import{X as z,Q as B,av as W,aw as L,W as M,u as U,ax as q,ay as P,az as j,at as G,B as K,aA as F,aB as R}from"./CTIk6S6H.mjs";import{a as Q}from"./BN0fnbsC.mjs";const X=()=>performance.now(),$={tick:r=>requestAnimationFrame(r),now:()=>X(),tasks:new Set};function S(){const r=$.now();$.tasks.forEach(a=>{a.c(r)||($.tasks.delete(a),a.f())}),$.tasks.size!==0&&$.tick(S)}function D(r){let a;return $.tasks.size===0&&$.tick(S),{promise:new Promise(t=>{$.tasks.add(a={c:r,f:t})}),abort(){$.tasks.delete(a)}}}function N(r,a){R(()=>{r.dispatchEvent(new CustomEvent(a))})}function H(r){if(r==="float")return"cssFloat";if(r==="offset")return"cssOffset";if(r.startsWith("--"))return r;const a=r.split("-");return a.length===1?a[0]:a[0]+a.slice(1).map(t=>t[0].toUpperCase()+t.slice(1)).join("")}function O(r){const a={},t=r.split(";");for(const s of t){const[v,e]=s.split(":");if(!v||e===void 0)break;const w=H(v.trim());a[w]=e.trim()}return a}const J=r=>r;function aa(r,a,t,s){var m,g;var v=(r&P)!==0,e=(r&j)!==0,w=v&&e,u=(r&q)!==0,b=w?"both":v?"in":"out",f,_=a.inert,p=a.style.overflow,o,n;function y(){return R(()=>{var c;return f!=null?f:f=t()(a,(c=s==null?void 0:s())!=null?c:{},{direction:b})})}var h={is_global:u,in(){var c;if(a.inert=_,!v){n==null||n.abort(),(c=n==null?void 0:n.reset)==null||c.call(n);return}e||o==null||o.abort(),o=k(a,y(),n,1,()=>{N(a,"introstart")},()=>{N(a,"introend"),o==null||o.abort(),o=f=void 0,a.style.overflow=p})},out(c){if(!e){c==null||c(),f=void 0;return}a.inert=!0,n=k(a,y(),o,0,()=>{N(a,"outrostart")},()=>{N(a,"outroend"),c==null||c()})},stop:()=>{o==null||o.abort(),n==null||n.abort()}},d=z;if(((g=(m=d.nodes).t)!=null?g:m.t=[]).push(h),v&&Q){var i=u;if(!i){for(var l=d.parent;l&&(l.f&B)!==0;)for(;(l=l.parent)&&(l.f&W)===0;);i=!l||(l.f&L)!==0}i&&M(()=>{U(()=>h.in())})}}function k(r,a,t,s,v,e){var w=s===1;if(G(a)){var u,b=!1;return K(()=>{if(!b){var i=a({direction:w?"in":"out"});u=k(r,i,t,s,v,e)}}),{abort:()=>{b=!0,u==null||u.abort()},deactivate:()=>u.deactivate(),reset:()=>u.reset(),t:()=>u.t()}}if(t==null||t.deactivate(),!(a!=null&&a.duration)&&!(a!=null&&a.delay))return v(),e(),{abort:F,deactivate:F,reset:F,t:()=>s};const{delay:f=0,css:_,tick:p,easing:o=J}=a;var n=[];if(w&&t===void 0&&(p&&p(0,1),_)){var y=O(_(0,1));n.push(y,y)}var h=()=>1-s,d=r.animate(n,{duration:f,fill:"forwards"});return d.onfinish=()=>{var I;d.cancel(),v();var i=(I=t==null?void 0:t.t())!=null?I:1-s;t==null||t.abort();var l=s-i,m=a.duration*Math.abs(l),g=[];if(m>0){var c=!1;if(_)for(var x=Math.ceil(m/16.666666666666668),A=0;A<=x;A+=1){var E=i+l*o(A/x),C=O(_(E,1-E));g.push(C),c||(c=C.overflow==="hidden")}c&&(r.style.overflow="hidden"),h=()=>{var T=d.currentTime;return i+l*o(T/m)},p&&D(()=>{if(d.playState!=="running")return!1;var T=h();return p(T,1-T),!0})}d=r.animate(g,{duration:m,fill:"forwards"}),d.onfinish=()=>{h=()=>s,p==null||p(s,1-s),e()}},{abort:()=>{d&&(d.cancel(),d.effect=null,d.onfinish=F)},deactivate:()=>{e=F},reset:()=>{s===0&&(p==null||p(1,0))},t:()=>h()}}function V(r){const a=r-1;return a*a*a+1}function ra(r,{delay:a=0,duration:t=400,easing:s=V,axis:v="y"}={}){const e=getComputedStyle(r),w=+e.opacity,u=v==="y"?"height":"width",b=parseFloat(e[u]),f=v==="y"?["top","bottom"]:["left","right"],_=f.map(i=>`${i[0].toUpperCase()}${i.slice(1)}`),p=parseFloat(e[`padding${_[0]}`]),o=parseFloat(e[`padding${_[1]}`]),n=parseFloat(e[`margin${_[0]}`]),y=parseFloat(e[`margin${_[1]}`]),h=parseFloat(e[`border${_[0]}Width`]),d=parseFloat(e[`border${_[1]}Width`]);return{delay:a,duration:t,easing:s,css:i=>`overflow: hidden;opacity: ${Math.min(i*20,1)*w};${u}: ${i*b}px;padding-${f[0]}: ${i*p}px;padding-${f[1]}: ${i*o}px;margin-${f[0]}: ${i*n}px;margin-${f[1]}: ${i*y}px;border-${f[0]}-width: ${i*h}px;border-${f[1]}-width: ${i*d}px;min-${u}: 0`}}export{ra as s,aa as t};
