/*! For license information please see movies-moviegenres.d8d491287479b136b3af.chunk.js.LICENSE.txt */
(self.webpackChunk=self.webpackChunk||[]).push([[12975,95947,3776],{3776:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return h}});var n=r(22696),i=r.n(n),a=r(24468),o=r(46782),s=r(99891),d=r(56869),l=r(70267),u=r(9482),c=r(82885),m=r(80633);function h(e,t,r){var n=this;function h(){var e=f(),r=g[e];return r||((r=g[e]={query:{SortBy:"SortName",SortOrder:"Ascending",IncludeItemTypes:"Movie",Recursive:!0,EnableTotalRecordCount:!1},view:c.getSavedView(e)||"Poster"}).query.ParentId=t.topParentId,c.loadQuerySettings(e,r.query)),r}function p(){return h().query}function f(){return t.topParentId+"-moviegenres"}function v(){return!o.A.desktop}var y,b=function(e){var i=e.target,o=i.getAttribute("data-id"),s=n.getCurrentViewStyle(),d="Thumb"==s||"ThumbCard"==s?5:9;v()&&(d=10);var l={SortBy:"Random",SortOrder:"Ascending",IncludeItemTypes:"Movie",Recursive:!0,Fields:"PrimaryImageAspectRatio,MediaSourceCount",ImageTypeLimit:1,EnableImageTypes:"Thumb"==s||"ThumbCard"==s?"Primary,Backdrop,Thumb":"Primary",Limit:d,GenreIds:o,EnableTotalRecordCount:!1,ParentId:t.topParentId};ApiClient.getItems(ApiClient.getCurrentUserId(),l).then((function(e){"Thumb"==s?a.default.buildCards(e.Items,{itemsContainer:i,shape:(0,m.UI)(v()),preferThumb:!0,showTitle:!0,scalable:!0,centerText:!0,overlayMoreButton:!0,allowBottomPadding:!1}):"ThumbCard"==s?a.default.buildCards(e.Items,{itemsContainer:i,shape:(0,m.UI)(v()),preferThumb:!0,showTitle:!0,scalable:!0,centerText:!1,cardLayout:!0,showYear:!0}):"PosterCard"==s?a.default.buildCards(e.Items,{itemsContainer:i,shape:(0,m.xK)(v()),showTitle:!0,scalable:!0,centerText:!1,cardLayout:!0,showYear:!0}):"Poster"==s&&a.default.buildCards(e.Items,{itemsContainer:i,shape:(0,m.xK)(v()),scalable:!0,overlayMoreButton:!0,allowBottomPadding:!0,showTitle:!0,centerText:!0,showYear:!0}),e.Items.length>=l.Limit&&r.querySelector(".btnMoreFromGenre"+o+" .material-icons").classList.remove("hide")}))},g={};this.getViewStyles=function(){return"Poster,PosterCard,Thumb,ThumbCard".split(",")},this.getCurrentViewStyle=function(){return h().view},this.setCurrentViewStyle=function(e){h().view=e,c.saveViewSetting(f(),e),n.preRender(),n.renderTab()},this.enableViewSelection=!0,this.preRender=function(){y=function(){d.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"),m="",h=r.Items,p=0,y=h.length;p<y;p++){var g=h[p];if(m+='<div class="verticalSection">',m+='<div class="sectionTitleContainer sectionTitleContainer-cards padded-left">',m+='<a is="emby-linkbutton" href="'+l.appRouter.getRouteUrl(g,{context:"movies",parentId:t.topParentId})+'" class="more button-flat button-flat-mini sectionTitleTextButton btnMoreFromGenre'+g.Id+'">',m+='<h2 class="sectionTitle sectionTitle-cards">',m+=i()(g.Name),m+="</h2>",m+='<span class="material-icons hide chevron_right" aria-hidden="true"></span>',m+="</a>",m+="</div>",v()){var T="scrollX hiddenScrollX";o.A.tv&&(T+="smoothScrollX padded-top-focusscale padded-bottom-focusscale"),m+='<div is="emby-itemscontainer" class="itemsContainer '+T+' lazy padded-left padded-right" data-id="'+g.Id+'">'}else m+='<div is="emby-itemscontainer" class="itemsContainer vertical-wrap lazy padded-left padded-right" data-id="'+g.Id+'">';m+="</div>",m+="</div>"}r.Items.length||(m="",m+='<div class="noItemsMessage centerMessage">',m+="<h1>"+u.Ay.translate("MessageNothingHere")+"</h1>",m+="<p>"+u.Ay.translate("MessageNoGenresAvailable")+"</p>",m+="</div>"),a.innerHTML=m,s.Ay.lazyChildren(a,b),c.saveQuerySettings(f(),n),d.Ay.hide()}))}(r,y)}}r(10353)},4452:function(e,t){var r;!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e="",t=0;t<arguments.length;t++){var r=arguments[t];r&&(e=o(e,a(r)))}return e}function a(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return i.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var r in e)n.call(e,r)&&e[r]&&(t=o(t,r));return t}function o(e,t){return t?e?e+" "+t:e+t:e}e.exports?(i.default=i,e.exports=i):void 0===(r=function(){return i}.apply(t,[]))||(e.exports=r)}()}}]);