/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */ !function(e){function t(s){if(i[s])return i[s].exports;var o=i[s]={exports:{},id:s,loaded:!1};return e[s].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var i={};return t.m=e,t.c=i,t.p="rainloop/v/0.0.0/static/js/min/",t(0)}([function(e,t,i){i(69)(i(6))},function(e,t,i){!function(){"use strict";var t=null,s={},o=i(10),n=i(2),r=i(13),a=i(3),l=i(71),c=i(72),u=i(48),d=i(4),h=i(8);s.trim=r.trim,s.inArray=r.inArray,s.isArray=n.isArray,s.isFunc=n.isFunction,s.isUnd=n.isUndefined,s.isNull=n.isNull,s.emptyFunction=function(){},s.isNormal=function(e){return!s.isUnd(e)&&!s.isNull(e)},s.windowResize=n.debounce(function(e){s.isUnd(e)?h.$win.resize():o.setTimeout(function(){h.$win.resize()},e)},50),s.windowResizeCallback=function(){s.windowResize()},s.isPosNumeric=function(e,t){return s.isNormal(e)?(s.isUnd(t)?0:!t)?/^[1-9]+[0-9]*$/.test(e.toString()):/^[0-9]*$/.test(e.toString()):!1},s.pInt=function(e,t){var i=s.isNormal(e)&&""!==e?o.parseInt(e,10):t||0;return o.isNaN(i)?t||0:i},s.pString=function(e){return s.isNormal(e)?""+e:""},s.encodeURIComponent=function(e){return o.encodeURIComponent(e)},s.isNonEmptyArray=function(e){return s.isArray(e)&&0n;n++)s=i[n].split("="),t[o.decodeURIComponent(s[0])]=o.decodeURIComponent(s[1]);return t},s.mailToHelper=function(e,t){if(e&&"mailto:"===e.toString().substr(0,7).toLowerCase()){e=e.toString().substr(7);var n={},r=null,a=null,l=null,c=e.replace(/\?.+$/,""),u=e.replace(/^[^\?]*\?/,""),h=i(25);return r=new h,r.parse(o.decodeURIComponent(c)),n=s.simpleQueryParser(u),s.isUnd(n.cc)||(a=new h,a.parse(o.decodeURIComponent(n.cc))),s.isUnd(n.bcc)||(l=new h,l.parse(o.decodeURIComponent(n.bcc))),i(5).showScreenPopup(t,[d.ComposeType.Empty,null,r&&r.email?[r]:null,a&&a.email?[a]:null,l&&l.email?[l]:null,s.isUnd(n.subject)?null:s.pString(n.subject),s.isUnd(n.body)?null:s.plainToHtml(s.pString(n.body))]),!0}return!1},s.rsaObject=function(e){return c&&e&&(null===t||t&&t.__sPublicKey!==e)&&o.crypto&&o.crypto.getRandomValues?(t=new c,t.setPublicKey(e),t.__sPublicKey=e):t=!1,t},s.rsaEncode=function(e,t){if(o.crypto&&o.crypto.getRandomValues&&t){var i=!1,n=s.rsaObject(t);if(n&&(i=n.encrypt(s.fakeMd5()+":"+e+":"+s.fakeMd5()),!1!==i&&s.isNormal(i)))return"rsa:xxx:"+i}return e},s.rsaEncode.supported=!1,s.encodeHtml=function(e){return s.isNormal(e)?e.toString().replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"):""},s.splitPlainText=function(e,t){var i="",o="",n=e,r=0,a=0;for(t=s.isUnd(t)?100:t;n.length>t;)o=n.substring(0,t),r=o.lastIndexOf(" "),a=o.lastIndexOf("\n"),-1!==a&&(r=a),-1===r&&(r=t),i+=o.substring(0,r)+"\n",n=n.substring(r+1);return i+n},s.timeOutAction=function(){var e={};return function(t,i,n){s.isUnd(e[t])&&(e[t]=0),o.clearTimeout(e[t]),e[t]=o.setTimeout(i,n)}}(),s.timeOutActionSecond=function(){var e={};return function(t,i,s){e[t]||(e[t]=o.setTimeout(function(){i(),e[t]=0},s))}}(),s.audio=function(){var e=!1;return function(t,i){if(!1===e)if(h.bIsiOSDevice)e=null;else{var s=!1,n=!1,r=o.Audio?new o.Audio:null;r&&r.canPlayType&&r.play?(s=""!==r.canPlayType('audio/mpeg; codecs="mp3"'),s||(n=""!==r.canPlayType('audio/ogg; codecs="vorbis"')),s||n?(e=r,e.preload="none",e.loop=!1,e.autoplay=!1,e.muted=!1,e.src=s?t:i):e=null):e=null}return e}}(),s.hos=function(e,t){return e&&o.Object&&o.Object.hasOwnProperty?o.Object.hasOwnProperty.call(e,t):!1},s.inFocus=function(){return o.document.activeElement?(s.isUnd(o.document.activeElement.__inFocusCache)&&(o.document.activeElement.__inFocusCache=r(o.document.activeElement).is("input,textarea,iframe,.cke_editable")),!!o.document.activeElement.__inFocusCache):!1},s.removeInFocus=function(){if(o.document&&o.document.activeElement&&o.document.activeElement.blur){var e=r(o.document.activeElement);e.is("input,textarea")&&o.document.activeElement.blur()}},s.removeSelection=function(){if(o&&o.getSelection){var e=o.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else o.document&&o.document.selection&&o.document.selection.empty&&o.document.selection.empty()},s.replySubjectAdd=function(e,t){e=s.trim(e.toUpperCase()),t=s.trim(t.replace(/[\s]+/g," "));var i=!1,o=[],r="RE"===e,a="FWD"===e,l=!a;return""!==t&&n.each(t.split(":"),function(e){var t=s.trim(e);i||!/^(RE|FWD)$/i.test(t)&&!/^(RE|FWD)[\[\(][\d]+[\]\)]$/i.test(t)?(o.push(e),i=!0):(r||(r=!!/^RE/i.test(t)),a||(a=!!/^FWD/i.test(t)))}),l?r=!1:a=!1,s.trim((l?"Re: ":"Fwd: ")+(r?"Re: ":"")+(a?"Fwd: ":"")+s.trim(o.join(":")))},s.roundNumber=function(e,t){return o.Math.round(e*o.Math.pow(10,t))/o.Math.pow(10,t)},s.friendlySize=function(e){return e=s.pInt(e),e>=1073741824?s.roundNumber(e/1073741824,1)+"GB":e>=1048576?s.roundNumber(e/1048576,1)+"MB":e>=1024?s.roundNumber(e/1024,0)+"KB":e+"B"},s.log=function(e){o.console&&o.console.log&&o.console.log(e)},s.delegateRun=function(e,t,i,o){e&&e[t]&&(o=s.pInt(o),0>=o?e[t].apply(e,s.isArray(i)?i:[]):n.delay(function(){e[t].apply(e,s.isArray(i)?i:[])},o))},s.killCtrlAandS=function(e){if(e=e||o.event,e&&e.ctrlKey&&!e.shiftKey&&!e.altKey){var t=e.target||e.srcElement,i=e.keyCode||e.which;if(i===d.EventKeyCode.S)return void e.preventDefault();if(t&&t.tagName&&t.tagName.match(/INPUT|TEXTAREA/i))return;i===d.EventKeyCode.A&&(o.getSelection?o.getSelection().removeAllRanges():o.document.selection&&o.document.selection.clear&&o.document.selection.clear(),e.preventDefault())}},s.createCommand=function(e,t,i){var o=function(){return n&&n.canExecute&&n.canExecute()&&t.apply(e,Array.prototype.slice.call(arguments)),!1},n=t?o:s.emptyFunction;return n.enabled=a.observable(!0),i=s.isUnd(i)?!0:i,n.canExecute=a.computed(s.isFunc(i)?function(){return n.enabled()&&i.call(e)}:function(){return n.enabled()&&!!i}),n},s.createMomentDate=function(e){return s.isUnd(e.moment)&&(e.moment=a.observable(moment())),a.computed(function(){h.momentTrigger();var e=this.moment();return 1970===e.year()?"":e.fromNow()},e)},s.createMomentShortDate=function(e){return a.computed(function(){var e="",t=moment(),s=this.moment(),o=this.momentDate();return e=1970===s.year()?"":4>=t.diff(s,"hours")?o:t.format("L")===s.format("L")?i(7).i18n("MESSAGE_LIST/TODAY_AT",{TIME:s.format("LT")}):t.clone().subtract("days",1).format("L")===s.format("L")?i(7).i18n("MESSAGE_LIST/YESTERDAY_AT",{TIME:s.format("LT")}):s.format(t.year()===s.year()?"D MMM.":"LL")},e)},s.convertThemeName=function(e){return"@custom"===e.substr(-7)&&(e=s.trim(e.substring(0,e.length-7))),s.trim(e.replace(/[^a-zA-Z0-9]+/g," ").replace(/([A-Z])/g," $1").replace(/[\s]+/g," "))},s.quoteName=function(e){return e.replace(/["]/g,'\\"')},s.microtime=function(){return(new Date).getTime()},s.timestamp=function(){return o.Math.round(s.microtime()/1e3)},s.convertLangName=function(e,t){return i(7).i18n("LANGS_NAMES"+(!0===t?"_EN":"")+"/LANG_"+e.toUpperCase().replace(/[^a-zA-Z0-9]+/g,"_"),null,e)},s.fakeMd5=function(e){var t="",i="0123456789abcdefghijklmnopqrstuvwxyz";for(e=s.isUnd(e)?32:s.pInt(e);t.length ').appendTo("#rl-hidden")},s.defautOptionsAfterRender=function(e,t){t&&!s.isUnd(t.disabled)&&e&&r(e).toggleClass("disabled",t.disabled).prop("disabled",t.disabled)},s.windowPopupKnockout=function(e,t,n,l){var c=null,u=o.open(""),d="__OpenerApplyBindingsUid"+s.fakeMd5()+"__",h=r("#"+t);o[d]=function(){if(u&&u.document.body&&h&&h[0]){var t=r(u.document.body);r("#rl-content",t).html(h.html()),r("html",u.document).addClass("external "+r("html").attr("class")),i(7).i18nToNode(t),e&&r("#rl-content",t)[0]&&a.applyBindings(e,r("#rl-content",t)[0]),o[d]=null,l(u)}},u.document.open(),u.document.write(''+s.encodeHtml(n)+'
'),u.document.close(),c=u.document.createElement("script"),c.type="text/javascript",c.innerHTML="if(window&&window.opener&&window.opener['"+d+"']){window.opener['"+d+"']();window.opener['"+d+"']=null}",u.document.getElementsByTagName("head")[0].appendChild(c)},s.settingsSaveHelperFunction=function(e,t,i,o){return i=i||null,o=s.isUnd(o)?1e3:s.pInt(o),function(s,r,a,l,c){t.call(i,r&&r.Result?d.SaveSettingsStep.TrueResult:d.SaveSettingsStep.FalseResult),e&&e.call(i,s,r,a,l,c),n.delay(function(){t.call(i,d.SaveSettingsStep.Idle)},o)}},s.settingsSaveHelperSimpleFunction=function(e,t){return s.settingsSaveHelperFunction(null,e,t,1e3)},s.settingsSaveHelperSubscribeFunction=function(e,t,i,o){return function(n){if(e){switch(i){default:n=s.pString(n);break;case"bool":case"boolean":n=n?"1":"0";break;case"int":case"integer":case"number":n=s.pInt(n);break;case"trim":n=s.trim(n)}var r={};r[t]=n,e.saveAdminConfig?e.saveAdminConfig(o||null,r):e.saveSettings&&e.saveSettings(o||null,r)}}},s.htmlToPlain=function(e){var t=0,i=0,s=0,o=0,n=0,a="",l=function(e){for(var t=100,i="",s="",o=e,n=0,r=0;o.length>t;)s=o.substring(0,t),n=s.lastIndexOf(" "),r=s.lastIndexOf("\n"),-1!==r&&(n=r),-1===n&&(n=t),i+=s.substring(0,n)+"\n",o=o.substring(n+1);return i+o},c=function(e){return e=l(r.trim(e)),e="> "+e.replace(/\n/gm,"\n> "),e.replace(/(^|\n)([> ]+)/gm,function(){return arguments&&2]*>([\s\S\r\n]*)<\/div>/gim,u),e="\n"+r.trim(e)+"\n"),e}return""},d=function(){return arguments&&1"):""},p=function(){return arguments&&1/g,">"):""},m=function(){return arguments&&1]*>([\s\S\r\n]*)<\/pre>/gim,d).replace(/[\s]+/gm," ").replace(/((?:href|data)\s?=\s?)("[^"]+?"|'[^']+?')/gim,p).replace(/]*>/gim,"\n").replace(/<\/h[\d]>/gi,"\n").replace(/<\/p>/gi,"\n\n").replace(/<\/li>/gi,"\n").replace(/<\/td>/gi,"\n").replace(/<\/tr>/gi,"\n").replace(/]*>/gim,"\n_______________________________\n\n").replace(/]*>([\s\S\r\n]*)<\/div>/gim,u).replace(/]*>/gim,"\n__bq__start__\n").replace(/<\/blockquote>/gim,"\n__bq__end__\n").replace(/]*>([\s\S\r\n]*?)<\/a>/gim,m).replace(/<\/div>/gi,"\n").replace(/ /gi," ").replace(/"/gi,'"').replace(/<[^>]*>/gm,""),a=h.$div.html(a).text(),a=a.replace(/\n[ \t]+/gm,"\n").replace(/[\n]{3,}/gm,"\n\n").replace(/>/gi,">").replace(/</gi,"<").replace(/&/gi,"&"),t=0,n=100;n>0&&(n--,i=a.indexOf("__bq__start__",t),i>-1);)s=a.indexOf("__bq__start__",i+5),o=a.indexOf("__bq__end__",i+5),(-1===s||s>o)&&o>i?(a=a.substring(0,i)+c(a.substring(i+13,o))+a.substring(o+11),t=0):t=s>-1&&o>s?s-1:0;return a=a.replace(/__bq__start__/gm,"").replace(/__bq__end__/gm,"")},s.plainToHtml=function(e,t){e=e.toString().replace(/\r/g,""),t=s.isUnd(t)?!1:!!t;var i=!1,o=!0,n=!0,r=[],a="",l=0,c=e.split("\n");do{for(o=!1,r=[],l=0;l"===a.substr(0,1),n&&!i?(o=!0,i=!0,r.push("~~~blockquote~~~"),r.push(a.substr(1))):!n&&i?""!==a?(i=!1,r.push("~~~/blockquote~~~"),r.push(a)):r.push(a):r.push(n&&i?a.substr(1):a);i&&(i=!1,r.push("~~~/blockquote~~~")),c=r}while(o);return e=c.join("\n"),e=e.replace(/&/g,"&").replace(/>/g,">").replace(/").replace(/[\s]*~~~\/blockquote~~~/g,"").replace(/\n/g,"
"),t?s.findEmailAndLinks(e):e},o.rainloop_Utils_htmlToPlain=s.htmlToPlain,o.rainloop_Utils_plainToHtml=s.plainToHtml,s.findEmailAndLinks=function(e){return e=l.link(e,{newWindow:!0,stripPrefix:!1,urls:!0,email:!0,twitter:!1,replaceFn:function(e,t){return!(e&&t&&"url"===t.getType()&&t.matchedText&&0!==t.matchedText.indexOf("http"))}})},s.resizeAndCrop=function(e,t,i){var s=new o.Image;s.onload=function(){var e=[0,0],s=o.document.createElement("canvas"),n=s.getContext("2d");s.width=t,s.height=t,e=this.width>this.height?[this.width-this.height,0]:[0,this.height-this.width],n.fillStyle="#fff",n.fillRect(0,0,t,t),n.drawImage(this,e[0]/2,e[1]/2,this.width-e[0],this.height-e[1],0,0,t,t),i(s.toDataURL("image/jpeg"))},s.src=e},s.folderListOptionsBuilder=function(e,t,i,n,r,a,l,c,u,h){var p=null,m=!1,f=0,g=0,b="   ",y=[];for(h=s.isUnd(h)?!1:!!h,u=s.isNormal(u)?u:0f;f++)y.push({id:n[f][0],name:n[f][1],system:!1,seporator:!1,disabled:!1});for(m=!0,f=0,g=e.length;g>f;f++)p=e[f],(l?l.call(null,p):!0)&&(m&&0f;f++)p=t[f],!p.subScribed()&&p.existen&&!h||!p.selectable&&!p.hasSubScribedSubfolders()||(l?l.call(null,p):!0)&&(d.FolderType.User===p.type()||!u||p.hasSubScribedSubfolders())&&(m&&01||c>0&&l>c){for(l>c?(u(c),i=c,n=c):((3>=l||l>=c-2)&&(r+=2),u(l),i=l,n=l);r>0;)if(i-=1,n+=1,i>0&&(u(i,!1),r--),c>=n)u(n,!0),r--;else if(0>=i)break;3===i?u(2,!1):i>3&&u(o.Math.round((i-1)/2),!1,"..."),c-2===n?u(c-1,!0):c-2>n&&u(o.Math.round((c+n)/2),!0,"..."),i>1&&u(1,!1),c>n&&u(c,!0)}return a}},s.selectElement=function(e){var t,i;o.getSelection?(t=o.getSelection(),t.removeAllRanges(),i=o.document.createRange(),i.selectNodeContents(e),t.addRange(i)):o.document.selection&&(i=o.document.body.createTextRange(),i.moveToElementText(e),i.select())},s.detectDropdownVisibility=n.debounce(function(){h.dropdownVisibility(!!n.find(h.aBootstrapDropdowns,function(e){return e.hasClass("open")}))},50),s.triggerAutocompleteInputChange=function(e){var t=function(){r(".checkAutocomplete").trigger("change")};(s.isUnd(e)?1:!e)?t():n.delay(t,100)},s.setHeadViewport=function(e){var t=[];n.each(e,function(e,i){t.push(""+e+"="+i)}),r("#rl-head-viewport").attr("content",t.join(", "))},s.getFileExtension=function(e){e=s.trim(e).toLowerCase();var t=e.split(".").pop();return t===e?"":t},s.mimeContentType=function(e){var t="",i="application/octet-stream";return e=s.trim(e).toLowerCase(),"winmail.dat"===e?"application/ms-tnef":(t=s.getFileExtension(e),t&&0'),a.after(l),a.remove()),l&&l[0]&&(l.attr("data-href",c).attr("data-theme",e[0]),l[0].styleSheet&&!s.isUnd(l[0].styleSheet.cssText)?l[0].styleSheet.cssText=e[1]:l.text(e[1])),n){var o=r("#rl-bg");t?o.backstretch(n.publicLink(t),{fade:h.bAnimationSupported?1e3:0,centeredX:!0,centeredY:!0}):o.data("backstretch")&&o.backstretch("destroy").attr("style","")}i(d.SaveSettingsStep.TrueResult)}}).always(function(){s.__themeTimer=o.setTimeout(function(){i(d.SaveSettingsStep.Idle)},1e3),s.__themeAjax=null}))},e.exports=s}()},function(e){e.exports=window._},function(e,t,i){!function(t){"use strict";var s=i(10),o=i(2),n=i(13),r=function(e,i,s){t.utils.domNodeDisposal.addDisposeCallback(e,function(){s&&s.dispose&&s.dispose(),i&&(i.off("click.koTooltip"),i.tooltip&&i.tooltip("destroy")),i=null})};t.bindingHandlers.tooltip={init:function(e,s){var o=null,a=!0,l="",c="",u=null,d=i(8),h=i(7);d.bMobileDevice||(o=n(e),l=o.data("tooltip-class")||"",a="on"===(o.data("tooltip-i18n")||"on"),c=o.data("tooltip-placement")||"top",o.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:c,trigger:"hover",title:function(){var e=a?t.unwrap(s()):s()();return""===e||o.is(".disabled")||d.dropdownVisibility()?"":''+(a?h.i18n(e):e)+""}}).on("click.koTooltip",function(){o.tooltip("hide")}),u=d.tooltipTrigger.subscribe(function(){o.tooltip("hide")}),r(e,o,u))}},t.bindingHandlers.tooltipForTest={init:function(e){var t=n(e),o=null,a=i(8);t.tooltip({container:"body",trigger:"hover manual",title:function(){return t.data("tooltip3-data")||""}}),n(s.document).on("click",function(){t.tooltip("hide")}),o=a.tooltipTrigger.subscribe(function(){t.tooltip("hide")}),r(e,t,o)},update:function(e,i){var s=t.unwrap(i());""===s?n(e).data("tooltip3-data","").tooltip("hide"):(n(e).data("tooltip3-data",s),o.delay(function(){n(e).is(":visible")&&n(e).tooltip("show")},100))}},t.bindingHandlers.registrateBootstrapDropdown={init:function(e){var t=i(8);t&&t.aBootstrapDropdowns&&t.aBootstrapDropdowns.push(n(e))}},t.bindingHandlers.openDropdownTrigger={update:function(e,s){if(t.unwrap(s())){var o=n(e),r=i(1);o.hasClass("open")||(o.find(".dropdown-toggle").dropdown("toggle"),r.detectDropdownVisibility()),s()(!1)}}},t.bindingHandlers.dropdownCloser={init:function(e){n(e).closest(".dropdown").on("click",".e-item",function(){n(e).dropdown("toggle")})}},t.bindingHandlers.popover={init:function(e,i){n(e).popover(t.unwrap(i())),t.utils.domNodeDisposal.addDisposeCallback(e,function(){n(e).popover("destroy")})}},t.bindingHandlers.csstext={init:function(e,s){var o=i(1);e&&e.styleSheet&&!o.isUnd(e.styleSheet.cssText)?e.styleSheet.cssText=t.unwrap(s()):n(e).text(t.unwrap(s()))},update:function(e,s){var o=i(1);e&&e.styleSheet&&!o.isUnd(e.styleSheet.cssText)?e.styleSheet.cssText=t.unwrap(s()):n(e).text(t.unwrap(s()))}},t.bindingHandlers.resizecrop={init:function(e){n(e).addClass("resizecrop").resizecrop({width:"100",height:"100",wrapperCSS:{"border-radius":"10px"}})},update:function(e,t){t()(),n(e).resizecrop({width:"100",height:"100"})}},t.bindingHandlers.onEnter={init:function(e,i,o,r){n(e).on("keypress.koOnEnter",function(t){t&&13===s.parseInt(t.keyCode,10)&&(n(e).trigger("change"),i().call(r))}),t.utils.domNodeDisposal.addDisposeCallback(e,function(){n(e).off("keypress.koOnEnter")})}},t.bindingHandlers.onEsc={init:function(e,i,o,r){n(e).on("keypress.koOnEsc",function(t){t&&27===s.parseInt(t.keyCode,10)&&(n(e).trigger("change"),i().call(r))}),t.utils.domNodeDisposal.addDisposeCallback(e,function(){n(e).off("keypress.koOnEsc")})}},t.bindingHandlers.clickOnTrue={update:function(e,i){t.unwrap(i())&&n(e).click()}},t.bindingHandlers.modal={init:function(e,s){var o=i(8),r=i(1);n(e).toggleClass("fade",!o.bMobileDevice).modal({keyboard:!1,show:t.unwrap(s())}).on("shown.koModal",r.windowResizeCallback).find(".close").on("click.koModal",function(){s()(!1)}),t.utils.domNodeDisposal.addDisposeCallback(e,function(){n(e).off("shown.koModal").find(".close").off("click.koModal")})},update:function(e,i){n(e).modal(t.unwrap(i())?"show":"hide")}},t.bindingHandlers.i18nInit={init:function(e){i(7).i18nToNode(e)}},t.bindingHandlers.i18nUpdate={update:function(e,s){t.unwrap(s()),i(7).i18nToNode(e)}},t.bindingHandlers.link={update:function(e,i){n(e).attr("href",t.unwrap(i()))}},t.bindingHandlers.title={update:function(e,i){n(e).attr("title",t.unwrap(i()))}},t.bindingHandlers.textF={init:function(e,i){n(e).text(t.unwrap(i()))}},t.bindingHandlers.initDom={init:function(e,t){t()(e)}},t.bindingHandlers.initFixedTrigger={init:function(e,i){var o=t.unwrap(i()),r=null,a=n(e),l=null,c=o[1]||0;r=n(o[0]||null),r=r[0]?r:null,r&&n(s).resize(function(){l=r.offset(),l&&l.top&&a.css("top",l.top+c)})}},t.bindingHandlers.initResizeTrigger={init:function(e,i){var s=t.unwrap(i());n(e).css({height:s[1],"min-height":s[1]})},update:function(e,s){var o=i(1),r=i(8),a=t.unwrap(s()),l=o.pInt(a[1]),c=0,u=n(e).offset().top;u>0&&(u+=o.pInt(a[2]),c=r.$win.height()-u,c>l&&(l=c),n(e).css({height:l,"min-height":l}))}},t.bindingHandlers.appendDom={update:function(e,i){n(e).hide().empty().append(t.unwrap(i())).show()}},t.bindingHandlers.draggable={init:function(e,o,r){var a=i(8),l=i(1);if(!a.bMobileDevice){var c=100,u=3,d=r(),h=d&&d.droppableSelector?d.droppableSelector:"",p={distance:20,handle:".dragHandle",cursorAt:{top:22,left:3},refreshPositions:!0,scroll:!0};h&&(p.drag=function(e){n(h).each(function(){var t=null,i=null,o=n(this),r=o.offset(),a=r.top+o.height();s.clearInterval(o.data("timerScroll")),o.data("timerScroll",!1),e.pageX>=r.left&&e.pageX<=r.left+o.width()&&(e.pageY>=a-c&&e.pageY<=a&&(t=function(){o.scrollTop(o.scrollTop()+u),l.windowResize()},o.data("timerScroll",s.setInterval(t,10)),t()),e.pageY>=r.top&&e.pageY<=r.top+c&&(i=function(){o.scrollTop(o.scrollTop()-u),l.windowResize()},o.data("timerScroll",s.setInterval(i,10)),i()))})},p.stop=function(){n(h).each(function(){s.clearInterval(n(this).data("timerScroll")),n(this).data("timerScroll",!1)})}),p.helper=function(e){return o()(e&&e.target?t.dataFor(e.target):null)},n(e).draggable(p).on("mousedown.koDraggable",function(){l.removeInFocus()}),t.utils.domNodeDisposal.addDisposeCallback(e,function(){n(e).off("mousedown.koDraggable").draggable("destroy")})}}},t.bindingHandlers.droppable={init:function(e,s,o){var r=i(8);if(!r.bMobileDevice){var a=s(),l=o(),c=l&&l.droppableOver?l.droppableOver:null,u=l&&l.droppableOut?l.droppableOut:null,d={tolerance:"pointer",hoverClass:"droppableHover"};a&&(d.drop=function(e,t){a(e,t)},c&&(d.over=function(e,t){c(e,t)}),u&&(d.out=function(e,t){u(e,t)}),n(e).droppable(d),t.utils.domNodeDisposal.addDisposeCallback(e,function(){n(e).droppable("destroy")}))}}},t.bindingHandlers.nano={init:function(e){var t=i(8);t.bDisableNanoScroll||n(e).addClass("nano").nanoScroller({iOSNativeScrolling:!1,preventPageScrolling:!0})}},t.bindingHandlers.saveTrigger={init:function(e){var t=n(e);t.data("save-trigger-type",t.is("input[type=text],input[type=email],input[type=password],select,textarea")?"input":"custom"),"custom"===t.data("save-trigger-type")?t.append('  ').addClass("settings-saved-trigger"):t.addClass("settings-saved-trigger-input")},update:function(e,i){var s=t.unwrap(i()),o=n(e);if("custom"===o.data("save-trigger-type"))switch(s.toString()){case"1":o.find(".animated,.error").hide().removeClass("visible").end().find(".success").show().addClass("visible");break;case"0":o.find(".animated,.success").hide().removeClass("visible").end().find(".error").show().addClass("visible");break;case"-2":o.find(".error,.success").hide().removeClass("visible").end().find(".animated").show().addClass("visible");break;default:o.find(".animated").hide().end().find(".error,.success").removeClass("visible")}else switch(s.toString()){case"1":o.addClass("success").removeClass("error");break;case"0":o.addClass("error").removeClass("success");break;case"-2":break;default:o.removeClass("error success")}}},t.bindingHandlers.emailsTags={init:function(e,t,s){var r=i(1),a=i(25),l=n(e),c=t(),u=s(),d=u.autoCompleteSource||null,h=function(e){c&&c.focusTrigger&&c.focusTrigger(e)};l.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!0,focusCallback:h,inputDelimiters:[",",";"],autoCompleteSource:d,parseHook:function(e){return o.map(e,function(e){var t=r.trim(e),i=null;return""!==t?(i=new a,i.mailsoParse(t),[i.toLine(!1),i]):[t,null]})},change:o.bind(function(e){l.data("EmailsTagsValue",e.target.value),c(e.target.value)},this)})},update:function(e,i,s){var o=n(e),r=s(),a=r.emailsTagsFilter||null,l=t.unwrap(i());o.data("EmailsTagsValue")!==l&&(o.val(l),o.data("EmailsTagsValue",l),o.inputosaurus("refresh")),a&&t.unwrap(a)&&o.inputosaurus("focus")}},t.bindingHandlers.command={init:function(e,i,s,o){var r=n(e),a=i();if(!a||!a.enabled||!a.canExecute)throw new Error("You are not using command function");r.addClass("command"),t.bindingHandlers[r.is("form")?"submit":"click"].init.apply(o,arguments)},update:function(e,t){var i=!0,s=n(e),o=t();i=o.enabled(),s.toggleClass("command-not-enabled",!i),i&&(i=o.canExecute(),s.toggleClass("command-can-not-be-execute",!i)),s.toggleClass("command-disabled disable disabled",!i).toggleClass("no-disabled",!!i),(s.is("input")||s.is("button"))&&s.prop("disabled",!i)}},t.extenders.trimmer=function(e){var s=i(1),o=t.computed({read:e,write:function(t){e(s.trim(t.toString()))},owner:this});return o(e()),o},t.extenders.posInterer=function(e,s){var o=i(1),n=t.computed({read:e,write:function(t){var i=o.pInt(t.toString(),s);0>=i&&(i=s),i===e()&&""+i!=""+t&&e(i+1),e(i)}});return n(e()),n},t.extenders.limitedList=function(e,s){var o=i(1),n=t.computed({read:e,write:function(i){var n=t.unwrap(e),r=t.unwrap(s);o.isNonEmptyArray(r)?-1").addClass("rl-view-model").addClass("RL-"+r.viewModelTemplate()).hide(),h.appendTo(d),r.viewModelDom=h,e.__dom=h,"Popups"===a&&(r.cancelCommand=r.closeCommand=u.createCommand(r,function(){i.hideScreenPopup(e)}),r.modalVisibility.subscribe(function(e){var t=this;e?(this.viewModelDom.show(),this.storeAndSetKeyScope(),l.popupVisibilityNames.push(this.viewModelName),r.viewModelDom.css("z-index",3e3+l.popupVisibilityNames().length+10),u.delegateRun(this,"onFocus",[],500)):(u.delegateRun(this,"onHide"),this.onHideTrigger&&this.onHideTrigger(!this.onHideTrigger()),this.restoreKeyScope(),s.each(this.viewModelNames,function(e){c.runHook("view-model-on-hide",[e,t])}),l.popupVisibilityNames.remove(this.viewModelName),r.viewModelDom.css("z-index",2e3),l.tooltipTrigger(!l.tooltipTrigger()),s.delay(function(){t.viewModelDom.hide()},300))},r)),s.each(e.__names,function(e){c.runHook("view-model-pre-build",[e,r,h])}),n.applyBindingAccessorsToNode(h[0],{i18nInit:!0,template:function(){return{name:r.viewModelTemplate()}}},r),u.delegateRun(r,"onBuild",[h]),r&&"Popups"===a&&r.registerPopupKeyDown(),s.each(e.__names,function(e){c.runHook("view-model-post-build",[e,r,h])})):u.log("Cannot find view model position: "+a)}return e?e.__vm:null},t.prototype.hideScreenPopup=function(e){e&&e.__vm&&e.__dom&&e.__vm.modalVisibility(!1)},t.prototype.showScreenPopup=function(e,t){e&&(this.buildViewModel(e),e.__vm&&e.__dom&&(e.__vm.modalVisibility(!0),u.delegateRun(e.__vm,"onShow",t||[]),e.__vm.onShowTrigger&&e.__vm.onShowTrigger(!e.__vm.onShowTrigger()),s.each(e.__names,function(i){c.runHook("view-model-on-show",[i,e.__vm,t||[]])})))},t.prototype.isPopupVisible=function(e){return e&&e.__vm?e.__vm.modalVisibility():!1},t.prototype.screenOnRoute=function(e,t){var i=this,o=null,n=null;""===u.pString(e)&&(e=this.sDefaultScreenName),""!==e&&(o=this.screen(e),o||(o=this.screen(this.sDefaultScreenName),o&&(t=e+"/"+t,e=this.sDefaultScreenName)),o&&o.__started&&(o.__builded||(o.__builded=!0,u.isNonEmptyArray(o.viewModels())&&s.each(o.viewModels(),function(e){this.buildViewModel(e,o)},this),u.delegateRun(o,"onBuild")),s.defer(function(){i.oCurrentScreen&&(u.delegateRun(i.oCurrentScreen,"onHide"),i.oCurrentScreen.onHideTrigger&&i.oCurrentScreen.onHideTrigger(!i.oCurrentScreen.onHideTrigger()),u.isNonEmptyArray(i.oCurrentScreen.viewModels())&&s.each(i.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.hide(),e.__vm.viewModelVisibility(!1),u.delegateRun(e.__vm,"onHide"),e.__vm.onHideTrigger&&e.__vm.onHideTrigger(!e.__vm.onHideTrigger()))})),i.oCurrentScreen=o,i.oCurrentScreen&&(u.delegateRun(i.oCurrentScreen,"onShow"),i.oCurrentScreen.onShowTrigger&&i.oCurrentScreen.onShowTrigger(!i.oCurrentScreen.onShowTrigger()),c.runHook("screen-on-show",[i.oCurrentScreen.screenName(),i.oCurrentScreen]),u.isNonEmptyArray(i.oCurrentScreen.viewModels())&&s.each(i.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.show(),e.__vm.viewModelVisibility(!0),u.delegateRun(e.__vm,"onShow"),e.__vm.onShowTrigger&&e.__vm.onShowTrigger(!e.__vm.onShowTrigger()),u.delegateRun(e.__vm,"onFocus",[],200),s.each(e.__names,function(t){c.runHook("view-model-on-show",[t,e.__vm])}))},i)),n=o.__cross?o.__cross():null,n&&n.parse(t)})))},t.prototype.startScreens=function(e){o("#rl-content").css({visibility:"hidden"}),s.each(e,function(e){var t=new e,i=t?t.screenName():"";t&&""!==i&&(""===this.sDefaultScreenName&&(this.sDefaultScreenName=i),this.oScreens[i]=t)},this),s.each(this.oScreens,function(e){e&&!e.__started&&e.__start&&(e.__started=!0,e.__start(),c.runHook("screen-pre-start",[e.screenName(),e]),u.delegateRun(e,"onStart"),c.runHook("screen-post-start",[e.screenName(),e]))},this);var t=a.create();t.addRoute(/^([a-zA-Z0-9\-]*)\/?(.*)$/,s.bind(this.screenOnRoute,this)),r.initialized.add(t.parse,t),r.changed.add(t.parse,t),r.init(),o("#rl-content").css({visibility:"visible"}),s.delay(function(){l.$html.removeClass("rl-started-trigger").addClass("rl-started")},50),s.delay(function(){l.$html.addClass("rl-started-delay")},200)},t.prototype.setHash=function(e,t,i){e="#"===e.substr(0,1)?e.substr(1):e,e="/"===e.substr(0,1)?e.substr(1):e,i=u.isUnd(i)?!1:!!i,(u.isUnd(t)?1:!t)?(r.changed.active=!0,r[i?"replaceHash":"setHash"](e),r.setHash(e)):(r.changed.active=!1,r[i?"replaceHash":"setHash"](e),r.changed.active=!0)},e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(){x.call(this,R),this.oMoveCache={},this.quotaDebounce=o.debounce(this.quota,3e4),this.moveOrDeleteResponseHelper=o.bind(this.moveOrDeleteResponseHelper,this),this.messagesMoveTrigger=o.debounce(this.messagesMoveTrigger,500),s.setInterval(function(){m.pub("interval.30s")},3e4),s.setInterval(function(){m.pub("interval.1m")},6e4),s.setInterval(function(){m.pub("interval.2m")},12e4),s.setInterval(function(){m.pub("interval.3m")},18e4),s.setInterval(function(){m.pub("interval.5m")},3e5),s.setInterval(function(){m.pub("interval.10m")},6e5),s.setInterval(function(){m.pub("interval.15m")},9e5),s.setInterval(function(){m.pub("interval.20m")},9e5),s.setTimeout(function(){s.setInterval(function(){m.pub("interval.5m-after5m")},3e5)},3e5),s.setTimeout(function(){s.setInterval(function(){m.pub("interval.10m-after5m")},6e5)},3e5),n.wakeUp(function(){R.jsVersion(function(e,t){l.StorageResultType.Success===e&&t&&!t.Result&&(s.parent&&A.settingsGet("InIframe")?s.parent.location.reload():s.location.reload())},A.settingsGet("Version"))},{},36e5),A.settingsGet("UserBackgroundHash")&&o.delay(function(){n("#rl-bg").attr("style","background-image: none !important;").backstretch(p.publicLink(A.settingsGet("UserBackgroundHash")),{fade:c.bAnimationSupported?1e3:0}).removeAttr("style")},2e3),this.socialUsers=o.bind(this.socialUsers,this)}var s=i(10),o=i(2),n=i(13),r=i(36),a=i(75),l=i(4),c=i(8),u=i(16),d=i(23),h=i(1),p=i(12),m=i(28),f=i(7),g=i(5),b=i(35),y=i(30),S=i(26),v=i(22),w=i(43),C=i(32),T=i(20),F=i(60),A=i(9),E=i(15),N=i(19),R=i(14),I=i(25),P=i(100),L=i(81),M=i(95),D=i(101),k=i(102),x=i(46);o.extend(t.prototype,x.prototype),t.prototype.remote=function(){return R},t.prototype.reloadFlagsCurrentMessageListAndMessageFromCache=function(){o.each(E.messageList(),function(e){N.initMessageFlagsFromCache(e)}),N.initMessageFlagsFromCache(E.message())},t.prototype.reloadMessageList=function(e,t){var i=this,s=(E.messageListPage()-1)*S.messagesPerPage();(h.isUnd(t)?1:!t)||N.setFolderHash(E.currentFolderFullNameRaw(),""),(h.isUnd(e)?1:!e)||(E.messageListPage(1),s=0),E.messageListLoading(!0),R.messageList(function(e,t,s){l.StorageResultType.Success===e&&t&&t.Result?(E.messageListError(""),E.messageListLoading(!1),i.setMessageList(t,s)):l.StorageResultType.Unload===e?(E.messageListError(""),E.messageListLoading(!1)):l.StorageResultType.Abort!==e&&(E.messageList([]),E.messageListLoading(!1),E.messageListError(t&&t.ErrorCode?f.getNotification(t.ErrorCode):f.i18n("NOTIFICATIONS/CANT_GET_MESSAGE_LIST")))},E.currentFolderFullNameRaw(),s,S.messagesPerPage(),E.messageListSearch())},t.prototype.recacheInboxMessageList=function(){R.messageList(h.emptyFunction,N.getFolderInboxName(),0,S.messagesPerPage(),"",!0)},t.prototype.reloadMessageListHelper=function(e){this.reloadMessageList(e)},t.prototype.contactsSync=function(e){var t=E.contacts;return t.importing()||t.syncing()||!E.enableContactsSync()||!E.allowContactsSync()?!1:(t.syncing(!0),R.contactsSync(function(i,s){t.syncing(!1),e&&e(i,s)}),!0)},t.prototype.messagesMoveTrigger=function(){var e=this,t=C.spamFolder();o.each(this.oMoveCache,function(i){var s=t===i.To,o=!s&&t===i.From&&N.getFolderInboxName()===i.To;R.messagesMove(e.moveOrDeleteResponseHelper,i.From,i.To,i.Uid,s?"SPAM":o?"HAM":"")}),this.oMoveCache={}},t.prototype.messagesMoveHelper=function(e,t,i){var s="$$"+e+"$$"+t+"$$";this.oMoveCache[s]||(this.oMoveCache[s]={From:e,To:t,Uid:[]}),this.oMoveCache[s].Uid=o.union(this.oMoveCache[s].Uid,i),this.messagesMoveTrigger()},t.prototype.messagesCopyHelper=function(e,t,i){R.messagesCopy(this.moveOrDeleteResponseHelper,e,t,i)},t.prototype.messagesDeleteHelper=function(e,t){R.messagesDelete(this.moveOrDeleteResponseHelper,e,t)},t.prototype.moveOrDeleteResponseHelper=function(e,t){l.StorageResultType.Success===e&&E.currentFolder()&&(t&&h.isArray(t.Result)&&2===t.Result.length?N.setFolderHash(t.Result[0],t.Result[1]):(N.setFolderHash(E.currentFolderFullNameRaw(),""),t&&-1o;o++)m=e.Result["@Collection"][o],m&&"Object/Message"===m["@Object"]&&(g=p[o],g&&g.initByJson(m)||(g=L.newInstanceFromJson(m)),g&&(N.hasNewMessageAndRemoveFromCache(g.folderFullNameRaw,g.uid)&&5>=y&&(y++,g.newForAnimation(!0)),g.deleted(!1),t?N.initMessageFlagsFromCache(g):N.storeMessageFlagsToCache(g),g.lastInCollapsedThread(i&&-1s;s++)n=t[s],n&&(a=n.FullNameRaw,r=N.getFolderFromCacheList(a),r||(r=P.newInstanceFromJson(n),r&&(N.setFolderToCacheList(a,r),N.setFolderFullNameRaw(r.fullNameHash,a,r))),r&&(r.collapsed(!i.isFolderExpanded(r.fullNameHash)),n.Extended&&(n.Extended.Hash&&N.setFolderHash(r.fullNameRaw,n.Extended.Hash),h.isNormal(n.Extended.MessageCount)&&r.messageCountAll(n.Extended.MessageCount),h.isNormal(n.Extended.MessageUnseenCount)&&r.messageCountUnread(n.Extended.MessageUnseenCount)),l=n.SubFolders,l&&"Collection/FolderCollection"===l["@Object"]&&l["@Collection"]&&h.isArray(l["@Collection"])&&r.subFolders(this.folderResponseParseRec(e,l["@Collection"])),c.push(r)));return c},t.prototype.setFolders=function(e){var t=[],i=!1,s=function(e){return""===e||u.Values.UnuseOptionValue===e||null!==N.getFolderFromCacheList(e)?e:""};e&&e.Result&&"Collection/FolderCollection"===e.Result["@Object"]&&e.Result["@Collection"]&&h.isArray(e.Result["@Collection"])&&(h.isUnd(e.Result.Namespace)||(E.namespace=e.Result.Namespace),y.threadsAllowed(!!A.settingsGet("UseImapThread")&&e.Result.IsThreadsSupported&&!0),t=this.folderResponseParseRec(E.namespace,e.Result["@Collection"]),E.folderList(t),e.Result.SystemFolders&&""==""+A.settingsGet("SentFolder")+A.settingsGet("DraftFolder")+A.settingsGet("SpamFolder")+A.settingsGet("TrashFolder")+A.settingsGet("ArchiveFolder")+A.settingsGet("NullFolder")&&(A.settingsSet("SentFolder",e.Result.SystemFolders[2]||null),A.settingsSet("DraftFolder",e.Result.SystemFolders[3]||null),A.settingsSet("SpamFolder",e.Result.SystemFolders[4]||null),A.settingsSet("TrashFolder",e.Result.SystemFolders[5]||null),A.settingsSet("ArchiveFolder",e.Result.SystemFolders[12]||null),i=!0),C.sentFolder(s(A.settingsGet("SentFolder"))),C.draftFolder(s(A.settingsGet("DraftFolder"))),C.spamFolder(s(A.settingsGet("SpamFolder"))),C.trashFolder(s(A.settingsGet("TrashFolder"))),C.archiveFolder(s(A.settingsGet("ArchiveFolder"))),i&&R.saveSystemFolders(h.emptyFunction,{SentFolder:C.sentFolder(),DraftFolder:C.draftFolder(),SpamFolder:C.spamFolder(),TrashFolder:C.trashFolder(),ArchiveFolder:C.archiveFolder(),NullFolder:"NullFolder"}),F.set(l.ClientSideKeyName.FoldersLashHash,e.Result.FoldersHash))},t.prototype.isFolderExpanded=function(e){var t=F.get(l.ClientSideKeyName.ExpandedFolders);return h.isArray(t)&&-1!==o.indexOf(t,e)},t.prototype.setExpandedFolder=function(e,t){var i=F.get(l.ClientSideKeyName.ExpandedFolders);h.isArray(i)||(i=[]),t?(i.push(e),i=o.uniq(i)):i=o.without(i,e),F.set(l.ClientSideKeyName.ExpandedFolders,i)},t.prototype.initHorizontalLayoutResizer=function(e){var t=200,i=500,s=null,o=null,r=function(t,i){i&&i.size&&i.size.height&&(F.set(e,i.size.height),u(i.size.height),h.windowResize())},a={helper:"ui-resizable-helper-h",minHeight:t,maxHeight:i,handles:"s",stop:r},u=function(e){e&&(s&&s.attr("style","height:"+e+"px"),o&&o.attr("style","top:"+(55+e)+"px"))},d=function(i){if(i)s&&s.hasClass("ui-resizable")&&s.resizable("destroy").removeAttr("style"),o&&o.removeAttr("style");else if(c.$html.hasClass("rl-bottom-preview-pane")){s=n(".b-message-list-wrapper"),o=n(".b-message-view-wrapper"),s.hasClass("ui-resizable")||s.resizable(a);var r=h.pInt(F.get(e))||300;u(r>t?r:t)}};d(!1),m.sub("layout",function(e){d(l.Layout.BottomPreview!==e)})},t.prototype.initVerticalLayoutResizer=function(e){var t=60,i=155,s=n("#rl-left"),o=n("#rl-right"),r=F.get(e)||null,a=function(e){e&&(s.css({width:""+e+"px"}),o.css({left:""+e+"px"}))},l=function(o){if(o)s.resizable("disable"),a(t);else{s.resizable("enable");var n=h.pInt(F.get(e))||i;a(n>i?n:i)}},c=function(t,i){i&&i.size&&i.size.width&&(F.set(e,i.size.width),o.css({left:""+i.size.width+"px"}))};null!==r&&a(r>i?r:i),s.resizable({helper:"ui-resizable-helper-w",minWidth:i,maxWidth:350,handles:"e",stop:c}),m.sub("left-panel.off",function(){l(!0)}),m.sub("left-panel.on",function(){l(!1)})},t.prototype.bootstartLoginScreen=function(){c.$html.removeClass("rl-user-auth").addClass("rl-user-no-auth");var e=h.pString(A.settingsGet("CustomLoginLink"));e?(g.routeOff(),g.setHash(p.root(),!0),g.routeOff(),o.defer(function(){s.location.href=e})):(g.hideLoading(),g.startScreens([i(106)]),d.runHook("rl-start-login-screens"),m.pub("rl.bootstart-login-screens"))},t.prototype.bootstart=function(){x.prototype.bootstart.call(this),i(30).populate(),i(26).populate(),i(66).populate(),i(43).populate(),i(22).populate();var e=this,t=i(152),n=A.settingsGet("JsHash"),r=h.pInt(A.settingsGet("ContactsSyncInterval")),u=A.settingsGet("AllowGoogleSocial"),y=A.settingsGet("AllowFacebookSocial"),S=A.settingsGet("AllowTwitterSocial");a&&(a.set(70),a.sleep()),c.leftPanelDisabled.subscribe(function(e){m.pub("left-panel."+(e?"off":"on"))}),A.settingsGet("Auth")?(c.$html.addClass("rl-user-auth"),this.setTitle(f.i18n("TITLES/LOADING")),e.folders(o.bind(function(n){if(g.hideLoading(),n){if(t&&s.crypto&&s.crypto.getRandomValues&&A.capa(l.Capa.OpenPGP)){var f=function(t){T.openpgp=t,T.openpgpKeyring=new t.Keyring,T.capaOpenPGP(!0),m.pub("openpgp.init"),e.reloadOpenPgpKeys()};s.openpgp?f(s.openpgp):t.script(p.openPgpJs()).wait(function(){s.openpgp&&f(s.openpgp)})}else T.capaOpenPGP(!1);g.startScreens([i(107),i(108),i(105)]),(u||y||S)&&e.socialUsers(!0),m.sub("interval.2m",function(){e.folderInformation(N.getFolderInboxName())}),m.sub("interval.3m",function(){var t=E.currentFolderFullNameRaw();N.getFolderInboxName()!==t&&e.folderInformation(t)}),m.sub("interval.5m-after5m",function(){e.folderInformationMultiply()}),m.sub("interval.15m",function(){e.quota()}),m.sub("interval.20m",function(){e.folders()}),r=r>=5?r:20,r=320>=r?r:320,o.delay(function(){e.contactsSync()},1e4),o.delay(function(){e.folderInformationMultiply(!0)},2e3),s.setInterval(function(){e.contactsSync()},6e4*r+5e3),(A.capa(l.Capa.AdditionalAccounts)||A.capa(l.Capa.AdditionalIdentities))&&e.accountsAndIdentities(!0),o.delay(function(){var t=E.currentFolderFullNameRaw();N.getFolderInboxName()!==t&&e.folderInformation(t)},1e3),o.delay(function(){e.quota()},5e3),o.delay(function(){R.appDelayStart(h.emptyFunction)},35e3),d.runHook("rl-start-user-screens"),m.pub("rl.bootstart-user-screens"),A.settingsGet("AccountSignMe")&&s.navigator.registerProtocolHandler&&o.delay(function(){try{s.navigator.registerProtocolHandler("mailto",s.location.protocol+"//"+s.location.host+s.location.pathname+"?mailto&to=%s",""+(A.settingsGet("Title")||"RainLoop"))}catch(e){}A.settingsGet("MailToEmail")&&h.mailToHelper(A.settingsGet("MailToEmail"),i(27))},500),c.bMobileDevice||o.defer(function(){e.initVerticalLayoutResizer(l.ClientSideKeyName.FolderListSize)})}else this.bootstartLoginScreen();a&&a.set(100)},e))):(this.bootstartLoginScreen(),a&&a.set(100)),u&&(s["rl_"+n+"_google_service"]=function(){b.google.loading(!0),e.socialUsers()}),y&&(s["rl_"+n+"_facebook_service"]=function(){b.facebook.loading(!0),e.socialUsers()}),S&&(s["rl_"+n+"_twitter_service"]=function(){b.twitter.loading(!0),e.socialUsers()}),m.sub("interval.1m",function(){c.momentTrigger(!c.momentTrigger())}),d.runHook("rl-start-screens"),m.pub("rl.bootstart-end")},e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(){this.data=s.rainloopI18N||{},this.notificationI18N={},this.trigger=r.observable(!1),this.i18n=n.bind(this.i18n,this)}var s=i(10),o=i(13),n=i(2),r=i(3),a=i(4),l=i(8);t.prototype.data={},t.prototype.notificationI18N={},t.prototype.i18n=function(e,t,i){var s="",o=n.isUndefined(this.data[e])?n.isUndefined(i)?e:i:this.data[e];if(!n.isUndefined(t)&&!n.isNull(t))for(s in t)n.has(t,s)&&(o=o.replace("%"+s+"%",t[s]));return o},t.prototype.i18nToNode=function(e,t){var i=this;n.defer(function(){o(".i18n",e).each(function(){var e=o(this),t="";t=e.data("i18n-text"),t?e.text(i.i18n(t)):(t=e.data("i18n-html"),t&&e.html(i.i18n(t)),t=e.data("i18n-placeholder"),t&&e.attr("placeholder",i.i18n(t)),t=e.data("i18n-title"),t&&e.attr("title",i.i18n(t)))}),t&&l.bAnimationSupported&&o(".i18n-animation.i18n",e).letterfx({fx:"fall fade",backwards:!1,timing:50,fx_duration:"50ms",letter_end:"restore",element_end:"restore"})})},t.prototype.reloadData=function(){s.rainloopI18N&&(this.data=s.rainloopI18N||{},this.i18nToNode(o(s.document),!0),this.trigger(!this.trigger())),s.rainloopI18N=null},t.prototype.initNotificationLanguage=function(){var e=this.notificationI18N||{};e[a.Notification.InvalidToken]=this.i18n("NOTIFICATIONS/INVALID_TOKEN"),e[a.Notification.AuthError]=this.i18n("NOTIFICATIONS/AUTH_ERROR"),e[a.Notification.AccessError]=this.i18n("NOTIFICATIONS/ACCESS_ERROR"),e[a.Notification.ConnectionError]=this.i18n("NOTIFICATIONS/CONNECTION_ERROR"),e[a.Notification.CaptchaError]=this.i18n("NOTIFICATIONS/CAPTCHA_ERROR"),e[a.Notification.SocialFacebookLoginAccessDisable]=this.i18n("NOTIFICATIONS/SOCIAL_FACEBOOK_LOGIN_ACCESS_DISABLE"),e[a.Notification.SocialTwitterLoginAccessDisable]=this.i18n("NOTIFICATIONS/SOCIAL_TWITTER_LOGIN_ACCESS_DISABLE"),e[a.Notification.SocialGoogleLoginAccessDisable]=this.i18n("NOTIFICATIONS/SOCIAL_GOOGLE_LOGIN_ACCESS_DISABLE"),e[a.Notification.DomainNotAllowed]=this.i18n("NOTIFICATIONS/DOMAIN_NOT_ALLOWED"),e[a.Notification.AccountNotAllowed]=this.i18n("NOTIFICATIONS/ACCOUNT_NOT_ALLOWED"),e[a.Notification.AccountTwoFactorAuthRequired]=this.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_REQUIRED"),e[a.Notification.AccountTwoFactorAuthError]=this.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_ERROR"),e[a.Notification.CouldNotSaveNewPassword]=this.i18n("NOTIFICATIONS/COULD_NOT_SAVE_NEW_PASSWORD"),e[a.Notification.CurrentPasswordIncorrect]=this.i18n("NOTIFICATIONS/CURRENT_PASSWORD_INCORRECT"),e[a.Notification.NewPasswordShort]=this.i18n("NOTIFICATIONS/NEW_PASSWORD_SHORT"),e[a.Notification.NewPasswordWeak]=this.i18n("NOTIFICATIONS/NEW_PASSWORD_WEAK"),e[a.Notification.NewPasswordForbidden]=this.i18n("NOTIFICATIONS/NEW_PASSWORD_FORBIDDENT"),e[a.Notification.ContactsSyncError]=this.i18n("NOTIFICATIONS/CONTACTS_SYNC_ERROR"),e[a.Notification.CantGetMessageList]=this.i18n("NOTIFICATIONS/CANT_GET_MESSAGE_LIST"),e[a.Notification.CantGetMessage]=this.i18n("NOTIFICATIONS/CANT_GET_MESSAGE"),e[a.Notification.CantDeleteMessage]=this.i18n("NOTIFICATIONS/CANT_DELETE_MESSAGE"),e[a.Notification.CantMoveMessage]=this.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),e[a.Notification.CantCopyMessage]=this.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),e[a.Notification.CantSaveMessage]=this.i18n("NOTIFICATIONS/CANT_SAVE_MESSAGE"),e[a.Notification.CantSendMessage]=this.i18n("NOTIFICATIONS/CANT_SEND_MESSAGE"),e[a.Notification.InvalidRecipients]=this.i18n("NOTIFICATIONS/INVALID_RECIPIENTS"),e[a.Notification.CantSaveFilters]=this.i18n("NOTIFICATIONS/CANT_SAVE_FILTERS"),e[a.Notification.CantGetFilters]=this.i18n("NOTIFICATIONS/CANT_GET_FILTERS"),e[a.Notification.FiltersAreNotCorrect]=this.i18n("NOTIFICATIONS/FILTERS_ARE_NOT_CORRECT"),e[a.Notification.CantCreateFolder]=this.i18n("NOTIFICATIONS/CANT_CREATE_FOLDER"),e[a.Notification.CantRenameFolder]=this.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER"),e[a.Notification.CantDeleteFolder]=this.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER"),e[a.Notification.CantDeleteNonEmptyFolder]=this.i18n("NOTIFICATIONS/CANT_DELETE_NON_EMPTY_FOLDER"),e[a.Notification.CantSubscribeFolder]=this.i18n("NOTIFICATIONS/CANT_SUBSCRIBE_FOLDER"),e[a.Notification.CantUnsubscribeFolder]=this.i18n("NOTIFICATIONS/CANT_UNSUBSCRIBE_FOLDER"),e[a.Notification.CantSaveSettings]=this.i18n("NOTIFICATIONS/CANT_SAVE_SETTINGS"),e[a.Notification.CantSavePluginSettings]=this.i18n("NOTIFICATIONS/CANT_SAVE_PLUGIN_SETTINGS"),e[a.Notification.DomainAlreadyExists]=this.i18n("NOTIFICATIONS/DOMAIN_ALREADY_EXISTS"),e[a.Notification.CantInstallPackage]=this.i18n("NOTIFICATIONS/CANT_INSTALL_PACKAGE"),e[a.Notification.CantDeletePackage]=this.i18n("NOTIFICATIONS/CANT_DELETE_PACKAGE"),e[a.Notification.InvalidPluginPackage]=this.i18n("NOTIFICATIONS/INVALID_PLUGIN_PACKAGE"),e[a.Notification.UnsupportedPluginPackage]=this.i18n("NOTIFICATIONS/UNSUPPORTED_PLUGIN_PACKAGE"),e[a.Notification.LicensingServerIsUnavailable]=this.i18n("NOTIFICATIONS/LICENSING_SERVER_IS_UNAVAILABLE"),e[a.Notification.LicensingExpired]=this.i18n("NOTIFICATIONS/LICENSING_EXPIRED"),e[a.Notification.LicensingBanned]=this.i18n("NOTIFICATIONS/LICENSING_BANNED"),e[a.Notification.DemoSendMessageError]=this.i18n("NOTIFICATIONS/DEMO_SEND_MESSAGE_ERROR"),e[a.Notification.DemoAccountError]=this.i18n("NOTIFICATIONS/DEMO_ACCOUNT_ERROR"),e[a.Notification.AccountAlreadyExists]=this.i18n("NOTIFICATIONS/ACCOUNT_ALREADY_EXISTS"),e[a.Notification.AccountDoesNotExist]=this.i18n("NOTIFICATIONS/ACCOUNT_DOES_NOT_EXIST"),e[a.Notification.MailServerError]=this.i18n("NOTIFICATIONS/MAIL_SERVER_ERROR"),e[a.Notification.InvalidInputArgument]=this.i18n("NOTIFICATIONS/INVALID_INPUT_ARGUMENT"),e[a.Notification.UnknownNotification]=this.i18n("NOTIFICATIONS/UNKNOWN_ERROR"),e[a.Notification.UnknownError]=this.i18n("NOTIFICATIONS/UNKNOWN_ERROR") },t.prototype.initOnStartOrLangChange=function(e,t,i){e&&e.call(t),i?this.trigger.subscribe(function(){e&&e.call(t),i.call(t)}):e&&this.trigger.subscribe(e,t)},t.prototype.getNotification=function(e,t){return e=s.parseInt(e,10)||0,a.Notification.ClientViewError===e&&t?t:n.isUndefined(this.notificationI18N[e])?"":this.notificationI18N[e]},t.prototype.getUploadErrorDescByCode=function(e){var t="";switch(s.parseInt(e,10)||0){case a.UploadErrorCode.FileIsTooBig:t=this.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG");break;case a.UploadErrorCode.FilePartiallyUploaded:t=this.i18n("UPLOAD/ERROR_FILE_PARTIALLY_UPLOADED");break;case a.UploadErrorCode.FileNoUploaded:t=this.i18n("UPLOAD/ERROR_NO_FILE_UPLOADED");break;case a.UploadErrorCode.MissingTempFolder:t=this.i18n("UPLOAD/ERROR_MISSING_TEMP_FOLDER");break;case a.UploadErrorCode.FileOnSaveingError:t=this.i18n("UPLOAD/ERROR_ON_SAVING_FILE");break;case a.UploadErrorCode.FileType:t=this.i18n("UPLOAD/ERROR_FILE_TYPE");break;default:t=this.i18n("UPLOAD/ERROR_UNKNOWN")}return t},t.prototype.reload=function(e,t,s){var r=this,a=o("html"),l=function(){},c=(new Date).getTime();a.addClass("rl-changing-language"),o.ajax({url:i(12).langLink(e),dataType:"script",cache:!0}).fail(s||l).done(function(){n.delay(function(){r.reloadData(),(t||l)(),a.removeClass("rl-changing-language")},500<(new Date).getTime()-c?1:500)})},e.exports=new t}()},function(e,t,i){!function(){"use strict";var t={},s=i(10),o=i(2),n=i(13),r=i(3),a=i(21),l=i(4);t.$win=n(s),t.$doc=n(s.document),t.$html=n("html"),t.$div=n("
"),t.now=(new s.Date).getTime(),t.momentTrigger=r.observable(!0),t.dropdownVisibility=r.observable(!1).extend({rateLimit:0}),t.tooltipTrigger=r.observable(!1).extend({rateLimit:0}),t.useKeyboardShortcuts=r.observable(!0),t.iAjaxErrorCount=0,t.iTokenErrorCount=0,t.iMessageBodyCacheCount=0,t.bUnload=!1,t.sUserAgent=(s.navigator.userAgent||"").toLowerCase(),t.bIsiOSDevice=-11&&(s=s.replace(/[\/]+$/,""),s+="/p"+t),""!==i&&(s=s.replace(/[\/]+$/,""),s+="/"+encodeURI(i)),s},t.prototype.phpInfo=function(){return this.sServer+"Info"},t.prototype.langLink=function(e){return this.sServer+"/Lang/0/"+encodeURI(e)+"/"+this.sVersion+"/"},t.prototype.exportContactsVcf=function(){return this.sServer+"/Raw/"+this.sSubQuery+this.sSpecSuffix+"/ContactsVcf/"},t.prototype.exportContactsCsv=function(){return this.sServer+"/Raw/"+this.sSubQuery+this.sSpecSuffix+"/ContactsCsv/"},t.prototype.emptyContactPic=function(){return this.sStaticPrefix+"css/images/empty-contact.png"},t.prototype.sound=function(e){return this.sStaticPrefix+"sounds/"+e},t.prototype.themePreviewLink=function(e){var t="rainloop/v/"+this.sVersion+"/";return"@custom"===e.substr(-7)&&(e=o.trim(e.substring(0,e.length-7)),t=""),t+"themes/"+s.encodeURI(e)+"/images/preview.png"},t.prototype.notificationMailIcon=function(){return this.sStaticPrefix+"css/images/icom-message-notification.png"},t.prototype.openPgpJs=function(){return this.sStaticPrefix+"js/min/openpgp.js"},t.prototype.socialGoogle=function(){return this.sServer+"SocialGoogle"+(""!==this.sSpecSuffix?"/"+this.sSubQuery+this.sSpecSuffix+"/":"")},t.prototype.socialTwitter=function(){return this.sServer+"SocialTwitter"+(""!==this.sSpecSuffix?"/"+this.sSubQuery+this.sSpecSuffix+"/":"")},t.prototype.socialFacebook=function(){return this.sServer+"SocialFacebook"+(""!==this.sSpecSuffix?"/"+this.sSubQuery+this.sSpecSuffix+"/":"")},e.exports=new t}()},function(e){e.exports=window.jQuery},function(e,t,i){!function(){"use strict";function t(){h.call(this),this.oRequests={}}var s=i(2),o=i(1),n=i(16),r=i(92),a=i(30),l=i(26),c=i(9),u=i(19),d=i(15),h=i(59);s.extend(t.prototype,h.prototype),t.prototype.folders=function(e){this.defaultRequest(e,"Folders",{SentFolder:c.settingsGet("SentFolder"),DraftFolder:c.settingsGet("DraftFolder"),SpamFolder:c.settingsGet("SpamFolder"),TrashFolder:c.settingsGet("TrashFolder"),ArchiveFolder:c.settingsGet("ArchiveFolder")},null,"",["Folders"])},t.prototype.login=function(e,t,i,s,o,n,r,a){this.defaultRequest(e,"Login",{Email:t,Login:i,Password:s,Language:n||"",AdditionalCode:r||"",AdditionalCodeSignMe:a?"1":"0",SignMe:o?"1":"0"})},t.prototype.getTwoFactor=function(e){this.defaultRequest(e,"GetTwoFactorInfo")},t.prototype.createTwoFactor=function(e){this.defaultRequest(e,"CreateTwoFactorSecret")},t.prototype.clearTwoFactor=function(e){this.defaultRequest(e,"ClearTwoFactorInfo")},t.prototype.showTwoFactorSecret=function(e){this.defaultRequest(e,"ShowTwoFactorSecret")},t.prototype.testTwoFactor=function(e,t){this.defaultRequest(e,"TestTwoFactorInfo",{Code:t})},t.prototype.enableTwoFactor=function(e,t){this.defaultRequest(e,"EnableTwoFactor",{Enable:t?"1":"0"})},t.prototype.clearTwoFactorInfo=function(e){this.defaultRequest(e,"ClearTwoFactorInfo")},t.prototype.contactsSync=function(e){this.defaultRequest(e,"ContactsSync",null,n.Defaults.ContactsSyncAjaxTimeout)},t.prototype.saveContactsSyncData=function(e,t,i,s,o){this.defaultRequest(e,"SaveContactsSyncData",{Enable:t?"1":"0",Url:i,User:s,Password:o})},t.prototype.accountSetup=function(e,t,i,s){s=o.isUnd(s)?!0:!!s,this.defaultRequest(e,"AccountSetup",{Email:t,Password:i,New:s?"1":"0"})},t.prototype.accountDelete=function(e,t){this.defaultRequest(e,"AccountDelete",{EmailToDelete:t})},t.prototype.accountSortOrder=function(e,t){this.defaultRequest(e,"AccountSortOrder",{Accounts:t})},t.prototype.identityUpdate=function(e,t,i,s,o,n){this.defaultRequest(e,"IdentityUpdate",{Id:t,Email:i,Name:s,ReplyTo:o,Bcc:n})},t.prototype.identityDelete=function(e,t){this.defaultRequest(e,"IdentityDelete",{IdToDelete:t})},t.prototype.accountsAndIdentities=function(e){this.defaultRequest(e,"AccountsAndIdentities")},t.prototype.accountsCounts=function(e){this.defaultRequest(e,"AccountsCounts")},t.prototype.filtersSave=function(e,t,i,o){this.defaultRequest(e,"FiltersSave",{Raw:i,RawIsActive:o?"1":"0",Filters:s.map(t,function(e){return e.toJson()})})},t.prototype.filtersGet=function(e){this.defaultRequest(e,"Filters",{})},t.prototype.messageList=function(e,t,i,s,c,h){t=o.pString(t);var p=u.getFolderHash(t);return h=o.isUnd(h)?!1:!!h,i=o.isUnd(i)?0:o.pInt(i),s=o.isUnd(i)?20:o.pInt(s),c=o.pString(c),""===p||""!==c&&-1!==c.indexOf("is:")?this.defaultRequest(e,"MessageList",{Folder:t,Offset:i,Limit:s,Search:c,UidNext:u.getFolderInboxName()===t?u.getFolderUidNext(t):"",UseThreads:a.threadsAllowed()&&l.useThreads()?"1":"0",ExpandedThreadUid:a.threadsAllowed()&&t===d.messageListThreadFolder()?d.messageListThreadUids().join(","):""},""===c?n.Defaults.DefaultAjaxTimeout:n.Defaults.SearchAjaxTimeout,"",h?[]:["MessageList"]):this.defaultRequest(e,"MessageList",{},""===c?n.Defaults.DefaultAjaxTimeout:n.Defaults.SearchAjaxTimeout,"MessageList/"+r.urlsafe_encode([t,i,s,c,a.projectHash(),p,u.getFolderInboxName()===t?u.getFolderUidNext(t):"",a.threadsAllowed()&&l.useThreads()?"1":"0",a.threadsAllowed()&&t===d.messageListThreadFolder()?d.messageListThreadUids().join(","):""].join(String.fromCharCode(0))),h?[]:["MessageList"])},t.prototype.messageUploadAttachments=function(e,t){this.defaultRequest(e,"MessageUploadAttachments",{Attachments:t},999e3)},t.prototype.message=function(e,t,i){return t=o.pString(t),i=o.pInt(i),u.getFolderFromCacheList(t)&&i>0?(this.defaultRequest(e,"Message",{},null,"Message/"+r.urlsafe_encode([t,i,a.projectHash(),a.threadsAllowed()&&l.useThreads()?"1":"0"].join(String.fromCharCode(0))),["Message"]),!0):!1},t.prototype.composeUploadExternals=function(e,t){this.defaultRequest(e,"ComposeUploadExternals",{Externals:t},999e3)},t.prototype.composeUploadDrive=function(e,t,i){this.defaultRequest(e,"ComposeUploadDrive",{AccessToken:i,Url:t},999e3)},t.prototype.folderInformation=function(e,t,n){var r=!0,a=[];o.isArray(n)&&0=e?1:e},this),this.mainMessageListSearch=r.computed({read:this.messageListSearch,write:function(e){b.setHash(h.mailBox(this.currentFolderFullNameHash(),1,d.trim(e.toString())))},owner:this}),this.messageListError=r.observable(""),this.messageListLoading=r.observable(!1),this.messageListIsNotCompleted=r.observable(!1),this.messageListCompleteLoadingThrottle=r.observable(!1).extend({throttle:200}),this.messageListCompleteLoading=r.computed(function(){var e=this.messageListLoading(),t=this.messageListIsNotCompleted();return e||t},this),this.messageListCompleteLoading.subscribe(function(e){this.messageListCompleteLoadingThrottle(e)},this),this.messageList.subscribe(o.debounce(function(e){o.each(e,function(e){e.newForAnimation()&&e.newForAnimation(!1)})},500)),this.staticMessageList=new y,this.message=r.observable(null),this.messageLoading=r.observable(!1),this.messageLoadingThrottle=r.observable(!1).extend({throttle:50}),this.message.focused=r.observable(!1),this.message.subscribe(function(e){e?c.Layout.NoPreview===m.layout()&&this.message.focused(!0):(this.message.focused(!1),this.messageFullScreenMode(!1),this.hideMessageBodies(),c.Layout.NoPreview===m.layout()&&-10&&(t=this.messagesBodiesDom(),t&&(t.find(".rl-cache-class").each(function(){var t=n(this);i>t.data("rl-cache-count")&&(t.addClass("rl-cache-purge"),e++)}),e>0&&o.delay(function(){t.find(".rl-cache-purge").remove()},300)))},t.prototype.initUidNextAndNewMessages=function(e,t,s){if(g.getFolderInboxName()===e&&d.isNormal(t)&&""!==t){if(d.isArray(s)&&03)a.displayDesktopNotification(h.notificationMailIcon(),i(22).email(),p.i18n("MESSAGE_LIST/NEW_MESSAGE_NOTIFICATION",{COUNT:r}));else for(;r>n;n++)a.displayDesktopNotification(h.notificationMailIcon(),y.emailsToLine(y.initEmailsFromJson(s[n].From),!1),s[n].Subject)}g.setFolderUidNext(e,t)}},t.prototype.hideMessageBodies=function(){var e=this.messagesBodiesDom();e&&e.find(".b-text-part").hide()},t.prototype.getNextFolderNames=function(e){e=d.isUnd(e)?!1:!!e;var t=[],i=5,s=a().unix(),n=s-300,r=[],l=g.getFolderInboxName(),c=function(t){o.each(t,function(t){t&&l!==t.fullNameRaw&&t.selectable&&t.existen&&n>t.interval&&(!e||t.subScribed())&&r.push([t.interval,t.fullNameRaw]),t&&0t[0]?1:0}),o.find(r,function(e){var o=g.getFolderFromCacheList(e[1]);return o&&(o.interval=s,t.push(e[1])),i<=t.length}),o.uniq(t)},t.prototype.removeMessagesFromList=function(e,t,i,s){i=d.isNormal(i)?i:"",s=d.isUnd(s)?!1:!!s,t=o.map(t,function(e){return d.pInt(e)});var n=this,r=0,a=this.messageList(),l=g.getFolderFromCacheList(e),c=""===i?null:g.getFolderFromCacheList(i||""),u=this.currentFolderFullNameRaw(),h=this.message(),p=u===e?o.filter(a,function(e){return e&&-10&&l.messageCountUnread(0<=l.messageCountUnread()-r?l.messageCountUnread()-r:0)),c&&(c.messageCountAll(c.messageCountAll()+t.length),r>0&&c.messageCountUnread(c.messageCountUnread()+r),c.actionBlink(!0)),0150)&&(e.addClass("rl-bq-switcher hidden-bq"),n('').insertBefore(e).click(function(){e.toggleClass("hidden-bq"),d.windowResize()}).after("
").before("
"))})},100)}},t.prototype.setMessage=function(e,t){var s=!1,o=!1,r=!1,a=null,l=null,h="",p="",f=!1,b=!1,y=this.messagesBodiesDom(),S=this.message();e&&S&&e.Result&&"Object/Message"===e.Result["@Object"]&&S.folderFullNameRaw===e.Result.Folder&&S.uid===e.Result.Uid&&(this.messageError(""),S.initUpdateByMessageJson(e.Result),g.addRequestedMessage(S.folderFullNameRaw,S.uid),t||S.initFlagsByJson(e.Result),y=y&&y[0]?y:null,y&&(h="rl-mgs-"+S.hash.replace(/[^a-zA-Z0-9]/g,""),l=y.find("#"+h),l&&l[0]?(S.body=l,S.body&&(S.body.data("rl-cache-count",++u.iMessageBodyCacheCount),S.fetchDataToDom())):(o=!!e.Result.HasExternals,r=!!e.Result.HasInternals,a=n('
').hide().addClass("rl-cache-class"),a.data("rl-cache-count",++u.iMessageBodyCacheCount),d.isNormal(e.Result.Html)&&""!==e.Result.Html?(s=!0,p=e.Result.Html.toString()):d.isNormal(e.Result.Plain)&&""!==e.Result.Plain?(s=!1,p=d.plainToHtml(e.Result.Plain.toString(),!1),(S.isPgpSigned()||S.isPgpEncrypted())&&i(20).capaOpenPGP()&&(S.plainRaw=d.pString(e.Result.Plain),b=/---BEGIN PGP MESSAGE---/.test(S.plainRaw),b||(f=/-----BEGIN PGP SIGNED MESSAGE-----/.test(S.plainRaw)&&/-----BEGIN PGP SIGNATURE-----/.test(S.plainRaw)),u.$div.empty(),f&&S.isPgpSigned()?p=u.$div.append(n('
').text(S.plainRaw)).html():b&&S.isPgpEncrypted()&&(p=u.$div.append(n('
').text(S.plainRaw)).html()),u.$div.empty(),S.isPgpSigned(f),S.isPgpEncrypted(b))):s=!1,a.html(d.findEmailAndLinks(p)).addClass("b-text-part "+(s?"html":"plain")),S.isHtml(!!s),S.hasImages(!!o),S.pgpSignedVerifyStatus(c.SignedVerifyStatus.None),S.pgpSignedVerifyUser(""),S.body=a,S.body&&y.append(S.body),S.storeDataToDom(),r&&S.showInternalImages(!0),S.hasImages()&&m.showImages()&&S.showExternalImages(!0),this.purgeMessageBodyCacheThrottle()),this.messageActiveDom(S.body),this.hideMessageBodies(),S.body.show(),a&&this.initBlockquoteSwitcher(a)),g.initMessageFlagsFromCache(S),S.unseen()&&i(6).setMessageSeen(S),d.windowResize())},t.prototype.calculateMessageListHash=function(e){return o.map(e,function(e){return""+e.hash+"_"+e.threadsLen()+"_"+e.flagHash()
}).join("|")},t.prototype.findPublicKeyByHex=function(e){return o.find(i(20).openpgpkeysPublic(),function(t){return t&&e===t.id})},t.prototype.findPublicKeysByEmail=function(e){var t=this;return o.compact(o.map(i(20).openpgpkeysPublic(),function(i){var s=null;if(i&&e===i.email)try{if(s=t.openpgp.key.readArmored(i.armor),s&&!s.err&&s.keys&&s.keys[0])return s.keys[0]}catch(o){}return null}))},t.prototype.findPrivateKeyByEmail=function(e,t){var s=this,n=null,r=o.find(i(20).openpgpkeysPrivate(),function(t){return t&&e===t.email});if(r)try{n=s.openpgp.key.readArmored(r.armor),n&&!n.err&&n.keys&&n.keys[0]?(n=n.keys[0],n.decrypt(d.pString(t))):n=null}catch(a){n=null}return n},t.prototype.findSelfPrivateKey=function(e){return this.findPrivateKeyByEmail(i(22).email(),e)},e.exports=new t}()},function(e,t,i){(function(e){!function(){"use strict";var t={};t.Values={},t.DataImages={},t.Defaults={},t.Defaults.MessagesPerPage=20,t.Defaults.ContactsPerPage=50,t.Defaults.MessagesPerPageArray=[10,20,30,50,100],t.Defaults.DefaultAjaxTimeout=3e4,t.Defaults.SearchAjaxTimeout=3e5,t.Defaults.SendMessageAjaxTimeout=3e5,t.Defaults.SaveMessageAjaxTimeout=2e5,t.Defaults.ContactsSyncAjaxTimeout=2e5,t.Values.UnuseOptionValue="__UNUSE__",t.Values.ClientSideStorageIndexName="rlcsc",t.Values.ImapDefaulPort=143,t.Values.ImapDefaulSecurePort=993,t.Values.SieveDefaulPort=4190,t.Values.SmtpDefaulPort=25,t.Values.SmtpDefaulSecurePort=465,t.Values.MessageBodyCacheLimit=15,t.Values.AjaxErrorLimit=7,t.Values.TokenErrorLimit=10,t.Values.RainLoopTrialKey="RAINLOOP-TRIAL-KEY",t.DataImages.UserDotPic="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAAAuCAYAAABXuSs3AAAHHklEQVRoQ7VZW08bVxCeXRuwIbTGXIwNtBBaqjwgVUiR8lDlbza9qe1DpVZ9aNQ/0KpPeaJK07SpcuEeCEmUAObm21bfrL9lONjexSYrWfbunj37zXdmvpkz9oIgCKTD0Wg0xPd94TDP83Q0zvWa50vzklSrdanVanqf4/D84GBGr+F+Op3S8fqoJxLOdnZgTvsO/nYhenHA+UC7CWF1uXwkb9++ldPTUwVerVbVqFQqpR8YPjQ0JCMjI5LNDijoRgP3PQVu5+5Eor2XGLg7IV4GkIdHJ/LmzRs5ODiIwNbrdR0O0GCcq4Xz4eFhmZyclP7+tDQaIik/BG5XKQn4SwG3zJTLZXn9+rUclI8UHD5YVoDDN8bSzXhONwL48fFxGR4eilzFZT1uFRIB5yT8BqCdnR3Z3d0VP9Un6XRawYJpggVrZBv38ME4XKtUKnLt2jUplUoy1PR/l3U7T6sVSAQcgMAkj8PDQ9ne3pajoyMRL7zeKsYZWHgWYDGmv78/mmdwcFA+mJlSgziHDWrERrsjEXDXegTi1tZW+DLxI2bxIrqFNYTXyDyCFweMAHCwb8e4RnTNuOsqe3t7sra21pTD0Kct666E8XlcZyzw9/RUUXK5nK5oUinUQI6TQ3cynO/v78vq6qrKXCNwlTiJJpyNGc3nZHp6uqV2dwrQWOCtZBDAV1ZWwsQk7f0wiQn5kffbAu/0/KWBYzIC1+XukfGx0RGZmppKlC2tIV0Bh4aDcZW7HhkfH8urLLZL7T2pihvlkMNnz56FiadHxicL41IsFpN41bkxsYxbRdFo9jwB8KdPn14J8KnSpBQKhQs63nPmbCVRcBUAR2Lq1VVmpksyMTFxAXjcEsQybiegESionjx5osCZOeNe1O4+EhCAX7bQSgQcxRHTMgAgcz5+/Dis/hL4uHU3/B4YGNASGHIKxuEql0k+l05AeIAF1vPnz5VxFFmdDlaJrMtZITJeSsXCOTlMunKxjLtMYOKNjQ158eJFuAuKkUOb5sEwgff19SkJUBVkThZUbnXZrtCKBQ6gbnWIkjZpyne3ejAWoGnA7Icz6irvBLgbOMicCM6TkxPx/LAkbXfgWcsazuE2kFRsKD5Z+CiqDumKncpZvieWcS6dDVD8xiYCNflpJdwcdwJOf9airLmVQ7DPzMxIYWLsXGXoVqLt5k0M3K3JUVPDZdbWNzsCp48TPFdvdnZWUz32nDha7bJ63kgAJPzSdRks9/Kf9xMJAQ1gq2NpaUmy2Yz4zar4nQC3xb99AQwCcGzLAAwuhG8YiWvcOKts+r4GOe5nMhm5efOm9lUA3E3vSZJRrKvE0fnPv//Jy5cvo5cTHIPQbSjhOoqq69evS19f6lxDKK4+sVhigZPtKJqbrQeqxd5+WR4+fKgqgT0k2XX3nhiPgETWXFhYkFzuPZ2yVq1GTSOXpE47/VjgNnD4m4GG7/LhsTx69EiwD4Vr2MwIIxgbAH18fKx1yfz8vEogNvGtWnCuhLZa9UTAreVWFsHy/b/+Vrbdl7E5REMQD2jDoUbByty+/ZnU64GkU2HzyJLhktU1cLv8nARgkYS2d3ajAgwG8qU2oLmDZ92CMaOjo7K4uCiZgbDWaRWgnZhPxLhrMUCvr69riwKZk1LHF7XqrWAO9hJxH6ozNzcnCx/PqztZg9mf6SQMscCtm2C5ke4BGMlHWTUp36036AJajDVrFMzBrhhWslQsSrFYiOqVpMriNYIgqFRq2j3FAb/zffT6zuxFXxsNzs3NTXn16lW4gYiW96w1FyedF+83xG/2FNGCRpU4NjamMsn+OZ9xE5RXqdaDdPpib6RWCzuwKF9RxqI2AVNQBwQYJoK0wdBejnqtEikP3pfP51XjUTESl12FqJEKxsEorARYDD44ONTeID7YpsEnrRvQfWAI2e8WfDaTUSIwJ0iBCmFOtOUAHvVMPp/TPwvYFVYFIuP8l+DBgwdaa2Miqwa0GgYwfeMltovbDfh6c1vIgMYcliSsKv4IWFr6VDHxvldvBAH+1sA+cnl5WYOPmmr9ir+1l9I0Cgz0yjhXjfJJ0JROnmezWbl165ayr/5fqwcBNr7IfhjMqKcvESSM4eRcCasQ3bDNObmKPLdGUGpZsN24cUNLBm9zazu4d++e6qpNBFaTuUS26U5dpuR1CxyA7J9ddrMRqlz4pwLLYawymPd++/2PADt2ugcGwq9gCCdhQ96C6xWwa6j1ceuq+I0EhW0i8MAIVJfeL3d/DVD8EKi12P6/2S2jV/EccVB54O/ejz/9HGCpoBBMta5rXMXLu53D1XAwjhXwvvv+h4BAXVe4bOu3O3ChxF08LiZFG3fel199G9CH3fLyqv24NcB44MRhpdK788U3CpyKwsCw590xmfSpzsBt0Fqc3ud3vtZigxWcVZCklVpSiN0w3q5E/h9TGMIUuA3+EQAAAABJRU5ErkJggg==",t.DataImages.TranspPic="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII=",e.exports=t}(e)}).call(t,i(70)(e))},,,function(e,t,i){!function(){"use strict";function t(){this.oFoldersCache={},this.oFoldersNamesCache={},this.oFolderHashCache={},this.oFolderUidNextCache={},this.oMessageListHashCache={},this.oMessageFlagsCache={},this.oNewMessage={},this.oRequestedMessage={},this.bCapaGravatar=a.capa(o.Capa.Gravatar)}var s=i(2),o=i(4),n=i(1),r=i(12),a=i(9);t.prototype.bCapaGravatar=!1,t.prototype.oFoldersCache={},t.prototype.oFoldersNamesCache={},t.prototype.oFolderHashCache={},t.prototype.oFolderUidNextCache={},t.prototype.oMessageListHashCache={},t.prototype.oMessageFlagsCache={},t.prototype.oBodies={},t.prototype.oNewMessage={},t.prototype.oRequestedMessage={},t.prototype.clear=function(){this.oFoldersCache={},this.oFoldersNamesCache={},this.oFolderHashCache={},this.oFolderUidNextCache={},this.oMessageListHashCache={},this.oMessageFlagsCache={},this.oBodies={}},t.prototype.getUserPic=function(e,t){e=n.trim(e),t(this.bCapaGravatar&&""!==e?r.avatarLink(e):"",e)},t.prototype.getMessageKey=function(e,t){return e+"#"+t},t.prototype.addRequestedMessage=function(e,t){this.oRequestedMessage[this.getMessageKey(e,t)]=!0},t.prototype.hasRequestedMessage=function(e,t){return!0===this.oRequestedMessage[this.getMessageKey(e,t)]},t.prototype.addNewMessageCache=function(e,t){this.oNewMessage[this.getMessageKey(e,t)]=!0},t.prototype.hasNewMessageAndRemoveFromCache=function(e,t){return this.oNewMessage[this.getMessageKey(e,t)]?(this.oNewMessage[this.getMessageKey(e,t)]=null,!0):!1},t.prototype.clearNewMessageCache=function(){this.oNewMessage={}},t.prototype.sInboxFolderName="",t.prototype.getFolderInboxName=function(){return""===this.sInboxFolderName?"INBOX":this.sInboxFolderName},t.prototype.getFolderFullNameRaw=function(e){return""!==e&&this.oFoldersNamesCache[e]?this.oFoldersNamesCache[e]:""},t.prototype.setFolderFullNameRaw=function(e,t){this.oFoldersNamesCache[e]=t,("INBOX"===t||""===this.sInboxFolderName)&&(this.sInboxFolderName=t)},t.prototype.getFolderHash=function(e){return""!==e&&this.oFolderHashCache[e]?this.oFolderHashCache[e]:""},t.prototype.setFolderHash=function(e,t){this.oFolderHashCache[e]=t},t.prototype.getFolderUidNext=function(e){return""!==e&&this.oFolderUidNextCache[e]?this.oFolderUidNextCache[e]:""},t.prototype.setFolderUidNext=function(e,t){this.oFolderUidNextCache[e]=t},t.prototype.getFolderFromCacheList=function(e){return""!==e&&this.oFoldersCache[e]?this.oFoldersCache[e]:null},t.prototype.setFolderToCacheList=function(e,t){this.oFoldersCache[e]=t},t.prototype.removeFolderFromCacheList=function(e){this.setFolderToCacheList(e,null)},t.prototype.getMessageFlagsFromCache=function(e,t){return this.oMessageFlagsCache[e]&&this.oMessageFlagsCache[e][t]?this.oMessageFlagsCache[e][t]:null},t.prototype.setMessageFlagsToCache=function(e,t,i){this.oMessageFlagsCache[e]||(this.oMessageFlagsCache[e]={}),this.oMessageFlagsCache[e][t]=i},t.prototype.clearMessageFlagsFromCacheByFolder=function(e){this.oMessageFlagsCache[e]={}},t.prototype.initMessageFlagsFromCache=function(e){if(e){var t=this,i=this.getMessageFlagsFromCache(e.folderFullNameRaw,e.uid),o=null,r=null;i&&0,]+)>?,? ?/g,i=t.exec(e);i?(this.name=i[1]||"",this.email=i[2]||"",this.clearDuplicateName()):/^[^@]+@[^@]+$/.test(e)&&(this.name="",this.email=e)},t.prototype.initByJson=function(e){var t=!1;return e&&"Object/Email"===e["@Object"]&&(this.name=s.trim(e.Name),this.email=s.trim(e.Email),this.dkimStatus=s.trim(e.DkimStatus||""),this.dkimValue=s.trim(e.DkimValue||""),t=""!==this.email,this.clearDuplicateName()),t},t.prototype.toLine=function(e,t,i){var o="";return""!==this.email&&(t=s.isUnd(t)?!1:!!t,i=s.isUnd(i)?!1:!!i,e&&""!==this.name?o=t?'
")+'" target="_blank" tabindex="-1">'+s.encodeHtml(this.name)+"":i?s.encodeHtml(this.name):this.name:(o=this.email,""!==this.name?t?o=s.encodeHtml('"'+this.name+'" <')+'")+'" target="_blank" tabindex="-1">'+s.encodeHtml(o)+""+s.encodeHtml(">"):(o='"'+this.name+'" <'+o+">",i&&(o=s.encodeHtml(o))):t&&(o=''+s.encodeHtml(this.email)+""))),o},t.prototype.mailsoParse=function(e){if(e=s.trim(e),""===e)return!1;for(var t=function(e,t,i){e+="";var s=e.length;return 0>t&&(t+=s),s="undefined"==typeof i?s:0>i?i+s:i+t,t>=e.length||0>t||t>s?!1:e.slice(t,s)},i=function(e,t,i,s){return 0>i&&(i+=e.length),s=void 0!==s?s:e.length,0>s&&(s=s+e.length-i),e.slice(0,i)+t.substr(0,s)+t.slice(s)+e.slice(i+s)},o="",n="",r="",a=!1,l=!1,c=!1,u=null,d=0,h=0,p=0;p0&&0===o.length&&(o=t(e,0,p)),l=!0,d=p);break;case">":l&&(h=p,n=t(e,d+1,h-d-1),e=i(e,"",d,h-d+1),h=0,p=0,d=0,l=!1);break;case"(":a||l||c||(c=!0,d=p);break;case")":c&&(h=p,r=t(e,d+1,h-d-1),e=i(e,"",d,h-d+1),h=0,p=0,d=0,c=!1);break;case"\\":p++}p++}return 0===n.length&&(u=e.match(/[^@\s]+@\S+/i),u&&u[0]?n=u[0]:o=e),n.length>0&&0===o.length&&0===r.length&&(o=e.replace(n,"")),n=s.trim(n).replace(/^[<]+/,"").replace(/[>]+$/,""),o=s.trim(o).replace(/^["']+/,"").replace(/["']+$/,""),r=s.trim(r).replace(/^[(]+/,"").replace(/[)]+$/,""),o=o.replace(/\\\\(.)/g,"$1"),r=r.replace(/\\\\(.)/g,"$1"),this.name=o,this.email=n,this.clearDuplicateName(),!0},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){this.layout=s.observable(n.Layout.SidePreview).extend({limitedList:[n.Layout.SidePreview,n.Layout.BottomPreview,n.Layout.NoPreview]}),this.editorDefaultType=s.observable(n.EditorDefaultType.Html).extend({limitedList:[n.EditorDefaultType.Html,n.EditorDefaultType.Plain,n.EditorDefaultType.HtmlForced,n.EditorDefaultType.PlainForced]}),this.messagesPerPage=s.observable(o.Defaults.MessagesPerPage).extend({limitedList:o.Defaults.MessagesPerPageArray}),this.showImages=s.observable(!1),this.useCheckboxesInList=s.observable(!0),this.useThreads=s.observable(!1),this.replySameFolder=s.observable(!1),this.computedProperies(),this.subscribes()}var s=i(3),o=i(16),n=i(4),r=i(8),a=i(1),l=i(28),c=i(9);t.prototype.computedProperies=function(){this.usePreviewPane=s.computed(function(){return n.Layout.NoPreview!==this.layout()},this)},t.prototype.subscribes=function(){this.layout.subscribe(function(e){r.$html.toggleClass("rl-no-preview-pane",n.Layout.NoPreview===e),r.$html.toggleClass("rl-side-preview-pane",n.Layout.SidePreview===e),r.$html.toggleClass("rl-bottom-preview-pane",n.Layout.BottomPreview===e),l.pub("layout",[e])})},t.prototype.populate=function(){this.layout(a.pInt(c.settingsGet("Layout"))),this.editorDefaultType(c.settingsGet("EditorDefaultType")),this.messagesPerPage(c.settingsGet("MPP")),this.showImages(!!c.settingsGet("ShowImages")),this.useCheckboxesInList(!!c.settingsGet("UseCheckboxesInList")),this.useThreads(!!c.settingsGet("UseThreads")),this.replySameFolder(!!c.settingsGet("ReplySameFolder"))},e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(){L.call(this,"Popups","PopupsCompose");var e=this;this.oEditor=null,this.aDraftInfo=null,this.sInReplyTo="",this.bFromDraft=!1,this.sReferences="",this.triggerForResize=o.bind(this.triggerForResize,this),this.bCapaAdditionalIdentities=A.capa(u.Capa.AdditionalIdentities),this.allowContacts=!!y.contactsIsAllowed(),this.bSkipNextHide=!1,this.composeInEdit=E.composeInEdit,this.editorDefaultType=S.editorDefaultType,this.capaOpenPGP=T.capaOpenPGP,this.resizer=r.observable(!1).extend({throttle:50}),this.identitiesDropdownTrigger=r.observable(!1),this.to=r.observable(""),this.to.focusTrigger=r.observable(!1),this.cc=r.observable(""),this.bcc=r.observable(""),this.replyTo=r.observable(""),this.subject=r.observable(""),this.isHtml=r.observable(!1),this.requestReadReceipt=r.observable(!1),this.markAsImportant=r.observable(!1),this.sendError=r.observable(!1),this.sendSuccessButSaveError=r.observable(!1),this.savedError=r.observable(!1),this.savedTime=r.observable(0),this.savedOrSendingText=r.observable(""),this.emptyToError=r.observable(!1),this.attachmentsInProcessError=r.observable(!1),this.attachmentsInErrorError=r.observable(!1),this.showCc=r.observable(!1),this.showBcc=r.observable(!1),this.cc.subscribe(function(t){!1===e.showCc()&&0"},t.prototype.sendMessageResponse=function(e,t){var i=!1,o="";this.sending(!1),u.StorageResultType.Success===e&&t&&t.Result&&(i=!0,this.modalVisibility()&&h.delegateRun(this,"closeCommand")),this.modalVisibility()&&!i&&(t&&u.Notification.CantSaveMessage===t.ErrorCode?(this.sendSuccessButSaveError(!0),s.alert(h.trim(b.i18n("COMPOSE/SAVED_ERROR_ON_SEND")))):(o=b.getNotification(t&&t.ErrorCode?t.ErrorCode:u.Notification.CantSendMessage,t&&t.ErrorMessage?t.ErrorMessage:""),this.sendError(!0),s.alert(o||b.getNotification(u.Notification.CantSendMessage)))),this.reloadDraftFolder()},t.prototype.saveMessageResponse=function(e,t){var i=!1,o=null;this.saving(!1),u.StorageResultType.Success===e&&t&&t.Result&&t.Result.NewFolder&&t.Result.NewUid&&(i=!0,this.bFromDraft&&(o=E.message(),o&&this.draftFolder()===o.folderFullNameRaw&&this.draftUid()===o.uid&&E.message(null)),this.draftFolder(t.Result.NewFolder),this.draftUid(t.Result.NewUid),this.savedTime(s.Math.round((new s.Date).getTime()/1e3)),this.savedOrSendingText(0"+t;break;default:e=t+"
"+e}return e},t.prototype.editor=function(e){if(e){var t=this;!this.oEditor&&this.composeEditorArea()?o.delay(function(){t.oEditor=new g(t.composeEditorArea(),null,function(){e(t.oEditor)},function(e){t.isHtml(!!e)})},300):this.oEditor&&e(this.oEditor)}},t.prototype.onShow=function(e,t,s,o,n,r,a){if(P.routeOff(),this.autosaveStart(),this.composeInEdit()){e=e||u.ComposeType.Empty;var l=this;u.ComposeType.Empty!==e?P.showScreenPopup(i(40),[b.i18n("COMPOSE/DISCARD_UNSAVED_DATA"),function(){l.initOnShow(e,t,s,o,n,r,a)},null,null,null,!1]):(this.addEmailsTo(this.to,s),this.addEmailsTo(this.cc,o),this.addEmailsTo(this.bcc,n),h.isNormal(r)&&""!==r&&""===this.subject()&&this.subject(r))}else this.initOnShow(e,t,s,o,n,r,a)},t.prototype.addEmailsTo=function(e,t){var i=h.trim(e()),s=[];h.isNonEmptyArray(t)&&(s=o.uniq(o.compact(o.map(t,function(e){return e?e.toLine(!1):null}))),e(i+(""===i?"":", ")+h.trim(s.join(", "))))},t.prototype.initOnShow=function(e,t,i,s,r,a,l){this.composeInEdit(!0);var c=this,d="",p="",m="",f="",g="",y=null,S="",v="",C=[],T={},F=null,A=w.email(),E=w.signature(),N=[],I=null,P=null,L=e||u.ComposeType.Empty,M=function(e,t){for(var i=0,s=e.length,o=[];s>i;i++)o.push(e[i].toLine(!!t));return o.join(", ")};if(t=t||null,t&&h.isNormal(t)&&(P=h.isArray(t)&&1===t.length?t[0]:h.isArray(t)?null:t),null!==A&&(T[A]=!0),F=this.findIdentityIdByMessage(L,P),F&&F[0]&&(T[F[1]]=!0,this.currentIdentityID(F[0])),this.reset(),h.isNonEmptyArray(i)&&this.to(M(i)),h.isNonEmptyArray(s)&&this.cc(M(s)),h.isNonEmptyArray(r)&&this.bcc(M(r)),""!==L&&P){switch(f=P.fullFormatDateValue(),g=P.subject(),I=P.aDraftInfo,y=n(P.body).clone(),y&&(y.find("blockquote.rl-bq-switcher").each(function(){n(this).removeClass("rl-bq-switcher hidden-bq")}),y.find(".rlBlockquoteSwitcher").each(function(){n(this).remove()})),y.find("[data-html-editor-font-wrapper]").removeAttr("data-html-editor-font-wrapper"),S=y.html(),L){case u.ComposeType.Empty:break;case u.ComposeType.Reply:this.to(M(P.replyEmails(T))),this.subject(h.replySubjectAdd("Re",g)),this.prepearMessageAttachments(P,L),this.aDraftInfo=["reply",P.uid,P.folderFullNameRaw],this.sInReplyTo=P.sMessageId,this.sReferences=h.trim(this.sInReplyTo+" "+P.sReferences);break;case u.ComposeType.ReplyAll:C=P.replyAllEmails(T),this.to(M(C[0])),this.cc(M(C[1])),this.subject(h.replySubjectAdd("Re",g)),this.prepearMessageAttachments(P,L),this.aDraftInfo=["reply",P.uid,P.folderFullNameRaw],this.sInReplyTo=P.sMessageId,this.sReferences=h.trim(this.sInReplyTo+" "+P.references());break;case u.ComposeType.Forward:this.subject(h.replySubjectAdd("Fwd",g)),this.prepearMessageAttachments(P,L),this.aDraftInfo=["forward",P.uid,P.folderFullNameRaw],this.sInReplyTo=P.sMessageId,this.sReferences=h.trim(this.sInReplyTo+" "+P.sReferences);break;case u.ComposeType.ForwardAsAttachment:this.subject(h.replySubjectAdd("Fwd",g)),this.prepearMessageAttachments(P,L),this.aDraftInfo=["forward",P.uid,P.folderFullNameRaw],this.sInReplyTo=P.sMessageId,this.sReferences=h.trim(this.sInReplyTo+" "+P.sReferences);break;case u.ComposeType.Draft:this.to(M(P.to)),this.cc(M(P.cc)),this.bcc(M(P.bcc)),this.bFromDraft=!0,this.draftFolder(P.folderFullNameRaw),this.draftUid(P.uid),this.subject(g),this.prepearMessageAttachments(P,L),this.aDraftInfo=h.isNonEmptyArray(I)&&3===I.length?I:null,this.sInReplyTo=P.sInReplyTo,this.sReferences=P.sReferences;break;case u.ComposeType.EditAsNew:this.to(M(P.to)),this.cc(M(P.cc)),this.bcc(M(P.bcc)),this.subject(g),this.prepearMessageAttachments(P,L),this.aDraftInfo=h.isNonEmptyArray(I)&&3===I.length?I:null,this.sInReplyTo=P.sInReplyTo,this.sReferences=P.sReferences}switch(L){case u.ComposeType.Reply:case u.ComposeType.ReplyAll:d=P.fromToLine(!1,!0),v=b.i18n("COMPOSE/REPLY_MESSAGE_TITLE",{DATETIME:f,EMAIL:d}),S="

"+v+":

"+S+"

"; break;case u.ComposeType.Forward:d=P.fromToLine(!1,!0),p=P.toToLine(!1,!0),m=P.ccToLine(!1,!0),S="


"+b.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TITLE")+"
"+b.i18n("COMPOSE/FORWARD_MESSAGE_TOP_FROM")+": "+d+"
"+b.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TO")+": "+p+(0"+b.i18n("COMPOSE/FORWARD_MESSAGE_TOP_CC")+": "+m:"")+"
"+b.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SENT")+": "+h.encodeHtml(f)+"
"+b.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SUBJECT")+": "+h.encodeHtml(g)+"

"+S;break;case u.ComposeType.ForwardAsAttachment:S=""}""!==E&&u.ComposeType.EditAsNew!==L&&u.ComposeType.Draft!==L&&(S=this.convertSignature(S,E,M(P.from,!0),L)),this.editor(function(e){e.setHtml(S,!1),(u.EditorDefaultType.PlainForced===c.editorDefaultType()||!P.isHtml()&&u.EditorDefaultType.HtmlForced!==c.editorDefaultType())&&e.modeToggle(!1)})}else u.ComposeType.Empty===L?(this.subject(h.isNormal(a)?""+a:""),S=h.isNormal(l)?""+l:"",""!==E&&(S=this.convertSignature(h.plainToHtml(S,!0),E,"",L)),this.editor(function(e){e.setHtml(S,!1),u.EditorDefaultType.Html!==c.editorDefaultType()&&u.EditorDefaultType.HtmlForced!==c.editorDefaultType()&&e.modeToggle(!1)})):h.isNonEmptyArray(t)&&o.each(t,function(e){c.addMessageAsAttachment(e)});N=this.getAttachmentsDownloadsForUpload(),h.isNonEmptyArray(N)&&R.messageUploadAttachments(function(e,t){if(u.StorageResultType.Success===e&&t&&t.Result){var i=null,s="";if(!c.viewModelVisibility())for(s in t.Result)t.Result.hasOwnProperty(s)&&(i=c.getAttachmentById(t.Result[s]),i&&(i.tempName(s),i.waiting(!1).uploading(!1).complete(!0)))}else c.setMessageAttachmentFailedDownloadText()},N),this.triggerForResize()},t.prototype.onFocus=function(){""===this.to()?this.to.focusTrigger(!this.to.focusTrigger()):this.oEditor&&this.oEditor.focus(),this.triggerForResize()},t.prototype.editorResize=function(){this.oEditor&&this.oEditor.resize()},t.prototype.tryToClosePopup=function(){var e=this,t=i(40);!P.isPopupVisible(t)&&this.modalVisibility()&&(this.bSkipNextHide||this.isEmptyForm()&&!this.draftUid()?h.delegateRun(e,"closeCommand"):P.showScreenPopup(t,[b.i18n("POPUPS_ASK/DESC_WANT_CLOSE_THIS_WINDOW"),function(){e.modalVisibility()&&h.delegateRun(e,"closeCommand")}]))},t.prototype.onBuild=function(){this.initUploader();var e=this,t=null;key("ctrl+q, command+q",u.KeyState.Compose,function(){return e.identitiesDropdownTrigger(!0),!1}),key("ctrl+s, command+s",u.KeyState.Compose,function(){return e.saveCommand(),!1}),A.settingsGet("AllowСtrlEnterOnCompose")&&key("ctrl+enter, command+enter",u.KeyState.Compose,function(){return e.sendCommand(),!1}),key("esc",u.KeyState.Compose,function(){return e.modalVisibility()&&e.tryToClosePopup(),!1}),p.$win.on("resize",e.triggerForResize),this.dropboxEnabled()&&(t=s.document.createElement("script"),t.type="text/javascript",t.src="https://www.dropbox.com/static/api/1/dropins.js",n(t).attr("id","dropboxjs").attr("data-app-key",e.dropboxApiKey()),s.document.body.appendChild(t)),this.driveEnabled()&&n.getScript("https://apis.google.com/js/api.js",function(){s.gapi&&e.driveVisible(!0)})},t.prototype.driveCallback=function(e,t){if(t&&s.XMLHttpRequest&&s.google&&t[s.google.picker.Response.ACTION]===s.google.picker.Action.PICKED&&t[s.google.picker.Response.DOCUMENTS]&&t[s.google.picker.Response.DOCUMENTS][0]&&t[s.google.picker.Response.DOCUMENTS][0].id){var i=this,o=new s.XMLHttpRequest;o.open("GET","https://www.googleapis.com/drive/v2/files/"+t[s.google.picker.Response.DOCUMENTS][0].id),o.setRequestHeader("Authorization","Bearer "+e),o.addEventListener("load",function(){if(o&&o.responseText){var t=l.parse(o.responseText),s=function(e,t,i){e&&e.exportLinks&&(e.exportLinks[t]?(e.downloadUrl=e.exportLinks[t],e.title=e.title+"."+i,e.mimeType=t):e.exportLinks["application/pdf"]&&(e.downloadUrl=e.exportLinks["application/pdf"],e.title=e.title+".pdf",e.mimeType="application/pdf"))};if(t&&!t.downloadUrl&&t.mimeType&&t.exportLinks)switch(t.mimeType.toString().toLowerCase()){case"application/vnd.google-apps.document":s(t,"application/vnd.openxmlformats-officedocument.wordprocessingml.document","docx");break;case"application/vnd.google-apps.spreadsheet":s(t,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","xlsx");break;case"application/vnd.google-apps.drawing":s(t,"image/png","png");break;case"application/vnd.google-apps.presentation":s(t,"application/vnd.openxmlformats-officedocument.presentationml.presentation","pptx");break;default:s(t,"application/pdf","pdf")}t&&t.downloadUrl&&i.addDriveAttachment(t,e)}}),o.send()}},t.prototype.driveCreatePiker=function(e){if(s.gapi&&e&&e.access_token){var t=this;s.gapi.load("picker",{callback:function(){if(s.google&&s.google.picker){var i=(new s.google.picker.PickerBuilder).addView(s.google.picker.ViewId.DOCS).setAppId(A.settingsGet("GoogleClientID")).setOAuthToken(e.access_token).setCallback(o.bind(t.driveCallback,t,e.access_token)).enableFeature(s.google.picker.Feature.NAV_HIDDEN).build();i.setVisible(!0)}}})}},t.prototype.driveOpenPopup=function(){if(s.gapi){var e=this;s.gapi.load("auth",{callback:function(){var t=s.gapi.auth.getToken(),i=function(t){if(t&&!t.error){var i=s.gapi.auth.getToken();return i&&e.driveCreatePiker(i),!0}return!1};t?e.driveCreatePiker(t):s.gapi.auth.authorize({client_id:A.settingsGet("GoogleClientID"),scope:"https://www.googleapis.com/auth/drive.readonly",immediate:!0},function(e){i(e)||s.gapi.auth.authorize({client_id:A.settingsGet("GoogleClientID"),scope:"https://www.googleapis.com/auth/drive.readonly",immediate:!1},i)})}})}},t.prototype.getAttachmentById=function(e){for(var t=this.attachments(),i=0,s=t.length;s>i;i++)if(t[i]&&e===t[i].id)return t[i];return null},t.prototype.cancelAttachmentHelper=function(e,t){var i=this;return function(){var s=o.find(i.attachments(),function(t){return t&&t.id===e});s&&(i.attachments.remove(s),h.delegateRunOnDestroy(s),t&&t.cancel(e))}},t.prototype.initUploader=function(){if(this.composeUploaderButton()){var e={},t=h.pInt(A.settingsGet("AttachmentLimit")),i=new c({action:f.upload(),name:"uploader",queueSize:2,multipleSizeLimit:50,disableFolderDragAndDrop:!1,clickElement:this.composeUploaderButton(),dragAndDropElement:this.composeUploaderDropPlace()});i?(i.on("onDragEnter",o.bind(function(){this.dragAndDropOver(!0)},this)).on("onDragLeave",o.bind(function(){this.dragAndDropOver(!1)},this)).on("onBodyDragEnter",o.bind(function(){this.dragAndDropVisible(!0)},this)).on("onBodyDragLeave",o.bind(function(){this.dragAndDropVisible(!1)},this)).on("onProgress",o.bind(function(t,i,o){var n=null;h.isUnd(e[t])?(n=this.getAttachmentById(t),n&&(e[t]=n)):n=e[t],n&&n.progress(s.Math.floor(i/o*100))},this)).on("onSelect",o.bind(function(e,s){this.dragAndDropOver(!1);var o=this,n=h.isUnd(s.FileName)?"":s.FileName.toString(),r=h.isNormal(s.Size)?h.pInt(s.Size):null,a=new I(e,n,r);return a.cancel=o.cancelAttachmentHelper(e,i),this.attachments.push(a),this.attachmentsPlace(!0),r>0&&t>0&&r>t?(a.waiting(!1).uploading(!0).complete(!0).error(b.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):!0},this)).on("onStart",o.bind(function(t){var i=null;h.isUnd(e[t])?(i=this.getAttachmentById(t),i&&(e[t]=i)):i=e[t],i&&i.waiting(!1).uploading(!0).complete(!1)},this)).on("onComplete",o.bind(function(t,i,s){var o="",n=null,r=null,a=this.getAttachmentById(t);r=i&&s&&s.Result&&s.Result.Attachment?s.Result.Attachment:null,n=s&&s.Result&&s.Result.ErrorCode?s.Result.ErrorCode:null,null!==n?o=b.getUploadErrorDescByCode(n):r||(o=b.i18n("UPLOAD/ERROR_UNKNOWN")),a&&(""!==o&&00&&i>0&&s>i?(t.uploading(!1).complete(!0),t.error(b.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(R.composeUploadExternals(function(e,i){var s=!1;t.uploading(!1).complete(!0),u.StorageResultType.Success===e&&i&&i.Result&&i.Result[t.id]&&(s=!0,t.tempName(i.Result[t.id])),s||t.error(b.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},[e.link]),!0)},t.prototype.addDriveAttachment=function(e,t){var i=h.pInt(A.settingsGet("AttachmentLimit")),s=null,o=e.fileSize?h.pInt(e.fileSize):0;return s=new I(e.downloadUrl,e.title,o),s.fromMessage=!1,s.cancel=this.cancelAttachmentHelper(e.downloadUrl),s.waiting(!1).uploading(!0).complete(!1),this.attachments.push(s),this.attachmentsPlace(!0),o>0&&i>0&&o>i?(s.uploading(!1).complete(!0),s.error(b.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(R.composeUploadDrive(function(e,t){var i=!1;s.uploading(!1).complete(!0),u.StorageResultType.Success===e&&t&&t.Result&&t.Result[s.id]&&(i=!0,s.tempName(t.Result[s.id][0]),s.size(h.pInt(t.Result[s.id][1]))),i||s.error(b.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},e.downloadUrl,t),!0)},t.prototype.prepearMessageAttachments=function(e,t){if(e){var i=h.isNonEmptyArray(e.attachments())?e.attachments():[],s=0,o=i.length,n=null,r=null,a=!1;if(u.ComposeType.ForwardAsAttachment===t)this.addMessageAsAttachment(e);else for(;o>s;s++){switch(r=i[s],a=!1,t){case u.ComposeType.Reply:case u.ComposeType.ReplyAll:a=r.isLinked;break;case u.ComposeType.Forward:case u.ComposeType.Draft:case u.ComposeType.EditAsNew:a=!0}a&&(n=new I(r.download,r.fileName,r.estimatedSize,r.isInline,r.isLinked,r.cid,r.contentLocation),n.fromMessage=!0,n.cancel=this.cancelAttachmentHelper(r.download),n.waiting(!1).uploading(!0).complete(!1),this.attachments.push(n))}}},t.prototype.removeLinkedAttachments=function(){var e=o.find(this.attachments(),function(e){return e&&e.isLinked});e&&(this.attachments.remove(e),h.delegateRunOnDestroy(e))},t.prototype.setMessageAttachmentFailedDownloadText=function(){o.each(this.attachments(),function(e){e&&e.fromMessage&&e.waiting(!1).uploading(!1).complete(!0).error(b.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},this)},t.prototype.isEmptyForm=function(e){e=h.isUnd(e)?!0:!!e;var t=e?0===this.attachments().length:0===this.attachmentsInReady().length;return 0===this.to().length&&0===this.cc().length&&0===this.bcc().length&&0===this.subject().length&&t&&(!this.oEditor||""===this.oEditor.getData())},t.prototype.reset=function(){this.to(""),this.cc(""),this.bcc(""),this.replyTo(""),this.subject(""),this.requestReadReceipt(!1),this.markAsImportant(!1),this.attachmentsPlace(!1),this.aDraftInfo=null,this.sInReplyTo="",this.bFromDraft=!1,this.sReferences="",this.sendError(!1),this.sendSuccessButSaveError(!1),this.savedError(!1),this.savedTime(0),this.savedOrSendingText(""),this.emptyToError(!1),this.attachmentsInProcessError(!1),this.showCc(!1),this.showBcc(!1),h.delegateRunOnDestroy(this.attachments()),this.attachments([]),this.dragAndDropOver(!1),this.dragAndDropVisible(!1),this.draftFolder(""),this.draftUid(""),this.sending(!1),this.saving(!1),this.oEditor&&this.oEditor.clear(!1)},t.prototype.getAttachmentsDownloadsForUpload=function(){return o.map(o.filter(this.attachments(),function(e){return e&&""===e.tempName()}),function(e){return e.id})},t.prototype.triggerForResize=function(){this.resizer(!this.resizer()),this.editorResizeThrottle()},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){this.oSubs={}}var s=i(2),o=i(1),n=i(23);t.prototype.oSubs={},t.prototype.sub=function(e,t,i){return o.isUnd(this.oSubs[e])&&(this.oSubs[e]=[]),this.oSubs[e].push([t,i]),this},t.prototype.pub=function(e,t){return n.runHook("rl-pub",[e,t]),o.isUnd(this.oSubs[e])||s.each(this.oSubs[e],function(e){e[0]&&e[0].apply(e[1]||null,t||[])}),this},e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(){this.disposable=[]}var s=i(2),o=i(3),n=i(1);t.prototype.disposable=[],t.prototype.dispose=function(){s.each(this.disposable,function(e){e&&e.dispose&&e.dispose()})},t.componentExportHelper=function(e,t){return{viewModel:{createViewModel:function(t,s){return t=t||{},t.element=null,s.element&&(t.element=$(s.element),i(7).i18nToNode(t.element),!n.isUnd(t.inline)&&o.unwrap(t.inline)&&t.element.css("display","inline-block")),new e(t)}},template:{element:t}}},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){n.call(this),this.projectHash=s.observable(""),this.threadsAllowed=s.observable(!1),this.contactsAutosave=s.observable(!1),this.useLocalProxyForExternalImages=s.observable(!1),this.contactsIsAllowed=s.observable(!1),this.devEmail="",this.devPassword=""}var s=i(3),o=i(9),n=i(65);t.prototype.populate=function(){n.prototype.populate.call(this),this.projectHash(o.settingsGet("ProjectHash")),this.useLocalProxyForExternalImages(!!o.settingsGet("UseLocalProxyForExternalImages")),this.contactsIsAllowed(!!o.settingsGet("ContactsIsAllowed")),this.devEmail=o.settingsGet("DevEmail"),this.devPassword=o.settingsGet("DevPassword")},e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(){this.languages=s.observableArray([]),this.language=s.observable("").extend({limitedList:this.languages})}var s=i(3),o=i(1),n=i(9);t.prototype.populate=function(){var e=n.settingsGet("Languages");this.languages(o.isArray(e)?e:[]),this.language(n.settingsGet("Language"))},e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(){this.sentFolder=s.observable(""),this.draftFolder=s.observable(""),this.spamFolder=s.observable(""),this.trashFolder=s.observable(""),this.archiveFolder=s.observable(""),this.computed(),this.subscribe()}var s=i(3),o=i(4),n=i(16),r=i(19);t.prototype.computed=function(){this.draftFolderNotEnabled=s.computed(function(){return""===this.draftFolder()||n.Values.UnuseOptionValue===this.draftFolder()},this)},t.prototype.subscribe=function(){var e=function(e){return function(){var t=r.getFolderFromCacheList(e());t&&t.type(o.FolderType.User)}},t=function(e){return function(t){var i=r.getFolderFromCacheList(t);i&&i.type(e)}};this.sentFolder.subscribe(e(this.sentFolder),this,"beforeChange"),this.draftFolder.subscribe(e(this.draftFolder),this,"beforeChange"),this.spamFolder.subscribe(e(this.spamFolder),this,"beforeChange"),this.trashFolder.subscribe(e(this.trashFolder),this,"beforeChange"),this.archiveFolder.subscribe(e(this.archiveFolder),this,"beforeChange"),this.sentFolder.subscribe(t(o.FolderType.SentItems),this),this.draftFolder.subscribe(t(o.FolderType.Draft),this),this.spamFolder.subscribe(t(o.FolderType.Spam),this),this.trashFolder.subscribe(t(o.FolderType.Trash),this),this.archiveFolder.subscribe(t(o.FolderType.Archive),this)},e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(e){a.call(this),this.value=e.value||"",this.size=e.size||0,this.label=e.label||"",this.preLabel=e.preLabel||"",this.enable=r.isUnd(e.enable)?!0:e.enable,this.trigger=e.trigger&&e.trigger.subscribe?e.trigger:null,this.placeholder=e.placeholder||"",this.labeled=!r.isUnd(e.label),this.preLabeled=!r.isUnd(e.preLabel),this.triggered=!r.isUnd(e.trigger)&&!!this.trigger,this.classForTrigger=o.observable(""),this.className=o.computed(function(){var e=o.unwrap(this.size),t=this.trigger?" "+r.trim("settings-saved-trigger-input "+this.classForTrigger()):"";return(e>0?"span"+e:"")+t},this),!r.isUnd(e.width)&&e.element&&e.element.find("input,select,textarea").css("width",e.width),this.disposable.push(this.className),this.trigger&&(this.setTriggerState(this.trigger()),this.disposable.push(this.trigger.subscribe(this.setTriggerState,this)))}var s=i(2),o=i(3),n=i(4),r=i(1),a=i(29);t.prototype.setTriggerState=function(e){switch(r.pInt(e)){case n.SaveSettingsStep.TrueResult:this.classForTrigger("success");break;case n.SaveSettingsStep.FalseResult:this.classForTrigger("error");break;default:this.classForTrigger("")}},s.extend(t.prototype,a.prototype),t.componentExportHelper=a.componentExportHelper,e.exports=t}()},function(e,t,i){!function(){"use strict";function t(e,t){this.sScreenName=e,this.aViewModels=n.isArray(t)?t:[]}var s=i(2),o=i(41),n=i(1);t.prototype.oCross=null,t.prototype.sScreenName="",t.prototype.aViewModels=[],t.prototype.viewModels=function(){return this.aViewModels},t.prototype.screenName=function(){return this.sScreenName},t.prototype.routes=function(){return null},t.prototype.__cross=function(){return this.oCross},t.prototype.__start=function(){var e=this.routes(),t=null,i=null;n.isNonEmptyArray(e)&&(i=s.bind(this.onRoute||n.emptyFunction,this),t=o.create(),s.each(e,function(e){t.addRoute(e[0],i).rules=e[1]}),this.oCross=t)},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){this.google={},this.twitter={},this.facebook={},this.dropbox={},this.google.enabled=s.observable(!1),this.google.clientID=s.observable(""),this.google.clientSecret=s.observable(""),this.google.apiKey=s.observable(""),this.google.loading=s.observable(!1),this.google.userName=s.observable(""),this.google.loggined=s.computed(function(){return""!==this.google.userName()},this),this.google.capa={},this.google.capa.auth=s.observable(!1),this.google.capa.drive=s.observable(!1),this.google.capa.preview=s.observable(!1),this.google.require={},this.google.require.clientSettings=s.computed(function(){return this.google.enabled()&&(this.google.capa.auth()||this.google.capa.drive())},this),this.google.require.apiKeySettings=s.computed(function(){return this.google.enabled()&&this.google.capa.drive()},this),this.facebook.enabled=s.observable(!1),this.facebook.appID=s.observable(""),this.facebook.appSecret=s.observable(""),this.facebook.loading=s.observable(!1),this.facebook.userName=s.observable(""),this.facebook.supported=s.observable(!1),this.facebook.loggined=s.computed(function(){return""!==this.facebook.userName()},this),this.twitter.enabled=s.observable(!1),this.twitter.consumerKey=s.observable(""),this.twitter.consumerSecret=s.observable(""),this.twitter.loading=s.observable(!1),this.twitter.userName=s.observable(""),this.twitter.loggined=s.computed(function(){return""!==this.twitter.userName()},this),this.dropbox.enabled=s.observable(!1),this.dropbox.apiKey=s.observable("")}var s=i(3);t.prototype.google={},t.prototype.twitter={},t.prototype.facebook={},t.prototype.dropbox={},t.prototype.populate=function(){var e=i(9);this.google.enabled(!!e.settingsGet("AllowGoogleSocial")),this.google.clientID(e.settingsGet("GoogleClientID")),this.google.clientSecret(e.settingsGet("GoogleClientSecret")),this.google.apiKey(e.settingsGet("GoogleApiKey")),this.google.capa.auth(!!e.settingsGet("AllowGoogleSocialAuth")),this.google.capa.drive(!!e.settingsGet("AllowGoogleSocialDrive")),this.google.capa.preview(!!e.settingsGet("AllowGoogleSocialPreview")),this.facebook.enabled(!!e.settingsGet("AllowFacebookSocial")),this.facebook.appID(e.settingsGet("FacebookAppID")),this.facebook.appSecret(e.settingsGet("FacebookAppSecret")),this.facebook.supported(!!e.settingsGet("SupportedFacebookSocial")),this.twitter.enabled=s.observable(!!e.settingsGet("AllowTwitterSocial")),this.twitter.consumerKey=s.observable(e.settingsGet("TwitterConsumerKey")),this.twitter.consumerSecret=s.observable(e.settingsGet("TwitterConsumerSecret")),this.dropbox.enabled(!!e.settingsGet("AllowDropboxSocial")),this.dropbox.apiKey(e.settingsGet("DropboxApiKey"))},e.exports=new t}()},function(e){e.exports=window.moment},,function(e,t,i){!function(){"use strict";function t(e){r.call(this),this.value=e.value,(n.isUnd(this.value)||!this.value.subscribe)&&(this.value=o.observable(n.isUnd(this.value)?!1:!!this.value)),this.enable=e.enable,(n.isUnd(this.enable)||!this.enable.subscribe)&&(this.enable=o.observable(n.isUnd(this.enable)?!0:!!this.enable)),this.disable=e.disable,(n.isUnd(this.disable)||!this.disable.subscribe)&&(this.disable=o.observable(n.isUnd(this.disable)?!1:!!this.disable)),this.label=e.label||"",this.inline=n.isUnd(e.inline)?!1:e.inline,this.readOnly=n.isUnd(e.readOnly)?!1:!!e.readOnly,this.inverted=n.isUnd(e.inverted)?!1:!!e.inverted,this.labeled=!n.isUnd(e.label)}var s=i(2),o=i(3),n=i(1),r=i(29);s.extend(t.prototype,r.prototype),t.prototype.click=function(){this.readOnly||!this.enable()||this.disable()||this.value(!this.value())},t.componentExportHelper=r.componentExportHelper,e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){this.themes=s.observableArray([]),this.themeBackgroundName=s.observable(""),this.themeBackgroundHash=s.observable(""),this.theme=s.observable("").extend({limitedList:this.themes})}var s=i(3),o=i(1),n=i(9);t.prototype.populate=function(){var e=n.settingsGet("Themes");this.themes(o.isArray(e)?e:[]),this.theme(n.settingsGet("Theme")),this.themeBackgroundName(n.settingsGet("UserBackgroundName")),this.themeBackgroundHash(n.settingsGet("UserBackgroundHash"))},e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(){u.call(this,"Popups","PopupsAsk"),this.askDesc=o.observable(""),this.yesButton=o.observable(""),this.noButton=o.observable(""),this.yesFocus=o.observable(!1),this.noFocus=o.observable(!1),this.fYesAction=null,this.fNoAction=null,this.bFocusYesOnShow=!0,this.bDisabeCloseOnEsc=!0,this.sDefaultKeyScope=r.KeyState.PopupAsk,c.constructorEnd(this)}var s=i(2),o=i(3),n=i(21),r=i(4),a=i(1),l=i(7),c=i(5),u=i(11);c.extendAsViewModel(["View/Popup/Ask","PopupsAskViewModel"],t),s.extend(t.prototype,u.prototype),t.prototype.clearPopup=function(){this.askDesc(""),this.yesButton(l.i18n("POPUPS_ASK/BUTTON_YES")),this.noButton(l.i18n("POPUPS_ASK/BUTTON_NO")),this.yesFocus(!1),this.noFocus(!1),this.fYesAction=null,this.fNoAction=null},t.prototype.yesClick=function(){this.cancelCommand(),a.isFunc(this.fYesAction)&&this.fYesAction.call(null)},t.prototype.noClick=function(){this.cancelCommand(),a.isFunc(this.fNoAction)&&this.fNoAction.call(null)},t.prototype.onShow=function(e,t,i,s,o,n){this.clearPopup(),this.fYesAction=t||null,this.fNoAction=i||null,this.askDesc(e||""),s&&this.yesButton(s),s&&this.yesButton(o),this.bFocusYesOnShow=a.isUnd(n)?!0:!!n},t.prototype.onFocus=function(){this.bFocusYesOnShow&&this.yesFocus(!0)},t.prototype.onBuild=function(){n("tab, shift+tab, right, left",r.KeyState.PopupAsk,s.bind(function(){return this.yesFocus()?this.noFocus(!0):this.yesFocus(!0),!1},this)),n("esc",r.KeyState.PopupAsk,s.bind(function(){return this.noClick(),!1},this))},e.exports=t}()},function(e){e.exports=window.crossroads},,function(e,t,i){!function(){"use strict";function t(){this.defaultIdentityID=s.observable(""),this.identities=s.observableArray([]),this.identities.loading=s.observable(!1).extend({throttle:100})}var s=i(3),o=i(9);t.prototype.populate=function(){this.defaultIdentityID(o.settingsGet("DefaultIdentityID"))},e.exports=new t}()},function(e,t,i){!function(){"use strict";function t(){m.call(this,"Popups","PopupsFolderSystem"),l.initOnStartOrLangChange(function(){this.sChooseOnText=l.i18n("POPUPS_SYSTEM_FOLDERS/SELECT_CHOOSE_ONE"),this.sUnuseText=l.i18n("POPUPS_SYSTEM_FOLDERS/SELECT_UNUSE_NAME")},this),this.notification=o.observable(""),this.folderSelectList=o.computed(function(){return a.folderListOptionsBuilder([],d.folderList(),d.folderListSystemNames(),[["",this.sChooseOnText],[r.Values.UnuseOptionValue,this.sUnuseText]],null,null,null,null,null,!0)},this);var e=null,t=null;this.sentFolder=c.sentFolder,this.draftFolder=c.draftFolder,this.spamFolder=c.spamFolder,this.trashFolder=c.trashFolder,this.archiveFolder=c.archiveFolder,e=s.debounce(function(){u.settingsSet("SentFolder",c.sentFolder()),u.settingsSet("DraftFolder",c.draftFolder()),u.settingsSet("SpamFolder",c.spamFolder()),u.settingsSet("TrashFolder",c.trashFolder()),u.settingsSet("ArchiveFolder",c.archiveFolder()),h.saveSystemFolders(a.emptyFunction,{SentFolder:c.sentFolder(),DraftFolder:c.draftFolder(),SpamFolder:c.spamFolder(),TrashFolder:c.trashFolder(),ArchiveFolder:c.archiveFolder(),NullFolder:"NullFolder"})},1e3),t=function(){u.settingsSet("SentFolder",c.sentFolder()),u.settingsSet("DraftFolder",c.draftFolder()),u.settingsSet("SpamFolder",c.spamFolder()),u.settingsSet("TrashFolder",c.trashFolder()),u.settingsSet("ArchiveFolder",c.archiveFolder()),e()},c.sentFolder.subscribe(t),c.draftFolder.subscribe(t),c.spamFolder.subscribe(t),c.trashFolder.subscribe(t),c.archiveFolder.subscribe(t),this.defautOptionsAfterRender=a.defautOptionsAfterRender,p.constructorEnd(this)}var s=i(2),o=i(3),n=i(4),r=i(16),a=i(1),l=i(7),c=i(32),u=i(9),d=i(15),h=i(14),p=i(5),m=i(11);p.extendAsViewModel(["View/Popup/FolderSystem","PopupsFolderSystemViewModel"],t),s.extend(t.prototype,m.prototype),t.prototype.sChooseOnText="",t.prototype.sUnuseText="",t.prototype.onShow=function(e){var t="";switch(e=a.isUnd(e)?n.SetSystemFoldersNotification.None:e){case n.SetSystemFoldersNotification.Sent:t=l.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SENT");break;case n.SetSystemFoldersNotification.Draft:t=l.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_DRAFTS");break;case n.SetSystemFoldersNotification.Spam:t=l.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SPAM");break;case n.SetSystemFoldersNotification.Trash:t=l.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_TRASH");break;case n.SetSystemFoldersNotification.Archive:t=l.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_ARCHIVE")}this.notification(t)},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(){a.call(this,"Popups","PopupsLanguages"),this.LanguageStore=i(31),this.exp=o.observable(!1),this.languages=o.computed(function(){return s.map(this.LanguageStore.languages(),function(e){return{key:e,selected:o.observable(!1),fullName:n.convertLangName(e)}})},this),this.LanguageStore.language.subscribe(function(){this.resetMainLanguage()},this),r.constructorEnd(this)}var s=i(2),o=i(3),n=i(1),r=i(5),a=i(11);r.extendAsViewModel(["View/Popup/Languages","PopupsLanguagesViewModel"],t),s.extend(t.prototype,a.prototype),t.prototype.languageEnName=function(e){var t=n.convertLangName(e,!0);return"English"===t?"":t},t.prototype.resetMainLanguage=function(){var e=this.LanguageStore.language();s.each(this.languages(),function(t){t.selected(t.key===e)})},t.prototype.onShow=function(){this.exp(!0),this.resetMainLanguage()},t.prototype.onHide=function(){this.exp(!1)},t.prototype.changeLanguage=function(e){this.LanguageStore.language(e),this.cancelCommand()},e.exports=t}()},function(e,t,i){!function(){"use strict";function t(e){h.call(this),this.isLocalAutocomplete=!0,this.iframe=n('