PageSourceSearch

https://crow.nl/_next/static/chunks/pages/registreren-1797fcc877da175d.js

js crow.nl collected 2026-10-02 02:47:00 UTC 13,876 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5856],{40473:function(e,a,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/registreren",function(){return s(96827)}])},96827:function(e,a,s){"use strict";s.r(a),s.d(a,{__N_SSP:function(){return S},default:function(){return k}});var l=s(85893),n=s(27361),r=s.n(n),i=s(67294),t=s(36093),o=s(86010),d=s(25675),c=s.n(d);let m=e=>{let{dataTestId:a,className:s,children:n,navigationProps:r,footerProps:i,seoProps:d,preview:m=!1,previewRedirectUrl:u="/"}=e;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(t.eF,{seoProps:d}),m&&(0,l.jsx)(t.W$,{previewRedirectUrl:u}),r&&(0,l.jsx)(t.h4,{...r}),(0,l.jsxs)("div",{className:(0,o.Z)("flex-grow px-4 sm:px-6",s),children:[(0,l.jsx)(c(),{priority:!0,src:"/assets/images/hero.jpg",width:1278,height:1112,alt:"infrastructuur, duurzaamheid",className:"fixed top-0 left-0 h-full min-h-[100vh] w-full",style:{objectFit:"cover",objectPosition:"50% 50%"}}),(0,l.jsx)("main",{className:"grid grid-cols-12 md:container lg:pt-0","data-testid":null==a?void 0:a.concat("-main"),children:n})]}),i&&(0,l.jsx)(t.$_,{...i,dataTestId:"footer"})]})};var u=s(87536),p=s(54774),h=s(88087),x=s(4045),g=s(92923),v=s(9724);let b={[v.tV.Taken]:h.R.email.taken,[v.tV.Error]:h.R.email.error,[v.tV.TypeMismatchP]:h.R.email.mismatchP,[v.tV.TypeMismatchC]:h.R.email.mismatchC};var j=s(50259),N=s(86501),f=s(93747),y=s(25468),w=s(35531),C=s(92622);let T=e=>{var a,s,n,d,c,T,S,k,R,q;let{dataTestId:P="user-registration",..._}=e,[I,E]=i.useState(!1),[Z,z]=i.useState(!1),[M,O]=i.useState(v.K7.C),[F,V]=i.useState("female"),[K,L]=i.useState(!1),{siteSettings:A}=_,B=A[0],{checkEmail:U,createPrivateUser:Y,searchCompanyByAddress:X,createBusinessUser:$}=(0,g.If)(),{executeRecaptcha:J}=(0,j.xX)(),{register:W,unregister:D,handleSubmit:G,formState:H,setError:Q,setValue:ee,watch:ea,getValues:es,trigger:el}=(0,u.cI)({mode:"onBlur",reValidateMode:"onSubmit"}),en=e=>N.ZP.error(e),er=e=>({}),{errors:ei,isValid:et,isSubmitting:eo}=H,ed=async e=>await Y.mutateAsync({input:e},{onSuccess:e=>{var a;let{privateUserCreate:s}=e,l=null!==(a=null==s?void 0:s.errors)&&void 0!==a?a:[];l.length>0?l.forEach((e,a)=>x.Jd.includes(e.field)?en(e.messages[0]):x.m7.includes(e.field)?er(e):Q(e.field,{type:"unavailable",message:e.messages[0]},{shouldFocus:0===a})):(z(!0),(0,w.X2)({action:"sign_up"}),(0,C.UU)(),window.scrollTo(0,0))}}),ec=async e=>await $.mutateAsync({input:e},{onSuccess:e=>{var a;let{businessUserCreate:s}=e,l=null!==(a=null==s?void 0:s.errors)&&void 0!==a?a:[];l.length>0?l.forEach((e,a)=>x.Jd.includes(e.field)?en(e.messages[0]):Q(e.field,{type:"unavailable",message:e.messages[0]},{shouldFocus:0===a})):(z(!0),(0,C.UU)(),(0,w.X2)({action:"sign_up"}),window.scrollTo(0,0))}}),em=async e=>J?await J("enquiryFormSubmit").then(async a=>{M===v.K7.C?await ec({...e,captchaToken:a}):await ed({...e,captchaToken:a})}):console.log("Execute recaptcha not yet available"),eu=async e=>{var a;L(!1),E(!0);let s=await U({email:e,accountType:M}).finally(()=>{E(!1)}),{checkEmail:l}=s,n=null!==(a=null==l?void 0:l.status)&&void 0!==a?a:v.tV.Error;if(!b.hasOwnProperty(n))return L(!0),!0;let r=b[n];Q("email",{type:"unavailable",message:r},{shouldFocus:!0})},[ep,eh]=i.useState(!1),[ex,eg]=i.useState([]),[ev,eb]=i.useState(String),[ej,eN]=i.useState(!1),{register:ef,handleSubmit:ey,formState:ew,setError:eC,reset:eT}=(0,u.cI)({mode:"onBlur",reValidateMode:"onBlur"}),{errors:eS,isValid:ek,isSubmitting:eR}=ew,eq=eR||eo,eP=async e=>(eh(!1),eb(""),eg([]),await X({postCode:null==e?void 0:e.postCode,houseNumber:e.houseNumber}).then(e=>{var a;let s=null!==(a=null==e?void 0:e.searchCompany)&&void 0!==a?a:[];if(s.length<1)eh(!0),en(h.R.company.notFound);else if(1===s.length){eN(!0),eg(s);let e=s[0];eb(e.relationId),ee("relationIdCompany",e.relationId)}else eN(!0),eg(s)}).catch(e=>(0,f.UN)(e)));return(0,l.jsx)(m,{..._,dataTestId:P,children:(0,l.jsx)("div",{"data-testid":P,className:"z-[10] col-span-12 my-20 rounded-lg bg-white px-4 pt-10 pb-12 sm:px-6 md:px-8 lg:col-span-10 lg:col-start-2 lg:pl-16 lg:pr-20",children:Z?(0,l.jsx)(t.Mk,{onLogInCB:()=>(0,y.jc)({})}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(t.ZT,{variant:"h1",dataTestId:null==P?void 0:P.concat("-form-heading"),className:"mb-6",children:"Account aanmaken"}),(0,l.jsxs)("div",{className:"relative",children:[eq&&(0,l.jsx)("div",{className:"sticky top-0 right-0 z-[99] col-span-12 flex h-0 w-full justify-center md:absolute md:h-full md:items-center",children:(0,l.jsx)(t.qZ,{name:"Loading",className:"mt-20 min-h-[40px] min-w-[40px] fill-primary md:mt-0",size:40})}),(0,l.jsxs)("div",{className:(0,o.Z)("space-y-6",{"opacity-50":eq}),children:[(0,l.jsx)("div",{className:"rounded-lg border border-neutrals-300 px-4 py-6 md:px-8",children:(0,l.jsxs)(t.Ee,{id:"typeAccount",label:"Soort account",renderLabel:(e,a)=>(0,l.jsx)(t.ZT,{as:"h2",variant:"h4",className:"mb-2",...a,children:e}),horizontal:!0,children:[(0,l.jsx)(t.Y8,{label:"Zakelijk",name:"zakelijk",id:"acType-zakelijk",value:v.K7.C,checked:M===v.K7.C,onChange:()=>O(v.K7.C)}),(0,l.jsx)(t.Y8,{label:"Particulier",name:"particulier",id:"acType-particulier",value:v.K7.P,checked:M===v.K7.P,onChange:()=>{eT(),D("relationIdCompany"),eg([]),eb(""),eN(!1),O(v.K7.P)}})]})}),M===v.K7.C&&(0,l.jsxs)("div",{className:"rounded-lg border border-neutrals-300 px-4 py-6 md:px-8",children:[(0,l.jsx)(t.ZT,{as:"h2",variant:"h4",className:"mb-4",children:"Bedrijfsgegevens"}),(0,l.jsx)(t.ZT,{variant:"p",customColor:"text-arsenic-400",className:"!mt-4",children:"Zoek naar een bestaand bedrijf binnen onze administratie. Voer hieronder de postcode en het huisnummer behorend bij jouw bedrijfsnaam in."}),(0,l.jsxs)("form",{onSubmit:ey(eP),"data-testid":null==P?void 0:P.concat("-form-business-search"),noValidate:!0,children:[(0,l.jsxs)("div",{className:"mt-4 grid grid-cols-2 gap-6",children:[(0,l.jsx)(t.oi,{...ef("postCode",{required:h.R.required,setValueAs:p.w,pattern:{value:p.m.dutchPostalCode,message:h.R.postalCode.invalidPattern}}),id:"companyNameSearch-postcode",type:"text",label:"Postcode",className:"col-span-2 lg:col-span-1",onFocus:()=>{eN(!1)},error:!!r()(eS,"postCode"),success:ej,helperText:null===(a=r()(eS,"postCode"))||void 0===a?void 0:a.message}),(0,l.jsx)(t.oi,{...ef("houseNumber",{required:h.R.required,validate:{atLeastOneNumber:e=>p.m.containAtLeastOneNumber.test(e)||h.R.atLeastOneNumber}}),id:"companyNameSearch-houseNumber",type:"text",label:"Huisnummer",className:"col-span-2 lg:col-span-1",error:!!r()(eS,"houseNumber"),success:ej,onFocus:()=>{eN(!1)},helperText:null===(s=r()(eS,"houseNumber"))||void 0===s?void 0:s.message})]}),ep&&(0,l.jsxs)(t.ZT,{variant:"p",customColor:"text-neutrals-500",className:"!my-8",children:["Geen bedrijf gevonden? Controleer gegevens, zoek opnieuw of neem contact op met de klantenservice"," ",(0,l.jsx)("a",{className:"underline",href:"tel:".concat(null!==(n=null==B?void 0:B.contactPhoneNumber)&&void 0!==n?n:""),children:null!==(d=null==B?void 0:B.contactPhoneNumber)&&void 0!==d?d:""}),","," ",(0,l.jsx)("a",{className:"underline",href:"mailto:".concat(null!==(c=null==B?void 0:B.contactEmail)&&void 0!==c?c:""),children:null!==(T=null==B?void 0:B.contactEmail)&&void 0!==T?T:""}),"."]}),(0,l.jsx)("div",{className:"col-span-2 mt-4 lg:col-span-1",children:(0,l.jsx)(t.zx,{type:"submit",variant:"primary",disabled:!ek,children:"Bedrijf zoeken"})}),ex.length>0&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("hr",{className:"border-top my-8 border-neutrals-300"}),(0,l.jsxs)(t.ZT,{variant:"p",customColor:"text-arsenic-400",className:"!mt-4",children:["De door u ingevoerde bedrijfsgegevens (postcode en huisnummer) zijn reeds bekend in ons systeem.",ex.length>1&&" Kies de gewenste organisatie."]}),(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsx)(t.Ee,{id:"companyName",label:"noop",renderLabel:()=>(0,l.jsx)(l.Fragment,{}),children:ex.map(e=>(0,l.jsx)(t.Y8,{label:e.name,name:"companyName",id:"company-option-".concat(e.relationId),value:e.relationId,checked:ev===e.relationId,onChange:async()=>{eb(e.relationId),ee("relationIdCompany",e.relationId),await el("relationIdCompany")}},e.relationId))})}),(0,l.jsxs)(t.ZT,{variant:"p",customColor:"text-neutrals-500",className:"!mt-8",children:["Staat jouw bedrijf er niet tussen? Neem contact op met de klantenservice."," ",(0,l.jsx)("a",{className:"underline",href:"tel:".concat(null!==(S=null==B?void 0:B.contactPhoneNumber)&&void 0!==S?S:""),children:null!==(k=null==B?void 0:B.contactPhoneNumber)&&void 0!==k?k:""}),","," ",(0,l.jsx)("a",{className:"underline",href:"mailto:".concat(null!==(R=null==B?void 0:B.contactEmail)&&void 0!==R?R:""),children:null!==(q=null==B?void 0:B.contactEmail)&&void 0!==q?q:""}),"."]})]})]})]}),(0,l.jsxs)("form",{onSubmit:G(em),"data-testid":null==P?void 0:P.concat("-form"),noValidate:!0,className:"space-y-6",name:"sign_up",id:"sign_up_form",children:[M===v.K7.C&&(0,l.jsx)("input",{...W("relationIdCompany",{required:h.R.required}),id:"relationIdCompany",type:"hidden"}),(0,l.jsxs)("div",{className:"rounded-lg border border-neutrals-300 px-4 py-6 md:px-8",children:[(0,l.jsx)(t.ZT,{as:"h2",variant:"h4",className:"mb-4",children:"Contactgegevens"}),(0,l.jsxs)(t.Ee,{id:"aanhef",label:"Aanhef",renderLabel:(e,a)=>(0,l.jsx)(t.ZT,{variant:"p",className:"mb-2 !mt-0",...a,children:e}),horizontal:!0,className:"mb-4",children:[(0,l.jsx)(t.Y8,{...W("gender"),label:"Mevrouw",value:"female",id:"gender-female",checked:"female"===F,onChange:()=>V("female")}),(0,l.jsx)(t.Y8,{...W("gender"),label:"Meneer",value:"male",id:"gender-male",checked:"male"===F,onChange:()=>V("male")}),(0,l.jsx)(t.Y8,{...W("gender"),label:"Zeg ik liever niet",value:"not_applicable",id:"gender-not_applicable",checked:"not_applicable"===F,onChange:()=>V("not_applicable")})]}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,l.jsx)(t.oi,{...W("initials",{required:h.R.required,validate:{onlySpaces:e=>p.m.containOnlySpaces.test(e)||h.R.required}}),id:"firstNinitialsame",type:"text",label:"Initialen",className:"col-span-2 lg:col-span-1",error:!!ei.initials,helperText:ei.initials&&ei.initials.message}),(0,l.jsx)(t.oi,{...W("firstName",{required:h.R.required,validate:{onlySpaces:e=>p.m.containOnlySpaces.test(e)||h.R.required}}),id:"firstName",type:"text",label:"Voornaam",className:"col-span-2 lg:col-span-1",error:!!ei.firstName,helperText:ei.firstName&&ei.firstName.message}),(0,l.jsx)(t.oi,{...W("infix",{required:!1}),id:"infix",type:"text",label:"Tussenvoegsel",className:"col-span-2 lg:col-span-1",error:!!ei.infix,helperText:ei.infix?ei.infix.message:"(Optioneel)"}),(0,l.jsx)(t.oi,{...W("lastName",{required:h.R.required,validate:{onlySpaces:e=>p.m.containOnlySpaces.test(e)||h.R.required}}),id:"lastName",type:"text",label:"Achternaam",className:"col-span-2 lg:col-span-1",error:!!ei.lastName,helperText:ei.lastName&&ei.lastName.message}),(0,l.jsx)(t.oi,{...W("email",{required:h.R.required,pattern:{value:p.m.email,message:h.R.email.invalidPattern},validate:{onlySpaces:e=>p.m.containOnlySpaces.test(e)||h.R.required}}),onBlur:async()=>{let e=await el("email");if(e){let e=es("email");return await eu(e)}},id:"email",type:"email",label:"E-mailadres",className:"col-span-2 lg:col-span-1",error:!!ei.email,success:!ei.email&&K&&!I,helperText:ei.email&&ei.email.message,loading:!!I}),(0,l.jsx)(t.oi,{...W("phoneNumber",{required:!1,pattern:{value:p.m.dutchPhone,message:h.R.phone.invalidPattern}}),id:"phoneNumber",type:"text",label:"Telefoonnummer werk",className:"col-span-2 lg:col-span-1",error:!!ei.phoneNumber,helperText:ei.p
1honeNumber?ei.phoneNumber.message:"(Optioneel)"}),(0,l.jsx)(t.oi,{...W("phoneNumberMobile",{required:!1,pattern:{value:p.m.dutchPhone,message:h.R.phone.invalidPattern}}),id:"phoneNumberMobile",type:"text",label:"Telefoonnummer mobiel",className:"col-span-2 lg:col-span-1",error:!!ei.phoneNumberMobile,helperText:ei.phoneNumberMobile?ei.phoneNumberMobile.message:"(Optioneel)"})]})]}),(0,l.jsxs)("div",{className:"rounded-lg border border-neutrals-300 px-4 py-6 md:px-8",children:[(0,l.jsx)(t.ZT,{as:"h2",variant:"h4",children:"Kies uw wachtwoord"}),(0,l.jsxs)("div",{className:"mt-4 grid grid-cols-2 gap-6",children:[(0,l.jsx)(t.oi,{...W("password",{required:h.R.required,minLength:{value:8,message:h.R.password.minLength},validate:{onlyNumber:e=>!/^\d+$/.test(e)||h.R.password.onlyNumbers,onlySpaces:e=>p.m.containOnlySpaces.test(e)||h.R.required}}),id:"password",type:"password",label:"Wachtwoord",className:"col-span-2 lg:col-span-1",error:!!ei.password,helperText:ei.password&&ei.password.message}),(0,l.jsx)(t.oi,{...W("passwordConfirm",{deps:["password"],required:h.R.required,validate:{doesNotMatch:e=>ea("password")===e||h.R.password.mismatch}}),id:"passwordConfirm",type:"password",label:"Bevestig wachtwoord",className:"col-span-2 lg:col-span-1",error:!!ei.passwordConfirm,helperText:ei.passwordConfirm&&ei.passwordConfirm.message}),(0,l.jsxs)("div",{className:"col-span-2",children:[(0,l.jsx)(t.ZT,{variant:"tiny",className:"mt-2",customColor:"text-arsenic-400",children:"Uw wachtwoord:"}),(0,l.jsxs)("ul",{className:"ml-4 list-disc text-sm text-arsenic-400",children:[(0,l.jsx)("li",{children:"Mag niet te veel op uw andere persoonlijke gegevens lijken."}),(0,l.jsx)("li",{children:"Moet minstens 8 tekens lang zijn."}),(0,l.jsx)("li",{children:"Mag geen veelgebruikt wachtwoord zijn."}),(0,l.jsx)("li",{children:"Mag niet volledig uit cijfers bestaan."})]})]})]})]}),(0,l.jsx)(t.zx,{type:"submit",variant:"primary",className:"mx-auto !mt-[46px]",disabled:!et,children:"Registreren"}),(0,l.jsxs)(t.ZT,{variant:"p",customColor:"text-arsenic-400 text-center flex justify-center",children:["Al een account?",(0,l.jsx)(t.zx,{variant:"text",className:"ml-1",onPress:()=>(0,y.jc)({}),children:"Inloggen"})]})]})]})]})]})})})};var S=!0,k=T}},function(e){e.O(0,[9774,2888,179],function(){return e(e.s=40473)}),_N_E=e.O()}]);

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.