1"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[8494],{38494:function(e,t,s){s.r(t),s.d(t,{FormChangeOwner:function(){return A}});var a=s(63696),o=s(51149),r=s(21698),n=s(10898),l=s(72407),i=s(17972),d=s(97074),m=s(21388),u=s(2290),c=s(74447),p=s(79124),h=s(51089),f=s(13276),g=s(79511),N=s(34995),C=s(49317),I=s(52466),v=s(4740),S=s(41129),b=s(48136),Y=s(3974),F=s(93911),T=s(26443),R=s(78887),y=s(98335),w=s(53974),$=s(19951),L=s(32120),q=s(3369),M=s(69561),V=s(90287),D=s(72418),x=s(4575),k=s(91785);const O=({imFormSectionHeadingCustom:e,hideFormSectionHeading:t=!1,formShortName:s,uniqueId:o="",otherInfo:r,getFormErrorClassName:n,handleOtherInfoChange:l,setErrors:i})=>{const d=(0,q.useLocation)(),m=(0,C.Nq)();return(0,a.useEffect)((()=>{(0,V.tl)(d,l,["postcode","suburb","state"])}),[]),(0,k.Y)(a.Fragment,null,!t&&(0,k.Y)(x.FormSectionHeading,{formSectionHeadingCustom:e},"Your Address Details"),(0,k.Y)("div",{className:"classImFormInputRow",css:R.lp},(0,k.Y)($.InputLabelNestedControlled,{isRequired:!0,idName:`${s}Street${o?`-${o}`:""}`,typeName:"text",placeholder:"Street",inputValue:(null==r?void 0:r.street)||"",inputValueKey:"street",handleChange:l},"Street")),(0,k.Y)("div",{className:"classImFormInputRow",css:R.lp},(0,k.Y)($.InputLabelNestedControlled,{isRequired:!0,idName:`${s}${(0,M.N)(m.suburb)}${o?`-${o}`:""}`,typeName:"text",placeholder:(0,M.N)(m.suburb),inputValue:(null==r?void 0:r[m.suburb])||"",inputValueKey:m.suburb,handleChange:l},(0,M.N)(m.suburb))),(0,k.Y)("div",{className:"classImFormInputRow",css:R.lp},(0,k.Y)(D.SelectLabelNestedControlled,{isRequired:!0,idName:`${s}${(0,M.N)(m.state)}${o?`-${o}`:""}`,selectValue:(null==r?void 0:r[m.state])||"",selectValueKey:m.state,options:(0,C._I)(),handleChange:l},(0,M.N)(m.state))),(0,k.Y)("div",{className:"classImFormInputRow",css:R.lp},(0,k.Y)($.InputLabelNestedControlled,{isRequired:!0,className:n(m.postcode),idName:`${s}${(0,M.N)(m.postcode)}${o?`-${o}`:""}`,typeName:"text",placeholder:(0,M.N)(m.postcode),inputValue:(null==r?void 0:r[m.postcode])||"",inputValueKey:m.postcode,handleChange:l,handleErrors:i,validationRequired:!0,validateFieldType:"postcode"},(0,M.N)(m.postcode))))};var E=s(30913),H=s(770),_=s(19023);const A=({formId:e,formHeading:t="",formOnModal:s=!1,closeFormModal:q,specialId:M="",specialSlug:V="",specialTitle:D="",specialsReferenceCode:A="",showLocations:K=!0})=>{const{addressTypes:P,formChangeOwner:j}=i.U,{siteType:U}=(0,Y.j)(),W=U===u.D.oem,[G,z]=(0,S.Mj)(c.fD,{}),{0:J,1:Q}=(0,a.useState)(!1),{0:B,1:X}=(0,a.useState)(!1),{0:Z,1:ee}=(0,a.useState)(!1),{0:te,1:se}=(0,a.useState)(""),{0:ae,1:oe}=(0,a.useState)({}),{0:re,1:ne}=(0,a.useState)(!1),{0:le,1:ie}=(0,a.useState)(null),de=(0,C.Nq)(),me={...W&&{addressType:P.private.value},street:"",[de.suburb]:"",[de.state]:"",[de.postcode]:"",vin:"",model:"",registration:"",ownershipTransferDate:"",comments:"",...j.isMarketing&&{marketing:j.isMarketingChecked},...j.isTerms&&{terms:j.isTermsChecked}},{0:ue,1:ce}=(0,a.useState)({...me}),pe=!s,he=pe?y.Y_:T.v,fe=d.ec.FormChangeOwner,{heading:ge,formShortName:Ne}=fe,{handleFormOpen:Ce,handleFormInteracted:Ie}=(0,I.Y)(Ne),ve=e=>{"string"!=typeof e&&(z((t=>({...t,...e}))),Ie())},Se=e=>{"object"==typeof e&&(ce({...ue,...e}),Ie())},be=e=>Z&&ae[e]?"classFormError":"",Ye=()=>{ne(!1),X(!1),ce({...me})},{handleSubmitWithReCaptcha:Fe,recaptchaReady:Te,isLoading:Re}=(0,v.T)({handleSubmit:async()=>{try{await(0,f.M)(G,z),(0,p.$)("Hard Lead","Change of Owner Form"),(0,N.t)({formId:parseInt(e,10),formShortName:Ne}),(0,g.JP)(),pe&&ne(!0),pe||Q(!0)}catch(t){ee(!0)}},errors:ae,setFormErrorStatus:ee,setSubmitted:X}),ye=()=>{const t={formId:parseInt(e,10),firstName:null==G?void 0:G.firstName,lastName:null==G?void 0:G.lastName,phone:null==G?void 0:G.phone,email:null==G?void 0:G.email,specialsReferenceCode:A,specialTitle:D,specialSlug:V,specialId:M,...ue};return(0,o.z)(t,n.Po)};(0,a.useEffect)((()=>{(0,a.startTransition)((()=>se((0,r.A)())))}),[]);const we=(0,b.S)((()=>{(0,h.QY)({eventName:l.R.formOpen,eventInfo:{form_name:Ne,form_category:"lead_aftersales",form_type:s?"modal":"embedded",form_step_name:"start",form_step_number:"step-0"}}),Ce()}));return(0,k.Y)(a.Fragment,null,!J&&(0,k.Y)("div",{ref:we,className:"classStandardComponent classStandardForm",css:he},(0,k.Y)("div",{css:y.cU},(0,k.Y)("form",{css:y.ao,id:Ne,name:Ne,acceptCharset:"utf-8",onSubmit:Fe},(0,k.Y)(_.h,{formOnPage:pe,isSubmitted:B,isFormErrorStatus:Z},t||ge),(0,k.Y)("div",{css:R.uf},(0,k.Y)("div",{className:"classImFormCol",css:R.hL}
1,(0,k.Y)(E.o,{formShortName:Ne,uniqueId:te,userInfo:G,handleUserInfoChange:ve,getFormErrorClassName:be,setErrors:oe,otherInfo:ue,handleOtherInfoChange:Se,showAddressType:W&&j.isAddressType,isPostcode:j.isPostcode}),(0,k.Y)(O,{formShortName:Ne,uniqueId:te,otherInfo:ue,getFormErrorClassName:be,handleOtherInfoChange:Se,setErrors:oe})),(0,k.Y)("div",{className:"classImFormCol",css:R.hL},(0,k.Y)(x.FormSectionHeading,null,"Vehicle Details"),(0,k.Y)("div",{className:"classImFormInputRow",css:R.lp},(0,k.Y)($.InputLabelNestedControlled,{isRequired:!0,idName:`${Ne}Vin-${te}`,typeName:"text",placeholder:"VIN",helpTextHeading:m.j.heading,helpText:m.j.content,inputValue:(null==ue?void 0:ue.vin)||"",inputValueKey:"vin",handleChange:Se},"VIN")),(0,k.Y)("div",{className:"classImFormInputRow",css:R.lp},(0,k.Y)($.InputLabelNestedControlled,{isRequired:!0,idName:`${Ne}Model-${te}`,typeName:"text",placeholder:"Model",inputValue:(null==ue?void 0:ue.model)||"",inputValueKey:"model",handleChange:Se},"Model")),(0,k.Y)("div",{className:"classImFormInputRow",css:R.lp},(0,k.Y)($.InputLabelNestedControlled,{isRequired:!0,idName:`${Ne}Registration-${te}`,typeName:"text",placeholder:"Registration",inputValue:(null==ue?void 0:ue.registration)||"",inputValueKey:"registration",handleChange:Se},"Registration")),(0,k.Y)("div",{className:"classImFormInputRow",css:R.lp},(0,k.Y)(w.DatePickerLabelNested,{isRequired:!0,idName:`${Ne}DateOfTransfer-${te}`,selected:le,onChange:e=>(e=>{ie(e),Se({ownershipTransferDate:(null==e?void 0:e.toLocaleDateString("en-AU"))||""})})(e),placeholderText:"Date of Transfer to New Owner",showDisabledMonthNavigation:!0},"Date of Transfer")),(0,k.Y)(H.v,{currentForm:fe,uniqueId:te,otherInfo:ue,handleOtherInfoChange:Se,userInfo:G,handleUserInfoChange:ve,handleErrors:oe,isSubmitted:B,isComments:j.isComments,isLocations:K&&j.isLocations,isGroupModel:j.isGroupModel,isFooterLegalHeading:j.isFooterLegalHeading,additionalContent:j.additionalContent,isMarketing:j.isMarketing,isMarketingRequired:j.isMarketingRequired,isTerms:j.isTerms,isTermsRequired:j.isTermsRequired,termsTextCustom:j.termsTextCustom,isAlternativeLegalText:j.isAlternativeLegalText,isSubmitDisabled:Re||!1===Te}))))),re&&(0,k.Y)(F.a,{modalWrapperCustom:T.Du,modalContentCustom:T.pW,modalShowed:re,closeModal:Ye},(0,k.Y)(L.C,{formShortName:Ne,fmSuccessText:j.successTextCustom,getFormData:ye,closeMessage:Ye}))),J&&(0,k.Y)(L.C,{formShortName:Ne,getFormData:ye,closeMessage:q}))}}}]);
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.