(self.webpackChunk=self.webpackChunk||[]).push([[5948],{88085:function(e,a,n){"use strict";n.r(a),n.d(a,{default:function(){return o}}),n(23938),n(98010),n(95374),n(5769),n(69217),n(63238),n(61418),n(17460),n(911),n(55849),n(14078);var t=n(6594),l=n(17025),i=n(53754),r=n(61097);function s(e,a,n){var t="",l=e.externalUrl?e.externalUrl:"#!/addplugin.html?name="+encodeURIComponent(e.name)+"&guid="+e.guid;a.context&&(l+="&context="+a.context);var s=e.externalUrl?' target="_blank"':"";t+="<div class='card backdropCard'>",t+='<div class="cardBox visualCardBox">',t+='<div class="cardScalable visualCardBox-cardScalable">',t+='<div class="cardPadder cardPadder-backdrop"></div>',t+='<div class="cardContent">',t+='<a class="cardImageContainer" is="emby-linkbutton" style="margin:0;padding:0" href="'.concat(l,'" ').concat(s,">"),e.imageUrl?t+='<img src="'.concat(e.imageUrl,'" style="width:100%" />'):(t+='<div class="cardImage flex align-items-center justify-content-center '.concat(r.getDefaultBackgroundClass(),'">'),t+='<span class="cardImageIcon material-icons extension"></span>',t+="</div>"),t+="</a>",t+="</div>",t+="</div>",t+='<div class="cardFooter">',t+="<div class='cardText'>",t+=e.name,t+="</div>";var c=n.filter((function(a){return a.Id==e.guid}))[0];return t+="<div class='cardText cardText-secondary'>",t+=c?i.ZP.translate("LabelVersionInstalled",c.Version):"&nbsp;",t+="</div>",t+="</div>",(t+="</div>")+"</div>"}function c(){return[{href:"#!/installedplugins.html",name:i.ZP.translate("TabMyPlugins")},{href:"#!/availableplugins.html",name:i.ZP.translate("TabCatalog")},{href:"#!/repositories.html",name:i.ZP.translate("TabRepositories")}]}function o(e){e.addEventListener("viewshow",(function(){l.Z.setTabs("plugins",1,c),function(e){t.ZP.show();var a=ApiClient.getAvailablePlugins(),n=ApiClient.getInstalledPlugins();Promise.all([a,n]).then((function(a){!function(e){var a=e.availablePlugins,n=e.installedPlugins;a.forEach((function(e,a,n){e.category=e.category||"General",e.categoryDisplayName=function(e){return"Channel"===(e=e.replace(" ",""))?e="Channels":"Theme"===e?e="Themes":"LiveTV"===e?e="LiveTV":"ScreenSaver"===e&&(e="HeaderScreenSavers"),i.ZP.translate(e)}(e.category),n[a]=e})),a.sort((function(e,a){return e.category>a.category?1:a.category>e.category?-1:e.name>a.name?1:a.name>e.name?-1:0}));for(var l=null,r="",c=0;c<a.length;c++){var o=a[c],d=o.categoryDisplayName;d!=l&&(l&&(r+="</div>",r+="</div>"),r+='<div class="verticalSection">',r+='<h2 class="sectionTitle sectionTitle-cards">'+d+"</h2>",r+='<div class="itemsContainer vertical-wrap">',l=d),r+=s(o,e,n)}r+="</div>",r+="</div>",!a.length&&e.noItemsElement&&e.noItemsElement.classList.remove("hide"),e.catalogElement.innerHTML=r,t.ZP.hide()}({catalogElement:e.querySelector("#pluginTiles"),noItemsElement:e.querySelector("#noPlugins"),availablePlugins:a[0],installedPlugins:a[1]})}))}(this)}))}n(5100),n(78066),n(65219),n(50447)}}]);