import{j as a}from"./vendor-react-wBh_31cN.js";import{u as o}from"./vendor-redux-CJZrIb6x.js";import{aq as h,G as x}from"./index-dNe6i2rS.js";import{I as n}from"./input-DFI7JniT.js";import{L as i}from"./label-gPWmc6ow.js";import{C as p}from"./combobox-QqI9aNup.js";import{C as e,a as f,b,c as C}from"./card-BeQtvmcJ.js";const F=({needConsent:m,remoteUser:l,chosenEmail:d,setChosenEmail:j,handleSubmit:t,onCancel:u})=>{const c=o(s=>s.loading.effects.auth.oauthLogin);return a.jsxs(e,{className:"w-[466px] mb-5",children:[a.jsx(f,{children:a.jsx(b,{children:"Complete registration"})}),a.jsx(C,{children:c?a.jsx(h,{}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex justify-between mb-5 gap-5",children:[a.jsxs("div",{className:"w-[203px]",children:[a.jsx(i,{className:"mb-1.5",children:"First name"}),a.jsx(n,{name:"firstName",disabled:!0,value:l==null?void 0:l.givenName})]}),a.jsxs("div",{className:"w-[203px]",children:[a.jsx(i,{className:"mb-1.5",children:"Last name"}),a.jsx(n,{name:"lastName",disabled:!0,value:l==null?void 0:l.surname})]})]}),l!=null&&l.email&&(l==null?void 0:l.email.length)>1?a.jsxs("div",{className:"w-full",children:[a.jsx(i,{className:"mb-1.5",children:"Choose an email"}),a.jsx(p,{options:((l==null?void 0:l.email)||[]).map(s=>({value:s,label:s})),value:d,onChange:s=>{s&&j(s)},placeholder:"No email found"})]}):a.jsxs("div",{className:"w-full",children:[a.jsx(i,{className:"mb-1.5",children:"Email"}),a.jsx(n,{name:"email",value:d||"No email found",disabled:!0})]}),a.jsxs("div",{className:"flex justify-end mt-5 gap-5",children:[m&&a.jsx(x,{variant:"secondary",type:"button",onClick:u,children:"Cancel"}),a.jsx(x,{type:"button",loading:c,onClick:t,children:"Register"})]})]})})]})};export{F as C};
