!function(){"use strict";function e(e,t){e.state("preferences",{abstract:!0,views:{preferences:{templateUrl:"preferences.html",controller:"PreferencesController",controllerAs:"app"}}}).state("preferences.general",{url:"/general",views:{module:{templateUrl:"generalPreferences.html"}}}).state("preferences.calendars",{url:"/calendars",views:{module:{templateUrl:"calendarsPreferences.html"}}}).state("preferences.addressbooks",{url:"/addressbooks",views:{module:{templateUrl:"addressbooksPreferences.html"}}}).state("preferences.mailer",{url:"/mailer",views:{module:{templateUrl:"mailerPreferences.html"}}}),t.rules.otherwise("/general")}function t(e,t,a,r){e.DebugEnabled||r.defaultErrorHandler(function(){}),a.onError({to:"preferences.**"},function(e){"preferences"==e.to().name||e.ignored()||(t.error("transition error to "+e.to().name+": "+e.error().detail),r.go({state:"preferences"}))})}angular.module("SOGo.PreferencesUI",["ui.router","ck","angularFileUpload","SOGo.Common","SOGo.MailerUI","SOGo.ContactsUI","SOGo.Authentication","as.sortable"]).config(e).run(t),e.$inject=["$stateProvider","$urlServiceProvider"],t.$inject=["$window","$log","$transitions","$state"]}(),function(){"use strict";function e(i,e,t,s,a,r,n,o,c,d){var u=this,f=new r({id:c,security:o.security});function h(){u.account.security&&u.account.security.hasCertificate&&f.$certificate().then(function(e){u.certificate=e},function(){delete u.account.security.hasCertificate})}function p(e){var t=0e.endDate.getTime()&&(e.startDate=new Date(e.endDate.getTime()),e.startDate.addDays(-1))},this.toggleVacationEndDate=function(){var e;(e=this.preferences.defaults.Vacation).endDateEnabled&&e.startDateEnabled&&e.endDate.getTime()=C.getTime()),a},this.validateVacationEndDate=function(e){var t=m.preferences.defaults,a=!0;return t&&t.Vacation&&t.Vacation.enabled&&t.Vacation.endDateEnabled&&(a=(!t.Vacation.startDateEnabled||e.getTime()>t.Vacation.startDate.getTime())&&e.getTime()>=C.getTime()),a}}e.$inject=["$q","$window","$state","$mdMedia","$mdSidenav","$mdDialog","$mdToast","sgSettings","sgFocus","Dialog","User","Account","Preferences","Authentication"],angular.module("SOGo.PreferencesUI").controller("PreferencesController",e)}(); //# sourceMappingURL=Preferences.js.map