import{bw as g,j as n,B as l,cJ as m,Q as f,e as c,af as b,ag as C,m as p,aG as e,s as u,cK as w,aL as y,L as v,aM as o,bm as r}from"./index-dP1W1_bd.js";const N=({error:i,register:a,login:t,loginHelp:x,children:d})=>{const s=g();return n.jsxs(l,{mt:"50px",flexDirection:"column",alignItems:"center",autoComplete:"on",children:[n.jsx(m,{}),n.jsx(f,{mb:"60px",mt:"15px",fontFamily:"Inter",fontSize:"18px",primary:!0,children:"Hopsworks"}),i&&n.jsx(c,{width:"466px",mb:"20px",children:n.jsx(b,{type:C.error,content:i.message})}),d,a&&n.jsx(c,{sx:{h4:{fontSize:"12px"}},children:n.jsx(p,{mb:"20px",width:"466px",actions:n.jsx(e,{intent:"secondary",onClick:()=>s(u.auth.register),children:"Register"}),title:"Don’t have an account?"})}),t&&n.jsx(c,{sx:{h4:{fontSize:"12px !important"}},children:n.jsx(p,{mb:"20px",width:"466px",actions:n.jsx(e,{intent:"secondary",onClick:()=>s(u.auth.login),children:"Login"}),title:"Already have an account?"})}),x&&n.jsx(l,{as:"div",mb:"60px",children:n.jsx(w,{})})]})},S=({needConsent:i,remoteUser:a,chosenEmail:t,setChosenEmail:x,handleSubmit:d,onCancel:s})=>{const h=y(j=>j.loading.effects.auth.oauthLogin);return n.jsx(p,{width:"466px",mb:"20px",title:"Complete registration",children:h?n.jsx(v,{}):n.jsxs(n.Fragment,{children:[n.jsxs(l,{flexDirection:"row",justifyContent:"space-between",mb:"20px",children:[n.jsx(o,{width:"203px",label:"First name",name:"firstName",disabled:!0,value:a==null?void 0:a.givenName}),n.jsx(o,{width:"203px",label:"Last name",name:"lastName",disabled:!0,value:a==null?void 0:a.surname})]}),a!=null&&a.email&&(a==null?void 0:a.email.length)>1?n.jsx(r,{width:"100%",label:"Choose an email",noDataMessage:"No email found",options:(a==null?void 0:a.email)||[],value:t,onChange:x}):n.jsx(o,{width:"100%",label:"Email",name:"email",value:t||"No email found",disabled:!0}),n.jsxs(l,{justifyContent:"flex-end",mt:"20px",children:[i&&n.jsx(e,{mr:"20px",intent:"secondary",type:"button",alignSelf:"flex-end",onClick:s,children:"Cancel"}),n.jsx(e,{intent:"primary",type:"button",alignSelf:"flex-end",isLoading:h,onClick:d,children:"Register"})]})]})})};export{S as C,N as L};
