!function(){"use strict";angular.module("SOGo.MainUI",["SOGo.Common","SOGo.Authentication"]);function e(e,o,s,r,a,n,i,t){var d=this;this.$onInit=function(){this.creds={username:o.cookieUsername,password:null,domain:null,rememberLogin:angular.isDefined(o.cookieUsername)&&0{e.parentElement.classList.add("md-input-has-value")})},100)},this.login=function(){return d.loginState="authenticating",n.login(d.creds).then(function(e){e.totpmissingkey?(d.loginState="totpcode",i("totpcode")):e.totpdisabled?(d.loginState="totpdisabled",d.cn=e.cn,d.url=e.url):(d.loginState="logged",d.cn=e.cn,d.url=e.url,s(function(){d.continueLogin()},1e3))},function(e){var o,s;d.loginState="error",e.error?d.errorMessage=e.error:0{d.retrievePasswordRecoveryEnabled(),this.passwordRecovery.passwordRecoveryLinkTimer=null},2e3)},this.retrievePasswordRecoveryEnabled=function(){(this.creds.username||this.creds.domain)&&n.passwordRecoveryEnabled(this.creds.username,this.creds.domain).then(function(e){d.passwordRecovery.passwordRecoveryMailDomain=e,d.passwordRecovery.passwordRecoveryEnabled=!0},function(){d.passwordRecovery.passwordRecoveryEnabled=!1})},this.changePasswordVisibility=function(){this.passwords.visible=!this.passwords.visible;var e=document.getElementById("passwordField");this.passwords.visible?(e.type="text",document.getElementById("password-visibility-icon").innerHTML="visibility_off"):(e.type="password",document.getElementById("password-visibility-icon").innerHTML="visibility")}}e.$inject=["$scope","$window","$timeout","Dialog","$mdDialog","Authentication","sgFocus","sgRippleClick"],angular.module("SOGo.MainUI").controller("LoginController",e)}(); //# sourceMappingURL=Main.js.map