define(["exports","./../list/list.js","./../modules/common/globalize.js","./../modules/emby-elements/emby-input/emby-input.js","./../modules/emby-elements/emby-button/emby-button.js","./../modules/emby-elements/emby-checkbox/emby-checkbox.js","./../modules/emby-elements/emby-scroller/emby-scroller.js","./../modules/emby-apiclient/connectionmanager.js","./../modules/approuter.js","./../modules/common/servicelocator.js","./startuphelper.js"],function(_exports,_list,_globalize,_embyInput,_embyButton,_embyCheckbox,_embyScroller,_connectionmanager,_approuter,_servicelocator,_startuphelper){function setItemProperies(server){}function addItems(items,serverId){items.push({Name:_globalize.default.translate("HeaderManualLogin"),Type:"ManualLogin",ServerId:serverId}),items.push({Name:_globalize.default.translate("HeaderForgotPassword"),Type:"ForgotPassword",ServerId:serverId}),_servicelocator.appHost.supports("multiserver")&&items.push({Name:_globalize.default.translate("HeaderChangeServer"),Type:"SelectServer"})}function onCardAction(e){e=e.detail.item;"User"!==e.Type?_approuter.default.showItem(e):function(item){item.HasPassword?_approuter.default.showItem({Type:"ManualLogin",ServerId:item.ServerId,Username:item.Name}):_startuphelper.default.authenticateUser(item.ServerId,item.Name)}(e)}function LoginPage(view,params){this.enableAlphaNumericShortcuts=!1,this.enableTotalRecordCountDisplay=!1,this.supportsViewSettings=!1,_list.default.call(this,view,params),view.querySelector(".itemsContainer").addEventListener("action-null",onCardAction.bind(this)),function(view){view.querySelector(".scrollSlider").insertAdjacentHTML("afterbegin",'<h1 style="text-align:center;margin: 0 0 .5em;">'+_globalize.default.translate("HeaderPleaseSignIn")+"</h1>")}(view),function(view,apiClient){_servicelocator.appHost.supports("multiserver")||apiClient.getJSON(apiClient.getUrl("Branding/Configuration")).then(function(options){var elem;options.LoginDisclaimer&&((elem=document.createElement("div")).classList.add("disclaimer"),elem.textContent=options.LoginDisclaimer||"",elem.style.textAlign="center",elem.classList.add("padded-bottom","padded-bottom-page","padded-top"),(options=view.querySelector(".scrollSlider")).insertAdjacentHTML("afterbegin",'<h1 style="text-align:center;margin-top:0;">'+_globalize.default.translate("HeaderPleaseSignIn")+"</h1>"),options.appendChild(elem),view.querySelector(".itemsContainer").classList.remove("padded-bottom-page"))})}(view,_connectionmanager.default.getApiClient(params.serverId))}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,require(["material-icons"]),Object.assign(LoginPage.prototype,_list.default.prototype),LoginPage.prototype.getSortMenuOptions=function(){return[]},LoginPage.prototype.getItemTypes=function(){return["User"]},LoginPage.prototype.getItems=function(query){var serverId=this.params.serverId,apiClient=_connectionmanager.default.getApiClient(serverId),specialItems=[],numSpecialItems=(addItems(specialItems,serverId),specialItems.length);return apiClient.getPublicUsersQueryResult(query).then(function(result){return result.Items.forEach(setItemProperies),result.Items.length<query.Limit&&addItems(result.Items,serverId),!1!==query.EnableTotalRecordCount&&(result.TotalRecordCount+=numSpecialItems),result})},LoginPage.prototype.setTitle=function(){},LoginPage.prototype.getBaseListRendererOptions=function(){var options=_list.default.prototype.getBaseListRendererOptions.apply(this,arguments);return options.draggable=!1,options.multiSelect=!1,options.contextMenu=!1,options.action="custom",options},LoginPage.prototype.getCardOptions=function(items,settings){var options=_list.default.prototype.getCardOptions.apply(this,arguments);return options.defaultBackground=!0,options},_exports.default=LoginPage});