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