import{a8 as i,r,l as u,V as n,ad as o,al as c}from"./index-CHfgriyV.js";function d(s=1e3*10){const t=u({...n(),refetchInterval:s}),e=o(),a=i();return r.useEffect(()=>{a.invalidate(),c(e)},[e,a,t.data?.authenticated]),t.isError?{status:"error"}:t.isPending?{status:"loading"}:{status:"ok",isAuthenticated:t.data.authenticated}}function g({status:s,returnUrl:t}){const e=d(1e3),a=i();r.useEffect(()=>{e.status==="ok"&&(e.isAuthenticated||s==="logged_out")&&a.navigate({to:t||"/"})},[a,e,s,t])}export{g as a,d as u};
