"use strict";(self.webpackChunkphaeria_dev=self.webpackChunkphaeria_dev||[]).push([[9115],{292:function(e,t,a){a.d(t,{Z:function(){return J}});var n=a(5861),r=a(7757),l=a.n(r),i=a(7294),c=a(9335),o=a(7244),s=a(3201),m=a(531),d=a.n(m),u=a(3964),p=a.n(u),h=(a(7347),function(){var e=(0,c.D)(),t=(e.setShowManualAddress,e.showManualAddress,e.dateOfBirthUnformatted),a=e.handleDateOfBirth,n=e.customerData,r=n.firstname,l=n.lastname,m=n.email,u=n.address,h=n.mobile,g=n.addressList,E=n.postcode,f=e.updateCustomerDetails,v=e.searchPostcodeInProgress,y=e.searchPostcode,b=e.updateAddress,N=e.discountCode,w=e.setDiscountCode,k=(0,i.useState)(!0),C=k[0],S=k[1],D=function(e){"-"===e.target.value&&(e.target.value="")};return(0,i.useEffect)((function(){}),[l]),i.createElement("form",{className:"customer-details"},i.createElement("div",{className:"customer-details-heading vertical-margin"}," ",i.createElement("h2",null,"Enter your details and get covered")," "),i.createElement("div",{className:"fullname-parent vertical-margin"},i.createElement("div",{className:"placeholder-customer","data-placeholder":"First name"},i.createElement("input",{type:"text","aria-label":"First name",className:"customer-details-input ",value:r,name:"firstname",onChange:f,onFocus:D})),i.createElement("div",{className:"placeholder-customer","data-placeholder":"Last name"},i.createElement("input",{type:"text","aria-label":"Last name",name:"lastname",className:"customer-details-input half-width-input",value:l,onChange:f,onFocus:D}))),i.createElement("div",{className:"fullname-parent vertical-margin"},i.createElement("div",{className:"placeholder-customer","data-placeholder":"Email address"},i.createElement("input",{type:"email",className:"customer-details-input ",value:m,onChange:f,name:"email",pattern:".+@globex\\.com"})),i.createElement("div",{className:"placeholder-customer","data-placeholder":"Mobile phone"},i.createElement("input",{type:"text",className:"customer-details-input half-width-input",value:h,onChange:f,name:"mobile"}))),i.createElement("div",{className:"fullname-parent vertical-margin"},i.createElement("div",{className:"placeholder-customer date-container ","data-placeholder":"Date of Birth"},i.createElement(d(),{wrapperClassName:"date-picker-pf",selected:t,onChange:a,maxDate:p()().toDate(),showYearDropdown:!0,dateFormatCalendar:"MMMM",dateFormat:"dd/MM/yyyy",yearDropdownItemNumber:80,scrollableYearDropdown:!0,className:"customer-details-input half-width-input",name:"dob"}))),i.createElement("div",{className:"customer-details-heading display-btn vertical-margin"},i.createElement("h2",null,"Your address"),i.createElement("span",{className:"enter-address-manually",onClick:function(){return S(!C)}},i.createElement(o.Hlf,null)," ",C?"Select address from the list":"Enter address manually")),i.createElement("div",{className:"fullname-parent no-margin vertical-margin"},i.createElement("div",{className:"placeholder-postcode","data-placeholder":"Enter your postcode"},i.createElement("div",{style:{position:"relative"},className:"address-container"},i.createElement("input",{style:{width:"100%"},name:"postcode",id:"postcode",className:"customer-details-input ",value:E,onChange:f}),i.createElement("button",{onClick:function(){return S(!1),void y()},style:{position:"absolute",right:"10px",height:"50px"},type:"button",className:"search-reg-no"},v?i.createElement(s.fCD,{size:24,className:"spinner-animation"}):"Search"))),C?i.createElement("div",{className:"placeholder-customer","data-placeholder":"Enter your address"},i.createElement("input",{name:"address",type:"text",className:"customer-details-input half-width-input",value:u,onChange:f})):i.createElement("div",{className:"placeholder-customer","data-placeholder":"Select your address"},i.createElement("select",{className:"uk-select form-controls address-select",value:u,onChange:b},g&&g.length?null==g?void 0:g.map((function(e,t){return i.createElement("option",{key:t,id:e,value:e,name:e},e)})):""))),i.createElement("div",{className:"fullname-parent vertical-margin discount-code-input"},i.createElement("div",{className:"placeholder-customer","data-placeholder":"Discount code"},i.createElement("input",{type:"text",className:"customer-details-input",value:N,onChange:function(e){w(e.target.value.toUpperCase())},name:"discountCode"}))))}),g=a(2876),E=(a(1653),a(1789)),f=function(){var e,t=(0,c.D)(),a=t.premiumFundingDetails,n=t.directDebitDetails,r=n.firstname,l=n.preferredPaymentDate,o=n.surname,s=n.sortCode,m=n.accountNo,d=n.bankName,u=n.bankPostcode,p=n.bankAddress1,h=n.bankAddress2,g=n.bankTown,f=a.MinDepositAmount,v=a.MonthlyPayable,y=a.DepositTerm,b=a.APR,N=a.TotalCost,w=(a.PremiumFinance,a.TotalAmountPayable,a.BorrowCost),k=(0,E.checkTheme)().pageTitle+".com - a trading style of Rest Ashored Limited -";if("lcs"==(0,E.checkTheme)().theme&&"undefined"!=typeof window&&window.sessionStorage.getItem("products")&&(e=JSON.parse(sessionStorage.getItem("products")))&&e.OrganisationName)switch(e.OrganisationName.toLowerCase()){case"savemoneyhub":k="SaveMoneyHub - a trading style of Rest Ashored Limited -";break;case"driveassured":k="Drive Assured - a trading style of Rest Ashored Limited -";break;case"invictusprotect":k="Invictus Protect Limited"}var C=N-f,S=C+w;return i.createElement("div",{className:"direct-debit-container"},i.createElement("div",{className:"secton-title-dd padding-top"},"Instruction to your bank or building society to pay direct debit"),i.createElement("div",{className:"agreement"},i.createElement("p",{className:"accept"},"I accept a loan to pay for the Total Amount Payable mentioned below."),i.createElement("div",{className:"prices"},i.createElement("div",{className:"row"},i.createElement("div",null,"Total Premiums"),i.createElement("div",null,"£",C.toFixed(2))),i.createElement("div",{className:"row"},i.createElement("div",null,"Less Deposit to ",k),i.createElement("div",null,"£",f.toFixed(2))),i.createElement("div",{className:"row"},i.createElement("div",null,"Premium on Finance"),i.createElement("div",null,"£",w.toFixed(2))),i.createElement("div",{className:"row"},i.createElement("div",null,"Add Installment charge at ",b,"%"),i.createElement("div",null,"£0.00")),i.createElement("div",{className:"row"},i.createElement("div",null,"TOTAL AMOUNT PAYABLE"),i.createElement("div",null,"£",S.toFixed(2))),i.createElement("div",{className:"row"},i.createElement("div",null,"MONTHLY AMOUNT PAYABLE (payable by ",y," equal monthly instalments)"),i.createElement("div",null,"£",v.toFixed(2))))),i.createElement("div",{className:"secton-title-dd padding-top"},"DECLARATION"),i.createElement("div",null,"By signing this declaration, I the customer declare that:"),i.createElement("ol",null,i.createElement("li",null,"The details I have provided in accepting this loan are true and complete and may be verified by you."),i.createElement("li",null,"I understand to notify ",k," of any changes in my circumstances which may affect this credit transaction. "),i.createElement("li",null,"I have given my express consent to the monitoring or recording or telephone calls referred to overleaf, including any made or carried out at the date of signing this application."),i.createElement("li",null,"I am 18 years of age or over.")),i.createElement("div",{className:"key-info padding-top"},i.createElement("p",null,i.createElement("span",{class:"pfHighlight "},"KEY INFORMATION")," - Upon failure by the Debtor to do or refrain from doing anything required under this Agreement, the Debtor will be required to make the following payments to the creditor:"),i.createElement("p",null,"Default Letter £25 : Unpaid Cheques £25 : Unpaid Direct Debits £25 : Recalling Standing Orders £10 : Appointing Collection Agency £50"),i.createElement("br",null),i.createElement("p",null,"We may charge interest at a rate not exceeding the rate of interest charged under this Agreement, on all sums overdue under this Agreement.",i.createElement("br",null)," We will charge interest from the due date for the payment until the payment is received in cleared funds. Interest is calculated on a daily basis, and is payable on demand.")),i.createElement("div",{className:"secton-title-dd padding-top"},"Instruction to your bank or building society to pay direct debit"),i.createElement("ol",null,i.createElement("li",null,"Name(s) of account holder(s): ",r+" "+o),i.createElement("li",null,"Name and full postal address of your Bank or Building Society branch:",i.createElement("div",null,i.createElement("div",null,"To: The manager"),i.createElement("div",null,"Bank or Building Society Name: ",d),i.createElement("div",null,"Address: ",p+" "+h),i.createElement("div",null,"Town: ",g),i.createElement("div",null,"Postcode: ",u))),i.createElement("li",null,"Branch Sort Code: ",s),i.createElement("li",null,"Preferred payment date after 1st instalment: ",l),i.createElement("li",null,"Bank or Building Society account number: ",m),i.createElement("li",null,"Instruction to your Bank or Building Society. ",i.createElement("br",null),"Please pay Premium Finance Limited, Bexhill Limited or PremFina Limited Direct Debits detailed in this instruction subject to the safeguards offered by The Direct debit Guarantee")),i.createElement("p",{className:"gray-heading"},"By accepting these terms, you are acknowledging this document and you are signing it electronically"),i.createElement("div",{className:"secton-title-dd"},"NO ACKNOWLEDGEMENT REQUIRED Bank and Building Societies may not accept Direct Debit Instructions for some types of account."),i.createElement("div",{className:"paragraph-padding gray-heading"},"I understand that this instruction may remain the originator and details may be passed to my Bank/Building Society electronically.",i.createElement("br",null),"You will receive the full terms and conditions in the post."),i.createElement("div",{className:"paragraph-padding"},i.createElement("div",{className:" blue-heading"},"Charges on Default"),i.createElement("div",{className:"paragraph-padding "},"The Debtor may be charged, on demand, all of our costs, charges and expenses (together with all legal costs recoverable against the Debtor) incurred by us in enforcing our rights under your Credit Agreement, including (in the event of any debt collection action) a debt collection administration fee of £25."),i.createElement("div",{className:"paragraph-padding "},"Failing to keep up to date with payments under this Credit Agreement may result in your insurance cover being terminated and may impact on your credit rating."),i.createElement("div",{className:"paragraph-padding "},"In the event of your default, there will be no rebate of policy premium."),i.createElement("div",{className:"paragraph-padding "},"Interest at the rate mentioned on any sum payable to us, under a Credit Agreement, will be payable from its due date to the date of actual payment."),i.createElement("div",{className:"paragraph-padding blue-heading"},"Important Information"),i.createElement("div",{className:"paragraph-padding "},"This is a Credit Proposal application for the provision of a loan to fund the purchase of an insurance product."),i.createElement("div",{className:"paragraph-padding "},"After signing this proposal, you will receive the full Credit Agreement direct from the Creditor, which you should sign and return."),i.createElement("div",{className:"paragraph-padding "},"The Creditor will carry out an assessment of this application via a Credit Reference Agency. By your signature below, You are giving authority for this search to be performed and by applying for this credit, you consent to your data being passed to the Creditor so they may assess your application."),i.createElement("div",{className:"paragraph-padding "},"If you wish to cancel the Credit Agreement within 14 days of receipt of the documentation, you will have to pay the Motor Dealer / Broker, in full, for any insurance’s that were to be funded by the Credit Agreement."),i.createElement("div",{className:"paragraph-padding "},"Using a Credit Agreement may result in the total cost of the products you are buying being more expensive than if you paid by another method."),i.createElement("hr",null),i.createElement("div",{className:"paragraph-padding blue-heading"},"Early Settlement"),i.createElement("div",{className:"paragraph-padding "},"You can settle your Credit Agreement at any time by giving notice in writing and paying off the amount you owe under the agreement.")))},v=function(){var e=(0,c.D)(),t=e.premiumFundingDetails,a=e.selectTypeOfPayment,n=e.typeOfPayment,r=e.purchaseLoading,l=e.stripeClientSecret,o=(e.dateOfBirthUnformatted,e.customerData),s=(o.firstname,o.lastname),m=(o.email,o.address,o.mobile,o.addressList,o.postcode,t.ShowPaymentTypeSelector,t.MinDepositAmount),d=t.MonthlyPayable,u=t.DepositTerm,p=(t.APR,t.TotalCost),h=(0,i.useState)(!1),E=h[0],v=h[1];return(0,i.useEffect)((function(){E?document.body.style.overflow="hidden":E||(document.body.style.overflow="unset")}),[E]),(0,i.useEffect)((function(){}),[s]),i.createElement("div",{className:"payment-frequency-container padding-top"},i.createElement("h3",{className:"heading-pf"},"Payment Frequency: ","fullPayment"===n?"Full Payment":"Monthly Payments"),i.createElement("div",{className:"premium-funding"},i.createElement("div",{className:"fullPayment"===n?"dark-payment":"light-payment","data-type":"fullPayment",onClick:a},i.createElement("h4",{className:"no-margin-bottom","data-type":"fullPayment"},"A one-off payment"),i.createElement("div",{className:"small-padding-bottom","data-type":"fullPayment"},"Full Payment Today"),i.createElement("div",{className:"break-line","data-type":"fullPayment"}),i.createElement("div",{className:"small-padding-top","data-type":"fullPayment"},"Pay £",p.toFixed(2)," now"),i.createElement("span",null),i.createElement("input",{type:"radio",className:"pay-input cursor-pointer",value:"fullPayment",onChange:a,checked:"fullPayment"===n,name:"payment"})),i.createElement("div",{className:"directDebit"===n?"dark-payment":"light-payment","data-type":"directDebit",onClick:a},i.createElement("h4",{"data-type":"directDebit"},"Deposit of £",m.toFixed(2)," then ",u," monthly payments of £",d.toFixed(2)),i.createElement("button",{className:"finance-disclosure",onClick:function(){return v(!0)},"data-type":"directDebit"},"Finance Disclosure"),i.createElement("input",{type:"radio",className:"pay-input cursor-pointer",value:"directDebit",name:"payment",onChange:a,checked:"directDebit"===n}))),i.createElement("div",{className:"pf-small"},i.createElement("span",null,"You’ve selected the ",i.createElement("b",null,"fullPayment"===n?"full payment":"monthly payments")," option.",i.createElement("br",null),"If you'd like to switch to ","fullPayment"===n?"monthly payments":"full payment",", simply click on it and proceed to the payment details.")),E&&i.createElement(g.Z,{openModal:v,isModalOpen:E,paymentButtonLabel:r&&!l?i.createElement("span",{"data-uk-spinner":"ratio: .5",className:"button-spinner "}):"Complete payment"},i.createElement(f,null)))},y=a(4517),b=a(886),N=a(1424),w=function(e){var t=e.products,a=(0,i.useState)(""),n=a[0],r=a[1],l=(0,c.D)(),o=(l.decreaseStep,l.cart),s=l.increaseStep,m=l.totalCost,d=l.hireRewardQuestions,u=d.firstQuestion,p=d.secondQuestion,h=d.thirdQuestion,g=[],E={};if(0!==Object.keys(t).length){try{!1===u&&!1===p&&!0===h&&(t.gap=t.gap.filter((function(e){return e.ProducGroupTitle.includes("Combination Shortfall Insurance")}))),!0===u&&!1===p&&!0===h&&(t.gap=t.gap.filter((function(e){return e.ProducGroupTitle.includes("Combination Shortfall Hire")}))),!0===p&&!1===h&&(t.gap=t.gap.filter((function(e){return e.ProducGroupTitle.match(/Contract Hire (and|&|And) Leasing Gap+/g)}))),!0===p&&!0===h&&(t.gap=t.gap.filter((function(e){return e.ProducGroupTitle.includes("Combined GAP and RTI")})))}catch(n){}"gap"in t&&Object.keys(t.gap).length&&(E.gap=t.gap),"mbi"in t&&Object.keys(t.mbi).length&&(E.mbi=t.mbi),"cosmetic"in t&&Object.keys(t.cosmetic).length&&(E.cosmetic=t.cosmetic),"alloy"in t&&Object.keys(t.alloy).length&&(E.alloy=t.alloy),"excess"in t&&Object.keys(t.excess).length&&(E.excess=t.excess),"tyre"in t&&Object.keys(t.tyre).length&&(E.tyre=t.tyre);var f=Object.values(E),v=[];f.map((function(e){var t=(0,y.vM)("ProducGroupTitle",e);v.push(t)})),g=v.filter((function(e){return 0!==Object.keys(e).length}))}else g=[];return i.createElement("div",{className:"products-list padding-top",id:"product-list"},i.createElement("h3",{className:"prod-list-heading"},"Select products"),i.createElement("div",{className:"prod-list-description"},"Whether your vehicle needs protecting, reparing or replacing, you've come to the right place. Take a look at the range of policies we offer."),i.createElement("div",{className:0!==g.length?"products uk-child-width-1-1@s uk-child-width-1-2@l uk-grid space-between":"products uk-child-width-1-1@s uk-grid space-between","uk-grid":"true"},g.length&&0!==Object.keys(g[0]).length?i.createElement(i.Fragment,null,g.map((function(e,t){for(var a in e)e[a]=(0,y.vM)("claim_limit",e[a]);var n=Object.values(Object.values(Object.values(e)[0])[0])[0].Origin;return i.createElement(b.Z,{props:e,origin:n,radioName:t,key:t})}))):i.createElement("div",{className:"no-products-fetched"},i.createElement("p",{style:{fontWeight:"bold"}},"No product match your search criteria, please try again or contact us! "))),n?i.createElement("div",{className:"padding-top color-red"},n):"",i.createElement("div",{className:"buttons-container-products small-padding container-fixed"},i.createElement("div",{className:"buttons-container-content"},i.createElement("div",{className:"bottom-price"},i.createElement("div",{className:"title"},"Your quote: "),i.createElement("div",{className:"price"},"£",null==m?void 0:m.toFixed(2)," ",i.createElement("span",null,"inc IPT"))),0!==Object.keys(E).length?i.createElement("button",{type:"button",className:"green-btn margin-right",onClick:function(){return 0!==o.length?(s(),r(""),void 0!==window&&window.scrollTo({top:0,behavior:"smooth"})):r("You have to add a product to your basket to continue!"),void("undefined"!=typeof window&&void 0!==window.gtag&&window.gtag("event","checkout_first_step",{event_category:"ecommerce","event-label":"Completed"}))}},"Next ",i.createElement(N.fNt,{size:24})):"")))},k=a(6125),C=a(7416),S=function(){var e=(0,c.D)(),t=e.customerData,a=t.firstname,n=t.lastname,r=t.postcode,l=t.email,o=t.mobile,m=e.changeStep;return i.createElement(i.Fragment,null,i.createElement("div",{className:"your-details-sidebar"},a&&n?i.createElement("div",null,a," ",n):a?i.createElement("div",null,a):n?i.createElement("div",null,n):"",l?i.createElement("div",null,l," "):"",o?i.createElement("div",null,o):"",r?i.createElement("div",null,r):"",i.createElement("div",{className:"sideline-edit-info"},i.createElement("div",{style:{visibility:"hidden"}}),i.createElement("div",{onClick:function(){return m(1)},className:"edit"}," ",i.createElement(s.ffH,null)," Edit Details"))))},D=a(2896),P=a(3645),x=function(e){var t=e.editFunction,n=(0,i.useState)(!1),r=n[0],l=n[1],o=(0,i.useState)(""),m=o[0],u=o[1],h=(0,c.D)(),f=h.customerData,v=f.mileage,y=f.vehicleValue,b=f.vehicleMake,N=f.vehicleModel,w=(f.wheelType,f.engineCC),x=(f.registrationDate,f.firstname),O=f.lastname,F=f.email,T=f.mobile,M=f.postcode,A=f.regNo,I=(h.changeStep,h.checkoutStep),L=h.cart,V=(h.resetQuestionChecked,h.groupedByOriginProducts),B=h.handleDate,Z=h.addProductSidebar,R=h.stripeClientSecret,q=h.selectedProductsUnformattedDate,Q=h.finIDDfetchResult,Y=(0,i.useState)(!1),_=Y[0],G=Y[1],U=(0,i.useState)(!1),j=U[0],z=U[1];(0,i.useEffect)((function(){N&&N&&v&&y&&w&&G(!0)}),[N,N,v,y,w]);var H={MBI:"Vehicle Warranty Insurance","Alloy Wheel":"Alloy Insurance",Tyre:"Complete Wheel Insurance","Cosmetic Repair":"Cosmetic Insurance",Excess:"Excess Insurance","Finance Gap":"Gap Insurance","Return to Invoice":"Gap Insurance"};return(0,i.useEffect)((function(){E.insuranceOptions.filter((function(e){return e.shortOrigin in V&&0!==V[e.shortOrigin].length})).map((function(e,t){0!==L.filter((function(t){return t.Origin.toLowerCase()===e.origin.toLowerCase()||("Return to Invoice"===t.Origin||"Finance Gap"===t.Origin)&&"gap"===e.shortOrigin})).length?e.addedToCart=!0:e.addedToCart=!1,E.insuranceOptions.sort((function(e,t){return t.addedToCart?1:-1}))}))}),[L]),E.insuranceOptions.filter((function(e){return e.shortOrigin in V&&0!==V[e.shortOrigin].length})).map((function(e,t){0!==L.filter((function(t){return t.Origin.toLowerCase()===e.origin.toLowerCase()||("Return to Invoice"===t.Origin||"Finance Gap"===t.Origin)&&"gap"===e.shortOrigin})).length?e.addedToCart=!0:e.addedToCart=!1,E.insuranceOptions.sort((function(e,t){return e.origint.origin?1:0})),E.insuranceOptions.sort((function(e,t){return t.addedToCart?1:-1}))})),i.createElement("div",{className:"sidebar"},i.createElement("ul",{className:"uk-switcher uk-margin accordion-right-side"},i.createElement("li",{className:"uk-active"},i.createElement("ul",{className:"uk-accordion","uk-accordion":"true"},_?i.createElement("li",{className:1===I?"item-accordion uk-open":"item-accordion"},i.createElement("a",{className:"uk-accordion-title accordion-title",href:"#"},"Your vehicle"),i.createElement("div",{className:"uk-accordion-content content-padding"},i.createElement("div",{className:"your-vehicle-container"},i.createElement("div",{className:"sidebar-regno"},i.createElement("div",{className:"regno-parent"},i.createElement("div",{className:"flag-container"},i.createElement(k.S,{src:"../../assets/gb-flag-2.png",alt:"Great Britain Flag",height:20,width:20,__imageData:a(2795)}),i.createElement("div",null,"GB")),i.createElement("div",{className:"regno"},A.toUpperCase()))),i.createElement("div",{className:"vehicle-model"},b+" "+N),i.createElement("div",{className:"vehicle-info"},"Engine cc ",w),i.createElement("div",{className:"vehicle-info"},v," Miles"),i.createElement("div",{className:"vehicle-info"},"Current Value £",y),i.createElement("div",{className:"sideline-edit-info"},i.createElement("div",{style:{visibility:"hidden"}}),i.createElement("div",{onClick:function(){return t(!0)},className:"edit"}," ",i.createElement(s.ffH,null)," Edit Details"))))):"",x||O||T||F||M?i.createElement("li",{className:"item-accordion"},i.createElement("a",{className:"uk-accordion-title accordion-title",href:"#"},"Your details"),i.createElement("div",{className:"uk-accordion-content content-padding"},i.createElement(S,null))):"",0!==Object.keys(V).length?i.createElement("li",{className:1!==I?"item-accordion uk-open":"item-accordion"},i.createElement("a",{className:"uk-accordion-title accordion-title",href:"#"},"Products"),i.createElement("div",{className:"uk-accordion-content"},E.insuranceOptions.filter((function(e){return e.shortOrigin in V&&0!==V[e.shortOrigin].length})).map((function(e,t){return i.createElement("div",{key:t},i.createElement("div",{className:"insurance-option"},i.createElement(i.Fragment,null,i.createElement("div",{style:{display:"flex"}},i.createElement("div",{className:"checkbox-green-container"},0!==L.filter((function(t){return t.Origin.toLowerCase()===e.origin.toLowerCase()||("Return to Invoice"===t.Origin||"Finance Gap"===t.Origin)&&"gap"===e.shortOrigin})).length?i.createElement(i.Fragment,null,i.createElement("input",{checked:"true",type:"checkbox"})):i.createElement("input",{type:"checkbox",disabled:"true"}),i.createElement("span",{className:"checkmark"})),i.createElement("span",{className:"sidebar-title"},e.title)),i.createElement("span",{className:"add-product",onClick:function(){0===I?Z(e.origin):(l(!0),u(e.origin))}},e.addedToCart?"Change":i.createElement(i.Fragment,null,i.createElement(C.uGf,{className:"add-icon"}),"Add")))),q.map((function(t,a){var n;return t.Origin.toLowerCase()===e.origin.toLowerCase()||("Return to Invoice"===t.Origin||"Finance Gap"===t.Origin)&&"gap"===e.shortOrigin?i.createElement("div",{className:"insurance-option-details",key:a},i.createElement("div",null,i.createElement("span",null,H[t.Origin])),i.createElement("div",null,i.createElement("span",null,"£",Number(t.claim_limit).toLocaleString("en-US")," Claim Limit")),i.createElement("div",null,i.createElement("span",null,t.months_of_cover," Months of Cover")),i.createElement("div",{className:"price"},"£",null===(n=t.Price)||void 0===n?void 0:n.toFixed(2)," ",i.createElement("span",null,"inc IPT at 12%")),i.createElement("div",{className:"terms-and-conditions"},i.createElement("a",{href:t.TC,className:"TC",target:"_blank",rel:"noreferrer"},"View Policy Wording"),i.createElement("br",null),i.createElement("a",{href:t.KeyFacts,target:"_blank",rel:"noreferrer"},"View IPID"),i.createElement("br",null),i.createElement("a",{onClick:function(){return z(!0)}},"View IDD")),i.createElement("span",{className:"start-date"},"Select start date: "),i.createElement(d(),{wrapperClassName:"date-picker",selected:t.StartDate,dateFormat:"dd/MM/yyyy",id:t.PPPId,disabled:!!R,onChange:function(e){return B(e,t.PPPId)},minDate:p()().toDate()})):i.createElement("div",null)})))})))):""))),i.createElement(D.Z,{setOpenModal:l,openModal:r,originProduct:m}),j&&i.createElement(g.Z,{openModal:z,isModalOpen:j},i.createElement(P.Z,{data:Q})))},O=function(e){var t=e.price,a=e.monthlyPrice,n=e.instalments,r=e.discountValue,l=e.discountCode;return i.createElement("div",{className:"total-cost "},i.createElement("div",{className:"title"},"Your quote"),i.createElement("div",{className:"price"},"£",null==t?void 0:t.toFixed(2)," ",i.createElement("span",null,"inc IPT")),a&&n?i.createElement("div",{className:"monthly-price"},"or ",n," monthly payments of £",a):"",(r&&r)>0?i.createElement("div",{className:"discount-info"},"Discount applied: £",r):!l||""===l||0!==r&&null!==r?"":i.createElement("div",{className:"discount-info"},"The code you entered is not valid or expired"))},F=a(9425),T=a(2775),M=a(6785),A=function(){var e=(0,i.useState)(!1),t=(e[0],e[1],(0,c.D)()),r=t.customerData,o=r.regNo,m=r.mileage,u=r.vehicleValue,p=r.registrationDate,h=r.engineCC,g=r.vehicleMake,E=r.tyresType,f=r.vehicleModel,v=r.categoryType,y=r.dateOfPurchase,b=t.hireRewardQuestions,N=b.firstQuestion,w=b.secondQuestion,C=b.thirdQuestion,S=t.updateCustomerDetails,D=(t.getQuoteWithDefaultCustomerValues,t.getQuote),P=t.clearCart,x=t.loading,O=t.searchRegNoInProgress,A=t.searchRegNo,I=(t.displayEngineAndDateFlag,t.updateHireRewardQuestions),L=t.changeRegistrationDate,V=t.getPurchaseDate,B=(0,i.useState)("undefined"!=typeof window&&window.sessionStorage.getItem("redirectFlagVehicle")?JSON.parse(sessionStorage.getItem("redirectFlagVehicle")):""),Z=B[0],R=(B[1],function(){var e=(0,n.Z)(l().mark((function e(){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,D();case 2:0==Z&&P(),(0,M.Z)("#product-list");case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}());sessionStorage.setItem("hireRewardQuestions",JSON.stringify({firstQuestion:N,secondQuestion:w,thirdQuestion:C}));var q=(0,i.useState)(""),Q=q[0],Y=q[1],_=(0,i.useState)(!0),G=_[0],U=_[1];(0,i.useEffect)((function(){j()}),[o,g,f,O]),(0,i.useEffect)((function(){j()}),[N,w,C]);var j=function(){var e=!1;/(^[a-zA-Z]{2}( ){0,1}[0-9]{2}( ){0,1}[a-zA-Z]{3}$)|(^[a-zA-Z][0-9]{1,3}( ){0,1}[a-zA-Z]{3}$)|(^[a-zA-Z]{3}( ){0,1}[0-9]{1,3}[a-zA-Z]$)|(^[0-9]{1,4}( ){0,1}[a-zA-Z]{1,2}$)|(^[0-9]{1,3}( ){0,1}[a-zA-Z]{1,3}$)|(^[a-zA-Z]{1,2}( ){0,1}[0-9]{1,4}$)|(^[a-zA-Z]{1,3}( ){0,1}[0-9]{1,3}$)/.test(o.toUpperCase())?(Y(""),e=!0):(e=!1,Y("Please enter a valid registration number.")),1==G&&e&&!O&&""!=f&&""!==o&&""!=g&&""!=h&&""!=E&&""!=m&&""!=u&&(U(!1),Y(""),R()),""==g&&Y("Vehicle Make is required"),""==f&&Y("Vehicle Model is required"),""!=f&&""!==o&&""!=g&&Y("")};return i.createElement("div",null,i.createElement("h1",{className:"LCS"!="smh".toUpperCase()?"":"row-hidden"},"Your vehicle"),i.createElement("form",{className:"vehicle-details-container-v2"},i.createElement("div",{className:"extra-details"},i.createElement("div",{className:"regno"},i.createElement("div",{className:"flag-container"},i.createElement(k.S,{src:"../../assets/gb-flag-2.png",alt:"Great Britain Flag",height:20,width:20,__imageData:a(2795)}),i.createElement("div",null,"GB")),i.createElement("div",{className:"placeholder-flag","data-placeholder":"Registration Number"},i.createElement("input",{type:"text",id:"registration-number",className:Q.includes("registration")&&""!=o?"regNo-input-error input-width":"regNo-input input-width",onChange:function(e){U(!0),P(),function(e){S(e)}(e)},value:o.toUpperCase(),name:"regNo"})),i.createElement("div",null,i.createElement("span",{className:"regno-search-icon",onClick:A},O?i.createElement(s.fCD,{size:24,className:"spinner-animation"}):i.createElement(s.U41,{className:"",size:24})))),i.createElement("div",null,i.createElement("div",{className:"placeholder-normal","data-placeholder":"Registration Date"},i.createElement(d(),{wrapperClassName:"date-picker input-width",selected:p,dateFormat:"dd/MM/yyyy",onChange:L})))),i.createElement("div",{className:"extra-details"},i.createElement("div",{className:"placeholder-normal","data-placeholder":""!=g||""===o||O?"Vehicle Make":"Vehicle Make required"},i.createElement("input",{type:"text",value:g,name:"vehicleMake",onChange:S,className:""==g&&Q.includes("make")&&""!==o?"error-input-width":"input-width"})),i.createElement("div",{className:"placeholder-normal","data-placeholder":""!=f||""===o||O?"Vehicle Model":"Vehicle Model required"},i.createElement("input",{type:"text",value:f,name:"vehicleModel",onChange:S,className:""==f&&Q.includes("model")&&""!==o?"error-input-width":"input-width"}))),i.createElement("div",{className:"extra-details"},i.createElement("div",{className:"regno"},i.createElement("div",{className:"placeholder-normal","data-placeholder":"Date of purchase"},i.createElement(d(),{wrapperClassName:"date-picker input-width",selected:y,onSelect:V,dateFormat:"dd/MM/yyyy"}))),i.createElement("div",null,i.createElement("div",{className:"placeholder-normal","data-placeholder":"Category Type"},i.createElement("select",{className:"input-width indent-property",name:"categoryType",value:v,onChange:S},i.createElement("option",{className:"tyre-option",value:"Car"},"Car"),i.createElement("option",{className:"tyre-option",value:"LCV"},"LCV"),i.createElement("option",{className:"tyre-option",value:"Motorbike"},"Motorbike"),i.createElement("option",{className:"tyre-option",value:"Moped/Scooter"},"Moped/Scooter"),i.createElement("option",{className:"tyre-option",value:"Motorhome"},"Motorhome"),i.createElement("option",{className:"tyre-option",value:"Caravan"},"Caravan"),i.createElement("option",{className:"tyre-option",value:"HCV"},"HCV"),i.createElement("option",{className:"tyre-option",value:"PSV"},"PSV"),i.createElement("option",{className:"tyre-option",value:"Taxi"},"Taxi"),i.createElement("option",{className:"tyre-option",value:"SPV"},"SPV"))))),i.createElement("div",{className:"extra-details"},i.createElement("div",{className:"placeholder-normal","data-placeholder":"Tyres Type"},i.createElement("select",{className:"input-width webkit-class",id:"form-stacked-select",name:"tyresType",value:E,onChange:S},i.createElement("option",{value:1,className:"tyre-option"},'Under 18"'),i.createElement("option",{value:2,className:"tyre-option"},'Over 18"'))),i.createElement("div",{className:"placeholder-normal","data-placeholder":"Engine CC"},i.createElement("input",{type:"text",value:h,name:"engineCC",className:"input-width",onChange:S}))),i.createElement("div",{className:"extra-details"},i.createElement("div",{className:"placeholder-normal","data-placeholder":"Vehicle Value"},i.createElement("input",{type:"text",id:"vehicle-value",value:u,className:"currency-input",name:"vehicleValue",onChange:S})),i.createElement("div",{className:"placeholder-normal","data-placeholder":"Vehicle Mileage"},i.createElement("input",{type:"text",id:"current-mileage",name:"mileage",className:"input-width",value:m,onChange:S}))),i.createElement("div",{className:"form-row-inline "+("LCS"!="smh".toUpperCase()?"":"row-hidden")},i.createElement(F.Z,{value:N,changeState:I,name:"firstQuestion"}),i.createElement("div",{className:"switch-question"},"Will you be using this vehicle for Hire & Reward purposes?"),i.createElement("div",{className:"tooltip"},i.createElement(T.K1g,{color:"#667fd1",fontSize:"18px"}),i.createElement("p",{className:"tooltiptext"},i.createElement("span",null,"Means the use of the Vehicle as a Taxi, Driving School, Courier or racing, pace-making, speed testing, reliability trials, rallying, or Vehicles used for any other competitive event.")))),i.createElement("div",{className:"form-row-inline "+("LCS"!="smh".toUpperCase()?"":"row-hidden")},i.createElement(F.Z,{value:w,changeState:I,name:"secondQuestion"}),i.createElement("div",{className:"switch-question"},"Did you purchase this vehicle from a Motor Dealer/ Internet Broker/ Leasing Company less than 180 days ago?")),i.createElement("div",{className:"form-row-inline "+("LCS"!="smh".toUpperCase()?"":"row-hidden")},i.createElement(F.Z,{value:!C,changeState:I,name:"thirdQuestion"}),i.createElement("div",{className:"switch-question"},"Did you purchase this vehicle on a Contract Hire or Leasing Agreement?")),i.createElement("button",{type:"button",className:"vehicle-form-button",onClick:Q?null:R},x?i.createElement("div",{"data-uk-spinner":!0}):i.createElement("span",null,"See products"))),Q&&""!=o&&i.createElement("div",{className:"regno-error"},Q))},I=a(6810);function L(e,t){var a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(a)return(a=a.call(e)).next.bind(a);if(Array.isArray(e)||(a=function(e,t){if(!e)return;if("string"==typeof e)return V(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);"Object"===a&&e.constructor&&(a=e.constructor.name);if("Map"===a||"Set"===a)return Array.from(e);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return V(e,t)}(e))||t&&e&&"number"==typeof e.length){a&&(e=a);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function V(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a0)E.some((function(e){return""===e.MonthlyPrice}))||(be=E.reduce((function(e,t){return(e+parseFloat(t.MonthlyPrice)).toFixed(2)}),0),Ne=E[0].Instalments)}catch(me){console.error("Something went wrong:",me.message)}return i.createElement(i.Fragment,null,i.createElement("div",{className:"vehicle-checkout-content padding-top padding-bottom "+(3!==P?"uk-grid":""),"uk-grid":3!==P?"true":"false"},i.createElement("div",{className:"left-side-comp uk-first-column no-padding-left "+(3!==P?"uk-width-3-4@l uk-width-3-5@s":"")},0===P?i.createElement("div",null,ce?i.createElement(A,null):"",D?i.createElement("p",{className:"error"},"Something gone wrong...Please check that all fields are filled in."):"",0!==g.length?i.createElement(w,{products:g}):""):"",1===P?i.createElement(i.Fragment,null,i.createElement(_,null),i.createElement(h,null),i.createElement("div",{className:"buttons-container padding-top padding-bottom"},i.createElement("button",{type:"button",className:"back",onClick:function(){return de(""),void C()}}," ",i.createElement(N.PjY,{size:24})," Go back"),i.createElement("button",{type:"button",className:"green-btn",onClick:function(){return Ce(P)},disabled:!!pe,id:"top"},pe?i.createElement("div",{className:"spinner-quote","data-uk-spinner":!0}):i.createElement("span",null,"Next",i.createElement(N.fNt,{size:24}))))):"",2===P?i.createElement(i.Fragment,null,M!==L.length+1?i.createElement(B,null):"",G.ShowPaymentTypeSelector&&!J&&M===L.length+1?i.createElement(i.Fragment,null,i.createElement(v,null),"fullPayment"===ee?i.createElement("div",{className:"buttons-container padding-top padding-bottom"},i.createElement("button",{type:"button",className:"back",onClick:C}," ",i.createElement(N.PjY,{size:24})," Go back"),i.createElement("button",{type:"button",className:"green-btn",onClick:function(){return Ce(P)},disabled:!!pe},pe?i.createElement("div",{className:"spinner-quote","data-uk-spinner":!0}):i.createElement("span",null,"Go to payment",i.createElement(N.fNt,{size:24})))):i.createElement("div",null)):M!==L.length+1?i.createElement("div",{className:"buttons-container padding-top padding-bottom"},i.createElement("button",{type:"button",className:"back",onClick:C}," ",i.createElement(N.PjY,{size:24})," Go back")):i.createElement("div",null),K?i.createElement("div",{className:"spinner-container"},i.createElement("svg",{className:"spinner",viewBox:"0 0 50 50"},i.createElement("circle",{className:"path",cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:5}))):"",J?i.createElement("div",{className:"payment-form1"},i.createElement(R.Elements,{stripe:ye,options:Se},i.createElement(U,{clientSecret:J,increaseStep:b}),i.createElement("div",{className:"no-padd-left-payment"},i.createElement("div",{className:"payment-methods no-padding-left"},i.createElement(k.S,{src:"../../assets/stripe_powered2.png",alt:"stripe",className:"stripe",width:"350",height:110,__imageData:a(9972)}),i.createElement("div",{className:"payment-methods-media uk-flex uk-flex-nowrap"},i.createElement("img",{src:j.Z,alt:"Mastercard",className:"payment-card2"}),i.createElement("img",{src:z.Z,alt:"Visa",className:"payment-card2"}),i.createElement("img",{src:H.Z,alt:"American Express",className:"payment-card2"}),i.createElement("img",{src:W.Z,alt:"Apple Pay",className:"payment-card2"}),i.createElement("img",{src:$.Z,alt:"Google Pay",className:"payment-card2"})))),i.createElement("div",{className:"buttons-container padding-top padding-bottom"},i.createElement("button",{className:"back",onClick:T}," ",i.createElement(N.PjY,{size:24})," Go back")))):"","directDebit"===ee&&M===L.length+1?i.createElement(q.Z,null):""):"",3===P?i.createElement(i.Fragment,null,i.createElement(Q.Z,{purchaseCode:X,formStep:P,onFeedbackSubmit:function(e){ne(e)},feedbackQuestions:re})):"",me?i.createElement("div",{className:"padding-top color-red"},me):""),3!==P?i.createElement("div",{className:"right-side-comp uk-width-1-4@l uk-width-2-5@s"},P>=1?i.createElement(i.Fragment,null):"",i.createElement(O,{price:f,monthlyPrice:be,instalments:Ne,discountValue:we,discountCode:le}),i.createElement(x,{editFunction:function(){oe(!0),ae(0)}})):""))}},2795:function(e){e.exports=JSON.parse('{"layout":"constrained","backgroundColor":"#080808","images":{"fallback":{"src":"/static/e667999048e9c8c5c5610d1d33908e52/c0289/gb-flag-2.png","srcSet":"/static/e667999048e9c8c5c5610d1d33908e52/c0289/gb-flag-2.png 20w,\\n/static/e667999048e9c8c5c5610d1d33908e52/5d536/gb-flag-2.png 512w","sizes":"(min-width: 20px) 20px, 100vw"},"sources":[{"srcSet":"/static/e667999048e9c8c5c5610d1d33908e52/391a9/gb-flag-2.webp 20w,\\n/static/e667999048e9c8c5c5610d1d33908e52/16dee/gb-flag-2.webp 512w","type":"image/webp","sizes":"(min-width: 20px) 20px, 100vw"}]},"width":20,"height":20}')}}]); //# sourceMappingURL=03425026212b100eb06ea14be8ef0aba26cbe0a6-1faf0d31ee19fc666d54.js.map