import{a as h}from"./chunk-IFY4UZPR.js";import{a as f}from"./chunk-PLVHWZTL.js";import{o as p}from"./chunk-M6NTKB7A.js";import{i as m}from"./chunk-YMOV4UGM.js";import{$ as c,K as a,ga as o,la as s}from"./chunk-I3FGJX2C.js";import{a as n}from"./chunk-B7YGBANW.js";var u=(()=>{let i=class i{constructor(t,e){this._http=t,this._store=e}get(){return this._http.post("/api/characteristic/all",{},{headers:f}).pipe(c(t=>{this._store.dispatch(new h({characteristics:[...t]}))}))}getById(t){return this._http.get(`/api/characteristic/${t}`)}create(t){return this._http.post("/api/characteristic",n({},t))}edit(t,e){return this._http.put(`/api/characteristic/${e}`,n({},t))}delete(t){return this._http.delete(`/api/characteristic/${t}`)}};i.\u0275fac=function(e){return new(e||i)(s(m),s(p))},i.\u0275prov=o({token:i,factory:i.\u0275fac});let r=i;return r})();var k=(()=>{let i=class i{constructor(t,e){this._characteristicService=t,this._store=e}get(){return this._characteristicService.get().pipe(a(1),c(t=>{this._store.dispatch(new h({characteristics:[...t.sort((e,d)=>d.id-e.id)]}))}))}create(t){return this._characteristicService.create(t).pipe(c(()=>this.get().subscribe()),a(1))}edit(t,e){return this._characteristicService.edit(t,e).pipe(c(()=>this.get().subscribe()),a(1))}delete(t){return this._characteristicService.delete(t).pipe(c(()=>this.get().subscribe()),a(1))}};i.\u0275fac=function(e){return new(e||i)(s(u),s(p))},i.\u0275prov=o({token:i,factory:i.\u0275fac});let r=i;return r})();export{u as a,k as b};
//# sourceMappingURL=chunk-GY7TOUI6.js.map
