"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[42462],{43060:function(e,t,n){n.r(t),n.d(t,{default:function(){return c}}),n(44962),n(78557),n(90076),n(95021),n(83994),n(93062),n(82367);var a=n(90381),r=n(56869),l=n(9482),i=(n(10353),n(89100)),o=n(86191),s=n(40326);function u(e,t){switch(r.Ay.hide(),t.State){case s.K.SignedIn:var n=t.ApiClient;i.default.onServerChanged(n.getCurrentUserId(),n.accessToken(),n),i.default.navigate("home.html");break;case s.K.ServerSignIn:i.default.navigate("login.html?serverid="+t.Servers[0].Id,!1,"none");break;case s.K.ServerSelection:i.default.navigate("selectserver.html",!1,"none");break;case s.K.ServerUpdateNeeded:i.default.alert({message:l.Ay.translate("ServerUpdateNeeded",'<a href="https://github.com/jellyfin/jellyfin">https://github.com/jellyfin/jellyfin</a>')});break;case s.K.Unavailable:i.default.alert({message:l.Ay.translate("MessageUnableToConnectToServer"),title:l.Ay.translate("HeaderConnectionFailure")})}}function c(e){e.querySelector(".addServerForm").addEventListener("submit",(function(t){return function(e){r.Ay.show();var t=e.querySelector("#txtServerHost").value.replace(/\/+$/,"");o.A.connectToAddress(t,{enableAutoLogin:a.A.enableAutoLogin()}).then((function(e){u(0,e)}),(function(){u(0,{State:s.K.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)}))}}}]);