import{g,aS as kn,aU as XP,aT as to,aV as oe,aW as ln,aX as fe,aa as ge,ab as Qn,ac as Vd,aY as S,bS as em}from'./main-BiUBeaMj.js';var L=class a{authHttp=g(kn);restService=g(XP);restExtractor=g(to);static BASE_APPLICATION_URL=oe.apiUrl+"/api/v1/server";listSubscriptions(r){let{pagination:o,sort:t,search:l,state:i,actorType:n}=r,e=new ln();return e=this.restService.addRestGetParams(e,o,t),l&&(e=e.append("search",l)),i&&(e=e.append("state",i)),n&&(e=e.append("actorType",n)),this.authHttp.get(a.BASE_APPLICATION_URL+"/following",{params:e}).pipe(fe(u=>this.restExtractor.handleError(u)));}listFollowers(r){let{pagination:o,sort:t,search:l,state:i,actorType:n}=r,e=new ln();return e=this.restService.addRestGetParams(e,o,t),l&&(e=e.append("search",l)),i&&(e=e.append("state",i)),n&&(e=e.append("actorType",n)),this.authHttp.get(a.BASE_APPLICATION_URL+"/followers",{params:e}).pipe(fe(u=>this.restExtractor.handleError(u)));}follow(r){let o={handles:r.filter(t=>t.includes("@")),hosts:r.filter(t=>!t.includes("@"))};return this.authHttp.post(a.BASE_APPLICATION_URL+"/following",o).pipe(fe(t=>this.restExtractor.handleError(t)));}unfollow(r){let o=em(r);return ge(o).pipe(Qn(t=>{let l=t.following.name+"@"+t.following.host;return this.authHttp.delete(a.BASE_APPLICATION_URL+"/following/"+l);}),Vd(),fe(t=>this.restExtractor.handleError(t)));}acceptFollower(r){let o=em(r);return ge(o).pipe(Qn(t=>{let l=t.follower.name+"@"+t.follower.host;return this.authHttp.post(`${a.BASE_APPLICATION_URL}/followers/${l}/accept`,{});}),Vd(),fe(t=>this.restExtractor.handleError(t)));}rejectFollower(r){let o=em(r);return ge(o).pipe(Qn(t=>{let l=t.follower.name+"@"+t.follower.host;return this.authHttp.post(`${a.BASE_APPLICATION_URL}/followers/${l}/reject`,{});}),Vd(),fe(t=>this.restExtractor.handleError(t)));}removeFollower(r){let o=em(r);return ge(o).pipe(Qn(t=>{let l=t.follower.name+"@"+t.follower.host;return this.authHttp.delete(`${a.BASE_APPLICATION_URL}/followers/${l}`);}),Vd(),fe(t=>this.restExtractor.handleError(t)));}buildFollowsListFilters(){return[{type:"options",key:"state",title:"Follow state",options:[{value:"all",label:"All follows"},{value:"accepted",label:"Onartutako jarraitzaileak"},{value:"rejected",label:"Baztertutako jarraitzaileak"},{value:"pending",label:"Zain dauden jarraitzaileak"}]}];}static ɵfac=function(o){return new(o||a)();};static ɵprov=S({token:a,factory:a.ɵfac});};/**i18n:fad79908930cbb4c308e7550a5fe49bb3841dbb330066a6429aebaa006173605*/export{L};//# sourceMappingURL=chunk-3vLuVr6f.js.map