PageSourceSearch

https://myaccount.southeastwater.co.uk/chunk-ABPJK4Y6.js

js southeastwater.co.uk collected 2026-10-03 21:19:33 UTC 274,949 bytes, 1 lines download raw bytes

1import{a as Ki,c as er,d as tr,e as Xt}from"./chunk-3K56RFOF.js";import{a as di,b as $i,c as Xi,d as Zi,e as Be,f as Le,g as It}from"./chunk-X5KWLEL4.js";import{a as Et}from"./chunk-77FSLFGU.js";import{a as zi}from"./chunk-RNJZGLGU.js";import{a as Qi}from"./chunk-SKN7D4C5.js";import{a as $t}from"./chunk-M3DSYCA2.js";import{a as _e}from"./chunk-GFFUDX3A.js";import{a as Ke,c as et,d as Ji}from"./chunk-6OW2AJJH.js";import{a as he}from"./chunk-EMNRMHET.js";import{a as fe}from"./chunk-A5EUQQC7.js";import{$ as h,$a as Fi,$d as se,$e as zt,Ad as ft,Ba as n,Ca as o,Cc as qt,Cd as mi,Ce as J,Da as u,Dd as G,De as ve,Ed as Y,Ee as Gi,F as be,Fc as Xe,Fd as ht,G as kt,Gc as Mi,Ge as Yt,Ha as b,He as ce,I as Tt,Ia as v,Id as Re,Ja as d,Jb as Lt,Jd as te,Kd as Ut,L as st,M as ci,Ma as k,N as lt,Na as Bt,Nd as ae,Od as Ze,Qa as A,R as He,Ra as N,Rd as Q,S as Vt,Sa as M,Sd as Li,Ta as oe,Td as gt,Te as Qt,U as me,Ua as c,Ud as Oi,Ue as de,Va as U,Ve as pe,W as O,Wa as ne,We as Fe,X as Pt,Xa as Ti,Xc as Ht,Za as Ii,Zc as dt,_a as Ri,_b as x,_d as je,aa as g,ab as Ai,ba as V,be as E,bf as Yi,cc as ct,cd as jt,ce as ie,da as xi,db as Ce,dc as Ot,de as z,eb as B,fb as T,fd as Di,fe as qi,g as Dt,ge as $,he as Hi,i as Si,ia as F,ic as mt,id as Vi,ie as vt,je as X,kd as pt,ke as Wt,ld as ut,le as Gt,ma as s,mb as q,me as re,na as f,nd as Ve,ne as _t,o as Ei,oe as yt,p as at,pb as W,pd as Pe,pe as bt,qb as ee,qe as Ue,rb as H,rd as Ie,sb as ge,se as Ct,ta as _,tb as j,ua as De,ue as St,v as Me,va as a,ve as le,wd as Pi,we as ji,x as ze,xd as K,xe as Ui,ya as wi,yd as Bi,ye as Wi,z as $e,za as ki,zc as Ni,zd as Je}from"./chunk-UKO5M5N4.js";var Jt=class{constructor(l,e,i,r,m,p,y,C,w,I,S){this.customerReference=l,this.propertyReference=e,this.contactMethod=i,this.meterKey=r,this.method=m,this.uid=p,this.changeReason=y,this.accountHolderNumber=C,this.accountHolderTitle=w,this.accountHolderInitials=I,this.accountHolderSurname=S}};var We=(()=>{let l=class l{constructor(i,r,m,p){this.http=i,this.globalSettingsService=r,this.functions=m,this.functionsInstances=p,this.baseUrl=x.baseUrl,this.nameChangeUrl=this.baseUrl+"namechangeupdate",this.globalSettings=this.globalSettingsService.getGlobalSettings(),this.globalSettingsService.globalSettingsChange.subscribe(y=>{this.globalSettings=y})}getNameChangeUpdateResponse(i,r,m,p,y,C,w,I){let S=new Jt(i,"",r,"",m,this.globalSettings?.uid,p,y,C,w,I);x.useEmulator&&Ve(this.functions,x.emulatorFunction[0],+x.emulatorFunction[1]);let D=Pe(this.functionsInstances[0],"nameChangeUpdateCF");return this.nameChangeUpdateCF$=Me(D(S)),this.nameChangeUpdateCF$}displayMeterEstimation(i){this.nameChangeUpdateResponse=i}getResults(){return this.nameChangeUpdateResponse}};l.\u0275fac=function(r){return new(r||l)(me(Lt),me(Re),me(pt),me(ut))},l.\u0275prov=He({token:l,factory:l.\u0275fac,providedIn:"root"});let t=l;return t})();var Fr=["template"],Ar=t=>({"is-invalid":t});function Nr(t,l){if(t&1){let e=b();n(0,"div",7)(1,"label",23),c(2,"Please enter your reason"),o(),u(3,"app-input-error-message",24),n(4,"input",25),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o()()}if(t&2){let e=d(2);s(3),a("displayErrorIf",e.submitted&&e.removePersonForm.get("changeReasonOther").value===""),s(),a("ngClass",B(2,Ar,e.submitted&&e.removePersonForm.get("changeReasonOther").value===""))}}function Mr(t,l){if(t&1){let e=b();n(0,"section",2)(1,"div",3)(2,"div",4)(3,"h3",5),c(4,"Remove person from account"),o(),n(5,"p"),
1c(6," Are you sure you want to remove "),n(7,"strong"),c(8),o(),c(9," from this account? "),o(),n(10,"form",6),v("ngSubmit",function(){h(e);let r=d();return g(r.removePerson())}),n(11,"div",7)(12,"fieldset")(13,"legend")(14,"h4",8),c(15," Reason for removing person from account? "),o()(),n(16,"div",9)(17,"input",10),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o(),n(18,"label",11),c(19," Bereavement"),o()(),n(20,"div",9)(21,"input",12),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o(),n(22,"label",13),c(23," No longer lives at the property"),o()(),n(24,"div",9)(25,"input",14),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o(),n(26,"label",15),c(27," Not responsible for bill"),o()(),n(28,"div",9)(29,"input",16),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o(),n(30,"label",17),c(31," Other"),o()(),_(32,Nr,5,4,"div",18),o()(),n(33,"div",19)(34,"div",20)(35,"button",21),v("click",function(){h(e);let r=d();return g(r.onCancel())}),c(36," No "),o(),n(37,"button",22),c(38," Yes "),o()()()()()()()}if(t&2){let e=d();a("ngClass",e.company==="LMH"?"bg-primary":"bg-primary-light"),s(8),U(e.accountHolder==null?null:e.accountHolder.customerName),s(2),a("formGroup",e.removePersonForm),s(22),a("ngIf",e.removePersonForm.get("changeReason").value==="other"),s(5),a("disabled",e.submittedForm)}}function Dr(t,l){if(t&1&&(n(0,"div"),u(1,"i",2),o()),t&2){let e=d(2);s(),a("ngClass",e.success?"bg-secondary fal fa-check":"bg-danger shadow fal fa-times")}}function Vr(t,l){t&1&&(n(0,"div")(1,"div",34),V(),n(2,"svg",35),u(3,"path",36),o(),n(4,"svg",37),u(5,"path",38),o()()())}
1function Pr(t,l){t&1&&(n(0,"div")(1,"div",39),V(),n(2,"svg",35),u(3,"path",36),o(),n(4,"svg",40),u(5,"path",41),o()()())}function Br(t,l){if(t&1&&(n(0,"div"),_(1,Vr,6,0,"div",27)(2,Pr,6,0,"div",27),o()),t&2){let e=d(2);s(),a("ngIf",e.success),s(),a("ngIf",!e.success)}}function Lr(t,l){if(t&1){let e=b();n(0,"div",26),_(1,Dr,2,1,"div",27)(2,Br,3,2,"div",27),o(),n(3,"div",28),u(4,"h4",29),o(),n(5,"div",30),u(6,"p",31),o(),n(7,"div",32)(8,"button",33),v("click",function(){h(e);let r=d();return g(r.closeModal())}),c(9," Close "),o()()}if(t&2){let e=d();s(),a("ngIf",e.company==="SEW"),s(),a("ngIf",e.company==="ICOSA"||e.company==="MTX"||e.company==="MUA"||e.company==="LEF"),s(2),a("innerHTML",e.modalTitle,F),s(2),a("innerHTML",e.modalBody,F)}}var rr=(()=>{let l=class l{constructor(i,r,m,p,y,C,w,I,S,D,L,P){this.route=i,this.fb=r,this.accountHolderService=m,this.customerService=p,this.pageScrollService=y,this.location=C,this.document=w,this.nameChangeService=I,this.spinnerSevice=S,this.spinner=D,this.modalService=L,this.analyticsService=P,this.formCheck=!1,this.showForm=!1,this.showSummary=!1,this.submitted=!1,this.submittedForm=!1,this.subscriptions=[],this.company=x.company,this.application=x.application,this.config={animated:!0,keyboard:!0,backdrop:!0,ignoreBackdropClick:!1,class:""}}ngOnInit(){this.analyticsService.pageView("remove-person-form","./remove-person-form","remove person form"),this.customerSubscription=this.customerService.customerChange.subscribe(i=>{this.customer=i}),this.customer=this.customerService.getCustomer(),this.accountHolderSubscription=this.accountHolderService.accountHoldersChange.subscribe(i=>{this.accountHolder=this.accountHolderService.getAccountHolder(this.id)}),this.route.params.subscribe(i=>{this.id=+i.id,this.initForm()}),this.removePersonForm=this.fb.group({changeReason:["bereavement",E.required],changeReasonOther:[""]})}initForm(){this.accountHolder=this.accountHolderService.getAccountHolder(this.id)}ngAfterViewInit(){this.pageScrollService.scroll({document:this.document,scrollTarget:".card-body",duration:300})}onCancel(){this.location.back(),this.pageScrollService.scroll({document:this.document,scrollTarget:"#topnav",duration:300})}removePerson(){if(this.submitted=!0,this.removePersonForm.get("changeReason").value!=="other"||this.removePersonForm.get("changeReason").value==="other"&&this.removePersonForm.get("changeReasonOther").value!==""){this.removalReason=this.removePersonForm.get("changeReason").value,this.removePersonForm.get("changeReason").value==="other"&&(this.removalReason=this.removePersonForm.get("changeReason").value+": "+this.removePersonForm.get("changeReasonOther").value);let i=this.route.snapshot.queryParamMap.get("contactMethod")?this.route.snapshot.queryParamMap.get("contactMethod"):"Y";this.spinnerSevice.setSpinnerDescription("please wait ..."),this.spinner.show(),this.submittedForm=!0,this.nameChangeService.getNameChangeUpdateResponse(this.customer.customerReference,i,"DELETE",this.removalReason,this.id+1,null,null,null).subscribe(r=>{this.spinner.hide(),this.submittedForm=!1,this.returnMessage=r.data.returnMessage,this.success=this.returnMessage==="GREEN"||this.returnMessage==="AMBER",this.config.class=this.success?"success-modal":"warning-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success&&this.returnMessage==="GREEN"?"That's all updated for you.  Thanks so much for keeping your details up to date.":this.success&&this.returnMessage==="AMBER"?"Thank you for updating your details. We are just checking a few bits and will update your account shortly.":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again.",this.openModal(this.templateRef)},r=>{this.submittedForm=!1,this.spinner.hide(),this.success=!1,this.config.class=this.success?"success-modal":"danger-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"Thank you we have updated your account.":"Oh no, I am so sorry but that didn't seem to work, could you please try again.",this.openModal(this.templateRef)})}}openModal(i){this.modalRef=this.modalService.show(i,Object.assign({},this.config)),this.subscriptions.push(this.modalService.onHide.subscribe(r=>{r==="backdrop-click"&&this.success&&this.onCancel()}))}closeModal(){if(this.modalRef)this.success&&this.onCancel();else return;this.modalRef.hide(),this.modalRef=null}ngOnDestroy(){this.customerSubscription.unsubscribe()}};l.\u0275fac=function(r){return new(r||l)(f(K),f(le),f(_e),f(te),f(Q),f(ee),f(W),f(We),f(Y),f(G),f(J),f(ae))},l.\u0275cmp=O({type:l,selectors:[["app-remove-person"]],viewQuery:function(r,m){if(r&1&&A(Fr,5),r&2){let p;N(p=M())&&(m.templateRef=p.first)}},decls:3,vars:1,consts:[["template",""],[3,"ngClass",4,"ngIf"],[3,"ngClass"],[1,"container","px-3","py-8","mx-auto"],["
1id","formHeader",1,"form-wrap"],[1,"text-center"],[3,"ngSubmit","formGroup"],[1,"form-group"],["for","changeReason",1,"label"],[1,"custom-control","custom-radio"],["formControlName","changeReason","id","changeReason1","name","changeReason","type","radio","value","bereavement",1,"custom-control-input",3,"keydown.enter"],["for","changeReason1",1,"custom-control-label"],["formControlName","changeReason","id","changeReason2","name","changeReason","type","radio","value","noLongerAtProperty",1,"custom-control-input",3,"keydown.enter"],["for","changeReason2",1,"custom-control-label"],["formControlName","changeReason","id","changeReason3","name","changeReason","type","radio","value","notResponsibleForBill",1,"custom-control-input",3,"keydown.enter"],["for","changeReason3",1,"custom-control-label"],["formControlName","changeReason","id","changeReason4","name","changeReason","type","radio","value","other",1,"custom-control-input",3,"keydown.enter"],["for","changeReason4",1,"custom-control-label"],["class","form-group",4,"ngIf"],[1,"clearfix"],[1,"btn-group","float-right"],["type","button",1,"btn","btn-outline-danger","mx-3",3,"click"],["type","submit",1,"btn","btn-primary",3,"disabled"],["for","changeReasonOther",1,"label","required"],["errorMsg","Please enter your reason.","id","changeReasonOtherError",3,"displayErrorIf"],["formControlName","changeReasonOther","id","changeReasonOther","name","changeReasonOther","type","text","aria-describedby","changeReasonOtherError",1,"form-control",3,"keydown.enter","ngClass"],[1,"icon-circle"],[4,"ngIf"],[1,"modal-header","justify-content-center"],[1,"modal-title",3,"innerHTML"],[1,"modal-body"],[1,"text-center",3,"innerHTML"],[1,"modal-footer","justify-content-center"],["type","button",1,"btn","btn-dark",3,"click"],[1,"icon-circle-inner","bg-active"],["xmlns","http://www.w3.org/2000/svg","width","279.5","height","268.79","viewBox","0 0 279.5 268.79",1,"pentagon"],["d","M856.134,1644.16a30,30,0,0,1-35.268,0L711.1,1564.41a30.009,30.009,0,0,1-10.9-33.55l41.926-129.04a30,30,0,0,1,28.532-20.73H906.338a30,30,0,0,1,28.532,20.73L976.8,1530.86a30.009,30.009,0,0,1-10.9,33.55Z","transform","translate(-698.75 -1381.09)"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 448 512","fill","white"],["d","M413.505 91.951L133.49 371.966l-98.995-98.995c-4.686-4.686-12.284-4.686-16.971 0L6.211 284.284c-4.686 4.686-4.686 12.284 0 16.971l118.794 118.794c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-11.314-11.314c-4.686-4.686-12.284-4.686-16.97 0z"],[1,"icon-circle-inner","bg-danger"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 512 512"],["d","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm101.8-262.2L295.6 256l62.2 62.2c4.7 4.7 4.7 12.3 0 17l-22.6 22.6c-4.7 4.7-12.3 4.7-17 0L256 295.6l-62.2 62.2c-4.7 4.7-12.3 4.7-17 0l-22.6-22.6c-4.7-4.7-4.7-12.3 0-17l62.2-62.2-62.2-62.2c-4.7-4.7-4.7-12.3 0-17l22.6-22.6c4.7-4.7 12.3-4.7 17 0l62.2 62.2 62.2-62.2c4.7-4.7 12.3-4.7 17 0l22.6 22.6c4.7 4.7 4.7 12.3 0 17z"]],template:function(r,m){r&1&&_(0,Mr,39,5,"section",1)(1,Lr,10,4,"ng-template",null,0,q),r&2&&a("ngIf",!0)},dependencies:[H,j,ce,$,se,vt,ie,z,X,re]});let t=l;return t})();var Or=["template"],pi=(t,l)=>({"is-invalid":t,"is-valid":l});function qr(t,l){if(t&1&&(n(0,"div"),u(1,"i",1),o()),t&2){let e=d(2);s(),a("ngClass",e.success?"bg-secondary fal fa-check":"bg-danger shadow fal fa-times")}}function Hr(t,l){t&1&&(n(0,"div")(1,"div",32),V(),n(2,"svg",33),u(3,"path",34),o(),n(4,"svg",35),u(5,"path",36),o()()())}function jr(t,l){t&1&&(n(0,"div")(1,"div",37),V(),n(2,"svg",33),u(3,"path",34),o(),n(4,"svg",38),u(5,"path",39),o()()())}function Ur(t,l){if(t&1&&(n(0,"div"),_(1,Hr,6,0,"div",25)(2,jr,6,0,"div",25),o()),t&2){let e=d(2);s(),a("ngIf",e.success),s(),a("ngIf",!e.success)}}function Wr(t,l){if(t&1){let e=b();n(0,"div",24),_(1,qr,2,1,"div",25)(2,Ur,3,2,"div",25),o(),n(3,"div",26),u(4,"h4",27),o(),n(5,"div",28),u(6,"p",29),o(),n(7,"div",30)(8,"button",31),v("click",function(){h(e);let r=d();return g(r.closeModal())}),c(9," Close "),o()()}if(t&2){let e=d();s(),a("ngIf",e.company==="SEW"||e.company==="ESP"),s(),a("ngIf",e.company==="ICOSA"||e.company==="MTX"||e.company==="MUA"||e.company==="LEF"),s(2),a("innerHTML",e.modalTitle,F),s(2),a("innerHTML",e.modalBody,F)}}var nr=(()=>{let l=class l{constructor(i,r,m,p,y,C,w,I,S,D,L,P){this.fb=i,this.route=r,this.accountHolderService=m,this.customerService=p,this.pageScrollService=y,this.location=C,this.document=w,this.nameChangeService=I,this.spinnerSevice=S,this.spinner=D,this.modalService=L,this.analyticsService=P,this.faAngleLeft=qt,this.faAngleRight=Ot,this.show
1Form=!0,this.submitted=!1,this.submittedForm=!1,this.subscriptions=[],this.company=x.company,this.application=x.application,this.config={animated:!0,keyboard:!0,backdrop:!0,ignoreBackdropClick:!1,class:""}}ngOnInit(){this.analyticsService.pageView("add-person-form","./add-person-form","add person form"),this.customerSubscription=this.customerService.customerChange.subscribe(i=>{this.customer=i}),this.customer=this.customerService.getCustomer(),this.addPersonForm=this.fb.group({title:[null,[E.required,E.maxLength(14)]],firstName:[null,[E.required,E.maxLength(30)]],lastName:[null,[E.required,E.maxLength(30)]]}),this.route.params.subscribe(i=>{this.id=+i.id,this.initForm()})}initForm(){this.accountHolder=this.accountHolderService.getAccountHolder(this.id)}ngAfterViewInit(){this.pageScrollService.scroll({document:this.document,scrollTarget:".card-body",duration:300})}get getTitle(){return this.addPersonForm.get("title")}get getFirstName(){return this.addPersonForm.get("firstName")}get getLastName(){return this.addPersonForm.get("lastName")}focusOnError(i){i.focus()}onCancel(){this.location.back(),this.pageScrollService.scroll({document:this.document,scrollTarget:"#topnav",duration:300})}onSubmit(){this.submitted=!0;let i=document.querySelector(".ng-invalid[formControlName]");if(this.getTitle.errors||this.getFirstName.errors||this.getLastName.errors)this.focusOnError(i);else{this.submittedForm=!0;let r=this.route.snapshot.queryParamMap.get("contactMethod")?this.route.snapshot.queryParamMap.get("contactMethod"):"Y";this.spinnerSevice.setSpinnerDescription("updating your account ..."),this.spinner.show(),this.nameChangeService.getNameChangeUpdateResponse(this.customer.customerReference,r,"ADD",null,this.id+1,this.getTitle.value,this.getFirstName.value,this.getLastName.value).subscribe(m=>{this.spinner.hide(),this.submittedForm=!1,this.returnMessage=m.data.returnMessage,this.success=this.returnMessage==="GREEN"||this.returnMessage==="AMBER",this.config.class=this.success?"success-modal":"warning-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success&&this.returnMessage==="GREEN"?"That's all updated for you.  Thanks so much for keeping your details up to date.":this.success&&this.returnMessage==="AMBER"?"Thank you for updating your details. We are just checking a few bits and will update your account shortly.":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again.",this.success===!0&&pe.includes(this.company)&&(this.modalBody+=de),this.openModal(this.templateRef)},m=>{this.submittedForm=!1,this.spinner.hide(),this.success=!1,this.config.class=this.success?"success-modal":"danger-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"Thank you we have updated your account.":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again.",this.openModal(this.templateRef)})}}openModal(i){this.modalRef=this.modalService.show(i,Object.assign({},this.config)),this.subscriptions.push(this.modalService.onHide.subscribe(r=>{r==="backdrop-click"&&this.success&&this.onCancel()}))}closeModal(){if(this.modalRef)this.success&&this.onCancel();else return;this.modalRef.hide(),this.modalRef=null}ngOnDestroy(){this.customerSubscription.unsubscribe()}};l.\u0275fac=function(r){return new(r||l)(f(le),f(K),f(_e),f(te),f(Q),f(ee),f(W),f(We),f(Y),f(G),f(J),f(ae))},l.\u0275cmp=O({type:l,selectors:[["app-add-person"]],viewQuery:function(r,m){if(r&1&&A(Or,5),r&2){let p;N(p=M())&&(m.templateRef=p.first)}},decls:38,vars:18,consts:[["template",""],[3,"ngClass"],[1,"container","px-3","py-8","mx-auto"],["id","formHeader",1,"form-wrap"],[3,"ngSubmit","formGroup"],[1,"sew-hint__required"],[1,"sew-error__text"],[1,"form-group"],["for","title",1,"label","required"],["errorMsg","Please enter your title.","id","titleError",3,"displayErrorIf"],[1,"form-row"],[1,"col-md-3"],["formControlName","title","id","title","name","title","type","text","maxlength","14","required","","aria-describedby","titleError",1,"form-control","form-control-lg",3,"keydown.enter","ngClass"],["for","firstName",1,"label","required"],["errorMsg","Please enter your first name.","id","firstNameError",3,"displayErrorIf"],[1,"col-xl-12","col-md-12"],["formControlName","firstName","
1id","firstName","name","firstName","type","text","maxlength","30","required","","aria-describedby","firstNameError",1,"form-control","form-control-lg",3,"keydown.enter","ngClass"],["for","lastName",1,"label","required"],["errorMsg","Please enter your last name.","id","lastNameError",3,"displayErrorIf"],["formControlName","lastName","id","lastName","name","lastName","type","text","maxlength","30","required","","aria-describedby","lastNameError",1,"form-control","form-control-lg",3,"keydown.enter","ngClass"],[1,"clearfix"],[1,"btn-group","float-right"],["type","button",1,"btn","btn-outline-danger","mx-3",3,"click"],["type","submit",1,"btn","btn-primary",3,"disabled"],[1,"icon-circle"],[4,"ngIf"],[1,"modal-header","justify-content-center"],[1,"modal-title",3,"innerHTML"],[1,"modal-body"],[1,"text-center",3,"innerHTML"],[1,"modal-footer","justify-content-center"],["type","button",1,"btn","btn-dark",3,"click"],[1,"icon-circle-inner","bg-active"],["xmlns","http://www.w3.org/2000/svg","width","279.5","height","268.79","viewBox","0 0 279.5 268.79",1,"pentagon"],["d","M856.134,1644.16a30,30,0,0,1-35.268,0L711.1,1564.41a30.009,30.009,0,0,1-10.9-33.55l41.926-129.04a30,30,0,0,1,28.532-20.73H906.338a30,30,0,0,1,28.532,20.73L976.8,1530.86a30.009,30.009,0,0,1-10.9,33.55Z","transform","translate(-698.75 -1381.09)"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 448 512","fill","white"],["d","M413.505 91.951L133.49 371.966l-98.995-98.995c-4.686-4.686-12.284-4.686-16.971 0L6.211 284.284c-4.686 4.686-4.686 12.284 0 16.971l118.794 118.794c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-11.314-11.314c-4.686-4.686-12.284-4.686-16.97 0z"],[1,"icon-circle-inner","bg-danger"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 512 512"],["d","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm101.8-262.2L295.6 256l62.2 62.2c4.7 4.7 4.7 12.3 0 17l-22.6 22.6c-4.7 4.7-12.3 4.7-17 0L256 295.6l-62.2 62.2c-4.7 4.7-12.3 4.7-17 0l-22.6-22.6c-4.7-4.7-4.7-12.3 0-17l62.2-62.2-62.2-62.2c-4.7-4.7-4.7-12.3 0-17l22.6-22.6c4.7-4.7 12.3-4.7 17 0l62.2 62.2 62.2-62.2c4.7-4.7 12.3-4.7 17 0l22.6 22.6c4.7 4.7 4.7 12.3 0 17z"]],template:function(r,m){if(r&1){let p=b();n(0,"section",1)(1,"div",2)(2,"div",3)(3,"h2"),c(4,"Add a new person to this account"),o(),n(5,"form",4),v("ngSubmit",function(){return h(p),g(m.onSubmit())}),n(6,"small",5),c(7,"Fields marked with "),n(8,"span",6),c(9,"*"),o(),c(10," are required."),o(),n(11,"div",7)(12,"label",8),c(13,"Title"),o(),u(14,"app-input-error-message",9),n(15,"div",10)(16,"div",11)(17,"input",12),v("keydown.enter",function(C){return h(p),g(C.preventDefault())}),o()()(),n(18,"label",13),c(19,"First name"),o(),u(20,"app-input-error-message",14),n(21,"div",10)(22,"div",15)(23,"input",16),v("keydown.enter",function(C){return h(p),g(C.preventDefault())}),o()()(),n(24,"label",17),c(25,"Last name"),o(),u(26,"app-input-error-message",18),n(27,"div",10)(28,"div",15)(29,"input",19),v("keydown.enter",function(C){return h(p),g(C.preventDefault())}),o()()()(),n(30,"div",20)(31,"div",21)(32,"button",22),v("click",function(){return h(p),g(m.onCancel())}),c(33," Cancel "),o(),n(34,"button",23),c(35," Submit "),o()()()()()()(),_(36,Wr,10,4,"ng-template",null,0,q)}r&2&&(a("ngClass",m.company==="LMH"?"bg-primary":"bg-primary-light"),s(5),a("formGroup",m.addPersonForm),s(9),a("displayErrorIf",m.submitted&&m.getTitle.errors),s(3),a("ngClass",T(9,pi,m.submitted&&m.getTitle.errors,m.getTitle.touched&&m.getTitle.valid)),s(3),a("displayErrorIf",m.submitted&&m.getFirstName.errors),s(3),a("ngClass",T(12,pi,m.submitted&&m.getFirstName.errors,m.getFirstName.touched&&m.getFirstName.valid)),s(3),a("displayErrorIf",m.submitted&&m.getLastName.errors),s(3),a("ngClass",T(15,pi,m.submitted&&m.getLastName.errors,m.getLastName.touched&&m.getLastName.valid)),s(5),a("disabled",m.submittedForm))},dependencies:[H,j,ce,$,se,ie,z,Ue,Ct,X,re]});let t=l;return t})();var Zt=class{constructor(l,e,i,r,m,p){this.customerReference=l,this.propertyReference=e,this.meterKey=i,this.method=r,this.uid=m,this.displayName=p}};var or=(()=>{let l=class l{constructor(i,r,m){this.globalSettingsService=i,this.functionsInstances=r,this.functions=m,this.globalSettings=this.globalSettingsService.getGlobalSettings(),this.globalSettingsService.globalSettingsChange.subscribe(p=>{this.globalSettings=p})}getMyUserUpdateResponse(i,r){let m=new Zt(i,"","","UPDATE",this.globalSettings?.uid,r);x.useEmulator&&Ve(this.functions,x.emulatorFunction[0],+x.emulatorFunction[1]);let p=Pe(this.functionsInstances[0],"myUserUpdateCF");return this.myUserUpdateCF$=Me(p(m)),this.myUserUpdateCF$}displayMyUserResponse(i){this.myUserUpdateResponse=i}getResults(){return this.myUserUpdateResponse}};l.\u0275fac=function(r){return new(r||l)(me(Re),me(ut),me(pt))},l.\u0275prov=He({token:l,factory:l.\u0275fac,providedIn:"root"});let t=l;return t})();var Yr=["template"],Qr=(t,l)=>({"is-invalid":t,"is-valid":l});function zr(t,l){if(t&1){let e=b();n(0,"div",2)(1,"div",3)(2,"div",4)(3,"form",5),v("ngSubmit",function(){h(e);let r=d();return g(r.onSubmit())}),n(4,"h2",6),c(5,"Change your display name"),o(),n(6,"p"),c(7,"Tell us your name so we can personalise your experience"),o(),n(8,"label",7),c(9,"Display name"),o(),n(10,"div",8)(11,"div",9),u(12,"input",10),o()(),u(13,"app-input-error-message",11),n(14,"div",12)(15,"div",13)(16,"div",14)(17,"button",15),v("click",function(){h(e);let r=d();return g(r.onCancel())}),c(18," Cancel "),o(),n(19,"button",16),c(20," Submit "),o()()()()()()()()}if(t&2){let e=d();a("ngClass",e.company==="LMH"?"bg-primary":"bg-primary-light"),s(3),a("formGroup",e.updateDisplayNameForm),s(9),a("ngClass",T(5,Qr,e.submitted&&e.getDisplayName.errors,e.getDisplayName.touched&&e.getDisplayName.valid)),s(),a("displayErrorIf",e.submitted&&e.getDisplayName.errors),s(6),a("disabled",e.submittedForm)}}function $r(t,l){if(t&1&&(n(0,"div"),u(1,"i",2),o()),t&2){let e=d(2);s(),a("ngClass",e.success?"bg-secondary fal fa-check":"bg-danger shadow fal fa-times")}}
1function Xr(t,l){t&1&&(n(0,"div")(1,"div",25),V(),n(2,"svg",26),u(3,"path",27),o(),n(4,"svg",28),u(5,"path",29),o()()())}function Jr(t,l){t&1&&(n(0,"div")(1,"div",30),V(),n(2,"svg",26),u(3,"path",27),o(),n(4,"svg",31),u(5,"path",32),o()()())}function Zr(t,l){if(t&1&&(n(0,"div"),_(1,Xr,6,0,"div",18)(2,Jr,6,0,"div",18),o()),t&2){let e=d(2);s(),a("ngIf",e.success),s(),a("ngIf",!e.success)}}function Kr(t,l){if(t&1){let e=b();n(0,"div",17),_(1,$r,2,1,"div",18)(2,Zr,3,2,"div",18),o(),n(3,"div",19),u(4,"h4",20),o(),n(5,"div",21),u(6,"p",22),o(),n(7,"div",23)(8,"button",24),v("click",function(){h(e);let r=d();return g(r.closeModal())}),c(9," Close "),o()()}if(t&2){let e=d();s(),a("ngIf",e.company==="SEW"),s(),a("ngIf",e.company==="ICOSA"||e.company==="MTX"||e.company==="MUA"||e.company==="LEF"),s(2),a("innerHTML",e.modalTitle,F),s(2),a("innerHTML",e.modalBody,F)}}var ar=(()=>{let l=class l{constructor(i,r,m,p,y,C,w,I,S,D){this.customerService=i,this.fb=r,this.myUserUpdateService=m,this.location=p,this.document=y,this.pageScrollService=C,this.modalService=w,this.spinnerSevice=I,this.spinner=S,this.analyticsService=D,this.alerts=[],this.campaigns=[],this.submitted=!1,this.submittedForm=!1,this.subscriptions=[],this.company=x.company,this.config={animated:!0,keyboard:!0,backdrop:!0,ignoreBackdropClick:!1,class:""}}ngOnInit(){this.analyticsService.pageView("update-display-name-form","./update-display-name","update display name form"),this.updateDisplayNameForm=this.fb.group({displayName:["",[E.required]]}),this.customerSubscription=this.customerService.customerChange.subscribe(i=>{this.customer=i,this.alerts=this.customerService.getAlerts("preferences"),this.campaigns=this.customerService.getCampaigns("preferences")}),this.customer=this.customerService.getCustomer()}get getDisplayName(){return this.updateDisplayNameForm.get("displayName")}focusOnError(i){i.focus()}onSubmit(){this.submitted=!0;let i=document.querySelector(".ng-invalid[formControlName]");this.getDisplayName.errors?this.focusOnError(i):(this.spinnerSevice.setSpinnerDescription("updating your account ..."),this.spinner.show(),this.submittedForm=!0,this.myUserUpdateService.getMyUserUpdateResponse(this.customer.customerReference,this.updateDisplayNameForm.get("displayName").value).subscribe(r=>{this.spinner.hide(),this.submittedForm=!1,this.returnMessage=r.data.returnMessage,this.success=this.returnMessage==="GREEN"||this.returnMessage==="AMBER",this.config.class=this.success?"success-modal":"warning-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"Thank you we have updated your account.":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again.",this.returnMessage==="GREEN"&&pe.includes(this.company)&&(this.modalBody+=de),this.openModal(this.templateRef)},r=>{this.submittedForm=!1,this.spinner.hide(),this.success=!1,this.config.class=this.success?"success-modal":"danger-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"Thank you we have updated your account.":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again.",this.openModal(this.templateRef)}))}onCancel(){this.location.back(),this.pageScrollService.scroll({document:this.document,scrollTarget:"#topnav",duration:300})}openModal(i){this.modalRef=this.modalService.show(i,Object.assign({},this.config)),this.subscriptions.push(this.modalService.onHide.subscribe(r=>{r==="backdrop-click"&&this.success&&this.onCancel()}))}closeModal(){if(this.modalRef)this.success&&this.onCancel();else return;this.modalRef.hide(),this.modalRef=null}ngOnDestroy(){this.customerSubscription.unsubscribe()}};l.\u0275fac=function(r){return new(r||l)(f(te),f(le),f(or),f(ee),f(W),f(Q),f(J),f(Y),f(G),f(ae))},l.\u0275cmp=O({type:l,selectors:[["app-update-display-name"]],viewQuery:function(r,m){if(r&1&&A(Yr,5),r&2){let p;N(p=M())&&(m.templateRef=p.first)}},decls:3,vars:1,consts:[["template",""],[3,"ngClass",4,"ngIf"],[3,"ngClass"],[1,"container","py-8"],[1,"form-wrap"],[3,"ngSubmit","formGroup"],["id","formHeader"],["for","displayName",1,"sr-only"],[1,"form-row"],[1,"col-md-6"],["formControlName","displayName","type","text","name","displayName","id","displayName","required","","aria-describedby","displayNameError","autocomplete","nickname",1,"form-control","form-control-lg",3,"ngClass"],["errorMsg","Please enter your preferred display name.","id","displayNameError",3,"displayErrorIf"],[1,"form-row","mt-5"],[1,"col-12"],[1,"btn-group","float-right"],["type","button",1,"btn","btn-outline-danger","mx-3",3,"click"],["type","submit",1,"btn","btn-primary",3,"disabled"],[1,"icon-circle"],[4,"ngIf"],[1,"modal-header","justify-content-center"],[1,"modal-title",3,"innerHTML"],[1,"modal-body"],[1,"text-center",3,"innerHTML"],[1,"modal-footer","justify-content-center"],["type","button",1,"btn","btn-dark",3,"click"],[1,"icon-circle-inner","bg-active"],["xmlns","http://www.w3.org/2000/svg","width","279.5","height","268.79","viewBox","0 0 279.5 268.79",1,"pentagon"],["d","M856.134,1644.16a30,30,0,0,1-35.268,0L711.1,1564.41a30.009,30.009,0,0,1-10.9-33.55l41.926-129.04a30,30,0,0,1,28.532-20.73H906.338a30,30,0,0,1,28.532,20.73L976.8,1530.86a30.009,30.009,0,0,1-10.9,33.55Z","transform","translate(-698.75 -1381.09)"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 448 512","fill","white"],["d","M413.505 91.951L133.49 371.966l-98.995-98.995c-4.686-4.686-12.284-4.686-16.971 0L6.211 284.284c-4.686 4.686-4.686 12.284 0 16.971l118.794 118.794c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-11.314-11.314c-4.686-4.686-12.284-4.686-16.97 0z"],[1,"icon-circle-inner","bg-danger"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 512 512"],["d","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm101.8-262.2L295.6 256l62.2 62.2c4.7 4.7 4.7 12.3 0 17l-22.6 22.6c-4.7 4.7-12.3 4.7-17 0L256 295.6l-62.2 62.2c-4.7 4.7-12.3 4.7-17 0l-22.6-22.6c-4.7-4.7-4.7-12.3 0-17l62.2-62.2-62.2-62.2c-4.7-4.7-4.7-12.3 0-17l22.6-22.6c4.7-4.7 12.3-4.7 17 0l62.2 
162.2 62.2-62.2c4.7-4.7 12.3-4.7 17 0l22.6 22.6c4.7 4.7 4.7 12.3 0 17z"]],template:function(r,m){r&1&&_(0,zr,21,8,"div",1)(1,Kr,10,4,"ng-template",null,0,q),r&2&&a("ngIf",!0)},dependencies:[H,j,ce,$,se,ie,z,Ue,X,re]});let t=l;return t})();var Oe=Dt(Qt());var tn=["template"],rn=["dateOfBirthErrorRef"],nn=["nationalInsuranceErrorRef"],on=["otherMedicalConditionErrorRef"],an=["adultsErrorRef"],sn=["childrenErrorRef"],ln=["income1ErrorRef"],cn=["income2ErrorRef"],mn=["income3ErrorRef"],dn=["child1DateOfBirthErrorRef"],pn=["child2DateOfBirthErrorRef"],un=["child3DateOfBirthErrorRef"],qe=(t,l)=>({"is-invalid":t,"is-valid":l}),Kt=t=>({"btn-outline-danger":t});function fn(t,l){t&1&&(n(0,"div")(1,"p"),c(2," We provide support tariffs for our customers who may be struggling to pay their bill without some support. We have two tariffs: "),o(),n(3,"p")(4,"strong"),c(5,"Social tariff -"),o(),c(6," This tariff can assist if you have a low household income; if your application is successful you will receive a percentage reduction on your fresh water service charges including standing charges. The reduction you receive will be dependant on your household income (excluding any disability and housing payment you receive). "),o(),n(7,"ul")(8,"li"),c(9," If your household income is between \xA317,001 and \xA322,020, you will receive a 30% reduction. "),o(),n(10,"li"),c(11," If your household income is less than \xA317,000, you will receive a 50% reduction. "),o()()())}function hn(t,l){t&1&&(n(0,"p"),c(1," You may be eligible for the WaterSure Tariff. "),o())}function gn(t,l){t&1&&(n(0,"p")(1,"strong"),c(2,"WaterSure tariff -"),o(),c(3," This can help by putting a cap on your metered water charges. "),o())}function vn(t,l){t&1&&(n(0,"p"),c(1," To qualify for the WaterSure Tariff, you must meet the following criteria: "),o())}function _n(t,l){t&1&&(n(0,"ul")(1,"li"),c(2,"Have a water meter"),o(),n(3,"li"),c(4,"buttone in receipt of a qualifying benefit"),o(),n(5,"li"),c(6," Have a medical condition that requires significant additional use of water or have three or more children under the age of 19 living in the household for which someone in the household is claiming child benefit "),o()())}function yn(t,l){if(t&1){let e=b();n(0,"div",26)(1,"div",31)(2,"p"),c(3," To get started please enter your date of birth and national insurance number "),o()(),n(4,"div",32)(5,"label",33),
1c(6,"Date of birth"),o(),n(7,"div",34),u(8,"input",35,1),n(11,"div",36)(12,"button",37),v("click",function(){h(e);let r=oe(9);return g(r.toggle())}),u(13,"fa-icon",38),o()()(),u(14,"app-input-error-message",39),o(),n(15,"div",40)(16,"label",41),c(17,"National insurance number"),o(),u(18,"input",42,2)(20,"app-input-error-message",43),o()()}if(t&2){let e=d(2);s(8),a("minDate",e.DOBMinDate)("maxDate",e.todayDate)("bsConfig",e.bsConfig)("ngClass",T(9,qe,e.submitted&&e.getElement("dateOfBirth").errors,e.getElement("dateOfBirth").touched&&e.getElement("dateOfBirth").valid)),s(4),a("ngClass",B(12,Kt,e.submitted&&e.getElement("dateOfBirth").errors)),s(),a("icon",e.faCalendarDay),s(),a("displayErrorIf",e.submitted&&e.getElement("dateOfBirth").errors),s(4),a("ngClass",T(14,qe,e.submitted&&e.getElement("nationalInsurance").errors,e.getElement("nationalInsurance").touched&&e.getElement("nationalInsurance").valid)),s(2),a("displayErrorIf",e.submitted&&e.getElement("nationalInsurance").errors)}}function bn(t,l){t&1&&(n(0,"div",44)(1,"div",45)(2,"legend")(3,"h4")(4,"label",46),c(5,"Benefits you receive"),o()()(),n(6,"p"),c(7," Please select any benefits you might receive from the list below. "),o()()())}function Cn(t,l){if(t&1&&u(0,"fa-icon",38),t&2){let e=d(4);a("icon",e.faCheckCircle)}}function Sn(t,l){if(t&1&&(n(0,"div",49)(1,"button",50),_(2,Cn,1,1,"fa-icon",51),c(3),o()()),t&2){let e=l.$implicit,i=l.index;a("formGroupName",i),s(2),a("ngIf",e.value.applicable==="true"),s(),ne(" ",e.value.description," ")}}function En(t,l){if(t&1&&(n(0,"div",47),_(1,Sn,4,3,"div",48),o()),t&2){let e=d(2);s(),a("ngForOf",e.socialTariffsform.get("benefits").controls)}}function xn(t,l){t&1&&(n(0,"div",44)(1,"div",45)(2,"legend")(3,"h4")(4,"label",46),c(5,"Medical conditions"),o()()(),n(6,"p"),c(7," Please select any medical conditions you have been diagnosed with. "),o()()())}function wn(t,l){if(t&1&&u(0,"fa-icon",38),t&2){let e=d(4);a("icon",e.faCheckCircle)}}function kn(t,l){if(t&1){let e=b();n(0,"div",49)(1,"button",53),v("click",function(){let r=h(e).$implicit,m=d(3);return g(m.medicalClick(r))}),_(2,wn,1,1,"fa-icon",51),c(3),o()()}if(t&2){let e=l.$implicit,i=l.index;a("formGroupName",i),s(2),a("ngIf",e.value.applicable==="true"),s(),ne(" ",e.value.description," ")}}function Tn(t,l){if(t&1&&(n(0,"div",52),_(1,kn,4,3,"div",48),o()),t&2){let e=d(2);s(),a("ngForOf",e.socialTariffsform.get("medicalConditions").controls)}}function In(t,l){if(t&1&&(n(0,"div",31)(1,"legend")(2,"h4")(3,"label",55),c(4,"Other medical conditions"),o()()(),n(5,"p"),
1c(6," Please give us details of other medical conditions you think should be considered "),o(),u(7,"input",56,3)(9,"app-input-error-message",57),o()),t&2){let e=d(3);s(7),a("ngClass",T(2,qe,e.submitted&&e.getElement("otherMedicalCondition").errors,e.getElement("otherMedicalCondition").touched&&e.getElement("otherMedicalCondition").valid)),s(2),a("displayErrorIf",e.submitted&&e.getElement("otherMedicalCondition").errors)}}function Rn(t,l){if(t&1&&(n(0,"div",44),_(1,In,10,5,"div",54),o()),t&2){let e=d(2);s(),a("ngIf",e.socialTariffsform.get("medicalConditions").controls[7].value.applicable==="true")}}function Fn(t,l){if(t&1&&(n(0,"div",44)(1,"div",32)(2,"label",58),c(3,"Number of adults in your home"),o(),u(4,"input",59,4)(6,"app-input-error-message",60),o(),n(7,"div",32)(8,"label",61),c(9,"Number of children under 19"),o(),u(10,"input",62,5)(12,"app-input-error-message",63),o()()),t&2){let e=d(2);s(4),a("ngClass",T(4,qe,e.submitted&&e.getElement("adults").errors,e.getElement("adults").touched&&e.getElement("adults").valid)),s(2),a("displayErrorIf",e.submitted&&e.getElement("adults").errors),s(4),a("ngClass",T(7,qe,e.submitted&&e.getElement("children").errors,e.getElement("children").touched&&e.getElement("children").valid)),s(2),a("displayErrorIf",e.submitted&&e.getElement("children").errors)}}function An(t,l){if(t&1&&(n(0,"div",31),c(1," Please give us the total annual income for each adult. "),n(2,"app-input-error-message",66),c(3,' > id="income-error" '),o()()),t&2){let e=d(3);s(2),a("displayErrorIf",e.submitted&&(e.getElement("income1").errors||e.getElement("income2").errors||e.getElement("income3").errors))}}function Nn(t,l){if(t&1&&(n(0,"div",67)(1,"label",68),c(2,"Income of adult 1"),o(),u(3,"input",69,6),o()),t&2){let e=d(3);s(3),a("ngClass",T(1,qe,e.submitted&&e.getElement("income1").errors,e.getElement("income1").touched&&e.getElement("income1").valid))}}function Mn(t,l){if(t&1&&(n(0,"div",67)(1,"label",70),c(2,"Adult 2"),o(),u(3,"input",71,7),o()),t&2){let e=d(3);s(3),a("ngClass",T(1,qe,e.submitted&&e.getElement("income2").errors,e.getElement("income2").touched&&e.getElement("income2").valid))}}function Dn(t,l){if(t&1&&(n(0,"div",67)(1,"label",72),c(2,"Other adults"),o(),u(3,"input",73,8),o()),t&2){let e=d(3);s(3),a("ngClass",T(1,qe,e.submitted&&e.getElement("income3").errors,e.getElement("income3").touched&&e.getElement("income3").valid))}}function Vn(t,l){if(t&1&&(n(0,"div",64),_(1,An,4,1,"div",54)(2,Nn,5,4,"div",65)(3,Mn,5,4,"div",65)(4,Dn,5,4,"div",65),o()),t&2){let e=d(2);s(),a("ngIf",e.getElement("adults").value>0),s(),a("ngIf",e.getElement("adults").value>0),s(),a("ngIf",e.getElement("adults").value>1),s(),a("ngIf",e.getElement("adults").value>2)}}function Pn(t,l){if(t&1&&(n(0,"div",31),c(1," Please can you give us the dates of birth of your youngest children. "),u(2,"app-input-error-message",74),o()),t&2){let e=d(3);s(2),a("displayErrorIf",e.submitted&&(e.getElement("child1DateOfBirth").errors||e.getElement("child2DateOfBirth").errors||e.getElement("child3DateOfBirth").errors))}}function Bn(t,l){if(t&1){let e=b();n(0,"div",67)(1,"legend")(2,"h4")(3,"label",75),c(4,"Date of birth"),o()()(),n(5,"div",34),u(6,"input",76,9),n(9,"div",36)(10,"button",37),v("click",function(){h(e);let r=oe(8);return g(r.toggle())}),u(11,"fa-icon",38),o()()()()}if(t&2){let e=d(3);s(6),a("minDate",e.DOBMinDate)("maxDate",e.todayDate)("bsConfig",e.bsConfig)("ngClass",T(6,qe,e.submitted&&e.getElement("child1DateOfBirth").errors,e.getElement("child1DateOfBirth").touched&&e.getElement("child1DateOfBirth").valid)),s(4),a("ngClass",B(9,Kt,e.submitted&&e.getElement("child1DateOfBirth").errors)),s(),a("icon",e.faCalendarDay)}}function Ln(t,l){if(t&1){let e=b();n(0,"div",67)(1,"legend")(2,"h4")(3,"label",55),c(4,"Date of birth"),o()()(),n(5,"div",34),u(6,"input",77,10),n(9,"div",36)(10,"button",37),v("click",function(){h(e);let r=oe(8);return g(r.toggle())}),u(11,"fa-icon",38),o()()()()}if(t&2){let e=d(3);s(6),a("minDate",e.DOBMinDate)("maxDate",e.todayDate)("bsConfig",e.bsConfig)("ngClass",T(6,qe,e.submitted&&e.getElement("child2DateOfBirth").errors,e.getElement("child2DateOfBirth").touched&&e.getElement("child2DateOfBirth").valid)),s(4),a("ngClass",B(9,Kt,e.submitted&&e.getElement("child2DateOfBirth").errors)),s(),a("icon",e.faCalendarDay)}}function On(t,l){if(t&1){let e=b();n(0,"div",67)(1,"legend")(2,"h4")(3,"label",78),c(4,"Date of birth"),o()()(),n(5,"div",34),u(6,"input",79,11),n(9,"div",36)(10,"button",37),v("click",function(){h(e);let r=oe(8);
1return g(r.toggle())}),u(11,"fa-icon",38),o()()()()}if(t&2){let e=d(3);s(6),a("minDate",e.DOBMinDate)("maxDate",e.todayDate)("bsConfig",e.bsConfig)("ngClass",T(6,qe,e.submitted&&e.getElement("child3DateOfBirth").errors,e.getElement("child3DateOfBirth").touched&&e.getElement("child3DateOfBirth").valid)),s(4),a("ngClass",B(9,Kt,e.submitted&&e.getElement("child3DateOfBirth").errors)),s(),a("icon",e.faCalendarDay)}}function qn(t,l){if(t&1&&(n(0,"div",64),_(1,Pn,3,1,"div",54)(2,Bn,12,11,"div",65)(3,Ln,12,11,"div",65)(4,On,12,11,"div",65),o()),t&2){let e=d(2);s(),a("ngIf",e.getElement("children").value>0),s(),a("ngIf",e.getElement("children").value>0),s(),a("ngIf",e.getElement("children").value>1),s(),a("ngIf",e.getElement("children").value>2)}}function Hn(t,l){if(t&1){let e=b();n(0,"li")(1,"a",82),v("click",function(){h(e);let r=d(3);return g(r.focusOnError(r.dateOfBirthErrorRef))}),c(2," Please enter your date of birth "),o()()}}function jn(t,l){if(t&1){let e=b();n(0,"li")(1,"a",82),v("click",function(){h(e);let r=d(3);return g(r.focusOnError(r.nationalInsuranceErrorRef))}),c(2," Please enter your national insurance number "),o()()}}function Un(t,l){if(t&1){let e=b();n(0,"li")(1,"a",82),v("click",function(){h(e);let r=d(3);return g(r.focusOnError(r.otherMedicalConditionErrorRef))}),c(2," Please enter details of your medical condition "),o()()}}function Wn(t,l){if(t&1){let e=b();n(0,"li")(1,"a",82),v("click",function(){h(e);let r=d(3);return g(r.focusOnError(r.adultsErrorRef))}),c(2," Please enter the number of adults living at the property "),o()()}}function Gn(t,l){if(t&1){let e=b();n(0,"li")(1,"a",82),v("click",function(){h(e);let r=d(3);return g(r.focusOnError(r.childrenErrorRef))}),c(2," Please enter the number of children living at the property "),o()()}}function Yn(t,l){if(t&1){let e=b();n(0,"li")(1,"a",82),v("click",function(){h(e);let r=d(3);return g(r.focusOnError(r.getElement("income1").errors?r.income1ErrorRef:r.getElement("income2").errors?r.income2ErrorRef:r.income3ErrorRef))}),c(2," Please enter the income of the adults living at the property "),o()()}}function Qn(t,l){if(t&1){let e=b();n(0,"li")(1,"a",82),v("click",function(){h(e);let r=d(3);return g(r.focusOnError(r.getElement("child1DateOfBirth").errors?r.child1DateOfBirthErrorRef:r.getElement("child2DateOfBirth").errors?r.child2DateOfBirthErrorRef:r.child3DateOfBirthErrorRef))}),c(2),o()()}if(t&2){let e=d(3);s(2),ne(" Please enter the date of birth of your youngest ",e.getElement("children").value===1?"child":"children"," living at the property ")}}function zn(t,l){if(t&1&&(n(0,"div",80,12)(2,"h4"),c(3,"There is a problem, please correct the fields marked below."),o(),n(4,"ul",81),_(5,Hn,3,0,"li",20)(6,jn,3,0,"li",20)(7,Un,3,0,"li",20)(8,Wn,3,0,"li",20)(9,Gn,3,0,"li",20)(10,Yn,3,0,"li",20)(11,Qn,3,1,"li",20),o()()),t&2){let e=d(2);s(5),a("ngIf",e.submitted&&e.getElement("dateOfBirth").errors),s(),a("ngIf",e.submitted&&e.getElement("nationalInsurance").errors),s(),a("ngIf",e.submitted&&e.getElement("otherMedicalCondition").errors),s(),a("ngIf",e.submitted&&e.getElement("adults").errors),s(),a("ngIf",e.submitted&&e.getElement("children").errors),s(),a("ngIf",e.submitted&&(e.getElement("income1").errors||e.getElement("income2").errors||e.getElement("income3").errors)&&e.getElement("adults").value>0),s(),a("ngIf",e.submitted&&(e.getElement("child1DateOfBirth").errors||e.getElement("child2DateOfBirth").errors||e.getElement("child3DateOfBirth").errors)&&e.getElement("children").value>0)}}function $n(t,l){if(t&1){let e=b();n(0,"button",83),v("click",function(){h(e);let r=d(2);return g(r.startForm())}),c(1," Start "),o()}}function Xn(t,l){if(t&1){let e=b();n(0,"div",84)(1,"button",85),v("click",function(){h(e);let r=d(2);return g(r.onCancel())}),c(2," Cancel "),o(),n(3,"button",86),c(4," Submit "),o()()}if(t&2){let e=d(2);s(3),a("disabled",e.submittedForm)}}function Jn(t,l){if(t&1){let e=b();n(0,"div",16)(1,"div",17)(2,"div",18)(3,"form",19),v("ngSubmit",function(){h(e);let r=d();return g(r.onSubmit())}),n(4,"h2",16),c(5," Help paying your bill "),o(),_(6,fn,12,0,"div",20)(7,hn,2,0,"p",20)(8,gn,4,0,"p",20)(9,vn,2,0,"p",20)(10,_n,7,0,"ul",20)(11,yn,21,17,"div",21)(12,bn,8,0,"div",22)(13,En,2,1,"div",23)(14,xn,8,0,"div",22)(15,Tn,2,1,"div",24)(16,Rn,2,1,"div",22)(17,Fn,13,10,"div",22)(18,Vn,5,4,"div",25)(19,qn,5,4,"div",25),n(20,"div",26),_(21,zn,12,7,"div",27),n(22,"div",28),_(23,$n,2,0,"button",29)(24,Xn,5,1,"div",30),o()()()()()()}if(t&2){let e=d();a("ngClass",e.company==="LMH"?"bg-primary":"bg-primary-light"),s(3),a("formGroup",e.socialTariffsform),s(),a("ngClass",e.company==="MUA"?"text-secondary-light":"text-primary"),s(2),a("ngIf",!e.formStarted&&e.company==="SEW"),s(),a("ngIf",!e.formStarted&&e.company!=="SEW"),s(),a("ngIf",!e.formStarted),s(),a("ngIf",!e.formStarted),s(),a("ngIf",!e.formStarted),s(),a("ngIf",e.formStarted),s(),a("ngIf",e.formStarted),s(),a("ngIf",e.formStarted),s(),a("ngIf",e.formStarted),s(),a("ngIf",e.formStarted),s(),a("ngIf",e.formStarted),s(),a("ngIf",e.formStarted),s(),a("ngIf",e.formStarted),s(),a("ngIf",e.formStarted),s(2),a("ngIf",e.formStarted&&e.submitted&&e.socialTariffsform.invali
1d),s(2),a("ngIf",!e.formStarted),s(),a("ngIf",e.formStarted)}}function Zn(t,l){if(t&1&&(n(0,"div"),u(1,"i",16),o()),t&2){let e=d(2);s(),a("ngClass",e.success?"bg-secondary fal fa-check":"bg-danger shadow fal fa-times")}}function Kn(t,l){t&1&&(n(0,"div")(1,"div",94),V(),n(2,"svg",95),u(3,"path",96),o(),n(4,"svg",97),u(5,"path",98),o()()())}function eo(t,l){t&1&&(n(0,"div")(1,"div",99),V(),n(2,"svg",95),u(3,"path",96),o(),n(4,"svg",100),u(5,"path",101),o()()())}function to(t,l){if(t&1&&(n(0,"div"),_(1,Kn,6,0,"div",20)(2,eo,6,0,"div",20),o()),t&2){let e=d(2);s(),a("ngIf",e.success),s(),a("ngIf",!e.success)}}function io(t,l){if(t&1){let e=b();n(0,"div",87),_(1,Zn,2,1,"div",20)(2,to,3,2,"div",20),o(),n(3,"div",88),u(4,"h4",89),o(),n(5,"div",90),u(6,"p",91),o(),n(7,"div",92)(8,"button",93),v("click",function(){h(e);let r=d();return g(r.closeModal())}),c(9," Close "),o(),n(10,"button",93),v("click",function(){h(e);let r=d();return g(r.onCallBack())}),c(11," Call back "),o()()}if(t&2){let e=d();s(),a("ngIf",e.company==="SEW"||e.company==="ESP"),s(),a("ngIf",e.company==="ICOSA"||e.company==="MTX"||e.company==="MUA"||e.company==="LEF"),s(2),a("innerHTML",e.modalTitle,F),s(2),a("innerHTML",e.modalBody,F)}}function ro(t,l){if(t&1){let e=b();n(0,"app-request-a-call-back",102),v("status",function(r){h(e);let m=d();return g(m.getMessage(r))}),o()}t&2&&a("defaultOption","Help with additional needs")}var lr=(()=>{let l=class l{ngOnInit(){this.bsConfig=Object.assign({},{containerClass:this.colorTheme,dateInputFormat:"DD/MM/YYYY"}),this.analyticsService.pageView("social-tariff-form","./social-tariff-form","social tariff form");let i=(0,Oe.default)().subtract(120,"years");this.DOBMinDate=(0,Oe.default)(i).toDate(),i=(0,Oe.default)(),this.todayDate=(0,Oe.default)(i).toDate(),this.customerSubscription=this.customerService.customerChange.subscribe(r=>{this.customer=r}),this.customer=this.customerService.getCustomer(),this.propertySubscription=this.propertyService.propertyChange.subscribe(r=>{this.property=r}),this.property=this.propertyService.getProperty(),this.globalSettings=this.globalSettingsService.getGlobalSettings(),this.globalSettingsService.globalSettingsChange.subscribe(r=>{this.globalSettings=r}),this.adultsSub=this.socialTariffsform.get("adults").valueChanges.subscribe(()=>{this.onChangeAdults()}),this.childrenSub=this.socialTariffsform.get("children").valueChanges.subscribe(()=>{this.onChangeChildren()})}constructor(i,r,m,p,y,C,w,I,S,D,L,P,R,Z,wt,li){this.fb=i,this.route=r,this.router=m,this.pageScrollService=p,this.document=y,this.spinner=C,this.spinnerSevice=w,this.location=I,this.customerService=S,this.propertyService=D,this.preferencesService=L,this.modalService=P,this.globalSettingsService=R,this.analyticsService=Z,this.activatedRoute=wt,this.contactDetailsService=li,this.config={animated:!0,keyboard:!0,backdrop:!0,ignoreBackdropClick:!1,class:""},this.faCalendarDay=Xe,this.faCheckCircle=mt,this.submitted=!1,this.submittedForm=!1,this.formStarted=!1,this.faExclamationCircle=ct,this.subscriptions=[],this.requestACallBack=!1,this.company=x.company,this.colorTheme="theme-default",this.socialTariffsform=this.fb.group({dateOfBirth:[null,E.required],nationalInsurance:[null],child1DateOfBirth:[null],child2DateOfBirth:[null],child3DateOfBirth:[null],adults:[null,E.required],children:[null,E.required],income1:[null],income2:[null],income3:[null],otherMedicalCondition:[null],benefits:this.fb.array([this.fb.group({code:"esa",description:"Income based ESA",applicable:"false"}),this.fb.group({code:"uc",description:"Universal credit",applicable:"false"}),this.fb.group({code:"is",description:"Income support",applicable:"false"}),this.fb.group({code:"ctc",description:"Child tax credit",applicable:"false"}),this.fb.group({code:"hcb",description:"Housing / Council tax benefit",applicable:"false"}),this.fb.group({code:"wtc",description:"Working tax credit",applicable:"false"}),this.fb.group({code:"pc",description:"Pension credit",applicable:"false"}),this.fb.group({code:"jsa",description:"Income based JSA",applicable:"false"})]),medicalConditions:this.fb.array([this.fb.group({code:"desquamation",description:"Desquamation (flaky skin disease)",applicable:"false"}),this.fb.group({code:"Incontinence",description:"Incontinence",applicable:"false"}),this.fb.group({code:"dialysis",description:"Renal Failure (home dialysis)",applicable:"false"}),this.fb.group({code:"colitis",description:"Ulcerative Colitis",applicable:"false"}),this.fb.group({code:"crohns",description:"Crohns Disease",applicable:"false"}),this.fb.group({code:"stoma",description:"Abdominal Stoma",applicable:"false"}),this.fb.group({code:"skin",description:"Weeping Skin Disease (eczema, psoriasis etc.)",applicable:"false"}),this.fb.group({code:"other",description:"Other",applicable:"false"})])});let it=(0,Oe.default)().subtract(5,"years");this.minDate=(0,Oe.default)(it).toDate()}startForm(){this.formStarted=!0,this.pageScrollService.scroll({document:this.document,scrollTarget:"#topnav",duration:0})}get medicallyDependent(){return this.fb.group({code:"",description:"",applicable:!1})}medicalClick(i){i.value.code=="other"&&(i.value.applicable=="true"?(this.socialTariffsform.get("otherMedicalCondition").setValidators([E.required]),this.socialTariffsform.get("otherMedicalCondition").setErrors(null),this.socialTariffsform.get("otherMedicalCondition").updateV
1alueAndValidity()):(this.socialTariffsform.get("otherMedicalCondition").setValidators([]),this.socialTariffsform.get("otherMedicalCondition").setErrors(null),this.socialTariffsform.get("otherMedicalCondition").updateValueAndValidity()))}onDeletePerson(i){this.socialTariffsform.get("persons").removeAt(i)}focusOnError(i){if(i){let r=i.nativeElement||i;typeof r.focus=="function"&&r.focus()}}getElement(i){return this.socialTariffsform.get(i)}onCancel(){this.location.back(),this.pageScrollService.scroll({document:this.document,scrollTarget:"#topnav",duration:300})}onChangeAdults(){let i=this.socialTariffsform.get("adults").value,r=this.socialTariffsform.get("income1"),m=this.socialTariffsform.get("income2"),p=this.socialTariffsform.get("income3");i>0?r.setValidators([E.required]):(r.clearValidators(),r.setValue(null,{emitEvent:!1}),r.setErrors(null)),r.updateValueAndValidity(),i>1?m.setValidators([E.required]):(m.clearValidators(),m.setValue(null,{emitEvent:!1}),m.setErrors(null)),m.updateValueAndValidity(),i>2?p.setValidators([E.required]):(p.clearValidators(),p.setValue(null,{emitEvent:!1}),p.setErrors(null)),p.updateValueAndValidity()}onChangeChildren(){let i=this.socialTariffsform.get("children").value,r=this.socialTariffsform.get("child1DateOfBirth"),m=this.socialTariffsform.get("child2DateOfBirth"),p=this.socialTariffsform.get("child3DateOfBirth");i>0?r.setValidators([E.required]):(r.clearValidators(),r.setValue(null,{emitEvent:!1}),r.setErrors(null)),r.updateValueAndValidity(),i>1?m.setValidators([E.required]):(m.clearValidators(),m.setValue(null,{emitEvent:!1}),m.setErrors(null)),m.updateValueAndValidity(),i>2?p.setValidators([E.required]):(p.clearValidators(),p.setValue(null,{emitEvent:!1}),p.setErrors(null)),p.updateValueAndValidity()}onSubmit(){this.submitted=!0;let i=this.activatedRoute.snapshot.queryParamMap.get("contactMethod")?this.activatedRoute.snapshot.queryParamMap.get("contactMethod"):"Y",r=this.activatedRoute.snapshot.queryParamMap.get("telephoneNumber"),m=this.activatedRoute.snapshot.queryParamMap.get("callerName");!i&&!r&&!m&&(i=this.contactDetailsService.contactMethod,r=this.contactDetailsService.eventTelephoneNumber,m=this.contactDetailsService.eventCallerName);let p=document.querySelector(".ng-invalid[formControlName]");if(this.socialTariffsform.invalid){this.focusOnError(p);return}else{let y,C,w,I,S;y=this.getElement("dateOfBirth").value,C=Oe.default.utc(y.getMonth()+1+"-"+y.getDate()+"-"+y.getFullYear(),"MM-DD-YYYY").toJSON(),y=this.getElement("child1DateOfBirth").value,y&&(w=Oe.default.utc(y.getMonth()+1+"-"+y.getDate()+"-"+y.getFullYear(),"MM-DD-YYYY").toJSON()),y=this.getElement("child2DateOfBirth").value,y&&(I=Oe.default.utc(y.getMonth()+1+"-"+y.getDate()+"-"+y.getFullYear(),"MM-DD-YYYY").toJSON()),y=this.getElement("child3DateOfBirth").value,y&&(S=Oe.default.utc(y.getMonth()+1+"-"+y.getDate()+"-"+y.getFullYear(),"MM-DD-YYYY").toJSON()),this.success=null,this.spinnerSevice.setSpinnerDescription("updating Priority Services Register info ..."),this.socialTariffsUpdateRequest=new Xi(this.customer.customerReference,this.property.propertyReference,"UPDATE",this.globalSettings.uid,"","","","",C,this.getElement("nationalInsurance").value,this.getElement("adults").value,this.getElement("income1").value,this.getElement("income2").value,this.getElement("income3").value,this.getElement("children").value,w,I,S,r,m,i,[],[]);let D;for(let P of this.socialTariffsform.controls.medicalConditions.value)P.applicable=="true"&&(P.code!="other"?D=new di(P.description,""):D=new di(P.description,this.socialTariffsform.get("otherMedicalCondition").value),this.socialTariffsUpdateRequest.socMedicalConditions.push(D));let L;for(let P of this.socialTariffsform.controls.benefits.value)P.applicable=="true"&&(L=new $i(P.description),this.socialTariffsUpdateRequest.socBenefits.push(L));this.success=null,this.spinnerSevice.setSpinnerDescription("updating help paying request ..."),this.spinner.show(),this.submittedForm=!0,this.preferencesService.getSocialTariffsUpdateResponse(this.socialTariffsUpdateRequest).subscribe(P=>{this.spinner.hide(),this.submittedForm=!1,this.returnMessage=P.data.returnMessage,this.success=this.returnMessage==="GREEN"||this.returnMessage==="AMBER",this.config.class=this.success?"success-modal":"warning-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"Thanks very much for all that information. We've passed this to a specialist in our Customer Care team and we'll get back to you as quickly as we can":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our specialist from our Customer Care Team to give you a ring",this.returnMessage==="GREEN"&&pe.includes(this.company)&&(this.modalBody+=de),this.openModal(this.templateRef)},P=>{this.submittedForm=!1,this.spinner.hide().then(()=>{}),this.success=!1,this.config.class=this.success?"success-modal":"danger-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"Thanks very much for all that information. We've passed this to a specialist in our Customer Care team and we'll get back to you as quickly as we can":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our specialist from our Customer Care Team to give you a ring",this.openModal(this.templateRef)})}}openModal(i){this.modalRef=this.modalService.show(i,Object.assign({},this.config)),this.subscriptions.push(this.modalService.onHide.subscribe(r=>{r=="backdrop-click"&&this.success&&(this.onCancel(),this.requestACallBack=!1)}))}onCallBack(){this.modalRef.hide(),this.modalRef=null,this.requestACallBack=!0}getMessage(i){this.onCancel(),this.requestACallBack=!1}closeModal(){if(this.modalRef)this.success&&(this.onCancel(),this.requestACallBack=!1);else return;this.modalRef.hide(),this.modalRef=null}startSpinner(){this.spinner.show(),setTimeout(()=>{this.spinner.hide()},1e4)}ngOnDestroy(){this.adultsSub&&this.adultsSub.unsubscribe(),this.childrenSub&&this.childrenSub.unsubscribe()}};l.\u0275fac=function(r){return new(r||l)(f(le),f(K),f(Je),f(Q),f(W),f(G),f(Y),f(ee),f(te),f(Ze),f(ve),f(J),f(Re),f(ae),f(K),f(Et))},l.\u0275cmp=O({type:l,selectors:[["app-social-tariff-form"]],viewQuery:function(r,m){if(r&1&&(A(tn,5),A(rn,5),A(nn,5),A(on,5),A(an,5),A(sn,5),A(ln,5),A(cn,5),A(mn,5),A(dn,5),A(pn,5),A(un,5)),r&2){let p;N(p=M())&&(m.templateRef=p.first),N(p=M())&&(m.dateOfBirthErrorRef=p.first),N(p=M())&&(m.nationalInsuranceErrorRef=p.first),N(p=M())&&(m.otherMedicalConditionErrorRef=p.first),N(p=M())&&(m.adultsErrorRef=p.first),N(p=M())&&(m.childrenErrorRef=p.first),N(p=M())&&(m.income1ErrorRef=p.first),N(p=M())&&(m.income2ErrorRef=p.first),N(p=M())&&(m.income3ErrorRef=p.first),N(p=M())&&(m.child1DateOfBirthErrorRef=p.first),N(p=M())&&(m.child2DateOfBirthErrorRef=p.first),N(p=M())&&(m.child3DateOfBirthErrorRef=p.first)}}
vendor: 7,261 bytes, line 1
1,decls:5,vars:2,consts:[["template",""],["dp","bsDatepicker","dateOfBirthErrorRef",""],["nationalInsuranceErrorRef",""],["otherMedicalConditionErrorRef",""],["adultsErrorRef",""],["childrenErrorRef",""],["income1ErrorRef",""],["income2ErrorRef",""],["income3ErrorRef",""],["child1DateOfBirthErrorRef","","dp1","bsDatepicker"],["child2DateOfBirthErrorRef","","dp2","bsDatepicker"],["child3DateOfBirthErrorRef","","dp3","bsDatepicker"],["errorSummaryRef",""],[3,"ngClass",4,"ngIf"],[1,"container"],[3,"defaultOption","status",4,"ngIf"],[3,"ngClass"],[1,"container","py-8"],[1,"form-wrap"],["id","socialTariffsform","name","socialTariffsform",3,"ngSubmit","formGroup"],[4,"ngIf"],["class","row",4,"ngIf"],["class","row mt-3",4,"ngIf"],["class","row","formArrayName","benefits",4,"ngIf"],["class","row","formArrayName","medicalConditions",4,"ngIf"],["class","row mt-2",4,"ngIf"],[1,"row"],["class","alert alert-danger mb-6 col-12",4,"ngIf"],[1,"col-lg-12","my-3"],["type","button","class","btn btn-primary float-right mx-3",3,"click",4,"ngIf"],["class","btn-group float-right",4,"ngIf"],[1,"col-lg-12","mb-1"],[1,"col-lg-6","mb-1"],["for","dateOfBirth",1,"label","required"],[1,"input-group"],["placeholder","dd/mm/yyyy","name","dateOfBirth","formControlName","dateOfBirth","bsDatepicker","","id","dateOfBirth","aria-describedby","dob-error",1,"form-control","form-control-lg",3,"minDate","maxDate","bsConfig","ngClass"],[1,"input-group-append"],["type","button",1,"btn","btn-outline-secondary",3,"click","ngClass"],[3,"icon"],["errorMsg","You must enter a valid date of birth","id","dob-error",3,"displayErrorIf"],[1,"col-lg-6"],["for","nationalInsurance",1,"label"],["type","text","mask","SS 00 00 00 S","formControlName","nationalInsurance","name","nationalInsurance","id","nationalInsurance","placeholder","AA 99 99 99 A","aria-describedby","nationalInsuranceError",1,"form-control","form-control-lg",3,"ngClass"],["errorMsg","You must enter a valid national insurance number","id","nationalInsuranceError",3,"displayErrorIf"],[1,"row","mt-3"],[1,"col-12","mb-1"],[1,"label"],["formArrayName","benefits",1,"row"],["class","col-md-6 col-lg-4 col-xl-3 my-2",3,"formGroupName",4,"ngFor","ngForOf"],[1,"col-md-6","col-lg-4","col-xl-3","my-2",3,"formGroupName"],["type","button","formControlName","applicable","btnCheckbox","","btnCheckboxTrue","true","btnCheckboxFalse","false",1,"btn","btn-info","btn-block","btn-lg","h-100"],[3,"icon",4,"ngIf"],["formArrayName","medicalConditions",1,"row"],["type","button","formControlName","applicable","btnCheckbox","","btnCheckboxTrue","true","btnCheckboxFalse","false",1,"btn","btn-info","btn-block","btn-lg","h-100",3,"click"],["class","col-lg-12 mb-1",4,"ngIf"],[1,"label","required"],["type","text","formControlName","otherMedicalCondition",1,"form-control","form-control-lg",3,"ngClass"],["errorMsg","Please enter details",3,"displayErrorIf"],["for","adults",1,"label","required"],["type","text","mask","09","formControlName","adults","name","adults","id","adults","aria-describedby","adultsError",1,"form-control","form-control-lg",3,"ngClass"],["errorMsg","Please enter how many adults live at the property","id","adultsError",3,"displayErrorIf"],["for","children",1,"label","required"],["type","text","mask","09","formControlName","children","name","children","id","children","aria-describedby","childrenError",1,"form-control","form-control-lg",3,"ngClass"],["errorMsg","Please enter how many children live at the property","id","childrenError",3,"displayErrorIf"],[1,"row","mt-2"],["class","col-lg-4 mb-1",4,"ngIf"],["errorMsg","In order to submit your application form, please enter a valid household income. This must include any benefits each adult currently receives. If you require any assistance with your application, please call our Customer Care team on 0800 952 4000.",3,"displayErrorIf"],[1,"col-lg-4","mb-1"],["for","income1",1,"label","required"],["type","number","formControlName","income1","name","income1","id","income1","placeholder","","aria-describedby","income-error",1,"form-control","form-control-lg",3,"ngClass"],["for","income2",1,"label","required"],["type","number","formControlName","income2","name","income2","id","income2","placeholder","","aria-describedby","income-error",1,"form-control","form-control-lg",3,"ngClass"],["for","income3",1,"label","required"],["type","number","formControlName","income3","name","income3","id","income3","placeholder","","aria-describedby","income-error",1,"form-control","form-control-lg",3,"ngClass"],["errorMsg","Please add the dates of birth for all the children in the household","id","dob-error",3,"displayErrorIf"],["for","child1DateOfBirth",1,"label","required"],["type","text","placeholder","dd/mm/yyyy","name","child1DateOfBirth","formControlName","child1DateOfBirth","bsDatepicker","","id","child1DateOfBirth","aria-describedby","dob-error",1,"form-control","form-control-lg",3,"minDate","maxDate","bsConfig","ngClass"],["placeholder","dd/mm/yyyy","name","child2DateOfBirth","formControlName","child2DateOfBirth","bsDatepicker","","id","child2DateOfBirth","aria-describedby","dob-error",1,"form-control","form-control-lg",3,"minDate","maxDate","bsConfig","ngClass"],["for","child3DateOfBirth",1,"label","required"],["placeholder","dd/mm/yyyy","name","child3DateOfBirth","formControlName","child3DateOfBirth","bsDatepicker","","id","child3DateOfBirth","aria-describedby","dob-error",1,"form-control","form-control-lg",3,"minDate","maxDate","bsConfig","ngClass"],[1,"alert","alert-danger","mb-6","col-12"],[1,"error-list"],[3,"click"],["type","button",1,"btn","btn-primary","float-right","mx-3",3,"click"],[1,"btn-group","float-right"],["type","button",1,"btn","btn-outline-danger","mx-3",3,"click"],["type","submit",1,"btn","btn-primary",3,"disabled"],[1,"icon-circle"],[1,"modal-header","justify-content-center"],[1,"modal-title",3,"innerHTML"],[1,"modal-body"],[3,"innerHTML"],[1,"modal-footer","justify-content-center"],["type","button",1,"btn","btn-dark",3,"click"],[1,"icon-circle-inner","bg-active"],["xmlns","http://www.w3.org/2000/svg","width","279.5","height","268.79","viewBox","0 0 279.5 268.79",1,"pentagon"],["d","M856.134,1644.16a30,30,0,0,1-35.268,0L711.1,1564.41a30.009,30.009,0,0,1-10.9-33.55l41.926-129.04a30,30,0,0,1,28.532-20.73H906.338a30,30,0,0,1,28.532,20.73L976.8,1530.86a30.009,30.009,0,0,1-10.9,33.55Z","transform","translate(-698.75 -1381.09)"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 448 512","fill","white"],["d","M413.505 91.951L133.49 371.966l-98.995-98.995c-4.686-4.686-12.284-4.686-16.971 0L6.211 284.284c-4.686 4.686-4.686 12.284 0 16.971l118.794 118.794c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-11.314-11.314c-4.686-4.686-12.284-4.686-16.97 0z"],[1,"icon-circle-inner","bg-danger"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 512 512"],["d","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm101.8-262.2L295.6 256l62.2 62.2c4.7 4.7 4.7 12.3 0 17l-22.6 22.6c-4.7 4.7-12.3 4.7-17 0L256 295.6l-62.2 62.2c-4.7 4.7-12.3 4.7-17 0l-22.6-22.6c-4.7-4.7-4.7-12.3 0-17l62.2-62.2-62.2-62.2c-4.7-4.7-4.7-12.3 0-17l22.6-22.6c4.7-4.7 12.3-4.7 17 0l62.2 
162.2 62.2-62.2c4.7-4.7 12.3-4.7 17 0l22.6 22.6c4.7 4.7 4.7 12.3 0 17z"],[3,"status","defaultOption"]],template:function(r,m){r&1&&(_(0,Jn,25,20,"div",13)(1,io,12,4,"ng-template",null,0,q),n(3,"section",14),_(4,ro,1,1,"app-request-a-call-back",15),o()),r&2&&(a("ngIf",!m.requestACallBack),s(4),a("ngIf",m.requestACallBack))},dependencies:[H,ge,j,Fe,ce,$,se,Hi,ie,z,X,re,Wt,Gt,Ie,Yt,Ke,et]});let t=l;return t})();var tt=Dt(Qt());var no=["template"],ye=(t,l)=>({"is-invalid":t,"is-valid":l});function oo(t,l){t&1&&(n(0,"alert",19),c(1,"Please add all of your requirements including any that you may have previously told us about as this will be a new application"),o())}function ao(t,l){t&1&&(n(0,"p"),c(1," If you are a customer that may need some extra help and support from us then our Priority Services Register is free to join and allows us to tailor our services to support you. In the event there is an interruption on our water network, these services support customers who have any restricted mobility, or may be deaf, blind or partially sighted, are elderly customers or those suffering a sickness or illness. The services we provide to support our customers include: "),o())}function so(t,l){t&1&&(n(0,"ul")(1,"li"),c(2,"helping you to understand through an interpretation service"),o(),n(3,"li"),c(4," giving you prior notice of planned works that may involve interruption to your supply "),o(),n(5,"li"),c(6," sending bills and letters in the best format such as braille, audio or large print "),o(),n(7,"li"),c(8," we can even arrange for someone to visit and read the bill to you if that\u2019s easier "),o(),n(9,"li"),c(10," register a spoken or written password for when you need to deal with us to give you peace of mind "),o(),n(11,"li"),c(12," nominate someone else to receive the water bill on your behalf or someone we can contact if you prefer "),o()())}function lo(t,l){if(t&1&&(n(0,"div")(1,"p"),c(2," We understand it can be a stressful to experience issues with your heating, especially if you\u2019re in a vulnerable situation. "),o(),n(3,"p"),c(4," That\u2019s why if you\u2019re a Last Mile Heat customer with extra needs, you can be added to our Priority Service Register \u2013 it\u2019s a completely free service designed to make sure we\u2019re taking care of your communication, access or safety needs. "),o(),n(5,"h3",7),c(6," How to know if you\u2019re eligible for the Priority Services Register "),o(),n(7,"p"),c(8," You and other people in your house can join the register if you/they are: "),o(),n(9,"ul")(10,"li"),c(11,"suffering from a terminal or chronic illness;"),o(),n(12,"li"),c(13," mentally or physically disabled, or having a hearing or visual impairment; "),o(),n(14,"li"),c(15,"of an age which requires additional support; or"),o(),n(16,"li"),c(17,"suffering severe financial difficulty."),o()(),n(18,"p"),c(19,"It\u2019s easy and free to join the Priority Services Register."),o(),n(20,"p"),c(21," If you need help with the form, or would prefer to speak to us, just call 0333 009 5211 "),o()()),t&2){let e=d(2);s(5),a("ngClass",e.company==="MUA"?"text-secondary-light":"text-primary")}}function co(t,l){t&1&&(n(0,"p"),c(1," We share the address and your priority needs when you join our PSR with your energy network operator which will be either UKPN or SSEN depending on where you live. Your energy network operator will also do the same and let us know if they have PSR customers in our South East Water geographical location. This is so that we can ensure that you can receive support from your key utility providers to meet your priority needs. "),o())}function mo(t,l){t&1&&(n(0,"p"),c(1," We have a code of practice, this can be viewed by visiting "),n(2,"a",21),c(3,"southeastwater.co.uk"),o(),c(4,", alternatively you can call us or email and ask us to send you one through the post. "),o())}function po(t,l){if(t&1&&(n(0,"div"),_(1,co,2,0,"p",20)(2,mo,5,0,"p",12),o()),t&2){let e=d(2);s(),a("ngif",!e.personcontrols||e.personcontrols.length<1),s(),a("ngIf",!e.personControls||e.personControls.length<1)}}function uo(t,l){t&1&&(n(0,"p"),c(1," We have a code of practice, this can be viewed by visiting "),n(2,"a",22),c(3,"lmwater.co.uk"),o(),c(4,", alternatively you can call us or email and ask us to send you one through the post. "),o())}function fo(t,l){if(t&1&&(n(0,"div"),_(1,uo,5,0,"p",12),o()),t&2){let e=d(2);s(),a("ngIf",!e.personControls||e.personControls.length<1)}}function ho(t,l){t&1&&(n(0,"p"),c(1," We have a code of practice, this can be viewed by visiting "),n(2,"a",23),c(3,"https://matrixwater.co.uk/"),o(),c(4,", alternatively you can call us or email and ask us to send you one through the post. "),o())}function go(t,l){if(t&1&&(n(0,"div"),_(1,ho,5,0,"p",12),o()),t&2){let e=d(2);s(),a("ngIf",!e.personControls||e.personControls.length<1)}}function vo(t,l){t&1&&(n(0,"p"),c(1," We have a code of practice, this can be viewed by visiting "),n(2,"a",24),c(3,"muagroup.co.uk"),o(),c(4,", alternatively you can call us or email and ask us to send you one through the post. "),o())}function _o(t,l){if(t&1&&(n(0,"div"),_(1,vo,5,0,"p",12),o()),t&2){let e=d(2);s(),a("ngIf",!e.personControls||e.personControls.length<1)}}function yo(t,l){t&1&&(n(0,"p"),c(1," We have a code of practice, this can be viewed by visiting "),n(2,"a",25),c(3,"leafwater.co.uk"),o(),c(4,", alternatively you can call us or email and ask us to send you one through the post. "),o())}function bo(t,l){if(t&1&&(n(0,"div"),_(1,yo,5,0,"p",12),o()),t&2){let e=d(2);s(),a("ngIf",!e.personControls||e.personControls.length<1)}}function Co(t,l){if(t&1&&(n(0,"div",37)(1,"div",53)(2,"h4")(3,"label",72),c(4,"Password"),o()(),u(5,"input",73),n(6,"p",74),c(7," Add a password and we'll use that if we ever need to visit your property, this is different to your My Account password "),o()()()),t&2){let e=d().index,i=d(2);s(3),k("for","accountPassword"+e),s(2),k("id","accountPassword"+e),k("name","accountPassword"+e),a("ngClass",T(4,ye,i.submitted&&i.getElement("accountPassword",e).errors,i.getElement("accountPassword",e).touched&&i.getElement("accountPassword",e).valid))}}function So(t,l){if(t&1&&(n(0,"div",37)(1,"div",53)(2,"h4")(3,"label",72),c(4,"Power of Attorney"),o()(),u(5,"input",75),n(6,"p",76),c(7," If someone else has Financial Power of Attorney to help deal with your account pop their name in the box. "),o()(),n(8,"div",53)(9,"h4")(10,"label",72),c(11,"Authorised third party"),o()(),u(12,"input",77),n(13,"p",78),c(14," If you would like someone you trust to help deal with your account but they do not have Power of Attorney, pop their name in the box. "),o()()()),t&2){let e=d().index,i=d(2);s(3),k("for","powerOfAttorney"+e),s(2),k("id","powerOfAttorney"+e),k("name","powerOfAttorney"+e),a("ngClass",T(8,ye,i.submitted&&i.getElement("powerOfAttorney",e).errors,i.getElement("powerOfAttorney",e).touched&&i.getElement("powerOfAttorney",e).valid)),s(5),k("for","authorisedThirdPartyName"+e),s(2),k("id","authorisedThirdPartyName"+e),k("name","authorisedThirdPartyName"+e),a("ngClass",T(11,ye,i.submitted&&i.getElement("authorisedThirdPartyName",e).errors,i.getElement("authorisedThirdPartyName",e).touched&&i.getElement("authorisedThirdPartyName",e).valid))}}function Eo(t,l){if(t&1&&(n(0,"div"),u(1,"input",79),n(2,"label",49),c(3," I would like two of the team from South East Water to attend rather than just one "),o()()),t&2){let e=d().index,i=d(2);s(),k("name","additionalSEWPresence"+e),k("id","additionalSEWPresence"+e),a("ngClass",T(4,ye,i.submitted&&i.getElement("additionalSEWPresence",e).errors,i.getElement("additionalSEWPresence",e).touched&&i.getElement("additionalSEWPresence",e).valid)),s(),k("for","additionalSEWPresence"+e)}}function xo(t,l){if(t&1&&(n(0,"div"),u(1,"input",79),n(2,"label",49),c(3," I would like two of the team from Last Mile Water to attend rather than just one "),o()()),t&2){let e=d().index,i=d(2);s(),k("name","additionalSEWPresence"+e),k("id","additionalSEWPresence"+e),a("ngClass",T(4,ye,i.submitted&&i.getElement("additionalSEWPresence",e).errors,i.getElement("additionalSEWPresence",e).touched&&i.getElement("additionalSEWPresence",e).valid)),s(),k("for","additionalSEWPresence"+e)}}function wo(t,l){if(t&1&&(n(0,"div"),u(1,"input",79),n(2,"label",49),c(3," I would like two of the team from matrix Water to attend rather than just one "),o()()),t&2){let e=d().index,i=d(2);s(),k("name","additionalSEWPresence"+e),k("id","additionalSEWPresence"+e),a("ngClass",T(4,ye,i.submitted&&i.getElement("additionalSEWPresence",e).errors,i.getElement("additionalSEWPresence",e).touched&&i.getElement("additionalSEWPresence",e).valid)),s(),k("for","additionalSEWPresence"+e)}}function ko(t,l){if(t&1&&(n(0,"div"),u(1,"input",79),n(2,"label",49),c(3," I would like two of the team from mua Water to attend rather than just one "),o()()),t&2){let e=d().index,i=d(2);s(),k("name","additionalSEWPresence"+e),k("id","additionalSEWPresence"+e),a("ngClass",T(4,ye,i.submitted&&i.getElement("additionalSEWPresence",e).errors,i.getElement("additionalSEWPresence",e).touched&&i.getElement("additionalSEWPresence",e).valid)),s(),k("for","additionalSEWPresence"+e)}}function To(t,l){if(t&1&&(n(0,"div"),u(1,"input",79),n(2,"label",49),c(3," I would like two of the team from Leaf Water to attend rather than just one "),o()()),t&2){let e=d().index,i=d(2);s(),k("name","additionalSEWPresence"+e),k("id","additionalSEWPresence"+e),a("ngClass",T(4,ye,i.submitted&&i.getElement("additionalSEWPresence",e).errors,i.getElement("additionalSEWPresence",e).touched&&i.getElement("additionalSEWPresence",e).valid)),s(),k("for","additionalSEWPresence"+e)}}function Io(t,l){if(t&1&&(n(0,"div"),u(1,"input",79),n(2,"label",49),c(3," I would like two of the team from ESP Water to attend rather than just one "),o()()),t&2){let e=d().index,i=d(2);s(),k("name","additionalSEWPresence"+e),k("id","additionalSEWPresence"+e),a("ngClass",T(4,ye,i.submitted&&i.getElement("additionalSEWPresence",e).errors,i.getElement("additionalSEWPresence",e).touched&&i.getElement("additionalSEWPresence",e).valid)),s(),k("for","additionalSEWPresence"+e)}}function Ro(t,l){t&1&&(n(0,"span",80),c(1," Please add your requirements"),o())}function Fo(t,l){if(t&1&&(n(0,"span",81),c(1),o()),t&2){let e=l.$implicit;s(),ne(" ",e,"")}}function Ao(t,l){if(t&1&&u(0,"fa-icon",43),t&2){let e=d(4);a("icon",e.faCheckCircle)}}function No(t,l){if(t&1){let e=b();n(0,"div",82)(1,"button",83),v("click",function(){let r=h(e).index,m=d().$implicit,p=d(2);return g(p.psrClick(m,r,"medicallyDependent"))}),_(2,Ao,1,1,"fa-icon",84),c(3),o()()}if(t&2){let e=l.$implicit,i=l.index;
1a("formGroupName",i),s(2),a("ngIf",e.value.applicable==="true"),s(),ne(" ",e.value.description," ")}}function Mo(t,l){if(t&1&&u(0,"fa-icon",43),t&2){let e=d(4);a("icon",e.faCheckCircle)}}function Do(t,l){if(t&1){let e=b();n(0,"div",82)(1,"button",83),v("click",function(){let r=h(e).index,m=d().$implicit,p=d(2);return g(p.psrClick(m,r,"communicationDependent"))}),_(2,Mo,1,1,"fa-icon",84),c(3),o()()}if(t&2){let e=l.$implicit,i=l.index;a("formGroupName",i),s(2),a("ngIf",e.value.applicable==="true"),s(),ne(" ",e.value.description," ")}}function Vo(t,l){if(t&1&&(n(0,"div",85)(1,"div",86)(2,"div",87)(3,"div",47),u(4,"input",88),n(5,"label",49),c(6,"Braille bill"),o()(),n(7,"div",47),u(8,"input",89),n(9,"label",49),c(10,"Large print bill"),o()(),n(11,"div",47),u(12,"input",90),n(13,"label",49),c(14,"Audio bill"),o()()()()()),t&2){let e=d().index;s(4),k("id","brailleBill"+e),s(),k("for","brailleBill"+e),s(3),k("id","largePrintBill"+e),s(),k("for","largePrintBill"+e),s(3),k("id","audioBill"+e),s(),k("for","audioBill"+e)}}function Po(t,l){if(t&1&&u(0,"fa-icon",43),t&2){let e=d(4);a("icon",e.faCheckCircle)}}function Bo(t,l){if(t&1){let e=b();n(0,"div",82)(1,"button",83),v("click",function(){let r=h(e).index,m=d().$implicit,p=d(2);return g(p.psrClick(m,r,"safety"))}),_(2,Po,1,1,"fa-icon",84),c(3),o()()}if(t&2){let e=l.$implicit,i=l.index;a("formGroupName",i),s(2),a("ngIf",e.value.applicable==="true"),s(),ne(" ",e.value.description," ")}}function Lo(t,l){if(t&1&&u(0,"fa-icon",43),t&2){let e=d(4);a("icon",e.faCheckCircle)}}function Oo(t,l){if(t&1){let e=b();n(0,"div",82)(1,"button",83),v("click",function(){let r=h(e).index,m=d().$implicit,p=d(2);return g(p.psrClick(m,r,"mobilityDependent"))}),_(2,Lo,1,1,"fa-icon",84),c(3),o()()}if(t&2){let e=l.$implicit,i=l.index;a("formGroupName",i),s(2),a("ngIf",e.value.applicable==="true"),s(),ne(" ",e.value.description," ")}}function qo(t,l){if(t&1&&u(0,"fa-icon",43),t&2){let e=d(4);a("icon",e.faCheckCircle)}}function Ho(t,l){if(t&1){let e=b();n(0,"div",82)(1,"button",83),v("click",function(){let r=h(e).index,m=d().$implicit,p=d(2);return g(p.psrClick(m,r,"temporaryDependent"))}),_(2,qo,1,1,"fa-icon",84),c(3),o()()}if(t&2){let e=l.$implicit,i=l.index;a("formGroupName",i),s(2),a("ngIf",e.value.applicable==="true"),s(),ne(" ",e.value.description," ")}}function jo(t,l){if(t&1){let e=b();n(0,"div",92),c(1," Please enter the date of birth of your youngest child "),n(2,"div",39),u(3,"input",93,2),n(6,"div",41)(7,"button",42),v("click",function(){h(e);let r=oe(5);return g(r.toggle())}),u(8,"fa-icon",43),o()()(),u(9,"app-input-error-message",94),o()}if(t&2){let e=d(2).index,i=d(2);s(3),k("id","youngestDateOfBirth"+e),a("ngClass",T(6,ye,i.submitted&&i.getElement("youngestDateOfBirth",e).errors,i.getElement("youngestDateOfBirth",e).touched&&i.getElement("youngestDateOfBirth",e).valid))("bsConfig",i.bsConfig)("minDate",i.minDate),s(5),a("icon",i.faCalendarDay),s(),a("displayErrorIf",i.submitted&&i.getElement("youngestDateOfBirth",e).errors)}}function Uo(t,l){if(t&1){let e=b();n(0,"div",92),c(1," Please enter when you are hoping to recover by "),n(2,"div",39),u(3,"input",95,3),n(6,"div",41)(7,"button",42),v("click",function(){h(e);let r=oe(5);return g(r.toggle())}),u(8,"fa-icon",43),o()()(),u(9,"app-input-error-message",96),o()}if(t&2){let e=d(2).index,i=d(2);s(3),k("id","temporaryChangeDate"+e),a("ngClass",T(6,ye,i.submitted&&i.getElement("temporaryChangeDate",e).errors,i.getElement("temporaryChangeDate",e).touched&&i.getElement("temporaryChangeDate",e).valid))("bsConfig",i.bsConfig)("minDate",i.todayDate),s(5),a("icon",i.faCalendarDay),s(),a("displayErrorIf",i.submitted&&i.getElement("temporaryChangeDate",e).errors)}}function Wo(t,l){if(t&1&&(n(0,"div",85),_(1,jo,10,9,"div",91)(2,Uo,10,9,"div",91),o()),t&2){let e=d().$implicit;s(),a("ngIf",e.get("temporaryDependent").controls[0].value.applicable==="true"),s(),a("ngIf",e.get("temporaryDependent").controls[4].value.applicable==="true")}}function Go(t,l){if(t&1){let e=b();n(0,"div",26)(1,"div",27)(2,"div",28)(3,"h3"),c(4),o()(),n(5,"div",29)(6,"h4")(7,"label",30),c(8,"Title"),o()(),u(9,"input",31)(10,"app-input-error-message",32),o(),n(11,"div",29)(12,"h4")(13,"label",30),c(14,"First name"),o()(),u(15,"input",33)(16,"app-input-error-message",34),o(),n(17,"div",29)(18,"h4")(19,"label",30),c(20,"Last name"),o()(),u(21,"input",35)(22,"app-input-error-message",36),o()(),n(23,"div",37)(24,"div",38)(25,"h4")(26,"label",30),c(27,"Date of birth"),o()(),n(28,"div",39),u(29,"input",40,1),n(32,"div",41)(33,"button",42),v("click",function(){h(e);let r=oe(30);
1return g(r.toggle())}),u(34,"fa-icon",43),o()()(),u(35,"app-input-error-message",44),o()(),n(36,"div",37)(37,"div",45)(38,"fieldset")(39,"legend")(40,"h4")(41,"label",46),c(42,"Can someone in your household collect water from a water station, if you were to lose your water supply?"),o()()(),n(43,"div",47),u(44,"input",48),n(45,"label",49),c(46," Yes "),o()(),n(47,"div",47),u(48,"input",48),n(49,"label",49),c(50," No "),o()()()()(),_(51,Co,8,7,"div",50)(52,So,15,14,"div",50),n(53,"div",37)(54,"div",16)(55,"legend")(56,"h4",51)(57,"label",52),c(58,"If we need to make a visit in person"),o()(),n(59,"small"),c(60,"You only need to select an option if you have a preference"),o()()(),n(61,"div",53)(62,"div",54),_(63,Eo,4,7,"div",12)(64,xo,4,7,"div",12)(65,wo,4,7,"div",12)(66,ko,4,7,"div",12)(67,To,4,7,"div",12)(68,Io,4,7,"div",12),o()(),n(69,"div",53)(70,"div",54),u(71,"input",55),n(72,"label",49),c(73," I would like someone I know with me before you attend "),o()()()(),n(74,"div",37)(75,"div",56)(76,"legend")(77,"h4")(78,"label",52),c(79,"Requirements"),o()()(),n(80,"div",57),_(81,Ro,2,0,"span",58),o(),u(82,"app-input-error-message",59),_(83,Fo,2,1,"span",60),u(84,"input",61),o()(),n(85,"div",37)(86,"div",62)(87,"h3",63),c(88,"Medically Dependent"),o(),n(89,"div",64),_(90,No,4,3,"div",65),o()()(),n(91,"div",37)(92,"div",62)(93,"h3",63),c(94,"Communication"),o(),n(95,"div",66),_(96,Do,4,3,"div",65),o(),_(97,Vo,15,6,"div",67),o()(),n(98,"div",37)(99,"div",62)(100,"h3",63),c(101,"Safety"),o(),n(102,"div",68),_(103,Bo,4,3,"div",65),o()()(),n(104,"div",37)(105,"div",62)(106,"h3",63),c(107,"Mobility"),o(),n(108,"div",69),_(109,Oo,4,3,"div",65),o()()(),n(110,"div",37)(111,"div",62)(112,"h3",63),c(113,"Other"),o(),n(114,"div",70),_(115,Ho,4,3,"div",65),o(),_(116,Wo,3,2,"div",67),o()(),n(117,"div",37)(118,"div",62)(119,"button",71),v("click",function(){let r=h(e).index,m=d(2);return g(m.onDeletePerson(r))}),c(120," Remove Person "),o()()()()}if(t&2){let e=l.$implicit,i=l.index,r=d(2);a("formGroupName",i),s(3),wi(r.company==="MUA"?"text-secondary-light":"text-primary"),s(),ne(" Person ",i+1," "),s(3),k("for","title"+i),s(2),k("name","title"+i),k("id","title"+i),a("ngClass",T(58,ye,r.submitted&&r.getElement("title",i).errors,r.getElement("title",i).touched&&r.getElement("title",i).valid)),s(),a("displayErrorIf",r.submitted&&r.getElement("title",i).errors),s(3),k("for","firstname"+i),s(2),k("name","firstname"+i),k("id","firstname"+i),a("ngClass",T(61,ye,r.submitted&&r.getElement("firstName",i).errors,r.getElement("firstName",i).touched&&r.getElement("firstName",i).valid)),s(),a("displayErrorIf",r.submitted&&r.getElement("firstName",i).errors),s(3),k("for","lastname"+i),s(2),k("name","lastname"+i),k("id","lastname"+i),a("ngClass",T(64,ye,r.submitted&&r.getElement("lastName",i).errors,r.getElement("lastName",i).touched&&r.getElement("lastName",i).valid)),s(),a("displayErrorIf",r.submitted&&r.getElement("lastName",i).errors),s(4),k("for","dateOfBirth"+i),s(3),k("name","dateOfBirth"+i),k("id","dateOfBirth"+i),a("ngClass",T(67,ye,r.submitted&&r.getElement("dateOfBirth",i).errors,r.getElement("dateOfBirth",i).touched&&r.getElement("dateOfBirth",i).valid))("bsConfig",r.bsConfig)("bsConfig",r.bsConfig)("minDate",r.DOBMinDate)("maxDate",r.todayDate),s(5),a("icon",r.faCalendarDay),s(),a("displayErrorIf",r.submitted&&r.getElement("dateOfBirth",i).errors),s(9),k("id","ableToCollectWaterYes"+i),a("value",!0),s(),k("for","ableToCollectWaterYes"+i),s(3),k("id","ableToCollectWaterNo"+i),a("value",!1),s(),k("for","ableToCollectWaterNo"+i),s(2),a("ngIf",i==0),s(),a("ngIf",i==0),s(11),a("ngIf",r.company==="SEW"),s(),a("ngIf",r.company==="ICOSA"),s(),a("ngIf",r.company==="MTX"),s(),a("ngIf",r.company==="MUA"),s(),a("ngIf",r.company==="LEF"),s(),a("ngIf",r.company==="ESP"),s(3),k("id","additionalCustomerPresence"+i),a("ngClass",T(70,ye,r.submitted&&r.getElement("additionalCustomerPresence",i).errors,r.getElement("additionalCustomerPresence",i).touched&&r.getElement("additionalCustomerPresence",i).valid)),s(),k("for","additionalCustomerPresence"+i),s(9),a("ngIf",!e.get("psrCodesSelected").value||e.get("psrCodesSelected").value.length<1),s(),a("displayErrorIf",r.submitted&&r.getElement("psrCodesSelected",i).errors),s(),a("ngForOf",e.get("psrCodesSelected").value),s(),k("id","psrCodesSelected"+i),s(6),a("ngForOf",e.get("medicallyDependent").controls),s(6),a("ngForOf",e.get("communicationDependent").controls),s(),a("ngIf",e.get("communicationDependent").controls[1].value.applicable==="true"||e.get("communicationDependent").controls[2].value.applicable==="true"),s(6),a("ngForOf",e.get("safety").controls),s(6),a("ngForOf",e.get("mobilityDependent").controls),s(6),a("ngForOf",e.get("temporaryDependent").controls),s(),a("ngIf",e.get("temporaryDependent").controls[0].value.applicable==="true"||e.get("temporaryDependent").controls[4].value.applicable==="true")}}function Yo(t,l){if(t&1){let e=b();n(0,"div",97)(1,"button",98),v("click",function(){h(e);let r=d(2);return g(r.onCancel())}),c(2," Cancel "),o(),n(3,"button",99),c(4," Submit "),o()()}if(t&2){let e=d(2);s(3),a("disabled",e.submittedForm)}}function Qo(t,l){t&1&&(n(0,"span"),c(1,"a"),o())}function zo(t,l){t&1&&(n(0,"span"),c(1,"another"),o())}function $o(t,l){if(t&1){let e=b();n(0,"div",7)(1,"div",8)(2,"div",9)(3,"form",10),v("ngSubmit",function(){h(e);let r=d();return g(r.onSubmit())}),n(4,"h2",7),c(5," Priority Services Register "),o(),_(6,oo,2,0,"alert",11)(7,ao,2,0,"p",12)(8,so,13,0,"ul",12)(9,lo,22,1,"div",12)(10,po,3,2,"div",12)(11,fo,2,1,"div",12)(12,go,2,1,"div",12)(13,_o,2,1,"div",12)(14,bo,2,1,"div",12),n(15,"div",13),_(16,Go,121,73,"div",14),o(),n(17,"div",15)(18,"div",16),_(19,Yo,5,1,"div",17),n(20,"button",18),v("click",function(){h(e);let r=d();return g(r.addPerson())}),c(21," Add "),_(22,Qo,2,0,"span",12)(23,zo,2,0,"span",12),c(24," person "),o()()()()()()()}if(t&2){let e=d();a("ngClass",e.company==="LMH"?"bg-primary":"bg-primary-light"),s(3),a("formGroup",e.form),s(),a("ngClass",e.company==="MUA"?"text-secondary-light":"text-primary"),s(2),a("ngIf",e.psr&&(e.psr==null?null:e.psr.length)>0&&e.personControls&&e.personControls.length>0),s(),a("ngIf",e.sector!=="ENERGY"&&(!e.personControls||e.personControls.length<1)),s(),a("ngIf",e.sector!=="ENERGY"&&(!e.personControls||e.personControls.length<1)),s(),a("ngIf",e.sector==="ENERGY"&&(!e.personControls||e.personControls.length<1)),s(),a("ngIf",e.company==="SEW"),s(),a("ngIf",e.company==="ICOSA"),s(),a("ngIf",e.company==="MTX"),s(),a("ngIf",e.company==="MUA"),s(),a("ngIf",e.company==="LEF"),s(2),a("ngForOf",e.personControls),s(3),a("ngIf",e.personControls&&e.personControls.length>0),s(3),a("ngIf",!e.personControls||e.personControls.length<1),s(),a("ngIf",e.personControls&&e.personControls.length>0)}}function Xo(t,l){if(t&1&&(n(0,"div"),u(1,"i",7),o()),t&2){let e=d(2);s(),a("ngClass",e.success?"bg-secondary fal fa-check":"bg-danger shadow fal fa-times")}}
1function Jo(t,l){t&1&&(n(0,"div")(1,"div",107),V(),n(2,"svg",108),u(3,"path",109),o(),n(4,"svg",110),u(5,"path",111),o()()())}function Zo(t,l){t&1&&(n(0,"div")(1,"div",112),V(),n(2,"svg",108),u(3,"path",109),o(),n(4,"svg",113),u(5,"path",114),o()()())}function Ko(t,l){if(t&1&&(n(0,"div"),_(1,Jo,6,0,"div",12)(2,Zo,6,0,"div",12),o()),t&2){let e=d(2);s(),a("ngIf",e.success),s(),a("ngIf",!e.success)}}function ea(t,l){if(t&1){let e=b();n(0,"div",100),_(1,Xo,2,1,"div",12)(2,Ko,3,2,"div",12),o(),n(3,"div",101),u(4,"h4",102),o(),n(5,"div",103),u(6,"p",104),o(),n(7,"div",105)(8,"button",106),v("click",function(){h(e);let r=d();return g(r.closeModal())}),c(9," Close "),o(),n(10,"button",106),v("click",function(){h(e);let r=d();return g(r.onCallBack())}),c(11," Call back "),o()()}if(t&2){let e=d();s(),a("ngIf",e.company==="SEW"||e.company==="ESP"),s(),a("ngIf",e.company==="ICOSA"||e.company==="MTX"||e.company==="MUA"||e.company==="LEF"),s(2),a("innerHTML",e.modalTitle,F),s(2),a("innerHTML",e.modalBody,F)}}function ta(t,l){if(t&1){let e=b();n(0,"app-request-a-call-back",115),v("status",function(r){h(e);let m=d();return g(m.getMessage(r))}),o()}t&2&&a("defaultOption","Help with additional needs")}var mr=(()=>{let l=class l{ngOnInit(){this.bsConfig=Object.assign({},{containerClass:this.colorTheme,dateInputFormat:"DD/MM/YYYY"}),this.analyticsService.pageView("psr-form","./psr-form","psr form"),this.customerSubscription=this.customerService.customerChange.subscribe(i=>{this.customer=i,this.psrTariffs=[],this.psr=[],this.customer?.priorityServiceRegisters?.filter(r=>{r.category.toUpperCase()==="TARIFF"?this.psrTariffs.push(r):this.psr.push(r)})}),this.customer=this.customerService.getCustomer(),this.customer&&(this.psrTariffs=[],this.psr=[],this.customer?.priorityServiceRegisters?.filter(i=>{i.category.toUpperCase()==="TARIFF"?this.psrTariffs.push(i):this.psr.push(i)})),this.globalSettings=this.globalSettingsService.getGlobalSettings(),this.globalSettingsService.globalSettingsChange.subscribe(i=>{this.globalSettings=i})}constructor(i,r,m,p,y,C,w,I,S,D,L,P,R,Z,wt,li){this.authService=i,this.fb=r,this.route=m,this.router=p,this.pageScrollService=y,this.document=C,this.spinner=w,this.spinnerSevice=I,this.location=S,this.customerService=D,this.preferencesService=L,this.modalService=P,this.globalSettingsService=R,this.analyticsService=Z,this.activatedRoute=wt,this.contactDetailsService=li,this.loggedIn=!1,this.faCalendarDay=Xe,this.faCheckCircle=mt,this.submitted=!1,this.submittedForm=!1,this.subscriptions=[],this.requestACallBack=!1,this.company=x.company,this.sector=x.sector,this.application=x.application,this.psrTariffs=[],this.psr=[],this.colorTheme="theme-default",this.config={animated:!0,keyboard:!0,backdrop:!0,ignoreBackdropClick:!1,class:""},this.isLoggedIn$=this.authService.isLoggedIn.subscribe(Ir=>this.loggedIn=Ir),this.form=this.fb.group({persons:this.fb.array([])});let it=(0,tt.default)().subtract(5,"years");this.minDate=it.toDate(),it=(0,tt.default)().subtract(120,"years"),this.DOBMinDate=it.toDate(),it=(0,tt.default)(),this.todayDate=it.toDate()}addPerson(){let i=document.querySelector(".ng-invalid[formControlName]");if(this.form.invalid){this.submitted=!0,this.focusOnError(i);return}else{let r=this.form.controls.persons;this.submitted=!1,(!r||r.length==0)&&this.pageScrollService.scroll({document:this.document,scrollTarget:"#topnav",duration:0}),r.push(this.fb.group({title:[null,[E.required,E.maxLength(16)]],firstName:[null,[E.required,E.maxLength(30)]],lastName:[null,[E.required,E.maxLength(30)]],dateOfBirth:[null,[E.required]],child:[!1,[E.required]],accountPassword:[null,[]],ableToCollectWater:[!0,[E.required]],powerOfAttorney:[null,[]],authorisedThirdPartyName:[null,[]],psrCodesSelected:[null,[E.required]],bill:[!1,[]],preferredLanguage:[null,[]],additionalSEWPresence:[null,[]],additionalCustomerPresence:[null,[]],youngestDateOfBirth:[null,[]],temporaryChangeDate:[null,[]],medicallyDependent:this.fb.array([this.fb.group({code:"mentalHealth",description:"Mental health",applicable:"false"}),this.fb.group({code:"dialysis",description:"Dialysis",applicable:"false"}),this.fb.group({code:"dementia",description:"Dementia",applicable:"false"}),this.fb.group({code:"chronic",description:"Chronic or serious illness",applicable:"false"})]),temporaryDependent:this.fb.array([this.fb.group({code:"youngChild",description:"Child under 5 years old",applicable:"false"}),this.fb.group({code:"lifeChangeBreavement",description:"Recent bereavement",applicable:"false"}),this.fb.group({code:"youngAdult",description:"Bill payer under 18",applicable:"false"}),this.fb.group({code:"olderAdult",description:"Pensionable Age",applicable:"false"}),this.fb.group({code:"hospital",description:"Post hospital recovery",applicable:"false"}
1)]),communicationDependent:this.fb.array([this.fb.group({code:"developmental",description:"Developmental condition",applicable:"false"}),this.fb.group({code:"blind",description:"Blind",applicable:"false"}),this.fb.group({code:"partiallySighted",description:"Partially sighted",applicable:"false"}),this.fb.group({code:"hearing",description:"Deaf or hard of hearing",applicable:"false"}),this.fb.group({code:"speech",description:"Speech difficulties",applicable:"false"}),this.fb.group({code:"nonEnglishSpeaker",description:"Non English Speaker",applicable:"false"})]),mobilityDependent:this.fb.array([this.fb.group({code:"physical",description:"Physical impairment",applicable:"false"}),this.fb.group({code:"unableToAnswerDoor",description:"Unable to answer door",applicable:"false"}),this.fb.group({code:"restrictedHand",description:"Restricted hand movement",applicable:"false"})]),safety:this.fb.array([this.fb.group({code:"smell",description:"Poor sense of smell",applicable:"false"}),this.fb.group({code:"taste",description:"Poor sense of taste",applicable:"false"})])}))}}get medicallyDependent(){return this.fb.group({code:"",description:"",applicable:!1})}get personControls(){return this.form.get("persons").controls}get medicalControls(){return this.form.get("medicallyDependent").controls}clickme(i){}psrClick(i,r,m){let p=i.get("psrCodesSelected").value,y=!1;if(p||(p=[]),i.get(m).controls[r].value.applicable=="true"){y=!1;let C=0;for(let w of p)w==i.get(m).controls[r].value.description&&(y=!0),C++;i.get(m).controls[r].value.code==="youngChild"&&(i.get("youngestDateOfBirth").setValidators([E.required]),i.get("youngestDateOfBirth").setErrors(null)),i.get(m).controls[r].value.code==="hospital"&&(i.get("temporaryChangeDate").setValidators([E.required]),i.get("temporaryChangeDate").setErrors(null)),y||p.push(i.get(m).controls[r].value.description)}else{let C=0;for(let w of p)w==i.get(m).controls[r].value.description&&p.splice(C,1),C++;i.get(m).controls[r].value.code==="youngChild"&&(i.get("youngestDateOfBirth").setValidators(),i.get("youngestDateOfBirth").setErrors(null)),i.get(m).controls[r].value.code==="hospital"&&(i.get("temporaryChangeDate").setValidators(),i.get("temporaryChangeDate").setErrors(null))}i.patchValue({psrCodesSelected:p})}onDeletePerson(i){this.form.get("persons").removeAt(i)}outputme(i){}focusOnError(i){i&&i.focus()}getElement(i,r){return this.form.controls.persons.controls[r].get(i)}onCancel(){if(this.application==="CRM")try{window.close()}catch{try{self.close()}catch{console.log("cannot close window")}}else this.loggedIn?(this.location.back(),this.pageScrollService.scroll({document:this.document,scrollTarget:"#topnav",duration:300})):this.router.navigate(["/"])}onSubmit(){this.submitted=!0;let i=this.activatedRoute.snapshot.queryParamMap.get("contactMethod")?this.activatedRoute.snapshot.queryParamMap.get("contactMethod"):"Y",r=this.activatedRoute.snapshot.queryParamMap.get("telephoneNumber"),m=this.activatedRoute.snapshot.queryParamMap.get("callerName");!i&&!r&&!m&&(i=this.contactDetailsService.contactMethod,r=this.contactDetailsService.eventTelephoneNumber,m=this.contactDetailsService.eventCallerName);let p=document.querySelector(".ng-invalid[formControlName]");if(this.form.invalid){this.focusOnError(p);return}else{this.success=null,this.spinnerSevice.setSpinnerDescription("updating Priority Services Register info ..."),this.priorityServiceRegisterRequest=new It(this.customer.customerReference,this.customer.checkDigit,"","UPDATE",this.globalSettings.uid,"","","","","","",0,0,r,m,i,[],[],[]);let y=0,C=0,w=null,I=null;for(let S of this.form.controls.persons.value){S.dateOfBirth?(w=tt.default.utc(S.dateOfBirth.getMonth()+1+"-"+S.dateOfBirth.getDate()+"-"+S.dateOfBirth.getFullYear(),"MM-DD-YYYY").toJSON(),I=(0,tt.default)(new Date).diff(w,"years")<18):(w=null,I=null),I&&C++,y++;let D=new Zi(S.title,S.firstName,S.lastName,w,I,y);this.priorityServiceRegisterRequest.psrPersonsAffected.push(D);for(let R of S.medicallyDependent)if(R.applicable=="true"){let Z=new Be("Medical",R.description,null,y);this.priorityServiceRegisterRequest.psrReasons.push(Z)}let L=null,P=null;S.youngestDateOfBirth&&(L=tt.default.utc(S.youngestDateOfBirth.getMonth()+1+"-"+S.youngestDateOfBirth.getDate()+"-"+S.youngestDateOfBirth.getFullYear(),"MM-DD-YYYY").toJSON()),S.temporaryChangeDate&&(P=tt.default.utc(S.temporaryChangeDate.getMonth()+1+"-"+S.temporaryChangeDate.getDate()+"-"+S.temporaryChangeDate.getFullYear(),"MM-DD-YYYY").toJSON());for(let R of S.temporaryDependent)if(R.applicable=="true"){let Z=new Be("Temporary",R.description,R.code=="youngChild"?L:R.c
1ode=="hospital"?P:null,y);this.priorityServiceRegisterRequest.psrReasons.push(Z)}for(let R of S.communicationDependent)if(R.applicable=="true"){let Z=new Be("Communication",R.description,null,y);this.priorityServiceRegisterRequest.psrReasons.push(Z)}for(let R of S.mobilityDependent)if(R.applicable=="true"){let Z=new Be("Mobility",R.description,null,y);this.priorityServiceRegisterRequest.psrReasons.push(Z)}for(let R of S.safety)if(R.applicable=="true"){let Z=new Be("Safety",R.description,null,y);this.priorityServiceRegisterRequest.psrReasons.push(Z)}if(S.accountPassword){let R=new Be("Safety","Password",null,y);this.priorityServiceRegisterRequest.psrReasons.push(R);let Z=new Le("Account password",S.accountPassword,y);this.priorityServiceRegisterRequest.psrRequests.push(Z)}if(S.powerOfAttorney){let R=new Be("Safety","Power of attorney",null,y);this.priorityServiceRegisterRequest.psrReasons.push(R);let Z=new Le("Power of attorney",S.powerOfAttorney,y);this.priorityServiceRegisterRequest.psrRequests.push(Z)}if(S.authorisedThirdPartyName){let R=new Be("Safety","3rd party name",null,y);this.priorityServiceRegisterRequest.psrReasons.push(R);let Z=new Le("3rd party name",S.authorisedThirdPartyName,y);this.priorityServiceRegisterRequest.psrRequests.push(Z)}if(this.sector!=="ENERGY"){let R=new Be("Safety","Collect water",null,y);this.priorityServiceRegisterRequest.psrReasons.push(R);let Z=new Le("Collect water",S.ableToCollectWater?"true":"false",y);this.priorityServiceRegisterRequest.psrRequests.push(Z)}if(S.additionalSEWPresence||S.additionalCustomerPresence){let R=new Be("Safety","Additional presence",null,y);if(this.priorityServiceRegisterRequest.psrReasons.push(R),S.additionalSEWPresence){let Z=new Le("Additional SEW presence","true",y);this.priorityServiceRegisterRequest.psrRequests.push(Z)}if(S.additionalCustomerPresence){let Z=new Le("Additional presence","true",y);this.priorityServiceRegisterRequest.psrRequests.push(Z)}}if(S.bill=="brailleBill"){let R=new Le("Bill option","Braille bill",y);this.priorityServiceRegisterRequest.psrRequests.push(R)}if(S.bill=="audioBill"){let R=new Le("Bill option","Audio bill",y);this.priorityServiceRegisterRequest.psrRequests.push(R)}if(S.bill=="largePrintBill"){let R=new Le("Bill option","Large print bill",y);this.priorityServiceRegisterRequest.psrRequests.push(R)}if(S.preferredLanguage){let R=new Le("Bill language",S.preferredLanguage,y);this.priorityServiceRegisterRequest.psrRequests.push(R)}}this.priorityServiceRegisterRequest.numberOccupants=y,this.priorityServiceRegisterRequest.numberChildren=C,this.success=null,this.spinnerSevice.setSpinnerDescription("updating Priority Services Register info ..."),this.spinner.show(),this.submittedForm=!0,this.preferencesService.getPSRUpdateResponse(this.priorityServiceRegisterRequest).subscribe(S=>{this.spinner.hide(),this.submittedForm=!1,this.returnMessage=S.data.returnMessage,this.success=this.returnMessage==="GREEN"||this.returnMessage==="GREEN:EXEMPT"||this.returnMessage==="AMBER",this.config.class=this.success?"success-modal":"warning-modal",this.modalTitle=this.success?"All complete":"Sorry we&apos;ve hit a problem",this.returnMessage==="GREEN:EXEMPT"?this.modalBody="Thanks for keeping us up to date. We have added you to our Priority Services Register.  You live in an area with a hosepipe ban but you have an exemption.  You may use your hosepipe but please do so sparingly to ensure there is enough water for everyone.":this.modalBody=this.success?"Thanks for keeping us up to date. We have added you to our Priority Services Register":"Oh no, I am so sorry but that didn&apos;t seem to work, could you complete the form again or you can request a callback if you want one of our specialist from our Customer Care Team to give you a ring",(this.returnMessage==="GREEN"||this.returnMessage==="GREEN:EXEMPT")&&pe.includes(this.company)&&(this.modalBody+=de),this.openModal(this.templateRef)},S=>{this.spinner.hide(),this.success=!1,this.submittedForm=!1,this.config.class=this.success?"success-modal":"danger-modal",this.modalTitle=this.success?"All complete":"Sorry we&apos;ve hit a problem",this.modalBody=this.success?"Thanks for keeping us up to date. We have added you to our Priority Services Register":"Oh no, I am so sorry but that didn&apos;t seem to work, could you complete the form again or you can request a callback if you want one of our specialist from our Customer Care Team to give you a ring",this.openModal(this.templateRef)})}}openModal(i){this.modalRef=this.modalService.show(i,Object.assign({},this.config)),this.subscriptions.push(this.modalService.onHide.subscribe(r=>{r=="backdrop-click"&&this.success&&(this.onCancel(),this.requestACallBack=!1)}))}onCallBack(){this.modalRef&&(this.modalRef.hide(),this.modalRef=null),this.requestACallBack=!0}getMessage(i){this.onCancel(),this.requestACallBack=!1}closeModal(){if(this.modalRef)this.success&&(this.onCancel(),this.requestACallBack=!1);else return;this.modalRef.hide(),this.modalRef=null}};l.\u0275fac=function(r){return new(r||l)(f(ht),f(le),f(K),f(Je),f(Q),f(W),f(G),f(Y),f(ee),f(te),f(ve),f(J),f(Re),f(ae),f(K),f(Et))},l.\u0275cmp=O({type:l,selectors:[["app-psr-form"]],viewQuery:function(r,m){if(r&1&&A(no,5),r&2){let p;N(p=M())&&(m.templateRef=p.first)}}
vendor: 1,666 bytes, line 1
1,decls:5,vars:2,consts:[["template",""],["dp","bsDatepicker","dateOfBirthErrorRef",""],["youngestDateOfBirthErrorRef","","dp","bsDatepicker"],["temporaryChangeDateErrorRef","","dp","bsDatepicker"],[3,"ngClass",4,"ngIf"],[1,"container"],[3,"defaultOption","status",4,"ngIf"],[3,"ngClass"],[1,"container","py-8"],[1,"form-wrap"],["id","form","name","form",3,"ngSubmit","formGroup"],["type","warning","class","text-center font-weight-bold",4,"ngIf"],[4,"ngIf"],["formArrayName","persons"],["class","my-2",3,"formGroupName",4,"ngFor","ngForOf"],[1,"row","mt-8"],[1,"col-12"],["class","btn-group float-right mt-2 ml-3",4,"ngIf"],["type","button",1,"btn","btn-primary","float-right","mt-2",3,"click"],["type","warning",1,"text-center","font-weight-bold"],[4,"ngif"],["href","https://corporate.southeastwater.co.uk/news-info/publications/customer-leaflets-and-codes-of-practice/"],["href","https://www.lmwater.co.uk/document-library/"],["href","https://matrixwater.co.uk/"],["href","https://www.muagroup.co.uk/sectors/water"],["href","https://www.leafwater.co.uk/privacy-policy"],[1,"my-2",3,"formGroupName"],[1,"row","my-2"],[1,"col-12","mb-2"],[1,"col-md-4","mb-1"],[1,"label","required",3,"for"],["type","text","formControlName","title","placeholder","title","maxlength","16","aria-describedby","title-error",1,"form-control","form-control-lg",3,"name","ngClass","id"],["errorMsg","Please enter a title","id","title-error",3,"displayErrorIf"],["type","text","formControlName","firstName","placeholder","first name","maxlength","30","aria-describedby","firstname-error",1,"form-control","form-control-lg",3,"name","ngClass","id"],["errorMsg","Please enter a first name","
1id","firstname-error",3,"displayErrorIf"],["type","text","formControlName","lastName","placeholder","last name","maxlength","30","aria-describedby","lastname-error",1,"form-control","form-control-lg",3,"name","ngClass","id"],["errorMsg","Please enter a last name","id","lastname-error",3,"displayErrorIf"],[1,"row","mt-3"],[1,"col-lg-5","mb-1"],[1,"input-group"],["placeholder","dd/mm/yyyy","formControlName","dateOfBirth","bsDatepicker","","aria-describedby","dob-error",1,"form-control","form-control-lg",3,"name","ngClass","bsConfig","minDate","maxDate","id"],[1,"input-group-append"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[3,"icon"],["errorMsg","Please enter a date of birth","id","dob-error",3,"displayErrorIf"],[1,"col-lg-12","mb-1"],[1,"label","required"],[1,"custom-control","custom-radio"],["type","radio","formControlName","ableToCollectWater",1,"custom-control-input",3,"id","value"],[1,"custom-control-label",3,"for"],["class","row mt-3",4,"ngIf"],[1,"pb-0","mb-0"],[1,"label"],[1,"col-md-6","mb-1"],[1,"custom-control","custom-checkbox"],["type","checkbox","formControlName","additionalCustomerPresence","name","additionalCustomerPresence","id","additionalCustomerPresence","aria-describedby","additionalCustomerPresence",1,"custom-control-input",3,"ngClass","id"],[1,"col-md-12","mb-1"],[1,"h3"],["class","badge badge-warning mr-1 px-2",4,"ngIf"],["errorMsg","Please select as least one requirement",3,"displayErrorIf"],["class","large badge badge-secondary mb-1 mr-1",4,"ngFor","ngForOf"],["type","text","formControlName","psrCodesSelected","hidden","true",1,"form-control","form-control-lg",3,"id"],[1,"col-12","mb-1"],[1,"mt-2"],["formArrayName","medicallyDependent",1,"row"],["class","col-md-6 col-lg-4 col-xl-3 my-2",3,"formGroupName",4,"ngFor","ngForOf"],["formArrayName","communicationDependent",1,"row"],["class","row",4,"ngIf"],["formArrayName","safety",1,"row"],["formArrayName","mobilityDependent",1,"row"],["formArrayName","temporaryDependent",1,"row"],["type","button",1,"btn","btn-danger","float-right",3,"click"],[1,"label",3,"for"],["type","text","formControlName","accountPassword","aria-describedby","password-hint",1,"form-control","form-control-lg",3,"ngClass","id","name"],["id","password-hint"],["type","text","formControlName","powerOfAttorney","aria-describedby","powerOFAttorney-hint",1,"form-control","form-control-lg",3,"ngClass","id","name"],["id","powerOFAttorney-hint"],["type","text","formControlName","authorisedThirdPartyName","aria-describedby","authorisedthirdpartyname-hint",1,"form-control","form-control-lg",3,"ngClass","id","name"],["id","authorisedthirdpartyname-hint"],["type","checkbox","formControlName","additionalSEWPresence",1,"custom-control-input",3,"name","ngClass","id"],[1,"badge","badge-warning","mr-1","px-2"],[1,"large","badge","badge-secondary","mb-1","mr-1"],[1,"col-md-6","col-lg-4","col-xl-3","my-2",3,"formGroupName"],["type","button","formControlName","applicable","btnCheckbox","","btnCheckboxTrue","true","btnCheckboxFalse","false",1,"btn","btn-info","btn-block","btn-lg","h-100",3,"click"],[3,"icon",4,"ngIf"],[1,"row"],[1,"col-12","my-2"],[1,"form-group"],["type","radio","formControlName","bill","aria-describedby","brailleBill","value","brailleBill",1,"custom-control-input",3,"id"],["type","radio","formControlName","bill","aria-describedby","largePrintBill","value","largePrintBill",1,"custom-control-input",3,"id"],["type","radio","formControlName","bill","aria-describedby","audioBill","value","audioBill",1,"custom-control-input",3,"id"],["class","col-md-6 col-lg-6 my-2",4,"ngIf"],[1,"col-md-6","col-lg-6","my-2"],["placeholder","dd/mm/yyyy","name","youngestDateOfBirth","formControlName","youngestDateOfBirth","bsDatepicker","",1,"form-control","form-control-lg",3,"ngClass","bsConfig","id","minDate"],["errorMsg","Please enter a date of birth",3,"displayErrorIf"],["placeholder","dd/mm/yyyy","name","temporaryChangeDate","formControlName","temporaryChangeDate","bsDatepicker","",1,"form-control","form-control-lg",3,"ngClass","bsConfig","id","minDate"],["errorMsg","Please enter a date",3,"displayErrorIf"],[1,"btn-group","float-right","mt-2","ml-3"],["type","button",1,"btn","btn-outline-danger","mx-3",3,"click"],["type","submit",1,"btn","btn-primary",3,"disabled"],[1,"icon-circle"],[1,"modal-header","justify-content-center"],[1,"modal-title",3,"innerHTML"],[1,"modal-body"],[1,"text-center",3,"innerHTML"],[1,"modal-footer","justify-content-center"],["type","button",1,"btn","btn-dark",3,"click"],[1,"icon-circle-inner","bg-active"],["xmlns","http://www.w3.org/2000/svg","width","279.5","height","268.79","viewBox","0 0 279.5 268.79",1,"pentagon"],["d","M856.134,1644.16a30,30,0,0,1-35.268,0L711.1,1564.41a30.009,30.009,0,0,1-10.9-33.55l41.926-129.04a30,30,0,0,1,28.532-20.73H906.338a30,30,0,0,1,28.532,20.73L976.8,1530.86a30.009,30.009,0,0,1-10.9,33.55Z","transform","translate(-698.75 -1381.09)"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 448 512","fill","white"],["d","M413.505 91.951L133.49 371.966l-98.995-98.995c-4.686-4.686-12.284-4.686-16.971 0L6.211 284.284c-4.686 4.686-4.686 12.284 0 16.971l118.794 118.794c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-11.314-11.314c-4.686-4.686-12.284-4.686-16.97 0z"],[1,"icon-circle-inner","bg-danger"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 512 512"],["d","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm101.8-262.2L295.6 256l62.2 62.2c4.7 4.7 4.7 12.3 0 17l-22.6 22.6c-4.7 4.7-12.3 4.7-17 0L256 295.6l-62.2 62.2c-4.7 4.7-12.3 4.7-17 0l-22.6-22.6c-4.7-4.7-4.7-12.3 0-17l62.2-62.2-62.2-62.2c-4.7-4.7-4.7-12.3 0-17l22.6-22.6c4.7-4.7 12.3-4.7 17 0l62.2 
162.2 62.2-62.2c4.7-4.7 12.3-4.7 17 0l22.6 22.6c4.7 4.7 4.7 12.3 0 17z"],[3,"status","defaultOption"]],template:function(r,m){r&1&&(_(0,$o,25,16,"div",4)(1,ea,12,4,"ng-template",null,0,q),n(3,"section",5),_(4,ta,1,1,"app-request-a-call-back",6),o()),r&2&&(a("ngIf",!m.requestACallBack),s(4),a("ngIf",m.requestACallBack))},dependencies:[H,ge,j,Fe,ce,$,se,je,vt,ie,z,Ct,X,re,Wt,Gt,Ie,Pi,Yt,Ke,et],styles:[".large[_ngcontent-%COMP%]{font-size:1.3em}"]});let t=l;return t})();var ia=["template"],hi=(t,l)=>({"is-invalid":t,"is-valid":l});function ra(t,l){if(t&1){let e=b();n(0,"div")(1,"p"),c(2,"This service is for:"),o(),n(3,"ul")(4,"li"),c(5,"Correcting a misspelt name"),o(),n(6,"li"),c(7,"Changing a surname due to marriage or divorce"),o(),n(8,"li"),c(9,"Advising us that you have changed your name by Deed Poll"),o()(),n(10,"p"),c(11,"This service is "),n(12,"strong"),c(13,"not"),o(),c(14," for:"),o(),n(15,"ul")(16,"li"),c(17,"Adding or removing account holders"),o()(),n(18,"div",7)(19,"button",8),v("click",function(){h(e);let r=d();return g(r.startForm())}),c(20," Start "),o()()()}}function na(t,l){if(t&1){let e=b();n(0,"div",13)(1,"input",41),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o(),n(2,"label",42),c(3," Deceased"),o()()}}function oa(t,l){if(t&1){let e=b();n(0,"form",9),v("ngSubmit",function(){h(e);let r=d();return g(r.onSubmit())}),n(1,"div",10)(2,"fieldset",11)(3,"legend")(4,"h4",12),c(5," Reason for name change? "),o()(),n(6,"div",13)(7,"input",14),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o(),n(8,"label",15),c(9," Marriage"),o()(),n(10,"div",13)(11,"input",16),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o(),n(12,"label",17),c(13," Divorce"),o()(),n(14,"div",13)(15,"input",18),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o(),n(16,"label",19),c(17," Misspelling"),o()(),n(18,"div",13)(19,"input",20),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o(),n(20,"label",21),c(21," Deed Poll"),o()(),_(22,na,4,0,"div",22),o()(),n(23,"div")(24,"div",10)(25,"fieldset",11)(26,"legend")(27,"h4",23),c(28,"New name details"),o()(),n(29,"small",24),c(30,"Fields marked with "),n(31,"span",25),c(32,"*"),o(),c(33," are required."),o(),n(34,"label",26),c(35,"Title"),o(),u(36,"app-input-error-message",27),n(37,"div",28)(38,"div",29)(39,"input",30),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o()()(),n(40,"label",31),c(41,"First name"),o(),u(42,"app-input-error-message",32),n(43,"div",28)(44,"div",33)(45,"input",34),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o()()(),n(46,"label",35),c(47,"Last name"),o(),u(48,"app-input-error-message",36),n(49,"div",28)(50,"div",33)(51,"input",37),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o()()()()(),n(52,"div",7)(53,"div",38)(54,"button",39),v("click",function(){h(e);let r=d();return g(r.onCancel())}),c(55," Cancel "),o(),n(56,"button",40),c(57," Submit "),o()()()()()}if(t&2){let e=d();a("formGroup",e.nameChangeForm),s(22),a("ngIf",e.application==="CRM"),s(14),a("displayErrorIf",e.submitted&&e.getNewTitle.errors),s(3),a("ngClass",T(9,hi,e.submitted&&e.getNewTitle.errors,e.getNewTitle.touched&&e.getNewTitle.valid)),s(3),a("displayErrorIf",e.submitted&&e.getNewFirstName.errors),s(3),a("ngClass",T(12,hi,e.submitted&&e.getNewFirstName.errors,e.getNewFirstName.touched&&e.getNewFirstName.valid)),s(3),a("displayErrorIf",e.submitted&&e.getNewLastName.errors),s(3),a("ngClass",T(15,hi,e.submitted&&e.getNewLastName.errors,e.getNewLastName.touched&&e.getNewLastName.valid)),s(5),a("disabled",e.submittedForm)}}function aa(t,l){if(t&1&&(n(0,"div"),u(1,"i",1),o()),t&2){let e=d(2);s(),a("ngClass",e.success?"bg-secondary fal fa-check":"bg-danger shadow fal fa-times")}}function sa(t,l){t&1&&(n(0,"div")(1,"div",50),V(),n(2,"svg",51),u(3,"path",52),o(),n(4,"svg",53),u(5,"path",54),o()()())}function la(t,l){t&1&&(n(0,"div")(1,"div",55),V(),n(2,"svg",51),u(3,"path",52),o(),n(4,"svg",56),u(5,"path",57),o()()())}function ca(t,l){if(t&1&&(n(0,"div"),_(1,sa,6,0,"div",5)(2,la,6,0,"div",5),o()),t&2){let e=d(2);s(),a("ngIf",e.success),s(),a("ngIf",!e.success)}}function ma(t,l){if(t&1){let e=b();n(0,"div",43),_(1,aa,2,1,"div",5)(2,ca,3,2,"div",5),o(),n(3,"div",44),u(4,"h4",45),o(),n(5,"div",46),u(6,"p",47),o(),n(7,"div",48)(8,"button",49),v("click",function(){h(e);let r=d();return g(r.closeModal())}),c(9," Close "),o()()}if(t&2){let e=d();s(),a("ngIf",e.company==="SEW"||e.company==="ESP"),s(),a("ngIf",e.company==="ICOSA"||e.company==="MTX"||e.company==="MUA"||e.company==="LEF"),s(2),a("innerHTML",e.modalTitle,F),s(2),a("innerHTML",e.modalBody,F)}}var dr=(()=>{let l=class l{constructor(i,r,m,p,y,C,w,I,S,D,L,P){this.fb=i,this.route=r,this.accountHolderService=m,this.customerService=p,this.pageScrollService=y,this.location=C,this.document=w,this.nameChangeService=I,this.spinnerSevice=S,this.spinner=D,this.modalService=L,this.analyticsService=P,this.application=x.application,this.faAngleLeft=qt,this.faAngleRight=Ot,this.showStart=!0,this.show
1Form=!1,this.submitted=!1,this.submittedForm=!1,this.subscriptions=[],this.company=x.company,this.config={animated:!0,keyboard:!0,backdrop:!0,ignoreBackdropClick:!1,class:""}}ngOnInit(){this.analyticsService.pageView("name-change-form","./name-change-form","name change form"),this.customerSubscription=this.customerService.customerChange.subscribe(i=>{this.customer=i}),this.customer=this.customerService.getCustomer(),this.accountHolderSubscription=this.accountHolderService.accountHoldersChange.subscribe(i=>{this.accountHolder=this.accountHolderService.getAccountHolder(this.id)}),this.nameChangeForm=this.fb.group({nameChangeReason:["marriage",E.required],newTitle:[null,[E.required,E.maxLength(14)]],newFirstName:[null,[E.required,E.maxLength(30)]],newLastName:[null,[E.required,E.maxLength(30)]]}),this.route.params.subscribe(i=>{this.id=+i.id})}initForm(){this.nameChangeForm.patchValue({newTitle:this.accountHolder?.accountHolderTitle,newFirstName:this.accountHolder?.accountHolderInitials,newLastName:this.accountHolder?.accountHolderSurname})}ngAfterViewInit(){this.pageScrollService.scroll({document:this.document,scrollTarget:".card-body",duration:300})}get getNameChangeReason(){return this.nameChangeForm.get("nameChangeReason")}get getNewTitle(){return this.nameChangeForm.get("newTitle")}get getNewFirstName(){return this.nameChangeForm.get("newFirstName")}get getNewLastName(){return this.nameChangeForm.get("newLastName")}focusOnError(i){i.focus()}startForm(){this.showStart=!1,this.showForm=!0,this.initForm()}onCancel(){this.location.back(),this.pageScrollService.scroll({document:this.document,scrollTarget:"#topnav",duration:300})}onSubmit(){this.submitted=!0;let i=document.querySelector(".ng-invalid[formControlName]");if(this.getNameChangeReason.errors||this.getNewTitle.errors||this.getNewFirstName.errors||this.getNewLastName.errors)this.focusOnError(i);else{let r=this.route.snapshot.queryParamMap.get("contactMethod")?this.route.snapshot.queryParamMap.get("contactMethod"):"Y";this.submittedForm=!0,this.showForm=!0,this.success=null,this.spinnerSevice.setSpinnerDescription("updating your name ..."),this.spinner.show(),this.nameChangeService.getNameChangeUpdateResponse(this.customer.customerReference,r,"UPDATE",this.getNameChangeReason.value,this.id+1,this.getNewTitle.value,this.getNewFirstName.value,this.getNewLastName.value).subscribe(m=>{this.spinner.hide(),this.returnMessage=m.data.returnMessage,this.submittedForm=!1,this.success=this.returnMessage==="GREEN"||this.returnMessage==="AMBER",this.config.class=this.success?"success-modal":"warning-modal",this.modalTitle=this.success?"All complete":"Sorry we&apos;ve hit a problem",this.modalBody=this.success&&this.returnMessage==="GREEN"?"That&apos;s all updated for you.  Thanks so much for keeping your details up to date.":this.success&&this.returnMessage==="AMBER"?"Thank you for updating your details. We are just checking a few bits and will update your account shortly.":"Oh no, I am so sorry but that didn&apos;t seem to work, could you complete the form again.",this.success===!0&&pe.includes(this.company)&&(this.modalBody+=de),this.openModal(this.templateRef)},m=>{this.submittedForm=!1,this.spinner.hide(),this.success=!1,this.config.class=this.success?"success-modal":"danger-modal",this.modalTitle=this.success?"All complete":"Sorry we&apos;ve hit a problem",this.modalBody=this.success?"That&apos;s all updated for you.  Thanks so much for keeping your details up to date.":"Oh no, I am so sorry but that didn&apos;t seem to work, could you complete the form again.",this.openModal(this.templateRef)})}}openModal(i){this.modalRef=this.modalService.show(i,Object.assign({},this.config)),this.subscriptions.push(this.modalService.onHide.subscribe(r=>{r==="backdrop-click"&&this.success&&this.onCancel()}))}closeModal(){if(this.modalRef)this.success&&this.onCancel();else return;this.modalRef.hide(),this.modalRef=null}ngOnDestroy(){this.customerSubscription.unsubscribe(),this.accountHolderSubscription.unsubscribe()}};l.\u0275fac=function(r){return new(r||l)(f(le),f(K),f(_e),f(te),f(Q),f(ee),f(W),f(We),f(Y),f(G),f(J),f(ae))},l.\u0275cmp=O({type:l,selectors:[["app-name-change-form"]],viewQuery:function(r,m){if(r&1&&A(ia,5),r&2){let p;N(p=M())&&(m.templateRef=p.first)}},decls:13,vars:4,consts:[["template",""],[3,"ngClass"],[1,"container","px-3","py-8","mx-auto"],["
1id","formHeader",1,"form-wrap"],["text","text-secondary"],[4,"ngIf"],[3,"formGroup","ngSubmit",4,"ngIf"],[1,"clearfix"],["type","button",1,"btn","btn-primary","float-right","mt-5",3,"click"],[3,"ngSubmit","formGroup"],[1,"form-group"],[1,"mt-6","mt-md-10"],["for","nameChangeReason",1,"label"],[1,"custom-control","custom-radio"],["formControlName","nameChangeReason","id","nameChangeReason1","name","nameChangeReason","type","radio","value","marriage",1,"custom-control-input",3,"keydown.enter"],["for","nameChangeReason1",1,"custom-control-label"],["formControlName","nameChangeReason","id","nameChangeReason2","name","nameChangeReason","type","radio","value","divorce",1,"custom-control-input",3,"keydown.enter"],["for","nameChangeReason2",1,"custom-control-label"],["formControlName","nameChangeReason","id","nameChangeReason3","name","nameChangeReason","type","radio","value","misspelling",1,"custom-control-input",3,"keydown.enter"],["for","nameChangeReason3",1,"custom-control-label"],["formControlName","nameChangeReason","id","nameChangeReason4","name","nameChangeReason","type","radio","value","deedpoll",1,"custom-control-input",3,"keydown.enter"],["for","nameChangeReason4",1,"custom-control-label"],["class","custom-control custom-radio",4,"ngIf"],[1,"label","mb-0"],[1,"hint"],[1,"text-danger"],["for","newTitle",1,"label","required"],["errorMsg","Please enter your title.","id","newTitleError",3,"displayErrorIf"],[1,"form-row"],[1,"col-md-3"],["formControlName","newTitle","name","newTitle","id","newTitle","type","text","maxlength","14","required","","aria-describedby","newTitleError",1,"form-control","form-control-lg",3,"keydown.enter","ngClass"],["for","newFirstName",1,"label","required"],["errorMsg","Please enter your first name.","id","newFirstNameError",3,"displayErrorIf"],[1,"col-xl-12","col-md-12"],["formControlName","newFirstName","name","newFirstName","id","newFirstName","type","text","maxlength","30","required","","aria-describedby","newFirstNameError",1,"form-control","form-control-lg",3,"keydown.enter","ngClass"],["for","newLastName",1,"label","required"],["errorMsg","Please enter your last name.","id","newLastNameError",3,"displayErrorIf"],["formControlName","newLastName","name","newLastName","id","newLastName","type","text","maxlength","30","required","","aria-describedby","newLastNameError",1,"form-control","form-control-lg",3,"keydown.enter","ngClass"],[1,"btn-group","float-right"],["type","button",1,"btn","btn-outline-danger","mx-3",3,"click"],["type","submit",1,"btn","btn-primary",3,"disabled"],["formControlName","nameChangeReason","id","nameChangeReason5","name","nameChangeReason","type","radio","value","deceased",1,"custom-control-input",3,"keydown.enter"],["for","nameChangeReason5",1,"custom-control-label"],[1,"icon-circle"],[1,"modal-header","justify-content-center"],[1,"modal-title",3,"innerHTML"],[1,"modal-body"],[1,"text-center",3,"innerHTML"],[1,"modal-footer","justify-content-center"],["type","button",1,"btn","btn-dark",3,"click"],[1,"icon-circle-inner","bg-active"],["xmlns","http://www.w3.org/2000/svg","width","279.5","height","268.79","viewBox","0 0 279.5 268.79",1,"pentagon"],["d","M856.134,1644.16a30,30,0,0,1-35.268,0L711.1,1564.41a30.009,30.009,0,0,1-10.9-33.55l41.926-129.04a30,30,0,0,1,28.532-20.73H906.338a30,30,0,0,1,28.532,20.73L976.8,1530.86a30.009,30.009,0,0,1-10.9,33.55Z","transform","translate(-698.75 -1381.09)"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 448 512","fill","white"],["d","M413.505 91.951L133.49 371.966l-98.995-98.995c-4.686-4.686-12.284-4.686-16.971 0L6.211 284.284c-4.686 4.686-4.686 12.284 0 16.971l118.794 118.794c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-11.314-11.314c-4.686-4.686-12.284-4.686-16.97 0z"],[1,"icon-circle-inner","bg-danger"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 512 512"],["d","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm101.8-262.2L295.6 256l62.2 62.2c4.7 4.7 4.7 12.3 0 17l-22.6 22.6c-4.7 4.7-12.3 4.7-17 0L256 295.6l-62.2 62.2c-4.7 4.7-12.3 4.7-17 0l-22.6-22.6c-4.7-4.7-4.7-12.3 0-17l62.2-62.2-62.2-62.2c-4.7-4.7-4.7-12.3 0-17l22.6-22.6c4.7-4.7 12.3-4.7 17 0l62.2 
162.2 62.2-62.2c4.7-4.7 12.3-4.7 17 0l22.6 22.6c4.7 4.7 4.7 12.3 0 17z"]],template:function(r,m){r&1&&(n(0,"section",1)(1,"div",2)(2,"div",3)(3,"h2",4),c(4,"Update your name"),o(),n(5,"p"),c(6," Name you are updating: "),n(7,"strong"),c(8),o()(),_(9,ra,21,0,"div",5)(10,oa,58,18,"form",6),o()()(),_(11,ma,10,4,"ng-template",null,0,q)),r&2&&(a("ngClass",m.company==="LMH"?"bg-primary":"bg-primary-light"),s(8),U(m.accountHolder==null?null:m.accountHolder.customerName),s(),a("ngIf",m.showStart),s(),a("ngIf",m.showForm))},dependencies:[H,j,ce,$,se,vt,ie,z,Ue,Ct,X,re]});let t=l;return t})();var gi=Dt(Qt());var da=["template"],vi=(t,l)=>({"is-invalid":t,"is-valid":l}),ot=t=>({"is-invalid":t});function pa(t,l){if(t&1){let e=b();n(0,"div",45)(1,"div",46)(2,"label",47),c(3,"Company name"),o(),u(4,"app-input-error-message",48)(5,"app-input-error-message",49),n(6,"input",50,6),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o()(),n(8,"div",46)(9,"label",51),c(10,"Company representative name"),o(),u(11,"app-input-error-message",52),n(12,"input",53,7),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o()(),n(14,"div",54)(15,"label",55),c(16,"Company trading as"),o(),u(17,"app-input-error-message",56),n(18,"input",57,8),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o()(),n(20,"div",54)(21,"label",58),c(22,"Company registration number (CRN)"),o(),u(23,"app-input-error-message",59),n(24,"input",60,9),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o()(),n(26,"div",54)(27,"label",61),c(28,"Company VAT number"),o(),n(29,"input",62),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o()()()}if(t&2){let e=d(2);s(4),a("displayErrorIf",e.submitted&&e.getElement("companyName").hasError("required")),s(),a("displayErrorIf",e.submitted&&e.getElement("companyName").hasError("maxlength")),s(),a("ngClass",B(13,ot,e.submitted&&e.getElement("companyName").errors)),De("aria-invalid",!e.contactDetailsForm.get("companyName").valid),s(5),a("displayErrorIf",e.submitted&&e.getElement("companyRepName").hasError("maxlength")),s(),a("ngClass",B(15,ot,e.submitted&&e.getElement("companyRepName").errors)),De("aria-invalid",!e.contactDetailsForm.get("companyRepName").valid),s(5),a("displayErrorIf",e.submitted&&e.getElement("companyTradingAs").hasError("maxlength")),s(),a("ngClass",B(17,ot,e.submitted&&e.getElement("companyTradingAs").errors)),De("aria-invalid",!e.contactDetailsForm.get("companyTradingAs").valid),s(5),a("displayErrorIf",e.submitted&&e.getElement("companyRegistrationNo").hasError("minlength")||e.getElement("companyRegistrationNo").hasError("maxlength")),s(),a("ngClass",B(19,ot,e.submitted&&e.getElement("companyRegistrationNo").errors)),De("aria-invalid",!e.contactDetailsForm.get("companyRegistrationNo").valid)}}function ua(t,l){if(t&1&&u(0,"app-input-error-message",27),t&2){let e=d(2);a("displayErrorIf",e.submitted&&e.getElement("emailAddress2").errors)}}function fa(t,l){if(t&1){let e=b();n(0,"input",63),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o()}if(t&2){let e=d(2);a("ngClass",T(1,vi,e.submitted&&e.getElement("emailAddress2").errors,e.getElement("emailAddress2").touched&&e.getElement("emailAddress2").valid))}}function ha(t,l){if(t&1){let e=b();
1n(0,"div")(1,"legend",32)(2,"label",33),c(3,"Date of birth"),o()(),u(4,"app-input-error-message",64),n(5,"div",40)(6,"div",65)(7,"div",66),u(8,"input",67,10),n(11,"div",68)(12,"button",69),v("click",function(){h(e);let r=oe(9);return g(r.toggle())}),u(13,"fa-icon",70),o()()()()(),n(14,"small",71),c(15,"This should be a valid date"),o()()}if(t&2){let e=d(2);s(4),a("displayErrorIf",e.submitted&&e.getElement("dateOfBirth").errors),s(4),a("ngClass",T(5,vi,e.submitted&&e.getElement("dateOfBirth").errors,e.getElement("dateOfBirth").touched&&e.getElement("dateOfBirth").valid))("maxDate",e.minDateCheck)("bsConfig",e.bsConfig),s(5),a("icon",e.faCalendarDay)}}function ga(t,l){if(t&1){let e=b();n(0,"div",46)(1,"label",72),c(2,"National insurance number"),o(),n(3,"div",40)(4,"div",65)(5,"input",73),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o()()()()}}function va(t,l){if(t&1){let e=b();n(0,"div",14)(1,"div",15)(2,"div",16)(3,"form",17),v("ngSubmit",function(){h(e);let r=d();return g(r.onSubmit())}),n(4,"h2",18),c(5,"Update your contact details"),o(),n(6,"div",19)(7,"div",20)(8,"div",21)(9,"div",22)(10,"h4"),c(11,"Name"),o(),n(12,"span"),c(13),o()()()()(),_(14,pa,30,21,"div",23),n(15,"div",24)(16,"fieldset",25)(17,"legend")(18,"label",26),c(19,"Email address"),o()(),u(20,"app-input-error-message",27),n(21,"div",28)(22,"div",22)(23,"input",29,1),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o()()(),_(25,ua,1,1,"app-input-error-message",30),n(26,"div",28)(27,"div",22,2),_(29,fa,1,4,"input",31),o()(),n(30,"legend",32)(31,"label",33),
1c(32,"Mobile tel. number"),o()(),u(33,"app-input-error-message",34),n(34,"div",28)(35,"div",22)(36,"input",35,3),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o()()(),n(38,"legend",32)(39,"label",33),c(40,"Home tel. number"),o()(),u(41,"app-input-error-message",34),n(42,"div",28)(43,"div",22)(44,"input",36,4),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o()()(),n(46,"legend",32)(47,"label",33),c(48,"Work tel. number"),o()(),u(49,"app-input-error-message",34),n(50,"div",28)(51,"div",22)(52,"input",37,5),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o()()(),_(54,ha,16,8,"div",38),o(),_(55,ga,6,0,"div",39),o(),n(56,"div",40)(57,"div",41)(58,"div",42)(59,"button",43),v("click",function(){h(e);let r=d();return g(r.onCancel())}),c(60," Cancel "),o(),n(61,"button",44),c(62," Submit "),o()()()()()()()()}if(t&2){let e=d();a("ngClass",e.company==="LMH"?"bg-primary":"bg-primary-light"),s(3),a("formGroup",e.contactDetailsForm),s(10),U(e.accountHolder==null?null:e.accountHolder.customerName),s(),a("ngIf",(e.customer==null?null:e.customer.customerType)==="C"),s(6),a("displayErrorIf",e.submitted&&e.getElement("emailAddress1").errors),s(3),a("ngClass",T(17,vi,e.submitted&&e.getElement("emailAddress1").errors,e.getElement("emailAddress1").touched&&e.getElement("emailAddress1").valid)),s(2),a("ngIf",e.getElement("emailAddress2").value),s(4),a("ngIf",e.getElement("emailAddress2").value||e.getElement("emailAddress1").value),s(4),a("displayErrorIf",e.submitted&&(e.getElement("mobileTelephone").errors||e.mobileNumberError)),s(3),a("ngClass",B(20,ot,e.submitted&&(e.getElement("mobileTelephone").errors||e.mobileNumberError))),s(5),a("displayErrorIf",e.submitted&&(e.getElement("homeTelephone").errors||e.homeNumberError)),s(3),a("ngClass",B(22,ot,e.submitted&&(e.getElement("homeTelephone").errors||e.homeNumberError))),s(5),a("displayErrorIf",e.submitted&&(e.getElement("workTelephone").errors||e.workNumberError)),s(3),a("ngClass",B(24,ot,e.submitted&&(e.getElement("workTelephone").errors||e.workNumberError))),s(2),a("ngIf",(e.customer==null?null:e.customer.customerType)==="D"),s(),a("ngIf",(e.customer==null?null:e.customer.customerType)==="D"),s(6),a("disabled",e.submittedForm)}}function _a(t,l){if(t&1&&(n(0,"div"),u(1,"i",14),o()),t&2){let e=d(2);s(),a("ngClass",e.success?"bg-secondary fal fa-check":"bg-danger shadow fal fa-times")}}function ya(t,l){t&1&&(n(0,"div")(1,"div",81),V(),n(2,"svg",82),u(3,"path",83),o(),n(4,"svg",84),u(5,"path",85),o()()())}function ba(t,l){t&1&&(n(0,"div")(1,"div",86),V(),n(2,"svg",82),u(3,"path",83),o(),n(4,"svg",87),u(5,"path",88),o()()())}function Ca(t,l){if(t&1&&(n(0,"div"),_(1,ya,6,0,"div",38)(2,ba,6,0,"div",38),o()),t&2){let e=d(2);s(),a("ngIf",e.success),s(),a("ngIf",!e.success)}}function Sa(t,l){if(t&1){let e=b();n(0,"div",74),_(1,_a,2,1,"div",38)(2,Ca,3,2,"div",38),o(),n(3,"div",75),u(4,"h4",76),o(),n(5,"div",77),u(6,"p",78),o(),n(7,"div",79)(8,"button",80),v("click",function(){h(e);let r=d();return g(r.closeModal())}),c(9," Close "),o(),n(10,"button",80),v("click",function(){h(e);let r=d();return g(r.onCallBack())}),c(11," Call back "),o()()}if(t&2){let e=d();s(),a("ngIf",e.company==="SEW"||e.company==="ESP"),s(),a("ngIf",e.company==="ICOSA"||e.company==="MTX"||e.company==="MUA"||e.company==="LEF"),s(2),a("innerHTML",e.modalTitle,F),s(2),a("innerHTML",e.modalBody,F)}}function Ea(t,l){if(t&1){let e=b();n(0,"app-request-a-call-back",89),v("status",function(r){h(e);let m=d();return g(m.getMessage(r))}),o()}t&2&&a("defaultOption","Other")}var pr=(()=>{let l=class l{constructor(i,r,m,p,y,C,w,I,S,D,L,P,R){this.fb=i,this.route=r,this.pageScrollService=m,this.document=p,this.spinner=y,this.spinnerSevice=C,this.accountHolderService=w,this.customerService=I,this.location=S,this.nameChangeService=D,this.preferencesService=L,this.modalService=P,this.analyticsService=R,this.submitted=!1,this.submittedForm=!1,this.faExclamationCircle=ct,this.faCalendarDay=Xe,this.paymentDays=$t,this.minDateChange=5840,this.minDateCheck=null,this.subscriptions=[],this.requestACallBack=!1,this.company=x.company,this.application=x.application,this.colorTheme="theme-default",this.config={animated:!0,keyboard:!0,backdrop:!0,ignoreBackdropClick:!1,class:""}}ngOnInit(){this.bsConfig=Object.assign({},{containerClass:this.colorTheme,dateInputFormat:"DD/MM/YYYY"}),this.analyticsService.pageView("contact-details-form","./contact-details-form","contact details form"),this.minDateCheck=new Date,this.minDateCheck.setDate(this.minDateCheck.getDate()-this.minDateChange),this.contactDetailsForm=this.fb.group({dateOfBirth:[null],emailAddress1:[null,[E.required,E.email]],emailAddress2:[null,[E.email]],homeTelephone:[null],mobileTelephone:[null],workTelep
1hone:[null],nationalInsuranceNo:[null],companyName:[{disabled:!0,value:null},[E.required,E.maxLength(30)]],companyRegistrationNo:[null,[E.minLength(8),E.maxLength(8)]],companyRepName:[null,[E.maxLength(30)]],companyTradingAs:[null,[E.maxLength(30)]],companyVATNo:[null]}),this.customerSubscription=this.customerService.customerChange.subscribe(i=>{this.customer=i,this.initForm()}),this.customer=this.customerService.getCustomer(),this.accountHolderSubscription=this.accountHolderService.accountHoldersChange.subscribe(i=>{this.accountHolder=this.accountHolderService.getAccountHolder(this.id),this.initForm()}),this.route.params.subscribe(i=>{this.id=+i.id})}initForm(){this.accountHolder&&(this.contactDetailsForm.patchValue({emailAddress1:this.accountHolder?.emailAddress1,emailAddress2:this.accountHolder?.emailAddress2,mobileTelephone:this.accountHolder?.mobileTelephone,homeTelephone:this.accountHolder?.homeTelephone,workTelephone:this.accountHolder?.workTelephone}),this.customer?.customerType==="C"?(this.contactDetailsForm.get("companyName").enable(),this.contactDetailsForm.patchValue({companyName:this.accountHolder?.accountHolderSurname,companyRegistrationNo:this.accountHolder?.companyRegistrationNo,companyRepName:this.accountHolder?.companyRepName,companyTradingAs:this.accountHolder?.companyTradingAs,companyVATNo:this.accountHolder?.companyVATNo})):(this.accountHolder?.dateOfBirth&&this.contactDetailsForm.patchValue({dateOfBirth:new Date(this.accountHolder?.dateOfBirth)}),this.contactDetailsForm.patchValue({nationalInsuranceNo:this.accountHolder?.nationalInsuranceNo})))}ngAfterViewInit(){this.pageScrollService.scroll({document:this.document,scrollTarget:".card-body",duration:300})}checkPhoneNumber(){let i=this.getElement("mobileTelephone").value?.replace(/\s/g,""),r=this.getElement("homeTelephone").value?.replace(/\s/g,""),m=this.getElement("workTelephone").value?.replace(/\s/g,""),p=RegExp("^(((\\+44\\s?\\d{4}|\\(?0\\d{4}\\)?)\\s?\\d{3}\\s?\\d{3})|((\\+44\\s?\\d{3}|\\(?0\\d{3}\\)?)\\s?\\d{3}\\s?\\d{4})|((\\+44\\s?\\d{2}|\\(?0\\d{2}\\)?)\\s?\\d{4}\\s?\\d{4}))(\\s?\\#(\\d{4}|\\d{3}))?$");this.mobileNumberWithoutSpaces=+i,this.homeNumberWithoutSpaces=+r,this.workNumberWithoutSpaces=+m,this.getElement("mobileTelephone").value!==""&&p.test(i)===!1?this.mobileNumberError=!0:this.mobileNumberError=!1,this.getElement("homeTelephone").value!==""&&p.test(r)===!1?this.homeNumberError=!0:this.homeNumberError=!1,this.getElement("workTelephone").value!==""&&p.test(m)===!1?this.workNumberError=!0:this.workNumberError=!1}focusOnError(i){i.focus()}onSubmit(){this.customerType=this.customer.customerType,this.customerReference=this.customer.customerReference;let i=this.getElement("dateOfBirth").value,r;i&&(r=gi.default.utc(i.getMonth()+1+"-"+i.getDate()+"-"+i.getFullYear(),"MM-DD-YYYY").toJSON()),this.submitted=!0,this.checkPhoneNumber();let m=document.querySelector(".ng-invalid[formControlName]");if(this.contactDetailsForm.invalid){this.focusOnError(m);return}else if(!(this.mobileNumberError||this.homeNumberError||this.workNumberError)){this.success=null,this.spinnerSevice.setSpinnerDescription("updating contact info ..."),this.spinner.show(),this.submittedForm=!0;let p=this.route.snapshot.queryParamMap.get("contactMethod")?this.route.snapshot.queryParamMap.get("contactMethod"):"Y",y=this.getElement("dateOfBirth").value,C;y&&(C=gi.default.utc(y.getMonth()+1+"-"+y.getDate()+"-"+y.getFullYear(),"MM-DD-YYYY").toJSON()),this.preferencesService.getContactDetailsUpdateResponse(this.customer.customerReference,this.id+1,this.getElement("mobileTelephone").value,this.getElement("homeTelephone").value,this.getElement("workTelephone").value,C,this.getElement("emailAddress1").value,this.getElement("emailAddress2").value,this.getElement("nationalInsuranceNo").value,this.getElement("companyRegistrationNo").value,this.getElement("companyRepName").value,this.getElement("companyTradingAs").value,this.getElement("companyVATNo").value,this.customerType,p).subscribe(w=>{this.customerType==="C"?this.nameChangeService.getNameChangeUpdateResponse(this.customerReference,p,"UPDATE","Business",1,"","",this.contactDetailsForm.get("companyName").value).subscribe(I=>{this.spinner.hide(),this.returnMessage=I.data.returnMessage,this.submittedForm=!1,this.success=this.returnMessage==="GREEN"||this.returnMessage==="AMBER",this.config.class=this.success?"success-modal":"warning-modal",this.modalTitle=this.success?"All complete":"Sorry we&apos;ve hit a problem",this.modalBody=this.success&&this.returnMessage==="GREEN"?"That&apos;s all updated for you.  Thanks so much for keeping your details up to date.":this.success&&this.returnMessage==="AMBER"?"Thank you for updating your details. We are just checking a few b
1its and will update your account shortly.":"Oh no, I am so sorry but that didn&apos;t seem to work, could you complete the form again.",this.success&&pe.includes(this.company)&&(this.modalBody+=de),this.openModal(this.templateRef)},I=>{this.submittedForm=!1,this.spinner.hide(),this.success=!1,this.config.class=this.success?"success-modal":"danger-modal",this.modalTitle=this.success?"All complete":"Sorry we&apos;ve hit a problem",this.modalBody=this.success&&this.returnMessage==="GREEN"?"That&apos;s all updated for you.  Thanks so much for keeping your details up to date.":this.success&&this.returnMessage==="AMBER"?"Thank you for updating your details. We are just checking a few bits and will update your account shortly.":"Oh no, I am so sorry but that didn&apos;t seem to work, could you complete the form again.",this.openModal(this.templateRef)}):(this.spinner.hide(),this.returnMessage=w.data.returnMessage,this.submittedForm=!1,this.success=this.returnMessage==="GREEN"||this.returnMessage==="AMBER",this.config.class=this.success?"success-modal":"warning-modal",this.modalTitle=this.success?"All complete":"Sorry we&apos;ve hit a problem",this.modalBody=this.success&&this.returnMessage==="GREEN"?"That&apos;s all updated for you.  Thanks so much for keeping your details up to date.":this.success&&this.returnMessage==="AMBER"?"Thank you for updating your details. We are just checking a few bits and will update your account shortly.":"Oh no, I am so sorry but that didn&apos;t seem to work, could you complete the form again.",this.success&&pe.includes(this.company)&&(this.modalBody+=de),this.openModal(this.templateRef))},w=>{this.submittedForm=!1,this.spinner.hide(),this.success=!1,this.config.class=this.success?"success-modal":"danger-modal",this.modalTitle=this.success?"All complete":"Sorry we&apos;ve hit a problem",this.modalBody=this.success&&this.returnMessage==="GREEN"?"That&apos;s all updated for you.  Thanks so much for keeping your details up to date.":this.success&&this.returnMessage==="AMBER"?"Thank you for updating your details. We are just checking a few bits and will update your account shortly.":"Oh no, I am so sorry but that didn&apos;t seem to work, could you complete the form again.",this.openModal(this.templateRef)})}}getElement(i){return this.contactDetailsForm.get(i)}onCancel(){this.location.back(),this.pageScrollService.scroll({document:this.document,scrollTarget:"#topnav",duration:300})}openModal(i){this.modalRef=this.modalService.show(i,Object.assign({},this.config)),this.subscriptions.push(this.modalService.onHide.subscribe(r=>{r=="backdrop-click"&&this.success&&(this.onCancel(),this.requestACallBack=!1)}))}onCallBack(){this.modalRef&&(this.modalRef.hide(),this.modalRef=null),this.requestACallBack=!0}getMessage(i){this.onCancel(),this.requestACallBack=!1}closeModal(){if(this.modalRef)this.success&&(this.onCancel(),this.requestACallBack=!1);else return;this.modalRef.hide(),this.modalRef=null}ngOnDestroy(){this.customerSubscription.unsubscribe(),this.accountHolderSubscription.unsubscribe()}};l.\u0275fac=function(r){return new(r||l)(f(le),f(K),f(Q),f(W),f(G),f(Y),f(_e),f(te),f(ee),f(We),f(ve),f(J),f(ae))},l.\u0275cmp=O({type:l,selectors:[["app-contact-details-form"]],viewQuery:function(r,m){if(r&1&&A(da,5),r&2){let p;N(p=M())&&(m.templateRef=p.first)}},decls:5,vars:2,consts:[["template",""],["emailAddress1ErrorRef",""],["emailAddress2ErrorRef",""],["mobileTelephoneErrorRef",""],["homeTelephoneErrorRef",""],["workTelephoneErrorRef",""],["compNameErrorRef",""],["companyRepNameErrorRef",""],["companyTradingAsErrorRef",""],["companyRegistrationNoErrorRef",""],["dp","bsDatepicker","dateOfBirthErrorRef",""],[3,"ngClass",4,"ngIf"],[1,"container"],[3,"defaultOption","status",4,"ngIf"],[3,"ngClass"],[1,"container","py-8"],[1,"form-wrap"],["id","contactDetailsForm","name","contactDetailsForm",3,"ngSubmit","formGroup"],["id","formHeader"],[1,"card","border-secondary","bg-info","mb-4"],[1,"card-body"],[1,"row"],[1,"col-md-12"],["class","pb-4",4,"ngIf"],[1,"form-group"],[1,"py-1"],[1,"label","mb-0","required"],["errorMsg","Please enter a valid email address",3,"displayErrorIf"],[1,"form-row","mb-2"],["formControlName","emailAddress1","name","emailAddress1","placeholder","email address 1","type","text","aria-describedby","emailAddress1",1,"form-control","form-control-lg",3,"keydown.enter","ngClass"],["errorMsg","Please enter a valid email address",3,"displayErrorIf",4,"ngIf"],["formControlName","emailAddress2","name","emailAddress2","placeholder","email address 2","class","form-control form-control-lg","type","text","aria-describedby","emailAddress2",3,"ngClass","keydown.enter",4,"ngIf"],[1,"pt-4"],[1,"label","mb-0"],["errorMsg","Please enter a valid telephone number",3,"displayErrorIf"],["formControlName","mobileTelephone","name","mobileTelephone","placeholder","07999 999 999","type","text","aria-describedby","mobileTelephone",1,"form-control","form-control-lg",3,"keydown.enter","ngClass"],["formControlName","homeTelephone","name","homeTelephone","placeholder","99999 999999","type","text","aria-describedby","homeTelephone",1,"form-control","form-control-lg",3,"keydown.enter","ngClass"],["formControlName","workTelep
1hone","name","workTelephone","placeholder","99999 999999","type","text","aria-describedby","workTelephone",1,"form-control","form-control-lg",3,"keydown.enter","ngClass"],[4,"ngIf"],["class","form-group pt-4",4,"ngIf"],[1,"form-row"],[1,"col-12","mt-2"],[1,"btn-group","float-right"],["type","button",1,"btn","btn-outline-danger","mx-3",3,"click"],["type","submit",1,"btn","btn-primary",3,"disabled"],[1,"pb-4"],[1,"form-group","pt-4"],["for","companyName",1,"label","mb-1"],["errorMsg","Please enter the companies name","id","companyNameError",3,"displayErrorIf"],["errorMsg","Company name is limited to 30 characters","id","companyNameError",3,"displayErrorIf"],["type","text","formControlName","companyName","name","companyName","id","companyName","type","text","aria-describedby","companyNameError",1,"form-control","form-control-lg",3,"keydown.enter","ngClass"],["for","companyRepName",1,"label","mb-1"],["errorMsg","Representative name is limited to 30 characters","id","companyRepNameError",3,"displayErrorIf"],["type","text","formControlName","companyRepName","name","companyRepName","id","companyRepName","type","text","aria-describedby","companyRepNameError",1,"form-control","form-control-lg",3,"keydown.enter","ngClass"],[1,"form-group","pt-1"],["for","companyTradingAs",1,"label","mb-1"],["errorMsg","Trading as name is limited to 30 characters","id","companyTradingAsError",3,"displayErrorIf"],["type","text","formControlName","companyTradingAs","name","companyTradingAs","id","companyTradingAs","type","text","aria-describedby","companyTradingAsError",1,"form-control","form-control-lg",3,"keydown.enter","ngClass"],["for","companyRegistrationNo",1,"label","mb-1"],["errorMsg","Company registration number consists of 8 figures (numbers) or 2 letters followed by 6 figures","id","companyRegistrationNoError",3,"displayErrorIf"],["type","text","formControlName","companyRegistrationNo","name","companyRegistrationNo","id","companyRegistrationNo","type","text","aria-describedby","companyRegistrationNoError",1,"form-control","form-control-lg",3,"keydown.enter","ngClass"],["for","companyVATNo",1,"label","mb-1"],["type","text","formControlName","companyVATNo","name","companyVATNo","id","companyVATNo","type","text",1,"form-control","form-control-lg",3,"keydown.enter"],["formControlName","emailAddress2","name","emailAddress2","placeholder","email address 2","type","text","aria-describedby","emailAddress2",1,"form-control","form-control-lg",3,"keydown.enter","ngClass"],["errorMsg","Please enter a valid date for Date of birth",3,"displayErrorIf"],[1,"col-md-6"],[1,"input-group"],["placeholder","dd/mm/yyyy","name","dp","formControlName","dateOfBirth","bsDatepicker","",1,"form-control",3,"ngClass","maxDate","bsConfig"],[1,"input-group-append"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[3,"icon"],[1,"hint"],["for","nationalInsuranceNo",1,"label","mb-1"],["type","text","spellcheck","false","formControlName","nationalInsuranceNo","name","nationalInsuranceNo","id","nationalInsuranceNo","type","text",1,"form-control","form-control-lg",3,"keydown.enter"],[1,"icon-circle"],[1,"modal-header","justify-content-center"],[1,"modal-title",3,"innerHTML"],[1,"modal-body"],[1,"text-center",3,"innerHTML"],[1,"modal-footer","justify-content-center"],["type","button",1,"btn","btn-dark",3,"click"],[1,"icon-circle-inner","bg-active"],["xmlns","http://www.w3.org/2000/svg","width","279.5","height","268.79","viewBox","0 0 279.5 268.79",1,"pentagon"],["d","M856.134,1644.16a30,30,0,0,1-35.268,0L711.1,1564.41a30.009,30.009,0,0,1-10.9-33.55l41.926-129.04a30,30,0,0,1,28.532-20.73H906.338a30,30,0,0,1,28.532,20.73L976.8,1530.86a30.009,30.009,0,0,1-10.9,33.55Z","transform","translate(-698.75 -1381.09)"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 448 512","fill","white"],["d","M413.505 91.951L133.49 371.966l-98.995-98.995c-4.686-4.686-12.284-4.686-16.971 0L6.211 284.284c-4.686 4.686-4.686 12.284 0 16.971l118.794 118.794c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-11.314-11.314c-4.686-4.686-12.284-4.686-16.97 0z"],[1,"icon-circle-inner","bg-danger"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 512 512"],["d","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm101.8-262.2L295.6 256l62.2 62.2c4.7 4.7 4.7 12.3 0 17l-22.6 22.6c-4.7 4.7-12.3 4.7-17 0L256 295.6l-62.2 62.2c-4.7 4.7-12.3 4.7-17 0l-22.6-22.6c-4.7-4.7-4.7-12.3 0-17l62.2-62.2-62.2-62.2c-4.7-4.7-4.7-12.3 0-17l22.6-22.6c4.7-4.7 12.3-4.7 17 0l62.2 
162.2 62.2-62.2c4.7-4.7 12.3-4.7 17 0l22.6 22.6c4.7 4.7 4.7 12.3 0 17z"],[3,"status","defaultOption"]],template:function(r,m){r&1&&(_(0,va,63,26,"div",11)(1,Sa,12,4,"ng-template",null,0,q),n(3,"section",12),_(4,Ea,1,1,"app-request-a-call-back",13),o()),r&2&&(a("ngIf",!m.requestACallBack),s(4),a("ngIf",m.requestACallBack))},dependencies:[H,j,Fe,ce,$,se,ie,z,X,re,Ie,Ke,et],styles:["*[_ngcontent-%COMP%]:focus{outline:none!important}[_ngcontent-%COMP%]:focus{outline:none!important}.star-rating[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]:focus{outline:none!important}.star-rating[_ngcontent-%COMP%]:focus{outline:none!important}.star-rating[_ngcontent-%COMP%]   .stars[_ngcontent-%COMP%]:focus{outline:none!important}"]});let t=l;return t})();var ur=Dt(Qt());var wa=["template"],Qe=(t,l)=>({"is-invalid":t,"is-valid":l});function ka(t,l){if(t&1){let e=b();n(0,"div",22)(1,"div",55),u(2,"app-input-error-message",56),n(3,"div",57)(4,"input",58,8),v("change",function(){h(e);let r=d(2);return g(r.onSameAsSupplyAddress())}),o(),n(6,"label",59),c(7," Mailing address is same as property address "),o()()()()}if(t&2){let e=d(2);s(2),a("displayErrorIf",e.submitted&&e.getElement("revertToSupplyAddress").errors),s(2),a("ngClass",T(2,Qe,e.submitted&&e.getElement("revertToSupplyAddress").errors,e.getElement("revertToSupplyAddress").touched&&e.getElement("revertToSupplyAddress").valid))}}function Ta(t,l){t&1&&(n(0,"option",70),c(1," No results found "),o()),t&2&&a("ngValue",null)}function Ia(t,l){t&1&&(n(0,"option",70),c(1," Select your address "),o()),t&2&&a("ngValue",null)}function Ra(t,l){if(t&1&&(n(0,"option",71),c(1),o()),t&2){let e=l.$implicit;a("ngValue",e),s(),ne(" ",e.fullAddressIncPostcode," ")}}function Fa(t,l){if(t&1){let e=b();n(0,"div",22)(1,"div",60)(2,"legend")(3,"h4")(4,"label",61),c(5,"Find my address"),o()()()(),n(6,"div",62)(7,"input",63),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o()(),n(8,"div",62)(9,"button",64),v("click",function(){h(e);let r=d(2);return g(r.propertyLookup())}),c(10," Find address "),u(11,"fa-icon",47),o()(),n(12,"div",65)(13,"div",66)(14,"select",67),v("ngModelChange",function(r){h(e);let m=d(2);return g(m.addressUpdate(r))}),_(15,Ta,2,1,"option",68)(16,Ia,2,1,"option",68)(17,Ra,2,2,"option",69),o()()()()}if(t&2){let e=d(2);s(7),a("ngClass",T(5,Qe,e.submitted&&e.getElement("searchPostcode").errors,e.getElement("searchPostcode").touched&&e.getElement("searchPostcode").valid)),s(4),a("icon",e.faSearch),s(4),a("ngIf",(e.propertyLookups==null?null:e.propertyLookups.length)==0),s(),a("ngIf",(e.propertyLookups==null?null:e.propertyLookups.length)>0),s(),a("ngForOf",e.propertyLookups)}}function Aa(t,l){if(t&1){let e=b();n(0,"div",57)(1,"input",72,9),v("click",function(){h(e);let r=d(2);return g(r.clickInternational())})("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o(),n(3,"label",73),c(4," Mailing address is not in the UK "),o()()}if(t&2){let e=d(2);s(),a("ngClass",T(1,Qe,e.submitted&&e.getElement("addressIsInternational").errors,e.getElement("addressIsInternational").touched&&e.getElement("addressIsInternational").valid))}}function Na(t,l){if(t&1){let e=b();n(0,"li")(1,"a",77),v("click",function(){h(e),d(2);let r=oe(21),m=d();return g(m.focusOnError(r))}),c(2," Please enter a valid address line "),o()()}}function Ma(t,l){if(t&1){let e=b();n(0,"li")(1,"a",77),v("click",function(){h(e),d(2);let r=oe(26),m=d();return g(m.focusOnError(r))}),c(2," Please enter a valid address line "),o()()}}function Da(t,l){if(t&1){let e=b();n(0,"li")(1,"a",77),v("click",function(){h(e),d(2);let r=oe(31),m=d();return g(m.focusOnError(r))}),c(2," Please enter a valid address line "),o()()}}function Va(t,l){if(t&1){let e=b();n(0,"li")(1,"a",77),v("click",function(){h(e),d(2);let r=oe(36),m=d();return g(m.focusOnError(r))}),c(2," Please enter a valid address line "),o()()}}function Pa(t,l){if(t&1){let e=b();n(0,"li")(1,"a",77),v("click",function(){h(e),d(2);let r=oe(41),m=d();return g(m.focusOnError(r))}),c(2," Please enter a valid address line "),o()()}}function Ba(t,l){if(t&1){let e=b();n(0,"li")(1,"a",77),v("click",function(){h(e),d(2);let r=oe(46),m=d();return g(m.focusOnError(r))}),c(2," Please enter a postal code "),o()()}}function La(t,l){if(t&1){let e=b();n(0,"li")(1,"a",77),v("click",function(){h(e),d(2);let r=oe(61),m=d();return g(m.focusOnError(r))}),c(2," Please enter a date when the change should happen "),o()()}}function Oa(t,l){if(t&1&&(n(0,"div",74,10)(2,"h4"),c(3,"There is a problem, please correct the fields marked below."),o(),n(4,"ul",75),_(5,Na,3,0,"li",76)(6,Ma,3,0,"li",76)(7,Da,3,0,"li",76)(8,Va,3,0,"li",76)(9,Pa,3,0,"li",76)(10,Ba,3,0,"li",76)(11,La,3,0,"li",76),o()()),t&2){let e=d(2);s(5),a("ngIf",e.submitted&&e.getElement("addressLine1").errors&&!e.getElement("revertToSupplyAddress").value),s(),a("ngIf",e.submitted&&e.getElement("addressLine2").errors&&!e.getElement("revertToSupplyAddress").value),s(),a("ngIf",e.submitted&&e.getElement("addressLine3").value&&e.getElement("addressLine3").errors&&!e.getElement("revertToSupplyAddress").value),s(),a("ngIf",e.submitted&&e.getElement("addressLine4").value&&e.getElement("addressLine4").errors&&!e.getElement("revertToSupplyAddress").value),s(),a("ngIf",e.submitted&&e.getElement("addressLine5").value&&e.getElement("addressLine5").errors&&!e.getElement("revertToSupplyAddress").value),s(),a("ngIf",e.submitted&&e.getElement("postalCode").errors&&!e.getElement("revertToSupplyAddress").value),s(),a("ngIf",e.submitted&&e.getElement("dateEffective").errors)}}function qa(t,l){if(t&1){let e=b();n(0,"div",14)(1,"div",15)(2,"div",16)(3,"form",17),v("ngSubmit",function(){h(e);let r=d();return g(r.onSubmit())}),n(4,"h2",18),c(5,"Update your mailing address"),o(),c(6," ` "),n(7,"div",19)(8,"fieldset",20),_(9,ka,8,5,"div",21)(10,Fa,18,8,"div",21),n(11,"div",22)(12,"div",23)(13,"legend")(14,"h4")(15,"label",24),c(16,"Address lines"),o()()()()(),u(17,"app-input-error-message",25),n(18,"div",26)(19,"div",23)(20,"input",27,1),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o()()(),u(22,"app-input-error-message",28),n(23,"div",26)(24,"div",23)(25,"input",29,2),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o()()(),u(27,"app-input-error-message",28),n(28,"div",26)(29,"div",23)(30,"input",30,3),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o()()(),u(32,"app-input-error-message",31),n(33,"div",26)(34,"div",23)(35,"input",32,4),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o()()(),u(37,"app-input-error-message",33),n(38,"div",26)(39,"div",23)(40,"input",34,5),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o()()(),u(42,"app-input-error-message",35),n(43,"div",26)(44,"div",23)(45,"input",36,6),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o()()(),n(47,"div",22)(48,"div",37),u(49,"app-input-error-message",38),_(50,Aa,5,4,"div",39),o()(),n(51,"div",40)(52,"legend")(53,"h4")(54,"label",24),c(55,"Change date"),o()()(),u(56,"app-input-error-message",41),n(57,"div",42)(58,"div",43),u(59,"input",44,7),n(62,"div",45)(63,"button",46),v("click",function(){h(e);let r=oe(60);
1return g(r.toggle())}),u(64,"fa-icon",47),o()()()()(),n(65,"small",48),c(66,"Enter the date from when this new address will be effective"),o()()(),_(67,Oa,12,7,"div",49),n(68,"div",50)(69,"div",51)(70,"div",52)(71,"button",53),v("click",function(){h(e);let r=d();return g(r.onCancel())}),c(72," Cancel "),o(),n(73,"button",54),c(74," Submit "),o()()()()()()()()}if(t&2){let e=d();a("ngClass",e.company==="LMH"?"bg-primary":"bg-primary-light"),s(3),a("formGroup",e.billingAddressForm),s(6),a("ngIf",e.customer==null?null:e.customer.movedInDate),s(),a("ngIf",!e.getElement("revertToSupplyAddress").value),s(7),a("displayErrorIf",e.submitted&&e.getElement("addressLine1").errors),s(3),a("ngClass",T(34,Qe,e.submitted&&e.getElement("addressLine1").errors,e.getElement("addressLine1").touched&&e.getElement("addressLine1").valid))("readonly",e.getElement("revertToSupplyAddress").value),s(2),a("displayErrorIf",e.submitted&&e.getElement("addressLine2").errors),s(3),a("ngClass",T(37,Qe,e.submitted&&e.getElement("addressLine2").errors,e.getElement("addressLine2").touched&&e.getElement("addressLine2").valid))("readonly",e.getElement("revertToSupplyAddress").value),s(2),a("displayErrorIf",e.submitted&&e.getElement("addressLine3").errors),s(3),a("ngClass",T(40,Qe,e.submitted&&e.getElement("addressLine3").errors,e.getElement("addressLine3").touched&&e.getElement("addressLine3").valid))("readonly",e.getElement("revertToSupplyAddress").value),s(2),a("displayErrorIf",e.submitted&&e.getElement("addressLine4").errors),s(3),a("ngClass",T(43,Qe,e.submitted&&e.getElement("addressLine4").errors,e.getElement("addressLine4").touched&&e.getElement("addressLine4").valid))("readonly",e.getElement("revertToSupplyAddress").value),s(2),a("displayErrorIf",e.submitted&&e.getElement("addressLine5").errors),s(3),a("ngClass",T(46,Qe,e.submitted&&e.getElement("addressLine5").errors,e.getElement("addressLine5").touched&&e.getElement("addressLine5").valid))("readonly",e.getElement("revertToSupplyAddress").value),s(2),a("displayErrorIf",e.submitted&&e.getElement("postalCode").errors),s(3),a("ngClass",T(49,Qe,e.submitted&&e.getElement("postalCode").errors,e.getElement("postalCode").touched&&e.getElement("postalCode").valid))("readonly",e.getElement("revertToSupplyAddress").value),s(4),a("displayErrorIf",e.submitted&&e.getElement("addressIsInternational").errors),s(),a("ngIf",!e.getElement("revertToSupplyAddress").value),s(6),a("displayErrorIf",e.submitted&&e.getElement("dateEffective").errors),s(3),a("ngClass",T(52,Qe,e.submitted&&e.getElement("dateEffective").errors,e.getElement("dateEffective").touched&&e.getElement("dateEffective").valid))("minDate",e.todayDate)("bsConfig",e.bsConfig),s(4),ki("btn ",e.company==="LEF"?"btn-outline-primary":"btn-outline-secondary",""),s(),a("icon",e.faCalendarDay),s(3),a("ngIf",e.submitted&&e.billingAddressForm.invalid&&!e.submittedForm),s(6),a("disabled",e.submittedForm)}}function Ha(t,l){if(t&1&&(n(0,"div"),u(1,"i",14),o()),t&2){let e=d(2);s(),a("ngClass",e.success?"bg-secondary fal fa-check":"bg-danger shadow fal fa-times")}}function ja(t,l){t&1&&(n(0,"div")(1,"div",85),V(),n(2,"svg",86),u(3,"path",87),o(),n(4,"svg",88),u(5,"path",89),o()()())}function Ua(t,l){t&1&&(n(0,"div")(1,"div",90),V(),n(2,"svg",86),u(3,"path",87),o(),n(4,"svg",91),u(5,"path",92),o()()())}function Wa(t,l){if(t&1&&(n(0,"div"),_(1,ja,6,0,"div",76)(2,Ua,6,0,"div",76),o()),t&2){let e=d(2);s(),a("ngIf",e.success),s(),a("ngIf",!e.success)}}function Ga(t,l){if(t&1){let e=b();n(0,"div",78),_(1,Ha,2,1,"div",76)(2,Wa,3,2,"div",76),o(),n(3,"div",79),u(4,"h4",80),o(),n(5,"div",81),u(6,"p",82),o(),n(7,"div",83)(8,"button",84),v("click",function(){h(e);let r=d();return g(r.closeModal())}),c(9," Close "),o(),n(10,"button",84),v("click",function(){h(e);let r=d();return g(r.onCallBack())}),c(11," Call back "),o()()}if(t&2){let e=d();s(),a("ngIf",e.company==="SEW"||e.company==="ESP"),s(),a("ngIf",e.company==="ICOSA"||e.company==="MTX"||e.company==="MUA"||e.company==="LEF"),s(2),a("innerHTML",e.modalTitle,F),s(2),a("innerHTML",e.modalBody,F)}}function Ya(t,l){if(t&1){let e=b();n(0,"app-request-a-call-back",93),v("status",function(){h(e);let r=d();
1return g(r.getMessage())}),o()}t&2&&a("defaultOption","Other")}var fr=(()=>{let l=class l{constructor(i,r,m,p,y,C,w,I,S,D,L,P,R){this.fb=i,this.route=r,this.pageScrollService=m,this.document=p,this.spinner=y,this.spinnerSevice=C,this.customerService=w,this.propertyService=I,this.location=S,this.preferencesService=D,this.propertyLookupService=L,this.modalService=P,this.analyticsService=R,this.submitted=!1,this.submittedForm=!1,this.faExclamationCircle=ct,this.faCalendarDay=Xe,this.faSearch=Ni,this.paymentDays=$t,this.propertyLookupSearch=!1,this.todayDate=new Date,this.subscriptions=[],this.requestACallBack=!1,this.company=x.company,this.application=x.application,this.colorTheme="theme-default",this.config={animated:!0,keyboard:!0,backdrop:!0,ignoreBackdropClick:!1,class:""}}ngOnInit(){this.bsConfig=Object.assign({},{containerClass:this.colorTheme,dateInputFormat:"DD/MM/YYYY"}),this.analyticsService.pageView("billing-address-change-form","./billing-address-change-form","billing address change form page"),this.billingAddressForm=this.fb.group({addressLine1:[null,[E.required]],addressLine2:[null,[E.required]],addressLine3:[null,[]],addressLine4:[null,[]],addressLine5:[null,[]],postalCode:[null,[E.required]],dateEffective:[null,[]],addressIsInternational:[null,[]],revertToSupplyAddress:[null,[]],searchPostcode:[null,[]],propertySearchResult:[null,[]]}),this.initForm()}initForm(){this.customerSubscription=this.customerService.customerChange.subscribe(i=>{this.customer=i,this.billingAddressForm.patchValue({revertToSupplyAddress:this.customer?.billingAddress?.sameAsSupplyAddress}),this.onSameAsSupplyAddress()}),this.customer=this.customerService.getCustomer(),this.property=this.propertyService.getProperty(),this.propertySubscription=this.propertyService.propertyChange.subscribe(i=>{this.property=i,this.billingAddressForm.patchValue({revertToSupplyAddress:this.customer?.billingAddress?.sameAsSupplyAddress}),this.onSameAsSupplyAddress()}),this.property=this.propertyService.getProperty(),this.customer,this.billingAddressForm.patchValue({dateEffective:new Date}),this.billingAddressForm.patchValue({addressIsInternational:!1}),this.billingAddressForm.patchValue({revertToSupplyAddress:this.customer?.billingAddress?.sameAsSupplyAddress}),this.onSameAsSupplyAddress()}onSameAsSupplyAddress(){this.getElement("revertToSupplyAddress").value?this.property&&(this.billingAddressForm.patchValue({addressLine1:this.property?.propertyAddress?.addressLine1}),this.billingAddressForm.patchValue({addressLine2:this.property?.propertyAddress?.addressLine2}),this.billingAddressForm.patchValue({addressLine3:this.property?.propertyAddress?.addressLine3}),this.billingAddressForm.patchValue({addressLine4:this.property?.propertyAddress?.addressLine4}),this.billingAddressForm.patchValue({addressLine5:this.property?.propertyAddress?.addressLine5}),this.billingAddressForm.patchValue({postalCode:this.property?.propertyAddress?.postalCode})):(this.billingAddressForm.patchValue({addressLine1:this.customer?.billingAddress?.addressLine1}),this.billingAddressForm.patchValue({addressLine2:this.customer?.billingAddress?.addressLine2}),this.billingAddressForm.patchValue({addressLine3:this.customer?.billingAddress?.addressLine3}),this.billingAddressForm.patchValue({addressLine4:this.customer?.billingAddress?.addressLine4}),this.billingAddressForm.patchValue({addressLine5:this.customer?.billingAddress?.addressLine5}),this.billingAddressForm.patchValue({postalCode:this.customer?.billingAddress?.postalCode})),this.customer.billingAddress?.addressIsInternational&&this.billingAddressForm.patchValue({addressIsInternational:!0})}ngAfterViewInit(){this.pageScrollService.scroll({document:this.document,scrollTarget:".card-body",duration:300})}focusOnError(i){i.focus()}onSubmit(){this.submitted=!0;let i=document.querySelector(".ng-invalid[formControlName]");if(this.billingAddressForm.invalid){this.focusOnError(i);return}else{this.success=null,this.spinnerSevice.setSpinnerDescription("updating contact info ..."),this.spinner.show(),this.submittedForm=!0;let r=this.getElement("dateEffective").value,m=ur.default.utc(r.getMonth()+1+"-"+r.getDate()+"-"+r.getFullYear(),"MM-DD-YYYY").toJSON(),p=this.route.
1snapshot.queryParamMap.get("contactMethod")?this.route.snapshot.queryParamMap.get("contactMethod"):"Y";this.preferencesService.getBillingAddressUpdateResponse(this.getElement("addressLine1").value,this.getElement("addressLine2").value,this.getElement("addressLine3").value,this.getElement("addressLine4").value,this.getElement("addressLine5").value,this.getElement("postalCode").value,m,this.getElement("addressIsInternational").value,this.getElement("revertToSupplyAddress").value,p).subscribe(y=>{this.spinner.hide(),this.returnMessage=y.data.returnMessage,this.success=this.returnMessage==="GREEN"||this.returnMessage==="AMBER",this.config.class=this.success?"success-modal":"warning-modal",this.modalTitle=this.success?"All complete":"Sorry we&apos;ve hit a problem",this.modalBody=this.success?"That&apos;s all updated for you.  Thanks so much for keeping your details up to date.":"Oh no, I am so sorry but that didn&apos;t seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.returnMessage==="GREEN"&&pe.includes(this.company)&&(this.modalBody+=de),this.openModal(this.templateRef)},y=>{this.submittedForm=!1,this.spinner.hide(),this.success=!1,this.config.class=this.success?"success-modal":"danger-modal",this.modalTitle=this.success?"All complete":"Sorry we&apos;ve hit a problem",this.modalBody=this.success?"That&apos;s all updated for you.  Thanks so much for keeping your details up to date.":"Oh no, I am so sorry but that didn&apos;t seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.openModal(this.templateRef)})}}getElement(i){return this.billingAddressForm.get(i)}onCancel(){this.location.back(),this.pageScrollService.scroll({document:this.document,scrollTarget:"#topnav",duration:300})}propertyLookup(){this.propertyLookupSearch=!0;let i=this.getElement("searchPostcode").value;this.propertyLookupService.getProperties(i,"").subscribe(r=>{this.propertyLookups=r.data.propertyLookups})}addressUpdate(i){this.billingAddressForm.patchValue({addressLine1:i.addressLine1}),this.billingAddressForm.patchValue({addressLine2:i.addressLine2}),this.billingAddressForm.patchValue({addressLine3:i.addressLine3}),this.billingAddressForm.patchValue({addressLine4:i.addressLine4}),this.billingAddressForm.patchValue({addressLine5:i.addressLine5}),this.billingAddressForm.patchValue({postalCode:i.postCode})}clickInternational(){this.billingAddressForm.value.addressIsInternational?this.billingAddressForm.get("postalCode").setValidators([E.required]):this.billingAddressForm.get("postalCode").setValidators([]),this.billingAddressForm.get("postalCode").setErrors(null),this.billingAddressForm.get("postalCode").updateValueAndValidity()}openModal(i){this.modalRef=this.modalService.show(i,Object.assign({},this.config)),this.subscriptions.push(this.modalService.onHide.subscribe(r=>{r=="backdrop-click"&&this.success&&(this.onCancel(),this.requestACallBack=!1)}))}onCallBack(){this.modalRef&&(this.modalRef.hide(),this.modalRef=null),this.requestACallBack=!0}getMessage(){this.onCancel(),this.requestACallBack=!1}closeModal(){if(this.modalRef)this.success&&(this.onCancel(),this.requestACallBack=!1);else return;this.modalRef.hide(),this.modalRef=null}ngOnDestroy(){this.customerSubscription&&this.customerSubscription.unsubscribe(),this.propertySubscription&&this.propertySubscription.unsubscribe()}};l.\u0275fac=function(r){return new(r||l)(f(le),f(K),f(Q),f(W),f(G),f(Y),f(te),f(Ze),f(ee),f(ve),f(zt),f(J),f(ae))},l.\u0275cmp=O({type:l,selectors:[["app-billing-address-change-form"]],viewQuery:function(r,m){if(r&1&&A(wa,5),r&2){let p;N(p=M())&&(m.templateRef=p.first)}},decls:5,vars:2,consts:[["template",""],["addressLine1ErrorRef",""],["addressLine2ErrorRef",""],["addressLine3ErrorRef",""],["addressLine4ErrorRef",""],["addressLine5ErrorRef",""],["postalCodeErrorRef",""],["dp","bsDatepicker","dateEffectiveErrorRef",""],["revertToSupplyAddressErrorRef",""],["addressIsInternationalErrorRef",""],["errorSummaryRef",""],[3,"ngClass",4,"ngIf"],[1,"container"],[3,"defaultOption","status",4,"ngIf"],[3,"ngClass"],[1,"container","py-8"],[1,"form-wrap"],["id","billingAddressForm","name","billingAddressForm",3,"ngSubmit","formGroup"],["id","formHeader"],[1,"form-group"],[1,"py-1"],["class","form-row",4,"ngIf"],[1,"form-row"],[1,"col-md-12"],[1,"label","required"],["errorMsg","Please enter address line 1",3,"displayErrorIf"],[1,"form-row","mb-2"],["formControlName","addressLine1","name","addressLine1","id","addressLine1","placeholder","address line 1","type","text","aria-describedby","addressLine1","required","",1,"form-control","form-control-lg",3,"keydown.enter","ngClass","readonly"],["errorMsg","Please enter address line 2",3,"displayErrorIf"],["formControlName","addressLine2","name","addressLine2","id","addressLine2","placeholder","address line 2","type","text","aria-describedby","addressLine2","required","",1,"form-control","form-control-lg",3,"keydown.enter","ngClass","readonly"],["formControlName","addressLine3","name","addressLine3","id","addressLine3","placeholder","address line 3","type","text","aria-describedby","addressLine3",1,"form-control","form-control-lg",3,"keydown.enter","ngClass","readonly"],["errorMsg","Please enter address line 3",3,"displayErrorIf"],["formControlName","addressLine4","name","addressLine4","id","addressLine4","placeholder","address line 4","type","text","aria-describedby","addressLine4",1,"form-control","form-control-lg",3,"keydown.enter","ngClass","readonly"],["errorMsg","Please enter address line 4",3,"displayErrorIf"],["formControlName","addressLine5","name","addressLine5","id","addressLine5","placeholder","address line 5","type","text","aria-describedby","addressLine5",1,"form-control","form-control-lg",3,"keydown.enter","ngClass","readonly"],["errorMsg","Please enter your post code",3,"displayErrorIf"],["formControlName","postalCode","id","postalCode","name","postalCode","placeholder","postal code","type","text","aria-describedby","postalCode","required","",1,"form-control","form-control-lg",3,"keydown.enter","ngClass","readonly"],[1,"col-auto","mt-2"],["errorMsg","Please select of the address is not in the UK",3,"displayErrorIf"],["class","custom-control custom-checkbox",4,"ngIf"],[1,"form-row","pt-4"],["errorMsg","Please enter when the new address should be used from",3,"displayErrorIf"],[1,"col-md-6"],[1,"input-group"],["placeholder","dd/mm/yyyy","name","dateEffective","
1id","dateEffective","formControlName","dateEffective","bsDatepicker","",1,"form-control",3,"ngClass","minDate","bsConfig"],[1,"input-group-append"],["type","button",3,"click"],[3,"icon"],[1,"hint"],["class","alert alert-danger mb-6 col-12",4,"ngIf"],[1,"form-row","pt-1"],[1,"col-12"],[1,"btn-group","float-right"],["type","button",1,"btn","btn-outline-danger","mx-3",3,"click"],["type","submit",1,"btn","btn-primary",3,"disabled"],[1,"col-auto"],["errorMsg","You must confirm you are the account holder to proceed",3,"displayErrorIf"],[1,"custom-control","custom-checkbox"],["type","checkbox","formControlName","revertToSupplyAddress","name","revertToSupplyAddress","id","revertToSupplyAddress","aria-describedby","revertToSupplyAddress",1,"custom-control-input",3,"change","ngClass"],["for","revertToSupplyAddress",1,"custom-control-label"],[1,"col-sm-12"],[1,"label"],[1,"col-sm-6"],["formControlName","searchPostcode","type","text","autocomplete","postal-code","placeholder","postcode","oninput","this.value = this.value.toUpperCase()",1,"form-control","form-control-lg","text-uppercase",3,"keydown.enter","ngClass"],["type","button",1,"btn","btn-small","btn-secondary","mt-1",3,"click"],[1,"col-sm-12","my-3"],[1,"select-wrap"],["formControlName","propertySearchResult",1,"custom-select","custom-select-lg",3,"ngModelChange"],["disabled","",3,"ngValue",4,"ngIf"],[3,"ngValue",4,"ngFor","ngForOf"],["disabled","",3,"ngValue"],[3,"ngValue"],["type","checkbox","formControlName","addressIsInternational","name","addressIsInternational","id","addressIsInternational","aria-describedby","addressIsInternational",1,"custom-control-input",3,"click","keydown.enter","ngClass"],["for","addressIsInternational",1,"custom-control-label"],[1,"alert","alert-danger","mb-6","col-12"],[1,"error-list"],[4,"ngIf"],[3,"click"],[1,"icon-circle"],[1,"modal-header","justify-content-center"],[1,"modal-title",3,"innerHTML"],[1,"modal-body"],[1,"text-center",3,"innerHTML"],[1,"modal-footer","justify-content-center"],["type","button",1,"btn","btn-dark",3,"click"],[1,"icon-circle-inner","bg-active"],["xmlns","http://www.w3.org/2000/svg","width","279.5","height","268.79","viewBox","0 0 279.5 268.79",1,"pentagon"],["d","M856.134,1644.16a30,30,0,0,1-35.268,0L711.1,1564.41a30.009,30.009,0,0,1-10.9-33.55l41.926-129.04a30,30,0,0,1,28.532-20.73H906.338a30,30,0,0,1,28.532,20.73L976.8,1530.86a30.009,30.009,0,0,1-10.9,33.55Z","transform","translate(-698.75 -1381.09)"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 448 512","fill","white"],["d","M413.505 91.951L133.49 371.966l-98.995-98.995c-4.686-4.686-12.284-4.686-16.971 0L6.211 284.284c-4.686 4.686-4.686 12.284 0 16.971l118.794 118.794c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-11.314-11.314c-4.686-4.686-12.284-4.686-16.97 0z"],[1,"icon-circle-inner","bg-danger"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 512 512"],["d","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm101.8-262.2L295.6 256l62.2 62.2c4.7 4.7 4.7 12.3 0 17l-22.6 22.6c-4.7 4.7-12.3 4.7-17 0L256 295.6l-62.2 62.2c-4.7 4.7-12.3 4.7-17 0l-22.6-22.6c-4.7-4.7-4.7-12.3 0-17l62.2-62.2-62.2-62.2c-4.7-4.7-4.7-12.3 0-17l22.6-22.6c4.7-4.7 12.3-4.7 17 0l62.2 62.2 62.2-62.2c4.7-4.7 12.3-4.7 17 0l22.6 22.6c4.7 4.7 4.7 12.3 0 17z"],[3,"status","defaultOption"]],template:function(r,m){r&1&&(_(0,qa,75,55,"div",11)(1,Ga,12,4,"ng-template",null,0,q),n(3,"section",12),_(4,Ya,1,1,"app-request-a-call-back",13),o()),r&2&&(a("ngIf",!m.requestACallBack),s(4),a("ngIf",m.requestACallBack))},dependencies:[H,ge,j,Fe,ce,$,yt,bt,se,je,_t,ie,z,Ue,X,re,Ie,Ke,et]});let t=l;return t})();var ei=class{constructor(l,e,i,r,m){this.image=l,this.name=e,this.provider=i,this.uid=r,this.email=m,this.image="",this.name="",this.provider="",this.uid="",this.email=""}};var hr=(()=>{let l=class l{constructor(i,r){this.firestore=i,this.auth=r,this.userChange=new at,this.destroy$=new at,this.currentSubscription=dt(this.auth).pipe($e(m=>{let p=new ei("","","","","");return m&&(p.image=m.photoURL||"",p.name=m.displayName||"",p.email=m.email||"",p.provider=m.providerData[0]?.providerId||"",p.uid=m.uid),p})).subscribe(m=>{this.returnObject(m)})}getUserStatus(){return dt}getCurrentUser(){return Object.assign({},this.firebaseUser)}getUid(){let i=this.auth.currentUser;return i?i.uid:null}returnObject(i){this.firebaseUser=i,this.firebaseUser?this.userChange.next(Object.assign({},this.firebaseUser)):this.userChange.next(null)}ngOnDestroy(){this.currentSubscription&&this.currentSubscription.unsubscribe()}};l.\u0275fac=function(r){return new(r||l)(me(jt),me(Ht))},l.\u0275prov=He({token:l,factory:l.\u0275fac,providedIn:"root"});let t=l;return t})();var Ja=["template"],Za=["template2"],Ka=()=>["/help-to-pay"],es=()=>["billing-address"],ts=()=>["data"],is=()=>["notifications"],ti=t=>[t],rs=()=>["/notify-us-of-a-bereavement"],ns=()=>["/preferences/business-account"],os=()=>["add-account"],as=()=>["display-name"];function ss(t,l){t&1&&(n(0,"div")(1,"p"),c(2," We're on hand if you need help paying your bill, or if you would like to receive your bills in another format, like audio or braille. Find out more about our support tariffs and services for priority customers below. "),o()())}function ls(t,l){t&1&&(n(0,"div")(1,"p"),c(2," We're on hand if you need help paying your bill, or if you would like to receive your bills in another format, like audio or braille. Find out more about services for priority customers below. "),o()())}function cs(t,l){if(t&1&&(n(0,"section")(1,"div",10)(2,"div",11)(3,"div",12)(4,"h2",13),c(5,"Need a bit of extra help?"),o(),_(6,ss,3,0,"div",4)(7,ls,3,0,"div",4),n(8,"button",14),c(9," Extra help "),o()()()()()),t&2){let e=d();s(6),a("ngIf",e.company==="SEW"||e.company!=="SEW"&&(e.customer==null?null:e.customer.supplyType)==="MEASURED"),s(),a("ngIf",e.company!=="SEW"&&(e.customer==null?null:e.customer.supplyType)!=="MEASURED"),s(),a("routerLink",Ce(4,Ka))("pageScrollDuration",100)}}function ms(t,l){t&1&&(n(0,"div",27)(1,"h2"),c(2,"My details"),o(),n(3,"p"),c(4," You can update, add and remove account holders for this account. You can also update the mailing address to one that's different from your supply address if you'd like. "),o()())}function ds(t,l){t&1&&(n(0,"div",17)(1,"div",28)(2,"div",19)(3,"h4"),c(4,"It's all about you"),o(),n(5,"p",20),c(6," We'd love to know a bit more about you, it helps us plan for the future & get to know what's important to you "),o(),n(7,"button",29),
1c(8," Extra info "),o()()(),n(9,"div",28)(10,"div",19)(11,"h4",30),c(12,"Notifications"),o(),n(13,"p",20),c(14," You can choose the notifications you'd like to receive - click below to set up "),o(),n(15,"button",31),c(16," Notifications "),o()()()()),t&2&&(s(7),a("routerLink",Ce(4,ts))("pageScrollDuration",100),s(8),a("routerLink",Ce(5,is))("pageScrollDuration",100))}function ps(t,l){t&1&&(n(0,"h5",41),c(1,"Name"),o())}function us(t,l){t&1&&(n(0,"h5",41),c(1," Email address "),o())}function fs(t,l){t&1&&(n(0,"h5",41),c(1," Mobile number "),o())}function hs(t,l){t&1&&(n(0,"div",42),c(1," We're missing some details, please update "),o())}function gs(t,l){if(t&1&&(n(0,"button",43),c(1," Update name "),o()),t&2){let e=d(),i=e.$implicit,r=e.index,m=d(2);a("ngClass",i!=null&&i.customerName&&(i!=null&&i.emailAddress1)&&(i!=null&&i.mobileTelephone)?"mt-auto":"")("routerLink",B(4,ti,"./"+r+"/name-change"))("queryParams",m.queryParams)("pageScrollDuration",100)}}function vs(t,l){if(t&1&&(n(0,"button",44),c(1," Remove person "),o()),t&2){let e=d().index,i=d(2);a("routerLink",B(3,ti,"./"+e+"/remove-person"))("queryParams",i.queryParams)("pageScrollDuration",100)}}function _s(t,l){if(t&1&&(n(0,"div",32)(1,"div",33)(2,"div",34),_(3,ps,2,0,"h5",35),n(4,"div",36),c(5),o(),_(6,us,2,0,"h5",35),n(7,"div",36),c(8),o(),_(9,fs,2,0,"h5",35),n(10,"div",36),c(11),o(),u(12,"br"),_(13,hs,2,0,"div",37)(14,gs,2,6,"button",38),n(15,"button",39),c(16," Update contact details "),o(),_(17,vs,2,5,"button",40),o()()()),t&2){let e=l.$implicit,i=l.index,r=d(2);a("ngClass",r.accountHolders&&(r.accountHolders.length==1||r.accountHolders.length==3)?"col-lg-6":"col-lg-4"),s(3),a("ngIf",e==null?null:e.customerName),s(2),U(e==null?null:e.customerName),s(),a("ngIf",e==null?null:e.emailAddress1),s(2),U(e==null?null:e.emailAddress1),s(),a("ngIf",e==null?null:e.mobileTelephone),s(2),U(e==null?null:e.mobileTelephone),s(2),a("ngIf",!(e!=null&&e.customerName)||!(e!=null&&e.emailAddress1)||!(e!=null&&e.mobileTelephone)),s(),a("ngIf",r.customer.customerType==="D"),s(),a("routerLink",B(13,ti,"./"+i+"/contact-details"))("queryParams",r.queryParams)("pageScrollDuration",100),s(2),a("ngIf",r.accountHolders.length>1)}}function ys(t,l){if(t&1&&(n(0,"div",32)(1,"div",33)(2,"div",45),u(3,"i",46),o(),n(4,"div",47),c(5," Want to add another name to the account? Click here. "),o(),n(6,"div",34)(7,"button",48),c(8," Add "),o()()()()),t&2){let e=d(2);a("ngClass",e.accountHolders&&(e.accountHolders.length==1||e.accountHolders.length==3)?"col-lg-6":"col-lg-4"),s(7),a("routerLink",B(4,ti,"./"+e.accountHolders.length+"/add-person"))("queryParams",e.queryParams)("pageScrollDuration",100)}}function bs(t,l){t&1&&(n(0,"div",49)(1,"div",19)(2,"h4"),c(3,"Notify us of a bereavement"),o(),n(4,"p"),c(5," We\u2019re really sorry about your loss. We know that dealing with the death of a family member or friend can be very distressing. "),o(),n(6,"p"),c(7," To notify us of a bereavement, please enter your details using this form. Once you've entered your details, we'll take care of the rest. "),o(),n(8,"div",50)(9,"button",51),c(10," Notify us of a bereavement "),o()()()()),t&2&&(s(9),a("routerLink",Ce(2,rs))("pageScrollDuration",100))}function Cs(t,l){t&1&&(n(0,"div")(1,"p"),c(2," Please remove additional account holders to switch to a business account. "),o()())}function Ss(t,l){if(t&1&&(n(0,"div")(1,"p"),c(2," If the account name needs to be in a business format please fill out this quick and easy form. "),o(),n(3,"div",50)(4,"button",48),c(5," Switch to a business account "),o()()()),t&2){let e=d(3);s(4),a("routerLink",Ce(3,ns))("queryParams",e.queryParams)("pageScrollDuration",100)}}function Es(t,l){if(t&1&&(n(0,"div",49)(1,"div",19)(2,"h4"),c(3,"Switch to a business account"),o(),_(4,Cs,3,0,"div",4)(5,Ss,6,4,"div",4),o()()),t&2){let e=d(2);s(4),a("ngIf",e.accountHolders&&e.accountHolders.length>1),s(),a("ngIf",e.accountHolders&&e.accountHolders.length===1)}}function xs(t,l){if(t&1&&(n(0,"section",15)(1,"div",10),_(2,ms,5,0,"div",16),n(3,"div",17)(4,"div",18)(5,"div",19)(6,"h4"),c(7,"Mailing address"),o(),n(8,"p",20),c(9," Update this if you want us to send your bill to a different address. Moving home? You'll need to complete our "),n(10,"a",21),c(11,"moving home form here."),o()(),n(12,"p"),c(13),o(),n(14,"button",22),c(15," Update address "),o()()()(),_(16,ds,17,6,"div",23),n(17,"div",17),_(18,_s,18,15,"div",24)(19,ys,9,6,"div",25)(20,bs,11,3,"div",26)(21,Es,6,2,"div",26),o()()()),t&2){let e=d();a("ngClass",e.company==="SEW"||e.company==="ICOSA"?"bg-primary-light":e.company==="LEF"?"bg-secondary-light":"bg-primary"),s(2),a("ngIf",e.application!=="C
1RM"),s(8),a("ngClass",e.company==="MUA"?"text-secondary-light":"")("pageScrollDuration",100),s(3),Ii(" ",e.customer==null||e.customer.billingAddress==null?null:e.customer.billingAddress.addressLine1," ",e.customer==null||e.customer.billingAddress==null?null:e.customer.billingAddress.addressLine2," ",e.customer==null||e.customer.billingAddress==null?null:e.customer.billingAddress.addressLine3," ",e.customer==null||e.customer.billingAddress==null?null:e.customer.billingAddress.addressLine4," ",e.customer==null||e.customer.billingAddress==null?null:e.customer.billingAddress.addressLine5," ",e.customer==null||e.customer.billingAddress==null?null:e.customer.billingAddress.postalCode," "),s(),a("routerLink",Ce(18,es))("queryParams",e.queryParams)("pageScrollDuration",100),s(2),a("ngIf",e.application!=="CRM"),s(2),a("ngForOf",e.accountHolders),s(),a("ngIf",e.accountHolders&&e.accountHolders.length<6),s(),a("ngIf",e.application!=="CRM"),s(),a("ngIf",e.customer.customerType==="D"&&e.sector!=="ENERGY")}}function ws(t,l){t&1&&(n(0,"button",59),c(1," Change display name "),o()),t&2&&a("routerLink",Ce(2,as))("pageScrollDuration",100)}function ks(t,l){if(t&1){let e=b();n(0,"button",60),v("click",function(){h(e);let r=d(2);return g(r.onPasswordReset())}),c(1," Change password "),o()}}function Ts(t,l){if(t&1){let e=b();n(0,"section",52)(1,"div",53)(2,"div",54)(3,"div",12)(4,"h2"),c(5,"Password & other accounts"),o(),n(6,"p"),c(7," Click below to add another property to your account, change your password or delete your online account. "),o(),_(8,ws,2,3,"button",55),n(9,"button",56),c(10," Add another account "),o(),_(11,ks,2,0,"button",57),n(12,"button",58),v("click",function(){h(e);let r=d();return g(r.onDeleteUser())}),c(13," Delete my online account "),o()()()()()}if(t&2){let e=d();s(8),a("ngIf",e.application!=="CRM"),s(),a("routerLink",Ce(4,os))("pageScrollDuration",100),s(2),a("ngIf",(e.firebaseUser==null?null:e.firebaseUser.provider)==="password")}}function Is(t,l){if(t&1&&u(0,"app-campaign",62),t&2){let e=l.$implicit;a("campaign",e)}}function Rs(t,l){if(t&1&&(n(0,"section"),_(1,Is,1,1,"app-campaign",61),o()),t&2){let e=d();s(),a("ngForOf",e.campaigns)}}function Fs(t,l){if(t&1&&(n(0,"div"),u(1,"i",15),o()),t&2){let e=d(2);s(),a("ngClass",e.success?"bg-secondary fal fa-check":"bg-danger shadow fal fa-times")}}function As(t,l){t&1&&(n(0,"div")(1,"div",71),V(),n(2,"svg",72),u(3,"path",73),o(),n(4,"svg",74),u(5,"path",75),o()()())}function Ns(t,l){t&1&&(n(0,"div")(1,"div",76),V(),n(2,"svg",72),u(3,"path",73),o(),n(4,"svg",77),u(5,"path",78),o()()())}function Ms(t,l){if(t&1&&(n(0,"div"),_(1,As,6,0,"div",4)(2,Ns,6,0,"div",4),o()),t&2){let e=d(2);s(),a("ngIf",e.success),s(),a("ngIf",!e.success)}}function Ds(t,l){if(t&1){let e=b();n(0,"button",69),v("click",function(){h(e);let r=d(2);return g(r.onCallBack())}),c(1," Call back "),o()}}function Vs(t,l){if(t&1){let e=b();n(0,"div",63),_(1,Fs,2,1,"div",4)(2,Ms,3,2,"div",4),o(),n(3,"div",64),u(4,"h4",65),o(),n(5,"div",66),u(6,"p",67),o(),n(7,"div",68)(8,"button",69),v("click",function(){h(e);let r=d();return g(r.closeModal())}),c(9," Close "),o(),_(10,Ds,2,0,"button",70),o()}if(t&2){let e=d();s(),a("ngIf",e.company==="SEW"||e.company==="ESP"),s(),a("ngIf",e.company==="ICOSA"||e.company==="MTX"||e.company==="MUA"||e.company==="LEF"),s(2),a("innerHTML",e.modalTitle,F),s(2),a("innerHTML",e.modalBody,F),s(4),a("ngIf",!e.hideCallback)}}function Ps(t,l){t&1&&(n(0,"div"),u(1,"i",88),o())}function Bs(t,l){t&1&&(n(0,"div")(1,"div",76),V(),n(2,"svg",72),u(3,"path",73),o(),n(4,"svg",77),u(5,"path",78),o()()())}function Ls(t,l){if(t&1&&(n(0,"option",89),c(1),o()),t&2){let e=l.$implicit;a("ngValue",e),s(),ne(" ",e," ")}}function Os(t,l){if(t&1){let e=b();n(0,"div",63),_(1,Ps,2,0,"div",4)(2,Bs,6,0,"div",4),o(),n(3,"div",64),u(4,"h4",65),o(),n(5,"div",66),u(6,"p",79),o(),n(7,"div",80)(8,"div",81)(9,"form",82)(10,"div",83)(11,"select",84)(12,"option",85),c(13," Choose your contact reason "),o(),_(14,Ls,2,2,"option",86),o()()()()(),n(15,"div",68)(16,"button",87),v("click",function(){h(e);let r=d();return g(r.onConfirmDelete())}),c(17," Confirm delete "),o(),n(18,"button",69),v("click",function(){h(e);let r=d();return g(r.closeModal())}),c(19," Close "),o()()}if(t&2){let e=d();s(),a("ngIf",e.company==="SEW"),s(),a("ngIf",e.company==="ICOSA"||e.company==="MTX"||e.company==="MUA"||e.company==="LEF"),s(2),a("innerHTML",e.modalTitle,F),s(2),a("innerHTML",e.modalBody,F),s(3),a("formGroup",e.deleteForm),s(3),a("ngValue",null),s(2),a("ngForOf",e.deleteReasons),s(2),a("disabled",!e.deleteForm.get("deleteReason").value)}}function qs(t,l){if(t&1){let e=b();n(0,"app-request-a-call-back",90),v("status",function(r){h(e);let m=d();return g(m.getMessage(r))}),o()}t&2&&a("defaultOption","Other")}var vr=(()=>{let l=class l{constructor(i,r,m,p,y,C,w,I,S,D,L,P,R){this.customerService=i,this.accountHolderService=r,this.pageScrollService=m,this.document=p,this.authUserService=y,this.authService=C,this.userService=w,this.modalService=I,this.sewspinnerService=S,this.spinner=D,this.analyticsService=L,this.route=P,this.fb=R,this.faCheckCircle=mt,this.faTimesCircle=Mi,this.accountHolders=[],this.alerts=[],this.campaigns=[],this.errorMessage="",this.subscriptions=[],this.requestACallBack=!1,this.success=!1,this.company=x.company,this.psrTariffs=[],this.psr=[],this.application=x.application,this.sector=x.sector,this.config={animated:!0,keyboard:!0,backdrop:!0,ignoreBackdropClick:!1,class:"modal-xl"},this.hideCallback=!1,this.deleteReasons=["I have moved out and no longer need to view this account","I'm not comfortable using the internet","I've changed my email address","I am no longer responsible for this address/account","I wasn't able to do/find what I wanted","Other"]}ngOnInit(){this.deleteForm=this.fb.group({deleteReason:[null,[]]}),this.analyticsService.pageView("preferences","./preferences","preferences page"),this.accountHolderSubscription=this.accountHolderService.accountHoldersChange.subscribe(i=>{this.accountHolders=i}),this.accountHolders=this.accountHolderService.getAccountHolders(),this.customerSubscription=this.customerService.customerChange.subscribe(i=>{this.customer=i,this.psrTariffs=[],this.psr=[],this.customer?.priorityServiceRegisters?.filter(r=>{r.category.toUpperCase()==="TARIFF"?this.psrTariffs.push(r):this.psr.push(r)}),this.alerts=this.customerService.getAlerts("preferences"),this.campaigns=this.customerService.getCampaigns("preferences")}),this.customer=this.customerService.getCustomer(),this.customer&&(this.psrTariffs=[],this.psr=[],this.customer?.priorityServiceRegisters?.filter(i=>
1{i.category.toUpperCase()==="TARIFF"?this.psrTariffs.push(i):this.psr.push(i)})),this.alerts=this.customerService.getAlerts("preferences"),this.campaigns=this.customerService.getCampaigns("preferences"),this.firebaseUserSubscription=this.authUserService.userChange.subscribe(i=>{this.firebaseUser=i}),this.firebaseUser=this.authUserService.getCurrentUser(),this.userSubscription=this.userService.userChange.subscribe(i=>{this.user=i}),this.user=this.userService.getUser(),this.queryParams=this.route.snapshot.queryParams}onDeactivate(i){this.pageScrollService.scroll({document:this.document,scrollTarget:"#topnav",duration:100})}onDeleteUser(){this.modalTitle="Are you sure?",this.modalBody="If you confirm this then your online account will be deleted and you will need to re-register",this.openModal(this.templateRef2)}onConfirmDelete(){return Si(this,null,function*(){this.spinner.setSpinnerDescription("Deleting your online account"),this.sewspinnerService.show();try{yield this.authService.doDeleteUser(this.customer?.customerReference,this.getElement("deleteReason").value),this.closeModal()}catch{this.modalTitle="Sorry you need to log back in",this.modalBody="We are unable to delete your account, please logout and back in and try again"}finally{this.sewspinnerService.hide()}})}onPasswordReset(){this.hideCallback=!0;let i={email:""};i.email=this.firebaseUser.email,this.authService.doPasswordReset(i).then(r=>{this.success=!0,this.config.class="success-modal",this.modalTitle="All complete",this.modalBody="All done, you should have an email winging its way to you",this.openModal(this.templateRef)},r=>{let m=Qi.Parse(r.code);this.success=!0,this.config.class="warning-modal",this.modalTitle="We&pos;ve hit an problem",this.modalBody=m,this.errorMessage=m,this.openModal(this.templateRef)})}ngOnDestroy(){this.accountHolderSubscription.unsubscribe()}openModal(i){this.modalRef=this.modalService.show(i,Object.assign({},this.config)),this.subscriptions.push(this.modalService.onHide.subscribe(r=>{r=="backdrop-click"&&this.success&&(this.requestACallBack=!1)}))}onCallBack(){this.closeModal(),this.requestACallBack=!0}getMessage(i){this.requestACallBack=!1}closeModal(){if(this.modalRef)this.requestACallBack=!1;else return;this.modalRef.hide(),this.modalRef=null,this.hideCallback=!1}getElement(i){return this.deleteForm.get(i)}};l.\u0275fac=function(r){return new(r||l)(f(te),f(_e),f(Q),f(W),f(hr),f(ht),f(Ut),f(J),f(G),f(Y),f(ae),f(K),f(le))},l.\u0275cmp=O({type:l,selectors:[["app-preferences"]],viewQuery:function(r,m){if(r&1&&(A(Ja,5),A(Za,5)),r&2){let p;N(p=M())&&(m.templateRef=p.first),N(p=M())&&(m.templateRef2=p.first)}},decls:14,vars:8,consts:[["outlet","outlet"],["template",""],["template2",""],[3,"alerts","showWelcome","pageHeader"],[4,"ngIf"],[3,"ngClass",4,"ngIf"],["class","",4,"ngIf"],[3,"deactivate"],[1,"container"],[3,"defaultOption","status",4,"ngIf"],[1,"container","px-3","py-8","mx-auto"],[1,"row","my-2"],[1,"col-md-12"],[1,"pt-3"],["type","button","href","#topnav","pageScroll","",1,"btn","btn-dark","py-3","px-4","float-right","mr-2","mt-1",3,"routerLink","pageScrollDuration"],[3,"ngClass"],["class","text text-center col-md-10 col-xl-9 mx-auto py-8 py-md-10",4,"ngIf"],[1,"row"],[1,"col-12","mt-5"],[1,"form-wrap","h-100"],[1,"callout","callout-primary"],["routerLink","../moving-home","href","#topnav","pageScroll","",3,"ngClass","pageScrollDuration"],["type","button","href","#topnav","pageScroll","",1,"btn","btn-dark",3,"routerLink","queryParams","pageScrollDuration"],["class","row",4,"ngIf"],["class","col-sm-6 mt-5",3,"ngClass",4,"ngFor","ngForOf"],["class","col-sm-6 mt-5",3,"ngClass",4,"ngIf"],["class","col-sm-12 mt-5",4,"ngIf"],[1,"text","text-center","col-md-10","col-xl-9","mx-auto","py-8","py-md-10"],[1,"col-sm-6","mt-5"],["type","button","href","#topnav","pageScroll","",1,"btn","btn-dark","btn-block",3,"routerLink","pageScrollDuration"],[1,"mb-0"],["type","button","href","#topnav","pageScroll","",1,"btn","btn-block","btn-dark","mt-2",3,"routerLink","pageScrollDuration"],[1,"col-sm-6","mt-5",3,"ngClass"],[1,"card","h-100"],[1,"card-body","d-flex","flex-column"],["class","mb-0 mt-1",4,"ngIf"],[1,"card-text"],["class","callout callout-danger mt-auto",4,"ngIf"],["type","button","class","btn btn-sm btn-block btn-dark","href","#topnav","pageScroll","",3,"ngClass","routerLink","queryParams","pageScrollDuration",4,"ngIf"],["type","button","href","#topnav","pageScroll","",1,"btn","btn-block","btn-sm","btn-dark",3,"routerLink","queryParams","pageScrollDuration"],["type","button","class","btn btn-danger btn-sm btn-block","href","#topnav","pageScroll","",3,"routerLink","queryParams","pageScrollDuration",4,"ngIf"],[1,"mb-0","mt-1"],[1,"callout","callout-danger","mt-auto"],["type","button","href","#topnav","pageScroll","",1,"btn","btn-sm","btn-block","btn-dark",3,"ngClass","routerLink","queryParams","pageScrollDuration"],["type","button","href","#topnav","pageScroll","",1,"btn","btn-danger","btn-sm","btn-block",3,"routerLink","queryParams","pageScrollDuration"],[1,"card-body","pb-1","d-flex","justify-content-center"],[1,"far","fa-user-plus","fa-7x"],[1,"card-body","py-2","text-center"],["type","button","href","#topnav","pageScroll","",1,"mt-auto","btn","btn-block","btn-dark","float-right",3,"routerLink","queryParams","pageScrollDuration"],[1,"col-sm-12","mt-5"],[1,"clearfix"],["type","button","href","#topnav","pageScroll","",1,"mt-auto","btn","btn-block","btn-dark","float-right",3,"routerLink","pageScrollDuration"],[1,""],[1,"container","px-3","py-15","mx-auto"],[1,"row","mt-2"],["type","button","class","btn btn-dark py-3 px-4 mr-1 mt-2","href","#topnav","pageScroll","",3,"routerLink","pageScrollDuration",4,"ngIf"],["type","button ","href","#topnav","pageScroll","",1,"btn","btn-dark","py-3","px-4","mr-1","mt-2",3,"routerLink","pageScrollDuration"],["type","button","class","btn btn-dark py-3 px-4 mr-1 mt-2",3,"click",4,"ngIf"],["type","button",1,"btn","btn-danger","py-3","px-4","mr-1","mt-2",3,"click"],["type","button","href","#topnav","pageScroll","",1,"btn","btn-dark","py-3","px-4","mr-1","mt-2",3,"routerLink","pageScrollDuration"],["type","button",1,"btn","btn-dark","py-3","px-4","mr-1","mt-2",3,"click"],[3,"campaign",4,"ngFor","ngForOf"],[3,"campaign"],[1,"icon-circle"],[1,"modal-header","justify-content-center"],[1,"modal-title",3,"innerHTML"],[1,"modal-body"],[3,"innerHTML"],[1,"modal-footer","justify-content-center"],["type","button",1,"btn","btn-dark",3,"click"],["type","button","class","btn btn-dark",3,"click",4,"ngIf"],[1,"icon-circle-inner","bg-active"],["xmlns","http://www.w3.org/2000/svg","width","279.5","height","268.79","viewBox","0 0 279.5 268.79",1,"pentagon"],["d","M856.134,1644.16a30,30,0,0,1-35.268,0L711.1,1564.41a30.009,30.009,0,0,1-10.9-33.55l41.926-129.04a30,30,0,0,1,28.532-20.73H906.338a30,30,0,0,1,28.532,20.73L976.8,1530.86a30.009,30.009,0,0,1-10.9,33.55Z","transform","translate(-698.75 -1381.09)"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 448 512","fill","white"],["d","M413.505 91.951L133.49 371.966l-98.995-98.995c-4.686-4.686-12.284-4.686-16.971 0L6.211 284.284c-4.686 4.686-4.686 12.284 0 16.971l118.794 118.794c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-11.314-11.314c-4.686-4.686-12.284-4.686-16.97 0z"],[1,"icon-circle-inner","bg-danger"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 512 512"],["d","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm101.8-262.2L295.6 256l62.2 62.2c4.7 4.7 4.7 12.3 0 17l-22.6 22.6c-4.7 4.7-12.3 4.7-17 0L256 295.6l-62.2 62.2c-4.7 4.7-12.3 4.7-17 0l-22.6-22.6c-4.7-4.7-4.7-12.3 0-17l62.2-62.2-62.2-62.2c-4.7-4.7-4.7-12.3 0-17l22.6-22.6c4.7-4.7 12.3-4.7 17 0l62.2 
162.2 62.2-62.2c4.7-4.7 12.3-4.7 17 0l22.6 22.6c4.7 4.7 4.7 12.3 0 17z"],[1,"text-center",3,"innerHTML"],[1,"row","justify-content-center"],[1,"col-10","col-md-8"],["id","deleteForm","name","deleteForm",3,"formGroup"],[1,"select-wrap"],["aria-describedby","deleteReason","formControlName","deleteReason","name","deleteReason","id","deleteReason","required","",1,"custom-select","custom-select-lg"],["disabled","",3,"ngValue"],[3,"ngValue",4,"ngFor","ngForOf"],["type","button",1,"btn","btn-danger",3,"click","disabled"],[1,"bg-danger","shadow","fal","fa-times"],[3,"ngValue"],[3,"status","defaultOption"]],template:function(r,m){if(r&1){let p=b();u(0,"app-page-head",3),_(1,cs,10,5,"section",4)(2,xs,22,19,"section",5)(3,Ts,14,5,"section",6)(4,Rs,2,1,"section",4),n(5,"section")(6,"router-outlet",7,0),v("deactivate",function(C){return h(p),g(m.onDeactivate(C))}),o()(),_(8,Vs,11,5,"ng-template",null,1,q)(10,Os,20,8,"ng-template",null,2,q),n(12,"section",8),_(13,qs,1,1,"app-request-a-call-back",9),o()}if(r&2){let p=oe(7);a("alerts",m.alerts)("showWelcome",!1)("pageHeader","Account settings"),s(),a("ngIf",p.isActivated==!1&&m.application!=="CRM"),s(),a("ngIf",p.isActivated==!1),s(),a("ngIf",p.isActivated==!1&&m.application!=="CRM"),s(),a("ngIf",p.isActivated==!1),s(9),a("ngIf",m.requestACallBack)}},dependencies:[Bi,ft,Li,Oi,H,ge,j,Fe,$,yt,bt,_t,ie,z,Ue,X,re,gt],styles:[".large[_ngcontent-%COMP%]{font-size:1.2em}"]});let t=l;return t})();var Hs=["template"],js=["template2"],Us=()=>["../psr"];function Ws(t,l){if(t&1&&(n(0,"span",17),c(1),o()),t&2){let e=l.$implicit;a("ngClass",e.category=="Tariff"?"badge-info":"badge-secondary"),s(),Ti(" ",e.category," - ",e.type," ")}}function Gs(t,l){if(t&1&&(n(0,"div")(1,"h3"),c(2,"You are already signed up for"),o(),_(3,Ws,2,3,"span",16),o()),t&2){let e=d(2);s(3),a("ngForOf",e.psr)}}function Ys(t,l){t&1&&(n(0,"p",18),c(1," Click confirm to let us know these still apply, click update to change or click remove all if you no longer want or need to be on the priority services register. "),o())}function Qs(t,l){t&1&&(n(0,"div",19)(1,"p"),c(2," You're not current on our priority services register, please click update to find out more and apply "),o()())}function zs(t,l){if(t&1){let e=b();n(0,"button",20),v("click",function(){h(e);let r=d(2);return g(r.onConfirm())}),c(1," Confirm "),o()}if(t&2){let e=d(2);a("disabled",!e.psr||(e.psr==null?null:e.psr.length)<=0)}}function $s(t,l){if(t&1){let e=b();n(0,"button",21),v("click",function(){h(e);let r=d(2);return g(r.onRemove())}),c(1," Remove all "),o()}if(t&2){let e=d(2);a("disabled",!e.psr||(e.psr==null?null:e.psr.length)<=0)}}function Xs(t,l){if(t&1&&(n(0,"div",5)(1,"div",6)(2,"div",7)(3,"h2",8),c(4,"Priority Services Register"),o(),_(5,Gs,4,1,"div",9)(6,Ys,2,0,"p",10)(7,Qs,3,0,"div",11),n(8,"div",12),_(9,zs,2,1,"button",13),n(10,"button",14),c(11," Update "),o(),_(12,$s,2,1,"button",15),o()()()()),t&2){let e=d();s(3),a("ngClass",e.company==="MUA"?"text-secondary-light":"text-primary"),s(2),a("ngIf",e.psr&&(e.psr==null?null:e.psr.length)>0),s(),a("ngIf",e.psr&&(e.psr==null?null:e.psr.length)>0),s(),a("ngIf",!e.psr||(e.psr==null?null:e.psr.length)<1),s(2),a("ngIf",e.psr&&(e.psr==null?null:e.psr.length)>0),s(),a("routerLink",Ce(8,Us))("pageScrollDuration",100),s(2),a("ngIf",e.psr&&(e.psr==null?null:e.psr.length)>0)}}function Js(t,l){if(t&1&&(n(0,"div"),u(1,"i",8),o()),t&2){let e=d(2);s(),a("ngClass",e.success?"bg-secondary fal fa-check":"bg-danger shadow fal fa-times")}}
1function Zs(t,l){t&1&&(n(0,"div")(1,"div",29),V(),n(2,"svg",30),u(3,"path",31),o(),n(4,"svg",32),u(5,"path",33),o()()())}function Ks(t,l){t&1&&(n(0,"div")(1,"div",34),V(),n(2,"svg",30),u(3,"path",31),o(),n(4,"svg",35),u(5,"path",36),o()()())}function el(t,l){if(t&1&&(n(0,"div"),_(1,Zs,6,0,"div",9)(2,Ks,6,0,"div",9),o()),t&2){let e=d(2);s(),a("ngIf",e.success),s(),a("ngIf",!e.success)}}function tl(t,l){if(t&1){let e=b();n(0,"div",22),_(1,Js,2,1,"div",9)(2,el,3,2,"div",9),o(),n(3,"div",23),u(4,"h4",24),o(),n(5,"div",25),u(6,"p",26),o(),n(7,"div",27)(8,"button",28),v("click",function(){h(e);let r=d();return g(r.closeModal())}),c(9," Close "),o(),n(10,"button",28),v("click",function(){h(e);let r=d();return g(r.onCallBack())}),c(11," Call back "),o()()}if(t&2){let e=d();s(),a("ngIf",e.company==="SEW"||e.company==="ESP"),s(),a("ngIf",e.company==="ICOSA"||e.company==="MTX"||e.company==="MUA"||e.company==="LEF"),s(2),a("innerHTML",e.modalTitle,F),s(2),a("innerHTML",e.modalBody,F)}}function il(t,l){if(t&1){let e=b();n(0,"app-request-a-call-back",37),v("status",function(r){h(e);let m=d();return g(m.getMessage(r))}),o()}t&2&&a("defaultOption","Help with additional needs")}function rl(t,l){t&1&&(n(0,"div"),u(1,"i",39),o())}function nl(t,l){t&1&&(n(0,"div")(1,"div",34),V(),n(2,"svg",30),u(3,"path",31),o(),n(4,"svg",35),u(5,"path",36),o()()())}function ol(t,l){if(t&1){let e=b();n(0,"div",22),_(1,rl,2,0,"div",9)(2,nl,6,0,"div",9),o(),n(3,"div",23),u(4,"h4",24),o(),n(5,"div",25),u(6,"p",26),o(),n(7,"div",27)(8,"button",38),v("click",function(){h(e);let r=d();return g(r.onConfirmDelete())}),c(9," Confirm delete "),o(),n(10,"button",28),v("click",function(){h(e);let r=d();return g(r.closeModal())}),c(11," Close "),o()()}if(t&2){let e=d();s(),a("ngIf",e.company==="SEW"||e.company==="ESP"),s(),a("ngIf",e.company==="ICOSA"||e.company==="MTX"||e.company==="MUA"||e.company==="LEF"),s(2),a("innerHTML",e.modalTitle,F),s(2),a("innerHTML",e.modalBody,F)}}var _r=(()=>{let l=class l{constructor(i,r,m,p,y,C,w,I,S,D,L,P,R,Z,wt){this.fb=i,this.route=r,this.router=m,this.pageScrollService=p,this.document=y,this.spinner=C,this.spinnerSevice=w,this.location=I,this.customerService=S,this.preferencesService=D,this.modalService=L,this.globalSettingsService=P,this.analyticsService=R,this.activatedRoute=Z,this.contactDetailsService=wt,this.requestACallBack=!1,this.company=x.company,this.submittedForm=!1,this.subscriptions=[],this.psrTariffs=[],this.psr=[],this.config={animated:!0,keyboard:!0,backdrop:!0,ignoreBackdropClick:!1,class:""}}ngOnInit(){this.customerSubscription=this.customerService.customerChange.subscribe(i=>{this.customer=i,this.psrTariffs=[],this.psr=[],this.customer?.priorityServiceRegisters?.filter(r=>{r.category.toUpperCase()==="TARIFF"?this.psrTariffs.push(r):this.psr.push(r)})}),this.customer=this.customerService.getCustomer(),this.customer&&(this.psrTariffs=[],this.psr=[],this.customer?.priorityServiceRegisters?.filter(i=>{i.category.toUpperCase()==="TARIFF"?this.psrTariffs.push(i):this.psr.push(i)})),this.globalSettings=this.globalSettingsService.getGlobalSettings(),this.globalSettingsService.globalSettingsChange.subscribe(i=>{this.globalSettings=i})}onConfirm(){this.spinner.show(),this.submittedForm=!0;let i=this.activatedRoute.snapshot.queryParamMap.get("contactMethod")?this.activatedRoute.snapshot.queryParamMap.get("contactMethod"):"Y",r=this.activatedRoute.snapshot.queryParamMap.get("telephoneNumber"),m=this.activatedRoute.snapshot.queryParamMap.get("callerName");!i&&!r&&!m&&(i=this.contactDetailsService.contactMethod,r=this.contactDetailsService.eventTelephoneNumber,m=this.contactDetailsService.eventCallerName),this.priorityServiceRegisterRequest=new It(this.customer.customerReference,this.customer.checkDigit,"","REVALIDATE",this.globalSettings.uid,"","","","","","",0,0,r,m,i,[],[],[]),this.preferencesService.getPSRUpdateResponse(this.priorityServiceRegisterRequest).subscribe(p=>{this.spinner.hide(),this.submittedForm=!1,this.returnMessage=p.data.returnMessage,this.success=this.returnMessage==="GREEN"||this.returnMessage==="AMBER",this.config.class=this.success?"success-modal":"warning-modal",this.modalTitle=this.success?"All complete":"Sorry we&apos;ve hit a problem",this.modalBody=this.success?"Thanks for keeping us up to date. We have updated your Priority Services Register requirements":"Oh no, I am so sorry but that didn&apos;t seem to work, could you complete the form again or you can request a callback if you want one of our specialist from our Customer Care Team to give you a ring",this.openModal(this.templateRef)},p=>{this.spinner.hide(),this.success=!1,this.submittedForm=!1,this.config.class=this.success?"success-modal":"danger-modal",this.modalTitle=this.success?"All complete":"Sorry we&apos;ve hit a problem",this.modalBody=this.success?"Thanks for keeping us up to date. We have updated your Priority Services Register requirements":"Oh no, I am so sorry but that didn&apos;t seem to work, could you complete the form again or you can request a callback if you want one of our specialist from our Customer Care Team to give you a ring",this.openModal(this.templateRef)})}onConfirmDelete(){this.spinner.show(),this.submittedForm=!0;let i=this.activatedRoute.snapshot.queryParamMap.get("contactMethod")?this.activatedRoute.snapshot.queryParamMap.get("contactMethod"):"Y",r=this.activatedRoute.snapshot.queryParamMap.get("telephoneNumber"),m=this.activatedRoute.snapshot.queryParamMap.get("callerName");!i&&!r&&!m&&(i=this.contactDetailsService.contactMethod,r=this.contactDetailsService.eventTelephoneNumber,m=this.contactDetailsService.eventCallerName),this.priorityServiceRegisterRequest=new It(this.customer.customerReference,this.customer.checkDigit,"","DELETE",this.globalSettings.uid,"","","","","","",0,0,r,m,i,[],[],[]),this.preferencesService.getPSRUpdateResponse(this.priorityServiceRegisterRequest).subscribe(p=>{this.closeModal(),this.spinner.hide(),this.submittedForm=!1,this.returnMessage=p.data.returnMessage,this.success=this.returnMessage==="GREEN"||this.returnMessage==="AMBER",this.config.class=this.success?"success-modal":"warning-modal",this.modalTitle=this.success?"All complete":"Sorry we&apos;ve hit a problem",this.modalBody=this.success?"Thanks for keeping us up to date. We have removed you from our Priority Services Register":"Oh no, I am so sorry but that didn&apos;t seem to work, could you complete the form again or you can request a callback if you want one of our specialist from our Customer Care Team to give you a ring",this.returnMessage==="GREEN"&&pe.includes(this.company)&&(this.modalBody+=de),this.openModal(this.templateRef)},p=>{this.closeModal(),this.spinner.hide(),this.success=!1,this.submittedForm=!1,this.config.class=this.success?"success-modal":"danger-modal",this.modalTitle=this.success?"All complete":"Sorry we&apos;ve hit a problem",this.modalBody=this.success?"Thanks for keeping us up to date. We have removed you from our Priority Services Register":"Oh no, I am so sorry but that didn&apos;t seem to work, could you complete the form again or you can request a callback if you want one of our specialist from our Customer Care Team to give you a ring",this.openModal(this.templateRef)})}onCancel(){this.location.back(),this.pageScrollService.scroll({document:this.document,scrollTarget:"#topnav",duration:300})}onCallBack(){this.modalRef&&(this.modalRef.hide(),this.modalRef=null),this.requestACallBack=!0}getMessage(i){this.onCancel(),this.requestACallBack=!1}closeModal(){if(this.modalRef)this.success&&(this.onCancel(),this.requestACallBack=!1);else return;this.modalRef.hide(),this.modalRef=null}openModal(i){this.modalRef=this.modalService.show(i,Object.assign({},this.config)),this.subscriptions.push(this.modalService.onHide.subscribe(r=>{r=="backdrop-click"&&this.success&&(this.onCancel(),this.requestACallBack=!1)}))}onRemove(){this.modalTitle="Are you sure?",this.modalBody="Please confirm you no longer need to be on our Priority Services Register",this.openModal(this.templateRef2)}};l.\u0275fac=function(r){return new(r||l)(f(le),f(K),f(Je),f(Q),f(W),f(G),f(Y),f(ee),f(te),f(ve),f(J),f(Re),f(ae),f(K),f(Et))},l.\u0275cmp=O({type:l,selectors:[["app-psr-revalidate-form"]],viewQuery:function(r,m){if(r&1&&(A(Hs,5),A(js,5)),r&2){let p;N(p=M())&&(m.templateRef=p.first),N(p=M())&&(m.templateRef2=p.first)}},decls:7,vars:2,consts:[["template",""],["template2",""],["class","bg-primary-light",4,"ngIf"],[1,"container"],[3,"defaultOption","status",4,"ngIf"],[1,"bg-primary-light"],[1,"container","py-8"],[1,"form-wrap"],[3,"ngClass"],[4,"ngIf"],["class","pt-3",4,"ngIf"],["class","py-3",4,"ngIf"],["role","group","aria-label","Basic example",1,"btn-group","btn-block"],["class","btn btn-success",3,"disabled","click",4,"ngIf"],["href","#topnav","pageScroll","",1,"btn","btn-primary",3,"routerLink","pageScrollDuration"],["class","btn btn-danger",3,"disabled","click",4,"ngIf"],["class","large badge mb-1 mr-1",3,"ngClass",4,"ngFor","ngForOf"],[1,"large","badge","mb-1","mr-1",3,"ngClass"],[1,"pt-3"],[1,"py-3"],[1,"btn","btn-success",3,"click","disabled"],[1,"btn","btn-danger",3,"click","disabled"],[1,"icon-circle"],[1,"modal-header","justify-content-center"],[1,"modal-title",3,"innerHTML"],[1,"modal-body"],[1,"text-center",3,"innerHTML"],[1,"modal-footer","justify-content-center"],["type","button",1,"btn","btn-dark",3,"click"],[1,"icon-circle-inner","bg-active"],["xmlns","http://www.w3.org/2000/svg","width","279.5","height","268.79","viewBox","0 0 279.5 268.79",1,"pentagon"],["d","M856.134,1644.16a30,30,0,0,1-35.268,0L711.1,1564.41a30.009,30.009,0,0,1-10.9-33.55l41.926-129.04a30,30,0,0,1,28.532-20.73H906.338a30,30,0,0,1,28.532,20.73L976.8,1530.86a30.009,30.009,0,0,1-10.9,33.55Z","transform","translate(-698.75 -1381.09)"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 448 512","fill","white"],["d","M413.505 91.951L133.49 371.966l-98.995-98.995c-4.686-4.686-12.284-4.686-16.971 0L6.211 284.284c-4.686 4.686-4.686 12.284 0 16.971l118.794 118.794c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-11.314-11.314c-4.686-4.686-12.284-4.686-16.97 0z"],[1,"icon-circle-inner","bg-danger"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 512 512"],["d","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm101.8-262.2L295.6 256l62.2 62.2c4.7 4.7 4.7 12.3 0 17l-22.6 22.6c-4.7 4.7-12.3 4.7-17 0L256 295.6l-62.2 62.2c-4.7 4.7-12.3 4.7-17 0l-22.6-22.6c-4.7-4.7-4.7-12.3 0-17l62.2-62.2-62.2-62.2c-4.7-4.7-4.7-12.3 0-17l22.6-22.6c4.7-4.7 12.3-4.7 17 0l62.2 
162.2 62.2-62.2c4.7-4.7 12.3-4.7 17 0l22.6 22.6c4.7 4.7 4.7 12.3 0 17z"],[3,"status","defaultOption"],["type","button",1,"btn","btn-danger",3,"click"],[1,"bg-danger","shadow","fal","fa-times"]],template:function(r,m){r&1&&(_(0,Xs,13,9,"div",2)(1,tl,12,4,"ng-template",null,0,q),n(3,"section",3),_(4,il,1,1,"app-request-a-call-back",4),o(),_(5,ol,12,4,"ng-template",null,1,q)),r&2&&(a("ngIf",!m.requestACallBack),s(4),a("ngIf",m.requestACallBack))},dependencies:[ft,H,ge,j,Fe,gt],styles:[".large[_ngcontent-%COMP%]{font-size:1.2em}"]});let t=l;return t})();var yr=(()=>{let l=class l{constructor(i,r,m){this.firestore=i,this.auth=r,this.authService=m,this.destroy$=new at,this.notificationsChange=new at,this.notifications=[],this.userId=null,this.currentSubscription=null,this.active=0,this.authService.isLoggedIn.pipe(st(p=>p?dt(this.auth).pipe(ci(this.destroy$),$e(y=>y?.uid||null),st(y=>(this.userId=y,y?this.loadNotificationsSevice():[]))):[])).subscribe(p=>{this.notifications=p,p&&p.length>0&&this.notificationsChange.next(this.notifications.slice())}),dt(this.auth).pipe(ci(this.destroy$)).subscribe(p=>{!p&&this.currentSubscription&&(this.destroy$.next(),this.active=0,this.notifications=[],this.notificationsChange.next(this.notifications.slice()))})}handleError(i){return r=>(console.error(i,r),ze(()=>new Error(i)))}loadNotificationsSevice(){if(!this.userId)return new Ei;let i=Vi(this.firestore,`user/${this.userId}/notifications/${this.userId}`);return Di(i,{idField:"id"}).pipe($e(r=>r),$e(r=>r?.notification?.length?r.notification:[]),be(this.handleError("Error: getting notification")))}getNotifications(){return this.notifications.slice()}};l.\u0275fac=function(r){return new(r||l)(me(jt),me(Ht),me(ht))},l.\u0275prov=He({token:l,factory:l.\u0275fac,providedIn:"root"});let t=l;return t})();var Mt=class{constructor(l,e,i,r,m){this.customerReference=l,this.method=e,this.limit=i,this.getFields=r,this.uid=m}},ii=class{constructor(l,e,i,r,m,p){this.customerReference=l,this.method=e,this.limit=i,this.getFields=r,this.uid=m,this.waterUpdatesOptOut=p}},ri=class{constructor(l,e,i,r,m,p,y,C,w,I,S,D){this.method=l,this.uid=e,this.customerReference=i,this.mobileNumber=r,this.postcode=m,this.easting=p,this.northing=y,this.interruptions=C,this.events=w,this.plannedWorks=I,this.leaks=S,this.regId=D}},ni=class{constructor(l,e,i,r,m,p,y,C,w){this.method=l,this.uid=e,this.customerReference=i,this.mobileNumber=r,this.postcode=m,this.interruptions=p,this.events=y,this.plannedWorks=C,this.leaks=w}},oi=class{constructor(l,e,i,r){this.method=l,this.uid=e,this.customerReference=i,this.regId=r}};var xt=(()=>{let l=class l{constructor(i,r,m,p){this.http=i,this.globalSettingsService=r,this.functions=m,this.functionsInstances=p,this.baseUrl=x.baseUrl,this.globalSettings=this.globalSettingsService.getGlobalSettings(),this.globalSettingsService.globalSettingsChange.subscribe(y=>{this.globalSettings=y})}getAquaAlerterRegistrations(){let i=new Mt(this.globalSettings?.customerReference,"GET",999,"*",this.globalSettings?.uid);x.useEmulator&&Ve(this.functions,x.emulatorFunction[0],+x.emulatorFunction[1]);let r=Pe(this.functionsInstances[0],"getAquAlerterRegistrationsCF");return this.getRegistrationsCF$=Me(r(i)),this.getRegistrationsCF$}getWuClassStatus(){let i=new Mt(this.globalSettings?.customerReference,"GET",1,"*",this.globalSettings?.uid);x.useEmulator&&Ve(this.functions,x.emulatorFunction[0],+x.emulatorFunction[1]);let r=Pe(this.functionsInstances[0],"getWuClassStatusCF");return this.getWuClassStatusCF$=Me(r(i)),this.getWuClassStatusCF$}updateWuClass(i){console.log("updateWuClass value: ",i);let r=new ii(this.globalSettings?.customerReference,"UPDATE",1,"*",this.globalSettings?.uid,i);console.log("updateWuClass: ",r),x.useEmulator&&Ve(this.functions,x.emulatorFunction[0],+x.emulatorFunction[1]);let m=Pe(this.functionsInstances[0],"updateWuClassStatusCF");return this.updateWuClassCF$=Me(m(r)),this.updateWuClassCF$}updateAquAlerterRegistration(i,r,m,p,y,C,w,I,S){let D=new ri("UPDATE",this.globalSettings?.uid,this.globalSettings?.customerReference,i,r,m,p,y,C,w,I,S);console.log("updateAquAlerterRegistration: ",D),x.useEmulator&&Ve(this.functions,x.emulatorFunction[0],+x.emulatorFunction[1]);let L=Pe(this.functionsInstances[0],"updateAquAlerterRegistrationCF");return this.updateRegistrationCF$=Me(L(D)),this.updateRegistrationCF$}deleteAquAlerterRegistration(i){let r=new oi("DELETE",this.globalSettings?.uid,this.globalSettings?.customerReference,i);x.useEmulator&&Ve(this.functions,x.emulatorFunction[0],+x.emulatorFunction[1]);let m=Pe(this.functionsInstances[0],"updateAquAlerterRegistrationCF");return this.updateRegistrationCF$=Me(m(r)),this.updateRegistrationCF$}newAquAlerterRegistration(i,r,m,p,y,C){let w=new ni("ADD",this.globalSettings?.uid,this.globalSettings?.customerReference,i,r,m,p,y,C);console.log("newAquAlerterRegistration: ",w),x.useEmulator&&Ve(this.functions,x.emulatorFunction[0],+x.emulatorFunction[1]);let I=Pe(this.functionsInstances[0],"newAquAlerterRegistrationCF");return this.updateRegistrationCF$=Me(I(w)),this.updateRegistrationCF$}};l.\u0275fac=function(r){return new(r||l)(me(Lt),me(Re),me(pt),me(ut))},l.\u0275prov=He({token:l,factory:l.\u0275fac,providedIn:"root"});let t=l;return t})();var sl=["template"],br=()=>["../aqualerter-add"],ll=t=>["../aqualerter-edit",t];function cl(t,l){if(t&1&&(n(0,"label",20),c(1,"On"),o()),t&2){let e=d().index;Bt("for","customSwitch",e,"")}}function ml(t,l){if(t&1&&(n(0,"label",20),c(1,"Off"),o()),t&2){let e=d().index;Bt("for","customSwitch",e,"")}}function dl(t,l){if(t&1){let e=b();n(0,"div",5)(1,"div",6)(2,"div",7)(3,"h5",8),c(4),o(),n(5,"div",9)(6,"div",17)(7,"input",18),Ai("ngModelChange",function(r){let m=h(e).$implicit;return Fi(m.active,r)||(m.active=r),g(r)}),o(),_(8,cl,2,2,"label",19)(9,ml,2,2,"label",19),o()()(),n(10,"p",8),c(11),o()()()}if(t&2){let e=l.$implicit,i=l.index;s(4),U(e.title),s(3),Bt("id","customSwitch",i,""),Ri("ngModel",e.active),s(),a("ngIf",e.active),s(),a("ngIf",!e.active),s(2),U(e.description)}}function pl(t,l){t&1&&(n(0,"div",21)(1,"h2",4),c(2,"AquAlerter"),o(),n(3,"p"),c(4," To receive AquAlerter notifications, please ensure your mobile number is up-to-date on your account. You can update your contact information "),n(5,"a",22)(6,"u"),c(7," here"),o()(),c(8,". "),o()()),t&2&&(s(5),a("pageScrollDuration",100))}
1function ul(t,l){if(t&1&&u(0,"fa-icon",56),t&2){let e=d(5);a("icon",e.faCheck)}}function fl(t,l){if(t&1&&u(0,"fa-icon",57),t&2){let e=d(5);a("icon",e.faCross)}}function hl(t,l){if(t&1&&u(0,"fa-icon",56),t&2){let e=d(5);a("icon",e.faCheck)}}function gl(t,l){if(t&1&&u(0,"fa-icon",57),t&2){let e=d(5);a("icon",e.faCross)}}function vl(t,l){if(t&1&&u(0,"fa-icon",56),t&2){let e=d(5);a("icon",e.faCheck)}}function _l(t,l){if(t&1&&u(0,"fa-icon",57),t&2){let e=d(5);a("icon",e.faCross)}}function yl(t,l){if(t&1){let e=b();n(0,"div",45)(1,"div",46)(2,"div",43)(3,"div",47)(4,"h5",48),c(5,"Postcode"),o(),n(6,"p"),c(7),o(),n(8,"h5",48),c(9,"Mobile number"),o(),n(10,"p"),c(11),o(),n(12,"h5",48),c(13,"Alerts"),o(),n(14,"ul",49)(15,"li"),_(16,ul,1,1,"fa-icon",50)(17,fl,1,1,"fa-icon",51),c(18," Community events "),o(),n(19,"li"),_(20,hl,1,1,"fa-icon",50)(21,gl,1,1,"fa-icon",51),c(22," Interruptions "),o(),n(23,"li"),_(24,vl,1,1,"fa-icon",50)(25,_l,1,1,"fa-icon",51),c(26," Leaks "),o()()(),n(27,"div",52)(28,"div",53)(29,"button",54),c(30," Edit "),o(),n(31,"button",55),v("click",function(){let r=h(e).$implicit,m=d(4);return g(m.deleteRegistration(r.regId))}),c(32," Delete "),o()()()()()()}if(t&2){let e=l.$implicit;s(7),U(e==null?null:e.postcode),s(4),ne(" ",e==null?null:e.mobileNumber," "),s(5),a("ngIf",e.events),s(),a("ngIf",!e.events),s(3),a("ngIf",e.interruptions),s(),a("ngIf",!e.interruptions),s(3),a("ngIf",e.leaks),s(),a("ngIf",!e.leaks),s(4),a("routerLink",B(10,ll,e.regId))("pageScrollDuration",100)}}function bl(t,l){if(t&1&&(n(0,"div",36),_(1,yl,33,12,"div",37),n(2,"div",38)(3,"div",39)(4,"div",40),u(5,"i",41),o(),n(6,"div",42),c(7," Want to add another location? Click here. "),o(),n(8,"div",43)(9,"button",44),c(10," Add "),o()()()()()),t&2){let e=d(3);s(),a("ngForOf",e.withoutPropertyRegistrations),s(8),a("routerLink",Ce(3,br))("pageScrollDuration",100)}}function Cl(t,l){t&1&&(n(0,"div",36)(1,"div",58)(2,"div",39)(3,"div",40),u(4,"i",41),o(),n(5,"div",42),c(6," Looks like you haven't signed up to receieve notifications. To add one click add. "),o(),n(7,"div",43)(8,"button",44),c(9," Add "),o()()()()()),t&2&&(s(8),a("routerLink",Ce(2,br))("pageScrollDuration",100))}function Sl(t,l){if(t&1&&(n(0,"div"),u(1,"hr",34),n(2,"h3"),c(3,"Additional subscribed locations"),o(),n(4,"p"),c(5," Below is a list of locations for which you have signed up to receive updates. "),o(),_(6,bl,11,4,"div",35)(7,Cl,10,3,"div",35),u(8,"hr",34),o()),t&2){let e=d(2);s(6),a("ngIf",e.withoutPropertyRegistrations.length>0),s(),a("ngIf",e.allRegistrations.length<=0||e.withoutPropertyRegistrations.length<=0)}}function El(t,l){if(t&1){let e=b();n(0,"div",21)(1,"h2",4),c(2,"AquAlerter"),o(),n(3,"h3"),c(4,"For your supply address"),o(),n(5,"p"),
1c(6," AquAlerter no water notifications will automatically be sent to the mobile number on the account. If you change or update your mobile number, please revisit this page and update your notification preferences to continue to receive updates. You can "),n(7,"a",22)(8,"u"),c(9," click here"),o()(),c(10," to update it. "),o(),n(11,"ul")(12,"li")(13,"strong"),c(14,"No water interruptions"),o(),c(15," - We will keep you updated by SMS during a no water incident. If you turn these off you will no longer receive service updates if your supply is interrupted. "),o(),n(16,"li")(17,"strong"),c(18,"Leaks"),o(),c(19," \u2013 We will keep you updated on the status of leaks in your area. "),o(),n(20,"li")(21,"strong"),c(22,"Community Events"),o(),c(23," \u2013 We will notify you of Community events in your area. "),o()(),n(24,"form",23),v("submit",function(){h(e);let r=d();return g(r.updateSupplyAddress())}),n(25,"div",5)(26,"div",6)(27,"div",7)(28,"h5",8),c(29,"No water interruptions"),o(),n(30,"div",9)(31,"div",17),u(32,"input",24),n(33,"label",25),c(34),o()()()()(),n(35,"div",6)(36,"div",7)(37,"h5",8),c(38,"Leaks"),o(),n(39,"div",9)(40,"div",17),u(41,"input",26),n(42,"label",27),c(43),o()()()()(),n(44,"div",6)(45,"div",7)(46,"h5",8),c(47,"Community events"),o(),n(48,"div",9)(49,"div",17),u(50,"input",28),n(51,"label",29),c(52),o()()()()()(),n(53,"div",30)(54,"div",31)(55,"button",32),c(56,"Update"),o()()()(),_(57,Sl,9,2,"div",33),o()}if(t&2){let e=d();s(7),a("pageScrollDuration",100),s(17),a("formGroup",e.form),s(10),U(e.form.get("interruptions").value?"On":"Off"),s(9),U(e.form.get("leaks").value?"On":"Off"),s(9),U(e.form.get("events").value?"On":"Off"),s(5),a("ngIf",e.allRegistrations!==null)}}function xl(t,l){if(t&1&&(n(0,"div"),u(1,"i",1),o()),t&2){let e=d(2);s(),a("ngClass",e.success?"bg-secondary fal fa-check":"bg-danger shadow fal fa-times")}}function wl(t,l){t&1&&(n(0,"div")(1,"div",66),V(),n(2,"svg",67),u(3,"path",68),o(),n(4,"svg",69),u(5,"path",70),o()()())}function kl(t,l){t&1&&(n(0,"div")(1,"div",71),V(),n(2,"svg",67),u(3,"path",68),o(),n(4,"svg",72),u(5,"path",73),o()()())}function Tl(t,l){if(t&1&&(n(0,"div"),_(1,wl,6,0,"div",33)(2,kl,6,0,"div",33),o()),t&2){let e=d(2);s(),a("ngIf",e.success),s(),a("ngIf",!e.success)}}function Il(t,l){if(t&1){let e=b();n(0,"div",59),_(1,xl,2,1,"div",33)(2,Tl,3,2,"div",33),o(),n(3,"div",60),u(4,"h4",61),o(),n(5,"div",62),u(6,"p",63),o(),n(7,"div",64)(8,"button",65),v("click",function(){h(e);let r=d();return g(r.closeModal())}),c(9," Close "),o()()}if(t&2){let e=d();s(),a("ngIf",e.company==="SEW"||e.company==="ESP"),s(),a("ngIf",e.company==="ICOSA"||e.company==="MTX"||e.company==="MUA"||e.company==="LEF"),s(2),a("innerHTML",e.modalTitle,F),s(2),a("innerHTML",e.modalBody,F)}}var Rl={title:"All complete",body:"That's all updated for you."},yi={title:"Sorry we've hit a problem",body:"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back"},Cr=(()=>{let l=class l{constructor(i,r,m,p,y,C,w,I,S,D,L,P,R){this.fb=i,this.customerService=r,this.analyticsService=m,this.preferencesService=p,this.userService=y,this.propertyService=C,this.notificationService=w,this.accountHolderService=I,this.spinner=S,this.spinnerService=D,this.modalService=L,this.registrationsService=P,this.router=R,this.initialFormState={postcode:null,easting:null,northing:null,interruptions:!1,events:!1,leaks:!1,plannedWorks:!1,regId:null},this.accountHolders=[],this.requestACallBack=!1,this.success=!1,this.company=x.company,this.allRegistrations=null,this.withoutPropertyRegistrations=null,this.propertyRegistration=null,this.loadingWu=!0,this.faCheck=er,this.faCross=Ki,this.config={animated:!0,keyboard:!0,backdrop:!0,ignoreBackdropClick:!1,class:""},this.form=this.fb.group({postcode:null,easting:null,northing:null,interruptions:!1,events:!1,leaks:!1,plannedWorks:!1,regId:null})}ngOnInit(){this.analyticsService.pageView("update-preferences-form","./update-preferences-form","notification change form page"),this.customerSubscription=this.customerService.customerChange.subscribe(i=>{this.customer=i}),this.customer=this.customerService.getCustomer(),this.customer&&(this.preferences=this.customer.notifications),this.userSubscription=this.userService.userChange.subscribe(i=>{this.user=i}),this.user=this.userService.getUser(),this.notificationSubscription=this.notificationService.n
1otificationsChange.subscribe(i=>{this.preferences=i}),this.accountHolderSubscription=this.accountHolderService.accountHoldersChange.subscribe(i=>{this.accountHolders=i}),this.propertySubscription=this.propertyService.propertyChange.subscribe(i=>{this.propertyPostcode=i?.propertyAddress?.postalCode,this.company==="SEW"&&(this.registrationsService.getAquaAlerterRegistrations().pipe(kt(1)).subscribe(r=>{let m=r?.data?.aquaRegistrations;if(m){if(this.allRegistrations=m,this.propertyRegistration=m.filter(p=>p.postcode===this.propertyPostcode),this.propertyRegistration.length>0){let p=this.propertyRegistration[0];this.form.patchValue({postcode:p.postcode,leaks:p.leaks,events:p.events,plannedWorks:p.plannedWorks,regId:p.regId,easting:p.easting,northing:p.northing}),this.initialFormState.postcode=p.postcode,this.initialFormState.easting=p.easting,this.initialFormState.northing=p.northing,this.initialFormState.leaks=p.leaks,this.initialFormState.events=p.events,this.initialFormState.plannedWorks=p.plannedWorks,this.initialFormState.regId=p.regId}this.withoutPropertyRegistrations=m.filter(p=>p.postcode!==this.propertyPostcode)}}),this.registrationsService.getWuClassStatus().pipe(kt(1)).subscribe(r=>{this.wuClassIsOptedOut=r.data.waterUpdatesOptOut,this.loadingWu=!1,this.form.patchValue({interruptions:!this.wuClassIsOptedOut}),this.initialFormState.interruptions=!this.wuClassIsOptedOut}))}),this.preferences=this.notificationService.getNotifications()}isPostcodeFound(){return this.allRegistrations.some(i=>i.postcode===this.propertyPostcode)}turnAllOn(){this.preferences.forEach(i=>{i.active||(i.active=!0)}),this.spinnerService.setSpinnerDescription("updating notifications ..."),this.spinner.show(),this.preferencesService.getNotificationUpdateResponse("*","",this.user.displayName,"MYACCOUNT").pipe(be(i=>this.handleError(i))).subscribe(i=>this.handleSuccess(i))}updateNotification(){let i="",r="";this.preferences.forEach(m=>{m.active&&(i=i+(i?",":"")+m.code),m.active||(r=r+(r?",":"")+m.code)}),this.spinnerService.setSpinnerDescription("updating notifications ..."),this.spinner.show(),this.preferencesService.getNotificationUpdateResponse(i,r,this.user.displayName,"MYACCOUNT").pipe(be(m=>this.handleError(m))).subscribe(m=>this.handleSuccess(m))}updateWuClass(i){this.spinnerService.setSpinnerDescription("Updating preferences..."),this.spinner.show(),this.registrationsService.updateWuClass(i).pipe(lt(()=>{this.spinnerService.setSpinnerDescription("Updating preferences...")}),be(r=>this.handleError(r)),lt(r=>this.handleSuccess(r)),lt(()=>{this.spinner.hide()})).subscribe()}updateSupplyAddress(){if(JSON.stringify(this.initialFormState)===JSON.stringify(this.form.value))return;let i=this.hasWuClassChanged(),r=this.hasAqlChanged();i&&r?this.isPostcodeFound()?this.updateWuClassAndAql():this.createAqlAndUpdateWuClass():i?this.updateWuClassAndAql():r&&(this.isPostcodeFound()?this.updateAql():this.createAql())}hasWuClassChanged(){return JSON.stringify(this.initialFormState.interruptions)!==JSON.stringify(this.form.value.interruptions)}hasAqlChanged(){return JSON.stringify(this.initialFormState.leaks)!==JSON.stringify(this.form.value.leaks)||JSON.stringify(this.initialFormState.events)!==JSON.stringify(this.form.value.events)||JSON.stringify(this.initialFormState.plannedWorks)!==JSON.stringify(this.form.value.plannedWorks)}updateWuClassAndAql(){this.spinnerService.setSpinnerDescription("Updating preferences..."),this.spinner.show(),this.registrationsService.updateWuClass(!this.form.value.interruptions).pipe(lt(()=>this.spinnerService.setSpinnerDescription("Please wait...")),st(()=>this.registrationsService.updateAquAlerterRegistration(this.accountHolders[0].mobileTelephone,this.form.get("postcode").value,this.form.get("easting").value,this.form.get("northing").value,!1,this.form.get("events").value,this.form.get("plannedWorks").value,this.form.get("leaks").value,this.form.get("regId").value)),be(i=>this.handleError(i)),Tt(()=>this.spinner.hide())).subscribe(i=>this.handleSuccess(i),i=>this.handleError(i))}createAqlAndUpdateWuClass(){this.spinnerService.setSpinnerDescription("Updating preferences..."),this.spinner.show(),this.registrationsService.updateWuClass(!this.form.value.interruptions).pipe(lt(()=>this.spinnerService.setSpinnerDescription("Almost there...")),st
1(()=>this.registrationsService.newAquAlerterRegistration(this.accountHolders[0].mobileTelephone,this.propertyPostcode,!1,this.form.get("events").value,this.form.get("plannedWorks").value,this.form.get("leaks").value)),be(i=>this.handleError(i)),Tt(()=>this.spinner.hide())).subscribe(i=>this.handleSuccess(i),i=>this.handleError(i))}updateAql(){this.spinnerService.setSpinnerDescription("Updating preferences..."),this.spinner.show(),this.registrationsService.updateAquAlerterRegistration(this.accountHolders[0].mobileTelephone,this.form.get("postcode").value,this.form.get("easting").value,this.form.get("northing").value,!1,this.form.get("events").value,this.form.get("plannedWorks").value,this.form.get("leaks").value,this.form.get("regId").value).pipe(be(i=>this.handleError(i)),Tt(()=>this.spinner.hide())).subscribe(i=>this.handleSuccess(i))}createAql(){this.spinnerService.setSpinnerDescription("Updating preferences..."),this.spinner.show(),this.registrationsService.newAquAlerterRegistration(this.accountHolders[0].mobileTelephone,this.propertyPostcode,!1,this.form.get("events").value,this.form.get("plannedWorks").value,this.form.get("leaks").value).pipe(be(i=>this.handleError(i)),Tt(()=>this.spinner.hide())).subscribe(i=>this.handleSuccess(i))}deleteRegistration(i){this.spinnerService.setSpinnerDescription("deleting notification..."),this.spinner.show(),this.registrationsService.deleteAquAlerterRegistration(+i).pipe(be(r=>this.handleError(r))).subscribe(r=>this.handleSuccess(r))}openModal(i){this.modalRef=this.modalService.show(i,Object.assign({},this.config))}closeModal(){if(!this.modalRef)return;this.modalRef.hide(),this.modalRef=null;let i=this.router.url;this.router.navigateByUrl("/",{skipLocationChange:!0}).then(()=>{this.router.navigate([i])})}handleError(i){return this.spinner.hide(),this.success=!1,this.showModal(yi.title,yi.body,"danger-modal"),ze(i)}handleSuccess(i){this.spinner.hide(),this.returnMessage=i.data.returnMessage,this.success=this.returnMessage==="GREEN"||this.returnMessage==="AMBER";let r=this.success?"success-modal":"warning-modal",m=this.success?Rl:yi,p=m.body;this.returnMessage==="GREEN"&&pe.includes(this.company)&&(p+=de),this.showModal(m.title,p,r)}showModal(i,r,m){this.config.class=m,this.modalTitle=i,this.modalBody=r,this.openModal(this.templateRef)}ngOnDestroy(){this.customerSubscription&&this.customerSubscription.unsubscribe(),this.userSubscription&&this.userSubscription.unsubscribe(),this.notificationSubscription&&this.notificationSubscription.unsubscribe(),this.propertySubscription&&this.propertySubscription.unsubscribe(),this.accountHolderSubscription&&this.accountHolderSubscription.unsubscribe()}};l.\u0275fac=function(r){return new(r||l)(f(St),f(te),f(ae),f(ve),f(Ut),f(Ze),f(yr),f(_e),f(G),f(Y),f(J),f(xt),f(Je))},l.\u0275cmp=O({type:l,selectors:[["app-update-preferences-form"]],viewQuery:function(r,m){if(r&1&&A(sl,5),r&2){let p;N(p=M())&&(m.templateRef=p.first)}},decls:27,vars:5,consts:[["template",""],[3,"ngClass"],[1,"container","py-8"],[1,"form-wrap"],[1,"text-center"],[1,"list-group"],[1,"list-group-item","list-group-item-action"],[1,"d-flex","w-100","justify-content-between"],[1,"mb-1"],[1,"form-group"],[1,"btn","btn-success","btn-sm",3,"click"],["class","list-group",4,"ngFor","ngForOf"],[1,"form-row","pt-1"],[1,"col-12"],[1,"btn-group","float-right"],[1,"btn","btn-primary",3,"click"],["class","form-wrap mt-5",4,"ngIf"],[1,"custom-control","custom-switch"],["type","checkbox","checked","preference.active",1,"custom-control-input",3,"ngModelChange","id","ngModel"],["class","custom-control-label",3,"for",4,"ngIf"],[1,"custom-control-label",3,"for"],[1,"form-wrap","mt-5"],["routerLink","/preferences/0/contact-details","href","#topnav","pageScroll","",1,"text-black",3,"pageScrollDuration"],[3,"submit","formGroup"],["formControlName","interruptions","type","checkbox","id","interruptions",1,"custom-control-input"],["for","interruptions",1,"custom-control-label"],["formControlName","leaks","type","checkbox","id","leaks",1,"custom-control-input"],["for","leaks",1,"custom-control-label"],["formControlName","events","type","checkbox","id","events",1,"custom-control-input"],["for","events",1,"custom-control-label"],[1,"clearfix"],[1,"btn-group","float-right","pt-5"],["type","submit",1,"btn","btn-primary"],[4,"ngIf"],[1,"my-5"],["class","row",4,"ngIf"],[1,"row"],["class","mt-5 col-md-6 col-lg-4",4,"ngFor","ngForOf"],[1,"col-sm-6","mt-5","col-lg-4"],[1,"card","h-100","bg-info"],[1,"card-body","pb-1","d-flex","justify-content-center"],[1,"far","fa-location-plus","fa-7x","text-success"],[1,"card-body","py-2","text-center"],[1,"card-body","d-flex","flex-column"],["type","button","href","#topnav","pageScroll","",1,"mt-auto","btn","btn-block","btn-success","btn-sm",3,"routerLink","pageScrollDuration"],[1,"mt-5","col-md-6","col-lg-4"],[1,"card","h-100","bg-info","border","border-primary"],[1,"card-text"],[1,"mb-0","mt-1"],[1,"list-unstyled","mb-0"],["class","text-success",3,"icon",4,"ngIf"],["class","text-danger",3,"icon",4,"ngIf"],[1,"clearfix","mt-3"],[1,"btn-group","d-flex"],["type","button","href","#topnav","pageScroll","",1,"btn","btn-warning","btn-sm","w-100",3,"routerLink","pageScrollDuration"],["type","button",1,"btn","btn-danger","btn-sm","w-100",3,"click"],[1,"text-success",3,"icon"],[1,"text-danger",3,"icon"],[1,"col-12","mt-5"],[1,"icon-circle"],[1,"modal-header","justify-content-center"],[1,"modal-title",3,"innerHTML"],[1,"modal-body"],[1,"text-center",3,"innerHTML"],[1,"modal-footer","justify-content-center"],["type","button",1,"btn","btn-dark",3,"click"],[1,"icon-circle-inner","bg-active"],["xmlns","http://www.w3.org/2000/svg","width","279.5","height","268.79","viewBox","0 0 279.5 268.79",1,"pentagon"],["d","M856.134,1644.16a30,30,0,0,1-35.268,0L711.1,1564.41a30.009,30.009,0,0,1-10.9-33.55l41.926-129.04a30,30,0,0,1,28.532-20.73H906.338a30,30,0,0,1,28.532,20.73L976.8,1530.86a30.009,30.009,0,0,1-10.9,33.55Z","transform","translate(-698.75 -1381.09)"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 448 512","fill","white"],["d","M413.505 91.951L133.49 371.966l-98.995-98.995c-4.686-4.686-12.284-4.686-16.971 0L6.211 284.284c-4.686 4.686-4.686 12.284 0 16.971l118.794 118.794c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-11.314-11.314c-4.686-4.686-12.284-4.686-16.97 0z"],[1,"icon-circle-inner","bg-danger"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 512 512"],["d","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm101.8-262.2L295.6 256l62.2 62.2c4.7 4.7 4.7 12.3 0 17l-22.6 22.6c-4.7 4.7-12.3 4.7-17 0L256 295.6l-62.2 62.2c-4.7 4.7-12.3 4.7-17 0l-22.6-22.6c-4.7-4.7-4.7-12.3 0-17l62.2-62.2-62.2-62.2c-4.7-4.7-4.7-12.3 0-17l22.6-22.6c4.7-4.7 12.3-4.7 17 0l62.2 
162.2 62.2-62.2c4.7-4.7 12.3-4.7 17 0l22.6 22.6c4.7 4.7 4.7 12.3 0 17z"]],template:function(r,m){if(r&1){let p=b();n(0,"div",1)(1,"div",2)(2,"div",3)(3,"h1",4),c(4,"Your notifications"),o(),n(5,"p"),c(6," As you're a My Account customer you can choose to receive notifications for some services we offer, just use the switch to turn it on or off "),o(),n(7,"div",5)(8,"div",6)(9,"div",7)(10,"h5",8),c(11,"Turn on all notifications"),o(),n(12,"div",9)(13,"button",10),v("click",function(){return h(p),g(m.turnAllOn())}),c(14," All "),o()()(),n(15,"p",8),c(16),o()()(),_(17,dl,12,7,"div",11),n(18,"div",12)(19,"div",13)(20,"div",14)(21,"button",15),v("click",function(){return h(p),g(m.updateNotification())}),c(22," Save "),o()()()()(),_(23,pl,9,1,"div",16)(24,El,58,6,"div",16),o()(),_(25,Il,10,4,"ng-template",null,0,q)}r&2&&(a("ngClass",m.company==="LMH"?"bg-primary":"bg-primary-light"),s(16),ne(" Click the button to switch all ",m.preferences==null?null:m.preferences.length," notifications on - these are typically sent by SMS and/or email "),s(),a("ngForOf",m.preferences),s(6),a("ngIf",m.company==="SEW"&&!m.loadingWu&&m.accountHolders!==null&&m.accountHolders[0].mobileTelephone===""),s(),a("ngIf",m.company==="SEW"&&!m.loadingWu&&m.accountHolders!==null&&m.accountHolders[0].mobileTelephone!==""))},dependencies:[ft,H,ge,j,$,je,ie,z,qi,X,re,Ie,gt]});let t=l;return t})();var Fl=["template"],ai=t=>({"is-invalid":t});function Al(t,l){if(t&1&&(n(0,"div"),u(1,"i",39),o()),t&2){let e=d(2);s(),a("ngClass",e.success?"bg-secondary fal fa-check":"bg-danger shadow fal fa-times")}}function Nl(t,l){t&1&&(n(0,"div")(1,"div",40),V(),n(2,"svg",41),u(3,"path",42),o(),n(4,"svg",43),u(5,"path",44),o()()())}function Ml(t,l){t&1&&(n(0,"div")(1,"div",45),V(),n(2,"svg",41),u(3,"path",42),o(),n(4,"svg",46),u(5,"path",47),o()()())}function Dl(t,l){if(t&1&&(n(0,"div"),_(1,Nl,6,0,"div",32)(2,Ml,6,0,"div",32),o()),t&2){let e=d(2);s(),a("ngIf",e.success),s(),a("ngIf",!e.success)}}function Vl(t,l){if(t&1){let e=b();n(0,"div",31),_(1,Al,2,1,"div",32)(2,Dl,3,2,"div",32),o(),n(3,"div",33),u(4,"h4",34),o(),n(5,"div",35),u(6,"p",36),o(),n(7,"div",37)(8,"button",38),v("click",function(){h(e);let r=d();return g(r.closeModal())}),c(9," Close "),o()()}if(t&2){let e=d();s(),a("ngIf",e.company==="SEW"||e.company==="ESP"),s(),a("ngIf",e.company==="ICOSA"||e.company==="MTX"||e.company==="MUA"||e.company==="LEF"),s(2),a("innerHTML",e.modalTitle,F),s(2),a("innerHTML",e.modalBody,F)}}var Sr=(()=>{let l=class l{constructor(i,r,m,p,y,C,w,I,S,D,L,P){this.fb=i,this.accountHolderService=r,this.customerService=m,this.location=p,this.document=y,this.nameChangeService=C,this.preferencesService=w,this.pageScrollService=I,this.spinner=S,this.spinnerService=D,this.activatedRoute=L,this.modalService=P,this.company=x.company,this.application=x.application,this.submitted=!1,this.subscriptions=[],this.config={animated:!0,keyboard:!0,backdrop:!0,ignoreBackdropClick:!1,class:""}}ngOnInit(){this.form=this.fb.group({companyName:[null,[E.required,E.maxLength(30)]],repName:[null,[E.maxLength(30)]],tradingAs:[null,[E.maxLength(30)]],regNo:[null,[E.minLength(8),E.maxLength(8)]],vatNo:null}),this.customerSubscription=this.customerService.customerChange.subscribe(i=>{this.customer=i}),this.customer=this.customerService.getCustomer(),this.accountHolderSubscription=this.accountHolderService.accountHoldersChange.subscribe(i=>{this.accountHolder=this.accountHolderService.getAccountHolder(0)})}focusOnError(i){i.focus()}onSubmitError(){this.spinner.hide(),this.success=!1,this.config.class=this.success?"success-modal":"danger-modal",this.modalTitle=this.success?"All complete":"Sorry we&apos;ve hit a problem",this.modalBody=this.success?"That&apos;s all updated for you.  Thanks so much for keeping your details up to date":"Oh no, I am so sorry but that didn&apos;t seem to work, could you complete the form again.",this.openModal(this.templateRef)}onSubmit(){this.submitted=!0;let i=document.querySelector(".ng-invalid[formControlName]");if(this.form.invalid)this.focusOnError(i);else{this.customerReference=this.customer.customerReference,this.mobileTelephone=this.accountHolder.mobileTelephone,this.homeTelephone=this.accountHolder.homeTelephone,this.workTelep
1hone=this.accountHolder.workTelephone,this.emailAddress1=this.accountHolder.emailAddress1,this.emailAddress2=this.accountHolder.emailAddress2,this.nationalInsuranceNo=this.accountHolder.nationalInsuranceNo;let r=this.activatedRoute.snapshot.queryParamMap.get("contactMethod")?this.activatedRoute.snapshot.queryParamMap.get("contactMethod"):"Y";this.spinnerService.setSpinnerDescription("Please wait..."),this.spinner.show(),this.nameChangeService.getNameChangeUpdateResponse(this.customer.customerReference,r,"UPDATE","Business",1,"","",this.form.get("companyName").value).subscribe(m=>{this.nameChangeMessage=m.data.returnMessage,m.data.returnMessage==="GREEN"||m.data.returnMessage==="AMBER"?this.preferencesService.getContactDetailsUpdateResponse(this.customerReference,1,this.mobileTelephone,this.homeTelephone,this.workTelephone,null,this.emailAddress1,this.emailAddress2,this.nationalInsuranceNo,this.form.get("regNo").value,this.form.get("repName").value,this.form.get("tradingAs").value,this.form.get("vatNo").value,"C",r).subscribe(p=>{this.spinner.hide(),this.success=p.data.returnMessage==="GREEN"||p.data.returnMessage==="AMBER",this.config.class=this.success?"success-modal":"warning-modal",this.modalTitle=this.success?"All complete":"Sorry we&apos;ve hit a problem",this.modalBody=this.success&&this.nameChangeMessage==="GREEN"?"That&apos;s all updated for you.  Thanks so much for keeping your details up to date.":this.success&&this.nameChangeMessage==="AMBER"?"Thank you for updating your details. We are just checking a few bits and will update your account shortly.":"Oh no, I am so sorry but that didn&apos;t seem to work, could you complete the form again.",p.data.returnMessage==="GREEN"&&pe.includes(this.company)&&(this.modalBody+=de),this.openModal(this.templateRef)},p=>{this.onSubmitError()}):this.onSubmitError()},m=>{this.onSubmitError()})}}onCancel(){this.location.back(),this.pageScrollService.scroll({document:this.document,scrollTarget:"#topnav",duration:300})}openModal(i){this.modalRef=this.modalService.show(i,Object.assign({},this.config)),this.subscriptions.push(this.modalService.onHide.subscribe(r=>{r==="backdrop-click"&&this.success&&this.onCancel()}))}closeModal(){if(this.modalRef)this.success&&this.onCancel();else return;this.modalRef.hide(),this.modalRef=null}};l.\u0275fac=function(r){return new(r||l)(f(le),f(_e),f(te),f(ee),f(W),f(We),f(ve),f(Q),f(G),f(Y),f(K),f(J))},l.\u0275cmp=O({type:l,selectors:[["app-business-account"]],viewQuery:function(r,m){if(r&1&&A(Fl,5),r&2){let p;N(p=M())&&(m.templateRef=p.first)}},decls:48,vars:23,consts:[["companyNameErrorRef",""],["repNameErrorRef",""],["tradingAsErrorRef",""],["regNoErrorRef",""],["template",""],[1,"bg-primary-light"],[1,"container","py-8"],[1,"form-wrap"],[3,"ngSubmit","formGroup"],[1,"hint"],[1,"text-danger"],[1,"form-group"],["for","companyName",1,"label","required"],["errorMsg","Please enter the companies name","id","companyNameError",3,"displayErrorIf"],["errorMsg","Company name is limited to 30 characters","id","companyNameError",3,"displayErrorIf"],["type","text","formControlName","companyName","name","companyName","id","companyName","aria-describedby","companyNameError",1,"form-control","form-control-lg",3,"keydown.enter","ngClass"],["for","repName",1,"label"],["errorMsg","Representative name is limited to 30 characters","id","repNameError",3,"displayErrorIf"],["type","text","formControlName","repName","name","repName","id","repName","aria-describedby","repNameError",1,"form-control","form-control-lg",3,"keydown.enter","ngClass"],["for","tradingAs",1,"label"],["errorMsg","Trading as name is limited to 30 characters","id","tradingAsError",3,"displayErrorIf"],["type","text","formControlName","tradingAs","name","tradingAs","id","tradingAs","aria-describedby","tradingAsError",1,"form-control","form-control-lg",3,"keydown.enter","ngClass"],["for","regNo",1,"label"],["errorMsg","Company registration number consists of 8 figures (numbers) or 2 letters followed by 6 figures","id","regNoError",3,"displayErrorIf"],["type","text","formControlName","regNo","name","regNoError","id","regNo","aria-describedby","reg
1NoError",1,"form-control","form-control-lg",3,"keydown.enter","ngClass"],["for","vatNo",1,"label"],["type","text","formControlName","vatNo","name","vatNo","id","vatNo",1,"form-control","form-control-lg",3,"keydown.enter"],[1,"clearfix"],[1,"btn-group","float-right"],["type","button",1,"btn","btn-outline-danger","mx-3",3,"click"],["type","submit",1,"btn","btn-primary"],[1,"icon-circle"],[4,"ngIf"],[1,"modal-header","justify-content-center"],[1,"modal-title",3,"innerHTML"],[1,"modal-body"],[1,"text-center",3,"innerHTML"],[1,"modal-footer","justify-content-center"],["type","button",1,"btn","btn-dark",3,"click"],[3,"ngClass"],[1,"icon-circle-inner","bg-active"],["xmlns","http://www.w3.org/2000/svg","width","279.5","height","268.79","viewBox","0 0 279.5 268.79",1,"pentagon"],["d","M856.134,1644.16a30,30,0,0,1-35.268,0L711.1,1564.41a30.009,30.009,0,0,1-10.9-33.55l41.926-129.04a30,30,0,0,1,28.532-20.73H906.338a30,30,0,0,1,28.532,20.73L976.8,1530.86a30.009,30.009,0,0,1-10.9,33.55Z","transform","translate(-698.75 -1381.09)"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 448 512","fill","white"],["d","M413.505 91.951L133.49 371.966l-98.995-98.995c-4.686-4.686-12.284-4.686-16.971 0L6.211 284.284c-4.686 4.686-4.686 12.284 0 16.971l118.794 118.794c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-11.314-11.314c-4.686-4.686-12.284-4.686-16.97 0z"],[1,"icon-circle-inner","bg-danger"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 512 512"],["d","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm101.8-262.2L295.6 256l62.2 62.2c4.7 4.7 4.7 12.3 0 17l-22.6 22.6c-4.7 4.7-12.3 4.7-17 0L256 295.6l-62.2 62.2c-4.7 4.7-12.3 4.7-17 0l-22.6-22.6c-4.7-4.7-4.7-12.3 0-17l62.2-62.2-62.2-62.2c-4.7-4.7-4.7-12.3 0-17l22.6-22.6c4.7-4.7 12.3-4.7 17 0l62.2 62.2 62.2-62.2c4.7-4.7 12.3-4.7 17 0l22.6 22.6c4.7 4.7 4.7 12.3 0 17z"]],template:function(r,m){if(r&1){let p=b();n(0,"div",5)(1,"div",6)(2,"div",7)(3,"form",8),v("ngSubmit",function(){return h(p),g(m.onSubmit())}),n(4,"h2"),c(5,"Switch to a business account"),o(),n(6,"small",9),c(7," Fields marked with "),n(8,"span",10),c(9,"*"),o(),c(10," are required. "),o(),n(11,"div",11)(12,"label",12),c(13,"Company name"),o(),u(14,"app-input-error-message",13)(15,"app-input-error-message",14),n(16,"input",15,0),v("keydown.enter",function(C){return h(p),g(C.preventDefault())}),o()(),n(18,"div",11)(19,"label",16),c(20,"Company representative name"),o(),u(21,"app-input-error-message",17),n(22,"input",18,1),v("keydown.enter",function(C){return h(p),g(C.preventDefault())}),o()(),n(24,"div",11)(25,"label",19),c(26,"Company trading as"),o(),u(27,"app-input-error-message",20),n(28,"input",21,2),v("keydown.enter",function(C){return h(p),g(C.preventDefault())}),o()(),n(30,"div",11)(31,"label",22),c(32,"Company registration number (CRN)"),o(),u(33,"app-input-error-message",23),n(34,"input",24,3),v("keydown.enter",function(C){return h(p),g(C.preventDefault())}),o()(),n(36,"div",11)(37,"label",25),c(38,"Company VAT number"),o(),n(39,"input",26),v("keydown.enter",function(C){return h(p),g(C.preventDefault())}),o()(),n(40,"div",27)(41,"div",28)(42,"button",29),v("click",function(){return h(p),g(m.onCancel())}),c(43," Cancel "),o(),n(44,"button",30),c(45,"Submit"),o()()()()()()(),_(46,Vl,10,4,"ng-template",null,4,q)}r&2&&(s(3),a("formGroup",m.form),s(11),a("displayErrorIf",m.submitted&&m.form.get("companyName").hasError("required")),s(),a("displayErrorIf",m.submitted&&m.form.get("companyName").hasError("maxlength")),s(),a("ngClass",B(15,ai,m.submitted&&m.form.get("companyName").errors)),De("aria-invalid",!m.form.get("companyName").valid),s(5),a("displayErrorIf",m.submitted&&m.form.get("repName").hasError("maxlength")),s(),a("ngClass",B(17,ai,m.submitted&&m.form.get("repName").errors)),De("aria-invalid",!m.form.get("repName").valid),s(5),a("displayErrorIf",m.submitted&&m.form.get("tradingAs").hasError("maxlength")),s(),a("ngClass",B(19,ai,m.submitted&&m.form.get("tradingAs").errors)),De("aria-invalid",!m.form.get("tradingAs").valid),s(5),a("displayErrorIf",m.submitted&&m.form.get("regNo").hasError("minlength")||m.form.get("regNo").hasError("maxlength")),s(),a("ngClass",B(21,ai,m.submitted&&m.form.get("regNo").errors)),De("aria-invalid",!m.form.get("regNo").valid),s(5),De("aria-invalid",!m.form.get("vatNo").valid))},dependencies:[H,j,ce,$,se,ie,z,X,re]});let t=l;return t})();var si=class{constructor(l,e){this.title=l,this.questions=e}};
1function Pl(t,l){t&1&&(n(0,"p"),c(1," We'd love to know you a bit better. By providing this information it helps us understand you better to make sure we give you the best service possible "),o())}function Bl(t,l){if(t&1&&(n(0,"div",8),u(1,"app-question",14),o()),t&2){let e=l.$implicit,i=d(2);s(),a("question",e)("form",i.form)}}function Ll(t,l){if(t&1){let e=b();n(0,"button",15),v("click",function(){h(e);let r=d(2);return g(r.onMove("prev"))}),c(1," Previous "),o()}if(t&2){let e=d(2);a("disabled",e.currentPage==0)}}function Ol(t,l){t&1&&(n(0,"span"),c(1,"& next"),o())}function ql(t,l){t&1&&(n(0,"span"),c(1,"& close"),o())}function Hl(t,l){if(t&1){let e=b();n(0,"form",6),v("ngSubmit",function(){h(e);let r=d();return g(r.onSubmit())}),n(1,"div",7)(2,"div",8)(3,"h3"),c(4),o()(),_(5,Bl,2,2,"div",9),o(),n(6,"div",7)(7,"div",8)(8,"div",10)(9,"button",11),v("click",function(){h(e);let r=d();return g(r.onCancel())}),c(10," Cancel "),o(),_(11,Ll,2,1,"button",12),n(12,"button",13),c(13," Save "),_(14,Ol,2,0,"span",3)(15,ql,2,0,"span",3),o()()()()()}if(t&2){let e=d();a("formGroup",e.form),s(4),U(e.categories[e.currentPage]==null?null:e.categories[e.currentPage].title),s(),a("ngForOf",e.categories[e.currentPage]==null?null:e.categories[e.currentPage].questions),s(6),a("ngIf",e.currentPage>0),s(),a("disabled",!(e.form!=null&&e.form.valid)||e.submittedForm),s(2),a("ngIf",e.currentPage<e.categories.length-1),s(),a("ngIf",e.currentPage==e.categories.length-1)}}function jl(t,l){if(t&1&&(n(0,"div",7)(1,"strong"),c(2,"Saved the following values"),o(),u(3,"br"),c(4),o()),t&2){let e=d();s(4),ne("",e.payLoad," ")}}var Er=(()=>{let l=class l{constructor(i,r,m,p,y,C,w){this.questionService=i,this.customerService=r,this.qcs=m,this.pageScrollService=p,this.document=y,this.location=C,this.preferencesService=w,this.status=new xi,this.payLoad="",this.submitted=null,this.questionsAnswer=[],this.moreQuestions=!1,this.categories=[],this.currentPage=0,this.submittedForm=!1,this.company=x.company}ngOnInit(){this.customerSubscription=this.customerService.customerChange.subscribe(i=>{this.customer=i,this.getQuestions()}),this.customer=this.customerService.getCustomer(),this.getQuestions()}getQuestions(){let i=!1,r;this.categories=[],this.customer?.questions&&this.customer?.questions.length>0&&(this.questions=this.questionService.getQuestions(0),this.questions.forEach(m=>{i=!1,this.categories.forEach(p=>{p.title==m.category&&(p.questions.push(m),i=!0)}),i||(r=new si(m.category,[m]),this.categories.push(r))}),this.questions&&this.questions.length>0&&(this.form=this.qcs.toFormGroup(this.questions)))}onMove(i){this.submittedForm=!1,i=="next"&&this.currentPage<this.categories.length-1?(this.currentPage++,this.pageScrollService.scroll({document:this.document,scrollTarget:"#topheading",duration:100})):i=="prev"&&this.currentPage>0?(this.currentPage--,this.pageScrollService.scroll({document:this.document,scrollTarget:"#topheading",duration:100})):i=="next"&&this.currentPage==this.categories.length-1&&this.onCancel()}onCancel(){this.location.back(),this.pageScrollService.scroll({document:this.document,scrollTarget:"#topnav",duration:300})}onSubmit(){let i=[];this.submittedForm=!0,this.categories[this.currentPage].questions.forEach(r=>{r.value=this.form.value[r.key].toString(),i.push(new ji(r.category,r.order,r.imageName,"",r.label,r.controlType,r.value,r.required,r.key,r.type,null))}),this.preferencesService.getQuestionsUpdateResponse(i).subscribe(()=>{}),this.onMove("next")}};l.\u0275fac=function(r){return new(r||l)(f(Wi),f(te),f(Ui),f(Q),f(W),f(ee),f(ve))},l.\u0275cmp=O({type:l,selectors:[["app-data-form"]],outputs:{status:"status"},decls:8,vars:4,consts:[["id","topheading",1,"topheading",3,"ngClass"],[1,"container","py-8"],[1,"form-wrap"],[4,"ngIf"],[3,"formGroup","ngSubmit",4,"ngIf"],["class","form-row",4,"ngIf"],[3,"ngSubmit","formGroup"],[1,"form-row"],[1,"col-12"],["class","col-12",4,"ngFor","ngForOf"],[1,"btn-group","float-right"],["type","button",1,"btn","btn-sm","btn-outline-danger",3,"click"],["type","button","class","btn btn-sm btn-outline-success mx-1",3,"disabled","click",4,"ngIf"],["type","submit",1,"btn","btn-sm","btn-success",3,"disabled"],[3,"question","form"],["type","button",1,"btn","btn-sm","btn-outline-success","mx-1",3,"click","disabled"]],template:function(r,m){r&1&&
1(n(0,"div",0)(1,"div",1)(2,"div",2)(3,"h2"),c(4,"Your details"),o(),_(5,Pl,2,0,"p",3)(6,Hl,16,7,"form",4)(7,jl,5,1,"div",5),o()()()),r&2&&(a("ngClass",m.company==="LMH"?"bg-primary":"bg-primary-light"),s(5),a("ngIf",m.currentPage==0),s(),a("ngIf",m.form&&m.questions&&m.questions.length>0&&!m.submitted),s(),a("ngIf",m.payLoad))},dependencies:[H,ge,j,$,z,X,Gi]});let t=l;return t})();var Ul=["template"],xr=t=>({"is-invalid":t});function Wl(t,l){if(t&1&&u(0,"fa-icon",24),t&2){let e=d();a("icon",e.faSearch)}}function Gl(t,l){t&1&&u(0,"i",25)}function Yl(t,l){t&1&&(n(0,"option",30),c(1," Loading... "),o()),t&2&&a("ngValue",null)}function Ql(t,l){t&1&&(n(0,"option",30),c(1," No results found "),o()),t&2&&a("ngValue",null)}function zl(t,l){t&1&&(n(0,"option",30),c(1," 1 address found "),o()),t&2&&a("ngValue",null)}function $l(t,l){if(t&1&&(n(0,"option",30),c(1),o()),t&2){let e=d(2);a("ngValue",null),s(),ne(" ",e.propertyLookups==null?null:e.propertyLookups.length," addresses found ")}}function Xl(t,l){if(t&1&&(n(0,"option",31),c(1),o()),t&2){let e=l.$implicit;a("ngValue",e),s(),ne(" ",e.fullAddressNoPostcode," ")}}function Jl(t,l){if(t&1){let e=b();n(0,"div")(1,"div",26)(2,"select",27),v("ngModelChange",function(r){h(e);let m=d();return g(m.addressUpdate(r))}),_(3,Yl,2,1,"option",28)(4,Ql,2,1,"option",28)(5,zl,2,1,"option",28)(6,$l,2,2,"option",28)(7,Xl,2,2,"option",29),o()()()}if(t&2){let e=d();s(3),a("ngIf",e.lookupLoading),s(),a("ngIf",(e.propertyLookups==null?null:e.propertyLookups.length)==0),s(),a("ngIf",(e.propertyLookups==null?null:e.propertyLookups.length)==1),s(),a("ngIf",(e.propertyLookups==null?null:e.propertyLookups.length)>1),s(),a("ngForOf",e.propertyLookups)}}function Zl(t,l){t&1&&(n(0,"div")(1,"p",32),c(2," Sorry we believe that this postcode is outside of our area, you can "),n(3,"a",33)(4,"u"),c(5,"check here"),o()(),c(6," to see who is listed as your correct water company. If you are sure that the property is supplied by South East Water then get in touch with us via Live Chat or "),n(7,"a",34)(8,"u"),c(9,"0333 000 0001"),o()(),c(10,". "),o()())}function Kl(t,l){t&1&&(n(0,"div")(1,"p",32),c(2," We don't have a match for this property, you can "),n(3,"a",33)(4,"u"),c(5,"check here"),o()(),c(6," to see who is listed as your correct water company. If you are sure that the property is supplied by South East Water then get in touch with us via Live Chat or "),n(7,"a",34)(8,"u"),c(9,"0333 000 0001"),o()(),c(10,". "),o()())}function ec(t,l){if(t&1&&(n(0,"div")(1,"h4"),c(2,"Communication preferences"),o(),n(3,"div",35)(4,"div",36)(5,"div",37)(6,"h5",38),c(7,"No water interruptions"),o(),n(8,"div",5)(9,"div",39),u(10,"input",40),n(11,"label",41),c(12),o()()()()(),n(13,"div",36)(14,"div",37)(15,"h5",38),c(16,"Leaks"),o(),n(17,"div",5)(18,"div",39),u(19,"input",42),n(20,"label",43),c(21),o()()()()(),n(22,"div",36)(23,"div",37)(24,"h5",38),c(25,"Community events"),o(),n(26,"div",5)(27,"div",39),u(28,"input",44),n(29,"label",45),c(30),o()()()()()(),n(31,"div",46)(32,"div",47)(33,"button",48),c(34," Subscribe "),o()()()()),t&2){let e=d();s(12),U(e.form.get("interruptions").value?"On":"Off"),s(9),U(e.form.get("leaks").value?"On":"Off"),s(9),U(e.form.get("events").value?"On":"Off")}}function tc(t,l){if(t&1){let e=b();n(0,"div",49)(1,"div"),u(2,"i",50),o()(),n(3,"div",51),u(4,"h4",52),o(),n(5,"div",53),u(6,"p",54),o(),n(7,"div",55)(8,"button",56),v("click",function(){h(e);let r=d();return g(r.closeModal())}),c(9," Close "),o()()}if(t&2){let e=d();s(2),a("ngClass",e.success?"bg-secondary fal fa-check":"bg-danger shadow fal fa-times"),s(2),a("innerHTML",e.modalTitle,F),s(2),a("innerHTML",e.modalBody,F)}}var ic={title:"All complete",body:"That's all updated for you."},bi={title:"Sorry we've hit a problem",body:"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back"},wr=(()=>{let l=class l{constructor(i,r,m,p,y,C,w,I,S,D,L,P){this.spinner=i,this.spinnerService=r,this.pageScrollService=m,this.modalService=p,this.location=y,this.fb=C,this.activatedRoute=w,this.propertyLookupService=I,this.propertyService=S,this.registrationsService=D,this.accountHolderService=L,this.document=P,this.accountHolders=[],this.postcodeMatch=!1,this.postcodeMatchError="You have already signed up for alerts at that postcode. To update please head to the alerts page.",this.postcodesSignedUpTo=[],this.company=x.company,this.submitted=!1,this.showNoLookupTriedError=!0,this.lookupLoading=!1,this.addressSelected=!1,this.propertyLookupSearch=!1,this.postcode=null,this.propertyReference=null,this.faSearch=tr,this.subscriptions=[],this.config={animated:!0,keyboard:!0,backdrop:!0,ignoreBackdropClick:!1,class:""},this.form=this.fb.group({propertySearchResult:null,postcode:[this.activatedRoute.snapshot.queryParamMap.get("postCode"),[E.required,E.minLength(5)]],interruptions:!0,events:!0,leaks:!0,plannedWorks:!0,mobileNumber:["",[E.required,E.pattern("^(?:(?:\\+44\\s?(?:\\(0\\)\\s?)?|0)7\\d{3}\\s?\\d{3}\\s?\\d{3}|\\(07\\d{3}\\)\\s?\\d{6})$")]]})}ngOnInit(){this.accountHolderSubscription=this.accountHolderService.accountHoldersChange.subscribe(i=>{this.form.patchValue({mobileNumber:i[0].mobileTelephone})}),this.propertySubscription=this.propertyService.propertyChange.subscribe(i=>{this.propertyPostcode=i?.propertyAddress?.postalCode}),this.company==="SEW"&&this.registrationsService.getAquaAlerterRegistrations().pipe(kt(1)).subscribe(i=>{if(i.data.aquaRegistrations){let r=i.data.aquaRegistrations.map(m=>m.postcode.replace(/\s/g,""));this.postcodesSignedUpTo=Array.from(new Set(r))}})}propertyLookup(){let i=this.form.get("postcode").value.replace(/\s/g,"");if(i===this.propertyPostcode.replace(/\s/g,"")||this.postcodesSignedUpTo.includes(i))i===this.propertyPostcode.replace(/\s/g,"")&&(this.postcodeMatchError="You don\u2019t need to add your supply postcode here. Instead, you can manage your supply address on the alerts page."),this.postcodeMatch=!0;else{this.showNoLookupTriedError=!1,this.addressSelected=!1,this.lookupLoading=!0,this.propertyLookupSearch&&(this.propertyLookupSearch=!1,this.addressSelected=!1,this.lookupLoading=!0,this.postcode=null,this.propertyReference=null,this.form.get("propertySearchResult").reset(),this.propertyLookups=null,this.postCodeDistrictMatch=""),this.propertyLookupSearch=!0;let r=this.form.get("postcode").value,m="";this.postcodeMatch=!1,this.propertyLookupService.getProperties(r,m).subscribe(p=>{this.propertyLookups=p.data.propertyLookups,this.postCodeDistrictMatch=p.data.postCodeDistrictMatch,this.lookupLoading=!1},p=>{console.error(p),this.lookupLoading=!1})}}addressUpdate(i){this.propertyLookupSearch&&(this.postcode=i.postCode,this.addressSelected=!0)}focusOnError(i){i.focus()}newRegistration(){this.submitted=!0;let i=document.querySelector(".ng-invalid[formControlName]");
1if(this.form.invalid||!this.addressSelected)this.form.invalid&&this.focusOnError(i);else{this.spinnerService.setSpinnerDescription("Adding notification..."),this.spinner.show();let r=Xt(this.form.get("mobileNumber").value);this.registrationsService.newAquAlerterRegistration(r,this.postcode,this.form.get("interruptions").value,this.form.get("events").value,this.form.get("plannedWorks").value,this.form.get("leaks").value).pipe(be(m=>this.handleError(m))).subscribe(m=>this.handleSuccess(m))}}onCancel(){this.location.back(),this.pageScrollService.scroll({document:this.document,scrollTarget:"#topnav",duration:100})}openModal(i){this.modalRef=this.modalService.show(i,Object.assign({},this.config)),this.subscriptions.push(this.modalService.onHide.subscribe(r=>{r==="backdrop-click"&&this.success&&this.onCancel()}))}closeModal(){if(this.modalRef)this.success?this.onCancel():this.submitted=!1;else return;this.modalRef.hide(),this.modalRef=null}handleError(i){return this.spinner.hide(),this.success=!1,this.showModal(bi.title,bi.body,"danger-modal"),ze(i)}handleSuccess(i){this.spinner.hide(),this.returnMessage=i.data.returnMessage,this.success=this.returnMessage==="GREEN"||this.returnMessage==="AMBER";let r=this.success?"success-modal":"warning-modal",m=this.success?ic:bi;this.showModal(m.title,m.body,r)}showModal(i,r,m){this.config.class=m,this.modalTitle=i,this.modalBody=r,this.openModal(this.templateRef)}};l.\u0275fac=function(r){return new(r||l)(f(G),f(Y),f(Q),f(J),f(ee),f(St),f(K),f(zt),f(Ze),f(xt),f(_e),f(W))},l.\u0275cmp=O({type:l,selectors:[["app-aqualerter-add"]],viewQuery:function(r,m){if(r&1&&A(Ul,5),r&2){let p;N(p=M())&&(m.templateRef=p.first)}},decls:36,vars:20,consts:[["template",""],[1,"bg-primary-light"],[1,"container","py-8"],[1,"form-wrap"],[3,"submit","formGroup"],[1,"form-group"],["for","mobileNumber",1,"label","mb-0","required"],[1,"form-row"],[1,"col-12","col-md-6"],["type","text","formControlName","mobileNumber","name","mobileNumber","id","mobileNumber","type","tel","autocomplete","tel","aria-describedby","phoneNumberError","inputmode","numeric",1,"form-control","font-weight-bold",3,"keydown.enter","ngClass"],["errorMsg","Please make sure that you have entered a valid mobile number","id","phoneNumberError",3,"displayErrorIf"],[1,"form-group","mb-3"],["for","postcode",1,"label","required"],[1,"col-md-4"],["formControlName","postcode","name","postcode","id","postcode","type","text","autocomplete","postal-code","aria-describedby","postcodeError",1,"form-control","font-weight-bold","text-uppercase","mb-3",3,"keydown.enter","change","ngClass"],[1,"col-auto"],["type","button",1,"btn","btn-secondary","mb-3","font-weight-bold",3,"click","disabled"],[3,"icon",4,"ngIf"],["class","fas fa-spinner-third fa-spin",4,"ngIf"],["id","postcodeMatchError",3,"displayErrorIf","errorMsg"],[4,"ngIf"],["errorMsg","Please enter a valid postcode","id","postcodeError",3,"displayErrorIf"],["errorMsg","Please search for an address","id","postcodeError",3,"displayErrorIf"],["errorMsg","Please choose an address from the list","id","postcodeError",3,"displayErrorIf"],[3,"icon"],[1,"fas","fa-spinner-third","fa-spin"],[1,"select-wrap"],["formControlName","propertySearchResult",1,"custom-select","font-weight-bold","mb-3",3,"ngModelChange"],["class","font-weight-bold","disabled","",3,"ngValue",4,"ngIf"],["class","font-weight-bold",3,"ngValue",4,"ngFor","ngForOf"],["disabled","",1,"font-weight-bold",3,"ngValue"],[1,"font-weight-bold",3,"ngValue"],[1,"callout","bg-warning","callout-warning","text-black","font-weight-bold"],["href","https://www.water.org.uk/advice-for-customers/find-your-supplier/",1,"text-dark"],["href","tel:0333 000 0001",1,"text-dark"],[1,"list-group"],[1,"list-group-item","list-group-item-action"],[1,"d-flex","w-100","justify-content-between"],[1,"mb-1"],[1,"custom-control","custom-switch"],["formControlName","interruptions","type","checkbox","id","interruptions",1,"custom-control-input"],["for","interruptions",1,"custom-control-label"],["formControlName","leaks","type","checkbox","id","leaks",1,"custom-control-input"],["for","leaks",1,"custom-control-label"],["formControlName","events","type","checkbox","id","events",1,"custom-control-input"],["for","events",1,"custom-control-label"],[1,"clearfix"],[1,"btn-group","float-right","pt-5"],["type","submit",1,"btn","btn-primary","font-weight-bold"],[1,"icon-circle"],[3,"ngClass"],[1,"modal-header","justify-content-center"],[1,"modal-title",3,"innerHTML"],[1,"modal-body"],[1,"text-center",3,"innerHTML"],[1,"modal-footer","justify-content-center"],["type","button",1,"btn","btn-dark",3,"click"]],template:function(r,m){if(r&1){let p=b();n(0,"div",1)(1,"div",2)(2,"div",3)(3,"h2"),c(4,"Get notifications for another address"),o(),n(5,"p"),
1c(6," You\u2019ll be kept up to date on the latest information in your area by SMS. "),o(),n(7,"form",4),v("submit",function(){return h(p),g(m.newRegistration())}),n(8,"div",5)(9,"label",6),c(10,"Mobile number"),o(),n(11,"div",7)(12,"div",8)(13,"input",9),v("keydown.enter",function(C){return h(p),g(C.preventDefault())}),o()()(),u(14,"app-input-error-message",10),o(),n(15,"div",11)(16,"label",12),c(17,"Enter postcode"),o(),n(18,"div",7)(19,"div",13)(20,"input",14),v("keydown.enter",function(C){return h(p),g(C.preventDefault())})("change",function(C){return h(p),g(m.form.patchValue({postcode:C.target.value.toUpperCase()}))}),o()(),n(21,"div",15)(22,"button",16),v("click",function(){return h(p),g(m.propertyLookup())}),c(23," Find address "),_(24,Wl,1,1,"fa-icon",17)(25,Gl,1,0,"i",18),o()()(),u(26,"app-input-error-message",19),_(27,Jl,8,5,"div",20)(28,Zl,11,0,"div",20)(29,Kl,11,0,"div",20),u(30,"app-input-error-message",21)(31,"app-input-error-message",22)(32,"app-input-error-message",23),o(),_(33,ec,35,3,"div",20),o()()()(),_(34,tc,10,3,"ng-template",null,0,q)}r&2&&(s(7),a("formGroup",m.form),s(6),a("ngClass",B(16,xr,m.submitted&&m.form.get("mobileNumber").errors)),s(),a("displayErrorIf",m.submitted&&m.form.get("mobileNumber").errors),s(6),a("ngClass",B(18,xr,m.submitted&&m.form.get("postcode").errors)),s(2),a("disabled",m.form.get("postcode").errors||m.lookupLoading),s(2),a("ngIf",!m.lookupLoading),s(),a("ngIf",m.lookupLoading),s(),a("displayErrorIf",m.postcodeMatch)("errorMsg",m.postcodeMatchError),s(),a("ngIf",m.propertyLookupSearch&&m.postCodeDistrictMatch!=="no"),s(),a("ngIf",m.postCodeDistrictMatch==="no"),s(),a("ngIf",m.postCodeDistrictMatch==="yes"&&(m.propertyReference==null?null:m.propertyReference.startsWith("GB"))),s(),a("displayErrorIf",m.submitted&&m.form.get("postcode").errors),s(),a("displayErrorIf",m.submitted&&!m.form.get("postcode").errors&&m.showNoLookupTriedError),s(),a("displayErrorIf",m.submitted&&!m.form.get("postcode").errors&&!m.showNoLookupTriedError&&!m.addressSelected&&m.postCodeDistrictMatch==="yes"),s(),a("ngIf",m.postCodeDistrictMatch!=="no"))},dependencies:[H,ge,j,ce,$,yt,bt,se,je,_t,ie,z,X,re,Ie]});let t=l;return t})();var rc=["template"],nc=t=>({"is-invalid":t});function oc(t,l){t&1&&(n(0,"p"),c(1,"Loading..."),o())}function ac(t,l){t&1&&(n(0,"p"),c(1," Sorry we couldn't find that notification "),o())}function sc(t,l){if(t&1&&(n(0,"p"),c(1," Updating notification for "),n(2,"span",6),c(3),o()()),t&2){let e=d();s(3),U(e.registration.postcode)}}function lc(t,l){if(t&1){let e=b();n(0,"form",7),v("submit",function(){h(e);let r=d();return g(r.updateRegistration())}),n(1,"div",8)(2,"label",9),c(3,"Mobile number"),o(),n(4,"div",10)(5,"div",11)(6,"input",12),v("keydown.enter",function(r){return h(e),g(r.preventDefault())}),o()()(),u(7,"app-input-error-message",13),o(),n(8,"h4"),c(9,"Communication preferences"),o(),n(10,"div",14)(11,"div",15)(12,"div",16)(13,"h5",17),c(14,"No water interruptions"),o(),n(15,"div",8)(16,"div",18),u(17,"input",19),n(18,"label",20),c(19),o()()()()(),n(20,"div",15)(21,"div",16)(22,"h5",17),c(23,"Leaks"),o(),n(24,"div",8)(25,"div",18),u(26,"input",21),n(27,"label",22),c(28),o()()()()(),n(29,"div",15)(30,"div",16)(31,"h5",17),c(32,"Community events"),o(),n(33,"div",8)(34,"div",18),u(35,"input",23),n(36,"label",24),c(37),o()()()()()(),n(38,"div",25)(39,"div",26)(40,"button",27),c(41," Update "),o()()()()}if(t&2){let e=d();a("formGroup",e.form),s(6),a("ngClass",B(6,nc,e.submitted&&e.form.get("mobileNumber").errors)),s(),a("displayErrorIf",e.submitted&&e.form.get("mobileNumber").errors),s(12),U(e.form.get("interruptions").value?"On":"Off"),s(9),U(e.form.get("leaks").value?"On":"Off"),s(9),U(e.form.get("events").value?"On":"Off")}}function cc(t,l){if(t&1){let e=b();n(0,"div",28)(1,"div"),u(2,"i",29),o()(),n(3,"div",30),u(4,"h4",31),o(),n(5,"div",32),u(6,"p",33),o(),n(7,"div",34)(8,"button",35),v("click",function(){h(e);let r=d();return g(r.closeModal())}),c(9," Close "),o()()}if(t&2){let e=d();s(2),a("ngClass",e.success?"bg-secondary fal fa-check":"bg-danger shadow fal fa-times"),s(2),a("innerHTML",e.modalTitle,F),s(2),a("innerHTML",e.modalBody,F)}}var mc={title:"All complete",body:"That's all updated for you."},Ci={title:"Sorry we've hit a problem",body:"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back"},kr=(()=>{let l=class l{constructor(i,r,m,p,y,C,w,I,S){this.fb=i,this.route=r,this.registrationsService=m,this.location=p,this.pageScrollService=y,this.spinner=C,this.spinnerService=w,this.modalService=I,this.document=S,this.currentRegistrations=[],this.loadingForm=!0,this.submitted=!1,this.subscriptions=[],this.config={animated:!0,keyboard:!0,backdrop:!0,ignoreBackdropClick:!1,class:""},this.form=this.fb.group({postcode:null,easting:null,northing:null,interruptions:null,events:null,leaks:null,plannedWorks:null,mobileNumber:["",[E.required,E.pattern("^(?:(?:\\+44\\s?(?:\\(0\\)\\s?)?|0)7\\d{3}\\s?\\d{3}\\s?\\d{3}|\\(07\\d{3}\\)\\s?\\d{6})$")]]})}ngOnInit(){this.route.params.subscribe(i=>{this.regId=i.regId,this.registrationsService.getAquaAlerterRegistrations().subscribe(r=>{this.currentRegistrations=r.data.aquaRegistrations.filter(m=>m.regId===+this.regId),this.currentRegistrations.length>0&&(this.registration=this.currentRegistrations[0],this.form.patchValue({postcode:this.registration.postcode,easting:this.registration.easting,northing:this.registration.northing,mobileNumber:this.registration.mobileNumber,interruptions:this.registration.interruptions,leaks:this.registration.leaks,events:this.registration.events,plannedWorks:this.registration.plannedWorks})),this.loadingForm=!1})})}focusOnError(i){i.focus()}updateRegistration(){this.submitted=!0;let i=document.querySelector(".ng-invalid[formControlName]");
1if(this.form.invalid)this.focusOnError(i);else{this.spinnerService.setSpinnerDescription("Updating..."),this.spinner.show();let r=Xt(this.form.get("mobileNumber").value);this.registrationsService.updateAquAlerterRegistration(r,this.form.get("postcode").value,this.form.get("easting").value,this.form.get("northing").value,this.form.get("interruptions").value,this.form.get("events").value,this.form.get("plannedWorks").value,this.form.get("leaks").value,this.registration.regId).pipe(be(m=>this.handleError(m))).subscribe(m=>this.handleSuccess(m))}}onCancel(){this.location.back(),this.pageScrollService.scroll({document:this.document,scrollTarget:"#topnav",duration:100})}openModal(i){this.modalRef=this.modalService.show(i,Object.assign({},this.config)),this.subscriptions.push(this.modalService.onHide.subscribe(r=>{r==="backdrop-click"&&this.success&&this.onCancel()}))}closeModal(){if(this.modalRef)this.success?this.onCancel():this.submitted=!1;else return;this.modalRef.hide(),this.modalRef=null}handleError(i){return this.spinner.hide(),this.success=!1,this.showModal(Ci.title,Ci.body,"danger-modal"),ze(i)}handleSuccess(i){this.spinner.hide(),this.returnMessage=i.data.returnMessage,this.success=this.returnMessage==="GREEN"||this.returnMessage==="AMBER";let r=this.success?"success-modal":"warning-modal",m=this.success?mc:Ci;this.showModal(m.title,m.body,r)}showModal(i,r,m){this.config.class=m,this.modalTitle=i,this.modalBody=r,this.openModal(this.templateRef)}};l.\u0275fac=function(r){return new(r||l)(f(St),f(K),f(xt),f(ee),f(Q),f(G),f(Y),f(J),f(W))},l.\u0275cmp=O({type:l,selectors:[["app-aqualerter-edit"]],viewQuery:function(r,m){if(r&1&&A(rc,5),r&2){let p;N(p=M())&&(m.templateRef=p.first)}},decls:11,vars:4,consts:[["template",""],[1,"bg-primary-light"],[1,"container","py-8"],[1,"form-wrap"],[4,"ngIf"],[3,"formGroup","submit",4,"ngIf"],[1,"font-weight-bold"],[3,"submit","formGroup"],[1,"form-group"],["for","mobileNumber",1,"label","mb-0","required"],[1,"form-row"],[1,"col-12","col-md-6"],["type","text","formControlName","mobileNumber","name","mobileNumber","id","mobileNumber","type","tel","autocomplete","tel","aria-describedby","phoneNumberError","inputmode","numeric",1,"form-control","font-weight-bold",3,"keydown.enter","ngClass"],["errorMsg","Please make sure that you have entered a valid mobile number","id","phoneNumberError",3,"displayErrorIf"],[1,"list-group"],[1,"list-group-item","list-group-item-action"],[1,"d-flex","w-100","justify-content-between"],[1,"mb-1"],[1,"custom-control","custom-switch"],["formControlName","interruptions","type","checkbox","id","interruptions",1,"custom-control-input"],["for","interruptions",1,"custom-control-label"],["formControlName","leaks","type","checkbox","id","leaks",1,"custom-control-input"],["for","leaks",1,"custom-control-label"],["formControlName","events","type","checkbox","id","events",1,"custom-control-input"],["for","events",1,"custom-control-label"],[1,"clearfix"],[1,"btn-group","float-right","pt-5"],["type","submit",1,"btn","btn-primary","font-weight-bold"],[1,"icon-circle"],[3,"ngClass"],[1,"modal-header","justify-content-center"],[1,"modal-title",3,"innerHTML"],[1,"modal-body"],[1,"text-center",3,"innerHTML"],[1,"modal-footer","justify-content-center"],["type","button",1,"btn","btn-dark",3,"click"]],template:function(r,m){r&1&&(n(0,"div",1)(1,"div",2)(2,"div",3)(3,"h2"),c(4,"Update notification"),o(),_(5,oc,2,0,"p",4)(6,ac,2,0,"p",4)(7,sc,4,1,"p",4)(8,lc,42,8,"form",5),o()()(),_(9,cc,10,3,"ng-template",null,0,q)),r&2&&(s(5),a("ngIf",m.loadingForm),s(),a("ngIf",!m.loadingForm&&m.currentRegistrations.length<=0),s(),a("ngIf",!m.loadingForm&&m.currentRegistrations.length>0&&m.registration.postcode),s(),a("ngIf",!m.loadingForm&&m.currentRegistrations.length>0))},dependencies:[H,j,ce,$,se,je,ie,z,X,re]});let t=l;return t})();var dc=()=>$e(t=>t?!0:["auth/login"]),pc=[{path:"",component:vr,data:{authGuardPipe:dc},canActivate:[he],resolve:{settings:fe},children:[{path:":id/contact-details",component:pr,canActivate:[he],resolve:{settings:fe}},{path:":id/name-change",component:dr,canActivate:[he],resolve:{settings:fe}}
1,{path:":id/add-person",component:nr,canActivate:[he],resolve:{settings:fe}},{path:":id/remove-person",component:rr,canActivate:[he],resolve:{settings:fe}},{path:"billing-address",component:fr,canActivate:[he],resolve:{settings:fe}},{path:"psr",component:mr,canActivate:[he],resolve:{settings:fe}},{path:"psr-revalidate",component:_r,canActivate:[he],resolve:{settings:fe}},{path:"socialtariffs",component:lr,canActivate:[he],resolve:{settings:fe}},{path:"add-account",component:zi,canActivate:[he],resolve:{settings:fe}},{path:"display-name",component:ar,canActivate:[he],resolve:{settings:fe}},{path:"notifications",component:Cr,canActivate:[he],resolve:{settings:fe}},{path:"data",component:Er,canActivate:[he],resolve:{settings:fe}},{path:"business-account",component:Sr,canActivate:[he],resolve:{settings:fe}},{path:"aqualerter-add",component:wr,canActivate:[he],resolve:{settings:fe}},{path:"aqualerter-edit/:regId",component:kr,canActivate:[he],resolve:{settings:fe}}]}],Tr=(()=>{let l=class l{};l.\u0275fac=function(r){return new(r||l)},l.\u0275mod=Pt({type:l}),l.\u0275inj=Vt({providers:[fe],imports:[mi.forChild(pc),mi]});let t=l;return t})();var Rp=(()=>{let l=class l{};l.\u0275fac=function(r){return new(r||l)},l.\u0275mod=Pt({type:l}),l.\u0275inj=Vt({imports:[Tr,Yi,Ji.forRoot()]});let t=l;return t})();export{Rp as PreferencesModule};

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.