import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Ep as t,Gy as n,Hy as r,In as i,ap as a,kp as o,lh as s}from"./index-DDwwBb9e.js";var c=e(n()),l=r();function u(){let{project:e,organization:n,organizations:r,isLoading:u}=a({redirectToOnboarding:!1}),d=o(),f=s.governance.resolveHome.useQuery({organizationId:n?.id??``},{enabled:!!n?.id,staleTime:6e4,retry:!1}),[p]=t(`lastVisitedHomeKind`,``);return(0,c.useEffect)(()=>{if(f.data?.destination){let e=f.data.governanceUiEnabled&&!f.data.isOverride&&p===`personal`&&f.data.destination!==`/me`;d.replace(e?`/me`:f.data.destination);return}if(f.isError&&e){d.replace(`/${e.slug}`);return}!u&&!n&&(r?.length??0)===0&&d.replace(`/onboarding/welcome`)},[f.data,f.isError,e,n,r,u,d,p]),(0,l.jsx)(i,{})}export{u as default};
//# sourceMappingURL=pages-CYshkB-O.js.map