import{c as m,h as f,b as y,dr as s,ca as c}from"./index-6Jqoo2rk.js";import{T as u}from"./transition-DuxZkCEv.js";const h=240,A=t=>{const[l,a]=m(0),o=()=>a(n=>n+1),r=()=>a(n=>n-1);return f(()=>{t.onRunningAnimations&&t.onRunningAnimations(l())}),y(u,{onBeforeEnter:o,onAfterEnter:()=>{r(),t.onAfterEnter?.()},onBeforeExit:o,onAfterExit:r,onEnter:async(n,i)=>{const e=n;e.style.height="0px",e.style.opacity="0",s(()=>{const g=e.scrollHeight;e.animate([{height:"0px",opacity:0,...t.scale&&{transform:"scale(0.95)",transformOrigin:"75% center"}},{height:`${g}px`,opacity:1,...t.scale&&{transform:"scale(1)"}}],{duration:c.isAvailable("animations")?h:0,easing:"ease-in-out"}).finished.then(()=>{e.style.removeProperty("height"),e.style.removeProperty("opacity"),i()})})},onExit:async(n,i)=>{s(()=>{n.animate([{height:`${n.scrollHeight}px`,opacity:1},{height:"0px",opacity:0}],{duration:c.isAvailable("animations")?h:0,fill:"forwards",easing:"ease-in-out"}).finished.then(i)})},get children(){return t.children}})};export{A as H};
//# sourceMappingURL=heightTransition-Du7NDu-z.js.map
