function l(){var n,e,t=arguments[0],r=t,o=arguments;for(labels[t]?r=labels[t]:clabels[t]&&(r=clabels[t]),n=1,e=0;n{function e(e,t,n,r,o,i,s){e.classNameFilter(/^(?:(?!ng-animate-disabled).)*$/),o.definePalette("sogo-green",{50:"eaf5e9",100:"cbe5c8",200:"aad6a5",300:"88c781",400:"66b86a",500:"56b04c",600:"4da143",700:"388e3c",800:"367d2e",900:"225e1b",A100:"fafafa",A200:"69f0ae",A400:"00e676",A700:"00c853",contrastDefaultColor:"dark",contrastLightColors:["300","400","500","600","700","800","900"]}),o.definePalette("sogo-blue",{50:"f0faf9",100:"e1f5f3",200:"ceebe8",300:"bfe0dd",400:"b2d6d3",500:"a1ccc8",600:"8ebfbb",700:"7db3b0",800:"639997",900:"4d8080",A100:"d4f7fa",A200:"c3f5fa",A400:"53e3f0",A700:"00b0c0",contrastDefaultColor:"light",contrastDarkColors:["50","100","200"]});e=o.extendPalette("grey",{1e3:"baa870"});o.definePalette("sogo-grey",e),o.theme("default").primaryPalette("sogo-blue",{default:"900","hue-1":"400","hue-2":"800","hue-3":"A700"}).accentPalette("sogo-green",{default:"500","hue-1":"A100","hue-2":"300","hue-3":"A700"}).backgroundPalette("sogo-grey"),o.registerStyles(["md-toolbar.md-hue-1:not(.md-menu-toolbar).md-accent,","md-toolbar.md-hue-1:not(.md-menu-toolbar).md-accent md-input-container[md-no-float] .md-input {"," background-color: '{{accent-hue-1}}';"," color: '{{foreground-1}}';","}","md-toolbar.md-hue-1:not(.md-menu-toolbar).md-accent md-icon {"," color: '{{foreground-1}}';"," fill: '{{foreground-1}}';","}"].join("")),o.registerStyles([".md-autocomplete-suggestions.md-3-line li p {"," color: '{{foreground-2}}';","}"].join("")),o.registerStyles([".sg-time-selection-indicator.sg-time-selected,",".sg-time-selection-indicator:hover.sg-time-selected,",".sg-time-selection-indicator.md-focus.sg-time-selected {"," background: '{{primary-500}}';","}",".sg-timepicker-open .sg-timepicker-icon {"," color: '{{primary-900}}';","}",".sg-timepicker-time,",".sg-timepicker-open .sg-timepicker-input-container {"," background: '{{background-hue-1}}';","}",".sg-timepicker-input-mask-opaque {"," box-shadow: 0 0 0 9999px '{{background-hue-1}}';","}"].join("")),o.registerStyles(["[ui-view=calendars] .hours {"," color: '{{primary-700}}';","}",".attendees .busy {"," background-color: '{{background-1000}}';","}",".attendees .event {"," background-color: '{{primary-300}}';","}"].join("")),o.registerStyles([".sg-message-thread {"," background-color: '{{primary-100}}';","}",".sg-message-thread-first {"," background-color: '{{primary-200}}';","}"].join("")),window.DebugEnabled||(t.debugEnabled(!1),n.debugInfoEnabled(!1),i.disableWarnings(),s.errorOnUnhandledRejections(!1),o.generateThemesOnDemand(!0)),r.interceptors.push("AuthInterceptor"),r.interceptors.push("ErrorInterceptor")}function a(t,e,n,r,o){var i=e.defer(),s=angular.element('');return s.on("load",function(){var e=r.get("$state");2{var v;function e(e){v=e}function t(e,t,n){function r(e){return e.join("")}for(var o=e(r([".md-{{theme}}-theme",".md-fg"])+" { color:{{value}};}"),i=e(r([".md-{{theme}}-theme",".md-bg"])+" { background-color:{{value}};}"),s=e(r([".md-{{theme}}-theme",".md-bdr"])+" { border-color:{{value}};}"),a=e(r([".md-{{theme}}-theme",".md-{{hue}}",".md-fg"])+" { color:{{value}};}"),l=e(r([".md-{{theme}}-theme",".md-{{hue}}",".md-bg"])+" { background-color:{{value}};}"),c=e(r([".md-{{theme}}-theme",".md-{{palette}}",".md-fg"])+" { color:{{value}};}"),u=e(r([".md-{{theme}}-theme",".md-{{palette}}",".md-bg"])+" { background-color:{{value}}; color:{{contrast}} !important; }"),d=e(r([".md-{{theme}}-theme",".md-{{palette}}",".md-bdr"])+" { border-color:{{value}};}"),h=e(r([".md-{{theme}}-theme",".md-{{palette}}.md-{{hue}}",".md-fg"])+" { color:{{value}};}"),m=e(r([".md-{{theme}}-theme",".md-{{palette}}.md-{{hue}}",".md-bg"])+" { background-color:{{value}};}"),g=(()=>{var e=t[0].head.querySelector('style[title="Dynamic-Generated-by-mdColors"]');return null===e&&((e=t[0].createElement("style")).title="Dynamic-Generated-by-mdColors",e.appendChild(t[0].createTextNode("")),t[0].head.appendChild(e)),e.sheet})(),p=0;0{function e(e){return e.CSS.escape}e.$inject=["$window"],angular.module("SOGo.Common").filter("cssEscape",e)})(),(()=>{function e(e){return e.decodeURIComponent}e.$inject=["$window"],angular.module("SOGo.Common").filter("decodeUri",e)})(),(()=>{function e(e){return e.encodeURIComponent}e.$inject=["$window"],angular.module("SOGo.Common").filter("encodeUri",e)})(),(()=>{function e(t){return function(e){e=angular.element("
"+e+"
");return e.find("a").attr("target","_blank"),t.trustAs("html",e.html())}}e.$inject=["$sce"],angular.module("SOGo.Common").filter("ensureTarget",e)})(),angular.module("SOGo.Common").filter("loc",function(){return l}),angular.module("SOGo.Common").filter("range",function(){return function(e){for(var t=[],n=0;n{function e(t){return function(e){return e?String(t(e," _blank",{rel:"noopener"})).replace(/ /gm,"
"):void 0}}e.$inject=["linkyFilter"],angular.module("SOGo.Common").filter("txt2html",e)})(),(()=>{function e(t,n,e,r,o,i,s){var a=this;function c(e,t){if(t&&t.target.parentNode.classList.contains("md-secondary"))return!1;a.selectedUid==e.uid?a.selectedUid=null:(a.selectedUid=e.uid,(a.selectedUser=e).inactive||a.selectedUser.$rights())}a.users=o,a.folder=s,a.selectedUser=null,a.selectedUid=null,a.userToAdd="",a.searchText="",a.folderClassName=function(){return!!angular.isFunction(s.getClassName)&&s.getClassName("bg")},a.templateName=function(e){return"UIx"+(t[0].getElementById("UIxAnonymousUserRightsEditor")&&e.$isAnonymous()?"Anonymous":"")+"UserRightsEditor"},a.userFilter=function(e){return i.$filter(e,s.$acl.users,{dry:!0})},a.closeModal=function(){s.$acl.$resetUsersRights(),e.hide()},a.saveModal=function(){s.$acl.$saveUsersRights().then(function(){e.hide()},function(e,t){r.alert(l("Warning"),l("An error occured, please try again."))})},a.confirmChange=function(e){e=e.$confirmRights(a.folder);e&&(a.confirmation.showing=!0,a.confirmation.message=e)},a.removeUser=function(e){n(function(){s.$acl.$removeUser(e.uid)},500)},a.addUser=function(e){e&&s.$acl.$addUser(e).then(function(e){a.userToAdd="",a.searchText="",a.selectedUid=null,e&&c(e)})},a.toggleAllRights=function(e){s.$acl.$toggleAllRights(e)},a.selectUser=c,a.hasNoRight=function(e){return s.$acl.$hasNoRight(e)},a.showRights=function(e){return a.selectedUid==e.uid&&!e.inactive},a.confirmation={showing:!1,message:""}}e.$inject=["$document","$timeout","$mdDialog","Dialog","usersWithACL","User","folder"],angular.module("SOGo.Common").controller("AclController",e)})(),(()=>{function e(e,t,n,r,o,i,s,a,c,u,d,h,m,g){var p=new m(h.baseURL(),h.activeUser());function f(e,t){var n;t.data&&t.data.message&&angular.isString(t.data.message)?n=t.data.message:t.status&&(n=t.statusText),n?a.show({template:["",'
',' error_outline'," "+l(n)+"","
","
"].join(""),hideDelay:5e3,position:d.toastPosition}):u.debug("untrap error")}this.$onInit=function(){t.isPopup=h.isPopup,t.activeUser=h.activeUser(),t.baseURL=h.baseURL(),t.leftIsClose=!c(d["gt-md"]),t.centerIsClose=!!i.centerIsClose&&!t.leftIsClose,t.currentDay=window.currentDay,n(function(){r(function(){o.get("../date").then(function(e){t.currentDay=e})},864e5)},1e3*window.currentDay.secondsBeforeTomorrow),t.$watch(function(){return c(d["gt-xs"])},function(e){t.isGtExtraSmall=e}),t.$watch(function(){return c(d["gt-md"])},function(e){(t.isGtMedium=e)&&(t.leftIsClose=!1)}),e.$on("http:Error",f),t.isPopup||(h.activeUser("path").calendar&&g.getAlarms(),h.activeUser("path").mail&&g.pollInbox())},t.toggleLeft=function(){t.isGtMedium?t.leftIsClose=!t.leftIsClose:(t.leftIsClose=!s("left").isOpen(),t.leftIsClose&&angular.element(i).triggerHandler("resize"),s("left").toggle().then(function(){u.debug("toggle left is done")}))},t.toggleRight=function(){s("right").toggle().then(function(){u.debug("toggle right is done")})},t.toggleCenter=function(e){t.centerIsClose=!t.centerIsClose,e&&e.save&&p.post(null,"saveListState",{state:t.centerIsClose?"collapse":"rise"})}}e.$inject=["$rootScope","$scope","$timeout","$interval","$http","$window","$mdSidenav","$mdToast","$mdMedia","$log","sgConstant","sgSettings","Resource","Preferences"],angular.module("SOGo.Common").controller("navController",e)})(),(()=>{function s(e){this.folderId=e}s.factory=["$q","$timeout","sgSettings","Resource","User",function(e,t,n,r,o){return angular.extend(s,{$q:e,$timeout:t,$$resource:new r(n.activeUser("folderURL"),n.activeUser()),$User:o}),s}],angular.module("SOGo.Common").factory("Acl",s.factory),s.prototype.$users=function(t){var n,r=this,o=s.$q.defer();return this.users?(o.resolve(this.users),o.promise):(angular.isDefined(t)?s.$$resource.userResource(t):s.$$resource).fetch(this.folderId,"acls").then(function(e){return r.users=[],angular.forEach(e.users,function(e){(n=new s.$User(e)).canSubscribeUser=n.isSubscribed,n.wasSubscribed=n.isSubscribed,n.$rights=angular.bind(n,n.$acl,r.folderId,t),r.users.push(n)}),o.resolve(r.users),r.users},function(e){throw o.reject(l(e.statusText)),Error("No access to object")})},s.prototype.$addUser=function(e,t){var n=this,r=s.$q.defer(),o={uid:e.uid};return!e.uid||-1<_.indexOf(_.map(this.users,"uid"),e.uid)?r.resolve():(angular.isDefined(t)?s.$$resource.userResource(t):s.$$resource).fetch(this.folderId,"addUserInAcls",o).then(function(){e.wasSubscribed=!1,e.userClass=e.isGroup?"normal-group":"normal-user",e.$rights=angular.bind(e,e.$acl,n.folderId,t),n.users.push(e),r.resolve(e)},function(e,t){r.reject(l("An error occured, please try again."))}),r.promise},s.prototype.$removeUser=function(t,e){var n=this,r={uid:t},e=(angular.isDefined(e)?s.$$resource.userResource(e):s.$$resource).fetch(this.folderId,"removeUserFromAcls",r);return e.then(function(){var e=_.indexOf(_.map(n.users,"uid"),t);0<=e&&(n.users[e].$shadowRights=null,n.users.splice(e,1))})},s.prototype.$toggleAllRights=function(n){var r=!angular.isUndefined(_.find(_.values(n.rights),function(e){return 1!==e&&"Modifier"!==e}));_.forEach(n.rights,function(e,t){angular.isNumber(n.rights[t])?n.rights[t]=r?1:0:n.rights[t]=r?"Modifier":"None"})},s.prototype.$hasNoRight=function(e){e=_.find(e.rights,function(e,t){return angular.isNumber(e)?1===e:"None"!==e});return _.isUndefined(e)},s.prototype.$resetUsersRights=function(){angular.forEach(this.users,function(e){e.$resetRights()})},s.prototype.$saveUsersRights=function(e){var t=this,n=s.$q.defer(),r=s.$q.defer(),o={action:"saveUserRights"},i=[];return angular.forEach(this.users,function(e){e.$rightsAreDirty()&&i.push(e.$omit())}),i.length?(angular.isDefined(e)?s.$$resource.userResource(e):s.$$resource).save(this.folderId,i,o).then(function(){angular.forEach(t.users,function(e){e.$rightsAreDirty()&&(e.$shadowRights=angular.copy(e.rights))}),n.resolve()},n.reject):n.resolve(),i=[],angular.forEach(this.users,function(e){!e.wasSubscribed&&e.isSubscribed&&i.push(e.uid)}),i.length?(o={uids:i.join(",")},s.$$resource.fetch(this.folderId,"subscribeUsers",o).then(function(){angular.forEach(t.users,function(e){e.wasSubscribed=e.isSubscribed}),r.resolve()},r.reject)):r.resolve(),s.$q.all([n.promise,r.promise])}})(),angular.module("SOGo.Authentication",["ngCookies"]).constant("passwordPolicyConfig",{PolicyPasswordChangeUnsupported:-3,PolicyPasswordSystemUnknown:-2,PolicyPasswordUnknown:-1,PolicyPasswordExpired:0,PolicyAccountLocked:1,PolicyChangeAfterReset:2,PolicyPasswordModNotAllowed:3,PolicyMustSupplyOldPassword:4,PolicyInsufficientPasswordQuality:5,PolicyPasswordTooShort:6,PolicyPasswordTooYoung:7,PolicyPasswordInHistory:8,PolicyPasswordRecoveryFailed:9,PolicyPasswordRecoveryInvalidToken:10,PolicyNoError:65535}).provider("Authentication",function(){function m(e,t){var n,r;return t&&(e+="@"+t),t=""+window.location.href,"/"==(e=ApplicationBaseURL+encodeURIComponent(e))[0]&&(r=(n=t.split("/"))[2],e=n[0]+"//"+r+e),t.startsWith(e)&&!t.endsWith("/logoff")?t:e}function e(c,u,d,h){return{login:function(e){var t,n=c.defer(),r=e.username,o=e.password,i=e.verificationCode,s=e.domain,a=e.rememberLogin?1:0;return e.loginSuffix&&!r.endsWith(e.loginSuffix)&&(r+=loginSuffix,s=!1),e.language&&"WONoSelectionString"!=e.language&&(t=e.language),u({method:"POST",url:"/SOGo/connect",data:{userName:r,password:o,verificationCode:i,domain:s,language:t,rememberLogin:a}}).then(function(e){var t=e.data;navigator&&!navigator.cookieEnabled?n.reject({error:l("cookiesNotEnabled")}):void 0!==t.totpMissingKey&&202==e.status?n.resolve({totpmissingkey:1}):void 0!==t.totpDisabled?n.resolve({cn:t.cn,url:m(t.username,s),totpdisabled:1}):void 0!==t.expire&&void 0!==t.grace?t.expire<0&&0{function n(){}function e(e,t){return angular.extend(n,{$q:e,$modal:t}),n}n.alert=function(e,t){e=this.$modal.alert().title(e).htmlContent(t).ok(l("OK")).multiple(!0);this.$modal.show(e)},n.confirm=function(e,t,n){e=this.$modal.confirm().title(e).htmlContent(t).ok(n&&n.ok?n.ok:l("OK")).cancel(n&&n.cancel?n.cancel:l("Cancel"));return this.$modal.show(e)},n.prompt=function(n,e,t){var t=t||{},r=n.asCSSIdentifier(),o=this.$q.defer();function i(e,t){e.title=n,e.name="",e.cancel=function(){o.reject(),t.hide()},e.ok=function(){o.resolve(e.name),t.hide()}}return this.$modal.show({parent:angular.element(document.body),clickOutsideToClose:!0,escapeToClose:!0,template:['','
',' ','

'," "," ",' '," ","
"," ",' '," "+l("Cancel")," ",' '," "+l("OK")," "," ","
","
"].join(""),controller:i}),i.$inject=["scope","$mdDialog"],o.promise},e.$inject=["$q","$mdDialog"],angular.module("SOGo.Common").factory("Dialog",e)})(),angular.module("SOGo.Common").factory("Gravatar",function(){return function(e,t,n,r){var o,i=t,s=n;return e?(t||(i=48),"https://www.gravatar.com/avatar/"+(e=0<=(t=e.indexOf("<"))&&t<(o=e.indexOf(">",t))?e.substring(t+1,o):e).md5()+"?s="+i+"&d="+(n=s&&"none"!=s?n:r&&r.no_404?"mm":"404")):""}}),(()=>{function a(e,t,n,r,o,i,s){angular.extend(this,{_http:e,_q:t,_window:n,_cookies:r,_path:o,_activeUser:i}),angular.extend(this,s),this._path=this._path.replace(/\/$/,"")}a.$factory=["$http","$q","$window","$cookies",function(r,o,i,s){return function(e,t,n){return new a(r,o,i,s,e,t,n)}}],angular.module("SOGo.Common").factory("Resource",a.$factory),a.prototype.encodeURL=function(e){var t=this,n=e;return angular.isArray(n)||(n=e.split("/")),_.map(n,function(e){return t._window.encodeURIComponent(e.toString())})},a.prototype.userResource=function(e){var t=_.compact(this._activeUser.folderURL.split("/"));return e&&t.splice(t.length-1,1,escape(e)),new a(this._http,this._q,this._window,this._cookies,"/"+t.join("/"),this._activeUser)},a.prototype.path=function(){var e=[this._path];return 0{function e(t,n){return function(e){n(function(){t.$broadcast("sgFocusOn",e)})}}e.$inject=["$rootScope","$timeout"],angular.module("SOGo.Common").factory("sgFocus",e)})(),(()=>{function e(e,t){return angular.extend(t,{$modal:e}),new t}e.$inject=["$mdDialog","$sgHotkeys"],angular.module("SOGo.Common").service("sgHotkeys",e).provider("$sgHotkeys",function(){var o={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"caps",27:"escape",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"delete",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12"},i={42:"*",63:"?"};function e(r,e){function t(e){this.id=e.id||guid(),this.key=e.key,this.description=e.description||null,this.context=e.context||null,this.callback=e.callback,this.preventInClass=e.preventInClass,this.args=e.args,this.onKeyUp=!1,1",' ','
',"
","
","
"," "," ",' '," {{keys[0].description}}",'
'," {{keys[0].lkey || hotkey}}","
","
","
","
",""].join(""),controller:t,locals:{hotkeys:e._hotkeys}}).finally(function(){e._cheatSheet=null}),t.$inject=["$scope","hotkeys"]},n}(this.$get=e).$inject=["$rootScope","$window"]})})(),(()=>{function e(t,n){return function(e){n(function(){t.$broadcast("sgRippleDo",e)})}}e.$inject=["$rootScope","$timeout"],angular.module("SOGo.Common").factory("sgRippleClick",e)})(),(()=>{function c(e){e&&this.init(e)}c.factory=["$q","$log","sgSettings","Resource",function(e,t,n,r){return angular.extend(c,{$q:e,$log:t,$$resource:new r(n.activeUser("folderURL"),n.activeUser()),$query:"",$users:[]}),c}],angular.module("SOGo.Common").factory("User",c.factory),c.$filter=function(e,s,a){var t=c.$$resource,n={search:e};if(a&&a.dry)a&&a.uid&&(t=c.$$resource.userResource(a.uid));else{if(!e)return c.$users.splice(0,c.$users.length),c.$q.when(c.$users);if(c.$query==e)return c.$q.when(c.$users);c.$query=e}return t.fetch(null,"usersSearch",n).then(function(e){function n(e){return this.uid==e.uid}var t,r,o,i;for(a?a.dry?i=[]:a.results&&(i=a.results):i=c.$users,t=s?_.filter(e.users,function(e){return!_.find(s,_.bind(n,e))}):e.users,r=i.length-1;0<=r;r--)o=i[r],_.find(t,_.bind(n,o))||i.splice(r,1);return _.forEach(t,function(e,t){_.isUndefined(_.find(i,_.bind(n,e)))&&(e=new c(e),i.splice(t,0,e))}),c.$log.debug(i),i})},c.prototype.init=function(e){angular.extend(this,e),this.$$shortFormat||(this.$$shortFormat=this.$shortFormat()),this.$$image||(this.$$image=this.image),this.$avatarIcon=this.$isGroup()||this.$isSpecial()?"group":"person",this.empty=" "},c.prototype.$fullname=function(){var e=this.cn||this.uid;return this.c_info&&(e+=" ("+this.c_info.split("\n").join("; ")+")"),e},c.prototype.$shortFormat=function(e){var t=this.$fullname(),n=this.c_email;return!(e&&!1===e.email)&&n&&t!=n&&(t+=" <"+n+">"),t},c.prototype.$acl=function(e,t){var n=this,r=c.$q.defer(),o={uid:this.uid};return this.$shadowRights?r.resolve(this.rights):(angular.isDefined(t)?c.$$resource.userResource(t):c.$$resource).fetch(e,"userRights",o).then(function(e){return n.rights=e,n.$shadowRights=angular.copy(e),r.resolve(e),e}),r.promise},c.prototype.$isGroup=function(){return this.isGroup||this.userClass&&"normal-group"==this.userClass},c.prototype.$isAnonymous=function(){return"anonymous"==this.uid},c.prototype.$isSpecial=function(){return this.userClass&&"public-user"==this.userClass},c.prototype.$confirmRights=function(e){var t=!1;return!this.$confirmation&&(_.some(_.values(this.rights))&&("anonymous"==this.uid?"AddressBook"==e.constructor.name?t=l('Potentially anyone on the Internet will be able to access your address book "%{0}", even if they do not have an account on this system. Is this information suitable for the public Internet?',e.name):"Calendar"==e.constructor.name&&(t=l('Potentially anyone on the Internet will be able to access your calendar "%{0}", even if they do not have an account on this system. Is this information suitable for the public Internet?',e.name)):"anyone"!=this.uid&&""!=this.uid||("AddressBook"==e.constructor.name?t=l('Any user with an account on this system will be able to access your address book "%{0}". Are you certain you trust them all?',e.name):"Calendar"==e.constructor.name?t=l('Any user with an account on this system will be able to access your calendar "%{0}". Are you certain you trust them all?',e.name):"Mailbox"==e.constructor.name&&(t=l('Any user with an account on this system will be able to access your mailbox "%{0}". Are you certain you trust them all?',e.name)))),this.$confirmation=t)},c.prototype.$rightsAreDirty=function(){return this.rights&&!_.isEqual(this.rights,this.$shadowRights)},c.prototype.$resetRights=function(e){var t=this;e?_.map(_.keys(this.rights),function(e){angular.isString(t.rights[e])?t.rights[e]="None":t.rights[e]=0}):this.$shadowRights&&(this.rights=angular.copy(this.$shadowRights))},c.prototype.$folders=function(e){var t=this,n=c.$q.defer(),e={type:e};return this.$$folders?n.resolve(this.$$folders):c.$$resource.userResource(this.uid).fetch(null,"foldersSearch",e).then(function(e){t.$$folders=e.folders,n.resolve(e.folders)}),n.promise},c.prototype.$omit=function(){var n={};return angular.forEach(this,function(e,t){"constructor"!=t&&"$"!=t[0]&&(n[t]=e)}),n},c.prototype.toString=function(){return"[User "+this.c_email+"]"}})(),(()=>{function e(c,e,u){return{restrict:"A",scope:{autogrow:"=sgAutogrow"},link:function(e,t,n){var r,o,i,s,a;function l(){s=(s=r.value.encodeEntities()).replace(/\n/g,"
"),i.innerHTML=s+'
',i.style.visibility="hidden",i.style.display="block",r.style.height=Math.max(o,i.offsetHeight)+"px",i.style.visibility="visible",i.style.display="none"}e.autogrow&&(r=t[0],o=r.clientHeight,i=c[0].createElement("div"),s=null,i.classList.add("md-input"),i.classList.add("plain-text"),i.style.display="none",i.style.whiteSpace="pre-wrap",i.style.wordWrap="break-word",r.parentNode.appendChild(i),r.style.resize="none",r.style.overflow="hidden",t.on("keyup",u.debounce(l,200)),t.on("paste",u.debounce(l,0)),a=e.$watch(function(){return t[0].value},function(e){e&&(l(),a())}))}}}e.$inject=["$document","$timeout","$mdUtil"],angular.module("SOGo.Common").directive("sgAutogrow",e)})(),(()=>{function e(e,t,o,n,i,s){var a,r;function l(){a.url=null,a.urlEmail=null,a.img.addClass("ng-hide"),a.genericImg.removeClass("ng-hide")}function c(){a.genericImg.addClass("ng-hide"),a.img.removeClass("ng-hide")}a=this,e.$on("$destroy",function(){r&&t.off("click",r)}),e.$watch(function(){return a.email},function(e,t){var n,r;e&&a.urlEmail!=e?(l(),i.defaults.SOGoGravatarEnabled&&(r=s(n=e,a.size,i.defaults.SOGoAlternateAvatar),o({method:"GET",url:r,cache:!0,headers:{Accept:"image/*"}}).then(function(){a.url||(a.url=r,a.urlEmail=n,c())},function(){l()}))):e||l()}),"sg-src"in t[0].attributes&&e.$watch(function(){return a.src},function(e){e&&(a.url=e,a.urlEmail=""+a.email,t.addClass("sg-avatar-image--zoomable"),r=function(){t.toggleClass("sg-avatar-image--zoom")},t.on("click",r),c())})}e.$inject=["$scope","$element","$http","$q","Preferences","Gravatar"],angular.module("SOGo.Common").directive("sgAvatarImage",function(){return{restrict:"AE",scope:{},bindToController:{size:"@",email:"=sgEmail",src:"=sgSrc"},transclude:!0,template:['
'," ",' ',' ',"
"].join(""),link:function(e,t,n,r){var o,i=t.find("img"),t=t.find("md-icon"),s=angular.element(t[0]),a=angular.element(t[1]);n.size&&(i.attr("width",n.size),i.attr("height",n.size),s.css("font-size",n.size+"px"),a.css("font-size",parseInt(.4*n.size)+"px"));angular.isDefined(n.ngDisabled)&&(o=e.$watch(n.ngDisabled,function(e){n.disabled&&a.css({display:"block"}),o()}));r.img=i,r.genericImg=s},controller:"sgAvatarImageController",controllerAs:"vm"}}).controller("sgAvatarImageController",e)})(),(()=>{function e(e,l,c){return{link:function(e,t){var n=t[0].querySelector(".sg-button-toggle"),r=n.querySelector(".sg-icon-toggle"),o="md-rotate-180-ccw",i=t[0].querySelector(".sg-block-toggle"),s=!1;function a(){i.setAttribute("aria-hidden",!s),i.setAttribute("aria-expanded",s),s||(i.style.visibility="hidden")}n.classList.add("md-clickable"),angular.element(n).on("click",function(){(s=!s)?r.classList.add(o):r.classList.remove(o),s&&(i.style.visibility="visible"),c(function(){var e=s?i.scrollHeight:0;l(angular.element(i),{easing:"cubic-bezier(0.35, 0, 0.25, 1)",to:{height:e+"px"},duration:.75}).start().then(function(){a()})})}),a()}}}e.$inject=["$mdUtil","$animateCss","$$rAF"],angular.module("SOGo.Common").directive("sgBlockToggle",e)})(),(()=>{function e(a,l,c,u){var d="sg-checked";return{restrict:"E",replace:!0,transclude:!0,require:"?ngModel",template:['