"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[3776],{3776:function(e,t,r){r.r(t),r.d(t,{default:function(){return 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(82885);function h(e,t,r){var n=this;function h(){var e=v(),r=T[e];return r||((r=T[e]={query:{SortBy:"SortName",SortOrder:"Ascending",IncludeItemTypes:"Movie",Recursive:!0,EnableTotalRecordCount:!1},view:m.getSavedView(e)||"Poster"}).query.ParentId=t.topParentId,m.loadQuerySettings(e,r.query)),r}function p(){return h().query}function v(){return t.topParentId+"-moviegenres"}function y(){return!o.A.desktop}var b,g=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;y()&&(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)(y()),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)(y()),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)(y()),showTitle:!0,scalable:!0,centerText:!1,cardLayout:!0,showYear:!0}):"Poster"==l&&a.Ay.buildCards(e.Items,{itemsContainer:o,shape:(0,s.xK)(y()),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")}))}},T={};this.getViewStyles=function(){return"Poster,PosterCard,Thumb,ThumbCard".split(",")},this.getCurrentViewStyle=function(){return h().view},this.setCurrentViewStyle=function(e){h().view=e,m.saveViewSetting(v(),e),n.preRender(),n.renderTab()},this.enableViewSelection=!0,this.preRender=function(){b=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,b=h.length;p<b;p++){var T=h[p];if(s+='<div class="verticalSection">',s+='<div class="sectionTitleContainer sectionTitleContainer-cards padded-left">',s+='<a is="emby-linkbutton" href="'+u.appRouter.getRouteUrl(T,{context:"movies",parentId:t.topParentId})+'" class="more button-flat button-flat-mini sectionTitleTextButton btnMoreFromGenre'+T.Id+'">',s+='<h2 class="sectionTitle sectionTitle-cards">',s+=i()(T.Name),s+="</h2>",s+='<span class="material-icons hide chevron_right" aria-hidden="true"></span>',s+="</a>",s+="</div>",y()){var f="scrollX hiddenScrollX";o.A.tv&&(f+="smoothScrollX padded-top-focusscale padded-bottom-focusscale"),s+='<div is="emby-itemscontainer" class="itemsContainer '+f+' lazy padded-left padded-right" data-id="'+T.Id+'">'}else s+='<div is="emby-itemscontainer" class="itemsContainer vertical-wrap lazy padded-left padded-right" data-id="'+T.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,g),m.saveQuerySettings(v(),n),l.Ay.hide()}))}(r,b)}}r(10353)}}]);