import{a as d}from"./chunk-BF44ZR3M.js";import{a as s}from"./chunk-PDYJ5OYY.js";import{d as o,i as l}from"./chunk-NDLDFKR2.js";import{K as p,fa as n,ka as h}from"./chunk-PVUKHE45.js";import{a as u}from"./chunk-MZPAXKJS.js";var a=(function(e){return e[e.None=0]="None",e[e.RongtaRLS1000=1]="RongtaRLS1000",e[e.MassaK=2]="MassaK",e[e.Mertech=3]="Mertech",e[e.Shtrich=4]="Shtrich",e})(a||{}),c=(function(e){return e[e.Ethernet=0]="Ethernet",e[e.SerialPort=1]="SerialPort",e})(c||{}),g={[a.None]:"\u041D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u0430\u044F \u043C\u043E\u0434\u0435\u043B\u044C",[a.MassaK]:"\u041C\u0430\u0441\u0441\u0430-\u041A",[a.RongtaRLS1000]:"Rongta RLS1000",[a.Mertech]:"Mertech (CAS-M)",[a.Shtrich]:"\u0428\u0422\u0420\u0418\u0425-\u041F\u0420\u0418\u041D\u0422"};var m=(()=>{let i=class i{constructor(t){this._http=t,this.apiUrl=d.apiURL}getAll(){let t=new o().append(s.SkipError,"skipError");return this._http.get(`${this.apiUrl}/api/scales`,{headers:t})}add(t){return this._http.post(`${this.apiUrl}/api/scales`,t)}edit(t,r){return this._http.put(`${this.apiUrl}/api/scales/${t}`,r)}delete(t){return this._http.delete(`${this.apiUrl}/api/scales/${t}`)}getById(t){let r=new o().append(s.SkipError,"skipError");return this._http.get(`${this.apiUrl}/api/scales/${t}`,{headers:r})}getWeightScale(t){let r=new o().append(s.SkipError,"skipError");return this._http.get(`${this.apiUrl}/api/scales/${t}/weight`,{headers:r})}uploadPLU(t,r){return this._http.post(`${this.apiUrl}/api/scales/${t}/upload-plu`,u({},r))}setZero(t){let r=new o().append(s.SkipError,"skipError").append(s.ActAsGet,"true");return this._http.post(`${this.apiUrl}/api/scales/${t}/set-zero`,{headers:r})}};i.\u0275fac=function(r){return new(r||i)(h(l))},i.\u0275prov=n({token:i,factory:i.\u0275fac});let e=i;return e})();var y=(()=>{let i=class i{constructor(t){this._scalesServiceApi=t}getScales(){return this._scalesServiceApi.getAll().pipe(p(1))}uploadPlu(t,r){return this._scalesServiceApi.uploadPLU(t,r).pipe(p(1))}add(t){return this._scalesServiceApi.add(t).pipe(p(1))}edit(t,r){return this._scalesServiceApi.edit(t,r).pipe(p(1))}delete(t){return this._scalesServiceApi.delete(t).pipe(p(1))}getById(t){return this._scalesServiceApi.getById(t).pipe(p(1))}getWeightScale(t){return this._scalesServiceApi.getWeightScale(t).pipe(p(1))}setZero(t){return this._scalesServiceApi.setZero(t).pipe(p(1))}convertScaleFormToScaleRequest(t){return{name:t.name,model:t.model,type:t.type,ethernetScale:t.type===c.Ethernet?{ipAddress:t.ipAddress,port:t.port}:null,serialPortScale:t.type===c.SerialPort?{portName:t.portName,baudRate:t.baudRate}:null}}};i.\u0275fac=function(r){return new(r||i)(h(m))},i.\u0275prov=n({token:i,factory:i.\u0275fac});let e=i;return e})();export{a,c as b,g as c,m as d,y as e};
//# sourceMappingURL=chunk-ATAE65B2.js.map
