"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[5948],{88085:function(e,a,n){n.r(a),n.d(a,{default:function(){return u}}),n(5769),n(63238),n(61418),n(17460),n(14078),n(52077),n(911),n(55849),n(69217),n(23938),n(52327);var t=n(65009),i=n.n(t),l=n(56705),r=n(3319),s=n(44614),c=n(61097);function d(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 r=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(r,">"),e.imageUrl?t+='<img src="'.concat(i()(e.imageUrl),'" style="width:100%" />'):(t+='<div class="cardImage flex align-items-center justify-content-center '.concat(c.getDefaultBackgroundClass(),'">'),t+='<span class="cardImageIcon material-icons extension" aria-hidden="true"></span>',t+="</div>"),t+="</a>",t+="</div>",t+="</div>",t+='<div class="cardFooter">',t+="<div class='cardText'>",t+=i()(e.name),t+="</div>";var d=n.find((function(a){return a.Id===e.guid}));return t+="<div class='cardText cardText-secondary'>",t+=d?s.ZP.translate("LabelVersionInstalled",d.Version):"&nbsp;",t+="</div>",t+="</div>",(t+="</div>")+"</div>"}function o(){return[{href:"#!/installedplugins.html",name:s.ZP.translate("TabMyPlugins")},{href:"#!/availableplugins.html",name:s.ZP.translate("TabCatalog")},{href:"#!/repositories.html",name:s.ZP.translate("TabRepositories")}]}function u(e){e.addEventListener("viewshow",(function(){r.Z.setTabs("plugins",1,o),function(e){l.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"),s.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 t=null,r="",c=0;c<a.length;c++){var o=a[c],u=o.categoryDisplayName;u!=t&&(t&&(r+="</div>",r+="</div>"),r+='<div class="verticalSection">',r+='<h2 class="sectionTitle sectionTitle-cards">'+i()(u)+"</h2>",r+='<div class="itemsContainer vertical-wrap">',t=u),r+=d(o,e,n)}r+="</div>",r+="</div>",!a.length&&e.noItemsElement&&e.noItemsElement.classList.remove("hide"),e.catalogElement.innerHTML=r,l.ZP.hide()}({catalogElement:e.querySelector("#pluginTiles"),noItemsElement:e.querySelector("#noPlugins"),availablePlugins:a[0],installedPlugins:a[1]})}))}(this)}))}n(46650),n(78066),n(45368),n(20716)}}]);