@widelab-development/pirxey-webflow-dev 0.0.14 → 0.0.16
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/blog.css +1 -1
- package/dist/blog.js +29 -33
- package/dist/index.css +1 -1
- package/dist/index.js +29 -33
- package/dist/lp-10-hours.css +1 -1
- package/dist/lp-10-hours.js +22 -26
- package/dist/prx-site.css +1 -1
- package/dist/prx-site.js +196 -189
- package/dist/services.css +1 -1
- package/dist/services.js +30 -34
- package/dist/single-case-study.css +1 -1
- package/dist/single-case-study.js +30 -34
- package/dist/talents.css +1 -1
- package/dist/talents.js +16 -20
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(()=>{function Bi(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Fd(r,t){r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.__proto__=t}var In={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},zs={duration:.5,overwrite:!1,delay:0},Au,an,Ae,qn=1e8,we=1/qn,gu=Math.PI*2,W0=gu/4,X0=0,Nd=Math.sqrt,Y0=Math.cos,q0=Math.sin,Ge=function(t){return typeof t=="string"},Ie=function(t){return typeof t=="function"},zi=function(t){return typeof t=="number"},ul=function(t){return typeof t>"u"},Ti=function(t){return typeof t=="object"},Pn=function(t){return t!==!1},Du=function(){return typeof window<"u"},el=function(t){return Ie(t)||Ge(t)},Ud=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},ln=Array.isArray,_u=/(?:-?\.?\d|\.)+/gi,Cu=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,jr=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,cu=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Ru=/[+-]=-?[.\d]+/,Od=/[^,'"\[\]\s]+/gi,Z0=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Ce,wi,xu,Pu,Bn={},sl={},Bd,kd=function(t){return(sl=Kr(t,Bn))&&cn},hl=function(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")},Qo=function(t,e){return!e&&console.warn(t)},zd=function(t,e){return t&&(Bn[t]=e)&&sl&&(sl[t]=e)||Bn},ta=function(){return 0},J0={suppressEvents:!0,isStart:!0,kill:!1},nl={suppressEvents:!0,kill:!1},$0={suppressEvents:!0},Iu={},fr=[],yu={},Vd,Cn={},uu={},Ad=30,il=[],Lu="",Fu=function(t){var e=t[0],n,i;if(Ti(e)||Ie(e)||(t=[t]),!(n=(e._gsap||{}).harness)){for(i=il.length;i--&&!il[i].targetTest(e););n=il[i]}for(i=t.length;i--;)t[i]&&(t[i]._gsap||(t[i]._gsap=new Ou(t[i],n)))||t.splice(i,1);return t},dr=function(t){return t._gsap||Fu(Zn(t))[0]._gsap},Nu=function(t,e,n){return(n=t[e])&&Ie(n)?t[e]():ul(n)&&t.getAttribute&&t.getAttribute(e)||n},xn=function(t,e){return(t=t.split(",")).forEach(e)||t},Le=function(t){return Math.round(t*1e5)/1e5||0},Je=function(t){return Math.round(t*1e7)/1e7||0},Qr=function(t,e){var n=e.charAt(0),i=parseFloat(e.substr(2));return t=parseFloat(t),n==="+"?t+i:n==="-"?t-i:n==="*"?t*i:t/i},K0=function(t,e){for(var n=e.length,i=0;t.indexOf(e[i])<0&&++i<n;);return i<n},ol=function(){var t=fr.length,e=fr.slice(0),n,i;for(yu={},fr.length=0,n=0;n<t;n++)i=e[n],i&&i._lazy&&(i.render(i._lazy[0],i._lazy[1],!0)._lazy=0)},Hd=function(t,e,n,i){fr.length&&!an&&ol(),t.render(e,n,i||an&&e<0&&(t._initted||t._startAt)),fr.length&&!an&&ol()},Gd=function(t){var e=parseFloat(t);return(e||e===0)&&(t+"").match(Od).length<2?e:Ge(t)?t.trim():t},Wd=function(t){return t},Jn=function(t,e){for(var n in e)n in t||(t[n]=e[n]);return t},j0=function(t){return function(e,n){for(var i in n)i in e||i==="duration"&&t||i==="ease"||(e[i]=n[i])}},Kr=function(t,e){for(var n in e)t[n]=e[n];return t},Dd=function r(t,e){for(var n in e)n!=="__proto__"&&n!=="constructor"&&n!=="prototype"&&(t[n]=Ti(e[n])?r(t[n]||(t[n]={}),e[n]):e[n]);return t},al=function(t,e){var n={},i;for(i in t)i in e||(n[i]=t[i]);return n},$o=function(t){var e=t.parent||Ce,n=t.keyframes?j0(ln(t.keyframes)):Jn;if(Pn(t.inherit))for(;e;)n(t,e.vars.defaults),e=e.parent||e._dp;return t},Q0=function(t,e){for(var n=t.length,i=n===e.length;i&&n--&&t[n]===e[n];);return n<0},Xd=function(t,e,n,i,s){n===void 0&&(n="_first"),i===void 0&&(i="_last");var o=t[i],a;if(s)for(a=e[s];o&&o[s]>a;)o=o._prev;return o?(e._next=o._next,o._next=e):(e._next=t[n],t[n]=e),e._next?e._next._prev=e:t[i]=e,e._prev=o,e.parent=e._dp=t,e},fl=function(t,e,n,i){n===void 0&&(n="_first"),i===void 0&&(i="_last");var s=e._prev,o=e._next;s?s._next=o:t[n]===e&&(t[n]=o),o?o._prev=s:t[i]===e&&(t[i]=s),e._next=e._prev=e.parent=null},pr=function(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},Zr=function(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var n=t;n;)n._dirty=1,n=n.parent;return t},tx=function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t},vu=function(t,e,n,i){return t._startAt&&(an?t._startAt.revert(nl):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,i))},ex=function r(t){return!t||t._ts&&r(t.parent)},Cd=function(t){return t._repeat?Vs(t._tTime,t=t.duration()+t._rDelay)*t:0},Vs=function(t,e){var n=Math.floor(t/=e);return t&&n===t?n-1:n},ll=function(t,e){return(t-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},dl=function(t){return t._end=Je(t._start+(t._tDur/Math.abs(t._ts||t._rts||we)||0))},pl=function(t,e){var n=t._dp;return n&&n.smoothChildTiming&&t._ts&&(t._start=Je(n._time-(t._ts>0?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),dl(t),n._dirty||Zr(n,t)),t},Yd=function(t,e){var n;if((e._time||!e._dur&&e._initted||e._start<t._time&&(e._dur||!e.add))&&(n=ll(t.rawTime(),e),(!e._dur||ia(0,e.totalDuration(),n)-e._tTime>we)&&e.render(n,!0)),Zr(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(n=t;n._dp;)n.rawTime()>=0&&n.totalTime(n._tTime),n=n._dp;t._zTime=-we}},Ei=function(t,e,n,i){return e.parent&&pr(e),e._start=Je((zi(n)?n:n||t!==Ce?Yn(t,n,e):t._time)+e._delay),e._end=Je(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),Xd(t,e,"_first","_last",t._sort?"_start":0),Su(e)||(t._recent=e),i||Yd(t,e),t._ts<0&&pl(t,t._tTime),t},qd=function(t,e){return(Bn.ScrollTrigger||hl("scrollTrigger",e))&&Bn.ScrollTrigger.create(e,t)},Zd=function(t,e,n,i,s){if(zu(t,e,s),!t._initted)return 1;if(!n&&t._pt&&!an&&(t._dur&&t.vars.lazy!==!1||!t._dur&&t.vars.lazy)&&Vd!==Rn.frame)return fr.push(t),t._lazy=[s,i],1},nx=function r(t){var e=t.parent;return e&&e._ts&&e._initted&&!e._lock&&(e.rawTime()<0||r(e))},Su=function(t){var e=t.data;return e==="isFromStart"||e==="isStart"},ix=function(t,e,n,i){var s=t.ratio,o=e<0||!e&&(!t._start&&nx(t)&&!(!t._initted&&Su(t))||(t._ts<0||t._dp._ts<0)&&!Su(t))?0:1,a=t._rDelay,l=0,c,h,d;if(a&&t._repeat&&(l=ia(0,t._tDur,e),h=Vs(l,a),t._yoyo&&h&1&&(o=1-o),h!==Vs(t._tTime,a)&&(s=1-o,t.vars.repeatRefresh&&t._initted&&t.invalidate())),o!==s||an||i||t._zTime===we||!e&&t._zTime){if(!t._initted&&Zd(t,e,i,n,l))return;for(d=t._zTime,t._zTime=e||(n?we:0),n||(n=e&&!d),t.ratio=o,t._from&&(o=1-o),t._time=0,t._tTime=l,c=t._pt;c;)c.r(o,c.d),c=c._next;e<0&&vu(t,e,n,!0),t._onUpdate&&!n&&On(t,"onUpdate"),l&&t._repeat&&!n&&t.parent&&On(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===o&&(o&&pr(t,1),!n&&!an&&(On(t,o?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)},rx=function(t,e,n){var i;if(n>e)for(i=t._first;i&&i._start<=n;){if(i.data==="isPause"&&i._start>e)return i;i=i._next}else for(i=t._last;i&&i._start>=n;){if(i.data==="isPause"&&i._start<e)return i;i=i._prev}},Hs=function(t,e,n,i){var s=t._repeat,o=Je(e)||0,a=t._tTime/t._tDur;return a&&!i&&(t._time*=o/t._dur),t._dur=o,t._tDur=s?s<0?1e10:Je(o*(s+1)+t._rDelay*s):o,a>0&&!i&&pl(t,t._tTime=t._tDur*a),t.parent&&dl(t),n||Zr(t.parent,t),t},Rd=function(t){return t instanceof tn?Zr(t):Hs(t,t._dur)},sx={_start:0,endTime:ta,totalDuration:ta},Yn=function r(t,e,n){var i=t.labels,s=t._recent||sx,o=t.duration()>=qn?s.endTime(!1):t._dur,a,l,c;return Ge(e)&&(isNaN(e)||e in i)?(l=e.charAt(0),c=e.substr(-1)==="%",a=e.indexOf("="),l==="<"||l===">"?(a>=0&&(e=e.replace(/=/,"")),(l==="<"?s._start:s.endTime(s._repeat>=0))+(parseFloat(e.substr(1))||0)*(c?(a<0?s:n).totalDuration()/100:1)):a<0?(e in i||(i[e]=o),i[e]):(l=parseFloat(e.charAt(a-1)+e.substr(a+1)),c&&n&&(l=l/100*(ln(n)?n[0]:n).totalDuration()),a>1?r(t,e.substr(0,a-1),n)+l:o+l)):e==null?o:+e},Ko=function(t,e,n){var i=zi(e[1]),s=(i?2:1)+(t<2?0:1),o=e[s],a,l;if(i&&(o.duration=e[1]),o.parent=n,t){for(a=o,l=n;l&&!("immediateRender"in a);)a=l.vars.defaults||{},l=Pn(l.vars.inherit)&&l.parent;o.immediateRender=Pn(a.immediateRender),t<2?o.runBackwards=1:o.startAt=e[s-1]}return new Ne(e[0],o,e[s+1])},mr=function(t,e){return t||t===0?e(t):e},ia=function(t,e,n){return n<t?t:n>e?e:n},en=function(t,e){return!Ge(t)||!(e=Z0.exec(t))?"":e[1]},ox=function(t,e,n){return mr(n,function(i){return ia(t,e,i)})},Mu=[].slice,Jd=function(t,e){return t&&Ti(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&Ti(t[0]))&&!t.nodeType&&t!==wi},ax=function(t,e,n){return n===void 0&&(n=[]),t.forEach(function(i){var s;return Ge(i)&&!e||Jd(i,1)?(s=n).push.apply(s,Zn(i)):n.push(i)})||n},Zn=function(t,e,n){return Ae&&!e&&Ae.selector?Ae.selector(t):Ge(t)&&!n&&(xu||!Gs())?Mu.call((e||Pu).querySelectorAll(t),0):ln(t)?ax(t,n):Jd(t)?Mu.call(t,0):t?[t]:[]},bu=function(t){return t=Zn(t)[0]||Qo("Invalid scope")||{},function(e){var n=t.current||t.nativeElement||t;return Zn(e,n.querySelectorAll?n:n===t?Qo("Invalid scope")||Pu.createElement("div"):t)}},$d=function(t){return t.sort(function(){return .5-Math.random()})},Kd=function(t){if(Ie(t))return t;var e=Ti(t)?t:{each:t},n=Jr(e.ease),i=e.from||0,s=parseFloat(e.base)||0,o={},a=i>0&&i<1,l=isNaN(i)||a,c=e.axis,h=i,d=i;return Ge(i)?h=d={center:.5,edges:.5,end:1}[i]||0:!a&&l&&(h=i[0],d=i[1]),function(f,u,_){var p=(_||e).length,m=o[p],g,b,v,S,D,T,w,P,M;if(!m){if(M=e.grid==="auto"?0:(e.grid||[1,qn])[1],!M){for(w=-qn;w<(w=_[M++].getBoundingClientRect().left)&&M<p;);M<p&&M--}for(m=o[p]=[],g=l?Math.min(M,p)*h-.5:i%M,b=M===qn?0:l?p*d/M-.5:i/M|0,w=0,P=qn,T=0;T<p;T++)v=T%M-g,S=b-(T/M|0),m[T]=D=c?Math.abs(c==="y"?S:v):Nd(v*v+S*S),D>w&&(w=D),D<P&&(P=D);i==="random"&&$d(m),m.max=w-P,m.min=P,m.v=p=(parseFloat(e.amount)||parseFloat(e.each)*(M>p?p-1:c?c==="y"?p/M:M:Math.max(M,p/M))||0)*(i==="edges"?-1:1),m.b=p<0?s-p:s,m.u=en(e.amount||e.each)||0,n=n&&p<0?op(n):n}return p=(m[f]-m.min)/m.max||0,Je(m.b+(n?n(p):p)*m.v)+m.u}},wu=function(t){var e=Math.pow(10,((t+"").split(".")[1]||"").length);return function(n){var i=Je(Math.round(parseFloat(n)/t)*t*e);return(i-i%1)/e+(zi(n)?0:en(n))}},jd=function(t,e){var n=ln(t),i,s;return!n&&Ti(t)&&(i=n=t.radius||qn,t.values?(t=Zn(t.values),(s=!zi(t[0]))&&(i*=i)):t=wu(t.increment)),mr(e,n?Ie(t)?function(o){return s=t(o),Math.abs(s-o)<=i?s:o}:function(o){for(var a=parseFloat(s?o.x:o),l=parseFloat(s?o.y:0),c=qn,h=0,d=t.length,f,u;d--;)s?(f=t[d].x-a,u=t[d].y-l,f=f*f+u*u):f=Math.abs(t[d]-a),f<c&&(c=f,h=d);return h=!i||c<=i?t[h]:o,s||h===o||zi(o)?h:h+en(o)}:wu(t))},Qd=function(t,e,n,i){return mr(ln(t)?!e:n===!0?!!(n=0):!i,function(){return ln(t)?t[~~(Math.random()*t.length)]:(n=n||1e-5)&&(i=n<1?Math.pow(10,(n+"").length-2):1)&&Math.floor(Math.round((t-n/2+Math.random()*(e-t+n*.99))/n)*n*i)/i})},lx=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(i){return e.reduce(function(s,o){return o(s)},i)}},cx=function(t,e){return function(n){return t(parseFloat(n))+(e||en(n))}},ux=function(t,e,n){return ep(t,e,0,1,n)},tp=function(t,e,n){return mr(n,function(i){return t[~~e(i)]})},hx=function r(t,e,n){var i=e-t;return ln(t)?tp(t,r(0,t.length),e):mr(n,function(s){return(i+(s-t)%i)%i+t})},fx=function r(t,e,n){var i=e-t,s=i*2;return ln(t)?tp(t,r(0,t.length-1),e):mr(n,function(o){return o=(s+(o-t)%s)%s||0,t+(o>i?s-o:o)})},Ws=function(t){for(var e=0,n="",i,s,o,a;~(i=t.indexOf("random(",e));)o=t.indexOf(")",i),a=t.charAt(i+7)==="[",s=t.substr(i+7,o-i-7).match(a?Od:_u),n+=t.substr(e,i-e)+Qd(a?s:+s[0],a?0:+s[1],+s[2]||1e-5),e=o+1;return n+t.substr(e,t.length-e)},ep=function(t,e,n,i,s){var o=e-t,a=i-n;return mr(s,function(l){return n+((l-t)/o*a||0)})},dx=function r(t,e,n,i){var s=isNaN(t+e)?0:function(u){return(1-u)*t+u*e};if(!s){var o=Ge(t),a={},l,c,h,d,f;if(n===!0&&(i=1)&&(n=null),o)t={p:t},e={p:e};else if(ln(t)&&!ln(e)){for(h=[],d=t.length,f=d-2,c=1;c<d;c++)h.push(r(t[c-1],t[c]));d--,s=function(_){_*=d;var p=Math.min(f,~~_);return h[p](_-p)},n=e}else i||(t=Kr(ln(t)?[]:{},t));if(!h){for(l in e)Bu.call(a,t,l,"get",e[l]);s=function(_){return Gu(_,a)||(o?t.p:t)}}}return mr(n,s)},Pd=function(t,e,n){var i=t.labels,s=qn,o,a,l;for(o in i)a=i[o]-e,a<0==!!n&&a&&s>(a=Math.abs(a))&&(l=o,s=a);return l},On=function(t,e,n){var i=t.vars,s=i[e],o=Ae,a=t._ctx,l,c,h;if(s)return l=i[e+"Params"],c=i.callbackScope||t,n&&fr.length&&ol(),a&&(Ae=a),h=l?s.apply(c,l):s.call(c),Ae=o,h},Zo=function(t){return pr(t),t.scrollTrigger&&t.scrollTrigger.kill(!!an),t.progress()<1&&On(t,"onInterrupt"),t},ks,np=[],ip=function(t){if(t)if(t=!t.name&&t.default||t,Du()||t.headless){var e=t.name,n=Ie(t),i=e&&!n&&t.init?function(){this._props=[]}:t,s={init:ta,render:Gu,add:Bu,kill:Cx,modifier:Dx,rawVars:0},o={targetTest:0,get:0,getSetter:ml,aliases:{},register:0};if(Gs(),t!==i){if(Cn[e])return;Jn(i,Jn(al(t,s),o)),Kr(i.prototype,Kr(s,al(t,o))),Cn[i.prop=e]=i,t.targetTest&&(il.push(i),Iu[e]=1),e=(e==="css"?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}zd(e,i),t.register&&t.register(cn,i,yn)}else np.push(t)},Me=255,Jo={aqua:[0,Me,Me],lime:[0,Me,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Me],navy:[0,0,128],white:[Me,Me,Me],olive:[128,128,0],yellow:[Me,Me,0],orange:[Me,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Me,0,0],pink:[Me,192,203],cyan:[0,Me,Me],transparent:[Me,Me,Me,0]},hu=function(t,e,n){return t+=t<0?1:t>1?-1:0,(t*6<1?e+(n-e)*t*6:t<.5?n:t*3<2?e+(n-e)*(2/3-t)*6:e)*Me+.5|0},rp=function(t,e,n){var i=t?zi(t)?[t>>16,t>>8&Me,t&Me]:0:Jo.black,s,o,a,l,c,h,d,f,u,_;if(!i){if(t.substr(-1)===","&&(t=t.substr(0,t.length-1)),Jo[t])i=Jo[t];else if(t.charAt(0)==="#"){if(t.length<6&&(s=t.charAt(1),o=t.charAt(2),a=t.charAt(3),t="#"+s+s+o+o+a+a+(t.length===5?t.charAt(4)+t.charAt(4):"")),t.length===9)return i=parseInt(t.substr(1,6),16),[i>>16,i>>8&Me,i&Me,parseInt(t.substr(7),16)/255];t=parseInt(t.substr(1),16),i=[t>>16,t>>8&Me,t&Me]}else if(t.substr(0,3)==="hsl"){if(i=_=t.match(_u),!e)l=+i[0]%360/360,c=+i[1]/100,h=+i[2]/100,o=h<=.5?h*(c+1):h+c-h*c,s=h*2-o,i.length>3&&(i[3]*=1),i[0]=hu(l+1/3,s,o),i[1]=hu(l,s,o),i[2]=hu(l-1/3,s,o);else if(~t.indexOf("="))return i=t.match(Cu),n&&i.length<4&&(i[3]=1),i}else i=t.match(_u)||Jo.transparent;i=i.map(Number)}return e&&!_&&(s=i[0]/Me,o=i[1]/Me,a=i[2]/Me,d=Math.max(s,o,a),f=Math.min(s,o,a),h=(d+f)/2,d===f?l=c=0:(u=d-f,c=h>.5?u/(2-d-f):u/(d+f),l=d===s?(o-a)/u+(o<a?6:0):d===o?(a-s)/u+2:(s-o)/u+4,l*=60),i[0]=~~(l+.5),i[1]=~~(c*100+.5),i[2]=~~(h*100+.5)),n&&i.length<4&&(i[3]=1),i},sp=function(t){var e=[],n=[],i=-1;return t.split(ki).forEach(function(s){var o=s.match(jr)||[];e.push.apply(e,o),n.push(i+=o.length+1)}),e.c=n,e},Id=function(t,e,n){var i="",s=(t+i).match(ki),o=e?"hsla(":"rgba(",a=0,l,c,h,d;if(!s)return t;if(s=s.map(function(f){return(f=rp(f,e,1))&&o+(e?f[0]+","+f[1]+"%,"+f[2]+"%,"+f[3]:f.join(","))+")"}),n&&(h=sp(t),l=n.c,l.join(i)!==h.c.join(i)))for(c=t.replace(ki,"1").split(jr),d=c.length-1;a<d;a++)i+=c[a]+(~l.indexOf(a)?s.shift()||o+"0,0,0,0)":(h.length?h:s.length?s:n).shift());if(!c)for(c=t.split(ki),d=c.length-1;a<d;a++)i+=c[a]+s[a];return i+c[d]},ki=function(){var r="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",t;for(t in Jo)r+="|"+t+"\\b";return new RegExp(r+")","gi")}(),px=/hsl[a]?\(/,Uu=function(t){var e=t.join(" "),n;if(ki.lastIndex=0,ki.test(e))return n=px.test(e),t[1]=Id(t[1],n),t[0]=Id(t[0],n,sp(t[1])),!0},ea,Rn=function(){var r=Date.now,t=500,e=33,n=r(),i=n,s=1e3/240,o=s,a=[],l,c,h,d,f,u,_=function p(m){var g=r()-i,b=m===!0,v,S,D,T;if((g>t||g<0)&&(n+=g-e),i+=g,D=i-n,v=D-o,(v>0||b)&&(T=++d.frame,f=D-d.time*1e3,d.time=D=D/1e3,o+=v+(v>=s?4:s-v),S=1),b||(l=c(p)),S)for(u=0;u<a.length;u++)a[u](D,f,T,m)};return d={time:0,frame:0,tick:function(){_(!0)},deltaRatio:function(m){return f/(1e3/(m||60))},wake:function(){Bd&&(!xu&&Du()&&(wi=xu=window,Pu=wi.document||{},Bn.gsap=cn,(wi.gsapVersions||(wi.gsapVersions=[])).push(cn.version),kd(sl||wi.GreenSockGlobals||!wi.gsap&&wi||{}),np.forEach(ip)),h=typeof requestAnimationFrame<"u"&&requestAnimationFrame,l&&d.sleep(),c=h||function(m){return setTimeout(m,o-d.time*1e3+1|0)},ea=1,_(2))},sleep:function(){(h?cancelAnimationFrame:clearTimeout)(l),ea=0,c=ta},lagSmoothing:function(m,g){t=m||1/0,e=Math.min(g||33,t)},fps:function(m){s=1e3/(m||240),o=d.time*1e3+s},add:function(m,g,b){var v=g?function(S,D,T,w){m(S,D,T,w),d.remove(v)}:m;return d.remove(m),a[b?"unshift":"push"](v),Gs(),v},remove:function(m,g){~(g=a.indexOf(m))&&a.splice(g,1)&&u>=g&&u--},_listeners:a},d}(),Gs=function(){return!ea&&Rn.wake()},fe={},mx=/^[\d.\-M][\d.\-,\s]/,gx=/["']/g,_x=function(t){for(var e={},n=t.substr(1,t.length-3).split(":"),i=n[0],s=1,o=n.length,a,l,c;s<o;s++)l=n[s],a=s!==o-1?l.lastIndexOf(","):l.length,c=l.substr(0,a),e[i]=isNaN(c)?c.replace(gx,"").trim():+c,i=l.substr(a+1).trim();return e},xx=function(t){var e=t.indexOf("(")+1,n=t.indexOf(")"),i=t.indexOf("(",e);return t.substring(e,~i&&i<n?t.indexOf(")",n+1):n)},yx=function(t){var e=(t+"").split("("),n=fe[e[0]];return n&&e.length>1&&n.config?n.config.apply(null,~t.indexOf("{")?[_x(e[1])]:xx(t).split(",").map(Gd)):fe._CE&&mx.test(t)?fe._CE("",t):n},op=function(t){return function(e){return 1-t(1-e)}},ap=function r(t,e){for(var n=t._first,i;n;)n instanceof tn?r(n,e):n.vars.yoyoEase&&(!n._yoyo||!n._repeat)&&n._yoyo!==e&&(n.timeline?r(n.timeline,e):(i=n._ease,n._ease=n._yEase,n._yEase=i,n._yoyo=e)),n=n._next},Jr=function(t,e){return t&&(Ie(t)?t:fe[t]||yx(t))||e},ts=function(t,e,n,i){n===void 0&&(n=function(l){return 1-e(1-l)}),i===void 0&&(i=function(l){return l<.5?e(l*2)/2:1-e((1-l)*2)/2});var s={easeIn:e,easeOut:n,easeInOut:i},o;return xn(t,function(a){fe[a]=Bn[a]=s,fe[o=a.toLowerCase()]=n;for(var l in s)fe[o+(l==="easeIn"?".in":l==="easeOut"?".out":".inOut")]=fe[a+"."+l]=s[l]}),s},lp=function(t){return function(e){return e<.5?(1-t(1-e*2))/2:.5+t((e-.5)*2)/2}},fu=function r(t,e,n){var i=e>=1?e:1,s=(n||(t?.3:.45))/(e<1?e:1),o=s/gu*(Math.asin(1/i)||0),a=function(h){return h===1?1:i*Math.pow(2,-10*h)*q0((h-o)*s)+1},l=t==="out"?a:t==="in"?function(c){return 1-a(1-c)}:lp(a);return s=gu/s,l.config=function(c,h){return r(t,c,h)},l},du=function r(t,e){e===void 0&&(e=1.70158);var n=function(o){return o?--o*o*((e+1)*o+e)+1:0},i=t==="out"?n:t==="in"?function(s){return 1-n(1-s)}:lp(n);return i.config=function(s){return r(t,s)},i};xn("Linear,Quad,Cubic,Quart,Quint,Strong",function(r,t){var e=t<5?t+1:t;ts(r+",Power"+(e-1),t?function(n){return Math.pow(n,e)}:function(n){return n},function(n){return 1-Math.pow(1-n,e)},function(n){return n<.5?Math.pow(n*2,e)/2:1-Math.pow((1-n)*2,e)/2})});fe.Linear.easeNone=fe.none=fe.Linear.easeIn;ts("Elastic",fu("in"),fu("out"),fu());(function(r,t){var e=1/t,n=2*e,i=2.5*e,s=function(a){return a<e?r*a*a:a<n?r*Math.pow(a-1.5/t,2)+.75:a<i?r*(a-=2.25/t)*a+.9375:r*Math.pow(a-2.625/t,2)+.984375};ts("Bounce",function(o){return 1-s(1-o)},s)})(7.5625,2.75);ts("Expo",function(r){return r?Math.pow(2,10*(r-1)):0});ts("Circ",function(r){return-(Nd(1-r*r)-1)});ts("Sine",function(r){return r===1?1:-Y0(r*W0)+1});ts("Back",du("in"),du("out"),du());fe.SteppedEase=fe.steps=Bn.SteppedEase={config:function(t,e){t===void 0&&(t=1);var n=1/t,i=t+(e?0:1),s=e?1:0,o=1-we;return function(a){return((i*ia(0,o,a)|0)+s)*n}}};zs.ease=fe["quad.out"];xn("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(r){return Lu+=r+","+r+"Params,"});var Ou=function(t,e){this.id=X0++,t._gsap=this,this.target=t,this.harness=e,this.get=e?e.get:Nu,this.set=e?e.getSetter:ml},na=function(){function r(e){this.vars=e,this._delay=+e.delay||0,(this._repeat=e.repeat===1/0?-2:e.repeat||0)&&(this._rDelay=e.repeatDelay||0,this._yoyo=!!e.yoyo||!!e.yoyoEase),this._ts=1,Hs(this,+e.duration,1,1),this.data=e.data,Ae&&(this._ctx=Ae,Ae.data.push(this)),ea||Rn.wake()}var t=r.prototype;return t.delay=function(n){return n||n===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+n-this._delay),this._delay=n,this):this._delay},t.duration=function(n){return arguments.length?this.totalDuration(this._repeat>0?n+(n+this._rDelay)*this._repeat:n):this.totalDuration()&&this._dur},t.totalDuration=function(n){return arguments.length?(this._dirty=0,Hs(this,this._repeat<0?n:(n-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(n,i){if(Gs(),!arguments.length)return this._tTime;var s=this._dp;if(s&&s.smoothChildTiming&&this._ts){for(pl(this,n),!s._dp||s.parent||Yd(s,this);s&&s.parent;)s.parent._time!==s._start+(s._ts>=0?s._tTime/s._ts:(s.totalDuration()-s._tTime)/-s._ts)&&s.totalTime(s._tTime,!0),s=s.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&n<this._tDur||this._ts<0&&n>0||!this._tDur&&!n)&&Ei(this._dp,this,this._start-this._delay)}return(this._tTime!==n||!this._dur&&!i||this._initted&&Math.abs(this._zTime)===we||!n&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=n),Hd(this,n,i)),this},t.time=function(n,i){return arguments.length?this.totalTime(Math.min(this.totalDuration(),n+Cd(this))%(this._dur+this._rDelay)||(n?this._dur:0),i):this._time},t.totalProgress=function(n,i){return arguments.length?this.totalTime(this.totalDuration()*n,i):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>0?1:0},t.progress=function(n,i){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-n:n)+Cd(this),i):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},t.iteration=function(n,i){var s=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(n-1)*s,i):this._repeat?Vs(this._tTime,s)+1:1},t.timeScale=function(n,i){if(!arguments.length)return this._rts===-we?0:this._rts;if(this._rts===n)return this;var s=this.parent&&this._ts?ll(this.parent._time,this):this._tTime;return this._rts=+n||0,this._ts=this._ps||n===-we?0:this._rts,this.totalTime(ia(-Math.abs(this._delay),this._tDur,s),i!==!1),dl(this),tx(this)},t.paused=function(n){return arguments.length?(this._ps!==n&&(this._ps=n,n?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Gs(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==we&&(this._tTime-=we)))),this):this._ps},t.startTime=function(n){if(arguments.length){this._start=n;var i=this.parent||this._dp;return i&&(i._sort||!this.parent)&&Ei(i,this,n-this._delay),this}return this._start},t.endTime=function(n){return this._start+(Pn(n)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(n){var i=this.parent||this._dp;return i?n&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?ll(i.rawTime(n),this):this._tTime:this._tTime},t.revert=function(n){n===void 0&&(n=$0);var i=an;return an=n,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(n),this.totalTime(-.01,n.suppressEvents)),this.data!=="nested"&&n.kill!==!1&&this.kill(),an=i,this},t.globalTime=function(n){for(var i=this,s=arguments.length?n:i.rawTime();i;)s=i._start+s/(Math.abs(i._ts)||1),i=i._dp;return!this.parent&&this._sat?this._sat.globalTime(n):s},t.repeat=function(n){return arguments.length?(this._repeat=n===1/0?-2:n,Rd(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(n){if(arguments.length){var i=this._time;return this._rDelay=n,Rd(this),i?this.time(i):this}return this._rDelay},t.yoyo=function(n){return arguments.length?(this._yoyo=n,this):this._yoyo},t.seek=function(n,i){return this.totalTime(Yn(this,n),Pn(i))},t.restart=function(n,i){return this.play().totalTime(n?-this._delay:0,Pn(i))},t.play=function(n,i){return n!=null&&this.seek(n,i),this.reversed(!1).paused(!1)},t.reverse=function(n,i){return n!=null&&this.seek(n||this.totalDuration(),i),this.reversed(!0).paused(!1)},t.pause=function(n,i){return n!=null&&this.seek(n,i),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(n){return arguments.length?(!!n!==this.reversed()&&this.timeScale(-this._rts||(n?-we:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-we,this},t.isActive=function(){var n=this.parent||this._dp,i=this._start,s;return!!(!n||this._ts&&this._initted&&n.isActive()&&(s=n.rawTime(!0))>=i&&s<this.endTime(!0)-we)},t.eventCallback=function(n,i,s){var o=this.vars;return arguments.length>1?(i?(o[n]=i,s&&(o[n+"Params"]=s),n==="onUpdate"&&(this._onUpdate=i)):delete o[n],this):o[n]},t.then=function(n){var i=this;return new Promise(function(s){var o=Ie(n)?n:Wd,a=function(){var c=i.then;i.then=null,Ie(o)&&(o=o(i))&&(o.then||o===i)&&(i.then=c),s(o),i.then=c};i._initted&&i.totalProgress()===1&&i._ts>=0||!i._tTime&&i._ts<0?a():i._prom=a})},t.kill=function(){Zo(this)},r}();Jn(na.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:-we,_prom:0,_ps:!1,_rts:1});var tn=function(r){Fd(t,r);function t(n,i){var s;return n===void 0&&(n={}),s=r.call(this,n)||this,s.labels={},s.smoothChildTiming=!!n.smoothChildTiming,s.autoRemoveChildren=!!n.autoRemoveChildren,s._sort=Pn(n.sortChildren),Ce&&Ei(n.parent||Ce,Bi(s),i),n.reversed&&s.reverse(),n.paused&&s.paused(!0),n.scrollTrigger&&qd(Bi(s),n.scrollTrigger),s}var e=t.prototype;return e.to=function(i,s,o){return Ko(0,arguments,this),this},e.from=function(i,s,o){return Ko(1,arguments,this),this},e.fromTo=function(i,s,o,a){return Ko(2,arguments,this),this},e.set=function(i,s,o){return s.duration=0,s.parent=this,$o(s).repeatDelay||(s.repeat=0),s.immediateRender=!!s.immediateRender,new Ne(i,s,Yn(this,o),1),this},e.call=function(i,s,o){return Ei(this,Ne.delayedCall(0,i,s),o)},e.staggerTo=function(i,s,o,a,l,c,h){return o.duration=s,o.stagger=o.stagger||a,o.onComplete=c,o.onCompleteParams=h,o.parent=this,new Ne(i,o,Yn(this,l)),this},e.staggerFrom=function(i,s,o,a,l,c,h){return o.runBackwards=1,$o(o).immediateRender=Pn(o.immediateRender),this.staggerTo(i,s,o,a,l,c,h)},e.staggerFromTo=function(i,s,o,a,l,c,h,d){return a.startAt=o,$o(a).immediateRender=Pn(a.immediateRender),this.staggerTo(i,s,a,l,c,h,d)},e.render=function(i,s,o){var a=this._time,l=this._dirty?this.totalDuration():this._tDur,c=this._dur,h=i<=0?0:Je(i),d=this._zTime<0!=i<0&&(this._initted||!c),f,u,_,p,m,g,b,v,S,D,T,w;if(this!==Ce&&h>l&&i>=0&&(h=l),h!==this._tTime||o||d){if(a!==this._time&&c&&(h+=this._time-a,i+=this._time-a),f=h,S=this._start,v=this._ts,g=!v,d&&(c||(a=this._zTime),(i||!s)&&(this._zTime=i)),this._repeat){if(T=this._yoyo,m=c+this._rDelay,this._repeat<-1&&i<0)return this.totalTime(m*100+i,s,o);if(f=Je(h%m),h===l?(p=this._repeat,f=c):(p=~~(h/m),p&&p===h/m&&(f=c,p--),f>c&&(f=c)),D=Vs(this._tTime,m),!a&&this._tTime&&D!==p&&this._tTime-D*m-this._dur<=0&&(D=p),T&&p&1&&(f=c-f,w=1),p!==D&&!this._lock){var P=T&&D&1,M=P===(T&&p&1);if(p<D&&(P=!P),a=P?0:h%c?c:h,this._lock=1,this.render(a||(w?0:Je(p*m)),s,!c)._lock=0,this._tTime=h,!s&&this.parent&&On(this,"onRepeat"),this.vars.repeatRefresh&&!w&&(this.invalidate()._lock=1),a&&a!==this._time||g!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(c=this._dur,l=this._tDur,M&&(this._lock=2,a=P?c:-1e-4,this.render(a,!0),this.vars.repeatRefresh&&!w&&this.invalidate()),this._lock=0,!this._ts&&!g)return this;ap(this,w)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(b=rx(this,Je(a),Je(f)),b&&(h-=f-(f=b._start))),this._tTime=h,this._time=f,this._act=!v,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=i,a=0),!a&&f&&!s&&!p&&(On(this,"onStart"),this._tTime!==h))return this;if(f>=a&&i>=0)for(u=this._first;u;){if(_=u._next,(u._act||f>=u._start)&&u._ts&&b!==u){if(u.parent!==this)return this.render(i,s,o);if(u.render(u._ts>0?(f-u._start)*u._ts:(u._dirty?u.totalDuration():u._tDur)+(f-u._start)*u._ts,s,o),f!==this._time||!this._ts&&!g){b=0,_&&(h+=this._zTime=-we);break}}u=_}else{u=this._last;for(var y=i<0?i:f;u;){if(_=u._prev,(u._act||y<=u._end)&&u._ts&&b!==u){if(u.parent!==this)return this.render(i,s,o);if(u.render(u._ts>0?(y-u._start)*u._ts:(u._dirty?u.totalDuration():u._tDur)+(y-u._start)*u._ts,s,o||an&&(u._initted||u._startAt)),f!==this._time||!this._ts&&!g){b=0,_&&(h+=this._zTime=y?-we:we);break}}u=_}}if(b&&!s&&(this.pause(),b.render(f>=a?0:-we)._zTime=f>=a?1:-1,this._ts))return this._start=S,dl(this),this.render(i,s,o);this._onUpdate&&!s&&On(this,"onUpdate",!0),(h===l&&this._tTime>=this.totalDuration()||!h&&a)&&(S===this._start||Math.abs(v)!==Math.abs(this._ts))&&(this._lock||((i||!c)&&(h===l&&this._ts>0||!h&&this._ts<0)&&pr(this,1),!s&&!(i<0&&!a)&&(h||a||!l)&&(On(this,h===l&&i>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(h<l&&this.timeScale()>0)&&this._prom())))}return this},e.add=function(i,s){var o=this;if(zi(s)||(s=Yn(this,s,i)),!(i instanceof na)){if(ln(i))return i.forEach(function(a){return o.add(a,s)}),this;if(Ge(i))return this.addLabel(i,s);if(Ie(i))i=Ne.delayedCall(0,i);else return this}return this!==i?Ei(this,i,s):this},e.getChildren=function(i,s,o,a){i===void 0&&(i=!0),s===void 0&&(s=!0),o===void 0&&(o=!0),a===void 0&&(a=-qn);for(var l=[],c=this._first;c;)c._start>=a&&(c instanceof Ne?s&&l.push(c):(o&&l.push(c),i&&l.push.apply(l,c.getChildren(!0,s,o)))),c=c._next;return l},e.getById=function(i){for(var s=this.getChildren(1,1,1),o=s.length;o--;)if(s[o].vars.id===i)return s[o]},e.remove=function(i){return Ge(i)?this.removeLabel(i):Ie(i)?this.killTweensOf(i):(fl(this,i),i===this._recent&&(this._recent=this._last),Zr(this))},e.totalTime=function(i,s){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Je(Rn.time-(this._ts>0?i/this._ts:(this.totalDuration()-i)/-this._ts))),r.prototype.totalTime.call(this,i,s),this._forcing=0,this):this._tTime},e.addLabel=function(i,s){return this.labels[i]=Yn(this,s),this},e.removeLabel=function(i){return delete this.labels[i],this},e.addPause=function(i,s,o){var a=Ne.delayedCall(0,s||ta,o);return a.data="isPause",this._hasPause=1,Ei(this,a,Yn(this,i))},e.removePause=function(i){var s=this._first;for(i=Yn(this,i);s;)s._start===i&&s.data==="isPause"&&pr(s),s=s._next},e.killTweensOf=function(i,s,o){for(var a=this.getTweensOf(i,o),l=a.length;l--;)hr!==a[l]&&a[l].kill(i,s);return this},e.getTweensOf=function(i,s){for(var o=[],a=Zn(i),l=this._first,c=zi(s),h;l;)l instanceof Ne?K0(l._targets,a)&&(c?(!hr||l._initted&&l._ts)&&l.globalTime(0)<=s&&l.globalTime(l.totalDuration())>s:!s||l.isActive())&&o.push(l):(h=l.getTweensOf(a,s)).length&&o.push.apply(o,h),l=l._next;return o},e.tweenTo=function(i,s){s=s||{};var o=this,a=Yn(o,i),l=s,c=l.startAt,h=l.onStart,d=l.onStartParams,f=l.immediateRender,u,_=Ne.to(o,Jn({ease:s.ease||"none",lazy:!1,immediateRender:!1,time:a,overwrite:"auto",duration:s.duration||Math.abs((a-(c&&"time"in c?c.time:o._time))/o.timeScale())||we,onStart:function(){if(o.pause(),!u){var m=s.duration||Math.abs((a-(c&&"time"in c?c.time:o._time))/o.timeScale());_._dur!==m&&Hs(_,m,0,1).render(_._time,!0,!0),u=1}h&&h.apply(_,d||[])}},s));return f?_.render(0):_},e.tweenFromTo=function(i,s,o){return this.tweenTo(s,Jn({startAt:{time:Yn(this,i)}},o))},e.recent=function(){return this._recent},e.nextLabel=function(i){return i===void 0&&(i=this._time),Pd(this,Yn(this,i))},e.previousLabel=function(i){return i===void 0&&(i=this._time),Pd(this,Yn(this,i),1)},e.currentLabel=function(i){return arguments.length?this.seek(i,!0):this.previousLabel(this._time+we)},e.shiftChildren=function(i,s,o){o===void 0&&(o=0);for(var a=this._first,l=this.labels,c;a;)a._start>=o&&(a._start+=i,a._end+=i),a=a._next;if(s)for(c in l)l[c]>=o&&(l[c]+=i);return Zr(this)},e.invalidate=function(i){var s=this._first;for(this._lock=0;s;)s.invalidate(i),s=s._next;return r.prototype.invalidate.call(this,i)},e.clear=function(i){i===void 0&&(i=!0);for(var s=this._first,o;s;)o=s._next,this.remove(s),s=o;return this._dp&&(this._time=this._tTime=this._pTime=0),i&&(this.labels={}),Zr(this)},e.totalDuration=function(i){var s=0,o=this,a=o._last,l=qn,c,h,d;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-i:i));if(o._dirty){for(d=o.parent;a;)c=a._prev,a._dirty&&a.totalDuration(),h=a._start,h>l&&o._sort&&a._ts&&!o._lock?(o._lock=1,Ei(o,a,h-a._delay,1)._lock=0):l=h,h<0&&a._ts&&(s-=h,(!d&&!o._dp||d&&d.smoothChildTiming)&&(o._start+=h/o._ts,o._time-=h,o._tTime-=h),o.shiftChildren(-h,!1,-1/0),l=0),a._end>s&&a._ts&&(s=a._end),a=c;Hs(o,o===Ce&&o._time>s?o._time:s,1,1),o._dirty=0}return o._tDur},t.updateRoot=function(i){if(Ce._ts&&(Hd(Ce,ll(i,Ce)),Vd=Rn.frame),Rn.frame>=Ad){Ad+=In.autoSleep||120;var s=Ce._first;if((!s||!s._ts)&&In.autoSleep&&Rn._listeners.length<2){for(;s&&!s._ts;)s=s._next;s||Rn.sleep()}}},t}(na);Jn(tn.prototype,{_lock:0,_hasPause:0,_forcing:0});var vx=function(t,e,n,i,s,o,a){var l=new yn(this._pt,t,e,0,1,Hu,null,s),c=0,h=0,d,f,u,_,p,m,g,b;for(l.b=n,l.e=i,n+="",i+="",(g=~i.indexOf("random("))&&(i=Ws(i)),o&&(b=[n,i],o(b,t,e),n=b[0],i=b[1]),f=n.match(cu)||[];d=cu.exec(i);)_=d[0],p=i.substring(c,d.index),u?u=(u+1)%5:p.substr(-5)==="rgba("&&(u=1),_!==f[h++]&&(m=parseFloat(f[h-1])||0,l._pt={_next:l._pt,p:p||h===1?p:",",s:m,c:_.charAt(1)==="="?Qr(m,_)-m:parseFloat(_)-m,m:u&&u<4?Math.round:0},c=cu.lastIndex);return l.c=c<i.length?i.substring(c,i.length):"",l.fp=a,(Ru.test(i)||g)&&(l.e=0),this._pt=l,l},Bu=function(t,e,n,i,s,o,a,l,c,h){Ie(i)&&(i=i(s||0,t,o));var d=t[e],f=n!=="get"?n:Ie(d)?c?t[e.indexOf("set")||!Ie(t["get"+e.substr(3)])?e:"get"+e.substr(3)](c):t[e]():d,u=Ie(d)?c?Ex:hp:Vu,_;if(Ge(i)&&(~i.indexOf("random(")&&(i=Ws(i)),i.charAt(1)==="="&&(_=Qr(f,i)+(en(f)||0),(_||_===0)&&(i=_))),!h||f!==i||Eu)return!isNaN(f*i)&&i!==""?(_=new yn(this._pt,t,e,+f||0,i-(f||0),typeof d=="boolean"?Ax:fp,0,u),c&&(_.fp=c),a&&_.modifier(a,this,t),this._pt=_):(!d&&!(e in t)&&hl(e,i),vx.call(this,t,e,f,i,u,l||In.stringFilter,c))},Sx=function(t,e,n,i,s){if(Ie(t)&&(t=jo(t,s,e,n,i)),!Ti(t)||t.style&&t.nodeType||ln(t)||Ud(t))return Ge(t)?jo(t,s,e,n,i):t;var o={},a;for(a in t)o[a]=jo(t[a],s,e,n,i);return o},ku=function(t,e,n,i,s,o){var a,l,c,h;if(Cn[t]&&(a=new Cn[t]).init(s,a.rawVars?e[t]:Sx(e[t],i,s,o,n),n,i,o)!==!1&&(n._pt=l=new yn(n._pt,s,t,0,1,a.render,a,0,a.priority),n!==ks))for(c=n._ptLookup[n._targets.indexOf(s)],h=a._props.length;h--;)c[a._props[h]]=l;return a},hr,Eu,zu=function r(t,e,n){var i=t.vars,s=i.ease,o=i.startAt,a=i.immediateRender,l=i.lazy,c=i.onUpdate,h=i.runBackwards,d=i.yoyoEase,f=i.keyframes,u=i.autoRevert,_=t._dur,p=t._startAt,m=t._targets,g=t.parent,b=g&&g.data==="nested"?g.vars.targets:m,v=t._overwrite==="auto"&&!Au,S=t.timeline,D,T,w,P,M,y,I,N,C,V,$,W,Z;if(S&&(!f||!s)&&(s="none"),t._ease=Jr(s,zs.ease),t._yEase=d?op(Jr(d===!0?s:d,zs.ease)):0,d&&t._yoyo&&!t._repeat&&(d=t._yEase,t._yEase=t._ease,t._ease=d),t._from=!S&&!!i.runBackwards,!S||f&&!i.stagger){if(N=m[0]?dr(m[0]).harness:0,W=N&&i[N.prop],D=al(i,Iu),p&&(p._zTime<0&&p.progress(1),e<0&&h&&a&&!u?p.render(-1,!0):p.revert(h&&_?nl:J0),p._lazy=0),o){if(pr(t._startAt=Ne.set(m,Jn({data:"isStart",overwrite:!1,parent:g,immediateRender:!0,lazy:!p&&Pn(l),startAt:null,delay:0,onUpdate:c&&function(){return On(t,"onUpdate")},stagger:0},o))),t._startAt._dp=0,t._startAt._sat=t,e<0&&(an||!a&&!u)&&t._startAt.revert(nl),a&&_&&e<=0&&n<=0){e&&(t._zTime=e);return}}else if(h&&_&&!p){if(e&&(a=!1),w=Jn({overwrite:!1,data:"isFromStart",lazy:a&&!p&&Pn(l),immediateRender:a,stagger:0,parent:g},D),W&&(w[N.prop]=W),pr(t._startAt=Ne.set(m,w)),t._startAt._dp=0,t._startAt._sat=t,e<0&&(an?t._startAt.revert(nl):t._startAt.render(-1,!0)),t._zTime=e,!a)r(t._startAt,we,we);else if(!e)return}for(t._pt=t._ptCache=0,l=_&&Pn(l)||l&&!_,T=0;T<m.length;T++){if(M=m[T],I=M._gsap||Fu(m)[T]._gsap,t._ptLookup[T]=V={},yu[I.id]&&fr.length&&ol(),$=b===m?T:b.indexOf(M),N&&(C=new N).init(M,W||D,t,$,b)!==!1&&(t._pt=P=new yn(t._pt,M,C.name,0,1,C.render,C,0,C.priority),C._props.forEach(function(z){V[z]=P}),C.priority&&(y=1)),!N||W)for(w in D)Cn[w]&&(C=ku(w,D,t,$,M,b))?C.priority&&(y=1):V[w]=P=Bu.call(t,M,w,"get",D[w],$,b,0,i.stringFilter);t._op&&t._op[T]&&t.kill(M,t._op[T]),v&&t._pt&&(hr=t,Ce.killTweensOf(M,V,t.globalTime(e)),Z=!t.parent,hr=0),t._pt&&l&&(yu[I.id]=1)}y&&Wu(t),t._onInit&&t._onInit(t)}t._onUpdate=c,t._initted=(!t._op||t._pt)&&!Z,f&&e<=0&&S.render(qn,!0,!0)},Mx=function(t,e,n,i,s,o,a,l){var c=(t._pt&&t._ptCache||(t._ptCache={}))[e],h,d,f,u;if(!c)for(c=t._ptCache[e]=[],f=t._ptLookup,u=t._targets.length;u--;){if(h=f[u][e],h&&h.d&&h.d._pt)for(h=h.d._pt;h&&h.p!==e&&h.fp!==e;)h=h._next;if(!h)return Eu=1,t.vars[e]="+=0",zu(t,a),Eu=0,l?Qo(e+" not eligible for reset"):1;c.push(h)}for(u=c.length;u--;)d=c[u],h=d._pt||d,h.s=(i||i===0)&&!s?i:h.s+(i||0)+o*h.c,h.c=n-h.s,d.e&&(d.e=Le(n)+en(d.e)),d.b&&(d.b=h.s+en(d.b))},bx=function(t,e){var n=t[0]?dr(t[0]).harness:0,i=n&&n.aliases,s,o,a,l;if(!i)return e;s=Kr({},e);for(o in i)if(o in s)for(l=i[o].split(","),a=l.length;a--;)s[l[a]]=s[o];return s},wx=function(t,e,n,i){var s=e.ease||i||"power1.inOut",o,a;if(ln(e))a=n[t]||(n[t]=[]),e.forEach(function(l,c){return a.push({t:c/(e.length-1)*100,v:l,e:s})});else for(o in e)a=n[o]||(n[o]=[]),o==="ease"||a.push({t:parseFloat(t),v:e[o],e:s})},jo=function(t,e,n,i,s){return Ie(t)?t.call(e,n,i,s):Ge(t)&&~t.indexOf("random(")?Ws(t):t},cp=Lu+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",up={};xn(cp+",id,stagger,delay,duration,paused,scrollTrigger",function(r){return up[r]=1});var Ne=function(r){Fd(t,r);function t(n,i,s,o){var a;typeof i=="number"&&(s.duration=i,i=s,s=null),a=r.call(this,o?i:$o(i))||this;var l=a.vars,c=l.duration,h=l.delay,d=l.immediateRender,f=l.stagger,u=l.overwrite,_=l.keyframes,p=l.defaults,m=l.scrollTrigger,g=l.yoyoEase,b=i.parent||Ce,v=(ln(n)||Ud(n)?zi(n[0]):"length"in i)?[n]:Zn(n),S,D,T,w,P,M,y,I;if(a._targets=v.length?Fu(v):Qo("GSAP target "+n+" not found. https://gsap.com",!In.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=u,_||f||el(c)||el(h)){if(i=a.vars,S=a.timeline=new tn({data:"nested",defaults:p||{},targets:b&&b.data==="nested"?b.vars.targets:v}),S.kill(),S.parent=S._dp=Bi(a),S._start=0,f||el(c)||el(h)){if(w=v.length,y=f&&Kd(f),Ti(f))for(P in f)~cp.indexOf(P)&&(I||(I={}),I[P]=f[P]);for(D=0;D<w;D++)T=al(i,up),T.stagger=0,g&&(T.yoyoEase=g),I&&Kr(T,I),M=v[D],T.duration=+jo(c,Bi(a),D,M,v),T.delay=(+jo(h,Bi(a),D,M,v)||0)-a._delay,!f&&w===1&&T.delay&&(a._delay=h=T.delay,a._start+=h,T.delay=0),S.to(M,T,y?y(D,M,v):0),S._ease=fe.none;S.duration()?c=h=0:a.timeline=0}else if(_){$o(Jn(S.vars.defaults,{ease:"none"})),S._ease=Jr(_.ease||i.ease||"none");var N=0,C,V,$;if(ln(_))_.forEach(function(W){return S.to(v,W,">")}),S.duration();else{T={};for(P in _)P==="ease"||P==="easeEach"||wx(P,_[P],T,_.easeEach);for(P in T)for(C=T[P].sort(function(W,Z){return W.t-Z.t}),N=0,D=0;D<C.length;D++)V=C[D],$={ease:V.e,duration:(V.t-(D?C[D-1].t:0))/100*c},$[P]=V.v,S.to(v,$,N),N+=$.duration;S.duration()<c&&S.to({},{duration:c-S.duration()})}}c||a.duration(c=S.duration())}else a.timeline=0;return u===!0&&!Au&&(hr=Bi(a),Ce.killTweensOf(v),hr=0),Ei(b,Bi(a),s),i.reversed&&a.reverse(),i.paused&&a.paused(!0),(d||!c&&!_&&a._start===Je(b._time)&&Pn(d)&&ex(Bi(a))&&b.data!=="nested")&&(a._tTime=-we,a.render(Math.max(0,-h)||0)),m&&qd(Bi(a),m),a}var e=t.prototype;return e.render=function(i,s,o){var a=this._time,l=this._tDur,c=this._dur,h=i<0,d=i>l-we&&!h?l:i<we?0:i,f,u,_,p,m,g,b,v,S;if(!c)ix(this,i,s,o);else if(d!==this._tTime||!i||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==h){if(f=d,v=this.timeline,this._repeat){if(p=c+this._rDelay,this._repeat<-1&&h)return this.totalTime(p*100+i,s,o);if(f=Je(d%p),d===l?(_=this._repeat,f=c):(_=~~(d/p),_&&_===Je(d/p)&&(f=c,_--),f>c&&(f=c)),g=this._yoyo&&_&1,g&&(S=this._yEase,f=c-f),m=Vs(this._tTime,p),f===a&&!o&&this._initted&&_===m)return this._tTime=d,this;_!==m&&(v&&this._yEase&&ap(v,g),this.vars.repeatRefresh&&!g&&!this._lock&&this._time!==p&&this._initted&&(this._lock=o=1,this.render(Je(p*_),!0).invalidate()._lock=0))}if(!this._initted){if(Zd(this,h?i:f,o,s,d))return this._tTime=0,this;if(a!==this._time&&!(o&&this.vars.repeatRefresh&&_!==m))return this;if(c!==this._dur)return this.render(i,s,o)}if(this._tTime=d,this._time=f,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=b=(S||this._ease)(f/c),this._from&&(this.ratio=b=1-b),f&&!a&&!s&&!_&&(On(this,"onStart"),this._tTime!==d))return this;for(u=this._pt;u;)u.r(b,u.d),u=u._next;v&&v.render(i<0?i:v._dur*v._ease(f/this._dur),s,o)||this._startAt&&(this._zTime=i),this._onUpdate&&!s&&(h&&vu(this,i,s,o),On(this,"onUpdate")),this._repeat&&_!==m&&this.vars.onRepeat&&!s&&this.parent&&On(this,"onRepeat"),(d===this._tDur||!d)&&this._tTime===d&&(h&&!this._onUpdate&&vu(this,i,!0,!0),(i||!c)&&(d===this._tDur&&this._ts>0||!d&&this._ts<0)&&pr(this,1),!s&&!(h&&!a)&&(d||a||g)&&(On(this,d===l?"onComplete":"onReverseComplete",!0),this._prom&&!(d<l&&this.timeScale()>0)&&this._prom()))}return this},e.targets=function(){return this._targets},e.invalidate=function(i){return(!i||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(i),r.prototype.invalidate.call(this,i)},e.resetTo=function(i,s,o,a,l){ea||Rn.wake(),this._ts||this.play();var c=Math.min(this._dur,(this._dp._time-this._start)*this._ts),h;return this._initted||zu(this,c),h=this._ease(c/this._dur),Mx(this,i,s,o,a,h,c,l)?this.resetTo(i,s,o,a,1):(pl(this,0),this.parent||Xd(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},e.kill=function(i,s){if(s===void 0&&(s="all"),!i&&(!s||s==="all"))return this._lazy=this._pt=0,this.parent?Zo(this):this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(i,s,hr&&hr.vars.overwrite!==!0)._first||Zo(this),this.parent&&o!==this.timeline.totalDuration()&&Hs(this,this._dur*this.timeline._tDur/o,0,1),this}var a=this._targets,l=i?Zn(i):a,c=this._ptLookup,h=this._pt,d,f,u,_,p,m,g;if((!s||s==="all")&&Q0(a,l))return s==="all"&&(this._pt=0),Zo(this);for(d=this._op=this._op||[],s!=="all"&&(Ge(s)&&(p={},xn(s,function(b){return p[b]=1}),s=p),s=bx(a,s)),g=a.length;g--;)if(~l.indexOf(a[g])){f=c[g],s==="all"?(d[g]=s,_=f,u={}):(u=d[g]=d[g]||{},_=s);for(p in _)m=f&&f[p],m&&((!("kill"in m.d)||m.d.kill(p)===!0)&&fl(this,m,"_pt"),delete f[p]),u!=="all"&&(u[p]=1)}return this._initted&&!this._pt&&h&&Zo(this),this},t.to=function(i,s){return new t(i,s,arguments[2])},t.from=function(i,s){return Ko(1,arguments)},t.delayedCall=function(i,s,o,a){return new t(s,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:i,onComplete:s,onReverseComplete:s,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:a})},t.fromTo=function(i,s,o){return Ko(2,arguments)},t.set=function(i,s){return s.duration=0,s.repeatDelay||(s.repeat=0),new t(i,s)},t.killTweensOf=function(i,s,o){return Ce.killTweensOf(i,s,o)},t}(na);Jn(Ne.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});xn("staggerTo,staggerFrom,staggerFromTo",function(r){Ne[r]=function(){var t=new tn,e=Mu.call(arguments,0);return e.splice(r==="staggerFromTo"?5:4,0,0),t[r].apply(t,e)}});var Vu=function(t,e,n){return t[e]=n},hp=function(t,e,n){return t[e](n)},Ex=function(t,e,n,i){return t[e](i.fp,n)},Tx=function(t,e,n){return t.setAttribute(e,n)},ml=function(t,e){return Ie(t[e])?hp:ul(t[e])&&t.setAttribute?Tx:Vu},fp=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e6)/1e6,e)},Ax=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},Hu=function(t,e){var n=e._pt,i="";if(!t&&e.b)i=e.b;else if(t===1&&e.e)i=e.e;else{for(;n;)i=n.p+(n.m?n.m(n.s+n.c*t):Math.round((n.s+n.c*t)*1e4)/1e4)+i,n=n._next;i+=e.c}e.set(e.t,e.p,i,e)},Gu=function(t,e){for(var n=e._pt;n;)n.r(t,n.d),n=n._next},Dx=function(t,e,n,i){for(var s=this._pt,o;s;)o=s._next,s.p===i&&s.modifier(t,e,n),s=o},Cx=function(t){for(var e=this._pt,n,i;e;)i=e._next,e.p===t&&!e.op||e.op===t?fl(this,e,"_pt"):e.dep||(n=1),e=i;return!n},Rx=function(t,e,n,i){i.mSet(t,e,i.m.call(i.tween,n,i.mt),i)},Wu=function(t){for(var e=t._pt,n,i,s,o;e;){for(n=e._next,i=s;i&&i.pr>e.pr;)i=i._next;(e._prev=i?i._prev:o)?e._prev._next=e:s=e,(e._next=i)?i._prev=e:o=e,e=n}t._pt=s},yn=function(){function r(e,n,i,s,o,a,l,c,h){this.t=n,this.s=s,this.c=o,this.p=i,this.r=a||fp,this.d=l||this,this.set=c||Vu,this.pr=h||0,this._next=e,e&&(e._prev=this)}var t=r.prototype;return t.modifier=function(n,i,s){this.mSet=this.mSet||this.set,this.set=Rx,this.m=n,this.mt=s,this.tween=i},r}();xn(Lu+"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(r){return Iu[r]=1});Bn.TweenMax=Bn.TweenLite=Ne;Bn.TimelineLite=Bn.TimelineMax=tn;Ce=new tn({sortChildren:!1,defaults:zs,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});In.stringFilter=Uu;var $r=[],rl={},Px=[],Ld=0,Ix=0,pu=function(t){return(rl[t]||Px).map(function(e){return e()})},Tu=function(){var t=Date.now(),e=[];t-Ld>2&&(pu("matchMediaInit"),$r.forEach(function(n){var i=n.queries,s=n.conditions,o,a,l,c;for(a in i)o=wi.matchMedia(i[a]).matches,o&&(l=1),o!==s[a]&&(s[a]=o,c=1);c&&(n.revert(),l&&e.push(n))}),pu("matchMediaRevert"),e.forEach(function(n){return n.onMatch(n,function(i){return n.add(null,i)})}),Ld=t,pu("matchMedia"))},dp=function(){function r(e,n){this.selector=n&&bu(n),this.data=[],this._r=[],this.isReverted=!1,this.id=Ix++,e&&this.add(e)}var t=r.prototype;return t.add=function(n,i,s){Ie(n)&&(s=i,i=n,n=Ie);var o=this,a=function(){var c=Ae,h=o.selector,d;return c&&c!==o&&c.data.push(o),s&&(o.selector=bu(s)),Ae=o,d=i.apply(o,arguments),Ie(d)&&o._r.push(d),Ae=c,o.selector=h,o.isReverted=!1,d};return o.last=a,n===Ie?a(o,function(l){return o.add(null,l)}):n?o[n]=a:a},t.ignore=function(n){var i=Ae;Ae=null,n(this),Ae=i},t.getTweens=function(){var n=[];return this.data.forEach(function(i){return i instanceof r?n.push.apply(n,i.getTweens()):i instanceof Ne&&!(i.parent&&i.parent.data==="nested")&&n.push(i)}),n},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(n,i){var s=this;if(n?function(){for(var a=s.getTweens(),l=s.data.length,c;l--;)c=s.data[l],c.data==="isFlip"&&(c.revert(),c.getChildren(!0,!0,!1).forEach(function(h){return a.splice(a.indexOf(h),1)}));for(a.map(function(h){return{g:h._dur||h._delay||h._sat&&!h._sat.vars.immediateRender?h.globalTime(0):-1/0,t:h}}).sort(function(h,d){return d.g-h.g||-1/0}).forEach(function(h){return h.t.revert(n)}),l=s.data.length;l--;)c=s.data[l],c instanceof tn?c.data!=="nested"&&(c.scrollTrigger&&c.scrollTrigger.revert(),c.kill()):!(c instanceof Ne)&&c.revert&&c.revert(n);s._r.forEach(function(h){return h(n,s)}),s.isReverted=!0}():this.data.forEach(function(a){return a.kill&&a.kill()}),this.clear(),i)for(var o=$r.length;o--;)$r[o].id===this.id&&$r.splice(o,1)},t.revert=function(n){this.kill(n||{})},r}(),Lx=function(){function r(e){this.contexts=[],this.scope=e,Ae&&Ae.data.push(this)}var t=r.prototype;return t.add=function(n,i,s){Ti(n)||(n={matches:n});var o=new dp(0,s||this.scope),a=o.conditions={},l,c,h;Ae&&!o.selector&&(o.selector=Ae.selector),this.contexts.push(o),i=o.add("onMatch",i),o.queries=n;for(c in n)c==="all"?h=1:(l=wi.matchMedia(n[c]),l&&($r.indexOf(o)<0&&$r.push(o),(a[c]=l.matches)&&(h=1),l.addListener?l.addListener(Tu):l.addEventListener("change",Tu)));return h&&i(o,function(d){return o.add(null,d)}),this},t.revert=function(n){this.kill(n||{})},t.kill=function(n){this.contexts.forEach(function(i){return i.kill(n,!0)})},r}(),cl={registerPlugin:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e.forEach(function(i){return ip(i)})},timeline:function(t){return new tn(t)},getTweensOf:function(t,e){return Ce.getTweensOf(t,e)},getProperty:function(t,e,n,i){Ge(t)&&(t=Zn(t)[0]);var s=dr(t||{}).get,o=n?Wd:Gd;return n==="native"&&(n=""),t&&(e?o((Cn[e]&&Cn[e].get||s)(t,e,n,i)):function(a,l,c){return o((Cn[a]&&Cn[a].get||s)(t,a,l,c))})},quickSetter:function(t,e,n){if(t=Zn(t),t.length>1){var i=t.map(function(h){return cn.quickSetter(h,e,n)}),s=i.length;return function(h){for(var d=s;d--;)i[d](h)}}t=t[0]||{};var o=Cn[e],a=dr(t),l=a.harness&&(a.harness.aliases||{})[e]||e,c=o?function(h){var d=new o;ks._pt=0,d.init(t,n?h+n:h,ks,0,[t]),d.render(1,d),ks._pt&&Gu(1,ks)}:a.set(t,l);return o?c:function(h){return c(t,l,n?h+n:h,a,1)}},quickTo:function(t,e,n){var i,s=cn.to(t,Kr((i={},i[e]="+=0.1",i.paused=!0,i),n||{})),o=function(l,c,h){return s.resetTo(e,l,c,h)};return o.tween=s,o},isTweening:function(t){return Ce.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=Jr(t.ease,zs.ease)),Dd(zs,t||{})},config:function(t){return Dd(In,t||{})},registerEffect:function(t){var e=t.name,n=t.effect,i=t.plugins,s=t.defaults,o=t.extendTimeline;(i||"").split(",").forEach(function(a){return a&&!Cn[a]&&!Bn[a]&&Qo(e+" effect requires "+a+" plugin.")}),uu[e]=function(a,l,c){return n(Zn(a),Jn(l||{},s),c)},o&&(tn.prototype[e]=function(a,l,c){return this.add(uu[e](a,Ti(l)?l:(c=l)&&{},this),c)})},registerEase:function(t,e){fe[t]=Jr(e)},parseEase:function(t,e){return arguments.length?Jr(t,e):fe},getById:function(t){return Ce.getById(t)},exportRoot:function(t,e){t===void 0&&(t={});var n=new tn(t),i,s;for(n.smoothChildTiming=Pn(t.smoothChildTiming),Ce.remove(n),n._dp=0,n._time=n._tTime=Ce._time,i=Ce._first;i;)s=i._next,(e||!(!i._dur&&i instanceof Ne&&i.vars.onComplete===i._targets[0]))&&Ei(n,i,i._start-i._delay),i=s;return Ei(Ce,n,0),n},context:function(t,e){return t?new dp(t,e):Ae},matchMedia:function(t){return new Lx(t)},matchMediaRefresh:function(){return $r.forEach(function(t){var e=t.conditions,n,i;for(i in e)e[i]&&(e[i]=!1,n=1);n&&t.revert()})||Tu()},addEventListener:function(t,e){var n=rl[t]||(rl[t]=[]);~n.indexOf(e)||n.push(e)},removeEventListener:function(t,e){var n=rl[t],i=n&&n.indexOf(e);i>=0&&n.splice(i,1)},utils:{wrap:hx,wrapYoyo:fx,distribute:Kd,random:Qd,snap:jd,normalize:ux,getUnit:en,clamp:ox,splitColor:rp,toArray:Zn,selector:bu,mapRange:ep,pipe:lx,unitize:cx,interpolate:dx,shuffle:$d},install:kd,effects:uu,ticker:Rn,updateRoot:tn.updateRoot,plugins:Cn,globalTimeline:Ce,core:{PropTween:yn,globals:zd,Tween:Ne,Timeline:tn,Animation:na,getCache:dr,_removeLinkedListItem:fl,reverting:function(){return an},context:function(t){return t&&Ae&&(Ae.data.push(t),t._ctx=Ae),Ae},suppressOverwrites:function(t){return Au=t}}};xn("to,from,fromTo,delayedCall,set,killTweensOf",function(r){return cl[r]=Ne[r]});Rn.add(tn.updateRoot);ks=cl.to({},{duration:0});var Fx=function(t,e){for(var n=t._pt;n&&n.p!==e&&n.op!==e&&n.fp!==e;)n=n._next;return n},Nx=function(t,e){var n=t._targets,i,s,o;for(i in e)for(s=n.length;s--;)o=t._ptLookup[s][i],o&&(o=o.d)&&(o._pt&&(o=Fx(o,i)),o&&o.modifier&&o.modifier(e[i],t,n[s],i))},mu=function(t,e){return{name:t,rawVars:1,init:function(i,s,o){o._onInit=function(a){var l,c;if(Ge(s)&&(l={},xn(s,function(h){return l[h]=1}),s=l),e){l={};for(c in s)l[c]=e(s[c]);s=l}Nx(a,s)}}}},cn=cl.registerPlugin({name:"attr",init:function(t,e,n,i,s){var o,a,l;this.tween=n;for(o in e)l=t.getAttribute(o)||"",a=this.add(t,"setAttribute",(l||0)+"",e[o],i,s,0,0,o),a.op=o,a.b=l,this._props.push(o)},render:function(t,e){for(var n=e._pt;n;)an?n.set(n.t,n.p,n.b,n):n.r(t,n.d),n=n._next}},{name:"endArray",init:function(t,e){for(var n=e.length;n--;)this.add(t,n,t[n]||0,e[n],0,0,0,0,0,1)}},mu("roundProps",wu),mu("modifiers"),mu("snap",jd))||cl;Ne.version=tn.version=cn.version="3.12.5";Bd=1;Du()&&Gs();var Ux=fe.Power0,Ox=fe.Power1,Bx=fe.Power2,kx=fe.Power3,zx=fe.Power4,Vx=fe.Linear,Hx=fe.Quad,Gx=fe.Cubic,Wx=fe.Quart,Xx=fe.Quint,Yx=fe.Strong,qx=fe.Elastic,Zx=fe.Back,Jx=fe.SteppedEase,$x=fe.Bounce,Kx=fe.Sine,jx=fe.Expo,Qx=fe.Circ;var pp,gr,Ys,Ku,rs,ty,mp,ju,ey=function(){return typeof window<"u"},Hi={},is=180/Math.PI,qs=Math.PI/180,Xs=Math.atan2,gp=1e8,Qu=/([A-Z])/g,ny=/(left|right|width|margin|padding|x)/i,iy=/[\s,\(]\S/,Ai={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},qu=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},ry=function(t,e){return e.set(e.t,e.p,t===1?e.e:Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},sy=function(t,e){return e.set(e.t,e.p,t?Math.round((e.s+e.c*t)*1e4)/1e4+e.u:e.b,e)},oy=function(t,e){var n=e.s+e.c*t;e.set(e.t,e.p,~~(n+(n<0?-.5:.5))+e.u,e)},bp=function(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)},wp=function(t,e){return e.set(e.t,e.p,t!==1?e.b:e.e,e)},ay=function(t,e,n){return t.style[e]=n},ly=function(t,e,n){return t.style.setProperty(e,n)},cy=function(t,e,n){return t._gsap[e]=n},uy=function(t,e,n){return t._gsap.scaleX=t._gsap.scaleY=n},hy=function(t,e,n,i,s){var o=t._gsap;o.scaleX=o.scaleY=n,o.renderTransform(s,o)},fy=function(t,e,n,i,s){var o=t._gsap;o[e]=n,o.renderTransform(s,o)},Re="transform",Ln=Re+"Origin",dy=function r(t,e){var n=this,i=this.target,s=i.style,o=i._gsap;if(t in Hi&&s){if(this.tfm=this.tfm||{},t!=="transform")t=Ai[t]||t,~t.indexOf(",")?t.split(",").forEach(function(a){return n.tfm[a]=Vi(i,a)}):this.tfm[t]=o.x?o[t]:Vi(i,t),t===Ln&&(this.tfm.zOrigin=o.zOrigin);else return Ai.transform.split(",").forEach(function(a){return r.call(n,a,e)});if(this.props.indexOf(Re)>=0)return;o.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(Ln,e,"")),t=Re}(s||e)&&this.props.push(t,e,s[t])},Ep=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},py=function(){var t=this.props,e=this.target,n=e.style,i=e._gsap,s,o;for(s=0;s<t.length;s+=3)t[s+1]?e[t[s]]=t[s+2]:t[s+2]?n[t[s]]=t[s+2]:n.removeProperty(t[s].substr(0,2)==="--"?t[s]:t[s].replace(Qu,"-$1").toLowerCase());if(this.tfm){for(o in this.tfm)i[o]=this.tfm[o];i.svg&&(i.renderTransform(),e.setAttribute("data-svg-origin",this.svgo||"")),s=ju(),(!s||!s.isStart)&&!n[Re]&&(Ep(n),i.zOrigin&&n[Ln]&&(n[Ln]+=" "+i.zOrigin+"px",i.zOrigin=0,i.renderTransform()),i.uncache=1)}},Tp=function(t,e){var n={target:t,props:[],revert:py,save:dy};return t._gsap||cn.core.getCache(t),e&&e.split(",").forEach(function(i){return n.save(i)}),n},Ap,Zu=function(t,e){var n=gr.createElementNS?gr.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):gr.createElement(t);return n&&n.style?n:gr.createElement(t)},Di=function r(t,e,n){var i=getComputedStyle(t);return i[e]||i.getPropertyValue(e.replace(Qu,"-$1").toLowerCase())||i.getPropertyValue(e)||!n&&r(t,Zs(e)||e,1)||""},_p="O,Moz,ms,Ms,Webkit".split(","),Zs=function(t,e,n){var i=e||rs,s=i.style,o=5;if(t in s&&!n)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);o--&&!(_p[o]+t in s););return o<0?null:(o===3?"ms":o>=0?_p[o]:"")+t},Ju=function(){ey()&&window.document&&(pp=window,gr=pp.document,Ys=gr.documentElement,rs=Zu("div")||{style:{}},ty=Zu("div"),Re=Zs(Re),Ln=Re+"Origin",rs.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Ap=!!Zs("perspective"),ju=cn.core.reverting,Ku=1)},Xu=function r(t){var e=Zu("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=this.parentNode,i=this.nextSibling,s=this.style.cssText,o;if(Ys.appendChild(e),e.appendChild(this),this.style.display="block",t)try{o=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=r}catch{}else this._gsapBBox&&(o=this._gsapBBox());return n&&(i?n.insertBefore(this,i):n.appendChild(this)),Ys.removeChild(e),this.style.cssText=s,o},xp=function(t,e){for(var n=e.length;n--;)if(t.hasAttribute(e[n]))return t.getAttribute(e[n])},Dp=function(t){var e;try{e=t.getBBox()}catch{e=Xu.call(t,!0)}return e&&(e.width||e.height)||t.getBBox===Xu||(e=Xu.call(t,!0)),e&&!e.width&&!e.x&&!e.y?{x:+xp(t,["x","cx","x1"])||0,y:+xp(t,["y","cy","y1"])||0,width:0,height:0}:e},Cp=function(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&Dp(t))},ss=function(t,e){if(e){var n=t.style,i;e in Hi&&e!==Ln&&(e=Re),n.removeProperty?(i=e.substr(0,2),(i==="ms"||e.substr(0,6)==="webkit")&&(e="-"+e),n.removeProperty(i==="--"?e:e.replace(Qu,"-$1").toLowerCase())):n.removeAttribute(e)}},_r=function(t,e,n,i,s,o){var a=new yn(t._pt,e,n,0,1,o?wp:bp);return t._pt=a,a.b=i,a.e=s,t._props.push(n),a},yp={deg:1,rad:1,turn:1},my={grid:1,flex:1},xr=function r(t,e,n,i){var s=parseFloat(n)||0,o=(n+"").trim().substr((s+"").length)||"px",a=rs.style,l=ny.test(e),c=t.tagName.toLowerCase()==="svg",h=(c?"client":"offset")+(l?"Width":"Height"),d=100,f=i==="px",u=i==="%",_,p,m,g;if(i===o||!s||yp[i]||yp[o])return s;if(o!=="px"&&!f&&(s=r(t,e,n,"px")),g=t.getCTM&&Cp(t),(u||o==="%")&&(Hi[e]||~e.indexOf("adius")))return _=g?t.getBBox()[l?"width":"height"]:t[h],Le(u?s/_*d:s/100*_);if(a[l?"width":"height"]=d+(f?o:i),p=~e.indexOf("adius")||i==="em"&&t.appendChild&&!c?t:t.parentNode,g&&(p=(t.ownerSVGElement||{}).parentNode),(!p||p===gr||!p.appendChild)&&(p=gr.body),m=p._gsap,m&&u&&m.width&&l&&m.time===Rn.time&&!m.uncache)return Le(s/m.width*d);if(u&&(e==="height"||e==="width")){var b=t.style[e];t.style[e]=d+i,_=t[h],b?t.style[e]=b:ss(t,e)}else(u||o==="%")&&!my[Di(p,"display")]&&(a.position=Di(t,"position")),p===t&&(a.position="static"),p.appendChild(rs),_=rs[h],p.removeChild(rs),a.position="absolute";return l&&u&&(m=dr(p),m.time=Rn.time,m.width=p[h]),Le(f?_*s/d:_&&s?d/_*s:0)},Vi=function(t,e,n,i){var s;return Ku||Ju(),e in Ai&&e!=="transform"&&(e=Ai[e],~e.indexOf(",")&&(e=e.split(",")[0])),Hi[e]&&e!=="transform"?(s=oa(t,i),s=e!=="transformOrigin"?s[e]:s.svg?s.origin:_l(Di(t,Ln))+" "+s.zOrigin+"px"):(s=t.style[e],(!s||s==="auto"||i||~(s+"").indexOf("calc("))&&(s=gl[e]&&gl[e](t,e,n)||Di(t,e)||Nu(t,e)||(e==="opacity"?1:0))),n&&!~(s+"").trim().indexOf(" ")?xr(t,e,s,n)+n:s},gy=function(t,e,n,i){if(!n||n==="none"){var s=Zs(e,t,1),o=s&&Di(t,s,1);o&&o!==n?(e=s,n=o):e==="borderColor"&&(n=Di(t,"borderTopColor"))}var a=new yn(this._pt,t.style,e,0,1,Hu),l=0,c=0,h,d,f,u,_,p,m,g,b,v,S,D;if(a.b=n,a.e=i,n+="",i+="",i==="auto"&&(p=t.style[e],t.style[e]=i,i=Di(t,e)||i,p?t.style[e]=p:ss(t,e)),h=[n,i],Uu(h),n=h[0],i=h[1],f=n.match(jr)||[],D=i.match(jr)||[],D.length){for(;d=jr.exec(i);)m=d[0],b=i.substring(l,d.index),_?_=(_+1)%5:(b.substr(-5)==="rgba("||b.substr(-5)==="hsla(")&&(_=1),m!==(p=f[c++]||"")&&(u=parseFloat(p)||0,S=p.substr((u+"").length),m.charAt(1)==="="&&(m=Qr(u,m)+S),g=parseFloat(m),v=m.substr((g+"").length),l=jr.lastIndex-v.length,v||(v=v||In.units[e]||S,l===i.length&&(i+=v,a.e+=v)),S!==v&&(u=xr(t,e,p,v)||0),a._pt={_next:a._pt,p:b||c===1?b:",",s:u,c:g-u,m:_&&_<4||e==="zIndex"?Math.round:0});a.c=l<i.length?i.substring(l,i.length):""}else a.r=e==="display"&&i==="none"?wp:bp;return Ru.test(i)&&(a.e=0),this._pt=a,a},vp={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},_y=function(t){var e=t.split(" "),n=e[0],i=e[1]||"50%";return(n==="top"||n==="bottom"||i==="left"||i==="right")&&(t=n,n=i,i=t),e[0]=vp[n]||n,e[1]=vp[i]||i,e.join(" ")},xy=function(t,e){if(e.tween&&e.tween._time===e.tween._dur){var n=e.t,i=n.style,s=e.u,o=n._gsap,a,l,c;if(s==="all"||s===!0)i.cssText="",l=1;else for(s=s.split(","),c=s.length;--c>-1;)a=s[c],Hi[a]&&(l=1,a=a==="transformOrigin"?Ln:Re),ss(n,a);l&&(ss(n,Re),o&&(o.svg&&n.removeAttribute("transform"),oa(n,1),o.uncache=1,Ep(i)))}},gl={clearProps:function(t,e,n,i,s){if(s.data!=="isFromStart"){var o=t._pt=new yn(t._pt,e,n,0,0,xy);return o.u=i,o.pr=-10,o.tween=s,t._props.push(n),1}}},sa=[1,0,0,1,0,0],Rp={},Pp=function(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},Sp=function(t){var e=Di(t,Re);return Pp(e)?sa:e.substr(7).match(Cu).map(Le)},th=function(t,e){var n=t._gsap||dr(t),i=t.style,s=Sp(t),o,a,l,c;return n.svg&&t.getAttribute("transform")?(l=t.transform.baseVal.consolidate().matrix,s=[l.a,l.b,l.c,l.d,l.e,l.f],s.join(",")==="1,0,0,1,0,0"?sa:s):(s===sa&&!t.offsetParent&&t!==Ys&&!n.svg&&(l=i.display,i.display="block",o=t.parentNode,(!o||!t.offsetParent)&&(c=1,a=t.nextElementSibling,Ys.appendChild(t)),s=Sp(t),l?i.display=l:ss(t,"display"),c&&(a?o.insertBefore(t,a):o?o.appendChild(t):Ys.removeChild(t))),e&&s.length>6?[s[0],s[1],s[4],s[5],s[12],s[13]]:s)},$u=function(t,e,n,i,s,o){var a=t._gsap,l=s||th(t,!0),c=a.xOrigin||0,h=a.yOrigin||0,d=a.xOffset||0,f=a.yOffset||0,u=l[0],_=l[1],p=l[2],m=l[3],g=l[4],b=l[5],v=e.split(" "),S=parseFloat(v[0])||0,D=parseFloat(v[1])||0,T,w,P,M;n?l!==sa&&(w=u*m-_*p)&&(P=S*(m/w)+D*(-p/w)+(p*b-m*g)/w,M=S*(-_/w)+D*(u/w)-(u*b-_*g)/w,S=P,D=M):(T=Dp(t),S=T.x+(~v[0].indexOf("%")?S/100*T.width:S),D=T.y+(~(v[1]||v[0]).indexOf("%")?D/100*T.height:D)),i||i!==!1&&a.smooth?(g=S-c,b=D-h,a.xOffset=d+(g*u+b*p)-g,a.yOffset=f+(g*_+b*m)-b):a.xOffset=a.yOffset=0,a.xOrigin=S,a.yOrigin=D,a.smooth=!!i,a.origin=e,a.originIsAbsolute=!!n,t.style[Ln]="0px 0px",o&&(_r(o,a,"xOrigin",c,S),_r(o,a,"yOrigin",h,D),_r(o,a,"xOffset",d,a.xOffset),_r(o,a,"yOffset",f,a.yOffset)),t.setAttribute("data-svg-origin",S+" "+D)},oa=function(t,e){var n=t._gsap||new Ou(t);if("x"in n&&!e&&!n.uncache)return n;var i=t.style,s=n.scaleX<0,o="px",a="deg",l=getComputedStyle(t),c=Di(t,Ln)||"0",h,d,f,u,_,p,m,g,b,v,S,D,T,w,P,M,y,I,N,C,V,$,W,Z,z,U,R,at,_t,Ut,X,ot;return h=d=f=p=m=g=b=v=S=0,u=_=1,n.svg=!!(t.getCTM&&Cp(t)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(i[Re]=(l.translate!=="none"?"translate3d("+(l.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(l.rotate!=="none"?"rotate("+l.rotate+") ":"")+(l.scale!=="none"?"scale("+l.scale.split(" ").join(",")+") ":"")+(l[Re]!=="none"?l[Re]:"")),i.scale=i.rotate=i.translate="none"),w=th(t,n.svg),n.svg&&(n.uncache?(z=t.getBBox(),c=n.xOrigin-z.x+"px "+(n.yOrigin-z.y)+"px",Z=""):Z=!e&&t.getAttribute("data-svg-origin"),$u(t,Z||c,!!Z||n.originIsAbsolute,n.smooth!==!1,w)),D=n.xOrigin||0,T=n.yOrigin||0,w!==sa&&(I=w[0],N=w[1],C=w[2],V=w[3],h=$=w[4],d=W=w[5],w.length===6?(u=Math.sqrt(I*I+N*N),_=Math.sqrt(V*V+C*C),p=I||N?Xs(N,I)*is:0,b=C||V?Xs(C,V)*is+p:0,b&&(_*=Math.abs(Math.cos(b*qs))),n.svg&&(h-=D-(D*I+T*C),d-=T-(D*N+T*V))):(ot=w[6],Ut=w[7],R=w[8],at=w[9],_t=w[10],X=w[11],h=w[12],d=w[13],f=w[14],P=Xs(ot,_t),m=P*is,P&&(M=Math.cos(-P),y=Math.sin(-P),Z=$*M+R*y,z=W*M+at*y,U=ot*M+_t*y,R=$*-y+R*M,at=W*-y+at*M,_t=ot*-y+_t*M,X=Ut*-y+X*M,$=Z,W=z,ot=U),P=Xs(-C,_t),g=P*is,P&&(M=Math.cos(-P),y=Math.sin(-P),Z=I*M-R*y,z=N*M-at*y,U=C*M-_t*y,X=V*y+X*M,I=Z,N=z,C=U),P=Xs(N,I),p=P*is,P&&(M=Math.cos(P),y=Math.sin(P),Z=I*M+N*y,z=$*M+W*y,N=N*M-I*y,W=W*M-$*y,I=Z,$=z),m&&Math.abs(m)+Math.abs(p)>359.9&&(m=p=0,g=180-g),u=Le(Math.sqrt(I*I+N*N+C*C)),_=Le(Math.sqrt(W*W+ot*ot)),P=Xs($,W),b=Math.abs(P)>2e-4?P*is:0,S=X?1/(X<0?-X:X):0),n.svg&&(Z=t.getAttribute("transform"),n.forceCSS=t.setAttribute("transform","")||!Pp(Di(t,Re)),Z&&t.setAttribute("transform",Z))),Math.abs(b)>90&&Math.abs(b)<270&&(s?(u*=-1,b+=p<=0?180:-180,p+=p<=0?180:-180):(_*=-1,b+=b<=0?180:-180)),e=e||n.uncache,n.x=h-((n.xPercent=h&&(!e&&n.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-h)?-50:0)))?t.offsetWidth*n.xPercent/100:0)+o,n.y=d-((n.yPercent=d&&(!e&&n.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-d)?-50:0)))?t.offsetHeight*n.yPercent/100:0)+o,n.z=f+o,n.scaleX=Le(u),n.scaleY=Le(_),n.rotation=Le(p)+a,n.rotationX=Le(m)+a,n.rotationY=Le(g)+a,n.skewX=b+a,n.skewY=v+a,n.transformPerspective=S+o,(n.zOrigin=parseFloat(c.split(" ")[2])||!e&&n.zOrigin||0)&&(i[Ln]=_l(c)),n.xOffset=n.yOffset=0,n.force3D=In.force3D,n.renderTransform=n.svg?vy:Ap?Ip:yy,n.uncache=0,n},_l=function(t){return(t=t.split(" "))[0]+" "+t[1]},Yu=function(t,e,n){var i=en(e);return Le(parseFloat(e)+parseFloat(xr(t,"x",n+"px",i)))+i},yy=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,Ip(t,e)},es="0deg",ra="0px",ns=") ",Ip=function(t,e){var n=e||this,i=n.xPercent,s=n.yPercent,o=n.x,a=n.y,l=n.z,c=n.rotation,h=n.rotationY,d=n.rotationX,f=n.skewX,u=n.skewY,_=n.scaleX,p=n.scaleY,m=n.transformPerspective,g=n.force3D,b=n.target,v=n.zOrigin,S="",D=g==="auto"&&t&&t!==1||g===!0;if(v&&(d!==es||h!==es)){var T=parseFloat(h)*qs,w=Math.sin(T),P=Math.cos(T),M;T=parseFloat(d)*qs,M=Math.cos(T),o=Yu(b,o,w*M*-v),a=Yu(b,a,-Math.sin(T)*-v),l=Yu(b,l,P*M*-v+v)}m!==ra&&(S+="perspective("+m+ns),(i||s)&&(S+="translate("+i+"%, "+s+"%) "),(D||o!==ra||a!==ra||l!==ra)&&(S+=l!==ra||D?"translate3d("+o+", "+a+", "+l+") ":"translate("+o+", "+a+ns),c!==es&&(S+="rotate("+c+ns),h!==es&&(S+="rotateY("+h+ns),d!==es&&(S+="rotateX("+d+ns),(f!==es||u!==es)&&(S+="skew("+f+", "+u+ns),(_!==1||p!==1)&&(S+="scale("+_+", "+p+ns),b.style[Re]=S||"translate(0, 0)"},vy=function(t,e){var n=e||this,i=n.xPercent,s=n.yPercent,o=n.x,a=n.y,l=n.rotation,c=n.skewX,h=n.skewY,d=n.scaleX,f=n.scaleY,u=n.target,_=n.xOrigin,p=n.yOrigin,m=n.xOffset,g=n.yOffset,b=n.forceCSS,v=parseFloat(o),S=parseFloat(a),D,T,w,P,M;l=parseFloat(l),c=parseFloat(c),h=parseFloat(h),h&&(h=parseFloat(h),c+=h,l+=h),l||c?(l*=qs,c*=qs,D=Math.cos(l)*d,T=Math.sin(l)*d,w=Math.sin(l-c)*-f,P=Math.cos(l-c)*f,c&&(h*=qs,M=Math.tan(c-h),M=Math.sqrt(1+M*M),w*=M,P*=M,h&&(M=Math.tan(h),M=Math.sqrt(1+M*M),D*=M,T*=M)),D=Le(D),T=Le(T),w=Le(w),P=Le(P)):(D=d,P=f,T=w=0),(v&&!~(o+"").indexOf("px")||S&&!~(a+"").indexOf("px"))&&(v=xr(u,"x",o,"px"),S=xr(u,"y",a,"px")),(_||p||m||g)&&(v=Le(v+_-(_*D+p*w)+m),S=Le(S+p-(_*T+p*P)+g)),(i||s)&&(M=u.getBBox(),v=Le(v+i/100*M.width),S=Le(S+s/100*M.height)),M="matrix("+D+","+T+","+w+","+P+","+v+","+S+")",u.setAttribute("transform",M),b&&(u.style[Re]=M)},Sy=function(t,e,n,i,s){var o=360,a=Ge(s),l=parseFloat(s)*(a&&~s.indexOf("rad")?is:1),c=l-i,h=i+c+"deg",d,f;return a&&(d=s.split("_")[1],d==="short"&&(c%=o,c!==c%(o/2)&&(c+=c<0?o:-o)),d==="cw"&&c<0?c=(c+o*gp)%o-~~(c/o)*o:d==="ccw"&&c>0&&(c=(c-o*gp)%o-~~(c/o)*o)),t._pt=f=new yn(t._pt,e,n,i,c,ry),f.e=h,f.u="deg",t._props.push(n),f},Mp=function(t,e){for(var n in e)t[n]=e[n];return t},My=function(t,e,n){var i=Mp({},n._gsap),s="perspective,force3D,transformOrigin,svgOrigin",o=n.style,a,l,c,h,d,f,u,_;i.svg?(c=n.getAttribute("transform"),n.setAttribute("transform",""),o[Re]=e,a=oa(n,1),ss(n,Re),n.setAttribute("transform",c)):(c=getComputedStyle(n)[Re],o[Re]=e,a=oa(n,1),o[Re]=c);for(l in Hi)c=i[l],h=a[l],c!==h&&s.indexOf(l)<0&&(u=en(c),_=en(h),d=u!==_?xr(n,l,c,_):parseFloat(c),f=parseFloat(h),t._pt=new yn(t._pt,a,l,d,f-d,qu),t._pt.u=_||0,t._props.push(l));Mp(a,i)};xn("padding,margin,Width,Radius",function(r,t){var e="Top",n="Right",i="Bottom",s="Left",o=(t<3?[e,n,i,s]:[e+s,e+n,i+n,i+s]).map(function(a){return t<2?r+a:"border"+a+r});gl[t>1?"border"+r:r]=function(a,l,c,h,d){var f,u;if(arguments.length<4)return f=o.map(function(_){return Vi(a,_,c)}),u=f.join(" "),u.split(f[0]).length===5?f[0]:u;f=(h+"").split(" "),u={},o.forEach(function(_,p){return u[_]=f[p]=f[p]||f[(p-1)/2|0]}),a.init(l,u,d)}});var eh={name:"css",register:Ju,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,n,i,s){var o=this._props,a=t.style,l=n.vars.startAt,c,h,d,f,u,_,p,m,g,b,v,S,D,T,w,P;Ku||Ju(),this.styles=this.styles||Tp(t),P=this.styles.props,this.tween=n;for(p in e)if(p!=="autoRound"&&(h=e[p],!(Cn[p]&&ku(p,e,n,i,t,s)))){if(u=typeof h,_=gl[p],u==="function"&&(h=h.call(n,i,t,s),u=typeof h),u==="string"&&~h.indexOf("random(")&&(h=Ws(h)),_)_(this,t,p,h,n)&&(w=1);else if(p.substr(0,2)==="--")c=(getComputedStyle(t).getPropertyValue(p)+"").trim(),h+="",ki.lastIndex=0,ki.test(c)||(m=en(c),g=en(h)),g?m!==g&&(c=xr(t,p,c,g)+g):m&&(h+=m),this.add(a,"setProperty",c,h,i,s,0,0,p),o.push(p),P.push(p,0,a[p]);else if(u!=="undefined"){if(l&&p in l?(c=typeof l[p]=="function"?l[p].call(n,i,t,s):l[p],Ge(c)&&~c.indexOf("random(")&&(c=Ws(c)),en(c+"")||c==="auto"||(c+=In.units[p]||en(Vi(t,p))||""),(c+"").charAt(1)==="="&&(c=Vi(t,p))):c=Vi(t,p),f=parseFloat(c),b=u==="string"&&h.charAt(1)==="="&&h.substr(0,2),b&&(h=h.substr(2)),d=parseFloat(h),p in Ai&&(p==="autoAlpha"&&(f===1&&Vi(t,"visibility")==="hidden"&&d&&(f=0),P.push("visibility",0,a.visibility),_r(this,a,"visibility",f?"inherit":"hidden",d?"inherit":"hidden",!d)),p!=="scale"&&p!=="transform"&&(p=Ai[p],~p.indexOf(",")&&(p=p.split(",")[0]))),v=p in Hi,v){if(this.styles.save(p),S||(D=t._gsap,D.renderTransform&&!e.parseTransform||oa(t,e.parseTransform),T=e.smoothOrigin!==!1&&D.smooth,S=this._pt=new yn(this._pt,a,Re,0,1,D.renderTransform,D,0,-1),S.dep=1),p==="scale")this._pt=new yn(this._pt,D,"scaleY",D.scaleY,(b?Qr(D.scaleY,b+d):d)-D.scaleY||0,qu),this._pt.u=0,o.push("scaleY",p),p+="X";else if(p==="transformOrigin"){P.push(Ln,0,a[Ln]),h=_y(h),D.svg?$u(t,h,0,T,0,this):(g=parseFloat(h.split(" ")[2])||0,g!==D.zOrigin&&_r(this,D,"zOrigin",D.zOrigin,g),_r(this,a,p,_l(c),_l(h)));continue}else if(p==="svgOrigin"){$u(t,h,1,T,0,this);continue}else if(p in Rp){Sy(this,D,p,f,b?Qr(f,b+h):h);continue}else if(p==="smoothOrigin"){_r(this,D,"smooth",D.smooth,h);continue}else if(p==="force3D"){D[p]=h;continue}else if(p==="transform"){My(this,h,t);continue}}else p in a||(p=Zs(p)||p);if(v||(d||d===0)&&(f||f===0)&&!iy.test(h)&&p in a)m=(c+"").substr((f+"").length),d||(d=0),g=en(h)||(p in In.units?In.units[p]:m),m!==g&&(f=xr(t,p,c,g)),this._pt=new yn(this._pt,v?D:a,p,f,(b?Qr(f,b+d):d)-f,!v&&(g==="px"||p==="zIndex")&&e.autoRound!==!1?oy:qu),this._pt.u=g||0,m!==g&&g!=="%"&&(this._pt.b=c,this._pt.r=sy);else if(p in a)gy.call(this,t,p,c,b?b+h:h);else if(p in t)this.add(t,p,c||t[p],b?b+h:h,i,s);else if(p!=="parseTransform"){hl(p,h);continue}v||(p in a?P.push(p,0,a[p]):P.push(p,1,c||t[p])),o.push(p)}}w&&Wu(this)},render:function(t,e){if(e.tween._time||!ju())for(var n=e._pt;n;)n.r(t,n.d),n=n._next;else e.styles.revert()},get:Vi,aliases:Ai,getSetter:function(t,e,n){var i=Ai[e];return i&&i.indexOf(",")<0&&(e=i),e in Hi&&e!==Ln&&(t._gsap.x||Vi(t,"x"))?n&&mp===n?e==="scale"?uy:cy:(mp=n||{})&&(e==="scale"?hy:fy):t.style&&!ul(t.style[e])?ay:~e.indexOf("-")?ly:ml(t,e)},core:{_removeProperty:ss,_getMatrix:th}};cn.utils.checkPrefix=Zs;cn.core.getStyleSaver=Tp;(function(r,t,e,n){var i=xn(r+","+t+","+e,function(s){Hi[s]=1});xn(t,function(s){In.units[s]="deg",Rp[s]=1}),Ai[i[13]]=r+","+t,xn(n,function(s){var o=s.split(":");Ai[o[1]]=i[o[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");xn("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){In.units[r]="px"});cn.registerPlugin(eh);var Kt=cn.registerPlugin(eh)||cn,fT=Kt.core.Tween;function Lp(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function by(r,t,e){return t&&Lp(r.prototype,t),e&&Lp(r,e),r}var nn,vl,wy,kn,yr,vr,$s,Np,os,la,Up,Gi,li,Op,Bp=function(){return nn||typeof window<"u"&&(nn=window.gsap)&&nn.registerPlugin&&nn},kp=1,Js=[],le=[],ci=[],ca=Date.now,nh=function(t,e){return e},Ey=function(){var t=la.core,e=t.bridge||{},n=t._scrollers,i=t._proxies;n.push.apply(n,le),i.push.apply(i,ci),le=n,ci=i,nh=function(o,a){return e[o](a)}},Xi=function(t,e){return~ci.indexOf(t)&&ci[ci.indexOf(t)+1][e]},ua=function(t){return!!~Up.indexOf(t)},Sn=function(t,e,n,i,s){return t.addEventListener(e,n,{passive:i!==!1,capture:!!s})},vn=function(t,e,n,i){return t.removeEventListener(e,n,!!i)},xl="scrollLeft",yl="scrollTop",ih=function(){return Gi&&Gi.isPressed||le.cache++},Sl=function(t,e){var n=function i(s){if(s||s===0){kp&&(kn.history.scrollRestoration="manual");var o=Gi&&Gi.isPressed;s=i.v=Math.round(s)||(Gi&&Gi.iOS?1:0),t(s),i.cacheID=le.cache,o&&nh("ss",s)}else(e||le.cache!==i.cacheID||nh("ref"))&&(i.cacheID=le.cache,i.v=t());return i.v+i.offset};return n.offset=0,t&&n},un={s:xl,p:"left",p2:"Left",os:"right",os2:"Right",d:"width",d2:"Width",a:"x",sc:Sl(function(r){return arguments.length?kn.scrollTo(r,ke.sc()):kn.pageXOffset||yr[xl]||vr[xl]||$s[xl]||0})},ke={s:yl,p:"top",p2:"Top",os:"bottom",os2:"Bottom",d:"height",d2:"Height",a:"y",op:un,sc:Sl(function(r){return arguments.length?kn.scrollTo(un.sc(),r):kn.pageYOffset||yr[yl]||vr[yl]||$s[yl]||0})},Mn=function(t,e){return(e&&e._ctx&&e._ctx.selector||nn.utils.toArray)(t)[0]||(typeof t=="string"&&nn.config().nullTargetWarn!==!1?console.warn("Element not found:",t):null)},Wi=function(t,e){var n=e.s,i=e.sc;ua(t)&&(t=yr.scrollingElement||vr);var s=le.indexOf(t),o=i===ke.sc?1:2;!~s&&(s=le.push(t)-1),le[s+o]||Sn(t,"scroll",ih);var a=le[s+o],l=a||(le[s+o]=Sl(Xi(t,n),!0)||(ua(t)?i:Sl(function(c){return arguments.length?t[n]=c:t[n]})));return l.target=t,a||(l.smooth=nn.getProperty(t,"scrollBehavior")==="smooth"),l},Ml=function(t,e,n){var i=t,s=t,o=ca(),a=o,l=e||50,c=Math.max(500,l*3),h=function(_,p){var m=ca();p||m-o>l?(s=i,i=_,a=o,o=m):n?i+=_:i=s+(_-s)/(m-a)*(o-a)},d=function(){s=i=n?0:i,a=o=0},f=function(_){var p=a,m=s,g=ca();return(_||_===0)&&_!==i&&h(_),o===a||g-a>c?0:(i+(n?m:-m))/((n?g:o)-p)*1e3};return{update:h,reset:d,getVelocity:f}},aa=function(t,e){return e&&!t._gsapAllow&&t.preventDefault(),t.changedTouches?t.changedTouches[0]:t},Fp=function(t){var e=Math.max.apply(Math,t),n=Math.min.apply(Math,t);return Math.abs(e)>=Math.abs(n)?e:n},zp=function(){la=nn.core.globals().ScrollTrigger,la&&la.core&&Ey()},Vp=function(t){return nn=t||Bp(),!vl&&nn&&typeof document<"u"&&document.body&&(kn=window,yr=document,vr=yr.documentElement,$s=yr.body,Up=[kn,yr,vr,$s],wy=nn.utils.clamp,Op=nn.core.context||function(){},os="onpointerenter"in $s?"pointer":"mouse",Np=Fe.isTouch=kn.matchMedia&&kn.matchMedia("(hover: none), (pointer: coarse)").matches?1:"ontouchstart"in kn||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0?2:0,li=Fe.eventTypes=("ontouchstart"in vr?"touchstart,touchmove,touchcancel,touchend":"onpointerdown"in vr?"pointerdown,pointermove,pointercancel,pointerup":"mousedown,mousemove,mouseup,mouseup").split(","),setTimeout(function(){return kp=0},500),zp(),vl=1),vl};un.op=ke;le.cache=0;var Fe=function(){function r(e){this.init(e)}var t=r.prototype;return t.init=function(n){vl||Vp(nn)||console.warn("Please gsap.registerPlugin(Observer)"),la||zp();var i=n.tolerance,s=n.dragMinimum,o=n.type,a=n.target,l=n.lineHeight,c=n.debounce,h=n.preventDefault,d=n.onStop,f=n.onStopDelay,u=n.ignore,_=n.wheelSpeed,p=n.event,m=n.onDragStart,g=n.onDragEnd,b=n.onDrag,v=n.onPress,S=n.onRelease,D=n.onRight,T=n.onLeft,w=n.onUp,P=n.onDown,M=n.onChangeX,y=n.onChangeY,I=n.onChange,N=n.onToggleX,C=n.onToggleY,V=n.onHover,$=n.onHoverEnd,W=n.onMove,Z=n.ignoreCheck,z=n.isNormalizer,U=n.onGestureStart,R=n.onGestureEnd,at=n.onWheel,_t=n.onEnable,Ut=n.onDisable,X=n.onClick,ot=n.scrollSpeed,xt=n.capture,ct=n.allowClicks,Rt=n.lockAxis,kt=n.onLockAxis;this.target=a=Mn(a)||vr,this.vars=n,u&&(u=nn.utils.toArray(u)),i=i||1e-9,s=s||0,_=_||1,ot=ot||1,o=o||"wheel,touch,pointer",c=c!==!1,l||(l=parseFloat(kn.getComputedStyle($s).lineHeight)||22);var q,$t,It,Ft,bt,Et,Ht,G=this,jt=0,A=0,x=n.passive||!h,F=Wi(a,un),Y=Wi(a,ke),tt=F(),it=Y(),vt=~o.indexOf("touch")&&!~o.indexOf("pointer")&&li[0]==="pointerdown",pt=ua(a),lt=a.ownerDocument||yr,Lt=[0,0,0],ht=[0,0,0],yt=0,qt=function(){return yt=ca()},ut=function(j,dt){return(G.event=j)&&u&&~u.indexOf(j.target)||dt&&vt&&j.pointerType!=="touch"||Z&&Z(j,dt)},Tt=function(){G._vx.reset(),G._vy.reset(),$t.pause(),d&&d(G)},Wt=function(){var j=G.deltaX=Fp(Lt),dt=G.deltaY=Fp(ht),et=Math.abs(j)>=i,wt=Math.abs(dt)>=i;I&&(et||wt)&&I(G,j,dt,Lt,ht),et&&(D&&G.deltaX>0&&D(G),T&&G.deltaX<0&&T(G),M&&M(G),N&&G.deltaX<0!=jt<0&&N(G),jt=G.deltaX,Lt[0]=Lt[1]=Lt[2]=0),wt&&(P&&G.deltaY>0&&P(G),w&&G.deltaY<0&&w(G),y&&y(G),C&&G.deltaY<0!=A<0&&C(G),A=G.deltaY,ht[0]=ht[1]=ht[2]=0),(Ft||It)&&(W&&W(G),It&&(b(G),It=!1),Ft=!1),Et&&!(Et=!1)&&kt&&kt(G),bt&&(at(G),bt=!1),q=0},Zt=function(j,dt,et){Lt[et]+=j,ht[et]+=dt,G._vx.update(j),G._vy.update(dt),c?q||(q=requestAnimationFrame(Wt)):Wt()},ue=function(j,dt){Rt&&!Ht&&(G.axis=Ht=Math.abs(j)>Math.abs(dt)?"x":"y",Et=!0),Ht!=="y"&&(Lt[2]+=j,G._vx.update(j,!0)),Ht!=="x"&&(ht[2]+=dt,G._vy.update(dt,!0)),c?q||(q=requestAnimationFrame(Wt)):Wt()},Jt=function(j){if(!ut(j,1)){j=aa(j,h);var dt=j.clientX,et=j.clientY,wt=dt-G.x,ft=et-G.y,Dt=G.isDragging;G.x=dt,G.y=et,(Dt||Math.abs(G.startX-dt)>=s||Math.abs(G.startY-et)>=s)&&(b&&(It=!0),Dt||(G.isDragging=!0),ue(wt,ft),Dt||m&&m(G))}},k=G.onPress=function(O){ut(O,1)||O&&O.button||(G.axis=Ht=null,$t.pause(),G.isPressed=!0,O=aa(O),jt=A=0,G.startX=G.x=O.clientX,G.startY=G.y=O.clientY,G._vx.reset(),G._vy.reset(),Sn(z?a:lt,li[1],Jt,x,!0),G.deltaX=G.deltaY=0,v&&v(G))},Q=G.onRelease=function(O){if(!ut(O,1)){vn(z?a:lt,li[1],Jt,!0);var j=!isNaN(G.y-G.startY),dt=G.isDragging,et=dt&&(Math.abs(G.x-G.startX)>3||Math.abs(G.y-G.startY)>3),wt=aa(O);!et&&j&&(G._vx.reset(),G._vy.reset(),h&&ct&&nn.delayedCall(.08,function(){if(ca()-yt>300&&!O.defaultPrevented){if(O.target.click)O.target.click();else if(lt.createEvent){var ft=lt.createEvent("MouseEvents");ft.initMouseEvent("click",!0,!0,kn,1,wt.screenX,wt.screenY,wt.clientX,wt.clientY,!1,!1,!1,!1,0,null),O.target.dispatchEvent(ft)}}})),G.isDragging=G.isGesturing=G.isPressed=!1,d&&dt&&!z&&$t.restart(!0),g&&dt&&g(G),S&&S(G,et)}},st=function(j){return j.touches&&j.touches.length>1&&(G.isGesturing=!0)&&U(j,G.isDragging)},mt=function(){return(G.isGesturing=!1)||R(G)},gt=function(j){if(!ut(j)){var dt=F(),et=Y();Zt((dt-tt)*ot,(et-it)*ot,1),tt=dt,it=et,d&&$t.restart(!0)}},Bt=function(j){if(!ut(j)){j=aa(j,h),at&&(bt=!0);var dt=(j.deltaMode===1?l:j.deltaMode===2?kn.innerHeight:1)*_;Zt(j.deltaX*dt,j.deltaY*dt,0),d&&!z&&$t.restart(!0)}},ne=function(j){if(!ut(j)){var dt=j.clientX,et=j.clientY,wt=dt-G.x,ft=et-G.y;G.x=dt,G.y=et,Ft=!0,d&&$t.restart(!0),(wt||ft)&&ue(wt,ft)}},Mt=function(j){G.event=j,V(G)},L=function(j){G.event=j,$(G)},rt=function(j){return ut(j)||aa(j,h)&&X(G)};$t=G._dc=nn.delayedCall(f||.25,Tt).pause(),G.deltaX=G.deltaY=0,G._vx=Ml(0,50,!0),G._vy=Ml(0,50,!0),G.scrollX=F,G.scrollY=Y,G.isDragging=G.isGesturing=G.isPressed=!1,Op(this),G.enable=function(O){return G.isEnabled||(Sn(pt?lt:a,"scroll",ih),o.indexOf("scroll")>=0&&Sn(pt?lt:a,"scroll",gt,x,xt),o.indexOf("wheel")>=0&&Sn(a,"wheel",Bt,x,xt),(o.indexOf("touch")>=0&&Np||o.indexOf("pointer")>=0)&&(Sn(a,li[0],k,x,xt),Sn(lt,li[2],Q),Sn(lt,li[3],Q),ct&&Sn(a,"click",qt,!0,!0),X&&Sn(a,"click",rt),U&&Sn(lt,"gesturestart",st),R&&Sn(lt,"gestureend",mt),V&&Sn(a,os+"enter",Mt),$&&Sn(a,os+"leave",L),W&&Sn(a,os+"move",ne)),G.isEnabled=!0,O&&O.type&&k(O),_t&&_t(G)),G},G.disable=function(){G.isEnabled&&(Js.filter(function(O){return O!==G&&ua(O.target)}).length||vn(pt?lt:a,"scroll",ih),G.isPressed&&(G._vx.reset(),G._vy.reset(),vn(z?a:lt,li[1],Jt,!0)),vn(pt?lt:a,"scroll",gt,xt),vn(a,"wheel",Bt,xt),vn(a,li[0],k,xt),vn(lt,li[2],Q),vn(lt,li[3],Q),vn(a,"click",qt,!0),vn(a,"click",rt),vn(lt,"gesturestart",st),vn(lt,"gestureend",mt),vn(a,os+"enter",Mt),vn(a,os+"leave",L),vn(a,os+"move",ne),G.isEnabled=G.isPressed=G.isDragging=!1,Ut&&Ut(G))},G.kill=G.revert=function(){G.disable();var O=Js.indexOf(G);O>=0&&Js.splice(O,1),Gi===G&&(Gi=0)},Js.push(G),z&&ua(a)&&(Gi=G),G.enable(p)},by(r,[{key:"velocityX",get:function(){return this._vx.getVelocity()}},{key:"velocityY",get:function(){return this._vy.getVelocity()}}]),r}();Fe.version="3.12.5";Fe.create=function(r){return new Fe(r)};Fe.register=Vp;Fe.getAll=function(){return Js.slice()};Fe.getById=function(r){return Js.filter(function(t){return t.vars.id===r})[0]};Bp()&&nn.registerPlugin(Fe);var Ot,Qs,de,Pe,ui,Ee,sm,Bl,ba,_a,fa,bl,hn,Hl,hh,wn,Hp,Gp,to,om,rh,am,bn,fh,lm,cm,Sr,dh,xh,eo,yh,kl,ph,sh,wl=1,fn=Date.now,oh=fn(),jn=0,da=0,Wp=function(t,e,n){var i=Vn(t)&&(t.substr(0,6)==="clamp("||t.indexOf("max")>-1);return n["_"+e+"Clamp"]=i,i?t.substr(6,t.length-7):t},Xp=function(t,e){return e&&(!Vn(t)||t.substr(0,6)!=="clamp(")?"clamp("+t+")":t},Ty=function r(){return da&&requestAnimationFrame(r)},Yp=function(){return Hl=1},qp=function(){return Hl=0},Ci=function(t){return t},pa=function(t){return Math.round(t*1e5)/1e5||0},um=function(){return typeof window<"u"},hm=function(){return Ot||um()&&(Ot=window.gsap)&&Ot.registerPlugin&&Ot},fs=function(t){return!!~sm.indexOf(t)},fm=function(t){return(t==="Height"?yh:de["inner"+t])||ui["client"+t]||Ee["client"+t]},dm=function(t){return Xi(t,"getBoundingClientRect")||(fs(t)?function(){return Ol.width=de.innerWidth,Ol.height=yh,Ol}:function(){return Yi(t)})},Ay=function(t,e,n){var i=n.d,s=n.d2,o=n.a;return(o=Xi(t,"getBoundingClientRect"))?function(){return o()[i]}:function(){return(e?fm(s):t["client"+s])||0}},Dy=function(t,e){return!e||~ci.indexOf(t)?dm(t):function(){return Ol}},Ri=function(t,e){var n=e.s,i=e.d2,s=e.d,o=e.a;return Math.max(0,(n="scroll"+i)&&(o=Xi(t,n))?o()-dm(t)()[s]:fs(t)?(ui[n]||Ee[n])-fm(i):t[n]-t["offset"+i])},El=function(t,e){for(var n=0;n<to.length;n+=3)(!e||~e.indexOf(to[n+1]))&&t(to[n],to[n+1],to[n+2])},Vn=function(t){return typeof t=="string"},Tn=function(t){return typeof t=="function"},ma=function(t){return typeof t=="number"},as=function(t){return typeof t=="object"},ha=function(t,e,n){return t&&t.progress(e?0:1)&&n&&t.pause()},ah=function(t,e){if(t.enabled){var n=t._ctx?t._ctx.add(function(){return e(t)}):e(t);n&&n.totalTime&&(t.callbackAnimation=n)}},Ks=Math.abs,pm="left",mm="top",vh="right",Sh="bottom",cs="width",us="height",xa="Right",ya="Left",va="Top",Sa="Bottom",ze="padding",$n="margin",io="Width",Mh="Height",We="px",Kn=function(t){return de.getComputedStyle(t)},Cy=function(t){var e=Kn(t).position;t.style.position=e==="absolute"||e==="fixed"?e:"relative"},Zp=function(t,e){for(var n in e)n in t||(t[n]=e[n]);return t},Yi=function(t,e){var n=e&&Kn(t)[hh]!=="matrix(1, 0, 0, 1, 0, 0)"&&Ot.to(t,{x:0,y:0,xPercent:0,yPercent:0,rotation:0,rotationX:0,rotationY:0,scale:1,skewX:0,skewY:0}).progress(1),i=t.getBoundingClientRect();return n&&n.progress(0).kill(),i},zl=function(t,e){var n=e.d2;return t["offset"+n]||t["client"+n]||0},gm=function(t){var e=[],n=t.labels,i=t.duration(),s;for(s in n)e.push(n[s]/i);return e},Ry=function(t){return function(e){return Ot.utils.snap(gm(t),e)}},bh=function(t){var e=Ot.utils.snap(t),n=Array.isArray(t)&&t.slice(0).sort(function(i,s){return i-s});return n?function(i,s,o){o===void 0&&(o=.001);var a;if(!s)return e(i);if(s>0){for(i-=o,a=0;a<n.length;a++)if(n[a]>=i)return n[a];return n[a-1]}else for(a=n.length,i+=o;a--;)if(n[a]<=i)return n[a];return n[0]}:function(i,s,o){o===void 0&&(o=.001);var a=e(i);return!s||Math.abs(a-i)<o||a-i<0==s<0?a:e(s<0?i-t:i+t)}},Py=function(t){return function(e,n){return bh(gm(t))(e,n.direction)}},Tl=function(t,e,n,i){return n.split(",").forEach(function(s){return t(e,s,i)})},Ke=function(t,e,n,i,s){return t.addEventListener(e,n,{passive:!i,capture:!!s})},$e=function(t,e,n,i){return t.removeEventListener(e,n,!!i)},Al=function(t,e,n){n=n&&n.wheelHandler,n&&(t(e,"wheel",n),t(e,"touchmove",n))},Jp={startColor:"green",endColor:"red",indent:0,fontSize:"16px",fontWeight:"normal"},Dl={toggleActions:"play",anticipatePin:0},Vl={top:0,left:0,center:.5,bottom:1,right:1},Ll=function(t,e){if(Vn(t)){var n=t.indexOf("="),i=~n?+(t.charAt(n-1)+1)*parseFloat(t.substr(n+1)):0;~n&&(t.indexOf("%")>n&&(i*=e/100),t=t.substr(0,n-1)),t=i+(t in Vl?Vl[t]*e:~t.indexOf("%")?parseFloat(t)*e/100:parseFloat(t)||0)}return t},Cl=function(t,e,n,i,s,o,a,l){var c=s.startColor,h=s.endColor,d=s.fontSize,f=s.indent,u=s.fontWeight,_=Pe.createElement("div"),p=fs(n)||Xi(n,"pinType")==="fixed",m=t.indexOf("scroller")!==-1,g=p?Ee:n,b=t.indexOf("start")!==-1,v=b?c:h,S="border-color:"+v+";font-size:"+d+";color:"+v+";font-weight:"+u+";pointer-events:none;white-space:nowrap;font-family:sans-serif,Arial;z-index:1000;padding:4px 8px;border-width:0;border-style:solid;";return S+="position:"+((m||l)&&p?"fixed;":"absolute;"),(m||l||!p)&&(S+=(i===ke?vh:Sh)+":"+(o+parseFloat(f))+"px;"),a&&(S+="box-sizing:border-box;text-align:left;width:"+a.offsetWidth+"px;"),_._isStart=b,_.setAttribute("class","gsap-marker-"+t+(e?" marker-"+e:"")),_.style.cssText=S,_.innerText=e||e===0?t+"-"+e:t,g.children[0]?g.insertBefore(_,g.children[0]):g.appendChild(_),_._offset=_["offset"+i.op.d2],Fl(_,0,i,b),_},Fl=function(t,e,n,i){var s={display:"block"},o=n[i?"os2":"p2"],a=n[i?"p2":"os2"];t._isFlipped=i,s[n.a+"Percent"]=i?-100:0,s[n.a]=i?"1px":0,s["border"+o+io]=1,s["border"+a+io]=0,s[n.p]=e+"px",Ot.set(t,s)},ce=[],mh={},wa,$p=function(){return fn()-jn>34&&(wa||(wa=requestAnimationFrame(qi)))},js=function(){(!bn||!bn.isPressed||bn.startX>Ee.clientWidth)&&(le.cache++,bn?wa||(wa=requestAnimationFrame(qi)):qi(),jn||ps("scrollStart"),jn=fn())},lh=function(){cm=de.innerWidth,lm=de.innerHeight},ga=function(){le.cache++,!hn&&!am&&!Pe.fullscreenElement&&!Pe.webkitFullscreenElement&&(!fh||cm!==de.innerWidth||Math.abs(de.innerHeight-lm)>de.innerHeight*.25)&&Bl.restart(!0)},ds={},Iy=[],_m=function r(){return $e(Yt,"scrollEnd",r)||ls(!0)},ps=function(t){return ds[t]&&ds[t].map(function(e){return e()})||Iy},zn=[],xm=function(t){for(var e=0;e<zn.length;e+=5)(!t||zn[e+4]&&zn[e+4].query===t)&&(zn[e].style.cssText=zn[e+1],zn[e].getBBox&&zn[e].setAttribute("transform",zn[e+2]||""),zn[e+3].uncache=1)},wh=function(t,e){var n;for(wn=0;wn<ce.length;wn++)n=ce[wn],n&&(!e||n._ctx===e)&&(t?n.kill(1):n.revert(!0,!0));kl=!0,e&&xm(e),e||ps("revert")},ym=function(t,e){le.cache++,(e||!En)&&le.forEach(function(n){return Tn(n)&&n.cacheID++&&(n.rec=0)}),Vn(t)&&(de.history.scrollRestoration=xh=t)},En,hs=0,Kp,Ly=function(){if(Kp!==hs){var t=Kp=hs;requestAnimationFrame(function(){return t===hs&&ls(!0)})}},vm=function(){Ee.appendChild(eo),yh=!bn&&eo.offsetHeight||de.innerHeight,Ee.removeChild(eo)},jp=function(t){return ba(".gsap-marker-start, .gsap-marker-end, .gsap-marker-scroller-start, .gsap-marker-scroller-end").forEach(function(e){return e.style.display=t?"none":"block"})},ls=function(t,e){if(jn&&!t&&!kl){Ke(Yt,"scrollEnd",_m);return}vm(),En=Yt.isRefreshing=!0,le.forEach(function(i){return Tn(i)&&++i.cacheID&&(i.rec=i())});var n=ps("refreshInit");om&&Yt.sort(),e||wh(),le.forEach(function(i){Tn(i)&&(i.smooth&&(i.target.style.scrollBehavior="auto"),i(0))}),ce.slice(0).forEach(function(i){return i.refresh()}),kl=!1,ce.forEach(function(i){if(i._subPinOffset&&i.pin){var s=i.vars.horizontal?"offsetWidth":"offsetHeight",o=i.pin[s];i.revert(!0,1),i.adjustPinSpacing(i.pin[s]-o),i.refresh()}}),ph=1,jp(!0),ce.forEach(function(i){var s=Ri(i.scroller,i._dir),o=i.vars.end==="max"||i._endClamp&&i.end>s,a=i._startClamp&&i.start>=s;(o||a)&&i.setPositions(a?s-1:i.start,o?Math.max(a?s:i.start+1,s):i.end,!0)}),jp(!1),ph=0,n.forEach(function(i){return i&&i.render&&i.render(-1)}),le.forEach(function(i){Tn(i)&&(i.smooth&&requestAnimationFrame(function(){return i.target.style.scrollBehavior="smooth"}),i.rec&&i(i.rec))}),ym(xh,1),Bl.pause(),hs++,En=2,qi(2),ce.forEach(function(i){return Tn(i.vars.onRefresh)&&i.vars.onRefresh(i)}),En=Yt.isRefreshing=!1,ps("refresh")},gh=0,Nl=1,Ma,qi=function(t){if(t===2||!En&&!kl){Yt.isUpdating=!0,Ma&&Ma.update(0);var e=ce.length,n=fn(),i=n-oh>=50,s=e&&ce[0].scroll();if(Nl=gh>s?-1:1,En||(gh=s),i&&(jn&&!Hl&&n-jn>200&&(jn=0,ps("scrollEnd")),fa=oh,oh=n),Nl<0){for(wn=e;wn-- >0;)ce[wn]&&ce[wn].update(0,i);Nl=1}else for(wn=0;wn<e;wn++)ce[wn]&&ce[wn].update(0,i);Yt.isUpdating=!1}wa=0},_h=[pm,mm,Sh,vh,$n+Sa,$n+xa,$n+va,$n+ya,"display","flexShrink","float","zIndex","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd","gridArea","justifySelf","alignSelf","placeSelf","order"],Ul=_h.concat([cs,us,"boxSizing","max"+io,"max"+Mh,"position",$n,ze,ze+va,ze+xa,ze+Sa,ze+ya]),Fy=function(t,e,n){no(n);var i=t._gsap;if(i.spacerIsNative)no(i.spacerState);else if(t._gsap.swappedIn){var s=e.parentNode;s&&(s.insertBefore(t,e),s.removeChild(e))}t._gsap.swappedIn=!1},ch=function(t,e,n,i){if(!t._gsap.swappedIn){for(var s=_h.length,o=e.style,a=t.style,l;s--;)l=_h[s],o[l]=n[l];o.position=n.position==="absolute"?"absolute":"relative",n.display==="inline"&&(o.display="inline-block"),a[Sh]=a[vh]="auto",o.flexBasis=n.flexBasis||"auto",o.overflow="visible",o.boxSizing="border-box",o[cs]=zl(t,un)+We,o[us]=zl(t,ke)+We,o[ze]=a[$n]=a[mm]=a[pm]="0",no(i),a[cs]=a["max"+io]=n[cs],a[us]=a["max"+Mh]=n[us],a[ze]=n[ze],t.parentNode!==e&&(t.parentNode.insertBefore(e,t),e.appendChild(t)),t._gsap.swappedIn=!0}},Ny=/([A-Z])/g,no=function(t){if(t){var e=t.t.style,n=t.length,i=0,s,o;for((t.t._gsap||Ot.core.getCache(t.t)).uncache=1;i<n;i+=2)o=t[i+1],s=t[i],o?e[s]=o:e[s]&&e.removeProperty(s.replace(Ny,"-$1").toLowerCase())}},Rl=function(t){for(var e=Ul.length,n=t.style,i=[],s=0;s<e;s++)i.push(Ul[s],n[Ul[s]]);return i.t=t,i},Uy=function(t,e,n){for(var i=[],s=t.length,o=n?8:0,a;o<s;o+=2)a=t[o],i.push(a,a in e?e[a]:t[o+1]);return i.t=t.t,i},Ol={left:0,top:0},Qp=function(t,e,n,i,s,o,a,l,c,h,d,f,u,_){Tn(t)&&(t=t(l)),Vn(t)&&t.substr(0,3)==="max"&&(t=f+(t.charAt(4)==="="?Ll("0"+t.substr(3),n):0));var p=u?u.time():0,m,g,b;if(u&&u.seek(0),isNaN(t)||(t=+t),ma(t))u&&(t=Ot.utils.mapRange(u.scrollTrigger.start,u.scrollTrigger.end,0,f,t)),a&&Fl(a,n,i,!0);else{Tn(e)&&(e=e(l));var v=(t||"0").split(" "),S,D,T,w;b=Mn(e,l)||Ee,S=Yi(b)||{},(!S||!S.left&&!S.top)&&Kn(b).display==="none"&&(w=b.style.display,b.style.display="block",S=Yi(b),w?b.style.display=w:b.style.removeProperty("display")),D=Ll(v[0],S[i.d]),T=Ll(v[1]||"0",n),t=S[i.p]-c[i.p]-h+D+s-T,a&&Fl(a,T,i,n-T<20||a._isStart&&T>20),n-=n-T}if(_&&(l[_]=t||-.001,t<0&&(t=0)),o){var P=t+n,M=o._isStart;m="scroll"+i.d2,Fl(o,P,i,M&&P>20||!M&&(d?Math.max(Ee[m],ui[m]):o.parentNode[m])<=P+1),d&&(c=Yi(a),d&&(o.style[i.op.p]=c[i.op.p]-i.op.m-o._offset+We))}return u&&b&&(m=Yi(b),u.seek(f),g=Yi(b),u._caScrollDist=m[i.p]-g[i.p],t=t/u._caScrollDist*f),u&&u.seek(p),u?t:Math.round(t)},Oy=/(webkit|moz|length|cssText|inset)/i,tm=function(t,e,n,i){if(t.parentNode!==e){var s=t.style,o,a;if(e===Ee){t._stOrig=s.cssText,a=Kn(t);for(o in a)!+o&&!Oy.test(o)&&a[o]&&typeof s[o]=="string"&&o!=="0"&&(s[o]=a[o]);s.top=n,s.left=i}else s.cssText=t._stOrig;Ot.core.getCache(t).uncache=1,e.appendChild(t)}},Sm=function(t,e,n){var i=e,s=i;return function(o){var a=Math.round(t());return a!==i&&a!==s&&Math.abs(a-i)>3&&Math.abs(a-s)>3&&(o=a,n&&n()),s=i,i=o,o}},Pl=function(t,e,n){var i={};i[e.p]="+="+n,Ot.set(t,i)},em=function(t,e){var n=Wi(t,e),i="_scroll"+e.p2,s=function o(a,l,c,h,d){var f=o.tween,u=l.onComplete,_={};c=c||n();var p=Sm(n,c,function(){f.kill(),o.tween=0});return d=h&&d||0,h=h||a-c,f&&f.kill(),l[i]=a,l.inherit=!1,l.modifiers=_,_[i]=function(){return p(c+h*f.ratio+d*f.ratio*f.ratio)},l.onUpdate=function(){le.cache++,o.tween&&qi()},l.onComplete=function(){o.tween=0,u&&u.call(f)},f=o.tween=Ot.to(t,l),f};return t[i]=n,n.wheelHandler=function(){return s.tween&&s.tween.kill()&&(s.tween=0)},Ke(t,"wheel",n.wheelHandler),Yt.isTouch&&Ke(t,"touchmove",n.wheelHandler),s},Yt=function(){function r(e,n){Qs||r.register(Ot)||console.warn("Please gsap.registerPlugin(ScrollTrigger)"),dh(this),this.init(e,n)}var t=r.prototype;return t.init=function(n,i){if(this.progress=this.start=0,this.vars&&this.kill(!0,!0),!da){this.update=this.refresh=this.kill=Ci;return}n=Zp(Vn(n)||ma(n)||n.nodeType?{trigger:n}:n,Dl);var s=n,o=s.onUpdate,a=s.toggleClass,l=s.id,c=s.onToggle,h=s.onRefresh,d=s.scrub,f=s.trigger,u=s.pin,_=s.pinSpacing,p=s.invalidateOnRefresh,m=s.anticipatePin,g=s.onScrubComplete,b=s.onSnapComplete,v=s.once,S=s.snap,D=s.pinReparent,T=s.pinSpacer,w=s.containerAnimation,P=s.fastScrollEnd,M=s.preventOverlaps,y=n.horizontal||n.containerAnimation&&n.horizontal!==!1?un:ke,I=!d&&d!==0,N=Mn(n.scroller||de),C=Ot.core.getCache(N),V=fs(N),$=("pinType"in n?n.pinType:Xi(N,"pinType")||V&&"fixed")==="fixed",W=[n.onEnter,n.onLeave,n.onEnterBack,n.onLeaveBack],Z=I&&n.toggleActions.split(" "),z="markers"in n?n.markers:Dl.markers,U=V?0:parseFloat(Kn(N)["border"+y.p2+io])||0,R=this,at=n.onRefreshInit&&function(){return n.onRefreshInit(R)},_t=Ay(N,V,y),Ut=Dy(N,V),X=0,ot=0,xt=0,ct=Wi(N,y),Rt,kt,q,$t,It,Ft,bt,Et,Ht,G,jt,A,x,F,Y,tt,it,vt,pt,lt,Lt,ht,yt,qt,ut,Tt,Wt,Zt,ue,Jt,k,Q,st,mt,gt,Bt,ne,Mt,L;if(R._startClamp=R._endClamp=!1,R._dir=y,m*=45,R.scroller=N,R.scroll=w?w.time.bind(w):ct,$t=ct(),R.vars=n,i=i||n.animation,"refreshPriority"in n&&(om=1,n.refreshPriority===-9999&&(Ma=R)),C.tweenScroll=C.tweenScroll||{top:em(N,ke),left:em(N,un)},R.tweenTo=Rt=C.tweenScroll[y.p],R.scrubDuration=function(et){st=ma(et)&&et,st?Q?Q.duration(et):Q=Ot.to(i,{ease:"expo",totalProgress:"+=0",inherit:!1,duration:st,paused:!0,onComplete:function(){return g&&g(R)}}):(Q&&Q.progress(1).kill(),Q=0)},i&&(i.vars.lazy=!1,i._initted&&!R.isReverted||i.vars.immediateRender!==!1&&n.immediateRender!==!1&&i.duration()&&i.render(0,!0,!0),R.animation=i.pause(),i.scrollTrigger=R,R.scrubDuration(d),Jt=0,l||(l=i.vars.id)),S&&((!as(S)||S.push)&&(S={snapTo:S}),"scrollBehavior"in Ee.style&&Ot.set(V?[Ee,ui]:N,{scrollBehavior:"auto"}),le.forEach(function(et){return Tn(et)&&et.target===(V?Pe.scrollingElement||ui:N)&&(et.smooth=!1)}),q=Tn(S.snapTo)?S.snapTo:S.snapTo==="labels"?Ry(i):S.snapTo==="labelsDirectional"?Py(i):S.directional!==!1?function(et,wt){return bh(S.snapTo)(et,fn()-ot<500?0:wt.direction)}:Ot.utils.snap(S.snapTo),mt=S.duration||{min:.1,max:2},mt=as(mt)?_a(mt.min,mt.max):_a(mt,mt),gt=Ot.delayedCall(S.delay||st/2||.1,function(){var et=ct(),wt=fn()-ot<500,ft=Rt.tween;if((wt||Math.abs(R.getVelocity())<10)&&!ft&&!Hl&&X!==et){var Dt=(et-Ft)/F,zt=i&&!I?i.totalProgress():Dt,Nt=wt?0:(zt-k)/(fn()-fa)*1e3||0,ee=Ot.utils.clamp(-Dt,1-Dt,Ks(Nt/2)*Nt/.185),he=Dt+(S.inertia===!1?0:ee),me,ae,E=S,B=E.onStart,H=E.onInterrupt,K=E.onComplete;if(me=q(he,R),ma(me)||(me=he),ae=Math.round(Ft+me*F),et<=bt&&et>=Ft&&ae!==et){if(ft&&!ft._initted&&ft.data<=Ks(ae-et))return;S.inertia===!1&&(ee=me-Dt),Rt(ae,{duration:mt(Ks(Math.max(Ks(he-zt),Ks(me-zt))*.185/Nt/.05||0)),ease:S.ease||"power3",data:Ks(ae-et),onInterrupt:function(){return gt.restart(!0)&&H&&H(R)},onComplete:function(){R.update(),X=ct(),i&&(Q?Q.resetTo("totalProgress",me,i._tTime/i._tDur):i.progress(me)),Jt=k=i&&!I?i.totalProgress():R.progress,b&&b(R),K&&K(R)}},et,ee*F,ae-et-ee*F),B&&B(R,Rt.tween)}}else R.isActive&&X!==et&>.restart(!0)}).pause()),l&&(mh[l]=R),f=R.trigger=Mn(f||u!==!0&&u),L=f&&f._gsap&&f._gsap.stRevert,L&&(L=L(R)),u=u===!0?f:Mn(u),Vn(a)&&(a={targets:f,className:a}),u&&(_===!1||_===$n||(_=!_&&u.parentNode&&u.parentNode.style&&Kn(u.parentNode).display==="flex"?!1:ze),R.pin=u,kt=Ot.core.getCache(u),kt.spacer?Y=kt.pinState:(T&&(T=Mn(T),T&&!T.nodeType&&(T=T.current||T.nativeElement),kt.spacerIsNative=!!T,T&&(kt.spacerState=Rl(T))),kt.spacer=vt=T||Pe.createElement("div"),vt.classList.add("pin-spacer"),l&&vt.classList.add("pin-spacer-"+l),kt.pinState=Y=Rl(u)),n.force3D!==!1&&Ot.set(u,{force3D:!0}),R.spacer=vt=kt.spacer,ue=Kn(u),qt=ue[_+y.os2],lt=Ot.getProperty(u),Lt=Ot.quickSetter(u,y.a,We),ch(u,vt,ue),it=Rl(u)),z){A=as(z)?Zp(z,Jp):Jp,G=Cl("scroller-start",l,N,y,A,0),jt=Cl("scroller-end",l,N,y,A,0,G),pt=G["offset"+y.op.d2];var rt=Mn(Xi(N,"content")||N);Et=this.markerStart=Cl("start",l,rt,y,A,pt,0,w),Ht=this.markerEnd=Cl("end",l,rt,y,A,pt,0,w),w&&(Mt=Ot.quickSetter([Et,Ht],y.a,We)),!$&&!(ci.length&&Xi(N,"fixedMarkers")===!0)&&(Cy(V?Ee:N),Ot.set([G,jt],{force3D:!0}),Tt=Ot.quickSetter(G,y.a,We),Zt=Ot.quickSetter(jt,y.a,We))}if(w){var O=w.vars.onUpdate,j=w.vars.onUpdateParams;w.eventCallback("onUpdate",function(){R.update(0,0,1),O&&O.apply(w,j||[])})}if(R.previous=function(){return ce[ce.indexOf(R)-1]},R.next=function(){return ce[ce.indexOf(R)+1]},R.revert=function(et,wt){if(!wt)return R.kill(!0);var ft=et!==!1||!R.enabled,Dt=hn;ft!==R.isReverted&&(ft&&(Bt=Math.max(ct(),R.scroll.rec||0),xt=R.progress,ne=i&&i.progress()),Et&&[Et,Ht,G,jt].forEach(function(zt){return zt.style.display=ft?"none":"block"}),ft&&(hn=R,R.update(ft)),u&&(!D||!R.isActive)&&(ft?Fy(u,vt,Y):ch(u,vt,Kn(u),ut)),ft||R.update(ft),hn=Dt,R.isReverted=ft)},R.refresh=function(et,wt,ft,Dt){if(!((hn||!R.enabled)&&!wt)){if(u&&et&&jn){Ke(r,"scrollEnd",_m);return}!En&&at&&at(R),hn=R,Rt.tween&&!ft&&(Rt.tween.kill(),Rt.tween=0),Q&&Q.pause(),p&&i&&i.revert({kill:!1}).invalidate(),R.isReverted||R.revert(!0,!0),R._subPinOffset=!1;var zt=_t(),Nt=Ut(),ee=w?w.duration():Ri(N,y),he=F<=.01,me=0,ae=Dt||0,E=as(ft)?ft.end:n.end,B=n.endTrigger||f,H=as(ft)?ft.start:n.start||(n.start===0||!f?0:u?"0 0":"0 100%"),K=R.pinnedContainer=n.pinnedContainer&&Mn(n.pinnedContainer,R),J=f&&Math.max(0,ce.indexOf(R))||0,St=J,At,Pt,Xt,te,Gt,Vt,xe,Be,sn,_n,ie,Qt,bi;for(z&&as(ft)&&(Qt=Ot.getProperty(G,y.p),bi=Ot.getProperty(jt,y.p));St--;)Vt=ce[St],Vt.end||Vt.refresh(0,1)||(hn=R),xe=Vt.pin,xe&&(xe===f||xe===u||xe===K)&&!Vt.isReverted&&(_n||(_n=[]),_n.unshift(Vt),Vt.revert(!0,!0)),Vt!==ce[St]&&(J--,St--);for(Tn(H)&&(H=H(R)),H=Wp(H,"start",R),Ft=Qp(H,f,zt,y,ct(),Et,G,R,Nt,U,$,ee,w,R._startClamp&&"_startClamp")||(u?-.001:0),Tn(E)&&(E=E(R)),Vn(E)&&!E.indexOf("+=")&&(~E.indexOf(" ")?E=(Vn(H)?H.split(" ")[0]:"")+E:(me=Ll(E.substr(2),zt),E=Vn(H)?H:(w?Ot.utils.mapRange(0,w.duration(),w.scrollTrigger.start,w.scrollTrigger.end,Ft):Ft)+me,B=f)),E=Wp(E,"end",R),bt=Math.max(Ft,Qp(E||(B?"100% 0":ee),B,zt,y,ct()+me,Ht,jt,R,Nt,U,$,ee,w,R._endClamp&&"_endClamp"))||-.001,me=0,St=J;St--;)Vt=ce[St],xe=Vt.pin,xe&&Vt.start-Vt._pinPush<=Ft&&!w&&Vt.end>0&&(At=Vt.end-(R._startClamp?Math.max(0,Vt.start):Vt.start),(xe===f&&Vt.start-Vt._pinPush<Ft||xe===K)&&isNaN(H)&&(me+=At*(1-Vt.progress)),xe===u&&(ae+=At));if(Ft+=me,bt+=me,R._startClamp&&(R._startClamp+=me),R._endClamp&&!En&&(R._endClamp=bt||-.001,bt=Math.min(bt,Ri(N,y))),F=bt-Ft||(Ft-=.01)&&.001,he&&(xt=Ot.utils.clamp(0,1,Ot.utils.normalize(Ft,bt,Bt))),R._pinPush=ae,Et&&me&&(At={},At[y.a]="+="+me,K&&(At[y.p]="-="+ct()),Ot.set([Et,Ht],At)),u&&!(ph&&R.end>=Ri(N,y)))At=Kn(u),te=y===ke,Xt=ct(),ht=parseFloat(lt(y.a))+ae,!ee&&bt>1&&(ie=(V?Pe.scrollingElement||ui:N).style,ie={style:ie,value:ie["overflow"+y.a.toUpperCase()]},V&&Kn(Ee)["overflow"+y.a.toUpperCase()]!=="scroll"&&(ie.style["overflow"+y.a.toUpperCase()]="scroll")),ch(u,vt,At),it=Rl(u),Pt=Yi(u,!0),Be=$&&Wi(N,te?un:ke)(),_?(ut=[_+y.os2,F+ae+We],ut.t=vt,St=_===ze?zl(u,y)+F+ae:0,St&&(ut.push(y.d,St+We),vt.style.flexBasis!=="auto"&&(vt.style.flexBasis=St+We)),no(ut),K&&ce.forEach(function(ve){ve.pin===K&&ve.vars.pinSpacing!==!1&&(ve._subPinOffset=!0)}),$&&ct(Bt)):(St=zl(u,y),St&&vt.style.flexBasis!=="auto"&&(vt.style.flexBasis=St+We)),$&&(Gt={top:Pt.top+(te?Xt-Ft:Be)+We,left:Pt.left+(te?Be:Xt-Ft)+We,boxSizing:"border-box",position:"fixed"},Gt[cs]=Gt["max"+io]=Math.ceil(Pt.width)+We,Gt[us]=Gt["max"+Mh]=Math.ceil(Pt.height)+We,Gt[$n]=Gt[$n+va]=Gt[$n+xa]=Gt[$n+Sa]=Gt[$n+ya]="0",Gt[ze]=At[ze],Gt[ze+va]=At[ze+va],Gt[ze+xa]=At[ze+xa],Gt[ze+Sa]=At[ze+Sa],Gt[ze+ya]=At[ze+ya],tt=Uy(Y,Gt,D),En&&ct(0)),i?(sn=i._initted,rh(1),i.render(i.duration(),!0,!0),yt=lt(y.a)-ht+F+ae,Wt=Math.abs(F-yt)>1,$&&Wt&&tt.splice(tt.length-2,2),i.render(0,!0,!0),sn||i.invalidate(!0),i.parent||i.totalTime(i.totalTime()),rh(0)):yt=F,ie&&(ie.value?ie.style["overflow"+y.a.toUpperCase()]=ie.value:ie.style.removeProperty("overflow-"+y.a));else if(f&&ct()&&!w)for(Pt=f.parentNode;Pt&&Pt!==Ee;)Pt._pinOffset&&(Ft-=Pt._pinOffset,bt-=Pt._pinOffset),Pt=Pt.parentNode;_n&&_n.forEach(function(ve){return ve.revert(!1,!0)}),R.start=Ft,R.end=bt,$t=It=En?Bt:ct(),!w&&!En&&($t<Bt&&ct(Bt),R.scroll.rec=0),R.revert(!1,!0),ot=fn(),gt&&(X=-1,gt.restart(!0)),hn=0,i&&I&&(i._initted||ne)&&i.progress()!==ne&&i.progress(ne||0,!0).render(i.time(),!0,!0),(he||xt!==R.progress||w||p)&&(i&&!I&&i.totalProgress(w&&Ft<-.001&&!xt?Ot.utils.normalize(Ft,bt,0):xt,!0),R.progress=he||($t-Ft)/F===xt?0:xt),u&&_&&(vt._pinOffset=Math.round(R.progress*yt)),Q&&Q.invalidate(),isNaN(Qt)||(Qt-=Ot.getProperty(G,y.p),bi-=Ot.getProperty(jt,y.p),Pl(G,y,Qt),Pl(Et,y,Qt-(Dt||0)),Pl(jt,y,bi),Pl(Ht,y,bi-(Dt||0))),he&&!En&&R.update(),h&&!En&&!x&&(x=!0,h(R),x=!1)}},R.getVelocity=function(){return(ct()-It)/(fn()-fa)*1e3||0},R.endAnimation=function(){ha(R.callbackAnimation),i&&(Q?Q.progress(1):i.paused()?I||ha(i,R.direction<0,1):ha(i,i.reversed()))},R.labelToScroll=function(et){return i&&i.labels&&(Ft||R.refresh()||Ft)+i.labels[et]/i.duration()*F||0},R.getTrailing=function(et){var wt=ce.indexOf(R),ft=R.direction>0?ce.slice(0,wt).reverse():ce.slice(wt+1);return(Vn(et)?ft.filter(function(Dt){return Dt.vars.preventOverlaps===et}):ft).filter(function(Dt){return R.direction>0?Dt.end<=Ft:Dt.start>=bt})},R.update=function(et,wt,ft){if(!(w&&!ft&&!et)){var Dt=En===!0?Bt:R.scroll(),zt=et?0:(Dt-Ft)/F,Nt=zt<0?0:zt>1?1:zt||0,ee=R.progress,he,me,ae,E,B,H,K,J;if(wt&&(It=$t,$t=w?ct():Dt,S&&(k=Jt,Jt=i&&!I?i.totalProgress():Nt)),m&&u&&!hn&&!wl&&jn&&(!Nt&&Ft<Dt+(Dt-It)/(fn()-fa)*m?Nt=1e-4:Nt===1&&bt>Dt+(Dt-It)/(fn()-fa)*m&&(Nt=.9999)),Nt!==ee&&R.enabled){if(he=R.isActive=!!Nt&&Nt<1,me=!!ee&&ee<1,H=he!==me,B=H||!!Nt!=!!ee,R.direction=Nt>ee?1:-1,R.progress=Nt,B&&!hn&&(ae=Nt&&!ee?0:Nt===1?1:ee===1?2:3,I&&(E=!H&&Z[ae+1]!=="none"&&Z[ae+1]||Z[ae],J=i&&(E==="complete"||E==="reset"||E in i))),M&&(H||J)&&(J||d||!i)&&(Tn(M)?M(R):R.getTrailing(M).forEach(function(Xt){return Xt.endAnimation()})),I||(Q&&!hn&&!wl?(Q._dp._time-Q._start!==Q._time&&Q.render(Q._dp._time-Q._start),Q.resetTo?Q.resetTo("totalProgress",Nt,i._tTime/i._tDur):(Q.vars.totalProgress=Nt,Q.invalidate().restart())):i&&i.totalProgress(Nt,!!(hn&&(ot||et)))),u){if(et&&_&&(vt.style[_+y.os2]=qt),!$)Lt(pa(ht+yt*Nt));else if(B){if(K=!et&&Nt>ee&&bt+1>Dt&&Dt+1>=Ri(N,y),D)if(!et&&(he||K)){var St=Yi(u,!0),At=Dt-Ft;tm(u,Ee,St.top+(y===ke?At:0)+We,St.left+(y===ke?0:At)+We)}else tm(u,vt);no(he||K?tt:it),Wt&&Nt<1&&he||Lt(ht+(Nt===1&&!K?yt:0))}}S&&!Rt.tween&&!hn&&!wl&>.restart(!0),a&&(H||v&&Nt&&(Nt<1||!sh))&&ba(a.targets).forEach(function(Xt){return Xt.classList[he||v?"add":"remove"](a.className)}),o&&!I&&!et&&o(R),B&&!hn?(I&&(J&&(E==="complete"?i.pause().totalProgress(1):E==="reset"?i.restart(!0).pause():E==="restart"?i.restart(!0):i[E]()),o&&o(R)),(H||!sh)&&(c&&H&&ah(R,c),W[ae]&&ah(R,W[ae]),v&&(Nt===1?R.kill(!1,1):W[ae]=0),H||(ae=Nt===1?1:3,W[ae]&&ah(R,W[ae]))),P&&!he&&Math.abs(R.getVelocity())>(ma(P)?P:2500)&&(ha(R.callbackAnimation),Q?Q.progress(1):ha(i,E==="reverse"?1:!Nt,1))):I&&o&&!hn&&o(R)}if(Zt){var Pt=w?Dt/w.duration()*(w._caScrollDist||0):Dt;Tt(Pt+(G._isFlipped?1:0)),Zt(Pt)}Mt&&Mt(-Dt/w.duration()*(w._caScrollDist||0))}},R.enable=function(et,wt){R.enabled||(R.enabled=!0,Ke(N,"resize",ga),V||Ke(N,"scroll",js),at&&Ke(r,"refreshInit",at),et!==!1&&(R.progress=xt=0,$t=It=X=ct()),wt!==!1&&R.refresh())},R.getTween=function(et){return et&&Rt?Rt.tween:Q},R.setPositions=function(et,wt,ft,Dt){if(w){var zt=w.scrollTrigger,Nt=w.duration(),ee=zt.end-zt.start;et=zt.start+ee*et/Nt,wt=zt.start+ee*wt/Nt}R.refresh(!1,!1,{start:Xp(et,ft&&!!R._startClamp),end:Xp(wt,ft&&!!R._endClamp)},Dt),R.update()},R.adjustPinSpacing=function(et){if(ut&&et){var wt=ut.indexOf(y.d)+1;ut[wt]=parseFloat(ut[wt])+et+We,ut[1]=parseFloat(ut[1])+et+We,no(ut)}},R.disable=function(et,wt){if(R.enabled&&(et!==!1&&R.revert(!0,!0),R.enabled=R.isActive=!1,wt||Q&&Q.pause(),Bt=0,kt&&(kt.uncache=1),at&&$e(r,"refreshInit",at),gt&&(gt.pause(),Rt.tween&&Rt.tween.kill()&&(Rt.tween=0)),!V)){for(var ft=ce.length;ft--;)if(ce[ft].scroller===N&&ce[ft]!==R)return;$e(N,"resize",ga),V||$e(N,"scroll",js)}},R.kill=function(et,wt){R.disable(et,wt),Q&&!wt&&Q.kill(),l&&delete mh[l];var ft=ce.indexOf(R);ft>=0&&ce.splice(ft,1),ft===wn&&Nl>0&&wn--,ft=0,ce.forEach(function(Dt){return Dt.scroller===R.scroller&&(ft=1)}),ft||En||(R.scroll.rec=0),i&&(i.scrollTrigger=null,et&&i.revert({kill:!1}),wt||i.kill()),Et&&[Et,Ht,G,jt].forEach(function(Dt){return Dt.parentNode&&Dt.parentNode.removeChild(Dt)}),Ma===R&&(Ma=0),u&&(kt&&(kt.uncache=1),ft=0,ce.forEach(function(Dt){return Dt.pin===u&&ft++}),ft||(kt.spacer=0)),n.onKill&&n.onKill(R)},ce.push(R),R.enable(!1,!1),L&&L(R),i&&i.add&&!F){var dt=R.update;R.update=function(){R.update=dt,Ft||bt||R.refresh()},Ot.delayedCall(.01,R.update),F=.01,Ft=bt=0}else R.refresh();u&&Ly()},r.register=function(n){return Qs||(Ot=n||hm(),um()&&window.document&&r.enable(),Qs=da),Qs},r.defaults=function(n){if(n)for(var i in n)Dl[i]=n[i];return Dl},r.disable=function(n,i){da=0,ce.forEach(function(o){return o[i?"kill":"disable"](n)}),$e(de,"wheel",js),$e(Pe,"scroll",js),clearInterval(bl),$e(Pe,"touchcancel",Ci),$e(Ee,"touchstart",Ci),Tl($e,Pe,"pointerdown,touchstart,mousedown",Yp),Tl($e,Pe,"pointerup,touchend,mouseup",qp),Bl.kill(),El($e);for(var s=0;s<le.length;s+=3)Al($e,le[s],le[s+1]),Al($e,le[s],le[s+2])},r.enable=function(){if(de=window,Pe=document,ui=Pe.documentElement,Ee=Pe.body,Ot&&(ba=Ot.utils.toArray,_a=Ot.utils.clamp,dh=Ot.core.context||Ci,rh=Ot.core.suppressOverwrites||Ci,xh=de.history.scrollRestoration||"auto",gh=de.pageYOffset,Ot.core.globals("ScrollTrigger",r),Ee)){da=1,eo=document.createElement("div"),eo.style.height="100vh",eo.style.position="absolute",vm(),Ty(),Fe.register(Ot),r.isTouch=Fe.isTouch,Sr=Fe.isTouch&&/(iPad|iPhone|iPod|Mac)/g.test(navigator.userAgent),fh=Fe.isTouch===1,Ke(de,"wheel",js),sm=[de,Pe,ui,Ee],Ot.matchMedia?(r.matchMedia=function(l){var c=Ot.matchMedia(),h;for(h in l)c.add(h,l[h]);return c},Ot.addEventListener("matchMediaInit",function(){return wh()}),Ot.addEventListener("matchMediaRevert",function(){return xm()}),Ot.addEventListener("matchMedia",function(){ls(0,1),ps("matchMedia")}),Ot.matchMedia("(orientation: portrait)",function(){return lh(),lh})):console.warn("Requires GSAP 3.11.0 or later"),lh(),Ke(Pe,"scroll",js);var n=Ee.style,i=n.borderTopStyle,s=Ot.core.Animation.prototype,o,a;for(s.revert||Object.defineProperty(s,"revert",{value:function(){return this.time(-.01,!0)}}),n.borderTopStyle="solid",o=Yi(Ee),ke.m=Math.round(o.top+ke.sc())||0,un.m=Math.round(o.left+un.sc())||0,i?n.borderTopStyle=i:n.removeProperty("border-top-style"),bl=setInterval($p,250),Ot.delayedCall(.5,function(){return wl=0}),Ke(Pe,"touchcancel",Ci),Ke(Ee,"touchstart",Ci),Tl(Ke,Pe,"pointerdown,touchstart,mousedown",Yp),Tl(Ke,Pe,"pointerup,touchend,mouseup",qp),hh=Ot.utils.checkPrefix("transform"),Ul.push(hh),Qs=fn(),Bl=Ot.delayedCall(.2,ls).pause(),to=[Pe,"visibilitychange",function(){var l=de.innerWidth,c=de.innerHeight;Pe.hidden?(Hp=l,Gp=c):(Hp!==l||Gp!==c)&&ga()},Pe,"DOMContentLoaded",ls,de,"load",ls,de,"resize",ga],El(Ke),ce.forEach(function(l){return l.enable(0,1)}),a=0;a<le.length;a+=3)Al($e,le[a],le[a+1]),Al($e,le[a],le[a+2])}},r.config=function(n){"limitCallbacks"in n&&(sh=!!n.limitCallbacks);var i=n.syncInterval;i&&clearInterval(bl)||(bl=i)&&setInterval($p,i),"ignoreMobileResize"in n&&(fh=r.isTouch===1&&n.ignoreMobileResize),"autoRefreshEvents"in n&&(El($e)||El(Ke,n.autoRefreshEvents||"none"),am=(n.autoRefreshEvents+"").indexOf("resize")===-1)},r.scrollerProxy=function(n,i){var s=Mn(n),o=le.indexOf(s),a=fs(s);~o&&le.splice(o,a?6:2),i&&(a?ci.unshift(de,i,Ee,i,ui,i):ci.unshift(s,i))},r.clearMatchMedia=function(n){ce.forEach(function(i){return i._ctx&&i._ctx.query===n&&i._ctx.kill(!0,!0)})},r.isInViewport=function(n,i,s){var o=(Vn(n)?Mn(n):n).getBoundingClientRect(),a=o[s?cs:us]*i||0;return s?o.right-a>0&&o.left+a<de.innerWidth:o.bottom-a>0&&o.top+a<de.innerHeight},r.positionInViewport=function(n,i,s){Vn(n)&&(n=Mn(n));var o=n.getBoundingClientRect(),a=o[s?cs:us],l=i==null?a/2:i in Vl?Vl[i]*a:~i.indexOf("%")?parseFloat(i)*a/100:parseFloat(i)||0;return s?(o.left+l)/de.innerWidth:(o.top+l)/de.innerHeight},r.killAll=function(n){if(ce.slice(0).forEach(function(s){return s.vars.id!=="ScrollSmoother"&&s.kill()}),n!==!0){var i=ds.killAll||[];ds={},i.forEach(function(s){return s()})}},r}();Yt.version="3.12.5";Yt.saveStyles=function(r){return r?ba(r).forEach(function(t){if(t&&t.style){var e=zn.indexOf(t);e>=0&&zn.splice(e,5),zn.push(t,t.style.cssText,t.getBBox&&t.getAttribute("transform"),Ot.core.getCache(t),dh())}}):zn};Yt.revert=function(r,t){return wh(!r,t)};Yt.create=function(r,t){return new Yt(r,t)};Yt.refresh=function(r){return r?ga():(Qs||Yt.register())&&ls(!0)};Yt.update=function(r){return++le.cache&&qi(r===!0?2:0)};Yt.clearScrollMemory=ym;Yt.maxScroll=function(r,t){return Ri(r,t?un:ke)};Yt.getScrollFunc=function(r,t){return Wi(Mn(r),t?un:ke)};Yt.getById=function(r){return mh[r]};Yt.getAll=function(){return ce.filter(function(r){return r.vars.id!=="ScrollSmoother"})};Yt.isScrolling=function(){return!!jn};Yt.snapDirectional=bh;Yt.addEventListener=function(r,t){var e=ds[r]||(ds[r]=[]);~e.indexOf(t)||e.push(t)};Yt.removeEventListener=function(r,t){var e=ds[r],n=e&&e.indexOf(t);n>=0&&e.splice(n,1)};Yt.batch=function(r,t){var e=[],n={},i=t.interval||.016,s=t.batchMax||1e9,o=function(c,h){var d=[],f=[],u=Ot.delayedCall(i,function(){h(d,f),d=[],f=[]}).pause();return function(_){d.length||u.restart(!0),d.push(_.trigger),f.push(_),s<=d.length&&u.progress(1)}},a;for(a in t)n[a]=a.substr(0,2)==="on"&&Tn(t[a])&&a!=="onRefreshInit"?o(a,t[a]):t[a];return Tn(s)&&(s=s(),Ke(Yt,"refresh",function(){return s=t.batchMax()})),ba(r).forEach(function(l){var c={};for(a in n)c[a]=n[a];c.trigger=l,e.push(Yt.create(c))}),e};var nm=function(t,e,n,i){return e>i?t(i):e<0&&t(0),n>i?(i-e)/(n-e):n<0?e/(e-n):1},uh=function r(t,e){e===!0?t.style.removeProperty("touch-action"):t.style.touchAction=e===!0?"auto":e?"pan-"+e+(Fe.isTouch?" pinch-zoom":""):"none",t===ui&&r(Ee,e)},Il={auto:1,scroll:1},By=function(t){var e=t.event,n=t.target,i=t.axis,s=(e.changedTouches?e.changedTouches[0]:e).target,o=s._gsap||Ot.core.getCache(s),a=fn(),l;if(!o._isScrollT||a-o._isScrollT>2e3){for(;s&&s!==Ee&&(s.scrollHeight<=s.clientHeight&&s.scrollWidth<=s.clientWidth||!(Il[(l=Kn(s)).overflowY]||Il[l.overflowX]));)s=s.parentNode;o._isScroll=s&&s!==n&&!fs(s)&&(Il[(l=Kn(s)).overflowY]||Il[l.overflowX]),o._isScrollT=a}(o._isScroll||i==="x")&&(e.stopPropagation(),e._gsapAllow=!0)},Mm=function(t,e,n,i){return Fe.create({target:t,capture:!0,debounce:!1,lockAxis:!0,type:e,onWheel:i=i&&By,onPress:i,onDrag:i,onScroll:i,onEnable:function(){return n&&Ke(Pe,Fe.eventTypes[0],rm,!1,!0)},onDisable:function(){return $e(Pe,Fe.eventTypes[0],rm,!0)}})},ky=/(input|label|select|textarea)/i,im,rm=function(t){var e=ky.test(t.target.tagName);(e||im)&&(t._gsapAllow=!0,im=e)},zy=function(t){as(t)||(t={}),t.preventDefault=t.isNormalizer=t.allowClicks=!0,t.type||(t.type="wheel,touch"),t.debounce=!!t.debounce,t.id=t.id||"normalizer";var e=t,n=e.normalizeScrollX,i=e.momentum,s=e.allowNestedScroll,o=e.onRelease,a,l,c=Mn(t.target)||ui,h=Ot.core.globals().ScrollSmoother,d=h&&h.get(),f=Sr&&(t.content&&Mn(t.content)||d&&t.content!==!1&&!d.smooth()&&d.content()),u=Wi(c,ke),_=Wi(c,un),p=1,m=(Fe.isTouch&&de.visualViewport?de.visualViewport.scale*de.visualViewport.width:de.outerWidth)/de.innerWidth,g=0,b=Tn(i)?function(){return i(a)}:function(){return i||2.8},v,S,D=Mm(c,t.type,!0,s),T=function(){return S=!1},w=Ci,P=Ci,M=function(){l=Ri(c,ke),P=_a(Sr?1:0,l),n&&(w=_a(0,Ri(c,un))),v=hs},y=function(){f._gsap.y=pa(parseFloat(f._gsap.y)+u.offset)+"px",f.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+parseFloat(f._gsap.y)+", 0, 1)",u.offset=u.cacheID=0},I=function(){if(S){requestAnimationFrame(T);var z=pa(a.deltaY/2),U=P(u.v-z);if(f&&U!==u.v+u.offset){u.offset=U-u.v;var R=pa((parseFloat(f&&f._gsap.y)||0)-u.offset);f.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+R+", 0, 1)",f._gsap.y=R+"px",u.cacheID=le.cache,qi()}return!0}u.offset&&y(),S=!0},N,C,V,$,W=function(){M(),N.isActive()&&N.vars.scrollY>l&&(u()>l?N.progress(1)&&u(l):N.resetTo("scrollY",l))};return f&&Ot.set(f,{y:"+=0"}),t.ignoreCheck=function(Z){return Sr&&Z.type==="touchmove"&&I(Z)||p>1.05&&Z.type!=="touchstart"||a.isGesturing||Z.touches&&Z.touches.length>1},t.onPress=function(){S=!1;var Z=p;p=pa((de.visualViewport&&de.visualViewport.scale||1)/m),N.pause(),Z!==p&&uh(c,p>1.01?!0:n?!1:"x"),C=_(),V=u(),M(),v=hs},t.onRelease=t.onGestureStart=function(Z,z){if(u.offset&&y(),!z)$.restart(!0);else{le.cache++;var U=b(),R,at;n&&(R=_(),at=R+U*.05*-Z.velocityX/.227,U*=nm(_,R,at,Ri(c,un)),N.vars.scrollX=w(at)),R=u(),at=R+U*.05*-Z.velocityY/.227,U*=nm(u,R,at,Ri(c,ke)),N.vars.scrollY=P(at),N.invalidate().duration(U).play(.01),(Sr&&N.vars.scrollY>=l||R>=l-1)&&Ot.to({},{onUpdate:W,duration:U})}o&&o(Z)},t.onWheel=function(){N._ts&&N.pause(),fn()-g>1e3&&(v=0,g=fn())},t.onChange=function(Z,z,U,R,at){if(hs!==v&&M(),z&&n&&_(w(R[2]===z?C+(Z.startX-Z.x):_()+z-R[1])),U){u.offset&&y();var _t=at[2]===U,Ut=_t?V+Z.startY-Z.y:u()+U-at[1],X=P(Ut);_t&&Ut!==X&&(V+=X-Ut),u(X)}(U||z)&&qi()},t.onEnable=function(){uh(c,n?!1:"x"),Yt.addEventListener("refresh",W),Ke(de,"resize",W),u.smooth&&(u.target.style.scrollBehavior="auto",u.smooth=_.smooth=!1),D.enable()},t.onDisable=function(){uh(c,!0),$e(de,"resize",W),Yt.removeEventListener("refresh",W),D.kill()},t.lockAxis=t.lockAxis!==!1,a=new Fe(t),a.iOS=Sr,Sr&&!u()&&u(1),Sr&&Ot.ticker.add(Ci),$=a._dc,N=Ot.to(a,{ease:"power4",paused:!0,inherit:!1,scrollX:n?"+=0.1":"+=0",scrollY:"+=0.1",modifiers:{scrollY:Sm(u,u(),function(){return N.pause()})},onUpdate:qi,onComplete:$.vars.onComplete}),a};Yt.sort=function(r){return ce.sort(r||function(t,e){return(t.vars.refreshPriority||0)*-1e6+t.start-(e.start+(e.vars.refreshPriority||0)*-1e6)})};Yt.observe=function(r){return new Fe(r)};Yt.normalizeScroll=function(r){if(typeof r>"u")return bn;if(r===!0&&bn)return bn.enable();if(r===!1){bn&&bn.kill(),bn=r;return}var t=r instanceof Fe?r:zy(r);return bn&&bn.target===t.target&&bn.kill(),fs(t.target)&&(bn=t),t};Yt.core={_getVelocityProp:Ml,_inputObserver:Mm,_scrollers:le,_proxies:ci,bridge:{ss:function(){jn||ps("scrollStart"),jn=fn()},ref:function(){return hn}}};hm()&&Ot.registerPlugin(Yt);var bm=()=>{Kt.registerPlugin(Yt),document.querySelector("#hero")&&document.querySelectorAll(".hero_services_right-column").forEach(t=>{let e=Kt.timeline({scrollTrigger:{trigger:t,start:"top bottom",toggleActions:"play none none reset"}});if(e.fromTo(".case-studies_hero-under",{y:"100%"},{y:0,duration:.75,ease:"circ.out",delay:2.2}),t.querySelector(".border_cover-img")){let n=t.querySelector(".border_cover-img");e.fromTo(n,{y:"0",x:"0",opacity:0},{y:"0.51em",x:"-0.51em",opacity:1,duration:.75,ease:"circ.out"})}if(t.querySelector(".slice-border")){let n=t.querySelector(".slice-border");e.fromTo(n,{y:"0",x:"0",opacity:0},{y:"0.51em",x:"-0.81em",opacity:1,duration:.75,ease:"circ.out"},"<")}})};var wm=()=>{if(Kt.registerPlugin(Yt),document.querySelector(".creator_container")){let r=document.querySelector(".creator_container");Kt.timeline({scrollTrigger:{trigger:r,start:"top center",toggleActions:"play none none reverse"}}).fromTo(".caption_wrapper",{opacity:0},{opacity:1,duration:.75,ease:"circ.out"}).to("#casestudies-sticker",{opacity:1,duration:.5,ease:"power1.inOut"}).to("#casestudies-sticker",{rotation:10,duration:.5,yoyo:!0,ease:"power1.inOut"}).to("#casestudies-sticker",{rotation:-10,duration:.5,yoyo:!0,ease:"power1.inOut"}).to("#casestudies-sticker",{rotation:0,duration:.5,yoyo:!0,ease:"power1.inOut"}).to(".is-case-line",{width:"100%",duration:.5,ease:"power1.inOut"},">-1.75").fromTo(".quote-paragraph",{autoAlpha:0,y:"3rem"},{y:0,autoAlpha:1,duration:.5,ease:"circ.out"},">-0.25")}};var Zi,ms,Dh,Xl,Ea,Gl,Wl,Ta,hi="transform",Ah=hi+"Origin",Em,Tm=function(t){var e=t.ownerDocument||t;for(!(hi in t.style)&&("msTransform"in t.style)&&(hi="msTransform",Ah=hi+"Origin");e.parentNode&&(e=e.parentNode););if(ms=window,Wl=new Mr,e){Zi=e,Dh=e.documentElement,Xl=e.body,Ta=Zi.createElementNS("http://www.w3.org/2000/svg","g"),Ta.style.transform="none";var n=e.createElement("div"),i=e.createElement("div"),s=e&&(e.body||e.firstElementChild);s&&s.appendChild&&(s.appendChild(n),n.appendChild(i),n.setAttribute("style","position:static;transform:translate3d(0,0,1px)"),Em=i.offsetParent!==n,s.removeChild(n))}return e},Vy=function(t){for(var e,n;t&&t!==Xl;)n=t._gsap,n&&n.uncache&&n.get(t,"x"),n&&!n.scaleX&&!n.scaleY&&n.renderTransform&&(n.scaleX=n.scaleY=1e-4,n.renderTransform(1,n),e?e.push(n):e=[n]),t=t.parentNode;return e},Am=[],Dm=[],Hy=function(){return ms.pageYOffset||Zi.scrollTop||Dh.scrollTop||Xl.scrollTop||0},Gy=function(){return ms.pageXOffset||Zi.scrollLeft||Dh.scrollLeft||Xl.scrollLeft||0},Ch=function(t){return t.ownerSVGElement||((t.tagName+"").toLowerCase()==="svg"?t:null)},Wy=function r(t){if(ms.getComputedStyle(t).position==="fixed")return!0;if(t=t.parentNode,t&&t.nodeType===1)return r(t)},Eh=function r(t,e){if(t.parentNode&&(Zi||Tm(t))){var n=Ch(t),i=n?n.getAttribute("xmlns")||"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",s=n?e?"rect":"g":"div",o=e!==2?0:100,a=e===3?100:0,l="position:absolute;display:block;pointer-events:none;margin:0;padding:0;",c=Zi.createElementNS?Zi.createElementNS(i.replace(/^https/,"http"),s):Zi.createElement(s);return e&&(n?(Gl||(Gl=r(t)),c.setAttribute("width",.01),c.setAttribute("height",.01),c.setAttribute("transform","translate("+o+","+a+")"),Gl.appendChild(c)):(Ea||(Ea=r(t),Ea.style.cssText=l),c.style.cssText=l+"width:0.1px;height:0.1px;top:"+a+"px;left:"+o+"px",Ea.appendChild(c))),c}throw"Need document and parent."},Xy=function(t){for(var e=new Mr,n=0;n<t.numberOfItems;n++)e.multiply(t.getItem(n).matrix);return e},Yy=function(t){var e=t.getCTM(),n;return e||(n=t.style[hi],t.style[hi]="none",t.appendChild(Ta),e=Ta.getCTM(),t.removeChild(Ta),n?t.style[hi]=n:t.style.removeProperty(hi.replace(/([A-Z])/g,"-$1").toLowerCase())),e||Wl.clone()},qy=function(t,e){var n=Ch(t),i=t===n,s=n?Am:Dm,o=t.parentNode,a,l,c,h,d,f;if(t===ms)return t;if(s.length||s.push(Eh(t,1),Eh(t,2),Eh(t,3)),a=n?Gl:Ea,n)i?(c=Yy(t),h=-c.e/c.a,d=-c.f/c.d,l=Wl):t.getBBox?(c=t.getBBox(),l=t.transform?t.transform.baseVal:{},l=l.numberOfItems?l.numberOfItems>1?Xy(l):l.getItem(0).matrix:Wl,h=l.a*c.x+l.c*c.y,d=l.b*c.x+l.d*c.y):(l=new Mr,h=d=0),e&&t.tagName.toLowerCase()==="g"&&(h=d=0),(i?n:o).appendChild(a),a.setAttribute("transform","matrix("+l.a+","+l.b+","+l.c+","+l.d+","+(l.e+h)+","+(l.f+d)+")");else{if(h=d=0,Em)for(l=t.offsetParent,c=t;c&&(c=c.parentNode)&&c!==l&&c.parentNode;)(ms.getComputedStyle(c)[hi]+"").length>4&&(h=c.offsetLeft,d=c.offsetTop,c=0);if(f=ms.getComputedStyle(t),f.position!=="absolute"&&f.position!=="fixed")for(l=t.offsetParent;o&&o!==l;)h+=o.scrollLeft||0,d+=o.scrollTop||0,o=o.parentNode;c=a.style,c.top=t.offsetTop-d+"px",c.left=t.offsetLeft-h+"px",c[hi]=f[hi],c[Ah]=f[Ah],c.position=f.position==="fixed"?"fixed":"absolute",t.parentNode.appendChild(a)}return a},Th=function(t,e,n,i,s,o,a){return t.a=e,t.b=n,t.c=i,t.d=s,t.e=o,t.f=a,t},Mr=function(){function r(e,n,i,s,o,a){e===void 0&&(e=1),n===void 0&&(n=0),i===void 0&&(i=0),s===void 0&&(s=1),o===void 0&&(o=0),a===void 0&&(a=0),Th(this,e,n,i,s,o,a)}var t=r.prototype;return t.inverse=function(){var n=this.a,i=this.b,s=this.c,o=this.d,a=this.e,l=this.f,c=n*o-i*s||1e-10;return Th(this,o/c,-i/c,-s/c,n/c,(s*l-o*a)/c,-(n*l-i*a)/c)},t.multiply=function(n){var i=this.a,s=this.b,o=this.c,a=this.d,l=this.e,c=this.f,h=n.a,d=n.c,f=n.b,u=n.d,_=n.e,p=n.f;return Th(this,h*i+f*o,h*s+f*a,d*i+u*o,d*s+u*a,l+_*i+p*o,c+_*s+p*a)},t.clone=function(){return new r(this.a,this.b,this.c,this.d,this.e,this.f)},t.equals=function(n){var i=this.a,s=this.b,o=this.c,a=this.d,l=this.e,c=this.f;return i===n.a&&s===n.b&&o===n.c&&a===n.d&&l===n.e&&c===n.f},t.apply=function(n,i){i===void 0&&(i={});var s=n.x,o=n.y,a=this.a,l=this.b,c=this.c,h=this.d,d=this.e,f=this.f;return i.x=s*a+o*c+d||0,i.y=s*l+o*h+f||0,i},r}();function br(r,t,e,n){if(!r||!r.parentNode||(Zi||Tm(r)).documentElement===r)return new Mr;var i=Vy(r),s=Ch(r),o=s?Am:Dm,a=qy(r,e),l=o[0].getBoundingClientRect(),c=o[1].getBoundingClientRect(),h=o[2].getBoundingClientRect(),d=a.parentNode,f=!n&&Wy(r),u=new Mr((c.left-l.left)/100,(c.top-l.top)/100,(h.left-l.left)/100,(h.top-l.top)/100,l.left+(f?0:Gy()),l.top+(f?0:Hy()));if(d.removeChild(a),i)for(l=i.length;l--;)c=i[l],c.scaleX=c.scaleY=0,c.renderTransform(1,c);return t?u.inverse():u}function Cm(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Zy(r,t){r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.__proto__=t}var pe,be,Hn,pi,Ki,Rh,$i,Nh,Da,Ar,zm,Uh,La,zh,Ca,fi,Ra,Zl,Vm,Oh,$l=0,Hm=function(){return typeof window<"u"},Gm=function(){return pe||Hm()&&(pe=window.gsap)&&pe.registerPlugin&&pe},Tr=function(t){return typeof t=="function"},Pa=function(t){return typeof t=="object"},di=function(t){return typeof t>"u"},Jl=function(){return!1},Ia="transform",Bh="transformOrigin",wr=function(t){return Math.round(t*1e4)/1e4},Aa=Array.isArray,Yl=function(t,e){var n=Hn.createElementNS?Hn.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):Hn.createElement(t);return n.style?n:Hn.createElement(t)},Rm=180/Math.PI,gs=1e20,Jy=new Mr,Er=Date.now||function(){return new Date().getTime()},xs=[],oo={},$y=0,Ky=/^(?:a|input|textarea|button|select)$/i,Pm=0,ro={},Ji={},Wm=function(t,e){var n={},i;for(i in t)n[i]=e?t[i]*e:t[i];return n},jy=function(t,e){for(var n in e)n in t||(t[n]=e[n]);return t},Im=function r(t,e){for(var n=t.length,i;n--;)e?t[n].style.touchAction=e:t[n].style.removeProperty("touch-action"),i=t[n].children,i&&i.length&&r(i,e)},Xm=function(){return xs.forEach(function(t){return t()})},Qy=function(t){xs.push(t),xs.length===1&&pe.ticker.add(Xm)},Lm=function(){return!xs.length&&pe.ticker.remove(Xm)},Fm=function(t){for(var e=xs.length;e--;)xs[e]===t&&xs.splice(e,1);pe.to(Lm,{overwrite:!0,delay:15,duration:0,onComplete:Lm,data:"_draggable"})},tv=function(t,e){for(var n in e)n in t||(t[n]=e[n]);return t},Xe=function(t,e,n,i){if(t.addEventListener){var s=La[e];i=i||(zm?{passive:!1}:null),t.addEventListener(s||e,n,i),s&&e!==s&&t.addEventListener(e,n,i)}},Ve=function(t,e,n,i){if(t.removeEventListener){var s=La[e];t.removeEventListener(s||e,n,i),s&&e!==s&&t.removeEventListener(e,n,i)}},Qn=function(t){t.preventDefault&&t.preventDefault(),t.preventManipulation&&t.preventManipulation()},ev=function(t,e){for(var n=t.length;n--;)if(t[n].identifier===e)return!0},nv=function r(t){zh=t.touches&&$l<t.touches.length,Ve(t.target,"touchend",r)},Nm=function(t){zh=t.touches&&$l<t.touches.length,Xe(t.target,"touchend",nv)},ao=function(t){return be.pageYOffset||t.scrollTop||t.documentElement.scrollTop||t.body.scrollTop||0},lo=function(t){return be.pageXOffset||t.scrollLeft||t.documentElement.scrollLeft||t.body.scrollLeft||0},Um=function r(t,e){Xe(t,"scroll",e),co(t.parentNode)||r(t.parentNode,e)},Om=function r(t,e){Ve(t,"scroll",e),co(t.parentNode)||r(t.parentNode,e)},co=function(t){return!t||t===pi||t.nodeType===9||t===Hn.body||t===be||!t.nodeType||!t.parentNode},Bm=function(t,e){var n=e==="x"?"Width":"Height",i="scroll"+n,s="client"+n;return Math.max(0,co(t)?Math.max(pi[i],Ki[i])-(be["inner"+n]||pi[s]||Ki[s]):t[i]-t[s])},Ph=function r(t,e){var n=Bm(t,"x"),i=Bm(t,"y");co(t)?t=Ji:r(t.parentNode,e),t._gsMaxScrollX=n,t._gsMaxScrollY=i,e||(t._gsScrollX=t.scrollLeft||0,t._gsScrollY=t.scrollTop||0)},Ih=function(t,e,n){var i=t.style;i&&(di(i[e])&&(e=Da(e,t)||e),n==null?i.removeProperty&&i.removeProperty(e.replace(/([A-Z])/g,"-$1").toLowerCase()):i[e]=n)},Fa=function(t){return be.getComputedStyle(t instanceof Element?t:t.host||(t.parentNode||{}).host||t)},_s={},so=function(t){if(t===be)return _s.left=_s.top=0,_s.width=_s.right=pi.clientWidth||t.innerWidth||Ki.clientWidth||0,_s.height=_s.bottom=(t.innerHeight||0)-20<pi.clientHeight?pi.clientHeight:t.innerHeight||Ki.clientHeight||0,_s;var e=t.ownerDocument||Hn,n=di(t.pageX)?!t.nodeType&&!di(t.left)&&!di(t.top)?t:Ar(t)[0].getBoundingClientRect():{left:t.pageX-lo(e),top:t.pageY-ao(e),right:t.pageX-lo(e)+1,bottom:t.pageY-ao(e)+1};return di(n.right)&&!di(n.width)?(n.right=n.left+n.width,n.bottom=n.top+n.height):di(n.width)&&(n={width:n.right-n.left,height:n.bottom-n.top,right:n.right,left:n.left,bottom:n.bottom,top:n.top}),n},Ue=function(t,e,n){var i=t.vars,s=i[n],o=t._listeners[e],a;return Tr(s)&&(a=s.apply(i.callbackScope||t,i[n+"Params"]||[t.pointerEvent])),o&&t.dispatchEvent(e)===!1&&(a=!1),a},km=function(t,e){var n=Ar(t)[0],i,s,o;return!n.nodeType&&n!==be?di(t.left)?(s=t.min||t.minX||t.minRotation||0,i=t.min||t.minY||0,{left:s,top:i,width:(t.max||t.maxX||t.maxRotation||0)-s,height:(t.max||t.maxY||0)-i}):(o={x:0,y:0},{left:t.left-o.x,top:t.top-o.y,width:t.width,height:t.height}):iv(n,e)},ti={},iv=function(t,e){e=Ar(e)[0];var n=t.getBBox&&t.ownerSVGElement,i=t.ownerDocument||Hn,s,o,a,l,c,h,d,f,u,_,p,m,g;if(t===be)a=ao(i),s=lo(i),o=s+(i.documentElement.clientWidth||t.innerWidth||i.body.clientWidth||0),l=a+((t.innerHeight||0)-20<i.documentElement.clientHeight?i.documentElement.clientHeight:t.innerHeight||i.body.clientHeight||0);else{if(e===be||di(e))return t.getBoundingClientRect();s=a=0,n?(_=t.getBBox(),p=_.width,m=_.height):(t.viewBox&&(_=t.viewBox.baseVal)&&(s=_.x||0,a=_.y||0,p=_.width,m=_.height),p||(g=Fa(t),_=g.boxSizing==="border-box",p=(parseFloat(g.width)||t.clientWidth||0)+(_?0:parseFloat(g.borderLeftWidth)+parseFloat(g.borderRightWidth)),m=(parseFloat(g.height)||t.clientHeight||0)+(_?0:parseFloat(g.borderTopWidth)+parseFloat(g.borderBottomWidth)))),o=p,l=m}return t===e?{left:s,top:a,width:o-s,height:l-a}:(c=br(e,!0).multiply(br(t)),h=c.apply({x:s,y:a}),d=c.apply({x:o,y:a}),f=c.apply({x:o,y:l}),u=c.apply({x:s,y:l}),s=Math.min(h.x,d.x,f.x,u.x),a=Math.min(h.y,d.y,f.y,u.y),{left:s,top:a,width:Math.max(h.x,d.x,f.x,u.x)-s,height:Math.max(h.y,d.y,f.y,u.y)-a})},Lh=function(t,e,n,i,s,o){var a={},l,c,h;if(e)if(s!==1&&e instanceof Array){if(a.end=l=[],h=e.length,Pa(e[0]))for(c=0;c<h;c++)l[c]=Wm(e[c],s);else for(c=0;c<h;c++)l[c]=e[c]*s;n+=1.1,i-=1.1}else Tr(e)?a.end=function(d){var f=e.call(t,d),u,_;if(s!==1)if(Pa(f)){u={};for(_ in f)u[_]=f[_]*s;f=u}else f*=s;return f}:a.end=e;return(n||n===0)&&(a.max=n),(i||i===0)&&(a.min=i),o&&(a.velocity=0),a},rv=function r(t){var e;return!t||!t.getAttribute||t===Ki?!1:(e=t.getAttribute("data-clickable"))==="true"||e!=="false"&&(Ky.test(t.nodeName+"")||t.getAttribute("contentEditable")==="true")?!0:r(t.parentNode)},ql=function(t,e){for(var n=t.length,i;n--;)i=t[n],i.ondragstart=i.onselectstart=e?null:Jl,pe.set(i,{lazy:!0,userSelect:e?"text":"none"})},sv=function r(t){if(Fa(t).position==="fixed")return!0;if(t=t.parentNode,t&&t.nodeType===1)return r(t)},Ym,kh,ov=function(t,e){t=pe.utils.toArray(t)[0],e=e||{};var n=document.createElement("div"),i=n.style,s=t.firstChild,o=0,a=0,l=t.scrollTop,c=t.scrollLeft,h=t.scrollWidth,d=t.scrollHeight,f=0,u=0,_=0,p,m,g,b,v,S;Ym&&e.force3D!==!1?(v="translate3d(",S="px,0px)"):Ia&&(v="translate(",S="px)"),this.scrollTop=function(D,T){if(!arguments.length)return-this.top();this.top(-D,T)},this.scrollLeft=function(D,T){if(!arguments.length)return-this.left();this.left(-D,T)},this.left=function(D,T){if(!arguments.length)return-(t.scrollLeft+a);var w=t.scrollLeft-c,P=a;if((w>2||w<-2)&&!T){c=t.scrollLeft,pe.killTweensOf(this,{left:1,scrollLeft:1}),this.left(-c),e.onKill&&e.onKill();return}D=-D,D<0?(a=D-.5|0,D=0):D>u?(a=D-u|0,D=u):a=0,(a||P)&&(this._skip||(i[Ia]=v+-a+"px,"+-o+S),a+f>=0&&(i.paddingRight=a+f+"px")),t.scrollLeft=D|0,c=t.scrollLeft},this.top=function(D,T){if(!arguments.length)return-(t.scrollTop+o);var w=t.scrollTop-l,P=o;if((w>2||w<-2)&&!T){l=t.scrollTop,pe.killTweensOf(this,{top:1,scrollTop:1}),this.top(-l),e.onKill&&e.onKill();return}D=-D,D<0?(o=D-.5|0,D=0):D>_?(o=D-_|0,D=_):o=0,(o||P)&&(this._skip||(i[Ia]=v+-a+"px,"+-o+S)),t.scrollTop=D|0,l=t.scrollTop},this.maxScrollTop=function(){return _},this.maxScrollLeft=function(){return u},this.disable=function(){for(s=n.firstChild;s;)b=s.nextSibling,t.appendChild(s),s=b;t===n.parentNode&&t.removeChild(n)},this.enable=function(){if(s=t.firstChild,s!==n){for(;s;)b=s.nextSibling,n.appendChild(s),s=b;t.appendChild(n),this.calibrate()}},this.calibrate=function(D){var T=t.clientWidth===p,w,P,M;l=t.scrollTop,c=t.scrollLeft,!(T&&t.clientHeight===m&&n.offsetHeight===g&&h===t.scrollWidth&&d===t.scrollHeight&&!D)&&((o||a)&&(P=this.left(),M=this.top(),this.left(-t.scrollLeft),this.top(-t.scrollTop)),w=Fa(t),(!T||D)&&(i.display="block",i.width="auto",i.paddingRight="0px",f=Math.max(0,t.scrollWidth-t.clientWidth),f&&(f+=parseFloat(w.paddingLeft)+(kh?parseFloat(w.paddingRight):0))),i.display="inline-block",i.position="relative",i.overflow="visible",i.verticalAlign="top",i.boxSizing="content-box",i.width="100%",i.paddingRight=f+"px",kh&&(i.paddingBottom=w.paddingBottom),p=t.clientWidth,m=t.clientHeight,h=t.scrollWidth,d=t.scrollHeight,u=t.scrollWidth-p,_=t.scrollHeight-m,g=n.offsetHeight,i.display="block",(P||M)&&(this.left(P),this.top(M)))},this.content=n,this.element=t,this._skip=!1,this.enable()},Fh=function(t){if(Hm()&&document.body){var e=window&&window.navigator;be=window,Hn=document,pi=Hn.documentElement,Ki=Hn.body,Rh=Yl("div"),Zl=!!window.PointerEvent,$i=Yl("div"),$i.style.cssText="visibility:hidden;height:1px;top:-1px;pointer-events:none;position:relative;clear:both;cursor:grab",Ra=$i.style.cursor==="grab"?"grab":"move",Ca=e&&e.userAgent.toLowerCase().indexOf("android")!==-1,Uh="ontouchstart"in pi&&"orientation"in be||e&&(e.MaxTouchPoints>0||e.msMaxTouchPoints>0),kh=function(){var n=Yl("div"),i=Yl("div"),s=i.style,o=Ki,a;return s.display="inline-block",s.position="relative",n.style.cssText="width:90px;height:40px;padding:10px;overflow:auto;visibility:hidden",n.appendChild(i),o.appendChild(n),a=i.offsetHeight+18>n.scrollHeight,o.removeChild(n),a}(),La=function(n){for(var i=n.split(","),s=("onpointerdown"in Rh?"pointerdown,pointermove,pointerup,pointercancel":"onmspointerdown"in Rh?"MSPointerDown,MSPointerMove,MSPointerUp,MSPointerCancel":n).split(","),o={},a=4;--a>-1;)o[i[a]]=s[a],o[s[a]]=i[a];try{pi.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){zm=1}}))}catch{}return o}("touchstart,touchmove,touchend,touchcancel"),Xe(Hn,"touchcancel",Jl),Xe(be,"touchmove",Jl),Ki&&Ki.addEventListener("touchstart",Jl),Xe(Hn,"contextmenu",function(){for(var n in oo)oo[n].isPressed&&oo[n].endDrag()}),pe=Nh=Gm()}pe?(fi=pe.plugins.inertia,Vm=pe.core.context||function(){},Da=pe.utils.checkPrefix,Ia=Da(Ia),Bh=Da(Bh),Ar=pe.utils.toArray,Oh=pe.core.getStyleSaver,Ym=!!Da("perspective")):t&&console.warn("Please gsap.registerPlugin(Draggable)")},av=function(){function r(e){this._listeners={},this.target=e||this}var t=r.prototype;return t.addEventListener=function(n,i){var s=this._listeners[n]||(this._listeners[n]=[]);~s.indexOf(i)||s.push(i)},t.removeEventListener=function(n,i){var s=this._listeners[n],o=s&&s.indexOf(i);o>=0&&s.splice(o,1)},t.dispatchEvent=function(n){var i=this,s;return(this._listeners[n]||[]).forEach(function(o){return o.call(i,{type:n,target:i.target})===!1&&(s=!1)}),s},r}(),Pi=function(r){Zy(t,r);function t(e,n){var i;i=r.call(this)||this,Nh||Fh(1),e=Ar(e)[0],i.styles=Oh&&Oh(e,"transform,left,top"),fi||(fi=pe.plugins.inertia),i.vars=n=Wm(n||{}),i.target=e,i.x=i.y=i.rotation=0,i.dragResistance=parseFloat(n.dragResistance)||0,i.edgeResistance=isNaN(n.edgeResistance)?1:parseFloat(n.edgeResistance)||0,i.lockAxis=n.lockAxis,i.autoScroll=n.autoScroll||0,i.lockedAxis=null,i.allowEventDefault=!!n.allowEventDefault,pe.getProperty(e,"x");var s=(n.type||"x,y").toLowerCase(),o=~s.indexOf("x")||~s.indexOf("y"),a=s.indexOf("rotation")!==-1,l=a?"rotation":o?"x":"left",c=o?"y":"top",h=!!(~s.indexOf("x")||~s.indexOf("left")||s==="scroll"),d=!!(~s.indexOf("y")||~s.indexOf("top")||s==="scroll"),f=n.minimumMovement||2,u=Cm(i),_=Ar(n.trigger||n.handle||e),p={},m=0,g=!1,b=n.autoScrollMarginTop||40,v=n.autoScrollMarginRight||40,S=n.autoScrollMarginBottom||40,D=n.autoScrollMarginLeft||40,T=n.clickableTest||rv,w=0,P=e._gsap||pe.core.getCache(e),M=sv(e),y=function(L,rt){return parseFloat(P.get(e,L,rt))},I=e.ownerDocument||Hn,N,C,V,$,W,Z,z,U,R,at,_t,Ut,X,ot,xt,ct,Rt,kt,q,$t,It,Ft,bt,Et,Ht,G,jt,A,x,F,Y,tt,it,vt=function(L){return Qn(L),L.stopImmediatePropagation&&L.stopImmediatePropagation(),!1},pt=function Mt(L){if(u.autoScroll&&u.isDragging&&(g||Rt)){var rt=e,O=u.autoScroll*15,j,dt,et,wt,ft,Dt,zt,Nt;for(g=!1,Ji.scrollTop=be.pageYOffset!=null?be.pageYOffset:I.documentElement.scrollTop!=null?I.documentElement.scrollTop:I.body.scrollTop,Ji.scrollLeft=be.pageXOffset!=null?be.pageXOffset:I.documentElement.scrollLeft!=null?I.documentElement.scrollLeft:I.body.scrollLeft,wt=u.pointerX-Ji.scrollLeft,ft=u.pointerY-Ji.scrollTop;rt&&!dt;)dt=co(rt.parentNode),j=dt?Ji:rt.parentNode,et=dt?{bottom:Math.max(pi.clientHeight,be.innerHeight||0),right:Math.max(pi.clientWidth,be.innerWidth||0),left:0,top:0}:j.getBoundingClientRect(),Dt=zt=0,d&&(Nt=j._gsMaxScrollY-j.scrollTop,Nt<0?zt=Nt:ft>et.bottom-S&&Nt?(g=!0,zt=Math.min(Nt,O*(1-Math.max(0,et.bottom-ft)/S)|0)):ft<et.top+b&&j.scrollTop&&(g=!0,zt=-Math.min(j.scrollTop,O*(1-Math.max(0,ft-et.top)/b)|0)),zt&&(j.scrollTop+=zt)),h&&(Nt=j._gsMaxScrollX-j.scrollLeft,Nt<0?Dt=Nt:wt>et.right-v&&Nt?(g=!0,Dt=Math.min(Nt,O*(1-Math.max(0,et.right-wt)/v)|0)):wt<et.left+D&&j.scrollLeft&&(g=!0,Dt=-Math.min(j.scrollLeft,O*(1-Math.max(0,wt-et.left)/D)|0)),Dt&&(j.scrollLeft+=Dt)),dt&&(Dt||zt)&&(be.scrollTo(j.scrollLeft,j.scrollTop),st(u.pointerX+Dt,u.pointerY+zt)),rt=j}if(Rt){var ee=u.x,he=u.y;a?(u.deltaX=ee-parseFloat(P.rotation),u.rotation=ee,P.rotation=ee+"deg",P.renderTransform(1,P)):C?(d&&(u.deltaY=he-C.top(),C.top(he)),h&&(u.deltaX=ee-C.left(),C.left(ee))):o?(d&&(u.deltaY=he-parseFloat(P.y),P.y=he+"px"),h&&(u.deltaX=ee-parseFloat(P.x),P.x=ee+"px"),P.renderTransform(1,P)):(d&&(u.deltaY=he-parseFloat(e.style.top||0),e.style.top=he+"px"),h&&(u.deltaX=ee-parseFloat(e.style.left||0),e.style.left=ee+"px")),U&&!L&&!A&&(A=!0,Ue(u,"drag","onDrag")===!1&&(h&&(u.x-=u.deltaX),d&&(u.y-=u.deltaY),Mt(!0)),A=!1)}Rt=!1},lt=function(L,rt){var O=u.x,j=u.y,dt,et;e._gsap||(P=pe.core.getCache(e)),P.uncache&&pe.getProperty(e,"x"),o?(u.x=parseFloat(P.x),u.y=parseFloat(P.y)):a?u.x=u.rotation=parseFloat(P.rotation):C?(u.y=C.top(),u.x=C.left()):(u.y=parseFloat(e.style.top||(et=Fa(e))&&et.top)||0,u.x=parseFloat(e.style.left||(et||{}).left)||0),(q||$t||It)&&!rt&&(u.isDragging||u.isThrowing)&&(It&&(ro.x=u.x,ro.y=u.y,dt=It(ro),dt.x!==u.x&&(u.x=dt.x,Rt=!0),dt.y!==u.y&&(u.y=dt.y,Rt=!0)),q&&(dt=q(u.x),dt!==u.x&&(u.x=dt,a&&(u.rotation=dt),Rt=!0)),$t&&(dt=$t(u.y),dt!==u.y&&(u.y=dt),Rt=!0)),Rt&&pt(!0),L||(u.deltaX=u.x-O,u.deltaY=u.y-j,Ue(u,"throwupdate","onThrowUpdate"))},Lt=function(L,rt,O,j){return rt==null&&(rt=-gs),O==null&&(O=gs),Tr(L)?function(dt){var et=u.isPressed?1-u.edgeResistance:1;return L.call(u,(dt>O?O+(dt-O)*et:dt<rt?rt+(dt-rt)*et:dt)*j)*j}:Aa(L)?function(dt){for(var et=L.length,wt=0,ft=gs,Dt,zt;--et>-1;)Dt=L[et],zt=Dt-dt,zt<0&&(zt=-zt),zt<ft&&Dt>=rt&&Dt<=O&&(wt=et,ft=zt);return L[wt]}:isNaN(L)?function(dt){return dt}:function(){return L*j}},ht=function(L,rt,O,j,dt,et,wt){return et=et&&et<gs?et*et:gs,Tr(L)?function(ft){var Dt=u.isPressed?1-u.edgeResistance:1,zt=ft.x,Nt=ft.y,ee,he,me;return ft.x=zt=zt>O?O+(zt-O)*Dt:zt<rt?rt+(zt-rt)*Dt:zt,ft.y=Nt=Nt>dt?dt+(Nt-dt)*Dt:Nt<j?j+(Nt-j)*Dt:Nt,ee=L.call(u,ft),ee!==ft&&(ft.x=ee.x,ft.y=ee.y),wt!==1&&(ft.x*=wt,ft.y*=wt),et<gs&&(he=ft.x-zt,me=ft.y-Nt,he*he+me*me>et&&(ft.x=zt,ft.y=Nt)),ft}:Aa(L)?function(ft){for(var Dt=L.length,zt=0,Nt=gs,ee,he,me,ae;--Dt>-1;)me=L[Dt],ee=me.x-ft.x,he=me.y-ft.y,ae=ee*ee+he*he,ae<Nt&&(zt=Dt,Nt=ae);return Nt<=et?L[zt]:ft}:function(ft){return ft}},yt=function(){var L,rt,O,j;z=!1,C?(C.calibrate(),u.minX=_t=-C.maxScrollLeft(),u.minY=X=-C.maxScrollTop(),u.maxX=at=u.maxY=Ut=0,z=!0):n.bounds&&(L=km(n.bounds,e.parentNode),a?(u.minX=_t=L.left,u.maxX=at=L.left+L.width,u.minY=X=u.maxY=Ut=0):!di(n.bounds.maxX)||!di(n.bounds.maxY)?(L=n.bounds,u.minX=_t=L.minX,u.minY=X=L.minY,u.maxX=at=L.maxX,u.maxY=Ut=L.maxY):(rt=km(e,e.parentNode),u.minX=_t=Math.round(y(l,"px")+L.left-rt.left),u.minY=X=Math.round(y(c,"px")+L.top-rt.top),u.maxX=at=Math.round(_t+(L.width-rt.width)),u.maxY=Ut=Math.round(X+(L.height-rt.height))),_t>at&&(u.minX=at,u.maxX=at=_t,_t=u.minX),X>Ut&&(u.minY=Ut,u.maxY=Ut=X,X=u.minY),a&&(u.minRotation=_t,u.maxRotation=at),z=!0),n.liveSnap&&(O=n.liveSnap===!0?n.snap||{}:n.liveSnap,j=Aa(O)||Tr(O),a?(q=Lt(j?O:O.rotation,_t,at,1),$t=null):O.points?It=ht(j?O:O.points,_t,at,X,Ut,O.radius,C?-1:1):(h&&(q=Lt(j?O:O.x||O.left||O.scrollLeft,_t,at,C?-1:1)),d&&($t=Lt(j?O:O.y||O.top||O.scrollTop,X,Ut,C?-1:1))))},qt=function(){u.isThrowing=!1,Ue(u,"throwcomplete","onThrowComplete")},ut=function(){u.isThrowing=!1},Tt=function(L,rt){var O,j,dt,et;L&&fi?(L===!0&&(O=n.snap||n.liveSnap||{},j=Aa(O)||Tr(O),L={resistance:(n.throwResistance||n.resistance||1e3)/(a?10:1)},a?L.rotation=Lh(u,j?O:O.rotation,at,_t,1,rt):(h&&(L[l]=Lh(u,j?O:O.points||O.x||O.left,at,_t,C?-1:1,rt||u.lockedAxis==="x")),d&&(L[c]=Lh(u,j?O:O.points||O.y||O.top,Ut,X,C?-1:1,rt||u.lockedAxis==="y")),(O.points||Aa(O)&&Pa(O[0]))&&(L.linkedProps=l+","+c,L.radius=O.radius))),u.isThrowing=!0,et=isNaN(n.overshootTolerance)?n.edgeResistance===1?0:1-u.edgeResistance+.2:n.overshootTolerance,L.duration||(L.duration={max:Math.max(n.minDuration||0,"maxDuration"in n?n.maxDuration:2),min:isNaN(n.minDuration)?et===0||Pa(L)&&L.resistance>1e3?0:.5:n.minDuration,overshoot:et}),u.tween=dt=pe.to(C||e,{inertia:L,data:"_draggable",inherit:!1,onComplete:qt,onInterrupt:ut,onUpdate:n.fastMode?Ue:lt,onUpdateParams:n.fastMode?[u,"onthrowupdate","onThrowUpdate"]:O&&O.radius?[!1,!0]:[]}),n.fastMode||(C&&(C._skip=!0),dt.render(1e9,!0,!0),lt(!0,!0),u.endX=u.x,u.endY=u.y,a&&(u.endRotation=u.x),dt.play(0),lt(!0,!0),C&&(C._skip=!1))):z&&u.applyBounds()},Wt=function(L){var rt=Et,O;Et=br(e.parentNode,!0),L&&u.isPressed&&!Et.equals(rt||new Mr)&&(O=rt.inverse().apply({x:V,y:$}),Et.apply(O,O),V=O.x,$=O.y),Et.equals(Jy)&&(Et=null)},Zt=function(){var L=1-u.edgeResistance,rt=M?lo(I):0,O=M?ao(I):0,j,dt,et;o&&(P.x=y(l,"px")+"px",P.y=y(c,"px")+"px",P.renderTransform()),Wt(!1),ti.x=u.pointerX-rt,ti.y=u.pointerY-O,Et&&Et.apply(ti,ti),V=ti.x,$=ti.y,Rt&&(st(u.pointerX,u.pointerY),pt(!0)),tt=br(e),C?(yt(),Z=C.top(),W=C.left()):(ue()?(lt(!0,!0),yt()):u.applyBounds(),a?(j=e.ownerSVGElement?[P.xOrigin-e.getBBox().x,P.yOrigin-e.getBBox().y]:(Fa(e)[Bh]||"0 0").split(" "),ct=u.rotationOrigin=br(e).apply({x:parseFloat(j[0])||0,y:parseFloat(j[1])||0}),lt(!0,!0),dt=u.pointerX-ct.x-rt,et=ct.y-u.pointerY+O,W=u.x,Z=u.y=Math.atan2(et,dt)*Rm):(Z=y(c,"px"),W=y(l,"px"))),z&&L&&(W>at?W=at+(W-at)/L:W<_t&&(W=_t-(_t-W)/L),a||(Z>Ut?Z=Ut+(Z-Ut)/L:Z<X&&(Z=X-(X-Z)/L))),u.startX=W=wr(W),u.startY=Z=wr(Z)},ue=function(){return u.tween&&u.tween.isActive()},Jt=function(){$i.parentNode&&!ue()&&!u.isDragging&&$i.parentNode.removeChild($i)},k=function(L,rt){var O;if(!N||u.isPressed||!L||(L.type==="mousedown"||L.type==="pointerdown")&&!rt&&Er()-w<30&&La[u.pointerEvent.type]){Y&&L&&N&&Qn(L);return}if(Ht=ue(),it=!1,u.pointerEvent=L,La[L.type]?(bt=~L.type.indexOf("touch")?L.currentTarget||L.target:I,Xe(bt,"touchend",mt),Xe(bt,"touchmove",Q),Xe(bt,"touchcancel",mt),Xe(I,"touchstart",Nm)):(bt=null,Xe(I,"mousemove",Q)),jt=null,(!Zl||!bt)&&(Xe(I,"mouseup",mt),L&&L.target&&Xe(L.target,"mouseup",mt)),Ft=T.call(u,L.target)&&n.dragClickables===!1&&!rt,Ft){Xe(L.target,"change",mt),Ue(u,"pressInit","onPressInit"),Ue(u,"press","onPress"),ql(_,!0),Y=!1;return}if(G=!bt||h===d||u.vars.allowNativeTouchScrolling===!1||u.vars.allowContextMenu&&L&&(L.ctrlKey||L.which>2)?!1:h?"y":"x",Y=!G&&!u.allowEventDefault,Y&&(Qn(L),Xe(be,"touchforcechange",Qn)),L.changedTouches?(L=ot=L.changedTouches[0],xt=L.identifier):L.pointerId?xt=L.pointerId:ot=xt=null,$l++,Qy(pt),$=u.pointerY=L.pageY,V=u.pointerX=L.pageX,Ue(u,"pressInit","onPressInit"),(G||u.autoScroll)&&Ph(e.parentNode),e.parentNode&&u.autoScroll&&!C&&!a&&e.parentNode._gsMaxScrollX&&!$i.parentNode&&!e.getBBox&&($i.style.width=e.parentNode.scrollWidth+"px",e.parentNode.appendChild($i)),Zt(),u.tween&&u.tween.kill(),u.isThrowing=!1,pe.killTweensOf(C||e,p,!0),C&&pe.killTweensOf(e,{scrollTo:1},!0),u.tween=u.lockedAxis=null,(n.zIndexBoost||!a&&!C&&n.zIndexBoost!==!1)&&(e.style.zIndex=t.zIndex++),u.isPressed=!0,U=!!(n.onDrag||u._listeners.drag),R=!!(n.onMove||u._listeners.move),n.cursor!==!1||n.activeCursor)for(O=_.length;--O>-1;)pe.set(_[O],{cursor:n.activeCursor||n.cursor||(Ra==="grab"?"grabbing":Ra)});Ue(u,"press","onPress")},Q=function(L){var rt=L,O,j,dt,et,wt,ft;if(!N||zh||!u.isPressed||!L){Y&&L&&N&&Qn(L);return}if(u.pointerEvent=L,O=L.changedTouches,O){if(L=O[0],L!==ot&&L.identifier!==xt){for(et=O.length;--et>-1&&(L=O[et]).identifier!==xt&&L.target!==e;);if(et<0)return}}else if(L.pointerId&&xt&&L.pointerId!==xt)return;if(bt&&G&&!jt&&(ti.x=L.pageX-(M?lo(I):0),ti.y=L.pageY-(M?ao(I):0),Et&&Et.apply(ti,ti),j=ti.x,dt=ti.y,wt=Math.abs(j-V),ft=Math.abs(dt-$),(wt!==ft&&(wt>f||ft>f)||Ca&&G===jt)&&(jt=wt>ft&&h?"x":"y",G&&jt!==G&&Xe(be,"touchforcechange",Qn),u.vars.lockAxisOnTouchScroll!==!1&&h&&d&&(u.lockedAxis=jt==="x"?"y":"x",Tr(u.vars.onLockAxis)&&u.vars.onLockAxis.call(u,rt)),Ca&&G===jt))){mt(rt);return}!u.allowEventDefault&&(!G||jt&&G!==jt)&&rt.cancelable!==!1?(Qn(rt),Y=!0):Y&&(Y=!1),u.autoScroll&&(g=!0),st(L.pageX,L.pageY,R)},st=function(L,rt,O){var j=1-u.dragResistance,dt=1-u.edgeResistance,et=u.pointerX,wt=u.pointerY,ft=Z,Dt=u.x,zt=u.y,Nt=u.endX,ee=u.endY,he=u.endRotation,me=Rt,ae,E,B,H,K,J;u.pointerX=L,u.pointerY=rt,M&&(L-=lo(I),rt-=ao(I)),a?(H=Math.atan2(ct.y-rt,L-ct.x)*Rm,K=u.y-H,K>180?(Z-=360,u.y=H):K<-180&&(Z+=360,u.y=H),u.x!==W||Math.abs(Z-H)>f?(u.y=H,B=W+(Z-H)*j):B=W):(Et&&(J=L*Et.a+rt*Et.c+Et.e,rt=L*Et.b+rt*Et.d+Et.f,L=J),E=rt-$,ae=L-V,E<f&&E>-f&&(E=0),ae<f&&ae>-f&&(ae=0),(u.lockAxis||u.lockedAxis)&&(ae||E)&&(J=u.lockedAxis,J||(u.lockedAxis=J=h&&Math.abs(ae)>Math.abs(E)?"y":d?"x":null,J&&Tr(u.vars.onLockAxis)&&u.vars.onLockAxis.call(u,u.pointerEvent)),J==="y"?E=0:J==="x"&&(ae=0)),B=wr(W+ae*j),H=wr(Z+E*j)),(q||$t||It)&&(u.x!==B||u.y!==H&&!a)&&(It&&(ro.x=B,ro.y=H,J=It(ro),B=wr(J.x),H=wr(J.y)),q&&(B=wr(q(B))),$t&&(H=wr($t(H)))),z&&(B>at?B=at+Math.round((B-at)*dt):B<_t&&(B=_t+Math.round((B-_t)*dt)),a||(H>Ut?H=Math.round(Ut+(H-Ut)*dt):H<X&&(H=Math.round(X+(H-X)*dt)))),(u.x!==B||u.y!==H&&!a)&&(a?(u.endRotation=u.x=u.endX=B,Rt=!0):(d&&(u.y=u.endY=H,Rt=!0),h&&(u.x=u.endX=B,Rt=!0)),!O||Ue(u,"move","onMove")!==!1?!u.isDragging&&u.isPressed&&(u.isDragging=it=!0,Ue(u,"dragstart","onDragStart")):(u.pointerX=et,u.pointerY=wt,Z=ft,u.x=Dt,u.y=zt,u.endX=Nt,u.endY=ee,u.endRotation=he,Rt=me))},mt=function Mt(L,rt){if(!N||!u.isPressed||L&&xt!=null&&!rt&&(L.pointerId&&L.pointerId!==xt&&L.target!==e||L.changedTouches&&!ev(L.changedTouches,xt))){Y&&L&&N&&Qn(L);return}u.isPressed=!1;var O=L,j=u.isDragging,dt=u.vars.allowContextMenu&&L&&(L.ctrlKey||L.which>2),et=pe.delayedCall(.001,Jt),wt,ft,Dt,zt,Nt;if(bt?(Ve(bt,"touchend",Mt),Ve(bt,"touchmove",Q),Ve(bt,"touchcancel",Mt),Ve(I,"touchstart",Nm)):Ve(I,"mousemove",Q),Ve(be,"touchforcechange",Qn),(!Zl||!bt)&&(Ve(I,"mouseup",Mt),L&&L.target&&Ve(L.target,"mouseup",Mt)),Rt=!1,j&&(m=Pm=Er(),u.isDragging=!1),Fm(pt),Ft&&!dt){L&&(Ve(L.target,"change",Mt),u.pointerEvent=O),ql(_,!1),Ue(u,"release","onRelease"),Ue(u,"click","onClick"),Ft=!1;return}for(ft=_.length;--ft>-1;)Ih(_[ft],"cursor",n.cursor||(n.cursor!==!1?Ra:null));if($l--,L){if(wt=L.changedTouches,wt&&(L=wt[0],L!==ot&&L.identifier!==xt)){for(ft=wt.length;--ft>-1&&(L=wt[ft]).identifier!==xt&&L.target!==e;);if(ft<0&&!rt)return}u.pointerEvent=O,u.pointerX=L.pageX,u.pointerY=L.pageY}return dt&&O?(Qn(O),Y=!0,Ue(u,"release","onRelease")):O&&!j?(Y=!1,Ht&&(n.snap||n.bounds)&&Tt(n.inertia||n.throwProps),Ue(u,"release","onRelease"),(!Ca||O.type!=="touchmove")&&O.type.indexOf("cancel")===-1&&(Ue(u,"click","onClick"),Er()-w<300&&Ue(u,"doubleclick","onDoubleClick"),zt=O.target||e,w=Er(),Nt=function(){w!==x&&u.enabled()&&!u.isPressed&&!O.defaultPrevented&&(zt.click?zt.click():I.createEvent&&(Dt=I.createEvent("MouseEvents"),Dt.initMouseEvent("click",!0,!0,be,1,u.pointerEvent.screenX,u.pointerEvent.screenY,u.pointerX,u.pointerY,!1,!1,!1,!1,0,null),zt.dispatchEvent(Dt)))},!Ca&&!O.defaultPrevented&&pe.delayedCall(.05,Nt))):(Tt(n.inertia||n.throwProps),!u.allowEventDefault&&O&&(n.dragClickables!==!1||!T.call(u,O.target))&&j&&(!G||jt&&G===jt)&&O.cancelable!==!1?(Y=!0,Qn(O)):Y=!1,Ue(u,"release","onRelease")),ue()&&et.duration(u.tween.duration()),j&&Ue(u,"dragend","onDragEnd"),!0},gt=function(L){if(L&&u.isDragging&&!C){var rt=L.target||e.parentNode,O=rt.scrollLeft-rt._gsScrollX,j=rt.scrollTop-rt._gsScrollY;(O||j)&&(Et?(V-=O*Et.a+j*Et.c,$-=j*Et.d+O*Et.b):(V-=O,$-=j),rt._gsScrollX+=O,rt._gsScrollY+=j,st(u.pointerX,u.pointerY))}},Bt=function(L){var rt=Er(),O=rt-w<100,j=rt-m<50,dt=O&&x===w,et=u.pointerEvent&&u.pointerEvent.defaultPrevented,wt=O&&F===w,ft=L.isTrusted||L.isTrusted==null&&O&&dt;if((dt||j&&u.vars.suppressClickOnDrag!==!1)&&L.stopImmediatePropagation&&L.stopImmediatePropagation(),O&&!(u.pointerEvent&&u.pointerEvent.defaultPrevented)&&(!dt||ft&&!wt)){ft&&dt&&(F=w),x=w;return}(u.isPressed||j||O)&&(!ft||!L.detail||!O||et)&&Qn(L),!O&&!j&&!it&&(L&&L.target&&(u.pointerEvent=L),Ue(u,"click","onClick"))},ne=function(L){return Et?{x:L.x*Et.a+L.y*Et.c+Et.e,y:L.x*Et.b+L.y*Et.d+Et.f}:{x:L.x,y:L.y}};return kt=t.get(e),kt&&kt.kill(),i.startDrag=function(Mt,L){var rt,O,j,dt;k(Mt||u.pointerEvent,!0),L&&!u.hitTest(Mt||u.pointerEvent)&&(rt=so(Mt||u.pointerEvent),O=so(e),j=ne({x:rt.left+rt.width/2,y:rt.top+rt.height/2}),dt=ne({x:O.left+O.width/2,y:O.top+O.height/2}),V-=j.x-dt.x,$-=j.y-dt.y),u.isDragging||(u.isDragging=it=!0,Ue(u,"dragstart","onDragStart"))},i.drag=Q,i.endDrag=function(Mt){return mt(Mt||u.pointerEvent,!0)},i.timeSinceDrag=function(){return u.isDragging?0:(Er()-m)/1e3},i.timeSinceClick=function(){return(Er()-w)/1e3},i.hitTest=function(Mt,L){return t.hitTest(u.target,Mt,L)},i.getDirection=function(Mt,L){var rt=Mt==="velocity"&&fi?Mt:Pa(Mt)&&!a?"element":"start",O,j,dt,et,wt,ft;return rt==="element"&&(wt=so(u.target),ft=so(Mt)),O=rt==="start"?u.x-W:rt==="velocity"?fi.getVelocity(e,l):wt.left+wt.width/2-(ft.left+ft.width/2),a?O<0?"counter-clockwise":"clockwise":(L=L||2,j=rt==="start"?u.y-Z:rt==="velocity"?fi.getVelocity(e,c):wt.top+wt.height/2-(ft.top+ft.height/2),dt=Math.abs(O/j),et=dt<1/L?"":O<0?"left":"right",dt<L&&(et!==""&&(et+="-"),et+=j<0?"up":"down"),et)},i.applyBounds=function(Mt,L){var rt,O,j,dt,et,wt;if(Mt&&n.bounds!==Mt)return n.bounds=Mt,u.update(!0,L);if(lt(!0),yt(),z&&!ue()){if(rt=u.x,O=u.y,rt>at?rt=at:rt<_t&&(rt=_t),O>Ut?O=Ut:O<X&&(O=X),(u.x!==rt||u.y!==O)&&(j=!0,u.x=u.endX=rt,a?u.endRotation=rt:u.y=u.endY=O,Rt=!0,pt(!0),u.autoScroll&&!u.isDragging))for(Ph(e.parentNode),dt=e,Ji.scrollTop=be.pageYOffset!=null?be.pageYOffset:I.documentElement.scrollTop!=null?I.documentElement.scrollTop:I.body.scrollTop,Ji.scrollLeft=be.pageXOffset!=null?be.pageXOffset:I.documentElement.scrollLeft!=null?I.documentElement.scrollLeft:I.body.scrollLeft;dt&&!wt;)wt=co(dt.parentNode),et=wt?Ji:dt.parentNode,d&&et.scrollTop>et._gsMaxScrollY&&(et.scrollTop=et._gsMaxScrollY),h&&et.scrollLeft>et._gsMaxScrollX&&(et.scrollLeft=et._gsMaxScrollX),dt=et;u.isThrowing&&(j||u.endX>at||u.endX<_t||u.endY>Ut||u.endY<X)&&Tt(n.inertia||n.throwProps,j)}return u},i.update=function(Mt,L,rt){if(L&&u.isPressed){var O=br(e),j=tt.apply({x:u.x-W,y:u.y-Z}),dt=br(e.parentNode,!0);dt.apply({x:O.e-j.x,y:O.f-j.y},j),u.x-=j.x-dt.e,u.y-=j.y-dt.f,pt(!0),Zt()}var et=u.x,wt=u.y;return Wt(!L),Mt?u.applyBounds():(Rt&&rt&&pt(!0),lt(!0)),L&&(st(u.pointerX,u.pointerY),Rt&&pt(!0)),u.isPressed&&!L&&(h&&Math.abs(et-u.x)>.01||d&&Math.abs(wt-u.y)>.01&&!a)&&Zt(),u.autoScroll&&(Ph(e.parentNode,u.isDragging),g=u.isDragging,pt(!0),Om(e,gt),Um(e,gt)),u},i.enable=function(Mt){var L={lazy:!0},rt,O,j;if(n.cursor!==!1&&(L.cursor=n.cursor||Ra),pe.utils.checkPrefix("touchCallout")&&(L.touchCallout="none"),Mt!=="soft"){for(Im(_,h===d?"none":n.allowNativeTouchScrolling&&e.scrollHeight===e.clientHeight==(e.scrollWidth===e.clientHeight)||n.allowEventDefault?"manipulation":h?"pan-y":"pan-x"),O=_.length;--O>-1;)j=_[O],Zl||Xe(j,"mousedown",k),Xe(j,"touchstart",k),Xe(j,"click",Bt,!0),pe.set(j,L),j.getBBox&&j.ownerSVGElement&&h!==d&&pe.set(j.ownerSVGElement,{touchAction:n.allowNativeTouchScrolling||n.allowEventDefault?"manipulation":h?"pan-y":"pan-x"}),n.allowContextMenu||Xe(j,"contextmenu",vt);ql(_,!1)}return Um(e,gt),N=!0,fi&&Mt!=="soft"&&fi.track(C||e,o?"x,y":a?"rotation":"top,left"),e._gsDragID=rt="d"+$y++,oo[rt]=u,C&&(C.enable(),C.element._gsDragID=rt),(n.bounds||a)&&Zt(),n.bounds&&u.applyBounds(),u},i.disable=function(Mt){for(var L=u.isDragging,rt=_.length,O;--rt>-1;)Ih(_[rt],"cursor",null);if(Mt!=="soft"){for(Im(_,null),rt=_.length;--rt>-1;)O=_[rt],Ih(O,"touchCallout",null),Ve(O,"mousedown",k),Ve(O,"touchstart",k),Ve(O,"click",Bt,!0),Ve(O,"contextmenu",vt);ql(_,!0),bt&&(Ve(bt,"touchcancel",mt),Ve(bt,"touchend",mt),Ve(bt,"touchmove",Q)),Ve(I,"mouseup",mt),Ve(I,"mousemove",Q)}return Om(e,gt),N=!1,fi&&Mt!=="soft"&&(fi.untrack(C||e,o?"x,y":a?"rotation":"top,left"),u.tween&&u.tween.kill()),C&&C.disable(),Fm(pt),u.isDragging=u.isPressed=Ft=!1,L&&Ue(u,"dragend","onDragEnd"),u},i.enabled=function(Mt,L){return arguments.length?Mt?u.enable(L):u.disable(L):N},i.kill=function(){return u.isThrowing=!1,u.tween&&u.tween.kill(),u.disable(),pe.set(_,{clearProps:"userSelect"}),delete oo[e._gsDragID],u},i.revert=function(){this.kill(),this.styles&&this.styles.revert()},~s.indexOf("scroll")&&(C=i.scrollProxy=new ov(e,jy({onKill:function(){u.isPressed&&mt(null)}},n)),e.style.overflowY=d&&!Uh?"auto":"hidden",e.style.overflowX=h&&!Uh?"auto":"hidden",e=C.content),a?p.rotation=1:(h&&(p[l]=1),d&&(p[c]=1)),P.force3D="force3D"in n?n.force3D:!0,Vm(Cm(i)),i.enable(),i}return t.register=function(n){pe=n,Fh()},t.create=function(n,i){return Nh||Fh(!0),Ar(n).map(function(s){return new t(s,i)})},t.get=function(n){return oo[(Ar(n)[0]||{})._gsDragID]},t.timeSinceDrag=function(){return(Er()-Pm)/1e3},t.hitTest=function(n,i,s){if(n===i)return!1;var o=so(n),a=so(i),l=o.top,c=o.left,h=o.right,d=o.bottom,f=o.width,u=o.height,_=a.left>h||a.right<c||a.top>d||a.bottom<l,p,m,g;return _||!s?!_:(g=(s+"").indexOf("%")!==-1,s=parseFloat(s)||0,p={left:Math.max(c,a.left),top:Math.max(l,a.top)},p.width=Math.min(h,a.right)-p.left,p.height=Math.min(d,a.bottom)-p.top,p.width<0||p.height<0?!1:g?(s*=.01,m=p.width*p.height,m>=f*u*s||m>=a.width*a.height*s):p.width>s&&p.height>s)},t}(av);tv(Pi.prototype,{pointerX:0,pointerY:0,startX:0,startY:0,deltaX:0,deltaY:0,isDragging:!1,isPressed:!1});Pi.zIndex=1e3;Pi.version="3.12.5";Gm()&&pe.registerPlugin(Pi);var Ii,Hh,Ua,Zm,uo,ho,Kl,Jm,$m,Km=function(){return Ii||typeof window<"u"&&(Ii=window.gsap)},Gh={},lv=function(t){return Math.round(t*1e4)/1e4},Wh=function(t){return $m(t).id},Na=function(t){return Gh[Wh(typeof t=="string"?Ua(t)[0]:t)]},qm=function(t){var e=uo,n;if(t-Kl>=.05)for(Jm=Kl,Kl=t;e;)n=e.g(e.t,e.p),(n!==e.v1||t-e.t1>.2)&&(e.v2=e.v1,e.v1=n,e.t2=e.t1,e.t1=t),e=e._next},cv={deg:360,rad:Math.PI*2},Vh=function(){Ii=Km(),Ii&&(Ua=Ii.utils.toArray,Zm=Ii.utils.getUnit,$m=Ii.core.getCache,ho=Ii.ticker,Hh=1)},uv=function(t,e,n,i){this.t=t,this.p=e,this.g=t._gsap.get,this.rCap=cv[n||Zm(this.g(t,e))],this.v1=this.v2=0,this.t1=this.t2=ho.time,i&&(this._next=i,i._prev=this)},fo=function(){function r(e,n){Hh||Vh(),this.target=Ua(e)[0],Gh[Wh(this.target)]=this,this._props={},n&&this.add(n)}r.register=function(n){Ii=n,Vh()};var t=r.prototype;return t.get=function(n,i){var s=this._props[n]||console.warn("Not tracking "+n+" velocity."),o,a,l;return o=parseFloat(i?s.v1:s.g(s.t,s.p)),a=o-parseFloat(s.v2),l=s.rCap,l&&(a=a%l,a!==a%(l/2)&&(a=a<0?a+l:a-l)),lv(a/((i?s.t1:ho.time)-s.t2))},t.getAll=function(){var n={},i=this._props,s;for(s in i)n[s]=this.get(s);return n},t.isTracking=function(n){return n in this._props},t.add=function(n,i){n in this._props||(uo||(ho.add(qm),Kl=Jm=ho.time),uo=this._props[n]=new uv(this.target,n,i,uo))},t.remove=function(n){var i=this._props[n],s,o;i&&(s=i._prev,o=i._next,s&&(s._next=o),o?o._prev=s:uo===i&&(ho.remove(qm),uo=0),delete this._props[n])},t.kill=function(n){for(var i in this._props)this.remove(i);n||delete Gh[Wh(this.target)]},r.track=function(n,i,s){Hh||Vh();for(var o=[],a=Ua(n),l=i.split(","),c=(s||"").split(","),h=a.length,d,f;h--;){for(d=Na(a[h])||new r(a[h]),f=l.length;f--;)d.add(l[f],c[f]||c[0]);o.push(d)}return o},r.untrack=function(n,i){var s=(i||"").split(",");Ua(n).forEach(function(o){var a=Na(o);a&&(s.length?s.forEach(function(l){return a.remove(l)}):a.kill(1))})},r.isTracking=function(n,i){var s=Na(n);return s&&s.isTracking(i)},r.getVelocity=function(n,i){var s=Na(n);return!s||!s.isTracking(i)?console.warn("Not tracking velocity of "+i):s.get(i)},r}();fo.getByTarget=Na;Km()&&Ii.registerPlugin(fo);var Ye,ig,jm,rg,Xh,Oa,sg,og,ag,Zh,lg,Ba,Yh,cg,jl=fo.getByTarget,ug=function(){return Ye||typeof window<"u"&&(Ye=window.gsap)&&Ye.registerPlugin&&Ye},hv=function(t){return typeof t=="string"},ka=function(t){return typeof t=="number"},Dr=function(t){return typeof t=="object"},qh=function(t){return typeof t=="function"},fv=1,hg=Array.isArray,dv=function(t){return t},ys=1e10,Qm=1/ys,fg=.05,pv=function(t){return Math.round(t*1e4)/1e4},mv=function(t,e,n){for(var i in e)!(i in t)&&i!==n&&(t[i]=e[i]);return t},gv=function r(t){var e={},n,i;for(n in t)e[n]=Dr(i=t[n])&&!hg(i)?r(i):i;return e},tg=function(t,e,n,i,s){var o=e.length,a=0,l=ys,c,h,d,f;if(Dr(t)){for(;o--;){c=e[o],h=0;for(d in t)f=c[d]-t[d],h+=f*f;h<l&&(a=o,l=h)}if((s||ys)<ys&&s<Math.sqrt(l))return t}else for(;o--;)c=e[o],h=c-t,h<0&&(h=-h),h<l&&c>=i&&c<=n&&(a=o,l=h);return e[a]},dg=function(t,e,n,i,s,o,a){if(t.end==="auto")return t;var l=t.end,c,h;if(n=isNaN(n)?ys:n,i=isNaN(i)?-ys:i,Dr(e)){if(c=e.calculated?e:(qh(l)?l(e,a):tg(e,l,n,i,o))||e,!e.calculated){for(h in c)e[h]=c[h];e.calculated=!0}c=c[s]}else c=qh(l)?l(e,a):hg(l)?tg(e,l,n,i,o):parseFloat(l);return c>n?c=n:c<i&&(c=i),{max:c,min:c,unitFactor:t.unitFactor}},Ql=function(t,e,n){return isNaN(t[e])?n:+t[e]},Jh=function(t,e){return e*fg*t/Zh},eg=function(t,e,n){return Math.abs((e-t)*Zh/n/fg)},pg={resistance:1,checkpoint:1,preventOvershoot:1,linkedProps:1,radius:1,duration:1},mg=function(t,e,n,i){if(e.linkedProps){var s=e.linkedProps.split(","),o={},a,l,c,h,d,f;for(a=0;a<s.length;a++)l=s[a],c=e[l],c&&(ka(c.velocity)?h=c.velocity:(d=d||jl(t),h=d&&d.isTracking(l)?d.get(l):0),f=Math.abs(h/Ql(c,"resistance",i)),o[l]=parseFloat(n(t,l))+Jh(h,f));return o}},_v=function(t,e,n,i,s,o){if(n===void 0&&(n=10),i===void 0&&(i=.2),s===void 0&&(s=1),o===void 0&&(o=0),hv(t)&&(t=rg(t)[0]),!t)return 0;var a=0,l=ys,c=e.inertia||e,h=ag(t).get,d=Ql(c,"resistance",Oa.resistance),f,u,_,p,m,g,b,v,S,D;D=mg(t,c,h,d);for(f in c)pg[f]||(u=c[f],Dr(u)||(v=v||jl(t),v&&v.isTracking(f)?u=ka(u)?{velocity:u}:{velocity:v.get(f)}:(p=+u||0,_=Math.abs(p/d))),Dr(u)&&(ka(u.velocity)?p=u.velocity:(v=v||jl(t),p=v&&v.isTracking(f)?v.get(f):0),_=lg(i,n,Math.abs(p/Ql(u,"resistance",d))),m=parseFloat(h(t,f))||0,g=m+Jh(p,_),"end"in u&&(u=dg(u,D&&f in D?D:g,u.max,u.min,f,c.radius,p),o&&(Ba===e&&(Ba=c=gv(e)),c[f]=mv(u,c[f],"end"))),"max"in u&&g>+u.max+Qm?(S=u.unitFactor||Oa.unitFactors[f]||1,b=m>u.max&&u.min!==u.max||p*S>-15&&p*S<45?i+(n-i)*.1:eg(m,u.max,p),b+s<l&&(l=b+s)):"min"in u&&g<+u.min-Qm&&(S=u.unitFactor||Oa.unitFactors[f]||1,b=m<u.min&&u.min!==u.max||p*S>-45&&p*S<15?i+(n-i)*.1:eg(m,u.min,p),b+s<l&&(l=b+s)),b>a&&(a=b)),_>a&&(a=_));return a>l&&(a=l),a>n?n:a<i?i:a},ng=function(){Ye=ug(),Ye&&(jm=Ye.parseEase,rg=Ye.utils.toArray,sg=Ye.utils.getUnit,ag=Ye.core.getCache,lg=Ye.utils.clamp,Yh=Ye.core.getStyleSaver,cg=Ye.core.reverting||function(){},Xh=jm("power3"),Zh=Xh(.05),og=Ye.core.PropTween,Ye.config({resistance:100,unitFactors:{time:1e3,totalTime:1e3,progress:1e3,totalProgress:1e3}}),Oa=Ye.config(),Ye.registerPlugin(fo),ig=1)},po={version:"3.12.5",name:"inertia",register:function(t){Ye=t,ng()},init:function(t,e,n,i,s){ig||ng();var o=jl(t);if(e==="auto"){if(!o){console.warn("No inertia tracking on "+t+". InertiaPlugin.track(target) first.");return}e=o.getAll()}this.styles=Yh&&typeof t.style=="object"&&Yh(t),this.target=t,this.tween=n,Ba=e;var a=t._gsap,l=a.get,c=e.duration,h=Dr(c),d=e.preventOvershoot||h&&c.overshoot===0,f=Ql(e,"resistance",Oa.resistance),u=ka(c)?c:_v(t,e,h&&c.max||10,h&&c.min||.2,h&&"overshoot"in c?+c.overshoot:d?0:1,!0),_,p,m,g,b,v,S,D,T;e=Ba,Ba=0,T=mg(t,e,l,f);for(_ in e)pg[_]||(p=e[_],qh(p)&&(p=p(i,t,s)),ka(p)?b=p:Dr(p)&&!isNaN(p.velocity)?b=+p.velocity:o&&o.isTracking(_)?b=o.get(_):console.warn("ERROR: No velocity was defined for "+t+" property: "+_),v=Jh(b,u),D=0,m=l(t,_),g=sg(m),m=parseFloat(m),Dr(p)&&(S=m+v,"end"in p&&(p=dg(p,T&&_ in T?T:S,p.max,p.min,_,e.radius,b)),"max"in p&&+p.max<S?d||p.preventOvershoot?v=p.max-m:D=p.max-m-v:"min"in p&&+p.min>S&&(d||p.preventOvershoot?v=p.min-m:D=p.min-m-v)),this._props.push(_),this.styles&&this.styles.save(_),this._pt=new og(this._pt,t,_,m,0,dv,0,a.set(t,_,this)),this._pt.u=g||0,this._pt.c1=v,this._pt.c2=D);return n.duration(u),fv},render:function(t,e){var n=e._pt;if(t=Xh(e.tween._time/e.tween._dur),t||!cg())for(;n;)n.set(n.t,n.p,pv(n.s+n.c1*t+n.c2*t*t)+n.u,n.d,t),n=n._next;else e.styles.revert()}};"track,untrack,isTracking,getVelocity,getByTarget".split(",").forEach(function(r){return po[r]=fo[r]});ug()&&Ye.registerPlugin(po);var gg=()=>{Kt.registerPlugin(Yt,Pi,po);let r=Kt.matchMedia(),t=document.querySelector(".gallery-section");t&&getComputedStyle(t).display!=="none"&&(r.add("(max-width: 767px)",()=>{let e=document.querySelector(".gallery_list");Pi.create(e,{type:"x",bounds:{minX:window.innerWidth-e.scrollWidth-40,maxX:0},inertia:!0})}),r.add("(min-width: 768px)",()=>{let e=document.querySelector(".gallery_list"),n=document.querySelector(".is-casestudies_button"),i=document.querySelector(".arrow-button-right"),s=document.querySelector(".arrow-button-left"),o=0,a=1,l=document.querySelectorAll(".gallery_item").length;function c(){let h=document.querySelector(".gallery_item").offsetWidth;Kt.to(e,{duration:.5,x:-o*h}),o===l-1?(s.classList.remove("hide"),i.classList.add("hide"),a=-1):o===0&&(i.classList.remove("hide"),s.classList.add("hide"),a=1)}n.addEventListener("click",()=>{a===1&&o<l-1?o++:a===-1&&o>0&&o--,c()}),c()}))};var xv=/(?:^\s+|\s+$)/g,$h=/([\uD800-\uDBFF][\uDC00-\uDFFF](?:[\u200D\uFE0F][\uD800-\uDBFF][\uDC00-\uDFFF]){2,}|\uD83D\uDC69(?:\u200D(?:(?:\uD83D\uDC69\u200D)?\uD83D\uDC67|(?:\uD83D\uDC69\u200D)?\uD83D\uDC66)|\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D(?:\uD83D\uDC69\u200D)?\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D(?:\uD83D\uDC69\u200D)?\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]\uFE0F|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC6F\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3C-\uDD3E\uDDD6-\uDDDF])\u200D[\u2640\u2642]\uFE0F|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F\u200D[\u2640\u2642]|(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642])\uFE0F|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\uD83D\uDC69\u200D[\u2695\u2696\u2708]|\uD83D\uDC68(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708]))\uFE0F|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83D\uDC69\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|\uD83D\uDC68(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC66\u200D\uD83D\uDC66|(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92])|(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]))|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDD1-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\u200D(?:(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC67|(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC66)|\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC69\uDC6E\uDC70-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD26\uDD30-\uDD39\uDD3D\uDD3E\uDDD1-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])?|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDEEB\uDEEC\uDEF4-\uDEF8]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD4C\uDD50-\uDD6B\uDD80-\uDD97\uDDC0\uDDD0-\uDDE6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267B\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEF8]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD4C\uDD50-\uDD6B\uDD80-\uDD97\uDDC0\uDDD0-\uDDE6])\uFE0F)/;function mo(r){var t=r.nodeType,e="";if(t===1||t===9||t===11){if(typeof r.textContent=="string")return r.textContent;for(r=r.firstChild;r;r=r.nextSibling)e+=mo(r)}else if(t===3||t===4)return r.nodeValue;return e}function mi(r,t,e,n){if(r+="",e&&(r=r.trim?r.trim():r.replace(xv,"")),t&&t!=="")return r.replace(/>/g,">").replace(/</g,"<").split(t);for(var i=[],s=r.length,o=0,a,l;o<s;o++)l=r.charAt(o),(l.charCodeAt(0)>=55296&&l.charCodeAt(0)<=56319||r.charCodeAt(o+1)>=65024&&r.charCodeAt(o+1)<=65039)&&(a=((r.substr(o,12).split($h)||[])[1]||"").length||2,l=r.substr(o,a),i.emoji=1,o+=a-1),i.push(l===">"?">":l==="<"?"<":n&&l===" "&&(r.charAt(o-1)===" "||r.charAt(o+1)===" ")?" ":l);return i}var go,jh,yg,za,vg,tc,yv=/(?:\r|\n|\t\t)/g,vv=/(?:\s\s+)/g,Sv="\xA0",Sg=function(t){go=document,jh=window,za=za||t||jh.gsap||console.warn("Please gsap.registerPlugin(SplitText)"),za&&(tc=za.utils.toArray,vg=za.core.context||function(){},yg=1)},Mv=1,Mg=function(t){return jh.getComputedStyle(t)},Qh=function(t){return t.position==="absolute"||t.absolute===!0},bv=function(t,e){for(var n=e.length,i;--n>-1;)if(i=e[n],t.substr(0,i.length)===i)return i.length},wv=" style='position:relative;display:inline-block;'",_g=function(t,e){t===void 0&&(t="");var n=~t.indexOf("++"),i=1;return n&&(t=t.split("++").join("")),function(){return"<"+e+wv+(t?" class='"+t+(n?i++:"")+"'>":">")}},bg=function r(t,e,n){var i=t.nodeType;if(i===1||i===9||i===11)for(t=t.firstChild;t;t=t.nextSibling)r(t,e,n);else(i===3||i===4)&&(t.nodeValue=t.nodeValue.split(e).join(n))},Kh=function(t,e){for(var n=e.length;--n>-1;)t.push(e[n])},xg=function(t,e,n){for(var i;t&&t!==e;){if(i=t._next||t.nextSibling,i)return i.textContent.charAt(0)===n;t=t.parentNode||t._parent}},Ev=function r(t){var e=tc(t.childNodes),n=e.length,i,s;for(i=0;i<n;i++)s=e[i],s._isSplit?r(s):i&&s.previousSibling&&s.previousSibling.nodeType===3?(s.previousSibling.nodeValue+=s.nodeType===3?s.nodeValue:s.firstChild.nodeValue,t.removeChild(s)):s.nodeType!==3&&(t.insertBefore(s.firstChild,s),t.removeChild(s))},Li=function(t,e){return parseFloat(e[t])||0},Tv=function(t,e,n,i,s,o,a){var l=Mg(t),c=Li("paddingLeft",l),h=-999,d=Li("borderBottomWidth",l)+Li("borderTopWidth",l),f=Li("borderLeftWidth",l)+Li("borderRightWidth",l),u=Li("paddingTop",l)+Li("paddingBottom",l),_=Li("paddingLeft",l)+Li("paddingRight",l),p=Li("fontSize",l)*(e.lineThreshold||.2),m=l.textAlign,g=[],b=[],v=[],S=e.wordDelimiter||" ",D=e.tag?e.tag:e.span?"span":"div",T=e.type||e.split||"chars,words,lines",w=s&&~T.indexOf("lines")?[]:null,P=~T.indexOf("words"),M=~T.indexOf("chars"),y=Qh(e),I=e.linesClass,N=~(I||"").indexOf("++"),C=[],V=l.display==="flex",$=t.style.display,W,Z,z,U,R,at,_t,Ut,X,ot,xt,ct;for(N&&(I=I.split("++").join("")),V&&(t.style.display="block"),Z=t.getElementsByTagName("*"),z=Z.length,R=[],W=0;W<z;W++)R[W]=Z[W];if(w||y)for(W=0;W<z;W++)U=R[W],at=U.parentNode===t,(at||y||M&&!P)&&(ct=U.offsetTop,w&&at&&Math.abs(ct-h)>p&&(U.nodeName!=="BR"||W===0)&&(_t=[],w.push(_t),h=ct),y&&(U._x=U.offsetLeft,U._y=ct,U._w=U.offsetWidth,U._h=U.offsetHeight),w&&((U._isSplit&&at||!M&&at||P&&at||!P&&U.parentNode.parentNode===t&&!U.parentNode._isSplit)&&(_t.push(U),U._x-=c,xg(U,t,S)&&(U._wordEnd=!0)),U.nodeName==="BR"&&(U.nextSibling&&U.nextSibling.nodeName==="BR"||W===0)&&w.push([])));for(W=0;W<z;W++){if(U=R[W],at=U.parentNode===t,U.nodeName==="BR"){w||y?(U.parentNode&&U.parentNode.removeChild(U),R.splice(W--,1),z--):P||t.appendChild(U);continue}if(y&&(X=U.style,!P&&!at&&(U._x+=U.parentNode._x,U._y+=U.parentNode._y),X.left=U._x+"px",X.top=U._y+"px",X.position="absolute",X.display="block",X.width=U._w+1+"px",X.height=U._h+"px"),!P&&M)if(U._isSplit)for(U._next=Z=U.nextSibling,U.parentNode.appendChild(U);Z&&Z.nodeType===3&&Z.textContent===" ";)U._next=Z.nextSibling,U.parentNode.appendChild(Z),Z=Z.nextSibling;else U.parentNode._isSplit?(U._parent=U.parentNode,!U.previousSibling&&U.firstChild&&(U.firstChild._isFirst=!0),U.nextSibling&&U.nextSibling.textContent===" "&&!U.nextSibling.nextSibling&&C.push(U.nextSibling),U._next=U.nextSibling&&U.nextSibling._isFirst?null:U.nextSibling,U.parentNode.removeChild(U),R.splice(W--,1),z--):at||(ct=!U.nextSibling&&xg(U.parentNode,t,S),U.parentNode._parent&&U.parentNode._parent.appendChild(U),ct&&U.parentNode.appendChild(go.createTextNode(" ")),D==="span"&&(U.style.display="inline"),g.push(U));else U.parentNode._isSplit&&!U._isSplit&&U.innerHTML!==""?b.push(U):M&&!U._isSplit&&(D==="span"&&(U.style.display="inline"),g.push(U))}for(W=C.length;--W>-1;)C[W].parentNode.removeChild(C[W]);if(w){for(y&&(ot=go.createElement(D),t.appendChild(ot),xt=ot.offsetWidth+"px",ct=ot.offsetParent===t?0:t.offsetLeft,t.removeChild(ot)),X=t.style.cssText,t.style.cssText="display:none;";t.firstChild;)t.removeChild(t.firstChild);for(Ut=S===" "&&(!y||!P&&!M),W=0;W<w.length;W++){for(_t=w[W],ot=go.createElement(D),ot.style.cssText="display:block;text-align:"+m+";position:"+(y?"absolute;":"relative;"),I&&(ot.className=I+(N?W+1:"")),v.push(ot),z=_t.length,Z=0;Z<z;Z++)_t[Z].nodeName!=="BR"&&(U=_t[Z],ot.appendChild(U),Ut&&U._wordEnd&&ot.appendChild(go.createTextNode(" ")),y&&(Z===0&&(ot.style.top=U._y+"px",ot.style.left=c+ct+"px"),U.style.top="0px",ct&&(U.style.left=U._x-ct+"px")));z===0?ot.innerHTML=" ":!P&&!M&&(Ev(ot),bg(ot,"\xA0"," ")),y&&(ot.style.width=xt,ot.style.height=U._h+"px"),t.appendChild(ot)}t.style.cssText=X}y&&(a>t.clientHeight&&(t.style.height=a-u+"px",t.clientHeight<a&&(t.style.height=a+d+"px")),o>t.clientWidth&&(t.style.width=o-_+"px",t.clientWidth<o&&(t.style.width=o+f+"px"))),V&&($?t.style.display=$:t.style.removeProperty("display")),Kh(n,g),P&&Kh(i,b),Kh(s,v)},Av=function(t,e,n,i){var s=e.tag?e.tag:e.span?"span":"div",o=e.type||e.split||"chars,words,lines",a=~o.indexOf("chars"),l=Qh(e),c=e.wordDelimiter||" ",h=function(y){return y===c||y===Sv&&c===" "},d=c!==" "?"":l?"­ ":" ",f="</"+s+">",u=1,_=e.specialChars?typeof e.specialChars=="function"?e.specialChars:bv:null,p,m,g,b,v,S,D,T,w=go.createElement("div"),P=t.parentNode;for(P.insertBefore(w,t),w.textContent=t.nodeValue,P.removeChild(t),t=w,p=mo(t),D=p.indexOf("<")!==-1,e.reduceWhiteSpace!==!1&&(p=p.replace(vv," ").replace(yv,"")),D&&(p=p.split("<").join("{{LT}}")),v=p.length,m=(p.charAt(0)===" "?d:"")+n(),g=0;g<v;g++)if(S=p.charAt(g),_&&(T=_(p.substr(g),e.specialChars)))S=p.substr(g,T||1),m+=a&&S!==" "?i()+S+"</"+s+">":S,g+=T-1;else if(h(S)&&!h(p.charAt(g-1))&&g){for(m+=u?f:"",u=0;h(p.charAt(g+1));)m+=d,g++;g===v-1?m+=d:p.charAt(g+1)!==")"&&(m+=d+n(),u=1)}else S==="{"&&p.substr(g,6)==="{{LT}}"?(m+=a?i()+"{{LT}}</"+s+">":"{{LT}}",g+=5):S.charCodeAt(0)>=55296&&S.charCodeAt(0)<=56319||p.charCodeAt(g+1)>=65024&&p.charCodeAt(g+1)<=65039?(b=((p.substr(g,12).split($h)||[])[1]||"").length||2,m+=a&&S!==" "?i()+p.substr(g,b)+"</"+s+">":p.substr(g,b),g+=b-1):m+=a&&S!==" "?i()+S+"</"+s+">":S;t.outerHTML=m+(u?f:""),D&&bg(P,"{{LT}}","<")},Dv=function r(t,e,n,i){var s=tc(t.childNodes),o=s.length,a=Qh(e),l,c;if(t.nodeType!==3||o>1){for(e.absolute=!1,l=0;l<o;l++)c=s[l],c._next=c._isFirst=c._parent=c._wordEnd=null,(c.nodeType!==3||/\S+/.test(c.nodeValue))&&(a&&c.nodeType!==3&&Mg(c).display==="inline"&&(c.style.display="inline-block",c.style.position="relative"),c._isSplit=!0,r(c,e,n,i));e.absolute=a,t._isSplit=!0;return}Av(t,e,n,i)},dn=function(){function r(e,n){yg||Sg(),this.elements=tc(e),this.chars=[],this.words=[],this.lines=[],this._originals=[],this.vars=n||{},vg(this),Mv&&this.split(n)}var t=r.prototype;return t.split=function(n){this.isSplit&&this.revert(),this.vars=n=n||this.vars,this._originals.length=this.chars.length=this.words.length=this.lines.length=0;for(var i=this.elements.length,s=n.tag?n.tag:n.span?"span":"div",o=_g(n.wordsClass,s),a=_g(n.charsClass,s),l,c,h;--i>-1;)h=this.elements[i],this._originals[i]={html:h.innerHTML,style:h.getAttribute("style")},l=h.clientHeight,c=h.clientWidth,Dv(h,n,o,a),Tv(h,n,this.chars,this.words,this.lines,c,l);return this.chars.reverse(),this.words.reverse(),this.lines.reverse(),this.isSplit=!0,this},t.revert=function(){var n=this._originals;if(!n)throw"revert() call wasn't scoped properly.";return this.elements.forEach(function(i,s){i.innerHTML=n[s].html,i.setAttribute("style",n[s].style)}),this.chars=[],this.words=[],this.lines=[],this.isSplit=!1,this},r.create=function(n,i){return new r(n,i)},r}();dn.version="3.12.5";dn.register=Sg;var wg=()=>{if(Kt.registerPlugin(Yt,dn),document.querySelector("#scope-section")){let e=function(){Kt.set(t,{width:"3em"}),Kt.set(".teamt_txt",{display:"none"})},n=function(i){let s=document.querySelector(".team_wrap_item.open");s&&s!==i&&(Kt.to(s,{width:"3em",duration:.1}),Kt.to(s.querySelector(".teamt_txt"),{display:"none",duration:.1}),s.classList.remove("open")),i.classList.contains("open")?(i.classList.remove("open"),Kt.to(i,{width:"3em",duration:.3}),Kt.to(i.querySelector(".teamt_txt"),{display:"none",duration:.1})):(i.classList.add("open"),Kt.to(i,{width:"10.2em",duration:.2}),Kt.to(i.querySelector(".teamt_txt"),{display:"block",duration:.3,delay:.5}))};document.querySelectorAll(".casestudy-stack-team").forEach(i=>{let s=Kt.timeline({scrollTrigger:{trigger:i,start:"10% 60%",toggleActions:"play none none reverse",invalidateOnRefresh:!0,smoothScroll:!0}});if(i.querySelector(".border-scope")){let a=i.querySelector(".border-scope");s.fromTo(a,{y:"0",x:"0",opacity:0},{y:"0.51em",x:"-0.51em",opacity:1,duration:.75,ease:"circ.out"})}let o=i.querySelectorAll(".collection-logo-item");o.length&&s.fromTo(o,{y:"100%",autoAlpha:0},{y:"0%",autoAlpha:1,duration:.5,stagger:.1,ease:"circ.out"},">-0.5")});let t=document.querySelectorAll(".team_wrap_item");e(),t.forEach(i=>{i.addEventListener("click",()=>n(i))})}};var Eg=()=>{Kt.registerPlugin(Yt,Pi,po);let r=Kt.utils.toArray(".people_wrap"),t=Kt.matchMedia();t.add("(max-width: 991px)",()=>{let e=document.querySelector(".people_wrapper"),n=r.map((s,o)=>-(s.clientWidth+40)*o),i=Kt.utils.snap(n);Pi.create(e,{type:"x",bounds:{minX:window.innerWidth-e.scrollWidth-40,maxX:0},inertia:!0,snap:{x:function(s){return i(s)}}})}),t.add("(min-width: 992px)",()=>{let e=document.querySelector(".people_wrapper"),n=document.querySelector(".people_wrap"),i=document.querySelector(".case-studies_team-wrapper"),s=e.children.length,o=n.getBoundingClientRect().width,l=window.getComputedStyle(e).getPropertyValue("grid-column-gap");l=parseFloat(l),e.style.width=`${s*(o+l)-l}px`;let c=Kt.timeline({scrollTrigger:{trigger:".team-container",start:"top top",end:`+=${s*(o+l)+window.innerWidth}`,scrub:!0,pin:!0,anticipatePin:1,ease:"none"}});c.to(".team-heading-container",{right:0,duration:1}).to(".scrolled-heading",{color:"#17171D"}),s<5?(c.to(e,{xPercent:-50,left:"50%"}),c.to(i,{left:"0"})):c.to(i,{left:"0"}),c.to(e,{x:`-${s*(o+l)-window.innerWidth}px`})})};var Tg=()=>{let r=document.querySelectorAll("[data-contact-popup-toggler]"),t=document.querySelector("[data-contact-popup]");var e=0;if(!r||!t)return;let n=t.querySelector("[data-contact-popup-close]");if(!n)return;let i=t.querySelector(".contact-popup_box");if(!i)return;let s=(o,a)=>{let l=document.createElement("script"),c=document.getElementsByTagName("script")[0];l.async=1,l.onload=l.onreadystatechange=(h,d)=>{(d||!l.readyState||/loaded|complete/.test(l.readyState))&&(l.onload=l.onreadystatechange=null,l=void 0,d||a&&a())},l.src=o,c.parentNode.insertBefore(l,c)};r.forEach(o=>{o.addEventListener("click",a=>{a.preventDefault,e?(t.classList.add("-open"),document.body.classList.add("-popup-open")):s("https://embed.typeform.com/next/embed.js",()=>{e=1,t.classList.add("-open"),document.body.classList.add("-popup-open")})})}),n.addEventListener("click",o=>{o.preventDefault,t.classList.remove("-open"),document.body.classList.remove("-popup-open")}),t.addEventListener("click",o=>{i.contains(o.target)||(t.classList.remove("-open"),document.body.classList.remove("-popup-open"))}),new URL(document.location).searchParams.has("invicible")&&setTimeout(()=>{s("https://embed.typeform.com/next/embed.js",()=>{e=1,setTimeout(()=>{t.classList.add("-open"),document.body.classList.add("-popup-open")},200)})},2e3)};var Ag=()=>{let r=new Date().toLocaleTimeString("pl-PL",{timeZone:"Poland"}).split(":");return r[0]+" - "+r[1]},Dg=()=>{let r=document.querySelectorAll("[data-current-time]");r.length>0&&r.forEach(t=>{t.textContent=Ag(),setInterval(()=>{t.textContent=Ag()},5e3)})};var Cg=()=>{Kt.registerPlugin(Yt,dn),document.querySelectorAll("[data-header-animation]").forEach(t=>{let e=t.querySelector("h2");if(e.classList.contains("is-all-strong")&&(e=e.querySelector("strong")),!e)return;let n=new dn(e,{type:"lines",tag:"span"}),i=new dn(e,{type:"lines",linesClass:"header_line"});n.lines=i.chars.concat(n.lines);let s=Kt.timeline({scrollTrigger:{trigger:t,start:"top bottom",toggleActions:"play none none reset"}});s.fromTo(n.lines,{y:100},{y:0,duration:.75,stagger:.05,ease:"circ.out"},"+=0.25");let o=t.querySelector(".hero_holo");o&&s.fromTo(o,{autoAlpha:0},{autoAlpha:1,duration:.75,ease:"circ.out"},"+-=0.25");let a=t.querySelector(".button");a&&s.fromTo(a,{autoAlpha:0},{autoAlpha:1,duration:.75,ease:"circ.out"},"-=0.75")})};var Rg=()=>{if(Kt.registerPlugin(Yt,dn),document.querySelector(".hero_grid")){let r=document.querySelector(".hero_grid"),t=r.querySelector(".hero_holo"),e=r.querySelector("h1"),n=r.querySelector(".paragraph-big"),i=new dn(e,{type:"lines",tag:"span"}),s=new dn(e,{type:"lines",linesClass:"header_line"});i.lines=s.chars.concat(i.lines),Kt.timeline({scrollTrigger:{trigger:r,start:"top bottom",toggleActions:"play none none reset"}}).fromTo(n,{autoAlpha:0},{autoAlpha:1,duration:.35,ease:"circ.out"},"+=1.75").fromTo(i.lines,{y:"100%"},{y:0,duration:.75,stagger:.05,ease:"circ.out"},"-=0.25").fromTo(t,{autoAlpha:0},{autoAlpha:1,duration:.75,ease:"circ.out"},"+-=0.25")}};var Pg=()=>{let r=document.querySelector(".is-section-loader");if(!r)return;let t=r.querySelector(".loader_line"),e=r.querySelector(".loader_value");!t||!e||Kt.to(t,{width:"100%",duration:1.5,onUpdate:function(){let n=Math.round(this.progress()*100);e.innerHTML=`${n}%`},onComplete:function(){Kt.to(r,{y:"-100dvh",duration:.75})}},"<")};var Ig=()=>{Kt.registerPlugin(Yt);let r=Kt.matchMedia();r.add("(max-width: 991px)",()=>{let t=Kt.timeline({scrollTrigger:{trigger:".casestudies-container",start:"top center",end:"center center",scrub:1}});Kt.set(".dotted-line",{scaleY:0,transformOrigin:"top center"}),t.fromTo(".circle-wrapper",{opacity:0,scale:.9},{opacity:1,scale:1,duration:.75,ease:"power2.out"}).from(".circle_red",{opacity:0,scale:.8,duration:.75,ease:"power2.out"},"-=0.6").to(".dotted-line",{scaleY:1,duration:.75,ease:"power2.inOut"},"-=0.2").from(".circle_blue",{opacity:0,scale:.8,duration:.75,ease:"power2.out"},"-=0.2")}),r.add("(min-width: 992px)",()=>{Kt.timeline({scrollTrigger:{trigger:".casestudies-container",start:"top top",end:"bottom top",scrub:!0,pin:!0}}).to(".circle_red",{scale:.7,top:"30%",left:"10%",ease:"none"},0).to(".circle_blue",{scale:1,top:"6%",ease:"none"},0).to(".dotted-line",{rotate:"-25deg",x:"-6em",ease:"none"},0)})};var Lg=()=>{Kt.registerPlugin(Yt,dn),document.querySelectorAll(".problems-solutions-container").forEach(t=>{let e=t.querySelector("h3");e.classList.contains("is-all-strong")&&(e=e.querySelector("strong"));let n=new dn(e,{type:"lines",tag:"span"}),i=new dn(e,{type:"lines",linesClass:"header_line"});n.lines=i.chars.concat(n.lines);let s=Kt.timeline({scrollTrigger:{trigger:t,start:"top bottom",toggleActions:"play none none reset"}});s.fromTo(n.lines,{y:100},{y:0,duration:.75,stagger:.05,ease:"circ.out"},"+=0.25"),s.fromTo(t.querySelector(".casestudies-description-heading"),{autoAlpha:0,y:"3rem"},{y:0,autoAlpha:1,duration:.5,ease:"circ.out"},">-0.5"),s.fromTo(t.querySelector(".casestudies-description"),{autoAlpha:0,y:"3rem"},{y:0,autoAlpha:1,duration:.5,ease:"circ.out"},">-0.5")})};var ec=function(){function r(e){this.chars=mi(e),this.sets=[],this.length=50;for(var n=0;n<20;n++)this.sets[n]=Ng(80,this.chars)}var t=r.prototype;return t.grow=function(n){for(var i=0;i<20;i++)this.sets[i]+=Ng(n-this.length,this.chars);this.length=n},r}(),vs,Bg,kg=function(){return vs||typeof window<"u"&&(vs=window.gsap)&&vs.registerPlugin&&vs},Cv=1,Fg=/\s+/g,Ng=function(t,e){for(var n=e.length,i="";--t>-1;)i+=e[~~(Math.random()*n)];return i},tf="ABCDEFGHIJKLMNOPQRSTUVWXYZ",Ug=tf.toLowerCase(),Rv={upperCase:new ec(tf),lowerCase:new ec(Ug),upperAndLowerCase:new ec(tf+Ug)},Og=function(){Bg=vs=kg()},Va={version:"3.12.5",name:"scrambleText",register:function(t,e,n){vs=t,Og()},init:function(t,e,n,i,s){if(Bg||Og(),this.prop="innerHTML"in t?"innerHTML":"textContent"in t?"textContent":0,!!this.prop){this.target=t,typeof e!="object"&&(e={text:e});var o=e.text||e.value||"",a=e.trim!==!1,l=this,c,h,d,f;return l.delimiter=c=e.delimiter||"",l.original=mi(mo(t).replace(Fg," ").split(" ").join(""),c,a),(o==="{original}"||o===!0||o==null)&&(o=l.original.join(c)),l.text=mi((o||"").replace(Fg," "),c,a),l.hasClass=!!(e.newClass||e.oldClass),l.newClass=e.newClass,l.oldClass=e.oldClass,f=c==="",l.textHasEmoji=f&&!!l.text.emoji,l.charsHaveEmoji=!!e.chars&&!!mi(e.chars).emoji,l.length=f?l.original.length:l.original.join(c).length,l.lengthDif=(f?l.text.length:l.text.join(c).length)-l.length,l.fillChar=e.fillChar||e.chars&&~e.chars.indexOf(" ")?" ":"",l.charSet=d=Rv[e.chars||"upperCase"]||new ec(e.chars),l.speed=.05/(e.speed||1),l.prevScrambleTime=0,l.setIndex=Math.random()*20|0,h=l.length+Math.max(l.lengthDif,0),h>d.length&&d.grow(h),l.chars=d.sets[l.setIndex],l.revealDelay=e.revealDelay||0,l.tweenLength=e.tweenLength!==!1,l.tween=n,l.rightToLeft=!!e.rightToLeft,l._props.push("scrambleText","text"),Cv}},render:function(t,e){var n=e.target,i=e.prop,s=e.text,o=e.delimiter,a=e.tween,l=e.prevScrambleTime,c=e.revealDelay,h=e.setIndex,d=e.chars,f=e.charSet,u=e.length,_=e.textHasEmoji,p=e.charsHaveEmoji,m=e.lengthDif,g=e.tweenLength,b=e.oldClass,v=e.newClass,S=e.rightToLeft,D=e.fillChar,T=e.speed,w=e.original,P=e.hasClass,M=s.length,y=a._time,I=y-l,N,C,V,$,W,Z,z,U,R,at,_t;c&&(a._from&&(y=a._dur-y),t=y===0?0:y<c?1e-6:y===a._dur?1:a._ease((y-c)/(a._dur-c))),t<0?t=0:t>1&&(t=1),S&&(t=1-t),N=~~(t*M+.5),t?((I>T||I<-T)&&(e.setIndex=h=(h+(Math.random()*19|0))%20,e.chars=f.sets[h],e.prevScrambleTime+=I),$=d):$=w.join(o),_t=a._from?t:1-t,at=u+(g?a._from?_t*_t*_t:1-_t*_t*_t:1)*m,S?t===1&&(a._from||a.data==="isFromStart")?(V="",$=w.join(o)):(z=s.slice(N).join(o),p?V=mi($).slice(0,at-(_?mi(z):z).length+.5|0).join(""):V=$.substr(0,at-(_?mi(z):z).length+.5|0),$=z):(V=s.slice(0,N).join(o),C=(_?mi(V):V).length,p?$=mi($).slice(C,at+.5|0).join(""):$=$.substr(C,at-C+.5|0)),P?(U=S?b:v,R=S?v:b,W=U&&N!==0,Z=R&&N!==M,z=(W?"<span class='"+U+"'>":"")+V+(W?"</span>":"")+(Z?"<span class='"+R+"'>":"")+o+$+(Z?"</span>":"")):z=V+o+$,n[i]=D===" "&&~z.indexOf(" ")?z.split(" ").join(" "):z}};Va.emojiSafeSplit=mi;Va.getText=mo;kg()&&vs.registerPlugin(Va);Kt.registerPlugin(Va);var zg=()=>{document.querySelectorAll("[data-scramble-link]").forEach(t=>{let e=t.querySelector("[data-scramble-text]");if(!e)return;let n=e.textContent;t.addEventListener("mouseenter",()=>{Kt.matchMedia().add("(min-width: 768px)",()=>{Kt.to(e,{duration:1,scrambleText:{text:n,chars:"10"}})})})})};function Vg(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function Pv(r,t,e){return t&&Vg(r.prototype,t),e&&Vg(r,e),r}var ye,nc,rn,Ms,_o,gi,Iv,Ss,Hg,re,Fi,ic,Gg,Wg,Xg,Yg,qg=function(){return typeof window<"u"},Zg=function(){return ye||qg()&&(ye=window.gsap)&&ye.registerPlugin&&ye};var Lv=function(t){return Math.round(t*1e5)/1e5||0},Cr=function(t){return re.maxScroll(t||rn)},Fv=function(t,e){var n=t.parentNode||_o,i=t.getBoundingClientRect(),s=n.getBoundingClientRect(),o=s.top-i.top,a=s.bottom-i.bottom,l=(Math.abs(o)>Math.abs(a)?o:a)/(1-e),c=-l*e,h,d;return l>0&&(h=s.height/(rn.innerHeight+s.height),d=h===.5?s.height*2:Math.min(s.height,Math.abs(-l*h/(2*h-1)))*2*(e||1),c+=e?-d*e:-d/2,l+=d),{change:l,offset:c}},Nv=function(t){var e=Ms.querySelector(".ScrollSmoother-wrapper");return e||(e=Ms.createElement("div"),e.classList.add("ScrollSmoother-wrapper"),t.parentNode.insertBefore(e,t),e.appendChild(t)),e},ji=function(){function r(t){var e=this;nc||r.register(ye)||console.warn("Please gsap.registerPlugin(ScrollSmoother)"),t=this.vars=t||{},Fi&&Fi.kill(),Fi=this,Xg(this);var n=t,i=n.smoothTouch,s=n.onUpdate,o=n.onStop,a=n.smooth,l=n.onFocusIn,c=n.normalizeScroll,h=n.wholePixels,d,f,u,_,p,m,g,b,v,S,D,T,w,P,M=this,y=t.effectsPrefix||"",I=re.getScrollFunc(rn),N=re.isTouch===1?i===!0?.8:parseFloat(i)||0:a===0||a===!1?0:parseFloat(a)||.8,C=N&&+t.speed||1,V=0,$=0,W=1,Z=Gg(0),z=function(){return Z.update(-V)},U={y:0},R=function(){return d.style.overflow="visible"},at,_t=function(x){x.update();var F=x.getTween();F&&(F.pause(),F._time=F._dur,F._tTime=F._tDur),at=!1,x.animation.progress(x.progress,!0)},Ut=function(x,F){(x!==V&&!S||F)&&(h&&(x=Math.round(x)),N&&(d.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+x+", 0, 1)",d._gsap.y=x+"px"),$=x-V,V=x,re.isUpdating||r.isRefreshing||re.update())},X=function(x){return arguments.length?(x<0&&(x=0),U.y=-x,at=!0,S?V=-x:Ut(-x),re.isRefreshing?_.update():I(x/C),this):-V},ot=typeof ResizeObserver<"u"&&t.autoResize!==!1&&new ResizeObserver(function(){if(!re.isRefreshing){var A=Cr(f)*C;A<-V&&X(A),Yg.restart(!0)}}),xt,ct=function(x){f.scrollTop=0,!(x.target.contains&&x.target.contains(f)||l&&l(e,x)===!1)&&(re.isInViewport(x.target)||x.target===xt||e.scrollTo(x.target,!1,"center center"),xt=x.target)},Rt=function(x,F){if(x<F.start)return x;var Y=isNaN(F.ratio)?1:F.ratio,tt=F.end-F.start,it=x-F.start,vt=F.offset||0,pt=F.pins||[],lt=pt.offset||0,Lt=F._startClamp&&F.start<=0||F.pins&&F.pins.offset?0:F._endClamp&&F.end===Cr()?1:.5;return pt.forEach(function(ht){tt-=ht.distance,ht.nativeStart<=x&&(it-=ht.distance)}),lt&&(it*=(tt-lt/Y)/tt),x+(it-vt*Lt)/Y-it},kt=function A(x,F,Y){Y||(x.pins.length=x.pins.offset=0);var tt=x.pins,it=x.markers,vt,pt,lt,Lt,ht,yt,qt,ut;for(qt=0;qt<F.length;qt++)if(ut=F[qt],x.trigger&&ut.trigger&&x!==ut&&(ut.trigger===x.trigger||ut.pinnedContainer===x.trigger||x.trigger.contains(ut.trigger))&&(ht=ut._startNative||ut._startClamp||ut.start,yt=ut._endNative||ut._endClamp||ut.end,lt=Rt(ht,x),Lt=ut.pin&&yt>0?lt+(yt-ht):Rt(yt,x),ut.setPositions(lt,Lt,!0,(ut._startClamp?Math.max(0,lt):lt)-ht),ut.markerStart&&it.push(ye.quickSetter([ut.markerStart,ut.markerEnd],"y","px")),ut.pin&&ut.end>0&&!Y)){if(vt=ut.end-ut.start,pt=x._startClamp&&ut.start<0,pt){if(x.start>0){x.setPositions(0,x.end+(x._startNative-x.start),!0),A(x,F);return}vt+=ut.start,tt.offset=-ut.start}tt.push({start:ut.start,nativeStart:ht,end:ut.end,distance:vt,trig:ut}),x.setPositions(x.start,x.end+(pt?-ut.start:vt),!0)}},q=function(x,F){p.forEach(function(Y){return kt(Y,x,F)})},$t=function(){R(),requestAnimationFrame(R),p&&(re.getAll().forEach(function(x){x._startNative=x.start,x._endNative=x.end}),p.forEach(function(x){var F=x._startClamp||x.start,Y=x.autoSpeed?Math.min(Cr(),x.end):F+Math.abs((x.end-F)/x.ratio),tt=Y-x.end;if(F-=tt/2,Y-=tt/2,F>Y){var it=F;F=Y,Y=it}x._startClamp&&F<0?(Y=x.ratio<0?Cr():x.end/x.ratio,tt=Y-x.end,F=0):(x.ratio<0||x._endClamp&&Y>=Cr())&&(Y=Cr(),F=x.ratio<0||x.ratio>1?0:Y-(Y-x.start)/x.ratio,tt=(Y-F)*x.ratio-(x.end-x.start)),x.offset=tt||1e-4,x.pins.length=x.pins.offset=0,x.setPositions(F,Y,!0)}),q(re.sort())),Z.reset()},It=function(){return re.addEventListener("refresh",$t)},Ft=function(){return p&&p.forEach(function(x){return x.vars.onRefresh(x)})},bt=function(){return p&&p.forEach(function(x){return x.vars.onRefreshInit(x)}),Ft},Et=function(x,F,Y,tt){return function(){var it=typeof F=="function"?F(Y,tt):F;it||it===0||(it=tt.getAttribute("data-"+y+x)||(x==="speed"?1:0)),tt.setAttribute("data-"+y+x,it);var vt=(it+"").substr(0,6)==="clamp(";return{clamp:vt,value:vt?it.substr(6,it.length-7):it}}},Ht=function(x,F,Y,tt,it){it=(typeof it=="function"?it(tt,x):it)||0;var vt=Et("speed",F,tt,x),pt=Et("lag",Y,tt,x),lt=ye.getProperty(x,"y"),Lt=x._gsap,ht,yt,qt,ut,Tt,Wt,Zt=[],ue=function(){F=vt(),Y=parseFloat(pt().value),ht=parseFloat(F.value)||1,qt=F.value==="auto",Tt=qt||yt&&yt._startClamp&&yt.start<=0||Zt.offset?0:yt&&yt._endClamp&&yt.end===Cr()?1:.5,ut&&ut.kill(),ut=Y&&ye.to(x,{ease:ic,overwrite:!1,y:"+=0",duration:Y}),yt&&(yt.ratio=ht,yt.autoSpeed=qt)},Jt=function(){Lt.y=lt+"px",Lt.renderTransform(1),ue()},k=[],Q=0,st=function(gt){if(qt){Jt();var Bt=Fv(x,Hg(0,1,-gt.start/(gt.end-gt.start)));Q=Bt.change,Wt=Bt.offset}else Wt=Zt.offset||0,Q=(gt.end-gt.start-Wt)*(1-ht);Zt.forEach(function(ne){return Q-=ne.distance*(1-ht)}),gt.offset=Q||.001,gt.vars.onUpdate(gt),ut&&ut.progress(1)};return ue(),(ht!==1||qt||ut)&&(yt=re.create({trigger:qt?x.parentNode:x,start:function(){return F.clamp?"clamp(top bottom+="+it+")":"top bottom+="+it},end:function(){return F.value<0?"max":F.clamp?"clamp(bottom top-="+it+")":"bottom top-="+it},scroller:f,scrub:!0,refreshPriority:-999,onRefreshInit:Jt,onRefresh:st,onKill:function(gt){var Bt=p.indexOf(gt);Bt>=0&&p.splice(Bt,1),Jt()},onUpdate:function(gt){var Bt=lt+Q*(gt.progress-Tt),ne=Zt.length,Mt=0,L,rt,O;if(gt.offset){if(ne){for(rt=-V,O=gt.end;ne--;){if(L=Zt[ne],L.trig.isActive||rt>=L.start&&rt<=L.end){ut&&(L.trig.progress+=L.trig.direction<0?.001:-.001,L.trig.update(0,0,1),ut.resetTo("y",parseFloat(Lt.y),-$,!0),W&&ut.progress(1));return}rt>L.end&&(Mt+=L.distance),O-=L.distance}Bt=lt+Mt+Q*((ye.utils.clamp(gt.start,gt.end,rt)-gt.start-Mt)/(O-gt.start)-Tt)}k.length&&!qt&&k.forEach(function(j){return j(Bt-Mt)}),Bt=Lv(Bt+Wt),ut?(ut.resetTo("y",Bt,-$,!0),W&&ut.progress(1)):(Lt.y=Bt+"px",Lt.renderTransform(1))}}}),st(yt),ye.core.getCache(yt.trigger).stRevert=bt,yt.startY=lt,yt.pins=Zt,yt.markers=k,yt.ratio=ht,yt.autoSpeed=qt,x.style.willChange="transform"),yt};It(),re.addEventListener("killAll",It),ye.delayedCall(.5,function(){return W=0}),this.scrollTop=X,this.scrollTo=function(A,x,F){var Y=ye.utils.clamp(0,Cr(),isNaN(A)?e.offset(A,F,!!x&&!S):+A);x?S?ye.to(e,{duration:N,scrollTop:Y,overwrite:"auto",ease:ic}):I(Y):X(Y)},this.offset=function(A,x,F){A=Ss(A)[0];var Y=A.style.cssText,tt=re.create({trigger:A,start:x||"top top"}),it;return p&&(W?re.refresh():q([tt],!0)),it=tt.start/(F?C:1),tt.kill(!1),A.style.cssText=Y,ye.core.getCache(A).uncache=1,it};function G(){return u=d.clientHeight,d.style.overflow="visible",gi.style.height=rn.innerHeight+(u-rn.innerHeight)/C+"px",u-rn.innerHeight}this.content=function(A){if(arguments.length){var x=Ss(A||"#smooth-content")[0]||console.warn("ScrollSmoother needs a valid content element.")||gi.children[0];return x!==d&&(d=x,v=d.getAttribute("style")||"",ot&&ot.observe(d),ye.set(d,{overflow:"visible",width:"100%",boxSizing:"border-box",y:"+=0"}),N||ye.set(d,{clearProps:"transform"})),this}return d},this.wrapper=function(A){return arguments.length?(f=Ss(A||"#smooth-wrapper")[0]||Nv(d),b=f.getAttribute("style")||"",G(),ye.set(f,N?{overflow:"hidden",position:"fixed",height:"100%",width:"100%",top:0,left:0,right:0,bottom:0}:{overflow:"visible",position:"relative",width:"100%",height:"auto",top:"auto",bottom:"auto",left:"auto",right:"auto"}),this):f},this.effects=function(A,x){var F;if(p||(p=[]),!A)return p.slice(0);A=Ss(A),A.forEach(function(ht){for(var yt=p.length;yt--;)p[yt].trigger===ht&&p[yt].kill()}),x=x||{};var Y=x,tt=Y.speed,it=Y.lag,vt=Y.effectsPadding,pt=[],lt,Lt;for(lt=0;lt<A.length;lt++)Lt=Ht(A[lt],tt,it,lt,vt),Lt&&pt.push(Lt);return(F=p).push.apply(F,pt),x.refresh!==!1&&re.refresh(),pt},this.sections=function(A,x){var F;if(m||(m=[]),!A)return m.slice(0);var Y=Ss(A).map(function(tt){return re.create({trigger:tt,start:"top 120%",end:"bottom -20%",onToggle:function(vt){tt.style.opacity=vt.isActive?"1":"0",tt.style.pointerEvents=vt.isActive?"all":"none"}})});return x&&x.add?(F=m).push.apply(F,Y):m=Y.slice(0),Y},this.content(t.content),this.wrapper(t.wrapper),this.render=function(A){return Ut(A||A===0?A:V)},this.getVelocity=function(){return Z.getVelocity(-V)},re.scrollerProxy(f,{scrollTop:X,scrollHeight:function(){return G()&&gi.scrollHeight},fixedMarkers:t.fixedMarkers!==!1&&!!N,content:d,getBoundingClientRect:function(){return{top:0,left:0,width:rn.innerWidth,height:rn.innerHeight}}}),re.defaults({scroller:f});var jt=re.getAll().filter(function(A){return A.scroller===rn||A.scroller===f});jt.forEach(function(A){return A.revert(!0,!0)}),_=re.create({animation:ye.fromTo(U,{y:function(){return P=0,0}},{y:function(){return P=1,-G()},immediateRender:!1,ease:"none",data:"ScrollSmoother",duration:100,onUpdate:function(){if(P){var x=at;x&&(_t(_),U.y=V),Ut(U.y,x),z(),s&&!S&&s(M)}}}),onRefreshInit:function(x){if(!r.isRefreshing){if(r.isRefreshing=!0,p){var F=re.getAll().filter(function(tt){return!!tt.pin});p.forEach(function(tt){tt.vars.pinnedContainer||F.forEach(function(it){if(it.pin.contains(tt.trigger)){var vt=tt.vars;vt.pinnedContainer=it.pin,tt.vars=null,tt.init(vt,tt.animation)}})})}var Y=x.getTween();w=Y&&Y._end>Y._dp._time,T=V,U.y=0,N&&(re.isTouch===1&&(f.style.position="absolute"),f.scrollTop=0,re.isTouch===1&&(f.style.position="fixed"))}},onRefresh:function(x){x.animation.invalidate(),x.setPositions(x.start,G()/C),w||_t(x),U.y=-I()*C,Ut(U.y),W||(w&&(at=!1),x.animation.progress(ye.utils.clamp(0,1,T/C/-x.end))),w&&(x.progress-=.001,x.update()),r.isRefreshing=!1},id:"ScrollSmoother",scroller:rn,invalidateOnRefresh:!0,start:0,refreshPriority:-9999,end:function(){return G()/C},onScrubComplete:function(){Z.reset(),o&&o(e)},scrub:N||!0}),this.smooth=function(A){return arguments.length&&(N=A||0,C=N&&+t.speed||1,_.scrubDuration(A)),_.getTween()?_.getTween().duration():0},_.getTween()&&(_.getTween().vars.ease=t.ease||ic),this.scrollTrigger=_,t.effects&&this.effects(t.effects===!0?"[data-"+y+"speed], [data-"+y+"lag]":t.effects,{effectsPadding:t.effectsPadding,refresh:!1}),t.sections&&this.sections(t.sections===!0?"[data-section]":t.sections),jt.forEach(function(A){A.vars.scroller=f,A.revert(!1,!0),A.init(A.vars,A.animation)}),this.paused=function(A,x){return arguments.length?(!!S!==A&&(A?(_.getTween()&&_.getTween().pause(),I(-V/C),Z.reset(),D=re.normalizeScroll(),D&&D.disable(),S=re.observe({preventDefault:!0,type:"wheel,touch,scroll",debounce:!1,allowClicks:!0,onChangeY:function(){return X(-V)}}),S.nested=Wg(_o,"wheel,touch,scroll",!0,x!==!1)):(S.nested.kill(),S.kill(),S=0,D&&D.enable(),_.progress=(-V/C-_.start)/(_.end-_.start),_t(_))),this):!!S},this.kill=this.revert=function(){e.paused(!1),_t(_),_.kill();for(var A=(p||[]).concat(m||[]),x=A.length;x--;)A[x].kill();re.scrollerProxy(f),re.removeEventListener("killAll",It),re.removeEventListener("refresh",$t),f.style.cssText=b,d.style.cssText=v;var F=re.defaults({});F&&F.scroller===f&&re.defaults({scroller:rn}),e.normalizer&&re.normalizeScroll(!1),clearInterval(g),Fi=null,ot&&ot.disconnect(),gi.style.removeProperty("height"),rn.removeEventListener("focusin",ct)},this.refresh=function(A,x){return _.refresh(A,x)},c&&(this.normalizer=re.normalizeScroll(c===!0?{debounce:!0,content:!N&&d}:c)),re.config(t),"overscrollBehavior"in rn.getComputedStyle(gi)&&ye.set([gi,_o],{overscrollBehavior:"none"}),"scrollBehavior"in rn.getComputedStyle(gi)&&ye.set([gi,_o],{scrollBehavior:"auto"}),rn.addEventListener("focusin",ct),g=setInterval(z,250),Ms.readyState==="loading"||requestAnimationFrame(function(){return re.refresh()})}return r.register=function(e){return nc||(ye=e||Zg(),qg()&&window.document&&(rn=window,Ms=document,_o=Ms.documentElement,gi=Ms.body),ye&&(Ss=ye.utils.toArray,Hg=ye.utils.clamp,ic=ye.parseEase("expo"),Xg=ye.core.context||function(){},re=ye.core.globals().ScrollTrigger,ye.core.globals("ScrollSmoother",r),gi&&re&&(Yg=ye.delayedCall(.2,function(){return re.isRefreshing||Fi&&Fi.refresh()}).pause(),Iv=[rn,Ms,_o,gi],Gg=re.core._getVelocityProp,Wg=re.core._inputObserver,r.refresh=re.refresh,nc=1))),nc},Pv(r,[{key:"progress",get:function(){return this.scrollTrigger?this.scrollTrigger.animation._time/100:0}}]),r}();ji.version="3.12.5";ji.create=function(r){return Fi&&r&&Fi.content()===Ss(r.content)[0]?Fi:new ji(r)};ji.get=function(){return Fi};Zg()&&ye.registerPlugin(ji);Kt.registerPlugin(ji,Yt);var Jg=()=>{Kt.registerPlugin(ji),ji.create({smooth:1.5,effects:!0}),Yt.refresh()};var yd="164";var Uv=0,$g=1,Ov=2;var M0=1,vd=2,rr=3,Hr=0,Un=1,or=2,kr=0,zr=1,Kg=2,jg=3,Qg=4,Bv=5,Rs=100,kv=101,zv=102,Vv=103,Hv=104,Gv=200,Wv=201,Xv=202,Yv=203,Uf=204,Of=205,qv=206,Zv=207,Jv=208,$v=209,Kv=210,jv=211,Qv=212,tS=213,eS=214,nS=0,iS=1,rS=2,Cc=3,sS=4,oS=5,aS=6,lS=7,b0=0,cS=1,uS=2,Vr=0,hS=1,fS=2,dS=3,pS=4,mS=5,gS=6,_S=7;var w0=300,zo=301,Vo=302,Bf=303,kf=304,nu=306,zf=1e3,Is=1001,Vf=1002,ii=1003,xS=1004;var rc=1005;var vi=1006,ef=1007;var Ls=1008;var Gr=1009,yS=1010,vS=1011,E0=1012,T0=1013,Ho=1014,Or=1015,iu=1016,A0=1017,D0=1018,Qa=1020,SS=35902,MS=1021,bS=1022,Ui=1023,wS=1024,ES=1025,Oo=1026,Ja=1027,TS=1028,C0=1029,AS=1030,R0=1031,P0=1033,nf=33776,rf=33777,sf=33778,of=33779,t_=35840,e_=35841,n_=35842,i_=35843,r_=36196,s_=37492,o_=37496,a_=37808,l_=37809,c_=37810,u_=37811,h_=37812,f_=37813,d_=37814,p_=37815,m_=37816,g_=37817,__=37818,x_=37819,y_=37820,v_=37821,af=36492,S_=36494,M_=36495,DS=36283,b_=36284,w_=36285,E_=36286;var Rc=2300,Pc=2301,lf=2302,T_=2400,A_=2401,D_=2402;var CS=3200,RS=3201,PS=0,IS=1,Ur="",ni="srgb",Yr="srgb-linear",Sd="display-p3",ru="display-p3-linear",Ic="linear",Te="srgb",Lc="rec709",Fc="p3";var xo=7680;var C_=519,LS=512,FS=513,NS=514,I0=515,US=516,OS=517,BS=518,kS=519,R_=35044;var P_="300 es",ar=2e3,Nc=2001,Wr=class{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[t]===void 0&&(n[t]=[]),n[t].indexOf(e)===-1&&n[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;let n=this._listeners;return n[t]!==void 0&&n[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;let i=this._listeners[t];if(i!==void 0){let s=i.indexOf(e);s!==-1&&i.splice(s,1)}}dispatchEvent(t){if(this._listeners===void 0)return;let n=this._listeners[t.type];if(n!==void 0){t.target=this;let i=n.slice(0);for(let s=0,o=i.length;s<o;s++)i[s].call(this,t);t.target=null}}},pn=["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"];var cf=Math.PI/180,Hf=180/Math.PI;function tl(){let r=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(pn[r&255]+pn[r>>8&255]+pn[r>>16&255]+pn[r>>24&255]+"-"+pn[t&255]+pn[t>>8&255]+"-"+pn[t>>16&15|64]+pn[t>>24&255]+"-"+pn[e&63|128]+pn[e>>8&255]+"-"+pn[e>>16&255]+pn[e>>24&255]+pn[n&255]+pn[n>>8&255]+pn[n>>16&255]+pn[n>>24&255]).toLowerCase()}function Nn(r,t,e){return Math.max(t,Math.min(e,r))}function zS(r,t){return(r%t+t)%t}function uf(r,t,e){return(1-e)*r+e*t}function Ha(r,t){switch(t.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function Fn(r,t){switch(t.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}var _e=class r{constructor(t=0,e=0){r.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){let e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[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=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=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){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(Nn(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y;return e*e+n*n}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,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,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){let n=Math.cos(e),i=Math.sin(e),s=this.x-t.x,o=this.y-t.y;return this.x=s*n-o*i+t.x,this.y=s*i+o*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},oe=class r{constructor(t,e,n,i,s,o,a,l,c){r.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,n,i,s,o,a,l,c)}set(t,e,n,i,s,o,a,l,c){let h=this.elements;return h[0]=t,h[1]=i,h[2]=a,h[3]=e,h[4]=s,h[5]=l,h[6]=n,h[7]=o,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){let 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){let n=t.elements,i=e.elements,s=this.elements,o=n[0],a=n[3],l=n[6],c=n[1],h=n[4],d=n[7],f=n[2],u=n[5],_=n[8],p=i[0],m=i[3],g=i[6],b=i[1],v=i[4],S=i[7],D=i[2],T=i[5],w=i[8];return s[0]=o*p+a*b+l*D,s[3]=o*m+a*v+l*T,s[6]=o*g+a*S+l*w,s[1]=c*p+h*b+d*D,s[4]=c*m+h*v+d*T,s[7]=c*g+h*S+d*w,s[2]=f*p+u*b+_*D,s[5]=f*m+u*v+_*T,s[8]=f*g+u*S+_*w,this}multiplyScalar(t){let 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(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],h=t[8];return e*o*h-e*a*c-n*s*h+n*a*l+i*s*c-i*o*l}invert(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],h=t[8],d=h*o-a*c,f=a*l-h*s,u=c*s-o*l,_=e*d+n*f+i*u;if(_===0)return this.set(0,0,0,0,0,0,0,0,0);let p=1/_;return t[0]=d*p,t[1]=(i*c-h*n)*p,t[2]=(a*n-i*o)*p,t[3]=f*p,t[4]=(h*e-i*l)*p,t[5]=(i*s-a*e)*p,t[6]=u*p,t[7]=(n*l-c*e)*p,t[8]=(o*e-n*s)*p,this}transpose(){let t,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){let 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,n,i,s,o,a){let l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*o+c*a)+o+t,-i*c,i*l,-i*(-c*o+l*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(hf.makeScale(t,e)),this}rotate(t){return this.premultiply(hf.makeRotation(-t)),this}translate(t,e){return this.premultiply(hf.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){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){let e=this.elements,n=t.elements;for(let i=0;i<9;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return new this.constructor().fromArray(this.elements)}},hf=new oe;function L0(r){for(let t=r.length-1;t>=0;--t)if(r[t]>=65535)return!0;return!1}function Uc(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function VS(){let r=Uc("canvas");return r.style.display="block",r}var I_={};function HS(r){r in I_||(I_[r]=!0,console.warn(r))}var L_=new oe().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),F_=new oe().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),sc={[Yr]:{transfer:Ic,primaries:Lc,toReference:r=>r,fromReference:r=>r},[ni]:{transfer:Te,primaries:Lc,toReference:r=>r.convertSRGBToLinear(),fromReference:r=>r.convertLinearToSRGB()},[ru]:{transfer:Ic,primaries:Fc,toReference:r=>r.applyMatrix3(F_),fromReference:r=>r.applyMatrix3(L_)},[Sd]:{transfer:Te,primaries:Fc,toReference:r=>r.convertSRGBToLinear().applyMatrix3(F_),fromReference:r=>r.applyMatrix3(L_).convertLinearToSRGB()}},GS=new Set([Yr,ru]),Se={enabled:!0,_workingColorSpace:Yr,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(r){if(!GS.has(r))throw new Error(`Unsupported working color space, "${r}".`);this._workingColorSpace=r},convert:function(r,t,e){if(this.enabled===!1||t===e||!t||!e)return r;let n=sc[t].toReference,i=sc[e].fromReference;return i(n(r))},fromWorkingColorSpace:function(r,t){return this.convert(r,this._workingColorSpace,t)},toWorkingColorSpace:function(r,t){return this.convert(r,t,this._workingColorSpace)},getPrimaries:function(r){return sc[r].primaries},getTransfer:function(r){return r===Ur?Ic:sc[r].transfer}};function Bo(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function ff(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var yo,Gf=class{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{yo===void 0&&(yo=Uc("canvas")),yo.width=t.width,yo.height=t.height;let n=yo.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=yo}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){let e=Uc("canvas");e.width=t.width,e.height=t.height;let n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);let i=n.getImageData(0,0,t.width,t.height),s=i.data;for(let o=0;o<s.length;o++)s[o]=Bo(s[o]/255)*255;return n.putImageData(i,0,0),e}else if(t.data){let e=t.data.slice(0);for(let n=0;n<e.length;n++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[n]=Math.floor(Bo(e[n]/255)*255):e[n]=Bo(e[n]);return{data:e,width:t.width,height:t.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}},WS=0,Oc=class{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:WS++}),this.uuid=tl(),this.data=t,this.dataReady=!0,this.version=0}set needsUpdate(t){t===!0&&this.version++}toJSON(t){let e=t===void 0||typeof t=="string";if(!e&&t.images[this.uuid]!==void 0)return t.images[this.uuid];let n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let s;if(Array.isArray(i)){s=[];for(let o=0,a=i.length;o<a;o++)i[o].isDataTexture?s.push(df(i[o].image)):s.push(df(i[o]))}else s=df(i);n.url=s}return e||(t.images[this.uuid]=n),n}};function df(r){return typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&r instanceof ImageBitmap?Gf.getDataURL(r):r.data?{data:Array.from(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var XS=0,oi=class r extends Wr{constructor(t=r.DEFAULT_IMAGE,e=r.DEFAULT_MAPPING,n=Is,i=Is,s=vi,o=Ls,a=Ui,l=Gr,c=r.DEFAULT_ANISOTROPY,h=Ur){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:XS++}),this.uuid=tl(),this.name="",this.source=new Oc(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=l,this.offset=new _e(0,0),this.repeat=new _e(1,1),this.center=new _e(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new oe,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!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.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){let e=t===void 0||typeof t=="string";if(!e&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];let n={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&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==w0)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case zf:t.x=t.x-Math.floor(t.x);break;case Is:t.x=t.x<0?0:1;break;case Vf:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case zf:t.y=t.y-Math.floor(t.y);break;case Is:t.y=t.y<0?0:1;break;case Vf:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}};oi.DEFAULT_IMAGE=null;oi.DEFAULT_MAPPING=w0;oi.DEFAULT_ANISOTROPY=1;var Qe=class r{constructor(t=0,e=0,n=0,i=1){r.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=i}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,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,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=t.w!==void 0?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){let e=this.x,n=this.y,i=this.z,s=this.w,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*e+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*e+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*e+o[7]*n+o[11]*i+o[15]*s,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);let 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,n,i,s,l=t.elements,c=l[0],h=l[4],d=l[8],f=l[1],u=l[5],_=l[9],p=l[2],m=l[6],g=l[10];if(Math.abs(h-f)<.01&&Math.abs(d-p)<.01&&Math.abs(_-m)<.01){if(Math.abs(h+f)<.1&&Math.abs(d+p)<.1&&Math.abs(_+m)<.1&&Math.abs(c+u+g-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;let v=(c+1)/2,S=(u+1)/2,D=(g+1)/2,T=(h+f)/4,w=(d+p)/4,P=(_+m)/4;return v>S&&v>D?v<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(v),i=T/n,s=w/n):S>D?S<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(S),n=T/i,s=P/i):D<.01?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(D),n=w/s,i=P/s),this.set(n,i,s,e),this}let b=Math.sqrt((m-_)*(m-_)+(d-p)*(d-p)+(f-h)*(f-h));return Math.abs(b)<.001&&(b=1),this.x=(m-_)/b,this.y=(d-p)/b,this.z=(f-h)/b,this.w=Math.acos((c+u+g-1)/2),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=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=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,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,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}},Wf=class extends Wr{constructor(t=1,e=1,n={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new Qe(0,0,t,e),this.scissorTest=!1,this.viewport=new Qe(0,0,t,e);let i={width:t,height:e,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:vi,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);let s=new oi(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);s.flipY=!1,s.generateMipmaps=n.generateMipmaps,s.internalFormat=n.internalFormat,this.textures=[];let o=n.count;for(let a=0;a<o;a++)this.textures[a]=s.clone(),this.textures[a].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}setSize(t,e,n=1){if(this.width!==t||this.height!==e||this.depth!==n){this.width=t,this.height=e,this.depth=n;for(let i=0,s=this.textures.length;i<s;i++)this.textures[i].image.width=t,this.textures[i].image.height=e,this.textures[i].image.depth=n;this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let n=0,i=t.textures.length;n<i;n++)this.textures[n]=t.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0;let e=Object.assign({},t.texture.image);return this.texture.source=new Oc(e),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,t.depthTexture!==null&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}},lr=class extends Wf{constructor(t=1,e=1,n={}){super(t,e,n),this.isWebGLRenderTarget=!0}},Bc=class extends oi{constructor(t=null,e=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=ii,this.minFilter=ii,this.wrapR=Is,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var Xf=class extends oi{constructor(t=null,e=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=ii,this.minFilter=ii,this.wrapR=Is,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var Xr=class{constructor(t=0,e=0,n=0,i=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=i}static slerpFlat(t,e,n,i,s,o,a){let l=n[i+0],c=n[i+1],h=n[i+2],d=n[i+3],f=s[o+0],u=s[o+1],_=s[o+2],p=s[o+3];if(a===0){t[e+0]=l,t[e+1]=c,t[e+2]=h,t[e+3]=d;return}if(a===1){t[e+0]=f,t[e+1]=u,t[e+2]=_,t[e+3]=p;return}if(d!==p||l!==f||c!==u||h!==_){let m=1-a,g=l*f+c*u+h*_+d*p,b=g>=0?1:-1,v=1-g*g;if(v>Number.EPSILON){let D=Math.sqrt(v),T=Math.atan2(D,g*b);m=Math.sin(m*T)/D,a=Math.sin(a*T)/D}let S=a*b;if(l=l*m+f*S,c=c*m+u*S,h=h*m+_*S,d=d*m+p*S,m===1-a){let D=1/Math.sqrt(l*l+c*c+h*h+d*d);l*=D,c*=D,h*=D,d*=D}}t[e]=l,t[e+1]=c,t[e+2]=h,t[e+3]=d}static multiplyQuaternionsFlat(t,e,n,i,s,o){let a=n[i],l=n[i+1],c=n[i+2],h=n[i+3],d=s[o],f=s[o+1],u=s[o+2],_=s[o+3];return t[e]=a*_+h*d+l*u-c*f,t[e+1]=l*_+h*f+c*d-a*u,t[e+2]=c*_+h*u+a*f-l*d,t[e+3]=h*_-a*d-l*f-c*u,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,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,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){let n=t._x,i=t._y,s=t._z,o=t._order,a=Math.cos,l=Math.sin,c=a(n/2),h=a(i/2),d=a(s/2),f=l(n/2),u=l(i/2),_=l(s/2);switch(o){case"XYZ":this._x=f*h*d+c*u*_,this._y=c*u*d-f*h*_,this._z=c*h*_+f*u*d,this._w=c*h*d-f*u*_;break;case"YXZ":this._x=f*h*d+c*u*_,this._y=c*u*d-f*h*_,this._z=c*h*_-f*u*d,this._w=c*h*d+f*u*_;break;case"ZXY":this._x=f*h*d-c*u*_,this._y=c*u*d+f*h*_,this._z=c*h*_+f*u*d,this._w=c*h*d-f*u*_;break;case"ZYX":this._x=f*h*d-c*u*_,this._y=c*u*d+f*h*_,this._z=c*h*_-f*u*d,this._w=c*h*d+f*u*_;break;case"YZX":this._x=f*h*d+c*u*_,this._y=c*u*d+f*h*_,this._z=c*h*_-f*u*d,this._w=c*h*d-f*u*_;break;case"XZY":this._x=f*h*d-c*u*_,this._y=c*u*d-f*h*_,this._z=c*h*_+f*u*d,this._w=c*h*d+f*u*_;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){let n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){let e=t.elements,n=e[0],i=e[4],s=e[8],o=e[1],a=e[5],l=e[9],c=e[2],h=e[6],d=e[10],f=n+a+d;if(f>0){let u=.5/Math.sqrt(f+1);this._w=.25/u,this._x=(h-l)*u,this._y=(s-c)*u,this._z=(o-i)*u}else if(n>a&&n>d){let u=2*Math.sqrt(1+n-a-d);this._w=(h-l)/u,this._x=.25*u,this._y=(i+o)/u,this._z=(s+c)/u}else if(a>d){let u=2*Math.sqrt(1+a-n-d);this._w=(s-c)/u,this._x=(i+o)/u,this._y=.25*u,this._z=(l+h)/u}else{let u=2*Math.sqrt(1+d-n-a);this._w=(o-i)/u,this._x=(s+c)/u,this._y=(l+h)/u,this._z=.25*u}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Nn(this.dot(t),-1,1)))}rotateTowards(t,e){let n=this.angleTo(t);if(n===0)return this;let i=Math.min(1,e/n);return this.slerp(t,i),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 t===0?(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){let n=t._x,i=t._y,s=t._z,o=t._w,a=e._x,l=e._y,c=e._z,h=e._w;return this._x=n*h+o*a+i*c-s*l,this._y=i*h+o*l+s*a-n*c,this._z=s*h+o*c+n*l-i*a,this._w=o*h-n*a-i*l-s*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);let n=this._x,i=this._y,s=this._z,o=this._w,a=o*t._w+n*t._x+i*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=o,this._x=n,this._y=i,this._z=s,this;let l=1-a*a;if(l<=Number.EPSILON){let u=1-e;return this._w=u*o+e*this._w,this._x=u*n+e*this._x,this._y=u*i+e*this._y,this._z=u*s+e*this._z,this.normalize(),this}let c=Math.sqrt(l),h=Math.atan2(c,a),d=Math.sin((1-e)*h)/c,f=Math.sin(e*h)/c;return this._w=o*d+this._w*f,this._x=n*d+this._x*f,this._y=i*d+this._y*f,this._z=s*d+this._z*f,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){let t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(i*Math.sin(t),i*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}},nt=class r{constructor(t=0,e=0,n=0){r.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return n===void 0&&(n=this.z),this.x=t,this.y=e,this.z=n,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(N_.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(N_.setFromAxisAngle(t,e))}applyMatrix3(t){let e=this.x,n=this.y,i=this.z,s=t.elements;return this.x=s[0]*e+s[3]*n+s[6]*i,this.y=s[1]*e+s[4]*n+s[7]*i,this.z=s[2]*e+s[5]*n+s[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){let e=this.x,n=this.y,i=this.z,s=t.elements,o=1/(s[3]*e+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*e+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*e+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*e+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(t){let e=this.x,n=this.y,i=this.z,s=t.x,o=t.y,a=t.z,l=t.w,c=2*(o*i-a*n),h=2*(a*e-s*i),d=2*(s*n-o*e);return this.x=e+l*c+o*d-a*h,this.y=n+l*h+a*c-s*d,this.z=i+l*d+s*h-o*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){let e=this.x,n=this.y,i=this.z,s=t.elements;return this.x=s[0]*e+s[4]*n+s[8]*i,this.y=s[1]*e+s[5]*n+s[9]*i,this.z=s[2]*e+s[6]*n+s[10]*i,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=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=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,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){let n=t.x,i=t.y,s=t.z,o=e.x,a=e.y,l=e.z;return this.x=i*l-s*a,this.y=s*o-n*l,this.z=n*a-i*o,this}projectOnVector(t){let e=t.lengthSq();if(e===0)return this.set(0,0,0);let n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return pf.copy(this).projectOnVector(t),this.sub(pf)}reflect(t){return this.sub(pf.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(Nn(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}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,n){let i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){let e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}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(){let t=Math.random()*Math.PI*2,e=Math.random()*2-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},pf=new nt,N_=new Xr,Fs=class{constructor(t=new nt(1/0,1/0,1/0),e=new nt(-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,n=t.length;e<n;e+=3)this.expandByPoint(_i.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,n=t.count;e<n;e++)this.expandByPoint(_i.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){let n=_i.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),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);let n=t.geometry;if(n!==void 0){let s=n.getAttribute("position");if(e===!0&&s!==void 0&&t.isInstancedMesh!==!0)for(let o=0,a=s.count;o<a;o++)t.isMesh===!0?t.getVertexPosition(o,_i):_i.fromBufferAttribute(s,o),_i.applyMatrix4(t.matrixWorld),this.expandByPoint(_i);else t.boundingBox!==void 0?(t.boundingBox===null&&t.computeBoundingBox(),oc.copy(t.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),oc.copy(n.boundingBox)),oc.applyMatrix4(t.matrixWorld),this.union(oc)}let i=t.children;for(let s=0,o=i.length;s<o;s++)this.expandByObject(i[s],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,_i),_i.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Ga),ac.subVectors(this.max,Ga),vo.subVectors(t.a,Ga),So.subVectors(t.b,Ga),Mo.subVectors(t.c,Ga),Rr.subVectors(So,vo),Pr.subVectors(Mo,So),bs.subVectors(vo,Mo);let e=[0,-Rr.z,Rr.y,0,-Pr.z,Pr.y,0,-bs.z,bs.y,Rr.z,0,-Rr.x,Pr.z,0,-Pr.x,bs.z,0,-bs.x,-Rr.y,Rr.x,0,-Pr.y,Pr.x,0,-bs.y,bs.x,0];return!mf(e,vo,So,Mo,ac)||(e=[1,0,0,0,1,0,0,0,1],!mf(e,vo,So,Mo,ac))?!1:(lc.crossVectors(Rr,Pr),e=[lc.x,lc.y,lc.z],mf(e,vo,So,Mo,ac))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,_i).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(_i).length()*.5),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()?this:(Qi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Qi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Qi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Qi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Qi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Qi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Qi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Qi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Qi),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)}},Qi=[new nt,new nt,new nt,new nt,new nt,new nt,new nt,new nt],_i=new nt,oc=new Fs,vo=new nt,So=new nt,Mo=new nt,Rr=new nt,Pr=new nt,bs=new nt,Ga=new nt,ac=new nt,lc=new nt,ws=new nt;function mf(r,t,e,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){ws.fromArray(r,s);let a=i.x*Math.abs(ws.x)+i.y*Math.abs(ws.y)+i.z*Math.abs(ws.z),l=t.dot(ws),c=e.dot(ws),h=n.dot(ws);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>a)return!1}return!0}var YS=new Fs,Wa=new nt,gf=new nt,Go=class{constructor(t=new nt,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){let n=this.center;e!==void 0?n.copy(e):YS.setFromPoints(t).getCenter(n);let i=0;for(let s=0,o=t.length;s<o;s++)i=Math.max(i,n.distanceToSquared(t[s]));return this.radius=Math.sqrt(i),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){let 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){let n=this.center.distanceToSquared(t);return e.copy(t),n>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;Wa.subVectors(t,this.center);let e=Wa.lengthSq();if(e>this.radius*this.radius){let n=Math.sqrt(e),i=(n-this.radius)*.5;this.center.addScaledVector(Wa,i/n),this.radius+=i}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(gf.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Wa.copy(t.center).add(gf)),this.expandByPoint(Wa.copy(t.center).sub(gf))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}},tr=new nt,_f=new nt,cc=new nt,Ir=new nt,xf=new nt,uc=new nt,yf=new nt,kc=class{constructor(t=new nt,e=new nt(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,tr)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);let n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){let e=tr.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(tr.copy(this.origin).addScaledVector(this.direction,e),tr.distanceToSquared(t))}distanceSqToSegment(t,e,n,i){_f.copy(t).add(e).multiplyScalar(.5),cc.copy(e).sub(t).normalize(),Ir.copy(this.origin).sub(_f);let s=t.distanceTo(e)*.5,o=-this.direction.dot(cc),a=Ir.dot(this.direction),l=-Ir.dot(cc),c=Ir.lengthSq(),h=Math.abs(1-o*o),d,f,u,_;if(h>0)if(d=o*l-a,f=o*a-l,_=s*h,d>=0)if(f>=-_)if(f<=_){let p=1/h;d*=p,f*=p,u=d*(d+o*f+2*a)+f*(o*d+f+2*l)+c}else f=s,d=Math.max(0,-(o*f+a)),u=-d*d+f*(f+2*l)+c;else f=-s,d=Math.max(0,-(o*f+a)),u=-d*d+f*(f+2*l)+c;else f<=-_?(d=Math.max(0,-(-o*s+a)),f=d>0?-s:Math.min(Math.max(-s,-l),s),u=-d*d+f*(f+2*l)+c):f<=_?(d=0,f=Math.min(Math.max(-s,-l),s),u=f*(f+2*l)+c):(d=Math.max(0,-(o*s+a)),f=d>0?s:Math.min(Math.max(-s,-l),s),u=-d*d+f*(f+2*l)+c);else f=o>0?-s:s,d=Math.max(0,-(o*f+a)),u=-d*d+f*(f+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,d),i&&i.copy(_f).addScaledVector(cc,f),u}intersectSphere(t,e){tr.subVectors(t.center,this.origin);let n=tr.dot(this.direction),i=tr.dot(tr)-n*n,s=t.radius*t.radius;if(i>s)return null;let o=Math.sqrt(s-i),a=n-o,l=n+o;return l<0?null:a<0?this.at(l,e):this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){let e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){let n=this.distanceToPlane(t);return n===null?null:this.at(n,e)}intersectsPlane(t){let e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,i,s,o,a,l,c=1/this.direction.x,h=1/this.direction.y,d=1/this.direction.z,f=this.origin;return c>=0?(n=(t.min.x-f.x)*c,i=(t.max.x-f.x)*c):(n=(t.max.x-f.x)*c,i=(t.min.x-f.x)*c),h>=0?(s=(t.min.y-f.y)*h,o=(t.max.y-f.y)*h):(s=(t.max.y-f.y)*h,o=(t.min.y-f.y)*h),n>o||s>i||((s>n||isNaN(n))&&(n=s),(o<i||isNaN(i))&&(i=o),d>=0?(a=(t.min.z-f.z)*d,l=(t.max.z-f.z)*d):(a=(t.max.z-f.z)*d,l=(t.min.z-f.z)*d),n>l||a>i)||((a>n||n!==n)&&(n=a),(l<i||i!==i)&&(i=l),i<0)?null:this.at(n>=0?n:i,e)}intersectsBox(t){return this.intersectBox(t,tr)!==null}intersectTriangle(t,e,n,i,s){xf.subVectors(e,t),uc.subVectors(n,t),yf.crossVectors(xf,uc);let o=this.direction.dot(yf),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Ir.subVectors(this.origin,t);let l=a*this.direction.dot(uc.crossVectors(Ir,uc));if(l<0)return null;let c=a*this.direction.dot(xf.cross(Ir));if(c<0||l+c>o)return null;let h=-a*Ir.dot(yf);return h<0?null:this.at(h/o,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)}},Oe=class r{constructor(t,e,n,i,s,o,a,l,c,h,d,f,u,_,p,m){r.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,n,i,s,o,a,l,c,h,d,f,u,_,p,m)}set(t,e,n,i,s,o,a,l,c,h,d,f,u,_,p,m){let g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=i,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=c,g[6]=h,g[10]=d,g[14]=f,g[3]=u,g[7]=_,g[11]=p,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new r().fromArray(this.elements)}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){let e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){let 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,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){let e=this.elements,n=t.elements,i=1/bo.setFromMatrixColumn(t,0).length(),s=1/bo.setFromMatrixColumn(t,1).length(),o=1/bo.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*s,e[5]=n[5]*s,e[6]=n[6]*s,e[7]=0,e[8]=n[8]*o,e[9]=n[9]*o,e[10]=n[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){let e=this.elements,n=t.x,i=t.y,s=t.z,o=Math.cos(n),a=Math.sin(n),l=Math.cos(i),c=Math.sin(i),h=Math.cos(s),d=Math.sin(s);if(t.order==="XYZ"){let f=o*h,u=o*d,_=a*h,p=a*d;e[0]=l*h,e[4]=-l*d,e[8]=c,e[1]=u+_*c,e[5]=f-p*c,e[9]=-a*l,e[2]=p-f*c,e[6]=_+u*c,e[10]=o*l}else if(t.order==="YXZ"){let f=l*h,u=l*d,_=c*h,p=c*d;e[0]=f+p*a,e[4]=_*a-u,e[8]=o*c,e[1]=o*d,e[5]=o*h,e[9]=-a,e[2]=u*a-_,e[6]=p+f*a,e[10]=o*l}else if(t.order==="ZXY"){let f=l*h,u=l*d,_=c*h,p=c*d;e[0]=f-p*a,e[4]=-o*d,e[8]=_+u*a,e[1]=u+_*a,e[5]=o*h,e[9]=p-f*a,e[2]=-o*c,e[6]=a,e[10]=o*l}else if(t.order==="ZYX"){let f=o*h,u=o*d,_=a*h,p=a*d;e[0]=l*h,e[4]=_*c-u,e[8]=f*c+p,e[1]=l*d,e[5]=p*c+f,e[9]=u*c-_,e[2]=-c,e[6]=a*l,e[10]=o*l}else if(t.order==="YZX"){let f=o*l,u=o*c,_=a*l,p=a*c;e[0]=l*h,e[4]=p-f*d,e[8]=_*d+u,e[1]=d,e[5]=o*h,e[9]=-a*h,e[2]=-c*h,e[6]=u*d+_,e[10]=f-p*d}else if(t.order==="XZY"){let f=o*l,u=o*c,_=a*l,p=a*c;e[0]=l*h,e[4]=-d,e[8]=c*h,e[1]=f*d+p,e[5]=o*h,e[9]=u*d-_,e[2]=_*d-u,e[6]=a*h,e[10]=p*d+f}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(qS,t,ZS)}lookAt(t,e,n){let i=this.elements;return Gn.subVectors(t,e),Gn.lengthSq()===0&&(Gn.z=1),Gn.normalize(),Lr.crossVectors(n,Gn),Lr.lengthSq()===0&&(Math.abs(n.z)===1?Gn.x+=1e-4:Gn.z+=1e-4,Gn.normalize(),Lr.crossVectors(n,Gn)),Lr.normalize(),hc.crossVectors(Gn,Lr),i[0]=Lr.x,i[4]=hc.x,i[8]=Gn.x,i[1]=Lr.y,i[5]=hc.y,i[9]=Gn.y,i[2]=Lr.z,i[6]=hc.z,i[10]=Gn.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,i=e.elements,s=this.elements,o=n[0],a=n[4],l=n[8],c=n[12],h=n[1],d=n[5],f=n[9],u=n[13],_=n[2],p=n[6],m=n[10],g=n[14],b=n[3],v=n[7],S=n[11],D=n[15],T=i[0],w=i[4],P=i[8],M=i[12],y=i[1],I=i[5],N=i[9],C=i[13],V=i[2],$=i[6],W=i[10],Z=i[14],z=i[3],U=i[7],R=i[11],at=i[15];return s[0]=o*T+a*y+l*V+c*z,s[4]=o*w+a*I+l*$+c*U,s[8]=o*P+a*N+l*W+c*R,s[12]=o*M+a*C+l*Z+c*at,s[1]=h*T+d*y+f*V+u*z,s[5]=h*w+d*I+f*$+u*U,s[9]=h*P+d*N+f*W+u*R,s[13]=h*M+d*C+f*Z+u*at,s[2]=_*T+p*y+m*V+g*z,s[6]=_*w+p*I+m*$+g*U,s[10]=_*P+p*N+m*W+g*R,s[14]=_*M+p*C+m*Z+g*at,s[3]=b*T+v*y+S*V+D*z,s[7]=b*w+v*I+S*$+D*U,s[11]=b*P+v*N+S*W+D*R,s[15]=b*M+v*C+S*Z+D*at,this}multiplyScalar(t){let 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(){let t=this.elements,e=t[0],n=t[4],i=t[8],s=t[12],o=t[1],a=t[5],l=t[9],c=t[13],h=t[2],d=t[6],f=t[10],u=t[14],_=t[3],p=t[7],m=t[11],g=t[15];return _*(+s*l*d-i*c*d-s*a*f+n*c*f+i*a*u-n*l*u)+p*(+e*l*u-e*c*f+s*o*f-i*o*u+i*c*h-s*l*h)+m*(+e*c*d-e*a*u-s*o*d+n*o*u+s*a*h-n*c*h)+g*(-i*a*h-e*l*d+e*a*f+i*o*d-n*o*f+n*l*h)}transpose(){let t=this.elements,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,n){let i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this}invert(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],h=t[8],d=t[9],f=t[10],u=t[11],_=t[12],p=t[13],m=t[14],g=t[15],b=d*m*c-p*f*c+p*l*u-a*m*u-d*l*g+a*f*g,v=_*f*c-h*m*c-_*l*u+o*m*u+h*l*g-o*f*g,S=h*p*c-_*d*c+_*a*u-o*p*u-h*a*g+o*d*g,D=_*d*l-h*p*l-_*a*f+o*p*f+h*a*m-o*d*m,T=e*b+n*v+i*S+s*D;if(T===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let w=1/T;return t[0]=b*w,t[1]=(p*f*s-d*m*s-p*i*u+n*m*u+d*i*g-n*f*g)*w,t[2]=(a*m*s-p*l*s+p*i*c-n*m*c-a*i*g+n*l*g)*w,t[3]=(d*l*s-a*f*s-d*i*c+n*f*c+a*i*u-n*l*u)*w,t[4]=v*w,t[5]=(h*m*s-_*f*s+_*i*u-e*m*u-h*i*g+e*f*g)*w,t[6]=(_*l*s-o*m*s-_*i*c+e*m*c+o*i*g-e*l*g)*w,t[7]=(o*f*s-h*l*s+h*i*c-e*f*c-o*i*u+e*l*u)*w,t[8]=S*w,t[9]=(_*d*s-h*p*s-_*n*u+e*p*u+h*n*g-e*d*g)*w,t[10]=(o*p*s-_*a*s+_*n*c-e*p*c-o*n*g+e*a*g)*w,t[11]=(h*a*s-o*d*s-h*n*c+e*d*c+o*n*u-e*a*u)*w,t[12]=D*w,t[13]=(h*p*i-_*d*i+_*n*f-e*p*f-h*n*m+e*d*m)*w,t[14]=(_*a*i-o*p*i-_*n*l+e*p*l+o*n*m-e*a*m)*w,t[15]=(o*d*i-h*a*i+h*n*l-e*d*l-o*n*f+e*a*f)*w,this}scale(t){let e=this.elements,n=t.x,i=t.y,s=t.z;return e[0]*=n,e[4]*=i,e[8]*=s,e[1]*=n,e[5]*=i,e[9]*=s,e[2]*=n,e[6]*=i,e[10]*=s,e[3]*=n,e[7]*=i,e[11]*=s,this}getMaxScaleOnAxis(){let t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){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,n,0,0,0,1),this}makeRotationX(t){let e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){let n=Math.cos(e),i=Math.sin(e),s=1-n,o=t.x,a=t.y,l=t.z,c=s*o,h=s*a;return this.set(c*o+n,c*a-i*l,c*l+i*a,0,c*a+i*l,h*a+n,h*l-i*o,0,c*l-i*a,h*l+i*o,s*l*l+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,i,s,o){return this.set(1,n,s,0,t,1,o,0,e,i,1,0,0,0,0,1),this}compose(t,e,n){let i=this.elements,s=e._x,o=e._y,a=e._z,l=e._w,c=s+s,h=o+o,d=a+a,f=s*c,u=s*h,_=s*d,p=o*h,m=o*d,g=a*d,b=l*c,v=l*h,S=l*d,D=n.x,T=n.y,w=n.z;return i[0]=(1-(p+g))*D,i[1]=(u+S)*D,i[2]=(_-v)*D,i[3]=0,i[4]=(u-S)*T,i[5]=(1-(f+g))*T,i[6]=(m+b)*T,i[7]=0,i[8]=(_+v)*w,i[9]=(m-b)*w,i[10]=(1-(f+p))*w,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){let i=this.elements,s=bo.set(i[0],i[1],i[2]).length(),o=bo.set(i[4],i[5],i[6]).length(),a=bo.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),t.x=i[12],t.y=i[13],t.z=i[14],xi.copy(this);let c=1/s,h=1/o,d=1/a;return xi.elements[0]*=c,xi.elements[1]*=c,xi.elements[2]*=c,xi.elements[4]*=h,xi.elements[5]*=h,xi.elements[6]*=h,xi.elements[8]*=d,xi.elements[9]*=d,xi.elements[10]*=d,e.setFromRotationMatrix(xi),n.x=s,n.y=o,n.z=a,this}makePerspective(t,e,n,i,s,o,a=ar){let l=this.elements,c=2*s/(e-t),h=2*s/(n-i),d=(e+t)/(e-t),f=(n+i)/(n-i),u,_;if(a===ar)u=-(o+s)/(o-s),_=-2*o*s/(o-s);else if(a===Nc)u=-o/(o-s),_=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=h,l[9]=f,l[13]=0,l[2]=0,l[6]=0,l[10]=u,l[14]=_,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,n,i,s,o,a=ar){let l=this.elements,c=1/(e-t),h=1/(n-i),d=1/(o-s),f=(e+t)*c,u=(n+i)*h,_,p;if(a===ar)_=(o+s)*d,p=-2*d;else if(a===Nc)_=s*d,p=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-f,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-u,l[2]=0,l[6]=0,l[10]=p,l[14]=-_,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){let e=this.elements,n=t.elements;for(let i=0;i<16;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}},bo=new nt,xi=new Oe,qS=new nt(0,0,0),ZS=new nt(1,1,1),Lr=new nt,hc=new nt,Gn=new nt,U_=new Oe,O_=new Xr,cr=class r{constructor(t=0,e=0,n=0,i=r.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=i}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,n,i=this._order){return this._x=t,this._y=e,this._z=n,this._order=i,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,n=!0){let i=t.elements,s=i[0],o=i[4],a=i[8],l=i[1],c=i[5],h=i[9],d=i[2],f=i[6],u=i[10];switch(e){case"XYZ":this._y=Math.asin(Nn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,u),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(f,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Nn(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,u),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,s),this._z=0);break;case"ZXY":this._x=Math.asin(Nn(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-d,u),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Nn(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(f,u),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Nn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-d,s)):(this._x=0,this._y=Math.atan2(a,u));break;case"XZY":this._z=Math.asin(-Nn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(f,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-h,u),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,n===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return U_.makeRotationFromQuaternion(t),this.setFromRotationMatrix(U_,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return O_.setFromEuler(this),this.setFromQuaternion(O_,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],t[3]!==void 0&&(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}};cr.DEFAULT_ORDER="XYZ";var zc=class{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!==0}isEnabled(t){return(this.mask&(1<<t|0))!==0}},JS=0,B_=new nt,wo=new Xr,er=new Oe,fc=new nt,Xa=new nt,$S=new nt,KS=new Xr,k_=new nt(1,0,0),z_=new nt(0,1,0),V_=new nt(0,0,1),H_={type:"added"},jS={type:"removed"},Eo={type:"childadded",child:null},vf={type:"childremoved",child:null},gn=class r extends Wr{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:JS++}),this.uuid=tl(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=r.DEFAULT_UP.clone();let t=new nt,e=new cr,n=new Xr,i=new nt(1,1,1);function s(){n.setFromEuler(e,!1)}function o(){e.setFromQuaternion(n,void 0,!1)}e._onChange(s),n._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Oe},normalMatrix:{value:new oe}}),this.matrix=new Oe,this.matrixWorld=new Oe,this.matrixAutoUpdate=r.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=r.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new zc,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],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 wo.setFromAxisAngle(t,e),this.quaternion.multiply(wo),this}rotateOnWorldAxis(t,e){return wo.setFromAxisAngle(t,e),this.quaternion.premultiply(wo),this}rotateX(t){return this.rotateOnAxis(k_,t)}rotateY(t){return this.rotateOnAxis(z_,t)}rotateZ(t){return this.rotateOnAxis(V_,t)}translateOnAxis(t,e){return B_.copy(t).applyQuaternion(this.quaternion),this.position.add(B_.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(k_,t)}translateY(t){return this.translateOnAxis(z_,t)}translateZ(t){return this.translateOnAxis(V_,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(er.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?fc.copy(t):fc.set(t,e,n);let i=this.parent;this.updateWorldMatrix(!0,!1),Xa.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?er.lookAt(Xa,fc,this.up):er.lookAt(fc,Xa,this.up),this.quaternion.setFromRotationMatrix(er),i&&(er.extractRotation(i.matrixWorld),wo.setFromRotationMatrix(er),this.quaternion.premultiply(wo.invert()))}add(t){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);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(H_),Eo.child=t,this.dispatchEvent(Eo),Eo.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}let e=this.children.indexOf(t);return e!==-1&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(jS),vf.child=t,this.dispatchEvent(vf),vf.child=null),this}removeFromParent(){let t=this.parent;return t!==null&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),er.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),er.multiply(t.parent.matrixWorld)),t.applyMatrix4(er),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(H_),Eo.child=t,this.dispatchEvent(Eo),Eo.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 n=0,i=this.children.length;n<i;n++){let o=this.children[n].getObjectByProperty(t,e);if(o!==void 0)return o}}getObjectsByProperty(t,e,n=[]){this[t]===e&&n.push(this);let i=this.children;for(let s=0,o=i.length;s<o;s++)i[s].getObjectsByProperty(t,e,n);return n}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Xa,t,$S),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Xa,KS,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);let e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);let e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);let e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverseVisible(t)}traverseAncestors(t){let e=this.parent;e!==null&&(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)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);let e=this.children;for(let n=0,i=e.length;n<i;n++){let s=e[n];(s.matrixWorldAutoUpdate===!0||t===!0)&&s.updateMatrixWorld(t)}}updateWorldMatrix(t,e){let n=this.parent;if(t===!0&&n!==null&&n.matrixWorldAutoUpdate===!0&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),e===!0){let i=this.children;for(let s=0,o=i.length;s<o;s++){let a=i[s];a.matrixWorldAutoUpdate===!0&&a.updateWorldMatrix(!1,!0)}}}toJSON(t){let e=t===void 0||typeof t=="string",n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});let i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),i.maxGeometryCount=this._maxGeometryCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(t),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(t)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(t.geometries,this.geometry);let a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){let l=a.shapes;if(Array.isArray(l))for(let c=0,h=l.length;c<h;c++){let d=l[c];s(t.shapes,d)}else s(t.shapes,l)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(t.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let a=[];for(let l=0,c=this.material.length;l<c;l++)a.push(s(t.materials,this.material[l]));i.material=a}else i.material=s(t.materials,this.material);if(this.children.length>0){i.children=[];for(let a=0;a<this.children.length;a++)i.children.push(this.children[a].toJSON(t).object)}if(this.animations.length>0){i.animations=[];for(let a=0;a<this.animations.length;a++){let l=this.animations[a];i.animations.push(s(t.animations,l))}}if(e){let a=o(t.geometries),l=o(t.materials),c=o(t.textures),h=o(t.images),d=o(t.shapes),f=o(t.skeletons),u=o(t.animations),_=o(t.nodes);a.length>0&&(n.geometries=a),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),h.length>0&&(n.images=h),d.length>0&&(n.shapes=d),f.length>0&&(n.skeletons=f),u.length>0&&(n.animations=u),_.length>0&&(n.nodes=_)}return n.object=i,n;function o(a){let l=[];for(let c in a){let h=a[c];delete h.metadata,l.push(h)}return l}}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)),e===!0)for(let n=0;n<t.children.length;n++){let i=t.children[n];this.add(i.clone())}return this}};gn.DEFAULT_UP=new nt(0,1,0);gn.DEFAULT_MATRIX_AUTO_UPDATE=!0;gn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var yi=new nt,nr=new nt,Sf=new nt,ir=new nt,To=new nt,Ao=new nt,G_=new nt,Mf=new nt,bf=new nt,wf=new nt,No=class r{constructor(t=new nt,e=new nt,n=new nt){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,i){i.subVectors(n,e),yi.subVectors(t,e),i.cross(yi);let s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(t,e,n,i,s){yi.subVectors(i,e),nr.subVectors(n,e),Sf.subVectors(t,e);let o=yi.dot(yi),a=yi.dot(nr),l=yi.dot(Sf),c=nr.dot(nr),h=nr.dot(Sf),d=o*c-a*a;if(d===0)return s.set(0,0,0),null;let f=1/d,u=(c*l-a*h)*f,_=(o*h-a*l)*f;return s.set(1-u-_,_,u)}static containsPoint(t,e,n,i){return this.getBarycoord(t,e,n,i,ir)===null?!1:ir.x>=0&&ir.y>=0&&ir.x+ir.y<=1}static getInterpolation(t,e,n,i,s,o,a,l){return this.getBarycoord(t,e,n,i,ir)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,ir.x),l.addScaledVector(o,ir.y),l.addScaledVector(a,ir.z),l)}static isFrontFacing(t,e,n,i){return yi.subVectors(n,e),nr.subVectors(t,e),yi.cross(nr).dot(i)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,n,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,i),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 yi.subVectors(this.c,this.b),nr.subVectors(this.a,this.b),yi.cross(nr).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return r.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return r.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,n,i,s){return r.getInterpolation(t,this.a,this.b,this.c,e,n,i,s)}containsPoint(t){return r.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return r.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){let n=this.a,i=this.b,s=this.c,o,a;To.subVectors(i,n),Ao.subVectors(s,n),Mf.subVectors(t,n);let l=To.dot(Mf),c=Ao.dot(Mf);if(l<=0&&c<=0)return e.copy(n);bf.subVectors(t,i);let h=To.dot(bf),d=Ao.dot(bf);if(h>=0&&d<=h)return e.copy(i);let f=l*d-h*c;if(f<=0&&l>=0&&h<=0)return o=l/(l-h),e.copy(n).addScaledVector(To,o);wf.subVectors(t,s);let u=To.dot(wf),_=Ao.dot(wf);if(_>=0&&u<=_)return e.copy(s);let p=u*c-l*_;if(p<=0&&c>=0&&_<=0)return a=c/(c-_),e.copy(n).addScaledVector(Ao,a);let m=h*_-u*d;if(m<=0&&d-h>=0&&u-_>=0)return G_.subVectors(s,i),a=(d-h)/(d-h+(u-_)),e.copy(i).addScaledVector(G_,a);let g=1/(m+p+f);return o=p*g,a=f*g,e.copy(n).addScaledVector(To,o).addScaledVector(Ao,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}},F0={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},Fr={h:0,s:0,l:0},dc={h:0,s:0,l:0};function Ef(r,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?r+(t-r)*6*e:e<1/2?t:e<2/3?r+(t-r)*6*(2/3-e):r}var ge=class{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(e===void 0&&n===void 0){let i=t;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=ni){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Se.toWorkingColorSpace(this,e),this}setRGB(t,e,n,i=Se.workingColorSpace){return this.r=t,this.g=e,this.b=n,Se.toWorkingColorSpace(this,i),this}setHSL(t,e,n,i=Se.workingColorSpace){if(t=zS(t,1),e=Nn(e,0,1),n=Nn(n,0,1),e===0)this.r=this.g=this.b=n;else{let s=n<=.5?n*(1+e):n+e-n*e,o=2*n-s;this.r=Ef(o,s,t+1/3),this.g=Ef(o,s,t),this.b=Ef(o,s,t-1/3)}return Se.toWorkingColorSpace(this,i),this}setStyle(t,e=ni){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(t)){let s,o=i[1],a=i[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(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 n(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 n(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(i=/^\#([A-Fa-f\d]+)$/.exec(t)){let s=i[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,e);if(o===6)return this.setHex(parseInt(s,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=ni){let n=F0[t.toLowerCase()];return n!==void 0?this.setHex(n,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=Bo(t.r),this.g=Bo(t.g),this.b=Bo(t.b),this}copyLinearToSRGB(t){return this.r=ff(t.r),this.g=ff(t.g),this.b=ff(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=ni){return Se.fromWorkingColorSpace(mn.copy(this),t),Math.round(Nn(mn.r*255,0,255))*65536+Math.round(Nn(mn.g*255,0,255))*256+Math.round(Nn(mn.b*255,0,255))}getHexString(t=ni){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Se.workingColorSpace){Se.fromWorkingColorSpace(mn.copy(this),e);let n=mn.r,i=mn.g,s=mn.b,o=Math.max(n,i,s),a=Math.min(n,i,s),l,c,h=(a+o)/2;if(a===o)l=0,c=0;else{let d=o-a;switch(c=h<=.5?d/(o+a):d/(2-o-a),o){case n:l=(i-s)/d+(i<s?6:0);break;case i:l=(s-n)/d+2;break;case s:l=(n-i)/d+4;break}l/=6}return t.h=l,t.s=c,t.l=h,t}getRGB(t,e=Se.workingColorSpace){return Se.fromWorkingColorSpace(mn.copy(this),e),t.r=mn.r,t.g=mn.g,t.b=mn.b,t}getStyle(t=ni){Se.fromWorkingColorSpace(mn.copy(this),t);let e=mn.r,n=mn.g,i=mn.b;return t!==ni?`color(${t} ${e.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(e*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(t,e,n){return this.getHSL(Fr),this.setHSL(Fr.h+t,Fr.s+e,Fr.l+n)}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,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(Fr),t.getHSL(dc);let n=uf(Fr.h,dc.h,e),i=uf(Fr.s,dc.s,e),s=uf(Fr.l,dc.l,e);return this.setHSL(n,i,s),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){let e=this.r,n=this.g,i=this.b,s=t.elements;return this.r=s[0]*e+s[3]*n+s[6]*i,this.g=s[1]*e+s[4]*n+s[7]*i,this.b=s[2]*e+s[5]*n+s[8]*i,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}},mn=new ge;ge.NAMES=F0;var QS=0,Ns=class extends Wr{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:QS++}),this.uuid=tl(),this.name="",this.type="Material",this.blending=zr,this.side=Hr,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Uf,this.blendDst=Of,this.blendEquation=Rs,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new ge(0,0,0),this.blendAlpha=0,this.depthFunc=Cc,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=C_,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=xo,this.stencilZFail=xo,this.stencilZPass=xo,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.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}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(let e in t){let n=t[e];if(n===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}let i=this[e];if(i===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n}}toJSON(t){let e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});let n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==zr&&(n.blending=this.blending),this.side!==Hr&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==Uf&&(n.blendSrc=this.blendSrc),this.blendDst!==Of&&(n.blendDst=this.blendDst),this.blendEquation!==Rs&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==Cc&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==C_&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==xo&&(n.stencilFail=this.stencilFail),this.stencilZFail!==xo&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==xo&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function i(s){let o=[];for(let a in s){let l=s[a];delete l.metadata,o.push(l)}return o}if(e){let s=i(t.textures),o=i(t.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}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;let e=t.clippingPlanes,n=null;if(e!==null){let i=e.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=e[s].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.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){t===!0&&this.version++}},Vc=class extends Ns{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ge(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 cr,this.combine=b0,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}};var He=new nt,pc=new _e,ri=class{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=n,this.usage=R_,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Or,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return HS("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}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,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,s=this.itemSize;i<s;i++)this.array[t+i]=e.array[n+i];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,n=this.count;e<n;e++)pc.fromBufferAttribute(this,e),pc.applyMatrix3(t),this.setXY(e,pc.x,pc.y);else if(this.itemSize===3)for(let e=0,n=this.count;e<n;e++)He.fromBufferAttribute(this,e),He.applyMatrix3(t),this.setXYZ(e,He.x,He.y,He.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)He.fromBufferAttribute(this,e),He.applyMatrix4(t),this.setXYZ(e,He.x,He.y,He.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)He.fromBufferAttribute(this,e),He.applyNormalMatrix(t),this.setXYZ(e,He.x,He.y,He.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)He.fromBufferAttribute(this,e),He.transformDirection(t),this.setXYZ(e,He.x,He.y,He.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let n=this.array[t*this.itemSize+e];return this.normalized&&(n=Ha(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=Fn(n,this.array)),this.array[t*this.itemSize+e]=n,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Ha(e,this.array)),e}setX(t,e){return this.normalized&&(e=Fn(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Ha(e,this.array)),e}setY(t,e){return this.normalized&&(e=Fn(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=Ha(e,this.array)),e}setZ(t,e){return this.normalized&&(e=Fn(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=Ha(e,this.array)),e}setW(t,e){return this.normalized&&(e=Fn(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=Fn(e,this.array),n=Fn(n,this.array)),this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,i){return t*=this.itemSize,this.normalized&&(e=Fn(e,this.array),n=Fn(n,this.array),i=Fn(i,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this}setXYZW(t,e,n,i,s){return t*=this.itemSize,this.normalized&&(e=Fn(e,this.array),n=Fn(n,this.array),i=Fn(i,this.array),s=Fn(s,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,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(){let 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!==R_&&(t.usage=this.usage),t}};var Hc=class extends ri{constructor(t,e,n){super(new Uint16Array(t),e,n)}};var Gc=class extends ri{constructor(t,e,n){super(new Uint32Array(t),e,n)}};var si=class extends ri{constructor(t,e,n){super(new Float32Array(t),e,n)}},tM=0,ei=new Oe,Tf=new gn,Do=new nt,Wn=new Fs,Ya=new Fs,je=new nt,Oi=class r extends Wr{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:tM++}),this.uuid=tl(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(L0(t)?Gc:Hc)(t,1):this.index=t,this}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 this.attributes[t]!==void 0}addGroup(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){let e=this.attributes.position;e!==void 0&&(e.applyMatrix4(t),e.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let s=new oe().getNormalMatrix(t);n.applyNormalMatrix(s),n.needsUpdate=!0}let i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(t),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return ei.makeRotationFromQuaternion(t),this.applyMatrix4(ei),this}rotateX(t){return ei.makeRotationX(t),this.applyMatrix4(ei),this}rotateY(t){return ei.makeRotationY(t),this.applyMatrix4(ei),this}rotateZ(t){return ei.makeRotationZ(t),this.applyMatrix4(ei),this}translate(t,e,n){return ei.makeTranslation(t,e,n),this.applyMatrix4(ei),this}scale(t,e,n){return ei.makeScale(t,e,n),this.applyMatrix4(ei),this}lookAt(t){return Tf.lookAt(t),Tf.updateMatrix(),this.applyMatrix4(Tf.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Do).negate(),this.translate(Do.x,Do.y,Do.z),this}setFromPoints(t){let e=[];for(let n=0,i=t.length;n<i;n++){let s=t[n];e.push(s.x,s.y,s.z||0)}return this.setAttribute("position",new si(e,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Fs);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new nt(-1/0,-1/0,-1/0),new nt(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let n=0,i=e.length;n<i;n++){let s=e[n];Wn.setFromBufferAttribute(s),this.morphTargetsRelative?(je.addVectors(this.boundingBox.min,Wn.min),this.boundingBox.expandByPoint(je),je.addVectors(this.boundingBox.max,Wn.max),this.boundingBox.expandByPoint(je)):(this.boundingBox.expandByPoint(Wn.min),this.boundingBox.expandByPoint(Wn.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(){this.boundingSphere===null&&(this.boundingSphere=new Go);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new nt,1/0);return}if(t){let n=this.boundingSphere.center;if(Wn.setFromBufferAttribute(t),e)for(let s=0,o=e.length;s<o;s++){let a=e[s];Ya.setFromBufferAttribute(a),this.morphTargetsRelative?(je.addVectors(Wn.min,Ya.min),Wn.expandByPoint(je),je.addVectors(Wn.max,Ya.max),Wn.expandByPoint(je)):(Wn.expandByPoint(Ya.min),Wn.expandByPoint(Ya.max))}Wn.getCenter(n);let i=0;for(let s=0,o=t.count;s<o;s++)je.fromBufferAttribute(t,s),i=Math.max(i,n.distanceToSquared(je));if(e)for(let s=0,o=e.length;s<o;s++){let a=e[s],l=this.morphTargetsRelative;for(let c=0,h=a.count;c<h;c++)je.fromBufferAttribute(a,c),l&&(Do.fromBufferAttribute(t,c),je.add(Do)),i=Math.max(i,n.distanceToSquared(je))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let t=this.index,e=this.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}let n=e.position,i=e.normal,s=e.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new ri(new Float32Array(4*n.count),4));let o=this.getAttribute("tangent"),a=[],l=[];for(let P=0;P<n.count;P++)a[P]=new nt,l[P]=new nt;let c=new nt,h=new nt,d=new nt,f=new _e,u=new _e,_=new _e,p=new nt,m=new nt;function g(P,M,y){c.fromBufferAttribute(n,P),h.fromBufferAttribute(n,M),d.fromBufferAttribute(n,y),f.fromBufferAttribute(s,P),u.fromBufferAttribute(s,M),_.fromBufferAttribute(s,y),h.sub(c),d.sub(c),u.sub(f),_.sub(f);let I=1/(u.x*_.y-_.x*u.y);isFinite(I)&&(p.copy(h).multiplyScalar(_.y).addScaledVector(d,-u.y).multiplyScalar(I),m.copy(d).multiplyScalar(u.x).addScaledVector(h,-_.x).multiplyScalar(I),a[P].add(p),a[M].add(p),a[y].add(p),l[P].add(m),l[M].add(m),l[y].add(m))}let b=this.groups;b.length===0&&(b=[{start:0,count:t.count}]);for(let P=0,M=b.length;P<M;++P){let y=b[P],I=y.start,N=y.count;for(let C=I,V=I+N;C<V;C+=3)g(t.getX(C+0),t.getX(C+1),t.getX(C+2))}let v=new nt,S=new nt,D=new nt,T=new nt;function w(P){D.fromBufferAttribute(i,P),T.copy(D);let M=a[P];v.copy(M),v.sub(D.multiplyScalar(D.dot(M))).normalize(),S.crossVectors(T,M);let I=S.dot(l[P])<0?-1:1;o.setXYZW(P,v.x,v.y,v.z,I)}for(let P=0,M=b.length;P<M;++P){let y=b[P],I=y.start,N=y.count;for(let C=I,V=I+N;C<V;C+=3)w(t.getX(C+0)),w(t.getX(C+1)),w(t.getX(C+2))}}computeVertexNormals(){let t=this.index,e=this.getAttribute("position");if(e!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new ri(new Float32Array(e.count*3),3),this.setAttribute("normal",n);else for(let f=0,u=n.count;f<u;f++)n.setXYZ(f,0,0,0);let i=new nt,s=new nt,o=new nt,a=new nt,l=new nt,c=new nt,h=new nt,d=new nt;if(t)for(let f=0,u=t.count;f<u;f+=3){let _=t.getX(f+0),p=t.getX(f+1),m=t.getX(f+2);i.fromBufferAttribute(e,_),s.fromBufferAttribute(e,p),o.fromBufferAttribute(e,m),h.subVectors(o,s),d.subVectors(i,s),h.cross(d),a.fromBufferAttribute(n,_),l.fromBufferAttribute(n,p),c.fromBufferAttribute(n,m),a.add(h),l.add(h),c.add(h),n.setXYZ(_,a.x,a.y,a.z),n.setXYZ(p,l.x,l.y,l.z),n.setXYZ(m,c.x,c.y,c.z)}else for(let f=0,u=e.count;f<u;f+=3)i.fromBufferAttribute(e,f+0),s.fromBufferAttribute(e,f+1),o.fromBufferAttribute(e,f+2),h.subVectors(o,s),d.subVectors(i,s),h.cross(d),n.setXYZ(f+0,h.x,h.y,h.z),n.setXYZ(f+1,h.x,h.y,h.z),n.setXYZ(f+2,h.x,h.y,h.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){let t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)je.fromBufferAttribute(t,e),je.normalize(),t.setXYZ(e,je.x,je.y,je.z)}toNonIndexed(){function t(a,l){let c=a.array,h=a.itemSize,d=a.normalized,f=new c.constructor(l.length*h),u=0,_=0;for(let p=0,m=l.length;p<m;p++){a.isInterleavedBufferAttribute?u=l[p]*a.data.stride+a.offset:u=l[p]*h;for(let g=0;g<h;g++)f[_++]=c[u++]}return new ri(f,h,d)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let e=new r,n=this.index.array,i=this.attributes;for(let a in i){let l=i[a],c=t(l,n);e.setAttribute(a,c)}let s=this.morphAttributes;for(let a in s){let l=[],c=s[a];for(let h=0,d=c.length;h<d;h++){let f=c[h],u=t(f,n);l.push(u)}e.morphAttributes[a]=l}e.morphTargetsRelative=this.morphTargetsRelative;let o=this.groups;for(let a=0,l=o.length;a<l;a++){let c=o[a];e.addGroup(c.start,c.count,c.materialIndex)}return e}toJSON(){let 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),this.parameters!==void 0){let l=this.parameters;for(let c in l)l[c]!==void 0&&(t[c]=l[c]);return t}t.data={attributes:{}};let e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});let n=this.attributes;for(let l in n){let c=n[l];t.data.attributes[l]=c.toJSON(t.data)}let i={},s=!1;for(let l in this.morphAttributes){let c=this.morphAttributes[l],h=[];for(let d=0,f=c.length;d<f;d++){let u=c[d];h.push(u.toJSON(t.data))}h.length>0&&(i[l]=h,s=!0)}s&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(t.data.groups=JSON.parse(JSON.stringify(o)));let a=this.boundingSphere;return a!==null&&(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;let e={};this.name=t.name;let n=t.index;n!==null&&this.setIndex(n.clone(e));let i=t.attributes;for(let c in i){let h=i[c];this.setAttribute(c,h.clone(e))}let s=t.morphAttributes;for(let c in s){let h=[],d=s[c];for(let f=0,u=d.length;f<u;f++)h.push(d[f].clone(e));this.morphAttributes[c]=h}this.morphTargetsRelative=t.morphTargetsRelative;let o=t.groups;for(let c=0,h=o.length;c<h;c++){let d=o[c];this.addGroup(d.start,d.count,d.materialIndex)}let a=t.boundingBox;a!==null&&(this.boundingBox=a.clone());let l=t.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}},W_=new Oe,Es=new kc,mc=new Go,X_=new nt,Co=new nt,Ro=new nt,Po=new nt,Af=new nt,gc=new nt,_c=new _e,xc=new _e,yc=new _e,Y_=new nt,q_=new nt,Z_=new nt,vc=new nt,Sc=new nt,Si=class extends gn{constructor(t=new Oi,e=new Vc){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),t.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),t.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){let e=this.geometry.morphAttributes,n=Object.keys(e);if(n.length>0){let i=e[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s<o;s++){let a=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}getVertexPosition(t,e){let n=this.geometry,i=n.attributes.position,s=n.morphAttributes.position,o=n.morphTargetsRelative;e.fromBufferAttribute(i,t);let a=this.morphTargetInfluences;if(s&&a){gc.set(0,0,0);for(let l=0,c=s.length;l<c;l++){let h=a[l],d=s[l];h!==0&&(Af.fromBufferAttribute(d,t),o?gc.addScaledVector(Af,h):gc.addScaledVector(Af.sub(e),h))}e.add(gc)}return e}raycast(t,e){let n=this.geometry,i=this.material,s=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),mc.copy(n.boundingSphere),mc.applyMatrix4(s),Es.copy(t.ray).recast(t.near),!(mc.containsPoint(Es.origin)===!1&&(Es.intersectSphere(mc,X_)===null||Es.origin.distanceToSquared(X_)>(t.far-t.near)**2))&&(W_.copy(s).invert(),Es.copy(t.ray).applyMatrix4(W_),!(n.boundingBox!==null&&Es.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(t,e,Es)))}_computeIntersections(t,e,n){let i,s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,c=s.attributes.uv,h=s.attributes.uv1,d=s.attributes.normal,f=s.groups,u=s.drawRange;if(a!==null)if(Array.isArray(o))for(let _=0,p=f.length;_<p;_++){let m=f[_],g=o[m.materialIndex],b=Math.max(m.start,u.start),v=Math.min(a.count,Math.min(m.start+m.count,u.start+u.count));for(let S=b,D=v;S<D;S+=3){let T=a.getX(S),w=a.getX(S+1),P=a.getX(S+2);i=Mc(this,g,t,n,c,h,d,T,w,P),i&&(i.faceIndex=Math.floor(S/3),i.face.materialIndex=m.materialIndex,e.push(i))}}else{let _=Math.max(0,u.start),p=Math.min(a.count,u.start+u.count);for(let m=_,g=p;m<g;m+=3){let b=a.getX(m),v=a.getX(m+1),S=a.getX(m+2);i=Mc(this,o,t,n,c,h,d,b,v,S),i&&(i.faceIndex=Math.floor(m/3),e.push(i))}}else if(l!==void 0)if(Array.isArray(o))for(let _=0,p=f.length;_<p;_++){let m=f[_],g=o[m.materialIndex],b=Math.max(m.start,u.start),v=Math.min(l.count,Math.min(m.start+m.count,u.start+u.count));for(let S=b,D=v;S<D;S+=3){let T=S,w=S+1,P=S+2;i=Mc(this,g,t,n,c,h,d,T,w,P),i&&(i.faceIndex=Math.floor(S/3),i.face.materialIndex=m.materialIndex,e.push(i))}}else{let _=Math.max(0,u.start),p=Math.min(l.count,u.start+u.count);for(let m=_,g=p;m<g;m+=3){let b=m,v=m+1,S=m+2;i=Mc(this,o,t,n,c,h,d,b,v,S),i&&(i.faceIndex=Math.floor(m/3),e.push(i))}}}};function eM(r,t,e,n,i,s,o,a){let l;if(t.side===Un?l=n.intersectTriangle(o,s,i,!0,a):l=n.intersectTriangle(i,s,o,t.side===Hr,a),l===null)return null;Sc.copy(a),Sc.applyMatrix4(r.matrixWorld);let c=e.ray.origin.distanceTo(Sc);return c<e.near||c>e.far?null:{distance:c,point:Sc.clone(),object:r}}function Mc(r,t,e,n,i,s,o,a,l,c){r.getVertexPosition(a,Co),r.getVertexPosition(l,Ro),r.getVertexPosition(c,Po);let h=eM(r,t,e,n,Co,Ro,Po,vc);if(h){i&&(_c.fromBufferAttribute(i,a),xc.fromBufferAttribute(i,l),yc.fromBufferAttribute(i,c),h.uv=No.getInterpolation(vc,Co,Ro,Po,_c,xc,yc,new _e)),s&&(_c.fromBufferAttribute(s,a),xc.fromBufferAttribute(s,l),yc.fromBufferAttribute(s,c),h.uv1=No.getInterpolation(vc,Co,Ro,Po,_c,xc,yc,new _e)),o&&(Y_.fromBufferAttribute(o,a),q_.fromBufferAttribute(o,l),Z_.fromBufferAttribute(o,c),h.normal=No.getInterpolation(vc,Co,Ro,Po,Y_,q_,Z_,new nt),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));let d={a,b:l,c,normal:new nt,materialIndex:0};No.getNormal(Co,Ro,Po,d.normal),h.face=d}return h}var $a=class r extends Oi{constructor(t=1,e=1,n=1,i=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:s,depthSegments:o};let a=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o);let l=[],c=[],h=[],d=[],f=0,u=0;_("z","y","x",-1,-1,n,e,t,o,s,0),_("z","y","x",1,-1,n,e,-t,o,s,1),_("x","z","y",1,1,t,n,e,i,o,2),_("x","z","y",1,-1,t,n,-e,i,o,3),_("x","y","z",1,-1,t,e,n,i,s,4),_("x","y","z",-1,-1,t,e,-n,i,s,5),this.setIndex(l),this.setAttribute("position",new si(c,3)),this.setAttribute("normal",new si(h,3)),this.setAttribute("uv",new si(d,2));function _(p,m,g,b,v,S,D,T,w,P,M){let y=S/w,I=D/P,N=S/2,C=D/2,V=T/2,$=w+1,W=P+1,Z=0,z=0,U=new nt;for(let R=0;R<W;R++){let at=R*I-C;for(let _t=0;_t<$;_t++){let Ut=_t*y-N;U[p]=Ut*b,U[m]=at*v,U[g]=V,c.push(U.x,U.y,U.z),U[p]=0,U[m]=0,U[g]=T>0?1:-1,h.push(U.x,U.y,U.z),d.push(_t/w),d.push(1-R/P),Z+=1}}for(let R=0;R<P;R++)for(let at=0;at<w;at++){let _t=f+at+$*R,Ut=f+at+$*(R+1),X=f+(at+1)+$*(R+1),ot=f+(at+1)+$*R;l.push(_t,Ut,ot),l.push(Ut,X,ot),z+=6}a.addGroup(u,z,M),u+=z,f+=Z}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new r(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}};function Wo(r){let t={};for(let e in r){t[e]={};for(let n in r[e]){let i=r[e][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[e][n]=null):t[e][n]=i.clone():Array.isArray(i)?t[e][n]=i.slice():t[e][n]=i}}return t}function An(r){let t={};for(let e=0;e<r.length;e++){let n=Wo(r[e]);for(let i in n)t[i]=n[i]}return t}function nM(r){let t=[];for(let e=0;e<r.length;e++)t.push(r[e].clone());return t}function N0(r){let t=r.getRenderTarget();return t===null?r.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:Se.workingColorSpace}var iM={clone:Wo,merge:An},rM=`void main() {
|
|
1
|
+
(()=>{function Bi(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Fd(r,t){r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.__proto__=t}var In={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},zs={duration:.5,overwrite:!1,delay:0},Au,an,Ae,qn=1e8,we=1/qn,gu=Math.PI*2,W0=gu/4,X0=0,Nd=Math.sqrt,Y0=Math.cos,q0=Math.sin,Ge=function(t){return typeof t=="string"},Ie=function(t){return typeof t=="function"},zi=function(t){return typeof t=="number"},ul=function(t){return typeof t>"u"},Ti=function(t){return typeof t=="object"},Pn=function(t){return t!==!1},Du=function(){return typeof window<"u"},el=function(t){return Ie(t)||Ge(t)},Ud=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},ln=Array.isArray,_u=/(?:-?\.?\d|\.)+/gi,Cu=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,jr=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,cu=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Ru=/[+-]=-?[.\d]+/,Od=/[^,'"\[\]\s]+/gi,Z0=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Ce,wi,xu,Pu,Bn={},sl={},Bd,kd=function(t){return(sl=Kr(t,Bn))&&cn},hl=function(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")},Qo=function(t,e){return!e&&console.warn(t)},zd=function(t,e){return t&&(Bn[t]=e)&&sl&&(sl[t]=e)||Bn},ta=function(){return 0},J0={suppressEvents:!0,isStart:!0,kill:!1},nl={suppressEvents:!0,kill:!1},$0={suppressEvents:!0},Iu={},fr=[],yu={},Vd,Cn={},uu={},Ad=30,il=[],Lu="",Fu=function(t){var e=t[0],n,i;if(Ti(e)||Ie(e)||(t=[t]),!(n=(e._gsap||{}).harness)){for(i=il.length;i--&&!il[i].targetTest(e););n=il[i]}for(i=t.length;i--;)t[i]&&(t[i]._gsap||(t[i]._gsap=new Ou(t[i],n)))||t.splice(i,1);return t},dr=function(t){return t._gsap||Fu(Zn(t))[0]._gsap},Nu=function(t,e,n){return(n=t[e])&&Ie(n)?t[e]():ul(n)&&t.getAttribute&&t.getAttribute(e)||n},xn=function(t,e){return(t=t.split(",")).forEach(e)||t},Le=function(t){return Math.round(t*1e5)/1e5||0},Je=function(t){return Math.round(t*1e7)/1e7||0},Qr=function(t,e){var n=e.charAt(0),i=parseFloat(e.substr(2));return t=parseFloat(t),n==="+"?t+i:n==="-"?t-i:n==="*"?t*i:t/i},K0=function(t,e){for(var n=e.length,i=0;t.indexOf(e[i])<0&&++i<n;);return i<n},ol=function(){var t=fr.length,e=fr.slice(0),n,i;for(yu={},fr.length=0,n=0;n<t;n++)i=e[n],i&&i._lazy&&(i.render(i._lazy[0],i._lazy[1],!0)._lazy=0)},Hd=function(t,e,n,i){fr.length&&!an&&ol(),t.render(e,n,i||an&&e<0&&(t._initted||t._startAt)),fr.length&&!an&&ol()},Gd=function(t){var e=parseFloat(t);return(e||e===0)&&(t+"").match(Od).length<2?e:Ge(t)?t.trim():t},Wd=function(t){return t},Jn=function(t,e){for(var n in e)n in t||(t[n]=e[n]);return t},j0=function(t){return function(e,n){for(var i in n)i in e||i==="duration"&&t||i==="ease"||(e[i]=n[i])}},Kr=function(t,e){for(var n in e)t[n]=e[n];return t},Dd=function r(t,e){for(var n in e)n!=="__proto__"&&n!=="constructor"&&n!=="prototype"&&(t[n]=Ti(e[n])?r(t[n]||(t[n]={}),e[n]):e[n]);return t},al=function(t,e){var n={},i;for(i in t)i in e||(n[i]=t[i]);return n},$o=function(t){var e=t.parent||Ce,n=t.keyframes?j0(ln(t.keyframes)):Jn;if(Pn(t.inherit))for(;e;)n(t,e.vars.defaults),e=e.parent||e._dp;return t},Q0=function(t,e){for(var n=t.length,i=n===e.length;i&&n--&&t[n]===e[n];);return n<0},Xd=function(t,e,n,i,s){n===void 0&&(n="_first"),i===void 0&&(i="_last");var o=t[i],a;if(s)for(a=e[s];o&&o[s]>a;)o=o._prev;return o?(e._next=o._next,o._next=e):(e._next=t[n],t[n]=e),e._next?e._next._prev=e:t[i]=e,e._prev=o,e.parent=e._dp=t,e},fl=function(t,e,n,i){n===void 0&&(n="_first"),i===void 0&&(i="_last");var s=e._prev,o=e._next;s?s._next=o:t[n]===e&&(t[n]=o),o?o._prev=s:t[i]===e&&(t[i]=s),e._next=e._prev=e.parent=null},pr=function(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},Zr=function(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var n=t;n;)n._dirty=1,n=n.parent;return t},tx=function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t},vu=function(t,e,n,i){return t._startAt&&(an?t._startAt.revert(nl):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,i))},ex=function r(t){return!t||t._ts&&r(t.parent)},Cd=function(t){return t._repeat?Vs(t._tTime,t=t.duration()+t._rDelay)*t:0},Vs=function(t,e){var n=Math.floor(t/=e);return t&&n===t?n-1:n},ll=function(t,e){return(t-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},dl=function(t){return t._end=Je(t._start+(t._tDur/Math.abs(t._ts||t._rts||we)||0))},pl=function(t,e){var n=t._dp;return n&&n.smoothChildTiming&&t._ts&&(t._start=Je(n._time-(t._ts>0?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),dl(t),n._dirty||Zr(n,t)),t},Yd=function(t,e){var n;if((e._time||!e._dur&&e._initted||e._start<t._time&&(e._dur||!e.add))&&(n=ll(t.rawTime(),e),(!e._dur||ia(0,e.totalDuration(),n)-e._tTime>we)&&e.render(n,!0)),Zr(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(n=t;n._dp;)n.rawTime()>=0&&n.totalTime(n._tTime),n=n._dp;t._zTime=-we}},Ei=function(t,e,n,i){return e.parent&&pr(e),e._start=Je((zi(n)?n:n||t!==Ce?Yn(t,n,e):t._time)+e._delay),e._end=Je(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),Xd(t,e,"_first","_last",t._sort?"_start":0),Su(e)||(t._recent=e),i||Yd(t,e),t._ts<0&&pl(t,t._tTime),t},qd=function(t,e){return(Bn.ScrollTrigger||hl("scrollTrigger",e))&&Bn.ScrollTrigger.create(e,t)},Zd=function(t,e,n,i,s){if(zu(t,e,s),!t._initted)return 1;if(!n&&t._pt&&!an&&(t._dur&&t.vars.lazy!==!1||!t._dur&&t.vars.lazy)&&Vd!==Rn.frame)return fr.push(t),t._lazy=[s,i],1},nx=function r(t){var e=t.parent;return e&&e._ts&&e._initted&&!e._lock&&(e.rawTime()<0||r(e))},Su=function(t){var e=t.data;return e==="isFromStart"||e==="isStart"},ix=function(t,e,n,i){var s=t.ratio,o=e<0||!e&&(!t._start&&nx(t)&&!(!t._initted&&Su(t))||(t._ts<0||t._dp._ts<0)&&!Su(t))?0:1,a=t._rDelay,l=0,c,h,f;if(a&&t._repeat&&(l=ia(0,t._tDur,e),h=Vs(l,a),t._yoyo&&h&1&&(o=1-o),h!==Vs(t._tTime,a)&&(s=1-o,t.vars.repeatRefresh&&t._initted&&t.invalidate())),o!==s||an||i||t._zTime===we||!e&&t._zTime){if(!t._initted&&Zd(t,e,i,n,l))return;for(f=t._zTime,t._zTime=e||(n?we:0),n||(n=e&&!f),t.ratio=o,t._from&&(o=1-o),t._time=0,t._tTime=l,c=t._pt;c;)c.r(o,c.d),c=c._next;e<0&&vu(t,e,n,!0),t._onUpdate&&!n&&On(t,"onUpdate"),l&&t._repeat&&!n&&t.parent&&On(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===o&&(o&&pr(t,1),!n&&!an&&(On(t,o?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)},rx=function(t,e,n){var i;if(n>e)for(i=t._first;i&&i._start<=n;){if(i.data==="isPause"&&i._start>e)return i;i=i._next}else for(i=t._last;i&&i._start>=n;){if(i.data==="isPause"&&i._start<e)return i;i=i._prev}},Hs=function(t,e,n,i){var s=t._repeat,o=Je(e)||0,a=t._tTime/t._tDur;return a&&!i&&(t._time*=o/t._dur),t._dur=o,t._tDur=s?s<0?1e10:Je(o*(s+1)+t._rDelay*s):o,a>0&&!i&&pl(t,t._tTime=t._tDur*a),t.parent&&dl(t),n||Zr(t.parent,t),t},Rd=function(t){return t instanceof tn?Zr(t):Hs(t,t._dur)},sx={_start:0,endTime:ta,totalDuration:ta},Yn=function r(t,e,n){var i=t.labels,s=t._recent||sx,o=t.duration()>=qn?s.endTime(!1):t._dur,a,l,c;return Ge(e)&&(isNaN(e)||e in i)?(l=e.charAt(0),c=e.substr(-1)==="%",a=e.indexOf("="),l==="<"||l===">"?(a>=0&&(e=e.replace(/=/,"")),(l==="<"?s._start:s.endTime(s._repeat>=0))+(parseFloat(e.substr(1))||0)*(c?(a<0?s:n).totalDuration()/100:1)):a<0?(e in i||(i[e]=o),i[e]):(l=parseFloat(e.charAt(a-1)+e.substr(a+1)),c&&n&&(l=l/100*(ln(n)?n[0]:n).totalDuration()),a>1?r(t,e.substr(0,a-1),n)+l:o+l)):e==null?o:+e},Ko=function(t,e,n){var i=zi(e[1]),s=(i?2:1)+(t<2?0:1),o=e[s],a,l;if(i&&(o.duration=e[1]),o.parent=n,t){for(a=o,l=n;l&&!("immediateRender"in a);)a=l.vars.defaults||{},l=Pn(l.vars.inherit)&&l.parent;o.immediateRender=Pn(a.immediateRender),t<2?o.runBackwards=1:o.startAt=e[s-1]}return new Ne(e[0],o,e[s+1])},mr=function(t,e){return t||t===0?e(t):e},ia=function(t,e,n){return n<t?t:n>e?e:n},en=function(t,e){return!Ge(t)||!(e=Z0.exec(t))?"":e[1]},ox=function(t,e,n){return mr(n,function(i){return ia(t,e,i)})},Mu=[].slice,Jd=function(t,e){return t&&Ti(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&Ti(t[0]))&&!t.nodeType&&t!==wi},ax=function(t,e,n){return n===void 0&&(n=[]),t.forEach(function(i){var s;return Ge(i)&&!e||Jd(i,1)?(s=n).push.apply(s,Zn(i)):n.push(i)})||n},Zn=function(t,e,n){return Ae&&!e&&Ae.selector?Ae.selector(t):Ge(t)&&!n&&(xu||!Gs())?Mu.call((e||Pu).querySelectorAll(t),0):ln(t)?ax(t,n):Jd(t)?Mu.call(t,0):t?[t]:[]},bu=function(t){return t=Zn(t)[0]||Qo("Invalid scope")||{},function(e){var n=t.current||t.nativeElement||t;return Zn(e,n.querySelectorAll?n:n===t?Qo("Invalid scope")||Pu.createElement("div"):t)}},$d=function(t){return t.sort(function(){return .5-Math.random()})},Kd=function(t){if(Ie(t))return t;var e=Ti(t)?t:{each:t},n=Jr(e.ease),i=e.from||0,s=parseFloat(e.base)||0,o={},a=i>0&&i<1,l=isNaN(i)||a,c=e.axis,h=i,f=i;return Ge(i)?h=f={center:.5,edges:.5,end:1}[i]||0:!a&&l&&(h=i[0],f=i[1]),function(d,u,_){var m=(_||e).length,p=o[m],g,b,v,S,D,T,w,P,M;if(!p){if(M=e.grid==="auto"?0:(e.grid||[1,qn])[1],!M){for(w=-qn;w<(w=_[M++].getBoundingClientRect().left)&&M<m;);M<m&&M--}for(p=o[m]=[],g=l?Math.min(M,m)*h-.5:i%M,b=M===qn?0:l?m*f/M-.5:i/M|0,w=0,P=qn,T=0;T<m;T++)v=T%M-g,S=b-(T/M|0),p[T]=D=c?Math.abs(c==="y"?S:v):Nd(v*v+S*S),D>w&&(w=D),D<P&&(P=D);i==="random"&&$d(p),p.max=w-P,p.min=P,p.v=m=(parseFloat(e.amount)||parseFloat(e.each)*(M>m?m-1:c?c==="y"?m/M:M:Math.max(M,m/M))||0)*(i==="edges"?-1:1),p.b=m<0?s-m:s,p.u=en(e.amount||e.each)||0,n=n&&m<0?op(n):n}return m=(p[d]-p.min)/p.max||0,Je(p.b+(n?n(m):m)*p.v)+p.u}},wu=function(t){var e=Math.pow(10,((t+"").split(".")[1]||"").length);return function(n){var i=Je(Math.round(parseFloat(n)/t)*t*e);return(i-i%1)/e+(zi(n)?0:en(n))}},jd=function(t,e){var n=ln(t),i,s;return!n&&Ti(t)&&(i=n=t.radius||qn,t.values?(t=Zn(t.values),(s=!zi(t[0]))&&(i*=i)):t=wu(t.increment)),mr(e,n?Ie(t)?function(o){return s=t(o),Math.abs(s-o)<=i?s:o}:function(o){for(var a=parseFloat(s?o.x:o),l=parseFloat(s?o.y:0),c=qn,h=0,f=t.length,d,u;f--;)s?(d=t[f].x-a,u=t[f].y-l,d=d*d+u*u):d=Math.abs(t[f]-a),d<c&&(c=d,h=f);return h=!i||c<=i?t[h]:o,s||h===o||zi(o)?h:h+en(o)}:wu(t))},Qd=function(t,e,n,i){return mr(ln(t)?!e:n===!0?!!(n=0):!i,function(){return ln(t)?t[~~(Math.random()*t.length)]:(n=n||1e-5)&&(i=n<1?Math.pow(10,(n+"").length-2):1)&&Math.floor(Math.round((t-n/2+Math.random()*(e-t+n*.99))/n)*n*i)/i})},lx=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(i){return e.reduce(function(s,o){return o(s)},i)}},cx=function(t,e){return function(n){return t(parseFloat(n))+(e||en(n))}},ux=function(t,e,n){return ep(t,e,0,1,n)},tp=function(t,e,n){return mr(n,function(i){return t[~~e(i)]})},hx=function r(t,e,n){var i=e-t;return ln(t)?tp(t,r(0,t.length),e):mr(n,function(s){return(i+(s-t)%i)%i+t})},fx=function r(t,e,n){var i=e-t,s=i*2;return ln(t)?tp(t,r(0,t.length-1),e):mr(n,function(o){return o=(s+(o-t)%s)%s||0,t+(o>i?s-o:o)})},Ws=function(t){for(var e=0,n="",i,s,o,a;~(i=t.indexOf("random(",e));)o=t.indexOf(")",i),a=t.charAt(i+7)==="[",s=t.substr(i+7,o-i-7).match(a?Od:_u),n+=t.substr(e,i-e)+Qd(a?s:+s[0],a?0:+s[1],+s[2]||1e-5),e=o+1;return n+t.substr(e,t.length-e)},ep=function(t,e,n,i,s){var o=e-t,a=i-n;return mr(s,function(l){return n+((l-t)/o*a||0)})},dx=function r(t,e,n,i){var s=isNaN(t+e)?0:function(u){return(1-u)*t+u*e};if(!s){var o=Ge(t),a={},l,c,h,f,d;if(n===!0&&(i=1)&&(n=null),o)t={p:t},e={p:e};else if(ln(t)&&!ln(e)){for(h=[],f=t.length,d=f-2,c=1;c<f;c++)h.push(r(t[c-1],t[c]));f--,s=function(_){_*=f;var m=Math.min(d,~~_);return h[m](_-m)},n=e}else i||(t=Kr(ln(t)?[]:{},t));if(!h){for(l in e)Bu.call(a,t,l,"get",e[l]);s=function(_){return Gu(_,a)||(o?t.p:t)}}}return mr(n,s)},Pd=function(t,e,n){var i=t.labels,s=qn,o,a,l;for(o in i)a=i[o]-e,a<0==!!n&&a&&s>(a=Math.abs(a))&&(l=o,s=a);return l},On=function(t,e,n){var i=t.vars,s=i[e],o=Ae,a=t._ctx,l,c,h;if(s)return l=i[e+"Params"],c=i.callbackScope||t,n&&fr.length&&ol(),a&&(Ae=a),h=l?s.apply(c,l):s.call(c),Ae=o,h},Zo=function(t){return pr(t),t.scrollTrigger&&t.scrollTrigger.kill(!!an),t.progress()<1&&On(t,"onInterrupt"),t},ks,np=[],ip=function(t){if(t)if(t=!t.name&&t.default||t,Du()||t.headless){var e=t.name,n=Ie(t),i=e&&!n&&t.init?function(){this._props=[]}:t,s={init:ta,render:Gu,add:Bu,kill:Cx,modifier:Dx,rawVars:0},o={targetTest:0,get:0,getSetter:ml,aliases:{},register:0};if(Gs(),t!==i){if(Cn[e])return;Jn(i,Jn(al(t,s),o)),Kr(i.prototype,Kr(s,al(t,o))),Cn[i.prop=e]=i,t.targetTest&&(il.push(i),Iu[e]=1),e=(e==="css"?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}zd(e,i),t.register&&t.register(cn,i,yn)}else np.push(t)},Me=255,Jo={aqua:[0,Me,Me],lime:[0,Me,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Me],navy:[0,0,128],white:[Me,Me,Me],olive:[128,128,0],yellow:[Me,Me,0],orange:[Me,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Me,0,0],pink:[Me,192,203],cyan:[0,Me,Me],transparent:[Me,Me,Me,0]},hu=function(t,e,n){return t+=t<0?1:t>1?-1:0,(t*6<1?e+(n-e)*t*6:t<.5?n:t*3<2?e+(n-e)*(2/3-t)*6:e)*Me+.5|0},rp=function(t,e,n){var i=t?zi(t)?[t>>16,t>>8&Me,t&Me]:0:Jo.black,s,o,a,l,c,h,f,d,u,_;if(!i){if(t.substr(-1)===","&&(t=t.substr(0,t.length-1)),Jo[t])i=Jo[t];else if(t.charAt(0)==="#"){if(t.length<6&&(s=t.charAt(1),o=t.charAt(2),a=t.charAt(3),t="#"+s+s+o+o+a+a+(t.length===5?t.charAt(4)+t.charAt(4):"")),t.length===9)return i=parseInt(t.substr(1,6),16),[i>>16,i>>8&Me,i&Me,parseInt(t.substr(7),16)/255];t=parseInt(t.substr(1),16),i=[t>>16,t>>8&Me,t&Me]}else if(t.substr(0,3)==="hsl"){if(i=_=t.match(_u),!e)l=+i[0]%360/360,c=+i[1]/100,h=+i[2]/100,o=h<=.5?h*(c+1):h+c-h*c,s=h*2-o,i.length>3&&(i[3]*=1),i[0]=hu(l+1/3,s,o),i[1]=hu(l,s,o),i[2]=hu(l-1/3,s,o);else if(~t.indexOf("="))return i=t.match(Cu),n&&i.length<4&&(i[3]=1),i}else i=t.match(_u)||Jo.transparent;i=i.map(Number)}return e&&!_&&(s=i[0]/Me,o=i[1]/Me,a=i[2]/Me,f=Math.max(s,o,a),d=Math.min(s,o,a),h=(f+d)/2,f===d?l=c=0:(u=f-d,c=h>.5?u/(2-f-d):u/(f+d),l=f===s?(o-a)/u+(o<a?6:0):f===o?(a-s)/u+2:(s-o)/u+4,l*=60),i[0]=~~(l+.5),i[1]=~~(c*100+.5),i[2]=~~(h*100+.5)),n&&i.length<4&&(i[3]=1),i},sp=function(t){var e=[],n=[],i=-1;return t.split(ki).forEach(function(s){var o=s.match(jr)||[];e.push.apply(e,o),n.push(i+=o.length+1)}),e.c=n,e},Id=function(t,e,n){var i="",s=(t+i).match(ki),o=e?"hsla(":"rgba(",a=0,l,c,h,f;if(!s)return t;if(s=s.map(function(d){return(d=rp(d,e,1))&&o+(e?d[0]+","+d[1]+"%,"+d[2]+"%,"+d[3]:d.join(","))+")"}),n&&(h=sp(t),l=n.c,l.join(i)!==h.c.join(i)))for(c=t.replace(ki,"1").split(jr),f=c.length-1;a<f;a++)i+=c[a]+(~l.indexOf(a)?s.shift()||o+"0,0,0,0)":(h.length?h:s.length?s:n).shift());if(!c)for(c=t.split(ki),f=c.length-1;a<f;a++)i+=c[a]+s[a];return i+c[f]},ki=function(){var r="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",t;for(t in Jo)r+="|"+t+"\\b";return new RegExp(r+")","gi")}(),px=/hsl[a]?\(/,Uu=function(t){var e=t.join(" "),n;if(ki.lastIndex=0,ki.test(e))return n=px.test(e),t[1]=Id(t[1],n),t[0]=Id(t[0],n,sp(t[1])),!0},ea,Rn=function(){var r=Date.now,t=500,e=33,n=r(),i=n,s=1e3/240,o=s,a=[],l,c,h,f,d,u,_=function m(p){var g=r()-i,b=p===!0,v,S,D,T;if((g>t||g<0)&&(n+=g-e),i+=g,D=i-n,v=D-o,(v>0||b)&&(T=++f.frame,d=D-f.time*1e3,f.time=D=D/1e3,o+=v+(v>=s?4:s-v),S=1),b||(l=c(m)),S)for(u=0;u<a.length;u++)a[u](D,d,T,p)};return f={time:0,frame:0,tick:function(){_(!0)},deltaRatio:function(p){return d/(1e3/(p||60))},wake:function(){Bd&&(!xu&&Du()&&(wi=xu=window,Pu=wi.document||{},Bn.gsap=cn,(wi.gsapVersions||(wi.gsapVersions=[])).push(cn.version),kd(sl||wi.GreenSockGlobals||!wi.gsap&&wi||{}),np.forEach(ip)),h=typeof requestAnimationFrame<"u"&&requestAnimationFrame,l&&f.sleep(),c=h||function(p){return setTimeout(p,o-f.time*1e3+1|0)},ea=1,_(2))},sleep:function(){(h?cancelAnimationFrame:clearTimeout)(l),ea=0,c=ta},lagSmoothing:function(p,g){t=p||1/0,e=Math.min(g||33,t)},fps:function(p){s=1e3/(p||240),o=f.time*1e3+s},add:function(p,g,b){var v=g?function(S,D,T,w){p(S,D,T,w),f.remove(v)}:p;return f.remove(p),a[b?"unshift":"push"](v),Gs(),v},remove:function(p,g){~(g=a.indexOf(p))&&a.splice(g,1)&&u>=g&&u--},_listeners:a},f}(),Gs=function(){return!ea&&Rn.wake()},fe={},mx=/^[\d.\-M][\d.\-,\s]/,gx=/["']/g,_x=function(t){for(var e={},n=t.substr(1,t.length-3).split(":"),i=n[0],s=1,o=n.length,a,l,c;s<o;s++)l=n[s],a=s!==o-1?l.lastIndexOf(","):l.length,c=l.substr(0,a),e[i]=isNaN(c)?c.replace(gx,"").trim():+c,i=l.substr(a+1).trim();return e},xx=function(t){var e=t.indexOf("(")+1,n=t.indexOf(")"),i=t.indexOf("(",e);return t.substring(e,~i&&i<n?t.indexOf(")",n+1):n)},yx=function(t){var e=(t+"").split("("),n=fe[e[0]];return n&&e.length>1&&n.config?n.config.apply(null,~t.indexOf("{")?[_x(e[1])]:xx(t).split(",").map(Gd)):fe._CE&&mx.test(t)?fe._CE("",t):n},op=function(t){return function(e){return 1-t(1-e)}},ap=function r(t,e){for(var n=t._first,i;n;)n instanceof tn?r(n,e):n.vars.yoyoEase&&(!n._yoyo||!n._repeat)&&n._yoyo!==e&&(n.timeline?r(n.timeline,e):(i=n._ease,n._ease=n._yEase,n._yEase=i,n._yoyo=e)),n=n._next},Jr=function(t,e){return t&&(Ie(t)?t:fe[t]||yx(t))||e},ts=function(t,e,n,i){n===void 0&&(n=function(l){return 1-e(1-l)}),i===void 0&&(i=function(l){return l<.5?e(l*2)/2:1-e((1-l)*2)/2});var s={easeIn:e,easeOut:n,easeInOut:i},o;return xn(t,function(a){fe[a]=Bn[a]=s,fe[o=a.toLowerCase()]=n;for(var l in s)fe[o+(l==="easeIn"?".in":l==="easeOut"?".out":".inOut")]=fe[a+"."+l]=s[l]}),s},lp=function(t){return function(e){return e<.5?(1-t(1-e*2))/2:.5+t((e-.5)*2)/2}},fu=function r(t,e,n){var i=e>=1?e:1,s=(n||(t?.3:.45))/(e<1?e:1),o=s/gu*(Math.asin(1/i)||0),a=function(h){return h===1?1:i*Math.pow(2,-10*h)*q0((h-o)*s)+1},l=t==="out"?a:t==="in"?function(c){return 1-a(1-c)}:lp(a);return s=gu/s,l.config=function(c,h){return r(t,c,h)},l},du=function r(t,e){e===void 0&&(e=1.70158);var n=function(o){return o?--o*o*((e+1)*o+e)+1:0},i=t==="out"?n:t==="in"?function(s){return 1-n(1-s)}:lp(n);return i.config=function(s){return r(t,s)},i};xn("Linear,Quad,Cubic,Quart,Quint,Strong",function(r,t){var e=t<5?t+1:t;ts(r+",Power"+(e-1),t?function(n){return Math.pow(n,e)}:function(n){return n},function(n){return 1-Math.pow(1-n,e)},function(n){return n<.5?Math.pow(n*2,e)/2:1-Math.pow((1-n)*2,e)/2})});fe.Linear.easeNone=fe.none=fe.Linear.easeIn;ts("Elastic",fu("in"),fu("out"),fu());(function(r,t){var e=1/t,n=2*e,i=2.5*e,s=function(a){return a<e?r*a*a:a<n?r*Math.pow(a-1.5/t,2)+.75:a<i?r*(a-=2.25/t)*a+.9375:r*Math.pow(a-2.625/t,2)+.984375};ts("Bounce",function(o){return 1-s(1-o)},s)})(7.5625,2.75);ts("Expo",function(r){return r?Math.pow(2,10*(r-1)):0});ts("Circ",function(r){return-(Nd(1-r*r)-1)});ts("Sine",function(r){return r===1?1:-Y0(r*W0)+1});ts("Back",du("in"),du("out"),du());fe.SteppedEase=fe.steps=Bn.SteppedEase={config:function(t,e){t===void 0&&(t=1);var n=1/t,i=t+(e?0:1),s=e?1:0,o=1-we;return function(a){return((i*ia(0,o,a)|0)+s)*n}}};zs.ease=fe["quad.out"];xn("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(r){return Lu+=r+","+r+"Params,"});var Ou=function(t,e){this.id=X0++,t._gsap=this,this.target=t,this.harness=e,this.get=e?e.get:Nu,this.set=e?e.getSetter:ml},na=function(){function r(e){this.vars=e,this._delay=+e.delay||0,(this._repeat=e.repeat===1/0?-2:e.repeat||0)&&(this._rDelay=e.repeatDelay||0,this._yoyo=!!e.yoyo||!!e.yoyoEase),this._ts=1,Hs(this,+e.duration,1,1),this.data=e.data,Ae&&(this._ctx=Ae,Ae.data.push(this)),ea||Rn.wake()}var t=r.prototype;return t.delay=function(n){return n||n===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+n-this._delay),this._delay=n,this):this._delay},t.duration=function(n){return arguments.length?this.totalDuration(this._repeat>0?n+(n+this._rDelay)*this._repeat:n):this.totalDuration()&&this._dur},t.totalDuration=function(n){return arguments.length?(this._dirty=0,Hs(this,this._repeat<0?n:(n-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(n,i){if(Gs(),!arguments.length)return this._tTime;var s=this._dp;if(s&&s.smoothChildTiming&&this._ts){for(pl(this,n),!s._dp||s.parent||Yd(s,this);s&&s.parent;)s.parent._time!==s._start+(s._ts>=0?s._tTime/s._ts:(s.totalDuration()-s._tTime)/-s._ts)&&s.totalTime(s._tTime,!0),s=s.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&n<this._tDur||this._ts<0&&n>0||!this._tDur&&!n)&&Ei(this._dp,this,this._start-this._delay)}return(this._tTime!==n||!this._dur&&!i||this._initted&&Math.abs(this._zTime)===we||!n&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=n),Hd(this,n,i)),this},t.time=function(n,i){return arguments.length?this.totalTime(Math.min(this.totalDuration(),n+Cd(this))%(this._dur+this._rDelay)||(n?this._dur:0),i):this._time},t.totalProgress=function(n,i){return arguments.length?this.totalTime(this.totalDuration()*n,i):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>0?1:0},t.progress=function(n,i){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-n:n)+Cd(this),i):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},t.iteration=function(n,i){var s=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(n-1)*s,i):this._repeat?Vs(this._tTime,s)+1:1},t.timeScale=function(n,i){if(!arguments.length)return this._rts===-we?0:this._rts;if(this._rts===n)return this;var s=this.parent&&this._ts?ll(this.parent._time,this):this._tTime;return this._rts=+n||0,this._ts=this._ps||n===-we?0:this._rts,this.totalTime(ia(-Math.abs(this._delay),this._tDur,s),i!==!1),dl(this),tx(this)},t.paused=function(n){return arguments.length?(this._ps!==n&&(this._ps=n,n?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Gs(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==we&&(this._tTime-=we)))),this):this._ps},t.startTime=function(n){if(arguments.length){this._start=n;var i=this.parent||this._dp;return i&&(i._sort||!this.parent)&&Ei(i,this,n-this._delay),this}return this._start},t.endTime=function(n){return this._start+(Pn(n)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(n){var i=this.parent||this._dp;return i?n&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?ll(i.rawTime(n),this):this._tTime:this._tTime},t.revert=function(n){n===void 0&&(n=$0);var i=an;return an=n,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(n),this.totalTime(-.01,n.suppressEvents)),this.data!=="nested"&&n.kill!==!1&&this.kill(),an=i,this},t.globalTime=function(n){for(var i=this,s=arguments.length?n:i.rawTime();i;)s=i._start+s/(Math.abs(i._ts)||1),i=i._dp;return!this.parent&&this._sat?this._sat.globalTime(n):s},t.repeat=function(n){return arguments.length?(this._repeat=n===1/0?-2:n,Rd(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(n){if(arguments.length){var i=this._time;return this._rDelay=n,Rd(this),i?this.time(i):this}return this._rDelay},t.yoyo=function(n){return arguments.length?(this._yoyo=n,this):this._yoyo},t.seek=function(n,i){return this.totalTime(Yn(this,n),Pn(i))},t.restart=function(n,i){return this.play().totalTime(n?-this._delay:0,Pn(i))},t.play=function(n,i){return n!=null&&this.seek(n,i),this.reversed(!1).paused(!1)},t.reverse=function(n,i){return n!=null&&this.seek(n||this.totalDuration(),i),this.reversed(!0).paused(!1)},t.pause=function(n,i){return n!=null&&this.seek(n,i),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(n){return arguments.length?(!!n!==this.reversed()&&this.timeScale(-this._rts||(n?-we:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-we,this},t.isActive=function(){var n=this.parent||this._dp,i=this._start,s;return!!(!n||this._ts&&this._initted&&n.isActive()&&(s=n.rawTime(!0))>=i&&s<this.endTime(!0)-we)},t.eventCallback=function(n,i,s){var o=this.vars;return arguments.length>1?(i?(o[n]=i,s&&(o[n+"Params"]=s),n==="onUpdate"&&(this._onUpdate=i)):delete o[n],this):o[n]},t.then=function(n){var i=this;return new Promise(function(s){var o=Ie(n)?n:Wd,a=function(){var c=i.then;i.then=null,Ie(o)&&(o=o(i))&&(o.then||o===i)&&(i.then=c),s(o),i.then=c};i._initted&&i.totalProgress()===1&&i._ts>=0||!i._tTime&&i._ts<0?a():i._prom=a})},t.kill=function(){Zo(this)},r}();Jn(na.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:-we,_prom:0,_ps:!1,_rts:1});var tn=function(r){Fd(t,r);function t(n,i){var s;return n===void 0&&(n={}),s=r.call(this,n)||this,s.labels={},s.smoothChildTiming=!!n.smoothChildTiming,s.autoRemoveChildren=!!n.autoRemoveChildren,s._sort=Pn(n.sortChildren),Ce&&Ei(n.parent||Ce,Bi(s),i),n.reversed&&s.reverse(),n.paused&&s.paused(!0),n.scrollTrigger&&qd(Bi(s),n.scrollTrigger),s}var e=t.prototype;return e.to=function(i,s,o){return Ko(0,arguments,this),this},e.from=function(i,s,o){return Ko(1,arguments,this),this},e.fromTo=function(i,s,o,a){return Ko(2,arguments,this),this},e.set=function(i,s,o){return s.duration=0,s.parent=this,$o(s).repeatDelay||(s.repeat=0),s.immediateRender=!!s.immediateRender,new Ne(i,s,Yn(this,o),1),this},e.call=function(i,s,o){return Ei(this,Ne.delayedCall(0,i,s),o)},e.staggerTo=function(i,s,o,a,l,c,h){return o.duration=s,o.stagger=o.stagger||a,o.onComplete=c,o.onCompleteParams=h,o.parent=this,new Ne(i,o,Yn(this,l)),this},e.staggerFrom=function(i,s,o,a,l,c,h){return o.runBackwards=1,$o(o).immediateRender=Pn(o.immediateRender),this.staggerTo(i,s,o,a,l,c,h)},e.staggerFromTo=function(i,s,o,a,l,c,h,f){return a.startAt=o,$o(a).immediateRender=Pn(a.immediateRender),this.staggerTo(i,s,a,l,c,h,f)},e.render=function(i,s,o){var a=this._time,l=this._dirty?this.totalDuration():this._tDur,c=this._dur,h=i<=0?0:Je(i),f=this._zTime<0!=i<0&&(this._initted||!c),d,u,_,m,p,g,b,v,S,D,T,w;if(this!==Ce&&h>l&&i>=0&&(h=l),h!==this._tTime||o||f){if(a!==this._time&&c&&(h+=this._time-a,i+=this._time-a),d=h,S=this._start,v=this._ts,g=!v,f&&(c||(a=this._zTime),(i||!s)&&(this._zTime=i)),this._repeat){if(T=this._yoyo,p=c+this._rDelay,this._repeat<-1&&i<0)return this.totalTime(p*100+i,s,o);if(d=Je(h%p),h===l?(m=this._repeat,d=c):(m=~~(h/p),m&&m===h/p&&(d=c,m--),d>c&&(d=c)),D=Vs(this._tTime,p),!a&&this._tTime&&D!==m&&this._tTime-D*p-this._dur<=0&&(D=m),T&&m&1&&(d=c-d,w=1),m!==D&&!this._lock){var P=T&&D&1,M=P===(T&&m&1);if(m<D&&(P=!P),a=P?0:h%c?c:h,this._lock=1,this.render(a||(w?0:Je(m*p)),s,!c)._lock=0,this._tTime=h,!s&&this.parent&&On(this,"onRepeat"),this.vars.repeatRefresh&&!w&&(this.invalidate()._lock=1),a&&a!==this._time||g!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(c=this._dur,l=this._tDur,M&&(this._lock=2,a=P?c:-1e-4,this.render(a,!0),this.vars.repeatRefresh&&!w&&this.invalidate()),this._lock=0,!this._ts&&!g)return this;ap(this,w)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(b=rx(this,Je(a),Je(d)),b&&(h-=d-(d=b._start))),this._tTime=h,this._time=d,this._act=!v,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=i,a=0),!a&&d&&!s&&!m&&(On(this,"onStart"),this._tTime!==h))return this;if(d>=a&&i>=0)for(u=this._first;u;){if(_=u._next,(u._act||d>=u._start)&&u._ts&&b!==u){if(u.parent!==this)return this.render(i,s,o);if(u.render(u._ts>0?(d-u._start)*u._ts:(u._dirty?u.totalDuration():u._tDur)+(d-u._start)*u._ts,s,o),d!==this._time||!this._ts&&!g){b=0,_&&(h+=this._zTime=-we);break}}u=_}else{u=this._last;for(var y=i<0?i:d;u;){if(_=u._prev,(u._act||y<=u._end)&&u._ts&&b!==u){if(u.parent!==this)return this.render(i,s,o);if(u.render(u._ts>0?(y-u._start)*u._ts:(u._dirty?u.totalDuration():u._tDur)+(y-u._start)*u._ts,s,o||an&&(u._initted||u._startAt)),d!==this._time||!this._ts&&!g){b=0,_&&(h+=this._zTime=y?-we:we);break}}u=_}}if(b&&!s&&(this.pause(),b.render(d>=a?0:-we)._zTime=d>=a?1:-1,this._ts))return this._start=S,dl(this),this.render(i,s,o);this._onUpdate&&!s&&On(this,"onUpdate",!0),(h===l&&this._tTime>=this.totalDuration()||!h&&a)&&(S===this._start||Math.abs(v)!==Math.abs(this._ts))&&(this._lock||((i||!c)&&(h===l&&this._ts>0||!h&&this._ts<0)&&pr(this,1),!s&&!(i<0&&!a)&&(h||a||!l)&&(On(this,h===l&&i>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(h<l&&this.timeScale()>0)&&this._prom())))}return this},e.add=function(i,s){var o=this;if(zi(s)||(s=Yn(this,s,i)),!(i instanceof na)){if(ln(i))return i.forEach(function(a){return o.add(a,s)}),this;if(Ge(i))return this.addLabel(i,s);if(Ie(i))i=Ne.delayedCall(0,i);else return this}return this!==i?Ei(this,i,s):this},e.getChildren=function(i,s,o,a){i===void 0&&(i=!0),s===void 0&&(s=!0),o===void 0&&(o=!0),a===void 0&&(a=-qn);for(var l=[],c=this._first;c;)c._start>=a&&(c instanceof Ne?s&&l.push(c):(o&&l.push(c),i&&l.push.apply(l,c.getChildren(!0,s,o)))),c=c._next;return l},e.getById=function(i){for(var s=this.getChildren(1,1,1),o=s.length;o--;)if(s[o].vars.id===i)return s[o]},e.remove=function(i){return Ge(i)?this.removeLabel(i):Ie(i)?this.killTweensOf(i):(fl(this,i),i===this._recent&&(this._recent=this._last),Zr(this))},e.totalTime=function(i,s){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Je(Rn.time-(this._ts>0?i/this._ts:(this.totalDuration()-i)/-this._ts))),r.prototype.totalTime.call(this,i,s),this._forcing=0,this):this._tTime},e.addLabel=function(i,s){return this.labels[i]=Yn(this,s),this},e.removeLabel=function(i){return delete this.labels[i],this},e.addPause=function(i,s,o){var a=Ne.delayedCall(0,s||ta,o);return a.data="isPause",this._hasPause=1,Ei(this,a,Yn(this,i))},e.removePause=function(i){var s=this._first;for(i=Yn(this,i);s;)s._start===i&&s.data==="isPause"&&pr(s),s=s._next},e.killTweensOf=function(i,s,o){for(var a=this.getTweensOf(i,o),l=a.length;l--;)hr!==a[l]&&a[l].kill(i,s);return this},e.getTweensOf=function(i,s){for(var o=[],a=Zn(i),l=this._first,c=zi(s),h;l;)l instanceof Ne?K0(l._targets,a)&&(c?(!hr||l._initted&&l._ts)&&l.globalTime(0)<=s&&l.globalTime(l.totalDuration())>s:!s||l.isActive())&&o.push(l):(h=l.getTweensOf(a,s)).length&&o.push.apply(o,h),l=l._next;return o},e.tweenTo=function(i,s){s=s||{};var o=this,a=Yn(o,i),l=s,c=l.startAt,h=l.onStart,f=l.onStartParams,d=l.immediateRender,u,_=Ne.to(o,Jn({ease:s.ease||"none",lazy:!1,immediateRender:!1,time:a,overwrite:"auto",duration:s.duration||Math.abs((a-(c&&"time"in c?c.time:o._time))/o.timeScale())||we,onStart:function(){if(o.pause(),!u){var p=s.duration||Math.abs((a-(c&&"time"in c?c.time:o._time))/o.timeScale());_._dur!==p&&Hs(_,p,0,1).render(_._time,!0,!0),u=1}h&&h.apply(_,f||[])}},s));return d?_.render(0):_},e.tweenFromTo=function(i,s,o){return this.tweenTo(s,Jn({startAt:{time:Yn(this,i)}},o))},e.recent=function(){return this._recent},e.nextLabel=function(i){return i===void 0&&(i=this._time),Pd(this,Yn(this,i))},e.previousLabel=function(i){return i===void 0&&(i=this._time),Pd(this,Yn(this,i),1)},e.currentLabel=function(i){return arguments.length?this.seek(i,!0):this.previousLabel(this._time+we)},e.shiftChildren=function(i,s,o){o===void 0&&(o=0);for(var a=this._first,l=this.labels,c;a;)a._start>=o&&(a._start+=i,a._end+=i),a=a._next;if(s)for(c in l)l[c]>=o&&(l[c]+=i);return Zr(this)},e.invalidate=function(i){var s=this._first;for(this._lock=0;s;)s.invalidate(i),s=s._next;return r.prototype.invalidate.call(this,i)},e.clear=function(i){i===void 0&&(i=!0);for(var s=this._first,o;s;)o=s._next,this.remove(s),s=o;return this._dp&&(this._time=this._tTime=this._pTime=0),i&&(this.labels={}),Zr(this)},e.totalDuration=function(i){var s=0,o=this,a=o._last,l=qn,c,h,f;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-i:i));if(o._dirty){for(f=o.parent;a;)c=a._prev,a._dirty&&a.totalDuration(),h=a._start,h>l&&o._sort&&a._ts&&!o._lock?(o._lock=1,Ei(o,a,h-a._delay,1)._lock=0):l=h,h<0&&a._ts&&(s-=h,(!f&&!o._dp||f&&f.smoothChildTiming)&&(o._start+=h/o._ts,o._time-=h,o._tTime-=h),o.shiftChildren(-h,!1,-1/0),l=0),a._end>s&&a._ts&&(s=a._end),a=c;Hs(o,o===Ce&&o._time>s?o._time:s,1,1),o._dirty=0}return o._tDur},t.updateRoot=function(i){if(Ce._ts&&(Hd(Ce,ll(i,Ce)),Vd=Rn.frame),Rn.frame>=Ad){Ad+=In.autoSleep||120;var s=Ce._first;if((!s||!s._ts)&&In.autoSleep&&Rn._listeners.length<2){for(;s&&!s._ts;)s=s._next;s||Rn.sleep()}}},t}(na);Jn(tn.prototype,{_lock:0,_hasPause:0,_forcing:0});var vx=function(t,e,n,i,s,o,a){var l=new yn(this._pt,t,e,0,1,Hu,null,s),c=0,h=0,f,d,u,_,m,p,g,b;for(l.b=n,l.e=i,n+="",i+="",(g=~i.indexOf("random("))&&(i=Ws(i)),o&&(b=[n,i],o(b,t,e),n=b[0],i=b[1]),d=n.match(cu)||[];f=cu.exec(i);)_=f[0],m=i.substring(c,f.index),u?u=(u+1)%5:m.substr(-5)==="rgba("&&(u=1),_!==d[h++]&&(p=parseFloat(d[h-1])||0,l._pt={_next:l._pt,p:m||h===1?m:",",s:p,c:_.charAt(1)==="="?Qr(p,_)-p:parseFloat(_)-p,m:u&&u<4?Math.round:0},c=cu.lastIndex);return l.c=c<i.length?i.substring(c,i.length):"",l.fp=a,(Ru.test(i)||g)&&(l.e=0),this._pt=l,l},Bu=function(t,e,n,i,s,o,a,l,c,h){Ie(i)&&(i=i(s||0,t,o));var f=t[e],d=n!=="get"?n:Ie(f)?c?t[e.indexOf("set")||!Ie(t["get"+e.substr(3)])?e:"get"+e.substr(3)](c):t[e]():f,u=Ie(f)?c?Ex:hp:Vu,_;if(Ge(i)&&(~i.indexOf("random(")&&(i=Ws(i)),i.charAt(1)==="="&&(_=Qr(d,i)+(en(d)||0),(_||_===0)&&(i=_))),!h||d!==i||Eu)return!isNaN(d*i)&&i!==""?(_=new yn(this._pt,t,e,+d||0,i-(d||0),typeof f=="boolean"?Ax:fp,0,u),c&&(_.fp=c),a&&_.modifier(a,this,t),this._pt=_):(!f&&!(e in t)&&hl(e,i),vx.call(this,t,e,d,i,u,l||In.stringFilter,c))},Sx=function(t,e,n,i,s){if(Ie(t)&&(t=jo(t,s,e,n,i)),!Ti(t)||t.style&&t.nodeType||ln(t)||Ud(t))return Ge(t)?jo(t,s,e,n,i):t;var o={},a;for(a in t)o[a]=jo(t[a],s,e,n,i);return o},ku=function(t,e,n,i,s,o){var a,l,c,h;if(Cn[t]&&(a=new Cn[t]).init(s,a.rawVars?e[t]:Sx(e[t],i,s,o,n),n,i,o)!==!1&&(n._pt=l=new yn(n._pt,s,t,0,1,a.render,a,0,a.priority),n!==ks))for(c=n._ptLookup[n._targets.indexOf(s)],h=a._props.length;h--;)c[a._props[h]]=l;return a},hr,Eu,zu=function r(t,e,n){var i=t.vars,s=i.ease,o=i.startAt,a=i.immediateRender,l=i.lazy,c=i.onUpdate,h=i.runBackwards,f=i.yoyoEase,d=i.keyframes,u=i.autoRevert,_=t._dur,m=t._startAt,p=t._targets,g=t.parent,b=g&&g.data==="nested"?g.vars.targets:p,v=t._overwrite==="auto"&&!Au,S=t.timeline,D,T,w,P,M,y,I,N,C,V,$,W,Z;if(S&&(!d||!s)&&(s="none"),t._ease=Jr(s,zs.ease),t._yEase=f?op(Jr(f===!0?s:f,zs.ease)):0,f&&t._yoyo&&!t._repeat&&(f=t._yEase,t._yEase=t._ease,t._ease=f),t._from=!S&&!!i.runBackwards,!S||d&&!i.stagger){if(N=p[0]?dr(p[0]).harness:0,W=N&&i[N.prop],D=al(i,Iu),m&&(m._zTime<0&&m.progress(1),e<0&&h&&a&&!u?m.render(-1,!0):m.revert(h&&_?nl:J0),m._lazy=0),o){if(pr(t._startAt=Ne.set(p,Jn({data:"isStart",overwrite:!1,parent:g,immediateRender:!0,lazy:!m&&Pn(l),startAt:null,delay:0,onUpdate:c&&function(){return On(t,"onUpdate")},stagger:0},o))),t._startAt._dp=0,t._startAt._sat=t,e<0&&(an||!a&&!u)&&t._startAt.revert(nl),a&&_&&e<=0&&n<=0){e&&(t._zTime=e);return}}else if(h&&_&&!m){if(e&&(a=!1),w=Jn({overwrite:!1,data:"isFromStart",lazy:a&&!m&&Pn(l),immediateRender:a,stagger:0,parent:g},D),W&&(w[N.prop]=W),pr(t._startAt=Ne.set(p,w)),t._startAt._dp=0,t._startAt._sat=t,e<0&&(an?t._startAt.revert(nl):t._startAt.render(-1,!0)),t._zTime=e,!a)r(t._startAt,we,we);else if(!e)return}for(t._pt=t._ptCache=0,l=_&&Pn(l)||l&&!_,T=0;T<p.length;T++){if(M=p[T],I=M._gsap||Fu(p)[T]._gsap,t._ptLookup[T]=V={},yu[I.id]&&fr.length&&ol(),$=b===p?T:b.indexOf(M),N&&(C=new N).init(M,W||D,t,$,b)!==!1&&(t._pt=P=new yn(t._pt,M,C.name,0,1,C.render,C,0,C.priority),C._props.forEach(function(z){V[z]=P}),C.priority&&(y=1)),!N||W)for(w in D)Cn[w]&&(C=ku(w,D,t,$,M,b))?C.priority&&(y=1):V[w]=P=Bu.call(t,M,w,"get",D[w],$,b,0,i.stringFilter);t._op&&t._op[T]&&t.kill(M,t._op[T]),v&&t._pt&&(hr=t,Ce.killTweensOf(M,V,t.globalTime(e)),Z=!t.parent,hr=0),t._pt&&l&&(yu[I.id]=1)}y&&Wu(t),t._onInit&&t._onInit(t)}t._onUpdate=c,t._initted=(!t._op||t._pt)&&!Z,d&&e<=0&&S.render(qn,!0,!0)},Mx=function(t,e,n,i,s,o,a,l){var c=(t._pt&&t._ptCache||(t._ptCache={}))[e],h,f,d,u;if(!c)for(c=t._ptCache[e]=[],d=t._ptLookup,u=t._targets.length;u--;){if(h=d[u][e],h&&h.d&&h.d._pt)for(h=h.d._pt;h&&h.p!==e&&h.fp!==e;)h=h._next;if(!h)return Eu=1,t.vars[e]="+=0",zu(t,a),Eu=0,l?Qo(e+" not eligible for reset"):1;c.push(h)}for(u=c.length;u--;)f=c[u],h=f._pt||f,h.s=(i||i===0)&&!s?i:h.s+(i||0)+o*h.c,h.c=n-h.s,f.e&&(f.e=Le(n)+en(f.e)),f.b&&(f.b=h.s+en(f.b))},bx=function(t,e){var n=t[0]?dr(t[0]).harness:0,i=n&&n.aliases,s,o,a,l;if(!i)return e;s=Kr({},e);for(o in i)if(o in s)for(l=i[o].split(","),a=l.length;a--;)s[l[a]]=s[o];return s},wx=function(t,e,n,i){var s=e.ease||i||"power1.inOut",o,a;if(ln(e))a=n[t]||(n[t]=[]),e.forEach(function(l,c){return a.push({t:c/(e.length-1)*100,v:l,e:s})});else for(o in e)a=n[o]||(n[o]=[]),o==="ease"||a.push({t:parseFloat(t),v:e[o],e:s})},jo=function(t,e,n,i,s){return Ie(t)?t.call(e,n,i,s):Ge(t)&&~t.indexOf("random(")?Ws(t):t},cp=Lu+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",up={};xn(cp+",id,stagger,delay,duration,paused,scrollTrigger",function(r){return up[r]=1});var Ne=function(r){Fd(t,r);function t(n,i,s,o){var a;typeof i=="number"&&(s.duration=i,i=s,s=null),a=r.call(this,o?i:$o(i))||this;var l=a.vars,c=l.duration,h=l.delay,f=l.immediateRender,d=l.stagger,u=l.overwrite,_=l.keyframes,m=l.defaults,p=l.scrollTrigger,g=l.yoyoEase,b=i.parent||Ce,v=(ln(n)||Ud(n)?zi(n[0]):"length"in i)?[n]:Zn(n),S,D,T,w,P,M,y,I;if(a._targets=v.length?Fu(v):Qo("GSAP target "+n+" not found. https://gsap.com",!In.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=u,_||d||el(c)||el(h)){if(i=a.vars,S=a.timeline=new tn({data:"nested",defaults:m||{},targets:b&&b.data==="nested"?b.vars.targets:v}),S.kill(),S.parent=S._dp=Bi(a),S._start=0,d||el(c)||el(h)){if(w=v.length,y=d&&Kd(d),Ti(d))for(P in d)~cp.indexOf(P)&&(I||(I={}),I[P]=d[P]);for(D=0;D<w;D++)T=al(i,up),T.stagger=0,g&&(T.yoyoEase=g),I&&Kr(T,I),M=v[D],T.duration=+jo(c,Bi(a),D,M,v),T.delay=(+jo(h,Bi(a),D,M,v)||0)-a._delay,!d&&w===1&&T.delay&&(a._delay=h=T.delay,a._start+=h,T.delay=0),S.to(M,T,y?y(D,M,v):0),S._ease=fe.none;S.duration()?c=h=0:a.timeline=0}else if(_){$o(Jn(S.vars.defaults,{ease:"none"})),S._ease=Jr(_.ease||i.ease||"none");var N=0,C,V,$;if(ln(_))_.forEach(function(W){return S.to(v,W,">")}),S.duration();else{T={};for(P in _)P==="ease"||P==="easeEach"||wx(P,_[P],T,_.easeEach);for(P in T)for(C=T[P].sort(function(W,Z){return W.t-Z.t}),N=0,D=0;D<C.length;D++)V=C[D],$={ease:V.e,duration:(V.t-(D?C[D-1].t:0))/100*c},$[P]=V.v,S.to(v,$,N),N+=$.duration;S.duration()<c&&S.to({},{duration:c-S.duration()})}}c||a.duration(c=S.duration())}else a.timeline=0;return u===!0&&!Au&&(hr=Bi(a),Ce.killTweensOf(v),hr=0),Ei(b,Bi(a),s),i.reversed&&a.reverse(),i.paused&&a.paused(!0),(f||!c&&!_&&a._start===Je(b._time)&&Pn(f)&&ex(Bi(a))&&b.data!=="nested")&&(a._tTime=-we,a.render(Math.max(0,-h)||0)),p&&qd(Bi(a),p),a}var e=t.prototype;return e.render=function(i,s,o){var a=this._time,l=this._tDur,c=this._dur,h=i<0,f=i>l-we&&!h?l:i<we?0:i,d,u,_,m,p,g,b,v,S;if(!c)ix(this,i,s,o);else if(f!==this._tTime||!i||o||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==h){if(d=f,v=this.timeline,this._repeat){if(m=c+this._rDelay,this._repeat<-1&&h)return this.totalTime(m*100+i,s,o);if(d=Je(f%m),f===l?(_=this._repeat,d=c):(_=~~(f/m),_&&_===Je(f/m)&&(d=c,_--),d>c&&(d=c)),g=this._yoyo&&_&1,g&&(S=this._yEase,d=c-d),p=Vs(this._tTime,m),d===a&&!o&&this._initted&&_===p)return this._tTime=f,this;_!==p&&(v&&this._yEase&&ap(v,g),this.vars.repeatRefresh&&!g&&!this._lock&&this._time!==m&&this._initted&&(this._lock=o=1,this.render(Je(m*_),!0).invalidate()._lock=0))}if(!this._initted){if(Zd(this,h?i:d,o,s,f))return this._tTime=0,this;if(a!==this._time&&!(o&&this.vars.repeatRefresh&&_!==p))return this;if(c!==this._dur)return this.render(i,s,o)}if(this._tTime=f,this._time=d,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=b=(S||this._ease)(d/c),this._from&&(this.ratio=b=1-b),d&&!a&&!s&&!_&&(On(this,"onStart"),this._tTime!==f))return this;for(u=this._pt;u;)u.r(b,u.d),u=u._next;v&&v.render(i<0?i:v._dur*v._ease(d/this._dur),s,o)||this._startAt&&(this._zTime=i),this._onUpdate&&!s&&(h&&vu(this,i,s,o),On(this,"onUpdate")),this._repeat&&_!==p&&this.vars.onRepeat&&!s&&this.parent&&On(this,"onRepeat"),(f===this._tDur||!f)&&this._tTime===f&&(h&&!this._onUpdate&&vu(this,i,!0,!0),(i||!c)&&(f===this._tDur&&this._ts>0||!f&&this._ts<0)&&pr(this,1),!s&&!(h&&!a)&&(f||a||g)&&(On(this,f===l?"onComplete":"onReverseComplete",!0),this._prom&&!(f<l&&this.timeScale()>0)&&this._prom()))}return this},e.targets=function(){return this._targets},e.invalidate=function(i){return(!i||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(i),r.prototype.invalidate.call(this,i)},e.resetTo=function(i,s,o,a,l){ea||Rn.wake(),this._ts||this.play();var c=Math.min(this._dur,(this._dp._time-this._start)*this._ts),h;return this._initted||zu(this,c),h=this._ease(c/this._dur),Mx(this,i,s,o,a,h,c,l)?this.resetTo(i,s,o,a,1):(pl(this,0),this.parent||Xd(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},e.kill=function(i,s){if(s===void 0&&(s="all"),!i&&(!s||s==="all"))return this._lazy=this._pt=0,this.parent?Zo(this):this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(i,s,hr&&hr.vars.overwrite!==!0)._first||Zo(this),this.parent&&o!==this.timeline.totalDuration()&&Hs(this,this._dur*this.timeline._tDur/o,0,1),this}var a=this._targets,l=i?Zn(i):a,c=this._ptLookup,h=this._pt,f,d,u,_,m,p,g;if((!s||s==="all")&&Q0(a,l))return s==="all"&&(this._pt=0),Zo(this);for(f=this._op=this._op||[],s!=="all"&&(Ge(s)&&(m={},xn(s,function(b){return m[b]=1}),s=m),s=bx(a,s)),g=a.length;g--;)if(~l.indexOf(a[g])){d=c[g],s==="all"?(f[g]=s,_=d,u={}):(u=f[g]=f[g]||{},_=s);for(m in _)p=d&&d[m],p&&((!("kill"in p.d)||p.d.kill(m)===!0)&&fl(this,p,"_pt"),delete d[m]),u!=="all"&&(u[m]=1)}return this._initted&&!this._pt&&h&&Zo(this),this},t.to=function(i,s){return new t(i,s,arguments[2])},t.from=function(i,s){return Ko(1,arguments)},t.delayedCall=function(i,s,o,a){return new t(s,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:i,onComplete:s,onReverseComplete:s,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:a})},t.fromTo=function(i,s,o){return Ko(2,arguments)},t.set=function(i,s){return s.duration=0,s.repeatDelay||(s.repeat=0),new t(i,s)},t.killTweensOf=function(i,s,o){return Ce.killTweensOf(i,s,o)},t}(na);Jn(Ne.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});xn("staggerTo,staggerFrom,staggerFromTo",function(r){Ne[r]=function(){var t=new tn,e=Mu.call(arguments,0);return e.splice(r==="staggerFromTo"?5:4,0,0),t[r].apply(t,e)}});var Vu=function(t,e,n){return t[e]=n},hp=function(t,e,n){return t[e](n)},Ex=function(t,e,n,i){return t[e](i.fp,n)},Tx=function(t,e,n){return t.setAttribute(e,n)},ml=function(t,e){return Ie(t[e])?hp:ul(t[e])&&t.setAttribute?Tx:Vu},fp=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e6)/1e6,e)},Ax=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},Hu=function(t,e){var n=e._pt,i="";if(!t&&e.b)i=e.b;else if(t===1&&e.e)i=e.e;else{for(;n;)i=n.p+(n.m?n.m(n.s+n.c*t):Math.round((n.s+n.c*t)*1e4)/1e4)+i,n=n._next;i+=e.c}e.set(e.t,e.p,i,e)},Gu=function(t,e){for(var n=e._pt;n;)n.r(t,n.d),n=n._next},Dx=function(t,e,n,i){for(var s=this._pt,o;s;)o=s._next,s.p===i&&s.modifier(t,e,n),s=o},Cx=function(t){for(var e=this._pt,n,i;e;)i=e._next,e.p===t&&!e.op||e.op===t?fl(this,e,"_pt"):e.dep||(n=1),e=i;return!n},Rx=function(t,e,n,i){i.mSet(t,e,i.m.call(i.tween,n,i.mt),i)},Wu=function(t){for(var e=t._pt,n,i,s,o;e;){for(n=e._next,i=s;i&&i.pr>e.pr;)i=i._next;(e._prev=i?i._prev:o)?e._prev._next=e:s=e,(e._next=i)?i._prev=e:o=e,e=n}t._pt=s},yn=function(){function r(e,n,i,s,o,a,l,c,h){this.t=n,this.s=s,this.c=o,this.p=i,this.r=a||fp,this.d=l||this,this.set=c||Vu,this.pr=h||0,this._next=e,e&&(e._prev=this)}var t=r.prototype;return t.modifier=function(n,i,s){this.mSet=this.mSet||this.set,this.set=Rx,this.m=n,this.mt=s,this.tween=i},r}();xn(Lu+"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(r){return Iu[r]=1});Bn.TweenMax=Bn.TweenLite=Ne;Bn.TimelineLite=Bn.TimelineMax=tn;Ce=new tn({sortChildren:!1,defaults:zs,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});In.stringFilter=Uu;var $r=[],rl={},Px=[],Ld=0,Ix=0,pu=function(t){return(rl[t]||Px).map(function(e){return e()})},Tu=function(){var t=Date.now(),e=[];t-Ld>2&&(pu("matchMediaInit"),$r.forEach(function(n){var i=n.queries,s=n.conditions,o,a,l,c;for(a in i)o=wi.matchMedia(i[a]).matches,o&&(l=1),o!==s[a]&&(s[a]=o,c=1);c&&(n.revert(),l&&e.push(n))}),pu("matchMediaRevert"),e.forEach(function(n){return n.onMatch(n,function(i){return n.add(null,i)})}),Ld=t,pu("matchMedia"))},dp=function(){function r(e,n){this.selector=n&&bu(n),this.data=[],this._r=[],this.isReverted=!1,this.id=Ix++,e&&this.add(e)}var t=r.prototype;return t.add=function(n,i,s){Ie(n)&&(s=i,i=n,n=Ie);var o=this,a=function(){var c=Ae,h=o.selector,f;return c&&c!==o&&c.data.push(o),s&&(o.selector=bu(s)),Ae=o,f=i.apply(o,arguments),Ie(f)&&o._r.push(f),Ae=c,o.selector=h,o.isReverted=!1,f};return o.last=a,n===Ie?a(o,function(l){return o.add(null,l)}):n?o[n]=a:a},t.ignore=function(n){var i=Ae;Ae=null,n(this),Ae=i},t.getTweens=function(){var n=[];return this.data.forEach(function(i){return i instanceof r?n.push.apply(n,i.getTweens()):i instanceof Ne&&!(i.parent&&i.parent.data==="nested")&&n.push(i)}),n},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(n,i){var s=this;if(n?function(){for(var a=s.getTweens(),l=s.data.length,c;l--;)c=s.data[l],c.data==="isFlip"&&(c.revert(),c.getChildren(!0,!0,!1).forEach(function(h){return a.splice(a.indexOf(h),1)}));for(a.map(function(h){return{g:h._dur||h._delay||h._sat&&!h._sat.vars.immediateRender?h.globalTime(0):-1/0,t:h}}).sort(function(h,f){return f.g-h.g||-1/0}).forEach(function(h){return h.t.revert(n)}),l=s.data.length;l--;)c=s.data[l],c instanceof tn?c.data!=="nested"&&(c.scrollTrigger&&c.scrollTrigger.revert(),c.kill()):!(c instanceof Ne)&&c.revert&&c.revert(n);s._r.forEach(function(h){return h(n,s)}),s.isReverted=!0}():this.data.forEach(function(a){return a.kill&&a.kill()}),this.clear(),i)for(var o=$r.length;o--;)$r[o].id===this.id&&$r.splice(o,1)},t.revert=function(n){this.kill(n||{})},r}(),Lx=function(){function r(e){this.contexts=[],this.scope=e,Ae&&Ae.data.push(this)}var t=r.prototype;return t.add=function(n,i,s){Ti(n)||(n={matches:n});var o=new dp(0,s||this.scope),a=o.conditions={},l,c,h;Ae&&!o.selector&&(o.selector=Ae.selector),this.contexts.push(o),i=o.add("onMatch",i),o.queries=n;for(c in n)c==="all"?h=1:(l=wi.matchMedia(n[c]),l&&($r.indexOf(o)<0&&$r.push(o),(a[c]=l.matches)&&(h=1),l.addListener?l.addListener(Tu):l.addEventListener("change",Tu)));return h&&i(o,function(f){return o.add(null,f)}),this},t.revert=function(n){this.kill(n||{})},t.kill=function(n){this.contexts.forEach(function(i){return i.kill(n,!0)})},r}(),cl={registerPlugin:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e.forEach(function(i){return ip(i)})},timeline:function(t){return new tn(t)},getTweensOf:function(t,e){return Ce.getTweensOf(t,e)},getProperty:function(t,e,n,i){Ge(t)&&(t=Zn(t)[0]);var s=dr(t||{}).get,o=n?Wd:Gd;return n==="native"&&(n=""),t&&(e?o((Cn[e]&&Cn[e].get||s)(t,e,n,i)):function(a,l,c){return o((Cn[a]&&Cn[a].get||s)(t,a,l,c))})},quickSetter:function(t,e,n){if(t=Zn(t),t.length>1){var i=t.map(function(h){return cn.quickSetter(h,e,n)}),s=i.length;return function(h){for(var f=s;f--;)i[f](h)}}t=t[0]||{};var o=Cn[e],a=dr(t),l=a.harness&&(a.harness.aliases||{})[e]||e,c=o?function(h){var f=new o;ks._pt=0,f.init(t,n?h+n:h,ks,0,[t]),f.render(1,f),ks._pt&&Gu(1,ks)}:a.set(t,l);return o?c:function(h){return c(t,l,n?h+n:h,a,1)}},quickTo:function(t,e,n){var i,s=cn.to(t,Kr((i={},i[e]="+=0.1",i.paused=!0,i),n||{})),o=function(l,c,h){return s.resetTo(e,l,c,h)};return o.tween=s,o},isTweening:function(t){return Ce.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=Jr(t.ease,zs.ease)),Dd(zs,t||{})},config:function(t){return Dd(In,t||{})},registerEffect:function(t){var e=t.name,n=t.effect,i=t.plugins,s=t.defaults,o=t.extendTimeline;(i||"").split(",").forEach(function(a){return a&&!Cn[a]&&!Bn[a]&&Qo(e+" effect requires "+a+" plugin.")}),uu[e]=function(a,l,c){return n(Zn(a),Jn(l||{},s),c)},o&&(tn.prototype[e]=function(a,l,c){return this.add(uu[e](a,Ti(l)?l:(c=l)&&{},this),c)})},registerEase:function(t,e){fe[t]=Jr(e)},parseEase:function(t,e){return arguments.length?Jr(t,e):fe},getById:function(t){return Ce.getById(t)},exportRoot:function(t,e){t===void 0&&(t={});var n=new tn(t),i,s;for(n.smoothChildTiming=Pn(t.smoothChildTiming),Ce.remove(n),n._dp=0,n._time=n._tTime=Ce._time,i=Ce._first;i;)s=i._next,(e||!(!i._dur&&i instanceof Ne&&i.vars.onComplete===i._targets[0]))&&Ei(n,i,i._start-i._delay),i=s;return Ei(Ce,n,0),n},context:function(t,e){return t?new dp(t,e):Ae},matchMedia:function(t){return new Lx(t)},matchMediaRefresh:function(){return $r.forEach(function(t){var e=t.conditions,n,i;for(i in e)e[i]&&(e[i]=!1,n=1);n&&t.revert()})||Tu()},addEventListener:function(t,e){var n=rl[t]||(rl[t]=[]);~n.indexOf(e)||n.push(e)},removeEventListener:function(t,e){var n=rl[t],i=n&&n.indexOf(e);i>=0&&n.splice(i,1)},utils:{wrap:hx,wrapYoyo:fx,distribute:Kd,random:Qd,snap:jd,normalize:ux,getUnit:en,clamp:ox,splitColor:rp,toArray:Zn,selector:bu,mapRange:ep,pipe:lx,unitize:cx,interpolate:dx,shuffle:$d},install:kd,effects:uu,ticker:Rn,updateRoot:tn.updateRoot,plugins:Cn,globalTimeline:Ce,core:{PropTween:yn,globals:zd,Tween:Ne,Timeline:tn,Animation:na,getCache:dr,_removeLinkedListItem:fl,reverting:function(){return an},context:function(t){return t&&Ae&&(Ae.data.push(t),t._ctx=Ae),Ae},suppressOverwrites:function(t){return Au=t}}};xn("to,from,fromTo,delayedCall,set,killTweensOf",function(r){return cl[r]=Ne[r]});Rn.add(tn.updateRoot);ks=cl.to({},{duration:0});var Fx=function(t,e){for(var n=t._pt;n&&n.p!==e&&n.op!==e&&n.fp!==e;)n=n._next;return n},Nx=function(t,e){var n=t._targets,i,s,o;for(i in e)for(s=n.length;s--;)o=t._ptLookup[s][i],o&&(o=o.d)&&(o._pt&&(o=Fx(o,i)),o&&o.modifier&&o.modifier(e[i],t,n[s],i))},mu=function(t,e){return{name:t,rawVars:1,init:function(i,s,o){o._onInit=function(a){var l,c;if(Ge(s)&&(l={},xn(s,function(h){return l[h]=1}),s=l),e){l={};for(c in s)l[c]=e(s[c]);s=l}Nx(a,s)}}}},cn=cl.registerPlugin({name:"attr",init:function(t,e,n,i,s){var o,a,l;this.tween=n;for(o in e)l=t.getAttribute(o)||"",a=this.add(t,"setAttribute",(l||0)+"",e[o],i,s,0,0,o),a.op=o,a.b=l,this._props.push(o)},render:function(t,e){for(var n=e._pt;n;)an?n.set(n.t,n.p,n.b,n):n.r(t,n.d),n=n._next}},{name:"endArray",init:function(t,e){for(var n=e.length;n--;)this.add(t,n,t[n]||0,e[n],0,0,0,0,0,1)}},mu("roundProps",wu),mu("modifiers"),mu("snap",jd))||cl;Ne.version=tn.version=cn.version="3.12.5";Bd=1;Du()&&Gs();var Ux=fe.Power0,Ox=fe.Power1,Bx=fe.Power2,kx=fe.Power3,zx=fe.Power4,Vx=fe.Linear,Hx=fe.Quad,Gx=fe.Cubic,Wx=fe.Quart,Xx=fe.Quint,Yx=fe.Strong,qx=fe.Elastic,Zx=fe.Back,Jx=fe.SteppedEase,$x=fe.Bounce,Kx=fe.Sine,jx=fe.Expo,Qx=fe.Circ;var pp,gr,Ys,Ku,rs,ty,mp,ju,ey=function(){return typeof window<"u"},Hi={},is=180/Math.PI,qs=Math.PI/180,Xs=Math.atan2,gp=1e8,Qu=/([A-Z])/g,ny=/(left|right|width|margin|padding|x)/i,iy=/[\s,\(]\S/,Ai={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},qu=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},ry=function(t,e){return e.set(e.t,e.p,t===1?e.e:Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},sy=function(t,e){return e.set(e.t,e.p,t?Math.round((e.s+e.c*t)*1e4)/1e4+e.u:e.b,e)},oy=function(t,e){var n=e.s+e.c*t;e.set(e.t,e.p,~~(n+(n<0?-.5:.5))+e.u,e)},bp=function(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)},wp=function(t,e){return e.set(e.t,e.p,t!==1?e.b:e.e,e)},ay=function(t,e,n){return t.style[e]=n},ly=function(t,e,n){return t.style.setProperty(e,n)},cy=function(t,e,n){return t._gsap[e]=n},uy=function(t,e,n){return t._gsap.scaleX=t._gsap.scaleY=n},hy=function(t,e,n,i,s){var o=t._gsap;o.scaleX=o.scaleY=n,o.renderTransform(s,o)},fy=function(t,e,n,i,s){var o=t._gsap;o[e]=n,o.renderTransform(s,o)},Re="transform",Ln=Re+"Origin",dy=function r(t,e){var n=this,i=this.target,s=i.style,o=i._gsap;if(t in Hi&&s){if(this.tfm=this.tfm||{},t!=="transform")t=Ai[t]||t,~t.indexOf(",")?t.split(",").forEach(function(a){return n.tfm[a]=Vi(i,a)}):this.tfm[t]=o.x?o[t]:Vi(i,t),t===Ln&&(this.tfm.zOrigin=o.zOrigin);else return Ai.transform.split(",").forEach(function(a){return r.call(n,a,e)});if(this.props.indexOf(Re)>=0)return;o.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(Ln,e,"")),t=Re}(s||e)&&this.props.push(t,e,s[t])},Ep=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},py=function(){var t=this.props,e=this.target,n=e.style,i=e._gsap,s,o;for(s=0;s<t.length;s+=3)t[s+1]?e[t[s]]=t[s+2]:t[s+2]?n[t[s]]=t[s+2]:n.removeProperty(t[s].substr(0,2)==="--"?t[s]:t[s].replace(Qu,"-$1").toLowerCase());if(this.tfm){for(o in this.tfm)i[o]=this.tfm[o];i.svg&&(i.renderTransform(),e.setAttribute("data-svg-origin",this.svgo||"")),s=ju(),(!s||!s.isStart)&&!n[Re]&&(Ep(n),i.zOrigin&&n[Ln]&&(n[Ln]+=" "+i.zOrigin+"px",i.zOrigin=0,i.renderTransform()),i.uncache=1)}},Tp=function(t,e){var n={target:t,props:[],revert:py,save:dy};return t._gsap||cn.core.getCache(t),e&&e.split(",").forEach(function(i){return n.save(i)}),n},Ap,Zu=function(t,e){var n=gr.createElementNS?gr.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):gr.createElement(t);return n&&n.style?n:gr.createElement(t)},Di=function r(t,e,n){var i=getComputedStyle(t);return i[e]||i.getPropertyValue(e.replace(Qu,"-$1").toLowerCase())||i.getPropertyValue(e)||!n&&r(t,Zs(e)||e,1)||""},_p="O,Moz,ms,Ms,Webkit".split(","),Zs=function(t,e,n){var i=e||rs,s=i.style,o=5;if(t in s&&!n)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);o--&&!(_p[o]+t in s););return o<0?null:(o===3?"ms":o>=0?_p[o]:"")+t},Ju=function(){ey()&&window.document&&(pp=window,gr=pp.document,Ys=gr.documentElement,rs=Zu("div")||{style:{}},ty=Zu("div"),Re=Zs(Re),Ln=Re+"Origin",rs.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Ap=!!Zs("perspective"),ju=cn.core.reverting,Ku=1)},Xu=function r(t){var e=Zu("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=this.parentNode,i=this.nextSibling,s=this.style.cssText,o;if(Ys.appendChild(e),e.appendChild(this),this.style.display="block",t)try{o=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=r}catch{}else this._gsapBBox&&(o=this._gsapBBox());return n&&(i?n.insertBefore(this,i):n.appendChild(this)),Ys.removeChild(e),this.style.cssText=s,o},xp=function(t,e){for(var n=e.length;n--;)if(t.hasAttribute(e[n]))return t.getAttribute(e[n])},Dp=function(t){var e;try{e=t.getBBox()}catch{e=Xu.call(t,!0)}return e&&(e.width||e.height)||t.getBBox===Xu||(e=Xu.call(t,!0)),e&&!e.width&&!e.x&&!e.y?{x:+xp(t,["x","cx","x1"])||0,y:+xp(t,["y","cy","y1"])||0,width:0,height:0}:e},Cp=function(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&Dp(t))},ss=function(t,e){if(e){var n=t.style,i;e in Hi&&e!==Ln&&(e=Re),n.removeProperty?(i=e.substr(0,2),(i==="ms"||e.substr(0,6)==="webkit")&&(e="-"+e),n.removeProperty(i==="--"?e:e.replace(Qu,"-$1").toLowerCase())):n.removeAttribute(e)}},_r=function(t,e,n,i,s,o){var a=new yn(t._pt,e,n,0,1,o?wp:bp);return t._pt=a,a.b=i,a.e=s,t._props.push(n),a},yp={deg:1,rad:1,turn:1},my={grid:1,flex:1},xr=function r(t,e,n,i){var s=parseFloat(n)||0,o=(n+"").trim().substr((s+"").length)||"px",a=rs.style,l=ny.test(e),c=t.tagName.toLowerCase()==="svg",h=(c?"client":"offset")+(l?"Width":"Height"),f=100,d=i==="px",u=i==="%",_,m,p,g;if(i===o||!s||yp[i]||yp[o])return s;if(o!=="px"&&!d&&(s=r(t,e,n,"px")),g=t.getCTM&&Cp(t),(u||o==="%")&&(Hi[e]||~e.indexOf("adius")))return _=g?t.getBBox()[l?"width":"height"]:t[h],Le(u?s/_*f:s/100*_);if(a[l?"width":"height"]=f+(d?o:i),m=~e.indexOf("adius")||i==="em"&&t.appendChild&&!c?t:t.parentNode,g&&(m=(t.ownerSVGElement||{}).parentNode),(!m||m===gr||!m.appendChild)&&(m=gr.body),p=m._gsap,p&&u&&p.width&&l&&p.time===Rn.time&&!p.uncache)return Le(s/p.width*f);if(u&&(e==="height"||e==="width")){var b=t.style[e];t.style[e]=f+i,_=t[h],b?t.style[e]=b:ss(t,e)}else(u||o==="%")&&!my[Di(m,"display")]&&(a.position=Di(t,"position")),m===t&&(a.position="static"),m.appendChild(rs),_=rs[h],m.removeChild(rs),a.position="absolute";return l&&u&&(p=dr(m),p.time=Rn.time,p.width=m[h]),Le(d?_*s/f:_&&s?f/_*s:0)},Vi=function(t,e,n,i){var s;return Ku||Ju(),e in Ai&&e!=="transform"&&(e=Ai[e],~e.indexOf(",")&&(e=e.split(",")[0])),Hi[e]&&e!=="transform"?(s=oa(t,i),s=e!=="transformOrigin"?s[e]:s.svg?s.origin:_l(Di(t,Ln))+" "+s.zOrigin+"px"):(s=t.style[e],(!s||s==="auto"||i||~(s+"").indexOf("calc("))&&(s=gl[e]&&gl[e](t,e,n)||Di(t,e)||Nu(t,e)||(e==="opacity"?1:0))),n&&!~(s+"").trim().indexOf(" ")?xr(t,e,s,n)+n:s},gy=function(t,e,n,i){if(!n||n==="none"){var s=Zs(e,t,1),o=s&&Di(t,s,1);o&&o!==n?(e=s,n=o):e==="borderColor"&&(n=Di(t,"borderTopColor"))}var a=new yn(this._pt,t.style,e,0,1,Hu),l=0,c=0,h,f,d,u,_,m,p,g,b,v,S,D;if(a.b=n,a.e=i,n+="",i+="",i==="auto"&&(m=t.style[e],t.style[e]=i,i=Di(t,e)||i,m?t.style[e]=m:ss(t,e)),h=[n,i],Uu(h),n=h[0],i=h[1],d=n.match(jr)||[],D=i.match(jr)||[],D.length){for(;f=jr.exec(i);)p=f[0],b=i.substring(l,f.index),_?_=(_+1)%5:(b.substr(-5)==="rgba("||b.substr(-5)==="hsla(")&&(_=1),p!==(m=d[c++]||"")&&(u=parseFloat(m)||0,S=m.substr((u+"").length),p.charAt(1)==="="&&(p=Qr(u,p)+S),g=parseFloat(p),v=p.substr((g+"").length),l=jr.lastIndex-v.length,v||(v=v||In.units[e]||S,l===i.length&&(i+=v,a.e+=v)),S!==v&&(u=xr(t,e,m,v)||0),a._pt={_next:a._pt,p:b||c===1?b:",",s:u,c:g-u,m:_&&_<4||e==="zIndex"?Math.round:0});a.c=l<i.length?i.substring(l,i.length):""}else a.r=e==="display"&&i==="none"?wp:bp;return Ru.test(i)&&(a.e=0),this._pt=a,a},vp={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},_y=function(t){var e=t.split(" "),n=e[0],i=e[1]||"50%";return(n==="top"||n==="bottom"||i==="left"||i==="right")&&(t=n,n=i,i=t),e[0]=vp[n]||n,e[1]=vp[i]||i,e.join(" ")},xy=function(t,e){if(e.tween&&e.tween._time===e.tween._dur){var n=e.t,i=n.style,s=e.u,o=n._gsap,a,l,c;if(s==="all"||s===!0)i.cssText="",l=1;else for(s=s.split(","),c=s.length;--c>-1;)a=s[c],Hi[a]&&(l=1,a=a==="transformOrigin"?Ln:Re),ss(n,a);l&&(ss(n,Re),o&&(o.svg&&n.removeAttribute("transform"),oa(n,1),o.uncache=1,Ep(i)))}},gl={clearProps:function(t,e,n,i,s){if(s.data!=="isFromStart"){var o=t._pt=new yn(t._pt,e,n,0,0,xy);return o.u=i,o.pr=-10,o.tween=s,t._props.push(n),1}}},sa=[1,0,0,1,0,0],Rp={},Pp=function(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},Sp=function(t){var e=Di(t,Re);return Pp(e)?sa:e.substr(7).match(Cu).map(Le)},th=function(t,e){var n=t._gsap||dr(t),i=t.style,s=Sp(t),o,a,l,c;return n.svg&&t.getAttribute("transform")?(l=t.transform.baseVal.consolidate().matrix,s=[l.a,l.b,l.c,l.d,l.e,l.f],s.join(",")==="1,0,0,1,0,0"?sa:s):(s===sa&&!t.offsetParent&&t!==Ys&&!n.svg&&(l=i.display,i.display="block",o=t.parentNode,(!o||!t.offsetParent)&&(c=1,a=t.nextElementSibling,Ys.appendChild(t)),s=Sp(t),l?i.display=l:ss(t,"display"),c&&(a?o.insertBefore(t,a):o?o.appendChild(t):Ys.removeChild(t))),e&&s.length>6?[s[0],s[1],s[4],s[5],s[12],s[13]]:s)},$u=function(t,e,n,i,s,o){var a=t._gsap,l=s||th(t,!0),c=a.xOrigin||0,h=a.yOrigin||0,f=a.xOffset||0,d=a.yOffset||0,u=l[0],_=l[1],m=l[2],p=l[3],g=l[4],b=l[5],v=e.split(" "),S=parseFloat(v[0])||0,D=parseFloat(v[1])||0,T,w,P,M;n?l!==sa&&(w=u*p-_*m)&&(P=S*(p/w)+D*(-m/w)+(m*b-p*g)/w,M=S*(-_/w)+D*(u/w)-(u*b-_*g)/w,S=P,D=M):(T=Dp(t),S=T.x+(~v[0].indexOf("%")?S/100*T.width:S),D=T.y+(~(v[1]||v[0]).indexOf("%")?D/100*T.height:D)),i||i!==!1&&a.smooth?(g=S-c,b=D-h,a.xOffset=f+(g*u+b*m)-g,a.yOffset=d+(g*_+b*p)-b):a.xOffset=a.yOffset=0,a.xOrigin=S,a.yOrigin=D,a.smooth=!!i,a.origin=e,a.originIsAbsolute=!!n,t.style[Ln]="0px 0px",o&&(_r(o,a,"xOrigin",c,S),_r(o,a,"yOrigin",h,D),_r(o,a,"xOffset",f,a.xOffset),_r(o,a,"yOffset",d,a.yOffset)),t.setAttribute("data-svg-origin",S+" "+D)},oa=function(t,e){var n=t._gsap||new Ou(t);if("x"in n&&!e&&!n.uncache)return n;var i=t.style,s=n.scaleX<0,o="px",a="deg",l=getComputedStyle(t),c=Di(t,Ln)||"0",h,f,d,u,_,m,p,g,b,v,S,D,T,w,P,M,y,I,N,C,V,$,W,Z,z,U,R,at,_t,Ut,X,ot;return h=f=d=m=p=g=b=v=S=0,u=_=1,n.svg=!!(t.getCTM&&Cp(t)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(i[Re]=(l.translate!=="none"?"translate3d("+(l.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(l.rotate!=="none"?"rotate("+l.rotate+") ":"")+(l.scale!=="none"?"scale("+l.scale.split(" ").join(",")+") ":"")+(l[Re]!=="none"?l[Re]:"")),i.scale=i.rotate=i.translate="none"),w=th(t,n.svg),n.svg&&(n.uncache?(z=t.getBBox(),c=n.xOrigin-z.x+"px "+(n.yOrigin-z.y)+"px",Z=""):Z=!e&&t.getAttribute("data-svg-origin"),$u(t,Z||c,!!Z||n.originIsAbsolute,n.smooth!==!1,w)),D=n.xOrigin||0,T=n.yOrigin||0,w!==sa&&(I=w[0],N=w[1],C=w[2],V=w[3],h=$=w[4],f=W=w[5],w.length===6?(u=Math.sqrt(I*I+N*N),_=Math.sqrt(V*V+C*C),m=I||N?Xs(N,I)*is:0,b=C||V?Xs(C,V)*is+m:0,b&&(_*=Math.abs(Math.cos(b*qs))),n.svg&&(h-=D-(D*I+T*C),f-=T-(D*N+T*V))):(ot=w[6],Ut=w[7],R=w[8],at=w[9],_t=w[10],X=w[11],h=w[12],f=w[13],d=w[14],P=Xs(ot,_t),p=P*is,P&&(M=Math.cos(-P),y=Math.sin(-P),Z=$*M+R*y,z=W*M+at*y,U=ot*M+_t*y,R=$*-y+R*M,at=W*-y+at*M,_t=ot*-y+_t*M,X=Ut*-y+X*M,$=Z,W=z,ot=U),P=Xs(-C,_t),g=P*is,P&&(M=Math.cos(-P),y=Math.sin(-P),Z=I*M-R*y,z=N*M-at*y,U=C*M-_t*y,X=V*y+X*M,I=Z,N=z,C=U),P=Xs(N,I),m=P*is,P&&(M=Math.cos(P),y=Math.sin(P),Z=I*M+N*y,z=$*M+W*y,N=N*M-I*y,W=W*M-$*y,I=Z,$=z),p&&Math.abs(p)+Math.abs(m)>359.9&&(p=m=0,g=180-g),u=Le(Math.sqrt(I*I+N*N+C*C)),_=Le(Math.sqrt(W*W+ot*ot)),P=Xs($,W),b=Math.abs(P)>2e-4?P*is:0,S=X?1/(X<0?-X:X):0),n.svg&&(Z=t.getAttribute("transform"),n.forceCSS=t.setAttribute("transform","")||!Pp(Di(t,Re)),Z&&t.setAttribute("transform",Z))),Math.abs(b)>90&&Math.abs(b)<270&&(s?(u*=-1,b+=m<=0?180:-180,m+=m<=0?180:-180):(_*=-1,b+=b<=0?180:-180)),e=e||n.uncache,n.x=h-((n.xPercent=h&&(!e&&n.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-h)?-50:0)))?t.offsetWidth*n.xPercent/100:0)+o,n.y=f-((n.yPercent=f&&(!e&&n.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-f)?-50:0)))?t.offsetHeight*n.yPercent/100:0)+o,n.z=d+o,n.scaleX=Le(u),n.scaleY=Le(_),n.rotation=Le(m)+a,n.rotationX=Le(p)+a,n.rotationY=Le(g)+a,n.skewX=b+a,n.skewY=v+a,n.transformPerspective=S+o,(n.zOrigin=parseFloat(c.split(" ")[2])||!e&&n.zOrigin||0)&&(i[Ln]=_l(c)),n.xOffset=n.yOffset=0,n.force3D=In.force3D,n.renderTransform=n.svg?vy:Ap?Ip:yy,n.uncache=0,n},_l=function(t){return(t=t.split(" "))[0]+" "+t[1]},Yu=function(t,e,n){var i=en(e);return Le(parseFloat(e)+parseFloat(xr(t,"x",n+"px",i)))+i},yy=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,Ip(t,e)},es="0deg",ra="0px",ns=") ",Ip=function(t,e){var n=e||this,i=n.xPercent,s=n.yPercent,o=n.x,a=n.y,l=n.z,c=n.rotation,h=n.rotationY,f=n.rotationX,d=n.skewX,u=n.skewY,_=n.scaleX,m=n.scaleY,p=n.transformPerspective,g=n.force3D,b=n.target,v=n.zOrigin,S="",D=g==="auto"&&t&&t!==1||g===!0;if(v&&(f!==es||h!==es)){var T=parseFloat(h)*qs,w=Math.sin(T),P=Math.cos(T),M;T=parseFloat(f)*qs,M=Math.cos(T),o=Yu(b,o,w*M*-v),a=Yu(b,a,-Math.sin(T)*-v),l=Yu(b,l,P*M*-v+v)}p!==ra&&(S+="perspective("+p+ns),(i||s)&&(S+="translate("+i+"%, "+s+"%) "),(D||o!==ra||a!==ra||l!==ra)&&(S+=l!==ra||D?"translate3d("+o+", "+a+", "+l+") ":"translate("+o+", "+a+ns),c!==es&&(S+="rotate("+c+ns),h!==es&&(S+="rotateY("+h+ns),f!==es&&(S+="rotateX("+f+ns),(d!==es||u!==es)&&(S+="skew("+d+", "+u+ns),(_!==1||m!==1)&&(S+="scale("+_+", "+m+ns),b.style[Re]=S||"translate(0, 0)"},vy=function(t,e){var n=e||this,i=n.xPercent,s=n.yPercent,o=n.x,a=n.y,l=n.rotation,c=n.skewX,h=n.skewY,f=n.scaleX,d=n.scaleY,u=n.target,_=n.xOrigin,m=n.yOrigin,p=n.xOffset,g=n.yOffset,b=n.forceCSS,v=parseFloat(o),S=parseFloat(a),D,T,w,P,M;l=parseFloat(l),c=parseFloat(c),h=parseFloat(h),h&&(h=parseFloat(h),c+=h,l+=h),l||c?(l*=qs,c*=qs,D=Math.cos(l)*f,T=Math.sin(l)*f,w=Math.sin(l-c)*-d,P=Math.cos(l-c)*d,c&&(h*=qs,M=Math.tan(c-h),M=Math.sqrt(1+M*M),w*=M,P*=M,h&&(M=Math.tan(h),M=Math.sqrt(1+M*M),D*=M,T*=M)),D=Le(D),T=Le(T),w=Le(w),P=Le(P)):(D=f,P=d,T=w=0),(v&&!~(o+"").indexOf("px")||S&&!~(a+"").indexOf("px"))&&(v=xr(u,"x",o,"px"),S=xr(u,"y",a,"px")),(_||m||p||g)&&(v=Le(v+_-(_*D+m*w)+p),S=Le(S+m-(_*T+m*P)+g)),(i||s)&&(M=u.getBBox(),v=Le(v+i/100*M.width),S=Le(S+s/100*M.height)),M="matrix("+D+","+T+","+w+","+P+","+v+","+S+")",u.setAttribute("transform",M),b&&(u.style[Re]=M)},Sy=function(t,e,n,i,s){var o=360,a=Ge(s),l=parseFloat(s)*(a&&~s.indexOf("rad")?is:1),c=l-i,h=i+c+"deg",f,d;return a&&(f=s.split("_")[1],f==="short"&&(c%=o,c!==c%(o/2)&&(c+=c<0?o:-o)),f==="cw"&&c<0?c=(c+o*gp)%o-~~(c/o)*o:f==="ccw"&&c>0&&(c=(c-o*gp)%o-~~(c/o)*o)),t._pt=d=new yn(t._pt,e,n,i,c,ry),d.e=h,d.u="deg",t._props.push(n),d},Mp=function(t,e){for(var n in e)t[n]=e[n];return t},My=function(t,e,n){var i=Mp({},n._gsap),s="perspective,force3D,transformOrigin,svgOrigin",o=n.style,a,l,c,h,f,d,u,_;i.svg?(c=n.getAttribute("transform"),n.setAttribute("transform",""),o[Re]=e,a=oa(n,1),ss(n,Re),n.setAttribute("transform",c)):(c=getComputedStyle(n)[Re],o[Re]=e,a=oa(n,1),o[Re]=c);for(l in Hi)c=i[l],h=a[l],c!==h&&s.indexOf(l)<0&&(u=en(c),_=en(h),f=u!==_?xr(n,l,c,_):parseFloat(c),d=parseFloat(h),t._pt=new yn(t._pt,a,l,f,d-f,qu),t._pt.u=_||0,t._props.push(l));Mp(a,i)};xn("padding,margin,Width,Radius",function(r,t){var e="Top",n="Right",i="Bottom",s="Left",o=(t<3?[e,n,i,s]:[e+s,e+n,i+n,i+s]).map(function(a){return t<2?r+a:"border"+a+r});gl[t>1?"border"+r:r]=function(a,l,c,h,f){var d,u;if(arguments.length<4)return d=o.map(function(_){return Vi(a,_,c)}),u=d.join(" "),u.split(d[0]).length===5?d[0]:u;d=(h+"").split(" "),u={},o.forEach(function(_,m){return u[_]=d[m]=d[m]||d[(m-1)/2|0]}),a.init(l,u,f)}});var eh={name:"css",register:Ju,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,n,i,s){var o=this._props,a=t.style,l=n.vars.startAt,c,h,f,d,u,_,m,p,g,b,v,S,D,T,w,P;Ku||Ju(),this.styles=this.styles||Tp(t),P=this.styles.props,this.tween=n;for(m in e)if(m!=="autoRound"&&(h=e[m],!(Cn[m]&&ku(m,e,n,i,t,s)))){if(u=typeof h,_=gl[m],u==="function"&&(h=h.call(n,i,t,s),u=typeof h),u==="string"&&~h.indexOf("random(")&&(h=Ws(h)),_)_(this,t,m,h,n)&&(w=1);else if(m.substr(0,2)==="--")c=(getComputedStyle(t).getPropertyValue(m)+"").trim(),h+="",ki.lastIndex=0,ki.test(c)||(p=en(c),g=en(h)),g?p!==g&&(c=xr(t,m,c,g)+g):p&&(h+=p),this.add(a,"setProperty",c,h,i,s,0,0,m),o.push(m),P.push(m,0,a[m]);else if(u!=="undefined"){if(l&&m in l?(c=typeof l[m]=="function"?l[m].call(n,i,t,s):l[m],Ge(c)&&~c.indexOf("random(")&&(c=Ws(c)),en(c+"")||c==="auto"||(c+=In.units[m]||en(Vi(t,m))||""),(c+"").charAt(1)==="="&&(c=Vi(t,m))):c=Vi(t,m),d=parseFloat(c),b=u==="string"&&h.charAt(1)==="="&&h.substr(0,2),b&&(h=h.substr(2)),f=parseFloat(h),m in Ai&&(m==="autoAlpha"&&(d===1&&Vi(t,"visibility")==="hidden"&&f&&(d=0),P.push("visibility",0,a.visibility),_r(this,a,"visibility",d?"inherit":"hidden",f?"inherit":"hidden",!f)),m!=="scale"&&m!=="transform"&&(m=Ai[m],~m.indexOf(",")&&(m=m.split(",")[0]))),v=m in Hi,v){if(this.styles.save(m),S||(D=t._gsap,D.renderTransform&&!e.parseTransform||oa(t,e.parseTransform),T=e.smoothOrigin!==!1&&D.smooth,S=this._pt=new yn(this._pt,a,Re,0,1,D.renderTransform,D,0,-1),S.dep=1),m==="scale")this._pt=new yn(this._pt,D,"scaleY",D.scaleY,(b?Qr(D.scaleY,b+f):f)-D.scaleY||0,qu),this._pt.u=0,o.push("scaleY",m),m+="X";else if(m==="transformOrigin"){P.push(Ln,0,a[Ln]),h=_y(h),D.svg?$u(t,h,0,T,0,this):(g=parseFloat(h.split(" ")[2])||0,g!==D.zOrigin&&_r(this,D,"zOrigin",D.zOrigin,g),_r(this,a,m,_l(c),_l(h)));continue}else if(m==="svgOrigin"){$u(t,h,1,T,0,this);continue}else if(m in Rp){Sy(this,D,m,d,b?Qr(d,b+h):h);continue}else if(m==="smoothOrigin"){_r(this,D,"smooth",D.smooth,h);continue}else if(m==="force3D"){D[m]=h;continue}else if(m==="transform"){My(this,h,t);continue}}else m in a||(m=Zs(m)||m);if(v||(f||f===0)&&(d||d===0)&&!iy.test(h)&&m in a)p=(c+"").substr((d+"").length),f||(f=0),g=en(h)||(m in In.units?In.units[m]:p),p!==g&&(d=xr(t,m,c,g)),this._pt=new yn(this._pt,v?D:a,m,d,(b?Qr(d,b+f):f)-d,!v&&(g==="px"||m==="zIndex")&&e.autoRound!==!1?oy:qu),this._pt.u=g||0,p!==g&&g!=="%"&&(this._pt.b=c,this._pt.r=sy);else if(m in a)gy.call(this,t,m,c,b?b+h:h);else if(m in t)this.add(t,m,c||t[m],b?b+h:h,i,s);else if(m!=="parseTransform"){hl(m,h);continue}v||(m in a?P.push(m,0,a[m]):P.push(m,1,c||t[m])),o.push(m)}}w&&Wu(this)},render:function(t,e){if(e.tween._time||!ju())for(var n=e._pt;n;)n.r(t,n.d),n=n._next;else e.styles.revert()},get:Vi,aliases:Ai,getSetter:function(t,e,n){var i=Ai[e];return i&&i.indexOf(",")<0&&(e=i),e in Hi&&e!==Ln&&(t._gsap.x||Vi(t,"x"))?n&&mp===n?e==="scale"?uy:cy:(mp=n||{})&&(e==="scale"?hy:fy):t.style&&!ul(t.style[e])?ay:~e.indexOf("-")?ly:ml(t,e)},core:{_removeProperty:ss,_getMatrix:th}};cn.utils.checkPrefix=Zs;cn.core.getStyleSaver=Tp;(function(r,t,e,n){var i=xn(r+","+t+","+e,function(s){Hi[s]=1});xn(t,function(s){In.units[s]="deg",Rp[s]=1}),Ai[i[13]]=r+","+t,xn(n,function(s){var o=s.split(":");Ai[o[1]]=i[o[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");xn("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){In.units[r]="px"});cn.registerPlugin(eh);var Kt=cn.registerPlugin(eh)||cn,dT=Kt.core.Tween;function Lp(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function by(r,t,e){return t&&Lp(r.prototype,t),e&&Lp(r,e),r}var nn,vl,wy,kn,yr,vr,$s,Np,os,la,Up,Gi,li,Op,Bp=function(){return nn||typeof window<"u"&&(nn=window.gsap)&&nn.registerPlugin&&nn},kp=1,Js=[],le=[],ci=[],ca=Date.now,nh=function(t,e){return e},Ey=function(){var t=la.core,e=t.bridge||{},n=t._scrollers,i=t._proxies;n.push.apply(n,le),i.push.apply(i,ci),le=n,ci=i,nh=function(o,a){return e[o](a)}},Xi=function(t,e){return~ci.indexOf(t)&&ci[ci.indexOf(t)+1][e]},ua=function(t){return!!~Up.indexOf(t)},Sn=function(t,e,n,i,s){return t.addEventListener(e,n,{passive:i!==!1,capture:!!s})},vn=function(t,e,n,i){return t.removeEventListener(e,n,!!i)},xl="scrollLeft",yl="scrollTop",ih=function(){return Gi&&Gi.isPressed||le.cache++},Sl=function(t,e){var n=function i(s){if(s||s===0){kp&&(kn.history.scrollRestoration="manual");var o=Gi&&Gi.isPressed;s=i.v=Math.round(s)||(Gi&&Gi.iOS?1:0),t(s),i.cacheID=le.cache,o&&nh("ss",s)}else(e||le.cache!==i.cacheID||nh("ref"))&&(i.cacheID=le.cache,i.v=t());return i.v+i.offset};return n.offset=0,t&&n},un={s:xl,p:"left",p2:"Left",os:"right",os2:"Right",d:"width",d2:"Width",a:"x",sc:Sl(function(r){return arguments.length?kn.scrollTo(r,ke.sc()):kn.pageXOffset||yr[xl]||vr[xl]||$s[xl]||0})},ke={s:yl,p:"top",p2:"Top",os:"bottom",os2:"Bottom",d:"height",d2:"Height",a:"y",op:un,sc:Sl(function(r){return arguments.length?kn.scrollTo(un.sc(),r):kn.pageYOffset||yr[yl]||vr[yl]||$s[yl]||0})},Mn=function(t,e){return(e&&e._ctx&&e._ctx.selector||nn.utils.toArray)(t)[0]||(typeof t=="string"&&nn.config().nullTargetWarn!==!1?console.warn("Element not found:",t):null)},Wi=function(t,e){var n=e.s,i=e.sc;ua(t)&&(t=yr.scrollingElement||vr);var s=le.indexOf(t),o=i===ke.sc?1:2;!~s&&(s=le.push(t)-1),le[s+o]||Sn(t,"scroll",ih);var a=le[s+o],l=a||(le[s+o]=Sl(Xi(t,n),!0)||(ua(t)?i:Sl(function(c){return arguments.length?t[n]=c:t[n]})));return l.target=t,a||(l.smooth=nn.getProperty(t,"scrollBehavior")==="smooth"),l},Ml=function(t,e,n){var i=t,s=t,o=ca(),a=o,l=e||50,c=Math.max(500,l*3),h=function(_,m){var p=ca();m||p-o>l?(s=i,i=_,a=o,o=p):n?i+=_:i=s+(_-s)/(p-a)*(o-a)},f=function(){s=i=n?0:i,a=o=0},d=function(_){var m=a,p=s,g=ca();return(_||_===0)&&_!==i&&h(_),o===a||g-a>c?0:(i+(n?p:-p))/((n?g:o)-m)*1e3};return{update:h,reset:f,getVelocity:d}},aa=function(t,e){return e&&!t._gsapAllow&&t.preventDefault(),t.changedTouches?t.changedTouches[0]:t},Fp=function(t){var e=Math.max.apply(Math,t),n=Math.min.apply(Math,t);return Math.abs(e)>=Math.abs(n)?e:n},zp=function(){la=nn.core.globals().ScrollTrigger,la&&la.core&&Ey()},Vp=function(t){return nn=t||Bp(),!vl&&nn&&typeof document<"u"&&document.body&&(kn=window,yr=document,vr=yr.documentElement,$s=yr.body,Up=[kn,yr,vr,$s],wy=nn.utils.clamp,Op=nn.core.context||function(){},os="onpointerenter"in $s?"pointer":"mouse",Np=Fe.isTouch=kn.matchMedia&&kn.matchMedia("(hover: none), (pointer: coarse)").matches?1:"ontouchstart"in kn||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0?2:0,li=Fe.eventTypes=("ontouchstart"in vr?"touchstart,touchmove,touchcancel,touchend":"onpointerdown"in vr?"pointerdown,pointermove,pointercancel,pointerup":"mousedown,mousemove,mouseup,mouseup").split(","),setTimeout(function(){return kp=0},500),zp(),vl=1),vl};un.op=ke;le.cache=0;var Fe=function(){function r(e){this.init(e)}var t=r.prototype;return t.init=function(n){vl||Vp(nn)||console.warn("Please gsap.registerPlugin(Observer)"),la||zp();var i=n.tolerance,s=n.dragMinimum,o=n.type,a=n.target,l=n.lineHeight,c=n.debounce,h=n.preventDefault,f=n.onStop,d=n.onStopDelay,u=n.ignore,_=n.wheelSpeed,m=n.event,p=n.onDragStart,g=n.onDragEnd,b=n.onDrag,v=n.onPress,S=n.onRelease,D=n.onRight,T=n.onLeft,w=n.onUp,P=n.onDown,M=n.onChangeX,y=n.onChangeY,I=n.onChange,N=n.onToggleX,C=n.onToggleY,V=n.onHover,$=n.onHoverEnd,W=n.onMove,Z=n.ignoreCheck,z=n.isNormalizer,U=n.onGestureStart,R=n.onGestureEnd,at=n.onWheel,_t=n.onEnable,Ut=n.onDisable,X=n.onClick,ot=n.scrollSpeed,xt=n.capture,ct=n.allowClicks,Rt=n.lockAxis,kt=n.onLockAxis;this.target=a=Mn(a)||vr,this.vars=n,u&&(u=nn.utils.toArray(u)),i=i||1e-9,s=s||0,_=_||1,ot=ot||1,o=o||"wheel,touch,pointer",c=c!==!1,l||(l=parseFloat(kn.getComputedStyle($s).lineHeight)||22);var q,$t,It,Ft,bt,Et,Ht,G=this,jt=0,A=0,x=n.passive||!h,F=Wi(a,un),Y=Wi(a,ke),tt=F(),it=Y(),vt=~o.indexOf("touch")&&!~o.indexOf("pointer")&&li[0]==="pointerdown",pt=ua(a),lt=a.ownerDocument||yr,Lt=[0,0,0],ht=[0,0,0],yt=0,qt=function(){return yt=ca()},ut=function(j,dt){return(G.event=j)&&u&&~u.indexOf(j.target)||dt&&vt&&j.pointerType!=="touch"||Z&&Z(j,dt)},Tt=function(){G._vx.reset(),G._vy.reset(),$t.pause(),f&&f(G)},Wt=function(){var j=G.deltaX=Fp(Lt),dt=G.deltaY=Fp(ht),et=Math.abs(j)>=i,wt=Math.abs(dt)>=i;I&&(et||wt)&&I(G,j,dt,Lt,ht),et&&(D&&G.deltaX>0&&D(G),T&&G.deltaX<0&&T(G),M&&M(G),N&&G.deltaX<0!=jt<0&&N(G),jt=G.deltaX,Lt[0]=Lt[1]=Lt[2]=0),wt&&(P&&G.deltaY>0&&P(G),w&&G.deltaY<0&&w(G),y&&y(G),C&&G.deltaY<0!=A<0&&C(G),A=G.deltaY,ht[0]=ht[1]=ht[2]=0),(Ft||It)&&(W&&W(G),It&&(b(G),It=!1),Ft=!1),Et&&!(Et=!1)&&kt&&kt(G),bt&&(at(G),bt=!1),q=0},Zt=function(j,dt,et){Lt[et]+=j,ht[et]+=dt,G._vx.update(j),G._vy.update(dt),c?q||(q=requestAnimationFrame(Wt)):Wt()},ue=function(j,dt){Rt&&!Ht&&(G.axis=Ht=Math.abs(j)>Math.abs(dt)?"x":"y",Et=!0),Ht!=="y"&&(Lt[2]+=j,G._vx.update(j,!0)),Ht!=="x"&&(ht[2]+=dt,G._vy.update(dt,!0)),c?q||(q=requestAnimationFrame(Wt)):Wt()},Jt=function(j){if(!ut(j,1)){j=aa(j,h);var dt=j.clientX,et=j.clientY,wt=dt-G.x,ft=et-G.y,Dt=G.isDragging;G.x=dt,G.y=et,(Dt||Math.abs(G.startX-dt)>=s||Math.abs(G.startY-et)>=s)&&(b&&(It=!0),Dt||(G.isDragging=!0),ue(wt,ft),Dt||p&&p(G))}},k=G.onPress=function(O){ut(O,1)||O&&O.button||(G.axis=Ht=null,$t.pause(),G.isPressed=!0,O=aa(O),jt=A=0,G.startX=G.x=O.clientX,G.startY=G.y=O.clientY,G._vx.reset(),G._vy.reset(),Sn(z?a:lt,li[1],Jt,x,!0),G.deltaX=G.deltaY=0,v&&v(G))},Q=G.onRelease=function(O){if(!ut(O,1)){vn(z?a:lt,li[1],Jt,!0);var j=!isNaN(G.y-G.startY),dt=G.isDragging,et=dt&&(Math.abs(G.x-G.startX)>3||Math.abs(G.y-G.startY)>3),wt=aa(O);!et&&j&&(G._vx.reset(),G._vy.reset(),h&&ct&&nn.delayedCall(.08,function(){if(ca()-yt>300&&!O.defaultPrevented){if(O.target.click)O.target.click();else if(lt.createEvent){var ft=lt.createEvent("MouseEvents");ft.initMouseEvent("click",!0,!0,kn,1,wt.screenX,wt.screenY,wt.clientX,wt.clientY,!1,!1,!1,!1,0,null),O.target.dispatchEvent(ft)}}})),G.isDragging=G.isGesturing=G.isPressed=!1,f&&dt&&!z&&$t.restart(!0),g&&dt&&g(G),S&&S(G,et)}},st=function(j){return j.touches&&j.touches.length>1&&(G.isGesturing=!0)&&U(j,G.isDragging)},mt=function(){return(G.isGesturing=!1)||R(G)},gt=function(j){if(!ut(j)){var dt=F(),et=Y();Zt((dt-tt)*ot,(et-it)*ot,1),tt=dt,it=et,f&&$t.restart(!0)}},Bt=function(j){if(!ut(j)){j=aa(j,h),at&&(bt=!0);var dt=(j.deltaMode===1?l:j.deltaMode===2?kn.innerHeight:1)*_;Zt(j.deltaX*dt,j.deltaY*dt,0),f&&!z&&$t.restart(!0)}},ne=function(j){if(!ut(j)){var dt=j.clientX,et=j.clientY,wt=dt-G.x,ft=et-G.y;G.x=dt,G.y=et,Ft=!0,f&&$t.restart(!0),(wt||ft)&&ue(wt,ft)}},Mt=function(j){G.event=j,V(G)},L=function(j){G.event=j,$(G)},rt=function(j){return ut(j)||aa(j,h)&&X(G)};$t=G._dc=nn.delayedCall(d||.25,Tt).pause(),G.deltaX=G.deltaY=0,G._vx=Ml(0,50,!0),G._vy=Ml(0,50,!0),G.scrollX=F,G.scrollY=Y,G.isDragging=G.isGesturing=G.isPressed=!1,Op(this),G.enable=function(O){return G.isEnabled||(Sn(pt?lt:a,"scroll",ih),o.indexOf("scroll")>=0&&Sn(pt?lt:a,"scroll",gt,x,xt),o.indexOf("wheel")>=0&&Sn(a,"wheel",Bt,x,xt),(o.indexOf("touch")>=0&&Np||o.indexOf("pointer")>=0)&&(Sn(a,li[0],k,x,xt),Sn(lt,li[2],Q),Sn(lt,li[3],Q),ct&&Sn(a,"click",qt,!0,!0),X&&Sn(a,"click",rt),U&&Sn(lt,"gesturestart",st),R&&Sn(lt,"gestureend",mt),V&&Sn(a,os+"enter",Mt),$&&Sn(a,os+"leave",L),W&&Sn(a,os+"move",ne)),G.isEnabled=!0,O&&O.type&&k(O),_t&&_t(G)),G},G.disable=function(){G.isEnabled&&(Js.filter(function(O){return O!==G&&ua(O.target)}).length||vn(pt?lt:a,"scroll",ih),G.isPressed&&(G._vx.reset(),G._vy.reset(),vn(z?a:lt,li[1],Jt,!0)),vn(pt?lt:a,"scroll",gt,xt),vn(a,"wheel",Bt,xt),vn(a,li[0],k,xt),vn(lt,li[2],Q),vn(lt,li[3],Q),vn(a,"click",qt,!0),vn(a,"click",rt),vn(lt,"gesturestart",st),vn(lt,"gestureend",mt),vn(a,os+"enter",Mt),vn(a,os+"leave",L),vn(a,os+"move",ne),G.isEnabled=G.isPressed=G.isDragging=!1,Ut&&Ut(G))},G.kill=G.revert=function(){G.disable();var O=Js.indexOf(G);O>=0&&Js.splice(O,1),Gi===G&&(Gi=0)},Js.push(G),z&&ua(a)&&(Gi=G),G.enable(m)},by(r,[{key:"velocityX",get:function(){return this._vx.getVelocity()}},{key:"velocityY",get:function(){return this._vy.getVelocity()}}]),r}();Fe.version="3.12.5";Fe.create=function(r){return new Fe(r)};Fe.register=Vp;Fe.getAll=function(){return Js.slice()};Fe.getById=function(r){return Js.filter(function(t){return t.vars.id===r})[0]};Bp()&&nn.registerPlugin(Fe);var Ot,Qs,de,Pe,ui,Ee,sm,Bl,ba,_a,fa,bl,hn,Hl,hh,wn,Hp,Gp,to,om,rh,am,bn,fh,lm,cm,Sr,dh,xh,eo,yh,kl,ph,sh,wl=1,fn=Date.now,oh=fn(),jn=0,da=0,Wp=function(t,e,n){var i=Vn(t)&&(t.substr(0,6)==="clamp("||t.indexOf("max")>-1);return n["_"+e+"Clamp"]=i,i?t.substr(6,t.length-7):t},Xp=function(t,e){return e&&(!Vn(t)||t.substr(0,6)!=="clamp(")?"clamp("+t+")":t},Ty=function r(){return da&&requestAnimationFrame(r)},Yp=function(){return Hl=1},qp=function(){return Hl=0},Ci=function(t){return t},pa=function(t){return Math.round(t*1e5)/1e5||0},um=function(){return typeof window<"u"},hm=function(){return Ot||um()&&(Ot=window.gsap)&&Ot.registerPlugin&&Ot},fs=function(t){return!!~sm.indexOf(t)},fm=function(t){return(t==="Height"?yh:de["inner"+t])||ui["client"+t]||Ee["client"+t]},dm=function(t){return Xi(t,"getBoundingClientRect")||(fs(t)?function(){return Ol.width=de.innerWidth,Ol.height=yh,Ol}:function(){return Yi(t)})},Ay=function(t,e,n){var i=n.d,s=n.d2,o=n.a;return(o=Xi(t,"getBoundingClientRect"))?function(){return o()[i]}:function(){return(e?fm(s):t["client"+s])||0}},Dy=function(t,e){return!e||~ci.indexOf(t)?dm(t):function(){return Ol}},Ri=function(t,e){var n=e.s,i=e.d2,s=e.d,o=e.a;return Math.max(0,(n="scroll"+i)&&(o=Xi(t,n))?o()-dm(t)()[s]:fs(t)?(ui[n]||Ee[n])-fm(i):t[n]-t["offset"+i])},El=function(t,e){for(var n=0;n<to.length;n+=3)(!e||~e.indexOf(to[n+1]))&&t(to[n],to[n+1],to[n+2])},Vn=function(t){return typeof t=="string"},Tn=function(t){return typeof t=="function"},ma=function(t){return typeof t=="number"},as=function(t){return typeof t=="object"},ha=function(t,e,n){return t&&t.progress(e?0:1)&&n&&t.pause()},ah=function(t,e){if(t.enabled){var n=t._ctx?t._ctx.add(function(){return e(t)}):e(t);n&&n.totalTime&&(t.callbackAnimation=n)}},Ks=Math.abs,pm="left",mm="top",vh="right",Sh="bottom",cs="width",us="height",xa="Right",ya="Left",va="Top",Sa="Bottom",ze="padding",$n="margin",io="Width",Mh="Height",We="px",Kn=function(t){return de.getComputedStyle(t)},Cy=function(t){var e=Kn(t).position;t.style.position=e==="absolute"||e==="fixed"?e:"relative"},Zp=function(t,e){for(var n in e)n in t||(t[n]=e[n]);return t},Yi=function(t,e){var n=e&&Kn(t)[hh]!=="matrix(1, 0, 0, 1, 0, 0)"&&Ot.to(t,{x:0,y:0,xPercent:0,yPercent:0,rotation:0,rotationX:0,rotationY:0,scale:1,skewX:0,skewY:0}).progress(1),i=t.getBoundingClientRect();return n&&n.progress(0).kill(),i},zl=function(t,e){var n=e.d2;return t["offset"+n]||t["client"+n]||0},gm=function(t){var e=[],n=t.labels,i=t.duration(),s;for(s in n)e.push(n[s]/i);return e},Ry=function(t){return function(e){return Ot.utils.snap(gm(t),e)}},bh=function(t){var e=Ot.utils.snap(t),n=Array.isArray(t)&&t.slice(0).sort(function(i,s){return i-s});return n?function(i,s,o){o===void 0&&(o=.001);var a;if(!s)return e(i);if(s>0){for(i-=o,a=0;a<n.length;a++)if(n[a]>=i)return n[a];return n[a-1]}else for(a=n.length,i+=o;a--;)if(n[a]<=i)return n[a];return n[0]}:function(i,s,o){o===void 0&&(o=.001);var a=e(i);return!s||Math.abs(a-i)<o||a-i<0==s<0?a:e(s<0?i-t:i+t)}},Py=function(t){return function(e,n){return bh(gm(t))(e,n.direction)}},Tl=function(t,e,n,i){return n.split(",").forEach(function(s){return t(e,s,i)})},Ke=function(t,e,n,i,s){return t.addEventListener(e,n,{passive:!i,capture:!!s})},$e=function(t,e,n,i){return t.removeEventListener(e,n,!!i)},Al=function(t,e,n){n=n&&n.wheelHandler,n&&(t(e,"wheel",n),t(e,"touchmove",n))},Jp={startColor:"green",endColor:"red",indent:0,fontSize:"16px",fontWeight:"normal"},Dl={toggleActions:"play",anticipatePin:0},Vl={top:0,left:0,center:.5,bottom:1,right:1},Ll=function(t,e){if(Vn(t)){var n=t.indexOf("="),i=~n?+(t.charAt(n-1)+1)*parseFloat(t.substr(n+1)):0;~n&&(t.indexOf("%")>n&&(i*=e/100),t=t.substr(0,n-1)),t=i+(t in Vl?Vl[t]*e:~t.indexOf("%")?parseFloat(t)*e/100:parseFloat(t)||0)}return t},Cl=function(t,e,n,i,s,o,a,l){var c=s.startColor,h=s.endColor,f=s.fontSize,d=s.indent,u=s.fontWeight,_=Pe.createElement("div"),m=fs(n)||Xi(n,"pinType")==="fixed",p=t.indexOf("scroller")!==-1,g=m?Ee:n,b=t.indexOf("start")!==-1,v=b?c:h,S="border-color:"+v+";font-size:"+f+";color:"+v+";font-weight:"+u+";pointer-events:none;white-space:nowrap;font-family:sans-serif,Arial;z-index:1000;padding:4px 8px;border-width:0;border-style:solid;";return S+="position:"+((p||l)&&m?"fixed;":"absolute;"),(p||l||!m)&&(S+=(i===ke?vh:Sh)+":"+(o+parseFloat(d))+"px;"),a&&(S+="box-sizing:border-box;text-align:left;width:"+a.offsetWidth+"px;"),_._isStart=b,_.setAttribute("class","gsap-marker-"+t+(e?" marker-"+e:"")),_.style.cssText=S,_.innerText=e||e===0?t+"-"+e:t,g.children[0]?g.insertBefore(_,g.children[0]):g.appendChild(_),_._offset=_["offset"+i.op.d2],Fl(_,0,i,b),_},Fl=function(t,e,n,i){var s={display:"block"},o=n[i?"os2":"p2"],a=n[i?"p2":"os2"];t._isFlipped=i,s[n.a+"Percent"]=i?-100:0,s[n.a]=i?"1px":0,s["border"+o+io]=1,s["border"+a+io]=0,s[n.p]=e+"px",Ot.set(t,s)},ce=[],mh={},wa,$p=function(){return fn()-jn>34&&(wa||(wa=requestAnimationFrame(qi)))},js=function(){(!bn||!bn.isPressed||bn.startX>Ee.clientWidth)&&(le.cache++,bn?wa||(wa=requestAnimationFrame(qi)):qi(),jn||ps("scrollStart"),jn=fn())},lh=function(){cm=de.innerWidth,lm=de.innerHeight},ga=function(){le.cache++,!hn&&!am&&!Pe.fullscreenElement&&!Pe.webkitFullscreenElement&&(!fh||cm!==de.innerWidth||Math.abs(de.innerHeight-lm)>de.innerHeight*.25)&&Bl.restart(!0)},ds={},Iy=[],_m=function r(){return $e(Yt,"scrollEnd",r)||ls(!0)},ps=function(t){return ds[t]&&ds[t].map(function(e){return e()})||Iy},zn=[],xm=function(t){for(var e=0;e<zn.length;e+=5)(!t||zn[e+4]&&zn[e+4].query===t)&&(zn[e].style.cssText=zn[e+1],zn[e].getBBox&&zn[e].setAttribute("transform",zn[e+2]||""),zn[e+3].uncache=1)},wh=function(t,e){var n;for(wn=0;wn<ce.length;wn++)n=ce[wn],n&&(!e||n._ctx===e)&&(t?n.kill(1):n.revert(!0,!0));kl=!0,e&&xm(e),e||ps("revert")},ym=function(t,e){le.cache++,(e||!En)&&le.forEach(function(n){return Tn(n)&&n.cacheID++&&(n.rec=0)}),Vn(t)&&(de.history.scrollRestoration=xh=t)},En,hs=0,Kp,Ly=function(){if(Kp!==hs){var t=Kp=hs;requestAnimationFrame(function(){return t===hs&&ls(!0)})}},vm=function(){Ee.appendChild(eo),yh=!bn&&eo.offsetHeight||de.innerHeight,Ee.removeChild(eo)},jp=function(t){return ba(".gsap-marker-start, .gsap-marker-end, .gsap-marker-scroller-start, .gsap-marker-scroller-end").forEach(function(e){return e.style.display=t?"none":"block"})},ls=function(t,e){if(jn&&!t&&!kl){Ke(Yt,"scrollEnd",_m);return}vm(),En=Yt.isRefreshing=!0,le.forEach(function(i){return Tn(i)&&++i.cacheID&&(i.rec=i())});var n=ps("refreshInit");om&&Yt.sort(),e||wh(),le.forEach(function(i){Tn(i)&&(i.smooth&&(i.target.style.scrollBehavior="auto"),i(0))}),ce.slice(0).forEach(function(i){return i.refresh()}),kl=!1,ce.forEach(function(i){if(i._subPinOffset&&i.pin){var s=i.vars.horizontal?"offsetWidth":"offsetHeight",o=i.pin[s];i.revert(!0,1),i.adjustPinSpacing(i.pin[s]-o),i.refresh()}}),ph=1,jp(!0),ce.forEach(function(i){var s=Ri(i.scroller,i._dir),o=i.vars.end==="max"||i._endClamp&&i.end>s,a=i._startClamp&&i.start>=s;(o||a)&&i.setPositions(a?s-1:i.start,o?Math.max(a?s:i.start+1,s):i.end,!0)}),jp(!1),ph=0,n.forEach(function(i){return i&&i.render&&i.render(-1)}),le.forEach(function(i){Tn(i)&&(i.smooth&&requestAnimationFrame(function(){return i.target.style.scrollBehavior="smooth"}),i.rec&&i(i.rec))}),ym(xh,1),Bl.pause(),hs++,En=2,qi(2),ce.forEach(function(i){return Tn(i.vars.onRefresh)&&i.vars.onRefresh(i)}),En=Yt.isRefreshing=!1,ps("refresh")},gh=0,Nl=1,Ma,qi=function(t){if(t===2||!En&&!kl){Yt.isUpdating=!0,Ma&&Ma.update(0);var e=ce.length,n=fn(),i=n-oh>=50,s=e&&ce[0].scroll();if(Nl=gh>s?-1:1,En||(gh=s),i&&(jn&&!Hl&&n-jn>200&&(jn=0,ps("scrollEnd")),fa=oh,oh=n),Nl<0){for(wn=e;wn-- >0;)ce[wn]&&ce[wn].update(0,i);Nl=1}else for(wn=0;wn<e;wn++)ce[wn]&&ce[wn].update(0,i);Yt.isUpdating=!1}wa=0},_h=[pm,mm,Sh,vh,$n+Sa,$n+xa,$n+va,$n+ya,"display","flexShrink","float","zIndex","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd","gridArea","justifySelf","alignSelf","placeSelf","order"],Ul=_h.concat([cs,us,"boxSizing","max"+io,"max"+Mh,"position",$n,ze,ze+va,ze+xa,ze+Sa,ze+ya]),Fy=function(t,e,n){no(n);var i=t._gsap;if(i.spacerIsNative)no(i.spacerState);else if(t._gsap.swappedIn){var s=e.parentNode;s&&(s.insertBefore(t,e),s.removeChild(e))}t._gsap.swappedIn=!1},ch=function(t,e,n,i){if(!t._gsap.swappedIn){for(var s=_h.length,o=e.style,a=t.style,l;s--;)l=_h[s],o[l]=n[l];o.position=n.position==="absolute"?"absolute":"relative",n.display==="inline"&&(o.display="inline-block"),a[Sh]=a[vh]="auto",o.flexBasis=n.flexBasis||"auto",o.overflow="visible",o.boxSizing="border-box",o[cs]=zl(t,un)+We,o[us]=zl(t,ke)+We,o[ze]=a[$n]=a[mm]=a[pm]="0",no(i),a[cs]=a["max"+io]=n[cs],a[us]=a["max"+Mh]=n[us],a[ze]=n[ze],t.parentNode!==e&&(t.parentNode.insertBefore(e,t),e.appendChild(t)),t._gsap.swappedIn=!0}},Ny=/([A-Z])/g,no=function(t){if(t){var e=t.t.style,n=t.length,i=0,s,o;for((t.t._gsap||Ot.core.getCache(t.t)).uncache=1;i<n;i+=2)o=t[i+1],s=t[i],o?e[s]=o:e[s]&&e.removeProperty(s.replace(Ny,"-$1").toLowerCase())}},Rl=function(t){for(var e=Ul.length,n=t.style,i=[],s=0;s<e;s++)i.push(Ul[s],n[Ul[s]]);return i.t=t,i},Uy=function(t,e,n){for(var i=[],s=t.length,o=n?8:0,a;o<s;o+=2)a=t[o],i.push(a,a in e?e[a]:t[o+1]);return i.t=t.t,i},Ol={left:0,top:0},Qp=function(t,e,n,i,s,o,a,l,c,h,f,d,u,_){Tn(t)&&(t=t(l)),Vn(t)&&t.substr(0,3)==="max"&&(t=d+(t.charAt(4)==="="?Ll("0"+t.substr(3),n):0));var m=u?u.time():0,p,g,b;if(u&&u.seek(0),isNaN(t)||(t=+t),ma(t))u&&(t=Ot.utils.mapRange(u.scrollTrigger.start,u.scrollTrigger.end,0,d,t)),a&&Fl(a,n,i,!0);else{Tn(e)&&(e=e(l));var v=(t||"0").split(" "),S,D,T,w;b=Mn(e,l)||Ee,S=Yi(b)||{},(!S||!S.left&&!S.top)&&Kn(b).display==="none"&&(w=b.style.display,b.style.display="block",S=Yi(b),w?b.style.display=w:b.style.removeProperty("display")),D=Ll(v[0],S[i.d]),T=Ll(v[1]||"0",n),t=S[i.p]-c[i.p]-h+D+s-T,a&&Fl(a,T,i,n-T<20||a._isStart&&T>20),n-=n-T}if(_&&(l[_]=t||-.001,t<0&&(t=0)),o){var P=t+n,M=o._isStart;p="scroll"+i.d2,Fl(o,P,i,M&&P>20||!M&&(f?Math.max(Ee[p],ui[p]):o.parentNode[p])<=P+1),f&&(c=Yi(a),f&&(o.style[i.op.p]=c[i.op.p]-i.op.m-o._offset+We))}return u&&b&&(p=Yi(b),u.seek(d),g=Yi(b),u._caScrollDist=p[i.p]-g[i.p],t=t/u._caScrollDist*d),u&&u.seek(m),u?t:Math.round(t)},Oy=/(webkit|moz|length|cssText|inset)/i,tm=function(t,e,n,i){if(t.parentNode!==e){var s=t.style,o,a;if(e===Ee){t._stOrig=s.cssText,a=Kn(t);for(o in a)!+o&&!Oy.test(o)&&a[o]&&typeof s[o]=="string"&&o!=="0"&&(s[o]=a[o]);s.top=n,s.left=i}else s.cssText=t._stOrig;Ot.core.getCache(t).uncache=1,e.appendChild(t)}},Sm=function(t,e,n){var i=e,s=i;return function(o){var a=Math.round(t());return a!==i&&a!==s&&Math.abs(a-i)>3&&Math.abs(a-s)>3&&(o=a,n&&n()),s=i,i=o,o}},Pl=function(t,e,n){var i={};i[e.p]="+="+n,Ot.set(t,i)},em=function(t,e){var n=Wi(t,e),i="_scroll"+e.p2,s=function o(a,l,c,h,f){var d=o.tween,u=l.onComplete,_={};c=c||n();var m=Sm(n,c,function(){d.kill(),o.tween=0});return f=h&&f||0,h=h||a-c,d&&d.kill(),l[i]=a,l.inherit=!1,l.modifiers=_,_[i]=function(){return m(c+h*d.ratio+f*d.ratio*d.ratio)},l.onUpdate=function(){le.cache++,o.tween&&qi()},l.onComplete=function(){o.tween=0,u&&u.call(d)},d=o.tween=Ot.to(t,l),d};return t[i]=n,n.wheelHandler=function(){return s.tween&&s.tween.kill()&&(s.tween=0)},Ke(t,"wheel",n.wheelHandler),Yt.isTouch&&Ke(t,"touchmove",n.wheelHandler),s},Yt=function(){function r(e,n){Qs||r.register(Ot)||console.warn("Please gsap.registerPlugin(ScrollTrigger)"),dh(this),this.init(e,n)}var t=r.prototype;return t.init=function(n,i){if(this.progress=this.start=0,this.vars&&this.kill(!0,!0),!da){this.update=this.refresh=this.kill=Ci;return}n=Zp(Vn(n)||ma(n)||n.nodeType?{trigger:n}:n,Dl);var s=n,o=s.onUpdate,a=s.toggleClass,l=s.id,c=s.onToggle,h=s.onRefresh,f=s.scrub,d=s.trigger,u=s.pin,_=s.pinSpacing,m=s.invalidateOnRefresh,p=s.anticipatePin,g=s.onScrubComplete,b=s.onSnapComplete,v=s.once,S=s.snap,D=s.pinReparent,T=s.pinSpacer,w=s.containerAnimation,P=s.fastScrollEnd,M=s.preventOverlaps,y=n.horizontal||n.containerAnimation&&n.horizontal!==!1?un:ke,I=!f&&f!==0,N=Mn(n.scroller||de),C=Ot.core.getCache(N),V=fs(N),$=("pinType"in n?n.pinType:Xi(N,"pinType")||V&&"fixed")==="fixed",W=[n.onEnter,n.onLeave,n.onEnterBack,n.onLeaveBack],Z=I&&n.toggleActions.split(" "),z="markers"in n?n.markers:Dl.markers,U=V?0:parseFloat(Kn(N)["border"+y.p2+io])||0,R=this,at=n.onRefreshInit&&function(){return n.onRefreshInit(R)},_t=Ay(N,V,y),Ut=Dy(N,V),X=0,ot=0,xt=0,ct=Wi(N,y),Rt,kt,q,$t,It,Ft,bt,Et,Ht,G,jt,A,x,F,Y,tt,it,vt,pt,lt,Lt,ht,yt,qt,ut,Tt,Wt,Zt,ue,Jt,k,Q,st,mt,gt,Bt,ne,Mt,L;if(R._startClamp=R._endClamp=!1,R._dir=y,p*=45,R.scroller=N,R.scroll=w?w.time.bind(w):ct,$t=ct(),R.vars=n,i=i||n.animation,"refreshPriority"in n&&(om=1,n.refreshPriority===-9999&&(Ma=R)),C.tweenScroll=C.tweenScroll||{top:em(N,ke),left:em(N,un)},R.tweenTo=Rt=C.tweenScroll[y.p],R.scrubDuration=function(et){st=ma(et)&&et,st?Q?Q.duration(et):Q=Ot.to(i,{ease:"expo",totalProgress:"+=0",inherit:!1,duration:st,paused:!0,onComplete:function(){return g&&g(R)}}):(Q&&Q.progress(1).kill(),Q=0)},i&&(i.vars.lazy=!1,i._initted&&!R.isReverted||i.vars.immediateRender!==!1&&n.immediateRender!==!1&&i.duration()&&i.render(0,!0,!0),R.animation=i.pause(),i.scrollTrigger=R,R.scrubDuration(f),Jt=0,l||(l=i.vars.id)),S&&((!as(S)||S.push)&&(S={snapTo:S}),"scrollBehavior"in Ee.style&&Ot.set(V?[Ee,ui]:N,{scrollBehavior:"auto"}),le.forEach(function(et){return Tn(et)&&et.target===(V?Pe.scrollingElement||ui:N)&&(et.smooth=!1)}),q=Tn(S.snapTo)?S.snapTo:S.snapTo==="labels"?Ry(i):S.snapTo==="labelsDirectional"?Py(i):S.directional!==!1?function(et,wt){return bh(S.snapTo)(et,fn()-ot<500?0:wt.direction)}:Ot.utils.snap(S.snapTo),mt=S.duration||{min:.1,max:2},mt=as(mt)?_a(mt.min,mt.max):_a(mt,mt),gt=Ot.delayedCall(S.delay||st/2||.1,function(){var et=ct(),wt=fn()-ot<500,ft=Rt.tween;if((wt||Math.abs(R.getVelocity())<10)&&!ft&&!Hl&&X!==et){var Dt=(et-Ft)/F,zt=i&&!I?i.totalProgress():Dt,Nt=wt?0:(zt-k)/(fn()-fa)*1e3||0,ee=Ot.utils.clamp(-Dt,1-Dt,Ks(Nt/2)*Nt/.185),he=Dt+(S.inertia===!1?0:ee),me,ae,E=S,B=E.onStart,H=E.onInterrupt,K=E.onComplete;if(me=q(he,R),ma(me)||(me=he),ae=Math.round(Ft+me*F),et<=bt&&et>=Ft&&ae!==et){if(ft&&!ft._initted&&ft.data<=Ks(ae-et))return;S.inertia===!1&&(ee=me-Dt),Rt(ae,{duration:mt(Ks(Math.max(Ks(he-zt),Ks(me-zt))*.185/Nt/.05||0)),ease:S.ease||"power3",data:Ks(ae-et),onInterrupt:function(){return gt.restart(!0)&&H&&H(R)},onComplete:function(){R.update(),X=ct(),i&&(Q?Q.resetTo("totalProgress",me,i._tTime/i._tDur):i.progress(me)),Jt=k=i&&!I?i.totalProgress():R.progress,b&&b(R),K&&K(R)}},et,ee*F,ae-et-ee*F),B&&B(R,Rt.tween)}}else R.isActive&&X!==et&>.restart(!0)}).pause()),l&&(mh[l]=R),d=R.trigger=Mn(d||u!==!0&&u),L=d&&d._gsap&&d._gsap.stRevert,L&&(L=L(R)),u=u===!0?d:Mn(u),Vn(a)&&(a={targets:d,className:a}),u&&(_===!1||_===$n||(_=!_&&u.parentNode&&u.parentNode.style&&Kn(u.parentNode).display==="flex"?!1:ze),R.pin=u,kt=Ot.core.getCache(u),kt.spacer?Y=kt.pinState:(T&&(T=Mn(T),T&&!T.nodeType&&(T=T.current||T.nativeElement),kt.spacerIsNative=!!T,T&&(kt.spacerState=Rl(T))),kt.spacer=vt=T||Pe.createElement("div"),vt.classList.add("pin-spacer"),l&&vt.classList.add("pin-spacer-"+l),kt.pinState=Y=Rl(u)),n.force3D!==!1&&Ot.set(u,{force3D:!0}),R.spacer=vt=kt.spacer,ue=Kn(u),qt=ue[_+y.os2],lt=Ot.getProperty(u),Lt=Ot.quickSetter(u,y.a,We),ch(u,vt,ue),it=Rl(u)),z){A=as(z)?Zp(z,Jp):Jp,G=Cl("scroller-start",l,N,y,A,0),jt=Cl("scroller-end",l,N,y,A,0,G),pt=G["offset"+y.op.d2];var rt=Mn(Xi(N,"content")||N);Et=this.markerStart=Cl("start",l,rt,y,A,pt,0,w),Ht=this.markerEnd=Cl("end",l,rt,y,A,pt,0,w),w&&(Mt=Ot.quickSetter([Et,Ht],y.a,We)),!$&&!(ci.length&&Xi(N,"fixedMarkers")===!0)&&(Cy(V?Ee:N),Ot.set([G,jt],{force3D:!0}),Tt=Ot.quickSetter(G,y.a,We),Zt=Ot.quickSetter(jt,y.a,We))}if(w){var O=w.vars.onUpdate,j=w.vars.onUpdateParams;w.eventCallback("onUpdate",function(){R.update(0,0,1),O&&O.apply(w,j||[])})}if(R.previous=function(){return ce[ce.indexOf(R)-1]},R.next=function(){return ce[ce.indexOf(R)+1]},R.revert=function(et,wt){if(!wt)return R.kill(!0);var ft=et!==!1||!R.enabled,Dt=hn;ft!==R.isReverted&&(ft&&(Bt=Math.max(ct(),R.scroll.rec||0),xt=R.progress,ne=i&&i.progress()),Et&&[Et,Ht,G,jt].forEach(function(zt){return zt.style.display=ft?"none":"block"}),ft&&(hn=R,R.update(ft)),u&&(!D||!R.isActive)&&(ft?Fy(u,vt,Y):ch(u,vt,Kn(u),ut)),ft||R.update(ft),hn=Dt,R.isReverted=ft)},R.refresh=function(et,wt,ft,Dt){if(!((hn||!R.enabled)&&!wt)){if(u&&et&&jn){Ke(r,"scrollEnd",_m);return}!En&&at&&at(R),hn=R,Rt.tween&&!ft&&(Rt.tween.kill(),Rt.tween=0),Q&&Q.pause(),m&&i&&i.revert({kill:!1}).invalidate(),R.isReverted||R.revert(!0,!0),R._subPinOffset=!1;var zt=_t(),Nt=Ut(),ee=w?w.duration():Ri(N,y),he=F<=.01,me=0,ae=Dt||0,E=as(ft)?ft.end:n.end,B=n.endTrigger||d,H=as(ft)?ft.start:n.start||(n.start===0||!d?0:u?"0 0":"0 100%"),K=R.pinnedContainer=n.pinnedContainer&&Mn(n.pinnedContainer,R),J=d&&Math.max(0,ce.indexOf(R))||0,St=J,At,Pt,Xt,te,Gt,Vt,xe,Be,sn,_n,ie,Qt,bi;for(z&&as(ft)&&(Qt=Ot.getProperty(G,y.p),bi=Ot.getProperty(jt,y.p));St--;)Vt=ce[St],Vt.end||Vt.refresh(0,1)||(hn=R),xe=Vt.pin,xe&&(xe===d||xe===u||xe===K)&&!Vt.isReverted&&(_n||(_n=[]),_n.unshift(Vt),Vt.revert(!0,!0)),Vt!==ce[St]&&(J--,St--);for(Tn(H)&&(H=H(R)),H=Wp(H,"start",R),Ft=Qp(H,d,zt,y,ct(),Et,G,R,Nt,U,$,ee,w,R._startClamp&&"_startClamp")||(u?-.001:0),Tn(E)&&(E=E(R)),Vn(E)&&!E.indexOf("+=")&&(~E.indexOf(" ")?E=(Vn(H)?H.split(" ")[0]:"")+E:(me=Ll(E.substr(2),zt),E=Vn(H)?H:(w?Ot.utils.mapRange(0,w.duration(),w.scrollTrigger.start,w.scrollTrigger.end,Ft):Ft)+me,B=d)),E=Wp(E,"end",R),bt=Math.max(Ft,Qp(E||(B?"100% 0":ee),B,zt,y,ct()+me,Ht,jt,R,Nt,U,$,ee,w,R._endClamp&&"_endClamp"))||-.001,me=0,St=J;St--;)Vt=ce[St],xe=Vt.pin,xe&&Vt.start-Vt._pinPush<=Ft&&!w&&Vt.end>0&&(At=Vt.end-(R._startClamp?Math.max(0,Vt.start):Vt.start),(xe===d&&Vt.start-Vt._pinPush<Ft||xe===K)&&isNaN(H)&&(me+=At*(1-Vt.progress)),xe===u&&(ae+=At));if(Ft+=me,bt+=me,R._startClamp&&(R._startClamp+=me),R._endClamp&&!En&&(R._endClamp=bt||-.001,bt=Math.min(bt,Ri(N,y))),F=bt-Ft||(Ft-=.01)&&.001,he&&(xt=Ot.utils.clamp(0,1,Ot.utils.normalize(Ft,bt,Bt))),R._pinPush=ae,Et&&me&&(At={},At[y.a]="+="+me,K&&(At[y.p]="-="+ct()),Ot.set([Et,Ht],At)),u&&!(ph&&R.end>=Ri(N,y)))At=Kn(u),te=y===ke,Xt=ct(),ht=parseFloat(lt(y.a))+ae,!ee&&bt>1&&(ie=(V?Pe.scrollingElement||ui:N).style,ie={style:ie,value:ie["overflow"+y.a.toUpperCase()]},V&&Kn(Ee)["overflow"+y.a.toUpperCase()]!=="scroll"&&(ie.style["overflow"+y.a.toUpperCase()]="scroll")),ch(u,vt,At),it=Rl(u),Pt=Yi(u,!0),Be=$&&Wi(N,te?un:ke)(),_?(ut=[_+y.os2,F+ae+We],ut.t=vt,St=_===ze?zl(u,y)+F+ae:0,St&&(ut.push(y.d,St+We),vt.style.flexBasis!=="auto"&&(vt.style.flexBasis=St+We)),no(ut),K&&ce.forEach(function(ve){ve.pin===K&&ve.vars.pinSpacing!==!1&&(ve._subPinOffset=!0)}),$&&ct(Bt)):(St=zl(u,y),St&&vt.style.flexBasis!=="auto"&&(vt.style.flexBasis=St+We)),$&&(Gt={top:Pt.top+(te?Xt-Ft:Be)+We,left:Pt.left+(te?Be:Xt-Ft)+We,boxSizing:"border-box",position:"fixed"},Gt[cs]=Gt["max"+io]=Math.ceil(Pt.width)+We,Gt[us]=Gt["max"+Mh]=Math.ceil(Pt.height)+We,Gt[$n]=Gt[$n+va]=Gt[$n+xa]=Gt[$n+Sa]=Gt[$n+ya]="0",Gt[ze]=At[ze],Gt[ze+va]=At[ze+va],Gt[ze+xa]=At[ze+xa],Gt[ze+Sa]=At[ze+Sa],Gt[ze+ya]=At[ze+ya],tt=Uy(Y,Gt,D),En&&ct(0)),i?(sn=i._initted,rh(1),i.render(i.duration(),!0,!0),yt=lt(y.a)-ht+F+ae,Wt=Math.abs(F-yt)>1,$&&Wt&&tt.splice(tt.length-2,2),i.render(0,!0,!0),sn||i.invalidate(!0),i.parent||i.totalTime(i.totalTime()),rh(0)):yt=F,ie&&(ie.value?ie.style["overflow"+y.a.toUpperCase()]=ie.value:ie.style.removeProperty("overflow-"+y.a));else if(d&&ct()&&!w)for(Pt=d.parentNode;Pt&&Pt!==Ee;)Pt._pinOffset&&(Ft-=Pt._pinOffset,bt-=Pt._pinOffset),Pt=Pt.parentNode;_n&&_n.forEach(function(ve){return ve.revert(!1,!0)}),R.start=Ft,R.end=bt,$t=It=En?Bt:ct(),!w&&!En&&($t<Bt&&ct(Bt),R.scroll.rec=0),R.revert(!1,!0),ot=fn(),gt&&(X=-1,gt.restart(!0)),hn=0,i&&I&&(i._initted||ne)&&i.progress()!==ne&&i.progress(ne||0,!0).render(i.time(),!0,!0),(he||xt!==R.progress||w||m)&&(i&&!I&&i.totalProgress(w&&Ft<-.001&&!xt?Ot.utils.normalize(Ft,bt,0):xt,!0),R.progress=he||($t-Ft)/F===xt?0:xt),u&&_&&(vt._pinOffset=Math.round(R.progress*yt)),Q&&Q.invalidate(),isNaN(Qt)||(Qt-=Ot.getProperty(G,y.p),bi-=Ot.getProperty(jt,y.p),Pl(G,y,Qt),Pl(Et,y,Qt-(Dt||0)),Pl(jt,y,bi),Pl(Ht,y,bi-(Dt||0))),he&&!En&&R.update(),h&&!En&&!x&&(x=!0,h(R),x=!1)}},R.getVelocity=function(){return(ct()-It)/(fn()-fa)*1e3||0},R.endAnimation=function(){ha(R.callbackAnimation),i&&(Q?Q.progress(1):i.paused()?I||ha(i,R.direction<0,1):ha(i,i.reversed()))},R.labelToScroll=function(et){return i&&i.labels&&(Ft||R.refresh()||Ft)+i.labels[et]/i.duration()*F||0},R.getTrailing=function(et){var wt=ce.indexOf(R),ft=R.direction>0?ce.slice(0,wt).reverse():ce.slice(wt+1);return(Vn(et)?ft.filter(function(Dt){return Dt.vars.preventOverlaps===et}):ft).filter(function(Dt){return R.direction>0?Dt.end<=Ft:Dt.start>=bt})},R.update=function(et,wt,ft){if(!(w&&!ft&&!et)){var Dt=En===!0?Bt:R.scroll(),zt=et?0:(Dt-Ft)/F,Nt=zt<0?0:zt>1?1:zt||0,ee=R.progress,he,me,ae,E,B,H,K,J;if(wt&&(It=$t,$t=w?ct():Dt,S&&(k=Jt,Jt=i&&!I?i.totalProgress():Nt)),p&&u&&!hn&&!wl&&jn&&(!Nt&&Ft<Dt+(Dt-It)/(fn()-fa)*p?Nt=1e-4:Nt===1&&bt>Dt+(Dt-It)/(fn()-fa)*p&&(Nt=.9999)),Nt!==ee&&R.enabled){if(he=R.isActive=!!Nt&&Nt<1,me=!!ee&&ee<1,H=he!==me,B=H||!!Nt!=!!ee,R.direction=Nt>ee?1:-1,R.progress=Nt,B&&!hn&&(ae=Nt&&!ee?0:Nt===1?1:ee===1?2:3,I&&(E=!H&&Z[ae+1]!=="none"&&Z[ae+1]||Z[ae],J=i&&(E==="complete"||E==="reset"||E in i))),M&&(H||J)&&(J||f||!i)&&(Tn(M)?M(R):R.getTrailing(M).forEach(function(Xt){return Xt.endAnimation()})),I||(Q&&!hn&&!wl?(Q._dp._time-Q._start!==Q._time&&Q.render(Q._dp._time-Q._start),Q.resetTo?Q.resetTo("totalProgress",Nt,i._tTime/i._tDur):(Q.vars.totalProgress=Nt,Q.invalidate().restart())):i&&i.totalProgress(Nt,!!(hn&&(ot||et)))),u){if(et&&_&&(vt.style[_+y.os2]=qt),!$)Lt(pa(ht+yt*Nt));else if(B){if(K=!et&&Nt>ee&&bt+1>Dt&&Dt+1>=Ri(N,y),D)if(!et&&(he||K)){var St=Yi(u,!0),At=Dt-Ft;tm(u,Ee,St.top+(y===ke?At:0)+We,St.left+(y===ke?0:At)+We)}else tm(u,vt);no(he||K?tt:it),Wt&&Nt<1&&he||Lt(ht+(Nt===1&&!K?yt:0))}}S&&!Rt.tween&&!hn&&!wl&>.restart(!0),a&&(H||v&&Nt&&(Nt<1||!sh))&&ba(a.targets).forEach(function(Xt){return Xt.classList[he||v?"add":"remove"](a.className)}),o&&!I&&!et&&o(R),B&&!hn?(I&&(J&&(E==="complete"?i.pause().totalProgress(1):E==="reset"?i.restart(!0).pause():E==="restart"?i.restart(!0):i[E]()),o&&o(R)),(H||!sh)&&(c&&H&&ah(R,c),W[ae]&&ah(R,W[ae]),v&&(Nt===1?R.kill(!1,1):W[ae]=0),H||(ae=Nt===1?1:3,W[ae]&&ah(R,W[ae]))),P&&!he&&Math.abs(R.getVelocity())>(ma(P)?P:2500)&&(ha(R.callbackAnimation),Q?Q.progress(1):ha(i,E==="reverse"?1:!Nt,1))):I&&o&&!hn&&o(R)}if(Zt){var Pt=w?Dt/w.duration()*(w._caScrollDist||0):Dt;Tt(Pt+(G._isFlipped?1:0)),Zt(Pt)}Mt&&Mt(-Dt/w.duration()*(w._caScrollDist||0))}},R.enable=function(et,wt){R.enabled||(R.enabled=!0,Ke(N,"resize",ga),V||Ke(N,"scroll",js),at&&Ke(r,"refreshInit",at),et!==!1&&(R.progress=xt=0,$t=It=X=ct()),wt!==!1&&R.refresh())},R.getTween=function(et){return et&&Rt?Rt.tween:Q},R.setPositions=function(et,wt,ft,Dt){if(w){var zt=w.scrollTrigger,Nt=w.duration(),ee=zt.end-zt.start;et=zt.start+ee*et/Nt,wt=zt.start+ee*wt/Nt}R.refresh(!1,!1,{start:Xp(et,ft&&!!R._startClamp),end:Xp(wt,ft&&!!R._endClamp)},Dt),R.update()},R.adjustPinSpacing=function(et){if(ut&&et){var wt=ut.indexOf(y.d)+1;ut[wt]=parseFloat(ut[wt])+et+We,ut[1]=parseFloat(ut[1])+et+We,no(ut)}},R.disable=function(et,wt){if(R.enabled&&(et!==!1&&R.revert(!0,!0),R.enabled=R.isActive=!1,wt||Q&&Q.pause(),Bt=0,kt&&(kt.uncache=1),at&&$e(r,"refreshInit",at),gt&&(gt.pause(),Rt.tween&&Rt.tween.kill()&&(Rt.tween=0)),!V)){for(var ft=ce.length;ft--;)if(ce[ft].scroller===N&&ce[ft]!==R)return;$e(N,"resize",ga),V||$e(N,"scroll",js)}},R.kill=function(et,wt){R.disable(et,wt),Q&&!wt&&Q.kill(),l&&delete mh[l];var ft=ce.indexOf(R);ft>=0&&ce.splice(ft,1),ft===wn&&Nl>0&&wn--,ft=0,ce.forEach(function(Dt){return Dt.scroller===R.scroller&&(ft=1)}),ft||En||(R.scroll.rec=0),i&&(i.scrollTrigger=null,et&&i.revert({kill:!1}),wt||i.kill()),Et&&[Et,Ht,G,jt].forEach(function(Dt){return Dt.parentNode&&Dt.parentNode.removeChild(Dt)}),Ma===R&&(Ma=0),u&&(kt&&(kt.uncache=1),ft=0,ce.forEach(function(Dt){return Dt.pin===u&&ft++}),ft||(kt.spacer=0)),n.onKill&&n.onKill(R)},ce.push(R),R.enable(!1,!1),L&&L(R),i&&i.add&&!F){var dt=R.update;R.update=function(){R.update=dt,Ft||bt||R.refresh()},Ot.delayedCall(.01,R.update),F=.01,Ft=bt=0}else R.refresh();u&&Ly()},r.register=function(n){return Qs||(Ot=n||hm(),um()&&window.document&&r.enable(),Qs=da),Qs},r.defaults=function(n){if(n)for(var i in n)Dl[i]=n[i];return Dl},r.disable=function(n,i){da=0,ce.forEach(function(o){return o[i?"kill":"disable"](n)}),$e(de,"wheel",js),$e(Pe,"scroll",js),clearInterval(bl),$e(Pe,"touchcancel",Ci),$e(Ee,"touchstart",Ci),Tl($e,Pe,"pointerdown,touchstart,mousedown",Yp),Tl($e,Pe,"pointerup,touchend,mouseup",qp),Bl.kill(),El($e);for(var s=0;s<le.length;s+=3)Al($e,le[s],le[s+1]),Al($e,le[s],le[s+2])},r.enable=function(){if(de=window,Pe=document,ui=Pe.documentElement,Ee=Pe.body,Ot&&(ba=Ot.utils.toArray,_a=Ot.utils.clamp,dh=Ot.core.context||Ci,rh=Ot.core.suppressOverwrites||Ci,xh=de.history.scrollRestoration||"auto",gh=de.pageYOffset,Ot.core.globals("ScrollTrigger",r),Ee)){da=1,eo=document.createElement("div"),eo.style.height="100vh",eo.style.position="absolute",vm(),Ty(),Fe.register(Ot),r.isTouch=Fe.isTouch,Sr=Fe.isTouch&&/(iPad|iPhone|iPod|Mac)/g.test(navigator.userAgent),fh=Fe.isTouch===1,Ke(de,"wheel",js),sm=[de,Pe,ui,Ee],Ot.matchMedia?(r.matchMedia=function(l){var c=Ot.matchMedia(),h;for(h in l)c.add(h,l[h]);return c},Ot.addEventListener("matchMediaInit",function(){return wh()}),Ot.addEventListener("matchMediaRevert",function(){return xm()}),Ot.addEventListener("matchMedia",function(){ls(0,1),ps("matchMedia")}),Ot.matchMedia("(orientation: portrait)",function(){return lh(),lh})):console.warn("Requires GSAP 3.11.0 or later"),lh(),Ke(Pe,"scroll",js);var n=Ee.style,i=n.borderTopStyle,s=Ot.core.Animation.prototype,o,a;for(s.revert||Object.defineProperty(s,"revert",{value:function(){return this.time(-.01,!0)}}),n.borderTopStyle="solid",o=Yi(Ee),ke.m=Math.round(o.top+ke.sc())||0,un.m=Math.round(o.left+un.sc())||0,i?n.borderTopStyle=i:n.removeProperty("border-top-style"),bl=setInterval($p,250),Ot.delayedCall(.5,function(){return wl=0}),Ke(Pe,"touchcancel",Ci),Ke(Ee,"touchstart",Ci),Tl(Ke,Pe,"pointerdown,touchstart,mousedown",Yp),Tl(Ke,Pe,"pointerup,touchend,mouseup",qp),hh=Ot.utils.checkPrefix("transform"),Ul.push(hh),Qs=fn(),Bl=Ot.delayedCall(.2,ls).pause(),to=[Pe,"visibilitychange",function(){var l=de.innerWidth,c=de.innerHeight;Pe.hidden?(Hp=l,Gp=c):(Hp!==l||Gp!==c)&&ga()},Pe,"DOMContentLoaded",ls,de,"load",ls,de,"resize",ga],El(Ke),ce.forEach(function(l){return l.enable(0,1)}),a=0;a<le.length;a+=3)Al($e,le[a],le[a+1]),Al($e,le[a],le[a+2])}},r.config=function(n){"limitCallbacks"in n&&(sh=!!n.limitCallbacks);var i=n.syncInterval;i&&clearInterval(bl)||(bl=i)&&setInterval($p,i),"ignoreMobileResize"in n&&(fh=r.isTouch===1&&n.ignoreMobileResize),"autoRefreshEvents"in n&&(El($e)||El(Ke,n.autoRefreshEvents||"none"),am=(n.autoRefreshEvents+"").indexOf("resize")===-1)},r.scrollerProxy=function(n,i){var s=Mn(n),o=le.indexOf(s),a=fs(s);~o&&le.splice(o,a?6:2),i&&(a?ci.unshift(de,i,Ee,i,ui,i):ci.unshift(s,i))},r.clearMatchMedia=function(n){ce.forEach(function(i){return i._ctx&&i._ctx.query===n&&i._ctx.kill(!0,!0)})},r.isInViewport=function(n,i,s){var o=(Vn(n)?Mn(n):n).getBoundingClientRect(),a=o[s?cs:us]*i||0;return s?o.right-a>0&&o.left+a<de.innerWidth:o.bottom-a>0&&o.top+a<de.innerHeight},r.positionInViewport=function(n,i,s){Vn(n)&&(n=Mn(n));var o=n.getBoundingClientRect(),a=o[s?cs:us],l=i==null?a/2:i in Vl?Vl[i]*a:~i.indexOf("%")?parseFloat(i)*a/100:parseFloat(i)||0;return s?(o.left+l)/de.innerWidth:(o.top+l)/de.innerHeight},r.killAll=function(n){if(ce.slice(0).forEach(function(s){return s.vars.id!=="ScrollSmoother"&&s.kill()}),n!==!0){var i=ds.killAll||[];ds={},i.forEach(function(s){return s()})}},r}();Yt.version="3.12.5";Yt.saveStyles=function(r){return r?ba(r).forEach(function(t){if(t&&t.style){var e=zn.indexOf(t);e>=0&&zn.splice(e,5),zn.push(t,t.style.cssText,t.getBBox&&t.getAttribute("transform"),Ot.core.getCache(t),dh())}}):zn};Yt.revert=function(r,t){return wh(!r,t)};Yt.create=function(r,t){return new Yt(r,t)};Yt.refresh=function(r){return r?ga():(Qs||Yt.register())&&ls(!0)};Yt.update=function(r){return++le.cache&&qi(r===!0?2:0)};Yt.clearScrollMemory=ym;Yt.maxScroll=function(r,t){return Ri(r,t?un:ke)};Yt.getScrollFunc=function(r,t){return Wi(Mn(r),t?un:ke)};Yt.getById=function(r){return mh[r]};Yt.getAll=function(){return ce.filter(function(r){return r.vars.id!=="ScrollSmoother"})};Yt.isScrolling=function(){return!!jn};Yt.snapDirectional=bh;Yt.addEventListener=function(r,t){var e=ds[r]||(ds[r]=[]);~e.indexOf(t)||e.push(t)};Yt.removeEventListener=function(r,t){var e=ds[r],n=e&&e.indexOf(t);n>=0&&e.splice(n,1)};Yt.batch=function(r,t){var e=[],n={},i=t.interval||.016,s=t.batchMax||1e9,o=function(c,h){var f=[],d=[],u=Ot.delayedCall(i,function(){h(f,d),f=[],d=[]}).pause();return function(_){f.length||u.restart(!0),f.push(_.trigger),d.push(_),s<=f.length&&u.progress(1)}},a;for(a in t)n[a]=a.substr(0,2)==="on"&&Tn(t[a])&&a!=="onRefreshInit"?o(a,t[a]):t[a];return Tn(s)&&(s=s(),Ke(Yt,"refresh",function(){return s=t.batchMax()})),ba(r).forEach(function(l){var c={};for(a in n)c[a]=n[a];c.trigger=l,e.push(Yt.create(c))}),e};var nm=function(t,e,n,i){return e>i?t(i):e<0&&t(0),n>i?(i-e)/(n-e):n<0?e/(e-n):1},uh=function r(t,e){e===!0?t.style.removeProperty("touch-action"):t.style.touchAction=e===!0?"auto":e?"pan-"+e+(Fe.isTouch?" pinch-zoom":""):"none",t===ui&&r(Ee,e)},Il={auto:1,scroll:1},By=function(t){var e=t.event,n=t.target,i=t.axis,s=(e.changedTouches?e.changedTouches[0]:e).target,o=s._gsap||Ot.core.getCache(s),a=fn(),l;if(!o._isScrollT||a-o._isScrollT>2e3){for(;s&&s!==Ee&&(s.scrollHeight<=s.clientHeight&&s.scrollWidth<=s.clientWidth||!(Il[(l=Kn(s)).overflowY]||Il[l.overflowX]));)s=s.parentNode;o._isScroll=s&&s!==n&&!fs(s)&&(Il[(l=Kn(s)).overflowY]||Il[l.overflowX]),o._isScrollT=a}(o._isScroll||i==="x")&&(e.stopPropagation(),e._gsapAllow=!0)},Mm=function(t,e,n,i){return Fe.create({target:t,capture:!0,debounce:!1,lockAxis:!0,type:e,onWheel:i=i&&By,onPress:i,onDrag:i,onScroll:i,onEnable:function(){return n&&Ke(Pe,Fe.eventTypes[0],rm,!1,!0)},onDisable:function(){return $e(Pe,Fe.eventTypes[0],rm,!0)}})},ky=/(input|label|select|textarea)/i,im,rm=function(t){var e=ky.test(t.target.tagName);(e||im)&&(t._gsapAllow=!0,im=e)},zy=function(t){as(t)||(t={}),t.preventDefault=t.isNormalizer=t.allowClicks=!0,t.type||(t.type="wheel,touch"),t.debounce=!!t.debounce,t.id=t.id||"normalizer";var e=t,n=e.normalizeScrollX,i=e.momentum,s=e.allowNestedScroll,o=e.onRelease,a,l,c=Mn(t.target)||ui,h=Ot.core.globals().ScrollSmoother,f=h&&h.get(),d=Sr&&(t.content&&Mn(t.content)||f&&t.content!==!1&&!f.smooth()&&f.content()),u=Wi(c,ke),_=Wi(c,un),m=1,p=(Fe.isTouch&&de.visualViewport?de.visualViewport.scale*de.visualViewport.width:de.outerWidth)/de.innerWidth,g=0,b=Tn(i)?function(){return i(a)}:function(){return i||2.8},v,S,D=Mm(c,t.type,!0,s),T=function(){return S=!1},w=Ci,P=Ci,M=function(){l=Ri(c,ke),P=_a(Sr?1:0,l),n&&(w=_a(0,Ri(c,un))),v=hs},y=function(){d._gsap.y=pa(parseFloat(d._gsap.y)+u.offset)+"px",d.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+parseFloat(d._gsap.y)+", 0, 1)",u.offset=u.cacheID=0},I=function(){if(S){requestAnimationFrame(T);var z=pa(a.deltaY/2),U=P(u.v-z);if(d&&U!==u.v+u.offset){u.offset=U-u.v;var R=pa((parseFloat(d&&d._gsap.y)||0)-u.offset);d.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+R+", 0, 1)",d._gsap.y=R+"px",u.cacheID=le.cache,qi()}return!0}u.offset&&y(),S=!0},N,C,V,$,W=function(){M(),N.isActive()&&N.vars.scrollY>l&&(u()>l?N.progress(1)&&u(l):N.resetTo("scrollY",l))};return d&&Ot.set(d,{y:"+=0"}),t.ignoreCheck=function(Z){return Sr&&Z.type==="touchmove"&&I(Z)||m>1.05&&Z.type!=="touchstart"||a.isGesturing||Z.touches&&Z.touches.length>1},t.onPress=function(){S=!1;var Z=m;m=pa((de.visualViewport&&de.visualViewport.scale||1)/p),N.pause(),Z!==m&&uh(c,m>1.01?!0:n?!1:"x"),C=_(),V=u(),M(),v=hs},t.onRelease=t.onGestureStart=function(Z,z){if(u.offset&&y(),!z)$.restart(!0);else{le.cache++;var U=b(),R,at;n&&(R=_(),at=R+U*.05*-Z.velocityX/.227,U*=nm(_,R,at,Ri(c,un)),N.vars.scrollX=w(at)),R=u(),at=R+U*.05*-Z.velocityY/.227,U*=nm(u,R,at,Ri(c,ke)),N.vars.scrollY=P(at),N.invalidate().duration(U).play(.01),(Sr&&N.vars.scrollY>=l||R>=l-1)&&Ot.to({},{onUpdate:W,duration:U})}o&&o(Z)},t.onWheel=function(){N._ts&&N.pause(),fn()-g>1e3&&(v=0,g=fn())},t.onChange=function(Z,z,U,R,at){if(hs!==v&&M(),z&&n&&_(w(R[2]===z?C+(Z.startX-Z.x):_()+z-R[1])),U){u.offset&&y();var _t=at[2]===U,Ut=_t?V+Z.startY-Z.y:u()+U-at[1],X=P(Ut);_t&&Ut!==X&&(V+=X-Ut),u(X)}(U||z)&&qi()},t.onEnable=function(){uh(c,n?!1:"x"),Yt.addEventListener("refresh",W),Ke(de,"resize",W),u.smooth&&(u.target.style.scrollBehavior="auto",u.smooth=_.smooth=!1),D.enable()},t.onDisable=function(){uh(c,!0),$e(de,"resize",W),Yt.removeEventListener("refresh",W),D.kill()},t.lockAxis=t.lockAxis!==!1,a=new Fe(t),a.iOS=Sr,Sr&&!u()&&u(1),Sr&&Ot.ticker.add(Ci),$=a._dc,N=Ot.to(a,{ease:"power4",paused:!0,inherit:!1,scrollX:n?"+=0.1":"+=0",scrollY:"+=0.1",modifiers:{scrollY:Sm(u,u(),function(){return N.pause()})},onUpdate:qi,onComplete:$.vars.onComplete}),a};Yt.sort=function(r){return ce.sort(r||function(t,e){return(t.vars.refreshPriority||0)*-1e6+t.start-(e.start+(e.vars.refreshPriority||0)*-1e6)})};Yt.observe=function(r){return new Fe(r)};Yt.normalizeScroll=function(r){if(typeof r>"u")return bn;if(r===!0&&bn)return bn.enable();if(r===!1){bn&&bn.kill(),bn=r;return}var t=r instanceof Fe?r:zy(r);return bn&&bn.target===t.target&&bn.kill(),fs(t.target)&&(bn=t),t};Yt.core={_getVelocityProp:Ml,_inputObserver:Mm,_scrollers:le,_proxies:ci,bridge:{ss:function(){jn||ps("scrollStart"),jn=fn()},ref:function(){return hn}}};hm()&&Ot.registerPlugin(Yt);var bm=()=>{Kt.registerPlugin(Yt),document.querySelector("#hero")&&document.querySelectorAll(".hero_services_right-column").forEach(t=>{let e=Kt.timeline({scrollTrigger:{trigger:t,start:"top bottom",toggleActions:"play none none reset"}});if(e.fromTo(".case-studies_hero-under",{y:"100%"},{y:0,duration:.75,ease:"circ.out",delay:2.2}),t.querySelector(".border_cover-img")){let n=t.querySelector(".border_cover-img");e.fromTo(n,{y:"0",x:"0",opacity:0},{y:"0.51em",x:"-0.51em",opacity:1,duration:.75,ease:"circ.out"})}if(t.querySelector(".slice-border")){let n=t.querySelector(".slice-border");e.fromTo(n,{y:"0",x:"0",opacity:0},{y:"0.51em",x:"-0.81em",opacity:1,duration:.75,ease:"circ.out"},"<")}})};var wm=()=>{if(Kt.registerPlugin(Yt),document.querySelector(".creator_container")){let r=document.querySelector(".creator_container");Kt.timeline({scrollTrigger:{trigger:r,start:"top center",toggleActions:"play none none reverse"}}).fromTo(".caption_wrapper",{opacity:0},{opacity:1,duration:.75,ease:"circ.out"}).to("#casestudies-sticker",{opacity:1,duration:.5,ease:"power1.inOut"}).to("#casestudies-sticker",{rotation:10,duration:.5,yoyo:!0,ease:"power1.inOut"}).to("#casestudies-sticker",{rotation:-10,duration:.5,yoyo:!0,ease:"power1.inOut"}).to("#casestudies-sticker",{rotation:0,duration:.5,yoyo:!0,ease:"power1.inOut"}).to(".is-case-line",{width:"100%",duration:.5,ease:"power1.inOut"},">-1.75").fromTo(".quote-paragraph",{autoAlpha:0,y:"3rem"},{y:0,autoAlpha:1,duration:.5,ease:"circ.out"},">-0.25")}};var Zi,ms,Dh,Xl,Ea,Gl,Wl,Ta,hi="transform",Ah=hi+"Origin",Em,Tm=function(t){var e=t.ownerDocument||t;for(!(hi in t.style)&&("msTransform"in t.style)&&(hi="msTransform",Ah=hi+"Origin");e.parentNode&&(e=e.parentNode););if(ms=window,Wl=new Mr,e){Zi=e,Dh=e.documentElement,Xl=e.body,Ta=Zi.createElementNS("http://www.w3.org/2000/svg","g"),Ta.style.transform="none";var n=e.createElement("div"),i=e.createElement("div"),s=e&&(e.body||e.firstElementChild);s&&s.appendChild&&(s.appendChild(n),n.appendChild(i),n.setAttribute("style","position:static;transform:translate3d(0,0,1px)"),Em=i.offsetParent!==n,s.removeChild(n))}return e},Vy=function(t){for(var e,n;t&&t!==Xl;)n=t._gsap,n&&n.uncache&&n.get(t,"x"),n&&!n.scaleX&&!n.scaleY&&n.renderTransform&&(n.scaleX=n.scaleY=1e-4,n.renderTransform(1,n),e?e.push(n):e=[n]),t=t.parentNode;return e},Am=[],Dm=[],Hy=function(){return ms.pageYOffset||Zi.scrollTop||Dh.scrollTop||Xl.scrollTop||0},Gy=function(){return ms.pageXOffset||Zi.scrollLeft||Dh.scrollLeft||Xl.scrollLeft||0},Ch=function(t){return t.ownerSVGElement||((t.tagName+"").toLowerCase()==="svg"?t:null)},Wy=function r(t){if(ms.getComputedStyle(t).position==="fixed")return!0;if(t=t.parentNode,t&&t.nodeType===1)return r(t)},Eh=function r(t,e){if(t.parentNode&&(Zi||Tm(t))){var n=Ch(t),i=n?n.getAttribute("xmlns")||"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",s=n?e?"rect":"g":"div",o=e!==2?0:100,a=e===3?100:0,l="position:absolute;display:block;pointer-events:none;margin:0;padding:0;",c=Zi.createElementNS?Zi.createElementNS(i.replace(/^https/,"http"),s):Zi.createElement(s);return e&&(n?(Gl||(Gl=r(t)),c.setAttribute("width",.01),c.setAttribute("height",.01),c.setAttribute("transform","translate("+o+","+a+")"),Gl.appendChild(c)):(Ea||(Ea=r(t),Ea.style.cssText=l),c.style.cssText=l+"width:0.1px;height:0.1px;top:"+a+"px;left:"+o+"px",Ea.appendChild(c))),c}throw"Need document and parent."},Xy=function(t){for(var e=new Mr,n=0;n<t.numberOfItems;n++)e.multiply(t.getItem(n).matrix);return e},Yy=function(t){var e=t.getCTM(),n;return e||(n=t.style[hi],t.style[hi]="none",t.appendChild(Ta),e=Ta.getCTM(),t.removeChild(Ta),n?t.style[hi]=n:t.style.removeProperty(hi.replace(/([A-Z])/g,"-$1").toLowerCase())),e||Wl.clone()},qy=function(t,e){var n=Ch(t),i=t===n,s=n?Am:Dm,o=t.parentNode,a,l,c,h,f,d;if(t===ms)return t;if(s.length||s.push(Eh(t,1),Eh(t,2),Eh(t,3)),a=n?Gl:Ea,n)i?(c=Yy(t),h=-c.e/c.a,f=-c.f/c.d,l=Wl):t.getBBox?(c=t.getBBox(),l=t.transform?t.transform.baseVal:{},l=l.numberOfItems?l.numberOfItems>1?Xy(l):l.getItem(0).matrix:Wl,h=l.a*c.x+l.c*c.y,f=l.b*c.x+l.d*c.y):(l=new Mr,h=f=0),e&&t.tagName.toLowerCase()==="g"&&(h=f=0),(i?n:o).appendChild(a),a.setAttribute("transform","matrix("+l.a+","+l.b+","+l.c+","+l.d+","+(l.e+h)+","+(l.f+f)+")");else{if(h=f=0,Em)for(l=t.offsetParent,c=t;c&&(c=c.parentNode)&&c!==l&&c.parentNode;)(ms.getComputedStyle(c)[hi]+"").length>4&&(h=c.offsetLeft,f=c.offsetTop,c=0);if(d=ms.getComputedStyle(t),d.position!=="absolute"&&d.position!=="fixed")for(l=t.offsetParent;o&&o!==l;)h+=o.scrollLeft||0,f+=o.scrollTop||0,o=o.parentNode;c=a.style,c.top=t.offsetTop-f+"px",c.left=t.offsetLeft-h+"px",c[hi]=d[hi],c[Ah]=d[Ah],c.position=d.position==="fixed"?"fixed":"absolute",t.parentNode.appendChild(a)}return a},Th=function(t,e,n,i,s,o,a){return t.a=e,t.b=n,t.c=i,t.d=s,t.e=o,t.f=a,t},Mr=function(){function r(e,n,i,s,o,a){e===void 0&&(e=1),n===void 0&&(n=0),i===void 0&&(i=0),s===void 0&&(s=1),o===void 0&&(o=0),a===void 0&&(a=0),Th(this,e,n,i,s,o,a)}var t=r.prototype;return t.inverse=function(){var n=this.a,i=this.b,s=this.c,o=this.d,a=this.e,l=this.f,c=n*o-i*s||1e-10;return Th(this,o/c,-i/c,-s/c,n/c,(s*l-o*a)/c,-(n*l-i*a)/c)},t.multiply=function(n){var i=this.a,s=this.b,o=this.c,a=this.d,l=this.e,c=this.f,h=n.a,f=n.c,d=n.b,u=n.d,_=n.e,m=n.f;return Th(this,h*i+d*o,h*s+d*a,f*i+u*o,f*s+u*a,l+_*i+m*o,c+_*s+m*a)},t.clone=function(){return new r(this.a,this.b,this.c,this.d,this.e,this.f)},t.equals=function(n){var i=this.a,s=this.b,o=this.c,a=this.d,l=this.e,c=this.f;return i===n.a&&s===n.b&&o===n.c&&a===n.d&&l===n.e&&c===n.f},t.apply=function(n,i){i===void 0&&(i={});var s=n.x,o=n.y,a=this.a,l=this.b,c=this.c,h=this.d,f=this.e,d=this.f;return i.x=s*a+o*c+f||0,i.y=s*l+o*h+d||0,i},r}();function br(r,t,e,n){if(!r||!r.parentNode||(Zi||Tm(r)).documentElement===r)return new Mr;var i=Vy(r),s=Ch(r),o=s?Am:Dm,a=qy(r,e),l=o[0].getBoundingClientRect(),c=o[1].getBoundingClientRect(),h=o[2].getBoundingClientRect(),f=a.parentNode,d=!n&&Wy(r),u=new Mr((c.left-l.left)/100,(c.top-l.top)/100,(h.left-l.left)/100,(h.top-l.top)/100,l.left+(d?0:Gy()),l.top+(d?0:Hy()));if(f.removeChild(a),i)for(l=i.length;l--;)c=i[l],c.scaleX=c.scaleY=0,c.renderTransform(1,c);return t?u.inverse():u}function Cm(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Zy(r,t){r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.__proto__=t}var pe,be,Hn,pi,Ki,Rh,$i,Nh,Da,Ar,zm,Uh,La,zh,Ca,fi,Ra,Zl,Vm,Oh,$l=0,Hm=function(){return typeof window<"u"},Gm=function(){return pe||Hm()&&(pe=window.gsap)&&pe.registerPlugin&&pe},Tr=function(t){return typeof t=="function"},Pa=function(t){return typeof t=="object"},di=function(t){return typeof t>"u"},Jl=function(){return!1},Ia="transform",Bh="transformOrigin",wr=function(t){return Math.round(t*1e4)/1e4},Aa=Array.isArray,Yl=function(t,e){var n=Hn.createElementNS?Hn.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):Hn.createElement(t);return n.style?n:Hn.createElement(t)},Rm=180/Math.PI,gs=1e20,Jy=new Mr,Er=Date.now||function(){return new Date().getTime()},xs=[],oo={},$y=0,Ky=/^(?:a|input|textarea|button|select)$/i,Pm=0,ro={},Ji={},Wm=function(t,e){var n={},i;for(i in t)n[i]=e?t[i]*e:t[i];return n},jy=function(t,e){for(var n in e)n in t||(t[n]=e[n]);return t},Im=function r(t,e){for(var n=t.length,i;n--;)e?t[n].style.touchAction=e:t[n].style.removeProperty("touch-action"),i=t[n].children,i&&i.length&&r(i,e)},Xm=function(){return xs.forEach(function(t){return t()})},Qy=function(t){xs.push(t),xs.length===1&&pe.ticker.add(Xm)},Lm=function(){return!xs.length&&pe.ticker.remove(Xm)},Fm=function(t){for(var e=xs.length;e--;)xs[e]===t&&xs.splice(e,1);pe.to(Lm,{overwrite:!0,delay:15,duration:0,onComplete:Lm,data:"_draggable"})},tv=function(t,e){for(var n in e)n in t||(t[n]=e[n]);return t},Xe=function(t,e,n,i){if(t.addEventListener){var s=La[e];i=i||(zm?{passive:!1}:null),t.addEventListener(s||e,n,i),s&&e!==s&&t.addEventListener(e,n,i)}},Ve=function(t,e,n,i){if(t.removeEventListener){var s=La[e];t.removeEventListener(s||e,n,i),s&&e!==s&&t.removeEventListener(e,n,i)}},Qn=function(t){t.preventDefault&&t.preventDefault(),t.preventManipulation&&t.preventManipulation()},ev=function(t,e){for(var n=t.length;n--;)if(t[n].identifier===e)return!0},nv=function r(t){zh=t.touches&&$l<t.touches.length,Ve(t.target,"touchend",r)},Nm=function(t){zh=t.touches&&$l<t.touches.length,Xe(t.target,"touchend",nv)},ao=function(t){return be.pageYOffset||t.scrollTop||t.documentElement.scrollTop||t.body.scrollTop||0},lo=function(t){return be.pageXOffset||t.scrollLeft||t.documentElement.scrollLeft||t.body.scrollLeft||0},Um=function r(t,e){Xe(t,"scroll",e),co(t.parentNode)||r(t.parentNode,e)},Om=function r(t,e){Ve(t,"scroll",e),co(t.parentNode)||r(t.parentNode,e)},co=function(t){return!t||t===pi||t.nodeType===9||t===Hn.body||t===be||!t.nodeType||!t.parentNode},Bm=function(t,e){var n=e==="x"?"Width":"Height",i="scroll"+n,s="client"+n;return Math.max(0,co(t)?Math.max(pi[i],Ki[i])-(be["inner"+n]||pi[s]||Ki[s]):t[i]-t[s])},Ph=function r(t,e){var n=Bm(t,"x"),i=Bm(t,"y");co(t)?t=Ji:r(t.parentNode,e),t._gsMaxScrollX=n,t._gsMaxScrollY=i,e||(t._gsScrollX=t.scrollLeft||0,t._gsScrollY=t.scrollTop||0)},Ih=function(t,e,n){var i=t.style;i&&(di(i[e])&&(e=Da(e,t)||e),n==null?i.removeProperty&&i.removeProperty(e.replace(/([A-Z])/g,"-$1").toLowerCase()):i[e]=n)},Fa=function(t){return be.getComputedStyle(t instanceof Element?t:t.host||(t.parentNode||{}).host||t)},_s={},so=function(t){if(t===be)return _s.left=_s.top=0,_s.width=_s.right=pi.clientWidth||t.innerWidth||Ki.clientWidth||0,_s.height=_s.bottom=(t.innerHeight||0)-20<pi.clientHeight?pi.clientHeight:t.innerHeight||Ki.clientHeight||0,_s;var e=t.ownerDocument||Hn,n=di(t.pageX)?!t.nodeType&&!di(t.left)&&!di(t.top)?t:Ar(t)[0].getBoundingClientRect():{left:t.pageX-lo(e),top:t.pageY-ao(e),right:t.pageX-lo(e)+1,bottom:t.pageY-ao(e)+1};return di(n.right)&&!di(n.width)?(n.right=n.left+n.width,n.bottom=n.top+n.height):di(n.width)&&(n={width:n.right-n.left,height:n.bottom-n.top,right:n.right,left:n.left,bottom:n.bottom,top:n.top}),n},Ue=function(t,e,n){var i=t.vars,s=i[n],o=t._listeners[e],a;return Tr(s)&&(a=s.apply(i.callbackScope||t,i[n+"Params"]||[t.pointerEvent])),o&&t.dispatchEvent(e)===!1&&(a=!1),a},km=function(t,e){var n=Ar(t)[0],i,s,o;return!n.nodeType&&n!==be?di(t.left)?(s=t.min||t.minX||t.minRotation||0,i=t.min||t.minY||0,{left:s,top:i,width:(t.max||t.maxX||t.maxRotation||0)-s,height:(t.max||t.maxY||0)-i}):(o={x:0,y:0},{left:t.left-o.x,top:t.top-o.y,width:t.width,height:t.height}):iv(n,e)},ti={},iv=function(t,e){e=Ar(e)[0];var n=t.getBBox&&t.ownerSVGElement,i=t.ownerDocument||Hn,s,o,a,l,c,h,f,d,u,_,m,p,g;if(t===be)a=ao(i),s=lo(i),o=s+(i.documentElement.clientWidth||t.innerWidth||i.body.clientWidth||0),l=a+((t.innerHeight||0)-20<i.documentElement.clientHeight?i.documentElement.clientHeight:t.innerHeight||i.body.clientHeight||0);else{if(e===be||di(e))return t.getBoundingClientRect();s=a=0,n?(_=t.getBBox(),m=_.width,p=_.height):(t.viewBox&&(_=t.viewBox.baseVal)&&(s=_.x||0,a=_.y||0,m=_.width,p=_.height),m||(g=Fa(t),_=g.boxSizing==="border-box",m=(parseFloat(g.width)||t.clientWidth||0)+(_?0:parseFloat(g.borderLeftWidth)+parseFloat(g.borderRightWidth)),p=(parseFloat(g.height)||t.clientHeight||0)+(_?0:parseFloat(g.borderTopWidth)+parseFloat(g.borderBottomWidth)))),o=m,l=p}return t===e?{left:s,top:a,width:o-s,height:l-a}:(c=br(e,!0).multiply(br(t)),h=c.apply({x:s,y:a}),f=c.apply({x:o,y:a}),d=c.apply({x:o,y:l}),u=c.apply({x:s,y:l}),s=Math.min(h.x,f.x,d.x,u.x),a=Math.min(h.y,f.y,d.y,u.y),{left:s,top:a,width:Math.max(h.x,f.x,d.x,u.x)-s,height:Math.max(h.y,f.y,d.y,u.y)-a})},Lh=function(t,e,n,i,s,o){var a={},l,c,h;if(e)if(s!==1&&e instanceof Array){if(a.end=l=[],h=e.length,Pa(e[0]))for(c=0;c<h;c++)l[c]=Wm(e[c],s);else for(c=0;c<h;c++)l[c]=e[c]*s;n+=1.1,i-=1.1}else Tr(e)?a.end=function(f){var d=e.call(t,f),u,_;if(s!==1)if(Pa(d)){u={};for(_ in d)u[_]=d[_]*s;d=u}else d*=s;return d}:a.end=e;return(n||n===0)&&(a.max=n),(i||i===0)&&(a.min=i),o&&(a.velocity=0),a},rv=function r(t){var e;return!t||!t.getAttribute||t===Ki?!1:(e=t.getAttribute("data-clickable"))==="true"||e!=="false"&&(Ky.test(t.nodeName+"")||t.getAttribute("contentEditable")==="true")?!0:r(t.parentNode)},ql=function(t,e){for(var n=t.length,i;n--;)i=t[n],i.ondragstart=i.onselectstart=e?null:Jl,pe.set(i,{lazy:!0,userSelect:e?"text":"none"})},sv=function r(t){if(Fa(t).position==="fixed")return!0;if(t=t.parentNode,t&&t.nodeType===1)return r(t)},Ym,kh,ov=function(t,e){t=pe.utils.toArray(t)[0],e=e||{};var n=document.createElement("div"),i=n.style,s=t.firstChild,o=0,a=0,l=t.scrollTop,c=t.scrollLeft,h=t.scrollWidth,f=t.scrollHeight,d=0,u=0,_=0,m,p,g,b,v,S;Ym&&e.force3D!==!1?(v="translate3d(",S="px,0px)"):Ia&&(v="translate(",S="px)"),this.scrollTop=function(D,T){if(!arguments.length)return-this.top();this.top(-D,T)},this.scrollLeft=function(D,T){if(!arguments.length)return-this.left();this.left(-D,T)},this.left=function(D,T){if(!arguments.length)return-(t.scrollLeft+a);var w=t.scrollLeft-c,P=a;if((w>2||w<-2)&&!T){c=t.scrollLeft,pe.killTweensOf(this,{left:1,scrollLeft:1}),this.left(-c),e.onKill&&e.onKill();return}D=-D,D<0?(a=D-.5|0,D=0):D>u?(a=D-u|0,D=u):a=0,(a||P)&&(this._skip||(i[Ia]=v+-a+"px,"+-o+S),a+d>=0&&(i.paddingRight=a+d+"px")),t.scrollLeft=D|0,c=t.scrollLeft},this.top=function(D,T){if(!arguments.length)return-(t.scrollTop+o);var w=t.scrollTop-l,P=o;if((w>2||w<-2)&&!T){l=t.scrollTop,pe.killTweensOf(this,{top:1,scrollTop:1}),this.top(-l),e.onKill&&e.onKill();return}D=-D,D<0?(o=D-.5|0,D=0):D>_?(o=D-_|0,D=_):o=0,(o||P)&&(this._skip||(i[Ia]=v+-a+"px,"+-o+S)),t.scrollTop=D|0,l=t.scrollTop},this.maxScrollTop=function(){return _},this.maxScrollLeft=function(){return u},this.disable=function(){for(s=n.firstChild;s;)b=s.nextSibling,t.appendChild(s),s=b;t===n.parentNode&&t.removeChild(n)},this.enable=function(){if(s=t.firstChild,s!==n){for(;s;)b=s.nextSibling,n.appendChild(s),s=b;t.appendChild(n),this.calibrate()}},this.calibrate=function(D){var T=t.clientWidth===m,w,P,M;l=t.scrollTop,c=t.scrollLeft,!(T&&t.clientHeight===p&&n.offsetHeight===g&&h===t.scrollWidth&&f===t.scrollHeight&&!D)&&((o||a)&&(P=this.left(),M=this.top(),this.left(-t.scrollLeft),this.top(-t.scrollTop)),w=Fa(t),(!T||D)&&(i.display="block",i.width="auto",i.paddingRight="0px",d=Math.max(0,t.scrollWidth-t.clientWidth),d&&(d+=parseFloat(w.paddingLeft)+(kh?parseFloat(w.paddingRight):0))),i.display="inline-block",i.position="relative",i.overflow="visible",i.verticalAlign="top",i.boxSizing="content-box",i.width="100%",i.paddingRight=d+"px",kh&&(i.paddingBottom=w.paddingBottom),m=t.clientWidth,p=t.clientHeight,h=t.scrollWidth,f=t.scrollHeight,u=t.scrollWidth-m,_=t.scrollHeight-p,g=n.offsetHeight,i.display="block",(P||M)&&(this.left(P),this.top(M)))},this.content=n,this.element=t,this._skip=!1,this.enable()},Fh=function(t){if(Hm()&&document.body){var e=window&&window.navigator;be=window,Hn=document,pi=Hn.documentElement,Ki=Hn.body,Rh=Yl("div"),Zl=!!window.PointerEvent,$i=Yl("div"),$i.style.cssText="visibility:hidden;height:1px;top:-1px;pointer-events:none;position:relative;clear:both;cursor:grab",Ra=$i.style.cursor==="grab"?"grab":"move",Ca=e&&e.userAgent.toLowerCase().indexOf("android")!==-1,Uh="ontouchstart"in pi&&"orientation"in be||e&&(e.MaxTouchPoints>0||e.msMaxTouchPoints>0),kh=function(){var n=Yl("div"),i=Yl("div"),s=i.style,o=Ki,a;return s.display="inline-block",s.position="relative",n.style.cssText="width:90px;height:40px;padding:10px;overflow:auto;visibility:hidden",n.appendChild(i),o.appendChild(n),a=i.offsetHeight+18>n.scrollHeight,o.removeChild(n),a}(),La=function(n){for(var i=n.split(","),s=("onpointerdown"in Rh?"pointerdown,pointermove,pointerup,pointercancel":"onmspointerdown"in Rh?"MSPointerDown,MSPointerMove,MSPointerUp,MSPointerCancel":n).split(","),o={},a=4;--a>-1;)o[i[a]]=s[a],o[s[a]]=i[a];try{pi.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){zm=1}}))}catch{}return o}("touchstart,touchmove,touchend,touchcancel"),Xe(Hn,"touchcancel",Jl),Xe(be,"touchmove",Jl),Ki&&Ki.addEventListener("touchstart",Jl),Xe(Hn,"contextmenu",function(){for(var n in oo)oo[n].isPressed&&oo[n].endDrag()}),pe=Nh=Gm()}pe?(fi=pe.plugins.inertia,Vm=pe.core.context||function(){},Da=pe.utils.checkPrefix,Ia=Da(Ia),Bh=Da(Bh),Ar=pe.utils.toArray,Oh=pe.core.getStyleSaver,Ym=!!Da("perspective")):t&&console.warn("Please gsap.registerPlugin(Draggable)")},av=function(){function r(e){this._listeners={},this.target=e||this}var t=r.prototype;return t.addEventListener=function(n,i){var s=this._listeners[n]||(this._listeners[n]=[]);~s.indexOf(i)||s.push(i)},t.removeEventListener=function(n,i){var s=this._listeners[n],o=s&&s.indexOf(i);o>=0&&s.splice(o,1)},t.dispatchEvent=function(n){var i=this,s;return(this._listeners[n]||[]).forEach(function(o){return o.call(i,{type:n,target:i.target})===!1&&(s=!1)}),s},r}(),Pi=function(r){Zy(t,r);function t(e,n){var i;i=r.call(this)||this,Nh||Fh(1),e=Ar(e)[0],i.styles=Oh&&Oh(e,"transform,left,top"),fi||(fi=pe.plugins.inertia),i.vars=n=Wm(n||{}),i.target=e,i.x=i.y=i.rotation=0,i.dragResistance=parseFloat(n.dragResistance)||0,i.edgeResistance=isNaN(n.edgeResistance)?1:parseFloat(n.edgeResistance)||0,i.lockAxis=n.lockAxis,i.autoScroll=n.autoScroll||0,i.lockedAxis=null,i.allowEventDefault=!!n.allowEventDefault,pe.getProperty(e,"x");var s=(n.type||"x,y").toLowerCase(),o=~s.indexOf("x")||~s.indexOf("y"),a=s.indexOf("rotation")!==-1,l=a?"rotation":o?"x":"left",c=o?"y":"top",h=!!(~s.indexOf("x")||~s.indexOf("left")||s==="scroll"),f=!!(~s.indexOf("y")||~s.indexOf("top")||s==="scroll"),d=n.minimumMovement||2,u=Cm(i),_=Ar(n.trigger||n.handle||e),m={},p=0,g=!1,b=n.autoScrollMarginTop||40,v=n.autoScrollMarginRight||40,S=n.autoScrollMarginBottom||40,D=n.autoScrollMarginLeft||40,T=n.clickableTest||rv,w=0,P=e._gsap||pe.core.getCache(e),M=sv(e),y=function(L,rt){return parseFloat(P.get(e,L,rt))},I=e.ownerDocument||Hn,N,C,V,$,W,Z,z,U,R,at,_t,Ut,X,ot,xt,ct,Rt,kt,q,$t,It,Ft,bt,Et,Ht,G,jt,A,x,F,Y,tt,it,vt=function(L){return Qn(L),L.stopImmediatePropagation&&L.stopImmediatePropagation(),!1},pt=function Mt(L){if(u.autoScroll&&u.isDragging&&(g||Rt)){var rt=e,O=u.autoScroll*15,j,dt,et,wt,ft,Dt,zt,Nt;for(g=!1,Ji.scrollTop=be.pageYOffset!=null?be.pageYOffset:I.documentElement.scrollTop!=null?I.documentElement.scrollTop:I.body.scrollTop,Ji.scrollLeft=be.pageXOffset!=null?be.pageXOffset:I.documentElement.scrollLeft!=null?I.documentElement.scrollLeft:I.body.scrollLeft,wt=u.pointerX-Ji.scrollLeft,ft=u.pointerY-Ji.scrollTop;rt&&!dt;)dt=co(rt.parentNode),j=dt?Ji:rt.parentNode,et=dt?{bottom:Math.max(pi.clientHeight,be.innerHeight||0),right:Math.max(pi.clientWidth,be.innerWidth||0),left:0,top:0}:j.getBoundingClientRect(),Dt=zt=0,f&&(Nt=j._gsMaxScrollY-j.scrollTop,Nt<0?zt=Nt:ft>et.bottom-S&&Nt?(g=!0,zt=Math.min(Nt,O*(1-Math.max(0,et.bottom-ft)/S)|0)):ft<et.top+b&&j.scrollTop&&(g=!0,zt=-Math.min(j.scrollTop,O*(1-Math.max(0,ft-et.top)/b)|0)),zt&&(j.scrollTop+=zt)),h&&(Nt=j._gsMaxScrollX-j.scrollLeft,Nt<0?Dt=Nt:wt>et.right-v&&Nt?(g=!0,Dt=Math.min(Nt,O*(1-Math.max(0,et.right-wt)/v)|0)):wt<et.left+D&&j.scrollLeft&&(g=!0,Dt=-Math.min(j.scrollLeft,O*(1-Math.max(0,wt-et.left)/D)|0)),Dt&&(j.scrollLeft+=Dt)),dt&&(Dt||zt)&&(be.scrollTo(j.scrollLeft,j.scrollTop),st(u.pointerX+Dt,u.pointerY+zt)),rt=j}if(Rt){var ee=u.x,he=u.y;a?(u.deltaX=ee-parseFloat(P.rotation),u.rotation=ee,P.rotation=ee+"deg",P.renderTransform(1,P)):C?(f&&(u.deltaY=he-C.top(),C.top(he)),h&&(u.deltaX=ee-C.left(),C.left(ee))):o?(f&&(u.deltaY=he-parseFloat(P.y),P.y=he+"px"),h&&(u.deltaX=ee-parseFloat(P.x),P.x=ee+"px"),P.renderTransform(1,P)):(f&&(u.deltaY=he-parseFloat(e.style.top||0),e.style.top=he+"px"),h&&(u.deltaX=ee-parseFloat(e.style.left||0),e.style.left=ee+"px")),U&&!L&&!A&&(A=!0,Ue(u,"drag","onDrag")===!1&&(h&&(u.x-=u.deltaX),f&&(u.y-=u.deltaY),Mt(!0)),A=!1)}Rt=!1},lt=function(L,rt){var O=u.x,j=u.y,dt,et;e._gsap||(P=pe.core.getCache(e)),P.uncache&&pe.getProperty(e,"x"),o?(u.x=parseFloat(P.x),u.y=parseFloat(P.y)):a?u.x=u.rotation=parseFloat(P.rotation):C?(u.y=C.top(),u.x=C.left()):(u.y=parseFloat(e.style.top||(et=Fa(e))&&et.top)||0,u.x=parseFloat(e.style.left||(et||{}).left)||0),(q||$t||It)&&!rt&&(u.isDragging||u.isThrowing)&&(It&&(ro.x=u.x,ro.y=u.y,dt=It(ro),dt.x!==u.x&&(u.x=dt.x,Rt=!0),dt.y!==u.y&&(u.y=dt.y,Rt=!0)),q&&(dt=q(u.x),dt!==u.x&&(u.x=dt,a&&(u.rotation=dt),Rt=!0)),$t&&(dt=$t(u.y),dt!==u.y&&(u.y=dt),Rt=!0)),Rt&&pt(!0),L||(u.deltaX=u.x-O,u.deltaY=u.y-j,Ue(u,"throwupdate","onThrowUpdate"))},Lt=function(L,rt,O,j){return rt==null&&(rt=-gs),O==null&&(O=gs),Tr(L)?function(dt){var et=u.isPressed?1-u.edgeResistance:1;return L.call(u,(dt>O?O+(dt-O)*et:dt<rt?rt+(dt-rt)*et:dt)*j)*j}:Aa(L)?function(dt){for(var et=L.length,wt=0,ft=gs,Dt,zt;--et>-1;)Dt=L[et],zt=Dt-dt,zt<0&&(zt=-zt),zt<ft&&Dt>=rt&&Dt<=O&&(wt=et,ft=zt);return L[wt]}:isNaN(L)?function(dt){return dt}:function(){return L*j}},ht=function(L,rt,O,j,dt,et,wt){return et=et&&et<gs?et*et:gs,Tr(L)?function(ft){var Dt=u.isPressed?1-u.edgeResistance:1,zt=ft.x,Nt=ft.y,ee,he,me;return ft.x=zt=zt>O?O+(zt-O)*Dt:zt<rt?rt+(zt-rt)*Dt:zt,ft.y=Nt=Nt>dt?dt+(Nt-dt)*Dt:Nt<j?j+(Nt-j)*Dt:Nt,ee=L.call(u,ft),ee!==ft&&(ft.x=ee.x,ft.y=ee.y),wt!==1&&(ft.x*=wt,ft.y*=wt),et<gs&&(he=ft.x-zt,me=ft.y-Nt,he*he+me*me>et&&(ft.x=zt,ft.y=Nt)),ft}:Aa(L)?function(ft){for(var Dt=L.length,zt=0,Nt=gs,ee,he,me,ae;--Dt>-1;)me=L[Dt],ee=me.x-ft.x,he=me.y-ft.y,ae=ee*ee+he*he,ae<Nt&&(zt=Dt,Nt=ae);return Nt<=et?L[zt]:ft}:function(ft){return ft}},yt=function(){var L,rt,O,j;z=!1,C?(C.calibrate(),u.minX=_t=-C.maxScrollLeft(),u.minY=X=-C.maxScrollTop(),u.maxX=at=u.maxY=Ut=0,z=!0):n.bounds&&(L=km(n.bounds,e.parentNode),a?(u.minX=_t=L.left,u.maxX=at=L.left+L.width,u.minY=X=u.maxY=Ut=0):!di(n.bounds.maxX)||!di(n.bounds.maxY)?(L=n.bounds,u.minX=_t=L.minX,u.minY=X=L.minY,u.maxX=at=L.maxX,u.maxY=Ut=L.maxY):(rt=km(e,e.parentNode),u.minX=_t=Math.round(y(l,"px")+L.left-rt.left),u.minY=X=Math.round(y(c,"px")+L.top-rt.top),u.maxX=at=Math.round(_t+(L.width-rt.width)),u.maxY=Ut=Math.round(X+(L.height-rt.height))),_t>at&&(u.minX=at,u.maxX=at=_t,_t=u.minX),X>Ut&&(u.minY=Ut,u.maxY=Ut=X,X=u.minY),a&&(u.minRotation=_t,u.maxRotation=at),z=!0),n.liveSnap&&(O=n.liveSnap===!0?n.snap||{}:n.liveSnap,j=Aa(O)||Tr(O),a?(q=Lt(j?O:O.rotation,_t,at,1),$t=null):O.points?It=ht(j?O:O.points,_t,at,X,Ut,O.radius,C?-1:1):(h&&(q=Lt(j?O:O.x||O.left||O.scrollLeft,_t,at,C?-1:1)),f&&($t=Lt(j?O:O.y||O.top||O.scrollTop,X,Ut,C?-1:1))))},qt=function(){u.isThrowing=!1,Ue(u,"throwcomplete","onThrowComplete")},ut=function(){u.isThrowing=!1},Tt=function(L,rt){var O,j,dt,et;L&&fi?(L===!0&&(O=n.snap||n.liveSnap||{},j=Aa(O)||Tr(O),L={resistance:(n.throwResistance||n.resistance||1e3)/(a?10:1)},a?L.rotation=Lh(u,j?O:O.rotation,at,_t,1,rt):(h&&(L[l]=Lh(u,j?O:O.points||O.x||O.left,at,_t,C?-1:1,rt||u.lockedAxis==="x")),f&&(L[c]=Lh(u,j?O:O.points||O.y||O.top,Ut,X,C?-1:1,rt||u.lockedAxis==="y")),(O.points||Aa(O)&&Pa(O[0]))&&(L.linkedProps=l+","+c,L.radius=O.radius))),u.isThrowing=!0,et=isNaN(n.overshootTolerance)?n.edgeResistance===1?0:1-u.edgeResistance+.2:n.overshootTolerance,L.duration||(L.duration={max:Math.max(n.minDuration||0,"maxDuration"in n?n.maxDuration:2),min:isNaN(n.minDuration)?et===0||Pa(L)&&L.resistance>1e3?0:.5:n.minDuration,overshoot:et}),u.tween=dt=pe.to(C||e,{inertia:L,data:"_draggable",inherit:!1,onComplete:qt,onInterrupt:ut,onUpdate:n.fastMode?Ue:lt,onUpdateParams:n.fastMode?[u,"onthrowupdate","onThrowUpdate"]:O&&O.radius?[!1,!0]:[]}),n.fastMode||(C&&(C._skip=!0),dt.render(1e9,!0,!0),lt(!0,!0),u.endX=u.x,u.endY=u.y,a&&(u.endRotation=u.x),dt.play(0),lt(!0,!0),C&&(C._skip=!1))):z&&u.applyBounds()},Wt=function(L){var rt=Et,O;Et=br(e.parentNode,!0),L&&u.isPressed&&!Et.equals(rt||new Mr)&&(O=rt.inverse().apply({x:V,y:$}),Et.apply(O,O),V=O.x,$=O.y),Et.equals(Jy)&&(Et=null)},Zt=function(){var L=1-u.edgeResistance,rt=M?lo(I):0,O=M?ao(I):0,j,dt,et;o&&(P.x=y(l,"px")+"px",P.y=y(c,"px")+"px",P.renderTransform()),Wt(!1),ti.x=u.pointerX-rt,ti.y=u.pointerY-O,Et&&Et.apply(ti,ti),V=ti.x,$=ti.y,Rt&&(st(u.pointerX,u.pointerY),pt(!0)),tt=br(e),C?(yt(),Z=C.top(),W=C.left()):(ue()?(lt(!0,!0),yt()):u.applyBounds(),a?(j=e.ownerSVGElement?[P.xOrigin-e.getBBox().x,P.yOrigin-e.getBBox().y]:(Fa(e)[Bh]||"0 0").split(" "),ct=u.rotationOrigin=br(e).apply({x:parseFloat(j[0])||0,y:parseFloat(j[1])||0}),lt(!0,!0),dt=u.pointerX-ct.x-rt,et=ct.y-u.pointerY+O,W=u.x,Z=u.y=Math.atan2(et,dt)*Rm):(Z=y(c,"px"),W=y(l,"px"))),z&&L&&(W>at?W=at+(W-at)/L:W<_t&&(W=_t-(_t-W)/L),a||(Z>Ut?Z=Ut+(Z-Ut)/L:Z<X&&(Z=X-(X-Z)/L))),u.startX=W=wr(W),u.startY=Z=wr(Z)},ue=function(){return u.tween&&u.tween.isActive()},Jt=function(){$i.parentNode&&!ue()&&!u.isDragging&&$i.parentNode.removeChild($i)},k=function(L,rt){var O;if(!N||u.isPressed||!L||(L.type==="mousedown"||L.type==="pointerdown")&&!rt&&Er()-w<30&&La[u.pointerEvent.type]){Y&&L&&N&&Qn(L);return}if(Ht=ue(),it=!1,u.pointerEvent=L,La[L.type]?(bt=~L.type.indexOf("touch")?L.currentTarget||L.target:I,Xe(bt,"touchend",mt),Xe(bt,"touchmove",Q),Xe(bt,"touchcancel",mt),Xe(I,"touchstart",Nm)):(bt=null,Xe(I,"mousemove",Q)),jt=null,(!Zl||!bt)&&(Xe(I,"mouseup",mt),L&&L.target&&Xe(L.target,"mouseup",mt)),Ft=T.call(u,L.target)&&n.dragClickables===!1&&!rt,Ft){Xe(L.target,"change",mt),Ue(u,"pressInit","onPressInit"),Ue(u,"press","onPress"),ql(_,!0),Y=!1;return}if(G=!bt||h===f||u.vars.allowNativeTouchScrolling===!1||u.vars.allowContextMenu&&L&&(L.ctrlKey||L.which>2)?!1:h?"y":"x",Y=!G&&!u.allowEventDefault,Y&&(Qn(L),Xe(be,"touchforcechange",Qn)),L.changedTouches?(L=ot=L.changedTouches[0],xt=L.identifier):L.pointerId?xt=L.pointerId:ot=xt=null,$l++,Qy(pt),$=u.pointerY=L.pageY,V=u.pointerX=L.pageX,Ue(u,"pressInit","onPressInit"),(G||u.autoScroll)&&Ph(e.parentNode),e.parentNode&&u.autoScroll&&!C&&!a&&e.parentNode._gsMaxScrollX&&!$i.parentNode&&!e.getBBox&&($i.style.width=e.parentNode.scrollWidth+"px",e.parentNode.appendChild($i)),Zt(),u.tween&&u.tween.kill(),u.isThrowing=!1,pe.killTweensOf(C||e,m,!0),C&&pe.killTweensOf(e,{scrollTo:1},!0),u.tween=u.lockedAxis=null,(n.zIndexBoost||!a&&!C&&n.zIndexBoost!==!1)&&(e.style.zIndex=t.zIndex++),u.isPressed=!0,U=!!(n.onDrag||u._listeners.drag),R=!!(n.onMove||u._listeners.move),n.cursor!==!1||n.activeCursor)for(O=_.length;--O>-1;)pe.set(_[O],{cursor:n.activeCursor||n.cursor||(Ra==="grab"?"grabbing":Ra)});Ue(u,"press","onPress")},Q=function(L){var rt=L,O,j,dt,et,wt,ft;if(!N||zh||!u.isPressed||!L){Y&&L&&N&&Qn(L);return}if(u.pointerEvent=L,O=L.changedTouches,O){if(L=O[0],L!==ot&&L.identifier!==xt){for(et=O.length;--et>-1&&(L=O[et]).identifier!==xt&&L.target!==e;);if(et<0)return}}else if(L.pointerId&&xt&&L.pointerId!==xt)return;if(bt&&G&&!jt&&(ti.x=L.pageX-(M?lo(I):0),ti.y=L.pageY-(M?ao(I):0),Et&&Et.apply(ti,ti),j=ti.x,dt=ti.y,wt=Math.abs(j-V),ft=Math.abs(dt-$),(wt!==ft&&(wt>d||ft>d)||Ca&&G===jt)&&(jt=wt>ft&&h?"x":"y",G&&jt!==G&&Xe(be,"touchforcechange",Qn),u.vars.lockAxisOnTouchScroll!==!1&&h&&f&&(u.lockedAxis=jt==="x"?"y":"x",Tr(u.vars.onLockAxis)&&u.vars.onLockAxis.call(u,rt)),Ca&&G===jt))){mt(rt);return}!u.allowEventDefault&&(!G||jt&&G!==jt)&&rt.cancelable!==!1?(Qn(rt),Y=!0):Y&&(Y=!1),u.autoScroll&&(g=!0),st(L.pageX,L.pageY,R)},st=function(L,rt,O){var j=1-u.dragResistance,dt=1-u.edgeResistance,et=u.pointerX,wt=u.pointerY,ft=Z,Dt=u.x,zt=u.y,Nt=u.endX,ee=u.endY,he=u.endRotation,me=Rt,ae,E,B,H,K,J;u.pointerX=L,u.pointerY=rt,M&&(L-=lo(I),rt-=ao(I)),a?(H=Math.atan2(ct.y-rt,L-ct.x)*Rm,K=u.y-H,K>180?(Z-=360,u.y=H):K<-180&&(Z+=360,u.y=H),u.x!==W||Math.abs(Z-H)>d?(u.y=H,B=W+(Z-H)*j):B=W):(Et&&(J=L*Et.a+rt*Et.c+Et.e,rt=L*Et.b+rt*Et.d+Et.f,L=J),E=rt-$,ae=L-V,E<d&&E>-d&&(E=0),ae<d&&ae>-d&&(ae=0),(u.lockAxis||u.lockedAxis)&&(ae||E)&&(J=u.lockedAxis,J||(u.lockedAxis=J=h&&Math.abs(ae)>Math.abs(E)?"y":f?"x":null,J&&Tr(u.vars.onLockAxis)&&u.vars.onLockAxis.call(u,u.pointerEvent)),J==="y"?E=0:J==="x"&&(ae=0)),B=wr(W+ae*j),H=wr(Z+E*j)),(q||$t||It)&&(u.x!==B||u.y!==H&&!a)&&(It&&(ro.x=B,ro.y=H,J=It(ro),B=wr(J.x),H=wr(J.y)),q&&(B=wr(q(B))),$t&&(H=wr($t(H)))),z&&(B>at?B=at+Math.round((B-at)*dt):B<_t&&(B=_t+Math.round((B-_t)*dt)),a||(H>Ut?H=Math.round(Ut+(H-Ut)*dt):H<X&&(H=Math.round(X+(H-X)*dt)))),(u.x!==B||u.y!==H&&!a)&&(a?(u.endRotation=u.x=u.endX=B,Rt=!0):(f&&(u.y=u.endY=H,Rt=!0),h&&(u.x=u.endX=B,Rt=!0)),!O||Ue(u,"move","onMove")!==!1?!u.isDragging&&u.isPressed&&(u.isDragging=it=!0,Ue(u,"dragstart","onDragStart")):(u.pointerX=et,u.pointerY=wt,Z=ft,u.x=Dt,u.y=zt,u.endX=Nt,u.endY=ee,u.endRotation=he,Rt=me))},mt=function Mt(L,rt){if(!N||!u.isPressed||L&&xt!=null&&!rt&&(L.pointerId&&L.pointerId!==xt&&L.target!==e||L.changedTouches&&!ev(L.changedTouches,xt))){Y&&L&&N&&Qn(L);return}u.isPressed=!1;var O=L,j=u.isDragging,dt=u.vars.allowContextMenu&&L&&(L.ctrlKey||L.which>2),et=pe.delayedCall(.001,Jt),wt,ft,Dt,zt,Nt;if(bt?(Ve(bt,"touchend",Mt),Ve(bt,"touchmove",Q),Ve(bt,"touchcancel",Mt),Ve(I,"touchstart",Nm)):Ve(I,"mousemove",Q),Ve(be,"touchforcechange",Qn),(!Zl||!bt)&&(Ve(I,"mouseup",Mt),L&&L.target&&Ve(L.target,"mouseup",Mt)),Rt=!1,j&&(p=Pm=Er(),u.isDragging=!1),Fm(pt),Ft&&!dt){L&&(Ve(L.target,"change",Mt),u.pointerEvent=O),ql(_,!1),Ue(u,"release","onRelease"),Ue(u,"click","onClick"),Ft=!1;return}for(ft=_.length;--ft>-1;)Ih(_[ft],"cursor",n.cursor||(n.cursor!==!1?Ra:null));if($l--,L){if(wt=L.changedTouches,wt&&(L=wt[0],L!==ot&&L.identifier!==xt)){for(ft=wt.length;--ft>-1&&(L=wt[ft]).identifier!==xt&&L.target!==e;);if(ft<0&&!rt)return}u.pointerEvent=O,u.pointerX=L.pageX,u.pointerY=L.pageY}return dt&&O?(Qn(O),Y=!0,Ue(u,"release","onRelease")):O&&!j?(Y=!1,Ht&&(n.snap||n.bounds)&&Tt(n.inertia||n.throwProps),Ue(u,"release","onRelease"),(!Ca||O.type!=="touchmove")&&O.type.indexOf("cancel")===-1&&(Ue(u,"click","onClick"),Er()-w<300&&Ue(u,"doubleclick","onDoubleClick"),zt=O.target||e,w=Er(),Nt=function(){w!==x&&u.enabled()&&!u.isPressed&&!O.defaultPrevented&&(zt.click?zt.click():I.createEvent&&(Dt=I.createEvent("MouseEvents"),Dt.initMouseEvent("click",!0,!0,be,1,u.pointerEvent.screenX,u.pointerEvent.screenY,u.pointerX,u.pointerY,!1,!1,!1,!1,0,null),zt.dispatchEvent(Dt)))},!Ca&&!O.defaultPrevented&&pe.delayedCall(.05,Nt))):(Tt(n.inertia||n.throwProps),!u.allowEventDefault&&O&&(n.dragClickables!==!1||!T.call(u,O.target))&&j&&(!G||jt&&G===jt)&&O.cancelable!==!1?(Y=!0,Qn(O)):Y=!1,Ue(u,"release","onRelease")),ue()&&et.duration(u.tween.duration()),j&&Ue(u,"dragend","onDragEnd"),!0},gt=function(L){if(L&&u.isDragging&&!C){var rt=L.target||e.parentNode,O=rt.scrollLeft-rt._gsScrollX,j=rt.scrollTop-rt._gsScrollY;(O||j)&&(Et?(V-=O*Et.a+j*Et.c,$-=j*Et.d+O*Et.b):(V-=O,$-=j),rt._gsScrollX+=O,rt._gsScrollY+=j,st(u.pointerX,u.pointerY))}},Bt=function(L){var rt=Er(),O=rt-w<100,j=rt-p<50,dt=O&&x===w,et=u.pointerEvent&&u.pointerEvent.defaultPrevented,wt=O&&F===w,ft=L.isTrusted||L.isTrusted==null&&O&&dt;if((dt||j&&u.vars.suppressClickOnDrag!==!1)&&L.stopImmediatePropagation&&L.stopImmediatePropagation(),O&&!(u.pointerEvent&&u.pointerEvent.defaultPrevented)&&(!dt||ft&&!wt)){ft&&dt&&(F=w),x=w;return}(u.isPressed||j||O)&&(!ft||!L.detail||!O||et)&&Qn(L),!O&&!j&&!it&&(L&&L.target&&(u.pointerEvent=L),Ue(u,"click","onClick"))},ne=function(L){return Et?{x:L.x*Et.a+L.y*Et.c+Et.e,y:L.x*Et.b+L.y*Et.d+Et.f}:{x:L.x,y:L.y}};return kt=t.get(e),kt&&kt.kill(),i.startDrag=function(Mt,L){var rt,O,j,dt;k(Mt||u.pointerEvent,!0),L&&!u.hitTest(Mt||u.pointerEvent)&&(rt=so(Mt||u.pointerEvent),O=so(e),j=ne({x:rt.left+rt.width/2,y:rt.top+rt.height/2}),dt=ne({x:O.left+O.width/2,y:O.top+O.height/2}),V-=j.x-dt.x,$-=j.y-dt.y),u.isDragging||(u.isDragging=it=!0,Ue(u,"dragstart","onDragStart"))},i.drag=Q,i.endDrag=function(Mt){return mt(Mt||u.pointerEvent,!0)},i.timeSinceDrag=function(){return u.isDragging?0:(Er()-p)/1e3},i.timeSinceClick=function(){return(Er()-w)/1e3},i.hitTest=function(Mt,L){return t.hitTest(u.target,Mt,L)},i.getDirection=function(Mt,L){var rt=Mt==="velocity"&&fi?Mt:Pa(Mt)&&!a?"element":"start",O,j,dt,et,wt,ft;return rt==="element"&&(wt=so(u.target),ft=so(Mt)),O=rt==="start"?u.x-W:rt==="velocity"?fi.getVelocity(e,l):wt.left+wt.width/2-(ft.left+ft.width/2),a?O<0?"counter-clockwise":"clockwise":(L=L||2,j=rt==="start"?u.y-Z:rt==="velocity"?fi.getVelocity(e,c):wt.top+wt.height/2-(ft.top+ft.height/2),dt=Math.abs(O/j),et=dt<1/L?"":O<0?"left":"right",dt<L&&(et!==""&&(et+="-"),et+=j<0?"up":"down"),et)},i.applyBounds=function(Mt,L){var rt,O,j,dt,et,wt;if(Mt&&n.bounds!==Mt)return n.bounds=Mt,u.update(!0,L);if(lt(!0),yt(),z&&!ue()){if(rt=u.x,O=u.y,rt>at?rt=at:rt<_t&&(rt=_t),O>Ut?O=Ut:O<X&&(O=X),(u.x!==rt||u.y!==O)&&(j=!0,u.x=u.endX=rt,a?u.endRotation=rt:u.y=u.endY=O,Rt=!0,pt(!0),u.autoScroll&&!u.isDragging))for(Ph(e.parentNode),dt=e,Ji.scrollTop=be.pageYOffset!=null?be.pageYOffset:I.documentElement.scrollTop!=null?I.documentElement.scrollTop:I.body.scrollTop,Ji.scrollLeft=be.pageXOffset!=null?be.pageXOffset:I.documentElement.scrollLeft!=null?I.documentElement.scrollLeft:I.body.scrollLeft;dt&&!wt;)wt=co(dt.parentNode),et=wt?Ji:dt.parentNode,f&&et.scrollTop>et._gsMaxScrollY&&(et.scrollTop=et._gsMaxScrollY),h&&et.scrollLeft>et._gsMaxScrollX&&(et.scrollLeft=et._gsMaxScrollX),dt=et;u.isThrowing&&(j||u.endX>at||u.endX<_t||u.endY>Ut||u.endY<X)&&Tt(n.inertia||n.throwProps,j)}return u},i.update=function(Mt,L,rt){if(L&&u.isPressed){var O=br(e),j=tt.apply({x:u.x-W,y:u.y-Z}),dt=br(e.parentNode,!0);dt.apply({x:O.e-j.x,y:O.f-j.y},j),u.x-=j.x-dt.e,u.y-=j.y-dt.f,pt(!0),Zt()}var et=u.x,wt=u.y;return Wt(!L),Mt?u.applyBounds():(Rt&&rt&&pt(!0),lt(!0)),L&&(st(u.pointerX,u.pointerY),Rt&&pt(!0)),u.isPressed&&!L&&(h&&Math.abs(et-u.x)>.01||f&&Math.abs(wt-u.y)>.01&&!a)&&Zt(),u.autoScroll&&(Ph(e.parentNode,u.isDragging),g=u.isDragging,pt(!0),Om(e,gt),Um(e,gt)),u},i.enable=function(Mt){var L={lazy:!0},rt,O,j;if(n.cursor!==!1&&(L.cursor=n.cursor||Ra),pe.utils.checkPrefix("touchCallout")&&(L.touchCallout="none"),Mt!=="soft"){for(Im(_,h===f?"none":n.allowNativeTouchScrolling&&e.scrollHeight===e.clientHeight==(e.scrollWidth===e.clientHeight)||n.allowEventDefault?"manipulation":h?"pan-y":"pan-x"),O=_.length;--O>-1;)j=_[O],Zl||Xe(j,"mousedown",k),Xe(j,"touchstart",k),Xe(j,"click",Bt,!0),pe.set(j,L),j.getBBox&&j.ownerSVGElement&&h!==f&&pe.set(j.ownerSVGElement,{touchAction:n.allowNativeTouchScrolling||n.allowEventDefault?"manipulation":h?"pan-y":"pan-x"}),n.allowContextMenu||Xe(j,"contextmenu",vt);ql(_,!1)}return Um(e,gt),N=!0,fi&&Mt!=="soft"&&fi.track(C||e,o?"x,y":a?"rotation":"top,left"),e._gsDragID=rt="d"+$y++,oo[rt]=u,C&&(C.enable(),C.element._gsDragID=rt),(n.bounds||a)&&Zt(),n.bounds&&u.applyBounds(),u},i.disable=function(Mt){for(var L=u.isDragging,rt=_.length,O;--rt>-1;)Ih(_[rt],"cursor",null);if(Mt!=="soft"){for(Im(_,null),rt=_.length;--rt>-1;)O=_[rt],Ih(O,"touchCallout",null),Ve(O,"mousedown",k),Ve(O,"touchstart",k),Ve(O,"click",Bt,!0),Ve(O,"contextmenu",vt);ql(_,!0),bt&&(Ve(bt,"touchcancel",mt),Ve(bt,"touchend",mt),Ve(bt,"touchmove",Q)),Ve(I,"mouseup",mt),Ve(I,"mousemove",Q)}return Om(e,gt),N=!1,fi&&Mt!=="soft"&&(fi.untrack(C||e,o?"x,y":a?"rotation":"top,left"),u.tween&&u.tween.kill()),C&&C.disable(),Fm(pt),u.isDragging=u.isPressed=Ft=!1,L&&Ue(u,"dragend","onDragEnd"),u},i.enabled=function(Mt,L){return arguments.length?Mt?u.enable(L):u.disable(L):N},i.kill=function(){return u.isThrowing=!1,u.tween&&u.tween.kill(),u.disable(),pe.set(_,{clearProps:"userSelect"}),delete oo[e._gsDragID],u},i.revert=function(){this.kill(),this.styles&&this.styles.revert()},~s.indexOf("scroll")&&(C=i.scrollProxy=new ov(e,jy({onKill:function(){u.isPressed&&mt(null)}},n)),e.style.overflowY=f&&!Uh?"auto":"hidden",e.style.overflowX=h&&!Uh?"auto":"hidden",e=C.content),a?m.rotation=1:(h&&(m[l]=1),f&&(m[c]=1)),P.force3D="force3D"in n?n.force3D:!0,Vm(Cm(i)),i.enable(),i}return t.register=function(n){pe=n,Fh()},t.create=function(n,i){return Nh||Fh(!0),Ar(n).map(function(s){return new t(s,i)})},t.get=function(n){return oo[(Ar(n)[0]||{})._gsDragID]},t.timeSinceDrag=function(){return(Er()-Pm)/1e3},t.hitTest=function(n,i,s){if(n===i)return!1;var o=so(n),a=so(i),l=o.top,c=o.left,h=o.right,f=o.bottom,d=o.width,u=o.height,_=a.left>h||a.right<c||a.top>f||a.bottom<l,m,p,g;return _||!s?!_:(g=(s+"").indexOf("%")!==-1,s=parseFloat(s)||0,m={left:Math.max(c,a.left),top:Math.max(l,a.top)},m.width=Math.min(h,a.right)-m.left,m.height=Math.min(f,a.bottom)-m.top,m.width<0||m.height<0?!1:g?(s*=.01,p=m.width*m.height,p>=d*u*s||p>=a.width*a.height*s):m.width>s&&m.height>s)},t}(av);tv(Pi.prototype,{pointerX:0,pointerY:0,startX:0,startY:0,deltaX:0,deltaY:0,isDragging:!1,isPressed:!1});Pi.zIndex=1e3;Pi.version="3.12.5";Gm()&&pe.registerPlugin(Pi);var Ii,Hh,Ua,Zm,uo,ho,Kl,Jm,$m,Km=function(){return Ii||typeof window<"u"&&(Ii=window.gsap)},Gh={},lv=function(t){return Math.round(t*1e4)/1e4},Wh=function(t){return $m(t).id},Na=function(t){return Gh[Wh(typeof t=="string"?Ua(t)[0]:t)]},qm=function(t){var e=uo,n;if(t-Kl>=.05)for(Jm=Kl,Kl=t;e;)n=e.g(e.t,e.p),(n!==e.v1||t-e.t1>.2)&&(e.v2=e.v1,e.v1=n,e.t2=e.t1,e.t1=t),e=e._next},cv={deg:360,rad:Math.PI*2},Vh=function(){Ii=Km(),Ii&&(Ua=Ii.utils.toArray,Zm=Ii.utils.getUnit,$m=Ii.core.getCache,ho=Ii.ticker,Hh=1)},uv=function(t,e,n,i){this.t=t,this.p=e,this.g=t._gsap.get,this.rCap=cv[n||Zm(this.g(t,e))],this.v1=this.v2=0,this.t1=this.t2=ho.time,i&&(this._next=i,i._prev=this)},fo=function(){function r(e,n){Hh||Vh(),this.target=Ua(e)[0],Gh[Wh(this.target)]=this,this._props={},n&&this.add(n)}r.register=function(n){Ii=n,Vh()};var t=r.prototype;return t.get=function(n,i){var s=this._props[n]||console.warn("Not tracking "+n+" velocity."),o,a,l;return o=parseFloat(i?s.v1:s.g(s.t,s.p)),a=o-parseFloat(s.v2),l=s.rCap,l&&(a=a%l,a!==a%(l/2)&&(a=a<0?a+l:a-l)),lv(a/((i?s.t1:ho.time)-s.t2))},t.getAll=function(){var n={},i=this._props,s;for(s in i)n[s]=this.get(s);return n},t.isTracking=function(n){return n in this._props},t.add=function(n,i){n in this._props||(uo||(ho.add(qm),Kl=Jm=ho.time),uo=this._props[n]=new uv(this.target,n,i,uo))},t.remove=function(n){var i=this._props[n],s,o;i&&(s=i._prev,o=i._next,s&&(s._next=o),o?o._prev=s:uo===i&&(ho.remove(qm),uo=0),delete this._props[n])},t.kill=function(n){for(var i in this._props)this.remove(i);n||delete Gh[Wh(this.target)]},r.track=function(n,i,s){Hh||Vh();for(var o=[],a=Ua(n),l=i.split(","),c=(s||"").split(","),h=a.length,f,d;h--;){for(f=Na(a[h])||new r(a[h]),d=l.length;d--;)f.add(l[d],c[d]||c[0]);o.push(f)}return o},r.untrack=function(n,i){var s=(i||"").split(",");Ua(n).forEach(function(o){var a=Na(o);a&&(s.length?s.forEach(function(l){return a.remove(l)}):a.kill(1))})},r.isTracking=function(n,i){var s=Na(n);return s&&s.isTracking(i)},r.getVelocity=function(n,i){var s=Na(n);return!s||!s.isTracking(i)?console.warn("Not tracking velocity of "+i):s.get(i)},r}();fo.getByTarget=Na;Km()&&Ii.registerPlugin(fo);var Ye,ig,jm,rg,Xh,Oa,sg,og,ag,Zh,lg,Ba,Yh,cg,jl=fo.getByTarget,ug=function(){return Ye||typeof window<"u"&&(Ye=window.gsap)&&Ye.registerPlugin&&Ye},hv=function(t){return typeof t=="string"},ka=function(t){return typeof t=="number"},Dr=function(t){return typeof t=="object"},qh=function(t){return typeof t=="function"},fv=1,hg=Array.isArray,dv=function(t){return t},ys=1e10,Qm=1/ys,fg=.05,pv=function(t){return Math.round(t*1e4)/1e4},mv=function(t,e,n){for(var i in e)!(i in t)&&i!==n&&(t[i]=e[i]);return t},gv=function r(t){var e={},n,i;for(n in t)e[n]=Dr(i=t[n])&&!hg(i)?r(i):i;return e},tg=function(t,e,n,i,s){var o=e.length,a=0,l=ys,c,h,f,d;if(Dr(t)){for(;o--;){c=e[o],h=0;for(f in t)d=c[f]-t[f],h+=d*d;h<l&&(a=o,l=h)}if((s||ys)<ys&&s<Math.sqrt(l))return t}else for(;o--;)c=e[o],h=c-t,h<0&&(h=-h),h<l&&c>=i&&c<=n&&(a=o,l=h);return e[a]},dg=function(t,e,n,i,s,o,a){if(t.end==="auto")return t;var l=t.end,c,h;if(n=isNaN(n)?ys:n,i=isNaN(i)?-ys:i,Dr(e)){if(c=e.calculated?e:(qh(l)?l(e,a):tg(e,l,n,i,o))||e,!e.calculated){for(h in c)e[h]=c[h];e.calculated=!0}c=c[s]}else c=qh(l)?l(e,a):hg(l)?tg(e,l,n,i,o):parseFloat(l);return c>n?c=n:c<i&&(c=i),{max:c,min:c,unitFactor:t.unitFactor}},Ql=function(t,e,n){return isNaN(t[e])?n:+t[e]},Jh=function(t,e){return e*fg*t/Zh},eg=function(t,e,n){return Math.abs((e-t)*Zh/n/fg)},pg={resistance:1,checkpoint:1,preventOvershoot:1,linkedProps:1,radius:1,duration:1},mg=function(t,e,n,i){if(e.linkedProps){var s=e.linkedProps.split(","),o={},a,l,c,h,f,d;for(a=0;a<s.length;a++)l=s[a],c=e[l],c&&(ka(c.velocity)?h=c.velocity:(f=f||jl(t),h=f&&f.isTracking(l)?f.get(l):0),d=Math.abs(h/Ql(c,"resistance",i)),o[l]=parseFloat(n(t,l))+Jh(h,d));return o}},_v=function(t,e,n,i,s,o){if(n===void 0&&(n=10),i===void 0&&(i=.2),s===void 0&&(s=1),o===void 0&&(o=0),hv(t)&&(t=rg(t)[0]),!t)return 0;var a=0,l=ys,c=e.inertia||e,h=ag(t).get,f=Ql(c,"resistance",Oa.resistance),d,u,_,m,p,g,b,v,S,D;D=mg(t,c,h,f);for(d in c)pg[d]||(u=c[d],Dr(u)||(v=v||jl(t),v&&v.isTracking(d)?u=ka(u)?{velocity:u}:{velocity:v.get(d)}:(m=+u||0,_=Math.abs(m/f))),Dr(u)&&(ka(u.velocity)?m=u.velocity:(v=v||jl(t),m=v&&v.isTracking(d)?v.get(d):0),_=lg(i,n,Math.abs(m/Ql(u,"resistance",f))),p=parseFloat(h(t,d))||0,g=p+Jh(m,_),"end"in u&&(u=dg(u,D&&d in D?D:g,u.max,u.min,d,c.radius,m),o&&(Ba===e&&(Ba=c=gv(e)),c[d]=mv(u,c[d],"end"))),"max"in u&&g>+u.max+Qm?(S=u.unitFactor||Oa.unitFactors[d]||1,b=p>u.max&&u.min!==u.max||m*S>-15&&m*S<45?i+(n-i)*.1:eg(p,u.max,m),b+s<l&&(l=b+s)):"min"in u&&g<+u.min-Qm&&(S=u.unitFactor||Oa.unitFactors[d]||1,b=p<u.min&&u.min!==u.max||m*S>-45&&m*S<15?i+(n-i)*.1:eg(p,u.min,m),b+s<l&&(l=b+s)),b>a&&(a=b)),_>a&&(a=_));return a>l&&(a=l),a>n?n:a<i?i:a},ng=function(){Ye=ug(),Ye&&(jm=Ye.parseEase,rg=Ye.utils.toArray,sg=Ye.utils.getUnit,ag=Ye.core.getCache,lg=Ye.utils.clamp,Yh=Ye.core.getStyleSaver,cg=Ye.core.reverting||function(){},Xh=jm("power3"),Zh=Xh(.05),og=Ye.core.PropTween,Ye.config({resistance:100,unitFactors:{time:1e3,totalTime:1e3,progress:1e3,totalProgress:1e3}}),Oa=Ye.config(),Ye.registerPlugin(fo),ig=1)},po={version:"3.12.5",name:"inertia",register:function(t){Ye=t,ng()},init:function(t,e,n,i,s){ig||ng();var o=jl(t);if(e==="auto"){if(!o){console.warn("No inertia tracking on "+t+". InertiaPlugin.track(target) first.");return}e=o.getAll()}this.styles=Yh&&typeof t.style=="object"&&Yh(t),this.target=t,this.tween=n,Ba=e;var a=t._gsap,l=a.get,c=e.duration,h=Dr(c),f=e.preventOvershoot||h&&c.overshoot===0,d=Ql(e,"resistance",Oa.resistance),u=ka(c)?c:_v(t,e,h&&c.max||10,h&&c.min||.2,h&&"overshoot"in c?+c.overshoot:f?0:1,!0),_,m,p,g,b,v,S,D,T;e=Ba,Ba=0,T=mg(t,e,l,d);for(_ in e)pg[_]||(m=e[_],qh(m)&&(m=m(i,t,s)),ka(m)?b=m:Dr(m)&&!isNaN(m.velocity)?b=+m.velocity:o&&o.isTracking(_)?b=o.get(_):console.warn("ERROR: No velocity was defined for "+t+" property: "+_),v=Jh(b,u),D=0,p=l(t,_),g=sg(p),p=parseFloat(p),Dr(m)&&(S=p+v,"end"in m&&(m=dg(m,T&&_ in T?T:S,m.max,m.min,_,e.radius,b)),"max"in m&&+m.max<S?f||m.preventOvershoot?v=m.max-p:D=m.max-p-v:"min"in m&&+m.min>S&&(f||m.preventOvershoot?v=m.min-p:D=m.min-p-v)),this._props.push(_),this.styles&&this.styles.save(_),this._pt=new og(this._pt,t,_,p,0,dv,0,a.set(t,_,this)),this._pt.u=g||0,this._pt.c1=v,this._pt.c2=D);return n.duration(u),fv},render:function(t,e){var n=e._pt;if(t=Xh(e.tween._time/e.tween._dur),t||!cg())for(;n;)n.set(n.t,n.p,pv(n.s+n.c1*t+n.c2*t*t)+n.u,n.d,t),n=n._next;else e.styles.revert()}};"track,untrack,isTracking,getVelocity,getByTarget".split(",").forEach(function(r){return po[r]=fo[r]});ug()&&Ye.registerPlugin(po);var gg=()=>{Kt.registerPlugin(Yt,Pi,po);let r=Kt.matchMedia(),t=document.querySelector(".gallery-section");t&&getComputedStyle(t).display!=="none"&&(r.add("(max-width: 767px)",()=>{let e=document.querySelector(".gallery_list");Pi.create(e,{type:"x",bounds:{minX:window.innerWidth-e.scrollWidth-40,maxX:0},inertia:!0})}),r.add("(min-width: 768px)",()=>{let e=document.querySelector(".gallery_list"),n=document.querySelector(".is-casestudies_button"),i=document.querySelector(".arrow-button-right"),s=document.querySelector(".arrow-button-left"),o=0,a=1,l=document.querySelectorAll(".gallery_item").length;function c(){let h=document.querySelector(".gallery_item").offsetWidth;Kt.to(e,{duration:.5,x:-o*h}),o===l-1?(s.classList.remove("hide"),i.classList.add("hide"),a=-1):o===0&&(i.classList.remove("hide"),s.classList.add("hide"),a=1)}n.addEventListener("click",()=>{a===1&&o<l-1?o++:a===-1&&o>0&&o--,c()}),c()}))};var xv=/(?:^\s+|\s+$)/g,$h=/([\uD800-\uDBFF][\uDC00-\uDFFF](?:[\u200D\uFE0F][\uD800-\uDBFF][\uDC00-\uDFFF]){2,}|\uD83D\uDC69(?:\u200D(?:(?:\uD83D\uDC69\u200D)?\uD83D\uDC67|(?:\uD83D\uDC69\u200D)?\uD83D\uDC66)|\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D(?:\uD83D\uDC69\u200D)?\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D(?:\uD83D\uDC69\u200D)?\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]\uFE0F|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC6F\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3C-\uDD3E\uDDD6-\uDDDF])\u200D[\u2640\u2642]\uFE0F|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F\u200D[\u2640\u2642]|(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642])\uFE0F|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\uD83D\uDC69\u200D[\u2695\u2696\u2708]|\uD83D\uDC68(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708]))\uFE0F|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83D\uDC69\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|\uD83D\uDC68(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC66\u200D\uD83D\uDC66|(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92])|(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]))|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDD1-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\u200D(?:(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC67|(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC66)|\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC69\uDC6E\uDC70-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD26\uDD30-\uDD39\uDD3D\uDD3E\uDDD1-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])?|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDEEB\uDEEC\uDEF4-\uDEF8]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD4C\uDD50-\uDD6B\uDD80-\uDD97\uDDC0\uDDD0-\uDDE6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267B\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEF8]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD4C\uDD50-\uDD6B\uDD80-\uDD97\uDDC0\uDDD0-\uDDE6])\uFE0F)/;function mo(r){var t=r.nodeType,e="";if(t===1||t===9||t===11){if(typeof r.textContent=="string")return r.textContent;for(r=r.firstChild;r;r=r.nextSibling)e+=mo(r)}else if(t===3||t===4)return r.nodeValue;return e}function mi(r,t,e,n){if(r+="",e&&(r=r.trim?r.trim():r.replace(xv,"")),t&&t!=="")return r.replace(/>/g,">").replace(/</g,"<").split(t);for(var i=[],s=r.length,o=0,a,l;o<s;o++)l=r.charAt(o),(l.charCodeAt(0)>=55296&&l.charCodeAt(0)<=56319||r.charCodeAt(o+1)>=65024&&r.charCodeAt(o+1)<=65039)&&(a=((r.substr(o,12).split($h)||[])[1]||"").length||2,l=r.substr(o,a),i.emoji=1,o+=a-1),i.push(l===">"?">":l==="<"?"<":n&&l===" "&&(r.charAt(o-1)===" "||r.charAt(o+1)===" ")?" ":l);return i}var go,jh,yg,za,vg,tc,yv=/(?:\r|\n|\t\t)/g,vv=/(?:\s\s+)/g,Sv="\xA0",Sg=function(t){go=document,jh=window,za=za||t||jh.gsap||console.warn("Please gsap.registerPlugin(SplitText)"),za&&(tc=za.utils.toArray,vg=za.core.context||function(){},yg=1)},Mv=1,Mg=function(t){return jh.getComputedStyle(t)},Qh=function(t){return t.position==="absolute"||t.absolute===!0},bv=function(t,e){for(var n=e.length,i;--n>-1;)if(i=e[n],t.substr(0,i.length)===i)return i.length},wv=" style='position:relative;display:inline-block;'",_g=function(t,e){t===void 0&&(t="");var n=~t.indexOf("++"),i=1;return n&&(t=t.split("++").join("")),function(){return"<"+e+wv+(t?" class='"+t+(n?i++:"")+"'>":">")}},bg=function r(t,e,n){var i=t.nodeType;if(i===1||i===9||i===11)for(t=t.firstChild;t;t=t.nextSibling)r(t,e,n);else(i===3||i===4)&&(t.nodeValue=t.nodeValue.split(e).join(n))},Kh=function(t,e){for(var n=e.length;--n>-1;)t.push(e[n])},xg=function(t,e,n){for(var i;t&&t!==e;){if(i=t._next||t.nextSibling,i)return i.textContent.charAt(0)===n;t=t.parentNode||t._parent}},Ev=function r(t){var e=tc(t.childNodes),n=e.length,i,s;for(i=0;i<n;i++)s=e[i],s._isSplit?r(s):i&&s.previousSibling&&s.previousSibling.nodeType===3?(s.previousSibling.nodeValue+=s.nodeType===3?s.nodeValue:s.firstChild.nodeValue,t.removeChild(s)):s.nodeType!==3&&(t.insertBefore(s.firstChild,s),t.removeChild(s))},Li=function(t,e){return parseFloat(e[t])||0},Tv=function(t,e,n,i,s,o,a){var l=Mg(t),c=Li("paddingLeft",l),h=-999,f=Li("borderBottomWidth",l)+Li("borderTopWidth",l),d=Li("borderLeftWidth",l)+Li("borderRightWidth",l),u=Li("paddingTop",l)+Li("paddingBottom",l),_=Li("paddingLeft",l)+Li("paddingRight",l),m=Li("fontSize",l)*(e.lineThreshold||.2),p=l.textAlign,g=[],b=[],v=[],S=e.wordDelimiter||" ",D=e.tag?e.tag:e.span?"span":"div",T=e.type||e.split||"chars,words,lines",w=s&&~T.indexOf("lines")?[]:null,P=~T.indexOf("words"),M=~T.indexOf("chars"),y=Qh(e),I=e.linesClass,N=~(I||"").indexOf("++"),C=[],V=l.display==="flex",$=t.style.display,W,Z,z,U,R,at,_t,Ut,X,ot,xt,ct;for(N&&(I=I.split("++").join("")),V&&(t.style.display="block"),Z=t.getElementsByTagName("*"),z=Z.length,R=[],W=0;W<z;W++)R[W]=Z[W];if(w||y)for(W=0;W<z;W++)U=R[W],at=U.parentNode===t,(at||y||M&&!P)&&(ct=U.offsetTop,w&&at&&Math.abs(ct-h)>m&&(U.nodeName!=="BR"||W===0)&&(_t=[],w.push(_t),h=ct),y&&(U._x=U.offsetLeft,U._y=ct,U._w=U.offsetWidth,U._h=U.offsetHeight),w&&((U._isSplit&&at||!M&&at||P&&at||!P&&U.parentNode.parentNode===t&&!U.parentNode._isSplit)&&(_t.push(U),U._x-=c,xg(U,t,S)&&(U._wordEnd=!0)),U.nodeName==="BR"&&(U.nextSibling&&U.nextSibling.nodeName==="BR"||W===0)&&w.push([])));for(W=0;W<z;W++){if(U=R[W],at=U.parentNode===t,U.nodeName==="BR"){w||y?(U.parentNode&&U.parentNode.removeChild(U),R.splice(W--,1),z--):P||t.appendChild(U);continue}if(y&&(X=U.style,!P&&!at&&(U._x+=U.parentNode._x,U._y+=U.parentNode._y),X.left=U._x+"px",X.top=U._y+"px",X.position="absolute",X.display="block",X.width=U._w+1+"px",X.height=U._h+"px"),!P&&M)if(U._isSplit)for(U._next=Z=U.nextSibling,U.parentNode.appendChild(U);Z&&Z.nodeType===3&&Z.textContent===" ";)U._next=Z.nextSibling,U.parentNode.appendChild(Z),Z=Z.nextSibling;else U.parentNode._isSplit?(U._parent=U.parentNode,!U.previousSibling&&U.firstChild&&(U.firstChild._isFirst=!0),U.nextSibling&&U.nextSibling.textContent===" "&&!U.nextSibling.nextSibling&&C.push(U.nextSibling),U._next=U.nextSibling&&U.nextSibling._isFirst?null:U.nextSibling,U.parentNode.removeChild(U),R.splice(W--,1),z--):at||(ct=!U.nextSibling&&xg(U.parentNode,t,S),U.parentNode._parent&&U.parentNode._parent.appendChild(U),ct&&U.parentNode.appendChild(go.createTextNode(" ")),D==="span"&&(U.style.display="inline"),g.push(U));else U.parentNode._isSplit&&!U._isSplit&&U.innerHTML!==""?b.push(U):M&&!U._isSplit&&(D==="span"&&(U.style.display="inline"),g.push(U))}for(W=C.length;--W>-1;)C[W].parentNode.removeChild(C[W]);if(w){for(y&&(ot=go.createElement(D),t.appendChild(ot),xt=ot.offsetWidth+"px",ct=ot.offsetParent===t?0:t.offsetLeft,t.removeChild(ot)),X=t.style.cssText,t.style.cssText="display:none;";t.firstChild;)t.removeChild(t.firstChild);for(Ut=S===" "&&(!y||!P&&!M),W=0;W<w.length;W++){for(_t=w[W],ot=go.createElement(D),ot.style.cssText="display:block;text-align:"+p+";position:"+(y?"absolute;":"relative;"),I&&(ot.className=I+(N?W+1:"")),v.push(ot),z=_t.length,Z=0;Z<z;Z++)_t[Z].nodeName!=="BR"&&(U=_t[Z],ot.appendChild(U),Ut&&U._wordEnd&&ot.appendChild(go.createTextNode(" ")),y&&(Z===0&&(ot.style.top=U._y+"px",ot.style.left=c+ct+"px"),U.style.top="0px",ct&&(U.style.left=U._x-ct+"px")));z===0?ot.innerHTML=" ":!P&&!M&&(Ev(ot),bg(ot,"\xA0"," ")),y&&(ot.style.width=xt,ot.style.height=U._h+"px"),t.appendChild(ot)}t.style.cssText=X}y&&(a>t.clientHeight&&(t.style.height=a-u+"px",t.clientHeight<a&&(t.style.height=a+f+"px")),o>t.clientWidth&&(t.style.width=o-_+"px",t.clientWidth<o&&(t.style.width=o+d+"px"))),V&&($?t.style.display=$:t.style.removeProperty("display")),Kh(n,g),P&&Kh(i,b),Kh(s,v)},Av=function(t,e,n,i){var s=e.tag?e.tag:e.span?"span":"div",o=e.type||e.split||"chars,words,lines",a=~o.indexOf("chars"),l=Qh(e),c=e.wordDelimiter||" ",h=function(y){return y===c||y===Sv&&c===" "},f=c!==" "?"":l?"­ ":" ",d="</"+s+">",u=1,_=e.specialChars?typeof e.specialChars=="function"?e.specialChars:bv:null,m,p,g,b,v,S,D,T,w=go.createElement("div"),P=t.parentNode;for(P.insertBefore(w,t),w.textContent=t.nodeValue,P.removeChild(t),t=w,m=mo(t),D=m.indexOf("<")!==-1,e.reduceWhiteSpace!==!1&&(m=m.replace(vv," ").replace(yv,"")),D&&(m=m.split("<").join("{{LT}}")),v=m.length,p=(m.charAt(0)===" "?f:"")+n(),g=0;g<v;g++)if(S=m.charAt(g),_&&(T=_(m.substr(g),e.specialChars)))S=m.substr(g,T||1),p+=a&&S!==" "?i()+S+"</"+s+">":S,g+=T-1;else if(h(S)&&!h(m.charAt(g-1))&&g){for(p+=u?d:"",u=0;h(m.charAt(g+1));)p+=f,g++;g===v-1?p+=f:m.charAt(g+1)!==")"&&(p+=f+n(),u=1)}else S==="{"&&m.substr(g,6)==="{{LT}}"?(p+=a?i()+"{{LT}}</"+s+">":"{{LT}}",g+=5):S.charCodeAt(0)>=55296&&S.charCodeAt(0)<=56319||m.charCodeAt(g+1)>=65024&&m.charCodeAt(g+1)<=65039?(b=((m.substr(g,12).split($h)||[])[1]||"").length||2,p+=a&&S!==" "?i()+m.substr(g,b)+"</"+s+">":m.substr(g,b),g+=b-1):p+=a&&S!==" "?i()+S+"</"+s+">":S;t.outerHTML=p+(u?d:""),D&&bg(P,"{{LT}}","<")},Dv=function r(t,e,n,i){var s=tc(t.childNodes),o=s.length,a=Qh(e),l,c;if(t.nodeType!==3||o>1){for(e.absolute=!1,l=0;l<o;l++)c=s[l],c._next=c._isFirst=c._parent=c._wordEnd=null,(c.nodeType!==3||/\S+/.test(c.nodeValue))&&(a&&c.nodeType!==3&&Mg(c).display==="inline"&&(c.style.display="inline-block",c.style.position="relative"),c._isSplit=!0,r(c,e,n,i));e.absolute=a,t._isSplit=!0;return}Av(t,e,n,i)},dn=function(){function r(e,n){yg||Sg(),this.elements=tc(e),this.chars=[],this.words=[],this.lines=[],this._originals=[],this.vars=n||{},vg(this),Mv&&this.split(n)}var t=r.prototype;return t.split=function(n){this.isSplit&&this.revert(),this.vars=n=n||this.vars,this._originals.length=this.chars.length=this.words.length=this.lines.length=0;for(var i=this.elements.length,s=n.tag?n.tag:n.span?"span":"div",o=_g(n.wordsClass,s),a=_g(n.charsClass,s),l,c,h;--i>-1;)h=this.elements[i],this._originals[i]={html:h.innerHTML,style:h.getAttribute("style")},l=h.clientHeight,c=h.clientWidth,Dv(h,n,o,a),Tv(h,n,this.chars,this.words,this.lines,c,l);return this.chars.reverse(),this.words.reverse(),this.lines.reverse(),this.isSplit=!0,this},t.revert=function(){var n=this._originals;if(!n)throw"revert() call wasn't scoped properly.";return this.elements.forEach(function(i,s){i.innerHTML=n[s].html,i.setAttribute("style",n[s].style)}),this.chars=[],this.words=[],this.lines=[],this.isSplit=!1,this},r.create=function(n,i){return new r(n,i)},r}();dn.version="3.12.5";dn.register=Sg;var wg=()=>{if(Kt.registerPlugin(Yt,dn),document.querySelector("#scope-section")){let e=function(){Kt.set(t,{width:"3em"}),Kt.set(".teamt_txt",{display:"none"})},n=function(i){let s=document.querySelector(".team_wrap_item.open");s&&s!==i&&(Kt.to(s,{width:"3em",duration:.1}),Kt.to(s.querySelector(".teamt_txt"),{display:"none",duration:.1}),s.classList.remove("open")),i.classList.contains("open")?(i.classList.remove("open"),Kt.to(i,{width:"3em",duration:.3}),Kt.to(i.querySelector(".teamt_txt"),{display:"none",duration:.1})):(i.classList.add("open"),Kt.to(i,{width:"10.2em",duration:.2}),Kt.to(i.querySelector(".teamt_txt"),{display:"block",duration:.3,delay:.5}))};document.querySelectorAll(".casestudy-stack-team").forEach(i=>{let s=Kt.timeline({scrollTrigger:{trigger:i,start:"10% 60%",toggleActions:"play none none reverse",invalidateOnRefresh:!0,smoothScroll:!0}});if(i.querySelector(".border-scope")){let a=i.querySelector(".border-scope");s.fromTo(a,{y:"0",x:"0",opacity:0},{y:"0.51em",x:"-0.51em",opacity:1,duration:.75,ease:"circ.out"})}let o=i.querySelectorAll(".collection-logo-item");o.length&&s.fromTo(o,{y:"100%",autoAlpha:0},{y:"0%",autoAlpha:1,duration:.5,stagger:.1,ease:"circ.out"},">-0.5")});let t=document.querySelectorAll(".team_wrap_item");e(),t.forEach(i=>{i.addEventListener("click",()=>n(i))})}};var Eg=()=>{Kt.registerPlugin(Yt,Pi,po);let r=Kt.utils.toArray(".people_wrap"),t=Kt.matchMedia();t.add("(max-width: 991px)",()=>{let e=document.querySelector(".people_wrapper"),n=r.map((s,o)=>-(s.clientWidth+40)*o),i=Kt.utils.snap(n);Pi.create(e,{type:"x",bounds:{minX:window.innerWidth-e.scrollWidth-40,maxX:0},inertia:!0,snap:{x:function(s){return i(s)}}})}),t.add("(min-width: 992px)",()=>{let e=document.querySelector(".people_wrapper"),n=document.querySelector(".people_wrap"),i=document.querySelector(".case-studies_team-wrapper"),s=e.children.length,o=n.getBoundingClientRect().width,l=window.getComputedStyle(e).getPropertyValue("grid-column-gap");l=parseFloat(l),e.style.width=`${s*(o+l)-l}px`;let c=Kt.timeline({scrollTrigger:{trigger:".team-container",start:"top top",end:`+=${s*(o+l)+window.innerWidth}`,scrub:!0,pin:!0,anticipatePin:1,ease:"none"}});c.to(".team-heading-container",{right:0,duration:1}).to(".scrolled-heading",{color:"#17171D"}),s<5?(c.to(e,{xPercent:-50,left:"50%"}),c.to(i,{left:"0"})):c.to(i,{left:"0"}),c.to(e,{x:`-${s*(o+l)-window.innerWidth}px`})})};var Tg=()=>{let r=document.querySelectorAll("[data-contact-popup-toggler]"),t=document.querySelector("[data-contact-popup]");var e=0;if(!r||!t)return;let n=t.querySelector("[data-contact-popup-close]");if(!n)return;let i=t.querySelector(".contact-popup_box");if(!i)return;let s=(o,a)=>{let l=document.createElement("script"),c=document.getElementsByTagName("script")[0];l.async=1,l.onload=l.onreadystatechange=(h,f)=>{(f||!l.readyState||/loaded|complete/.test(l.readyState))&&(l.onload=l.onreadystatechange=null,l=void 0,f||a&&a())},l.src=o,c.parentNode.insertBefore(l,c)};r.forEach(o=>{o.addEventListener("click",a=>{a.preventDefault,e?(t.classList.add("-open"),document.body.classList.add("-popup-open")):s("https://embed.typeform.com/next/embed.js",()=>{e=1,t.classList.add("-open"),document.body.classList.add("-popup-open")})})}),n.addEventListener("click",o=>{o.preventDefault,t.classList.remove("-open"),document.body.classList.remove("-popup-open")}),t.addEventListener("click",o=>{i.contains(o.target)||(t.classList.remove("-open"),document.body.classList.remove("-popup-open"))}),new URL(document.location).searchParams.has("invicible")&&setTimeout(()=>{s("https://embed.typeform.com/next/embed.js",()=>{e=1,setTimeout(()=>{t.classList.add("-open"),document.body.classList.add("-popup-open")},200)})},2e3)};var Ag=()=>{let r=new Date().toLocaleTimeString("pl-PL",{timeZone:"Poland"}).split(":");return r[0]+" - "+r[1]},Dg=()=>{let r=document.querySelectorAll("[data-current-time]");r.length>0&&r.forEach(t=>{t.textContent=Ag(),setInterval(()=>{t.textContent=Ag()},5e3)})};var Cg=()=>{Kt.registerPlugin(Yt,dn),document.querySelectorAll("[data-header-animation]").forEach(t=>{let e=t.querySelector("h2");if(!e||(e.classList.contains("is-all-strong")&&(e=e.querySelector("strong")),!e))return;let n=new dn(e,{type:"lines",tag:"span"}),i=new dn(e,{type:"lines",linesClass:"header_line"});n.lines=i.chars.concat(n.lines);let s=Kt.timeline({scrollTrigger:{trigger:t,start:"top bottom",toggleActions:"play none none reset"}});s.fromTo(n.lines,{y:100},{y:0,duration:.75,stagger:.05,ease:"circ.out"},"+=0.25");let o=t.querySelector(".hero_holo");o&&s.fromTo(o,{autoAlpha:0},{autoAlpha:1,duration:.75,ease:"circ.out"},"+-=0.25");let a=t.querySelector(".button");a&&s.fromTo(a,{autoAlpha:0},{autoAlpha:1,duration:.75,ease:"circ.out"},"-=0.75")})};var Rg=()=>{if(Kt.registerPlugin(Yt,dn),document.querySelector(".hero_grid")){let r=document.querySelector(".hero_grid"),t=r.querySelector(".hero_holo"),e=r.querySelector("h1"),n=r.querySelector(".paragraph-big"),i=new dn(e,{type:"lines",tag:"span"}),s=new dn(e,{type:"lines",linesClass:"header_line"});i.lines=s.chars.concat(i.lines),Kt.timeline({scrollTrigger:{trigger:r,start:"top bottom",toggleActions:"play none none reset"}}).fromTo(n,{autoAlpha:0},{autoAlpha:1,duration:.35,ease:"circ.out"},"+=1.75").fromTo(i.lines,{y:"100%"},{y:0,duration:.75,stagger:.05,ease:"circ.out"},"-=0.25").fromTo(t,{autoAlpha:0},{autoAlpha:1,duration:.75,ease:"circ.out"},"+-=0.25")}};var Pg=()=>{let r=document.querySelector(".is-section-loader");if(!r)return;let t=r.querySelector(".loader_line"),e=r.querySelector(".loader_value");!t||!e||Kt.to(t,{width:"100%",duration:1.5,onUpdate:function(){let n=Math.round(this.progress()*100);e.innerHTML=`${n}%`},onComplete:function(){Kt.to(r,{y:"-100dvh",duration:.75})}},"<")};var Ig=()=>{Kt.registerPlugin(Yt);let r=Kt.matchMedia();r.add("(max-width: 991px)",()=>{let t=Kt.timeline({scrollTrigger:{trigger:".casestudies-container",start:"top center",end:"center center",scrub:1}});Kt.set(".dotted-line",{scaleY:0,transformOrigin:"top center"}),t.fromTo(".circle-wrapper",{opacity:0,scale:.9},{opacity:1,scale:1,duration:.75,ease:"power2.out"}).from(".circle_red",{opacity:0,scale:.8,duration:.75,ease:"power2.out"},"-=0.6").to(".dotted-line",{scaleY:1,duration:.75,ease:"power2.inOut"},"-=0.2").from(".circle_blue",{opacity:0,scale:.8,duration:.75,ease:"power2.out"},"-=0.2")}),r.add("(min-width: 992px)",()=>{Kt.timeline({scrollTrigger:{trigger:".casestudies-container",start:"top top",end:"bottom top",scrub:!0,pin:!0}}).to(".circle_red",{scale:.7,top:"30%",left:"10%",ease:"none"},0).to(".circle_blue",{scale:1,top:"6%",ease:"none"},0).to(".dotted-line",{rotate:"-25deg",x:"-6em",ease:"none"},0)})};var Lg=()=>{Kt.registerPlugin(Yt,dn),document.querySelectorAll(".problems-solutions-container").forEach(t=>{let e=t.querySelector("h3");e.classList.contains("is-all-strong")&&(e=e.querySelector("strong"));let n=new dn(e,{type:"lines",tag:"span"}),i=new dn(e,{type:"lines",linesClass:"header_line"});n.lines=i.chars.concat(n.lines);let s=Kt.timeline({scrollTrigger:{trigger:t,start:"top bottom",toggleActions:"play none none reset"}});s.fromTo(n.lines,{y:100},{y:0,duration:.75,stagger:.05,ease:"circ.out"},"+=0.25"),s.fromTo(t.querySelector(".casestudies-description-heading"),{autoAlpha:0,y:"3rem"},{y:0,autoAlpha:1,duration:.5,ease:"circ.out"},">-0.5"),s.fromTo(t.querySelector(".casestudies-description"),{autoAlpha:0,y:"3rem"},{y:0,autoAlpha:1,duration:.5,ease:"circ.out"},">-0.5")})};var ec=function(){function r(e){this.chars=mi(e),this.sets=[],this.length=50;for(var n=0;n<20;n++)this.sets[n]=Ng(80,this.chars)}var t=r.prototype;return t.grow=function(n){for(var i=0;i<20;i++)this.sets[i]+=Ng(n-this.length,this.chars);this.length=n},r}(),vs,Bg,kg=function(){return vs||typeof window<"u"&&(vs=window.gsap)&&vs.registerPlugin&&vs},Cv=1,Fg=/\s+/g,Ng=function(t,e){for(var n=e.length,i="";--t>-1;)i+=e[~~(Math.random()*n)];return i},tf="ABCDEFGHIJKLMNOPQRSTUVWXYZ",Ug=tf.toLowerCase(),Rv={upperCase:new ec(tf),lowerCase:new ec(Ug),upperAndLowerCase:new ec(tf+Ug)},Og=function(){Bg=vs=kg()},Va={version:"3.12.5",name:"scrambleText",register:function(t,e,n){vs=t,Og()},init:function(t,e,n,i,s){if(Bg||Og(),this.prop="innerHTML"in t?"innerHTML":"textContent"in t?"textContent":0,!!this.prop){this.target=t,typeof e!="object"&&(e={text:e});var o=e.text||e.value||"",a=e.trim!==!1,l=this,c,h,f,d;return l.delimiter=c=e.delimiter||"",l.original=mi(mo(t).replace(Fg," ").split(" ").join(""),c,a),(o==="{original}"||o===!0||o==null)&&(o=l.original.join(c)),l.text=mi((o||"").replace(Fg," "),c,a),l.hasClass=!!(e.newClass||e.oldClass),l.newClass=e.newClass,l.oldClass=e.oldClass,d=c==="",l.textHasEmoji=d&&!!l.text.emoji,l.charsHaveEmoji=!!e.chars&&!!mi(e.chars).emoji,l.length=d?l.original.length:l.original.join(c).length,l.lengthDif=(d?l.text.length:l.text.join(c).length)-l.length,l.fillChar=e.fillChar||e.chars&&~e.chars.indexOf(" ")?" ":"",l.charSet=f=Rv[e.chars||"upperCase"]||new ec(e.chars),l.speed=.05/(e.speed||1),l.prevScrambleTime=0,l.setIndex=Math.random()*20|0,h=l.length+Math.max(l.lengthDif,0),h>f.length&&f.grow(h),l.chars=f.sets[l.setIndex],l.revealDelay=e.revealDelay||0,l.tweenLength=e.tweenLength!==!1,l.tween=n,l.rightToLeft=!!e.rightToLeft,l._props.push("scrambleText","text"),Cv}},render:function(t,e){var n=e.target,i=e.prop,s=e.text,o=e.delimiter,a=e.tween,l=e.prevScrambleTime,c=e.revealDelay,h=e.setIndex,f=e.chars,d=e.charSet,u=e.length,_=e.textHasEmoji,m=e.charsHaveEmoji,p=e.lengthDif,g=e.tweenLength,b=e.oldClass,v=e.newClass,S=e.rightToLeft,D=e.fillChar,T=e.speed,w=e.original,P=e.hasClass,M=s.length,y=a._time,I=y-l,N,C,V,$,W,Z,z,U,R,at,_t;c&&(a._from&&(y=a._dur-y),t=y===0?0:y<c?1e-6:y===a._dur?1:a._ease((y-c)/(a._dur-c))),t<0?t=0:t>1&&(t=1),S&&(t=1-t),N=~~(t*M+.5),t?((I>T||I<-T)&&(e.setIndex=h=(h+(Math.random()*19|0))%20,e.chars=d.sets[h],e.prevScrambleTime+=I),$=f):$=w.join(o),_t=a._from?t:1-t,at=u+(g?a._from?_t*_t*_t:1-_t*_t*_t:1)*p,S?t===1&&(a._from||a.data==="isFromStart")?(V="",$=w.join(o)):(z=s.slice(N).join(o),m?V=mi($).slice(0,at-(_?mi(z):z).length+.5|0).join(""):V=$.substr(0,at-(_?mi(z):z).length+.5|0),$=z):(V=s.slice(0,N).join(o),C=(_?mi(V):V).length,m?$=mi($).slice(C,at+.5|0).join(""):$=$.substr(C,at-C+.5|0)),P?(U=S?b:v,R=S?v:b,W=U&&N!==0,Z=R&&N!==M,z=(W?"<span class='"+U+"'>":"")+V+(W?"</span>":"")+(Z?"<span class='"+R+"'>":"")+o+$+(Z?"</span>":"")):z=V+o+$,n[i]=D===" "&&~z.indexOf(" ")?z.split(" ").join(" "):z}};Va.emojiSafeSplit=mi;Va.getText=mo;kg()&&vs.registerPlugin(Va);Kt.registerPlugin(Va);var zg=()=>{document.querySelectorAll("[data-scramble-link]").forEach(t=>{let e=t.querySelector("[data-scramble-text]");if(!e)return;let n=e.textContent;t.addEventListener("mouseenter",()=>{Kt.matchMedia().add("(min-width: 768px)",()=>{Kt.to(e,{duration:1,scrambleText:{text:n,chars:"10"}})})})})};function Vg(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function Pv(r,t,e){return t&&Vg(r.prototype,t),e&&Vg(r,e),r}var ye,nc,rn,Ms,_o,gi,Iv,Ss,Hg,re,Fi,ic,Gg,Wg,Xg,Yg,qg=function(){return typeof window<"u"},Zg=function(){return ye||qg()&&(ye=window.gsap)&&ye.registerPlugin&&ye};var Lv=function(t){return Math.round(t*1e5)/1e5||0},Cr=function(t){return re.maxScroll(t||rn)},Fv=function(t,e){var n=t.parentNode||_o,i=t.getBoundingClientRect(),s=n.getBoundingClientRect(),o=s.top-i.top,a=s.bottom-i.bottom,l=(Math.abs(o)>Math.abs(a)?o:a)/(1-e),c=-l*e,h,f;return l>0&&(h=s.height/(rn.innerHeight+s.height),f=h===.5?s.height*2:Math.min(s.height,Math.abs(-l*h/(2*h-1)))*2*(e||1),c+=e?-f*e:-f/2,l+=f),{change:l,offset:c}},Nv=function(t){var e=Ms.querySelector(".ScrollSmoother-wrapper");return e||(e=Ms.createElement("div"),e.classList.add("ScrollSmoother-wrapper"),t.parentNode.insertBefore(e,t),e.appendChild(t)),e},ji=function(){function r(t){var e=this;nc||r.register(ye)||console.warn("Please gsap.registerPlugin(ScrollSmoother)"),t=this.vars=t||{},Fi&&Fi.kill(),Fi=this,Xg(this);var n=t,i=n.smoothTouch,s=n.onUpdate,o=n.onStop,a=n.smooth,l=n.onFocusIn,c=n.normalizeScroll,h=n.wholePixels,f,d,u,_,m,p,g,b,v,S,D,T,w,P,M=this,y=t.effectsPrefix||"",I=re.getScrollFunc(rn),N=re.isTouch===1?i===!0?.8:parseFloat(i)||0:a===0||a===!1?0:parseFloat(a)||.8,C=N&&+t.speed||1,V=0,$=0,W=1,Z=Gg(0),z=function(){return Z.update(-V)},U={y:0},R=function(){return f.style.overflow="visible"},at,_t=function(x){x.update();var F=x.getTween();F&&(F.pause(),F._time=F._dur,F._tTime=F._tDur),at=!1,x.animation.progress(x.progress,!0)},Ut=function(x,F){(x!==V&&!S||F)&&(h&&(x=Math.round(x)),N&&(f.style.transform="matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, "+x+", 0, 1)",f._gsap.y=x+"px"),$=x-V,V=x,re.isUpdating||r.isRefreshing||re.update())},X=function(x){return arguments.length?(x<0&&(x=0),U.y=-x,at=!0,S?V=-x:Ut(-x),re.isRefreshing?_.update():I(x/C),this):-V},ot=typeof ResizeObserver<"u"&&t.autoResize!==!1&&new ResizeObserver(function(){if(!re.isRefreshing){var A=Cr(d)*C;A<-V&&X(A),Yg.restart(!0)}}),xt,ct=function(x){d.scrollTop=0,!(x.target.contains&&x.target.contains(d)||l&&l(e,x)===!1)&&(re.isInViewport(x.target)||x.target===xt||e.scrollTo(x.target,!1,"center center"),xt=x.target)},Rt=function(x,F){if(x<F.start)return x;var Y=isNaN(F.ratio)?1:F.ratio,tt=F.end-F.start,it=x-F.start,vt=F.offset||0,pt=F.pins||[],lt=pt.offset||0,Lt=F._startClamp&&F.start<=0||F.pins&&F.pins.offset?0:F._endClamp&&F.end===Cr()?1:.5;return pt.forEach(function(ht){tt-=ht.distance,ht.nativeStart<=x&&(it-=ht.distance)}),lt&&(it*=(tt-lt/Y)/tt),x+(it-vt*Lt)/Y-it},kt=function A(x,F,Y){Y||(x.pins.length=x.pins.offset=0);var tt=x.pins,it=x.markers,vt,pt,lt,Lt,ht,yt,qt,ut;for(qt=0;qt<F.length;qt++)if(ut=F[qt],x.trigger&&ut.trigger&&x!==ut&&(ut.trigger===x.trigger||ut.pinnedContainer===x.trigger||x.trigger.contains(ut.trigger))&&(ht=ut._startNative||ut._startClamp||ut.start,yt=ut._endNative||ut._endClamp||ut.end,lt=Rt(ht,x),Lt=ut.pin&&yt>0?lt+(yt-ht):Rt(yt,x),ut.setPositions(lt,Lt,!0,(ut._startClamp?Math.max(0,lt):lt)-ht),ut.markerStart&&it.push(ye.quickSetter([ut.markerStart,ut.markerEnd],"y","px")),ut.pin&&ut.end>0&&!Y)){if(vt=ut.end-ut.start,pt=x._startClamp&&ut.start<0,pt){if(x.start>0){x.setPositions(0,x.end+(x._startNative-x.start),!0),A(x,F);return}vt+=ut.start,tt.offset=-ut.start}tt.push({start:ut.start,nativeStart:ht,end:ut.end,distance:vt,trig:ut}),x.setPositions(x.start,x.end+(pt?-ut.start:vt),!0)}},q=function(x,F){m.forEach(function(Y){return kt(Y,x,F)})},$t=function(){R(),requestAnimationFrame(R),m&&(re.getAll().forEach(function(x){x._startNative=x.start,x._endNative=x.end}),m.forEach(function(x){var F=x._startClamp||x.start,Y=x.autoSpeed?Math.min(Cr(),x.end):F+Math.abs((x.end-F)/x.ratio),tt=Y-x.end;if(F-=tt/2,Y-=tt/2,F>Y){var it=F;F=Y,Y=it}x._startClamp&&F<0?(Y=x.ratio<0?Cr():x.end/x.ratio,tt=Y-x.end,F=0):(x.ratio<0||x._endClamp&&Y>=Cr())&&(Y=Cr(),F=x.ratio<0||x.ratio>1?0:Y-(Y-x.start)/x.ratio,tt=(Y-F)*x.ratio-(x.end-x.start)),x.offset=tt||1e-4,x.pins.length=x.pins.offset=0,x.setPositions(F,Y,!0)}),q(re.sort())),Z.reset()},It=function(){return re.addEventListener("refresh",$t)},Ft=function(){return m&&m.forEach(function(x){return x.vars.onRefresh(x)})},bt=function(){return m&&m.forEach(function(x){return x.vars.onRefreshInit(x)}),Ft},Et=function(x,F,Y,tt){return function(){var it=typeof F=="function"?F(Y,tt):F;it||it===0||(it=tt.getAttribute("data-"+y+x)||(x==="speed"?1:0)),tt.setAttribute("data-"+y+x,it);var vt=(it+"").substr(0,6)==="clamp(";return{clamp:vt,value:vt?it.substr(6,it.length-7):it}}},Ht=function(x,F,Y,tt,it){it=(typeof it=="function"?it(tt,x):it)||0;var vt=Et("speed",F,tt,x),pt=Et("lag",Y,tt,x),lt=ye.getProperty(x,"y"),Lt=x._gsap,ht,yt,qt,ut,Tt,Wt,Zt=[],ue=function(){F=vt(),Y=parseFloat(pt().value),ht=parseFloat(F.value)||1,qt=F.value==="auto",Tt=qt||yt&&yt._startClamp&&yt.start<=0||Zt.offset?0:yt&&yt._endClamp&&yt.end===Cr()?1:.5,ut&&ut.kill(),ut=Y&&ye.to(x,{ease:ic,overwrite:!1,y:"+=0",duration:Y}),yt&&(yt.ratio=ht,yt.autoSpeed=qt)},Jt=function(){Lt.y=lt+"px",Lt.renderTransform(1),ue()},k=[],Q=0,st=function(gt){if(qt){Jt();var Bt=Fv(x,Hg(0,1,-gt.start/(gt.end-gt.start)));Q=Bt.change,Wt=Bt.offset}else Wt=Zt.offset||0,Q=(gt.end-gt.start-Wt)*(1-ht);Zt.forEach(function(ne){return Q-=ne.distance*(1-ht)}),gt.offset=Q||.001,gt.vars.onUpdate(gt),ut&&ut.progress(1)};return ue(),(ht!==1||qt||ut)&&(yt=re.create({trigger:qt?x.parentNode:x,start:function(){return F.clamp?"clamp(top bottom+="+it+")":"top bottom+="+it},end:function(){return F.value<0?"max":F.clamp?"clamp(bottom top-="+it+")":"bottom top-="+it},scroller:d,scrub:!0,refreshPriority:-999,onRefreshInit:Jt,onRefresh:st,onKill:function(gt){var Bt=m.indexOf(gt);Bt>=0&&m.splice(Bt,1),Jt()},onUpdate:function(gt){var Bt=lt+Q*(gt.progress-Tt),ne=Zt.length,Mt=0,L,rt,O;if(gt.offset){if(ne){for(rt=-V,O=gt.end;ne--;){if(L=Zt[ne],L.trig.isActive||rt>=L.start&&rt<=L.end){ut&&(L.trig.progress+=L.trig.direction<0?.001:-.001,L.trig.update(0,0,1),ut.resetTo("y",parseFloat(Lt.y),-$,!0),W&&ut.progress(1));return}rt>L.end&&(Mt+=L.distance),O-=L.distance}Bt=lt+Mt+Q*((ye.utils.clamp(gt.start,gt.end,rt)-gt.start-Mt)/(O-gt.start)-Tt)}k.length&&!qt&&k.forEach(function(j){return j(Bt-Mt)}),Bt=Lv(Bt+Wt),ut?(ut.resetTo("y",Bt,-$,!0),W&&ut.progress(1)):(Lt.y=Bt+"px",Lt.renderTransform(1))}}}),st(yt),ye.core.getCache(yt.trigger).stRevert=bt,yt.startY=lt,yt.pins=Zt,yt.markers=k,yt.ratio=ht,yt.autoSpeed=qt,x.style.willChange="transform"),yt};It(),re.addEventListener("killAll",It),ye.delayedCall(.5,function(){return W=0}),this.scrollTop=X,this.scrollTo=function(A,x,F){var Y=ye.utils.clamp(0,Cr(),isNaN(A)?e.offset(A,F,!!x&&!S):+A);x?S?ye.to(e,{duration:N,scrollTop:Y,overwrite:"auto",ease:ic}):I(Y):X(Y)},this.offset=function(A,x,F){A=Ss(A)[0];var Y=A.style.cssText,tt=re.create({trigger:A,start:x||"top top"}),it;return m&&(W?re.refresh():q([tt],!0)),it=tt.start/(F?C:1),tt.kill(!1),A.style.cssText=Y,ye.core.getCache(A).uncache=1,it};function G(){return u=f.clientHeight,f.style.overflow="visible",gi.style.height=rn.innerHeight+(u-rn.innerHeight)/C+"px",u-rn.innerHeight}this.content=function(A){if(arguments.length){var x=Ss(A||"#smooth-content")[0]||console.warn("ScrollSmoother needs a valid content element.")||gi.children[0];return x!==f&&(f=x,v=f.getAttribute("style")||"",ot&&ot.observe(f),ye.set(f,{overflow:"visible",width:"100%",boxSizing:"border-box",y:"+=0"}),N||ye.set(f,{clearProps:"transform"})),this}return f},this.wrapper=function(A){return arguments.length?(d=Ss(A||"#smooth-wrapper")[0]||Nv(f),b=d.getAttribute("style")||"",G(),ye.set(d,N?{overflow:"hidden",position:"fixed",height:"100%",width:"100%",top:0,left:0,right:0,bottom:0}:{overflow:"visible",position:"relative",width:"100%",height:"auto",top:"auto",bottom:"auto",left:"auto",right:"auto"}),this):d},this.effects=function(A,x){var F;if(m||(m=[]),!A)return m.slice(0);A=Ss(A),A.forEach(function(ht){for(var yt=m.length;yt--;)m[yt].trigger===ht&&m[yt].kill()}),x=x||{};var Y=x,tt=Y.speed,it=Y.lag,vt=Y.effectsPadding,pt=[],lt,Lt;for(lt=0;lt<A.length;lt++)Lt=Ht(A[lt],tt,it,lt,vt),Lt&&pt.push(Lt);return(F=m).push.apply(F,pt),x.refresh!==!1&&re.refresh(),pt},this.sections=function(A,x){var F;if(p||(p=[]),!A)return p.slice(0);var Y=Ss(A).map(function(tt){return re.create({trigger:tt,start:"top 120%",end:"bottom -20%",onToggle:function(vt){tt.style.opacity=vt.isActive?"1":"0",tt.style.pointerEvents=vt.isActive?"all":"none"}})});return x&&x.add?(F=p).push.apply(F,Y):p=Y.slice(0),Y},this.content(t.content),this.wrapper(t.wrapper),this.render=function(A){return Ut(A||A===0?A:V)},this.getVelocity=function(){return Z.getVelocity(-V)},re.scrollerProxy(d,{scrollTop:X,scrollHeight:function(){return G()&&gi.scrollHeight},fixedMarkers:t.fixedMarkers!==!1&&!!N,content:f,getBoundingClientRect:function(){return{top:0,left:0,width:rn.innerWidth,height:rn.innerHeight}}}),re.defaults({scroller:d});var jt=re.getAll().filter(function(A){return A.scroller===rn||A.scroller===d});jt.forEach(function(A){return A.revert(!0,!0)}),_=re.create({animation:ye.fromTo(U,{y:function(){return P=0,0}},{y:function(){return P=1,-G()},immediateRender:!1,ease:"none",data:"ScrollSmoother",duration:100,onUpdate:function(){if(P){var x=at;x&&(_t(_),U.y=V),Ut(U.y,x),z(),s&&!S&&s(M)}}}),onRefreshInit:function(x){if(!r.isRefreshing){if(r.isRefreshing=!0,m){var F=re.getAll().filter(function(tt){return!!tt.pin});m.forEach(function(tt){tt.vars.pinnedContainer||F.forEach(function(it){if(it.pin.contains(tt.trigger)){var vt=tt.vars;vt.pinnedContainer=it.pin,tt.vars=null,tt.init(vt,tt.animation)}})})}var Y=x.getTween();w=Y&&Y._end>Y._dp._time,T=V,U.y=0,N&&(re.isTouch===1&&(d.style.position="absolute"),d.scrollTop=0,re.isTouch===1&&(d.style.position="fixed"))}},onRefresh:function(x){x.animation.invalidate(),x.setPositions(x.start,G()/C),w||_t(x),U.y=-I()*C,Ut(U.y),W||(w&&(at=!1),x.animation.progress(ye.utils.clamp(0,1,T/C/-x.end))),w&&(x.progress-=.001,x.update()),r.isRefreshing=!1},id:"ScrollSmoother",scroller:rn,invalidateOnRefresh:!0,start:0,refreshPriority:-9999,end:function(){return G()/C},onScrubComplete:function(){Z.reset(),o&&o(e)},scrub:N||!0}),this.smooth=function(A){return arguments.length&&(N=A||0,C=N&&+t.speed||1,_.scrubDuration(A)),_.getTween()?_.getTween().duration():0},_.getTween()&&(_.getTween().vars.ease=t.ease||ic),this.scrollTrigger=_,t.effects&&this.effects(t.effects===!0?"[data-"+y+"speed], [data-"+y+"lag]":t.effects,{effectsPadding:t.effectsPadding,refresh:!1}),t.sections&&this.sections(t.sections===!0?"[data-section]":t.sections),jt.forEach(function(A){A.vars.scroller=d,A.revert(!1,!0),A.init(A.vars,A.animation)}),this.paused=function(A,x){return arguments.length?(!!S!==A&&(A?(_.getTween()&&_.getTween().pause(),I(-V/C),Z.reset(),D=re.normalizeScroll(),D&&D.disable(),S=re.observe({preventDefault:!0,type:"wheel,touch,scroll",debounce:!1,allowClicks:!0,onChangeY:function(){return X(-V)}}),S.nested=Wg(_o,"wheel,touch,scroll",!0,x!==!1)):(S.nested.kill(),S.kill(),S=0,D&&D.enable(),_.progress=(-V/C-_.start)/(_.end-_.start),_t(_))),this):!!S},this.kill=this.revert=function(){e.paused(!1),_t(_),_.kill();for(var A=(m||[]).concat(p||[]),x=A.length;x--;)A[x].kill();re.scrollerProxy(d),re.removeEventListener("killAll",It),re.removeEventListener("refresh",$t),d.style.cssText=b,f.style.cssText=v;var F=re.defaults({});F&&F.scroller===d&&re.defaults({scroller:rn}),e.normalizer&&re.normalizeScroll(!1),clearInterval(g),Fi=null,ot&&ot.disconnect(),gi.style.removeProperty("height"),rn.removeEventListener("focusin",ct)},this.refresh=function(A,x){return _.refresh(A,x)},c&&(this.normalizer=re.normalizeScroll(c===!0?{debounce:!0,content:!N&&f}:c)),re.config(t),"overscrollBehavior"in rn.getComputedStyle(gi)&&ye.set([gi,_o],{overscrollBehavior:"none"}),"scrollBehavior"in rn.getComputedStyle(gi)&&ye.set([gi,_o],{scrollBehavior:"auto"}),rn.addEventListener("focusin",ct),g=setInterval(z,250),Ms.readyState==="loading"||requestAnimationFrame(function(){return re.refresh()})}return r.register=function(e){return nc||(ye=e||Zg(),qg()&&window.document&&(rn=window,Ms=document,_o=Ms.documentElement,gi=Ms.body),ye&&(Ss=ye.utils.toArray,Hg=ye.utils.clamp,ic=ye.parseEase("expo"),Xg=ye.core.context||function(){},re=ye.core.globals().ScrollTrigger,ye.core.globals("ScrollSmoother",r),gi&&re&&(Yg=ye.delayedCall(.2,function(){return re.isRefreshing||Fi&&Fi.refresh()}).pause(),Iv=[rn,Ms,_o,gi],Gg=re.core._getVelocityProp,Wg=re.core._inputObserver,r.refresh=re.refresh,nc=1))),nc},Pv(r,[{key:"progress",get:function(){return this.scrollTrigger?this.scrollTrigger.animation._time/100:0}}]),r}();ji.version="3.12.5";ji.create=function(r){return Fi&&r&&Fi.content()===Ss(r.content)[0]?Fi:new ji(r)};ji.get=function(){return Fi};Zg()&&ye.registerPlugin(ji);Kt.registerPlugin(ji,Yt);var Jg=()=>{Kt.registerPlugin(ji),ji.create({smooth:1.5,effects:!0}),Yt.refresh()};var yd="164";var Uv=0,$g=1,Ov=2;var M0=1,vd=2,rr=3,Hr=0,Un=1,or=2,kr=0,zr=1,Kg=2,jg=3,Qg=4,Bv=5,Rs=100,kv=101,zv=102,Vv=103,Hv=104,Gv=200,Wv=201,Xv=202,Yv=203,Uf=204,Of=205,qv=206,Zv=207,Jv=208,$v=209,Kv=210,jv=211,Qv=212,tS=213,eS=214,nS=0,iS=1,rS=2,Cc=3,sS=4,oS=5,aS=6,lS=7,b0=0,cS=1,uS=2,Vr=0,hS=1,fS=2,dS=3,pS=4,mS=5,gS=6,_S=7;var w0=300,zo=301,Vo=302,Bf=303,kf=304,nu=306,zf=1e3,Is=1001,Vf=1002,ii=1003,xS=1004;var rc=1005;var vi=1006,ef=1007;var Ls=1008;var Gr=1009,yS=1010,vS=1011,E0=1012,T0=1013,Ho=1014,Or=1015,iu=1016,A0=1017,D0=1018,Qa=1020,SS=35902,MS=1021,bS=1022,Ui=1023,wS=1024,ES=1025,Oo=1026,Ja=1027,TS=1028,C0=1029,AS=1030,R0=1031,P0=1033,nf=33776,rf=33777,sf=33778,of=33779,t_=35840,e_=35841,n_=35842,i_=35843,r_=36196,s_=37492,o_=37496,a_=37808,l_=37809,c_=37810,u_=37811,h_=37812,f_=37813,d_=37814,p_=37815,m_=37816,g_=37817,__=37818,x_=37819,y_=37820,v_=37821,af=36492,S_=36494,M_=36495,DS=36283,b_=36284,w_=36285,E_=36286;var Rc=2300,Pc=2301,lf=2302,T_=2400,A_=2401,D_=2402;var CS=3200,RS=3201,PS=0,IS=1,Ur="",ni="srgb",Yr="srgb-linear",Sd="display-p3",ru="display-p3-linear",Ic="linear",Te="srgb",Lc="rec709",Fc="p3";var xo=7680;var C_=519,LS=512,FS=513,NS=514,I0=515,US=516,OS=517,BS=518,kS=519,R_=35044;var P_="300 es",ar=2e3,Nc=2001,Wr=class{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[t]===void 0&&(n[t]=[]),n[t].indexOf(e)===-1&&n[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;let n=this._listeners;return n[t]!==void 0&&n[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;let i=this._listeners[t];if(i!==void 0){let s=i.indexOf(e);s!==-1&&i.splice(s,1)}}dispatchEvent(t){if(this._listeners===void 0)return;let n=this._listeners[t.type];if(n!==void 0){t.target=this;let i=n.slice(0);for(let s=0,o=i.length;s<o;s++)i[s].call(this,t);t.target=null}}},pn=["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"];var cf=Math.PI/180,Hf=180/Math.PI;function tl(){let r=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(pn[r&255]+pn[r>>8&255]+pn[r>>16&255]+pn[r>>24&255]+"-"+pn[t&255]+pn[t>>8&255]+"-"+pn[t>>16&15|64]+pn[t>>24&255]+"-"+pn[e&63|128]+pn[e>>8&255]+"-"+pn[e>>16&255]+pn[e>>24&255]+pn[n&255]+pn[n>>8&255]+pn[n>>16&255]+pn[n>>24&255]).toLowerCase()}function Nn(r,t,e){return Math.max(t,Math.min(e,r))}function zS(r,t){return(r%t+t)%t}function uf(r,t,e){return(1-e)*r+e*t}function Ha(r,t){switch(t.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function Fn(r,t){switch(t.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}var _e=class r{constructor(t=0,e=0){r.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){let e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[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=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=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){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(Nn(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y;return e*e+n*n}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,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,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){let n=Math.cos(e),i=Math.sin(e),s=this.x-t.x,o=this.y-t.y;return this.x=s*n-o*i+t.x,this.y=s*i+o*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},oe=class r{constructor(t,e,n,i,s,o,a,l,c){r.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,n,i,s,o,a,l,c)}set(t,e,n,i,s,o,a,l,c){let h=this.elements;return h[0]=t,h[1]=i,h[2]=a,h[3]=e,h[4]=s,h[5]=l,h[6]=n,h[7]=o,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){let 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){let n=t.elements,i=e.elements,s=this.elements,o=n[0],a=n[3],l=n[6],c=n[1],h=n[4],f=n[7],d=n[2],u=n[5],_=n[8],m=i[0],p=i[3],g=i[6],b=i[1],v=i[4],S=i[7],D=i[2],T=i[5],w=i[8];return s[0]=o*m+a*b+l*D,s[3]=o*p+a*v+l*T,s[6]=o*g+a*S+l*w,s[1]=c*m+h*b+f*D,s[4]=c*p+h*v+f*T,s[7]=c*g+h*S+f*w,s[2]=d*m+u*b+_*D,s[5]=d*p+u*v+_*T,s[8]=d*g+u*S+_*w,this}multiplyScalar(t){let 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(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],h=t[8];return e*o*h-e*a*c-n*s*h+n*a*l+i*s*c-i*o*l}invert(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],h=t[8],f=h*o-a*c,d=a*l-h*s,u=c*s-o*l,_=e*f+n*d+i*u;if(_===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/_;return t[0]=f*m,t[1]=(i*c-h*n)*m,t[2]=(a*n-i*o)*m,t[3]=d*m,t[4]=(h*e-i*l)*m,t[5]=(i*s-a*e)*m,t[6]=u*m,t[7]=(n*l-c*e)*m,t[8]=(o*e-n*s)*m,this}transpose(){let t,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){let 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,n,i,s,o,a){let l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*o+c*a)+o+t,-i*c,i*l,-i*(-c*o+l*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(hf.makeScale(t,e)),this}rotate(t){return this.premultiply(hf.makeRotation(-t)),this}translate(t,e){return this.premultiply(hf.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){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){let e=this.elements,n=t.elements;for(let i=0;i<9;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return new this.constructor().fromArray(this.elements)}},hf=new oe;function L0(r){for(let t=r.length-1;t>=0;--t)if(r[t]>=65535)return!0;return!1}function Uc(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function VS(){let r=Uc("canvas");return r.style.display="block",r}var I_={};function HS(r){r in I_||(I_[r]=!0,console.warn(r))}var L_=new oe().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),F_=new oe().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),sc={[Yr]:{transfer:Ic,primaries:Lc,toReference:r=>r,fromReference:r=>r},[ni]:{transfer:Te,primaries:Lc,toReference:r=>r.convertSRGBToLinear(),fromReference:r=>r.convertLinearToSRGB()},[ru]:{transfer:Ic,primaries:Fc,toReference:r=>r.applyMatrix3(F_),fromReference:r=>r.applyMatrix3(L_)},[Sd]:{transfer:Te,primaries:Fc,toReference:r=>r.convertSRGBToLinear().applyMatrix3(F_),fromReference:r=>r.applyMatrix3(L_).convertLinearToSRGB()}},GS=new Set([Yr,ru]),Se={enabled:!0,_workingColorSpace:Yr,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(r){if(!GS.has(r))throw new Error(`Unsupported working color space, "${r}".`);this._workingColorSpace=r},convert:function(r,t,e){if(this.enabled===!1||t===e||!t||!e)return r;let n=sc[t].toReference,i=sc[e].fromReference;return i(n(r))},fromWorkingColorSpace:function(r,t){return this.convert(r,this._workingColorSpace,t)},toWorkingColorSpace:function(r,t){return this.convert(r,t,this._workingColorSpace)},getPrimaries:function(r){return sc[r].primaries},getTransfer:function(r){return r===Ur?Ic:sc[r].transfer}};function Bo(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function ff(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}var yo,Gf=class{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{yo===void 0&&(yo=Uc("canvas")),yo.width=t.width,yo.height=t.height;let n=yo.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=yo}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){let e=Uc("canvas");e.width=t.width,e.height=t.height;let n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);let i=n.getImageData(0,0,t.width,t.height),s=i.data;for(let o=0;o<s.length;o++)s[o]=Bo(s[o]/255)*255;return n.putImageData(i,0,0),e}else if(t.data){let e=t.data.slice(0);for(let n=0;n<e.length;n++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[n]=Math.floor(Bo(e[n]/255)*255):e[n]=Bo(e[n]);return{data:e,width:t.width,height:t.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}},WS=0,Oc=class{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:WS++}),this.uuid=tl(),this.data=t,this.dataReady=!0,this.version=0}set needsUpdate(t){t===!0&&this.version++}toJSON(t){let e=t===void 0||typeof t=="string";if(!e&&t.images[this.uuid]!==void 0)return t.images[this.uuid];let n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let s;if(Array.isArray(i)){s=[];for(let o=0,a=i.length;o<a;o++)i[o].isDataTexture?s.push(df(i[o].image)):s.push(df(i[o]))}else s=df(i);n.url=s}return e||(t.images[this.uuid]=n),n}};function df(r){return typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&r instanceof ImageBitmap?Gf.getDataURL(r):r.data?{data:Array.from(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var XS=0,oi=class r extends Wr{constructor(t=r.DEFAULT_IMAGE,e=r.DEFAULT_MAPPING,n=Is,i=Is,s=vi,o=Ls,a=Ui,l=Gr,c=r.DEFAULT_ANISOTROPY,h=Ur){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:XS++}),this.uuid=tl(),this.name="",this.source=new Oc(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=l,this.offset=new _e(0,0),this.repeat=new _e(1,1),this.center=new _e(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new oe,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!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.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){let e=t===void 0||typeof t=="string";if(!e&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];let n={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&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==w0)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case zf:t.x=t.x-Math.floor(t.x);break;case Is:t.x=t.x<0?0:1;break;case Vf:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case zf:t.y=t.y-Math.floor(t.y);break;case Is:t.y=t.y<0?0:1;break;case Vf:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(t){t===!0&&this.pmremVersion++}};oi.DEFAULT_IMAGE=null;oi.DEFAULT_MAPPING=w0;oi.DEFAULT_ANISOTROPY=1;var Qe=class r{constructor(t=0,e=0,n=0,i=1){r.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=i}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,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,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=t.w!==void 0?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){let e=this.x,n=this.y,i=this.z,s=this.w,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*e+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*e+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*e+o[7]*n+o[11]*i+o[15]*s,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);let 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,n,i,s,l=t.elements,c=l[0],h=l[4],f=l[8],d=l[1],u=l[5],_=l[9],m=l[2],p=l[6],g=l[10];if(Math.abs(h-d)<.01&&Math.abs(f-m)<.01&&Math.abs(_-p)<.01){if(Math.abs(h+d)<.1&&Math.abs(f+m)<.1&&Math.abs(_+p)<.1&&Math.abs(c+u+g-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;let v=(c+1)/2,S=(u+1)/2,D=(g+1)/2,T=(h+d)/4,w=(f+m)/4,P=(_+p)/4;return v>S&&v>D?v<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(v),i=T/n,s=w/n):S>D?S<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(S),n=T/i,s=P/i):D<.01?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(D),n=w/s,i=P/s),this.set(n,i,s,e),this}let b=Math.sqrt((p-_)*(p-_)+(f-m)*(f-m)+(d-h)*(d-h));return Math.abs(b)<.001&&(b=1),this.x=(p-_)/b,this.y=(f-m)/b,this.z=(d-h)/b,this.w=Math.acos((c+u+g-1)/2),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=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=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,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,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}},Wf=class extends Wr{constructor(t=1,e=1,n={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new Qe(0,0,t,e),this.scissorTest=!1,this.viewport=new Qe(0,0,t,e);let i={width:t,height:e,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:vi,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);let s=new oi(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);s.flipY=!1,s.generateMipmaps=n.generateMipmaps,s.internalFormat=n.internalFormat,this.textures=[];let o=n.count;for(let a=0;a<o;a++)this.textures[a]=s.clone(),this.textures[a].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}setSize(t,e,n=1){if(this.width!==t||this.height!==e||this.depth!==n){this.width=t,this.height=e,this.depth=n;for(let i=0,s=this.textures.length;i<s;i++)this.textures[i].image.width=t,this.textures[i].image.height=e,this.textures[i].image.depth=n;this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let n=0,i=t.textures.length;n<i;n++)this.textures[n]=t.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0;let e=Object.assign({},t.texture.image);return this.texture.source=new Oc(e),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,t.depthTexture!==null&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}},lr=class extends Wf{constructor(t=1,e=1,n={}){super(t,e,n),this.isWebGLRenderTarget=!0}},Bc=class extends oi{constructor(t=null,e=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=ii,this.minFilter=ii,this.wrapR=Is,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var Xf=class extends oi{constructor(t=null,e=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:n,depth:i},this.magFilter=ii,this.minFilter=ii,this.wrapR=Is,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var Xr=class{constructor(t=0,e=0,n=0,i=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=i}static slerpFlat(t,e,n,i,s,o,a){let l=n[i+0],c=n[i+1],h=n[i+2],f=n[i+3],d=s[o+0],u=s[o+1],_=s[o+2],m=s[o+3];if(a===0){t[e+0]=l,t[e+1]=c,t[e+2]=h,t[e+3]=f;return}if(a===1){t[e+0]=d,t[e+1]=u,t[e+2]=_,t[e+3]=m;return}if(f!==m||l!==d||c!==u||h!==_){let p=1-a,g=l*d+c*u+h*_+f*m,b=g>=0?1:-1,v=1-g*g;if(v>Number.EPSILON){let D=Math.sqrt(v),T=Math.atan2(D,g*b);p=Math.sin(p*T)/D,a=Math.sin(a*T)/D}let S=a*b;if(l=l*p+d*S,c=c*p+u*S,h=h*p+_*S,f=f*p+m*S,p===1-a){let D=1/Math.sqrt(l*l+c*c+h*h+f*f);l*=D,c*=D,h*=D,f*=D}}t[e]=l,t[e+1]=c,t[e+2]=h,t[e+3]=f}static multiplyQuaternionsFlat(t,e,n,i,s,o){let a=n[i],l=n[i+1],c=n[i+2],h=n[i+3],f=s[o],d=s[o+1],u=s[o+2],_=s[o+3];return t[e]=a*_+h*f+l*u-c*d,t[e+1]=l*_+h*d+c*f-a*u,t[e+2]=c*_+h*u+a*d-l*f,t[e+3]=h*_-a*f-l*d-c*u,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,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,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){let n=t._x,i=t._y,s=t._z,o=t._order,a=Math.cos,l=Math.sin,c=a(n/2),h=a(i/2),f=a(s/2),d=l(n/2),u=l(i/2),_=l(s/2);switch(o){case"XYZ":this._x=d*h*f+c*u*_,this._y=c*u*f-d*h*_,this._z=c*h*_+d*u*f,this._w=c*h*f-d*u*_;break;case"YXZ":this._x=d*h*f+c*u*_,this._y=c*u*f-d*h*_,this._z=c*h*_-d*u*f,this._w=c*h*f+d*u*_;break;case"ZXY":this._x=d*h*f-c*u*_,this._y=c*u*f+d*h*_,this._z=c*h*_+d*u*f,this._w=c*h*f-d*u*_;break;case"ZYX":this._x=d*h*f-c*u*_,this._y=c*u*f+d*h*_,this._z=c*h*_-d*u*f,this._w=c*h*f+d*u*_;break;case"YZX":this._x=d*h*f+c*u*_,this._y=c*u*f+d*h*_,this._z=c*h*_-d*u*f,this._w=c*h*f-d*u*_;break;case"XZY":this._x=d*h*f-c*u*_,this._y=c*u*f-d*h*_,this._z=c*h*_+d*u*f,this._w=c*h*f+d*u*_;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){let n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){let e=t.elements,n=e[0],i=e[4],s=e[8],o=e[1],a=e[5],l=e[9],c=e[2],h=e[6],f=e[10],d=n+a+f;if(d>0){let u=.5/Math.sqrt(d+1);this._w=.25/u,this._x=(h-l)*u,this._y=(s-c)*u,this._z=(o-i)*u}else if(n>a&&n>f){let u=2*Math.sqrt(1+n-a-f);this._w=(h-l)/u,this._x=.25*u,this._y=(i+o)/u,this._z=(s+c)/u}else if(a>f){let u=2*Math.sqrt(1+a-n-f);this._w=(s-c)/u,this._x=(i+o)/u,this._y=.25*u,this._z=(l+h)/u}else{let u=2*Math.sqrt(1+f-n-a);this._w=(o-i)/u,this._x=(s+c)/u,this._y=(l+h)/u,this._z=.25*u}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Nn(this.dot(t),-1,1)))}rotateTowards(t,e){let n=this.angleTo(t);if(n===0)return this;let i=Math.min(1,e/n);return this.slerp(t,i),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 t===0?(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){let n=t._x,i=t._y,s=t._z,o=t._w,a=e._x,l=e._y,c=e._z,h=e._w;return this._x=n*h+o*a+i*c-s*l,this._y=i*h+o*l+s*a-n*c,this._z=s*h+o*c+n*l-i*a,this._w=o*h-n*a-i*l-s*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);let n=this._x,i=this._y,s=this._z,o=this._w,a=o*t._w+n*t._x+i*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=o,this._x=n,this._y=i,this._z=s,this;let l=1-a*a;if(l<=Number.EPSILON){let u=1-e;return this._w=u*o+e*this._w,this._x=u*n+e*this._x,this._y=u*i+e*this._y,this._z=u*s+e*this._z,this.normalize(),this}let c=Math.sqrt(l),h=Math.atan2(c,a),f=Math.sin((1-e)*h)/c,d=Math.sin(e*h)/c;return this._w=o*f+this._w*d,this._x=n*f+this._x*d,this._y=i*f+this._y*d,this._z=s*f+this._z*d,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){let t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(i*Math.sin(t),i*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}},nt=class r{constructor(t=0,e=0,n=0){r.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return n===void 0&&(n=this.z),this.x=t,this.y=e,this.z=n,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(N_.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(N_.setFromAxisAngle(t,e))}applyMatrix3(t){let e=this.x,n=this.y,i=this.z,s=t.elements;return this.x=s[0]*e+s[3]*n+s[6]*i,this.y=s[1]*e+s[4]*n+s[7]*i,this.z=s[2]*e+s[5]*n+s[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){let e=this.x,n=this.y,i=this.z,s=t.elements,o=1/(s[3]*e+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*e+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*e+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*e+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(t){let e=this.x,n=this.y,i=this.z,s=t.x,o=t.y,a=t.z,l=t.w,c=2*(o*i-a*n),h=2*(a*e-s*i),f=2*(s*n-o*e);return this.x=e+l*c+o*f-a*h,this.y=n+l*h+a*c-s*f,this.z=i+l*f+s*h-o*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){let e=this.x,n=this.y,i=this.z,s=t.elements;return this.x=s[0]*e+s[4]*n+s[8]*i,this.y=s[1]*e+s[5]*n+s[9]*i,this.z=s[2]*e+s[6]*n+s[10]*i,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=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=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,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){let n=t.x,i=t.y,s=t.z,o=e.x,a=e.y,l=e.z;return this.x=i*l-s*a,this.y=s*o-n*l,this.z=n*a-i*o,this}projectOnVector(t){let e=t.lengthSq();if(e===0)return this.set(0,0,0);let n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return pf.copy(this).projectOnVector(t),this.sub(pf)}reflect(t){return this.sub(pf.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(Nn(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}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,n){let i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){let e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}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(){let t=Math.random()*Math.PI*2,e=Math.random()*2-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},pf=new nt,N_=new Xr,Fs=class{constructor(t=new nt(1/0,1/0,1/0),e=new nt(-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,n=t.length;e<n;e+=3)this.expandByPoint(_i.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,n=t.count;e<n;e++)this.expandByPoint(_i.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){let n=_i.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),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);let n=t.geometry;if(n!==void 0){let s=n.getAttribute("position");if(e===!0&&s!==void 0&&t.isInstancedMesh!==!0)for(let o=0,a=s.count;o<a;o++)t.isMesh===!0?t.getVertexPosition(o,_i):_i.fromBufferAttribute(s,o),_i.applyMatrix4(t.matrixWorld),this.expandByPoint(_i);else t.boundingBox!==void 0?(t.boundingBox===null&&t.computeBoundingBox(),oc.copy(t.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),oc.copy(n.boundingBox)),oc.applyMatrix4(t.matrixWorld),this.union(oc)}let i=t.children;for(let s=0,o=i.length;s<o;s++)this.expandByObject(i[s],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,_i),_i.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Ga),ac.subVectors(this.max,Ga),vo.subVectors(t.a,Ga),So.subVectors(t.b,Ga),Mo.subVectors(t.c,Ga),Rr.subVectors(So,vo),Pr.subVectors(Mo,So),bs.subVectors(vo,Mo);let e=[0,-Rr.z,Rr.y,0,-Pr.z,Pr.y,0,-bs.z,bs.y,Rr.z,0,-Rr.x,Pr.z,0,-Pr.x,bs.z,0,-bs.x,-Rr.y,Rr.x,0,-Pr.y,Pr.x,0,-bs.y,bs.x,0];return!mf(e,vo,So,Mo,ac)||(e=[1,0,0,0,1,0,0,0,1],!mf(e,vo,So,Mo,ac))?!1:(lc.crossVectors(Rr,Pr),e=[lc.x,lc.y,lc.z],mf(e,vo,So,Mo,ac))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,_i).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(_i).length()*.5),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()?this:(Qi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Qi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Qi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Qi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Qi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Qi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Qi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Qi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Qi),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)}},Qi=[new nt,new nt,new nt,new nt,new nt,new nt,new nt,new nt],_i=new nt,oc=new Fs,vo=new nt,So=new nt,Mo=new nt,Rr=new nt,Pr=new nt,bs=new nt,Ga=new nt,ac=new nt,lc=new nt,ws=new nt;function mf(r,t,e,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){ws.fromArray(r,s);let a=i.x*Math.abs(ws.x)+i.y*Math.abs(ws.y)+i.z*Math.abs(ws.z),l=t.dot(ws),c=e.dot(ws),h=n.dot(ws);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>a)return!1}return!0}var YS=new Fs,Wa=new nt,gf=new nt,Go=class{constructor(t=new nt,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){let n=this.center;e!==void 0?n.copy(e):YS.setFromPoints(t).getCenter(n);let i=0;for(let s=0,o=t.length;s<o;s++)i=Math.max(i,n.distanceToSquared(t[s]));return this.radius=Math.sqrt(i),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){let 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){let n=this.center.distanceToSquared(t);return e.copy(t),n>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;Wa.subVectors(t,this.center);let e=Wa.lengthSq();if(e>this.radius*this.radius){let n=Math.sqrt(e),i=(n-this.radius)*.5;this.center.addScaledVector(Wa,i/n),this.radius+=i}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(gf.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Wa.copy(t.center).add(gf)),this.expandByPoint(Wa.copy(t.center).sub(gf))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}},tr=new nt,_f=new nt,cc=new nt,Ir=new nt,xf=new nt,uc=new nt,yf=new nt,kc=class{constructor(t=new nt,e=new nt(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,tr)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);let n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){let e=tr.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(tr.copy(this.origin).addScaledVector(this.direction,e),tr.distanceToSquared(t))}distanceSqToSegment(t,e,n,i){_f.copy(t).add(e).multiplyScalar(.5),cc.copy(e).sub(t).normalize(),Ir.copy(this.origin).sub(_f);let s=t.distanceTo(e)*.5,o=-this.direction.dot(cc),a=Ir.dot(this.direction),l=-Ir.dot(cc),c=Ir.lengthSq(),h=Math.abs(1-o*o),f,d,u,_;if(h>0)if(f=o*l-a,d=o*a-l,_=s*h,f>=0)if(d>=-_)if(d<=_){let m=1/h;f*=m,d*=m,u=f*(f+o*d+2*a)+d*(o*f+d+2*l)+c}else d=s,f=Math.max(0,-(o*d+a)),u=-f*f+d*(d+2*l)+c;else d=-s,f=Math.max(0,-(o*d+a)),u=-f*f+d*(d+2*l)+c;else d<=-_?(f=Math.max(0,-(-o*s+a)),d=f>0?-s:Math.min(Math.max(-s,-l),s),u=-f*f+d*(d+2*l)+c):d<=_?(f=0,d=Math.min(Math.max(-s,-l),s),u=d*(d+2*l)+c):(f=Math.max(0,-(o*s+a)),d=f>0?s:Math.min(Math.max(-s,-l),s),u=-f*f+d*(d+2*l)+c);else d=o>0?-s:s,f=Math.max(0,-(o*d+a)),u=-f*f+d*(d+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,f),i&&i.copy(_f).addScaledVector(cc,d),u}intersectSphere(t,e){tr.subVectors(t.center,this.origin);let n=tr.dot(this.direction),i=tr.dot(tr)-n*n,s=t.radius*t.radius;if(i>s)return null;let o=Math.sqrt(s-i),a=n-o,l=n+o;return l<0?null:a<0?this.at(l,e):this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){let e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){let n=this.distanceToPlane(t);return n===null?null:this.at(n,e)}intersectsPlane(t){let e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,i,s,o,a,l,c=1/this.direction.x,h=1/this.direction.y,f=1/this.direction.z,d=this.origin;return c>=0?(n=(t.min.x-d.x)*c,i=(t.max.x-d.x)*c):(n=(t.max.x-d.x)*c,i=(t.min.x-d.x)*c),h>=0?(s=(t.min.y-d.y)*h,o=(t.max.y-d.y)*h):(s=(t.max.y-d.y)*h,o=(t.min.y-d.y)*h),n>o||s>i||((s>n||isNaN(n))&&(n=s),(o<i||isNaN(i))&&(i=o),f>=0?(a=(t.min.z-d.z)*f,l=(t.max.z-d.z)*f):(a=(t.max.z-d.z)*f,l=(t.min.z-d.z)*f),n>l||a>i)||((a>n||n!==n)&&(n=a),(l<i||i!==i)&&(i=l),i<0)?null:this.at(n>=0?n:i,e)}intersectsBox(t){return this.intersectBox(t,tr)!==null}intersectTriangle(t,e,n,i,s){xf.subVectors(e,t),uc.subVectors(n,t),yf.crossVectors(xf,uc);let o=this.direction.dot(yf),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;Ir.subVectors(this.origin,t);let l=a*this.direction.dot(uc.crossVectors(Ir,uc));if(l<0)return null;let c=a*this.direction.dot(xf.cross(Ir));if(c<0||l+c>o)return null;let h=-a*Ir.dot(yf);return h<0?null:this.at(h/o,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)}},Oe=class r{constructor(t,e,n,i,s,o,a,l,c,h,f,d,u,_,m,p){r.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,n,i,s,o,a,l,c,h,f,d,u,_,m,p)}set(t,e,n,i,s,o,a,l,c,h,f,d,u,_,m,p){let g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=i,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=c,g[6]=h,g[10]=f,g[14]=d,g[3]=u,g[7]=_,g[11]=m,g[15]=p,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 r().fromArray(this.elements)}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){let e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){let 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,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){let e=this.elements,n=t.elements,i=1/bo.setFromMatrixColumn(t,0).length(),s=1/bo.setFromMatrixColumn(t,1).length(),o=1/bo.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*s,e[5]=n[5]*s,e[6]=n[6]*s,e[7]=0,e[8]=n[8]*o,e[9]=n[9]*o,e[10]=n[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){let e=this.elements,n=t.x,i=t.y,s=t.z,o=Math.cos(n),a=Math.sin(n),l=Math.cos(i),c=Math.sin(i),h=Math.cos(s),f=Math.sin(s);if(t.order==="XYZ"){let d=o*h,u=o*f,_=a*h,m=a*f;e[0]=l*h,e[4]=-l*f,e[8]=c,e[1]=u+_*c,e[5]=d-m*c,e[9]=-a*l,e[2]=m-d*c,e[6]=_+u*c,e[10]=o*l}else if(t.order==="YXZ"){let d=l*h,u=l*f,_=c*h,m=c*f;e[0]=d+m*a,e[4]=_*a-u,e[8]=o*c,e[1]=o*f,e[5]=o*h,e[9]=-a,e[2]=u*a-_,e[6]=m+d*a,e[10]=o*l}else if(t.order==="ZXY"){let d=l*h,u=l*f,_=c*h,m=c*f;e[0]=d-m*a,e[4]=-o*f,e[8]=_+u*a,e[1]=u+_*a,e[5]=o*h,e[9]=m-d*a,e[2]=-o*c,e[6]=a,e[10]=o*l}else if(t.order==="ZYX"){let d=o*h,u=o*f,_=a*h,m=a*f;e[0]=l*h,e[4]=_*c-u,e[8]=d*c+m,e[1]=l*f,e[5]=m*c+d,e[9]=u*c-_,e[2]=-c,e[6]=a*l,e[10]=o*l}else if(t.order==="YZX"){let d=o*l,u=o*c,_=a*l,m=a*c;e[0]=l*h,e[4]=m-d*f,e[8]=_*f+u,e[1]=f,e[5]=o*h,e[9]=-a*h,e[2]=-c*h,e[6]=u*f+_,e[10]=d-m*f}else if(t.order==="XZY"){let d=o*l,u=o*c,_=a*l,m=a*c;e[0]=l*h,e[4]=-f,e[8]=c*h,e[1]=d*f+m,e[5]=o*h,e[9]=u*f-_,e[2]=_*f-u,e[6]=a*h,e[10]=m*f+d}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(qS,t,ZS)}lookAt(t,e,n){let i=this.elements;return Gn.subVectors(t,e),Gn.lengthSq()===0&&(Gn.z=1),Gn.normalize(),Lr.crossVectors(n,Gn),Lr.lengthSq()===0&&(Math.abs(n.z)===1?Gn.x+=1e-4:Gn.z+=1e-4,Gn.normalize(),Lr.crossVectors(n,Gn)),Lr.normalize(),hc.crossVectors(Gn,Lr),i[0]=Lr.x,i[4]=hc.x,i[8]=Gn.x,i[1]=Lr.y,i[5]=hc.y,i[9]=Gn.y,i[2]=Lr.z,i[6]=hc.z,i[10]=Gn.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,i=e.elements,s=this.elements,o=n[0],a=n[4],l=n[8],c=n[12],h=n[1],f=n[5],d=n[9],u=n[13],_=n[2],m=n[6],p=n[10],g=n[14],b=n[3],v=n[7],S=n[11],D=n[15],T=i[0],w=i[4],P=i[8],M=i[12],y=i[1],I=i[5],N=i[9],C=i[13],V=i[2],$=i[6],W=i[10],Z=i[14],z=i[3],U=i[7],R=i[11],at=i[15];return s[0]=o*T+a*y+l*V+c*z,s[4]=o*w+a*I+l*$+c*U,s[8]=o*P+a*N+l*W+c*R,s[12]=o*M+a*C+l*Z+c*at,s[1]=h*T+f*y+d*V+u*z,s[5]=h*w+f*I+d*$+u*U,s[9]=h*P+f*N+d*W+u*R,s[13]=h*M+f*C+d*Z+u*at,s[2]=_*T+m*y+p*V+g*z,s[6]=_*w+m*I+p*$+g*U,s[10]=_*P+m*N+p*W+g*R,s[14]=_*M+m*C+p*Z+g*at,s[3]=b*T+v*y+S*V+D*z,s[7]=b*w+v*I+S*$+D*U,s[11]=b*P+v*N+S*W+D*R,s[15]=b*M+v*C+S*Z+D*at,this}multiplyScalar(t){let 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(){let t=this.elements,e=t[0],n=t[4],i=t[8],s=t[12],o=t[1],a=t[5],l=t[9],c=t[13],h=t[2],f=t[6],d=t[10],u=t[14],_=t[3],m=t[7],p=t[11],g=t[15];return _*(+s*l*f-i*c*f-s*a*d+n*c*d+i*a*u-n*l*u)+m*(+e*l*u-e*c*d+s*o*d-i*o*u+i*c*h-s*l*h)+p*(+e*c*f-e*a*u-s*o*f+n*o*u+s*a*h-n*c*h)+g*(-i*a*h-e*l*f+e*a*d+i*o*f-n*o*d+n*l*h)}transpose(){let t=this.elements,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,n){let i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this}invert(){let t=this.elements,e=t[0],n=t[1],i=t[2],s=t[3],o=t[4],a=t[5],l=t[6],c=t[7],h=t[8],f=t[9],d=t[10],u=t[11],_=t[12],m=t[13],p=t[14],g=t[15],b=f*p*c-m*d*c+m*l*u-a*p*u-f*l*g+a*d*g,v=_*d*c-h*p*c-_*l*u+o*p*u+h*l*g-o*d*g,S=h*m*c-_*f*c+_*a*u-o*m*u-h*a*g+o*f*g,D=_*f*l-h*m*l-_*a*d+o*m*d+h*a*p-o*f*p,T=e*b+n*v+i*S+s*D;if(T===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let w=1/T;return t[0]=b*w,t[1]=(m*d*s-f*p*s-m*i*u+n*p*u+f*i*g-n*d*g)*w,t[2]=(a*p*s-m*l*s+m*i*c-n*p*c-a*i*g+n*l*g)*w,t[3]=(f*l*s-a*d*s-f*i*c+n*d*c+a*i*u-n*l*u)*w,t[4]=v*w,t[5]=(h*p*s-_*d*s+_*i*u-e*p*u-h*i*g+e*d*g)*w,t[6]=(_*l*s-o*p*s-_*i*c+e*p*c+o*i*g-e*l*g)*w,t[7]=(o*d*s-h*l*s+h*i*c-e*d*c-o*i*u+e*l*u)*w,t[8]=S*w,t[9]=(_*f*s-h*m*s-_*n*u+e*m*u+h*n*g-e*f*g)*w,t[10]=(o*m*s-_*a*s+_*n*c-e*m*c-o*n*g+e*a*g)*w,t[11]=(h*a*s-o*f*s-h*n*c+e*f*c+o*n*u-e*a*u)*w,t[12]=D*w,t[13]=(h*m*i-_*f*i+_*n*d-e*m*d-h*n*p+e*f*p)*w,t[14]=(_*a*i-o*m*i-_*n*l+e*m*l+o*n*p-e*a*p)*w,t[15]=(o*f*i-h*a*i+h*n*l-e*f*l-o*n*d+e*a*d)*w,this}scale(t){let e=this.elements,n=t.x,i=t.y,s=t.z;return e[0]*=n,e[4]*=i,e[8]*=s,e[1]*=n,e[5]*=i,e[9]*=s,e[2]*=n,e[6]*=i,e[10]*=s,e[3]*=n,e[7]*=i,e[11]*=s,this}getMaxScaleOnAxis(){let t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){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,n,0,0,0,1),this}makeRotationX(t){let e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){let n=Math.cos(e),i=Math.sin(e),s=1-n,o=t.x,a=t.y,l=t.z,c=s*o,h=s*a;return this.set(c*o+n,c*a-i*l,c*l+i*a,0,c*a+i*l,h*a+n,h*l-i*o,0,c*l-i*a,h*l+i*o,s*l*l+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,i,s,o){return this.set(1,n,s,0,t,1,o,0,e,i,1,0,0,0,0,1),this}compose(t,e,n){let i=this.elements,s=e._x,o=e._y,a=e._z,l=e._w,c=s+s,h=o+o,f=a+a,d=s*c,u=s*h,_=s*f,m=o*h,p=o*f,g=a*f,b=l*c,v=l*h,S=l*f,D=n.x,T=n.y,w=n.z;return i[0]=(1-(m+g))*D,i[1]=(u+S)*D,i[2]=(_-v)*D,i[3]=0,i[4]=(u-S)*T,i[5]=(1-(d+g))*T,i[6]=(p+b)*T,i[7]=0,i[8]=(_+v)*w,i[9]=(p-b)*w,i[10]=(1-(d+m))*w,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){let i=this.elements,s=bo.set(i[0],i[1],i[2]).length(),o=bo.set(i[4],i[5],i[6]).length(),a=bo.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),t.x=i[12],t.y=i[13],t.z=i[14],xi.copy(this);let c=1/s,h=1/o,f=1/a;return xi.elements[0]*=c,xi.elements[1]*=c,xi.elements[2]*=c,xi.elements[4]*=h,xi.elements[5]*=h,xi.elements[6]*=h,xi.elements[8]*=f,xi.elements[9]*=f,xi.elements[10]*=f,e.setFromRotationMatrix(xi),n.x=s,n.y=o,n.z=a,this}makePerspective(t,e,n,i,s,o,a=ar){let l=this.elements,c=2*s/(e-t),h=2*s/(n-i),f=(e+t)/(e-t),d=(n+i)/(n-i),u,_;if(a===ar)u=-(o+s)/(o-s),_=-2*o*s/(o-s);else if(a===Nc)u=-o/(o-s),_=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=f,l[12]=0,l[1]=0,l[5]=h,l[9]=d,l[13]=0,l[2]=0,l[6]=0,l[10]=u,l[14]=_,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,n,i,s,o,a=ar){let l=this.elements,c=1/(e-t),h=1/(n-i),f=1/(o-s),d=(e+t)*c,u=(n+i)*h,_,m;if(a===ar)_=(o+s)*f,m=-2*f;else if(a===Nc)_=s*f,m=-1*f;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-d,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-u,l[2]=0,l[6]=0,l[10]=m,l[14]=-_,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){let e=this.elements,n=t.elements;for(let i=0;i<16;i++)if(e[i]!==n[i])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}},bo=new nt,xi=new Oe,qS=new nt(0,0,0),ZS=new nt(1,1,1),Lr=new nt,hc=new nt,Gn=new nt,U_=new Oe,O_=new Xr,cr=class r{constructor(t=0,e=0,n=0,i=r.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=i}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,n,i=this._order){return this._x=t,this._y=e,this._z=n,this._order=i,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,n=!0){let i=t.elements,s=i[0],o=i[4],a=i[8],l=i[1],c=i[5],h=i[9],f=i[2],d=i[6],u=i[10];switch(e){case"XYZ":this._y=Math.asin(Nn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,u),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Nn(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,u),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,s),this._z=0);break;case"ZXY":this._x=Math.asin(Nn(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-f,u),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Nn(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(d,u),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Nn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-f,s)):(this._x=0,this._y=Math.atan2(a,u));break;case"XZY":this._z=Math.asin(-Nn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-h,u),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,n===!0&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return U_.makeRotationFromQuaternion(t),this.setFromRotationMatrix(U_,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return O_.setFromEuler(this),this.setFromQuaternion(O_,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],t[3]!==void 0&&(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}};cr.DEFAULT_ORDER="XYZ";var zc=class{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!==0}isEnabled(t){return(this.mask&(1<<t|0))!==0}},JS=0,B_=new nt,wo=new Xr,er=new Oe,fc=new nt,Xa=new nt,$S=new nt,KS=new Xr,k_=new nt(1,0,0),z_=new nt(0,1,0),V_=new nt(0,0,1),H_={type:"added"},jS={type:"removed"},Eo={type:"childadded",child:null},vf={type:"childremoved",child:null},gn=class r extends Wr{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:JS++}),this.uuid=tl(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=r.DEFAULT_UP.clone();let t=new nt,e=new cr,n=new Xr,i=new nt(1,1,1);function s(){n.setFromEuler(e,!1)}function o(){e.setFromQuaternion(n,void 0,!1)}e._onChange(s),n._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Oe},normalMatrix:{value:new oe}}),this.matrix=new Oe,this.matrixWorld=new Oe,this.matrixAutoUpdate=r.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=r.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new zc,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],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 wo.setFromAxisAngle(t,e),this.quaternion.multiply(wo),this}rotateOnWorldAxis(t,e){return wo.setFromAxisAngle(t,e),this.quaternion.premultiply(wo),this}rotateX(t){return this.rotateOnAxis(k_,t)}rotateY(t){return this.rotateOnAxis(z_,t)}rotateZ(t){return this.rotateOnAxis(V_,t)}translateOnAxis(t,e){return B_.copy(t).applyQuaternion(this.quaternion),this.position.add(B_.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(k_,t)}translateY(t){return this.translateOnAxis(z_,t)}translateZ(t){return this.translateOnAxis(V_,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(er.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?fc.copy(t):fc.set(t,e,n);let i=this.parent;this.updateWorldMatrix(!0,!1),Xa.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?er.lookAt(Xa,fc,this.up):er.lookAt(fc,Xa,this.up),this.quaternion.setFromRotationMatrix(er),i&&(er.extractRotation(i.matrixWorld),wo.setFromRotationMatrix(er),this.quaternion.premultiply(wo.invert()))}add(t){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);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(H_),Eo.child=t,this.dispatchEvent(Eo),Eo.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}let e=this.children.indexOf(t);return e!==-1&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(jS),vf.child=t,this.dispatchEvent(vf),vf.child=null),this}removeFromParent(){let t=this.parent;return t!==null&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),er.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),er.multiply(t.parent.matrixWorld)),t.applyMatrix4(er),t.removeFromParent(),t.parent=this,this.children.push(t),t.updateWorldMatrix(!1,!0),t.dispatchEvent(H_),Eo.child=t,this.dispatchEvent(Eo),Eo.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 n=0,i=this.children.length;n<i;n++){let o=this.children[n].getObjectByProperty(t,e);if(o!==void 0)return o}}getObjectsByProperty(t,e,n=[]){this[t]===e&&n.push(this);let i=this.children;for(let s=0,o=i.length;s<o;s++)i[s].getObjectsByProperty(t,e,n);return n}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Xa,t,$S),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Xa,KS,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);let e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);let e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);let e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverseVisible(t)}traverseAncestors(t){let e=this.parent;e!==null&&(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)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);let e=this.children;for(let n=0,i=e.length;n<i;n++){let s=e[n];(s.matrixWorldAutoUpdate===!0||t===!0)&&s.updateMatrixWorld(t)}}updateWorldMatrix(t,e){let n=this.parent;if(t===!0&&n!==null&&n.matrixWorldAutoUpdate===!0&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),e===!0){let i=this.children;for(let s=0,o=i.length;s<o;s++){let a=i[s];a.matrixWorldAutoUpdate===!0&&a.updateWorldMatrix(!1,!0)}}}toJSON(t){let e=t===void 0||typeof t=="string",n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});let i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.bounds=this._bounds.map(a=>({boxInitialized:a.boxInitialized,boxMin:a.box.min.toArray(),boxMax:a.box.max.toArray(),sphereInitialized:a.sphereInitialized,sphereRadius:a.sphere.radius,sphereCenter:a.sphere.center.toArray()})),i.maxGeometryCount=this._maxGeometryCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(t),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(t)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(t.geometries,this.geometry);let a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){let l=a.shapes;if(Array.isArray(l))for(let c=0,h=l.length;c<h;c++){let f=l[c];s(t.shapes,f)}else s(t.shapes,l)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(t.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let a=[];for(let l=0,c=this.material.length;l<c;l++)a.push(s(t.materials,this.material[l]));i.material=a}else i.material=s(t.materials,this.material);if(this.children.length>0){i.children=[];for(let a=0;a<this.children.length;a++)i.children.push(this.children[a].toJSON(t).object)}if(this.animations.length>0){i.animations=[];for(let a=0;a<this.animations.length;a++){let l=this.animations[a];i.animations.push(s(t.animations,l))}}if(e){let a=o(t.geometries),l=o(t.materials),c=o(t.textures),h=o(t.images),f=o(t.shapes),d=o(t.skeletons),u=o(t.animations),_=o(t.nodes);a.length>0&&(n.geometries=a),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),h.length>0&&(n.images=h),f.length>0&&(n.shapes=f),d.length>0&&(n.skeletons=d),u.length>0&&(n.animations=u),_.length>0&&(n.nodes=_)}return n.object=i,n;function o(a){let l=[];for(let c in a){let h=a[c];delete h.metadata,l.push(h)}return l}}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)),e===!0)for(let n=0;n<t.children.length;n++){let i=t.children[n];this.add(i.clone())}return this}};gn.DEFAULT_UP=new nt(0,1,0);gn.DEFAULT_MATRIX_AUTO_UPDATE=!0;gn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var yi=new nt,nr=new nt,Sf=new nt,ir=new nt,To=new nt,Ao=new nt,G_=new nt,Mf=new nt,bf=new nt,wf=new nt,No=class r{constructor(t=new nt,e=new nt,n=new nt){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,i){i.subVectors(n,e),yi.subVectors(t,e),i.cross(yi);let s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(t,e,n,i,s){yi.subVectors(i,e),nr.subVectors(n,e),Sf.subVectors(t,e);let o=yi.dot(yi),a=yi.dot(nr),l=yi.dot(Sf),c=nr.dot(nr),h=nr.dot(Sf),f=o*c-a*a;if(f===0)return s.set(0,0,0),null;let d=1/f,u=(c*l-a*h)*d,_=(o*h-a*l)*d;return s.set(1-u-_,_,u)}static containsPoint(t,e,n,i){return this.getBarycoord(t,e,n,i,ir)===null?!1:ir.x>=0&&ir.y>=0&&ir.x+ir.y<=1}static getInterpolation(t,e,n,i,s,o,a,l){return this.getBarycoord(t,e,n,i,ir)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,ir.x),l.addScaledVector(o,ir.y),l.addScaledVector(a,ir.z),l)}static isFrontFacing(t,e,n,i){return yi.subVectors(n,e),nr.subVectors(t,e),yi.cross(nr).dot(i)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this}setFromAttributeAndIndices(t,e,n,i){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,i),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 yi.subVectors(this.c,this.b),nr.subVectors(this.a,this.b),yi.cross(nr).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return r.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return r.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,n,i,s){return r.getInterpolation(t,this.a,this.b,this.c,e,n,i,s)}containsPoint(t){return r.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return r.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){let n=this.a,i=this.b,s=this.c,o,a;To.subVectors(i,n),Ao.subVectors(s,n),Mf.subVectors(t,n);let l=To.dot(Mf),c=Ao.dot(Mf);if(l<=0&&c<=0)return e.copy(n);bf.subVectors(t,i);let h=To.dot(bf),f=Ao.dot(bf);if(h>=0&&f<=h)return e.copy(i);let d=l*f-h*c;if(d<=0&&l>=0&&h<=0)return o=l/(l-h),e.copy(n).addScaledVector(To,o);wf.subVectors(t,s);let u=To.dot(wf),_=Ao.dot(wf);if(_>=0&&u<=_)return e.copy(s);let m=u*c-l*_;if(m<=0&&c>=0&&_<=0)return a=c/(c-_),e.copy(n).addScaledVector(Ao,a);let p=h*_-u*f;if(p<=0&&f-h>=0&&u-_>=0)return G_.subVectors(s,i),a=(f-h)/(f-h+(u-_)),e.copy(i).addScaledVector(G_,a);let g=1/(p+m+d);return o=m*g,a=d*g,e.copy(n).addScaledVector(To,o).addScaledVector(Ao,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}},F0={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},Fr={h:0,s:0,l:0},dc={h:0,s:0,l:0};function Ef(r,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?r+(t-r)*6*e:e<1/2?t:e<2/3?r+(t-r)*6*(2/3-e):r}var ge=class{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(e===void 0&&n===void 0){let i=t;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=ni){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,Se.toWorkingColorSpace(this,e),this}setRGB(t,e,n,i=Se.workingColorSpace){return this.r=t,this.g=e,this.b=n,Se.toWorkingColorSpace(this,i),this}setHSL(t,e,n,i=Se.workingColorSpace){if(t=zS(t,1),e=Nn(e,0,1),n=Nn(n,0,1),e===0)this.r=this.g=this.b=n;else{let s=n<=.5?n*(1+e):n+e-n*e,o=2*n-s;this.r=Ef(o,s,t+1/3),this.g=Ef(o,s,t),this.b=Ef(o,s,t-1/3)}return Se.toWorkingColorSpace(this,i),this}setStyle(t,e=ni){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(t)){let s,o=i[1],a=i[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(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 n(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 n(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(i=/^\#([A-Fa-f\d]+)$/.exec(t)){let s=i[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,e);if(o===6)return this.setHex(parseInt(s,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=ni){let n=F0[t.toLowerCase()];return n!==void 0?this.setHex(n,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=Bo(t.r),this.g=Bo(t.g),this.b=Bo(t.b),this}copyLinearToSRGB(t){return this.r=ff(t.r),this.g=ff(t.g),this.b=ff(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=ni){return Se.fromWorkingColorSpace(mn.copy(this),t),Math.round(Nn(mn.r*255,0,255))*65536+Math.round(Nn(mn.g*255,0,255))*256+Math.round(Nn(mn.b*255,0,255))}getHexString(t=ni){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Se.workingColorSpace){Se.fromWorkingColorSpace(mn.copy(this),e);let n=mn.r,i=mn.g,s=mn.b,o=Math.max(n,i,s),a=Math.min(n,i,s),l,c,h=(a+o)/2;if(a===o)l=0,c=0;else{let f=o-a;switch(c=h<=.5?f/(o+a):f/(2-o-a),o){case n:l=(i-s)/f+(i<s?6:0);break;case i:l=(s-n)/f+2;break;case s:l=(n-i)/f+4;break}l/=6}return t.h=l,t.s=c,t.l=h,t}getRGB(t,e=Se.workingColorSpace){return Se.fromWorkingColorSpace(mn.copy(this),e),t.r=mn.r,t.g=mn.g,t.b=mn.b,t}getStyle(t=ni){Se.fromWorkingColorSpace(mn.copy(this),t);let e=mn.r,n=mn.g,i=mn.b;return t!==ni?`color(${t} ${e.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(e*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(t,e,n){return this.getHSL(Fr),this.setHSL(Fr.h+t,Fr.s+e,Fr.l+n)}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,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(Fr),t.getHSL(dc);let n=uf(Fr.h,dc.h,e),i=uf(Fr.s,dc.s,e),s=uf(Fr.l,dc.l,e);return this.setHSL(n,i,s),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){let e=this.r,n=this.g,i=this.b,s=t.elements;return this.r=s[0]*e+s[3]*n+s[6]*i,this.g=s[1]*e+s[4]*n+s[7]*i,this.b=s[2]*e+s[5]*n+s[8]*i,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}},mn=new ge;ge.NAMES=F0;var QS=0,Ns=class extends Wr{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:QS++}),this.uuid=tl(),this.name="",this.type="Material",this.blending=zr,this.side=Hr,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Uf,this.blendDst=Of,this.blendEquation=Rs,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new ge(0,0,0),this.blendAlpha=0,this.depthFunc=Cc,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=C_,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=xo,this.stencilZFail=xo,this.stencilZPass=xo,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.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}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(let e in t){let n=t[e];if(n===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}let i=this[e];if(i===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n}}toJSON(t){let e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});let n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==zr&&(n.blending=this.blending),this.side!==Hr&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==Uf&&(n.blendSrc=this.blendSrc),this.blendDst!==Of&&(n.blendDst=this.blendDst),this.blendEquation!==Rs&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==Cc&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==C_&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==xo&&(n.stencilFail=this.stencilFail),this.stencilZFail!==xo&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==xo&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function i(s){let o=[];for(let a in s){let l=s[a];delete l.metadata,o.push(l)}return o}if(e){let s=i(t.textures),o=i(t.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}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;let e=t.clippingPlanes,n=null;if(e!==null){let i=e.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=e[s].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.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){t===!0&&this.version++}},Vc=class extends Ns{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new ge(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 cr,this.combine=b0,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}};var He=new nt,pc=new _e,ri=class{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=n,this.usage=R_,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Or,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return HS("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}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,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,s=this.itemSize;i<s;i++)this.array[t+i]=e.array[n+i];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,n=this.count;e<n;e++)pc.fromBufferAttribute(this,e),pc.applyMatrix3(t),this.setXY(e,pc.x,pc.y);else if(this.itemSize===3)for(let e=0,n=this.count;e<n;e++)He.fromBufferAttribute(this,e),He.applyMatrix3(t),this.setXYZ(e,He.x,He.y,He.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)He.fromBufferAttribute(this,e),He.applyMatrix4(t),this.setXYZ(e,He.x,He.y,He.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)He.fromBufferAttribute(this,e),He.applyNormalMatrix(t),this.setXYZ(e,He.x,He.y,He.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)He.fromBufferAttribute(this,e),He.transformDirection(t),this.setXYZ(e,He.x,He.y,He.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let n=this.array[t*this.itemSize+e];return this.normalized&&(n=Ha(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=Fn(n,this.array)),this.array[t*this.itemSize+e]=n,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Ha(e,this.array)),e}setX(t,e){return this.normalized&&(e=Fn(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Ha(e,this.array)),e}setY(t,e){return this.normalized&&(e=Fn(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=Ha(e,this.array)),e}setZ(t,e){return this.normalized&&(e=Fn(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=Ha(e,this.array)),e}setW(t,e){return this.normalized&&(e=Fn(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=Fn(e,this.array),n=Fn(n,this.array)),this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,i){return t*=this.itemSize,this.normalized&&(e=Fn(e,this.array),n=Fn(n,this.array),i=Fn(i,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this}setXYZW(t,e,n,i,s){return t*=this.itemSize,this.normalized&&(e=Fn(e,this.array),n=Fn(n,this.array),i=Fn(i,this.array),s=Fn(s,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,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(){let 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!==R_&&(t.usage=this.usage),t}};var Hc=class extends ri{constructor(t,e,n){super(new Uint16Array(t),e,n)}};var Gc=class extends ri{constructor(t,e,n){super(new Uint32Array(t),e,n)}};var si=class extends ri{constructor(t,e,n){super(new Float32Array(t),e,n)}},tM=0,ei=new Oe,Tf=new gn,Do=new nt,Wn=new Fs,Ya=new Fs,je=new nt,Oi=class r extends Wr{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:tM++}),this.uuid=tl(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(L0(t)?Gc:Hc)(t,1):this.index=t,this}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 this.attributes[t]!==void 0}addGroup(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){let e=this.attributes.position;e!==void 0&&(e.applyMatrix4(t),e.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let s=new oe().getNormalMatrix(t);n.applyNormalMatrix(s),n.needsUpdate=!0}let i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(t),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return ei.makeRotationFromQuaternion(t),this.applyMatrix4(ei),this}rotateX(t){return ei.makeRotationX(t),this.applyMatrix4(ei),this}rotateY(t){return ei.makeRotationY(t),this.applyMatrix4(ei),this}rotateZ(t){return ei.makeRotationZ(t),this.applyMatrix4(ei),this}translate(t,e,n){return ei.makeTranslation(t,e,n),this.applyMatrix4(ei),this}scale(t,e,n){return ei.makeScale(t,e,n),this.applyMatrix4(ei),this}lookAt(t){return Tf.lookAt(t),Tf.updateMatrix(),this.applyMatrix4(Tf.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Do).negate(),this.translate(Do.x,Do.y,Do.z),this}setFromPoints(t){let e=[];for(let n=0,i=t.length;n<i;n++){let s=t[n];e.push(s.x,s.y,s.z||0)}return this.setAttribute("position",new si(e,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Fs);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new nt(-1/0,-1/0,-1/0),new nt(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let n=0,i=e.length;n<i;n++){let s=e[n];Wn.setFromBufferAttribute(s),this.morphTargetsRelative?(je.addVectors(this.boundingBox.min,Wn.min),this.boundingBox.expandByPoint(je),je.addVectors(this.boundingBox.max,Wn.max),this.boundingBox.expandByPoint(je)):(this.boundingBox.expandByPoint(Wn.min),this.boundingBox.expandByPoint(Wn.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(){this.boundingSphere===null&&(this.boundingSphere=new Go);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new nt,1/0);return}if(t){let n=this.boundingSphere.center;if(Wn.setFromBufferAttribute(t),e)for(let s=0,o=e.length;s<o;s++){let a=e[s];Ya.setFromBufferAttribute(a),this.morphTargetsRelative?(je.addVectors(Wn.min,Ya.min),Wn.expandByPoint(je),je.addVectors(Wn.max,Ya.max),Wn.expandByPoint(je)):(Wn.expandByPoint(Ya.min),Wn.expandByPoint(Ya.max))}Wn.getCenter(n);let i=0;for(let s=0,o=t.count;s<o;s++)je.fromBufferAttribute(t,s),i=Math.max(i,n.distanceToSquared(je));if(e)for(let s=0,o=e.length;s<o;s++){let a=e[s],l=this.morphTargetsRelative;for(let c=0,h=a.count;c<h;c++)je.fromBufferAttribute(a,c),l&&(Do.fromBufferAttribute(t,c),je.add(Do)),i=Math.max(i,n.distanceToSquared(je))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let t=this.index,e=this.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}let n=e.position,i=e.normal,s=e.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new ri(new Float32Array(4*n.count),4));let o=this.getAttribute("tangent"),a=[],l=[];for(let P=0;P<n.count;P++)a[P]=new nt,l[P]=new nt;let c=new nt,h=new nt,f=new nt,d=new _e,u=new _e,_=new _e,m=new nt,p=new nt;function g(P,M,y){c.fromBufferAttribute(n,P),h.fromBufferAttribute(n,M),f.fromBufferAttribute(n,y),d.fromBufferAttribute(s,P),u.fromBufferAttribute(s,M),_.fromBufferAttribute(s,y),h.sub(c),f.sub(c),u.sub(d),_.sub(d);let I=1/(u.x*_.y-_.x*u.y);isFinite(I)&&(m.copy(h).multiplyScalar(_.y).addScaledVector(f,-u.y).multiplyScalar(I),p.copy(f).multiplyScalar(u.x).addScaledVector(h,-_.x).multiplyScalar(I),a[P].add(m),a[M].add(m),a[y].add(m),l[P].add(p),l[M].add(p),l[y].add(p))}let b=this.groups;b.length===0&&(b=[{start:0,count:t.count}]);for(let P=0,M=b.length;P<M;++P){let y=b[P],I=y.start,N=y.count;for(let C=I,V=I+N;C<V;C+=3)g(t.getX(C+0),t.getX(C+1),t.getX(C+2))}let v=new nt,S=new nt,D=new nt,T=new nt;function w(P){D.fromBufferAttribute(i,P),T.copy(D);let M=a[P];v.copy(M),v.sub(D.multiplyScalar(D.dot(M))).normalize(),S.crossVectors(T,M);let I=S.dot(l[P])<0?-1:1;o.setXYZW(P,v.x,v.y,v.z,I)}for(let P=0,M=b.length;P<M;++P){let y=b[P],I=y.start,N=y.count;for(let C=I,V=I+N;C<V;C+=3)w(t.getX(C+0)),w(t.getX(C+1)),w(t.getX(C+2))}}computeVertexNormals(){let t=this.index,e=this.getAttribute("position");if(e!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new ri(new Float32Array(e.count*3),3),this.setAttribute("normal",n);else for(let d=0,u=n.count;d<u;d++)n.setXYZ(d,0,0,0);let i=new nt,s=new nt,o=new nt,a=new nt,l=new nt,c=new nt,h=new nt,f=new nt;if(t)for(let d=0,u=t.count;d<u;d+=3){let _=t.getX(d+0),m=t.getX(d+1),p=t.getX(d+2);i.fromBufferAttribute(e,_),s.fromBufferAttribute(e,m),o.fromBufferAttribute(e,p),h.subVectors(o,s),f.subVectors(i,s),h.cross(f),a.fromBufferAttribute(n,_),l.fromBufferAttribute(n,m),c.fromBufferAttribute(n,p),a.add(h),l.add(h),c.add(h),n.setXYZ(_,a.x,a.y,a.z),n.setXYZ(m,l.x,l.y,l.z),n.setXYZ(p,c.x,c.y,c.z)}else for(let d=0,u=e.count;d<u;d+=3)i.fromBufferAttribute(e,d+0),s.fromBufferAttribute(e,d+1),o.fromBufferAttribute(e,d+2),h.subVectors(o,s),f.subVectors(i,s),h.cross(f),n.setXYZ(d+0,h.x,h.y,h.z),n.setXYZ(d+1,h.x,h.y,h.z),n.setXYZ(d+2,h.x,h.y,h.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){let t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)je.fromBufferAttribute(t,e),je.normalize(),t.setXYZ(e,je.x,je.y,je.z)}toNonIndexed(){function t(a,l){let c=a.array,h=a.itemSize,f=a.normalized,d=new c.constructor(l.length*h),u=0,_=0;for(let m=0,p=l.length;m<p;m++){a.isInterleavedBufferAttribute?u=l[m]*a.data.stride+a.offset:u=l[m]*h;for(let g=0;g<h;g++)d[_++]=c[u++]}return new ri(d,h,f)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let e=new r,n=this.index.array,i=this.attributes;for(let a in i){let l=i[a],c=t(l,n);e.setAttribute(a,c)}let s=this.morphAttributes;for(let a in s){let l=[],c=s[a];for(let h=0,f=c.length;h<f;h++){let d=c[h],u=t(d,n);l.push(u)}e.morphAttributes[a]=l}e.morphTargetsRelative=this.morphTargetsRelative;let o=this.groups;for(let a=0,l=o.length;a<l;a++){let c=o[a];e.addGroup(c.start,c.count,c.materialIndex)}return e}toJSON(){let 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),this.parameters!==void 0){let l=this.parameters;for(let c in l)l[c]!==void 0&&(t[c]=l[c]);return t}t.data={attributes:{}};let e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});let n=this.attributes;for(let l in n){let c=n[l];t.data.attributes[l]=c.toJSON(t.data)}let i={},s=!1;for(let l in this.morphAttributes){let c=this.morphAttributes[l],h=[];for(let f=0,d=c.length;f<d;f++){let u=c[f];h.push(u.toJSON(t.data))}h.length>0&&(i[l]=h,s=!0)}s&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);let o=this.groups;o.length>0&&(t.data.groups=JSON.parse(JSON.stringify(o)));let a=this.boundingSphere;return a!==null&&(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;let e={};this.name=t.name;let n=t.index;n!==null&&this.setIndex(n.clone(e));let i=t.attributes;for(let c in i){let h=i[c];this.setAttribute(c,h.clone(e))}let s=t.morphAttributes;for(let c in s){let h=[],f=s[c];for(let d=0,u=f.length;d<u;d++)h.push(f[d].clone(e));this.morphAttributes[c]=h}this.morphTargetsRelative=t.morphTargetsRelative;let o=t.groups;for(let c=0,h=o.length;c<h;c++){let f=o[c];this.addGroup(f.start,f.count,f.materialIndex)}let a=t.boundingBox;a!==null&&(this.boundingBox=a.clone());let l=t.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}},W_=new Oe,Es=new kc,mc=new Go,X_=new nt,Co=new nt,Ro=new nt,Po=new nt,Af=new nt,gc=new nt,_c=new _e,xc=new _e,yc=new _e,Y_=new nt,q_=new nt,Z_=new nt,vc=new nt,Sc=new nt,Si=class extends gn{constructor(t=new Oi,e=new Vc){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),t.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),t.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){let e=this.geometry.morphAttributes,n=Object.keys(e);if(n.length>0){let i=e[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s<o;s++){let a=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}getVertexPosition(t,e){let n=this.geometry,i=n.attributes.position,s=n.morphAttributes.position,o=n.morphTargetsRelative;e.fromBufferAttribute(i,t);let a=this.morphTargetInfluences;if(s&&a){gc.set(0,0,0);for(let l=0,c=s.length;l<c;l++){let h=a[l],f=s[l];h!==0&&(Af.fromBufferAttribute(f,t),o?gc.addScaledVector(Af,h):gc.addScaledVector(Af.sub(e),h))}e.add(gc)}return e}raycast(t,e){let n=this.geometry,i=this.material,s=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),mc.copy(n.boundingSphere),mc.applyMatrix4(s),Es.copy(t.ray).recast(t.near),!(mc.containsPoint(Es.origin)===!1&&(Es.intersectSphere(mc,X_)===null||Es.origin.distanceToSquared(X_)>(t.far-t.near)**2))&&(W_.copy(s).invert(),Es.copy(t.ray).applyMatrix4(W_),!(n.boundingBox!==null&&Es.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(t,e,Es)))}_computeIntersections(t,e,n){let i,s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,c=s.attributes.uv,h=s.attributes.uv1,f=s.attributes.normal,d=s.groups,u=s.drawRange;if(a!==null)if(Array.isArray(o))for(let _=0,m=d.length;_<m;_++){let p=d[_],g=o[p.materialIndex],b=Math.max(p.start,u.start),v=Math.min(a.count,Math.min(p.start+p.count,u.start+u.count));for(let S=b,D=v;S<D;S+=3){let T=a.getX(S),w=a.getX(S+1),P=a.getX(S+2);i=Mc(this,g,t,n,c,h,f,T,w,P),i&&(i.faceIndex=Math.floor(S/3),i.face.materialIndex=p.materialIndex,e.push(i))}}else{let _=Math.max(0,u.start),m=Math.min(a.count,u.start+u.count);for(let p=_,g=m;p<g;p+=3){let b=a.getX(p),v=a.getX(p+1),S=a.getX(p+2);i=Mc(this,o,t,n,c,h,f,b,v,S),i&&(i.faceIndex=Math.floor(p/3),e.push(i))}}else if(l!==void 0)if(Array.isArray(o))for(let _=0,m=d.length;_<m;_++){let p=d[_],g=o[p.materialIndex],b=Math.max(p.start,u.start),v=Math.min(l.count,Math.min(p.start+p.count,u.start+u.count));for(let S=b,D=v;S<D;S+=3){let T=S,w=S+1,P=S+2;i=Mc(this,g,t,n,c,h,f,T,w,P),i&&(i.faceIndex=Math.floor(S/3),i.face.materialIndex=p.materialIndex,e.push(i))}}else{let _=Math.max(0,u.start),m=Math.min(l.count,u.start+u.count);for(let p=_,g=m;p<g;p+=3){let b=p,v=p+1,S=p+2;i=Mc(this,o,t,n,c,h,f,b,v,S),i&&(i.faceIndex=Math.floor(p/3),e.push(i))}}}};function eM(r,t,e,n,i,s,o,a){let l;if(t.side===Un?l=n.intersectTriangle(o,s,i,!0,a):l=n.intersectTriangle(i,s,o,t.side===Hr,a),l===null)return null;Sc.copy(a),Sc.applyMatrix4(r.matrixWorld);let c=e.ray.origin.distanceTo(Sc);return c<e.near||c>e.far?null:{distance:c,point:Sc.clone(),object:r}}function Mc(r,t,e,n,i,s,o,a,l,c){r.getVertexPosition(a,Co),r.getVertexPosition(l,Ro),r.getVertexPosition(c,Po);let h=eM(r,t,e,n,Co,Ro,Po,vc);if(h){i&&(_c.fromBufferAttribute(i,a),xc.fromBufferAttribute(i,l),yc.fromBufferAttribute(i,c),h.uv=No.getInterpolation(vc,Co,Ro,Po,_c,xc,yc,new _e)),s&&(_c.fromBufferAttribute(s,a),xc.fromBufferAttribute(s,l),yc.fromBufferAttribute(s,c),h.uv1=No.getInterpolation(vc,Co,Ro,Po,_c,xc,yc,new _e)),o&&(Y_.fromBufferAttribute(o,a),q_.fromBufferAttribute(o,l),Z_.fromBufferAttribute(o,c),h.normal=No.getInterpolation(vc,Co,Ro,Po,Y_,q_,Z_,new nt),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));let f={a,b:l,c,normal:new nt,materialIndex:0};No.getNormal(Co,Ro,Po,f.normal),h.face=f}return h}var $a=class r extends Oi{constructor(t=1,e=1,n=1,i=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:s,depthSegments:o};let a=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o);let l=[],c=[],h=[],f=[],d=0,u=0;_("z","y","x",-1,-1,n,e,t,o,s,0),_("z","y","x",1,-1,n,e,-t,o,s,1),_("x","z","y",1,1,t,n,e,i,o,2),_("x","z","y",1,-1,t,n,-e,i,o,3),_("x","y","z",1,-1,t,e,n,i,s,4),_("x","y","z",-1,-1,t,e,-n,i,s,5),this.setIndex(l),this.setAttribute("position",new si(c,3)),this.setAttribute("normal",new si(h,3)),this.setAttribute("uv",new si(f,2));function _(m,p,g,b,v,S,D,T,w,P,M){let y=S/w,I=D/P,N=S/2,C=D/2,V=T/2,$=w+1,W=P+1,Z=0,z=0,U=new nt;for(let R=0;R<W;R++){let at=R*I-C;for(let _t=0;_t<$;_t++){let Ut=_t*y-N;U[m]=Ut*b,U[p]=at*v,U[g]=V,c.push(U.x,U.y,U.z),U[m]=0,U[p]=0,U[g]=T>0?1:-1,h.push(U.x,U.y,U.z),f.push(_t/w),f.push(1-R/P),Z+=1}}for(let R=0;R<P;R++)for(let at=0;at<w;at++){let _t=d+at+$*R,Ut=d+at+$*(R+1),X=d+(at+1)+$*(R+1),ot=d+(at+1)+$*R;l.push(_t,Ut,ot),l.push(Ut,X,ot),z+=6}a.addGroup(u,z,M),u+=z,d+=Z}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new r(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}};function Wo(r){let t={};for(let e in r){t[e]={};for(let n in r[e]){let i=r[e][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[e][n]=null):t[e][n]=i.clone():Array.isArray(i)?t[e][n]=i.slice():t[e][n]=i}}return t}function An(r){let t={};for(let e=0;e<r.length;e++){let n=Wo(r[e]);for(let i in n)t[i]=n[i]}return t}function nM(r){let t=[];for(let e=0;e<r.length;e++)t.push(r[e].clone());return t}function N0(r){let t=r.getRenderTarget();return t===null?r.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:Se.workingColorSpace}var iM={clone:Wo,merge:An},rM=`void main() {
|
|
2
2
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
3
3
|
}`,sM=`void main() {
|
|
4
4
|
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|
|
5
|
-
}`,ai=class extends Ns{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=rM,this.fragmentShader=sM,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,t!==void 0&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Wo(t.uniforms),this.uniformsGroups=nM(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){let e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(let i in this.uniforms){let o=this.uniforms[i].value;o&&o.isTexture?e.uniforms[i]={type:"t",value:o.toJSON(t).uuid}:o&&o.isColor?e.uniforms[i]={type:"c",value:o.getHex()}:o&&o.isVector2?e.uniforms[i]={type:"v2",value:o.toArray()}:o&&o.isVector3?e.uniforms[i]={type:"v3",value:o.toArray()}:o&&o.isVector4?e.uniforms[i]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?e.uniforms[i]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?e.uniforms[i]={type:"m4",value:o.toArray()}:e.uniforms[i]={value:o}}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;let n={};for(let i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}},Wc=class extends gn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Oe,this.projectionMatrix=new Oe,this.projectionMatrixInverse=new Oe,this.coordinateSystem=ar}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}},Nr=new nt,J_=new _e,$_=new _e,Dn=class extends Wc{constructor(t=50,e=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){let e=.5*this.getFilmHeight()/t;this.fov=Hf*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){let t=Math.tan(cf*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return Hf*2*Math.atan(Math.tan(cf*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,n){Nr.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(Nr.x,Nr.y).multiplyScalar(-t/Nr.z),Nr.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Nr.x,Nr.y).multiplyScalar(-t/Nr.z)}getViewSize(t,e){return this.getViewBounds(t,J_,$_),e.subVectors($_,J_)}setViewOffset(t,e,n,i,s,o){this.aspect=t/e,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=this.near,e=t*Math.tan(cf*.5*this.fov)/this.zoom,n=2*e,i=this.aspect*n,s=-.5*i,o=this.view;if(this.view!==null&&this.view.enabled){let l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*i/l,e-=o.offsetY*n/c,i*=o.width/l,n*=o.height/c}let a=this.filmOffset;a!==0&&(s+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,e,e-n,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}},Io=-90,Lo=1,Yf=class extends gn{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;let i=new Dn(Io,Lo,t,e);i.layers=this.layers,this.add(i);let s=new Dn(Io,Lo,t,e);s.layers=this.layers,this.add(s);let o=new Dn(Io,Lo,t,e);o.layers=this.layers,this.add(o);let a=new Dn(Io,Lo,t,e);a.layers=this.layers,this.add(a);let l=new Dn(Io,Lo,t,e);l.layers=this.layers,this.add(l);let c=new Dn(Io,Lo,t,e);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){let t=this.coordinateSystem,e=this.children.concat(),[n,i,s,o,a,l]=e;for(let c of e)this.remove(c);if(t===ar)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(t===Nc)n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(let c of e)this.add(c),c.updateMatrixWorld()}update(t,e){this.parent===null&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());let[s,o,a,l,c,h]=this.children,
|
|
5
|
+
}`,ai=class extends Ns{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=rM,this.fragmentShader=sM,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,t!==void 0&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Wo(t.uniforms),this.uniformsGroups=nM(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){let e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(let i in this.uniforms){let o=this.uniforms[i].value;o&&o.isTexture?e.uniforms[i]={type:"t",value:o.toJSON(t).uuid}:o&&o.isColor?e.uniforms[i]={type:"c",value:o.getHex()}:o&&o.isVector2?e.uniforms[i]={type:"v2",value:o.toArray()}:o&&o.isVector3?e.uniforms[i]={type:"v3",value:o.toArray()}:o&&o.isVector4?e.uniforms[i]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?e.uniforms[i]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?e.uniforms[i]={type:"m4",value:o.toArray()}:e.uniforms[i]={value:o}}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;let n={};for(let i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}},Wc=class extends gn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Oe,this.projectionMatrix=new Oe,this.projectionMatrixInverse=new Oe,this.coordinateSystem=ar}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}},Nr=new nt,J_=new _e,$_=new _e,Dn=class extends Wc{constructor(t=50,e=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){let e=.5*this.getFilmHeight()/t;this.fov=Hf*2*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){let t=Math.tan(cf*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return Hf*2*Math.atan(Math.tan(cf*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,n){Nr.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(Nr.x,Nr.y).multiplyScalar(-t/Nr.z),Nr.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Nr.x,Nr.y).multiplyScalar(-t/Nr.z)}getViewSize(t,e){return this.getViewBounds(t,J_,$_),e.subVectors($_,J_)}setViewOffset(t,e,n,i,s,o){this.aspect=t/e,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=this.near,e=t*Math.tan(cf*.5*this.fov)/this.zoom,n=2*e,i=this.aspect*n,s=-.5*i,o=this.view;if(this.view!==null&&this.view.enabled){let l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*i/l,e-=o.offsetY*n/c,i*=o.width/l,n*=o.height/c}let a=this.filmOffset;a!==0&&(s+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,e,e-n,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,this.view!==null&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}},Io=-90,Lo=1,Yf=class extends gn{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;let i=new Dn(Io,Lo,t,e);i.layers=this.layers,this.add(i);let s=new Dn(Io,Lo,t,e);s.layers=this.layers,this.add(s);let o=new Dn(Io,Lo,t,e);o.layers=this.layers,this.add(o);let a=new Dn(Io,Lo,t,e);a.layers=this.layers,this.add(a);let l=new Dn(Io,Lo,t,e);l.layers=this.layers,this.add(l);let c=new Dn(Io,Lo,t,e);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){let t=this.coordinateSystem,e=this.children.concat(),[n,i,s,o,a,l]=e;for(let c of e)this.remove(c);if(t===ar)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(t===Nc)n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);for(let c of e)this.add(c),c.updateMatrixWorld()}update(t,e){this.parent===null&&this.updateMatrixWorld();let{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());let[s,o,a,l,c,h]=this.children,f=t.getRenderTarget(),d=t.getActiveCubeFace(),u=t.getActiveMipmapLevel(),_=t.xr.enabled;t.xr.enabled=!1;let m=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0,i),t.render(e,s),t.setRenderTarget(n,1,i),t.render(e,o),t.setRenderTarget(n,2,i),t.render(e,a),t.setRenderTarget(n,3,i),t.render(e,l),t.setRenderTarget(n,4,i),t.render(e,c),n.texture.generateMipmaps=m,t.setRenderTarget(n,5,i),t.render(e,h),t.setRenderTarget(f,d,u),t.xr.enabled=_,n.texture.needsPMREMUpdate=!0}},Xc=class extends oi{constructor(t,e,n,i,s,o,a,l,c,h){t=t!==void 0?t:[],e=e!==void 0?e:zo,super(t,e,n,i,s,o,a,l,c,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}},qf=class extends lr{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;let n={width:t,height:t,depth:1},i=[n,n,n,n,n,n];this.texture=new Xc(i,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=e.generateMipmaps!==void 0?e.generateMipmaps:!1,this.texture.minFilter=e.minFilter!==void 0?e.minFilter:vi}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;let n={uniforms:{tEquirect:{value:null}},vertexShader:`
|
|
6
6
|
|
|
7
7
|
varying vec3 vWorldDirection;
|
|
8
8
|
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
gl_FragColor = texture2D( tEquirect, sampleUV );
|
|
38
38
|
|
|
39
39
|
}
|
|
40
|
-
`},i=new $a(5,5,5),s=new ai({name:"CubemapFromEquirect",uniforms:Wo(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Un,blending:kr});s.uniforms.tEquirect.value=e;let o=new Si(i,s),a=e.minFilter;return e.minFilter===Ls&&(e.minFilter=vi),new Yf(1,10,this).update(t,o),e.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(t,e,n,i){let s=t.getRenderTarget();for(let o=0;o<6;o++)t.setRenderTarget(this,o),t.clear(e,n,i);t.setRenderTarget(s)}},Df=new nt,oM=new nt,aM=new oe,sr=class{constructor(t=new nt(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){let i=Df.subVectors(n,e).cross(oM.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){let t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){let n=t.delta(Df),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(t.start)===0?e.copy(t.start):null;let s=-(t.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:e.copy(t.start).addScaledVector(n,s)}intersectsLine(t){let e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){let n=e||aM.getNormalMatrix(t),i=this.coplanarPoint(Df).applyMatrix4(t),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}},Ts=new Go,bc=new nt,Ka=class{constructor(t=new sr,e=new sr,n=new sr,i=new sr,s=new sr,o=new sr){this.planes=[t,e,n,i,s,o]}set(t,e,n,i,s,o){let a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(t){let e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=ar){let n=this.planes,i=t.elements,s=i[0],o=i[1],a=i[2],l=i[3],c=i[4],h=i[5],
|
|
40
|
+
`},i=new $a(5,5,5),s=new ai({name:"CubemapFromEquirect",uniforms:Wo(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Un,blending:kr});s.uniforms.tEquirect.value=e;let o=new Si(i,s),a=e.minFilter;return e.minFilter===Ls&&(e.minFilter=vi),new Yf(1,10,this).update(t,o),e.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(t,e,n,i){let s=t.getRenderTarget();for(let o=0;o<6;o++)t.setRenderTarget(this,o),t.clear(e,n,i);t.setRenderTarget(s)}},Df=new nt,oM=new nt,aM=new oe,sr=class{constructor(t=new nt(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){let i=Df.subVectors(n,e).cross(oM.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){let t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){let n=t.delta(Df),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(t.start)===0?e.copy(t.start):null;let s=-(t.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:e.copy(t.start).addScaledVector(n,s)}intersectsLine(t){let e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){let n=e||aM.getNormalMatrix(t),i=this.coplanarPoint(Df).applyMatrix4(t),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}},Ts=new Go,bc=new nt,Ka=class{constructor(t=new sr,e=new sr,n=new sr,i=new sr,s=new sr,o=new sr){this.planes=[t,e,n,i,s,o]}set(t,e,n,i,s,o){let a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(t){let e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=ar){let n=this.planes,i=t.elements,s=i[0],o=i[1],a=i[2],l=i[3],c=i[4],h=i[5],f=i[6],d=i[7],u=i[8],_=i[9],m=i[10],p=i[11],g=i[12],b=i[13],v=i[14],S=i[15];if(n[0].setComponents(l-s,d-c,p-u,S-g).normalize(),n[1].setComponents(l+s,d+c,p+u,S+g).normalize(),n[2].setComponents(l+o,d+h,p+_,S+b).normalize(),n[3].setComponents(l-o,d-h,p-_,S-b).normalize(),n[4].setComponents(l-a,d-f,p-m,S-v).normalize(),e===ar)n[5].setComponents(l+a,d+f,p+m,S+v).normalize();else if(e===Nc)n[5].setComponents(a,f,m,v).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);return this}intersectsObject(t){if(t.boundingSphere!==void 0)t.boundingSphere===null&&t.computeBoundingSphere(),Ts.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{let e=t.geometry;e.boundingSphere===null&&e.computeBoundingSphere(),Ts.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(Ts)}intersectsSprite(t){return Ts.center.set(0,0,0),Ts.radius=.7071067811865476,Ts.applyMatrix4(t.matrixWorld),this.intersectsSphere(Ts)}intersectsSphere(t){let e=this.planes,n=t.center,i=-t.radius;for(let s=0;s<6;s++)if(e[s].distanceToPoint(n)<i)return!1;return!0}intersectsBox(t){let e=this.planes;for(let n=0;n<6;n++){let i=e[n];if(bc.x=i.normal.x>0?t.max.x:t.min.x,bc.y=i.normal.y>0?t.max.y:t.min.y,bc.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(bc)<0)return!1}return!0}containsPoint(t){let e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function U0(){let r=null,t=!1,e=null,n=null;function i(s,o){e(s,o),n=r.requestAnimationFrame(i)}return{start:function(){t!==!0&&e!==null&&(n=r.requestAnimationFrame(i),t=!0)},stop:function(){r.cancelAnimationFrame(n),t=!1},setAnimationLoop:function(s){e=s},setContext:function(s){r=s}}}function lM(r){let t=new WeakMap;function e(a,l){let c=a.array,h=a.usage,f=c.byteLength,d=r.createBuffer();r.bindBuffer(l,d),r.bufferData(l,c,h),a.onUploadCallback();let u;if(c instanceof Float32Array)u=r.FLOAT;else if(c instanceof Uint16Array)a.isFloat16BufferAttribute?u=r.HALF_FLOAT:u=r.UNSIGNED_SHORT;else if(c instanceof Int16Array)u=r.SHORT;else if(c instanceof Uint32Array)u=r.UNSIGNED_INT;else if(c instanceof Int32Array)u=r.INT;else if(c instanceof Int8Array)u=r.BYTE;else if(c instanceof Uint8Array)u=r.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)u=r.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:d,type:u,bytesPerElement:c.BYTES_PER_ELEMENT,version:a.version,size:f}}function n(a,l,c){let h=l.array,f=l._updateRange,d=l.updateRanges;if(r.bindBuffer(c,a),f.count===-1&&d.length===0&&r.bufferSubData(c,0,h),d.length!==0){for(let u=0,_=d.length;u<_;u++){let m=d[u];r.bufferSubData(c,m.start*h.BYTES_PER_ELEMENT,h,m.start,m.count)}l.clearUpdateRanges()}f.count!==-1&&(r.bufferSubData(c,f.offset*h.BYTES_PER_ELEMENT,h,f.offset,f.count),f.count=-1),l.onUploadCallback()}function i(a){return a.isInterleavedBufferAttribute&&(a=a.data),t.get(a)}function s(a){a.isInterleavedBufferAttribute&&(a=a.data);let l=t.get(a);l&&(r.deleteBuffer(l.buffer),t.delete(a))}function o(a,l){if(a.isGLBufferAttribute){let h=t.get(a);(!h||h.version<a.version)&&t.set(a,{buffer:a.buffer,type:a.type,bytesPerElement:a.elementSize,version:a.version});return}a.isInterleavedBufferAttribute&&(a=a.data);let c=t.get(a);if(c===void 0)t.set(a,e(a,l));else if(c.version<a.version){if(c.size!==a.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");n(c.buffer,a,l),c.version=a.version}}return{get:i,remove:s,update:o}}var Yc=class r extends Oi{constructor(t=1,e=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i};let s=t/2,o=e/2,a=Math.floor(n),l=Math.floor(i),c=a+1,h=l+1,f=t/a,d=e/l,u=[],_=[],m=[],p=[];for(let g=0;g<h;g++){let b=g*d-o;for(let v=0;v<c;v++){let S=v*f-s;_.push(S,-b,0),m.push(0,0,1),p.push(v/a),p.push(1-g/l)}}for(let g=0;g<l;g++)for(let b=0;b<a;b++){let v=b+c*g,S=b+c*(g+1),D=b+1+c*(g+1),T=b+1+c*g;u.push(v,S,T),u.push(S,D,T)}this.setIndex(u),this.setAttribute("position",new si(_,3)),this.setAttribute("normal",new si(m,3)),this.setAttribute("uv",new si(p,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new r(t.width,t.height,t.widthSegments,t.heightSegments)}},cM=`#ifdef USE_ALPHAHASH
|
|
41
41
|
if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
|
|
42
42
|
#endif`,uM=`#ifdef USE_ALPHAHASH
|
|
43
43
|
const float ALPHA_HASH_SCALE = 0.05;
|
|
@@ -3567,7 +3567,7 @@ void main() {
|
|
|
3567
3567
|
#include <tonemapping_fragment>
|
|
3568
3568
|
#include <colorspace_fragment>
|
|
3569
3569
|
#include <fog_fragment>
|
|
3570
|
-
}`,se={alphahash_fragment:cM,alphahash_pars_fragment:uM,alphamap_fragment:hM,alphamap_pars_fragment:fM,alphatest_fragment:dM,alphatest_pars_fragment:pM,aomap_fragment:mM,aomap_pars_fragment:gM,batching_pars_vertex:_M,batching_vertex:xM,begin_vertex:yM,beginnormal_vertex:vM,bsdfs:SM,iridescence_fragment:MM,bumpmap_pars_fragment:bM,clipping_planes_fragment:wM,clipping_planes_pars_fragment:EM,clipping_planes_pars_vertex:TM,clipping_planes_vertex:AM,color_fragment:DM,color_pars_fragment:CM,color_pars_vertex:RM,color_vertex:PM,common:IM,cube_uv_reflection_fragment:LM,defaultnormal_vertex:FM,displacementmap_pars_vertex:NM,displacementmap_vertex:UM,emissivemap_fragment:OM,emissivemap_pars_fragment:BM,colorspace_fragment:kM,colorspace_pars_fragment:zM,envmap_fragment:VM,envmap_common_pars_fragment:HM,envmap_pars_fragment:GM,envmap_pars_vertex:WM,envmap_physical_pars_fragment:eb,envmap_vertex:XM,fog_vertex:YM,fog_pars_vertex:qM,fog_fragment:ZM,fog_pars_fragment:JM,gradientmap_pars_fragment:$M,lightmap_pars_fragment:KM,lights_lambert_fragment:jM,lights_lambert_pars_fragment:QM,lights_pars_begin:tb,lights_toon_fragment:nb,lights_toon_pars_fragment:ib,lights_phong_fragment:rb,lights_phong_pars_fragment:sb,lights_physical_fragment:ob,lights_physical_pars_fragment:ab,lights_fragment_begin:lb,lights_fragment_maps:cb,lights_fragment_end:ub,logdepthbuf_fragment:hb,logdepthbuf_pars_fragment:fb,logdepthbuf_pars_vertex:db,logdepthbuf_vertex:pb,map_fragment:mb,map_pars_fragment:gb,map_particle_fragment:_b,map_particle_pars_fragment:xb,metalnessmap_fragment:yb,metalnessmap_pars_fragment:vb,morphinstance_vertex:Sb,morphcolor_vertex:Mb,morphnormal_vertex:bb,morphtarget_pars_vertex:wb,morphtarget_vertex:Eb,normal_fragment_begin:Tb,normal_fragment_maps:Ab,normal_pars_fragment:Db,normal_pars_vertex:Cb,normal_vertex:Rb,normalmap_pars_fragment:Pb,clearcoat_normal_fragment_begin:Ib,clearcoat_normal_fragment_maps:Lb,clearcoat_pars_fragment:Fb,iridescence_pars_fragment:Nb,opaque_fragment:Ub,packing:Ob,premultiplied_alpha_fragment:Bb,project_vertex:kb,dithering_fragment:zb,dithering_pars_fragment:Vb,roughnessmap_fragment:Hb,roughnessmap_pars_fragment:Gb,shadowmap_pars_fragment:Wb,shadowmap_pars_vertex:Xb,shadowmap_vertex:Yb,shadowmask_pars_fragment:qb,skinbase_vertex:Zb,skinning_pars_vertex:Jb,skinning_vertex:$b,skinnormal_vertex:Kb,specularmap_fragment:jb,specularmap_pars_fragment:Qb,tonemapping_fragment:tw,tonemapping_pars_fragment:ew,transmission_fragment:nw,transmission_pars_fragment:iw,uv_pars_fragment:rw,uv_pars_vertex:sw,uv_vertex:ow,worldpos_vertex:aw,background_vert:lw,background_frag:cw,backgroundCube_vert:uw,backgroundCube_frag:hw,cube_vert:fw,cube_frag:dw,depth_vert:pw,depth_frag:mw,distanceRGBA_vert:gw,distanceRGBA_frag:_w,equirect_vert:xw,equirect_frag:yw,linedashed_vert:vw,linedashed_frag:Sw,meshbasic_vert:Mw,meshbasic_frag:bw,meshlambert_vert:ww,meshlambert_frag:Ew,meshmatcap_vert:Tw,meshmatcap_frag:Aw,meshnormal_vert:Dw,meshnormal_frag:Cw,meshphong_vert:Rw,meshphong_frag:Pw,meshphysical_vert:Iw,meshphysical_frag:Lw,meshtoon_vert:Fw,meshtoon_frag:Nw,points_vert:Uw,points_frag:Ow,shadow_vert:Bw,shadow_frag:kw,sprite_vert:zw,sprite_frag:Vw},Ct={common:{diffuse:{value:new ge(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new oe},alphaMap:{value:null},alphaMapTransform:{value:new oe},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new oe}},envmap:{envMap:{value:null},envMapRotation:{value:new oe},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new oe}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new oe}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new oe},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new oe},normalScale:{value:new _e(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new oe},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new oe}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new oe}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new oe}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ge(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new ge(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new oe},alphaTest:{value:0},uvTransform:{value:new oe}},sprite:{diffuse:{value:new ge(16777215)},opacity:{value:1},center:{value:new _e(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new oe},alphaMap:{value:null},alphaMapTransform:{value:new oe},alphaTest:{value:0}}},Ni={basic:{uniforms:An([Ct.common,Ct.specularmap,Ct.envmap,Ct.aomap,Ct.lightmap,Ct.fog]),vertexShader:se.meshbasic_vert,fragmentShader:se.meshbasic_frag},lambert:{uniforms:An([Ct.common,Ct.specularmap,Ct.envmap,Ct.aomap,Ct.lightmap,Ct.emissivemap,Ct.bumpmap,Ct.normalmap,Ct.displacementmap,Ct.fog,Ct.lights,{emissive:{value:new ge(0)}}]),vertexShader:se.meshlambert_vert,fragmentShader:se.meshlambert_frag},phong:{uniforms:An([Ct.common,Ct.specularmap,Ct.envmap,Ct.aomap,Ct.lightmap,Ct.emissivemap,Ct.bumpmap,Ct.normalmap,Ct.displacementmap,Ct.fog,Ct.lights,{emissive:{value:new ge(0)},specular:{value:new ge(1118481)},shininess:{value:30}}]),vertexShader:se.meshphong_vert,fragmentShader:se.meshphong_frag},standard:{uniforms:An([Ct.common,Ct.envmap,Ct.aomap,Ct.lightmap,Ct.emissivemap,Ct.bumpmap,Ct.normalmap,Ct.displacementmap,Ct.roughnessmap,Ct.metalnessmap,Ct.fog,Ct.lights,{emissive:{value:new ge(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:se.meshphysical_vert,fragmentShader:se.meshphysical_frag},toon:{uniforms:An([Ct.common,Ct.aomap,Ct.lightmap,Ct.emissivemap,Ct.bumpmap,Ct.normalmap,Ct.displacementmap,Ct.gradientmap,Ct.fog,Ct.lights,{emissive:{value:new ge(0)}}]),vertexShader:se.meshtoon_vert,fragmentShader:se.meshtoon_frag},matcap:{uniforms:An([Ct.common,Ct.bumpmap,Ct.normalmap,Ct.displacementmap,Ct.fog,{matcap:{value:null}}]),vertexShader:se.meshmatcap_vert,fragmentShader:se.meshmatcap_frag},points:{uniforms:An([Ct.points,Ct.fog]),vertexShader:se.points_vert,fragmentShader:se.points_frag},dashed:{uniforms:An([Ct.common,Ct.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:se.linedashed_vert,fragmentShader:se.linedashed_frag},depth:{uniforms:An([Ct.common,Ct.displacementmap]),vertexShader:se.depth_vert,fragmentShader:se.depth_frag},normal:{uniforms:An([Ct.common,Ct.bumpmap,Ct.normalmap,Ct.displacementmap,{opacity:{value:1}}]),vertexShader:se.meshnormal_vert,fragmentShader:se.meshnormal_frag},sprite:{uniforms:An([Ct.sprite,Ct.fog]),vertexShader:se.sprite_vert,fragmentShader:se.sprite_frag},background:{uniforms:{uvTransform:{value:new oe},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:se.background_vert,fragmentShader:se.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new oe}},vertexShader:se.backgroundCube_vert,fragmentShader:se.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:se.cube_vert,fragmentShader:se.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:se.equirect_vert,fragmentShader:se.equirect_frag},distanceRGBA:{uniforms:An([Ct.common,Ct.displacementmap,{referencePosition:{value:new nt},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:se.distanceRGBA_vert,fragmentShader:se.distanceRGBA_frag},shadow:{uniforms:An([Ct.lights,Ct.fog,{color:{value:new ge(0)},opacity:{value:1}}]),vertexShader:se.shadow_vert,fragmentShader:se.shadow_frag}};Ni.physical={uniforms:An([Ni.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new oe},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new oe},clearcoatNormalScale:{value:new _e(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new oe},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new oe},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new oe},sheen:{value:0},sheenColor:{value:new ge(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new oe},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new oe},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new oe},transmissionSamplerSize:{value:new _e},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new oe},attenuationDistance:{value:0},attenuationColor:{value:new ge(0)},specularColor:{value:new ge(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new oe},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new oe},anisotropyVector:{value:new _e},anisotropyMap:{value:null},anisotropyMapTransform:{value:new oe}}]),vertexShader:se.meshphysical_vert,fragmentShader:se.meshphysical_frag};var wc={r:0,b:0,g:0},As=new cr,Hw=new Oe;function Gw(r,t,e,n,i,s,o){let a=new ge(0),l=s===!0?0:1,c,h,d=null,f=0,u=null;function _(b){let v=b.isScene===!0?b.background:null;return v&&v.isTexture&&(v=(b.backgroundBlurriness>0?e:t).get(v)),v}function p(b){let v=!1,S=_(b);S===null?g(a,l):S&&S.isColor&&(g(S,1),v=!0);let D=r.xr.getEnvironmentBlendMode();D==="additive"?n.buffers.color.setClear(0,0,0,1,o):D==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,o),(r.autoClear||v)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil)}function m(b,v){let S=_(v);S&&(S.isCubeTexture||S.mapping===nu)?(h===void 0&&(h=new Si(new $a(1,1,1),new ai({name:"BackgroundCubeMaterial",uniforms:Wo(Ni.backgroundCube.uniforms),vertexShader:Ni.backgroundCube.vertexShader,fragmentShader:Ni.backgroundCube.fragmentShader,side:Un,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(D,T,w){this.matrixWorld.copyPosition(w.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(h)),As.copy(v.backgroundRotation),As.x*=-1,As.y*=-1,As.z*=-1,S.isCubeTexture&&S.isRenderTargetTexture===!1&&(As.y*=-1,As.z*=-1),h.material.uniforms.envMap.value=S,h.material.uniforms.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(Hw.makeRotationFromEuler(As)),h.material.toneMapped=Se.getTransfer(S.colorSpace)!==Te,(d!==S||f!==S.version||u!==r.toneMapping)&&(h.material.needsUpdate=!0,d=S,f=S.version,u=r.toneMapping),h.layers.enableAll(),b.unshift(h,h.geometry,h.material,0,0,null)):S&&S.isTexture&&(c===void 0&&(c=new Si(new Yc(2,2),new ai({name:"BackgroundMaterial",uniforms:Wo(Ni.background.uniforms),vertexShader:Ni.background.vertexShader,fragmentShader:Ni.background.fragmentShader,side:Hr,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(c)),c.material.uniforms.t2D.value=S,c.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,c.material.toneMapped=Se.getTransfer(S.colorSpace)!==Te,S.matrixAutoUpdate===!0&&S.updateMatrix(),c.material.uniforms.uvTransform.value.copy(S.matrix),(d!==S||f!==S.version||u!==r.toneMapping)&&(c.material.needsUpdate=!0,d=S,f=S.version,u=r.toneMapping),c.layers.enableAll(),b.unshift(c,c.geometry,c.material,0,0,null))}function g(b,v){b.getRGB(wc,N0(r)),n.buffers.color.setClear(wc.r,wc.g,wc.b,v,o)}return{getClearColor:function(){return a},setClearColor:function(b,v=1){a.set(b),l=v,g(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(b){l=b,g(a,l)},render:p,addToRenderList:m}}function Ww(r,t){let e=r.getParameter(r.MAX_VERTEX_ATTRIBS),n={},i=f(null),s=i,o=!1;function a(y,I,N,C,V){let $=!1,W=d(C,N,I);s!==W&&(s=W,c(s.object)),$=u(y,C,N,V),$&&_(y,C,N,V),V!==null&&t.update(V,r.ELEMENT_ARRAY_BUFFER),($||o)&&(o=!1,S(y,I,N,C),V!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t.get(V).buffer))}function l(){return r.createVertexArray()}function c(y){return r.bindVertexArray(y)}function h(y){return r.deleteVertexArray(y)}function d(y,I,N){let C=N.wireframe===!0,V=n[y.id];V===void 0&&(V={},n[y.id]=V);let $=V[I.id];$===void 0&&($={},V[I.id]=$);let W=$[C];return W===void 0&&(W=f(l()),$[C]=W),W}function f(y){let I=[],N=[],C=[];for(let V=0;V<e;V++)I[V]=0,N[V]=0,C[V]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:I,enabledAttributes:N,attributeDivisors:C,object:y,attributes:{},index:null}}function u(y,I,N,C){let V=s.attributes,$=I.attributes,W=0,Z=N.getAttributes();for(let z in Z)if(Z[z].location>=0){let R=V[z],at=$[z];if(at===void 0&&(z==="instanceMatrix"&&y.instanceMatrix&&(at=y.instanceMatrix),z==="instanceColor"&&y.instanceColor&&(at=y.instanceColor)),R===void 0||R.attribute!==at||at&&R.data!==at.data)return!0;W++}return s.attributesNum!==W||s.index!==C}function _(y,I,N,C){let V={},$=I.attributes,W=0,Z=N.getAttributes();for(let z in Z)if(Z[z].location>=0){let R=$[z];R===void 0&&(z==="instanceMatrix"&&y.instanceMatrix&&(R=y.instanceMatrix),z==="instanceColor"&&y.instanceColor&&(R=y.instanceColor));let at={};at.attribute=R,R&&R.data&&(at.data=R.data),V[z]=at,W++}s.attributes=V,s.attributesNum=W,s.index=C}function p(){let y=s.newAttributes;for(let I=0,N=y.length;I<N;I++)y[I]=0}function m(y){g(y,0)}function g(y,I){let N=s.newAttributes,C=s.enabledAttributes,V=s.attributeDivisors;N[y]=1,C[y]===0&&(r.enableVertexAttribArray(y),C[y]=1),V[y]!==I&&(r.vertexAttribDivisor(y,I),V[y]=I)}function b(){let y=s.newAttributes,I=s.enabledAttributes;for(let N=0,C=I.length;N<C;N++)I[N]!==y[N]&&(r.disableVertexAttribArray(N),I[N]=0)}function v(y,I,N,C,V,$,W){W===!0?r.vertexAttribIPointer(y,I,N,V,$):r.vertexAttribPointer(y,I,N,C,V,$)}function S(y,I,N,C){p();let V=C.attributes,$=N.getAttributes(),W=I.defaultAttributeValues;for(let Z in $){let z=$[Z];if(z.location>=0){let U=V[Z];if(U===void 0&&(Z==="instanceMatrix"&&y.instanceMatrix&&(U=y.instanceMatrix),Z==="instanceColor"&&y.instanceColor&&(U=y.instanceColor)),U!==void 0){let R=U.normalized,at=U.itemSize,_t=t.get(U);if(_t===void 0)continue;let Ut=_t.buffer,X=_t.type,ot=_t.bytesPerElement,xt=X===r.INT||X===r.UNSIGNED_INT||U.gpuType===T0;if(U.isInterleavedBufferAttribute){let ct=U.data,Rt=ct.stride,kt=U.offset;if(ct.isInstancedInterleavedBuffer){for(let q=0;q<z.locationSize;q++)g(z.location+q,ct.meshPerAttribute);y.isInstancedMesh!==!0&&C._maxInstanceCount===void 0&&(C._maxInstanceCount=ct.meshPerAttribute*ct.count)}else for(let q=0;q<z.locationSize;q++)m(z.location+q);r.bindBuffer(r.ARRAY_BUFFER,Ut);for(let q=0;q<z.locationSize;q++)v(z.location+q,at/z.locationSize,X,R,Rt*ot,(kt+at/z.locationSize*q)*ot,xt)}else{if(U.isInstancedBufferAttribute){for(let ct=0;ct<z.locationSize;ct++)g(z.location+ct,U.meshPerAttribute);y.isInstancedMesh!==!0&&C._maxInstanceCount===void 0&&(C._maxInstanceCount=U.meshPerAttribute*U.count)}else for(let ct=0;ct<z.locationSize;ct++)m(z.location+ct);r.bindBuffer(r.ARRAY_BUFFER,Ut);for(let ct=0;ct<z.locationSize;ct++)v(z.location+ct,at/z.locationSize,X,R,at*ot,at/z.locationSize*ct*ot,xt)}}else if(W!==void 0){let R=W[Z];if(R!==void 0)switch(R.length){case 2:r.vertexAttrib2fv(z.location,R);break;case 3:r.vertexAttrib3fv(z.location,R);break;case 4:r.vertexAttrib4fv(z.location,R);break;default:r.vertexAttrib1fv(z.location,R)}}}}b()}function D(){P();for(let y in n){let I=n[y];for(let N in I){let C=I[N];for(let V in C)h(C[V].object),delete C[V];delete I[N]}delete n[y]}}function T(y){if(n[y.id]===void 0)return;let I=n[y.id];for(let N in I){let C=I[N];for(let V in C)h(C[V].object),delete C[V];delete I[N]}delete n[y.id]}function w(y){for(let I in n){let N=n[I];if(N[y.id]===void 0)continue;let C=N[y.id];for(let V in C)h(C[V].object),delete C[V];delete N[y.id]}}function P(){M(),o=!0,s!==i&&(s=i,c(s.object))}function M(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:a,reset:P,resetDefaultState:M,dispose:D,releaseStatesOfGeometry:T,releaseStatesOfProgram:w,initAttributes:p,enableAttribute:m,disableUnusedAttributes:b}}function Xw(r,t,e){let n;function i(c){n=c}function s(c,h){r.drawArrays(n,c,h),e.update(h,n,1)}function o(c,h,d){d!==0&&(r.drawArraysInstanced(n,c,h,d),e.update(h,n,d))}function a(c,h,d){if(d===0)return;let f=t.get("WEBGL_multi_draw");if(f===null)for(let u=0;u<d;u++)this.render(c[u],h[u]);else{f.multiDrawArraysWEBGL(n,c,0,h,0,d);let u=0;for(let _=0;_<d;_++)u+=h[_];e.update(u,n,1)}}function l(c,h,d,f){if(d===0)return;let u=t.get("WEBGL_multi_draw");if(u===null)for(let _=0;_<c.length;_++)o(c[_],h[_],f[_]);else{u.multiDrawArraysInstancedWEBGL(n,c,0,h,0,f,0,d);let _=0;for(let p=0;p<d;p++)_+=h[p];for(let p=0;p<f.length;p++)e.update(_,n,f[p])}}this.setMode=i,this.render=s,this.renderInstances=o,this.renderMultiDraw=a,this.renderMultiDrawInstances=l}function Yw(r,t,e,n){let i;function s(){if(i!==void 0)return i;if(t.has("EXT_texture_filter_anisotropic")===!0){let T=t.get("EXT_texture_filter_anisotropic");i=r.getParameter(T.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function o(T){return!(T!==Ui&&n.convert(T)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT))}function a(T){let w=T===iu&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(T!==Gr&&n.convert(T)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)&&T!==Or&&!w)}function l(T){if(T==="highp"){if(r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";T="mediump"}return T==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=e.precision!==void 0?e.precision:"highp",h=l(c);h!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",h,"instead."),c=h);let d=e.logarithmicDepthBuffer===!0,f=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),u=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=r.getParameter(r.MAX_TEXTURE_SIZE),p=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),m=r.getParameter(r.MAX_VERTEX_ATTRIBS),g=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),b=r.getParameter(r.MAX_VARYING_VECTORS),v=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),S=u>0,D=r.getParameter(r.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:d,maxTextures:f,maxVertexTextures:u,maxTextureSize:_,maxCubemapSize:p,maxAttributes:m,maxVertexUniforms:g,maxVaryings:b,maxFragmentUniforms:v,vertexTextures:S,maxSamples:D}}function qw(r){let t=this,e=null,n=0,i=!1,s=!1,o=new sr,a=new oe,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,f){let u=d.length!==0||f||n!==0||i;return i=f,n=d.length,u},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(d,f){e=h(d,f,0)},this.setState=function(d,f,u){let _=d.clippingPlanes,p=d.clipIntersection,m=d.clipShadows,g=r.get(d);if(!i||_===null||_.length===0||s&&!m)s?h(null):c();else{let b=s?0:n,v=b*4,S=g.clippingState||null;l.value=S,S=h(_,f,v,u);for(let D=0;D!==v;++D)S[D]=e[D];g.clippingState=S,this.numIntersection=p?this.numPlanes:0,this.numPlanes+=b}};function c(){l.value!==e&&(l.value=e,l.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function h(d,f,u,_){let p=d!==null?d.length:0,m=null;if(p!==0){if(m=l.value,_!==!0||m===null){let g=u+p*4,b=f.matrixWorldInverse;a.getNormalMatrix(b),(m===null||m.length<g)&&(m=new Float32Array(g));for(let v=0,S=u;v!==p;++v,S+=4)o.copy(d[v]).applyMatrix4(b,a),o.normal.toArray(m,S),m[S+3]=o.constant}l.value=m,l.needsUpdate=!0}return t.numPlanes=p,t.numIntersection=0,m}}function Zw(r){let t=new WeakMap;function e(o,a){return a===Bf?o.mapping=zo:a===kf&&(o.mapping=Vo),o}function n(o){if(o&&o.isTexture){let a=o.mapping;if(a===Bf||a===kf)if(t.has(o)){let l=t.get(o).texture;return e(l,o.mapping)}else{let l=o.image;if(l&&l.height>0){let c=new qf(l.height);return c.fromEquirectangularTexture(r,o),t.set(o,c),o.addEventListener("dispose",i),e(c.texture,o.mapping)}else return null}}return o}function i(o){let a=o.target;a.removeEventListener("dispose",i);let l=t.get(a);l!==void 0&&(t.delete(a),l.dispose())}function s(){t=new WeakMap}return{get:n,dispose:s}}var qc=class extends Wc{constructor(t=-1,e=1,n=1,i=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,e,n,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,s=n-t,o=n+t,a=i+e,l=i-e;if(this.view!==null&&this.view.enabled){let c=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=h*this.view.offsetY,l=a-h*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,this.view!==null&&(e.object.view=Object.assign({},this.view)),e}},Uo=4,K_=[.125,.215,.35,.446,.526,.582],Ps=20,Cf=new qc,j_=new ge,Rf=null,Pf=0,If=0,Lf=!1,Cs=(1+Math.sqrt(5))/2,Fo=1/Cs,Q_=[new nt(-Cs,Fo,0),new nt(Cs,Fo,0),new nt(-Fo,0,Cs),new nt(Fo,0,Cs),new nt(0,Cs,-Fo),new nt(0,Cs,Fo),new nt(-1,1,-1),new nt(1,1,-1),new nt(-1,1,1),new nt(1,1,1)],Zc=class{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,i=100){Rf=this._renderer.getRenderTarget(),Pf=this._renderer.getActiveCubeFace(),If=this._renderer.getActiveMipmapLevel(),Lf=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);let s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(t,n,i,s),e>0&&this._blur(s,0,0,e),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=n0(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=e0(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(Rf,Pf,If),this._renderer.xr.enabled=Lf,t.scissorTest=!1,Ec(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===zo||t.mapping===Vo?this._setSize(t.image.length===0?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),Rf=this._renderer.getRenderTarget(),Pf=this._renderer.getActiveCubeFace(),If=this._renderer.getActiveMipmapLevel(),Lf=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;let n=e||this._allocateTargets();return this._textureToCubeUV(t,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){let t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,n={magFilter:vi,minFilter:vi,generateMipmaps:!1,type:iu,format:Ui,colorSpace:Yr,depthBuffer:!1},i=t0(t,e,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=t0(t,e,n);let{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=Jw(s)),this._blurMaterial=$w(s,t,e)}return i}_compileMaterial(t){let e=new Si(this._lodPlanes[0],t);this._renderer.compile(e,Cf)}_sceneToCubeUV(t,e,n,i){let a=new Dn(90,1,e,n),l=[1,-1,1,1,1,1],c=[1,1,1,-1,-1,-1],h=this._renderer,d=h.autoClear,f=h.toneMapping;h.getClearColor(j_),h.toneMapping=Vr,h.autoClear=!1;let u=new Vc({name:"PMREM.Background",side:Un,depthWrite:!1,depthTest:!1}),_=new Si(new $a,u),p=!1,m=t.background;m?m.isColor&&(u.color.copy(m),t.background=null,p=!0):(u.color.copy(j_),p=!0);for(let g=0;g<6;g++){let b=g%3;b===0?(a.up.set(0,l[g],0),a.lookAt(c[g],0,0)):b===1?(a.up.set(0,0,l[g]),a.lookAt(0,c[g],0)):(a.up.set(0,l[g],0),a.lookAt(0,0,c[g]));let v=this._cubeSize;Ec(i,b*v,g>2?v:0,v,v),h.setRenderTarget(i),p&&h.render(_,a),h.render(t,a)}_.geometry.dispose(),_.material.dispose(),h.toneMapping=f,h.autoClear=d,t.background=m}_textureToCubeUV(t,e){let n=this._renderer,i=t.mapping===zo||t.mapping===Vo;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=n0()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=e0());let s=i?this._cubemapMaterial:this._equirectMaterial,o=new Si(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=t;let l=this._cubeSize;Ec(e,0,0,3*l,2*l),n.setRenderTarget(e),n.render(o,Cf)}_applyPMREM(t){let e=this._renderer,n=e.autoClear;e.autoClear=!1;let i=this._lodPlanes.length;for(let s=1;s<i;s++){let o=Math.sqrt(this._sigmas[s]*this._sigmas[s]-this._sigmas[s-1]*this._sigmas[s-1]),a=Q_[(i-s-1)%Q_.length];this._blur(t,s-1,s,o,a)}e.autoClear=n}_blur(t,e,n,i,s){let o=this._pingPongRenderTarget;this._halfBlur(t,o,e,n,i,"latitudinal",s),this._halfBlur(o,t,n,n,i,"longitudinal",s)}_halfBlur(t,e,n,i,s,o,a){let l=this._renderer,c=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");let h=3,d=new Si(this._lodPlanes[i],c),f=c.uniforms,u=this._sizeLods[n]-1,_=isFinite(s)?Math.PI/(2*u):2*Math.PI/(2*Ps-1),p=s/_,m=isFinite(s)?1+Math.floor(h*p):Ps;m>Ps&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${Ps}`);let g=[],b=0;for(let w=0;w<Ps;++w){let P=w/p,M=Math.exp(-P*P/2);g.push(M),w===0?b+=M:w<m&&(b+=2*M)}for(let w=0;w<g.length;w++)g[w]=g[w]/b;f.envMap.value=t.texture,f.samples.value=m,f.weights.value=g,f.latitudinal.value=o==="latitudinal",a&&(f.poleAxis.value=a);let{_lodMax:v}=this;f.dTheta.value=_,f.mipInt.value=v-n;let S=this._sizeLods[i],D=3*S*(i>v-Uo?i-v+Uo:0),T=4*(this._cubeSize-S);Ec(e,D,T,3*S,2*S),l.setRenderTarget(e),l.render(d,Cf)}};function Jw(r){let t=[],e=[],n=[],i=r,s=r-Uo+1+K_.length;for(let o=0;o<s;o++){let a=Math.pow(2,i);e.push(a);let l=1/a;o>r-Uo?l=K_[o-r+Uo-1]:o===0&&(l=0),n.push(l);let c=1/(a-2),h=-c,d=1+c,f=[h,h,d,h,d,d,h,h,d,d,h,d],u=6,_=6,p=3,m=2,g=1,b=new Float32Array(p*_*u),v=new Float32Array(m*_*u),S=new Float32Array(g*_*u);for(let T=0;T<u;T++){let w=T%3*2/3-1,P=T>2?0:-1,M=[w,P,0,w+2/3,P,0,w+2/3,P+1,0,w,P,0,w+2/3,P+1,0,w,P+1,0];b.set(M,p*_*T),v.set(f,m*_*T);let y=[T,T,T,T,T,T];S.set(y,g*_*T)}let D=new Oi;D.setAttribute("position",new ri(b,p)),D.setAttribute("uv",new ri(v,m)),D.setAttribute("faceIndex",new ri(S,g)),t.push(D),i>Uo&&i--}return{lodPlanes:t,sizeLods:e,sigmas:n}}function t0(r,t,e){let n=new lr(r,t,e);return n.texture.mapping=nu,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Ec(r,t,e,n,i){r.viewport.set(t,e,n,i),r.scissor.set(t,e,n,i)}function $w(r,t,e){let n=new Float32Array(Ps),i=new nt(0,1,0);return new ai({name:"SphericalGaussianBlur",defines:{n:Ps,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:Md(),fragmentShader:`
|
|
3570
|
+
}`,se={alphahash_fragment:cM,alphahash_pars_fragment:uM,alphamap_fragment:hM,alphamap_pars_fragment:fM,alphatest_fragment:dM,alphatest_pars_fragment:pM,aomap_fragment:mM,aomap_pars_fragment:gM,batching_pars_vertex:_M,batching_vertex:xM,begin_vertex:yM,beginnormal_vertex:vM,bsdfs:SM,iridescence_fragment:MM,bumpmap_pars_fragment:bM,clipping_planes_fragment:wM,clipping_planes_pars_fragment:EM,clipping_planes_pars_vertex:TM,clipping_planes_vertex:AM,color_fragment:DM,color_pars_fragment:CM,color_pars_vertex:RM,color_vertex:PM,common:IM,cube_uv_reflection_fragment:LM,defaultnormal_vertex:FM,displacementmap_pars_vertex:NM,displacementmap_vertex:UM,emissivemap_fragment:OM,emissivemap_pars_fragment:BM,colorspace_fragment:kM,colorspace_pars_fragment:zM,envmap_fragment:VM,envmap_common_pars_fragment:HM,envmap_pars_fragment:GM,envmap_pars_vertex:WM,envmap_physical_pars_fragment:eb,envmap_vertex:XM,fog_vertex:YM,fog_pars_vertex:qM,fog_fragment:ZM,fog_pars_fragment:JM,gradientmap_pars_fragment:$M,lightmap_pars_fragment:KM,lights_lambert_fragment:jM,lights_lambert_pars_fragment:QM,lights_pars_begin:tb,lights_toon_fragment:nb,lights_toon_pars_fragment:ib,lights_phong_fragment:rb,lights_phong_pars_fragment:sb,lights_physical_fragment:ob,lights_physical_pars_fragment:ab,lights_fragment_begin:lb,lights_fragment_maps:cb,lights_fragment_end:ub,logdepthbuf_fragment:hb,logdepthbuf_pars_fragment:fb,logdepthbuf_pars_vertex:db,logdepthbuf_vertex:pb,map_fragment:mb,map_pars_fragment:gb,map_particle_fragment:_b,map_particle_pars_fragment:xb,metalnessmap_fragment:yb,metalnessmap_pars_fragment:vb,morphinstance_vertex:Sb,morphcolor_vertex:Mb,morphnormal_vertex:bb,morphtarget_pars_vertex:wb,morphtarget_vertex:Eb,normal_fragment_begin:Tb,normal_fragment_maps:Ab,normal_pars_fragment:Db,normal_pars_vertex:Cb,normal_vertex:Rb,normalmap_pars_fragment:Pb,clearcoat_normal_fragment_begin:Ib,clearcoat_normal_fragment_maps:Lb,clearcoat_pars_fragment:Fb,iridescence_pars_fragment:Nb,opaque_fragment:Ub,packing:Ob,premultiplied_alpha_fragment:Bb,project_vertex:kb,dithering_fragment:zb,dithering_pars_fragment:Vb,roughnessmap_fragment:Hb,roughnessmap_pars_fragment:Gb,shadowmap_pars_fragment:Wb,shadowmap_pars_vertex:Xb,shadowmap_vertex:Yb,shadowmask_pars_fragment:qb,skinbase_vertex:Zb,skinning_pars_vertex:Jb,skinning_vertex:$b,skinnormal_vertex:Kb,specularmap_fragment:jb,specularmap_pars_fragment:Qb,tonemapping_fragment:tw,tonemapping_pars_fragment:ew,transmission_fragment:nw,transmission_pars_fragment:iw,uv_pars_fragment:rw,uv_pars_vertex:sw,uv_vertex:ow,worldpos_vertex:aw,background_vert:lw,background_frag:cw,backgroundCube_vert:uw,backgroundCube_frag:hw,cube_vert:fw,cube_frag:dw,depth_vert:pw,depth_frag:mw,distanceRGBA_vert:gw,distanceRGBA_frag:_w,equirect_vert:xw,equirect_frag:yw,linedashed_vert:vw,linedashed_frag:Sw,meshbasic_vert:Mw,meshbasic_frag:bw,meshlambert_vert:ww,meshlambert_frag:Ew,meshmatcap_vert:Tw,meshmatcap_frag:Aw,meshnormal_vert:Dw,meshnormal_frag:Cw,meshphong_vert:Rw,meshphong_frag:Pw,meshphysical_vert:Iw,meshphysical_frag:Lw,meshtoon_vert:Fw,meshtoon_frag:Nw,points_vert:Uw,points_frag:Ow,shadow_vert:Bw,shadow_frag:kw,sprite_vert:zw,sprite_frag:Vw},Ct={common:{diffuse:{value:new ge(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new oe},alphaMap:{value:null},alphaMapTransform:{value:new oe},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new oe}},envmap:{envMap:{value:null},envMapRotation:{value:new oe},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new oe}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new oe}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new oe},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new oe},normalScale:{value:new _e(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new oe},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new oe}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new oe}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new oe}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ge(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new ge(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new oe},alphaTest:{value:0},uvTransform:{value:new oe}},sprite:{diffuse:{value:new ge(16777215)},opacity:{value:1},center:{value:new _e(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new oe},alphaMap:{value:null},alphaMapTransform:{value:new oe},alphaTest:{value:0}}},Ni={basic:{uniforms:An([Ct.common,Ct.specularmap,Ct.envmap,Ct.aomap,Ct.lightmap,Ct.fog]),vertexShader:se.meshbasic_vert,fragmentShader:se.meshbasic_frag},lambert:{uniforms:An([Ct.common,Ct.specularmap,Ct.envmap,Ct.aomap,Ct.lightmap,Ct.emissivemap,Ct.bumpmap,Ct.normalmap,Ct.displacementmap,Ct.fog,Ct.lights,{emissive:{value:new ge(0)}}]),vertexShader:se.meshlambert_vert,fragmentShader:se.meshlambert_frag},phong:{uniforms:An([Ct.common,Ct.specularmap,Ct.envmap,Ct.aomap,Ct.lightmap,Ct.emissivemap,Ct.bumpmap,Ct.normalmap,Ct.displacementmap,Ct.fog,Ct.lights,{emissive:{value:new ge(0)},specular:{value:new ge(1118481)},shininess:{value:30}}]),vertexShader:se.meshphong_vert,fragmentShader:se.meshphong_frag},standard:{uniforms:An([Ct.common,Ct.envmap,Ct.aomap,Ct.lightmap,Ct.emissivemap,Ct.bumpmap,Ct.normalmap,Ct.displacementmap,Ct.roughnessmap,Ct.metalnessmap,Ct.fog,Ct.lights,{emissive:{value:new ge(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:se.meshphysical_vert,fragmentShader:se.meshphysical_frag},toon:{uniforms:An([Ct.common,Ct.aomap,Ct.lightmap,Ct.emissivemap,Ct.bumpmap,Ct.normalmap,Ct.displacementmap,Ct.gradientmap,Ct.fog,Ct.lights,{emissive:{value:new ge(0)}}]),vertexShader:se.meshtoon_vert,fragmentShader:se.meshtoon_frag},matcap:{uniforms:An([Ct.common,Ct.bumpmap,Ct.normalmap,Ct.displacementmap,Ct.fog,{matcap:{value:null}}]),vertexShader:se.meshmatcap_vert,fragmentShader:se.meshmatcap_frag},points:{uniforms:An([Ct.points,Ct.fog]),vertexShader:se.points_vert,fragmentShader:se.points_frag},dashed:{uniforms:An([Ct.common,Ct.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:se.linedashed_vert,fragmentShader:se.linedashed_frag},depth:{uniforms:An([Ct.common,Ct.displacementmap]),vertexShader:se.depth_vert,fragmentShader:se.depth_frag},normal:{uniforms:An([Ct.common,Ct.bumpmap,Ct.normalmap,Ct.displacementmap,{opacity:{value:1}}]),vertexShader:se.meshnormal_vert,fragmentShader:se.meshnormal_frag},sprite:{uniforms:An([Ct.sprite,Ct.fog]),vertexShader:se.sprite_vert,fragmentShader:se.sprite_frag},background:{uniforms:{uvTransform:{value:new oe},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:se.background_vert,fragmentShader:se.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new oe}},vertexShader:se.backgroundCube_vert,fragmentShader:se.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:se.cube_vert,fragmentShader:se.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:se.equirect_vert,fragmentShader:se.equirect_frag},distanceRGBA:{uniforms:An([Ct.common,Ct.displacementmap,{referencePosition:{value:new nt},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:se.distanceRGBA_vert,fragmentShader:se.distanceRGBA_frag},shadow:{uniforms:An([Ct.lights,Ct.fog,{color:{value:new ge(0)},opacity:{value:1}}]),vertexShader:se.shadow_vert,fragmentShader:se.shadow_frag}};Ni.physical={uniforms:An([Ni.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new oe},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new oe},clearcoatNormalScale:{value:new _e(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new oe},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new oe},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new oe},sheen:{value:0},sheenColor:{value:new ge(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new oe},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new oe},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new oe},transmissionSamplerSize:{value:new _e},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new oe},attenuationDistance:{value:0},attenuationColor:{value:new ge(0)},specularColor:{value:new ge(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new oe},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new oe},anisotropyVector:{value:new _e},anisotropyMap:{value:null},anisotropyMapTransform:{value:new oe}}]),vertexShader:se.meshphysical_vert,fragmentShader:se.meshphysical_frag};var wc={r:0,b:0,g:0},As=new cr,Hw=new Oe;function Gw(r,t,e,n,i,s,o){let a=new ge(0),l=s===!0?0:1,c,h,f=null,d=0,u=null;function _(b){let v=b.isScene===!0?b.background:null;return v&&v.isTexture&&(v=(b.backgroundBlurriness>0?e:t).get(v)),v}function m(b){let v=!1,S=_(b);S===null?g(a,l):S&&S.isColor&&(g(S,1),v=!0);let D=r.xr.getEnvironmentBlendMode();D==="additive"?n.buffers.color.setClear(0,0,0,1,o):D==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,o),(r.autoClear||v)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil)}function p(b,v){let S=_(v);S&&(S.isCubeTexture||S.mapping===nu)?(h===void 0&&(h=new Si(new $a(1,1,1),new ai({name:"BackgroundCubeMaterial",uniforms:Wo(Ni.backgroundCube.uniforms),vertexShader:Ni.backgroundCube.vertexShader,fragmentShader:Ni.backgroundCube.fragmentShader,side:Un,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(D,T,w){this.matrixWorld.copyPosition(w.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(h)),As.copy(v.backgroundRotation),As.x*=-1,As.y*=-1,As.z*=-1,S.isCubeTexture&&S.isRenderTargetTexture===!1&&(As.y*=-1,As.z*=-1),h.material.uniforms.envMap.value=S,h.material.uniforms.flipEnvMap.value=S.isCubeTexture&&S.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(Hw.makeRotationFromEuler(As)),h.material.toneMapped=Se.getTransfer(S.colorSpace)!==Te,(f!==S||d!==S.version||u!==r.toneMapping)&&(h.material.needsUpdate=!0,f=S,d=S.version,u=r.toneMapping),h.layers.enableAll(),b.unshift(h,h.geometry,h.material,0,0,null)):S&&S.isTexture&&(c===void 0&&(c=new Si(new Yc(2,2),new ai({name:"BackgroundMaterial",uniforms:Wo(Ni.background.uniforms),vertexShader:Ni.background.vertexShader,fragmentShader:Ni.background.fragmentShader,side:Hr,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(c)),c.material.uniforms.t2D.value=S,c.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,c.material.toneMapped=Se.getTransfer(S.colorSpace)!==Te,S.matrixAutoUpdate===!0&&S.updateMatrix(),c.material.uniforms.uvTransform.value.copy(S.matrix),(f!==S||d!==S.version||u!==r.toneMapping)&&(c.material.needsUpdate=!0,f=S,d=S.version,u=r.toneMapping),c.layers.enableAll(),b.unshift(c,c.geometry,c.material,0,0,null))}function g(b,v){b.getRGB(wc,N0(r)),n.buffers.color.setClear(wc.r,wc.g,wc.b,v,o)}return{getClearColor:function(){return a},setClearColor:function(b,v=1){a.set(b),l=v,g(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(b){l=b,g(a,l)},render:m,addToRenderList:p}}function Ww(r,t){let e=r.getParameter(r.MAX_VERTEX_ATTRIBS),n={},i=d(null),s=i,o=!1;function a(y,I,N,C,V){let $=!1,W=f(C,N,I);s!==W&&(s=W,c(s.object)),$=u(y,C,N,V),$&&_(y,C,N,V),V!==null&&t.update(V,r.ELEMENT_ARRAY_BUFFER),($||o)&&(o=!1,S(y,I,N,C),V!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t.get(V).buffer))}function l(){return r.createVertexArray()}function c(y){return r.bindVertexArray(y)}function h(y){return r.deleteVertexArray(y)}function f(y,I,N){let C=N.wireframe===!0,V=n[y.id];V===void 0&&(V={},n[y.id]=V);let $=V[I.id];$===void 0&&($={},V[I.id]=$);let W=$[C];return W===void 0&&(W=d(l()),$[C]=W),W}function d(y){let I=[],N=[],C=[];for(let V=0;V<e;V++)I[V]=0,N[V]=0,C[V]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:I,enabledAttributes:N,attributeDivisors:C,object:y,attributes:{},index:null}}function u(y,I,N,C){let V=s.attributes,$=I.attributes,W=0,Z=N.getAttributes();for(let z in Z)if(Z[z].location>=0){let R=V[z],at=$[z];if(at===void 0&&(z==="instanceMatrix"&&y.instanceMatrix&&(at=y.instanceMatrix),z==="instanceColor"&&y.instanceColor&&(at=y.instanceColor)),R===void 0||R.attribute!==at||at&&R.data!==at.data)return!0;W++}return s.attributesNum!==W||s.index!==C}function _(y,I,N,C){let V={},$=I.attributes,W=0,Z=N.getAttributes();for(let z in Z)if(Z[z].location>=0){let R=$[z];R===void 0&&(z==="instanceMatrix"&&y.instanceMatrix&&(R=y.instanceMatrix),z==="instanceColor"&&y.instanceColor&&(R=y.instanceColor));let at={};at.attribute=R,R&&R.data&&(at.data=R.data),V[z]=at,W++}s.attributes=V,s.attributesNum=W,s.index=C}function m(){let y=s.newAttributes;for(let I=0,N=y.length;I<N;I++)y[I]=0}function p(y){g(y,0)}function g(y,I){let N=s.newAttributes,C=s.enabledAttributes,V=s.attributeDivisors;N[y]=1,C[y]===0&&(r.enableVertexAttribArray(y),C[y]=1),V[y]!==I&&(r.vertexAttribDivisor(y,I),V[y]=I)}function b(){let y=s.newAttributes,I=s.enabledAttributes;for(let N=0,C=I.length;N<C;N++)I[N]!==y[N]&&(r.disableVertexAttribArray(N),I[N]=0)}function v(y,I,N,C,V,$,W){W===!0?r.vertexAttribIPointer(y,I,N,V,$):r.vertexAttribPointer(y,I,N,C,V,$)}function S(y,I,N,C){m();let V=C.attributes,$=N.getAttributes(),W=I.defaultAttributeValues;for(let Z in $){let z=$[Z];if(z.location>=0){let U=V[Z];if(U===void 0&&(Z==="instanceMatrix"&&y.instanceMatrix&&(U=y.instanceMatrix),Z==="instanceColor"&&y.instanceColor&&(U=y.instanceColor)),U!==void 0){let R=U.normalized,at=U.itemSize,_t=t.get(U);if(_t===void 0)continue;let Ut=_t.buffer,X=_t.type,ot=_t.bytesPerElement,xt=X===r.INT||X===r.UNSIGNED_INT||U.gpuType===T0;if(U.isInterleavedBufferAttribute){let ct=U.data,Rt=ct.stride,kt=U.offset;if(ct.isInstancedInterleavedBuffer){for(let q=0;q<z.locationSize;q++)g(z.location+q,ct.meshPerAttribute);y.isInstancedMesh!==!0&&C._maxInstanceCount===void 0&&(C._maxInstanceCount=ct.meshPerAttribute*ct.count)}else for(let q=0;q<z.locationSize;q++)p(z.location+q);r.bindBuffer(r.ARRAY_BUFFER,Ut);for(let q=0;q<z.locationSize;q++)v(z.location+q,at/z.locationSize,X,R,Rt*ot,(kt+at/z.locationSize*q)*ot,xt)}else{if(U.isInstancedBufferAttribute){for(let ct=0;ct<z.locationSize;ct++)g(z.location+ct,U.meshPerAttribute);y.isInstancedMesh!==!0&&C._maxInstanceCount===void 0&&(C._maxInstanceCount=U.meshPerAttribute*U.count)}else for(let ct=0;ct<z.locationSize;ct++)p(z.location+ct);r.bindBuffer(r.ARRAY_BUFFER,Ut);for(let ct=0;ct<z.locationSize;ct++)v(z.location+ct,at/z.locationSize,X,R,at*ot,at/z.locationSize*ct*ot,xt)}}else if(W!==void 0){let R=W[Z];if(R!==void 0)switch(R.length){case 2:r.vertexAttrib2fv(z.location,R);break;case 3:r.vertexAttrib3fv(z.location,R);break;case 4:r.vertexAttrib4fv(z.location,R);break;default:r.vertexAttrib1fv(z.location,R)}}}}b()}function D(){P();for(let y in n){let I=n[y];for(let N in I){let C=I[N];for(let V in C)h(C[V].object),delete C[V];delete I[N]}delete n[y]}}function T(y){if(n[y.id]===void 0)return;let I=n[y.id];for(let N in I){let C=I[N];for(let V in C)h(C[V].object),delete C[V];delete I[N]}delete n[y.id]}function w(y){for(let I in n){let N=n[I];if(N[y.id]===void 0)continue;let C=N[y.id];for(let V in C)h(C[V].object),delete C[V];delete N[y.id]}}function P(){M(),o=!0,s!==i&&(s=i,c(s.object))}function M(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:a,reset:P,resetDefaultState:M,dispose:D,releaseStatesOfGeometry:T,releaseStatesOfProgram:w,initAttributes:m,enableAttribute:p,disableUnusedAttributes:b}}function Xw(r,t,e){let n;function i(c){n=c}function s(c,h){r.drawArrays(n,c,h),e.update(h,n,1)}function o(c,h,f){f!==0&&(r.drawArraysInstanced(n,c,h,f),e.update(h,n,f))}function a(c,h,f){if(f===0)return;let d=t.get("WEBGL_multi_draw");if(d===null)for(let u=0;u<f;u++)this.render(c[u],h[u]);else{d.multiDrawArraysWEBGL(n,c,0,h,0,f);let u=0;for(let _=0;_<f;_++)u+=h[_];e.update(u,n,1)}}function l(c,h,f,d){if(f===0)return;let u=t.get("WEBGL_multi_draw");if(u===null)for(let _=0;_<c.length;_++)o(c[_],h[_],d[_]);else{u.multiDrawArraysInstancedWEBGL(n,c,0,h,0,d,0,f);let _=0;for(let m=0;m<f;m++)_+=h[m];for(let m=0;m<d.length;m++)e.update(_,n,d[m])}}this.setMode=i,this.render=s,this.renderInstances=o,this.renderMultiDraw=a,this.renderMultiDrawInstances=l}function Yw(r,t,e,n){let i;function s(){if(i!==void 0)return i;if(t.has("EXT_texture_filter_anisotropic")===!0){let T=t.get("EXT_texture_filter_anisotropic");i=r.getParameter(T.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function o(T){return!(T!==Ui&&n.convert(T)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT))}function a(T){let w=T===iu&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(T!==Gr&&n.convert(T)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)&&T!==Or&&!w)}function l(T){if(T==="highp"){if(r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";T="mediump"}return T==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=e.precision!==void 0?e.precision:"highp",h=l(c);h!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",h,"instead."),c=h);let f=e.logarithmicDepthBuffer===!0,d=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),u=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=r.getParameter(r.MAX_TEXTURE_SIZE),m=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),p=r.getParameter(r.MAX_VERTEX_ATTRIBS),g=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),b=r.getParameter(r.MAX_VARYING_VECTORS),v=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),S=u>0,D=r.getParameter(r.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:o,textureTypeReadable:a,precision:c,logarithmicDepthBuffer:f,maxTextures:d,maxVertexTextures:u,maxTextureSize:_,maxCubemapSize:m,maxAttributes:p,maxVertexUniforms:g,maxVaryings:b,maxFragmentUniforms:v,vertexTextures:S,maxSamples:D}}function qw(r){let t=this,e=null,n=0,i=!1,s=!1,o=new sr,a=new oe,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,d){let u=f.length!==0||d||n!==0||i;return i=d,n=f.length,u},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(f,d){e=h(f,d,0)},this.setState=function(f,d,u){let _=f.clippingPlanes,m=f.clipIntersection,p=f.clipShadows,g=r.get(f);if(!i||_===null||_.length===0||s&&!p)s?h(null):c();else{let b=s?0:n,v=b*4,S=g.clippingState||null;l.value=S,S=h(_,d,v,u);for(let D=0;D!==v;++D)S[D]=e[D];g.clippingState=S,this.numIntersection=m?this.numPlanes:0,this.numPlanes+=b}};function c(){l.value!==e&&(l.value=e,l.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function h(f,d,u,_){let m=f!==null?f.length:0,p=null;if(m!==0){if(p=l.value,_!==!0||p===null){let g=u+m*4,b=d.matrixWorldInverse;a.getNormalMatrix(b),(p===null||p.length<g)&&(p=new Float32Array(g));for(let v=0,S=u;v!==m;++v,S+=4)o.copy(f[v]).applyMatrix4(b,a),o.normal.toArray(p,S),p[S+3]=o.constant}l.value=p,l.needsUpdate=!0}return t.numPlanes=m,t.numIntersection=0,p}}function Zw(r){let t=new WeakMap;function e(o,a){return a===Bf?o.mapping=zo:a===kf&&(o.mapping=Vo),o}function n(o){if(o&&o.isTexture){let a=o.mapping;if(a===Bf||a===kf)if(t.has(o)){let l=t.get(o).texture;return e(l,o.mapping)}else{let l=o.image;if(l&&l.height>0){let c=new qf(l.height);return c.fromEquirectangularTexture(r,o),t.set(o,c),o.addEventListener("dispose",i),e(c.texture,o.mapping)}else return null}}return o}function i(o){let a=o.target;a.removeEventListener("dispose",i);let l=t.get(a);l!==void 0&&(t.delete(a),l.dispose())}function s(){t=new WeakMap}return{get:n,dispose:s}}var qc=class extends Wc{constructor(t=-1,e=1,n=1,i=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,e,n,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,s=n-t,o=n+t,a=i+e,l=i-e;if(this.view!==null&&this.view.enabled){let c=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=h*this.view.offsetY,l=a-h*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,this.view!==null&&(e.object.view=Object.assign({},this.view)),e}},Uo=4,K_=[.125,.215,.35,.446,.526,.582],Ps=20,Cf=new qc,j_=new ge,Rf=null,Pf=0,If=0,Lf=!1,Cs=(1+Math.sqrt(5))/2,Fo=1/Cs,Q_=[new nt(-Cs,Fo,0),new nt(Cs,Fo,0),new nt(-Fo,0,Cs),new nt(Fo,0,Cs),new nt(0,Cs,-Fo),new nt(0,Cs,Fo),new nt(-1,1,-1),new nt(1,1,-1),new nt(-1,1,1),new nt(1,1,1)],Zc=class{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,i=100){Rf=this._renderer.getRenderTarget(),Pf=this._renderer.getActiveCubeFace(),If=this._renderer.getActiveMipmapLevel(),Lf=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);let s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(t,n,i,s),e>0&&this._blur(s,0,0,e),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=n0(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=e0(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(Rf,Pf,If),this._renderer.xr.enabled=Lf,t.scissorTest=!1,Ec(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===zo||t.mapping===Vo?this._setSize(t.image.length===0?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),Rf=this._renderer.getRenderTarget(),Pf=this._renderer.getActiveCubeFace(),If=this._renderer.getActiveMipmapLevel(),Lf=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;let n=e||this._allocateTargets();return this._textureToCubeUV(t,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){let t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,n={magFilter:vi,minFilter:vi,generateMipmaps:!1,type:iu,format:Ui,colorSpace:Yr,depthBuffer:!1},i=t0(t,e,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=t0(t,e,n);let{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=Jw(s)),this._blurMaterial=$w(s,t,e)}return i}_compileMaterial(t){let e=new Si(this._lodPlanes[0],t);this._renderer.compile(e,Cf)}_sceneToCubeUV(t,e,n,i){let a=new Dn(90,1,e,n),l=[1,-1,1,1,1,1],c=[1,1,1,-1,-1,-1],h=this._renderer,f=h.autoClear,d=h.toneMapping;h.getClearColor(j_),h.toneMapping=Vr,h.autoClear=!1;let u=new Vc({name:"PMREM.Background",side:Un,depthWrite:!1,depthTest:!1}),_=new Si(new $a,u),m=!1,p=t.background;p?p.isColor&&(u.color.copy(p),t.background=null,m=!0):(u.color.copy(j_),m=!0);for(let g=0;g<6;g++){let b=g%3;b===0?(a.up.set(0,l[g],0),a.lookAt(c[g],0,0)):b===1?(a.up.set(0,0,l[g]),a.lookAt(0,c[g],0)):(a.up.set(0,l[g],0),a.lookAt(0,0,c[g]));let v=this._cubeSize;Ec(i,b*v,g>2?v:0,v,v),h.setRenderTarget(i),m&&h.render(_,a),h.render(t,a)}_.geometry.dispose(),_.material.dispose(),h.toneMapping=d,h.autoClear=f,t.background=p}_textureToCubeUV(t,e){let n=this._renderer,i=t.mapping===zo||t.mapping===Vo;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=n0()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=e0());let s=i?this._cubemapMaterial:this._equirectMaterial,o=new Si(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=t;let l=this._cubeSize;Ec(e,0,0,3*l,2*l),n.setRenderTarget(e),n.render(o,Cf)}_applyPMREM(t){let e=this._renderer,n=e.autoClear;e.autoClear=!1;let i=this._lodPlanes.length;for(let s=1;s<i;s++){let o=Math.sqrt(this._sigmas[s]*this._sigmas[s]-this._sigmas[s-1]*this._sigmas[s-1]),a=Q_[(i-s-1)%Q_.length];this._blur(t,s-1,s,o,a)}e.autoClear=n}_blur(t,e,n,i,s){let o=this._pingPongRenderTarget;this._halfBlur(t,o,e,n,i,"latitudinal",s),this._halfBlur(o,t,n,n,i,"longitudinal",s)}_halfBlur(t,e,n,i,s,o,a){let l=this._renderer,c=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");let h=3,f=new Si(this._lodPlanes[i],c),d=c.uniforms,u=this._sizeLods[n]-1,_=isFinite(s)?Math.PI/(2*u):2*Math.PI/(2*Ps-1),m=s/_,p=isFinite(s)?1+Math.floor(h*m):Ps;p>Ps&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${p} samples when the maximum is set to ${Ps}`);let g=[],b=0;for(let w=0;w<Ps;++w){let P=w/m,M=Math.exp(-P*P/2);g.push(M),w===0?b+=M:w<p&&(b+=2*M)}for(let w=0;w<g.length;w++)g[w]=g[w]/b;d.envMap.value=t.texture,d.samples.value=p,d.weights.value=g,d.latitudinal.value=o==="latitudinal",a&&(d.poleAxis.value=a);let{_lodMax:v}=this;d.dTheta.value=_,d.mipInt.value=v-n;let S=this._sizeLods[i],D=3*S*(i>v-Uo?i-v+Uo:0),T=4*(this._cubeSize-S);Ec(e,D,T,3*S,2*S),l.setRenderTarget(e),l.render(f,Cf)}};function Jw(r){let t=[],e=[],n=[],i=r,s=r-Uo+1+K_.length;for(let o=0;o<s;o++){let a=Math.pow(2,i);e.push(a);let l=1/a;o>r-Uo?l=K_[o-r+Uo-1]:o===0&&(l=0),n.push(l);let c=1/(a-2),h=-c,f=1+c,d=[h,h,f,h,f,f,h,h,f,f,h,f],u=6,_=6,m=3,p=2,g=1,b=new Float32Array(m*_*u),v=new Float32Array(p*_*u),S=new Float32Array(g*_*u);for(let T=0;T<u;T++){let w=T%3*2/3-1,P=T>2?0:-1,M=[w,P,0,w+2/3,P,0,w+2/3,P+1,0,w,P,0,w+2/3,P+1,0,w,P+1,0];b.set(M,m*_*T),v.set(d,p*_*T);let y=[T,T,T,T,T,T];S.set(y,g*_*T)}let D=new Oi;D.setAttribute("position",new ri(b,m)),D.setAttribute("uv",new ri(v,p)),D.setAttribute("faceIndex",new ri(S,g)),t.push(D),i>Uo&&i--}return{lodPlanes:t,sizeLods:e,sigmas:n}}function t0(r,t,e){let n=new lr(r,t,e);return n.texture.mapping=nu,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Ec(r,t,e,n,i){r.viewport.set(t,e,n,i),r.scissor.set(t,e,n,i)}function $w(r,t,e){let n=new Float32Array(Ps),i=new nt(0,1,0);return new ai({name:"SphericalGaussianBlur",defines:{n:Ps,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/e,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:Md(),fragmentShader:`
|
|
3571
3571
|
|
|
3572
3572
|
precision mediump float;
|
|
3573
3573
|
precision mediump int;
|
|
@@ -3717,7 +3717,7 @@ void main() {
|
|
|
3717
3717
|
gl_Position = vec4( position, 1.0 );
|
|
3718
3718
|
|
|
3719
3719
|
}
|
|
3720
|
-
`}function Kw(r){let t=new WeakMap,e=null;function n(a){if(a&&a.isTexture){let l=a.mapping,c=l===Bf||l===kf,h=l===zo||l===Vo;if(c||h){let d=t.get(a),f=d!==void 0?d.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==f)return e===null&&(e=new Zc(r)),d=c?e.fromEquirectangular(a,d):e.fromCubemap(a,d),d.texture.pmremVersion=a.pmremVersion,t.set(a,d),d.texture;if(d!==void 0)return d.texture;{let u=a.image;return c&&u&&u.height>0||h&&u&&i(u)?(e===null&&(e=new Zc(r)),d=c?e.fromEquirectangular(a):e.fromCubemap(a),d.texture.pmremVersion=a.pmremVersion,t.set(a,d),a.addEventListener("dispose",s),d.texture):null}}}return a}function i(a){let l=0,c=6;for(let h=0;h<c;h++)a[h]!==void 0&&l++;return l===c}function s(a){let l=a.target;l.removeEventListener("dispose",s);let c=t.get(l);c!==void 0&&(t.delete(l),c.dispose())}function o(){t=new WeakMap,e!==null&&(e.dispose(),e=null)}return{get:n,dispose:o}}function jw(r){let t={};function e(n){if(t[n]!==void 0)return t[n];let i;switch(n){case"WEBGL_depth_texture":i=r.getExtension("WEBGL_depth_texture")||r.getExtension("MOZ_WEBGL_depth_texture")||r.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("MOZ_EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=r.getExtension("WEBGL_compressed_texture_s3tc")||r.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=r.getExtension("WEBGL_compressed_texture_pvrtc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=r.getExtension(n)}return t[n]=i,i}return{has:function(n){return e(n)!==null},init:function(){e("EXT_color_buffer_float"),e("WEBGL_clip_cull_distance"),e("OES_texture_float_linear"),e("EXT_color_buffer_half_float"),e("WEBGL_multisampled_render_to_texture"),e("WEBGL_render_shared_exponent")},get:function(n){let i=e(n);return i===null&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),i}}}function Qw(r,t,e,n){let i={},s=new WeakMap;function o(d){let f=d.target;f.index!==null&&t.remove(f.index);for(let _ in f.attributes)t.remove(f.attributes[_]);for(let _ in f.morphAttributes){let p=f.morphAttributes[_];for(let m=0,g=p.length;m<g;m++)t.remove(p[m])}f.removeEventListener("dispose",o),delete i[f.id];let u=s.get(f);u&&(t.remove(u),s.delete(f)),n.releaseStatesOfGeometry(f),f.isInstancedBufferGeometry===!0&&delete f._maxInstanceCount,e.memory.geometries--}function a(d,f){return i[f.id]===!0||(f.addEventListener("dispose",o),i[f.id]=!0,e.memory.geometries++),f}function l(d){let f=d.attributes;for(let _ in f)t.update(f[_],r.ARRAY_BUFFER);let u=d.morphAttributes;for(let _ in u){let p=u[_];for(let m=0,g=p.length;m<g;m++)t.update(p[m],r.ARRAY_BUFFER)}}function c(d){let f=[],u=d.index,_=d.attributes.position,p=0;if(u!==null){let b=u.array;p=u.version;for(let v=0,S=b.length;v<S;v+=3){let D=b[v+0],T=b[v+1],w=b[v+2];f.push(D,T,T,w,w,D)}}else if(_!==void 0){let b=_.array;p=_.version;for(let v=0,S=b.length/3-1;v<S;v+=3){let D=v+0,T=v+1,w=v+2;f.push(D,T,T,w,w,D)}}else return;let m=new(L0(f)?Gc:Hc)(f,1);m.version=p;let g=s.get(d);g&&t.remove(g),s.set(d,m)}function h(d){let f=s.get(d);if(f){let u=d.index;u!==null&&f.version<u.version&&c(d)}else c(d);return s.get(d)}return{get:a,update:l,getWireframeAttribute:h}}function t1(r,t,e){let n;function i(f){n=f}let s,o;function a(f){s=f.type,o=f.bytesPerElement}function l(f,u){r.drawElements(n,u,s,f*o),e.update(u,n,1)}function c(f,u,_){_!==0&&(r.drawElementsInstanced(n,u,s,f*o,_),e.update(u,n,_))}function h(f,u,_){if(_===0)return;let p=t.get("WEBGL_multi_draw");if(p===null)for(let m=0;m<_;m++)this.render(f[m]/o,u[m]);else{p.multiDrawElementsWEBGL(n,u,0,s,f,0,_);let m=0;for(let g=0;g<_;g++)m+=u[g];e.update(m,n,1)}}function d(f,u,_,p){if(_===0)return;let m=t.get("WEBGL_multi_draw");if(m===null)for(let g=0;g<f.length;g++)c(f[g]/o,u[g],p[g]);else{m.multiDrawElementsInstancedWEBGL(n,u,0,s,f,0,p,0,_);let g=0;for(let b=0;b<_;b++)g+=u[b];for(let b=0;b<p.length;b++)e.update(g,n,p[b])}}this.setMode=i,this.setIndex=a,this.render=l,this.renderInstances=c,this.renderMultiDraw=h,this.renderMultiDrawInstances=d}function e1(r){let t={geometries:0,textures:0},e={frame:0,calls:0,triangles:0,points:0,lines:0};function n(s,o,a){switch(e.calls++,o){case r.TRIANGLES:e.triangles+=a*(s/3);break;case r.LINES:e.lines+=a*(s/2);break;case r.LINE_STRIP:e.lines+=a*(s-1);break;case r.LINE_LOOP:e.lines+=a*s;break;case r.POINTS:e.points+=a*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function i(){e.calls=0,e.triangles=0,e.points=0,e.lines=0}return{memory:t,render:e,programs:null,autoReset:!0,reset:i,update:n}}function n1(r,t,e){let n=new WeakMap,i=new Qe;function s(o,a,l){let c=o.morphTargetInfluences,h=a.morphAttributes.position||a.morphAttributes.normal||a.morphAttributes.color,d=h!==void 0?h.length:0,f=n.get(a);if(f===void 0||f.count!==d){let M=function(){w.dispose(),n.delete(a),a.removeEventListener("dispose",M)};f!==void 0&&f.texture.dispose();let u=a.morphAttributes.position!==void 0,_=a.morphAttributes.normal!==void 0,p=a.morphAttributes.color!==void 0,m=a.morphAttributes.position||[],g=a.morphAttributes.normal||[],b=a.morphAttributes.color||[],v=0;u===!0&&(v=1),_===!0&&(v=2),p===!0&&(v=3);let S=a.attributes.position.count*v,D=1;S>t.maxTextureSize&&(D=Math.ceil(S/t.maxTextureSize),S=t.maxTextureSize);let T=new Float32Array(S*D*4*d),w=new Bc(T,S,D,d);w.type=Or,w.needsUpdate=!0;let P=v*4;for(let y=0;y<d;y++){let I=m[y],N=g[y],C=b[y],V=S*D*4*y;for(let $=0;$<I.count;$++){let W=$*P;u===!0&&(i.fromBufferAttribute(I,$),T[V+W+0]=i.x,T[V+W+1]=i.y,T[V+W+2]=i.z,T[V+W+3]=0),_===!0&&(i.fromBufferAttribute(N,$),T[V+W+4]=i.x,T[V+W+5]=i.y,T[V+W+6]=i.z,T[V+W+7]=0),p===!0&&(i.fromBufferAttribute(C,$),T[V+W+8]=i.x,T[V+W+9]=i.y,T[V+W+10]=i.z,T[V+W+11]=C.itemSize===4?i.w:1)}}f={count:d,texture:w,size:new _e(S,D)},n.set(a,f),a.addEventListener("dispose",M)}if(o.isInstancedMesh===!0&&o.morphTexture!==null)l.getUniforms().setValue(r,"morphTexture",o.morphTexture,e);else{let u=0;for(let p=0;p<c.length;p++)u+=c[p];let _=a.morphTargetsRelative?1:1-u;l.getUniforms().setValue(r,"morphTargetBaseInfluence",_),l.getUniforms().setValue(r,"morphTargetInfluences",c)}l.getUniforms().setValue(r,"morphTargetsTexture",f.texture,e),l.getUniforms().setValue(r,"morphTargetsTextureSize",f.size)}return{update:s}}function i1(r,t,e,n){let i=new WeakMap;function s(l){let c=n.render.frame,h=l.geometry,d=t.get(l,h);if(i.get(d)!==c&&(t.update(d),i.set(d,c)),l.isInstancedMesh&&(l.hasEventListener("dispose",a)===!1&&l.addEventListener("dispose",a),i.get(l)!==c&&(e.update(l.instanceMatrix,r.ARRAY_BUFFER),l.instanceColor!==null&&e.update(l.instanceColor,r.ARRAY_BUFFER),i.set(l,c))),l.isSkinnedMesh){let f=l.skeleton;i.get(f)!==c&&(f.update(),i.set(f,c))}return d}function o(){i=new WeakMap}function a(l){let c=l.target;c.removeEventListener("dispose",a),e.remove(c.instanceMatrix),c.instanceColor!==null&&e.remove(c.instanceColor)}return{update:s,dispose:o}}var Jc=class extends oi{constructor(t,e,n,i,s,o,a,l,c,h){if(h=h!==void 0?h:Oo,h!==Oo&&h!==Ja)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&h===Oo&&(n=Ho),n===void 0&&h===Ja&&(n=Qa),super(null,i,s,o,a,l,h,n,c),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=a!==void 0?a:ii,this.minFilter=l!==void 0?l:ii,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.compareFunction=t.compareFunction,this}toJSON(t){let e=super.toJSON(t);return this.compareFunction!==null&&(e.compareFunction=this.compareFunction),e}},O0=new oi,B0=new Jc(1,1);B0.compareFunction=I0;var k0=new Bc,z0=new Xf,V0=new Xc,i0=[],r0=[],s0=new Float32Array(16),o0=new Float32Array(9),a0=new Float32Array(4);function Yo(r,t,e){let n=r[0];if(n<=0||n>0)return r;let i=t*e,s=i0[i];if(s===void 0&&(s=new Float32Array(i),i0[i]=s),t!==0){n.toArray(s,0);for(let o=1,a=0;o!==t;++o)a+=e,r[o].toArray(s,a)}return s}function qe(r,t){if(r.length!==t.length)return!1;for(let e=0,n=r.length;e<n;e++)if(r[e]!==t[e])return!1;return!0}function Ze(r,t){for(let e=0,n=t.length;e<n;e++)r[e]=t[e]}function su(r,t){let e=r0[t];e===void 0&&(e=new Int32Array(t),r0[t]=e);for(let n=0;n!==t;++n)e[n]=r.allocateTextureUnit();return e}function r1(r,t){let e=this.cache;e[0]!==t&&(r.uniform1f(this.addr,t),e[0]=t)}function s1(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(r.uniform2f(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(qe(e,t))return;r.uniform2fv(this.addr,t),Ze(e,t)}}function o1(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(r.uniform3f(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else if(t.r!==void 0)(e[0]!==t.r||e[1]!==t.g||e[2]!==t.b)&&(r.uniform3f(this.addr,t.r,t.g,t.b),e[0]=t.r,e[1]=t.g,e[2]=t.b);else{if(qe(e,t))return;r.uniform3fv(this.addr,t),Ze(e,t)}}function a1(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(r.uniform4f(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(qe(e,t))return;r.uniform4fv(this.addr,t),Ze(e,t)}}function l1(r,t){let e=this.cache,n=t.elements;if(n===void 0){if(qe(e,t))return;r.uniformMatrix2fv(this.addr,!1,t),Ze(e,t)}else{if(qe(e,n))return;a0.set(n),r.uniformMatrix2fv(this.addr,!1,a0),Ze(e,n)}}function c1(r,t){let e=this.cache,n=t.elements;if(n===void 0){if(qe(e,t))return;r.uniformMatrix3fv(this.addr,!1,t),Ze(e,t)}else{if(qe(e,n))return;o0.set(n),r.uniformMatrix3fv(this.addr,!1,o0),Ze(e,n)}}function u1(r,t){let e=this.cache,n=t.elements;if(n===void 0){if(qe(e,t))return;r.uniformMatrix4fv(this.addr,!1,t),Ze(e,t)}else{if(qe(e,n))return;s0.set(n),r.uniformMatrix4fv(this.addr,!1,s0),Ze(e,n)}}function h1(r,t){let e=this.cache;e[0]!==t&&(r.uniform1i(this.addr,t),e[0]=t)}function f1(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(r.uniform2i(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(qe(e,t))return;r.uniform2iv(this.addr,t),Ze(e,t)}}function d1(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(r.uniform3i(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(qe(e,t))return;r.uniform3iv(this.addr,t),Ze(e,t)}}function p1(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(r.uniform4i(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(qe(e,t))return;r.uniform4iv(this.addr,t),Ze(e,t)}}function m1(r,t){let e=this.cache;e[0]!==t&&(r.uniform1ui(this.addr,t),e[0]=t)}function g1(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(r.uniform2ui(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(qe(e,t))return;r.uniform2uiv(this.addr,t),Ze(e,t)}}function _1(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(r.uniform3ui(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(qe(e,t))return;r.uniform3uiv(this.addr,t),Ze(e,t)}}function x1(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(r.uniform4ui(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(qe(e,t))return;r.uniform4uiv(this.addr,t),Ze(e,t)}}function y1(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i);let s=this.type===r.SAMPLER_2D_SHADOW?B0:O0;e.setTexture2D(t||s,i)}function v1(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTexture3D(t||z0,i)}function S1(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTextureCube(t||V0,i)}function M1(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTexture2DArray(t||k0,i)}function b1(r){switch(r){case 5126:return r1;case 35664:return s1;case 35665:return o1;case 35666:return a1;case 35674:return l1;case 35675:return c1;case 35676:return u1;case 5124:case 35670:return h1;case 35667:case 35671:return f1;case 35668:case 35672:return d1;case 35669:case 35673:return p1;case 5125:return m1;case 36294:return g1;case 36295:return _1;case 36296:return x1;case 35678:case 36198:case 36298:case 36306:case 35682:return y1;case 35679:case 36299:case 36307:return v1;case 35680:case 36300:case 36308:case 36293:return S1;case 36289:case 36303:case 36311:case 36292:return M1}}function w1(r,t){r.uniform1fv(this.addr,t)}function E1(r,t){let e=Yo(t,this.size,2);r.uniform2fv(this.addr,e)}function T1(r,t){let e=Yo(t,this.size,3);r.uniform3fv(this.addr,e)}function A1(r,t){let e=Yo(t,this.size,4);r.uniform4fv(this.addr,e)}function D1(r,t){let e=Yo(t,this.size,4);r.uniformMatrix2fv(this.addr,!1,e)}function C1(r,t){let e=Yo(t,this.size,9);r.uniformMatrix3fv(this.addr,!1,e)}function R1(r,t){let e=Yo(t,this.size,16);r.uniformMatrix4fv(this.addr,!1,e)}function P1(r,t){r.uniform1iv(this.addr,t)}function I1(r,t){r.uniform2iv(this.addr,t)}function L1(r,t){r.uniform3iv(this.addr,t)}function F1(r,t){r.uniform4iv(this.addr,t)}function N1(r,t){r.uniform1uiv(this.addr,t)}function U1(r,t){r.uniform2uiv(this.addr,t)}function O1(r,t){r.uniform3uiv(this.addr,t)}function B1(r,t){r.uniform4uiv(this.addr,t)}function k1(r,t,e){let n=this.cache,i=t.length,s=su(e,i);qe(n,s)||(r.uniform1iv(this.addr,s),Ze(n,s));for(let o=0;o!==i;++o)e.setTexture2D(t[o]||O0,s[o])}function z1(r,t,e){let n=this.cache,i=t.length,s=su(e,i);qe(n,s)||(r.uniform1iv(this.addr,s),Ze(n,s));for(let o=0;o!==i;++o)e.setTexture3D(t[o]||z0,s[o])}function V1(r,t,e){let n=this.cache,i=t.length,s=su(e,i);qe(n,s)||(r.uniform1iv(this.addr,s),Ze(n,s));for(let o=0;o!==i;++o)e.setTextureCube(t[o]||V0,s[o])}function H1(r,t,e){let n=this.cache,i=t.length,s=su(e,i);qe(n,s)||(r.uniform1iv(this.addr,s),Ze(n,s));for(let o=0;o!==i;++o)e.setTexture2DArray(t[o]||k0,s[o])}function G1(r){switch(r){case 5126:return w1;case 35664:return E1;case 35665:return T1;case 35666:return A1;case 35674:return D1;case 35675:return C1;case 35676:return R1;case 5124:case 35670:return P1;case 35667:case 35671:return I1;case 35668:case 35672:return L1;case 35669:case 35673:return F1;case 5125:return N1;case 36294:return U1;case 36295:return O1;case 36296:return B1;case 35678:case 36198:case 36298:case 36306:case 35682:return k1;case 35679:case 36299:case 36307:return z1;case 35680:case 36300:case 36308:case 36293:return V1;case 36289:case 36303:case 36311:case 36292:return H1}}var Zf=class{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.setValue=b1(e.type)}},Jf=class{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.size=e.size,this.setValue=G1(e.type)}},$f=class{constructor(t){this.id=t,this.seq=[],this.map={}}setValue(t,e,n){let i=this.seq;for(let s=0,o=i.length;s!==o;++s){let a=i[s];a.setValue(t,e[a.id],n)}}},Ff=/(\w+)(\])?(\[|\.)?/g;function l0(r,t){r.seq.push(t),r.map[t.id]=t}function W1(r,t,e){let n=r.name,i=n.length;for(Ff.lastIndex=0;;){let s=Ff.exec(n),o=Ff.lastIndex,a=s[1],l=s[2]==="]",c=s[3];if(l&&(a=a|0),c===void 0||c==="["&&o+2===i){l0(e,c===void 0?new Zf(a,r,t):new Jf(a,r,t));break}else{let d=e.map[a];d===void 0&&(d=new $f(a),l0(e,d)),e=d}}}var ko=class{constructor(t,e){this.seq=[],this.map={};let n=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){let s=t.getActiveUniform(e,i),o=t.getUniformLocation(e,s.name);W1(s,o,this)}}setValue(t,e,n,i){let s=this.map[e];s!==void 0&&s.setValue(t,n,i)}setOptional(t,e,n){let i=e[n];i!==void 0&&this.setValue(t,n,i)}static upload(t,e,n,i){for(let s=0,o=e.length;s!==o;++s){let a=e[s],l=n[a.id];l.needsUpdate!==!1&&a.setValue(t,l.value,i)}}static seqWithValue(t,e){let n=[];for(let i=0,s=t.length;i!==s;++i){let o=t[i];o.id in e&&n.push(o)}return n}};function c0(r,t,e){let n=r.createShader(t);return r.shaderSource(n,e),r.compileShader(n),n}var X1=37297,Y1=0;function q1(r,t){let e=r.split(`
|
|
3720
|
+
`}function Kw(r){let t=new WeakMap,e=null;function n(a){if(a&&a.isTexture){let l=a.mapping,c=l===Bf||l===kf,h=l===zo||l===Vo;if(c||h){let f=t.get(a),d=f!==void 0?f.texture.pmremVersion:0;if(a.isRenderTargetTexture&&a.pmremVersion!==d)return e===null&&(e=new Zc(r)),f=c?e.fromEquirectangular(a,f):e.fromCubemap(a,f),f.texture.pmremVersion=a.pmremVersion,t.set(a,f),f.texture;if(f!==void 0)return f.texture;{let u=a.image;return c&&u&&u.height>0||h&&u&&i(u)?(e===null&&(e=new Zc(r)),f=c?e.fromEquirectangular(a):e.fromCubemap(a),f.texture.pmremVersion=a.pmremVersion,t.set(a,f),a.addEventListener("dispose",s),f.texture):null}}}return a}function i(a){let l=0,c=6;for(let h=0;h<c;h++)a[h]!==void 0&&l++;return l===c}function s(a){let l=a.target;l.removeEventListener("dispose",s);let c=t.get(l);c!==void 0&&(t.delete(l),c.dispose())}function o(){t=new WeakMap,e!==null&&(e.dispose(),e=null)}return{get:n,dispose:o}}function jw(r){let t={};function e(n){if(t[n]!==void 0)return t[n];let i;switch(n){case"WEBGL_depth_texture":i=r.getExtension("WEBGL_depth_texture")||r.getExtension("MOZ_WEBGL_depth_texture")||r.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("MOZ_EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=r.getExtension("WEBGL_compressed_texture_s3tc")||r.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=r.getExtension("WEBGL_compressed_texture_pvrtc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=r.getExtension(n)}return t[n]=i,i}return{has:function(n){return e(n)!==null},init:function(){e("EXT_color_buffer_float"),e("WEBGL_clip_cull_distance"),e("OES_texture_float_linear"),e("EXT_color_buffer_half_float"),e("WEBGL_multisampled_render_to_texture"),e("WEBGL_render_shared_exponent")},get:function(n){let i=e(n);return i===null&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),i}}}function Qw(r,t,e,n){let i={},s=new WeakMap;function o(f){let d=f.target;d.index!==null&&t.remove(d.index);for(let _ in d.attributes)t.remove(d.attributes[_]);for(let _ in d.morphAttributes){let m=d.morphAttributes[_];for(let p=0,g=m.length;p<g;p++)t.remove(m[p])}d.removeEventListener("dispose",o),delete i[d.id];let u=s.get(d);u&&(t.remove(u),s.delete(d)),n.releaseStatesOfGeometry(d),d.isInstancedBufferGeometry===!0&&delete d._maxInstanceCount,e.memory.geometries--}function a(f,d){return i[d.id]===!0||(d.addEventListener("dispose",o),i[d.id]=!0,e.memory.geometries++),d}function l(f){let d=f.attributes;for(let _ in d)t.update(d[_],r.ARRAY_BUFFER);let u=f.morphAttributes;for(let _ in u){let m=u[_];for(let p=0,g=m.length;p<g;p++)t.update(m[p],r.ARRAY_BUFFER)}}function c(f){let d=[],u=f.index,_=f.attributes.position,m=0;if(u!==null){let b=u.array;m=u.version;for(let v=0,S=b.length;v<S;v+=3){let D=b[v+0],T=b[v+1],w=b[v+2];d.push(D,T,T,w,w,D)}}else if(_!==void 0){let b=_.array;m=_.version;for(let v=0,S=b.length/3-1;v<S;v+=3){let D=v+0,T=v+1,w=v+2;d.push(D,T,T,w,w,D)}}else return;let p=new(L0(d)?Gc:Hc)(d,1);p.version=m;let g=s.get(f);g&&t.remove(g),s.set(f,p)}function h(f){let d=s.get(f);if(d){let u=f.index;u!==null&&d.version<u.version&&c(f)}else c(f);return s.get(f)}return{get:a,update:l,getWireframeAttribute:h}}function t1(r,t,e){let n;function i(d){n=d}let s,o;function a(d){s=d.type,o=d.bytesPerElement}function l(d,u){r.drawElements(n,u,s,d*o),e.update(u,n,1)}function c(d,u,_){_!==0&&(r.drawElementsInstanced(n,u,s,d*o,_),e.update(u,n,_))}function h(d,u,_){if(_===0)return;let m=t.get("WEBGL_multi_draw");if(m===null)for(let p=0;p<_;p++)this.render(d[p]/o,u[p]);else{m.multiDrawElementsWEBGL(n,u,0,s,d,0,_);let p=0;for(let g=0;g<_;g++)p+=u[g];e.update(p,n,1)}}function f(d,u,_,m){if(_===0)return;let p=t.get("WEBGL_multi_draw");if(p===null)for(let g=0;g<d.length;g++)c(d[g]/o,u[g],m[g]);else{p.multiDrawElementsInstancedWEBGL(n,u,0,s,d,0,m,0,_);let g=0;for(let b=0;b<_;b++)g+=u[b];for(let b=0;b<m.length;b++)e.update(g,n,m[b])}}this.setMode=i,this.setIndex=a,this.render=l,this.renderInstances=c,this.renderMultiDraw=h,this.renderMultiDrawInstances=f}function e1(r){let t={geometries:0,textures:0},e={frame:0,calls:0,triangles:0,points:0,lines:0};function n(s,o,a){switch(e.calls++,o){case r.TRIANGLES:e.triangles+=a*(s/3);break;case r.LINES:e.lines+=a*(s/2);break;case r.LINE_STRIP:e.lines+=a*(s-1);break;case r.LINE_LOOP:e.lines+=a*s;break;case r.POINTS:e.points+=a*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function i(){e.calls=0,e.triangles=0,e.points=0,e.lines=0}return{memory:t,render:e,programs:null,autoReset:!0,reset:i,update:n}}function n1(r,t,e){let n=new WeakMap,i=new Qe;function s(o,a,l){let c=o.morphTargetInfluences,h=a.morphAttributes.position||a.morphAttributes.normal||a.morphAttributes.color,f=h!==void 0?h.length:0,d=n.get(a);if(d===void 0||d.count!==f){let M=function(){w.dispose(),n.delete(a),a.removeEventListener("dispose",M)};d!==void 0&&d.texture.dispose();let u=a.morphAttributes.position!==void 0,_=a.morphAttributes.normal!==void 0,m=a.morphAttributes.color!==void 0,p=a.morphAttributes.position||[],g=a.morphAttributes.normal||[],b=a.morphAttributes.color||[],v=0;u===!0&&(v=1),_===!0&&(v=2),m===!0&&(v=3);let S=a.attributes.position.count*v,D=1;S>t.maxTextureSize&&(D=Math.ceil(S/t.maxTextureSize),S=t.maxTextureSize);let T=new Float32Array(S*D*4*f),w=new Bc(T,S,D,f);w.type=Or,w.needsUpdate=!0;let P=v*4;for(let y=0;y<f;y++){let I=p[y],N=g[y],C=b[y],V=S*D*4*y;for(let $=0;$<I.count;$++){let W=$*P;u===!0&&(i.fromBufferAttribute(I,$),T[V+W+0]=i.x,T[V+W+1]=i.y,T[V+W+2]=i.z,T[V+W+3]=0),_===!0&&(i.fromBufferAttribute(N,$),T[V+W+4]=i.x,T[V+W+5]=i.y,T[V+W+6]=i.z,T[V+W+7]=0),m===!0&&(i.fromBufferAttribute(C,$),T[V+W+8]=i.x,T[V+W+9]=i.y,T[V+W+10]=i.z,T[V+W+11]=C.itemSize===4?i.w:1)}}d={count:f,texture:w,size:new _e(S,D)},n.set(a,d),a.addEventListener("dispose",M)}if(o.isInstancedMesh===!0&&o.morphTexture!==null)l.getUniforms().setValue(r,"morphTexture",o.morphTexture,e);else{let u=0;for(let m=0;m<c.length;m++)u+=c[m];let _=a.morphTargetsRelative?1:1-u;l.getUniforms().setValue(r,"morphTargetBaseInfluence",_),l.getUniforms().setValue(r,"morphTargetInfluences",c)}l.getUniforms().setValue(r,"morphTargetsTexture",d.texture,e),l.getUniforms().setValue(r,"morphTargetsTextureSize",d.size)}return{update:s}}function i1(r,t,e,n){let i=new WeakMap;function s(l){let c=n.render.frame,h=l.geometry,f=t.get(l,h);if(i.get(f)!==c&&(t.update(f),i.set(f,c)),l.isInstancedMesh&&(l.hasEventListener("dispose",a)===!1&&l.addEventListener("dispose",a),i.get(l)!==c&&(e.update(l.instanceMatrix,r.ARRAY_BUFFER),l.instanceColor!==null&&e.update(l.instanceColor,r.ARRAY_BUFFER),i.set(l,c))),l.isSkinnedMesh){let d=l.skeleton;i.get(d)!==c&&(d.update(),i.set(d,c))}return f}function o(){i=new WeakMap}function a(l){let c=l.target;c.removeEventListener("dispose",a),e.remove(c.instanceMatrix),c.instanceColor!==null&&e.remove(c.instanceColor)}return{update:s,dispose:o}}var Jc=class extends oi{constructor(t,e,n,i,s,o,a,l,c,h){if(h=h!==void 0?h:Oo,h!==Oo&&h!==Ja)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&h===Oo&&(n=Ho),n===void 0&&h===Ja&&(n=Qa),super(null,i,s,o,a,l,h,n,c),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=a!==void 0?a:ii,this.minFilter=l!==void 0?l:ii,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.compareFunction=t.compareFunction,this}toJSON(t){let e=super.toJSON(t);return this.compareFunction!==null&&(e.compareFunction=this.compareFunction),e}},O0=new oi,B0=new Jc(1,1);B0.compareFunction=I0;var k0=new Bc,z0=new Xf,V0=new Xc,i0=[],r0=[],s0=new Float32Array(16),o0=new Float32Array(9),a0=new Float32Array(4);function Yo(r,t,e){let n=r[0];if(n<=0||n>0)return r;let i=t*e,s=i0[i];if(s===void 0&&(s=new Float32Array(i),i0[i]=s),t!==0){n.toArray(s,0);for(let o=1,a=0;o!==t;++o)a+=e,r[o].toArray(s,a)}return s}function qe(r,t){if(r.length!==t.length)return!1;for(let e=0,n=r.length;e<n;e++)if(r[e]!==t[e])return!1;return!0}function Ze(r,t){for(let e=0,n=t.length;e<n;e++)r[e]=t[e]}function su(r,t){let e=r0[t];e===void 0&&(e=new Int32Array(t),r0[t]=e);for(let n=0;n!==t;++n)e[n]=r.allocateTextureUnit();return e}function r1(r,t){let e=this.cache;e[0]!==t&&(r.uniform1f(this.addr,t),e[0]=t)}function s1(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(r.uniform2f(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(qe(e,t))return;r.uniform2fv(this.addr,t),Ze(e,t)}}function o1(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(r.uniform3f(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else if(t.r!==void 0)(e[0]!==t.r||e[1]!==t.g||e[2]!==t.b)&&(r.uniform3f(this.addr,t.r,t.g,t.b),e[0]=t.r,e[1]=t.g,e[2]=t.b);else{if(qe(e,t))return;r.uniform3fv(this.addr,t),Ze(e,t)}}function a1(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(r.uniform4f(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(qe(e,t))return;r.uniform4fv(this.addr,t),Ze(e,t)}}function l1(r,t){let e=this.cache,n=t.elements;if(n===void 0){if(qe(e,t))return;r.uniformMatrix2fv(this.addr,!1,t),Ze(e,t)}else{if(qe(e,n))return;a0.set(n),r.uniformMatrix2fv(this.addr,!1,a0),Ze(e,n)}}function c1(r,t){let e=this.cache,n=t.elements;if(n===void 0){if(qe(e,t))return;r.uniformMatrix3fv(this.addr,!1,t),Ze(e,t)}else{if(qe(e,n))return;o0.set(n),r.uniformMatrix3fv(this.addr,!1,o0),Ze(e,n)}}function u1(r,t){let e=this.cache,n=t.elements;if(n===void 0){if(qe(e,t))return;r.uniformMatrix4fv(this.addr,!1,t),Ze(e,t)}else{if(qe(e,n))return;s0.set(n),r.uniformMatrix4fv(this.addr,!1,s0),Ze(e,n)}}function h1(r,t){let e=this.cache;e[0]!==t&&(r.uniform1i(this.addr,t),e[0]=t)}function f1(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(r.uniform2i(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(qe(e,t))return;r.uniform2iv(this.addr,t),Ze(e,t)}}function d1(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(r.uniform3i(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(qe(e,t))return;r.uniform3iv(this.addr,t),Ze(e,t)}}function p1(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(r.uniform4i(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(qe(e,t))return;r.uniform4iv(this.addr,t),Ze(e,t)}}function m1(r,t){let e=this.cache;e[0]!==t&&(r.uniform1ui(this.addr,t),e[0]=t)}function g1(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y)&&(r.uniform2ui(this.addr,t.x,t.y),e[0]=t.x,e[1]=t.y);else{if(qe(e,t))return;r.uniform2uiv(this.addr,t),Ze(e,t)}}function _1(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z)&&(r.uniform3ui(this.addr,t.x,t.y,t.z),e[0]=t.x,e[1]=t.y,e[2]=t.z);else{if(qe(e,t))return;r.uniform3uiv(this.addr,t),Ze(e,t)}}function x1(r,t){let e=this.cache;if(t.x!==void 0)(e[0]!==t.x||e[1]!==t.y||e[2]!==t.z||e[3]!==t.w)&&(r.uniform4ui(this.addr,t.x,t.y,t.z,t.w),e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.w);else{if(qe(e,t))return;r.uniform4uiv(this.addr,t),Ze(e,t)}}function y1(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i);let s=this.type===r.SAMPLER_2D_SHADOW?B0:O0;e.setTexture2D(t||s,i)}function v1(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTexture3D(t||z0,i)}function S1(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTextureCube(t||V0,i)}function M1(r,t,e){let n=this.cache,i=e.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),e.setTexture2DArray(t||k0,i)}function b1(r){switch(r){case 5126:return r1;case 35664:return s1;case 35665:return o1;case 35666:return a1;case 35674:return l1;case 35675:return c1;case 35676:return u1;case 5124:case 35670:return h1;case 35667:case 35671:return f1;case 35668:case 35672:return d1;case 35669:case 35673:return p1;case 5125:return m1;case 36294:return g1;case 36295:return _1;case 36296:return x1;case 35678:case 36198:case 36298:case 36306:case 35682:return y1;case 35679:case 36299:case 36307:return v1;case 35680:case 36300:case 36308:case 36293:return S1;case 36289:case 36303:case 36311:case 36292:return M1}}function w1(r,t){r.uniform1fv(this.addr,t)}function E1(r,t){let e=Yo(t,this.size,2);r.uniform2fv(this.addr,e)}function T1(r,t){let e=Yo(t,this.size,3);r.uniform3fv(this.addr,e)}function A1(r,t){let e=Yo(t,this.size,4);r.uniform4fv(this.addr,e)}function D1(r,t){let e=Yo(t,this.size,4);r.uniformMatrix2fv(this.addr,!1,e)}function C1(r,t){let e=Yo(t,this.size,9);r.uniformMatrix3fv(this.addr,!1,e)}function R1(r,t){let e=Yo(t,this.size,16);r.uniformMatrix4fv(this.addr,!1,e)}function P1(r,t){r.uniform1iv(this.addr,t)}function I1(r,t){r.uniform2iv(this.addr,t)}function L1(r,t){r.uniform3iv(this.addr,t)}function F1(r,t){r.uniform4iv(this.addr,t)}function N1(r,t){r.uniform1uiv(this.addr,t)}function U1(r,t){r.uniform2uiv(this.addr,t)}function O1(r,t){r.uniform3uiv(this.addr,t)}function B1(r,t){r.uniform4uiv(this.addr,t)}function k1(r,t,e){let n=this.cache,i=t.length,s=su(e,i);qe(n,s)||(r.uniform1iv(this.addr,s),Ze(n,s));for(let o=0;o!==i;++o)e.setTexture2D(t[o]||O0,s[o])}function z1(r,t,e){let n=this.cache,i=t.length,s=su(e,i);qe(n,s)||(r.uniform1iv(this.addr,s),Ze(n,s));for(let o=0;o!==i;++o)e.setTexture3D(t[o]||z0,s[o])}function V1(r,t,e){let n=this.cache,i=t.length,s=su(e,i);qe(n,s)||(r.uniform1iv(this.addr,s),Ze(n,s));for(let o=0;o!==i;++o)e.setTextureCube(t[o]||V0,s[o])}function H1(r,t,e){let n=this.cache,i=t.length,s=su(e,i);qe(n,s)||(r.uniform1iv(this.addr,s),Ze(n,s));for(let o=0;o!==i;++o)e.setTexture2DArray(t[o]||k0,s[o])}function G1(r){switch(r){case 5126:return w1;case 35664:return E1;case 35665:return T1;case 35666:return A1;case 35674:return D1;case 35675:return C1;case 35676:return R1;case 5124:case 35670:return P1;case 35667:case 35671:return I1;case 35668:case 35672:return L1;case 35669:case 35673:return F1;case 5125:return N1;case 36294:return U1;case 36295:return O1;case 36296:return B1;case 35678:case 36198:case 36298:case 36306:case 35682:return k1;case 35679:case 36299:case 36307:return z1;case 35680:case 36300:case 36308:case 36293:return V1;case 36289:case 36303:case 36311:case 36292:return H1}}var Zf=class{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.setValue=b1(e.type)}},Jf=class{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.size=e.size,this.setValue=G1(e.type)}},$f=class{constructor(t){this.id=t,this.seq=[],this.map={}}setValue(t,e,n){let i=this.seq;for(let s=0,o=i.length;s!==o;++s){let a=i[s];a.setValue(t,e[a.id],n)}}},Ff=/(\w+)(\])?(\[|\.)?/g;function l0(r,t){r.seq.push(t),r.map[t.id]=t}function W1(r,t,e){let n=r.name,i=n.length;for(Ff.lastIndex=0;;){let s=Ff.exec(n),o=Ff.lastIndex,a=s[1],l=s[2]==="]",c=s[3];if(l&&(a=a|0),c===void 0||c==="["&&o+2===i){l0(e,c===void 0?new Zf(a,r,t):new Jf(a,r,t));break}else{let f=e.map[a];f===void 0&&(f=new $f(a),l0(e,f)),e=f}}}var ko=class{constructor(t,e){this.seq=[],this.map={};let n=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){let s=t.getActiveUniform(e,i),o=t.getUniformLocation(e,s.name);W1(s,o,this)}}setValue(t,e,n,i){let s=this.map[e];s!==void 0&&s.setValue(t,n,i)}setOptional(t,e,n){let i=e[n];i!==void 0&&this.setValue(t,n,i)}static upload(t,e,n,i){for(let s=0,o=e.length;s!==o;++s){let a=e[s],l=n[a.id];l.needsUpdate!==!1&&a.setValue(t,l.value,i)}}static seqWithValue(t,e){let n=[];for(let i=0,s=t.length;i!==s;++i){let o=t[i];o.id in e&&n.push(o)}return n}};function c0(r,t,e){let n=r.createShader(t);return r.shaderSource(n,e),r.compileShader(n),n}var X1=37297,Y1=0;function q1(r,t){let e=r.split(`
|
|
3721
3721
|
`),n=[],i=Math.max(t-6,0),s=Math.min(t+6,e.length);for(let o=i;o<s;o++){let a=o+1;n.push(`${a===t?">":" "} ${a}: ${e[o]}`)}return n.join(`
|
|
3722
3722
|
`)}function Z1(r){let t=Se.getPrimaries(Se.workingColorSpace),e=Se.getPrimaries(r),n;switch(t===e?n="":t===Fc&&e===Lc?n="LinearDisplayP3ToLinearSRGB":t===Lc&&e===Fc&&(n="LinearSRGBToLinearDisplayP3"),r){case Yr:case ru:return[n,"LinearTransferOETF"];case ni:case Sd:return[n,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",r),[n,"LinearTransferOETF"]}}function u0(r,t,e){let n=r.getShaderParameter(t,r.COMPILE_STATUS),i=r.getShaderInfoLog(t).trim();if(n&&i==="")return"";let s=/ERROR: 0:(\d+)/.exec(i);if(s){let o=parseInt(s[1]);return e.toUpperCase()+`
|
|
3723
3723
|
|
|
@@ -3745,28 +3745,28 @@ void main() {
|
|
|
3745
3745
|
`;return r.precision==="highp"?t+=`
|
|
3746
3746
|
#define HIGH_PRECISION`:r.precision==="mediump"?t+=`
|
|
3747
3747
|
#define MEDIUM_PRECISION`:r.precision==="lowp"&&(t+=`
|
|
3748
|
-
#define LOW_PRECISION`),t}function sE(r){let t="SHADOWMAP_TYPE_BASIC";return r.shadowMapType===M0?t="SHADOWMAP_TYPE_PCF":r.shadowMapType===vd?t="SHADOWMAP_TYPE_PCF_SOFT":r.shadowMapType===rr&&(t="SHADOWMAP_TYPE_VSM"),t}function oE(r){let t="ENVMAP_TYPE_CUBE";if(r.envMap)switch(r.envMapMode){case zo:case Vo:t="ENVMAP_TYPE_CUBE";break;case nu:t="ENVMAP_TYPE_CUBE_UV";break}return t}function aE(r){let t="ENVMAP_MODE_REFLECTION";if(r.envMap)switch(r.envMapMode){case Vo:t="ENVMAP_MODE_REFRACTION";break}return t}function lE(r){let t="ENVMAP_BLENDING_NONE";if(r.envMap)switch(r.combine){case b0:t="ENVMAP_BLENDING_MULTIPLY";break;case cS:t="ENVMAP_BLENDING_MIX";break;case uS:t="ENVMAP_BLENDING_ADD";break}return t}function cE(r){let t=r.envMapCubeUVHeight;if(t===null)return null;let e=Math.log2(t)-2,n=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,e),7*16)),texelHeight:n,maxMip:e}}function uE(r,t,e,n){let i=r.getContext(),s=e.defines,o=e.vertexShader,a=e.fragmentShader,l=sE(e),c=oE(e),h=aE(e),
|
|
3749
|
-
`:"";e.isRawShaderMaterial?(
|
|
3750
|
-
`),
|
|
3748
|
+
#define LOW_PRECISION`),t}function sE(r){let t="SHADOWMAP_TYPE_BASIC";return r.shadowMapType===M0?t="SHADOWMAP_TYPE_PCF":r.shadowMapType===vd?t="SHADOWMAP_TYPE_PCF_SOFT":r.shadowMapType===rr&&(t="SHADOWMAP_TYPE_VSM"),t}function oE(r){let t="ENVMAP_TYPE_CUBE";if(r.envMap)switch(r.envMapMode){case zo:case Vo:t="ENVMAP_TYPE_CUBE";break;case nu:t="ENVMAP_TYPE_CUBE_UV";break}return t}function aE(r){let t="ENVMAP_MODE_REFLECTION";if(r.envMap)switch(r.envMapMode){case Vo:t="ENVMAP_MODE_REFRACTION";break}return t}function lE(r){let t="ENVMAP_BLENDING_NONE";if(r.envMap)switch(r.combine){case b0:t="ENVMAP_BLENDING_MULTIPLY";break;case cS:t="ENVMAP_BLENDING_MIX";break;case uS:t="ENVMAP_BLENDING_ADD";break}return t}function cE(r){let t=r.envMapCubeUVHeight;if(t===null)return null;let e=Math.log2(t)-2,n=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,e),7*16)),texelHeight:n,maxMip:e}}function uE(r,t,e,n){let i=r.getContext(),s=e.defines,o=e.vertexShader,a=e.fragmentShader,l=sE(e),c=oE(e),h=aE(e),f=lE(e),d=cE(e),u=K1(e),_=j1(s),m=i.createProgram(),p,g,b=e.glslVersion?"#version "+e.glslVersion+`
|
|
3749
|
+
`:"";e.isRawShaderMaterial?(p=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,_].filter(qa).join(`
|
|
3750
|
+
`),p.length>0&&(p+=`
|
|
3751
3751
|
`),g=["#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,_].filter(qa).join(`
|
|
3752
3752
|
`),g.length>0&&(g+=`
|
|
3753
|
-
`)):(
|
|
3753
|
+
`)):(p=[p0(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,_,e.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",e.batching?"#define USE_BATCHING":"",e.instancing?"#define USE_INSTANCING":"",e.instancingColor?"#define USE_INSTANCING_COLOR":"",e.instancingMorph?"#define USE_INSTANCING_MORPH":"",e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+h:"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.displacementMap?"#define USE_DISPLACEMENTMAP":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.mapUv?"#define MAP_UV "+e.mapUv:"",e.alphaMapUv?"#define ALPHAMAP_UV "+e.alphaMapUv:"",e.lightMapUv?"#define LIGHTMAP_UV "+e.lightMapUv:"",e.aoMapUv?"#define AOMAP_UV "+e.aoMapUv:"",e.emissiveMapUv?"#define EMISSIVEMAP_UV "+e.emissiveMapUv:"",e.bumpMapUv?"#define BUMPMAP_UV "+e.bumpMapUv:"",e.normalMapUv?"#define NORMALMAP_UV "+e.normalMapUv:"",e.displacementMapUv?"#define DISPLACEMENTMAP_UV "+e.displacementMapUv:"",e.metalnessMapUv?"#define METALNESSMAP_UV "+e.metalnessMapUv:"",e.roughnessMapUv?"#define ROUGHNESSMAP_UV "+e.roughnessMapUv:"",e.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+e.anisotropyMapUv:"",e.clearcoatMapUv?"#define CLEARCOATMAP_UV "+e.clearcoatMapUv:"",e.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+e.clearcoatNormalMapUv:"",e.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+e.clearcoatRoughnessMapUv:"",e.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+e.iridescenceMapUv:"",e.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+e.iridescenceThicknessMapUv:"",e.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+e.sheenColorMapUv:"",e.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+e.sheenRoughnessMapUv:"",e.specularMapUv?"#define SPECULARMAP_UV "+e.specularMapUv:"",e.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+e.specularColorMapUv:"",e.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+e.specularIntensityMapUv:"",e.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+e.transmissionMapUv:"",e.thicknessMapUv?"#define THICKNESSMAP_UV "+e.thicknessMapUv:"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.flatShading?"#define FLAT_SHADED":"",e.skinning?"#define USE_SKINNING":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals&&e.flatShading===!1?"#define USE_MORPHNORMALS":"",e.morphColors?"#define USE_MORPHCOLORS":"",e.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE":"",e.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+e.morphTextureStride:"",e.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+e.morphTargetsCount:"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.sizeAttenuation?"#define USE_SIZEATTENUATION":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.useLegacyLights?"#define LEGACY_LIGHTS":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",`
|
|
3754
3754
|
`].filter(qa).join(`
|
|
3755
|
-
`),g=[p0(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,_,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",e.map?"#define USE_MAP":"",e.matcap?"#define USE_MATCAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+c:"",e.envMap?"#define "+h:"",e.envMap?"#define "+
|
|
3755
|
+
`),g=[p0(e),"#define SHADER_TYPE "+e.shaderType,"#define SHADER_NAME "+e.shaderName,_,e.useFog&&e.fog?"#define USE_FOG":"",e.useFog&&e.fogExp2?"#define FOG_EXP2":"",e.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",e.map?"#define USE_MAP":"",e.matcap?"#define USE_MATCAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+c:"",e.envMap?"#define "+h:"",e.envMap?"#define "+f:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",e.lightMap?"#define USE_LIGHTMAP":"",e.aoMap?"#define USE_AOMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",e.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",e.emissiveMap?"#define USE_EMISSIVEMAP":"",e.anisotropy?"#define USE_ANISOTROPY":"",e.anisotropyMap?"#define USE_ANISOTROPYMAP":"",e.clearcoat?"#define USE_CLEARCOAT":"",e.clearcoatMap?"#define USE_CLEARCOATMAP":"",e.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",e.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",e.dispersion?"#define USE_DISPERSION":"",e.iridescence?"#define USE_IRIDESCENCE":"",e.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",e.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",e.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",e.roughnessMap?"#define USE_ROUGHNESSMAP":"",e.metalnessMap?"#define USE_METALNESSMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.alphaTest?"#define USE_ALPHATEST":"",e.alphaHash?"#define USE_ALPHAHASH":"",e.sheen?"#define USE_SHEEN":"",e.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",e.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",e.transmission?"#define USE_TRANSMISSION":"",e.transmissionMap?"#define USE_TRANSMISSIONMAP":"",e.thicknessMap?"#define USE_THICKNESSMAP":"",e.vertexTangents&&e.flatShading===!1?"#define USE_TANGENT":"",e.vertexColors||e.instancingColor?"#define USE_COLOR":"",e.vertexAlphas?"#define USE_COLOR_ALPHA":"",e.vertexUv1s?"#define USE_UV1":"",e.vertexUv2s?"#define USE_UV2":"",e.vertexUv3s?"#define USE_UV3":"",e.pointsUvs?"#define USE_POINTS_UV":"",e.gradientMap?"#define USE_GRADIENTMAP":"",e.flatShading?"#define FLAT_SHADED":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+l:"",e.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",e.numLightProbes>0?"#define USE_LIGHT_PROBES":"",e.useLegacyLights?"#define LEGACY_LIGHTS":"",e.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",e.toneMapping!==Vr?"#define TONE_MAPPING":"",e.toneMapping!==Vr?se.tonemapping_pars_fragment:"",e.toneMapping!==Vr?$1("toneMapping",e.toneMapping):"",e.dithering?"#define DITHERING":"",e.opaque?"#define OPAQUE":"",se.colorspace_pars_fragment,J1("linearToOutputTexel",e.outputColorSpace),e.useDepthPacking?"#define DEPTH_PACKING "+e.depthPacking:"",`
|
|
3756
3756
|
`].filter(qa).join(`
|
|
3757
3757
|
`)),o=Kf(o),o=h0(o,e),o=f0(o,e),a=Kf(a),a=h0(a,e),a=f0(a,e),o=d0(o),a=d0(a),e.isRawShaderMaterial!==!0&&(b=`#version 300 es
|
|
3758
|
-
`,
|
|
3758
|
+
`,p=[u,"#define attribute in","#define varying out","#define texture2D texture"].join(`
|
|
3759
3759
|
`)+`
|
|
3760
|
-
`+
|
|
3760
|
+
`+p,g=["#define varying in",e.glslVersion===P_?"":"layout(location = 0) out highp vec4 pc_fragColor;",e.glslVersion===P_?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(`
|
|
3761
3761
|
`)+`
|
|
3762
|
-
`+g);let v=b+
|
|
3762
|
+
`+g);let v=b+p+o,S=b+g+a,D=c0(i,i.VERTEX_SHADER,v),T=c0(i,i.FRAGMENT_SHADER,S);i.attachShader(m,D),i.attachShader(m,T),e.index0AttributeName!==void 0?i.bindAttribLocation(m,0,e.index0AttributeName):e.morphTargets===!0&&i.bindAttribLocation(m,0,"position"),i.linkProgram(m);function w(I){if(r.debug.checkShaderErrors){let N=i.getProgramInfoLog(m).trim(),C=i.getShaderInfoLog(D).trim(),V=i.getShaderInfoLog(T).trim(),$=!0,W=!0;if(i.getProgramParameter(m,i.LINK_STATUS)===!1)if($=!1,typeof r.debug.onShaderError=="function")r.debug.onShaderError(i,m,D,T);else{let Z=u0(i,D,"vertex"),z=u0(i,T,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(m,i.VALIDATE_STATUS)+`
|
|
3763
3763
|
|
|
3764
3764
|
Material Name: `+I.name+`
|
|
3765
3765
|
Material Type: `+I.type+`
|
|
3766
3766
|
|
|
3767
3767
|
Program Info Log: `+N+`
|
|
3768
3768
|
`+Z+`
|
|
3769
|
-
`+z)}else N!==""?console.warn("THREE.WebGLProgram: Program Info Log:",N):(C===""||V==="")&&(W=!1);W&&(I.diagnostics={runnable:$,programLog:N,vertexShader:{log:C,prefix:m},fragmentShader:{log:V,prefix:g}})}i.deleteShader(D),i.deleteShader(T),P=new ko(i,p),M=Q1(i,p)}let P;this.getUniforms=function(){return P===void 0&&w(this),P};let M;this.getAttributes=function(){return M===void 0&&w(this),M};let y=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return y===!1&&(y=i.getProgramParameter(p,X1)),y},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(p),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=Y1++,this.cacheKey=t,this.usedTimes=1,this.program=p,this.vertexShader=D,this.fragmentShader=T,this}var hE=0,jf=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){let e=t.vertexShader,n=t.fragmentShader,i=this._getShaderStage(e),s=this._getShaderStage(n),o=this._getShaderCacheForMaterial(t);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(t){let e=this.materialCache.get(t);for(let n of e)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){let e=this.materialCache,n=e.get(t);return n===void 0&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){let e=this.shaderCache,n=e.get(t);return n===void 0&&(n=new Qf(t),e.set(t,n)),n}},Qf=class{constructor(t){this.id=hE++,this.code=t,this.usedTimes=0}};function fE(r,t,e,n,i,s,o){let a=new zc,l=new jf,c=new Set,h=[],d=i.logarithmicDepthBuffer,f=i.vertexTextures,u=i.precision,_={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function p(M){return c.add(M),M===0?"uv":`uv${M}`}function m(M,y,I,N,C){let V=N.fog,$=C.geometry,W=M.isMeshStandardMaterial?N.environment:null,Z=(M.isMeshStandardMaterial?e:t).get(M.envMap||W),z=Z&&Z.mapping===nu?Z.image.height:null,U=_[M.type];M.precision!==null&&(u=i.getMaxPrecision(M.precision),u!==M.precision&&console.warn("THREE.WebGLProgram.getParameters:",M.precision,"not supported, using",u,"instead."));let R=$.morphAttributes.position||$.morphAttributes.normal||$.morphAttributes.color,at=R!==void 0?R.length:0,_t=0;$.morphAttributes.position!==void 0&&(_t=1),$.morphAttributes.normal!==void 0&&(_t=2),$.morphAttributes.color!==void 0&&(_t=3);let Ut,X,ot,xt;if(U){let rt=Ni[U];Ut=rt.vertexShader,X=rt.fragmentShader}else Ut=M.vertexShader,X=M.fragmentShader,l.update(M),ot=l.getVertexShaderID(M),xt=l.getFragmentShaderID(M);let ct=r.getRenderTarget(),Rt=C.isInstancedMesh===!0,kt=C.isBatchedMesh===!0,q=!!M.map,$t=!!M.matcap,It=!!Z,Ft=!!M.aoMap,bt=!!M.lightMap,Et=!!M.bumpMap,Ht=!!M.normalMap,G=!!M.displacementMap,jt=!!M.emissiveMap,A=!!M.metalnessMap,x=!!M.roughnessMap,F=M.anisotropy>0,Y=M.clearcoat>0,tt=M.dispersion>0,it=M.iridescence>0,vt=M.sheen>0,pt=M.transmission>0,lt=F&&!!M.anisotropyMap,Lt=Y&&!!M.clearcoatMap,ht=Y&&!!M.clearcoatNormalMap,yt=Y&&!!M.clearcoatRoughnessMap,qt=it&&!!M.iridescenceMap,ut=it&&!!M.iridescenceThicknessMap,Tt=vt&&!!M.sheenColorMap,Wt=vt&&!!M.sheenRoughnessMap,Zt=!!M.specularMap,ue=!!M.specularColorMap,Jt=!!M.specularIntensityMap,k=pt&&!!M.transmissionMap,Q=pt&&!!M.thicknessMap,st=!!M.gradientMap,mt=!!M.alphaMap,gt=M.alphaTest>0,Bt=!!M.alphaHash,ne=!!M.extensions,Mt=Vr;M.toneMapped&&(ct===null||ct.isXRRenderTarget===!0)&&(Mt=r.toneMapping);let L={shaderID:U,shaderType:M.type,shaderName:M.name,vertexShader:Ut,fragmentShader:X,defines:M.defines,customVertexShaderID:ot,customFragmentShaderID:xt,isRawShaderMaterial:M.isRawShaderMaterial===!0,glslVersion:M.glslVersion,precision:u,batching:kt,instancing:Rt,instancingColor:Rt&&C.instanceColor!==null,instancingMorph:Rt&&C.morphTexture!==null,supportsVertexTextures:f,outputColorSpace:ct===null?r.outputColorSpace:ct.isXRRenderTarget===!0?ct.texture.colorSpace:Yr,alphaToCoverage:!!M.alphaToCoverage,map:q,matcap:$t,envMap:It,envMapMode:It&&Z.mapping,envMapCubeUVHeight:z,aoMap:Ft,lightMap:bt,bumpMap:Et,normalMap:Ht,displacementMap:f&&G,emissiveMap:jt,normalMapObjectSpace:Ht&&M.normalMapType===IS,normalMapTangentSpace:Ht&&M.normalMapType===PS,metalnessMap:A,roughnessMap:x,anisotropy:F,anisotropyMap:lt,clearcoat:Y,clearcoatMap:Lt,clearcoatNormalMap:ht,clearcoatRoughnessMap:yt,dispersion:tt,iridescence:it,iridescenceMap:qt,iridescenceThicknessMap:ut,sheen:vt,sheenColorMap:Tt,sheenRoughnessMap:Wt,specularMap:Zt,specularColorMap:ue,specularIntensityMap:Jt,transmission:pt,transmissionMap:k,thicknessMap:Q,gradientMap:st,opaque:M.transparent===!1&&M.blending===zr&&M.alphaToCoverage===!1,alphaMap:mt,alphaTest:gt,alphaHash:Bt,combine:M.combine,mapUv:q&&p(M.map.channel),aoMapUv:Ft&&p(M.aoMap.channel),lightMapUv:bt&&p(M.lightMap.channel),bumpMapUv:Et&&p(M.bumpMap.channel),normalMapUv:Ht&&p(M.normalMap.channel),displacementMapUv:G&&p(M.displacementMap.channel),emissiveMapUv:jt&&p(M.emissiveMap.channel),metalnessMapUv:A&&p(M.metalnessMap.channel),roughnessMapUv:x&&p(M.roughnessMap.channel),anisotropyMapUv:lt&&p(M.anisotropyMap.channel),clearcoatMapUv:Lt&&p(M.clearcoatMap.channel),clearcoatNormalMapUv:ht&&p(M.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:yt&&p(M.clearcoatRoughnessMap.channel),iridescenceMapUv:qt&&p(M.iridescenceMap.channel),iridescenceThicknessMapUv:ut&&p(M.iridescenceThicknessMap.channel),sheenColorMapUv:Tt&&p(M.sheenColorMap.channel),sheenRoughnessMapUv:Wt&&p(M.sheenRoughnessMap.channel),specularMapUv:Zt&&p(M.specularMap.channel),specularColorMapUv:ue&&p(M.specularColorMap.channel),specularIntensityMapUv:Jt&&p(M.specularIntensityMap.channel),transmissionMapUv:k&&p(M.transmissionMap.channel),thicknessMapUv:Q&&p(M.thicknessMap.channel),alphaMapUv:mt&&p(M.alphaMap.channel),vertexTangents:!!$.attributes.tangent&&(Ht||F),vertexColors:M.vertexColors,vertexAlphas:M.vertexColors===!0&&!!$.attributes.color&&$.attributes.color.itemSize===4,pointsUvs:C.isPoints===!0&&!!$.attributes.uv&&(q||mt),fog:!!V,useFog:M.fog===!0,fogExp2:!!V&&V.isFogExp2,flatShading:M.flatShading===!0,sizeAttenuation:M.sizeAttenuation===!0,logarithmicDepthBuffer:d,skinning:C.isSkinnedMesh===!0,morphTargets:$.morphAttributes.position!==void 0,morphNormals:$.morphAttributes.normal!==void 0,morphColors:$.morphAttributes.color!==void 0,morphTargetsCount:at,morphTextureStride:_t,numDirLights:y.directional.length,numPointLights:y.point.length,numSpotLights:y.spot.length,numSpotLightMaps:y.spotLightMap.length,numRectAreaLights:y.rectArea.length,numHemiLights:y.hemi.length,numDirLightShadows:y.directionalShadowMap.length,numPointLightShadows:y.pointShadowMap.length,numSpotLightShadows:y.spotShadowMap.length,numSpotLightShadowsWithMaps:y.numSpotLightShadowsWithMaps,numLightProbes:y.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:M.dithering,shadowMapEnabled:r.shadowMap.enabled&&I.length>0,shadowMapType:r.shadowMap.type,toneMapping:Mt,useLegacyLights:r._useLegacyLights,decodeVideoTexture:q&&M.map.isVideoTexture===!0&&Se.getTransfer(M.map.colorSpace)===Te,premultipliedAlpha:M.premultipliedAlpha,doubleSided:M.side===or,flipSided:M.side===Un,useDepthPacking:M.depthPacking>=0,depthPacking:M.depthPacking||0,index0AttributeName:M.index0AttributeName,extensionClipCullDistance:ne&&M.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:ne&&M.extensions.multiDraw===!0&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:M.customProgramCacheKey()};return L.vertexUv1s=c.has(1),L.vertexUv2s=c.has(2),L.vertexUv3s=c.has(3),c.clear(),L}function g(M){let y=[];if(M.shaderID?y.push(M.shaderID):(y.push(M.customVertexShaderID),y.push(M.customFragmentShaderID)),M.defines!==void 0)for(let I in M.defines)y.push(I),y.push(M.defines[I]);return M.isRawShaderMaterial===!1&&(b(y,M),v(y,M),y.push(r.outputColorSpace)),y.push(M.customProgramCacheKey),y.join()}function b(M,y){M.push(y.precision),M.push(y.outputColorSpace),M.push(y.envMapMode),M.push(y.envMapCubeUVHeight),M.push(y.mapUv),M.push(y.alphaMapUv),M.push(y.lightMapUv),M.push(y.aoMapUv),M.push(y.bumpMapUv),M.push(y.normalMapUv),M.push(y.displacementMapUv),M.push(y.emissiveMapUv),M.push(y.metalnessMapUv),M.push(y.roughnessMapUv),M.push(y.anisotropyMapUv),M.push(y.clearcoatMapUv),M.push(y.clearcoatNormalMapUv),M.push(y.clearcoatRoughnessMapUv),M.push(y.iridescenceMapUv),M.push(y.iridescenceThicknessMapUv),M.push(y.sheenColorMapUv),M.push(y.sheenRoughnessMapUv),M.push(y.specularMapUv),M.push(y.specularColorMapUv),M.push(y.specularIntensityMapUv),M.push(y.transmissionMapUv),M.push(y.thicknessMapUv),M.push(y.combine),M.push(y.fogExp2),M.push(y.sizeAttenuation),M.push(y.morphTargetsCount),M.push(y.morphAttributeCount),M.push(y.numDirLights),M.push(y.numPointLights),M.push(y.numSpotLights),M.push(y.numSpotLightMaps),M.push(y.numHemiLights),M.push(y.numRectAreaLights),M.push(y.numDirLightShadows),M.push(y.numPointLightShadows),M.push(y.numSpotLightShadows),M.push(y.numSpotLightShadowsWithMaps),M.push(y.numLightProbes),M.push(y.shadowMapType),M.push(y.toneMapping),M.push(y.numClippingPlanes),M.push(y.numClipIntersection),M.push(y.depthPacking)}function v(M,y){a.disableAll(),y.supportsVertexTextures&&a.enable(0),y.instancing&&a.enable(1),y.instancingColor&&a.enable(2),y.instancingMorph&&a.enable(3),y.matcap&&a.enable(4),y.envMap&&a.enable(5),y.normalMapObjectSpace&&a.enable(6),y.normalMapTangentSpace&&a.enable(7),y.clearcoat&&a.enable(8),y.iridescence&&a.enable(9),y.alphaTest&&a.enable(10),y.vertexColors&&a.enable(11),y.vertexAlphas&&a.enable(12),y.vertexUv1s&&a.enable(13),y.vertexUv2s&&a.enable(14),y.vertexUv3s&&a.enable(15),y.vertexTangents&&a.enable(16),y.anisotropy&&a.enable(17),y.alphaHash&&a.enable(18),y.batching&&a.enable(19),y.dispersion&&a.enable(20),M.push(a.mask),a.disableAll(),y.fog&&a.enable(0),y.useFog&&a.enable(1),y.flatShading&&a.enable(2),y.logarithmicDepthBuffer&&a.enable(3),y.skinning&&a.enable(4),y.morphTargets&&a.enable(5),y.morphNormals&&a.enable(6),y.morphColors&&a.enable(7),y.premultipliedAlpha&&a.enable(8),y.shadowMapEnabled&&a.enable(9),y.useLegacyLights&&a.enable(10),y.doubleSided&&a.enable(11),y.flipSided&&a.enable(12),y.useDepthPacking&&a.enable(13),y.dithering&&a.enable(14),y.transmission&&a.enable(15),y.sheen&&a.enable(16),y.opaque&&a.enable(17),y.pointsUvs&&a.enable(18),y.decodeVideoTexture&&a.enable(19),y.alphaToCoverage&&a.enable(20),M.push(a.mask)}function S(M){let y=_[M.type],I;if(y){let N=Ni[y];I=iM.clone(N.uniforms)}else I=M.uniforms;return I}function D(M,y){let I;for(let N=0,C=h.length;N<C;N++){let V=h[N];if(V.cacheKey===y){I=V,++I.usedTimes;break}}return I===void 0&&(I=new uE(r,y,M,s),h.push(I)),I}function T(M){if(--M.usedTimes===0){let y=h.indexOf(M);h[y]=h[h.length-1],h.pop(),M.destroy()}}function w(M){l.remove(M)}function P(){l.dispose()}return{getParameters:m,getProgramCacheKey:g,getUniforms:S,acquireProgram:D,releaseProgram:T,releaseShaderCache:w,programs:h,dispose:P}}function dE(){let r=new WeakMap;function t(s){let o=r.get(s);return o===void 0&&(o={},r.set(s,o)),o}function e(s){r.delete(s)}function n(s,o,a){r.get(s)[o]=a}function i(){r=new WeakMap}return{get:t,remove:e,update:n,dispose:i}}function pE(r,t){return r.groupOrder!==t.groupOrder?r.groupOrder-t.groupOrder:r.renderOrder!==t.renderOrder?r.renderOrder-t.renderOrder:r.material.id!==t.material.id?r.material.id-t.material.id:r.z!==t.z?r.z-t.z:r.id-t.id}function m0(r,t){return r.groupOrder!==t.groupOrder?r.groupOrder-t.groupOrder:r.renderOrder!==t.renderOrder?r.renderOrder-t.renderOrder:r.z!==t.z?t.z-r.z:r.id-t.id}function g0(){let r=[],t=0,e=[],n=[],i=[];function s(){t=0,e.length=0,n.length=0,i.length=0}function o(d,f,u,_,p,m){let g=r[t];return g===void 0?(g={id:d.id,object:d,geometry:f,material:u,groupOrder:_,renderOrder:d.renderOrder,z:p,group:m},r[t]=g):(g.id=d.id,g.object=d,g.geometry=f,g.material=u,g.groupOrder=_,g.renderOrder=d.renderOrder,g.z=p,g.group=m),t++,g}function a(d,f,u,_,p,m){let g=o(d,f,u,_,p,m);u.transmission>0?n.push(g):u.transparent===!0?i.push(g):e.push(g)}function l(d,f,u,_,p,m){let g=o(d,f,u,_,p,m);u.transmission>0?n.unshift(g):u.transparent===!0?i.unshift(g):e.unshift(g)}function c(d,f){e.length>1&&e.sort(d||pE),n.length>1&&n.sort(f||m0),i.length>1&&i.sort(f||m0)}function h(){for(let d=t,f=r.length;d<f;d++){let u=r[d];if(u.id===null)break;u.id=null,u.object=null,u.geometry=null,u.material=null,u.group=null}}return{opaque:e,transmissive:n,transparent:i,init:s,push:a,unshift:l,finish:h,sort:c}}function mE(){let r=new WeakMap;function t(n,i){let s=r.get(n),o;return s===void 0?(o=new g0,r.set(n,[o])):i>=s.length?(o=new g0,s.push(o)):o=s[i],o}function e(){r=new WeakMap}return{get:t,dispose:e}}function gE(){let r={};return{get:function(t){if(r[t.id]!==void 0)return r[t.id];let e;switch(t.type){case"DirectionalLight":e={direction:new nt,color:new ge};break;case"SpotLight":e={position:new nt,direction:new nt,color:new ge,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new nt,color:new ge,distance:0,decay:0};break;case"HemisphereLight":e={direction:new nt,skyColor:new ge,groundColor:new ge};break;case"RectAreaLight":e={color:new ge,position:new nt,halfWidth:new nt,halfHeight:new nt};break}return r[t.id]=e,e}}}function _E(){let r={};return{get:function(t){if(r[t.id]!==void 0)return r[t.id];let e;switch(t.type){case"DirectionalLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new _e};break;case"SpotLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new _e};break;case"PointLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new _e,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[t.id]=e,e}}}var xE=0;function yE(r,t){return(t.castShadow?2:0)-(r.castShadow?2:0)+(t.map?1:0)-(r.map?1:0)}function vE(r){let t=new gE,e=_E(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)n.probe.push(new nt);let i=new nt,s=new Oe,o=new Oe;function a(c,h){let d=0,f=0,u=0;for(let I=0;I<9;I++)n.probe[I].set(0,0,0);let _=0,p=0,m=0,g=0,b=0,v=0,S=0,D=0,T=0,w=0,P=0;c.sort(yE);let M=h===!0?Math.PI:1;for(let I=0,N=c.length;I<N;I++){let C=c[I],V=C.color,$=C.intensity,W=C.distance,Z=C.shadow&&C.shadow.map?C.shadow.map.texture:null;if(C.isAmbientLight)d+=V.r*$*M,f+=V.g*$*M,u+=V.b*$*M;else if(C.isLightProbe){for(let z=0;z<9;z++)n.probe[z].addScaledVector(C.sh.coefficients[z],$);P++}else if(C.isDirectionalLight){let z=t.get(C);if(z.color.copy(C.color).multiplyScalar(C.intensity*M),C.castShadow){let U=C.shadow,R=e.get(C);R.shadowBias=U.bias,R.shadowNormalBias=U.normalBias,R.shadowRadius=U.radius,R.shadowMapSize=U.mapSize,n.directionalShadow[_]=R,n.directionalShadowMap[_]=Z,n.directionalShadowMatrix[_]=C.shadow.matrix,v++}n.directional[_]=z,_++}else if(C.isSpotLight){let z=t.get(C);z.position.setFromMatrixPosition(C.matrixWorld),z.color.copy(V).multiplyScalar($*M),z.distance=W,z.coneCos=Math.cos(C.angle),z.penumbraCos=Math.cos(C.angle*(1-C.penumbra)),z.decay=C.decay,n.spot[m]=z;let U=C.shadow;if(C.map&&(n.spotLightMap[T]=C.map,T++,U.updateMatrices(C),C.castShadow&&w++),n.spotLightMatrix[m]=U.matrix,C.castShadow){let R=e.get(C);R.shadowBias=U.bias,R.shadowNormalBias=U.normalBias,R.shadowRadius=U.radius,R.shadowMapSize=U.mapSize,n.spotShadow[m]=R,n.spotShadowMap[m]=Z,D++}m++}else if(C.isRectAreaLight){let z=t.get(C);z.color.copy(V).multiplyScalar($),z.halfWidth.set(C.width*.5,0,0),z.halfHeight.set(0,C.height*.5,0),n.rectArea[g]=z,g++}else if(C.isPointLight){let z=t.get(C);if(z.color.copy(C.color).multiplyScalar(C.intensity*M),z.distance=C.distance,z.decay=C.decay,C.castShadow){let U=C.shadow,R=e.get(C);R.shadowBias=U.bias,R.shadowNormalBias=U.normalBias,R.shadowRadius=U.radius,R.shadowMapSize=U.mapSize,R.shadowCameraNear=U.camera.near,R.shadowCameraFar=U.camera.far,n.pointShadow[p]=R,n.pointShadowMap[p]=Z,n.pointShadowMatrix[p]=C.shadow.matrix,S++}n.point[p]=z,p++}else if(C.isHemisphereLight){let z=t.get(C);z.skyColor.copy(C.color).multiplyScalar($*M),z.groundColor.copy(C.groundColor).multiplyScalar($*M),n.hemi[b]=z,b++}}g>0&&(r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=Ct.LTC_FLOAT_1,n.rectAreaLTC2=Ct.LTC_FLOAT_2):(n.rectAreaLTC1=Ct.LTC_HALF_1,n.rectAreaLTC2=Ct.LTC_HALF_2)),n.ambient[0]=d,n.ambient[1]=f,n.ambient[2]=u;let y=n.hash;(y.directionalLength!==_||y.pointLength!==p||y.spotLength!==m||y.rectAreaLength!==g||y.hemiLength!==b||y.numDirectionalShadows!==v||y.numPointShadows!==S||y.numSpotShadows!==D||y.numSpotMaps!==T||y.numLightProbes!==P)&&(n.directional.length=_,n.spot.length=m,n.rectArea.length=g,n.point.length=p,n.hemi.length=b,n.directionalShadow.length=v,n.directionalShadowMap.length=v,n.pointShadow.length=S,n.pointShadowMap.length=S,n.spotShadow.length=D,n.spotShadowMap.length=D,n.directionalShadowMatrix.length=v,n.pointShadowMatrix.length=S,n.spotLightMatrix.length=D+T-w,n.spotLightMap.length=T,n.numSpotLightShadowsWithMaps=w,n.numLightProbes=P,y.directionalLength=_,y.pointLength=p,y.spotLength=m,y.rectAreaLength=g,y.hemiLength=b,y.numDirectionalShadows=v,y.numPointShadows=S,y.numSpotShadows=D,y.numSpotMaps=T,y.numLightProbes=P,n.version=xE++)}function l(c,h){let d=0,f=0,u=0,_=0,p=0,m=h.matrixWorldInverse;for(let g=0,b=c.length;g<b;g++){let v=c[g];if(v.isDirectionalLight){let S=n.directional[d];S.direction.setFromMatrixPosition(v.matrixWorld),i.setFromMatrixPosition(v.target.matrixWorld),S.direction.sub(i),S.direction.transformDirection(m),d++}else if(v.isSpotLight){let S=n.spot[u];S.position.setFromMatrixPosition(v.matrixWorld),S.position.applyMatrix4(m),S.direction.setFromMatrixPosition(v.matrixWorld),i.setFromMatrixPosition(v.target.matrixWorld),S.direction.sub(i),S.direction.transformDirection(m),u++}else if(v.isRectAreaLight){let S=n.rectArea[_];S.position.setFromMatrixPosition(v.matrixWorld),S.position.applyMatrix4(m),o.identity(),s.copy(v.matrixWorld),s.premultiply(m),o.extractRotation(s),S.halfWidth.set(v.width*.5,0,0),S.halfHeight.set(0,v.height*.5,0),S.halfWidth.applyMatrix4(o),S.halfHeight.applyMatrix4(o),_++}else if(v.isPointLight){let S=n.point[f];S.position.setFromMatrixPosition(v.matrixWorld),S.position.applyMatrix4(m),f++}else if(v.isHemisphereLight){let S=n.hemi[p];S.direction.setFromMatrixPosition(v.matrixWorld),S.direction.transformDirection(m),p++}}}return{setup:a,setupView:l,state:n}}function _0(r){let t=new vE(r),e=[],n=[];function i(h){c.camera=h,e.length=0,n.length=0}function s(h){e.push(h)}function o(h){n.push(h)}function a(h){t.setup(e,h)}function l(h){t.setupView(e,h)}let c={lightsArray:e,shadowsArray:n,camera:null,lights:t,transmissionRenderTarget:{}};return{init:i,state:c,setupLights:a,setupLightsView:l,pushLight:s,pushShadow:o}}function SE(r){let t=new WeakMap;function e(i,s=0){let o=t.get(i),a;return o===void 0?(a=new _0(r),t.set(i,[a])):s>=o.length?(a=new _0(r),o.push(a)):a=o[s],a}function n(){t=new WeakMap}return{get:e,dispose:n}}var td=class extends Ns{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=CS,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}},ed=class extends Ns{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}},ME=`void main() {
|
|
3769
|
+
`+z)}else N!==""?console.warn("THREE.WebGLProgram: Program Info Log:",N):(C===""||V==="")&&(W=!1);W&&(I.diagnostics={runnable:$,programLog:N,vertexShader:{log:C,prefix:p},fragmentShader:{log:V,prefix:g}})}i.deleteShader(D),i.deleteShader(T),P=new ko(i,m),M=Q1(i,m)}let P;this.getUniforms=function(){return P===void 0&&w(this),P};let M;this.getAttributes=function(){return M===void 0&&w(this),M};let y=e.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return y===!1&&(y=i.getProgramParameter(m,X1)),y},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(m),this.program=void 0},this.type=e.shaderType,this.name=e.shaderName,this.id=Y1++,this.cacheKey=t,this.usedTimes=1,this.program=m,this.vertexShader=D,this.fragmentShader=T,this}var hE=0,jf=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){let e=t.vertexShader,n=t.fragmentShader,i=this._getShaderStage(e),s=this._getShaderStage(n),o=this._getShaderCacheForMaterial(t);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(t){let e=this.materialCache.get(t);for(let n of e)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){let e=this.materialCache,n=e.get(t);return n===void 0&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){let e=this.shaderCache,n=e.get(t);return n===void 0&&(n=new Qf(t),e.set(t,n)),n}},Qf=class{constructor(t){this.id=hE++,this.code=t,this.usedTimes=0}};function fE(r,t,e,n,i,s,o){let a=new zc,l=new jf,c=new Set,h=[],f=i.logarithmicDepthBuffer,d=i.vertexTextures,u=i.precision,_={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function m(M){return c.add(M),M===0?"uv":`uv${M}`}function p(M,y,I,N,C){let V=N.fog,$=C.geometry,W=M.isMeshStandardMaterial?N.environment:null,Z=(M.isMeshStandardMaterial?e:t).get(M.envMap||W),z=Z&&Z.mapping===nu?Z.image.height:null,U=_[M.type];M.precision!==null&&(u=i.getMaxPrecision(M.precision),u!==M.precision&&console.warn("THREE.WebGLProgram.getParameters:",M.precision,"not supported, using",u,"instead."));let R=$.morphAttributes.position||$.morphAttributes.normal||$.morphAttributes.color,at=R!==void 0?R.length:0,_t=0;$.morphAttributes.position!==void 0&&(_t=1),$.morphAttributes.normal!==void 0&&(_t=2),$.morphAttributes.color!==void 0&&(_t=3);let Ut,X,ot,xt;if(U){let rt=Ni[U];Ut=rt.vertexShader,X=rt.fragmentShader}else Ut=M.vertexShader,X=M.fragmentShader,l.update(M),ot=l.getVertexShaderID(M),xt=l.getFragmentShaderID(M);let ct=r.getRenderTarget(),Rt=C.isInstancedMesh===!0,kt=C.isBatchedMesh===!0,q=!!M.map,$t=!!M.matcap,It=!!Z,Ft=!!M.aoMap,bt=!!M.lightMap,Et=!!M.bumpMap,Ht=!!M.normalMap,G=!!M.displacementMap,jt=!!M.emissiveMap,A=!!M.metalnessMap,x=!!M.roughnessMap,F=M.anisotropy>0,Y=M.clearcoat>0,tt=M.dispersion>0,it=M.iridescence>0,vt=M.sheen>0,pt=M.transmission>0,lt=F&&!!M.anisotropyMap,Lt=Y&&!!M.clearcoatMap,ht=Y&&!!M.clearcoatNormalMap,yt=Y&&!!M.clearcoatRoughnessMap,qt=it&&!!M.iridescenceMap,ut=it&&!!M.iridescenceThicknessMap,Tt=vt&&!!M.sheenColorMap,Wt=vt&&!!M.sheenRoughnessMap,Zt=!!M.specularMap,ue=!!M.specularColorMap,Jt=!!M.specularIntensityMap,k=pt&&!!M.transmissionMap,Q=pt&&!!M.thicknessMap,st=!!M.gradientMap,mt=!!M.alphaMap,gt=M.alphaTest>0,Bt=!!M.alphaHash,ne=!!M.extensions,Mt=Vr;M.toneMapped&&(ct===null||ct.isXRRenderTarget===!0)&&(Mt=r.toneMapping);let L={shaderID:U,shaderType:M.type,shaderName:M.name,vertexShader:Ut,fragmentShader:X,defines:M.defines,customVertexShaderID:ot,customFragmentShaderID:xt,isRawShaderMaterial:M.isRawShaderMaterial===!0,glslVersion:M.glslVersion,precision:u,batching:kt,instancing:Rt,instancingColor:Rt&&C.instanceColor!==null,instancingMorph:Rt&&C.morphTexture!==null,supportsVertexTextures:d,outputColorSpace:ct===null?r.outputColorSpace:ct.isXRRenderTarget===!0?ct.texture.colorSpace:Yr,alphaToCoverage:!!M.alphaToCoverage,map:q,matcap:$t,envMap:It,envMapMode:It&&Z.mapping,envMapCubeUVHeight:z,aoMap:Ft,lightMap:bt,bumpMap:Et,normalMap:Ht,displacementMap:d&&G,emissiveMap:jt,normalMapObjectSpace:Ht&&M.normalMapType===IS,normalMapTangentSpace:Ht&&M.normalMapType===PS,metalnessMap:A,roughnessMap:x,anisotropy:F,anisotropyMap:lt,clearcoat:Y,clearcoatMap:Lt,clearcoatNormalMap:ht,clearcoatRoughnessMap:yt,dispersion:tt,iridescence:it,iridescenceMap:qt,iridescenceThicknessMap:ut,sheen:vt,sheenColorMap:Tt,sheenRoughnessMap:Wt,specularMap:Zt,specularColorMap:ue,specularIntensityMap:Jt,transmission:pt,transmissionMap:k,thicknessMap:Q,gradientMap:st,opaque:M.transparent===!1&&M.blending===zr&&M.alphaToCoverage===!1,alphaMap:mt,alphaTest:gt,alphaHash:Bt,combine:M.combine,mapUv:q&&m(M.map.channel),aoMapUv:Ft&&m(M.aoMap.channel),lightMapUv:bt&&m(M.lightMap.channel),bumpMapUv:Et&&m(M.bumpMap.channel),normalMapUv:Ht&&m(M.normalMap.channel),displacementMapUv:G&&m(M.displacementMap.channel),emissiveMapUv:jt&&m(M.emissiveMap.channel),metalnessMapUv:A&&m(M.metalnessMap.channel),roughnessMapUv:x&&m(M.roughnessMap.channel),anisotropyMapUv:lt&&m(M.anisotropyMap.channel),clearcoatMapUv:Lt&&m(M.clearcoatMap.channel),clearcoatNormalMapUv:ht&&m(M.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:yt&&m(M.clearcoatRoughnessMap.channel),iridescenceMapUv:qt&&m(M.iridescenceMap.channel),iridescenceThicknessMapUv:ut&&m(M.iridescenceThicknessMap.channel),sheenColorMapUv:Tt&&m(M.sheenColorMap.channel),sheenRoughnessMapUv:Wt&&m(M.sheenRoughnessMap.channel),specularMapUv:Zt&&m(M.specularMap.channel),specularColorMapUv:ue&&m(M.specularColorMap.channel),specularIntensityMapUv:Jt&&m(M.specularIntensityMap.channel),transmissionMapUv:k&&m(M.transmissionMap.channel),thicknessMapUv:Q&&m(M.thicknessMap.channel),alphaMapUv:mt&&m(M.alphaMap.channel),vertexTangents:!!$.attributes.tangent&&(Ht||F),vertexColors:M.vertexColors,vertexAlphas:M.vertexColors===!0&&!!$.attributes.color&&$.attributes.color.itemSize===4,pointsUvs:C.isPoints===!0&&!!$.attributes.uv&&(q||mt),fog:!!V,useFog:M.fog===!0,fogExp2:!!V&&V.isFogExp2,flatShading:M.flatShading===!0,sizeAttenuation:M.sizeAttenuation===!0,logarithmicDepthBuffer:f,skinning:C.isSkinnedMesh===!0,morphTargets:$.morphAttributes.position!==void 0,morphNormals:$.morphAttributes.normal!==void 0,morphColors:$.morphAttributes.color!==void 0,morphTargetsCount:at,morphTextureStride:_t,numDirLights:y.directional.length,numPointLights:y.point.length,numSpotLights:y.spot.length,numSpotLightMaps:y.spotLightMap.length,numRectAreaLights:y.rectArea.length,numHemiLights:y.hemi.length,numDirLightShadows:y.directionalShadowMap.length,numPointLightShadows:y.pointShadowMap.length,numSpotLightShadows:y.spotShadowMap.length,numSpotLightShadowsWithMaps:y.numSpotLightShadowsWithMaps,numLightProbes:y.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:M.dithering,shadowMapEnabled:r.shadowMap.enabled&&I.length>0,shadowMapType:r.shadowMap.type,toneMapping:Mt,useLegacyLights:r._useLegacyLights,decodeVideoTexture:q&&M.map.isVideoTexture===!0&&Se.getTransfer(M.map.colorSpace)===Te,premultipliedAlpha:M.premultipliedAlpha,doubleSided:M.side===or,flipSided:M.side===Un,useDepthPacking:M.depthPacking>=0,depthPacking:M.depthPacking||0,index0AttributeName:M.index0AttributeName,extensionClipCullDistance:ne&&M.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:ne&&M.extensions.multiDraw===!0&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:M.customProgramCacheKey()};return L.vertexUv1s=c.has(1),L.vertexUv2s=c.has(2),L.vertexUv3s=c.has(3),c.clear(),L}function g(M){let y=[];if(M.shaderID?y.push(M.shaderID):(y.push(M.customVertexShaderID),y.push(M.customFragmentShaderID)),M.defines!==void 0)for(let I in M.defines)y.push(I),y.push(M.defines[I]);return M.isRawShaderMaterial===!1&&(b(y,M),v(y,M),y.push(r.outputColorSpace)),y.push(M.customProgramCacheKey),y.join()}function b(M,y){M.push(y.precision),M.push(y.outputColorSpace),M.push(y.envMapMode),M.push(y.envMapCubeUVHeight),M.push(y.mapUv),M.push(y.alphaMapUv),M.push(y.lightMapUv),M.push(y.aoMapUv),M.push(y.bumpMapUv),M.push(y.normalMapUv),M.push(y.displacementMapUv),M.push(y.emissiveMapUv),M.push(y.metalnessMapUv),M.push(y.roughnessMapUv),M.push(y.anisotropyMapUv),M.push(y.clearcoatMapUv),M.push(y.clearcoatNormalMapUv),M.push(y.clearcoatRoughnessMapUv),M.push(y.iridescenceMapUv),M.push(y.iridescenceThicknessMapUv),M.push(y.sheenColorMapUv),M.push(y.sheenRoughnessMapUv),M.push(y.specularMapUv),M.push(y.specularColorMapUv),M.push(y.specularIntensityMapUv),M.push(y.transmissionMapUv),M.push(y.thicknessMapUv),M.push(y.combine),M.push(y.fogExp2),M.push(y.sizeAttenuation),M.push(y.morphTargetsCount),M.push(y.morphAttributeCount),M.push(y.numDirLights),M.push(y.numPointLights),M.push(y.numSpotLights),M.push(y.numSpotLightMaps),M.push(y.numHemiLights),M.push(y.numRectAreaLights),M.push(y.numDirLightShadows),M.push(y.numPointLightShadows),M.push(y.numSpotLightShadows),M.push(y.numSpotLightShadowsWithMaps),M.push(y.numLightProbes),M.push(y.shadowMapType),M.push(y.toneMapping),M.push(y.numClippingPlanes),M.push(y.numClipIntersection),M.push(y.depthPacking)}function v(M,y){a.disableAll(),y.supportsVertexTextures&&a.enable(0),y.instancing&&a.enable(1),y.instancingColor&&a.enable(2),y.instancingMorph&&a.enable(3),y.matcap&&a.enable(4),y.envMap&&a.enable(5),y.normalMapObjectSpace&&a.enable(6),y.normalMapTangentSpace&&a.enable(7),y.clearcoat&&a.enable(8),y.iridescence&&a.enable(9),y.alphaTest&&a.enable(10),y.vertexColors&&a.enable(11),y.vertexAlphas&&a.enable(12),y.vertexUv1s&&a.enable(13),y.vertexUv2s&&a.enable(14),y.vertexUv3s&&a.enable(15),y.vertexTangents&&a.enable(16),y.anisotropy&&a.enable(17),y.alphaHash&&a.enable(18),y.batching&&a.enable(19),y.dispersion&&a.enable(20),M.push(a.mask),a.disableAll(),y.fog&&a.enable(0),y.useFog&&a.enable(1),y.flatShading&&a.enable(2),y.logarithmicDepthBuffer&&a.enable(3),y.skinning&&a.enable(4),y.morphTargets&&a.enable(5),y.morphNormals&&a.enable(6),y.morphColors&&a.enable(7),y.premultipliedAlpha&&a.enable(8),y.shadowMapEnabled&&a.enable(9),y.useLegacyLights&&a.enable(10),y.doubleSided&&a.enable(11),y.flipSided&&a.enable(12),y.useDepthPacking&&a.enable(13),y.dithering&&a.enable(14),y.transmission&&a.enable(15),y.sheen&&a.enable(16),y.opaque&&a.enable(17),y.pointsUvs&&a.enable(18),y.decodeVideoTexture&&a.enable(19),y.alphaToCoverage&&a.enable(20),M.push(a.mask)}function S(M){let y=_[M.type],I;if(y){let N=Ni[y];I=iM.clone(N.uniforms)}else I=M.uniforms;return I}function D(M,y){let I;for(let N=0,C=h.length;N<C;N++){let V=h[N];if(V.cacheKey===y){I=V,++I.usedTimes;break}}return I===void 0&&(I=new uE(r,y,M,s),h.push(I)),I}function T(M){if(--M.usedTimes===0){let y=h.indexOf(M);h[y]=h[h.length-1],h.pop(),M.destroy()}}function w(M){l.remove(M)}function P(){l.dispose()}return{getParameters:p,getProgramCacheKey:g,getUniforms:S,acquireProgram:D,releaseProgram:T,releaseShaderCache:w,programs:h,dispose:P}}function dE(){let r=new WeakMap;function t(s){let o=r.get(s);return o===void 0&&(o={},r.set(s,o)),o}function e(s){r.delete(s)}function n(s,o,a){r.get(s)[o]=a}function i(){r=new WeakMap}return{get:t,remove:e,update:n,dispose:i}}function pE(r,t){return r.groupOrder!==t.groupOrder?r.groupOrder-t.groupOrder:r.renderOrder!==t.renderOrder?r.renderOrder-t.renderOrder:r.material.id!==t.material.id?r.material.id-t.material.id:r.z!==t.z?r.z-t.z:r.id-t.id}function m0(r,t){return r.groupOrder!==t.groupOrder?r.groupOrder-t.groupOrder:r.renderOrder!==t.renderOrder?r.renderOrder-t.renderOrder:r.z!==t.z?t.z-r.z:r.id-t.id}function g0(){let r=[],t=0,e=[],n=[],i=[];function s(){t=0,e.length=0,n.length=0,i.length=0}function o(f,d,u,_,m,p){let g=r[t];return g===void 0?(g={id:f.id,object:f,geometry:d,material:u,groupOrder:_,renderOrder:f.renderOrder,z:m,group:p},r[t]=g):(g.id=f.id,g.object=f,g.geometry=d,g.material=u,g.groupOrder=_,g.renderOrder=f.renderOrder,g.z=m,g.group=p),t++,g}function a(f,d,u,_,m,p){let g=o(f,d,u,_,m,p);u.transmission>0?n.push(g):u.transparent===!0?i.push(g):e.push(g)}function l(f,d,u,_,m,p){let g=o(f,d,u,_,m,p);u.transmission>0?n.unshift(g):u.transparent===!0?i.unshift(g):e.unshift(g)}function c(f,d){e.length>1&&e.sort(f||pE),n.length>1&&n.sort(d||m0),i.length>1&&i.sort(d||m0)}function h(){for(let f=t,d=r.length;f<d;f++){let u=r[f];if(u.id===null)break;u.id=null,u.object=null,u.geometry=null,u.material=null,u.group=null}}return{opaque:e,transmissive:n,transparent:i,init:s,push:a,unshift:l,finish:h,sort:c}}function mE(){let r=new WeakMap;function t(n,i){let s=r.get(n),o;return s===void 0?(o=new g0,r.set(n,[o])):i>=s.length?(o=new g0,s.push(o)):o=s[i],o}function e(){r=new WeakMap}return{get:t,dispose:e}}function gE(){let r={};return{get:function(t){if(r[t.id]!==void 0)return r[t.id];let e;switch(t.type){case"DirectionalLight":e={direction:new nt,color:new ge};break;case"SpotLight":e={position:new nt,direction:new nt,color:new ge,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":e={position:new nt,color:new ge,distance:0,decay:0};break;case"HemisphereLight":e={direction:new nt,skyColor:new ge,groundColor:new ge};break;case"RectAreaLight":e={color:new ge,position:new nt,halfWidth:new nt,halfHeight:new nt};break}return r[t.id]=e,e}}}function _E(){let r={};return{get:function(t){if(r[t.id]!==void 0)return r[t.id];let e;switch(t.type){case"DirectionalLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new _e};break;case"SpotLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new _e};break;case"PointLight":e={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new _e,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[t.id]=e,e}}}var xE=0;function yE(r,t){return(t.castShadow?2:0)-(r.castShadow?2:0)+(t.map?1:0)-(r.map?1:0)}function vE(r){let t=new gE,e=_E(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let c=0;c<9;c++)n.probe.push(new nt);let i=new nt,s=new Oe,o=new Oe;function a(c,h){let f=0,d=0,u=0;for(let I=0;I<9;I++)n.probe[I].set(0,0,0);let _=0,m=0,p=0,g=0,b=0,v=0,S=0,D=0,T=0,w=0,P=0;c.sort(yE);let M=h===!0?Math.PI:1;for(let I=0,N=c.length;I<N;I++){let C=c[I],V=C.color,$=C.intensity,W=C.distance,Z=C.shadow&&C.shadow.map?C.shadow.map.texture:null;if(C.isAmbientLight)f+=V.r*$*M,d+=V.g*$*M,u+=V.b*$*M;else if(C.isLightProbe){for(let z=0;z<9;z++)n.probe[z].addScaledVector(C.sh.coefficients[z],$);P++}else if(C.isDirectionalLight){let z=t.get(C);if(z.color.copy(C.color).multiplyScalar(C.intensity*M),C.castShadow){let U=C.shadow,R=e.get(C);R.shadowBias=U.bias,R.shadowNormalBias=U.normalBias,R.shadowRadius=U.radius,R.shadowMapSize=U.mapSize,n.directionalShadow[_]=R,n.directionalShadowMap[_]=Z,n.directionalShadowMatrix[_]=C.shadow.matrix,v++}n.directional[_]=z,_++}else if(C.isSpotLight){let z=t.get(C);z.position.setFromMatrixPosition(C.matrixWorld),z.color.copy(V).multiplyScalar($*M),z.distance=W,z.coneCos=Math.cos(C.angle),z.penumbraCos=Math.cos(C.angle*(1-C.penumbra)),z.decay=C.decay,n.spot[p]=z;let U=C.shadow;if(C.map&&(n.spotLightMap[T]=C.map,T++,U.updateMatrices(C),C.castShadow&&w++),n.spotLightMatrix[p]=U.matrix,C.castShadow){let R=e.get(C);R.shadowBias=U.bias,R.shadowNormalBias=U.normalBias,R.shadowRadius=U.radius,R.shadowMapSize=U.mapSize,n.spotShadow[p]=R,n.spotShadowMap[p]=Z,D++}p++}else if(C.isRectAreaLight){let z=t.get(C);z.color.copy(V).multiplyScalar($),z.halfWidth.set(C.width*.5,0,0),z.halfHeight.set(0,C.height*.5,0),n.rectArea[g]=z,g++}else if(C.isPointLight){let z=t.get(C);if(z.color.copy(C.color).multiplyScalar(C.intensity*M),z.distance=C.distance,z.decay=C.decay,C.castShadow){let U=C.shadow,R=e.get(C);R.shadowBias=U.bias,R.shadowNormalBias=U.normalBias,R.shadowRadius=U.radius,R.shadowMapSize=U.mapSize,R.shadowCameraNear=U.camera.near,R.shadowCameraFar=U.camera.far,n.pointShadow[m]=R,n.pointShadowMap[m]=Z,n.pointShadowMatrix[m]=C.shadow.matrix,S++}n.point[m]=z,m++}else if(C.isHemisphereLight){let z=t.get(C);z.skyColor.copy(C.color).multiplyScalar($*M),z.groundColor.copy(C.groundColor).multiplyScalar($*M),n.hemi[b]=z,b++}}g>0&&(r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=Ct.LTC_FLOAT_1,n.rectAreaLTC2=Ct.LTC_FLOAT_2):(n.rectAreaLTC1=Ct.LTC_HALF_1,n.rectAreaLTC2=Ct.LTC_HALF_2)),n.ambient[0]=f,n.ambient[1]=d,n.ambient[2]=u;let y=n.hash;(y.directionalLength!==_||y.pointLength!==m||y.spotLength!==p||y.rectAreaLength!==g||y.hemiLength!==b||y.numDirectionalShadows!==v||y.numPointShadows!==S||y.numSpotShadows!==D||y.numSpotMaps!==T||y.numLightProbes!==P)&&(n.directional.length=_,n.spot.length=p,n.rectArea.length=g,n.point.length=m,n.hemi.length=b,n.directionalShadow.length=v,n.directionalShadowMap.length=v,n.pointShadow.length=S,n.pointShadowMap.length=S,n.spotShadow.length=D,n.spotShadowMap.length=D,n.directionalShadowMatrix.length=v,n.pointShadowMatrix.length=S,n.spotLightMatrix.length=D+T-w,n.spotLightMap.length=T,n.numSpotLightShadowsWithMaps=w,n.numLightProbes=P,y.directionalLength=_,y.pointLength=m,y.spotLength=p,y.rectAreaLength=g,y.hemiLength=b,y.numDirectionalShadows=v,y.numPointShadows=S,y.numSpotShadows=D,y.numSpotMaps=T,y.numLightProbes=P,n.version=xE++)}function l(c,h){let f=0,d=0,u=0,_=0,m=0,p=h.matrixWorldInverse;for(let g=0,b=c.length;g<b;g++){let v=c[g];if(v.isDirectionalLight){let S=n.directional[f];S.direction.setFromMatrixPosition(v.matrixWorld),i.setFromMatrixPosition(v.target.matrixWorld),S.direction.sub(i),S.direction.transformDirection(p),f++}else if(v.isSpotLight){let S=n.spot[u];S.position.setFromMatrixPosition(v.matrixWorld),S.position.applyMatrix4(p),S.direction.setFromMatrixPosition(v.matrixWorld),i.setFromMatrixPosition(v.target.matrixWorld),S.direction.sub(i),S.direction.transformDirection(p),u++}else if(v.isRectAreaLight){let S=n.rectArea[_];S.position.setFromMatrixPosition(v.matrixWorld),S.position.applyMatrix4(p),o.identity(),s.copy(v.matrixWorld),s.premultiply(p),o.extractRotation(s),S.halfWidth.set(v.width*.5,0,0),S.halfHeight.set(0,v.height*.5,0),S.halfWidth.applyMatrix4(o),S.halfHeight.applyMatrix4(o),_++}else if(v.isPointLight){let S=n.point[d];S.position.setFromMatrixPosition(v.matrixWorld),S.position.applyMatrix4(p),d++}else if(v.isHemisphereLight){let S=n.hemi[m];S.direction.setFromMatrixPosition(v.matrixWorld),S.direction.transformDirection(p),m++}}}return{setup:a,setupView:l,state:n}}function _0(r){let t=new vE(r),e=[],n=[];function i(h){c.camera=h,e.length=0,n.length=0}function s(h){e.push(h)}function o(h){n.push(h)}function a(h){t.setup(e,h)}function l(h){t.setupView(e,h)}let c={lightsArray:e,shadowsArray:n,camera:null,lights:t,transmissionRenderTarget:{}};return{init:i,state:c,setupLights:a,setupLightsView:l,pushLight:s,pushShadow:o}}function SE(r){let t=new WeakMap;function e(i,s=0){let o=t.get(i),a;return o===void 0?(a=new _0(r),t.set(i,[a])):s>=o.length?(a=new _0(r),o.push(a)):a=o[s],a}function n(){t=new WeakMap}return{get:e,dispose:n}}var td=class extends Ns{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=CS,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}},ed=class extends Ns{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}},ME=`void main() {
|
|
3770
3770
|
gl_Position = vec4( position, 1.0 );
|
|
3771
3771
|
}`,bE=`uniform sampler2D shadow_pass;
|
|
3772
3772
|
uniform vec2 resolution;
|
|
@@ -3794,7 +3794,7 @@ void main() {
|
|
|
3794
3794
|
squared_mean = squared_mean / samples;
|
|
3795
3795
|
float std_dev = sqrt( squared_mean - mean * mean );
|
|
3796
3796
|
gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
|
|
3797
|
-
}`;function wE(r,t,e){let n=new Ka,i=new _e,s=new _e,o=new Qe,a=new td({depthPacking:RS}),l=new ed,c={},h=e.maxTextureSize,d={[Hr]:Un,[Un]:Hr,[or]:or},f=new ai({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new _e},radius:{value:4}},vertexShader:ME,fragmentShader:bE}),u=f.clone();u.defines.HORIZONTAL_PASS=1;let _=new Oi;_.setAttribute("position",new ri(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let p=new Si(_,f),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=M0;let g=this.type;this.render=function(T,w,P){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||T.length===0)return;let M=r.getRenderTarget(),y=r.getActiveCubeFace(),I=r.getActiveMipmapLevel(),N=r.state;N.setBlending(kr),N.buffers.color.setClear(1,1,1,1),N.buffers.depth.setTest(!0),N.setScissorTest(!1);let C=g!==rr&&this.type===rr,V=g===rr&&this.type!==rr;for(let $=0,W=T.length;$<W;$++){let Z=T[$],z=Z.shadow;if(z===void 0){console.warn("THREE.WebGLShadowMap:",Z,"has no shadow.");continue}if(z.autoUpdate===!1&&z.needsUpdate===!1)continue;i.copy(z.mapSize);let U=z.getFrameExtents();if(i.multiply(U),s.copy(z.mapSize),(i.x>h||i.y>h)&&(i.x>h&&(s.x=Math.floor(h/U.x),i.x=s.x*U.x,z.mapSize.x=s.x),i.y>h&&(s.y=Math.floor(h/U.y),i.y=s.y*U.y,z.mapSize.y=s.y)),z.map===null||C===!0||V===!0){let at=this.type!==rr?{minFilter:ii,magFilter:ii}:{};z.map!==null&&z.map.dispose(),z.map=new lr(i.x,i.y,at),z.map.texture.name=Z.name+".shadowMap",z.camera.updateProjectionMatrix()}r.setRenderTarget(z.map),r.clear();let R=z.getViewportCount();for(let at=0;at<R;at++){let _t=z.getViewport(at);o.set(s.x*_t.x,s.y*_t.y,s.x*_t.z,s.y*_t.w),N.viewport(o),z.updateMatrices(Z,at),n=z.getFrustum(),S(w,P,z.camera,Z,this.type)}z.isPointLightShadow!==!0&&this.type===rr&&b(z,P),z.needsUpdate=!1}g=this.type,m.needsUpdate=!1,r.setRenderTarget(M,y,I)};function b(T,w){let P=t.update(p);f.defines.VSM_SAMPLES!==T.blurSamples&&(f.defines.VSM_SAMPLES=T.blurSamples,u.defines.VSM_SAMPLES=T.blurSamples,f.needsUpdate=!0,u.needsUpdate=!0),T.mapPass===null&&(T.mapPass=new lr(i.x,i.y)),f.uniforms.shadow_pass.value=T.map.texture,f.uniforms.resolution.value=T.mapSize,f.uniforms.radius.value=T.radius,r.setRenderTarget(T.mapPass),r.clear(),r.renderBufferDirect(w,null,P,f,p,null),u.uniforms.shadow_pass.value=T.mapPass.texture,u.uniforms.resolution.value=T.mapSize,u.uniforms.radius.value=T.radius,r.setRenderTarget(T.map),r.clear(),r.renderBufferDirect(w,null,P,u,p,null)}function v(T,w,P,M){let y=null,I=P.isPointLight===!0?T.customDistanceMaterial:T.customDepthMaterial;if(I!==void 0)y=I;else if(y=P.isPointLight===!0?l:a,r.localClippingEnabled&&w.clipShadows===!0&&Array.isArray(w.clippingPlanes)&&w.clippingPlanes.length!==0||w.displacementMap&&w.displacementScale!==0||w.alphaMap&&w.alphaTest>0||w.map&&w.alphaTest>0){let N=y.uuid,C=w.uuid,V=c[N];V===void 0&&(V={},c[N]=V);let $=V[C];$===void 0&&($=y.clone(),V[C]=$,w.addEventListener("dispose",D)),y=$}if(y.visible=w.visible,y.wireframe=w.wireframe,M===rr?y.side=w.shadowSide!==null?w.shadowSide:w.side:y.side=w.shadowSide!==null?w.shadowSide:d[w.side],y.alphaMap=w.alphaMap,y.alphaTest=w.alphaTest,y.map=w.map,y.clipShadows=w.clipShadows,y.clippingPlanes=w.clippingPlanes,y.clipIntersection=w.clipIntersection,y.displacementMap=w.displacementMap,y.displacementScale=w.displacementScale,y.displacementBias=w.displacementBias,y.wireframeLinewidth=w.wireframeLinewidth,y.linewidth=w.linewidth,P.isPointLight===!0&&y.isMeshDistanceMaterial===!0){let N=r.properties.get(y);N.light=P}return y}function S(T,w,P,M,y){if(T.visible===!1)return;if(T.layers.test(w.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&y===rr)&&(!T.frustumCulled||n.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,T.matrixWorld);let C=t.update(T),V=T.material;if(Array.isArray(V)){let $=C.groups;for(let W=0,Z=$.length;W<Z;W++){let z=$[W],U=V[z.materialIndex];if(U&&U.visible){let R=v(T,U,M,y);T.onBeforeShadow(r,T,w,P,C,R,z),r.renderBufferDirect(P,null,C,R,T,z),T.onAfterShadow(r,T,w,P,C,R,z)}}}else if(V.visible){let $=v(T,V,M,y);T.onBeforeShadow(r,T,w,P,C,$,null),r.renderBufferDirect(P,null,C,$,T,null),T.onAfterShadow(r,T,w,P,C,$,null)}}let N=T.children;for(let C=0,V=N.length;C<V;C++)S(N[C],w,P,M,y)}function D(T){T.target.removeEventListener("dispose",D);for(let P in c){let M=c[P],y=T.target.uuid;y in M&&(M[y].dispose(),delete M[y])}}}function EE(r){function t(){let k=!1,Q=new Qe,st=null,mt=new Qe(0,0,0,0);return{setMask:function(gt){st!==gt&&!k&&(r.colorMask(gt,gt,gt,gt),st=gt)},setLocked:function(gt){k=gt},setClear:function(gt,Bt,ne,Mt,L){L===!0&&(gt*=Mt,Bt*=Mt,ne*=Mt),Q.set(gt,Bt,ne,Mt),mt.equals(Q)===!1&&(r.clearColor(gt,Bt,ne,Mt),mt.copy(Q))},reset:function(){k=!1,st=null,mt.set(-1,0,0,0)}}}function e(){let k=!1,Q=null,st=null,mt=null;return{setTest:function(gt){gt?xt(r.DEPTH_TEST):ct(r.DEPTH_TEST)},setMask:function(gt){Q!==gt&&!k&&(r.depthMask(gt),Q=gt)},setFunc:function(gt){if(st!==gt){switch(gt){case nS:r.depthFunc(r.NEVER);break;case iS:r.depthFunc(r.ALWAYS);break;case rS:r.depthFunc(r.LESS);break;case Cc:r.depthFunc(r.LEQUAL);break;case sS:r.depthFunc(r.EQUAL);break;case oS:r.depthFunc(r.GEQUAL);break;case aS:r.depthFunc(r.GREATER);break;case lS:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}st=gt}},setLocked:function(gt){k=gt},setClear:function(gt){mt!==gt&&(r.clearDepth(gt),mt=gt)},reset:function(){k=!1,Q=null,st=null,mt=null}}}function n(){let k=!1,Q=null,st=null,mt=null,gt=null,Bt=null,ne=null,Mt=null,L=null;return{setTest:function(rt){k||(rt?xt(r.STENCIL_TEST):ct(r.STENCIL_TEST))},setMask:function(rt){Q!==rt&&!k&&(r.stencilMask(rt),Q=rt)},setFunc:function(rt,O,j){(st!==rt||mt!==O||gt!==j)&&(r.stencilFunc(rt,O,j),st=rt,mt=O,gt=j)},setOp:function(rt,O,j){(Bt!==rt||ne!==O||Mt!==j)&&(r.stencilOp(rt,O,j),Bt=rt,ne=O,Mt=j)},setLocked:function(rt){k=rt},setClear:function(rt){L!==rt&&(r.clearStencil(rt),L=rt)},reset:function(){k=!1,Q=null,st=null,mt=null,gt=null,Bt=null,ne=null,Mt=null,L=null}}}let i=new t,s=new e,o=new n,a=new WeakMap,l=new WeakMap,c={},h={},d=new WeakMap,f=[],u=null,_=!1,p=null,m=null,g=null,b=null,v=null,S=null,D=null,T=new ge(0,0,0),w=0,P=!1,M=null,y=null,I=null,N=null,C=null,V=r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS),$=!1,W=0,Z=r.getParameter(r.VERSION);Z.indexOf("WebGL")!==-1?(W=parseFloat(/^WebGL (\d)/.exec(Z)[1]),$=W>=1):Z.indexOf("OpenGL ES")!==-1&&(W=parseFloat(/^OpenGL ES (\d)/.exec(Z)[1]),$=W>=2);let z=null,U={},R=r.getParameter(r.SCISSOR_BOX),at=r.getParameter(r.VIEWPORT),_t=new Qe().fromArray(R),Ut=new Qe().fromArray(at);function X(k,Q,st,mt){let gt=new Uint8Array(4),Bt=r.createTexture();r.bindTexture(k,Bt),r.texParameteri(k,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(k,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let ne=0;ne<st;ne++)k===r.TEXTURE_3D||k===r.TEXTURE_2D_ARRAY?r.texImage3D(Q,0,r.RGBA,1,1,mt,0,r.RGBA,r.UNSIGNED_BYTE,gt):r.texImage2D(Q+ne,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,gt);return Bt}let ot={};ot[r.TEXTURE_2D]=X(r.TEXTURE_2D,r.TEXTURE_2D,1),ot[r.TEXTURE_CUBE_MAP]=X(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),ot[r.TEXTURE_2D_ARRAY]=X(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),ot[r.TEXTURE_3D]=X(r.TEXTURE_3D,r.TEXTURE_3D,1,1),i.setClear(0,0,0,1),s.setClear(1),o.setClear(0),xt(r.DEPTH_TEST),s.setFunc(Cc),Et(!1),Ht($g),xt(r.CULL_FACE),Ft(kr);function xt(k){c[k]!==!0&&(r.enable(k),c[k]=!0)}function ct(k){c[k]!==!1&&(r.disable(k),c[k]=!1)}function Rt(k,Q){return h[k]!==Q?(r.bindFramebuffer(k,Q),h[k]=Q,k===r.DRAW_FRAMEBUFFER&&(h[r.FRAMEBUFFER]=Q),k===r.FRAMEBUFFER&&(h[r.DRAW_FRAMEBUFFER]=Q),!0):!1}function kt(k,Q){let st=f,mt=!1;if(k){st=d.get(Q),st===void 0&&(st=[],d.set(Q,st));let gt=k.textures;if(st.length!==gt.length||st[0]!==r.COLOR_ATTACHMENT0){for(let Bt=0,ne=gt.length;Bt<ne;Bt++)st[Bt]=r.COLOR_ATTACHMENT0+Bt;st.length=gt.length,mt=!0}}else st[0]!==r.BACK&&(st[0]=r.BACK,mt=!0);mt&&r.drawBuffers(st)}function q(k){return u!==k?(r.useProgram(k),u=k,!0):!1}let $t={[Rs]:r.FUNC_ADD,[kv]:r.FUNC_SUBTRACT,[zv]:r.FUNC_REVERSE_SUBTRACT};$t[Vv]=r.MIN,$t[Hv]=r.MAX;let It={[Gv]:r.ZERO,[Wv]:r.ONE,[Xv]:r.SRC_COLOR,[Uf]:r.SRC_ALPHA,[Kv]:r.SRC_ALPHA_SATURATE,[Jv]:r.DST_COLOR,[qv]:r.DST_ALPHA,[Yv]:r.ONE_MINUS_SRC_COLOR,[Of]:r.ONE_MINUS_SRC_ALPHA,[$v]:r.ONE_MINUS_DST_COLOR,[Zv]:r.ONE_MINUS_DST_ALPHA,[jv]:r.CONSTANT_COLOR,[Qv]:r.ONE_MINUS_CONSTANT_COLOR,[tS]:r.CONSTANT_ALPHA,[eS]:r.ONE_MINUS_CONSTANT_ALPHA};function Ft(k,Q,st,mt,gt,Bt,ne,Mt,L,rt){if(k===kr){_===!0&&(ct(r.BLEND),_=!1);return}if(_===!1&&(xt(r.BLEND),_=!0),k!==Bv){if(k!==p||rt!==P){if((m!==Rs||v!==Rs)&&(r.blendEquation(r.FUNC_ADD),m=Rs,v=Rs),rt)switch(k){case zr:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case Kg:r.blendFunc(r.ONE,r.ONE);break;case jg:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Qg:r.blendFuncSeparate(r.ZERO,r.SRC_COLOR,r.ZERO,r.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",k);break}else switch(k){case zr:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case Kg:r.blendFunc(r.SRC_ALPHA,r.ONE);break;case jg:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Qg:r.blendFunc(r.ZERO,r.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",k);break}g=null,b=null,S=null,D=null,T.set(0,0,0),w=0,p=k,P=rt}return}gt=gt||Q,Bt=Bt||st,ne=ne||mt,(Q!==m||gt!==v)&&(r.blendEquationSeparate($t[Q],$t[gt]),m=Q,v=gt),(st!==g||mt!==b||Bt!==S||ne!==D)&&(r.blendFuncSeparate(It[st],It[mt],It[Bt],It[ne]),g=st,b=mt,S=Bt,D=ne),(Mt.equals(T)===!1||L!==w)&&(r.blendColor(Mt.r,Mt.g,Mt.b,L),T.copy(Mt),w=L),p=k,P=!1}function bt(k,Q){k.side===or?ct(r.CULL_FACE):xt(r.CULL_FACE);let st=k.side===Un;Q&&(st=!st),Et(st),k.blending===zr&&k.transparent===!1?Ft(kr):Ft(k.blending,k.blendEquation,k.blendSrc,k.blendDst,k.blendEquationAlpha,k.blendSrcAlpha,k.blendDstAlpha,k.blendColor,k.blendAlpha,k.premultipliedAlpha),s.setFunc(k.depthFunc),s.setTest(k.depthTest),s.setMask(k.depthWrite),i.setMask(k.colorWrite);let mt=k.stencilWrite;o.setTest(mt),mt&&(o.setMask(k.stencilWriteMask),o.setFunc(k.stencilFunc,k.stencilRef,k.stencilFuncMask),o.setOp(k.stencilFail,k.stencilZFail,k.stencilZPass)),jt(k.polygonOffset,k.polygonOffsetFactor,k.polygonOffsetUnits),k.alphaToCoverage===!0?xt(r.SAMPLE_ALPHA_TO_COVERAGE):ct(r.SAMPLE_ALPHA_TO_COVERAGE)}function Et(k){M!==k&&(k?r.frontFace(r.CW):r.frontFace(r.CCW),M=k)}function Ht(k){k!==Uv?(xt(r.CULL_FACE),k!==y&&(k===$g?r.cullFace(r.BACK):k===Ov?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):ct(r.CULL_FACE),y=k}function G(k){k!==I&&($&&r.lineWidth(k),I=k)}function jt(k,Q,st){k?(xt(r.POLYGON_OFFSET_FILL),(N!==Q||C!==st)&&(r.polygonOffset(Q,st),N=Q,C=st)):ct(r.POLYGON_OFFSET_FILL)}function A(k){k?xt(r.SCISSOR_TEST):ct(r.SCISSOR_TEST)}function x(k){k===void 0&&(k=r.TEXTURE0+V-1),z!==k&&(r.activeTexture(k),z=k)}function F(k,Q,st){st===void 0&&(z===null?st=r.TEXTURE0+V-1:st=z);let mt=U[st];mt===void 0&&(mt={type:void 0,texture:void 0},U[st]=mt),(mt.type!==k||mt.texture!==Q)&&(z!==st&&(r.activeTexture(st),z=st),r.bindTexture(k,Q||ot[k]),mt.type=k,mt.texture=Q)}function Y(){let k=U[z];k!==void 0&&k.type!==void 0&&(r.bindTexture(k.type,null),k.type=void 0,k.texture=void 0)}function tt(){try{r.compressedTexImage2D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function it(){try{r.compressedTexImage3D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function vt(){try{r.texSubImage2D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function pt(){try{r.texSubImage3D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function lt(){try{r.compressedTexSubImage2D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function Lt(){try{r.compressedTexSubImage3D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function ht(){try{r.texStorage2D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function yt(){try{r.texStorage3D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function qt(){try{r.texImage2D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function ut(){try{r.texImage3D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function Tt(k){_t.equals(k)===!1&&(r.scissor(k.x,k.y,k.z,k.w),_t.copy(k))}function Wt(k){Ut.equals(k)===!1&&(r.viewport(k.x,k.y,k.z,k.w),Ut.copy(k))}function Zt(k,Q){let st=l.get(Q);st===void 0&&(st=new WeakMap,l.set(Q,st));let mt=st.get(k);mt===void 0&&(mt=r.getUniformBlockIndex(Q,k.name),st.set(k,mt))}function ue(k,Q){let mt=l.get(Q).get(k);a.get(Q)!==mt&&(r.uniformBlockBinding(Q,mt,k.__bindingPointIndex),a.set(Q,mt))}function Jt(){r.disable(r.BLEND),r.disable(r.CULL_FACE),r.disable(r.DEPTH_TEST),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SCISSOR_TEST),r.disable(r.STENCIL_TEST),r.disable(r.SAMPLE_ALPHA_TO_COVERAGE),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ZERO),r.blendFuncSeparate(r.ONE,r.ZERO,r.ONE,r.ZERO),r.blendColor(0,0,0,0),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0),r.depthMask(!0),r.depthFunc(r.LESS),r.clearDepth(1),r.stencilMask(4294967295),r.stencilFunc(r.ALWAYS,0,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.KEEP),r.clearStencil(0),r.cullFace(r.BACK),r.frontFace(r.CCW),r.polygonOffset(0,0),r.activeTexture(r.TEXTURE0),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),r.bindFramebuffer(r.READ_FRAMEBUFFER,null),r.useProgram(null),r.lineWidth(1),r.scissor(0,0,r.canvas.width,r.canvas.height),r.viewport(0,0,r.canvas.width,r.canvas.height),c={},z=null,U={},h={},d=new WeakMap,f=[],u=null,_=!1,p=null,m=null,g=null,b=null,v=null,S=null,D=null,T=new ge(0,0,0),w=0,P=!1,M=null,y=null,I=null,N=null,C=null,_t.set(0,0,r.canvas.width,r.canvas.height),Ut.set(0,0,r.canvas.width,r.canvas.height),i.reset(),s.reset(),o.reset()}return{buffers:{color:i,depth:s,stencil:o},enable:xt,disable:ct,bindFramebuffer:Rt,drawBuffers:kt,useProgram:q,setBlending:Ft,setMaterial:bt,setFlipSided:Et,setCullFace:Ht,setLineWidth:G,setPolygonOffset:jt,setScissorTest:A,activeTexture:x,bindTexture:F,unbindTexture:Y,compressedTexImage2D:tt,compressedTexImage3D:it,texImage2D:qt,texImage3D:ut,updateUBOMapping:Zt,uniformBlockBinding:ue,texStorage2D:ht,texStorage3D:yt,texSubImage2D:vt,texSubImage3D:pt,compressedTexSubImage2D:lt,compressedTexSubImage3D:Lt,scissor:Tt,viewport:Wt,reset:Jt}}function TE(r,t,e,n,i,s,o){let a=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new _e,h=new WeakMap,d,f=new WeakMap,u=!1;try{u=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(A,x){return u?new OffscreenCanvas(A,x):Uc("canvas")}function p(A,x,F){let Y=1,tt=jt(A);if((tt.width>F||tt.height>F)&&(Y=F/Math.max(tt.width,tt.height)),Y<1)if(typeof HTMLImageElement<"u"&&A instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&A instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&A instanceof ImageBitmap||typeof VideoFrame<"u"&&A instanceof VideoFrame){let it=Math.floor(Y*tt.width),vt=Math.floor(Y*tt.height);d===void 0&&(d=_(it,vt));let pt=x?_(it,vt):d;return pt.width=it,pt.height=vt,pt.getContext("2d").drawImage(A,0,0,it,vt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+tt.width+"x"+tt.height+") to ("+it+"x"+vt+")."),pt}else return"data"in A&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+tt.width+"x"+tt.height+")."),A;return A}function m(A){return A.generateMipmaps&&A.minFilter!==ii&&A.minFilter!==vi}function g(A){r.generateMipmap(A)}function b(A,x,F,Y,tt=!1){if(A!==null){if(r[A]!==void 0)return r[A];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+A+"'")}let it=x;if(x===r.RED&&(F===r.FLOAT&&(it=r.R32F),F===r.HALF_FLOAT&&(it=r.R16F),F===r.UNSIGNED_BYTE&&(it=r.R8)),x===r.RED_INTEGER&&(F===r.UNSIGNED_BYTE&&(it=r.R8UI),F===r.UNSIGNED_SHORT&&(it=r.R16UI),F===r.UNSIGNED_INT&&(it=r.R32UI),F===r.BYTE&&(it=r.R8I),F===r.SHORT&&(it=r.R16I),F===r.INT&&(it=r.R32I)),x===r.RG&&(F===r.FLOAT&&(it=r.RG32F),F===r.HALF_FLOAT&&(it=r.RG16F),F===r.UNSIGNED_BYTE&&(it=r.RG8)),x===r.RG_INTEGER&&(F===r.UNSIGNED_BYTE&&(it=r.RG8UI),F===r.UNSIGNED_SHORT&&(it=r.RG16UI),F===r.UNSIGNED_INT&&(it=r.RG32UI),F===r.BYTE&&(it=r.RG8I),F===r.SHORT&&(it=r.RG16I),F===r.INT&&(it=r.RG32I)),x===r.RGB&&F===r.UNSIGNED_INT_5_9_9_9_REV&&(it=r.RGB9_E5),x===r.RGBA){let vt=tt?Ic:Se.getTransfer(Y);F===r.FLOAT&&(it=r.RGBA32F),F===r.HALF_FLOAT&&(it=r.RGBA16F),F===r.UNSIGNED_BYTE&&(it=vt===Te?r.SRGB8_ALPHA8:r.RGBA8),F===r.UNSIGNED_SHORT_4_4_4_4&&(it=r.RGBA4),F===r.UNSIGNED_SHORT_5_5_5_1&&(it=r.RGB5_A1)}return(it===r.R16F||it===r.R32F||it===r.RG16F||it===r.RG32F||it===r.RGBA16F||it===r.RGBA32F)&&t.get("EXT_color_buffer_float"),it}function v(A,x){return m(A)===!0||A.isFramebufferTexture&&A.minFilter!==ii&&A.minFilter!==vi?Math.log2(Math.max(x.width,x.height))+1:A.mipmaps!==void 0&&A.mipmaps.length>0?A.mipmaps.length:A.isCompressedTexture&&Array.isArray(A.image)?x.mipmaps.length:1}function S(A){let x=A.target;x.removeEventListener("dispose",S),T(x),x.isVideoTexture&&h.delete(x)}function D(A){let x=A.target;x.removeEventListener("dispose",D),P(x)}function T(A){let x=n.get(A);if(x.__webglInit===void 0)return;let F=A.source,Y=f.get(F);if(Y){let tt=Y[x.__cacheKey];tt.usedTimes--,tt.usedTimes===0&&w(A),Object.keys(Y).length===0&&f.delete(F)}n.remove(A)}function w(A){let x=n.get(A);r.deleteTexture(x.__webglTexture);let F=A.source,Y=f.get(F);delete Y[x.__cacheKey],o.memory.textures--}function P(A){let x=n.get(A);if(A.depthTexture&&A.depthTexture.dispose(),A.isWebGLCubeRenderTarget)for(let Y=0;Y<6;Y++){if(Array.isArray(x.__webglFramebuffer[Y]))for(let tt=0;tt<x.__webglFramebuffer[Y].length;tt++)r.deleteFramebuffer(x.__webglFramebuffer[Y][tt]);else r.deleteFramebuffer(x.__webglFramebuffer[Y]);x.__webglDepthbuffer&&r.deleteRenderbuffer(x.__webglDepthbuffer[Y])}else{if(Array.isArray(x.__webglFramebuffer))for(let Y=0;Y<x.__webglFramebuffer.length;Y++)r.deleteFramebuffer(x.__webglFramebuffer[Y]);else r.deleteFramebuffer(x.__webglFramebuffer);if(x.__webglDepthbuffer&&r.deleteRenderbuffer(x.__webglDepthbuffer),x.__webglMultisampledFramebuffer&&r.deleteFramebuffer(x.__webglMultisampledFramebuffer),x.__webglColorRenderbuffer)for(let Y=0;Y<x.__webglColorRenderbuffer.length;Y++)x.__webglColorRenderbuffer[Y]&&r.deleteRenderbuffer(x.__webglColorRenderbuffer[Y]);x.__webglDepthRenderbuffer&&r.deleteRenderbuffer(x.__webglDepthRenderbuffer)}let F=A.textures;for(let Y=0,tt=F.length;Y<tt;Y++){let it=n.get(F[Y]);it.__webglTexture&&(r.deleteTexture(it.__webglTexture),o.memory.textures--),n.remove(F[Y])}n.remove(A)}let M=0;function y(){M=0}function I(){let A=M;return A>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+A+" texture units while this GPU supports only "+i.maxTextures),M+=1,A}function N(A){let x=[];return x.push(A.wrapS),x.push(A.wrapT),x.push(A.wrapR||0),x.push(A.magFilter),x.push(A.minFilter),x.push(A.anisotropy),x.push(A.internalFormat),x.push(A.format),x.push(A.type),x.push(A.generateMipmaps),x.push(A.premultiplyAlpha),x.push(A.flipY),x.push(A.unpackAlignment),x.push(A.colorSpace),x.join()}function C(A,x){let F=n.get(A);if(A.isVideoTexture&&Ht(A),A.isRenderTargetTexture===!1&&A.version>0&&F.__version!==A.version){let Y=A.image;if(Y===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Y.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{_t(F,A,x);return}}e.bindTexture(r.TEXTURE_2D,F.__webglTexture,r.TEXTURE0+x)}function V(A,x){let F=n.get(A);if(A.version>0&&F.__version!==A.version){_t(F,A,x);return}e.bindTexture(r.TEXTURE_2D_ARRAY,F.__webglTexture,r.TEXTURE0+x)}function $(A,x){let F=n.get(A);if(A.version>0&&F.__version!==A.version){_t(F,A,x);return}e.bindTexture(r.TEXTURE_3D,F.__webglTexture,r.TEXTURE0+x)}function W(A,x){let F=n.get(A);if(A.version>0&&F.__version!==A.version){Ut(F,A,x);return}e.bindTexture(r.TEXTURE_CUBE_MAP,F.__webglTexture,r.TEXTURE0+x)}let Z={[zf]:r.REPEAT,[Is]:r.CLAMP_TO_EDGE,[Vf]:r.MIRRORED_REPEAT},z={[ii]:r.NEAREST,[xS]:r.NEAREST_MIPMAP_NEAREST,[rc]:r.NEAREST_MIPMAP_LINEAR,[vi]:r.LINEAR,[ef]:r.LINEAR_MIPMAP_NEAREST,[Ls]:r.LINEAR_MIPMAP_LINEAR},U={[LS]:r.NEVER,[kS]:r.ALWAYS,[FS]:r.LESS,[I0]:r.LEQUAL,[NS]:r.EQUAL,[BS]:r.GEQUAL,[US]:r.GREATER,[OS]:r.NOTEQUAL};function R(A,x){if(x.type===Or&&t.has("OES_texture_float_linear")===!1&&(x.magFilter===vi||x.magFilter===ef||x.magFilter===rc||x.magFilter===Ls||x.minFilter===vi||x.minFilter===ef||x.minFilter===rc||x.minFilter===Ls)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),r.texParameteri(A,r.TEXTURE_WRAP_S,Z[x.wrapS]),r.texParameteri(A,r.TEXTURE_WRAP_T,Z[x.wrapT]),(A===r.TEXTURE_3D||A===r.TEXTURE_2D_ARRAY)&&r.texParameteri(A,r.TEXTURE_WRAP_R,Z[x.wrapR]),r.texParameteri(A,r.TEXTURE_MAG_FILTER,z[x.magFilter]),r.texParameteri(A,r.TEXTURE_MIN_FILTER,z[x.minFilter]),x.compareFunction&&(r.texParameteri(A,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(A,r.TEXTURE_COMPARE_FUNC,U[x.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(x.magFilter===ii||x.minFilter!==rc&&x.minFilter!==Ls||x.type===Or&&t.has("OES_texture_float_linear")===!1)return;if(x.anisotropy>1||n.get(x).__currentAnisotropy){let F=t.get("EXT_texture_filter_anisotropic");r.texParameterf(A,F.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(x.anisotropy,i.getMaxAnisotropy())),n.get(x).__currentAnisotropy=x.anisotropy}}}function at(A,x){let F=!1;A.__webglInit===void 0&&(A.__webglInit=!0,x.addEventListener("dispose",S));let Y=x.source,tt=f.get(Y);tt===void 0&&(tt={},f.set(Y,tt));let it=N(x);if(it!==A.__cacheKey){tt[it]===void 0&&(tt[it]={texture:r.createTexture(),usedTimes:0},o.memory.textures++,F=!0),tt[it].usedTimes++;let vt=tt[A.__cacheKey];vt!==void 0&&(tt[A.__cacheKey].usedTimes--,vt.usedTimes===0&&w(x)),A.__cacheKey=it,A.__webglTexture=tt[it].texture}return F}function _t(A,x,F){let Y=r.TEXTURE_2D;(x.isDataArrayTexture||x.isCompressedArrayTexture)&&(Y=r.TEXTURE_2D_ARRAY),x.isData3DTexture&&(Y=r.TEXTURE_3D);let tt=at(A,x),it=x.source;e.bindTexture(Y,A.__webglTexture,r.TEXTURE0+F);let vt=n.get(it);if(it.version!==vt.__version||tt===!0){e.activeTexture(r.TEXTURE0+F);let pt=Se.getPrimaries(Se.workingColorSpace),lt=x.colorSpace===Ur?null:Se.getPrimaries(x.colorSpace),Lt=x.colorSpace===Ur||pt===lt?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,x.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,x.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Lt);let ht=p(x.image,!1,i.maxTextureSize);ht=G(x,ht);let yt=s.convert(x.format,x.colorSpace),qt=s.convert(x.type),ut=b(x.internalFormat,yt,qt,x.colorSpace,x.isVideoTexture);R(Y,x);let Tt,Wt=x.mipmaps,Zt=x.isVideoTexture!==!0,ue=vt.__version===void 0||tt===!0,Jt=it.dataReady,k=v(x,ht);if(x.isDepthTexture)ut=r.DEPTH_COMPONENT16,x.type===Or?ut=r.DEPTH_COMPONENT32F:x.type===Ho?ut=r.DEPTH_COMPONENT24:x.type===Qa&&(ut=r.DEPTH24_STENCIL8),ue&&(Zt?e.texStorage2D(r.TEXTURE_2D,1,ut,ht.width,ht.height):e.texImage2D(r.TEXTURE_2D,0,ut,ht.width,ht.height,0,yt,qt,null));else if(x.isDataTexture)if(Wt.length>0){Zt&&ue&&e.texStorage2D(r.TEXTURE_2D,k,ut,Wt[0].width,Wt[0].height);for(let Q=0,st=Wt.length;Q<st;Q++)Tt=Wt[Q],Zt?Jt&&e.texSubImage2D(r.TEXTURE_2D,Q,0,0,Tt.width,Tt.height,yt,qt,Tt.data):e.texImage2D(r.TEXTURE_2D,Q,ut,Tt.width,Tt.height,0,yt,qt,Tt.data);x.generateMipmaps=!1}else Zt?(ue&&e.texStorage2D(r.TEXTURE_2D,k,ut,ht.width,ht.height),Jt&&e.texSubImage2D(r.TEXTURE_2D,0,0,0,ht.width,ht.height,yt,qt,ht.data)):e.texImage2D(r.TEXTURE_2D,0,ut,ht.width,ht.height,0,yt,qt,ht.data);else if(x.isCompressedTexture)if(x.isCompressedArrayTexture){Zt&&ue&&e.texStorage3D(r.TEXTURE_2D_ARRAY,k,ut,Wt[0].width,Wt[0].height,ht.depth);for(let Q=0,st=Wt.length;Q<st;Q++)Tt=Wt[Q],x.format!==Ui?yt!==null?Zt?Jt&&e.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,Q,0,0,0,Tt.width,Tt.height,ht.depth,yt,Tt.data,0,0):e.compressedTexImage3D(r.TEXTURE_2D_ARRAY,Q,ut,Tt.width,Tt.height,ht.depth,0,Tt.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Zt?Jt&&e.texSubImage3D(r.TEXTURE_2D_ARRAY,Q,0,0,0,Tt.width,Tt.height,ht.depth,yt,qt,Tt.data):e.texImage3D(r.TEXTURE_2D_ARRAY,Q,ut,Tt.width,Tt.height,ht.depth,0,yt,qt,Tt.data)}else{Zt&&ue&&e.texStorage2D(r.TEXTURE_2D,k,ut,Wt[0].width,Wt[0].height);for(let Q=0,st=Wt.length;Q<st;Q++)Tt=Wt[Q],x.format!==Ui?yt!==null?Zt?Jt&&e.compressedTexSubImage2D(r.TEXTURE_2D,Q,0,0,Tt.width,Tt.height,yt,Tt.data):e.compressedTexImage2D(r.TEXTURE_2D,Q,ut,Tt.width,Tt.height,0,Tt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Zt?Jt&&e.texSubImage2D(r.TEXTURE_2D,Q,0,0,Tt.width,Tt.height,yt,qt,Tt.data):e.texImage2D(r.TEXTURE_2D,Q,ut,Tt.width,Tt.height,0,yt,qt,Tt.data)}else if(x.isDataArrayTexture)Zt?(ue&&e.texStorage3D(r.TEXTURE_2D_ARRAY,k,ut,ht.width,ht.height,ht.depth),Jt&&e.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,ht.width,ht.height,ht.depth,yt,qt,ht.data)):e.texImage3D(r.TEXTURE_2D_ARRAY,0,ut,ht.width,ht.height,ht.depth,0,yt,qt,ht.data);else if(x.isData3DTexture)Zt?(ue&&e.texStorage3D(r.TEXTURE_3D,k,ut,ht.width,ht.height,ht.depth),Jt&&e.texSubImage3D(r.TEXTURE_3D,0,0,0,0,ht.width,ht.height,ht.depth,yt,qt,ht.data)):e.texImage3D(r.TEXTURE_3D,0,ut,ht.width,ht.height,ht.depth,0,yt,qt,ht.data);else if(x.isFramebufferTexture){if(ue)if(Zt)e.texStorage2D(r.TEXTURE_2D,k,ut,ht.width,ht.height);else{let Q=ht.width,st=ht.height;for(let mt=0;mt<k;mt++)e.texImage2D(r.TEXTURE_2D,mt,ut,Q,st,0,yt,qt,null),Q>>=1,st>>=1}}else if(Wt.length>0){if(Zt&&ue){let Q=jt(Wt[0]);e.texStorage2D(r.TEXTURE_2D,k,ut,Q.width,Q.height)}for(let Q=0,st=Wt.length;Q<st;Q++)Tt=Wt[Q],Zt?Jt&&e.texSubImage2D(r.TEXTURE_2D,Q,0,0,yt,qt,Tt):e.texImage2D(r.TEXTURE_2D,Q,ut,yt,qt,Tt);x.generateMipmaps=!1}else if(Zt){if(ue){let Q=jt(ht);e.texStorage2D(r.TEXTURE_2D,k,ut,Q.width,Q.height)}Jt&&e.texSubImage2D(r.TEXTURE_2D,0,0,0,yt,qt,ht)}else e.texImage2D(r.TEXTURE_2D,0,ut,yt,qt,ht);m(x)&&g(Y),vt.__version=it.version,x.onUpdate&&x.onUpdate(x)}A.__version=x.version}function Ut(A,x,F){if(x.image.length!==6)return;let Y=at(A,x),tt=x.source;e.bindTexture(r.TEXTURE_CUBE_MAP,A.__webglTexture,r.TEXTURE0+F);let it=n.get(tt);if(tt.version!==it.__version||Y===!0){e.activeTexture(r.TEXTURE0+F);let vt=Se.getPrimaries(Se.workingColorSpace),pt=x.colorSpace===Ur?null:Se.getPrimaries(x.colorSpace),lt=x.colorSpace===Ur||vt===pt?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,x.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,x.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,lt);let Lt=x.isCompressedTexture||x.image[0].isCompressedTexture,ht=x.image[0]&&x.image[0].isDataTexture,yt=[];for(let st=0;st<6;st++)!Lt&&!ht?yt[st]=p(x.image[st],!0,i.maxCubemapSize):yt[st]=ht?x.image[st].image:x.image[st],yt[st]=G(x,yt[st]);let qt=yt[0],ut=s.convert(x.format,x.colorSpace),Tt=s.convert(x.type),Wt=b(x.internalFormat,ut,Tt,x.colorSpace),Zt=x.isVideoTexture!==!0,ue=it.__version===void 0||Y===!0,Jt=tt.dataReady,k=v(x,qt);R(r.TEXTURE_CUBE_MAP,x);let Q;if(Lt){Zt&&ue&&e.texStorage2D(r.TEXTURE_CUBE_MAP,k,Wt,qt.width,qt.height);for(let st=0;st<6;st++){Q=yt[st].mipmaps;for(let mt=0;mt<Q.length;mt++){let gt=Q[mt];x.format!==Ui?ut!==null?Zt?Jt&&e.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt,0,0,gt.width,gt.height,ut,gt.data):e.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt,Wt,gt.width,gt.height,0,gt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):Zt?Jt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt,0,0,gt.width,gt.height,ut,Tt,gt.data):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt,Wt,gt.width,gt.height,0,ut,Tt,gt.data)}}}else{if(Q=x.mipmaps,Zt&&ue){Q.length>0&&k++;let st=jt(yt[0]);e.texStorage2D(r.TEXTURE_CUBE_MAP,k,Wt,st.width,st.height)}for(let st=0;st<6;st++)if(ht){Zt?Jt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,0,0,0,yt[st].width,yt[st].height,ut,Tt,yt[st].data):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,0,Wt,yt[st].width,yt[st].height,0,ut,Tt,yt[st].data);for(let mt=0;mt<Q.length;mt++){let Bt=Q[mt].image[st].image;Zt?Jt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt+1,0,0,Bt.width,Bt.height,ut,Tt,Bt.data):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt+1,Wt,Bt.width,Bt.height,0,ut,Tt,Bt.data)}}else{Zt?Jt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,0,0,0,ut,Tt,yt[st]):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,0,Wt,ut,Tt,yt[st]);for(let mt=0;mt<Q.length;mt++){let gt=Q[mt];Zt?Jt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt+1,0,0,ut,Tt,gt.image[st]):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt+1,Wt,ut,Tt,gt.image[st])}}}m(x)&&g(r.TEXTURE_CUBE_MAP),it.__version=tt.version,x.onUpdate&&x.onUpdate(x)}A.__version=x.version}function X(A,x,F,Y,tt,it){let vt=s.convert(F.format,F.colorSpace),pt=s.convert(F.type),lt=b(F.internalFormat,vt,pt,F.colorSpace);if(!n.get(x).__hasExternalTextures){let ht=Math.max(1,x.width>>it),yt=Math.max(1,x.height>>it);tt===r.TEXTURE_3D||tt===r.TEXTURE_2D_ARRAY?e.texImage3D(tt,it,lt,ht,yt,x.depth,0,vt,pt,null):e.texImage2D(tt,it,lt,ht,yt,0,vt,pt,null)}e.bindFramebuffer(r.FRAMEBUFFER,A),Et(x)?a.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,Y,tt,n.get(F).__webglTexture,0,bt(x)):(tt===r.TEXTURE_2D||tt>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&tt<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,Y,tt,n.get(F).__webglTexture,it),e.bindFramebuffer(r.FRAMEBUFFER,null)}function ot(A,x,F){if(r.bindRenderbuffer(r.RENDERBUFFER,A),x.depthBuffer&&!x.stencilBuffer){let Y=r.DEPTH_COMPONENT24;if(F||Et(x)){let tt=x.depthTexture;tt&&tt.isDepthTexture&&(tt.type===Or?Y=r.DEPTH_COMPONENT32F:tt.type===Ho&&(Y=r.DEPTH_COMPONENT24));let it=bt(x);Et(x)?a.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,it,Y,x.width,x.height):r.renderbufferStorageMultisample(r.RENDERBUFFER,it,Y,x.width,x.height)}else r.renderbufferStorage(r.RENDERBUFFER,Y,x.width,x.height);r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,A)}else if(x.depthBuffer&&x.stencilBuffer){let Y=bt(x);F&&Et(x)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,Y,r.DEPTH24_STENCIL8,x.width,x.height):Et(x)?a.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Y,r.DEPTH24_STENCIL8,x.width,x.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,x.width,x.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,A)}else{let Y=x.textures;for(let tt=0;tt<Y.length;tt++){let it=Y[tt],vt=s.convert(it.format,it.colorSpace),pt=s.convert(it.type),lt=b(it.internalFormat,vt,pt,it.colorSpace),Lt=bt(x);F&&Et(x)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,Lt,lt,x.width,x.height):Et(x)?a.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Lt,lt,x.width,x.height):r.renderbufferStorage(r.RENDERBUFFER,lt,x.width,x.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}function xt(A,x){if(x&&x.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(r.FRAMEBUFFER,A),!(x.depthTexture&&x.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.get(x.depthTexture).__webglTexture||x.depthTexture.image.width!==x.width||x.depthTexture.image.height!==x.height)&&(x.depthTexture.image.width=x.width,x.depthTexture.image.height=x.height,x.depthTexture.needsUpdate=!0),C(x.depthTexture,0);let Y=n.get(x.depthTexture).__webglTexture,tt=bt(x);if(x.depthTexture.format===Oo)Et(x)?a.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,Y,0,tt):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,Y,0);else if(x.depthTexture.format===Ja)Et(x)?a.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,Y,0,tt):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,Y,0);else throw new Error("Unknown depthTexture format")}function ct(A){let x=n.get(A),F=A.isWebGLCubeRenderTarget===!0;if(A.depthTexture&&!x.__autoAllocateDepthBuffer){if(F)throw new Error("target.depthTexture not supported in Cube render targets");xt(x.__webglFramebuffer,A)}else if(F){x.__webglDepthbuffer=[];for(let Y=0;Y<6;Y++)e.bindFramebuffer(r.FRAMEBUFFER,x.__webglFramebuffer[Y]),x.__webglDepthbuffer[Y]=r.createRenderbuffer(),ot(x.__webglDepthbuffer[Y],A,!1)}else e.bindFramebuffer(r.FRAMEBUFFER,x.__webglFramebuffer),x.__webglDepthbuffer=r.createRenderbuffer(),ot(x.__webglDepthbuffer,A,!1);e.bindFramebuffer(r.FRAMEBUFFER,null)}function Rt(A,x,F){let Y=n.get(A);x!==void 0&&X(Y.__webglFramebuffer,A,A.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),F!==void 0&&ct(A)}function kt(A){let x=A.texture,F=n.get(A),Y=n.get(x);A.addEventListener("dispose",D);let tt=A.textures,it=A.isWebGLCubeRenderTarget===!0,vt=tt.length>1;if(vt||(Y.__webglTexture===void 0&&(Y.__webglTexture=r.createTexture()),Y.__version=x.version,o.memory.textures++),it){F.__webglFramebuffer=[];for(let pt=0;pt<6;pt++)if(x.mipmaps&&x.mipmaps.length>0){F.__webglFramebuffer[pt]=[];for(let lt=0;lt<x.mipmaps.length;lt++)F.__webglFramebuffer[pt][lt]=r.createFramebuffer()}else F.__webglFramebuffer[pt]=r.createFramebuffer()}else{if(x.mipmaps&&x.mipmaps.length>0){F.__webglFramebuffer=[];for(let pt=0;pt<x.mipmaps.length;pt++)F.__webglFramebuffer[pt]=r.createFramebuffer()}else F.__webglFramebuffer=r.createFramebuffer();if(vt)for(let pt=0,lt=tt.length;pt<lt;pt++){let Lt=n.get(tt[pt]);Lt.__webglTexture===void 0&&(Lt.__webglTexture=r.createTexture(),o.memory.textures++)}if(A.samples>0&&Et(A)===!1){F.__webglMultisampledFramebuffer=r.createFramebuffer(),F.__webglColorRenderbuffer=[],e.bindFramebuffer(r.FRAMEBUFFER,F.__webglMultisampledFramebuffer);for(let pt=0;pt<tt.length;pt++){let lt=tt[pt];F.__webglColorRenderbuffer[pt]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,F.__webglColorRenderbuffer[pt]);let Lt=s.convert(lt.format,lt.colorSpace),ht=s.convert(lt.type),yt=b(lt.internalFormat,Lt,ht,lt.colorSpace,A.isXRRenderTarget===!0),qt=bt(A);r.renderbufferStorageMultisample(r.RENDERBUFFER,qt,yt,A.width,A.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+pt,r.RENDERBUFFER,F.__webglColorRenderbuffer[pt])}r.bindRenderbuffer(r.RENDERBUFFER,null),A.depthBuffer&&(F.__webglDepthRenderbuffer=r.createRenderbuffer(),ot(F.__webglDepthRenderbuffer,A,!0)),e.bindFramebuffer(r.FRAMEBUFFER,null)}}if(it){e.bindTexture(r.TEXTURE_CUBE_MAP,Y.__webglTexture),R(r.TEXTURE_CUBE_MAP,x);for(let pt=0;pt<6;pt++)if(x.mipmaps&&x.mipmaps.length>0)for(let lt=0;lt<x.mipmaps.length;lt++)X(F.__webglFramebuffer[pt][lt],A,x,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,lt);else X(F.__webglFramebuffer[pt],A,x,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,0);m(x)&&g(r.TEXTURE_CUBE_MAP),e.unbindTexture()}else if(vt){for(let pt=0,lt=tt.length;pt<lt;pt++){let Lt=tt[pt],ht=n.get(Lt);e.bindTexture(r.TEXTURE_2D,ht.__webglTexture),R(r.TEXTURE_2D,Lt),X(F.__webglFramebuffer,A,Lt,r.COLOR_ATTACHMENT0+pt,r.TEXTURE_2D,0),m(Lt)&&g(r.TEXTURE_2D)}e.unbindTexture()}else{let pt=r.TEXTURE_2D;if((A.isWebGL3DRenderTarget||A.isWebGLArrayRenderTarget)&&(pt=A.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),e.bindTexture(pt,Y.__webglTexture),R(pt,x),x.mipmaps&&x.mipmaps.length>0)for(let lt=0;lt<x.mipmaps.length;lt++)X(F.__webglFramebuffer[lt],A,x,r.COLOR_ATTACHMENT0,pt,lt);else X(F.__webglFramebuffer,A,x,r.COLOR_ATTACHMENT0,pt,0);m(x)&&g(pt),e.unbindTexture()}A.depthBuffer&&ct(A)}function q(A){let x=A.textures;for(let F=0,Y=x.length;F<Y;F++){let tt=x[F];if(m(tt)){let it=A.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D,vt=n.get(tt).__webglTexture;e.bindTexture(it,vt),g(it),e.unbindTexture()}}}let $t=[],It=[];function Ft(A){if(A.samples>0){if(Et(A)===!1){let x=A.textures,F=A.width,Y=A.height,tt=r.COLOR_BUFFER_BIT,it=A.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,vt=n.get(A),pt=x.length>1;if(pt)for(let lt=0;lt<x.length;lt++)e.bindFramebuffer(r.FRAMEBUFFER,vt.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+lt,r.RENDERBUFFER,null),e.bindFramebuffer(r.FRAMEBUFFER,vt.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+lt,r.TEXTURE_2D,null,0);e.bindFramebuffer(r.READ_FRAMEBUFFER,vt.__webglMultisampledFramebuffer),e.bindFramebuffer(r.DRAW_FRAMEBUFFER,vt.__webglFramebuffer);for(let lt=0;lt<x.length;lt++){if(A.resolveDepthBuffer&&(A.depthBuffer&&(tt|=r.DEPTH_BUFFER_BIT),A.stencilBuffer&&A.resolveStencilBuffer&&(tt|=r.STENCIL_BUFFER_BIT)),pt){r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,vt.__webglColorRenderbuffer[lt]);let Lt=n.get(x[lt]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,Lt,0)}r.blitFramebuffer(0,0,F,Y,0,0,F,Y,tt,r.NEAREST),l===!0&&($t.length=0,It.length=0,$t.push(r.COLOR_ATTACHMENT0+lt),A.depthBuffer&&A.resolveDepthBuffer===!1&&($t.push(it),It.push(it),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,It)),r.invalidateFramebuffer(r.READ_FRAMEBUFFER,$t))}if(e.bindFramebuffer(r.READ_FRAMEBUFFER,null),e.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),pt)for(let lt=0;lt<x.length;lt++){e.bindFramebuffer(r.FRAMEBUFFER,vt.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+lt,r.RENDERBUFFER,vt.__webglColorRenderbuffer[lt]);let Lt=n.get(x[lt]).__webglTexture;e.bindFramebuffer(r.FRAMEBUFFER,vt.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+lt,r.TEXTURE_2D,Lt,0)}e.bindFramebuffer(r.DRAW_FRAMEBUFFER,vt.__webglMultisampledFramebuffer)}else if(A.depthBuffer&&A.resolveDepthBuffer===!1&&l){let x=A.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT;r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[x])}}}function bt(A){return Math.min(i.maxSamples,A.samples)}function Et(A){let x=n.get(A);return A.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&x.__useRenderToTexture!==!1}function Ht(A){let x=o.render.frame;h.get(A)!==x&&(h.set(A,x),A.update())}function G(A,x){let F=A.colorSpace,Y=A.format,tt=A.type;return A.isCompressedTexture===!0||A.isVideoTexture===!0||F!==Yr&&F!==Ur&&(Se.getTransfer(F)===Te?(Y!==Ui||tt!==Gr)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",F)),x}function jt(A){return typeof HTMLImageElement<"u"&&A instanceof HTMLImageElement?(c.width=A.naturalWidth||A.width,c.height=A.naturalHeight||A.height):typeof VideoFrame<"u"&&A instanceof VideoFrame?(c.width=A.displayWidth,c.height=A.displayHeight):(c.width=A.width,c.height=A.height),c}this.allocateTextureUnit=I,this.resetTextureUnits=y,this.setTexture2D=C,this.setTexture2DArray=V,this.setTexture3D=$,this.setTextureCube=W,this.rebindTextures=Rt,this.setupRenderTarget=kt,this.updateRenderTargetMipmap=q,this.updateMultisampleRenderTarget=Ft,this.setupDepthRenderbuffer=ct,this.setupFrameBufferTexture=X,this.useMultisampledRTT=Et}function AE(r,t){function e(n,i=Ur){let s,o=Se.getTransfer(i);if(n===Gr)return r.UNSIGNED_BYTE;if(n===A0)return r.UNSIGNED_SHORT_4_4_4_4;if(n===D0)return r.UNSIGNED_SHORT_5_5_5_1;if(n===SS)return r.UNSIGNED_INT_5_9_9_9_REV;if(n===yS)return r.BYTE;if(n===vS)return r.SHORT;if(n===E0)return r.UNSIGNED_SHORT;if(n===T0)return r.INT;if(n===Ho)return r.UNSIGNED_INT;if(n===Or)return r.FLOAT;if(n===iu)return r.HALF_FLOAT;if(n===MS)return r.ALPHA;if(n===bS)return r.RGB;if(n===Ui)return r.RGBA;if(n===wS)return r.LUMINANCE;if(n===ES)return r.LUMINANCE_ALPHA;if(n===Oo)return r.DEPTH_COMPONENT;if(n===Ja)return r.DEPTH_STENCIL;if(n===TS)return r.RED;if(n===C0)return r.RED_INTEGER;if(n===AS)return r.RG;if(n===R0)return r.RG_INTEGER;if(n===P0)return r.RGBA_INTEGER;if(n===nf||n===rf||n===sf||n===of)if(o===Te)if(s=t.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===nf)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===rf)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===sf)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===of)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=t.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===nf)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===rf)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===sf)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===of)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===t_||n===e_||n===n_||n===i_)if(s=t.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===t_)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===e_)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===n_)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===i_)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===r_||n===s_||n===o_)if(s=t.get("WEBGL_compressed_texture_etc"),s!==null){if(n===r_||n===s_)return o===Te?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===o_)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===a_||n===l_||n===c_||n===u_||n===h_||n===f_||n===d_||n===p_||n===m_||n===g_||n===__||n===x_||n===y_||n===v_)if(s=t.get("WEBGL_compressed_texture_astc"),s!==null){if(n===a_)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===l_)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===c_)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===u_)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===h_)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===f_)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===d_)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===p_)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===m_)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===g_)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===__)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===x_)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===y_)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===v_)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===af||n===S_||n===M_)if(s=t.get("EXT_texture_compression_bptc"),s!==null){if(n===af)return o===Te?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===S_)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===M_)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===DS||n===b_||n===w_||n===E_)if(s=t.get("EXT_texture_compression_rgtc"),s!==null){if(n===af)return s.COMPRESSED_RED_RGTC1_EXT;if(n===b_)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===w_)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===E_)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===Qa?r.UNSIGNED_INT_24_8:r[n]!==void 0?r[n]:null}return{convert:e}}var nd=class extends Dn{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}},Br=class extends gn{constructor(){super(),this.isGroup=!0,this.type="Group"}},DE={type:"move"},Za=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Br,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Br,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new nt,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new nt),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Br,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new nt,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new nt),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){let e=this._hand;if(e)for(let n of t.hand.values())this._getHandJoint(e,n)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,n){let i=null,s=null,o=null,a=this._targetRay,l=this._grip,c=this._hand;if(t&&e.session.visibilityState!=="visible-blurred"){if(c&&t.hand){o=!0;for(let p of t.hand.values()){let m=e.getJointPose(p,n),g=this._getHandJoint(c,p);m!==null&&(g.matrix.fromArray(m.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=m.radius),g.visible=m!==null}let h=c.joints["index-finger-tip"],d=c.joints["thumb-tip"],f=h.position.distanceTo(d.position),u=.02,_=.005;c.inputState.pinching&&f>u+_?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&f<=u-_&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(s=e.getPose(t.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(i=e.getPose(t.targetRaySpace,n),i===null&&s!==null&&(i=s),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(DE)))}return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(t,e){if(t.joints[e.jointName]===void 0){let n=new Br;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}},CE=`
|
|
3797
|
+
}`;function wE(r,t,e){let n=new Ka,i=new _e,s=new _e,o=new Qe,a=new td({depthPacking:RS}),l=new ed,c={},h=e.maxTextureSize,f={[Hr]:Un,[Un]:Hr,[or]:or},d=new ai({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new _e},radius:{value:4}},vertexShader:ME,fragmentShader:bE}),u=d.clone();u.defines.HORIZONTAL_PASS=1;let _=new Oi;_.setAttribute("position",new ri(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let m=new Si(_,d),p=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=M0;let g=this.type;this.render=function(T,w,P){if(p.enabled===!1||p.autoUpdate===!1&&p.needsUpdate===!1||T.length===0)return;let M=r.getRenderTarget(),y=r.getActiveCubeFace(),I=r.getActiveMipmapLevel(),N=r.state;N.setBlending(kr),N.buffers.color.setClear(1,1,1,1),N.buffers.depth.setTest(!0),N.setScissorTest(!1);let C=g!==rr&&this.type===rr,V=g===rr&&this.type!==rr;for(let $=0,W=T.length;$<W;$++){let Z=T[$],z=Z.shadow;if(z===void 0){console.warn("THREE.WebGLShadowMap:",Z,"has no shadow.");continue}if(z.autoUpdate===!1&&z.needsUpdate===!1)continue;i.copy(z.mapSize);let U=z.getFrameExtents();if(i.multiply(U),s.copy(z.mapSize),(i.x>h||i.y>h)&&(i.x>h&&(s.x=Math.floor(h/U.x),i.x=s.x*U.x,z.mapSize.x=s.x),i.y>h&&(s.y=Math.floor(h/U.y),i.y=s.y*U.y,z.mapSize.y=s.y)),z.map===null||C===!0||V===!0){let at=this.type!==rr?{minFilter:ii,magFilter:ii}:{};z.map!==null&&z.map.dispose(),z.map=new lr(i.x,i.y,at),z.map.texture.name=Z.name+".shadowMap",z.camera.updateProjectionMatrix()}r.setRenderTarget(z.map),r.clear();let R=z.getViewportCount();for(let at=0;at<R;at++){let _t=z.getViewport(at);o.set(s.x*_t.x,s.y*_t.y,s.x*_t.z,s.y*_t.w),N.viewport(o),z.updateMatrices(Z,at),n=z.getFrustum(),S(w,P,z.camera,Z,this.type)}z.isPointLightShadow!==!0&&this.type===rr&&b(z,P),z.needsUpdate=!1}g=this.type,p.needsUpdate=!1,r.setRenderTarget(M,y,I)};function b(T,w){let P=t.update(m);d.defines.VSM_SAMPLES!==T.blurSamples&&(d.defines.VSM_SAMPLES=T.blurSamples,u.defines.VSM_SAMPLES=T.blurSamples,d.needsUpdate=!0,u.needsUpdate=!0),T.mapPass===null&&(T.mapPass=new lr(i.x,i.y)),d.uniforms.shadow_pass.value=T.map.texture,d.uniforms.resolution.value=T.mapSize,d.uniforms.radius.value=T.radius,r.setRenderTarget(T.mapPass),r.clear(),r.renderBufferDirect(w,null,P,d,m,null),u.uniforms.shadow_pass.value=T.mapPass.texture,u.uniforms.resolution.value=T.mapSize,u.uniforms.radius.value=T.radius,r.setRenderTarget(T.map),r.clear(),r.renderBufferDirect(w,null,P,u,m,null)}function v(T,w,P,M){let y=null,I=P.isPointLight===!0?T.customDistanceMaterial:T.customDepthMaterial;if(I!==void 0)y=I;else if(y=P.isPointLight===!0?l:a,r.localClippingEnabled&&w.clipShadows===!0&&Array.isArray(w.clippingPlanes)&&w.clippingPlanes.length!==0||w.displacementMap&&w.displacementScale!==0||w.alphaMap&&w.alphaTest>0||w.map&&w.alphaTest>0){let N=y.uuid,C=w.uuid,V=c[N];V===void 0&&(V={},c[N]=V);let $=V[C];$===void 0&&($=y.clone(),V[C]=$,w.addEventListener("dispose",D)),y=$}if(y.visible=w.visible,y.wireframe=w.wireframe,M===rr?y.side=w.shadowSide!==null?w.shadowSide:w.side:y.side=w.shadowSide!==null?w.shadowSide:f[w.side],y.alphaMap=w.alphaMap,y.alphaTest=w.alphaTest,y.map=w.map,y.clipShadows=w.clipShadows,y.clippingPlanes=w.clippingPlanes,y.clipIntersection=w.clipIntersection,y.displacementMap=w.displacementMap,y.displacementScale=w.displacementScale,y.displacementBias=w.displacementBias,y.wireframeLinewidth=w.wireframeLinewidth,y.linewidth=w.linewidth,P.isPointLight===!0&&y.isMeshDistanceMaterial===!0){let N=r.properties.get(y);N.light=P}return y}function S(T,w,P,M,y){if(T.visible===!1)return;if(T.layers.test(w.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&y===rr)&&(!T.frustumCulled||n.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(P.matrixWorldInverse,T.matrixWorld);let C=t.update(T),V=T.material;if(Array.isArray(V)){let $=C.groups;for(let W=0,Z=$.length;W<Z;W++){let z=$[W],U=V[z.materialIndex];if(U&&U.visible){let R=v(T,U,M,y);T.onBeforeShadow(r,T,w,P,C,R,z),r.renderBufferDirect(P,null,C,R,T,z),T.onAfterShadow(r,T,w,P,C,R,z)}}}else if(V.visible){let $=v(T,V,M,y);T.onBeforeShadow(r,T,w,P,C,$,null),r.renderBufferDirect(P,null,C,$,T,null),T.onAfterShadow(r,T,w,P,C,$,null)}}let N=T.children;for(let C=0,V=N.length;C<V;C++)S(N[C],w,P,M,y)}function D(T){T.target.removeEventListener("dispose",D);for(let P in c){let M=c[P],y=T.target.uuid;y in M&&(M[y].dispose(),delete M[y])}}}function EE(r){function t(){let k=!1,Q=new Qe,st=null,mt=new Qe(0,0,0,0);return{setMask:function(gt){st!==gt&&!k&&(r.colorMask(gt,gt,gt,gt),st=gt)},setLocked:function(gt){k=gt},setClear:function(gt,Bt,ne,Mt,L){L===!0&&(gt*=Mt,Bt*=Mt,ne*=Mt),Q.set(gt,Bt,ne,Mt),mt.equals(Q)===!1&&(r.clearColor(gt,Bt,ne,Mt),mt.copy(Q))},reset:function(){k=!1,st=null,mt.set(-1,0,0,0)}}}function e(){let k=!1,Q=null,st=null,mt=null;return{setTest:function(gt){gt?xt(r.DEPTH_TEST):ct(r.DEPTH_TEST)},setMask:function(gt){Q!==gt&&!k&&(r.depthMask(gt),Q=gt)},setFunc:function(gt){if(st!==gt){switch(gt){case nS:r.depthFunc(r.NEVER);break;case iS:r.depthFunc(r.ALWAYS);break;case rS:r.depthFunc(r.LESS);break;case Cc:r.depthFunc(r.LEQUAL);break;case sS:r.depthFunc(r.EQUAL);break;case oS:r.depthFunc(r.GEQUAL);break;case aS:r.depthFunc(r.GREATER);break;case lS:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}st=gt}},setLocked:function(gt){k=gt},setClear:function(gt){mt!==gt&&(r.clearDepth(gt),mt=gt)},reset:function(){k=!1,Q=null,st=null,mt=null}}}function n(){let k=!1,Q=null,st=null,mt=null,gt=null,Bt=null,ne=null,Mt=null,L=null;return{setTest:function(rt){k||(rt?xt(r.STENCIL_TEST):ct(r.STENCIL_TEST))},setMask:function(rt){Q!==rt&&!k&&(r.stencilMask(rt),Q=rt)},setFunc:function(rt,O,j){(st!==rt||mt!==O||gt!==j)&&(r.stencilFunc(rt,O,j),st=rt,mt=O,gt=j)},setOp:function(rt,O,j){(Bt!==rt||ne!==O||Mt!==j)&&(r.stencilOp(rt,O,j),Bt=rt,ne=O,Mt=j)},setLocked:function(rt){k=rt},setClear:function(rt){L!==rt&&(r.clearStencil(rt),L=rt)},reset:function(){k=!1,Q=null,st=null,mt=null,gt=null,Bt=null,ne=null,Mt=null,L=null}}}let i=new t,s=new e,o=new n,a=new WeakMap,l=new WeakMap,c={},h={},f=new WeakMap,d=[],u=null,_=!1,m=null,p=null,g=null,b=null,v=null,S=null,D=null,T=new ge(0,0,0),w=0,P=!1,M=null,y=null,I=null,N=null,C=null,V=r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS),$=!1,W=0,Z=r.getParameter(r.VERSION);Z.indexOf("WebGL")!==-1?(W=parseFloat(/^WebGL (\d)/.exec(Z)[1]),$=W>=1):Z.indexOf("OpenGL ES")!==-1&&(W=parseFloat(/^OpenGL ES (\d)/.exec(Z)[1]),$=W>=2);let z=null,U={},R=r.getParameter(r.SCISSOR_BOX),at=r.getParameter(r.VIEWPORT),_t=new Qe().fromArray(R),Ut=new Qe().fromArray(at);function X(k,Q,st,mt){let gt=new Uint8Array(4),Bt=r.createTexture();r.bindTexture(k,Bt),r.texParameteri(k,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(k,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let ne=0;ne<st;ne++)k===r.TEXTURE_3D||k===r.TEXTURE_2D_ARRAY?r.texImage3D(Q,0,r.RGBA,1,1,mt,0,r.RGBA,r.UNSIGNED_BYTE,gt):r.texImage2D(Q+ne,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,gt);return Bt}let ot={};ot[r.TEXTURE_2D]=X(r.TEXTURE_2D,r.TEXTURE_2D,1),ot[r.TEXTURE_CUBE_MAP]=X(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),ot[r.TEXTURE_2D_ARRAY]=X(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),ot[r.TEXTURE_3D]=X(r.TEXTURE_3D,r.TEXTURE_3D,1,1),i.setClear(0,0,0,1),s.setClear(1),o.setClear(0),xt(r.DEPTH_TEST),s.setFunc(Cc),Et(!1),Ht($g),xt(r.CULL_FACE),Ft(kr);function xt(k){c[k]!==!0&&(r.enable(k),c[k]=!0)}function ct(k){c[k]!==!1&&(r.disable(k),c[k]=!1)}function Rt(k,Q){return h[k]!==Q?(r.bindFramebuffer(k,Q),h[k]=Q,k===r.DRAW_FRAMEBUFFER&&(h[r.FRAMEBUFFER]=Q),k===r.FRAMEBUFFER&&(h[r.DRAW_FRAMEBUFFER]=Q),!0):!1}function kt(k,Q){let st=d,mt=!1;if(k){st=f.get(Q),st===void 0&&(st=[],f.set(Q,st));let gt=k.textures;if(st.length!==gt.length||st[0]!==r.COLOR_ATTACHMENT0){for(let Bt=0,ne=gt.length;Bt<ne;Bt++)st[Bt]=r.COLOR_ATTACHMENT0+Bt;st.length=gt.length,mt=!0}}else st[0]!==r.BACK&&(st[0]=r.BACK,mt=!0);mt&&r.drawBuffers(st)}function q(k){return u!==k?(r.useProgram(k),u=k,!0):!1}let $t={[Rs]:r.FUNC_ADD,[kv]:r.FUNC_SUBTRACT,[zv]:r.FUNC_REVERSE_SUBTRACT};$t[Vv]=r.MIN,$t[Hv]=r.MAX;let It={[Gv]:r.ZERO,[Wv]:r.ONE,[Xv]:r.SRC_COLOR,[Uf]:r.SRC_ALPHA,[Kv]:r.SRC_ALPHA_SATURATE,[Jv]:r.DST_COLOR,[qv]:r.DST_ALPHA,[Yv]:r.ONE_MINUS_SRC_COLOR,[Of]:r.ONE_MINUS_SRC_ALPHA,[$v]:r.ONE_MINUS_DST_COLOR,[Zv]:r.ONE_MINUS_DST_ALPHA,[jv]:r.CONSTANT_COLOR,[Qv]:r.ONE_MINUS_CONSTANT_COLOR,[tS]:r.CONSTANT_ALPHA,[eS]:r.ONE_MINUS_CONSTANT_ALPHA};function Ft(k,Q,st,mt,gt,Bt,ne,Mt,L,rt){if(k===kr){_===!0&&(ct(r.BLEND),_=!1);return}if(_===!1&&(xt(r.BLEND),_=!0),k!==Bv){if(k!==m||rt!==P){if((p!==Rs||v!==Rs)&&(r.blendEquation(r.FUNC_ADD),p=Rs,v=Rs),rt)switch(k){case zr:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case Kg:r.blendFunc(r.ONE,r.ONE);break;case jg:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Qg:r.blendFuncSeparate(r.ZERO,r.SRC_COLOR,r.ZERO,r.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",k);break}else switch(k){case zr:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case Kg:r.blendFunc(r.SRC_ALPHA,r.ONE);break;case jg:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Qg:r.blendFunc(r.ZERO,r.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",k);break}g=null,b=null,S=null,D=null,T.set(0,0,0),w=0,m=k,P=rt}return}gt=gt||Q,Bt=Bt||st,ne=ne||mt,(Q!==p||gt!==v)&&(r.blendEquationSeparate($t[Q],$t[gt]),p=Q,v=gt),(st!==g||mt!==b||Bt!==S||ne!==D)&&(r.blendFuncSeparate(It[st],It[mt],It[Bt],It[ne]),g=st,b=mt,S=Bt,D=ne),(Mt.equals(T)===!1||L!==w)&&(r.blendColor(Mt.r,Mt.g,Mt.b,L),T.copy(Mt),w=L),m=k,P=!1}function bt(k,Q){k.side===or?ct(r.CULL_FACE):xt(r.CULL_FACE);let st=k.side===Un;Q&&(st=!st),Et(st),k.blending===zr&&k.transparent===!1?Ft(kr):Ft(k.blending,k.blendEquation,k.blendSrc,k.blendDst,k.blendEquationAlpha,k.blendSrcAlpha,k.blendDstAlpha,k.blendColor,k.blendAlpha,k.premultipliedAlpha),s.setFunc(k.depthFunc),s.setTest(k.depthTest),s.setMask(k.depthWrite),i.setMask(k.colorWrite);let mt=k.stencilWrite;o.setTest(mt),mt&&(o.setMask(k.stencilWriteMask),o.setFunc(k.stencilFunc,k.stencilRef,k.stencilFuncMask),o.setOp(k.stencilFail,k.stencilZFail,k.stencilZPass)),jt(k.polygonOffset,k.polygonOffsetFactor,k.polygonOffsetUnits),k.alphaToCoverage===!0?xt(r.SAMPLE_ALPHA_TO_COVERAGE):ct(r.SAMPLE_ALPHA_TO_COVERAGE)}function Et(k){M!==k&&(k?r.frontFace(r.CW):r.frontFace(r.CCW),M=k)}function Ht(k){k!==Uv?(xt(r.CULL_FACE),k!==y&&(k===$g?r.cullFace(r.BACK):k===Ov?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):ct(r.CULL_FACE),y=k}function G(k){k!==I&&($&&r.lineWidth(k),I=k)}function jt(k,Q,st){k?(xt(r.POLYGON_OFFSET_FILL),(N!==Q||C!==st)&&(r.polygonOffset(Q,st),N=Q,C=st)):ct(r.POLYGON_OFFSET_FILL)}function A(k){k?xt(r.SCISSOR_TEST):ct(r.SCISSOR_TEST)}function x(k){k===void 0&&(k=r.TEXTURE0+V-1),z!==k&&(r.activeTexture(k),z=k)}function F(k,Q,st){st===void 0&&(z===null?st=r.TEXTURE0+V-1:st=z);let mt=U[st];mt===void 0&&(mt={type:void 0,texture:void 0},U[st]=mt),(mt.type!==k||mt.texture!==Q)&&(z!==st&&(r.activeTexture(st),z=st),r.bindTexture(k,Q||ot[k]),mt.type=k,mt.texture=Q)}function Y(){let k=U[z];k!==void 0&&k.type!==void 0&&(r.bindTexture(k.type,null),k.type=void 0,k.texture=void 0)}function tt(){try{r.compressedTexImage2D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function it(){try{r.compressedTexImage3D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function vt(){try{r.texSubImage2D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function pt(){try{r.texSubImage3D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function lt(){try{r.compressedTexSubImage2D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function Lt(){try{r.compressedTexSubImage3D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function ht(){try{r.texStorage2D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function yt(){try{r.texStorage3D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function qt(){try{r.texImage2D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function ut(){try{r.texImage3D.apply(r,arguments)}catch(k){console.error("THREE.WebGLState:",k)}}function Tt(k){_t.equals(k)===!1&&(r.scissor(k.x,k.y,k.z,k.w),_t.copy(k))}function Wt(k){Ut.equals(k)===!1&&(r.viewport(k.x,k.y,k.z,k.w),Ut.copy(k))}function Zt(k,Q){let st=l.get(Q);st===void 0&&(st=new WeakMap,l.set(Q,st));let mt=st.get(k);mt===void 0&&(mt=r.getUniformBlockIndex(Q,k.name),st.set(k,mt))}function ue(k,Q){let mt=l.get(Q).get(k);a.get(Q)!==mt&&(r.uniformBlockBinding(Q,mt,k.__bindingPointIndex),a.set(Q,mt))}function Jt(){r.disable(r.BLEND),r.disable(r.CULL_FACE),r.disable(r.DEPTH_TEST),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SCISSOR_TEST),r.disable(r.STENCIL_TEST),r.disable(r.SAMPLE_ALPHA_TO_COVERAGE),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ZERO),r.blendFuncSeparate(r.ONE,r.ZERO,r.ONE,r.ZERO),r.blendColor(0,0,0,0),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0),r.depthMask(!0),r.depthFunc(r.LESS),r.clearDepth(1),r.stencilMask(4294967295),r.stencilFunc(r.ALWAYS,0,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.KEEP),r.clearStencil(0),r.cullFace(r.BACK),r.frontFace(r.CCW),r.polygonOffset(0,0),r.activeTexture(r.TEXTURE0),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),r.bindFramebuffer(r.READ_FRAMEBUFFER,null),r.useProgram(null),r.lineWidth(1),r.scissor(0,0,r.canvas.width,r.canvas.height),r.viewport(0,0,r.canvas.width,r.canvas.height),c={},z=null,U={},h={},f=new WeakMap,d=[],u=null,_=!1,m=null,p=null,g=null,b=null,v=null,S=null,D=null,T=new ge(0,0,0),w=0,P=!1,M=null,y=null,I=null,N=null,C=null,_t.set(0,0,r.canvas.width,r.canvas.height),Ut.set(0,0,r.canvas.width,r.canvas.height),i.reset(),s.reset(),o.reset()}return{buffers:{color:i,depth:s,stencil:o},enable:xt,disable:ct,bindFramebuffer:Rt,drawBuffers:kt,useProgram:q,setBlending:Ft,setMaterial:bt,setFlipSided:Et,setCullFace:Ht,setLineWidth:G,setPolygonOffset:jt,setScissorTest:A,activeTexture:x,bindTexture:F,unbindTexture:Y,compressedTexImage2D:tt,compressedTexImage3D:it,texImage2D:qt,texImage3D:ut,updateUBOMapping:Zt,uniformBlockBinding:ue,texStorage2D:ht,texStorage3D:yt,texSubImage2D:vt,texSubImage3D:pt,compressedTexSubImage2D:lt,compressedTexSubImage3D:Lt,scissor:Tt,viewport:Wt,reset:Jt}}function TE(r,t,e,n,i,s,o){let a=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new _e,h=new WeakMap,f,d=new WeakMap,u=!1;try{u=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(A,x){return u?new OffscreenCanvas(A,x):Uc("canvas")}function m(A,x,F){let Y=1,tt=jt(A);if((tt.width>F||tt.height>F)&&(Y=F/Math.max(tt.width,tt.height)),Y<1)if(typeof HTMLImageElement<"u"&&A instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&A instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&A instanceof ImageBitmap||typeof VideoFrame<"u"&&A instanceof VideoFrame){let it=Math.floor(Y*tt.width),vt=Math.floor(Y*tt.height);f===void 0&&(f=_(it,vt));let pt=x?_(it,vt):f;return pt.width=it,pt.height=vt,pt.getContext("2d").drawImage(A,0,0,it,vt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+tt.width+"x"+tt.height+") to ("+it+"x"+vt+")."),pt}else return"data"in A&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+tt.width+"x"+tt.height+")."),A;return A}function p(A){return A.generateMipmaps&&A.minFilter!==ii&&A.minFilter!==vi}function g(A){r.generateMipmap(A)}function b(A,x,F,Y,tt=!1){if(A!==null){if(r[A]!==void 0)return r[A];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+A+"'")}let it=x;if(x===r.RED&&(F===r.FLOAT&&(it=r.R32F),F===r.HALF_FLOAT&&(it=r.R16F),F===r.UNSIGNED_BYTE&&(it=r.R8)),x===r.RED_INTEGER&&(F===r.UNSIGNED_BYTE&&(it=r.R8UI),F===r.UNSIGNED_SHORT&&(it=r.R16UI),F===r.UNSIGNED_INT&&(it=r.R32UI),F===r.BYTE&&(it=r.R8I),F===r.SHORT&&(it=r.R16I),F===r.INT&&(it=r.R32I)),x===r.RG&&(F===r.FLOAT&&(it=r.RG32F),F===r.HALF_FLOAT&&(it=r.RG16F),F===r.UNSIGNED_BYTE&&(it=r.RG8)),x===r.RG_INTEGER&&(F===r.UNSIGNED_BYTE&&(it=r.RG8UI),F===r.UNSIGNED_SHORT&&(it=r.RG16UI),F===r.UNSIGNED_INT&&(it=r.RG32UI),F===r.BYTE&&(it=r.RG8I),F===r.SHORT&&(it=r.RG16I),F===r.INT&&(it=r.RG32I)),x===r.RGB&&F===r.UNSIGNED_INT_5_9_9_9_REV&&(it=r.RGB9_E5),x===r.RGBA){let vt=tt?Ic:Se.getTransfer(Y);F===r.FLOAT&&(it=r.RGBA32F),F===r.HALF_FLOAT&&(it=r.RGBA16F),F===r.UNSIGNED_BYTE&&(it=vt===Te?r.SRGB8_ALPHA8:r.RGBA8),F===r.UNSIGNED_SHORT_4_4_4_4&&(it=r.RGBA4),F===r.UNSIGNED_SHORT_5_5_5_1&&(it=r.RGB5_A1)}return(it===r.R16F||it===r.R32F||it===r.RG16F||it===r.RG32F||it===r.RGBA16F||it===r.RGBA32F)&&t.get("EXT_color_buffer_float"),it}function v(A,x){return p(A)===!0||A.isFramebufferTexture&&A.minFilter!==ii&&A.minFilter!==vi?Math.log2(Math.max(x.width,x.height))+1:A.mipmaps!==void 0&&A.mipmaps.length>0?A.mipmaps.length:A.isCompressedTexture&&Array.isArray(A.image)?x.mipmaps.length:1}function S(A){let x=A.target;x.removeEventListener("dispose",S),T(x),x.isVideoTexture&&h.delete(x)}function D(A){let x=A.target;x.removeEventListener("dispose",D),P(x)}function T(A){let x=n.get(A);if(x.__webglInit===void 0)return;let F=A.source,Y=d.get(F);if(Y){let tt=Y[x.__cacheKey];tt.usedTimes--,tt.usedTimes===0&&w(A),Object.keys(Y).length===0&&d.delete(F)}n.remove(A)}function w(A){let x=n.get(A);r.deleteTexture(x.__webglTexture);let F=A.source,Y=d.get(F);delete Y[x.__cacheKey],o.memory.textures--}function P(A){let x=n.get(A);if(A.depthTexture&&A.depthTexture.dispose(),A.isWebGLCubeRenderTarget)for(let Y=0;Y<6;Y++){if(Array.isArray(x.__webglFramebuffer[Y]))for(let tt=0;tt<x.__webglFramebuffer[Y].length;tt++)r.deleteFramebuffer(x.__webglFramebuffer[Y][tt]);else r.deleteFramebuffer(x.__webglFramebuffer[Y]);x.__webglDepthbuffer&&r.deleteRenderbuffer(x.__webglDepthbuffer[Y])}else{if(Array.isArray(x.__webglFramebuffer))for(let Y=0;Y<x.__webglFramebuffer.length;Y++)r.deleteFramebuffer(x.__webglFramebuffer[Y]);else r.deleteFramebuffer(x.__webglFramebuffer);if(x.__webglDepthbuffer&&r.deleteRenderbuffer(x.__webglDepthbuffer),x.__webglMultisampledFramebuffer&&r.deleteFramebuffer(x.__webglMultisampledFramebuffer),x.__webglColorRenderbuffer)for(let Y=0;Y<x.__webglColorRenderbuffer.length;Y++)x.__webglColorRenderbuffer[Y]&&r.deleteRenderbuffer(x.__webglColorRenderbuffer[Y]);x.__webglDepthRenderbuffer&&r.deleteRenderbuffer(x.__webglDepthRenderbuffer)}let F=A.textures;for(let Y=0,tt=F.length;Y<tt;Y++){let it=n.get(F[Y]);it.__webglTexture&&(r.deleteTexture(it.__webglTexture),o.memory.textures--),n.remove(F[Y])}n.remove(A)}let M=0;function y(){M=0}function I(){let A=M;return A>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+A+" texture units while this GPU supports only "+i.maxTextures),M+=1,A}function N(A){let x=[];return x.push(A.wrapS),x.push(A.wrapT),x.push(A.wrapR||0),x.push(A.magFilter),x.push(A.minFilter),x.push(A.anisotropy),x.push(A.internalFormat),x.push(A.format),x.push(A.type),x.push(A.generateMipmaps),x.push(A.premultiplyAlpha),x.push(A.flipY),x.push(A.unpackAlignment),x.push(A.colorSpace),x.join()}function C(A,x){let F=n.get(A);if(A.isVideoTexture&&Ht(A),A.isRenderTargetTexture===!1&&A.version>0&&F.__version!==A.version){let Y=A.image;if(Y===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Y.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{_t(F,A,x);return}}e.bindTexture(r.TEXTURE_2D,F.__webglTexture,r.TEXTURE0+x)}function V(A,x){let F=n.get(A);if(A.version>0&&F.__version!==A.version){_t(F,A,x);return}e.bindTexture(r.TEXTURE_2D_ARRAY,F.__webglTexture,r.TEXTURE0+x)}function $(A,x){let F=n.get(A);if(A.version>0&&F.__version!==A.version){_t(F,A,x);return}e.bindTexture(r.TEXTURE_3D,F.__webglTexture,r.TEXTURE0+x)}function W(A,x){let F=n.get(A);if(A.version>0&&F.__version!==A.version){Ut(F,A,x);return}e.bindTexture(r.TEXTURE_CUBE_MAP,F.__webglTexture,r.TEXTURE0+x)}let Z={[zf]:r.REPEAT,[Is]:r.CLAMP_TO_EDGE,[Vf]:r.MIRRORED_REPEAT},z={[ii]:r.NEAREST,[xS]:r.NEAREST_MIPMAP_NEAREST,[rc]:r.NEAREST_MIPMAP_LINEAR,[vi]:r.LINEAR,[ef]:r.LINEAR_MIPMAP_NEAREST,[Ls]:r.LINEAR_MIPMAP_LINEAR},U={[LS]:r.NEVER,[kS]:r.ALWAYS,[FS]:r.LESS,[I0]:r.LEQUAL,[NS]:r.EQUAL,[BS]:r.GEQUAL,[US]:r.GREATER,[OS]:r.NOTEQUAL};function R(A,x){if(x.type===Or&&t.has("OES_texture_float_linear")===!1&&(x.magFilter===vi||x.magFilter===ef||x.magFilter===rc||x.magFilter===Ls||x.minFilter===vi||x.minFilter===ef||x.minFilter===rc||x.minFilter===Ls)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),r.texParameteri(A,r.TEXTURE_WRAP_S,Z[x.wrapS]),r.texParameteri(A,r.TEXTURE_WRAP_T,Z[x.wrapT]),(A===r.TEXTURE_3D||A===r.TEXTURE_2D_ARRAY)&&r.texParameteri(A,r.TEXTURE_WRAP_R,Z[x.wrapR]),r.texParameteri(A,r.TEXTURE_MAG_FILTER,z[x.magFilter]),r.texParameteri(A,r.TEXTURE_MIN_FILTER,z[x.minFilter]),x.compareFunction&&(r.texParameteri(A,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(A,r.TEXTURE_COMPARE_FUNC,U[x.compareFunction])),t.has("EXT_texture_filter_anisotropic")===!0){if(x.magFilter===ii||x.minFilter!==rc&&x.minFilter!==Ls||x.type===Or&&t.has("OES_texture_float_linear")===!1)return;if(x.anisotropy>1||n.get(x).__currentAnisotropy){let F=t.get("EXT_texture_filter_anisotropic");r.texParameterf(A,F.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(x.anisotropy,i.getMaxAnisotropy())),n.get(x).__currentAnisotropy=x.anisotropy}}}function at(A,x){let F=!1;A.__webglInit===void 0&&(A.__webglInit=!0,x.addEventListener("dispose",S));let Y=x.source,tt=d.get(Y);tt===void 0&&(tt={},d.set(Y,tt));let it=N(x);if(it!==A.__cacheKey){tt[it]===void 0&&(tt[it]={texture:r.createTexture(),usedTimes:0},o.memory.textures++,F=!0),tt[it].usedTimes++;let vt=tt[A.__cacheKey];vt!==void 0&&(tt[A.__cacheKey].usedTimes--,vt.usedTimes===0&&w(x)),A.__cacheKey=it,A.__webglTexture=tt[it].texture}return F}function _t(A,x,F){let Y=r.TEXTURE_2D;(x.isDataArrayTexture||x.isCompressedArrayTexture)&&(Y=r.TEXTURE_2D_ARRAY),x.isData3DTexture&&(Y=r.TEXTURE_3D);let tt=at(A,x),it=x.source;e.bindTexture(Y,A.__webglTexture,r.TEXTURE0+F);let vt=n.get(it);if(it.version!==vt.__version||tt===!0){e.activeTexture(r.TEXTURE0+F);let pt=Se.getPrimaries(Se.workingColorSpace),lt=x.colorSpace===Ur?null:Se.getPrimaries(x.colorSpace),Lt=x.colorSpace===Ur||pt===lt?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,x.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,x.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Lt);let ht=m(x.image,!1,i.maxTextureSize);ht=G(x,ht);let yt=s.convert(x.format,x.colorSpace),qt=s.convert(x.type),ut=b(x.internalFormat,yt,qt,x.colorSpace,x.isVideoTexture);R(Y,x);let Tt,Wt=x.mipmaps,Zt=x.isVideoTexture!==!0,ue=vt.__version===void 0||tt===!0,Jt=it.dataReady,k=v(x,ht);if(x.isDepthTexture)ut=r.DEPTH_COMPONENT16,x.type===Or?ut=r.DEPTH_COMPONENT32F:x.type===Ho?ut=r.DEPTH_COMPONENT24:x.type===Qa&&(ut=r.DEPTH24_STENCIL8),ue&&(Zt?e.texStorage2D(r.TEXTURE_2D,1,ut,ht.width,ht.height):e.texImage2D(r.TEXTURE_2D,0,ut,ht.width,ht.height,0,yt,qt,null));else if(x.isDataTexture)if(Wt.length>0){Zt&&ue&&e.texStorage2D(r.TEXTURE_2D,k,ut,Wt[0].width,Wt[0].height);for(let Q=0,st=Wt.length;Q<st;Q++)Tt=Wt[Q],Zt?Jt&&e.texSubImage2D(r.TEXTURE_2D,Q,0,0,Tt.width,Tt.height,yt,qt,Tt.data):e.texImage2D(r.TEXTURE_2D,Q,ut,Tt.width,Tt.height,0,yt,qt,Tt.data);x.generateMipmaps=!1}else Zt?(ue&&e.texStorage2D(r.TEXTURE_2D,k,ut,ht.width,ht.height),Jt&&e.texSubImage2D(r.TEXTURE_2D,0,0,0,ht.width,ht.height,yt,qt,ht.data)):e.texImage2D(r.TEXTURE_2D,0,ut,ht.width,ht.height,0,yt,qt,ht.data);else if(x.isCompressedTexture)if(x.isCompressedArrayTexture){Zt&&ue&&e.texStorage3D(r.TEXTURE_2D_ARRAY,k,ut,Wt[0].width,Wt[0].height,ht.depth);for(let Q=0,st=Wt.length;Q<st;Q++)Tt=Wt[Q],x.format!==Ui?yt!==null?Zt?Jt&&e.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,Q,0,0,0,Tt.width,Tt.height,ht.depth,yt,Tt.data,0,0):e.compressedTexImage3D(r.TEXTURE_2D_ARRAY,Q,ut,Tt.width,Tt.height,ht.depth,0,Tt.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Zt?Jt&&e.texSubImage3D(r.TEXTURE_2D_ARRAY,Q,0,0,0,Tt.width,Tt.height,ht.depth,yt,qt,Tt.data):e.texImage3D(r.TEXTURE_2D_ARRAY,Q,ut,Tt.width,Tt.height,ht.depth,0,yt,qt,Tt.data)}else{Zt&&ue&&e.texStorage2D(r.TEXTURE_2D,k,ut,Wt[0].width,Wt[0].height);for(let Q=0,st=Wt.length;Q<st;Q++)Tt=Wt[Q],x.format!==Ui?yt!==null?Zt?Jt&&e.compressedTexSubImage2D(r.TEXTURE_2D,Q,0,0,Tt.width,Tt.height,yt,Tt.data):e.compressedTexImage2D(r.TEXTURE_2D,Q,ut,Tt.width,Tt.height,0,Tt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Zt?Jt&&e.texSubImage2D(r.TEXTURE_2D,Q,0,0,Tt.width,Tt.height,yt,qt,Tt.data):e.texImage2D(r.TEXTURE_2D,Q,ut,Tt.width,Tt.height,0,yt,qt,Tt.data)}else if(x.isDataArrayTexture)Zt?(ue&&e.texStorage3D(r.TEXTURE_2D_ARRAY,k,ut,ht.width,ht.height,ht.depth),Jt&&e.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,ht.width,ht.height,ht.depth,yt,qt,ht.data)):e.texImage3D(r.TEXTURE_2D_ARRAY,0,ut,ht.width,ht.height,ht.depth,0,yt,qt,ht.data);else if(x.isData3DTexture)Zt?(ue&&e.texStorage3D(r.TEXTURE_3D,k,ut,ht.width,ht.height,ht.depth),Jt&&e.texSubImage3D(r.TEXTURE_3D,0,0,0,0,ht.width,ht.height,ht.depth,yt,qt,ht.data)):e.texImage3D(r.TEXTURE_3D,0,ut,ht.width,ht.height,ht.depth,0,yt,qt,ht.data);else if(x.isFramebufferTexture){if(ue)if(Zt)e.texStorage2D(r.TEXTURE_2D,k,ut,ht.width,ht.height);else{let Q=ht.width,st=ht.height;for(let mt=0;mt<k;mt++)e.texImage2D(r.TEXTURE_2D,mt,ut,Q,st,0,yt,qt,null),Q>>=1,st>>=1}}else if(Wt.length>0){if(Zt&&ue){let Q=jt(Wt[0]);e.texStorage2D(r.TEXTURE_2D,k,ut,Q.width,Q.height)}for(let Q=0,st=Wt.length;Q<st;Q++)Tt=Wt[Q],Zt?Jt&&e.texSubImage2D(r.TEXTURE_2D,Q,0,0,yt,qt,Tt):e.texImage2D(r.TEXTURE_2D,Q,ut,yt,qt,Tt);x.generateMipmaps=!1}else if(Zt){if(ue){let Q=jt(ht);e.texStorage2D(r.TEXTURE_2D,k,ut,Q.width,Q.height)}Jt&&e.texSubImage2D(r.TEXTURE_2D,0,0,0,yt,qt,ht)}else e.texImage2D(r.TEXTURE_2D,0,ut,yt,qt,ht);p(x)&&g(Y),vt.__version=it.version,x.onUpdate&&x.onUpdate(x)}A.__version=x.version}function Ut(A,x,F){if(x.image.length!==6)return;let Y=at(A,x),tt=x.source;e.bindTexture(r.TEXTURE_CUBE_MAP,A.__webglTexture,r.TEXTURE0+F);let it=n.get(tt);if(tt.version!==it.__version||Y===!0){e.activeTexture(r.TEXTURE0+F);let vt=Se.getPrimaries(Se.workingColorSpace),pt=x.colorSpace===Ur?null:Se.getPrimaries(x.colorSpace),lt=x.colorSpace===Ur||vt===pt?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,x.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,x.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,lt);let Lt=x.isCompressedTexture||x.image[0].isCompressedTexture,ht=x.image[0]&&x.image[0].isDataTexture,yt=[];for(let st=0;st<6;st++)!Lt&&!ht?yt[st]=m(x.image[st],!0,i.maxCubemapSize):yt[st]=ht?x.image[st].image:x.image[st],yt[st]=G(x,yt[st]);let qt=yt[0],ut=s.convert(x.format,x.colorSpace),Tt=s.convert(x.type),Wt=b(x.internalFormat,ut,Tt,x.colorSpace),Zt=x.isVideoTexture!==!0,ue=it.__version===void 0||Y===!0,Jt=tt.dataReady,k=v(x,qt);R(r.TEXTURE_CUBE_MAP,x);let Q;if(Lt){Zt&&ue&&e.texStorage2D(r.TEXTURE_CUBE_MAP,k,Wt,qt.width,qt.height);for(let st=0;st<6;st++){Q=yt[st].mipmaps;for(let mt=0;mt<Q.length;mt++){let gt=Q[mt];x.format!==Ui?ut!==null?Zt?Jt&&e.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt,0,0,gt.width,gt.height,ut,gt.data):e.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt,Wt,gt.width,gt.height,0,gt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):Zt?Jt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt,0,0,gt.width,gt.height,ut,Tt,gt.data):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt,Wt,gt.width,gt.height,0,ut,Tt,gt.data)}}}else{if(Q=x.mipmaps,Zt&&ue){Q.length>0&&k++;let st=jt(yt[0]);e.texStorage2D(r.TEXTURE_CUBE_MAP,k,Wt,st.width,st.height)}for(let st=0;st<6;st++)if(ht){Zt?Jt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,0,0,0,yt[st].width,yt[st].height,ut,Tt,yt[st].data):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,0,Wt,yt[st].width,yt[st].height,0,ut,Tt,yt[st].data);for(let mt=0;mt<Q.length;mt++){let Bt=Q[mt].image[st].image;Zt?Jt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt+1,0,0,Bt.width,Bt.height,ut,Tt,Bt.data):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt+1,Wt,Bt.width,Bt.height,0,ut,Tt,Bt.data)}}else{Zt?Jt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,0,0,0,ut,Tt,yt[st]):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,0,Wt,ut,Tt,yt[st]);for(let mt=0;mt<Q.length;mt++){let gt=Q[mt];Zt?Jt&&e.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt+1,0,0,ut,Tt,gt.image[st]):e.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+st,mt+1,Wt,ut,Tt,gt.image[st])}}}p(x)&&g(r.TEXTURE_CUBE_MAP),it.__version=tt.version,x.onUpdate&&x.onUpdate(x)}A.__version=x.version}function X(A,x,F,Y,tt,it){let vt=s.convert(F.format,F.colorSpace),pt=s.convert(F.type),lt=b(F.internalFormat,vt,pt,F.colorSpace);if(!n.get(x).__hasExternalTextures){let ht=Math.max(1,x.width>>it),yt=Math.max(1,x.height>>it);tt===r.TEXTURE_3D||tt===r.TEXTURE_2D_ARRAY?e.texImage3D(tt,it,lt,ht,yt,x.depth,0,vt,pt,null):e.texImage2D(tt,it,lt,ht,yt,0,vt,pt,null)}e.bindFramebuffer(r.FRAMEBUFFER,A),Et(x)?a.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,Y,tt,n.get(F).__webglTexture,0,bt(x)):(tt===r.TEXTURE_2D||tt>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&tt<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,Y,tt,n.get(F).__webglTexture,it),e.bindFramebuffer(r.FRAMEBUFFER,null)}function ot(A,x,F){if(r.bindRenderbuffer(r.RENDERBUFFER,A),x.depthBuffer&&!x.stencilBuffer){let Y=r.DEPTH_COMPONENT24;if(F||Et(x)){let tt=x.depthTexture;tt&&tt.isDepthTexture&&(tt.type===Or?Y=r.DEPTH_COMPONENT32F:tt.type===Ho&&(Y=r.DEPTH_COMPONENT24));let it=bt(x);Et(x)?a.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,it,Y,x.width,x.height):r.renderbufferStorageMultisample(r.RENDERBUFFER,it,Y,x.width,x.height)}else r.renderbufferStorage(r.RENDERBUFFER,Y,x.width,x.height);r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,A)}else if(x.depthBuffer&&x.stencilBuffer){let Y=bt(x);F&&Et(x)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,Y,r.DEPTH24_STENCIL8,x.width,x.height):Et(x)?a.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Y,r.DEPTH24_STENCIL8,x.width,x.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,x.width,x.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,A)}else{let Y=x.textures;for(let tt=0;tt<Y.length;tt++){let it=Y[tt],vt=s.convert(it.format,it.colorSpace),pt=s.convert(it.type),lt=b(it.internalFormat,vt,pt,it.colorSpace),Lt=bt(x);F&&Et(x)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,Lt,lt,x.width,x.height):Et(x)?a.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Lt,lt,x.width,x.height):r.renderbufferStorage(r.RENDERBUFFER,lt,x.width,x.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}function xt(A,x){if(x&&x.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(r.FRAMEBUFFER,A),!(x.depthTexture&&x.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.get(x.depthTexture).__webglTexture||x.depthTexture.image.width!==x.width||x.depthTexture.image.height!==x.height)&&(x.depthTexture.image.width=x.width,x.depthTexture.image.height=x.height,x.depthTexture.needsUpdate=!0),C(x.depthTexture,0);let Y=n.get(x.depthTexture).__webglTexture,tt=bt(x);if(x.depthTexture.format===Oo)Et(x)?a.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,Y,0,tt):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,Y,0);else if(x.depthTexture.format===Ja)Et(x)?a.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,Y,0,tt):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,Y,0);else throw new Error("Unknown depthTexture format")}function ct(A){let x=n.get(A),F=A.isWebGLCubeRenderTarget===!0;if(A.depthTexture&&!x.__autoAllocateDepthBuffer){if(F)throw new Error("target.depthTexture not supported in Cube render targets");xt(x.__webglFramebuffer,A)}else if(F){x.__webglDepthbuffer=[];for(let Y=0;Y<6;Y++)e.bindFramebuffer(r.FRAMEBUFFER,x.__webglFramebuffer[Y]),x.__webglDepthbuffer[Y]=r.createRenderbuffer(),ot(x.__webglDepthbuffer[Y],A,!1)}else e.bindFramebuffer(r.FRAMEBUFFER,x.__webglFramebuffer),x.__webglDepthbuffer=r.createRenderbuffer(),ot(x.__webglDepthbuffer,A,!1);e.bindFramebuffer(r.FRAMEBUFFER,null)}function Rt(A,x,F){let Y=n.get(A);x!==void 0&&X(Y.__webglFramebuffer,A,A.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),F!==void 0&&ct(A)}function kt(A){let x=A.texture,F=n.get(A),Y=n.get(x);A.addEventListener("dispose",D);let tt=A.textures,it=A.isWebGLCubeRenderTarget===!0,vt=tt.length>1;if(vt||(Y.__webglTexture===void 0&&(Y.__webglTexture=r.createTexture()),Y.__version=x.version,o.memory.textures++),it){F.__webglFramebuffer=[];for(let pt=0;pt<6;pt++)if(x.mipmaps&&x.mipmaps.length>0){F.__webglFramebuffer[pt]=[];for(let lt=0;lt<x.mipmaps.length;lt++)F.__webglFramebuffer[pt][lt]=r.createFramebuffer()}else F.__webglFramebuffer[pt]=r.createFramebuffer()}else{if(x.mipmaps&&x.mipmaps.length>0){F.__webglFramebuffer=[];for(let pt=0;pt<x.mipmaps.length;pt++)F.__webglFramebuffer[pt]=r.createFramebuffer()}else F.__webglFramebuffer=r.createFramebuffer();if(vt)for(let pt=0,lt=tt.length;pt<lt;pt++){let Lt=n.get(tt[pt]);Lt.__webglTexture===void 0&&(Lt.__webglTexture=r.createTexture(),o.memory.textures++)}if(A.samples>0&&Et(A)===!1){F.__webglMultisampledFramebuffer=r.createFramebuffer(),F.__webglColorRenderbuffer=[],e.bindFramebuffer(r.FRAMEBUFFER,F.__webglMultisampledFramebuffer);for(let pt=0;pt<tt.length;pt++){let lt=tt[pt];F.__webglColorRenderbuffer[pt]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,F.__webglColorRenderbuffer[pt]);let Lt=s.convert(lt.format,lt.colorSpace),ht=s.convert(lt.type),yt=b(lt.internalFormat,Lt,ht,lt.colorSpace,A.isXRRenderTarget===!0),qt=bt(A);r.renderbufferStorageMultisample(r.RENDERBUFFER,qt,yt,A.width,A.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+pt,r.RENDERBUFFER,F.__webglColorRenderbuffer[pt])}r.bindRenderbuffer(r.RENDERBUFFER,null),A.depthBuffer&&(F.__webglDepthRenderbuffer=r.createRenderbuffer(),ot(F.__webglDepthRenderbuffer,A,!0)),e.bindFramebuffer(r.FRAMEBUFFER,null)}}if(it){e.bindTexture(r.TEXTURE_CUBE_MAP,Y.__webglTexture),R(r.TEXTURE_CUBE_MAP,x);for(let pt=0;pt<6;pt++)if(x.mipmaps&&x.mipmaps.length>0)for(let lt=0;lt<x.mipmaps.length;lt++)X(F.__webglFramebuffer[pt][lt],A,x,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,lt);else X(F.__webglFramebuffer[pt],A,x,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+pt,0);p(x)&&g(r.TEXTURE_CUBE_MAP),e.unbindTexture()}else if(vt){for(let pt=0,lt=tt.length;pt<lt;pt++){let Lt=tt[pt],ht=n.get(Lt);e.bindTexture(r.TEXTURE_2D,ht.__webglTexture),R(r.TEXTURE_2D,Lt),X(F.__webglFramebuffer,A,Lt,r.COLOR_ATTACHMENT0+pt,r.TEXTURE_2D,0),p(Lt)&&g(r.TEXTURE_2D)}e.unbindTexture()}else{let pt=r.TEXTURE_2D;if((A.isWebGL3DRenderTarget||A.isWebGLArrayRenderTarget)&&(pt=A.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),e.bindTexture(pt,Y.__webglTexture),R(pt,x),x.mipmaps&&x.mipmaps.length>0)for(let lt=0;lt<x.mipmaps.length;lt++)X(F.__webglFramebuffer[lt],A,x,r.COLOR_ATTACHMENT0,pt,lt);else X(F.__webglFramebuffer,A,x,r.COLOR_ATTACHMENT0,pt,0);p(x)&&g(pt),e.unbindTexture()}A.depthBuffer&&ct(A)}function q(A){let x=A.textures;for(let F=0,Y=x.length;F<Y;F++){let tt=x[F];if(p(tt)){let it=A.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D,vt=n.get(tt).__webglTexture;e.bindTexture(it,vt),g(it),e.unbindTexture()}}}let $t=[],It=[];function Ft(A){if(A.samples>0){if(Et(A)===!1){let x=A.textures,F=A.width,Y=A.height,tt=r.COLOR_BUFFER_BIT,it=A.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,vt=n.get(A),pt=x.length>1;if(pt)for(let lt=0;lt<x.length;lt++)e.bindFramebuffer(r.FRAMEBUFFER,vt.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+lt,r.RENDERBUFFER,null),e.bindFramebuffer(r.FRAMEBUFFER,vt.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+lt,r.TEXTURE_2D,null,0);e.bindFramebuffer(r.READ_FRAMEBUFFER,vt.__webglMultisampledFramebuffer),e.bindFramebuffer(r.DRAW_FRAMEBUFFER,vt.__webglFramebuffer);for(let lt=0;lt<x.length;lt++){if(A.resolveDepthBuffer&&(A.depthBuffer&&(tt|=r.DEPTH_BUFFER_BIT),A.stencilBuffer&&A.resolveStencilBuffer&&(tt|=r.STENCIL_BUFFER_BIT)),pt){r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,vt.__webglColorRenderbuffer[lt]);let Lt=n.get(x[lt]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,Lt,0)}r.blitFramebuffer(0,0,F,Y,0,0,F,Y,tt,r.NEAREST),l===!0&&($t.length=0,It.length=0,$t.push(r.COLOR_ATTACHMENT0+lt),A.depthBuffer&&A.resolveDepthBuffer===!1&&($t.push(it),It.push(it),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,It)),r.invalidateFramebuffer(r.READ_FRAMEBUFFER,$t))}if(e.bindFramebuffer(r.READ_FRAMEBUFFER,null),e.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),pt)for(let lt=0;lt<x.length;lt++){e.bindFramebuffer(r.FRAMEBUFFER,vt.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+lt,r.RENDERBUFFER,vt.__webglColorRenderbuffer[lt]);let Lt=n.get(x[lt]).__webglTexture;e.bindFramebuffer(r.FRAMEBUFFER,vt.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+lt,r.TEXTURE_2D,Lt,0)}e.bindFramebuffer(r.DRAW_FRAMEBUFFER,vt.__webglMultisampledFramebuffer)}else if(A.depthBuffer&&A.resolveDepthBuffer===!1&&l){let x=A.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT;r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[x])}}}function bt(A){return Math.min(i.maxSamples,A.samples)}function Et(A){let x=n.get(A);return A.samples>0&&t.has("WEBGL_multisampled_render_to_texture")===!0&&x.__useRenderToTexture!==!1}function Ht(A){let x=o.render.frame;h.get(A)!==x&&(h.set(A,x),A.update())}function G(A,x){let F=A.colorSpace,Y=A.format,tt=A.type;return A.isCompressedTexture===!0||A.isVideoTexture===!0||F!==Yr&&F!==Ur&&(Se.getTransfer(F)===Te?(Y!==Ui||tt!==Gr)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",F)),x}function jt(A){return typeof HTMLImageElement<"u"&&A instanceof HTMLImageElement?(c.width=A.naturalWidth||A.width,c.height=A.naturalHeight||A.height):typeof VideoFrame<"u"&&A instanceof VideoFrame?(c.width=A.displayWidth,c.height=A.displayHeight):(c.width=A.width,c.height=A.height),c}this.allocateTextureUnit=I,this.resetTextureUnits=y,this.setTexture2D=C,this.setTexture2DArray=V,this.setTexture3D=$,this.setTextureCube=W,this.rebindTextures=Rt,this.setupRenderTarget=kt,this.updateRenderTargetMipmap=q,this.updateMultisampleRenderTarget=Ft,this.setupDepthRenderbuffer=ct,this.setupFrameBufferTexture=X,this.useMultisampledRTT=Et}function AE(r,t){function e(n,i=Ur){let s,o=Se.getTransfer(i);if(n===Gr)return r.UNSIGNED_BYTE;if(n===A0)return r.UNSIGNED_SHORT_4_4_4_4;if(n===D0)return r.UNSIGNED_SHORT_5_5_5_1;if(n===SS)return r.UNSIGNED_INT_5_9_9_9_REV;if(n===yS)return r.BYTE;if(n===vS)return r.SHORT;if(n===E0)return r.UNSIGNED_SHORT;if(n===T0)return r.INT;if(n===Ho)return r.UNSIGNED_INT;if(n===Or)return r.FLOAT;if(n===iu)return r.HALF_FLOAT;if(n===MS)return r.ALPHA;if(n===bS)return r.RGB;if(n===Ui)return r.RGBA;if(n===wS)return r.LUMINANCE;if(n===ES)return r.LUMINANCE_ALPHA;if(n===Oo)return r.DEPTH_COMPONENT;if(n===Ja)return r.DEPTH_STENCIL;if(n===TS)return r.RED;if(n===C0)return r.RED_INTEGER;if(n===AS)return r.RG;if(n===R0)return r.RG_INTEGER;if(n===P0)return r.RGBA_INTEGER;if(n===nf||n===rf||n===sf||n===of)if(o===Te)if(s=t.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===nf)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===rf)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===sf)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===of)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=t.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===nf)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===rf)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===sf)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===of)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===t_||n===e_||n===n_||n===i_)if(s=t.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===t_)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===e_)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===n_)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===i_)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===r_||n===s_||n===o_)if(s=t.get("WEBGL_compressed_texture_etc"),s!==null){if(n===r_||n===s_)return o===Te?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===o_)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===a_||n===l_||n===c_||n===u_||n===h_||n===f_||n===d_||n===p_||n===m_||n===g_||n===__||n===x_||n===y_||n===v_)if(s=t.get("WEBGL_compressed_texture_astc"),s!==null){if(n===a_)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===l_)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===c_)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===u_)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===h_)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===f_)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===d_)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===p_)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===m_)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===g_)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===__)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===x_)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===y_)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===v_)return o===Te?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===af||n===S_||n===M_)if(s=t.get("EXT_texture_compression_bptc"),s!==null){if(n===af)return o===Te?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===S_)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===M_)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===DS||n===b_||n===w_||n===E_)if(s=t.get("EXT_texture_compression_rgtc"),s!==null){if(n===af)return s.COMPRESSED_RED_RGTC1_EXT;if(n===b_)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===w_)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===E_)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===Qa?r.UNSIGNED_INT_24_8:r[n]!==void 0?r[n]:null}return{convert:e}}var nd=class extends Dn{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}},Br=class extends gn{constructor(){super(),this.isGroup=!0,this.type="Group"}},DE={type:"move"},Za=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Br,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Br,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new nt,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new nt),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Br,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new nt,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new nt),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){let e=this._hand;if(e)for(let n of t.hand.values())this._getHandJoint(e,n)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,e,n){let i=null,s=null,o=null,a=this._targetRay,l=this._grip,c=this._hand;if(t&&e.session.visibilityState!=="visible-blurred"){if(c&&t.hand){o=!0;for(let m of t.hand.values()){let p=e.getJointPose(m,n),g=this._getHandJoint(c,m);p!==null&&(g.matrix.fromArray(p.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=p.radius),g.visible=p!==null}let h=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],d=h.position.distanceTo(f.position),u=.02,_=.005;c.inputState.pinching&&d>u+_?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&d<=u-_&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(s=e.getPose(t.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(i=e.getPose(t.targetRaySpace,n),i===null&&s!==null&&(i=s),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(DE)))}return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(t,e){if(t.joints[e.jointName]===void 0){let n=new Br;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}},CE=`
|
|
3798
3798
|
void main() {
|
|
3799
3799
|
|
|
3800
3800
|
gl_Position = vec4( position, 1.0 );
|
|
@@ -3818,32 +3818,28 @@ void main() {
|
|
|
3818
3818
|
|
|
3819
3819
|
}
|
|
3820
3820
|
|
|
3821
|
-
}`,id=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,n){if(this.texture===null){let i=new oi,s=t.properties.get(i);s.__webglTexture=e.texture,(e.depthNear!=n.depthNear||e.depthFar!=n.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}render(t,e){if(this.texture!==null){if(this.mesh===null){let n=e.cameras[0].viewport,i=new ai({vertexShader:CE,fragmentShader:RE,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new Si(new Yc(20,20),i)}t.render(this.mesh,e)}}reset(){this.texture=null,this.mesh=null}},rd=class extends Wr{constructor(t,e){super();let n=this,i=null,s=1,o=null,a="local-floor",l=1,c=null,h=null,d=null,f=null,u=null,_=null,p=new id,m=e.getContextAttributes(),g=null,b=null,v=[],S=[],D=new _e,T=null,w=new Dn;w.layers.enable(1),w.viewport=new Qe;let P=new Dn;P.layers.enable(2),P.viewport=new Qe;let M=[w,P],y=new nd;y.layers.enable(1),y.layers.enable(2);let I=null,N=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(X){let ot=v[X];return ot===void 0&&(ot=new Za,v[X]=ot),ot.getTargetRaySpace()},this.getControllerGrip=function(X){let ot=v[X];return ot===void 0&&(ot=new Za,v[X]=ot),ot.getGripSpace()},this.getHand=function(X){let ot=v[X];return ot===void 0&&(ot=new Za,v[X]=ot),ot.getHandSpace()};function C(X){let ot=S.indexOf(X.inputSource);if(ot===-1)return;let xt=v[ot];xt!==void 0&&(xt.update(X.inputSource,X.frame,c||o),xt.dispatchEvent({type:X.type,data:X.inputSource}))}function V(){i.removeEventListener("select",C),i.removeEventListener("selectstart",C),i.removeEventListener("selectend",C),i.removeEventListener("squeeze",C),i.removeEventListener("squeezestart",C),i.removeEventListener("squeezeend",C),i.removeEventListener("end",V),i.removeEventListener("inputsourceschange",$);for(let X=0;X<v.length;X++){let ot=S[X];ot!==null&&(S[X]=null,v[X].disconnect(ot))}I=null,N=null,p.reset(),t.setRenderTarget(g),u=null,f=null,d=null,i=null,b=null,Ut.stop(),n.isPresenting=!1,t.setPixelRatio(T),t.setSize(D.width,D.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(X){s=X,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(X){a=X,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||o},this.setReferenceSpace=function(X){c=X},this.getBaseLayer=function(){return f!==null?f:u},this.getBinding=function(){return d},this.getFrame=function(){return _},this.getSession=function(){return i},this.setSession=async function(X){if(i=X,i!==null){if(g=t.getRenderTarget(),i.addEventListener("select",C),i.addEventListener("selectstart",C),i.addEventListener("selectend",C),i.addEventListener("squeeze",C),i.addEventListener("squeezestart",C),i.addEventListener("squeezeend",C),i.addEventListener("end",V),i.addEventListener("inputsourceschange",$),m.xrCompatible!==!0&&await e.makeXRCompatible(),T=t.getPixelRatio(),t.getSize(D),i.renderState.layers===void 0){let ot={antialias:m.antialias,alpha:!0,depth:m.depth,stencil:m.stencil,framebufferScaleFactor:s};u=new XRWebGLLayer(i,e,ot),i.updateRenderState({baseLayer:u}),t.setPixelRatio(1),t.setSize(u.framebufferWidth,u.framebufferHeight,!1),b=new lr(u.framebufferWidth,u.framebufferHeight,{format:Ui,type:Gr,colorSpace:t.outputColorSpace,stencilBuffer:m.stencil})}else{let ot=null,xt=null,ct=null;m.depth&&(ct=m.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,ot=m.stencil?Ja:Oo,xt=m.stencil?Qa:Ho);let Rt={colorFormat:e.RGBA8,depthFormat:ct,scaleFactor:s};d=new XRWebGLBinding(i,e),f=d.createProjectionLayer(Rt),i.updateRenderState({layers:[f]}),t.setPixelRatio(1),t.setSize(f.textureWidth,f.textureHeight,!1),b=new lr(f.textureWidth,f.textureHeight,{format:Ui,type:Gr,depthTexture:new Jc(f.textureWidth,f.textureHeight,xt,void 0,void 0,void 0,void 0,void 0,void 0,ot),stencilBuffer:m.stencil,colorSpace:t.outputColorSpace,samples:m.antialias?4:0,resolveDepthBuffer:f.ignoreDepthValues===!1})}b.isXRRenderTarget=!0,this.setFoveation(l),c=null,o=await i.requestReferenceSpace(a),Ut.setContext(i),Ut.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode};function $(X){for(let ot=0;ot<X.removed.length;ot++){let xt=X.removed[ot],ct=S.indexOf(xt);ct>=0&&(S[ct]=null,v[ct].disconnect(xt))}for(let ot=0;ot<X.added.length;ot++){let xt=X.added[ot],ct=S.indexOf(xt);if(ct===-1){for(let kt=0;kt<v.length;kt++)if(kt>=S.length){S.push(xt),ct=kt;break}else if(S[kt]===null){S[kt]=xt,ct=kt;break}if(ct===-1)break}let Rt=v[ct];Rt&&Rt.connect(xt)}}let W=new nt,Z=new nt;function z(X,ot,xt){W.setFromMatrixPosition(ot.matrixWorld),Z.setFromMatrixPosition(xt.matrixWorld);let ct=W.distanceTo(Z),Rt=ot.projectionMatrix.elements,kt=xt.projectionMatrix.elements,q=Rt[14]/(Rt[10]-1),$t=Rt[14]/(Rt[10]+1),It=(Rt[9]+1)/Rt[5],Ft=(Rt[9]-1)/Rt[5],bt=(Rt[8]-1)/Rt[0],Et=(kt[8]+1)/kt[0],Ht=q*bt,G=q*Et,jt=ct/(-bt+Et),A=jt*-bt;ot.matrixWorld.decompose(X.position,X.quaternion,X.scale),X.translateX(A),X.translateZ(jt),X.matrixWorld.compose(X.position,X.quaternion,X.scale),X.matrixWorldInverse.copy(X.matrixWorld).invert();let x=q+jt,F=$t+jt,Y=Ht-A,tt=G+(ct-A),it=It*$t/F*x,vt=Ft*$t/F*x;X.projectionMatrix.makePerspective(Y,tt,it,vt,x,F),X.projectionMatrixInverse.copy(X.projectionMatrix).invert()}function U(X,ot){ot===null?X.matrixWorld.copy(X.matrix):X.matrixWorld.multiplyMatrices(ot.matrixWorld,X.matrix),X.matrixWorldInverse.copy(X.matrixWorld).invert()}this.updateCamera=function(X){if(i===null)return;p.texture!==null&&(X.near=p.depthNear,X.far=p.depthFar),y.near=P.near=w.near=X.near,y.far=P.far=w.far=X.far,(I!==y.near||N!==y.far)&&(i.updateRenderState({depthNear:y.near,depthFar:y.far}),I=y.near,N=y.far,w.near=I,w.far=N,P.near=I,P.far=N,w.updateProjectionMatrix(),P.updateProjectionMatrix(),X.updateProjectionMatrix());let ot=X.parent,xt=y.cameras;U(y,ot);for(let ct=0;ct<xt.length;ct++)U(xt[ct],ot);xt.length===2?z(y,w,P):y.projectionMatrix.copy(w.projectionMatrix),R(X,y,ot)};function R(X,ot,xt){xt===null?X.matrix.copy(ot.matrixWorld):(X.matrix.copy(xt.matrixWorld),X.matrix.invert(),X.matrix.multiply(ot.matrixWorld)),X.matrix.decompose(X.position,X.quaternion,X.scale),X.updateMatrixWorld(!0),X.projectionMatrix.copy(ot.projectionMatrix),X.projectionMatrixInverse.copy(ot.projectionMatrixInverse),X.isPerspectiveCamera&&(X.fov=Hf*2*Math.atan(1/X.projectionMatrix.elements[5]),X.zoom=1)}this.getCamera=function(){return y},this.getFoveation=function(){if(!(f===null&&u===null))return l},this.setFoveation=function(X){l=X,f!==null&&(f.fixedFoveation=X),u!==null&&u.fixedFoveation!==void 0&&(u.fixedFoveation=X)},this.hasDepthSensing=function(){return p.texture!==null};let at=null;function _t(X,ot){if(h=ot.getViewerPose(c||o),_=ot,h!==null){let xt=h.views;u!==null&&(t.setRenderTargetFramebuffer(b,u.framebuffer),t.setRenderTarget(b));let ct=!1;xt.length!==y.cameras.length&&(y.cameras.length=0,ct=!0);for(let kt=0;kt<xt.length;kt++){let q=xt[kt],$t=null;if(u!==null)$t=u.getViewport(q);else{let Ft=d.getViewSubImage(f,q);$t=Ft.viewport,kt===0&&(t.setRenderTargetTextures(b,Ft.colorTexture,f.ignoreDepthValues?void 0:Ft.depthStencilTexture),t.setRenderTarget(b))}let It=M[kt];It===void 0&&(It=new Dn,It.layers.enable(kt),It.viewport=new Qe,M[kt]=It),It.matrix.fromArray(q.transform.matrix),It.matrix.decompose(It.position,It.quaternion,It.scale),It.projectionMatrix.fromArray(q.projectionMatrix),It.projectionMatrixInverse.copy(It.projectionMatrix).invert(),It.viewport.set($t.x,$t.y,$t.width,$t.height),kt===0&&(y.matrix.copy(It.matrix),y.matrix.decompose(y.position,y.quaternion,y.scale)),ct===!0&&y.cameras.push(It)}let Rt=i.enabledFeatures;if(Rt&&Rt.includes("depth-sensing")){let kt=d.getDepthInformation(xt[0]);kt&&kt.isValid&&kt.texture&&p.init(t,kt,i.renderState)}}for(let xt=0;xt<v.length;xt++){let ct=S[xt],Rt=v[xt];ct!==null&&Rt!==void 0&&Rt.update(ct,ot,c||o)}p.render(t,y),at&&at(X,ot),ot.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:ot}),_=null}let Ut=new U0;Ut.setAnimationLoop(_t),this.setAnimationLoop=function(X){at=X},this.dispose=function(){}}},Ds=new cr,PE=new Oe;function IE(r,t){function e(m,g){m.matrixAutoUpdate===!0&&m.updateMatrix(),g.value.copy(m.matrix)}function n(m,g){g.color.getRGB(m.fogColor.value,N0(r)),g.isFog?(m.fogNear.value=g.near,m.fogFar.value=g.far):g.isFogExp2&&(m.fogDensity.value=g.density)}function i(m,g,b,v,S){g.isMeshBasicMaterial||g.isMeshLambertMaterial?s(m,g):g.isMeshToonMaterial?(s(m,g),d(m,g)):g.isMeshPhongMaterial?(s(m,g),h(m,g)):g.isMeshStandardMaterial?(s(m,g),f(m,g),g.isMeshPhysicalMaterial&&u(m,g,S)):g.isMeshMatcapMaterial?(s(m,g),_(m,g)):g.isMeshDepthMaterial?s(m,g):g.isMeshDistanceMaterial?(s(m,g),p(m,g)):g.isMeshNormalMaterial?s(m,g):g.isLineBasicMaterial?(o(m,g),g.isLineDashedMaterial&&a(m,g)):g.isPointsMaterial?l(m,g,b,v):g.isSpriteMaterial?c(m,g):g.isShadowMaterial?(m.color.value.copy(g.color),m.opacity.value=g.opacity):g.isShaderMaterial&&(g.uniformsNeedUpdate=!1)}function s(m,g){m.opacity.value=g.opacity,g.color&&m.diffuse.value.copy(g.color),g.emissive&&m.emissive.value.copy(g.emissive).multiplyScalar(g.emissiveIntensity),g.map&&(m.map.value=g.map,e(g.map,m.mapTransform)),g.alphaMap&&(m.alphaMap.value=g.alphaMap,e(g.alphaMap,m.alphaMapTransform)),g.bumpMap&&(m.bumpMap.value=g.bumpMap,e(g.bumpMap,m.bumpMapTransform),m.bumpScale.value=g.bumpScale,g.side===Un&&(m.bumpScale.value*=-1)),g.normalMap&&(m.normalMap.value=g.normalMap,e(g.normalMap,m.normalMapTransform),m.normalScale.value.copy(g.normalScale),g.side===Un&&m.normalScale.value.negate()),g.displacementMap&&(m.displacementMap.value=g.displacementMap,e(g.displacementMap,m.displacementMapTransform),m.displacementScale.value=g.displacementScale,m.displacementBias.value=g.displacementBias),g.emissiveMap&&(m.emissiveMap.value=g.emissiveMap,e(g.emissiveMap,m.emissiveMapTransform)),g.specularMap&&(m.specularMap.value=g.specularMap,e(g.specularMap,m.specularMapTransform)),g.alphaTest>0&&(m.alphaTest.value=g.alphaTest);let b=t.get(g),v=b.envMap,S=b.envMapRotation;if(v&&(m.envMap.value=v,Ds.copy(S),Ds.x*=-1,Ds.y*=-1,Ds.z*=-1,v.isCubeTexture&&v.isRenderTargetTexture===!1&&(Ds.y*=-1,Ds.z*=-1),m.envMapRotation.value.setFromMatrix4(PE.makeRotationFromEuler(Ds)),m.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=g.reflectivity,m.ior.value=g.ior,m.refractionRatio.value=g.refractionRatio),g.lightMap){m.lightMap.value=g.lightMap;let D=r._useLegacyLights===!0?Math.PI:1;m.lightMapIntensity.value=g.lightMapIntensity*D,e(g.lightMap,m.lightMapTransform)}g.aoMap&&(m.aoMap.value=g.aoMap,m.aoMapIntensity.value=g.aoMapIntensity,e(g.aoMap,m.aoMapTransform))}function o(m,g){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity,g.map&&(m.map.value=g.map,e(g.map,m.mapTransform))}function a(m,g){m.dashSize.value=g.dashSize,m.totalSize.value=g.dashSize+g.gapSize,m.scale.value=g.scale}function l(m,g,b,v){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity,m.size.value=g.size*b,m.scale.value=v*.5,g.map&&(m.map.value=g.map,e(g.map,m.uvTransform)),g.alphaMap&&(m.alphaMap.value=g.alphaMap,e(g.alphaMap,m.alphaMapTransform)),g.alphaTest>0&&(m.alphaTest.value=g.alphaTest)}function c(m,g){m.diffuse.value.copy(g.color),m.opacity.value=g.opacity,m.rotation.value=g.rotation,g.map&&(m.map.value=g.map,e(g.map,m.mapTransform)),g.alphaMap&&(m.alphaMap.value=g.alphaMap,e(g.alphaMap,m.alphaMapTransform)),g.alphaTest>0&&(m.alphaTest.value=g.alphaTest)}function h(m,g){m.specular.value.copy(g.specular),m.shininess.value=Math.max(g.shininess,1e-4)}function d(m,g){g.gradientMap&&(m.gradientMap.value=g.gradientMap)}function f(m,g){m.metalness.value=g.metalness,g.metalnessMap&&(m.metalnessMap.value=g.metalnessMap,e(g.metalnessMap,m.metalnessMapTransform)),m.roughness.value=g.roughness,g.roughnessMap&&(m.roughnessMap.value=g.roughnessMap,e(g.roughnessMap,m.roughnessMapTransform)),g.envMap&&(m.envMapIntensity.value=g.envMapIntensity)}function u(m,g,b){m.ior.value=g.ior,g.sheen>0&&(m.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),m.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(m.sheenColorMap.value=g.sheenColorMap,e(g.sheenColorMap,m.sheenColorMapTransform)),g.sheenRoughnessMap&&(m.sheenRoughnessMap.value=g.sheenRoughnessMap,e(g.sheenRoughnessMap,m.sheenRoughnessMapTransform))),g.clearcoat>0&&(m.clearcoat.value=g.clearcoat,m.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(m.clearcoatMap.value=g.clearcoatMap,e(g.clearcoatMap,m.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,e(g.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(m.clearcoatNormalMap.value=g.clearcoatNormalMap,e(g.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===Un&&m.clearcoatNormalScale.value.negate())),g.dispersion>0&&(m.dispersion.value=g.dispersion),g.iridescence>0&&(m.iridescence.value=g.iridescence,m.iridescenceIOR.value=g.iridescenceIOR,m.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(m.iridescenceMap.value=g.iridescenceMap,e(g.iridescenceMap,m.iridescenceMapTransform)),g.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=g.iridescenceThicknessMap,e(g.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),g.transmission>0&&(m.transmission.value=g.transmission,m.transmissionSamplerMap.value=b.texture,m.transmissionSamplerSize.value.set(b.width,b.height),g.transmissionMap&&(m.transmissionMap.value=g.transmissionMap,e(g.transmissionMap,m.transmissionMapTransform)),m.thickness.value=g.thickness,g.thicknessMap&&(m.thicknessMap.value=g.thicknessMap,e(g.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=g.attenuationDistance,m.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(m.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(m.anisotropyMap.value=g.anisotropyMap,e(g.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=g.specularIntensity,m.specularColor.value.copy(g.specularColor),g.specularColorMap&&(m.specularColorMap.value=g.specularColorMap,e(g.specularColorMap,m.specularColorMapTransform)),g.specularIntensityMap&&(m.specularIntensityMap.value=g.specularIntensityMap,e(g.specularIntensityMap,m.specularIntensityMapTransform))}function _(m,g){g.matcap&&(m.matcap.value=g.matcap)}function p(m,g){let b=t.get(g).light;m.referencePosition.value.setFromMatrixPosition(b.matrixWorld),m.nearDistance.value=b.shadow.camera.near,m.farDistance.value=b.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function LE(r,t,e,n){let i={},s={},o=[],a=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function l(b,v){let S=v.program;n.uniformBlockBinding(b,S)}function c(b,v){let S=i[b.id];S===void 0&&(_(b),S=h(b),i[b.id]=S,b.addEventListener("dispose",m));let D=v.program;n.updateUBOMapping(b,D);let T=t.render.frame;s[b.id]!==T&&(f(b),s[b.id]=T)}function h(b){let v=d();b.__bindingPointIndex=v;let S=r.createBuffer(),D=b.__size,T=b.usage;return r.bindBuffer(r.UNIFORM_BUFFER,S),r.bufferData(r.UNIFORM_BUFFER,D,T),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,v,S),S}function d(){for(let b=0;b<a;b++)if(o.indexOf(b)===-1)return o.push(b),b;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function f(b){let v=i[b.id],S=b.uniforms,D=b.__cache;r.bindBuffer(r.UNIFORM_BUFFER,v);for(let T=0,w=S.length;T<w;T++){let P=Array.isArray(S[T])?S[T]:[S[T]];for(let M=0,y=P.length;M<y;M++){let I=P[M];if(u(I,T,M,D)===!0){let N=I.__offset,C=Array.isArray(I.value)?I.value:[I.value],V=0;for(let $=0;$<C.length;$++){let W=C[$],Z=p(W);typeof W=="number"||typeof W=="boolean"?(I.__data[0]=W,r.bufferSubData(r.UNIFORM_BUFFER,N+V,I.__data)):W.isMatrix3?(I.__data[0]=W.elements[0],I.__data[1]=W.elements[1],I.__data[2]=W.elements[2],I.__data[3]=0,I.__data[4]=W.elements[3],I.__data[5]=W.elements[4],I.__data[6]=W.elements[5],I.__data[7]=0,I.__data[8]=W.elements[6],I.__data[9]=W.elements[7],I.__data[10]=W.elements[8],I.__data[11]=0):(W.toArray(I.__data,V),V+=Z.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,N,I.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function u(b,v,S,D){let T=b.value,w=v+"_"+S;if(D[w]===void 0)return typeof T=="number"||typeof T=="boolean"?D[w]=T:D[w]=T.clone(),!0;{let P=D[w];if(typeof T=="number"||typeof T=="boolean"){if(P!==T)return D[w]=T,!0}else if(P.equals(T)===!1)return P.copy(T),!0}return!1}function _(b){let v=b.uniforms,S=0,D=16;for(let w=0,P=v.length;w<P;w++){let M=Array.isArray(v[w])?v[w]:[v[w]];for(let y=0,I=M.length;y<I;y++){let N=M[y],C=Array.isArray(N.value)?N.value:[N.value];for(let V=0,$=C.length;V<$;V++){let W=C[V],Z=p(W),z=S%D;z!==0&&D-z<Z.boundary&&(S+=D-z),N.__data=new Float32Array(Z.storage/Float32Array.BYTES_PER_ELEMENT),N.__offset=S,S+=Z.storage}}}let T=S%D;return T>0&&(S+=D-T),b.__size=S,b.__cache={},this}function p(b){let v={boundary:0,storage:0};return typeof b=="number"||typeof b=="boolean"?(v.boundary=4,v.storage=4):b.isVector2?(v.boundary=8,v.storage=8):b.isVector3||b.isColor?(v.boundary=16,v.storage=12):b.isVector4?(v.boundary=16,v.storage=16):b.isMatrix3?(v.boundary=48,v.storage=48):b.isMatrix4?(v.boundary=64,v.storage=64):b.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",b),v}function m(b){let v=b.target;v.removeEventListener("dispose",m);let S=o.indexOf(v.__bindingPointIndex);o.splice(S,1),r.deleteBuffer(i[v.id]),delete i[v.id],delete s[v.id]}function g(){for(let b in i)r.deleteBuffer(i[b]);o=[],i={},s={}}return{bind:l,update:c,dispose:g}}var $c=class{constructor(t={}){let{canvas:e=VS(),context:n=null,depth:i=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:d=!1}=t;this.isWebGLRenderer=!0;let f;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");f=n.getContextAttributes().alpha}else f=o;let u=new Uint32Array(4),_=new Int32Array(4),p=null,m=null,g=[],b=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=ni,this._useLegacyLights=!1,this.toneMapping=Vr,this.toneMappingExposure=1;let v=this,S=!1,D=0,T=0,w=null,P=-1,M=null,y=new Qe,I=new Qe,N=null,C=new ge(0),V=0,$=e.width,W=e.height,Z=1,z=null,U=null,R=new Qe(0,0,$,W),at=new Qe(0,0,$,W),_t=!1,Ut=new Ka,X=!1,ot=!1,xt=new Oe,ct=new nt,Rt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function kt(){return w===null?Z:1}let q=n;function $t(E,B){return e.getContext(E,B)}try{let E={alpha:!0,depth:i,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:d};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${yd}`),e.addEventListener("webglcontextlost",k,!1),e.addEventListener("webglcontextrestored",Q,!1),e.addEventListener("webglcontextcreationerror",st,!1),q===null){let B="webgl2";if(q=$t(B,E),q===null)throw $t(B)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(E){throw console.error("THREE.WebGLRenderer: "+E.message),E}let It,Ft,bt,Et,Ht,G,jt,A,x,F,Y,tt,it,vt,pt,lt,Lt,ht,yt,qt,ut,Tt,Wt,Zt;function ue(){It=new jw(q),It.init(),Tt=new AE(q,It),Ft=new Yw(q,It,t,Tt),bt=new EE(q),Et=new e1(q),Ht=new dE,G=new TE(q,It,bt,Ht,Ft,Tt,Et),jt=new Zw(v),A=new Kw(v),x=new lM(q),Wt=new Ww(q,x),F=new Qw(q,x,Et,Wt),Y=new i1(q,F,x,Et),yt=new n1(q,Ft,G),lt=new qw(Ht),tt=new fE(v,jt,A,It,Ft,Wt,lt),it=new IE(v,Ht),vt=new mE,pt=new SE(It),ht=new Gw(v,jt,A,bt,Y,f,l),Lt=new wE(v,Y,Ft),Zt=new LE(q,Et,Ft,bt),qt=new Xw(q,It,Et),ut=new t1(q,It,Et),Et.programs=tt.programs,v.capabilities=Ft,v.extensions=It,v.properties=Ht,v.renderLists=vt,v.shadowMap=Lt,v.state=bt,v.info=Et}ue();let Jt=new rd(v,q);this.xr=Jt,this.getContext=function(){return q},this.getContextAttributes=function(){return q.getContextAttributes()},this.forceContextLoss=function(){let E=It.get("WEBGL_lose_context");E&&E.loseContext()},this.forceContextRestore=function(){let E=It.get("WEBGL_lose_context");E&&E.restoreContext()},this.getPixelRatio=function(){return Z},this.setPixelRatio=function(E){E!==void 0&&(Z=E,this.setSize($,W,!1))},this.getSize=function(E){return E.set($,W)},this.setSize=function(E,B,H=!0){if(Jt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}$=E,W=B,e.width=Math.floor(E*Z),e.height=Math.floor(B*Z),H===!0&&(e.style.width=E+"px",e.style.height=B+"px"),this.setViewport(0,0,E,B)},this.getDrawingBufferSize=function(E){return E.set($*Z,W*Z).floor()},this.setDrawingBufferSize=function(E,B,H){$=E,W=B,Z=H,e.width=Math.floor(E*H),e.height=Math.floor(B*H),this.setViewport(0,0,E,B)},this.getCurrentViewport=function(E){return E.copy(y)},this.getViewport=function(E){return E.copy(R)},this.setViewport=function(E,B,H,K){E.isVector4?R.set(E.x,E.y,E.z,E.w):R.set(E,B,H,K),bt.viewport(y.copy(R).multiplyScalar(Z).round())},this.getScissor=function(E){return E.copy(at)},this.setScissor=function(E,B,H,K){E.isVector4?at.set(E.x,E.y,E.z,E.w):at.set(E,B,H,K),bt.scissor(I.copy(at).multiplyScalar(Z).round())},this.getScissorTest=function(){return _t},this.setScissorTest=function(E){bt.setScissorTest(_t=E)},this.setOpaqueSort=function(E){z=E},this.setTransparentSort=function(E){U=E},this.getClearColor=function(E){return E.copy(ht.getClearColor())},this.setClearColor=function(){ht.setClearColor.apply(ht,arguments)},this.getClearAlpha=function(){return ht.getClearAlpha()},this.setClearAlpha=function(){ht.setClearAlpha.apply(ht,arguments)},this.clear=function(E=!0,B=!0,H=!0){let K=0;if(E){let J=!1;if(w!==null){let St=w.texture.format;J=St===P0||St===R0||St===C0}if(J){let St=w.texture.type,At=St===Gr||St===Ho||St===E0||St===Qa||St===A0||St===D0,Pt=ht.getClearColor(),Xt=ht.getClearAlpha(),te=Pt.r,Gt=Pt.g,Vt=Pt.b;At?(u[0]=te,u[1]=Gt,u[2]=Vt,u[3]=Xt,q.clearBufferuiv(q.COLOR,0,u)):(_[0]=te,_[1]=Gt,_[2]=Vt,_[3]=Xt,q.clearBufferiv(q.COLOR,0,_))}else K|=q.COLOR_BUFFER_BIT}B&&(K|=q.DEPTH_BUFFER_BIT),H&&(K|=q.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),q.clear(K)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",k,!1),e.removeEventListener("webglcontextrestored",Q,!1),e.removeEventListener("webglcontextcreationerror",st,!1),vt.dispose(),pt.dispose(),Ht.dispose(),jt.dispose(),A.dispose(),Y.dispose(),Wt.dispose(),Zt.dispose(),tt.dispose(),Jt.dispose(),Jt.removeEventListener("sessionstart",rt),Jt.removeEventListener("sessionend",O),j.stop()};function k(E){E.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),S=!0}function Q(){console.log("THREE.WebGLRenderer: Context Restored."),S=!1;let E=Et.autoReset,B=Lt.enabled,H=Lt.autoUpdate,K=Lt.needsUpdate,J=Lt.type;ue(),Et.autoReset=E,Lt.enabled=B,Lt.autoUpdate=H,Lt.needsUpdate=K,Lt.type=J}function st(E){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",E.statusMessage)}function mt(E){let B=E.target;B.removeEventListener("dispose",mt),gt(B)}function gt(E){Bt(E),Ht.remove(E)}function Bt(E){let B=Ht.get(E).programs;B!==void 0&&(B.forEach(function(H){tt.releaseProgram(H)}),E.isShaderMaterial&&tt.releaseShaderCache(E))}this.renderBufferDirect=function(E,B,H,K,J,St){B===null&&(B=Rt);let At=J.isMesh&&J.matrixWorld.determinant()<0,Pt=he(E,B,H,K,J);bt.setMaterial(K,At);let Xt=H.index,te=1;if(K.wireframe===!0){if(Xt=F.getWireframeAttribute(H),Xt===void 0)return;te=2}let Gt=H.drawRange,Vt=H.attributes.position,xe=Gt.start*te,Be=(Gt.start+Gt.count)*te;St!==null&&(xe=Math.max(xe,St.start*te),Be=Math.min(Be,(St.start+St.count)*te)),Xt!==null?(xe=Math.max(xe,0),Be=Math.min(Be,Xt.count)):Vt!=null&&(xe=Math.max(xe,0),Be=Math.min(Be,Vt.count));let sn=Be-xe;if(sn<0||sn===1/0)return;Wt.setup(J,K,Pt,H,Xt);let _n,ie=qt;if(Xt!==null&&(_n=x.get(Xt),ie=ut,ie.setIndex(_n)),J.isMesh)K.wireframe===!0?(bt.setLineWidth(K.wireframeLinewidth*kt()),ie.setMode(q.LINES)):ie.setMode(q.TRIANGLES);else if(J.isLine){let Qt=K.linewidth;Qt===void 0&&(Qt=1),bt.setLineWidth(Qt*kt()),J.isLineSegments?ie.setMode(q.LINES):J.isLineLoop?ie.setMode(q.LINE_LOOP):ie.setMode(q.LINE_STRIP)}else J.isPoints?ie.setMode(q.POINTS):J.isSprite&&ie.setMode(q.TRIANGLES);if(J.isBatchedMesh)J._multiDrawInstances!==null?ie.renderMultiDrawInstances(J._multiDrawStarts,J._multiDrawCounts,J._multiDrawCount,J._multiDrawInstances):ie.renderMultiDraw(J._multiDrawStarts,J._multiDrawCounts,J._multiDrawCount);else if(J.isInstancedMesh)ie.renderInstances(xe,sn,J.count);else if(H.isInstancedBufferGeometry){let Qt=H._maxInstanceCount!==void 0?H._maxInstanceCount:1/0,bi=Math.min(H.instanceCount,Qt);ie.renderInstances(xe,sn,bi)}else ie.render(xe,sn)};function ne(E,B,H){E.transparent===!0&&E.side===or&&E.forceSinglePass===!1?(E.side=Un,E.needsUpdate=!0,zt(E,B,H),E.side=Hr,E.needsUpdate=!0,zt(E,B,H),E.side=or):zt(E,B,H)}this.compile=function(E,B,H=null){H===null&&(H=E),m=pt.get(H),m.init(B),b.push(m),H.traverseVisible(function(J){J.isLight&&J.layers.test(B.layers)&&(m.pushLight(J),J.castShadow&&m.pushShadow(J))}),E!==H&&E.traverseVisible(function(J){J.isLight&&J.layers.test(B.layers)&&(m.pushLight(J),J.castShadow&&m.pushShadow(J))}),m.setupLights(v._useLegacyLights);let K=new Set;return E.traverse(function(J){let St=J.material;if(St)if(Array.isArray(St))for(let At=0;At<St.length;At++){let Pt=St[At];ne(Pt,H,J),K.add(Pt)}else ne(St,H,J),K.add(St)}),b.pop(),m=null,K},this.compileAsync=function(E,B,H=null){let K=this.compile(E,B,H);return new Promise(J=>{function St(){if(K.forEach(function(At){Ht.get(At).currentProgram.isReady()&&K.delete(At)}),K.size===0){J(E);return}setTimeout(St,10)}It.get("KHR_parallel_shader_compile")!==null?St():setTimeout(St,10)})};let Mt=null;function L(E){Mt&&Mt(E)}function rt(){j.stop()}function O(){j.start()}let j=new U0;j.setAnimationLoop(L),typeof self<"u"&&j.setContext(self),this.setAnimationLoop=function(E){Mt=E,Jt.setAnimationLoop(E),E===null?j.stop():j.start()},Jt.addEventListener("sessionstart",rt),Jt.addEventListener("sessionend",O),this.render=function(E,B){if(B!==void 0&&B.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(S===!0)return;E.matrixWorldAutoUpdate===!0&&E.updateMatrixWorld(),B.parent===null&&B.matrixWorldAutoUpdate===!0&&B.updateMatrixWorld(),Jt.enabled===!0&&Jt.isPresenting===!0&&(Jt.cameraAutoUpdate===!0&&Jt.updateCamera(B),B=Jt.getCamera()),E.isScene===!0&&E.onBeforeRender(v,E,B,w),m=pt.get(E,b.length),m.init(B),b.push(m),xt.multiplyMatrices(B.projectionMatrix,B.matrixWorldInverse),Ut.setFromProjectionMatrix(xt),ot=this.localClippingEnabled,X=lt.init(this.clippingPlanes,ot),p=vt.get(E,g.length),p.init(),g.push(p),dt(E,B,0,v.sortObjects),p.finish(),v.sortObjects===!0&&p.sort(z,U);let H=Jt.enabled===!1||Jt.isPresenting===!1||Jt.hasDepthSensing()===!1;H&&ht.addToRenderList(p,E),this.info.render.frame++,X===!0&<.beginShadows();let K=m.state.shadowsArray;Lt.render(K,E,B),X===!0&<.endShadows(),this.info.autoReset===!0&&this.info.reset();let J=p.opaque,St=p.transmissive;if(m.setupLights(v._useLegacyLights),B.isArrayCamera){let At=B.cameras;if(St.length>0)for(let Pt=0,Xt=At.length;Pt<Xt;Pt++){let te=At[Pt];wt(J,St,E,te)}H&&ht.render(E);for(let Pt=0,Xt=At.length;Pt<Xt;Pt++){let te=At[Pt];et(p,E,te,te.viewport)}}else St.length>0&&wt(J,St,E,B),H&&ht.render(E),et(p,E,B);w!==null&&(G.updateMultisampleRenderTarget(w),G.updateRenderTargetMipmap(w)),E.isScene===!0&&E.onAfterRender(v,E,B),Wt.resetDefaultState(),P=-1,M=null,b.pop(),b.length>0?(m=b[b.length-1],X===!0&<.setGlobalState(v.clippingPlanes,m.state.camera)):m=null,g.pop(),g.length>0?p=g[g.length-1]:p=null};function dt(E,B,H,K){if(E.visible===!1)return;if(E.layers.test(B.layers)){if(E.isGroup)H=E.renderOrder;else if(E.isLOD)E.autoUpdate===!0&&E.update(B);else if(E.isLight)m.pushLight(E),E.castShadow&&m.pushShadow(E);else if(E.isSprite){if(!E.frustumCulled||Ut.intersectsSprite(E)){K&&ct.setFromMatrixPosition(E.matrixWorld).applyMatrix4(xt);let At=Y.update(E),Pt=E.material;Pt.visible&&p.push(E,At,Pt,H,ct.z,null)}}else if((E.isMesh||E.isLine||E.isPoints)&&(!E.frustumCulled||Ut.intersectsObject(E))){let At=Y.update(E),Pt=E.material;if(K&&(E.boundingSphere!==void 0?(E.boundingSphere===null&&E.computeBoundingSphere(),ct.copy(E.boundingSphere.center)):(At.boundingSphere===null&&At.computeBoundingSphere(),ct.copy(At.boundingSphere.center)),ct.applyMatrix4(E.matrixWorld).applyMatrix4(xt)),Array.isArray(Pt)){let Xt=At.groups;for(let te=0,Gt=Xt.length;te<Gt;te++){let Vt=Xt[te],xe=Pt[Vt.materialIndex];xe&&xe.visible&&p.push(E,At,xe,H,ct.z,Vt)}}else Pt.visible&&p.push(E,At,Pt,H,ct.z,null)}}let St=E.children;for(let At=0,Pt=St.length;At<Pt;At++)dt(St[At],B,H,K)}function et(E,B,H,K){let J=E.opaque,St=E.transmissive,At=E.transparent;m.setupLightsView(H),X===!0&<.setGlobalState(v.clippingPlanes,H),K&&bt.viewport(y.copy(K)),J.length>0&&ft(J,B,H),St.length>0&&ft(St,B,H),At.length>0&&ft(At,B,H),bt.buffers.depth.setTest(!0),bt.buffers.depth.setMask(!0),bt.buffers.color.setMask(!0),bt.setPolygonOffset(!1)}function wt(E,B,H,K){if((H.isScene===!0?H.overrideMaterial:null)!==null)return;m.state.transmissionRenderTarget[K.id]===void 0&&(m.state.transmissionRenderTarget[K.id]=new lr(1,1,{generateMipmaps:!0,type:It.has("EXT_color_buffer_half_float")||It.has("EXT_color_buffer_float")?iu:Gr,minFilter:Ls,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1}));let St=m.state.transmissionRenderTarget[K.id],At=K.viewport||y;St.setSize(At.z,At.w);let Pt=v.getRenderTarget();v.setRenderTarget(St),v.getClearColor(C),V=v.getClearAlpha(),V<1&&v.setClearColor(16777215,.5),v.clear();let Xt=v.toneMapping;v.toneMapping=Vr;let te=K.viewport;if(K.viewport!==void 0&&(K.viewport=void 0),m.setupLightsView(K),X===!0&<.setGlobalState(v.clippingPlanes,K),ft(E,H,K),G.updateMultisampleRenderTarget(St),G.updateRenderTargetMipmap(St),It.has("WEBGL_multisampled_render_to_texture")===!1){let Gt=!1;for(let Vt=0,xe=B.length;Vt<xe;Vt++){let Be=B[Vt],sn=Be.object,_n=Be.geometry,ie=Be.material,Qt=Be.group;if(ie.side===or&&sn.layers.test(K.layers)){let bi=ie.side;ie.side=Un,ie.needsUpdate=!0,Dt(sn,H,K,_n,ie,Qt),ie.side=bi,ie.needsUpdate=!0,Gt=!0}}Gt===!0&&(G.updateMultisampleRenderTarget(St),G.updateRenderTargetMipmap(St))}v.setRenderTarget(Pt),v.setClearColor(C,V),te!==void 0&&(K.viewport=te),v.toneMapping=Xt}function ft(E,B,H){let K=B.isScene===!0?B.overrideMaterial:null;for(let J=0,St=E.length;J<St;J++){let At=E[J],Pt=At.object,Xt=At.geometry,te=K===null?At.material:K,Gt=At.group;Pt.layers.test(H.layers)&&Dt(Pt,B,H,Xt,te,Gt)}}function Dt(E,B,H,K,J,St){E.onBeforeRender(v,B,H,K,J,St),E.modelViewMatrix.multiplyMatrices(H.matrixWorldInverse,E.matrixWorld),E.normalMatrix.getNormalMatrix(E.modelViewMatrix),J.onBeforeRender(v,B,H,K,E,St),J.transparent===!0&&J.side===or&&J.forceSinglePass===!1?(J.side=Un,J.needsUpdate=!0,v.renderBufferDirect(H,B,K,J,E,St),J.side=Hr,J.needsUpdate=!0,v.renderBufferDirect(H,B,K,J,E,St),J.side=or):v.renderBufferDirect(H,B,K,J,E,St),E.onAfterRender(v,B,H,K,J,St)}function zt(E,B,H){B.isScene!==!0&&(B=Rt);let K=Ht.get(E),J=m.state.lights,St=m.state.shadowsArray,At=J.state.version,Pt=tt.getParameters(E,J.state,St,B,H),Xt=tt.getProgramCacheKey(Pt),te=K.programs;K.environment=E.isMeshStandardMaterial?B.environment:null,K.fog=B.fog,K.envMap=(E.isMeshStandardMaterial?A:jt).get(E.envMap||K.environment),K.envMapRotation=K.environment!==null&&E.envMap===null?B.environmentRotation:E.envMapRotation,te===void 0&&(E.addEventListener("dispose",mt),te=new Map,K.programs=te);let Gt=te.get(Xt);if(Gt!==void 0){if(K.currentProgram===Gt&&K.lightsStateVersion===At)return ee(E,Pt),Gt}else Pt.uniforms=tt.getUniforms(E),E.onBuild(H,Pt,v),E.onBeforeCompile(Pt,v),Gt=tt.acquireProgram(Pt,Xt),te.set(Xt,Gt),K.uniforms=Pt.uniforms;let Vt=K.uniforms;return(!E.isShaderMaterial&&!E.isRawShaderMaterial||E.clipping===!0)&&(Vt.clippingPlanes=lt.uniform),ee(E,Pt),K.needsLights=ae(E),K.lightsStateVersion=At,K.needsLights&&(Vt.ambientLightColor.value=J.state.ambient,Vt.lightProbe.value=J.state.probe,Vt.directionalLights.value=J.state.directional,Vt.directionalLightShadows.value=J.state.directionalShadow,Vt.spotLights.value=J.state.spot,Vt.spotLightShadows.value=J.state.spotShadow,Vt.rectAreaLights.value=J.state.rectArea,Vt.ltc_1.value=J.state.rectAreaLTC1,Vt.ltc_2.value=J.state.rectAreaLTC2,Vt.pointLights.value=J.state.point,Vt.pointLightShadows.value=J.state.pointShadow,Vt.hemisphereLights.value=J.state.hemi,Vt.directionalShadowMap.value=J.state.directionalShadowMap,Vt.directionalShadowMatrix.value=J.state.directionalShadowMatrix,Vt.spotShadowMap.value=J.state.spotShadowMap,Vt.spotLightMatrix.value=J.state.spotLightMatrix,Vt.spotLightMap.value=J.state.spotLightMap,Vt.pointShadowMap.value=J.state.pointShadowMap,Vt.pointShadowMatrix.value=J.state.pointShadowMatrix),K.currentProgram=Gt,K.uniformsList=null,Gt}function Nt(E){if(E.uniformsList===null){let B=E.currentProgram.getUniforms();E.uniformsList=ko.seqWithValue(B.seq,E.uniforms)}return E.uniformsList}function ee(E,B){let H=Ht.get(E);H.outputColorSpace=B.outputColorSpace,H.batching=B.batching,H.instancing=B.instancing,H.instancingColor=B.instancingColor,H.instancingMorph=B.instancingMorph,H.skinning=B.skinning,H.morphTargets=B.morphTargets,H.morphNormals=B.morphNormals,H.morphColors=B.morphColors,H.morphTargetsCount=B.morphTargetsCount,H.numClippingPlanes=B.numClippingPlanes,H.numIntersection=B.numClipIntersection,H.vertexAlphas=B.vertexAlphas,H.vertexTangents=B.vertexTangents,H.toneMapping=B.toneMapping}function he(E,B,H,K,J){B.isScene!==!0&&(B=Rt),G.resetTextureUnits();let St=B.fog,At=K.isMeshStandardMaterial?B.environment:null,Pt=w===null?v.outputColorSpace:w.isXRRenderTarget===!0?w.texture.colorSpace:Yr,Xt=(K.isMeshStandardMaterial?A:jt).get(K.envMap||At),te=K.vertexColors===!0&&!!H.attributes.color&&H.attributes.color.itemSize===4,Gt=!!H.attributes.tangent&&(!!K.normalMap||K.anisotropy>0),Vt=!!H.morphAttributes.position,xe=!!H.morphAttributes.normal,Be=!!H.morphAttributes.color,sn=Vr;K.toneMapped&&(w===null||w.isXRRenderTarget===!0)&&(sn=v.toneMapping);let _n=H.morphAttributes.position||H.morphAttributes.normal||H.morphAttributes.color,ie=_n!==void 0?_n.length:0,Qt=Ht.get(K),bi=m.state.lights;if(X===!0&&(ot===!0||E!==M)){let Xn=E===M&&K.id===P;lt.setState(K,E,Xn)}let ve=!1;K.version===Qt.__version?(Qt.needsLights&&Qt.lightsStateVersion!==bi.state.version||Qt.outputColorSpace!==Pt||J.isBatchedMesh&&Qt.batching===!1||!J.isBatchedMesh&&Qt.batching===!0||J.isInstancedMesh&&Qt.instancing===!1||!J.isInstancedMesh&&Qt.instancing===!0||J.isSkinnedMesh&&Qt.skinning===!1||!J.isSkinnedMesh&&Qt.skinning===!0||J.isInstancedMesh&&Qt.instancingColor===!0&&J.instanceColor===null||J.isInstancedMesh&&Qt.instancingColor===!1&&J.instanceColor!==null||J.isInstancedMesh&&Qt.instancingMorph===!0&&J.morphTexture===null||J.isInstancedMesh&&Qt.instancingMorph===!1&&J.morphTexture!==null||Qt.envMap!==Xt||K.fog===!0&&Qt.fog!==St||Qt.numClippingPlanes!==void 0&&(Qt.numClippingPlanes!==lt.numPlanes||Qt.numIntersection!==lt.numIntersection)||Qt.vertexAlphas!==te||Qt.vertexTangents!==Gt||Qt.morphTargets!==Vt||Qt.morphNormals!==xe||Qt.morphColors!==Be||Qt.toneMapping!==sn||Qt.morphTargetsCount!==ie)&&(ve=!0):(ve=!0,Qt.__version=K.version);let qr=Qt.currentProgram;ve===!0&&(qr=zt(K,B,J));let Ed=!1,qo=!1,ou=!1,on=qr.getUniforms(),ur=Qt.uniforms;if(bt.useProgram(qr.program)&&(Ed=!0,qo=!0,ou=!0),K.id!==P&&(P=K.id,qo=!0),Ed||M!==E){on.setValue(q,"projectionMatrix",E.projectionMatrix),on.setValue(q,"viewMatrix",E.matrixWorldInverse);let Xn=on.map.cameraPosition;Xn!==void 0&&Xn.setValue(q,ct.setFromMatrixPosition(E.matrixWorld)),Ft.logarithmicDepthBuffer&&on.setValue(q,"logDepthBufFC",2/(Math.log(E.far+1)/Math.LN2)),(K.isMeshPhongMaterial||K.isMeshToonMaterial||K.isMeshLambertMaterial||K.isMeshBasicMaterial||K.isMeshStandardMaterial||K.isShaderMaterial)&&on.setValue(q,"isOrthographic",E.isOrthographicCamera===!0),M!==E&&(M=E,qo=!0,ou=!0)}if(J.isSkinnedMesh){on.setOptional(q,J,"bindMatrix"),on.setOptional(q,J,"bindMatrixInverse");let Xn=J.skeleton;Xn&&(Xn.boneTexture===null&&Xn.computeBoneTexture(),on.setValue(q,"boneTexture",Xn.boneTexture,G))}J.isBatchedMesh&&(on.setOptional(q,J,"batchingTexture"),on.setValue(q,"batchingTexture",J._matricesTexture,G));let au=H.morphAttributes;if((au.position!==void 0||au.normal!==void 0||au.color!==void 0)&&yt.update(J,H,qr),(qo||Qt.receiveShadow!==J.receiveShadow)&&(Qt.receiveShadow=J.receiveShadow,on.setValue(q,"receiveShadow",J.receiveShadow)),K.isMeshGouraudMaterial&&K.envMap!==null&&(ur.envMap.value=Xt,ur.flipEnvMap.value=Xt.isCubeTexture&&Xt.isRenderTargetTexture===!1?-1:1),K.isMeshStandardMaterial&&K.envMap===null&&B.environment!==null&&(ur.envMapIntensity.value=B.environmentIntensity),qo&&(on.setValue(q,"toneMappingExposure",v.toneMappingExposure),Qt.needsLights&&me(ur,ou),St&&K.fog===!0&&it.refreshFogUniforms(ur,St),it.refreshMaterialUniforms(ur,K,Z,W,m.state.transmissionRenderTarget[E.id]),ko.upload(q,Nt(Qt),ur,G)),K.isShaderMaterial&&K.uniformsNeedUpdate===!0&&(ko.upload(q,Nt(Qt),ur,G),K.uniformsNeedUpdate=!1),K.isSpriteMaterial&&on.setValue(q,"center",J.center),on.setValue(q,"modelViewMatrix",J.modelViewMatrix),on.setValue(q,"normalMatrix",J.normalMatrix),on.setValue(q,"modelMatrix",J.matrixWorld),K.isShaderMaterial||K.isRawShaderMaterial){let Xn=K.uniformsGroups;for(let lu=0,G0=Xn.length;lu<G0;lu++){let Td=Xn[lu];Zt.update(Td,qr),Zt.bind(Td,qr)}}return qr}function me(E,B){E.ambientLightColor.needsUpdate=B,E.lightProbe.needsUpdate=B,E.directionalLights.needsUpdate=B,E.directionalLightShadows.needsUpdate=B,E.pointLights.needsUpdate=B,E.pointLightShadows.needsUpdate=B,E.spotLights.needsUpdate=B,E.spotLightShadows.needsUpdate=B,E.rectAreaLights.needsUpdate=B,E.hemisphereLights.needsUpdate=B}function ae(E){return E.isMeshLambertMaterial||E.isMeshToonMaterial||E.isMeshPhongMaterial||E.isMeshStandardMaterial||E.isShadowMaterial||E.isShaderMaterial&&E.lights===!0}this.getActiveCubeFace=function(){return D},this.getActiveMipmapLevel=function(){return T},this.getRenderTarget=function(){return w},this.setRenderTargetTextures=function(E,B,H){Ht.get(E.texture).__webglTexture=B,Ht.get(E.depthTexture).__webglTexture=H;let K=Ht.get(E);K.__hasExternalTextures=!0,K.__autoAllocateDepthBuffer=H===void 0,K.__autoAllocateDepthBuffer||It.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),K.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(E,B){let H=Ht.get(E);H.__webglFramebuffer=B,H.__useDefaultFramebuffer=B===void 0},this.setRenderTarget=function(E,B=0,H=0){w=E,D=B,T=H;let K=!0,J=null,St=!1,At=!1;if(E){let Xt=Ht.get(E);Xt.__useDefaultFramebuffer!==void 0?(bt.bindFramebuffer(q.FRAMEBUFFER,null),K=!1):Xt.__webglFramebuffer===void 0?G.setupRenderTarget(E):Xt.__hasExternalTextures&&G.rebindTextures(E,Ht.get(E.texture).__webglTexture,Ht.get(E.depthTexture).__webglTexture);let te=E.texture;(te.isData3DTexture||te.isDataArrayTexture||te.isCompressedArrayTexture)&&(At=!0);let Gt=Ht.get(E).__webglFramebuffer;E.isWebGLCubeRenderTarget?(Array.isArray(Gt[B])?J=Gt[B][H]:J=Gt[B],St=!0):E.samples>0&&G.useMultisampledRTT(E)===!1?J=Ht.get(E).__webglMultisampledFramebuffer:Array.isArray(Gt)?J=Gt[H]:J=Gt,y.copy(E.viewport),I.copy(E.scissor),N=E.scissorTest}else y.copy(R).multiplyScalar(Z).floor(),I.copy(at).multiplyScalar(Z).floor(),N=_t;if(bt.bindFramebuffer(q.FRAMEBUFFER,J)&&K&&bt.drawBuffers(E,J),bt.viewport(y),bt.scissor(I),bt.setScissorTest(N),St){let Xt=Ht.get(E.texture);q.framebufferTexture2D(q.FRAMEBUFFER,q.COLOR_ATTACHMENT0,q.TEXTURE_CUBE_MAP_POSITIVE_X+B,Xt.__webglTexture,H)}else if(At){let Xt=Ht.get(E.texture),te=B||0;q.framebufferTextureLayer(q.FRAMEBUFFER,q.COLOR_ATTACHMENT0,Xt.__webglTexture,H||0,te)}P=-1},this.readRenderTargetPixels=function(E,B,H,K,J,St,At){if(!(E&&E.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Pt=Ht.get(E).__webglFramebuffer;if(E.isWebGLCubeRenderTarget&&At!==void 0&&(Pt=Pt[At]),Pt){bt.bindFramebuffer(q.FRAMEBUFFER,Pt);try{let Xt=E.texture,te=Xt.format,Gt=Xt.type;if(!Ft.textureFormatReadable(te)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Ft.textureTypeReadable(Gt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}B>=0&&B<=E.width-K&&H>=0&&H<=E.height-J&&q.readPixels(B,H,K,J,Tt.convert(te),Tt.convert(Gt),St)}finally{let Xt=w!==null?Ht.get(w).__webglFramebuffer:null;bt.bindFramebuffer(q.FRAMEBUFFER,Xt)}}},this.copyFramebufferToTexture=function(E,B,H=0){let K=Math.pow(2,-H),J=Math.floor(B.image.width*K),St=Math.floor(B.image.height*K);G.setTexture2D(B,0),q.copyTexSubImage2D(q.TEXTURE_2D,H,0,0,E.x,E.y,J,St),bt.unbindTexture()},this.copyTextureToTexture=function(E,B,H,K=0){let J=B.image.width,St=B.image.height,At=Tt.convert(H.format),Pt=Tt.convert(H.type);G.setTexture2D(H,0),q.pixelStorei(q.UNPACK_FLIP_Y_WEBGL,H.flipY),q.pixelStorei(q.UNPACK_PREMULTIPLY_ALPHA_WEBGL,H.premultiplyAlpha),q.pixelStorei(q.UNPACK_ALIGNMENT,H.unpackAlignment),B.isDataTexture?q.texSubImage2D(q.TEXTURE_2D,K,E.x,E.y,J,St,At,Pt,B.image.data):B.isCompressedTexture?q.compressedTexSubImage2D(q.TEXTURE_2D,K,E.x,E.y,B.mipmaps[0].width,B.mipmaps[0].height,At,B.mipmaps[0].data):q.texSubImage2D(q.TEXTURE_2D,K,E.x,E.y,At,Pt,B.image),K===0&&H.generateMipmaps&&q.generateMipmap(q.TEXTURE_2D),bt.unbindTexture()},this.copyTextureToTexture3D=function(E,B,H,K,J=0){let St=E.max.x-E.min.x,At=E.max.y-E.min.y,Pt=E.max.z-E.min.z,Xt=Tt.convert(K.format),te=Tt.convert(K.type),Gt;if(K.isData3DTexture)G.setTexture3D(K,0),Gt=q.TEXTURE_3D;else if(K.isDataArrayTexture||K.isCompressedArrayTexture)G.setTexture2DArray(K,0),Gt=q.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}q.pixelStorei(q.UNPACK_FLIP_Y_WEBGL,K.flipY),q.pixelStorei(q.UNPACK_PREMULTIPLY_ALPHA_WEBGL,K.premultiplyAlpha),q.pixelStorei(q.UNPACK_ALIGNMENT,K.unpackAlignment);let Vt=q.getParameter(q.UNPACK_ROW_LENGTH),xe=q.getParameter(q.UNPACK_IMAGE_HEIGHT),Be=q.getParameter(q.UNPACK_SKIP_PIXELS),sn=q.getParameter(q.UNPACK_SKIP_ROWS),_n=q.getParameter(q.UNPACK_SKIP_IMAGES),ie=H.isCompressedTexture?H.mipmaps[J]:H.image;q.pixelStorei(q.UNPACK_ROW_LENGTH,ie.width),q.pixelStorei(q.UNPACK_IMAGE_HEIGHT,ie.height),q.pixelStorei(q.UNPACK_SKIP_PIXELS,E.min.x),q.pixelStorei(q.UNPACK_SKIP_ROWS,E.min.y),q.pixelStorei(q.UNPACK_SKIP_IMAGES,E.min.z),H.isDataTexture||H.isData3DTexture?q.texSubImage3D(Gt,J,B.x,B.y,B.z,St,At,Pt,Xt,te,ie.data):K.isCompressedArrayTexture?q.compressedTexSubImage3D(Gt,J,B.x,B.y,B.z,St,At,Pt,Xt,ie.data):q.texSubImage3D(Gt,J,B.x,B.y,B.z,St,At,Pt,Xt,te,ie),q.pixelStorei(q.UNPACK_ROW_LENGTH,Vt),q.pixelStorei(q.UNPACK_IMAGE_HEIGHT,xe),q.pixelStorei(q.UNPACK_SKIP_PIXELS,Be),q.pixelStorei(q.UNPACK_SKIP_ROWS,sn),q.pixelStorei(q.UNPACK_SKIP_IMAGES,_n),J===0&&K.generateMipmaps&&q.generateMipmap(Gt),bt.unbindTexture()},this.initTexture=function(E){E.isCubeTexture?G.setTextureCube(E,0):E.isData3DTexture?G.setTexture3D(E,0):E.isDataArrayTexture||E.isCompressedArrayTexture?G.setTexture2DArray(E,0):G.setTexture2D(E,0),bt.unbindTexture()},this.resetState=function(){D=0,T=0,w=null,bt.reset(),Wt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return ar}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;let e=this.getContext();e.drawingBufferColorSpace=t===Sd?"display-p3":"srgb",e.unpackColorSpace=Se.workingColorSpace===ru?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(t){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=t}};var Kc=class r{constructor(t,e=1,n=1e3){this.isFog=!0,this.name="",this.color=new ge(t),this.near=e,this.far=n}clone(){return new r(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}},jc=class extends gn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new cr,this.environmentIntensity=1,this.environmentRotation=new cr,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){let e=super.toJSON(t);return this.fog!==null&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}};var sd=class extends Ns{constructor(t){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new ge(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}},x0=new Oe,od=new kc,Tc=new Go,Ac=new nt,Qc=class extends gn{constructor(t=new Oi,e=new sd){super(),this.isPoints=!0,this.type="Points",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}raycast(t,e){let n=this.geometry,i=this.matrixWorld,s=t.params.Points.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Tc.copy(n.boundingSphere),Tc.applyMatrix4(i),Tc.radius+=s,t.ray.intersectsSphere(Tc)===!1)return;x0.copy(i).invert(),od.copy(t.ray).applyMatrix4(x0);let a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,c=n.index,d=n.attributes.position;if(c!==null){let f=Math.max(0,o.start),u=Math.min(c.count,o.start+o.count);for(let _=f,p=u;_<p;_++){let m=c.getX(_);Ac.fromBufferAttribute(d,m),y0(Ac,m,l,i,t,e,this)}}else{let f=Math.max(0,o.start),u=Math.min(d.count,o.start+o.count);for(let _=f,p=u;_<p;_++)Ac.fromBufferAttribute(d,_),y0(Ac,_,l,i,t,e,this)}}updateMorphTargets(){let e=this.geometry.morphAttributes,n=Object.keys(e);if(n.length>0){let i=e[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s<o;s++){let a=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}};function y0(r,t,e,n,i,s,o){let a=od.distanceSqToPoint(r);if(a<e){let l=new nt;od.closestPointToPoint(r,l),l.applyMatrix4(n);let c=i.ray.origin.distanceTo(l);if(c<i.near||c>i.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:t,face:null,object:o})}}function Dc(r,t,e){return!r||!e&&r.constructor===t?r:typeof t.BYTES_PER_ELEMENT=="number"?new t(r):Array.prototype.slice.call(r)}function FE(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}var Xo=class{constructor(t,e,n,i){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new e.constructor(n),this.sampleValues=e,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(t){let e=this.parameterPositions,n=this._cachedIndex,i=e[n],s=e[n-1];n:{t:{let o;e:{i:if(!(t<i)){for(let a=n+2;;){if(i===void 0){if(t<s)break i;return n=e.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===a)break;if(s=i,i=e[++n],t<i)break t}o=e.length;break e}if(!(t>=s)){let a=e[1];t<a&&(n=2,s=a);for(let l=n-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===l)break;if(i=s,s=e[--n-1],t>=s)break t}o=n,n=0;break e}break n}for(;n<o;){let a=n+o>>>1;t<e[a]?o=a:n=a+1}if(i=e[n],s=e[n-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return n=e.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,s,i)}return this.interpolate_(n,s,t,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){let e=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=t*i;for(let o=0;o!==i;++o)e[o]=n[s+o];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},ad=class extends Xo{constructor(t,e,n,i){super(t,e,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:T_,endingEnd:T_}}intervalChanged_(t,e,n){let i=this.parameterPositions,s=t-2,o=t+1,a=i[s],l=i[o];if(a===void 0)switch(this.getSettings_().endingStart){case A_:s=t,a=2*e-n;break;case D_:s=i.length-2,a=e+i[s]-i[s+1];break;default:s=t,a=n}if(l===void 0)switch(this.getSettings_().endingEnd){case A_:o=t,l=2*n-e;break;case D_:o=1,l=n+i[1]-i[0];break;default:o=t-1,l=e}let c=(n-e)*.5,h=this.valueSize;this._weightPrev=c/(e-a),this._weightNext=c/(l-n),this._offsetPrev=s*h,this._offsetNext=o*h}interpolate_(t,e,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=t*a,c=l-a,h=this._offsetPrev,d=this._offsetNext,f=this._weightPrev,u=this._weightNext,_=(n-e)/(i-e),p=_*_,m=p*_,g=-f*m+2*f*p-f*_,b=(1+f)*m+(-1.5-2*f)*p+(-.5+f)*_+1,v=(-1-u)*m+(1.5+u)*p+.5*_,S=u*m-u*p;for(let D=0;D!==a;++D)s[D]=g*o[h+D]+b*o[c+D]+v*o[l+D]+S*o[d+D];return s}},ld=class extends Xo{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=t*a,c=l-a,h=(n-e)/(i-e),d=1-h;for(let f=0;f!==a;++f)s[f]=o[c+f]*d+o[l+f]*h;return s}},cd=class extends Xo{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t){return this.copySampleValue_(t-1)}},Mi=class{constructor(t,e,n,i){if(t===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(e===void 0||e.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=Dc(e,this.TimeBufferType),this.values=Dc(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(t){let e=t.constructor,n;if(e.toJSON!==this.toJSON)n=e.toJSON(t);else{n={name:t.name,times:Dc(t.times,Array),values:Dc(t.values,Array)};let i=t.getInterpolation();i!==t.DefaultInterpolation&&(n.interpolation=i)}return n.type=t.ValueTypeName,n}InterpolantFactoryMethodDiscrete(t){return new cd(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new ld(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new ad(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case Rc:e=this.InterpolantFactoryMethodDiscrete;break;case Pc:e=this.InterpolantFactoryMethodLinear;break;case lf:e=this.InterpolantFactoryMethodSmooth;break}if(e===void 0){let n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(t!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Rc;case this.InterpolantFactoryMethodLinear:return Pc;case this.InterpolantFactoryMethodSmooth:return lf}}getValueSize(){return this.values.length/this.times.length}shift(t){if(t!==0){let e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]+=t}return this}scale(t){if(t!==1){let e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]*=t}return this}trim(t,e){let n=this.times,i=n.length,s=0,o=i-1;for(;s!==i&&n[s]<t;)++s;for(;o!==-1&&n[o]>e;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);let a=this.getValueSize();this.times=n.slice(s,o),this.values=this.values.slice(s*a,o*a)}return this}validate(){let t=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);let n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let o=null;for(let a=0;a!==s;a++){let l=n[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),t=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),t=!1;break}o=l}if(i!==void 0&&FE(i))for(let a=0,l=i.length;a!==l;++a){let c=i[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),t=!1;break}}return t}optimize(){let t=this.times.slice(),e=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===lf,s=t.length-1,o=1;for(let a=1;a<s;++a){let l=!1,c=t[a],h=t[a+1];if(c!==h&&(a!==1||c!==t[0]))if(i)l=!0;else{let d=a*n,f=d-n,u=d+n;for(let _=0;_!==n;++_){let p=e[d+_];if(p!==e[f+_]||p!==e[u+_]){l=!0;break}}}if(l){if(a!==o){t[o]=t[a];let d=a*n,f=o*n;for(let u=0;u!==n;++u)e[f+u]=e[d+u]}++o}}if(s>0){t[o]=t[s];for(let a=s*n,l=o*n,c=0;c!==n;++c)e[l+c]=e[a+c];++o}return o!==t.length?(this.times=t.slice(0,o),this.values=e.slice(0,o*n)):(this.times=t,this.values=e),this}clone(){let t=this.times.slice(),e=this.values.slice(),n=this.constructor,i=new n(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}};Mi.prototype.TimeBufferType=Float32Array;Mi.prototype.ValueBufferType=Float32Array;Mi.prototype.DefaultInterpolation=Pc;var Us=class extends Mi{};Us.prototype.ValueTypeName="bool";Us.prototype.ValueBufferType=Array;Us.prototype.DefaultInterpolation=Rc;Us.prototype.InterpolantFactoryMethodLinear=void 0;Us.prototype.InterpolantFactoryMethodSmooth=void 0;var ud=class extends Mi{};ud.prototype.ValueTypeName="color";var hd=class extends Mi{};hd.prototype.ValueTypeName="number";var fd=class extends Xo{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(n-e)/(i-e),c=t*a;for(let h=c+a;c!==h;c+=4)Xr.slerpFlat(s,0,o,c-a,o,c,l);return s}},ja=class extends Mi{InterpolantFactoryMethodLinear(t){return new fd(this.times,this.values,this.getValueSize(),t)}};ja.prototype.ValueTypeName="quaternion";ja.prototype.DefaultInterpolation=Pc;ja.prototype.InterpolantFactoryMethodSmooth=void 0;var Os=class extends Mi{};Os.prototype.ValueTypeName="string";Os.prototype.ValueBufferType=Array;Os.prototype.DefaultInterpolation=Rc;Os.prototype.InterpolantFactoryMethodLinear=void 0;Os.prototype.InterpolantFactoryMethodSmooth=void 0;var dd=class extends Mi{};dd.prototype.ValueTypeName="vector";var pd=class{constructor(t,e,n){let i=this,s=!1,o=0,a=0,l,c=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(h){a++,s===!1&&i.onStart!==void 0&&i.onStart(h,o,a),s=!0},this.itemEnd=function(h){o++,i.onProgress!==void 0&&i.onProgress(h,o,a),o===a&&(s=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(h){i.onError!==void 0&&i.onError(h)},this.resolveURL=function(h){return l?l(h):h},this.setURLModifier=function(h){return l=h,this},this.addHandler=function(h,d){return c.push(h,d),this},this.removeHandler=function(h){let d=c.indexOf(h);return d!==-1&&c.splice(d,2),this},this.getHandler=function(h){for(let d=0,f=c.length;d<f;d+=2){let u=c[d],_=c[d+1];if(u.global&&(u.lastIndex=0),u.test(h))return _}return null}}},NE=new pd,md=class{constructor(t){this.manager=t!==void 0?t:NE,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){let n=this;return new Promise(function(i,s){n.load(t,i,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}};md.DEFAULT_MATERIAL_NAME="__DEFAULT";var tu=class extends gn{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new ge(t),this.intensity=e}dispose(){}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){let e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,this.groundColor!==void 0&&(e.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(e.object.distance=this.distance),this.angle!==void 0&&(e.object.angle=this.angle),this.decay!==void 0&&(e.object.decay=this.decay),this.penumbra!==void 0&&(e.object.penumbra=this.penumbra),this.shadow!==void 0&&(e.object.shadow=this.shadow.toJSON()),e}},eu=class extends tu{constructor(t,e,n){super(t,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(gn.DEFAULT_UP),this.updateMatrix(),this.groundColor=new ge(e)}copy(t,e){return super.copy(t,e),this.groundColor.copy(t.groundColor),this}},Nf=new Oe,v0=new nt,S0=new nt,gd=class{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new _e(512,512),this.map=null,this.mapPass=null,this.matrix=new Oe,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Ka,this._frameExtents=new _e(1,1),this._viewportCount=1,this._viewports=[new Qe(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){let e=this.camera,n=this.matrix;v0.setFromMatrixPosition(t.matrixWorld),e.position.copy(v0),S0.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(S0),e.updateMatrixWorld(),Nf.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Nf),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(Nf)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){let t={};return this.bias!==0&&(t.bias=this.bias),this.normalBias!==0&&(t.normalBias=this.normalBias),this.radius!==1&&(t.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}};var _d=class extends gd{constructor(){super(new qc(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}},Bs=class extends tu{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(gn.DEFAULT_UP),this.updateMatrix(),this.target=new gn,this.shadow=new _d}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}};var bd="\\[\\]\\.:\\/",UE=new RegExp("["+bd+"]","g"),wd="[^"+bd+"]",OE="[^"+bd.replace("\\.","")+"]",BE=/((?:WC+[\/:])*)/.source.replace("WC",wd),kE=/(WCOD+)?/.source.replace("WCOD",OE),zE=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",wd),VE=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",wd),HE=new RegExp("^"+BE+kE+zE+VE+"$"),GE=["material","materials","bones","map"],xd=class{constructor(t,e,n){let i=n||De.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,i)}getValue(t,e){this.bind();let n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(t,e)}setValue(t,e){let n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(t,e)}bind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()}unbind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}},De=class r{constructor(t,e,n){this.path=e,this.parsedPath=n||r.parseTrackName(e),this.node=r.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,n){return t&&t.isAnimationObjectGroup?new r.Composite(t,e,n):new r(t,e,n)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(UE,"")}static parseTrackName(t){let e=HE.exec(t);if(e===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);let n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){let s=n.nodeName.substring(i+1);GE.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}static findNode(t,e){if(e===void 0||e===""||e==="."||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){let n=t.skeleton.getBoneByName(e);if(n!==void 0)return n}if(t.children){let n=function(s){for(let o=0;o<s.length;o++){let a=s[o];if(a.name===e||a.uuid===e)return a;let l=n(a.children);if(l)return l}return null},i=n(t.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)t[e++]=n[i]}_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){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=t[e++]}_setValue_array_setNeedsUpdate(t,e){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=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,e=this.parsedPath,n=e.objectName,i=e.propertyName,s=e.propertyIndex;if(t||(t=r.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(n){let c=e.objectIndex;switch(n){case"materials":if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}t=t.material.materials;break;case"bones":if(!t.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}t=t.skeleton.bones;for(let h=0;h<t.length;h++)if(t[h].name===c){c=h;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}t=t.material.map;break;default:if(t[n]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}t=t[n]}if(c!==void 0){if(t[c]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);return}t=t[c]}}let o=t[i];if(o===void 0){let c=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+i+" but it wasn't found.",t);return}let a=this.Versioning.None;this.targetObject=t,t.needsUpdate!==void 0?a=this.Versioning.NeedsUpdate:t.matrixWorldNeedsUpdate!==void 0&&(a=this.Versioning.MatrixWorldNeedsUpdate);let l=this.BindingType.Direct;if(s!==void 0){if(i==="morphTargetInfluences"){if(!t.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!t.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}t.morphTargetDictionary[s]!==void 0&&(s=t.morphTargetDictionary[s])}l=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(l=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(l=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=i;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};De.Composite=xd;De.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};De.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};De.prototype.GetterByBindingType=[De.prototype._getValue_direct,De.prototype._getValue_array,De.prototype._getValue_arrayElement,De.prototype._getValue_toArray];De.prototype.SetterByBindingTypeAndVersioning=[[De.prototype._setValue_direct,De.prototype._setValue_direct_setNeedsUpdate,De.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[De.prototype._setValue_array,De.prototype._setValue_array_setNeedsUpdate,De.prototype._setValue_array_setMatrixWorldNeedsUpdate],[De.prototype._setValue_arrayElement,De.prototype._setValue_arrayElement_setNeedsUpdate,De.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[De.prototype._setValue_fromArray,De.prototype._setValue_fromArray_setNeedsUpdate,De.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var SA=new Float32Array(1);typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:yd}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=yd);var H0=()=>{var r=new Br;function t(){let e=document.querySelector("#canvas"),n=new $c({canvas:e,antialias:!0,alpha:!0}),i=new jc,s=new Dn(18);s.near=1,s.far=2e3,s.position.z=-10,n.outputColorSpace=ni,n.shadowMap.enabled=!0,n.shadowMap.type=vd,i.fog=new Kc(3741705,9,15),i.add(r);function o(){let h=new eu(16777215,41378,1),d=new Bs(3355443,4);d.position.set(5,5,5),d.lookAt(0,0,0),d.castShadow=!0,d.shadow.mapSize.width=512,d.shadow.mapSize.height=512,d.shadow.camera.near=.5,d.shadow.camera.far=500,i.add(d),i.add(h);let f=[];f[0]=new Bs(16777215,1),f[0].position.set(1,0,0),f[1]=new Bs(11460838,1),f[1].position.set(.75,1,.5),f[2]=new Bs(14277490,1),f[2].position.set(-.75,-1,.5),i.add(f[0]),i.add(f[1]),i.add(f[2])}function a(h,d){let f=new Oi,u=[],_=[],p=d||25,m=p/2;for(let v=0;v<(h||7e3);v++){let S=Math.random()*p-m,D=Math.random()*p-m,T=Math.random()*p-m;u.push(S,D,T),_.push(Math.random()*.9+.1)}f.setAttribute("position",new si(u,3)),f.setAttribute("opacity",new si(_,1)),f.computeBoundingSphere();let g=new ai({vertexShader:`
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3821
|
+
}`,id=class{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,n){if(this.texture===null){let i=new oi,s=t.properties.get(i);s.__webglTexture=e.texture,(e.depthNear!=n.depthNear||e.depthFar!=n.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}render(t,e){if(this.texture!==null){if(this.mesh===null){let n=e.cameras[0].viewport,i=new ai({vertexShader:CE,fragmentShader:RE,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new Si(new Yc(20,20),i)}t.render(this.mesh,e)}}reset(){this.texture=null,this.mesh=null}},rd=class extends Wr{constructor(t,e){super();let n=this,i=null,s=1,o=null,a="local-floor",l=1,c=null,h=null,f=null,d=null,u=null,_=null,m=new id,p=e.getContextAttributes(),g=null,b=null,v=[],S=[],D=new _e,T=null,w=new Dn;w.layers.enable(1),w.viewport=new Qe;let P=new Dn;P.layers.enable(2),P.viewport=new Qe;let M=[w,P],y=new nd;y.layers.enable(1),y.layers.enable(2);let I=null,N=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(X){let ot=v[X];return ot===void 0&&(ot=new Za,v[X]=ot),ot.getTargetRaySpace()},this.getControllerGrip=function(X){let ot=v[X];return ot===void 0&&(ot=new Za,v[X]=ot),ot.getGripSpace()},this.getHand=function(X){let ot=v[X];return ot===void 0&&(ot=new Za,v[X]=ot),ot.getHandSpace()};function C(X){let ot=S.indexOf(X.inputSource);if(ot===-1)return;let xt=v[ot];xt!==void 0&&(xt.update(X.inputSource,X.frame,c||o),xt.dispatchEvent({type:X.type,data:X.inputSource}))}function V(){i.removeEventListener("select",C),i.removeEventListener("selectstart",C),i.removeEventListener("selectend",C),i.removeEventListener("squeeze",C),i.removeEventListener("squeezestart",C),i.removeEventListener("squeezeend",C),i.removeEventListener("end",V),i.removeEventListener("inputsourceschange",$);for(let X=0;X<v.length;X++){let ot=S[X];ot!==null&&(S[X]=null,v[X].disconnect(ot))}I=null,N=null,m.reset(),t.setRenderTarget(g),u=null,d=null,f=null,i=null,b=null,Ut.stop(),n.isPresenting=!1,t.setPixelRatio(T),t.setSize(D.width,D.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(X){s=X,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(X){a=X,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||o},this.setReferenceSpace=function(X){c=X},this.getBaseLayer=function(){return d!==null?d:u},this.getBinding=function(){return f},this.getFrame=function(){return _},this.getSession=function(){return i},this.setSession=async function(X){if(i=X,i!==null){if(g=t.getRenderTarget(),i.addEventListener("select",C),i.addEventListener("selectstart",C),i.addEventListener("selectend",C),i.addEventListener("squeeze",C),i.addEventListener("squeezestart",C),i.addEventListener("squeezeend",C),i.addEventListener("end",V),i.addEventListener("inputsourceschange",$),p.xrCompatible!==!0&&await e.makeXRCompatible(),T=t.getPixelRatio(),t.getSize(D),i.renderState.layers===void 0){let ot={antialias:p.antialias,alpha:!0,depth:p.depth,stencil:p.stencil,framebufferScaleFactor:s};u=new XRWebGLLayer(i,e,ot),i.updateRenderState({baseLayer:u}),t.setPixelRatio(1),t.setSize(u.framebufferWidth,u.framebufferHeight,!1),b=new lr(u.framebufferWidth,u.framebufferHeight,{format:Ui,type:Gr,colorSpace:t.outputColorSpace,stencilBuffer:p.stencil})}else{let ot=null,xt=null,ct=null;p.depth&&(ct=p.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,ot=p.stencil?Ja:Oo,xt=p.stencil?Qa:Ho);let Rt={colorFormat:e.RGBA8,depthFormat:ct,scaleFactor:s};f=new XRWebGLBinding(i,e),d=f.createProjectionLayer(Rt),i.updateRenderState({layers:[d]}),t.setPixelRatio(1),t.setSize(d.textureWidth,d.textureHeight,!1),b=new lr(d.textureWidth,d.textureHeight,{format:Ui,type:Gr,depthTexture:new Jc(d.textureWidth,d.textureHeight,xt,void 0,void 0,void 0,void 0,void 0,void 0,ot),stencilBuffer:p.stencil,colorSpace:t.outputColorSpace,samples:p.antialias?4:0,resolveDepthBuffer:d.ignoreDepthValues===!1})}b.isXRRenderTarget=!0,this.setFoveation(l),c=null,o=await i.requestReferenceSpace(a),Ut.setContext(i),Ut.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode};function $(X){for(let ot=0;ot<X.removed.length;ot++){let xt=X.removed[ot],ct=S.indexOf(xt);ct>=0&&(S[ct]=null,v[ct].disconnect(xt))}for(let ot=0;ot<X.added.length;ot++){let xt=X.added[ot],ct=S.indexOf(xt);if(ct===-1){for(let kt=0;kt<v.length;kt++)if(kt>=S.length){S.push(xt),ct=kt;break}else if(S[kt]===null){S[kt]=xt,ct=kt;break}if(ct===-1)break}let Rt=v[ct];Rt&&Rt.connect(xt)}}let W=new nt,Z=new nt;function z(X,ot,xt){W.setFromMatrixPosition(ot.matrixWorld),Z.setFromMatrixPosition(xt.matrixWorld);let ct=W.distanceTo(Z),Rt=ot.projectionMatrix.elements,kt=xt.projectionMatrix.elements,q=Rt[14]/(Rt[10]-1),$t=Rt[14]/(Rt[10]+1),It=(Rt[9]+1)/Rt[5],Ft=(Rt[9]-1)/Rt[5],bt=(Rt[8]-1)/Rt[0],Et=(kt[8]+1)/kt[0],Ht=q*bt,G=q*Et,jt=ct/(-bt+Et),A=jt*-bt;ot.matrixWorld.decompose(X.position,X.quaternion,X.scale),X.translateX(A),X.translateZ(jt),X.matrixWorld.compose(X.position,X.quaternion,X.scale),X.matrixWorldInverse.copy(X.matrixWorld).invert();let x=q+jt,F=$t+jt,Y=Ht-A,tt=G+(ct-A),it=It*$t/F*x,vt=Ft*$t/F*x;X.projectionMatrix.makePerspective(Y,tt,it,vt,x,F),X.projectionMatrixInverse.copy(X.projectionMatrix).invert()}function U(X,ot){ot===null?X.matrixWorld.copy(X.matrix):X.matrixWorld.multiplyMatrices(ot.matrixWorld,X.matrix),X.matrixWorldInverse.copy(X.matrixWorld).invert()}this.updateCamera=function(X){if(i===null)return;m.texture!==null&&(X.near=m.depthNear,X.far=m.depthFar),y.near=P.near=w.near=X.near,y.far=P.far=w.far=X.far,(I!==y.near||N!==y.far)&&(i.updateRenderState({depthNear:y.near,depthFar:y.far}),I=y.near,N=y.far,w.near=I,w.far=N,P.near=I,P.far=N,w.updateProjectionMatrix(),P.updateProjectionMatrix(),X.updateProjectionMatrix());let ot=X.parent,xt=y.cameras;U(y,ot);for(let ct=0;ct<xt.length;ct++)U(xt[ct],ot);xt.length===2?z(y,w,P):y.projectionMatrix.copy(w.projectionMatrix),R(X,y,ot)};function R(X,ot,xt){xt===null?X.matrix.copy(ot.matrixWorld):(X.matrix.copy(xt.matrixWorld),X.matrix.invert(),X.matrix.multiply(ot.matrixWorld)),X.matrix.decompose(X.position,X.quaternion,X.scale),X.updateMatrixWorld(!0),X.projectionMatrix.copy(ot.projectionMatrix),X.projectionMatrixInverse.copy(ot.projectionMatrixInverse),X.isPerspectiveCamera&&(X.fov=Hf*2*Math.atan(1/X.projectionMatrix.elements[5]),X.zoom=1)}this.getCamera=function(){return y},this.getFoveation=function(){if(!(d===null&&u===null))return l},this.setFoveation=function(X){l=X,d!==null&&(d.fixedFoveation=X),u!==null&&u.fixedFoveation!==void 0&&(u.fixedFoveation=X)},this.hasDepthSensing=function(){return m.texture!==null};let at=null;function _t(X,ot){if(h=ot.getViewerPose(c||o),_=ot,h!==null){let xt=h.views;u!==null&&(t.setRenderTargetFramebuffer(b,u.framebuffer),t.setRenderTarget(b));let ct=!1;xt.length!==y.cameras.length&&(y.cameras.length=0,ct=!0);for(let kt=0;kt<xt.length;kt++){let q=xt[kt],$t=null;if(u!==null)$t=u.getViewport(q);else{let Ft=f.getViewSubImage(d,q);$t=Ft.viewport,kt===0&&(t.setRenderTargetTextures(b,Ft.colorTexture,d.ignoreDepthValues?void 0:Ft.depthStencilTexture),t.setRenderTarget(b))}let It=M[kt];It===void 0&&(It=new Dn,It.layers.enable(kt),It.viewport=new Qe,M[kt]=It),It.matrix.fromArray(q.transform.matrix),It.matrix.decompose(It.position,It.quaternion,It.scale),It.projectionMatrix.fromArray(q.projectionMatrix),It.projectionMatrixInverse.copy(It.projectionMatrix).invert(),It.viewport.set($t.x,$t.y,$t.width,$t.height),kt===0&&(y.matrix.copy(It.matrix),y.matrix.decompose(y.position,y.quaternion,y.scale)),ct===!0&&y.cameras.push(It)}let Rt=i.enabledFeatures;if(Rt&&Rt.includes("depth-sensing")){let kt=f.getDepthInformation(xt[0]);kt&&kt.isValid&&kt.texture&&m.init(t,kt,i.renderState)}}for(let xt=0;xt<v.length;xt++){let ct=S[xt],Rt=v[xt];ct!==null&&Rt!==void 0&&Rt.update(ct,ot,c||o)}m.render(t,y),at&&at(X,ot),ot.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:ot}),_=null}let Ut=new U0;Ut.setAnimationLoop(_t),this.setAnimationLoop=function(X){at=X},this.dispose=function(){}}},Ds=new cr,PE=new Oe;function IE(r,t){function e(p,g){p.matrixAutoUpdate===!0&&p.updateMatrix(),g.value.copy(p.matrix)}function n(p,g){g.color.getRGB(p.fogColor.value,N0(r)),g.isFog?(p.fogNear.value=g.near,p.fogFar.value=g.far):g.isFogExp2&&(p.fogDensity.value=g.density)}function i(p,g,b,v,S){g.isMeshBasicMaterial||g.isMeshLambertMaterial?s(p,g):g.isMeshToonMaterial?(s(p,g),f(p,g)):g.isMeshPhongMaterial?(s(p,g),h(p,g)):g.isMeshStandardMaterial?(s(p,g),d(p,g),g.isMeshPhysicalMaterial&&u(p,g,S)):g.isMeshMatcapMaterial?(s(p,g),_(p,g)):g.isMeshDepthMaterial?s(p,g):g.isMeshDistanceMaterial?(s(p,g),m(p,g)):g.isMeshNormalMaterial?s(p,g):g.isLineBasicMaterial?(o(p,g),g.isLineDashedMaterial&&a(p,g)):g.isPointsMaterial?l(p,g,b,v):g.isSpriteMaterial?c(p,g):g.isShadowMaterial?(p.color.value.copy(g.color),p.opacity.value=g.opacity):g.isShaderMaterial&&(g.uniformsNeedUpdate=!1)}function s(p,g){p.opacity.value=g.opacity,g.color&&p.diffuse.value.copy(g.color),g.emissive&&p.emissive.value.copy(g.emissive).multiplyScalar(g.emissiveIntensity),g.map&&(p.map.value=g.map,e(g.map,p.mapTransform)),g.alphaMap&&(p.alphaMap.value=g.alphaMap,e(g.alphaMap,p.alphaMapTransform)),g.bumpMap&&(p.bumpMap.value=g.bumpMap,e(g.bumpMap,p.bumpMapTransform),p.bumpScale.value=g.bumpScale,g.side===Un&&(p.bumpScale.value*=-1)),g.normalMap&&(p.normalMap.value=g.normalMap,e(g.normalMap,p.normalMapTransform),p.normalScale.value.copy(g.normalScale),g.side===Un&&p.normalScale.value.negate()),g.displacementMap&&(p.displacementMap.value=g.displacementMap,e(g.displacementMap,p.displacementMapTransform),p.displacementScale.value=g.displacementScale,p.displacementBias.value=g.displacementBias),g.emissiveMap&&(p.emissiveMap.value=g.emissiveMap,e(g.emissiveMap,p.emissiveMapTransform)),g.specularMap&&(p.specularMap.value=g.specularMap,e(g.specularMap,p.specularMapTransform)),g.alphaTest>0&&(p.alphaTest.value=g.alphaTest);let b=t.get(g),v=b.envMap,S=b.envMapRotation;if(v&&(p.envMap.value=v,Ds.copy(S),Ds.x*=-1,Ds.y*=-1,Ds.z*=-1,v.isCubeTexture&&v.isRenderTargetTexture===!1&&(Ds.y*=-1,Ds.z*=-1),p.envMapRotation.value.setFromMatrix4(PE.makeRotationFromEuler(Ds)),p.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,p.reflectivity.value=g.reflectivity,p.ior.value=g.ior,p.refractionRatio.value=g.refractionRatio),g.lightMap){p.lightMap.value=g.lightMap;let D=r._useLegacyLights===!0?Math.PI:1;p.lightMapIntensity.value=g.lightMapIntensity*D,e(g.lightMap,p.lightMapTransform)}g.aoMap&&(p.aoMap.value=g.aoMap,p.aoMapIntensity.value=g.aoMapIntensity,e(g.aoMap,p.aoMapTransform))}function o(p,g){p.diffuse.value.copy(g.color),p.opacity.value=g.opacity,g.map&&(p.map.value=g.map,e(g.map,p.mapTransform))}function a(p,g){p.dashSize.value=g.dashSize,p.totalSize.value=g.dashSize+g.gapSize,p.scale.value=g.scale}function l(p,g,b,v){p.diffuse.value.copy(g.color),p.opacity.value=g.opacity,p.size.value=g.size*b,p.scale.value=v*.5,g.map&&(p.map.value=g.map,e(g.map,p.uvTransform)),g.alphaMap&&(p.alphaMap.value=g.alphaMap,e(g.alphaMap,p.alphaMapTransform)),g.alphaTest>0&&(p.alphaTest.value=g.alphaTest)}function c(p,g){p.diffuse.value.copy(g.color),p.opacity.value=g.opacity,p.rotation.value=g.rotation,g.map&&(p.map.value=g.map,e(g.map,p.mapTransform)),g.alphaMap&&(p.alphaMap.value=g.alphaMap,e(g.alphaMap,p.alphaMapTransform)),g.alphaTest>0&&(p.alphaTest.value=g.alphaTest)}function h(p,g){p.specular.value.copy(g.specular),p.shininess.value=Math.max(g.shininess,1e-4)}function f(p,g){g.gradientMap&&(p.gradientMap.value=g.gradientMap)}function d(p,g){p.metalness.value=g.metalness,g.metalnessMap&&(p.metalnessMap.value=g.metalnessMap,e(g.metalnessMap,p.metalnessMapTransform)),p.roughness.value=g.roughness,g.roughnessMap&&(p.roughnessMap.value=g.roughnessMap,e(g.roughnessMap,p.roughnessMapTransform)),g.envMap&&(p.envMapIntensity.value=g.envMapIntensity)}function u(p,g,b){p.ior.value=g.ior,g.sheen>0&&(p.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),p.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(p.sheenColorMap.value=g.sheenColorMap,e(g.sheenColorMap,p.sheenColorMapTransform)),g.sheenRoughnessMap&&(p.sheenRoughnessMap.value=g.sheenRoughnessMap,e(g.sheenRoughnessMap,p.sheenRoughnessMapTransform))),g.clearcoat>0&&(p.clearcoat.value=g.clearcoat,p.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(p.clearcoatMap.value=g.clearcoatMap,e(g.clearcoatMap,p.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(p.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,e(g.clearcoatRoughnessMap,p.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(p.clearcoatNormalMap.value=g.clearcoatNormalMap,e(g.clearcoatNormalMap,p.clearcoatNormalMapTransform),p.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===Un&&p.clearcoatNormalScale.value.negate())),g.dispersion>0&&(p.dispersion.value=g.dispersion),g.iridescence>0&&(p.iridescence.value=g.iridescence,p.iridescenceIOR.value=g.iridescenceIOR,p.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],p.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(p.iridescenceMap.value=g.iridescenceMap,e(g.iridescenceMap,p.iridescenceMapTransform)),g.iridescenceThicknessMap&&(p.iridescenceThicknessMap.value=g.iridescenceThicknessMap,e(g.iridescenceThicknessMap,p.iridescenceThicknessMapTransform))),g.transmission>0&&(p.transmission.value=g.transmission,p.transmissionSamplerMap.value=b.texture,p.transmissionSamplerSize.value.set(b.width,b.height),g.transmissionMap&&(p.transmissionMap.value=g.transmissionMap,e(g.transmissionMap,p.transmissionMapTransform)),p.thickness.value=g.thickness,g.thicknessMap&&(p.thicknessMap.value=g.thicknessMap,e(g.thicknessMap,p.thicknessMapTransform)),p.attenuationDistance.value=g.attenuationDistance,p.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(p.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(p.anisotropyMap.value=g.anisotropyMap,e(g.anisotropyMap,p.anisotropyMapTransform))),p.specularIntensity.value=g.specularIntensity,p.specularColor.value.copy(g.specularColor),g.specularColorMap&&(p.specularColorMap.value=g.specularColorMap,e(g.specularColorMap,p.specularColorMapTransform)),g.specularIntensityMap&&(p.specularIntensityMap.value=g.specularIntensityMap,e(g.specularIntensityMap,p.specularIntensityMapTransform))}function _(p,g){g.matcap&&(p.matcap.value=g.matcap)}function m(p,g){let b=t.get(g).light;p.referencePosition.value.setFromMatrixPosition(b.matrixWorld),p.nearDistance.value=b.shadow.camera.near,p.farDistance.value=b.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function LE(r,t,e,n){let i={},s={},o=[],a=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function l(b,v){let S=v.program;n.uniformBlockBinding(b,S)}function c(b,v){let S=i[b.id];S===void 0&&(_(b),S=h(b),i[b.id]=S,b.addEventListener("dispose",p));let D=v.program;n.updateUBOMapping(b,D);let T=t.render.frame;s[b.id]!==T&&(d(b),s[b.id]=T)}function h(b){let v=f();b.__bindingPointIndex=v;let S=r.createBuffer(),D=b.__size,T=b.usage;return r.bindBuffer(r.UNIFORM_BUFFER,S),r.bufferData(r.UNIFORM_BUFFER,D,T),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,v,S),S}function f(){for(let b=0;b<a;b++)if(o.indexOf(b)===-1)return o.push(b),b;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function d(b){let v=i[b.id],S=b.uniforms,D=b.__cache;r.bindBuffer(r.UNIFORM_BUFFER,v);for(let T=0,w=S.length;T<w;T++){let P=Array.isArray(S[T])?S[T]:[S[T]];for(let M=0,y=P.length;M<y;M++){let I=P[M];if(u(I,T,M,D)===!0){let N=I.__offset,C=Array.isArray(I.value)?I.value:[I.value],V=0;for(let $=0;$<C.length;$++){let W=C[$],Z=m(W);typeof W=="number"||typeof W=="boolean"?(I.__data[0]=W,r.bufferSubData(r.UNIFORM_BUFFER,N+V,I.__data)):W.isMatrix3?(I.__data[0]=W.elements[0],I.__data[1]=W.elements[1],I.__data[2]=W.elements[2],I.__data[3]=0,I.__data[4]=W.elements[3],I.__data[5]=W.elements[4],I.__data[6]=W.elements[5],I.__data[7]=0,I.__data[8]=W.elements[6],I.__data[9]=W.elements[7],I.__data[10]=W.elements[8],I.__data[11]=0):(W.toArray(I.__data,V),V+=Z.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,N,I.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function u(b,v,S,D){let T=b.value,w=v+"_"+S;if(D[w]===void 0)return typeof T=="number"||typeof T=="boolean"?D[w]=T:D[w]=T.clone(),!0;{let P=D[w];if(typeof T=="number"||typeof T=="boolean"){if(P!==T)return D[w]=T,!0}else if(P.equals(T)===!1)return P.copy(T),!0}return!1}function _(b){let v=b.uniforms,S=0,D=16;for(let w=0,P=v.length;w<P;w++){let M=Array.isArray(v[w])?v[w]:[v[w]];for(let y=0,I=M.length;y<I;y++){let N=M[y],C=Array.isArray(N.value)?N.value:[N.value];for(let V=0,$=C.length;V<$;V++){let W=C[V],Z=m(W),z=S%D;z!==0&&D-z<Z.boundary&&(S+=D-z),N.__data=new Float32Array(Z.storage/Float32Array.BYTES_PER_ELEMENT),N.__offset=S,S+=Z.storage}}}let T=S%D;return T>0&&(S+=D-T),b.__size=S,b.__cache={},this}function m(b){let v={boundary:0,storage:0};return typeof b=="number"||typeof b=="boolean"?(v.boundary=4,v.storage=4):b.isVector2?(v.boundary=8,v.storage=8):b.isVector3||b.isColor?(v.boundary=16,v.storage=12):b.isVector4?(v.boundary=16,v.storage=16):b.isMatrix3?(v.boundary=48,v.storage=48):b.isMatrix4?(v.boundary=64,v.storage=64):b.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",b),v}function p(b){let v=b.target;v.removeEventListener("dispose",p);let S=o.indexOf(v.__bindingPointIndex);o.splice(S,1),r.deleteBuffer(i[v.id]),delete i[v.id],delete s[v.id]}function g(){for(let b in i)r.deleteBuffer(i[b]);o=[],i={},s={}}return{bind:l,update:c,dispose:g}}var $c=class{constructor(t={}){let{canvas:e=VS(),context:n=null,depth:i=!0,stencil:s=!1,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:f=!1}=t;this.isWebGLRenderer=!0;let d;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");d=n.getContextAttributes().alpha}else d=o;let u=new Uint32Array(4),_=new Int32Array(4),m=null,p=null,g=[],b=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=ni,this._useLegacyLights=!1,this.toneMapping=Vr,this.toneMappingExposure=1;let v=this,S=!1,D=0,T=0,w=null,P=-1,M=null,y=new Qe,I=new Qe,N=null,C=new ge(0),V=0,$=e.width,W=e.height,Z=1,z=null,U=null,R=new Qe(0,0,$,W),at=new Qe(0,0,$,W),_t=!1,Ut=new Ka,X=!1,ot=!1,xt=new Oe,ct=new nt,Rt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function kt(){return w===null?Z:1}let q=n;function $t(E,B){return e.getContext(E,B)}try{let E={alpha:!0,depth:i,stencil:s,antialias:a,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:f};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${yd}`),e.addEventListener("webglcontextlost",k,!1),e.addEventListener("webglcontextrestored",Q,!1),e.addEventListener("webglcontextcreationerror",st,!1),q===null){let B="webgl2";if(q=$t(B,E),q===null)throw $t(B)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(E){throw console.error("THREE.WebGLRenderer: "+E.message),E}let It,Ft,bt,Et,Ht,G,jt,A,x,F,Y,tt,it,vt,pt,lt,Lt,ht,yt,qt,ut,Tt,Wt,Zt;function ue(){It=new jw(q),It.init(),Tt=new AE(q,It),Ft=new Yw(q,It,t,Tt),bt=new EE(q),Et=new e1(q),Ht=new dE,G=new TE(q,It,bt,Ht,Ft,Tt,Et),jt=new Zw(v),A=new Kw(v),x=new lM(q),Wt=new Ww(q,x),F=new Qw(q,x,Et,Wt),Y=new i1(q,F,x,Et),yt=new n1(q,Ft,G),lt=new qw(Ht),tt=new fE(v,jt,A,It,Ft,Wt,lt),it=new IE(v,Ht),vt=new mE,pt=new SE(It),ht=new Gw(v,jt,A,bt,Y,d,l),Lt=new wE(v,Y,Ft),Zt=new LE(q,Et,Ft,bt),qt=new Xw(q,It,Et),ut=new t1(q,It,Et),Et.programs=tt.programs,v.capabilities=Ft,v.extensions=It,v.properties=Ht,v.renderLists=vt,v.shadowMap=Lt,v.state=bt,v.info=Et}ue();let Jt=new rd(v,q);this.xr=Jt,this.getContext=function(){return q},this.getContextAttributes=function(){return q.getContextAttributes()},this.forceContextLoss=function(){let E=It.get("WEBGL_lose_context");E&&E.loseContext()},this.forceContextRestore=function(){let E=It.get("WEBGL_lose_context");E&&E.restoreContext()},this.getPixelRatio=function(){return Z},this.setPixelRatio=function(E){E!==void 0&&(Z=E,this.setSize($,W,!1))},this.getSize=function(E){return E.set($,W)},this.setSize=function(E,B,H=!0){if(Jt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}$=E,W=B,e.width=Math.floor(E*Z),e.height=Math.floor(B*Z),H===!0&&(e.style.width=E+"px",e.style.height=B+"px"),this.setViewport(0,0,E,B)},this.getDrawingBufferSize=function(E){return E.set($*Z,W*Z).floor()},this.setDrawingBufferSize=function(E,B,H){$=E,W=B,Z=H,e.width=Math.floor(E*H),e.height=Math.floor(B*H),this.setViewport(0,0,E,B)},this.getCurrentViewport=function(E){return E.copy(y)},this.getViewport=function(E){return E.copy(R)},this.setViewport=function(E,B,H,K){E.isVector4?R.set(E.x,E.y,E.z,E.w):R.set(E,B,H,K),bt.viewport(y.copy(R).multiplyScalar(Z).round())},this.getScissor=function(E){return E.copy(at)},this.setScissor=function(E,B,H,K){E.isVector4?at.set(E.x,E.y,E.z,E.w):at.set(E,B,H,K),bt.scissor(I.copy(at).multiplyScalar(Z).round())},this.getScissorTest=function(){return _t},this.setScissorTest=function(E){bt.setScissorTest(_t=E)},this.setOpaqueSort=function(E){z=E},this.setTransparentSort=function(E){U=E},this.getClearColor=function(E){return E.copy(ht.getClearColor())},this.setClearColor=function(){ht.setClearColor.apply(ht,arguments)},this.getClearAlpha=function(){return ht.getClearAlpha()},this.setClearAlpha=function(){ht.setClearAlpha.apply(ht,arguments)},this.clear=function(E=!0,B=!0,H=!0){let K=0;if(E){let J=!1;if(w!==null){let St=w.texture.format;J=St===P0||St===R0||St===C0}if(J){let St=w.texture.type,At=St===Gr||St===Ho||St===E0||St===Qa||St===A0||St===D0,Pt=ht.getClearColor(),Xt=ht.getClearAlpha(),te=Pt.r,Gt=Pt.g,Vt=Pt.b;At?(u[0]=te,u[1]=Gt,u[2]=Vt,u[3]=Xt,q.clearBufferuiv(q.COLOR,0,u)):(_[0]=te,_[1]=Gt,_[2]=Vt,_[3]=Xt,q.clearBufferiv(q.COLOR,0,_))}else K|=q.COLOR_BUFFER_BIT}B&&(K|=q.DEPTH_BUFFER_BIT),H&&(K|=q.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),q.clear(K)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",k,!1),e.removeEventListener("webglcontextrestored",Q,!1),e.removeEventListener("webglcontextcreationerror",st,!1),vt.dispose(),pt.dispose(),Ht.dispose(),jt.dispose(),A.dispose(),Y.dispose(),Wt.dispose(),Zt.dispose(),tt.dispose(),Jt.dispose(),Jt.removeEventListener("sessionstart",rt),Jt.removeEventListener("sessionend",O),j.stop()};function k(E){E.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),S=!0}function Q(){console.log("THREE.WebGLRenderer: Context Restored."),S=!1;let E=Et.autoReset,B=Lt.enabled,H=Lt.autoUpdate,K=Lt.needsUpdate,J=Lt.type;ue(),Et.autoReset=E,Lt.enabled=B,Lt.autoUpdate=H,Lt.needsUpdate=K,Lt.type=J}function st(E){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",E.statusMessage)}function mt(E){let B=E.target;B.removeEventListener("dispose",mt),gt(B)}function gt(E){Bt(E),Ht.remove(E)}function Bt(E){let B=Ht.get(E).programs;B!==void 0&&(B.forEach(function(H){tt.releaseProgram(H)}),E.isShaderMaterial&&tt.releaseShaderCache(E))}this.renderBufferDirect=function(E,B,H,K,J,St){B===null&&(B=Rt);let At=J.isMesh&&J.matrixWorld.determinant()<0,Pt=he(E,B,H,K,J);bt.setMaterial(K,At);let Xt=H.index,te=1;if(K.wireframe===!0){if(Xt=F.getWireframeAttribute(H),Xt===void 0)return;te=2}let Gt=H.drawRange,Vt=H.attributes.position,xe=Gt.start*te,Be=(Gt.start+Gt.count)*te;St!==null&&(xe=Math.max(xe,St.start*te),Be=Math.min(Be,(St.start+St.count)*te)),Xt!==null?(xe=Math.max(xe,0),Be=Math.min(Be,Xt.count)):Vt!=null&&(xe=Math.max(xe,0),Be=Math.min(Be,Vt.count));let sn=Be-xe;if(sn<0||sn===1/0)return;Wt.setup(J,K,Pt,H,Xt);let _n,ie=qt;if(Xt!==null&&(_n=x.get(Xt),ie=ut,ie.setIndex(_n)),J.isMesh)K.wireframe===!0?(bt.setLineWidth(K.wireframeLinewidth*kt()),ie.setMode(q.LINES)):ie.setMode(q.TRIANGLES);else if(J.isLine){let Qt=K.linewidth;Qt===void 0&&(Qt=1),bt.setLineWidth(Qt*kt()),J.isLineSegments?ie.setMode(q.LINES):J.isLineLoop?ie.setMode(q.LINE_LOOP):ie.setMode(q.LINE_STRIP)}else J.isPoints?ie.setMode(q.POINTS):J.isSprite&&ie.setMode(q.TRIANGLES);if(J.isBatchedMesh)J._multiDrawInstances!==null?ie.renderMultiDrawInstances(J._multiDrawStarts,J._multiDrawCounts,J._multiDrawCount,J._multiDrawInstances):ie.renderMultiDraw(J._multiDrawStarts,J._multiDrawCounts,J._multiDrawCount);else if(J.isInstancedMesh)ie.renderInstances(xe,sn,J.count);else if(H.isInstancedBufferGeometry){let Qt=H._maxInstanceCount!==void 0?H._maxInstanceCount:1/0,bi=Math.min(H.instanceCount,Qt);ie.renderInstances(xe,sn,bi)}else ie.render(xe,sn)};function ne(E,B,H){E.transparent===!0&&E.side===or&&E.forceSinglePass===!1?(E.side=Un,E.needsUpdate=!0,zt(E,B,H),E.side=Hr,E.needsUpdate=!0,zt(E,B,H),E.side=or):zt(E,B,H)}this.compile=function(E,B,H=null){H===null&&(H=E),p=pt.get(H),p.init(B),b.push(p),H.traverseVisible(function(J){J.isLight&&J.layers.test(B.layers)&&(p.pushLight(J),J.castShadow&&p.pushShadow(J))}),E!==H&&E.traverseVisible(function(J){J.isLight&&J.layers.test(B.layers)&&(p.pushLight(J),J.castShadow&&p.pushShadow(J))}),p.setupLights(v._useLegacyLights);let K=new Set;return E.traverse(function(J){let St=J.material;if(St)if(Array.isArray(St))for(let At=0;At<St.length;At++){let Pt=St[At];ne(Pt,H,J),K.add(Pt)}else ne(St,H,J),K.add(St)}),b.pop(),p=null,K},this.compileAsync=function(E,B,H=null){let K=this.compile(E,B,H);return new Promise(J=>{function St(){if(K.forEach(function(At){Ht.get(At).currentProgram.isReady()&&K.delete(At)}),K.size===0){J(E);return}setTimeout(St,10)}It.get("KHR_parallel_shader_compile")!==null?St():setTimeout(St,10)})};let Mt=null;function L(E){Mt&&Mt(E)}function rt(){j.stop()}function O(){j.start()}let j=new U0;j.setAnimationLoop(L),typeof self<"u"&&j.setContext(self),this.setAnimationLoop=function(E){Mt=E,Jt.setAnimationLoop(E),E===null?j.stop():j.start()},Jt.addEventListener("sessionstart",rt),Jt.addEventListener("sessionend",O),this.render=function(E,B){if(B!==void 0&&B.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(S===!0)return;E.matrixWorldAutoUpdate===!0&&E.updateMatrixWorld(),B.parent===null&&B.matrixWorldAutoUpdate===!0&&B.updateMatrixWorld(),Jt.enabled===!0&&Jt.isPresenting===!0&&(Jt.cameraAutoUpdate===!0&&Jt.updateCamera(B),B=Jt.getCamera()),E.isScene===!0&&E.onBeforeRender(v,E,B,w),p=pt.get(E,b.length),p.init(B),b.push(p),xt.multiplyMatrices(B.projectionMatrix,B.matrixWorldInverse),Ut.setFromProjectionMatrix(xt),ot=this.localClippingEnabled,X=lt.init(this.clippingPlanes,ot),m=vt.get(E,g.length),m.init(),g.push(m),dt(E,B,0,v.sortObjects),m.finish(),v.sortObjects===!0&&m.sort(z,U);let H=Jt.enabled===!1||Jt.isPresenting===!1||Jt.hasDepthSensing()===!1;H&&ht.addToRenderList(m,E),this.info.render.frame++,X===!0&<.beginShadows();let K=p.state.shadowsArray;Lt.render(K,E,B),X===!0&<.endShadows(),this.info.autoReset===!0&&this.info.reset();let J=m.opaque,St=m.transmissive;if(p.setupLights(v._useLegacyLights),B.isArrayCamera){let At=B.cameras;if(St.length>0)for(let Pt=0,Xt=At.length;Pt<Xt;Pt++){let te=At[Pt];wt(J,St,E,te)}H&&ht.render(E);for(let Pt=0,Xt=At.length;Pt<Xt;Pt++){let te=At[Pt];et(m,E,te,te.viewport)}}else St.length>0&&wt(J,St,E,B),H&&ht.render(E),et(m,E,B);w!==null&&(G.updateMultisampleRenderTarget(w),G.updateRenderTargetMipmap(w)),E.isScene===!0&&E.onAfterRender(v,E,B),Wt.resetDefaultState(),P=-1,M=null,b.pop(),b.length>0?(p=b[b.length-1],X===!0&<.setGlobalState(v.clippingPlanes,p.state.camera)):p=null,g.pop(),g.length>0?m=g[g.length-1]:m=null};function dt(E,B,H,K){if(E.visible===!1)return;if(E.layers.test(B.layers)){if(E.isGroup)H=E.renderOrder;else if(E.isLOD)E.autoUpdate===!0&&E.update(B);else if(E.isLight)p.pushLight(E),E.castShadow&&p.pushShadow(E);else if(E.isSprite){if(!E.frustumCulled||Ut.intersectsSprite(E)){K&&ct.setFromMatrixPosition(E.matrixWorld).applyMatrix4(xt);let At=Y.update(E),Pt=E.material;Pt.visible&&m.push(E,At,Pt,H,ct.z,null)}}else if((E.isMesh||E.isLine||E.isPoints)&&(!E.frustumCulled||Ut.intersectsObject(E))){let At=Y.update(E),Pt=E.material;if(K&&(E.boundingSphere!==void 0?(E.boundingSphere===null&&E.computeBoundingSphere(),ct.copy(E.boundingSphere.center)):(At.boundingSphere===null&&At.computeBoundingSphere(),ct.copy(At.boundingSphere.center)),ct.applyMatrix4(E.matrixWorld).applyMatrix4(xt)),Array.isArray(Pt)){let Xt=At.groups;for(let te=0,Gt=Xt.length;te<Gt;te++){let Vt=Xt[te],xe=Pt[Vt.materialIndex];xe&&xe.visible&&m.push(E,At,xe,H,ct.z,Vt)}}else Pt.visible&&m.push(E,At,Pt,H,ct.z,null)}}let St=E.children;for(let At=0,Pt=St.length;At<Pt;At++)dt(St[At],B,H,K)}function et(E,B,H,K){let J=E.opaque,St=E.transmissive,At=E.transparent;p.setupLightsView(H),X===!0&<.setGlobalState(v.clippingPlanes,H),K&&bt.viewport(y.copy(K)),J.length>0&&ft(J,B,H),St.length>0&&ft(St,B,H),At.length>0&&ft(At,B,H),bt.buffers.depth.setTest(!0),bt.buffers.depth.setMask(!0),bt.buffers.color.setMask(!0),bt.setPolygonOffset(!1)}function wt(E,B,H,K){if((H.isScene===!0?H.overrideMaterial:null)!==null)return;p.state.transmissionRenderTarget[K.id]===void 0&&(p.state.transmissionRenderTarget[K.id]=new lr(1,1,{generateMipmaps:!0,type:It.has("EXT_color_buffer_half_float")||It.has("EXT_color_buffer_float")?iu:Gr,minFilter:Ls,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1}));let St=p.state.transmissionRenderTarget[K.id],At=K.viewport||y;St.setSize(At.z,At.w);let Pt=v.getRenderTarget();v.setRenderTarget(St),v.getClearColor(C),V=v.getClearAlpha(),V<1&&v.setClearColor(16777215,.5),v.clear();let Xt=v.toneMapping;v.toneMapping=Vr;let te=K.viewport;if(K.viewport!==void 0&&(K.viewport=void 0),p.setupLightsView(K),X===!0&<.setGlobalState(v.clippingPlanes,K),ft(E,H,K),G.updateMultisampleRenderTarget(St),G.updateRenderTargetMipmap(St),It.has("WEBGL_multisampled_render_to_texture")===!1){let Gt=!1;for(let Vt=0,xe=B.length;Vt<xe;Vt++){let Be=B[Vt],sn=Be.object,_n=Be.geometry,ie=Be.material,Qt=Be.group;if(ie.side===or&&sn.layers.test(K.layers)){let bi=ie.side;ie.side=Un,ie.needsUpdate=!0,Dt(sn,H,K,_n,ie,Qt),ie.side=bi,ie.needsUpdate=!0,Gt=!0}}Gt===!0&&(G.updateMultisampleRenderTarget(St),G.updateRenderTargetMipmap(St))}v.setRenderTarget(Pt),v.setClearColor(C,V),te!==void 0&&(K.viewport=te),v.toneMapping=Xt}function ft(E,B,H){let K=B.isScene===!0?B.overrideMaterial:null;for(let J=0,St=E.length;J<St;J++){let At=E[J],Pt=At.object,Xt=At.geometry,te=K===null?At.material:K,Gt=At.group;Pt.layers.test(H.layers)&&Dt(Pt,B,H,Xt,te,Gt)}}function Dt(E,B,H,K,J,St){E.onBeforeRender(v,B,H,K,J,St),E.modelViewMatrix.multiplyMatrices(H.matrixWorldInverse,E.matrixWorld),E.normalMatrix.getNormalMatrix(E.modelViewMatrix),J.onBeforeRender(v,B,H,K,E,St),J.transparent===!0&&J.side===or&&J.forceSinglePass===!1?(J.side=Un,J.needsUpdate=!0,v.renderBufferDirect(H,B,K,J,E,St),J.side=Hr,J.needsUpdate=!0,v.renderBufferDirect(H,B,K,J,E,St),J.side=or):v.renderBufferDirect(H,B,K,J,E,St),E.onAfterRender(v,B,H,K,J,St)}function zt(E,B,H){B.isScene!==!0&&(B=Rt);let K=Ht.get(E),J=p.state.lights,St=p.state.shadowsArray,At=J.state.version,Pt=tt.getParameters(E,J.state,St,B,H),Xt=tt.getProgramCacheKey(Pt),te=K.programs;K.environment=E.isMeshStandardMaterial?B.environment:null,K.fog=B.fog,K.envMap=(E.isMeshStandardMaterial?A:jt).get(E.envMap||K.environment),K.envMapRotation=K.environment!==null&&E.envMap===null?B.environmentRotation:E.envMapRotation,te===void 0&&(E.addEventListener("dispose",mt),te=new Map,K.programs=te);let Gt=te.get(Xt);if(Gt!==void 0){if(K.currentProgram===Gt&&K.lightsStateVersion===At)return ee(E,Pt),Gt}else Pt.uniforms=tt.getUniforms(E),E.onBuild(H,Pt,v),E.onBeforeCompile(Pt,v),Gt=tt.acquireProgram(Pt,Xt),te.set(Xt,Gt),K.uniforms=Pt.uniforms;let Vt=K.uniforms;return(!E.isShaderMaterial&&!E.isRawShaderMaterial||E.clipping===!0)&&(Vt.clippingPlanes=lt.uniform),ee(E,Pt),K.needsLights=ae(E),K.lightsStateVersion=At,K.needsLights&&(Vt.ambientLightColor.value=J.state.ambient,Vt.lightProbe.value=J.state.probe,Vt.directionalLights.value=J.state.directional,Vt.directionalLightShadows.value=J.state.directionalShadow,Vt.spotLights.value=J.state.spot,Vt.spotLightShadows.value=J.state.spotShadow,Vt.rectAreaLights.value=J.state.rectArea,Vt.ltc_1.value=J.state.rectAreaLTC1,Vt.ltc_2.value=J.state.rectAreaLTC2,Vt.pointLights.value=J.state.point,Vt.pointLightShadows.value=J.state.pointShadow,Vt.hemisphereLights.value=J.state.hemi,Vt.directionalShadowMap.value=J.state.directionalShadowMap,Vt.directionalShadowMatrix.value=J.state.directionalShadowMatrix,Vt.spotShadowMap.value=J.state.spotShadowMap,Vt.spotLightMatrix.value=J.state.spotLightMatrix,Vt.spotLightMap.value=J.state.spotLightMap,Vt.pointShadowMap.value=J.state.pointShadowMap,Vt.pointShadowMatrix.value=J.state.pointShadowMatrix),K.currentProgram=Gt,K.uniformsList=null,Gt}function Nt(E){if(E.uniformsList===null){let B=E.currentProgram.getUniforms();E.uniformsList=ko.seqWithValue(B.seq,E.uniforms)}return E.uniformsList}function ee(E,B){let H=Ht.get(E);H.outputColorSpace=B.outputColorSpace,H.batching=B.batching,H.instancing=B.instancing,H.instancingColor=B.instancingColor,H.instancingMorph=B.instancingMorph,H.skinning=B.skinning,H.morphTargets=B.morphTargets,H.morphNormals=B.morphNormals,H.morphColors=B.morphColors,H.morphTargetsCount=B.morphTargetsCount,H.numClippingPlanes=B.numClippingPlanes,H.numIntersection=B.numClipIntersection,H.vertexAlphas=B.vertexAlphas,H.vertexTangents=B.vertexTangents,H.toneMapping=B.toneMapping}function he(E,B,H,K,J){B.isScene!==!0&&(B=Rt),G.resetTextureUnits();let St=B.fog,At=K.isMeshStandardMaterial?B.environment:null,Pt=w===null?v.outputColorSpace:w.isXRRenderTarget===!0?w.texture.colorSpace:Yr,Xt=(K.isMeshStandardMaterial?A:jt).get(K.envMap||At),te=K.vertexColors===!0&&!!H.attributes.color&&H.attributes.color.itemSize===4,Gt=!!H.attributes.tangent&&(!!K.normalMap||K.anisotropy>0),Vt=!!H.morphAttributes.position,xe=!!H.morphAttributes.normal,Be=!!H.morphAttributes.color,sn=Vr;K.toneMapped&&(w===null||w.isXRRenderTarget===!0)&&(sn=v.toneMapping);let _n=H.morphAttributes.position||H.morphAttributes.normal||H.morphAttributes.color,ie=_n!==void 0?_n.length:0,Qt=Ht.get(K),bi=p.state.lights;if(X===!0&&(ot===!0||E!==M)){let Xn=E===M&&K.id===P;lt.setState(K,E,Xn)}let ve=!1;K.version===Qt.__version?(Qt.needsLights&&Qt.lightsStateVersion!==bi.state.version||Qt.outputColorSpace!==Pt||J.isBatchedMesh&&Qt.batching===!1||!J.isBatchedMesh&&Qt.batching===!0||J.isInstancedMesh&&Qt.instancing===!1||!J.isInstancedMesh&&Qt.instancing===!0||J.isSkinnedMesh&&Qt.skinning===!1||!J.isSkinnedMesh&&Qt.skinning===!0||J.isInstancedMesh&&Qt.instancingColor===!0&&J.instanceColor===null||J.isInstancedMesh&&Qt.instancingColor===!1&&J.instanceColor!==null||J.isInstancedMesh&&Qt.instancingMorph===!0&&J.morphTexture===null||J.isInstancedMesh&&Qt.instancingMorph===!1&&J.morphTexture!==null||Qt.envMap!==Xt||K.fog===!0&&Qt.fog!==St||Qt.numClippingPlanes!==void 0&&(Qt.numClippingPlanes!==lt.numPlanes||Qt.numIntersection!==lt.numIntersection)||Qt.vertexAlphas!==te||Qt.vertexTangents!==Gt||Qt.morphTargets!==Vt||Qt.morphNormals!==xe||Qt.morphColors!==Be||Qt.toneMapping!==sn||Qt.morphTargetsCount!==ie)&&(ve=!0):(ve=!0,Qt.__version=K.version);let qr=Qt.currentProgram;ve===!0&&(qr=zt(K,B,J));let Ed=!1,qo=!1,ou=!1,on=qr.getUniforms(),ur=Qt.uniforms;if(bt.useProgram(qr.program)&&(Ed=!0,qo=!0,ou=!0),K.id!==P&&(P=K.id,qo=!0),Ed||M!==E){on.setValue(q,"projectionMatrix",E.projectionMatrix),on.setValue(q,"viewMatrix",E.matrixWorldInverse);let Xn=on.map.cameraPosition;Xn!==void 0&&Xn.setValue(q,ct.setFromMatrixPosition(E.matrixWorld)),Ft.logarithmicDepthBuffer&&on.setValue(q,"logDepthBufFC",2/(Math.log(E.far+1)/Math.LN2)),(K.isMeshPhongMaterial||K.isMeshToonMaterial||K.isMeshLambertMaterial||K.isMeshBasicMaterial||K.isMeshStandardMaterial||K.isShaderMaterial)&&on.setValue(q,"isOrthographic",E.isOrthographicCamera===!0),M!==E&&(M=E,qo=!0,ou=!0)}if(J.isSkinnedMesh){on.setOptional(q,J,"bindMatrix"),on.setOptional(q,J,"bindMatrixInverse");let Xn=J.skeleton;Xn&&(Xn.boneTexture===null&&Xn.computeBoneTexture(),on.setValue(q,"boneTexture",Xn.boneTexture,G))}J.isBatchedMesh&&(on.setOptional(q,J,"batchingTexture"),on.setValue(q,"batchingTexture",J._matricesTexture,G));let au=H.morphAttributes;if((au.position!==void 0||au.normal!==void 0||au.color!==void 0)&&yt.update(J,H,qr),(qo||Qt.receiveShadow!==J.receiveShadow)&&(Qt.receiveShadow=J.receiveShadow,on.setValue(q,"receiveShadow",J.receiveShadow)),K.isMeshGouraudMaterial&&K.envMap!==null&&(ur.envMap.value=Xt,ur.flipEnvMap.value=Xt.isCubeTexture&&Xt.isRenderTargetTexture===!1?-1:1),K.isMeshStandardMaterial&&K.envMap===null&&B.environment!==null&&(ur.envMapIntensity.value=B.environmentIntensity),qo&&(on.setValue(q,"toneMappingExposure",v.toneMappingExposure),Qt.needsLights&&me(ur,ou),St&&K.fog===!0&&it.refreshFogUniforms(ur,St),it.refreshMaterialUniforms(ur,K,Z,W,p.state.transmissionRenderTarget[E.id]),ko.upload(q,Nt(Qt),ur,G)),K.isShaderMaterial&&K.uniformsNeedUpdate===!0&&(ko.upload(q,Nt(Qt),ur,G),K.uniformsNeedUpdate=!1),K.isSpriteMaterial&&on.setValue(q,"center",J.center),on.setValue(q,"modelViewMatrix",J.modelViewMatrix),on.setValue(q,"normalMatrix",J.normalMatrix),on.setValue(q,"modelMatrix",J.matrixWorld),K.isShaderMaterial||K.isRawShaderMaterial){let Xn=K.uniformsGroups;for(let lu=0,G0=Xn.length;lu<G0;lu++){let Td=Xn[lu];Zt.update(Td,qr),Zt.bind(Td,qr)}}return qr}function me(E,B){E.ambientLightColor.needsUpdate=B,E.lightProbe.needsUpdate=B,E.directionalLights.needsUpdate=B,E.directionalLightShadows.needsUpdate=B,E.pointLights.needsUpdate=B,E.pointLightShadows.needsUpdate=B,E.spotLights.needsUpdate=B,E.spotLightShadows.needsUpdate=B,E.rectAreaLights.needsUpdate=B,E.hemisphereLights.needsUpdate=B}function ae(E){return E.isMeshLambertMaterial||E.isMeshToonMaterial||E.isMeshPhongMaterial||E.isMeshStandardMaterial||E.isShadowMaterial||E.isShaderMaterial&&E.lights===!0}this.getActiveCubeFace=function(){return D},this.getActiveMipmapLevel=function(){return T},this.getRenderTarget=function(){return w},this.setRenderTargetTextures=function(E,B,H){Ht.get(E.texture).__webglTexture=B,Ht.get(E.depthTexture).__webglTexture=H;let K=Ht.get(E);K.__hasExternalTextures=!0,K.__autoAllocateDepthBuffer=H===void 0,K.__autoAllocateDepthBuffer||It.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),K.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(E,B){let H=Ht.get(E);H.__webglFramebuffer=B,H.__useDefaultFramebuffer=B===void 0},this.setRenderTarget=function(E,B=0,H=0){w=E,D=B,T=H;let K=!0,J=null,St=!1,At=!1;if(E){let Xt=Ht.get(E);Xt.__useDefaultFramebuffer!==void 0?(bt.bindFramebuffer(q.FRAMEBUFFER,null),K=!1):Xt.__webglFramebuffer===void 0?G.setupRenderTarget(E):Xt.__hasExternalTextures&&G.rebindTextures(E,Ht.get(E.texture).__webglTexture,Ht.get(E.depthTexture).__webglTexture);let te=E.texture;(te.isData3DTexture||te.isDataArrayTexture||te.isCompressedArrayTexture)&&(At=!0);let Gt=Ht.get(E).__webglFramebuffer;E.isWebGLCubeRenderTarget?(Array.isArray(Gt[B])?J=Gt[B][H]:J=Gt[B],St=!0):E.samples>0&&G.useMultisampledRTT(E)===!1?J=Ht.get(E).__webglMultisampledFramebuffer:Array.isArray(Gt)?J=Gt[H]:J=Gt,y.copy(E.viewport),I.copy(E.scissor),N=E.scissorTest}else y.copy(R).multiplyScalar(Z).floor(),I.copy(at).multiplyScalar(Z).floor(),N=_t;if(bt.bindFramebuffer(q.FRAMEBUFFER,J)&&K&&bt.drawBuffers(E,J),bt.viewport(y),bt.scissor(I),bt.setScissorTest(N),St){let Xt=Ht.get(E.texture);q.framebufferTexture2D(q.FRAMEBUFFER,q.COLOR_ATTACHMENT0,q.TEXTURE_CUBE_MAP_POSITIVE_X+B,Xt.__webglTexture,H)}else if(At){let Xt=Ht.get(E.texture),te=B||0;q.framebufferTextureLayer(q.FRAMEBUFFER,q.COLOR_ATTACHMENT0,Xt.__webglTexture,H||0,te)}P=-1},this.readRenderTargetPixels=function(E,B,H,K,J,St,At){if(!(E&&E.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Pt=Ht.get(E).__webglFramebuffer;if(E.isWebGLCubeRenderTarget&&At!==void 0&&(Pt=Pt[At]),Pt){bt.bindFramebuffer(q.FRAMEBUFFER,Pt);try{let Xt=E.texture,te=Xt.format,Gt=Xt.type;if(!Ft.textureFormatReadable(te)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Ft.textureTypeReadable(Gt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}B>=0&&B<=E.width-K&&H>=0&&H<=E.height-J&&q.readPixels(B,H,K,J,Tt.convert(te),Tt.convert(Gt),St)}finally{let Xt=w!==null?Ht.get(w).__webglFramebuffer:null;bt.bindFramebuffer(q.FRAMEBUFFER,Xt)}}},this.copyFramebufferToTexture=function(E,B,H=0){let K=Math.pow(2,-H),J=Math.floor(B.image.width*K),St=Math.floor(B.image.height*K);G.setTexture2D(B,0),q.copyTexSubImage2D(q.TEXTURE_2D,H,0,0,E.x,E.y,J,St),bt.unbindTexture()},this.copyTextureToTexture=function(E,B,H,K=0){let J=B.image.width,St=B.image.height,At=Tt.convert(H.format),Pt=Tt.convert(H.type);G.setTexture2D(H,0),q.pixelStorei(q.UNPACK_FLIP_Y_WEBGL,H.flipY),q.pixelStorei(q.UNPACK_PREMULTIPLY_ALPHA_WEBGL,H.premultiplyAlpha),q.pixelStorei(q.UNPACK_ALIGNMENT,H.unpackAlignment),B.isDataTexture?q.texSubImage2D(q.TEXTURE_2D,K,E.x,E.y,J,St,At,Pt,B.image.data):B.isCompressedTexture?q.compressedTexSubImage2D(q.TEXTURE_2D,K,E.x,E.y,B.mipmaps[0].width,B.mipmaps[0].height,At,B.mipmaps[0].data):q.texSubImage2D(q.TEXTURE_2D,K,E.x,E.y,At,Pt,B.image),K===0&&H.generateMipmaps&&q.generateMipmap(q.TEXTURE_2D),bt.unbindTexture()},this.copyTextureToTexture3D=function(E,B,H,K,J=0){let St=E.max.x-E.min.x,At=E.max.y-E.min.y,Pt=E.max.z-E.min.z,Xt=Tt.convert(K.format),te=Tt.convert(K.type),Gt;if(K.isData3DTexture)G.setTexture3D(K,0),Gt=q.TEXTURE_3D;else if(K.isDataArrayTexture||K.isCompressedArrayTexture)G.setTexture2DArray(K,0),Gt=q.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}q.pixelStorei(q.UNPACK_FLIP_Y_WEBGL,K.flipY),q.pixelStorei(q.UNPACK_PREMULTIPLY_ALPHA_WEBGL,K.premultiplyAlpha),q.pixelStorei(q.UNPACK_ALIGNMENT,K.unpackAlignment);let Vt=q.getParameter(q.UNPACK_ROW_LENGTH),xe=q.getParameter(q.UNPACK_IMAGE_HEIGHT),Be=q.getParameter(q.UNPACK_SKIP_PIXELS),sn=q.getParameter(q.UNPACK_SKIP_ROWS),_n=q.getParameter(q.UNPACK_SKIP_IMAGES),ie=H.isCompressedTexture?H.mipmaps[J]:H.image;q.pixelStorei(q.UNPACK_ROW_LENGTH,ie.width),q.pixelStorei(q.UNPACK_IMAGE_HEIGHT,ie.height),q.pixelStorei(q.UNPACK_SKIP_PIXELS,E.min.x),q.pixelStorei(q.UNPACK_SKIP_ROWS,E.min.y),q.pixelStorei(q.UNPACK_SKIP_IMAGES,E.min.z),H.isDataTexture||H.isData3DTexture?q.texSubImage3D(Gt,J,B.x,B.y,B.z,St,At,Pt,Xt,te,ie.data):K.isCompressedArrayTexture?q.compressedTexSubImage3D(Gt,J,B.x,B.y,B.z,St,At,Pt,Xt,ie.data):q.texSubImage3D(Gt,J,B.x,B.y,B.z,St,At,Pt,Xt,te,ie),q.pixelStorei(q.UNPACK_ROW_LENGTH,Vt),q.pixelStorei(q.UNPACK_IMAGE_HEIGHT,xe),q.pixelStorei(q.UNPACK_SKIP_PIXELS,Be),q.pixelStorei(q.UNPACK_SKIP_ROWS,sn),q.pixelStorei(q.UNPACK_SKIP_IMAGES,_n),J===0&&K.generateMipmaps&&q.generateMipmap(Gt),bt.unbindTexture()},this.initTexture=function(E){E.isCubeTexture?G.setTextureCube(E,0):E.isData3DTexture?G.setTexture3D(E,0):E.isDataArrayTexture||E.isCompressedArrayTexture?G.setTexture2DArray(E,0):G.setTexture2D(E,0),bt.unbindTexture()},this.resetState=function(){D=0,T=0,w=null,bt.reset(),Wt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return ar}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;let e=this.getContext();e.drawingBufferColorSpace=t===Sd?"display-p3":"srgb",e.unpackColorSpace=Se.workingColorSpace===ru?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(t){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=t}};var Kc=class r{constructor(t,e=1,n=1e3){this.isFog=!0,this.name="",this.color=new ge(t),this.near=e,this.far=n}clone(){return new r(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}},jc=class extends gn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new cr,this.environmentIntensity=1,this.environmentRotation=new cr,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,this.backgroundRotation.copy(t.backgroundRotation),this.environmentIntensity=t.environmentIntensity,this.environmentRotation.copy(t.environmentRotation),t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){let e=super.toJSON(t);return this.fog!==null&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(e.object.backgroundIntensity=this.backgroundIntensity),e.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(e.object.environmentIntensity=this.environmentIntensity),e.object.environmentRotation=this.environmentRotation.toArray(),e}};var sd=class extends Ns{constructor(t){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new ge(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}},x0=new Oe,od=new kc,Tc=new Go,Ac=new nt,Qc=class extends gn{constructor(t=new Oi,e=new sd){super(),this.isPoints=!0,this.type="Points",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}raycast(t,e){let n=this.geometry,i=this.matrixWorld,s=t.params.Points.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Tc.copy(n.boundingSphere),Tc.applyMatrix4(i),Tc.radius+=s,t.ray.intersectsSphere(Tc)===!1)return;x0.copy(i).invert(),od.copy(t.ray).applyMatrix4(x0);let a=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=a*a,c=n.index,f=n.attributes.position;if(c!==null){let d=Math.max(0,o.start),u=Math.min(c.count,o.start+o.count);for(let _=d,m=u;_<m;_++){let p=c.getX(_);Ac.fromBufferAttribute(f,p),y0(Ac,p,l,i,t,e,this)}}else{let d=Math.max(0,o.start),u=Math.min(f.count,o.start+o.count);for(let _=d,m=u;_<m;_++)Ac.fromBufferAttribute(f,_),y0(Ac,_,l,i,t,e,this)}}updateMorphTargets(){let e=this.geometry.morphAttributes,n=Object.keys(e);if(n.length>0){let i=e[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s<o;s++){let a=i[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[a]=s}}}}};function y0(r,t,e,n,i,s,o){let a=od.distanceSqToPoint(r);if(a<e){let l=new nt;od.closestPointToPoint(r,l),l.applyMatrix4(n);let c=i.ray.origin.distanceTo(l);if(c<i.near||c>i.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:t,face:null,object:o})}}function Dc(r,t,e){return!r||!e&&r.constructor===t?r:typeof t.BYTES_PER_ELEMENT=="number"?new t(r):Array.prototype.slice.call(r)}function FE(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}var Xo=class{constructor(t,e,n,i){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new e.constructor(n),this.sampleValues=e,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(t){let e=this.parameterPositions,n=this._cachedIndex,i=e[n],s=e[n-1];n:{t:{let o;e:{i:if(!(t<i)){for(let a=n+2;;){if(i===void 0){if(t<s)break i;return n=e.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===a)break;if(s=i,i=e[++n],t<i)break t}o=e.length;break e}if(!(t>=s)){let a=e[1];t<a&&(n=2,s=a);for(let l=n-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===l)break;if(i=s,s=e[--n-1],t>=s)break t}o=n,n=0;break e}break n}for(;n<o;){let a=n+o>>>1;t<e[a]?o=a:n=a+1}if(i=e[n],s=e[n-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return n=e.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,s,i)}return this.interpolate_(n,s,t,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){let e=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=t*i;for(let o=0;o!==i;++o)e[o]=n[s+o];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},ad=class extends Xo{constructor(t,e,n,i){super(t,e,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:T_,endingEnd:T_}}intervalChanged_(t,e,n){let i=this.parameterPositions,s=t-2,o=t+1,a=i[s],l=i[o];if(a===void 0)switch(this.getSettings_().endingStart){case A_:s=t,a=2*e-n;break;case D_:s=i.length-2,a=e+i[s]-i[s+1];break;default:s=t,a=n}if(l===void 0)switch(this.getSettings_().endingEnd){case A_:o=t,l=2*n-e;break;case D_:o=1,l=n+i[1]-i[0];break;default:o=t-1,l=e}let c=(n-e)*.5,h=this.valueSize;this._weightPrev=c/(e-a),this._weightNext=c/(l-n),this._offsetPrev=s*h,this._offsetNext=o*h}interpolate_(t,e,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=t*a,c=l-a,h=this._offsetPrev,f=this._offsetNext,d=this._weightPrev,u=this._weightNext,_=(n-e)/(i-e),m=_*_,p=m*_,g=-d*p+2*d*m-d*_,b=(1+d)*p+(-1.5-2*d)*m+(-.5+d)*_+1,v=(-1-u)*p+(1.5+u)*m+.5*_,S=u*p-u*m;for(let D=0;D!==a;++D)s[D]=g*o[h+D]+b*o[c+D]+v*o[l+D]+S*o[f+D];return s}},ld=class extends Xo{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=t*a,c=l-a,h=(n-e)/(i-e),f=1-h;for(let d=0;d!==a;++d)s[d]=o[c+d]*f+o[l+d]*h;return s}},cd=class extends Xo{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t){return this.copySampleValue_(t-1)}},Mi=class{constructor(t,e,n,i){if(t===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(e===void 0||e.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=Dc(e,this.TimeBufferType),this.values=Dc(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(t){let e=t.constructor,n;if(e.toJSON!==this.toJSON)n=e.toJSON(t);else{n={name:t.name,times:Dc(t.times,Array),values:Dc(t.values,Array)};let i=t.getInterpolation();i!==t.DefaultInterpolation&&(n.interpolation=i)}return n.type=t.ValueTypeName,n}InterpolantFactoryMethodDiscrete(t){return new cd(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new ld(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new ad(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case Rc:e=this.InterpolantFactoryMethodDiscrete;break;case Pc:e=this.InterpolantFactoryMethodLinear;break;case lf:e=this.InterpolantFactoryMethodSmooth;break}if(e===void 0){let n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(t!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Rc;case this.InterpolantFactoryMethodLinear:return Pc;case this.InterpolantFactoryMethodSmooth:return lf}}getValueSize(){return this.values.length/this.times.length}shift(t){if(t!==0){let e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]+=t}return this}scale(t){if(t!==1){let e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]*=t}return this}trim(t,e){let n=this.times,i=n.length,s=0,o=i-1;for(;s!==i&&n[s]<t;)++s;for(;o!==-1&&n[o]>e;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);let a=this.getValueSize();this.times=n.slice(s,o),this.values=this.values.slice(s*a,o*a)}return this}validate(){let t=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);let n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let o=null;for(let a=0;a!==s;a++){let l=n[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),t=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),t=!1;break}o=l}if(i!==void 0&&FE(i))for(let a=0,l=i.length;a!==l;++a){let c=i[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),t=!1;break}}return t}optimize(){let t=this.times.slice(),e=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===lf,s=t.length-1,o=1;for(let a=1;a<s;++a){let l=!1,c=t[a],h=t[a+1];if(c!==h&&(a!==1||c!==t[0]))if(i)l=!0;else{let f=a*n,d=f-n,u=f+n;for(let _=0;_!==n;++_){let m=e[f+_];if(m!==e[d+_]||m!==e[u+_]){l=!0;break}}}if(l){if(a!==o){t[o]=t[a];let f=a*n,d=o*n;for(let u=0;u!==n;++u)e[d+u]=e[f+u]}++o}}if(s>0){t[o]=t[s];for(let a=s*n,l=o*n,c=0;c!==n;++c)e[l+c]=e[a+c];++o}return o!==t.length?(this.times=t.slice(0,o),this.values=e.slice(0,o*n)):(this.times=t,this.values=e),this}clone(){let t=this.times.slice(),e=this.values.slice(),n=this.constructor,i=new n(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}};Mi.prototype.TimeBufferType=Float32Array;Mi.prototype.ValueBufferType=Float32Array;Mi.prototype.DefaultInterpolation=Pc;var Us=class extends Mi{};Us.prototype.ValueTypeName="bool";Us.prototype.ValueBufferType=Array;Us.prototype.DefaultInterpolation=Rc;Us.prototype.InterpolantFactoryMethodLinear=void 0;Us.prototype.InterpolantFactoryMethodSmooth=void 0;var ud=class extends Mi{};ud.prototype.ValueTypeName="color";var hd=class extends Mi{};hd.prototype.ValueTypeName="number";var fd=class extends Xo{constructor(t,e,n,i){super(t,e,n,i)}interpolate_(t,e,n,i){let s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(n-e)/(i-e),c=t*a;for(let h=c+a;c!==h;c+=4)Xr.slerpFlat(s,0,o,c-a,o,c,l);return s}},ja=class extends Mi{InterpolantFactoryMethodLinear(t){return new fd(this.times,this.values,this.getValueSize(),t)}};ja.prototype.ValueTypeName="quaternion";ja.prototype.DefaultInterpolation=Pc;ja.prototype.InterpolantFactoryMethodSmooth=void 0;var Os=class extends Mi{};Os.prototype.ValueTypeName="string";Os.prototype.ValueBufferType=Array;Os.prototype.DefaultInterpolation=Rc;Os.prototype.InterpolantFactoryMethodLinear=void 0;Os.prototype.InterpolantFactoryMethodSmooth=void 0;var dd=class extends Mi{};dd.prototype.ValueTypeName="vector";var pd=class{constructor(t,e,n){let i=this,s=!1,o=0,a=0,l,c=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(h){a++,s===!1&&i.onStart!==void 0&&i.onStart(h,o,a),s=!0},this.itemEnd=function(h){o++,i.onProgress!==void 0&&i.onProgress(h,o,a),o===a&&(s=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(h){i.onError!==void 0&&i.onError(h)},this.resolveURL=function(h){return l?l(h):h},this.setURLModifier=function(h){return l=h,this},this.addHandler=function(h,f){return c.push(h,f),this},this.removeHandler=function(h){let f=c.indexOf(h);return f!==-1&&c.splice(f,2),this},this.getHandler=function(h){for(let f=0,d=c.length;f<d;f+=2){let u=c[f],_=c[f+1];if(u.global&&(u.lastIndex=0),u.test(h))return _}return null}}},NE=new pd,md=class{constructor(t){this.manager=t!==void 0?t:NE,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){let n=this;return new Promise(function(i,s){n.load(t,i,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}};md.DEFAULT_MATERIAL_NAME="__DEFAULT";var tu=class extends gn{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new ge(t),this.intensity=e}dispose(){}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){let e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,this.groundColor!==void 0&&(e.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(e.object.distance=this.distance),this.angle!==void 0&&(e.object.angle=this.angle),this.decay!==void 0&&(e.object.decay=this.decay),this.penumbra!==void 0&&(e.object.penumbra=this.penumbra),this.shadow!==void 0&&(e.object.shadow=this.shadow.toJSON()),e}},eu=class extends tu{constructor(t,e,n){super(t,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(gn.DEFAULT_UP),this.updateMatrix(),this.groundColor=new ge(e)}copy(t,e){return super.copy(t,e),this.groundColor.copy(t.groundColor),this}},Nf=new Oe,v0=new nt,S0=new nt,gd=class{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new _e(512,512),this.map=null,this.mapPass=null,this.matrix=new Oe,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Ka,this._frameExtents=new _e(1,1),this._viewportCount=1,this._viewports=[new Qe(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){let e=this.camera,n=this.matrix;v0.setFromMatrixPosition(t.matrixWorld),e.position.copy(v0),S0.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(S0),e.updateMatrixWorld(),Nf.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Nf),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(Nf)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){let t={};return this.bias!==0&&(t.bias=this.bias),this.normalBias!==0&&(t.normalBias=this.normalBias),this.radius!==1&&(t.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}};var _d=class extends gd{constructor(){super(new qc(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}},Bs=class extends tu{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(gn.DEFAULT_UP),this.updateMatrix(),this.target=new gn,this.shadow=new _d}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}};var bd="\\[\\]\\.:\\/",UE=new RegExp("["+bd+"]","g"),wd="[^"+bd+"]",OE="[^"+bd.replace("\\.","")+"]",BE=/((?:WC+[\/:])*)/.source.replace("WC",wd),kE=/(WCOD+)?/.source.replace("WCOD",OE),zE=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",wd),VE=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",wd),HE=new RegExp("^"+BE+kE+zE+VE+"$"),GE=["material","materials","bones","map"],xd=class{constructor(t,e,n){let i=n||De.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,i)}getValue(t,e){this.bind();let n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(t,e)}setValue(t,e){let n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(t,e)}bind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()}unbind(){let t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}},De=class r{constructor(t,e,n){this.path=e,this.parsedPath=n||r.parseTrackName(e),this.node=r.findNode(t,this.parsedPath.nodeName),this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,n){return t&&t.isAnimationObjectGroup?new r.Composite(t,e,n):new r(t,e,n)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(UE,"")}static parseTrackName(t){let e=HE.exec(t);if(e===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);let n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){let s=n.nodeName.substring(i+1);GE.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}static findNode(t,e){if(e===void 0||e===""||e==="."||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){let n=t.skeleton.getBoneByName(e);if(n!==void 0)return n}if(t.children){let n=function(s){for(let o=0;o<s.length;o++){let a=s[o];if(a.name===e||a.uuid===e)return a;let l=n(a.children);if(l)return l}return null},i=n(t.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)t[e++]=n[i]}_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){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=t[e++]}_setValue_array_setNeedsUpdate(t,e){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){let n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=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,e=this.parsedPath,n=e.objectName,i=e.propertyName,s=e.propertyIndex;if(t||(t=r.findNode(this.rootNode,e.nodeName),this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(n){let c=e.objectIndex;switch(n){case"materials":if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}t=t.material.materials;break;case"bones":if(!t.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}t=t.skeleton.bones;for(let h=0;h<t.length;h++)if(t[h].name===c){c=h;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}t=t.material.map;break;default:if(t[n]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}t=t[n]}if(c!==void 0){if(t[c]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);return}t=t[c]}}let o=t[i];if(o===void 0){let c=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+i+" but it wasn't found.",t);return}let a=this.Versioning.None;this.targetObject=t,t.needsUpdate!==void 0?a=this.Versioning.NeedsUpdate:t.matrixWorldNeedsUpdate!==void 0&&(a=this.Versioning.MatrixWorldNeedsUpdate);let l=this.BindingType.Direct;if(s!==void 0){if(i==="morphTargetInfluences"){if(!t.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!t.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}t.morphTargetDictionary[s]!==void 0&&(s=t.morphTargetDictionary[s])}l=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(l=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(l=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=i;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][a]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};De.Composite=xd;De.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};De.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};De.prototype.GetterByBindingType=[De.prototype._getValue_direct,De.prototype._getValue_array,De.prototype._getValue_arrayElement,De.prototype._getValue_toArray];De.prototype.SetterByBindingTypeAndVersioning=[[De.prototype._setValue_direct,De.prototype._setValue_direct_setNeedsUpdate,De.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[De.prototype._setValue_array,De.prototype._setValue_array_setNeedsUpdate,De.prototype._setValue_array_setMatrixWorldNeedsUpdate],[De.prototype._setValue_arrayElement,De.prototype._setValue_arrayElement_setNeedsUpdate,De.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[De.prototype._setValue_fromArray,De.prototype._setValue_fromArray_setNeedsUpdate,De.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var MA=new Float32Array(1);typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:yd}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=yd);var XE=(r,t,e=7e3,n=25)=>{let i=new Br,s=new $c({canvas:r,antialias:!0,alpha:!0}),o=new jc,a=new Dn(18);a.near=1,a.far=2e3,a.position.z=-10,s.outputColorSpace=ni,s.shadowMap.enabled=!0,s.shadowMap.type=vd,o.fog=new Kc(3741705,9,15),o.add(i);let l=new eu(16777215,41378,1),c=new Bs(3355443,4);c.position.set(5,5,5),c.lookAt(0,0,0),c.castShadow=!0,c.shadow.mapSize.width=512,c.shadow.mapSize.height=512,c.shadow.camera.near=.5,c.shadow.camera.far=500,o.add(c),o.add(l);let h=[new Bs(16777215,1),new Bs(11460838,1),new Bs(14277490,1)];h[0].position.set(1,0,0),h[1].position.set(.75,1,.5),h[2].position.set(-.75,-1,.5),h.forEach(b=>o.add(b));let f=new Oi,d=[],u=[],_=n/2;for(let b=0;b<e;b++)d.push(Math.random()*n-_,Math.random()*n-_,Math.random()*n-_),u.push(Math.random()*.9+.1);f.setAttribute("position",new si(d,3)),f.setAttribute("opacity",new si(u,1)),f.computeBoundingSphere();let m=new ai({vertexShader:`
|
|
3822
|
+
attribute float opacity;
|
|
3823
|
+
varying float vOpacity;
|
|
3824
|
+
varying float distanceToCamera;
|
|
3825
|
+
void main() {
|
|
3826
3826
|
vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);
|
|
3827
3827
|
gl_Position = projectionMatrix * mvPosition;
|
|
3828
|
-
vOpacity = opacity;
|
|
3828
|
+
vOpacity = opacity;
|
|
3829
3829
|
distanceToCamera = length(mvPosition.xyz);
|
|
3830
|
-
gl_PointSize = 40.0 / distanceToCamera;
|
|
3830
|
+
gl_PointSize = 40.0 / distanceToCamera;
|
|
3831
3831
|
}
|
|
3832
3832
|
`,fragmentShader:`
|
|
3833
|
-
varying float vOpacity;
|
|
3834
|
-
varying float distanceToCamera;
|
|
3833
|
+
varying float vOpacity;
|
|
3834
|
+
varying float distanceToCamera;
|
|
3835
3835
|
void main() {
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
float opacityFactor = distanceToCamera / 15.0; // Adjust divisor as needed for opacity
|
|
3842
|
-
|
|
3843
|
-
// Combine alpha with opacity and distance factor
|
|
3844
|
-
gl_FragColor = vec4(1.0, 1.0, 1.0, alpha * vOpacity * opacityFactor);
|
|
3836
|
+
float distance = length(gl_PointCoord - vec2(0.5, 0.5));
|
|
3837
|
+
if (distance > 0.5) discard;
|
|
3838
|
+
float alpha = 1.0 - smoothstep(0.3, 0.5, distance);
|
|
3839
|
+
float opacityFactor = distanceToCamera / 15.0;
|
|
3840
|
+
gl_FragColor = vec4(1.0, 1.0, 1.0, alpha * vOpacity * opacityFactor);
|
|
3845
3841
|
}
|
|
3846
|
-
`,blending:zr,transparent:!0});
|
|
3842
|
+
`,blending:zr,transparent:!0});m.needsUpdate=!0,i.add(new Qc(f,m));let p=()=>{let{w:b,h:v}=t();a.aspect=b/v,a.updateProjectionMatrix(),s.setSize(b,v)},g=()=>{requestAnimationFrame(g);let b=Date.now()*.003;i.rotation.z+=.001/4,i.rotation.y+=5e-4/4,i.position.y=Math.sin(b*.05)*.05,a.lookAt(o.position),a.updateMatrixWorld(),s.render(o,a)};p(),s.compile(o,a),g(),window.addEventListener("resize",p,!1)},H0=()=>{let r=document.querySelector("#canvas");r&&window.addEventListener("load",()=>XE(r,()=>({w:window.innerWidth,h:window.innerHeight})),!1)};window.Webflow||(window.Webflow=[]);window.Webflow.push(()=>{Jg(),Pg(),Dg(),Tg(),H0(),zg(),Rg(),Cg(),bm(),wg(),wm(),Ig(),Lg(),gg(),Eg()});})();
|
|
3847
3843
|
/*! Bundled license information:
|
|
3848
3844
|
|
|
3849
3845
|
gsap/gsap-core.js:
|