"use strict";(self.webpackChunkclam_av=self.webpackChunkclam_av||[]).push([[792],{1636:(x,A,c)=>{var y=c(345),t=c(3953),z=c(8658),M=c(7820),j=c(2691),u=c(4369),r=c(9417),h=c(6381),_=c(1413),b=c(6977),p=function(n){return n.root="",n.cleanupPage="cleanup",n.newScanPage="newscan",n.scannerPage="scanner",n.doCleanupPage="docleanup",n}(p||{}),$=function(n){return n.scanPath="scanpath",n.disinfect="actions",n}($||{}),m=function(n){return n.disinfect="cleanse_mailbox",n.quarantine="quarantine",n.destroy="delete",n.ignore="ignore",n}(m||{}),g=function(n){return n.file="File",n.virus="Virus",n.disinfect="Disinfect",n.quarantine="Quarantine",n.destroy="Destroy",n.ignore="Ignore",n}(g||{}),k=function(n){return n.done="done",n.running="running",n}(k||{}),Y=function(n){return n.done="done",n.step="step",n}(Y||{}),F=function(n){return n.cleansed="mailbox-cleansed",n.deleted="deleted",n.error="error",n.noAction="no-action",n.quarantined="quarantined",n.success="success",n.warning="warning",n}(F||{}),f=function(n){return n.namespace="ClamScanner",n.startScan="start_scan",n.getScanStatus="get_scan_status",n.getScanPath="get_scan_paths",n.listInfectedFiles="list_infected_files",n.disinfectedFiles="disinfect_files",n.checkDisinfectedStatus="check_disinfection_status",n.scanTypeArgs="scan_type",n.virusesArg="viruses",n.actionsArg="actions",n}(f||{}),D=function(n){return n.failedToStartScan="FAILED_TO_START_SCAN",n.noScanpathOrData="NO_SCANPATH_OR_DATA",n.failedToFetchScanStatus="FAILED_TO_FETCH_SCAN_STATUS",n.internalError="INTERNAL_ERROR",n}(D||{}),C=function(n){return n.failedToFetchInfectedFiles="FAILED_TO_FETCH_INFECTED_FILES",n.internalError="INTERNAL_ERROR",n}(C||{}),T=function(n){return n.failedToStartDisinfection="FAILED_TO_START_DISINFECTION",n.noVirusActionsOrData="NO_VIRUS_ACTIONS_OR_DATA",n.failedToFetchDisinfectStatus="FAILED_TO_FETCH_DISINFECT_STATUS",n.internalError="INTERNAL_ERROR",n}(T||{}),X=c(7673),S=c(6354),G=c(9437),w=c(8141),V=c(7048),R=c(6697),Q=c(2690),W=c(8810),q=c(983),Z=c(7083);let O;const it={interval:2e3,initialDelay:0,maxAttempts:5},B=(n,a=it)=>(0,Q.O)(a.initialDelay,a.interval).pipe((0,Z.K)(n.pipe(st(a.maxAttempts)))).pipe((0,w.M)(()=>O=a.maxAttempts)),st=n=>(O=n,(0,G.W)(a=>(console.error(a),O--<=1?(0,W.$)(`Polling failed ${n} times in succession.`):q.w)));var I=c(3280),U=c(6802);const at=n=>{const a={};for(const e of n){const i=Object.keys(e)[0];a[i]=e[i]}return a};var ct=c(6822);let E=(()=>{class n{constructor(e){this._http=e}getScanPaths(){const e=new I.V({namespace:f.namespace,method:f.getScanPath});return this._http.get(e).pipe((0,S.T)(i=>{if(1===i.status)return i.data;throw i.errors.pop()}))}startScan(e){const i=new I.V({namespace:f.namespace,method:f.startScan,arguments:[new U.e(f.scanTypeArgs,e)]});return this._http.get(i).pipe((0,S.T)(s=>{if(1===s.status)return!0;throw s.errors.pop()}))}getScanStatus(){const e=new I.V({namespace:f.namespace,method:f.getScanStatus});return this._http.get(e).pipe((0,S.T)(i=>{if(1===i.status)return i.data;throw i.errors.pop()}))}getInfectedFiles(){const e=new I.V({namespace:f.namespace,method:f.listInfectedFiles});return this._http.get(e).pipe((0,S.T)(i=>{if(1===i.status)return i.data;throw i.errors.pop()}))}startDisinfect(e){const i=new I.V({namespace:f.namespace,method:f.disinfectedFiles,arguments:[new U.e(f.actionsArg,at(e))],config:{json:!0}});return this._http.post(i).pipe((0,S.T)(s=>{if(1===s.status)return!0;throw s.errors.pop()}))}getDisinfectStatus(){const e=new I.V({namespace:f.namespace,method:f.checkDisinfectedStatus});return this._http.get(e).pipe((0,S.T)(i=>{if(1===i.status)return i.data;throw i.errors.pop()}))}static#t=this.\u0275fac=function(i){return new(i||n)(t.KVO(ct.dF))};static#e=this.\u0275prov=t.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var l=c(6805);let N=(()=>{class n{constructor(e,i,s,o){this._router=e,this.locale=i,this._alertService=s,this._clamApiService=o,this.disinfectStatusSubject=new _.B,this.infectedFilesSubject=new _.B,this.disinfectErrorSubject=new _.B,this.doDisinfectErrorSubject=new _.B}getInfectedFiles(){this.getMappedInfectedFiles().subscribe(e=>this.infectedFilesSubject.next(e),()=>{this.disinfectErrorSubject.next(C.failedToFetchInfectedFiles)})}getMappedInfectedFiles(){return this._clamApiService.getInfectedFiles().pipe((0,S.T)(e=>e.map(i=>({...i,virusInMailDir:i.file.includes("/mail/")||i.file.startsWith("mail/")}))),(0,G.W)(()=>(0,X.of)([])))}goToDoDisinfectPage(e){this._router.navigate([p.doCleanupPage],{state:{values:e}})}startDisinfect({virusesWithActions:e,disinfectStatus:i}){i?(this.disinfectStatusSubject.next(i),this.startPolling()):!i&&e?this._startFreshDisinfection(e):this._checkForOngoingDisinfection()}startPolling(e){B(this._clamApiService.getDisinfectStatus(),e).pipe((0,w.M)(i=>this.disinfectStatusSubject.next(i)),(0,V.v)(i=>i.status!==k.done)).subscribe({error:()=>{this.doDisinfectErrorSubject.next(T.failedToFetchDisinfectStatus);const i=this.locale.maketext("The system failed to fetch the disinfect status.");this._alertService.error(i)}})}_startFreshDisinfection(e){this._clamApiService.startDisinfect(e).pipe((0,R.s)(1)).subscribe(()=>this.startPolling(),()=>{this.doDisinfectErrorSubject.next(T.failedToStartDisinfection);const i=this.locale.maketext("The system failed to start the disinfection process in the background.");this._alertService.error(i)})}_checkForOngoingDisinfection(){this._clamApiService.getDisinfectStatus().subscribe(e=>{e?.status===k.running&&this.startPolling(),this.disinfectStatusSubject.next(e)},()=>{this.doDisinfectErrorSubject.next(T.internalError);const e=this.locale.maketext("Internal Error"),i=this.locale.maketext("If this condition persists, contact your system administrator.");this._alertService.error(`${e} ${i}`)})}static#t=this.\u0275fac=function(i){return new(i||n)(t.KVO(u.Ix),t.KVO(h.h),t.KVO(l.uE),t.KVO(E))};static#e=this.\u0275prov=t.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var d=c(177);let P=(()=>{class n{constructor(e,i){this.locale=e,this._alertService=i,this.rootRoute=p.root}clearAlerts(){this._alertService.clear()}static#t=this.\u0275fac=function(i){return new(i||n)(t.rXU(h.h),t.rXU(l.uE))};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["cp-clam-start-scan-link"]],decls:2,vars:2,consts:[["id","start-scan-link__error-link",1,"start-scan-link__error-link",3,"click","routerLink"]],template:function(i,s){1&i&&(t.j41(0,"a",0),t.bIt("click",function(){return s.clearAlerts()}),t.EFF(1),t.k0s()),2&i&&(t.Y8G("routerLink",s.rootRoute),t.R7$(),t.JRh(s.locale.maketext("Start a New Scan")))},dependencies:[u.Wk],styles:[".start-scan-link__error-link[_ngcontent-%COMP%]{display:block;margin-top:10px}"]})}return n})();function ot(n,a){1&n&&t.nrm(0,"cp-loading-spinner",5)}function rt(n,a){if(1&n&&(t.j41(0,"div"),t.EFF(1),t.k0s()),2&n){const e=t.XpG(2);t.R7$(),t.SpI(" ",e.locale.maketext("The system failed to fetch the infected files.")," ")}}function lt(n,a){if(1&n&&(t.j41(0,"div"),t.EFF(1),t.k0s()),2&n){const e=t.XpG(2);t.R7$(),t.SpI(" ",e.locale.maketext("Internal Error")," ")}}function dt(n,a){if(1&n&&(t.j41(0,"cp-callout",6)(1,"h3",7),t.EFF(2),t.k0s(),t.qex(3,8),t.DNE(4,rt,2,1,"div",9)(5,lt,2,1,"div",9),t.bVm(),t.j41(6,"div"),t.EFF(7),t.k0s(),t.nrm(8,"cp-clam-start-scan-link"),t.k0s()),2&n){const e=t.XpG();t.R7$(2),t.SpI(" ",e.locale.maketext("Oops!")," "),t.R7$(),t.Y8G("ngSwitch",e.errorMessage),t.R7$(),t.Y8G("ngSwitchCase",e.disinfectErrorMessage.failedToFetchInfectedFiles),t.R7$(),t.Y8G("ngSwitchCase",e.disinfectErrorMessage.internalError),t.R7$(2),t.SpI(" ",e.locale.maketext("If this condition persists, contact your system administrator.")," ")}}function pt(n,a){if(1&n&&(t.j41(0,"cp-callout",10)(1,"h3",7),t.EFF(2),t.k0s(),t.nrm(3,"cp-clam-start-scan-link"),t.k0s()),2&n){const e=t.XpG();t.R7$(2),t.SpI(" ",e.locale.maketext("No cleanup process found.")," ")}}function ft(n,a){1&n&&(t.j41(0,"span"),t.EFF(1,"* "),t.k0s())}function ut(n,a){if(1&n&&(t.j41(0,"th"),t.DNE(1,ft,2,0,"span",3),t.EFF(2),t.k0s()),2&n){const e=a.$implicit,i=t.XpG(2);t.R7$(),t.Y8G("ngIf",e.id===i.disinfectTableHeaders.disinfect),t.R7$(),t.SpI(" ",e.label," ")}}function _t(n,a){if(1&n&&t.nrm(0,"input",20),2&n){const e=t.XpG().$implicit,i=t.XpG().$implicit;t.Y8G("formControlName",i.file)("id","disinfect__"+i.file+"--"+e)("name",i.file)("value",e)}}function ht(n,a){if(1&n&&(t.j41(0,"td"),t.DNE(1,_t,1,4,"input",19),t.k0s()),2&n){const e=a.$implicit,i=t.XpG().$implicit,s=t.XpG(2);t.R7$(),t.Y8G("ngIf",s.showDisinfectRadio(e,i))}}function mt(n,a){if(1&n&&(t.j41(0,"tr",17)(1,"td",18),t.EFF(2),t.k0s(),t.j41(3,"td",18),t.EFF(4),t.k0s(),t.DNE(5,ht,2,1,"td",13),t.k0s()),2&n){const e=a.$implicit,i=a.index,s=t.XpG(2);t.Y8G("formGroupName",i)("id","disinfect__row-"+e.file),t.R7$(),t.Y8G("id","disinfect__file-"+e.file),t.R7$(),t.SpI(" ",e.file," "),t.R7$(),t.Y8G("id","disinfect__virus_type-"+e.virus_type),t.R7$(),t.SpI(" ",e.virus_type," "),t.R7$(),t.Y8G("ngForOf",s.actions)}}function gt(n,a){if(1&n){const e=t.RV6();t.j41(0,"th")(1,"input",21),t.bIt("click",function(){const s=t.eBV(e).$implicit,o=t.XpG(2);return t.Njj(o.selectAll(s))}),t.k0s()()}if(2&n){const e=a.$implicit,i=t.XpG(2);t.R7$(),t.Y8G("id","disinfect__all--"+e)("value",i.locale.maketext("Select All"))}}function Ft(n,a){if(1&n){const e=t.RV6();t.j41(0,"section")(1,"form",11),t.bIt("ngSubmit",function(){t.eBV(e);const s=t.XpG();return t.Njj(s.submit())}),t.j41(2,"table",12)(3,"thead")(4,"tr"),t.DNE(5,ut,3,2,"th",13),t.k0s()(),t.qex(6,14),t.j41(7,"tbody"),t.DNE(8,mt,6,7,"tr",15),t.k0s(),t.bVm(),t.j41(9,"tfoot")(10,"tr")(11,"th"),t.EFF(12,"\xa0"),t.k0s(),t.j41(13,"th"),t.EFF(14,"\xa0"),t.k0s(),t.DNE(15,gt,2,2,"th",13),t.k0s()()(),t.j41(16,"button",16),t.EFF(17),t.k0s()()()}if(2&n){const e=t.XpG();t.R7$(),t.Y8G("formGroup",e.formGroup),t.R7$(4),t.Y8G("ngForOf",e.tableHeaders),t.R7$(3),t.Y8G("ngForOf",e.infectedFilesData)("ngForTrackBy",e.trackByFile),t.R7$(7),t.Y8G("ngForOf",e.actions),t.R7$(2),t.SpI(" ",e.locale.maketext("Process Cleanup")," ")}}function St(n,a){if(1&n&&(t.j41(0,"div",22),t.EFF(1),t.k0s()),2&n){const e=t.XpG();t.R7$(),t.SpI(" * ",e.locale.maketext("Only mailboxes can be disinfected."),"\n")}}let vt=(()=>{class n{constructor(e,i,s,o){this.locale=e,this._disinfectFacadeService=i,this._router=s,this._fb=o,this.submitted=!1,this.disinfectTableHeaders=g,this.actions=Object.values(m),this.showDisinfectNotice=!0,this.loading=!0,this.disinfectErrorMessage=C,this._destroy$=new _.B,this.formGroup=this._fb.group({formArray:this._fb.array([])}),this._infectedFormArray=this.formGroup.get("formArray"),this._initTableHeaders(),this._subscribeToDisinfectErrorSubject(),this._subscribeToInfectedFilesSubject(),this.infectedFilesData=this._router.getCurrentNavigation().extras.state}canDeactivate(){return!this.loading&&!this.infectedFilesData?.length||this.submitted}ngOnInit(){this.infectedFilesData?this._initInfectedFilesFormAndSetDisinfectFlag():this._disinfectFacadeService.getInfectedFiles()}ngOnDestroy(){this._destroy$.next(!0)}selectAll(e){for(let i=0;i<this.infectedFilesData.length;i++){const s=this._infectedFormArray.get([i]),o=Object.keys(s.controls)[0];(e!==m.disinfect||e===m.disinfect&&this.infectedFilesData[i].virusInMailDir)&&s.get([o]).setValue(e)}}submit(){this.submitted=!0,this._disinfectFacadeService.goToDoDisinfectPage(this._infectedFormArray.value)}trackByFile(e,i){return i.file}showDisinfectRadio(e,i){return e!==m.disinfect||e===m.disinfect&&i.virusInMailDir}_initInfectedFilesFormAndSetDisinfectFlag(){let e=!1;this.infectedFilesData.map(i=>{const s=this._fb.group({[i.file]:["",r.k0.required]});this._infectedFormArray.push(s),i.virusInMailDir?(e=!0,s.setValue({[i.file]:m.disinfect})):s.setValue({[i.file]:m.quarantine})}),!e&&this.infectedFilesData.length&&this._hideDisinfectFlagAndAction(),this.loading=!1}_initTableHeaders(){this.tableHeaders=[{id:g.file,label:this.locale.maketext("File")},{id:g.virus,label:this.locale.maketext("Virus")},{id:g.disinfect,label:this.locale.maketext("Disinfect")},{id:g.quarantine,label:this.locale.maketext("Quarantine")},{id:g.destroy,label:this.locale.maketext("Destroy")},{id:g.ignore,label:this.locale.maketext("Ignore")}]}_hideDisinfectFlagAndAction(){this.showDisinfectNotice=!1,this.actions=this.actions.filter(e=>e!==m.disinfect),this.tableHeaders=this.tableHeaders.filter(e=>e.id!==g.disinfect)}_subscribeToDisinfectErrorSubject(){this._disinfectFacadeService.disinfectErrorSubject.pipe((0,b.Q)(this._destroy$)).subscribe(e=>{this.errorMessage=e,this.loading=!1})}_subscribeToInfectedFilesSubject(){this._disinfectFacadeService.infectedFilesSubject.pipe((0,b.Q)(this._destroy$)).subscribe(e=>{this.infectedFilesData=e,this.loading=!1,this._initInfectedFilesFormAndSetDisinfectFlag()})}static#t=this.\u0275fac=function(i){return new(i||n)(t.rXU(h.h),t.rXU(N),t.rXU(u.Ix),t.rXU(r.ze))};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["cp-clam-disinfect"]],hostBindings:function(i,s){1&i&&t.bIt("beforeunload",function(){return s.canDeactivate()},!1,t.tSv)},decls:7,vars:6,consts:[["id","disinfect__loading-spinner",4,"ngIf"],["id","disinfect__callout--danger","class","clam-callout","calloutType","danger",4,"ngIf"],["id","disinfect__callout--info","class","clam-callout","calloutType","info",4,"ngIf"],[4,"ngIf"],["id","disinfect__mailbox-notice",4,"ngIf"],["id","disinfect__loading-spinner"],["id","disinfect__callout--danger","calloutType","danger",1,"clam-callout"],[1,"clam-callout__header"],[3,"ngSwitch"],[4,"ngSwitchCase"],["id","disinfect__callout--info","calloutType","info",1,"clam-callout"],["method","post",3,"ngSubmit","formGroup"],[1,"table","table-striped"],[4,"ngFor","ngForOf"],["formArrayName","formArray"],[3,"formGroupName","id",4,"ngFor","ngForOf","ngForTrackBy"],["type","submit","id","disinfect__btn-submit",1,"btn","btn-primary"],[3,"formGroupName","id"],[3,"id"],["type","radio",3,"formControlName","id","name","value",4,"ngIf"],["type","radio",3,"formControlName","id","name","value"],["type","button",1,"btn","btn-default",3,"click","id","value"],["id","disinfect__mailbox-notice"]],template:function(i,s){1&i&&(t.j41(0,"h2"),t.EFF(1),t.k0s(),t.DNE(2,ot,1,0,"cp-loading-spinner",0)(3,dt,9,5,"cp-callout",1)(4,pt,4,1,"cp-callout",2)(5,Ft,18,6,"section",3)(6,St,2,1,"div",4)),2&i&&(t.R7$(),t.JRh(s.locale.maketext("Cleanup Process")),t.R7$(),t.Y8G("ngIf",s.loading),t.R7$(),t.Y8G("ngIf",s.errorMessage),t.R7$(),t.Y8G("ngIf",!(s.loading||null!=s.infectedFilesData&&s.infectedFilesData.length||s.errorMessage)),t.R7$(),t.Y8G("ngIf",!s.loading&&(null==s.infectedFilesData?null:s.infectedFilesData.length)),t.R7$(),t.Y8G("ngIf",s.showDisinfectNotice))},dependencies:[r.qT,r.me,r.Fm,r.BC,r.cb,r.j4,r.JD,r.$R,r.v8,d.Sq,d.bT,d.ux,d.e1,l.NB,l.GV,P],encapsulation:2})}return n})();function bt(n,a){1&n&&t.nrm(0,"cp-loading-spinner",4)}function kt(n,a){if(1&n&&(t.j41(0,"div"),t.EFF(1),t.k0s()),2&n){const e=t.XpG(2);t.R7$(),t.SpI(" ",e.locale.maketext("The system failed to start a disinfection.")," ")}}function Dt(n,a){if(1&n&&(t.j41(0,"div"),t.EFF(1),t.k0s()),2&n){const e=t.XpG(2);t.R7$(),t.SpI(" ",e.locale.maketext("No cleanup process found.")," ")}}function It(n,a){if(1&n){const e=t.RV6();t.j41(0,"div"),t.EFF(1),t.j41(2,"button",9),t.bIt("click",function(){t.eBV(e);const s=t.XpG(2);return t.Njj(s.continuePolling())}),t.EFF(3),t.k0s()()}if(2&n){const e=t.XpG(2);t.R7$(),t.SpI(" ",e.locale.maketext("The system failed to fetch the disinfect status.")," "),t.R7$(2),t.SpI(" ",e.locale.maketext("Try again")," ")}}function xt(n,a){if(1&n&&(t.j41(0,"div"),t.EFF(1),t.k0s()),2&n){const e=t.XpG(2);t.R7$(),t.SpI(" ",e.locale.maketext("Internal Error")," ")}}function Tt(n,a){if(1&n&&(t.j41(0,"cp-callout",5)(1,"h3",6),t.EFF(2),t.k0s(),t.qex(3,7),t.DNE(4,kt,2,1,"div",8)(5,Dt,2,1,"div",8)(6,It,4,2,"div",8)(7,xt,2,1,"div",8),t.j41(8,"div"),t.EFF(9),t.k0s(),t.nrm(10,"cp-clam-start-scan-link"),t.bVm(),t.k0s()),2&n){const e=t.XpG();t.R7$(2),t.SpI(" ",e.locale.maketext("Oops!")," "),t.R7$(),t.Y8G("ngSwitch",e.errorMessage),t.R7$(),t.Y8G("ngSwitchCase",e.doDisinfectErrorMessage.failedToFetchDisinfectStatus),t.R7$(),t.Y8G("ngSwitchCase",e.doDisinfectErrorMessage.noVirusActionsOrData),t.R7$(),t.Y8G("ngSwitchCase",e.doDisinfectErrorMessage.failedToFetchDisinfectStatus),t.R7$(),t.Y8G("ngSwitchCase",e.doDisinfectErrorMessage.internalError),t.R7$(2),t.SpI(" ",e.locale.maketext("If this condition persists, contact your system administrator.")," ")}}function Et(n,a){if(1&n&&(t.j41(0,"cp-callout",10)(1,"h3",6),t.EFF(2),t.k0s(),t.nrm(3,"cp-clam-start-scan-link"),t.k0s()),2&n){const e=t.XpG();t.R7$(2),t.SpI(" ",e.locale.maketext("No cleanup process found.")," ")}}function yt(n,a){if(1&n&&(t.j41(0,"div",15),t.EFF(1,"\n "),t.nrm(2,"span",16),t.EFF(3,"\n "),t.j41(4,"span"),t.EFF(5),t.k0s(),t.EFF(6,"\n "),t.k0s()),2&n){const e=t.XpG(3);t.R7$(5),t.JRh(e.locale.maketext("Processing \u2026"))}}function Rt(n,a){if(1&n&&(t.j41(0,"span"),t.EFF(1),t.k0s()),2&n){const e=t.XpG(2).$implicit;t.R7$(),t.JRh(e.message)}}function jt(n,a){if(1&n&&(t.qex(0),t.EFF(1,"\n "),t.j41(2,"span",18),t.EFF(3),t.k0s(),t.EFF(4,"\n "),t.j41(5,"span"),t.EFF(6),t.k0s(),t.EFF(7,"\n "),t.DNE(8,Rt,2,1,"span",3),t.EFF(9,"\n "),t.bVm()),2&n){const e=t.XpG().$implicit,i=t.XpG(4);t.R7$(3),t.SpI("",e.file,":"),t.R7$(3),t.JRh(i.stateTranslations[e.state]),t.R7$(2),t.Y8G("ngIf",e.message)}}function $t(n,a){if(1&n&&(t.j41(0,"div"),t.EFF(1,"\n "),t.DNE(2,jt,10,3,"ng-container",3),t.EFF(3,"\n "),t.k0s()),2&n){const e=a.$implicit;t.R7$(2),t.Y8G("ngIf",e.file)}}function Ct(n,a){if(1&n&&(t.qex(0),t.EFF(1,"\n "),t.DNE(2,$t,4,1,"div",17),t.EFF(3,"\n "),t.bVm()),2&n){const e=t.XpG(3);t.R7$(2),t.Y8G("ngForOf",e.disinfectStatusData.details)}}function Gt(n,a){if(1&n&&(t.j41(0,"div",19),t.EFF(1),t.k0s()),2&n){const e=t.XpG(3);t.R7$(),t.SpI("\n ",e.locale.maketext("Scan Complete!"),"\n ")}}function wt(n,a){if(1&n&&(t.j41(0,"pre",12),t.EFF(1," "),t.DNE(2,yt,7,1,"div",13),t.EFF(3,"\n\n "),t.DNE(4,Ct,4,1,"ng-container",3),t.EFF(5,"\n\n "),t.DNE(6,Gt,2,1,"div",14),t.EFF(7,"\n"),t.k0s()),2&n){const e=t.XpG(2);t.R7$(2),t.Y8G("ngIf",(null==e.disinfectStatusData?null:e.disinfectStatusData.status)===e.disinfectCompletedStatus.running&&!e.errorMessage),t.R7$(2),t.Y8G("ngIf",null==e.disinfectStatusData?null:e.disinfectStatusData.details),t.R7$(2),t.Y8G("ngIf",(null==e.disinfectStatusData?null:e.disinfectStatusData.status)===e.disinfectCompletedStatus.done)}}function Ot(n,a){if(1&n&&(t.qex(0),t.DNE(1,wt,8,3,"pre",11),t.bVm()),2&n){const e=t.XpG();t.R7$(),t.Y8G("ngIf",!e.loading&&!e.errorMessage||e.disinfectStatusData)}}let Nt=(()=>{class n{constructor(e,i,s,o){this.locale=e,this._disinfectFacadeService=i,this._cd=s,this._router=o,this.loading=!0,this.disinfectCompletedStatus=k,this.doDisinfectErrorMessage=T,this.disinfectionInProgress=!0,this._destroy$=new _.B,this.subscribeToDoDisinfectErrorSubject(),this.subscribeToDisinfectStatusSubject(),this.initStateTranslations(),this.disinfectStatusData=this._router.getCurrentNavigation()?.extras?.state?.status,this._disinfectActions=this._router.getCurrentNavigation()?.extras?.state?.values}ngOnInit(){this.disinfectStatusData&&(this.loading=!1),this.startDisinfect()}ngOnDestroy(){this._destroy$.next(!0)}continuePolling(){this.errorMessage=null,this._cd.markForCheck(),this._disinfectFacadeService.startPolling()}startDisinfect(){this._disinfectFacadeService.startDisinfect({virusesWithActions:this._disinfectActions,disinfectStatus:this.disinfectStatusData})}initStateTranslations(){this.stateTranslations={[F.cleansed]:this.locale.maketext("Disinfected.[comment, placed after the path to a file that was cleaned]"),[F.deleted]:this.locale.maketext("Deleted.[comment, placed after the path to a file that was removed]"),[F.quarantined]:this.locale.maketext("Quarantined.[comment, placed after the path to a file that was moved to a safer place]"),[F.noAction]:this.locale.maketext("Ignored.[comment, placed after the path to a file that was not processed]"),[F.warning]:this.locale.maketext("Warning!"),[F.error]:this.locale.maketext("Error!"),[F.success]:this.locale.maketext("Success!")}}subscribeToDoDisinfectErrorSubject(){this._disinfectFacadeService.doDisinfectErrorSubject.pipe((0,b.Q)(this._destroy$)).subscribe(e=>{this.loading=!1,this.errorMessage=e,this._cd.markForCheck()})}subscribeToDisinfectStatusSubject(){this._disinfectFacadeService.disinfectStatusSubject.pipe((0,b.Q)(this._destroy$)).subscribe(e=>{this.loading=!1,this.disinfectStatusData=e,e.status===k.done&&e.details[0].type===Y.done&&(this.disinfectionInProgress=!1),this._cd.markForCheck()})}static#t=this.\u0275fac=function(i){return new(i||n)(t.rXU(h.h),t.rXU(N),t.rXU(t.gRc),t.rXU(u.Ix))};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["cp-clam-do-disinfect"]],decls:6,vars:5,consts:[["id","do-disinfect__loading-spinner",4,"ngIf"],["id","do-disinfect__callout","class","clam-callout","calloutType","danger",4,"ngIf"],["id","do-disinfect__no-cleanup","calloutType","info","class","clam-callout",4,"ngIf"],[4,"ngIf"],["id","do-disinfect__loading-spinner"],["id","do-disinfect__callout","calloutType","danger",1,"clam-callout"],[1,"clam-callout__header"],[3,"ngSwitch"],[4,"ngSwitchCase"],["id","do-disinfect__error-btn",1,"btn","btn-sm","btn-default",3,"click"],["id","do-disinfect__no-cleanup","calloutType","info",1,"clam-callout"],["class","do-disinfect__pre","id","do-disinfect__results",4,"ngIf"],["id","do-disinfect__results",1,"do-disinfect__pre"],["class","do-disinfect__processing",4,"ngIf"],["class","do-disinfect__scan-complete",4,"ngIf"],[1,"do-disinfect__processing"],[1,"fas","fa-sync","fa-spin"],[4,"ngFor","ngForOf"],[1,"do-disinfect__file-name"],[1,"do-disinfect__scan-complete"]],template:function(i,s){1&i&&(t.j41(0,"h2"),t.EFF(1),t.k0s(),t.DNE(2,bt,1,0,"cp-loading-spinner",0)(3,Tt,11,7,"cp-callout",1)(4,Et,4,1,"cp-callout",2)(5,Ot,2,1,"ng-container",3)),2&i&&(t.R7$(),t.JRh(s.locale.maketext("Cleanup Process")),t.R7$(),t.Y8G("ngIf",s.loading),t.R7$(),t.Y8G("ngIf",s.errorMessage),t.R7$(),t.Y8G("ngIf",!s.disinfectionInProgress),t.R7$(),t.Y8G("ngIf",s.disinfectionInProgress))},dependencies:[d.Sq,d.bT,d.ux,d.e1,l.NB,l.GV,P],styles:[".clam-callout__header[_ngcontent-%COMP%]{margin-top:0}.clam-callout[_ngcontent-%COMP%]{display:block;max-width:500px}.do-disinfect__file-name[_ngcontent-%COMP%]{font-weight:700}.do-disinfect__scan-complete[_ngcontent-%COMP%]{margin-top:10px}.do-disinfect__pre[_ngcontent-%COMP%]{white-space:normal}.do-disinfect__processing[_ngcontent-%COMP%]{margin-bottom:5px}"],changeDetection:0})}return n})(),Pt=(()=>{class n{constructor(e,i){this._router=e,this._clamApiService=i}hasMailLinkage(){return window.PAGE?.hasMailnodeLinkage}goToScanPage(e){this._router.navigate([p.scannerPage,{[$.scanPath]:e}])}getScanpaths(){return this._clamApiService.getScanPaths()}static#t=this.\u0275fac=function(i){return new(i||n)(t.KVO(u.Ix),t.KVO(E))};static#e=this.\u0275prov=t.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function At(n,a){if(1&n&&t.nrm(0,"cp-alert",7),2&n){const e=t.XpG();t.Y8G("alert",e.linkedNodeAlert)}}function Mt(n,a){if(1&n&&(t.j41(0,"tr",8),t.EFF(1),t.k0s()),2&n){const e=t.XpG();t.R7$(),t.SpI(" ",e.locale.maketext("Loading \u2026")," ")}}function Yt(n,a){if(1&n&&(t.j41(0,"tr")(1,"td"),t.nrm(2,"input",9),t.j41(3,"label",10),t.EFF(4),t.k0s()()()),2&n){const e=a.$implicit;t.R7$(2),t.Y8G("id","new-scan__control-"+e.id)("value",e.id),t.R7$(),t.Y8G("for","new-scan__control-"+e.id),t.R7$(),t.SpI("\xa0",e.message,"")}}function Xt(n,a){if(1&n&&(t.j41(0,"button",11),t.EFF(1),t.k0s()),2&n){const e=t.XpG();t.R7$(),t.SpI(" ",e.locale.maketext("Scan Now")," ")}}let Vt=(()=>{class n{constructor(e,i,s,o){this.newscanFacade=e,this.locale=i,this._fb=s,this._cd=o,this.scanpathForm=this._fb.group({scanpath:[""]}),this.linkedNodeAlert=new l.Fc(this.locale.maketext("Due to your system\u2019s configuration, the system can not scan all files in your user\u2019s mail directory."),l.vT.warning,{isCloseable:!1})}ngOnInit(){this._getScanpaths()}onSubmitScanpath(){this.newscanFacade.goToScanPage(this.scanpathForm.value.scanpath)}_getScanpaths(){this.newscanFacade.getScanpaths().pipe((0,R.s)(1)).subscribe(e=>{this.scanpaths=e,this.scanpathForm.controls.scanpath.patchValue(e[0].id),this._cd.markForCheck()})}static#t=this.\u0275fac=function(i){return new(i||n)(t.rXU(Pt),t.rXU(h.h),t.rXU(r.ze),t.rXU(t.gRc))};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["cp-clam-new-scan"]],decls:16,vars:7,consts:[["id","new-scan__header"],["id","new-scan__alert","class","new-scan__alert",3,"alert",4,"ngIf"],[3,"ngSubmit","formGroup"],["cellspacing","0","cellpadding","2","border","0","align","center"],["id","new-scan__loading",4,"ngIf"],[4,"ngFor","ngForOf"],["class","btn btn-default","id","new-scan__submit-button","type","submit",4,"ngIf"],["id","new-scan__alert",1,"new-scan__alert",3,"alert"],["id","new-scan__loading"],["formControlName","scanpath","name","scanpath","type","radio",3,"id","value"],[3,"for"],["id","new-scan__submit-button","type","submit",1,"btn","btn-default"]],template:function(i,s){1&i&&(t.j41(0,"h2",0),t.EFF(1),t.k0s(),t.j41(2,"p"),t.EFF(3),t.k0s(),t.DNE(4,At,1,1,"cp-alert",1),t.j41(5,"form",2),t.bIt("ngSubmit",function(){return s.onSubmitScanpath()}),t.j41(6,"table",3)(7,"tbody"),t.DNE(8,Mt,2,1,"tr",4)(9,Yt,5,4,"tr",5),t.j41(10,"tr")(11,"td"),t.EFF(12,"\xa0"),t.k0s()(),t.j41(13,"tr")(14,"td"),t.DNE(15,Xt,2,1,"button",6),t.k0s()()()()()),2&i&&(t.R7$(),t.JRh(s.locale.maketext("Start a New Scan")),t.R7$(2),t.SpI(" ",s.locale.maketext("Scans will automatically stop if they run for more than one day."),"\n"),t.R7$(),t.Y8G("ngIf",s.newscanFacade.hasMailLinkage()),t.R7$(),t.Y8G("formGroup",s.scanpathForm),t.R7$(3),t.Y8G("ngIf",!s.scanpaths),t.R7$(),t.Y8G("ngForOf",s.scanpaths),t.R7$(6),t.Y8G("ngIf",s.scanpaths))},dependencies:[l.Cy,r.qT,r.me,r.Fm,r.BC,r.cb,r.j4,r.JD,d.Sq,d.bT],styles:[".new-scan__alert[_ngcontent-%COMP%]{display:block;width:fit-content}"],changeDetection:0})}return n})(),Bt=(()=>{class n{constructor(e,i){this._bsModalRef=e,this.locale=i,this.onHide=new _.B}ngOnInit(){this.scannerData.infected_files.length?(this.infoText=this.locale.maketext("Infected files found."),this.buttonText=this.locale.maketext("Go to the Cleanup Process Page")):(this.infoText=this.locale.maketext("No virus found."),this.buttonText=this.locale.maketext("Close"))}close(e=null){this.onHide.next(e),this._bsModalRef.hide()}static#t=this.\u0275fac=function(i){return new(i||n)(t.rXU(j.Y$),t.rXU(h.h))};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["cp-clam-scan-complete-modal"]],decls:13,vars:5,consts:[[1,"modal-header","scan-complete-modal__header"],[1,"modal-title","scan-complete-modal__title"],["id","scan-complete-modal__close-button",1,"close",3,"click"],["aria-hidden","true"],["aria-hidden","true",1,"fas","fa-times"],[1,"modal-body"],["id","scan-complete-modal__info"],["id","scan-complete-modal__main-button",1,"btn","btn-primary",3,"click"],["id","scan-complete-modal__label",1,"sr-only"]],template:function(i,s){1&i&&(t.j41(0,"div",0)(1,"h4",1),t.EFF(2),t.k0s(),t.j41(3,"button",2),t.bIt("click",function(){return s.close()}),t.j41(4,"span",3),t.nrm(5,"i",4),t.k0s()()(),t.j41(6,"div",5)(7,"p",6),t.EFF(8),t.k0s(),t.j41(9,"button",7),t.bIt("click",function(){return s.close()}),t.EFF(10),t.k0s()(),t.j41(11,"label",8),t.EFF(12),t.k0s()),2&i&&(t.R7$(2),t.SpI(" ",s.locale.maketext("Virus Scan Complete")," "),t.R7$(),t.BMQ("aria-label",s.locale.maketext("Close")),t.R7$(5),t.JRh(s.infoText),t.R7$(2),t.SpI(" ",s.buttonText," "),t.R7$(2),t.JRh(s.locale.maketext("Virus scan complete modal.")))},styles:[".scan-complete-modal__header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;flex-direction:row}"]})}return n})(),L=(()=>{class n{constructor(e,i,s,o,v){this._apiService=e,this._alertService=i,this.locale=s,this._modalService=o,this._router=v,this.scannerDataSubject=new _.B,this.scannerErrorSubject=new _.B,this.config={keyboard:!1,ignoreBackdropClick:!0,ariaLabelledBy:"scan-complete-modal__label"}}startFileScan({scanpath:e,scannerData:i}){i?(this.scannerDataSubject.next(i),this._startPolling()):e?this._apiService.startScan(e).pipe((0,R.s)(1)).subscribe(()=>this._startPolling(),()=>{this.scannerErrorSubject.next(D.failedToStartScan);const s=this.locale.maketext("The system failed to start the virus scanner in the background.");this._alertService.error(s)}):this._apiService.getScanStatus().subscribe(s=>{!s.scan_complete&&s.scanned_file_size?(this.scannerDataSubject.next(s),this._startPolling()):this.scannerErrorSubject.next(D.noScanpathOrData)},()=>{this.scannerErrorSubject.next(D.internalError);const s=this.locale.maketext("Internal Error"),o=this.locale.maketext("If this condition persists, contact your system administrator.");this._alertService.error(`${s} ${o}`)})}openModal(e){this._modalService.show(Bt,{...this.config,initialState:{scannerData:e}}).content.onHide.pipe((0,R.s)(1)).subscribe(()=>this._goTo(e.infected_files.length?p.cleanupPage:p.root))}_goTo(e){this._router.navigate([e])}_startPolling(e){B(this._apiService.getScanStatus(),e).pipe((0,w.M)(s=>this.scannerDataSubject.next(s)),(0,V.v)(s=>!s?.scan_complete)).subscribe({error:()=>{this.scannerErrorSubject.next(D.failedToFetchScanStatus);const s=this.locale.maketext("The system failed to fetch the scan status.");this._alertService.error(s)}})}static#t=this.\u0275fac=function(i){return new(i||n)(t.KVO(E),t.KVO(l.uE),t.KVO(h.h),t.KVO(j.I8),t.KVO(u.Ix))};static#e=this.\u0275prov=t.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function Ut(n,a){1&n&&t.nrm(0,"cp-loading-spinner",5)}function Lt(n,a){if(1&n&&(t.j41(0,"div"),t.EFF(1),t.k0s()),2&n){const e=t.XpG(2);t.R7$(),t.SpI(" ",e.locale.maketext("The system failed to start a scan.")," ")}}function Ht(n,a){if(1&n){const e=t.RV6();t.j41(0,"div"),t.EFF(1),t.j41(2,"button",12),t.bIt("click",function(){t.eBV(e);const s=t.XpG(2);return t.Njj(s.continuePolling())}),t.EFF(3),t.k0s()()}if(2&n){const e=t.XpG(2);t.R7$(),t.SpI(" ",e.locale.maketext("The system failed to fetch the scan status.")," "),t.R7$(2),t.SpI(" ",e.locale.maketext("Try again")," ")}}function Kt(n,a){if(1&n&&(t.j41(0,"div"),t.EFF(1),t.k0s()),2&n){const e=t.XpG(2);t.R7$(),t.SpI(" ",e.locale.maketext("Something bad happened.")," ")}}function Jt(n,a){if(1&n&&(t.j41(0,"cp-callout",6)(1,"h3",7),t.EFF(2),t.k0s(),t.qex(3,8),t.DNE(4,Lt,2,1,"div",9)(5,Ht,4,2,"div",9)(6,Kt,2,1,"div",10),t.j41(7,"div",11),t.EFF(8),t.k0s(),t.nrm(9,"cp-clam-start-scan-link"),t.bVm(),t.k0s()),2&n){const e=t.XpG();t.R7$(2),t.SpI(" ",e.locale.maketext("Oops!")," "),t.R7$(),t.Y8G("ngSwitch",e.errorMessage),t.R7$(),t.Y8G("ngSwitchCase",e.scannerPageErrors.failedToStartScan),t.R7$(),t.Y8G("ngSwitchCase",e.scannerPageErrors.failedToFetchScanStatus),t.R7$(3),t.SpI(" ",e.locale.maketext("If this condition persists, contact your system administrator.")," ")}}function zt(n,a){if(1&n&&(t.j41(0,"cp-callout",13)(1,"h3",7),t.EFF(2),t.k0s(),t.nrm(3,"cp-clam-start-scan-link"),t.k0s()),2&n){const e=t.XpG();t.R7$(2),t.SpI(" ",e.locale.maketext("No active scans.")," ")}}function Qt(n,a){if(1&n&&(t.j41(0,"option",37),t.EFF(1),t.k0s()),2&n){const e=a.$implicit;t.Y8G("value",e),t.R7$(),t.SpI(" ",e," ")}}function Wt(n,a){if(1&n&&(t.j41(0,"div")(1,"div")(2,"p")(3,"strong"),t.EFF(4),t.k0s(),t.j41(5,"span",14),t.EFF(6),t.k0s()(),t.j41(7,"form",15)(8,"div",16)(9,"label",17),t.EFF(10),t.k0s(),t.j41(11,"div",18)(12,"div",19),t.nrm(13,"input",20),t.k0s(),t.j41(14,"div",21),t.EFF(15,"/"),t.k0s(),t.j41(16,"div",19)(17,"label",22),t.EFF(18),t.k0s(),t.nrm(19,"input",23),t.k0s()()(),t.j41(20,"div",16)(21,"label",24),t.EFF(22),t.k0s(),t.j41(23,"div",18)(24,"div",19)(25,"div",25),t.nrm(26,"input",26),t.j41(27,"span",27),t.EFF(28,"MB"),t.k0s()()(),t.j41(29,"div",21),t.EFF(30,"/"),t.k0s(),t.j41(31,"div",19)(32,"div",25)(33,"label",28),t.EFF(34),t.k0s(),t.nrm(35,"input",29),t.j41(36,"span",27),t.EFF(37,"MB"),t.k0s()()()()(),t.j41(38,"div",16)(39,"label",30),t.EFF(40),t.k0s(),t.j41(41,"div",18)(42,"div",31)(43,"progressbar",32)(44,"b"),t.EFF(45),t.k0s()()()()(),t.j41(46,"div",16)(47,"label",33),t.EFF(48),t.k0s(),t.j41(49,"div",18)(50,"div",34)(51,"select",35),t.DNE(52,Qt,2,2,"option",36),t.k0s()(),t.nrm(53,"div",34),t.k0s()()()()()),2&n){const e=t.XpG();t.R7$(4),t.SpI("",e.locale.maketext("Scanning:"),"\xa0"),t.R7$(2),t.JRh((null==e.scannerData?null:e.scannerData.current_file)||e.locale.maketext("Loading \u2026")),t.R7$(4),t.JRh(e.locale.maketext("File")),t.R7$(3),t.Y8G("value",null==e.scannerData?null:e.scannerData.scanned_file_count),t.R7$(5),t.JRh(e.locale.maketext("Total file count")),t.R7$(),t.Y8G("value",null==e.scannerData?null:e.scannerData.total_file_count),t.R7$(3),t.JRh(e.locale.maketext("Data")),t.R7$(4),t.Y8G("value",null==e.scannerData?null:e.scannerData.scanned_file_size),t.R7$(8),t.JRh(e.locale.maketext("Total file size")),t.R7$(),t.Y8G("value",null==e.scannerData?null:e.scannerData.total_file_size_MiB),t.R7$(5),t.SpI(" ",e.locale.maketext("Scanner Progress")," "),t.R7$(3),t.Y8G("animate",!0)("value",e.progress),t.R7$(2),t.SpI("",e.progress,"%"),t.R7$(3),t.SpI(" ",e.locale.maketext("Infected Files")," "),t.R7$(4),t.Y8G("ngForOf",null==e.scannerData?null:e.scannerData.infected_files)("ngForTrackBy",e.trackByIndex)}}let qt=(()=>{class n{constructor(e,i,s,o,v){this.locale=e,this._scannerFacadeService=i,this._cd=s,this._route=o,this._router=v,this.loading=!0,this.scannerPageErrors=D,this._destroy$=new _.B,this._subscribeToScannerErrorSubject(),this._subscribeToScannerDataSubject(),this.scannerData=this._router.getCurrentNavigation().extras.state,this._scanpath=this._route.snapshot.paramMap.get($.scanPath)}ngOnInit(){this._startScan()}ngOnDestroy(){this._destroy$.next(!0)}trackByIndex(e){return e}continuePolling(){this.errorMessage=null,this._cd.markForCheck(),this._startScan()}_startScan(){this._scannerFacadeService.startFileScan({scanpath:this._scanpath,scannerData:this.scannerData})}_subscribeToScannerErrorSubject(){this._scannerFacadeService.scannerErrorSubject.pipe((0,b.Q)(this._destroy$)).subscribe(e=>{this.loading=!1,this.errorMessage=e,this._cd.markForCheck()})}_subscribeToScannerDataSubject(){this._scannerFacadeService.scannerDataSubject.pipe((0,b.Q)(this._destroy$)).subscribe(e=>{this.scannerData=e,this.progress=this._calculateProgressPercentage(e?.scanned_file_count,e?.total_file_count),this._cd.markForCheck(),e?.scan_complete&&this._scannerFacadeService.openModal(e)})}_calculateProgressPercentage(e,i){return!i||i<=0||e<0?0:e>i?100:Math.round(e/i*100)}static#t=this.\u0275fac=function(i){return new(i||n)(t.rXU(h.h),t.rXU(L),t.rXU(t.gRc),t.rXU(u.nX),t.rXU(u.Ix))};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["cp-clam-scanner"]],decls:6,vars:5,consts:[["id","scanner__header"],["id","scanner__loading-spinner",4,"ngIf"],["id","scanner__callout","class","clam-callout","calloutType","danger",4,"ngIf"],["id","scanner__callout--info","class","clam-callout","calloutType","info",4,"ngIf"],[4,"ngIf"],["id","scanner__loading-spinner"],["id","scanner__callout","calloutType","danger",1,"clam-callout"],[1,"clam-callout__header"],[3,"ngSwitch"],[4,"ngSwitchCase"],[4,"ngSwitchDefault"],["ngClass","scanner__error-persists"],["id","scanner__error-btn",1,"btn","btn-sm","btn-default",3,"click"],["id","scanner__callout--info","calloutType","info",1,"clam-callout"],["id","scanner__current-file"],["name","scanner__form"],[1,"form-group"],["id","scanner__file-label","for","scanner__scanned-file-count"],[1,"row"],[1,"col-xs-3"],["type","text","id","scanner__scanned-file-count","disabled","",1,"form-control",3,"value"],[1,"col-xs-1"],["for","scanner__total-file-count",1,"sr-only"],["type","text","id","scanner__total-file-count","disabled","",1,"form-control",3,"value"],["id","scanner__data-label","for","scanner__scanned-file-size"],[1,"input-group"],["type","text","id","scanner__scanned-file-size","disabled","",1,"form-control",3,"value"],[1,"input-group-addon"],["for","scanner__total-file-size",1,"sr-only"],["type","text","id","scanner__total-file-size","disabled","",1,"form-control",3,"value"],["id","scanner__progressbar-label","for","scanner__progressbar"],[1,"col-xs-12"],["id","scanner__progressbar",1,"h-100","scanner__progressbar",3,"animate","value"],["id","lblInfectedFiles","for","status"],[1,"col-xs-12","col-sm-6","col-md-6","col-lg-6"],["size","8","name","status","id","status",1,"form-control"],[3,"value",4,"ngFor","ngForOf","ngForTrackBy"],[3,"value"]],template:function(i,s){1&i&&(t.j41(0,"h2",0),t.EFF(1),t.k0s(),t.DNE(2,Ut,1,0,"cp-loading-spinner",1)(3,Jt,10,5,"cp-callout",2)(4,zt,4,1,"cp-callout",3)(5,Wt,54,17,"div",4)),2&i&&(t.R7$(),t.JRh(s.locale.maketext("Scanner")),t.R7$(),t.Y8G("ngIf",s.loading),t.R7$(),t.Y8G("ngIf",s.errorMessage&&s.errorMessage!==s.scannerPageErrors.noScanpathOrData),t.R7$(),t.Y8G("ngIf",s.errorMessage===s.scannerPageErrors.noScanpathOrData),t.R7$(),t.Y8G("ngIf",!s.loading&&!s.errorMessage||s.scannerData))},dependencies:[r.qT,r.xH,r.y7,r.cb,r.cV,d.YU,d.Sq,d.bT,d.ux,d.e1,d.fG,l.NB,l.GV,M.eh,P],styles:[".clam-callout__header[_ngcontent-%COMP%]{margin-top:0}.clam-callout[_ngcontent-%COMP%]{display:block;max-width:500px}.scanner__progressbar[_ngcontent-%COMP%]{height:100%}.scanner__error-persists[_ngcontent-%COMP%]{margin-top:.25rem}"],changeDetection:0})}return n})(),H=(()=>{class n{constructor(e){this.locale=e}canDeactivate(e){const i=this.locale.maketext("You should not leave this page without hitting the \u201cProcess Cleanup\u201d button!"),s=this.locale.maketext("Please press the \u201cCancel\u201d button.");return!!e.canDeactivate()||confirm(`${i}\n\n${s}`)}static#t=this.\u0275fac=function(i){return new(i||n)(t.KVO(h.h))};static#e=this.\u0275prov=t.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Zt=c(7468),te=c(980);let K=(()=>{class n{constructor(){this.appIsLoading=new _.B}static#t=this.\u0275fac=function(i){return new(i||n)};static#e=this.\u0275prov=t.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();const ne=[{path:p.doCleanupPage,component:Nt},{path:p.cleanupPage,component:vt,canDeactivate:[H]},{path:p.scannerPage,component:qt},{path:p.newScanPage,component:Vt,canActivate:[(()=>{class n{constructor(e,i,s,o,v,J){this._clamApiService=e,this._disinfectFacadeService=i,this._alertService=s,this._router=o,this._appFacadeService=v,this.locale=J}canActivate(){return this._appFacadeService.appIsLoading.next(!0),(0,Zt.p)([this._clamApiService.getScanStatus(),this._disinfectFacadeService.getMappedInfectedFiles(),this._clamApiService.getDisinfectStatus()]).pipe((0,S.T)(([e,i,s])=>{const o=e&&e?.scan_complete,v=i&&i?.length;return s&&s?.status===k.running?(this._router.navigate([p.doCleanupPage],{state:{status:s}}),!1):v?(this._router.navigate([p.cleanupPage],{state:i}),!1):!(!o&&e?.scanned_file_size&&(this._router.navigate([p.scannerPage],{state:e}),1))}),(0,G.W)(()=>{const e=this.locale.maketext("Internal Error"),i=this.locale.maketext("If this condition persists, contact your system administrator.");return this._alertService.error(`${e} ${i}`),(0,X.of)(!0)})).pipe((0,te.j)(()=>this._appFacadeService.appIsLoading.next(!1)))}static#t=this.\u0275fac=function(i){return new(i||n)(t.KVO(E),t.KVO(N),t.KVO(l.uE),t.KVO(u.Ix),t.KVO(K),t.KVO(h.h))};static#e=this.\u0275prov=t.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})()]},{path:"",redirectTo:p.newScanPage,pathMatch:"full"},{path:"**",redirectTo:p.newScanPage}];let ie=(()=>{class n{static#t=this.\u0275fac=function(i){return new(i||n)};static#e=this.\u0275mod=t.$C({type:n});static#n=this.\u0275inj=t.G2t({imports:[u.iI.forRoot(ne,{useHash:!0}),u.iI]})}return n})();var se=c(2806);function ae(n,a){1&n&&t.nrm(0,"cp-loading-spinner",1)}let ce=(()=>{class n{constructor(e){this.appFacadeService=e,(0,se.Yl)("bs4")}static#t=this.\u0275fac=function(i){return new(i||n)(t.rXU(K))};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["cp-clam-root"]],decls:4,vars:3,consts:[["id","app__loading-spinner",4,"ngIf"],["id","app__loading-spinner"]],template:function(i,s){1&i&&(t.nrm(0,"cp-alert-list")(1,"router-outlet"),t.DNE(2,ae,1,0,"cp-loading-spinner",0),t.nI1(3,"async")),2&i&&(t.R7$(2),t.Y8G("ngIf",t.bMT(3,1,s.appFacadeService.appIsLoading)))},dependencies:[l.Ab,d.bT,l.NB,u.n3,d.Jj],encapsulation:2})}return n})();var oe=c(1562);let re=(()=>{class n{static#t=this.\u0275fac=function(i){return new(i||n)};static#e=this.\u0275mod=t.$C({type:n,bootstrap:[ce]});static#n=this.\u0275inj=t.G2t({providers:[l.uE,E,L,H],imports:[l.sb,l.yI,oe.q1,r.YN,r.X1,y.Bb,l.ys,l.jM,ie,z.B,M.Hq.forRoot(),j.Q_.forRoot()]})}return n})();(0,t.SmG)(),y.sG().bootstrapModule(re).catch(n=>console.error(n))}},x=>{x.O(0,[502],()=>x(x.s=1636)),x.O()}]);