import{f as U}from"./chunk-A4FSGNM7.js";import{A as y,Bd as I,md as j,tc as h,uc as c}from"./chunk-CBXQYRPM.js";import{Bc as C,Hc as n,J as p,Rc as L,ca as s,da as v,fa as o,g as u,la as E,o as d,r as R,u as S}from"./chunk-LVXYIJUI.js";var l=(()=>{class r{static{this.infinityConfigFilePath="assets/general/config/infinityConfig.json"}constructor(t){this.http=t}load(){return u(this,null,function*(){return new Promise(t=>{S(this.http.get(r.infinityConfigFilePath)).then(e=>{r.properties=e,console.log("InfinityConfig file loaded successfully!"),t()}).catch(()=>{t()})})})}static{this.\u0275fac=function(e){return new(e||r)(o(n))}}static{this.\u0275prov=s({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var x=(()=>{class r{static{this.\u0275fac=function(e){return new(e||r)}}static{this.\u0275mod=E({type:r})}static{this.\u0275inj=v({imports:[C]})}}return r})();var a=class{constructor(i){this.http=i}formatErrors(i){return i.length===0?d:R(()=>new Error(i))}get(i,t){return this.http.get(`${this.getURL(i)}${i}`,{params:t}).pipe(p(e=>this.formatErrors(e.message)))}head(i,t){return this.http.head(`${this.getURL(i)}${i}`,{params:t}).pipe(p(e=>this.formatErrors(e.message)))}put(i,t){return this.http.put(`${this.getURL(i)}${i}`,JSON.stringify(t)).pipe(p(e=>this.formatErrors(e.message)))}post(i,t,e){return this.http.post(`${this.getURL(i)}${i}`,JSON.stringify(t),{params:e}).pipe(p(m=>this.formatErrors(m.message)))}patch(i,t,e){return this.http.patch(`${this.getURL(i)}${i}`,JSON.stringify(t),{params:e}).pipe(p(m=>this.formatErrors(m.message)))}delete(i){return this.http.delete(`${this.getURL(i)}${i}`).pipe(p(t=>this.formatErrors(t.message)))}};var M=(()=>{class r extends a{constructor(t,e,m,w){super(t),this.logger=e,this.translateService=m,this.toastMessageService=w}getURL(){let t=c.getLpsUrl();if(c.isNullOrUndefined(t)){let e=this.translateService.instant("MSG_ERROR_NO_LOCAL_PRINT_SERVER",{workstationCode:h.getWorkstation().code,workstationDescription:h.getWorkstation().description});throw this.toastMessageService.showToastPanel(j.getErrorDefaultConfig().withMessage(e)),this.logger.error(e),new Error(e)}return t}static{this.\u0275fac=function(e){return new(e||r)(o(n),o(U),o(L),o(I))}}static{this.\u0275prov=s({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var H=(()=>{class r extends a{constructor(t){super(t)}getURL(){return""}getBaseURL(){return y.PERIPHERAL_AGENT}static{this.\u0275fac=function(e){return new(e||r)(o(n))}}static{this.\u0275prov=s({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var $="/client",N=(()=>{class r extends a{constructor(t){super(t)}getURL(t){return c.isNullOrUndefined(l.properties)?null:l.properties.appServerRestOrigin+(c.isAuthenticationRequest(t)||c.isVersionCheckRequest(t)?"":$)}static{this.\u0275fac=function(e){return new(e||r)(o(n))}}static{this.\u0275prov=s({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();export{M as a,H as b,l as c,N as d,x as e};
