import{f as $}from"./chunk-VXSFLKKM.js";import{a as S}from"./chunk-KZKY3ROD.js";import{h as b,p as D}from"./chunk-ZTKV4AIV.js";import{a as l}from"./chunk-5JDCLYZA.js";import{h as w}from"./chunk-73IMXZSJ.js";import{C as d,D as v,E as g,K as h,aa as c,bb as i,cb as u,ha as p,na as m,p as r,u as o}from"./chunk-FWZCAEAJ.js";import{a,b as f}from"./chunk-CWTPBX7D.js";var I=20,F=(()=>{let t=class t{constructor(){this.httpClient=m(w),this.authService=m($),this.serverInfoState=u({status:"Pending",refreshIn:I}),this.getJsonInfo$=d(0,I*1e3).pipe(l(),o(()=>new Date().getTime()),c(e=>this.httpClient.get("/json").pipe(o(n=>({status:"Online",refreshIn:I,publicInfo:f(a({},n),{lastPing:new Date,responseTime:new Date().getTime()-e-5})})),h(()=>r({status:"Offline"}))))),this.getAdminInfo$=this.authService.status$.pipe(c(e=>e==="LOGGED_IN"?this.httpClient.get("/config/info/environment"):r(void 0)),h(()=>r(void 0))),this.status=i(()=>this.serverInfoState().status),this.refreshIn=i(()=>this.serverInfoState().refreshIn),this.publicInfo=i(()=>this.serverInfoState().publicInfo),this.adminInfo=i(()=>this.serverInfoState().adminInfo),v(1e3).pipe(l()).subscribe(()=>this.serverInfoState.update(e=>f(a({},e),{refreshIn:e.refreshIn-1}))),S(this.serverInfoState,g(this.getJsonInfo$,this.getAdminInfo$.pipe(o(e=>({adminInfo:e})))))}};t.\u0275fac=function(n){return new(n||t)},t.\u0275prov=p({token:t,factory:t.\u0275fac});let s=t;return s})(),G=(()=>{let t=class t{constructor(){this._show=u(b("show_devmenu")??!1),this.show=i(()=>this._show())}set(e){D("show_devmenu",e),this._show.set(e),console.warn(`Developer mode ${e?"enabled":"disabled"}`)}};t.\u0275fac=function(n){return new(n||t)},t.\u0275prov=p({token:t,factory:t.\u0275fac,providedIn:"root"});let s=t;return s})();export{F as a,G as b};
