1import{j as e,cB as xe,al as ve,cC as be,an as ye,am as Ce,cD as je,cE as Se,aU as Pe,cF as ne,ar as ke,cG as te,cH as Te,a as Le,d as Ae,p as Ee,t as C,cI as Y,$ as M,_ as l,cJ as _e,w as u,T as N,B as w,G as Ie,cK as De,S as Me,cL as Z,cM as Ne,cN as Be,ac as We,a4 as ze}from"./index-ZWP6Dbbj.js";import{n as Ge,r as c}from"./vendor-DKtCm5W2.js";import{D as Re}from"./DeedCard-DyaoK884.js";import{u as Fe}from"./usePostcodeGroups-D8S5aoAt.js";import{A as B}from"./Alert-QeeEGDQH.js";import{B as Ue}from"./Badge-BSVpQSIn.js";import"./app-BUG-_G7c.js";import"./dayjs-timezone-iana-plugin-CmU3ItL3.js";import"./postcode-groups-DFi0pRxl.js";import"./getDeedCommitment-CNyv1zLo.js";try{let n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new n.Error().stack;t&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[t]="330eef21-9937-4e7f-a709-94cc8f923a3c",n._sentryDebugIdIdentifier="sentry-dbid-330eef21-9937-4e7f-a709-94cc8f923a3c")}catch{}const Ve=({reveal:n})=>e.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{width:"var(--psi-icon-size)",height:"var(--psi-icon-size)"},children:e.jsx("path",{d:n?"M13.3536 2.35355C13.5488 2.15829 13.5488 1.84171 13.3536 1.64645C13.1583 1.45118 12.8417 1.45118 12.6464 1.64645L10.6828 3.61012C9.70652 3.21671 8.63759 3 7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C0.902945 9.08812 2.02314 10.1861 3.36061 10.9323L1.64645 12.6464C1.45118 12.8417 1.45118 13.1583 1.64645 13.3536C1.84171 13.5488 2.15829 13.5488 2.35355 13.3536L4.31723 11.3899C5.29348 11.7833 6.36241 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C14.0971 5.9119 12.9769 4.81391 11.6394 4.06771L13.3536 2.35355ZM9.90428 4.38861C9.15332 4.1361 8.34759 4 7.5 4C4.80285 4 2.52952 5.37816 1.09622 7.50001C1.87284 8.6497 2.89609 9.58106 4.09974 10.1931L9.90428 4.38861ZM5.09572 10.6114L10.9003 4.80685C12.1039 5.41894 13.1272 6.35031 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11C6.65241 11 5.84668 10.8639 5.09572 10.6114Z":"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})});var q={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const $e={visibilityToggleIcon:Ve},Je=ke((n,{size:t})=>({root:{"--psi-icon-size":te(t,"psi-icon-size"),"--psi-button-size":te(t,"psi-button-size")}})),W=xe((n,t)=>{const p=ve("PasswordInput",$e,n),{classNames:j,className:S,style:a,styles:P,unstyled:g,vars:m,required:f,error:s,leftSection:k,disabled:d,id:z,variant:T,inputContainer:x,description:L,label:A,size:E,errorProps:o,descriptionProps:_,labelProps:v,withAsterisk:G,inputWrapperOrder:R,wrapperProps:F,radius:b,rightSection:U,rightSectionWidth:I,rightSectionPointerEvents:i,leftSectionWidth:ae,visible:se,defaultVisible:oe,onVisibilityChange:ie,visibilityToggleIcon:re,visibilityToggleButtonProps:h,rightSectionProps:le,leftSectionProps:ce,leftSectionPointerEvents:de,withErrorStyles:ue,mod:pe,attributes:V,...ge}
1=p,y=be(z),[D,me]=ye({value:se,defaultValue:oe,finalValue:!1,onChange:ie}),$=()=>me(!D),J=Ce({name:"PasswordInput",classes:q,props:p,className:S,style:a,classNames:j,styles:P,unstyled:g,attributes:V,vars:m,varsResolver:Je}),{resolvedClassNames:H,resolvedStyles:K}=je({classNames:j,styles:P,props:p}),{styleProps:he,rest:X}=Se(ge),O=o?.id||`${y}-error`,Q=_?.id||`${y}-description`,ee=`${!!s&&typeof s!="boolean"?O:""} ${!!L?Q:""}`,we=ee.trim().length>0?ee.trim():void 0,fe=e.jsx(Pe,{...J("visibilityToggle"),disabled:d,radius:b,"aria-hidden":!h,"aria-pressed":D,tabIndex:-1,...h,variant:h?.variant??"subtle",color:"gray",unstyled:g,onTouchEnd:r=>{r.preventDefault(),h?.onTouchEnd?.(r),$()},onMouseDown:r=>{r.preventDefault(),h?.onMouseDown?.(r),$()},onKeyDown:r=>{h?.onKeyDown?.(r),r.key===" "&&(r.preventDefault(),$())},children:e.jsx(re,{reveal:D})});return e.jsx(ne.Wrapper,{required:f,id:y,label:A,error:s,description:L,size:E,classNames:H,styles:K,__staticSelector:"PasswordInput",unstyled:g,withAsterisk:G,inputWrapperOrder:R,inputContainer:x,variant:T,labelProps:{...v,htmlFor:y},descriptionProps:{..._,id:Q},errorProps:{...o,id:O},mod:pe,attributes:V,...J("root"),...he,...F,children:e.jsx(ne,{component:"div",error:s,leftSection:k,size:E,classNames:{...H,input:Ge(q.input,H.input)},styles:K,radius:b,disabled:d,__staticSelector:"PasswordInput",rightSectionWidth:I,rightSection:U??fe,variant:T,unstyled:g,leftSectionWidth:ae,rightSectionPointerEvents:i||"all",rightSectionProps:le,leftSectionProps:ce,leftSectionPointerEvents:de,withAria:!1,withErrorStyles:ue,attributes:V,children:e.jsx("input",{required:f,"data-invalid":!!s||void 0,"data-with-left-section":!!k||void 0,...J("innerInput"),disabled:d,id:y,ref:t,...X,"aria-describedby":we,autoComplete:X.autoComplete||"off",type:D?"text":"password"})})})});W.classes={...Te.classes,...q};W.displayName="@mantine/core/PasswordInput";const He={en:"Application confirmed",nl:"Aanmelding bevestigd"},Ye={en:"Applied %{date}",nl:"Aangemeld op %{date}"},Ze={en:"Confirmation failed",nl:"Bevestiging mislukt"},qe={en:"Something went wrong while confirming your application. Please try again later.",nl:"Er is iets misgegaan tijdens het bevestigen van je aanmelding. Probeer het later opnieuw."},Ke={en:"Confirm password",nl:"Wachtwoord bevestigen"},Xe={en:"Your application has been confirmed.",nl:"Je aanmelding is bevestigd."},Oe={en:"Confirming your application...",nl:"Je aanmelding wordt bevestigd..."},Qe={en:"Create account",nl:"Account aanmaken"},en={en:"Email",nl:"E-mail"},nn={en:"First name",nl:"Voornaam"},tn={en:"Go to login",nl:"Ga naar de inlogpagina"},an={en:"Link expired or invalid",nl:"Link verlopen of ongeldig"},sn={en:"This management link is no longer valid. It may have expired or been revoked after account creation.",nl:"Deze link is niet langer geldig. Deze is mogelijk verlopen of ingetrokken na het aanmaken van het account."},on={en:"Last name",nl:"Achternaam"},rn={en:"Could not load your application. Please try again.",nl:"Je aanmelding kan niet worden geladen. Probeer het opnieuw."},ln={en:"Your application",nl:"Je aanmelding"},cn={en:"Password",nl:"Wachtwoord"},dn={en:"Passwords do not match",nl:"Wachtwoorden komen niet overeen"},un={en:"Password must be at least 8 characters",nl:"Het wachtwoord moet minimaal 8 tekens lang zijn."},pn={en:"Status",nl:"Status"},gn={en:"Create an account to manage your applications, receive messages, and discover new opportunities.",nl:"Maak een account aan om je aanmeldingen te beheren, berichten te ontvangen en nieuwe vacatures en activiteiten te ontdekken."},mn={en:"Set a password to create your account",nl:"Stel een wachtwoord in om je account aan te maken"},hn={en:"Create account",nl:"Account aanmaken"},wn={en:"Account created! You can now log in.",nl:"Account aangemaakt! Je kunt nu inloggen."},fn={en:"Want to create an account?",nl:"Wil je een account aanmaken?"},xn={en:"Withdraw application",nl:"Aanmelding annuleren"},vn={en:"Are you sure you want to withdraw your application? This cannot be undone.",nl:"Weet je zeker dat je je aanmelding wilt intrekken? Dit kan niet ongedaan worden gemaakt."},bn={en:"Keep application",nl:"Aanmelding behouden"},yn={en:"Yes, withdraw",nl:"Ja, intrekken"},Cn={applicationConfirmed:He,appliedAt:Ye,confirmError:Ze,confirmErrorBody:qe,confirmPasswordLabel:Ke,confirmedBody:Xe,confirming:Oe,createAccount:Qe,emailLabel:en,firstNameLabel:nn,goToLogin:tn,invalidToken:an,invalidTokenBody:sn,lastNameLabel:on,loadError:rn,pageTitle:ln,passwordLabel:cn,passwordMismatch:dn,passwordTooShort:un,statusLabel:pn,upgradeDescription:gn,upgradeHeading:mn,upgradeSubmit:hn,upgradeSuccess:wn,upgradeTitle:fn,withdrawApplication:xn,withdrawConfirm:vn,withdrawNo:bn,withdrawYes:yn},Nn=()=>{const n=Le(Cn),{token:t}=Ae(),p=c.useRef(!1),j=Fe();Ee(n("pageTitle"));const S=C.useUtils(),{data:a,isLoading:P,isError:g}=C.guest.manage.useQuery({token:t},{enabled:!!t}),m=C.guest.confirm.useMutation({onSuccess:()=>
1S.guest.manage.invalidate({token:t})}),f=C.guest.withdraw.useMutation({onSuccess:()=>S.guest.manage.invalidate({token:t})}),s=C.guest.upgrade.useMutation();c.useEffect(()=>{!t||a?.status!==Y.draft||p.current||(p.current=!0,m.mutate({token:t}))},[a?.status,t]);const[k,d]=c.useState(!1),[z,T]=c.useState(!1),[x,L]=c.useState(""),[A,E]=c.useState(""),[o,_]=c.useState(""),[v,G]=c.useState(""),R=async()=>{await f.mutateAsync({token:t}),d(!1)},F=async()=>{await s.mutateAsync({token:t,password:o,first_names:x,last_name:A||void 0})},b=o===v,U=!x.trim()||o.length<8||!b||s.isPending,I=a?.status===Y.draft&&m.isPending;return P||I?e.jsx(M,{maw:480,mx:"auto",p:"xl",children:e.jsxs(l,{align:"center",children:[e.jsx(_e,{}),I&&e.jsx(u,{children:n("confirming")})]})}):m.isError?e.jsx(M,{maw:480,mx:"auto",p:"xl",children:e.jsx(l,{children:e.jsx(B,{color:"red",title:n("confirmError"),children:n("confirmErrorBody")})})}):g||!a?e.jsx(M,{maw:480,mx:"auto",p:"xl",children:e.jsxs(l,{children:[e.jsx(N,{order:2,children:n("invalidToken")}),e.jsx(u,{c:"dimmed",children:n("invalidTokenBody")})]})}):e.jsx(M,{maw:480,mx:"auto",p:"xl",children:e.jsxs(l,{children:[m.isSuccess&&e.jsx(B,{color:"green",title:n("applicationConfirmed"),children:n("confirmedBody")}),e.jsx(N,{order:2,children:n("pageTitle")}),e.jsxs(l,{gap:"xs",children:[e.jsx(Ue,{color:a.status===Y.pending?"blue":"gray",size:"lg",w:"fit-content",children:n.g(`application_${a.status}`)??a.status}),e.jsx(u,{c:"dimmed",fz:"sm",children:n("appliedAt",{date:new Date(a.applied_at).toLocaleDateString()})}),a.can_withdraw&&e.jsx(e.Fragment,{children:k?e.jsx(B,{color:"red",children:e.jsxs(l,{gap:"xs",children:[e.jsx(u,{children:n("withdrawConfirm")}),e.jsxs(Ie,{gap:"xs",children:[e.jsx(w,{color:"red",loading:f.isPending,onClick:R,children:n("withdrawYes")}),e.jsx(w,{variant:"default",onClick:()=>d(!1),children:n("withdrawNo")})]})]})}):e.jsx(w,{color:"red",variant:"outline",onClick:()=>d(!0),children:n("withdrawApplication")})})]}),e.jsx(Re,{deed:a.deed,postcodeGroups:j,openInNewTab:!0}),a.can_upgrade&&e.jsxs(e.Fragment,{children:[e.jsx(De,{}),e.jsxs(l,{gap:"xs",children:[e.jsx(N,{order:3,children:n("upgradeTitle")}),e.jsx(u,{children:n("upgradeDescription")}),z?e.jsxs(l,{gap:"sm",children:[e.jsx(N,{order:4,children:n("upgradeHeading")}),e.jsxs(Me,{cols:{base:1,xs:2},children:[e.jsx(Z,{label:n("firstNameLabel"),value:x,onChange:i=>L(i.currentTarget.value),maxLength:Ne,required:!0,autoComplete:"given-name"}),e.jsx(Z,{label:n("lastNameLabel"),value:A,onChange:i=>E(i.currentTarget.value),maxLength:Be,autoComplete:"family-name"})]}),e.jsx(Z,{label:n("emailLabel"),value:a.email,disabled:!0}),e.jsx(W,{label:n("passwordLabel"),value:o,required:!0,onChange:i=>_(i.currentTarget.value),error:o.length>0&&o.length<8?n("passwordTooShort"):void 0}),e.jsx(W,{label:n("confirmPasswordLabel"),required:!0,value:v,onChange:i=>G(i.currentTarget.value),error:v.length>0&&!b?n("passwordMismatch"):void 0}),s.isSuccess?e.jsx(B,{color:"green",children:e.jsxs(l,{gap:"xs",children:[e.jsx(u,{children:n("upgradeSuccess")}),e.jsx(w,{component:"a",href:`${We("login")}?${new URLSearchParams({[ze.email]:a.email})}`,children:n("goToLogin")})]})}):e.jsx(w,{disabled:U,loading:s.isPending,onClick:F,children:n("upgradeSubmit")}),s.isError&&e.jsx(u,{c:"red",children:n("loadError")})]}):e.jsx(w,{onClick:()=>T(!0),children:n("createAccount")})]})]})]})})};export{Nn as default}; 2//# sourceMappingURL=index-Ct12i1HM.js.map
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.