]*>([\s\S\r\n]*)<\/div>/gim,d).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=c.html(a).text(),a=a.replace(/\n[ \t]+/gm,"\n").replace(/[\n]{3,}/gm,"\n\n").replace(/>/gi,">").replace(/</gi,"<").replace(/&/gi,"&"),t=0,r=100;r>0&&(r--,s=a.indexOf("__bq__start__",t),s>-1);)i=a.indexOf("__bq__start__",s+5),n=a.indexOf("__bq__end__",s+5),(-1===i||i>n)&&n>s?(a=a.substring(0,s)+u(a.substring(s+13,n))+a.substring(n+11),t=0):t=i>-1&&n>i?i-1:0;return a=a.replace(/__bq__start__/gm,"").replace(/__bq__end__/gm,"")},s.plainToHtml=function(e,t){e=e.toString().replace(/\r/g,"");var o=!1,i=!0,n=!0,r=[],a="",l=0,c=e.split("\n");do{for(i=!1,r=[],l=0;l"===a.substr(0,1),n&&!o?(i=!0,o=!0,r.push("~~~blockquote~~~"),r.push(a.substr(1))):!n&&o?(o=!1,r.push("~~~/blockquote~~~"),r.push(a)):r.push(n&&o?a.substr(1):a);o&&(o=!1,r.push("~~~/blockquote~~~")),c=r}while(i);return e=c.join("\n"),e=e.replace(/&/g,"&").replace(/>/g,">").replace(/").replace(/[\s]*~~~\/blockquote~~~/g,"
").replace(/[\-_~]{10,}/g,"
").replace(/\n/g,"
"),t?s.linkify(e):e},r.rainloop_Utils_htmlToPlain=s.htmlToPlain,r.rainloop_Utils_plainToHtml=s.plainToHtml,s.linkify=function(e){return o.fn&&o.fn.linkify&&(e=c.html(e.replace(/&/gi,"amp_amp_12345_amp_amp")).linkify().find(".linkified").removeClass("linkified").end().html().replace(/amp_amp_12345_amp_amp/g,"&")),e},s.resizeAndCrop=function(e,t,s){var o=new r.Image;o.onload=function(){var e=[0,0],o=r.document.createElement("canvas"),i=o.getContext("2d");o.width=t,o.height=t,e=this.width>this.height?[this.width-this.height,0]:[0,this.height-this.width],i.fillStyle="#fff",i.fillRect(0,0,t,t),i.drawImage(this,e[0]/2,e[1]/2,this.width-e[0],this.height-e[1],0,0,t,t),s(o.toDataURL("image/jpeg"))},o.src=e},s.folderListOptionsBuilder=function(e,t,o,i,n,a,l,c,u,d){var h=null,m=!1,g=0,f=0,b="Â Â Â ",S=[];for(u=s.isNormal(u)?u:0
g;g++)S.push({id:i[g][0],name:i[g][1],system:!1,seporator:!1,disabled:!1});for(m=!0,g=0,f=e.length;f>g;g++)h=e[g],(l?l.call(null,h):!0)&&(m&&0g;g++)h=t[g],(h.subScribed()||!h.existen)&&(l?l.call(null,h):!0)&&(p.FolderType.User===h.type()||!u||01||c>0&&l>c){for(l>c?(u(c),o=c,i=c):((3>=l||l>=c-2)&&(n+=2),u(l),o=l,i=l);n>0;)if(o-=1,i+=1,o>0&&(u(o,!1),n--),c>=i)u(i,!0),n--;else if(0>=o)break;3===o?u(2,!1):o>3&&u(r.Math.round((o-1)/2),!1,"..."),c-2===i?u(c-1,!0):c-2>i&&u(r.Math.round((c+i)/2),!0,"..."),o>1&&u(1,!1),c>i&&u(c,!0)}return a}},s.selectElement=function(e){if(r.getSelection){var t=r.getSelection();t.removeAllRanges();var s=r.document.createRange();s.selectNodeContents(e),t.addRange(s)}else if(r.document.selection){var o=r.document.body.createTextRange();o.moveToElementText(e),o.select()}},s.detectDropdownVisibility=i.debounce(function(){m.dropdownVisibility(!!i.find(m.aBootstrapDropdowns,function(e){return e.hasClass("open")}))},50),s.triggerAutocompleteInputChange=function(e){var t=function(){o(".checkAutocomplete").trigger("change")};e?i.delay(t,100):t()},t.exports=s}(t)},{"../External/$div.js":15,"../External/$doc.js":16,"../External/$html.js":17,"../External/$window.js":18,"../External/NotificationClass.js":22,"../External/jquery.js":26,"../External/ko.js":28,"../External/underscore.js":31,"../External/window.js":32,"./Consts.js":6,"./Enums.js":7,"./Globals.js":9}],15:[function(e,t){"use strict";t.exports=e("./jquery.js")("")},{"./jquery.js":26}],16:[function(e,t){"use strict";t.exports=e("./jquery.js")(window.document)},{"./jquery.js":26}],17:[function(e,t){"use strict";t.exports=e("./jquery.js")("html")},{"./jquery.js":26}],18:[function(e,t){"use strict";t.exports=e("./jquery.js")(window)},{"./jquery.js":26}],19:[function(e,t){"use strict";t.exports=e("./window.js").rainloopAppData||{}},{"./window.js":32}],20:[function(e,t){"use strict";t.exports=JSON},{}],21:[function(e,t){"use strict";t.exports=Jua},{}],22:[function(e,t){"use strict";var s=e("./window.js");t.exports=s.Notification&&s.Notification.requestPermission?s.Notification:null},{"./window.js":32}],23:[function(e,t){"use strict";t.exports=crossroads},{}],24:[function(e,t){"use strict";t.exports=hasher},{}],25:[function(e,t){"use strict";t.exports=ifvisible},{}],26:[function(e,t){"use strict";t.exports=$},{}],27:[function(e,t){"use strict";t.exports=key},{}],28:[function(e,t){!function(t,s){"use strict";var o=e("./window.js"),i=e("./underscore.js"),n=e("./jquery.js"),r=e("./$window.js"),a=e("./$doc.js");s.bindingHandlers.tooltip={init:function(t,o){var i=e("../Common/Globals.js"),r=e("../Common/Utils.js");if(!i.bMobileDevice){var a=n(t),l=a.data("tooltip-class")||"",c=a.data("tooltip-placement")||"top";a.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:c,trigger:"hover",title:function(){return a.is(".disabled")||i.dropdownVisibility()?"":''+r.i18n(s.utils.unwrapObservable(o()))+""}}).click(function(){a.tooltip("hide")}),i.tooltipTrigger.subscribe(function(){a.tooltip("hide")})}}},s.bindingHandlers.tooltip2={init:function(t,s){var o=e("../Common/Globals.js"),i=n(t),r=i.data("tooltip-class")||"",a=i.data("tooltip-placement")||"top";i.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:a,title:function(){return i.is(".disabled")||o.dropdownVisibility()?"":''+s()()+""}}).click(function(){i.tooltip("hide")}),o.tooltipTrigger.subscribe(function(){i.tooltip("hide")})}},s.bindingHandlers.tooltip3={init:function(t){var s=n(t),o=e("../Common/Globals.js");s.tooltip({container:"body",trigger:"hover manual",title:function(){return s.data("tooltip3-data")||""}}),a.click(function(){s.tooltip("hide")}),o.tooltipTrigger.subscribe(function(){s.tooltip("hide")})},update:function(e,t){var o=s.utils.unwrapObservable(t());""===o?n(e).data("tooltip3-data","").tooltip("hide"):n(e).data("tooltip3-data",o).tooltip("show")}},s.bindingHandlers.registrateBootstrapDropdown={init:function(t){var s=e("../Common/Globals.js");s.aBootstrapDropdowns.push(n(t))}},s.bindingHandlers.openDropdownTrigger={update:function(t,o){if(s.utils.unwrapObservable(o())){var i=n(t),r=e("../Common/Utils.js");i.hasClass("open")||(i.find(".dropdown-toggle").dropdown("toggle"),r.detectDropdownVisibility()),o()(!1)}}},s.bindingHandlers.dropdownCloser={init:function(e){n(e).closest(".dropdown").on("click",".e-item",function(){n(e).dropdown("toggle")})}},s.bindingHandlers.popover={init:function(e,t){n(e).popover(s.utils.unwrapObservable(t()))}},s.bindingHandlers.csstext={init:function(t,o){var i=e("../Common/Utils.js");t&&t.styleSheet&&!i.isUnd(t.styleSheet.cssText)?t.styleSheet.cssText=s.utils.unwrapObservable(o()):n(t).text(s.utils.unwrapObservable(o()))},update:function(t,o){var i=e("../Common/Utils.js");t&&t.styleSheet&&!i.isUnd(t.styleSheet.cssText)?t.styleSheet.cssText=s.utils.unwrapObservable(o()):n(t).text(s.utils.unwrapObservable(o()))}},s.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"})}},s.bindingHandlers.onEnter={init:function(e,t,s,i){n(e).on("keypress",function(s){s&&13===o.parseInt(s.keyCode,10)&&(n(e).trigger("change"),t().call(i))})}},s.bindingHandlers.onEsc={init:function(e,t,s,i){n(e).on("keypress",function(s){s&&27===o.parseInt(s.keyCode,10)&&(n(e).trigger("change"),t().call(i))})}},s.bindingHandlers.clickOnTrue={update:function(e,t){s.utils.unwrapObservable(t())&&n(e).click()}},s.bindingHandlers.modal={init:function(t,o){var i=e("../Common/Globals.js"),r=e("../Common/Utils.js");n(t).toggleClass("fade",!i.bMobileDevice).modal({keyboard:!1,show:s.utils.unwrapObservable(o())}).on("shown",function(){r.windowResize()}).find(".close").click(function(){o()(!1)})},update:function(e,t){n(e).modal(s.utils.unwrapObservable(t())?"show":"hide")}},s.bindingHandlers.i18nInit={init:function(t){var s=e("../Common/Utils.js");s.i18nToNode(t)}},s.bindingHandlers.i18nUpdate={update:function(t,o){var i=e("../Common/Utils.js");s.utils.unwrapObservable(o()),i.i18nToNode(t)}},s.bindingHandlers.link={update:function(e,t){n(e).attr("href",s.utils.unwrapObservable(t()))}},s.bindingHandlers.title={update:function(e,t){n(e).attr("title",s.utils.unwrapObservable(t()))}},s.bindingHandlers.textF={init:function(e,t){n(e).text(s.utils.unwrapObservable(t()))}},s.bindingHandlers.initDom={init:function(e,t){t()(e)}},s.bindingHandlers.initResizeTrigger={init:function(e,t){var o=s.utils.unwrapObservable(t());n(e).css({height:o[1],"min-height":o[1]})},update:function(t,o){var i=e("../Common/Utils.js"),a=s.utils.unwrapObservable(o()),l=i.pInt(a[1]),c=0,u=n(t).offset().top;u>0&&(u+=i.pInt(a[2]),c=r.height()-u,c>l&&(l=c),n(t).css({height:l,"min-height":l}))}},s.bindingHandlers.appendDom={update:function(e,t){n(e).hide().empty().append(s.utils.unwrapObservable(t())).show()}},s.bindingHandlers.draggable={init:function(t,i,r){var a=e("../Common/Globals.js"),l=e("../Common/Utils.js");if(!a.bMobileDevice){var c=100,u=3,d=r(),p=d&&d.droppableSelector?d.droppableSelector:"",h={distance:20,handle:".dragHandle",cursorAt:{top:22,left:3},refreshPositions:!0,scroll:!0};p&&(h.drag=function(e){n(p).each(function(){var t=null,s=null,i=n(this),r=i.offset(),a=r.top+i.height();o.clearInterval(i.data("timerScroll")),i.data("timerScroll",!1),e.pageX>=r.left&&e.pageX<=r.left+i.width()&&(e.pageY>=a-c&&e.pageY<=a&&(t=function(){i.scrollTop(i.scrollTop()+u),l.windowResize()},i.data("timerScroll",o.setInterval(t,10)),t()),e.pageY>=r.top&&e.pageY<=r.top+c&&(s=function(){i.scrollTop(i.scrollTop()-u),l.windowResize()},i.data("timerScroll",o.setInterval(s,10)),s()))})},h.stop=function(){n(p).each(function(){o.clearInterval(n(this).data("timerScroll")),n(this).data("timerScroll",!1)})}),h.helper=function(e){return i()(e&&e.target?s.dataFor(e.target):null)},n(t).draggable(h).on("mousedown",function(){l.removeInFocus()})}}},s.bindingHandlers.droppable={init:function(t,s,o){var i=e("../Common/Globals.js");if(!i.bMobileDevice){var r=s(),a=o(),l=a&&a.droppableOver?a.droppableOver:null,c=a&&a.droppableOut?a.droppableOut:null,u={tolerance:"pointer",hoverClass:"droppableHover"};r&&(u.drop=function(e,t){r(e,t)},l&&(u.over=function(e,t){l(e,t)}),c&&(u.out=function(e,t){c(e,t)}),n(t).droppable(u))}}},s.bindingHandlers.nano={init:function(t){var s=e("../Common/Globals.js");s.bDisableNanoScroll||n(t).addClass("nano").nanoScroller({iOSNativeScrolling:!1,preventPageScrolling:!0})}},s.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,t){var o=s.utils.unwrapObservable(t()),i=n(e);if("custom"===i.data("save-trigger-type"))switch(o.toString()){case"1":i.find(".animated,.error").hide().removeClass("visible").end().find(".success").show().addClass("visible");break;case"0":i.find(".animated,.success").hide().removeClass("visible").end().find(".error").show().addClass("visible");break;case"-2":i.find(".error,.success").hide().removeClass("visible").end().find(".animated").show().addClass("visible");break;default:i.find(".animated").hide().end().find(".error,.success").removeClass("visible")}else switch(o.toString()){case"1":i.addClass("success").removeClass("error");break;case"0":i.addClass("error").removeClass("success");break;case"-2":break;default:i.removeClass("error success")}}},s.bindingHandlers.emailsTags={init:function(t,s,o){var r=e("../Common/Utils.js"),a=e("../Models/EmailModel.js"),l=n(t),c=s(),u=o(),d=u.autoCompleteSource||null,p=function(e){c&&c.focusTrigger&&c.focusTrigger(e)};l.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!0,focusCallback:p,inputDelimiters:[",",";"],autoCompleteSource:d,parseHook:function(e){return i.map(e,function(e){var t=r.trim(e),s=null;return""!==t?(s=new a,s.mailsoParse(t),s.clearDuplicateName(),[s.toLine(!1),s]):[t,null]})},change:i.bind(function(e){l.data("EmailsTagsValue",e.target.value),c(e.target.value)},this)})},update:function(e,t,o){var i=n(e),r=o(),a=r.emailsTagsFilter||null,l=s.utils.unwrapObservable(t());i.data("EmailsTagsValue")!==l&&(i.val(l),i.data("EmailsTagsValue",l),i.inputosaurus("refresh")),a&&s.utils.unwrapObservable(a)&&i.inputosaurus("focus")}},s.bindingHandlers.contactTags={init:function(t,s,o){var r=e("../Common/Utils.js"),a=e("../Models/ContactTagModel.js"),l=n(t),c=s(),u=o(),d=u.autoCompleteSource||null,p=function(e){c&&c.focusTrigger&&c.focusTrigger(e)};l.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!1,focusCallback:p,inputDelimiters:[",",";"],outputDelimiter:",",autoCompleteSource:d,parseHook:function(e){return i.map(e,function(e){var t=r.trim(e),s=null;return""!==t?(s=new a,s.name(t),[s.toLine(!1),s]):[t,null]})},change:i.bind(function(e){l.data("ContactTagsValue",e.target.value),c(e.target.value)},this)})},update:function(e,t,o){var i=n(e),r=o(),a=r.contactTagsFilter||null,l=s.utils.unwrapObservable(t());i.data("ContactTagsValue")!==l&&(i.val(l),i.data("ContactTagsValue",l),i.inputosaurus("refresh")),a&&s.utils.unwrapObservable(a)&&i.inputosaurus("focus")}},s.bindingHandlers.command={init:function(e,t,o,i){var r=n(e),a=t();if(!a||!a.enabled||!a.canExecute)throw new Error("You are not using command function");r.addClass("command"),s.bindingHandlers[r.is("form")?"submit":"click"].init.apply(i,arguments)},update:function(e,t){var s=!0,o=n(e),i=t();s=i.enabled(),o.toggleClass("command-not-enabled",!s),s&&(s=i.canExecute(),o.toggleClass("command-can-not-be-execute",!s)),o.toggleClass("command-disabled disable disabled",!s).toggleClass("no-disabled",!!s),(o.is("input")||o.is("button"))&&o.prop("disabled",!s)}},s.extenders.trimmer=function(t){var o=e("../Common/Utils.js"),i=s.computed({read:t,write:function(e){t(o.trim(e.toString()))},owner:this});return i(t()),i},s.extenders.posInterer=function(t,o){var i=e("../Common/Utils.js"),n=s.computed({read:t,write:function(e){var s=i.pInt(e.toString(),o);0>=s&&(s=o),s===t()&&""+s!=""+e&&t(s+1),t(s)}});return n(t()),n},s.extenders.reversible=function(e){var t=e();return e.commit=function(){t=e()},e.reverse=function(){e(t)},e.commitedValue=function(){return t},e},s.extenders.toggleSubscribe=function(e,t){return e.subscribe(t[1],t[0],"beforeChange"),e.subscribe(t[2],t[0]),e},s.extenders.falseTimeout=function(t,s){var i=e("../Common/Utils.js");return t.iTimeout=0,t.subscribe(function(e){e&&(o.clearTimeout(t.iTimeout),t.iTimeout=o.setTimeout(function(){t(!1),t.iTimeout=0},i.pInt(s)))}),t},s.observable.fn.validateNone=function(){return this.hasError=s.observable(!1),this},s.observable.fn.validateEmail=function(){var t=e("../Common/Utils.js");return this.hasError=s.observable(!1),this.subscribe(function(e){e=t.trim(e),this.hasError(""!==e&&!/^[^@\s]+@[^@\s]+$/.test(e))},this),this.valueHasMutated(),this},s.observable.fn.validateSimpleEmail=function(){var t=e("../Common/Utils.js");return this.hasError=s.observable(!1),this.subscribe(function(e){e=t.trim(e),this.hasError(""!==e&&!/^.+@.+$/.test(e))},this),this.valueHasMutated(),this},s.observable.fn.validateFunc=function(t){var o=e("../Common/Utils.js");return this.hasFuncError=s.observable(!1),o.isFunc(t)&&(this.subscribe(function(e){this.hasFuncError(!t(e))},this),this.valueHasMutated()),this},t.exports=s}(t,ko)},{"../Common/Globals.js":9,"../Common/Utils.js":14,"../Models/ContactTagModel.js":42,"../Models/EmailModel.js":43,"./$doc.js":16,"./$window.js":18,"./jquery.js":26,"./underscore.js":31,"./window.js":32}],29:[function(e,t){"use strict";t.exports=moment},{}],30:[function(e,t){"use strict";t.exports=ssm},{}],31:[function(e,t){"use strict";t.exports=_},{}],32:[function(e,t){"use strict";t.exports=window},{}],33:[function(e,t){!function(t){"use strict";function s(){this.sDefaultScreenName="",this.oScreens={},this.oCurrentScreen=null}var o=e("../External/jquery.js"),i=e("../External/underscore.js"),n=e("../External/ko.js"),r=e("../External/hasher.js"),a=e("../External/crossroads.js"),l=e("../External/$html.js"),c=e("../Common/Globals.js"),u=e("../Common/Plugins.js"),d=e("../Common/Utils.js"),p=e("../Knoin/KnoinAbstractViewModel.js");
s.prototype.sDefaultScreenName="",s.prototype.oScreens={},s.prototype.oCurrentScreen=null,s.prototype.hideLoading=function(){o("#rl-loading").hide()},s.prototype.constructorEnd=function(e){d.isFunc(e.__constructor_end)&&e.__constructor_end.call(e)},s.prototype.extendAsViewModel=function(e,t,s){t&&(s||(s=p),t.__name=e,u.regViewModelHook(e,t),i.extend(t.prototype,s.prototype))},s.prototype.addSettingsViewModel=function(e,t,s,o,i){e.__rlSettingsData={Label:s,Template:t,Route:o,IsDefault:!!i},c.aViewModels.settings.push(e)},s.prototype.removeSettingsViewModel=function(e){c.aViewModels["settings-removed"].push(e)},s.prototype.disableSettingsViewModel=function(e){c.aViewModels["settings-disabled"].push(e)},s.prototype.routeOff=function(){r.changed.active=!1},s.prototype.routeOn=function(){r.changed.active=!0},s.prototype.screen=function(e){return""===e||d.isUnd(this.oScreens[e])?null:this.oScreens[e]},s.prototype.buildViewModel=function(e,t){if(e&&!e.__builded){var s=this,r=new e(t),a=r.viewModelPosition(),l=o("#rl-content #rl-"+a.toLowerCase()),p=null;e.__builded=!0,e.__vm=r,r.viewModelName=e.__name,l&&1===l.length?(p=o("").addClass("rl-view-model").addClass("RL-"+r.viewModelTemplate()).hide(),p.appendTo(l),r.viewModelDom=p,e.__dom=p,"Popups"===a&&(r.cancelCommand=r.closeCommand=d.createCommand(r,function(){s.hideScreenPopup(e)}),r.modalVisibility.subscribe(function(e){var t=this;e?(this.viewModelDom.show(),this.storeAndSetKeyScope(),c.popupVisibilityNames.push(this.viewModelName),r.viewModelDom.css("z-index",3e3+c.popupVisibilityNames().length+10),d.delegateRun(this,"onFocus",[],500)):(d.delegateRun(this,"onHide"),this.restoreKeyScope(),c.popupVisibilityNames.remove(this.viewModelName),r.viewModelDom.css("z-index",2e3),c.tooltipTrigger(!c.tooltipTrigger()),i.delay(function(){t.viewModelDom.hide()},300))},r)),u.runHook("view-model-pre-build",[e.__name,r,p]),n.applyBindingAccessorsToNode(p[0],{i18nInit:!0,template:function(){return{name:r.viewModelTemplate()}}},r),d.delegateRun(r,"onBuild",[p]),r&&"Popups"===a&&r.registerPopupKeyDown(),u.runHook("view-model-post-build",[e.__name,r,p])):d.log("Cannot find view model position: "+a)}return e?e.__vm:null},s.prototype.hideScreenPopup=function(e){e&&e.__vm&&e.__dom&&(e.__vm.modalVisibility(!1),u.runHook("view-model-on-hide",[e.__name,e.__vm]))},s.prototype.showScreenPopup=function(e,t){e&&(this.buildViewModel(e),e.__vm&&e.__dom&&(e.__vm.modalVisibility(!0),d.delegateRun(e.__vm,"onShow",t||[]),u.runHook("view-model-on-show",[e.__name,e.__vm,t||[]])))},s.prototype.isPopupVisible=function(e){return e&&e.__vm?e.__vm.modalVisibility():!1},s.prototype.screenOnRoute=function(e,t){var s=this,o=null,n=null;""===d.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,d.isNonEmptyArray(o.viewModels())&&i.each(o.viewModels(),function(e){this.buildViewModel(e,o)},this),d.delegateRun(o,"onBuild")),i.defer(function(){s.oCurrentScreen&&(d.delegateRun(s.oCurrentScreen,"onHide"),d.isNonEmptyArray(s.oCurrentScreen.viewModels())&&i.each(s.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.hide(),e.__vm.viewModelVisibility(!1),d.delegateRun(e.__vm,"onHide"))})),s.oCurrentScreen=o,s.oCurrentScreen&&(d.delegateRun(s.oCurrentScreen,"onShow"),u.runHook("screen-on-show",[s.oCurrentScreen.screenName(),s.oCurrentScreen]),d.isNonEmptyArray(s.oCurrentScreen.viewModels())&&i.each(s.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.show(),e.__vm.viewModelVisibility(!0),d.delegateRun(e.__vm,"onShow"),d.delegateRun(e.__vm,"onFocus",[],200),u.runHook("view-model-on-show",[e.__name,e.__vm]))},s)),n=o.__cross(),n&&n.parse(t)})))},s.prototype.startScreens=function(e){o("#rl-content").css({visibility:"hidden"}),i.each(e,function(e){var t=new e,s=t?t.screenName():"";t&&""!==s&&(""===this.sDefaultScreenName&&(this.sDefaultScreenName=s),this.oScreens[s]=t)},this),i.each(this.oScreens,function(e){e&&!e.__started&&e.__start&&(e.__started=!0,e.__start(),u.runHook("screen-pre-start",[e.screenName(),e]),d.delegateRun(e,"onStart"),u.runHook("screen-post-start",[e.screenName(),e]))},this);var t=a.create();t.addRoute(/^([a-zA-Z0-9\-]*)\/?(.*)$/,i.bind(this.screenOnRoute,this)),r.initialized.add(t.parse,t),r.changed.add(t.parse,t),r.init(),o("#rl-content").css({visibility:"visible"}),i.delay(function(){l.removeClass("rl-started-trigger").addClass("rl-started")},50)},s.prototype.setHash=function(e,t,s){e="#"===e.substr(0,1)?e.substr(1):e,e="/"===e.substr(0,1)?e.substr(1):e,s=d.isUnd(s)?!1:!!s,(d.isUnd(t)?1:!t)?(r.changed.active=!0,r[s?"replaceHash":"setHash"](e),r.setHash(e)):(r.changed.active=!1,r[s?"replaceHash":"setHash"](e),r.changed.active=!0)},t.exports=new s}(t)},{"../Common/Globals.js":9,"../Common/Plugins.js":12,"../Common/Utils.js":14,"../External/$html.js":17,"../External/crossroads.js":23,"../External/hasher.js":24,"../External/jquery.js":26,"../External/ko.js":28,"../External/underscore.js":31,"../Knoin/KnoinAbstractViewModel.js":36}],34:[function(e,t){!function(e){"use strict";function t(){}t.prototype.bootstart=function(){},e.exports=t}(t)},{}],35:[function(e,t){!function(t){"use strict";function s(e,t){this.sScreenName=e,this.aViewModels=i.isArray(t)?t:[]}var o=e("../External/crossroads.js"),i=e("../Common/Utils.js");s.prototype.oCross=null,s.prototype.sScreenName="",s.prototype.aViewModels=[],s.prototype.viewModels=function(){return this.aViewModels},s.prototype.screenName=function(){return this.sScreenName},s.prototype.routes=function(){return null},s.prototype.__cross=function(){return this.oCross},s.prototype.__start=function(){var e=this.routes(),t=null,s=null;i.isNonEmptyArray(e)&&(s=_.bind(this.onRoute||i.emptyFunction,this),t=o.create(),_.each(e,function(e){t.addRoute(e[0],s).rules=e[1]}),this.oCross=t)},t.exports=s}(t)},{"../Common/Utils.js":14,"../External/crossroads.js":23}],36:[function(e,t){!function(t){"use strict";function s(e,t){this.bDisabeCloseOnEsc=!1,this.sPosition=a.pString(e),this.sTemplate=a.pString(t),this.sDefaultKeyScope=n.KeyState.None,this.sCurrentKeyScope=this.sDefaultKeyScope,this.viewModelName="",this.viewModelVisibility=o.observable(!1),this.modalVisibility=o.observable(!1).extend({rateLimit:0}),this.viewModelDom=null}var o=e("../External/ko.js"),i=e("../External/$window.js"),n=e("../Common/Enums.js"),r=e("../Common/Globals.js"),a=e("../Common/Utils.js");s.prototype.sPosition="",s.prototype.sTemplate="",s.prototype.viewModelName="",s.prototype.viewModelDom=null,s.prototype.viewModelTemplate=function(){return this.sTemplate},s.prototype.viewModelPosition=function(){return this.sPosition},s.prototype.cancelCommand=function(){},s.prototype.closeCommand=function(){},s.prototype.storeAndSetKeyScope=function(){this.sCurrentKeyScope=r.keyScope(),r.keyScope(this.sDefaultKeyScope)},s.prototype.restoreKeyScope=function(){r.keyScope(this.sCurrentKeyScope)},s.prototype.registerPopupKeyDown=function(){var e=this;i.on("keydown",function(t){if(t&&e.modalVisibility&&e.modalVisibility()){if(!this.bDisabeCloseOnEsc&&n.EventKeyCode.Esc===t.keyCode)return a.delegateRun(e,"cancelCommand"),!1;if(n.EventKeyCode.Backspace===t.keyCode&&!a.inFocus())return!1}return!0})},t.exports=s}(t)},{"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/$window.js":18,"../External/ko.js":28}],37:[function(e,t){!function(t){"use strict";function s(e,t){this.email=e,this.deleteAccess=o.observable(!1),this.canBeDalete=o.observable(t)}var o=e("../External/ko.js");s.prototype.email="",s.prototype.changeAccountLink=function(){return e("../Common/LinkBuilder.js").change(this.email)},t.exports=s}(t)},{"../Common/LinkBuilder.js":10,"../External/ko.js":28}],38:[function(e,t){!function(t){"use strict";function s(){this.mimeType="",this.fileName="",this.estimatedSize=0,this.friendlySize="",this.isInline=!1,this.isLinked=!1,this.cid="",this.cidWithOutTags="",this.contentLocation="",this.download="",this.folder="",this.uid="",this.mimeIndex=""}var o=e("../External/window.js"),i=e("../Common/Globals.js"),n=e("../Common/Utils.js"),r=e("../Common/LinkBuilder.js");s.newInstanceFromJson=function(e){var t=new s;return t.initByJson(e)?t:null},s.prototype.mimeType="",s.prototype.fileName="",s.prototype.estimatedSize=0,s.prototype.friendlySize="",s.prototype.isInline=!1,s.prototype.isLinked=!1,s.prototype.cid="",s.prototype.cidWithOutTags="",s.prototype.contentLocation="",s.prototype.download="",s.prototype.folder="",s.prototype.uid="",s.prototype.mimeIndex="",s.prototype.initByJson=function(e){var t=!1;return e&&"Object/Attachment"===e["@Object"]&&(this.mimeType=(e.MimeType||"").toLowerCase(),this.fileName=e.FileName,this.estimatedSize=n.pInt(e.EstimatedSize),this.isInline=!!e.IsInline,this.isLinked=!!e.IsLinked,this.cid=e.CID,this.contentLocation=e.ContentLocation,this.download=e.Download,this.folder=e.Folder,this.uid=e.Uid,this.mimeIndex=e.MimeIndex,this.friendlySize=n.friendlySize(this.estimatedSize),this.cidWithOutTags=this.cid.replace(/^<+/,"").replace(/>+$/,""),t=!0),t},s.prototype.isImage=function(){return-1,]+)>?,? ?/g,s=t.exec(e);s?(this.name=s[1]||"",this.email=s[2]||"",this.clearDuplicateName()):/^[^@]+@[^@]+$/.test(e)&&(this.name="",this.email=e)},s.prototype.initByJson=function(e){var t=!1;return e&&"Object/Email"===e["@Object"]&&(this.name=i.trim(e.Name),this.email=i.trim(e.Email),t=""!==this.email,this.clearDuplicateName()),t},s.prototype.toLine=function(e,t,s){var o="";return""!==this.email&&(t=i.isUnd(t)?!1:!!t,s=i.isUnd(s)?!1:!!s,e&&""!==this.name?o=t?'")+'" target="_blank" tabindex="-1">'+i.encodeHtml(this.name)+"":s?i.encodeHtml(this.name):this.name:(o=this.email,""!==this.name?t?o=i.encodeHtml('"'+this.name+'" <')+'")+'" target="_blank" tabindex="-1">'+i.encodeHtml(o)+""+i.encodeHtml(">"):(o='"'+this.name+'" <'+o+">",s&&(o=i.encodeHtml(o))):t&&(o=''+i.encodeHtml(this.email)+""))),o},s.prototype.mailsoParse=function(e){if(e=i.trim(e),""===e)return!1;for(var t=function(e,t,s){e+="";var o=e.length;return 0>t&&(t+=o),o="undefined"==typeof s?o:0>s?s+o:s+t,t>=e.length||0>t||t>o?!1:e.slice(t,o)},s=function(e,t,s,o){return 0>s&&(s+=e.length),o=void 0!==o?o:e.length,0>o&&(o=o+e.length-s),e.slice(0,s)+t.substr(0,o)+t.slice(o)+e.slice(s+o)},o="",n="",r="",a=!1,l=!1,c=!1,u=null,d=0,p=0,h=0;h0&&0===o.length&&(o=t(e,0,h)),l=!0,d=h);break;case">":l&&(p=h,n=t(e,d+1,p-d-1),e=s(e,"",d,p-d+1),p=0,h=0,d=0,l=!1);break;case"(":a||l||c||(c=!0,d=h);break;case")":c&&(p=h,r=t(e,d+1,p-d-1),e=s(e,"",d,p-d+1),p=0,h=0,d=0,c=!1);break;case"\\":h++}h++}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=i.trim(n).replace(/^[<]+/,"").replace(/[>]+$/,""),o=i.trim(o).replace(/^["']+/,"").replace(/["']+$/,""),r=i.trim(r).replace(/^[(]+/,"").replace(/[)]+$/,""),o=o.replace(/\\\\(.)/,"$1"),r=r.replace(/\\\\(.)/,"$1"),this.name=o,this.email=n,this.clearDuplicateName(),!0},s.prototype.inputoTagLine=function(){return 00){if(r.FolderType.Draft===s)return""+e;if(t>0&&r.FolderType.Trash!==s&&r.FolderType.Archive!==s&&r.FolderType.SentItems!==s)return""+t}return""},this),this.canBeDeleted=i.computed(function(){var e=this.isSystemFolder();return!e&&0===this.subFolders().length&&"INBOX"!==this.fullNameRaw},this),this.canBeSubScribed=i.computed(function(){return!this.isSystemFolder()&&this.selectable&&"INBOX"!==this.fullNameRaw},this),this.visible.subscribe(function(){l.timeOutAction("folder-list-folder-visibility-change",function(){n.trigger("folder-list-folder-visibility-change")},100)}),this.localName=i.computed(function(){a.langChangeTrigger();var e=this.type(),t=this.name();if(this.isSystemFolder())switch(e){case r.FolderType.Inbox:t=l.i18n("FOLDER_LIST/INBOX_NAME");break;case r.FolderType.SentItems:t=l.i18n("FOLDER_LIST/SENT_NAME");break;case r.FolderType.Draft:t=l.i18n("FOLDER_LIST/DRAFTS_NAME");break;case r.FolderType.Spam:t=l.i18n("FOLDER_LIST/SPAM_NAME");break;case r.FolderType.Trash:t=l.i18n("FOLDER_LIST/TRASH_NAME");break;case r.FolderType.Archive:t=l.i18n("FOLDER_LIST/ARCHIVE_NAME")}return t},this),this.manageFolderSystemName=i.computed(function(){a.langChangeTrigger();var e="",t=this.type(),s=this.name();if(this.isSystemFolder())switch(t){case r.FolderType.Inbox:e="("+l.i18n("FOLDER_LIST/INBOX_NAME")+")";break;case r.FolderType.SentItems:e="("+l.i18n("FOLDER_LIST/SENT_NAME")+")";break;case r.FolderType.Draft:e="("+l.i18n("FOLDER_LIST/DRAFTS_NAME")+")";break;case r.FolderType.Spam:e="("+l.i18n("FOLDER_LIST/SPAM_NAME")+")";break;case r.FolderType.Trash:e="("+l.i18n("FOLDER_LIST/TRASH_NAME")+")";break;case r.FolderType.Archive:e="("+l.i18n("FOLDER_LIST/ARCHIVE_NAME")+")"}return(""!==e&&"("+s+")"===e||"(inbox)"===e.toLowerCase())&&(e=""),e},this),this.collapsed=i.computed({read:function(){return!this.hidden()&&this.collapsedPrivate()},write:function(e){this.collapsedPrivate(e)},owner:this}),this.hasUnreadMessages=i.computed(function(){return 0"},s.prototype.formattedNameForCompose=function(){var e=this.name();return""===e?this.email():e+" ("+this.email()+")"},s.prototype.formattedNameForEmail=function(){var e=this.name();return""===e?this.email():'"'+i.quoteName(e)+'" <'+this.email()+">"},t.exports=s}(t)},{"../Common/Utils.js":14,"../External/ko.js":28}],48:[function(e,t){!function(t){"use strict";function s(){this.folderFullNameRaw="",this.uid="",this.hash="",this.requestHash="",this.subject=r.observable(""),this.subjectPrefix=r.observable(""),this.subjectSuffix=r.observable(""),this.size=r.observable(0),this.dateTimeStampInUTC=r.observable(0),this.priority=r.observable(u.MessagePriority.Normal),this.proxy=!1,this.fromEmailString=r.observable(""),this.fromClearEmailString=r.observable(""),this.toEmailsString=r.observable(""),this.toClearEmailsString=r.observable(""),this.senderEmailsString=r.observable(""),this.senderClearEmailsString=r.observable(""),this.emails=[],this.from=[],this.to=[],this.cc=[],this.bcc=[],this.replyTo=[],this.deliveredTo=[],this.newForAnimation=r.observable(!1),this.deleted=r.observable(!1),this.unseen=r.observable(!1),this.flagged=r.observable(!1),this.answered=r.observable(!1),this.forwarded=r.observable(!1),this.isReadReceipt=r.observable(!1),this.focused=r.observable(!1),this.selected=r.observable(!1),this.checked=r.observable(!1),this.hasAttachments=r.observable(!1),this.attachmentsMainType=r.observable(""),this.moment=r.observable(a(a.unix(0))),this.attachmentIconClass=r.computed(function(){var e="";if(this.hasAttachments())switch(e="icon-attachment",this.attachmentsMainType()){case"image":e="icon-image";break;case"archive":e="icon-file-zip";break;case"doc":e="icon-file-text"}return e},this),this.fullFormatDateValue=r.computed(function(){return s.calculateFullFromatDateValue(this.dateTimeStampInUTC())},this),this.momentDate=d.createMomentDate(this),this.momentShortDate=d.createMomentShortDate(this),this.dateTimeStampInUTC.subscribe(function(e){var t=a().unix();this.moment(a.unix(e>t?t:e))},this),this.body=null,this.plainRaw="",this.isHtml=r.observable(!1),this.hasImages=r.observable(!1),this.attachments=r.observableArray([]),this.isPgpSigned=r.observable(!1),this.isPgpEncrypted=r.observable(!1),this.pgpSignedVerifyStatus=r.observable(u.SignedVerifyStatus.None),this.pgpSignedVerifyUser=r.observable(""),this.priority=r.observable(u.MessagePriority.Normal),this.readReceipt=r.observable(""),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid=r.observable(0),this.threads=r.observableArray([]),this.threadsLen=r.observable(0),this.hasUnseenSubMessage=r.observable(!1),this.hasFlaggedSubMessage=r.observable(!1),this.lastInCollapsedThread=r.observable(!1),this.lastInCollapsedThreadLoading=r.observable(!1),this.threadsLenResult=r.computed(function(){var e=this.threadsLen();return 0===this.parentUid()&&e>0?e+1:""},this)}var o=e("../External/window.js"),i=e("../External/jquery.js"),n=e("../External/underscore.js"),r=e("../External/ko.js"),a=e("../External/moment.js"),l=e("../External/$window.js"),c=e("../External/$div.js"),u=e("../Common/Enums.js"),d=e("../Common/Utils.js"),p=e("../Common/LinkBuilder.js"),h=e("./EmailModel.js"),m=e("./AttachmentModel.js");s.newInstanceFromJson=function(e){var t=new s;return t.initByJson(e)?t:null},s.calculateFullFromatDateValue=function(e){return e>0?a.unix(e).format("LLL"):""},s.emailsToLine=function(e,t,s){var o=[],i=0,n=0;if(d.isNonEmptyArray(e))for(i=0,n=e.length;n>i;i++)o.push(e[i].toLine(t,s));return o.join(", ")},s.emailsToLineClear=function(e){var t=[],s=0,o=0;if(d.isNonEmptyArray(e))for(s=0,o=e.length;o>s;s++)e[s]&&e[s].email&&""!==e[s].name&&t.push(e[s].email);return t.join(", ")},s.initEmailsFromJson=function(e){var t=0,s=0,o=null,i=[];
if(d.isNonEmptyArray(e))for(t=0,s=e.length;s>t;t++)o=h.newInstanceFromJson(e[t]),o&&i.push(o);return i},s.replyHelper=function(e,t,s){if(e&&0o;o++)d.isUnd(t[e[o].email])&&(t[e[o].email]=!0,s.push(e[o]))},s.prototype.clear=function(){this.folderFullNameRaw="",this.uid="",this.hash="",this.requestHash="",this.subject(""),this.subjectPrefix(""),this.subjectSuffix(""),this.size(0),this.dateTimeStampInUTC(0),this.priority(u.MessagePriority.Normal),this.proxy=!1,this.fromEmailString(""),this.fromClearEmailString(""),this.toEmailsString(""),this.toClearEmailsString(""),this.senderEmailsString(""),this.senderClearEmailsString(""),this.emails=[],this.from=[],this.to=[],this.cc=[],this.bcc=[],this.replyTo=[],this.deliveredTo=[],this.newForAnimation(!1),this.deleted(!1),this.unseen(!1),this.flagged(!1),this.answered(!1),this.forwarded(!1),this.isReadReceipt(!1),this.selected(!1),this.checked(!1),this.hasAttachments(!1),this.attachmentsMainType(""),this.body=null,this.isHtml(!1),this.hasImages(!1),this.attachments([]),this.isPgpSigned(!1),this.isPgpEncrypted(!1),this.pgpSignedVerifyStatus(u.SignedVerifyStatus.None),this.pgpSignedVerifyUser(""),this.priority(u.MessagePriority.Normal),this.readReceipt(""),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid(0),this.threads([]),this.threadsLen(0),this.hasUnseenSubMessage(!1),this.hasFlaggedSubMessage(!1),this.lastInCollapsedThread(!1),this.lastInCollapsedThreadLoading(!1)},s.prototype.computeSenderEmail=function(){var t=e("../Storages/WebMailDataStorage.js"),s=t.sentFolder(),o=t.draftFolder();this.senderEmailsString(this.folderFullNameRaw===s||this.folderFullNameRaw===o?this.toEmailsString():this.fromEmailString()),this.senderClearEmailsString(this.folderFullNameRaw===s||this.folderFullNameRaw===o?this.toClearEmailsString():this.fromClearEmailString())},s.prototype.initByJson=function(e){var t=!1;return e&&"Object/Message"===e["@Object"]&&(this.folderFullNameRaw=e.Folder,this.uid=e.Uid,this.hash=e.Hash,this.requestHash=e.RequestHash,this.proxy=!!e.ExternalProxy,this.size(d.pInt(e.Size)),this.from=s.initEmailsFromJson(e.From),this.to=s.initEmailsFromJson(e.To),this.cc=s.initEmailsFromJson(e.Cc),this.bcc=s.initEmailsFromJson(e.Bcc),this.replyTo=s.initEmailsFromJson(e.ReplyTo),this.deliveredTo=s.initEmailsFromJson(e.DeliveredTo),this.subject(e.Subject),d.isArray(e.SubjectParts)?(this.subjectPrefix(e.SubjectParts[0]),this.subjectSuffix(e.SubjectParts[1])):(this.subjectPrefix(""),this.subjectSuffix(this.subject())),this.dateTimeStampInUTC(d.pInt(e.DateTimeStampInUTC)),this.hasAttachments(!!e.HasAttachments),this.attachmentsMainType(e.AttachmentsMainType),this.fromEmailString(s.emailsToLine(this.from,!0)),this.fromClearEmailString(s.emailsToLineClear(this.from)),this.toEmailsString(s.emailsToLine(this.to,!0)),this.toClearEmailsString(s.emailsToLineClear(this.to)),this.parentUid(d.pInt(e.ParentThread)),this.threads(d.isArray(e.Threads)?e.Threads:[]),this.threadsLen(d.pInt(e.ThreadsLen)),this.initFlagsByJson(e),this.computeSenderEmail(),t=!0),t},s.prototype.initUpdateByMessageJson=function(t){var s=e("../Storages/WebMailDataStorage.js"),o=!1,i=u.MessagePriority.Normal;return t&&"Object/Message"===t["@Object"]&&(i=d.pInt(t.Priority),this.priority(-1t;t++)o=m.newInstanceFromJson(e["@Collection"][t]),o&&(""!==o.cidWithOutTags&&0+$/,""),t=n.find(s,function(t){return e===t.cidWithOutTags})),t||null},s.prototype.findAttachmentByContentLocation=function(e){var t=null,s=this.attachments();return d.isNonEmptyArray(s)&&(t=n.find(s,function(t){return e===t.contentLocation})),t||null},s.prototype.messageId=function(){return this.sMessageId},s.prototype.inReplyTo=function(){return this.sInReplyTo},s.prototype.references=function(){return this.sReferences},s.prototype.fromAsSingleEmail=function(){return d.isArray(this.from)&&this.from[0]?this.from[0].email:""},s.prototype.viewLink=function(){return p.messageViewLink(this.requestHash)},s.prototype.downloadLink=function(){return p.messageDownloadLink(this.requestHash)},s.prototype.replyEmails=function(e){var t=[],o=d.isUnd(e)?{}:e;return s.replyHelper(this.replyTo,o,t),0===t.length&&s.replyHelper(this.from,o,t),t},s.prototype.replyAllEmails=function(e){var t=[],o=[],i=d.isUnd(e)?{}:e;return s.replyHelper(this.replyTo,i,t),0===t.length&&s.replyHelper(this.from,i,t),s.replyHelper(this.to,i,t),s.replyHelper(this.cc,i,o),[t,o]},s.prototype.textBodyToString=function(){return this.body?this.body.html():""},s.prototype.attachmentsToStringLine=function(){var e=n.map(this.attachments(),function(e){return e.fileName+" ("+e.friendlySize+")"});return e&&0=0&&o&&!n&&s.attr("src",o)}),e&&o.setTimeout(function(){t.print()},100))})},s.prototype.printMessage=function(){this.viewPopupMessage(!0)},s.prototype.generateUid=function(){return this.folderFullNameRaw+"/"+this.uid},s.prototype.populateByMessageListItem=function(e){return this.folderFullNameRaw=e.folderFullNameRaw,this.uid=e.uid,this.hash=e.hash,this.requestHash=e.requestHash,this.subject(e.subject()),this.subjectPrefix(this.subjectPrefix()),this.subjectSuffix(this.subjectSuffix()),this.size(e.size()),this.dateTimeStampInUTC(e.dateTimeStampInUTC()),this.priority(e.priority()),this.proxy=e.proxy,this.fromEmailString(e.fromEmailString()),this.fromClearEmailString(e.fromClearEmailString()),this.toEmailsString(e.toEmailsString()),this.toClearEmailsString(e.toClearEmailsString()),this.emails=e.emails,this.from=e.from,this.to=e.to,this.cc=e.cc,this.bcc=e.bcc,this.replyTo=e.replyTo,this.deliveredTo=e.deliveredTo,this.unseen(e.unseen()),this.flagged(e.flagged()),this.answered(e.answered()),this.forwarded(e.forwarded()),this.isReadReceipt(e.isReadReceipt()),this.selected(e.selected()),this.checked(e.checked()),this.hasAttachments(e.hasAttachments()),this.attachmentsMainType(e.attachmentsMainType()),this.moment(e.moment()),this.body=null,this.priority(u.MessagePriority.Normal),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid(e.parentUid()),this.threads(e.threads()),this.threadsLen(e.threadsLen()),this.computeSenderEmail(),this},s.prototype.showExternalImages=function(e){if(this.body&&this.body.data("rl-has-images")){var t="";e=d.isUnd(e)?!1:e,this.hasImages(!1),this.body.data("rl-has-images",!1),t=this.proxy?"data-x-additional-src":"data-x-src",i("["+t+"]",this.body).each(function(){e&&i(this).is("img")?i(this).addClass("lazy").attr("data-original",i(this).attr(t)).removeAttr(t):i(this).attr("src",i(this).attr(t)).removeAttr(t)}),t=this.proxy?"data-x-additional-style-url":"data-x-style-url",i("["+t+"]",this.body).each(function(){var e=d.trim(i(this).attr("style"));e=""===e?"":";"===e.substr(-1)?e+" ":e+"; ",i(this).attr("style",e+i(this).attr(t)).removeAttr(t)}),e&&(i("img.lazy",this.body).addClass("lazy-inited").lazyload({threshold:400,effect:"fadeIn",skip_invisible:!1,container:i(".RL-MailMessageView .messageView .messageItem .content")[0]}),l.resize()),d.windowResize(500)}},s.prototype.showInternalImages=function(e){if(this.body&&!this.body.data("rl-init-internal-images")){this.body.data("rl-init-internal-images",!0),e=d.isUnd(e)?!1:e;var t=this;i("[data-x-src-cid]",this.body).each(function(){var s=t.findAttachmentByCid(i(this).attr("data-x-src-cid"));s&&s.download&&(e&&i(this).is("img")?i(this).addClass("lazy").attr("data-original",s.linkPreview()):i(this).attr("src",s.linkPreview()))}),i("[data-x-src-location]",this.body).each(function(){var s=t.findAttachmentByContentLocation(i(this).attr("data-x-src-location"));s||(s=t.findAttachmentByCid(i(this).attr("data-x-src-location"))),s&&s.download&&(e&&i(this).is("img")?i(this).addClass("lazy").attr("data-original",s.linkPreview()):i(this).attr("src",s.linkPreview()))}),i("[data-x-style-cid]",this.body).each(function(){var e="",s="",o=t.findAttachmentByCid(i(this).attr("data-x-style-cid"));o&&o.linkPreview&&(s=i(this).attr("data-x-style-cid-name"),""!==s&&(e=d.trim(i(this).attr("style")),e=""===e?"":";"===e.substr(-1)?e+" ":e+"; ",i(this).attr("style",e+s+": url('"+o.linkPreview()+"')")))}),e&&!function(e,t){n.delay(function(){e.addClass("lazy-inited").lazyload({threshold:400,effect:"fadeIn",skip_invisible:!1,container:t})},300)}(i("img.lazy",t.body),i(".RL-MailMessageView .messageView .messageItem .content")[0]),d.windowResize(500)}},s.prototype.storeDataToDom=function(){if(this.body){this.body.data("rl-is-html",!!this.isHtml()),this.body.data("rl-has-images",!!this.hasImages()),this.body.data("rl-plain-raw",this.plainRaw);var t=e("../Storages/WebMailDataStorage.js");t.capaOpenPGP()&&(this.body.data("rl-plain-pgp-signed",!!this.isPgpSigned()),this.body.data("rl-plain-pgp-encrypted",!!this.isPgpEncrypted()),this.body.data("rl-pgp-verify-status",this.pgpSignedVerifyStatus()),this.body.data("rl-pgp-verify-user",this.pgpSignedVerifyUser()))}},s.prototype.storePgpVerifyDataToDom=function(){var t=e("../Storages/WebMailDataStorage.js");this.body&&t.capaOpenPGP()&&(this.body.data("rl-pgp-verify-status",this.pgpSignedVerifyStatus()),this.body.data("rl-pgp-verify-user",this.pgpSignedVerifyUser()))},s.prototype.fetchDataToDom=function(){if(this.body){this.isHtml(!!this.body.data("rl-is-html")),this.hasImages(!!this.body.data("rl-has-images")),this.plainRaw=d.pString(this.body.data("rl-plain-raw"));var t=e("../Storages/WebMailDataStorage.js");t.capaOpenPGP()?(this.isPgpSigned(!!this.body.data("rl-plain-pgp-signed")),this.isPgpEncrypted(!!this.body.data("rl-plain-pgp-encrypted")),this.pgpSignedVerifyStatus(this.body.data("rl-pgp-verify-status")),this.pgpSignedVerifyUser(this.body.data("rl-pgp-verify-user"))):(this.isPgpSigned(!1),this.isPgpEncrypted(!1),this.pgpSignedVerifyStatus(u.SignedVerifyStatus.None),this.pgpSignedVerifyUser(""))}},s.prototype.verifyPgpSignedClearMessage=function(){if(this.isPgpSigned()){var t=[],s=null,r=e("../Storages/WebMailDataStorage.js"),a=this.from&&this.from[0]&&this.from[0].email?this.from[0].email:"",l=r.findPublicKeysByEmail(a),d=null,p=null,h="";this.pgpSignedVerifyStatus(u.SignedVerifyStatus.Error),this.pgpSignedVerifyUser("");try{s=o.openpgp.cleartext.readArmored(this.plainRaw),s&&s.getText&&(this.pgpSignedVerifyStatus(l.length?u.SignedVerifyStatus.Unverified:u.SignedVerifyStatus.UnknownPublicKeys),t=s.verify(l),t&&0').text(h)).html(),c.empty(),this.replacePlaneTextBody(h)))))}catch(m){}this.storePgpVerifyDataToDom()}},s.prototype.decryptPgpEncryptedMessage=function(t){if(this.isPgpEncrypted()){var s=[],r=null,a=null,l=e("../Storages/WebMailDataStorage.js"),d=this.from&&this.from[0]&&this.from[0].email?this.from[0].email:"",p=l.findPublicKeysByEmail(d),h=l.findSelfPrivateKey(t),m=null,g=null,f="";this.pgpSignedVerifyStatus(u.SignedVerifyStatus.Error),this.pgpSignedVerifyUser(""),h||this.pgpSignedVerifyStatus(u.SignedVerifyStatus.UnknownPrivateKey);try{r=o.openpgp.message.readArmored(this.plainRaw),r&&h&&r.decrypt&&(this.pgpSignedVerifyStatus(u.SignedVerifyStatus.Unverified),a=r.decrypt(h),a&&(s=a.verify(p),s&&0').text(f)).html(),c.empty(),this.replacePlaneTextBody(f)))}catch(b){}this.storePgpVerifyDataToDom()}},s.prototype.replacePlaneTextBody=function(e){this.body&&this.body.html(e).addClass("b-text-part plain")},s.prototype.flagHash=function(){return[this.deleted(),this.unseen(),this.flagged(),this.answered(),this.forwarded(),this.isReadReceipt()].join("")},t.exports=s}(t)},{"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/$div.js":15,"../External/$window.js":18,"../External/jquery.js":26,"../External/ko.js":28,"../External/moment.js":29,"../External/underscore.js":31,"../External/window.js":32,"../Storages/WebMailDataStorage.js":74,"./AttachmentModel.js":38,"./EmailModel.js":43}],49:[function(e,t){!function(t){"use strict";function s(e,t,s,i,n,r,a){this.index=e,this.id=s,this.guid=t,this.user=i,this.email=n,this.armor=a,this.isPrivate=!!r,this.deleteAccess=o.observable(!1)}var o=e("../External/ko.js");s.prototype.index=0,s.prototype.id="",s.prototype.guid="",s.prototype.user="",s.prototype.email="",s.prototype.armor="",s.prototype.isPrivate=!1,t.exports=s}(t)},{"../External/ko.js":28}],50:[function(e,t){!function(t){"use strict";function s(e){u.call(this,"settings",e),this.menu=n.observableArray([]),this.oCurrentSubScreen=null,this.oViewModelPlace=null}var o=e("../External/jquery.js"),i=e("../External/underscore.js"),n=e("../External/ko.js"),r=e("../Common/Globals.js"),a=e("../Common/Utils.js"),l=e("../Common/LinkBuilder.js"),c=e("../Knoin/Knoin.js"),u=e("../Knoin/KnoinAbstractScreen.js");i.extend(s.prototype,u.prototype),s.prototype.onRoute=function(e){var t=this,s=null,u=null,d=null,p=null;u=i.find(r.aViewModels.settings,function(t){return t&&t.__rlSettingsData&&e===t.__rlSettingsData.Route}),u&&(i.find(r.aViewModels["settings-removed"],function(e){return e&&e===u})&&(u=null),u&&i.find(r.aViewModels["settings-disabled"],function(e){return e&&e===u})&&(u=null)),u?(u.__builded&&u.__vm?s=u.__vm:(d=this.oViewModelPlace,d&&1===d.length?(u=u,s=new u,p=o("").addClass("rl-settings-view-model").hide(),p.appendTo(d),s.viewModelDom=p,s.__rlSettingsData=u.__rlSettingsData,u.__dom=p,u.__builded=!0,u.__vm=s,n.applyBindingAccessorsToNode(p[0],{i18nInit:!0,template:function(){return{name:u.__rlSettingsData.Template}}},s),a.delegateRun(s,"onBuild",[p])):a.log("Cannot find sub settings view model position: SettingsSubScreen")),s&&i.defer(function(){t.oCurrentSubScreen&&(a.delegateRun(t.oCurrentSubScreen,"onHide"),t.oCurrentSubScreen.viewModelDom.hide()),t.oCurrentSubScreen=s,t.oCurrentSubScreen&&(t.oCurrentSubScreen.viewModelDom.show(),a.delegateRun(t.oCurrentSubScreen,"onShow"),a.delegateRun(t.oCurrentSubScreen,"onFocus",[],200),i.each(t.menu(),function(e){e.selected(s&&s.__rlSettingsData&&e.route===s.__rlSettingsData.Route)}),o("#rl-content .b-settings .b-content .content").scrollTop(0)),a.windowResize()})):c.setHash(l.settings(),!1,!0)},s.prototype.onHide=function(){this.oCurrentSubScreen&&this.oCurrentSubScreen.viewModelDom&&(a.delegateRun(this.oCurrentSubScreen,"onHide"),this.oCurrentSubScreen.viewModelDom.hide())},s.prototype.onBuild=function(){i.each(r.aViewModels.settings,function(e){e&&e.__rlSettingsData&&!i.find(r.aViewModels["settings-removed"],function(t){return t&&t===e})&&this.menu.push({route:e.__rlSettingsData.Route,label:e.__rlSettingsData.Label,selected:n.observable(!1),disabled:!!i.find(r.aViewModels["settings-disabled"],function(t){return t&&t===e})})},this),this.oViewModelPlace=o("#rl-content #rl-settings-subscreen")},s.prototype.routes=function(){var e=i.find(r.aViewModels.settings,function(e){return e&&e.__rlSettingsData&&e.__rlSettingsData.IsDefault}),t=e?e.__rlSettingsData.Route:"general",s={subname:/^(.*)$/,normalize_:function(e,s){return s.subname=a.isUnd(s.subname)?t:a.pString(s.subname),[s.subname]}};return[["{subname}/",s],["{subname}",s],["",s]]},t.exports=s}(t)},{"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/jquery.js":26,"../External/ko.js":28,"../External/underscore.js":31,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractScreen.js":35}],51:[function(e,t){!function(t){"use strict";function s(){var t=e("../ViewModels/LoginViewModel.js");i.call(this,"login",[t])}var o=e("../External/underscore.js"),i=e("../Knoin/KnoinAbstractScreen.js");o.extend(s.prototype,i.prototype),s.prototype.onShow=function(){var t=e("../Boots/RainLoopApp.js");t.setTitle("")},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../External/underscore.js":31,"../Knoin/KnoinAbstractScreen.js":35,"../ViewModels/LoginViewModel.js":76}],52:[function(e,t){!function(t){"use strict";function s(){var t=e("../ViewModels/MailBoxSystemDropDownViewModel.js"),s=e("../ViewModels/MailBoxFolderListViewModel.js"),o=e("../ViewModels/MailBoxMessageListViewModel.js"),i=e("../ViewModels/MailBoxMessageViewViewModel.js");c.call(this,"mailbox",[t,s,o,i]),this.oLastRoute={}}var o=e("../External/underscore.js"),i=e("../External/$html.js"),n=e("../Common/Enums.js"),r=e("../Common/Globals.js"),a=e("../Common/Utils.js"),l=e("../Common/Events.js"),c=e("../Knoin/KnoinAbstractScreen.js"),u=e("../Storages/AppSettings.js"),d=e("../Storages/WebMailDataStorage.js"),p=e("../Storages/WebMailCacheStorage.js"),h=e("../Storages/WebMailAjaxRemoteStorage.js");o.extend(s.prototype,c.prototype),s.prototype.oLastRoute={},s.prototype.setNewTitle=function(){var t=e("../Boots/RainLoopApp.js"),s=d.accountEmail(),o=d.foldersInboxUnreadCount();t.setTitle((""===s?"":(o>0?"("+o+") ":" ")+s+" - ")+a.i18n("TITLES/MAILBOX"))},s.prototype.onShow=function(){this.setNewTitle(),r.keyScope(n.KeyState.MessageList)},s.prototype.onRoute=function(t,s,o,i){var r=e("../Boots/RainLoopApp.js");if(a.isUnd(i)?1:!i){var l=p.getFolderFullNameRaw(t),c=p.getFolderFromCacheList(l);c&&(d.currentFolder(c).messageListPage(s).messageListSearch(o),n.Layout.NoPreview===d.layout()&&d.message()&&d.message(null),r.reloadMessageList())}else n.Layout.NoPreview!==d.layout()||d.message()||r.historyBack()},s.prototype.onStart=function(){var t=e("../Boots/RainLoopApp.js"),s=function(){a.windowResize()};(u.capa(n.Capa.AdditionalAccounts)||u.capa(n.Capa.AdditionalIdentities))&&t.accountsAndIdentities(),o.delay(function(){"INBOX"!==d.currentFolderFullNameRaw()&&t.folderInformation("INBOX")},1e3),o.delay(function(){t.quota()},5e3),o.delay(function(){h.appDelayStart(a.emptyFunction)},35e3),i.toggleClass("rl-no-preview-pane",n.Layout.NoPreview===d.layout()),d.folderList.subscribe(s),d.messageList.subscribe(s),d.message.subscribe(s),d.layout.subscribe(function(e){i.toggleClass("rl-no-preview-pane",n.Layout.NoPreview===e)}),l.sub("mailbox.inbox-unread-count",function(e){d.foldersInboxUnreadCount(e)}),d.foldersInboxUnreadCount.subscribe(function(){this.setNewTitle()},this)},s.prototype.routes=function(){var e=function(){return["Inbox",1,"",!0]},t=function(e,t){return t[0]=a.pString(t[0]),t[1]=a.pInt(t[1]),t[1]=0>=t[1]?1:t[1],t[2]=a.pString(t[2]),""===e&&(t[0]="Inbox",t[1]=1),[decodeURI(t[0]),t[1],decodeURI(t[2]),!1]},s=function(e,t){return t[0]=a.pString(t[0]),t[1]=a.pString(t[1]),""===e&&(t[0]="Inbox"),[decodeURI(t[0]),1,decodeURI(t[1]),!1]};return[[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)\/(.+)\/?$/,{normalize_:t}],[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)$/,{normalize_:t}],[/^([a-zA-Z0-9]+)\/(.+)\/?$/,{normalize_:s}],[/^message-preview$/,{normalize_:e}],[/^([^\/]*)$/,{normalize_:t}]]},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/Events.js":8,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/$html.js":17,"../External/underscore.js":31,"../Knoin/KnoinAbstractScreen.js":35,"../Storages/AppSettings.js":68,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailCacheStorage.js":73,"../Storages/WebMailDataStorage.js":74,"../ViewModels/MailBoxFolderListViewModel.js":77,"../ViewModels/MailBoxMessageListViewModel.js":78,"../ViewModels/MailBoxMessageViewViewModel.js":79,"../ViewModels/MailBoxSystemDropDownViewModel.js":80}],53:[function(e,t){!function(t){"use strict";function s(){var t=e("../Boots/RainLoopApp.js"),s=e("../ViewModels/SettingsSystemDropDownViewModel.js"),o=e("../ViewModels/SettingsMenuViewModel.js"),i=e("../ViewModels/SettingsPaneViewModel.js");a.call(this,[s,o,i]),n.initOnStartOrLangChange(function(){this.sSettingsTitle=n.i18n("TITLES/SETTINGS")},this,function(){t.setTitle(this.sSettingsTitle)})}var o=e("../External/underscore.js"),i=e("../Common/Enums.js"),n=e("../Common/Utils.js"),r=e("../Common/Globals.js"),a=e("./AbstractSettings.js");o.extend(s.prototype,a.prototype),s.prototype.onShow=function(){var t=e("../Boots/RainLoopApp.js");t.setTitle(this.sSettingsTitle),r.keyScope(i.KeyState.Settings)},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/underscore.js":31,"../ViewModels/SettingsMenuViewModel.js":98,"../ViewModels/SettingsPaneViewModel.js":99,"../ViewModels/SettingsSystemDropDownViewModel.js":100,"./AbstractSettings.js":50}],54:[function(e,t){!function(t){"use strict";function s(){this.accounts=c.accounts,this.processText=n.computed(function(){return c.accountsLoading()?a.i18n("SETTINGS_ACCOUNTS/LOADING_PROCESS"):""},this),this.visibility=n.computed(function(){return""===this.processText()?"hidden":"visible"},this),this.accountForDeletion=n.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1)},function(e){e&&e.deleteAccess(!0)}]})}var o=e("../External/window.js"),i=e("../External/underscore.js"),n=e("../External/ko.js"),r=e("../Common/Enums.js"),a=e("../Common/Utils.js"),l=e("../Common/LinkBuilder.js"),c=e("../Storages/WebMailDataStorage.js"),u=e("../Storages/WebMailAjaxRemoteStorage.js"),d=e("../Knoin/Knoin.js"),p=e("../ViewModels/Popups/PopupsAddAccountViewModel.js");s.prototype.addNewAccount=function(){d.showScreenPopup(p)},s.prototype.deleteAccount=function(t){if(t&&t.deleteAccess()){this.accountForDeletion(null);var s=e("../Boots/RainLoopApp.js"),n=function(e){return t===e};t&&(this.accounts.remove(n),u.accountDelete(function(e,t){r.StorageResultType.Success===e&&t&&t.Result&&t.Reload?(d.routeOff(),d.setHash(l.root(),!0),d.routeOff(),i.defer(function(){o.location.reload()})):s.accountsAndIdentities()},t.email))}},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/ko.js":28,"../External/underscore.js":31,"../External/window.js":32,"../Knoin/Knoin.js":33,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailDataStorage.js":74,"../ViewModels/Popups/PopupsAddAccountViewModel.js":81}],55:[function(e,t){!function(t){"use strict";function s(){this.changeProcess=i.observable(!1),this.errorDescription=i.observable(""),this.passwordMismatch=i.observable(!1),this.passwordUpdateError=i.observable(!1),this.passwordUpdateSuccess=i.observable(!1),this.currentPassword=i.observable(""),this.currentPassword.error=i.observable(!1),this.newPassword=i.observable(""),this.newPassword2=i.observable(""),this.currentPassword.subscribe(function(){this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.currentPassword.error(!1)},this),this.newPassword.subscribe(function(){this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.passwordMismatch(!1)},this),this.newPassword2.subscribe(function(){this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.passwordMismatch(!1)},this),this.saveNewPasswordCommand=r.createCommand(this,function(){this.newPassword()!==this.newPassword2()?(this.passwordMismatch(!0),this.errorDescription(r.i18n("SETTINGS_CHANGE_PASSWORD/ERROR_PASSWORD_MISMATCH"))):(this.changeProcess(!0),this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.currentPassword.error(!1),this.passwordMismatch(!1),this.errorDescription(""),a.changePassword(this.onChangePasswordResponse,this.currentPassword(),this.newPassword()))},function(){return!this.changeProcess()&&""!==this.currentPassword()&&""!==this.newPassword()&&""!==this.newPassword2()}),this.onChangePasswordResponse=o.bind(this.onChangePasswordResponse,this)}var o=e("../External/underscore.js"),i=e("../External/ko.js"),n=e("../Common/Enums.js"),r=e("../Common/Utils.js"),a=e("../Storages/WebMailAjaxRemoteStorage.js");s.prototype.onHide=function(){this.changeProcess(!1),this.currentPassword(""),this.newPassword(""),this.newPassword2(""),this.errorDescription(""),this.passwordMismatch(!1),this.currentPassword.error(!1)},s.prototype.onChangePasswordResponse=function(e,t){this.changeProcess(!1),this.passwordMismatch(!1),this.errorDescription(""),this.currentPassword.error(!1),n.StorageResultType.Success===e&&t&&t.Result?(this.currentPassword(""),this.newPassword(""),this.newPassword2(""),this.passwordUpdateSuccess(!0),this.currentPassword.error(!1)):(t&&n.Notification.CurrentPasswordIncorrect===t.ErrorCode&&this.currentPassword.error(!0),this.passwordUpdateError(!0),this.errorDescription(r.getNotification(t&&t.ErrorCode?t.ErrorCode:n.Notification.CouldNotSaveNewPassword)))},t.exports=s}(t)},{"../Common/Enums.js":7,"../Common/Utils.js":14,"../External/ko.js":28,"../External/underscore.js":31,"../Storages/WebMailAjaxRemoteStorage.js":72}],56:[function(e,t){!function(t){"use strict";function s(){this.contactsAutosave=r.contactsAutosave,this.allowContactsSync=r.allowContactsSync,this.enableContactsSync=r.enableContactsSync,this.contactsSyncUrl=r.contactsSyncUrl,this.contactsSyncUser=r.contactsSyncUser,this.contactsSyncPass=r.contactsSyncPass,this.saveTrigger=o.computed(function(){return[this.enableContactsSync()?"1":"0",this.contactsSyncUrl(),this.contactsSyncUser(),this.contactsSyncPass()].join("|")},this).extend({throttle:500}),this.saveTrigger.subscribe(function(){n.saveContactsSyncData(null,this.enableContactsSync(),this.contactsSyncUrl(),this.contactsSyncUser(),this.contactsSyncPass())},this)}var o=e("../External/ko.js"),i=e("../Common/Utils.js"),n=e("../Storages/WebMailAjaxRemoteStorage.js"),r=e("../Storages/WebMailDataStorage.js");s.prototype.onBuild=function(){r.contactsAutosave.subscribe(function(e){n.saveSettings(i.emptyFunction,{ContactsAutosave:e?"1":"0"})})},t.exports=s}(t)},{"../Common/Utils.js":14,"../External/ko.js":28,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailDataStorage.js":74}],57:[function(e,t){!function(t){"use strict";function s(){this.filters=o.observableArray([]),this.filters.loading=o.observable(!1),this.filters.subscribe(function(){i.windowResize()})}var o=e("../External/ko.js"),i=e("../Common/Utils.js");s.prototype.deleteFilter=function(e){this.filters.remove(e)},s.prototype.addFilter=function(){var t=e("../Knoin/Knoin.js"),s=e("../Models/FilterModel.js"),o=e("../ViewModels/Popups/PopupsFilterViewModel.js");t.showScreenPopup(o,[new s])},t.exports=s}(t)},{"../Common/Utils.js":14,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Models/FilterModel.js":45,"../ViewModels/Popups/PopupsFilterViewModel.js":88}],58:[function(e,t){!function(t){"use strict";function s(){this.foldersListError=c.foldersListError,this.folderList=c.folderList,this.processText=o.computed(function(){var e=c.foldersLoading(),t=c.foldersCreating(),s=c.foldersDeleting(),o=c.foldersRenaming();return t?n.i18n("SETTINGS_FOLDERS/CREATING_PROCESS"):s?n.i18n("SETTINGS_FOLDERS/DELETING_PROCESS"):o?n.i18n("SETTINGS_FOLDERS/RENAMING_PROCESS"):e?n.i18n("SETTINGS_FOLDERS/LOADING_PROCESS"):""},this),this.visibility=o.computed(function(){return""===this.processText()?"hidden":"visible"},this),this.folderForDeletion=o.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1)},function(e){e&&e.deleteAccess(!0)}]}),this.folderForEdit=o.observable(null).extend({toggleSubscribe:[this,function(e){e&&e.edited(!1)},function(e){e&&e.canBeEdited()&&e.edited(!0)}]}),this.useImapSubscribe=!!a.settingsGet("UseImapSubscribe")}var o=e("../External/ko.js"),i=e("../Common/Enums.js"),n=e("../Common/Utils.js"),r=e("../Knoin/Knoin.js"),a=e("../Storages/AppSettings.js"),l=e("../Storages/LocalStorage.js"),c=e("../Storages/WebMailDataStorage.js"),u=e("../Storages/WebMailCacheStorage.js"),d=e("../Storages/WebMailAjaxRemoteStorage.js"),p=e("../ViewModels/Popups/PopupsFolderCreateViewModel.js"),h=e("../ViewModels/Popups/PopupsFolderSystemViewModel.js");s.prototype.folderEditOnEnter=function(t){var s=e("../Boots/RainLoopApp.js"),o=t?n.trim(t.nameForEdit()):"";""!==o&&t.name()!==o&&(l.set(i.ClientSideKeyName.FoldersLashHash,""),c.foldersRenaming(!0),d.folderRename(function(e,t){c.foldersRenaming(!1),i.StorageResultType.Success===e&&t&&t.Result||c.foldersListError(t&&t.ErrorCode?n.getNotification(t.ErrorCode):n.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER")),s.folders()},t.fullNameRaw,o),u.removeFolderFromCacheList(t.fullNameRaw),t.name(o)),t.edited(!1)},s.prototype.folderEditOnEsc=function(e){e&&e.edited(!1)},s.prototype.onShow=function(){c.foldersListError("")},s.prototype.createFolder=function(){r.showScreenPopup(p)},s.prototype.systemFolder=function(){r.showScreenPopup(h)},s.prototype.deleteFolder=function(t){if(t&&t.canBeDeleted()&&t.deleteAccess()&&0===t.privateMessageCountAll()){this.folderForDeletion(null);var s=e("../Boots/RainLoopApp.js"),o=function(e){return t===e?!0:(e.subFolders.remove(o),!1)
};t&&(l.set(i.ClientSideKeyName.FoldersLashHash,""),c.folderList.remove(o),c.foldersDeleting(!0),d.folderDelete(function(e,t){c.foldersDeleting(!1),i.StorageResultType.Success===e&&t&&t.Result||c.foldersListError(t&&t.ErrorCode?n.getNotification(t.ErrorCode):n.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER")),s.folders()},t.fullNameRaw),u.removeFolderFromCacheList(t.fullNameRaw))}else 0"},s.prototype.addNewIdentity=function(){c.showScreenPopup(u)},s.prototype.editIdentity=function(e){c.showScreenPopup(u,[e])},s.prototype.deleteIdentity=function(t){if(t&&t.deleteAccess()){this.identityForDeletion(null);var s=e("../Boots/RainLoopApp.js"),o=function(e){return t===e};t&&(this.identities.remove(o),l.identityDelete(function(){s.accountsAndIdentities()},t.id))}},s.prototype.onFocus=function(){if(!this.editor&&this.signatureDom()){var e=this,t=a.signature();this.editor=new r(e.signatureDom(),function(){a.signature((e.editor.isHtml()?":HTML:":"")+e.editor.getData())},function(){":HTML:"===t.substr(0,6)?e.editor.setHtml(t.substr(6),!1):e.editor.setPlain(t,!1)})}},s.prototype.onBuild=function(e){var t=this;e.on("click",".identity-item .e-action",function(){var e=o.dataFor(this);e&&t.editIdentity(e)}),_.delay(function(){var e=n.settingsSaveHelperSimpleFunction(t.displayNameTrigger,t),s=n.settingsSaveHelperSimpleFunction(t.replyTrigger,t),o=n.settingsSaveHelperSimpleFunction(t.signatureTrigger,t),i=n.settingsSaveHelperSimpleFunction(t.defaultIdentityIDTrigger,t);a.defaultIdentityID.subscribe(function(e){l.saveSettings(i,{DefaultIdentityID:e})}),a.displayName.subscribe(function(t){l.saveSettings(e,{DisplayName:t})}),a.replyTo.subscribe(function(e){l.saveSettings(s,{ReplyTo:e})}),a.signature.subscribe(function(e){l.saveSettings(o,{Signature:e})}),a.signatureToAll.subscribe(function(e){l.saveSettings(null,{SignatureToAll:e?"1":"0"})})},50)},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/NewHtmlEditorWrapper.js":11,"../Common/Utils.js":14,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailDataStorage.js":74,"../ViewModels/Popups/PopupsIdentityViewModel.js":93}],61:[function(e,t){!function(t){"use strict";function s(){this.editor=null,this.displayName=a.displayName,this.signature=a.signature,this.signatureToAll=a.signatureToAll,this.replyTo=a.replyTo,this.signatureDom=o.observable(null),this.displayNameTrigger=o.observable(i.SaveSettingsStep.Idle),this.replyTrigger=o.observable(i.SaveSettingsStep.Idle),this.signatureTrigger=o.observable(i.SaveSettingsStep.Idle)}var o=e("../External/ko.js"),i=e("../Common/Enums.js"),n=e("../Common/Utils.js"),r=e("../Common/NewHtmlEditorWrapper.js"),a=e("../Storages/WebMailDataStorage.js"),l=e("../Storages/WebMailAjaxRemoteStorage.js");s.prototype.onFocus=function(){if(!this.editor&&this.signatureDom()){var e=this,t=a.signature();this.editor=new r(e.signatureDom(),function(){a.signature((e.editor.isHtml()?":HTML:":"")+e.editor.getData())},function(){":HTML:"===t.substr(0,6)?e.editor.setHtml(t.substr(6),!1):e.editor.setPlain(t,!1)})}},s.prototype.onBuild=function(){var e=this;_.delay(function(){var t=n.settingsSaveHelperSimpleFunction(e.displayNameTrigger,e),s=n.settingsSaveHelperSimpleFunction(e.replyTrigger,e),o=n.settingsSaveHelperSimpleFunction(e.signatureTrigger,e);a.displayName.subscribe(function(e){l.saveSettings(t,{DisplayName:e})}),a.replyTo.subscribe(function(e){l.saveSettings(s,{ReplyTo:e})}),a.signature.subscribe(function(e){l.saveSettings(o,{Signature:e})}),a.signatureToAll.subscribe(function(e){l.saveSettings(null,{SignatureToAll:e?"1":"0"})})},50)},t.exports=s}(t)},{"../Common/Enums.js":7,"../Common/NewHtmlEditorWrapper.js":11,"../Common/Utils.js":14,"../External/ko.js":28,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailDataStorage.js":74}],62:[function(e,t){!function(t){"use strict";function s(){this.openpgpkeys=n.openpgpkeys,this.openpgpkeysPublic=n.openpgpkeysPublic,this.openpgpkeysPrivate=n.openpgpkeysPrivate,this.openPgpKeyForDeletion=o.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1)},function(e){e&&e.deleteAccess(!0)}]})}var o=e("../External/ko.js"),i=e("../Knoin/Knoin.js"),n=e("../Storages/WebMailDataStorage.js"),r=e("../ViewModels/Popups/PopupsAddOpenPgpKeyViewModel.js"),a=e("../ViewModels/Popups/PopupsGenerateNewOpenPgpKeyViewModel.js"),l=e("../ViewModels/Popups/PopupsViewOpenPgpKeyViewModel.js");s.prototype.addOpenPgpKey=function(){i.showScreenPopup(r)},s.prototype.generateOpenPgpKey=function(){i.showScreenPopup(a)},s.prototype.viewOpenPgpKey=function(e){e&&i.showScreenPopup(l,[e])},s.prototype.deleteOpenPgpKey=function(t){if(t&&t.deleteAccess()&&(this.openPgpKeyForDeletion(null),t&&n.openpgpKeyring)){this.openpgpkeys.remove(function(e){return t===e}),n.openpgpKeyring[t.isPrivate?"privateKeys":"publicKeys"].removeForId(t.guid),n.openpgpKeyring.store();var s=e("../Boots/RainLoopApp.js");s.reloadOpenPgpKeys()}},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Storages/WebMailDataStorage.js":74,"../ViewModels/Popups/PopupsAddOpenPgpKeyViewModel.js":82,"../ViewModels/Popups/PopupsGenerateNewOpenPgpKeyViewModel.js":92,"../ViewModels/Popups/PopupsViewOpenPgpKeyViewModel.js":97}],63:[function(e,t){!function(t){"use strict";function s(){this.processing=o.observable(!1),this.clearing=o.observable(!1),this.secreting=o.observable(!1),this.viewUser=o.observable(""),this.viewEnable=o.observable(!1),this.viewEnable.subs=!0,this.twoFactorStatus=o.observable(!1),this.viewSecret=o.observable(""),this.viewBackupCodes=o.observable(""),this.viewUrl=o.observable(""),this.bFirst=!0,this.viewTwoFactorStatus=o.computed(function(){return n.langChangeTrigger(),r.i18n(this.twoFactorStatus()?"SETTINGS_SECURITY/TWO_FACTOR_SECRET_CONFIGURED_DESC":"SETTINGS_SECURITY/TWO_FACTOR_SECRET_NOT_CONFIGURED_DESC")},this),this.onResult=_.bind(this.onResult,this),this.onSecretResult=_.bind(this.onSecretResult,this)}var o=e("../External/ko.js"),i=e("../Common/Enums.js"),n=e("../Common/Globals.js"),r=e("../Common/Utils.js"),a=e("../Storages/WebMailAjaxRemoteStorage.js"),l=e("../Knoin/Knoin.js"),c=e("../ViewModels/Popups/PopupsTwoFactorTestViewModel.js");s.prototype.showSecret=function(){this.secreting(!0),a.showTwoFactorSecret(this.onSecretResult)},s.prototype.hideSecret=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")},s.prototype.createTwoFactor=function(){this.processing(!0),a.createTwoFactor(this.onResult)},s.prototype.enableTwoFactor=function(){this.processing(!0),a.enableTwoFactor(this.onResult,this.viewEnable())},s.prototype.testTwoFactor=function(){l.showScreenPopup(c)},s.prototype.clearTwoFactor=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl(""),this.clearing(!0),a.clearTwoFactor(this.onResult)},s.prototype.onShow=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")},s.prototype.onResult=function(e,t){if(this.processing(!1),this.clearing(!1),i.StorageResultType.Success===e&&t&&t.Result?(this.viewUser(r.pString(t.Result.User)),this.viewEnable(!!t.Result.Enable),this.twoFactorStatus(!!t.Result.IsSet),this.viewSecret(r.pString(t.Result.Secret)),this.viewBackupCodes(r.pString(t.Result.BackupCodes).replace(/[\s]+/g," ")),this.viewUrl(r.pString(t.Result.Url))):(this.viewUser(""),this.viewEnable(!1),this.twoFactorStatus(!1),this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")),this.bFirst){this.bFirst=!1;var s=this;this.viewEnable.subscribe(function(e){this.viewEnable.subs&&a.enableTwoFactor(function(e,t){i.StorageResultType.Success===e&&t&&t.Result||(s.viewEnable.subs=!1,s.viewEnable(!1),s.viewEnable.subs=!0)},e)},this)}},s.prototype.onSecretResult=function(e,t){this.secreting(!1),i.StorageResultType.Success===e&&t&&t.Result?(this.viewSecret(r.pString(t.Result.Secret)),this.viewUrl(r.pString(t.Result.Url))):(this.viewSecret(""),this.viewUrl(""))},s.prototype.onBuild=function(){this.processing(!0),a.getTwoFactor(this.onResult)},t.exports=s}(t)},{"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Storages/WebMailAjaxRemoteStorage.js":72,"../ViewModels/Popups/PopupsTwoFactorTestViewModel.js":96}],64:[function(e,t){!function(t){"use strict";function s(){var t=e("../Common/Utils.js"),s=e("../Boots/RainLoopApp.js"),o=e("../Storages/WebMailDataStorage.js");this.googleEnable=o.googleEnable,this.googleActions=o.googleActions,this.googleLoggined=o.googleLoggined,this.googleUserName=o.googleUserName,this.facebookEnable=o.facebookEnable,this.facebookActions=o.facebookActions,this.facebookLoggined=o.facebookLoggined,this.facebookUserName=o.facebookUserName,this.twitterEnable=o.twitterEnable,this.twitterActions=o.twitterActions,this.twitterLoggined=o.twitterLoggined,this.twitterUserName=o.twitterUserName,this.connectGoogle=t.createCommand(this,function(){this.googleLoggined()||s.googleConnect()},function(){return!this.googleLoggined()&&!this.googleActions()}),this.disconnectGoogle=t.createCommand(this,function(){s.googleDisconnect()}),this.connectFacebook=t.createCommand(this,function(){this.facebookLoggined()||s.facebookConnect()},function(){return!this.facebookLoggined()&&!this.facebookActions()}),this.disconnectFacebook=t.createCommand(this,function(){s.facebookDisconnect()}),this.connectTwitter=t.createCommand(this,function(){this.twitterLoggined()||s.twitterConnect()},function(){return!this.twitterLoggined()&&!this.twitterActions()}),this.disconnectTwitter=t.createCommand(this,function(){s.twitterDisconnect()})}t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Utils.js":14,"../Storages/WebMailDataStorage.js":74}],65:[function(e,t){!function(t){"use strict";function s(){var e=this;this.mainTheme=c.mainTheme,this.themesObjects=n.observableArray([]),this.themeTrigger=n.observable(r.SaveSettingsStep.Idle).extend({throttle:100}),this.oLastAjax=null,this.iTimer=0,c.theme.subscribe(function(t){_.each(this.themesObjects(),function(e){e.selected(t===e.name)});var s=i("#rlThemeLink"),n=i("#rlThemeStyle"),l=s.attr("href");l||(l=n.attr("data-href")),l&&(l=l.toString().replace(/\/-\/[^\/]+\/\-\//,"/-/"+t+"/-/"),l=l.toString().replace(/\/Css\/[^\/]+\/User\//,"/Css/0/User/"),"Json/"!==l.substring(l.length-5,l.length)&&(l+="Json/"),o.clearTimeout(e.iTimer),e.themeTrigger(r.SaveSettingsStep.Animate),this.oLastAjax&&this.oLastAjax.abort&&this.oLastAjax.abort(),this.oLastAjax=i.ajax({url:l,dataType:"json"}).done(function(t){t&&a.isArray(t)&&2===t.length&&(!s||!s[0]||n&&n[0]||(n=i(''),s.after(n),s.remove()),n&&n[0]&&(n.attr("data-href",l).attr("data-theme",t[0]),n&&n[0]&&n[0].styleSheet&&!a.isUnd(n[0].styleSheet.cssText)?n[0].styleSheet.cssText=t[1]:n.text(t[1])),e.themeTrigger(r.SaveSettingsStep.TrueResult))}).always(function(){e.iTimer=o.setTimeout(function(){e.themeTrigger(r.SaveSettingsStep.Idle)},1e3),e.oLastAjax=null})),u.saveSettings(null,{Theme:t})},this)}var o=e("../External/window.js"),i=e("../External/jquery.js"),n=e("../External/ko.js"),r=e("../Common/Enums.js"),a=e("../Common/Utils.js"),l=e("../Common/LinkBuilder.js"),c=e("../Storages/WebMailDataStorage.js"),u=e("../Storages/WebMailAjaxRemoteStorage.js");s.prototype.onBuild=function(){var e=c.theme();this.themesObjects(_.map(c.themes(),function(t){return{name:t,nameDisplay:a.convertThemeName(t),selected:n.observable(t===e),themePreviewSrc:l.themePreviewLink(t)}}))},t.exports=s}(t)},{"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/jquery.js":26,"../External/ko.js":28,"../External/window.js":32,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailDataStorage.js":74}],66:[function(e,t){!function(t){"use strict";function s(){this.oRequests={}}var o=e("../External/window.js"),i=e("../External/jquery.js"),n=e("../Common/Consts.js"),r=e("../Common/Enums.js"),a=e("../Common/Globals.js"),l=e("../Common/Utils.js"),c=e("../Common/Plugins.js"),u=e("../Common/LinkBuilder.js"),d=e("./AppSettings.js");s.prototype.oRequests={},s.prototype.defaultResponse=function(e,t,s,i,u,d){var p=function(){r.StorageResultType.Success!==s&&a.bUnload&&(s=r.StorageResultType.Unload),r.StorageResultType.Success===s&&i&&!i.Result?(i&&-1(new o.Date).getTime()-h),g&&a.oRequests[g]&&(a.oRequests[g].__aborted&&(i="abort"),a.oRequests[g]=null),a.defaultResponse(e,g,i,s,n,t)}),g&&00?(this.defaultRequest(e,"Message",{},null,"Message/"+a.urlsafe_encode([t,s,u.projectHash(),u.threading()&&u.useThreads()?"1":"0"].join(String.fromCharCode(0))),["Message"]),!0):!1},s.prototype.composeUploadExternals=function(e,t){this.defaultRequest(e,"ComposeUploadExternals",{Externals:t},999e3)},s.prototype.composeUploadDrive=function(e,t,s){this.defaultRequest(e,"ComposeUploadDrive",{AccessToken:s,Url:t},999e3)},s.prototype.folderInformation=function(e,t,s){var n=!0,a=[];i.isArray(s)&&0=e?1:e},this),this.mainMessageListSearch=r.computed({read:this.messageListSearch,write:function(e){b.setHash(m.mailBox(this.currentFolderFullNameHash(),1,h.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(n.debounce(function(e){n.each(e,function(e){e.newForAnimation()&&e.newForAnimation(!1)})},500)),this.staticMessageList=new S,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?d.Layout.NoPreview===this.layout()&&this.message.focused(!0):(this.message.focused(!1),this.messageFullScreenMode(!1),this.hideMessageBodies(),d.Layout.NoPreview===this.layout()&&-10?o.Math.ceil(t/e*100):0},this),this.capaOpenPGP=r.observable(!1),this.openpgpkeys=r.observableArray([]),this.openpgpKeyring=null,this.openpgpkeysPublic=this.openpgpkeys.filter(function(e){return!(!e||e.isPrivate)}),this.openpgpkeysPrivate=this.openpgpkeys.filter(function(e){return!(!e||!e.isPrivate)}),this.googleActions=r.observable(!1),this.googleLoggined=r.observable(!1),this.googleUserName=r.observable(""),this.facebookActions=r.observable(!1),this.facebookLoggined=r.observable(!1),this.facebookUserName=r.observable(""),this.twitterActions=r.observable(!1),this.twitterLoggined=r.observable(!1),this.twitterUserName=r.observable(""),this.customThemeType=r.observable(d.CustomThemeType.Light),this.purgeMessageBodyCacheThrottle=n.throttle(this.purgeMessageBodyCache,3e4)}var o=e("../External/window.js"),i=e("../External/jquery.js"),n=e("../External/underscore.js"),r=e("../External/ko.js"),a=e("../External/moment.js"),l=e("../External/$div.js"),c=e("../External/NotificationClass.js"),u=e("../Common/Consts.js"),d=e("../Common/Enums.js"),p=e("../Common/Globals.js"),h=e("../Common/Utils.js"),m=e("../Common/LinkBuilder.js"),g=e("./AppSettings.js"),f=e("./WebMailCacheStorage.js"),b=e("../Knoin/Knoin.js"),S=e("../Models/MessageModel.js"),y=e("./LocalStorage.js"),v=e("./AbstractData.js");n.extend(s.prototype,v.prototype),s.prototype.purgeMessageBodyCache=function(){var e=0,t=null,s=p.iMessageBodyCacheCount-u.Values.MessageBodyCacheLimit;s>0&&(t=this.messagesBodiesDom(),t&&(t.find(".rl-cache-class").each(function(){var t=i(this);s>t.data("rl-cache-count")&&(t.addClass("rl-cache-purge"),e++)}),e>0&&n.delay(function(){t.find(".rl-cache-purge").remove()},300)))},s.prototype.populateDataOnStart=function(){v.prototype.populateDataOnStart.call(this),this.accountEmail(g.settingsGet("Email")),this.accountIncLogin(g.settingsGet("IncLogin")),this.accountOutLogin(g.settingsGet("OutLogin")),this.projectHash(g.settingsGet("ProjectHash")),this.defaultIdentityID(g.settingsGet("DefaultIdentityID")),this.displayName(g.settingsGet("DisplayName")),this.replyTo(g.settingsGet("ReplyTo")),this.signature(g.settingsGet("Signature")),this.signatureToAll(!!g.settingsGet("SignatureToAll")),this.enableTwoFactor(!!g.settingsGet("EnableTwoFactor")),this.lastFoldersHash=y.get(d.ClientSideKeyName.FoldersLashHash)||"",this.remoteSuggestions=!!g.settingsGet("RemoteSuggestions"),this.devEmail=g.settingsGet("DevEmail"),this.devPassword=g.settingsGet("DevPassword")},s.prototype.initUidNextAndNewMessages=function(e,t,s){if("INBOX"===e&&h.isNormal(t)&&""!==t){if(h.isArray(s)&&03)l(m.notificationMailIcon(),this.accountEmail(),h.i18n("MESSAGE_LIST/NEW_MESSAGE_NOTIFICATION",{COUNT:a}));else for(;a>r;r++)l(m.notificationMailIcon(),S.emailsToLine(S.initEmailsFromJson(s[r].From),!1),s[r].Subject)}f.setFolderUidNext(e,t)}},s.prototype.hideMessageBodies=function(){var e=this.messagesBodiesDom();e&&e.find(".b-text-part").hide()},s.prototype.getNextFolderNames=function(e){e=h.isUnd(e)?!1:!!e;var t=[],s=10,o=a().unix(),i=o-300,r=[],l=function(t){n.each(t,function(t){t&&"INBOX"!==t.fullNameRaw&&t.selectable&&t.existen&&i>t.interval&&(!e||t.subScribed())&&r.push([t.interval,t.fullNameRaw]),t&&0t[0]?1:0}),n.find(r,function(e){var i=f.getFolderFromCacheList(e[1]);return i&&(i.interval=o,t.push(e[1])),s<=t.length}),n.uniq(t)},s.prototype.removeMessagesFromList=function(e,t,s,o){s=h.isNormal(s)?s:"",o=h.isUnd(o)?!1:!!o,t=n.map(t,function(e){return h.pInt(e)});var i=this,r=0,a=this.messageList(),l=f.getFolderFromCacheList(e),c=""===s?null:f.getFolderFromCacheList(s||""),u=this.currentFolderFullNameRaw(),d=this.message(),p=u===e?n.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)),0').hide().addClass("rl-cache-class"),r.data("rl-cache-count",++p.iMessageBodyCacheCount),h.isNormal(e.Result.Html)&&""!==e.Result.Html?(s=!0,u=e.Result.Html.toString()):h.isNormal(e.Result.Plain)&&""!==e.Result.Plain?(s=!1,u=h.plainToHtml(e.Result.Plain.toString(),!1),(S.isPgpSigned()||S.isPgpEncrypted())&&this.capaOpenPGP()&&(S.plainRaw=h.pString(e.Result.Plain),g=/---BEGIN PGP MESSAGE---/.test(S.plainRaw),g||(m=/-----BEGIN PGP SIGNED MESSAGE-----/.test(S.plainRaw)&&/-----BEGIN PGP SIGNATURE-----/.test(S.plainRaw)),l.empty(),m&&S.isPgpSigned()?u=l.append(i('').text(S.plainRaw)).html():g&&S.isPgpEncrypted()&&(u=l.append(i('').text(S.plainRaw)).html()),l.empty(),S.isPgpSigned(m),S.isPgpEncrypted(g))):s=!1,r.html(h.linkify(u)).addClass("b-text-part "+(s?"html":"plain")),S.isHtml(!!s),S.hasImages(!!o),S.pgpSignedVerifyStatus(d.SignedVerifyStatus.None),S.pgpSignedVerifyUser(""),S.body=r,S.body&&b.append(S.body),S.storeDataToDom(),n&&S.showInternalImages(!0),S.hasImages()&&this.showImages()&&S.showExternalImages(!0),this.purgeMessageBodyCacheThrottle()),this.messageActiveDom(S.body),this.hideMessageBodies(),S.body.show(),r&&h.initBlockquoteSwitcher(r)),f.initMessageFlagsFromCache(S),S.unseen()&&p.__RL&&p.__RL.setMessageSeen(S),h.windowResize())},s.prototype.calculateMessageListHash=function(e){return n.map(e,function(e){return""+e.hash+"_"+e.threadsLen()+"_"+e.flagHash()}).join("|")},s.prototype.findPublicKeyByHex=function(e){return n.find(this.openpgpkeysPublic(),function(t){return t&&e===t.id})},s.prototype.findPublicKeysByEmail=function(e){return n.compact(n.map(this.openpgpkeysPublic(),function(t){var s=null;if(t&&e===t.email)try{if(s=o.openpgp.key.readArmored(t.armor),s&&!s.err&&s.keys&&s.keys[0])return s.keys[0]}catch(i){}return null}))},s.prototype.findPrivateKeyByEmail=function(e,t){var s=null,i=n.find(this.openpgpkeysPrivate(),function(t){return t&&e===t.email});if(i)try{s=o.openpgp.key.readArmored(i.armor),s&&!s.err&&s.keys&&s.keys[0]?(s=s.keys[0],s.decrypt(h.pString(t))):s=null}catch(r){s=null}return s},s.prototype.findSelfPrivateKey=function(e){return this.findPrivateKeyByEmail(this.accountEmail(),e)},t.exports=new s}(t)},{"../Common/Consts.js":6,"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/$div.js":15,"../External/NotificationClass.js":22,"../External/jquery.js":26,"../External/ko.js":28,"../External/moment.js":29,"../External/underscore.js":31,"../External/window.js":32,"../Knoin/Knoin.js":33,"../Models/MessageModel.js":48,"./AbstractData.js":67,"./AppSettings.js":68,"./LocalStorage.js":69,"./WebMailCacheStorage.js":73}],75:[function(e,t){!function(t){"use strict";function s(){f.call(this,"Right","SystemDropDown"),this.accounts=d.accounts,this.accountEmail=d.accountEmail,this.accountsLoading=d.accountsLoading,this.accountMenuDropdownTrigger=i.observable(!1),this.capaAdditionalAccounts=u.capa(a.Capa.AdditionalAccounts),this.loading=i.computed(function(){return this.accountsLoading()},this),this.accountClick=o.bind(this.accountClick,this)}var o=e("../External/underscore.js"),i=e("../External/ko.js"),n=e("../External/window.js"),r=e("../External/key.js"),a=e("../Common/Enums.js"),l=e("../Common/Utils.js"),c=e("../Common/LinkBuilder.js"),u=e("../Storages/AppSettings.js"),d=e("../Storages/WebMailDataStorage.js"),p=e("../Storages/WebMailAjaxRemoteStorage.js"),h=e("../ViewModels/Popups/PopupsKeyboardShortcutsHelpViewModel.js"),m=e("../ViewModels/Popups/PopupsKeyboardShortcutsHelpViewModel.js"),g=e("../Knoin/Knoin.js"),f=e("../Knoin/KnoinAbstractViewModel.js");o.extend(s.prototype,f.prototype),s.prototype.accountClick=function(e,t){if(e&&t&&!l.isUnd(t.which)&&1===t.which){var s=this;this.accountsLoading(!0),o.delay(function(){s.accountsLoading(!1)},1e3)}return!0},s.prototype.emailTitle=function(){return d.accountEmail()},s.prototype.settingsClick=function(){g.setHash(c.settings())},s.prototype.settingsHelp=function(){g.showScreenPopup(h)},s.prototype.addAccountClick=function(){this.capaAdditionalAccounts&&g.showScreenPopup(m)},s.prototype.logoutClick=function(){var t=e("../Boots/RainLoopApp.js");p.logout(function(){n.__rlah_clear&&n.__rlah_clear(),t.loginAndLogoutReload(!0,u.settingsGet("ParentEmail")&&0-1&&a.eq(n).removeClass("focused"),38===r&&n>0?n--:40===r&&no)?(this.oContentScrollable.scrollTop(s.top<0?this.oContentScrollable.scrollTop()+s.top-e:this.oContentScrollable.scrollTop()+s.top-o+n+e),!0):!1},s.prototype.messagesDrop=function(t,s){if(t&&s&&s.helper){var o=e("../Boots/RainLoopApp.js"),i=s.helper.data("rl-folder"),n=a.hasClass("rl-ctrl-key-pressed"),r=s.helper.data("rl-uids");l.isNormal(i)&&""!==i&&l.isArray(r)&&o.moveMessagesToFolder(i,r,t.fullNameRaw,n)}},s.prototype.composeClick=function(){S.showScreenPopup(g)},s.prototype.createFolder=function(){S.showScreenPopup(f)},s.prototype.configureFolders=function(){S.setHash(d.settings("folders"))},s.prototype.contactsClick=function(){this.allowContacts&&S.showScreenPopup(b)},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/$html.js":17,"../External/jquery.js":26,"../External/key.js":27,"../External/ko.js":28,"../External/window.js":32,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractViewModel.js":36,"../Storages/AppSettings.js":68,"../Storages/WebMailCacheStorage.js":73,"../Storages/WebMailDataStorage.js":74,"./Popups/PopupsComposeViewModel.js":86,"./Popups/PopupsContactsViewModel.js":87,"./Popups/PopupsFolderCreateViewModel.js":90}],78:[function(e,t){!function(t){"use strict";function s(){var t=e("../Boots/RainLoopApp.js");C.call(this,"Right","MailMessageList"),this.sLastUid=null,this.bPrefetch=!1,this.emptySubjectValue="",this.hideDangerousActions=!!f.settingsGet("HideDangerousActions"),this.popupVisibility=d.popupVisibility,this.message=S.message,this.messageList=S.messageList,this.folderList=S.folderList,this.currentMessage=S.currentMessage,this.isMessageSelected=S.isMessageSelected,this.messageListSearch=S.messageListSearch,this.messageListError=S.messageListError,this.folderMenuForMove=S.folderMenuForMove,this.useCheckboxesInList=S.useCheckboxesInList,this.mainMessageListSearch=S.mainMessageListSearch,this.messageListEndFolder=S.messageListEndFolder,this.messageListChecked=S.messageListChecked,this.messageListCheckedOrSelected=S.messageListCheckedOrSelected,this.messageListCheckedOrSelectedUidsWithSubMails=S.messageListCheckedOrSelectedUidsWithSubMails,this.messageListCompleteLoadingThrottle=S.messageListCompleteLoadingThrottle,p.initOnStartOrLangChange(function(){this.emptySubjectValue=p.i18n("MESSAGE_LIST/EMPTY_SUBJECT_TEXT")},this),this.userQuota=S.userQuota,this.userUsageSize=S.userUsageSize,this.userUsageProc=S.userUsageProc,this.moveDropdownTrigger=n.observable(!1),this.moreDropdownTrigger=n.observable(!1),this.dragOver=n.observable(!1).extend({throttle:1}),this.dragOverEnter=n.observable(!1).extend({throttle:1}),this.dragOverArea=n.observable(null),this.dragOverBodyArea=n.observable(null),this.messageListItemTemplate=n.computed(function(){return c.Layout.NoPreview!==S.layout()?"MailMessageListItem":"MailMessageListItemNoPreviewPane"}),this.messageListSearchDesc=n.computed(function(){var e=S.messageListEndSearch();return""===e?"":p.i18n("MESSAGE_LIST/SEARCH_RESULT_FOR",{SEARCH:e})}),this.messageListPagenator=n.computed(p.computedPagenatorHelper(S.messageListPage,S.messageListPageCount)),this.checkAll=n.computed({read:function(){return 00&&t>0&&e>t},this),this.hasMessages=n.computed(function(){return 01?" ("+(100>e?e:"99+")+")":""},s.prototype.cancelSearch=function(){this.mainMessageListSearch(""),this.inputMessageListSearchFocus(!1)},s.prototype.moveSelectedMessagesToFolder=function(e,t){return this.canBeMoved()&&RL.moveMessagesToFolder(S.currentFolderFullNameRaw(),S.messageListCheckedOrSelectedUidsWithSubMails(),e,t),!1},s.prototype.dragAndDronHelper=function(e){e&&e.checked(!0);var t=p.draggeblePlace(),s=S.messageListCheckedOrSelectedUidsWithSubMails();return t.data("rl-folder",S.currentFolderFullNameRaw()),t.data("rl-uids",s),t.find(".text").text(""+s.length),i.defer(function(){var e=S.messageListCheckedOrSelectedUidsWithSubMails();t.data("rl-uids",e),t.find(".text").text(""+e.length)}),t},s.prototype.onMessageResponse=function(e,t,s){S.hideMessageBodies(),S.messageLoading(!1),c.StorageResultType.Success===e&&t&&t.Result?S.setMessage(t,s):c.StorageResultType.Unload===e?(S.message(null),S.messageError("")):c.StorageResultType.Abort!==e&&(S.message(null),S.messageError(p.getNotification(t&&t.ErrorCode?t.ErrorCode:c.Notification.UnknownError)))},s.prototype.populateMessageBody=function(e){e&&(y.message(this.onMessageResponse,e.folderFullNameRaw,e.uid)?S.messageLoading(!0):p.log("Error: Unknown message request: "+e.folderFullNameRaw+" ~ "+e.uid+" [e-101]"))},s.prototype.setAction=function(e,t,s){var o=[],n=null,r=0;if(p.isUnd(s)&&(s=S.messageListChecked()),o=i.map(s,function(e){return e.uid}),""!==e&&00?100>e?e:"99+":""},s.prototype.verifyPgpSignedClearMessage=function(e){e&&e.verifyPgpSignedClearMessage()},s.prototype.decryptPgpEncryptedMessage=function(e){e&&e.decryptPgpEncryptedMessage(this.viewPgpPassword())},s.prototype.readReceipt=function(t){if(t&&""!==t.readReceipt()){m.sendReadReceiptMessage(u.emptyFunction,t.folderFullNameRaw,t.uid,t.readReceipt(),u.i18n("READ_RECEIPT/SUBJECT",{SUBJECT:t.subject()}),u.i18n("READ_RECEIPT/BODY",{"READ-RECEIPT":h.accountEmail()})),t.isReadReceipt(!0),p.storeMessageFlagsToCache(t);var s=e("../Boots/RainLoopApp.js");s.reloadFlagsCurrentMessageListAndMessageFromCache()}},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Consts.js":6,"../Common/Enums.js":7,"../Common/Events.js":8,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/$html.js":17,"../External/jquery.js":26,"../External/key.js":27,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractViewModel.js":36,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailCacheStorage.js":73,"../Storages/WebMailDataStorage.js":74,"./Popups/PopupsComposeViewModel.js":86}],80:[function(e,t){!function(t){"use strict";function s(){i.call(this),o.constructorEnd(this)}var o=e("../Knoin/Knoin.js"),i=e("./AbstractSystemDropDownViewModel.js");o.extendAsViewModel("MailBoxSystemDropDownViewModel",s,i),t.exports=s}(t)},{"../Knoin/Knoin.js":33,"./AbstractSystemDropDownViewModel.js":75}],81:[function(e,t){!function(t){"use strict";function s(){c.call(this,"Popups","PopupsAddAccount");var t=e("../../Boots/RainLoopApp.js");this.email=i.observable(""),this.password=i.observable(""),this.emailError=i.observable(!1),this.passwordError=i.observable(!1),this.email.subscribe(function(){this.emailError(!1)},this),this.password.subscribe(function(){this.passwordError(!1)},this),this.submitRequest=i.observable(!1),this.submitError=i.observable(""),this.emailFocus=i.observable(!1),this.addAccountCommand=r.createCommand(this,function(){return this.emailError(""===r.trim(this.email())),this.passwordError(""===r.trim(this.password())),this.emailError()||this.passwordError()?!1:(this.submitRequest(!0),a.accountAdd(o.bind(function(e,s){this.submitRequest(!1),n.StorageResultType.Success===e&&s&&"AccountAdd"===s.Action?s.Result?(t.accountsAndIdentities(),this.cancelCommand()):s.ErrorCode&&this.submitError(r.getNotification(s.ErrorCode)):this.submitError(r.getNotification(n.Notification.UnknownError))},this),this.email(),"",this.password()),!0)},function(){return!this.submitRequest()}),l.constructorEnd(this)}var o=e("../../External/underscore.js"),i=e("../../External/ko.js"),n=e("../../Common/Enums.js"),r=e("../../Common/Utils.js"),a=e("../../Storages/WebMailAjaxRemoteStorage.js"),l=e("../../Knoin/Knoin.js"),c=e("../../Knoin/KnoinAbstractViewModel.js");l.extendAsViewModel("PopupsAddAccountViewModel",s),s.prototype.clearPopup=function(){this.email(""),this.password(""),this.emailError(!1),this.passwordError(!1),this.submitRequest(!1),this.submitError("")},s.prototype.onShow=function(){this.clearPopup()},s.prototype.onFocus=function(){this.emailFocus(!0)},t.exports=s}(t)},{"../../Boots/RainLoopApp.js":4,"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../External/underscore.js":31,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailAjaxRemoteStorage.js":72}],82:[function(e,t){!function(t){"use strict";function s(){a.call(this,"Popups","PopupsAddOpenPgpKey");var t=e("../../Boots/RainLoopApp.js");this.key=o.observable(""),this.key.error=o.observable(!1),this.key.focus=o.observable(!1),this.key.subscribe(function(){this.key.error(!1)},this),this.addOpenPgpKeyCommand=i.createCommand(this,function(){var e=30,s=null,o=i.trim(this.key()),r=/[\-]{3,6}BEGIN[\s]PGP[\s](PRIVATE|PUBLIC)[\s]KEY[\s]BLOCK[\-]{3,6}[\s\S]+?[\-]{3,6}END[\s]PGP[\s](PRIVATE|PUBLIC)[\s]KEY[\s]BLOCK[\-]{3,6}/gi,a=n.openpgpKeyring;if(o=o.replace(/[\r\n]([a-zA-Z0-9]{2,}:[^\r\n]+)[\r\n]+([a-zA-Z0-9\/\\+=]{10,})/g,"\n$1!-!N!-!$2").replace(/[\n\r]+/g,"\n").replace(/!-!N!-!/g,"\n\n"),this.key.error(""===o),!a||this.key.error())return!1;for(;;){if(s=r.exec(o),!s||0>e)break;s[0]&&s[1]&&s[2]&&s[1]===s[2]&&("PRIVATE"===s[1]?a.privateKeys.importKey(s[0]):"PUBLIC"===s[1]&&a.publicKeys.importKey(s[0])),e--}return a.store(),t.reloadOpenPgpKeys(),i.delegateRun(this,"cancelCommand"),!0}),r.constructorEnd(this)}var o=e("../../External/ko.js"),i=e("../../Common/Utils.js"),n=e("../../Storages/WebMailDataStorage.js"),r=e("../../Knoin/Knoin.js"),a=e("../../Knoin/KnoinAbstractViewModel.js");r.extendAsViewModel("PopupsAddOpenPgpKeyViewModel",s),s.prototype.clearPopup=function(){this.key(""),this.key.error(!1)},s.prototype.onShow=function(){this.clearPopup()},s.prototype.onFocus=function(){this.key.focus(!0)},t.exports=s}(t)},{"../../Boots/RainLoopApp.js":4,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailDataStorage.js":74}],83:[function(e,t){!function(t){"use strict";function s(){l.call(this,"Popups","PopupsAdvancedSearch"),this.fromFocus=o.observable(!1),this.from=o.observable(""),this.to=o.observable(""),this.subject=o.observable(""),this.text=o.observable(""),this.selectedDateValue=o.observable(-1),this.hasAttachment=o.observable(!1),this.starred=o.observable(!1),this.unseen=o.observable(!1),this.searchCommand=n.createCommand(this,function(){var e=this.buildSearchString();""!==e&&r.mainMessageListSearch(e),this.cancelCommand()}),a.constructorEnd(this)}var o=e("../../External/ko.js"),i=e("../../External/moment.js"),n=e("../../Common/Utils.js"),r=e("../../Storages/WebMailDataStorage.js"),a=e("../../Knoin/Knoin.js"),l=e("../../Knoin/KnoinAbstractViewModel.js");a.extendAsViewModel("PopupsAdvancedSearchViewModel",s),s.prototype.buildSearchStringValue=function(e){return-1"},s.prototype.sendMessageResponse=function(e,t){var s=!1,i="";this.sending(!1),u.StorageResultType.Success===e&&t&&t.Result&&(s=!0,this.modalVisibility()&&p.delegateRun(this,"closeCommand")),this.modalVisibility()&&!s&&(t&&u.Notification.CantSaveMessage===t.ErrorCode?(this.sendSuccessButSaveError(!0),o.alert(p.trim(p.i18n("COMPOSE/SAVED_ERROR_ON_SEND")))):(i=p.getNotification(t&&t.ErrorCode?t.ErrorCode:u.Notification.CantSendMessage,t&&t.ErrorMessage?t.ErrorMessage:""),this.sendError(!0),o.alert(i||p.getNotification(u.Notification.CantSendMessage)))),this.reloadDraftFolder()},s.prototype.saveMessageResponse=function(e,t){var s=!1,i=null;this.saving(!1),u.StorageResultType.Success===e&&t&&t.Result&&t.Result.NewFolder&&t.Result.NewUid&&(this.bFromDraft&&(i=S.message(),i&&this.draftFolder()===i.folderFullNameRaw&&this.draftUid()===i.uid&&S.message(null)),this.draftFolder(t.Result.NewFolder),this.draftUid(t.Result.NewUid),this.modalVisibility()&&(this.savedTime(o.Math.round((new o.Date).getTime()/1e3)),this.savedOrSendingText(0"+e;break;default:e=e+"
"+s}return e},s.prototype.editor=function(e){if(e){var t=this;!this.oEditor&&this.composeEditorArea()?n.delay(function(){t.oEditor=new f(t.composeEditorArea(),null,function(){e(t.oEditor)},function(e){t.isHtml(!!e)})},300):this.oEditor&&e(this.oEditor)}},s.prototype.onShow=function(e,t,s,o,r){j.routeOff();var a=this,l="",c="",d="",h="",m="",g=null,f=null,b="",y="",C=[],w={},E=S.accountEmail(),A=S.signature(),T=S.signatureToAll(),F=[],M=null,N=null,R=e||u.ComposeType.Empty,L=function(e,t){for(var s=0,o=e.length,i=[];o>s;s++)i.push(e[s].toLine(!!t));return i.join(", ")};if(t=t||null,t&&p.isNormal(t)&&(N=p.isArray(t)&&1===t.length?t[0]:p.isArray(t)?null:t),null!==E&&(w[E]=!0),this.currentIdentityID(this.findIdentityIdByMessage(R,N)),this.reset(),p.isNonEmptyArray(s)&&this.to(L(s)),""!==R&&N){switch(h=N.fullFormatDateValue(),m=N.subject(),M=N.aDraftInfo,g=i(N.body).clone(),p.removeBlockquoteSwitcher(g),f=g.find("[data-html-editor-font-wrapper=true]"),b=f&&f[0]?f.html():g.html(),R){case u.ComposeType.Empty:break;case u.ComposeType.Reply:this.to(L(N.replyEmails(w))),this.subject(p.replySubjectAdd("Re",m)),this.prepearMessageAttachments(N,R),this.aDraftInfo=["reply",N.uid,N.folderFullNameRaw],this.sInReplyTo=N.sMessageId,this.sReferences=p.trim(this.sInReplyTo+" "+N.sReferences);break;case u.ComposeType.ReplyAll:C=N.replyAllEmails(w),this.to(L(C[0])),this.cc(L(C[1])),this.subject(p.replySubjectAdd("Re",m)),this.prepearMessageAttachments(N,R),this.aDraftInfo=["reply",N.uid,N.folderFullNameRaw],this.sInReplyTo=N.sMessageId,this.sReferences=p.trim(this.sInReplyTo+" "+N.references());break;case u.ComposeType.Forward:this.subject(p.replySubjectAdd("Fwd",m)),this.prepearMessageAttachments(N,R),this.aDraftInfo=["forward",N.uid,N.folderFullNameRaw],this.sInReplyTo=N.sMessageId,this.sReferences=p.trim(this.sInReplyTo+" "+N.sReferences);break;case u.ComposeType.ForwardAsAttachment:this.subject(p.replySubjectAdd("Fwd",m)),this.prepearMessageAttachments(N,R),this.aDraftInfo=["forward",N.uid,N.folderFullNameRaw],this.sInReplyTo=N.sMessageId,this.sReferences=p.trim(this.sInReplyTo+" "+N.sReferences);break;case u.ComposeType.Draft:this.to(L(N.to)),this.cc(L(N.cc)),this.bcc(L(N.bcc)),this.bFromDraft=!0,this.draftFolder(N.folderFullNameRaw),this.draftUid(N.uid),this.subject(m),this.prepearMessageAttachments(N,R),this.aDraftInfo=p.isNonEmptyArray(M)&&3===M.length?M:null,this.sInReplyTo=N.sInReplyTo,this.sReferences=N.sReferences;break;case u.ComposeType.EditAsNew:this.to(L(N.to)),this.cc(L(N.cc)),this.bcc(L(N.bcc)),this.subject(m),this.prepearMessageAttachments(N,R),this.aDraftInfo=p.isNonEmptyArray(M)&&3===M.length?M:null,this.sInReplyTo=N.sInReplyTo,this.sReferences=N.sReferences}switch(R){case u.ComposeType.Reply:case u.ComposeType.ReplyAll:l=N.fromToLine(!1,!0),y=p.i18n("COMPOSE/REPLY_MESSAGE_TITLE",{DATETIME:h,EMAIL:l}),b="
"+y+":"+b+"
";break;case u.ComposeType.Forward:l=N.fromToLine(!1,!0),c=N.toToLine(!1,!0),d=N.ccToLine(!1,!0),b="
"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TITLE")+"
"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_FROM")+": "+l+"
"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TO")+": "+c+(0"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_CC")+": "+d:"")+"
"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SENT")+": "+p.encodeHtml(h)+"
"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SUBJECT")+": "+p.encodeHtml(m)+"
"+b;break;case u.ComposeType.ForwardAsAttachment:b=""}T&&""!==A&&u.ComposeType.EditAsNew!==R&&u.ComposeType.Draft!==R&&(b=this.convertSignature(A,L(N.from,!0),b,R)),this.editor(function(e){e.setHtml(b,!1),N.isHtml()||e.modeToggle(!1)})}else u.ComposeType.Empty===R?(this.subject(p.isNormal(o)?""+o:""),b=p.isNormal(r)?""+r:"",T&&""!==A&&(b=this.convertSignature(A,"",p.convertPlainTextToHtml(b),R)),this.editor(function(e){e.setHtml(b,!1),u.EditorDefaultType.Html!==S.editorDefaultType()&&e.modeToggle(!1)})):p.isNonEmptyArray(t)&&n.each(t,function(e){a.addMessageAsAttachment(e)});F=this.getAttachmentsDownloadsForUpload(),p.isNonEmptyArray(F)&&v.messageUploadAttachments(function(e,t){if(u.StorageResultType.Success===e&&t&&t.Result){var s=null,o="";if(!a.viewModelVisibility())for(o in t.Result)t.Result.hasOwnProperty(o)&&(s=a.getAttachmentById(t.Result[o]),s&&s.tempName(o))}else a.setMessageAttachmentFailedDowbloadText()},F),this.triggerForResize()},s.prototype.onFocus=function(){""===this.to()?this.to.focusTrigger(!this.to.focusTrigger()):this.oEditor&&this.oEditor.focus(),this.triggerForResize()},s.prototype.editorResize=function(){this.oEditor&&this.oEditor.resize()},s.prototype.tryToClosePopup=function(){var e=this;j.isPopupVisible(A)||j.showScreenPopup(A,[p.i18n("POPUPS_ASK/DESC_WANT_CLOSE_THIS_WINDOW"),function(){e.modalVisibility()&&p.delegateRun(e,"closeCommand")}])},s.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}),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}),l.on("resize",function(){e.triggerForResize()}),this.dropboxEnabled()&&(t=o.document.createElement("script"),t.type="text/javascript",t.src="https://www.dropbox.com/static/api/1/dropins.js",i(t).attr("id","dropboxjs").attr("data-app-key",b.settingsGet("DropboxApiKey")),o.document.body.appendChild(t)),this.driveEnabled()&&i.getScript("https://apis.google.com/js/api.js",function(){o.gapi&&e.driveVisible(!0)})},s.prototype.driveCallback=function(e,t){if(t&&o.XMLHttpRequest&&o.google&&t[o.google.picker.Response.ACTION]===o.google.picker.Action.PICKED&&t[o.google.picker.Response.DOCUMENTS]&&t[o.google.picker.Response.DOCUMENTS][0]&&t[o.google.picker.Response.DOCUMENTS][0].id){var s=this,i=new o.XMLHttpRequest;i.open("GET","https://www.googleapis.com/drive/v2/files/"+t[o.google.picker.Response.DOCUMENTS][0].id),i.setRequestHeader("Authorization","Bearer "+e),i.addEventListener("load",function(){if(i&&i.responseText){var t=c.parse(i.responseText),o=function(e,t,s){e&&e.exportLinks&&(e.exportLinks[t]?(e.downloadUrl=e.exportLinks[t],e.title=e.title+"."+s,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":o(t,"application/vnd.openxmlformats-officedocument.wordprocessingml.document","docx");break;case"application/vnd.google-apps.spreadsheet":o(t,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","xlsx");break;case"application/vnd.google-apps.drawing":o(t,"image/png","png");break;case"application/vnd.google-apps.presentation":o(t,"application/vnd.openxmlformats-officedocument.presentationml.presentation","pptx");break;default:o(t,"application/pdf","pdf")}t&&t.downloadUrl&&s.addDriveAttachment(t,e)}}),i.send()}},s.prototype.driveCreatePiker=function(e){if(o.gapi&&e&&e.access_token){var t=this;o.gapi.load("picker",{callback:function(){if(o.google&&o.google.picker){var s=(new o.google.picker.PickerBuilder).addView((new o.google.picker.DocsView).setIncludeFolders(!0)).setAppId(b.settingsGet("GoogleClientID")).setOAuthToken(e.access_token).setCallback(n.bind(t.driveCallback,t,e.access_token)).enableFeature(o.google.picker.Feature.NAV_HIDDEN).build();s.setVisible(!0)}}})}},s.prototype.driveOpenPopup=function(){if(o.gapi){var e=this;o.gapi.load("auth",{callback:function(){var t=o.gapi.auth.getToken();t?e.driveCreatePiker(t):o.gapi.auth.authorize({client_id:b.settingsGet("GoogleClientID"),scope:"https://www.googleapis.com/auth/drive.readonly",immediate:!0},function(t){if(t&&!t.error){var s=o.gapi.auth.getToken();s&&e.driveCreatePiker(s)}else o.gapi.auth.authorize({client_id:b.settingsGet("GoogleClientID"),scope:"https://www.googleapis.com/auth/drive.readonly",immediate:!1},function(t){if(t&&!t.error){var s=o.gapi.auth.getToken();s&&e.driveCreatePiker(s)}})})}})}},s.prototype.getAttachmentById=function(e){for(var t=this.attachments(),s=0,o=t.length;o>s;s++)if(t[s]&&e===t[s].id)return t[s];return null},s.prototype.initUploader=function(){if(this.composeUploaderButton()){var e={},t=p.pInt(b.settingsGet("AttachmentLimit")),s=new Jua({action:m.upload(),name:"uploader",queueSize:2,multipleSizeLimit:50,disableFolderDragAndDrop:!1,clickElement:this.composeUploaderButton(),dragAndDropElement:this.composeUploaderDropPlace()});s?(s.on("onDragEnter",n.bind(function(){this.dragAndDropOver(!0)},this)).on("onDragLeave",n.bind(function(){this.dragAndDropOver(!1)},this)).on("onBodyDragEnter",n.bind(function(){this.dragAndDropVisible(!0)},this)).on("onBodyDragLeave",n.bind(function(){this.dragAndDropVisible(!1)},this)).on("onProgress",n.bind(function(t,s,i){var n=null;p.isUnd(e[t])?(n=this.getAttachmentById(t),n&&(e[t]=n)):n=e[t],n&&n.progress(" - "+o.Math.floor(s/i*100)+"%")},this)).on("onSelect",n.bind(function(e,o){this.dragAndDropOver(!1);var i=this,n=p.isUnd(o.FileName)?"":o.FileName.toString(),r=p.isNormal(o.Size)?p.pInt(o.Size):null,a=new C(e,n,r);return a.cancel=function(e){return function(){i.attachments.remove(function(t){return t&&t.id===e}),s&&s.cancel(e)}}(e),this.attachments.push(a),r>0&&t>0&&r>t?(a.error(p.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):!0},this)).on("onStart",n.bind(function(t){var s=null;p.isUnd(e[t])?(s=this.getAttachmentById(t),s&&(e[t]=s)):s=e[t],s&&(s.waiting(!1),s.uploading(!0))},this)).on("onComplete",n.bind(function(t,s,o){var i="",n=null,r=null,a=this.getAttachmentById(t);r=s&&o&&o.Result&&o.Result.Attachment?o.Result.Attachment:null,n=o&&o.Result&&o.Result.ErrorCode?o.Result.ErrorCode:null,null!==n?i=p.getUploadErrorDescByCode(n):r||(i=p.i18n("UPLOAD/ERROR_UNKNOWN")),a&&(""!==i&&00&&i>0&&n>i?(s.uploading(!1),s.error(p.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(v.composeUploadExternals(function(e,t){var o=!1;s.uploading(!1),u.StorageResultType.Success===e&&t&&t.Result&&t.Result[s.id]&&(o=!0,s.tempName(t.Result[s.id])),o||s.error(p.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},[e.link]),!0)},s.prototype.addDriveAttachment=function(e,t){var s=this,o=function(e){return function(){s.attachments.remove(function(t){return t&&t.id===e})}},i=p.pInt(b.settingsGet("AttachmentLimit")),n=null,r=e.fileSize?p.pInt(e.fileSize):0;return n=new C(e.downloadUrl,e.title,r),n.fromMessage=!1,n.cancel=o(e.downloadUrl),n.waiting(!1).uploading(!0),this.attachments.push(n),r>0&&i>0&&r>i?(n.uploading(!1),n.error(p.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(v.composeUploadDrive(function(e,t){var s=!1;n.uploading(!1),u.StorageResultType.Success===e&&t&&t.Result&&t.Result[n.id]&&(s=!0,n.tempName(t.Result[n.id][0]),n.size(p.pInt(t.Result[n.id][1]))),s||n.error(p.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},e.downloadUrl,t),!0)},s.prototype.prepearMessageAttachments=function(e,t){if(e){var s=this,o=p.isNonEmptyArray(e.attachments())?e.attachments():[],i=0,n=o.length,r=null,a=null,l=!1,c=function(e){return function(){s.attachments.remove(function(t){return t&&t.id===e})}};if(u.ComposeType.ForwardAsAttachment===t)this.addMessageAsAttachment(e);else for(;n>i;i++){switch(a=o[i],l=!1,t){case u.ComposeType.Reply:case u.ComposeType.ReplyAll:l=a.isLinked;break;case u.ComposeType.Forward:case u.ComposeType.Draft:case u.ComposeType.EditAsNew:l=!0}l&&(r=new C(a.download,a.fileName,a.estimatedSize,a.isInline,a.isLinked,a.cid,a.contentLocation),r.fromMessage=!0,r.cancel=c(a.download),r.waiting(!1).uploading(!0),this.attachments.push(r))}}},s.prototype.removeLinkedAttachments=function(){this.attachments.remove(function(e){return e&&e.isLinked})},s.prototype.setMessageAttachmentFailedDowbloadText=function(){n.each(this.attachments(),function(e){e&&e.fromMessage&&e.waiting(!1).uploading(!1).error(p.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},this)},s.prototype.isEmptyForm=function(e){e=p.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())},s.prototype.reset=function(){this.to(""),this.cc(""),this.bcc(""),this.replyTo(""),this.subject(""),this.requestReadReceipt(!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.showCcAndBcc(!1),this.attachments([]),this.dragAndDropOver(!1),this.dragAndDropVisible(!1),this.draftFolder(""),this.draftUid(""),this.sending(!1),this.saving(!1),this.oEditor&&this.oEditor.clear(!1)},s.prototype.getAttachmentsDownloadsForUpload=function(){return n.map(n.filter(this.attachments(),function(e){return e&&""===e.tempName()}),function(e){return e.id})},s.prototype.triggerForResize=function(){this.resizer(!this.resizer()),this.editorResizeThrottle()},t.exports=s}(t)},{"../../Boots/RainLoopApp.js":4,"../../Common/Consts.js":6,"../../Common/Enums.js":7,"../../Common/Events.js":8,"../../Common/Globals.js":9,"../../Common/LinkBuilder.js":10,"../../Common/NewHtmlEditorWrapper.js":11,"../../Common/Utils.js":14,"../../External/$window.js":18,"../../External/JSON.js":20,"../../External/jquery.js":26,"../../External/ko.js":28,"../../External/moment.js":29,"../../External/underscore.js":31,"../../External/window.js":32,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Models/ComposeAttachmentModel.js":39,"../../Storages/AppSettings.js":68,"../../Storages/WebMailAjaxRemoteStorage.js":72,"../../Storages/WebMailCacheStorage.js":73,"../../Storages/WebMailDataStorage.js":74,"./PopupsAskViewModel.js":84,"./PopupsComposeOpenPgpViewModel.js":85,"./PopupsFolderSystemViewModel.js":91}],87:[function(e,t){!function(t){"use strict";function s(){w.call(this,"Popups","PopupsContacts");var t=this,i=function(e){e&&0=e?1:e},this),this.contactsPagenator=r.computed(d.computedPagenatorHelper(this.contactsPage,this.contactsPageCount)),this.emptySelection=r.observable(!0),this.viewClearSearch=r.observable(!1),this.viewID=r.observable(""),this.viewReadOnly=r.observable(!1),this.viewProperties=r.observableArray([]),this.viewTags=r.observable(""),this.viewTags.visibility=r.observable(!1),this.viewTags.focusTrigger=r.observable(!1),this.viewTags.focusTrigger.subscribe(function(e){e||""!==this.viewTags()?e&&this.viewTags.visibility(!0):this.viewTags.visibility(!1)},this),this.viewSaveTrigger=r.observable(l.SaveSettingsStep.Idle),this.viewPropertiesNames=this.viewProperties.filter(function(e){return-1=o&&(this.bDropPageAfterDelete=!0),n.delay(function(){n.each(i,function(e){t.remove(e)})},500))},s.prototype.deleteSelectedContacts=function(){00?o:0),d.isNonEmptyArray(s.Result.Tags)&&(r=n.map(s.Result.Tags,function(e){var t=new S;return t.parse(e)?t:null}),r=n.compact(r))),t.contactsCount(o),t.contacts(i),t.contacts.loading(!1),t.contactTags(r),t.viewClearSearch(""!==t.search())},s,c.Defaults.ContactsPerPage,this.search())},s.prototype.onBuild=function(e){this.oContentVisible=i(".b-list-content",e),this.oContentScrollable=i(".content",this.oContentVisible),this.selector.init(this.oContentVisible,this.oContentScrollable,l.KeyState.ContactList);var t=this;a("delete",l.KeyState.ContactList,function(){return t.deleteCommand(),!1}),e.on("click",".e-pagenator .e-page",function(){var e=r.dataFor(this);e&&(t.contactsPage(d.pInt(e.value)),t.reloadContactList())}),this.initUploader()},s.prototype.onShow=function(){C.routeOff(),this.reloadContactList(!0)},s.prototype.onHide=function(){C.routeOn(),this.currentContact(null),this.emptySelection(!0),this.search(""),this.contactsCount(0),this.contacts([])},t.exports=s}(t)},{"../../Boots/RainLoopApp.js":4,"../../Common/Consts.js":6,"../../Common/Enums.js":7,"../../Common/Globals.js":9,"../../Common/LinkBuilder.js":10,"../../Common/Selector.js":13,"../../Common/Utils.js":14,"../../External/jquery.js":26,"../../External/key.js":27,"../../External/ko.js":28,"../../External/underscore.js":31,"../../External/window.js":32,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Models/ContactModel.js":40,"../../Models/ContactPropertyModel.js":41,"../../Models/ContactTagModel.js":42,"../../Models/EmailModel.js":43,"../../Storages/WebMailAjaxRemoteStorage.js":72,"../../Storages/WebMailDataStorage.js":74,"./PopupsComposeViewModel.js":86}],88:[function(e,t){!function(t){"use strict";function s(){l.call(this,"Popups","PopupsFilter"),this.filter=o.observable(null),this.selectedFolderValue=o.observable(i.Values.UnuseOptionValue),this.folderSelectList=r.folderMenuForMove,this.defautOptionsAfterRender=n.defautOptionsAfterRender,a.constructorEnd(this)}var o=e("../../External/ko.js"),i=e("../../Common/Consts.js"),n=e("../../Common/Utils.js"),r=e("../../Storages/WebMailDataStorage.js"),a=e("../../Knoin/Knoin.js"),l=e("../../Knoin/KnoinAbstractViewModel.js");a.extendAsViewModel("PopupsFilterViewModel",s),s.prototype.clearPopup=function(){},s.prototype.onShow=function(e){this.clearPopup(),this.filter(e)},t.exports=s}(t)},{"../../Common/Consts.js":6,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailDataStorage.js":74}],89:[function(e,t){!function(t){"use strict";function s(){u.call(this,"Popups","PopupsFolderClear");var t=e("../../Boots/RainLoopApp.js");this.selectedFolder=o.observable(null),this.clearingProcess=o.observable(!1),this.clearingError=o.observable(""),this.folderFullNameForClear=o.computed(function(){var e=this.selectedFolder();return e?e.printableFullName():""},this),this.folderNameForClear=o.computed(function(){var e=this.selectedFolder();return e?e.localName():""},this),this.dangerDescHtml=o.computed(function(){return n.i18n("POPUPS_CLEAR_FOLDER/DANGER_DESC_HTML_1",{FOLDER:this.folderNameForClear()})},this),this.clearCommand=n.createCommand(this,function(){var e=this,s=this.selectedFolder();s&&(r.message(null),r.messageList([]),this.clearingProcess(!0),a.setFolderHash(s.fullNameRaw,""),l.folderClear(function(s,o){e.clearingProcess(!1),i.StorageResultType.Success===s&&o&&o.Result?(t.reloadMessageList(!0),e.cancelCommand()):e.clearingError(o&&o.ErrorCode?n.getNotification(o.ErrorCode):n.getNotification(i.Notification.MailServerError))},s.fullNameRaw))},function(){var e=this.selectedFolder(),t=this.clearingProcess();return!t&&null!==e}),c.constructorEnd(this)}var o=e("../../External/ko.js"),i=e("../../Common/Enums.js"),n=e("../../Common/Utils.js"),r=e("../../Storages/WebMailDataStorage.js"),a=e("../../Storages/WebMailCacheStorage.js"),l=e("../../Storages/WebMailAjaxRemoteStorage.js"),c=e("../../Knoin/Knoin.js"),u=e("../../Knoin/KnoinAbstractViewModel.js");c.extendAsViewModel("PopupsFolderClearViewModel",s),s.prototype.clearPopup=function(){this.clearingProcess(!1),this.selectedFolder(null)},s.prototype.onShow=function(e){this.clearPopup(),e&&this.selectedFolder(e)},t.exports=s}(t)},{"../../Boots/RainLoopApp.js":4,"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailAjaxRemoteStorage.js":72,"../../Storages/WebMailCacheStorage.js":73,"../../Storages/WebMailDataStorage.js":74}],90:[function(e,t){!function(t){"use strict";function s(){u.call(this,"Popups","PopupsFolderCreate"),r.initOnStartOrLangChange(function(){this.sNoParentText=r.i18n("POPUPS_CREATE_FOLDER/SELECT_NO_PARENT")},this),this.folderName=o.observable(""),this.folderName.focused=o.observable(!1),this.selectedParentValue=o.observable(n.Values.UnuseOptionValue),this.parentFolderSelectList=o.computed(function(){var e=[],t=null,s=null,o=a.folderList(),i=function(e){return e?e.isSystemFolder()?e.name()+" "+e.manageFolderSystemName():e.name():""};return e.push(["",this.sNoParentText]),""!==a.namespace&&(t=function(e){return a.namespace!==e.fullNameRaw.substr(0,a.namespace.length)}),r.folderListOptionsBuilder([],o,[],e,null,t,s,i)},this),this.createFolder=r.createCommand(this,function(){var t=e("../../Boots/RainLoopApp.js"),s=this.selectedParentValue();""===s&&1"),this.submitRequest(!0),i.delay(function(){n=o.openpgp.generateKeyPair({userId:s,numBits:r.pInt(e.keyBitLength()),passphrase:r.trim(e.password())}),n&&n.privateKeyArmored&&(l.privateKeys.importKey(n.privateKeyArmored),l.publicKeys.importKey(n.publicKeyArmored),l.store(),t.reloadOpenPgpKeys(),r.delegateRun(e,"cancelCommand")),e.submitRequest(!1)},100),!0)}),l.constructorEnd(this)}var o=e("../../External/window.js"),i=e("../../External/underscore.js"),n=e("../../External/ko.js"),r=e("../../Common/Utils.js"),a=e("../../Storages/WebMailDataStorage.js"),l=e("../../Knoin/Knoin.js"),c=e("../../Knoin/KnoinAbstractViewModel.js");l.extendAsViewModel("PopupsGenerateNewOpenPgpKeyViewModel",s),s.prototype.clearPopup=function(){this.name(""),this.password(""),this.email(""),this.email.error(!1),this.keyBitLength(2048)
},s.prototype.onShow=function(){this.clearPopup()},s.prototype.onFocus=function(){this.email.focus(!0)},t.exports=s}(t)},{"../../Boots/RainLoopApp.js":4,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../External/underscore.js":31,"../../External/window.js":32,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailDataStorage.js":74}],93:[function(e,t){!function(t){"use strict";function s(){c.call(this,"Popups","PopupsIdentity");var t=e("../../Boots/RainLoopApp.js");this.id="",this.edit=o.observable(!1),this.owner=o.observable(!1),this.email=o.observable("").validateEmail(),this.email.focused=o.observable(!1),this.name=o.observable(""),this.name.focused=o.observable(!1),this.replyTo=o.observable("").validateSimpleEmail(),this.replyTo.focused=o.observable(!1),this.bcc=o.observable("").validateSimpleEmail(),this.bcc.focused=o.observable(!1),this.submitRequest=o.observable(!1),this.submitError=o.observable(""),this.addOrEditIdentityCommand=n.createCommand(this,function(){return this.email.hasError()||this.email.hasError(""===n.trim(this.email())),this.email.hasError()?(this.owner()||this.email.focused(!0),!1):this.replyTo.hasError()?(this.replyTo.focused(!0),!1):this.bcc.hasError()?(this.bcc.focused(!0),!1):(this.submitRequest(!0),a.identityUpdate(_.bind(function(e,s){this.submitRequest(!1),i.StorageResultType.Success===e&&s?s.Result?(t.accountsAndIdentities(),this.cancelCommand()):s.ErrorCode&&this.submitError(n.getNotification(s.ErrorCode)):this.submitError(n.getNotification(i.Notification.UnknownError))},this),this.id,this.email(),this.name(),this.replyTo(),this.bcc()),!0)},function(){return!this.submitRequest()}),this.label=o.computed(function(){return n.i18n("POPUPS_IDENTITIES/"+(this.edit()?"TITLE_UPDATE_IDENTITY":"TITLE_ADD_IDENTITY"))},this),this.button=o.computed(function(){return n.i18n("POPUPS_IDENTITIES/"+(this.edit()?"BUTTON_UPDATE_IDENTITY":"BUTTON_ADD_IDENTITY"))},this),r.constructorEnd(this)}var o=e("../../External/ko.js"),i=e("../../Common/Enums.js"),n=e("../../Common/Utils.js"),r=e("../../Knoin/Knoin.js"),a=e("../../Storages/WebMailAjaxRemoteStorage.js"),l=e("../../Storages/WebMailDataStorage.js"),c=e("../../Knoin/KnoinAbstractViewModel.js");r.extendAsViewModel("PopupsIdentityViewModel",s),s.prototype.clearPopup=function(){this.id="",this.edit(!1),this.owner(!1),this.name(""),this.email(""),this.replyTo(""),this.bcc(""),this.email.hasError(!1),this.replyTo.hasError(!1),this.bcc.hasError(!1),this.submitRequest(!1),this.submitError("")},s.prototype.onShow=function(e){this.clearPopup(),e&&(this.edit(!0),this.id=e.id,this.name(e.name()),this.email(e.email()),this.replyTo(e.replyTo()),this.bcc(e.bcc()),this.owner(this.id===l.accountEmail()))},s.prototype.onFocus=function(){this.owner()||this.email.focused(!0)},t.exports=s}(t)},{"../../Boots/RainLoopApp.js":4,"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailAjaxRemoteStorage.js":72,"../../Storages/WebMailDataStorage.js":74}],94:[function(e,t){!function(t){"use strict";function s(){a.call(this,"Popups","PopupsKeyboardShortcutsHelp"),this.sDefaultKeyScope=n.KeyState.PopupKeyboardShortcutsHelp,r.constructorEnd(this)}var o=e("../../External/underscore.js"),i=e("../../External/key.js"),n=e("../../Common/Enums.js"),r=e("../../Knoin/Knoin.js"),a=e("../../Knoin/KnoinAbstractViewModel.js");r.extendAsViewModel("PopupsKeyboardShortcutsHelpViewModel",s),s.prototype.onBuild=function(e){i("tab, shift+tab, left, right",n.KeyState.PopupKeyboardShortcutsHelp,o.bind(function(t,s){if(t&&s){var o=e.find(".nav.nav-tabs > li"),i=s&&("tab"===s.shortcut||"right"===s.shortcut),n=o.index(o.filter(".active"));return!i&&n>0?n--:i&&n