"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[42462],{43060:function(e,t,n){n.r(t),n.d(t,{default:function(){return u}}),n(44962),n(78557),n(90076),n(95021),n(83994),n(93062),n(82367);var a=n(8566),r=n(5898),l=n(67430),i=n(90381),o=n(89100);function s(e,t){switch(a.Ay.hide(),t.State){case l.KN.SignedIn:var n=t.ApiClient;o.default.onServerChanged(n.getCurrentUserId(),n.accessToken(),n),o.default.navigate("home");break;case l.KN.ServerSignIn:o.default.navigate("login?serverid="+t.Servers[0].Id,!1,"none");break;case l.KN.ServerSelection:o.default.navigate("selectserver",!1,"none");break;case l.KN.ServerUpdateNeeded:o.default.alert({message:r.Ay.translate("ServerUpdateNeeded",'<a href="https://github.com/jellyfin/jellyfin">https://github.com/jellyfin/jellyfin</a>')});break;case l.KN.Unavailable:o.default.alert({message:r.Ay.translate("MessageUnableToConnectToServer"),title:r.Ay.translate("HeaderConnectionFailure")})}}function u(e){e.querySelector(".addServerForm").addEventListener("submit",(function(t){return function(e){a.Ay.show();var t=e.querySelector("#txtServerHost").value.replace(/\/+$/,"");l.tF.connectToAddress(t,{enableAutoLogin:i.A.enableAutoLogin()}).then((function(e){s(0,e)}),(function(){s(0,{State:l.KN.Unavailable})}))}(e),t.preventDefault(),!1})),e.querySelector(".btnCancel").addEventListener("click",(function(){Promise.resolve().then(n.bind(n,70267)).then((function(e){e.appRouter.back()}))})),Promise.resolve().then(n.bind(n,84069)).then((function(t){t.default.autoFocus(e)}))}n(10353)}}]);