squiffy-runtime 6.0.0-beta.4 → 6.0.0-beta.5
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/squiffy.runtime.global.js +2 -2
- package/dist/squiffy.runtime.global.js.map +1 -1
- package/dist/squiffy.runtime.js +72 -69
- package/dist/squiffy.runtime.js.map +1 -1
- package/dist/types.d.ts +1 -0
- package/package.json +3 -3
- package/src/plugins/plugins.test.ts +166 -19
- package/src/squiffy.runtime.test.ts +37 -0
- package/src/squiffy.runtime.ts +1 -0
- package/src/types.ts +1 -0
|
@@ -90,7 +90,7 @@ Expecting `+C.join(", ")+", got '"+(this.terminals_[y]||y)+"'":H="Parse error on
|
|
|
90
90
|
|
|
91
91
|
`)?i.innerHTML=Pr(n.content,{async:!1}).trim():i.innerHTML=Cr(n.content,{async:!1}).trim(),!n.name))continue;const o=i.innerHTML;let a=[];const h=()=>{for(const l of a)e.animation.removeLinkAnimation(l);a=[...i.querySelectorAll("a")];for(const l of a)e.animation.addLinkAnimation(l,f)},u=()=>{if(n.trigger!=="link"){i.innerHTML=o;return}const l=a;i.innerHTML=o,h(),a.forEach((d,c)=>{const p=l[c];if(!p)return;p.classList.contains("disabled")&&d.classList.add("disabled");const g=p.getAttribute("tabindex");g!==null&&d.setAttribute("tabindex",g)})},f=()=>{n.loop?e.animation.runAnimation(n.name,i,n,()=>{},!0):(e.animation.isInitiallyHidden(n.name)&&(i.style.opacity="0"),e.addTransition(()=>new Promise(l=>{i.style.opacity="",e.animation.runAnimation(n.name,i,n,()=>{i.classList.remove("squiffy-animate"),u(),l()},!1)})))};n.trigger==="link"?h():f()}};return{name:"animate",init(r){e=r,e.registerHelper("animate",function(i,n){const o=n.fn(this),a={name:i,content:o,...n.hash},h=Object.entries(a).map(([f,l])=>` data-${Qe.default.escapeExpression(f)}="${Qe.default.escapeExpression(JSON.stringify(l))}"`).join(""),u=o.includes(`
|
|
92
92
|
|
|
93
|
-
`)?"div":"span";return new Qe.default.SafeString(`<${u} class="squiffy-animate"${h}></${u}>`)})},onWrite(r){s(r)},onLoad(){s(e.outputElement)}}}var hs={ReplaceLabel:xl,RotateSequencePlugin:Tl,RandomPlugin:Cl,LivePlugin:Pl,AnimatePlugin:El},Al=class{constructor(){this.linkHandlers={}}registerLinkHandler(e,t){this.linkHandlers[e]=t}handleLink(e){const t=e.getAttribute("data-handler")||"",s=this.linkHandlers[t];return s?[!0,t,s(e)]:[!1,t,{}]}},yt=typeof window<"u",Xe=yt?window:null,Q=yt?document:null,Le={OBJECT:0,ATTRIBUTE:1,CSS:2,TRANSFORM:3,CSS_VAR:4},pe={NUMBER:0,UNIT:1,COLOR:2,COMPLEX:3},et={NONE:0,AUTO:1,FORCE:2},He={replace:0,none:1,blend:2},Qi=Symbol(),Ht=Symbol(),Ir=Symbol(),ds=Symbol(),Ji=Symbol(),Re=1e-11,pt=1e12,Ye=1e3,au="var(",Ds=[],Or=(()=>{const e=new Map;return e.set("x","translateX"),e.set("y","translateY"),e.set("z","translateZ"),e})(),$t=["perspective","translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY"],Ki=$t.reduce((e,t)=>({...e,[t]:t+"("}),{}),oe=()=>{},Ll=e=>e,Rl=/\)\s*[-.\d]/,Il=/(^#([\da-f]{3}){1,2}$)|(^#([\da-f]{4}){1,2}$)/i,Ol=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,Nl=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,Ml=/hsl\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*\)/i,Dl=/hsla\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,ji=/[-+]?\d*\.?\d+(?:e[-+]?\d)?/gi,en=/^([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z]+|%)$/i,Bl=/([a-z])([A-Z])/g,tn=/(\*=|\+=|-=)/,Hl=/var\(\s*(--[\w-]+)(?:\s*,\s*([^)]+))?\s*\)/,fs={id:null,keyframes:null,playbackEase:null,playbackRate:1,frameRate:240,loop:0,reversed:!1,alternate:!1,autoplay:!0,persist:!1,duration:Ye,delay:0,loopDelay:0,ease:"out(2)",composition:He.replace,modifier:Ll,onBegin:oe,onBeforeUpdate:oe,onUpdate:oe,onLoop:oe,onPause:oe,onComplete:oe,onRender:oe},Ie={current:null,root:Q},z={defaults:fs,precision:4,timeScale:1,tickThreshold:200,editor:null},sn={version:"4.5.0",engine:null};yt&&(Xe.AnimeJS||(Xe.AnimeJS=[]),Xe.AnimeJS.push(sn));var Bs=e=>e.replace(Bl,"$1-$2").toLowerCase(),Me=(e,t)=>e.indexOf(t)===0,Et=Date.now,$e=Array.isArray,De=e=>e&&e.constructor===Object,qe=e=>typeof e=="number"&&!isNaN(e),Be=e=>typeof e=="string",Ee=e=>typeof e=="function",D=e=>typeof e>"u",qt=e=>D(e)||e===null,Hs=e=>yt&&e instanceof SVGElement,rn=e=>Il.test(e),nn=e=>Me(e,"rgb"),on=e=>Me(e,"hsl"),$l=e=>rn(e)||(nn(e)||on(e))&&(e[e.length-1]===")"||!Rl.test(e)),Jt=e=>!z.defaults.hasOwnProperty(e),ql=["opacity","rotate","overflow","color"],Fl=(e,t)=>{if(ql.includes(t))return!1;if(e.getAttribute(t)||t in e){if(t==="scale"){const s=e.parentNode;return s&&s.tagName==="filter"}return!0}},Ft=e=>Be(e)?parseFloat(e):e,Vt=Math.pow,nt=Math.sqrt,Nr=Math.sin,Mr=Math.cos,ot=Math.abs,$s=Math.exp,Vl=Math.ceil,Kt=Math.floor,zl=Math.asin,an=Math.max,qs=Math.atan2,bt=Math.PI,Dr=Math.round,Z=(e,t,s)=>e<t?t:e>s?s:e,F=(e,t)=>{if(t<0)return e;if(!t)return Dr(e);const s=10**t;return Dr(e*s)/s},zt=(e,t)=>$e(t)?t.reduce((s,r)=>ot(r-e)<ot(s-e)?r:s):t?Dr(e/t)*t:e,At=(e,t,s)=>s===1?t:s===0?e:e+(t-e)*s,Fs=e=>e===1/0?pt:e===-1/0?-pt:e,jt=e=>e<=1e-11?Re:Fs(F(e,11)),Ue=e=>$e(e)?[...e]:e,at=(e,t)=>{const s={...e};for(let r in t){const i=e[r];s[r]=D(i)?t[r]:i}return s},Se=(e,t,s,r="_prev",i="_next")=>{let n=e._head,o=i;for(s&&(n=e._tail,o=r);n;){const a=n[o];t(n),n=a}},gt=(e,t,s="_prev",r="_next")=>{const i=t[s],n=t[r];i?i[r]=n:e._head=n,n?n[s]=i:e._tail=i,t[s]=null,t[r]=null},mt=(e,t,s,r="_prev",i="_next")=>{let n=e._tail;for(;n&&s&&s(n,t);)n=n[r];const o=n?n[i]:e._head;n?n[i]=t:e._head=t,o?o[r]=t:e._tail=t,t[r]=n,t[i]=o},Ul=(e,t,s)=>{const r=e.style.transform;if(r){const i=e[ds];let n=0;const o=r.length;let a;for(;n<o;){for(;n<o&&r.charCodeAt(n)===32;)n++;if(n>=o)break;const u=n;for(;n<o&&r.charCodeAt(n)!==40;)n++;if(n>=o)break;const f=r.substring(u,n);let l=1;const d=n+1;let c=-1,p=-1;for(n++;n<o&&l>0;){const v=r.charCodeAt(n);v===40?l++:v===41?l--:v===44&&l===1&&(c===-1?c=n:p===-1&&(p=n)),n++}const g=n-1;f==="translate"||f==="translate3d"?(c===-1?i.translateX=r.substring(d,g).trim():(i.translateX=r.substring(d,c).trim(),p===-1?i.translateY=r.substring(c+1,g).trim():(i.translateY=r.substring(c+1,p).trim(),i.translateZ=r.substring(p+1,g).trim())),a=r.substring(d,g)):f==="scale"||f==="scale3d"?c===-1?i.scale=r.substring(d,g).trim():(i.scaleX=r.substring(d,c).trim(),p===-1?i.scaleY=r.substring(c+1,g).trim():(i.scaleY=r.substring(c+1,p).trim(),i.scaleZ=r.substring(p+1,g).trim())):i[f]=r.substring(d,g)}if(t==="translate3d"&&a)return s&&(s[t]=a),a;const h=i[t];if(!D(h))return s&&(s[t]=h),h}return t==="translate3d"?"0px, 0px, 0px":t==="rotate3d"?"0, 0, 0, 0deg":Me(t,"scale")?"1":Me(t,"rotate")||Me(t,"skew")?"0deg":"0px"},ln=e=>{let t="";for(let s=0,r=$t.length;s<r;s++){const i=$t[s],n=e[i];if(n!==void 0){if(i==="translateX"){const o=e.translateY;if(o!==void 0){const a=e.translateZ;a!==void 0?(t+=`translate3d(${n},${o},${a}) `,s+=2):(t+=`translate(${n},${o}) `,s+=1);continue}}if(i==="scaleX"&&e.scale===void 0){const o=e.scaleY;if(o!==void 0){const a=e.scaleZ;a!==void 0?(t+=`scale3d(${n},${o},${a}) `,s+=2):(t+=`scale(${n},${o}) `,s+=1);continue}}t+=`${Ki[i]}${n}) `}i==="rotateZ"&&e.rotate3d!==void 0&&(t+=`rotate3d(${e.rotate3d}) `)}return e.matrix!==void 0&&(t+=`matrix(${e.matrix}) `),e.matrix3d!==void 0&&(t+=`matrix3d(${e.matrix3d}) `),t},Br=[];function cn(e,t){if(!e)return null;const s=Br.length;e:for(let r=0;r<s;r++){const i=Br[r];if(i.detect&&!i.detect(e))continue;const n=i.targetAdapters;for(let o=0,a=n.length;o<a;o++){const h=n[o];if(h.detect(e)){const u=h.props[t];if(u&&(!u.gate||u.gate(e)))return u;break e}}}for(let r=0;r<s;r++){const i=Br[r];if(i.detect&&!i.detect(e))continue;const n=i.propertyResolvers;for(let o=0,a=n.length;o<a;o++){const h=n[o](e,t);if(h)return h}}return null}var Wl=e=>{const t=Ol.exec(e)||Nl.exec(e),s=D(t[4])?1:+t[4];return[+t[1],+t[2],+t[3],s]},Xl=e=>{const t=e.length,s=t===4||t===5;return[+("0x"+e[1]+e[s?1:2]),+("0x"+e[s?2:3]+e[s?2:4]),+("0x"+e[s?3:5]+e[s?3:6]),t===5||t===9?+(+("0x"+e[s?4:7]+e[s?4:8])/255).toFixed(3):1]},Hr=(e,t,s)=>(s<0&&(s+=1),s>1&&(s-=1),s<1/6?e+(t-e)*6*s:s<1/2?t:s<2/3?e+(t-e)*(2/3-s)*6:e),Yl=e=>{const t=Ml.exec(e)||Dl.exec(e),s=+t[1]/360,r=+t[2]/100,i=+t[3]/100,n=D(t[4])?1:+t[4];let o,a,h;if(r===0)o=a=h=i;else{const u=i<.5?i*(1+r):i+r-i*r,f=2*i-u;o=F(Hr(f,u,s+1/3)*255,0),a=F(Hr(f,u,s)*255,0),h=F(Hr(f,u,s-1/3)*255,0)}return[o,a,h,n]},Gl=e=>nn(e)?Wl(e):rn(e)?Xl(e):on(e)?Yl(e):[0,0,0,1],U=(e,t)=>D(e)?t:e,un=(e,t)=>{const s=e.match(Hl),r=t[Ht]?t:document.documentElement;let i=getComputedStyle(r)?.getPropertyValue(s[1]);return(!i||i.trim()==="")&&s[2]&&(i=s[2].trim()),i||0},Ne=(e,t,s,r,i,n)=>{if(Ee(e)){if(!i){const a=e(t,s,r,n);return isNaN(+a)?a||0:+a}const o=()=>{const a=e(t,s,r,n);return isNaN(+a)?a||0:+a};return i.func=o,o()}if(Be(e)&&Me(e,"var(")){if(!i)return un(e,t);const o=()=>un(e,t);return i.func=o,o()}return e},$r=(e,t)=>e[Ht]?e[Ir]&&Fl(e,t)?Le.ATTRIBUTE:$t.includes(t)||Or.get(t)?Le.TRANSFORM:Me(t,"--")?Le.CSS_VAR:t in e.style?Le.CSS:t in e?Le.OBJECT:Le.ATTRIBUTE:Le.OBJECT,hn=(e,t,s)=>{const r=e.style[t];r&&s&&(s[t]=r);const i=r||getComputedStyle(e[Ji]||e).getPropertyValue(t);return i==="auto"?"0":i},Ut=(e,t,s,r)=>{const i=D(s)?$r(e,t):s,n=cn(e,t);if(n){const o=n.get(e);return o&&r&&(r[t]=o),o??0}if(i===Le.OBJECT){const o=e[t];return o&&r&&(r[t]=o),o||0}if(i===Le.ATTRIBUTE){const o=e.getAttribute(t);return o&&r&&(r[t]=o),o}return i===Le.TRANSFORM?Ul(e,t,r):i===Le.CSS_VAR?hn(e,t,r).trimStart():hn(e,t,r)},Wt=(e,t,s)=>s==="-"?e-t:s==="+"?e+t:e*t,qr=()=>({t:pe.NUMBER,n:0,u:null,o:null,d:null,s:null}),Je=(e,t)=>{if(t.t=pe.NUMBER,t.n=0,t.u=null,t.o=null,t.d=null,t.s=null,!e)return t;const s=+e;if(!isNaN(s))return t.n=s,t;let r=e;r[1]==="="&&(t.o=r[0],r=r.slice(2));const i=r.includes(" ")?!1:en.exec(r);if(i)return t.t=pe.UNIT,t.n=+i[1],t.u=i[2],t;if(t.o)return t.n=+r,t;if($l(r))return t.t=pe.COLOR,t.d=Gl(r),t;{const n=r.match(ji);return t.t=pe.COMPLEX,t.d=n?n.map(Number):[],t.s=r.split(ji)||[],t}},dn=(e,t)=>(t.t=e._valueType,t.n=e._toNumber,t.u=e._unit,t.o=null,t.d=Ue(e._toNumbers),t.s=Ue(e._strings),t),Fe=qr(),fn=(e,t,s)=>{const r=e._modifier,i=e._fromNumbers,n=e._toNumbers,o=e._strings;let a=o[0];for(let h=0,u=n.length;h<u;h++){const f=r(F(At(i[h],n[h],t),s)),l=o[h+1];a+=`${l?f+l:f}`,e._numbers[h]=f}return a},Vs=(e,t,s,r,i)=>{const n=e.parent,o=e.duration,a=e.completed,h=e.iterationDuration,u=e.iterationCount,f=e._currentIteration,l=e._loopDelay,d=e._reversed,c=e._alternate,p=e._hasChildren,g=e._delay,v=e._currentTime,_=g+h,S=t-g,y=Z(v,-g,o),m=Z(S,-g,o),b=S-v,k=m>0,w=m>=o,E=o<=Re,O=i===et.FORCE;let P=0,A=S,C=0;if(u>1){const M=h+(w?0:l),I=~~(m/M);e._currentIteration=Z(I,0,u),w&&e._currentIteration--,P=e._currentIteration%2,A=m-I*M||0}const H=d^(c&&P),$=e._ease;let V=w?H?0:o:H?h-A:A;$&&(V=h*$(V/h)||0);const x=(n?n.backwards:S<v)?!H:!!H;if(e._currentTime=S,e._iterationTime=V,e.backwards=x,k&&!e.began?(e.began=!0,!s&&!(n&&(x||!n.began))&&e.onBegin(e)):S<=0&&(e.began=!1),!s&&!p&&k&&e._currentIteration!==f&&e.onLoop(e),O||i===et.AUTO&&(t>=(n&&g>0?0:g)&&t<=_||t<=g&&y>g||t>=_&&y!==o)||V>=_&&y!==o||V<=g&&y>0&&!w||t<=y&&y===o&&a||w&&!a&&E){if(k&&(e.computeDeltaTime(y),s||e.onBeforeUpdate(e)),!p){const M=O||(x?b*-1:b)>=z.tickThreshold,I=F(e._offset+(n?n._offset:0)+g+V,12);let L=e._head,q,K,G,W,ee=0;for(;L;){const Y=L._composition,re=L._currentTime,ge=L._changeDuration,he=L._absoluteStartTime+L._changeDuration,le=L._nextRep,J=L._prevRep,ce=Y!==He.none,fe=J?J._absoluteStartTime+J._changeDuration:0,ie=J&&J.parent!==L.parent,ae=!le||le._isOverridden?he:le.parent===L.parent?he+le._delay:le._absoluteStartTime<le._absoluteUpdateStartTime?le._absoluteStartTime:le._absoluteUpdateStartTime;if((M||(re!==ge||I<=ae||J&&!ie&&(!le||le.parent!==L.parent))&&(re!==0||I>=L._absoluteStartTime||ie&&!L._hasFromValue&&!J._isOverridden&&I>=fe||le&&!le._isOverridden&&le.parent===L.parent&&le._currentTime!==0&&V<le._startTime))&&(!J||ie||V>=L._startTime)&&(!ce||!L._isOverridden&&(!L._isOverlapped||I<=he)&&(!le||le._isOverridden||I<=ae)&&(!J||J._isOverridden||(ie?I>=L._absoluteStartTime||!L._hasFromValue&&I>=fe:I>=fe+L._delay)))){const ke=L._currentTime=Z(V-L._startTime,0,ge),ye=L._ease(ke/L._updateDuration),we=L._modifier,Te=L._valueType,xe=L._tweenType,me=xe===Le.OBJECT,te=Te===pe.NUMBER,T=te&&me||ye===0||ye===1?-1:z.precision;let N,B;if(te)N=B=we(F(At(L._fromNumber,L._toNumber,ye),T));else if(Te===pe.UNIT)B=we(F(At(L._fromNumber,L._toNumber,ye),T)),N=`${B}${L._unit}`;else if(Te===pe.COLOR){const R=L._numbers,X=L._fromNumbers,j=L._toNumbers,se=1-ye,be=X[0],Ae=X[1],Oe=X[2],Yt=j[0],Es=j[1],Nt=j[2];R[0]=we(Math.sqrt(be*be*se+Yt*Yt*ye)),R[1]=we(Math.sqrt(Ae*Ae*se+Es*Es*ye)),R[2]=we(Math.sqrt(Oe*Oe*se+Nt*Nt*ye)),R[3]=we(At(X[3],j[3],ye)),(!L._setter||r)&&(N=`rgba(${F(R[0],0)},${F(R[1],0)},${F(R[2],0)},${R[3]})`)}else Te===pe.COMPLEX&&(N=fn(L,ye,T));if(ce&&(L._number=B),!r&&Y!==He.blend){const R=L.property;q=L.target,L._setter?L._setter(q,B,L):me?q[R]=N:xe===Le.ATTRIBUTE?q.setAttribute(R,N):(K=q.style,xe===Le.TRANSFORM?(q!==G&&(G=q,W=q[ds]),W[R]=N,ee=1):xe===Le.CSS?K[R]=N:xe===Le.CSS_VAR&&K.setProperty(R,N)),k&&(C=1)}else L._value=N}else re&&J&&!ie&&V<L._startTime&&(L._currentTime=0);ee&&L._renderTransforms&&(K.transform=ln(W),ee=0),L=L._next}!s&&C&&e.onRender(e)}!s&&k&&e.onUpdate(e)}return n&&E?!s&&(n.began&&!x&&S>0&&!a||x&&S<=1e-11&&a)&&(e.onComplete(e),e.completed=!x):k&&w?u===1/0?e._startTime+=e.duration:e._currentIteration>=u-1&&(e.paused=!0,!a&&!p&&(e.completed=!0,!s&&!(n&&(x||!n.began))&&(e.onComplete(e),e._resolve(e)))):e.completed=!1,C},Xt=(e,t,s,r,i)=>{const n=e._currentIteration;if(Vs(e,t,s,r,i),e._hasChildren){const o=e,a=o.backwards,h=r?t:o._iterationTime,u=Et();let f=0,l=!0;if(!r&&o._currentIteration!==n){const d=o.iterationDuration;Se(o,c=>{if(!a)!c.completed&&!c.backwards&&c._currentTime<c.iterationDuration&&Vs(c,d,s,1,et.FORCE),c.began=!1,c.completed=!1;else{const p=c.duration,g=c._offset+c._delay,v=g+p;!s&&p<=1e-11&&(!g||v===d)&&c.onComplete(c)}}),s||o.onLoop(o)}Se(o,d=>{const c=F((h-d._offset)*d._speed,12);if(a&&c>d._delay+d.duration)return;const p=d._fps<o._fps?d.requestTick(u):i;f+=Vs(d,c,s,r,p),!d.completed&&l&&(l=!1)},a),!s&&f&&o.onRender(o),(l||a)&&o._currentTime>=o.duration&&(o.paused=!0,o.completed||(o.completed=!0,s||(o.onComplete(o),o._resolve(o))))}},pn={},Fr=(e,t,s)=>{if(s===Le.TRANSFORM){const r=Or.get(e);return r||e}else if(s===Le.CSS||s===Le.ATTRIBUTE&&Hs(t)&&e in t.style){const r=pn[e];if(r)return r;{const i=e&&Bs(e);return pn[e]=i,i}}else return e},zs=(e,t=!1)=>{if(e._hasChildren)Se(e,s=>zs(s,t),!0);else{const s=e;s.pause(),Se(s,r=>{const i=r.property,n=r.target,o=r._tweenType,a=r._inlineValue,h=qt(a)||a==="";if(r._setter){if(!t&&!h){if(Je(a,Fe),Fe.d){const u=Fe.d,f=r._numbers;for(let l=0,d=u.length;l<d;l++)f[l]=u[l]}else r._number=Fe.n;r._setter(r.target,r._number,r)}}else if(o===Le.OBJECT)!t&&!h&&(n[i]=a);else if(n[Ht])if(o===Le.ATTRIBUTE)t||(h?n.removeAttribute(i):n.setAttribute(i,a));else{const u=n.style;if(o===Le.TRANSFORM){const f=n[ds];h?delete f[i]:f[i]=a,r._renderTransforms&&(Object.keys(f).length?u.transform=ln(f):u.removeProperty("transform"))}else h?u.removeProperty(Bs(i)):u[i]=a}n[Ht]&&s._tail===r&&s.targets.forEach(u=>{u.getAttribute&&u.getAttribute("style")===""&&u.removeAttribute("style")})})}return e},gn=e=>zs(e,!0),mn=class{constructor(e=0){this.deltaTime=0,this._currentTime=e,this._lastTickTime=e,this._startTime=e,this._lastTime=e,this._frameDuration=Ye/240,this._fps=240,this._speed=1,this._hasChildren=!1,this._head=null,this._tail=null}get fps(){return this._fps}set fps(e){const t=+e,s=t<1e-11?Re:t,r=Ye/s;s>fs.frameRate&&(fs.frameRate=s),this._fps=s,this._frameDuration=r}get speed(){return this._speed}set speed(e){const t=+e;this._speed=t<1e-11?Re:t}requestTick(e){const t=this._frameDuration,s=e-this._lastTickTime,r=t*.25;return s+(r<4?r:4)<t?et.NONE:(this._lastTickTime=s>=t?e-s%t:e,et.AUTO)}computeDeltaTime(e){const t=e-this._lastTime;return this.deltaTime=t,this._lastTime=e,t}},es={animation:null,update:oe},Zl=e=>{let t=es.animation;return t||(t={duration:Re,computeDeltaTime:oe,_offset:0,_delay:0,_head:null,_tail:null},es.animation=t,es.update=()=>{e.forEach(s=>{for(let r in s){const i=s[r],n=i._head;if(n){const o=n._valueType,a=o===pe.COMPLEX||o===pe.COLOR?Ue(n._fromNumbers):null;let h=n._fromNumber,u=i._tail;for(;u&&u!==n;){if(a)for(let f=0,l=u._numbers.length;f<l;f++)a[f]+=u._numbers[f];else h+=u._number;u=u._prevAdd}n._toNumber=h,n._toNumbers=a}}}),Vs(t,1,1,0,et.FORCE)}),t},vn=yt?requestAnimationFrame:setImmediate,Ql=yt?cancelAnimationFrame:clearImmediate,Jl=class extends mn{constructor(e){super(e),this.useDefaultMainLoop=!0,this.pauseOnDocumentHidden=!0,this.defaults=fs,this.paused=!0,this.reqId=0}update(){const e=this._currentTime=Et();if(this.requestTick(e)){this.computeDeltaTime(e);const t=this._speed,s=this._fps;let r=this._head;for(;r;){const i=r._next;r.paused?(gt(this,r),this._hasChildren=!!this._tail,r._running=!1,r.completed&&!r._cancelled&&r.cancel()):Xt(r,(e-r._startTime)*r._speed*t,0,0,r._fps<s?r.requestTick(e):et.AUTO),r=i}es.update()}}wake(){return this.useDefaultMainLoop&&!this.reqId&&(this.requestTick(Et()),this.reqId=vn(yn)),this}pause(){if(this.reqId)return this.paused=!0,Kl()}resume(){if(this.paused)return this.paused=!1,Se(this,e=>e.resetTime()),this.wake()}get speed(){return this._speed*(z.timeScale===1?1:Ye)}set speed(e){const t=e*z.timeScale;this._speed!==t&&(this._speed=t,Se(this,s=>s.speed=s._speed))}get timeUnit(){return z.timeScale===1?"ms":"s"}set timeUnit(e){const s=e==="s",r=s?.001:1;if(z.timeScale!==r){z.timeScale=r,z.tickThreshold=200*r;const i=s?.001:Ye;this.defaults.duration*=i,this._speed*=i}}get precision(){return z.precision}set precision(e){z.precision=e}},Ve=(()=>{const e=new Jl(Et());return yt&&(sn.engine=e,Q.addEventListener("visibilitychange",()=>{e.pauseOnDocumentHidden&&(Q.hidden?e.pause():e.resume())})),e})(),yn=()=>{Ve._head?(Ve.reqId=vn(yn),Ve.update()):Ve.reqId=0},Kl=()=>(Ql(Ve.reqId),Ve.reqId=0,Ve),Us={_rep:new WeakMap,_add:new Map},Vr=(e,t,s="_rep")=>{const r=Us[s];let i=r.get(e);return i||(i={},r.set(e,i)),i[t]?i[t]:i[t]={_head:null,_tail:null}},jl=(e,t)=>e._isOverridden||e._absoluteStartTime>t._absoluteStartTime,Ws=e=>{e._isOverlapped=1,e._isOverridden=1,e._changeDuration=Re,e._currentTime=Re},bn=(e,t)=>{const s=e._composition;if(s===He.replace){const r=e._absoluteStartTime;mt(t,e,jl,"_prevRep","_nextRep");const i=e._prevRep;if(i){const n=i.parent,o=i._absoluteEndTime;if(e.parent.id!==n.id&&n.iterationCount>1&&o+(n.duration-n.iterationDuration)>r){Ws(i);let u=i._prevRep;for(;u&&u.parent.id===n.id;)Ws(u),u=u._prevRep}const a=e._absoluteUpdateStartTime;if(o>a){const u=i._startTime,f=o-(u+i._updateDuration),l=F(a-f-u,12);i._changeDuration=l,i._currentTime=l,i._isOverlapped=1,l<1e-11&&Ws(i)}const h=e.parent.parent;if(!h||h!==n.parent){let u=!0;if(Se(n,f=>{f._isOverlapped||(u=!1)}),u){const f=n.parent;if(f){let l=!0;Se(f,d=>{d!==n&&Se(d,c=>{c._isOverlapped||(l=!1)})}),l&&f.cancel()}else n.cancel()}}}}else if(s===He.blend){const r=Vr(e.target,e.property,"_add"),i=Zl(Us._add);let n=r._head;n||(n={...e},n._composition=He.replace,n._updateDuration=Re,n._startTime=0,n._numbers=Ue(e._fromNumbers),n._number=0,n._next=null,n._prev=null,mt(r,n),mt(i,n));const o=e._toNumber;if(e._fromNumber=n._fromNumber-o,e._toNumber=0,e._numbers=Ue(e._fromNumbers),e._number=0,n._fromNumber=o,e._toNumbers.length){const a=Ue(e._toNumbers);a.forEach((h,u)=>{e._fromNumbers[u]=n._fromNumbers[u]-h,e._toNumbers[u]=0}),n._fromNumbers=a}mt(r,e,null,"_prevAdd","_nextAdd")}return e},_n=e=>{const t=e._composition;if(t!==He.none){const s=e.target,r=e.property,i=Us._rep.get(s)[r];if(gt(i,e,"_prevRep","_nextRep"),t===He.blend){const n=Us._add,o=n.get(s);if(!o)return;const a=o[r],h=es.animation;gt(a,e,"_prevAdd","_nextAdd");const u=a._head;if(u&&u===a._tail){gt(a,u,"_prevAdd","_nextAdd"),gt(h,u);let f=!0;for(let l in o)if(o[l]._head){f=!1;break}f&&n.delete(s)}}}return e},Sn=(e,t,s)=>{let r=!1;return Se(t,i=>{const n=i.target;if(e.includes(n)){const o=i.property,a=i._tweenType,h=Fr(s,n,a);(!h||h&&h===o)&&(i.parent._tail===i&&i._tweenType===Le.TRANSFORM&&i._prev&&i._prev._tweenType===Le.TRANSFORM&&(i._prev._renderTransforms=1),gt(t,i),_n(i),r=!0)}},!0),r},kt=(e,t,s)=>{const r=t||Ve;let i;if(r._hasChildren){let n=0;Se(r,o=>{if(!o._hasChildren)if(i=Sn(e,o,s),i&&!o._head)o.cancel(),gt(r,o);else{const a=o._offset+o._delay+o.duration;a>n&&(n=a)}o._head?kt(e,o,s):o._hasChildren=!1},!0),D(r.iterationDuration)||(r.iterationDuration=n)}else i=Sn(e,r,s);i&&!r._head&&(r._hasChildren=!1,r.cancel&&r.cancel())},kn=e=>(e.paused=!0,e.began=!1,e.completed=!1,e),zr=e=>(e._cancelled&&(e._hasChildren?Se(e,zr):Se(e,t=>{t._composition!==He.none&&bn(t,Vr(t.target,t.property))}),e._cancelled=0),e),wn=0,ec=(e,t)=>e._priority>t._priority,tt=class extends mn{constructor(e={},t=null,s=0){super(0),++wn;const{id:r,delay:i,duration:n,reversed:o,alternate:a,loop:h,loopDelay:u,autoplay:f,frameRate:l,playbackRate:d,priority:c,onComplete:p,onLoop:g,onPause:v,onBegin:_,onBeforeUpdate:S,onUpdate:y}=e;Ie.current&&Ie.current.register(this);const m=t?0:Ve._lastTickTime,b=t?t.defaults:z.defaults,k=Ee(i)||D(i)?b.delay:+i,w=Ee(n)||D(n)?1/0:+n,E=U(h,b.loop),O=U(u,b.loopDelay);let P=E===!0||E===1/0||E<0?1/0:E+1,A=0;t?A=s:(Ve.reqId||Ve.requestTick(Et()),A=(Ve._lastTickTime-Ve._startTime)*z.timeScale),this.id=D(r)?wn:r,this.parent=t,this.duration=Fs((w+O)*P-O)||1e-11,this.backwards=!1,this.paused=!0,this.began=!1,this.completed=!1,this.onBegin=_||b.onBegin,this.onBeforeUpdate=S||b.onBeforeUpdate,this.onUpdate=y||b.onUpdate,this.onLoop=g||b.onLoop,this.onPause=v||b.onPause,this.onComplete=p||b.onComplete,this.iterationDuration=w,this.iterationCount=P,this._autoplay=t?!1:U(f,b.autoplay),this._offset=A,this._delay=k,this._loopDelay=O,this._iterationTime=0,this._currentIteration=0,this._resolve=oe,this._running=!1,this._reversed=+U(o,b.reversed),this._reverse=this._reversed,this._cancelled=0,this._alternate=U(a,b.alternate),this._prev=null,this._next=null,this._lastTickTime=m,this._startTime=m,this._lastTime=m,this._fps=U(l,b.frameRate),this._speed=U(d,b.playbackRate),this._priority=+U(c,1)}get cancelled(){return!!this._cancelled}set cancelled(e){e?this.cancel():this.reset(!0).play()}get currentTime(){return Z(F(this._currentTime,z.precision),-this._delay,this.duration)}set currentTime(e){const t=this.paused;this.pause().seek(+e),t||this.resume()}get iterationCurrentTime(){return Z(F(this._iterationTime,z.precision),0,this.iterationDuration)}set iterationCurrentTime(e){this.currentTime=this.iterationDuration*this._currentIteration+e}get progress(){return Z(F(this._currentTime/this.duration,10),0,1)}set progress(e){this.currentTime=this.duration*e}get iterationProgress(){return Z(F(this._iterationTime/this.iterationDuration,10),0,1)}set iterationProgress(e){const t=this.iterationDuration;this.currentTime=t*this._currentIteration+t*e}get currentIteration(){return this._currentIteration}set currentIteration(e){this.currentTime=this.iterationDuration*Z(+e,0,this.iterationCount-1)}get reversed(){return!!this._reversed}set reversed(e){e?this.reverse():this.play()}get speed(){return super.speed}set speed(e){super.speed=e,this.resetTime()}reset(e=!1){return zr(this),this._reversed&&!this._reverse&&(this.reversed=!1),this._iterationTime=this.iterationDuration,Xt(this,0,1,~~e,et.FORCE),kn(this),this._hasChildren&&Se(this,kn),this}init(e=!1){this.fps=this._fps,this.speed=this._speed,!e&&this._hasChildren&&Xt(this,this.duration,1,~~e,et.FORCE),this.reset(e);const t=this._autoplay;return t===!0?this.resume():t&&!D(t.linked)&&t.link(this),this}resetTime(){const e=1/(this._speed*Ve._speed);return this._startTime=Et()-(this._currentTime+this._delay)*e,this}pause(){return this.paused?this:(this.paused=!0,this.onPause(this),this)}resume(){return this.paused?(this.paused=!1,this.duration<=1e-11&&!this._hasChildren?Xt(this,Re,0,0,et.FORCE):(this._running||(mt(Ve,this,ec),Ve._hasChildren=!0,this._running=!0),this.resetTime(),this._startTime-=12,Ve.wake()),this):this}restart(){return this.reset().resume()}seek(e,t=0,s=0){zr(this),this.completed=!1;const r=this.paused;return this.paused=!0,Xt(this,e+this._delay,~~t,~~s,et.AUTO),r?this:this.resume()}alternate(){const e=this._reversed,t=this.iterationCount,s=this.iterationDuration,r=t===1/0?Kt(pt/s):t;return this._reversed=+(this._alternate&&!(r%2)?e:!e),t===1/0?this.iterationProgress=this._reversed?1-this.iterationProgress:this.iterationProgress:this.seek(s*r-this._currentTime),this.resetTime(),this}play(){return this._reversed&&this.alternate(),this.resume()}reverse(){return this._reversed||this.alternate(),this.resume()}cancel(){return this._hasChildren?Se(this,e=>e.cancel(),!0):Se(this,_n),this._cancelled=1,this.pause()}stretch(e){const t=this.duration,s=jt(e);if(t===s)return this;const r=e/t,i=e<=Re;return this.duration=i?Re:s,this.iterationDuration=i?Re:jt(this.iterationDuration*r),this._offset*=r,this._delay*=r,this._loopDelay*=r,this}revert(){Xt(this,0,1,0,et.AUTO);const e=this._autoplay;return e&&e.linked&&e.linked===this&&e.revert(),this.cancel()}complete(e=0){return this.seek(this.duration,e).cancel()}then(e=oe){const t=this.then,s=()=>{this.then=null,e(this),this.then=t,this._resolve=oe};return new Promise(r=>(this._resolve=()=>r(s()),this.completed&&this._resolve(),this))}},tc=e=>new tt(e,null,0).init();function Ur(e){const t=Be(e)?Ie.root.querySelectorAll(e):e;if(t instanceof NodeList||t instanceof HTMLCollection)return t}function st(e){if(qt(e))return[];if(!yt)return $e(e)&&e.flat(1/0)||[e];if($e(e)){const s=e.flat(1/0),r=[];for(let i=0,n=s.length;i<n;i++){const o=s[i];if(!qt(o)){const a=Ur(o);if(a)for(let h=0,u=a.length;h<u;h++){const f=a[h];if(!qt(f)){let l=!1;for(let d=0,c=r.length;d<c;d++)if(r[d]===f){l=!0;break}l||r.push(f)}}else{let h=!1;for(let u=0,f=r.length;u<f;u++)if(r[u]===o){h=!0;break}h||r.push(o)}}}return r}const t=Ur(e);return t?Array.from(t):[e]}function Lt(e){const t=st(e),s=t.length;for(let r=0;r<s;r++){const i=t[r];if(!i[Qi]){i[Qi]=!0;const n=Hs(i);(i.nodeType||n)&&(i[Ht]=!0,i[Ir]=n,i[ds]={})}}return t}var Wr={deg:1,rad:180/bt,turn:360},xn={},Xs=(e,t,s,r=!1)=>{const i=t.u,n=t.n;if(t.t===pe.UNIT&&i===s)return t;const o=n+i+s,a=xn[o];if(!D(a)&&!r)t.n=a;else{let h;if(i in Wr)h=n*Wr[i]/Wr[s];else{const f=e.cloneNode(),l=e.parentNode,d=l&&l!==Q?l:Q.body;d.appendChild(f);const c=f.style;c.width=100+i;const p=f.offsetWidth||100;c.width=100+s;const g=p/(f.offsetWidth||100);d.removeChild(f),h=g*n}t.n=h,xn[o]=h}return t.t,pe.UNIT,t.u=s,t},rt=e=>e,ps=(e=1.68)=>t=>Vt(t,+e),Xr={in:e=>t=>e(t),out:e=>t=>1-e(1-t),inOut:e=>t=>t<.5?e(t*2)/2:1-e(t*-2+2)/2,outIn:e=>t=>t<.5?(1-e(1-t*2))/2:(e(t*2-1)+1)/2},sc=bt/2,Tn=bt*2,Cn={"":ps,Quad:ps(2),Cubic:ps(3),Quart:ps(4),Quint:ps(5),Sine:e=>1-Mr(e*sc),Circ:e=>1-nt(1-e*e),Expo:e=>e?Vt(2,10*e-10):0,Bounce:e=>{let t,s=4;for(;e<((t=Vt(2,--s))-1)/11;);return 1/Vt(4,3-s)-7.5625*Vt((t*3-2)/22-e,2)},Back:(e=1.7)=>t=>(+e+1)*t*t*t-+e*t*t,Elastic:(e=1,t=.3)=>{const s=Z(+e,1,10),r=Z(+t,Re,2),i=r/Tn*zl(1/s),n=Tn/r;return o=>o===0||o===1?o:-s*Vt(2,-10*(1-o))*Nr((1-o-i)*n)}},wt=(()=>{const e={linear:rt,none:rt};for(let t in Xr)for(let s in Cn){const r=Cn[s],i=Xr[t];e[t+s]=s===""||s==="Back"||s==="Elastic"?(n,o)=>i(r(n,o)):i(r)}return e})(),Ys={linear:rt,none:rt},Pn=e=>{if(Ys[e])return Ys[e];if(e.indexOf("(")<=-1){const t=Xr[e]||e.includes("Back")||e.includes("Elastic")?wt[e]():wt[e];return t?Ys[e]=t:rt}else{const t=e.slice(0,-1).split("("),s=wt[t[0]];return s?Ys[e]=s(...t[1].split(",")):rt}},En=["steps(","irregular(","linear(","cubicBezier("],xt=e=>{if(Be(e)){for(let t=0,s=En.length;t<s;t++)if(Me(e,En[t]))return console.warn(`String syntax for \`ease: "${e}"\` has been removed from the core and replaced by importing and passing the easing function directly: \`ease: ${e}\``),rt}return Ee(e)?e:Be(e)?Pn(e):rt},ne=qr(),de=qr(),ts={},Gs={func:null},Zs={func:null},Qs=[null],ss=[null,null],Js={to:null},rc=0,An=0,Rt,_t,ic=(e,t)=>{const s={};if($e(e)){const r=[].concat(...e.map(i=>Object.keys(i))).filter(Jt);for(let i=0,n=r.length;i<n;i++){const o=r[i];s[o]=e.map(a=>{const h={};for(let u in a){const f=a[u];Jt(u)?u===o&&(h.to=f):h[u]=f}return h})}}else{const r=U(t.duration,z.defaults.duration);Object.keys(e).map(i=>({o:parseFloat(i)/100,p:e[i]})).sort((i,n)=>i.o-n.o).forEach(i=>{const n=i.o,o=i.p;for(let a in o)if(Jt(a)){let h=s[a];h||(h=s[a]=[]);const u=n*r;let f=h.length,l=h[f-1];const d={to:o[a]};let c=0;for(let p=0;p<f;p++)c+=h[p].duration;f===1&&(d.from=l.to),o.ease&&(d.ease=o.ease),d.duration=u-(f?c:0),h.push(d)}return i});for(let i in s){const n=s[i];let o;for(let a=0,h=n.length;a<h;a++){const u=n[a],f=u.ease;u.ease=o||void 0,o=f}n[0].duration||n.shift()}}return s},Tt=class extends tt{constructor(e,t,s,r,i=!1,n=0,o){super(t,s,r),this._head,this._tail,++An;const a=Lt(e),h=a.length,u=t.keyframes,f=u?at(ic(u,t),t):t,{id:l,delay:d,duration:c,ease:p,playbackEase:g,modifier:v,composition:_,onRender:S}=f,y=s?s.defaults:z.defaults,m=U(p,y.ease),b=U(g,y.playbackEase),k=b?xt(b):null,w=!D(m.ease),E=w?m.ease:U(p,k?"linear":y.ease),O=w?m.settlingDuration:U(c,y.duration),P=U(d,y.delay),A=v||y.modifier,C=D(_)&&h>=1e3?He.none:D(_)?y.composition:_,H=this._offset+(s?s._offset:0);w&&(m.parent=this);let $=NaN,V=NaN,x=0,M=0;for(let I=0;I<h;I++){const L=a[I],q=n||I,K=o||a;let G=NaN,W=NaN;for(let ee in f)if(Jt(ee)){const Y=$r(L,ee),re=cn(L,ee),ge=Fr(ee,L,Y);let he=f[ee];const le=$e(he);if(i&&!le&&(ss[0]=he,ss[1]=he,he=ss),le){const ke=he.length,ye=!De(he[0]);ke===2&&ye?(Js.to=he,Qs[0]=Js,Rt=Qs):ke>2&&ye?(Rt=[],he.forEach((we,Te)=>{Te?Te===1?(ss[1]=we,Rt.push(ss)):Rt.push(we):ss[0]=we})):Rt=he}else Qs[0]=he,Rt=Qs;let J=null,ce=null,fe=NaN,ie=0,ae=0;for(let ke=Rt.length;ae<ke;ae++){const ye=Rt[ae];De(ye)?_t=ye:(Js.to=ye,_t=Js),Gs.func=null,Zs.func=null;const we=Ne(U(_t.composition,C),L,q,K,null,null),Te=qe(we)?we:He[we];!J&&Te!==He.none&&(J=Vr(L,ge));const xe=J?J._tail:null,me=s&&xe&&xe.parent.parent===s?xe:ce,te=Ne(_t.to,L,q,K,Gs,me);let T;De(te)&&!D(te.to)?(_t=te,T=te.to):T=te;const N=Ne(_t.from,L,q,K,Zs,me),B=_t.ease||E,R=Ne(B,L,q,K,null,me),X=Ee(R)||Be(R)?R:B,j=!D(X)&&!D(X.ease),se=j?X.ease:X,be=j?X.settlingDuration:Ne(U(_t.duration,ke>1?Ne(O,L,q,K,null,me)/ke:O),L,q,K,null,me),Ae=Ne(U(_t.delay,ae?0:P),L,q,K,null,me),Oe=_t.modifier||A,Yt=!D(N),Es=!D(T),Nt=$e(T),Kc=Nt||Yt&&Es,jc=ce?ie:0,pi=ce?ie+Ae:Ae,gi=F(H+pi,12),eu=F(H+jc,12);!M&&(Yt||Nt)&&(M=1);let ut=ce;if(Te!==He.none){let _e=J._head;for(;_e&&_e._absoluteStartTime<=gi;)if(_e._isOverridden||(ut=_e),_e=_e._nextRep,_e&&_e._absoluteStartTime>=gi)for(;_e;)Ws(_e),_e=_e._nextRep}if(Kc){Je(Nt?Ne(T[0],L,q,K,Zs,me):N,ne),Je(Nt?Ne(T[1],L,q,K,Gs,me):T,de);const _e=Ut(L,ge,Y,ts);ne.t===pe.NUMBER&&(ut?ut._valueType===pe.UNIT&&(ne.t=pe.UNIT,ne.u=ut._unit):(Je(_e,Fe),Fe.t===pe.UNIT&&(ne.t=pe.UNIT,ne.u=Fe.u)))}else Es?Je(T,de):ce?dn(ce,de):Je(s&&ut&&ut.parent.parent===s?ut._value:Ut(L,ge,Y,ts),de),Yt?Je(N,ne):ce?dn(ce,ne):Je(s&&ut&&ut.parent.parent===s?ut._value:Ut(L,ge,Y,ts),ne);if(ne.o&&(ne.n=Wt(ut?ut._toNumber:Je(Ut(L,ge,Y,ts),Fe).n,ne.n,ne.o)),de.o&&(de.n=Wt(ne.n,de.n,de.o)),ne.t!==de.t){if(ne.t===pe.COMPLEX||de.t===pe.COMPLEX){const _e=ne.t===pe.COMPLEX?ne:de,Ze=ne.t===pe.COMPLEX?de:ne;Ze.t=pe.COMPLEX,Ze.s=Ue(_e.s),Ze.d=_e.d.map(()=>Ze.n)}else if(ne.t===pe.UNIT||de.t===pe.UNIT){const _e=ne.t===pe.UNIT?ne:de,Ze=ne.t===pe.UNIT?de:ne;Ze.t=pe.UNIT,Ze.u=_e.u}else if(ne.t===pe.COLOR||de.t===pe.COLOR){const _e=ne.t===pe.COLOR?ne:de,Ze=ne.t===pe.COLOR?de:ne;Ze.t=pe.COLOR,Ze.d=_e.d.map(()=>0)}}if(ne.u!==de.u){let _e=de.u?ne:de;_e=Xs(L,_e,de.u?de.u:ne.u,!1)}if(de.d&&ne.d&&de.d.length!==ne.d.length){const _e=ne.d.length>de.d.length?ne:de,Ze=_e===ne?de:ne;Ze.d=_e.d.map((lu,Mo)=>D(Ze.d[Mo])?0:Ze.d[Mo]),Ze.s=Ue(_e.s)}const mi=F(+be||1e-11,12);let Io=ts[ge];qt(Io)||(ts[ge]=null);const tu=re?re.set:null;ie=F(pi+mi,12);const gr=ne.d,Oo=de.d,No=de.s,it={parent:this,id:rc++,property:ge,target:L,_value:null,_toFunc:Gs.func,_fromFunc:Zs.func,_ease:xt(se),_fromNumbers:gr?Ue(gr):Ds,_toNumbers:Oo?Ue(Oo):Ds,_strings:No?Ue(No):Ds,_fromNumber:ne.n,_toNumber:de.n,_numbers:gr?Ue(gr):Ds,_number:ne.n,_unit:de.u,_modifier:Oe,_currentTime:0,_startTime:pi,_delay:+Ae,_updateDuration:mi,_changeDuration:mi,_absoluteStartTime:gi,_absoluteUpdateStartTime:eu,_absoluteEndTime:F(H+ie,12),_hasFromValue:Yt||Nt?1:0,_tweenType:Y,_setter:tu,_valueType:de.t,_composition:Te,_isOverlapped:0,_isOverridden:0,_renderTransforms:0,_inlineValue:Io,_prevRep:null,_nextRep:null,_prevAdd:null,_nextAdd:null,_prev:null,_next:null};Te!==He.none&&bn(it,J);const vi=it._valueType;if(vi===pe.COMPLEX)it._value=fn(it,1,-1);else if(vi===pe.UNIT)it._value=`${Oe(it._toNumber)}${it._unit}`;else if(vi===pe.COLOR){const _e=de.d;it._value=`rgba(${F(_e[0],0)},${F(_e[1],0)},${F(_e[2],0)},${_e[3]})`}else it._value=Oe(it._toNumber);isNaN(fe)&&(fe=it._startTime),ce=it,x++,mt(this,it)}(isNaN(V)||fe<V)&&(V=fe),(isNaN($)||ie>$)&&($=ie),Y===Le.TRANSFORM&&(G=x-ae,W=x)}if(!isNaN(G)){let ee=0;Se(this,Y=>{ee>=G&&ee<W&&(Y._renderTransforms=1,Y._composition===He.blend&&Se(es.animation,re=>{re.id===Y.id&&(re._renderTransforms=1)})),ee++})}}h||console.warn("No target found. Make sure the element you're trying to animate is accessible before creating your animation."),V?(Se(this,I=>{I._startTime-I._delay||(I._delay-=V),I._startTime-=V}),$-=V):V=0,$||($=Re,this.iterationCount=0),this.targets=a,this.id=D(l)?An:l,this.duration=$===1e-11?Re:Fs(($+this._loopDelay)*this.iterationCount-this._loopDelay)||1e-11,this.onRender=S||y.onRender,this._ease=k,this._delay=V,this.iterationDuration=$,!this._autoplay&&M&&this.onRender(this)}stretch(e){const t=this.duration;if(t===jt(e))return this;const s=e/t;return Se(this,r=>{r._updateDuration=jt(r._updateDuration*s),r._changeDuration=jt(r._changeDuration*s),r._currentTime*=s,r._delay*=s,r._startTime*=s,r._absoluteStartTime*=s,r._absoluteUpdateStartTime*=s,r._absoluteEndTime*=s}),super.stretch(e)}refresh(){return Se(this,e=>{const t=e._toFunc,s=e._fromFunc;(t||s)&&(s?(Je(s(),ne),ne.u!==e._unit&&e.target[Ht]&&Xs(e.target,ne,e._unit,!0),e._fromNumbers=Ue(ne.d),e._fromNumber=ne.n):t&&(Je(Ut(e.target,e.property,e._tweenType),Fe),e._fromNumbers=Ue(Fe.d),e._fromNumber=Fe.n),t&&(Je(t(),de),e._toNumbers=Ue(de.d),e._strings=Ue(de.s),e._toNumber=de.o?Wt(e._fromNumber,de.n,de.o):de.n))}),this.duration===1e-11&&this.restart(),this}revert(){return super.revert(),zs(this)}then(e){return super.then(e)}},gs=(e,t)=>z.editor?z.editor.addAnimation(e,t):new Tt(e,t,null,0,!1).init(),nc=(e,t)=>{if(Me(t,"<")){const s=t[1]==="<",r=e._tail,i=r?r._offset+r._delay:0;return s?i:i+r.duration}},ms=(e,t)=>{let s=e.iterationDuration;if(s===1e-11&&(s=0),D(t))return s;if(qe(+t))return+t;const r=t,i=e?e.labels:null,n=!qt(i),o=nc(e,r),a=!D(o),h=tn.exec(r);if(h){const u=h[0],f=r.split(u),l=n&&f[0]?i[f[0]]:s,d=a?o:n?l:s,c=+f[1];return Wt(d,c,u[0])}else return a?o:n?D(i[r])?s:i[r]:s};function oc(e){return Fs((e.iterationDuration+e._loopDelay)*e.iterationCount-e._loopDelay)||1e-11}function Yr(e,t,s,r,i,n){const o=qe(e.duration)&&e.duration<=1e-11?s-Re:s;t.composition&&Xt(t,o,1,1,et.AUTO);const a=r?new Tt(r,e,t,o,!1,i,n):new tt(e,t,o);return t.composition&&a.init(!0),mt(t,a),Se(t,h=>{const u=h._offset+h._delay+h.duration;u>t.iterationDuration&&(t.iterationDuration=u)}),t.duration=oc(t),t}var Ln=0,Rn=class extends tt{constructor(e={}){super(e,null,0),++Ln,this.id=D(e.id)?Ln:e.id,this.duration=0,this.labels={};const t=e.defaults,s=z.defaults;this.defaults=t?at(t,s):s,this.composition=U(e.composition,!0),this.onRender=e.onRender||s.onRender;const r=U(e.playbackEase,s.playbackEase);this._ease=r?xt(r):null,this.iterationDuration=0}add(e,t,s){const r=De(t),i=De(e);if(r||i){if(this._hasChildren=!0,r){const n=t,o=z.editor&&z.editor.addTimelineChild,a=s&&s.type==="Stagger"&&z.editor,h=Ee(s)?s:null;if(h||a){const u=st(e),f=this.duration,l=this.iterationDuration,d=n.id;let c=0;const p=u.length,g=o?o(e,n,this.id,s,p):null,v=h||z.editor.resolveStagger(s.defaultValue);u.forEach(_=>{const S={...g||n};this.duration=f,this.iterationDuration=l,D(d)||(S.id=d+"-"+c);const y=ms(this,v(_,c,u,null,this));Yr(S,this,y,_,c,u),c++})}else{const u=o?o(e,n,this.id,s):n,f=s&&s.type?s.defaultValue:s;Yr(u,this,ms(this,f),e)}}else Yr(e,this,ms(this,t));return this.composition&&this.init(!0),this}}sync(e,t){if(D(e)||e&&D(e.pause))return this;e.pause();const s=+(e.effect?e.effect.getTiming().duration:e.duration);!D(e)&&!D(e.persist)&&(e.persist=!0);const r=z.editor,i=r&&r.addTimelineChild;r&&r.addTimelineSync&&(t=r.addTimelineSync(e,t,this.id),r.addTimelineChild=null);const n=this.add(e,{currentTime:[0,s],duration:s,delay:0,ease:"linear",playbackEase:"linear"},t);return r&&(r.addTimelineChild=i),n}set(e,t,s){return D(t)?this:(t.duration=Re,t.composition=He.replace,this.add(e,t,s))}call(e,t){return D(e)||e&&!Ee(e)?this:(z.editor&&z.editor.addTimelineCall&&(t=z.editor.addTimelineCall(e,t,this.id)),this.add({duration:0,delay:0,onComplete:()=>e(this)},t))}label(e,t){return D(e)||e&&!Be(e)?this:(z.editor&&z.editor.addTimelineLabel&&(t=z.editor.addTimelineLabel(e,t,this.id)),this.labels[e]=ms(this,t),this)}remove(e,t){return kt(st(e),this,t),this}stretch(e){const t=this.duration;if(t===jt(e))return this;const s=e/t,r=this.labels;Se(this,i=>i.stretch(i.duration*s));for(let i in r)r[i]*=s;return super.stretch(e)}refresh(){return Se(this,e=>{e.refresh&&e.refresh()}),this}revert(){return super.revert(),Se(this,e=>e.revert,!0),zs(this)}then(e){return super.then(e)}},In=e=>z.editor?z.editor.addTimeline(e):new Rn(e).init(),Gr=class{constructor(e,t){Ie.current&&Ie.current.register(this);const s=()=>{this.callbacks.completed&&this.callbacks.reset(),this.callbacks.play()},r=()=>{if(this.callbacks.completed)return;let a=!0;for(let h in this.animations)if(!this.animations[h].paused&&a){a=!1;break}a&&this.callbacks.complete()},i={onBegin:s,onComplete:r,onPause:r},n={v:1,autoplay:!1},o={};if(this.targets=[],this.animations={},this.callbacks=null,!(D(e)||D(t))){for(let a in t){const h=t[a];Jt(a)?o[a]=h:Me(a,"on")?n[a]=h:i[a]=h}this.callbacks=new Tt({v:0},n);for(let a in o){const h=o[a],u=De(h);let f={},l="+=0";if(u){const p=h.unit;Be(p)&&(l+=p)}else f.duration=h;f[a]=u?at({to:l},h):l;const d=at(i,f);d.composition=He.replace,d.autoplay=!1;const c=this.animations[a]=new Tt(e,d,null,0,!1).init();this.targets.length||this.targets.push(...c.targets),this[a]=(p,g,v)=>{const _=c._head;if(D(p)&&_){const S=_._numbers;return S&&S.length?S:_._modifier(_._number)}else return Se(c,S=>{if($e(p))for(let y=0,m=p.length;y<m;y++)D(S._numbers[y])||(S._fromNumbers[y]=S._modifier(S._numbers[y]),S._toNumbers[y]=p[y]);else S._fromNumber=S._modifier(S._number),S._toNumber=p;D(v)||(S._ease=xt(v)),S._currentTime=0}),D(g)||c.stretch(g),c.reset(!0).resume(),this}}}}revert(){for(let e in this.animations)this[e]=oe,this.animations[e].revert();return this.animations={},this.targets.length=0,this.callbacks&&this.callbacks.revert(),this}},ac=(e,t)=>new Gr(e,t),lc=Gt({clamp:()=>Z,damp:()=>gc,degToRad:()=>fc,lerp:()=>At,mapRange:()=>vs,padEnd:()=>hc,padStart:()=>uc,radToDeg:()=>pc,round:()=>F,roundPad:()=>cc,snap:()=>zt,wrap:()=>dc}),cc=(e,t)=>(+e).toFixed(t),uc=(e,t,s)=>`${e}`.padStart(t,s),hc=(e,t,s)=>`${e}`.padEnd(t,s),dc=(e,t,s)=>((e-t)%(s-t)+(s-t))%(s-t)+t,vs=(e,t,s,r,i)=>r+(e-t)/(s-t)*(i-r),fc=e=>e*Math.PI/180,pc=e=>e*180/Math.PI,gc=(e,t,s,r)=>r?r===1?t:At(e,t,1-Math.exp(-r*s*.1)):e,Ke=Ye*10,Ks=class{constructor(e={}){const t=!D(e.bounce)||!D(e.duration);this.timeStep=.02,this.restThreshold=5e-4,this.restDuration=200,this.maxDuration=6e4,this.maxRestSteps=this.restDuration/this.timeStep/Ye,this.maxIterations=this.maxDuration/this.timeStep/Ye,this.bn=Z(U(e.bounce,.5),-1,1),this.pd=Z(U(e.duration,628),10*z.timeScale,Ke*z.timeScale),this.m=Z(U(e.mass,1),1,Ke),this.s=Z(U(e.stiffness,100),Re,Ke),this.d=Z(U(e.damping,10),Re,Ke),this.v=Z(U(e.velocity,0),-Ke,Ke),this.w0=0,this.zeta=0,this.wd=0,this.b=0,this.completed=!1,this.solverDuration=0,this.settlingDuration=0,this.parent=null,this.onComplete=e.onComplete||oe,t&&this.calculateSDFromBD(),this.compute(),this.ease=s=>{const r=s*this.settlingDuration,i=this.completed,n=this.pd;return r>=n&&!i&&(this.completed=!0,this.onComplete(this.parent)),r<n&&i&&(this.completed=!1),s===0||s===1?s:this.solve(s*this.solverDuration)}}solve(e){const{zeta:t,w0:s,wd:r,b:i}=this;let n=e;return t<1?n=$s(-n*t*s)*(1*Mr(r*n)+i*Nr(r*n)):t===1?n=(1+i*n)*$s(-n*s):n=((1+i)*$s((-t*s+r)*n)+(1-i)*$s((-t*s-r)*n))/2,1-n}calculateSDFromBD(){const e=z.timeScale===1?this.pd/Ye:this.pd;this.m=1,this.v=0,this.s=Vt(2*bt/e,2),this.bn>=0?this.d=(1-this.bn)*4*bt/e:this.d=4*bt/(e*(1+this.bn)),this.s=F(Z(this.s,Re,Ke),3),this.d=F(Z(this.d,Re,300),3)}calculateBDFromSD(){const e=2*bt/nt(this.s);this.pd=e*(z.timeScale===1?Ye:1),this.d/(2*nt(this.s))<=1?this.bn=1-this.d*e/(4*bt):this.bn=4*bt/(this.d*e)-1,this.bn=F(Z(this.bn,-1,1),3),this.pd=F(Z(this.pd,10*z.timeScale,Ke*z.timeScale),3)}compute(){const{maxRestSteps:e,maxIterations:t,restThreshold:s,timeStep:r,m:i,d:n,s:o,v:a}=this,h=this.w0=Z(nt(o/i),Re,Ye),u=this.zeta=n/(2*nt(o*i));u<1?(this.wd=h*nt(1-u*u),this.b=(u*h+-a)/this.wd):u===1?(this.wd=0,this.b=-a+h):(this.wd=h*nt(u*u-1),this.b=(u*h+-a)/this.wd);let f=0,l=0,d=0;for(;l<=e&&d<=t;)ot(1-this.solve(f))<s?l++:l=0,this.solverDuration=f,f+=r,d++;this.settlingDuration=F(this.solverDuration*Ye,0)*z.timeScale}get bounce(){return this.bn}set bounce(e){this.bn=Z(U(e,1),-1,1),this.calculateSDFromBD(),this.compute()}get duration(){return this.pd}set duration(e){this.pd=Z(U(e,1),10*z.timeScale,Ke*z.timeScale),this.calculateSDFromBD(),this.compute()}get stiffness(){return this.s}set stiffness(e){this.s=Z(U(e,100),Re,Ke),this.calculateBDFromSD(),this.compute()}get damping(){return this.d}set damping(e){this.d=Z(U(e,10),Re,Ke),this.calculateBDFromSD(),this.compute()}get mass(){return this.m}set mass(e){this.m=Z(U(e,1),1,Ke),this.compute()}get velocity(){return this.v}set velocity(e){this.v=Z(U(e,0),-Ke,Ke),this.compute()}},js=e=>new Ks(e),On=e=>(console.warn("createSpring() is deprecated use spring() instead"),new Ks(e)),Zr={_head:null,_tail:null},Qr=(e,t,s)=>{let r=Zr._head,i;for(;r;){const n=r._next,o=r.$el===e,a=!t||r.property===t,h=!s||r.parent===s;if(o&&a&&h){i=r.animation;try{i.commitStyles()}catch{}i.cancel(),gt(Zr,r);const u=r.parent;u&&(u._completed++,u.animations.length===u._completed&&(u.completed=!0,u.paused=!0,u.muteCallbacks||(u.onComplete(u),u._resolve(u))))}r=n}return i},Nn=(e,t,s,r,i)=>{const n=t.animate(r,i),o=i.delay+ +i.duration*i.iterations;n.playbackRate=e._speed,e.paused&&n.pause(),e.duration<o&&(e.duration=o,e.controlAnimation=n),e.animations.push(n),Qr(t,s),mt(Zr,{parent:e,animation:n,$el:t,property:s,_next:null,_prev:null});const a=()=>Qr(t,s,e);return n.oncancel=a,n.onremove=a,e.persist||(n.onfinish=a),n};function It(e,t,s){const r=Lt(e);if(!r.length)return;const[i]=r,n=$r(i,t),o=Fr(t,i,n);let a=Ut(i,o);if(D(s))return a;if(Je(a,Fe),Fe.t===pe.NUMBER||Fe.t===pe.UNIT){if(s===!1)return Fe.n;{const h=Xs(i,Fe,s,!1);return`${F(h.n,z.precision)}${h.u}`}}}var Ct=(e,t)=>{if(!D(t))return z.editor&&z.editor.addSet?z.editor.addSet(e,t):(t.duration=Re,t.composition=U(t.composition,He.none),new Tt(e,t,null,0,!0).resume())},Mn=(e,t,s)=>{const r=st(e);for(let i=0,n=r.length;i<n;i++)Qr(r[i],s,t&&t.controlAnimation&&t);return kt(r,t,s),r},Ot=e=>{e.cancelable&&e.preventDefault()},mc=class{constructor(e){this.el=e,this.zIndex=0,this.parentElement=null,this.classList={add:oe,remove:oe}}get x(){return this.el.x||0}set x(e){this.el.x=e}get y(){return this.el.y||0}set y(e){this.el.y=e}get width(){return this.el.width||0}set width(e){this.el.width=e}get height(){return this.el.height||0}set height(e){this.el.height=e}getBoundingClientRect(){return{top:this.y,right:this.x,bottom:this.y+this.height,left:this.x+this.width}}},vc=class{constructor(e){this.$el=e,this.inlineTransforms=[],this.point=new DOMPoint,this.inversedMatrix=this.getMatrix().inverse()}normalizePoint(e,t){return this.point.x=e,this.point.y=t,this.point.matrixTransform(this.inversedMatrix)}traverseUp(e){let t=this.$el.parentElement,s=0;for(;t&&t!==Q;)e(t,s),t=t.parentElement,s++}getMatrix(){const e=new DOMMatrix;return this.traverseUp(t=>{const s=getComputedStyle(t).transform;if(s){const r=new DOMMatrix(s);e.preMultiplySelf(r)}}),e}remove(){this.traverseUp((e,t)=>{this.inlineTransforms[t]=e.style.transform,e.style.transform="none"})}revert(){this.traverseUp((e,t)=>{const s=this.inlineTransforms[t];s===""?e.style.removeProperty("transform"):e.style.transform=s})}},Ge=(e,t)=>e&&Ee(e)?e(t):e,er=0,Dn=class{constructor(e,t={}){if(!e)return;Ie.current&&Ie.current.register(this);const s=t.x,r=t.y,i=t.trigger,n=t.modifier,o=t.releaseEase,a=o&&xt(o),h=!D(o)&&!D(o.ease),u=De(s)&&!D(s.mapTo)?s.mapTo:"translateX",f=De(r)&&!D(r.mapTo)?r.mapTo:"translateY",l=Ge(t.container,this);this.containerArray=$e(l)?l:null,this.$container=l&&!this.containerArray?st(l)[0]:Q.body,this.useWin=this.$container===Q.body,this.$scrollContainer=this.useWin?Xe:this.$container,this.$target=De(e)?new mc(e):st(e)[0],this.$trigger=st(i||e)[0],this.fixed=It(this.$target,"position")==="fixed",this.isFinePointer=!0,this.containerPadding=[0,0,0,0],this.containerFriction=0,this.releaseContainerFriction=0,this.snapX=0,this.snapY=0,this.scrollSpeed=0,this.scrollThreshold=0,this.dragSpeed=0,this.dragThreshold=3,this.maxVelocity=0,this.minVelocity=0,this.velocityMultiplier=0,this.cursor=!1,this.releaseXSpring=h?o:js({mass:U(t.releaseMass,1),stiffness:U(t.releaseStiffness,80),damping:U(t.releaseDamping,20)}),this.releaseYSpring=h?o:js({mass:U(t.releaseMass,1),stiffness:U(t.releaseStiffness,80),damping:U(t.releaseDamping,20)}),this.releaseEase=a||wt.outQuint,this.hasReleaseSpring=h,this.onGrab=t.onGrab||oe,this.onDrag=t.onDrag||oe,this.onRelease=t.onRelease||oe,this.onUpdate=t.onUpdate||oe,this.onSettle=t.onSettle||oe,this.onSnap=t.onSnap||oe,this.onResize=t.onResize||oe,this.onAfterResize=t.onAfterResize||oe,this.disabled=[0,0];const d={};if(n&&(d.modifier=n),D(s)||s===!0)d[u]=0;else if(De(s)){const c=s,p={};c.modifier&&(p.modifier=c.modifier),c.composition&&(p.composition=c.composition),d[u]=p}else s===!1&&(d[u]=0,this.disabled[0]=1);if(D(r)||r===!0)d[f]=0;else if(De(r)){const c=r,p={};c.modifier&&(p.modifier=c.modifier),c.composition&&(p.composition=c.composition),d[f]=p}else r===!1&&(d[f]=0,this.disabled[1]=1);this.animate=new Gr(this.$target,d),this.xProp=u,this.yProp=f,this.destX=0,this.destY=0,this.deltaX=0,this.deltaY=0,this.scroll={x:0,y:0},this.coords=[this.x,this.y,0,0],this.snapped=[0,0],this.pointer=[0,0,0,0,0,0,0,0],this.scrollView=[0,0],this.dragArea=[0,0,0,0],this.containerBounds=[-pt,pt,pt,-pt],this.scrollBounds=[0,0,0,0],this.targetBounds=[0,0,0,0],this.window=[0,0],this.velocityStack=[0,0,0],this.velocityStackIndex=0,this.velocityTime=Et(),this.velocity=0,this.angle=0,this.cursorStyles=null,this.triggerStyles=null,this.bodyStyles=null,this.targetStyles=null,this.touchActionStyles=null,this.transforms=new vc(this.$target),this.overshootCoords={x:0,y:0},this.overshootTicker=new tt({autoplay:!1,onUpdate:()=>{this.updated=!0,this.manual=!0,this.disabled[0]||this.animate[this.xProp](this.overshootCoords.x,1),this.disabled[1]||this.animate[this.yProp](this.overshootCoords.y,1)},onComplete:()=>{this.manual=!1,this.disabled[0]||this.animate[this.xProp](this.overshootCoords.x,0),this.disabled[1]||this.animate[this.yProp](this.overshootCoords.y,0)}},null,0).init(),this.updateTicker=new tt({autoplay:!1,onUpdate:()=>this.update()},null,0).init(),this.contained=!D(l),this.manual=!1,this.grabbed=!1,this.dragged=!1,this.updated=!1,this.released=!1,this.canScroll=!1,this.enabled=!1,this.initialized=!1,this.activeProp=this.disabled[1]?u:f,this.animate.callbacks.onRender=()=>{const c=this.updated,p=!(this.grabbed&&c)&&this.released,g=this.x,v=this.y,_=g-this.coords[2],S=v-this.coords[3];this.deltaX=_,this.deltaY=S,this.coords[2]=g,this.coords[3]=v,c&&(_||S)&&this.onUpdate(this),p?(this.computeVelocity(_,S),this.angle=qs(S,_)):this.updated=!1},this.animate.callbacks.onComplete=()=>{!this.grabbed&&this.released&&(this.released=!1),this.manual||(this.deltaX=0,this.deltaY=0,this.velocity=0,this.velocityStack[0]=0,this.velocityStack[1]=0,this.velocityStack[2]=0,this.velocityStackIndex=0,this.onSettle(this))},this.resizeTicker=new tt({autoplay:!1,duration:150*z.timeScale,onComplete:()=>{this.onResize(this),this.refresh(),this.onAfterResize(this)}}).init(),this.parameters=t,this.resizeObserver=new ResizeObserver(()=>{this.initialized?this.resizeTicker.restart():this.initialized=!0}),this.enable(),this.refresh(),this.resizeObserver.observe(this.$container),De(e)||this.resizeObserver.observe(this.$target)}computeVelocity(e,t){const s=this.velocityTime,r=Et(),i=r-s;if(i<17)return this.velocity;this.velocityTime=r;const n=this.velocityStack,o=this.velocityMultiplier,a=this.minVelocity,h=this.maxVelocity,u=this.velocityStackIndex;n[u]=F(Z(nt(e*e+t*t)/i*o,a,h),5);const f=an(n[0],n[1],n[2]);return this.velocity=f,this.velocityStackIndex=(u+1)%3,f}setX(e,t=!1){if(this.disabled[0])return;const s=F(e,5);return this.overshootTicker.pause(),this.manual=!0,this.updated=!t,this.destX=s,this.snapped[0]=zt(s,this.snapX),this.animate[this.xProp](s,0),this.manual=!1,this}setY(e,t=!1){if(this.disabled[1])return;const s=F(e,5);return this.overshootTicker.pause(),this.manual=!0,this.updated=!t,this.destY=s,this.snapped[1]=zt(s,this.snapY),this.animate[this.yProp](s,0),this.manual=!1,this}get x(){return F(this.animate[this.xProp](),z.precision)}set x(e){this.setX(e,!1)}get y(){return F(this.animate[this.yProp](),z.precision)}set y(e){this.setY(e,!1)}get progressX(){return vs(this.x,this.containerBounds[3],this.containerBounds[1],0,1)}set progressX(e){this.setX(vs(e,0,1,this.containerBounds[3],this.containerBounds[1]),!1)}get progressY(){return vs(this.y,this.containerBounds[0],this.containerBounds[2],0,1)}set progressY(e){this.setY(vs(e,0,1,this.containerBounds[0],this.containerBounds[2]),!1)}updateScrollCoords(){const e=F(this.useWin?Xe.scrollX:this.$container.scrollLeft,0),t=F(this.useWin?Xe.scrollY:this.$container.scrollTop,0),[s,r,i,n]=this.containerPadding,o=this.scrollThreshold;this.scroll.x=e,this.scroll.y=t,this.scrollBounds[0]=t-this.targetBounds[0]+s-o,this.scrollBounds[1]=e-this.targetBounds[1]-r+o,this.scrollBounds[2]=t-this.targetBounds[2]-i+o,this.scrollBounds[3]=e-this.targetBounds[3]+n-o}updateBoundingValues(){const e=this.$container;if(!e)return;const t=this.x,s=this.y,r=this.coords[2],i=this.coords[3];this.coords[2]=0,this.coords[3]=0,this.setX(0,!0),this.setY(0,!0),this.transforms.remove();const n=this.window[0]=Xe.innerWidth,o=this.window[1]=Xe.innerHeight,a=this.useWin,h=e.scrollWidth,u=e.scrollHeight,f=this.fixed,l=e.getBoundingClientRect(),[d,c,p,g]=this.containerPadding;this.dragArea[0]=a?0:l.left,this.dragArea[1]=a?0:l.top,this.scrollView[0]=a?Z(h,n,h):h,this.scrollView[1]=a?Z(u,o,u):u,this.updateScrollCoords();const{width:v,height:_,left:S,top:y,right:m,bottom:b}=e.getBoundingClientRect();this.dragArea[2]=F(a?Z(v,n,n):v,0),this.dragArea[3]=F(a?Z(_,o,o):_,0);const k=It(e,"overflow"),w=k==="visible",E=k==="hidden";if(this.canScroll=f?!1:this.contained&&(e===Q.body&&w||!E&&!w)&&(h>this.dragArea[2]+g-c||u>this.dragArea[3]+d-p)&&(!this.containerArray||this.containerArray&&!$e(this.containerArray)),this.contained){const O=this.scroll.x,P=this.scroll.y,A=this.canScroll,C=this.$target.getBoundingClientRect(),H=A?a?0:e.scrollLeft:0,$=A?a?0:e.scrollTop:0,V=A?this.scrollView[0]-H-v:0,x=A?this.scrollView[1]-$-_:0;this.targetBounds[0]=F(C.top+P-(a?0:y),0),this.targetBounds[1]=F(C.right+O-(a?n:m),0),this.targetBounds[2]=F(C.bottom+P-(a?o:b),0),this.targetBounds[3]=F(C.left+O-(a?0:S),0),this.containerArray?(this.containerBounds[0]=this.containerArray[0]+d,this.containerBounds[1]=this.containerArray[1]-c,this.containerBounds[2]=this.containerArray[2]-p,this.containerBounds[3]=this.containerArray[3]+g):(this.containerBounds[0]=-F(C.top-(f?Z(y,0,o):y)+$-d,0),this.containerBounds[1]=-F(C.right-(f?Z(m,0,n):m)-V+c,0),this.containerBounds[2]=-F(C.bottom-(f?Z(b,0,o):b)-x+p,0),this.containerBounds[3]=-F(C.left-(f?Z(S,0,n):S)+H-g,0))}this.transforms.revert(),this.coords[2]=r,this.coords[3]=i,this.setX(t,!0),this.setY(s,!0)}isOutOfBounds(e,t,s){if(!this.contained)return 0;const[r,i,n,o]=e,[a,h]=this.disabled,u=!a&&t<o||!a&&t>i,f=!h&&s<r||!h&&s>n;return u&&!f?1:!u&&f?2:u&&f?3:0}refresh(){const e=this.parameters,t=e.x,s=e.y,r=Ge(e.container,this),i=Ge(e.containerPadding,this)||0,n=$e(i)?i:[i,i,i,i],o=this.x,a=this.y,h=Ge(e.cursor,this),u={onHover:"grab",onGrab:"grabbing"};if(h){const{onHover:v,onGrab:_}=h;v&&(u.onHover=v),_&&(u.onGrab=_)}const f=Ge(e.dragThreshold,this),l={mouse:3,touch:7};if(qe(f))l.mouse=f,l.touch=f;else if(f){const{mouse:v,touch:_}=f;D(v)||(l.mouse=v),D(_)||(l.touch=_)}this.containerArray=$e(r)?r:null,this.$container=r&&!this.containerArray?st(r)[0]:Q.body,this.useWin=this.$container===Q.body,this.$scrollContainer=this.useWin?Xe:this.$container,this.isFinePointer=matchMedia("(pointer:fine)").matches,this.containerPadding=U(n,[0,0,0,0]),this.containerFriction=Z(U(Ge(e.containerFriction,this),.8),0,1),this.releaseContainerFriction=Z(U(Ge(e.releaseContainerFriction,this),this.containerFriction),0,1),this.snapX=Ge(De(t)&&!D(t.snap)?t.snap:e.snap,this),this.snapY=Ge(De(s)&&!D(s.snap)?s.snap:e.snap,this),this.scrollSpeed=U(Ge(e.scrollSpeed,this),1.5),this.scrollThreshold=U(Ge(e.scrollThreshold,this),20),this.dragSpeed=U(Ge(e.dragSpeed,this),1),this.dragThreshold=this.isFinePointer?l.mouse:l.touch,this.minVelocity=U(Ge(e.minVelocity,this),0),this.maxVelocity=U(Ge(e.maxVelocity,this),50),this.velocityMultiplier=U(Ge(e.velocityMultiplier,this),1),this.cursor=h===!1?!1:u,this.updateBoundingValues();const[d,c,p,g]=this.containerBounds;this.setX(Z(o,g,c),!0),this.setY(Z(a,d,p),!0)}update(){if(this.updateScrollCoords(),this.canScroll){const[_,S,y,m]=this.containerPadding,[b,k]=this.scrollView,w=this.dragArea[2],E=this.dragArea[3],O=this.scroll.x,P=this.scroll.y,A=this.$container.scrollWidth,C=this.$container.scrollHeight,H=this.useWin?Z(A,this.window[0],A):A,$=this.useWin?Z(C,this.window[1],C):C,V=b-H,x=k-$;this.dragged&&V>0&&(this.coords[0]-=V,this.scrollView[0]=H),this.dragged&&x>0&&(this.coords[1]-=x,this.scrollView[1]=$);const M=this.scrollSpeed*10,I=this.scrollThreshold,[L,q]=this.coords,[K,G,W,ee]=this.scrollBounds,Y=F(Z((q-K+_)/I,-1,0)*M,0),re=F(Z((L-G-S)/I,0,1)*M,0),ge=F(Z((q-W-y)/I,0,1)*M,0),he=F(Z((L-ee+m)/I,-1,0)*M,0);if(Y||ge||he||re){const[le,J]=this.disabled;let ce=O,fe=P;le||(ce=F(Z(O+(he||re),0,b-w),0),this.coords[0]-=O-ce),J||(fe=F(Z(P+(Y||ge),0,k-E),0),this.coords[1]-=P-fe),this.useWin?this.$scrollContainer.scrollBy(-(O-ce),-(P-fe)):this.$scrollContainer.scrollTo(ce,fe)}}const[e,t,s,r]=this.containerBounds,[i,n,o,a,h,u]=this.pointer;this.coords[0]+=(i-h)*this.dragSpeed,this.coords[1]+=(n-u)*this.dragSpeed,this.pointer[4]=i,this.pointer[5]=n;const[f,l]=this.coords,[d,c]=this.snapped,p=(1-this.containerFriction)*this.dragSpeed;this.setX(f>t?t+(f-t)*p:f<r?r+(f-r)*p:f,!1),this.setY(l>s?s+(l-s)*p:l<e?e+(l-e)*p:l,!1),this.computeVelocity(i-h,n-u),this.angle=qs(n-a,i-o);const[g,v]=this.snapped;(g!==d&&this.snapX||v!==c&&this.snapY)&&this.onSnap(this)}stop(){this.updateTicker.pause(),this.overshootTicker.pause();for(let e in this.animate.animations)this.animate.animations[e].pause();return kt([this],null,"x"),kt([this],null,"y"),kt([this],null,"progressX"),kt([this],null,"progressY"),kt([this.scroll]),kt([this.overshootCoords]),this}scrollInView(e,t=0,s=wt.inOutQuad){this.updateScrollCoords();const r=this.destX,i=this.destY,n=this.scroll,o=this.scrollBounds,a=this.canScroll;if(!this.containerArray&&this.isOutOfBounds(o,r,i)){const[h,u,f,l]=o,d=F(Z(i-h,-pt,0),0),c=F(Z(r-u,0,pt),0),p=F(Z(i-f,0,pt),0),g=F(Z(r-l,-pt,0),0);new Tt(n,{x:F(n.x+(g?g-t:c?c+t:0),0),y:F(n.y+(d?d-t:p?p+t:0),0),duration:D(e)?350*z.timeScale:e,ease:s,onUpdate:()=>{this.canScroll=!1,this.$scrollContainer.scrollTo(n.x,n.y)}}).init().then(()=>{this.canScroll=a})}return this}handleHover(){this.isFinePointer&&this.cursor&&!this.cursorStyles&&(this.cursorStyles=Ct(this.$trigger,{cursor:this.cursor.onHover}))}animateInView(e,t=0,s=wt.inOutQuad){this.stop(),this.updateBoundingValues();const r=this.x,i=this.y,[n,o,a,h]=this.containerPadding,u=this.scroll.y-this.targetBounds[0]+n+t,f=this.scroll.x-this.targetBounds[1]-o-t,l=this.scroll.y-this.targetBounds[2]-a-t,d=this.scroll.x-this.targetBounds[3]+h+t,c=this.isOutOfBounds([u,f,l,d],r,i);if(c){const[p,g]=this.disabled,v=Z(zt(r,this.snapX),d,f),_=Z(zt(i,this.snapY),u,l),S=D(e)?350*z.timeScale:e;!p&&(c===1||c===3)&&this.animate[this.xProp](v,S,s),!g&&(c===2||c===3)&&this.animate[this.yProp](_,S,s)}return this}handleDown(e){const t=e.target;if(this.grabbed||t.type==="range")return;e.stopPropagation(),this.grabbed=!0,this.released=!1,this.stop(),this.updateBoundingValues();const s=e.changedTouches,r=s?s[0].clientX:e.clientX,i=s?s[0].clientY:e.clientY,{x:n,y:o}=this.transforms.normalizePoint(r,i),[a,h,u,f]=this.containerBounds,l=(1-this.containerFriction)*this.dragSpeed,d=this.x,c=this.y;this.coords[0]=this.coords[2]=l?d>h?h+(d-h)/l:d<f?f+(d-f)/l:d:d,this.coords[1]=this.coords[3]=l?c>u?u+(c-u)/l:c<a?a+(c-a)/l:c:c,this.pointer[0]=n,this.pointer[1]=o,this.pointer[2]=n,this.pointer[3]=o,this.pointer[4]=n,this.pointer[5]=o,this.pointer[6]=n,this.pointer[7]=o,this.deltaX=0,this.deltaY=0,this.velocity=0,this.velocityStack[0]=0,this.velocityStack[1]=0,this.velocityStack[2]=0,this.velocityStackIndex=0,this.angle=0,this.targetStyles&&(this.targetStyles.revert(),this.targetStyles=null);const p=It(this.$target,"zIndex",!1);er=(p>er?p:er)+1,this.targetStyles=Ct(this.$target,{zIndex:er}),this.triggerStyles&&(this.triggerStyles.revert(),this.triggerStyles=null),this.cursorStyles&&(this.cursorStyles.revert(),this.cursorStyles=null),this.isFinePointer&&this.cursor&&(this.bodyStyles=Ct(Q.body,{cursor:this.cursor.onGrab})),this.scrollInView(100,0,wt.out(3)),this.onGrab(this),Q.addEventListener("touchmove",this),Q.addEventListener("touchend",this),Q.addEventListener("touchcancel",this),Q.addEventListener("mousemove",this),Q.addEventListener("mouseup",this),Q.addEventListener("selectstart",this)}handleMove(e){if(!this.grabbed)return;const t=e.changedTouches,s=t?t[0].clientX:e.clientX,r=t?t[0].clientY:e.clientY,{x:i,y:n}=this.transforms.normalizePoint(s,r),o=i-this.pointer[6],a=n-this.pointer[7];let h=e.target,u=!1,f=!1,l=!1;for(;t&&h&&h!==this.$trigger;){const d=It(h,"overflow-y");if(d!=="hidden"&&d!=="visible"){const{scrollTop:c,scrollHeight:p,clientHeight:g}=h;if(p>g){l=!0,u=c<=3,f=c>=p-g-3;break}}h=h.parentElement}l&&(!u&&!f||u&&a<0||f&&a>0)?(this.pointer[0]=i,this.pointer[1]=n,this.pointer[2]=i,this.pointer[3]=n,this.pointer[4]=i,this.pointer[5]=n,this.pointer[6]=i,this.pointer[7]=n):(Ot(e),this.triggerStyles||(this.triggerStyles=Ct(this.$trigger,{pointerEvents:"none"})),this.$trigger.addEventListener("touchstart",Ot,{passive:!1}),this.$trigger.addEventListener("touchmove",Ot,{passive:!1}),this.$trigger.addEventListener("touchend",Ot),(this.dragged||!this.disabled[0]&&ot(o)>this.dragThreshold||!this.disabled[1]&&ot(a)>this.dragThreshold)&&(this.updateTicker.resume(),this.pointer[2]=this.pointer[0],this.pointer[3]=this.pointer[1],this.pointer[0]=i,this.pointer[1]=n,this.dragged=!0,this.released=!1,this.onDrag(this)))}handleUp(){if(!this.grabbed)return;this.updateTicker.pause(),this.triggerStyles&&(this.triggerStyles.revert(),this.triggerStyles=null),this.bodyStyles&&(this.bodyStyles.revert(),this.bodyStyles=null);const[e,t]=this.disabled,[s,r,i,n,o,a]=this.pointer,[h,u,f,l]=this.containerBounds,[d,c]=this.snapped,p=this.releaseXSpring,g=this.releaseYSpring,v=this.releaseEase,_=this.hasReleaseSpring,S=this.overshootCoords,y=this.x,m=this.y,b=this.computeVelocity(s-o,r-a),k=this.angle=qs(r-n,s-i),w=b*150,E=(1-this.releaseContainerFriction)*this.dragSpeed,O=y+Mr(k)*w,P=m+Nr(k)*w,A=O>u?u+(O-u)*E:O<l?l+(O-l)*E:O,C=P>f?f+(P-f)*E:P<h?h+(P-h)*E:P,H=this.destX=Z(F(zt(A,this.snapX),5),l,u),$=this.destY=Z(F(zt(C,this.snapY),5),h,f),V=this.isOutOfBounds(this.containerBounds,O,P);let x=0,M=0,I=v,L=v,q=0;if(S.x=y,S.y=m,!e){const G=H===u?y>u?-1:1:y<l?-1:1,W=F(y-H,0);p.velocity=t&&_?W?w*G/ot(W):0:b;const{ease:ee,settlingDuration:Y,restDuration:re}=p;x=y===H?0:_?Y:Y-re*z.timeScale,_&&(I=ee),x>q&&(q=x)}if(!t){const G=$===f?m>f?-1:1:m<h?-1:1,W=F(m-$,0);g.velocity=e&&_?W?w*G/ot(W):0:b;const{ease:ee,settlingDuration:Y,restDuration:re}=g;M=m===$?0:_?Y:Y-re*z.timeScale,_&&(L=ee),M>q&&(q=M)}if(!_&&V&&E&&(x||M)){const G=He.blend;new Tt(S,{x:{to:A,duration:x*.65},y:{to:C,duration:M*.65},ease:v,composition:G}).init(),new Tt(S,{x:{to:H,duration:x},y:{to:$,duration:M},ease:v,composition:G}).init(),this.overshootTicker.stretch(an(x,M)).restart()}else e||this.animate[this.xProp](H,x,I),t||this.animate[this.yProp]($,M,L);this.scrollInView(q,this.scrollThreshold,v);let K=!1;H!==d&&(this.snapped[0]=H,this.snapX&&(K=!0)),$!==c&&this.snapY&&(this.snapped[1]=$,this.snapY&&(K=!0)),K&&this.onSnap(this),this.grabbed=!1,this.dragged=!1,this.updated=!0,this.released=!0,this.onRelease(this),this.$trigger.removeEventListener("touchstart",Ot),this.$trigger.removeEventListener("touchmove",Ot),this.$trigger.removeEventListener("touchend",Ot),Q.removeEventListener("touchmove",this),Q.removeEventListener("touchend",this),Q.removeEventListener("touchcancel",this),Q.removeEventListener("mousemove",this),Q.removeEventListener("mouseup",this),Q.removeEventListener("selectstart",this)}reset(){return this.stop(),this.resizeTicker.pause(),this.grabbed=!1,this.dragged=!1,this.updated=!1,this.released=!1,this.canScroll=!1,this.setX(0,!0),this.setY(0,!0),this.coords[0]=0,this.coords[1]=0,this.pointer[0]=0,this.pointer[1]=0,this.pointer[2]=0,this.pointer[3]=0,this.pointer[4]=0,this.pointer[5]=0,this.pointer[6]=0,this.pointer[7]=0,this.velocity=0,this.velocityStack[0]=0,this.velocityStack[1]=0,this.velocityStack[2]=0,this.velocityStackIndex=0,this.angle=0,this}enable(){return this.enabled||(this.enabled=!0,this.$target.classList.remove("is-disabled"),this.touchActionStyles=Ct(this.$trigger,{touchAction:this.disabled[0]?"pan-x":this.disabled[1]?"pan-y":"none"}),this.$trigger.addEventListener("touchstart",this,{passive:!0}),this.$trigger.addEventListener("mousedown",this,{passive:!0}),this.$trigger.addEventListener("mouseenter",this)),this}disable(){return this.enabled=!1,this.grabbed=!1,this.dragged=!1,this.updated=!1,this.released=!1,this.canScroll=!1,this.touchActionStyles.revert(),this.cursorStyles&&(this.cursorStyles.revert(),this.cursorStyles=null),this.triggerStyles&&(this.triggerStyles.revert(),this.triggerStyles=null),this.bodyStyles&&(this.bodyStyles.revert(),this.bodyStyles=null),this.targetStyles&&(this.targetStyles.revert(),this.targetStyles=null),this.$target.classList.add("is-disabled"),this.$trigger.removeEventListener("touchstart",this),this.$trigger.removeEventListener("mousedown",this),this.$trigger.removeEventListener("mouseenter",this),Q.removeEventListener("touchmove",this),Q.removeEventListener("touchend",this),Q.removeEventListener("touchcancel",this),Q.removeEventListener("mousemove",this),Q.removeEventListener("mouseup",this),Q.removeEventListener("selectstart",this),this}revert(){return this.reset(),this.disable(),this.$target.classList.remove("is-disabled"),this.updateTicker.revert(),this.overshootTicker.revert(),this.resizeTicker.revert(),this.animate.revert(),this.resizeObserver.disconnect(),this}handleEvent(e){switch(e.type){case"mousedown":this.handleDown(e);break;case"touchstart":this.handleDown(e);break;case"mousemove":this.handleMove(e);break;case"touchmove":this.handleMove(e);break;case"mouseup":this.handleUp();break;case"touchend":this.handleUp();break;case"touchcancel":this.handleUp();break;case"mouseenter":this.handleHover();break;case"selectstart":Ot(e)}}},yc=(e,t)=>new Dn(e,t),Jr=(e=oe)=>new tt({duration:1*z.timeScale,onComplete:e},null,0).resume(),tr=e=>{let t;return((...s)=>{let r,i,n,o,a;t&&(r=t.currentIteration,i=t.iterationProgress,n=t.reversed,o=t._alternate,a=t._startTime,t.revert());const h=e(...s);return h&&!Ee(h)&&h.revert&&(t=h),D(i)||(t.currentIteration=r,t.iterationProgress=(o&&r%2?!n:n)?1-i:i,t._startTime=a),h||oe})},Bn=class{constructor(e={}){Ie.current&&Ie.current.register(this);const t=e.root;let s=Q;t&&(s=t.current||t.nativeElement||st(t)[0]||Q);const r=e.defaults,i=z.defaults,n=e.mediaQueries;if(this.defaults=r?at(r,i):i,this.root=s,this.constructors=[],this.revertConstructors=[],this.revertibles=[],this.constructorsOnce=[],this.revertConstructorsOnce=[],this.revertiblesOnce=[],this.once=!1,this.onceIndex=0,this.methods={},this.matches={},this.mediaQueryLists={},this.data={},n)for(let o in n){const a=Xe.matchMedia(n[o]);this.mediaQueryLists[o]=a,a.addEventListener("change",this)}}register(e){(this.once?this.revertiblesOnce:this.revertibles).push(e)}execute(e){let t=Ie.current,s=Ie.root,r=z.defaults;Ie.current=this,Ie.root=this.root,z.defaults=this.defaults;const i=this.mediaQueryLists;for(let o in i)this.matches[o]=i[o].matches;const n=e(this);return Ie.current=t,Ie.root=s,z.defaults=r,n}refresh(){return this.onceIndex=0,this.execute(()=>{let e=this.revertibles.length,t=this.revertConstructors.length;for(;e--;)this.revertibles[e].revert();for(;t--;)this.revertConstructors[t](this);this.revertibles.length=0,this.revertConstructors.length=0,this.constructors.forEach(s=>{const r=s(this);Ee(r)&&this.revertConstructors.push(r)})}),this}add(e,t){if(this.once=!1,Ee(e)){const s=e;this.constructors.push(s),this.execute(()=>{const r=s(this);Ee(r)&&this.revertConstructors.push(r)})}else this.methods[e]=(...s)=>this.execute(()=>t(...s));return this}addOnce(e){if(this.once=!0,Ee(e)){const t=this.onceIndex++;if(this.constructorsOnce[t])return this;const s=e;this.constructorsOnce[t]=s,this.execute(()=>{const r=s(this);Ee(r)&&this.revertConstructorsOnce.push(r)})}return this}keepTime(e){this.once=!0;const t=this.onceIndex++,s=this.constructorsOnce[t];if(Ee(s))return s(this);const r=tr(e);this.constructorsOnce[t]=r;let i;return this.execute(()=>{i=r(this)}),i}handleEvent(e){e.type==="change"&&this.refresh()}revert(){const e=this.revertibles,t=this.revertConstructors,s=this.revertiblesOnce,r=this.revertConstructorsOnce,i=this.mediaQueryLists;let n=e.length,o=t.length,a=s.length,h=r.length;for(;n--;)e[n].revert();for(;o--;)t[o](this);for(;a--;)s[a].revert();for(;h--;)r[h](this);for(let u in i)i[u].removeEventListener("change",this);e.length=0,t.length=0,this.constructors.length=0,s.length=0,r.length=0,this.constructorsOnce.length=0,this.onceIndex=0,this.matches={},this.methods={},this.mediaQueryLists={},this.data={}}},bc=e=>new Bn(e),_c=()=>{const e=Q.createElement("div");Q.body.appendChild(e),e.style.height="100lvh";const t=e.offsetHeight;return Q.body.removeChild(e),t},sr=(e,t)=>e&&Ee(e)?e(t):e,rr=new Map,Sc=class{constructor(e){this.element=e,this.useWin=this.element===Q.body,this.winWidth=0,this.winHeight=0,this.width=0,this.height=0,this.left=0,this.top=0,this.scale=1,this.zIndex=0,this.scrollX=0,this.scrollY=0,this.prevScrollX=0,this.prevScrollY=0,this.scrollWidth=0,this.scrollHeight=0,this.velocity=0,this.backwardX=!1,this.backwardY=!1,this.scrollTicker=new tt({autoplay:!1,onBegin:()=>this.dataTimer.resume(),onUpdate:()=>{const t=this.backwardX||this.backwardY;Se(this,s=>s.handleScroll(),t)},onComplete:()=>this.dataTimer.pause()}).init(),this.dataTimer=new tt({autoplay:!1,frameRate:30,onUpdate:t=>{const s=t.deltaTime,r=this.prevScrollX,i=this.prevScrollY,n=this.scrollX,o=this.scrollY,a=r-n,h=i-o;this.prevScrollX=n,this.prevScrollY=o,a&&(this.backwardX=r>n),h&&(this.backwardY=i>o),this.velocity=F(s>0?Math.sqrt(a*a+h*h)/s:0,5)}}).init(),this.resizeTicker=new tt({autoplay:!1,duration:250*z.timeScale,onComplete:()=>{this.updateWindowBounds(),this.refreshScrollObservers(),this.handleScroll()}}).init(),this.wakeTicker=new tt({autoplay:!1,duration:500*z.timeScale,onBegin:()=>{this.scrollTicker.resume()},onComplete:()=>{this.scrollTicker.pause()}}).init(),this._head=null,this._tail=null,this.updateScrollCoords(),this.updateWindowBounds(),this.updateBounds(),this.refreshScrollObservers(),this.handleScroll(),this.resizeObserver=new ResizeObserver(()=>this.resizeTicker.restart()),this.resizeObserver.observe(this.element),(this.useWin?Xe:this.element).addEventListener("scroll",this,!1)}updateScrollCoords(){const e=this.useWin,t=this.element;this.scrollX=F(e?Xe.scrollX:t.scrollLeft,0),this.scrollY=F(e?Xe.scrollY:t.scrollTop,0)}updateWindowBounds(){this.winWidth=Xe.innerWidth,this.winHeight=_c()}updateBounds(){const e=getComputedStyle(this.element),t=this.element;this.scrollWidth=t.scrollWidth+parseFloat(e.marginLeft)+parseFloat(e.marginRight),this.scrollHeight=t.scrollHeight+parseFloat(e.marginTop)+parseFloat(e.marginBottom),this.updateWindowBounds();let s,r;if(this.useWin)s=this.winWidth,r=this.winHeight;else{const i=t.getBoundingClientRect();s=t.clientWidth,r=t.clientHeight,this.top=i.top,this.left=i.left,this.scale=i.width?s/i.width:i.height?r/i.height:1}this.width=s,this.height=r}refreshScrollObservers(){Se(this,e=>{e.ready&&e._debug&&e.removeDebug()}),this.updateBounds(),Se(this,e=>{e.ready&&(e.refresh(),e.onResize(e),e._debug&&e.debug())})}refresh(){this.updateWindowBounds(),this.updateBounds(),this.refreshScrollObservers(),this.handleScroll()}handleScroll(){this.updateScrollCoords(),this.wakeTicker.restart()}handleEvent(e){e.type==="scroll"&&this.handleScroll()}revert(){this.scrollTicker.cancel(),this.dataTimer.cancel(),this.resizeTicker.cancel(),this.wakeTicker.cancel(),this.resizeObserver.disconnect(),(this.useWin?Xe:this.element).removeEventListener("scroll",this),rr.delete(this.element)}},kc=e=>{const t=e&&st(e)[0]||Q.body;let s=rr.get(t);return s||(s=new Sc(t),rr.set(t,s)),s},ys=(e,t,s,r,i)=>{const n=t==="min",o=t==="max",{n:a,u:h}=Je(t==="top"||t==="left"||t==="start"||n?0:t==="bottom"||t==="right"||t==="end"||o?"100%":t==="center"?"50%":t,Fe);let u=a;return h==="%"?u=a/100*s:h&&(u=Xs(e,Fe,"px",!0).n),o&&r<0&&(u+=r),n&&i>0&&(u+=i),u},ir=(e,t,s,r,i)=>{let n;if(Be(t)){const o=tn.exec(t);if(o){const a=o[0],h=a[0],u=t.split(a),f=u[0]==="min",l=u[0]==="max",d=ys(e,u[0],s,r,i),c=ys(e,u[1],s,r,i);if(f){const p=Wt(ys(e,"min",s),c,h);n=p<d?d:p}else if(l){const p=Wt(ys(e,"max",s),c,h);n=p>d?d:p}else n=Wt(d,c,h)}else n=ys(e,t,s,r,i)}else n=t;return F(n,0)},Hn=e=>{let t;const s=e.targets;for(let r=0,i=s.length;r<i;r++){const n=s[r];if(n[Ht]){t=n;break}}return t},wc=0,$n=["#FF4B4B","#FF971B","#FFC730","#F9F640","#7AFF5A","#18FF74","#17E09B","#3CFFEC","#05DBE9","#33B3F1","#638CF9","#C563FE","#FF4FCF","#F93F8A"],qn=class{constructor(e={}){Ie.current&&Ie.current.register(this);const t=U(e.sync,"play pause"),s=t?xt(t):null,r=t&&(t==="linear"||t===rt),i=t&&!(s===rt&&!r),n=t&&(qe(t)||t===!0||r),o=t&&Be(t)&&!i&&!n,a=o?t.split(" ").map(u=>()=>{const f=this.linked;return f&&f[u]?f[u]():null}):null,h=o&&a.length>2;this.index=wc++,this.id=D(e.id)?this.index:e.id,this.container=kc(e.container),this.target=null,this.linked=null,this.repeat=null,this.horizontal=null,this.enter=null,this.leave=null,this.sync=i||n||!!a,this.syncEase=i?s:null,this.syncSmooth=n?t===!0||r?1:t:null,this.onSyncEnter=a&&!h&&a[0]?a[0]:oe,this.onSyncLeave=a&&!h&&a[1]?a[1]:oe,this.onSyncEnterForward=a&&h&&a[0]?a[0]:oe,this.onSyncLeaveForward=a&&h&&a[1]?a[1]:oe,this.onSyncEnterBackward=a&&h&&a[2]?a[2]:oe,this.onSyncLeaveBackward=a&&h&&a[3]?a[3]:oe,this.onEnter=e.onEnter||oe,this.onLeave=e.onLeave||oe,this.onEnterForward=e.onEnterForward||oe,this.onLeaveForward=e.onLeaveForward||oe,this.onEnterBackward=e.onEnterBackward||oe,this.onLeaveBackward=e.onLeaveBackward||oe,this.onUpdate=e.onUpdate||oe,this.onResize=e.onResize||oe,this.onSyncComplete=e.onSyncComplete||oe,this.reverted=!1,this.ready=!1,this.completed=!1,this.began=!1,this.isInView=!1,this.forceEnter=!1,this.hasEntered=!1,this.offset=0,this.offsetStart=0,this.offsetEnd=0,this.distance=0,this.prevProgress=0,this.thresholds=["start","end","end","start"],this.coords=[0,0,0,0],this.debugStyles=null,this.$debug=null,this._params=e,this._debug=U(e.debug,!1),this._next=null,this._prev=null,mt(this.container,this),Jr(()=>{if(!this.reverted){if(!this.target){const u=st(e.target)[0];this.target=u||Q.body,this.refresh()}this._debug&&this.debug()}})}link(e){if(e&&(e.pause(),this.linked=e,!D(e)&&!D(e.persist)&&(e.persist=!0),!this._params.target)){let t;D(e.targets)?Se(e,s=>{s.targets&&!t&&(t=Hn(s))}):t=Hn(e),this.target=t||Q.body,this.refresh()}return this}get velocity(){return this.container.velocity}get backward(){return this.horizontal?this.container.backwardX:this.container.backwardY}get scroll(){return this.horizontal?this.container.scrollX:this.container.scrollY}get progress(){const e=(this.scroll-this.offsetStart)/this.distance;return e===1/0||isNaN(e)?0:F(Z(e,0,1),6)}refresh(){this.ready=!0,this.reverted=!1;const e=this._params;return this.repeat=U(sr(e.repeat,this),!0),this.horizontal=U(sr(e.axis,this),"y")==="x",this.enter=U(sr(e.enter,this),"end start"),this.leave=U(sr(e.leave,this),"start end"),this.updateBounds(),this.handleScroll(),this}removeDebug(){return this.$debug&&(this.$debug.parentNode.removeChild(this.$debug),this.$debug=null),this.debugStyles&&(this.debugStyles.revert(),this.$debug=null),this}debug(){this.removeDebug();const e=this.container,t=this.horizontal,s=e.element.querySelector(":scope > .animejs-onscroll-debug"),r=Q.createElement("div"),i=Q.createElement("div"),n=Q.createElement("div"),o=$n[this.index%$n.length],a=e.useWin,h=a?e.winWidth:e.width,u=a?e.winHeight:e.height,f=e.scrollWidth,l=e.scrollHeight,d=this.container.width>360?320:260,c=t?0:10,p=t?10:0,g=t?24:d/2,v=t?g:15,_=t?60:g,S=t?_:v,y=t?"repeat-x":"repeat-y",m=E=>t?"0px "+E+"px":E+"px 2px",b=E=>`linear-gradient(${t?90:0}deg, ${E} 2px, transparent 1px)`,k=(E,O,P,A,C)=>`position:${E};left:${O}px;top:${P}px;width:${A}px;height:${C}px;`;r.style.cssText=`${k("absolute",c,p,t?f:d,t?d:l)}
|
|
93
|
+
`)?"div":"span";return new Qe.default.SafeString(`<${u} class="squiffy-animate"${h}></${u}>`)})},onWrite(r){s(r)},onLoad(){s(e.outputElement)}}}var hs={ReplaceLabel:xl,RotateSequencePlugin:Tl,RandomPlugin:Cl,LivePlugin:Pl,AnimatePlugin:El},Al=class{constructor(){this.linkHandlers={}}registerLinkHandler(e,t){this.linkHandlers[e]=t}handleLink(e){const t=e.getAttribute("data-handler")||"",s=this.linkHandlers[t];return s?[!0,t,s(e)]:[!1,t,{}]}},yt=typeof window<"u",Xe=yt?window:null,Q=yt?document:null,Le={OBJECT:0,ATTRIBUTE:1,CSS:2,TRANSFORM:3,CSS_VAR:4},pe={NUMBER:0,UNIT:1,COLOR:2,COMPLEX:3},et={NONE:0,AUTO:1,FORCE:2},He={replace:0,none:1,blend:2},Qi=Symbol(),Ht=Symbol(),Ir=Symbol(),ds=Symbol(),Ji=Symbol(),Re=1e-11,pt=1e12,Ye=1e3,au="var(",Ds=[],Or=(()=>{const e=new Map;return e.set("x","translateX"),e.set("y","translateY"),e.set("z","translateZ"),e})(),$t=["perspective","translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY"],Ki=$t.reduce((e,t)=>({...e,[t]:t+"("}),{}),oe=()=>{},Ll=e=>e,Rl=/\)\s*[-.\d]/,Il=/(^#([\da-f]{3}){1,2}$)|(^#([\da-f]{4}){1,2}$)/i,Ol=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,Nl=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,Ml=/hsl\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*\)/i,Dl=/hsla\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,ji=/[-+]?\d*\.?\d+(?:e[-+]?\d)?/gi,en=/^([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z]+|%)$/i,Bl=/([a-z])([A-Z])/g,tn=/(\*=|\+=|-=)/,Hl=/var\(\s*(--[\w-]+)(?:\s*,\s*([^)]+))?\s*\)/,fs={id:null,keyframes:null,playbackEase:null,playbackRate:1,frameRate:240,loop:0,reversed:!1,alternate:!1,autoplay:!0,persist:!1,duration:Ye,delay:0,loopDelay:0,ease:"out(2)",composition:He.replace,modifier:Ll,onBegin:oe,onBeforeUpdate:oe,onUpdate:oe,onLoop:oe,onPause:oe,onComplete:oe,onRender:oe},Ie={current:null,root:Q},z={defaults:fs,precision:4,timeScale:1,tickThreshold:200,editor:null},sn={version:"4.5.0",engine:null};yt&&(Xe.AnimeJS||(Xe.AnimeJS=[]),Xe.AnimeJS.push(sn));var Bs=e=>e.replace(Bl,"$1-$2").toLowerCase(),Me=(e,t)=>e.indexOf(t)===0,Et=Date.now,$e=Array.isArray,De=e=>e&&e.constructor===Object,qe=e=>typeof e=="number"&&!isNaN(e),Be=e=>typeof e=="string",Ee=e=>typeof e=="function",D=e=>typeof e>"u",qt=e=>D(e)||e===null,Hs=e=>yt&&e instanceof SVGElement,rn=e=>Il.test(e),nn=e=>Me(e,"rgb"),on=e=>Me(e,"hsl"),$l=e=>rn(e)||(nn(e)||on(e))&&(e[e.length-1]===")"||!Rl.test(e)),Jt=e=>!z.defaults.hasOwnProperty(e),ql=["opacity","rotate","overflow","color"],Fl=(e,t)=>{if(ql.includes(t))return!1;if(e.getAttribute(t)||t in e){if(t==="scale"){const s=e.parentNode;return s&&s.tagName==="filter"}return!0}},Ft=e=>Be(e)?parseFloat(e):e,Vt=Math.pow,nt=Math.sqrt,Nr=Math.sin,Mr=Math.cos,ot=Math.abs,$s=Math.exp,Vl=Math.ceil,Kt=Math.floor,zl=Math.asin,an=Math.max,qs=Math.atan2,bt=Math.PI,Dr=Math.round,Z=(e,t,s)=>e<t?t:e>s?s:e,F=(e,t)=>{if(t<0)return e;if(!t)return Dr(e);const s=10**t;return Dr(e*s)/s},zt=(e,t)=>$e(t)?t.reduce((s,r)=>ot(r-e)<ot(s-e)?r:s):t?Dr(e/t)*t:e,At=(e,t,s)=>s===1?t:s===0?e:e+(t-e)*s,Fs=e=>e===1/0?pt:e===-1/0?-pt:e,jt=e=>e<=1e-11?Re:Fs(F(e,11)),Ue=e=>$e(e)?[...e]:e,at=(e,t)=>{const s={...e};for(let r in t){const i=e[r];s[r]=D(i)?t[r]:i}return s},Se=(e,t,s,r="_prev",i="_next")=>{let n=e._head,o=i;for(s&&(n=e._tail,o=r);n;){const a=n[o];t(n),n=a}},gt=(e,t,s="_prev",r="_next")=>{const i=t[s],n=t[r];i?i[r]=n:e._head=n,n?n[s]=i:e._tail=i,t[s]=null,t[r]=null},mt=(e,t,s,r="_prev",i="_next")=>{let n=e._tail;for(;n&&s&&s(n,t);)n=n[r];const o=n?n[i]:e._head;n?n[i]=t:e._head=t,o?o[r]=t:e._tail=t,t[r]=n,t[i]=o},Ul=(e,t,s)=>{const r=e.style.transform;if(r){const i=e[ds];let n=0;const o=r.length;let a;for(;n<o;){for(;n<o&&r.charCodeAt(n)===32;)n++;if(n>=o)break;const u=n;for(;n<o&&r.charCodeAt(n)!==40;)n++;if(n>=o)break;const f=r.substring(u,n);let l=1;const d=n+1;let c=-1,p=-1;for(n++;n<o&&l>0;){const v=r.charCodeAt(n);v===40?l++:v===41?l--:v===44&&l===1&&(c===-1?c=n:p===-1&&(p=n)),n++}const g=n-1;f==="translate"||f==="translate3d"?(c===-1?i.translateX=r.substring(d,g).trim():(i.translateX=r.substring(d,c).trim(),p===-1?i.translateY=r.substring(c+1,g).trim():(i.translateY=r.substring(c+1,p).trim(),i.translateZ=r.substring(p+1,g).trim())),a=r.substring(d,g)):f==="scale"||f==="scale3d"?c===-1?i.scale=r.substring(d,g).trim():(i.scaleX=r.substring(d,c).trim(),p===-1?i.scaleY=r.substring(c+1,g).trim():(i.scaleY=r.substring(c+1,p).trim(),i.scaleZ=r.substring(p+1,g).trim())):i[f]=r.substring(d,g)}if(t==="translate3d"&&a)return s&&(s[t]=a),a;const h=i[t];if(!D(h))return s&&(s[t]=h),h}return t==="translate3d"?"0px, 0px, 0px":t==="rotate3d"?"0, 0, 0, 0deg":Me(t,"scale")?"1":Me(t,"rotate")||Me(t,"skew")?"0deg":"0px"},ln=e=>{let t="";for(let s=0,r=$t.length;s<r;s++){const i=$t[s],n=e[i];if(n!==void 0){if(i==="translateX"){const o=e.translateY;if(o!==void 0){const a=e.translateZ;a!==void 0?(t+=`translate3d(${n},${o},${a}) `,s+=2):(t+=`translate(${n},${o}) `,s+=1);continue}}if(i==="scaleX"&&e.scale===void 0){const o=e.scaleY;if(o!==void 0){const a=e.scaleZ;a!==void 0?(t+=`scale3d(${n},${o},${a}) `,s+=2):(t+=`scale(${n},${o}) `,s+=1);continue}}t+=`${Ki[i]}${n}) `}i==="rotateZ"&&e.rotate3d!==void 0&&(t+=`rotate3d(${e.rotate3d}) `)}return e.matrix!==void 0&&(t+=`matrix(${e.matrix}) `),e.matrix3d!==void 0&&(t+=`matrix3d(${e.matrix3d}) `),t},Br=[];function cn(e,t){if(!e)return null;const s=Br.length;e:for(let r=0;r<s;r++){const i=Br[r];if(i.detect&&!i.detect(e))continue;const n=i.targetAdapters;for(let o=0,a=n.length;o<a;o++){const h=n[o];if(h.detect(e)){const u=h.props[t];if(u&&(!u.gate||u.gate(e)))return u;break e}}}for(let r=0;r<s;r++){const i=Br[r];if(i.detect&&!i.detect(e))continue;const n=i.propertyResolvers;for(let o=0,a=n.length;o<a;o++){const h=n[o](e,t);if(h)return h}}return null}var Wl=e=>{const t=Ol.exec(e)||Nl.exec(e),s=D(t[4])?1:+t[4];return[+t[1],+t[2],+t[3],s]},Xl=e=>{const t=e.length,s=t===4||t===5;return[+("0x"+e[1]+e[s?1:2]),+("0x"+e[s?2:3]+e[s?2:4]),+("0x"+e[s?3:5]+e[s?3:6]),t===5||t===9?+(+("0x"+e[s?4:7]+e[s?4:8])/255).toFixed(3):1]},Hr=(e,t,s)=>(s<0&&(s+=1),s>1&&(s-=1),s<1/6?e+(t-e)*6*s:s<1/2?t:s<2/3?e+(t-e)*(2/3-s)*6:e),Yl=e=>{const t=Ml.exec(e)||Dl.exec(e),s=+t[1]/360,r=+t[2]/100,i=+t[3]/100,n=D(t[4])?1:+t[4];let o,a,h;if(r===0)o=a=h=i;else{const u=i<.5?i*(1+r):i+r-i*r,f=2*i-u;o=F(Hr(f,u,s+1/3)*255,0),a=F(Hr(f,u,s)*255,0),h=F(Hr(f,u,s-1/3)*255,0)}return[o,a,h,n]},Gl=e=>nn(e)?Wl(e):rn(e)?Xl(e):on(e)?Yl(e):[0,0,0,1],U=(e,t)=>D(e)?t:e,un=(e,t)=>{const s=e.match(Hl),r=t[Ht]?t:document.documentElement;let i=getComputedStyle(r)?.getPropertyValue(s[1]);return(!i||i.trim()==="")&&s[2]&&(i=s[2].trim()),i||0},Ne=(e,t,s,r,i,n)=>{if(Ee(e)){if(!i){const a=e(t,s,r,n);return isNaN(+a)?a||0:+a}const o=()=>{const a=e(t,s,r,n);return isNaN(+a)?a||0:+a};return i.func=o,o()}if(Be(e)&&Me(e,"var(")){if(!i)return un(e,t);const o=()=>un(e,t);return i.func=o,o()}return e},$r=(e,t)=>e[Ht]?e[Ir]&&Fl(e,t)?Le.ATTRIBUTE:$t.includes(t)||Or.get(t)?Le.TRANSFORM:Me(t,"--")?Le.CSS_VAR:t in e.style?Le.CSS:t in e?Le.OBJECT:Le.ATTRIBUTE:Le.OBJECT,hn=(e,t,s)=>{const r=e.style[t];r&&s&&(s[t]=r);const i=r||getComputedStyle(e[Ji]||e).getPropertyValue(t);return i==="auto"?"0":i},Ut=(e,t,s,r)=>{const i=D(s)?$r(e,t):s,n=cn(e,t);if(n){const o=n.get(e);return o&&r&&(r[t]=o),o??0}if(i===Le.OBJECT){const o=e[t];return o&&r&&(r[t]=o),o||0}if(i===Le.ATTRIBUTE){const o=e.getAttribute(t);return o&&r&&(r[t]=o),o}return i===Le.TRANSFORM?Ul(e,t,r):i===Le.CSS_VAR?hn(e,t,r).trimStart():hn(e,t,r)},Wt=(e,t,s)=>s==="-"?e-t:s==="+"?e+t:e*t,qr=()=>({t:pe.NUMBER,n:0,u:null,o:null,d:null,s:null}),Je=(e,t)=>{if(t.t=pe.NUMBER,t.n=0,t.u=null,t.o=null,t.d=null,t.s=null,!e)return t;const s=+e;if(!isNaN(s))return t.n=s,t;let r=e;r[1]==="="&&(t.o=r[0],r=r.slice(2));const i=r.includes(" ")?!1:en.exec(r);if(i)return t.t=pe.UNIT,t.n=+i[1],t.u=i[2],t;if(t.o)return t.n=+r,t;if($l(r))return t.t=pe.COLOR,t.d=Gl(r),t;{const n=r.match(ji);return t.t=pe.COMPLEX,t.d=n?n.map(Number):[],t.s=r.split(ji)||[],t}},dn=(e,t)=>(t.t=e._valueType,t.n=e._toNumber,t.u=e._unit,t.o=null,t.d=Ue(e._toNumbers),t.s=Ue(e._strings),t),Fe=qr(),fn=(e,t,s)=>{const r=e._modifier,i=e._fromNumbers,n=e._toNumbers,o=e._strings;let a=o[0];for(let h=0,u=n.length;h<u;h++){const f=r(F(At(i[h],n[h],t),s)),l=o[h+1];a+=`${l?f+l:f}`,e._numbers[h]=f}return a},Vs=(e,t,s,r,i)=>{const n=e.parent,o=e.duration,a=e.completed,h=e.iterationDuration,u=e.iterationCount,f=e._currentIteration,l=e._loopDelay,d=e._reversed,c=e._alternate,p=e._hasChildren,g=e._delay,v=e._currentTime,_=g+h,S=t-g,y=Z(v,-g,o),m=Z(S,-g,o),b=S-v,k=m>0,w=m>=o,E=o<=Re,O=i===et.FORCE;let P=0,A=S,C=0;if(u>1){const M=h+(w?0:l),I=~~(m/M);e._currentIteration=Z(I,0,u),w&&e._currentIteration--,P=e._currentIteration%2,A=m-I*M||0}const H=d^(c&&P),$=e._ease;let V=w?H?0:o:H?h-A:A;$&&(V=h*$(V/h)||0);const x=(n?n.backwards:S<v)?!H:!!H;if(e._currentTime=S,e._iterationTime=V,e.backwards=x,k&&!e.began?(e.began=!0,!s&&!(n&&(x||!n.began))&&e.onBegin(e)):S<=0&&(e.began=!1),!s&&!p&&k&&e._currentIteration!==f&&e.onLoop(e),O||i===et.AUTO&&(t>=(n&&g>0?0:g)&&t<=_||t<=g&&y>g||t>=_&&y!==o)||V>=_&&y!==o||V<=g&&y>0&&!w||t<=y&&y===o&&a||w&&!a&&E){if(k&&(e.computeDeltaTime(y),s||e.onBeforeUpdate(e)),!p){const M=O||(x?b*-1:b)>=z.tickThreshold,I=F(e._offset+(n?n._offset:0)+g+V,12);let L=e._head,q,K,G,W,ee=0;for(;L;){const Y=L._composition,re=L._currentTime,ge=L._changeDuration,he=L._absoluteStartTime+L._changeDuration,le=L._nextRep,J=L._prevRep,ce=Y!==He.none,de=J?J._absoluteStartTime+J._changeDuration:0,ie=J&&J.parent!==L.parent,ae=!le||le._isOverridden?he:le.parent===L.parent?he+le._delay:le._absoluteStartTime<le._absoluteUpdateStartTime?le._absoluteStartTime:le._absoluteUpdateStartTime;if((M||(re!==ge||I<=ae||J&&!ie&&(!le||le.parent!==L.parent))&&(re!==0||I>=L._absoluteStartTime||ie&&!L._hasFromValue&&!J._isOverridden&&I>=de||le&&!le._isOverridden&&le.parent===L.parent&&le._currentTime!==0&&V<le._startTime))&&(!J||ie||V>=L._startTime)&&(!ce||!L._isOverridden&&(!L._isOverlapped||I<=he)&&(!le||le._isOverridden||I<=ae)&&(!J||J._isOverridden||(ie?I>=L._absoluteStartTime||!L._hasFromValue&&I>=de:I>=de+L._delay)))){const ke=L._currentTime=Z(V-L._startTime,0,ge),ye=L._ease(ke/L._updateDuration),we=L._modifier,Te=L._valueType,xe=L._tweenType,me=xe===Le.OBJECT,te=Te===pe.NUMBER,T=te&&me||ye===0||ye===1?-1:z.precision;let N,B;if(te)N=B=we(F(At(L._fromNumber,L._toNumber,ye),T));else if(Te===pe.UNIT)B=we(F(At(L._fromNumber,L._toNumber,ye),T)),N=`${B}${L._unit}`;else if(Te===pe.COLOR){const R=L._numbers,X=L._fromNumbers,j=L._toNumbers,se=1-ye,be=X[0],Ae=X[1],Oe=X[2],Yt=j[0],Es=j[1],Nt=j[2];R[0]=we(Math.sqrt(be*be*se+Yt*Yt*ye)),R[1]=we(Math.sqrt(Ae*Ae*se+Es*Es*ye)),R[2]=we(Math.sqrt(Oe*Oe*se+Nt*Nt*ye)),R[3]=we(At(X[3],j[3],ye)),(!L._setter||r)&&(N=`rgba(${F(R[0],0)},${F(R[1],0)},${F(R[2],0)},${R[3]})`)}else Te===pe.COMPLEX&&(N=fn(L,ye,T));if(ce&&(L._number=B),!r&&Y!==He.blend){const R=L.property;q=L.target,L._setter?L._setter(q,B,L):me?q[R]=N:xe===Le.ATTRIBUTE?q.setAttribute(R,N):(K=q.style,xe===Le.TRANSFORM?(q!==G&&(G=q,W=q[ds]),W[R]=N,ee=1):xe===Le.CSS?K[R]=N:xe===Le.CSS_VAR&&K.setProperty(R,N)),k&&(C=1)}else L._value=N}else re&&J&&!ie&&V<L._startTime&&(L._currentTime=0);ee&&L._renderTransforms&&(K.transform=ln(W),ee=0),L=L._next}!s&&C&&e.onRender(e)}!s&&k&&e.onUpdate(e)}return n&&E?!s&&(n.began&&!x&&S>0&&!a||x&&S<=1e-11&&a)&&(e.onComplete(e),e.completed=!x):k&&w?u===1/0?e._startTime+=e.duration:e._currentIteration>=u-1&&(e.paused=!0,!a&&!p&&(e.completed=!0,!s&&!(n&&(x||!n.began))&&(e.onComplete(e),e._resolve(e)))):e.completed=!1,C},Xt=(e,t,s,r,i)=>{const n=e._currentIteration;if(Vs(e,t,s,r,i),e._hasChildren){const o=e,a=o.backwards,h=r?t:o._iterationTime,u=Et();let f=0,l=!0;if(!r&&o._currentIteration!==n){const d=o.iterationDuration;Se(o,c=>{if(!a)!c.completed&&!c.backwards&&c._currentTime<c.iterationDuration&&Vs(c,d,s,1,et.FORCE),c.began=!1,c.completed=!1;else{const p=c.duration,g=c._offset+c._delay,v=g+p;!s&&p<=1e-11&&(!g||v===d)&&c.onComplete(c)}}),s||o.onLoop(o)}Se(o,d=>{const c=F((h-d._offset)*d._speed,12);if(a&&c>d._delay+d.duration)return;const p=d._fps<o._fps?d.requestTick(u):i;f+=Vs(d,c,s,r,p),!d.completed&&l&&(l=!1)},a),!s&&f&&o.onRender(o),(l||a)&&o._currentTime>=o.duration&&(o.paused=!0,o.completed||(o.completed=!0,s||(o.onComplete(o),o._resolve(o))))}},pn={},Fr=(e,t,s)=>{if(s===Le.TRANSFORM){const r=Or.get(e);return r||e}else if(s===Le.CSS||s===Le.ATTRIBUTE&&Hs(t)&&e in t.style){const r=pn[e];if(r)return r;{const i=e&&Bs(e);return pn[e]=i,i}}else return e},zs=(e,t=!1)=>{if(e._hasChildren)Se(e,s=>zs(s,t),!0);else{const s=e;s.pause(),Se(s,r=>{const i=r.property,n=r.target,o=r._tweenType,a=r._inlineValue,h=qt(a)||a==="";if(r._setter){if(!t&&!h){if(Je(a,Fe),Fe.d){const u=Fe.d,f=r._numbers;for(let l=0,d=u.length;l<d;l++)f[l]=u[l]}else r._number=Fe.n;r._setter(r.target,r._number,r)}}else if(o===Le.OBJECT)!t&&!h&&(n[i]=a);else if(n[Ht])if(o===Le.ATTRIBUTE)t||(h?n.removeAttribute(i):n.setAttribute(i,a));else{const u=n.style;if(o===Le.TRANSFORM){const f=n[ds];h?delete f[i]:f[i]=a,r._renderTransforms&&(Object.keys(f).length?u.transform=ln(f):u.removeProperty("transform"))}else h?u.removeProperty(Bs(i)):u[i]=a}n[Ht]&&s._tail===r&&s.targets.forEach(u=>{u.getAttribute&&u.getAttribute("style")===""&&u.removeAttribute("style")})})}return e},gn=e=>zs(e,!0),mn=class{constructor(e=0){this.deltaTime=0,this._currentTime=e,this._lastTickTime=e,this._startTime=e,this._lastTime=e,this._frameDuration=Ye/240,this._fps=240,this._speed=1,this._hasChildren=!1,this._head=null,this._tail=null}get fps(){return this._fps}set fps(e){const t=+e,s=t<1e-11?Re:t,r=Ye/s;s>fs.frameRate&&(fs.frameRate=s),this._fps=s,this._frameDuration=r}get speed(){return this._speed}set speed(e){const t=+e;this._speed=t<1e-11?Re:t}requestTick(e){const t=this._frameDuration,s=e-this._lastTickTime,r=t*.25;return s+(r<4?r:4)<t?et.NONE:(this._lastTickTime=s>=t?e-s%t:e,et.AUTO)}computeDeltaTime(e){const t=e-this._lastTime;return this.deltaTime=t,this._lastTime=e,t}},es={animation:null,update:oe},Zl=e=>{let t=es.animation;return t||(t={duration:Re,computeDeltaTime:oe,_offset:0,_delay:0,_head:null,_tail:null},es.animation=t,es.update=()=>{e.forEach(s=>{for(let r in s){const i=s[r],n=i._head;if(n){const o=n._valueType,a=o===pe.COMPLEX||o===pe.COLOR?Ue(n._fromNumbers):null;let h=n._fromNumber,u=i._tail;for(;u&&u!==n;){if(a)for(let f=0,l=u._numbers.length;f<l;f++)a[f]+=u._numbers[f];else h+=u._number;u=u._prevAdd}n._toNumber=h,n._toNumbers=a}}}),Vs(t,1,1,0,et.FORCE)}),t},vn=yt?requestAnimationFrame:setImmediate,Ql=yt?cancelAnimationFrame:clearImmediate,Jl=class extends mn{constructor(e){super(e),this.useDefaultMainLoop=!0,this.pauseOnDocumentHidden=!0,this.defaults=fs,this.paused=!0,this.reqId=0}update(){const e=this._currentTime=Et();if(this.requestTick(e)){this.computeDeltaTime(e);const t=this._speed,s=this._fps;let r=this._head;for(;r;){const i=r._next;r.paused?(gt(this,r),this._hasChildren=!!this._tail,r._running=!1,r.completed&&!r._cancelled&&r.cancel()):Xt(r,(e-r._startTime)*r._speed*t,0,0,r._fps<s?r.requestTick(e):et.AUTO),r=i}es.update()}}wake(){return this.useDefaultMainLoop&&!this.reqId&&(this.requestTick(Et()),this.reqId=vn(yn)),this}pause(){if(this.reqId)return this.paused=!0,Kl()}resume(){if(this.paused)return this.paused=!1,Se(this,e=>e.resetTime()),this.wake()}get speed(){return this._speed*(z.timeScale===1?1:Ye)}set speed(e){const t=e*z.timeScale;this._speed!==t&&(this._speed=t,Se(this,s=>s.speed=s._speed))}get timeUnit(){return z.timeScale===1?"ms":"s"}set timeUnit(e){const s=e==="s",r=s?.001:1;if(z.timeScale!==r){z.timeScale=r,z.tickThreshold=200*r;const i=s?.001:Ye;this.defaults.duration*=i,this._speed*=i}}get precision(){return z.precision}set precision(e){z.precision=e}},Ve=(()=>{const e=new Jl(Et());return yt&&(sn.engine=e,Q.addEventListener("visibilitychange",()=>{e.pauseOnDocumentHidden&&(Q.hidden?e.pause():e.resume())})),e})(),yn=()=>{Ve._head?(Ve.reqId=vn(yn),Ve.update()):Ve.reqId=0},Kl=()=>(Ql(Ve.reqId),Ve.reqId=0,Ve),Us={_rep:new WeakMap,_add:new Map},Vr=(e,t,s="_rep")=>{const r=Us[s];let i=r.get(e);return i||(i={},r.set(e,i)),i[t]?i[t]:i[t]={_head:null,_tail:null}},jl=(e,t)=>e._isOverridden||e._absoluteStartTime>t._absoluteStartTime,Ws=e=>{e._isOverlapped=1,e._isOverridden=1,e._changeDuration=Re,e._currentTime=Re},bn=(e,t)=>{const s=e._composition;if(s===He.replace){const r=e._absoluteStartTime;mt(t,e,jl,"_prevRep","_nextRep");const i=e._prevRep;if(i){const n=i.parent,o=i._absoluteEndTime;if(e.parent.id!==n.id&&n.iterationCount>1&&o+(n.duration-n.iterationDuration)>r){Ws(i);let u=i._prevRep;for(;u&&u.parent.id===n.id;)Ws(u),u=u._prevRep}const a=e._absoluteUpdateStartTime;if(o>a){const u=i._startTime,f=o-(u+i._updateDuration),l=F(a-f-u,12);i._changeDuration=l,i._currentTime=l,i._isOverlapped=1,l<1e-11&&Ws(i)}const h=e.parent.parent;if(!h||h!==n.parent){let u=!0;if(Se(n,f=>{f._isOverlapped||(u=!1)}),u){const f=n.parent;if(f){let l=!0;Se(f,d=>{d!==n&&Se(d,c=>{c._isOverlapped||(l=!1)})}),l&&f.cancel()}else n.cancel()}}}}else if(s===He.blend){const r=Vr(e.target,e.property,"_add"),i=Zl(Us._add);let n=r._head;n||(n={...e},n._composition=He.replace,n._updateDuration=Re,n._startTime=0,n._numbers=Ue(e._fromNumbers),n._number=0,n._next=null,n._prev=null,mt(r,n),mt(i,n));const o=e._toNumber;if(e._fromNumber=n._fromNumber-o,e._toNumber=0,e._numbers=Ue(e._fromNumbers),e._number=0,n._fromNumber=o,e._toNumbers.length){const a=Ue(e._toNumbers);a.forEach((h,u)=>{e._fromNumbers[u]=n._fromNumbers[u]-h,e._toNumbers[u]=0}),n._fromNumbers=a}mt(r,e,null,"_prevAdd","_nextAdd")}return e},_n=e=>{const t=e._composition;if(t!==He.none){const s=e.target,r=e.property,i=Us._rep.get(s)[r];if(gt(i,e,"_prevRep","_nextRep"),t===He.blend){const n=Us._add,o=n.get(s);if(!o)return;const a=o[r],h=es.animation;gt(a,e,"_prevAdd","_nextAdd");const u=a._head;if(u&&u===a._tail){gt(a,u,"_prevAdd","_nextAdd"),gt(h,u);let f=!0;for(let l in o)if(o[l]._head){f=!1;break}f&&n.delete(s)}}}return e},Sn=(e,t,s)=>{let r=!1;return Se(t,i=>{const n=i.target;if(e.includes(n)){const o=i.property,a=i._tweenType,h=Fr(s,n,a);(!h||h&&h===o)&&(i.parent._tail===i&&i._tweenType===Le.TRANSFORM&&i._prev&&i._prev._tweenType===Le.TRANSFORM&&(i._prev._renderTransforms=1),gt(t,i),_n(i),r=!0)}},!0),r},kt=(e,t,s)=>{const r=t||Ve;let i;if(r._hasChildren){let n=0;Se(r,o=>{if(!o._hasChildren)if(i=Sn(e,o,s),i&&!o._head)o.cancel(),gt(r,o);else{const a=o._offset+o._delay+o.duration;a>n&&(n=a)}o._head?kt(e,o,s):o._hasChildren=!1},!0),D(r.iterationDuration)||(r.iterationDuration=n)}else i=Sn(e,r,s);i&&!r._head&&(r._hasChildren=!1,r.cancel&&r.cancel())},kn=e=>(e.paused=!0,e.began=!1,e.completed=!1,e),zr=e=>(e._cancelled&&(e._hasChildren?Se(e,zr):Se(e,t=>{t._composition!==He.none&&bn(t,Vr(t.target,t.property))}),e._cancelled=0),e),wn=0,ec=(e,t)=>e._priority>t._priority,tt=class extends mn{constructor(e={},t=null,s=0){super(0),++wn;const{id:r,delay:i,duration:n,reversed:o,alternate:a,loop:h,loopDelay:u,autoplay:f,frameRate:l,playbackRate:d,priority:c,onComplete:p,onLoop:g,onPause:v,onBegin:_,onBeforeUpdate:S,onUpdate:y}=e;Ie.current&&Ie.current.register(this);const m=t?0:Ve._lastTickTime,b=t?t.defaults:z.defaults,k=Ee(i)||D(i)?b.delay:+i,w=Ee(n)||D(n)?1/0:+n,E=U(h,b.loop),O=U(u,b.loopDelay);let P=E===!0||E===1/0||E<0?1/0:E+1,A=0;t?A=s:(Ve.reqId||Ve.requestTick(Et()),A=(Ve._lastTickTime-Ve._startTime)*z.timeScale),this.id=D(r)?wn:r,this.parent=t,this.duration=Fs((w+O)*P-O)||1e-11,this.backwards=!1,this.paused=!0,this.began=!1,this.completed=!1,this.onBegin=_||b.onBegin,this.onBeforeUpdate=S||b.onBeforeUpdate,this.onUpdate=y||b.onUpdate,this.onLoop=g||b.onLoop,this.onPause=v||b.onPause,this.onComplete=p||b.onComplete,this.iterationDuration=w,this.iterationCount=P,this._autoplay=t?!1:U(f,b.autoplay),this._offset=A,this._delay=k,this._loopDelay=O,this._iterationTime=0,this._currentIteration=0,this._resolve=oe,this._running=!1,this._reversed=+U(o,b.reversed),this._reverse=this._reversed,this._cancelled=0,this._alternate=U(a,b.alternate),this._prev=null,this._next=null,this._lastTickTime=m,this._startTime=m,this._lastTime=m,this._fps=U(l,b.frameRate),this._speed=U(d,b.playbackRate),this._priority=+U(c,1)}get cancelled(){return!!this._cancelled}set cancelled(e){e?this.cancel():this.reset(!0).play()}get currentTime(){return Z(F(this._currentTime,z.precision),-this._delay,this.duration)}set currentTime(e){const t=this.paused;this.pause().seek(+e),t||this.resume()}get iterationCurrentTime(){return Z(F(this._iterationTime,z.precision),0,this.iterationDuration)}set iterationCurrentTime(e){this.currentTime=this.iterationDuration*this._currentIteration+e}get progress(){return Z(F(this._currentTime/this.duration,10),0,1)}set progress(e){this.currentTime=this.duration*e}get iterationProgress(){return Z(F(this._iterationTime/this.iterationDuration,10),0,1)}set iterationProgress(e){const t=this.iterationDuration;this.currentTime=t*this._currentIteration+t*e}get currentIteration(){return this._currentIteration}set currentIteration(e){this.currentTime=this.iterationDuration*Z(+e,0,this.iterationCount-1)}get reversed(){return!!this._reversed}set reversed(e){e?this.reverse():this.play()}get speed(){return super.speed}set speed(e){super.speed=e,this.resetTime()}reset(e=!1){return zr(this),this._reversed&&!this._reverse&&(this.reversed=!1),this._iterationTime=this.iterationDuration,Xt(this,0,1,~~e,et.FORCE),kn(this),this._hasChildren&&Se(this,kn),this}init(e=!1){this.fps=this._fps,this.speed=this._speed,!e&&this._hasChildren&&Xt(this,this.duration,1,~~e,et.FORCE),this.reset(e);const t=this._autoplay;return t===!0?this.resume():t&&!D(t.linked)&&t.link(this),this}resetTime(){const e=1/(this._speed*Ve._speed);return this._startTime=Et()-(this._currentTime+this._delay)*e,this}pause(){return this.paused?this:(this.paused=!0,this.onPause(this),this)}resume(){return this.paused?(this.paused=!1,this.duration<=1e-11&&!this._hasChildren?Xt(this,Re,0,0,et.FORCE):(this._running||(mt(Ve,this,ec),Ve._hasChildren=!0,this._running=!0),this.resetTime(),this._startTime-=12,Ve.wake()),this):this}restart(){return this.reset().resume()}seek(e,t=0,s=0){zr(this),this.completed=!1;const r=this.paused;return this.paused=!0,Xt(this,e+this._delay,~~t,~~s,et.AUTO),r?this:this.resume()}alternate(){const e=this._reversed,t=this.iterationCount,s=this.iterationDuration,r=t===1/0?Kt(pt/s):t;return this._reversed=+(this._alternate&&!(r%2)?e:!e),t===1/0?this.iterationProgress=this._reversed?1-this.iterationProgress:this.iterationProgress:this.seek(s*r-this._currentTime),this.resetTime(),this}play(){return this._reversed&&this.alternate(),this.resume()}reverse(){return this._reversed||this.alternate(),this.resume()}cancel(){return this._hasChildren?Se(this,e=>e.cancel(),!0):Se(this,_n),this._cancelled=1,this.pause()}stretch(e){const t=this.duration,s=jt(e);if(t===s)return this;const r=e/t,i=e<=Re;return this.duration=i?Re:s,this.iterationDuration=i?Re:jt(this.iterationDuration*r),this._offset*=r,this._delay*=r,this._loopDelay*=r,this}revert(){Xt(this,0,1,0,et.AUTO);const e=this._autoplay;return e&&e.linked&&e.linked===this&&e.revert(),this.cancel()}complete(e=0){return this.seek(this.duration,e).cancel()}then(e=oe){const t=this.then,s=()=>{this.then=null,e(this),this.then=t,this._resolve=oe};return new Promise(r=>(this._resolve=()=>r(s()),this.completed&&this._resolve(),this))}},tc=e=>new tt(e,null,0).init();function Ur(e){const t=Be(e)?Ie.root.querySelectorAll(e):e;if(t instanceof NodeList||t instanceof HTMLCollection)return t}function st(e){if(qt(e))return[];if(!yt)return $e(e)&&e.flat(1/0)||[e];if($e(e)){const s=e.flat(1/0),r=[];for(let i=0,n=s.length;i<n;i++){const o=s[i];if(!qt(o)){const a=Ur(o);if(a)for(let h=0,u=a.length;h<u;h++){const f=a[h];if(!qt(f)){let l=!1;for(let d=0,c=r.length;d<c;d++)if(r[d]===f){l=!0;break}l||r.push(f)}}else{let h=!1;for(let u=0,f=r.length;u<f;u++)if(r[u]===o){h=!0;break}h||r.push(o)}}}return r}const t=Ur(e);return t?Array.from(t):[e]}function Lt(e){const t=st(e),s=t.length;for(let r=0;r<s;r++){const i=t[r];if(!i[Qi]){i[Qi]=!0;const n=Hs(i);(i.nodeType||n)&&(i[Ht]=!0,i[Ir]=n,i[ds]={})}}return t}var Wr={deg:1,rad:180/bt,turn:360},xn={},Xs=(e,t,s,r=!1)=>{const i=t.u,n=t.n;if(t.t===pe.UNIT&&i===s)return t;const o=n+i+s,a=xn[o];if(!D(a)&&!r)t.n=a;else{let h;if(i in Wr)h=n*Wr[i]/Wr[s];else{const f=e.cloneNode(),l=e.parentNode,d=l&&l!==Q?l:Q.body;d.appendChild(f);const c=f.style;c.width=100+i;const p=f.offsetWidth||100;c.width=100+s;const g=p/(f.offsetWidth||100);d.removeChild(f),h=g*n}t.n=h,xn[o]=h}return t.t,pe.UNIT,t.u=s,t},rt=e=>e,ps=(e=1.68)=>t=>Vt(t,+e),Xr={in:e=>t=>e(t),out:e=>t=>1-e(1-t),inOut:e=>t=>t<.5?e(t*2)/2:1-e(t*-2+2)/2,outIn:e=>t=>t<.5?(1-e(1-t*2))/2:(e(t*2-1)+1)/2},sc=bt/2,Tn=bt*2,Cn={"":ps,Quad:ps(2),Cubic:ps(3),Quart:ps(4),Quint:ps(5),Sine:e=>1-Mr(e*sc),Circ:e=>1-nt(1-e*e),Expo:e=>e?Vt(2,10*e-10):0,Bounce:e=>{let t,s=4;for(;e<((t=Vt(2,--s))-1)/11;);return 1/Vt(4,3-s)-7.5625*Vt((t*3-2)/22-e,2)},Back:(e=1.7)=>t=>(+e+1)*t*t*t-+e*t*t,Elastic:(e=1,t=.3)=>{const s=Z(+e,1,10),r=Z(+t,Re,2),i=r/Tn*zl(1/s),n=Tn/r;return o=>o===0||o===1?o:-s*Vt(2,-10*(1-o))*Nr((1-o-i)*n)}},wt=(()=>{const e={linear:rt,none:rt};for(let t in Xr)for(let s in Cn){const r=Cn[s],i=Xr[t];e[t+s]=s===""||s==="Back"||s==="Elastic"?(n,o)=>i(r(n,o)):i(r)}return e})(),Ys={linear:rt,none:rt},Pn=e=>{if(Ys[e])return Ys[e];if(e.indexOf("(")<=-1){const t=Xr[e]||e.includes("Back")||e.includes("Elastic")?wt[e]():wt[e];return t?Ys[e]=t:rt}else{const t=e.slice(0,-1).split("("),s=wt[t[0]];return s?Ys[e]=s(...t[1].split(",")):rt}},En=["steps(","irregular(","linear(","cubicBezier("],xt=e=>{if(Be(e)){for(let t=0,s=En.length;t<s;t++)if(Me(e,En[t]))return console.warn(`String syntax for \`ease: "${e}"\` has been removed from the core and replaced by importing and passing the easing function directly: \`ease: ${e}\``),rt}return Ee(e)?e:Be(e)?Pn(e):rt},ne=qr(),fe=qr(),ts={},Gs={func:null},Zs={func:null},Qs=[null],ss=[null,null],Js={to:null},rc=0,An=0,Rt,_t,ic=(e,t)=>{const s={};if($e(e)){const r=[].concat(...e.map(i=>Object.keys(i))).filter(Jt);for(let i=0,n=r.length;i<n;i++){const o=r[i];s[o]=e.map(a=>{const h={};for(let u in a){const f=a[u];Jt(u)?u===o&&(h.to=f):h[u]=f}return h})}}else{const r=U(t.duration,z.defaults.duration);Object.keys(e).map(i=>({o:parseFloat(i)/100,p:e[i]})).sort((i,n)=>i.o-n.o).forEach(i=>{const n=i.o,o=i.p;for(let a in o)if(Jt(a)){let h=s[a];h||(h=s[a]=[]);const u=n*r;let f=h.length,l=h[f-1];const d={to:o[a]};let c=0;for(let p=0;p<f;p++)c+=h[p].duration;f===1&&(d.from=l.to),o.ease&&(d.ease=o.ease),d.duration=u-(f?c:0),h.push(d)}return i});for(let i in s){const n=s[i];let o;for(let a=0,h=n.length;a<h;a++){const u=n[a],f=u.ease;u.ease=o||void 0,o=f}n[0].duration||n.shift()}}return s},Tt=class extends tt{constructor(e,t,s,r,i=!1,n=0,o){super(t,s,r),this._head,this._tail,++An;const a=Lt(e),h=a.length,u=t.keyframes,f=u?at(ic(u,t),t):t,{id:l,delay:d,duration:c,ease:p,playbackEase:g,modifier:v,composition:_,onRender:S}=f,y=s?s.defaults:z.defaults,m=U(p,y.ease),b=U(g,y.playbackEase),k=b?xt(b):null,w=!D(m.ease),E=w?m.ease:U(p,k?"linear":y.ease),O=w?m.settlingDuration:U(c,y.duration),P=U(d,y.delay),A=v||y.modifier,C=D(_)&&h>=1e3?He.none:D(_)?y.composition:_,H=this._offset+(s?s._offset:0);w&&(m.parent=this);let $=NaN,V=NaN,x=0,M=0;for(let I=0;I<h;I++){const L=a[I],q=n||I,K=o||a;let G=NaN,W=NaN;for(let ee in f)if(Jt(ee)){const Y=$r(L,ee),re=cn(L,ee),ge=Fr(ee,L,Y);let he=f[ee];const le=$e(he);if(i&&!le&&(ss[0]=he,ss[1]=he,he=ss),le){const ke=he.length,ye=!De(he[0]);ke===2&&ye?(Js.to=he,Qs[0]=Js,Rt=Qs):ke>2&&ye?(Rt=[],he.forEach((we,Te)=>{Te?Te===1?(ss[1]=we,Rt.push(ss)):Rt.push(we):ss[0]=we})):Rt=he}else Qs[0]=he,Rt=Qs;let J=null,ce=null,de=NaN,ie=0,ae=0;for(let ke=Rt.length;ae<ke;ae++){const ye=Rt[ae];De(ye)?_t=ye:(Js.to=ye,_t=Js),Gs.func=null,Zs.func=null;const we=Ne(U(_t.composition,C),L,q,K,null,null),Te=qe(we)?we:He[we];!J&&Te!==He.none&&(J=Vr(L,ge));const xe=J?J._tail:null,me=s&&xe&&xe.parent.parent===s?xe:ce,te=Ne(_t.to,L,q,K,Gs,me);let T;De(te)&&!D(te.to)?(_t=te,T=te.to):T=te;const N=Ne(_t.from,L,q,K,Zs,me),B=_t.ease||E,R=Ne(B,L,q,K,null,me),X=Ee(R)||Be(R)?R:B,j=!D(X)&&!D(X.ease),se=j?X.ease:X,be=j?X.settlingDuration:Ne(U(_t.duration,ke>1?Ne(O,L,q,K,null,me)/ke:O),L,q,K,null,me),Ae=Ne(U(_t.delay,ae?0:P),L,q,K,null,me),Oe=_t.modifier||A,Yt=!D(N),Es=!D(T),Nt=$e(T),Kc=Nt||Yt&&Es,jc=ce?ie:0,pi=ce?ie+Ae:Ae,gi=F(H+pi,12),eu=F(H+jc,12);!M&&(Yt||Nt)&&(M=1);let ut=ce;if(Te!==He.none){let _e=J._head;for(;_e&&_e._absoluteStartTime<=gi;)if(_e._isOverridden||(ut=_e),_e=_e._nextRep,_e&&_e._absoluteStartTime>=gi)for(;_e;)Ws(_e),_e=_e._nextRep}if(Kc){Je(Nt?Ne(T[0],L,q,K,Zs,me):N,ne),Je(Nt?Ne(T[1],L,q,K,Gs,me):T,fe);const _e=Ut(L,ge,Y,ts);ne.t===pe.NUMBER&&(ut?ut._valueType===pe.UNIT&&(ne.t=pe.UNIT,ne.u=ut._unit):(Je(_e,Fe),Fe.t===pe.UNIT&&(ne.t=pe.UNIT,ne.u=Fe.u)))}else Es?Je(T,fe):ce?dn(ce,fe):Je(s&&ut&&ut.parent.parent===s?ut._value:Ut(L,ge,Y,ts),fe),Yt?Je(N,ne):ce?dn(ce,ne):Je(s&&ut&&ut.parent.parent===s?ut._value:Ut(L,ge,Y,ts),ne);if(ne.o&&(ne.n=Wt(ut?ut._toNumber:Je(Ut(L,ge,Y,ts),Fe).n,ne.n,ne.o)),fe.o&&(fe.n=Wt(ne.n,fe.n,fe.o)),ne.t!==fe.t){if(ne.t===pe.COMPLEX||fe.t===pe.COMPLEX){const _e=ne.t===pe.COMPLEX?ne:fe,Ze=ne.t===pe.COMPLEX?fe:ne;Ze.t=pe.COMPLEX,Ze.s=Ue(_e.s),Ze.d=_e.d.map(()=>Ze.n)}else if(ne.t===pe.UNIT||fe.t===pe.UNIT){const _e=ne.t===pe.UNIT?ne:fe,Ze=ne.t===pe.UNIT?fe:ne;Ze.t=pe.UNIT,Ze.u=_e.u}else if(ne.t===pe.COLOR||fe.t===pe.COLOR){const _e=ne.t===pe.COLOR?ne:fe,Ze=ne.t===pe.COLOR?fe:ne;Ze.t=pe.COLOR,Ze.d=_e.d.map(()=>0)}}if(ne.u!==fe.u){let _e=fe.u?ne:fe;_e=Xs(L,_e,fe.u?fe.u:ne.u,!1)}if(fe.d&&ne.d&&fe.d.length!==ne.d.length){const _e=ne.d.length>fe.d.length?ne:fe,Ze=_e===ne?fe:ne;Ze.d=_e.d.map((lu,Mo)=>D(Ze.d[Mo])?0:Ze.d[Mo]),Ze.s=Ue(_e.s)}const mi=F(+be||1e-11,12);let Io=ts[ge];qt(Io)||(ts[ge]=null);const tu=re?re.set:null;ie=F(pi+mi,12);const gr=ne.d,Oo=fe.d,No=fe.s,it={parent:this,id:rc++,property:ge,target:L,_value:null,_toFunc:Gs.func,_fromFunc:Zs.func,_ease:xt(se),_fromNumbers:gr?Ue(gr):Ds,_toNumbers:Oo?Ue(Oo):Ds,_strings:No?Ue(No):Ds,_fromNumber:ne.n,_toNumber:fe.n,_numbers:gr?Ue(gr):Ds,_number:ne.n,_unit:fe.u,_modifier:Oe,_currentTime:0,_startTime:pi,_delay:+Ae,_updateDuration:mi,_changeDuration:mi,_absoluteStartTime:gi,_absoluteUpdateStartTime:eu,_absoluteEndTime:F(H+ie,12),_hasFromValue:Yt||Nt?1:0,_tweenType:Y,_setter:tu,_valueType:fe.t,_composition:Te,_isOverlapped:0,_isOverridden:0,_renderTransforms:0,_inlineValue:Io,_prevRep:null,_nextRep:null,_prevAdd:null,_nextAdd:null,_prev:null,_next:null};Te!==He.none&&bn(it,J);const vi=it._valueType;if(vi===pe.COMPLEX)it._value=fn(it,1,-1);else if(vi===pe.UNIT)it._value=`${Oe(it._toNumber)}${it._unit}`;else if(vi===pe.COLOR){const _e=fe.d;it._value=`rgba(${F(_e[0],0)},${F(_e[1],0)},${F(_e[2],0)},${_e[3]})`}else it._value=Oe(it._toNumber);isNaN(de)&&(de=it._startTime),ce=it,x++,mt(this,it)}(isNaN(V)||de<V)&&(V=de),(isNaN($)||ie>$)&&($=ie),Y===Le.TRANSFORM&&(G=x-ae,W=x)}if(!isNaN(G)){let ee=0;Se(this,Y=>{ee>=G&&ee<W&&(Y._renderTransforms=1,Y._composition===He.blend&&Se(es.animation,re=>{re.id===Y.id&&(re._renderTransforms=1)})),ee++})}}h||console.warn("No target found. Make sure the element you're trying to animate is accessible before creating your animation."),V?(Se(this,I=>{I._startTime-I._delay||(I._delay-=V),I._startTime-=V}),$-=V):V=0,$||($=Re,this.iterationCount=0),this.targets=a,this.id=D(l)?An:l,this.duration=$===1e-11?Re:Fs(($+this._loopDelay)*this.iterationCount-this._loopDelay)||1e-11,this.onRender=S||y.onRender,this._ease=k,this._delay=V,this.iterationDuration=$,!this._autoplay&&M&&this.onRender(this)}stretch(e){const t=this.duration;if(t===jt(e))return this;const s=e/t;return Se(this,r=>{r._updateDuration=jt(r._updateDuration*s),r._changeDuration=jt(r._changeDuration*s),r._currentTime*=s,r._delay*=s,r._startTime*=s,r._absoluteStartTime*=s,r._absoluteUpdateStartTime*=s,r._absoluteEndTime*=s}),super.stretch(e)}refresh(){return Se(this,e=>{const t=e._toFunc,s=e._fromFunc;(t||s)&&(s?(Je(s(),ne),ne.u!==e._unit&&e.target[Ht]&&Xs(e.target,ne,e._unit,!0),e._fromNumbers=Ue(ne.d),e._fromNumber=ne.n):t&&(Je(Ut(e.target,e.property,e._tweenType),Fe),e._fromNumbers=Ue(Fe.d),e._fromNumber=Fe.n),t&&(Je(t(),fe),e._toNumbers=Ue(fe.d),e._strings=Ue(fe.s),e._toNumber=fe.o?Wt(e._fromNumber,fe.n,fe.o):fe.n))}),this.duration===1e-11&&this.restart(),this}revert(){return super.revert(),zs(this)}then(e){return super.then(e)}},gs=(e,t)=>z.editor?z.editor.addAnimation(e,t):new Tt(e,t,null,0,!1).init(),nc=(e,t)=>{if(Me(t,"<")){const s=t[1]==="<",r=e._tail,i=r?r._offset+r._delay:0;return s?i:i+r.duration}},ms=(e,t)=>{let s=e.iterationDuration;if(s===1e-11&&(s=0),D(t))return s;if(qe(+t))return+t;const r=t,i=e?e.labels:null,n=!qt(i),o=nc(e,r),a=!D(o),h=tn.exec(r);if(h){const u=h[0],f=r.split(u),l=n&&f[0]?i[f[0]]:s,d=a?o:n?l:s,c=+f[1];return Wt(d,c,u[0])}else return a?o:n?D(i[r])?s:i[r]:s};function oc(e){return Fs((e.iterationDuration+e._loopDelay)*e.iterationCount-e._loopDelay)||1e-11}function Yr(e,t,s,r,i,n){const o=qe(e.duration)&&e.duration<=1e-11?s-Re:s;t.composition&&Xt(t,o,1,1,et.AUTO);const a=r?new Tt(r,e,t,o,!1,i,n):new tt(e,t,o);return t.composition&&a.init(!0),mt(t,a),Se(t,h=>{const u=h._offset+h._delay+h.duration;u>t.iterationDuration&&(t.iterationDuration=u)}),t.duration=oc(t),t}var Ln=0,Rn=class extends tt{constructor(e={}){super(e,null,0),++Ln,this.id=D(e.id)?Ln:e.id,this.duration=0,this.labels={};const t=e.defaults,s=z.defaults;this.defaults=t?at(t,s):s,this.composition=U(e.composition,!0),this.onRender=e.onRender||s.onRender;const r=U(e.playbackEase,s.playbackEase);this._ease=r?xt(r):null,this.iterationDuration=0}add(e,t,s){const r=De(t),i=De(e);if(r||i){if(this._hasChildren=!0,r){const n=t,o=z.editor&&z.editor.addTimelineChild,a=s&&s.type==="Stagger"&&z.editor,h=Ee(s)?s:null;if(h||a){const u=st(e),f=this.duration,l=this.iterationDuration,d=n.id;let c=0;const p=u.length,g=o?o(e,n,this.id,s,p):null,v=h||z.editor.resolveStagger(s.defaultValue);u.forEach(_=>{const S={...g||n};this.duration=f,this.iterationDuration=l,D(d)||(S.id=d+"-"+c);const y=ms(this,v(_,c,u,null,this));Yr(S,this,y,_,c,u),c++})}else{const u=o?o(e,n,this.id,s):n,f=s&&s.type?s.defaultValue:s;Yr(u,this,ms(this,f),e)}}else Yr(e,this,ms(this,t));return this.composition&&this.init(!0),this}}sync(e,t){if(D(e)||e&&D(e.pause))return this;e.pause();const s=+(e.effect?e.effect.getTiming().duration:e.duration);!D(e)&&!D(e.persist)&&(e.persist=!0);const r=z.editor,i=r&&r.addTimelineChild;r&&r.addTimelineSync&&(t=r.addTimelineSync(e,t,this.id),r.addTimelineChild=null);const n=this.add(e,{currentTime:[0,s],duration:s,delay:0,ease:"linear",playbackEase:"linear"},t);return r&&(r.addTimelineChild=i),n}set(e,t,s){return D(t)?this:(t.duration=Re,t.composition=He.replace,this.add(e,t,s))}call(e,t){return D(e)||e&&!Ee(e)?this:(z.editor&&z.editor.addTimelineCall&&(t=z.editor.addTimelineCall(e,t,this.id)),this.add({duration:0,delay:0,onComplete:()=>e(this)},t))}label(e,t){return D(e)||e&&!Be(e)?this:(z.editor&&z.editor.addTimelineLabel&&(t=z.editor.addTimelineLabel(e,t,this.id)),this.labels[e]=ms(this,t),this)}remove(e,t){return kt(st(e),this,t),this}stretch(e){const t=this.duration;if(t===jt(e))return this;const s=e/t,r=this.labels;Se(this,i=>i.stretch(i.duration*s));for(let i in r)r[i]*=s;return super.stretch(e)}refresh(){return Se(this,e=>{e.refresh&&e.refresh()}),this}revert(){return super.revert(),Se(this,e=>e.revert,!0),zs(this)}then(e){return super.then(e)}},In=e=>z.editor?z.editor.addTimeline(e):new Rn(e).init(),Gr=class{constructor(e,t){Ie.current&&Ie.current.register(this);const s=()=>{this.callbacks.completed&&this.callbacks.reset(),this.callbacks.play()},r=()=>{if(this.callbacks.completed)return;let a=!0;for(let h in this.animations)if(!this.animations[h].paused&&a){a=!1;break}a&&this.callbacks.complete()},i={onBegin:s,onComplete:r,onPause:r},n={v:1,autoplay:!1},o={};if(this.targets=[],this.animations={},this.callbacks=null,!(D(e)||D(t))){for(let a in t){const h=t[a];Jt(a)?o[a]=h:Me(a,"on")?n[a]=h:i[a]=h}this.callbacks=new Tt({v:0},n);for(let a in o){const h=o[a],u=De(h);let f={},l="+=0";if(u){const p=h.unit;Be(p)&&(l+=p)}else f.duration=h;f[a]=u?at({to:l},h):l;const d=at(i,f);d.composition=He.replace,d.autoplay=!1;const c=this.animations[a]=new Tt(e,d,null,0,!1).init();this.targets.length||this.targets.push(...c.targets),this[a]=(p,g,v)=>{const _=c._head;if(D(p)&&_){const S=_._numbers;return S&&S.length?S:_._modifier(_._number)}else return Se(c,S=>{if($e(p))for(let y=0,m=p.length;y<m;y++)D(S._numbers[y])||(S._fromNumbers[y]=S._modifier(S._numbers[y]),S._toNumbers[y]=p[y]);else S._fromNumber=S._modifier(S._number),S._toNumber=p;D(v)||(S._ease=xt(v)),S._currentTime=0}),D(g)||c.stretch(g),c.reset(!0).resume(),this}}}}revert(){for(let e in this.animations)this[e]=oe,this.animations[e].revert();return this.animations={},this.targets.length=0,this.callbacks&&this.callbacks.revert(),this}},ac=(e,t)=>new Gr(e,t),lc=Gt({clamp:()=>Z,damp:()=>gc,degToRad:()=>fc,lerp:()=>At,mapRange:()=>vs,padEnd:()=>hc,padStart:()=>uc,radToDeg:()=>pc,round:()=>F,roundPad:()=>cc,snap:()=>zt,wrap:()=>dc}),cc=(e,t)=>(+e).toFixed(t),uc=(e,t,s)=>`${e}`.padStart(t,s),hc=(e,t,s)=>`${e}`.padEnd(t,s),dc=(e,t,s)=>((e-t)%(s-t)+(s-t))%(s-t)+t,vs=(e,t,s,r,i)=>r+(e-t)/(s-t)*(i-r),fc=e=>e*Math.PI/180,pc=e=>e*180/Math.PI,gc=(e,t,s,r)=>r?r===1?t:At(e,t,1-Math.exp(-r*s*.1)):e,Ke=Ye*10,Ks=class{constructor(e={}){const t=!D(e.bounce)||!D(e.duration);this.timeStep=.02,this.restThreshold=5e-4,this.restDuration=200,this.maxDuration=6e4,this.maxRestSteps=this.restDuration/this.timeStep/Ye,this.maxIterations=this.maxDuration/this.timeStep/Ye,this.bn=Z(U(e.bounce,.5),-1,1),this.pd=Z(U(e.duration,628),10*z.timeScale,Ke*z.timeScale),this.m=Z(U(e.mass,1),1,Ke),this.s=Z(U(e.stiffness,100),Re,Ke),this.d=Z(U(e.damping,10),Re,Ke),this.v=Z(U(e.velocity,0),-Ke,Ke),this.w0=0,this.zeta=0,this.wd=0,this.b=0,this.completed=!1,this.solverDuration=0,this.settlingDuration=0,this.parent=null,this.onComplete=e.onComplete||oe,t&&this.calculateSDFromBD(),this.compute(),this.ease=s=>{const r=s*this.settlingDuration,i=this.completed,n=this.pd;return r>=n&&!i&&(this.completed=!0,this.onComplete(this.parent)),r<n&&i&&(this.completed=!1),s===0||s===1?s:this.solve(s*this.solverDuration)}}solve(e){const{zeta:t,w0:s,wd:r,b:i}=this;let n=e;return t<1?n=$s(-n*t*s)*(1*Mr(r*n)+i*Nr(r*n)):t===1?n=(1+i*n)*$s(-n*s):n=((1+i)*$s((-t*s+r)*n)+(1-i)*$s((-t*s-r)*n))/2,1-n}calculateSDFromBD(){const e=z.timeScale===1?this.pd/Ye:this.pd;this.m=1,this.v=0,this.s=Vt(2*bt/e,2),this.bn>=0?this.d=(1-this.bn)*4*bt/e:this.d=4*bt/(e*(1+this.bn)),this.s=F(Z(this.s,Re,Ke),3),this.d=F(Z(this.d,Re,300),3)}calculateBDFromSD(){const e=2*bt/nt(this.s);this.pd=e*(z.timeScale===1?Ye:1),this.d/(2*nt(this.s))<=1?this.bn=1-this.d*e/(4*bt):this.bn=4*bt/(this.d*e)-1,this.bn=F(Z(this.bn,-1,1),3),this.pd=F(Z(this.pd,10*z.timeScale,Ke*z.timeScale),3)}compute(){const{maxRestSteps:e,maxIterations:t,restThreshold:s,timeStep:r,m:i,d:n,s:o,v:a}=this,h=this.w0=Z(nt(o/i),Re,Ye),u=this.zeta=n/(2*nt(o*i));u<1?(this.wd=h*nt(1-u*u),this.b=(u*h+-a)/this.wd):u===1?(this.wd=0,this.b=-a+h):(this.wd=h*nt(u*u-1),this.b=(u*h+-a)/this.wd);let f=0,l=0,d=0;for(;l<=e&&d<=t;)ot(1-this.solve(f))<s?l++:l=0,this.solverDuration=f,f+=r,d++;this.settlingDuration=F(this.solverDuration*Ye,0)*z.timeScale}get bounce(){return this.bn}set bounce(e){this.bn=Z(U(e,1),-1,1),this.calculateSDFromBD(),this.compute()}get duration(){return this.pd}set duration(e){this.pd=Z(U(e,1),10*z.timeScale,Ke*z.timeScale),this.calculateSDFromBD(),this.compute()}get stiffness(){return this.s}set stiffness(e){this.s=Z(U(e,100),Re,Ke),this.calculateBDFromSD(),this.compute()}get damping(){return this.d}set damping(e){this.d=Z(U(e,10),Re,Ke),this.calculateBDFromSD(),this.compute()}get mass(){return this.m}set mass(e){this.m=Z(U(e,1),1,Ke),this.compute()}get velocity(){return this.v}set velocity(e){this.v=Z(U(e,0),-Ke,Ke),this.compute()}},js=e=>new Ks(e),On=e=>(console.warn("createSpring() is deprecated use spring() instead"),new Ks(e)),Zr={_head:null,_tail:null},Qr=(e,t,s)=>{let r=Zr._head,i;for(;r;){const n=r._next,o=r.$el===e,a=!t||r.property===t,h=!s||r.parent===s;if(o&&a&&h){i=r.animation;try{i.commitStyles()}catch{}i.cancel(),gt(Zr,r);const u=r.parent;u&&(u._completed++,u.animations.length===u._completed&&(u.completed=!0,u.paused=!0,u.muteCallbacks||(u.onComplete(u),u._resolve(u))))}r=n}return i},Nn=(e,t,s,r,i)=>{const n=t.animate(r,i),o=i.delay+ +i.duration*i.iterations;n.playbackRate=e._speed,e.paused&&n.pause(),e.duration<o&&(e.duration=o,e.controlAnimation=n),e.animations.push(n),Qr(t,s),mt(Zr,{parent:e,animation:n,$el:t,property:s,_next:null,_prev:null});const a=()=>Qr(t,s,e);return n.oncancel=a,n.onremove=a,e.persist||(n.onfinish=a),n};function It(e,t,s){const r=Lt(e);if(!r.length)return;const[i]=r,n=$r(i,t),o=Fr(t,i,n);let a=Ut(i,o);if(D(s))return a;if(Je(a,Fe),Fe.t===pe.NUMBER||Fe.t===pe.UNIT){if(s===!1)return Fe.n;{const h=Xs(i,Fe,s,!1);return`${F(h.n,z.precision)}${h.u}`}}}var Ct=(e,t)=>{if(!D(t))return z.editor&&z.editor.addSet?z.editor.addSet(e,t):(t.duration=Re,t.composition=U(t.composition,He.none),new Tt(e,t,null,0,!0).resume())},Mn=(e,t,s)=>{const r=st(e);for(let i=0,n=r.length;i<n;i++)Qr(r[i],s,t&&t.controlAnimation&&t);return kt(r,t,s),r},Ot=e=>{e.cancelable&&e.preventDefault()},mc=class{constructor(e){this.el=e,this.zIndex=0,this.parentElement=null,this.classList={add:oe,remove:oe}}get x(){return this.el.x||0}set x(e){this.el.x=e}get y(){return this.el.y||0}set y(e){this.el.y=e}get width(){return this.el.width||0}set width(e){this.el.width=e}get height(){return this.el.height||0}set height(e){this.el.height=e}getBoundingClientRect(){return{top:this.y,right:this.x,bottom:this.y+this.height,left:this.x+this.width}}},vc=class{constructor(e){this.$el=e,this.inlineTransforms=[],this.point=new DOMPoint,this.inversedMatrix=this.getMatrix().inverse()}normalizePoint(e,t){return this.point.x=e,this.point.y=t,this.point.matrixTransform(this.inversedMatrix)}traverseUp(e){let t=this.$el.parentElement,s=0;for(;t&&t!==Q;)e(t,s),t=t.parentElement,s++}getMatrix(){const e=new DOMMatrix;return this.traverseUp(t=>{const s=getComputedStyle(t).transform;if(s){const r=new DOMMatrix(s);e.preMultiplySelf(r)}}),e}remove(){this.traverseUp((e,t)=>{this.inlineTransforms[t]=e.style.transform,e.style.transform="none"})}revert(){this.traverseUp((e,t)=>{const s=this.inlineTransforms[t];s===""?e.style.removeProperty("transform"):e.style.transform=s})}},Ge=(e,t)=>e&&Ee(e)?e(t):e,er=0,Dn=class{constructor(e,t={}){if(!e)return;Ie.current&&Ie.current.register(this);const s=t.x,r=t.y,i=t.trigger,n=t.modifier,o=t.releaseEase,a=o&&xt(o),h=!D(o)&&!D(o.ease),u=De(s)&&!D(s.mapTo)?s.mapTo:"translateX",f=De(r)&&!D(r.mapTo)?r.mapTo:"translateY",l=Ge(t.container,this);this.containerArray=$e(l)?l:null,this.$container=l&&!this.containerArray?st(l)[0]:Q.body,this.useWin=this.$container===Q.body,this.$scrollContainer=this.useWin?Xe:this.$container,this.$target=De(e)?new mc(e):st(e)[0],this.$trigger=st(i||e)[0],this.fixed=It(this.$target,"position")==="fixed",this.isFinePointer=!0,this.containerPadding=[0,0,0,0],this.containerFriction=0,this.releaseContainerFriction=0,this.snapX=0,this.snapY=0,this.scrollSpeed=0,this.scrollThreshold=0,this.dragSpeed=0,this.dragThreshold=3,this.maxVelocity=0,this.minVelocity=0,this.velocityMultiplier=0,this.cursor=!1,this.releaseXSpring=h?o:js({mass:U(t.releaseMass,1),stiffness:U(t.releaseStiffness,80),damping:U(t.releaseDamping,20)}),this.releaseYSpring=h?o:js({mass:U(t.releaseMass,1),stiffness:U(t.releaseStiffness,80),damping:U(t.releaseDamping,20)}),this.releaseEase=a||wt.outQuint,this.hasReleaseSpring=h,this.onGrab=t.onGrab||oe,this.onDrag=t.onDrag||oe,this.onRelease=t.onRelease||oe,this.onUpdate=t.onUpdate||oe,this.onSettle=t.onSettle||oe,this.onSnap=t.onSnap||oe,this.onResize=t.onResize||oe,this.onAfterResize=t.onAfterResize||oe,this.disabled=[0,0];const d={};if(n&&(d.modifier=n),D(s)||s===!0)d[u]=0;else if(De(s)){const c=s,p={};c.modifier&&(p.modifier=c.modifier),c.composition&&(p.composition=c.composition),d[u]=p}else s===!1&&(d[u]=0,this.disabled[0]=1);if(D(r)||r===!0)d[f]=0;else if(De(r)){const c=r,p={};c.modifier&&(p.modifier=c.modifier),c.composition&&(p.composition=c.composition),d[f]=p}else r===!1&&(d[f]=0,this.disabled[1]=1);this.animate=new Gr(this.$target,d),this.xProp=u,this.yProp=f,this.destX=0,this.destY=0,this.deltaX=0,this.deltaY=0,this.scroll={x:0,y:0},this.coords=[this.x,this.y,0,0],this.snapped=[0,0],this.pointer=[0,0,0,0,0,0,0,0],this.scrollView=[0,0],this.dragArea=[0,0,0,0],this.containerBounds=[-pt,pt,pt,-pt],this.scrollBounds=[0,0,0,0],this.targetBounds=[0,0,0,0],this.window=[0,0],this.velocityStack=[0,0,0],this.velocityStackIndex=0,this.velocityTime=Et(),this.velocity=0,this.angle=0,this.cursorStyles=null,this.triggerStyles=null,this.bodyStyles=null,this.targetStyles=null,this.touchActionStyles=null,this.transforms=new vc(this.$target),this.overshootCoords={x:0,y:0},this.overshootTicker=new tt({autoplay:!1,onUpdate:()=>{this.updated=!0,this.manual=!0,this.disabled[0]||this.animate[this.xProp](this.overshootCoords.x,1),this.disabled[1]||this.animate[this.yProp](this.overshootCoords.y,1)},onComplete:()=>{this.manual=!1,this.disabled[0]||this.animate[this.xProp](this.overshootCoords.x,0),this.disabled[1]||this.animate[this.yProp](this.overshootCoords.y,0)}},null,0).init(),this.updateTicker=new tt({autoplay:!1,onUpdate:()=>this.update()},null,0).init(),this.contained=!D(l),this.manual=!1,this.grabbed=!1,this.dragged=!1,this.updated=!1,this.released=!1,this.canScroll=!1,this.enabled=!1,this.initialized=!1,this.activeProp=this.disabled[1]?u:f,this.animate.callbacks.onRender=()=>{const c=this.updated,p=!(this.grabbed&&c)&&this.released,g=this.x,v=this.y,_=g-this.coords[2],S=v-this.coords[3];this.deltaX=_,this.deltaY=S,this.coords[2]=g,this.coords[3]=v,c&&(_||S)&&this.onUpdate(this),p?(this.computeVelocity(_,S),this.angle=qs(S,_)):this.updated=!1},this.animate.callbacks.onComplete=()=>{!this.grabbed&&this.released&&(this.released=!1),this.manual||(this.deltaX=0,this.deltaY=0,this.velocity=0,this.velocityStack[0]=0,this.velocityStack[1]=0,this.velocityStack[2]=0,this.velocityStackIndex=0,this.onSettle(this))},this.resizeTicker=new tt({autoplay:!1,duration:150*z.timeScale,onComplete:()=>{this.onResize(this),this.refresh(),this.onAfterResize(this)}}).init(),this.parameters=t,this.resizeObserver=new ResizeObserver(()=>{this.initialized?this.resizeTicker.restart():this.initialized=!0}),this.enable(),this.refresh(),this.resizeObserver.observe(this.$container),De(e)||this.resizeObserver.observe(this.$target)}computeVelocity(e,t){const s=this.velocityTime,r=Et(),i=r-s;if(i<17)return this.velocity;this.velocityTime=r;const n=this.velocityStack,o=this.velocityMultiplier,a=this.minVelocity,h=this.maxVelocity,u=this.velocityStackIndex;n[u]=F(Z(nt(e*e+t*t)/i*o,a,h),5);const f=an(n[0],n[1],n[2]);return this.velocity=f,this.velocityStackIndex=(u+1)%3,f}setX(e,t=!1){if(this.disabled[0])return;const s=F(e,5);return this.overshootTicker.pause(),this.manual=!0,this.updated=!t,this.destX=s,this.snapped[0]=zt(s,this.snapX),this.animate[this.xProp](s,0),this.manual=!1,this}setY(e,t=!1){if(this.disabled[1])return;const s=F(e,5);return this.overshootTicker.pause(),this.manual=!0,this.updated=!t,this.destY=s,this.snapped[1]=zt(s,this.snapY),this.animate[this.yProp](s,0),this.manual=!1,this}get x(){return F(this.animate[this.xProp](),z.precision)}set x(e){this.setX(e,!1)}get y(){return F(this.animate[this.yProp](),z.precision)}set y(e){this.setY(e,!1)}get progressX(){return vs(this.x,this.containerBounds[3],this.containerBounds[1],0,1)}set progressX(e){this.setX(vs(e,0,1,this.containerBounds[3],this.containerBounds[1]),!1)}get progressY(){return vs(this.y,this.containerBounds[0],this.containerBounds[2],0,1)}set progressY(e){this.setY(vs(e,0,1,this.containerBounds[0],this.containerBounds[2]),!1)}updateScrollCoords(){const e=F(this.useWin?Xe.scrollX:this.$container.scrollLeft,0),t=F(this.useWin?Xe.scrollY:this.$container.scrollTop,0),[s,r,i,n]=this.containerPadding,o=this.scrollThreshold;this.scroll.x=e,this.scroll.y=t,this.scrollBounds[0]=t-this.targetBounds[0]+s-o,this.scrollBounds[1]=e-this.targetBounds[1]-r+o,this.scrollBounds[2]=t-this.targetBounds[2]-i+o,this.scrollBounds[3]=e-this.targetBounds[3]+n-o}updateBoundingValues(){const e=this.$container;if(!e)return;const t=this.x,s=this.y,r=this.coords[2],i=this.coords[3];this.coords[2]=0,this.coords[3]=0,this.setX(0,!0),this.setY(0,!0),this.transforms.remove();const n=this.window[0]=Xe.innerWidth,o=this.window[1]=Xe.innerHeight,a=this.useWin,h=e.scrollWidth,u=e.scrollHeight,f=this.fixed,l=e.getBoundingClientRect(),[d,c,p,g]=this.containerPadding;this.dragArea[0]=a?0:l.left,this.dragArea[1]=a?0:l.top,this.scrollView[0]=a?Z(h,n,h):h,this.scrollView[1]=a?Z(u,o,u):u,this.updateScrollCoords();const{width:v,height:_,left:S,top:y,right:m,bottom:b}=e.getBoundingClientRect();this.dragArea[2]=F(a?Z(v,n,n):v,0),this.dragArea[3]=F(a?Z(_,o,o):_,0);const k=It(e,"overflow"),w=k==="visible",E=k==="hidden";if(this.canScroll=f?!1:this.contained&&(e===Q.body&&w||!E&&!w)&&(h>this.dragArea[2]+g-c||u>this.dragArea[3]+d-p)&&(!this.containerArray||this.containerArray&&!$e(this.containerArray)),this.contained){const O=this.scroll.x,P=this.scroll.y,A=this.canScroll,C=this.$target.getBoundingClientRect(),H=A?a?0:e.scrollLeft:0,$=A?a?0:e.scrollTop:0,V=A?this.scrollView[0]-H-v:0,x=A?this.scrollView[1]-$-_:0;this.targetBounds[0]=F(C.top+P-(a?0:y),0),this.targetBounds[1]=F(C.right+O-(a?n:m),0),this.targetBounds[2]=F(C.bottom+P-(a?o:b),0),this.targetBounds[3]=F(C.left+O-(a?0:S),0),this.containerArray?(this.containerBounds[0]=this.containerArray[0]+d,this.containerBounds[1]=this.containerArray[1]-c,this.containerBounds[2]=this.containerArray[2]-p,this.containerBounds[3]=this.containerArray[3]+g):(this.containerBounds[0]=-F(C.top-(f?Z(y,0,o):y)+$-d,0),this.containerBounds[1]=-F(C.right-(f?Z(m,0,n):m)-V+c,0),this.containerBounds[2]=-F(C.bottom-(f?Z(b,0,o):b)-x+p,0),this.containerBounds[3]=-F(C.left-(f?Z(S,0,n):S)+H-g,0))}this.transforms.revert(),this.coords[2]=r,this.coords[3]=i,this.setX(t,!0),this.setY(s,!0)}isOutOfBounds(e,t,s){if(!this.contained)return 0;const[r,i,n,o]=e,[a,h]=this.disabled,u=!a&&t<o||!a&&t>i,f=!h&&s<r||!h&&s>n;return u&&!f?1:!u&&f?2:u&&f?3:0}refresh(){const e=this.parameters,t=e.x,s=e.y,r=Ge(e.container,this),i=Ge(e.containerPadding,this)||0,n=$e(i)?i:[i,i,i,i],o=this.x,a=this.y,h=Ge(e.cursor,this),u={onHover:"grab",onGrab:"grabbing"};if(h){const{onHover:v,onGrab:_}=h;v&&(u.onHover=v),_&&(u.onGrab=_)}const f=Ge(e.dragThreshold,this),l={mouse:3,touch:7};if(qe(f))l.mouse=f,l.touch=f;else if(f){const{mouse:v,touch:_}=f;D(v)||(l.mouse=v),D(_)||(l.touch=_)}this.containerArray=$e(r)?r:null,this.$container=r&&!this.containerArray?st(r)[0]:Q.body,this.useWin=this.$container===Q.body,this.$scrollContainer=this.useWin?Xe:this.$container,this.isFinePointer=matchMedia("(pointer:fine)").matches,this.containerPadding=U(n,[0,0,0,0]),this.containerFriction=Z(U(Ge(e.containerFriction,this),.8),0,1),this.releaseContainerFriction=Z(U(Ge(e.releaseContainerFriction,this),this.containerFriction),0,1),this.snapX=Ge(De(t)&&!D(t.snap)?t.snap:e.snap,this),this.snapY=Ge(De(s)&&!D(s.snap)?s.snap:e.snap,this),this.scrollSpeed=U(Ge(e.scrollSpeed,this),1.5),this.scrollThreshold=U(Ge(e.scrollThreshold,this),20),this.dragSpeed=U(Ge(e.dragSpeed,this),1),this.dragThreshold=this.isFinePointer?l.mouse:l.touch,this.minVelocity=U(Ge(e.minVelocity,this),0),this.maxVelocity=U(Ge(e.maxVelocity,this),50),this.velocityMultiplier=U(Ge(e.velocityMultiplier,this),1),this.cursor=h===!1?!1:u,this.updateBoundingValues();const[d,c,p,g]=this.containerBounds;this.setX(Z(o,g,c),!0),this.setY(Z(a,d,p),!0)}update(){if(this.updateScrollCoords(),this.canScroll){const[_,S,y,m]=this.containerPadding,[b,k]=this.scrollView,w=this.dragArea[2],E=this.dragArea[3],O=this.scroll.x,P=this.scroll.y,A=this.$container.scrollWidth,C=this.$container.scrollHeight,H=this.useWin?Z(A,this.window[0],A):A,$=this.useWin?Z(C,this.window[1],C):C,V=b-H,x=k-$;this.dragged&&V>0&&(this.coords[0]-=V,this.scrollView[0]=H),this.dragged&&x>0&&(this.coords[1]-=x,this.scrollView[1]=$);const M=this.scrollSpeed*10,I=this.scrollThreshold,[L,q]=this.coords,[K,G,W,ee]=this.scrollBounds,Y=F(Z((q-K+_)/I,-1,0)*M,0),re=F(Z((L-G-S)/I,0,1)*M,0),ge=F(Z((q-W-y)/I,0,1)*M,0),he=F(Z((L-ee+m)/I,-1,0)*M,0);if(Y||ge||he||re){const[le,J]=this.disabled;let ce=O,de=P;le||(ce=F(Z(O+(he||re),0,b-w),0),this.coords[0]-=O-ce),J||(de=F(Z(P+(Y||ge),0,k-E),0),this.coords[1]-=P-de),this.useWin?this.$scrollContainer.scrollBy(-(O-ce),-(P-de)):this.$scrollContainer.scrollTo(ce,de)}}const[e,t,s,r]=this.containerBounds,[i,n,o,a,h,u]=this.pointer;this.coords[0]+=(i-h)*this.dragSpeed,this.coords[1]+=(n-u)*this.dragSpeed,this.pointer[4]=i,this.pointer[5]=n;const[f,l]=this.coords,[d,c]=this.snapped,p=(1-this.containerFriction)*this.dragSpeed;this.setX(f>t?t+(f-t)*p:f<r?r+(f-r)*p:f,!1),this.setY(l>s?s+(l-s)*p:l<e?e+(l-e)*p:l,!1),this.computeVelocity(i-h,n-u),this.angle=qs(n-a,i-o);const[g,v]=this.snapped;(g!==d&&this.snapX||v!==c&&this.snapY)&&this.onSnap(this)}stop(){this.updateTicker.pause(),this.overshootTicker.pause();for(let e in this.animate.animations)this.animate.animations[e].pause();return kt([this],null,"x"),kt([this],null,"y"),kt([this],null,"progressX"),kt([this],null,"progressY"),kt([this.scroll]),kt([this.overshootCoords]),this}scrollInView(e,t=0,s=wt.inOutQuad){this.updateScrollCoords();const r=this.destX,i=this.destY,n=this.scroll,o=this.scrollBounds,a=this.canScroll;if(!this.containerArray&&this.isOutOfBounds(o,r,i)){const[h,u,f,l]=o,d=F(Z(i-h,-pt,0),0),c=F(Z(r-u,0,pt),0),p=F(Z(i-f,0,pt),0),g=F(Z(r-l,-pt,0),0);new Tt(n,{x:F(n.x+(g?g-t:c?c+t:0),0),y:F(n.y+(d?d-t:p?p+t:0),0),duration:D(e)?350*z.timeScale:e,ease:s,onUpdate:()=>{this.canScroll=!1,this.$scrollContainer.scrollTo(n.x,n.y)}}).init().then(()=>{this.canScroll=a})}return this}handleHover(){this.isFinePointer&&this.cursor&&!this.cursorStyles&&(this.cursorStyles=Ct(this.$trigger,{cursor:this.cursor.onHover}))}animateInView(e,t=0,s=wt.inOutQuad){this.stop(),this.updateBoundingValues();const r=this.x,i=this.y,[n,o,a,h]=this.containerPadding,u=this.scroll.y-this.targetBounds[0]+n+t,f=this.scroll.x-this.targetBounds[1]-o-t,l=this.scroll.y-this.targetBounds[2]-a-t,d=this.scroll.x-this.targetBounds[3]+h+t,c=this.isOutOfBounds([u,f,l,d],r,i);if(c){const[p,g]=this.disabled,v=Z(zt(r,this.snapX),d,f),_=Z(zt(i,this.snapY),u,l),S=D(e)?350*z.timeScale:e;!p&&(c===1||c===3)&&this.animate[this.xProp](v,S,s),!g&&(c===2||c===3)&&this.animate[this.yProp](_,S,s)}return this}handleDown(e){const t=e.target;if(this.grabbed||t.type==="range")return;e.stopPropagation(),this.grabbed=!0,this.released=!1,this.stop(),this.updateBoundingValues();const s=e.changedTouches,r=s?s[0].clientX:e.clientX,i=s?s[0].clientY:e.clientY,{x:n,y:o}=this.transforms.normalizePoint(r,i),[a,h,u,f]=this.containerBounds,l=(1-this.containerFriction)*this.dragSpeed,d=this.x,c=this.y;this.coords[0]=this.coords[2]=l?d>h?h+(d-h)/l:d<f?f+(d-f)/l:d:d,this.coords[1]=this.coords[3]=l?c>u?u+(c-u)/l:c<a?a+(c-a)/l:c:c,this.pointer[0]=n,this.pointer[1]=o,this.pointer[2]=n,this.pointer[3]=o,this.pointer[4]=n,this.pointer[5]=o,this.pointer[6]=n,this.pointer[7]=o,this.deltaX=0,this.deltaY=0,this.velocity=0,this.velocityStack[0]=0,this.velocityStack[1]=0,this.velocityStack[2]=0,this.velocityStackIndex=0,this.angle=0,this.targetStyles&&(this.targetStyles.revert(),this.targetStyles=null);const p=It(this.$target,"zIndex",!1);er=(p>er?p:er)+1,this.targetStyles=Ct(this.$target,{zIndex:er}),this.triggerStyles&&(this.triggerStyles.revert(),this.triggerStyles=null),this.cursorStyles&&(this.cursorStyles.revert(),this.cursorStyles=null),this.isFinePointer&&this.cursor&&(this.bodyStyles=Ct(Q.body,{cursor:this.cursor.onGrab})),this.scrollInView(100,0,wt.out(3)),this.onGrab(this),Q.addEventListener("touchmove",this),Q.addEventListener("touchend",this),Q.addEventListener("touchcancel",this),Q.addEventListener("mousemove",this),Q.addEventListener("mouseup",this),Q.addEventListener("selectstart",this)}handleMove(e){if(!this.grabbed)return;const t=e.changedTouches,s=t?t[0].clientX:e.clientX,r=t?t[0].clientY:e.clientY,{x:i,y:n}=this.transforms.normalizePoint(s,r),o=i-this.pointer[6],a=n-this.pointer[7];let h=e.target,u=!1,f=!1,l=!1;for(;t&&h&&h!==this.$trigger;){const d=It(h,"overflow-y");if(d!=="hidden"&&d!=="visible"){const{scrollTop:c,scrollHeight:p,clientHeight:g}=h;if(p>g){l=!0,u=c<=3,f=c>=p-g-3;break}}h=h.parentElement}l&&(!u&&!f||u&&a<0||f&&a>0)?(this.pointer[0]=i,this.pointer[1]=n,this.pointer[2]=i,this.pointer[3]=n,this.pointer[4]=i,this.pointer[5]=n,this.pointer[6]=i,this.pointer[7]=n):(Ot(e),this.triggerStyles||(this.triggerStyles=Ct(this.$trigger,{pointerEvents:"none"})),this.$trigger.addEventListener("touchstart",Ot,{passive:!1}),this.$trigger.addEventListener("touchmove",Ot,{passive:!1}),this.$trigger.addEventListener("touchend",Ot),(this.dragged||!this.disabled[0]&&ot(o)>this.dragThreshold||!this.disabled[1]&&ot(a)>this.dragThreshold)&&(this.updateTicker.resume(),this.pointer[2]=this.pointer[0],this.pointer[3]=this.pointer[1],this.pointer[0]=i,this.pointer[1]=n,this.dragged=!0,this.released=!1,this.onDrag(this)))}handleUp(){if(!this.grabbed)return;this.updateTicker.pause(),this.triggerStyles&&(this.triggerStyles.revert(),this.triggerStyles=null),this.bodyStyles&&(this.bodyStyles.revert(),this.bodyStyles=null);const[e,t]=this.disabled,[s,r,i,n,o,a]=this.pointer,[h,u,f,l]=this.containerBounds,[d,c]=this.snapped,p=this.releaseXSpring,g=this.releaseYSpring,v=this.releaseEase,_=this.hasReleaseSpring,S=this.overshootCoords,y=this.x,m=this.y,b=this.computeVelocity(s-o,r-a),k=this.angle=qs(r-n,s-i),w=b*150,E=(1-this.releaseContainerFriction)*this.dragSpeed,O=y+Mr(k)*w,P=m+Nr(k)*w,A=O>u?u+(O-u)*E:O<l?l+(O-l)*E:O,C=P>f?f+(P-f)*E:P<h?h+(P-h)*E:P,H=this.destX=Z(F(zt(A,this.snapX),5),l,u),$=this.destY=Z(F(zt(C,this.snapY),5),h,f),V=this.isOutOfBounds(this.containerBounds,O,P);let x=0,M=0,I=v,L=v,q=0;if(S.x=y,S.y=m,!e){const G=H===u?y>u?-1:1:y<l?-1:1,W=F(y-H,0);p.velocity=t&&_?W?w*G/ot(W):0:b;const{ease:ee,settlingDuration:Y,restDuration:re}=p;x=y===H?0:_?Y:Y-re*z.timeScale,_&&(I=ee),x>q&&(q=x)}if(!t){const G=$===f?m>f?-1:1:m<h?-1:1,W=F(m-$,0);g.velocity=e&&_?W?w*G/ot(W):0:b;const{ease:ee,settlingDuration:Y,restDuration:re}=g;M=m===$?0:_?Y:Y-re*z.timeScale,_&&(L=ee),M>q&&(q=M)}if(!_&&V&&E&&(x||M)){const G=He.blend;new Tt(S,{x:{to:A,duration:x*.65},y:{to:C,duration:M*.65},ease:v,composition:G}).init(),new Tt(S,{x:{to:H,duration:x},y:{to:$,duration:M},ease:v,composition:G}).init(),this.overshootTicker.stretch(an(x,M)).restart()}else e||this.animate[this.xProp](H,x,I),t||this.animate[this.yProp]($,M,L);this.scrollInView(q,this.scrollThreshold,v);let K=!1;H!==d&&(this.snapped[0]=H,this.snapX&&(K=!0)),$!==c&&this.snapY&&(this.snapped[1]=$,this.snapY&&(K=!0)),K&&this.onSnap(this),this.grabbed=!1,this.dragged=!1,this.updated=!0,this.released=!0,this.onRelease(this),this.$trigger.removeEventListener("touchstart",Ot),this.$trigger.removeEventListener("touchmove",Ot),this.$trigger.removeEventListener("touchend",Ot),Q.removeEventListener("touchmove",this),Q.removeEventListener("touchend",this),Q.removeEventListener("touchcancel",this),Q.removeEventListener("mousemove",this),Q.removeEventListener("mouseup",this),Q.removeEventListener("selectstart",this)}reset(){return this.stop(),this.resizeTicker.pause(),this.grabbed=!1,this.dragged=!1,this.updated=!1,this.released=!1,this.canScroll=!1,this.setX(0,!0),this.setY(0,!0),this.coords[0]=0,this.coords[1]=0,this.pointer[0]=0,this.pointer[1]=0,this.pointer[2]=0,this.pointer[3]=0,this.pointer[4]=0,this.pointer[5]=0,this.pointer[6]=0,this.pointer[7]=0,this.velocity=0,this.velocityStack[0]=0,this.velocityStack[1]=0,this.velocityStack[2]=0,this.velocityStackIndex=0,this.angle=0,this}enable(){return this.enabled||(this.enabled=!0,this.$target.classList.remove("is-disabled"),this.touchActionStyles=Ct(this.$trigger,{touchAction:this.disabled[0]?"pan-x":this.disabled[1]?"pan-y":"none"}),this.$trigger.addEventListener("touchstart",this,{passive:!0}),this.$trigger.addEventListener("mousedown",this,{passive:!0}),this.$trigger.addEventListener("mouseenter",this)),this}disable(){return this.enabled=!1,this.grabbed=!1,this.dragged=!1,this.updated=!1,this.released=!1,this.canScroll=!1,this.touchActionStyles.revert(),this.cursorStyles&&(this.cursorStyles.revert(),this.cursorStyles=null),this.triggerStyles&&(this.triggerStyles.revert(),this.triggerStyles=null),this.bodyStyles&&(this.bodyStyles.revert(),this.bodyStyles=null),this.targetStyles&&(this.targetStyles.revert(),this.targetStyles=null),this.$target.classList.add("is-disabled"),this.$trigger.removeEventListener("touchstart",this),this.$trigger.removeEventListener("mousedown",this),this.$trigger.removeEventListener("mouseenter",this),Q.removeEventListener("touchmove",this),Q.removeEventListener("touchend",this),Q.removeEventListener("touchcancel",this),Q.removeEventListener("mousemove",this),Q.removeEventListener("mouseup",this),Q.removeEventListener("selectstart",this),this}revert(){return this.reset(),this.disable(),this.$target.classList.remove("is-disabled"),this.updateTicker.revert(),this.overshootTicker.revert(),this.resizeTicker.revert(),this.animate.revert(),this.resizeObserver.disconnect(),this}handleEvent(e){switch(e.type){case"mousedown":this.handleDown(e);break;case"touchstart":this.handleDown(e);break;case"mousemove":this.handleMove(e);break;case"touchmove":this.handleMove(e);break;case"mouseup":this.handleUp();break;case"touchend":this.handleUp();break;case"touchcancel":this.handleUp();break;case"mouseenter":this.handleHover();break;case"selectstart":Ot(e)}}},yc=(e,t)=>new Dn(e,t),Jr=(e=oe)=>new tt({duration:1*z.timeScale,onComplete:e},null,0).resume(),tr=e=>{let t;return((...s)=>{let r,i,n,o,a;t&&(r=t.currentIteration,i=t.iterationProgress,n=t.reversed,o=t._alternate,a=t._startTime,t.revert());const h=e(...s);return h&&!Ee(h)&&h.revert&&(t=h),D(i)||(t.currentIteration=r,t.iterationProgress=(o&&r%2?!n:n)?1-i:i,t._startTime=a),h||oe})},Bn=class{constructor(e={}){Ie.current&&Ie.current.register(this);const t=e.root;let s=Q;t&&(s=t.current||t.nativeElement||st(t)[0]||Q);const r=e.defaults,i=z.defaults,n=e.mediaQueries;if(this.defaults=r?at(r,i):i,this.root=s,this.constructors=[],this.revertConstructors=[],this.revertibles=[],this.constructorsOnce=[],this.revertConstructorsOnce=[],this.revertiblesOnce=[],this.once=!1,this.onceIndex=0,this.methods={},this.matches={},this.mediaQueryLists={},this.data={},n)for(let o in n){const a=Xe.matchMedia(n[o]);this.mediaQueryLists[o]=a,a.addEventListener("change",this)}}register(e){(this.once?this.revertiblesOnce:this.revertibles).push(e)}execute(e){let t=Ie.current,s=Ie.root,r=z.defaults;Ie.current=this,Ie.root=this.root,z.defaults=this.defaults;const i=this.mediaQueryLists;for(let o in i)this.matches[o]=i[o].matches;const n=e(this);return Ie.current=t,Ie.root=s,z.defaults=r,n}refresh(){return this.onceIndex=0,this.execute(()=>{let e=this.revertibles.length,t=this.revertConstructors.length;for(;e--;)this.revertibles[e].revert();for(;t--;)this.revertConstructors[t](this);this.revertibles.length=0,this.revertConstructors.length=0,this.constructors.forEach(s=>{const r=s(this);Ee(r)&&this.revertConstructors.push(r)})}),this}add(e,t){if(this.once=!1,Ee(e)){const s=e;this.constructors.push(s),this.execute(()=>{const r=s(this);Ee(r)&&this.revertConstructors.push(r)})}else this.methods[e]=(...s)=>this.execute(()=>t(...s));return this}addOnce(e){if(this.once=!0,Ee(e)){const t=this.onceIndex++;if(this.constructorsOnce[t])return this;const s=e;this.constructorsOnce[t]=s,this.execute(()=>{const r=s(this);Ee(r)&&this.revertConstructorsOnce.push(r)})}return this}keepTime(e){this.once=!0;const t=this.onceIndex++,s=this.constructorsOnce[t];if(Ee(s))return s(this);const r=tr(e);this.constructorsOnce[t]=r;let i;return this.execute(()=>{i=r(this)}),i}handleEvent(e){e.type==="change"&&this.refresh()}revert(){const e=this.revertibles,t=this.revertConstructors,s=this.revertiblesOnce,r=this.revertConstructorsOnce,i=this.mediaQueryLists;let n=e.length,o=t.length,a=s.length,h=r.length;for(;n--;)e[n].revert();for(;o--;)t[o](this);for(;a--;)s[a].revert();for(;h--;)r[h](this);for(let u in i)i[u].removeEventListener("change",this);e.length=0,t.length=0,this.constructors.length=0,s.length=0,r.length=0,this.constructorsOnce.length=0,this.onceIndex=0,this.matches={},this.methods={},this.mediaQueryLists={},this.data={}}},bc=e=>new Bn(e),_c=()=>{const e=Q.createElement("div");Q.body.appendChild(e),e.style.height="100lvh";const t=e.offsetHeight;return Q.body.removeChild(e),t},sr=(e,t)=>e&&Ee(e)?e(t):e,rr=new Map,Sc=class{constructor(e){this.element=e,this.useWin=this.element===Q.body,this.winWidth=0,this.winHeight=0,this.width=0,this.height=0,this.left=0,this.top=0,this.scale=1,this.zIndex=0,this.scrollX=0,this.scrollY=0,this.prevScrollX=0,this.prevScrollY=0,this.scrollWidth=0,this.scrollHeight=0,this.velocity=0,this.backwardX=!1,this.backwardY=!1,this.scrollTicker=new tt({autoplay:!1,onBegin:()=>this.dataTimer.resume(),onUpdate:()=>{const t=this.backwardX||this.backwardY;Se(this,s=>s.handleScroll(),t)},onComplete:()=>this.dataTimer.pause()}).init(),this.dataTimer=new tt({autoplay:!1,frameRate:30,onUpdate:t=>{const s=t.deltaTime,r=this.prevScrollX,i=this.prevScrollY,n=this.scrollX,o=this.scrollY,a=r-n,h=i-o;this.prevScrollX=n,this.prevScrollY=o,a&&(this.backwardX=r>n),h&&(this.backwardY=i>o),this.velocity=F(s>0?Math.sqrt(a*a+h*h)/s:0,5)}}).init(),this.resizeTicker=new tt({autoplay:!1,duration:250*z.timeScale,onComplete:()=>{this.updateWindowBounds(),this.refreshScrollObservers(),this.handleScroll()}}).init(),this.wakeTicker=new tt({autoplay:!1,duration:500*z.timeScale,onBegin:()=>{this.scrollTicker.resume()},onComplete:()=>{this.scrollTicker.pause()}}).init(),this._head=null,this._tail=null,this.updateScrollCoords(),this.updateWindowBounds(),this.updateBounds(),this.refreshScrollObservers(),this.handleScroll(),this.resizeObserver=new ResizeObserver(()=>this.resizeTicker.restart()),this.resizeObserver.observe(this.element),(this.useWin?Xe:this.element).addEventListener("scroll",this,!1)}updateScrollCoords(){const e=this.useWin,t=this.element;this.scrollX=F(e?Xe.scrollX:t.scrollLeft,0),this.scrollY=F(e?Xe.scrollY:t.scrollTop,0)}updateWindowBounds(){this.winWidth=Xe.innerWidth,this.winHeight=_c()}updateBounds(){const e=getComputedStyle(this.element),t=this.element;this.scrollWidth=t.scrollWidth+parseFloat(e.marginLeft)+parseFloat(e.marginRight),this.scrollHeight=t.scrollHeight+parseFloat(e.marginTop)+parseFloat(e.marginBottom),this.updateWindowBounds();let s,r;if(this.useWin)s=this.winWidth,r=this.winHeight;else{const i=t.getBoundingClientRect();s=t.clientWidth,r=t.clientHeight,this.top=i.top,this.left=i.left,this.scale=i.width?s/i.width:i.height?r/i.height:1}this.width=s,this.height=r}refreshScrollObservers(){Se(this,e=>{e.ready&&e._debug&&e.removeDebug()}),this.updateBounds(),Se(this,e=>{e.ready&&(e.refresh(),e.onResize(e),e._debug&&e.debug())})}refresh(){this.updateWindowBounds(),this.updateBounds(),this.refreshScrollObservers(),this.handleScroll()}handleScroll(){this.updateScrollCoords(),this.wakeTicker.restart()}handleEvent(e){e.type==="scroll"&&this.handleScroll()}revert(){this.scrollTicker.cancel(),this.dataTimer.cancel(),this.resizeTicker.cancel(),this.wakeTicker.cancel(),this.resizeObserver.disconnect(),(this.useWin?Xe:this.element).removeEventListener("scroll",this),rr.delete(this.element)}},kc=e=>{const t=e&&st(e)[0]||Q.body;let s=rr.get(t);return s||(s=new Sc(t),rr.set(t,s)),s},ys=(e,t,s,r,i)=>{const n=t==="min",o=t==="max",{n:a,u:h}=Je(t==="top"||t==="left"||t==="start"||n?0:t==="bottom"||t==="right"||t==="end"||o?"100%":t==="center"?"50%":t,Fe);let u=a;return h==="%"?u=a/100*s:h&&(u=Xs(e,Fe,"px",!0).n),o&&r<0&&(u+=r),n&&i>0&&(u+=i),u},ir=(e,t,s,r,i)=>{let n;if(Be(t)){const o=tn.exec(t);if(o){const a=o[0],h=a[0],u=t.split(a),f=u[0]==="min",l=u[0]==="max",d=ys(e,u[0],s,r,i),c=ys(e,u[1],s,r,i);if(f){const p=Wt(ys(e,"min",s),c,h);n=p<d?d:p}else if(l){const p=Wt(ys(e,"max",s),c,h);n=p>d?d:p}else n=Wt(d,c,h)}else n=ys(e,t,s,r,i)}else n=t;return F(n,0)},Hn=e=>{let t;const s=e.targets;for(let r=0,i=s.length;r<i;r++){const n=s[r];if(n[Ht]){t=n;break}}return t},wc=0,$n=["#FF4B4B","#FF971B","#FFC730","#F9F640","#7AFF5A","#18FF74","#17E09B","#3CFFEC","#05DBE9","#33B3F1","#638CF9","#C563FE","#FF4FCF","#F93F8A"],qn=class{constructor(e={}){Ie.current&&Ie.current.register(this);const t=U(e.sync,"play pause"),s=t?xt(t):null,r=t&&(t==="linear"||t===rt),i=t&&!(s===rt&&!r),n=t&&(qe(t)||t===!0||r),o=t&&Be(t)&&!i&&!n,a=o?t.split(" ").map(u=>()=>{const f=this.linked;return f&&f[u]?f[u]():null}):null,h=o&&a.length>2;this.index=wc++,this.id=D(e.id)?this.index:e.id,this.container=kc(e.container),this.target=null,this.linked=null,this.repeat=null,this.horizontal=null,this.enter=null,this.leave=null,this.sync=i||n||!!a,this.syncEase=i?s:null,this.syncSmooth=n?t===!0||r?1:t:null,this.onSyncEnter=a&&!h&&a[0]?a[0]:oe,this.onSyncLeave=a&&!h&&a[1]?a[1]:oe,this.onSyncEnterForward=a&&h&&a[0]?a[0]:oe,this.onSyncLeaveForward=a&&h&&a[1]?a[1]:oe,this.onSyncEnterBackward=a&&h&&a[2]?a[2]:oe,this.onSyncLeaveBackward=a&&h&&a[3]?a[3]:oe,this.onEnter=e.onEnter||oe,this.onLeave=e.onLeave||oe,this.onEnterForward=e.onEnterForward||oe,this.onLeaveForward=e.onLeaveForward||oe,this.onEnterBackward=e.onEnterBackward||oe,this.onLeaveBackward=e.onLeaveBackward||oe,this.onUpdate=e.onUpdate||oe,this.onResize=e.onResize||oe,this.onSyncComplete=e.onSyncComplete||oe,this.reverted=!1,this.ready=!1,this.completed=!1,this.began=!1,this.isInView=!1,this.forceEnter=!1,this.hasEntered=!1,this.offset=0,this.offsetStart=0,this.offsetEnd=0,this.distance=0,this.prevProgress=0,this.thresholds=["start","end","end","start"],this.coords=[0,0,0,0],this.debugStyles=null,this.$debug=null,this._params=e,this._debug=U(e.debug,!1),this._next=null,this._prev=null,mt(this.container,this),Jr(()=>{if(!this.reverted){if(!this.target){const u=st(e.target)[0];this.target=u||Q.body,this.refresh()}this._debug&&this.debug()}})}link(e){if(e&&(e.pause(),this.linked=e,!D(e)&&!D(e.persist)&&(e.persist=!0),!this._params.target)){let t;D(e.targets)?Se(e,s=>{s.targets&&!t&&(t=Hn(s))}):t=Hn(e),this.target=t||Q.body,this.refresh()}return this}get velocity(){return this.container.velocity}get backward(){return this.horizontal?this.container.backwardX:this.container.backwardY}get scroll(){return this.horizontal?this.container.scrollX:this.container.scrollY}get progress(){const e=(this.scroll-this.offsetStart)/this.distance;return e===1/0||isNaN(e)?0:F(Z(e,0,1),6)}refresh(){this.ready=!0,this.reverted=!1;const e=this._params;return this.repeat=U(sr(e.repeat,this),!0),this.horizontal=U(sr(e.axis,this),"y")==="x",this.enter=U(sr(e.enter,this),"end start"),this.leave=U(sr(e.leave,this),"start end"),this.updateBounds(),this.handleScroll(),this}removeDebug(){return this.$debug&&(this.$debug.parentNode.removeChild(this.$debug),this.$debug=null),this.debugStyles&&(this.debugStyles.revert(),this.$debug=null),this}debug(){this.removeDebug();const e=this.container,t=this.horizontal,s=e.element.querySelector(":scope > .animejs-onscroll-debug"),r=Q.createElement("div"),i=Q.createElement("div"),n=Q.createElement("div"),o=$n[this.index%$n.length],a=e.useWin,h=a?e.winWidth:e.width,u=a?e.winHeight:e.height,f=e.scrollWidth,l=e.scrollHeight,d=this.container.width>360?320:260,c=t?0:10,p=t?10:0,g=t?24:d/2,v=t?g:15,_=t?60:g,S=t?_:v,y=t?"repeat-x":"repeat-y",m=E=>t?"0px "+E+"px":E+"px 2px",b=E=>`linear-gradient(${t?90:0}deg, ${E} 2px, transparent 1px)`,k=(E,O,P,A,C)=>`position:${E};left:${O}px;top:${P}px;width:${A}px;height:${C}px;`;r.style.cssText=`${k("absolute",c,p,t?f:d,t?d:l)}
|
|
94
94
|
pointer-events: none;
|
|
95
95
|
z-index: ${this.container.zIndex++};
|
|
96
96
|
display: flex;
|
|
@@ -127,6 +127,6 @@ Expecting `+C.join(", ")+", got '"+(this.terminals_[y]||y)+"'":H="Parse error on
|
|
|
127
127
|
border: 2px solid ${C?o:"transparent"};
|
|
128
128
|
border-${t?V?"top-left":"top-right":V?"top-left":"bottom-left"}-radius: 5px;
|
|
129
129
|
border-${t?V?"bottom-left":"bottom-right":V?"top-right":"bottom-right"}-radius: 5px;
|
|
130
|
-
`,x.appendChild(M);let q=A-L+(t?1:0);x.style[t?"left":"top"]=`${q}px`,(P?i:n).appendChild(x)}),r.appendChild(i),r.appendChild(n),e.element.appendChild(r),s||r.classList.add("animejs-onscroll-debug"),this.$debug=r,It(e.element,"position")==="static"&&(this.debugStyles=Ct(e.element,{position:"relative "}))}updateBounds(){this._debug&&this.removeDebug();let e;const t=this.target,s=this.container,r=this.horizontal,i=this.linked;let n,o=t;for(i&&(n=i.currentTime,i.seek(0,!0));o&&o!==s.element&&o!==Q.body;){const C=It(o,"position")==="sticky"?Ct(o,{position:"static"}):!1;o=o.parentElement,C&&(e||(e=[]),e.push(C))}const a=t.getBoundingClientRect(),h=s.scale,u=(r?a.left+s.scrollX-s.left:a.top+s.scrollY-s.top)*h,f=(r?a.width:a.height)*h,l=r?s.width:s.height,d=(r?s.scrollWidth:s.scrollHeight)-l,c=this.enter,p=this.leave;let g="start",v="end",_="end",S="start";if(Be(c)){const C=c.split(" ");_=C[0],g=C.length>1?C[1]:g}else if(De(c)){const C=c;D(C.container)||(_=C.container),D(C.target)||(g=C.target)}else qe(c)&&(_=c);if(Be(p)){const C=p.split(" ");S=C[0],v=C.length>1?C[1]:v}else if(De(p)){const C=p;D(C.container)||(S=C.container),D(C.target)||(v=C.target)}else qe(p)&&(S=p);const y=ir(t,g,f),m=ir(t,v,f),b=y+u-l,k=m+u-d,w=ir(t,_,l,b,k),E=ir(t,S,l,b,k),O=y+u-w,P=m+u-E,A=P-O;this.offset=u,this.offsetStart=O,this.offsetEnd=P,this.distance=A<=0?0:A,this.thresholds=[g,v,_,S],this.coords=[y,m,w,E],e&&e.forEach(C=>C.revert()),i&&i.seek(n,!0),this._debug&&this.debug()}handleScroll(){if(!this.ready)return;const e=this.linked,t=this.sync,s=this.syncEase,r=this.syncSmooth,i=e&&(s||r),n=this.horizontal,o=this.container,a=this.scroll,h=a<=this.offsetStart,u=a>=this.offsetEnd,f=!h&&!u,l=a===this.offsetStart||a===this.offsetEnd,d=!this.hasEntered&&l,c=this._debug&&this.$debug;let p=!1,g=!1,v=this.progress;if(h&&this.began&&(this.began=!1),v>0&&!this.began&&(this.began=!0),i){const _=e.progress;if(r&&qe(r)){if(r<1){const S=_<v&&v===1?1e-4:_>v&&!v?-1e-4:0;v=F(At(_,v,At(.01,.2,r))+S,6)}}else s&&(v=s(v));p=v!==this.prevProgress,g=_===1,p&&!g&&r&&_&&o.wakeTicker.restart()}if(c){const _=n?o.scrollY:o.scrollX;c.style[n?"top":"left"]=_+10+"px"}(f&&!this.isInView||d&&!this.forceEnter&&!this.hasEntered)&&(f&&(this.isInView=!0),!this.forceEnter||!this.hasEntered?(c&&f&&(c.style.zIndex=`${this.container.zIndex++}`),this.onSyncEnter(this),this.onEnter(this),this.backward?(this.onSyncEnterBackward(this),this.onEnterBackward(this)):(this.onSyncEnterForward(this),this.onEnterForward(this)),this.hasEntered=!0,d&&(this.forceEnter=!0)):f&&(this.forceEnter=!1)),(f||!f&&this.isInView)&&(p=!0),p&&(i&&e.seek(e.duration*v),this.onUpdate(this)),!f&&this.isInView&&(this.isInView=!1,this.onSyncLeave(this),this.onLeave(this),this.backward?(this.onSyncLeaveBackward(this),this.onLeaveBackward(this)):(this.onSyncLeaveForward(this),this.onLeaveForward(this)),t&&!r&&(g=!0)),v>=1&&this.began&&!this.completed&&(t&&g||!t)&&(t&&this.onSyncComplete(this),this.completed=!0,(!this.repeat&&!e||!this.repeat&&e&&e.completed)&&this.revert()),v<1&&this.completed&&(this.completed=!1),this.prevProgress=v}revert(){if(this.reverted)return;const e=this.container;return gt(e,this),e._head||e.revert(),this._debug&&this.removeDebug(),this.reverted=!0,this.ready=!1,this}},xc=(e={})=>new qn(e),Fn=(e,t,s)=>(((1-3*s+3*t)*e+(3*s-6*t))*e+3*t)*e,Tc=(e,t,s)=>{let r=0,i=1,n,o,a=0;do o=r+(i-r)/2,n=Fn(o,t,s)-e,n>0?i=o:r=o;while(ot(n)>1e-7&&++a<100);return o},Vn=(e=.5,t=0,s=.5,r=1)=>e===t&&s===r?rt:i=>i===0||i===1?i:Fn(Tc(i,e,s),t,r),zn=(e=10,t)=>{const s=t?Vl:Kt;return r=>s(Z(r,0,1)*e)*(1/e)},Kr=(...e)=>{const t=e.length;if(!t)return rt;const s=t-1,r=e[0],i=e[s],n=[0],o=[Ft(r)];for(let a=1;a<s;a++){const h=e[a],u=Be(h)?h.trim().split(" "):[h],f=u[0],l=u[1];n.push(D(l)?a/s:Ft(l)/100),o.push(Ft(f))}return o.push(Ft(i)),n.push(1),function(h){for(let u=1,f=n.length;u<f;u++){const l=n[u];if(h<=l){const d=n[u-1],c=o[u-1];return c+(o[u]-c)*(h-d)/(l-d)}}return o[o.length-1]}},Un=(e=10,t=1)=>{const s=[0],r=e-1;for(let i=1;i<r;i++){const n=s[i-1],o=i/r,a=o+((i+1)/r-o)*Math.random(),h=o*(1-t)+a*t;s.push(Z(h,n,1))}return s.push(1),Kr(...s)},Cc=Gt({Spring:()=>Ks,createSpring:()=>On,cubicBezier:()=>Vn,eases:()=>wt,irregular:()=>Un,linear:()=>Kr,spring:()=>js,steps:()=>zn}),nr=(e,t=100)=>{const s=[];for(let r=0;r<=t;r++)s.push(F(e(r/t),4));return`linear(${s.join(", ")})`},Wn={},Xn=e=>{let t=Wn[e];if(t)return t;if(t="linear",Be(e)){if(Me(e,"linear")||Me(e,"cubic-")||Me(e,"steps")||Me(e,"ease"))t=e;else if(Me(e,"cubicB"))t=Bs(e);else{const s=Pn(e);Ee(s)&&(t=s===rt?"linear":nr(s))}Wn[e]=t}else if(Ee(e)){const s=nr(e);s&&(t=s)}else e.ease&&(t=nr(e.ease));return t},Yn=["x","y","z"],Pc=["perspective","width","height","margin","padding","top","right","bottom","left","borderWidth","fontSize","borderRadius",...Yn],Ec=[...Yn,...$t.filter(e=>["X","Y","Z"].some(t=>e.endsWith(t)))],jr=null,bs=(e,t,s,r,i)=>{let n=Be(t)?t:Ne(t,s,r,i,null,null);return qe(n)?Pc.includes(e)||Me(e,"translate")?`${n}px`:Me(e,"rotate")||Me(e,"skew")?`${n}deg`:`${n}`:n},Gn=(e,t,s,r,i,n)=>{let o="0";const a=D(r)?getComputedStyle(e)[t]:bs(t,r,e,i,n);return D(s)?o=$e(r)?r.map(h=>bs(t,h,e,i,n)):a:o=[bs(t,s,e,i,n),a],o},Zn=class{constructor(e,t){Ie.current&&Ie.current.register(this),qt(jr)&&(yt&&(D(CSS)||!Object.hasOwnProperty.call(CSS,"registerProperty"))?jr=!1:($t.forEach(d=>{const c=Me(d,"skew"),p=Me(d,"scale"),g=Me(d,"rotate"),v=Me(d,"translate"),_=g||c,S=_?"<angle>":p?"<number>":v?"<length-percentage>":"*";try{CSS.registerProperty({name:"--"+d,syntax:S,inherits:!1,initialValue:v?"0px":_?"0deg":p?"1":"0"})}catch{}}),jr=!0));const s=Lt(e);s.length||console.warn("No target found. Make sure the element you're trying to animate is accessible before creating your animation.");const r=U(t.autoplay,z.defaults.autoplay),i=r&&r.link?r:!1,n=t.alternate&&t.alternate===!0,o=t.reversed&&t.reversed===!0,a=U(t.loop,z.defaults.loop),h=a===!0||a===1/0?1/0:qe(a)?a+1:1,u=n?o?"alternate-reverse":"alternate":o?"reverse":"normal",f="both",l=z.timeScale===1?1:Ye;this.targets=s,this.animations=[],this.controlAnimation=null,this.onComplete=t.onComplete||z.defaults.onComplete,this.duration=0,this.muteCallbacks=!1,this.completed=!1,this.paused=!r||i!==!1,this.reversed=o,this.persist=U(t.persist,z.defaults.persist),this.autoplay=r,this._speed=U(t.playbackRate,z.defaults.playbackRate),this._resolve=oe,this._completed=0,this._inlineStyles=[],s.forEach((d,c)=>{const p=d[ds],g=Ec.some(P=>t.hasOwnProperty(P)),v=d.style,_=this._inlineStyles[c]={},S=U(t.ease,z.defaults.ease),y=Ne(S,d,c,s,null,null),m=Ee(y)||Be(y)?y:S,b=S.ease&&S,k=Xn(m),w=(b?b.settlingDuration:Ne(U(t.duration,z.defaults.duration),d,c,s,null,null))*l,E=Ne(U(t.delay,z.defaults.delay),d,c,s,null,null)*l,O=U(t.composition,"replace");for(let P in t){if(!Jt(P))continue;const A={},C={iterations:h,direction:u,fill:f,easing:k,duration:w,delay:E,composite:O},H=t[P],$=g?$t.includes(P)?P:Or.get(P):!1,V=$?"transform":P;_[V]||(_[V]=v[V]);let x;if(De(H)){const M=H,I=U(M.ease,k),L=I.ease&&I,q=M.to,K=M.from;if(C.duration=(L?L.settlingDuration:Ne(U(M.duration,w),d,c,s,null,null))*l,C.delay=Ne(U(M.delay,E),d,c,s,null,null)*l,C.composite=U(M.composition,O),C.easing=Xn(I),x=Gn(d,P,K,q,c,s),$?(A[`--${$}`]=x,p[$]=x):A[P]=Gn(d,P,K,q,c,s),Nn(this,d,P,A,C),!D(K))if(!$)v[P]=A[P][0];else{const G=`--${$}`;v.setProperty(G,A[G][0])}}else x=$e(H)?H.map(M=>bs(P,M,d,c,s)):bs(P,H,d,c,s),$?(A[`--${$}`]=x,p[$]=x):A[P]=x,Nn(this,d,P,A,C)}if(g){let P="";for(let A in p)P+=`${Ki[A]}var(--${A})) `;v.transform=P}}),i&&this.autoplay.link(this)}forEach(e){try{const t=Be(e)?s=>s[e]():e;this.animations.forEach(t)}catch{}return this}get speed(){return this._speed}set speed(e){this._speed=+e,this.forEach(t=>t.playbackRate=e)}get currentTime(){const e=this.controlAnimation,t=z.timeScale;return this.completed?this.duration:e?+e.currentTime*(t===1?1:t):0}set currentTime(e){const t=e*(z.timeScale===1?1:Ye);this.forEach(s=>{!this.persist&&t>=this.duration&&s.play(),s.currentTime=t})}get progress(){return this.currentTime/this.duration}set progress(e){this.forEach(t=>t.currentTime=e*this.duration||0)}resume(){return this.paused?(this.paused=!1,this.forEach("play")):this}pause(){return this.paused?this:(this.paused=!0,this.forEach("pause"))}alternate(){return this.reversed=!this.reversed,this.forEach("reverse"),this.paused&&this.forEach("pause"),this}play(){return this.reversed&&this.alternate(),this.resume()}reverse(){return this.reversed||this.alternate(),this.resume()}seek(e,t=!1){return t&&(this.muteCallbacks=!0),e<this.duration&&(this.completed=!1),this.currentTime=e,this.muteCallbacks=!1,this.paused&&this.pause(),this}restart(){return this.completed=!1,this.seek(0,!0).resume()}commitStyles(){return this.forEach("commitStyles")}complete(){return this.seek(this.duration)}cancel(){return this.muteCallbacks=!0,this.commitStyles().forEach("cancel"),this.animations.length=0,requestAnimationFrame(()=>{this.targets.forEach(e=>{e.style.transform==="none"&&e.style.removeProperty("transform")})}),this}revert(){return this.cancel().targets.forEach((e,t)=>{const s=e.style,r=this._inlineStyles[t];for(let i in r){const n=r[i];D(n)||n===""?s.removeProperty(Bs(i)):e.style[i]=n}e.getAttribute("style")===""&&e.removeAttribute("style")}),this}then(e=oe){const t=this.then,s=()=>{this.then=null,e(this),this.then=t,this._resolve=oe};return new Promise(r=>(this._resolve=()=>r(s()),this.completed&&this._resolve(),this))}},Qn={animate:(e,t)=>new Zn(e,t),convertEase:nr},Ac=0,Lc=0,or=(e,t)=>!e||!t?!1:e===t||e.contains(t),rs=e=>{if(!e)return null;const t=e.style,s=t.transition||"";return t.setProperty("transition","none","important"),s},ar=(e,t)=>{if(!e)return;const s=e.style;t?s.transition=t:s.removeProperty("transition")},Rc=e=>{const t=e.layout.transitionMuteStore,s=e.$el,r=e.$measure;s&&!t.has(s)&&t.set(s,rs(s)),r&&!t.has(r)&&t.set(r,rs(r))},lr=e=>{e.forEach((t,s)=>ar(s,t)),e.clear()},Ic={display:"none",visibility:"hidden",opacity:"0",transform:"none",position:"static"},Oc=e=>{if(!e)return;const t=e.parentNode;t&&(t._head===e&&(t._head=e._next),t._tail===e&&(t._tail=e._prev),e._prev&&(e._prev._next=e._next),e._next&&(e._next._prev=e._prev),e._prev=null,e._next=null,e.parentNode=null)},Jn=(e,t,s,r)=>{let i=e.dataset.layoutId;i||(i=e.dataset.layoutId=`node-${Lc++}`);const n=r||{};return n.$el=e,n.$measure=e,n.id=i,n.index=0,n.targets=null,n.delay=0,n.duration=0,n.ease=null,n.state=s,n.layout=s.layout,n.parentNode=t||null,n.isTarget=!1,n.isEntering=!1,n.isLeaving=!1,n.isInlined=!1,n.hasTransform=!1,n.inlineStyles=[],n.inlineTransforms=null,n.inlineTransition=null,n.branchAdded=!1,n.branchRemoved=!1,n.branchNotRendered=!1,n.sizeChanged=!1,n.hasVisibilitySwap=!1,n.hasDisplayNone=!1,n.hasVisibilityHidden=!1,n.measuredInlineTransform=null,n.measuredInlineTransition=null,n.measuredDisplay=null,n.measuredVisibility=null,n.measuredPosition=null,n.measuredHasDisplayNone=!1,n.measuredHasVisibilityHidden=!1,n.measuredIsVisible=!1,n.measuredIsRemoved=!1,n.measuredIsInsideRoot=!1,n.properties={transform:"none",x:0,y:0,left:0,top:0,clientLeft:0,clientTop:0,width:0,height:0},n.layout.properties.forEach(o=>n.properties[o]=0),n._head=null,n._tail=null,n._prev=null,n._next=null,n},Kn=(e,t,s,r)=>{const i=e.$el,n=e.layout.root,o=n===i,a=e.properties,h=e.state.rootNode,u=e.parentNode,f=s.transform,l=i.style.transform,d=u?u.measuredIsRemoved:!1,c=s.position;o&&(e.layout.absoluteCoords=c==="fixed"||c==="absolute"),e.$measure=t,e.inlineTransforms=l,e.hasTransform=f&&f!=="none",e.measuredIsInsideRoot=or(n,t),e.measuredInlineTransform=null,e.measuredDisplay=s.display,e.measuredVisibility=s.visibility,e.measuredPosition=c,e.measuredHasDisplayNone=s.display==="none",e.measuredHasVisibilityHidden=s.visibility==="hidden",e.measuredIsVisible=!(e.measuredHasDisplayNone||e.measuredHasVisibilityHidden),e.measuredIsRemoved=e.measuredHasDisplayNone||e.measuredHasVisibilityHidden||d;let p=!1,g=i.previousSibling;for(;g&&(g.nodeType===Node.COMMENT_NODE||g.nodeType===Node.TEXT_NODE&&!g.textContent.trim());)g=g.previousSibling;if(g&&g.nodeType===Node.TEXT_NODE)p=!0;else{for(g=i.nextSibling;g&&(g.nodeType===Node.COMMENT_NODE||g.nodeType===Node.TEXT_NODE&&!g.textContent.trim());)g=g.nextSibling;p=g!==null&&g.nodeType===Node.TEXT_NODE}if(e.isInlined=p,e.hasTransform&&!r){const k=e.layout.transitionMuteStore;k.get(i)||(e.inlineTransition=rs(i)),t===i?i.style.transform="none":(k.get(t)||(e.measuredInlineTransition=rs(t)),e.measuredInlineTransform=t.style.transform,t.style.transform="none")}let v=0,_=0,S=0,y=0;if(!r){const k=t.getBoundingClientRect();v=k.left,_=k.top,S=k.width,y=k.height}for(let k in a){const w=k==="transform"?f:s[k]||s.getPropertyValue&&s.getPropertyValue(k);D(w)||(a[k]=w)}a.left=v,a.top=_,a.clientLeft=r?0:t.clientLeft,a.clientTop=r?0:t.clientTop;let m,b;if(o)e.layout.absoluteCoords?(m=v,b=_):(m=0,b=0);else{const k=u||h,w=k.properties.left,E=k.properties.top,O=k.properties.clientLeft,P=k.properties.clientTop;if(e.layout.absoluteCoords)m=v-w-O,b=_-E-P;else if(k===h){const A=h.properties.left,C=h.properties.top,H=h.properties.clientLeft,$=h.properties.clientTop;m=v-A-H,b=_-C-$}else m=v-w-O,b=_-E-P}return a.x=m,a.y=b,a.width=S,a.height=y,e},jn=(e,t)=>{if(t)for(let s in t)e.properties[s]=t[s]},_s=(e,t)=>{const s=Ne(t.ease,e.$el,e.index,e.targets,null,null),r=Ee(s)?s:t.ease,i=!D(r)&&!D(r.ease);e.ease=i?r.ease:r,e.duration=i?r.settlingDuration:Ne(t.duration,e.$el,e.index,e.targets,null,null),e.delay=Ne(t.delay,e.$el,e.index,e.targets,null,null)},Nc=e=>{const t=e.$el.style,s=e.inlineStyles;s.length=0,e.layout.recordedProperties.forEach(r=>{s.push(r,t[r]||"")})},eo=e=>{const t=e.$el.style,s=e.inlineStyles;for(let r=0,i=s.length;r<i;r+=2){const n=s[r],o=s[r+1];o&&o!==""?t[n]=o:(t[n]="",t.removeProperty(n))}},Mc=e=>{const t=e.inlineTransforms,s=e.$el.style;!e.hasTransform||!t||e.hasTransform&&s.transform==="none"||t&&t==="none"?s.removeProperty("transform"):t&&(s.transform=t);const r=e.$measure;if(e.hasTransform&&r!==e.$el){const i=r.style,n=e.measuredInlineTransform;n&&n!==""?i.transform=n:i.removeProperty("transform")}e.measuredInlineTransform=null,e.inlineTransition!==null&&(ar(e.$el,e.inlineTransition),e.inlineTransition=null),r!==e.$el&&e.measuredInlineTransition!==null&&(ar(r,e.measuredInlineTransition),e.measuredInlineTransition=null)},to=e=>{(e.measuredIsRemoved||e.hasVisibilitySwap)&&(e.$el.style.removeProperty("display"),e.$el.style.removeProperty("visibility"),e.hasVisibilitySwap&&(e.$measure.style.removeProperty("display"),e.$measure.style.removeProperty("visibility"))),e.layout.pendingRemoval.delete(e.$el)},ei=(e,t,s)=>(t.properties={...e.properties},t.state=s,t.isTarget=e.isTarget,t.hasTransform=e.hasTransform,t.inlineTransforms=e.inlineTransforms,t.measuredIsVisible=e.measuredIsVisible,t.measuredDisplay=e.measuredDisplay,t.measuredIsRemoved=e.measuredIsRemoved,t.measuredHasDisplayNone=e.measuredHasDisplayNone,t.measuredHasVisibilityHidden=e.measuredHasVisibilityHidden,t.hasDisplayNone=e.hasDisplayNone,t.isInlined=e.isInlined,t.hasVisibilityHidden=e.hasVisibilityHidden,t),so=class{constructor(e){this.layout=e,this.rootNode=null,this.rootNodes=new Set,this.nodes=new Map,this.scrollX=0,this.scrollY=0}revert(){return this.forEachNode(e=>{this.layout.pendingRemoval.delete(e.$el),e.$el.removeAttribute("data-layout-id"),e.$measure.removeAttribute("data-layout-id")}),this.rootNode=null,this.rootNodes.clear(),this.nodes.clear(),this}getNode(e){if(!(!e||!e.dataset))return this.nodes.get(e.dataset.layoutId)}getComputedValue(e,t){const s=this.getNode(e);if(s)return s.properties[t]}forEach(e,t){let s=e,r=0;for(;s;)if(t(s,r++),s._head)s=s._head;else if(s._next)s=s._next;else{for(;s&&!s._next;)s=s.parentNode;s&&(s=s._next)}}forEachRootNode(e){this.forEach(this.rootNode,e)}forEachNode(e){for(const t of this.rootNodes)this.forEach(t,e)}registerElement(e,t){if(!e||e.nodeType!==1)return null;this.layout.transitionMuteStore.has(e)||this.layout.transitionMuteStore.set(e,rs(e));const s=[e,t],r=this.layout.root;let i=null;for(;s.length;){const n=s.pop(),o=s.pop();if(!o||o.nodeType!==1||Hs(o))continue;const a=n?n.measuredIsRemoved:!1,h=a?Ic:getComputedStyle(o),u=a?!0:h.display==="none",f=a?!0:h.visibility==="hidden",l=!u&&!f,d=o.dataset.layoutId,c=or(r,o);let p=d?this.nodes.get(d):null;if(p&&p.$el!==o){const v=or(r,p.$el),_=p.measuredIsVisible,S=!v&&(c||!c&&!_&&l),y=v&&!_&&l;if(S)Oc(p),p=Jn(o,n,this,p);else if(y){Kn(p,o,h,a);let m=o.lastElementChild;for(;m;)s.push(m,p),m=m.previousElementSibling;i||(i=p);continue}else{let m=o.lastElementChild;for(;m;)s.push(m,n),m=m.previousElementSibling;i||(i=p);continue}}else p=Jn(o,n,this,p);p.branchAdded=!1,p.branchRemoved=!1,p.branchNotRendered=!1,p.isTarget=!1,p.sizeChanged=!1,p.hasVisibilityHidden=f,p.hasDisplayNone=u,p.hasVisibilitySwap=f&&!p.measuredHasVisibilityHidden||u&&!p.measuredHasDisplayNone,this.nodes.set(p.id,p),p.parentNode=n||null,p._prev=null,p._next=null,n?(this.rootNodes.delete(p),n._head?(n._tail._next=p,p._prev=n._tail,n._tail=p):(n._head=p,n._tail=p)):this.rootNodes.add(p),Kn(p,p.$el,h,a);let g=o.lastElementChild;for(;g;)s.push(g,p),g=g.previousElementSibling;i||(i=p)}return i}ensureDetachedNode(e,t){if(!e||e===this.layout.root)return null;const s=e.dataset.layoutId,r=s?this.nodes.get(s):null;if(r&&r.$el===e)return r;let i=null,n=e.parentElement;for(;n&&n!==this.layout.root;){if(t.has(n)){i=this.ensureDetachedNode(n,t);break}n=n.parentElement}return this.registerElement(e,i)}record(){const e=this.layout,t=e.children,s=e.root,r=$e(t)?t:[t],i=[],n=t==="*"?s:Ie.root,o=[];let a=s.parentElement;for(;a&&a.nodeType===1;){const g=getComputedStyle(a);if(g.transform&&g.transform!=="none"){const v=a.style.transform||"",_=rs(a);o.push(a,v,_),a.style.transform="none"}a=a.parentElement}for(let g=0,v=r.length;g<v;g++){const _=r[g];i[g]=Be(_)?n.querySelectorAll(_):_}const h=Lt(i);this.nodes.clear(),this.rootNodes.clear();const u=this.registerElement(s,null);u.isTarget=!0,this.rootNode=u;const f=new Set;let l=0;const d=[];this.nodes.forEach(g=>{d.push(g.$el)}),this.nodes.forEach((g,v)=>{g.index=l++,g.targets=d,g&&g.measuredIsInsideRoot&&f.add(v)});const c=new Set,p=[];for(let g=0,v=h.length;g<v;g++){const _=h[g];if(!(!_||_.nodeType!==1||_===s)){if(!or(s,_)){const S=_.dataset.layoutId;if(!S||!f.has(S))continue}c.has(_)||(c.add(_),p.push(_))}}for(let g=0,v=p.length;g<v;g++)this.ensureDetachedNode(p[g],c);for(let g=0,v=h.length;g<v;g++){const _=h[g],S=this.getNode(_);if(S){let y=S;for(;y&&!y.isTarget;)y.isTarget=!0,y=y.parentNode}}this.scrollX=window.scrollX,this.scrollY=window.scrollY,this.forEachNode(Mc);for(let g=0,v=o.length;g<v;g+=3){const _=o[g],S=o[g+1],y=o[g+2];S&&S!==""?_.style.transform=S:_.style.removeProperty("transform"),ar(_,y)}return this}};function is(e){const t={},s={};for(let r in e){const i=e[r],n=r==="ease";r==="duration"||r==="delay"||n?s[r]=i:t[r]=i}return[t,s]}var ro=class{constructor(e,t={}){Ie.current&&Ie.current.register(this);const s=is(t.swapAt),r=is(t.enterFrom),i=is(t.leaveTo),n=t.properties;if(t.duration=U(t.duration,350),t.delay=U(t.delay,0),t.ease=U(t.ease,"inOut(3.5)"),this.params=t,this.root=Lt(e)[0],this.id=t.id||Ac++,this.children=t.children||"*",this.absoluteCoords=!1,this.swapAtParams=at(t.swapAt||{opacity:0},{ease:"inOut(1.75)"}),this.enterFromParams=t.enterFrom||{opacity:0},this.leaveToParams=t.leaveTo||{opacity:0},this.properties=new Set(["opacity","fontSize","color","backgroundColor","borderRadius","border","filter","clipPath"]),s[0])for(let o in s[0])this.properties.add(o);if(r[0])for(let o in r[0])this.properties.add(o);if(i[0])for(let o in i[0])this.properties.add(o);if(n)for(let o=0,a=n.length;o<a;o++)this.properties.add(n[o]);this.recordedProperties=new Set(["display","visibility","translate","position","left","top","marginLeft","marginTop","width","height","maxWidth","maxHeight","minWidth","minHeight"]),this.properties.forEach(o=>this.recordedProperties.add(o)),this.pendingRemoval=new WeakSet,this.transitionMuteStore=new Map,this.oldState=new so(this),this.newState=new so(this),this.timeline=null,this.transformAnimation=null,this.animating=[],this.swapping=[],this.leaving=[],this.entering=[],this.oldState.record(),lr(this.transitionMuteStore)}revert(){return this.root.classList.remove("is-animated"),this.timeline&&(this.timeline.complete(),this.timeline=null),this.transformAnimation&&(this.transformAnimation.complete(),this.transformAnimation=null),this.animating.length=this.swapping.length=this.leaving.length=this.entering.length=0,this.oldState.revert(),this.newState.revert(),requestAnimationFrame(()=>lr(this.transitionMuteStore)),this}record(){return this.transformAnimation&&(this.transformAnimation.cancel(),this.transformAnimation=null),this.oldState.record(),this.timeline&&(this.timeline.cancel(),this.timeline=null),this.newState.forEachRootNode(eo),this}animate(e={}){const t={ease:U(e.ease,this.params.ease),delay:U(e.delay,this.params.delay),duration:U(e.duration,this.params.duration)},s={id:this.id},r=U(e.onComplete,this.params.onComplete),i=U(e.onPause,this.params.onPause);for(let x in fs)x!=="ease"&&x!=="duration"&&x!=="delay"&&(D(e[x])?D(this.params[x])||(s[x]=this.params[x]):s[x]=e[x]);s.onComplete=()=>{const x=e.autoplay,M=z.editor;if(x&&x.linked||M&&M.showPanel){r&&r(this.timeline);return}this.transformAnimation&&this.transformAnimation.cancel(),g.forEachRootNode(I=>{to(I),eo(I)});for(let I=0,L=w.length;I<L;I++){const q=w[I];q.style.transform=g.getComputedValue(q,"transform")}this.root.classList.contains("is-animated")&&(this.root.classList.remove("is-animated"),r&&r(this.timeline)),requestAnimationFrame(()=>{this.root.classList.contains("is-animated")||lr(this.transitionMuteStore)})},s.onPause=()=>{const x=e.autoplay;if(x&&x.linked){r&&r(this.timeline),i&&i(this.timeline);return}this.root.classList.contains("is-animated")&&(this.transformAnimation&&this.transformAnimation.cancel(),g.forEachRootNode(to),this.root.classList.remove("is-animated"),r&&r(this.timeline),i&&i(this.timeline))},s.composition=!1;const n=at(at(e.swapAt||{},this.swapAtParams),t),o=at(at(e.enterFrom||{},this.enterFromParams),t),a=at(at(e.leaveTo||{},this.leaveToParams),t),[h,u]=is(n),[f,l]=is(o),[d,c]=is(a),p=this.oldState,g=this.newState,v=this.animating,_=this.swapping,S=this.entering,y=this.leaving,m=this.pendingRemoval;v.length=_.length=S.length=y.length=0,p.forEachRootNode(Rc),g.record(),g.forEachRootNode(Nc);const b=[],k=[],w=[],E=[],O=g.rootNode,P=O.$el;g.forEachRootNode(x=>{const M=x.$el,I=x.id,L=x.parentNode,q=L?L.branchAdded:!1,K=L?L.branchRemoved:!1,G=L?L.branchNotRendered:!1;let W=p.nodes.get(I);const ee=!W;ee?(W=ei(x,{},p),p.nodes.set(I,W),W.measuredIsRemoved=!0):W.measuredIsRemoved&&!x.measuredIsRemoved&&(ei(x,W,p),W.measuredIsRemoved=!0);const Y=W.parentNode,re=(Y?Y.id:null)!==(L?L.id:null),ge=W.$el!==x.$el,he=W.measuredIsRemoved,le=x.measuredIsRemoved;if(!W.measuredIsRemoved&&!le&&!ee&&(re||ge)){const we=W.properties.left,Te=W.properties.top,xe=L||g.rootNode,me=xe.id?p.nodes.get(xe.id):null,te=me?me.properties.left:xe.properties.left,T=me?me.properties.top:xe.properties.top,N=me?me.properties.clientLeft:xe.properties.clientLeft,B=me?me.properties.clientTop:xe.properties.clientTop;W.properties.x=we-te-N,W.properties.y=Te-T-B}x.hasVisibilitySwap&&(x.hasVisibilityHidden&&(x.$el.style.visibility="visible",x.$measure.style.visibility="hidden"),x.hasDisplayNone&&(x.$el.style.display=W.measuredDisplay||x.measuredDisplay||"",x.$measure.style.visibility="hidden"));const J=m.has(M),ce=W.measuredIsVisible,fe=x.measuredIsVisible,ie=!ce&&fe&&!G,ae=!le&&(he||J)&&!q,ke=le&&!he&&!K,ye=ke||le&&J&&!K;x.branchAdded=q||ae,x.branchRemoved=K||ye,x.branchNotRendered=G||le,le&&ce&&(x.$el.style.display=W.measuredDisplay,x.$el.style.visibility="visible",ei(W,x,g)),ke?(x.isTarget&&(y.push(M),x.isLeaving=!0),m.add(M)):!le&&J&&m.delete(M),ae&&!G||ie?(jn(W,f),x.isTarget&&(S.push(M),x.isEntering=!0)):ye&&!G&&jn(x,d),x!==O&&x.isTarget&&!x.isEntering&&!x.isLeaving&&v.push(M),b.push(M)});let A=0,C=0,H=0;g.forEachRootNode(x=>{const M=x.$el,I=x.parentNode,L=p.nodes.get(x.id),q=x.properties,K=L.properties;let G=I!==O&&I;for(;G&&!G.isTarget&&G!==O;)G=G.parentNode;x===O?(x.index=0,x.targets=v,_s(x,t)):x.isEntering?(x.index=G?G.index:A,x.targets=G?v:S,_s(x,l),A++):x.isLeaving?(x.index=G?G.index:C,x.targets=G?v:y,C++,_s(x,c)):x.isTarget?(x.index=H++,x.targets=v,_s(x,t)):(x.index=G?G.index:0,x.targets=v,_s(x,u)),L.index=x.index,L.targets=x.targets;for(let re in q)q[re]=Ne(q[re],M,x.index,x.targets,null,null),K[re]=Ne(K[re],M,L.index,L.targets,null,null);const W=1,ee=Math.abs(q.width-K.width)>W,Y=Math.abs(q.height-K.height)>W;if(x.sizeChanged=ee||Y,x.isTarget&&(!x.measuredIsRemoved&&L.measuredIsVisible||x.measuredIsRemoved&&x.measuredIsVisible)){(q.transform!=="none"||K.transform!=="none")&&(x.hasTransform=!0,w.push(M));for(let re in q)if(re!=="transform"&&q[re]!==K[re]){k.push(M);break}}x.isTarget||(_.push(M),x.sizeChanged&&I&&I.isTarget&&I.sizeChanged&&(h.transform&&(x.hasTransform=!0,w.push(M)),E.push(M)))});const $={delay:x=>g.getNode(x).delay,duration:x=>g.getNode(x).duration,ease:x=>g.getNode(x).ease};if(s.defaults=$,this.timeline=In(s),!k.length&&!w.length&&!_.length)return lr(this.transitionMuteStore),this.timeline.complete();if(b.length){this.root.classList.add("is-animated");for(let x=0,M=b.length;x<M;x++){const I=b[x],L=I.dataset.layoutId,q=p.nodes.get(L),K=g.nodes.get(L),G=q.properties;K.isInlined||((q.measuredDisplay==="grid"||K.measuredDisplay==="grid")&&I.style.setProperty("display","block","important"),(I!==P||this.absoluteCoords)&&(I.style.position=this.absoluteCoords?"fixed":"absolute",I.style.left="0px",I.style.top="0px",I.style.marginLeft="0px",I.style.marginTop="0px",I.style.translate=`${G.x}px ${G.y}px`),I===P&&K.measuredPosition==="static"&&(I.style.position="relative",I.style.left="0px",I.style.top="0px")),I.style.width=`${G.width}px`,I.style.height=`${G.height}px`,I.style.minWidth="auto",I.style.minHeight="auto",I.style.maxWidth="none",I.style.maxHeight="none"}(p.scrollX!==window.scrollX||p.scrollY!==window.scrollY)&&requestAnimationFrame(()=>window.scrollTo(p.scrollX,p.scrollY));for(let x=0,M=k.length;x<M;x++){const I=k[x],L=I.dataset.layoutId,q=p.nodes.get(L),K=g.nodes.get(L),G=q.properties,W=K.properties;let ee=!1;const Y={composition:"none"};G.width!==W.width&&(Y.width=[G.width,W.width],ee=!0),G.height!==W.height&&(Y.height=[G.height,W.height],ee=!0),!K.hasTransform&&!K.isInlined&&(Y.translate=[`${G.x}px ${G.y}px`,`${W.x}px ${W.y}px`],ee=!0),this.properties.forEach(re=>{const ge=G[re],he=W[re];re!=="transform"&&ge!==he&&(Y[re]=[ge,he],ee=!0)}),ee&&this.timeline.add(I,Y,0)}}if(_.length){for(let x=0,M=_.length;x<M;x++){const I=_[x],L=p.getNode(I),q=L.properties;I.style.width=`${q.width}px`,I.style.height=`${q.height}px`,I.style.minWidth="auto",I.style.minHeight="auto",I.style.maxWidth="none",I.style.maxHeight="none",L.isInlined||(I.style.translate=`${q.x}px ${q.y}px`),this.properties.forEach(K=>{K!=="transform"&&(I.style[K]=`${p.getComputedValue(I,K)}`)})}for(let x=0,M=_.length;x<M;x++){const I=_[x],L=g.getNode(I),q=L.properties;this.timeline.call(()=>{I.style.width=`${q.width}px`,I.style.height=`${q.height}px`,I.style.minWidth="auto",I.style.minHeight="auto",I.style.maxWidth="none",I.style.maxHeight="none",L.isInlined||(I.style.translate=`${q.x}px ${q.y}px`),this.properties.forEach(K=>{K!=="transform"&&(I.style[K]=`${g.getComputedValue(I,K)}`)})},L.delay+L.duration/2)}if(E.length){const x=xt(g.nodes.get(E[0].dataset.layoutId).ease),M=L=>1-x(1-L),I={};if(h)for(let L in h)L!=="transform"&&(I[L]=[{from:q=>p.getComputedValue(q,L),to:h[L]},{from:h[L],to:q=>g.getComputedValue(q,L),ease:M}]);this.timeline.add(E,I,0)}}const V=w.length;if(V){for(let x=0;x<V;x++){const M=w[x],I=g.getNode(M);I.isInlined||(M.style.translate=`${p.getComputedValue(M,"x")}px ${p.getComputedValue(M,"y")}px`),M.style.transform=p.getComputedValue(M,"transform"),E.includes(M)&&(I.ease=Ne(n.ease,M,I.index,I.targets,null,null),I.duration=Ne(n.duration,M,I.index,I.targets,null,null))}this.transformAnimation=Qn.animate(w,{translate:x=>g.getNode(x).isInlined?"0px 0px":`${g.getComputedValue(x,"x")}px ${g.getComputedValue(x,"y")}px`,transform:x=>{const M=g.getComputedValue(x,"transform");if(!E.includes(x))return M;const I=p.getComputedValue(x,"transform"),L=g.getNode(x);return[I,Ne(h.transform,x,L.index,L.targets,null,null),M]},autoplay:!1,...$}),this.timeline.sync(this.transformAnimation,0)}return this.timeline.init()}update(e,t={}){return this.record(),e(this),this.animate(t)}},Dc=(e,t)=>new ro(e,t),lt=lc,cr={},Bc=(e,t=0)=>(...s)=>t?r=>e(...s,r):r=>e(r,...s),io=e=>(...t)=>{const s=e(...t);return new Proxy(oe,{apply:(r,i,[n])=>s(n),get:(r,i)=>{if(cr[i])return io((...n)=>{const o=cr[i](...n);return a=>o(s(a))})}})},ct=(e,t,s=0)=>{const r=(...i)=>(i.length<t.length?io(Bc(t,s)):t)(...i);return cr[e]||(cr[e]=r),r},no=ct("roundPad",lt.roundPad),oo=ct("padStart",lt.padStart),ao=ct("padEnd",lt.padEnd),lo=ct("wrap",lt.wrap),co=ct("mapRange",lt.mapRange),uo=ct("degToRad",lt.degToRad),ho=ct("radToDeg",lt.radToDeg),fo=ct("snap",lt.snap),po=ct("clamp",lt.clamp),go=ct("round",lt.round),mo=ct("lerp",lt.lerp,1),vo=ct("damp",lt.damp,1),Ss=(e=0,t=1,s=0)=>{const r=10**s;return Math.floor((Math.random()*(t-e+1/r)+e)*r)/r},Hc=0,ks=(e,t=0,s=1,r=0)=>{let i=e===void 0?Hc++:e;return(n=t,o=s,a=r)=>{i+=1831565813,i=Math.imul(i^i>>>15,i|1),i^=i+Math.imul(i^i>>>7,i|61);const h=10**a;return Math.floor((((i^i>>>14)>>>0)/4294967296*(o-n+1/h)+n)*h)/h}},yo=e=>e[Ss(0,e.length-1)],ti=(e,t=Ss)=>{let s=e.length,r,i;for(;s;)i=t(0,--s),r=e[s],e[s]=e[i],e[i]=r;return e},ws=(e,t={})=>{let s=[],r=0,i,n=null;const o=t.from,a=t.reversed,h=t.ease,u=!D(h),f=u&&!D(h.ease)?h.ease:u?xt(h):null,l=t.grid,d=l===!0,c=t.axis,p=t.total,g=D(o)||o===0||o==="first",v=o==="center",_=o==="last",S=o==="random",y=$e(o),m=$e(e),b=t.use,k=Ft(m?e[0]:e),w=m?Ft(e[1]):0,E=en.exec((m?e[1]:e)+""),O=t.start||0+(m?k:0),P=t.seed,A=!D(P)&&P!==!1?ks(P===!0?0:P):Ss,C=t.jitter,H=!D(C),$=$e(C),V=$?C[0]:C||0,x=$?C[1]:C||0;let M=g?0:qe(o)?o:0;return(I,L,q,K,G)=>{const[W]=Lt(I),ee=D(p)?q.length:p,Y=D(b)?!1:Ee(b)?b(W,L,ee):Ut(W,b),re=qe(Y)||Be(Y)&&qe(+Y)?+Y:L,ge=re>=0&&re<ee?re:L;if(v&&(M=(ee-1)/2),_&&(M=ee-1),!s.length){if(d){let J=!0,ce=!1,fe=1/0,ie=1/0,ae=1/0,ke=-1/0,ye=-1/0,we=-1/0;const Te=[],xe=[],me=[];for(let te=0;te<ee;te++){const T=q[te];let N=0,B=0,R=0,X=!1;if(T&&Ee(T.getBoundingClientRect)){const j=T.getBoundingClientRect();N=j.left+j.width/2,B=j.top+j.height/2,X=!0}else{const j=T;j&&qe(j.x)&&qe(j.y)&&(N=j.x,B=j.y,qe(j.z)&&(R=j.z,ce=!0),X=!0)}if(!X){J=!1;break}Te.push(N),xe.push(B),me.push(R),N<fe&&(fe=N),B<ie&&(ie=B),R<ae&&(ae=R),N>ke&&(ke=N),B>ye&&(ye=B),R>we&&(we=R)}if(J){let te=Te[0],T=xe[0],N=me[0];y?(te=fe+o[0]*(ke-fe),T=ie+o[1]*(ye-ie),N=ce?ae+(o.length>=3?o[2]:.5)*(we-ae):0):v?(te=(fe+ke)/2,T=(ie+ye)/2,N=(ae+we)/2):_?(te=Te[ee-1],T=xe[ee-1],N=me[ee-1]):qe(o)&&(te=Te[o],T=xe[o],N=me[o]);for(let R=0;R<ee;R++){const X=te-Te[R],j=T-xe[R],se=N-me[R];let be=nt(X*X+j*j+(ce?se*se:0));c==="x"&&(be=-X),c==="y"&&(be=-j),c==="z"&&(be=-se),s.push(be)}let B=1/0;for(let R=0;R<ee;R++){const X=ot(s[R]);X>0&&X<B&&(B=X)}if(B>0&&B<1/0)for(let R=0;R<ee;R++)s[R]=s[R]/B}else for(let te=0;te<ee;te++)s.push(ot(M-te))}else for(let J=0;J<ee;J++)if(!l)s.push(ot(M-J));else{const ce=l.length,fe=l[0]*l[1];let ie,ae,ke;y?(ie=o[0]*(l[0]-1),ae=o[1]*(l[1]-1),ke=ce===3?(o.length>=3?o[2]:.5)*(l[2]-1):0):v?(ie=(l[0]-1)/2,ae=(l[1]-1)/2,ke=ce===3?(l[2]-1)/2:0):(ie=M%l[0],ae=Kt(M/l[0])%l[1],ke=ce===3?Kt(M/fe):0);const ye=J%l[0],we=Kt(J/l[0])%l[1],Te=ce===3?Kt(J/fe):0,xe=ie-ye,me=ae-we,te=ke-Te;let T=nt(xe*xe+me*me+(ce===3?te*te:0));c==="x"&&(T=-xe),c==="y"&&(T=-me),c==="z"&&(T=-te),s.push(T)}r=s[0];for(let J=1;J<ee;J++)s[J]>r&&(r=s[J]);if(f||a)for(let J=0;J<ee;J++){let ce=s[J];f&&(ce=f(ce/r)*r),a&&(ce=c?-ce:ot(r-ce)),s[J]=ce}if(H){n=new Array(ee);for(let J=0;J<ee;J++)n[J]=A(-1,1,4)}S&&(s=ti(s,A))}const he=m?(w-k)/r:k;D(i)&&(i=G?ms(G,D(t.start)?G.iterationDuration:O):O);let le=i+(he*F(s[ge],2)||0);if(H){const J=r?s[ge]/r:0,ce=V+(x-V)*J;le=le+n[ge]*ce}return t.modifier&&(le=t.modifier(le)),E&&(le=`${le}${E[2]}`),le}},$c=Gt({$:()=>Lt,addChild:()=>mt,clamp:()=>po,cleanInlineStyles:()=>gn,createSeededRandom:()=>ks,damp:()=>vo,degToRad:()=>uo,forEachChildren:()=>Se,get:()=>It,keepTime:()=>tr,lerp:()=>mo,mapRange:()=>co,padEnd:()=>ao,padStart:()=>oo,radToDeg:()=>ho,random:()=>Ss,randomPick:()=>yo,remove:()=>Mn,removeChild:()=>gt,round:()=>go,roundPad:()=>no,set:()=>Ct,shuffle:()=>ti,snap:()=>fo,stagger:()=>ws,sync:()=>Jr,wrap:()=>lo}),bo=e=>{const t=st(e)[0];return!t||!Hs(t)?console.warn(`${e} is not a valid SVGGeometryElement`):t},si=(e,t,s,r,i)=>{const n=s+r,o=i?Math.max(0,Math.min(n,t)):(n%t+t)%t;return e.getPointAtLength(o)},ri=(e,t,s=0)=>r=>{const i=+e.getTotalLength(),n=r[Ir],o=e.getCTM(),a=s===0;return{from:0,to:i,modifier:h=>{const u=h+s*i;if(t==="a"){const f=si(e,i,u,-1,a),l=si(e,i,u,1,a);return qs(l.y-f.y,l.x-f.x)*180/bt}else{const f=si(e,i,u,0,a);return t==="x"?n||!o?f.x:f.x*o.a+f.y*o.c+o.e:n||!o?f.y:f.x*o.b+f.y*o.d+o.f}}}},_o=(e,t=0)=>{const s=bo(e);if(s)return{translateX:ri(s,"x",t),translateY:ri(s,"y",t),rotate:ri(s,"a",t)}},qc=e=>{let t=1;if(e&&e.getCTM){const s=e.getCTM();s&&(t=(nt(s.a*s.a+s.b*s.b)+nt(s.c*s.c+s.d*s.d))/2)}return t},Fc=(e,t,s)=>{const r=Ye,i=getComputedStyle(e),n=i.strokeLinecap,o=i.vectorEffect==="non-scaling-stroke"?e:null;let a=n;const h=new Proxy(e,{get(u,f){const l=u[f];return f===Ji?u:f==="setAttribute"?(...d)=>{if(d[0]==="draw"){const c=d[1].split(" "),p=+c[0],g=+c[1],v=qc(o),_=p*-r*v,S=g*r*v+_,y=r*v+(p===0&&g===1||p===1&&g===0?0:10*v)-S;if(n!=="butt"){const m=p===g?"butt":n;a!==m&&(u.style.strokeLinecap=`${m}`,a=m)}u.setAttribute("stroke-dashoffset",`${_}`),u.setAttribute("stroke-dasharray",`${S} ${y}`)}return Reflect.apply(l,u,d)}:Ee(l)?(...d)=>Reflect.apply(l,u,d):l}});return e.getAttribute("pathLength")!==`${r}`&&(e.setAttribute("pathLength",`${r}`),h.setAttribute("draw",`${t} ${s}`)),h},So=(e,t=0,s=0)=>st(e).map(r=>Fc(r,t,s)),ko=(e,t=.33)=>(s,r,i,n)=>{if(!(s.tagName||"").toLowerCase().match(/^(path|polygon|polyline)$/))throw new Error(`Can't morph a <${s.tagName}> SVG element. Use <path>, <polygon> or <polyline>.`);const o=bo(e);if(!o)throw new Error("Can't morph to an invalid target. 'path2' must resolve to an existing <path>, <polygon> or <polyline> SVG element.");if(!(o.tagName||"").toLowerCase().match(/^(path|polygon|polyline)$/))throw new Error(`Can't morph a <${o.tagName}> SVG element. Use <path>, <polygon> or <polyline>.`);const a=s.tagName==="path",h=a?" ":",",u=n?n._value:null;u&&s.setAttribute(a?"d":"points",u);let f="",l="";if(!t)f=s.getAttribute(a?"d":"points"),l=o.getAttribute(a?"d":"points");else{const d=s.getTotalLength(),c=o.getTotalLength(),p=Math.max(Math.ceil(d*t),Math.ceil(c*t));for(let g=0;g<p;g++){const v=g/(p-1),_=s.getPointAtLength(d*v),S=o.getPointAtLength(c*v),y=a?g===0?"M":"L":"";f+=y+F(_.x,3)+h+_.y+" ",l+=y+F(S.x,3)+h+S.y+" "}}return[f,l]},Vc=Gt({createDrawable:()=>So,createMotionPath:()=>_o,morphTo:()=>ko}),ur=typeof Intl<"u"&&Intl.Segmenter,zc=/\{value\}/g,Uc=/\{i\}/g,ii=/(\s+)/,ni=/^\s+$/,oi="line",xs="word",Ts="char",Cs="data-line",ai=null,li=null,hr=null,wo=e=>e.isWordLike||e.segment===" "||qe(+e.segment),ci=e=>e.setAttribute("aria-hidden","true"),dr=(e,t)=>[...e.querySelectorAll(`[data-${t}]:not([data-${t}] [data-${t}])`)],Wc={line:"#00D672",word:"#FF4B4B",char:"#5A87FF"},xo=e=>{if(!e.childElementCount&&!e.textContent.trim()){const t=e.parentElement;e.remove(),t&&xo(t)}},To=(e,t,s)=>{const r=e.getAttribute(Cs);if(r!==null&&+r!==t||e.tagName==="BR"){s.add(e);const n=e.previousSibling,o=e.nextSibling;n&&n.nodeType===3&&ni.test(n.textContent)&&s.add(n),o&&o.nodeType===3&&ni.test(o.textContent)&&s.add(o)}let i=e.childElementCount;for(;i--;)To(e.children[i],t,s);return s},ui=(e,t={})=>{let s="";t||(t={});const r=Be(t.class)?` class="${t.class}"`:"",i=U(t.clone,!1),n=U(t.wrap,!1),o=n?n===!0?"clip":n:i?"clip":!1;if(n&&(s+=`<span${o?` style="overflow:${o};"`:""}>`),s+=`<span${r}${i?' style="position:relative;"':""} data-${e}="{i}">`,i){const a=i==="left"?"-100%":i==="right"?"100%":"0",h=i==="top"?"-100%":i==="bottom"?"100%":"0";s+="<span>{value}</span>",s+=`<span inert style="position:absolute;top:${h};left:${a};white-space:nowrap;">{value}</span>`}else s+="{value}";return s+="</span>",n&&(s+="</span>"),s},hi=(e,t,s,r,i,n,o,a,h)=>{const u=i===oi,f=i===Ts,l=`_${i}_`,d=Ee(e)?e(s):e,c=u?"block":"inline-block";hr.innerHTML=d.replace(zc,`<i class="${l}"></i>`).replace(Uc,`${f?h:u?o:a}`);const p=hr.content,g=p.firstElementChild,v=p.querySelector(`[data-${i}]`)||g,_=p.querySelectorAll(`i.${l}`),S=_.length;if(S){g.style.display=c,v.style.display=c,v.setAttribute(Cs,`${o}`),u||(v.setAttribute("data-word",`${a}`),f&&v.setAttribute("data-char",`${h}`));let y=S;for(;y--;){const m=_[y],b=m.parentElement;b.style.display=c,u?b.innerHTML=s.innerHTML:b.replaceChild(s.cloneNode(!0),m)}t.push(v),r.appendChild(p)}else console.warn('The expression "{value}" is missing from the provided template.');return n&&(g.style.outline=`1px dotted ${Wc[i]}`),g},fr=class{constructor(e,t={}){ai||(ai=ur?new ur([],{granularity:xs}):{segment:c=>{const p=[],g=c.split(ii);for(let v=0,_=g.length;v<_;v++){const S=g[v];p.push({segment:S,isWordLike:!ni.test(S)})}return p}}),li||(li=ur?new ur([],{granularity:"grapheme"}):{segment:c=>[...c].map(p=>({segment:p}))}),!hr&&yt&&(hr=Q.createElement("template")),Ie.current&&Ie.current.register(this);const{words:s,chars:r,lines:i,accessible:n,includeSpaces:o,debug:a}=t,h=(e=$e(e)?e[0]:e)&&e.nodeType?e:(Ur(e)||[])[0],u=i===!0?{}:i,f=s===!0||D(s)?{}:s,l=r===!0?{}:r;this.debug=U(a,!1),this.includeSpaces=U(o,!1),this.accessible=U(n,!0),this.linesOnly=u&&!f&&!l,this.lineTemplate=De(u)?ui(oi,u):u,this.wordTemplate=De(f)||this.linesOnly?ui(xs,f):f,this.charTemplate=De(l)?ui(Ts,l):l,this.$target=h,this.html=h&&h.innerHTML,this.lines=[],this.words=[],this.chars=[],this.effects=[],this.effectsCleanups=[],this.cache=null,this.ready=!1,this.width=0,this.resizeTimeout=null;const d=()=>this.html&&(u||f||l)&&this.split();this.resizeObserver=new ResizeObserver(()=>{clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{const c=h.offsetWidth;c!==this.width&&(this.width=c,d())},150)}),this.lineTemplate&&!this.ready?Q.fonts.ready.then(d):d(),h?this.resizeObserver.observe(h):console.warn("No Text Splitter target found.")}addEffect(e){if(!Ee(e))return console.warn("Effect must return a function."),this;const t=tr(e);return this.effects.push(t),this.ready&&(this.effectsCleanups[this.effects.length-1]=t(this)),this}revert(){return clearTimeout(this.resizeTimeout),this.lines.length=this.words.length=this.chars.length=0,this.resizeObserver.disconnect(),this.effectsCleanups.forEach(e=>Ee(e)?e(this):e.revert&&e.revert()),this.$target.innerHTML=this.html,this}splitNode(e){const t=this.wordTemplate,s=this.charTemplate,r=this.includeSpaces,i=this.debug,n=e.nodeType;if(n===3){const o=e.nodeValue;if(o.trim()){const a=[],h=this.words,u=this.chars,f=ai.segment(o),l=Q.createDocumentFragment();let d=null;for(const c of f){const p=c.segment,g=wo(c);if(!d||g&&d&&wo(d))a.push(p);else{const v=a.length-1,_=a[v];!ii.test(_)&&!ii.test(p)?a[v]+=p:a.push(p)}d=c}for(let c=0,p=a.length;c<p;c++){const g=a[c];if(g.trim()){const v=a[c+1],_=r&&v&&!v.trim(),S=g,y=s?li.segment(S):null,m=s?Q.createDocumentFragment():Q.createTextNode(_?g+" ":g);if(s){const b=[...y];for(let k=0,w=b.length;k<w;k++){const E=b[k],O=k===w-1&&_?E.segment+" ":E.segment,P=Q.createTextNode(O);hi(s,u,P,m,Ts,i,-1,h.length,u.length)}}t?hi(t,h,m,l,xs,i,-1,h.length,u.length):s?l.appendChild(m):l.appendChild(Q.createTextNode(g)),_&&c++}else{if(c&&r)continue;l.appendChild(Q.createTextNode(g))}}e.parentNode.replaceChild(l,e)}}else if(n===1){const o=[...e.childNodes];for(let a=0,h=o.length;a<h;a++)this.splitNode(o[a])}}split(e=!1){const t=this.$target,s=!!this.cache&&!e,r=this.lineTemplate,i=this.wordTemplate,n=this.charTemplate,o=Q.fonts.status!=="loading",a=r&&o;this.ready=!r||o,(a||e)&&this.effectsCleanups.forEach(l=>Ee(l)&&l(this)),s||(e&&(t.innerHTML=this.html,this.words.length=this.chars.length=0),this.splitNode(t),this.cache=t.innerHTML),a&&(s&&(t.innerHTML=this.cache),this.lines.length=0,i&&(this.words=dr(t,xs))),n&&(a||i)&&(this.chars=dr(t,Ts));const h=this.words.length?this.words:this.chars;let u,f=0;for(let l=0,d=h.length;l<d;l++){const c=h[l],{top:p,height:g}=c.getBoundingClientRect();!D(u)&&p-u>g*.5&&f++,c.setAttribute(Cs,`${f}`);const v=c.querySelectorAll(`[${Cs}]`);let _=v.length;for(;_--;)v[_].setAttribute(Cs,`${f}`);u=p}if(a){const l=Q.createDocumentFragment(),d=new Set,c=[];for(let p=0;p<f+1;p++){const g=t.cloneNode(!0);To(g,p,new Set).forEach(v=>{const _=v.parentNode;_&&(v.nodeType===1&&d.add(_),_.removeChild(v))}),c.push(g)}d.forEach(xo);for(let p=0,g=c.length;p<g;p++)hi(r,this.lines,c[p],l,oi,this.debug,p);t.innerHTML="",t.appendChild(l),i&&(this.words=dr(t,xs)),n&&(this.chars=dr(t,Ts))}if(this.linesOnly){const l=this.words;let d=l.length;for(;d--;){const c=l[d];c.replaceWith(c.textContent)}l.length=0}if(this.accessible&&(a||!s)){const l=Q.createElement("span");l.style.cssText="position:absolute;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);width:1px;height:1px;white-space:nowrap;",l.innerHTML=this.html,t.insertBefore(l,t.firstChild),this.lines.forEach(ci),this.words.forEach(ci),this.chars.forEach(ci)}return this.width=t.offsetWidth,(a||e)&&this.effects.forEach((l,d)=>this.effectsCleanups[d]=l(this)),this}refresh(){this.split(!0)}},Co=(e,t)=>new fr(e,t),Ps=(e,t)=>(console.warn("text.split() is deprecated, import splitText() directly, or text.splitText()"),new fr(e,t)),Po=e=>{let t="";for(let s=0,r=e.length;s<r;s++)if(s+2<r&&e[s+1]==="-"&&e.charCodeAt(s)<e.charCodeAt(s+2)){const i=e.charCodeAt(s),n=e.charCodeAt(s+2);for(let o=i;o<=n;o++)t+=String.fromCharCode(o);s+=2}else t+=e[s];return t},Eo={lowercase:"a-z",uppercase:"A-Z",numbers:"0-9",symbols:"!%#_|*+=",braille:"⠀-⣿",blocks:"▀-▟",shades:"░-▓"},di=new WeakMap,Ao=(e={})=>{e||(e={});const t=e.chars,s=xt(e.ease||"linear"),r=e.text,i=e.from,n=e.reversed||!1,o=e.perturbation||0,a=e.cursor,h=a===!0?"_":typeof a=="number"?String.fromCharCode(a):typeof a=="string"?a:"",u=h.length,f=e.seed||0,l=e.override!==void 0?e.override:!0,d=e.revealRate||60,c=1e3*z.timeScale/d,p=e.settleDuration||300*z.timeScale,g=e.settleRate||30,v=e.duration,_=e.revealDelay,S=e.delay,y=e.onChange||oe;return(m,b,k,w)=>{const E=typeof t=="function"?t(m,b,k):t||"a-zA-Z0-9!%#_",O=Po(Eo[E]||E),P=O.length-1,A=typeof v=="function"?v(m,b,k):v,C=typeof _=="function"?_(m,b,k):_||0,H=typeof S=="function"?S(m,b,k):S||0,$=f?ks(f):ks();di.has(m)||di.set(m,m.textContent);const V=w?w._value:m.textContent,x=r!==void 0?typeof r=="function"?r(m,b,k):r:w?w._value:di.get(m),M=x===" "||x===" "?" ":x,I=V===" "?0:V.length,L=M.length,q=l===!0?O:typeof l=="string"&&l.length>0?Po(Eo[l]||l):null,K=q?q.length-1:0,G=l===" "?" ":null,W=l===""?L:Math.max(I,L),ee=A>0?A:(W-1)*c+p,Y=F((ee+C)/z.timeScale,0)*z.timeScale,re=C>0?F(C/Y,12):0,ge=i===void 0||i==="auto"?L<I?"right":"left":i,he=new Int32Array(W);if(ge==="random"){for(let R=0;R<W;R++)he[R]=R;for(let R=W-1;R>0;R--){const X=$(0,R),j=he[R];he[R]=he[X],he[X]=j}}else{const R=ge==="right"?(l===""||!I?W:I)-1:ge==="center"?((l===""||!I?W:I)-1)/2:typeof ge=="number"?ge:0,X=Math.abs,j=new Array(W);for(let se=0;se<W;se++)j[se]=se;j.sort((se,be)=>X(se-R)-X(be-R));for(let se=0;se<W;se++)he[j[se]]=se}if(n){const R=W-1;for(let X=0;X<W;X++)he[X]=R-he[X]}const le=F(p/ee,12),J=F((1-le)/W,12),ce=u*J,fe=F(1e3*z.timeScale/(g*Y),12),ie=new Float32Array(W),ae=new Float32Array(W),ke=o>0?o*le:0;for(let R=0;R<W;R++){const X=ke>0?($(0,2e3)-1e3)/1e3*ke:0,j=ke>0?($(0,2e3)-1e3)/1e3*ke:0;ie[R]=he[R]*J+X,ae[R]=Math.ceil((ie[R]+le+j)/fe)*fe}if(L<W&&ge!=="left"&&ge!=="right"&&ge!=="random"){let R=0;for(let se=L;se<W;se++)ae[se]>R&&(R=ae[se]);const X=new Array(L);for(let se=0;se<L;se++)X[se]=se;X.sort((se,be)=>he[se]-he[be]);const j=(1-R)/L;for(let se=0;se<L;se++){const be=R+se*j;be>ae[X[se]]&&(ae[X[se]]=be)}}const ye=new Array(W);for(let R=0;R<W;R++)ye[R]=O[$(0,P)];const we=q?q===O?ye:new Array(W):null;if(we&&we!==ye)for(let R=0;R<W;R++)we[R]=G||q[$(0,q.length-1)];let Te=V;if(!w){if(l==="")Te="";else if(q){Te="";for(let R=0;R<I;R++)Te+=V[R]===" "?" ":we[R]}}let xe=-1,me=-1,te="";const T=l!=="",N=!!q,B=u>0;return{from:0,to:1,duration:Y,delay:H,ease:"linear",modifier:R=>{if(R===xe)return te;if(xe=R,H>0&&R<=0)return te=V,V;if(R<=0)return te=Te,Te;if(R>=1)return te=M,M;te="";const X=R/fe|0,j=X!==me;j&&(me=X);const se=re>0?(R-re)/(1-re):R,be=se>0?s(se):0;for(let Ae=0;Ae<W;Ae++){const Oe=ie[Ae];if(be>=ae[Ae]){Ae<L&&(te+=M[Ae]);continue}if(be<=0||be<Oe){T&&Ae<I&&(N?V[Ae]===" "?te+=" ":(j&&(we[Ae]=G||q[$(0,K)]),te+=we[Ae]):te+=V[Ae]);continue}Ae<L&&M[Ae]===" "||Ae<I&&V[Ae]===" "?te+=" ":B&&be-Oe<ce?te+=h[u-1-((be-Oe)/J|0)]:(j&&(ye[Ae]=O[$(0,P)]),te+=ye[Ae])}return j&&y(te,be),te}}}},Xc=Gt({TextSplitter:()=>fr,scrambleText:()=>Ao,split:()=>Ps,splitText:()=>Co}),Yc=Gt({$:()=>Lt,Animatable:()=>Gr,AutoLayout:()=>ro,Draggable:()=>Dn,JSAnimation:()=>Tt,Scope:()=>Bn,ScrollObserver:()=>qn,Spring:()=>Ks,TextSplitter:()=>fr,Timeline:()=>Rn,Timer:()=>tt,WAAPIAnimation:()=>Zn,addChild:()=>mt,animate:()=>gs,clamp:()=>po,cleanInlineStyles:()=>gn,createAnimatable:()=>ac,createDraggable:()=>yc,createDrawable:()=>So,createLayout:()=>Dc,createMotionPath:()=>_o,createScope:()=>bc,createSeededRandom:()=>ks,createSpring:()=>On,createTimeline:()=>In,createTimer:()=>tc,cubicBezier:()=>Vn,damp:()=>vo,degToRad:()=>uo,eases:()=>wt,easings:()=>Cc,engine:()=>Ve,forEachChildren:()=>Se,get:()=>It,globals:()=>z,irregular:()=>Un,keepTime:()=>tr,lerp:()=>mo,linear:()=>Kr,mapRange:()=>co,morphTo:()=>ko,onScroll:()=>xc,padEnd:()=>ao,padStart:()=>oo,radToDeg:()=>ho,random:()=>Ss,randomPick:()=>yo,remove:()=>Mn,removeChild:()=>gt,round:()=>go,roundPad:()=>no,scrambleText:()=>Ao,scrollContainers:()=>rr,set:()=>Ct,shuffle:()=>ti,snap:()=>fo,split:()=>Ps,splitText:()=>Co,spring:()=>js,stagger:()=>ws,steps:()=>zn,svg:()=>Vc,sync:()=>Jr,text:()=>Xc,utils:()=>$c,waapi:()=>Qn,wrap:()=>lo}),Gc=class{registerAnimation(e,t,s={}){this.animations[e]={handler:t,options:s}}isInitiallyHidden(e){return this.animations[e]?.options.initiallyHidden??!1}runAnimation(e,t,s,r,i){const n=this.animations[e];n?n.handler(t,s,r,i):(console.warn(`No animation registered with name: ${e}`),r())}addLinkAnimation(e,t){this.linkAnimations.set(e,t)}removeLinkAnimation(e){this.linkAnimations.delete(e)}runLinkAnimation(e){const t=this.linkAnimations.get(e);t&&t()}constructor(){this.animations={},this.linkAnimations=new Map,this.registerAnimation("typewriter",function(e,t,s,r){const{chars:i}=Ps(e,{words:!1,chars:!0}),n=t.fadeDuration||100,o=t.interval||100;gs(i,{opacity:[0,1],easing:"linear",duration:n,delay:ws(o,{start:t.start||0}),loop:r,onComplete:s})},{initiallyHidden:!0}),this.registerAnimation("toast",function(e,t,s,r){const{words:i}=Ps(e,{words:!0,chars:!1}),n=t.fadeDuration||100,o=t.interval||200;gs(i,{opacity:[0,1],y:[{to:["100%","0%"]}],easing:"linear",duration:n,delay:ws(o,{start:t.start||0}),loop:r,onComplete:s})},{initiallyHidden:!0}),this.registerAnimation("fadeIn",function(e,t,s,r){const i=t.duration||500;gs(e,{opacity:[0,1],easing:t.easing||"easeOutQuad",duration:i,delay:t.start||0,loop:r,onComplete:s})},{initiallyHidden:!0}),this.registerAnimation("continue",function(e,t,s){e.classList.add("squiffy-continue");const r=t.style||"pulse";let i=null,n=null;r==="wave"?(e.classList.add("squiffy-continue-wave"),n=Ps(e,{words:!1,chars:!0}).chars,i=gs(n,{opacity:[1,.3,1],easing:"easeInOutSine",duration:1200,delay:ws(80),loop:!0})):e.classList.add(`squiffy-continue-${r}`);const o=()=>{if(e.classList.remove("squiffy-continue","squiffy-continue-wave",`squiffy-continue-${r}`),e.removeEventListener("click",o),i&&(i.pause(),n))for(const a of n)a.style.opacity="1";s()};e.addEventListener("click",o)})}},Zc={animejs:Yc},Lo="input:not([disabled]), textarea:not([disabled]), select:not([disabled])",Qc="a.squiffy-link[data-section], a.squiffy-link[data-passage]";function Ro(e){if(!e)return!0;const t=e.querySelectorAll(Lo);for(const s of t)if(!s.checkValidity())return!1;return!0}function fi(e){if(!e)return;const t=Ro(e),s=e.querySelectorAll(Qc);for(const r of s)t?(r.classList.remove("validation-disabled"),r.removeAttribute("aria-disabled")):(r.classList.add("validation-disabled"),r.setAttribute("aria-disabled","true"))}function pr(e){if(!e)return;const t=e.querySelectorAll(Lo);for(const s of t)s.addEventListener("input",()=>fi(e)),s.addEventListener("change",()=>fi(e)),s.addEventListener("invalid",r=>{r.preventDefault(),s.classList.add("squiffy-invalid")}),s.addEventListener("input",()=>{s.checkValidity()&&s.classList.remove("squiffy-invalid")});fi(e)}var Jc=async e=>{let t,s,r,i,n,o=0;const a=new _l,h=[];let u=!1;async function f(T){if(u||T.closest(".squiffy-output-section")!==r||T.classList.contains("disabled")||!Ro(r))return!1;const N=T.getAttribute("data-passage"),B=T.getAttribute("data-section");if(N!==null)return d(T),ae("_turncount",ie("_turncount")+1),await g(T),N&&(n=null,await b(N)),a.emit("linkClick",{linkType:"passage"}),!0;if(B!==null)return await g(T),B&&await _(B),a.emit("linkClick",{linkType:"section"}),!0;const[R,X,j]=ye.handleLink(T);return R?(j?.disableLink&&d(T),E(),a.emit("linkClick",{linkType:X}),!0):!1}async function l(T){const N=T.target;N.classList.contains("squiffy-link")&&await f(N)}function d(T){T.classList.add("disabled"),T.setAttribute("tabindex","-1")}function c(T){T.classList.remove("disabled"),T.removeAttribute("tabindex")}async function p(){O()||await _(t.start)}async function g(T){me.runLinkAnimation(T),await m();const N=T.getAttribute("data-set");if(N){const B=JSON.parse(N);for(const R of B)v(R)}}function v(T){T=T.replace(/^(\w*\s*):=(.*)$/,(B,R,X)=>R+"="+x.processText(X,!0));const N=/^([\w]*)\s*=\s*(.*)$/.exec(T);if(N){const B=N[1];let R=N[2];R==="true"?ae(B,!0):R==="false"?ae(B,!1):isNaN(R)?(R.startsWith("@")&&(R=ie(R.substring(1))),ae(B,R)):ae(B,parseFloat(R))}else{const B=/^([\w]*)\s*([+\-*/])=\s*(.*)$/.exec(T);if(B){const R=B[1],X=B[2];let j=B[3];j.startsWith("@")&&(j=ie(j.substring(1)));const se=parseFloat(j);let be=ie(R);be===null&&(be=0),X=="+"&&(be+=se),X=="-"&&(be-=se),X=="*"&&(be*=se),X=="/"&&(be/=se),ae(R,be)}else{let R=!0;T.startsWith("not ")&&(T=T.substring(4),R=!1),ae(T,R)}}}async function _(T){const N=G();if(s=t.sections[T],!s)return;ae("_section",T),fe.setSeen(T);const B=t.sections[""];(B?.clear||s.clear)&&$(),A(T);const R=r;if(B&&(await y(B,"[[]]"),ie("_section")!==T)){R.remove();return}if(await y(s,`[[${T}]]`),ie("_section")!==T){R.remove();return}pr(r),ae("_turncount",0),J(),E();const X=G();X!=N&&a.emit("canGoBackChanged",{canGoBack:X})}function S(T,N=null){const B={get:ie,set:ae,ui:{transition:xe,write:x.write,scrollToEnd:x.scrollToEnd},story:{go:_},element:ee,import:Zc,...N};t.js[T](B,ie,ae)}async function y(T,N){if(T.attributes&&await k(T.attributes),T.jsIndex!==void 0){const B=ie("_section");if(S(T.jsIndex),ie("_section")!==B)return}x.write(T.text||"",N),await m()}async function m(){u=!0,r.classList.add("links-disabled");for(const T of h)await T();h.length=0,u=!1,r.classList.remove("links-disabled")}async function b(T){const N=G();let B=s.passages&&s.passages[T];const R=t.sections[""];if(!B&&R&&R.passages&&(B=R.passages[T]),!B)throw`No passage named ${T} in the current section or master section`;fe.setSeen(T);const X=[],j=[];if(R&&R.passages){const Oe=R.passages[""];Oe&&(X.push(Oe),j.push(()=>y(Oe,"[[]][]")))}const se=s.passages&&s.passages[""];se&&(X.push(se),j.push(()=>y(se,`[[${ie("_section")}]][]`))),X.push(B),j.push(()=>y(B,`[[${ie("_section")}]][${T}]`));const be="@"+ie("_turncount");if(s.passages){if(be in s.passages){const Oe=s.passages[be];X.push(Oe),j.push(()=>y(Oe,`[[${ie("_section")}]][${be}]`))}if("@last"in s.passages&&ie("_turncount")>=(s.passageCount||0)){const Oe=s.passages["@last"];X.push(Oe),j.push(()=>y(Oe,`[[${ie("_section")}]][${be}]`))}}X.some(Oe=>Oe.clear)&&($(),C()),i=document.createElement("div"),i.classList.add("squiffy-output-passage"),i.setAttribute("data-passage",`${T}`),r.appendChild(i);for(const Oe of j)await Oe();pr(r),J(),E();const Ae=G();Ae!=N&&a.emit("canGoBackChanged",{canGoBack:Ae})}async function k(T){for(const N of T)v(N)}function w(){fe.reset(),re.scroll==="element"||re.scroll==="none"?(Y.innerHTML="",p()):location.reload()}function E(){ae("_output",Y.innerHTML)}function O(){const T=()=>{t.uiJsIndex!==void 0&&S(t.uiJsIndex,{registerAnimation:me.registerAnimation.bind(me),registerHelper:ke.handlebars.registerHelper.bind(ke.handlebars),SafeString:ke.handlebars.SafeString})};fe.load();const N=ie("_output");return N?(Y.innerHTML=N,I(),L(),n=Y.querySelector(".squiffy-output-block:last-child"),s=t.sections[ie("_section")],T(),te.onLoad(),pr(r),!0):(T(),!1)}function P(){n=document.createElement("div"),n.classList.add("squiffy-output-block"),(i||r)?.appendChild(n)}function A(T){r&&(r.querySelectorAll("input, textarea, select").forEach(N=>{const B=N,R=B.getAttribute("data-attribute")||B.id;R&&ae(R,B.value),B.disabled||(B.disabled=!0,B.setAttribute("data-squiffy-disabled",""))}),r.querySelectorAll("[contenteditable]").forEach(N=>{const B=N.getAttribute("data-attribute")||N.id;B&&ae(B,N.innerHTML),N.getAttribute("contenteditable")!=="false"&&(N.setAttribute("contenteditable","false"),N.setAttribute("data-squiffy-disabled",""))})),i=null,C(T),P()}function C(T){r=document.createElement("div"),r.classList.add("squiffy-output-section"),r.setAttribute("data-section",T??ie("_section")),T||r.setAttribute("data-clear","true"),Y.appendChild(r)}function H(){return Y.querySelector(".squiffy-clear-stack")}function $(){let T=H();T||(T=document.createElement("div"),T.classList.add("squiffy-clear-stack"),T.style.display="none",Y.prepend(T));const N=document.createElement("div");T.appendChild(N);for(const B of[...Y.children])B!==T&&N.appendChild(B)}function V(){const T=H();if(!T)return;for(const B of[...Y.children])B!==T&&B.remove();const N=T.children[T.children.length-1];for(const B of[...N.children])Y.appendChild(B);N.remove()}const x={write:(T,N)=>{o=Y.scrollHeight;const B=x.processText(T,!1).trim();n||P();const R=document.createElement("div");N&&R.setAttribute("data-source",N),R.innerHTML=B,te.onWrite(R),n.appendChild(R),pr(r),x.scrollToEnd()},clearScreen:()=>{$(),C()},scrollToEnd:()=>{if(re.scroll!=="none")if(re.scroll==="element")Y.lastElementChild?.scrollIntoView({block:"end",inline:"nearest",behavior:"smooth"});else{let T=o;const N=Math.max(document.body.scrollTop,document.documentElement.scrollTop);if(T>N){const B=document.documentElement.scrollHeight-window.innerHeight;T>B&&(T=B),window.scrollTo({top:T,behavior:"smooth"})}}},processText:(T,N)=>ke.process(T,N)};function M(T){if(T.start!=t.start){t=T,fe.reset(),Y.innerHTML="",_(t.start);return}const N=t;t=T,kl(N,T,Y,(R,X)=>{const j=s;s=X;try{return x.processText(R,!1)}finally{s=j}},d,R=>k(R)),I(),L()}function I(){const T=Y.querySelectorAll(".squiffy-output-section:last-child");r=T[T.length-1];const N=r.getAttribute("data-section");s=t.sections[N]}function L(){i=r.querySelector(".squiffy-output-passage:last-child")}function q(){const T=H(),N=Y.querySelectorAll(".squiffy-output-section").length+Y.querySelectorAll(".squiffy-output-passage").length;return T?N+T.children.length:N}function K(T){T.querySelectorAll("[data-squiffy-disabled]").forEach(N=>{N.hasAttribute("contenteditable")?N.setAttribute("contenteditable","true"):N.disabled=!1,N.removeAttribute("data-squiffy-disabled")})}function G(){return q()>1}function W(){if(u||!G())return;const T=H();if(i){const N=i.getAttribute("data-passage");ce(i.getAttribute("data-undo")),i.remove();let B=!1,R=!1;for(const X of Y.children)if(X!==T){if(X.getAttribute("data-clear")=="true"&&X.children.length==0){B=!0;continue}R=!0;break}B&&!R&&(V(),I());for(const X of r.querySelectorAll("a.squiffy-link[data-passage]"))X.getAttribute("data-passage")==N&&c(X);L()}else{ce(r.getAttribute("data-undo")),r.remove();let N=!1;for(const B of[...Y.children])if(B!==T){N=!0;break}N||V(),I(),L(),K(r)}G()||a.emit("canGoBackChanged",{canGoBack:!1})}const ee=e.element,Y=document.createElement("div");ee.appendChild(Y),t=e.story;const re={scroll:e.scroll||"body",persist:e.persist===void 0?!0:e.persist,onSet:e.onSet||(()=>{})};let ge="";re.persist&&(e.storyId!==void 0?ge=e.storyId:window.location.protocol==="file:"?ge=t.id||"":ge=window.location.pathname,ge||(console.warn("Persist is set to true in Squiffy runtime options, but no storage key could be determined. Persist will be disabled."),re.persist=!1)),re.scroll==="element"&&(Y.style.overflowY="auto"),Y.addEventListener("click",l),Y.addEventListener("keypress",async function(T){T.key==="Enter"&&await l(T)});let he={};const le=function(T,N){T!="_output"&&(T in he||(he[T]=N))},J=function(){(i??r).setAttribute("data-undo",JSON.stringify(he)),he={}},ce=function(T){if(!T)return;const N=JSON.parse(T);if(N)for(const B of Object.keys(N))fe.setInternal(B,N[B],!1)},fe=new Sl(re.persist,ge,re.onSet,a,le),ie=fe.get.bind(fe),ae=fe.set.bind(fe),ke=new bl(()=>t,fe,()=>s),ye=new Al,we=T=>T in t.sections&&t.sections[T].text||null,Te=T=>s.passages&&T in s.passages?s.passages[T].text||null:"passages"in t.sections[""]&&t.sections[""].passages&&T in t.sections[""].passages&&t.sections[""].passages[T].text||null,xe=T=>{h.push(T)},me=new Gc,te=new wl(Y,ke,fe,ye,we,Te,x.processText,xe,me,a);return te.add(hs.ReplaceLabel()),te.add(hs.RotateSequencePlugin()),te.add(hs.RandomPlugin()),te.add(hs.LivePlugin()),te.add(hs.AnimatePlugin()),{begin:p,restart:w,get:ie,set:ae,clickLink:f,update:M,goBack:W,on:(T,N)=>a.on(T,N),off:(T,N)=>a.off(T,N),once:(T,N)=>a.once(T,N)}};return mr.init=Jc,mr})({});
|
|
130
|
+
`,x.appendChild(M);let q=A-L+(t?1:0);x.style[t?"left":"top"]=`${q}px`,(P?i:n).appendChild(x)}),r.appendChild(i),r.appendChild(n),e.element.appendChild(r),s||r.classList.add("animejs-onscroll-debug"),this.$debug=r,It(e.element,"position")==="static"&&(this.debugStyles=Ct(e.element,{position:"relative "}))}updateBounds(){this._debug&&this.removeDebug();let e;const t=this.target,s=this.container,r=this.horizontal,i=this.linked;let n,o=t;for(i&&(n=i.currentTime,i.seek(0,!0));o&&o!==s.element&&o!==Q.body;){const C=It(o,"position")==="sticky"?Ct(o,{position:"static"}):!1;o=o.parentElement,C&&(e||(e=[]),e.push(C))}const a=t.getBoundingClientRect(),h=s.scale,u=(r?a.left+s.scrollX-s.left:a.top+s.scrollY-s.top)*h,f=(r?a.width:a.height)*h,l=r?s.width:s.height,d=(r?s.scrollWidth:s.scrollHeight)-l,c=this.enter,p=this.leave;let g="start",v="end",_="end",S="start";if(Be(c)){const C=c.split(" ");_=C[0],g=C.length>1?C[1]:g}else if(De(c)){const C=c;D(C.container)||(_=C.container),D(C.target)||(g=C.target)}else qe(c)&&(_=c);if(Be(p)){const C=p.split(" ");S=C[0],v=C.length>1?C[1]:v}else if(De(p)){const C=p;D(C.container)||(S=C.container),D(C.target)||(v=C.target)}else qe(p)&&(S=p);const y=ir(t,g,f),m=ir(t,v,f),b=y+u-l,k=m+u-d,w=ir(t,_,l,b,k),E=ir(t,S,l,b,k),O=y+u-w,P=m+u-E,A=P-O;this.offset=u,this.offsetStart=O,this.offsetEnd=P,this.distance=A<=0?0:A,this.thresholds=[g,v,_,S],this.coords=[y,m,w,E],e&&e.forEach(C=>C.revert()),i&&i.seek(n,!0),this._debug&&this.debug()}handleScroll(){if(!this.ready)return;const e=this.linked,t=this.sync,s=this.syncEase,r=this.syncSmooth,i=e&&(s||r),n=this.horizontal,o=this.container,a=this.scroll,h=a<=this.offsetStart,u=a>=this.offsetEnd,f=!h&&!u,l=a===this.offsetStart||a===this.offsetEnd,d=!this.hasEntered&&l,c=this._debug&&this.$debug;let p=!1,g=!1,v=this.progress;if(h&&this.began&&(this.began=!1),v>0&&!this.began&&(this.began=!0),i){const _=e.progress;if(r&&qe(r)){if(r<1){const S=_<v&&v===1?1e-4:_>v&&!v?-1e-4:0;v=F(At(_,v,At(.01,.2,r))+S,6)}}else s&&(v=s(v));p=v!==this.prevProgress,g=_===1,p&&!g&&r&&_&&o.wakeTicker.restart()}if(c){const _=n?o.scrollY:o.scrollX;c.style[n?"top":"left"]=_+10+"px"}(f&&!this.isInView||d&&!this.forceEnter&&!this.hasEntered)&&(f&&(this.isInView=!0),!this.forceEnter||!this.hasEntered?(c&&f&&(c.style.zIndex=`${this.container.zIndex++}`),this.onSyncEnter(this),this.onEnter(this),this.backward?(this.onSyncEnterBackward(this),this.onEnterBackward(this)):(this.onSyncEnterForward(this),this.onEnterForward(this)),this.hasEntered=!0,d&&(this.forceEnter=!0)):f&&(this.forceEnter=!1)),(f||!f&&this.isInView)&&(p=!0),p&&(i&&e.seek(e.duration*v),this.onUpdate(this)),!f&&this.isInView&&(this.isInView=!1,this.onSyncLeave(this),this.onLeave(this),this.backward?(this.onSyncLeaveBackward(this),this.onLeaveBackward(this)):(this.onSyncLeaveForward(this),this.onLeaveForward(this)),t&&!r&&(g=!0)),v>=1&&this.began&&!this.completed&&(t&&g||!t)&&(t&&this.onSyncComplete(this),this.completed=!0,(!this.repeat&&!e||!this.repeat&&e&&e.completed)&&this.revert()),v<1&&this.completed&&(this.completed=!1),this.prevProgress=v}revert(){if(this.reverted)return;const e=this.container;return gt(e,this),e._head||e.revert(),this._debug&&this.removeDebug(),this.reverted=!0,this.ready=!1,this}},xc=(e={})=>new qn(e),Fn=(e,t,s)=>(((1-3*s+3*t)*e+(3*s-6*t))*e+3*t)*e,Tc=(e,t,s)=>{let r=0,i=1,n,o,a=0;do o=r+(i-r)/2,n=Fn(o,t,s)-e,n>0?i=o:r=o;while(ot(n)>1e-7&&++a<100);return o},Vn=(e=.5,t=0,s=.5,r=1)=>e===t&&s===r?rt:i=>i===0||i===1?i:Fn(Tc(i,e,s),t,r),zn=(e=10,t)=>{const s=t?Vl:Kt;return r=>s(Z(r,0,1)*e)*(1/e)},Kr=(...e)=>{const t=e.length;if(!t)return rt;const s=t-1,r=e[0],i=e[s],n=[0],o=[Ft(r)];for(let a=1;a<s;a++){const h=e[a],u=Be(h)?h.trim().split(" "):[h],f=u[0],l=u[1];n.push(D(l)?a/s:Ft(l)/100),o.push(Ft(f))}return o.push(Ft(i)),n.push(1),function(h){for(let u=1,f=n.length;u<f;u++){const l=n[u];if(h<=l){const d=n[u-1],c=o[u-1];return c+(o[u]-c)*(h-d)/(l-d)}}return o[o.length-1]}},Un=(e=10,t=1)=>{const s=[0],r=e-1;for(let i=1;i<r;i++){const n=s[i-1],o=i/r,a=o+((i+1)/r-o)*Math.random(),h=o*(1-t)+a*t;s.push(Z(h,n,1))}return s.push(1),Kr(...s)},Cc=Gt({Spring:()=>Ks,createSpring:()=>On,cubicBezier:()=>Vn,eases:()=>wt,irregular:()=>Un,linear:()=>Kr,spring:()=>js,steps:()=>zn}),nr=(e,t=100)=>{const s=[];for(let r=0;r<=t;r++)s.push(F(e(r/t),4));return`linear(${s.join(", ")})`},Wn={},Xn=e=>{let t=Wn[e];if(t)return t;if(t="linear",Be(e)){if(Me(e,"linear")||Me(e,"cubic-")||Me(e,"steps")||Me(e,"ease"))t=e;else if(Me(e,"cubicB"))t=Bs(e);else{const s=Pn(e);Ee(s)&&(t=s===rt?"linear":nr(s))}Wn[e]=t}else if(Ee(e)){const s=nr(e);s&&(t=s)}else e.ease&&(t=nr(e.ease));return t},Yn=["x","y","z"],Pc=["perspective","width","height","margin","padding","top","right","bottom","left","borderWidth","fontSize","borderRadius",...Yn],Ec=[...Yn,...$t.filter(e=>["X","Y","Z"].some(t=>e.endsWith(t)))],jr=null,bs=(e,t,s,r,i)=>{let n=Be(t)?t:Ne(t,s,r,i,null,null);return qe(n)?Pc.includes(e)||Me(e,"translate")?`${n}px`:Me(e,"rotate")||Me(e,"skew")?`${n}deg`:`${n}`:n},Gn=(e,t,s,r,i,n)=>{let o="0";const a=D(r)?getComputedStyle(e)[t]:bs(t,r,e,i,n);return D(s)?o=$e(r)?r.map(h=>bs(t,h,e,i,n)):a:o=[bs(t,s,e,i,n),a],o},Zn=class{constructor(e,t){Ie.current&&Ie.current.register(this),qt(jr)&&(yt&&(D(CSS)||!Object.hasOwnProperty.call(CSS,"registerProperty"))?jr=!1:($t.forEach(d=>{const c=Me(d,"skew"),p=Me(d,"scale"),g=Me(d,"rotate"),v=Me(d,"translate"),_=g||c,S=_?"<angle>":p?"<number>":v?"<length-percentage>":"*";try{CSS.registerProperty({name:"--"+d,syntax:S,inherits:!1,initialValue:v?"0px":_?"0deg":p?"1":"0"})}catch{}}),jr=!0));const s=Lt(e);s.length||console.warn("No target found. Make sure the element you're trying to animate is accessible before creating your animation.");const r=U(t.autoplay,z.defaults.autoplay),i=r&&r.link?r:!1,n=t.alternate&&t.alternate===!0,o=t.reversed&&t.reversed===!0,a=U(t.loop,z.defaults.loop),h=a===!0||a===1/0?1/0:qe(a)?a+1:1,u=n?o?"alternate-reverse":"alternate":o?"reverse":"normal",f="both",l=z.timeScale===1?1:Ye;this.targets=s,this.animations=[],this.controlAnimation=null,this.onComplete=t.onComplete||z.defaults.onComplete,this.duration=0,this.muteCallbacks=!1,this.completed=!1,this.paused=!r||i!==!1,this.reversed=o,this.persist=U(t.persist,z.defaults.persist),this.autoplay=r,this._speed=U(t.playbackRate,z.defaults.playbackRate),this._resolve=oe,this._completed=0,this._inlineStyles=[],s.forEach((d,c)=>{const p=d[ds],g=Ec.some(P=>t.hasOwnProperty(P)),v=d.style,_=this._inlineStyles[c]={},S=U(t.ease,z.defaults.ease),y=Ne(S,d,c,s,null,null),m=Ee(y)||Be(y)?y:S,b=S.ease&&S,k=Xn(m),w=(b?b.settlingDuration:Ne(U(t.duration,z.defaults.duration),d,c,s,null,null))*l,E=Ne(U(t.delay,z.defaults.delay),d,c,s,null,null)*l,O=U(t.composition,"replace");for(let P in t){if(!Jt(P))continue;const A={},C={iterations:h,direction:u,fill:f,easing:k,duration:w,delay:E,composite:O},H=t[P],$=g?$t.includes(P)?P:Or.get(P):!1,V=$?"transform":P;_[V]||(_[V]=v[V]);let x;if(De(H)){const M=H,I=U(M.ease,k),L=I.ease&&I,q=M.to,K=M.from;if(C.duration=(L?L.settlingDuration:Ne(U(M.duration,w),d,c,s,null,null))*l,C.delay=Ne(U(M.delay,E),d,c,s,null,null)*l,C.composite=U(M.composition,O),C.easing=Xn(I),x=Gn(d,P,K,q,c,s),$?(A[`--${$}`]=x,p[$]=x):A[P]=Gn(d,P,K,q,c,s),Nn(this,d,P,A,C),!D(K))if(!$)v[P]=A[P][0];else{const G=`--${$}`;v.setProperty(G,A[G][0])}}else x=$e(H)?H.map(M=>bs(P,M,d,c,s)):bs(P,H,d,c,s),$?(A[`--${$}`]=x,p[$]=x):A[P]=x,Nn(this,d,P,A,C)}if(g){let P="";for(let A in p)P+=`${Ki[A]}var(--${A})) `;v.transform=P}}),i&&this.autoplay.link(this)}forEach(e){try{const t=Be(e)?s=>s[e]():e;this.animations.forEach(t)}catch{}return this}get speed(){return this._speed}set speed(e){this._speed=+e,this.forEach(t=>t.playbackRate=e)}get currentTime(){const e=this.controlAnimation,t=z.timeScale;return this.completed?this.duration:e?+e.currentTime*(t===1?1:t):0}set currentTime(e){const t=e*(z.timeScale===1?1:Ye);this.forEach(s=>{!this.persist&&t>=this.duration&&s.play(),s.currentTime=t})}get progress(){return this.currentTime/this.duration}set progress(e){this.forEach(t=>t.currentTime=e*this.duration||0)}resume(){return this.paused?(this.paused=!1,this.forEach("play")):this}pause(){return this.paused?this:(this.paused=!0,this.forEach("pause"))}alternate(){return this.reversed=!this.reversed,this.forEach("reverse"),this.paused&&this.forEach("pause"),this}play(){return this.reversed&&this.alternate(),this.resume()}reverse(){return this.reversed||this.alternate(),this.resume()}seek(e,t=!1){return t&&(this.muteCallbacks=!0),e<this.duration&&(this.completed=!1),this.currentTime=e,this.muteCallbacks=!1,this.paused&&this.pause(),this}restart(){return this.completed=!1,this.seek(0,!0).resume()}commitStyles(){return this.forEach("commitStyles")}complete(){return this.seek(this.duration)}cancel(){return this.muteCallbacks=!0,this.commitStyles().forEach("cancel"),this.animations.length=0,requestAnimationFrame(()=>{this.targets.forEach(e=>{e.style.transform==="none"&&e.style.removeProperty("transform")})}),this}revert(){return this.cancel().targets.forEach((e,t)=>{const s=e.style,r=this._inlineStyles[t];for(let i in r){const n=r[i];D(n)||n===""?s.removeProperty(Bs(i)):e.style[i]=n}e.getAttribute("style")===""&&e.removeAttribute("style")}),this}then(e=oe){const t=this.then,s=()=>{this.then=null,e(this),this.then=t,this._resolve=oe};return new Promise(r=>(this._resolve=()=>r(s()),this.completed&&this._resolve(),this))}},Qn={animate:(e,t)=>new Zn(e,t),convertEase:nr},Ac=0,Lc=0,or=(e,t)=>!e||!t?!1:e===t||e.contains(t),rs=e=>{if(!e)return null;const t=e.style,s=t.transition||"";return t.setProperty("transition","none","important"),s},ar=(e,t)=>{if(!e)return;const s=e.style;t?s.transition=t:s.removeProperty("transition")},Rc=e=>{const t=e.layout.transitionMuteStore,s=e.$el,r=e.$measure;s&&!t.has(s)&&t.set(s,rs(s)),r&&!t.has(r)&&t.set(r,rs(r))},lr=e=>{e.forEach((t,s)=>ar(s,t)),e.clear()},Ic={display:"none",visibility:"hidden",opacity:"0",transform:"none",position:"static"},Oc=e=>{if(!e)return;const t=e.parentNode;t&&(t._head===e&&(t._head=e._next),t._tail===e&&(t._tail=e._prev),e._prev&&(e._prev._next=e._next),e._next&&(e._next._prev=e._prev),e._prev=null,e._next=null,e.parentNode=null)},Jn=(e,t,s,r)=>{let i=e.dataset.layoutId;i||(i=e.dataset.layoutId=`node-${Lc++}`);const n=r||{};return n.$el=e,n.$measure=e,n.id=i,n.index=0,n.targets=null,n.delay=0,n.duration=0,n.ease=null,n.state=s,n.layout=s.layout,n.parentNode=t||null,n.isTarget=!1,n.isEntering=!1,n.isLeaving=!1,n.isInlined=!1,n.hasTransform=!1,n.inlineStyles=[],n.inlineTransforms=null,n.inlineTransition=null,n.branchAdded=!1,n.branchRemoved=!1,n.branchNotRendered=!1,n.sizeChanged=!1,n.hasVisibilitySwap=!1,n.hasDisplayNone=!1,n.hasVisibilityHidden=!1,n.measuredInlineTransform=null,n.measuredInlineTransition=null,n.measuredDisplay=null,n.measuredVisibility=null,n.measuredPosition=null,n.measuredHasDisplayNone=!1,n.measuredHasVisibilityHidden=!1,n.measuredIsVisible=!1,n.measuredIsRemoved=!1,n.measuredIsInsideRoot=!1,n.properties={transform:"none",x:0,y:0,left:0,top:0,clientLeft:0,clientTop:0,width:0,height:0},n.layout.properties.forEach(o=>n.properties[o]=0),n._head=null,n._tail=null,n._prev=null,n._next=null,n},Kn=(e,t,s,r)=>{const i=e.$el,n=e.layout.root,o=n===i,a=e.properties,h=e.state.rootNode,u=e.parentNode,f=s.transform,l=i.style.transform,d=u?u.measuredIsRemoved:!1,c=s.position;o&&(e.layout.absoluteCoords=c==="fixed"||c==="absolute"),e.$measure=t,e.inlineTransforms=l,e.hasTransform=f&&f!=="none",e.measuredIsInsideRoot=or(n,t),e.measuredInlineTransform=null,e.measuredDisplay=s.display,e.measuredVisibility=s.visibility,e.measuredPosition=c,e.measuredHasDisplayNone=s.display==="none",e.measuredHasVisibilityHidden=s.visibility==="hidden",e.measuredIsVisible=!(e.measuredHasDisplayNone||e.measuredHasVisibilityHidden),e.measuredIsRemoved=e.measuredHasDisplayNone||e.measuredHasVisibilityHidden||d;let p=!1,g=i.previousSibling;for(;g&&(g.nodeType===Node.COMMENT_NODE||g.nodeType===Node.TEXT_NODE&&!g.textContent.trim());)g=g.previousSibling;if(g&&g.nodeType===Node.TEXT_NODE)p=!0;else{for(g=i.nextSibling;g&&(g.nodeType===Node.COMMENT_NODE||g.nodeType===Node.TEXT_NODE&&!g.textContent.trim());)g=g.nextSibling;p=g!==null&&g.nodeType===Node.TEXT_NODE}if(e.isInlined=p,e.hasTransform&&!r){const k=e.layout.transitionMuteStore;k.get(i)||(e.inlineTransition=rs(i)),t===i?i.style.transform="none":(k.get(t)||(e.measuredInlineTransition=rs(t)),e.measuredInlineTransform=t.style.transform,t.style.transform="none")}let v=0,_=0,S=0,y=0;if(!r){const k=t.getBoundingClientRect();v=k.left,_=k.top,S=k.width,y=k.height}for(let k in a){const w=k==="transform"?f:s[k]||s.getPropertyValue&&s.getPropertyValue(k);D(w)||(a[k]=w)}a.left=v,a.top=_,a.clientLeft=r?0:t.clientLeft,a.clientTop=r?0:t.clientTop;let m,b;if(o)e.layout.absoluteCoords?(m=v,b=_):(m=0,b=0);else{const k=u||h,w=k.properties.left,E=k.properties.top,O=k.properties.clientLeft,P=k.properties.clientTop;if(e.layout.absoluteCoords)m=v-w-O,b=_-E-P;else if(k===h){const A=h.properties.left,C=h.properties.top,H=h.properties.clientLeft,$=h.properties.clientTop;m=v-A-H,b=_-C-$}else m=v-w-O,b=_-E-P}return a.x=m,a.y=b,a.width=S,a.height=y,e},jn=(e,t)=>{if(t)for(let s in t)e.properties[s]=t[s]},_s=(e,t)=>{const s=Ne(t.ease,e.$el,e.index,e.targets,null,null),r=Ee(s)?s:t.ease,i=!D(r)&&!D(r.ease);e.ease=i?r.ease:r,e.duration=i?r.settlingDuration:Ne(t.duration,e.$el,e.index,e.targets,null,null),e.delay=Ne(t.delay,e.$el,e.index,e.targets,null,null)},Nc=e=>{const t=e.$el.style,s=e.inlineStyles;s.length=0,e.layout.recordedProperties.forEach(r=>{s.push(r,t[r]||"")})},eo=e=>{const t=e.$el.style,s=e.inlineStyles;for(let r=0,i=s.length;r<i;r+=2){const n=s[r],o=s[r+1];o&&o!==""?t[n]=o:(t[n]="",t.removeProperty(n))}},Mc=e=>{const t=e.inlineTransforms,s=e.$el.style;!e.hasTransform||!t||e.hasTransform&&s.transform==="none"||t&&t==="none"?s.removeProperty("transform"):t&&(s.transform=t);const r=e.$measure;if(e.hasTransform&&r!==e.$el){const i=r.style,n=e.measuredInlineTransform;n&&n!==""?i.transform=n:i.removeProperty("transform")}e.measuredInlineTransform=null,e.inlineTransition!==null&&(ar(e.$el,e.inlineTransition),e.inlineTransition=null),r!==e.$el&&e.measuredInlineTransition!==null&&(ar(r,e.measuredInlineTransition),e.measuredInlineTransition=null)},to=e=>{(e.measuredIsRemoved||e.hasVisibilitySwap)&&(e.$el.style.removeProperty("display"),e.$el.style.removeProperty("visibility"),e.hasVisibilitySwap&&(e.$measure.style.removeProperty("display"),e.$measure.style.removeProperty("visibility"))),e.layout.pendingRemoval.delete(e.$el)},ei=(e,t,s)=>(t.properties={...e.properties},t.state=s,t.isTarget=e.isTarget,t.hasTransform=e.hasTransform,t.inlineTransforms=e.inlineTransforms,t.measuredIsVisible=e.measuredIsVisible,t.measuredDisplay=e.measuredDisplay,t.measuredIsRemoved=e.measuredIsRemoved,t.measuredHasDisplayNone=e.measuredHasDisplayNone,t.measuredHasVisibilityHidden=e.measuredHasVisibilityHidden,t.hasDisplayNone=e.hasDisplayNone,t.isInlined=e.isInlined,t.hasVisibilityHidden=e.hasVisibilityHidden,t),so=class{constructor(e){this.layout=e,this.rootNode=null,this.rootNodes=new Set,this.nodes=new Map,this.scrollX=0,this.scrollY=0}revert(){return this.forEachNode(e=>{this.layout.pendingRemoval.delete(e.$el),e.$el.removeAttribute("data-layout-id"),e.$measure.removeAttribute("data-layout-id")}),this.rootNode=null,this.rootNodes.clear(),this.nodes.clear(),this}getNode(e){if(!(!e||!e.dataset))return this.nodes.get(e.dataset.layoutId)}getComputedValue(e,t){const s=this.getNode(e);if(s)return s.properties[t]}forEach(e,t){let s=e,r=0;for(;s;)if(t(s,r++),s._head)s=s._head;else if(s._next)s=s._next;else{for(;s&&!s._next;)s=s.parentNode;s&&(s=s._next)}}forEachRootNode(e){this.forEach(this.rootNode,e)}forEachNode(e){for(const t of this.rootNodes)this.forEach(t,e)}registerElement(e,t){if(!e||e.nodeType!==1)return null;this.layout.transitionMuteStore.has(e)||this.layout.transitionMuteStore.set(e,rs(e));const s=[e,t],r=this.layout.root;let i=null;for(;s.length;){const n=s.pop(),o=s.pop();if(!o||o.nodeType!==1||Hs(o))continue;const a=n?n.measuredIsRemoved:!1,h=a?Ic:getComputedStyle(o),u=a?!0:h.display==="none",f=a?!0:h.visibility==="hidden",l=!u&&!f,d=o.dataset.layoutId,c=or(r,o);let p=d?this.nodes.get(d):null;if(p&&p.$el!==o){const v=or(r,p.$el),_=p.measuredIsVisible,S=!v&&(c||!c&&!_&&l),y=v&&!_&&l;if(S)Oc(p),p=Jn(o,n,this,p);else if(y){Kn(p,o,h,a);let m=o.lastElementChild;for(;m;)s.push(m,p),m=m.previousElementSibling;i||(i=p);continue}else{let m=o.lastElementChild;for(;m;)s.push(m,n),m=m.previousElementSibling;i||(i=p);continue}}else p=Jn(o,n,this,p);p.branchAdded=!1,p.branchRemoved=!1,p.branchNotRendered=!1,p.isTarget=!1,p.sizeChanged=!1,p.hasVisibilityHidden=f,p.hasDisplayNone=u,p.hasVisibilitySwap=f&&!p.measuredHasVisibilityHidden||u&&!p.measuredHasDisplayNone,this.nodes.set(p.id,p),p.parentNode=n||null,p._prev=null,p._next=null,n?(this.rootNodes.delete(p),n._head?(n._tail._next=p,p._prev=n._tail,n._tail=p):(n._head=p,n._tail=p)):this.rootNodes.add(p),Kn(p,p.$el,h,a);let g=o.lastElementChild;for(;g;)s.push(g,p),g=g.previousElementSibling;i||(i=p)}return i}ensureDetachedNode(e,t){if(!e||e===this.layout.root)return null;const s=e.dataset.layoutId,r=s?this.nodes.get(s):null;if(r&&r.$el===e)return r;let i=null,n=e.parentElement;for(;n&&n!==this.layout.root;){if(t.has(n)){i=this.ensureDetachedNode(n,t);break}n=n.parentElement}return this.registerElement(e,i)}record(){const e=this.layout,t=e.children,s=e.root,r=$e(t)?t:[t],i=[],n=t==="*"?s:Ie.root,o=[];let a=s.parentElement;for(;a&&a.nodeType===1;){const g=getComputedStyle(a);if(g.transform&&g.transform!=="none"){const v=a.style.transform||"",_=rs(a);o.push(a,v,_),a.style.transform="none"}a=a.parentElement}for(let g=0,v=r.length;g<v;g++){const _=r[g];i[g]=Be(_)?n.querySelectorAll(_):_}const h=Lt(i);this.nodes.clear(),this.rootNodes.clear();const u=this.registerElement(s,null);u.isTarget=!0,this.rootNode=u;const f=new Set;let l=0;const d=[];this.nodes.forEach(g=>{d.push(g.$el)}),this.nodes.forEach((g,v)=>{g.index=l++,g.targets=d,g&&g.measuredIsInsideRoot&&f.add(v)});const c=new Set,p=[];for(let g=0,v=h.length;g<v;g++){const _=h[g];if(!(!_||_.nodeType!==1||_===s)){if(!or(s,_)){const S=_.dataset.layoutId;if(!S||!f.has(S))continue}c.has(_)||(c.add(_),p.push(_))}}for(let g=0,v=p.length;g<v;g++)this.ensureDetachedNode(p[g],c);for(let g=0,v=h.length;g<v;g++){const _=h[g],S=this.getNode(_);if(S){let y=S;for(;y&&!y.isTarget;)y.isTarget=!0,y=y.parentNode}}this.scrollX=window.scrollX,this.scrollY=window.scrollY,this.forEachNode(Mc);for(let g=0,v=o.length;g<v;g+=3){const _=o[g],S=o[g+1],y=o[g+2];S&&S!==""?_.style.transform=S:_.style.removeProperty("transform"),ar(_,y)}return this}};function is(e){const t={},s={};for(let r in e){const i=e[r],n=r==="ease";r==="duration"||r==="delay"||n?s[r]=i:t[r]=i}return[t,s]}var ro=class{constructor(e,t={}){Ie.current&&Ie.current.register(this);const s=is(t.swapAt),r=is(t.enterFrom),i=is(t.leaveTo),n=t.properties;if(t.duration=U(t.duration,350),t.delay=U(t.delay,0),t.ease=U(t.ease,"inOut(3.5)"),this.params=t,this.root=Lt(e)[0],this.id=t.id||Ac++,this.children=t.children||"*",this.absoluteCoords=!1,this.swapAtParams=at(t.swapAt||{opacity:0},{ease:"inOut(1.75)"}),this.enterFromParams=t.enterFrom||{opacity:0},this.leaveToParams=t.leaveTo||{opacity:0},this.properties=new Set(["opacity","fontSize","color","backgroundColor","borderRadius","border","filter","clipPath"]),s[0])for(let o in s[0])this.properties.add(o);if(r[0])for(let o in r[0])this.properties.add(o);if(i[0])for(let o in i[0])this.properties.add(o);if(n)for(let o=0,a=n.length;o<a;o++)this.properties.add(n[o]);this.recordedProperties=new Set(["display","visibility","translate","position","left","top","marginLeft","marginTop","width","height","maxWidth","maxHeight","minWidth","minHeight"]),this.properties.forEach(o=>this.recordedProperties.add(o)),this.pendingRemoval=new WeakSet,this.transitionMuteStore=new Map,this.oldState=new so(this),this.newState=new so(this),this.timeline=null,this.transformAnimation=null,this.animating=[],this.swapping=[],this.leaving=[],this.entering=[],this.oldState.record(),lr(this.transitionMuteStore)}revert(){return this.root.classList.remove("is-animated"),this.timeline&&(this.timeline.complete(),this.timeline=null),this.transformAnimation&&(this.transformAnimation.complete(),this.transformAnimation=null),this.animating.length=this.swapping.length=this.leaving.length=this.entering.length=0,this.oldState.revert(),this.newState.revert(),requestAnimationFrame(()=>lr(this.transitionMuteStore)),this}record(){return this.transformAnimation&&(this.transformAnimation.cancel(),this.transformAnimation=null),this.oldState.record(),this.timeline&&(this.timeline.cancel(),this.timeline=null),this.newState.forEachRootNode(eo),this}animate(e={}){const t={ease:U(e.ease,this.params.ease),delay:U(e.delay,this.params.delay),duration:U(e.duration,this.params.duration)},s={id:this.id},r=U(e.onComplete,this.params.onComplete),i=U(e.onPause,this.params.onPause);for(let x in fs)x!=="ease"&&x!=="duration"&&x!=="delay"&&(D(e[x])?D(this.params[x])||(s[x]=this.params[x]):s[x]=e[x]);s.onComplete=()=>{const x=e.autoplay,M=z.editor;if(x&&x.linked||M&&M.showPanel){r&&r(this.timeline);return}this.transformAnimation&&this.transformAnimation.cancel(),g.forEachRootNode(I=>{to(I),eo(I)});for(let I=0,L=w.length;I<L;I++){const q=w[I];q.style.transform=g.getComputedValue(q,"transform")}this.root.classList.contains("is-animated")&&(this.root.classList.remove("is-animated"),r&&r(this.timeline)),requestAnimationFrame(()=>{this.root.classList.contains("is-animated")||lr(this.transitionMuteStore)})},s.onPause=()=>{const x=e.autoplay;if(x&&x.linked){r&&r(this.timeline),i&&i(this.timeline);return}this.root.classList.contains("is-animated")&&(this.transformAnimation&&this.transformAnimation.cancel(),g.forEachRootNode(to),this.root.classList.remove("is-animated"),r&&r(this.timeline),i&&i(this.timeline))},s.composition=!1;const n=at(at(e.swapAt||{},this.swapAtParams),t),o=at(at(e.enterFrom||{},this.enterFromParams),t),a=at(at(e.leaveTo||{},this.leaveToParams),t),[h,u]=is(n),[f,l]=is(o),[d,c]=is(a),p=this.oldState,g=this.newState,v=this.animating,_=this.swapping,S=this.entering,y=this.leaving,m=this.pendingRemoval;v.length=_.length=S.length=y.length=0,p.forEachRootNode(Rc),g.record(),g.forEachRootNode(Nc);const b=[],k=[],w=[],E=[],O=g.rootNode,P=O.$el;g.forEachRootNode(x=>{const M=x.$el,I=x.id,L=x.parentNode,q=L?L.branchAdded:!1,K=L?L.branchRemoved:!1,G=L?L.branchNotRendered:!1;let W=p.nodes.get(I);const ee=!W;ee?(W=ei(x,{},p),p.nodes.set(I,W),W.measuredIsRemoved=!0):W.measuredIsRemoved&&!x.measuredIsRemoved&&(ei(x,W,p),W.measuredIsRemoved=!0);const Y=W.parentNode,re=(Y?Y.id:null)!==(L?L.id:null),ge=W.$el!==x.$el,he=W.measuredIsRemoved,le=x.measuredIsRemoved;if(!W.measuredIsRemoved&&!le&&!ee&&(re||ge)){const we=W.properties.left,Te=W.properties.top,xe=L||g.rootNode,me=xe.id?p.nodes.get(xe.id):null,te=me?me.properties.left:xe.properties.left,T=me?me.properties.top:xe.properties.top,N=me?me.properties.clientLeft:xe.properties.clientLeft,B=me?me.properties.clientTop:xe.properties.clientTop;W.properties.x=we-te-N,W.properties.y=Te-T-B}x.hasVisibilitySwap&&(x.hasVisibilityHidden&&(x.$el.style.visibility="visible",x.$measure.style.visibility="hidden"),x.hasDisplayNone&&(x.$el.style.display=W.measuredDisplay||x.measuredDisplay||"",x.$measure.style.visibility="hidden"));const J=m.has(M),ce=W.measuredIsVisible,de=x.measuredIsVisible,ie=!ce&&de&&!G,ae=!le&&(he||J)&&!q,ke=le&&!he&&!K,ye=ke||le&&J&&!K;x.branchAdded=q||ae,x.branchRemoved=K||ye,x.branchNotRendered=G||le,le&&ce&&(x.$el.style.display=W.measuredDisplay,x.$el.style.visibility="visible",ei(W,x,g)),ke?(x.isTarget&&(y.push(M),x.isLeaving=!0),m.add(M)):!le&&J&&m.delete(M),ae&&!G||ie?(jn(W,f),x.isTarget&&(S.push(M),x.isEntering=!0)):ye&&!G&&jn(x,d),x!==O&&x.isTarget&&!x.isEntering&&!x.isLeaving&&v.push(M),b.push(M)});let A=0,C=0,H=0;g.forEachRootNode(x=>{const M=x.$el,I=x.parentNode,L=p.nodes.get(x.id),q=x.properties,K=L.properties;let G=I!==O&&I;for(;G&&!G.isTarget&&G!==O;)G=G.parentNode;x===O?(x.index=0,x.targets=v,_s(x,t)):x.isEntering?(x.index=G?G.index:A,x.targets=G?v:S,_s(x,l),A++):x.isLeaving?(x.index=G?G.index:C,x.targets=G?v:y,C++,_s(x,c)):x.isTarget?(x.index=H++,x.targets=v,_s(x,t)):(x.index=G?G.index:0,x.targets=v,_s(x,u)),L.index=x.index,L.targets=x.targets;for(let re in q)q[re]=Ne(q[re],M,x.index,x.targets,null,null),K[re]=Ne(K[re],M,L.index,L.targets,null,null);const W=1,ee=Math.abs(q.width-K.width)>W,Y=Math.abs(q.height-K.height)>W;if(x.sizeChanged=ee||Y,x.isTarget&&(!x.measuredIsRemoved&&L.measuredIsVisible||x.measuredIsRemoved&&x.measuredIsVisible)){(q.transform!=="none"||K.transform!=="none")&&(x.hasTransform=!0,w.push(M));for(let re in q)if(re!=="transform"&&q[re]!==K[re]){k.push(M);break}}x.isTarget||(_.push(M),x.sizeChanged&&I&&I.isTarget&&I.sizeChanged&&(h.transform&&(x.hasTransform=!0,w.push(M)),E.push(M)))});const $={delay:x=>g.getNode(x).delay,duration:x=>g.getNode(x).duration,ease:x=>g.getNode(x).ease};if(s.defaults=$,this.timeline=In(s),!k.length&&!w.length&&!_.length)return lr(this.transitionMuteStore),this.timeline.complete();if(b.length){this.root.classList.add("is-animated");for(let x=0,M=b.length;x<M;x++){const I=b[x],L=I.dataset.layoutId,q=p.nodes.get(L),K=g.nodes.get(L),G=q.properties;K.isInlined||((q.measuredDisplay==="grid"||K.measuredDisplay==="grid")&&I.style.setProperty("display","block","important"),(I!==P||this.absoluteCoords)&&(I.style.position=this.absoluteCoords?"fixed":"absolute",I.style.left="0px",I.style.top="0px",I.style.marginLeft="0px",I.style.marginTop="0px",I.style.translate=`${G.x}px ${G.y}px`),I===P&&K.measuredPosition==="static"&&(I.style.position="relative",I.style.left="0px",I.style.top="0px")),I.style.width=`${G.width}px`,I.style.height=`${G.height}px`,I.style.minWidth="auto",I.style.minHeight="auto",I.style.maxWidth="none",I.style.maxHeight="none"}(p.scrollX!==window.scrollX||p.scrollY!==window.scrollY)&&requestAnimationFrame(()=>window.scrollTo(p.scrollX,p.scrollY));for(let x=0,M=k.length;x<M;x++){const I=k[x],L=I.dataset.layoutId,q=p.nodes.get(L),K=g.nodes.get(L),G=q.properties,W=K.properties;let ee=!1;const Y={composition:"none"};G.width!==W.width&&(Y.width=[G.width,W.width],ee=!0),G.height!==W.height&&(Y.height=[G.height,W.height],ee=!0),!K.hasTransform&&!K.isInlined&&(Y.translate=[`${G.x}px ${G.y}px`,`${W.x}px ${W.y}px`],ee=!0),this.properties.forEach(re=>{const ge=G[re],he=W[re];re!=="transform"&&ge!==he&&(Y[re]=[ge,he],ee=!0)}),ee&&this.timeline.add(I,Y,0)}}if(_.length){for(let x=0,M=_.length;x<M;x++){const I=_[x],L=p.getNode(I),q=L.properties;I.style.width=`${q.width}px`,I.style.height=`${q.height}px`,I.style.minWidth="auto",I.style.minHeight="auto",I.style.maxWidth="none",I.style.maxHeight="none",L.isInlined||(I.style.translate=`${q.x}px ${q.y}px`),this.properties.forEach(K=>{K!=="transform"&&(I.style[K]=`${p.getComputedValue(I,K)}`)})}for(let x=0,M=_.length;x<M;x++){const I=_[x],L=g.getNode(I),q=L.properties;this.timeline.call(()=>{I.style.width=`${q.width}px`,I.style.height=`${q.height}px`,I.style.minWidth="auto",I.style.minHeight="auto",I.style.maxWidth="none",I.style.maxHeight="none",L.isInlined||(I.style.translate=`${q.x}px ${q.y}px`),this.properties.forEach(K=>{K!=="transform"&&(I.style[K]=`${g.getComputedValue(I,K)}`)})},L.delay+L.duration/2)}if(E.length){const x=xt(g.nodes.get(E[0].dataset.layoutId).ease),M=L=>1-x(1-L),I={};if(h)for(let L in h)L!=="transform"&&(I[L]=[{from:q=>p.getComputedValue(q,L),to:h[L]},{from:h[L],to:q=>g.getComputedValue(q,L),ease:M}]);this.timeline.add(E,I,0)}}const V=w.length;if(V){for(let x=0;x<V;x++){const M=w[x],I=g.getNode(M);I.isInlined||(M.style.translate=`${p.getComputedValue(M,"x")}px ${p.getComputedValue(M,"y")}px`),M.style.transform=p.getComputedValue(M,"transform"),E.includes(M)&&(I.ease=Ne(n.ease,M,I.index,I.targets,null,null),I.duration=Ne(n.duration,M,I.index,I.targets,null,null))}this.transformAnimation=Qn.animate(w,{translate:x=>g.getNode(x).isInlined?"0px 0px":`${g.getComputedValue(x,"x")}px ${g.getComputedValue(x,"y")}px`,transform:x=>{const M=g.getComputedValue(x,"transform");if(!E.includes(x))return M;const I=p.getComputedValue(x,"transform"),L=g.getNode(x);return[I,Ne(h.transform,x,L.index,L.targets,null,null),M]},autoplay:!1,...$}),this.timeline.sync(this.transformAnimation,0)}return this.timeline.init()}update(e,t={}){return this.record(),e(this),this.animate(t)}},Dc=(e,t)=>new ro(e,t),lt=lc,cr={},Bc=(e,t=0)=>(...s)=>t?r=>e(...s,r):r=>e(r,...s),io=e=>(...t)=>{const s=e(...t);return new Proxy(oe,{apply:(r,i,[n])=>s(n),get:(r,i)=>{if(cr[i])return io((...n)=>{const o=cr[i](...n);return a=>o(s(a))})}})},ct=(e,t,s=0)=>{const r=(...i)=>(i.length<t.length?io(Bc(t,s)):t)(...i);return cr[e]||(cr[e]=r),r},no=ct("roundPad",lt.roundPad),oo=ct("padStart",lt.padStart),ao=ct("padEnd",lt.padEnd),lo=ct("wrap",lt.wrap),co=ct("mapRange",lt.mapRange),uo=ct("degToRad",lt.degToRad),ho=ct("radToDeg",lt.radToDeg),fo=ct("snap",lt.snap),po=ct("clamp",lt.clamp),go=ct("round",lt.round),mo=ct("lerp",lt.lerp,1),vo=ct("damp",lt.damp,1),Ss=(e=0,t=1,s=0)=>{const r=10**s;return Math.floor((Math.random()*(t-e+1/r)+e)*r)/r},Hc=0,ks=(e,t=0,s=1,r=0)=>{let i=e===void 0?Hc++:e;return(n=t,o=s,a=r)=>{i+=1831565813,i=Math.imul(i^i>>>15,i|1),i^=i+Math.imul(i^i>>>7,i|61);const h=10**a;return Math.floor((((i^i>>>14)>>>0)/4294967296*(o-n+1/h)+n)*h)/h}},yo=e=>e[Ss(0,e.length-1)],ti=(e,t=Ss)=>{let s=e.length,r,i;for(;s;)i=t(0,--s),r=e[s],e[s]=e[i],e[i]=r;return e},ws=(e,t={})=>{let s=[],r=0,i,n=null;const o=t.from,a=t.reversed,h=t.ease,u=!D(h),f=u&&!D(h.ease)?h.ease:u?xt(h):null,l=t.grid,d=l===!0,c=t.axis,p=t.total,g=D(o)||o===0||o==="first",v=o==="center",_=o==="last",S=o==="random",y=$e(o),m=$e(e),b=t.use,k=Ft(m?e[0]:e),w=m?Ft(e[1]):0,E=en.exec((m?e[1]:e)+""),O=t.start||0+(m?k:0),P=t.seed,A=!D(P)&&P!==!1?ks(P===!0?0:P):Ss,C=t.jitter,H=!D(C),$=$e(C),V=$?C[0]:C||0,x=$?C[1]:C||0;let M=g?0:qe(o)?o:0;return(I,L,q,K,G)=>{const[W]=Lt(I),ee=D(p)?q.length:p,Y=D(b)?!1:Ee(b)?b(W,L,ee):Ut(W,b),re=qe(Y)||Be(Y)&&qe(+Y)?+Y:L,ge=re>=0&&re<ee?re:L;if(v&&(M=(ee-1)/2),_&&(M=ee-1),!s.length){if(d){let J=!0,ce=!1,de=1/0,ie=1/0,ae=1/0,ke=-1/0,ye=-1/0,we=-1/0;const Te=[],xe=[],me=[];for(let te=0;te<ee;te++){const T=q[te];let N=0,B=0,R=0,X=!1;if(T&&Ee(T.getBoundingClientRect)){const j=T.getBoundingClientRect();N=j.left+j.width/2,B=j.top+j.height/2,X=!0}else{const j=T;j&&qe(j.x)&&qe(j.y)&&(N=j.x,B=j.y,qe(j.z)&&(R=j.z,ce=!0),X=!0)}if(!X){J=!1;break}Te.push(N),xe.push(B),me.push(R),N<de&&(de=N),B<ie&&(ie=B),R<ae&&(ae=R),N>ke&&(ke=N),B>ye&&(ye=B),R>we&&(we=R)}if(J){let te=Te[0],T=xe[0],N=me[0];y?(te=de+o[0]*(ke-de),T=ie+o[1]*(ye-ie),N=ce?ae+(o.length>=3?o[2]:.5)*(we-ae):0):v?(te=(de+ke)/2,T=(ie+ye)/2,N=(ae+we)/2):_?(te=Te[ee-1],T=xe[ee-1],N=me[ee-1]):qe(o)&&(te=Te[o],T=xe[o],N=me[o]);for(let R=0;R<ee;R++){const X=te-Te[R],j=T-xe[R],se=N-me[R];let be=nt(X*X+j*j+(ce?se*se:0));c==="x"&&(be=-X),c==="y"&&(be=-j),c==="z"&&(be=-se),s.push(be)}let B=1/0;for(let R=0;R<ee;R++){const X=ot(s[R]);X>0&&X<B&&(B=X)}if(B>0&&B<1/0)for(let R=0;R<ee;R++)s[R]=s[R]/B}else for(let te=0;te<ee;te++)s.push(ot(M-te))}else for(let J=0;J<ee;J++)if(!l)s.push(ot(M-J));else{const ce=l.length,de=l[0]*l[1];let ie,ae,ke;y?(ie=o[0]*(l[0]-1),ae=o[1]*(l[1]-1),ke=ce===3?(o.length>=3?o[2]:.5)*(l[2]-1):0):v?(ie=(l[0]-1)/2,ae=(l[1]-1)/2,ke=ce===3?(l[2]-1)/2:0):(ie=M%l[0],ae=Kt(M/l[0])%l[1],ke=ce===3?Kt(M/de):0);const ye=J%l[0],we=Kt(J/l[0])%l[1],Te=ce===3?Kt(J/de):0,xe=ie-ye,me=ae-we,te=ke-Te;let T=nt(xe*xe+me*me+(ce===3?te*te:0));c==="x"&&(T=-xe),c==="y"&&(T=-me),c==="z"&&(T=-te),s.push(T)}r=s[0];for(let J=1;J<ee;J++)s[J]>r&&(r=s[J]);if(f||a)for(let J=0;J<ee;J++){let ce=s[J];f&&(ce=f(ce/r)*r),a&&(ce=c?-ce:ot(r-ce)),s[J]=ce}if(H){n=new Array(ee);for(let J=0;J<ee;J++)n[J]=A(-1,1,4)}S&&(s=ti(s,A))}const he=m?(w-k)/r:k;D(i)&&(i=G?ms(G,D(t.start)?G.iterationDuration:O):O);let le=i+(he*F(s[ge],2)||0);if(H){const J=r?s[ge]/r:0,ce=V+(x-V)*J;le=le+n[ge]*ce}return t.modifier&&(le=t.modifier(le)),E&&(le=`${le}${E[2]}`),le}},$c=Gt({$:()=>Lt,addChild:()=>mt,clamp:()=>po,cleanInlineStyles:()=>gn,createSeededRandom:()=>ks,damp:()=>vo,degToRad:()=>uo,forEachChildren:()=>Se,get:()=>It,keepTime:()=>tr,lerp:()=>mo,mapRange:()=>co,padEnd:()=>ao,padStart:()=>oo,radToDeg:()=>ho,random:()=>Ss,randomPick:()=>yo,remove:()=>Mn,removeChild:()=>gt,round:()=>go,roundPad:()=>no,set:()=>Ct,shuffle:()=>ti,snap:()=>fo,stagger:()=>ws,sync:()=>Jr,wrap:()=>lo}),bo=e=>{const t=st(e)[0];return!t||!Hs(t)?console.warn(`${e} is not a valid SVGGeometryElement`):t},si=(e,t,s,r,i)=>{const n=s+r,o=i?Math.max(0,Math.min(n,t)):(n%t+t)%t;return e.getPointAtLength(o)},ri=(e,t,s=0)=>r=>{const i=+e.getTotalLength(),n=r[Ir],o=e.getCTM(),a=s===0;return{from:0,to:i,modifier:h=>{const u=h+s*i;if(t==="a"){const f=si(e,i,u,-1,a),l=si(e,i,u,1,a);return qs(l.y-f.y,l.x-f.x)*180/bt}else{const f=si(e,i,u,0,a);return t==="x"?n||!o?f.x:f.x*o.a+f.y*o.c+o.e:n||!o?f.y:f.x*o.b+f.y*o.d+o.f}}}},_o=(e,t=0)=>{const s=bo(e);if(s)return{translateX:ri(s,"x",t),translateY:ri(s,"y",t),rotate:ri(s,"a",t)}},qc=e=>{let t=1;if(e&&e.getCTM){const s=e.getCTM();s&&(t=(nt(s.a*s.a+s.b*s.b)+nt(s.c*s.c+s.d*s.d))/2)}return t},Fc=(e,t,s)=>{const r=Ye,i=getComputedStyle(e),n=i.strokeLinecap,o=i.vectorEffect==="non-scaling-stroke"?e:null;let a=n;const h=new Proxy(e,{get(u,f){const l=u[f];return f===Ji?u:f==="setAttribute"?(...d)=>{if(d[0]==="draw"){const c=d[1].split(" "),p=+c[0],g=+c[1],v=qc(o),_=p*-r*v,S=g*r*v+_,y=r*v+(p===0&&g===1||p===1&&g===0?0:10*v)-S;if(n!=="butt"){const m=p===g?"butt":n;a!==m&&(u.style.strokeLinecap=`${m}`,a=m)}u.setAttribute("stroke-dashoffset",`${_}`),u.setAttribute("stroke-dasharray",`${S} ${y}`)}return Reflect.apply(l,u,d)}:Ee(l)?(...d)=>Reflect.apply(l,u,d):l}});return e.getAttribute("pathLength")!==`${r}`&&(e.setAttribute("pathLength",`${r}`),h.setAttribute("draw",`${t} ${s}`)),h},So=(e,t=0,s=0)=>st(e).map(r=>Fc(r,t,s)),ko=(e,t=.33)=>(s,r,i,n)=>{if(!(s.tagName||"").toLowerCase().match(/^(path|polygon|polyline)$/))throw new Error(`Can't morph a <${s.tagName}> SVG element. Use <path>, <polygon> or <polyline>.`);const o=bo(e);if(!o)throw new Error("Can't morph to an invalid target. 'path2' must resolve to an existing <path>, <polygon> or <polyline> SVG element.");if(!(o.tagName||"").toLowerCase().match(/^(path|polygon|polyline)$/))throw new Error(`Can't morph a <${o.tagName}> SVG element. Use <path>, <polygon> or <polyline>.`);const a=s.tagName==="path",h=a?" ":",",u=n?n._value:null;u&&s.setAttribute(a?"d":"points",u);let f="",l="";if(!t)f=s.getAttribute(a?"d":"points"),l=o.getAttribute(a?"d":"points");else{const d=s.getTotalLength(),c=o.getTotalLength(),p=Math.max(Math.ceil(d*t),Math.ceil(c*t));for(let g=0;g<p;g++){const v=g/(p-1),_=s.getPointAtLength(d*v),S=o.getPointAtLength(c*v),y=a?g===0?"M":"L":"";f+=y+F(_.x,3)+h+_.y+" ",l+=y+F(S.x,3)+h+S.y+" "}}return[f,l]},Vc=Gt({createDrawable:()=>So,createMotionPath:()=>_o,morphTo:()=>ko}),ur=typeof Intl<"u"&&Intl.Segmenter,zc=/\{value\}/g,Uc=/\{i\}/g,ii=/(\s+)/,ni=/^\s+$/,oi="line",xs="word",Ts="char",Cs="data-line",ai=null,li=null,hr=null,wo=e=>e.isWordLike||e.segment===" "||qe(+e.segment),ci=e=>e.setAttribute("aria-hidden","true"),dr=(e,t)=>[...e.querySelectorAll(`[data-${t}]:not([data-${t}] [data-${t}])`)],Wc={line:"#00D672",word:"#FF4B4B",char:"#5A87FF"},xo=e=>{if(!e.childElementCount&&!e.textContent.trim()){const t=e.parentElement;e.remove(),t&&xo(t)}},To=(e,t,s)=>{const r=e.getAttribute(Cs);if(r!==null&&+r!==t||e.tagName==="BR"){s.add(e);const n=e.previousSibling,o=e.nextSibling;n&&n.nodeType===3&&ni.test(n.textContent)&&s.add(n),o&&o.nodeType===3&&ni.test(o.textContent)&&s.add(o)}let i=e.childElementCount;for(;i--;)To(e.children[i],t,s);return s},ui=(e,t={})=>{let s="";t||(t={});const r=Be(t.class)?` class="${t.class}"`:"",i=U(t.clone,!1),n=U(t.wrap,!1),o=n?n===!0?"clip":n:i?"clip":!1;if(n&&(s+=`<span${o?` style="overflow:${o};"`:""}>`),s+=`<span${r}${i?' style="position:relative;"':""} data-${e}="{i}">`,i){const a=i==="left"?"-100%":i==="right"?"100%":"0",h=i==="top"?"-100%":i==="bottom"?"100%":"0";s+="<span>{value}</span>",s+=`<span inert style="position:absolute;top:${h};left:${a};white-space:nowrap;">{value}</span>`}else s+="{value}";return s+="</span>",n&&(s+="</span>"),s},hi=(e,t,s,r,i,n,o,a,h)=>{const u=i===oi,f=i===Ts,l=`_${i}_`,d=Ee(e)?e(s):e,c=u?"block":"inline-block";hr.innerHTML=d.replace(zc,`<i class="${l}"></i>`).replace(Uc,`${f?h:u?o:a}`);const p=hr.content,g=p.firstElementChild,v=p.querySelector(`[data-${i}]`)||g,_=p.querySelectorAll(`i.${l}`),S=_.length;if(S){g.style.display=c,v.style.display=c,v.setAttribute(Cs,`${o}`),u||(v.setAttribute("data-word",`${a}`),f&&v.setAttribute("data-char",`${h}`));let y=S;for(;y--;){const m=_[y],b=m.parentElement;b.style.display=c,u?b.innerHTML=s.innerHTML:b.replaceChild(s.cloneNode(!0),m)}t.push(v),r.appendChild(p)}else console.warn('The expression "{value}" is missing from the provided template.');return n&&(g.style.outline=`1px dotted ${Wc[i]}`),g},fr=class{constructor(e,t={}){ai||(ai=ur?new ur([],{granularity:xs}):{segment:c=>{const p=[],g=c.split(ii);for(let v=0,_=g.length;v<_;v++){const S=g[v];p.push({segment:S,isWordLike:!ni.test(S)})}return p}}),li||(li=ur?new ur([],{granularity:"grapheme"}):{segment:c=>[...c].map(p=>({segment:p}))}),!hr&&yt&&(hr=Q.createElement("template")),Ie.current&&Ie.current.register(this);const{words:s,chars:r,lines:i,accessible:n,includeSpaces:o,debug:a}=t,h=(e=$e(e)?e[0]:e)&&e.nodeType?e:(Ur(e)||[])[0],u=i===!0?{}:i,f=s===!0||D(s)?{}:s,l=r===!0?{}:r;this.debug=U(a,!1),this.includeSpaces=U(o,!1),this.accessible=U(n,!0),this.linesOnly=u&&!f&&!l,this.lineTemplate=De(u)?ui(oi,u):u,this.wordTemplate=De(f)||this.linesOnly?ui(xs,f):f,this.charTemplate=De(l)?ui(Ts,l):l,this.$target=h,this.html=h&&h.innerHTML,this.lines=[],this.words=[],this.chars=[],this.effects=[],this.effectsCleanups=[],this.cache=null,this.ready=!1,this.width=0,this.resizeTimeout=null;const d=()=>this.html&&(u||f||l)&&this.split();this.resizeObserver=new ResizeObserver(()=>{clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{const c=h.offsetWidth;c!==this.width&&(this.width=c,d())},150)}),this.lineTemplate&&!this.ready?Q.fonts.ready.then(d):d(),h?this.resizeObserver.observe(h):console.warn("No Text Splitter target found.")}addEffect(e){if(!Ee(e))return console.warn("Effect must return a function."),this;const t=tr(e);return this.effects.push(t),this.ready&&(this.effectsCleanups[this.effects.length-1]=t(this)),this}revert(){return clearTimeout(this.resizeTimeout),this.lines.length=this.words.length=this.chars.length=0,this.resizeObserver.disconnect(),this.effectsCleanups.forEach(e=>Ee(e)?e(this):e.revert&&e.revert()),this.$target.innerHTML=this.html,this}splitNode(e){const t=this.wordTemplate,s=this.charTemplate,r=this.includeSpaces,i=this.debug,n=e.nodeType;if(n===3){const o=e.nodeValue;if(o.trim()){const a=[],h=this.words,u=this.chars,f=ai.segment(o),l=Q.createDocumentFragment();let d=null;for(const c of f){const p=c.segment,g=wo(c);if(!d||g&&d&&wo(d))a.push(p);else{const v=a.length-1,_=a[v];!ii.test(_)&&!ii.test(p)?a[v]+=p:a.push(p)}d=c}for(let c=0,p=a.length;c<p;c++){const g=a[c];if(g.trim()){const v=a[c+1],_=r&&v&&!v.trim(),S=g,y=s?li.segment(S):null,m=s?Q.createDocumentFragment():Q.createTextNode(_?g+" ":g);if(s){const b=[...y];for(let k=0,w=b.length;k<w;k++){const E=b[k],O=k===w-1&&_?E.segment+" ":E.segment,P=Q.createTextNode(O);hi(s,u,P,m,Ts,i,-1,h.length,u.length)}}t?hi(t,h,m,l,xs,i,-1,h.length,u.length):s?l.appendChild(m):l.appendChild(Q.createTextNode(g)),_&&c++}else{if(c&&r)continue;l.appendChild(Q.createTextNode(g))}}e.parentNode.replaceChild(l,e)}}else if(n===1){const o=[...e.childNodes];for(let a=0,h=o.length;a<h;a++)this.splitNode(o[a])}}split(e=!1){const t=this.$target,s=!!this.cache&&!e,r=this.lineTemplate,i=this.wordTemplate,n=this.charTemplate,o=Q.fonts.status!=="loading",a=r&&o;this.ready=!r||o,(a||e)&&this.effectsCleanups.forEach(l=>Ee(l)&&l(this)),s||(e&&(t.innerHTML=this.html,this.words.length=this.chars.length=0),this.splitNode(t),this.cache=t.innerHTML),a&&(s&&(t.innerHTML=this.cache),this.lines.length=0,i&&(this.words=dr(t,xs))),n&&(a||i)&&(this.chars=dr(t,Ts));const h=this.words.length?this.words:this.chars;let u,f=0;for(let l=0,d=h.length;l<d;l++){const c=h[l],{top:p,height:g}=c.getBoundingClientRect();!D(u)&&p-u>g*.5&&f++,c.setAttribute(Cs,`${f}`);const v=c.querySelectorAll(`[${Cs}]`);let _=v.length;for(;_--;)v[_].setAttribute(Cs,`${f}`);u=p}if(a){const l=Q.createDocumentFragment(),d=new Set,c=[];for(let p=0;p<f+1;p++){const g=t.cloneNode(!0);To(g,p,new Set).forEach(v=>{const _=v.parentNode;_&&(v.nodeType===1&&d.add(_),_.removeChild(v))}),c.push(g)}d.forEach(xo);for(let p=0,g=c.length;p<g;p++)hi(r,this.lines,c[p],l,oi,this.debug,p);t.innerHTML="",t.appendChild(l),i&&(this.words=dr(t,xs)),n&&(this.chars=dr(t,Ts))}if(this.linesOnly){const l=this.words;let d=l.length;for(;d--;){const c=l[d];c.replaceWith(c.textContent)}l.length=0}if(this.accessible&&(a||!s)){const l=Q.createElement("span");l.style.cssText="position:absolute;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);width:1px;height:1px;white-space:nowrap;",l.innerHTML=this.html,t.insertBefore(l,t.firstChild),this.lines.forEach(ci),this.words.forEach(ci),this.chars.forEach(ci)}return this.width=t.offsetWidth,(a||e)&&this.effects.forEach((l,d)=>this.effectsCleanups[d]=l(this)),this}refresh(){this.split(!0)}},Co=(e,t)=>new fr(e,t),Ps=(e,t)=>(console.warn("text.split() is deprecated, import splitText() directly, or text.splitText()"),new fr(e,t)),Po=e=>{let t="";for(let s=0,r=e.length;s<r;s++)if(s+2<r&&e[s+1]==="-"&&e.charCodeAt(s)<e.charCodeAt(s+2)){const i=e.charCodeAt(s),n=e.charCodeAt(s+2);for(let o=i;o<=n;o++)t+=String.fromCharCode(o);s+=2}else t+=e[s];return t},Eo={lowercase:"a-z",uppercase:"A-Z",numbers:"0-9",symbols:"!%#_|*+=",braille:"⠀-⣿",blocks:"▀-▟",shades:"░-▓"},di=new WeakMap,Ao=(e={})=>{e||(e={});const t=e.chars,s=xt(e.ease||"linear"),r=e.text,i=e.from,n=e.reversed||!1,o=e.perturbation||0,a=e.cursor,h=a===!0?"_":typeof a=="number"?String.fromCharCode(a):typeof a=="string"?a:"",u=h.length,f=e.seed||0,l=e.override!==void 0?e.override:!0,d=e.revealRate||60,c=1e3*z.timeScale/d,p=e.settleDuration||300*z.timeScale,g=e.settleRate||30,v=e.duration,_=e.revealDelay,S=e.delay,y=e.onChange||oe;return(m,b,k,w)=>{const E=typeof t=="function"?t(m,b,k):t||"a-zA-Z0-9!%#_",O=Po(Eo[E]||E),P=O.length-1,A=typeof v=="function"?v(m,b,k):v,C=typeof _=="function"?_(m,b,k):_||0,H=typeof S=="function"?S(m,b,k):S||0,$=f?ks(f):ks();di.has(m)||di.set(m,m.textContent);const V=w?w._value:m.textContent,x=r!==void 0?typeof r=="function"?r(m,b,k):r:w?w._value:di.get(m),M=x===" "||x===" "?" ":x,I=V===" "?0:V.length,L=M.length,q=l===!0?O:typeof l=="string"&&l.length>0?Po(Eo[l]||l):null,K=q?q.length-1:0,G=l===" "?" ":null,W=l===""?L:Math.max(I,L),ee=A>0?A:(W-1)*c+p,Y=F((ee+C)/z.timeScale,0)*z.timeScale,re=C>0?F(C/Y,12):0,ge=i===void 0||i==="auto"?L<I?"right":"left":i,he=new Int32Array(W);if(ge==="random"){for(let R=0;R<W;R++)he[R]=R;for(let R=W-1;R>0;R--){const X=$(0,R),j=he[R];he[R]=he[X],he[X]=j}}else{const R=ge==="right"?(l===""||!I?W:I)-1:ge==="center"?((l===""||!I?W:I)-1)/2:typeof ge=="number"?ge:0,X=Math.abs,j=new Array(W);for(let se=0;se<W;se++)j[se]=se;j.sort((se,be)=>X(se-R)-X(be-R));for(let se=0;se<W;se++)he[j[se]]=se}if(n){const R=W-1;for(let X=0;X<W;X++)he[X]=R-he[X]}const le=F(p/ee,12),J=F((1-le)/W,12),ce=u*J,de=F(1e3*z.timeScale/(g*Y),12),ie=new Float32Array(W),ae=new Float32Array(W),ke=o>0?o*le:0;for(let R=0;R<W;R++){const X=ke>0?($(0,2e3)-1e3)/1e3*ke:0,j=ke>0?($(0,2e3)-1e3)/1e3*ke:0;ie[R]=he[R]*J+X,ae[R]=Math.ceil((ie[R]+le+j)/de)*de}if(L<W&&ge!=="left"&&ge!=="right"&&ge!=="random"){let R=0;for(let se=L;se<W;se++)ae[se]>R&&(R=ae[se]);const X=new Array(L);for(let se=0;se<L;se++)X[se]=se;X.sort((se,be)=>he[se]-he[be]);const j=(1-R)/L;for(let se=0;se<L;se++){const be=R+se*j;be>ae[X[se]]&&(ae[X[se]]=be)}}const ye=new Array(W);for(let R=0;R<W;R++)ye[R]=O[$(0,P)];const we=q?q===O?ye:new Array(W):null;if(we&&we!==ye)for(let R=0;R<W;R++)we[R]=G||q[$(0,q.length-1)];let Te=V;if(!w){if(l==="")Te="";else if(q){Te="";for(let R=0;R<I;R++)Te+=V[R]===" "?" ":we[R]}}let xe=-1,me=-1,te="";const T=l!=="",N=!!q,B=u>0;return{from:0,to:1,duration:Y,delay:H,ease:"linear",modifier:R=>{if(R===xe)return te;if(xe=R,H>0&&R<=0)return te=V,V;if(R<=0)return te=Te,Te;if(R>=1)return te=M,M;te="";const X=R/de|0,j=X!==me;j&&(me=X);const se=re>0?(R-re)/(1-re):R,be=se>0?s(se):0;for(let Ae=0;Ae<W;Ae++){const Oe=ie[Ae];if(be>=ae[Ae]){Ae<L&&(te+=M[Ae]);continue}if(be<=0||be<Oe){T&&Ae<I&&(N?V[Ae]===" "?te+=" ":(j&&(we[Ae]=G||q[$(0,K)]),te+=we[Ae]):te+=V[Ae]);continue}Ae<L&&M[Ae]===" "||Ae<I&&V[Ae]===" "?te+=" ":B&&be-Oe<ce?te+=h[u-1-((be-Oe)/J|0)]:(j&&(ye[Ae]=O[$(0,P)]),te+=ye[Ae])}return j&&y(te,be),te}}}},Xc=Gt({TextSplitter:()=>fr,scrambleText:()=>Ao,split:()=>Ps,splitText:()=>Co}),Yc=Gt({$:()=>Lt,Animatable:()=>Gr,AutoLayout:()=>ro,Draggable:()=>Dn,JSAnimation:()=>Tt,Scope:()=>Bn,ScrollObserver:()=>qn,Spring:()=>Ks,TextSplitter:()=>fr,Timeline:()=>Rn,Timer:()=>tt,WAAPIAnimation:()=>Zn,addChild:()=>mt,animate:()=>gs,clamp:()=>po,cleanInlineStyles:()=>gn,createAnimatable:()=>ac,createDraggable:()=>yc,createDrawable:()=>So,createLayout:()=>Dc,createMotionPath:()=>_o,createScope:()=>bc,createSeededRandom:()=>ks,createSpring:()=>On,createTimeline:()=>In,createTimer:()=>tc,cubicBezier:()=>Vn,damp:()=>vo,degToRad:()=>uo,eases:()=>wt,easings:()=>Cc,engine:()=>Ve,forEachChildren:()=>Se,get:()=>It,globals:()=>z,irregular:()=>Un,keepTime:()=>tr,lerp:()=>mo,linear:()=>Kr,mapRange:()=>co,morphTo:()=>ko,onScroll:()=>xc,padEnd:()=>ao,padStart:()=>oo,radToDeg:()=>ho,random:()=>Ss,randomPick:()=>yo,remove:()=>Mn,removeChild:()=>gt,round:()=>go,roundPad:()=>no,scrambleText:()=>Ao,scrollContainers:()=>rr,set:()=>Ct,shuffle:()=>ti,snap:()=>fo,split:()=>Ps,splitText:()=>Co,spring:()=>js,stagger:()=>ws,steps:()=>zn,svg:()=>Vc,sync:()=>Jr,text:()=>Xc,utils:()=>$c,waapi:()=>Qn,wrap:()=>lo}),Gc=class{registerAnimation(e,t,s={}){this.animations[e]={handler:t,options:s}}isInitiallyHidden(e){return this.animations[e]?.options.initiallyHidden??!1}runAnimation(e,t,s,r,i){const n=this.animations[e];n?n.handler(t,s,r,i):(console.warn(`No animation registered with name: ${e}`),r())}addLinkAnimation(e,t){this.linkAnimations.set(e,t)}removeLinkAnimation(e){this.linkAnimations.delete(e)}runLinkAnimation(e){const t=this.linkAnimations.get(e);t&&t()}constructor(){this.animations={},this.linkAnimations=new Map,this.registerAnimation("typewriter",function(e,t,s,r){const{chars:i}=Ps(e,{words:!1,chars:!0}),n=t.fadeDuration||100,o=t.interval||100;gs(i,{opacity:[0,1],easing:"linear",duration:n,delay:ws(o,{start:t.start||0}),loop:r,onComplete:s})},{initiallyHidden:!0}),this.registerAnimation("toast",function(e,t,s,r){const{words:i}=Ps(e,{words:!0,chars:!1}),n=t.fadeDuration||100,o=t.interval||200;gs(i,{opacity:[0,1],y:[{to:["100%","0%"]}],easing:"linear",duration:n,delay:ws(o,{start:t.start||0}),loop:r,onComplete:s})},{initiallyHidden:!0}),this.registerAnimation("fadeIn",function(e,t,s,r){const i=t.duration||500;gs(e,{opacity:[0,1],easing:t.easing||"easeOutQuad",duration:i,delay:t.start||0,loop:r,onComplete:s})},{initiallyHidden:!0}),this.registerAnimation("continue",function(e,t,s){e.classList.add("squiffy-continue");const r=t.style||"pulse";let i=null,n=null;r==="wave"?(e.classList.add("squiffy-continue-wave"),n=Ps(e,{words:!1,chars:!0}).chars,i=gs(n,{opacity:[1,.3,1],easing:"easeInOutSine",duration:1200,delay:ws(80),loop:!0})):e.classList.add(`squiffy-continue-${r}`);const o=()=>{if(e.classList.remove("squiffy-continue","squiffy-continue-wave",`squiffy-continue-${r}`),e.removeEventListener("click",o),i&&(i.pause(),n))for(const a of n)a.style.opacity="1";s()};e.addEventListener("click",o)})}},Zc={animejs:Yc},Lo="input:not([disabled]), textarea:not([disabled]), select:not([disabled])",Qc="a.squiffy-link[data-section], a.squiffy-link[data-passage]";function Ro(e){if(!e)return!0;const t=e.querySelectorAll(Lo);for(const s of t)if(!s.checkValidity())return!1;return!0}function fi(e){if(!e)return;const t=Ro(e),s=e.querySelectorAll(Qc);for(const r of s)t?(r.classList.remove("validation-disabled"),r.removeAttribute("aria-disabled")):(r.classList.add("validation-disabled"),r.setAttribute("aria-disabled","true"))}function pr(e){if(!e)return;const t=e.querySelectorAll(Lo);for(const s of t)s.addEventListener("input",()=>fi(e)),s.addEventListener("change",()=>fi(e)),s.addEventListener("invalid",r=>{r.preventDefault(),s.classList.add("squiffy-invalid")}),s.addEventListener("input",()=>{s.checkValidity()&&s.classList.remove("squiffy-invalid")});fi(e)}var Jc=async e=>{let t,s,r,i,n,o=0;const a=new _l,h=[];let u=!1;async function f(T){if(u||T.closest(".squiffy-output-section")!==r||T.classList.contains("disabled")||!Ro(r))return!1;const N=T.getAttribute("data-passage"),B=T.getAttribute("data-section");if(N!==null)return d(T),ae("_turncount",ie("_turncount")+1),await g(T),N&&(n=null,await b(N)),a.emit("linkClick",{linkType:"passage"}),!0;if(B!==null)return await g(T),B&&await _(B),a.emit("linkClick",{linkType:"section"}),!0;const[R,X,j]=ye.handleLink(T);return R?(j?.disableLink&&d(T),E(),a.emit("linkClick",{linkType:X}),!0):!1}async function l(T){const N=T.target;N.classList.contains("squiffy-link")&&await f(N)}function d(T){T.classList.add("disabled"),T.setAttribute("tabindex","-1")}function c(T){T.classList.remove("disabled"),T.removeAttribute("tabindex")}async function p(){O()||await _(t.start)}async function g(T){me.runLinkAnimation(T),await m();const N=T.getAttribute("data-set");if(N){const B=JSON.parse(N);for(const R of B)v(R)}}function v(T){T=T.replace(/^(\w*\s*):=(.*)$/,(B,R,X)=>R+"="+x.processText(X,!0));const N=/^([\w]*)\s*=\s*(.*)$/.exec(T);if(N){const B=N[1];let R=N[2];R==="true"?ae(B,!0):R==="false"?ae(B,!1):isNaN(R)?(R.startsWith("@")&&(R=ie(R.substring(1))),ae(B,R)):ae(B,parseFloat(R))}else{const B=/^([\w]*)\s*([+\-*/])=\s*(.*)$/.exec(T);if(B){const R=B[1],X=B[2];let j=B[3];j.startsWith("@")&&(j=ie(j.substring(1)));const se=parseFloat(j);let be=ie(R);be===null&&(be=0),X=="+"&&(be+=se),X=="-"&&(be-=se),X=="*"&&(be*=se),X=="/"&&(be/=se),ae(R,be)}else{let R=!0;T.startsWith("not ")&&(T=T.substring(4),R=!1),ae(T,R)}}}async function _(T){const N=G();if(s=t.sections[T],!s)return;ae("_section",T),de.setSeen(T);const B=t.sections[""];(B?.clear||s.clear)&&$(),A(T);const R=r;if(B&&(await y(B,"[[]]"),ie("_section")!==T)){R.remove();return}if(await y(s,`[[${T}]]`),ie("_section")!==T){R.remove();return}pr(r),ae("_turncount",0),J(),E();const X=G();X!=N&&a.emit("canGoBackChanged",{canGoBack:X})}function S(T,N=null){const B={get:ie,set:ae,ui:{transition:xe,write:x.write,scrollToEnd:x.scrollToEnd},story:{go:_,seen:R=>de.getSeen(R)},element:ee,import:Zc,...N};t.js[T](B,ie,ae)}async function y(T,N){if(T.attributes&&await k(T.attributes),T.jsIndex!==void 0){const B=ie("_section");if(S(T.jsIndex),ie("_section")!==B)return}x.write(T.text||"",N),await m()}async function m(){u=!0,r.classList.add("links-disabled");for(const T of h)await T();h.length=0,u=!1,r.classList.remove("links-disabled")}async function b(T){const N=G();let B=s.passages&&s.passages[T];const R=t.sections[""];if(!B&&R&&R.passages&&(B=R.passages[T]),!B)throw`No passage named ${T} in the current section or master section`;de.setSeen(T);const X=[],j=[];if(R&&R.passages){const Oe=R.passages[""];Oe&&(X.push(Oe),j.push(()=>y(Oe,"[[]][]")))}const se=s.passages&&s.passages[""];se&&(X.push(se),j.push(()=>y(se,`[[${ie("_section")}]][]`))),X.push(B),j.push(()=>y(B,`[[${ie("_section")}]][${T}]`));const be="@"+ie("_turncount");if(s.passages){if(be in s.passages){const Oe=s.passages[be];X.push(Oe),j.push(()=>y(Oe,`[[${ie("_section")}]][${be}]`))}if("@last"in s.passages&&ie("_turncount")>=(s.passageCount||0)){const Oe=s.passages["@last"];X.push(Oe),j.push(()=>y(Oe,`[[${ie("_section")}]][${be}]`))}}X.some(Oe=>Oe.clear)&&($(),C()),i=document.createElement("div"),i.classList.add("squiffy-output-passage"),i.setAttribute("data-passage",`${T}`),r.appendChild(i);for(const Oe of j)await Oe();pr(r),J(),E();const Ae=G();Ae!=N&&a.emit("canGoBackChanged",{canGoBack:Ae})}async function k(T){for(const N of T)v(N)}function w(){de.reset(),re.scroll==="element"||re.scroll==="none"?(Y.innerHTML="",p()):location.reload()}function E(){ae("_output",Y.innerHTML)}function O(){const T=()=>{t.uiJsIndex!==void 0&&S(t.uiJsIndex,{registerAnimation:me.registerAnimation.bind(me),registerHelper:ke.handlebars.registerHelper.bind(ke.handlebars),SafeString:ke.handlebars.SafeString})};de.load();const N=ie("_output");return N?(Y.innerHTML=N,I(),L(),n=Y.querySelector(".squiffy-output-block:last-child"),s=t.sections[ie("_section")],T(),te.onLoad(),pr(r),!0):(T(),!1)}function P(){n=document.createElement("div"),n.classList.add("squiffy-output-block"),(i||r)?.appendChild(n)}function A(T){r&&(r.querySelectorAll("input, textarea, select").forEach(N=>{const B=N,R=B.getAttribute("data-attribute")||B.id;R&&ae(R,B.value),B.disabled||(B.disabled=!0,B.setAttribute("data-squiffy-disabled",""))}),r.querySelectorAll("[contenteditable]").forEach(N=>{const B=N.getAttribute("data-attribute")||N.id;B&&ae(B,N.innerHTML),N.getAttribute("contenteditable")!=="false"&&(N.setAttribute("contenteditable","false"),N.setAttribute("data-squiffy-disabled",""))})),i=null,C(T),P()}function C(T){r=document.createElement("div"),r.classList.add("squiffy-output-section"),r.setAttribute("data-section",T??ie("_section")),T||r.setAttribute("data-clear","true"),Y.appendChild(r)}function H(){return Y.querySelector(".squiffy-clear-stack")}function $(){let T=H();T||(T=document.createElement("div"),T.classList.add("squiffy-clear-stack"),T.style.display="none",Y.prepend(T));const N=document.createElement("div");T.appendChild(N);for(const B of[...Y.children])B!==T&&N.appendChild(B)}function V(){const T=H();if(!T)return;for(const B of[...Y.children])B!==T&&B.remove();const N=T.children[T.children.length-1];for(const B of[...N.children])Y.appendChild(B);N.remove()}const x={write:(T,N)=>{o=Y.scrollHeight;const B=x.processText(T,!1).trim();n||P();const R=document.createElement("div");N&&R.setAttribute("data-source",N),R.innerHTML=B,te.onWrite(R),n.appendChild(R),pr(r),x.scrollToEnd()},clearScreen:()=>{$(),C()},scrollToEnd:()=>{if(re.scroll!=="none")if(re.scroll==="element")Y.lastElementChild?.scrollIntoView({block:"end",inline:"nearest",behavior:"smooth"});else{let T=o;const N=Math.max(document.body.scrollTop,document.documentElement.scrollTop);if(T>N){const B=document.documentElement.scrollHeight-window.innerHeight;T>B&&(T=B),window.scrollTo({top:T,behavior:"smooth"})}}},processText:(T,N)=>ke.process(T,N)};function M(T){if(T.start!=t.start){t=T,de.reset(),Y.innerHTML="",_(t.start);return}const N=t;t=T,kl(N,T,Y,(R,X)=>{const j=s;s=X;try{return x.processText(R,!1)}finally{s=j}},d,R=>k(R)),I(),L()}function I(){const T=Y.querySelectorAll(".squiffy-output-section:last-child");r=T[T.length-1];const N=r.getAttribute("data-section");s=t.sections[N]}function L(){i=r.querySelector(".squiffy-output-passage:last-child")}function q(){const T=H(),N=Y.querySelectorAll(".squiffy-output-section").length+Y.querySelectorAll(".squiffy-output-passage").length;return T?N+T.children.length:N}function K(T){T.querySelectorAll("[data-squiffy-disabled]").forEach(N=>{N.hasAttribute("contenteditable")?N.setAttribute("contenteditable","true"):N.disabled=!1,N.removeAttribute("data-squiffy-disabled")})}function G(){return q()>1}function W(){if(u||!G())return;const T=H();if(i){const N=i.getAttribute("data-passage");ce(i.getAttribute("data-undo")),i.remove();let B=!1,R=!1;for(const X of Y.children)if(X!==T){if(X.getAttribute("data-clear")=="true"&&X.children.length==0){B=!0;continue}R=!0;break}B&&!R&&(V(),I());for(const X of r.querySelectorAll("a.squiffy-link[data-passage]"))X.getAttribute("data-passage")==N&&c(X);L()}else{ce(r.getAttribute("data-undo")),r.remove();let N=!1;for(const B of[...Y.children])if(B!==T){N=!0;break}N||V(),I(),L(),K(r)}G()||a.emit("canGoBackChanged",{canGoBack:!1})}const ee=e.element,Y=document.createElement("div");ee.appendChild(Y),t=e.story;const re={scroll:e.scroll||"body",persist:e.persist===void 0?!0:e.persist,onSet:e.onSet||(()=>{})};let ge="";re.persist&&(e.storyId!==void 0?ge=e.storyId:window.location.protocol==="file:"?ge=t.id||"":ge=window.location.pathname,ge||(console.warn("Persist is set to true in Squiffy runtime options, but no storage key could be determined. Persist will be disabled."),re.persist=!1)),re.scroll==="element"&&(Y.style.overflowY="auto"),Y.addEventListener("click",l),Y.addEventListener("keypress",async function(T){T.key==="Enter"&&await l(T)});let he={};const le=function(T,N){T!="_output"&&(T in he||(he[T]=N))},J=function(){(i??r).setAttribute("data-undo",JSON.stringify(he)),he={}},ce=function(T){if(!T)return;const N=JSON.parse(T);if(N)for(const B of Object.keys(N))de.setInternal(B,N[B],!1)},de=new Sl(re.persist,ge,re.onSet,a,le),ie=de.get.bind(de),ae=de.set.bind(de),ke=new bl(()=>t,de,()=>s),ye=new Al,we=T=>T in t.sections&&t.sections[T].text||null,Te=T=>s.passages&&T in s.passages?s.passages[T].text||null:"passages"in t.sections[""]&&t.sections[""].passages&&T in t.sections[""].passages&&t.sections[""].passages[T].text||null,xe=T=>{h.push(T)},me=new Gc,te=new wl(Y,ke,de,ye,we,Te,x.processText,xe,me,a);return te.add(hs.ReplaceLabel()),te.add(hs.RotateSequencePlugin()),te.add(hs.RandomPlugin()),te.add(hs.LivePlugin()),te.add(hs.AnimatePlugin()),{begin:p,restart:w,get:ie,set:ae,clickLink:f,update:M,goBack:W,on:(T,N)=>a.on(T,N),off:(T,N)=>a.off(T,N),once:(T,N)=>a.once(T,N)}};return mr.init=Jc,mr})({});
|
|
131
131
|
|
|
132
132
|
//# sourceMappingURL=squiffy.runtime.global.js.map
|