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