"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[28739],{28739:function(e,t,r){r.r(t),r.d(t,{default:function(){return h}}),r.dn(h);var n=r(22696),i=r.n(n),a=r(24468),s=r(40984),o=r(46782),d=r(99891),l=r(8566),u=r(70267),c=r(5898),m=r(95569);function h(e,t,r){var n=this;function h(){var e=b(),r=f[e];return r||((r=f[e]={query:{SortBy:"SortName",SortOrder:"Ascending",IncludeItemTypes:"Movie",Recursive:!0,EnableTotalRecordCount:!1},view:m.jS(e)||"Poster"}).query.ParentId=t.topParentId,m.YE(e,r.query)),r}function p(){return h().query}function b(){return t.topParentId+"-moviegenres"}function v(){return!o.A.desktop}var y,T=function(e,i){if(e.isIntersecting){var o=e.target;i.unobserve(o);var d=o.getAttribute("data-id"),l=n.getCurrentViewStyle(),u="Thumb"==l||"ThumbCard"==l?5:9;v()&&(u=10);var c={SortBy:"Random",SortOrder:"Ascending",IncludeItemTypes:"Movie",Recursive:!0,Fields:"PrimaryImageAspectRatio,MediaSourceCount",ImageTypeLimit:1,EnableImageTypes:"Thumb"==l||"ThumbCard"==l?"Primary,Backdrop,Thumb":"Primary",Limit:u,GenreIds:d,EnableTotalRecordCount:!1,ParentId:t.topParentId};ApiClient.getItems(ApiClient.getCurrentUserId(),c).then((function(e){"Thumb"==l?a.Ay.buildCards(e.Items,{itemsContainer:o,shape:(0,s.UI)(v()),preferThumb:!0,showTitle:!0,scalable:!0,centerText:!0,overlayMoreButton:!0,allowBottomPadding:!1}):"ThumbCard"==l?a.Ay.buildCards(e.Items,{itemsContainer:o,shape:(0,s.UI)(v()),preferThumb:!0,showTitle:!0,scalable:!0,centerText:!1,cardLayout:!0,showYear:!0}):"PosterCard"==l?a.Ay.buildCards(e.Items,{itemsContainer:o,shape:(0,s.xK)(v()),showTitle:!0,scalable:!0,centerText:!1,cardLayout:!0,showYear:!0}):"Poster"==l&&a.Ay.buildCards(e.Items,{itemsContainer:o,shape:(0,s.xK)(v()),scalable:!0,overlayMoreButton:!0,allowBottomPadding:!0,showTitle:!0,centerText:!0,showYear:!0}),e.Items.length>=c.Limit&&r.querySelector(".btnMoreFromGenre"+d+" .material-icons").classList.remove("hide")}))}},f={};this.getViewStyles=function(){return"Poster,PosterCard,Thumb,ThumbCard".split(",")},this.getCurrentViewStyle=function(){return h().view},this.setCurrentViewStyle=function(e){h().view=e,m.hz(b(),e),n.preRender(),n.renderTab()},this.enableViewSelection=!0,this.preRender=function(){y=function(){l.Ay.show();var e=p();return ApiClient.getGenres(ApiClient.getCurrentUserId(),e)}()},this.renderTab=function(){!function(e,r){var n=p();r.then((function(r){for(var a=e.querySelector("#items"),s="",h=r.Items,p=0,y=h.length;p<y;p++){var f=h[p];if(s+='<div class="verticalSection">',s+='<div class="sectionTitleContainer sectionTitleContainer-cards padded-left">',s+='<a is="emby-linkbutton" href="'+u.appRouter.getRouteUrl(f,{context:"movies",parentId:t.topParentId})+'" class="more button-flat button-flat-mini sectionTitleTextButton btnMoreFromGenre'+f.Id+'">',s+='<h2 class="sectionTitle sectionTitle-cards">',s+=i()(f.Name),s+="</h2>",s+='<span class="material-icons hide chevron_right" aria-hidden="true"></span>',s+="</a>",s+="</div>",v()){var C="scrollX hiddenScrollX";o.A.tv&&(C+="smoothScrollX padded-top-focusscale padded-bottom-focusscale"),s+='<div is="emby-itemscontainer" class="itemsContainer '+C+' lazy padded-left padded-right" data-id="'+f.Id+'">'}else s+='<div is="emby-itemscontainer" class="itemsContainer vertical-wrap lazy padded-left padded-right" data-id="'+f.Id+'">';s+="</div>",s+="</div>"}r.Items.length||(s="",s+='<div class="noItemsMessage centerMessage">',s+="<h1>"+c.Ay.translate("MessageNothingHere")+"</h1>",s+="<p>"+c.Ay.translate("MessageNoGenresAvailable")+"</p>",s+="</div>"),a.innerHTML=s,d.Ay.lazyChildren(a,T),m.Pp(b(),n),l.Ay.hide()}))}(r,y)}}r(10353)}}]);