url:ApplicationBaseURL+[d.id,"import"].join("/"),autoUpload:!0,queueLimit:1,filters:[{name:e,fn:e}],onSuccessItem:function(b,d,e,g){varh;c.hide(),0===d.imported?h=l("No event was imported."):(h=l("A total of %{0} events were imported in the calendar.",d.imported),a.$emit("calendars:list")),f.show(f.simple().content(h).position("top right").hideDelay(3e3))},onErrorItem:function(a,b,c,d){f.show({template:["<md-toast>",' <div class="md-toast-content">',' <md-icon class="md-warn md-hue-1">error_outline</md-icon>'," <span>"+l("An error occurred while importing calendar.")+"</span>"," </div>","</md-toast>"].join(""),position:"top right",hideDelay:3e3})}}),h.close=function(){c.hide()}}d.show({parent:angular.element(document.body),targetEvent:b,clickOutsideToClose:!0,escapeToClose:!0,templateUrl:"UIxCalendarImportDialog",controller:e,controllerAs:"$CalendarImportDialogController",locals:{folder:c}}),e.$inject=["scope","$mdDialog","folder"]}functionx(a){_.forEach(m.$findAll(),function(b){a.id==b.id?b.active=1:b.active=0})}functiony(){_.forEach(m.$findAll(),function(a){a.active=1})}functionz(a){functionb(a,b){functionc(){a.hide()}vard=this;d.calendar=b,d.close=c}d.show({parent:angular.element(document.body),clickOutsideToClose:!0,escapeToClose:!0,templateUrl:a.id+"/links",controller:b,controllerAs:"links",locals:{calendar:a}}),b.$inject=["$mdDialog","calendar"]}functionA(a){functionb(a,b,c){functiond(){f.calendar.$save(),c.init(f.calendar.$omit()),b.hide()}functione(){b.cancel()}varf=this;f.calendar=newm(c.$omit()),f.saveProperties=d,f.close=e,a.$watch(function(){returnf.calendar.color},function(){c.color=f.calendar.color})}varc=a.color;d.show({templateUrl:a.id+"/properties",controller:b,controllerAs:"properties",clickOutsideToClose:!0,escapeToClose:!0,locals:{srcCalendar:a}})["catch"](function(){a.color=c}),b.$inject=["$scope","$mdDialog","srcCalendar"]}functionB(a){H.calendarName=a.name,H.editMode=a.id,h("calendarName_"+a.id)}functionC(a){a.$reset(),H.editMode=!1}functionD(a){a.$rename().then(function(a){H.editMode=!1})}functionE(a){a.$acl.$users().then(function(){d.show({templateUrl:a.id+"/UIxAclEditor",controller:"AclController",controllerAs:"acl",clickOutsideToClose:!0,escapeToClose:!0,locals:{usersWithACL:a.$acl.users,User:n,folder:a}})})}functionF(a){e.debug("subscribeToFolder "+a.owner+a.name),m.$subscribe(a.owner,a.name).then(function(a){f.show(f.simple().content(l("Successfully subscribed to calendar")).position("top right").hideDelay(3e3))})}functionG(){vara=c.location.hash.split("/"),b=a[1],d=a[2],e=newDate,f=["#",b,d,e.getDayString()];c.location=f.join("/")}varH=this;H.activeUser=j.activeUser,H.service=m,H.newCalendar=t,H.addWebCalendar=u,H.confirmDelete=v,H.editFolder=B,H.revertEditing=C,H.renameFolder=D,H.share=E,H.importCalendar=w,H.showOnly=x,H.showAll=y,H.showLinks=z,H.showProperties=A,H.subscribeToFolder=F,H.today=G,H.filter={name:""},H.toggleSortableMode=r,H.resetSort=s,H.sortableCalendars={disabled:!0,animation:150,draggable:"md-list-item",handle:".md-menu",ghostClass:"sg-sortable-ghost",chosenClass:"sg-sortable-chosen",setData:p,onEnd:q},H.sortableSubscriptions=angular.copy(H.sortableCalendars),H.sortableWebCalendars=angular.copy(H.sortableCalendars),k.ready().then(function(){H.categories=_.map(k.defaults.SOGoCalendarCategories,function(a){return{id:a.asCSSIdentifier(),name:a,color:k.defaults.SOGoCalendarCategoriesColors[a]}})}),b.$watch(function(){return_.union(_.map(m.$calendars,function(a){return_.pick(a,["id","active","color"])}),_.map(m.$subscriptions,function(a){return_.pick(a,["id","active","color"])}),_.map(m.$webcalendars,function(a){return_.pick(a,["id","active","color"])}))},function(b,c){vard,f,g;d=_.intersectionBy(b,c,"id"),f=_.map(_.filter(d,function(a){varb=_.find(c,{id:a.id});return!_.isEqual(a,b)}),"id"),g=[],f.length>0&&(e.debug(f.join(", ")+" changed"),_.forEach(f,function(a){varb=m.$get(a);g.push(b.$setActivation())})),(g.length>0||d.length!=b.length||d.length!=c.length)&&m.$q.all(g).then(function(){a.$emit("calendars:list")})},!0)}a.$inject=["$rootS