define(["loading","connectionManager","appRouter","globalize","apphost","emby-linkbutton","emby-scroller","material-icons","emby-button"],function(loading,connectionManager,appRouter,globalize,appHost){"use strict";function onViewShow(e){loading.hide()}function onSubmit(e){return loading.show(),connectionManager.connect().then(function(result){loading.hide(),appRouter.handleConnectionResult(result)}),e.preventDefault(),e.stopPropagation(),!1}return function(view,params){view.addEventListener("viewshow",onViewShow),view.querySelector("form").addEventListener("submit",onSubmit);var downloadMessage=view.querySelector(".embyIntroDownloadMessage");appHost.supports("externallinks")&&appHost.supports("externalappinfo")?downloadMessage.innerHTML=globalize.translate("ServerDownloadMessage",'<a is="emby-linkbutton" class="button-link" href="https://emby.media" target="_blank">https://emby.media</a>'):appHost.supports("externallinkdisplay")?downloadMessage.innerHTML=globalize.translate("ServerDownloadMessage","https://emby.media"):downloadMessage.innerHTML=globalize.translate("ServerDownloadMessageWithoutLink")}});