import{s as h,t as j}from"./chunk-EAIMSMGJ.js";import{a as b,b as S}from"./chunk-AIHAZUSZ.js";import{Gd as f,Na as u,d as s,g as i,h as n,i as d,ka as m,ma as I,na as p,sa as c}from"./chunk-JSJB5BKT.js";import{e as g}from"./chunk-SZAW6ZBW.js";function y(t){return new s(a=>{let e=new FileReader;return e.readAsDataURL(t),e.onload=()=>{a.next(e.result),a.complete()},e.onerror=()=>a.error(e.error),()=>e.abort()})}var w,k=g(()=>{I();p();S();j();f();w=(()=>{class t extends h{constructor(){super(...arguments),this.deletedImageSubject=new d,this.handbookImagesListSubject=new n([]),this.editRequest$=new i}get deletedImage$(){return this.deletedImageSubject.asObservable()}get handbookImagesList$(){return this.handbookImagesListSubject.asObservable()}get handbookImagesList(){return this.handbookImagesListSubject.getValue()}set handbookImagesList(e){this.handbookImagesListSubject.next(e)}deleteImage$(e){return this.deleteImageRequest$(e).pipe(m(({errorMessage:o,result:r})=>{r===b.Success?(this.deletedImageSubject.next({imageId:e}),this.handbookImagesList=this.handbookImagesList.filter(l=>l.id!==e)):console.log(o,r)}))}editImageRequest(e){this.editRequest$.next(e)}static{this.\u0275fac=(()=>{let e;return function(r){return(e||(e=u(t)))(r||t)}})()}static{this.\u0275prov=c({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})()});export{w as a,y as b,k as c};
