"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[25091],{25091:function(e,t,n){n.r(t),n.d(t,{getTabsElement:function(){return h},selectedTabIndex:function(){return v},setTabs:function(){return f}}),n(44962),n(86584),n(78557),n(90076),n(83994),n(82367);var a,s,i,r=n(36300),d=n(34789),c=n(46782),o=n(44797),u=(n(79845),n(10353),document.querySelector(".skinHeader"));function l(){this.selectedIndex(this.readySelectedIndex),this.readySelectedIndex=null}function b(e){function t(e){if(r.Ay.parentWithTag(e,"input"))return!1;var t=e.classList;return!t||!t.contains("scrollX")&&!t.contains("animatedScrollX")}for(var n=e;null!=n;){if(!t(n))return!1;n=n.parentNode}return!0}function f(e,t,r,f,v,h,m){if(s||(s=u.querySelector(".headerTabs")),!e)return a&&(document.body.classList.remove("withSectionTabs"),s.innerHTML="",s.classList.add("hide"),a=null),{tabsContainer:s,replaced:!1};var y=s;if(a||y.classList.remove("hide"),a!==e){var p=0,x='<div is="emby-tabs"'+(null==t?"":' data-index="'+t+'"')+' class="tabs-viewmenubar"><div class="emby-tabs-slider" style="white-space:nowrap;">'+r().map((function(e){var t,n="emby-tab-button";return!1===e.enabled&&(n+=" hide"),e.cssClass&&(n+=" "+e.cssClass),t=e.href?'<a href="'+e.href+'" is="emby-linkbutton" class="'+n+'" data-index="'+p+'"><div class="emby-button-foreground">'+e.name+"</div></a>":'<button type="button" is="emby-button" class="'+n+'" data-index="'+p+'"><div class="emby-button-foreground">'+e.name+"</div></button>",p++,t})).join("")+"</div></div>";return y.innerHTML=x,window.CustomElements.upgradeSubtree(y),document.body.classList.add("withSectionTabs"),a=e,function(e,t){if(d.A.touch&&!c.A.experimental){var a=function(n,a){b(a)&&e.contains(a)&&t.selectNext()},s=function(n,a){b(a)&&e.contains(a)&&t.selectPrevious()};n.e(19842).then(n.bind(n,19842)).then((function(t){var n=new(0,t.default)(e.parentNode.parentNode);o.A.on(n,"swipeleft",a),o.A.on(n,"swiperight",s),e.addEventListener("viewdestroy",(function(){n.destroy()}))}))}}(e,i=y.querySelector('[is="emby-tabs"]')),f&&i.addEventListener("beforetabchange",(function(e){var t=f();if(null!=e.detail.previousIndex){var n=t[e.detail.previousIndex];n&&n.classList.remove("is-active")}var a=t[e.detail.selectedTabIndex];a&&a.classList.add("is-active")})),v&&i.addEventListener("beforetabchange",v),h&&i.addEventListener("tabchange",h),!1!==m&&(i.selectedIndex?i.selectedIndex(t):(i.readySelectedIndex=t,i.addEventListener("ready",l))),{tabsContainer:y,tabs:i,replaced:!0}}return i.selectedIndex(t),{tabsContainer:y,tabs:i,replaced:!1}}function v(e){null!=e?i.selectedIndex(e):i.triggerTabChange()}function h(){return document.querySelector(".tabs-viewmenubar")}}}]);