1import{a as F,b as ce,c as pe,d as me}from"./chunk-ICFYWBBT.js";import{a as xe}from"./chunk-GZ5534H5.js";import{a as ge}from"./chunk-ZQ33DIWQ.js";import{a as be}from"./chunk-G3BWSWB7.js";import{a as ue}from"./chunk-YHAXVKGT.js";import{a as se,c as le}from"./chunk-RJLHLO5O.js";import"./chunk-JEL6HJ7P.js";import{Ha as ne,Ja as ae,L as ee,Mb as re,Nc as de,U as te,Xa as oe,q as Z,sa as ie}from"./chunk-YQOD7X2Z.js";import"./chunk-563YFTIG.js";import"./chunk-36JN3LZY.js";import"./chunk-WPHW6CRH.js";import{J as X,e as C,n as J}from"./chunk-76O7YCWW.js";import{c as K,e as $}from"./chunk-YYIIKC2W.js";import{d as U,e as W}from"./chunk-3WYGUSDH.js";import"./chunk-LU7SZU5X.js";import{t as Q}from"./chunk-PO2RDVKE.js";import{Ac as p,Bc as x,Cc as G,Pb as b,Rb as g,Tb as H,Tc as k,Ub as Y,Uc as N,Vb as R,Vc as B,Wb as D,Xb as t,Yb as i,Zb as y,db as o,ec as I,jc as V,lc as l,oa as S,pa as T,pb as v,pc as j,qc as q,rc as z,ub as M,zc as r}from"./chunk-3URBZWPM.js";import{g as _e}from"./chunk-ODN5LVDJ.js";var fe=_e(xe());function ve(a,s){a&1&&(t(0,"div")(1,"div",4),y(2,"fab-loader"),i()())}function De(a,s){if(a&1&&(t(0,"div",6)(1,"div",7),y(2,"fab-notification",8),i()()),a&2){let e=l(2);o(2),D("notification",e.notification)("isNotificationOpen",e.notification.isOpened)}}function ye(a,s){if(a&1){let e=I();t(0,"div",6)(1,"landing-page",9),V("nextStage",function(){S(e);let d=l(2);return T(d.nextStage())}),i()()}if(a&2){let e=l(2);o(),D("isEligible",e.isEligible)}}function Ce(a,s){a&1&&(t(0,"p"),r(1," If you need to change your details, "),t(2,"a",13),r(3,"use the profile editor in your MyAAT dashboard"),i()())}function we(a,s){if(a&1&&(t(0,"div",6)(1,"div",10)(2,"div",11)(3,"h2")(4,"strong"),r(5,"Your personal details"),i()()(),t(6,"div",12)(7,"p")(8,"strong"),r(9,"Name"),i()(),t(10,"span"),r(11),i(),t(12,"p")(13,"strong"),r(14,"Email"),i()(),t(15,"span"),r(16),i(),t(17,"p")(18,"strong"),r(19,"Address"),i()(),t(20,"div")(21,"div"),r(22),i(),t(23,"div"),r(24),i(),t(25,"div"),r(26),i(),t(27,"div"),r(28),i(),t(29,"div"),r(30),i(),t(31,"div"),r(32),k(33,"countryName"),i()()(),t(34,"div",11),b(35,Ce,4,0,"p"),i()()()),a&2){let e=l(2);o(11),G(" ",e.contact.name.givenName," ",e.contact.name.familyName," "),o(5),x(" ",e.contact.email),o(6),x(" ",e.contactFormattedAddress.A0_streetAddressLine1," "),o(2),x(" ",e.contactFormattedAddress.A1_streetAddressLine2," "),o(2),p(e.contactFormattedAddress.A2_addressLocality),o(2),p(e.contactFormattedAddress.A3_addressRegion),o(2),p(e.contactFormattedAddress.A4_postalCode),o(2),x(" ",N(33,10,e.contactFormattedAddress.A5_addressCountry)," "),o(3),g(e.stage==1||e.stage==2&&!e.confirmationPage?35:-1)}}function Ae(a,s){if(a&1){let e=I();
1t(0,"div",6)(1,"bank-details-form",14),V("nextStage",function(){S(e);let d=l(2);return T(d.validateSubmit())})("prevStage",function(){S(e);let d=l(2);return T(d.prevStage())})("saveAddress",function(){S(e);let d=l(2);return T(d.saveAddress())})("clearBillingAddress",function(){S(e);let d=l(2);return T(d.clearBillingAddress())}),i()()}if(a&2){let e=l(2);o(),D("parentForm",e.form)("addressValues",e.billingAddressValues)("instalments",e.instalments)("isEditing",e.hasDDAccount)("updateValidation",e.updateValidation)}}function Se(a,s){a&1&&(t(0,"p"),r(1," For security purposes, your account details will be partially shown below."),y(2,"br")(3,"br"),r(4," Please note that if you have updated any of your bank details since setting up your Direct Debit, your sort code may appear as ****RD and only the last two digits of your account number will be displayed. "),i())}function Te(a,s){if(a&1&&(t(0,"div")(1,"div"),r(2),i(),t(3,"div"),r(4),i(),t(5,"div"),r(6),i(),t(7,"div"),r(8),i(),t(9,"div"),r(10),i(),t(11,"div"),r(12),k(13,"countryName"),i()()),a&2){let e=l(3);o(2),p(e.billingAddressDisplay.address1),o(2),p(e.billingAddressDisplay.address2),o(2),p(e.billingAddressDisplay.town),o(2),p(e.billingAddressDisplay.county),o(2),p(e.billingAddressDisplay.postcode),o(2),x(" ",N(13,6,e.contactFormattedAddress.A5_addressCountry)," ")}}function Pe(a,s){if(a&1&&(t(0,"div")(1,"div"),r(2),i(),t(3,"div"),r(4),i(),t(5,"div"),r(6),i(),t(7,"div"),r(8),i(),t(9,"div"),r(10),i(),t(11,"div"),r(12),k(13,"countryName"),i()()),a&2){let e=l(3);o(2),x(" ",e.billingAddressDisplay.A0_streetAddressLine1," "),o(2),x(" ",e.billingAddressDisplay.A1_streetAddressLine2," "),o(2),p(e.billingAddressDisplay.A2_addressLocality),o(2),p(e.billingAddressDisplay.A3_addressRegion),o(2),p(e.billingAddressDisplay.A4_postalCode),o(2),x(" ",N(13,6,e.billingAddressDisplay.A5_addressCountry)," ")}}function ke(a,s){if(a&1){let e=I();t(0,"div",15)(1,"app-confirm",16),V("agreeEvent",function(){S(e);let d=l(3);
1return T(d.deletionCheckbox())}),i()()}if(a&2){let e=l(3);o(),D("content",e.deleteConfirmationInterface)}}function Ee(a,s){if(a&1&&(t(0,"div",6)(1,"div",10)(2,"div",11)(3,"h2")(4,"strong"),r(5,"Your bank details"),i()(),b(6,Se,5,0,"p"),i(),t(7,"div",12)(8,"p")(9,"strong"),r(10,"Account holder\u2019s full name"),i()(),t(11,"span"),r(12),i(),t(13,"p")(14,"strong"),r(15,"Sort code"),i()(),t(16,"span"),r(17),k(18,"textToStars"),i(),t(19,"p")(20,"strong"),r(21,"Account number"),i()(),t(22,"span"),r(23),k(24,"textToStars"),i(),t(25,"p")(26,"strong"),r(27,"Billing address"),i()(),t(28,"div"),b(29,Te,14,8,"div"),b(30,Pe,14,8,"div"),i(),t(31,"p")(32,"strong"),r(33,"Number of instalments"),i()(),t(34,"span"),r(35),i()(),b(36,ke,2,1,"div",15),i()()),a&2){let e=l(2);o(6),g(e.hasDDAccount?6:-1),o(6),p(e.form.controls.account_holder.value),o(5),p(e.hasDDAccount||e.isDeleting?B(18,8,e.form.controls.sort_code.value,2):e.form.controls.sort_code.value),o(6),p(e.hasDDAccount||e.isDeleting?B(24,11,e.form.controls.account_number.value,2):e.form.controls.account_number.value),o(6),g(e.billingAddressDisplay&&e.billingAddressDisplay.address1?29:-1),o(),g(e.billingAddressDisplay&&e.billingAddressDisplay.A0_streetAddressLine1?30:-1),o(5),p(e.instalments[e.form.controls.instalments.value].name),o(),g(e.isDeleting?36:-1)}}function Ie(a,s){if(a&1&&(t(0,"div",6),y(1,"confirmation-page",17),i()),a&2){let e=l(2);o(),D("section",e.confirmationSection)("renewalPendingOrDue",e.renewalPendingOrDue)}}function Ve(a,s){if(a&1&&(t(0,"div")(1,"div",20)(2,"div",23)(3,"div",24)(4,"div",25)(5,"div")(6,"strong"),r(7),i()()()()(),t(8,"div",26)(9,"div",27)(10,"div")(11,"strong"),r(12,"Due date"),i(),t(13,"div"),r(14),k(15,"date"),i()(),t(16,"div",28)(17,"strong"),r(18,"Amount due"),i(),t(19,"div"),r(20),i()(),t(21,"div",28)(22,"strong"),r(23,"Balance"),i(),t(24,"div"),r(25),i()()()()()()),a&2){let e=s.$implicit;o(7),p(e.title),o(7),x(" ",B(15,4,e.transactionDate,"dd MMMM yyyy")," "),o(6),x("\xA3",e.amount),o(5),x("\xA3",e.outstanding)}}function Be(a,s){if(a&1&&(t(0,"div",21)(1,"div")(2,"div"),r(3),k(4,"date"),i()(),t(5,"div",22)(6,"div"),r(7),i()(),t(8,"div")(9,"div"),r(10),i()()()),a&2){let e=s.$implicit;o(3),p(B(4,3,e.date,"dd MMMM yyyy")),o(4),x("\xA3",e.amount),o(3),p(e.status)}}function Le(a,s){if(a&1&&(t(0,"div",5)(1,"div",6)(2,"div",10)(3,"div",18)(4,"h2")(5,"strong"),r(6,"Your payment schedule"),i()(),t(7,"p"),r(8,"Here is your payment schedule for your recent and upcoming instalment(s)."),i()(),t(9,"div",19),Y(10,Ve,26,7,"div",null,H),i(),t(12,"div",19)(13,"div",20)(14,"div",21)(15,"div")(16,"strong"),r(17,"Instalment(s) date"),i()(),t(18,"div",22)(19,"strong"),r(20,"Amount due"),i()(),t(21,"div")(22,"strong"),r(23,"Status"),i()()(),Y(24,Be,11,6,"div",21,H),i()()()()()),a&2){let e=l(2);o(10),R(e.transactionData),o(14),R(e.paymentData)}}function Ne(a,s){if(a&1){let e=I();t(0,"div",29)(1,"div",31),V("click",function(){S(e);let d=l(3);return T(d.prevStage())})("keydown",function(d){S(e);let c=l(3);return T(c.onBackKeyDown(d))}),t(2,"strong"),y(3,"i",32),t(4,"span"),r(5,"Back"),i()()(),t(6,"div"),y(7,"fab-button",33),i()()}if(a&2){let e=l(3);o(7),D("enabled",e.deleteEnabled)("button",e.formSubmitButton)}}function Fe(a,s){if(a&1&&(t(0,"div",30)(1,"div"),y(2,"fab-button",34),i(),t(3,"div"),y(4,"fab-button",34),i()()),a&2){let e=l(3);o(2),D("button",e.editDDButton),o(2),D("button",e.DeleteDDButton)}}function Oe(a,s){if(a&1&&(t(0,"div",5)(1,"div",6),b(2,Ne,8,2,"div",29)(3,Fe,5,2,"div",30),i()()),a&2){let e=l(2);o(2),g(e.confirmationPage?2:3)}}function He(a,s){if(a&1&&(t(0,"div",5),b(1,De,3,2,"div",6),i(),t(2,"div",5),b(3,ye,2,1,"div",6),i(),t(4,"div",5),b(5,we,36,12,"div",6),i(),t(6,"div",5),b(7,Ae,2,5,"div",6),i(),t(8,"div",5),b(9,Ee,37,14,"div",6),i(),t(10,"div",5),b(11,Ie,2,2,"div",6),i(),b(12,Le,26,0,"div",5),b(13,Oe,4,1,"div",5)),a&2){let e=l();o(),g(e.showNotification?1:-1),o(2),g(e.stage==0?3:-1),o(2),g(e.stage==1||e.stage==2?5:-1),o(2),g(e.stage==1?7:-1),o(2),g(e.stage==2?9:-1),o(2),g(e.stage==3?11:-1),o(),g(e.stage===2&&e.transactionData.length&&!e.isDeleting&&e.hasDDAccount?12:-1),o(),g(e.stage===2?13:-1)}}function Ye(a,s){if(a&1&&(t(0,"div",3),y(1,"app-two-blocks",1),i()),a&2){let e=l();
1o(),D("content",e.content)}}var Re=0,Me=1,he=2;var dt=(()=>{let s=class s{constructor(n,d,c,m,u,f,A,P,w,L){this.fb=n,this.router=d,this.route=c,this.eligibilityService=m,this.authService=u,this.contactService=f,this.directDebitService=A,this.titleService=P,this.metaService=w,this.gtmService=L,this.newTitle="Direct Debit | AAT",this.stage=Re,this.renewalPendingOrDue=!1,this.isEligible=!1,this.hasDDAccount=!1,this.confirmationPage=!1,this.isDeleting=!1,this.showNotification=!1,this.confirmationSection="create",this.isLoading=!1,this.deleteEnabled=!0,this.updateValidation=!1,this.deletePayload={billingAddress:{streetAddressLine1:null,streetAddressLine2:null,addressCountry:null,postalCode:null,addressLocality:null,addressRegion:null},directDebit:{accountHolder:null,accountNumber:null,sortCode:null,paymentSchedule:null}},this.transactionData=[],this.paymentData=[],this.standardHeroData={title:"Set up your Direct Debit",expanded:!1,toplineLink:null,authorline:null,sponsorshipDetails:null,isContentDetail:!1,isContentArticle:!1,align:"left"},this.formSubmitButton={text:"Set up Direct Debit",action:{type:"callback",callback:this.submit.bind(this)},type:"primary",aria:"Set up Direct Debit"},this.editDDButton={text:"Amend current Direct Debit",action:{type:"callback",callback:this.editAccount.bind(this)},type:"primary",aria:"Amend current Direct Debit"},this.DeleteDDButton={text:"Cancel Direct Debit",action:{type:"callback",callback:this.deleteAccount.bind(this)},type:"secondary",aria:"Cancel Direct Debit"},this.instalments=[{name:"One instalment",crmValue:"1 Instalment"},{name:"Two instalments",crmValue:"2 Instalments"},{name:"Three instalments",crmValue:"3 Instalments"},{name:"Four instalments",crmValue:"4 Instalments"}],this.notification={type:"warning",fullWidth:!0,message:`<h2><strong>Please check and confirm your details</strong></h2>Please review your personal details and the account details you've provided and confirm they're correct. If the details are correct, choose \u201CSet up Direct Debit". If you need to amend your account details, choose \u201CBack\u201D.<br><br>You may cancel this Direct Debit at any time by contacting AAT or by contacting your bank or building society.`,isOpened:!0,leftAlign:!1},this.deleteConfirmationInterface={id:"delete_confirmation",label:"Please confirm you want to cancel your Direct Debit.",required:!1,codeType:"checkbox"},this.content={title1:"<h1><strong>Do you need</strong></h1>",text1:"<h1>to speak to us?</h1>",title2:'<h4>Speak to one of our advisors: <a href="tel:+442037352468"><strong>+44 (0) 20 3735 2468</strong></a> or email <a href="mailto:[email protected]"><strong>[email protected]</strong></a>.</h4>',contact:'<p class="minor">Our telephone lines are open Monday to Friday, 09.00\u201317.00 (UK time).</p>'},this.isLoading=!0,w.addTag({name:"description",content:"Use the Direct Debit service to set up instalments to pay for your AAT membership or licence fee, view or amend your Direct Debit details, or cancel your Direct Debit."}),this.setTitle(this.newTitle),this.form=this.fb.group({account_number:"",sort_code:"",account_holder:"",instalments:["",C.required],guarantee_confirmation:["",[C.required,C.pattern("true")]],billing_address:[!1,C.required],read_guarantee_confirmation:["",[C.required,C.pattern("true")]]}),this.form.valueChanges.subscribe(_=>{}),this.route.data.subscribe(_=>{this.contact=_.contact,this.relationships=_.relationships,this.contactFormattedAddress=this.formatAddressDisplayed(this.contact.address)}),this.contact&&this.contact.directDebit&&this.contact.directDebit.accountNumber&&this.contact.directDebit.accountNumber.length>0&&(this.existingDDAccount(),this.gaPush("existing_account")),this.route.data.subscribe(_=>{this.paymentScheduleDD=this.directDebitService.getDDPayments(this.contact.contactId).subscribe(h=>{let E=JSON.parse(h);this.renewalPendingOrDue=!!(E.accountDetail&&E.accountDetail.overallBalance>0),this.parseTransactionData(E)},h=>{console.log("DDService error: ",h)})}),this.eligibilityService.geteligibilityByContact(this.contact.contactId).subscribe(_=>{_.filter(h=>{if(!h.toDate&&h.name==="Direct Debit")return!0;let E=new Date(h.toDate),O=new Date;return h.name==="Direct Debit"&&O<=E}).length>0&&(this.isEligible=!0,this.hasDDAccount||this.gaPush("is_landing")),this.isLoading=!1},_=>{console.log("eligibility error: ",_),this.isLoading=!1})}ngOnInit(){}parseTransactionData(n){let d={};if(!n||!n.transactions||!n.transactions.transaction)return;let c=n.transactions.transaction.map(u=>
1{let{transactionLines:f,transactionDate:A,amount:P,outstanding:w,payments:L}=u,_=L&&L.payment.filter(h=>h.status.indexOf("DD")>-1||h.status.indexOf("dd")>-1);return _&&_.forEach(({date:h,amount:E,status:O})=>{d[h]=d[h]||[],d[h].push({amount:Math.abs(E).toFixed(2),date:h,status:O})}),{title:f.line[0].description,transactionDate:A,amount:parseFloat(P).toFixed(2),outstanding:parseFloat(w).toFixed(2),hasPayment:_&&_.length>0}}).filter(u=>u.hasPayment),m=Object.values(d).map(u=>{let f=u.reduce((A,P)=>{let w=P.status.includes("to be collected")?"Not paid":"Paid";return P.status=w,A[w]?A[w].amount=(parseFloat(A[w].amount)+parseFloat(P.amount)).toFixed(2):A[w]=P,A},{});return Object.values(f)});m=m.flat(),this.transactionData=c,this.paymentData=m}existingDDAccount(){this.hasDDAccount=!0,this.stage=he,this.setNotification("existing_account",!0);for(let n in this.contact.billingAddress)(this.contact.billingAddress[n]===null||this.contact.billingAddress[n]===void 0)&&delete this.contact.billingAddress[n];this.form.patchValue({account_number:this.formatAccountNumber(this.contact.directDebit.accountNumber),sort_code:this.contact.directDebit.sortCode,instalments:this.instalments.findIndex(n=>n.crmValue==this.contact.directDebit.paymentSchedule),billing_address:this.contact.billingAddress&&Object.keys(this.contact.billingAddress).length&&!Object.values(this.contact.billingAddress).every(n=>n==null)&&!fe.default.isEqual(this.contact.billingAddress,this.contact.address)?"true":"false",account_holder:this.contact.directDebit.accountHolder}),this.form.controls.billing_address.value==="true"&&(this.auxAddressForm=this.fb.group({postcode:[this.contact.billingAddress.postalCode||"",C.required],address1:[this.contact.billingAddress.streetAddressLine1||"",C.required],address2:[this.contact.billingAddress.streetAddressLine2||""],town:[this.contact.billingAddress.addressLocality||""],county:[this.contact.billingAddress.addressCounty||this.contact.billingAddress.addressRegion||""],country:["",C.required],countryItem:[""],state:[""],zipcode:[""]}),this.form.addControl("address",new J("",C.required)),this.form.controls.address.patchValue(this.auxAddressForm.value),this.billingAddressDisplay=this.formatAddressDisplayed(this.contact.billingAddress),this.saveAddress()),this.billingAddressDisplay=this.billingAddressValues?this.billingAddressValues:this.contactFormattedAddress,this.standardHeroData.title="Your Direct Debit details"}validateSubmit(){this.form.valid?this.nextStage():this.checkInvalidControls()}submit(){this.formSubmitButton.glyph={icon:ee.LOOP2,glyphAnimation:"spin"},this.showNotification=!1,this.scroll();let n=Object.keys(this.form.value).length===0?this.deletePayload:this.formDataFormat(this.form.value);this.isLoading=!0,this.contactService.update(this.contact.contactId,n).subscribe(d=>(this.isLoading=!1,this.stage=++this.stage,this.standardHeroData.title="Thank you "+this.contact.name.givenName,this.formSubmitButton.glyph=null,this.confirmationSection==="amend"?this.gaPush("edit_success"):this.isDeleting?this.gaPush("delete_success"):this.gaPush("create_success"),!0),d=>(console.error("Error: ",d),this.isLoading=!1,this.formSubmitButton.glyph=null,this.isDeleting?(this.stage=he,this.setNotification("delete_error",!0),this.gaPush("delete_error")):(this.stage=Me,this.setNotification("create_error",!0),this.gaPush("create_error")),!1))}formDataFormat(n){let d={accountHolder:n.account_holder,paymentSchedule:this.instalments[n.instalments].crmValue,isAccountHolder:n.guarantee_confirmation==="true",accountNumber:n.account_number,sortCode:n.sort_code.replace(/-/g,"")},c;n.address?c={streetAddressLine1:n.address.address1||null,streetAddressLine2:n.address.address2||null,addressCountry:"GBR",postalCode:n.address.postcode||null,addressLocality:n.address.town||null,addressRegion:n.address.county||null}:c={streetAddressLine1:this.contact.address.streetAddressLine1||null,streetAddressLine2:this.contact.address.streetAddressLine2||null,addressCountry:this.contact.address.addressCountry||null,postalCode:this.contact.address.postalCode||null,addressLocality:this.contact.address.addressLocality||null,addressRegion:this.contact.address.addressRegion||null};let m=this.contact.contactId;
1return{directDebit:d,billingAddress:c,contactId:m}}nextStage(){this.scroll(),this.showNotification=!1,this.stage=++this.stage,this.stage===1&&!this.hasDDAccount&&this.gaPush("is_creating"),this.stage===2&&(this.billingAddressDisplay=this.billingAddressValues?this.billingAddressValues:this.contactFormattedAddress,this.showNotification=!0,this.confirmationPage=!0,this.hasDDAccount===!0?(this.setNotification("edit_confirmation",!0),this.gaPush("edit_confirmation")):this.gaPush("create_confirmation"))}prevStage(){this.showNotification=!1,this.hasDDAccount===!0&&!this.confirmationPage?(this.stage=++this.stage,this.existingDDAccount(),this.scroll()):this.isDeleting?(this.isDeleting=!1,this.hasDDAccount=!0,this.confirmationPage=!1,this.standardHeroData.title="Your Direct Debit details",this.scroll()):(this.confirmationPage=!1,this.stage=--this.stage,this.scroll())}editAccount(){this.scroll(),this.showNotification=!1,this.formSubmitButton.text="Amend my Direct Debit",this.form.controls.sort_code.setValue(this.formatSortCode(this.contact.directDebit.sortCode)),this.setNotification("is_editing",!0),this.gaPush("is_editing"),this.stage=--this.stage,this.standardHeroData.title="Your Direct Debit",this.confirmationSection="amend"}deleteAccount(){this.showNotification=!1,this.confirmationPage=!0,this.hasDDAccount=!1,this.isDeleting=!0,this.setNotification("is_deleting",!0),this.gaPush("is_deleting"),this.standardHeroData.title="Your Direct Debit",this.scroll(),this.formSubmitButton=Object.assign({},this.DeleteDDButton),this.formSubmitButton.action.callback=this.confirmDeletion.bind(this),this.deleteEnabled=!1}deletionCheckbox(){this.deleteEnabled=!this.deleteEnabled}confirmDeletion(){this.confirmationSection="delete",this.form=this.fb.group({}),this.deletePayload.contactId=this.contact.contactId,this.submit(),this.scroll()}checkInvalidControls(){let n=this.form.controls,d=null,c=120;for(let m in n)if(n[m]&&(n[m].invalid&&n[m].errors&&n[m].errors.required&&(n[m].markAsTouched({onlySelf:!0}),this.updateValidation=!0,d||(d=document.getElementById(m))),m==="instalments"&&!d&&this.form.controls.address)){let u=this.formComponent.toArray()[0].postcodeLookupComponent.toArray()[0].formgroup.controls;for(let f in u)u[f]&&(u[f].invalid&&u[f].errors&&u[f].errors.required&&(u[f].markAsTouched({onlySelf:!0}),u[f].markAsDirty({onlySelf:!0}),d||(d=document.getElementById("billing_address_box"))),f==="postcode"&&u[f].valid&&!this.formComponent.toArray()[0].postcodeLookupComponent.toArray()[0].isActive&&(this.formComponent.toArray()[0].postcodeLookupComponent.toArray()[0].searchPostcode(),u.dropDownAddressControl.setErrors({formControlValidationErrors:{value:"Select your address or click or enter address manually"}}),u.dropDownAddressControl.markAsTouched({onlySelf:!0}),d||(d=document.getElementById("billing_address_box"))))}d&&this.scroll(d.offsetTop-c)}saveAddress(){for(let n in this.form.controls.address.value)this.form.controls.address.value[n]!==""&&(this.billingAddressValues=this.form.controls.address.value);this.billingAddressDisplay=this.billingAddressValues}formatAddressDisplayed(n){return{A0_streetAddressLine1:n?.streetAddressLine1||null,A1_streetAddressLine2:n?.streetAddressLine2||null,A2_addressLocality:n?.addressLocality||null,A3_addressRegion:n?.addressRegion||null,A4_postalCode:n?.postalCode||null,A5_addressCountry:n?.addressCountry||null}}formatSortCode(n){if(n.length==6)return n.substring(0,2)+"-"+n.substring(2,4)+"-"+n.substring(4,6)}formatAccountNumber(n){let d=n;return d.length<8&&(d=d.padStart(8,"*")),d}setNotification(n,d){switch(d&&(this.showNotification=d),n){case"create_error":this.notification.message="<h2><strong>Direct Debit set up failed</strong></h2>Please check the details provided are correct",this.notification.type="error";break;case"existing_account":this.notification.message="<h2><strong>You can view your Direct Debit details below</strong></h2><p>You can make amends to your current Direct Debit or cancel your Direct Debit by clicking on the options below.</p>",this.notification.type="status";break;case"is_editing":this.notification.message=`<h2><strong>You can amend your Direct Debit details below</strong></h2><p>You can amend your bank details and your instalments below. Please note if you request to amend your instalments and have an active payment schedule your new number of instalments will be applied to your next payment schedule.</p><br>If you aren't the current account holder, or if more than one person is required to authorise debits from the account, you'll need to <a target="_blank" href="https://www.aat.org.uk/prod/s3fs-public/assets/AAT-register-pay-Direct-Debit-form.pdf">complete a Direct Debit Instruction form</a> and return it to us.`,this.notification.type="status";break;case"edit_confirmation":this.notification.message="<h2><strong>Please check and confirm your amended details</strong></h2><p>Please review the personal details and account details you've provided and confirm they're correct. If the details are correct, choose \u201CAmend my Direct Debit\u201D. If you need to change your account details, cho
1ose \u201CBack\u201D.</p>",this.notification.type="warning";break;case"is_deleting":this.notification.message="<h2><strong>Please check details below before cancelling your Direct Debit</strong></h2><p>Cancelling your Direct Debit will not affect your membership status and any fees due will remain outstanding.<p><p>Please review your Direct Debit details, if you want to cancel your Direct Debit, click on \u201CCancel Direct Debit\u201D. If you want to amend your Direct Debit details, go \u201CBack\u201D.</p>",this.notification.type="warning";break;case"delete_error":this.notification.message="<h2><strong>Direct Debit delete failed</strong></h2>Please contact AAT by email or phone",this.notification.type="error";break;default:break}}gaPush(n){switch(n){case"is_landing":this.gtmService.push({event:"virtualPageview",virtualPagePath:"/payments/direct-debit/vpv/setup",virtualPageTitle:"VPV Direct Debit: Setup"});break;case"is_creating":this.gtmService.push({event:"virtualPageview",virtualPagePath:"/payments/direct-debit/vpv/setup/add-details",virtualPageTitle:"VPV Direct Debit: Setup - Your Details"});break;case"create_confirmation":this.gtmService.push({event:"virtualPageview",virtualPagePath:"/payments/direct-debit/vpv/setup/confirm-details",virtualPageTitle:"VPV Direct Debit: Setup - Check and Confirm Details"});break;case"create_success":this.gtmService.push({event:"virtualPageview",virtualPagePath:"/payments/direct-debit/vpv/setup/thank-you",virtualPageTitle:"VPV Direct Debit: Setup - Thank You"});break;case"create_error":this.gtmService.push({event:"virtualPageview",virtualPagePath:"/payments/direct-debit/vpv/setup/failed",virtualPageTitle:"VPV Direct Debit: Cancel - Thank You"});break;case"existing_account":this.gtmService.push({event:"virtualPageview",virtualPagePath:"/payments/direct-debit/vpv/amend/view-details",virtualPageTitle:"VPV Direct Debit: Amend - View Your Details"});break;case"is_editing":this.gtmService.push({event:"virtualPageview",virtualPagePath:"/payments/direct-debit/vpv/amend/amend-details",virtualPageTitle:"VPV: Direct Debit Amend - Amend Your Details"});break;case"edit_confirmation":this.gtmService.push({event:"virtualPageview",virtualPagePath:"/payments/direct-debit/vpv/amend/confirm-details",virtualPageTitle:"VPV Direct Debit: Amend - Confirm Your Details"});break;case"edit_success":this.gtmService.push({event:"virtualPageview",virtualPagePath:"/payments/direct-debit/vpv/amend/thank-you",virtualPageTitle:"VPV Direct Debit: Amend - Thank You"});break;case"edit_error":break;case"is_deleting":this.gtmService.push({event:"virtualPageview",virtualPagePath:"/payments/direct-debit/vpv/cancel/confirm-details",virtualPageTitle:"VPV Direct Debit: Cancel - Confirm Details"});break;case"delete_success":this.gtmService.push({event:"virtualPageview",virtualPagePath:"/payments/direct-debit/vpv/cancel/thank-you",virtualPageTitle:"VPV Direct Debit: Cancel - Thank You"});break;case"delete_error":this.gtmService.push({event:"virtualPageview",virtualPagePath:"/payments/direct-debit/vpv/cancel/failed",virtualPageTitle:"VPV Direct Debit: Cancel - Failed"});break;default:break}}clearBillingAddress(){this.billingAddressDisplay=this.billingAddressValues=null,this.form.controls.billing_address.setValue(!1)}scroll(n=null){window.scrollTo({top:n||0,behavior:"smooth"})}onBackKeyDown(n,d,c){n.keyCode==13&&this.prevStage()}setTitle(n){this.titleService.setTitle(n)}};s.\u0275fac=function(d){return new(d||s)(v(X),v($),v(K),v(ue),v(Z),v(be),v(ge),v(W),v(U),v(te))},s.\u0275cmp=M({type:s,selectors:[["lib-direct-debit"]],viewQuery:function(d,c){if(d&1&&j(F,5),d&2){let m;q(m=z())&&(c.formComponent=m)}},decls:6,vars:3,consts:[[1,"direct-debit-page"],[3,"content"],[1,"direct-debit-page__container"],[1,"non-eligible-two-blocks"],[1,"col-lg-3","col-lg-offset-0","col-md-3","col-md-offset-1","col-sm-9","col-sm-offset-1","col-xs-12","col-xs-offset"],[1,"row"],[1,"col-lg-6","col-lg-offset-3","col-md-7","col-md-offset-2","col-sm-9","col-sm-offset-1","col-xs-12","col-xs-offset"],[1,"direct-debit-page__box--notification"],[3,"notification","isNotificationOpen"],[3,"nextStage","isEligible"],[1,"direct-debit-page__box","no-padding"],[1,"direct-debit-page__box--
1header"],[1,"direct-debit-page__box--detail-table"],["target","_blank","href","/my-account/edit-details"],[3,"nextStage","prevStage","saveAddress","clearBillingAddress","parentForm","addressValues","instalments","isEditing","updateValidation"],[1,"direct-debit-page__box--confirm-delete-row"],[3,"agreeEvent","content"],[3,"section","renewalPendingOrDue"],[1,"direct-debit-page__box--header","noTopBorder"],[1,"direct-debit-page__box----detail-noline"],[1,"rTableBorder"],[1,"grid-3","grid-2-1","small"],[1,"left"],[1,"rTableRow"],[1,"rTableCell","showBorder"],[1,"rtableTitle"],[1,""],[1,"grid-3","grid-break-down","grid-2-1","grid-large","showBorder","ddBorderTop"],[1,"number"],[1,"direct-debit-page__box--buttons"],[1,"direct-debit-page__box--buttons-existing-dd"],["tabindex","0",1,"direct-debit-page__back-link",3,"click","keydown"],[1,"icon","icon-arrow-left"],[3,"enabled","button"],[3,"button"]],template:function(d,c){d&1&&(t(0,"div",0),y(1,"fab-standard-hero",1),t(2,"div",2),b(3,ve,3,0,"div")(4,He,14,8),i()(),b(5,Ye,2,1,"div",3)),d&2&&(o(),D("content",c.standardHeroData),o(2),g(c.isLoading?3:4),o(2),g(!c.isEligible&&!c.hasDDAccount&&!c.isLoading?5:-1))},dependencies:[me,F,pe,ce,se,le,oe,re,de,ie,Q,ne,ae],styles:[`:root{--aat-ui-grey-25: #bfbfbf;--aat-ui-grey-55: #737373;--aat-slate: #3a5066;--aat-ui-grey-05: #f2f2f2}.direct-debit-page{background-color:#f9f9f9}.direct-debit-page__box{background-color:#fff;margin:0 15px 20px;padding:0 10px;border-style:solid;border-width:thin;border-color:#e6e6e6}@media (min-width: 768px){.direct-debit-page__box{margin:0 0 20px}}.direct-debit-page__box.no-padding{padding:0}.direct-debit-page__box--header{padding:20px 15px}.direct-debit-page__box--detail-table{display:grid;grid-template-columns:1fr;padding:10px 0;white-space:nowrap}@media (min-width: 768px){.direct-debit-page__box--detail-table{grid-template-columns:1fr 2fr}}.direct-debit-page__box--detail-table>p,.direct-debit-page__box--detail-table>h4,.direct-debit-page__box--detail-table>span,.direct-debit-page__box--detail-table>div{padding:10px 10px 10px 15px;border-top:thin;border-top-style:solid;border-color:#e6e6e6}.direct-debit-page__box--detail-table>p:nth-child(2n),.direct-debit-page__box--detail-table>h4:nth-child(2n),.direct-debit-page__box--detail-table>span:nth-child(2n),.direct-debit-page__box--detail-table>div:nth-child(2n){border-top-width:0}@media (min-width: 768px){.direct-debit-page__box--detail-table>p:nth-child(2n),.direct-debit-page__box--detail-table>h4:nth-child(2n),.direct-debit-page__box--detail-table>span:nth-child(2n),.direct-debit-page__box--detail-table>div:nth-child(2n){border-top-width:1px}}@media (min-width: 768px){.direct-debit-page__box--detail-table>p,.direct-debit-page__box--detail-table>h4,.direct-debit-page__box--detail-table>span,.direct-debit-page__box--detail-table>div{padding:20px}}.direct-debit-page__box--detail-table>p{margin:0;font-size:20px}.direct-debit-page__box--detail-noline{display:flex;padding:10px 20px;border-top:none;border-top-style:none;border-color:#e6e6e6;font-weight:600}.direct-debit-page__box--detail-noline p,.direct-debit-page__box--detail-noline h4{flex:1}.direct-debit-page__box--detail-noline span,.direct-debit-page__box--detail-noline div{flex:2}.direct-debit-page__box--detail-header{display:flex;padding:10px 20px;border-top:none;border-top-style:none;border-color:#e6e6e6;font-weight:600}.direct-debit-page__box--detail-header p,.direct-debit-page__box--detail-header h4{flex:1}.direct-debit-page__box--detail-header span,.direct-debit-page__box--detail-header div{flex:2}.direct-debit-page__box--edit-row,.direct-debit-page__box--confirm-delete-row{padding:20px;margin:0}.direct-debit-page__box--confirm-delete-row .confirm__wrapper{background-color:#fff;border-style:none}.direct-debit-page__box--notification{margin:0 15px 20px}@media (min-width: 768px){.direct-debit-page__box--notification{margin:0 0 20px}}.direct-debit-page__box--notification .notification--status a{color:#fff}.direct-debit-page__box--element{padding:20px 15px}.direct-debit-page__box--element li{list-style:initial;margin-left:20px}.direct-debit-page__box--element.no-padding-top{padding-top:0}.direct-debit-page__box--element.select{padding:5px 15px}.direct-debit-page__box--element .form_icon{padding-top:8px;padding-left:5px!important}@media (min-width: 1200px){.direct-debit-page__box--element .form_icon{padding-top:10px}}.direct-debit-page__box--buttons{padding:20px 0;display:flex;justify-content:space-between}.direct-debit-page__box--buttons-existing-dd{padding:30px 15px}@media (min-width: 768px){.direct-debit-page__box--buttons-existing-dd{padding:30px 0;display:flex;flex-direction:row-reverse;justify-content:space-between}}@media (min-width: 768px){.direct-debit-page__box{margin-bottom:20px;margin-top:55px}}.direct-debit-page__back-link{color:#00ab4e;font-weight:600;cursor:pointer;margin-top:30px}.direct-debit-page__back-link i{position:relative;top:2px}.direct-debit-page .standard-hero{background-color:#e6e6e6}.notification.notification--error h2{color:#fff}.table_title_header{font-weight:600;font-size:17px;white-space:nowrap}.table_title{font-weight:600;font-size:12px;white-space:nowrap}.rHeaderTitle{display:flex;padding:10px 20px;border-top:none;border-top-style:none;border-color:#e6e6e6;font-weight:400;color:#00ab4e}.rHeaderTitle h4{flex:1}.rHeaderTitle span,.rHeaderTitle div{flex:2}.rtableTitle{display:flex;padding:10px 20px;border-top:none;border-top-style:none;border-color:#e6e6e6;font-weight:400}.rtableTitle h4{flex:1}.rtableTitle span,.rtableTitle div{flex:2}.rtableSubTitle{display:flex;padding:20px;border:1px solid #f3f1f1;font-weight:400}.amountAlign{align-content:left}.rtableSubTitle{display:flex;padding:10px 20px;border-style:solid;border-width:thin;border-color:#e6e6e6;font-weight:400}.rtableSubTitle h4{flex:1}.rtableSubTitle span,.rtableSubTitle div{flex:2}.rTableNoline{display:table;border-style:none}.rTableCellnolineleft{display:flex;text-align:left;justify-content:flex-end}.rTable{display:table;width:40%!important;border-style:none;border-width:thin;border-color:#e6e6e6}.rTableDD{display:table;width:25%!important;border-style:none;border-width:thin;border-color:#e6e6e6}.rTableBorder{display:table;border-style:none;border-width:thin;border-color:#e6e6e6;padding:10px 20px;font-weight:400;width:100%;box-sizing:border-box}.rTableRow{display:table-row}.rTableRowDDStatus{display:table-row;width:100%}.rTableHeading{display:table-header-group;background-color:#ddd}.rTableCellnoline,.rTableHeadnoline{display:table-cell;padding:3px 10px;font-weight:400}.rTableCellNoline{display:table-cell;padding:3px 10px;border:0px solid #ffffff;font-weight:400}.rTableCell,.rTableHead{display:table-cell;padding:3px 10px;border:0px solid #f3f1f1;font-weight:400;text-align:left;white-space:nowrap}.rTableCellDDStatus{display:table-cell;padding:1px 5px;border:0px solid #f3f1f1;font-weight:400;text-align:left;white-space:nowrap}.rTableHeading{display:table-header-group;background-color:#ddd;font-weight:600}.rTableFoot{display:table-footer-group;font-weight:600;background-color:#ddd}.rTableBody{display:table-row-group}.showBorder{border-style:solid;border-width:thin;border-color:#e6e6e6;padding:3px 10px;text-align:left}.aligncenter{text-align:center!important}.ddBorderTop{border-top:none}.ddBorderCell{width:70px!important}.rightalign{text-align:right!important;white-space:nowrap}.leftalign{text-align:left;white-space:nowrap}.ddDateWidth{width:30px!important}.ddAmount{text-align:right;white-space:nowrap;width:250px!important}.ddDateWidth{width:250px!important}.noTopBorder{border-top:none}.maxWidth{width:100%!important}.rTableHeadDDStatus{display:table-cell;padding:3px 10px;border:0px solid #f3f1f1;font-weight:400;text-align:right!important;white-space:nowrap;width:100%}.grid-3{display:grid;padding:10px 20px;grid-template-columns:1fr 1fr 1fr}.grid-3.grid-2-1{grid-template-columns:2fr 2fr 1fr}.grid-3.grid-break-down{grid-template-columns:1fr}@media (min-width: 768px){.grid-3.grid-break-down{grid-template-columns:1fr 1fr 1fr}.grid-3.grid-break-down.grid-2-1{grid-template-columns:2fr 2fr 1fr}}.grid-3.small{padding:0}.grid-3.small>div{padding-top:15px;padding-bottom:15px}.grid-3.grid-large{padding:20px}.grid-3>div{padding:10px}.grid-3:not(.showBorder)>div{border-bottom:1px solid #f3f1f1}.grid-3 .number{text-align:left}@media (min-width: 768px){.grid-3 .number{text-align:left}}.grid-3 .left{text-align:left}.non-eligible-two-blocks{margin-bottom:-32px} 2`],encapsulation:2});let a=s;return a})();export{dt as DirectDebitComponent};
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.