cheryglsljs 1.1.11 → 1.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cherry.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
/*! For license information please see cherry.js.LICENSE.txt */
|
2
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Cherryglsl",[],e):"object"==typeof exports?exports.Cherryglsl=e():t.Cherryglsl=e()}(this,(()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{default:()=>Jn});function r(t=400,e=400){const r=new THREE.Scene,n=new THREE.PerspectiveCamera(75,window.innerWidth/window.innerHeight,.1,1e3),i=new THREE.WebGLRenderer({alpha:!1});return i.setSize(t,e),{Scene:r,camera:n,renderer:i}}function n(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function i(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var s,a,o,u,h,l,f,c,d,p,_,m,g,v,y,T,w,x={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},b={duration:.5,overwrite:!1,delay:0},M=1e8,O=1e-8,S=2*Math.PI,k=S/4,E=0,C=Math.sqrt,A=Math.cos,P=Math.sin,R=function(t){return"string"==typeof t},D=function(t){return"function"==typeof t},z=function(t){return"number"==typeof t},F=function(t){return void 0===t},L=function(t){return"object"==typeof t},I=function(t){return!1!==t},B=function(){return"undefined"!=typeof window},Y=function(t){return D(t)||R(t)},U="function"==typeof ArrayBuffer&&ArrayBuffer.isView||function(){},H=Array.isArray,N=/(?:-?\.?\d|\.)+/gi,X=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,j=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,q=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,V=/[+-]=-?[.\d]+/,W=/[^,'"\[\]\s]+/gi,G=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Q={},Z={},$=function(t){return(Z=kt(t,Q))&&Er},J=function(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")},K=function(t,e){return!e&&console.warn(t)},tt=function(t,e){return t&&(Q[t]=e)&&Z&&(Z[t]=e)||Q},et=function(){return 0},rt={suppressEvents:!0,isStart:!0,kill:!1},nt={suppressEvents:!0,kill:!1},it={suppressEvents:!0},st={},at=[],ot={},ut={},ht={},lt=30,ft=[],ct="",dt=function(t){var e,r,n=t[0];if(L(n)||D(n)||(t=[t]),!(e=(n._gsap||{}).harness)){for(r=ft.length;r--&&!ft[r].targetTest(n););e=ft[r]}for(r=t.length;r--;)t[r]&&(t[r]._gsap||(t[r]._gsap=new Ne(t[r],e)))||t.splice(r,1);return t},pt=function(t){return t._gsap||dt(se(t))[0]._gsap},_t=function(t,e,r){return(r=t[e])&&D(r)?t[e]():F(r)&&t.getAttribute&&t.getAttribute(e)||r},mt=function(t,e){return(t=t.split(",")).forEach(e)||t},gt=function(t){return Math.round(1e5*t)/1e5||0},vt=function(t){return Math.round(1e7*t)/1e7||0},yt=function(t,e){var r=e.charAt(0),n=parseFloat(e.substr(2));return t=parseFloat(t),"+"===r?t+n:"-"===r?t-n:"*"===r?t*n:t/n},Tt=function(t,e){for(var r=e.length,n=0;t.indexOf(e[n])<0&&++n<r;);return n<r},wt=function(){var t,e,r=at.length,n=at.slice(0);for(ot={},at.length=0,t=0;t<r;t++)(e=n[t])&&e._lazy&&(e.render(e._lazy[0],e._lazy[1],!0)._lazy=0)},xt=function(t){return!!(t._initted||t._startAt||t.add)},bt=function(t,e,r,n){at.length&&!a&&wt(),t.render(e,r,n||!!(a&&e<0&&xt(t))),at.length&&!a&&wt()},Mt=function(t){var e=parseFloat(t);return(e||0===e)&&(t+"").match(W).length<2?e:R(t)?t.trim():t},Ot=function(t){return t},St=function(t,e){for(var r in e)r in t||(t[r]=e[r]);return t},kt=function(t,e){for(var r in e)t[r]=e[r];return t},Et=function t(e,r){for(var n in r)"__proto__"!==n&&"constructor"!==n&&"prototype"!==n&&(e[n]=L(r[n])?t(e[n]||(e[n]={}),r[n]):r[n]);return e},Ct=function(t,e){var r,n={};for(r in t)r in e||(n[r]=t[r]);return n},At=function(t){var e,r=t.parent||u,n=t.keyframes?(e=H(t.keyframes),function(t,r){for(var n in r)n in t||"duration"===n&&e||"ease"===n||(t[n]=r[n])}):St;if(I(t.inherit))for(;r;)n(t,r.vars.defaults),r=r.parent||r._dp;return t},Pt=function(t,e,r,n,i){void 0===r&&(r="_first"),void 0===n&&(n="_last");var s,a=t[n];if(i)for(s=e[i];a&&a[i]>s;)a=a._prev;return a?(e._next=a._next,a._next=e):(e._next=t[r],t[r]=e),e._next?e._next._prev=e:t[n]=e,e._prev=a,e.parent=e._dp=t,e},Rt=function(t,e,r,n){void 0===r&&(r="_first"),void 0===n&&(n="_last");var i=e._prev,s=e._next;i?i._next=s:t[r]===e&&(t[r]=s),s?s._prev=i:t[n]===e&&(t[n]=i),e._next=e._prev=e.parent=null},Dt=function(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},zt=function(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var r=t;r;)r._dirty=1,r=r.parent;return t},Ft=function(t,e,r,n){return t._startAt&&(a?t._startAt.revert(nt):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,n))},Lt=function t(e){return!e||e._ts&&t(e.parent)},It=function(t){return t._repeat?Bt(t._tTime,t=t.duration()+t._rDelay)*t:0},Bt=function(t,e){var r=Math.floor(t=vt(t/e));return t&&r===t?r-1:r},Yt=function(t,e){return(t-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},Ut=function(t){return t._end=vt(t._start+(t._tDur/Math.abs(t._ts||t._rts||O)||0))},Ht=function(t,e){var r=t._dp;return r&&r.smoothChildTiming&&t._ts&&(t._start=vt(r._time-(t._ts>0?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),Ut(t),r._dirty||zt(r,t)),t},Nt=function(t,e){var r;if((e._time||!e._dur&&e._initted||e._start<t._time&&(e._dur||!e.add))&&(r=Yt(t.rawTime(),e),(!e._dur||te(0,e.totalDuration(),r)-e._tTime>O)&&e.render(r,!0)),zt(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(r=t;r._dp;)r.rawTime()>=0&&r.totalTime(r._tTime),r=r._dp;t._zTime=-1e-8}},Xt=function(t,e,r,n){return e.parent&&Dt(e),e._start=vt((z(r)?r:r||t!==u?$t(t,r,e):t._time)+e._delay),e._end=vt(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),Pt(t,e,"_first","_last",t._sort?"_start":0),Wt(e)||(t._recent=e),n||Nt(t,e),t._ts<0&&Ht(t,t._tTime),t},jt=function(t,e){return(Q.ScrollTrigger||J("scrollTrigger",e))&&Q.ScrollTrigger.create(e,t)},qt=function(t,e,r,n,i){return Ze(t,e,i),t._initted?!r&&t._pt&&!a&&(t._dur&&!1!==t.vars.lazy||!t._dur&&t.vars.lazy)&&d!==Ce.frame?(at.push(t),t._lazy=[i,n],1):void 0:1},Vt=function t(e){var r=e.parent;return r&&r._ts&&r._initted&&!r._lock&&(r.rawTime()<0||t(r))},Wt=function(t){var e=t.data;return"isFromStart"===e||"isStart"===e},Gt=function(t,e,r,n){var i=t._repeat,s=vt(e)||0,a=t._tTime/t._tDur;return a&&!n&&(t._time*=s/t._dur),t._dur=s,t._tDur=i?i<0?1e10:vt(s*(i+1)+t._rDelay*i):s,a>0&&!n&&Ht(t,t._tTime=t._tDur*a),t.parent&&Ut(t),r||zt(t.parent,t),t},Qt=function(t){return t instanceof je?zt(t):Gt(t,t._dur)},Zt={_start:0,endTime:et,totalDuration:et},$t=function t(e,r,n){var i,s,a,o=e.labels,u=e._recent||Zt,h=e.duration()>=M?u.endTime(!1):e._dur;return R(r)&&(isNaN(r)||r in o)?(s=r.charAt(0),a="%"===r.substr(-1),i=r.indexOf("="),"<"===s||">"===s?(i>=0&&(r=r.replace(/=/,"")),("<"===s?u._start:u.endTime(u._repeat>=0))+(parseFloat(r.substr(1))||0)*(a?(i<0?u:n).totalDuration()/100:1)):i<0?(r in o||(o[r]=h),o[r]):(s=parseFloat(r.charAt(i-1)+r.substr(i+1)),a&&n&&(s=s/100*(H(n)?n[0]:n).totalDuration()),i>1?t(e,r.substr(0,i-1),n)+s:h+s)):null==r?h:+r},Jt=function(t,e,r){var n,i,s=z(e[1]),a=(s?2:1)+(t<2?0:1),o=e[a];if(s&&(o.duration=e[1]),o.parent=r,t){for(n=o,i=r;i&&!("immediateRender"in n);)n=i.vars.defaults||{},i=I(i.vars.inherit)&&i.parent;o.immediateRender=I(n.immediateRender),t<2?o.runBackwards=1:o.startAt=e[a-1]}return new er(e[0],o,e[a+1])},Kt=function(t,e){return t||0===t?e(t):e},te=function(t,e,r){return r<t?t:r>e?e:r},ee=function(t,e){return R(t)&&(e=G.exec(t))?e[1]:""},re=[].slice,ne=function(t,e){return t&&L(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&L(t[0]))&&!t.nodeType&&t!==h},ie=function(t,e,r){return void 0===r&&(r=[]),t.forEach((function(t){var n;return R(t)&&!e||ne(t,1)?(n=r).push.apply(n,se(t)):r.push(t)}))||r},se=function(t,e,r){return o&&!e&&o.selector?o.selector(t):!R(t)||r||!l&&Ae()?H(t)?ie(t,r):ne(t)?re.call(t,0):t?[t]:[]:re.call((e||f).querySelectorAll(t),0)},ae=function(t){return t=se(t)[0]||K("Invalid scope")||{},function(e){var r=t.current||t.nativeElement||t;return se(e,r.querySelectorAll?r:r===t?K("Invalid scope")||f.createElement("div"):t)}},oe=function(t){return t.sort((function(){return.5-Math.random()}))},ue=function(t){if(D(t))return t;var e=L(t)?t:{each:t},r=Ie(e.ease),n=e.from||0,i=parseFloat(e.base)||0,s={},a=n>0&&n<1,o=isNaN(n)||a,u=e.axis,h=n,l=n;return R(n)?h=l={center:.5,edges:.5,end:1}[n]||0:!a&&o&&(h=n[0],l=n[1]),function(t,a,f){var c,d,p,_,m,g,v,y,T,w=(f||e).length,x=s[w];if(!x){if(!(T="auto"===e.grid?0:(e.grid||[1,M])[1])){for(v=-M;v<(v=f[T++].getBoundingClientRect().left)&&T<w;);T<w&&T--}for(x=s[w]=[],c=o?Math.min(T,w)*h-.5:n%T,d=T===M?0:o?w*l/T-.5:n/T|0,v=0,y=M,g=0;g<w;g++)p=g%T-c,_=d-(g/T|0),x[g]=m=u?Math.abs("y"===u?_:p):C(p*p+_*_),m>v&&(v=m),m<y&&(y=m);"random"===n&&oe(x),x.max=v-y,x.min=y,x.v=w=(parseFloat(e.amount)||parseFloat(e.each)*(T>w?w-1:u?"y"===u?w/T:T:Math.max(T,w/T))||0)*("edges"===n?-1:1),x.b=w<0?i-w:i,x.u=ee(e.amount||e.each)||0,r=r&&w<0?Fe(r):r}return w=(x[t]-x.min)/x.max||0,vt(x.b+(r?r(w):w)*x.v)+x.u}},he=function(t){var e=Math.pow(10,((t+"").split(".")[1]||"").length);return function(r){var n=vt(Math.round(parseFloat(r)/t)*t*e);return(n-n%1)/e+(z(r)?0:ee(r))}},le=function(t,e){var r,n,i=H(t);return!i&&L(t)&&(r=i=t.radius||M,t.values?(t=se(t.values),(n=!z(t[0]))&&(r*=r)):t=he(t.increment)),Kt(e,i?D(t)?function(e){return n=t(e),Math.abs(n-e)<=r?n:e}:function(e){for(var i,s,a=parseFloat(n?e.x:e),o=parseFloat(n?e.y:0),u=M,h=0,l=t.length;l--;)(i=n?(i=t[l].x-a)*i+(s=t[l].y-o)*s:Math.abs(t[l]-a))<u&&(u=i,h=l);return h=!r||u<=r?t[h]:e,n||h===e||z(e)?h:h+ee(e)}:he(t))},fe=function(t,e,r,n){return Kt(H(t)?!e:!0===r?!!(r=0):!n,(function(){return H(t)?t[~~(Math.random()*t.length)]:(r=r||1e-5)&&(n=r<1?Math.pow(10,(r+"").length-2):1)&&Math.floor(Math.round((t-r/2+Math.random()*(e-t+.99*r))/r)*r*n)/n}))},ce=function(t,e,r){return Kt(r,(function(r){return t[~~e(r)]}))},de=function(t){for(var e,r,n,i,s=0,a="";~(e=t.indexOf("random(",s));)n=t.indexOf(")",e),i="["===t.charAt(e+7),r=t.substr(e+7,n-e-7).match(i?W:N),a+=t.substr(s,e-s)+fe(i?r:+r[0],i?0:+r[1],+r[2]||1e-5),s=n+1;return a+t.substr(s,t.length-s)},pe=function(t,e,r,n,i){var s=e-t,a=n-r;return Kt(i,(function(e){return r+((e-t)/s*a||0)}))},_e=function(t,e,r){var n,i,s,a=t.labels,o=M;for(n in a)(i=a[n]-e)<0==!!r&&i&&o>(i=Math.abs(i))&&(s=n,o=i);return s},me=function(t,e,r){var n,i,s,a=t.vars,u=a[e],h=o,l=t._ctx;if(u)return n=a[e+"Params"],i=a.callbackScope||t,r&&at.length&&wt(),l&&(o=l),s=n?u.apply(i,n):u.call(i),o=h,s},ge=function(t){return Dt(t),t.scrollTrigger&&t.scrollTrigger.kill(!!a),t.progress()<1&&me(t,"onInterrupt"),t},ve=[],ye=function(t){if(t)if(t=!t.name&&t.default||t,B()||t.headless){var e=t.name,r=D(t),n=e&&!r&&t.init?function(){this._props=[]}:t,i={init:et,render:lr,add:Ge,kill:cr,modifier:fr,rawVars:0},s={targetTest:0,get:0,getSetter:ar,aliases:{},register:0};if(Ae(),t!==n){if(ut[e])return;St(n,St(Ct(t,i),s)),kt(n.prototype,kt(i,Ct(t,s))),ut[n.prop=e]=n,t.targetTest&&(ft.push(n),st[e]=1),e=("css"===e?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}tt(e,n),t.register&&t.register(Er,n,_r)}else ve.push(t)},Te=255,we={aqua:[0,Te,Te],lime:[0,Te,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Te],navy:[0,0,128],white:[Te,Te,Te],olive:[128,128,0],yellow:[Te,Te,0],orange:[Te,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Te,0,0],pink:[Te,192,203],cyan:[0,Te,Te],transparent:[Te,Te,Te,0]},xe=function(t,e,r){return(6*(t+=t<0?1:t>1?-1:0)<1?e+(r-e)*t*6:t<.5?r:3*t<2?e+(r-e)*(2/3-t)*6:e)*Te+.5|0},be=function(t,e,r){var n,i,s,a,o,u,h,l,f,c,d=t?z(t)?[t>>16,t>>8&Te,t&Te]:0:we.black;if(!d){if(","===t.substr(-1)&&(t=t.substr(0,t.length-1)),we[t])d=we[t];else if("#"===t.charAt(0)){if(t.length<6&&(n=t.charAt(1),i=t.charAt(2),s=t.charAt(3),t="#"+n+n+i+i+s+s+(5===t.length?t.charAt(4)+t.charAt(4):"")),9===t.length)return[(d=parseInt(t.substr(1,6),16))>>16,d>>8&Te,d&Te,parseInt(t.substr(7),16)/255];d=[(t=parseInt(t.substr(1),16))>>16,t>>8&Te,t&Te]}else if("hsl"===t.substr(0,3))if(d=c=t.match(N),e){if(~t.indexOf("="))return d=t.match(X),r&&d.length<4&&(d[3]=1),d}else a=+d[0]%360/360,o=+d[1]/100,n=2*(u=+d[2]/100)-(i=u<=.5?u*(o+1):u+o-u*o),d.length>3&&(d[3]*=1),d[0]=xe(a+1/3,n,i),d[1]=xe(a,n,i),d[2]=xe(a-1/3,n,i);else d=t.match(N)||we.transparent;d=d.map(Number)}return e&&!c&&(n=d[0]/Te,i=d[1]/Te,s=d[2]/Te,u=((h=Math.max(n,i,s))+(l=Math.min(n,i,s)))/2,h===l?a=o=0:(f=h-l,o=u>.5?f/(2-h-l):f/(h+l),a=h===n?(i-s)/f+(i<s?6:0):h===i?(s-n)/f+2:(n-i)/f+4,a*=60),d[0]=~~(a+.5),d[1]=~~(100*o+.5),d[2]=~~(100*u+.5)),r&&d.length<4&&(d[3]=1),d},Me=function(t){var e=[],r=[],n=-1;return t.split(Se).forEach((function(t){var i=t.match(j)||[];e.push.apply(e,i),r.push(n+=i.length+1)})),e.c=r,e},Oe=function(t,e,r){var n,i,s,a,o="",u=(t+o).match(Se),h=e?"hsla(":"rgba(",l=0;if(!u)return t;if(u=u.map((function(t){return(t=be(t,e,1))&&h+(e?t[0]+","+t[1]+"%,"+t[2]+"%,"+t[3]:t.join(","))+")"})),r&&(s=Me(t),(n=r.c).join(o)!==s.c.join(o)))for(a=(i=t.replace(Se,"1").split(j)).length-1;l<a;l++)o+=i[l]+(~n.indexOf(l)?u.shift()||h+"0,0,0,0)":(s.length?s:u.length?u:r).shift());if(!i)for(a=(i=t.split(Se)).length-1;l<a;l++)o+=i[l]+u[l];return o+i[a]},Se=function(){var t,e="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b";for(t in we)e+="|"+t+"\\b";return new RegExp(e+")","gi")}(),ke=/hsl[a]?\(/,Ee=function(t){var e,r=t.join(" ");if(Se.lastIndex=0,Se.test(r))return e=ke.test(r),t[1]=Oe(t[1],e),t[0]=Oe(t[0],e,Me(t[1])),!0},Ce=function(){var t,e,r,n,i,s,a=Date.now,o=500,u=33,d=a(),p=d,m=1e3/240,g=m,v=[],y=function r(h){var l,f,c,_,y=a()-p,T=!0===h;if((y>o||y<0)&&(d+=y-u),((l=(c=(p+=y)-d)-g)>0||T)&&(_=++n.frame,i=c-1e3*n.time,n.time=c/=1e3,g+=l+(l>=m?4:m-l),f=1),T||(t=e(r)),f)for(s=0;s<v.length;s++)v[s](c,i,_,h)};return n={time:0,frame:0,tick:function(){y(!0)},deltaRatio:function(t){return i/(1e3/(t||60))},wake:function(){c&&(!l&&B()&&(h=l=window,f=h.document||{},Q.gsap=Er,(h.gsapVersions||(h.gsapVersions=[])).push(Er.version),$(Z||h.GreenSockGlobals||!h.gsap&&h||{}),ve.forEach(ye)),r="undefined"!=typeof requestAnimationFrame&&requestAnimationFrame,t&&n.sleep(),e=r||function(t){return setTimeout(t,g-1e3*n.time+1|0)},_=1,y(2))},sleep:function(){(r?cancelAnimationFrame:clearTimeout)(t),_=0,e=et},lagSmoothing:function(t,e){o=t||1/0,u=Math.min(e||33,o)},fps:function(t){m=1e3/(t||240),g=1e3*n.time+m},add:function(t,e,r){var i=e?function(e,r,s,a){t(e,r,s,a),n.remove(i)}:t;return n.remove(t),v[r?"unshift":"push"](i),Ae(),i},remove:function(t,e){~(e=v.indexOf(t))&&v.splice(e,1)&&s>=e&&s--},_listeners:v}}(),Ae=function(){return!_&&Ce.wake()},Pe={},Re=/^[\d.\-M][\d.\-,\s]/,De=/["']/g,ze=function(t){for(var e,r,n,i={},s=t.substr(1,t.length-3).split(":"),a=s[0],o=1,u=s.length;o<u;o++)r=s[o],e=o!==u-1?r.lastIndexOf(","):r.length,n=r.substr(0,e),i[a]=isNaN(n)?n.replace(De,"").trim():+n,a=r.substr(e+1).trim();return i},Fe=function(t){return function(e){return 1-t(1-e)}},Le=function t(e,r){for(var n,i=e._first;i;)i instanceof je?t(i,r):!i.vars.yoyoEase||i._yoyo&&i._repeat||i._yoyo===r||(i.timeline?t(i.timeline,r):(n=i._ease,i._ease=i._yEase,i._yEase=n,i._yoyo=r)),i=i._next},Ie=function(t,e){return t&&(D(t)?t:Pe[t]||function(t){var e,r,n,i,s=(t+"").split("("),a=Pe[s[0]];return a&&s.length>1&&a.config?a.config.apply(null,~t.indexOf("{")?[ze(s[1])]:(e=t,r=e.indexOf("(")+1,n=e.indexOf(")"),i=e.indexOf("(",r),e.substring(r,~i&&i<n?e.indexOf(")",n+1):n)).split(",").map(Mt)):Pe._CE&&Re.test(t)?Pe._CE("",t):a}(t))||e},Be=function(t,e,r,n){void 0===r&&(r=function(t){return 1-e(1-t)}),void 0===n&&(n=function(t){return t<.5?e(2*t)/2:1-e(2*(1-t))/2});var i,s={easeIn:e,easeOut:r,easeInOut:n};return mt(t,(function(t){for(var e in Pe[t]=Q[t]=s,Pe[i=t.toLowerCase()]=r,s)Pe[i+("easeIn"===e?".in":"easeOut"===e?".out":".inOut")]=Pe[t+"."+e]=s[e]})),s},Ye=function(t){return function(e){return e<.5?(1-t(1-2*e))/2:.5+t(2*(e-.5))/2}},Ue=function t(e,r,n){var i=r>=1?r:1,s=(n||(e?.3:.45))/(r<1?r:1),a=s/S*(Math.asin(1/i)||0),o=function(t){return 1===t?1:i*Math.pow(2,-10*t)*P((t-a)*s)+1},u="out"===e?o:"in"===e?function(t){return 1-o(1-t)}:Ye(o);return s=S/s,u.config=function(r,n){return t(e,r,n)},u},He=function t(e,r){void 0===r&&(r=1.70158);var n=function(t){return t?--t*t*((r+1)*t+r)+1:0},i="out"===e?n:"in"===e?function(t){return 1-n(1-t)}:Ye(n);return i.config=function(r){return t(e,r)},i};mt("Linear,Quad,Cubic,Quart,Quint,Strong",(function(t,e){var r=e<5?e+1:e;Be(t+",Power"+(r-1),e?function(t){return Math.pow(t,r)}:function(t){return t},(function(t){return 1-Math.pow(1-t,r)}),(function(t){return t<.5?Math.pow(2*t,r)/2:1-Math.pow(2*(1-t),r)/2}))})),Pe.Linear.easeNone=Pe.none=Pe.Linear.easeIn,Be("Elastic",Ue("in"),Ue("out"),Ue()),m=7.5625,y=2*(v=1/(g=2.75)),T=2.5*v,Be("Bounce",(function(t){return 1-w(1-t)}),w=function(t){return t<v?m*t*t:t<y?m*Math.pow(t-1.5/g,2)+.75:t<T?m*(t-=2.25/g)*t+.9375:m*Math.pow(t-2.625/g,2)+.984375}),Be("Expo",(function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)})),Be("Circ",(function(t){return-(C(1-t*t)-1)})),Be("Sine",(function(t){return 1===t?1:1-A(t*k)})),Be("Back",He("in"),He("out"),He()),Pe.SteppedEase=Pe.steps=Q.SteppedEase={config:function(t,e){void 0===t&&(t=1);var r=1/t,n=t+(e?0:1),i=e?1:0;return function(t){return((n*te(0,.99999999,t)|0)+i)*r}}},b.ease=Pe["quad.out"],mt("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",(function(t){return ct+=t+","+t+"Params,"}));var Ne=function(t,e){this.id=E++,t._gsap=this,this.target=t,this.harness=e,this.get=e?e.get:_t,this.set=e?e.getSetter:ar},Xe=function(){function t(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,Gt(this,+t.duration,1,1),this.data=t.data,o&&(this._ctx=o,o.data.push(this)),_||Ce.wake()}var e=t.prototype;return e.delay=function(t){return t||0===t?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+t-this._delay),this._delay=t,this):this._delay},e.duration=function(t){return arguments.length?this.totalDuration(this._repeat>0?t+(t+this._rDelay)*this._repeat:t):this.totalDuration()&&this._dur},e.totalDuration=function(t){return arguments.length?(this._dirty=0,Gt(this,this._repeat<0?t:(t-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(t,e){if(Ae(),!arguments.length)return this._tTime;var r=this._dp;if(r&&r.smoothChildTiming&&this._ts){for(Ht(this,t),!r._dp||r.parent||Nt(r,this);r&&r.parent;)r.parent._time!==r._start+(r._ts>=0?r._tTime/r._ts:(r.totalDuration()-r._tTime)/-r._ts)&&r.totalTime(r._tTime,!0),r=r.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&t<this._tDur||this._ts<0&&t>0||!this._tDur&&!t)&&Xt(this._dp,this,this._start-this._delay)}return(this._tTime!==t||!this._dur&&!e||this._initted&&Math.abs(this._zTime)===O||!t&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=t),bt(this,t,e)),this},e.time=function(t,e){return arguments.length?this.totalTime(Math.min(this.totalDuration(),t+It(this))%(this._dur+this._rDelay)||(t?this._dur:0),e):this._time},e.totalProgress=function(t,e){return arguments.length?this.totalTime(this.totalDuration()*t,e):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},e.progress=function(t,e){return arguments.length?this.totalTime(this.duration()*(!this._yoyo||1&this.iteration()?t:1-t)+It(this),e):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(t,e){var r=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(t-1)*r,e):this._repeat?Bt(this._tTime,r)+1:1},e.timeScale=function(t,e){if(!arguments.length)return-1e-8===this._rts?0:this._rts;if(this._rts===t)return this;var r=this.parent&&this._ts?Yt(this.parent._time,this):this._tTime;return this._rts=+t||0,this._ts=this._ps||-1e-8===t?0:this._rts,this.totalTime(te(-Math.abs(this._delay),this.totalDuration(),r),!1!==e),Ut(this),function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t}(this)},e.paused=function(t){return arguments.length?(this._ps!==t&&(this._ps=t,t?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Ae(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,1===this.progress()&&Math.abs(this._zTime)!==O&&(this._tTime-=O)))),this):this._ps},e.startTime=function(t){if(arguments.length){this._start=t;var e=this.parent||this._dp;return e&&(e._sort||!this.parent)&&Xt(e,this,t-this._delay),this}return this._start},e.endTime=function(t){return this._start+(I(t)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(t){var e=this.parent||this._dp;return e?t&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Yt(e.rawTime(t),this):this._tTime:this._tTime},e.revert=function(t){void 0===t&&(t=it);var e=a;return a=t,xt(this)&&(this.timeline&&this.timeline.revert(t),this.totalTime(-.01,t.suppressEvents)),"nested"!==this.data&&!1!==t.kill&&this.kill(),a=e,this},e.globalTime=function(t){for(var e=this,r=arguments.length?t:e.rawTime();e;)r=e._start+r/(Math.abs(e._ts)||1),e=e._dp;return!this.parent&&this._sat?this._sat.globalTime(t):r},e.repeat=function(t){return arguments.length?(this._repeat=t===1/0?-2:t,Qt(this)):-2===this._repeat?1/0:this._repeat},e.repeatDelay=function(t){if(arguments.length){var e=this._time;return this._rDelay=t,Qt(this),e?this.time(e):this}return this._rDelay},e.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},e.seek=function(t,e){return this.totalTime($t(this,t),I(e))},e.restart=function(t,e){return this.play().totalTime(t?-this._delay:0,I(e)),this._dur||(this._zTime=-1e-8),this},e.play=function(t,e){return null!=t&&this.seek(t,e),this.reversed(!1).paused(!1)},e.reverse=function(t,e){return null!=t&&this.seek(t||this.totalDuration(),e),this.reversed(!0).paused(!1)},e.pause=function(t,e){return null!=t&&this.seek(t,e),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(t){return arguments.length?(!!t!==this.reversed()&&this.timeScale(-this._rts||(t?-1e-8:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-1e-8,this},e.isActive=function(){var t,e=this.parent||this._dp,r=this._start;return!(e&&!(this._ts&&this._initted&&e.isActive()&&(t=e.rawTime(!0))>=r&&t<this.endTime(!0)-O))},e.eventCallback=function(t,e,r){var n=this.vars;return arguments.length>1?(e?(n[t]=e,r&&(n[t+"Params"]=r),"onUpdate"===t&&(this._onUpdate=e)):delete n[t],this):n[t]},e.then=function(t){var e=this;return new Promise((function(r){var n=D(t)?t:Ot,i=function(){var t=e.then;e.then=null,D(n)&&(n=n(e))&&(n.then||n===e)&&(e.then=t),r(n),e.then=t};e._initted&&1===e.totalProgress()&&e._ts>=0||!e._tTime&&e._ts<0?i():e._prom=i}))},e.kill=function(){ge(this)},t}();St(Xe.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-1e-8,_prom:0,_ps:!1,_rts:1});var je=function(t){function e(e,r){var i;return void 0===e&&(e={}),(i=t.call(this,e)||this).labels={},i.smoothChildTiming=!!e.smoothChildTiming,i.autoRemoveChildren=!!e.autoRemoveChildren,i._sort=I(e.sortChildren),u&&Xt(e.parent||u,n(i),r),e.reversed&&i.reverse(),e.paused&&i.paused(!0),e.scrollTrigger&&jt(n(i),e.scrollTrigger),i}i(e,t);var r=e.prototype;return r.to=function(t,e,r){return Jt(0,arguments,this),this},r.from=function(t,e,r){return Jt(1,arguments,this),this},r.fromTo=function(t,e,r,n){return Jt(2,arguments,this),this},r.set=function(t,e,r){return e.duration=0,e.parent=this,At(e).repeatDelay||(e.repeat=0),e.immediateRender=!!e.immediateRender,new er(t,e,$t(this,r),1),this},r.call=function(t,e,r){return Xt(this,er.delayedCall(0,t,e),r)},r.staggerTo=function(t,e,r,n,i,s,a){return r.duration=e,r.stagger=r.stagger||n,r.onComplete=s,r.onCompleteParams=a,r.parent=this,new er(t,r,$t(this,i)),this},r.staggerFrom=function(t,e,r,n,i,s,a){return r.runBackwards=1,At(r).immediateRender=I(r.immediateRender),this.staggerTo(t,e,r,n,i,s,a)},r.staggerFromTo=function(t,e,r,n,i,s,a,o){return n.startAt=r,At(n).immediateRender=I(n.immediateRender),this.staggerTo(t,e,n,i,s,a,o)},r.render=function(t,e,r){var n,i,s,o,h,l,f,c,d,p,_,m,g=this._time,v=this._dirty?this.totalDuration():this._tDur,y=this._dur,T=t<=0?0:vt(t),w=this._zTime<0!=t<0&&(this._initted||!y);if(this!==u&&T>v&&t>=0&&(T=v),T!==this._tTime||r||w){if(g!==this._time&&y&&(T+=this._time-g,t+=this._time-g),n=T,d=this._start,l=!(c=this._ts),w&&(y||(g=this._zTime),(t||!e)&&(this._zTime=t)),this._repeat){if(_=this._yoyo,h=y+this._rDelay,this._repeat<-1&&t<0)return this.totalTime(100*h+t,e,r);if(n=vt(T%h),T===v?(o=this._repeat,n=y):((o=~~(p=vt(T/h)))&&o===p&&(n=y,o--),n>y&&(n=y)),p=Bt(this._tTime,h),!g&&this._tTime&&p!==o&&this._tTime-p*h-this._dur<=0&&(p=o),_&&1&o&&(n=y-n,m=1),o!==p&&!this._lock){var x=_&&1&p,b=x===(_&&1&o);if(o<p&&(x=!x),g=x?0:T%y?y:T,this._lock=1,this.render(g||(m?0:vt(o*h)),e,!y)._lock=0,this._tTime=T,!e&&this.parent&&me(this,"onRepeat"),this.vars.repeatRefresh&&!m&&(this.invalidate()._lock=1),g&&g!==this._time||l!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(y=this._dur,v=this._tDur,b&&(this._lock=2,g=x?y:-1e-4,this.render(g,!0),this.vars.repeatRefresh&&!m&&this.invalidate()),this._lock=0,!this._ts&&!l)return this;Le(this,m)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(f=function(t,e,r){var n;if(r>e)for(n=t._first;n&&n._start<=r;){if("isPause"===n.data&&n._start>e)return n;n=n._next}else for(n=t._last;n&&n._start>=r;){if("isPause"===n.data&&n._start<e)return n;n=n._prev}}(this,vt(g),vt(n)),f&&(T-=n-(n=f._start))),this._tTime=T,this._time=n,this._act=!c,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=t,g=0),!g&&T&&!e&&!p&&(me(this,"onStart"),this._tTime!==T))return this;if(n>=g&&t>=0)for(i=this._first;i;){if(s=i._next,(i._act||n>=i._start)&&i._ts&&f!==i){if(i.parent!==this)return this.render(t,e,r);if(i.render(i._ts>0?(n-i._start)*i._ts:(i._dirty?i.totalDuration():i._tDur)+(n-i._start)*i._ts,e,r),n!==this._time||!this._ts&&!l){f=0,s&&(T+=this._zTime=-1e-8);break}}i=s}else{i=this._last;for(var M=t<0?t:n;i;){if(s=i._prev,(i._act||M<=i._end)&&i._ts&&f!==i){if(i.parent!==this)return this.render(t,e,r);if(i.render(i._ts>0?(M-i._start)*i._ts:(i._dirty?i.totalDuration():i._tDur)+(M-i._start)*i._ts,e,r||a&&xt(i)),n!==this._time||!this._ts&&!l){f=0,s&&(T+=this._zTime=M?-1e-8:O);break}}i=s}}if(f&&!e&&(this.pause(),f.render(n>=g?0:-1e-8)._zTime=n>=g?1:-1,this._ts))return this._start=d,Ut(this),this.render(t,e,r);this._onUpdate&&!e&&me(this,"onUpdate",!0),(T===v&&this._tTime>=this.totalDuration()||!T&&g)&&(d!==this._start&&Math.abs(c)===Math.abs(this._ts)||this._lock||((t||!y)&&(T===v&&this._ts>0||!T&&this._ts<0)&&Dt(this,1),e||t<0&&!g||!T&&!g&&v||(me(this,T===v&&t>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(T<v&&this.timeScale()>0)&&this._prom())))}return this},r.add=function(t,e){var r=this;if(z(e)||(e=$t(this,e,t)),!(t instanceof Xe)){if(H(t))return t.forEach((function(t){return r.add(t,e)})),this;if(R(t))return this.addLabel(t,e);if(!D(t))return this;t=er.delayedCall(0,t)}return this!==t?Xt(this,t,e):this},r.getChildren=function(t,e,r,n){void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===r&&(r=!0),void 0===n&&(n=-M);for(var i=[],s=this._first;s;)s._start>=n&&(s instanceof er?e&&i.push(s):(r&&i.push(s),t&&i.push.apply(i,s.getChildren(!0,e,r)))),s=s._next;return i},r.getById=function(t){for(var e=this.getChildren(1,1,1),r=e.length;r--;)if(e[r].vars.id===t)return e[r]},r.remove=function(t){return R(t)?this.removeLabel(t):D(t)?this.killTweensOf(t):(t.parent===this&&Rt(this,t),t===this._recent&&(this._recent=this._last),zt(this))},r.totalTime=function(e,r){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=vt(Ce.time-(this._ts>0?e/this._ts:(this.totalDuration()-e)/-this._ts))),t.prototype.totalTime.call(this,e,r),this._forcing=0,this):this._tTime},r.addLabel=function(t,e){return this.labels[t]=$t(this,e),this},r.removeLabel=function(t){return delete this.labels[t],this},r.addPause=function(t,e,r){var n=er.delayedCall(0,e||et,r);return n.data="isPause",this._hasPause=1,Xt(this,n,$t(this,t))},r.removePause=function(t){var e=this._first;for(t=$t(this,t);e;)e._start===t&&"isPause"===e.data&&Dt(e),e=e._next},r.killTweensOf=function(t,e,r){for(var n=this.getTweensOf(t,r),i=n.length;i--;)qe!==n[i]&&n[i].kill(t,e);return this},r.getTweensOf=function(t,e){for(var r,n=[],i=se(t),s=this._first,a=z(e);s;)s instanceof er?Tt(s._targets,i)&&(a?(!qe||s._initted&&s._ts)&&s.globalTime(0)<=e&&s.globalTime(s.totalDuration())>e:!e||s.isActive())&&n.push(s):(r=s.getTweensOf(i,e)).length&&n.push.apply(n,r),s=s._next;return n},r.tweenTo=function(t,e){e=e||{};var r,n=this,i=$t(n,t),s=e,a=s.startAt,o=s.onStart,u=s.onStartParams,h=s.immediateRender,l=er.to(n,St({ease:e.ease||"none",lazy:!1,immediateRender:!1,time:i,overwrite:"auto",duration:e.duration||Math.abs((i-(a&&"time"in a?a.time:n._time))/n.timeScale())||O,onStart:function(){if(n.pause(),!r){var t=e.duration||Math.abs((i-(a&&"time"in a?a.time:n._time))/n.timeScale());l._dur!==t&&Gt(l,t,0,1).render(l._time,!0,!0),r=1}o&&o.apply(l,u||[])}},e));return h?l.render(0):l},r.tweenFromTo=function(t,e,r){return this.tweenTo(e,St({startAt:{time:$t(this,t)}},r))},r.recent=function(){return this._recent},r.nextLabel=function(t){return void 0===t&&(t=this._time),_e(this,$t(this,t))},r.previousLabel=function(t){return void 0===t&&(t=this._time),_e(this,$t(this,t),1)},r.currentLabel=function(t){return arguments.length?this.seek(t,!0):this.previousLabel(this._time+O)},r.shiftChildren=function(t,e,r){void 0===r&&(r=0);for(var n,i=this._first,s=this.labels;i;)i._start>=r&&(i._start+=t,i._end+=t),i=i._next;if(e)for(n in s)s[n]>=r&&(s[n]+=t);return zt(this)},r.invalidate=function(e){var r=this._first;for(this._lock=0;r;)r.invalidate(e),r=r._next;return t.prototype.invalidate.call(this,e)},r.clear=function(t){void 0===t&&(t=!0);for(var e,r=this._first;r;)e=r._next,this.remove(r),r=e;return this._dp&&(this._time=this._tTime=this._pTime=0),t&&(this.labels={}),zt(this)},r.totalDuration=function(t){var e,r,n,i=0,s=this,a=s._last,o=M;if(arguments.length)return s.timeScale((s._repeat<0?s.duration():s.totalDuration())/(s.reversed()?-t:t));if(s._dirty){for(n=s.parent;a;)e=a._prev,a._dirty&&a.totalDuration(),(r=a._start)>o&&s._sort&&a._ts&&!s._lock?(s._lock=1,Xt(s,a,r-a._delay,1)._lock=0):o=r,r<0&&a._ts&&(i-=r,(!n&&!s._dp||n&&n.smoothChildTiming)&&(s._start+=r/s._ts,s._time-=r,s._tTime-=r),s.shiftChildren(-r,!1,-Infinity),o=0),a._end>i&&a._ts&&(i=a._end),a=e;Gt(s,s===u&&s._time>i?s._time:i,1,1),s._dirty=0}return s._tDur},e.updateRoot=function(t){if(u._ts&&(bt(u,Yt(t,u)),d=Ce.frame),Ce.frame>=lt){lt+=x.autoSleep||120;var e=u._first;if((!e||!e._ts)&&x.autoSleep&&Ce._listeners.length<2){for(;e&&!e._ts;)e=e._next;e||Ce.sleep()}}},e}(Xe);St(je.prototype,{_lock:0,_hasPause:0,_forcing:0});var qe,Ve,We=function(t,e,r,n,i,s,a){var o,u,h,l,f,c,d,p,_=new _r(this._pt,t,e,0,1,hr,null,i),m=0,g=0;for(_.b=r,_.e=n,r+="",(d=~(n+="").indexOf("random("))&&(n=de(n)),s&&(s(p=[r,n],t,e),r=p[0],n=p[1]),u=r.match(q)||[];o=q.exec(n);)l=o[0],f=n.substring(m,o.index),h?h=(h+1)%5:"rgba("===f.substr(-5)&&(h=1),l!==u[g++]&&(c=parseFloat(u[g-1])||0,_._pt={_next:_._pt,p:f||1===g?f:",",s:c,c:"="===l.charAt(1)?yt(c,l)-c:parseFloat(l)-c,m:h&&h<4?Math.round:0},m=q.lastIndex);return _.c=m<n.length?n.substring(m,n.length):"",_.fp=a,(V.test(n)||d)&&(_.e=0),this._pt=_,_},Ge=function(t,e,r,n,i,s,a,o,u,h){D(n)&&(n=n(i||0,t,s));var l,f=t[e],c="get"!==r?r:D(f)?u?t[e.indexOf("set")||!D(t["get"+e.substr(3)])?e:"get"+e.substr(3)](u):t[e]():f,d=D(f)?u?ir:nr:rr;if(R(n)&&(~n.indexOf("random(")&&(n=de(n)),"="===n.charAt(1)&&((l=yt(c,n)+(ee(c)||0))||0===l)&&(n=l)),!h||c!==n||Ve)return isNaN(c*n)||""===n?(!f&&!(e in t)&&J(e,n),We.call(this,t,e,c,n,d,o||x.stringFilter,u)):(l=new _r(this._pt,t,e,+c||0,n-(c||0),"boolean"==typeof f?ur:or,0,d),u&&(l.fp=u),a&&l.modifier(a,this,t),this._pt=l)},Qe=function(t,e,r,n,i,s){var a,o,u,h;if(ut[t]&&!1!==(a=new ut[t]).init(i,a.rawVars?e[t]:function(t,e,r,n,i){if(D(t)&&(t=Je(t,i,e,r,n)),!L(t)||t.style&&t.nodeType||H(t)||U(t))return R(t)?Je(t,i,e,r,n):t;var s,a={};for(s in t)a[s]=Je(t[s],i,e,r,n);return a}(e[t],n,i,s,r),r,n,s)&&(r._pt=o=new _r(r._pt,i,t,0,1,a.render,a,0,a.priority),r!==p))for(u=r._ptLookup[r._targets.indexOf(i)],h=a._props.length;h--;)u[a._props[h]]=o;return a},Ze=function t(e,r,n){var i,o,h,l,f,c,d,p,_,m,g,v,y,T=e.vars,w=T.ease,x=T.startAt,S=T.immediateRender,k=T.lazy,E=T.onUpdate,C=T.runBackwards,A=T.yoyoEase,P=T.keyframes,R=T.autoRevert,D=e._dur,z=e._startAt,F=e._targets,L=e.parent,B=L&&"nested"===L.data?L.vars.targets:F,Y="auto"===e._overwrite&&!s,U=e.timeline;if(U&&(!P||!w)&&(w="none"),e._ease=Ie(w,b.ease),e._yEase=A?Fe(Ie(!0===A?w:A,b.ease)):0,A&&e._yoyo&&!e._repeat&&(A=e._yEase,e._yEase=e._ease,e._ease=A),e._from=!U&&!!T.runBackwards,!U||P&&!T.stagger){if(v=(p=F[0]?pt(F[0]).harness:0)&&T[p.prop],i=Ct(T,st),z&&(z._zTime<0&&z.progress(1),r<0&&C&&S&&!R?z.render(-1,!0):z.revert(C&&D?nt:rt),z._lazy=0),x){if(Dt(e._startAt=er.set(F,St({data:"isStart",overwrite:!1,parent:L,immediateRender:!0,lazy:!z&&I(k),startAt:null,delay:0,onUpdate:E&&function(){return me(e,"onUpdate")},stagger:0},x))),e._startAt._dp=0,e._startAt._sat=e,r<0&&(a||!S&&!R)&&e._startAt.revert(nt),S&&D&&r<=0&&n<=0)return void(r&&(e._zTime=r))}else if(C&&D&&!z)if(r&&(S=!1),h=St({overwrite:!1,data:"isFromStart",lazy:S&&!z&&I(k),immediateRender:S,stagger:0,parent:L},i),v&&(h[p.prop]=v),Dt(e._startAt=er.set(F,h)),e._startAt._dp=0,e._startAt._sat=e,r<0&&(a?e._startAt.revert(nt):e._startAt.render(-1,!0)),e._zTime=r,S){if(!r)return}else t(e._startAt,O,O);for(e._pt=e._ptCache=0,k=D&&I(k)||k&&!D,o=0;o<F.length;o++){if(d=(f=F[o])._gsap||dt(F)[o]._gsap,e._ptLookup[o]=m={},ot[d.id]&&at.length&&wt(),g=B===F?o:B.indexOf(f),p&&!1!==(_=new p).init(f,v||i,e,g,B)&&(e._pt=l=new _r(e._pt,f,_.name,0,1,_.render,_,0,_.priority),_._props.forEach((function(t){m[t]=l})),_.priority&&(c=1)),!p||v)for(h in i)ut[h]&&(_=Qe(h,i,e,g,f,B))?_.priority&&(c=1):m[h]=l=Ge.call(e,f,h,"get",i[h],g,B,0,T.stringFilter);e._op&&e._op[o]&&e.kill(f,e._op[o]),Y&&e._pt&&(qe=e,u.killTweensOf(f,m,e.globalTime(r)),y=!e.parent,qe=0),e._pt&&k&&(ot[d.id]=1)}c&&pr(e),e._onInit&&e._onInit(e)}e._onUpdate=E,e._initted=(!e._op||e._pt)&&!y,P&&r<=0&&U.render(M,!0,!0)},$e=function(t,e,r,n){var i,s,a=e.ease||n||"power1.inOut";if(H(e))s=r[t]||(r[t]=[]),e.forEach((function(t,r){return s.push({t:r/(e.length-1)*100,v:t,e:a})}));else for(i in e)s=r[i]||(r[i]=[]),"ease"===i||s.push({t:parseFloat(t),v:e[i],e:a})},Je=function(t,e,r,n,i){return D(t)?t.call(e,r,n,i):R(t)&&~t.indexOf("random(")?de(t):t},Ke=ct+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",tr={};mt(Ke+",id,stagger,delay,duration,paused,scrollTrigger",(function(t){return tr[t]=1}));var er=function(t){function e(e,r,i,a){var o;"number"==typeof r&&(i.duration=r,r=i,i=null);var h,l,f,c,d,p,_,m,g=(o=t.call(this,a?r:At(r))||this).vars,v=g.duration,y=g.delay,T=g.immediateRender,w=g.stagger,b=g.overwrite,M=g.keyframes,O=g.defaults,S=g.scrollTrigger,k=g.yoyoEase,E=r.parent||u,C=(H(e)||U(e)?z(e[0]):"length"in r)?[e]:se(e);if(o._targets=C.length?dt(C):K("GSAP target "+e+" not found. https://gsap.com",!x.nullTargetWarn)||[],o._ptLookup=[],o._overwrite=b,M||w||Y(v)||Y(y)){if(r=o.vars,(h=o.timeline=new je({data:"nested",defaults:O||{},targets:E&&"nested"===E.data?E.vars.targets:C})).kill(),h.parent=h._dp=n(o),h._start=0,w||Y(v)||Y(y)){if(c=C.length,_=w&&ue(w),L(w))for(d in w)~Ke.indexOf(d)&&(m||(m={}),m[d]=w[d]);for(l=0;l<c;l++)(f=Ct(r,tr)).stagger=0,k&&(f.yoyoEase=k),m&&kt(f,m),p=C[l],f.duration=+Je(v,n(o),l,p,C),f.delay=(+Je(y,n(o),l,p,C)||0)-o._delay,!w&&1===c&&f.delay&&(o._delay=y=f.delay,o._start+=y,f.delay=0),h.to(p,f,_?_(l,p,C):0),h._ease=Pe.none;h.duration()?v=y=0:o.timeline=0}else if(M){At(St(h.vars.defaults,{ease:"none"})),h._ease=Ie(M.ease||r.ease||"none");var A,P,R,D=0;if(H(M))M.forEach((function(t){return h.to(C,t,">")})),h.duration();else{for(d in f={},M)"ease"===d||"easeEach"===d||$e(d,M[d],f,M.easeEach);for(d in f)for(A=f[d].sort((function(t,e){return t.t-e.t})),D=0,l=0;l<A.length;l++)(R={ease:(P=A[l]).e,duration:(P.t-(l?A[l-1].t:0))/100*v})[d]=P.v,h.to(C,R,D),D+=R.duration;h.duration()<v&&h.to({},{duration:v-h.duration()})}}v||o.duration(v=h.duration())}else o.timeline=0;return!0!==b||s||(qe=n(o),u.killTweensOf(C),qe=0),Xt(E,n(o),i),r.reversed&&o.reverse(),r.paused&&o.paused(!0),(T||!v&&!M&&o._start===vt(E._time)&&I(T)&&Lt(n(o))&&"nested"!==E.data)&&(o._tTime=-1e-8,o.render(Math.max(0,-y)||0)),S&&jt(n(o),S),o}i(e,t);var r=e.prototype;return r.render=function(t,e,r){var n,i,s,o,u,h,l,f,c,d=this._time,p=this._tDur,_=this._dur,m=t<0,g=t>p-O&&!m?p:t<O?0:t;if(_){if(g!==this._tTime||!t||r||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==m||this._lazy){if(n=g,f=this.timeline,this._repeat){if(o=_+this._rDelay,this._repeat<-1&&m)return this.totalTime(100*o+t,e,r);if(n=vt(g%o),g===p?(s=this._repeat,n=_):(s=~~(u=vt(g/o)))&&s===u?(n=_,s--):n>_&&(n=_),(h=this._yoyo&&1&s)&&(c=this._yEase,n=_-n),u=Bt(this._tTime,o),n===d&&!r&&this._initted&&s===u)return this._tTime=g,this;s!==u&&(f&&this._yEase&&Le(f,h),this.vars.repeatRefresh&&!h&&!this._lock&&n!==o&&this._initted&&(this._lock=r=1,this.render(vt(o*s),!0).invalidate()._lock=0))}if(!this._initted){if(qt(this,m?t:n,r,e,g))return this._tTime=0,this;if(!(d===this._time||r&&this.vars.repeatRefresh&&s!==u))return this;if(_!==this._dur)return this.render(t,e,r)}if(this._tTime=g,this._time=n,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=l=(c||this._ease)(n/_),this._from&&(this.ratio=l=1-l),!d&&g&&!e&&!u&&(me(this,"onStart"),this._tTime!==g))return this;for(i=this._pt;i;)i.r(l,i.d),i=i._next;f&&f.render(t<0?t:f._dur*f._ease(n/this._dur),e,r)||this._startAt&&(this._zTime=t),this._onUpdate&&!e&&(m&&Ft(this,t,0,r),me(this,"onUpdate")),this._repeat&&s!==u&&this.vars.onRepeat&&!e&&this.parent&&me(this,"onRepeat"),g!==this._tDur&&g||this._tTime!==g||(m&&!this._onUpdate&&Ft(this,t,0,!0),(t||!_)&&(g===this._tDur&&this._ts>0||!g&&this._ts<0)&&Dt(this,1),e||m&&!d||!(g||d||h)||(me(this,g===p?"onComplete":"onReverseComplete",!0),this._prom&&!(g<p&&this.timeScale()>0)&&this._prom()))}}else!function(t,e,r,n){var i,s,o,u=t.ratio,h=e<0||!e&&(!t._start&&Vt(t)&&(t._initted||!Wt(t))||(t._ts<0||t._dp._ts<0)&&!Wt(t))?0:1,l=t._rDelay,f=0;if(l&&t._repeat&&(f=te(0,t._tDur,e),s=Bt(f,l),t._yoyo&&1&s&&(h=1-h),s!==Bt(t._tTime,l)&&(u=1-h,t.vars.repeatRefresh&&t._initted&&t.invalidate())),h!==u||a||n||t._zTime===O||!e&&t._zTime){if(!t._initted&&qt(t,e,n,r,f))return;for(o=t._zTime,t._zTime=e||(r?O:0),r||(r=e&&!o),t.ratio=h,t._from&&(h=1-h),t._time=0,t._tTime=f,i=t._pt;i;)i.r(h,i.d),i=i._next;e<0&&Ft(t,e,0,!0),t._onUpdate&&!r&&me(t,"onUpdate"),f&&t._repeat&&!r&&t.parent&&me(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===h&&(h&&Dt(t,1),r||a||(me(t,h?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)}(this,t,e,r);return this},r.targets=function(){return this._targets},r.invalidate=function(e){return(!e||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(e),t.prototype.invalidate.call(this,e)},r.resetTo=function(t,e,r,n,i){_||Ce.wake(),this._ts||this.play();var s=Math.min(this._dur,(this._dp._time-this._start)*this._ts);return this._initted||Ze(this,s),function(t,e,r,n,i,s,a,o){var u,h,l,f,c=(t._pt&&t._ptCache||(t._ptCache={}))[e];if(!c)for(c=t._ptCache[e]=[],l=t._ptLookup,f=t._targets.length;f--;){if((u=l[f][e])&&u.d&&u.d._pt)for(u=u.d._pt;u&&u.p!==e&&u.fp!==e;)u=u._next;if(!u)return Ve=1,t.vars[e]="+=0",Ze(t,a),Ve=0,o?K(e+" not eligible for reset"):1;c.push(u)}for(f=c.length;f--;)(u=(h=c[f])._pt||h).s=!n&&0!==n||i?u.s+(n||0)+s*u.c:n,u.c=r-u.s,h.e&&(h.e=gt(r)+ee(h.e)),h.b&&(h.b=u.s+ee(h.b))}(this,t,e,r,n,this._ease(s/this._dur),s,i)?this.resetTo(t,e,r,n,1):(Ht(this,0),this.parent||Pt(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},r.kill=function(t,e){if(void 0===e&&(e="all"),!(t||e&&"all"!==e))return this._lazy=this._pt=0,this.parent?ge(this):this.scrollTrigger&&this.scrollTrigger.kill(!!a),this;if(this.timeline){var r=this.timeline.totalDuration();return this.timeline.killTweensOf(t,e,qe&&!0!==qe.vars.overwrite)._first||ge(this),this.parent&&r!==this.timeline.totalDuration()&&Gt(this,this._dur*this.timeline._tDur/r,0,1),this}var n,i,s,o,u,h,l,f=this._targets,c=t?se(t):f,d=this._ptLookup,p=this._pt;if((!e||"all"===e)&&function(t,e){for(var r=t.length,n=r===e.length;n&&r--&&t[r]===e[r];);return r<0}(f,c))return"all"===e&&(this._pt=0),ge(this);for(n=this._op=this._op||[],"all"!==e&&(R(e)&&(u={},mt(e,(function(t){return u[t]=1})),e=u),e=function(t,e){var r,n,i,s,a=t[0]?pt(t[0]).harness:0,o=a&&a.aliases;if(!o)return e;for(n in r=kt({},e),o)if(n in r)for(i=(s=o[n].split(",")).length;i--;)r[s[i]]=r[n];return r}(f,e)),l=f.length;l--;)if(~c.indexOf(f[l]))for(u in i=d[l],"all"===e?(n[l]=e,o=i,s={}):(s=n[l]=n[l]||{},o=e),o)(h=i&&i[u])&&("kill"in h.d&&!0!==h.d.kill(u)||Rt(this,h,"_pt"),delete i[u]),"all"!==s&&(s[u]=1);return this._initted&&!this._pt&&p&&ge(this),this},e.to=function(t,r){return new e(t,r,arguments[2])},e.from=function(t,e){return Jt(1,arguments)},e.delayedCall=function(t,r,n,i){return new e(r,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:t,onComplete:r,onReverseComplete:r,onCompleteParams:n,onReverseCompleteParams:n,callbackScope:i})},e.fromTo=function(t,e,r){return Jt(2,arguments)},e.set=function(t,r){return r.duration=0,r.repeatDelay||(r.repeat=0),new e(t,r)},e.killTweensOf=function(t,e,r){return u.killTweensOf(t,e,r)},e}(Xe);St(er.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),mt("staggerTo,staggerFrom,staggerFromTo",(function(t){er[t]=function(){var e=new je,r=re.call(arguments,0);return r.splice("staggerFromTo"===t?5:4,0,0),e[t].apply(e,r)}}));var rr=function(t,e,r){return t[e]=r},nr=function(t,e,r){return t[e](r)},ir=function(t,e,r,n){return t[e](n.fp,r)},sr=function(t,e,r){return t.setAttribute(e,r)},ar=function(t,e){return D(t[e])?nr:F(t[e])&&t.setAttribute?sr:rr},or=function(t,e){return e.set(e.t,e.p,Math.round(1e6*(e.s+e.c*t))/1e6,e)},ur=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},hr=function(t,e){var r=e._pt,n="";if(!t&&e.b)n=e.b;else if(1===t&&e.e)n=e.e;else{for(;r;)n=r.p+(r.m?r.m(r.s+r.c*t):Math.round(1e4*(r.s+r.c*t))/1e4)+n,r=r._next;n+=e.c}e.set(e.t,e.p,n,e)},lr=function(t,e){for(var r=e._pt;r;)r.r(t,r.d),r=r._next},fr=function(t,e,r,n){for(var i,s=this._pt;s;)i=s._next,s.p===n&&s.modifier(t,e,r),s=i},cr=function(t){for(var e,r,n=this._pt;n;)r=n._next,n.p===t&&!n.op||n.op===t?Rt(this,n,"_pt"):n.dep||(e=1),n=r;return!e},dr=function(t,e,r,n){n.mSet(t,e,n.m.call(n.tween,r,n.mt),n)},pr=function(t){for(var e,r,n,i,s=t._pt;s;){for(e=s._next,r=n;r&&r.pr>s.pr;)r=r._next;(s._prev=r?r._prev:i)?s._prev._next=s:n=s,(s._next=r)?r._prev=s:i=s,s=e}t._pt=n},_r=function(){function t(t,e,r,n,i,s,a,o,u){this.t=e,this.s=n,this.c=i,this.p=r,this.r=s||or,this.d=a||this,this.set=o||rr,this.pr=u||0,this._next=t,t&&(t._prev=this)}return t.prototype.modifier=function(t,e,r){this.mSet=this.mSet||this.set,this.set=dr,this.m=t,this.mt=r,this.tween=e},t}();mt(ct+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",(function(t){return st[t]=1})),Q.TweenMax=Q.TweenLite=er,Q.TimelineLite=Q.TimelineMax=je,u=new je({sortChildren:!1,defaults:b,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),x.stringFilter=Ee;var mr=[],gr={},vr=[],yr=0,Tr=0,wr=function(t){return(gr[t]||vr).map((function(t){return t()}))},xr=function(){var t=Date.now(),e=[];t-yr>2&&(wr("matchMediaInit"),mr.forEach((function(t){var r,n,i,s,a=t.queries,o=t.conditions;for(n in a)(r=h.matchMedia(a[n]).matches)&&(i=1),r!==o[n]&&(o[n]=r,s=1);s&&(t.revert(),i&&e.push(t))})),wr("matchMediaRevert"),e.forEach((function(t){return t.onMatch(t,(function(e){return t.add(null,e)}))})),yr=t,wr("matchMedia"))},br=function(){function t(t,e){this.selector=e&&ae(e),this.data=[],this._r=[],this.isReverted=!1,this.id=Tr++,t&&this.add(t)}var e=t.prototype;return e.add=function(t,e,r){D(t)&&(r=e,e=t,t=D);var n=this,i=function(){var t,i=o,s=n.selector;return i&&i!==n&&i.data.push(n),r&&(n.selector=ae(r)),o=n,t=e.apply(n,arguments),D(t)&&n._r.push(t),o=i,n.selector=s,n.isReverted=!1,t};return n.last=i,t===D?i(n,(function(t){return n.add(null,t)})):t?n[t]=i:i},e.ignore=function(t){var e=o;o=null,t(this),o=e},e.getTweens=function(){var e=[];return this.data.forEach((function(r){return r instanceof t?e.push.apply(e,r.getTweens()):r instanceof er&&!(r.parent&&"nested"===r.parent.data)&&e.push(r)})),e},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(t,e){var r=this;if(t?function(){for(var e,n=r.getTweens(),i=r.data.length;i--;)"isFlip"===(e=r.data[i]).data&&(e.revert(),e.getChildren(!0,!0,!1).forEach((function(t){return n.splice(n.indexOf(t),1)})));for(n.map((function(t){return{g:t._dur||t._delay||t._sat&&!t._sat.vars.immediateRender?t.globalTime(0):-1/0,t}})).sort((function(t,e){return e.g-t.g||-1/0})).forEach((function(e){return e.t.revert(t)})),i=r.data.length;i--;)(e=r.data[i])instanceof je?"nested"!==e.data&&(e.scrollTrigger&&e.scrollTrigger.revert(),e.kill()):!(e instanceof er)&&e.revert&&e.revert(t);r._r.forEach((function(e){return e(t,r)})),r.isReverted=!0}():this.data.forEach((function(t){return t.kill&&t.kill()})),this.clear(),e)for(var n=mr.length;n--;)mr[n].id===this.id&&mr.splice(n,1)},e.revert=function(t){this.kill(t||{})},t}(),Mr=function(){function t(t){this.contexts=[],this.scope=t,o&&o.data.push(this)}var e=t.prototype;return e.add=function(t,e,r){L(t)||(t={matches:t});var n,i,s,a=new br(0,r||this.scope),u=a.conditions={};for(i in o&&!a.selector&&(a.selector=o.selector),this.contexts.push(a),e=a.add("onMatch",e),a.queries=t,t)"all"===i?s=1:(n=h.matchMedia(t[i]))&&(mr.indexOf(a)<0&&mr.push(a),(u[i]=n.matches)&&(s=1),n.addListener?n.addListener(xr):n.addEventListener("change",xr));return s&&e(a,(function(t){return a.add(null,t)})),this},e.revert=function(t){this.kill(t||{})},e.kill=function(t){this.contexts.forEach((function(e){return e.kill(t,!0)}))},t}(),Or={registerPlugin:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];e.forEach((function(t){return ye(t)}))},timeline:function(t){return new je(t)},getTweensOf:function(t,e){return u.getTweensOf(t,e)},getProperty:function(t,e,r,n){R(t)&&(t=se(t)[0]);var i=pt(t||{}).get,s=r?Ot:Mt;return"native"===r&&(r=""),t?e?s((ut[e]&&ut[e].get||i)(t,e,r,n)):function(e,r,n){return s((ut[e]&&ut[e].get||i)(t,e,r,n))}:t},quickSetter:function(t,e,r){if((t=se(t)).length>1){var n=t.map((function(t){return Er.quickSetter(t,e,r)})),i=n.length;return function(t){for(var e=i;e--;)n[e](t)}}t=t[0]||{};var s=ut[e],a=pt(t),o=a.harness&&(a.harness.aliases||{})[e]||e,u=s?function(e){var n=new s;p._pt=0,n.init(t,r?e+r:e,p,0,[t]),n.render(1,n),p._pt&&lr(1,p)}:a.set(t,o);return s?u:function(e){return u(t,o,r?e+r:e,a,1)}},quickTo:function(t,e,r){var n,i=Er.to(t,St(((n={})[e]="+=0.1",n.paused=!0,n.stagger=0,n),r||{})),s=function(t,r,n){return i.resetTo(e,t,r,n)};return s.tween=i,s},isTweening:function(t){return u.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=Ie(t.ease,b.ease)),Et(b,t||{})},config:function(t){return Et(x,t||{})},registerEffect:function(t){var e=t.name,r=t.effect,n=t.plugins,i=t.defaults,s=t.extendTimeline;(n||"").split(",").forEach((function(t){return t&&!ut[t]&&!Q[t]&&K(e+" effect requires "+t+" plugin.")})),ht[e]=function(t,e,n){return r(se(t),St(e||{},i),n)},s&&(je.prototype[e]=function(t,r,n){return this.add(ht[e](t,L(r)?r:(n=r)&&{},this),n)})},registerEase:function(t,e){Pe[t]=Ie(e)},parseEase:function(t,e){return arguments.length?Ie(t,e):Pe},getById:function(t){return u.getById(t)},exportRoot:function(t,e){void 0===t&&(t={});var r,n,i=new je(t);for(i.smoothChildTiming=I(t.smoothChildTiming),u.remove(i),i._dp=0,i._time=i._tTime=u._time,r=u._first;r;)n=r._next,!e&&!r._dur&&r instanceof er&&r.vars.onComplete===r._targets[0]||Xt(i,r,r._start-r._delay),r=n;return Xt(u,i,0),i},context:function(t,e){return t?new br(t,e):o},matchMedia:function(t){return new Mr(t)},matchMediaRefresh:function(){return mr.forEach((function(t){var e,r,n=t.conditions;for(r in n)n[r]&&(n[r]=!1,e=1);e&&t.revert()}))||xr()},addEventListener:function(t,e){var r=gr[t]||(gr[t]=[]);~r.indexOf(e)||r.push(e)},removeEventListener:function(t,e){var r=gr[t],n=r&&r.indexOf(e);n>=0&&r.splice(n,1)},utils:{wrap:function t(e,r,n){var i=r-e;return H(e)?ce(e,t(0,e.length),r):Kt(n,(function(t){return(i+(t-e)%i)%i+e}))},wrapYoyo:function t(e,r,n){var i=r-e,s=2*i;return H(e)?ce(e,t(0,e.length-1),r):Kt(n,(function(t){return e+((t=(s+(t-e)%s)%s||0)>i?s-t:t)}))},distribute:ue,random:fe,snap:le,normalize:function(t,e,r){return pe(t,e,0,1,r)},getUnit:ee,clamp:function(t,e,r){return Kt(r,(function(r){return te(t,e,r)}))},splitColor:be,toArray:se,selector:ae,mapRange:pe,pipe:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(t){return e.reduce((function(t,e){return e(t)}),t)}},unitize:function(t,e){return function(r){return t(parseFloat(r))+(e||ee(r))}},interpolate:function t(e,r,n,i){var s=isNaN(e+r)?0:function(t){return(1-t)*e+t*r};if(!s){var a,o,u,h,l,f=R(e),c={};if(!0===n&&(i=1)&&(n=null),f)e={p:e},r={p:r};else if(H(e)&&!H(r)){for(u=[],h=e.length,l=h-2,o=1;o<h;o++)u.push(t(e[o-1],e[o]));h--,s=function(t){t*=h;var e=Math.min(l,~~t);return u[e](t-e)},n=r}else i||(e=kt(H(e)?[]:{},e));if(!u){for(a in r)Ge.call(c,e,a,"get",r[a]);s=function(t){return lr(t,c)||(f?e.p:e)}}}return Kt(n,s)},shuffle:oe},install:$,effects:ht,ticker:Ce,updateRoot:je.updateRoot,plugins:ut,globalTimeline:u,core:{PropTween:_r,globals:tt,Tween:er,Timeline:je,Animation:Xe,getCache:pt,_removeLinkedListItem:Rt,reverting:function(){return a},context:function(t){return t&&o&&(o.data.push(t),t._ctx=o),o},suppressOverwrites:function(t){return s=t}}};mt("to,from,fromTo,delayedCall,set,killTweensOf",(function(t){return Or[t]=er[t]})),Ce.add(je.updateRoot),p=Or.to({},{duration:0});var Sr=function(t,e){for(var r=t._pt;r&&r.p!==e&&r.op!==e&&r.fp!==e;)r=r._next;return r},kr=function(t,e){return{name:t,headless:1,rawVars:1,init:function(t,r,n){n._onInit=function(t){var n,i;if(R(r)&&(n={},mt(r,(function(t){return n[t]=1})),r=n),e){for(i in n={},r)n[i]=e(r[i]);r=n}!function(t,e){var r,n,i,s=t._targets;for(r in e)for(n=s.length;n--;)(i=t._ptLookup[n][r])&&(i=i.d)&&(i._pt&&(i=Sr(i,r)),i&&i.modifier&&i.modifier(e[r],t,s[n],r))}(t,r)}}}},Er=Or.registerPlugin({name:"attr",init:function(t,e,r,n,i){var s,a,o;for(s in this.tween=r,e)o=t.getAttribute(s)||"",(a=this.add(t,"setAttribute",(o||0)+"",e[s],n,i,0,0,s)).op=s,a.b=o,this._props.push(s)},render:function(t,e){for(var r=e._pt;r;)a?r.set(r.t,r.p,r.b,r):r.r(t,r.d),r=r._next}},{name:"endArray",headless:1,init:function(t,e){for(var r=e.length;r--;)this.add(t,r,t[r]||0,e[r],0,0,0,0,0,1)}},kr("roundProps",he),kr("modifiers"),kr("snap",le))||Or;er.version=je.version=Er.version="3.13.0",c=1,B()&&Ae();Pe.Power0,Pe.Power1,Pe.Power2,Pe.Power3,Pe.Power4,Pe.Linear,Pe.Quad,Pe.Cubic,Pe.Quart,Pe.Quint,Pe.Strong,Pe.Elastic,Pe.Back,Pe.SteppedEase,Pe.Bounce,Pe.Sine,Pe.Expo,Pe.Circ;var Cr,Ar,Pr,Rr,Dr,zr,Fr,Lr,Ir={},Br=180/Math.PI,Yr=Math.PI/180,Ur=Math.atan2,Hr=/([A-Z])/g,Nr=/(left|right|width|margin|padding|x)/i,Xr=/[\s,\(]\S/,jr={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},qr=function(t,e){return e.set(e.t,e.p,Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)},Vr=function(t,e){return e.set(e.t,e.p,1===t?e.e:Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)},Wr=function(t,e){return e.set(e.t,e.p,t?Math.round(1e4*(e.s+e.c*t))/1e4+e.u:e.b,e)},Gr=function(t,e){var r=e.s+e.c*t;e.set(e.t,e.p,~~(r+(r<0?-.5:.5))+e.u,e)},Qr=function(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)},Zr=function(t,e){return e.set(e.t,e.p,1!==t?e.b:e.e,e)},$r=function(t,e,r){return t.style[e]=r},Jr=function(t,e,r){return t.style.setProperty(e,r)},Kr=function(t,e,r){return t._gsap[e]=r},tn=function(t,e,r){return t._gsap.scaleX=t._gsap.scaleY=r},en=function(t,e,r,n,i){var s=t._gsap;s.scaleX=s.scaleY=r,s.renderTransform(i,s)},rn=function(t,e,r,n,i){var s=t._gsap;s[e]=r,s.renderTransform(i,s)},nn="transform",sn=nn+"Origin",an=function t(e,r){var n=this,i=this.target,s=i.style,a=i._gsap;if(e in Ir&&s){if(this.tfm=this.tfm||{},"transform"===e)return jr.transform.split(",").forEach((function(e){return t.call(n,e,r)}));if(~(e=jr[e]||e).indexOf(",")?e.split(",").forEach((function(t){return n.tfm[t]=Mn(i,t)})):this.tfm[e]=a.x?a[e]:Mn(i,e),e===sn&&(this.tfm.zOrigin=a.zOrigin),this.props.indexOf(nn)>=0)return;a.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(sn,r,"")),e=nn}(s||r)&&this.props.push(e,r,s[e])},on=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},un=function(){var t,e,r=this.props,n=this.target,i=n.style,s=n._gsap;for(t=0;t<r.length;t+=3)r[t+1]?2===r[t+1]?n[r[t]](r[t+2]):n[r[t]]=r[t+2]:r[t+2]?i[r[t]]=r[t+2]:i.removeProperty("--"===r[t].substr(0,2)?r[t]:r[t].replace(Hr,"-$1").toLowerCase());if(this.tfm){for(e in this.tfm)s[e]=this.tfm[e];s.svg&&(s.renderTransform(),n.setAttribute("data-svg-origin",this.svgo||"")),(t=Fr())&&t.isStart||i[nn]||(on(i),s.zOrigin&&i[sn]&&(i[sn]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},hn=function(t,e){var r={target:t,props:[],revert:un,save:an};return t._gsap||Er.core.getCache(t),e&&t.style&&t.nodeType&&e.split(",").forEach((function(t){return r.save(t)})),r},ln=function(t,e){var r=Ar.createElementNS?Ar.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):Ar.createElement(t);return r&&r.style?r:Ar.createElement(t)},fn=function t(e,r,n){var i=getComputedStyle(e);return i[r]||i.getPropertyValue(r.replace(Hr,"-$1").toLowerCase())||i.getPropertyValue(r)||!n&&t(e,dn(r)||r,1)||""},cn="O,Moz,ms,Ms,Webkit".split(","),dn=function(t,e,r){var n=(e||Dr).style,i=5;if(t in n&&!r)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);i--&&!(cn[i]+t in n););return i<0?null:(3===i?"ms":i>=0?cn[i]:"")+t},pn=function(){"undefined"!=typeof window&&window.document&&(Cr=window,Ar=Cr.document,Pr=Ar.documentElement,Dr=ln("div")||{style:{}},ln("div"),nn=dn(nn),sn=nn+"Origin",Dr.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Lr=!!dn("perspective"),Fr=Er.core.reverting,Rr=1)},_n=function(t){var e,r=t.ownerSVGElement,n=ln("svg",r&&r.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=t.cloneNode(!0);i.style.display="block",n.appendChild(i),Pr.appendChild(n);try{e=i.getBBox()}catch(t){}return n.removeChild(i),Pr.removeChild(n),e},mn=function(t,e){for(var r=e.length;r--;)if(t.hasAttribute(e[r]))return t.getAttribute(e[r])},gn=function(t){var e,r;try{e=t.getBBox()}catch(n){e=_n(t),r=1}return e&&(e.width||e.height)||r||(e=_n(t)),!e||e.width||e.x||e.y?e:{x:+mn(t,["x","cx","x1"])||0,y:+mn(t,["y","cy","y1"])||0,width:0,height:0}},vn=function(t){return!(!t.getCTM||t.parentNode&&!t.ownerSVGElement||!gn(t))},yn=function(t,e){if(e){var r,n=t.style;e in Ir&&e!==sn&&(e=nn),n.removeProperty?("ms"!==(r=e.substr(0,2))&&"webkit"!==e.substr(0,6)||(e="-"+e),n.removeProperty("--"===r?e:e.replace(Hr,"-$1").toLowerCase())):n.removeAttribute(e)}},Tn=function(t,e,r,n,i,s){var a=new _r(t._pt,e,r,0,1,s?Zr:Qr);return t._pt=a,a.b=n,a.e=i,t._props.push(r),a},wn={deg:1,rad:1,turn:1},xn={grid:1,flex:1},bn=function t(e,r,n,i){var s,a,o,u,h=parseFloat(n)||0,l=(n+"").trim().substr((h+"").length)||"px",f=Dr.style,c=Nr.test(r),d="svg"===e.tagName.toLowerCase(),p=(d?"client":"offset")+(c?"Width":"Height"),_=100,m="px"===i,g="%"===i;if(i===l||!h||wn[i]||wn[l])return h;if("px"!==l&&!m&&(h=t(e,r,n,"px")),u=e.getCTM&&vn(e),(g||"%"===l)&&(Ir[r]||~r.indexOf("adius")))return s=u?e.getBBox()[c?"width":"height"]:e[p],gt(g?h/s*_:h/100*s);if(f[c?"width":"height"]=_+(m?l:i),a="rem"!==i&&~r.indexOf("adius")||"em"===i&&e.appendChild&&!d?e:e.parentNode,u&&(a=(e.ownerSVGElement||{}).parentNode),a&&a!==Ar&&a.appendChild||(a=Ar.body),(o=a._gsap)&&g&&o.width&&c&&o.time===Ce.time&&!o.uncache)return gt(h/o.width*_);if(!g||"height"!==r&&"width"!==r)(g||"%"===l)&&!xn[fn(a,"display")]&&(f.position=fn(e,"position")),a===e&&(f.position="static"),a.appendChild(Dr),s=Dr[p],a.removeChild(Dr),f.position="absolute";else{var v=e.style[r];e.style[r]=_+i,s=e[p],v?e.style[r]=v:yn(e,r)}return c&&g&&((o=pt(a)).time=Ce.time,o.width=a[p]),gt(m?s*h/_:s&&h?_/s*h:0)},Mn=function(t,e,r,n){var i;return Rr||pn(),e in jr&&"transform"!==e&&~(e=jr[e]).indexOf(",")&&(e=e.split(",")[0]),Ir[e]&&"transform"!==e?(i=Fn(t,n),i="transformOrigin"!==e?i[e]:i.svg?i.origin:Ln(fn(t,sn))+" "+i.zOrigin+"px"):(!(i=t.style[e])||"auto"===i||n||~(i+"").indexOf("calc("))&&(i=En[e]&&En[e](t,e,r)||fn(t,e)||_t(t,e)||("opacity"===e?1:0)),r&&!~(i+"").trim().indexOf(" ")?bn(t,e,i,r)+r:i},On=function(t,e,r,n){if(!r||"none"===r){var i=dn(e,t,1),s=i&&fn(t,i,1);s&&s!==r?(e=i,r=s):"borderColor"===e&&(r=fn(t,"borderTopColor"))}var a,o,u,h,l,f,c,d,p,_,m,g=new _r(this._pt,t.style,e,0,1,hr),v=0,y=0;if(g.b=r,g.e=n,r+="","var(--"===(n+="").substring(0,6)&&(n=fn(t,n.substring(4,n.indexOf(")")))),"auto"===n&&(f=t.style[e],t.style[e]=n,n=fn(t,e)||n,f?t.style[e]=f:yn(t,e)),Ee(a=[r,n]),n=a[1],u=(r=a[0]).match(j)||[],(n.match(j)||[]).length){for(;o=j.exec(n);)c=o[0],p=n.substring(v,o.index),l?l=(l+1)%5:"rgba("!==p.substr(-5)&&"hsla("!==p.substr(-5)||(l=1),c!==(f=u[y++]||"")&&(h=parseFloat(f)||0,m=f.substr((h+"").length),"="===c.charAt(1)&&(c=yt(h,c)+m),d=parseFloat(c),_=c.substr((d+"").length),v=j.lastIndex-_.length,_||(_=_||x.units[e]||m,v===n.length&&(n+=_,g.e+=_)),m!==_&&(h=bn(t,e,f,_)||0),g._pt={_next:g._pt,p:p||1===y?p:",",s:h,c:d-h,m:l&&l<4||"zIndex"===e?Math.round:0});g.c=v<n.length?n.substring(v,n.length):""}else g.r="display"===e&&"none"===n?Zr:Qr;return V.test(n)&&(g.e=0),this._pt=g,g},Sn={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},kn=function(t,e){if(e.tween&&e.tween._time===e.tween._dur){var r,n,i,s=e.t,a=s.style,o=e.u,u=s._gsap;if("all"===o||!0===o)a.cssText="",n=1;else for(i=(o=o.split(",")).length;--i>-1;)r=o[i],Ir[r]&&(n=1,r="transformOrigin"===r?sn:nn),yn(s,r);n&&(yn(s,nn),u&&(u.svg&&s.removeAttribute("transform"),a.scale=a.rotate=a.translate="none",Fn(s,1),u.uncache=1,on(a)))}},En={clearProps:function(t,e,r,n,i){if("isFromStart"!==i.data){var s=t._pt=new _r(t._pt,e,r,0,0,kn);return s.u=n,s.pr=-10,s.tween=i,t._props.push(r),1}}},Cn=[1,0,0,1,0,0],An={},Pn=function(t){return"matrix(1, 0, 0, 1, 0, 0)"===t||"none"===t||!t},Rn=function(t){var e=fn(t,nn);return Pn(e)?Cn:e.substr(7).match(X).map(gt)},Dn=function(t,e){var r,n,i,s,a=t._gsap||pt(t),o=t.style,u=Rn(t);return a.svg&&t.getAttribute("transform")?"1,0,0,1,0,0"===(u=[(i=t.transform.baseVal.consolidate().matrix).a,i.b,i.c,i.d,i.e,i.f]).join(",")?Cn:u:(u!==Cn||t.offsetParent||t===Pr||a.svg||(i=o.display,o.display="block",(r=t.parentNode)&&(t.offsetParent||t.getBoundingClientRect().width)||(s=1,n=t.nextElementSibling,Pr.appendChild(t)),u=Rn(t),i?o.display=i:yn(t,"display"),s&&(n?r.insertBefore(t,n):r?r.appendChild(t):Pr.removeChild(t))),e&&u.length>6?[u[0],u[1],u[4],u[5],u[12],u[13]]:u)},zn=function(t,e,r,n,i,s){var a,o,u,h=t._gsap,l=i||Dn(t,!0),f=h.xOrigin||0,c=h.yOrigin||0,d=h.xOffset||0,p=h.yOffset||0,_=l[0],m=l[1],g=l[2],v=l[3],y=l[4],T=l[5],w=e.split(" "),x=parseFloat(w[0])||0,b=parseFloat(w[1])||0;r?l!==Cn&&(o=_*v-m*g)&&(u=x*(-m/o)+b*(_/o)-(_*T-m*y)/o,x=x*(v/o)+b*(-g/o)+(g*T-v*y)/o,b=u):(x=(a=gn(t)).x+(~w[0].indexOf("%")?x/100*a.width:x),b=a.y+(~(w[1]||w[0]).indexOf("%")?b/100*a.height:b)),n||!1!==n&&h.smooth?(y=x-f,T=b-c,h.xOffset=d+(y*_+T*g)-y,h.yOffset=p+(y*m+T*v)-T):h.xOffset=h.yOffset=0,h.xOrigin=x,h.yOrigin=b,h.smooth=!!n,h.origin=e,h.originIsAbsolute=!!r,t.style[sn]="0px 0px",s&&(Tn(s,h,"xOrigin",f,x),Tn(s,h,"yOrigin",c,b),Tn(s,h,"xOffset",d,h.xOffset),Tn(s,h,"yOffset",p,h.yOffset)),t.setAttribute("data-svg-origin",x+" "+b)},Fn=function(t,e){var r=t._gsap||new Ne(t);if("x"in r&&!e&&!r.uncache)return r;var n,i,s,a,o,u,h,l,f,c,d,p,_,m,g,v,y,T,w,b,M,O,S,k,E,C,A,P,R,D,z,F,L=t.style,I=r.scaleX<0,B="px",Y="deg",U=getComputedStyle(t),H=fn(t,sn)||"0";return n=i=s=u=h=l=f=c=d=0,a=o=1,r.svg=!(!t.getCTM||!vn(t)),U.translate&&("none"===U.translate&&"none"===U.scale&&"none"===U.rotate||(L[nn]=("none"!==U.translate?"translate3d("+(U.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+("none"!==U.rotate?"rotate("+U.rotate+") ":"")+("none"!==U.scale?"scale("+U.scale.split(" ").join(",")+") ":"")+("none"!==U[nn]?U[nn]:"")),L.scale=L.rotate=L.translate="none"),m=Dn(t,r.svg),r.svg&&(r.uncache?(E=t.getBBox(),H=r.xOrigin-E.x+"px "+(r.yOrigin-E.y)+"px",k=""):k=!e&&t.getAttribute("data-svg-origin"),zn(t,k||H,!!k||r.originIsAbsolute,!1!==r.smooth,m)),p=r.xOrigin||0,_=r.yOrigin||0,m!==Cn&&(T=m[0],w=m[1],b=m[2],M=m[3],n=O=m[4],i=S=m[5],6===m.length?(a=Math.sqrt(T*T+w*w),o=Math.sqrt(M*M+b*b),u=T||w?Ur(w,T)*Br:0,(f=b||M?Ur(b,M)*Br+u:0)&&(o*=Math.abs(Math.cos(f*Yr))),r.svg&&(n-=p-(p*T+_*b),i-=_-(p*w+_*M))):(F=m[6],D=m[7],A=m[8],P=m[9],R=m[10],z=m[11],n=m[12],i=m[13],s=m[14],h=(g=Ur(F,R))*Br,g&&(k=O*(v=Math.cos(-g))+A*(y=Math.sin(-g)),E=S*v+P*y,C=F*v+R*y,A=O*-y+A*v,P=S*-y+P*v,R=F*-y+R*v,z=D*-y+z*v,O=k,S=E,F=C),l=(g=Ur(-b,R))*Br,g&&(v=Math.cos(-g),z=M*(y=Math.sin(-g))+z*v,T=k=T*v-A*y,w=E=w*v-P*y,b=C=b*v-R*y),u=(g=Ur(w,T))*Br,g&&(k=T*(v=Math.cos(g))+w*(y=Math.sin(g)),E=O*v+S*y,w=w*v-T*y,S=S*v-O*y,T=k,O=E),h&&Math.abs(h)+Math.abs(u)>359.9&&(h=u=0,l=180-l),a=gt(Math.sqrt(T*T+w*w+b*b)),o=gt(Math.sqrt(S*S+F*F)),g=Ur(O,S),f=Math.abs(g)>2e-4?g*Br:0,d=z?1/(z<0?-z:z):0),r.svg&&(k=t.getAttribute("transform"),r.forceCSS=t.setAttribute("transform","")||!Pn(fn(t,nn)),k&&t.setAttribute("transform",k))),Math.abs(f)>90&&Math.abs(f)<270&&(I?(a*=-1,f+=u<=0?180:-180,u+=u<=0?180:-180):(o*=-1,f+=f<=0?180:-180)),e=e||r.uncache,r.x=n-((r.xPercent=n&&(!e&&r.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-n)?-50:0)))?t.offsetWidth*r.xPercent/100:0)+B,r.y=i-((r.yPercent=i&&(!e&&r.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-i)?-50:0)))?t.offsetHeight*r.yPercent/100:0)+B,r.z=s+B,r.scaleX=gt(a),r.scaleY=gt(o),r.rotation=gt(u)+Y,r.rotationX=gt(h)+Y,r.rotationY=gt(l)+Y,r.skewX=f+Y,r.skewY=c+Y,r.transformPerspective=d+B,(r.zOrigin=parseFloat(H.split(" ")[2])||!e&&r.zOrigin||0)&&(L[sn]=Ln(H)),r.xOffset=r.yOffset=0,r.force3D=x.force3D,r.renderTransform=r.svg?Xn:Lr?Nn:Bn,r.uncache=0,r},Ln=function(t){return(t=t.split(" "))[0]+" "+t[1]},In=function(t,e,r){var n=ee(e);return gt(parseFloat(e)+parseFloat(bn(t,"x",r+"px",n)))+n},Bn=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,Nn(t,e)},Yn="0deg",Un="0px",Hn=") ",Nn=function(t,e){var r=e||this,n=r.xPercent,i=r.yPercent,s=r.x,a=r.y,o=r.z,u=r.rotation,h=r.rotationY,l=r.rotationX,f=r.skewX,c=r.skewY,d=r.scaleX,p=r.scaleY,_=r.transformPerspective,m=r.force3D,g=r.target,v=r.zOrigin,y="",T="auto"===m&&t&&1!==t||!0===m;if(v&&(l!==Yn||h!==Yn)){var w,x=parseFloat(h)*Yr,b=Math.sin(x),M=Math.cos(x);x=parseFloat(l)*Yr,w=Math.cos(x),s=In(g,s,b*w*-v),a=In(g,a,-Math.sin(x)*-v),o=In(g,o,M*w*-v+v)}_!==Un&&(y+="perspective("+_+Hn),(n||i)&&(y+="translate("+n+"%, "+i+"%) "),(T||s!==Un||a!==Un||o!==Un)&&(y+=o!==Un||T?"translate3d("+s+", "+a+", "+o+") ":"translate("+s+", "+a+Hn),u!==Yn&&(y+="rotate("+u+Hn),h!==Yn&&(y+="rotateY("+h+Hn),l!==Yn&&(y+="rotateX("+l+Hn),f===Yn&&c===Yn||(y+="skew("+f+", "+c+Hn),1===d&&1===p||(y+="scale("+d+", "+p+Hn),g.style[nn]=y||"translate(0, 0)"},Xn=function(t,e){var r,n,i,s,a,o=e||this,u=o.xPercent,h=o.yPercent,l=o.x,f=o.y,c=o.rotation,d=o.skewX,p=o.skewY,_=o.scaleX,m=o.scaleY,g=o.target,v=o.xOrigin,y=o.yOrigin,T=o.xOffset,w=o.yOffset,x=o.forceCSS,b=parseFloat(l),M=parseFloat(f);c=parseFloat(c),d=parseFloat(d),(p=parseFloat(p))&&(d+=p=parseFloat(p),c+=p),c||d?(c*=Yr,d*=Yr,r=Math.cos(c)*_,n=Math.sin(c)*_,i=Math.sin(c-d)*-m,s=Math.cos(c-d)*m,d&&(p*=Yr,a=Math.tan(d-p),i*=a=Math.sqrt(1+a*a),s*=a,p&&(a=Math.tan(p),r*=a=Math.sqrt(1+a*a),n*=a)),r=gt(r),n=gt(n),i=gt(i),s=gt(s)):(r=_,s=m,n=i=0),(b&&!~(l+"").indexOf("px")||M&&!~(f+"").indexOf("px"))&&(b=bn(g,"x",l,"px"),M=bn(g,"y",f,"px")),(v||y||T||w)&&(b=gt(b+v-(v*r+y*i)+T),M=gt(M+y-(v*n+y*s)+w)),(u||h)&&(a=g.getBBox(),b=gt(b+u/100*a.width),M=gt(M+h/100*a.height)),a="matrix("+r+","+n+","+i+","+s+","+b+","+M+")",g.setAttribute("transform",a),x&&(g.style[nn]=a)},jn=function(t,e,r,n,i){var s,a,o=360,u=R(i),h=parseFloat(i)*(u&&~i.indexOf("rad")?Br:1)-n,l=n+h+"deg";return u&&("short"===(s=i.split("_")[1])&&(h%=o)!==h%180&&(h+=h<0?o:-360),"cw"===s&&h<0?h=(h+36e9)%o-~~(h/o)*o:"ccw"===s&&h>0&&(h=(h-36e9)%o-~~(h/o)*o)),t._pt=a=new _r(t._pt,e,r,n,h,Vr),a.e=l,a.u="deg",t._props.push(r),a},qn=function(t,e){for(var r in e)t[r]=e[r];return t},Vn=function(t,e,r){var n,i,s,a,o,u,h,l=qn({},r._gsap),f=r.style;for(i in l.svg?(s=r.getAttribute("transform"),r.setAttribute("transform",""),f[nn]=e,n=Fn(r,1),yn(r,nn),r.setAttribute("transform",s)):(s=getComputedStyle(r)[nn],f[nn]=e,n=Fn(r,1),f[nn]=s),Ir)(s=l[i])!==(a=n[i])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(i)<0&&(o=ee(s)!==(h=ee(a))?bn(r,i,s,h):parseFloat(s),u=parseFloat(a),t._pt=new _r(t._pt,n,i,o,u-o,qr),t._pt.u=h||0,t._props.push(i));qn(n,l)};mt("padding,margin,Width,Radius",(function(t,e){var r="Top",n="Right",i="Bottom",s="Left",a=(e<3?[r,n,i,s]:[r+s,r+n,i+n,i+s]).map((function(r){return e<2?t+r:"border"+r+t}));En[e>1?"border"+t:t]=function(t,e,r,n,i){var s,o;if(arguments.length<4)return s=a.map((function(e){return Mn(t,e,r)})),5===(o=s.join(" ")).split(s[0]).length?s[0]:o;s=(n+"").split(" "),o={},a.forEach((function(t,e){return o[t]=s[e]=s[e]||s[(e-1)/2|0]})),t.init(e,o,i)}}));var Wn,Gn,Qn,Zn={name:"css",register:pn,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,r,n,i){var s,a,o,u,h,l,f,c,d,p,_,m,g,v,y,T,w,b,M,O,S=this._props,k=t.style,E=r.vars.startAt;for(f in Rr||pn(),this.styles=this.styles||hn(t),T=this.styles.props,this.tween=r,e)if("autoRound"!==f&&(a=e[f],!ut[f]||!Qe(f,e,r,n,t,i)))if(h=typeof a,l=En[f],"function"===h&&(h=typeof(a=a.call(r,n,t,i))),"string"===h&&~a.indexOf("random(")&&(a=de(a)),l)l(this,t,f,a,r)&&(y=1);else if("--"===f.substr(0,2))s=(getComputedStyle(t).getPropertyValue(f)+"").trim(),a+="",Se.lastIndex=0,Se.test(s)||(c=ee(s),d=ee(a)),d?c!==d&&(s=bn(t,f,s,d)+d):c&&(a+=c),this.add(k,"setProperty",s,a,n,i,0,0,f),S.push(f),T.push(f,0,k[f]);else if("undefined"!==h){if(E&&f in E?(s="function"==typeof E[f]?E[f].call(r,n,t,i):E[f],R(s)&&~s.indexOf("random(")&&(s=de(s)),ee(s+"")||"auto"===s||(s+=x.units[f]||ee(Mn(t,f))||""),"="===(s+"").charAt(1)&&(s=Mn(t,f))):s=Mn(t,f),u=parseFloat(s),(p="string"===h&&"="===a.charAt(1)&&a.substr(0,2))&&(a=a.substr(2)),o=parseFloat(a),f in jr&&("autoAlpha"===f&&(1===u&&"hidden"===Mn(t,"visibility")&&o&&(u=0),T.push("visibility",0,k.visibility),Tn(this,k,"visibility",u?"inherit":"hidden",o?"inherit":"hidden",!o)),"scale"!==f&&"transform"!==f&&~(f=jr[f]).indexOf(",")&&(f=f.split(",")[0])),_=f in Ir)if(this.styles.save(f),"string"===h&&"var(--"===a.substring(0,6)&&(a=fn(t,a.substring(4,a.indexOf(")"))),o=parseFloat(a)),m||((g=t._gsap).renderTransform&&!e.parseTransform||Fn(t,e.parseTransform),v=!1!==e.smoothOrigin&&g.smooth,(m=this._pt=new _r(this._pt,k,nn,0,1,g.renderTransform,g,0,-1)).dep=1),"scale"===f)this._pt=new _r(this._pt,g,"scaleY",g.scaleY,(p?yt(g.scaleY,p+o):o)-g.scaleY||0,qr),this._pt.u=0,S.push("scaleY",f),f+="X";else{if("transformOrigin"===f){T.push(sn,0,k[sn]),b=void 0,M=void 0,O=void 0,b=(w=a).split(" "),M=b[0],O=b[1]||"50%","top"!==M&&"bottom"!==M&&"left"!==O&&"right"!==O||(w=M,M=O,O=w),b[0]=Sn[M]||M,b[1]=Sn[O]||O,a=b.join(" "),g.svg?zn(t,a,0,v,0,this):((d=parseFloat(a.split(" ")[2])||0)!==g.zOrigin&&Tn(this,g,"zOrigin",g.zOrigin,d),Tn(this,k,f,Ln(s),Ln(a)));continue}if("svgOrigin"===f){zn(t,a,1,v,0,this);continue}if(f in An){jn(this,g,f,u,p?yt(u,p+a):a);continue}if("smoothOrigin"===f){Tn(this,g,"smooth",g.smooth,a);continue}if("force3D"===f){g[f]=a;continue}if("transform"===f){Vn(this,a,t);continue}}else f in k||(f=dn(f)||f);if(_||(o||0===o)&&(u||0===u)&&!Xr.test(a)&&f in k)o||(o=0),(c=(s+"").substr((u+"").length))!==(d=ee(a)||(f in x.units?x.units[f]:c))&&(u=bn(t,f,s,d)),this._pt=new _r(this._pt,_?g:k,f,u,(p?yt(u,p+o):o)-u,_||"px"!==d&&"zIndex"!==f||!1===e.autoRound?qr:Gr),this._pt.u=d||0,c!==d&&"%"!==d&&(this._pt.b=s,this._pt.r=Wr);else if(f in k)On.call(this,t,f,s,p?p+a:a);else if(f in t)this.add(t,f,s||t[f],p?p+a:a,n,i);else if("parseTransform"!==f){J(f,a);continue}_||(f in k?T.push(f,0,k[f]):"function"==typeof t[f]?T.push(f,2,t[f]()):T.push(f,1,s||t[f])),S.push(f)}y&&pr(this)},render:function(t,e){if(e.tween._time||!Fr())for(var r=e._pt;r;)r.r(t,r.d),r=r._next;else e.styles.revert()},get:Mn,aliases:jr,getSetter:function(t,e,r){var n=jr[e];return n&&n.indexOf(",")<0&&(e=n),e in Ir&&e!==sn&&(t._gsap.x||Mn(t,"x"))?r&&zr===r?"scale"===e?tn:Kr:(zr=r||{})&&("scale"===e?en:rn):t.style&&!F(t.style[e])?$r:~e.indexOf("-")?Jr:ar(t,e)},core:{_removeProperty:yn,_getMatrix:Dn}};Er.utils.checkPrefix=dn,Er.core.getStyleSaver=hn,Qn=mt((Wn="x,y,z,scale,scaleX,scaleY,xPercent,yPercent")+","+(Gn="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",(function(t){Ir[t]=1})),mt(Gn,(function(t){x.units[t]="deg",An[t]=1})),jr[Qn[13]]=Wn+","+Gn,mt("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",(function(t){var e=t.split(":");jr[e[1]]=Qn[e[0]]})),mt("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",(function(t){x.units[t]="px"})),Er.registerPlugin(Zn);var $n=Er.registerPlugin(Zn)||Er;$n.core.Tween;const Jn={CherryWave:({container:t,image:e,speed:n=.05,strength:i=.02,hover:s=!1,light:a})=>{if(!e)return void console.log("No image provided");(new THREE.TextureLoader).load(e.src,(e=>{const o={uImage:{value:e},uTime:{value:0},uStrength:{value:s?0:i},uLight:{value:a}},u=r(t.clientWidth,t.clientHeight);let h;function l(){h&&(u.Scene.remove(h),h.geometry.dispose(),h.material.dispose()),h=function(){const e=t.clientWidth/t.clientHeight*2.3,r=new THREE.PlaneGeometry(e,2.3,100,100),n=new THREE.ShaderMaterial({vertexShader:"\nprecision highp float;\n varying vec2 vUv;\n varying vec3 pos;\n uniform float uTime;\n uniform float uStrength;\n\n void main() {\n \n vUv = uv;\n \n vec3 newPosition = position;\n\n \n float waveX = uStrength * sin(10.0 * uv.y + uTime * 2.0);\n float waveY = uStrength * cos(12.0 * uv.x + uTime * 1.5);\n \n float waveZ = uStrength * sin(10.0 * uv.x + uTime * 2.5);\n\n newPosition.x += waveX;\n newPosition.y += waveY;\n newPosition.z += waveZ;\n\n pos = (modelViewMatrix * vec4(newPosition, 1.0)).xyz;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(newPosition, 1.0);\n }",fragmentShader:"\nprecision highp float;\n\nvarying vec2 vUv;\nuniform sampler2D uImage;\nuniform float uTime;\n\nuniform float uStrength;\nuniform bool uLight;\n\n\nvoid main() {\n vec2 uv = vUv;\n \n\n \n \n\n // Apply wave distortion\n float waveX = sin(10.0 * uv.y + uTime * 2.0);\n float waveY = cos(10.0 * uv.x + uTime * 2.0);\n uv.x += (uStrength * 0.05) * waveX;\n uv.y += (uStrength * 0.05) * waveY;\n\n \n\n vec4 color = texture2D(uImage, uv);\n if(uLight){\n color.x+=smoothstep(0.001,0.6,sin(2.0*uTime));\n color.y+=smoothstep(0.2,0.6,sin(0.2*uTime));\n }\n \n gl_FragColor = color;\n}\n",uniforms:o,transparent:!0});return new THREE.Mesh(r,n)}(),u.mesh=h,u.Scene.add(h)}function f(){const e=t.clientWidth,r=t.clientHeight;u.renderer.setSize(e,r),u.renderer.setPixelRatio(window.devicePixelRatio),u.camera.aspect=e/r,u.camera.updateProjectionMatrix(),l()}return u.camera.fov=2*Math.atan(t.clientHeight/2/600)*(180/Math.PI),u.camera.position.z=2.8,s&&(t.addEventListener("mouseenter",(()=>{$n.to(o.uStrength,{value:i,duration:.5,ease:"power2.out"})})),t.addEventListener("mouseleave",(()=>{$n.to(o.uStrength,{value:0,duration:.5,ease:"power2.out"})}))),t.innerHTML="",t.appendChild(u.renderer.domElement),window.addEventListener("resize",f),f(),function t(){o.uTime.value+=n,u.renderer.render(u.Scene,u.camera),requestAnimationFrame(t)}(),{mesh:u.mesh,geometry:u.geometry,renderer:u.renderer,Scene:u.Scene}}))},ImageTransition1:function(t,{speed:e=.02,strength:n=.02,radius:i=.02,hover:s=!1,noise:a=.4}={}){let o=Array.from(t.querySelectorAll("img"));if(!o.length)return void console.log("No image provided");const u={uImage:{value:null},uImage2:{value:null},uTime:{value:0},uStrength:{value:s?0:n},uNoise:{value:a},uMouse:{value:new THREE.Vector2(-10,-10)},uRadius:{value:i}},h=new THREE.TextureLoader;let l,f=[];o.map(((t,e)=>{h.load(t.src,(t=>{l=0,1==e&&(u.uImage2.value=t),0==e&&(u.uImage.value=t),f.push(t)}))}));const c=r(t.clientWidth,t.clientHeight);let d;function p(){d&&(c.Scene.remove(d),d.geometry.dispose(),d.material.dispose()),d=function(){const e=t.clientWidth/t.clientHeight*2.3,r=new THREE.PlaneGeometry(e,2.3,100,100),n=new THREE.ShaderMaterial({vertexShader:"\nprecision highp float;\nvarying vec2 vUv; \n\n void main() { \n vUv = uv; \n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }",fragmentShader:"\nprecision highp float;\nuniform vec2 uMouse;\nvarying vec2 vUv;\nuniform sampler2D uImage;\nuniform float uTime;\nuniform float uRadius;\nuniform float uStrength;\nuniform float uNoise;\nuniform bool uLight;\nuniform sampler2D uImage2;\nfloat rand(float n){return fract(sin(n) * 43758.5453123);}\nfloat rand(vec2 n){return fract(sin(dot(n, vec2(12.9898, 4.1414))) * 43758.5453123);}\n\nfloat noise(float p){\n float fl = floor(p);\n float fc = fract(p);\n return mix(rand(fl), rand(fl + 1.0), fc);\n}\n \nfloat noise(vec2 n) {\n const vec2 d = vec2(0.0, 1.0);\n vec2 b = floor(n), f = smoothstep(vec2(0.0), vec2(1.0), fract(n));\n return mix(mix(rand(b), rand(b + d.yx), f.x), mix(rand(b + d.xy), rand(b + d.yy), f.x), f.y);\n}\n\nvoid main() {\n vec2 uv = vUv;\n vec2 guv = vUv;\n guv.x -= 0.5;\n guv.y -= 0.5;\n\n // Calculate distance from mouse\n float dist = length(guv - uMouse);\n\n \n float edgeNoise = noise(guv * 10.0 + uTime * 2.0 ) * uNoise;\n\n // Create mask for area following mouse, with wobbly edge\n float inside = step(dist, uRadius *edgeNoise);\n\n // Apply noise only inside the circle\n float n = noise(guv * 0.2);\n\n vec3 circle = mix(vec3(1.0), vec3(n), inside);\n\n // Apply wave distortion\n float waveX = sin(10.0 * uv.y + uTime * 2.0);\n float waveY = cos(10.0 * uv.x + uTime * 2.0);\n uv.x += (uStrength * 0.05) * waveX;\n uv.y += (uStrength * 0.05) * waveY;\n\n \n\n vec4 color = texture2D(uImage, uv);\n \n vec4 color2 = texture2D(uImage2,uv);\n gl_FragColor = mix(color,(vec4(n)+color2),inside);\n}\n",uniforms:u,transparent:!0});return new THREE.Mesh(r,n)}(),c.mesh=d,c.Scene.add(d)}function _(){const e=t.clientWidth,r=t.clientHeight;c.renderer.setSize(e,r),c.renderer.setPixelRatio(window.devicePixelRatio),c.camera.aspect=e/r,c.camera.updateProjectionMatrix(),p()}return c.camera.fov=2*Math.atan(t.clientHeight/2/600)*(180/Math.PI),c.camera.position.z=2.8,t.addEventListener("mousemove",(function(e){const r=t.getBoundingClientRect(),n=(e.clientX-r.left)/r.width-.5,i=-(e.clientY-r.top)/r.height+.5;$n.to(u.uMouse.value,{x:n,y:i,duration:.2})})),s&&(t.addEventListener("mouseenter",(()=>{$n.to(u.uStrength,{value:n,duration:.5,ease:"power2.out"}),$n.to(u.uRadius,{value:i,duration:.2})})),t.addEventListener("mouseleave",(()=>{$n.to(u.uStrength,{value:0,duration:.5,ease:"power2.out"}),$n.to(u.uRadius,{value:-100,duration:.6})}))),t.innerHTML="",t.appendChild(c.renderer.domElement),window.addEventListener("resize",_),_(),function t(){u.uTime.value+=e,c.renderer.render(c.Scene,c.camera),requestAnimationFrame(t)}(),t.addEventListener("click",(()=>{const t=(l+1)%f.length,e=(l+2)%f.length;$n.to(u.uRadius,{value:2,duration:2,ease:"power2.inOut",onComplete:()=>{u.uImage.value=f[t],u.uImage2.value=f[e],$n.fromTo(u.uRadius,{value:0},{value:i,duration:2,ease:"power2.inOut"}),l=t}})})),{mesh:c.mesh,geometry:c.geometry,renderer:c.renderer,Scene:c.Scene,currntimageIndex:l}}};return e})()));
|
2
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Cherryglsl",[],e):"object"==typeof exports?exports.Cherryglsl=e():t.Cherryglsl=e()}(this,(()=>(()=>{"use strict";var t={d:(e,i)=>{for(var r in i)t.o(i,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:i[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{default:()=>bo});function i(t=400,e=400){const i=new THREE.Scene,r=new THREE.PerspectiveCamera(75,window.innerWidth/window.innerHeight,.1,1e3),s=new THREE.WebGLRenderer({alpha:!1});return s.setSize(t,e),{Scene:i,camera:r,renderer:s}}function r(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function s(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var n,a,o,h,u,l,c,d,p,m,f,y,g,x,_,v,b,w={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},M={duration:.5,overwrite:!1,delay:0},T=1e8,S=1e-8,z=2*Math.PI,A=z/4,k=0,C=Math.sqrt,E=Math.cos,O=Math.sin,B=function(t){return"string"==typeof t},P=function(t){return"function"==typeof t},R=function(t){return"number"==typeof t},I=function(t){return void 0===t},F=function(t){return"object"==typeof t},V=function(t){return!1!==t},N=function(){return"undefined"!=typeof window},D=function(t){return P(t)||B(t)},U="function"==typeof ArrayBuffer&&ArrayBuffer.isView||function(){},L=Array.isArray,q=/(?:-?\.?\d|\.)+/gi,W=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,j=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,H=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,X=/[+-]=-?[.\d]+/,Y=/[^,'"\[\]\s]+/gi,Z=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,J={},G={},Q=function(t){return(G=At(t,J))&&ki},$=function(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")},K=function(t,e){return!e&&console.warn(t)},tt=function(t,e){return t&&(J[t]=e)&&G&&(G[t]=e)||J},et=function(){return 0},it={suppressEvents:!0,isStart:!0,kill:!1},rt={suppressEvents:!0,kill:!1},st={suppressEvents:!0},nt={},at=[],ot={},ht={},ut={},lt=30,ct=[],dt="",pt=function(t){var e,i,r=t[0];if(F(r)||P(r)||(t=[t]),!(e=(r._gsap||{}).harness)){for(i=ct.length;i--&&!ct[i].targetTest(r););e=ct[i]}for(i=t.length;i--;)t[i]&&(t[i]._gsap||(t[i]._gsap=new qe(t[i],e)))||t.splice(i,1);return t},mt=function(t){return t._gsap||pt(ne(t))[0]._gsap},ft=function(t,e,i){return(i=t[e])&&P(i)?t[e]():I(i)&&t.getAttribute&&t.getAttribute(e)||i},yt=function(t,e){return(t=t.split(",")).forEach(e)||t},gt=function(t){return Math.round(1e5*t)/1e5||0},xt=function(t){return Math.round(1e7*t)/1e7||0},_t=function(t,e){var i=e.charAt(0),r=parseFloat(e.substr(2));return t=parseFloat(t),"+"===i?t+r:"-"===i?t-r:"*"===i?t*r:t/r},vt=function(t,e){for(var i=e.length,r=0;t.indexOf(e[r])<0&&++r<i;);return r<i},bt=function(){var t,e,i=at.length,r=at.slice(0);for(ot={},at.length=0,t=0;t<i;t++)(e=r[t])&&e._lazy&&(e.render(e._lazy[0],e._lazy[1],!0)._lazy=0)},wt=function(t){return!!(t._initted||t._startAt||t.add)},Mt=function(t,e,i,r){at.length&&!a&&bt(),t.render(e,i,r||!!(a&&e<0&&wt(t))),at.length&&!a&&bt()},Tt=function(t){var e=parseFloat(t);return(e||0===e)&&(t+"").match(Y).length<2?e:B(t)?t.trim():t},St=function(t){return t},zt=function(t,e){for(var i in e)i in t||(t[i]=e[i]);return t},At=function(t,e){for(var i in e)t[i]=e[i];return t},kt=function t(e,i){for(var r in i)"__proto__"!==r&&"constructor"!==r&&"prototype"!==r&&(e[r]=F(i[r])?t(e[r]||(e[r]={}),i[r]):i[r]);return e},Ct=function(t,e){var i,r={};for(i in t)i in e||(r[i]=t[i]);return r},Et=function(t){var e,i=t.parent||h,r=t.keyframes?(e=L(t.keyframes),function(t,i){for(var r in i)r in t||"duration"===r&&e||"ease"===r||(t[r]=i[r])}):zt;if(V(t.inherit))for(;i;)r(t,i.vars.defaults),i=i.parent||i._dp;return t},Ot=function(t,e,i,r,s){void 0===i&&(i="_first"),void 0===r&&(r="_last");var n,a=t[r];if(s)for(n=e[s];a&&a[s]>n;)a=a._prev;return a?(e._next=a._next,a._next=e):(e._next=t[i],t[i]=e),e._next?e._next._prev=e:t[r]=e,e._prev=a,e.parent=e._dp=t,e},Bt=function(t,e,i,r){void 0===i&&(i="_first"),void 0===r&&(r="_last");var s=e._prev,n=e._next;s?s._next=n:t[i]===e&&(t[i]=n),n?n._prev=s:t[r]===e&&(t[r]=s),e._next=e._prev=e.parent=null},Pt=function(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},Rt=function(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var i=t;i;)i._dirty=1,i=i.parent;return t},It=function(t,e,i,r){return t._startAt&&(a?t._startAt.revert(rt):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,r))},Ft=function t(e){return!e||e._ts&&t(e.parent)},Vt=function(t){return t._repeat?Nt(t._tTime,t=t.duration()+t._rDelay)*t:0},Nt=function(t,e){var i=Math.floor(t=xt(t/e));return t&&i===t?i-1:i},Dt=function(t,e){return(t-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},Ut=function(t){return t._end=xt(t._start+(t._tDur/Math.abs(t._ts||t._rts||S)||0))},Lt=function(t,e){var i=t._dp;return i&&i.smoothChildTiming&&t._ts&&(t._start=xt(i._time-(t._ts>0?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),Ut(t),i._dirty||Rt(i,t)),t},qt=function(t,e){var i;if((e._time||!e._dur&&e._initted||e._start<t._time&&(e._dur||!e.add))&&(i=Dt(t.rawTime(),e),(!e._dur||te(0,e.totalDuration(),i)-e._tTime>S)&&e.render(i,!0)),Rt(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(i=t;i._dp;)i.rawTime()>=0&&i.totalTime(i._tTime),i=i._dp;t._zTime=-1e-8}},Wt=function(t,e,i,r){return e.parent&&Pt(e),e._start=xt((R(i)?i:i||t!==h?Qt(t,i,e):t._time)+e._delay),e._end=xt(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),Ot(t,e,"_first","_last",t._sort?"_start":0),Yt(e)||(t._recent=e),r||qt(t,e),t._ts<0&&Lt(t,t._tTime),t},jt=function(t,e){return(J.ScrollTrigger||$("scrollTrigger",e))&&J.ScrollTrigger.create(e,t)},Ht=function(t,e,i,r,s){return Ge(t,e,s),t._initted?!i&&t._pt&&!a&&(t._dur&&!1!==t.vars.lazy||!t._dur&&t.vars.lazy)&&p!==Ce.frame?(at.push(t),t._lazy=[s,r],1):void 0:1},Xt=function t(e){var i=e.parent;return i&&i._ts&&i._initted&&!i._lock&&(i.rawTime()<0||t(i))},Yt=function(t){var e=t.data;return"isFromStart"===e||"isStart"===e},Zt=function(t,e,i,r){var s=t._repeat,n=xt(e)||0,a=t._tTime/t._tDur;return a&&!r&&(t._time*=n/t._dur),t._dur=n,t._tDur=s?s<0?1e10:xt(n*(s+1)+t._rDelay*s):n,a>0&&!r&&Lt(t,t._tTime=t._tDur*a),t.parent&&Ut(t),i||Rt(t.parent,t),t},Jt=function(t){return t instanceof je?Rt(t):Zt(t,t._dur)},Gt={_start:0,endTime:et,totalDuration:et},Qt=function t(e,i,r){var s,n,a,o=e.labels,h=e._recent||Gt,u=e.duration()>=T?h.endTime(!1):e._dur;return B(i)&&(isNaN(i)||i in o)?(n=i.charAt(0),a="%"===i.substr(-1),s=i.indexOf("="),"<"===n||">"===n?(s>=0&&(i=i.replace(/=/,"")),("<"===n?h._start:h.endTime(h._repeat>=0))+(parseFloat(i.substr(1))||0)*(a?(s<0?h:r).totalDuration()/100:1)):s<0?(i in o||(o[i]=u),o[i]):(n=parseFloat(i.charAt(s-1)+i.substr(s+1)),a&&r&&(n=n/100*(L(r)?r[0]:r).totalDuration()),s>1?t(e,i.substr(0,s-1),r)+n:u+n)):null==i?u:+i},$t=function(t,e,i){var r,s,n=R(e[1]),a=(n?2:1)+(t<2?0:1),o=e[a];if(n&&(o.duration=e[1]),o.parent=i,t){for(r=o,s=i;s&&!("immediateRender"in r);)r=s.vars.defaults||{},s=V(s.vars.inherit)&&s.parent;o.immediateRender=V(r.immediateRender),t<2?o.runBackwards=1:o.startAt=e[a-1]}return new ei(e[0],o,e[a+1])},Kt=function(t,e){return t||0===t?e(t):e},te=function(t,e,i){return i<t?t:i>e?e:i},ee=function(t,e){return B(t)&&(e=Z.exec(t))?e[1]:""},ie=[].slice,re=function(t,e){return t&&F(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&F(t[0]))&&!t.nodeType&&t!==u},se=function(t,e,i){return void 0===i&&(i=[]),t.forEach((function(t){var r;return B(t)&&!e||re(t,1)?(r=i).push.apply(r,ne(t)):i.push(t)}))||i},ne=function(t,e,i){return o&&!e&&o.selector?o.selector(t):!B(t)||i||!l&&Ee()?L(t)?se(t,i):re(t)?ie.call(t,0):t?[t]:[]:ie.call((e||c).querySelectorAll(t),0)},ae=function(t){return t=ne(t)[0]||K("Invalid scope")||{},function(e){var i=t.current||t.nativeElement||t;return ne(e,i.querySelectorAll?i:i===t?K("Invalid scope")||c.createElement("div"):t)}},oe=function(t){return t.sort((function(){return.5-Math.random()}))},he=function(t){if(P(t))return t;var e=F(t)?t:{each:t},i=Ve(e.ease),r=e.from||0,s=parseFloat(e.base)||0,n={},a=r>0&&r<1,o=isNaN(r)||a,h=e.axis,u=r,l=r;return B(r)?u=l={center:.5,edges:.5,end:1}[r]||0:!a&&o&&(u=r[0],l=r[1]),function(t,a,c){var d,p,m,f,y,g,x,_,v,b=(c||e).length,w=n[b];if(!w){if(!(v="auto"===e.grid?0:(e.grid||[1,T])[1])){for(x=-T;x<(x=c[v++].getBoundingClientRect().left)&&v<b;);v<b&&v--}for(w=n[b]=[],d=o?Math.min(v,b)*u-.5:r%v,p=v===T?0:o?b*l/v-.5:r/v|0,x=0,_=T,g=0;g<b;g++)m=g%v-d,f=p-(g/v|0),w[g]=y=h?Math.abs("y"===h?f:m):C(m*m+f*f),y>x&&(x=y),y<_&&(_=y);"random"===r&&oe(w),w.max=x-_,w.min=_,w.v=b=(parseFloat(e.amount)||parseFloat(e.each)*(v>b?b-1:h?"y"===h?b/v:v:Math.max(v,b/v))||0)*("edges"===r?-1:1),w.b=b<0?s-b:s,w.u=ee(e.amount||e.each)||0,i=i&&b<0?Ie(i):i}return b=(w[t]-w.min)/w.max||0,xt(w.b+(i?i(b):b)*w.v)+w.u}},ue=function(t){var e=Math.pow(10,((t+"").split(".")[1]||"").length);return function(i){var r=xt(Math.round(parseFloat(i)/t)*t*e);return(r-r%1)/e+(R(i)?0:ee(i))}},le=function(t,e){var i,r,s=L(t);return!s&&F(t)&&(i=s=t.radius||T,t.values?(t=ne(t.values),(r=!R(t[0]))&&(i*=i)):t=ue(t.increment)),Kt(e,s?P(t)?function(e){return r=t(e),Math.abs(r-e)<=i?r:e}:function(e){for(var s,n,a=parseFloat(r?e.x:e),o=parseFloat(r?e.y:0),h=T,u=0,l=t.length;l--;)(s=r?(s=t[l].x-a)*s+(n=t[l].y-o)*n:Math.abs(t[l]-a))<h&&(h=s,u=l);return u=!i||h<=i?t[u]:e,r||u===e||R(e)?u:u+ee(e)}:ue(t))},ce=function(t,e,i,r){return Kt(L(t)?!e:!0===i?!!(i=0):!r,(function(){return L(t)?t[~~(Math.random()*t.length)]:(i=i||1e-5)&&(r=i<1?Math.pow(10,(i+"").length-2):1)&&Math.floor(Math.round((t-i/2+Math.random()*(e-t+.99*i))/i)*i*r)/r}))},de=function(t,e,i){return Kt(i,(function(i){return t[~~e(i)]}))},pe=function(t){for(var e,i,r,s,n=0,a="";~(e=t.indexOf("random(",n));)r=t.indexOf(")",e),s="["===t.charAt(e+7),i=t.substr(e+7,r-e-7).match(s?Y:q),a+=t.substr(n,e-n)+ce(s?i:+i[0],s?0:+i[1],+i[2]||1e-5),n=r+1;return a+t.substr(n,t.length-n)},me=function(t,e,i,r,s){var n=e-t,a=r-i;return Kt(s,(function(e){return i+((e-t)/n*a||0)}))},fe=function(t,e,i){var r,s,n,a=t.labels,o=T;for(r in a)(s=a[r]-e)<0==!!i&&s&&o>(s=Math.abs(s))&&(n=r,o=s);return n},ye=function(t,e,i){var r,s,n,a=t.vars,h=a[e],u=o,l=t._ctx;if(h)return r=a[e+"Params"],s=a.callbackScope||t,i&&at.length&&bt(),l&&(o=l),n=r?h.apply(s,r):h.call(s),o=u,n},ge=function(t){return Pt(t),t.scrollTrigger&&t.scrollTrigger.kill(!!a),t.progress()<1&&ye(t,"onInterrupt"),t},xe=[],_e=function(t){if(t)if(t=!t.name&&t.default||t,N()||t.headless){var e=t.name,i=P(t),r=e&&!i&&t.init?function(){this._props=[]}:t,s={init:et,render:li,add:Ze,kill:di,modifier:ci,rawVars:0},n={targetTest:0,get:0,getSetter:ai,aliases:{},register:0};if(Ee(),t!==r){if(ht[e])return;zt(r,zt(Ct(t,s),n)),At(r.prototype,At(s,Ct(t,n))),ht[r.prop=e]=r,t.targetTest&&(ct.push(r),nt[e]=1),e=("css"===e?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}tt(e,r),t.register&&t.register(ki,r,fi)}else xe.push(t)},ve=255,be={aqua:[0,ve,ve],lime:[0,ve,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,ve],navy:[0,0,128],white:[ve,ve,ve],olive:[128,128,0],yellow:[ve,ve,0],orange:[ve,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[ve,0,0],pink:[ve,192,203],cyan:[0,ve,ve],transparent:[ve,ve,ve,0]},we=function(t,e,i){return(6*(t+=t<0?1:t>1?-1:0)<1?e+(i-e)*t*6:t<.5?i:3*t<2?e+(i-e)*(2/3-t)*6:e)*ve+.5|0},Me=function(t,e,i){var r,s,n,a,o,h,u,l,c,d,p=t?R(t)?[t>>16,t>>8&ve,t&ve]:0:be.black;if(!p){if(","===t.substr(-1)&&(t=t.substr(0,t.length-1)),be[t])p=be[t];else if("#"===t.charAt(0)){if(t.length<6&&(r=t.charAt(1),s=t.charAt(2),n=t.charAt(3),t="#"+r+r+s+s+n+n+(5===t.length?t.charAt(4)+t.charAt(4):"")),9===t.length)return[(p=parseInt(t.substr(1,6),16))>>16,p>>8&ve,p&ve,parseInt(t.substr(7),16)/255];p=[(t=parseInt(t.substr(1),16))>>16,t>>8&ve,t&ve]}else if("hsl"===t.substr(0,3))if(p=d=t.match(q),e){if(~t.indexOf("="))return p=t.match(W),i&&p.length<4&&(p[3]=1),p}else a=+p[0]%360/360,o=+p[1]/100,r=2*(h=+p[2]/100)-(s=h<=.5?h*(o+1):h+o-h*o),p.length>3&&(p[3]*=1),p[0]=we(a+1/3,r,s),p[1]=we(a,r,s),p[2]=we(a-1/3,r,s);else p=t.match(q)||be.transparent;p=p.map(Number)}return e&&!d&&(r=p[0]/ve,s=p[1]/ve,n=p[2]/ve,h=((u=Math.max(r,s,n))+(l=Math.min(r,s,n)))/2,u===l?a=o=0:(c=u-l,o=h>.5?c/(2-u-l):c/(u+l),a=u===r?(s-n)/c+(s<n?6:0):u===s?(n-r)/c+2:(r-s)/c+4,a*=60),p[0]=~~(a+.5),p[1]=~~(100*o+.5),p[2]=~~(100*h+.5)),i&&p.length<4&&(p[3]=1),p},Te=function(t){var e=[],i=[],r=-1;return t.split(ze).forEach((function(t){var s=t.match(j)||[];e.push.apply(e,s),i.push(r+=s.length+1)})),e.c=i,e},Se=function(t,e,i){var r,s,n,a,o="",h=(t+o).match(ze),u=e?"hsla(":"rgba(",l=0;if(!h)return t;if(h=h.map((function(t){return(t=Me(t,e,1))&&u+(e?t[0]+","+t[1]+"%,"+t[2]+"%,"+t[3]:t.join(","))+")"})),i&&(n=Te(t),(r=i.c).join(o)!==n.c.join(o)))for(a=(s=t.replace(ze,"1").split(j)).length-1;l<a;l++)o+=s[l]+(~r.indexOf(l)?h.shift()||u+"0,0,0,0)":(n.length?n:h.length?h:i).shift());if(!s)for(a=(s=t.split(ze)).length-1;l<a;l++)o+=s[l]+h[l];return o+s[a]},ze=function(){var t,e="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b";for(t in be)e+="|"+t+"\\b";return new RegExp(e+")","gi")}(),Ae=/hsl[a]?\(/,ke=function(t){var e,i=t.join(" ");if(ze.lastIndex=0,ze.test(i))return e=Ae.test(i),t[1]=Se(t[1],e),t[0]=Se(t[0],e,Te(t[1])),!0},Ce=function(){var t,e,i,r,s,n,a=Date.now,o=500,h=33,p=a(),m=p,y=1e3/240,g=y,x=[],_=function i(u){var l,c,d,f,_=a()-m,v=!0===u;if((_>o||_<0)&&(p+=_-h),((l=(d=(m+=_)-p)-g)>0||v)&&(f=++r.frame,s=d-1e3*r.time,r.time=d/=1e3,g+=l+(l>=y?4:y-l),c=1),v||(t=e(i)),c)for(n=0;n<x.length;n++)x[n](d,s,f,u)};return r={time:0,frame:0,tick:function(){_(!0)},deltaRatio:function(t){return s/(1e3/(t||60))},wake:function(){d&&(!l&&N()&&(u=l=window,c=u.document||{},J.gsap=ki,(u.gsapVersions||(u.gsapVersions=[])).push(ki.version),Q(G||u.GreenSockGlobals||!u.gsap&&u||{}),xe.forEach(_e)),i="undefined"!=typeof requestAnimationFrame&&requestAnimationFrame,t&&r.sleep(),e=i||function(t){return setTimeout(t,g-1e3*r.time+1|0)},f=1,_(2))},sleep:function(){(i?cancelAnimationFrame:clearTimeout)(t),f=0,e=et},lagSmoothing:function(t,e){o=t||1/0,h=Math.min(e||33,o)},fps:function(t){y=1e3/(t||240),g=1e3*r.time+y},add:function(t,e,i){var s=e?function(e,i,n,a){t(e,i,n,a),r.remove(s)}:t;return r.remove(t),x[i?"unshift":"push"](s),Ee(),s},remove:function(t,e){~(e=x.indexOf(t))&&x.splice(e,1)&&n>=e&&n--},_listeners:x}}(),Ee=function(){return!f&&Ce.wake()},Oe={},Be=/^[\d.\-M][\d.\-,\s]/,Pe=/["']/g,Re=function(t){for(var e,i,r,s={},n=t.substr(1,t.length-3).split(":"),a=n[0],o=1,h=n.length;o<h;o++)i=n[o],e=o!==h-1?i.lastIndexOf(","):i.length,r=i.substr(0,e),s[a]=isNaN(r)?r.replace(Pe,"").trim():+r,a=i.substr(e+1).trim();return s},Ie=function(t){return function(e){return 1-t(1-e)}},Fe=function t(e,i){for(var r,s=e._first;s;)s instanceof je?t(s,i):!s.vars.yoyoEase||s._yoyo&&s._repeat||s._yoyo===i||(s.timeline?t(s.timeline,i):(r=s._ease,s._ease=s._yEase,s._yEase=r,s._yoyo=i)),s=s._next},Ve=function(t,e){return t&&(P(t)?t:Oe[t]||function(t){var e,i,r,s,n=(t+"").split("("),a=Oe[n[0]];return a&&n.length>1&&a.config?a.config.apply(null,~t.indexOf("{")?[Re(n[1])]:(e=t,i=e.indexOf("(")+1,r=e.indexOf(")"),s=e.indexOf("(",i),e.substring(i,~s&&s<r?e.indexOf(")",r+1):r)).split(",").map(Tt)):Oe._CE&&Be.test(t)?Oe._CE("",t):a}(t))||e},Ne=function(t,e,i,r){void 0===i&&(i=function(t){return 1-e(1-t)}),void 0===r&&(r=function(t){return t<.5?e(2*t)/2:1-e(2*(1-t))/2});var s,n={easeIn:e,easeOut:i,easeInOut:r};return yt(t,(function(t){for(var e in Oe[t]=J[t]=n,Oe[s=t.toLowerCase()]=i,n)Oe[s+("easeIn"===e?".in":"easeOut"===e?".out":".inOut")]=Oe[t+"."+e]=n[e]})),n},De=function(t){return function(e){return e<.5?(1-t(1-2*e))/2:.5+t(2*(e-.5))/2}},Ue=function t(e,i,r){var s=i>=1?i:1,n=(r||(e?.3:.45))/(i<1?i:1),a=n/z*(Math.asin(1/s)||0),o=function(t){return 1===t?1:s*Math.pow(2,-10*t)*O((t-a)*n)+1},h="out"===e?o:"in"===e?function(t){return 1-o(1-t)}:De(o);return n=z/n,h.config=function(i,r){return t(e,i,r)},h},Le=function t(e,i){void 0===i&&(i=1.70158);var r=function(t){return t?--t*t*((i+1)*t+i)+1:0},s="out"===e?r:"in"===e?function(t){return 1-r(1-t)}:De(r);return s.config=function(i){return t(e,i)},s};yt("Linear,Quad,Cubic,Quart,Quint,Strong",(function(t,e){var i=e<5?e+1:e;Ne(t+",Power"+(i-1),e?function(t){return Math.pow(t,i)}:function(t){return t},(function(t){return 1-Math.pow(1-t,i)}),(function(t){return t<.5?Math.pow(2*t,i)/2:1-Math.pow(2*(1-t),i)/2}))})),Oe.Linear.easeNone=Oe.none=Oe.Linear.easeIn,Ne("Elastic",Ue("in"),Ue("out"),Ue()),y=7.5625,_=2*(x=1/(g=2.75)),v=2.5*x,Ne("Bounce",(function(t){return 1-b(1-t)}),b=function(t){return t<x?y*t*t:t<_?y*Math.pow(t-1.5/g,2)+.75:t<v?y*(t-=2.25/g)*t+.9375:y*Math.pow(t-2.625/g,2)+.984375}),Ne("Expo",(function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)})),Ne("Circ",(function(t){return-(C(1-t*t)-1)})),Ne("Sine",(function(t){return 1===t?1:1-E(t*A)})),Ne("Back",Le("in"),Le("out"),Le()),Oe.SteppedEase=Oe.steps=J.SteppedEase={config:function(t,e){void 0===t&&(t=1);var i=1/t,r=t+(e?0:1),s=e?1:0;return function(t){return((r*te(0,.99999999,t)|0)+s)*i}}},M.ease=Oe["quad.out"],yt("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",(function(t){return dt+=t+","+t+"Params,"}));var qe=function(t,e){this.id=k++,t._gsap=this,this.target=t,this.harness=e,this.get=e?e.get:ft,this.set=e?e.getSetter:ai},We=function(){function t(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,Zt(this,+t.duration,1,1),this.data=t.data,o&&(this._ctx=o,o.data.push(this)),f||Ce.wake()}var e=t.prototype;return e.delay=function(t){return t||0===t?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+t-this._delay),this._delay=t,this):this._delay},e.duration=function(t){return arguments.length?this.totalDuration(this._repeat>0?t+(t+this._rDelay)*this._repeat:t):this.totalDuration()&&this._dur},e.totalDuration=function(t){return arguments.length?(this._dirty=0,Zt(this,this._repeat<0?t:(t-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(t,e){if(Ee(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(Lt(this,t),!i._dp||i.parent||qt(i,this);i&&i.parent;)i.parent._time!==i._start+(i._ts>=0?i._tTime/i._ts:(i.totalDuration()-i._tTime)/-i._ts)&&i.totalTime(i._tTime,!0),i=i.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&t<this._tDur||this._ts<0&&t>0||!this._tDur&&!t)&&Wt(this._dp,this,this._start-this._delay)}return(this._tTime!==t||!this._dur&&!e||this._initted&&Math.abs(this._zTime)===S||!t&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=t),Mt(this,t,e)),this},e.time=function(t,e){return arguments.length?this.totalTime(Math.min(this.totalDuration(),t+Vt(this))%(this._dur+this._rDelay)||(t?this._dur:0),e):this._time},e.totalProgress=function(t,e){return arguments.length?this.totalTime(this.totalDuration()*t,e):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},e.progress=function(t,e){return arguments.length?this.totalTime(this.duration()*(!this._yoyo||1&this.iteration()?t:1-t)+Vt(this),e):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(t,e){var i=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(t-1)*i,e):this._repeat?Nt(this._tTime,i)+1:1},e.timeScale=function(t,e){if(!arguments.length)return-1e-8===this._rts?0:this._rts;if(this._rts===t)return this;var i=this.parent&&this._ts?Dt(this.parent._time,this):this._tTime;return this._rts=+t||0,this._ts=this._ps||-1e-8===t?0:this._rts,this.totalTime(te(-Math.abs(this._delay),this.totalDuration(),i),!1!==e),Ut(this),function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t}(this)},e.paused=function(t){return arguments.length?(this._ps!==t&&(this._ps=t,t?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Ee(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,1===this.progress()&&Math.abs(this._zTime)!==S&&(this._tTime-=S)))),this):this._ps},e.startTime=function(t){if(arguments.length){this._start=t;var e=this.parent||this._dp;return e&&(e._sort||!this.parent)&&Wt(e,this,t-this._delay),this}return this._start},e.endTime=function(t){return this._start+(V(t)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(t){var e=this.parent||this._dp;return e?t&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Dt(e.rawTime(t),this):this._tTime:this._tTime},e.revert=function(t){void 0===t&&(t=st);var e=a;return a=t,wt(this)&&(this.timeline&&this.timeline.revert(t),this.totalTime(-.01,t.suppressEvents)),"nested"!==this.data&&!1!==t.kill&&this.kill(),a=e,this},e.globalTime=function(t){for(var e=this,i=arguments.length?t:e.rawTime();e;)i=e._start+i/(Math.abs(e._ts)||1),e=e._dp;return!this.parent&&this._sat?this._sat.globalTime(t):i},e.repeat=function(t){return arguments.length?(this._repeat=t===1/0?-2:t,Jt(this)):-2===this._repeat?1/0:this._repeat},e.repeatDelay=function(t){if(arguments.length){var e=this._time;return this._rDelay=t,Jt(this),e?this.time(e):this}return this._rDelay},e.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},e.seek=function(t,e){return this.totalTime(Qt(this,t),V(e))},e.restart=function(t,e){return this.play().totalTime(t?-this._delay:0,V(e)),this._dur||(this._zTime=-1e-8),this},e.play=function(t,e){return null!=t&&this.seek(t,e),this.reversed(!1).paused(!1)},e.reverse=function(t,e){return null!=t&&this.seek(t||this.totalDuration(),e),this.reversed(!0).paused(!1)},e.pause=function(t,e){return null!=t&&this.seek(t,e),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(t){return arguments.length?(!!t!==this.reversed()&&this.timeScale(-this._rts||(t?-1e-8:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-1e-8,this},e.isActive=function(){var t,e=this.parent||this._dp,i=this._start;return!(e&&!(this._ts&&this._initted&&e.isActive()&&(t=e.rawTime(!0))>=i&&t<this.endTime(!0)-S))},e.eventCallback=function(t,e,i){var r=this.vars;return arguments.length>1?(e?(r[t]=e,i&&(r[t+"Params"]=i),"onUpdate"===t&&(this._onUpdate=e)):delete r[t],this):r[t]},e.then=function(t){var e=this;return new Promise((function(i){var r=P(t)?t:St,s=function(){var t=e.then;e.then=null,P(r)&&(r=r(e))&&(r.then||r===e)&&(e.then=t),i(r),e.then=t};e._initted&&1===e.totalProgress()&&e._ts>=0||!e._tTime&&e._ts<0?s():e._prom=s}))},e.kill=function(){ge(this)},t}();zt(We.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-1e-8,_prom:0,_ps:!1,_rts:1});var je=function(t){function e(e,i){var s;return void 0===e&&(e={}),(s=t.call(this,e)||this).labels={},s.smoothChildTiming=!!e.smoothChildTiming,s.autoRemoveChildren=!!e.autoRemoveChildren,s._sort=V(e.sortChildren),h&&Wt(e.parent||h,r(s),i),e.reversed&&s.reverse(),e.paused&&s.paused(!0),e.scrollTrigger&&jt(r(s),e.scrollTrigger),s}s(e,t);var i=e.prototype;return i.to=function(t,e,i){return $t(0,arguments,this),this},i.from=function(t,e,i){return $t(1,arguments,this),this},i.fromTo=function(t,e,i,r){return $t(2,arguments,this),this},i.set=function(t,e,i){return e.duration=0,e.parent=this,Et(e).repeatDelay||(e.repeat=0),e.immediateRender=!!e.immediateRender,new ei(t,e,Qt(this,i),1),this},i.call=function(t,e,i){return Wt(this,ei.delayedCall(0,t,e),i)},i.staggerTo=function(t,e,i,r,s,n,a){return i.duration=e,i.stagger=i.stagger||r,i.onComplete=n,i.onCompleteParams=a,i.parent=this,new ei(t,i,Qt(this,s)),this},i.staggerFrom=function(t,e,i,r,s,n,a){return i.runBackwards=1,Et(i).immediateRender=V(i.immediateRender),this.staggerTo(t,e,i,r,s,n,a)},i.staggerFromTo=function(t,e,i,r,s,n,a,o){return r.startAt=i,Et(r).immediateRender=V(r.immediateRender),this.staggerTo(t,e,r,s,n,a,o)},i.render=function(t,e,i){var r,s,n,o,u,l,c,d,p,m,f,y,g=this._time,x=this._dirty?this.totalDuration():this._tDur,_=this._dur,v=t<=0?0:xt(t),b=this._zTime<0!=t<0&&(this._initted||!_);if(this!==h&&v>x&&t>=0&&(v=x),v!==this._tTime||i||b){if(g!==this._time&&_&&(v+=this._time-g,t+=this._time-g),r=v,p=this._start,l=!(d=this._ts),b&&(_||(g=this._zTime),(t||!e)&&(this._zTime=t)),this._repeat){if(f=this._yoyo,u=_+this._rDelay,this._repeat<-1&&t<0)return this.totalTime(100*u+t,e,i);if(r=xt(v%u),v===x?(o=this._repeat,r=_):((o=~~(m=xt(v/u)))&&o===m&&(r=_,o--),r>_&&(r=_)),m=Nt(this._tTime,u),!g&&this._tTime&&m!==o&&this._tTime-m*u-this._dur<=0&&(m=o),f&&1&o&&(r=_-r,y=1),o!==m&&!this._lock){var w=f&&1&m,M=w===(f&&1&o);if(o<m&&(w=!w),g=w?0:v%_?_:v,this._lock=1,this.render(g||(y?0:xt(o*u)),e,!_)._lock=0,this._tTime=v,!e&&this.parent&&ye(this,"onRepeat"),this.vars.repeatRefresh&&!y&&(this.invalidate()._lock=1),g&&g!==this._time||l!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(_=this._dur,x=this._tDur,M&&(this._lock=2,g=w?_:-1e-4,this.render(g,!0),this.vars.repeatRefresh&&!y&&this.invalidate()),this._lock=0,!this._ts&&!l)return this;Fe(this,y)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(c=function(t,e,i){var r;if(i>e)for(r=t._first;r&&r._start<=i;){if("isPause"===r.data&&r._start>e)return r;r=r._next}else for(r=t._last;r&&r._start>=i;){if("isPause"===r.data&&r._start<e)return r;r=r._prev}}(this,xt(g),xt(r)),c&&(v-=r-(r=c._start))),this._tTime=v,this._time=r,this._act=!d,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=t,g=0),!g&&v&&!e&&!m&&(ye(this,"onStart"),this._tTime!==v))return this;if(r>=g&&t>=0)for(s=this._first;s;){if(n=s._next,(s._act||r>=s._start)&&s._ts&&c!==s){if(s.parent!==this)return this.render(t,e,i);if(s.render(s._ts>0?(r-s._start)*s._ts:(s._dirty?s.totalDuration():s._tDur)+(r-s._start)*s._ts,e,i),r!==this._time||!this._ts&&!l){c=0,n&&(v+=this._zTime=-1e-8);break}}s=n}else{s=this._last;for(var T=t<0?t:r;s;){if(n=s._prev,(s._act||T<=s._end)&&s._ts&&c!==s){if(s.parent!==this)return this.render(t,e,i);if(s.render(s._ts>0?(T-s._start)*s._ts:(s._dirty?s.totalDuration():s._tDur)+(T-s._start)*s._ts,e,i||a&&wt(s)),r!==this._time||!this._ts&&!l){c=0,n&&(v+=this._zTime=T?-1e-8:S);break}}s=n}}if(c&&!e&&(this.pause(),c.render(r>=g?0:-1e-8)._zTime=r>=g?1:-1,this._ts))return this._start=p,Ut(this),this.render(t,e,i);this._onUpdate&&!e&&ye(this,"onUpdate",!0),(v===x&&this._tTime>=this.totalDuration()||!v&&g)&&(p!==this._start&&Math.abs(d)===Math.abs(this._ts)||this._lock||((t||!_)&&(v===x&&this._ts>0||!v&&this._ts<0)&&Pt(this,1),e||t<0&&!g||!v&&!g&&x||(ye(this,v===x&&t>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(v<x&&this.timeScale()>0)&&this._prom())))}return this},i.add=function(t,e){var i=this;if(R(e)||(e=Qt(this,e,t)),!(t instanceof We)){if(L(t))return t.forEach((function(t){return i.add(t,e)})),this;if(B(t))return this.addLabel(t,e);if(!P(t))return this;t=ei.delayedCall(0,t)}return this!==t?Wt(this,t,e):this},i.getChildren=function(t,e,i,r){void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===r&&(r=-T);for(var s=[],n=this._first;n;)n._start>=r&&(n instanceof ei?e&&s.push(n):(i&&s.push(n),t&&s.push.apply(s,n.getChildren(!0,e,i)))),n=n._next;return s},i.getById=function(t){for(var e=this.getChildren(1,1,1),i=e.length;i--;)if(e[i].vars.id===t)return e[i]},i.remove=function(t){return B(t)?this.removeLabel(t):P(t)?this.killTweensOf(t):(t.parent===this&&Bt(this,t),t===this._recent&&(this._recent=this._last),Rt(this))},i.totalTime=function(e,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=xt(Ce.time-(this._ts>0?e/this._ts:(this.totalDuration()-e)/-this._ts))),t.prototype.totalTime.call(this,e,i),this._forcing=0,this):this._tTime},i.addLabel=function(t,e){return this.labels[t]=Qt(this,e),this},i.removeLabel=function(t){return delete this.labels[t],this},i.addPause=function(t,e,i){var r=ei.delayedCall(0,e||et,i);return r.data="isPause",this._hasPause=1,Wt(this,r,Qt(this,t))},i.removePause=function(t){var e=this._first;for(t=Qt(this,t);e;)e._start===t&&"isPause"===e.data&&Pt(e),e=e._next},i.killTweensOf=function(t,e,i){for(var r=this.getTweensOf(t,i),s=r.length;s--;)He!==r[s]&&r[s].kill(t,e);return this},i.getTweensOf=function(t,e){for(var i,r=[],s=ne(t),n=this._first,a=R(e);n;)n instanceof ei?vt(n._targets,s)&&(a?(!He||n._initted&&n._ts)&&n.globalTime(0)<=e&&n.globalTime(n.totalDuration())>e:!e||n.isActive())&&r.push(n):(i=n.getTweensOf(s,e)).length&&r.push.apply(r,i),n=n._next;return r},i.tweenTo=function(t,e){e=e||{};var i,r=this,s=Qt(r,t),n=e,a=n.startAt,o=n.onStart,h=n.onStartParams,u=n.immediateRender,l=ei.to(r,zt({ease:e.ease||"none",lazy:!1,immediateRender:!1,time:s,overwrite:"auto",duration:e.duration||Math.abs((s-(a&&"time"in a?a.time:r._time))/r.timeScale())||S,onStart:function(){if(r.pause(),!i){var t=e.duration||Math.abs((s-(a&&"time"in a?a.time:r._time))/r.timeScale());l._dur!==t&&Zt(l,t,0,1).render(l._time,!0,!0),i=1}o&&o.apply(l,h||[])}},e));return u?l.render(0):l},i.tweenFromTo=function(t,e,i){return this.tweenTo(e,zt({startAt:{time:Qt(this,t)}},i))},i.recent=function(){return this._recent},i.nextLabel=function(t){return void 0===t&&(t=this._time),fe(this,Qt(this,t))},i.previousLabel=function(t){return void 0===t&&(t=this._time),fe(this,Qt(this,t),1)},i.currentLabel=function(t){return arguments.length?this.seek(t,!0):this.previousLabel(this._time+S)},i.shiftChildren=function(t,e,i){void 0===i&&(i=0);for(var r,s=this._first,n=this.labels;s;)s._start>=i&&(s._start+=t,s._end+=t),s=s._next;if(e)for(r in n)n[r]>=i&&(n[r]+=t);return Rt(this)},i.invalidate=function(e){var i=this._first;for(this._lock=0;i;)i.invalidate(e),i=i._next;return t.prototype.invalidate.call(this,e)},i.clear=function(t){void 0===t&&(t=!0);for(var e,i=this._first;i;)e=i._next,this.remove(i),i=e;return this._dp&&(this._time=this._tTime=this._pTime=0),t&&(this.labels={}),Rt(this)},i.totalDuration=function(t){var e,i,r,s=0,n=this,a=n._last,o=T;if(arguments.length)return n.timeScale((n._repeat<0?n.duration():n.totalDuration())/(n.reversed()?-t:t));if(n._dirty){for(r=n.parent;a;)e=a._prev,a._dirty&&a.totalDuration(),(i=a._start)>o&&n._sort&&a._ts&&!n._lock?(n._lock=1,Wt(n,a,i-a._delay,1)._lock=0):o=i,i<0&&a._ts&&(s-=i,(!r&&!n._dp||r&&r.smoothChildTiming)&&(n._start+=i/n._ts,n._time-=i,n._tTime-=i),n.shiftChildren(-i,!1,-Infinity),o=0),a._end>s&&a._ts&&(s=a._end),a=e;Zt(n,n===h&&n._time>s?n._time:s,1,1),n._dirty=0}return n._tDur},e.updateRoot=function(t){if(h._ts&&(Mt(h,Dt(t,h)),p=Ce.frame),Ce.frame>=lt){lt+=w.autoSleep||120;var e=h._first;if((!e||!e._ts)&&w.autoSleep&&Ce._listeners.length<2){for(;e&&!e._ts;)e=e._next;e||Ce.sleep()}}},e}(We);zt(je.prototype,{_lock:0,_hasPause:0,_forcing:0});var He,Xe,Ye=function(t,e,i,r,s,n,a){var o,h,u,l,c,d,p,m,f=new fi(this._pt,t,e,0,1,ui,null,s),y=0,g=0;for(f.b=i,f.e=r,i+="",(p=~(r+="").indexOf("random("))&&(r=pe(r)),n&&(n(m=[i,r],t,e),i=m[0],r=m[1]),h=i.match(H)||[];o=H.exec(r);)l=o[0],c=r.substring(y,o.index),u?u=(u+1)%5:"rgba("===c.substr(-5)&&(u=1),l!==h[g++]&&(d=parseFloat(h[g-1])||0,f._pt={_next:f._pt,p:c||1===g?c:",",s:d,c:"="===l.charAt(1)?_t(d,l)-d:parseFloat(l)-d,m:u&&u<4?Math.round:0},y=H.lastIndex);return f.c=y<r.length?r.substring(y,r.length):"",f.fp=a,(X.test(r)||p)&&(f.e=0),this._pt=f,f},Ze=function(t,e,i,r,s,n,a,o,h,u){P(r)&&(r=r(s||0,t,n));var l,c=t[e],d="get"!==i?i:P(c)?h?t[e.indexOf("set")||!P(t["get"+e.substr(3)])?e:"get"+e.substr(3)](h):t[e]():c,p=P(c)?h?si:ri:ii;if(B(r)&&(~r.indexOf("random(")&&(r=pe(r)),"="===r.charAt(1)&&((l=_t(d,r)+(ee(d)||0))||0===l)&&(r=l)),!u||d!==r||Xe)return isNaN(d*r)||""===r?(!c&&!(e in t)&&$(e,r),Ye.call(this,t,e,d,r,p,o||w.stringFilter,h)):(l=new fi(this._pt,t,e,+d||0,r-(d||0),"boolean"==typeof c?hi:oi,0,p),h&&(l.fp=h),a&&l.modifier(a,this,t),this._pt=l)},Je=function(t,e,i,r,s,n){var a,o,h,u;if(ht[t]&&!1!==(a=new ht[t]).init(s,a.rawVars?e[t]:function(t,e,i,r,s){if(P(t)&&(t=$e(t,s,e,i,r)),!F(t)||t.style&&t.nodeType||L(t)||U(t))return B(t)?$e(t,s,e,i,r):t;var n,a={};for(n in t)a[n]=$e(t[n],s,e,i,r);return a}(e[t],r,s,n,i),i,r,n)&&(i._pt=o=new fi(i._pt,s,t,0,1,a.render,a,0,a.priority),i!==m))for(h=i._ptLookup[i._targets.indexOf(s)],u=a._props.length;u--;)h[a._props[u]]=o;return a},Ge=function t(e,i,r){var s,o,u,l,c,d,p,m,f,y,g,x,_,v=e.vars,b=v.ease,w=v.startAt,z=v.immediateRender,A=v.lazy,k=v.onUpdate,C=v.runBackwards,E=v.yoyoEase,O=v.keyframes,B=v.autoRevert,P=e._dur,R=e._startAt,I=e._targets,F=e.parent,N=F&&"nested"===F.data?F.vars.targets:I,D="auto"===e._overwrite&&!n,U=e.timeline;if(U&&(!O||!b)&&(b="none"),e._ease=Ve(b,M.ease),e._yEase=E?Ie(Ve(!0===E?b:E,M.ease)):0,E&&e._yoyo&&!e._repeat&&(E=e._yEase,e._yEase=e._ease,e._ease=E),e._from=!U&&!!v.runBackwards,!U||O&&!v.stagger){if(x=(m=I[0]?mt(I[0]).harness:0)&&v[m.prop],s=Ct(v,nt),R&&(R._zTime<0&&R.progress(1),i<0&&C&&z&&!B?R.render(-1,!0):R.revert(C&&P?rt:it),R._lazy=0),w){if(Pt(e._startAt=ei.set(I,zt({data:"isStart",overwrite:!1,parent:F,immediateRender:!0,lazy:!R&&V(A),startAt:null,delay:0,onUpdate:k&&function(){return ye(e,"onUpdate")},stagger:0},w))),e._startAt._dp=0,e._startAt._sat=e,i<0&&(a||!z&&!B)&&e._startAt.revert(rt),z&&P&&i<=0&&r<=0)return void(i&&(e._zTime=i))}else if(C&&P&&!R)if(i&&(z=!1),u=zt({overwrite:!1,data:"isFromStart",lazy:z&&!R&&V(A),immediateRender:z,stagger:0,parent:F},s),x&&(u[m.prop]=x),Pt(e._startAt=ei.set(I,u)),e._startAt._dp=0,e._startAt._sat=e,i<0&&(a?e._startAt.revert(rt):e._startAt.render(-1,!0)),e._zTime=i,z){if(!i)return}else t(e._startAt,S,S);for(e._pt=e._ptCache=0,A=P&&V(A)||A&&!P,o=0;o<I.length;o++){if(p=(c=I[o])._gsap||pt(I)[o]._gsap,e._ptLookup[o]=y={},ot[p.id]&&at.length&&bt(),g=N===I?o:N.indexOf(c),m&&!1!==(f=new m).init(c,x||s,e,g,N)&&(e._pt=l=new fi(e._pt,c,f.name,0,1,f.render,f,0,f.priority),f._props.forEach((function(t){y[t]=l})),f.priority&&(d=1)),!m||x)for(u in s)ht[u]&&(f=Je(u,s,e,g,c,N))?f.priority&&(d=1):y[u]=l=Ze.call(e,c,u,"get",s[u],g,N,0,v.stringFilter);e._op&&e._op[o]&&e.kill(c,e._op[o]),D&&e._pt&&(He=e,h.killTweensOf(c,y,e.globalTime(i)),_=!e.parent,He=0),e._pt&&A&&(ot[p.id]=1)}d&&mi(e),e._onInit&&e._onInit(e)}e._onUpdate=k,e._initted=(!e._op||e._pt)&&!_,O&&i<=0&&U.render(T,!0,!0)},Qe=function(t,e,i,r){var s,n,a=e.ease||r||"power1.inOut";if(L(e))n=i[t]||(i[t]=[]),e.forEach((function(t,i){return n.push({t:i/(e.length-1)*100,v:t,e:a})}));else for(s in e)n=i[s]||(i[s]=[]),"ease"===s||n.push({t:parseFloat(t),v:e[s],e:a})},$e=function(t,e,i,r,s){return P(t)?t.call(e,i,r,s):B(t)&&~t.indexOf("random(")?pe(t):t},Ke=dt+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",ti={};yt(Ke+",id,stagger,delay,duration,paused,scrollTrigger",(function(t){return ti[t]=1}));var ei=function(t){function e(e,i,s,a){var o;"number"==typeof i&&(s.duration=i,i=s,s=null);var u,l,c,d,p,m,f,y,g=(o=t.call(this,a?i:Et(i))||this).vars,x=g.duration,_=g.delay,v=g.immediateRender,b=g.stagger,M=g.overwrite,T=g.keyframes,S=g.defaults,z=g.scrollTrigger,A=g.yoyoEase,k=i.parent||h,C=(L(e)||U(e)?R(e[0]):"length"in i)?[e]:ne(e);if(o._targets=C.length?pt(C):K("GSAP target "+e+" not found. https://gsap.com",!w.nullTargetWarn)||[],o._ptLookup=[],o._overwrite=M,T||b||D(x)||D(_)){if(i=o.vars,(u=o.timeline=new je({data:"nested",defaults:S||{},targets:k&&"nested"===k.data?k.vars.targets:C})).kill(),u.parent=u._dp=r(o),u._start=0,b||D(x)||D(_)){if(d=C.length,f=b&&he(b),F(b))for(p in b)~Ke.indexOf(p)&&(y||(y={}),y[p]=b[p]);for(l=0;l<d;l++)(c=Ct(i,ti)).stagger=0,A&&(c.yoyoEase=A),y&&At(c,y),m=C[l],c.duration=+$e(x,r(o),l,m,C),c.delay=(+$e(_,r(o),l,m,C)||0)-o._delay,!b&&1===d&&c.delay&&(o._delay=_=c.delay,o._start+=_,c.delay=0),u.to(m,c,f?f(l,m,C):0),u._ease=Oe.none;u.duration()?x=_=0:o.timeline=0}else if(T){Et(zt(u.vars.defaults,{ease:"none"})),u._ease=Ve(T.ease||i.ease||"none");var E,O,B,P=0;if(L(T))T.forEach((function(t){return u.to(C,t,">")})),u.duration();else{for(p in c={},T)"ease"===p||"easeEach"===p||Qe(p,T[p],c,T.easeEach);for(p in c)for(E=c[p].sort((function(t,e){return t.t-e.t})),P=0,l=0;l<E.length;l++)(B={ease:(O=E[l]).e,duration:(O.t-(l?E[l-1].t:0))/100*x})[p]=O.v,u.to(C,B,P),P+=B.duration;u.duration()<x&&u.to({},{duration:x-u.duration()})}}x||o.duration(x=u.duration())}else o.timeline=0;return!0!==M||n||(He=r(o),h.killTweensOf(C),He=0),Wt(k,r(o),s),i.reversed&&o.reverse(),i.paused&&o.paused(!0),(v||!x&&!T&&o._start===xt(k._time)&&V(v)&&Ft(r(o))&&"nested"!==k.data)&&(o._tTime=-1e-8,o.render(Math.max(0,-_)||0)),z&&jt(r(o),z),o}s(e,t);var i=e.prototype;return i.render=function(t,e,i){var r,s,n,o,h,u,l,c,d,p=this._time,m=this._tDur,f=this._dur,y=t<0,g=t>m-S&&!y?m:t<S?0:t;if(f){if(g!==this._tTime||!t||i||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==y||this._lazy){if(r=g,c=this.timeline,this._repeat){if(o=f+this._rDelay,this._repeat<-1&&y)return this.totalTime(100*o+t,e,i);if(r=xt(g%o),g===m?(n=this._repeat,r=f):(n=~~(h=xt(g/o)))&&n===h?(r=f,n--):r>f&&(r=f),(u=this._yoyo&&1&n)&&(d=this._yEase,r=f-r),h=Nt(this._tTime,o),r===p&&!i&&this._initted&&n===h)return this._tTime=g,this;n!==h&&(c&&this._yEase&&Fe(c,u),this.vars.repeatRefresh&&!u&&!this._lock&&r!==o&&this._initted&&(this._lock=i=1,this.render(xt(o*n),!0).invalidate()._lock=0))}if(!this._initted){if(Ht(this,y?t:r,i,e,g))return this._tTime=0,this;if(!(p===this._time||i&&this.vars.repeatRefresh&&n!==h))return this;if(f!==this._dur)return this.render(t,e,i)}if(this._tTime=g,this._time=r,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=l=(d||this._ease)(r/f),this._from&&(this.ratio=l=1-l),!p&&g&&!e&&!h&&(ye(this,"onStart"),this._tTime!==g))return this;for(s=this._pt;s;)s.r(l,s.d),s=s._next;c&&c.render(t<0?t:c._dur*c._ease(r/this._dur),e,i)||this._startAt&&(this._zTime=t),this._onUpdate&&!e&&(y&&It(this,t,0,i),ye(this,"onUpdate")),this._repeat&&n!==h&&this.vars.onRepeat&&!e&&this.parent&&ye(this,"onRepeat"),g!==this._tDur&&g||this._tTime!==g||(y&&!this._onUpdate&&It(this,t,0,!0),(t||!f)&&(g===this._tDur&&this._ts>0||!g&&this._ts<0)&&Pt(this,1),e||y&&!p||!(g||p||u)||(ye(this,g===m?"onComplete":"onReverseComplete",!0),this._prom&&!(g<m&&this.timeScale()>0)&&this._prom()))}}else!function(t,e,i,r){var s,n,o,h=t.ratio,u=e<0||!e&&(!t._start&&Xt(t)&&(t._initted||!Yt(t))||(t._ts<0||t._dp._ts<0)&&!Yt(t))?0:1,l=t._rDelay,c=0;if(l&&t._repeat&&(c=te(0,t._tDur,e),n=Nt(c,l),t._yoyo&&1&n&&(u=1-u),n!==Nt(t._tTime,l)&&(h=1-u,t.vars.repeatRefresh&&t._initted&&t.invalidate())),u!==h||a||r||t._zTime===S||!e&&t._zTime){if(!t._initted&&Ht(t,e,r,i,c))return;for(o=t._zTime,t._zTime=e||(i?S:0),i||(i=e&&!o),t.ratio=u,t._from&&(u=1-u),t._time=0,t._tTime=c,s=t._pt;s;)s.r(u,s.d),s=s._next;e<0&&It(t,e,0,!0),t._onUpdate&&!i&&ye(t,"onUpdate"),c&&t._repeat&&!i&&t.parent&&ye(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===u&&(u&&Pt(t,1),i||a||(ye(t,u?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)}(this,t,e,i);return this},i.targets=function(){return this._targets},i.invalidate=function(e){return(!e||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(e),t.prototype.invalidate.call(this,e)},i.resetTo=function(t,e,i,r,s){f||Ce.wake(),this._ts||this.play();var n=Math.min(this._dur,(this._dp._time-this._start)*this._ts);return this._initted||Ge(this,n),function(t,e,i,r,s,n,a,o){var h,u,l,c,d=(t._pt&&t._ptCache||(t._ptCache={}))[e];if(!d)for(d=t._ptCache[e]=[],l=t._ptLookup,c=t._targets.length;c--;){if((h=l[c][e])&&h.d&&h.d._pt)for(h=h.d._pt;h&&h.p!==e&&h.fp!==e;)h=h._next;if(!h)return Xe=1,t.vars[e]="+=0",Ge(t,a),Xe=0,o?K(e+" not eligible for reset"):1;d.push(h)}for(c=d.length;c--;)(h=(u=d[c])._pt||u).s=!r&&0!==r||s?h.s+(r||0)+n*h.c:r,h.c=i-h.s,u.e&&(u.e=gt(i)+ee(u.e)),u.b&&(u.b=h.s+ee(u.b))}(this,t,e,i,r,this._ease(n/this._dur),n,s)?this.resetTo(t,e,i,r,1):(Lt(this,0),this.parent||Ot(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},i.kill=function(t,e){if(void 0===e&&(e="all"),!(t||e&&"all"!==e))return this._lazy=this._pt=0,this.parent?ge(this):this.scrollTrigger&&this.scrollTrigger.kill(!!a),this;if(this.timeline){var i=this.timeline.totalDuration();return this.timeline.killTweensOf(t,e,He&&!0!==He.vars.overwrite)._first||ge(this),this.parent&&i!==this.timeline.totalDuration()&&Zt(this,this._dur*this.timeline._tDur/i,0,1),this}var r,s,n,o,h,u,l,c=this._targets,d=t?ne(t):c,p=this._ptLookup,m=this._pt;if((!e||"all"===e)&&function(t,e){for(var i=t.length,r=i===e.length;r&&i--&&t[i]===e[i];);return i<0}(c,d))return"all"===e&&(this._pt=0),ge(this);for(r=this._op=this._op||[],"all"!==e&&(B(e)&&(h={},yt(e,(function(t){return h[t]=1})),e=h),e=function(t,e){var i,r,s,n,a=t[0]?mt(t[0]).harness:0,o=a&&a.aliases;if(!o)return e;for(r in i=At({},e),o)if(r in i)for(s=(n=o[r].split(",")).length;s--;)i[n[s]]=i[r];return i}(c,e)),l=c.length;l--;)if(~d.indexOf(c[l]))for(h in s=p[l],"all"===e?(r[l]=e,o=s,n={}):(n=r[l]=r[l]||{},o=e),o)(u=s&&s[h])&&("kill"in u.d&&!0!==u.d.kill(h)||Bt(this,u,"_pt"),delete s[h]),"all"!==n&&(n[h]=1);return this._initted&&!this._pt&&m&&ge(this),this},e.to=function(t,i){return new e(t,i,arguments[2])},e.from=function(t,e){return $t(1,arguments)},e.delayedCall=function(t,i,r,s){return new e(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:t,onComplete:i,onReverseComplete:i,onCompleteParams:r,onReverseCompleteParams:r,callbackScope:s})},e.fromTo=function(t,e,i){return $t(2,arguments)},e.set=function(t,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new e(t,i)},e.killTweensOf=function(t,e,i){return h.killTweensOf(t,e,i)},e}(We);zt(ei.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),yt("staggerTo,staggerFrom,staggerFromTo",(function(t){ei[t]=function(){var e=new je,i=ie.call(arguments,0);return i.splice("staggerFromTo"===t?5:4,0,0),e[t].apply(e,i)}}));var ii=function(t,e,i){return t[e]=i},ri=function(t,e,i){return t[e](i)},si=function(t,e,i,r){return t[e](r.fp,i)},ni=function(t,e,i){return t.setAttribute(e,i)},ai=function(t,e){return P(t[e])?ri:I(t[e])&&t.setAttribute?ni:ii},oi=function(t,e){return e.set(e.t,e.p,Math.round(1e6*(e.s+e.c*t))/1e6,e)},hi=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},ui=function(t,e){var i=e._pt,r="";if(!t&&e.b)r=e.b;else if(1===t&&e.e)r=e.e;else{for(;i;)r=i.p+(i.m?i.m(i.s+i.c*t):Math.round(1e4*(i.s+i.c*t))/1e4)+r,i=i._next;r+=e.c}e.set(e.t,e.p,r,e)},li=function(t,e){for(var i=e._pt;i;)i.r(t,i.d),i=i._next},ci=function(t,e,i,r){for(var s,n=this._pt;n;)s=n._next,n.p===r&&n.modifier(t,e,i),n=s},di=function(t){for(var e,i,r=this._pt;r;)i=r._next,r.p===t&&!r.op||r.op===t?Bt(this,r,"_pt"):r.dep||(e=1),r=i;return!e},pi=function(t,e,i,r){r.mSet(t,e,r.m.call(r.tween,i,r.mt),r)},mi=function(t){for(var e,i,r,s,n=t._pt;n;){for(e=n._next,i=r;i&&i.pr>n.pr;)i=i._next;(n._prev=i?i._prev:s)?n._prev._next=n:r=n,(n._next=i)?i._prev=n:s=n,n=e}t._pt=r},fi=function(){function t(t,e,i,r,s,n,a,o,h){this.t=e,this.s=r,this.c=s,this.p=i,this.r=n||oi,this.d=a||this,this.set=o||ii,this.pr=h||0,this._next=t,t&&(t._prev=this)}return t.prototype.modifier=function(t,e,i){this.mSet=this.mSet||this.set,this.set=pi,this.m=t,this.mt=i,this.tween=e},t}();yt(dt+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",(function(t){return nt[t]=1})),J.TweenMax=J.TweenLite=ei,J.TimelineLite=J.TimelineMax=je,h=new je({sortChildren:!1,defaults:M,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),w.stringFilter=ke;var yi=[],gi={},xi=[],_i=0,vi=0,bi=function(t){return(gi[t]||xi).map((function(t){return t()}))},wi=function(){var t=Date.now(),e=[];t-_i>2&&(bi("matchMediaInit"),yi.forEach((function(t){var i,r,s,n,a=t.queries,o=t.conditions;for(r in a)(i=u.matchMedia(a[r]).matches)&&(s=1),i!==o[r]&&(o[r]=i,n=1);n&&(t.revert(),s&&e.push(t))})),bi("matchMediaRevert"),e.forEach((function(t){return t.onMatch(t,(function(e){return t.add(null,e)}))})),_i=t,bi("matchMedia"))},Mi=function(){function t(t,e){this.selector=e&&ae(e),this.data=[],this._r=[],this.isReverted=!1,this.id=vi++,t&&this.add(t)}var e=t.prototype;return e.add=function(t,e,i){P(t)&&(i=e,e=t,t=P);var r=this,s=function(){var t,s=o,n=r.selector;return s&&s!==r&&s.data.push(r),i&&(r.selector=ae(i)),o=r,t=e.apply(r,arguments),P(t)&&r._r.push(t),o=s,r.selector=n,r.isReverted=!1,t};return r.last=s,t===P?s(r,(function(t){return r.add(null,t)})):t?r[t]=s:s},e.ignore=function(t){var e=o;o=null,t(this),o=e},e.getTweens=function(){var e=[];return this.data.forEach((function(i){return i instanceof t?e.push.apply(e,i.getTweens()):i instanceof ei&&!(i.parent&&"nested"===i.parent.data)&&e.push(i)})),e},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(t,e){var i=this;if(t?function(){for(var e,r=i.getTweens(),s=i.data.length;s--;)"isFlip"===(e=i.data[s]).data&&(e.revert(),e.getChildren(!0,!0,!1).forEach((function(t){return r.splice(r.indexOf(t),1)})));for(r.map((function(t){return{g:t._dur||t._delay||t._sat&&!t._sat.vars.immediateRender?t.globalTime(0):-1/0,t}})).sort((function(t,e){return e.g-t.g||-1/0})).forEach((function(e){return e.t.revert(t)})),s=i.data.length;s--;)(e=i.data[s])instanceof je?"nested"!==e.data&&(e.scrollTrigger&&e.scrollTrigger.revert(),e.kill()):!(e instanceof ei)&&e.revert&&e.revert(t);i._r.forEach((function(e){return e(t,i)})),i.isReverted=!0}():this.data.forEach((function(t){return t.kill&&t.kill()})),this.clear(),e)for(var r=yi.length;r--;)yi[r].id===this.id&&yi.splice(r,1)},e.revert=function(t){this.kill(t||{})},t}(),Ti=function(){function t(t){this.contexts=[],this.scope=t,o&&o.data.push(this)}var e=t.prototype;return e.add=function(t,e,i){F(t)||(t={matches:t});var r,s,n,a=new Mi(0,i||this.scope),h=a.conditions={};for(s in o&&!a.selector&&(a.selector=o.selector),this.contexts.push(a),e=a.add("onMatch",e),a.queries=t,t)"all"===s?n=1:(r=u.matchMedia(t[s]))&&(yi.indexOf(a)<0&&yi.push(a),(h[s]=r.matches)&&(n=1),r.addListener?r.addListener(wi):r.addEventListener("change",wi));return n&&e(a,(function(t){return a.add(null,t)})),this},e.revert=function(t){this.kill(t||{})},e.kill=function(t){this.contexts.forEach((function(e){return e.kill(t,!0)}))},t}(),Si={registerPlugin:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];e.forEach((function(t){return _e(t)}))},timeline:function(t){return new je(t)},getTweensOf:function(t,e){return h.getTweensOf(t,e)},getProperty:function(t,e,i,r){B(t)&&(t=ne(t)[0]);var s=mt(t||{}).get,n=i?St:Tt;return"native"===i&&(i=""),t?e?n((ht[e]&&ht[e].get||s)(t,e,i,r)):function(e,i,r){return n((ht[e]&&ht[e].get||s)(t,e,i,r))}:t},quickSetter:function(t,e,i){if((t=ne(t)).length>1){var r=t.map((function(t){return ki.quickSetter(t,e,i)})),s=r.length;return function(t){for(var e=s;e--;)r[e](t)}}t=t[0]||{};var n=ht[e],a=mt(t),o=a.harness&&(a.harness.aliases||{})[e]||e,h=n?function(e){var r=new n;m._pt=0,r.init(t,i?e+i:e,m,0,[t]),r.render(1,r),m._pt&&li(1,m)}:a.set(t,o);return n?h:function(e){return h(t,o,i?e+i:e,a,1)}},quickTo:function(t,e,i){var r,s=ki.to(t,zt(((r={})[e]="+=0.1",r.paused=!0,r.stagger=0,r),i||{})),n=function(t,i,r){return s.resetTo(e,t,i,r)};return n.tween=s,n},isTweening:function(t){return h.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=Ve(t.ease,M.ease)),kt(M,t||{})},config:function(t){return kt(w,t||{})},registerEffect:function(t){var e=t.name,i=t.effect,r=t.plugins,s=t.defaults,n=t.extendTimeline;(r||"").split(",").forEach((function(t){return t&&!ht[t]&&!J[t]&&K(e+" effect requires "+t+" plugin.")})),ut[e]=function(t,e,r){return i(ne(t),zt(e||{},s),r)},n&&(je.prototype[e]=function(t,i,r){return this.add(ut[e](t,F(i)?i:(r=i)&&{},this),r)})},registerEase:function(t,e){Oe[t]=Ve(e)},parseEase:function(t,e){return arguments.length?Ve(t,e):Oe},getById:function(t){return h.getById(t)},exportRoot:function(t,e){void 0===t&&(t={});var i,r,s=new je(t);for(s.smoothChildTiming=V(t.smoothChildTiming),h.remove(s),s._dp=0,s._time=s._tTime=h._time,i=h._first;i;)r=i._next,!e&&!i._dur&&i instanceof ei&&i.vars.onComplete===i._targets[0]||Wt(s,i,i._start-i._delay),i=r;return Wt(h,s,0),s},context:function(t,e){return t?new Mi(t,e):o},matchMedia:function(t){return new Ti(t)},matchMediaRefresh:function(){return yi.forEach((function(t){var e,i,r=t.conditions;for(i in r)r[i]&&(r[i]=!1,e=1);e&&t.revert()}))||wi()},addEventListener:function(t,e){var i=gi[t]||(gi[t]=[]);~i.indexOf(e)||i.push(e)},removeEventListener:function(t,e){var i=gi[t],r=i&&i.indexOf(e);r>=0&&i.splice(r,1)},utils:{wrap:function t(e,i,r){var s=i-e;return L(e)?de(e,t(0,e.length),i):Kt(r,(function(t){return(s+(t-e)%s)%s+e}))},wrapYoyo:function t(e,i,r){var s=i-e,n=2*s;return L(e)?de(e,t(0,e.length-1),i):Kt(r,(function(t){return e+((t=(n+(t-e)%n)%n||0)>s?n-t:t)}))},distribute:he,random:ce,snap:le,normalize:function(t,e,i){return me(t,e,0,1,i)},getUnit:ee,clamp:function(t,e,i){return Kt(i,(function(i){return te(t,e,i)}))},splitColor:Me,toArray:ne,selector:ae,mapRange:me,pipe:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t){return e.reduce((function(t,e){return e(t)}),t)}},unitize:function(t,e){return function(i){return t(parseFloat(i))+(e||ee(i))}},interpolate:function t(e,i,r,s){var n=isNaN(e+i)?0:function(t){return(1-t)*e+t*i};if(!n){var a,o,h,u,l,c=B(e),d={};if(!0===r&&(s=1)&&(r=null),c)e={p:e},i={p:i};else if(L(e)&&!L(i)){for(h=[],u=e.length,l=u-2,o=1;o<u;o++)h.push(t(e[o-1],e[o]));u--,n=function(t){t*=u;var e=Math.min(l,~~t);return h[e](t-e)},r=i}else s||(e=At(L(e)?[]:{},e));if(!h){for(a in i)Ze.call(d,e,a,"get",i[a]);n=function(t){return li(t,d)||(c?e.p:e)}}}return Kt(r,n)},shuffle:oe},install:Q,effects:ut,ticker:Ce,updateRoot:je.updateRoot,plugins:ht,globalTimeline:h,core:{PropTween:fi,globals:tt,Tween:ei,Timeline:je,Animation:We,getCache:mt,_removeLinkedListItem:Bt,reverting:function(){return a},context:function(t){return t&&o&&(o.data.push(t),t._ctx=o),o},suppressOverwrites:function(t){return n=t}}};yt("to,from,fromTo,delayedCall,set,killTweensOf",(function(t){return Si[t]=ei[t]})),Ce.add(je.updateRoot),m=Si.to({},{duration:0});var zi=function(t,e){for(var i=t._pt;i&&i.p!==e&&i.op!==e&&i.fp!==e;)i=i._next;return i},Ai=function(t,e){return{name:t,headless:1,rawVars:1,init:function(t,i,r){r._onInit=function(t){var r,s;if(B(i)&&(r={},yt(i,(function(t){return r[t]=1})),i=r),e){for(s in r={},i)r[s]=e(i[s]);i=r}!function(t,e){var i,r,s,n=t._targets;for(i in e)for(r=n.length;r--;)(s=t._ptLookup[r][i])&&(s=s.d)&&(s._pt&&(s=zi(s,i)),s&&s.modifier&&s.modifier(e[i],t,n[r],i))}(t,i)}}}},ki=Si.registerPlugin({name:"attr",init:function(t,e,i,r,s){var n,a,o;for(n in this.tween=i,e)o=t.getAttribute(n)||"",(a=this.add(t,"setAttribute",(o||0)+"",e[n],r,s,0,0,n)).op=n,a.b=o,this._props.push(n)},render:function(t,e){for(var i=e._pt;i;)a?i.set(i.t,i.p,i.b,i):i.r(t,i.d),i=i._next}},{name:"endArray",headless:1,init:function(t,e){for(var i=e.length;i--;)this.add(t,i,t[i]||0,e[i],0,0,0,0,0,1)}},Ai("roundProps",ue),Ai("modifiers"),Ai("snap",le))||Si;ei.version=je.version=ki.version="3.13.0",d=1,N()&&Ee();Oe.Power0,Oe.Power1,Oe.Power2,Oe.Power3,Oe.Power4,Oe.Linear,Oe.Quad,Oe.Cubic,Oe.Quart,Oe.Quint,Oe.Strong,Oe.Elastic,Oe.Back,Oe.SteppedEase,Oe.Bounce,Oe.Sine,Oe.Expo,Oe.Circ;var Ci,Ei,Oi,Bi,Pi,Ri,Ii,Fi,Vi={},Ni=180/Math.PI,Di=Math.PI/180,Ui=Math.atan2,Li=/([A-Z])/g,qi=/(left|right|width|margin|padding|x)/i,Wi=/[\s,\(]\S/,ji={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Hi=function(t,e){return e.set(e.t,e.p,Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)},Xi=function(t,e){return e.set(e.t,e.p,1===t?e.e:Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)},Yi=function(t,e){return e.set(e.t,e.p,t?Math.round(1e4*(e.s+e.c*t))/1e4+e.u:e.b,e)},Zi=function(t,e){var i=e.s+e.c*t;e.set(e.t,e.p,~~(i+(i<0?-.5:.5))+e.u,e)},Ji=function(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)},Gi=function(t,e){return e.set(e.t,e.p,1!==t?e.b:e.e,e)},Qi=function(t,e,i){return t.style[e]=i},$i=function(t,e,i){return t.style.setProperty(e,i)},Ki=function(t,e,i){return t._gsap[e]=i},tr=function(t,e,i){return t._gsap.scaleX=t._gsap.scaleY=i},er=function(t,e,i,r,s){var n=t._gsap;n.scaleX=n.scaleY=i,n.renderTransform(s,n)},ir=function(t,e,i,r,s){var n=t._gsap;n[e]=i,n.renderTransform(s,n)},rr="transform",sr=rr+"Origin",nr=function t(e,i){var r=this,s=this.target,n=s.style,a=s._gsap;if(e in Vi&&n){if(this.tfm=this.tfm||{},"transform"===e)return ji.transform.split(",").forEach((function(e){return t.call(r,e,i)}));if(~(e=ji[e]||e).indexOf(",")?e.split(",").forEach((function(t){return r.tfm[t]=Mr(s,t)})):this.tfm[e]=a.x?a[e]:Mr(s,e),e===sr&&(this.tfm.zOrigin=a.zOrigin),this.props.indexOf(rr)>=0)return;a.svg&&(this.svgo=s.getAttribute("data-svg-origin"),this.props.push(sr,i,"")),e=rr}(n||i)&&this.props.push(e,i,n[e])},ar=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},or=function(){var t,e,i=this.props,r=this.target,s=r.style,n=r._gsap;for(t=0;t<i.length;t+=3)i[t+1]?2===i[t+1]?r[i[t]](i[t+2]):r[i[t]]=i[t+2]:i[t+2]?s[i[t]]=i[t+2]:s.removeProperty("--"===i[t].substr(0,2)?i[t]:i[t].replace(Li,"-$1").toLowerCase());if(this.tfm){for(e in this.tfm)n[e]=this.tfm[e];n.svg&&(n.renderTransform(),r.setAttribute("data-svg-origin",this.svgo||"")),(t=Ii())&&t.isStart||s[rr]||(ar(s),n.zOrigin&&s[sr]&&(s[sr]+=" "+n.zOrigin+"px",n.zOrigin=0,n.renderTransform()),n.uncache=1)}},hr=function(t,e){var i={target:t,props:[],revert:or,save:nr};return t._gsap||ki.core.getCache(t),e&&t.style&&t.nodeType&&e.split(",").forEach((function(t){return i.save(t)})),i},ur=function(t,e){var i=Ei.createElementNS?Ei.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):Ei.createElement(t);return i&&i.style?i:Ei.createElement(t)},lr=function t(e,i,r){var s=getComputedStyle(e);return s[i]||s.getPropertyValue(i.replace(Li,"-$1").toLowerCase())||s.getPropertyValue(i)||!r&&t(e,dr(i)||i,1)||""},cr="O,Moz,ms,Ms,Webkit".split(","),dr=function(t,e,i){var r=(e||Pi).style,s=5;if(t in r&&!i)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);s--&&!(cr[s]+t in r););return s<0?null:(3===s?"ms":s>=0?cr[s]:"")+t},pr=function(){"undefined"!=typeof window&&window.document&&(Ci=window,Ei=Ci.document,Oi=Ei.documentElement,Pi=ur("div")||{style:{}},ur("div"),rr=dr(rr),sr=rr+"Origin",Pi.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Fi=!!dr("perspective"),Ii=ki.core.reverting,Bi=1)},mr=function(t){var e,i=t.ownerSVGElement,r=ur("svg",i&&i.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=t.cloneNode(!0);s.style.display="block",r.appendChild(s),Oi.appendChild(r);try{e=s.getBBox()}catch(t){}return r.removeChild(s),Oi.removeChild(r),e},fr=function(t,e){for(var i=e.length;i--;)if(t.hasAttribute(e[i]))return t.getAttribute(e[i])},yr=function(t){var e,i;try{e=t.getBBox()}catch(r){e=mr(t),i=1}return e&&(e.width||e.height)||i||(e=mr(t)),!e||e.width||e.x||e.y?e:{x:+fr(t,["x","cx","x1"])||0,y:+fr(t,["y","cy","y1"])||0,width:0,height:0}},gr=function(t){return!(!t.getCTM||t.parentNode&&!t.ownerSVGElement||!yr(t))},xr=function(t,e){if(e){var i,r=t.style;e in Vi&&e!==sr&&(e=rr),r.removeProperty?("ms"!==(i=e.substr(0,2))&&"webkit"!==e.substr(0,6)||(e="-"+e),r.removeProperty("--"===i?e:e.replace(Li,"-$1").toLowerCase())):r.removeAttribute(e)}},_r=function(t,e,i,r,s,n){var a=new fi(t._pt,e,i,0,1,n?Gi:Ji);return t._pt=a,a.b=r,a.e=s,t._props.push(i),a},vr={deg:1,rad:1,turn:1},br={grid:1,flex:1},wr=function t(e,i,r,s){var n,a,o,h,u=parseFloat(r)||0,l=(r+"").trim().substr((u+"").length)||"px",c=Pi.style,d=qi.test(i),p="svg"===e.tagName.toLowerCase(),m=(p?"client":"offset")+(d?"Width":"Height"),f=100,y="px"===s,g="%"===s;if(s===l||!u||vr[s]||vr[l])return u;if("px"!==l&&!y&&(u=t(e,i,r,"px")),h=e.getCTM&&gr(e),(g||"%"===l)&&(Vi[i]||~i.indexOf("adius")))return n=h?e.getBBox()[d?"width":"height"]:e[m],gt(g?u/n*f:u/100*n);if(c[d?"width":"height"]=f+(y?l:s),a="rem"!==s&&~i.indexOf("adius")||"em"===s&&e.appendChild&&!p?e:e.parentNode,h&&(a=(e.ownerSVGElement||{}).parentNode),a&&a!==Ei&&a.appendChild||(a=Ei.body),(o=a._gsap)&&g&&o.width&&d&&o.time===Ce.time&&!o.uncache)return gt(u/o.width*f);if(!g||"height"!==i&&"width"!==i)(g||"%"===l)&&!br[lr(a,"display")]&&(c.position=lr(e,"position")),a===e&&(c.position="static"),a.appendChild(Pi),n=Pi[m],a.removeChild(Pi),c.position="absolute";else{var x=e.style[i];e.style[i]=f+s,n=e[m],x?e.style[i]=x:xr(e,i)}return d&&g&&((o=mt(a)).time=Ce.time,o.width=a[m]),gt(y?n*u/f:n&&u?f/n*u:0)},Mr=function(t,e,i,r){var s;return Bi||pr(),e in ji&&"transform"!==e&&~(e=ji[e]).indexOf(",")&&(e=e.split(",")[0]),Vi[e]&&"transform"!==e?(s=Rr(t,r),s="transformOrigin"!==e?s[e]:s.svg?s.origin:Ir(lr(t,sr))+" "+s.zOrigin+"px"):(!(s=t.style[e])||"auto"===s||r||~(s+"").indexOf("calc("))&&(s=Ar[e]&&Ar[e](t,e,i)||lr(t,e)||ft(t,e)||("opacity"===e?1:0)),i&&!~(s+"").trim().indexOf(" ")?wr(t,e,s,i)+i:s},Tr=function(t,e,i,r){if(!i||"none"===i){var s=dr(e,t,1),n=s&&lr(t,s,1);n&&n!==i?(e=s,i=n):"borderColor"===e&&(i=lr(t,"borderTopColor"))}var a,o,h,u,l,c,d,p,m,f,y,g=new fi(this._pt,t.style,e,0,1,ui),x=0,_=0;if(g.b=i,g.e=r,i+="","var(--"===(r+="").substring(0,6)&&(r=lr(t,r.substring(4,r.indexOf(")")))),"auto"===r&&(c=t.style[e],t.style[e]=r,r=lr(t,e)||r,c?t.style[e]=c:xr(t,e)),ke(a=[i,r]),r=a[1],h=(i=a[0]).match(j)||[],(r.match(j)||[]).length){for(;o=j.exec(r);)d=o[0],m=r.substring(x,o.index),l?l=(l+1)%5:"rgba("!==m.substr(-5)&&"hsla("!==m.substr(-5)||(l=1),d!==(c=h[_++]||"")&&(u=parseFloat(c)||0,y=c.substr((u+"").length),"="===d.charAt(1)&&(d=_t(u,d)+y),p=parseFloat(d),f=d.substr((p+"").length),x=j.lastIndex-f.length,f||(f=f||w.units[e]||y,x===r.length&&(r+=f,g.e+=f)),y!==f&&(u=wr(t,e,c,f)||0),g._pt={_next:g._pt,p:m||1===_?m:",",s:u,c:p-u,m:l&&l<4||"zIndex"===e?Math.round:0});g.c=x<r.length?r.substring(x,r.length):""}else g.r="display"===e&&"none"===r?Gi:Ji;return X.test(r)&&(g.e=0),this._pt=g,g},Sr={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},zr=function(t,e){if(e.tween&&e.tween._time===e.tween._dur){var i,r,s,n=e.t,a=n.style,o=e.u,h=n._gsap;if("all"===o||!0===o)a.cssText="",r=1;else for(s=(o=o.split(",")).length;--s>-1;)i=o[s],Vi[i]&&(r=1,i="transformOrigin"===i?sr:rr),xr(n,i);r&&(xr(n,rr),h&&(h.svg&&n.removeAttribute("transform"),a.scale=a.rotate=a.translate="none",Rr(n,1),h.uncache=1,ar(a)))}},Ar={clearProps:function(t,e,i,r,s){if("isFromStart"!==s.data){var n=t._pt=new fi(t._pt,e,i,0,0,zr);return n.u=r,n.pr=-10,n.tween=s,t._props.push(i),1}}},kr=[1,0,0,1,0,0],Cr={},Er=function(t){return"matrix(1, 0, 0, 1, 0, 0)"===t||"none"===t||!t},Or=function(t){var e=lr(t,rr);return Er(e)?kr:e.substr(7).match(W).map(gt)},Br=function(t,e){var i,r,s,n,a=t._gsap||mt(t),o=t.style,h=Or(t);return a.svg&&t.getAttribute("transform")?"1,0,0,1,0,0"===(h=[(s=t.transform.baseVal.consolidate().matrix).a,s.b,s.c,s.d,s.e,s.f]).join(",")?kr:h:(h!==kr||t.offsetParent||t===Oi||a.svg||(s=o.display,o.display="block",(i=t.parentNode)&&(t.offsetParent||t.getBoundingClientRect().width)||(n=1,r=t.nextElementSibling,Oi.appendChild(t)),h=Or(t),s?o.display=s:xr(t,"display"),n&&(r?i.insertBefore(t,r):i?i.appendChild(t):Oi.removeChild(t))),e&&h.length>6?[h[0],h[1],h[4],h[5],h[12],h[13]]:h)},Pr=function(t,e,i,r,s,n){var a,o,h,u=t._gsap,l=s||Br(t,!0),c=u.xOrigin||0,d=u.yOrigin||0,p=u.xOffset||0,m=u.yOffset||0,f=l[0],y=l[1],g=l[2],x=l[3],_=l[4],v=l[5],b=e.split(" "),w=parseFloat(b[0])||0,M=parseFloat(b[1])||0;i?l!==kr&&(o=f*x-y*g)&&(h=w*(-y/o)+M*(f/o)-(f*v-y*_)/o,w=w*(x/o)+M*(-g/o)+(g*v-x*_)/o,M=h):(w=(a=yr(t)).x+(~b[0].indexOf("%")?w/100*a.width:w),M=a.y+(~(b[1]||b[0]).indexOf("%")?M/100*a.height:M)),r||!1!==r&&u.smooth?(_=w-c,v=M-d,u.xOffset=p+(_*f+v*g)-_,u.yOffset=m+(_*y+v*x)-v):u.xOffset=u.yOffset=0,u.xOrigin=w,u.yOrigin=M,u.smooth=!!r,u.origin=e,u.originIsAbsolute=!!i,t.style[sr]="0px 0px",n&&(_r(n,u,"xOrigin",c,w),_r(n,u,"yOrigin",d,M),_r(n,u,"xOffset",p,u.xOffset),_r(n,u,"yOffset",m,u.yOffset)),t.setAttribute("data-svg-origin",w+" "+M)},Rr=function(t,e){var i=t._gsap||new qe(t);if("x"in i&&!e&&!i.uncache)return i;var r,s,n,a,o,h,u,l,c,d,p,m,f,y,g,x,_,v,b,M,T,S,z,A,k,C,E,O,B,P,R,I,F=t.style,V=i.scaleX<0,N="px",D="deg",U=getComputedStyle(t),L=lr(t,sr)||"0";return r=s=n=h=u=l=c=d=p=0,a=o=1,i.svg=!(!t.getCTM||!gr(t)),U.translate&&("none"===U.translate&&"none"===U.scale&&"none"===U.rotate||(F[rr]=("none"!==U.translate?"translate3d("+(U.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+("none"!==U.rotate?"rotate("+U.rotate+") ":"")+("none"!==U.scale?"scale("+U.scale.split(" ").join(",")+") ":"")+("none"!==U[rr]?U[rr]:"")),F.scale=F.rotate=F.translate="none"),y=Br(t,i.svg),i.svg&&(i.uncache?(k=t.getBBox(),L=i.xOrigin-k.x+"px "+(i.yOrigin-k.y)+"px",A=""):A=!e&&t.getAttribute("data-svg-origin"),Pr(t,A||L,!!A||i.originIsAbsolute,!1!==i.smooth,y)),m=i.xOrigin||0,f=i.yOrigin||0,y!==kr&&(v=y[0],b=y[1],M=y[2],T=y[3],r=S=y[4],s=z=y[5],6===y.length?(a=Math.sqrt(v*v+b*b),o=Math.sqrt(T*T+M*M),h=v||b?Ui(b,v)*Ni:0,(c=M||T?Ui(M,T)*Ni+h:0)&&(o*=Math.abs(Math.cos(c*Di))),i.svg&&(r-=m-(m*v+f*M),s-=f-(m*b+f*T))):(I=y[6],P=y[7],E=y[8],O=y[9],B=y[10],R=y[11],r=y[12],s=y[13],n=y[14],u=(g=Ui(I,B))*Ni,g&&(A=S*(x=Math.cos(-g))+E*(_=Math.sin(-g)),k=z*x+O*_,C=I*x+B*_,E=S*-_+E*x,O=z*-_+O*x,B=I*-_+B*x,R=P*-_+R*x,S=A,z=k,I=C),l=(g=Ui(-M,B))*Ni,g&&(x=Math.cos(-g),R=T*(_=Math.sin(-g))+R*x,v=A=v*x-E*_,b=k=b*x-O*_,M=C=M*x-B*_),h=(g=Ui(b,v))*Ni,g&&(A=v*(x=Math.cos(g))+b*(_=Math.sin(g)),k=S*x+z*_,b=b*x-v*_,z=z*x-S*_,v=A,S=k),u&&Math.abs(u)+Math.abs(h)>359.9&&(u=h=0,l=180-l),a=gt(Math.sqrt(v*v+b*b+M*M)),o=gt(Math.sqrt(z*z+I*I)),g=Ui(S,z),c=Math.abs(g)>2e-4?g*Ni:0,p=R?1/(R<0?-R:R):0),i.svg&&(A=t.getAttribute("transform"),i.forceCSS=t.setAttribute("transform","")||!Er(lr(t,rr)),A&&t.setAttribute("transform",A))),Math.abs(c)>90&&Math.abs(c)<270&&(V?(a*=-1,c+=h<=0?180:-180,h+=h<=0?180:-180):(o*=-1,c+=c<=0?180:-180)),e=e||i.uncache,i.x=r-((i.xPercent=r&&(!e&&i.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-r)?-50:0)))?t.offsetWidth*i.xPercent/100:0)+N,i.y=s-((i.yPercent=s&&(!e&&i.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-s)?-50:0)))?t.offsetHeight*i.yPercent/100:0)+N,i.z=n+N,i.scaleX=gt(a),i.scaleY=gt(o),i.rotation=gt(h)+D,i.rotationX=gt(u)+D,i.rotationY=gt(l)+D,i.skewX=c+D,i.skewY=d+D,i.transformPerspective=p+N,(i.zOrigin=parseFloat(L.split(" ")[2])||!e&&i.zOrigin||0)&&(F[sr]=Ir(L)),i.xOffset=i.yOffset=0,i.force3D=w.force3D,i.renderTransform=i.svg?qr:Fi?Lr:Vr,i.uncache=0,i},Ir=function(t){return(t=t.split(" "))[0]+" "+t[1]},Fr=function(t,e,i){var r=ee(e);return gt(parseFloat(e)+parseFloat(wr(t,"x",i+"px",r)))+r},Vr=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,Lr(t,e)},Nr="0deg",Dr="0px",Ur=") ",Lr=function(t,e){var i=e||this,r=i.xPercent,s=i.yPercent,n=i.x,a=i.y,o=i.z,h=i.rotation,u=i.rotationY,l=i.rotationX,c=i.skewX,d=i.skewY,p=i.scaleX,m=i.scaleY,f=i.transformPerspective,y=i.force3D,g=i.target,x=i.zOrigin,_="",v="auto"===y&&t&&1!==t||!0===y;if(x&&(l!==Nr||u!==Nr)){var b,w=parseFloat(u)*Di,M=Math.sin(w),T=Math.cos(w);w=parseFloat(l)*Di,b=Math.cos(w),n=Fr(g,n,M*b*-x),a=Fr(g,a,-Math.sin(w)*-x),o=Fr(g,o,T*b*-x+x)}f!==Dr&&(_+="perspective("+f+Ur),(r||s)&&(_+="translate("+r+"%, "+s+"%) "),(v||n!==Dr||a!==Dr||o!==Dr)&&(_+=o!==Dr||v?"translate3d("+n+", "+a+", "+o+") ":"translate("+n+", "+a+Ur),h!==Nr&&(_+="rotate("+h+Ur),u!==Nr&&(_+="rotateY("+u+Ur),l!==Nr&&(_+="rotateX("+l+Ur),c===Nr&&d===Nr||(_+="skew("+c+", "+d+Ur),1===p&&1===m||(_+="scale("+p+", "+m+Ur),g.style[rr]=_||"translate(0, 0)"},qr=function(t,e){var i,r,s,n,a,o=e||this,h=o.xPercent,u=o.yPercent,l=o.x,c=o.y,d=o.rotation,p=o.skewX,m=o.skewY,f=o.scaleX,y=o.scaleY,g=o.target,x=o.xOrigin,_=o.yOrigin,v=o.xOffset,b=o.yOffset,w=o.forceCSS,M=parseFloat(l),T=parseFloat(c);d=parseFloat(d),p=parseFloat(p),(m=parseFloat(m))&&(p+=m=parseFloat(m),d+=m),d||p?(d*=Di,p*=Di,i=Math.cos(d)*f,r=Math.sin(d)*f,s=Math.sin(d-p)*-y,n=Math.cos(d-p)*y,p&&(m*=Di,a=Math.tan(p-m),s*=a=Math.sqrt(1+a*a),n*=a,m&&(a=Math.tan(m),i*=a=Math.sqrt(1+a*a),r*=a)),i=gt(i),r=gt(r),s=gt(s),n=gt(n)):(i=f,n=y,r=s=0),(M&&!~(l+"").indexOf("px")||T&&!~(c+"").indexOf("px"))&&(M=wr(g,"x",l,"px"),T=wr(g,"y",c,"px")),(x||_||v||b)&&(M=gt(M+x-(x*i+_*s)+v),T=gt(T+_-(x*r+_*n)+b)),(h||u)&&(a=g.getBBox(),M=gt(M+h/100*a.width),T=gt(T+u/100*a.height)),a="matrix("+i+","+r+","+s+","+n+","+M+","+T+")",g.setAttribute("transform",a),w&&(g.style[rr]=a)},Wr=function(t,e,i,r,s){var n,a,o=360,h=B(s),u=parseFloat(s)*(h&&~s.indexOf("rad")?Ni:1)-r,l=r+u+"deg";return h&&("short"===(n=s.split("_")[1])&&(u%=o)!==u%180&&(u+=u<0?o:-360),"cw"===n&&u<0?u=(u+36e9)%o-~~(u/o)*o:"ccw"===n&&u>0&&(u=(u-36e9)%o-~~(u/o)*o)),t._pt=a=new fi(t._pt,e,i,r,u,Xi),a.e=l,a.u="deg",t._props.push(i),a},jr=function(t,e){for(var i in e)t[i]=e[i];return t},Hr=function(t,e,i){var r,s,n,a,o,h,u,l=jr({},i._gsap),c=i.style;for(s in l.svg?(n=i.getAttribute("transform"),i.setAttribute("transform",""),c[rr]=e,r=Rr(i,1),xr(i,rr),i.setAttribute("transform",n)):(n=getComputedStyle(i)[rr],c[rr]=e,r=Rr(i,1),c[rr]=n),Vi)(n=l[s])!==(a=r[s])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(s)<0&&(o=ee(n)!==(u=ee(a))?wr(i,s,n,u):parseFloat(n),h=parseFloat(a),t._pt=new fi(t._pt,r,s,o,h-o,Hi),t._pt.u=u||0,t._props.push(s));jr(r,l)};yt("padding,margin,Width,Radius",(function(t,e){var i="Top",r="Right",s="Bottom",n="Left",a=(e<3?[i,r,s,n]:[i+n,i+r,s+r,s+n]).map((function(i){return e<2?t+i:"border"+i+t}));Ar[e>1?"border"+t:t]=function(t,e,i,r,s){var n,o;if(arguments.length<4)return n=a.map((function(e){return Mr(t,e,i)})),5===(o=n.join(" ")).split(n[0]).length?n[0]:o;n=(r+"").split(" "),o={},a.forEach((function(t,e){return o[t]=n[e]=n[e]||n[(e-1)/2|0]})),t.init(e,o,s)}}));var Xr,Yr,Zr,Jr={name:"css",register:pr,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,i,r,s){var n,a,o,h,u,l,c,d,p,m,f,y,g,x,_,v,b,M,T,S,z=this._props,A=t.style,k=i.vars.startAt;for(c in Bi||pr(),this.styles=this.styles||hr(t),v=this.styles.props,this.tween=i,e)if("autoRound"!==c&&(a=e[c],!ht[c]||!Je(c,e,i,r,t,s)))if(u=typeof a,l=Ar[c],"function"===u&&(u=typeof(a=a.call(i,r,t,s))),"string"===u&&~a.indexOf("random(")&&(a=pe(a)),l)l(this,t,c,a,i)&&(_=1);else if("--"===c.substr(0,2))n=(getComputedStyle(t).getPropertyValue(c)+"").trim(),a+="",ze.lastIndex=0,ze.test(n)||(d=ee(n),p=ee(a)),p?d!==p&&(n=wr(t,c,n,p)+p):d&&(a+=d),this.add(A,"setProperty",n,a,r,s,0,0,c),z.push(c),v.push(c,0,A[c]);else if("undefined"!==u){if(k&&c in k?(n="function"==typeof k[c]?k[c].call(i,r,t,s):k[c],B(n)&&~n.indexOf("random(")&&(n=pe(n)),ee(n+"")||"auto"===n||(n+=w.units[c]||ee(Mr(t,c))||""),"="===(n+"").charAt(1)&&(n=Mr(t,c))):n=Mr(t,c),h=parseFloat(n),(m="string"===u&&"="===a.charAt(1)&&a.substr(0,2))&&(a=a.substr(2)),o=parseFloat(a),c in ji&&("autoAlpha"===c&&(1===h&&"hidden"===Mr(t,"visibility")&&o&&(h=0),v.push("visibility",0,A.visibility),_r(this,A,"visibility",h?"inherit":"hidden",o?"inherit":"hidden",!o)),"scale"!==c&&"transform"!==c&&~(c=ji[c]).indexOf(",")&&(c=c.split(",")[0])),f=c in Vi)if(this.styles.save(c),"string"===u&&"var(--"===a.substring(0,6)&&(a=lr(t,a.substring(4,a.indexOf(")"))),o=parseFloat(a)),y||((g=t._gsap).renderTransform&&!e.parseTransform||Rr(t,e.parseTransform),x=!1!==e.smoothOrigin&&g.smooth,(y=this._pt=new fi(this._pt,A,rr,0,1,g.renderTransform,g,0,-1)).dep=1),"scale"===c)this._pt=new fi(this._pt,g,"scaleY",g.scaleY,(m?_t(g.scaleY,m+o):o)-g.scaleY||0,Hi),this._pt.u=0,z.push("scaleY",c),c+="X";else{if("transformOrigin"===c){v.push(sr,0,A[sr]),M=void 0,T=void 0,S=void 0,M=(b=a).split(" "),T=M[0],S=M[1]||"50%","top"!==T&&"bottom"!==T&&"left"!==S&&"right"!==S||(b=T,T=S,S=b),M[0]=Sr[T]||T,M[1]=Sr[S]||S,a=M.join(" "),g.svg?Pr(t,a,0,x,0,this):((p=parseFloat(a.split(" ")[2])||0)!==g.zOrigin&&_r(this,g,"zOrigin",g.zOrigin,p),_r(this,A,c,Ir(n),Ir(a)));continue}if("svgOrigin"===c){Pr(t,a,1,x,0,this);continue}if(c in Cr){Wr(this,g,c,h,m?_t(h,m+a):a);continue}if("smoothOrigin"===c){_r(this,g,"smooth",g.smooth,a);continue}if("force3D"===c){g[c]=a;continue}if("transform"===c){Hr(this,a,t);continue}}else c in A||(c=dr(c)||c);if(f||(o||0===o)&&(h||0===h)&&!Wi.test(a)&&c in A)o||(o=0),(d=(n+"").substr((h+"").length))!==(p=ee(a)||(c in w.units?w.units[c]:d))&&(h=wr(t,c,n,p)),this._pt=new fi(this._pt,f?g:A,c,h,(m?_t(h,m+o):o)-h,f||"px"!==p&&"zIndex"!==c||!1===e.autoRound?Hi:Zi),this._pt.u=p||0,d!==p&&"%"!==p&&(this._pt.b=n,this._pt.r=Yi);else if(c in A)Tr.call(this,t,c,n,m?m+a:a);else if(c in t)this.add(t,c,n||t[c],m?m+a:a,r,s);else if("parseTransform"!==c){$(c,a);continue}f||(c in A?v.push(c,0,A[c]):"function"==typeof t[c]?v.push(c,2,t[c]()):v.push(c,1,n||t[c])),z.push(c)}_&&mi(this)},render:function(t,e){if(e.tween._time||!Ii())for(var i=e._pt;i;)i.r(t,i.d),i=i._next;else e.styles.revert()},get:Mr,aliases:ji,getSetter:function(t,e,i){var r=ji[e];return r&&r.indexOf(",")<0&&(e=r),e in Vi&&e!==sr&&(t._gsap.x||Mr(t,"x"))?i&&Ri===i?"scale"===e?tr:Ki:(Ri=i||{})&&("scale"===e?er:ir):t.style&&!I(t.style[e])?Qi:~e.indexOf("-")?$i:ai(t,e)},core:{_removeProperty:xr,_getMatrix:Br}};ki.utils.checkPrefix=dr,ki.core.getStyleSaver=hr,Zr=yt((Xr="x,y,z,scale,scaleX,scaleY,xPercent,yPercent")+","+(Yr="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",(function(t){Vi[t]=1})),yt(Yr,(function(t){w.units[t]="deg",Cr[t]=1})),ji[Zr[13]]=Xr+","+Yr,yt("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",(function(t){var e=t.split(":");ji[e[1]]=Zr[e[0]]})),yt("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",(function(t){w.units[t]="px"})),ki.registerPlugin(Jr);var Gr=ki.registerPlugin(Jr)||ki;Gr.core.Tween;const Qr=1e3,$r=1001,Kr=1002,ts=1015,es=2300,is=2301,rs=2302,ss=2400,ns=2401,as=2402,os="srgb",hs="srgb-linear",us="linear",ls="srgb",cs=7680,ds=35044,ps=2e3,ms=2001;class fs{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});const i=this._listeners;void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&i[t].push(e)}hasEventListener(t,e){const i=this._listeners;return void 0!==i&&(void 0!==i[t]&&-1!==i[t].indexOf(e))}removeEventListener(t,e){const i=this._listeners;if(void 0===i)return;const r=i[t];if(void 0!==r){const t=r.indexOf(e);-1!==t&&r.splice(t,1)}}dispatchEvent(t){const e=this._listeners;if(void 0===e)return;const i=e[t.type];if(void 0!==i){t.target=this;const e=i.slice(0);for(let i=0,r=e.length;i<r;i++)e[i].call(this,t);t.target=null}}}const ys=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];Math.PI,Math.PI;function gs(){const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,i=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(ys[255&t]+ys[t>>8&255]+ys[t>>16&255]+ys[t>>24&255]+"-"+ys[255&e]+ys[e>>8&255]+"-"+ys[e>>16&15|64]+ys[e>>24&255]+"-"+ys[63&i|128]+ys[i>>8&255]+"-"+ys[i>>16&255]+ys[i>>24&255]+ys[255&r]+ys[r>>8&255]+ys[r>>16&255]+ys[r>>24&255]).toLowerCase()}function xs(t,e,i){return Math.max(e,Math.min(i,t))}function _s(t,e){return(t%e+e)%e}function vs(t,e,i){return(1-i)*t+i*e}function bs(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function ws(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(4294967295*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(2147483647*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}class Ms{constructor(t=0,e=0){Ms.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,i=this.y,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6],this.y=r[1]*e+r[4]*i+r[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=xs(this.x,t.x,e.x),this.y=xs(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=xs(this.x,t,e),this.y=xs(this.y,t,e),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(xs(i,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(xs(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y;return e*e+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const i=Math.cos(e),r=Math.sin(e),s=this.x-t.x,n=this.y-t.y;return this.x=s*i-n*r+t.x,this.y=s*r+n*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ts{constructor(t,e,i,r,s,n,a,o,h){Ts.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,e,i,r,s,n,a,o,h)}set(t,e,i,r,s,n,a,o,h){const u=this.elements;return u[0]=t,u[1]=r,u[2]=a,u[3]=e,u[4]=s,u[5]=o,u[6]=i,u[7]=n,u[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this}extractBasis(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,r=e.elements,s=this.elements,n=i[0],a=i[3],o=i[6],h=i[1],u=i[4],l=i[7],c=i[2],d=i[5],p=i[8],m=r[0],f=r[3],y=r[6],g=r[1],x=r[4],_=r[7],v=r[2],b=r[5],w=r[8];return s[0]=n*m+a*g+o*v,s[3]=n*f+a*x+o*b,s[6]=n*y+a*_+o*w,s[1]=h*m+u*g+l*v,s[4]=h*f+u*x+l*b,s[7]=h*y+u*_+l*w,s[2]=c*m+d*g+p*v,s[5]=c*f+d*x+p*b,s[8]=c*y+d*_+p*w,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],u=t[8];return e*n*u-e*a*h-i*s*u+i*a*o+r*s*h-r*n*o}invert(){const t=this.elements,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],u=t[8],l=u*n-a*h,c=a*o-u*s,d=h*s-n*o,p=e*l+i*c+r*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const m=1/p;return t[0]=l*m,t[1]=(r*h-u*i)*m,t[2]=(a*i-r*n)*m,t[3]=c*m,t[4]=(u*e-r*o)*m,t[5]=(r*s-a*e)*m,t[6]=d*m,t[7]=(i*o-h*e)*m,t[8]=(n*e-i*s)*m,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,i,r,s,n,a){const o=Math.cos(s),h=Math.sin(s);return this.set(i*o,i*h,-i*(o*n+h*a)+n+t,-r*h,r*o,-r*(-h*n+o*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(Ss.makeScale(t,e)),this}rotate(t){return this.premultiply(Ss.makeRotation(-t)),this}translate(t,e){return this.premultiply(Ss.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,i,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,i=t.elements;for(let t=0;t<9;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}clone(){return(new this.constructor).fromArray(this.elements)}}const Ss=new Ts;Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array;function zs(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}const As=(new Ts).set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),ks=(new Ts).set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function Cs(){const t={enabled:!0,workingColorSpace:hs,spaces:{},convert:function(t,e,i){return!1!==this.enabled&&e!==i&&e&&i?(this.spaces[e].transfer===ls&&(t.r=Os(t.r),t.g=Os(t.g),t.b=Os(t.b)),this.spaces[e].primaries!==this.spaces[i].primaries&&(t.applyMatrix3(this.spaces[e].toXYZ),t.applyMatrix3(this.spaces[i].fromXYZ)),this.spaces[i].transfer===ls&&(t.r=Bs(t.r),t.g=Bs(t.g),t.b=Bs(t.b)),t):t},fromWorkingColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this.workingColorSpace)},getPrimaries:function(t){return this.spaces[t].primaries},getTransfer:function(t){return""===t?us:this.spaces[t].transfer},getLuminanceCoefficients:function(t,e=this.workingColorSpace){return t.fromArray(this.spaces[e].luminanceCoefficients)},define:function(t){Object.assign(this.spaces,t)},_getMatrix:function(t,e,i){return t.copy(this.spaces[e].toXYZ).multiply(this.spaces[i].fromXYZ)},_getDrawingBufferColorSpace:function(t){return this.spaces[t].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(t=this.workingColorSpace){return this.spaces[t].workingColorSpaceConfig.unpackColorSpace}},e=[.64,.33,.3,.6,.15,.06],i=[.2126,.7152,.0722],r=[.3127,.329];return t.define({[hs]:{primaries:e,whitePoint:r,transfer:us,toXYZ:As,fromXYZ:ks,luminanceCoefficients:i,workingColorSpaceConfig:{unpackColorSpace:os},outputColorSpaceConfig:{drawingBufferColorSpace:os}},[os]:{primaries:e,whitePoint:r,transfer:ls,toXYZ:As,fromXYZ:ks,luminanceCoefficients:i,outputColorSpaceConfig:{drawingBufferColorSpace:os}}}),t}const Es=Cs();function Os(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Bs(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}let Ps;class Rs{static getDataURL(t,e="image/png"){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let i;if(t instanceof HTMLCanvasElement)i=t;else{void 0===Ps&&(Ps=zs("canvas")),Ps.width=t.width,Ps.height=t.height;const e=Ps.getContext("2d");t instanceof ImageData?e.putImageData(t,0,0):e.drawImage(t,0,0,t.width,t.height),i=Ps}return i.toDataURL(e)}static sRGBToLinear(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const e=zs("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);const r=i.getImageData(0,0,t.width,t.height),s=r.data;for(let t=0;t<s.length;t++)s[t]=255*Os(s[t]/255);return i.putImageData(r,0,0),e}if(t.data){const e=t.data.slice(0);for(let t=0;t<e.length;t++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[t]=Math.floor(255*Os(e[t]/255)):e[t]=Os(e[t]);return{data:e,width:t.width,height:t.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}}let Is=0;class Fs{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Is++}),this.uuid=gs(),this.data=t,this.dataReady=!0,this.version=0}set needsUpdate(t){!0===t&&this.version++}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.images[this.uuid])return t.images[this.uuid];const i={uuid:this.uuid,url:""},r=this.data;if(null!==r){let t;if(Array.isArray(r)){t=[];for(let e=0,i=r.length;e<i;e++)r[e].isDataTexture?t.push(Vs(r[e].image)):t.push(Vs(r[e]))}else t=Vs(r);i.url=t}return e||(t.images[this.uuid]=i),i}}function Vs(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?Rs.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let Ns=0;class Ds extends fs{constructor(t=Ds.DEFAULT_IMAGE,e=Ds.DEFAULT_MAPPING,i=1001,r=1001,s=1006,n=1008,a=1023,o=1009,h=Ds.DEFAULT_ANISOTROPY,u=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Ns++}),this.uuid=gs(),this.name="",this.source=new Fs(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=i,this.wrapT=r,this.magFilter=s,this.minFilter=n,this.anisotropy=h,this.format=a,this.internalFormat=null,this.type=o,this.offset=new Ms(0,0),this.repeat=new Ms(1,1),this.center=new Ms(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Ts,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isTextureArray=!1,this.pmremVersion=0}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.renderTarget=t.renderTarget,this.isRenderTargetTexture=t.isRenderTargetTexture,this.isTextureArray=t.isTextureArray,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];const i={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),e||(t.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case Qr:t.x=t.x-Math.floor(t.x);break;case $r:t.x=t.x<0?0:1;break;case Kr: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 Qr:t.y=t.y-Math.floor(t.y);break;case $r:t.y=t.y<0?0:1;break;case Kr:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){!0===t&&this.pmremVersion++}}Ds.DEFAULT_IMAGE=null,Ds.DEFAULT_MAPPING=300,Ds.DEFAULT_ANISOTROPY=1;class Us{constructor(t=0,e=0,i=0,r=1){Us.prototype.isVector4=!0,this.x=t,this.y=e,this.z=i,this.w=r}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,i,r){return this.x=t,this.y=e,this.z=i,this.w=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,i=this.y,r=this.z,s=this.w,n=t.elements;return this.x=n[0]*e+n[4]*i+n[8]*r+n[12]*s,this.y=n[1]*e+n[5]*i+n[9]*r+n[13]*s,this.z=n[2]*e+n[6]*i+n[10]*r+n[14]*s,this.w=n[3]*e+n[7]*i+n[11]*r+n[15]*s,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,i,r,s;const n=.01,a=.1,o=t.elements,h=o[0],u=o[4],l=o[8],c=o[1],d=o[5],p=o[9],m=o[2],f=o[6],y=o[10];if(Math.abs(u-c)<n&&Math.abs(l-m)<n&&Math.abs(p-f)<n){if(Math.abs(u+c)<a&&Math.abs(l+m)<a&&Math.abs(p+f)<a&&Math.abs(h+d+y-3)<a)return this.set(1,0,0,0),this;e=Math.PI;const t=(h+1)/2,o=(d+1)/2,g=(y+1)/2,x=(u+c)/4,_=(l+m)/4,v=(p+f)/4;return t>o&&t>g?t<n?(i=0,r=.707106781,s=.707106781):(i=Math.sqrt(t),r=x/i,s=_/i):o>g?o<n?(i=.707106781,r=0,s=.707106781):(r=Math.sqrt(o),i=x/r,s=v/r):g<n?(i=.707106781,r=.707106781,s=0):(s=Math.sqrt(g),i=_/s,r=v/s),this.set(i,r,s,e),this}let g=Math.sqrt((f-p)*(f-p)+(l-m)*(l-m)+(c-u)*(c-u));return Math.abs(g)<.001&&(g=1),this.x=(f-p)/g,this.y=(l-m)/g,this.z=(c-u)/g,this.w=Math.acos((h+d+y-1)/2),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=xs(this.x,t.x,e.x),this.y=xs(this.y,t.y,e.y),this.z=xs(this.z,t.z,e.z),this.w=xs(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=xs(this.x,t,e),this.y=xs(this.y,t,e),this.z=xs(this.z,t,e),this.w=xs(this.w,t,e),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(xs(i,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Ls{constructor(t=0,e=0,i=0,r=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=i,this._w=r}static slerpFlat(t,e,i,r,s,n,a){let o=i[r+0],h=i[r+1],u=i[r+2],l=i[r+3];const c=s[n+0],d=s[n+1],p=s[n+2],m=s[n+3];if(0===a)return t[e+0]=o,t[e+1]=h,t[e+2]=u,void(t[e+3]=l);if(1===a)return t[e+0]=c,t[e+1]=d,t[e+2]=p,void(t[e+3]=m);if(l!==m||o!==c||h!==d||u!==p){let t=1-a;const e=o*c+h*d+u*p+l*m,i=e>=0?1:-1,r=1-e*e;if(r>Number.EPSILON){const s=Math.sqrt(r),n=Math.atan2(s,e*i);t=Math.sin(t*n)/s,a=Math.sin(a*n)/s}const s=a*i;if(o=o*t+c*s,h=h*t+d*s,u=u*t+p*s,l=l*t+m*s,t===1-a){const t=1/Math.sqrt(o*o+h*h+u*u+l*l);o*=t,h*=t,u*=t,l*=t}}t[e]=o,t[e+1]=h,t[e+2]=u,t[e+3]=l}static multiplyQuaternionsFlat(t,e,i,r,s,n){const a=i[r],o=i[r+1],h=i[r+2],u=i[r+3],l=s[n],c=s[n+1],d=s[n+2],p=s[n+3];return t[e]=a*p+u*l+o*d-h*c,t[e+1]=o*p+u*c+h*l-a*d,t[e+2]=h*p+u*d+a*c-o*l,t[e+3]=u*p-a*l-o*c-h*d,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,i,r){return this._x=t,this._y=e,this._z=i,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const i=t._x,r=t._y,s=t._z,n=t._order,a=Math.cos,o=Math.sin,h=a(i/2),u=a(r/2),l=a(s/2),c=o(i/2),d=o(r/2),p=o(s/2);switch(n){case"XYZ":this._x=c*u*l+h*d*p,this._y=h*d*l-c*u*p,this._z=h*u*p+c*d*l,this._w=h*u*l-c*d*p;break;case"YXZ":this._x=c*u*l+h*d*p,this._y=h*d*l-c*u*p,this._z=h*u*p-c*d*l,this._w=h*u*l+c*d*p;break;case"ZXY":this._x=c*u*l-h*d*p,this._y=h*d*l+c*u*p,this._z=h*u*p+c*d*l,this._w=h*u*l-c*d*p;break;case"ZYX":this._x=c*u*l-h*d*p,this._y=h*d*l+c*u*p,this._z=h*u*p-c*d*l,this._w=h*u*l+c*d*p;break;case"YZX":this._x=c*u*l+h*d*p,this._y=h*d*l+c*u*p,this._z=h*u*p-c*d*l,this._w=h*u*l-c*d*p;break;case"XZY":this._x=c*u*l-h*d*p,this._y=h*d*l-c*u*p,this._z=h*u*p+c*d*l,this._w=h*u*l+c*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+n)}return!0===e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const i=e/2,r=Math.sin(i);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,i=e[0],r=e[4],s=e[8],n=e[1],a=e[5],o=e[9],h=e[2],u=e[6],l=e[10],c=i+a+l;if(c>0){const t=.5/Math.sqrt(c+1);this._w=.25/t,this._x=(u-o)*t,this._y=(s-h)*t,this._z=(n-r)*t}else if(i>a&&i>l){const t=2*Math.sqrt(1+i-a-l);this._w=(u-o)/t,this._x=.25*t,this._y=(r+n)/t,this._z=(s+h)/t}else if(a>l){const t=2*Math.sqrt(1+a-i-l);this._w=(s-h)/t,this._x=(r+n)/t,this._y=.25*t,this._z=(o+u)/t}else{const t=2*Math.sqrt(1+l-i-a);this._w=(n-r)/t,this._x=(s+h)/t,this._y=(o+u)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return i<Number.EPSILON?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(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=i),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(xs(this.dot(t),-1,1)))}rotateTowards(t,e){const i=this.angleTo(t);if(0===i)return this;const r=Math.min(1,e/i);return this.slerp(t,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const i=t._x,r=t._y,s=t._z,n=t._w,a=e._x,o=e._y,h=e._z,u=e._w;return this._x=i*u+n*a+r*h-s*o,this._y=r*u+n*o+s*a-i*h,this._z=s*u+n*h+i*o-r*a,this._w=n*u-i*a-r*o-s*h,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const i=this._x,r=this._y,s=this._z,n=this._w;let a=n*t._w+i*t._x+r*t._y+s*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=n,this._x=i,this._y=r,this._z=s,this;const o=1-a*a;if(o<=Number.EPSILON){const t=1-e;return this._w=t*n+e*this._w,this._x=t*i+e*this._x,this._y=t*r+e*this._y,this._z=t*s+e*this._z,this.normalize(),this}const h=Math.sqrt(o),u=Math.atan2(h,a),l=Math.sin((1-e)*u)/h,c=Math.sin(e*u)/h;return this._w=n*l+this._w*c,this._x=i*l+this._x*c,this._y=r*l+this._y*c,this._z=s*l+this._z*c,this._onChangeCallback(),this}slerpQuaternions(t,e,i){return this.copy(t).slerp(e,i)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),i=Math.random(),r=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(r*Math.sin(t),r*Math.cos(t),s*Math.sin(e),s*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class qs{constructor(t=0,e=0,i=0){qs.prototype.isVector3=!0,this.x=t,this.y=e,this.z=i}set(t,e,i){return void 0===i&&(i=this.z),this.x=t,this.y=e,this.z=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(js.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(js.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,i=this.y,r=this.z,s=t.elements;return this.x=s[0]*e+s[3]*i+s[6]*r,this.y=s[1]*e+s[4]*i+s[7]*r,this.z=s[2]*e+s[5]*i+s[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,i=this.y,r=this.z,s=t.elements,n=1/(s[3]*e+s[7]*i+s[11]*r+s[15]);return this.x=(s[0]*e+s[4]*i+s[8]*r+s[12])*n,this.y=(s[1]*e+s[5]*i+s[9]*r+s[13])*n,this.z=(s[2]*e+s[6]*i+s[10]*r+s[14])*n,this}applyQuaternion(t){const e=this.x,i=this.y,r=this.z,s=t.x,n=t.y,a=t.z,o=t.w,h=2*(n*r-a*i),u=2*(a*e-s*r),l=2*(s*i-n*e);return this.x=e+o*h+n*l-a*u,this.y=i+o*u+a*h-s*l,this.z=r+o*l+s*u-n*h,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,i=this.y,r=this.z,s=t.elements;return this.x=s[0]*e+s[4]*i+s[8]*r,this.y=s[1]*e+s[5]*i+s[9]*r,this.z=s[2]*e+s[6]*i+s[10]*r,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=xs(this.x,t.x,e.x),this.y=xs(this.y,t.y,e.y),this.z=xs(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=xs(this.x,t,e),this.y=xs(this.y,t,e),this.z=xs(this.z,t,e),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(xs(i,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const i=t.x,r=t.y,s=t.z,n=e.x,a=e.y,o=e.z;return this.x=r*o-s*a,this.y=s*n-i*o,this.z=i*a-r*n,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return Ws.copy(this).projectOnVector(t),this.sub(Ws)}reflect(t){return this.sub(Ws.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(xs(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,r=this.z-t.z;return e*e+i*i+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,i){const r=Math.sin(e)*t;return this.x=r*Math.sin(i),this.y=Math.cos(e)*t,this.z=r*Math.cos(i),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=r,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=2*Math.random()-1,i=Math.sqrt(1-e*e);return this.x=i*Math.cos(t),this.y=e,this.z=i*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Ws=new qs,js=new Ls;class Hs{constructor(t=new qs(1/0,1/0,1/0),e=new qs(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e+=3)this.expandByPoint(Ys.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,i=t.count;e<i;e++)this.expandByPoint(Ys.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const i=Ys.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);const i=t.geometry;if(void 0!==i){const r=i.getAttribute("position");if(!0===e&&void 0!==r&&!0!==t.isInstancedMesh)for(let e=0,i=r.count;e<i;e++)!0===t.isMesh?t.getVertexPosition(e,Ys):Ys.fromBufferAttribute(r,e),Ys.applyMatrix4(t.matrixWorld),this.expandByPoint(Ys);else void 0!==t.boundingBox?(null===t.boundingBox&&t.computeBoundingBox(),Zs.copy(t.boundingBox)):(null===i.boundingBox&&i.computeBoundingBox(),Zs.copy(i.boundingBox)),Zs.applyMatrix4(t.matrixWorld),this.union(Zs)}const r=t.children;for(let t=0,i=r.length;t<i;t++)this.expandByObject(r[t],e);return this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,Ys),Ys.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(en),rn.subVectors(this.max,en),Js.subVectors(t.a,en),Gs.subVectors(t.b,en),Qs.subVectors(t.c,en),$s.subVectors(Gs,Js),Ks.subVectors(Qs,Gs),tn.subVectors(Js,Qs);let e=[0,-$s.z,$s.y,0,-Ks.z,Ks.y,0,-tn.z,tn.y,$s.z,0,-$s.x,Ks.z,0,-Ks.x,tn.z,0,-tn.x,-$s.y,$s.x,0,-Ks.y,Ks.x,0,-tn.y,tn.x,0];return!!an(e,Js,Gs,Qs,rn)&&(e=[1,0,0,0,1,0,0,0,1],!!an(e,Js,Gs,Qs,rn)&&(sn.crossVectors($s,Ks),e=[sn.x,sn.y,sn.z],an(e,Js,Gs,Qs,rn)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,Ys).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(Ys).length()),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(Xs[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Xs[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Xs[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Xs[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Xs[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Xs[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Xs[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Xs[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Xs)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const Xs=[new qs,new qs,new qs,new qs,new qs,new qs,new qs,new qs],Ys=new qs,Zs=new Hs,Js=new qs,Gs=new qs,Qs=new qs,$s=new qs,Ks=new qs,tn=new qs,en=new qs,rn=new qs,sn=new qs,nn=new qs;function an(t,e,i,r,s){for(let n=0,a=t.length-3;n<=a;n+=3){nn.fromArray(t,n);const a=s.x*Math.abs(nn.x)+s.y*Math.abs(nn.y)+s.z*Math.abs(nn.z),o=e.dot(nn),h=i.dot(nn),u=r.dot(nn);if(Math.max(-Math.max(o,h,u),Math.min(o,h,u))>a)return!1}return!0}const on=new Hs,hn=new qs,un=new qs;class ln{constructor(t=new qs,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const i=this.center;void 0!==e?i.copy(e):on.setFromPoints(t).getCenter(i);let r=0;for(let e=0,s=t.length;e<s;e++)r=Math.max(r,i.distanceToSquared(t[e]));return this.radius=Math.sqrt(r),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const i=this.center.distanceToSquared(t);return e.copy(t),i>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;hn.subVectors(t,this.center);const e=hn.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),i=.5*(t-this.radius);this.center.addScaledVector(hn,i/t),this.radius+=i}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):(un.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(hn.copy(t.center).add(un)),this.expandByPoint(hn.copy(t.center).sub(un))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const cn=new qs,dn=new qs,pn=new qs,mn=new qs,fn=new qs,yn=new qs,gn=new qs;class xn{constructor(t=new qs,e=new qs(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,cn)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=cn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(cn.copy(this.origin).addScaledVector(this.direction,e),cn.distanceToSquared(t))}distanceSqToSegment(t,e,i,r){dn.copy(t).add(e).multiplyScalar(.5),pn.copy(e).sub(t).normalize(),mn.copy(this.origin).sub(dn);const s=.5*t.distanceTo(e),n=-this.direction.dot(pn),a=mn.dot(this.direction),o=-mn.dot(pn),h=mn.lengthSq(),u=Math.abs(1-n*n);let l,c,d,p;if(u>0)if(l=n*o-a,c=n*a-o,p=s*u,l>=0)if(c>=-p)if(c<=p){const t=1/u;l*=t,c*=t,d=l*(l+n*c+2*a)+c*(n*l+c+2*o)+h}else c=s,l=Math.max(0,-(n*c+a)),d=-l*l+c*(c+2*o)+h;else c=-s,l=Math.max(0,-(n*c+a)),d=-l*l+c*(c+2*o)+h;else c<=-p?(l=Math.max(0,-(-n*s+a)),c=l>0?-s:Math.min(Math.max(-s,-o),s),d=-l*l+c*(c+2*o)+h):c<=p?(l=0,c=Math.min(Math.max(-s,-o),s),d=c*(c+2*o)+h):(l=Math.max(0,-(n*s+a)),c=l>0?s:Math.min(Math.max(-s,-o),s),d=-l*l+c*(c+2*o)+h);else c=n>0?-s:s,l=Math.max(0,-(n*c+a)),d=-l*l+c*(c+2*o)+h;return i&&i.copy(this.origin).addScaledVector(this.direction,l),r&&r.copy(dn).addScaledVector(pn,c),d}intersectSphere(t,e){cn.subVectors(t.center,this.origin);const i=cn.dot(this.direction),r=cn.dot(cn)-i*i,s=t.radius*t.radius;if(r>s)return null;const n=Math.sqrt(s-r),a=i-n,o=i+n;return o<0?null:a<0?this.at(o,e):this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}intersectPlane(t,e){const i=this.distanceToPlane(t);return null===i?null:this.at(i,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(0===e)return!0;return t.normal.dot(this.direction)*e<0}intersectBox(t,e){let i,r,s,n,a,o;const h=1/this.direction.x,u=1/this.direction.y,l=1/this.direction.z,c=this.origin;return h>=0?(i=(t.min.x-c.x)*h,r=(t.max.x-c.x)*h):(i=(t.max.x-c.x)*h,r=(t.min.x-c.x)*h),u>=0?(s=(t.min.y-c.y)*u,n=(t.max.y-c.y)*u):(s=(t.max.y-c.y)*u,n=(t.min.y-c.y)*u),i>n||s>r?null:((s>i||isNaN(i))&&(i=s),(n<r||isNaN(r))&&(r=n),l>=0?(a=(t.min.z-c.z)*l,o=(t.max.z-c.z)*l):(a=(t.max.z-c.z)*l,o=(t.min.z-c.z)*l),i>o||a>r?null:((a>i||i!=i)&&(i=a),(o<r||r!=r)&&(r=o),r<0?null:this.at(i>=0?i:r,e)))}intersectsBox(t){return null!==this.intersectBox(t,cn)}intersectTriangle(t,e,i,r,s){fn.subVectors(e,t),yn.subVectors(i,t),gn.crossVectors(fn,yn);let n,a=this.direction.dot(gn);if(a>0){if(r)return null;n=1}else{if(!(a<0))return null;n=-1,a=-a}mn.subVectors(this.origin,t);const o=n*this.direction.dot(yn.crossVectors(mn,yn));if(o<0)return null;const h=n*this.direction.dot(fn.cross(mn));if(h<0)return null;if(o+h>a)return null;const u=-n*mn.dot(gn);return u<0?null:this.at(u/a,s)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class _n{constructor(t,e,i,r,s,n,a,o,h,u,l,c,d,p,m,f){_n.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,e,i,r,s,n,a,o,h,u,l,c,d,p,m,f)}set(t,e,i,r,s,n,a,o,h,u,l,c,d,p,m,f){const y=this.elements;return y[0]=t,y[4]=e,y[8]=i,y[12]=r,y[1]=s,y[5]=n,y[9]=a,y[13]=o,y[2]=h,y[6]=u,y[10]=l,y[14]=c,y[3]=d,y[7]=p,y[11]=m,y[15]=f,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new _n).fromArray(this.elements)}copy(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this}copyPosition(t){const e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,i=t.elements,r=1/vn.setFromMatrixColumn(t,0).length(),s=1/vn.setFromMatrixColumn(t,1).length(),n=1/vn.setFromMatrixColumn(t,2).length();return e[0]=i[0]*r,e[1]=i[1]*r,e[2]=i[2]*r,e[3]=0,e[4]=i[4]*s,e[5]=i[5]*s,e[6]=i[6]*s,e[7]=0,e[8]=i[8]*n,e[9]=i[9]*n,e[10]=i[10]*n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,i=t.x,r=t.y,s=t.z,n=Math.cos(i),a=Math.sin(i),o=Math.cos(r),h=Math.sin(r),u=Math.cos(s),l=Math.sin(s);if("XYZ"===t.order){const t=n*u,i=n*l,r=a*u,s=a*l;e[0]=o*u,e[4]=-o*l,e[8]=h,e[1]=i+r*h,e[5]=t-s*h,e[9]=-a*o,e[2]=s-t*h,e[6]=r+i*h,e[10]=n*o}else if("YXZ"===t.order){const t=o*u,i=o*l,r=h*u,s=h*l;e[0]=t+s*a,e[4]=r*a-i,e[8]=n*h,e[1]=n*l,e[5]=n*u,e[9]=-a,e[2]=i*a-r,e[6]=s+t*a,e[10]=n*o}else if("ZXY"===t.order){const t=o*u,i=o*l,r=h*u,s=h*l;e[0]=t-s*a,e[4]=-n*l,e[8]=r+i*a,e[1]=i+r*a,e[5]=n*u,e[9]=s-t*a,e[2]=-n*h,e[6]=a,e[10]=n*o}else if("ZYX"===t.order){const t=n*u,i=n*l,r=a*u,s=a*l;e[0]=o*u,e[4]=r*h-i,e[8]=t*h+s,e[1]=o*l,e[5]=s*h+t,e[9]=i*h-r,e[2]=-h,e[6]=a*o,e[10]=n*o}else if("YZX"===t.order){const t=n*o,i=n*h,r=a*o,s=a*h;e[0]=o*u,e[4]=s-t*l,e[8]=r*l+i,e[1]=l,e[5]=n*u,e[9]=-a*u,e[2]=-h*u,e[6]=i*l+r,e[10]=t-s*l}else if("XZY"===t.order){const t=n*o,i=n*h,r=a*o,s=a*h;e[0]=o*u,e[4]=-l,e[8]=h*u,e[1]=t*l+s,e[5]=n*u,e[9]=i*l-r,e[2]=r*l-i,e[6]=a*u,e[10]=s*l+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(wn,t,Mn)}lookAt(t,e,i){const r=this.elements;return zn.subVectors(t,e),0===zn.lengthSq()&&(zn.z=1),zn.normalize(),Tn.crossVectors(i,zn),0===Tn.lengthSq()&&(1===Math.abs(i.z)?zn.x+=1e-4:zn.z+=1e-4,zn.normalize(),Tn.crossVectors(i,zn)),Tn.normalize(),Sn.crossVectors(zn,Tn),r[0]=Tn.x,r[4]=Sn.x,r[8]=zn.x,r[1]=Tn.y,r[5]=Sn.y,r[9]=zn.y,r[2]=Tn.z,r[6]=Sn.z,r[10]=zn.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,r=e.elements,s=this.elements,n=i[0],a=i[4],o=i[8],h=i[12],u=i[1],l=i[5],c=i[9],d=i[13],p=i[2],m=i[6],f=i[10],y=i[14],g=i[3],x=i[7],_=i[11],v=i[15],b=r[0],w=r[4],M=r[8],T=r[12],S=r[1],z=r[5],A=r[9],k=r[13],C=r[2],E=r[6],O=r[10],B=r[14],P=r[3],R=r[7],I=r[11],F=r[15];return s[0]=n*b+a*S+o*C+h*P,s[4]=n*w+a*z+o*E+h*R,s[8]=n*M+a*A+o*O+h*I,s[12]=n*T+a*k+o*B+h*F,s[1]=u*b+l*S+c*C+d*P,s[5]=u*w+l*z+c*E+d*R,s[9]=u*M+l*A+c*O+d*I,s[13]=u*T+l*k+c*B+d*F,s[2]=p*b+m*S+f*C+y*P,s[6]=p*w+m*z+f*E+y*R,s[10]=p*M+m*A+f*O+y*I,s[14]=p*T+m*k+f*B+y*F,s[3]=g*b+x*S+_*C+v*P,s[7]=g*w+x*z+_*E+v*R,s[11]=g*M+x*A+_*O+v*I,s[15]=g*T+x*k+_*B+v*F,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[4],r=t[8],s=t[12],n=t[1],a=t[5],o=t[9],h=t[13],u=t[2],l=t[6],c=t[10],d=t[14];return t[3]*(+s*o*l-r*h*l-s*a*c+i*h*c+r*a*d-i*o*d)+t[7]*(+e*o*d-e*h*c+s*n*c-r*n*d+r*h*u-s*o*u)+t[11]*(+e*h*l-e*a*d-s*n*l+i*n*d+s*a*u-i*h*u)+t[15]*(-r*a*u-e*o*l+e*a*c+r*n*l-i*n*c+i*o*u)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,i){const r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=i),this}invert(){const t=this.elements,e=t[0],i=t[1],r=t[2],s=t[3],n=t[4],a=t[5],o=t[6],h=t[7],u=t[8],l=t[9],c=t[10],d=t[11],p=t[12],m=t[13],f=t[14],y=t[15],g=l*f*h-m*c*h+m*o*d-a*f*d-l*o*y+a*c*y,x=p*c*h-u*f*h-p*o*d+n*f*d+u*o*y-n*c*y,_=u*m*h-p*l*h+p*a*d-n*m*d-u*a*y+n*l*y,v=p*l*o-u*m*o-p*a*c+n*m*c+u*a*f-n*l*f,b=e*g+i*x+r*_+s*v;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const w=1/b;return t[0]=g*w,t[1]=(m*c*s-l*f*s-m*r*d+i*f*d+l*r*y-i*c*y)*w,t[2]=(a*f*s-m*o*s+m*r*h-i*f*h-a*r*y+i*o*y)*w,t[3]=(l*o*s-a*c*s-l*r*h+i*c*h+a*r*d-i*o*d)*w,t[4]=x*w,t[5]=(u*f*s-p*c*s+p*r*d-e*f*d-u*r*y+e*c*y)*w,t[6]=(p*o*s-n*f*s-p*r*h+e*f*h+n*r*y-e*o*y)*w,t[7]=(n*c*s-u*o*s+u*r*h-e*c*h-n*r*d+e*o*d)*w,t[8]=_*w,t[9]=(p*l*s-u*m*s-p*i*d+e*m*d+u*i*y-e*l*y)*w,t[10]=(n*m*s-p*a*s+p*i*h-e*m*h-n*i*y+e*a*y)*w,t[11]=(u*a*s-n*l*s-u*i*h+e*l*h+n*i*d-e*a*d)*w,t[12]=v*w,t[13]=(u*m*r-p*l*r+p*i*c-e*m*c-u*i*f+e*l*f)*w,t[14]=(p*a*r-n*m*r-p*i*o+e*m*o+n*i*f-e*a*f)*w,t[15]=(n*l*r-u*a*r+u*i*o-e*l*o-n*i*c+e*a*c)*w,this}scale(t){const e=this.elements,i=t.x,r=t.y,s=t.z;return e[0]*=i,e[4]*=r,e[8]*=s,e[1]*=i,e[5]*=r,e[9]*=s,e[2]*=i,e[6]*=r,e[10]*=s,e[3]*=i,e[7]*=r,e[11]*=s,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,r))}makeTranslation(t,e,i){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const i=Math.cos(e),r=Math.sin(e),s=1-i,n=t.x,a=t.y,o=t.z,h=s*n,u=s*a;return this.set(h*n+i,h*a-r*o,h*o+r*a,0,h*a+r*o,u*a+i,u*o-r*n,0,h*o-r*a,u*o+r*n,s*o*o+i,0,0,0,0,1),this}makeScale(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}makeShear(t,e,i,r,s,n){return this.set(1,i,s,0,t,1,n,0,e,r,1,0,0,0,0,1),this}compose(t,e,i){const r=this.elements,s=e._x,n=e._y,a=e._z,o=e._w,h=s+s,u=n+n,l=a+a,c=s*h,d=s*u,p=s*l,m=n*u,f=n*l,y=a*l,g=o*h,x=o*u,_=o*l,v=i.x,b=i.y,w=i.z;return r[0]=(1-(m+y))*v,r[1]=(d+_)*v,r[2]=(p-x)*v,r[3]=0,r[4]=(d-_)*b,r[5]=(1-(c+y))*b,r[6]=(f+g)*b,r[7]=0,r[8]=(p+x)*w,r[9]=(f-g)*w,r[10]=(1-(c+m))*w,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,i){const r=this.elements;let s=vn.set(r[0],r[1],r[2]).length();const n=vn.set(r[4],r[5],r[6]).length(),a=vn.set(r[8],r[9],r[10]).length();this.determinant()<0&&(s=-s),t.x=r[12],t.y=r[13],t.z=r[14],bn.copy(this);const o=1/s,h=1/n,u=1/a;return bn.elements[0]*=o,bn.elements[1]*=o,bn.elements[2]*=o,bn.elements[4]*=h,bn.elements[5]*=h,bn.elements[6]*=h,bn.elements[8]*=u,bn.elements[9]*=u,bn.elements[10]*=u,e.setFromRotationMatrix(bn),i.x=s,i.y=n,i.z=a,this}makePerspective(t,e,i,r,s,n,a=2e3){const o=this.elements,h=2*s/(e-t),u=2*s/(i-r),l=(e+t)/(e-t),c=(i+r)/(i-r);let d,p;if(a===ps)d=-(n+s)/(n-s),p=-2*n*s/(n-s);else{if(a!==ms)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);d=-n/(n-s),p=-n*s/(n-s)}return o[0]=h,o[4]=0,o[8]=l,o[12]=0,o[1]=0,o[5]=u,o[9]=c,o[13]=0,o[2]=0,o[6]=0,o[10]=d,o[14]=p,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(t,e,i,r,s,n,a=2e3){const o=this.elements,h=1/(e-t),u=1/(i-r),l=1/(n-s),c=(e+t)*h,d=(i+r)*u;let p,m;if(a===ps)p=(n+s)*l,m=-2*l;else{if(a!==ms)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);p=s*l,m=-1*l}return o[0]=2*h,o[4]=0,o[8]=0,o[12]=-c,o[1]=0,o[5]=2*u,o[9]=0,o[13]=-d,o[2]=0,o[6]=0,o[10]=m,o[14]=-p,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(t){const e=this.elements,i=t.elements;for(let t=0;t<16;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<16;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}}const vn=new qs,bn=new _n,wn=new qs(0,0,0),Mn=new qs(1,1,1),Tn=new qs,Sn=new qs,zn=new qs,An=new _n,kn=new Ls;class Cn{constructor(t=0,e=0,i=0,r=Cn.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=i,this._order=r}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,i,r=this._order){return this._x=t,this._y=e,this._z=i,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,i=!0){const r=t.elements,s=r[0],n=r[4],a=r[8],o=r[1],h=r[5],u=r[9],l=r[2],c=r[6],d=r[10];switch(e){case"XYZ":this._y=Math.asin(xs(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,d),this._z=Math.atan2(-n,s)):(this._x=Math.atan2(c,h),this._z=0);break;case"YXZ":this._x=Math.asin(-xs(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,d),this._z=Math.atan2(o,h)):(this._y=Math.atan2(-l,s),this._z=0);break;case"ZXY":this._x=Math.asin(xs(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(-l,d),this._z=Math.atan2(-n,h)):(this._y=0,this._z=Math.atan2(o,s));break;case"ZYX":this._y=Math.asin(-xs(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(c,d),this._z=Math.atan2(o,s)):(this._x=0,this._z=Math.atan2(-n,h));break;case"YZX":this._z=Math.asin(xs(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-u,h),this._y=Math.atan2(-l,s)):(this._x=0,this._y=Math.atan2(a,d));break;case"XZY":this._z=Math.asin(-xs(n,-1,1)),Math.abs(n)<.9999999?(this._x=Math.atan2(c,h),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===i&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return An.makeRotationFromQuaternion(t),this.setFromRotationMatrix(An,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return kn.setFromEuler(this),this.setFromQuaternion(kn,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Cn.DEFAULT_ORDER="XYZ";class En{constructor(){this.mask=1}set(t){this.mask=1<<t>>>0}enable(t){this.mask|=1<<t}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t}disable(t){this.mask&=~(1<<t)}disableAll(){this.mask=0}test(t){return 0!==(this.mask&t.mask)}isEnabled(t){return!!(this.mask&1<<t)}}let On=0;const Bn=new qs,Pn=new Ls,Rn=new _n,In=new qs,Fn=new qs,Vn=new qs,Nn=new Ls,Dn=new qs(1,0,0),Un=new qs(0,1,0),Ln=new qs(0,0,1),qn={type:"added"},Wn={type:"removed"},jn={type:"childadded",child:null},Hn={type:"childremoved",child:null};class Xn extends fs{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:On++}),this.uuid=gs(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Xn.DEFAULT_UP.clone();const t=new qs,e=new Cn,i=new Ls,r=new qs(1,1,1);e._onChange((function(){i.setFromEuler(e,!1)})),i._onChange((function(){e.setFromQuaternion(i,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new _n},normalMatrix:{value:new Ts}}),this.matrix=new _n,this.matrixWorld=new _n,this.matrixAutoUpdate=Xn.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Xn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new En,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return Pn.setFromAxisAngle(t,e),this.quaternion.multiply(Pn),this}rotateOnWorldAxis(t,e){return Pn.setFromAxisAngle(t,e),this.quaternion.premultiply(Pn),this}rotateX(t){return this.rotateOnAxis(Dn,t)}rotateY(t){return this.rotateOnAxis(Un,t)}rotateZ(t){return this.rotateOnAxis(Ln,t)}translateOnAxis(t,e){return Bn.copy(t).applyQuaternion(this.quaternion),this.position.add(Bn.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(Dn,t)}translateY(t){return this.translateOnAxis(Un,t)}translateZ(t){return this.translateOnAxis(Ln,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Rn.copy(this.matrixWorld).invert())}lookAt(t,e,i){t.isVector3?In.copy(t):In.set(t,e,i);const r=this.parent;this.updateWorldMatrix(!0,!1),Fn.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Rn.lookAt(Fn,In,this.up):Rn.lookAt(In,Fn,this.up),this.quaternion.setFromRotationMatrix(Rn),r&&(Rn.extractRotation(r.matrixWorld),Pn.setFromRotationMatrix(Rn),this.quaternion.premultiply(Pn.invert()))}add(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.removeFromParent(),t.parent=this,this.children.push(t),t.dispatchEvent(qn),jn.child=t,this.dispatchEvent(jn),jn.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}const e=this.children.indexOf(t);return-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(Wn),Hn.child=t,this.dispatchEvent(Hn),Hn.child=null),this}removeFromParent(){const t=this.parent;return null!==t&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),Rn.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),Rn.multiply(t.parent.matrixWorld)),t.applyMatrix4(Rn),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(qn),jn.child=t,this.dispatchEvent(jn),jn.child=null,this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let i=0,r=this.children.length;i<r;i++){const r=this.children[i].getObjectByProperty(t,e);if(void 0!==r)return r}}getObjectsByProperty(t,e,i=[]){this[t]===e&&i.push(this);const r=this.children;for(let s=0,n=r.length;s<n;s++)r[s].getObjectsByProperty(t,e,i);return i}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Fn,t,Vn),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Fn,Nn,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let i=0,r=e.length;i<r;i++)e[i].traverse(t)}traverseVisible(t){if(!1===this.visible)return;t(this);const e=this.children;for(let i=0,r=e.length;i<r;i++)e[i].traverseVisible(t)}traverseAncestors(t){const e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let i=0,r=e.length;i<r;i++){e[i].updateMatrixWorld(t)}}updateWorldMatrix(t,e){const i=this.parent;if(!0===t&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),!0===e){const t=this.children;for(let e=0,i=t.length;e<i;e++){t[e].updateWorldMatrix(!1,!0)}}}toJSON(t){const e=void 0===t||"string"==typeof t,i={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const r={};function s(e,i){return void 0===e[i.uuid]&&(e[i.uuid]=i.toJSON(t)),i.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map((t=>({...t,boundingBox:t.boundingBox?{min:t.boundingBox.min.toArray(),max:t.boundingBox.max.toArray()}:void 0,boundingSphere:t.boundingSphere?{radius:t.boundingSphere.radius,center:t.boundingSphere.center.toArray()}:void 0}))),r.instanceInfo=this._instanceInfo.map((t=>({...t}))),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(t),r.indirectTexture=this._indirectTexture.toJSON(t),null!==this._colorsTexture&&(r.colorsTexture=this._colorsTexture.toJSON(t)),null!==this.boundingSphere&&(r.boundingSphere={center:this.boundingSphere.center.toArray(),radius:this.boundingSphere.radius}),null!==this.boundingBox&&(r.boundingBox={min:this.boundingBox.min.toArray(),max:this.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(r.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(t.geometries,this.geometry);const e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){const i=e.shapes;if(Array.isArray(i))for(let e=0,r=i.length;e<r;e++){const r=i[e];s(t.shapes,r)}else s(t.shapes,i)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(s(t.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const e=[];for(let i=0,r=this.material.length;i<r;i++)e.push(s(t.materials,this.material[i]));r.material=e}else r.material=s(t.materials,this.material);if(this.children.length>0){r.children=[];for(let e=0;e<this.children.length;e++)r.children.push(this.children[e].toJSON(t).object)}if(this.animations.length>0){r.animations=[];for(let e=0;e<this.animations.length;e++){const i=this.animations[e];r.animations.push(s(t.animations,i))}}if(e){const e=n(t.geometries),r=n(t.materials),s=n(t.textures),a=n(t.images),o=n(t.shapes),h=n(t.skeletons),u=n(t.animations),l=n(t.nodes);e.length>0&&(i.geometries=e),r.length>0&&(i.materials=r),s.length>0&&(i.textures=s),a.length>0&&(i.images=a),o.length>0&&(i.shapes=o),h.length>0&&(i.skeletons=h),u.length>0&&(i.animations=u),l.length>0&&(i.nodes=l)}return i.object=r,i;function n(t){const e=[];for(const i in t){const r=t[i];delete r.metadata,e.push(r)}return e}}clone(t){return(new this.constructor).copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e<t.children.length;e++){const i=t.children[e];this.add(i.clone())}return this}}Xn.DEFAULT_UP=new qs(0,1,0),Xn.DEFAULT_MATRIX_AUTO_UPDATE=!0,Xn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Yn=new qs,Zn=new qs,Jn=new qs,Gn=new qs,Qn=new qs,$n=new qs,Kn=new qs,ta=new qs,ea=new qs,ia=new qs,ra=new Us,sa=new Us,na=new Us;class aa{constructor(t=new qs,e=new qs,i=new qs){this.a=t,this.b=e,this.c=i}static getNormal(t,e,i,r){r.subVectors(i,e),Yn.subVectors(t,e),r.cross(Yn);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(t,e,i,r,s){Yn.subVectors(r,e),Zn.subVectors(i,e),Jn.subVectors(t,e);const n=Yn.dot(Yn),a=Yn.dot(Zn),o=Yn.dot(Jn),h=Zn.dot(Zn),u=Zn.dot(Jn),l=n*h-a*a;if(0===l)return s.set(0,0,0),null;const c=1/l,d=(h*o-a*u)*c,p=(n*u-a*o)*c;return s.set(1-d-p,p,d)}static containsPoint(t,e,i,r){return null!==this.getBarycoord(t,e,i,r,Gn)&&(Gn.x>=0&&Gn.y>=0&&Gn.x+Gn.y<=1)}static getInterpolation(t,e,i,r,s,n,a,o){return null===this.getBarycoord(t,e,i,r,Gn)?(o.x=0,o.y=0,"z"in o&&(o.z=0),"w"in o&&(o.w=0),null):(o.setScalar(0),o.addScaledVector(s,Gn.x),o.addScaledVector(n,Gn.y),o.addScaledVector(a,Gn.z),o)}static getInterpolatedAttribute(t,e,i,r,s,n){return ra.setScalar(0),sa.setScalar(0),na.setScalar(0),ra.fromBufferAttribute(t,e),sa.fromBufferAttribute(t,i),na.fromBufferAttribute(t,r),n.setScalar(0),n.addScaledVector(ra,s.x),n.addScaledVector(sa,s.y),n.addScaledVector(na,s.z),n}static isFrontFacing(t,e,i,r){return Yn.subVectors(i,e),Zn.subVectors(t,e),Yn.cross(Zn).dot(r)<0}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,r){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[r]),this}setFromAttributeAndIndices(t,e,i,r){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(t,r),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Yn.subVectors(this.c,this.b),Zn.subVectors(this.a,this.b),.5*Yn.cross(Zn).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return aa.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return aa.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,i,r,s){return aa.getInterpolation(t,this.a,this.b,this.c,e,i,r,s)}containsPoint(t){return aa.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return aa.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const i=this.a,r=this.b,s=this.c;let n,a;Qn.subVectors(r,i),$n.subVectors(s,i),ta.subVectors(t,i);const o=Qn.dot(ta),h=$n.dot(ta);if(o<=0&&h<=0)return e.copy(i);ea.subVectors(t,r);const u=Qn.dot(ea),l=$n.dot(ea);if(u>=0&&l<=u)return e.copy(r);const c=o*l-u*h;if(c<=0&&o>=0&&u<=0)return n=o/(o-u),e.copy(i).addScaledVector(Qn,n);ia.subVectors(t,s);const d=Qn.dot(ia),p=$n.dot(ia);if(p>=0&&d<=p)return e.copy(s);const m=d*h-o*p;if(m<=0&&h>=0&&p<=0)return a=h/(h-p),e.copy(i).addScaledVector($n,a);const f=u*p-d*l;if(f<=0&&l-u>=0&&d-p>=0)return Kn.subVectors(s,r),a=(l-u)/(l-u+(d-p)),e.copy(r).addScaledVector(Kn,a);const y=1/(f+m+c);return n=m*y,a=c*y,e.copy(i).addScaledVector(Qn,n).addScaledVector($n,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const oa={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},ha={h:0,s:0,l:0},ua={h:0,s:0,l:0};function la(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+6*(e-t)*(2/3-i):t}class ca{constructor(t,e,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,i)}set(t,e,i){if(void 0===e&&void 0===i){const e=t;e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e)}else this.setRGB(t,e,i);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=os){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,Es.toWorkingColorSpace(this,e),this}setRGB(t,e,i,r=Es.workingColorSpace){return this.r=t,this.g=e,this.b=i,Es.toWorkingColorSpace(this,r),this}setHSL(t,e,i,r=Es.workingColorSpace){if(t=_s(t,1),e=xs(e,0,1),i=xs(i,0,1),0===e)this.r=this.g=this.b=i;else{const r=i<=.5?i*(1+e):i+e-i*e,s=2*i-r;this.r=la(s,r,t+1/3),this.g=la(s,r,t),this.b=la(s,r,t-1/3)}return Es.toWorkingColorSpace(this,r),this}setStyle(t,e=os){function i(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(t)){let s;const n=r[1],a=r[2];switch(n){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,e);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,e);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(t)){const i=r[1],s=i.length;if(3===s)return this.setRGB(parseInt(i.charAt(0),16)/15,parseInt(i.charAt(1),16)/15,parseInt(i.charAt(2),16)/15,e);if(6===s)return this.setHex(parseInt(i,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=os){const i=oa[t.toLowerCase()];return void 0!==i?this.setHex(i,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=Os(t.r),this.g=Os(t.g),this.b=Os(t.b),this}copyLinearToSRGB(t){return this.r=Bs(t.r),this.g=Bs(t.g),this.b=Bs(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=os){return Es.fromWorkingColorSpace(da.copy(this),t),65536*Math.round(xs(255*da.r,0,255))+256*Math.round(xs(255*da.g,0,255))+Math.round(xs(255*da.b,0,255))}getHexString(t=os){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Es.workingColorSpace){Es.fromWorkingColorSpace(da.copy(this),e);const i=da.r,r=da.g,s=da.b,n=Math.max(i,r,s),a=Math.min(i,r,s);let o,h;const u=(a+n)/2;if(a===n)o=0,h=0;else{const t=n-a;switch(h=u<=.5?t/(n+a):t/(2-n-a),n){case i:o=(r-s)/t+(r<s?6:0);break;case r:o=(s-i)/t+2;break;case s:o=(i-r)/t+4}o/=6}return t.h=o,t.s=h,t.l=u,t}getRGB(t,e=Es.workingColorSpace){return Es.fromWorkingColorSpace(da.copy(this),e),t.r=da.r,t.g=da.g,t.b=da.b,t}getStyle(t=os){Es.fromWorkingColorSpace(da.copy(this),t);const e=da.r,i=da.g,r=da.b;return t!==os?`color(${t} ${e.toFixed(3)} ${i.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(255*e)},${Math.round(255*i)},${Math.round(255*r)})`}offsetHSL(t,e,i){return this.getHSL(ha),this.setHSL(ha.h+t,ha.s+e,ha.l+i)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,i){return this.r=t.r+(e.r-t.r)*i,this.g=t.g+(e.g-t.g)*i,this.b=t.b+(e.b-t.b)*i,this}lerpHSL(t,e){this.getHSL(ha),t.getHSL(ua);const i=vs(ha.h,ua.h,e),r=vs(ha.s,ua.s,e),s=vs(ha.l,ua.l,e);return this.setHSL(i,r,s),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const e=this.r,i=this.g,r=this.b,s=t.elements;return this.r=s[0]*e+s[3]*i+s[6]*r,this.g=s[1]*e+s[4]*i+s[7]*r,this.b=s[2]*e+s[5]*i+s[8]*r,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const da=new ca;ca.NAMES=oa;let pa=0;class ma extends fs{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:pa++}),this.uuid=gs(),this.name="",this.type="Material",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new ca(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=cs,this.stencilZFail=cs,this.stencilZPass=cs,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(const e in t){const i=t[e];if(void 0===i){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const r=this[e];void 0!==r?r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):this[e]=i:console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`)}}toJSON(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});const i={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function r(t){const e=[];for(const i in t){const r=t[i];delete r.metadata,e.push(r)}return e}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.dispersion&&(i.dispersion=this.dispersion),void 0!==this.iridescence&&(i.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(i.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),void 0!==this.anisotropy&&(i.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapRotation&&(i.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(i.blending=this.blending),0!==this.side&&(i.side=this.side),!0===this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=!0),204!==this.blendSrc&&(i.blendSrc=this.blendSrc),205!==this.blendDst&&(i.blendDst=this.blendDst),100!==this.blendEquation&&(i.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(i.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(i.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(i.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(i.depthFunc=this.depthFunc),!1===this.depthTest&&(i.depthTest=this.depthTest),!1===this.depthWrite&&(i.depthWrite=this.depthWrite),!1===this.colorWrite&&(i.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(i.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(i.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(i.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==cs&&(i.stencilFail=this.stencilFail),this.stencilZFail!==cs&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==cs&&(i.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(i.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaHash&&(i.alphaHash=!0),!0===this.alphaToCoverage&&(i.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=!0),!0===this.forceSinglePass&&(i.forceSinglePass=!0),!0===this.wireframe&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(i.flatShading=!0),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),!1===this.fog&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData),e){const e=r(t.textures),s=r(t.images);e.length>0&&(i.textures=e),s.length>0&&(i.images=s)}return i}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let i=null;if(null!==e){const t=e.length;i=new Array(t);for(let r=0;r!==t;++r)i[r]=e[r].clone()}return this.clippingPlanes=i,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}}class fa extends ma{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ca(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Cn,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const ya=new qs,ga=new Ms;let xa=0;class _a{constructor(t,e,i=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:xa++}),this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=i,this.usage=ds,this.updateRanges=[],this.gpuType=ts,this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,i){t*=this.itemSize,i*=e.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[t+r]=e.array[i+r];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(2===this.itemSize)for(let e=0,i=this.count;e<i;e++)ga.fromBufferAttribute(this,e),ga.applyMatrix3(t),this.setXY(e,ga.x,ga.y);else if(3===this.itemSize)for(let e=0,i=this.count;e<i;e++)ya.fromBufferAttribute(this,e),ya.applyMatrix3(t),this.setXYZ(e,ya.x,ya.y,ya.z);return this}applyMatrix4(t){for(let e=0,i=this.count;e<i;e++)ya.fromBufferAttribute(this,e),ya.applyMatrix4(t),this.setXYZ(e,ya.x,ya.y,ya.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)ya.fromBufferAttribute(this,e),ya.applyNormalMatrix(t),this.setXYZ(e,ya.x,ya.y,ya.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)ya.fromBufferAttribute(this,e),ya.transformDirection(t),this.setXYZ(e,ya.x,ya.y,ya.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let i=this.array[t*this.itemSize+e];return this.normalized&&(i=bs(i,this.array)),i}setComponent(t,e,i){return this.normalized&&(i=ws(i,this.array)),this.array[t*this.itemSize+e]=i,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=bs(e,this.array)),e}setX(t,e){return this.normalized&&(e=ws(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=bs(e,this.array)),e}setY(t,e){return this.normalized&&(e=ws(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=bs(e,this.array)),e}setZ(t,e){return this.normalized&&(e=ws(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=bs(e,this.array)),e}setW(t,e){return this.normalized&&(e=ws(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,i){return t*=this.itemSize,this.normalized&&(e=ws(e,this.array),i=ws(i,this.array)),this.array[t+0]=e,this.array[t+1]=i,this}setXYZ(t,e,i,r){return t*=this.itemSize,this.normalized&&(e=ws(e,this.array),i=ws(i,this.array),r=ws(r,this.array)),this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=r,this}setXYZW(t,e,i,r,s){return t*=this.itemSize,this.normalized&&(e=ws(e,this.array),i=ws(i,this.array),r=ws(r,this.array),s=ws(s,this.array)),this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=r,this.array[t+3]=s,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(t.name=this.name),this.usage!==ds&&(t.usage=this.usage),t}}class va extends _a{constructor(t,e,i){super(new Uint16Array(t),e,i)}}class ba extends _a{constructor(t,e,i){super(new Uint32Array(t),e,i)}}class wa extends _a{constructor(t,e,i){super(new Float32Array(t),e,i)}}let Ma=0;const Ta=new _n,Sa=new Xn,za=new qs,Aa=new Hs,ka=new Hs,Ca=new qs;class Ea extends fs{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Ma++}),this.uuid=gs(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(function(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}(t)?ba:va)(t,1):this.index=t,this}setIndirect(t){return this.indirect=t,this}getIndirect(){return this.indirect}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return void 0!==this.attributes[t]}addGroup(t,e,i=0){this.groups.push({start:t,count:e,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);const i=this.attributes.normal;if(void 0!==i){const e=(new Ts).getNormalMatrix(t);i.applyNormalMatrix(e),i.needsUpdate=!0}const r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(t),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(t){return Ta.makeRotationFromQuaternion(t),this.applyMatrix4(Ta),this}rotateX(t){return Ta.makeRotationX(t),this.applyMatrix4(Ta),this}rotateY(t){return Ta.makeRotationY(t),this.applyMatrix4(Ta),this}rotateZ(t){return Ta.makeRotationZ(t),this.applyMatrix4(Ta),this}translate(t,e,i){return Ta.makeTranslation(t,e,i),this.applyMatrix4(Ta),this}scale(t,e,i){return Ta.makeScale(t,e,i),this.applyMatrix4(Ta),this}lookAt(t){return Sa.lookAt(t),Sa.updateMatrix(),this.applyMatrix4(Sa.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(za).negate(),this.translate(za.x,za.y,za.z),this}setFromPoints(t){const e=this.getAttribute("position");if(void 0===e){const e=[];for(let i=0,r=t.length;i<r;i++){const r=t[i];e.push(r.x,r.y,r.z||0)}this.setAttribute("position",new wa(e,3))}else{const i=Math.min(t.length,e.count);for(let r=0;r<i;r++){const i=t[r];e.setXYZ(r,i.x,i.y,i.z||0)}t.length>e.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),e.needsUpdate=!0}return this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Hs);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),void this.boundingBox.set(new qs(-1/0,-1/0,-1/0),new qs(1/0,1/0,1/0));if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let t=0,i=e.length;t<i;t++){const i=e[t];Aa.setFromBufferAttribute(i),this.morphTargetsRelative?(Ca.addVectors(this.boundingBox.min,Aa.min),this.boundingBox.expandByPoint(Ca),Ca.addVectors(this.boundingBox.max,Aa.max),this.boundingBox.expandByPoint(Ca)):(this.boundingBox.expandByPoint(Aa.min),this.boundingBox.expandByPoint(Aa.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new ln);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),void this.boundingSphere.set(new qs,1/0);if(t){const i=this.boundingSphere.center;if(Aa.setFromBufferAttribute(t),e)for(let t=0,i=e.length;t<i;t++){const i=e[t];ka.setFromBufferAttribute(i),this.morphTargetsRelative?(Ca.addVectors(Aa.min,ka.min),Aa.expandByPoint(Ca),Ca.addVectors(Aa.max,ka.max),Aa.expandByPoint(Ca)):(Aa.expandByPoint(ka.min),Aa.expandByPoint(ka.max))}Aa.getCenter(i);let r=0;for(let e=0,s=t.count;e<s;e++)Ca.fromBufferAttribute(t,e),r=Math.max(r,i.distanceToSquared(Ca));if(e)for(let s=0,n=e.length;s<n;s++){const n=e[s],a=this.morphTargetsRelative;for(let e=0,s=n.count;e<s;e++)Ca.fromBufferAttribute(n,e),a&&(za.fromBufferAttribute(t,e),Ca.add(za)),r=Math.max(r,i.distanceToSquared(Ca))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const t=this.index,e=this.attributes;if(null===t||void 0===e.position||void 0===e.normal||void 0===e.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const i=e.position,r=e.normal,s=e.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new _a(new Float32Array(4*i.count),4));const n=this.getAttribute("tangent"),a=[],o=[];for(let t=0;t<i.count;t++)a[t]=new qs,o[t]=new qs;const h=new qs,u=new qs,l=new qs,c=new Ms,d=new Ms,p=new Ms,m=new qs,f=new qs;function y(t,e,r){h.fromBufferAttribute(i,t),u.fromBufferAttribute(i,e),l.fromBufferAttribute(i,r),c.fromBufferAttribute(s,t),d.fromBufferAttribute(s,e),p.fromBufferAttribute(s,r),u.sub(h),l.sub(h),d.sub(c),p.sub(c);const n=1/(d.x*p.y-p.x*d.y);isFinite(n)&&(m.copy(u).multiplyScalar(p.y).addScaledVector(l,-d.y).multiplyScalar(n),f.copy(l).multiplyScalar(d.x).addScaledVector(u,-p.x).multiplyScalar(n),a[t].add(m),a[e].add(m),a[r].add(m),o[t].add(f),o[e].add(f),o[r].add(f))}let g=this.groups;0===g.length&&(g=[{start:0,count:t.count}]);for(let e=0,i=g.length;e<i;++e){const i=g[e],r=i.start;for(let e=r,s=r+i.count;e<s;e+=3)y(t.getX(e+0),t.getX(e+1),t.getX(e+2))}const x=new qs,_=new qs,v=new qs,b=new qs;function w(t){v.fromBufferAttribute(r,t),b.copy(v);const e=a[t];x.copy(e),x.sub(v.multiplyScalar(v.dot(e))).normalize(),_.crossVectors(b,e);const i=_.dot(o[t])<0?-1:1;n.setXYZW(t,x.x,x.y,x.z,i)}for(let e=0,i=g.length;e<i;++e){const i=g[e],r=i.start;for(let e=r,s=r+i.count;e<s;e+=3)w(t.getX(e+0)),w(t.getX(e+1)),w(t.getX(e+2))}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(void 0!==e){let i=this.getAttribute("normal");if(void 0===i)i=new _a(new Float32Array(3*e.count),3),this.setAttribute("normal",i);else for(let t=0,e=i.count;t<e;t++)i.setXYZ(t,0,0,0);const r=new qs,s=new qs,n=new qs,a=new qs,o=new qs,h=new qs,u=new qs,l=new qs;if(t)for(let c=0,d=t.count;c<d;c+=3){const d=t.getX(c+0),p=t.getX(c+1),m=t.getX(c+2);r.fromBufferAttribute(e,d),s.fromBufferAttribute(e,p),n.fromBufferAttribute(e,m),u.subVectors(n,s),l.subVectors(r,s),u.cross(l),a.fromBufferAttribute(i,d),o.fromBufferAttribute(i,p),h.fromBufferAttribute(i,m),a.add(u),o.add(u),h.add(u),i.setXYZ(d,a.x,a.y,a.z),i.setXYZ(p,o.x,o.y,o.z),i.setXYZ(m,h.x,h.y,h.z)}else for(let t=0,a=e.count;t<a;t+=3)r.fromBufferAttribute(e,t+0),s.fromBufferAttribute(e,t+1),n.fromBufferAttribute(e,t+2),u.subVectors(n,s),l.subVectors(r,s),u.cross(l),i.setXYZ(t+0,u.x,u.y,u.z),i.setXYZ(t+1,u.x,u.y,u.z),i.setXYZ(t+2,u.x,u.y,u.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const t=this.attributes.normal;for(let e=0,i=t.count;e<i;e++)Ca.fromBufferAttribute(t,e),Ca.normalize(),t.setXYZ(e,Ca.x,Ca.y,Ca.z)}toNonIndexed(){function t(t,e){const i=t.array,r=t.itemSize,s=t.normalized,n=new i.constructor(e.length*r);let a=0,o=0;for(let s=0,h=e.length;s<h;s++){a=t.isInterleavedBufferAttribute?e[s]*t.data.stride+t.offset:e[s]*r;for(let t=0;t<r;t++)n[o++]=i[a++]}return new _a(n,r,s)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new Ea,i=this.index.array,r=this.attributes;for(const s in r){const n=t(r[s],i);e.setAttribute(s,n)}const s=this.morphAttributes;for(const r in s){const n=[],a=s[r];for(let e=0,r=a.length;e<r;e++){const r=t(a[e],i);n.push(r)}e.morphAttributes[r]=n}e.morphTargetsRelative=this.morphTargetsRelative;const n=this.groups;for(let t=0,i=n.length;t<i;t++){const i=n[t];e.addGroup(i.start,i.count,i.materialIndex)}return e}toJSON(){const t={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const i in e)void 0!==e[i]&&(t[i]=e[i]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const i=this.attributes;for(const e in i){const r=i[e];t.data.attributes[e]=r.toJSON(t.data)}const r={};let s=!1;for(const e in this.morphAttributes){const i=this.morphAttributes[e],n=[];for(let e=0,r=i.length;e<r;e++){const r=i[e];n.push(r.toJSON(t.data))}n.length>0&&(r[e]=n,s=!0)}s&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);const n=this.groups;n.length>0&&(t.data.groups=JSON.parse(JSON.stringify(n)));const a=this.boundingSphere;return null!==a&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t}clone(){return(new this.constructor).copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const i=t.index;null!==i&&this.setIndex(i.clone());const r=t.attributes;for(const t in r){const i=r[t];this.setAttribute(t,i.clone(e))}const s=t.morphAttributes;for(const t in s){const i=[],r=s[t];for(let t=0,s=r.length;t<s;t++)i.push(r[t].clone(e));this.morphAttributes[t]=i}this.morphTargetsRelative=t.morphTargetsRelative;const n=t.groups;for(let t=0,e=n.length;t<e;t++){const e=n[t];this.addGroup(e.start,e.count,e.materialIndex)}const a=t.boundingBox;null!==a&&(this.boundingBox=a.clone());const o=t.boundingSphere;return null!==o&&(this.boundingSphere=o.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const Oa=new _n,Ba=new xn,Pa=new ln,Ra=new qs,Ia=new qs,Fa=new qs,Va=new qs,Na=new qs,Da=new qs,Ua=new qs,La=new qs;class qa extends Xn{constructor(t=new Ea,e=new fa){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const i=t[e[0]];if(void 0!==i){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=i.length;t<e;t++){const e=i[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}getVertexPosition(t,e){const i=this.geometry,r=i.attributes.position,s=i.morphAttributes.position,n=i.morphTargetsRelative;e.fromBufferAttribute(r,t);const a=this.morphTargetInfluences;if(s&&a){Da.set(0,0,0);for(let i=0,r=s.length;i<r;i++){const r=a[i],o=s[i];0!==r&&(Na.fromBufferAttribute(o,t),n?Da.addScaledVector(Na,r):Da.addScaledVector(Na.sub(e),r))}e.add(Da)}return e}raycast(t,e){const i=this.geometry,r=this.material,s=this.matrixWorld;if(void 0!==r){if(null===i.boundingSphere&&i.computeBoundingSphere(),Pa.copy(i.boundingSphere),Pa.applyMatrix4(s),Ba.copy(t.ray).recast(t.near),!1===Pa.containsPoint(Ba.origin)){if(null===Ba.intersectSphere(Pa,Ra))return;if(Ba.origin.distanceToSquared(Ra)>(t.far-t.near)**2)return}Oa.copy(s).invert(),Ba.copy(t.ray).applyMatrix4(Oa),null!==i.boundingBox&&!1===Ba.intersectsBox(i.boundingBox)||this._computeIntersections(t,e,Ba)}}_computeIntersections(t,e,i){let r;const s=this.geometry,n=this.material,a=s.index,o=s.attributes.position,h=s.attributes.uv,u=s.attributes.uv1,l=s.attributes.normal,c=s.groups,d=s.drawRange;if(null!==a)if(Array.isArray(n))for(let s=0,o=c.length;s<o;s++){const o=c[s],p=n[o.materialIndex];for(let s=Math.max(o.start,d.start),n=Math.min(a.count,Math.min(o.start+o.count,d.start+d.count));s<n;s+=3){r=Wa(this,p,t,i,h,u,l,a.getX(s),a.getX(s+1),a.getX(s+2)),r&&(r.faceIndex=Math.floor(s/3),r.face.materialIndex=o.materialIndex,e.push(r))}}else{for(let s=Math.max(0,d.start),o=Math.min(a.count,d.start+d.count);s<o;s+=3){r=Wa(this,n,t,i,h,u,l,a.getX(s),a.getX(s+1),a.getX(s+2)),r&&(r.faceIndex=Math.floor(s/3),e.push(r))}}else if(void 0!==o)if(Array.isArray(n))for(let s=0,a=c.length;s<a;s++){const a=c[s],p=n[a.materialIndex];for(let s=Math.max(a.start,d.start),n=Math.min(o.count,Math.min(a.start+a.count,d.start+d.count));s<n;s+=3){r=Wa(this,p,t,i,h,u,l,s,s+1,s+2),r&&(r.faceIndex=Math.floor(s/3),r.face.materialIndex=a.materialIndex,e.push(r))}}else{for(let s=Math.max(0,d.start),a=Math.min(o.count,d.start+d.count);s<a;s+=3){r=Wa(this,n,t,i,h,u,l,s,s+1,s+2),r&&(r.faceIndex=Math.floor(s/3),e.push(r))}}}}function Wa(t,e,i,r,s,n,a,o,h,u){t.getVertexPosition(o,Ia),t.getVertexPosition(h,Fa),t.getVertexPosition(u,Va);const l=function(t,e,i,r,s,n,a,o){let h;if(h=1===e.side?r.intersectTriangle(a,n,s,!0,o):r.intersectTriangle(s,n,a,0===e.side,o),null===h)return null;La.copy(o),La.applyMatrix4(t.matrixWorld);const u=i.ray.origin.distanceTo(La);return u<i.near||u>i.far?null:{distance:u,point:La.clone(),object:t}}(t,e,i,r,Ia,Fa,Va,Ua);if(l){const t=new qs;aa.getBarycoord(Ua,Ia,Fa,Va,t),s&&(l.uv=aa.getInterpolatedAttribute(s,o,h,u,t,new Ms)),n&&(l.uv1=aa.getInterpolatedAttribute(n,o,h,u,t,new Ms)),a&&(l.normal=aa.getInterpolatedAttribute(a,o,h,u,t,new qs),l.normal.dot(r.direction)>0&&l.normal.multiplyScalar(-1));const e={a:o,b:h,c:u,normal:new qs,materialIndex:0};aa.getNormal(Ia,Fa,Va,e.normal),l.face=e,l.barycoord=t}return l}function ja(t){const e={};for(const i in t){e[i]={};for(const r in t[i]){const s=t[i][r];s&&(s.isColor||s.isMatrix3||s.isMatrix4||s.isVector2||s.isVector3||s.isVector4||s.isTexture||s.isQuaternion)?s.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[i][r]=null):e[i][r]=s.clone():Array.isArray(s)?e[i][r]=s.slice():e[i][r]=s}}return e}class Ha extends ma{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==t&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=ja(t.uniforms),this.uniformsGroups=function(t){const e=[];for(let i=0;i<t.length;i++)e.push(t[i].clone());return e}(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){const e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(const i in this.uniforms){const r=this.uniforms[i].value;r&&r.isTexture?e.uniforms[i]={type:"t",value:r.toJSON(t).uuid}:r&&r.isColor?e.uniforms[i]={type:"c",value:r.getHex()}:r&&r.isVector2?e.uniforms[i]={type:"v2",value:r.toArray()}:r&&r.isVector3?e.uniforms[i]={type:"v3",value:r.toArray()}:r&&r.isVector4?e.uniforms[i]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?e.uniforms[i]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?e.uniforms[i]={type:"m4",value:r.toArray()}:e.uniforms[i]={value:r}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const i={};for(const t in this.extensions)!0===this.extensions[t]&&(i[t]=!0);return Object.keys(i).length>0&&(e.extensions=i),e}}class Xa extends Ea{constructor(t=1,e=1,i=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:i,heightSegments:r};const s=t/2,n=e/2,a=Math.floor(i),o=Math.floor(r),h=a+1,u=o+1,l=t/a,c=e/o,d=[],p=[],m=[],f=[];for(let t=0;t<u;t++){const e=t*c-n;for(let i=0;i<h;i++){const r=i*l-s;p.push(r,-e,0),m.push(0,0,1),f.push(i/a),f.push(1-t/o)}}for(let t=0;t<o;t++)for(let e=0;e<a;e++){const i=e+h*t,r=e+h*(t+1),s=e+1+h*(t+1),n=e+1+h*t;d.push(i,r,n),d.push(r,s,n)}this.setIndex(d),this.setAttribute("position",new wa(p,3)),this.setAttribute("normal",new wa(m,3)),this.setAttribute("uv",new wa(f,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Xa(t.width,t.height,t.widthSegments,t.heightSegments)}}function Ya(t,e){return t&&t.constructor!==e?"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t):t}function Za(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}class Ja{constructor(t,e,i,r){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new e.constructor(i),this.sampleValues=e,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(t){const e=this.parameterPositions;let i=this._cachedIndex,r=e[i],s=e[i-1];t:{e:{let n;i:{r:if(!(t<r)){for(let n=i+2;;){if(void 0===r){if(t<s)break r;return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===n)break;if(s=r,r=e[++i],t<r)break e}n=e.length;break i}if(t>=s)break t;{const a=e[1];t<a&&(i=2,s=a);for(let n=i-2;;){if(void 0===s)return this._cachedIndex=0,this.copySampleValue_(0);if(i===n)break;if(r=s,s=e[--i-1],t>=s)break e}n=i,i=0}}for(;i<n;){const r=i+n>>>1;t<e[r]?n=r:i=r+1}if(r=e[i],s=e[i-1],void 0===s)return this._cachedIndex=0,this.copySampleValue_(0);if(void 0===r)return i=e.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,s,r)}return this.interpolate_(i,s,t,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){const e=this.resultBuffer,i=this.sampleValues,r=this.valueSize,s=t*r;for(let t=0;t!==r;++t)e[t]=i[s+t];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class Ga extends Ja{constructor(t,e,i,r){super(t,e,i,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:ss,endingEnd:ss}}intervalChanged_(t,e,i){const r=this.parameterPositions;let s=t-2,n=t+1,a=r[s],o=r[n];if(void 0===a)switch(this.getSettings_().endingStart){case ns:s=t,a=2*e-i;break;case as:s=r.length-2,a=e+r[s]-r[s+1];break;default:s=t,a=i}if(void 0===o)switch(this.getSettings_().endingEnd){case ns:n=t,o=2*i-e;break;case as:n=1,o=i+r[1]-r[0];break;default:n=t-1,o=e}const h=.5*(i-e),u=this.valueSize;this._weightPrev=h/(e-a),this._weightNext=h/(o-i),this._offsetPrev=s*u,this._offsetNext=n*u}interpolate_(t,e,i,r){const s=this.resultBuffer,n=this.sampleValues,a=this.valueSize,o=t*a,h=o-a,u=this._offsetPrev,l=this._offsetNext,c=this._weightPrev,d=this._weightNext,p=(i-e)/(r-e),m=p*p,f=m*p,y=-c*f+2*c*m-c*p,g=(1+c)*f+(-1.5-2*c)*m+(-.5+c)*p+1,x=(-1-d)*f+(1.5+d)*m+.5*p,_=d*f-d*m;for(let t=0;t!==a;++t)s[t]=y*n[u+t]+g*n[h+t]+x*n[o+t]+_*n[l+t];return s}}class Qa extends Ja{constructor(t,e,i,r){super(t,e,i,r)}interpolate_(t,e,i,r){const s=this.resultBuffer,n=this.sampleValues,a=this.valueSize,o=t*a,h=o-a,u=(i-e)/(r-e),l=1-u;for(let t=0;t!==a;++t)s[t]=n[h+t]*l+n[o+t]*u;return s}}class $a extends Ja{constructor(t,e,i,r){super(t,e,i,r)}interpolate_(t){return this.copySampleValue_(t-1)}}class Ka{constructor(t,e,i,r){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=Ya(e,this.TimeBufferType),this.values=Ya(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(t){const e=t.constructor;let i;if(e.toJSON!==this.toJSON)i=e.toJSON(t);else{i={name:t.name,times:Ya(t.times,Array),values:Ya(t.values,Array)};const e=t.getInterpolation();e!==t.DefaultInterpolation&&(i.interpolation=e)}return i.type=t.ValueTypeName,i}InterpolantFactoryMethodDiscrete(t){return new $a(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new Qa(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new Ga(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case es:e=this.InterpolantFactoryMethodDiscrete;break;case is:e=this.InterpolantFactoryMethodLinear;break;case rs:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){const e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(e);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",e),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return es;case this.InterpolantFactoryMethodLinear:return is;case this.InterpolantFactoryMethodSmooth:return rs}}getValueSize(){return this.values.length/this.times.length}shift(t){if(0!==t){const e=this.times;for(let i=0,r=e.length;i!==r;++i)e[i]+=t}return this}scale(t){if(1!==t){const e=this.times;for(let i=0,r=e.length;i!==r;++i)e[i]*=t}return this}trim(t,e){const i=this.times,r=i.length;let s=0,n=r-1;for(;s!==r&&i[s]<t;)++s;for(;-1!==n&&i[n]>e;)--n;if(++n,0!==s||n!==r){s>=n&&(n=Math.max(n,1),s=n-1);const t=this.getValueSize();this.times=i.slice(s,n),this.values=this.values.slice(s*t,n*t)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const i=this.times,r=this.values,s=i.length;0===s&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let n=null;for(let e=0;e!==s;e++){const r=i[e];if("number"==typeof r&&isNaN(r)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,e,r),t=!1;break}if(null!==n&&n>r){console.error("THREE.KeyframeTrack: Out of order keys.",this,e,r,n),t=!1;break}n=r}if(void 0!==r&&Za(r))for(let e=0,i=r.length;e!==i;++e){const i=r[e];if(isNaN(i)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,e,i),t=!1;break}}return t}optimize(){const t=this.times.slice(),e=this.values.slice(),i=this.getValueSize(),r=this.getInterpolation()===rs,s=t.length-1;let n=1;for(let a=1;a<s;++a){let s=!1;const o=t[a];if(o!==t[a+1]&&(1!==a||o!==t[0]))if(r)s=!0;else{const t=a*i,r=t-i,n=t+i;for(let a=0;a!==i;++a){const i=e[t+a];if(i!==e[r+a]||i!==e[n+a]){s=!0;break}}}if(s){if(a!==n){t[n]=t[a];const r=a*i,s=n*i;for(let t=0;t!==i;++t)e[s+t]=e[r+t]}++n}}if(s>0){t[n]=t[s];for(let t=s*i,r=n*i,a=0;a!==i;++a)e[r+a]=e[t+a];++n}return n!==t.length?(this.times=t.slice(0,n),this.values=e.slice(0,n*i)):(this.times=t,this.values=e),this}clone(){const t=this.times.slice(),e=this.values.slice(),i=new(0,this.constructor)(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}}Ka.prototype.ValueTypeName="",Ka.prototype.TimeBufferType=Float32Array,Ka.prototype.ValueBufferType=Float32Array,Ka.prototype.DefaultInterpolation=is;class to extends Ka{constructor(t,e,i){super(t,e,i)}}to.prototype.ValueTypeName="bool",to.prototype.ValueBufferType=Array,to.prototype.DefaultInterpolation=es,to.prototype.InterpolantFactoryMethodLinear=void 0,to.prototype.InterpolantFactoryMethodSmooth=void 0;class eo extends Ka{constructor(t,e,i,r){super(t,e,i,r)}}eo.prototype.ValueTypeName="color";class io extends Ka{constructor(t,e,i,r){super(t,e,i,r)}}io.prototype.ValueTypeName="number";class ro extends Ja{constructor(t,e,i,r){super(t,e,i,r)}interpolate_(t,e,i,r){const s=this.resultBuffer,n=this.sampleValues,a=this.valueSize,o=(i-e)/(r-e);let h=t*a;for(let t=h+a;h!==t;h+=4)Ls.slerpFlat(s,0,n,h-a,n,h,o);return s}}class so extends Ka{constructor(t,e,i,r){super(t,e,i,r)}InterpolantFactoryMethodLinear(t){return new ro(this.times,this.values,this.getValueSize(),t)}}so.prototype.ValueTypeName="quaternion",so.prototype.InterpolantFactoryMethodSmooth=void 0;class no extends Ka{constructor(t,e,i){super(t,e,i)}}no.prototype.ValueTypeName="string",no.prototype.ValueBufferType=Array,no.prototype.DefaultInterpolation=es,no.prototype.InterpolantFactoryMethodLinear=void 0,no.prototype.InterpolantFactoryMethodSmooth=void 0;class ao extends Ka{constructor(t,e,i,r){super(t,e,i,r)}}ao.prototype.ValueTypeName="vector";const oo={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};class ho{constructor(t,e,i){const r=this;let s,n=!1,a=0,o=0;const h=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=i,this.itemStart=function(t){o++,!1===n&&void 0!==r.onStart&&r.onStart(t,a,o),n=!0},this.itemEnd=function(t){a++,void 0!==r.onProgress&&r.onProgress(t,a,o),a===o&&(n=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(t){void 0!==r.onError&&r.onError(t)},this.resolveURL=function(t){return s?s(t):t},this.setURLModifier=function(t){return s=t,this},this.addHandler=function(t,e){return h.push(t,e),this},this.removeHandler=function(t){const e=h.indexOf(t);return-1!==e&&h.splice(e,2),this},this.getHandler=function(t){for(let e=0,i=h.length;e<i;e+=2){const i=h[e],r=h[e+1];if(i.global&&(i.lastIndex=0),i.test(t))return r}return null}}}const uo=new ho;class lo{constructor(t){this.manager=void 0!==t?t:uo,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){const i=this;return new Promise((function(r,s){i.load(t,r,e,s)}))}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}lo.DEFAULT_MATERIAL_NAME="__DEFAULT";Error;class co extends lo{constructor(t){super(t)}load(t,e,i,r){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const s=this,n=oo.get(t);if(void 0!==n)return s.manager.itemStart(t),setTimeout((function(){e&&e(n),s.manager.itemEnd(t)}),0),n;const a=zs("img");function o(){u(),oo.add(t,this),e&&e(this),s.manager.itemEnd(t)}function h(e){u(),r&&r(e),s.manager.itemError(t),s.manager.itemEnd(t)}function u(){a.removeEventListener("load",o,!1),a.removeEventListener("error",h,!1)}return a.addEventListener("load",o,!1),a.addEventListener("error",h,!1),"data:"!==t.slice(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),s.manager.itemStart(t),a.src=t,a}}class po extends lo{constructor(t){super(t)}load(t,e,i,r){const s=new Ds,n=new co(this.manager);return n.setCrossOrigin(this.crossOrigin),n.setPath(this.path),n.load(t,(function(t){s.image=t,s.needsUpdate=!0,void 0!==e&&e(s)}),i,r),s}}const mo="\\[\\]\\.:\\/",fo=new RegExp("["+mo+"]","g"),yo="[^"+mo+"]",go="[^"+mo.replace("\\.","")+"]",xo=new RegExp("^"+/((?:WC+[\/:])*)/.source.replace("WC",yo)+/(WCOD+)?/.source.replace("WCOD",go)+/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",yo)+/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",yo)+"$"),_o=["material","materials","bones","map"];class vo{constructor(t,e,i){this.path=e,this.parsedPath=i||vo.parseTrackName(e),this.node=vo.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,i){return t&&t.isAnimationObjectGroup?new vo.Composite(t,e,i):new vo(t,e,i)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(fo,"")}static parseTrackName(t){const e=xo.exec(t);if(null===e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const i={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){const t=i.nodeName.substring(r+1);-1!==_o.indexOf(t)&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=t)}if(null===i.propertyName||0===i.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i}static findNode(t,e){if(void 0===e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){const i=t.skeleton.getBoneByName(e);if(void 0!==i)return i}if(t.children){const i=function(t){for(let r=0;r<t.length;r++){const s=t[r];if(s.name===e||s.uuid===e)return s;const n=i(s.children);if(n)return n}return null},r=i(t.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)t[e++]=i[r]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=t[e++]}_setValue_array_setNeedsUpdate(t,e){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node;const e=this.parsedPath,i=e.objectName,r=e.propertyName;let s=e.propertyIndex;if(t||(t=vo.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");if(i){let r=e.objectIndex;switch(i){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(let e=0;e<t.length;e++)if(t[e].name===r){r=e;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.map)return void console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);t=t.material.map;break;default:if(void 0===t[i])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[i]}if(void 0!==r){if(void 0===t[r])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[r]}}const n=t[r];if(void 0===n){const i=e.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+i+"."+r+" but it wasn't found.",t)}let a=this.Versioning.None;this.targetObject=t,!0===t.isMaterial?a=this.Versioning.NeedsUpdate:!0===t.isObject3D&&(a=this.Versioning.MatrixWorldNeedsUpdate);let o=this.BindingType.Direct;if(void 0!==s){if("morphTargetInfluences"===r){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==t.morphTargetDictionary[s]&&(s=t.morphTargetDictionary[s])}o=this.BindingType.ArrayElement,this.resolvedProperty=n,this.propertyIndex=s}else void 0!==n.fromArray&&void 0!==n.toArray?(o=this.BindingType.HasFromToArray,this.resolvedProperty=n):Array.isArray(n)?(o=this.BindingType.EntireArray,this.resolvedProperty=n):this.propertyName=r;this.getValue=this.GetterByBindingType[o],this.setValue=this.SetterByBindingTypeAndVersioning[o][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}vo.Composite=class{constructor(t,e,i){const r=i||vo.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,r)}getValue(t,e){this.bind();const i=this._targetGroup.nCachedObjects_,r=this._bindings[i];void 0!==r&&r.getValue(t,e)}setValue(t,e){const i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=i.length;r!==s;++r)i[r].setValue(t,e)}bind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()}unbind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}},vo.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},vo.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},vo.prototype.GetterByBindingType=[vo.prototype._getValue_direct,vo.prototype._getValue_array,vo.prototype._getValue_arrayElement,vo.prototype._getValue_toArray],vo.prototype.SetterByBindingTypeAndVersioning=[[vo.prototype._setValue_direct,vo.prototype._setValue_direct_setNeedsUpdate,vo.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[vo.prototype._setValue_array,vo.prototype._setValue_array_setNeedsUpdate,vo.prototype._setValue_array_setMatrixWorldNeedsUpdate],[vo.prototype._setValue_arrayElement,vo.prototype._setValue_arrayElement_setNeedsUpdate,vo.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[vo.prototype._setValue_fromArray,vo.prototype._setValue_fromArray_setNeedsUpdate,vo.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];new Float32Array(1);"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"176"}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="176");const bo={CherryWave:({container:t,image:e,speed:r=.05,strength:s=.02,hover:n=!1,light:a})=>{if(!e)return void console.log("No image provided");(new po).load(e.src,(e=>{const o={uImage:{value:e},uTime:{value:0},uStrength:{value:n?0:s},uLight:{value:a}},h=i(t.clientWidth,t.clientHeight);let u;function l(){u&&(h.Scene.remove(u),u.geometry.dispose(),u.material.dispose()),u=function(){const e=t.clientWidth,i=t.clientHeight,r=new Xa(e/i*2.3,2.3,100,100),s=new Ha({vertexShader:"\nprecision highp float;\n varying vec2 vUv;\n varying vec3 pos;\n uniform float uTime;\n uniform float uStrength;\n\n void main() {\n \n vUv = uv;\n \n vec3 newPosition = position;\n\n \n float waveX = uStrength * sin(10.0 * uv.y + uTime * 2.0);\n float waveY = uStrength * cos(12.0 * uv.x + uTime * 1.5);\n \n float waveZ = uStrength * sin(10.0 * uv.x + uTime * 2.5);\n\n newPosition.x += waveX;\n newPosition.y += waveY;\n newPosition.z += waveZ;\n\n pos = (modelViewMatrix * vec4(newPosition, 1.0)).xyz;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(newPosition, 1.0);\n }",fragmentShader:"\nprecision highp float;\n\nvarying vec2 vUv;\nuniform sampler2D uImage;\nuniform float uTime;\n\nuniform float uStrength;\nuniform bool uLight;\n\n\nvoid main() {\n vec2 uv = vUv;\n \n\n \n \n\n // Apply wave distortion\n float waveX = sin(10.0 * uv.y + uTime * 2.0);\n float waveY = cos(10.0 * uv.x + uTime * 2.0);\n uv.x += (uStrength * 0.05) * waveX;\n uv.y += (uStrength * 0.05) * waveY;\n\n \n\n vec4 color = texture2D(uImage, uv);\n if(uLight){\n color.x+=smoothstep(0.001,0.6,sin(2.0*uTime));\n color.y+=smoothstep(0.2,0.6,sin(0.2*uTime));\n }\n \n gl_FragColor = color;\n}\n",uniforms:o,transparent:!0});return new qa(r,s)}(),h.mesh=u,h.Scene.add(u)}function c(){const e=t.clientWidth,i=t.clientHeight;h.renderer.setSize(e,i),h.renderer.setPixelRatio(window.devicePixelRatio),h.camera.aspect=e/i,h.camera.updateProjectionMatrix(),l()}return h.camera.fov=2*Math.atan(t.clientHeight/2/600)*(180/Math.PI),h.camera.position.z=2.8,n&&(t.addEventListener("mouseenter",(()=>{Gr.to(o.uStrength,{value:s,duration:.5,ease:"power2.out"})})),t.addEventListener("mouseleave",(()=>{Gr.to(o.uStrength,{value:0,duration:.5,ease:"power2.out"})}))),t.innerHTML="",t.appendChild(h.renderer.domElement),window.addEventListener("resize",c),c(),function t(){o.uTime.value+=r,h.renderer.render(h.Scene,h.camera),requestAnimationFrame(t)}(),{mesh:h.mesh,geometry:h.geometry,renderer:h.renderer,Scene:h.Scene}}))},ImageTransition1:function(t,{speed:e=.02,strength:r=.02,radius:s=.02,hover:n=!1,noise:a=.4}={}){let o=Array.from(t.querySelectorAll("img"));if(!o.length)return void console.log("No image provided");const h={uImage:{value:null},uImage2:{value:null},uTime:{value:0},uStrength:{value:n?0:r},uNoise:{value:a},uMouse:{value:new Ms(-10,-10)},uRadius:{value:s}},u=new po;let l,c=[];o.map(((t,e)=>{u.load(t.src,(t=>{l=0,1==e&&(h.uImage2.value=t),0==e&&(h.uImage.value=t),c.push(t)}))}));const d=i(t.clientWidth,t.clientHeight);let p;function m(){p&&(d.Scene.remove(p),p.geometry.dispose(),p.material.dispose()),p=function(){const e=t.clientWidth,i=t.clientHeight,r=new Xa(e/i*2.3,2.3,100,100),s=new Ha({vertexShader:"\nprecision highp float;\nvarying vec2 vUv; \n\n void main() { \n vUv = uv; \n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }",fragmentShader:"\nprecision highp float;\nuniform vec2 uMouse;\nvarying vec2 vUv;\nuniform sampler2D uImage;\nuniform float uTime;\nuniform float uRadius;\nuniform float uStrength;\nuniform float uNoise;\nuniform bool uLight;\nuniform sampler2D uImage2;\nfloat rand(float n){return fract(sin(n) * 43758.5453123);}\nfloat rand(vec2 n){return fract(sin(dot(n, vec2(12.9898, 4.1414))) * 43758.5453123);}\n\nfloat noise(float p){\n float fl = floor(p);\n float fc = fract(p);\n return mix(rand(fl), rand(fl + 1.0), fc);\n}\n \nfloat noise(vec2 n) {\n const vec2 d = vec2(0.0, 1.0);\n vec2 b = floor(n), f = smoothstep(vec2(0.0), vec2(1.0), fract(n));\n return mix(mix(rand(b), rand(b + d.yx), f.x), mix(rand(b + d.xy), rand(b + d.yy), f.x), f.y);\n}\n\nvoid main() {\n vec2 uv = vUv;\n vec2 guv = vUv;\n guv.x -= 0.5;\n guv.y -= 0.5;\n\n // Calculate distance from mouse\n float dist = length(guv - uMouse);\n\n \n float edgeNoise = noise(guv * 10.0 + uTime * 2.0 ) * uNoise;\n\n // Create mask for area following mouse, with wobbly edge\n float inside = step(dist, uRadius *edgeNoise);\n\n // Apply noise only inside the circle\n float n = noise(guv * 0.2);\n\n vec3 circle = mix(vec3(1.0), vec3(n), inside);\n\n // Apply wave distortion\n float waveX = sin(10.0 * uv.y + uTime * 2.0);\n float waveY = cos(10.0 * uv.x + uTime * 2.0);\n uv.x += (uStrength * 0.05) * waveX;\n uv.y += (uStrength * 0.05) * waveY;\n\n \n\n vec4 color = texture2D(uImage, uv);\n \n vec4 color2 = texture2D(uImage2,uv);\n gl_FragColor = mix(color,(vec4(n)+color2),inside);\n}\n",uniforms:h,transparent:!0});return new qa(r,s)}(),d.mesh=p,d.Scene.add(p)}function f(){const e=t.clientWidth,i=t.clientHeight;d.renderer.setSize(e,i),d.renderer.setPixelRatio(window.devicePixelRatio),d.camera.aspect=e/i,d.camera.updateProjectionMatrix(),m()}return d.camera.fov=2*Math.atan(t.clientHeight/2/600)*(180/Math.PI),d.camera.position.z=2.8,t.addEventListener("mousemove",(function(e){const i=t.getBoundingClientRect(),r=(e.clientX-i.left)/i.width-.5,s=-(e.clientY-i.top)/i.height+.5;Gr.to(h.uMouse.value,{x:r,y:s,duration:.2})})),n&&(t.addEventListener("mouseenter",(()=>{Gr.to(h.uStrength,{value:r,duration:.5,ease:"power2.out"}),Gr.to(h.uRadius,{value:s,duration:.2})})),t.addEventListener("mouseleave",(()=>{Gr.to(h.uStrength,{value:0,duration:.5,ease:"power2.out"}),Gr.to(h.uRadius,{value:-100,duration:.6})}))),t.innerHTML="",t.appendChild(d.renderer.domElement),window.addEventListener("resize",f),f(),function t(){h.uTime.value+=e,d.renderer.render(d.Scene,d.camera),requestAnimationFrame(t)}(),t.addEventListener("click",(()=>{const t=(l+1)%c.length,e=(l+2)%c.length;Gr.to(h.uRadius,{value:2,duration:2,ease:"power2.inOut",onComplete:()=>{h.uImage.value=c[t],h.uImage2.value=c[e],Gr.fromTo(h.uRadius,{value:0},{value:s,duration:2,ease:"power2.inOut"}),l=t}})})),{mesh:d.mesh,geometry:d.geometry,renderer:d.renderer,Scene:d.Scene,currntimageIndex:l}}};return e})()));
|
package/package.json
CHANGED
package/src/cherry.js
CHANGED
@@ -2,7 +2,7 @@ import createWaveAssets from "../../utils/init.js";
|
|
2
2
|
import fragmentShader from "./FragementShader.glsl.js";
|
3
3
|
import vertexShader from "./VertexShader.glsl.js";
|
4
4
|
import gsap from "gsap";
|
5
|
-
|
5
|
+
import *as THREE from 'three';
|
6
6
|
|
7
7
|
export function ImageTransition1(
|
8
8
|
container,
|
@@ -3,6 +3,7 @@ import createWaveAssets from '../../utils/init.js';
|
|
3
3
|
import fragmentShader from './FragementShader.glsl.js';
|
4
4
|
import vertexShader from './Vertexshader.glsl.js';
|
5
5
|
import gsap from 'gsap';
|
6
|
+
import *as THREE from 'three';
|
6
7
|
|
7
8
|
const CherryWave = ({ container, image, speed = 0.05, strength = 0.02, hover = false,light }) => {
|
8
9
|
if (!image) {
|