import{a as G,b as J,c as K,d as Q}from"./chunk-7A3WMPGM.js";import{f as R}from"./chunk-DR3RUOXE.js";import"./chunk-TKBSI5E4.js";import{C as d,D as f,E as z,G as q}from"./chunk-P5ZTPV5Q.js";import"./chunk-LZAJN7X2.js";import"./chunk-7GLTULNV.js";import{Ba as V,Ca as H}from"./chunk-JNANLRYG.js";import{h as I}from"./chunk-HQJI5M5I.js";import{a as S}from"./chunk-PTMJTNEU.js";import"./chunk-X6YHEMIY.js";import{$ as P,Fc as F,Jc as u,K as M,Kc as y,Mb as C,Mc as $,Nb as g,Qb as b,Rb as T,Sb as E,Tb as s,Ub as r,Vb as v,Xd as N,ab as c,ac as D,ae as B,be as L,cc as _,ce as j,ea as l,ec as p,ka as w,la as k,nb as O,rd as A,sc as a,tc as h,uc as x}from"./chunk-PCDQIHDN.js";import"./chunk-2PV2FVC7.js";var U=(()=>{let t=class t{constructor(){this.httpClient=l(I)}trigger(){return this.httpClient.post(`${S.endpoints.api}/systemcheck/trigger`,null)}execute(n){let i={action:n};return this.httpClient.post(`${S.endpoints.api}/systemcheck/execute`,i)}};t.\u0275fac=function(i){return new(i||t)},t.\u0275prov=P({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})();var X=()=>({dateStyle:"short",timeStyle:"medium"}),Y=(e,t)=>t.title;function Z(e,t){if(e&1){let o=D();s(0,"div",7)(1,"button",11),_("click",function(){w(o);let i=p().$implicit,m=p();return k(m.executeAction(i.action))}),a(2,"Fix"),r()()}if(e&2){let o=p().$implicit,n=p();c(),E("disabled",n.isActionBusy(o.action))("matTooltip",o.actionTooltip)}}function tt(e,t){e&1&&v(0,"i",9)}function et(e,t){e&1&&v(0,"i",10)}function it(e,t){if(e&1&&(s(0,"div",3)(1,"div",4)(2,"div",5),a(3),r(),s(4,"div",6),a(5),r()(),C(6,Z,3,2,"div",7),s(7,"div",8),C(8,tt,1,0,"i",9)(9,et,1,0,"i",10),a(10),r()()),e&2){let o=t.$implicit;c(3),h(o.title),c(2),h(o.description),c(),g(!o.success&&o.action?6:-1),c(2),g(o.success?8:9),c(2),x(" ",o.value," ")}}var kt=(()=>{let t=class t{constructor(){this.deviceMonitor=l(R),this.systemCheckService=l(U),this.viewService=l(q),this.locale=l(N),this.busyStore=new Set,this.systemCheck$=this.deviceMonitor.systemCheck}triggerSync(){this.systemCheckService.trigger().subscribe({next:()=>this.viewService.showToastNotification("ActionTriggered",d.Info,f.Short),error:n=>this.viewService.showHttpErrorNotification(n)})}isActionBusy(n){return this.busyStore.has(n)}executeAction(n){this.busyStore.add(n),this.systemCheckService.execute(n).pipe(M(()=>this.busyStore.delete(n))).subscribe({next:i=>{i.success?this.viewService.showToastNotification(i.message,d.Success,f.Short):this.viewService.showToastNotification(i.message,d.Error,f.Max)},error:i=>this.viewService.showHttpErrorNotification(i)})}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=O({type:t,selectors:[["wv-system-check"]],decls:16,vars:10,consts:[["l10nTranslate",""],["mat-raised-button","","color","primary","type","button","l10nTranslate","",3,"click"],[1,"result-items"],[1,"result-item"],[1,"title-area"],[1,"title"],[1,"description"],[1,"action"],[1,"value"],[1,"success","icon-mmt-check"],[1,"warning","icon-warning"],["mat-flat-button","",3,"click","disabled","matTooltip"]],template:function(i,m){i&1&&(s(0,"wv-static-page-container")(1,"page-title",0),a(2,"System check"),r(),s(3,"page-subtitle")(4,"span",0),a(5,"Last execution"),r(),a(6),u(7,"async"),u(8,"l10nDate"),r(),s(9,"page-action")(10,"button",1),_("click",function(){return m.triggerSync()}),a(11,"Refresh"),r()(),s(12,"div",2),b(13,it,11,5,"div",3,Y),u(15,"async"),r()()),i&2&&(c(6),x(": ",$(8,3,y(7,1,m.systemCheck$).executionTime,m.locale.language,F(9,X))," "),c(7),T(y(15,7,m.systemCheck$).results))},dependencies:[Q,G,J,K,H,V,L,B,z,A,j],styles:[".result-items[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;align-items:center}.result-items[_ngcontent-%COMP%]   .result-item[_ngcontent-%COMP%]{width:75%;padding:16px 4px;border-bottom:solid 1px #303030;display:flex;align-items:center;gap:24px}.result-items[_ngcontent-%COMP%]   .result-item[_ngcontent-%COMP%]   .title-area[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column}.result-items[_ngcontent-%COMP%]   .result-item[_ngcontent-%COMP%]   .title-area[_ngcontent-%COMP%]   .description[_ngcontent-%COMP%]{font-size:14px;color:var(--wv-color-foreground-disabled)}.result-items[_ngcontent-%COMP%]   .result-item[_ngcontent-%COMP%]   .value[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.result-items[_ngcontent-%COMP%]   .result-item[_ngcontent-%COMP%]   .value[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{height:16px}.result-items[_ngcontent-%COMP%]   .result-item[_ngcontent-%COMP%]   .value[_ngcontent-%COMP%]   i.success[_ngcontent-%COMP%]{color:var(--wv-color-state-success)}.result-items[_ngcontent-%COMP%]   .result-item[_ngcontent-%COMP%]   .value[_ngcontent-%COMP%]   i.warning[_ngcontent-%COMP%]{color:var(--wv-color-state-error)}"]});let e=t;return e})();export{kt as SystemCheckComponent};
