import{a as h}from"./chunk-IFY4UZPR.js";import{o as p}from"./chunk-GW2OL5S3.js";import{a as f}from"./chunk-P5XIDEFS.js";import{i as m}from"./chunk-CO3WTSA4.js";import{I as a,Z as c,ea as o,ja as s}from"./chunk-DYUFV4HF.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-AWZ5DUFH.js.map
