import{a as P,b as w,c as M}from"./chunk-Z5PQWEDD.js";import{a as E}from"./chunk-ZCJRONRO.js";import{a as n}from"./chunk-DMMLB46B.js";import"./chunk-ZH4PMEF4.js";import"./chunk-Y5AGTBYE.js";import"./chunk-TOHZISBS.js";import"./chunk-N3OXCBF5.js";import"./chunk-2WXB7LGF.js";import{c as F,g as C,h as A}from"./chunk-K3PMQOQZ.js";import"./chunk-DCEZPJEU.js";import"./chunk-LK5Y3ZQB.js";import"./chunk-KUUL622F.js";import"./chunk-NQHJR7NL.js";import"./chunk-7Z4MFK7Q.js";import"./chunk-HTRNMWZ3.js";import"./chunk-IWP2IQ4J.js";import"./chunk-WVP4DFTI.js";import"./chunk-UTX5PPUY.js";import"./chunk-BDQBGB3Z.js";import"./chunk-CA7OHKU4.js";import"./chunk-VWAD57RP.js";import"./chunk-3AGKNXZ2.js";import"./chunk-HGZRUCDN.js";import{c as O}from"./chunk-5QIC22QM.js";import"./chunk-VSUJFEUT.js";import"./chunk-2X5WLE7K.js";import"./chunk-U62COGMS.js";import"./chunk-ZAUYFBHZ.js";import"./chunk-G3BFCT3W.js";import"./chunk-QVXH2LXL.js";import"./chunk-MFCZNRCL.js";import"./chunk-XAJ6TVAS.js";import"./chunk-EJP4YEMY.js";import"./chunk-3WU5JWKD.js";import"./chunk-TGL4Z6ZU.js";import"./chunk-VUB3KB5Z.js";import"./chunk-LG22A7PE.js";import"./chunk-DH2KIER4.js";import"./chunk-RO4CBHM7.js";import"./chunk-Z4R7HYSO.js";import"./chunk-TLVZZXDH.js";import"./chunk-RJPQLN64.js";import{$h as V,Da as S,K as p,La as f,Lh as k,Q as u,Qh as y,S as m,_h as _,aa as o,gb as b,hb as v,ib as h,jb as g,m as l,oi as I,xb as T}from"./chunk-WSBGJRUM.js";import{a as c,b as a,i as d}from"./chunk-PMOLICDQ.js";var R=(()=>{let r=class r{authService=o(k);userSubscription=o(n);hooks=o(I);videoService=o(O);scopedTokensService=o(y);getVideosObservableFunction=this.getVideosObservable.bind(this);getSyndicationItemsFunction=this.getSyndicationItems.bind(this);defaultSort="-publishedAt";actions=[{routerLink:"/my-library/subscriptions",label:"Manage",iconName:"cog"}];disabled=!1;feedToken;getVideosObservable(e,i){let t=a(c({},i.toVideosAPIObject()),{videoPagination:e,skipCount:!0});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=!0;}enabledForReuse(){this.disabled=!1;}loadFeedToken(){if(this.feedToken)return Promise.resolve(this.feedToken);let e=this.authService.userInformationLoaded.pipe(p(),u(()=>this.scopedTokensService.getScopedTokens()),m(i=>this.feedToken=i.feedToken));return l(e);}};d(r,"\u0275fac",function(i){return new(i||r)();}),d(r,"\u0275cmp",f({type:r,selectors:[["my-videos-user-subscriptions"]],decls:3,vars:5,consts:()=>{let e;return e="Videos from your subscriptions",[e,[1,"visually-hidden"],["displayFilters","false","loadUserVideoPreferences","false","groupByDate","true","highlightLives","false",3,"getVideosObservableFunction","getSyndicationItemsFunction","defaultSort","disabled","headerActions"]];},template:function(i,t){i&1&&(v(0,"h1",1),T(1,0),h(),g(2,"my-videos-list",2)),i&2&&(S(2),b("getVideosObservableFunction",t.getVideosObservableFunction)("getSyndicationItemsFunction",t.getSyndicationItemsFunction)("defaultSort",t.defaultSort)("disabled",t.disabled)("headerActions",t.actions));},dependencies:[E],encapsulation:2}));let s=r;return s;})();var te=[{path:"",providers:[P,n,F,A,C],children:[{path:"overview",component:w,data:{meta:{title:"Discover videos"},reuse:{enabled:!0,key:"videos-discover"}}},{path:"most-liked",redirectTo:"browse?scope=federated&sort=-likes"},{path:"trending",redirectTo:()=>"browse?scope=federated&sort=-"+o(_).getDefaultTrendingSort()},{path:"recently-added",redirectTo:"browse?scope=federated&sort=-publishedAt"},{path:"local",redirectTo:"browse?scope=local&sort=-publishedAt"},{path:"browse",component:M,data:{reuse:{enabled:!0,key:"videos-list"}}},{path:"subscriptions",canActivate:[V],component:R,data:{meta:{title:"Subscriptions"},reuse:{enabled:!0,key:"subscription-videos-list"}}}]}];export{te as default};/**i18n:3907c1bc44ea3b180445250ac6c616b106e81f719372623351dcd73c005dc65a*///# sourceMappingURL=chunk-3B2SBSDB.js.map