import{g,aS as kn,aU as XP,aT as no,aV as oe,aW as ln,aX as le,aa as ge,ab as Qn,ac as Vd,aY as S,bS as em}from'./main-ajlqprgK.js';var L=class a{authHttp=g(kn);restService=g(XP);restExtractor=g(no);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(le(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(le(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(le(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(),le(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(),le(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(),le(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(),le(t=>this.restExtractor.handleError(t)));}buildFollowsListFilters(){return[{type:"options",key:"state",title:"Status folgen",options:[{value:"all",label:"Allen folgen"},{value:"accepted",label:"Akzeptierte Abonnement-Anfragen"},{value:"rejected",label:"Abgelehnte Abonnement-Anfragen"},{value:"pending",label:"Ausstehende Abonnement-Anfragen"}]}];}static ɵfac=function(o){return new(o||a)();};static ɵprov=S({token:a,factory:a.ɵfac});};/**i18n:fad79908930cbb4c308e7550a5fe49bb3841dbb330066a6429aebaa006173605*/export{L};//# sourceMappingURL=chunk-CXfc2Sq3.js.map