import{transition as d}from'../components/transitions/utils/transition.js';import{disposables as l}from'../utils/disposables.js';import{useDisposables as f}from'./use-disposables.js';import{useIsMounted as m}from'./use-is-mounted.js';import{useIsoMorphicEffect as p}from'./use-iso-morphic-effect.js';import{useLatestValue as b}from'./use-latest-value.js';function D({container:i,direction:t,classes:o,onStart:s,onStop:u}){let a=m(),c=f(),r=b(t);p(()=>{let e=l();c.add(e.dispose);let n=i.current;if(n&&r.current!=="idle"&&a.current)return e.dispose(),s.current(r.current),e.add(d(n,o.current,r.current==="enter",()=>{e.dispose(),u.current(r.current)})),e.dispose},[t])}export{D as useTransition};
