import{a as P,b as w,c as M}from"./chunk-RMGP3PEN.js";import{a as E}from"./chunk-JIKGX7LG.js";import{a as n}from"./chunk-OJEAAU3T.js";import"./chunk-FCZ32F7O.js";import"./chunk-ZEEWYKMR.js";import{b as O}from"./chunk-QYLED4O6.js";import"./chunk-F6GXKPWY.js";import{d as F,h as C,i as A}from"./chunk-UG6DFTLU.js";import"./chunk-UXUMWRMX.js";import"./chunk-BPJA2ZKA.js";import"./chunk-DI6XX3KA.js";import"./chunk-2GEAOCQW.js";import"./chunk-2UHTD6EI.js";import"./chunk-ZVOBYEEZ.js";import"./chunk-H2JBB5IW.js";import"./chunk-EHGXSXDQ.js";import"./chunk-KVG4XH3A.js";import"./chunk-XJHJSTYT.js";import"./chunk-4TPOJQKB.js";import{c as I}from"./chunk-OM3FVU6X.js";import"./chunk-W3AOD4ZM.js";import"./chunk-UKHBIQJT.js";import"./chunk-FQW544WC.js";import"./chunk-ZMJKLLYA.js";import"./chunk-4ATQLHGM.js";import"./chunk-EXZU2T6R.js";import"./chunk-ODE5GCGZ.js";import"./chunk-DQU4UQBL.js";import"./chunk-N6HA4CTN.js";import"./chunk-PCGEWYLJ.js";import"./chunk-ECAJCLYK.js";import"./chunk-GK57ETDG.js";import"./chunk-YIR4YKUV.js";import"./chunk-HGZLNLER.js";import"./chunk-CBPOLVKJ.js";import"./chunk-F5QYAUDG.js";import"./chunk-XFZA4K23.js";import"./chunk-XMSHPEIZ.js";import"./chunk-EER3XQJH.js";import"./chunk-OFXGXJTA.js";import"./chunk-VJWG2YMW.js";import"./chunk-FZ5W3QGW.js";import{Bh as y,Ha as m,Kh as k,Lh as V,Q as p,S as u,Sa as S,_h as _,aa as o,eb as v,m as l,nb as b,ob as f,pb as h,wh as T,xb as g}from"./chunk-QIQJDAPQ.js";import{a as c,b as a,i as d}from"./chunk-3HGMGVFC.js";var R=(()=>{let r=class r{authService=o(T);userSubscription=o(n);hooks=o(_);videoService=o(I);scopedTokensService=o(y);getVideosObservableFunction=this.getVideosObservable.bind(this);getSyndicationItemsFunction=this.getSyndicationItems.bind(this);defaultSort="-publishedAt";actions=[{routerLink:"/my-library/subscriptions",label:"Hallinnoi",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(()=>this.scopedTokensService.getScopedTokens()),u(i=>this.feedToken=i.feedToken));return l(e);}};d(r,"\u0275fac",function(i){return new(i||r)();}),d(r,"\u0275cmp",S({type:r,selectors:[["my-videos-user-subscriptions"]],decls:3,vars:5,consts:()=>{let e;return e="Videoita tilauksistasi",[e,[1,"visually-hidden"],["displayFilters","false","loadUserVideoPreferences","false","groupByDate","true","highlightLives","false",3,"getVideosObservableFunction","getSyndicationItemsFunction","defaultSort","disabled","headerActions"]];},template:function(i,t){i&1&&(b(0,"h1",1),g(1,0),f(),h(2,"my-videos-list",2)),i&2&&(m(2),v("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,O,F,A,C],children:[{path:"overview",component:w,data:{meta:{title:"L\xF6yd\xE4 videoita"},reuse:{enabled:!0,key:"videos-discover"}}},{path:"most-liked",redirectTo:"browse?scope=federated&sort=-likes"},{path:"trending",redirectTo:()=>"browse?scope=federated&sort=-"+o(k).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:"Tilaukset"},reuse:{enabled:!0,key:"subscription-videos-list"}}}]}];export{te as default};/**i18n:d946b30bd8b2b104e368c275b91cb34bb911fa22291c946a5e8c8a6facd9306d*///# sourceMappingURL=chunk-NT76DOEA.js.map