"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[12519],{12519:function(a,t,e){e(24776),e(14382),e(78557);var n=e(22696),c=e.n(n),i=e(67430),r=e(98320),o=e(76542),d=e(46782),s=e(34789),l=!s.A.slow&&!s.A.edge;function v(a,t,e,n,i,o,d){var s=i.width,l=i.coverImage,v=function(a,t,e,n,c){var i=a.Id,r=t.ImageTag;return r?c.getScaledImageUrl(i,{maxWidth:n,tag:r,type:"Chapter",index:e}):null}(a,e,n,s||400,t),u="cardContent cardContent-shadow cardImageContainer chapterCardImageContainer";l&&(u+=" coveredImage");var p=' data-action="play" data-isfolder="'.concat(a.IsFolder,'" data-id="').concat(a.Id,'" data-serverid="').concat(a.ServerId,'" data-type="').concat(a.Type,'" data-mediatype="').concat(a.MediaType,'" data-positionticks="').concat(e.StartPositionTicks,'"'),h=v?'<div class="'.concat(u,' lazy" data-src="').concat(v,'">'):'<div class="'.concat(u,'">');v||(h+='<span class="material-icons cardImageIcon local_movies" aria-hidden="true"></span>');var C="";return C+='<div class="cardText">'.concat(c()(e.Name),"</div>"),C+='<div class="cardText">'.concat(r.Ay.getDisplayRunningTime(e.StartPositionTicks),"</div>"),'<button type="button" class="'.concat(o,'"').concat(p,'><div class="').concat("cardBox",'"><div class="').concat("cardScalable",'"><div class="cardPadder-').concat(d,'"></div>').concat(h,'</div><div class="innerCardFooter">').concat(C,"</div></div></div></button>")}t.default={buildChapterCards:function(a,t,e){if(e.parentContainer){if(!document.body.contains(e.parentContainer))return;if(!t.length)return void e.parentContainer.classList.add("hide");e.parentContainer.classList.remove("hide")}var n=function(a,t,e){var n,c="card itemAction chapterCard";d.A.tv&&(c+=" show-focus",l&&(c+=" show-animation"));var r=((null===(n=(a.MediaSources||[])[0])||void 0===n?void 0:n.MediaStreams)||[]).filter((function(a){return"Video"===a.Type}))[0]||{},o=e.backdropShape||"backdrop";r.Width&&r.Height&&r.Width/r.Height<=1.2&&(o=e.squareShape||"square"),c+=" ".concat(o,"Card"),(e.block||e.rows)&&(c+=" block");for(var s="",u=0,p=i.tF.getApiClient(a.ServerId),h=0,C=t.length;h<C;h++)e.rows&&0===u&&(s+='<div class="cardColumn">'),s+=v(a,p,t[h],h,e,c,o),u++,e.rows&&u>=e.rows&&(u=0,s+="</div>");return s}(a,t,e);e.itemsContainer.innerHTML=n,o.Ay.lazyChildren(e.itemsContainer)}}}}]);