UNPKG

alrdy-animate

Version:

A library to handle animations on scroll with GSAP integration.

2 lines 24.6 kB
/*! For license information please see gsap-flip.2a4286eb89dcb87f51e7.js.LICENSE.txt */ "use strict";(this.webpackChunkAlrdyAnimate=this.webpackChunkAlrdyAnimate||[]).push([[638],{863(t,e,n){n.d(e,{Flip:()=>at});var i,r,s,a,o,l,u,h,c=n(335),p=1,f=function(t,e){return t.actions.forEach(function(t){return t.vars[e]&&t.vars[e](t)})},d={},m=180/Math.PI,g=Math.PI/180,y={},v={},b={},x=function(t){return"string"==typeof t?t.split(" ").join("").split(","):t},w=x("onStart,onUpdate,onComplete,onReverseComplete,onInterrupt"),C=x("transform,transformOrigin,width,height,position,top,left,opacity,zIndex,maxWidth,maxHeight,minWidth,minHeight"),S=function(t){return i(t)[0]||console.warn("Element not found:",t)},k=function(t){return Math.round(1e4*t)/1e4||0},E=function(t,e,n){return t.forEach(function(t){return t.classList[n](e)})},V={zIndex:1,kill:1,simple:1,spin:1,clearProps:1,targets:1,toggleClass:1,onComplete:1,onUpdate:1,onInterrupt:1,onStart:1,delay:1,repeat:1,repeatDelay:1,yoyo:1,scale:1,fade:1,absolute:1,props:1,onEnter:1,onLeave:1,custom:1,paused:1,nested:1,prune:1,absoluteOnLeave:1},L={zIndex:1,simple:1,clearProps:1,scale:1,absolute:1,fitChild:1,getVars:1,props:1},B=function(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()},_=function(t,e){var n,i={};for(n in t)e[n]||(i[n]=t[n]);return i},I={},A=function(t){var e=I[t]=x(t);return b[t]=e.concat(C),e},P=function t(e,n,i){void 0===i&&(i=0);for(var r=e.parentNode,s=1e3*Math.pow(10,i)*(n?-1:1),a=n?900*-s:0;e;)a+=s,e=e.previousSibling;return r?a+t(r,n,i+1):a},M=function(t,e,n){return t.forEach(function(t){return t.d=P(n?t.element:t.t,e)}),t.sort(function(t,e){return t.d-e.d}),t},O=function(t,e){for(var n,i,r=t.element.style,s=t.css=t.css||[],a=e.length;a--;)i=r[n=e[a]]||r.getPropertyValue(n),s.push(i?n:v[n]||(v[n]=B(n)),i);return r},N=function(t){var e=t.css,n=t.element.style,i=0;for(t.cache.uncache=1;i<e.length;i+=2)e[i+1]?n[e[i]]=e[i+1]:n.removeProperty(e[i]);!e[e.indexOf("transform")+1]&&n.translate&&(n.removeProperty("translate"),n.removeProperty("scale"),n.removeProperty("rotate"))},X=function(t,e){t.forEach(function(t){return t.a.cache.uncache=1}),e||t.finalStates.forEach(N)},T="paddingTop,paddingRight,paddingBottom,paddingLeft,gridArea,transition".split(","),R=function(t,e,n){var i,r,a,o=t.element,u=t.width,h=t.height,p=t.uncache,f=t.getProp,d=o.style,m=4;if("object"!=typeof e&&(e=t),s&&1!==n)return s._abs.push({t:o,b:t,a:t,sd:0}),s._final.push(function(){return(t.cache.uncache=1)&&N(t)}),o;for(r="none"===f("display"),t.isVisible&&!r||(r&&(O(t,["display"]).display=e.display),t.matrix=e.matrix,t.width=u=t.width||e.width,t.height=h=t.height||e.height),O(t,T),a=window.getComputedStyle(o);m--;)d[T[m]]=a[T[m]];if(d.gridArea="1 / 1 / 1 / 1",d.transition="none",d.position="absolute",d.width=u+"px",d.height=h+"px",d.top||(d.top="0px"),d.left||(d.left="0px"),p)i=new it(o);else if((i=_(t,y)).position="absolute",t.simple){var g=o.getBoundingClientRect();i.matrix=new c.cA(1,0,0,1,g.left+(0,c.Mt)(),g.top+(0,c.eK)())}else i.matrix=(0,c.hK)(o,!1,!1,!0);return i=H(i,t,!0),t.x=l(i.x,.01),t.y=l(i.y,.01),o},Y=function(t,e){return!0!==e&&(e=i(e),t=t.filter(function(t){if(-1!==e.indexOf((t.sd<0?t.b:t.a).element))return!0;t.t._gsap.renderTransform(1),t.b.isVisible&&(t.t.style.width=t.b.width+"px",t.t.style.height=t.b.height+"px")})),t},K=function(t){return M(t,!0).forEach(function(t){return(t.a.isVisible||t.b.isVisible)&&R(t.sd<0?t.b:t.a,t.b,1)})},z=function(t,e,n,i){return t instanceof it?t:t instanceof nt?function(t,e){return e&&t.idLookup[z(e).id]||t.elementStates[0]}(t,i):new it("string"==typeof t?S(t)||console.warn(t+" not found"):t,e,n)},D=function(t,e){var n,i=t.style||t;for(n in e)i[n]=e[n]},F=function(t){return t.map(function(t){return t.element})},j=function(t,e,n){return t&&e.length&&n.add(t(F(e),n,new nt(e,0,!0)),0)},H=function(t,e,n,s,a,o){var h,p,f,d,y,v,b,x=t.element,w=t.cache,C=t.parent,S=t.x,E=t.y,V=e.width,L=e.height,B=e.scaleX,_=e.scaleY,I=e.rotation,A=e.bounds,P=o&&u&&u(x,"transform,width,height"),M=t,O=e.matrix,N=O.e,X=O.f,T=t.bounds.width!==A.width||t.bounds.height!==A.height||t.scaleX!==B||t.scaleY!==_||t.rotation!==I,R=!T&&t.simple&&e.simple&&!a;return R||!C?(B=_=1,I=h=0):(y=function(t){var e=t._gsap||r.core.getCache(t);return e.gmCache===r.ticker.frame?e.gMatrix:(e.gmCache=r.ticker.frame,e.gMatrix=(0,c.hK)(t,!0,!1,!0))}(C),v=y.clone().multiply(e.ctm?e.matrix.clone().multiply(e.ctm):e.matrix),I=k(Math.atan2(v.b,v.a)*m),h=k(Math.atan2(v.c,v.d)*m+I)%360,B=Math.sqrt(Math.pow(v.a,2)+Math.pow(v.b,2)),_=Math.sqrt(Math.pow(v.c,2)+Math.pow(v.d,2))*Math.cos(h*g),a&&(a=i(a)[0],d=r.getProperty(a),b=a.getBBox&&"function"==typeof a.getBBox&&a.getBBox(),M={scaleX:d("scaleX"),scaleY:d("scaleY"),width:b?b.width:Math.ceil(parseFloat(d("width","px"))),height:b?b.height:parseFloat(d("height","px"))}),w.rotation=I+"deg",w.skewX=h+"deg"),n?(B*=V!==M.width&&M.width?V/M.width:1,_*=L!==M.height&&M.height?L/M.height:1,w.scaleX=B,w.scaleY=_):(V=l(V*B/M.scaleX,0),L=l(L*_/M.scaleY,0),x.style.width=V+"px",x.style.height=L+"px"),s&&D(x,e.props),R||!C?(S+=N-t.matrix.e,E+=X-t.matrix.f):T||C!==e.parent?(w.x=S+"px",w.y=E+"px",w.renderTransform(1,w),v=(0,c.hK)(a||x,!1,!1,!0),p=y.apply({x:v.e,y:v.f}),S+=(f=y.apply({x:N,y:X})).x-p.x,E+=f.y-p.y):(y.e=y.f=0,S+=(f=y.apply({x:N-t.matrix.e,y:X-t.matrix.f})).x,E+=f.y),S=l(S,.02),E=l(E,.02),!o||o instanceof it?(w.x=S+"px",w.y=E+"px",w.renderTransform(1,w)):P&&P.revert(),o&&(o.x=S,o.y=E,o.rotation=I,o.skewX=h,n?(o.scaleX=B,o.scaleY=_):(o.width=V,o.height=L)),o||w},W=function(t,e){return t instanceof nt?t:new nt(t,e)},q=function(t,e,n){var i=t.idLookup[n],r=t.alt[n];return!r.isVisible||(e.getElementState(r.element)||r).isVisible&&i.isVisible?i:r},J=[],Q="width,height,overflowX,overflowY".split(","),U=function(t){if(t!==h){var e=o.style,n=o.clientWidth===window.outerWidth,i=o.clientHeight===window.outerHeight,r=4;if(t&&(n||i)){for(;r--;)J[r]=e[Q[r]];n&&(e.width=o.clientWidth+"px",e.overflowY="hidden"),i&&(e.height=o.clientHeight+"px",e.overflowX="hidden"),h=t}else if(h){for(;r--;)J[r]?e[Q[r]]=J[r]:e.removeProperty(B(Q[r]));h=t}}},Z=function(t,e){for(var n=0;n<t.length;n+=3)r.set(t[n],{clearProps:!0}),t[n].setAttribute("style",t[n+e]),t[n]._gsap.gmCache=-1},$=function(t,e,n,i){t instanceof nt&&e instanceof nt||console.warn("Not a valid state object.");var a,o,l,u,h,p,f,d,m,g,y,v,x,S,k,B=n=n||{},P=B.clearProps,N=B.onEnter,T=B.onLeave,R=B.absolute,z=B.absoluteOnLeave,D=B.custom,F=B.delay,W=B.paused,J=B.repeat,Q=B.repeatDelay,$=B.yoyo,G=B.toggleClass,et=B.nested,rt=B.zIndex,st=B.scale,at=B.fade,ot=B.stagger,lt=B.spin,ut=B.prune,ht=("props"in n?n:t).props,ct=_(n,V),pt=r.timeline({delay:F,paused:W,repeat:J,repeatDelay:Q,yoyo:$,data:"isFlip"}),ft=ct,dt=[],mt=[],gt=[],yt=[],vt=!0===lt?1:lt||0,bt="function"==typeof lt?lt:function(){return vt},xt=t.interrupted||e.interrupted,wt=pt[1!==i?"to":"from"];for(o in e.idLookup)y=e.alt[o]?q(e,t,o):e.idLookup[o],h=y.element,g=t.idLookup[o],t.alt[o]&&h===g.element&&(t.alt[o].isVisible||!y.isVisible)&&(g=t.alt[o]),g?(p={t:h,b:g,a:y,sd:g.element===h?0:y.isVisible?1:-1},gt.push(p),p.sd&&(p.sd<0&&(p.b=y,p.a=g),xt&&O(p.b,ht?b[ht]:C),at&&gt.push(p.swap={t:g.element,b:p.b,a:p.a,sd:-p.sd,swap:p})),h._flip=g.element._flip=s?s.timeline:pt):y.isVisible&&(gt.push({t:h,b:_(y,{isVisible:1}),a:y,sd:0,entering:1}),h._flip=s?s.timeline:pt);ht&&(I[ht]||A(ht)).forEach(function(t){return ct[t]=function(e){return gt[e].a.props[t]}}),gt.finalStates=m=[],v=function(){M(gt),U(!0);var e,i=[];for(u=0;u<gt.length;u++)p=gt[u],x=p.a,S=p.b,!ut||x.isDifferent(S)||p.entering?(h=p.t,!et||p.sd<0||!u||(x=p.a=x.clone({matrix:(0,c.hK)(h,!1,!1,!0)})),S.isVisible&&x.isVisible?(p.sd<0?(et&&Z(i,1),f=new it(h,ht,t.simple),H(f,x,st,0,0,f),f.matrix=(0,c.hK)(h,!1,!1,!0),f.bounds=h.getBoundingClientRect(),f.css=p.b.css,p.a=x=f,at&&(h.style.opacity=xt?S.opacity:x.opacity),ot&&yt.push(h),et&&(Z(i,2),i.push(h,h.getAttribute("style")))):p.sd>0&&at&&(h.style.opacity=xt?x.opacity-S.opacity:"0"),H(x,S,st,ht),et&&p.sd<0&&i.push(h.getAttribute("style"))):S.isVisible!==x.isVisible&&(S.isVisible?x.isVisible||(S.css=x.css,mt.push(S),gt.splice(u--,1),R&&et&&H(x,S,st,ht)):(x.isVisible&&dt.push(x),gt.splice(u--,1))),st||(h.style.maxWidth=Math.max(x.width,S.width)+"px",h.style.maxHeight=Math.max(x.height,S.height)+"px",h.style.minWidth=Math.min(x.width,S.width)+"px",h.style.minHeight=Math.min(x.height,S.height)+"px"),et&&G&&h.classList.add(G)):gt.splice(u--,1),m.push(x);if(G&&(e=m.map(function(t){return t.element}),et&&e.forEach(function(t){return t.classList.remove(G)})),U(!1),st?(ct.scaleX=function(t){return gt[t].a.scaleX},ct.scaleY=function(t){return gt[t].a.scaleY}):(ct.width=function(t){return gt[t].a.width+"px"},ct.height=function(t){return gt[t].a.height+"px"},ct.autoRound=n.autoRound||!1),ct.x=function(t){return gt[t].a.x+"px"},ct.y=function(t){return gt[t].a.y+"px"},ct.rotation=function(t){return gt[t].a.rotation+(lt?360*bt(t,d[t],d):0)},ct.skewX=function(t){return gt[t].a.skewX},d=gt.map(function(t){return t.t}),(rt||0===rt)&&(ct.modifiers={zIndex:function(){return rt}},ct.zIndex=rt,ct.immediateRender=!1!==n.immediateRender),at&&(ct.opacity=function(t){return gt[t].sd<0?0:gt[t].sd>0?gt[t].a.opacity:"+=0"}),yt.length){ot=r.utils.distribute(ot);var g=d.slice(yt.length);ct.stagger=function(t,e){return ot(~yt.indexOf(e)?d.indexOf(gt[t].swap.t):t,e,g)}}if(w.forEach(function(t){return n[t]&&pt.eventCallback(t,n[t],n[t+"Params"])}),D&&d.length)for(o in ft=_(ct,V),"scale"in D&&(D.scaleX=D.scaleY=D.scale,delete D.scale),D)(a=_(D[o],L))[o]=ct[o],!("duration"in a)&&"duration"in ct&&(a.duration=ct.duration),a.stagger=ct.stagger,wt.call(pt,d,a,0),delete ft[o];(d.length||mt.length||dt.length)&&(G&&pt.add(function(){return E(e,G,pt._zTime<0?"remove":"add")},0)&&!W&&E(e,G,"add"),d.length&&wt.call(pt,d,ft,0)),j(N,dt,pt),j(T,mt,pt);var y=s&&s.timeline;y&&(y.add(pt,0),s._final.push(function(){return X(gt,!P)})),l=pt.duration(),pt.call(function(){var t=pt.time()>=l;t&&!y&&X(gt,!P),G&&E(e,G,t?"remove":"add")})},z&&(R=gt.filter(function(t){return!t.sd&&!t.a.isVisible&&t.b.isVisible}).map(function(t){return t.a.element})),s?(R&&(k=s._abs).push.apply(k,Y(gt,R)),s._run.push(v)):(R&&K(Y(gt,R)),v());var Ct=s?s.timeline:pt;return Ct.revert=function(){return tt(Ct,1,1)},Ct},G=function t(e){e.vars.onInterrupt&&e.vars.onInterrupt.apply(e,e.vars.onInterruptParams||[]),e.getChildren(!0,!1,!0).forEach(t)},tt=function(t,e,n){if(t&&t.progress()<1&&(!t.paused()||n))return e&&(G(t),e<2&&t.progress(1),t.kill()),!0},et=function(t){for(var e,n=t.idLookup={},i=t.alt={},r=t.elementStates,s=r.length;s--;)n[(e=r[s]).id]?i[e.id]=e:n[e.id]=e},nt=function(){function t(t,e,n){if(this.props=e&&e.props,this.simple=!(!e||!e.simple),n)this.targets=F(t),this.elementStates=t,et(this);else{this.targets=i(t);var r=e&&(!1===e.kill||e.batch&&!e.kill);s&&!r&&s._kill.push(this),this.update(r||!!s)}}var e=t.prototype;return e.update=function(t){var e=this;return this.elementStates=this.targets.map(function(t){return new it(t,e.props,e.simple)}),et(this),this.interrupt(t),this.recordInlineStyles(),this},e.clear=function(){return this.targets.length=this.elementStates.length=0,et(this),this},e.fit=function(t,e,n){for(var i,r,s=M(this.elementStates.slice(0),!1,!0),a=(t||this).idLookup,o=0;o<s.length;o++)i=s[o],n&&(i.matrix=(0,c.hK)(i.element,!1,!1,!0)),(r=a[i.id])&&H(i,r,e,!0,0,i),i.matrix=(0,c.hK)(i.element,!1,!1,!0);return this},e.getProperty=function(t,e){var n=this.getElementState(t)||y;return(e in n?n:n.props||y)[e]},e.add=function(t){for(var e,n,i,r=t.targets.length,s=this.idLookup,a=this.alt;r--;)(i=s[(n=t.elementStates[r]).id])&&(n.element===i.element||a[n.id]&&a[n.id].element===n.element)?(e=this.elementStates.indexOf(n.element===i.element?i:a[n.id]),this.targets.splice(e,1,t.targets[r]),this.elementStates.splice(e,1,n)):(this.targets.push(t.targets[r]),this.elementStates.push(n));return t.interrupted&&(this.interrupted=!0),t.simple||(this.simple=!1),et(this),this},e.compare=function(t){var e,n,i,r,s,a,o,l,u=t.idLookup,h=this.idLookup,c=[],p=[],f=[],d=[],m=[],g=t.alt,y=this.alt,v=function(t,e,n){return(t.isVisible!==e.isVisible?t.isVisible?f:d:t.isVisible?p:c).push(n)&&m.push(n)},b=function(t,e,n){return m.indexOf(n)<0&&v(t,e,n)};for(i in u)s=g[i],a=y[i],r=(e=s?q(t,this,i):u[i]).element,n=h[i],a?(l=n.isVisible||!a.isVisible&&r===n.element?n:a,(o=!s||e.isVisible||s.isVisible||l.element!==s.element?e:s).isVisible&&l.isVisible&&o.element!==l.element?((o.isDifferent(l)?p:c).push(o.element,l.element),m.push(o.element,l.element)):v(o,l,o.element),s&&o.element===s.element&&(s=u[i]),b(o.element!==n.element&&s?s:o,n,n.element),b(s&&s.element===a.element?s:o,a,a.element),s&&b(s,a.element===s.element?a:n,s.element)):(n?n.isDifferent(e)?v(e,n,r):c.push(r):f.push(r),s&&b(s,n,s.element));for(i in h)u[i]||(d.push(h[i].element),y[i]&&d.push(y[i].element));return{changed:p,unchanged:c,enter:f,leave:d}},e.recordInlineStyles=function(){for(var t=b[this.props]||C,e=this.elementStates.length;e--;)O(this.elementStates[e],t)},e.interrupt=function(t){var e=this,n=[];this.targets.forEach(function(i){var r=i._flip,s=tt(r,t?0:1);t&&s&&n.indexOf(r)<0&&r.add(function(){return e.updateVisibility()}),s&&n.push(r)}),!t&&n.length&&this.updateVisibility(),this.interrupted||(this.interrupted=!!n.length)},e.updateVisibility=function(){this.elementStates.forEach(function(t){var e=t.element.getBoundingClientRect();t.isVisible=!!(e.width||e.height||e.top||e.left),t.uncache=1})},e.getElementState=function(t){return this.elementStates[this.targets.indexOf(S(t))]},e.makeAbsolute=function(){return M(this.elementStates.slice(0),!0,!0).map(R)},t}(),it=function(){function t(e,n,i){e instanceof t?Object.assign(this,e,n||{}):(this.element=e,this.update(n,i))}var e=t.prototype;return e.isDifferent=function(t){var e=this.bounds,n=t.bounds;return e.top!==n.top||e.left!==n.left||e.width!==n.width||e.height!==n.height||!this.matrix.equals(t.matrix)||this.opacity!==t.opacity||this.props&&t.props&&JSON.stringify(this.props)!==JSON.stringify(t.props)},e.clone=function(e){return new t(this,e)},e.update=function(t,e){var n,i,s=this,a=s.element,o=r.getProperty(a),u=r.core.getCache(a),h=a.getBoundingClientRect(),f=a.getBBox&&"function"==typeof a.getBBox&&"svg"!==a.nodeName.toLowerCase()&&a.getBBox(),d=e?new c.cA(1,0,0,1,h.left+(0,c.Mt)(),h.top+(0,c.eK)()):(0,c.hK)(a,!1,!1,!0);u.uncache=1,s.getProp=o,s.element=a,s.id=((i=(n=a).getAttribute("data-flip-id"))||n.setAttribute("data-flip-id",i="auto-"+p++),i),s.matrix=d,s.cache=u,s.bounds=h,s.isVisible=!!(h.width||h.height||h.left||h.top),s.display=o("display"),s.position=o("position"),s.parent=a.parentNode,s.x=o("x","px"),s.y=o("y","px"),s.scaleX=u.scaleX,s.scaleY=u.scaleY,s.rotation=o("rotation"),s.skewX=o("skewX"),s.opacity=o("opacity"),s.width=f?f.width:l(o("width","px"),.04),s.height=f?f.height:l(o("height","px"),.04),t&&function(t,e){for(var n=r.getProperty(t.element,null,"native"),i=t.props={},s=e.length;s--;)i[e[s]]=(n(e[s])+"").trim();i.zIndex&&(i.zIndex=parseFloat(i.zIndex)||0)}(s,I[t]||A(t)),s.ctm=a.getCTM&&"svg"===a.nodeName.toLowerCase()&&(0,c.KQ)(a).inverse(),s.simple=e||1===k(d.a)&&!k(d.b)&&!k(d.c)&&1===k(d.d),s.uncache=0},t}(),rt=function(){function t(t,e){this.vars=t,this.batch=e,this.states=[],this.timeline=e.timeline}var e=t.prototype;return e.getStateById=function(t){for(var e=this.states.length;e--;)if(this.states[e].idLookup[t])return this.states[e]},e.kill=function(){this.batch.remove(this)},t}(),st=function(){function t(t){this.id=t,this.actions=[],this._kill=[],this._final=[],this._abs=[],this._run=[],this.data={},this.state=new nt,this.timeline=r.timeline()}var e=t.prototype;return e.add=function(t){var e=this.actions.filter(function(e){return e.vars===t});return e.length?e[0]:(e=new rt("function"==typeof t?{animate:t}:t,this),this.actions.push(e),e)},e.remove=function(t){var e=this.actions.indexOf(t);return e>=0&&this.actions.splice(e,1),this},e.getState=function(t){var e=this,n=s,i=a;return s=this,this.state.clear(),this._kill.length=0,this.actions.forEach(function(n){n.vars.getState&&(n.states.length=0,a=n,n.state=n.vars.getState(n)),t&&n.states.forEach(function(t){return e.state.add(t)})}),a=i,s=n,this.killConflicts(),this},e.animate=function(){var t,e,n=this,i=s,r=this.timeline,a=this.actions.length;for(s=this,r.clear(),this._abs.length=this._final.length=this._run.length=0,this.actions.forEach(function(t){t.vars.animate&&t.vars.animate(t);var e,n,i=t.vars.onEnter,r=t.vars.onLeave,s=t.targets;s&&s.length&&(i||r)&&(e=new nt,t.states.forEach(function(t){return e.add(t)}),(n=e.compare(at.getState(s))).enter.length&&i&&i(n.enter),n.leave.length&&r&&r(n.leave))}),K(this._abs),this._run.forEach(function(t){return t()}),e=r.duration(),t=this._final.slice(0),r.add(function(){e<=r.time()&&(t.forEach(function(t){return t()}),f(n,"onComplete"))}),s=i;a--;)this.actions[a].vars.once&&this.actions[a].kill();return f(this,"onStart"),r.restart(),this},e.loadState=function(t){t||(t=function(){return 0});var e=[];return this.actions.forEach(function(n){if(n.vars.loadState){var i,r=function r(s){s&&(n.targets=s),~(i=e.indexOf(r))&&(e.splice(i,1),e.length||t())};e.push(r),n.vars.loadState(r)}}),e.length||t(),this},e.setState=function(){return this.actions.forEach(function(t){return t.targets=t.vars.setState&&t.vars.setState(t)}),this},e.killConflicts=function(t){return this.state.interrupt(t),this._kill.forEach(function(e){return e.interrupt(t)}),this},e.run=function(t,e){var n=this;return this!==s&&(t||this.getState(e),this.loadState(function(){n._killed||(n.setState(),n.animate())})),this},e.clear=function(t){this.state.clear(),t||(this.actions.length=0)},e.getStateById=function(t){for(var e,n=this.actions.length;n--;)if(e=this.actions[n].getStateById(t))return e;return this.state.idLookup[t]&&this.state},e.kill=function(){this._killed=1,this.clear(),delete d[this.id]},t}(),at=function(){function t(){}return t.getState=function(e,n){var i=W(e,n);return a&&a.states.push(i),n&&n.batch&&t.batch(n.batch).state.add(i),i},t.from=function(t,e){return"clearProps"in(e=e||{})||(e.clearProps=!0),$(t,W(e.targets||t.targets,{props:e.props||t.props,simple:e.simple,kill:!!e.kill}),e,-1)},t.to=function(t,e){return $(t,W(e.targets||t.targets,{props:e.props||t.props,simple:e.simple,kill:!!e.kill}),e,1)},t.fromTo=function(t,e,n){return $(t,e,n)},t.fit=function(t,e,n){var i=n?_(n,L):{},s=n||i,a=s.absolute,o=s.scale,l=s.getVars,u=s.props,h=s.runBackwards,c=s.onComplete,p=s.simple,f=n&&n.fitChild&&S(n.fitChild),d=z(e,u,p,t),m=z(t,0,p,d),g=u?b[u]:C,y=r.context();return u&&D(i,d.props),O(m,g),h&&("immediateRender"in i||(i.immediateRender=!0),i.onComplete=function(){N(m),c&&c.apply(this,arguments)}),a&&R(m,d),i=H(m,d,o||f,!i.duration&&u,f,i.duration||l?i:0),"object"==typeof n&&"zIndex"in n&&(i.zIndex=n.zIndex),y&&!l&&y.add(function(){return function(){return N(m)}}),l?i:i.duration?r.to(m.element,i):null},t.makeAbsolute=function(t,e){return(t instanceof nt?t:new nt(t,e)).makeAbsolute()},t.batch=function(t){return t||(t="default"),d[t]||(d[t]=new st(t))},t.killFlipsOf=function(t,e){(t instanceof nt?t.targets:i(t)).forEach(function(t){return t&&tt(t._flip,!1!==e?1:2)})},t.isFlipping=function(e){var n=t.getByTarget(e);return!!n&&n.isActive()},t.getByTarget=function(t){return(S(t)||y)._flip},t.getElementState=function(t,e){return new it(S(t),e)},t.convertCoordinates=function(t,e,n){var i=(0,c.hK)(e,!0,!0).multiply((0,c.hK)(t));return n?i.apply(n):i},t.register=function(t){if(o="undefined"!=typeof document&&document.body){r=t,(0,c.mk)(o),i=r.utils.toArray,u=r.core.getStyleSaver;var e=r.utils.snap(.1);l=function(t,n){return e(parseFloat(t)+n)}}},t}();at.version="3.15.0","undefined"!=typeof window&&window.gsap&&window.gsap.registerPlugin(at)},335(t,e,n){n.d(e,{KQ:()=>C,Mt:()=>v,cA:()=>k,eK:()=>y,hK:()=>E,mk:()=>d});var i,r,s,a,o,l,u,h,c,p="transform",f=p+"Origin",d=function(t){var e=t.ownerDocument||t;!(p in t.style)&&"msTransform"in t.style&&(f=(p="msTransform")+"Origin");for(;e.parentNode&&(e=e.parentNode););if(r=window,u=new k,e){i=e,s=e.documentElement,a=e.body,(h=i.createElementNS("http://www.w3.org/2000/svg","g")).style.transform="none";var n=e.createElement("div"),o=e.createElement("div"),l=e&&(e.body||e.firstElementChild);l&&l.appendChild&&(l.appendChild(n),n.appendChild(o),n.style.position="static",n.style.transform="translate3d(0,0,1px)",c=o.offsetParent!==n,l.removeChild(n))}return e},m=[],g=[],y=function(){return r.pageYOffset||i.scrollTop||s.scrollTop||a.scrollTop||0},v=function(){return r.pageXOffset||i.scrollLeft||s.scrollLeft||a.scrollLeft||0},b=function(t){return t.ownerSVGElement||("svg"===(t.tagName+"").toLowerCase()?t:null)},x=function t(e){return"fixed"===r.getComputedStyle(e).position||((e=e.parentNode)&&1===e.nodeType?t(e):void 0)},w=function t(e,n){if(e.parentNode&&(i||d(e))){var r=b(e),s=r?r.getAttribute("xmlns")||"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",a=r?n?"rect":"g":"div",u=2!==n?0:100,h=3===n?100:0,c={position:"absolute",display:"block",pointerEvents:"none",margin:"0",padding:"0"},p=i.createElementNS?i.createElementNS(s.replace(/^https/,"http"),a):i.createElement(a);return n&&(r?(l||(l=t(e)),p.setAttribute("width",.01),p.setAttribute("height",.01),p.setAttribute("transform","translate("+u+","+h+")"),p.setAttribute("fill","transparent"),l.appendChild(p)):(o||(o=t(e),Object.assign(o.style,c)),Object.assign(p.style,c,{width:"0.1px",height:"0.1px",top:h+"px",left:u+"px"}),o.appendChild(p))),p}throw"Need document and parent."},C=function(t){var e,n=t.getCTM();return n||(e=t.style[p],t.style[p]="none",t.appendChild(h),n=h.getCTM(),t.removeChild(h),e?t.style[p]=e:t.style.removeProperty(p.replace(/([A-Z])/g,"-$1").toLowerCase())),n||u.clone()},S=function(t,e,n,i,r,s,a){return t.a=e,t.b=n,t.c=i,t.d=r,t.e=s,t.f=a,t},k=function(){function t(t,e,n,i,r,s){void 0===t&&(t=1),void 0===e&&(e=0),void 0===n&&(n=0),void 0===i&&(i=1),void 0===r&&(r=0),void 0===s&&(s=0),S(this,t,e,n,i,r,s)}var e=t.prototype;return e.inverse=function(){var t=this.a,e=this.b,n=this.c,i=this.d,r=this.e,s=this.f,a=t*i-e*n||1e-10;return S(this,i/a,-e/a,-n/a,t/a,(n*s-i*r)/a,-(t*s-e*r)/a)},e.multiply=function(t){var e=this.a,n=this.b,i=this.c,r=this.d,s=this.e,a=this.f,o=t.a,l=t.c,u=t.b,h=t.d,c=t.e,p=t.f;return S(this,o*e+u*i,o*n+u*r,l*e+h*i,l*n+h*r,s+c*e+p*i,a+c*n+p*r)},e.clone=function(){return new t(this.a,this.b,this.c,this.d,this.e,this.f)},e.equals=function(t){var e=this.a,n=this.b,i=this.c,r=this.d,s=this.e,a=this.f;return e===t.a&&n===t.b&&i===t.c&&r===t.d&&s===t.e&&a===t.f},e.apply=function(t,e){void 0===e&&(e={});var n=t.x,i=t.y,r=this.a,s=this.b,a=this.c,o=this.d,l=this.e,u=this.f;return e.x=n*r+i*a+l||0,e.y=n*s+i*o+u||0,e},t}();function E(t,e,n,s){if(!t||!t.parentNode||(i||d(t)).documentElement===t)return new k;var h=function(t){for(var e,n;t&&t!==a;)(n=t._gsap)&&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}(t),S=b(t)?m:g,E=function(t,e){var n,i,s,a,h,d,y=b(t),v=t===y,x=y?m:g,S=t.parentNode,E=S&&!y&&S.shadowRoot&&S.shadowRoot.appendChild?S.shadowRoot:S;if(t===r)return t;if(x.length||x.push(w(t,1),w(t,2),w(t,3)),n=y?l:o,y)v?(a=-(s=C(t)).e/s.a,h=-s.f/s.d,i=u):t.getBBox?(s=t.getBBox(),a=(i=(i=t.transform?t.transform.baseVal:{}).numberOfItems?i.numberOfItems>1?function(t){for(var e=new k,n=0;n<t.numberOfItems;n++)e.multiply(t.getItem(n).matrix);return e}(i):i.getItem(0).matrix:u).a*s.x+i.c*s.y,h=i.b*s.x+i.d*s.y):(i=new k,a=h=0),e&&"g"===t.tagName.toLowerCase()&&(a=h=0),(v||!t.getBoundingClientRect().width?y:S).appendChild(n),n.setAttribute("transform","matrix("+i.a+","+i.b+","+i.c+","+i.d+","+(i.e+a)+","+(i.f+h)+")");else{if(a=h=0,c)for(i=t.offsetParent,s=t;s&&(s=s.parentNode)&&s!==i&&s.parentNode;)(r.getComputedStyle(s)[p]+"").length>4&&(a=s.offsetLeft,h=s.offsetTop,s=0);if("absolute"!==(d=r.getComputedStyle(t)).position&&"fixed"!==d.position)for(i=t.offsetParent;S&&S!==i;)a+=S.scrollLeft||0,h+=S.scrollTop||0,S=S.parentNode;(s=n.style).top=t.offsetTop-h+"px",s.left=t.offsetLeft-a+"px",s[p]=d[p],s[f]=d[f],s.position="fixed"===d.position?"fixed":"absolute",E.appendChild(n)}return n}(t,n),V=S[0].getBoundingClientRect(),L=S[1].getBoundingClientRect(),B=S[2].getBoundingClientRect(),_=E.parentNode,I=!s&&x(t),A=new k((L.left-V.left)/100,(L.top-V.top)/100,(B.left-V.left)/100,(B.top-V.top)/100,V.left+(I?0:v()),V.top+(I?0:y()));if(_.removeChild(E),h)for(V=h.length;V--;)(L=h[V]).scaleX=L.scaleY=0,L.renderTransform(1,L);return e?A.inverse():A}}}]);