"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[9974],{29974:function(e,a,t){t.r(a),t(98010),t(63238),t(61418);var r=t(90914),s=t(83094),n=t(78695),i=t(44614),c=t(56705),d=t(47518),o=t(27515),l=t(74227),u=(t(85427),t(6626),t(78066),t(32420),t(46650),!d.Z.slow&&!d.Z.edge);function v(e){var a="",t="card scalableCard backdropCard backdropCard-scalable";return n.Z.tv&&(t+=" show-focus",u&&(t+=" show-animation")),a+='<button type="button" class="'+t+'" data-id="'+e.DeviceId+'" style="min-width:33.3333%;">',a+='<div class="cardBox visualCardBox">',a+='<div class="cardScalable visualCardBox-cardScalable">',a+='<div class="cardPadder-backdrop"></div>',a+='<div class="cardContent searchImage">',a+='<div class="cardImageContainer coveredImage"><span class="cardImageIcon material-icons dvr" aria-hidden="true"></span></div>',a+="</div>",a+="</div>",a+='<div class="cardFooter visualCardBox-cardFooter">',a+='<div class="cardText cardTextCentered">'+function(e){switch(e=e.toLowerCase()){case"m3u":return"M3U";case"hdhomerun":return"HDHomerun";case"hauppauge":return"Hauppauge";case"satip":return"DVB";default:return"Unknown"}}(e.Type)+"</div>",a+='<div class="cardText cardTextCentered cardText-secondary">'+e.FriendlyName+"</div>",a+='<div class="cardText cardText-secondary cardTextCentered">',a+=e.Url||"&nbsp;",a+="</div>",a+="</div>",(a+="</div>")+"</button>"}var f=[];a.default=function(){this.show=function(){var e={removeOnClose:!0,scrollY:!1};n.Z.tv?e.size="fullscreen":e.size="small";var a=r.default.createDialog(e);a.classList.add("formDialog");var t,d,u="";return u+='<div class="formDialogHeader">',u+='<button is="paper-icon-button-light" class="btnCancel autoSize" tabindex="-1" title="'.concat(i.ZP.translate("ButtonBack"),'"><span class="material-icons arrow_back" aria-hidden="true"></span></button>'),u+='<h3 class="formDialogHeaderTitle">',u+=i.ZP.translate("HeaderLiveTvTunerSetup"),u+="</h3>",u+="</div>",u+=function(){var e="";return e+='<div class="formDialogContent scrollY">',e+='<div class="dialogContentInner dialog-content-centered">',e+='<div class="loadingContent hide">',e+="<h1>"+i.ZP.translate("DetectingDevices")+"...</h1>",e+="<p>"+i.ZP.translate("MessagePleaseWait")+"</p>",e+="</div>",e+='<h1 style="margin-bottom:.25em;" class="devicesHeader hide">'+i.ZP.translate("HeaderNewDevices")+"</h1>",e+='<div is="emby-itemscontainer" class="results vertical-wrap">',e+="</div>",(e+="</div>")+"</div>"}(),a.innerHTML=u,a.querySelector(".btnCancel").addEventListener("click",(function(){r.default.close(a)})),a.querySelector(".results").addEventListener("click",(function(e){var n=s.ZP.parentWithClass(e.target,"card");if(n){var i=n.getAttribute("data-id");t=f.filter((function(e){return e.DeviceId===i}))[0],r.default.close(a)}})),n.Z.tv&&l.default.centerFocus.on(a.querySelector(".formDialogContent"),!1),d=a,c.ZP.show(),d.querySelector(".loadingContent").classList.remove("hide"),ApiClient.getJSON(ApiClient.getUrl("LiveTv/Tuners/Discover",{NewDevicesOnly:!0})).then((function(e){f=e,function(e,a){for(var t="",r=0,s=a.length;r<s;r++)t+=v(a[r]);a.length?e.querySelector(".devicesHeader").classList.remove("hide"):(t="<p><br/>"+i.ZP.translate("NoNewDevicesFound")+"</p>",e.querySelector(".devicesHeader").classList.add("hide"));var c=e.querySelector(".results");c.innerHTML=t,n.Z.tv&&o.Z.autoFocus(c)}(d,e),d.querySelector(".loadingContent").classList.add("hide"),c.ZP.hide()})),n.Z.tv&&l.default.centerFocus.off(a.querySelector(".formDialogContent"),!1),r.default.open(a).then((function(){return t?Promise.resolve(t):Promise.reject()}))}}}}]);