!function(){"use strict";function e(e,r){e.state("calendars",{url:"/calendar",views:{calendars:{templateUrl:"UIxCalMainView",controller:"CalendarsController",controllerAs:"app"}},resolve:{stateCalendars:a}}).state("calendars.view",{url:"/{view:(?:day|week|month|multicolumnday)}/:day",views:{calendarView:{templateUrl:function(e){return e.view+"view?day="+e.day},controller:"CalendarController",controllerAs:"calendar"}},resolve:{stateEventsBlocks:n}}),r.when("/calendar/day",function(){return"/calendar/day/"+(new Date).getDayString()}),r.when("/calendar/multicolumnday",function(){return"/calendar/multicolumnday/"+(new Date).getDayString()}),r.when("/calendar/week",function(){return"/calendar/week/"+(new Date).getDayString()}),r.when("/calendar/month",function(){return"/calendar/month/"+(new Date).getDayString()}),r.otherwise("/calendar")}function a(e){return e.$calendars||e.$findAll(window.calendarsData)}function n(e,a,n){return a.$eventsBlocksForView(e.view,e.day.asDate()).then(function(e){return _.forEach(e,function(e){e.id&&(e.calendar=new n({id:e.id,name:e.calendarName}))}),e})}function r(e,a,n,r,t){if(e.$on("$stateChangeError",function(e,n,t,l,o,c){a.error(c),r.go("calendar")}),e.$on("$routeChangeError",function(e,n,r,t){a.error(e,n,r,t)}),0===n.url().length){var l="/calendar/",o=/(.+)view/.exec(t.settings.Calendar.View);l+=o?o[1]:"week";var c=new Date;if(t.defaults.SOGoCalendarWeekdays)for(var i=["SU","MO","TU","WE","TH","FR","SA"],d=i[c.getDay()];t.defaults.SOGoCalendarWeekdays.indexOf(d)<0;)c.addDays(1),d=i[c.getDay()];l+="/"+c.getDayString(),n.replace().url(l)}}angular.module("SOGo.SchedulerUI",["ngCookies","ui.router","angularFileUpload","ck","SOGo.Common","SOGo.PreferencesUI","SOGo.ContactsUI","SOGo.MailerUI","as.sortable"]).config(e).run(r),e.$inject=["$stateProvider","$urlRouterProvider"],a.$inject=["Calendar"],n.$inject=["$stateParams","Component","Calendar"],r.$inject=["$rootScope","$log","$location","$state","Preferences"]}();
//# sourceMappingURL=Scheduler.js.map