1import{u as b,r as c,b3 as v,j as e,B as f,F as S,az as k,S as q}from"./elements-5kxJS_4j.js";import{u as U,x as A,A as C,aa as R,j as m}from"./index-CtCeyryw.js";import"./grids-DGmfp9GI.js";import"./startOfDay-AazlW55I.js";const E=["/community/requests/upload"];function L(){const{t:r}=b(),w=U(),n=A(),[u]=C(),{setEmail:g,setRedirect:p}=R(),a=m(t=>t.user),y=m(t=>t.isLoggedIn),j=m(t=>t.refreshing),N=m(t=>t.logout),[i,l]=c.useState("loading"),d=u.get("userId"),o=u.get("email"),s=u.get("redirect")||"/dashboard",x=c.useMemo(()=>{const t=decodeURIComponent(s);return E.some(I=>t.startsWith(I))},[s]),h=c.useMemo(()=>`/public?${new URLSearchParams({modal:"login",redirect:s}).toString()}`,[s]);return c.useEffect(()=>{if(j||i!=="loading")return;if(!d||!o||!v(o)){l("error");return}const t=parseInt(d,10);if(!Number.isInteger(t)){l("error");return}if(g(o),p(s),!x&&!y&&!a){l("complete"),n(h);return}if(x||(a==null?void 0:a.userId)===t&&(a==null?void 0:a.email)===o){l("complete"),n(s);return}l("loggedInWithDifferentUser")},[y,j,a,o,s,n,g,i,p,d,h,x]),i==="loggedInWithDifferentUser"?e.jsx("div",{className:"w-full h-full bg-zinc-100",children:e.jsxs("div",{className:"max-w-2xl mx-auto py-16 px-4 sm:py-24 sm:px-6 lg:px-8 text-center flex flex-col space-y-4",children:[e.jsxs("h2",{className:"text-2xl text-gray-500 pt-40",children:[r("auth.login.loggedInDifferentUser"),":"]}),e.jsx("label",{className:"text-red-500",children:a==null?void 0:a.email}),e.jsxs("h3",{className:"text-lg text-gray-500 pt-10",children:[r("auth.login.switchUserInstructions"),":"]}),e.jsx("label",{className:"text-green-800",children:o}),e.jsxs("div",{className:"flex flex-row items-center justify-center space-x-6 pt-6",children:[e.jsx(f,{"data-qa":"handoff-switch-account",className:"min-w-[32%] pr-8",onClick:()=>{N({keepAuthFlowState:!0}),w.clear(),n(h)},variant:"primary",startIcon:e.jsx(S,{className:"text-primary-fg",icon:k}),children:r("main.header.links.logOut")}),e.jsx(f,{"data-qa":"handoff-continue-to-dashboard",className:"min-w-[30%]",onClick:()=>n("/dashboard"),variant:"primaryOutline",children:r("auth.login.backToDashboard")})]})]})}):i==="error"?e.jsx("div",{className:"w-full h-full bg-zinc-100",children:e.jsxs("div",{className:"max-w-2xl mx-auto py-16 px-4 sm:py-24 sm:px-6 lg:px-8 text-center flex flex-col space-y-12",children:[e.jsx("h2",{className:"text-2xl text-gray-500 pt-40",children:r("auth.login.somethingWentWrong")}),e.jsx(f,{"data-qa":"handoff-sign-in",onClick:()=>n("/public?modal=login"),className:"w-60 m-auto",variant:"primary",children:r("auth.login.backToLogin")})]})}):e.jsx("div",{className:"w-full h-full py-16 flex items-center justify-center",children:e.jsx(q,{})})}export{L as Component};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.