define(["../list/list","./startuphelper","apphost","connectionManager","loading","layoutManager","imageLoader","dom","globalize","appRouter","cardBuilder","emby-linkbutton","emby-itemscontainer","emby-scroller"],function(ListPage,startupHelper,appHost,connectionManager,loading,layoutManager,imageLoader,dom,globalize,appRouter,cardBuilder){"use strict";function setItemProperies(server){}function LoginPage(view,params){ListPage.call(this,view,params),view.querySelector(".itemsContainer").addEventListener("action-null",function(e){var item=e.detail.item,user=this.items.filter(function(u){return u.Id===item.Id})[0];user.HasPassword?appRouter.showItem({Type:"ManualLogin",ServerId:user.ServerId,Username:user.Name}):startupHelper.authenticateUser(user.ServerId,user.Name)}.bind(this)),function(view,apiClient){appHost.supports("multiserver")&&apiClient.getJSON(apiClient.getUrl("Branding/Configuration")).then(function(options){var elem=view.querySelector(".disclaimer");options.LoginDisclaimer&&elem.classList.remove("hide"),elem.textContent=options.LoginDisclaimer||""})}(view,connectionManager.getApiClient(params.serverId))}return Object.assign(LoginPage.prototype,ListPage.prototype),LoginPage.prototype.getItems=function(sortBy,startIndex,limit){var serverId=this.params.serverId,apiClient=connectionManager.getApiClient(serverId),instance=this;return apiClient.getPublicUsers().then(function(result){return result.forEach(setItemProperies),function(items,serverId){items.push({Name:globalize.translate("HeaderManualLogin"),Type:"ManualLogin",ServerId:serverId}),items.push({Name:globalize.translate("HeaderForgotPassword"),Type:"ForgotPassword",ServerId:serverId}),appHost.supports("multiserver")&&items.push({Name:globalize.translate("HeaderChangeServer"),Type:"SelectServer"})}(result,serverId),instance.items=result})},LoginPage.prototype.setTitle=function(){},LoginPage.prototype.getItemsHtml=function(items){return cardBuilder.getCardsHtml({items:items,shape:"auto",showTitle:!0,centerText:!0,moreButton:!1,overlayText:!1,multiSelect:!1,action:"custom",defaultBackground:!0})},LoginPage});