e.show(e.simple().content(l("Folder compacted")).position("top right").hideDelay(3e3))})}functionG(a){a.$emptyTrash().then(function(){e.show(e.simple().content(l("Trash emptied")).position("top right").hideDelay(3e3))})}functionH(b){k.confirm(l("Confirmation"),l("Do you really want to move this folder into the trash ?")).then(function(){b.$delete().then(function(){a.go("mail.account.inbox")},function(a,c){k.alert(l('An error occured while deleting the mailbox "%{0}".',b.name),l(a.error))})})}functionI(a){a.$markAsRead()}functionJ(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:q,folder:a}})})}functionK(a){return"inbox"==a.type?{name:a.name,icon:"inbox"}:"draft"==a.type?{name:l("DraftsFolderName"),icon:"drafts"}:"sent"==a.type?{name:l("SentFolderName"),icon:"send"}:"trash"==a.type?{name:l("TrashFolderName"),icon:"delete"}:"junk"==a.type?{name:l("JunkFolderName"),icon:"thumb_down"}:"additional"==a.type?{name:a.name,icon:"folder_shared"}:{name:a.name,icon:"folder_open"}}functionL(a,b){a.$setFolderAs(b).then(function(){a.$account.$getMailboxes({reload:!0})})}functionM(){vara=window.unseenCountFolders;_.forEach(P.accounts,function(b){_.includes(a,b.id+"/folderINBOX")||a.push(b.id+"/folderINBOX"),_.forEach(b.$$flattenMailboxes,function(b){angular.isDefined(b.unseenCount)&&!_.includes(a,b.id)&&a.push(b.id)})}),n.$$resource.post("","unseenCount",{mailboxes:a}).then(function(a){_.forEach(P.accounts,function(b){_.forEach(b.$$flattenMailboxes,function(b){a[b.id]&&(b.unseenCount=a[b.id])})})}),r.ready().then(function(){vara=r.defaults.SOGoRefreshViewCheck;a&&"manually"!=a&&b(P.refreshUnseenCount,1e3*a.timeInterval())})}varN,O,P=this;P.service=o,P.accounts=s,P.toggleAccountState=y,P.newFolder=z,P.delegate=A,P.editFolder=B,P.revertEditing=C,P.selectFolder=D,P.saveFolder=E,P.compactFolder=F,P.emptyTrashFolder=G,P.confirmDelete=H,P.markFolderRead=I,P.share=J,P.metadataForFolder=K,P.setFolderAs=L,P.refreshUnseenCount=M,P.showingAdvancedSearch=!1,P.currentSearchParam="",P.addSearchParam=w,P.newSearchParam=x,P.showAdvancedSearch=t,P.hideAdvancedSearch=u,P.toggleAdvancedSearch=v,P.search={options:{"":l("Select a criteria"),subject:l("Enter Subject"),from:l("Enter From"),to:l("Enter To"),cc:l("Enter Cc"),body:l("Enter Body")},mailbox:"INBOX",subfolders:1,match:"AND",params:[]},P.refreshUnseenCount()}a.$inject=["$state","$timeout","$window","$mdDialog","$mdToast","$mdMedia","$mdSidenav","sgConstant","sgFocus","encodeUriFilter","Dialog","sgSettings","Account","Mailbox","VirtualMailbox","User","Preferences","stateAccounts"],angular.module("SOGo.MailerUI").controller("MailboxesController",a)}(),function(){"use strict";functiona(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s){functiont(){varb,c,d={};returna.opener&&a.opener.$mailboxController&&a.opener.$mailboxController.selectedFolder.$id()==i.$id()&&(c=a.opener.$mailboxController,d.mailboxCtrl=c,a.opener.$messageController&&a.opener.$messageController.message.uid==j.uid&&(b=a.opener.$messageController,d.messageCtrl=b)),d}functionu(a){L.$showDetailedRecipients=!L.$showDetailedRecipients,a.stopPropagation(),a.preventDefault()}functionv(a){varb,c,d,e;"A"==a.target.tagName&&"href"ina.target.attributes&&(b=a.target.attributes.href.value,c=/^mailto:([^\?]+)/.exec(b),c&&(d=_.map(decodeURIComponent(c[1]).split(","),function(a){return"<"+a+">"}),e={to:d},_.forEach(["subject","body"],function(a){vard=newRegExp(a+"=([^&]+)");a="body"==a?"text":a,c=d.exec(b),c&&(e[a]=[decodeURIComponent(c[1])])}),_.forEach(["cc","bcc"],function(a){vard=newRegExp(a+"=([^&]+)");c=d.exec(b),c&&(e[a]=[decodeURIComponent(c[1])])}),F(a,e)))}functionw(){vara,b,e,g,h,k=t();k.messageCtrl?(a=k.mailboxCtrl.selectedFolder,b=k.messageCtrl.message,e=k.messageCtrl.$state):(a=i,b=j,e=c),a.$deleteMessages([b]).then(function(c){vari=c;if(b=null,angular.isDefined(e)){c>0&&(i-=1,g=a.$messages[i]),c<a.$messages.length&&(h=a.$messages[c]),g?g.isread&&h&&!h.isread&&(i=c,g=h):h&&