"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7621],{52055:function(e,t,n){n.d(t,{Rq:function(){return j},CG:function(){return y}});var i=n(30266),a=n(92809),o=n(10219),r=n(809),s=n.n(r),l=n(7544),u=n(60118),c=n(92981),m=n(62017),d=n(89776),p=n.n(d);var f,h=n(85893),b=["apolloClient","apolloState"];function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?x(Object(n),!0).forEach((function(t){(0,a.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var v=function(e){var t=Boolean(e.ctx);var n=e.apolloClient||j(e.apolloState||{},t?e.ctx:e);return n.toJSON=function(){return null},e.apolloClient=n,t&&(e.ctx.apolloClient=n),e},j=function(e,t){return f||(f=function(e,t){return new c.fe({ssrMode:Boolean(t),link:p()({uri:"https://roystonfinance.afos.io/api/graphql",credentials:"same-origin",headers:{"broker-id":"0019q0000043kzRAAQ"}}),cache:(new m.h4).restore(e)})}(e,t)),f},y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.ssr,a=void 0!==t&&t;return function(e){var t=function(t){var n,i=t.apolloClient,a=t.apolloState,r=(0,o.Z)(t,b);return n=i||j(a,void 0),(0,h.jsx)(u.eT,{client:n,children:(0,h.jsx)(e,g({},r))})};return(a||e.getInitialProps)&&(t.getInitialProps=function(){var t=(0,i.Z)(s().mark((function t(i){var o,r,u,c,m,d,p,f;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=Boolean(i.ctx),r=v(i),u=r.apolloClient,c={},!e.getInitialProps){t.next=9;break}return t.next=6,e.getInitialProps(i);case 6:c=t.sent,t.next=13;break;case 9:if(!o){t.next=13;break}return t.next=12,l.default.getInitialProps(i);case 12:c=t.sent;case 13:t.next=31;break;case 17:if(!a||!m){t.next=31;break}return t.prev=18,t.next=21,Promise.all([n.e(9774),n.e(8499),n.e(9575)]).then(n.bind(n,59575));case 21:return d=t.sent,p=d.getDataFromTree,f=o?g(g({},c),{},{apolloClient:u}):{pageProps:g(g({},c),{},{apolloClient:u})},t.next=26,p((0,h.jsx)(m,g({},f)));case 26:t.next=31;break;case 28:t.prev=28,t.t0=t.catch(18),console.error("Error while running `getDataFromTree`",JSON.stringify(t.t0,null,2));case 31:return t.abrupt("return",g(g({},c),{},{apolloState:u.cache.extract(),apolloClient:i.apolloClient}));case 32:case"end":return t.stop()}}),t,null,[[18,28]])})));return function(e){return t.apply(this,arguments)}}()),t}}},40229:function(e,t,n){n.d(t,{ns:function(){return r},bd:function(){return s},Q$:function(){return l}});var i=n(14670),a=n(87623),o=n(33681),r=(0,i.Z)((function(e){return(0,a.Z)({root:{height:5,borderRadius:5},bar:{borderRadius:5},colorSecondary:{backgroundColor:"transparent"}})}))(o.Z),s=(0,i.Z)((function(e){return(0,a.Z)({root:{height:5,borderRadius:5},bar:{borderRadius:5},colorSecondary:{backgroundColor:"#CAD0D7"}})}))(o.Z),l=(0,i.Z)((function(e){return(0,a.Z)({root:{height:5,borderRadius:5},bar:{borderRadius:5},colorSecondary:{backgroundColor:"#f4f4f4"}})}))(o.Z)},7358:function(e,t,n){n.d(t,{ns:function(){return i.ns},vD:function(){return s},bd:function(){return i.bd},Hn:function(){return y}});var i=n(40229),a=n(14670),o=n(87623),r=n(33681),s=(0,a.Z)((function(e){return(0,o.Z)({root:{height:5,borderRadius:5},bar:{borderRadius:5},colorSecondary:{backgroundColor:"#f2f2f2"}})}))(r.Z),l=n(92809),u=(n(67294),n(41120)),c=n(4686),m=n(91594),d=n(87257),p=n(18530),f=n(41749),h=n(85893);function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach((function(t){(0,l.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var g=(0,u.Z)((function(e){return(0,o.Z)({root:{flexGrow:1,textAlign:"center",margin:"auto",width:"100%",backgroundColor:"#f7f5f6",marginBottom:e.spacing(3)},stepper:{backgroundColor:"#f7f5f6",width:"360px"}})}));var v=(0,a.Z)({alternativeLabel:{top:10,left:"calc(-50% + 16px)",right:"calc(50% + 16px)"},line:{borderColor:"#f7f5f6",borderTopWidth:3,borderRadius:1}})(p.Z),j=(0,a.Z)({label:{color:"#344556"},active:{color:"#132435"},completed:{color:"#576879"}})(d.Z);(0,u.Z)({root:{color:"#eaeaf0",display:"flex",height:22,alignItems:"center"},active:{color:"#784af4"},circle:{width:8,height:8,borderRadius:"50%",backgroundColor:"currentColor"},completed:{color:"#784af4",zIndex:1,fontSize:18},labelroot:{label:{color:"#95852"}}});var y=function(e){var t=e.activeStep,n=g(),i=["Declaration","Apply & submit"];return(0,h.jsx)("div",{className:n.root,children:(0,h.jsx)(f.Z,{container:!0,direction:"column",alignContent:"center",children:(0,h.jsx)(f.Z,{item:!0,children:(0,h.jsx)(c.Z,{nonLinear:!0,activeStep:t,connector:(0,h.jsx)(v,{}),className:n.stepper,children:i.map((function(e,t){return(0,h.jsx)(m.Z,{completed:!1,children:(0,h.jsx)(j,x(x({},{}),{},{children:e}))},e)}))})})})})}},11349:function(e,t,n){n.d(t,{Z:function(){return s}});n(67294);var i=n(41120),a=n(95477),o=n(85893),r=(0,i.Z)({progress:{color:"#8f6e6e",width:"3rem !important",height:"3rem !important"},wrapperDiv:{margin:"100px auto",padding:"0px",maxWidth:"360px",textAlign:"center",position:"relative",top:"0"},iconWrapper:{display:"block"},loadingTitle:{textAlign:"center",marginTop:"-100px",fontSize:"23px",fontWeight:700}});function s(e){var t=r();return(0,o.jsx)("div",{children:(0,o.jsxs)("div",{className:t.wrapperDiv,children:[(0,o.jsx)("div",{className:t.loadingTitle,children:"Loading page contents..."}),(0,o.jsx)("div",{className:t.iconWrapper,children:(0,o.jsx)(a.Z,{className:t.progress})})]})})}},49171:function(e,t,n){n.d(t,{j:function(){return m}});var i=n(92809),a=(n(67294),n(41120)),o=n(87241),r=n(41749),s=n(282),l=n(5118),u=n(85893),c=(0,a.Z)((function(e){return{textCenter:{textAlign:"center"},img:(0,i.Z)({display:"block",maxWidth:"70%",maxHeight:"70%"},e.breakpoints.down("xs"),{maxWidth:"85%",maxHeight:"85%"}),savvyImage:{marginTop:"30px"}}})),m=function(e){var t=e.qqKey,n=e.loanType,i=e.loanFor,a=(e.handlePrev,e.formData),m=e.profile,p=c(),f="/apply-now";"Car Loan"===n||"Bad Credit Car Loan"===n?f="/car-loans/application":"Leisure Loan"===n?(f="/leisure-finance/application","Caravan"===i?f="/caravan-finance/application":"Bike"===i?f="/bike-finance/application":"Boat"===i&&(f="/boat-finance/application")):"Commercial Loan"===n?f="/commercial-finance/application":"Personal Loan"===n?f="/personal-loans/application":"Home Loan"===n&&(f="/home-loans/application"),t&&(f+="/".concat(t));var h=function(e){e.preventDefault(),console.log("Opening the link: ".concat(f));var n="/auth/signup?email=".concat(encodeURIComponent(a.email));t&&t.length>0&&(n+="&redirect=".concat(f)),window.location.assign(n)},b="Home Loan"===n;return m?(0,u.jsx)(d,{styleClasses:p,onClickHandler:h,profile:m}):(0,u.jsxs)("div",{className:p.textCenter,children:[(0,u.jsx)("div",{id:"fb-root"}),(0,u.jsxs)(r.Z,{container:!0,spacing:3,alignItems:"center",justifyContent:"center",children:[(0,u.jsx)(r.Z,{item:!0,xs:12,children:(0,u.jsx)(l.A,{title:"Thank you"})}),(0,u.jsxs)(r.Z,{item:!0,xs:12,children:[(0,u.jsx)("p",{className:(0,o.Iz)().fpText,children:"Thank you for requesting your finance quote with us."}),(0,u.jsx)("p",{className:(0,o.Iz)().fpText,children:"Our consultant will get in touch with you shortly to discuss your finance options."}),b?null:(0,u.jsx)("p",{className:(0,o.Iz)().fpText,children:"In the meantime, please complete your application so that we can provide you an accurate quote based on your current financial situation."})]}),b?null:(0,u.jsx)(r.Z,{item:!0,xs:12,children:(0,u.jsx)(s.Z,{variant:"contained",color:"primary",size:"large",className:(0,o.NF)().fpQQConfirmationButton,onClick:h,children:"Complete your application"})})]})]})},d=function(e){var t=e.styleClasses,n=e.onClickHandler,i=e.profile;return"SAVVY"==="".concat("0019q0000043kzRAAQ")?(0,u.jsxs)("div",{className:t.textCenter,children:[(0,u.jsx)("div",{id:"fb-root"}),(0,u.jsxs)(r.Z,{container:!0,spacing:3,alignItems:"center",justifyContent:"center",children:[(0,u.jsx)(r.Z,{item:!0,xs:12,children:(0,u.jsx)(l.A,{title:"Thank you",profile:i})}),(0,u.jsxs)(r.Z,{item:!0,xs:12,children:[(0,u.jsx)("p",{className:(0,o.Iz)().fpText,children:"Thank you for requesting your car loan quote with us."}),(0,u.jsx)("p",{className:(0,o.Iz)().fpText,children:"Badcreditcarloans.com.au is managed by Savvy. You will receive a call in next two hours from one of our consultants to discuss your finance options."}),(0,u.jsx)("p",{className:(0,o.Iz)().fpText,children:"In the meantime, please complete your application so that we can provide you an accurate quote based on your current financial situation."}),(0,u.jsx)("p",{children:(0,u.jsx)("img",{className:t.savvyImage,alt:"Savvy's logo",src:"".concat("/_savvyassets/img/savvy-logo-2017-pink.svg")})})]}),(0,u.jsx)(r.Z,{item:!0,xs:12,children:(0,u.jsx)(s.Z,{variant:"contained",color:"primary",size:"large",className:(0,o.Iz)().fpQQConfirmationButton,onClick:n,children:"Complete your application"})})]})]}):(0,u.jsxs)("div",{className:t.textCenter,children:[(0,u.jsx)("div",{id:"fb-root"}),(0,u.jsxs)(r.Z,{container:!0,spacing:3,alignItems:"center",justifyContent:"center",children:[(0,u.jsx)(r.Z,{item:!0,xs:12,children:(0,u.jsx)(l.A,{title:"Thank you",profile:i})}),(0,u.jsxs)(r.Z,{item:!0,xs:12,children:[(0,u.jsxs)("p",{className:(0,o.Iz)().fpText,children:["Thank you for requesting your car loan quote with"," ","".concat("Royston Finance"),"."]}),(0,u.jsx)("p",{className:(0,o.Iz)().fpText,children:"You will receive a call in next two hours from one of our consultants to discuss your finance options."}),(0,u.jsx)("p",{className:(0,o.Iz)().fpText,children:"In the meantime, please complete your application so that we can provide you an accurate quote based on your current financial situation."})]}),(0,u.jsx)(r.Z,{item:!0,xs:12,children:(0,u.jsx)(s.Z,{variant:"contained",color:"primary",size:"large",className:(0,o.Iz)().fpQQConfirmationButton,onClick:n,children:"Complete your application"})})]})]})}},16192:function(e,t,n){n.d(t,{Id:function(){return x},MK:function(){return N},LH:function(){return C},J9:function(){return X},uz:function(){return de},ah:function(){return xe},gx:function(){return fe},XA:function(){return be},M9:function(){return ye},jJ:function(){return Se.j},hc:function(){return Ze},I5:function(){return Fe},Jn:function(){return Be},Dk:function(){return Ae},BD:function(){return Me},Bp:function(){return Re},qI:function(){return Ve},Vm:function(){return We},k_:function(){return ze},r6:function(){return He},sJ:function(){return $e},y2:function(){return Ge},iA:function(){return _e},Oh:function(){return Xe},n3:function(){return tt},wC:function(){return at},I2:function(){return ut},HR:function(){return mt},jc:function(){return pt}});var i,a,o,r=n(67294),s=n(48193),l=n(64436),u=n(8209),c=n(78961),m=n(28119),d=n(71943),p=n(35009),f=n(60256),h=n(85893),b=(0,c.Ry)({abn:(0,c.Z_)().required("Please select a value.").test("abn","ABN invalid, please verify your number",(function(e){return(0,p.em)(e)}))}),x=function(e){var t=e.formData,n=e.setFormData,i=e.prevStep,a=e.handleSubmit,o=e.submittingButtonLabel;return(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(s.J9,{initialValues:t,validationSchema:b,onSubmit:function(e){console.log("Submitting BusinessNameForm..."),n(e),a&&a(e)},children:function(e){var t=e.isSubmitting;return(0,h.jsxs)(s.l0,{className:(0,d.MI)().form,children:[(0,h.jsx)(m.AU,{title:"What is your ABN?"}),(0,h.jsx)(l.Z,{variant:"outlined",fullWidth:!0,className:(0,d.MI)().field,children:(0,h.jsx)(s.gN,{name:"abn",component:u.nv,variant:"outlined",InputProps:{inputComponent:f.eD}})}),(0,h.jsx)(m.kj,{isSubmitting:t,prevStep:i,submittingButtonLabel:o})]})}})})},g=n(80318),v=n(24837),j=n(282),y=n(57502),S=(0,c.Ry)({}),N=function(e){var t=e.formData,n=e.setFormData,i=e.prevStep,a=e.handleSubmit,o=e.submittingButtonLabel,l=r.useState(t.annualRevenue),u=(0,g.Z)(l,2),c=u[0],p=u[1];return(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(s.J9,{initialValues:t,validationSchema:S,onSubmit:function(e){console.log("Submitting AnnualRevenueForm..."),e.annualRevenue=c,n(e),a&&a(e)},children:function(e){var t=e.isSubmitting;return(0,h.jsxs)(s.l0,{className:(0,d.MI)().form,children:[(0,h.jsx)(m.AU,{title:"What is your annual revenue?"}),(0,h.jsx)(v.Z,{orientation:"vertical",color:"secondary","aria-label":"vertical outlined primary button group",fullWidth:!0,variant:"contained",size:"large",className:(0,d.MI)().buttonGroup,children:y.E5.map((function(e,t){return(0,h.jsx)(j.Z,{type:"submit",onClick:function(){p(e)},endIcon:c===e?(0,h.jsx)(m.$H,{}):"",className:(0,d.MI)().buttonInGroup,children:e},t)}))}),(0,h.jsx)(m.kj,{isSubmitting:t,nextDisabled:!c,prevStep:i,submittingButtonLabel:o,hideNextButton:!c})]})}})})},Z=n(6783),k=n(2256),I=(0,c.Ry)({}),F=["New","Used","Still deciding"],C=function(e){var t=e.formData,n=e.setFormData,i=e.prevStep,a=e.handleSubmit,o=e.submittingButtonLabel,l=(e.handleRedirection,e.profile),u=e.loanType,c=r.useState(t.assetDetails.condition),p=(0,g.Z)(c,2),f=p[0];p[1];return(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(s.J9,{initialValues:t.assetDetails,validationSchema:I,onSubmit:function(e){console.log("Submitting AssetConditionForm..."),t.assetDetails=e,n(t),y.J3.includes(u)?setTimeout((function(){a&&a(t)}),200):a&&a(t)},children:function(e){var t=e.isSubmitting;return(0,h.jsxs)(s.l0,{className:y.J3.includes(u)?(0,d.MI)().form3:(0,d.MI)().form,children:[(0,h.jsx)(m.AU,{title:"Please tell us more about the car you would like to purchase",profile:l}),(0,h.jsx)(Z.TP,{name:"condition",options:F,profile:l,loanType:u}),(0,h.jsx)(k.Z,{infoType:"quote"}),(0,h.jsx)(m.kj,{isSubmitting:t,nextDisabled:!f,prevStep:i,submittingButtonLabel:o,hideNextButton:!f,profile:l,loanType:u})]})}})})},B=n(52209),D=n(66888),A=n(18499),T=n(11349),L=n(85260),M=n(41120),P=n(18463),R=n(79912),w=n(41749),V=n(89738),J=n(51907),W=(0,M.Z)({root:{width:"100%",maxWidth:"420px",marginBottom:"20px"},title:{fontSize:14},pos:{marginBottom:12},cardContent:{padding:"0px"},description:{textAlign:"left",fontWeight:600,backgroundColor:"#e6e6e6",padding:"10px 20px"},source:{textAlign:"left",padding:"10px 20px"},nvic:{textAlign:"right",padding:"10px 20px"},selButton:{width:"100%",fontSize:"14px !important",lineHeight:"2.1rem",fontWeight:400,textTransform:"inherit",paddingTop:"5px",paddingBottom:"5px",borderRadius:"5px !important",backgroundColor:"".concat("#ffffff"),border:"1px solid ".concat("#40548f"),color:"#40548f","&:hover, &:focus":{backgroundColor:"".concat("#40548f"," !important"),border:"1px solid ".concat("#40548f"),color:"#ffffff"}}}),O=function(e){var t=W(),n=e.asset;return(0,h.jsxs)(P.Z,{className:t.root,children:[(0,h.jsx)(R.Z,{className:t.cardContent,children:(0,h.jsxs)(w.Z,{container:!0,children:[(0,h.jsx)(w.Z,{item:!0,xs:12,className:t.description,children:function(){var e="".concat(n.year,", ").concat(n.make,", ").concat(n.modelInGuide,", ");return e+="".concat(n.style,", ").concat(n.cc,"cc, ").concat(n.engine,", ").concat(n.transmission),n.kms>0&&(e+=", ".concat(q(n.kms)," kms")),e}()}),(0,h.jsx)(w.Z,{item:!0,xs:8,className:t.source,children:z(n.source)}),(0,h.jsxs)(w.Z,{item:!0,xs:4,className:t.nvic,children:["NVIC: ",n.externalId]})]})}),(0,h.jsx)(V.Z,{onClick:function(t){console.log("@@ onClickHandler:",n.externalId),e.onSelectAsset&&e.onSelectAsset(n.externalId)},children:(0,h.jsx)(J.Z,{style:{flexFlow:"row-reverse"},children:(0,h.jsx)(j.Z,{size:"small",type:"submit",className:t.selButton,startIcon:!0===e.selected?(0,h.jsx)(m.$H,{}):null,children:!0===e.selected?"Selected":"Select"})})})]})},z=function(e){return["PVG","OCG"].includes(e)?"Passenger Vehicle":["CVG","OLC"].includes(e)?"Light Commercial Vehicle":e},q=function(e){return(new Intl.NumberFormat).format(e)},H=function(e){var t=e.results,n=function(t){console.log("\ud83d\ude80 ~ file: AssetResults.tsx:10 ~ onSelectAsset ~ onSelectAsset:",t),e.onSelectAsset&&e.onSelectAsset(t)};if(void 0===t||0===t.length)return(0,h.jsx)("div",{});if(!0===e.noResults)return(0,h.jsx)("div",{children:"No vehicles found"});var i=[];return t.forEach((function(t,a){i.push((0,h.jsx)(O,{asset:t,onSelectAsset:n,selected:!!(e.assetSelected&&e.assetSelected.length>0&&e.assetSelected===t.externalId)||void 0},a))})),(0,h.jsxs)("div",{style:{display:"inline-grid",maxWidth:"520px"},children:[(0,h.jsx)("h5",{children:"Results:"}),i]})},U=n(87241),$=function(e){var t=e.value,n=e.setValue;return(0,h.jsx)("div",{className:(0,U.Iz)().linkBlock2,children:(0,h.jsx)(j.Z,{className:(0,U.Iz)().buttonLink,onClick:function(){n(!t)},children:!1===t?"Click here to select a car from options":"Click here to add a car manually"})})},E=n(39803),G=n(16946),Y=n(30381),_=n.n(Y),Q=function(e){var t=(0,G.c)();return(0,h.jsxs)("div",{className:t.topInfo,style:{marginLeft:"auto",marginRight:"auto",marginTop:"-25px"},children:[(0,h.jsx)(h.Fragment,{children:(0,h.jsx)("img",{src:"/_savvyassets/img/health-insurance-light-bulb.svg",className:t.bulb,style:{width:"24px",marginTop:"-5px"}})}),(0,h.jsx)(h.Fragment,{children:e.text})]})},K=(0,c.Ry)({}),X=function(e){var t=e.formData,n=e.setFormData,i=e.prevStep,a=e.handleSubmit,o=e.submittingButtonLabel,l=(e.handleRedirection,e.profile),u=e.assetLists,c=e.setAssetLists,p=e.loanType,f=t.assetDetails,b=r.useState(!0),x=(0,g.Z)(b,2),v=x[0];x[1];return!1===v?(0,h.jsx)(T.Z,{}):(0,h.jsx)(s.J9,{initialValues:f,validationSchema:K,onSubmit:function(e){console.log("Submitting AssetDetailsForm..."),t.assetDetails=e,u.results&&u.results.length>0&&"-"===t.assetDetails.series&&(t.assetDetails.series=u.results[0].series),n(t),a&&a(t)},children:(0,h.jsxs)(s.l0,{className:y.J3.includes(p)?(0,d.MI)().form3:(0,d.MI)().form,children:[(0,h.jsx)(m.AU,{title:"Please tell us more about the car you would like to purchase",profile:l}),(0,h.jsx)("div",{style:{textAlign:"center",maxWidth:"520px"},children:(0,h.jsx)(ee,{formData:t,prevStep:i,submittingButtonLabel:o,profile:l,assetLists:u,setAssetLists:c,loanType:p})})]})})},ee=function(e){var t=e.formData,n=e.prevStep,i=e.submittingButtonLabel,a=e.profile,o=e.assetLists,l=e.setAssetLists,u=e.loanType,c=(0,s.u6)(),d=t.assetDetails,p=(0,G.c)(),f=r.useState(d.year),b=(0,g.Z)(f,2),x=b[0],v=b[1],j=r.useState(d.make),S=(0,g.Z)(j,2),N=S[0],Z=S[1],I=r.useState(d.model),F=(0,g.Z)(I,2),C=F[0],B=F[1],D=r.useState(d.variant),T=(0,g.Z)(D,2),M=T[0],P=T[1],R=r.useState(d.series),w=(0,g.Z)(R,2),V=w[0],J=w[1],W=r.useState(o.results),O=(0,g.Z)(W,2),z=O[0],q=O[1],U=r.useState(d.year),Y=(0,g.Z)(U,2),K=Y[0],X=Y[1],ee=r.useState(d.make),te=(0,g.Z)(ee,2),ce=te[0],me=te[1],de=r.useState(d.model),pe=(0,g.Z)(de,2),fe=pe[0],he=pe[1],be=r.useState(d.variant),xe=(0,g.Z)(be,2),ge=xe[0],ve=xe[1],je=r.useState(d.series),ye=(0,g.Z)(je,2),Se=ye[0],Ne=ye[1],Ze=r.useState(!1),ke=(0,g.Z)(Ze,2),Ie=ke[0],Fe=ke[1],Ce=r.useState(""),Be=(0,g.Z)(Ce,2),De=Be[0],Ae=Be[1],Te=r.useState(!1),Le=(0,g.Z)(Te,2),Me=Le[0],Pe=Le[1],Re=r.useState(!0),we=(0,g.Z)(Re,2),Ve=we[0],Je=we[1],We=r.useState(o&&o.makes?o.makes:[]),Oe=(0,g.Z)(We,2),ze=Oe[0],qe=Oe[1],He=r.useState(o&&o.models?o.models:[]),Ue=(0,g.Z)(He,2),$e=Ue[0],Ee=Ue[1],Ge=r.useState(o&&o.variants?o.variants:[]),Ye=(0,g.Z)(Ge,2),_e=Ye[0],Qe=Ye[1],Ke=r.useState(o&&o.series?o.series:[]),Xe=(0,g.Z)(Ke,2),et=Xe[0],tt=Xe[1],nt=(0,A.td)(ne,{fetchPolicy:"no-cache",onCompleted:function(e){console.log("@@ loadMakesCompleted:",JSON.stringify(e,null,2)),e.searchAssetMakes&&(qe(e.searchAssetMakes),o.makes=e.searchAssetMakes,o.models=[],o.variants=[],o.series=[],l(o),Z(se),B(se),P(se),J(se),q(void 0),c&&(console.log("@@ formik - makes..."),c.setFieldValue("make",se,!1),c.setFieldValue("model",se,!1),c.setFieldValue("variant",se,!1),c.setFieldValue("series",se,!1)))}}),it=(0,g.Z)(nt,1)[0],at=(0,A.td)(ie,{fetchPolicy:"no-cache",onCompleted:function(e){console.log("@@ loadModelsCompleted:",JSON.stringify(e,null,2)),e.searchAssetModels&&(Ee(e.searchAssetModels),o.models=e.searchAssetModels,o.variants=[],o.series=[],l(o),B(se),P(se),J(se),q(void 0),c&&(console.log("@@ formik - models..."),c.setFieldValue("model",se,!1),c.setFieldValue("variant",se,!1),c.setFieldValue("series",se,!1)))}}),ot=(0,g.Z)(at,1)[0],rt=(0,A.td)(ae,{fetchPolicy:"no-cache",onCompleted:function(e){if(console.log("@@ loadVariantsCompleted:",JSON.stringify(e,null,2)),e.searchAssetVariants){if(Qe(e.searchAssetVariants),o.variants=e.searchAssetVariants,o.series=[],l(o),0===o.variants.length||1===o.variants.length&&0===o.variants[0].length){console.log("@@ search for vehicles [Variants]...");var t={type:"Car",year:Number(x),make:N,model:C};mt({variables:{params:t}})}P(se),J(se),q(void 0),c&&(console.log("@@ formik - variants..."),c.setFieldValue("variant",se,!1),c.setFieldValue("series",se,!1))}}}),st=(0,g.Z)(rt,1)[0],lt=(0,A.td)(oe,{fetchPolicy:"no-cache",onCompleted:function(e){if(console.log("@@ loadSeriesCompleted:",JSON.stringify(e,null,2)),e.searchAssetSeries){if(tt(e.searchAssetSeries),o.series=e.searchAssetSeries,l(o),o.series.length<=1){console.log("@@ search for vehicles [Series]...");var t={type:"Car",year:Number(x),make:N,model:C,variant:M};mt({variables:{params:t}})}else J(se),q(void 0);c.setFieldValue("series",se,!1),q(void 0),c&&console.log("@@ formik...")}}}),ut=(0,g.Z)(lt,1)[0],ct=(0,A.td)(re,{fetchPolicy:"no-cache",onCompleted:function(e){Pe(!e),console.log("@@ searchAssetsCompleted:",JSON.stringify(e,null,2)),q(e.searchAsset),o.results=e.searchAsset,l(o)}}),mt=(0,g.Z)(ct,1)[0];(0,r.useEffect)((function(){if(console.log("Year -> useEffect...",x,d.year),x!=d.year||void 0===o.makes||0===o.makes.length){console.log("Year -> useEffect -> loading makes...");var e={type:"Car",year:Number(x)};it({variables:{params:e}})}}),[x]),(0,r.useEffect)((function(){if(console.log("Make -> useEffect...",N,d.make),N!=d.make||void 0===o.models||0===o.models.length){var e={type:"Car",year:Number(x),make:N};N&&N.length>0&&(console.log("Make -> useEffect -> loading models..."),ot({variables:{params:e}}))}}),[N]),(0,r.useEffect)((function(){if(console.log("Model -> useEffect...",C,d.model),C!=d.model||void 0===o.variants||0===o.variants.length){var e={type:"Car",year:Number(x),make:N,model:C};C&&C.length>0&&(console.log("Model -> useEffect -> loading variants..."),st({variables:{params:e}}))}}),[C]),(0,r.useEffect)((function(){if(console.log("Variant -> useEffect...",M,d.variant),M!=d.variant||void 0===o.series||0===o.series.length){var e={type:"Car",year:Number(x),make:N,model:C,variant:M};M&&(""===M||M.length>1)&&(console.log("Variant -> useEffect -> loading series..."),d.variant=M,ut({variables:{params:e}}))}}),[M]),(0,r.useEffect)((function(){if(console.log("Series -> useEffect...",V,d.series),V!=d.series||void 0===o.results||0===o.results.length){var e={type:"Car",year:Number(x),make:N,model:C,variant:M,series:V};V&&"-"!==V&&V.length>0&&(console.log("Series -> useEffect -> loading results..."),d.series=V,mt({variables:{params:e}}))}}),[V]);return(0,h.jsxs)(h.Fragment,{children:["Car Loan"===u&&"-"!==N&&"-"!==C&&""!==N&&""!==C&&!0===Ve?(0,h.jsx)(Q,{text:"Please proceed by clicking continue if none of these options available is the specific car you're looking for."}):"Car Loan"===u&&""!==ce&&"-"!==ce&&""!==fe&&"-"!==fe&&!1===Ve?(0,h.jsx)(Q,{text:"Please proceed by clicking continue if you don't know the specific car you're looking for."}):"",(0,h.jsx)($,{value:Ve,setValue:Je}),!0===Ve?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(L.mg,{name:"year",label:"Year",options:le(d.condition),touched:c.touched,errors:c.errors,onChange:function(e){e!=x&&v(e)}}),(0,h.jsx)(L.mg,{name:"make",label:"Make",options:ue(ze),touched:c.touched,errors:c.errors,onChange:function(e){e!=N&&Z(e)}}),(0,h.jsx)(L.mg,{name:"model",label:"Model",options:ue($e),touched:c.touched,errors:c.errors,onChange:function(e){e!=C&&B(e)}}),(0,h.jsx)(L.mg,{name:"variant",label:"Variant",options:ue(_e),touched:c.touched,errors:c.errors,onChange:function(e){e!=M&&P(e)}}),(0,h.jsx)(L.mg,{name:"series",label:"Series",options:ue(et),touched:c.touched,errors:c.errors,onChange:function(e){e!=V&&J(e)}}),(0,h.jsx)(H,{results:z,onSelectAsset:function(e){console.log("\ud83d\ude80 ~ file: index.tsx:384 ~ Parent ~ onSelectAsset:",e),e!=V&&c.setFieldValue("nvic",e,!1)},assetSelected:d.nvic,noResults:Me})]}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(E.Z,{name:"year",label:"Year",value:K,variant:"outlined",onChange:function(e){var t=e.target.value;X(t)},onBlur:function(){"New"===t.assetDetails.condition?Number(K)>Number(_()().format("YYYY"))?(Fe(!0),Ae("Please enter a valid year.")):Number(K)<2021?(Fe(!0),Ae("New cars must not be older than 2021.")):(Fe(!1),Ae(""),d.year=Number(K)):"Used"===t.assetDetails.condition&&(Number(K)>Number(_()().format("YYYY"))?(Fe(!0),Ae("Please enter a valid year.")):Number(K)<1960?(Fe(!0),Ae("Used cars must not be older than 1960.")):(Fe(!1),Ae(""),d.year=Number(K)))},className:p.textfields,error:Ie,helperText:De,onKeyPress:function(e){["0","1","2","3","4","5","6","7","8","9"].includes(e.key)||e.preventDefault()},inputProps:{inputMode:"numeric",maxLength:4}}),(0,h.jsx)(E.Z,{name:"make",label:"Make",value:ce,variant:"outlined",onChange:function(e){var t=e.target.value;me(t)},onBlur:function(){d.make=ce},className:p.textfields}),(0,h.jsx)(E.Z,{name:"model",label:"Model",value:fe,variant:"outlined",onChange:function(e){var t=e.target.value;he(t)},onBlur:function(){d.model=fe},className:p.textfields}),(0,h.jsx)(E.Z,{name:"variant",label:"Variant",value:ge,variant:"outlined",onChange:function(e){var t=e.target.value;ve(t)},onBlur:function(){d.variant=ge},className:p.textfields}),(0,h.jsx)(E.Z,{name:"series",label:"Series",value:Se,variant:"outlined",onChange:function(e){var t=e.target.value;Ne(t)},onBlur:function(){d.series=Se},className:p.textfields})]}),y.J3.includes(u)?(0,h.jsx)(k.Z,{infoType:"quote"}):"",(0,h.jsx)(m.kj,{isSubmitting:c.isSubmitting,prevStep:n,submittingButtonLabel:i,profile:a,loanType:u})]})},te=function(e){return(0,D.ZP)(i||(i=(0,B.Z)(["query Query($params: ParamInput!) {","(params: $params)}"])),e)},ne=te("searchAssetMakes"),ie=te("searchAssetModels"),ae=te("searchAssetVariants"),oe=te("searchAssetSeries"),re=((0,D.ZP)(a||(a=(0,B.Z)(["query Query($params: ParamInput!) {\n  searchAssetMakes(params: $params)\n  searchAssetModels(params: $params)\n  searchAssetVariants(params: $params)\n  searchAssetSeries(params: $params)\n}"]))),(0,D.ZP)(o||(o=(0,B.Z)(["query Query($params: ParamInput!) {\n  searchAsset(params: $params) {\n    id\n    type\n    externalId\n    source\n    year\n    make\n    model\n    variant\n    series\n    modelInGuide\n    style\n    engine\n    cc\n    transmission\n    kms\n  }\n}"])))),se="-",le=function(e){for(var t=[],n=(new Date).getFullYear(),i="New"===e?n-2:1960,a=n;a>=i;a--)t.push({key:a,label:"".concat(a)});return t},ue=function(e){var t=[];return e&&e.forEach((function(e){t.push({key:e,label:e})})),t},ce=(0,c.Ry)({}),me=["10%","20%","30%","Not Sure","No Thanks"],de=function(e){var t=e.formData,n=e.setFormData,i=e.prevStep,a=e.handleSubmit,o=e.submittingButtonLabel,l=(e.handleRedirection,e.profile),u=e.loanType,c=r.useState(t.balloonType),p=(0,g.Z)(c,2),f=p[0];p[1];return(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(s.J9,{initialValues:t,validationSchema:ce,onSubmit:function(e){console.log("Submitting BalloonTypeForm..."),n(e),y.J3.includes(u)?setTimeout((function(){a&&a(e)}),200):a&&a(e)},children:function(e){var t=e.isSubmitting;return(0,h.jsxs)(s.l0,{className:y.J3.includes(u)?(0,d.MI)().form3:(0,d.MI)().form,children:[(0,h.jsx)(m.AU,{title:"Will you be requiring an end of loan payment (balloon)?",subTitle:"Is yes, please select your preferred percentage.",profile:l}),(0,h.jsx)(Z.TP,{name:"balloonType",options:me,profile:l,loanType:u}),(0,h.jsx)(m.kj,{isSubmitting:t,nextDisabled:!f,prevStep:i,submittingButtonLabel:o,hideNextButton:!f,profile:l,loanType:u})]})}})})},pe=(0,c.Ry)({entityName:(0,c.Z_)().required("Please select a value.")}),fe=function(e){var t=e.formData,n=e.setFormData,i=e.prevStep,a=e.handleSubmit,o=e.submittingButtonLabel;return(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(s.J9,{initialValues:t,validationSchema:pe,onSubmit:function(e){console.log("Submitting BusinessNameForm..."),n(e),a&&a(e)},children:function(e){var t=e.isSubmitting;return(0,h.jsxs)(s.l0,{className:(0,d.MI)().form,children:[(0,h.jsx)(m.AU,{title:"What is the registered name of your business?"}),(0,h.jsx)(l.Z,{variant:"outlined",fullWidth:!0,className:(0,d.MI)().field,children:(0,h.jsx)(s.gN,{name:"entityName",component:u.nv,variant:"outlined"})}),(0,h.jsx)(m.kj,{isSubmitting:t,prevStep:i,submittingButtonLabel:o})]})}})})},he=(0,c.Ry)({}),be=function(e){var t=e.formData,n=e.setFormData,i=e.prevStep,a=e.handleSubmit,o=e.submittingButtonLabel,l=r.useState(t.businessStructure),u=(0,g.Z)(l,2),c=u[0],p=u[1];return(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(s.J9,{initialValues:t,validationSchema:he,onSubmit:function(e){console.log("Submitting BusinessStructureForm..."),e.businessStructure=c,n(e),a&&a(e)},children:function(e){var t=e.isSubmitting;return(0,h.jsxs)(s.l0,{className:(0,d.MI)().form,children:[(0,h.jsx)(m.AU,{title:"What is your business structure?"}),(0,h.jsx)(v.Z,{orientation:"vertical",color:"secondary","aria-label":"vertical outlined primary button group",fullWidth:!0,variant:"contained",size:"large",className:(0,d.MI)().buttonGroup,children:y.pL.map((function(e,t){return(0,h.jsx)(j.Z,{type:"submit",onClick:function(){p(e)},endIcon:c===e?(0,h.jsx)(m.$H,{}):"",className:(0,d.MI)().buttonInGroup,children:e},t)}))}),(0,h.jsx)(m.kj,{isSubmitting:t,nextDisabled:!c,prevStep:i,submittingButtonLabel:o,hideNextButton:!c})]})}})})},xe=function(e){var t=e.formData,n=e.setFormData,i=e.prevStep,a=e.handleSubmit,o=e.submittingButtonLabel,l=e.loanType,u=ge(),p=(0,r.useState)(t.loanFor),f=(p[0],p[1]),b=(0,c.Ry)({loanFor:(0,c.Z_)().required("Please select a value.")});return(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(s.J9,{initialValues:t,validationSchema:b,onSubmit:function(e){console.log("Submitting BusinessLoanForForm..."),n(e),a&&a(e)},children:function(e){var t=e.values,n=e.touched,a=e.errors,r=e.isSubmitting;return(0,h.jsxs)(s.l0,{className:(0,d.MI)().form,children:[(0,h.jsx)(m.AU,{title:"What is this ".concat(l?l.toLowerCase():"commercial finance"," for?")}),(0,h.jsx)(Z.a5,{name:"loanFor",setLoanPurpose:f,values:t,touched:n,errors:a}),(0,h.jsx)(m.kj,{isSubmitting:r,prevStep:i,submittingButtonLabel:o}),(0,h.jsx)("div",{className:u.moreinfo,children:(0,h.jsx)(k.Z,{infoType:"quote"})})]})}})})},ge=(0,M.Z)((function(e){return{moreinfo:{paddingBottom:"50px"}}})),ve=n(30585),je=(0,c.Ry)({loanFor:(0,c.Z_)().required("Please select a value.")}),ye=function(e){var t=e.formData,n=e.setFormData,i=e.prevStep,a=e.handleSubmit,o=e.submittingButtonLabel,r=e.loanType;return(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(s.J9,{initialValues:t,validationSchema:je,onSubmit:function(e){console.log("Submitting CommercialLoanForForm..."),n(e),a&&a(e)},children:function(e){e.values;var t=e.touched,n=e.errors,a=e.isSubmitting;return(0,h.jsxs)(s.l0,{className:(0,d.MI)().form,children:[(0,h.jsx)(m.AU,{title:"What is this ".concat(r?r.toLowerCase():"commercial finance"," for?")}),(0,h.jsxs)(l.Z,{variant:"outlined",fullWidth:!0,className:(0,d.MI)().selectField,error:!(!(0,s.u9)(t,"loanFor")||!(0,s.u9)(n,"loanFor")),children:[(0,h.jsxs)(s.gN,{labelId:"leisure-loan-for-label",fullWidth:!0,name:"loanFor",type:"text",component:u.Ph,variant:"outlined",native:!0,children:[(0,h.jsx)("option",{value:"",disabled:!0,"aria-label":"Please select",children:"Please select"}),y.$z.map((function(e,t){return(0,h.jsx)("option",{value:e.key,children:e.value},t)}))]}),(0,s.u9)(t,"loanFor")&&(0,s.u9)(n,"loanFor")&&(0,h.jsx)(ve.Z,{children:(0,s.u9)(n,"loanFor")})]}),(0,h.jsx)(m.kj,{isSubmitting:a,prevStep:i,submittingButtonLabel:o})]})}})})},Se=n(49171),Ne=(0,c.Ry)({}),Ze=function(e){var t=e.formData,n=e.setFormData,i=e.prevStep,a=e.handleSubmit,o=e.submittingButtonLabel,l=e.profile,u=e.loanType,c=r.useState(t.creditHistory),p=(0,g.Z)(c,2),f=p[0],b=(p[1],l?y.Jm:y.wO);return(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(s.J9,{initialValues:t,validationSchema:Ne,onSubmit:function(e){console.log("Submitting CreditHistoryForm..."),n(e),y.J3.includes(u)?setTimeout((function(){a&&a(e)}),200):a&&a(e)},children:function(e){var t=e.isSubmitting;return(0,h.jsxs)(s.l0,{className:y.J3.includes(u)?(0,d.MI)().form3:(0,d.MI)().form,children:[(0,h.jsx)(m.AU,{title:"Your credit history",profile:l}),(0,h.jsx)(Z.TP,{name:"creditHistory",options:b,profile:l,loanType:u}),y.J3.includes(u)?(0,h.jsx)(k.Z,{infoType:"quote"}):"",(0,h.jsx)(m.kj,{isSubmitting:t,nextDisabled:!f,prevStep:i,submittingButtonLabel:o,hideNextButton:!f,profile:l,loanType:u})]})}})})},ke=(n(94100),n(11163)),Ie=(0,c.Ry)({}),Fe=function(e){var t=e.formData,n=e.setFormData,i=e.prevStep,a=e.handleSubmit,o=e.submittingButtonLabel,l=e.handleRedirection,u=e.profile,c=e.isHome,f=e.loanType,b=((0,ke.useRouter)(),r.useState(t.employmentStatus)),x=(0,g.Z)(b,2),v=x[0];x[1];return(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(s.J9,{initialValues:t,validationSchema:Ie,onSubmit:function(e){if(console.log("Submitting EmploymentStatusForm..."),"Centrelink - Newstart only"!==e.employmentStatus&&"Unemployed"!==e.employmentStatus)n(e),y.J3.includes(f)?setTimeout((function(){a&&a(e)}),200):a&&a(e);else{var i="".concat("https://my.savvy.com.au/small-loans/application","?");e.loanFor&&""!==e.loanFor&&(i+="loan_for=".concat(t.loanFor,"&"));var o=(0,p.xN)("".concat(e.financeAmount));if(i+="loan_amount=".concat(o>5e3?5e3:o),l){var r="As You have indicated you're ".concat(e.employmentStatus,", we'll assess your application through one of our partners. You'll be redirected to the remaining application now.");"Centrelink - Newstart only"===e.employmentStatus&&(r="As You have indicated you're on ".concat(e.employmentStatus,", we'll assess your application through one of our partners. You'll be redirected to the remaining application now.")),l({subtitle:r,url:i})}}},children:function(e){var t=e.isSubmitting;return(0,h.jsxs)(s.l0,{className:y.J3.includes(f)?(0,d.MI)().form3:(0,d.MI)().form,children:[(0,h.jsx)(m.AU,{title:"What is your employment status?",profile:u}),(0,h.jsx)(Z.TP,{name:"employmentStatus",options:c?y.EQ:y.es,profile:u,loanType:f}),y.J3.includes(f)?(0,h.jsx)(k.Z,{infoType:"quote"}):"",(0,h.jsx)(m.kj,{isSubmitting:t,nextDisabled:!v,prevStep:i,submittingButtonLabel:o,hideNextButton:!v,profile:u,loanType:f})]})}})})},Ce=((0,c.Ry)({}),(0,c.Ry)({}),(0,c.Ry)({})),Be=function(e){var t=e.formData,n=e.setFormData,i=e.prevStep,a=e.handleSubmit,o=e.submittingButtonLabel;return(0,h.jsx)(s.J9,{initialValues:t,validationSchema:Ce,onSubmit:function(e){console.log("Submitting HomeDepositForm..."),n(e),a&&a(e)},children:function(e){var t=e.isSubmitting;return(0,h.jsxs)(s.l0,{className:(0,d.MI)().form,children:[(0,h.jsx)(m.AU,{title:"How much deposit do you have?"}),(0,h.jsx)(l.Z,{variant:"outlined",fullWidth:!0,className:(0,d.MI)().field,children:(0,h.jsx)(s.gN,{name:"deposit",component:u.nv,variant:"outlined",InputProps:{inputComponent:f.$e},inputProps:{inputMode:"numeric"},placeholder:"$25,000"})}),(0,h.jsx)(l.Z,{variant:"outlined",fullWidth:!0,className:(0,d.MI)().sliderField,children:(0,h.jsx)(Z.RW,{name:"deposit",min:0,max:2e6,valueLabelDisplay:"on"})}),(0,h.jsx)(m.kj,{isSubmitting:t,prevStep:i,submittingButtonLabel:o})]})}})},De=(0,c.Ry)({financeAmount:(0,c.Z_)().required("Please fill the required field.").test("financeAmount","Min. loan amount is $100,000,000",(function(e){return(0,p.xN)(e)<=1e8}))}),Ae=function(e){var t=e.formData,n=e.setFormData,i=e.prevStep,a=e.handleSubmit,o=e.submittingButtonLabel;return(0,h.jsx)(s.J9,{initialValues:t,validationSchema:De,onSubmit:function(e){console.log("Submitting FinanceAmountForm..."),n(e),a&&a(e)},children:function(e){var n=e.isSubmitting;return(0,h.jsxs)(s.l0,{className:(0,d.MI)().form,children:[(0,h.jsx)(m.AU,{title:"I want to refinance"===t.loanReason?"What is your current loan amount?":"What is the approximate purchase price?"}),(0,h.jsx)(l.Z,{variant:"outlined",fullWidth:!0,className:(0,d.MI)().field,children:(0,h.jsx)(s.gN,{name:"financeAmount",component:u.nv,variant:"outlined",InputProps:{inputComponent:f.$e},inputProps:{inputMode:"numeric"}})}),(0,h.jsx)(l.Z,{variant:"outlined",fullWidth:!0,className:(0,d.MI)().sliderField,children:(0,h.jsx)(Z.RW,{name:"financeAmount",min:0,max:2e6,valueLabelDisplay:"on"})}),(0,h.jsx)(m.kj,{isSubmitting:n,prevStep:i,submittingButtonLabel:o})]})}})},Te=(0,c.Ry)({}),Le=[{key:"Y",value:"Yes"},{key:"N",value:"No"}],Me=function(e){var t=e.formData,n=e.setFormData,i=e.prevStep,a=e.handleSubmit,o=e.submittingButtonLabel,l=r.useState(t.firstTimeBuyer),u=(0,g.Z)(l,2),c=u[0],p=u[1];return(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(s.J9,{initialValues:t,validationSchema:Te,onSubmit:function(e){console.log("Submitting HomeFistTimeBuyerForm..."),e.firstTimeBuyer=c,n(e),a&&a(e)},children:function(e){var t=e.isSubmitting;return(0,h.jsxs)(s.l0,{className:(0,d.MI)().form,children:[(0,h.jsx)(m.AU,{title:"Are you a first-time home buyer?"}),(0,h.jsx)(v.Z,{orientation:"vertical",color:"secondary","aria-label":"vertical outlined primary button group",fullWidth:!0,variant:"contained",size:"large",className:(0,d.MI)().buttonGroup,children:Le.map((function(e,t){return(0,h.jsx)(j.Z,{type:"submit",onClick:function(){p(e.key)},endIcon:c===e.key?(0,h.jsx)(m.$H,{}):"",className:(0,d.MI)().buttonInGroup,children:e.value},t)}))}),(0,h.jsx)(m.kj,{isSubmitting:t,nextDisabled:!c,prevStep:i,submittingButtonLabel:o,hideNextButton:!c})]})}})})},Pe=(0,c.Ry)({}),Re=function(e){var t=e.formData,n=e.setFormData,i=e.prevStep,a=e.handleSubmit,o=e.submittingButtonLabel,l=r.useState(t.howRepayLoan),u=(0,g.Z)(l,2),c=u[0],p=u[1];return(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(s.J9,{initialValues:t,validationSchema:Pe,onSubmit:function(e){console.log("Submitting HomeHowRepayLoanForm..."),e.howRepayLoan=c,n(e),a&&a(e)},children:function(e){var t=e.isSubmitting;return(0,h.jsxs)(s.l0,{className:(0,d.MI)().form,children:[(0,h.jsx)(m.AU,{title:"How would you like to repay the loan?"}),(0,h.jsx)(v.Z,{orientation:"vertical",color:"secondary","aria-label":"vertical outlined primary button group",fullWidth:!0,variant:"contained",size:"large",className:(0,d.MI)().buttonGroup,children:y.Xn.map((function(e,t){return(0,h.jsx)(j.Z,{type:"submit",onClick:function(){p(e)},endIcon:c===e?(0,h.jsx)(m.$H,{}):"",className:(0,d.MI)().buttonInGroup,children:e},t)}))}),(0,h.jsx)(m.kj,{isSubmitting:t,nextDisabled:!c,prevStep:i,submittingButtonLabel:o,hideNextButton:!c})]})}})})},we=(0,c.Ry)({}),Ve=function(e){var t=e.formData,n=e.setFormData,i=e.prevStep,a=e.handleSubmit,o=e.submittingButtonLabel,l=r.useState(t.loanReason),u=(0,g.Z)(l,2),c=u[0],p=u[1];return(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(s.J9,{initialValues:t,validationSchema:we,onSubmit:function(e){console.log("Submitting loanReasonForm..."),e.loanReason=c,n(e),a&&a(e)},children:function(e){var t=e.isSubmitting;return(0,h.jsxs)(s.l0,{className:(0,d.MI)().form,children:[(0,h.jsx)(m.AU,{title:"What are you looking into today?",subTitle:"Find a home loan to suit your needs with a better rate"}),(0,h.jsx)(v.Z,{orientation:"vertical",color:"secondary","aria-label":"vertical outlined primary button group",fullWidth:!0,variant:"contained",size:"large",className:(0,d.MI)().buttonGroup,children:y.Bw.map((function(e,t){return(0,h.jsx)(j.Z,{type:"submit",onClick:function(){p(e)},endIcon:c===e?(0,h.jsx)(m.$H,{}):"",className:(0,d.MI)().buttonInGroup,children:e},t)}))}),(0,h.jsx)(m.kj,{isSubmitting:t,nextDisabled:!c,prevStep:i,submittingButtonLabel:o,hideNextButton:!c})]})}})})},Je=(n(80084),n(35263),(0,c.Ry)({})),We=function(e){var t=e.formData,n=e.setFormData,i=e.prevStep,a=e.handleSubmit,o=e.submittingButtonLabel,l=r.useState(t.propertyType),u=(0,g.Z)(l,2),c=u[0],p=u[1];return(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(s.J9,{initialValues:t,validationSchema:Je,onSubmit:function(e){console.log("Submitting HomePropertyTypeForm..."),e.propertyType=c,n(e),a&&a(e)},children:function(e){var t=e.isSubmitting;return(0,h.jsxs)(s.l0,{className:(0,d.MI)().form,children:[(0,h.jsx)(m.AU,{title:"What kind of property are you looking to buy?"}),(0,h.jsx)(v.Z,{orientation:"vertical",color:"secondary","aria-label":"vertical outlined primary button group",fullWidth:!0,variant:"contained",size:"large",className:(0,d.MI)().buttonGroup,children:y.m$.map((function(e,t){return(0,h.jsx)(j.Z,{type:"submit",onClick:function(){p(e)},endIcon:c===e?(0,h.jsx)(m.$H,{}):"",className:(0,d.MI)().buttonInGroup,children:e},t)}))}),(0,h.jsx)(m.kj,{isSubmitting:t,nextDisabled:!c,prevStep:i,submittingButtonLabel:o,hideNextButton:!c})]})}})})},Oe=(0,c.Ry)({}),ze=function(e){var t=e.formData,n=e.setFormData,i=e.prevStep,a=e.handleSubmit,o=e.submittingButtonLabel,l=r.useState(t.propertyUse),u=(0,g.Z)(l,2),c=u[0],p=u[1];return(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(s.J9,{initialValues:t,validationSchema:Oe,onSubmit:function(e){console.log("Submitting HomePropertyUseForm..."),e.propertyUse=c,n(e),a&&a(e)},children:function(e){var t=e.isSubmitting;return(0,h.jsxs)(s.l0,{className:(0,d.MI)().form,children:[(0,h.jsx)(m.AU,{title:"How will the property be used?"}),(0,h.jsx)(v.Z,{orientation:"vertical",color:"secondary","aria-label":"vertical outlined primary button group",fullWidth:!0,variant:"contained",size:"large",className:(0,d.MI)().buttonGroup,children:y.SR.map((function(e,t){return(0,h.jsx)(j.Z,{type:"submit",onClick:function(){p(e)},endIcon:c===e?(0,h.jsx)(m.$H,{}):"",className:(0,d.MI)().buttonInGroup,children:e},t)}))}),(0,h.jsx)(m.kj,{isSubmitting:t,nextDisabled:!c,prevStep:i,submittingButtonLabel:o,hideNextButton:!c})]})}})})},qe=(0,c.Ry)({propertyValue:(0,c.Z_)().required("Please fill the required field.")}),He=function(e){var t=e.formData,n=e.setFormData,i=e.prevStep,a=e.handleSubmit,o=e.submittingButtonLabel;return(0,h.jsx)(s.J9,{initialValues:t,validationSchema:qe,onSubmit:function(e){console.log("Submitting HomePropertyValueForm..."),n(e),a&&a(e)},children:function(e){var t=e.isSubmitting;return(0,h.jsxs)(s.l0,{className:(0,d.MI)().form,children:[(0,h.jsx)(m.AU,{title:"Approximately how much is your property worth?"}),(0,h.jsx)(l.Z,{variant:"outlined",fullWidth:!0,className:(0,d.MI)().field,children:(0,h.jsx)(s.gN,{name:"propertyValue",component:u.nv,variant:"outlined",InputProps:{inputComponent:f.$e},inputProps:{inputMode:"numeric"},placeholder:"$0"})}),(0,h.jsx)(l.Z,{variant:"outlined",fullWidth:!0,className:(0,d.MI)().sliderField,children:(0,h.jsx)(Z.RW,{name:"propertyValue",min:0,max:2e6,valueLabelDisplay:"on"})}),(0,h.jsx)(m.kj,{isSubmitting:t,prevStep:i,submittingButtonLabel:o})]})}})},Ue=(0,c.Ry)({}),$e=function(e){var t=e.formData,n=e.setFormData,i=e.prevStep,a=e.handleSubmit,o=e.submittingButtonLabel,l=r.useState(t.propertyUse),u=(0,g.Z)(l,2),c=u[0],p=u[1];return(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(s.J9,{initialValues:t,validationSchema:Ue,onSubmit:function(e){console.log("Submitting HomeRefinancePropertyUseForm..."),e.propertyUse=c,n(e),a&&a(e)},children:function(e){var t=e.isSubmitting;return(0,h.jsxs)(s.l0,{className:(0,d.MI)().form,children:[(0,h.jsx)(m.AU,{title:"Do you live in this property or is it an investment?"}),(0,h.jsx)(v.Z,{orientation:"vertical",color:"secondary","aria-label":"vertical outlined primary button group",fullWidth:!0,variant:"contained",size:"large",className:(0,d.MI)().buttonGroup,children:y.Ec.map((function(e,t){return(0,h.jsx)(j.Z,{type:"submit",onClick:function(){p(e)},endIcon:c===e?(0,h.jsx)(m.$H,{}):"",className:(0,d.MI)().buttonInGroup,children:e},t)}))}),(0,h.jsx)(m.kj,{isSubmitting:t,nextDisabled:!c,prevStep:i,submittingButtonLabel:o,hideNextButton:!c})]})}})})},Ee=(0,c.Ry)({}),Ge=function(e){var t=e.formData,n=e.setFormData,i=e.prevStep,a=e.handleSubmit,o=e.submittingButtonLabel,l=r.useState(t.refinanceReason),u=(0,g.Z)(l,2),c=u[0],p=u[1];return(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(s.J9,{initialValues:t,validationSchema:Ee,onSubmit:function(e){console.log("Submitting HomeWhyRefinanceForm..."),e.refinanceReason=c,n(e),a&&a(e)},children:function(e){var t=e.isSubmitting;return(0,h.jsxs)(s.l0,{className:(0,d.MI)().form,children:[(0,h.jsx)(m.AU,{title:"Why are you refinancing?"}),(0,h.jsx)(v.Z,{orientation:"vertical",color:"secondary","aria-label":"vertical outlined primary button group",fullWidth:!0,variant:"contained",size:"large",className:(0,d.MI)().buttonGroup,children:y.$i.map((function(e,t){return(0,h.jsx)(j.Z,{type:"submit",onClick:function(){p(e)},endIcon:c===e?(0,h.jsx)(m.$H,{}):"",className:(0,d.MI)().buttonInGroup,children:e},t)}))}),(0,h.jsx)(m.kj,{isSubmitting:t,nextDisabled:!c,prevStep:i,submittingButtonLabel:o,hideNextButton:!c})]})}})})},Ye=(0,c.Ry)({loanFor:(0,c.Z_)().required("Please select a value.")}),_e=function(e){var t=e.formData,n=e.setFormData,i=e.prevStep,a=e.handleSubmit,o=e.submittingButtonLabel;return(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(s.J9,{initialValues:t,validationSchema:Ye,onSubmit:function(e){console.log("Submitting LeisureLoanForForm..."),n(e),a&&a(e)},children:function(e){e.values;var t=e.touched,n=e.errors,a=e.isSubmitting;return(0,h.jsxs)(s.l0,{className:(0,d.MI)().form,children:[(0,h.jsx)(m.AU,{title:"What is the leisure loan for?"}),(0,h.jsxs)(l.Z,{variant:"outlined",fullWidth:!0,className:(0,d.MI)().selectField,error:!(!(0,s.u9)(t,"loanFor")||!(0,s.u9)(n,"loanFor")),children:[(0,h.jsxs)(s.gN,{labelId:"leisure-loan-for-label",fullWidth:!0,name:"loanFor",type:"text",component:u.Ph,variant:"outlined",native:!0,children:[(0,h.jsx)("option",{value:"",disabled:!0,"aria-label":"Please select",children:"Please select"}),y.C$.map((function(e,t){return(0,h.jsx)("option",{value:e.key,children:e.value},t)}))]}),(0,s.u9)(t,"loanFor")&&(0,s.u9)(n,"loanFor")&&(0,h.jsx)(ve.Z,{children:(0,s.u9)(n,"loanFor")})]}),(0,h.jsx)(m.kj,{isSubmitting:a,prevStep:i,submittingButtonLabel:o})]})}})})},Qe=((0,c.Ry)({}),(0,c.Ry)({})),Ke=["Personal","Business"],Xe=function(e){var t=e.formData,n=e.setFormData,i=e.prevStep,a=e.handleSubmit,o=e.submittingButtonLabel,l=(e.handleRedirection,e.profile),u=e.loanType,c=r.useState(t.loanPurpose),p=(0,g.Z)(c,2),f=p[0];p[1];return(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(s.J9,{initialValues:t,validationSchema:Qe,onSubmit:function(e){console.log("Submitting LoanPurposeForm..."),n(e),y.J3.includes(u)?setTimeout((function(){a&&a(e)}),200):a&&a(e)},children:function(e){var t=e.isSubmitting;return(0,h.jsxs)(s.l0,{className:y.J3.includes(u)?(0,d.MI)().form3:(0,d.MI)().form,children:[(0,h.jsx)(m.AU,{title:"Is this personal or for business use?",profile:l}),(0,h.jsx)(Z.TP,{name:"loanPurpose",options:Ke,profile:l,loanType:u}),y.J3.includes(u)?(0,h.jsx)(k.Z,{infoType:"quote"}):"",(0,h.jsx)(m.kj,{isSubmitting:t,nextDisabled:!f,prevStep:i,submittingButtonLabel:o,hideNextButton:!f,profile:l,loanType:u})]})}})})},et=(0,c.Ry)({loanFor:(0,c.Z_)().required("Please select a value.")}),tt=function(e){var t=e.formData,n=e.setFormData,i=e.prevStep,a=e.handleSubmit,o=e.submittingButtonLabel;return(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(s.J9,{initialValues:t,validationSchema:et,onSubmit:function(e){console.log("Submitting PersonalLoanForForm..."),n(e),a&&a(e)},children:function(e){e.values;var t=e.touched,n=e.errors,a=e.isSubmitting;return(0,h.jsxs)(s.l0,{className:(0,d.MI)().form,children:[(0,h.jsx)(m.AU,{title:"What is this personal loan for?"}),(0,h.jsxs)(l.Z,{variant:"outlined",fullWidth:!0,className:(0,d.MI)().selectField,error:!(!(0,s.u9)(t,"loanFor")||!(0,s.u9)(n,"loanFor")),children:[(0,h.jsxs)(s.gN,{labelId:"leisure-loan-for-label",fullWidth:!0,name:"loanFor",type:"text",component:u.Ph,variant:"outlined",native:!0,children:[(0,h.jsx)("option",{value:"",disabled:!0,"aria-label":"Please select",children:"Please select"}),y.vx.map((function(e,t){return(0,h.jsx)("option",{value:e.key,children:e.value},t)}))]}),(0,s.u9)(t,"loanFor")&&(0,s.u9)(n,"loanFor")&&(0,h.jsx)(ve.Z,{children:(0,s.u9)(n,"loanFor")})]}),(0,h.jsx)(m.kj,{isSubmitting:a,prevStep:i,submittingButtonLabel:o})]})}})})},nt=(0,c.Ry)({}),it=["Dealership","Private Sale","Not Sure"],at=function(e){var t=e.formData,n=e.setFormData,i=e.prevStep,a=e.handleSubmit,o=e.submittingButtonLabel,l=(e.handleRedirection,e.profile),u=e.loanType,c=r.useState(t.purchaseType),p=(0,g.Z)(c,2),f=p[0];p[1];return(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(s.J9,{initialValues:t,validationSchema:nt,onSubmit:function(e){console.log("Submitting PurchaseTypeForm..."),n(e),y.J3.includes(u)?setTimeout((function(){a&&a(e)}),200):a&&a(e)},children:function(e){var t=e.isSubmitting;return(0,h.jsxs)(s.l0,{className:y.J3.includes(u)?(0,d.MI)().form3:(0,d.MI)().form,children:[(0,h.jsx)(m.AU,{title:"Where are you buying from?",profile:l}),(0,h.jsx)(Z.TP,{name:"purchaseType",options:it,profile:l,loanType:u}),y.J3.includes(u)?(0,h.jsx)(k.Z,{infoType:"quote"}):"",(0,h.jsx)(m.kj,{isSubmitting:t,nextDisabled:!f,prevStep:i,submittingButtonLabel:o,hideNextButton:!f,profile:l,loanType:u})]})}})})},ot=n(22318),rt=n(95477),st=n(41664),lt=(0,M.Z)((function(e){return{root:{maxWidth:"840px",textAlign:"center",marginBottom:"40px","& p a":{color:U.Bp.roseColor[0]}}}})),ut=function(e){var t=e.content,n=lt();return console.log("RedirectConfirmationPage...."),(0,h.jsxs)("div",{className:n.root,children:[(0,h.jsx)("div",{id:"fb-root"}),(0,h.jsxs)(w.Z,{container:!0,spacing:3,alignItems:"center",justifyContent:"center",children:[(0,h.jsx)(w.Z,{item:!0,xs:12,children:(0,h.jsx)(ot.Z,{variant:"h2",className:(0,U.Iz)().fpTitle,children:"Thank you"})}),(0,h.jsxs)(w.Z,{item:!0,xs:12,children:[(0,h.jsx)("p",{className:(0,U.Iz)().fpText,children:t.title?t.title:"Thank you for sending through your application for approval."}),(0,h.jsx)("p",{className:(0,U.Iz)().fpText,children:t.subtitle})]}),(0,h.jsx)(w.Z,{item:!0,xs:12,children:(0,h.jsx)(rt.Z,{disableShrink:!0,thickness:5,size:40})}),(0,h.jsx)(w.Z,{item:!0,xs:12,children:(0,h.jsxs)("p",{className:(0,U.Iz)().fpText,children:["If nothing happens after few seconds, please click"," ",(0,h.jsx)(st.default,{href:t.url,children:(0,h.jsx)("a",{children:"here."})})]})})]})]})},ct=(0,c.Ry)({}),mt=function(e){var t=e.formData,n=e.setFormData,i=e.prevStep,a=e.handleSubmit,o=e.submittingButtonLabel,l=(e.handleRedirection,e.profile),u=e.loanType,c=r.useState(t.residencyStatus),p=(0,g.Z)(c,2),f=p[0];p[1],(0,ke.useRouter)();return(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(s.J9,{initialValues:t,validationSchema:ct,onSubmit:function(e){console.log("Submitting ResidencyStatusForm..."),n(e),y.J3.includes(u)?setTimeout((function(){a&&a(e)}),200):a&&a(e)},children:function(e){var t=e.isSubmitting;return(0,h.jsxs)(s.l0,{className:y.J3.includes(u)?(0,d.MI)().form3:(0,d.MI)().form,children:[(0,h.jsx)(m.AU,{title:"Current residency status",profile:l}),(0,h.jsx)(Z.TP,{name:"residencyStatus",options:y.bv,profile:l,loanType:u}),y.J3.includes(u)?(0,h.jsx)(k.Z,{infoType:"quote"}):"",(0,h.jsx)(m.kj,{isSubmitting:t,nextDisabled:!f,prevStep:i,submittingButtonLabel:o,hideNextButton:!f,profile:l,loanType:u})]})}})})},dt=(0,c.Ry)({}),pt=function(e){var t=e.formData,n=e.setFormData,i=e.prevStep,a=e.handleSubmit,o=e.submittingButtonLabel,l=r.useState(t.timeInBusiness),u=(0,g.Z)(l,2),c=u[0],p=u[1];return(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(s.J9,{initialValues:t,validationSchema:dt,onSubmit:function(e){console.log("Submitting TimeInBusinessForm..."),e.timeInBusiness=c,n(e),a&&a(e)},children:function(e){var t=e.isSubmitting;return(0,h.jsxs)(s.l0,{className:(0,d.MI)().form,children:[(0,h.jsx)(m.AU,{title:"How long have you been in business for?"}),(0,h.jsx)(v.Z,{orientation:"vertical",color:"secondary","aria-label":"vertical outlined primary button group",fullWidth:!0,variant:"contained",size:"large",className:(0,d.MI)().buttonGroup,children:y.LE.map((function(e,t){return(0,h.jsx)(j.Z,{type:"submit",onClick:function(){p(e.key)},endIcon:c===e.key?(0,h.jsx)(m.$H,{}):"",className:(0,d.MI)().buttonInGroup,children:e.value},t)}))}),(0,h.jsx)(m.kj,{isSubmitting:t,nextDisabled:!c,prevStep:i,submittingButtonLabel:o,hideNextButton:!c})]})}})})};(0,c.Ry)({year:(0,c.Z_)().required("Please select a value.")})}}]);