1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5889],{4711:function(e,i,d){(window.__NEXT_P=window.__NEXT_P||[]).push(["/journey/[plan-name]/personal-details",function(){return d(2281)}])},9533:function(e,i,d){"use strict";var n=d(5893),r=d(7294),l=d(1604),a=d(2088),t=d(6905),o=d(1342),s=d(7319),u=d(7536);i.Z=e=>{let{max:i=11,min:d=11,id:v,label:c,disabled:p,placeholder:y,initialValue:h,onValueUpdate:f,initialError:m,helpMessage:x}=e,[I,q]=(0,r.useState)(""),[b,g]=(0,r.useState)(!1),[j,w]=(0,r.useState)(m||null),{clearErrors:Z}=(0,u.Gc)();(0,r.useEffect)(()=>{void 0!==m&&w(m)},[m]),(0,r.useEffect)(()=>{h&&q(h)},[h]),(0,r.useEffect)(()=>{void 0!==f&&f(I)},[I]);let N=l.z.string().max(i,{message:"Phone number must be 11 digits"}).regex(/^$|^[0-9]+$/,{message:"Only numbers allowed"}),O=l.z.string().min(d,{message:"Phone number must be 11 digits"}).regex(/^$|^[0-9]+$/,{message:"Only numbers allowed"}),P=(e,i)=>{let d=e.safeParse(i);d.success?(e===O&&g(!0),w(null),q(d.data)):(g(!1),w(d.error.issues[0].message||"Error"))};return(0,n.jsxs)("div",{className:"flex flex-col relative group w-full",children:[c&&(0,n.jsx)(s.Z,{label:c,htmlFor:v||"input-phonefield"}),(0,n.jsx)("input",{id:v||"input-phonefield",value:I,onBlur:()=>{""!==I&&P(O,I)},onChange:e=>{P(N,e.target.value),m&&Z(v)},onKeyDown:e=>{"Enter"===e.key&&P(O,I)},maxLength:i,autoComplete:"new-password",type:"text",pattern:"\\d*",placeholder:y,disabled:p,className:"min-h-[50px] xl:min-h-[60px] px-[20px] xl:px-[25px] focus:outline-none\n ".concat((0,o.O)({error:j,disabled:p,validated:b}))}),x&&(0,n.jsx)(t.Z,{helpMessage:x}),j&&(0,n.jsx)(a.Z,{error:j})]})}},2281:function(e,i,d){"use strict";d.r(i);var n=d(5893),r=d(7294),l=d(1163),a=d(3912),t=d(7536),o=d(572),s=d(3580),u=d(3838),v=d(1111),c=d(8190),p=d(9865),y=d(2248),h=d(8361),f=d(9533),m=d(6323),x=d(8666),I=d(9646),q=d(2481),b=d(2183),g=d(9147),j=d(8024);i.default=()=>{let e=(0,l.useRouter)(),i=e.query["plan-name"],{control:d,watch:w,setValue:Z,getValues:N,setError:O}=(0,t.Gc)(),{setProgressStep:P}=(0,x.bN)(),[E,S]=(0,r.useState)("Monthly"===N("enquiry.paymentType")),[V,M]=(0,r.useState)(!1),[T,B]=(0,r.useState)(!1),[C,_]=(0,r.useState)(!1),[k,A]=(0,r.useState)(["options.coveredIndividualTitle","enquiry.coveredIndividual1.firstName","enquiry.coveredIndividual1.lastName","enquiry.coveredIndividual1.dateOfBirth","enquiry.coveredIndividual1.gender","options.coveredIndividual1Postcode","options.coveredIndividual1AddressDropdown","enquiry.coveredIndividual1.email","enquiry.coveredIndividual1.phone"]),D=(0,j.pR)(k);(0,r.useEffect)(()=>{P(4)},[P]);let{enquiry:{customer:W,coveredIndividual1:U,powerOfAttorney:F,paymentType:Q},options:{whoIsPlanFor:$,coveredIndividualTitle:z,coveredIndividualValidationState:L}}=w(),[R,G]=(0,r.useState)(!!L),H={line1:w("enquiry.coveredIndividual1.address1")||"",line2:w("enquiry.coveredIndividual1.address2")||"",line3:w("enquiry.coveredIndividual1.address3")||"",town:w("enquiry.coveredIndividual1.city")||"",postCode:w("enquiry.coveredIndividual1.postcode")};null==W||W.address1,null==W||W.address2,null==W||W.address3,null==W||W.city,null==W||W.postcode;let X=e=>{e&&(Z("enquiry.coveredIndividual1.address1",e.line1),Z("enquiry.coveredIndividual1.address2",e.line2),Z("enquiry.coveredIndividual1.address3",e.line3),Z("enquiry.coveredIndividual1.city",e.town),Z("enquiry.coveredIndividual1.postcode",e.postCode)),e&&K&&(Z("enquiry.customer.address1",e.line1),Z("enquiry.customer.address2",e.line2),Z("enquiry.customer.address3",e.line3),Z("enquiry.customer.city",e.town),Z("enquiry.customer.postcode",e.postCode))},K="Me"===$;return((0,r.useEffect)(()=>{if(R)A(L),G(!1);else{let e=[];V?(Z("options.coveredIndividual1Postcode",void 0),e=["options.coveredIndividualTitle","enquiry.coveredIndividual1.firstName","enquiry.coveredIndividual1.lastName","enquiry.coveredIndividual1.dateOfBirth","enquiry.coveredIndividual1.gender","enquiry.coveredIndividual1.address1","enquiry.coveredIndividual1.city","enquiry.coveredIndividual1.postcode"]):(Z("options.coveredIndividual1Postcode",void 0),e=C?["options.coveredIndividualTitle","enquiry.coveredIndividual1.firstName","enquiry.coveredIndividual1.lastName","enquiry.coveredIndividual1.dateOfBirth","enquiry.coveredIndividual1.gender","enquiry.coveredIndividual1.address1","enquiry.coveredIndividual1.city","enquiry.coveredIndividual1.postcode"]:["options.coveredIndividualTitle","enquiry.coveredIndividual1.firstName","enquiry.coveredIndividual1.lastName","enquiry.coveredIndividual1.dateOfBirth","enquiry.coveredIndividual1.gender","options.coveredIndividual1Postcode","options.coveredIndividual1AddressDropdown"]),"Other"===z&&e.splice(1,0,"enquiry.coveredIndividual1.title"),e.push("enquiry.coveredIndividual1.email","enquiry.coveredIndividual1.phone"),A(e),Z("options.coveredIndividualValidationState",e)}},[V,C,z]),(0,r.useEffect)(()=>{K&&(Z("enquiry.coveredIndividual1.title",null==W?void 0:W.title),Z("enquiry.coveredIndividual1.firstName","".concat(null==W?void 0:W.firstName)),Z("enquiry.coveredIndividual1.lastName","".concat(null==W?void 0:W.lastName)),Z("enquiry.coveredIndividual1.dateOfBirth","".concat(null==W?void 0:W.dateOfBirth)),Z("enquiry.coveredIndividual1.gender",null==W?void 0:W.gender),Z("enquiry.coveredIndividual1.address1","".concat(null==W?void 0:W.address1)),Z("enquiry.coveredIndividual1.address2","".concat(null==W?void 0:W.address2)),Z("enquiry.coveredIndividual1.address3","".concat(null==W?void 0:W.address3)),Z("enquiry.coveredIndividual1.city","".concat(null==W?void 0:W.city)),Z("enquiry.coveredIndividual1.postcode","".concat(null==W?void 0:W.postcode)))},[null==W?void 0:W.title,null==W?void 0:W.firstName,null==W?void 0:W.lastName,null==W?void 0:W.dateOfBirth,null==W?void 0:W.gender,null==W?void 0:W.address1,null==W?void 0:W.address2,null==W?void 0:W.address3,null==W?void 0:W.city,null==W?void 0:W.postcode]),K)?(0,n.jsx)(b.Z,{}):(0,n.jsxs)(m.Z,{title:"Choice Funeral Plans | Personalise Plan | Persononal Details | Covered Individual",children:[(0,n.jsx)(o.Z,{title:"Who this funeral plan is for",copy:"Tell us about the person who this funeral plan is for, also known as the Covered Individual."}),(0,n.jsxs)("div",{className:"pb-[20px]",children:[(0,n.jsx)(s.Z,{title:"About the covered person"}),(0,n.jsx)(v.Z,{children:(0,n.jsx)(t.Qr,{control:d,name:"options.coveredIndividualTitle",render:e=>{let{field:{name:i,onChange:d,value:r,ref:l},fieldState:{error:a}}=e;return(0,n.jsx)(u.Z,{id:i,initialValue:r,onValueUpdate:e=>{d(e),"Other"===e&&Z("enquiry.coveredIndividual1.title",""),"Other"!==e&&Z("enquiry.coveredIndividual1.title","".concat(e))},initialError:null==a?void 0:a.message,label:"What title should we use for them?",options:[{label:"Mr",value:"Mr"},{label:"Mrs",value:"Mrs"},{label:"Miss",value:"Miss"},{label:"Ms",value:"Ms"},{label:"Dr",value:"Dr"},{label:"Other",value:"Other"}],hideTopBorder:!0})}})}),"Other"===z&&(0,n.jsx)(v.Z,{children:(0,n.jsx)(t.Qr,{control:d,name:"enquiry.coveredIndividual1.title",render:e=>{let{field:{name:i,onChange:d,value:r,ref:l},fieldState:{error:a}}=e;return(0,n.jsx)(c.Z,{id:i,label:"Please specify title",initialValue:r,onValueUpdate:d,initialError:null==a?void 0:a.message,type:"name"})}})}),(0,n.jsx)(v.Z,{children:(0,n.jsx)(t.Qr,{control:d,name:"enquiry.coveredIndividual1.firstName",render:e=>{let{field:{name:i,onChange:d,value:r,ref:l},fieldState:{error:a}}=e;return(0,n.jsx)(c.Z,{id:i,label:"Whatâs their first name?",type:"name",initialValue:r,onValueUpdate:d,initialError:null==a?void 0:a.message})}})}),(0,n.jsx)(v.Z,{children:(0,n.jsx)(t.Qr,{control:d,name:"enquiry.coveredIndividual1.lastName",render:e=>{let{field:{name:i,onChange:d,value:r,ref:l},fieldState:{error:a}}=e;return(0,n.jsx)(c.Z,{id:i,label:"Whatâs their surname?",type:"name",initialValue:r,onValueUpdate:d,initialError:null==a?void 0:a.message})}})}),(0,n.jsx)(v.Z,{children:(0,n.jsx)(t.Qr,{control:d,name:"enquiry.coveredIndividual1.dateOfBirth",render:e=>{let{field:{name:i,onChange:d,value:r,ref:l},fieldState:{error:a}}=e;return(0,n.jsx)(p.Z,{id:i,label:"Whatâs their date of birth?",initialValue:r,onValueUpdate:d,initialError:null==a?void 0:a.message,validation:{type:"minmax",value:[(0,q.zP)("youngerThan120"),new Date],minMessage:"They must not be older than 120 years",maxMessage:"Date cannot be in the future"},helpMessage:"Monthly"===Q?"This date of birth has been used to calculate the monthly cost for the funeral plan.":""})}})}),(0,n.jsx)(v.Z,{children:(0,n.jsx)(t.Qr,{control:d,name:"enquiry.coveredIndividual1.gender",render:e=>{let{field:{name:i,onChange:d,value:r,ref:l},fieldState:{error:a}}=e;return(0,n.jsx)(y.Z,{id:i,label:"Whatâs their gender?",initialValue:r,onValueUpdate:d,initialError:null==a?void 0:a.message,options:[{label:"Male",value:"M"},{label:"Female",value:"F"}]})}})}),"Someone else"===$&&(0,n.jsx)("div",{className:"text-grey-900 w-full pb-[20px] border-t border-grey-500",children:(0,n.jsx)(v.Z,{children:(0,n.jsx)(t.Qr,{control:d,name:"enquiry.powerOfAttorney",render:e=>{let{field:{name:i,onChange:d,value:r,ref:l},fieldState:{error:a}}=e;return(0,n.jsx)(g.Z,{id:"enquiry.powerOfAttorney",label:"Do you have a Power of Attorney for the person you are buying a plan for?",initialValue:F,initialError:null==a?void 0:a.message,onValueUpdate:e=>{null!==e&&Z("enquiry.powerOfAttorney",e)}})}})},"enquiry.powerOfAttorney")})]}),(0,n.jsx)(s.Z,{title:"Covered person's address details"}),(0,n.jsx)(v.Z,{children:(0,n.jsx)(h.Z,{fields:["enquiry.coveredIndividual1.address1","enquiry.coveredIndividual1.address2","enquiry.coveredIndividual1.address3","enquiry.coveredIndividual1.city","enquiry.coveredIndividual1.postcode","options.coveredIndividual1Postcode","options.coveredIndividual1AddressDropdown"],firstFieldLabel:"Whatâs their house number or name?",secondFieldLabel:"Whatâs their postcode?",id:"address",onValueUpdate:e=>X(e),initialValue:H.postCode?H:void 0,hideFirstField:!0,onAddressIsManual:e=>M(e),onAddressSelected:e=>_(e)})}),(0,n.jsx)(s.Z,{title:"Covered person's contact details"}),(0,n.jsxs)("div",{className:"pb-[20px]",children:[(0,n.jsx)(v.Z,{children:(0,n.jsx)(t.Qr,{control:d,name:"enquiry.coveredIndividual1.email",render:e=>{let{field:{name:i,onChange:d,value:r,ref:l},fieldState:{error:a}}=e;return(0,n.jsx)(c.Z,{id:i,label:"Whatâs their email address?",type:"email",initialError:null==a?void 0:a.message,initialValue:r,onValueUpdate:d})}})}),(0,n.jsx)(v.Z,{children:(0,n.jsx)(t.Qr,{control:d,name:"enquiry.coveredIndividual1.phone",render:e=>{let{field:{name:i,onChange:d,value:r,ref:l},fieldState:{error:a}}=e;return(0,n.jsx)(f.Z,{id:i,label:"What's their phone number?",max:11,initialError:null==a?void 0:a.message,initialValue:r,onValueUpdate:d,helpMessage:"We will only call if we need to provide an important update about their funeral plan."})}})}),"Someone else"===$&&(0,n.jsxs)("div",{className:"[&>*]:text-grey-900",children:[(0,n.jsx)("h5",{className:"text-heading-xs xl:text-heading-sm tracking-[-0.36px] font-redHatDisp font-black mb-6",children:"Privacy"}),(0,n.jsx)("p",{children:"If you provide us with personal data about someone other than yourself (for example, a Nominated Representative or a family member on whose behalf you are arranging the Funeral Plan) you must obtain their freely given informed consent before doing so."}),(0,n.jsx)("br",{}),(0,n.jsxs)("p",{children:["By proceeding with the purchase of the funeral plan, you confirm that you have the individual's consent to provide and use their personal data for this purpose, and that you agree to all personal data provided by you being processed in accordance with our ",(0,n.jsx)("a",{className:"underline text-base",href:"https://www.choiceplan.co.uk/privacy-policy",target:"_blank",children:"Privacy Policy"}),"."]})]})]}),K&&(0,n.jsx)(I.Z,{showMarketing:!1}),(0,n.jsx)(a.Z,{href:"/journey/".concat(i,"/personal-details/choose-funeral-director"),prevHref:"/journey/".concat(i,"/who-is-plan-for"),validatePage:()=>{let e=N("enquiry.coveredIndividual1.dateOfBirth");return e||O("enquiry.coveredIndividual1.dateOfBirth",{message:"Please enter valid date"}),D()}})]})}}},function(e){e.O(0,[6323,226,9646,2183,9774,2888,179],function(){return e(e.s=4711)}),_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.