1"use strict";(self.webpackChunkmetronic=self.webpackChunkmetronic||[]).push([[766],{30766:(An,ot,l)=>{l.r(ot),l.d(ot,{AssignmentModule:()=>Tn});var f=l(94666),C=l(64346),Nt=l(88550),S=l(84522),St=l(82156),B=l(44792),U=l(42298),b=l(31484),P=l(57822),V=l(31267),Ot=l(88589),O=l(70207),G=l(36060),rt=l(51294),tt=l(61708),xt=l(52922),J=l(57371),lt=l(10930),Y=l(92197),h=l(8711),Rt=l(15892),M=l(6896),yt=l(58987),H=l(28945),u=l(2508),p=l(725),v=l(33935),F=l(17007),Dt=l(84666),L=l(84505),d=l(13401),Z=l(90949),y=l(68222),I=l(21369),K=l(25843),t=l(22560),k=l(17795),Q=l(5617),q=l(58765),$=l(1317),N=l(75074),Ut=l(74536),Mt=l(50673);function Ft(i,a){if(1&i){const o=t.EpF();t.TgZ(0,"a",6),t.NdJ("click",function(){t.CHM(o);const n=t.oxw();return t.KtG(n.onSubmit())}),t.ALo(1,"translate"),t.TgZ(2,"span",3),t._uU(3),t.ALo(4,"translate"),t.qZA()()}if(2&i){const o=t.oxw();t.Q6J("disabled",!o.isFormValid())("matTooltip",t.lcZ(1,3,"GENERAL.TOOLTIP.SAVE")),t.xp6(3),t.Oqu(t.lcZ(4,5,"GENERAL.BUTTON.SAVE"))}}function kt(i,a){if(1&i&&(t.TgZ(0,"mat-option",27),t._uU(1),t.qZA()),2&i){const o=a.$implicit;t.Q6J("value",o.id),t.xp6(1),t.Oqu(o.full_name)}}function Pt(i,a){if(1&i&&(t.TgZ(0,"mat-option",27),t._uU(1),t.qZA()),2&i){const o=a.$implicit;t.Q6J("value",o.id),t.xp6(1),t.Oqu(o.name)}}const wt=function(i){return{readonly:i}},et=function(i){return{field:i}};function Gt(i,a){if(1&i){const o=t.EpF();t.TgZ(0,"form",7)(1,"div",8)(2,"div",9)(3,"div",10)(4,"mat-form-field",11),t._UZ(5,"input",12),t.ALo(6,"translate"),t.TgZ(7,"mat-hint",13),t._uU(8," Assignment ID "),t.TgZ(9,"span"),t._uU(10,"required"),t.qZA()(),t._UZ(11,"mat-error",14),t.ALo(12,"translate"),t.ALo(13,"translate"),t.qZA()(),t.TgZ(14,"div",10)(15,"mat-form-field",15)(16,"span",16),t.NdJ("click",function(){t.CHM(o);const n=t.MAs(21);return t.KtG(n.open())}),t._UZ(17,"input",17),t.ALo(18,"translate"),t.qZA(),t._UZ(19,"mat-datepicker-toggle",18)(20,"mat-datepicker",null,19),t.qZA()(),t.TgZ(22,"div",10)(23,"mat-form-field",11)(24,"mat-select",20),t.ALo(25,"translate"),t.YNc(26,kt,2,2,"mat-option",21),t.qZA(),t.TgZ(27,"mat-hint",13),t._uU(28," Project Manager "),t.TgZ(29,"span"),t._uU(30,"required"),t.qZA()(),t._UZ(31,"mat-error",14),t.ALo(32,"translate"),t.ALo(33,"translate"),t.qZA()(),t.TgZ(34,"div",10)(35,"mat-form-field",11)(36,"mat-select",22),t.ALo(37,"translate"),t.YNc(38,Pt,2,2,"mat-option",21),t.qZA(),t.TgZ(39,"mat-hint",13),t._uU(40," Agency "),t.TgZ(41,"span"),t._uU(42,"required"),t.qZA()(),t._UZ(43,"mat-error",14),t.ALo(44,"translate"),t.ALo(45,"translate"),t.qZA()()(),t.TgZ(46,"div",9)(47,"div",23)(48,"mat-form-field",11),t._UZ(49,"textarea",24),t.ALo(50,"translate"),t.TgZ(51,"mat-icon",25),t.NdJ("click",function(n){return n.stopPropagation()}),t.ALo(52,"translate"),t.ALo(53,"translate"),t._uU(54,"help "),t.qZA(),t.TgZ(55,"mat-hint",13),t._uU(56," Point of Contact "),t.TgZ(57,"span"),t._uU(58,"required"),t.qZA()(),t.TgZ(59,"mat-error"),t._uU(60," Point of Contact "),t.TgZ(61,"strong"),t._uU(62,"required"),t.qZA()()()(),t.TgZ(63,"div",23)(64,"mat-form-field",11)(65,"textarea",26),t.ALo(66,"translate"),t._uU(67," "),t.qZA(),t.TgZ(68,"mat-icon",25),t.NdJ("click",function(n){return n.stopPropagation()}),t.ALo(69,"translate"),t.ALo(70,"translate"),t._uU(71,"help "),t.qZA(),t.TgZ(72,"mat-hint",13),t._uU(73," Description "),t.TgZ(74,"span"),t._uU(75,"required"),t.qZA()(),t.TgZ(76,"mat-error"),t._uU(77," Description "),t.TgZ(78,"strong"),t._uU(79,"required"),t.qZA()()()()()()()}if(2&i){const o=t.MAs(21),e=t.oxw();t.Q6J("formGroup",e.assignmentForm)("ngClass",t.VKq(64,wt,e.readonly)),t.xp6(4),t.Q6J("formFieldState",e.assignmentForm.controls.name),t.xp6(1),t.Q6J("placeholder",t.lcZ(6,29,"ASSIGNMENT.FORM.FIELD.GENERAL.NAME.PLACEHOLDER")),t.xp6(2),t.Q6J("formFieldHintState",e.assignmentForm.controls.name),t.xp6(4),t.Q6J("innerHtml",t.xi3(12,31,"GENERAL.VALIDATION.REQUIRED",t.VKq(66,et,t.lcZ(13,34,"ASSIGNMENT.FORM.FIELD.GENERAL.NAME.NAME"))),t.oJD),t.xp6(6),t.Q6J("matDatepicker",o)("placeholder",t.lcZ(18,36,"ASSIGNMENT.FORM.FIELD.GENERAL.INSERTION_DATE.PLACEHOLDER")),t.xp6(2),t.Q6J("for",o),t.xp6(4),t.Q6J("formFieldState",e.assignmentForm.controls.valuer_id),t.xp6(1),t.Q6J("placeholder",t.lcZ(25,38,"ASSIGNMENT.FORM.FIELD.GENERAL.VALUER.PLACEHOLDER")),t.xp6(2),t.Q6J("ngForOf",e.valuers),t.xp6(1),t.Q6J("formFieldHintState",e.assignmentForm.controls.valuer_id),t.xp6(4),t.Q6J("innerHtml",t.xi3(32,40,"GENERAL.VALIDATION.REQUIRED",t.VKq(68,et,t.lcZ(33,43,"ASSIGNMENT.FORM.FIELD.GENERAL.VALUER.NAME"))),t.oJD),t.xp6(4),t.Q6J("formFieldState",e.assignmentForm.controls.agency_id),t.xp6(1),t.Q6J("placeholder",t.lcZ(37,45,"ASSIGNMENT.FORM.FIELD.GENERAL.AGENCY.PLACEHOLDER")),t.xp6(2),t.Q6J("ngForOf",e.agencies),t.xp6(1),t.Q6J("formFieldHintState",e.assignmentForm.controls.agency_id),t.xp6(4),t.Q6J("innerHtml",t.xi3(44,47,"GENERAL.VALIDATION.REQUIRED",t.VKq(70,et,t.lcZ(45,50,"ASSIGNMENT.FORM.FIELD.GENERAL.AGENCY.NAME"))),t.oJD),t.xp6(5),t.Q6J("formFieldState",e.assignmentForm.controls.pointOfContact),t.xp6(1),t.Q6J("placeholder",t.lcZ(50,52,"ASSIGNMENT.FORM.FIELD.GENERAL.POINT_OF_CONTACT.PLACEHOLDER")),t.xp6(2),t.Q6J("ngbPopover",t.lcZ(52,54,"TOOLTIP.ASSIGNMENT.FORM_FIELD.POINT_OF_CONTACT.DESCRIPTION"))("popoverTitle",t.lcZ(53,56,"TOOLTIP.ASSIGNMENT.FORM_FIELD.POINT_OF_CONTACT.TITLE")),t.xp6(4),t.Q6J("formFieldHintState",e.assignmentForm.controls.pointOfContact),t.xp6(9),t.Q6J("formFieldState",e.assignmentForm.controls.description),t.xp6(1),t.Q6J("placeholder",t.lcZ(66,58,"ASSIGNMENT.FORM.FIELD.GENERAL.DESCRIPTION.PLACEHOLDER")),t.xp6(3),t.Q6J("ngbPopover",t.lcZ(69,60,"TOOLTIP.ASSIGNMENT.FORM_FIELD.DESCRIPTION.DESCRIPTION"))("popoverTitle",t.lcZ(70,62,"TOOLTIP.ASSIGNMENT.FORM_FIELD.DESCRIPTION.TITLE")),t.xp6(4),t.Q6J("formFieldHintState",e.assignmentForm.controls.description)}}const Jt=function(i){return{back_page:i}};let ct=(()=>{const a=class{constructor(e,n,s,r,c,m,T,g,_,E,A){this.activatedRoute=e,this.router=n,this.fb=s,this.location=r,this.subheaderService=c,this.typesUtilsService=m,this.layoutUtilsService=T,this.store=g,this.ref=_,this.layoutConfigService=E,this.translate=A,this.isExistAss=new L.X(!1),this.valuers=[],this.agencies=[],this.hasFormErrors=!1,this.saveState=!1,this.subscriptions=[],this.readonly=!1}ngOnInit(){this.loading$=this.store.pipe((0,p.Ys)(d.hE));const e=this.activatedRoute.params.subscribe(r=>{const c=r.id;if(c&&c>0){const m=this.store.pipe((0,p.Ys)((0,d.DA)(c))).subscribe(T=>{T&&(this.oldAssignment=Object.assign({},T),this.assignment=Object.assign({},this.oldAssignment),this.readonly=2==this.assignment.status,this.isExistAss.next(!0),this.createForm())});this.subscriptions.push(m)}
1else this.oldAssignment=new d.tC,this.oldAssignment.clear(),this.assignment=Object.assign({},this.oldAssignment),this.isExistAss.next(!0),this.createForm()});this.subscriptions.push(e),this.store.dispatch(new Z.WK({roleId:2}));const n=this.store.pipe((0,p.Ys)(Z.CJ)).subscribe(r=>{this.valuers=[],r&&(this.valuers=r.items.filter(c=>null!=c.qualification_id&&null!=c.qualification_id),this.ref.detectChanges())});this.subscriptions.push(n),this.store.dispatch(new y.jqq);const s=this.store.pipe((0,p.Ys)(y.hN$)).subscribe(r=>{this.agencies=[],r&&(this.agencies=r,this.ref.detectChanges())});this.subscriptions.push(s)}ngOnDestroy(){this.subscriptions.forEach(e=>{e.unsubscribe()})}createForm(){if(this.assignmentForm=this.fb.group({name:[this.assignment.name,u.kI.required],valuer_id:[this.assignment.valuer_id,u.kI.required],agency_id:[this.assignment.agency_id,u.kI.required],pointOfContact:[this.assignment.pointOfContact,u.kI.required],description:[this.assignment.description,u.kI.required],insertion_date:[{value:this.typesUtilsService.getDateFromString(this.assignment.insertion_date),disabled:!0},u.kI.required]}),this.assignment.id)return this.subheaderService.setTitle("Add Assignment"),void this.subheaderService.setBreadcrumbs([{title:"Main menu",page:"../default/assignment"},{title:"Assignments",page:"../default/assignment/assignments"},{title:"Edit assignment",page:"../default/assignment/assignments/edit"}]);this.subheaderService.setTitle("Edit Assignment"),this.subheaderService.setBreadcrumbs([{title:"Main menu",page:"../default/assignment"},{title:"Assignments",page:"../default/assignment/assignments"},{title:"Add assignment",page:"../default/assignment/assignments/add"}])}getComponentTitle(){return this.assignment&&this.assignment.id?this.translate.instant("ASSIGNMENT.FORM.TITLE.EDIT",{name:this.assignment.name}):this.translate.instant("ASSIGNMENT.FORM.TITLE.NEW")}back(){this.location.back()}isControlInvalid(e){const n=this.assignmentForm.controls[e];return n.invalid&&n.touched}prepareAssignment(){const e=this.assignmentForm.controls,n=new d.tC;n.clear(),n.id=this.assignment.id;const s=e.insertion_date.value;return s&&(n.insertion_date=this.typesUtilsService.dateFormat(s)),n.name=e.name.value,n.valuer_id=e.valuer_id.value,n.agency_id=e.agency_id.value,n.pointOfContact=e.pointOfContact.value,n.description=e.description.value,n}isFormValid(){if(!this.assignmentForm)return!1;const e=this.assignmentForm.controls,n=e.name.value;return e.insertion_date.value&&n&&n.length>0&&e.valuer_id.value&&e.agency_id.value}onSubmit(){this.hasFormErrors=!1;const e=this.assignmentForm.controls;if(this.assignmentForm.invalid)return Object.keys(e).forEach(s=>e[s].markAsTouched()),void(this.hasFormErrors=!0);const n=this.prepareAssignment();n.id>0?this.updateAssignment(n):this.createAssignment(n)}updateAssignment(e){this.store.dispatch(new d.bq({partialAssignment:{id:e.id,changes:e},assignment:e})),this.saveState=!0,this.oldAssignment=e,this.layoutUtilsService.showActionNotification(this.translate.instant("GENERAL.MESSAGE.SAVE_CHANGES"),I.Cs.Update,3e3,!0,!1),this.router.navigate(["../../",this.oldAssignment.id,"toes"],{relativeTo:this.activatedRoute})}createAssignment(e){this.store.dispatch(new d.r$({assignment:e})),this.oldAssignment=e;const n=this.store.pipe((0,p.Ys)(d.vR),(0,K.g)(1e3)).subscribe(s=>{s&&(this.saveState=!0,this.router.navigate(["..",s,"toes"],{relativeTo:this.activatedRoute}))});this.subscriptions.push(n)}reset(){this.assignment=Object.assign({},this.oldAssignment),this.createForm(),this.hasFormErrors=!1,this.assignmentForm.markAsPristine(),this.assignmentForm.markAsUntouched(),this.assignmentForm.updateValueAndValidity()}onAlertClose(e){this.hasFormErrors=!1}canDeactivate(){if(this.discard()){if(window.confirm(this.translate.instant("GENERAL.MESSAGE.LOST_CHANGES")))return!0;{const n=this.router.createUrlTree([],this.activatedRoute.snapshot).toString();return this.location.go(n),!1}}return!0}discard(){const e=this.prepareAssignment();return!this.saveState&&(e.name!=this.oldAssignment.name||e.valuer_id!=this.oldAssignment.valuer_id||e.agency_id!=this.oldAssignment.agency_id||e.pointOfContact!=this.oldAssignment.pointOfContact||e.description!=this.oldAssignment.description)}beforeUnloadHander(e){this.discard()&&(e.preventDefault(),e.returnValue="test")}};let i=a;return a.\u0275fac=function(n){return new(n||a)(t.Y36(C.gz),t.Y36(C.F0),t.Y36(u.QS),t.Y36(f.Ye),t.Y36(k.b8),t.Y36(I.mz),t.Y36(I.eb),t.Y36(p.yh),t.Y36(t.sBO),t.Y36(k.JJ),t.Y36(v.sK))}
1,a.\u0275cmp=t.Xpm({type:a,selectors:[["kt-assignment-edit"]],hostBindings:function(n,s){1&n&&t.NdJ("beforeunload",function(c){return s.beforeUnloadHander(c)},!1,t.Jf7)},decls:17,vars:25,consts:[[3,"title","tooltipTitle","tooltipDesc","viewLoading$"],["ktPortletTools",""],["href","javascript:;","mat-raised-button","",1,"btn","mr-2",3,"matTooltip","click"],[1,"kt-hidden-mobile"],["href","javascript:;","class","btn btn-success mr-2","color","submit","mat-raised-button","",3,"disabled","matTooltip","click",4,"ngIf"],["class","kt-form",3,"formGroup","ngClass",4,"ngIf"],["href","javascript:;","color","submit","mat-raised-button","",1,"btn","btn-success","mr-2",3,"disabled","matTooltip","click"],[1,"kt-form",3,"formGroup","ngClass"],[1,"kt-portlet__body"],[1,"form-group","kt-form__group","row"],[1,"col-lg-6","kt-margin-bottom-20-mobile"],[1,"mat-form-field-fluid",3,"formFieldState"],["matInput","","formControlName","name",3,"placeholder"],[3,"formFieldHintState"],[3,"innerHtml"],[1,"mat-form-field-fluid"],[3,"click"],["matInput","","formControlName","insertion_date",3,"matDatepicker","placeholder"],["matSuffix","",3,"for"],["picker",""],["formControlName","valuer_id",3,"placeholder"],[3,"value",4,"ngFor","ngForOf"],["formControlName","agency_id",3,"placeholder"],[1,"col-md-12","kt-margin-bottom-10-mobile"],["matInput","","rows","4","formControlName","pointOfContact",3,"placeholder"],["matSuffix","","container","body",1,"cursor-pointer",3,"ngbPopover","popoverTitle","click"],["matInput","","rows","4","formControlName","description",3,"placeholder"],[3,"value"]],template:function(n,s){1&n&&(t.TgZ(0,"kt-portlet")(1,"kt-portlet-header",0),t.ALo(2,"translate"),t.ALo(3,"translate"),t.ynx(4,1),t.TgZ(5,"a",2),t.NdJ("click",function(){return s.back()}),t.ALo(6,"translate"),t.ALo(7,"translate"),t.TgZ(8,"mat-icon"),t._uU(9,"arrow_back"),t.qZA(),t.TgZ(10,"span",3),t._uU(11),t.ALo(12,"translate"),t.qZA()(),t.YNc(13,Ft,5,7,"a",4),t.BQk(),t.qZA(),t.TgZ(14,"kt-portlet-body"),t.YNc(15,Gt,80,72,"form",5),t.ALo(16,"async"),t.qZA()()),2&n&&(t.xp6(1),t.Tol("kt-portlet__head--lg"),t.Q6J("title",s.getComponentTitle())("tooltipTitle",t.lcZ(2,10,"TOOLTIP.ASSIGNMENT.FORM"+(s.assignment&&s.assignment.id>0?"_EDIT":"")+".TITLE"))("tooltipDesc",t.lcZ(3,12,"TOOLTIP.ASSIGNMENT.FORM"+(s.assignment&&s.assignment.id>0?"_EDIT":"")+".DESCRIPTION"))("viewLoading$",s.loading$),t.xp6(4),t.Q6J("matTooltip",t.xi3(6,14,"GENERAL.TOOLTIP.BACK",t.VKq(23,Jt,t.lcZ(7,17,"ASSIGNMENT.LIST.TITLE")))),t.xp6(6),t.Oqu(t.lcZ(12,19,"GENERAL.BUTTON.BACK")),t.xp6(2),t.Q6J("ngIf",!s.readonly),t.xp6(2),t.Q6J("ngIf",t.lcZ(16,21,s.isExistAss)))},dependencies:[f.mk,f.sg,f.O5,Q.I,q.c,$.j,u._Y,u.Fj,u.JJ,u.JL,u.sg,u.u,S.zs,N.TO,N.KE,N.bx,N.R9,J.gD,O.ey,V.Nt,P.Hw,U.Mq,U.hl,U.nW,M.gM,F.o8,Ut.k,Mt.h,f.Ov,v.X$],styles:[".readonly[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%]{pointer-events:none}"]}),i})();var dt=l(17111);let mt=(()=>{const a=class{constructor(e,n){this.store=e,this.global=n}resolve(e){if(this.global.activeAssignmentId)return void this.store.dispatch(new d.oP({id:this.global.activeAssignmentId}));const n=Number(e.params.id);this.store.dispatch(new d.oP({id:n}))}};let i=a;return a.\u0275fac=function(n){return new(n||a)(t.LFG(p.yh),t.LFG(dt.O))},a.\u0275prov=t.Yz7({token:a,factory:a.\u0275fac}),i})();var Yt=l(42214),ut=l(62560),Qt=l(77118);let pt=(()=>{const a=class{constructor(e){this.global=e}resolve(e){const n=Number(e.paramMap.get("ass_id"));return this.global.activeAssignmentId=n,!0}};let i=a;return a.\u0275fac=function(n){return new(n||a)(t.LFG(dt.O))},a.\u0275prov=t.Yz7({token:a,factory:a.\u0275fac}),i})();var qt=l(34642),$t=l(333),jt=l(40619);let Bt=(()=>{const a=class{constructor(){}ngOnInit(){}};let i=a;return a.\u0275fac=function(n){return new(n||a)},a.\u0275cmp=t.Xpm({type:a,selectors:[["kt-assignment"]],decls:1,vars:0,template:function(n,s){1&n&&t._UZ(0,"router-outlet")},dependencies:[C.lC],encapsulation:2,changeDetection:0}),i})();var it=l(88759),ht=l(16276),gt=l(53298),x=l(83910),Tt=l(88623),_t=l(64139),At=l(11755),Vt=l(75026),ft=l(92938),j=l(29847),Ht=l(19193),z=l(86942),Kt=l(59095),zt=l(44661);function Wt(i,a){1&i&&(t.TgZ(0,"div",23),t._UZ(1,"mat-progress-bar",24),t.qZA())}function Xt(i,a){if(1&i&&(t.ynx(0),t.TgZ(1,"mat-option",25),t._uU(2),t.qZA(),t.BQk()),2&i){const o=a.$implicit;t.xp6(1),t.Q6J("value",o.value),t.xp6(1),t.hij(" ",o.label," ")}}function te(i,a){if(1&i&&(t.ynx(0),t.TgZ(1,"mat-option",25),t._uU(2),t.qZA(),t.BQk()),2&i){const o=a.$implicit;t.xp6(1),t.Q6J("value",o.value),t.xp6(1),t.hij(" ",o.label," ")}}
1function ee(i,a){if(1&i){const o=t.EpF();t.TgZ(0,"div",26)(1,"mat-checkbox",27),t.NdJ("change",function(n){const r=t.CHM(o).$implicit,c=t.oxw();return t.KtG(c.onToeSelected(n,r))}),t._uU(2),t.qZA()()}if(2&i){const o=a.$implicit;t.xp6(1),t.Q6J("checked",o.checked),t.xp6(1),t.hij(" ",o.name," ")}}let ie=(()=>{const a=class{constructor(e,n,s,r,c){this.dialogRef=e,this.data=n,this.formBuilder=s,this.store=r,this.service=c,this.toeLoading$=new L.X(!0),this.submitting$=new L.X(!1),this.loading$=(0,Ht.aj)([this.toeLoading$,this.submitting$]).pipe((0,z.U)(([m,T])=>m||T)),this.title$=new L.X(""),this.form=this.formBuilder.group({name:["",[u.kI.required]],project_manager_id:[0,[u.kI.required]],agency_id:[0,[u.kI.required]]}),this.users$=this.store.select(Z.CJ).pipe((0,z.U)(m=>m.items.map(T=>({value:T.id,label:T.full_name})))),this.agencies$=this.store.select(y.hN$).pipe((0,z.U)(m=>m.map(T=>({value:T.id,label:T.name})))),this.selectedToes$=new L.X([]),this.toes$=this.service.getToesListing(this.data.assignment.id).pipe((0,it.b)(m=>this.toeLoading$.next(!1)),(0,Kt.w)(m=>this.selectedToes$.asObservable().pipe((0,z.U)(T=>m.data.map(g=>({id:g.id,name:g.name,checked:T.includes(g.id)})))))),this.store.dispatch(new Z.WK({roleId:2})),this.store.dispatch(new y.jqq),this.title$.next(`Duplicate Assignment: ${n.assignment.name}`),this.form.patchValue({project_manager_id:n.assignment.valuer_id,agency_id:n.assignment.agency_id})}ngOnInit(){}onToeSelected(e,{id:n}){const s=this.selectedToes$.value;if(e.checked)s.push(n);else{const r=s.findIndex(c=>c==n);s.splice(r,1)}this.selectedToes$.next(s)}onSubmit(){const e=this.form.controls;this.form.invalid?Object.keys(e).forEach(n=>e[n].markAsTouched()):(this.submitting$.next(!0),this.service.duplicateAssignment({name:e.name.value??"",assignment_id:this.data.assignment.id,project_manager_id:e.project_manager_id.value??0,agency_id:e.agency_id.value??0,selectedToeIds:this.selectedToes$.value}).pipe((0,zt.x)(()=>this.submitting$.next(!1))).subscribe({next:n=>{this.dialogRef.close("success")},error:n=>console.error("Error:",n)}))}onClose(){this.dialogRef.close()}};let i=a;return a.\u0275fac=function(n){return new(n||a)(t.Y36(b.so),t.Y36(b.WI),t.Y36(u.qu),t.Y36(p.yh),t.Y36(d.FM))}
1,a.\u0275cmp=t.Xpm({type:a,selectors:[["kt-duplicate-assignment-dialog"]],decls:52,vars:17,consts:[[1,"card","card-custom"],["class","card-body-progress card-body-progress-overlay",4,"ngIf"],[1,"card-header"],[1,"card-title"],[1,"card-label"],[1,"card-toolbar"],[3,"matTooltip"],[1,"btn","btn-icon","btn-sm","btn-success","mr-2","p-1",2,"width","80px",3,"click"],[1,"btn","btn-icon","btn-sm","btn-light-warning","p-1",3,"click"],[1,"ki","ki-close","icon-nm"],[1,"form",3,"formGroup"],[1,"card-body"],[1,"form-group","kt-form-group"],[1,"row"],[1,"col-6","kt-margin-bottom-20-mobile"],[1,"mat-form-field-fluid"],["matInput","","formControlName","name","placeholder","Assignment ID"],["formControlName","project_manager_id","placeholder","Project Manager"],[4,"ngFor","ngForOf"],["formControlName","agency_id","placeholder","Agency"],[1,"my-3","text-mad"],[1,"active"],["class","col-6",4,"ngFor","ngForOf"],[1,"card-body-progress","card-body-progress-overlay"],["mode","indeterminate"],[3,"value"],[1,"col-6"],[1,"toe_name",3,"checked","change"]],template:function(n,s){1&n&&(t.TgZ(0,"div",0),t.YNc(1,Wt,2,0,"div",1),t.ALo(2,"async"),t.TgZ(3,"div",2)(4,"div",3)(5,"h3",4),t._uU(6),t.ALo(7,"async"),t.qZA()(),t.TgZ(8,"div",5)(9,"span",6)(10,"button",7),t.NdJ("click",function(){return s.onSubmit()}),t._uU(11," Validate "),t.qZA()(),t.TgZ(12,"button",8),t.NdJ("click",function(){return s.onClose()}),t._UZ(13,"i",9),t.qZA()()(),t.TgZ(14,"div",10)(15,"div",11)(16,"mat-dialog-content")(17,"div",12)(18,"div",13)(19,"div",14)(20,"mat-form-field",15),t._UZ(21,"input",16),t.TgZ(22,"mat-error"),t._uU(23," Assignment ID is "),t.TgZ(24,"strong"),t._uU(25,"required"),t.qZA()()()()(),t.TgZ(26,"div",13)(27,"div",14)(28,"mat-form-field",15)(29,"mat-select",17),t.YNc(30,Xt,3,2,"ng-container",18),t.ALo(31,"async"),t.qZA(),t.TgZ(32,"mat-error"),t._uU(33," Project Manager is "),t.TgZ(34,"strong"),t._uU(35,"required"),t.qZA()()()(),t.TgZ(36,"div",14)(37,"mat-form-field",15)(38,"mat-select",19),t.YNc(39,te,3,2,"ng-container",18),t.ALo(40,"async"),t.qZA(),t.TgZ(41,"mat-error"),t._uU(42," Agency is "),t.TgZ(43,"strong"),t._uU(44,"required"),t.qZA()()()()()(),t.TgZ(45,"h5",20),t._uU(46," Choose which Terms of Engagement to include "),t.qZA(),t._UZ(47,"hr",21),t.TgZ(48,"div",12)(49,"div",13),t.YNc(50,ee,3,2,"div",22),t.ALo(51,"async"),t.qZA()()()()()()),2&n&&(t.xp6(1),t.Q6J("ngIf",t.lcZ(2,7,s.loading$)),t.xp6(5),t.hij(" ",t.lcZ(7,9,s.title$)," "),t.xp6(3),t.Q6J("matTooltip","Duplicate"),t.xp6(5),t.Q6J("formGroup",s.form),t.xp6(16),t.Q6J("ngForOf",t.lcZ(31,11,s.users$)),t.xp6(9),t.Q6J("ngForOf",t.lcZ(40,13,s.agencies$)),t.xp6(11),t.Q6J("ngForOf",t.lcZ(51,15,s.toes$)))},dependencies:[b.xY,f.sg,f.O5,u.Fj,u.JJ,u.JL,u.sg,u.u,N.TO,N.KE,J.gD,O.ey,V.Nt,rt.pW,B.oG,M.gM,f.Ov],styles:[".toe_name.mat-checkbox .mat-checkbox-layout{white-space:normal}"]}),i})();var ne=l(47465),se=l(41078),ae=l(59278),oe=l(23472);let re=(()=>{const a=class{constructor(e){this._filterService=e,this.value=!1}ngOnInit(){this._filterService.reset$.subscribe(()=>{this._default()}),this._default()}_default(){this.value=!1,this._filterService.setValue(this.key,0)}onCheckboxChange(e){this.value=e.checked,this._filterService.setValue(this.key,this.value?1:0)}};let i=a;return a.\u0275fac=function(n){return new(n||a)(t.Y36(oe.i))},a.\u0275cmp=t.Xpm({type:a,selectors:[["kt-f-checkbox"]],inputs:{key:"key",label:"label"},decls:3,vars:2,consts:[[1,"f-checkbox"],[3,"checked","change"]],template:function(n,s){1&n&&(t.TgZ(0,"div",0)(1,"mat-checkbox",1),t.NdJ("change",function(c){return s.onCheckboxChange(c)}),t._uU(2),t.qZA()()),2&n&&(t.xp6(1),t.Q6J("checked",s.value),t.xp6(1),t.hij(" ",s.label," "))},dependencies:[B.oG],styles:[".f-checkbox[_ngcontent-%COMP%]{display:flex;height:100%;align-items:center}"]}),i})();var le=l(8467);const ce=["sort1"];function de(i,a){if(1&i){const o=t.EpF();t.TgZ(0,"button",35),t.NdJ("click",function(){t.CHM(o);const n=t.oxw();return t.KtG(n.trash())}),t.ALo(1,"translate"),t.TgZ(2,"span"),t._uU(3),t.ALo(4,"translate"),t.ALo(5,"async"),t.qZA()()}if(2&i){const o=t.oxw();t.Q6J("matTooltip",t.lcZ(1,3,"ASSIGNMENT.LIST.BUTTON.TRASHED.TOOLTIP")),t.xp6(3),t.AsE(" ",t.lcZ(4,5,"GENERAL.BUTTON.TRASHED")," (",t.lcZ(5,7,o.trashCnt$),") ")}}
1function me(i,a){if(1&i){const o=t.EpF();t.TgZ(0,"button",36),t.NdJ("click",function(){t.CHM(o);const n=t.oxw();return t.KtG(n.adminTrash())}),t.ALo(1,"translate"),t.TgZ(2,"span"),t._uU(3),t.ALo(4,"translate"),t.ALo(5,"async"),t.qZA()()}if(2&i){const o=t.oxw();t.Q6J("matTooltip",t.lcZ(1,3,"ASSIGNMENT.LIST.BUTTON.ADMIN_TRASHED.TOOLTIP")),t.xp6(3),t.AsE(" ",t.lcZ(4,5,"GENERAL.BUTTON.ADMIN_TRASHED")," (",t.lcZ(5,7,o.adminTrashCnt$),") ")}}function ue(i,a){if(1&i&&(t.TgZ(0,"div",37)(1,"div",38)(2,"div",39)(3,"div",40)(4,"span",41),t._uU(5),t.qZA()(),t.TgZ(6,"div",42)(7,"p",43)(8,"span",44),t._uU(9,"ASSIGNMENTS"),t.qZA()()()(),t.TgZ(10,"div",45)(11,"span",41),t._uU(12),t.qZA(),t.TgZ(13,"div",46)(14,"p",43)(15,"span",47),t._uU(16,"TOEs"),t.qZA()()()(),t.TgZ(17,"div",48)(18,"span",41),t._uU(19),t.qZA(),t.TgZ(20,"div",42)(21,"p",43)(22,"span",47),t._uU(23,"PROPERTIES"),t.qZA()()()(),t.TgZ(24,"div",49)(25,"div",40)(26,"span",41),t._uU(27),t.qZA()(),t.TgZ(28,"div",42)(29,"p",43)(30,"span",47),t._uU(31,"VALUATIONS"),t.qZA()()()()()()),2&i){const o=a.ngIf;t.xp6(5),t.hij(" ",o.total_assignments," "),t.xp6(7),t.hij(" ",o.total_toes," "),t.xp6(7),t.hij(" ",o.total_properties," "),t.xp6(8),t.hij(" ",o.total_valuations," ")}}function pe(i,a){1&i&&(t.TgZ(0,"mat-header-cell",50),t._uU(1,"#"),t.qZA())}function he(i,a){if(1&i&&(t.TgZ(0,"mat-cell"),t._uU(1),t.qZA()),2&i){const o=a.$implicit;t.xp6(1),t.hij("",o.id," ")}}function ge(i,a){1&i&&(t.TgZ(0,"mat-header-cell",50),t._uU(1),t.ALo(2,"translate"),t.qZA()),2&i&&(t.xp6(1),t.hij(" ",t.lcZ(2,1,"ASSIGNMENT.LIST.DATATABLE.NAME")," "))}function Te(i,a){if(1&i&&(t.TgZ(0,"mat-cell"),t._uU(1),t.qZA()),2&i){const o=a.$implicit;t.xp6(1),t.Oqu(o.name)}}function _e(i,a){1&i&&(t.TgZ(0,"mat-header-cell",51),t._uU(1),t.ALo(2,"translate"),t.qZA()),2&i&&(t.xp6(1),t.hij(" ",t.lcZ(2,1,"ASSIGNMENT.LIST.DATATABLE.PROJECT_MANAGER")," "))}function Ae(i,a){if(1&i&&(t.TgZ(0,"mat-cell",52),t._UZ(1,"kt-user-tooltip",53),t.qZA()),2&i){const o=a.$implicit,e=t.oxw();
1t.xp6(1),t.Q6J("user",e.convertManager(o))}}function fe(i,a){1&i&&(t.TgZ(0,"mat-header-cell",50),t._uU(1),t.ALo(2,"translate"),t.qZA()),2&i&&(t.xp6(1),t.hij(" ",t.lcZ(2,1,"ASSIGNMENT.LIST.DATATABLE.AGENCY")," "))}function Ie(i,a){if(1&i&&(t.TgZ(0,"mat-cell"),t._uU(1),t.qZA()),2&i){const o=a.$implicit;t.xp6(1),t.hij(" ",o.agency_name," ")}}function Le(i,a){1&i&&(t.TgZ(0,"mat-header-cell"),t._uU(1),t.ALo(2,"translate"),t.qZA()),2&i&&(t.xp6(1),t.hij(" ",t.lcZ(2,1,"ASSIGNMENT.LIST.DATATABLE.REMAINING_DAYS")," "))}function Ee(i,a){if(1&i&&(t.TgZ(0,"mat-cell"),t._uU(1),t.qZA()),2&i){const o=a.$implicit;t.xp6(1),t.Oqu(o.val_cnt)}}function be(i,a){1&i&&(t.TgZ(0,"mat-header-cell",50),t._uU(1),t.ALo(2,"translate"),t.qZA()),2&i&&(t.xp6(1),t.hij(" ",t.lcZ(2,1,"ASSIGNMENT.LIST.DATATABLE.TOE")," "))}function Ce(i,a){if(1&i&&(t.TgZ(0,"mat-cell"),t._uU(1),t.qZA()),2&i){const o=a.$implicit;t.xp6(1),t.Oqu(o.toe_cnt)}}function ve(i,a){1&i&&(t.TgZ(0,"mat-header-cell"),t._uU(1),t.ALo(2,"translate"),t.qZA()),2&i&&(t.xp6(1),t.hij(" ",t.lcZ(2,1,"ASSIGNMENT.LIST.DATATABLE.TARGET_PROPERTIES")," "))}function Ze(i,a){if(1&i&&(t.TgZ(0,"mat-cell"),t._uU(1),t.qZA()),2&i){const o=a.$implicit;t.xp6(1),t.Oqu(o.ongoing_toe_cnt)}}function Ne(i,a){1&i&&(t.TgZ(0,"mat-header-cell"),t._uU(1),t.ALo(2,"translate"),t.qZA()),2&i&&(t.xp6(1),t.hij(" ",t.lcZ(2,1,"ASSIGNMENT.LIST.DATATABLE.VALS")," "))}function Se(i,a){if(1&i&&(t.TgZ(0,"mat-cell"),t._uU(1),t.qZA()),2&i){const o=a.$implicit;t.xp6(1),t.Oqu(o.val_cnt)}}function Oe(i,a){1&i&&(t.TgZ(0,"mat-header-cell",50),t._uU(1),t.ALo(2,"translate"),t.qZA()),2&i&&(t.xp6(1),t.hij(" ",t.lcZ(2,1,"ASSIGNMENT.LIST.DATATABLE.STATUS.COLUMN")," "))}function xe(i,a){if(1&i){const o=t.EpF();t.TgZ(0,"mat-checkbox",56),t.NdJ("change",function(n){t.CHM(o);const s=t.oxw().$implicit,r=t.oxw();return t.KtG(r.changeStatus(n,s))}),t.qZA()}if(2&i){const o=t.oxw().$implicit;t.Q6J("checked",2==o.status)}}function Re(i,a){if(1&i&&(t.TgZ(0,"mat-cell")(1,"b")(2,"span",54),t._uU(3),t.qZA()(),t.YNc(4,xe,1,1,"mat-checkbox",55),t.qZA()),2&i){const o=a.$implicit,e=t.oxw();
1t.xp6(2),t.Gre("label label-inline label-rounded label-outline-",e.getItemCssClassByStatus(o.completion)," label-outline-2x label-lg"),t.xp6(1),t.hij(" ",e.getItemStatusString(o.status,o.completion)," "),t.xp6(1),t.Q6J("ngIf",o.status>=1)}}function ye(i,a){1&i&&(t.TgZ(0,"mat-header-cell"),t._uU(1),t.ALo(2,"translate"),t.qZA()),2&i&&(t.xp6(1),t.hij(" ",t.lcZ(2,1,"ASSIGNMENT.LIST.DATATABLE.ACTIONS")," "))}const It=function(i,a){return{username:i,date:a}},De=function(i){return{cnt:i}};function Ue(i,a){if(1&i&&(t._UZ(0,"p",67),t.ALo(1,"translate"),t.ALo(2,"date"),t._UZ(3,"p",67),t.ALo(4,"translate"),t.ALo(5,"date"),t.TgZ(6,"div"),t._uU(7),t.ALo(8,"translate"),t.qZA()),2&i){const o=t.oxw().$implicit,e=t.oxw();t.Q6J("innerHTML",t.xi3(1,3,"GENERAL.INFORMATION_TOOLTIP.CREATED_BY",t.WLB(20,It,o.createdBy?o.createdBy:"Unknown",t.Dn7(2,6,o.created_at,"dd MMM yyyy",e.currentUser.settings.time_zone_gmt))),t.oJD),t.xp6(3),t.Q6J("innerHTML",t.xi3(4,10,"GENERAL.INFORMATION_TOOLTIP.LAST_EDITED_BY",t.WLB(23,It,o.lastUpdatedBy?o.lastUpdatedBy:"Unknown",t.Dn7(5,13,o.updated_at,"dd MMM yyyy",e.currentUser.settings.time_zone_gmt))),t.oJD),t.xp6(4),t.hij(" ",t.xi3(8,17,"ASSIGNMENT.LIST.POP_OVER.INFORMATION.AUDIT_TRAIL",t.VKq(26,De,o.audit_cnt))," ")}}function Me(i,a){1&i&&(t._uU(0),t.ALo(1,"translate")),2&i&&t.hij(" ",t.lcZ(1,1,"GENERAL.INFORMATION_TOOLTIP.TITLE")," ")}function Fe(i,a){if(1&i&&(t.TgZ(0,"button",68)(1,"mat-icon",63),t.ALo(2,"translate"),t._uU(3,"info"),t.qZA()()),2&i){t.oxw();const o=t.MAs(5),e=t.MAs(7);t.Q6J("ngbPopover",o)("popoverTitle",e),t.xp6(1),t.Q6J("matTooltip",t.lcZ(2,3,"GENERAL.TOOLTIP.INFORMATION"))}}function ke(i,a){if(1&i){const o=t.EpF();t.TgZ(0,"mat-cell")(1,"button",57),t.NdJ("click",function(){const s=t.CHM(o).$implicit,r=t.oxw();return t.KtG(r.duplicateAssignment(s))}),t.ALo(2,"translate"),t._UZ(3,"i",58),t.qZA(),t.YNc(4,Ue,9,28,"ng-template",null,59,t.W1O),t.YNc(6,Me,2,3,"ng-template",null,60,t.W1O),t.YNc(8,Fe,4,5,"button",61),t.TgZ(9,"button",62),t.NdJ("click",function(){const s=t.CHM(o).$implicit,r=t.oxw();return t.KtG(r.editAssignment(s))}),t.TgZ(10,"mat-icon"),t._uU(11,"create"),t.qZA()(),t._uU(12,"\xa0 "),t.TgZ(13,"span",63),t.ALo(14,"translate"),t.ALo(15,"translate"),t.TgZ(16,"button",64),t.NdJ("click",function(){const s=t.CHM(o).$implicit,r=t.oxw();return t.KtG(r.deleteAssignment(s))}),t.TgZ(17,"mat-icon"),t._uU(18,"delete"),t.qZA()()(),t.TgZ(19,"button",65),t.NdJ("click",function(){const s=t.CHM(o).$implicit,r=t.oxw();return t.KtG(r.reachAssignment(s))}),t.ALo(20,"translate"),t._UZ(21,"i",66),t.qZA()()}if(2&i){const o=a.$implicit,e=t.oxw();
1t.xp6(1),t.Q6J("disabled",1===o.status)("matTooltip",t.lcZ(2,9,"ASSIGNMENT.LIST.BUTTON.DUPLICATE.TOOLTIP")),t.xp6(2),t.Udp("color",0===o.status?"green":"grey"),t.xp6(5),t.Q6J("ngIf",e.currentUser),t.xp6(1),t.Q6J("matTooltip","Edit"),t.xp6(4),t.Q6J("matTooltip",0==o.relation_cnt?t.lcZ(14,11,"ASSIGNMENT.LIST.BUTTON.DELETE.TOOLTIP.CAN"):t.lcZ(15,13,"ASSIGNMENT.LIST.BUTTON.DELETE.TOOLTIP.CANNOT")),t.xp6(3),t.Q6J("disabled",o.relation_cnt>0),t.xp6(3),t.Q6J("matTooltip",t.lcZ(20,15,"ASSIGNMENT.LIST.BUTTON.ENTER.TOOLTIP"))}}function Pe(i,a){1&i&&t._UZ(0,"mat-header-row")}const we=function(i){return{gray:i}};function Ge(i,a){1&i&&t._UZ(0,"mat-row",69),2&i&&t.Q6J("ngClass",t.VKq(1,we,a.index%2))}function Je(i,a){1&i&&(t.TgZ(0,"div",70),t._uU(1),t.ALo(2,"translate"),t.qZA()),2&i&&(t.xp6(1),t.hij(" ",t.lcZ(2,1,"GENERAL.MESSAGE.NO_DATA")," "))}function Ye(i,a){1&i&&(t.TgZ(0,"div",70),t._uU(1),t.ALo(2,"translate"),t.qZA()),2&i&&(t.xp6(1),t.hij(" ",t.lcZ(2,1,"GENERAL.MESSAGE.PLEASE_WAIT")," "))}function Qe(i,a){1&i&&t._UZ(0,"mat-spinner",71),2&i&&t.Q6J("diameter",20)}const qe=function(){return{main:!0,location:!1,reset:!1}},$e=function(i){return{search:i}},je=function(){return[25,50,100]};let Be=(()=>{const a=class{constructor(e,n,s,r,c,m,T,g,_,E){this.activatedRoute=e,this.router=n,this.dialog=s,this.snackBar=r,this.subheaderService=c,this.service=m,this.layoutUtilsService=T,this.translate=g,this.store=_,this.subDomainService=E,this.displayedColumns=["id","name","manager.first_name","agency_name","toe_cnt","ongoing_toe_cnt","actions"],this.selection=new At.Ov(!0,[]),this.assignmentResult=[],this.assignmentStatusCnts$=new L.X({total_assignments:"0",total_toes:"0",total_properties:"0",total_valuations:"0"}),this.projectManagerSelections=[{id:-1,text:"All"}],this.agencySelections=[{id:-1,text:"All"}],this.status=[{id:-1,text:"All"},{id:0,text:"Draft"},{id:1,text:"Ongoing"}],this.subscriptions=[],this.canAccessAdminTrash$=this.store.pipe((0,p.Ys)((0,j.Fs)(["admin_trash"]))),this.currentUser=null}ngOnInit(){this.lastQueryParams=new I.Pm({});const e=this.store.pipe((0,p.Ys)(j.ar)).subscribe(g=>{this.currentUser=g});this.subscriptions.push(e),this.subheaderService.setTitle("Assignments"),this.subheaderService.setBreadcrumbs([{title:"Main menu",page:"../default/assignment"},{title:"Assignments",page:"../default/assignment/assignments"}]),this.paginator._intl.itemsPerPageLabel=this.translate.instant("GENERAL.PAGELABEL");const n=this.sort.sortChange.subscribe(()=>this.paginator.pageIndex=0);this.subscriptions.push(n);const s=(0,Tt.T)(this.sort.sortChange,this.paginator.page).pipe((0,it.b)(()=>this.loadAssignmentsList())).subscribe();this.subscriptions.push(s),this.dataSource=new d.vv(this.store);const r=this.dataSource.entitySubject.pipe((0,ht.T)(1),(0,gt.x)()).subscribe(g=>{g.length>0?(this.assignmentResult=g,this.assignmentStatusCnts$.next({total_assignments:g.length.toString(),total_toes:g.reduce((_,E)=>_+E.toe_cnt,0).toString(),total_properties:g.reduce((_,E)=>_+E.tp_cnt,0).toString(),total_valuations:g.reduce((_,E)=>_+E.val_cnt,0).toString()})):(this.assignmentResult=[],this.assignmentStatusCnts$.next({total_assignments:"0",total_toes:"0",total_properties:"0",total_valuations:"0"}))});this.trashCnt$=this.store.pipe((0,p.Ys)(d.YZ)),this.adminTrashCnt$=this.store.pipe((0,p.Ys)(d.tf)),this.subscriptions.push(r),(0,_t.of)(void 0).pipe((0,x.q)(1),(0,K.g)(1e3)).subscribe(()=>{this.loadAssignmentsList()});const c=this.store.pipe((0,p.Ys)(d.co),(0,x.q)(1)).subscribe(g=>{g.isEmpty()||(this.lastQueryParams=g,this.updateFilter(g.filter))});this.subscriptions.push(c),this.store.dispatch(new y.jqq);const m=this.store.pipe((0,p.Ys)(y.hN$)).subscribe(g=>{this.agencySelections=(0,ft.concat)([{id:-1,text:"All"}],g?g.map(_=>({id:_.id,text:_.name})):[])});this.subscriptions.push(m),this.store.dispatch(new Z.WK({roleId:2}));const T=this.store.pipe((0,p.Ys)(Z.CJ)).subscribe(g=>{this.projectManagerSelections=(0,ft.concat)([{id:-1,text:"All"}],g?g.items.map(_=>({id:_.id,text:_.full_name})):[])});this.subscriptions.push(T)}ngAfterViewInit(){this.activatedRoute.snapshot.queryParamMap.has("show-trash")&&this.trash(),this.activatedRoute.snapshot.queryParamMap.has("show-admin-trash")&&this.adminTrash()}
1ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe())}loadAssignmentsList(){this.selection.clear();let e=null;e=this.lastQueryParams.isEmpty()?new I.Pm(this.filter,this.sort.direction,this.sort.active,this.paginator.pageIndex+1,this.paginator.pageSize):this.lastQueryParams,this.lastQueryParams=new I.Pm({}),this.store.dispatch(new d.Vu({page:e})),this.selection.clear()}updateFilter(e){this.filter=e,this.loadAssignmentsList()}convertManager(e){return{firstName:e.manager.first_name,lastName:e.manager.last_name,email:e.manager.email,picture:e.manager.picture,qualification:e.manager.qualification_name,role:"Project Manager",agency:e.agency_name}}deleteAssignment(e){const n=this.translate.instant("ASSIGNMENT.LIST.DIALOG.DELETE.TITLE"),s=this.translate.instant("ASSIGNMENT.LIST.DIALOG.DELETE.DESCRIPTION",{name:e.name}),r=this.translate.instant("ASSIGNMENT.LIST.DIALOG.DELETE.WAIT_DESCRIPTION");this.layoutUtilsService.deleteElement(n,s,r).afterClosed().subscribe(m=>{m&&this.store.dispatch(new d.FF({id:e.id}))})}updateStatusForAssignments(){const s=[];this.selection.selected.forEach(c=>{s.push({text:`${c.name}`,id:c.id.toString(),status:c.status,statusTitle:this.getItemStatusString(c.status,c.completion),statusCssClass:this.getItemCssClassByStatus(c.status)})}),this.layoutUtilsService.updateStatusForEntities("updateStatusForAssignments",[{value:0,text:"Suspended"},{value:1,text:"Active"},{value:2,text:"Pending"}],s).afterClosed().subscribe(c=>{c?(this.store.dispatch(new d.$v({status:+c,assignments:this.selection.selected})),this.selection.clear()):this.selection.clear()})}addAssignment(){this.editAssignment(null)}editAssignment(e){this.router.navigate(e?["../assignments/edit",e.id]:["../assignments/add"],{relativeTo:this.activatedRoute})}dashboard(e){this.router.navigate(["../assignments/dashboard/",e.id],{relativeTo:this.activatedRoute})}reachAssignment(e){this.router.navigate(["../assignments/",e.id,"toes"],{relativeTo:this.activatedRoute})}duplicateAssignment(e){this.dialog.open(ie,{data:{assignment:e}}).afterClosed().subscribe(s=>{s&&"success"==s&&this.loadAssignmentsList()})}trash(){this.store.dispatch(new d.qu({isLoading:!0})),this.service.getTrashed().subscribe(e=>{const n=[];e.data.forEach(s=>{n.push({text:`${s.name}`,id:s.id.toString(),date:s.user_deleted,deletedUser:s.userDeletedBy,hasPermanentlyDelete:!0})}),n.length>0&&this.show_trash(n)})}adminTrash(){this.store.dispatch(new d.qu({isLoading:!0})),this.service.getAdminTrashed().subscribe(e=>{this.store.dispatch(new d.qu({isLoading:!1}));const n=[];e.data.forEach(s=>{n.push({text:`${s.name}`,id:s.id.toString(),hasPermanentlyDelete:!0,date:s.deleted_at,deletedUser:s.deletedBy}
1)}),n.length>0&&this.show_trash(n,!0)})}show_trash(e,n=!1){let s=this.translate.instant("ASSIGNMENT.LIST.DIALOG.SHOW_TRASH.TITLE");n&&(s=this.translate.instant("ASSIGNMENT.LIST.DIALOG.SHOW_TRASH.TITLE_ADMIN")),this.layoutUtilsService.trashedEntities(s,e,this,n)}hardDelete(e){this.store.dispatch(new d.XD({id:e}))}restore(e,n){this.store.dispatch(n?new d.ut({id:e}):new d.mw({id:e}))}delete(e){this.store.dispatch(new d.f9({id:e}))}flush(){this.store.dispatch(new d.Ek)}isAllSelected(){return this.selection.selected.length===this.assignmentResult.length}masterToggle(){this.selection.selected.length===this.assignmentResult.length?this.selection.clear():this.assignmentResult.forEach(e=>this.selection.select(e))}getItemCssClassByStatus(e=0){return e<26?"danger":e>25&&e<51?"warning":e>50&&e<76?"info":"success"}getItemStatusString(e=0,n){switch(e){case 0:case 1:return this.translate.instant("ASSIGNMENT.LIST.DATATABLE.STATUS.VALUE.ONGOING",{completion:n});case 2:return"Completed"}return""}changeStatus(e,n){this.store.dispatch(new Vt.v0({updateAssignment:{id:n.id,changes:{status:e.checked?2:1}}}))}onFilterChange(e){this.paginator.pageIndex=0,this.filter=e,this.loadAssignmentsList()}};let i=a;return a.\u0275fac=function(n){return new(n||a)(t.Y36(C.gz),t.Y36(C.F0),t.Y36(b.uw),t.Y36(lt.ux),t.Y36(k.b8),t.Y36(d.FM),t.Y36(I.eb),t.Y36(v.sK),t.Y36(p.yh),t.Y36(ne.$))},a.\u0275cmp=t.Xpm({type:a,selectors:[["kt-assignments-list"]],viewQuery:function(n,s){if(1&n&&(t.Gf(G.NW,7),t.Gf(ce,7)),2&n){let r;t.iGM(r=t.CRH())&&(s.paginator=r.first),t.iGM(r=t.CRH())&&(s.sort=r.first)}},decls:71,vars:61,consts:[[3,"viewLoading$","tooltipTitle","tooltipDesc"],["ktPortletTitle",""],[1,"card-head-title"],["ktPortletTools",""],["mat-raised-button","","color","primary","type","button",1,"mr-2",3,"matTooltip","click"],["mat-raised-button","","type","button","class","button-gray",3,"matTooltip","click",4,"ngIf"],["mat-raised-button","","type","button","class","button-gray ml-2",3,"matTooltip","click",4,"ngIf"],["class","kt-margin-bottom-20-mobile p-1 section-margin-bottom-60",4,"ngIf"],[3,"config","filterChange"],[1,"mr-2","mt-2",3,"key","bg","placeholder","selections"],[3,"key","label"],[1,"mat-table-wrapper"],["matSort","","matSortActive","status","matSortDirection","asc","matSortDisableClear","",1,"lmat-elevation-z8","table-striped",3,"dataSource"],["table","","sort1","matSort"],["matColumnDef","id"],["mat-sort-header","",4,"matHeaderCellDef"],[4,"matCellDef"],["matColumnDef","name"],["matColumnDef","manager.first_name"],["mat-sort-header","","class","project-manager",4,"matHeaderCellDef"],["class","project-manager",4,"matCellDef"],["matColumnDef","agency_name"],["matColumnDef","remaining_days"],[4,"matHeaderCellDef"],["matColumnDef","toe_cnt"],["matColumnDef","ongoing_toe_cnt"],["matColumnDef","val_cnt"],["matColumnDef","status"],["matColumnDef","actions"],[4,"matHeaderRowDef"],[3,"ngClass",4,"matRowDef","matRowDefColumns"],["class","mat-table-message",4,"ngIf"],[1,"mat-table-bottom"],[3,"diameter",4,"ngIf"],[3,"pageSize","pageSizeOptions","length","pageIndex","showFirstLastButtons"],["mat-raised-button","","type","button",1,"button-gray",3,"matTooltip","click"],["mat-raised-button","","type","button",1,"button-gray","ml-2",3,"matTooltip","click"],[1,"kt-margin-bottom-20-mobile","p-1","section-margin-bottom-60"],[1,"row","kt-margin-bottom-20-mobile",2,"text-align","right","font-weight","600","font-size","large"],[1,"col","rounded-sm","p-4","m-1","d-flex","align-items-center",2,"color","white","background-color","#999999 !important"],[1,"float-left","h-100","d-flex","justify-content-center","align-items-center","my-3"],[2,"vertical-align","middle","color","#E8E8E8"],[1,"float-right","align-content-end","w-100","text-uppercase","text-white"],[1,"m-0"],[2,"color","#cccccc"],[1,"col","rounded-sm","p-4","m-1","d-flex","align-items-center",2,"color","white","background-color","#f44d5e !important"],[1,"float-right","align-content-end","w-100","text-white"],[2,"color","#E8E8E8"],[1,"col","rounded-sm","p-4","m-1","d-flex","align-items-center",2,"color","white","background-color","#fda701 !important"],[1,"col","rounded-sm","p-4","m-1","d-flex","align-items-center",2,"color","white","background-color","#16c4bb !important"],["mat-sort-header",""],["mat-sort-header","",1,"project-manager"],[1,"project-manager"],[3,"user"],[2,"width","150px"],["class","ml-2",3,"checked","change",4,"ngIf"],[1,"ml-2",3,"checked","change"],["mat-icon-button","",3,"disabled","matTooltip","click"],[1,"flaticon2-layers"],["popContent",""],["popTitle",""],["mat-icon-button","","color","primary",3,"ngbPopover","popoverTitle",4,"ngIf"],["mat-icon-button","","color","primary",3,"matTooltip","click"],[3,"matTooltip"],["mat-icon-button","","color","warn","type","button",3,"disabled","click"],["mat-icon-button","","type","button",3,"matTooltip","click"],[1,"flaticon2-arrow"],[3,"innerHTML"],["mat-icon-button","","color","primary",3,"ngbPopover","popoverTitle"],[3,"ngClass"],[1,"mat-table-message"],[3,"diameter"]],template:function(n,s){1&n&&(t.TgZ(0,"kt-portlet")(1,"kt-portlet-header",0),t.ALo(2,"translate"),t.ALo(3,"translate"),t.ynx(4,1),t.TgZ(5,"h3",2)(6,"span"),t._uU(7),t.ALo(8,"translate"),t.qZA()(),t.BQk(),t.ynx(9,3),t.TgZ(10,"button",4),t.NdJ("click",function(){return s.addAssignment()}),t.ALo(11,"translate"),t.TgZ(12,"span"),t._uU(13),t.ALo(14,"translate"),t.qZA()(),t.YNc(15,de,6,9,"button",5),t.ALo(16,"async"),t.YNc(17,me,6,9,"button",6),t.ALo(18,"async"),t.ALo(19,"async"),t.BQk(),t.qZA(),t.TgZ(20,"kt-portlet-body"),t.YNc(21,ue,32,4,"div",7),t.ALo(22,"async"),t.TgZ(23,"kt-filter",8),t.
1NdJ("filterChange",function(c){return s.onFilterChange(c)}),t._UZ(24,"kt-f-selection",9)(25,"kt-f-selection",9)(26,"kt-f-checkbox",10),t.qZA(),t.TgZ(27,"div",11)(28,"mat-table",12,13),t.ynx(31,14),t.YNc(32,pe,2,0,"mat-header-cell",15),t.YNc(33,he,2,1,"mat-cell",16),t.BQk(),t.ynx(34,17),t.YNc(35,ge,3,3,"mat-header-cell",15),t.YNc(36,Te,2,1,"mat-cell",16),t.BQk(),t.ynx(37,18),t.YNc(38,_e,3,3,"mat-header-cell",19),t.YNc(39,Ae,2,1,"mat-cell",20),t.BQk(),t.ynx(40,21),t.YNc(41,fe,3,3,"mat-header-cell",15),t.YNc(42,Ie,2,1,"mat-cell",16),t.BQk(),t.ynx(43,22),t.YNc(44,Le,3,3,"mat-header-cell",23),t.YNc(45,Ee,2,1,"mat-cell",16),t.BQk(),t.ynx(46,24),t.YNc(47,be,3,3,"mat-header-cell",15),t.YNc(48,Ce,2,1,"mat-cell",16),t.BQk(),t.ynx(49,25),t.YNc(50,ve,3,3,"mat-header-cell",23),t.YNc(51,Ze,2,1,"mat-cell",16),t.BQk(),t.ynx(52,26),t.YNc(53,Ne,3,3,"mat-header-cell",23),t.YNc(54,Se,2,1,"mat-cell",16),t.BQk(),t.ynx(55,27),t.YNc(56,Oe,3,3,"mat-header-cell",15),t.YNc(57,Re,5,5,"mat-cell",16),t.BQk(),t.ynx(58,28),t.YNc(59,ye,3,3,"mat-header-cell",23),t.YNc(60,ke,22,17,"mat-cell",16),t.BQk(),t.YNc(61,Pe,1,0,"mat-header-row",29),t.YNc(62,Ge,1,3,"mat-row",30),t.qZA(),t.YNc(63,Je,3,3,"div",31),t.YNc(64,Ye,3,3,"div",31),t.ALo(65,"async"),t.qZA(),t.TgZ(66,"div",32),t.YNc(67,Qe,1,1,"mat-spinner",33),t.ALo(68,"async"),t._UZ(69,"mat-paginator",34),t.ALo(70,"async"),t.qZA()()()),2&n&&(t.xp6(1),t.Tol("kt-portlet-head--lg"),t.Q6J("viewLoading$",s.dataSource.loading$)("tooltipTitle",t.lcZ(2,33,"TOOLTIP.ASSIGNMENT.LIST.TITLE"))("tooltipDesc",t.lcZ(3,35,"TOOLTIP.ASSIGNMENT.LIST.DESCRIPTION")),t.xp6(6),t.hij(" ",t.lcZ(8,37,"ASSIGNMENT.LIST.TITLE")," "),t.xp6(3),t.Q6J("matTooltip",t.lcZ(11,39,"ASSIGNMENT.LIST.BUTTON.NEW.TOOLTIP")),t.xp6(3),t.hij(" ",t.lcZ(14,41,"ASSIGNMENT.LIST.BUTTON.NEW.LABEL")," "),t.xp6(2),t.Q6J("ngIf",0!=t.lcZ(16,43,s.trashCnt$)),t.xp6(2),t.Q6J("ngIf",0!=t.lcZ(18,45,s.adminTrashCnt$)&&t.lcZ(19,47,s.canAccessAdminTrash$)),t.xp6(4),t.Q6J("ngIf",t.lcZ(22,49,s.assignmentStatusCnts$)),t.xp6(2),t.Q6J("config",t.VKq(58,$e,t.DdM(57,qe))),t.xp6(1),t.Q6J("key","pm_id")("bg","#187016")("placeholder","Project Manager")("selections",s.projectManagerSelections),t.xp6(1),t.Q6J("key","agency_id")("bg","#67a262")("placeholder","Agency")("selections",s.agencySelections),t.xp6(1),t.Q6J("key","ongoing_toe")("label","Display assignments with no ongoing ToEs"),t.xp6(2),t.Q6J("dataSource",s.dataSource),t.xp6(33),t.Q6J("matHeaderRowDef",s.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",s.displayedColumns),t.xp6(1),t.Q6J("ngIf",!s.dataSource.hasItems),t.xp6(1),t.Q6J("ngIf",t.lcZ(65,51,s.dataSource.isPreloadTextViewed$)),t.xp6(3),t.Q6J("ngIf",t.lcZ(68,53,s.dataSource.loading$)),t.xp6(2),t.Q6J("pageSize",25)("pageSizeOptions",t.DdM(60,je))("length",t.lcZ(70,55,s.dataSource.paginatorTotal$))("pageIndex",s.dataSource.pageIndex)("showFirstLastButtons",!0))},dependencies:[f.mk,f.O5,Q.I,q.c,$.j,S.lW,h.BZ,h.fO,h.as,h.w1,h.Dz,h.nj,h.ge,h.ev,h.XQ,h.Gk,P.Hw,G.NW,Y.YE,Y.nU,B.oG,tt.Ou,M.gM,se.z,ae.r,re,F.o8,le.p,f.Ov,f.uU,v.X$],styles:[".mat-column-created_at[_ngcontent-%COMP%]{color:gray;font-size:small}.mat-column-toe_cnt[_ngcontent-%COMP%], .mat-column-val_cnt[_ngcontent-%COMP%], .mat-column-audit_cnt[_ngcontent-%COMP%], .mat-column-ongoing_toe_cnt[_ngcontent-%COMP%]{flex:0 0 10%!important;align-items:center;justify-content:center;width:10%!important;padding-right:0!important;margin-right:10px}.mat-column-status[_ngcontent-%COMP%]{flex:0 0 12%!important;align-items:center;width:12%!important;padding-right:0!important;margin-right:10px}.mat-column-status.mat-header-cell[_ngcontent-%COMP%]{justify-content:center}.mat-column-status.mat-cell[_ngcontent-%COMP%]{justify-content:flex-start}.mat-column-completion[_ngcontent-%COMP%]{flex:0 0 5%!important;align-items:center;justify-content:center;width:5%!important;padding-right:0!important;margin-right:10px}.mat-column-actions[_ngcontent-%COMP%]{flex:0 0 200px!important}.mat-column-manager-first_name.project-manager[_ngcontent-%COMP%]{flex:0 0 10%!important;width:10%!important}.mat-column-updated_at[_ngcontent-%COMP%]{color:gray;font-size:small}.cursor-pointer[_ngcontent-%COMP%]{cursor:pointer}.not-applicable[_ngcontent-%COMP%]{cursor:default;font-weight:400}"],changeDetection:0}),i})();var w=l(42730);let Ve=(()=>{const a=class{constructor(e){this.dialogRef=e}ngOnInit(){}onNoClick(){this.dialogRef.close(!1)}onYesClick(){this.dialogRef.close(!0)}};let i=a;return a.\u0275fac=function(n){return new(n||a)(t.Y36(b.so))}
1,a.\u0275cmp=t.Xpm({type:a,selectors:[["kt-toe-exclude-dialog"]],decls:14,vars:0,consts:[[1,"card","card-custom"],[1,"form"],[1,"card-body"],[1,"form-group","kt-form__group","row"],[1,"col-lg-12"],[1,"card-footer","b-0","p-0","text-right"],[1,"form-actions","form-actions-solid"],[1,"row"],["type","button","mat-raised-button","",3,"click"],["type","button","mat-raised-button","","color","primary",3,"click"]],template:function(n,s){1&n&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),t._uU(5," Do you want to exclude ToEs that are in draft mode? "),t.qZA()()(),t.TgZ(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",4)(10,"button",8),t.NdJ("click",function(){return s.onNoClick()}),t._uU(11,"No"),t.qZA(),t.TgZ(12,"button",9),t.NdJ("click",function(){return s.onYesClick()}),t._uU(13,"Yes"),t.qZA()()()()()()())},dependencies:[S.lW]}),i})();function He(i,a){1&i&&(t.TgZ(0,"mat-header-cell"),t._uU(1,"Generated Date"),t.qZA())}function Ke(i,a){if(1&i&&(t.TgZ(0,"mat-cell"),t._uU(1),t.ALo(2,"date"),t.qZA()),2&i){const o=a.$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,o.created_at,"dd MMM yyyy"),"")}}function ze(i,a){1&i&&(t.TgZ(0,"mat-header-cell"),t._uU(1,"Size of the file"),t.qZA())}function We(i,a){if(1&i&&(t.TgZ(0,"mat-cell"),t._uU(1),t.qZA()),2&i){const o=a.$implicit;t.xp6(1),t.hij(" ",o.file_size,"")}}function Xe(i,a){1&i&&(t.TgZ(0,"mat-header-cell"),t._uU(1,"Inlcuding Not Signed?"),t.qZA())}function ti(i,a){if(1&i&&(t.TgZ(0,"mat-cell"),t._uU(1),t.qZA()),2&i){const o=a.$implicit;t.xp6(1),t.hij(" ",o.includesOnlySignedToe?"No":"Yes","")}}function ei(i,a){1&i&&(t.TgZ(0,"mat-header-cell"),t._uU(1,"Report Status"),t.qZA())}function ii(i,a){if(1&i&&(t.TgZ(0,"mat-cell")(1,"b")(2,"span",19),t._uU(3),t.qZA()()()),2&i){const o=a.$implicit,e=t.oxw();
1t.xp6(2),t.Gre("label label-inline label-rounded label-outline-",e.getItemCssClassByStatus(o.status)," label-outline-2x label-lg py-1"),t.xp6(1),t.hij("",1==o.status?"success":0==o.status?"in progress":"failed"," ")}}function ni(i,a){1&i&&(t.TgZ(0,"mat-header-cell"),t._uU(1,"Actions"),t.qZA())}function si(i,a){if(1&i){const o=t.EpF();t.TgZ(0,"mat-cell")(1,"button",20),t.NdJ("click",function(){const n=t.CHM(o),s=n.$implicit,r=n.index,c=t.oxw();return t.KtG(c.downloadAuditTrailReport(s,r))}),t.TgZ(2,"mat-icon"),t._uU(3,"get_app"),t.qZA()(),t._uU(4,"\xa0 "),t.TgZ(5,"button",21),t.NdJ("click",function(){const n=t.CHM(o),s=n.$implicit,r=n.index,c=t.oxw();return t.KtG(c.deleteAuditTrailReport(s,r))}),t.TgZ(6,"mat-icon"),t._uU(7,"delete"),t.qZA()(),t._uU(8,"\xa0 "),t.qZA()}if(2&i){const o=a.$implicit;t.xp6(1),t.Q6J("disabled",1!=o.status)}}function ai(i,a){1&i&&t._UZ(0,"mat-header-row")}function oi(i,a){1&i&&t._UZ(0,"mat-row")}let ri=(()=>{const a=class{constructor(e,n,s,r,c,m,T,g,_,E){this.dialogRef=e,this.dialog=n,this.data=s,this.fb=r,this.store=c,this.ref=m,this.layoutConfigService=T,this.layoutUtilsService=g,this.auditTrailReportService=_,this.translate=E,this.generatedReports=[],this.displayedColumnsGeneratedReport=["created_at","file_size","including_not_signed","status","actions"],this.dataSourceGeneratedReport=new h.by,this.subscriptions=[]}ngOnInit(){this.generating=!1;const e=this.store.pipe((0,p.Ys)(j.ar)).subscribe(s=>{s&&(this.currentUser=s)});this.subscriptions.push(e),this.store.dispatch(new d.BS({assignmentId:this.data.assId}));const n=this.store.pipe((0,p.Ys)(d.NU)).subscribe(s=>{this.generating=!1,this.generatedReports=s.sort((r,c)=>r.id<c.id?1:c.id<r.id?-1:0),this.dataSourceGeneratedReport=new h.by(this.generatedReports)});this.subscriptions.push(n)}ngOnDestroy(){this.subscriptions.forEach(e=>{e.unsubscribe()})}onClickClose(){this.dialogRef.close()}onSubmit(){this.dialog.open(Ve,{width:"440px"}).afterClosed().subscribe(n=>{const s=n,r=new d.X2;r.clear(),r.assignment_id=this.data.assId,r.status=0,r.user_id=this.currentUser.id,r.includesOnlySignedToe=s,setInterval(()=>{this.generating="1"==this.layoutConfigService.getGeneratingLayout()},1e3),this.generating=!0,this.layoutConfigService.showGeneratingLayout(),this.store.dispatch(new d.mz({auditTrailReport:r}));const c=this.store.pipe((0,p.Ys)(d.BN),(0,K.g)(1e3)).subscribe(m=>{m&&this.auditTrailReportService.generateAuditTrailReport(this.data.assId,this.currentUser.id,m,s).subscribe(T=>{T&&(this.store.dispatch(new d.BS({assignmentId:this.data.assId})),this.layoutConfigService.hideGeneratingLayout())})});this.subscriptions.push(c)})}isFormValid(){return!0}downloadAuditTrailReport(e,n){window.open(e.url,"_blank")}deleteAuditTrailReport(e,n){this.layoutUtilsService.deleteElement("Are you sure?","The report history data will be lost","Report history deleting").afterClosed().subscribe(T=>{T&&this.auditTrailReportService.deleteAuditTrailReport(e.id).subscribe(g=>{const _=[...this.generatedReports];_.splice(n,1),this.generatedReports=_,this.dataSourceGeneratedReport=new h.by(this.generatedReports)})})}getItemStatusString(e=0){switch(e){case 0:return"Draft";case 1:return"Validated";case 2:return"Signed";case 3:return"Completed";case 4:return"Aborted"}return""}getItemCssClassByStatus(e=0){switch(e){case 0:return"metal";case 4:return"danger";default:return"success"}}};let i=a;return a.\u0275fac=function(n){return new(n||a)(t.Y36(b.so),t.Y36(b.uw),t.Y36(b.WI),t.Y36(u.QS),t.Y36(p.yh),t.Y36(t.sBO),t.Y36(k.JJ),t.Y36(I.eb),t.Y36(d.CV),t.Y36(v.sK))},a.\u0275cmp=t.Xpm({type:a,selectors:[["kt-audit-report-dialog"]],decls:36,vars:6,consts:[["ktPortletTitle",""],[1,"card-label"],[1,"form"],[1,"example-container","mat-elevation-z0","col-lg-12","kt-margin-bottom-10-mobile","mt-4","mb-4"],[3,"dataSource"],["table",""],["matColumnDef","created_at"],[4,"matHeaderCellDef"],[4,"matCellDef"],["matColumnDef","file_size"],["matColumnDef","including_not_signed"],["matColumnDef","status"],["matColumnDef","actions"],[4,"matHeaderRowDef"],[4,"matRowDef","matRowDefColumns"],[1,"card-footer","text-right"],[1,"form-actions","form-actions-solid","my-2s"],["mat-button","","mat-raised-button","",3,"click"],["type","button","mat-raised-button","","color","submit","matTooltip","Download generated report file",1,"btn","btn-success",3,"disabled","click"],[2,"width","10rem"],["mat-icon-button","","color","primary","matTooltip","Download Generated Report","type","button",3,"disabled","click"],["mat-icon-button","","color","warn","matTooltip","Delete Generated Report","type","button",3,"click"]],template:function(n,s){1&n&&(t.TgZ(0,"kt-portlet")(1,"kt-portlet-header"),t.ynx(2,0),t.TgZ(3,"h3",1)(4,"span"),t._uU(5,"Generate audit report"),t.qZA()(),t.BQk(),t.qZA(),t.TgZ(6,"kt-portlet-body")(7,"mat-dialog-content")(8,"form",2)(9,"div",3)(10,"mat-table",4,5),t.ynx(12,6),t.YNc(13,He,2,0,"mat-header-cell",7),t.YNc(14,Ke,3,4,"mat-cell",8),t.BQk(),t.ynx(15,9),t.YNc(16,ze,2,0,"mat-header-cell",7),t.YNc(17,We,2,1,"mat-cell",8),t.BQk(),t.ynx(18,10),t.YNc(19,Xe,2,0,"mat-header-cell",7),t.YNc(20,ti,2,1,"mat-cell",8),t.BQk(),t.ynx(21,11),t.YNc(22,ei,2,0,"mat-header-cell",7),t.YNc(23,ii,4,4,"mat-cell",8),t.BQk(),t.ynx(24,12),t.YNc(25,ni,2,0,"mat-header-cell",7),t.YNc(26,si,9,1,"mat-cell",8),t.BQk(),t.YNc(27,ai,1,0,"mat-header-row",13),t.YNc(28,oi,1,0,"mat-row",14),t.qZA()()()(),t.TgZ(29,"div",15)(30,"div",16)(31,"button",17),t.NdJ("click",function(){return s.onClickClose()}),t._uU(32,"Close"),t.qZA(),t._uU(33,"\xa0 "),t.TgZ(34,"button",18),t.NdJ("click",function(){return s.onSubmit()}),t._uU(35," Generate a New Audit Trail "),t.qZA()()()()()),2&n&&(t.xp6(1),t.Tol("card-head-lg"),t.xp6(9),t.Q6J("dataSource",s.dataSourceGeneratedReport),t.xp6(17),t.Q6J("matHeaderRowDef",s.displayedColumnsGeneratedReport),t.xp6(1),t.Q6J("matRowDefColumns",s.displayedColumnsGeneratedReport),t.xp6(6),t.Q6J("disabled",s.generating))},dependencies:[S.lW,b.xY,P.Hw,h.BZ,h.fO,h.as,h.w1,h.Dz,h.nj,h.ge,h.ev,h.XQ,h.Gk,M.gM,u._Y,u.JL,u.F,Q.I,q.c,$.j,f.uU]}),i})();var W=l(27463),li=l(61159),ci=l(13498);const di=["sort1"];
1function mi(i,a){if(1&i){const o=t.EpF();t.TgZ(0,"button",39),t.NdJ("click",function(){t.CHM(o);const n=t.oxw();return t.KtG(n.trash())}),t.ALo(1,"translate"),t.TgZ(2,"span"),t._uU(3),t.ALo(4,"translate"),t.qZA()()}if(2&i){const o=t.oxw();t.Q6J("matTooltip",t.lcZ(1,3,"AUDIT_TRAIL.LIST.BUTTON.TRASHED.TOOLTIP")),t.xp6(3),t.AsE("",t.lcZ(4,5,"GENERAL.BUTTON.TRASHED")," (",o.trashCnt,")")}}function ui(i,a){if(1&i&&(t.TgZ(0,"mat-option",40),t._uU(1),t.qZA()),2&i){const o=a.$implicit;t.s9C("value",o.id),t.xp6(1),t.Oqu(o.name)}}function pi(i,a){1&i&&(t.TgZ(0,"mat-header-cell",41),t._uU(1,"#"),t.qZA())}function hi(i,a){if(1&i&&(t.TgZ(0,"mat-cell"),t._uU(1),t.qZA()),2&i){const o=a.$implicit;t.xp6(1),t.hij("",o.ref_num," ")}}function gi(i,a){1&i&&(t.TgZ(0,"mat-header-cell"),t._uU(1,"ref"),t.qZA())}function Ti(i,a){if(1&i&&(t.TgZ(0,"mat-cell"),t._uU(1),t.qZA()),2&i){const o=a.$implicit;t.xp6(1),t.hij(" ",o.ref," ")}}function _i(i,a){1&i&&(t.TgZ(0,"mat-header-cell",41),t._uU(1),t.ALo(2,"translate"),t.qZA()),2&i&&(t.xp6(1),t.hij(" ",t.lcZ(2,1,"AUDIT_TRAIL.LIST.DATATABLE.INTERACTION_DATE")," "))}function Ai(i,a){if(1&i&&(t.TgZ(0,"mat-cell"),t._uU(1),t.ALo(2,"date"),t.qZA()),2&i){const o=a.$implicit,e=t.oxw();
1t.xp6(1),t.hij("",t.Dn7(2,1,e.currentUser&&o.interaction_date,"dd MMM yyyy",e.currentUser.settings.time_zone_gmt)," ")}}function fi(i,a){1&i&&(t.TgZ(0,"mat-header-cell",41),t._uU(1),t.ALo(2,"translate"),t.qZA()),2&i&&(t.xp6(1),t.hij(" ",t.lcZ(2,1,"AUDIT_TRAIL.LIST.DATATABLE.CLIENT")," "))}function Ii(i,a){if(1&i&&(t.TgZ(0,"mat-cell"),t._uU(1),t.qZA()),2&i){const o=a.$implicit;t.xp6(1),t.Oqu(o.client_name)}}function Li(i,a){1&i&&(t.TgZ(0,"mat-header-cell",41),t._uU(1),t.ALo(2,"translate"),t.qZA()),2&i&&(t.xp6(1),t.hij(" ",t.lcZ(2,1,"AUDIT_TRAIL.LIST.DATATABLE.TOE")," "))}const Lt=function(){return["100"]};function Ei(i,a){if(1&i&&(t.TgZ(0,"mat-cell"),t._uU(1),t.ALo(2,"truncate"),t.qZA()),2&i){const o=a.$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,o.terms_of_engagement_name,t.DdM(4,Lt)))}}function bi(i,a){1&i&&(t.TgZ(0,"mat-header-cell"),t._uU(1),t.ALo(2,"translate"),t.qZA()),2&i&&(t.xp6(1),t.hij(" ",t.lcZ(2,1,"AUDIT_TRAIL.LIST.DATATABLE.TARGET_PROPERTY")," "))}function Ci(i,a){if(1&i&&(t.TgZ(0,"mat-cell"),t._uU(1),t.ALo(2,"truncate"),t.qZA()),2&i){const o=a.$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,o.asset_class_name,t.DdM(4,Lt)))}}function vi(i,a){1&i&&(t.TgZ(0,"mat-header-cell",41),t._uU(1),t.ALo(2,"translate"),t.qZA()),2&i&&(t.xp6(1),t.hij(" ",t.lcZ(2,1,"AUDIT_TRAIL.LIST.DATATABLE.EXPECTED_IMPACT")," "))}function Zi(i,a){if(1&i&&(t.TgZ(0,"mat-cell"),t._uU(1),t.qZA()),2&i){const o=a.$implicit;t.xp6(1),t.hij(" ",o.impact_on_valuation," ")}}function Ni(i,a){1&i&&(t.TgZ(0,"mat-header-cell",41),t._uU(1),t.ALo(2,"translate"),t.qZA()),2&i&&(t.xp6(1),t.hij(" ",t.lcZ(2,1,"AUDIT_TRAIL.LIST.DATATABLE.CREATED_AT")," "))}function Si(i,a){if(1&i&&(t.TgZ(0,"mat-cell"),t._uU(1),t.qZA()),2&i){const o=a.$implicit;t.xp6(1),t.hij("",o.created_at," ")}}function Oi(i,a){1&i&&(t.TgZ(0,"mat-header-cell"),t._uU(1),t.ALo(2,"translate"),t.qZA()),2&i&&(t.xp6(1),t.hij(" ",t.lcZ(2,1,"AUDIT_TRAIL.LIST.DATATABLE.ACTIONS")," "))}function xi(i,a){1&i&&(t._uU(0),t.ALo(1,"translate")),2&i&&t.hij(" ",t.lcZ(1,1,"GENERAL.INFORMATION_TOOLTIP.TITLE")," ")}const Ri=function(i,a){return{username:i,date:a}},yi=function(i){return{type:i}};function Di(i,a){if(1&i&&(t._UZ(0,"p",47),t.ALo(1,"translate"),t.ALo(2,"date"),t._UZ(3,"div",47),t.ALo(4,"translate")),2&i){const o=t.oxw().$implicit,e=t.oxw();t.Q6J("innerHTML",t.xi3(1,2,"GENERAL.INFORMATION_TOOLTIP.CREATED_BY",t.WLB(12,Ri,o.createdBy?o.createdBy:"Unknown",t.Dn7(2,5,o.created_at,"dd MMM yyyy",e.currentUser.settings.time_zone_gmt))),t.oJD),t.xp6(3),t.Q6J("innerHTML",t.xi3(4,9,"AUDIT_TRAIL.LIST.POP_OVER.INFORMATION.TYPE",t.VKq(15,yi,o.interaction_type_name)),t.oJD)}}function Ui(i,a){if(1&i&&(t.TgZ(0,"button",48)(1,"mat-icon",49),t.ALo(2,"translate"),t._uU(3,"info"),t.qZA()()),2&i){t.oxw();const o=t.MAs(4),e=t.MAs(2);t.Q6J("ngbPopover",o)("popoverTitle",e),t.xp6(1),t.Q6J("matTooltip",t.lcZ(2,3,"GENERAL.TOOLTIP.INFORMATION"))}}function Mi(i,a){if(1&i){const o=t.EpF();t.TgZ(0,"mat-cell"),t.YNc(1,xi,2,3,"ng-template",null,42,t.W1O),t.YNc(3,Di,5,17,"ng-template",null,43,t.W1O),t.YNc(5,Ui,4,5,"button",44),t.TgZ(6,"button",45),t.NdJ("click",function(){const s=t.CHM(o).$implicit,r=t.oxw();return t.KtG(r.deleteInteraction(s))}),t.ALo(7,"translate"),t.TgZ(8,"mat-icon"),t._uU(9,"delete"),t.qZA()(),t._uU(10,"\xa0 "),t.TgZ(11,"button",46),t.NdJ("click",function(){const s=t.CHM(o).$implicit,r=t.oxw();return t.KtG(r.reachInteraction(s))}),t.ALo(12,"translate"),t.TgZ(13,"mat-icon"),t._uU(14,"remove_red_eye"),t.qZA()(),t._uU(15,"\xa0 "),t.qZA()}if(2&i){const o=t.oxw();t.xp6(5),t.Q6J("ngIf",o.currentUser),t.xp6(1),t.Q6J("matTooltip",t.lcZ(7,3,"AUDIT_TRAIL.LIST.BUTTON.DELETE.TOOLTIP")),t.xp6(5),t.Q6J("matTooltip",t.lcZ(12,5,"AUDIT_TRAIL.LIST.BUTTON.DETAIL.TOOLTIP"))}}function Fi(i,a){1&i&&t._UZ(0,"mat-header-row")}function ki(i,a){1&i&&t._UZ(0,"mat-row")}function Pi(i,a){1&i&&(t.TgZ(0,"div",50),t._uU(1),t.ALo(2,"translate"),t.qZA()),2&i&&(t.xp6(1),t.hij(" ",t.lcZ(2,1,"GENERAL.MESSAGE.NO_DATA")," "))}function wi(i,a){1&i&&(t.TgZ(0,"div",50),t._uU(1),t.ALo(2,"translate"),t.qZA()),2&i&&(t.xp6(1),t.hij(" ",t.lcZ(2,1,"GENERAL.MESSAGE.PLEASE_WAIT")," "))}function Gi(i,a){1&i&&t._UZ(0,"mat-spinner",51),2&i&&t.Q6J("diameter",20)}const Ji=function(i){return{assignment_name:i}},Yi=function(){return[25,50,100]};let Qi=(()=>{const a=class{constructor(e,n,s,r,c,m,T,g,_){this.activatedRoute=e,this.router=n,this.dialog=s,this.location=r,this.subheaderService=c,this.layoutUtilsService=m,this.service=T,this.translate=g,this.store=_,this.trashCnt=0,this.adminTrashCnt=0,this.displayedColumns=["id","interaction_date","client_name","terms_of_engagement_name","asset_class_name","impact_on_valuation","actions"],this.selection=new At.Ov(!0,[]),this.auditTrailResult=[],this.filterToE="",this.toes=[],this.menuSubject=ne
1w L.X(-1),this.menuItems=[],this.subscriptions=[],this.menuItems=[{title:this.translate.instant("AUDIT_TRAIL.LIST.MENU.NEW"),icon:"flaticon2-edit",refId:1,disabled:!1}],this.trashCnt=0,this.adminTrashedCnt=0,this.backTitle=this.translate.instant("GENERAL.TOOLTIP.BACK",{back_page:this.translate.instant("ASSIGNMENT.LIST.TITLE")})}ngOnInit(){this.lastQueryParams=new I.Pm({}),this.subheaderService.setTitle(this.translate.instant("SUBHEADER.INTERACTIONS")),this.subheaderService.setBreadcrumbs([{title:"Main menu",page:"../default/assignment"},{title:"Assignments",page:"../default/assignment/assignments"},{title:"Interactions"}]),localStorage.getItem("audit_trails_url")&&"dashboard"===localStorage.getItem("audit_trails_url")&&(this.backTitle=this.translate.instant("GENERAL.TOOLTIP.BACK",{back_page:this.translate.instant("AUDIT_TRAIL.LIST.TOE_DASHBOARD")}),localStorage.removeItem("audit_trails_url"));const e=this.menuSubject.asObservable().subscribe(A=>{switch(A){case 1:this.router.navigate(["add"],{relativeTo:this.activatedRoute});break;case 2:this.dialog.open(ri,{data:{assId:this.assignmentId}}).afterClosed().subscribe(_n=>{})}});this.subscriptions.push(e),this.store.dispatch(new d.ud),this.assignmentId=Number(this.activatedRoute.snapshot.paramMap.get("id")),this.paginator._intl.itemsPerPageLabel=this.translate.instant("GENERAL.PAGELABEL");const n=this.sort.sortChange.subscribe(()=>this.paginator.pageIndex=0);this.subscriptions.push(n),this.store.pipe((0,p.Ys)((0,d.DA)(this.assignmentId))).subscribe(A=>{A&&(this.assignment=A)});const s=(0,Tt.T)(this.sort.sortChange,this.paginator.page).pipe((0,it.b)(()=>this.loadAuditTrailsList())).subscribe();this.subscriptions.push(s);const r=this.store.pipe((0,x.q)(1),(0,p.Ys)(j.ar)).subscribe(A=>{A&&(this.currentUser=A)});this.subscriptions.push(r),this.dataSource=new d.Cc(this.store);const c=this.dataSource.entitySubject.pipe((0,ht.T)(1),(0,gt.x)()).subscribe(A=>{this.auditTrailResult=A});this.subscriptions.push(c);const m=this.store.pipe((0,p.Ys)(d.LU)).subscribe(A=>{this.trashCnt=A});this.subscriptions.push(m);const T=this.store.pipe((0,p.Ys)(d.vd)).subscribe(A=>{this.adminTrashCnt=A});this.subscriptions.push(T),(0,_t.of)(void 0).pipe((0,x.q)(1),(0,K.g)(1e3)).subscribe(()=>{this.loadAuditTrailsList()});const g=new I.Pm({name:""},"asc","status",1,1e3);this.store.dispatch(new W.iJ({page:g,assignmentId:this.assignmentId}));const _=this.store.pipe((0,p.Ys)(W.g)).subscribe(A=>{A&&(this.toes=A.items)});this.subscriptions.push(_);const E=this.store.pipe((0,p.Ys)(d.HV),(0,x.q)(1)).subscribe(A=>{A.isEmpty()||(this.lastQueryParams=A,this.updateFilter(A.filter))});this.subscriptions.push(E)}ngAfterViewInit(){this.activatedRoute.snapshot.queryParamMap.has("show-trash")&&this.trash(),this.activatedRoute.snapshot.queryParamMap.has("show-admin-trash")&&this.adminTrash()}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe())}loadAuditTrailsList(){this.selection.clear();let e=null;e=this.lastQueryParams.isEmpty()?new I.Pm(this.filterConfiguration(),this.sort.direction,this.sort.active,this.paginator.pageIndex+1,this.paginator.pageSize):this.lastQueryParams,this.store.dispatch(new d.TC({page:e,assignmentId:this.assignmentId})),this.selection.clear()}filterConfiguration(){const e={};return this.filterToE&&this.filterToE.length>0&&(e.status=+this.filterToE),e.name="",e}valueChange(){this.lastQueryParams=new I.Pm({}),this.loadAuditTrailsList()}updateFilter(e){this.filterToE=e.status.toString()}deleteInteraction(e){const n=this.translate.instant("AUDIT_TRAIL.LIST.DIALOG.DELETE.TITLE"),s=this.translate.instant("AUDIT_TRAIL.LIST.DIALOG.DELETE.DESCRIPTION",{date:e.interaction_date}),r=this.translate.instant("AUDIT_TRAIL.LIST.DIALOG.DELETE.WAIT_DESCRIPTION");this.layoutUtilsService.deleteElementWithDescr(n,s,r).afterClosed().subscribe(m=>{m&&this.store.dispatch(new d.tI({id:e.id,trashDeleteDesc:m,userId:this.currentUser.id}))})}reachInteraction(e){this.router.navigate(["../audit-trails/show/",e.id],{relativeTo:this.activatedRoute})}isAllSelected(){return this.selection.selected.length===this.auditTrailResult.length}masterToggle(){this.selection.selected.length===this.auditTrailResult.length?this.selection.clear():this.auditTrailResult.forEach(e
1=>this.selection.select(e))}back(){this.backTitle!==this.translate.instant("GENERAL.TOOLTIP.BACK",{back_page:this.translate.instant("ASSIGNMENT.LIST.TITLE")})?this.location.back():this.router.navigate(["../toes"],{relativeTo:this.activatedRoute})}trash(){this.store.dispatch(new d._Z({isLoading:!0})),this.service.getTrashed(this.assignmentId).subscribe(e=>{this.store.dispatch(new d._Z({isLoading:!1}));const n=[];e.data.forEach(s=>{n.push({text:s.interaction_description,interaction_date:s.interaction_date,desc:`${s.trash_delete_descr}`,id:s.id.toString(),hasPermanentlyDelete:!0,date:s.user_deleted,userName:s.deleted_user_name})}),this.show_trash(n)})}adminTrash(){this.store.dispatch(new d._Z({isLoading:!0})),this.service.getAdminTrashed(this.assignmentId).subscribe(e=>{this.store.dispatch(new d._Z({isLoading:!1}));const n=[];e.data.forEach(s=>{n.push({text:s.interaction_description,interaction_date:s.interaction_date,id:s.id.toString(),hasPermanentlyDelete:!0,date:s.user_deleted,userName:s.deleted_user_name})}),this.show_trash(n,!0)})}show_trash(e,n=!1){const s=this.translate.instant("AUDIT_TRAIL.LIST.DIALOG.SHOW_TRASH.TITLE");this.layoutUtilsService.trashedAuditTrailEntities(s,e,this).afterClosed().subscribe(c=>{c&&this.router.navigate(["../audit-trails/trash-detail/",c.id],{relativeTo:this.activatedRoute})})}restore(e,n=!1){this.store.dispatch(n?new d.gQ({id:e}):new d.J$({id:e}))}};let i=a;return a.\u0275fac=function(n){return new(n||a)(t.Y36(C.gz),t.Y36(C.F0),t.Y36(b.uw),t.Y36(f.Ye),t.Y36(k.b8),t.Y36(I.eb),t.Y36(w.rn),t.Y36(v.sK),t.Y36(p.yh))},a.\u0275cmp=t.Xpm({type:a,selectors:[["kt-audit-list"]],viewQuery:function(n,s){if(1&n&&(t.Gf(G.NW,7),t.Gf(di,7)),2&n){let r;t.iGM(r=t.CRH())&&(s.paginator=r.first),t.iGM(r=t.CRH())&&(s.sort=r.first)}},decls:74,vars:48,consts:[[3,"viewLoading$","tooltipTitle","tooltipDesc"],["ktPortletTitle",""],[1,"kt-portlet-head-title"],["ktPortletTools",""],["mat-raised-button","",1,"btn","mr-2",3,"matTooltip","click"],[1,"kt-hidden-mobile"],[3,"menuItems","menuSubject","width","menuItemsChange","menuSubjectChange"],["class","ml-2 button-gray","mat-raised-button","","type","button",3,"matTooltip","click",4,"ngIf"],[1,"kt-form"],[1,"kt-form-filtration"],[1,"row","align-items-center","active"],[1,"col-md-2","kt-margin-bottom-10-mobile"],[1,"kt-form-control"],[1,"mat-form-field-fluid"],[3,"value","valueChange","selectionChange"],["value",""],["value","0"],[3,"value",4,"ngFor","ngForOf"],[1,"mat-table-wrapper"],["matSort","","matSortActive","created_at","matSortDirection","desc","matSortDisableClear","",1,"lmat-elevation-z8","table-striped",3,"dataSource"],["table","","sort1","matSort"],["matColumnDef","id"],["mat-sort-header","",4,"matHeaderCellDef"],[4,"matCellDef"],["matColumnDef","ref"],[4,"matHeaderCellDef"],["matColumnDef","interaction_date"],["matColumnDef","client_name"],["matColumnDef","terms_of_engagement_name"],["matColumnDef","asset_class_name"],["matColumnDef","impact_on_valuation"],["matColumnDef","created_at"],["matColumnDef","actions"],[4,"matHeaderRowDef"],[4,"matRowDef","matRowDefColumns"],["class","mat-table-message",4,"ngIf"],[1,"mat-table-bottom"],[3,"diameter",4,"ngIf"],[3,"pageSize","pageSizeOptions","length","showFirstLastButtons"],["mat-raised-button","","type","button",1,"ml-2","button-gray",3,"matTooltip","click"],[3,"value"],["mat-sort-header",""],["popTitle",""],["popContent",""],["mat-icon-button","","color","primary",3,"ngbPopover","popoverTitle",4,"ngIf"],["mat-icon-button","","color","warn","type","button",3,"matTooltip","click"],["mat-icon-button","","type","button",3,"matTooltip","click"],[3,"innerHTML"],["mat-icon-button","","color","primary",3,"ngbPopover","popoverTitle"],[3,"matTooltip"],[1,"mat-table-message"],[3,"diameter"]],template:function(n,s){1&n&&(t.TgZ(0,"kt-portlet")(1,"kt-portlet-header",0),t.ALo(2,"translate"),t.ALo(3,"translate"),t.ynx(4,1),t.TgZ(5,"h3",2)(6,"span"),t._uU(7),t.ALo(8,"translate"),t.qZA()(),t.BQk(),t.ynx(9,3),t.TgZ(10,"a",4),t.NdJ("click",function(){return s.back()}),t.TgZ(11,"mat-icon"),t._uU(12,"arrow_back"),t.qZA(),t.TgZ(13,"span",5),t._uU(14),t.ALo(15,"translate"),t.qZA()(),t.TgZ(16,"kt-context-menu-mad",6),t.NdJ("menuItemsChange",function(c){return s.menuItems=c})("menuSubjectChange",function(c){return s.menuSubject=c}),t.qZA(),t.YNc(17,mi,5,7,"button",7),t.BQk(),t.qZA(),t.TgZ(18,"kt-portlet-body")(19,"div",8)(20,"div",9)(21,"div",10)(22,"div",11)(23,"div",12)(24,"mat-form-field",13)(25,"mat-select",14),t.NdJ("valueChange",function(c){return s.filterToE=c})("selectionChange",function(){return s.valueChange()}),t.TgZ(26,"mat-option",15),t._uU(27),t.ALo(28,"translate"),t.qZA(),t.TgZ(29,"mat-option",16),t._uU(30),t.ALo(31,"translate"),t.qZA(),t.YNc(32,ui,2,2,"mat-option",17),t.qZA()()()()()()(),t.TgZ(33,"div",18)(34,"mat-table",19,20),t.ynx(37,21),t.YNc(38,pi,2,0,"mat-header-cell",22),t.YNc(39,hi,2,1,"mat-cell",23),t.BQk(),t.ynx(4
10,24),t.YNc(41,gi,2,0,"mat-header-cell",25),t.YNc(42,Ti,2,1,"mat-cell",23),t.BQk(),t.ynx(43,26),t.YNc(44,_i,3,3,"mat-header-cell",22),t.YNc(45,Ai,3,5,"mat-cell",23),t.BQk(),t.ynx(46,27),t.YNc(47,fi,3,3,"mat-header-cell",22),t.YNc(48,Ii,2,1,"mat-cell",23),t.BQk(),t.ynx(49,28),t.YNc(50,Li,3,3,"mat-header-cell",22),t.YNc(51,Ei,3,5,"mat-cell",23),t.BQk(),t.ynx(52,29),t.YNc(53,bi,3,3,"mat-header-cell",25),t.YNc(54,Ci,3,5,"mat-cell",23),t.BQk(),t.ynx(55,30),t.YNc(56,vi,3,3,"mat-header-cell",22),t.YNc(57,Zi,2,1,"mat-cell",23),t.BQk(),t.ynx(58,31),t.YNc(59,Ni,3,3,"mat-header-cell",22),t.YNc(60,Si,2,1,"mat-cell",23),t.BQk(),t.ynx(61,32),t.YNc(62,Oi,3,3,"mat-header-cell",25),t.YNc(63,Mi,16,7,"mat-cell",23),t.BQk(),t.YNc(64,Fi,1,0,"mat-header-row",33),t.YNc(65,ki,1,0,"mat-row",34),t.qZA(),t.YNc(66,Pi,3,3,"div",35),t.YNc(67,wi,3,3,"div",35),t.ALo(68,"async"),t.qZA(),t.TgZ(69,"div",36),t.YNc(70,Gi,1,1,"mat-spinner",37),t.ALo(71,"async"),t._UZ(72,"mat-paginator",38),t.ALo(73,"async"),t.qZA()()()),2&n&&(t.xp6(1),t.Tol("kt-portlet-head--lg"),t.Q6J("viewLoading$",s.dataSource.loading$)("tooltipTitle",t.lcZ(2,26,"TOOLTIP.AUDIT_TRAIL.LIST.TITLE"))("tooltipDesc",t.lcZ(3,28,"TOOLTIP.AUDIT_TRAIL.LIST.DESCRIPTION")),t.xp6(6),t.hij(" ",t.xi3(8,30,"AUDIT_TRAIL.LIST.TITLE",t.VKq(45,Ji,s.assignment?s.assignment.name:""))," "),t.xp6(3),t.Q6J("matTooltip",s.backTitle),t.xp6(4),t.hij(" ",t.lcZ(15,33,"GENERAL.BUTTON.BACK")," "),t.xp6(2),t.Q6J("menuItems",s.menuItems)("menuSubject",s.menuSubject)("width","200"),t.xp6(1),t.Q6J("ngIf",0!=s.trashCnt),t.xp6(8),t.Q6J("value",s.filterToE),t.xp6(2),t.Oqu(t.lcZ(28,35,"AUDIT_TRAIL.LIST.FILTER.TOE.VALUE.ALL")),t.xp6(3),t.hij(" ",t.lcZ(31,37,"AUDIT_TRAIL.LIST.FILTER.TOE.VALUE.GENERAL"),""),t.xp6(2),t.Q6J("ngForOf",s.toes),t.xp6(2),t.Q6J("dataSource",s.dataSource),t.xp6(30),t.Q6J("matHeaderRowDef",s.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",s.displayedColumns),t.xp6(1),t.Q6J("ngIf",!s.dataSource.hasItems),t.xp6(1),t.Q6J("ngIf",t.lcZ(68,39,s.dataSource.isPreloadTextViewed$)),t.xp6(3),t.Q6J("ngIf",t.lcZ(71,41,s.dataSource.loading$)),t.xp6(2),t.Q6J("pageSize",25)("pageSizeOptions",t.DdM(47,Yi))("length",t.lcZ(73,43,s.dataSource.paginatorTotal$))("showFirstLastButtons",!0))},dependencies:[f.sg,f.O5,Q.I,q.c,$.j,li.r,S.lW,S.zs,N.KE,J.gD,O.ey,h.BZ,h.fO,h.as,h.w1,h.Dz,h.nj,h.ge,h.ev,h.XQ,h.Gk,P.Hw,G.NW,Y.YE,Y.nU,tt.Ou,M.gM,F.o8,f.Ov,f.uU,v.X$,ci.W],styles:["button.mat-raised-button.mat-primary[_ngcontent-%COMP%]{margin-left:6px}.mat-column-id[_ngcontent-%COMP%]{flex:0 0 10%!important}.mat-column-ref[_ngcontent-%COMP%]{flex:0 0 80px}"],changeDetection:0}),i})();var qi=l(92218),nt=l(61555),R=l(85921),$i=l(59151),Et=l(81666),bt=l(61832),Ct=l(18234),vt=l(77883),ji=l(31640),Bi=l(35810);const Vi=["singleSelectToe"],Hi=["singleSelectInteractionType"],Ki=["singleSelectValuation"];function zi(i,a){if(1&i&&(t.TgZ(0,"div",43),t._uU(1),t.qZA()),2&i){const o=t.oxw();t.xp6(1),t.hij(" *",o.auditTrail.notes," ")}}function Wi(i,a){if(1&i){const o=t.EpF();t.TgZ(0,"kt-alert",44),t.NdJ("close",function(n){t.CHM(o);const s=t.oxw();return t.KtG(s.onAlertClose(n))}),t._uU(1),t.ALo(2,"translate"),t.qZA()}2&i&&(t.Q6J("type","warn")("duration",3e4)("showCloseButton",!0),t.xp6(1),t.hij(" ",t.lcZ(2,4,"GENERAL.MESSAGE.FORM_WARNING")," "))}function Xi(i,a){if(1&i){const o=t.EpF();t.TgZ(0,"button",45),t.NdJ("click",function(){t.CHM(o);const n=t.oxw();return t.KtG(n.clearDate(n.auditTrailForm.controls.interaction_date))}),t.ALo(1,"translate"),t.TgZ(2,"mat-icon"),t._uU(3,"close"),t.qZA()()}2&i&&t.Q6J("matTooltip",t.lcZ(1,1,"GENERAL.TOOLTIP.CLEAR"))}function tn(i,a){if(1&i&&(t.TgZ(0,"mat-option",46),t._uU(1),t.qZA()),2&i){const o=a.$implicit;t.Q6J("value",o.id),t.xp6(1),t.hij(" ",o.name," ")}}function en(i,a){if(1&i&&(t.TgZ(0,"mat-option",46),t._uU(1),t.qZA()),2&i){const o=a.$implicit;t.Q6J("value",o.id),t.xp6(1),t.hij(" ","Company"==o.type?o.name:o.name+" "+o.last_name," ")}}function nn(i,a){if(1&i&&(t.TgZ(0,"mat-option",46),t._uU(1),t.qZA()),2&i){const o=a.$implicit;t.Q6J("value",o.id),t.xp6(1),t.Oqu(o.name)}}const D=function(i){return{field:i}};function sn(i,a){if(1&i&&(t.TgZ(0,"div",47)(1,"mat-form-field",14)(2,"mat-select",48),t.ALo(3,"translate"),t.YNc(4,nn,2,2,"mat-option",24),t.qZA(),t._UZ(5,"mat-error",25),t.ALo(6,"translate"),t.ALo(7,"translate"),t.qZA()()),2&i){const o=t.oxw();
1t.xp6(2),t.Q6J("placeholder",t.lcZ(3,3,"AUDIT_TRAIL.FORM.FIELD.GENERAL.TARGET_PROPERTY.PLACEHOLDER")),t.xp6(2),t.Q6J("ngForOf",o.assetClasses),t.xp6(1),t.Q6J("innerHtml",t.xi3(6,5,"GENERAL.VALIDATION.REQUIRED",t.VKq(10,D,t.lcZ(7,8,"AUDIT_TRAIL.FORM.FIELD.GENERAL.TARGET_PROPERTY.NAME"))),t.oJD)}}function an(i,a){if(1&i&&(t.TgZ(0,"mat-option",46),t._uU(1),t.qZA()),2&i){const o=a.$implicit;t.Q6J("value",o.id),t.xp6(1),t.hij(" ",o.name," ")}}function on(i,a){if(1&i&&(t.TgZ(0,"mat-option",46),t._uU(1),t.qZA()),2&i){const o=a.$implicit;t.Q6J("value",o),t.xp6(1),t.hij(" ",o," ")}}const rn=function(i){return{back_page:i}},st=function(i){return{entry:i}},ln=["None","Our Side","Client Side","External"],cn=["None","Low","Medium","High"];let X=(()=>{const a=class{constructor(e,n,s,r,c,m,T,g,_,E,A){this.activatedRoute=e,this.router=n,this.fb=s,this.subheaderService=r,this.typesUtilsService=c,this.layoutUtilsService=m,this.store=T,this.layoutConfigService=g,this.auditTrailsService=_,this.location=E,this.translate=A,this.displayedColumns=["type","title","descr","actions"],this.participantsSubject=new L.X([]),this.clients=[],this.participantsSide=[],this.impactOnValuation=[],this.toes=[],this.interactionTypes=[],this.assetClasses=[],this.hasFormErrors=!1,this.dataLoaded=!1,this.readOnly=!1,this.dataSource=new h.by,this.subscriptions=[],this.agencyName=new L.X(null),this.agencyId$=new L.X(0),this.clientName=new L.X(null),this.clientId$=new L.X(0),this.toeSelected=new L.X(!1),this.toeId$=new L.X(0),this.atLeastOneParticipant$=new L.X(!1),this.filterCtrl=new u.p4,this.filterCtrlInteractionType=new u.p4,this.filterCtrlValuation=new u.p4,this._onDestroy=new qi.xQ,this.filteredSelectionModels=new nt.t(1),this.filteredInteractionTypes=new nt.t(1),this.filteredValuations=new nt.t(1),this.fileType="",this.isEdit=!1,this.saveState=!1,this.fileType=""}ngOnInit(){this.subheaderService.setTitle("New Interaction"),this.subheaderService.setBreadcrumbs([{title:"Main menu",page:"../default/assignment"},{title:"Assignments",page:"../default/assignment/assignments"},{title:"To do",page:"../default/assignment/assignments/todo"},{title:"Interactions",page:"../default/assignment/assignments/todo/audit-trails"},{title:"New",page:"../default/assignment/assignments/todo/audit-trails/add"}]),this.loading$=this.store.pipe((0,p.Ys)(d.V5)),this.assignmentId=Number(this.activatedRoute.snapshot.paramMap.get("id")),this.store.dispatch(new d.oP({id:this.assignmentId})),this.participantsSide=ln,this.impactOnValuation=cn,this.router.url.indexOf("trash-detail")>-1||this.router.url.indexOf("show")>-1?this.activatedRoute.data.subscribe(e=>{this.oldAuditTrail=e.data.data,this.auditTrail=Object.assign({},this.oldAuditTrail),this.dataLoaded=!0,this.readOnly=!0,this.createForm(),this.store.dispatch(new d.Ge({auditTrailId:this.auditTrail.id})),this.store.pipe((0,R.R)(this._onDestroy),(0,p.Ys)(d.nC)).subscribe(s=>{s&&this.participantsSubject.next(s)}),null!=this.auditTrail.terms_of_engagement_id?(this.toeSelected.next(!0),this.clientName.next(this.auditTrail.client_name),this.clientId$.next(this.auditTrail.client_id)):this.toeSelected.next(!1),this.toeId$.next(this.auditTrail.terms_of_engagement_id)}):this.router.url.indexOf("edit")>-1?this.activatedRoute.data.subscribe(e=>{this.oldAuditTrail=e.data.data,this.auditTrail=Object.assign({},this.oldAuditTrail),this.dataLoaded=!0,this.readOnly=!1,this.isEdit=!0,this.createForm(!0),this.store.dispatch(new d.Ge({auditTrailId:this.auditTrail.id})),this.store.pipe((0,R.R)(this._onDestroy),(0,p.Ys)(d.nC)).subscribe(s=>{s&&this.participantsSubject.next(s)}),null!=this.auditTrail.terms_of_engagement_id?(this.toeSelected.next(!0),this.clientName.next(this.auditTrail.client_name),this.clientId$.next(this.auditTrail.client_id)):this.toeSelected.next(!1),this.toeId$.next(this.auditTrail.terms_of_engagement_id),this.populateAssetClasses(this.auditTrail.terms_of_engagement_id)}):(this.oldAuditTrail=new d.EZ,this.oldAuditTrail.clear(),this.oldAuditTrail.interaction_date=this.typesUtilsService.getDateStringFromDate(new Date),this.auditTrail=Object.assign({},this.oldAuditTrail),this.dataLoaded=!0,this.readOnly=!1,this.createForm()),this.store.pipe((0,p.Ys)((0,d.DA)(this.assignmentId))).subscribe(e=>{e&&(this.assignment=e,this.agencyName.next(this.assignment.agency_name),this.agencyId$.next(this.assignment.agency_id))}),this.filterCtrl.valueChanges.pipe((0,R.R)(this._onDestroy)).subscribe(()=>{this.filterSelectionModels()}),this.filterCtrlInteractionType.valueChanges.pipe((0,R.R)(this._onDestroy)).subscribe(()=>{this.filterInteractionTypes()}),this.filterCtrlValuation.valueChanges.pipe((0,R.R)(this._onDestroy)).subscribe(()=>{this.filterValuations()}),this.readOnly&&0!=this.auditTrail.terms_of_engagement_id&&this.populateAssetClasses(this.auditTrail.terms_of_engagement_id)}ngAfterViewInit(){this.setInitialValueToE(),this.setInitialValueInteractionType(),this.setInitialValueValuation()}fetchSelects(){const e=this.store.pipe((0,p.Ys)(j.ar)).subscribe(m=>{m&&(this.currentUser=m)});this.subscriptions.push(e),this.store.dispatch(new y.gEx);const n=this.store.pipe((0,p.Ys)(y.L3D)).subscribe(m=>{this.clients=[],m&&(this.clients=m,this.auditTrailForm.controls.client_id.patchValue(this.auditTrail.client_id))});this.subscriptions.push(n),this.store.dispatch(new Ct.dcf);const s=this.store.pipe((0,p.Ys)(Ct.f$7)).subscribe(m=>{m&&(this.interactionTypes=m,this.filteredInteractionTypes.next(this.interactionTypes.slice()))});this.subscriptions.push(s);const r=new I.Pm({name:""},"asc","status",1,25);this.store.dispatch(new W.iJ({page:r,assignmentId:this.assignmentId}));const c=this.store.pipe((0,p.Ys)(W.g)).subscribe(m=>{m&&(this.toes=[{id:0,name:"General"}].concat(m.items),this.filteredSelectionModels.next(this.toes.slice()))});this.subscriptions.push(c),this.filteredValuations.next(this.impactOnValuation.slice())}ngOnDestroy(){this.componentSubscriptions&&this.componentSubscriptions.unsubscribe(),this.subscriptions.forEach(e
1=>e.unsubscribe())}getComponentTitle(){return this.auditTrail&&this.auditTrail.id&&this.readOnly?this.translate.instant("AUDIT_TRAIL.FORM.TITLE.DETAIL_VIEW",{id:this.auditTrail.ref_num,assignment_name:this.auditTrail.assignment_name}):this.auditTrail&&this.auditTrail.id&&!this.readOnly?this.translate.instant("AUDIT_TRAIL.FORM.TITLE.DETAIL",{id:this.auditTrail.ref_num,assignment_name:this.auditTrail.assignment_name}):this.translate.instant("AUDIT_TRAIL.FORM.TITLE.NEW",{assignment_name:this.assignment?this.assignment.name:""})}createForm(e=!1){this.auditTrailForm=this.fb.group({interaction_date:[{value:this.typesUtilsService.getDateFromString(this.auditTrail.interaction_date),disabled:this.readOnly||e},u.kI.required],client_id:[{value:this.auditTrail.client_id,disabled:!0}],terms_of_engagement_id:[{value:this.auditTrail.terms_of_engagement_id,disabled:this.readOnly||e},u.kI.required],asset_class_id:[{value:this.auditTrail.asset_class_id,disabled:this.readOnly||e}],interaction_type_id:[{value:this.auditTrail.interaction_type_id,disabled:this.readOnly||e},u.kI.required],interaction_description:[{value:this.auditTrail.interaction_description,disabled:this.readOnly},u.kI.required],location:[{value:this.auditTrail.location,disabled:this.readOnly}],impact_on_valuation:[{value:this.auditTrail.impact_on_valuation?this.auditTrail.impact_on_valuation:"",disabled:this.readOnly},u.kI.required],mitigation_strategy:[{value:this.auditTrail.mitigation_strategy?this.auditTrail.mitigation_strategy:"",disabled:this.readOnly},u.kI.required],mitigation_strategy1:[{value:this.auditTrail.mitigation_strategy1?this.auditTrail.mitigation_strategy1:"",disabled:this.readOnly},u.kI.required]}),this.auditTrailForm.controls.terms_of_engagement_id.valueChanges.subscribe(n=>{0!=n?(this.populateAssetClasses(n),this.auditTrailForm.controls.asset_class_id.setValidators([u.kI.required])):this.auditTrailForm.controls.asset_class_id.clearValidators(),this.auditTrailForm.controls.asset_class_id.updateValueAndValidity()}),this.fetchSelects()}isControlInvalid(e){const n=this.auditTrailForm.controls[e];return n.invalid&&n.touched}onAlertClose(e){this.hasFormErrors=!1}isFormValid(){const e=this.auditTrailForm.controls,s=e.interaction_description.value,m=e.mitigation_strategy.value;return e.interaction_date.value&&s&&s.length>0&&e.impact_on_valuation.value&&m&&m.length>0&&e.interaction_type_id.value}prepareAuditTrail(){const e=this.auditTrailForm.controls,n=new d.EZ;n.clear(),n.id=this.oldAuditTrail.id,n.assignment_id=this.assignmentId;const s=new Date(e.interaction_date.value);return n.interaction_date=s?this.typesUtilsService.getDateStringFromDate(s):"",n.client_id=e.client_id.value,n.terms_of_engagement_id=e.terms_of_engagement_id.value,n.asset_class_id=e.asset_class_id.value,n.interaction_description=e.interaction_description.value,n.interaction_type_id=e.interaction_type_id.value,n.location=e.location.value,n.user_id=this.currentUser.id,n.impact_on_valuation=e.impact_on_valuation.value,
1n.mitigation_strategy=e.mitigation_strategy.value,n.mitigation_strategy1=e.mitigation_strategy1.value,this.uploadFileComponent.res$.pipe((0,x.q)(1)).subscribe(r=>{r&&(n.picture=r.success)}),n}onSubmit(){const e=this.prepareAuditTrail();this.isEdit?this.updateAuditTrail(e):this.createAuditTrail(e)}updateAuditTrail(e){const n=[];for(const s of this.participantListComponent?this.participantListComponent.participants:[]){const r=Object.assign({},s);r.linked_id=this.auditTrail.id,n.push(r)}this.store.dispatch(new ji.OX({item:e,assignmentId:this.assignmentId,participants:n,fileList:this.uploadFileComponent?this.uploadFileComponent.uploadFiles:[]})),this.location.back()}createAuditTrail(e){const n=[];for(const s of this.participantListComponent?this.participantListComponent.participants:[]){const r=Object.assign({},s);r.linked_id=this.auditTrail.id,n.push(r)}this.store.dispatch(new d.fv({item:e,assignmentId:this.assignmentId,participants:n,fileList:this.uploadFileComponent?this.uploadFileComponent.uploadFiles:[]})),this.oldAuditTrail=e,this.componentSubscriptions=this.store.pipe((0,p.Ys)(d.UO),(0,$i.h)(s=>void 0!==s)).subscribe(s=>{if(!s)return;this.saveState=!0;const r=`${this.layoutConfigService.getCurrentMainRoute()}/assignment/assignments/${this.assignmentId}/audit-trails`;this.router.navigate([r],{relativeTo:this.activatedRoute})})}auditTrailSaveNotification(){this.hasFormErrors=!1;const e=this.auditTrailForm.controls;
1if(this.auditTrailForm.invalid)return Object.keys(e).forEach(m=>e[m].markAsTouched()),void(this.hasFormErrors=!0);const n=this.translate.instant("AUDIT_TRAIL.FORM.DIALOG.SAVE.TITLE"),s=this.translate.instant("AUDIT_TRAIL.FORM.DIALOG.SAVE.DESCRIPTION"),r=this.translate.instant("AUDIT_TRAIL.FORM.DIALOG.SAVE.WAIT_DESCRIPTION");this.layoutUtilsService.saveElement(n,s,r).afterClosed().subscribe(m=>{m&&this.onSubmit()})}changeClient(e){if(0!=e.value){this.toeSelected.next(!0);const n=this.toes.find(s=>s.id===Number(e.value));n?(this.auditTrailForm.controls.client_id.patchValue(n.client_id),this.clientName.next(n.client_name),this.clientId$.next(n.client_id),this.toeId$.next(n.id)):(this.auditTrailForm.controls.client_id.patchValue(null),this.toeSelected.next(!1),this.toeId$.next(null))}else this.toeSelected.next(!1),this.auditTrailForm.controls.client_id.patchValue(null),this.toeId$.next(null);this.participantsSubject.next(this.participantsSubject.value.filter(n=>null==n.ref_id))}canDeactivate(){if(this.discard()){if(window.confirm(this.translate.instant("GENERAL.MESSAGE.LOST_CHANGES")))return!0;{const n=this.router.createUrlTree([],this.activatedRoute.snapshot).toString();return this.location.go(n),!1}}return!0}discard(){const e=this.prepareAuditTrail();return!this.saveState&&(e.interaction_date!==this.oldAuditTrail.interaction_date||e.terms_of_engagement_id!==this.oldAuditTrail.terms_of_engagement_id||e.interaction_type_id!==this.oldAuditTrail.interaction_type_id||e.impact_on_valuation!==this.oldAuditTrail.impact_on_valuation||e.location!==this.oldAuditTrail.location||e.interaction_description!==this.oldAuditTrail.interaction_description||e.mitigation_strategy!==this.oldAuditTrail.mitigation_strategy)}beforeUnloadHander(e){this.discard()&&(e.preventDefault(),e.returnValue="test")}setInitialValueToE(){this.filteredSelectionModels.pipe((0,x.q)(1),(0,R.R)(this._onDestroy)).subscribe(()=>{this.singleSelectToe.compareWith=(e,n)=>e===n})}setInitialValueInteractionType(){this.filteredInteractionTypes.pipe((0,x.q)(1),(0,R.R)(this._onDestroy)).subscribe(()=>{this.singleSelectInteractionType.compareWith=(e,n)=>e===n})}setInitialValueValuation(){this.filteredValuations.pipe((0,x.q)(1),(0,R.R)(this._onDestroy)).subscribe(()=>{this.singleSelectValuation.compareWith=(e,n)=>e===n})}filterSelectionModels(){if(!this.toes)return;let e=this.filterCtrl.value;e&&""!==e?(e=e.toLowerCase(),this.filteredSelectionModels.next(this.toes.filter(n=>n.name.toLowerCase().indexOf(e)>-1))):this.filteredSelectionModels.next(this.toes.slice())}filterInteractionTypes(){if(!this.interactionTypes)return;let e=this.filterCtrlInteractionType.value;e&&""!==e?(e=e.toLowerCase(),this.filteredInteractionTypes.next(this.interactionTypes.filter(n=>n.name.toLowerCase().indexOf(e)>-1))):this.filteredInteractionTypes.next(this.interactionTypes.slice())}filterValuations(){if(!this.impactOnValuation)return;let e=this.filterCtrlValuation.value;e&&""!==e?(e=e.toLowerCase(),this.filteredValuations.next(this.impactOnValuation.filter(n=>n.toLowerCase().indexOf(e)>-1))):this.filteredValuations.next(this.impactOnValuation.slice())}populateAssetClasses(e){const n=new I.Pm({},"asc","status",1,25);this.store.dispatch(new vt._LP({page:n,toeId:e}));const s=this.store.pipe((0,p.Ys)(vt.pVw)).subscribe(r=>{r&&(this.assetClasses=[{id:0,name:"General"}].concat(r.items),this.auditTrail.asset_class_id&&this.auditTrailForm.controls.asset_class_id.setValue(this.auditTrail.asset_class_id))});this.subscriptions.push(s)}clearDate(e){e.setValue(null),e.updateValueAndValidity()}goBack(){this.readOnly||this.isEdit?this.location.back():this.router.navigate(["../"],{relativeTo:this.activatedRoute})}};let i=a;return a.\u0275fac=function(n){return new(n||a)(t.Y36(C.gz),t.Y36(C.F0),t.Y36(u.QS),t.Y36(k.b8),t.Y36(I.mz),t.Y36(I.eb),t.Y36(p.yh),t.Y36(k.JJ),t.Y36(w.rn),t.Y36(f.Ye),t.Y36(v.sK))},a.\u0275cmp=t.Xpm({type:a,selectors:[["kt-audit-edit"]],viewQuery:function(n,s){if(1&n&&(t.Gf(Et.k,7),t.Gf(bt.R,7),t.Gf(Vi,7),t.Gf(Hi,7),t.Gf(Ki,7)),2&n){let r;t.iGM(r=t.CRH())&&(s.participantListComponent=r.first),t.iGM(r=t.CRH())&&(s.uploadFileComponent=r.first),t.iGM(r=t.CRH())&&(s.singleSelectToe=r.first),t.iGM(r=t.CRH())&&(s.singleSelectInteractionType=r.first),t.iGM(r=t.CRH())&&(s.singleSelectValuation=r.first)}},hostBindings:function(n,s){1&n&&t.NdJ("beforeunload",function(c){return s.beforeUnloadHander(c)},!1,t.Jf7)},decls:150,vars:205,consts:[[3,"title","tooltipTitle","tooltipDesc","viewLoading$"],["ktPortletTools",""],["mat-raised-button","",1,"btn","mr-2",3,"matTooltip","click"],[1,"kt-hidden-mobile"],["href","javascript:;","color","submit","mat-raised-button","",1,"btn","btn-success","mr-2",3,"hidden","disabled","matTooltip","click"],[1,"kt-form",3,"formGroup"],[1,"kt-portlet-body","body_padding_top_zero"],["class","mb-4",4,"ngIf"],[3,"type","duration","showCloseButton","close",4,"ngIf"],[1,"form-group","kt-form-group","row"],[1,"col-md-12","kt-margin-bottom-20-mobile"],[1,"my-3","text-mad","text-uppercase"],[1,"active"],[1,"col-lg-4","kt-margin-bottom-20-mobile"],[1,"mat-form-field-fluid"],[3,"click"],["matInput","","formControlName","interaction_date",3,"matDatepicker","placeholder","value"],["matSuffix","",3,"for"],["mat-button","","matSuffix","","mat-icon-button","",3,"matTooltip","click",4,"ngIf"],["picker",""],[1,"col-lg-4","kt-margin-bottom-10-mobile"],["formControlName","terms_of_engagement_id",3,"placeholder","selectionChange"],["singleSelectToe",""],[3,"formControl","placeholderL
1abel","noEntriesFoundLabel"],[3,"value",4,"ngFor","ngForOf"],[3,"innerHtml"],["formControlName","client_id","id","client",1,"client",3,"placeholder"],["class","col-lg-12 kt-margin-bottom-10-mobile mt-4",4,"ngIf"],[1,"form-group","kt-form-group","row","section-margin-top-60"],["formControlName","interaction_type_id",3,"placeholder"],["singleSelectInteractionType",""],["matInput","","formControlName","location",3,"placeholder"],["formControlName","impact_on_valuation",3,"placeholder"],["singleSelectValuation",""],[1,"col-lg-12","kt-margin-bottom-20-mobile"],["matInput","","rows","4","formControlName","interaction_description",3,"placeholder"],["matInput","","rows","4","formControlName","mitigation_strategy",3,"placeholder"],["matInput","","rows","4","formControlName","mitigation_strategy1",3,"placeholder"],["matSuffix","",1,"cursor-pointer",3,"popoverTitle","ngbPopover","click"],[3,"agencyName","clientName","toeSelected","participantsSubject","atLeastOneParticipant$","readOnly","agencyId","clientId","toeId"],[1,"col-md-12","kt-margin-bottom-10-mobile"],[1,"cursor-pointer",3,"popoverTitle","ngbPopover","click"],["folderOnEditMode","",3,"filesOnEditMode","readOnly","fileType","descriptionField","parentForm"],[1,"mb-4"],[3,"type","duration","showCloseButton","close"],["mat-button","","matSuffix","","mat-icon-button","",3,"matTooltip","click"],[3,"value"],[1,"col-lg-12","kt-margin-bottom-10-mobile","mt-4"],["formControlName","asset_class_id",3,"placeholder"]],template:function(n,s){if(1&n){const r=t.EpF();t.TgZ(0,"kt-portlet")(1,"kt-portlet-header",0),t.ALo(2,"translate"),t.ALo(3,"translate"),t.ynx(4,1),t.TgZ(5,"a",2),t.NdJ("click",function(){return s.goBack()}),t.ALo(6,"translate"),t.ALo(7,"translate"),t.TgZ(8,"mat-icon"),t._uU(9,"arrow_back"),t.qZA(),t.TgZ(10,"span",3),t._uU(11),t.ALo(12,"translate"),t.qZA()(),t.TgZ(13,"a",4),t.NdJ("click",function(){return s.auditTrailSaveNotification()}),t.ALo(14,"translate"),t.TgZ(15,"span",3),t._uU(16),t.ALo(17,"translate"),t.qZA()(),t.BQk(),t.qZA(),t.TgZ(18,"kt-portlet-body")(19,"form",5)(20,"div",6),t.YNc(21,zi,2,1,"div",7),t.YNc(22,Wi,3,6,"kt-alert",8),t.TgZ(23,"div",9)(24,"div",10)(25,"h5",11),t._uU(26),t.ALo(27,"translate"),t.qZA(),t._UZ(28,"hr",12),t.qZA(),t.TgZ(29,"div",13)(30,"mat-form-field",14)(31,"span",15),t.NdJ("click",function(){t.CHM(r);const m=t.MAs(37);return t.KtG(m.open())}),t._UZ(32,"input",16),t.ALo(33,"translate"),t.qZA(),t._UZ(34,"mat-datepicker-toggle",17),t.YNc(35,Xi,4,3,"button",18),t._UZ(36,"mat-datepicker",null,19),t.qZA()(),t.TgZ(38,"div",20)(39,"mat-form-field",14)(40,"mat-select",21,22),t.NdJ("selectionChange",function(m){return s.changeClient(m)}),t.ALo(42,"translate"),t.TgZ(43,"mat-option"),t._UZ(44,"ngx-mat-select-search",23),t.ALo(45,"translate"),t.ALo(46,"translate"),t.ALo(47,"translate"),t.qZA(),t.YNc(48,tn,2,2,"mat-option",24),t.ALo(49,"async"),t.qZA(),t._UZ(50,"mat-error",25),t.ALo(51,"translate"),t.ALo(52,"translate"),t.qZA()(),t.TgZ(53,"div",13)(54,"mat-form-field",14)(55,"mat-select",26),t.ALo(56,"translate"),t.YNc(57,en,2,2,"mat-option",24),t.qZA(),t._UZ(58,"mat-error",25),t.ALo(59,"translate"),t.ALo(60,"translate"),t.qZA()(),t.YNc(61,sn,8,12,"div",27),t.qZA(),t.TgZ(62,"div",28)(63,"div",10)(64,"h5",11),t._uU(65),t.ALo(66,"translate"),t.qZA(),t._UZ(67,"hr",12),t.qZA(),t.TgZ(68,"div",20)(69,"mat-form-field",14)(70,"mat-select",29,30),t.ALo(72,"translate"),t.TgZ(73,"mat-option"),t._UZ(74,"ngx-mat-select-search",23),t.ALo(75,"translate"),t.ALo(76,"translate"),t.ALo(77,"translate"),t.qZA(),t.YNc(78,an,2,2,"mat-option",24),t.ALo(79,"async"),t.qZA(),t._UZ(80,"mat-error",25),t.ALo(81,"translate"),t.ALo(82,"translate"),t.qZA()(),t.TgZ(83,"div",20)(84,"mat-form-field",14),t._UZ(85,"input",31),t.ALo(86,"translate"),t.qZA()(),t.TgZ(87,"div",20)(88,"mat-form-field",14)(89,"mat-select",32,33),t.ALo(91,"translate"),t.TgZ(92,"mat-option"),t._UZ(93,"ngx-mat-select-search",23),t.ALo(94,"translate"),t.ALo(95,"translate"),t.ALo(96,"translate"),t.qZA(),t.YNc(97,on,2,2,"mat-option",24),t.ALo(98,"async"),t.qZA(),t._UZ(99,"mat-error",25),t.ALo(100,"translate"),t.ALo(101,"translate"),t.qZA()()(),t.TgZ(102,"div",9)(103,"div",34)(104,"mat-form-field",14),t._UZ(105,"textarea",35),t.ALo(106,"translate"),t._UZ(107,"mat-error",25),t.ALo(108,"translate"),t.ALo(109,"translate"),t.qZA()()(),t.TgZ(110,"div",9)(111,"div",34)(112,"mat-form-field",14),t._UZ(113,"textarea",36),t.ALo(114,"translate"),t._UZ(115,"mat-error",25),t.ALo(116,"translate"),t.ALo(117,"translate"),t.qZA()()(),t.TgZ(118,"div",9)(119,"div",34)(120,"mat-form-field",14),t._UZ(121,"textarea",37),t.ALo(122,"translate"),t.TgZ(123,"mat-icon",38),t.NdJ("click",function(m){return m.stopPropagation()}),t.ALo(124,"translate"),t.ALo(125,"translate"),t._uU(126,"help "),t.qZA(),t._UZ(127,"mat-error",25),t.ALo(128,"translate"),t.ALo(129,"translate"),t.qZA()()(),t.TgZ(130,"div",28)(131,"div",10)(132,"h5",11),t._uU(133),t.ALo(134,"translate"),t.qZA(),t._UZ(135,"hr",12),t.qZA(),t.TgZ(136,"div",10),t._UZ(137,"kt-participant-list",39),t.qZA()(),t.TgZ(138,"div",28)(139,"div",40)(140,"h5",11),t._uU(141),t.ALo(142,"translate"),t.TgZ(143,"mat-icon",41),t.NdJ("click",function(m){return m.stopPropagation()}),t.ALo(144,"translate"),t.ALo(145,"translate"),t._uU(146,"help "),t.qZA()(),t._UZ(147,"hr",12),t.qZA(),t.TgZ(148,"div",10),t._UZ(149,"kt-upload-file",42),t.qZA()()()()()()}if(2&n){const r=t.MAs(37);
1t.xp6(1),t.Tol("kt-portlet-head--lg"),t.Q6J("title",s.getComponentTitle())("tooltipTitle",t.lcZ(2,72,"TOOLTIP.AUDIT_TRAIL.FORM"+(s.auditTrail&&s.auditTrail.id>0?"_EDIT":"")+".TITLE"))("tooltipDesc",t.lcZ(3,74,"TOOLTIP.AUDIT_TRAIL.FORM"+(s.auditTrail&&s.auditTrail.id>0?"_EDIT":"")+".DESCRIPTION"))("viewLoading$",s.loading$),t.xp6(4),t.Q6J("matTooltip",t.xi3(6,76,"GENERAL.TOOLTIP.BACK",t.VKq(183,rn,t.lcZ(7,79,"AUDIT_TRAIL.FORM.TITLE.LIST")))),t.xp6(6),t.hij(" ",t.lcZ(12,81,"GENERAL.BUTTON.BACK")," "),t.xp6(2),t.Q6J("hidden",s.readOnly)("disabled",!s.isFormValid())("matTooltip",t.lcZ(14,83,"GENERAL.TOOLTIP.SAVE")),t.xp6(3),t.hij(" ",t.lcZ(17,85,"GENERAL.BUTTON.SAVE")," "),t.xp6(3),t.Q6J("formGroup",s.auditTrailForm),t.xp6(2),t.Q6J("ngIf",s.auditTrail.notes),t.xp6(1),t.Q6J("ngIf",s.hasFormErrors),t.xp6(4),t.hij(" ",t.lcZ(27,87,"AUDIT_TRAIL.FORM.FIELD.GENERAL.SECTION_TITLE")," "),t.xp6(6),t.Q6J("matDatepicker",r)("placeholder",t.lcZ(33,89,"AUDIT_TRAIL.FORM.FIELD.GENERAL.DATE_OF_INTERACTION.PLACEHOLDER"))("value","hello"),t.xp6(2),t.Q6J("for",r),t.xp6(1),t.Q6J("ngIf",!s.readOnly&&s.auditTrailForm.controls.interaction_date.value),t.xp6(5),t.Q6J("placeholder",t.lcZ(42,91,"AUDIT_TRAIL.FORM.FIELD.GENERAL.TOE.PLACEHOLDER")),t.xp6(4),t.Q6J("formControl",s.filterCtrl)("placeholderL
1abel",t.lcZ(45,93,"GENERAL.PLACEHOLDER.SEARCH"))("noEntriesFoundLabel",t.xi3(46,95,"GENERAL.MESSAGE.NOT_FOUND",t.VKq(185,st,t.lcZ(47,98,"AUDIT_TRAIL.FORM.FIELD.GENERAL.TOE.NAME")))),t.xp6(4),t.Q6J("ngForOf",t.lcZ(49,100,s.filteredSelectionModels)),t.xp6(2),t.Q6J("innerHtml",t.xi3(51,102,"GENERAL.VALIDATION.REQUIRED",t.VKq(187,D,t.lcZ(52,105,"AUDIT_TRAIL.FORM.FIELD.GENERAL.TOE.NAME"))),t.oJD),t.xp6(5),t.Q6J("placeholder",t.lcZ(56,107,"AUDIT_TRAIL.FORM.FIELD.GENERAL.CLIENT.PLACEHOLDER")),t.xp6(2),t.Q6J("ngForOf",s.clients),t.xp6(1),t.Q6J("innerHtml",t.xi3(59,109,"GENERAL.VALIDATION.REQUIRED",t.VKq(189,D,t.lcZ(60,112,"AUDIT_TRAIL.FORM.FIELD.GENERAL.CLIENT.NAME"))),t.oJD),t.xp6(3),t.Q6J("ngIf",0!=s.auditTrailForm.controls.terms_of_engagement_id.value),t.xp6(4),t.hij(" ",t.lcZ(66,114,"AUDIT_TRAIL.FORM.FIELD.INTERACTION_DETAIL.SECTION_TITLE")," "),t.xp6(5),t.Q6J("placeholder",t.lcZ(72,116,"AUDIT_TRAIL.FORM.FIELD.INTERACTION_DETAIL.INTERACTION_TYPE.PLACEHOLDER")),t.xp6(4),t.Q6J("formControl",s.filterCtrlInteractionType)("placeholderL
1abel",t.lcZ(75,118,"GENERAL.PLACEHOLDER.SEARCH"))("noEntriesFoundLabel",t.xi3(76,120,"GENERAL.MESSAGE.NOT_FOUND",t.VKq(191,st,t.lcZ(77,123,"AUDIT_TRAIL.FORM.FIELD.INTERACTION_DETAIL.INTERACTION_TYPE.NAME")))),t.xp6(4),t.Q6J("ngForOf",t.lcZ(79,125,s.filteredInteractionTypes)),t.xp6(2),t.Q6J("innerHtml",t.xi3(81,127,"GENERAL.VALIDATION.REQUIRED",t.VKq(193,D,t.lcZ(82,130,"AUDIT_TRAIL.FORM.FIELD.INTERACTION_DETAIL.INTERACTION_TYPE.NAME"))),t.oJD),t.xp6(5),t.Q6J("placeholder",t.lcZ(86,132,"AUDIT_TRAIL.FORM.FIELD.INTERACTION_DETAIL.LOCATION.PLACEHOLDER")),t.xp6(4),t.Q6J("placeholder",t.lcZ(91,134,"AUDIT_TRAIL.FORM.FIELD.INTERACTION_DETAIL.EXPECTED_IMPACT_ON_VAL.PLACEHOLDER")),t.xp6(4),t.Q6J("formControl",s.filterCtrlValuation)("placeholderLabel",t.lcZ(94,136,"GENERAL.PLACEHOLDER.SEARCH"))("noEntriesFoundLabel",t.xi3(95,138,"GENERAL.MESSAGE.NOT_FOUND",t.VKq(195,st,t.lcZ(96,141,"AUDIT_TRAIL.FORM.FIELD.INTERACTION_DETAIL.EXPECTED_IMPACT_ON_VAL.NAME")))),t.xp6(4),t.Q6J("ngForOf",t.lcZ(98,143,s.filteredValuations)),t.xp6(2),t.Q6J("innerHtml",t.xi3(100,145,"GENERAL.VALIDATION.REQUIRED",t.VKq(197,D,t.lcZ(101,148,"AUDIT_TRAIL.FORM.FIELD.INTERACTION_DETAIL.EXPECTED_IMPACT_ON_VAL.NAME"))),t.oJD),t.xp6(6),t.Q6J("placeholder",t.lcZ(106,150,"AUDIT_TRAIL.FORM.FIELD.INTERACTION_DETAIL.INTERACTION_DESC.PLACEHOLDER")),t.xp6(2),t.Q6J("innerHtml",t.xi3(108,152,"GENERAL.VALIDATION.REQUIRED",t.VKq(199,D,t.lcZ(109,155,"AUDIT_TRAIL.FORM.FIELD.INTERACTION_DETAIL.INTERACTION_DESC.NAME"))),t.oJD),t.xp6(6),t.Q6J("placeholder",t.lcZ(114,157,"AUDIT_TRAIL.FORM.FIELD.INTERACTION_DETAIL.EXP_ACTION_MIT_STRA.PLACEHOLDER")),t.xp6(2),t.Q6J("innerHtml",t.xi3(116,159,"GENERAL.VALIDATION.REQUIRED",t.VKq(201,D,t.lcZ(117,162,"AUDIT_TRAIL.FORM.FIELD.INTERACTION_DETAIL.EXP_ACTION_MIT_STRA.NAME"))),t.oJD),t.xp6(6),t.Q6J("placeholder",t.lcZ(122,164,"AUDIT_TRAIL.FORM.FIELD.INTERACTION_DETAIL.INPUT.PLACEHOLDER")),t.xp6(2),t.Q6J("popoverTitle",t.lcZ(124,166,"TOOLTIP.AUDIT_TRAIL.FORM_FIELD.INPUT.TITLE"))("ngbPopover",t.lcZ(125,168,"TOOLTIP.AUDIT_TRAIL.FORM_FIELD.INPUT.DESCRIPTION")),t.xp6(4),t.Q6J("innerHtml",t.xi3(128,170,"GENERAL.VALIDATION.REQUIRED",t.VKq(203,D,t.lcZ(129,173,"AUDIT_TRAIL.FORM.FIELD.INTERACTION_DETAIL.INPUT.NAME"))),t.oJD),t.xp6(6),t.hij(" ",t.lcZ(134,175,"AUDIT_TRAIL.FORM.FIELD.PARTICIPANTS.SECTION_TITLE")," "),t.xp6(4),t.Q6J("agencyName",s.agencyName)("clientName",s.clientName)("toeSelected",s.toeSelected)("participantsSubject",s.participantsSubject)("atLeastOneParticipant$",s.atLeastOneParticipant$)("readOnly",s.readOnly)("agencyId",s.agencyId$)("clientId",s.clientId$)("toeId",s.toeId$)("readOnly",s.readOnly),t.xp6(4),t.hij(" ",t.lcZ(142,177,"AUDIT_TRAIL.FORM.FIELD.ATTACHMENTS.SECTION_TITLE")," "),t.xp6(2),t.Q6J("popoverTitle",t.lcZ(144,179,"AUDIT_TRAIL.FORM.POP_OVER.UPLOAD_FILE.TITLE"))("ngbPopover",t.lcZ(145,181,"AUDIT_TRAIL.FORM.POP_OVER.UPLOAD_FILE.DESCRIPTION")),t.xp6(6),t.Q6J("filesOnEditMode",s.auditTrail.audit_file)("readOnly",s.readOnly)("fileType",s.fileType)("descriptionField",!0)("parentForm","audit")}},dependencies:[f.sg,f.O5,Q.I,q.c,$.j,Bi.w,u._Y,u.Fj,u.JJ,u.JL,u.oH,u.sg,u.u,S.lW,S.zs,N.TO,N.KE,N.R9,J.gD,O.ey,V.Nt,P.Hw,U.Mq,U.hl,U.nW,M.gM,Et.k,bt.R,ut.nu,F.o8,f.Ov,v.X$],styles:["button.mat-raised-button.mat-primary[_ngcontent-%COMP%]{margin-left:6px}textarea[_ngcontent-%COMP%]{height:70px}.body_padding_top_zero[_ngcontent-%COMP%]{padding-top:0!important}img[_ngcontent-%COMP%]{width:30px}.client[_ngcontent-%COMP%] .mat-select-arrow[_ngcontent-%COMP%]{visibility:hidden}.readonly[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{pointer-events:none}"]}),i})(),at=(()=>{const a=class{constructor(e){this.auditTrailsService=e}resolve(e){const n=Number(e.params.audit_id);return this.auditTrailsService.getById(n)}};let i=a;return a.\u0275fac=function(n){return new(n||a)(t.LFG(d.rn))},a.\u0275prov=t.Yz7({token:a,factory:a.\u0275fac}),i})(),Zt=(()=>{const a=class{constructor(e){this.auditTrailsService=e}resolve(e){const n=Number(e.params.audit_id);return this.auditTrailsService.getById(n)}};let i=a;return a.\u0275fac=function(n){return new(n||a)(t.LFG(w.rn))}
1,a.\u0275prov=t.Yz7({token:a,factory:a.\u0275fac}),i})();var dn=l(36953),mn=l(46798),un=l(1049),pn=l(92303),hn=l(56654);const gn=[{path:"",component:Bt,children:[{path:"",redirectTo:"assignments",pathMatch:"full"},{path:"assignments",component:Be},{path:"assignments/add",component:ct,canDeactivate:[Z.Ic]},{path:"assignments/edit/:id",component:ct,canDeactivate:[Z.Ic]},{path:"assignments/:id/audit-trails",resolve:{data:mt},component:Qi},{path:"assignments/:id/audit-trails/add",component:X,canDeactivate:[Z.Ic]},{path:"assignments/:id/audit-trails/edit/:audit_id",component:X,resolve:{data:at}},{path:"assignments/:id/audit-trails/show/:audit_id",component:X,resolve:{data:at}},{path:"assignments/:id/audit-trails/trash-detail/:audit_id",component:X,resolve:{data:Zt}},{path:"assignments/:ass_id",loadChildren:()=>Promise.resolve().then(l.bind(l,47335)).then(i=>i.ToeModule),resolve:{data:pt}}]}];let Tn=(()=>{const a=class{};let i=a;return a.\u0275fac=function(n){return new(n||a)},a.\u0275mod=t.oAB({type:a}),a.\u0275inj=t.cJS({providers:[{provide:O._A,useClass:mn.T,deps:[O.Ad,Qt.o8]},{provide:O.sG,useValue:{parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"DD MMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}}},I.mz,I.eb,I.Oe,w.FM,w.rn,w.IB,d.CV,I.mz,mt,Zt,pt,at,Z.Ic],imports:[b.Is,O.Dn,f.ez,yt.JF,qt._,Dt.VI.forChild(),C.Bz.forChild(gn),u.u5,u.UX,v.aw.forChild(),S.ot,Ot.Tx,J.LD,V.c,h.p0,Nt.Bb,xt.Fk,P.Ps,O.XK,rt.Cv,U.FA,St.QW,G.TU,Y.JX,B.p9,tt.Cq,lt.ZX,Rt.Nh,M.AV,F.ZQ,Yt.xC,$t.m,ut.Co,F.IJ,F.dT,jt.t,p.Aw.forFeature("assignments",d.gr),H.sQ.forFeature([d.Qy]),p.Aw.forFeature("auditTrails",d.T_),H.sQ.forFeature([d.JP]),p.Aw.forFeature("auditTrailParticipants",d.K4),H.sQ.forFeature([d.o0]),p.Aw.forFeature("auditTrailReports",d.Zb),H.sQ.forFeature([dn.dt,d.Uu]),un.z,pn.I,hn.g]}),i})()}}]); 2//# sourceMappingURL=766.7c60c4867cd86ec9.js.map
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.