1"use strict";(self.webpackChunkhubfe=self.webpackChunkhubfe||[]).push([[938],{1613:(F,D,s)=>{s.d(D,{O:()=>S});var g=s(73664);let S=(()=>{class b{transform(k,h){try{return k?k.length>=h?k.substr(0,h)+"...":k:void 0}catch(d){return console.log(d),k}}static \u0275fac=function(h){return new(h||b)};static \u0275pipe=g.EJ8({name:"trimLength",type:b,pure:!0,standalone:!1})}return b})()},6993:(F,D,s)=>{s.d(D,{X:()=>b});var g=s(95018),S=s(2615);let b=(()=>{class f{constructor(){}selectedCompany=new g.C;accountCancelButtonClicked=!1;accountDetails=new Array;filterStatuses;filter=null;selectedTab;datasource;accountSearchText;accountTableBatchList;accountTableBatchMap;selectedBatchId;childParentDetailsMap;childParentDetailsProcessedFlags;showParentChildDetailsForChild=!1;isDataLoading;dataSourcePending;dataSourceRejected;dataSourceFailed;dataSourceEnrolled;toDeactivate;allDeactivate;allDelete;releaseRFID;recallBEAPI;approvalCancelButtonClicked=!1;datasourseApproval;searchTextModel;filterStatusesApproval;approvalSearchText=null;activitySearchText;batchSearchText;exportText=null;generateIdCardState;announcementCancelButtonClicked=!1;dataSourceAnnouncement;announcementFilterText;announcementSearchText;memPlanCancelButtonClicked=!1;sharedMembershipPlans;dataSourceMembershipPlan;membershipPlanSearchText;membershipFilter;sharedActivities;dataSourceActivity;levelCancelButtonClicked=!1;dataSourceLevel;levelSerachText;selectedAcitivity;activitiesInLevel;activityhCancelButtonClicked=!1;allActivities;isRolesUpdated=!1;isRFIDAssigned=!1;isRFIDReleased=!1;isAccountDetailsUpdated=!1;taxCancelButtonClicked=!1;dataSourceTax;taxSearchText;pendingFeesSearchText;bookingSerchText;pendingFeesSearchTextFeewise;homeToMembersFilter;homeToCoachesFilter;homeToReportsFilter;homeToMebershipPlanFilter;homeToFeesDashboardFilter;batchBackButtonPressed=!1;static \u0275fac=function(d){return new(d||f)};static \u0275prov=S.jDH({token:f,factory:f.\u0275fac,providedIn:"root"})}return f})()},12230:(F,D,s)=>{s.d(D,{P:()=>d});var g=s(31635),S=s(16627),b=s(2615),f=s(29330),k=s(92616),h=s(2490);let d=class R{httpService;sharedService;cookieService;constructor(c,m,u){this.httpService=c,this.sharedService=m,this.cookieService=u}getAll(c){return this.httpService.get(c.hubRequestURL+"membershipplan/getall")}create(c,m){return this.httpService.post(c.hubRequestURL+"membershipplan/create",m)}getById(c,m){return this.httpService.get(c.hubRequestURL+"membershipplan/"+m)}update(c,m){return this.httpService.post(c.hubRequestURL+"membershipplan/update/"+m.id,m)}deactivate(c,m){return this.httpService.post(c.hubRequestURL+"membershipplan/deactivate/"+m,{})}activate(c,m){return this.httpService.post(c.hubRequestURL+"membershipplan/activate/"+m,{})}getByPlannameAndVersion(c,m,u){return this.httpService.post(c.hubRequestURL+"membershipplan/fetchbynameversion",{membershipPlanName:m,membershipPlanVersion:u})}static \u0275fac=function(m){return new(m||R)(b.KVO(f.Qq),b.KVO(k.d),b.KVO(h.O))};static \u0275prov=b.jDH({token:R,factory:R.\u0275fac,providedIn:"root"})};d=(0,g.Cg)([S.P],d)},40472:(F,D,s)=>{s.d(D,{u:()=>b});var g=s(2615),S=s(76192);let b=(()=>{class f{dataSource;constructor(h){this.dataSource=h}columnsForDisplay=[];overrrideFilterPredicate(h){this.columnsForDisplay=h,this.dataSource.filterPredicate=(d,v)=>{const m=Object.keys(d).reduce((A,_)=>this.nestedFilterCheck(A,d,_),"").toLowerCase(),u=v.trim().toLowerCase();return-1!==m.indexOf(u)}}nestedFilterCheck(h,d,v){if("object"==typeof d[v])for(const c in d[v])null!==d[v][c]&&(h=this.nestedFilterCheck(h,d[v],c));else this.columnsForDisplay?this.columnsForDisplay.includes(v)&&(h+=d[v]):h+=d[v];return h}static \u0275fac=function(d){return new(d||f)(g.KVO(S.I6))};static \u0275prov=g.jDH({token:f,factory:f.\u0275fac,providedIn:"root"})}return f})()},49938:(F,D,s)=>{s.r(D),s.d(D,{ApprovalTableModule:()=>Ct});var g=s(72200),S=s(38132),b=s(31635),f=s(95018),k=s(40472),h=s(18359),d=s(71985),v=s(96697),c=s(16627),m=s(83869),u=s(96695),A=s(2042),_=s(76192),e=s(73664),I=s(51585),o=s(2615),z=s(29330);let H=(()=>{class n{httpService;constructor(t){this.httpService=t}uploadfile(t,i,l){let r=new FormData;return r.append("file",i),r.append("sendEnrollmentNotification",l),this.httpService.post(t.hubRequestURL+"excel/enrollmembersfromexcel",r,{})}static \u0275fac=function(i){return new(i||n)(o.KVO(z.Qq))};static \u0275prov=o.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var G=s(23052),W=s(95416),y=s(88834),O=s(22598),$=s(82765),j=s(12629),C=s(89417);let K=(()=>{class n{dialogRef;fileUploadService;localStorage;snackBar;file=null;fileToUpload=null;selectedCompany=new f.C;isupload=!0;sendEnrollmentNotification=!1;constructor(t,i,l,r){this.dialogRef=t,this.fileUploadService=i,this.localStorage=l,this.snackBar=r}ngOnInit(){this.localStorage.get("selectedCompany").subscribe(t=>{this.selectedCompany=t})}onFilechange(t){this.isupload=!(this.file=t.target.files[0])}showSucessMessage(t){this.snackBar.open(t,"Close",{duration:5e3,panelClass:["green-snackbar"]})}showErrorMessage(t){this.snackBar.open(t,"Close",{duration:5e3,panelClass:["red-snackbar"]})}close(){this.dialogRef.close()}onupload(){this.file&&this.fileUploadService.uploadfile(this.selectedCompany,this.file,this.sendEnrollmentNotification).subscribe(()=>{this.showSucessMessage("Excel Upload successful.Members will get enrolled in a while,please wait for few seconds"),this.dialogRef.close(),this.dialogRef.afterClosed().subscribe(t=>{})})}static \u0275fac=function(i){return new(i||n)(e.rXU(I.CP),e.rXU(H),e.rXU(G.A
1X),e.rXU(W.UG))};static \u0275cmp=e.VBU({type:n,selectors:[["app-excel-upload-dialog"]],standalone:!1,decls:11,vars:2,consts:[[1,"upload-container","mat-elevation-z2"],[1,"toolbar",2,"text-align","right"],["mat-icon-button","","aria-label","Close",3,"click"],[1,"content",2,"display","flex","flex-direction","column","align-items","flex-start","padding","16px"],["type","file","multiple","",2,"margin-bottom","12px",3,"change"],["color","primary","name","sendEnrollmentNotification",2,"margin-bottom","12px",3,"ngModelChange","ngModel"],["mat-raised-button","","color","primary",3,"click","disabled"]],template:function(i,l){1&i&&(e.j41(0,"div",0)(1,"div",1)(2,"button",2),e.bIt("click",function(){return l.close()}),e.j41(3,"mat-icon"),e.EFF(4,"close"),e.k0s()()(),e.j41(5,"div",3)(6,"input",4),e.bIt("change",function(p){return l.onFilechange(p)}),e.k0s(),e.j41(7,"mat-checkbox",5),e.mxI("ngModelChange",function(p){return e.DH7(l.sendEnrollmentNotification,p)||(l.sendEnrollmentNotification=p),p}),e.EFF(8," Send Announcement "),e.k0s(),e.j41(9,"button",6),e.bIt("click",function(){return l.onupload()}),e.EFF(10," Upload "),e.k0s()()()),2&i&&(e.R7$(7),e.R50("ngModel",l.sendEnrollmentNotification),e.R7$(2),e.Y8G("disabled",l.isupload))},dependencies:[y.$z,O.iY,$.So,j.An,C.BC,C.vS],styles:[".upload-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-end;padding:16px}.upload-content[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{margin-bottom:12px}.upload-content[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]:last-child{margin-bottom:0}"]})}return n})();var E=s(63129),V=s(92615),Q=s(12230),Z=s(39347),q=s(1949),X=s(83921),Y=s(92616),M=s(64727),U=s(40100),ee=s(96183),te=s(60407),L=s(40455),P=s(25084);function ae(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",38)(1,"button",39),e.bIt("click",function(){const l=o.eBV(t).$implicit,r=e.XpG(2);return o.Njj(r.onChipClick(l))}),e.j41(2,"span",40),e.EFF(3),e.k0s(),e.j41(4,"span",41),e.EFF(5),e.k0s()(),e.j41(6,"button",42),e.bIt("click",function(l){const r=o.eBV(t).$implicit,p=e.XpG(2);return o.Njj(p.removeMember(r,l))}),e.j41(7,"mat-icon"),e.EFF(8,"close"),e.k0s()()()}if(2&n){const t=a.$implicit,i=e.XpG(2);e.AVh("member-chip--active",i.activeChipId===t.id),e.R7$(3),e.JRh(i.getChipInitial(t)),e.R7$(2),e.JRh(t.applicationId||t.id)}}function ie(n,a){if(1&n&&(e.j41(0,"div",35)(1,"div",36),e.DNE(2,ae,9,4,"div",37),e.k0s()()),2&n){const t=e.XpG();e.R7$(2),e.Y8G("ngForOf",t.selectedItems)}}function ne(n,a){1&n&&(e.j41(0,"div",50),e.EFF(1,"Loading member details..."),e.k0s())}function le(n,a){if(1&n&&(e.j41(0,"div",51),e.EFF(1),e.k0s()),2&n){const t=e.XpG(2);e.R7$(),e.JRh(t.memberDetailsError)}}function oe(n,a){if(1&n&&e.nrm(0,"img",61),2&n){const t=e.XpG().ngIf;e.Y8G("src",t.member.photo,e.B4B)}}function re(n,a){1&n&&e.nrm(0,"img",62)}function se(n,a){if(1&n&&(e.j41(0,"tr")(1,"th"),e.EFF(2,"Birthdate"),e.k0s(),e.j41(3,"td"),e.EFF(4),e.nI1(5,"date"),e.k0s()()),2&n){const t=e.XpG().ngIf;e.R7$(4),e.SpI(": ",e.i5U(5,1,t.member.dob,"dd-MMM-yyyy"))}}function pe(n,a){if(1&n&&(e.j41(0,"tr")(1,"th"),e.EFF(2,"Gender"),e.k0s(),e.j41(3,"td"),e.EFF(4),e.k0s()()),2&n){const t=e.XpG().ngIf;e.R7$(4),e.SpI(": ",t.member.gender)}}function ce(n,a){if(1&n&&(e.j41(0,"tr")(1,"th"),e.EFF(2,"Age"),e.k0s(),e.j41(3,"td"),e.EFF(4),e.k0s()()),2&n){const t=e.XpG().ngIf;e.R7$(4),e.SpI(": ",t.member.age)}}function de(n,a){if(1&n&&(e.j41(0,"tr")(1,"th"),e.EFF(2,"Phone"),e.k0s(),e.j41(3,"td"),e.EFF(4),e.k0s()()),2&n){const t=e.XpG().ngIf;e.R7$(4),e.Lme(": ",t.member.countryCode," ",t.member.phone)}}function me(n,a){if(1&n&&(e.j41(0,"tr")(1,"th"),e.EFF(2,"Email"),e.k0s(),e.j41(3,"td"),e.EFF(4),e.k0s()()),2&n){const t=e.XpG().ngIf;e.R7$(4),e.SpI(": ",t.member.email)}}function he(n,a){if(1&n){const t=e.RV6();e.j41(0,"a",64),e.bIt("click",function(){o.eBV(t);const l=e.XpG(5);return o.Njj(l.showFullAddress=!0)}),e.EFF(1,"see more"),e.k0s()}}function ue(n,a){if(1&n&&(e.j41(0,"span"),e.EFF(1),e.nI1(2,"slice"),e.DNE(3,he,2,0,"a",63),e.k0s()),2&n){const t=e.XpG(4);e.R7$(),e.Lme(" ",e.brH(2,3,t.getAddressText(),0,60),"",t.getAddressText().length>60?"...":""," "),e.R7$(2),e.Y8G("ngIf",t.getAddressText().length>60)}}function _e(n,a){if(1&n){const t=e.RV6();e.j41(0,"span"),e.EFF(1),e.j41(2,"a",64),e.bIt("click",function(){o.eBV(t);const l=e.XpG(4);return o.Njj(l.showFullAddress=!1)}),e.EFF(3,"see less"),e.k0s()()}if(2&n){const t=e.XpG(4);e.R7$(),e.SpI(" ",t.getAddressText()," ")}}function ge(n,a){if(1&n&&(e.j41(0,"tr")(1,"th"),e.EFF(2,"Address"),e.k0s(),e.j41(3,"td"),e.EFF(4," : "),e.DNE(
15,ue,4,7,"span",60)(6,_e,4,1,"span",60),e.k0s()()),2&n){const t=e.XpG(3);e.R7$(5),e.Y8G("ngIf",!t.showFullAddress),e.R7$(),e.Y8G("ngIf",t.showFullAddress)}}function be(n,a){if(1&n&&(e.j41(0,"div",52)(1,"div",53),e.DNE(2,oe,1,1,"img",54)(3,re,1,0,"img",55),e.j41(4,"div")(5,"div",56),e.EFF(6),e.k0s(),e.j41(7,"div",57),e.EFF(8),e.k0s(),e.j41(9,"div",58),e.EFF(10),e.k0s()()(),e.j41(11,"table",59),e.DNE(12,se,6,4,"tr",60)(13,pe,5,1,"tr",60)(14,ce,5,1,"tr",60)(15,de,5,2,"tr",60)(16,me,5,1,"tr",60)(17,ge,7,2,"tr",60),e.k0s()()),2&n){const t=a.ngIf,i=e.XpG(2);e.R7$(2),e.Y8G("ngIf",null==t.member?null:t.member.photo),e.R7$(),e.Y8G("ngIf",!(null!=t.member&&t.member.photo)),e.R7$(3),e.JRh(i.getMemberFullName()),e.R7$(2),e.SpI("Application ID : ",t.applicationId||i.activeChipId),e.R7$(2),e.SpI("Status : ",t.status),e.R7$(2),e.Y8G("ngIf",null==t.member?null:t.member.dob),e.R7$(),e.Y8G("ngIf",null==t.member?null:t.member.gender),e.R7$(),e.Y8G("ngIf",null==t.member?null:t.member.age),e.R7$(),e.Y8G("ngIf",null==t.member?null:t.member.phone),e.R7$(),e.Y8G("ngIf",null==t.member?null:t.member.email),e.R7$(),e.Y8G("ngIf",i.getAddressText())}}function fe(n,a){if(1&n){const t=e.RV6();e.j41(0,"div",43)(1,"div",44)(2,"span",45),e.EFF(3,"Member Details"),e.k0s(),e.j41(4,"button",46),e.bIt("click",function(){o.eBV(t);const l=e.XpG();return o.Njj(l.clearMemberDetails())}),e.j41(5,"mat-icon"),e.EFF(6,"close"),e.k0s()()(),e.DNE(7,ne,2,0,"div",47)(8,le,2,1,"div",48)(9,be,18,11,"div",49),e.k0s()}if(2&n){const t=e.XpG();e.R7$(7),e.Y8G("ngIf",t.memberDetailsLoading),e.R7$(),e.Y8G("ngIf",!t.memberDetailsLoading&&t.memberDetailsError),e.R7$(),e.Y8G("ngIf",!t.memberDetailsLoading&&t.memberDetailsRequest)}}function ve(n,a){if(1&n){const t=e.RV6();e.j41(0,"mat-option",19),e.bIt("click",function(){o.eBV(t);const l=e.XpG().$implicit,r=e.XpG();return o.Njj(r.approvalModel.membershipPlanVersion=l.version)}),e.EFF(1),e.j41(2,"span",66),e.EFF(3),e.k0s()()}if(2&n){const t=e.XpG().$implicit;e.Y8G("value",t.planName),e.R7$(),e.SpI(" ",t.planName," "),e.R7$(2),e.SpI("(V",t.version,")")}}function Ce(n,a){if(1&n&&(e.qex(0),e.DNE(1,ve,4,3,"mat-option",65),e.bVm()),2&n){const t=a.$implicit;e.R7$(),e.Y8G("ngIf","active"===t.status)}}function ke(n,a){if(1&n){const t=e.RV6();e.j41(0,"mat-form-field",22)(1,"mat-label"),e.EFF(2,"Membership Expiry Date"),e.k0s(),e.j41(3,"input",67),e.bIt("click",function(){o.eBV(t);const l=e.sdS(6);return o.Njj(l.open())}),e.mxI("ngModelChange",function(l){o.eBV(t);const r=e.XpG();return e.DH7(r.approvalModel.membershipEndDate,l)||(r.approvalModel.membershipEndDate=l),o.Njj(l)}),e.k0s(),e.nrm(4,"mat-datepicker-toggle",17)(5,"mat-datepicker",24,4),e.k0s()}if(2&n){const t=e.sdS(6),i=e.XpG();e.R7$(3),e.Y8G("matDatepicker",t)("readonly",!0)("min",i.approvalModel.membershipStartDate),e.R50("ngModel",i.approvalModel.membershipEndDate),e.Y8G("disabled",!i.isValid(i.approvalModel.membershipPlanName)),e.R7$(),e.Y8G("for",t),e.R7$(),e.Y8G("disabled",!i.isValid(i.approvalModel.membershipPlanName))}}function De(n,a){if(1&n&&(e.j41(0,"mat-option",68),e.EFF(1),e.k0s()),2&n){const t=a.$implicit;e.Y8G("value",t.id)("disabled","active"!==t.status),e.R7$(),e.SpI(" ",t.name," ")}}function Se(n,a){if(1&n&&(e.j41(0,"mat-option",27),e.EFF(1),e.k0s()),2&n){const t=e.XpG().$implicit;e.Y8G("value",t.id),e.R7$(),e.SpI(" ",t.name," ")}}function xe(n,a){if(1&n&&(e.qex(0),e.DNE(1,Se,2,2,"mat-option",69),e.bVm()),2&n){const t=a.$implicit,i=e.XpG();e.R7$(),e.Y8G("ngIf","active"===t.status&&!i.getBatchExpired(t.endDate))}}function Ae(n,a){1&n&&(e.j41(0,"p",70),e.EFF(1," Please complete Activity, Batch, and Joining Date together, or leave all empty. "),e.k0s())}let T=class N{dialogRef;data;membershipPlanService;activityService;batchService;approvalService;sharedService;ngOnDestroy(){}approvalModel=new E.F;membershipPlans=[];activities=[];batches=[];endDateDisableFlag=!1;startDateDisableFlag=!1;isSubmitting=!1;selectedActivityId;selectedBatchId;selectedJoiningDate=null;minimumJoiningDate=null;maximumJoiningDate=null;activeChipId=null;memberDetailsLoading=!1;memberDetailsError=null;memberDetailsRequest=null;showFullAddress=!1;selectedIds=[];selectedItems=[];selectedCompany$;subscription=new h.yU;constructor(a,t,i,l,r,p,x){this.dialogRef=a,this.data=t,this.membershipPlanService=i,this.activityService=l,this.batchService=r,this.approvalService=p,this.sharedService=x}ngOnInit(){this.selectedCompany$=this.sharedService.getLoggedInCompany,this.selectedIds=[...this.data?.selectedIds||[]],this.selectedItems=[...this.data?.selectedItems||[]],this.approvalModel.enrollmentDate=this.sharedService.getDateInIST00InUTCFormat(new Date),this.approvalModel.preferredBatches=[],this.approvalModel.allocatedBatches=[],this.getAllMembershipPlans(),this.getAllActivities()}get selectedCount(){return this.selectedIds?.length||0}getChipInitial(a){return(a.name||a.applicationId||"M").trim().charAt(0).toUpperCase()}removeMember(a,t){t.stopPropagation(),t.preventDefault(),a?.id&&
1(this.selectedIds=this.selectedIds.filter(i=>i!==a.id),this.selectedItems=this.selectedItems.filter(i=>i.id!==a.id),this.data?.onRemoveMember&&this.data.onRemoveMember(a.id),this.activeChipId===a.id&&this.clearMemberDetails(),0===this.selectedIds.length&&this.dialogRef.close())}onChipClick(a){if(!a?.id)return;if(this.activeChipId===a.id&&(this.memberDetailsRequest||this.memberDetailsError))return void this.clearMemberDetails();this.activeChipId=a.id,this.memberDetailsLoading=!0,this.memberDetailsError=null,this.memberDetailsRequest=null,this.showFullAddress=!1;const t=this.data.selectedCompany;if(!t)return this.memberDetailsLoading=!1,void(this.memberDetailsError="Company not found.");this.subscription.add(this.approvalService.getById(t,a.id).subscribe({next:i=>{if(this.memberDetailsLoading=!1,this.memberDetailsRequest=i?.details||null,this.memberDetailsRequest){if(this.memberDetailsRequest.member?.dob)try{this.memberDetailsRequest.member.age=this.sharedService.calculateAge(this.memberDetailsRequest.member.dob)}catch{}}else this.memberDetailsError="Member details not found."},error:()=>{this.memberDetailsLoading=!1,this.memberDetailsError="Unable to load member details."}}))}clearMemberDetails(){this.activeChipId=null,this.memberDetailsRequest=null,this.memberDetailsError=null,this.memberDetailsLoading=!1,this.showFullAddress=!1}getMemberFullName(){const a=this.memberDetailsRequest?.member;return a?[a.firstName,a.middleName,a.lastName].filter(Boolean).join(" "):""}getAddressText(){const a=this.memberDetailsRequest?.member?.address;return a?[a.line1,a.line2,a.line3,a.line4,a.locality,a.city,a.state,a.postalCode,a.country].filter(t=>null!=t&&""!==String(t).trim()&&"Not Provided"!==String(t)).join(", "):""}close(){this.dialogRef.close()}getAllMembershipPlans(){this.subscription.add(this.selectedCompany$.pipe((0,v.s)(1)).subscribe(a=>{a&&this.subscription.add(this.membershipPlanService.getAll(a).subscribe(t=>{this.membershipPlans=t.membershipPlans||[]}))}))}getAllActivities(){this.subscription.add(this.selectedCompany$.pipe((0,v.s)(1)).subscribe(a=>{a&&this.subscription.add(this.activityService.getAllForWeb(a).subscribe(t=>{this.activities=t?.activities||[]}))}))}getAllBatches(){this.selectedBatchId=void 0,this.selectedJoiningDate=null,this.batches=[],this.selectedActivityId&&this.subscription.add(this.selectedCompany$.pipe((0,v.s)(1)).subscribe(a=>{!a||!this.selectedActivityId||this.subscription.add(this.batchService.getAll(a,this.selectedActivityId).subscribe(t=>{this.batches=t?.batches||[],this.batches.forEach(i=>{i.startDate=this.sharedService.getDateFromStringOfSameTimeZone(i.startDate),i.endDate=this.sharedService.getPrevioudsDateFromStringOfSameTimeZone(i.endDate)})}))}))}setBatchJoiningDate(){this.isValid(this.selectedBatchId)?this.batches.forEach(a=>{a.id==this.selectedBatchId&&(new Date(a.startDate)<new Date(this.approvalModel.enrollmentDate)?(this.selectedJoiningDate=new Date(this.approvalModel.enrollmentDate),this.minimumJoiningDate=new Date(this.approvalModel.enrollmentDate),this.maximumJoiningDate=new Date(a.endDate)):(this.selectedJoiningDate=new Date(a.startDate),this.minimumJoiningDate=new Date(a.startDate),this.maximumJoiningDate=new Date(a.endDate)))}):this.selectedJoiningDate=null}getBatchExpired(a){return null!=a&&new Date(a)<new Date}clearMembershipPlan(){this.approvalModel.membershipPlanName=null,this.approvalModel.membershipPlanVersion=null,this.approvalModel.membershipStartDate=null,this.approvalModel.membershipEndDate=null,this.endDateDisableFlag=!1,this.startDateDisableFlag=!1}setMembershipStartDate(){this.isValid(this.approvalModel.membershipPlanName)&&(this.approvalModel.membershipStartDate=this.approvalModel.enrollmentDate,this.setEndDate()),this.isValid(this.selectedBatchId)&&this.setBatchJoiningDate()}setEndDate(){!this.approvalModel.membershipPlanName||!this.approvalModel.membershipStartDate||this.membershipPlans.forEach(a=>{a.planName==this.approvalModel.membershipPlanName&&"yearly"==a.type&&(this.approvalModel.membershipEndDate=new Date(this.approvalModel.membershipStartDate.getTime()+31536e6))})}setSelectedMembershipPlan(){this.isValid(this.approvalModel.membershipPlanName)?this.membershipPlans.forEach(a=>{a.planName==this.approvalModel.membershipPlanName&&(this.approvalModel.membershipPlanVersion=a.version,"yearly"==a.type?(this.setMembershipStartDate(),this.setEndDate(),this.endDateDisableFlag=!1,this.startDateDisableFlag=!0):(this.approvalModel.membershipEndDate=null,this.endDateDisableFlag=!0,this.startDateDisableFlag=!1,this.setMembershipStartDate()))}):this.clearMembershipPlan()}isValid(a){return null!=a&&void 0!==a&&""!==a}isBatchSectionPartial(){const a=this.isValid(this.selectedActivityId)||this.isValid(this.selectedBatchId)||this.isValid(this.selectedJoiningDate),t=this.isValid(this.selectedActivityId)&&this.isValid(this.selectedBatchId)&&this.isValid(this.selectedJoiningDate);return a&&!t}buildAllocatedBatchIfSelected(){if(!this.isValid(this.selectedActivityId)||!this.isValid(this.selectedBatchId)||!this.isValid(this.selectedJoiningDate))return[];const a=this.batches.find(l=>l.id==this.selectedBatchId),t=this.activities.find(l=>l.id==this.selectedActivityId);if(!a||!t)return[];const i=new E.L;return i.batchId=this.selectedBatchId,i.batchName=a.name,i.activityName=t.name,i.activityId=t.
1id,i.joiningDate=this.sharedService.getDateStringForWOUtc(this.selectedJoiningDate),[i]}onApprove(){if(this.isSubmitting||!this.selectedIds?.length||this.isBatchSectionPartial())return;this.isSubmitting=!0;const a=Object.assign(new E.F,this.approvalModel);if(a.enrollmentDate=this.sharedService.getDateStringForWOUtc(a.enrollmentDate),a.preferredBatches=[],a.allocatedBatches=this.buildAllocatedBatchIfSelected(),this.isValid(this.approvalModel.membershipPlanName)){try{a.membershipStartDate=this.sharedService.getDateStringForWOUtc(this.approvalModel.membershipStartDate)}catch{a.membershipStartDate=null}try{this.approvalModel.membershipEndDate&&(a.membershipEndDate=this.sharedService.getNextDateStringForWOUtc(this.approvalModel.membershipEndDate))}catch{a.membershipEndDate=null}}else a.membershipStartDate=null,a.membershipEndDate=null,a.membershipPlanName="",a.membershipPlanVersion=null;a.status="approve";const t={approvalModel:a,ids:[...this.selectedIds]};this.dialogRef.close(t)}static \u0275fac=function(t){return new(t||N)(e.rXU(I.CP),e.rXU(I.Vh),e.rXU(Q.P),e.rXU(Z.B),e.rXU(q.z),e.rXU(X.r),e.rXU(Y.d))};static \u0275cmp=e.VBU({type:N,selectors:[["app-bulk-approve-dialog"]],decls:68,vars:38,consts:[["f","ngForm"],["picker",""],["picker0",""],["pickerJoin",""],["picker1",""],[1,"bulk-dialog"],["type","button","aria-label","Close","matTooltip","Close",1,"bulk-dialog__close",3,"click"],[1,"bulk-dialog__header"],[1,"bulk-dialog__header-text"],[1,"bulk-dialog__title"],[1,"bulk-dialog__subtitle"],["class","bulk-dialog__chips-wrap",4,"ngIf"],["class","member-details",4,"ngIf"],[1,"bulk-dialog__section-label"],[1,"bulk-dialog__form"],["appearance","outline",1,"full-width"],["matInput","","placeholder","mm/dd/yyyy","name","enrollmentDate","required","",3,"click","ngModelChange","matDatepicker","readonly","min","ngModel"],["matSuffix","",3,"for"],["name","membershipPlan","placeholder","-- Select Plan --",3,"ngModelChange","ngModel"],[3,"click","value"],[4,"ngFor","ngForOf"],[1,"bulk-dialog__row"],["appearance","outline",1,"half-width"],["matInput","","placeholder","mm/dd/yyyy","name","membershipStartDate",3,"click","ngModelChange","matDatepicker","readonly","min","ngModel","disabled","required"],[3,"disabled"],["class","half-width","appearance","outline",4,"ngIf"],["name","activity","placeholder","-- Select Activity --",3,"ngModelChange","ngModel"],[3,"value"],[3,"value","disabled",4,"ngFor","ngForOf"],["name","batch","placeholder","-- Select Batch --",3,"ngModelChange","ngModel","disabled"],["matInput","","placeholder","mm/dd/yyyy","name","selectedJoiningDate",3,"click","ngModelChange","matDatepicker","readonly","min","max","ngModel","disabled","required"],["class","bulk-dialog__error",4,"ngIf"],[1,"bulk-dialog__actions"],["mat-stroked-button","","type","button",1,"cancel-btn",3,"click"],["mat-flat-button","","type","button",1,"approve-btn",3,"click","disabled"],[1,"bulk-dialog__chips-wrap"],[1,"bulk-dialog__chips"],["class","member-chip",3,"member-chip--active",4,"ngFor","ngForOf"],[1,"member-chip"],["type","button","matTooltip","View member details",1,"member-chip__main",3,"click"],[1,"member-chip__avatar"],[1,"member-chip__id"],["type","button","matTooltip","Remove from selection","aria-label","Remove member",1,"member-chip__remove",3,"click"],[1,"member-details"],[1,"member-details__header"],[1,"member-details__title"],["type","button","aria-label","Close details",1,"member-details__close",3,"click"],["class","member-details__loading",4,"ngIf"],["class","member-details__error",4,"ngIf"],["class","member-details__body",4,"ngIf"],[1,"member-details__loading"],[1,"member-details__error"],[1,"member-details__body"],[1,"member-details__top"],["class","member-details__photo","alt","Member photo",3,"src",4,"ngIf"],["class","member-details__photo member-details__photo--placeholder","src","./assets/user.png","alt","Member",4,"ngIf"],[1,"member-details__name"],[1,"member-details__app-id"],[1,"member-details__status"],[1,"member-details__table"],[4,"ngIf"],["alt","Member photo",1,"member-details__photo",3,"src"],["src","./assets/user.png","alt","Member",1,"member-details__photo","member-details__photo--placeholder"],["class","see-more",3,"click",4,"ngIf"],[1,"see-more",3,"click"],[3,"value","click",4,"ngIf"],[1,"plan-meta"],["matInput","","placeholder","mm/dd/yyyy","name","membershipEndDate",3,"click","ngModelChange","matDatepicker","readonly","min","ngModel","disabled"],[3,"value","disabled"],[3,"value",4,"ngIf"],[1,"bulk-dialog__error"]],template:function(t,i){if(1&t){const l=e.RV6();e.j41(0,"div",5)(1,"button",6),e.bIt("click",function(){return o.eBV(l),o.Njj(i.close())}),e.j41(2,"mat-icon"),e.EFF(3,"close"),e.k0s()(),e.j41(4,"div",7)(5,"div",8)(6,"h2",9),e.EFF(7,"Approve Members"),e.k0s(),e.j41(8,"p",10),e.EFF(9),e.k0s()()(),e.DNE(10,ie,3,1,"div",11)(11,fe,10,3,"div",12),e.j41(12,"div",13),e.EFF(13,"APPLY TO ALL SELECTED MEMBERS"),e.k0s(),e.j41(14,"form",14,0)(16,"mat-form-field",15)(17,"mat-label"),e.EFF(18,"Enrollment Date"),e.k0s(),e.j41(19,"input",16),e.bIt("click",function(){o.eBV(l);const p=e.sdS(22);return o.Njj(p.open())}),e.mxI("ngModelChange",function(p){return o.eBV(l),e.DH7(i.approvalModel.enrollmentDate,p)||(i.approvalModel.enrollmentDate=p),o.Njj(p)}),e.bIt("ngModelChange",function(){return o.eBV(l),o.Njj(i.setMembershipStartDate())}),e.k0s(),e.nrm(20,"mat-datepicker-toggle",17)(21,"mat-datepicker",null,1),e.k0s(),e.j41(23,"mat-form-field",15)(24,"mat-label"),e.EFF(25,"Membership Plan"),e.k0s(),e.j41(26,"mat-select",18),e.mxI("ngModelChange",function(p){return o.eBV(l),e.DH7(i.approvalModel.membershipPlanName,p)||(i.approvalModel.membershipPlanName=p),o.Njj(p)}),e.bIt("ngModelChange",function(){return o.eBV(l),o.Njj(i.setSelectedMembershipPlan())}),e.j41(27,"mat-option",19),e.bIt("click",function(){return o.eBV(l),o.Njj(i.clearMembershipPlan())}),e.EFF(28,"-- Select Plan --"),e.k0s(),e.DNE(29,Ce,2,1,"ng-container",20),e.k0s()(),e.j41(30,"div",21)(31,"mat-form-field",22)(32,"mat-label"),e.EFF(33,"Membership Start Date"),e.k0s(),e.j41(34,"input",23),e.bIt("click",function(){o.eBV(l);const p=e.sdS(37);return o.Njj(p.open())}),e.mxI("ngModelChange",function(p){return o.eBV(l),e.DH7(i.approvalModel.membershipStartDate,p)||(i.approvalModel.membershipStartDate=p),o.Njj(p)}),e.bIt("ngModelChange",function(){return o.eBV(l),o.Njj(i.setEndDate())}),e.k0s(),e.nrm(35,"mat-datepicker-toggle",17)(36,"mat-datepicker",24,2),e.k0s(),e.DNE(38,ke,7,7,"mat-form-field",25),e.k0s(),e.j41(39,"div",21)(40,"mat-form-field",22)(41,"mat-label"),e.EFF(42,"Activity"),e.k0s(),e.j41(43,"mat-select",26),e.mxI("ngModelChange",function(p){return o.eBV(l),e.DH7(i.selectedActivityId,p)||(i.selectedActivityId=p),o.Njj(p)}),e.bIt("ngModelChange",function(){return o.eBV(l),o.Njj(i.getAllBatches())}),e.j41(44,"mat-option",27),e.EFF(45,"-- Select Activity --"),e.k0s(),e.DNE(46,De,2,3,"mat-option",28),e.k0s()(),e.j41(47,"mat-form-field",22)(48,"mat-label"),e.EFF(49,"Batch"),e.k0s(),e.j41(50,"mat-select",29),e.mxI("ngModelChange",function(p){return o.eBV(l),e.DH7(i.selectedBatchId,p)||(i.selectedBatchId=p),o.Njj(p)}),e.bIt("ngModelChange",function(){return o.eBV(l),o.Njj(i.setBatchJoiningDate())}),e.j41(51,"mat-option",27),e.EFF(52,"-- Select Batch --"),e.k0s(),e.DNE(53,xe,2,1,"ng-container",20),e.k0s()()(),e.j41(54,"div",21)(55,"mat-form-field",22)(
156,"mat-label"),e.EFF(57,"Joining Date"),e.k0s(),e.j41(58,"input",30),e.bIt("click",function(){o.eBV(l);const p=e.sdS(61);return o.Njj(p.open())}),e.mxI("ngModelChange",function(p){return o.eBV(l),e.DH7(i.selectedJoiningDate,p)||(i.selectedJoiningDate=p),o.Njj(p)}),e.k0s(),e.nrm(59,"mat-datepicker-toggle",17)(60,"mat-datepicker",null,3),e.k0s()(),e.DNE(62,Ae,2,0,"p",31),e.j41(63,"div",32)(64,"button",33),e.bIt("click",function(){return o.eBV(l),o.Njj(i.close())}),e.EFF(65,"Cancel"),e.k0s(),e.j41(66,"button",34),e.bIt("click",function(){return o.eBV(l),o.Njj(i.onApprove())}),e.EFF(67),e.k0s()()()()}if(2&t){const l=e.sdS(15),r=e.sdS(22),p=e.sdS(37),x=e.sdS(61);e.R7$(9),e.SpI("",i.selectedCount," members selected"),e.R7$(),e.Y8G("ngIf",null==i.selectedItems?null:i.selectedItems.length),e.R7$(),e.Y8G("ngIf",i.activeChipId),e.R7$(8),e.Y8G("matDatepicker",r)("readonly",!0)("min",i.sharedService.minDate),e.R50("ngModel",i.approvalModel.enrollmentDate),e.R7$(),e.Y8G("for",r),e.R7$(6),e.R50("ngModel",i.approvalModel.membershipPlanName),e.R7$(),e.Y8G("value",null),e.R7$(2),e.Y8G("ngForOf",i.membershipPlans),e.R7$(5),e.Y8G("matDatepicker",p)("readonly",!0)("min",i.approvalModel.enrollmentDate),e.R50("ngModel",i.approvalModel.membershipStartDate),e.Y8G("disabled",!i.isValid(i.approvalModel.membershipPlanName)||i.startDateDisableFlag)("required",i.isValid(i.approvalModel.membershipPlanName)),e.R7$(),e.Y8G("for",p),e.R7$(),e.Y8G("disabled",!i.isValid(i.approvalModel.membershipPlanName)||i.startDateDisableFlag),e.R7$(2),e.Y8G("ngIf",!i.endDateDisableFlag||!i.isValid(i.approvalModel.membershipPlanName)),e.R7$(5),e.R50("ngModel",i.selectedActivityId),e.R7$(),e.Y8G("value",void 0),e.R7$(2),e.Y8G("ngForOf",i.activities),e.R7$(4),e.R50("ngModel",i.selectedBatchId),e.Y8G("disabled",!i.selectedActivityId),e.R7$(),e.Y8G("value",void 0),e.R7$(2),e.Y8G("ngForOf",i.batches),e.R7$(5),e.Y8G("matDatepicker",x)("readonly",!0)("min",i.minimumJoiningDate)("max",i.maximumJoiningDate),e.R50("ngModel",i.selectedJoiningDate),e.Y8G("disabled",!i.selectedBatchId)("required",!!i.selectedActivityId||!!i.selectedBatchId),e.R7$(),e.Y8G("for",x),e.R7$(3),e.Y8G("ngIf",i.isBatchSectionPartial()),e.R7$(4),e.Y8G("disabled",!l.valid||i.isSubmitting||i.isBatchSectionPartial()),e.R7$(),e.SpI(" \u2713 Approve ",i.selectedCount," Members ")}},dependencies:[g.MD,g.Sq,g.bT,V.g,y.$z,j.An,M.rl,M.nJ,M.yw,U.fg,ee.VO,te.wT,C.qT,C.me,C.BC,C.cb,C.YS,C.vS,C.cV,L.oV,P.Vh,P.bZ,P.bU,g.P9,g.vh],styles:["[_nghost-%COMP%]{display:block;max-height:calc(90vh - 48px);overflow:auto;-webkit-overflow-scrolling:touch}.bulk-dialog[_ngcontent-%COMP%]{position:relative;padding:12px 8px 8px;width:100%;max-width:720px;min-width:0;box-sizing:border-box;color:#1f2937}.bulk-dialog__close[_ngcontent-%COMP%]{position:absolute;top:0;right:0;z-index:2;border:none;background:transparent;color:#6b7280;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%;padding:0}.bulk-dialog__close[_ngcontent-%COMP%]:hover{background:#f3f4f6;color:#111827}.bulk-dialog__close[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:22px;width:22px;height:22px}.bulk-dialog__header[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin:0 36px 14px 0}.bulk-dialog__header-text[_ngcontent-%COMP%]{min-width:0;flex:1 1 auto}.bulk-dialog__title[_ngcontent-%COMP%]{margin:0;font-size:22px;font-weight:700;color:#111827;line-height:1.2;word-break:break-word}.bulk-dialog__subtitle[_ngcontent-%COMP%]{margin:4px 0 0;font-size:13px;color:#6b7280}.bulk-dialog__chips-wrap[_ngcontent-%COMP%]{margin-bottom:16px;border:1px solid #e5e7eb;border-radius:10px;background:#f9fafb;padding:10px;max-height:132px;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch}.bulk-dialog__chips[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:0}.member-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:2px;padding:3px 4px 3px 3px;border-radius:999px;background:#fff;border:1px solid #e5e7eb;font-size:13px;color:#111827;max-width:100%}.member-chip[_ngcontent-%COMP%]:hover{border-color:#93c5fd;background:#eff6ff}.member-chip--active[_ngcontent-%COMP%]{border-color:#2563eb;background:#dbeafe;box-shadow:0 0 0 1px #2563eb inset}.member-chip__main[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:8px;border:none;background:transparent;cursor:pointer;padding:1px 4px 1px 1px;font-family:inherit;color:inherit;min-width:0}
1.member-chip__avatar[_ngcontent-%COMP%]{width:24px;height:24px;border-radius:50%;background:#2563eb;color:#fff;display:inline-flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;flex-shrink:0}.member-chip__id[_ngcontent-%COMP%]{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:120px}.member-chip__remove[_ngcontent-%COMP%]{border:none;background:transparent;color:#6b7280;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;padding:0;flex-shrink:0}.member-chip__remove[_ngcontent-%COMP%]:hover{background:#fee2e2;color:#dc2626}.member-chip__remove[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;line-height:16px}.member-details[_ngcontent-%COMP%]{border:1px solid #e5e7eb;border-radius:10px;background:#f8fafc;padding:12px 14px;margin-bottom:16px;max-height:220px;overflow-y:auto}.member-details__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.member-details__title[_ngcontent-%COMP%]{font-size:13px;font-weight:700;color:#374151}.member-details__close[_ngcontent-%COMP%]{border:none;background:transparent;cursor:pointer;color:#6b7280;display:inline-flex;padding:0}.member-details__loading[_ngcontent-%COMP%], .member-details__error[_ngcontent-%COMP%]{font-size:13px;color:#6b7280}.member-details__error[_ngcontent-%COMP%]{color:#dc2626}.member-details__top[_ngcontent-%COMP%]{display:flex;gap:12px;align-items:center;margin-bottom:10px}.member-details__photo[_ngcontent-%COMP%]{width:64px;height:64px;border-radius:8px;object-fit:cover;background:#e5e7eb;flex-shrink:0}.member-details__photo--placeholder[_ngcontent-%COMP%]{object-fit:contain;padding:8px}.member-details__name[_ngcontent-%COMP%]{font-size:16px;font-weight:700;color:#111827;word-break:break-word}.member-details__app-id[_ngcontent-%COMP%], .member-details__status[_ngcontent-%COMP%]{font-size:12px;color:#4b5563;margin-top:2px}.member-details__table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse}.member-details__table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{text-align:left;width:110px;font-size:13px;color:#374151;font-weight:600;padding:3px 0;vertical-align:top}.member-details__table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{font-size:13px;color:#111827;padding:3px 0;word-break:break-word}.see-more[_ngcontent-%COMP%]{color:#2563eb;cursor:pointer;margin-left:4px;text-decoration:underline}.bulk-dialog__section-label[_ngcontent-%COMP%]{font-size:11px;font-weight:700;letter-spacing:.06em;color:#6b7280;margin-bottom:10px}.bulk-dialog__form[_ngcontent-%COMP%]{display:block}.full-width[_ngcontent-%COMP%]{width:100%}.bulk-dialog__row[_ngcontent-%COMP%]{display:flex;gap:12px;width:100%}.half-width[_ngcontent-%COMP%]{flex:1 1 0;min-width:0}.plan-meta[_ngcontent-%COMP%]{color:#6b7280;font-size:12px}.bulk-dialog__error[_ngcontent-%COMP%]{margin:0 0 8px;color:#dc2626;font-size:13px}.bulk-dialog__actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-top:8px;gap:12px;flex-wrap:wrap}.cancel-btn[_ngcontent-%COMP%]{border-color:#d1d5db!important;color:#374151!important;min-width:96px}.approve-btn[_ngcontent-%COMP%]{background:#16a34a!important;color:#fff!important;min-width:180px;font-weight:600}.approve-btn[_ngcontent-%COMP%]:disabled{background:#86efac!important;color:#fff!important;opacity:.7}@media (max-width: 720px){.bulk-dialog[_ngcontent-%COMP%]{padding:8px 4px 4px}.bulk-dialog__header[_ngcontent-%COMP%]{flex-wrap:wrap;margin-right:32px}.bulk-dialog__title[_ngcontent-%COMP%]{font-size:18px}.bulk-dialog__chips-wrap[_ngcontent-%COMP%]{max-height:110px}.bulk-dialog__row[_ngcontent-%COMP%]{flex-direction:column;gap:0}.half-width[_ngcontent-%COMP%]{width:100%;flex:1 1 auto}.member-details__table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{width:90px}.bulk-dialog__actions[_ngcontent-%COMP%]{flex-direction:column-reverse;align-items:stretch}.cancel-btn[_ngcontent-%COMP%], .approve-btn[_ngcontent-%COMP%]{width:100%;min-width:0}}@media (max-width: 480px){.member-details__top[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start}.member-details__table[_ngcontent-%COMP%], .member-details__table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%], .member-details__table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%], .member-details__table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .member-details__table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{display:block;width:100%}.member-details__table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{padding-bottom:0}.member-details__table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding-top:0;margin-bottom:8px}}"]})};T=(0,b.Cg)([c.P],T);var Me=s(17705),Fe=s(35568),Ie=s(29885),Te=s(26656),Re=s(6993),ye=s(34330),je=s(25596),J=s(5951),Ee=s(97702),Pe=s(1613);const Be=()=>[25,50,100,250],Ne=()=>[10,25,50,100,250];function we(n,a){if(1&n){const t=e.RV6();e.j41(0,"button",23),e.bIt("click",function(){o.eBV(t);const l=e.XpG(2);return o.Njj(l.openBulkApproveDialog())}),e.EFF(1),e.k0s()}if(2&n){const t=e.XpG(2);e.Y8G("disabled",t.isBulkApproving||t.hasNonPendingSelected()),e.R7$(),e.SpI(" Approve Selected (",t.selectedApprovalCount,") ")}}function Ge(n,a){if(1&n){const t=e.RV6();e.j41(0,"div")(1,"div",6)(2,"p",7),e.EFF(3,"Member Approvals"),e.k0s(),e.nrm(4,"span",8),e.k0s(),e.j41(5,"div",9)(6,"span",10)(7,"mat-form-field",11)(8,"input",12),e.bIt("keyup",function(l){o.eBV(t);const r=e.XpG();return o.Njj(r.applyFilter(l.target.value))}),e.mxI("ngModelChange",function(l){o.eBV(t);const r=e.XpG();
1return e.DH7(r.sharedDetailsNavService.approvalSearchText,l)||(r.sharedDetailsNavService.approvalSearchText=l),o.Njj(l)}),e.k0s(),e.j41(9,"button",13),e.bIt("click",function(){o.eBV(t);const l=e.XpG();return o.Njj(l.onReset())}),e.j41(10,"mat-icon"),e.EFF(11,"close"),e.k0s()()()(),e.j41(12,"span",14)(13,"mat-radio-group",15),e.mxI("ngModelChange",function(l){o.eBV(t);const r=e.XpG();return e.DH7(r.filter,l)||(r.filter=l),o.Njj(l)}),e.bIt("ngModelChange",function(){o.eBV(t);const l=e.XpG();return o.Njj(l.filterApprovals())}),e.j41(14,"mat-radio-button",16),e.EFF(15,"Pending"),e.k0s(),e.EFF(16,"\xa0\xa0 "),e.j41(17,"mat-radio-button",17),e.EFF(18,"Rejected"),e.k0s(),e.EFF(19,"\xa0\xa0 "),e.j41(20,"mat-radio-button",18),e.EFF(21,"Failed"),e.k0s(),e.EFF(22,"\xa0\xa0 "),e.j41(23,"mat-radio-button",19),e.EFF(24,"Enrolled"),e.k0s(),e.EFF(25,"\xa0\xa0 "),e.k0s()(),e.j41(26,"span",20),e.DNE(27,we,2,2,"button",21),e.j41(28,"button",22),e.bIt("click",function(){o.eBV(t);const l=e.XpG();return o.Njj(l.onload())}),e.j41(29,"mat-icon"),e.EFF(30,"upload"),e.k0s()()()()()}if(2&n){const t=e.XpG();e.R7$(8),e.R50("ngModel",t.sharedDetailsNavService.approvalSearchText),e.R7$(5),e.R50("ngModel",t.filter),e.R7$(14),e.Y8G("ngIf",t.selectedApprovalCount>0)}}function Oe(n,a){if(1&n){const t=e.RV6();e.j41(0,"button",28),e.bIt("click",function(){o.eBV(t);const l=e.XpG(2);return o.Njj(l.openBulkApproveDialog())}),e.EFF(1),e.k0s()}if(2&n){const t=e.XpG(2);e.Y8G("disabled",t.isBulkApproving||t.hasNonPendingSelected()),e.R7$(),e.SpI(" ",t.bulkApproveSuccessMessage," ")}}function $e(n,a){if(1&n){const t=e.RV6();e.j41(0,"div")(1,"mat-form-field",24)(2,"input",12),e.bIt("keyup",function(l){o.eBV(t);const r=e.XpG();return o.Njj(r.applyFilter(l.target.value))}),e.mxI("ngModelChange",function(l){o.eBV(t);const r=e.XpG();return e.DH7(r.sharedDetailsNavService.approvalSearchText,l)||(r.sharedDetailsNavService.approvalSearchText=l),o.Njj(l)}),e.k0s()(),e.j41(3,"div",25)(4,"mat-radio-group",15),e.mxI("ngModelChange",function(l){o.eBV(t);const r=e.XpG();return e.DH7(r.filter,l)||(r.filter=l),o.Njj(l)}),e.bIt("ngModelChange",function(){o.eBV(t);const l=e.XpG();return o.Njj(l.filterApprovals())}),e.j41(5,"mat-radio-button",16),e.EFF(6,"Pending"),e.k0s(),e.EFF(7,"\xa0\xa0 "),e.j41(8,"mat-radio-button",17),e.EFF(9,"Rejected"),e.k0s(),e.nrm(10,"br"),e.j41(11,"mat-radio-button",18),e.EFF(12,"Failed"),e.k0s(),e.EFF(13,"\xa0\xa0\xa0\xa0\xa0\xa0 "),e.j41(14,"mat-radio-button",19),e.EFF(15,"Enrolled"),e.k0s()()(),e.j41(16,"div",25),e.DNE(17,Oe,2,2,"button",26),e.j41(18,"button",27),e.bIt("click",function(){o.eBV(t);const l=e.XpG();return o.Njj(l.onload())}),e.EFF(19,"upload"),e.k0s()()()}if(2&n){const t=e.XpG();e.R7$(2),e.R50("ngModel",t.sharedDetailsNavService.approvalSearchText),e.R7$(2),e.R50("ngModel",t.filter),e.R7$(13),e.Y8G("ngIf",t.selectedApprovalCount>0)}}function Ve(n,a){if(1&n){const t=e.RV6();e.j41(0,"mat-checkbox",51),e.bIt("change",function(l){o.eBV(t);const r=e.XpG(3);return o.Njj(r.toggleAllRows(l.checked))})("click",function(l){return o.eBV(t),o.Njj(l.stopPropagation())}),e.k0s()}if(2&n){const t=e.XpG(3);e.Y8G("checked",t.isAllSelected())("indeterminate",t.isIndeterminate())}}function Xe(n,a){if(1&n&&(e.j41(0,"th",49),e.DNE(1,Ve,1,2,"mat-checkbox",50),e.k0s()),2&n){const t=e.XpG(2);e.R7$(),e.Y8G("ngIf",t.isSelectionEnabled)}}function Ye(n,a){if(1&n){const t=e.RV6();e.j41(0,"mat-checkbox",54),e.bIt("change",function(l){o.eBV(t);const r=e.XpG().$implicit,p=e.XpG(2);return o.Njj(p.onRowSelectionChange(r,l.checked))})("click",function(l){return o.eBV(t),o.Njj(l.stopPropagation())}),e.k0s()}if(2&n){const t=e.XpG().$implicit,i=e.XpG(2);e.Y8G("checked",i.selection.isSelected(t))("disabled",!i.isRowSelectable(t))}}function Ue(n,a){if(1&n){const t=e.RV6();e.j41(0,"td",52),e.bIt("click",function(l){return o.eBV(t),o.Njj(l.stopPropagation())}),e.DNE(1,Ye,1,2,"mat-checkbox",53),e.k0s()}if(2&n){const t=e.XpG(2);e.R7$(),e.Y8G("ngIf",t.isSelectionEnabled)}}function Le(n,a){1&n&&(e.j41(0,"th",55),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&n&&(e.R7$(),e.JRh(e.bMT(2,1,"Name")))}function Je(n,a){if(1&n&&(e.j41(0,"td",56),e.EFF(1),e.k0s()),2&n){const t=a.$implicit;e.R7$(),e.Lme("",t.member.firstName," ",t.member.lastName)}}function ze(n,a){1&n&&(e.j41(0,"th",57),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&n&&(e.R7$(),e.JRh(e.bMT(2,1,"Phone")))}function He(n,a){if(1&n&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&n){const t=e.XpG().$implicit;e.R7$(),e.Lme("",t.parent[0].countryCode," ",t.parents[0].phone)}}function We(n,a){if(1&n&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&n){const t=e.XpG().$implicit;e.R7$(),e.Lme("",t.member.countryCode," ",t.member.phone)}}function Ke(n,a){if(1&n&&(e.j41(0,"td",56),e.DNE(1,He,2,2,"span",3)(2,We,2,2,"span",3),e.k0s()),2&n){const t=a.$implicit;e.R7$(),e.Y8G("ngIf",null!=t.parents&&0!=t.parents.length&&!(null!=t.member.phone&&null!=t.member.phone&&""!=t.member.phone)),e.R7$(),e.Y8G("ngIf",null!=t.member.phone&&null!=t.member.phone&&""!=t.member.phone)}}function Qe(n,a){1&n&&(e.j41(0,"th",57),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&n&&(e.R7$(),e.JRh(e.bMT(2,1,"Pending Approvals")))}function Ze(n,a){if(1&n&&(e.j41(0,"td",58),e.EFF(1),e.k0s()),2&n){const t=a.$implicit;e.R7$(),e.JRh(t.approvalsLeft)}}function qe(n,a){1&n&&(e.j41(0,"th",57),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&n&&(e.R7$(),e.JRh(e.bMT(2,1,"Application Id")))}function et(n,a){if(1&n&&(e.j41(0,"td",56),e.EFF(1),e.k0s()),2&n){const t=a.$implicit;e.R7$(),e.JRh(t.applicationId)}}function tt(n,a){1&n&&(e.j41(0,"th",59),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&n&&(e.R7$(),e.JRh(e.bMT(2,1,"Status")))}function at(n,a){if(1&n&&(e.j41(0,"td",56)(1,"span"),e.EFF(2),e.k0s()()),2&n){const t=a.$implicit;e.R7$(2),e.SpI(" ",t.status)}}function it(n,a){1&n&&(e.j41(0,"th",60),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&n&&(e.R7$(),e.JRh(e.bMT(2,1,"Notes")))}function nt(n,a){if(1&n&&(e.j41(0,"td",61),e.EFF(1),e.nI1(2,"trimLength"),e.k0s()),2&n){const t=a.$implicit;e.Y8G("matTooltip",e.mNQ(t.notesToDisplay)),e.R7$(),e.JRh(e.i5U(2,3,t.notesToDisplay,50))}}function lt(n,a){if(1&n){const t=e.RV6();e.j41(0,"tr",62),e.bIt("click",function(){o.eBV(t);const l=e.XpG(2);return o.Njj(l.onSortClick())}),e.k0s()}}function ot(n,a){if(1&n){const t=e.RV6();e.j41(0,"tr",63),e.bIt("click",function(){const l=o.eBV(t).$implicit,r=e.XpG(2);return o.Njj(r.getApprovalDetails(l.id))}),e.k0s()}}function rt(n,a){if(1&n&&(e.j41(0,"div")(1,"table",29),e.qex(2,30),e.DNE(3,Xe,2,1,"th",31)(4,Ue,2,1,"td",32),e.bVm(),e.qex(5,33),e.DNE(6,Le,3,3,"th",34)(7,Je,2,2,"td",35),e.bVm(),e.qex(8,36),e.DNE(9,ze,3,3,"th",37)(10,Ke,3,2,"td",35),e.bVm(),e.qex(11,38),e.DNE(12,Qe,3,3,"th",37)(13,Ze,2,1,"td",39),e.bVm(),e.qex(14,40),e.DNE(15,qe,3,3,"th",37)(16,et,2,1,"td",35),e.bVm(),e.qex(17,41),e.DNE(18,tt,3,3,"th",42)(19,at,3,1,"td",35),e.bVm(),e.qex(20,43),e.DNE(21,it,3,3,"th",44)(22,nt,3,6,"td",45),e.bVm(),e.DNE(23,lt,1,0,"tr",46)(24,ot,1,0,"tr",47),e.k0s(),e.nrm(25,"mat-paginator",48,0),e.k0s()),2&n){const t=e.XpG();e.R7$(),e.Y8G("dataSource",t.dataSource),e.R7$(22),e.Y8G("matHeaderRowDef",t.displayedColumns),e.R7$(),e.Y8G("matRowDefColumns",t.displayedColumns),e.R7$(),e.Y8G("length",t.dataSource.data.length)("pageIndex",t.pageIndex)("pageSize",t.pageSize)("pageSizeOptions",e.lJ4(7,Be))}}function st(n,a){1&n&&(e.j41(0,"th",67),e.EFF(1,"Member Approvals"),e.k0s())}function pt(n,a){if(1&n){const t=e.RV6();e.j41(0,"mat-checkbox",54),e.bIt("change",function(l){o.eBV(t);const r=e.XpG().$implicit,p=e.XpG(2);return o.Njj(p.onRowSelectionChange(r,l.checked))})("click",function(l){return o.eBV(t),o.Njj(l.stopPropagation())}),e.k0s()}if(2&n){const t=e.XpG().$implicit,i=e.XpG(2);e.Y8G("checked",i.selection.isSelected(t))("disabled",!i.isRowSelectable(t))}}function ct(n,a){if(1&n&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&n){const t=e.XpG().$implicit;e.R7$(),e.Lme("",t.parent[0].countryCode," ",t.parents[0].phone)}}function dt(n,a){if(1&n&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&n){const t=e.XpG().$implicit;e.R7$(),e.Lme("",t.member.countryCode," ",t.member.phone)}}function mt(n,a){if(1&n&&(e.j41(0,"td",56)(1,"mat-card",68)(2,"div",69),e.DNE(3,pt,1,2,"mat-checkbox",53),e.k0s(),e.j41(4,"span",70)(5,"B"),e.EFF(6,"Name : "),e.k0s()(),e.EFF(7),e.nrm(8,"br"),e.j41(9,"span",70)(10,"B"),e.EFF(11,"Phone : "),e.k0s()(),e.DNE(12,ct,2,2,"span",3)(13,dt,2,2,"span",3),e.nrm(14,"br"),e.j41(15,"span",70)(16,"B"),e.EFF(17,"Pending Approvals : "),e.k0s()(),e.EFF(18),e.nrm(19,"br"),e.j41(20,"span",70)(21,"B"),e.EFF(22,"Application Id : "),e.k0s()(),e.EFF(23),e.nrm(24,"br"),e.j41(25,"span",70)(26,"B"),e.EFF(27,"Status : "),e.k0s()(),e.EFF(28),e.nrm(29,"br"),e.j41(30,"span",70)(31,"B"),e.EFF(32,"Notes : "),e.k0s()(),e.EFF(33),e.nI1(34,"trimLength"),e.nrm(35,"br"),e.k0s()()),2&n){const t=a.$implicit,i=e.XpG(2);e.R7$(3),e.Y8G("ngIf",i.isSelectionEnabled),e.R7$(4),e.Lme("",t.member.firstName," ",t.member.lastName," "),e.R7$(5),e.Y8G("ngIf",null!=t.parents&&0!=t.parents.length&&!(null!=t.member.phone&&null!=t.member.phone&&""!=t.member.phone)),e.R7$(),e.Y8G("ngIf",null!=t.member.phone&&null!=t.member.phone&&""!=t.member.phone),e.R7$(5),e.SpI("",t.approvalsLeft," "),e.R7$(5),e.JRh(t.applicationId),e.R7$(5),e.SpI(" ",t.status," "),e.R7$(5),e.SpI("",e.i5U(34,9,t.notesToDisplay,50)," ")}}function ht(n,a){if(1&n){const t=e.RV6();e.j41(0,"tr",62),e.bIt("click",function(){o.eBV(t);const l=e.XpG(2);return o.Njj(l.onSortClick())}),e.k0s()}}function ut(n,a){if(1&n){const t=e.RV6();e.j41(0,"tr",63),e.bIt("click",function(){const l=o.eBV(t).$implicit,r=e.XpG(2);return o.Njj(r.getApprovalDetails(l.id))}),e.k0s()}}function _t(n,a){if(1&n&&(e.j41(0,"table",64),e.qex(1,65),e.DNE(2,st,2,0,"th",66)(3,mt,36,12,"td",35),e.bVm(),e.DNE(4,ht,1,0,"tr",46)(5,ut,1,0,"tr",47),e.k0s()),2&n){const t=e.XpG();e.Y8G("dataSource",t.dataSource),e.R7$(4),e.Y8G("matHeaderRowDef",t.displayedColumns1),e.R7$(),e.Y8G("matRowDefColumns",t.displayedColumns1)}}function gt(n,a){if(1&n&&e.nrm(0,"mat-paginator",48,0),2&n){const t=e.XpG();e.Y8G("length",t.dataSource.data.length)("pageIndex",t.pageIndex)("pageSize",t.pageSize)("pageSizeOptions",e.lJ4(4,Ne))}}class bt{status;page=1;pageSize=25}let B=class w{dialog;sharedService;router;service;userService;errorHandler;
1sharedDetailsNavService;localStorage;ngOnDestroy(){}paginator;sort;subscription=new h.yU;file=null;selection=new m.C(!0,[]);isBulkApproving=!1;constructor(a,t,i,l,r,p,x,kt,Dt,St){this.dialog=a,this.sharedService=t,this.router=i,this.service=l,this.userService=r,this.errorHandler=p,this.sharedDetailsNavService=x,this.localStorage=kt,this.mobileQuery=Dt.matchMedia("(max-width: 700px)"),this._mobileQueryListener=()=>St.detectChanges(),this.mobileQuery.addListener(this._mobileQueryListener)}displayedColumns=["select","name","phone","approvalsPending","applicationID","status","notesToDisplay"];displayedColumns1=["info"];dataSource=new _.I6;dataSourcePending=new _.I6;dataSourceRejected=new _.I6;dataSourceFailed=new _.I6;dataSourceEnrolled=new _.I6;pendingStatuses=["pending","readytolink","approved","submited"];columnsForDisplay=["userName","firstName","lastName","phone","applicationId"];approvalRequests=new Array;filterStatuses=new Array;filter="pending";selectedCompany$=new d.c;selectedCompany=new f.C;memberApproval=new bt;next=!1;pageIndex=0;pageSize=50;myRoles$=new d.c;myRoles=new Array;mobileQuery;_mobileQueryListener;ngOnInit(){this.pageIndex=0,this.pageSize=50,this.myRoles$=this.sharedService.getMyRoles,this.subscription.add(this.myRoles$.subscribe(a=>{this.myRoles=a})),this.myRoles.includes("ROLE_COMPANY_ADMIN")||this.myRoles.includes("ROLE_COACH_ENROLLMENT_ADMIN")?this.customNgOnInit():this.sharedService.navigateToNoPageFoundPage(),this.localStorage.get("selectedCompany").subscribe(a=>{this.selectedCompany=a})}ngAfterViewInit(){this.dataSource.paginator=this.paginator}customNgOnInit(){this.selectedCompany$=this.sharedService.getLoggedInCompany,this.subscription.add(this.selectedCompany$.subscribe(a=>{null==a&&null==a||(this.sharedDetailsNavService.approvalCancelButtonClicked?(this.sharedDetailsNavService.approvalCancelButtonClicked=!1,this.dataSource=this.sharedDetailsNavService.datasourseApproval,this.filterStatuses=this.sharedDetailsNavService.filterStatuses,this.filter=this.sharedDetailsNavService.filter,new k.u(this.dataSource).overrrideFilterPredicate(this.columnsForDisplay),this.pageSize=this.sharedDetailsNavService.datasourseApproval.paginator.pageSize,this.pageIndex=this.sharedDetailsNavService.datasourseApproval.paginator.pageIndex,console.log("PageIndex is",this.sharedDetailsNavService.datasourseApproval.paginator.pageIndex),this.dataSource.paginator=this.paginator):(this.sharedDetailsNavService.approvalCancelButtonClicked=!1,this.filter="pending",this.getAllByPagination(this.pendingStatuses)))}))}getAllByPagination(a){this.next=!1,this.selection.clear(),this.memberApproval.status=a,this.memberApproval.page=this.pageIndex+1,this.memberApproval.pageSize=this.pageSize,this.subscription.add(this.selectedCompany$.subscribe(t=>{(null!=t||null!=t)&&this.service.getAll(t,this.memberApproval).subscribe(i=>{for(console.log("response returned"),this.approvalRequests=i.enrollmentSearchByPagination.enrollmentApplicationDetails,null!=this.approvalRequests&&this.approvalRequests.length>0&&(0===this.pageIndex&&(this.dataSource.data=[],this.dataSourcePending.data=[],this.dataSourceRejected.data=[],this.dataSourceFailed.data=[],this.dataSourceEnrolled.data=[]),a==this.pendingStatuses?(this.dataSourcePending.data=this.dataSourcePending.data.concat(this.approvalRequests),this.dataSource.data=this.dataSourcePending.data):a.includes("rejected")?(this.dataSourceRejected.data=this.dataSourceRejected.data.concat(this.approvalRequests),this.dataSource.data=this.dataSourceRejected.data):a.includes("failed")?(this.dataSourceFailed.data=this.dataSourceFailed.data.concat(this.approvalRequests),this.dataSource.data=this.dataSourceFailed.data):a.includes("enrolled")&&(this.dataSourceEnrolled.data=this.dataSourceEnrolled.data.concat(this.approvalRequests),this.dataSource.data=this.dataSourceEnrolled.data)),this.next=i.enrollmentSearchByPagination.next,console.log("Next "+this.next);!0===this.next;)this.pageIndex=this.pageIndex+1,this.getAllByPagination(this.memberApproval.status)},i=>{console.error("error during call to this.service.getAll() ",i)},()=>{console.log("on completion - set first page"),new k.u(this.dataSource).overrrideFilterPredicate(),this.dataSource.paginator=this.paginator,this.sharedDetail
1sNavService.datasourseApproval=this.dataSource,this.dataSource.paginator?.firstPage()})}))}adjustRequests(a){null!=a&&null!=a&&a.forEach(t=>{"failed"==t.status?t.notesToDisplay=t.failureReason:"rejected"==t.status&&(t.notesToDisplay=t.rejectionReason),null!=t.sendSMS&&t.sendSMS&&(t.notesToDisplay=t.notesToDisplay+" ("+t.smsText+")")})}applyFilter(a){this.dataSource.filter=a.trim().toLowerCase(),this.dataSource.paginator&&this.dataSource.paginator.firstPage()}onReset(){this.applyFilter(""),this.sharedDetailsNavService.approvalSearchText=""}getApprovalDetails(a){this.sharedService.viewApprovalId=a,this.router.navigate(["/approvals-view"],{skipLocationChange:!0}),this.sharedDetailsNavService.datasourseApproval=this.dataSource,this.dataSource.paginator=this.paginator,this.sharedDetailsNavService.approvalCancelButtonClicked=!1,this.sharedDetailsNavService.filterStatuses=this.filterStatuses,this.sharedDetailsNavService.filter=this.filter}onFilterChange(a){this.sharedDetailsNavService.approvalSearchText=null;let t=new Array;for(var i in this.filterStatuses)this.filterStatuses[i]&&("pending"==i?this.pendingStatuses.forEach(l=>{t.push(l)}):t.push(i));this.getAllByPagination(t)}onSortClick(){this.dataSource.sortingDataAccessor=(a,t)=>{switch(t){case"name":return a.member.firstName+" "+a.member.middleName+" "+a.member.lastName;case"phone":return a.member.phone;case"approvalsPending":return a.approvalsLeft;case"applicationID":return a.applicationId;case"status":case"notesToDisplay":return a.status;default:return a[t]}},this.dataSource.sort=this.sort}onFilechange(a){this.file=a.target.files[0]}onload(){this.dialog.open(K,{disableClose:!0}).afterClosed().subscribe(t=>{setTimeout(()=>{this.getAllByPagination(this.pendingStatuses)},5e3)})}filterApprovals(){this.updateDisplayedColumns(),this.dataSource.data=[],this.pageIndex=0,"pending"==this.filter?this.getAllByPagination(this.pendingStatuses):"rejected"==this.filter?this.getAllByPagination(["rejected"]):"failed"==this.filter?this.getAllByPagination(["failed"]):"enrolled"==this.filter&&this.getAllByPagination(["enrolled"])}get isSelectionEnabled(){return"pending"===this.filter}updateDisplayedColumns(){const a=["name","phone","approvalsPending","applicationID","status","notesToDisplay"];this.displayedColumns=this.isSelectionEnabled?["select",...a]:a}isRowSelectable(a){return this.isSelectionEnabled&&!!a?.id&&this.pendingStatuses.includes(String(a.status||""))}isAllSelected(){const a=this.getCurrentPageSelectableRows();return a.length>0&&a.every(t=>this.selection.isSelected(t))}isIndeterminate(){const a=this.getCurrentPageSelectableRows(),t=a.filter(i=>this.selection.isSelected(i)).length;return t>0&&t<a.length}toggleAllRows(a){if(!this.isSelectionEnabled)return;this.getCurrentPageSelectableRows().forEach(a?i=>this.selection.select(i):i=>this.selection.deselect(i))}onRowSelectionChange(a,t){this.isRowSelectable(a)&&(t?this.selection.select(a):this.selection.deselect(a))}hasNonPendingSelected(){return this.selection.selected.some(a=>!this.isRowSelectable(a))}get selectedApprovalCount(){return this.selection.selected.length}get bulkApproveSuccessMessage(){return this.selectedApprovalCount>0?`Approve Selected (${this.selectedApprovalCount})`:"Approve Selected"}openBulkApproveDialog(){if(!this.isSelectionEnabled||0===this.selection.selected.length||this.isBulkApproving)return;if(this.hasNonPendingSelected())return void this.errorHandler.showErrorMessage("Only pending applications can be approved.");const a=this.selection.selected.filter(r=>!!r.id),t=a.map(r=>r.id),i=a.map(r=>({id:r.id,applicationId:r.applicationId,name:`${r.member?.firstName||""} ${r.member?.lastName||""}`.trim()}));this.dialog.open(T,{width:"680px",maxWidth:"95vw",maxHeight:"90vh",autoFocus:!1,panelClass:"bulk-approve-dialog-panel",disableClose:!0,data:{selectedIds:t,selectedItems:i,selectedCompany:this.selectedCompany,onRemoveMember:r=>{const p=this.selection.selected.find(x=>x.id===r);p&&this.selection.deselect(p)}}}).afterClosed().subscribe(r=>{!r?.ids?.length||!r.approvalModel||this.submitBulkApprove(r)})}submitBulkApprove(a){this.isBulkApproving=!0,this.subscription.add(this.selectedCompany$.pipe((0,v.s)(1)).subscribe(t=>{t?this.subscription.add(this.userService.bulkApproveApplication(t,{...a.approvalModel,a
1pplicationIds:a.ids}).subscribe({next:i=>{this.isBulkApproving=!1;const l=this.getBulkApproveSummary(i,a.ids.length);if(this.selection.clear(),l.failed>0&&l.approved>0){const r=l.statusText?this.appendBulkApproveCounts(l.statusText,l.approved,l.failed):l.reason?`${l.approved} approved, ${l.failed} failed. ${l.reason}`:`${l.approved} approved, ${l.failed} failed.`;this.errorHandler.showSucessMessage(r)}else if(l.failed>0){const r=l.statusText?this.appendBulkApproveCounts(l.statusText,l.approved,l.failed):l.reason?`${l.failed} failed. ${l.reason}`:`${l.failed} failed.`;this.errorHandler.showErrorMessage(r)}else this.errorHandler.showSucessMessage(l.statusText?this.appendBulkApproveCounts(l.statusText,l.approved,l.failed):`${l.approved} approved.`);this.pageIndex=0,this.getAllByPagination(this.pendingStatuses)},error:()=>{this.isBulkApproving=!1,this.errorHandler.showErrorMessage("Approve failed.")}})):this.isBulkApproving=!1}))}getBulkApproveSummary(a,t){if(!a||"object"!=typeof a)return{approved:t,failed:0};const i=this.getCountValue(a.approvedCount)??this.getCountValue(a.successCount)??this.getArrayCount(a.approvedIds)??this.getArrayCount(a.successIds),l=this.getCountValue(a.failedCount)??this.getCountValue(a.failureCount)??this.getArrayCount(a.failedIds)??this.getArrayCount(a.failureIds),r=this.getFailureReason(a.failures),p=this.getStatusText(a.statusText);return null!=i&&null!=l?{approved:i,failed:l,reason:r,statusText:p}:null!=i?{approved:i,failed:Math.max(0,t-i),reason:r,statusText:p}:null!=l?{approved:Math.max(0,t-l),failed:l,reason:r,statusText:p}:{approved:t,failed:0,reason:r,statusText:p}}getCountValue(a){return"number"!=typeof a||Number.isNaN(a)?null:a}getArrayCount(a){return Array.isArray(a)?a.length:null}getFailureReason(a){if(!Array.isArray(a)||0===a.length)return;const t=a[0];return"string"==typeof t?.reason&&""!==t.reason.trim()?t.reason.trim():void 0}getStatusText(a){return"string"==typeof a&&""!==a.trim()?a.trim():void 0}appendBulkApproveCounts(a,t,i){return`${a} (${t} approved${i>0?`, ${i} failed`:""})`}getCurrentPageSelectableRows(){const a=this.dataSource.filteredData||this.dataSource.data||[];let t=a;if(this.paginator){const i=this.paginator.pageIndex*this.paginator.pageSize;t=a.slice(i,i+this.paginator.pageSize)}return t.filter(i=>this.isRowSelectable(i))}static \u0275fac=function(t){return new(t||w)(e.rXU(I.bZ),e.rXU(Y.d),e.rXU(Fe.Ix),e.rXU(X.r),e.rXU(Ie.D),e.rXU(Te._),e.rXU(Re.X),e.rXU(G.AX),e.rXU(ye.D),e.rXU(Me.gRc))};static \u0275cmp=e.VBU({type:w,selectors:[["app-approval-table"]],viewQuery:function(t,i){if(1&t&&(e.GBs(u.iy,5),e.GBs(A.B4,5)),2&t){let l;e.mGM(l=e.lsd())&&(i.paginator=l.first),e.mGM(l=e.lsd())&&(i.sort=l.first)}},standalone:!1,decls:9,vars:5,consts:[["paginator",""],[1,"grid-container"],[1,"mat-elevation-z8","mat-card","entity_table",2,"margin-top","2%","padding-top","0"],[4,"ngIf"],["mat-table","","class","full-width-table","matSort","","aria-label","Elements","style","width: 100%;",3,"dataSource",4,"ngIf"],[3,"length","pageIndex","pageSize","pageSizeOptions",4,"ngIf"],[1,"screen-header-row"],[1,"screen-title"],[1,"screen-title-actions"],[1,"screen-toolbar-row"],[1,"screen-toolbar-left"],[1,"screen-search-field"],["matInput","","placeholder","Search",3,"keyup","ngModelChange","ngModel"],["mat-icon-button","","matSuffix","","matTooltip","Clear search field",1,"exitBtn","pointer",3,"click"],[1,"screen-toolbar-center","screen-toolbar-item"],["aria-label","Select an option",3,"ngModelChange","ngModel"],["value","pending","color","primary"],["value","rejected","color","primary"],["value","failed","color","primary"],["value","enrolled","color","primary"],[1,"screen-toolbar-right"],["mat-raised-button","","color","primary","class","bulk-approve-btn","matTooltip","Approve selected pending applications",3,"disabled","click",4,"ngIf"],["mat-icon-button","","color","primary","matTooltip","Upload",3,"click"],["mat-raised-button","","color","primary","matTooltip","Approve selected pending applications",1,"bulk-approve-btn",3,"click","disabled"],[2,"margin-left","2%","float","left"],[2,"margin-right","2%","float","left","margin-left","5%","margin-top","1%"],["mat-raised-button","","color","primary","style","margin-right:8px;",3,"disabled","click",4,"ngIf"],["mat-raised-button","","color","white",3,"click"],["mat-raised-button","","color","primary",2,"margin-right","8px",3,"click","disabled"],["mat-table","","matSort","","aria-label","Elements",1,"full-width-table",3,"dataSource"],["matColumnDef","select"],["mat-header-cell","","width","4%",4,"matHeaderCellDef"],["mat-cell","",3,"click",4,"matCellDef"],["matColumnDef","name"],["mat-header-cell","","width","20%","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","phone"],["mat-header-cell","","width","15%","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","approvalsPending"],["mat-cell","","style","text-align: center",4,"matCellDef"],["matColumnDef","applicationID"],["matColumnDef","status"],["mat-header-cell","","width","10%","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","notesToDisplay"],["mat-header-cell","","width","40%","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",3,"matTooltip",4,"matCellDef"],["mat-header-row","",3,"click",4,"matHeaderRowDef"],["mat-row","","class","pointer",3,"click",4,"matRowDef","matRowDefColumns"],[3,"length","pageIndex","pageSize","pageSizeOptions"],["mat-header-cell","","width","4%"],["color","primary",3,"checked","indeterminate","change","click",4,"ngIf"],["color","primary",3,"change","click","checked","indeterminate"],["mat-cell","",3,"click"],["color","primary",3,"checked","disabled","change","click",4,"ngIf"],["color","primary",3,"change","click","checked","disabled"],["mat-header-cell","","width","20%","mat-sort-header",""],["mat-cell",""],["mat-header-cell","","width","15%","mat-sort-header",""],["mat-cell","",2,"text-align","center"],["mat-header-cell","","width","10%","mat-sort-header",""],["mat-header-cell","","width","40%","mat-sort-header",""],["mat-cell","",3,"matTooltip"],["mat-header-row","",3,"click"],["mat-row","",1,"pointer",3,"click"],["mat-table","","matSort","","aria-label","Elements",1,"full-width-table",2,"width","100%",3,"dataSource"],["matColumnDef","info"],["mat-header-cell","","width","20%","mat-sort-header","","style","text-align:center",4,"matHeaderCellDef"],["mat-header-cell","","width","20%","mat-sort-header","",2,"text-align","center"],[2,"background-color","rgba(0,0,0,.05)","margin-bottom","2%"],[2,"display","flex","justify-content","space-between","align-items","flex-start","margin-bottom","6px"],[2,"color","rgb(47, 47, 163)"]],template:function(t,i){1&t&&(e.j41(0,"div",1)(1,"mat-card",2)(2,"div"),e.DNE(3,Ge,31,3,"div",3)(4,$e,20,3,"div",3)(5,rt,27,8,"div",3),e.k0s()()(),e.j41(6,"div"),e.DNE(7,_t,6,3,"table",4)(8,gt,2,5,"mat-paginator",5),e.k0s()),2&t&&(e.R7$(3),e.Y8G("ngIf",!i.mobileQuery.matches),e.R7$(),e.Y8G("ngIf",i.mobileQuery.matches),e.R7$(),e.Y8G("ngIf",!i.mobileQuery.matches),e.R7$(2),e.Y8G("ngIf",i.mobileQuery.matches),e.R7$(),e.Y8G("ngIf",i.mobileQuery.matches))},dependencies:[g.bT,y.$z,O.iY,$.So,j.An,je.RN,_.Zl,_.tL,_.ji,_.cC,_.YV,_.iL,_.KS,_.$R,_.YZ,_.NB,u.iy,A.B4,A.aE,M.rl,M.yw,U.fg,J.VT,J._g,C.me,C.BC,C.vS,L.oV,Ee.D,Pe.O],styles:[".bulk-approve-btn[_ngcontent-%COMP%]{margin-right:8px} .bulk-approve-dialog-panel .mat-mdc-dialog-container, .bulk-approve-dialog-panel .mat-dialog-container{padding:12px 16px!important;max-height:90vh;overflow:hidden} .bulk-approve-dialog-panel{width:min(680px,95vw)!important;max-width:95vw!important}"]})};B=(0,b.Cg)([c.P],B);
1const ft=[{path:"",component:B}];let vt=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=e.$C({type:n});static \u0275inj=o.G2t({imports:[S.iI.forChild(ft),S.iI]})}return n})(),Ct=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=e.$C({type:n});static \u0275inj=o.G2t({imports:[g.MD,vt,V.g,T]})}return n})()}}]);
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.