import{J as Je,m as mt,P as P$1}from'./chunk-BY-yDHeZ.js';import{J as Ji}from'./chunk-BVyl9Ga1.js';import{B}from'./chunk-DBWX8fE6.js';import'./chunk-CKaXVFxJ.js';import'./chunk-C5-AjuHL.js';import'./chunk-wVqekVIq.js';import'./chunk-BvhSjahg.js';import'./chunk-BvvoatGa.js';import{I as It,U as Ut,P as Pt}from'./chunk-Cow1Stq2.js';import'./chunk-39BX8I59.js';import'./chunk-C-050XcB.js';import{d6 as ak,g,dl as Oi,aQ as Xe,a_ as Lk,aC as x,dc as sg,av as E,ao as D,dG as ze,a9 as Oe,bq as lt,fA as Zn,b as Pa,s as sp,y as yV,u as ub,e as Pp,z as zB,a3 as B0}from'./main-WLWfNrEm.js';import'./chunk-D3HV6GuE.js';import'./chunk-CidmfIBU.js';import'./chunk-F7sai10S.js';var P=(()=>{class r{authService=g(Xe);userSubscription=g(B);hooks=g(Lk);videoService=g(x);scopedTokensService=g(sg);getVideosObservableFunction=this.getVideosObservable.bind(this);getSyndicationItemsFunction=this.getSyndicationItems.bind(this);defaultSort="-publishedAt";actions=[{routerLink:"/my-library/subscriptions",label:"Gestionare",iconName:"cog"}];disabled=false;feedToken;getVideosObservable(e,i){let t=E(D({},i.toVideosAPIObject()),{videoPagination:e,skipCount:true});return this.hooks.wrapObsFun(this.userSubscription.getUserSubscriptionVideos.bind(this.userSubscription),t,"common","filter:api.user-subscriptions-videos.videos.list.params","filter:api.user-subscriptions-videos.videos.list.result");}getSyndicationItems(){return this.loadFeedToken().then(()=>{let e=this.authService.getUser();return this.videoService.getVideoSubscriptionFeedUrls(e.account.id,this.feedToken);});}disableForReuse(){this.disabled=true;}enabledForReuse(){this.disabled=false;}loadFeedToken(){if(this.feedToken)return Promise.resolve(this.feedToken);let e=this.authService.userInformationLoaded.pipe(ze(),Oe(()=>this.scopedTokensService.getScopedTokens()),lt(i=>this.feedToken=i.feedToken));return Zn(e);}static ɵfac=function(i){return new(i||r)();};static ɵcmp=Pa({type:r,selectors:[["my-videos-user-subscriptions"]],decls:3,vars:5,consts:()=>{let e;return e="Videoclipuri din abonamentele tale",[e,[1,"visually-hidden"],["displayFilters","false","loadUserVideoPreferences","false","groupByDate","true","highlightLives","false",3,"getVideosObservableFunction","getSyndicationItemsFunction","defaultSort","disabled","headerActions"]];},template:function(i,t){i&1&&(sp(0,"h1",1),yV(1,0),ub(),Pp(2,"my-videos-list",2)),i&2&&(zB(2),B0("getVideosObservableFunction",t.getVideosObservableFunction)("getSyndicationItemsFunction",t.getSyndicationItemsFunction)("defaultSort",t.defaultSort)("disabled",t.disabled)("headerActions",t.actions));},dependencies:[Ji],encapsulation:2,changeDetection:1});}return r;})();var oe=[{path:"",providers:[P$1,B,It,Ut,Pt],children:[{path:"overview",component:Je,data:{meta:{title:"Descoper\u0103 videoclipuri"},reuse:{enabled:true,key:"videos-discover"}}},{path:"most-liked",redirectTo:"browse?scope=federated&sort=-likes"},{path:"trending",redirectTo:()=>"browse?scope=federated&sort=-"+g(Oi).getDefaultTrendingSort()},{path:"recently-added",redirectTo:"browse?scope=federated&sort=-publishedAt"},{path:"local",redirectTo:"browse?scope=local&sort=-publishedAt"},{path:"browse",component:mt,data:{reuse:{enabled:true,key:"videos-list"}}},{path:"subscriptions",canActivate:[ak],component:P,data:{meta:{title:"Abonamente"},reuse:{enabled:true,key:"subscription-videos-list"}}}]}];/**i18n:fad79908930cbb4c308e7550a5fe49bb3841dbb330066a6429aebaa006173605*/export{oe as default};//# sourceMappingURL=chunk-BWzLDM-T.js.map