snappymail/rainloop/v/0.0.0/static/js/app.min.js
2014-08-31 00:37:36 +04:00

10 lines
307 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

!function e(t,i,s){function o(a,r){if(!i[a]){if(!t[a]){var l="function"==typeof require&&require;if(!r&&l)return l(a,!0);if(n)return n(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=i[a]={exports:{}};t[a][0].call(u.exports,function(e){var i=t[a][1][e];return o(i?i:e)},u,u.exports,e,t,i,s)}return i[a].exports}for(var n="function"==typeof require&&require,a=0;a<s.length;a++)o(s[a]);return o}({1:[function(e){!function(e){"use strict";e("App:Boot")(e("App:RainLoop"))}(e)},{"App:Boot":4,"App:RainLoop":3}],2:[function(e,t){!function(e,t){"use strict";function i(e){g.call(this),this.isLocalAutocomplete=!0,this.iframe=s('<iframe style="display:none" src="javascript:;" />').appendTo("body"),r.on("error",function(t){t&&t.originalEvent&&t.originalEvent.message&&-1===u.inArray(t.originalEvent.message,["Script error.","Uncaught Error: Error calling method on NPObject."])&&e.jsError(u.emptyFunction,t.originalEvent.message,t.originalEvent.filename,t.originalEvent.lineno,n.location&&n.location.toString?n.location.toString():"",a.attr("class"),u.microtime()-c.now)}),l.on("keydown",function(e){e&&e.ctrlKey&&a.addClass("rl-ctrl-key-pressed")}).on("keyup",function(e){e&&!e.ctrlKey&&a.removeClass("rl-ctrl-key-pressed")})}var s=t("$"),o=t("_"),n=t("window"),a=t("$html"),r=t("$win"),l=t("$doc"),c=t("Globals"),u=t("Utils"),d=t("LinkBuilder"),p=t("Events"),h=t("Storage:Settings"),g=t("Knoin:AbstractBoot");o.extend(i.prototype,g.prototype),i.prototype.remote=function(){return null},i.prototype.data=function(){return null},i.prototype.setupSettings=function(){return!0},i.prototype.download=function(e){var t=null,i=null,s=n.navigator.userAgent.toLowerCase();return s&&(s.indexOf("chrome")>-1||s.indexOf("chrome")>-1)&&(i=n.document.createElement("a"),i.href=e,n.document.createEvent&&(t=n.document.createEvent("MouseEvents"),t&&t.initEvent&&i.dispatchEvent))?(t.initEvent("click",!0,!0),i.dispatchEvent(t),!0):(c.bMobileDevice?(n.open(e,"_self"),n.focus()):this.iframe.attr("src",e),!0)},i.prototype.setTitle=function(e){e=(u.isNormal(e)&&0<e.length?e+" - ":"")+h.settingsGet("Title")||"",n.document.title="_",n.document.title=e},i.prototype.loginAndLogoutReload=function(e,i){var s=t("App:Knoin"),a=u.pString(h.settingsGet("CustomLogoutLink")),r=!!h.settingsGet("InIframe");e=u.isUnd(e)?!1:!!e,i=u.isUnd(i)?!1:!!i,e&&i&&n.close&&n.close(),e&&""!==a&&n.location.href!==a?o.delay(function(){r&&n.parent?n.parent.location.href=a:n.location.href=a},100):(s.routeOff(),s.setHash(d.root(),!0),s.routeOff(),o.delay(function(){r&&n.parent?n.parent.location.reload():n.location.reload()},100))},i.prototype.historyBack=function(){n.history.back()},i.prototype.bootstart=function(){p.pub("rl.bootstart");var e=t("ssm");u.initOnStartOrLangChange(function(){u.initNotificationLanguage()},null),o.delay(function(){u.windowResize()},1e3),e.addState({id:"mobile",maxWidth:767,onEnter:function(){a.addClass("ssm-state-mobile"),p.pub("ssm.mobile-enter")},onLeave:function(){a.removeClass("ssm-state-mobile"),p.pub("ssm.mobile-leave")}}),e.addState({id:"tablet",minWidth:768,maxWidth:999,onEnter:function(){a.addClass("ssm-state-tablet")},onLeave:function(){a.removeClass("ssm-state-tablet")}}),e.addState({id:"desktop",minWidth:1e3,maxWidth:1400,onEnter:function(){a.addClass("ssm-state-desktop")},onLeave:function(){a.removeClass("ssm-state-desktop")}}),e.addState({id:"desktop-large",minWidth:1400,onEnter:function(){a.addClass("ssm-state-desktop-large")},onLeave:function(){a.removeClass("ssm-state-desktop-large")}}),p.sub("ssm.mobile-enter",function(){c.leftPanelDisabled(!0)}),p.sub("ssm.mobile-leave",function(){c.leftPanelDisabled(!1)}),c.leftPanelDisabled.subscribe(function(e){a.toggleClass("rl-left-panel-disabled",e)}),e.ready()},e.exports=i}(t,e)},{$:26,$doc:16,$html:17,$win:18,"App:Knoin":33,Events:8,Globals:9,"Knoin:AbstractBoot":34,LinkBuilder:11,"Storage:Settings":75,Utils:14,_:31,ssm:30,window:32}],3:[function(e,t){!function(e,t){"use strict";function i(){R.call(this,y),this.oMoveCache={},this.quotaDebounce=n.debounce(this.quota,3e4),this.moveOrDeleteResponseHelper=n.bind(this.moveOrDeleteResponseHelper,this),this.messagesMoveTrigger=n.debounce(this.messagesMoveTrigger,500),s.setInterval(function(){h.pub("interval.30s")},3e4),s.setInterval(function(){h.pub("interval.1m")},6e4),s.setInterval(function(){h.pub("interval.2m")},12e4),s.setInterval(function(){h.pub("interval.3m")},18e4),s.setInterval(function(){h.pub("interval.5m")},3e5),s.setInterval(function(){h.pub("interval.10m")},6e5),s.setTimeout(function(){s.setInterval(function(){h.pub("interval.10m-after5m")},6e5)},3e5),o.wakeUp(function(){y.jsVersion(function(e,t){r.StorageResultType.Success===e&&t&&!t.Result&&(s.parent&&f.settingsGet("InIframe")?s.parent.location.reload():s.location.reload())},f.settingsGet("Version"))},{},36e5),this.socialUsers=n.bind(this.socialUsers,this)}var s=t("window"),o=t("$"),n=t("_"),a=t("moment"),r=t("Enums"),l=t("Globals"),c=t("Consts"),u=t("Plugins"),d=t("Utils"),p=t("LinkBuilder"),h=t("Events"),g=t("App:Knoin"),m=t("Storage:LocalStorage"),f=t("Storage:Settings"),b=t("Storage:RainLoop:Data"),S=t("Storage:RainLoop:Cache"),y=t("Storage:RainLoop:Remote"),v=t("Model:Email"),w=t("Model:Folder"),C=t("Model:Message"),A=t("Model:Account"),T=t("Model:Identity"),F=t("Model:OpenPgpKey"),R=t("App:Abstract");n.extend(i.prototype,R.prototype),i.prototype.remote=function(){return y},i.prototype.data=function(){return b},i.prototype.setupSettings=function(){return g.addSettingsViewModel(t("Settings:RainLoop:General"),"SettingsGeneral","SETTINGS_LABELS/LABEL_GENERAL_NAME","general",!0),f.settingsGet("ContactsIsAllowed")&&g.addSettingsViewModel(t("Settings:RainLoop:Contacts"),"SettingsContacts","SETTINGS_LABELS/LABEL_CONTACTS_NAME","contacts"),f.capa(r.Capa.AdditionalAccounts)&&g.addSettingsViewModel(t("Settings:RainLoop:Accounts"),"SettingsAccounts","SETTINGS_LABELS/LABEL_ACCOUNTS_NAME","accounts"),f.capa(r.Capa.AdditionalIdentities)?g.addSettingsViewModel(t("Settings:RainLoop:Identities"),"SettingsIdentities","SETTINGS_LABELS/LABEL_IDENTITIES_NAME","identities"):g.addSettingsViewModel(t("Settings:RainLoop:Identity"),"SettingsIdentity","SETTINGS_LABELS/LABEL_IDENTITY_NAME","identity"),f.capa(r.Capa.Filters)&&g.addSettingsViewModel(t("Settings:RainLoop:Filters"),"SettingsFilters","SETTINGS_LABELS/LABEL_FILTERS_NAME","filters"),f.capa(r.Capa.TwoFactor)&&g.addSettingsViewModel(t("Settings:RainLoop:Security"),"SettingsSecurity","SETTINGS_LABELS/LABEL_SECURITY_NAME","security"),(f.settingsGet("AllowGoogleSocial")||f.settingsGet("AllowFacebookSocial")||f.settingsGet("AllowTwitterSocial"))&&g.addSettingsViewModel(t("Settings:RainLoop:Social"),"SettingsSocial","SETTINGS_LABELS/LABEL_SOCIAL_NAME","social"),f.settingsGet("ChangePasswordIsAllowed")&&g.addSettingsViewModel(t("Settings:RainLoop:ChangePassword"),"SettingsChangePassword","SETTINGS_LABELS/LABEL_CHANGE_PASSWORD_NAME","change-password"),g.addSettingsViewModel(t("Settings:RainLoop:Folders"),"SettingsFolders","SETTINGS_LABELS/LABEL_FOLDERS_NAME","folders"),f.capa(r.Capa.Themes)&&g.addSettingsViewModel(t("Settings:RainLoop:Themes"),"SettingsThemes","SETTINGS_LABELS/LABEL_THEMES_NAME","themes"),f.capa(r.Capa.OpenPGP)&&g.addSettingsViewModel(t("Settings:RainLoop:OpenPGP"),"SettingsOpenPGP","SETTINGS_LABELS/LABEL_OPEN_PGP_NAME","openpgp"),!0},i.prototype.reloadFlagsCurrentMessageListAndMessageFromCache=function(){n.each(b.messageList(),function(e){S.initMessageFlagsFromCache(e)}),S.initMessageFlagsFromCache(b.message())},i.prototype.reloadMessageList=function(e,t){var i=this,s=(b.messageListPage()-1)*b.messagesPerPage();(d.isUnd(t)?1:!t)||S.setFolderHash(b.currentFolderFullNameRaw(),""),(d.isUnd(e)?1:!e)||(b.messageListPage(1),s=0),b.messageListLoading(!0),y.messageList(function(e,t,s){r.StorageResultType.Success===e&&t&&t.Result?(b.messageListError(""),b.messageListLoading(!1),i.setMessageList(t,s)):r.StorageResultType.Unload===e?(b.messageListError(""),b.messageListLoading(!1)):r.StorageResultType.Abort!==e&&(b.messageList([]),b.messageListLoading(!1),b.messageListError(t&&t.ErrorCode?d.getNotification(t.ErrorCode):d.i18n("NOTIFICATIONS/CANT_GET_MESSAGE_LIST")))},b.currentFolderFullNameRaw(),s,b.messagesPerPage(),b.messageListSearch())},i.prototype.recacheInboxMessageList=function(){y.messageList(d.emptyFunction,"INBOX",0,b.messagesPerPage(),"",!0)},i.prototype.reloadMessageListHelper=function(e){this.reloadMessageList(e)},i.prototype.contactsSync=function(e){var t=b.contacts;return t.importing()||t.syncing()||!b.enableContactsSync()||!b.allowContactsSync()?!1:(t.syncing(!0),y.contactsSync(function(i,s){t.syncing(!1),e&&e(i,s)}),!0)},i.prototype.messagesMoveTrigger=function(){var e=this,t=b.spamFolder();n.each(this.oMoveCache,function(i){var s=t===i.To,o=!s&&t===i.From&&"INBOX"===i.To;y.messagesMove(e.moveOrDeleteResponseHelper,i.From,i.To,i.Uid,s?"SPAM":o?"HAM":"")}),this.oMoveCache={}},i.prototype.messagesMoveHelper=function(e,t,i){var s="$$"+e+"$$"+t+"$$";this.oMoveCache[s]||(this.oMoveCache[s]={From:e,To:t,Uid:[]}),this.oMoveCache[s].Uid=n.union(this.oMoveCache[s].Uid,i),this.messagesMoveTrigger()},i.prototype.messagesCopyHelper=function(e,t,i){y.messagesCopy(this.moveOrDeleteResponseHelper,e,t,i)},i.prototype.messagesDeleteHelper=function(e,t){y.messagesDelete(this.moveOrDeleteResponseHelper,e,t)},i.prototype.moveOrDeleteResponseHelper=function(e,t){r.StorageResultType.Success===e&&b.currentFolder()&&(t&&d.isArray(t.Result)&&2===t.Result.length?S.setFolderHash(t.Result[0],t.Result[1]):(S.setFolderHash(b.currentFolderFullNameRaw(),""),t&&-1<d.inArray(t.ErrorCode,[r.Notification.CantMoveMessage,r.Notification.CantCopyMessage])&&s.alert(d.getNotification(t.ErrorCode))),this.reloadMessageListHelper(0===b.messageList().length),this.quotaDebounce())},i.prototype.deleteMessagesFromFolderWithoutCheck=function(e,t){this.messagesDeleteHelper(e,t),b.removeMessagesFromList(e,t)},i.prototype.deleteMessagesFromFolder=function(e,i,s,o){var n=this,a=null,l=null;switch(e){case r.FolderType.Spam:a=S.getFolderFromCacheList(b.spamFolder()),l=r.SetSystemFoldersNotification.Spam;break;case r.FolderType.NotSpam:a=S.getFolderFromCacheList("INBOX");break;case r.FolderType.Trash:a=S.getFolderFromCacheList(b.trashFolder()),l=r.SetSystemFoldersNotification.Trash;break;case r.FolderType.Archive:a=S.getFolderFromCacheList(b.archiveFolder()),l=r.SetSystemFoldersNotification.Archive}o=d.isUnd(o)?!0:!!o,o&&(r.FolderType.Spam===e&&c.Values.UnuseOptionValue===b.spamFolder()||r.FolderType.Trash===e&&c.Values.UnuseOptionValue===b.trashFolder()||r.FolderType.Archive===e&&c.Values.UnuseOptionValue===b.archiveFolder())&&(o=!1),!a&&o?g.showScreenPopup(t("View:Popup:FolderSystem"),[l]):o&&(r.FolderType.Trash!==e||i!==b.spamFolder()&&i!==b.trashFolder())?a&&(this.messagesMoveHelper(i,a.fullNameRaw,s),b.removeMessagesFromList(i,s,a.fullNameRaw)):g.showScreenPopup(t("View:Popup:Ask"),[d.i18n("POPUPS_ASK/DESC_WANT_DELETE_MESSAGES"),function(){n.messagesDeleteHelper(i,s),b.removeMessagesFromList(i,s)}])},i.prototype.moveMessagesToFolder=function(e,t,i,s){if(e!==i&&d.isArray(t)&&0<t.length){var o=S.getFolderFromCacheList(e),n=S.getFolderFromCacheList(i);if(o&&n)return(d.isUnd(s)?1:!s)?this.messagesMoveHelper(o.fullNameRaw,n.fullNameRaw,t):this.messagesCopyHelper(o.fullNameRaw,n.fullNameRaw,t),b.removeMessagesFromList(o.fullNameRaw,t,n.fullNameRaw,s),!0}return!1},i.prototype.folders=function(e){b.foldersLoading(!0),y.folders(n.bind(function(t,i){b.foldersLoading(!1),r.StorageResultType.Success===t?(this.setFolders(i),e&&e(!0)):e&&e(!1)},this))},i.prototype.reloadOpenPgpKeys=function(){if(b.capaOpenPGP()){var e=[],t=new v,i=b.openpgpKeyring,s=i?i.getAllKeys():[];n.each(s,function(i,s){if(i&&i.primaryKey){var o=i.getPrimaryUser(),n=o&&o.user?o.user.userId.userid:i.users&&i.users[0]?i.users[0].userId.userid:"";t.clear(),t.mailsoParse(n),t.validate()&&e.push(new F(s,i.primaryKey.getFingerprint(),i.primaryKey.getKeyId().toHex().toLowerCase(),n,t.email,i.isPrivate(),i.armor()))}}),b.openpgpkeys(e)}},i.prototype.accountsAndIdentities=function(){b.accountsLoading(!0),b.identitiesLoading(!0),y.accountsAndIdentities(function(e,t){if(b.accountsLoading(!1),b.identitiesLoading(!1),r.StorageResultType.Success===e&&t.Result){var i=f.settingsGet("ParentEmail"),s=b.accountEmail();i=""===i?s:i,d.isArray(t.Result.Accounts)&&b.accounts(n.map(t.Result.Accounts,function(e){return new A(e,e!==i)})),d.isArray(t.Result.Identities)&&b.identities(n.map(t.Result.Identities,function(e){var t=d.pString(e.Id),i=d.pString(e.Email),o=new T(t,i,t!==s);return o.name(d.pString(e.Name)),o.replyTo(d.pString(e.ReplyTo)),o.bcc(d.pString(e.Bcc)),o}))}})},i.prototype.quota=function(){y.quota(function(e,t){r.StorageResultType.Success===e&&t&&t.Result&&d.isArray(t.Result)&&1<t.Result.length&&d.isPosNumeric(t.Result[0],!0)&&d.isPosNumeric(t.Result[1],!0)&&(b.userQuota(1024*d.pInt(t.Result[1])),b.userUsageSize(1024*d.pInt(t.Result[0])))})},i.prototype.folderInformation=function(e,t){if(""!==d.trim(e)){var i=this;y.folderInformation(function(e,t){if(r.StorageResultType.Success===e&&t&&t.Result&&t.Result.Hash&&t.Result.Folder){var s=a().unix(),o=S.getFolderHash(t.Result.Folder),n=S.getFolderFromCacheList(t.Result.Folder),l=!1,c="",u=[],p=!1,h=null;if(n){if(n.interval=s,t.Result.Hash&&S.setFolderHash(t.Result.Folder,t.Result.Hash),d.isNormal(t.Result.MessageCount)&&n.messageCountAll(t.Result.MessageCount),d.isNormal(t.Result.MessageUnseenCount)&&(d.pInt(n.messageCountUnread())!==d.pInt(t.Result.MessageUnseenCount)&&(p=!0),n.messageCountUnread(t.Result.MessageUnseenCount)),p&&S.clearMessageFlagsFromCacheByFolder(n.fullNameRaw),t.Result.Flags){for(c in t.Result.Flags)t.Result.Flags.hasOwnProperty(c)&&(l=!0,h=t.Result.Flags[c],S.storeMessageFlagsToCacheByFolderAndUid(n.fullNameRaw,c.toString(),[!h.IsSeen,!!h.IsFlagged,!!h.IsAnswered,!!h.IsForwarded,!!h.IsReadReceipt]));l&&i.reloadFlagsCurrentMessageListAndMessageFromCache()}b.initUidNextAndNewMessages(n.fullNameRaw,t.Result.UidNext,t.Result.NewMessages),t.Result.Hash!==o||""===o?n.fullNameRaw===b.currentFolderFullNameRaw()?i.reloadMessageList():"INBOX"===n.fullNameRaw&&i.recacheInboxMessageList():p&&n.fullNameRaw===b.currentFolderFullNameRaw()&&(u=b.messageList(),d.isNonEmptyArray(u)&&i.folderInformation(n.fullNameRaw,u))}}},e,t)}},i.prototype.folderInformationMultiply=function(e){e=d.isUnd(e)?!1:!!e;var t=this,i=a().unix(),s=b.getNextFolderNames(e);d.isNonEmptyArray(s)&&y.folderInformationMultiply(function(s,o){r.StorageResultType.Success===s&&o&&o.Result&&o.Result.List&&d.isNonEmptyArray(o.Result.List)&&(n.each(o.Result.List,function(e){var s=[],o=S.getFolderHash(e.Folder),n=S.getFolderFromCacheList(e.Folder),a=!1;n&&(n.interval=i,e.Hash&&S.setFolderHash(e.Folder,e.Hash),d.isNormal(e.MessageCount)&&n.messageCountAll(e.MessageCount),d.isNormal(e.MessageUnseenCount)&&(d.pInt(n.messageCountUnread())!==d.pInt(e.MessageUnseenCount)&&(a=!0),n.messageCountUnread(e.MessageUnseenCount)),a&&S.clearMessageFlagsFromCacheByFolder(n.fullNameRaw),e.Hash!==o||""===o?n.fullNameRaw===b.currentFolderFullNameRaw()&&t.reloadMessageList():a&&n.fullNameRaw===b.currentFolderFullNameRaw()&&(s=b.messageList(),d.isNonEmptyArray(s)&&t.folderInformation(n.fullNameRaw,s)))}),e&&t.folderInformationMultiply(!0))},s)},i.prototype.setMessageSeen=function(e){if(e.unseen()){e.unseen(!1);var t=S.getFolderFromCacheList(e.folderFullNameRaw);t&&t.messageCountUnread(0<=t.messageCountUnread()-1?t.messageCountUnread()-1:0),S.storeMessageFlagsToCache(e),this.reloadFlagsCurrentMessageListAndMessageFromCache()}y.messageSetSeen(d.emptyFunction,e.folderFullNameRaw,[e.uid],!0)},i.prototype.googleConnect=function(){s.open(p.socialGoogle(),"Google","left=200,top=100,width=650,height=600,menubar=no,status=no,resizable=yes,scrollbars=yes")},i.prototype.twitterConnect=function(){s.open(p.socialTwitter(),"Twitter","left=200,top=100,width=650,height=350,menubar=no,status=no,resizable=yes,scrollbars=yes")},i.prototype.facebookConnect=function(){s.open(p.socialFacebook(),"Facebook","left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes")},i.prototype.socialUsers=function(e){e&&(b.googleActions(!0),b.facebookActions(!0),b.twitterActions(!0)),y.socialUsers(function(e,t){r.StorageResultType.Success===e&&t&&t.Result?(b.googleUserName(t.Result.Google||""),b.facebookUserName(t.Result.Facebook||""),b.twitterUserName(t.Result.Twitter||"")):(b.googleUserName(""),b.facebookUserName(""),b.twitterUserName("")),b.googleLoggined(""!==b.googleUserName()),b.facebookLoggined(""!==b.facebookUserName()),b.twitterLoggined(""!==b.twitterUserName()),b.googleActions(!1),b.facebookActions(!1),b.twitterActions(!1)})},i.prototype.googleDisconnect=function(){b.googleActions(!0),y.googleDisconnect(this.socialUsers)},i.prototype.facebookDisconnect=function(){b.facebookActions(!0),y.facebookDisconnect(this.socialUsers)},i.prototype.twitterDisconnect=function(){b.twitterActions(!0),y.twitterDisconnect(this.socialUsers)},i.prototype.getAutocomplete=function(e,t){var i=[];y.suggestions(function(e,s){r.StorageResultType.Success===e&&s&&d.isArray(s.Result)?(i=n.map(s.Result,function(e){return e&&e[0]?new v(e[0],e[1]):null}),t(n.compact(i))):r.StorageResultType.Abort!==e&&t([])},e)},i.prototype.getContactTagsAutocomplete=function(e,t){t(n.filter(b.contactTags(),function(t){return t&&t.filterHelper(e)}))},i.prototype.setMessageList=function(e,t){if(e&&e.Result&&"Collection/MessageCollection"===e.Result["@Object"]&&e.Result["@Collection"]&&d.isArray(e.Result["@Collection"])){var i=null,o=0,n=0,l=0,c=0,u=[],p=a().unix(),h=b.staticMessageList,g=null,m=null,f=null,y=0,v=!1;for(l=d.pInt(e.Result.MessageResultCount),c=d.pInt(e.Result.Offset),d.isNonEmptyArray(e.Result.LastCollapsedThreadUids)&&(i=e.Result.LastCollapsedThreadUids),f=S.getFolderFromCacheList(d.isNormal(e.Result.Folder)?e.Result.Folder:""),f&&!t&&(f.interval=p,S.setFolderHash(e.Result.Folder,e.Result.FolderHash),d.isNormal(e.Result.MessageCount)&&f.messageCountAll(e.Result.MessageCount),d.isNormal(e.Result.MessageUnseenCount)&&(d.pInt(f.messageCountUnread())!==d.pInt(e.Result.MessageUnseenCount)&&(v=!0),f.messageCountUnread(e.Result.MessageUnseenCount)),b.initUidNextAndNewMessages(f.fullNameRaw,e.Result.UidNext,e.Result.NewMessages)),v&&f&&S.clearMessageFlagsFromCacheByFolder(f.fullNameRaw),o=0,n=e.Result["@Collection"].length;n>o;o++)g=e.Result["@Collection"][o],g&&"Object/Message"===g["@Object"]&&(m=h[o],m&&m.initByJson(g)||(m=C.newInstanceFromJson(g)),m&&(S.hasNewMessageAndRemoveFromCache(m.folderFullNameRaw,m.uid)&&5>=y&&(y++,m.newForAnimation(!0)),m.deleted(!1),t?S.initMessageFlagsFromCache(m):S.storeMessageFlagsToCache(m),m.lastInCollapsedThread(i&&-1<d.inArray(d.pInt(m.uid),i)?!0:!1),u.push(m)));b.messageListCount(l),b.messageListSearch(d.isNormal(e.Result.Search)?e.Result.Search:""),b.messageListPage(s.Math.ceil(c/b.messagesPerPage()+1)),b.messageListEndFolder(d.isNormal(e.Result.Folder)?e.Result.Folder:""),b.messageListEndSearch(d.isNormal(e.Result.Search)?e.Result.Search:""),b.messageListEndPage(b.messageListPage()),b.messageList(u),b.messageListIsNotCompleted(!1),h.length<u.length&&(b.staticMessageList=u),S.clearNewMessageCache(),f&&(t||v||b.useThreads())&&this.folderInformation(f.fullNameRaw,u)}else b.messageListCount(0),b.messageList([]),b.messageListError(d.getNotification(e&&e.ErrorCode?e.ErrorCode:r.Notification.CantGetMessageList))},i.prototype.folderResponseParseRec=function(e,t){var i=this,s=0,o=0,n=null,a=null,r="",l=[],c=[];for(s=0,o=t.length;o>s;s++)n=t[s],n&&(r=n.FullNameRaw,a=S.getFolderFromCacheList(r),a||(a=w.newInstanceFromJson(n),a&&(S.setFolderToCacheList(r,a),S.setFolderFullNameRaw(a.fullNameHash,r))),a&&(a.collapsed(!i.isFolderExpanded(a.fullNameHash)),n.Extended&&(n.Extended.Hash&&S.setFolderHash(a.fullNameRaw,n.Extended.Hash),d.isNormal(n.Extended.MessageCount)&&a.messageCountAll(n.Extended.MessageCount),d.isNormal(n.Extended.MessageUnseenCount)&&a.messageCountUnread(n.Extended.MessageUnseenCount)),l=n.SubFolders,l&&"Collection/FolderCollection"===l["@Object"]&&l["@Collection"]&&d.isArray(l["@Collection"])&&a.subFolders(this.folderResponseParseRec(e,l["@Collection"])),c.push(a)));return c},i.prototype.setFolders=function(e){var t=[],i=!1,s=function(e){return""===e||c.Values.UnuseOptionValue===e||null!==S.getFolderFromCacheList(e)?e:""};e&&e.Result&&"Collection/FolderCollection"===e.Result["@Object"]&&e.Result["@Collection"]&&d.isArray(e.Result["@Collection"])&&(d.isUnd(e.Result.Namespace)||(b.namespace=e.Result.Namespace),b.threading(!!f.settingsGet("UseImapThread")&&e.Result.IsThreadsSupported&&!0),t=this.folderResponseParseRec(b.namespace,e.Result["@Collection"]),b.folderList(t),e.Result.SystemFolders&&""==""+f.settingsGet("SentFolder")+f.settingsGet("DraftFolder")+f.settingsGet("SpamFolder")+f.settingsGet("TrashFolder")+f.settingsGet("ArchiveFolder")+f.settingsGet("NullFolder")&&(f.settingsSet("SentFolder",e.Result.SystemFolders[2]||null),f.settingsSet("DraftFolder",e.Result.SystemFolders[3]||null),f.settingsSet("SpamFolder",e.Result.SystemFolders[4]||null),f.settingsSet("TrashFolder",e.Result.SystemFolders[5]||null),f.settingsSet("ArchiveFolder",e.Result.SystemFolders[12]||null),i=!0),b.sentFolder(s(f.settingsGet("SentFolder"))),b.draftFolder(s(f.settingsGet("DraftFolder"))),b.spamFolder(s(f.settingsGet("SpamFolder"))),b.trashFolder(s(f.settingsGet("TrashFolder"))),b.archiveFolder(s(f.settingsGet("ArchiveFolder"))),i&&y.saveSystemFolders(d.emptyFunction,{SentFolder:b.sentFolder(),DraftFolder:b.draftFolder(),SpamFolder:b.spamFolder(),TrashFolder:b.trashFolder(),ArchiveFolder:b.archiveFolder(),NullFolder:"NullFolder"}),m.set(r.ClientSideKeyName.FoldersLashHash,e.Result.FoldersHash))},i.prototype.isFolderExpanded=function(e){var t=m.get(r.ClientSideKeyName.ExpandedFolders);return n.isArray(t)&&-1!==n.indexOf(t,e)},i.prototype.setExpandedFolder=function(e,t){var i=m.get(r.ClientSideKeyName.ExpandedFolders);n.isArray(i)||(i=[]),t?(i.push(e),i=n.uniq(i)):i=n.without(i,e),m.set(r.ClientSideKeyName.ExpandedFolders,i)},i.prototype.initLayoutResizer=function(e,t,i){var s=60,n=155,a=o(e),r=o(t),l=m.get(i)||null,c=function(e){e&&(a.css({width:""+e+"px"}),r.css({left:""+e+"px"}))},u=function(e){if(e)a.resizable("disable"),c(s);else{a.resizable("enable");var t=d.pInt(m.get(i))||n;c(t>n?t:n)}},p=function(e,t){t&&t.size&&t.size.width&&(m.set(i,t.size.width),r.css({left:""+t.size.width+"px"}))};null!==l&&c(l>n?l:n),a.resizable({helper:"ui-resizable-helper",minWidth:n,maxWidth:350,handles:"e",stop:p}),h.sub("left-panel.off",function(){u(!0)}),h.sub("left-panel.on",function(){u(!1)})},i.prototype.mailToHelper=function(e){if(e&&"mailto:"===e.toString().substr(0,7).toLowerCase()){e=e.toString().substr(7);var i={},o=null,n=e.replace(/\?.+$/,""),a=e.replace(/^[^\?]*\?/,"");return o=new v,o.parse(s.decodeURIComponent(n)),o&&o.email&&(i=d.simpleQueryParser(a),g.showScreenPopup(t("View:Popup:Compose"),[r.ComposeType.Empty,null,[o],d.isUnd(i.subject)?null:d.pString(i.subject),d.isUnd(i.body)?null:d.plainToHtml(d.pString(i.body))])),!0}return!1},i.prototype.bootstartLoginScreen=function(){var e=d.pString(f.settingsGet("CustomLoginLink"));e?(g.routeOff(),g.setHash(p.root(),!0),g.routeOff(),n.defer(function(){s.location.href=e})):(g.hideLoading(),g.startScreens([t("Screen:RainLoop:Login")]),u.runHook("rl-start-login-screens"),h.pub("rl.bootstart-login-screens"))},i.prototype.bootstart=function(){R.prototype.bootstart.call(this),b.populateDataOnStart();var e=this,i=f.settingsGet("JsHash"),a=d.pInt(f.settingsGet("ContactsSyncInterval")),c=f.settingsGet("AllowGoogleSocial"),m=f.settingsGet("AllowFacebookSocial"),S=f.settingsGet("AllowTwitterSocial");d.initOnStartOrLangChange(function(){o.extend(!0,o.magnificPopup.defaults,{tClose:d.i18n("MAGNIFIC_POPUP/CLOSE"),tLoading:d.i18n("MAGNIFIC_POPUP/LOADING"),gallery:{tPrev:d.i18n("MAGNIFIC_POPUP/GALLERY_PREV"),tNext:d.i18n("MAGNIFIC_POPUP/GALLERY_NEXT"),tCounter:d.i18n("MAGNIFIC_POPUP/GALLERY_COUNTER")},image:{tError:d.i18n("MAGNIFIC_POPUP/IMAGE_ERROR")},ajax:{tError:d.i18n("MAGNIFIC_POPUP/AJAX_ERROR")}})},this),s.SimplePace&&(s.SimplePace.set(70),s.SimplePace.sleep()),l.leftPanelDisabled.subscribe(function(e){h.pub("left-panel."+(e?"off":"on"))}),f.settingsGet("Auth")?(this.setTitle(d.i18n("TITLES/LOADING")),this.folders(n.bind(function(i){g.hideLoading(),i?(s.$LAB&&s.crypto&&s.crypto.getRandomValues&&f.capa(r.Capa.OpenPGP)?s.$LAB.script(s.openpgp?"":p.openPgpJs()).wait(function(){s.openpgp&&(b.openpgpKeyring=new s.openpgp.Keyring,b.capaOpenPGP(!0),h.pub("openpgp.init"),e.reloadOpenPgpKeys())}):b.capaOpenPGP(!1),g.startScreens([t("Screen:RainLoop:MailBox"),t("Screen:RainLoop:Settings"),t("Screen:RainLoop:About")]),(c||m||S)&&e.socialUsers(!0),h.sub("interval.2m",function(){e.folderInformation("INBOX")}),h.sub("interval.2m",function(){var t=b.currentFolderFullNameRaw();"INBOX"!==t&&e.folderInformation(t)}),h.sub("interval.3m",function(){e.folderInformationMultiply()}),h.sub("interval.5m",function(){e.quota()}),h.sub("interval.10m",function(){e.folders()}),a=a>=5?a:20,a=320>=a?a:320,s.setInterval(function(){e.contactsSync()},6e4*a+5e3),n.delay(function(){e.contactsSync()},5e3),n.delay(function(){e.folderInformationMultiply(!0)},500),u.runHook("rl-start-user-screens"),h.pub("rl.bootstart-user-screens"),f.settingsGet("AccountSignMe")&&s.navigator.registerProtocolHandler&&n.delay(function(){try{s.navigator.registerProtocolHandler("mailto",s.location.protocol+"//"+s.location.host+s.location.pathname+"?mailto&to=%s",""+(f.settingsGet("Title")||"RainLoop"))}catch(t){}f.settingsGet("MailToEmail")&&e.mailToHelper(f.settingsGet("MailToEmail"))},500),l.bMobileDevice||n.defer(function(){e.initLayoutResizer("#rl-left","#rl-right",r.ClientSideKeyName.FolderListSize)})):e.bootstartLoginScreen(),s.SimplePace&&s.SimplePace.set(100)},this))):(this.bootstartLoginScreen(),s.SimplePace&&s.SimplePace.set(100)),c&&(s["rl_"+i+"_google_service"]=function(){b.googleActions(!0),e.socialUsers()}),m&&(s["rl_"+i+"_facebook_service"]=function(){b.facebookActions(!0),e.socialUsers()}),S&&(s["rl_"+i+"_twitter_service"]=function(){b.twitterActions(!0),e.socialUsers()}),h.sub("interval.1m",function(){l.momentTrigger(!l.momentTrigger())}),u.runHook("rl-start-screens"),h.pub("rl.bootstart-end")},e.exports=new i}(t,e)},{$:26,"App:Abstract":2,"App:Knoin":33,Consts:6,Enums:7,Events:8,Globals:9,LinkBuilder:11,"Model:Account":37,"Model:Email":43,"Model:Folder":46,"Model:Identity":47,"Model:Message":48,"Model:OpenPgpKey":49,Plugins:12,"Screen:RainLoop:About":50,"Screen:RainLoop:Login":52,"Screen:RainLoop:MailBox":53,"Screen:RainLoop:Settings":54,"Settings:RainLoop:Accounts":55,"Settings:RainLoop:ChangePassword":56,"Settings:RainLoop:Contacts":57,"Settings:RainLoop:Filters":58,"Settings:RainLoop:Folders":59,"Settings:RainLoop:General":60,"Settings:RainLoop:Identities":61,"Settings:RainLoop:Identity":62,"Settings:RainLoop:OpenPGP":63,"Settings:RainLoop:Security":64,"Settings:RainLoop:Social":65,"Settings:RainLoop:Themes":66,"Storage:LocalStorage":71,"Storage:RainLoop:Cache":69,"Storage:RainLoop:Data":70,"Storage:RainLoop:Remote":74,"Storage:Settings":75,Utils:14,"View:Popup:Ask":86,"View:Popup:Compose":88,"View:Popup:FolderSystem":93,_:31,moment:29,window:32}],4:[function(e,t){!function(e,t){"use strict";e.exports=function(e){var i=t("window"),s=t("_"),o=t("$"),n=t("$win"),a=t("$html"),r=t("Globals"),l=t("Plugins"),c=t("Utils"),u=t("Enums"),d=t("Model:Email");r.__APP=e,e.setupSettings(),l.__boot=e,l.__remote=e.remote(),l.__data=e.data(),a.addClass(r.bMobileDevice?"mobile":"no-mobile"),n.keydown(c.killCtrlAandS).keyup(c.killCtrlAandS),n.unload(function(){r.bUnload=!0}),a.on("click.dropdown.data-api",function(){c.detectDropdownVisibility()}),i.rl=i.rl||{},i.rl.addHook=l.addHook,i.rl.settingsGet=l.mainSettingsGet,i.rl.remoteRequest=l.remoteRequest,i.rl.pluginSettingsGet=l.settingsGet,i.rl.createCommand=c.createCommand,i.rl.EmailModel=d,i.rl.Enums=u,i.__APP_BOOT=function(t){o(function(){i.rainloopTEMPLATES&&i.rainloopTEMPLATES[0]?(o("#rl-templates").html(i.rainloopTEMPLATES[0]),s.delay(function(){e.bootstart(),a.removeClass("no-js rl-booted-trigger").addClass("rl-booted")},10)):t(!1),i.__APP_BOOT=null})}}}(t,e)},{$:26,$html:17,$win:18,Enums:7,Globals:9,"Model:Email":43,Plugins:12,Utils:14,_:31,window:32}],5:[function(e,t){!function(e){"use strict";var t={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",urlsafe_encode:function(e){return t.encode(e).replace(/[+]/g,"-").replace(/[\/]/g,"_").replace(/[=]/g,".")},encode:function(e){var i,s,o,n,a,r,l,c="",u=0;for(e=t._utf8_encode(e);u<e.length;)i=e.charCodeAt(u++),s=e.charCodeAt(u++),o=e.charCodeAt(u++),n=i>>2,a=(3&i)<<4|s>>4,r=(15&s)<<2|o>>6,l=63&o,isNaN(s)?r=l=64:isNaN(o)&&(l=64),c=c+this._keyStr.charAt(n)+this._keyStr.charAt(a)+this._keyStr.charAt(r)+this._keyStr.charAt(l);return c},decode:function(e){var i,s,o,n,a,r,l,c="",u=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");u<e.length;)n=this._keyStr.indexOf(e.charAt(u++)),a=this._keyStr.indexOf(e.charAt(u++)),r=this._keyStr.indexOf(e.charAt(u++)),l=this._keyStr.indexOf(e.charAt(u++)),i=n<<2|a>>4,s=(15&a)<<4|r>>2,o=(3&r)<<6|l,c+=String.fromCharCode(i),64!==r&&(c+=String.fromCharCode(s)),64!==l&&(c+=String.fromCharCode(o));return t._utf8_decode(c)},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");for(var t="",i=0,s=e.length,o=0;s>i;i++)o=e.charCodeAt(i),128>o?t+=String.fromCharCode(o):o>127&&2048>o?(t+=String.fromCharCode(o>>6|192),t+=String.fromCharCode(63&o|128)):(t+=String.fromCharCode(o>>12|224),t+=String.fromCharCode(o>>6&63|128),t+=String.fromCharCode(63&o|128));return t},_utf8_decode:function(e){for(var t="",i=0,s=0,o=0,n=0;i<e.length;)s=e.charCodeAt(i),128>s?(t+=String.fromCharCode(s),i++):s>191&&224>s?(o=e.charCodeAt(i+1),t+=String.fromCharCode((31&s)<<6|63&o),i+=2):(o=e.charCodeAt(i+1),n=e.charCodeAt(i+2),t+=String.fromCharCode((15&s)<<12|(63&o)<<6|63&n),i+=3);return t}};e.exports=t}(t,e)},{}],6:[function(e,t){!function(e){"use strict";var t={};t.Values={},t.DataImages={},t.Defaults={},t.Defaults.MessagesPerPage=20,t.Defaults.ContactsPerPage=50,t.Defaults.MessagesPerPageArray=[10,20,30,50,100],t.Defaults.DefaultAjaxTimeout=3e4,t.Defaults.SearchAjaxTimeout=3e5,t.Defaults.SendMessageAjaxTimeout=3e5,t.Defaults.SaveMessageAjaxTimeout=2e5,t.Defaults.ContactsSyncAjaxTimeout=2e5,t.Values.UnuseOptionValue="__UNUSE__",t.Values.ClientSideCookieIndexName="rlcsc",t.Values.ImapDefaulPort=143,t.Values.ImapDefaulSecurePort=993,t.Values.SmtpDefaulPort=25,t.Values.SmtpDefaulSecurePort=465,t.Values.MessageBodyCacheLimit=15,t.Values.AjaxErrorLimit=7,t.Values.TokenErrorLimit=10,t.DataImages.UserDotPic="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2P8DwQACgAD/il4QJ8AAAAASUVORK5CYII=",t.DataImages.TranspPic="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII=",e.exports=t}(t,e)},{}],7:[function(e,t){!function(e){"use strict";var t={};t.StorageResultType={Success:"success",Abort:"abort",Error:"error",Unload:"unload"},t.State={Empty:10,Login:20,Auth:30},t.StateType={Webmail:0,Admin:1},t.Capa={Prem:"PREM",TwoFactor:"TWO_FACTOR",OpenPGP:"OPEN_PGP",Prefetch:"PREFETCH",Gravatar:"GRAVATAR",Themes:"THEMES",Filters:"FILTERS",AdditionalAccounts:"ADDITIONAL_ACCOUNTS",AdditionalIdentities:"ADDITIONAL_IDENTITIES"},t.KeyState={All:"all",None:"none",ContactList:"contact-list",MessageList:"message-list",FolderList:"folder-list",MessageView:"message-view",Compose:"compose",Settings:"settings",Menu:"menu",PopupComposeOpenPGP:"compose-open-pgp",PopupKeyboardShortcutsHelp:"popup-keyboard-shortcuts-help",PopupAsk:"popup-ask"},t.FolderType={Inbox:10,SentItems:11,Draft:12,Trash:13,Spam:14,Archive:15,NotSpam:80,User:99},t.LoginSignMeTypeAsString={DefaultOff:"defaultoff",DefaultOn:"defaulton",Unused:"unused"},t.LoginSignMeType={DefaultOff:0,DefaultOn:1,Unused:2},t.ComposeType={Empty:"empty",Reply:"reply",ReplyAll:"replyall",Forward:"forward",ForwardAsAttachment:"forward-as-attachment",Draft:"draft",EditAsNew:"editasnew"},t.UploadErrorCode={Normal:0,FileIsTooBig:1,FilePartiallyUploaded:2,FileNoUploaded:3,MissingTempFolder:4,FileOnSaveingError:5,FileType:98,Unknown:99},t.SetSystemFoldersNotification={None:0,Sent:1,Draft:2,Spam:3,Trash:4,Archive:5},t.ClientSideKeyName={FoldersLashHash:0,MessagesInboxLastHash:1,MailBoxListSize:2,ExpandedFolders:3,FolderListSize:4},t.EventKeyCode={Backspace:8,Tab:9,Enter:13,Esc:27,PageUp:33,PageDown:34,Left:37,Right:39,Up:38,Down:40,End:35,Home:36,Space:32,Insert:45,Delete:46,A:65,S:83},t.MessageSetAction={SetSeen:0,UnsetSeen:1,SetFlag:2,UnsetFlag:3},t.MessageSelectAction={All:0,None:1,Invert:2,Unseen:3,Seen:4,Flagged:5,Unflagged:6},t.DesktopNotifications={Allowed:0,NotAllowed:1,Denied:2,NotSupported:9},t.MessagePriority={Low:5,Normal:3,High:1},t.EditorDefaultType={Html:"Html",Plain:"Plain"},t.CustomThemeType={Light:"Light",Dark:"Dark"},t.ServerSecure={None:0,SSL:1,TLS:2},t.SearchDateType={All:-1,Days3:3,Days7:7,Month:30},t.EmailType={Defailt:0,Facebook:1,Google:2},t.SaveSettingsStep={Animate:-2,Idle:-1,TrueResult:1,FalseResult:0},t.InterfaceAnimation={None:"None",Normal:"Normal",Full:"Full"},t.Layout={NoPreview:0,SidePreview:1,BottomPreview:2},t.FilterConditionField={From:"From",To:"To",Recipient:"Recipient",Subject:"Subject"},t.FilterConditionType={Contains:"Contains",NotContains:"NotContains",EqualTo:"EqualTo",NotEqualTo:"NotEqualTo"},t.FiltersAction={None:"None",Move:"Move",Discard:"Discard",Forward:"Forward"},t.FilterRulesType={And:"And",Or:"Or"},t.SignedVerifyStatus={UnknownPublicKeys:-4,UnknownPrivateKey:-3,Unverified:-2,Error:-1,None:0,Success:1},t.ContactPropertyType={Unknown:0,FullName:10,FirstName:15,LastName:16,MiddleName:16,Nick:18,NamePrefix:20,NameSuffix:21,Email:30,Phone:31,Web:32,Birthday:40,Facebook:90,Skype:91,GitHub:92,Note:110,Custom:250},t.Notification={InvalidToken:101,AuthError:102,AccessError:103,ConnectionError:104,CaptchaError:105,SocialFacebookLoginAccessDisable:106,SocialTwitterLoginAccessDisable:107,SocialGoogleLoginAccessDisable:108,DomainNotAllowed:109,AccountNotAllowed:110,AccountTwoFactorAuthRequired:120,AccountTwoFactorAuthError:121,CouldNotSaveNewPassword:130,CurrentPasswordIncorrect:131,NewPasswordShort:132,NewPasswordWeak:133,NewPasswordForbidden:134,ContactsSyncError:140,CantGetMessageList:201,CantGetMessage:202,CantDeleteMessage:203,CantMoveMessage:204,CantCopyMessage:205,CantSaveMessage:301,CantSendMessage:302,InvalidRecipients:303,CantCreateFolder:400,CantRenameFolder:401,CantDeleteFolder:402,CantSubscribeFolder:403,CantUnsubscribeFolder:404,CantDeleteNonEmptyFolder:405,CantSaveSettings:501,CantSavePluginSettings:502,DomainAlreadyExists:601,CantInstallPackage:701,CantDeletePackage:702,InvalidPluginPackage:703,UnsupportedPluginPackage:704,LicensingServerIsUnavailable:710,LicensingExpired:711,LicensingBanned:712,DemoSendMessageError:750,AccountAlreadyExists:801,MailServerError:901,ClientViewError:902,InvalidInputArgument:903,UnknownNotification:999,UnknownError:999},e.exports=t
}(t,e)},{}],8:[function(e,t){!function(e,t){"use strict";function i(){this.oSubs={}}var s=t("_"),o=t("Utils"),n=t("Plugins");i.prototype.oSubs={},i.prototype.sub=function(e,t,i){return o.isUnd(this.oSubs[e])&&(this.oSubs[e]=[]),this.oSubs[e].push([t,i]),this},i.prototype.pub=function(e,t){return n.runHook("rl-pub",[e,t]),o.isUnd(this.oSubs[e])||s.each(this.oSubs[e],function(e){e[0]&&e[0].apply(e[1]||null,t||[])}),this},e.exports=new i}(t,e)},{Plugins:12,Utils:14,_:31}],9:[function(e,t){!function(e,t){"use strict";var i={},s=t("window"),o=t("ko"),n=t("key"),a=t("$html"),r=t("Enums");i.now=(new s.Date).getTime(),i.momentTrigger=o.observable(!0),i.dropdownVisibility=o.observable(!1).extend({rateLimit:0}),i.tooltipTrigger=o.observable(!1).extend({rateLimit:0}),i.langChangeTrigger=o.observable(!0),i.useKeyboardShortcuts=o.observable(!0),i.iAjaxErrorCount=0,i.iTokenErrorCount=0,i.iMessageBodyCacheCount=0,i.bUnload=!1,i.sUserAgent=(s.navigator.userAgent||"").toLowerCase(),i.bIsiOSDevice=-1<i.sUserAgent.indexOf("iphone")||-1<i.sUserAgent.indexOf("ipod")||-1<i.sUserAgent.indexOf("ipad"),i.bIsAndroidDevice=-1<i.sUserAgent.indexOf("android"),i.bMobileDevice=i.bIsiOSDevice||i.bIsAndroidDevice,i.bDisableNanoScroll=i.bMobileDevice,i.bAllowPdfPreview=!i.bMobileDevice,i.bAnimationSupported=!i.bMobileDevice&&a.hasClass("csstransitions"),i.bXMLHttpRequestSupported=!!s.XMLHttpRequest,i.sAnimationType="",i.__APP=null,i.oHtmlEditorDefaultConfig={title:!1,stylesSet:!1,customConfig:"",contentsCss:"",toolbarGroups:[{name:"spec"},{name:"styles"},{name:"basicstyles",groups:["basicstyles","cleanup"]},{name:"colors"},{name:"paragraph",groups:["list","indent","blocks","align"]},{name:"links"},{name:"insert"},{name:"others"}],removePlugins:"contextmenu",removeButtons:"Format,Undo,Redo,Cut,Copy,Paste,Anchor,Strike,Subscript,Superscript,Image,SelectAll",removeDialogTabs:"link:advanced;link:target;image:advanced;images:advanced",extraPlugins:"plain",allowedContent:!0,autoParagraph:!1,font_defaultLabel:"Arial",fontSize_defaultLabel:"13",fontSize_sizes:"10/10px;12/12px;13/13px;14/14px;16/16px;18/18px;20/20px;24/24px;28/28px;36/36px;48/48px"},i.oHtmlEditorLangsMap={de:"de",es:"es",fr:"fr",hu:"hu",is:"is",it:"it",ja:"ja","ja-jp":"ja",ko:"ko","ko-kr":"ko",lv:"lv",nl:"nl",no:"no",pl:"pl",pt:"pt","pt-pt":"pt","pt-br":"pt-br",ro:"ro",ru:"ru",sk:"sk",tr:"tr",ua:"ru",zh:"zh","zh-cn":"zh-cn"},i.bAllowPdfPreview&&s.navigator&&s.navigator.mimeTypes&&(i.bAllowPdfPreview=!!_.find(s.navigator.mimeTypes,function(e){return e&&"application/pdf"===e.type})),i.oI18N=s.rainloopI18N||{},i.oNotificationI18N={},i.aBootstrapDropdowns=[],i.aViewModels={settings:[],"settings-removed":[],"settings-disabled":[]},i.leftPanelDisabled=o.observable(!1),i.popupVisibilityNames=o.observableArray([]),i.popupVisibility=o.computed(function(){return 0<i.popupVisibilityNames().length},this),i.keyScopeReal=o.observable(r.KeyState.All),i.keyScopeFake=o.observable(r.KeyState.All),i.keyScope=o.computed({owner:this,read:function(){return i.keyScopeFake()},write:function(e){r.KeyState.Menu!==e&&(n.filter=r.KeyState.Compose===e?function(){return i.useKeyboardShortcuts()}:function(e){if(i.useKeyboardShortcuts()){var t=e.target||e.srcElement,s=t?t.tagName:"";return s=s.toUpperCase(),!("INPUT"===s||"SELECT"===s||"TEXTAREA"===s||t&&"DIV"===s&&"editorHtmlArea"===t.className&&t.contentEditable)}return!1},i.keyScopeFake(e),i.dropdownVisibility()&&(e=r.KeyState.Menu)),i.keyScopeReal(e)}}),i.keyScopeReal.subscribe(function(e){n.setScope(e)}),i.dropdownVisibility.subscribe(function(e){e?(i.tooltipTrigger(!i.tooltipTrigger()),i.keyScope(r.KeyState.Menu)):r.KeyState.Menu===n.getScope()&&i.keyScope(i.keyScopeFake())}),e.exports=i}(t,e)},{$html:17,Enums:7,key:27,ko:28,window:32}],10:[function(e,t){!function(e,t){"use strict";function i(e,t,i,s){this.editor=null,this.iBlurTimer=0,this.fOnBlur=t||null,this.fOnReady=i||null,this.fOnModeChange=s||null,this.$element=$(e),this.resize=o.throttle(o.bind(this.resize,this),100),this.init()}var s=t("window"),o=t("_"),n=t("Globals"),a=t("Storage:Settings");i.prototype.blurTrigger=function(){if(this.fOnBlur){var e=this;s.clearTimeout(this.iBlurTimer),this.iBlurTimer=s.setTimeout(function(){e.fOnBlur()},200)}},i.prototype.focusTrigger=function(){this.fOnBlur&&s.clearTimeout(this.iBlurTimer)},i.prototype.isHtml=function(){return this.editor?"wysiwyg"===this.editor.mode:!1},i.prototype.checkDirty=function(){return this.editor?this.editor.checkDirty():!1},i.prototype.resetDirty=function(){this.editor&&this.editor.resetDirty()},i.prototype.getData=function(e){return this.editor?"plain"===this.editor.mode&&this.editor.plugins.plain&&this.editor.__plain?this.editor.__plain.getRawData():e?'<div data-html-editor-font-wrapper="true" style="font-family: arial, sans-serif; font-size: 13px;">'+this.editor.getData()+"</div>":this.editor.getData():""},i.prototype.modeToggle=function(e){this.editor&&(e?"plain"===this.editor.mode&&this.editor.setMode("wysiwyg"):"wysiwyg"===this.editor.mode&&this.editor.setMode("plain"),this.resize())},i.prototype.setHtml=function(e,t){this.editor&&(this.modeToggle(!0),this.editor.setData(e),t&&this.focus())},i.prototype.setPlain=function(e,t){if(this.editor){if(this.modeToggle(!1),"plain"===this.editor.mode&&this.editor.plugins.plain&&this.editor.__plain)return this.editor.__plain.setRawData(e);this.editor.setData(e),t&&this.focus()}},i.prototype.init=function(){if(this.$element&&this.$element[0]){var e=this,t=function(){var t=n.oHtmlEditorDefaultConfig,i=a.settingsGet("Language"),o=!!a.settingsGet("AllowHtmlEditorSourceButton");o&&t.toolbarGroups&&!t.toolbarGroups.__SourceInited&&(t.toolbarGroups.__SourceInited=!0,t.toolbarGroups.push({name:"document",groups:["mode","document","doctools"]})),t.enterMode=s.CKEDITOR.ENTER_BR,t.shiftEnterMode=s.CKEDITOR.ENTER_BR,t.language=n.oHtmlEditorLangsMap[i]||"en",s.CKEDITOR.env&&(s.CKEDITOR.env.isCompatible=!0),e.editor=s.CKEDITOR.appendTo(e.$element[0],t),e.editor.on("key",function(e){return e&&e.data&&9===e.data.keyCode?!1:void 0}),e.editor.on("blur",function(){e.blurTrigger()}),e.editor.on("mode",function(){e.blurTrigger(),e.fOnModeChange&&e.fOnModeChange("plain"!==e.editor.mode)}),e.editor.on("focus",function(){e.focusTrigger()}),e.fOnReady&&e.editor.on("instanceReady",function(){e.editor.setKeystroke(s.CKEDITOR.CTRL+65,"selectAll"),e.fOnReady(),e.__resizable=!0,e.resize()})};s.CKEDITOR?t():s.__initEditor=t}},i.prototype.focus=function(){this.editor&&this.editor.focus()},i.prototype.blur=function(){this.editor&&this.editor.focusManager.blur(!0)},i.prototype.resize=function(){if(this.editor&&this.__resizable)try{this.editor.resize(this.$element.width(),this.$element.innerHeight())}catch(e){}},i.prototype.clear=function(e){this.setHtml("",e)},e.exports=i}(t,e)},{Globals:9,"Storage:Settings":75,_:31,window:32}],11:[function(e,t){!function(e,t){"use strict";function i(){var e=t("Storage:Settings");this.sBase="#/",this.sServer="./?",this.sVersion=e.settingsGet("Version"),this.sSpecSuffix=e.settingsGet("AuthAccountHash")||"0",this.sStaticPrefix=e.settingsGet("StaticPrefix")||"rainloop/v/"+this.sVersion+"/static/"}var s=t("window"),o=t("Utils");i.prototype.root=function(){return this.sBase},i.prototype.attachmentDownload=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/Download/"+e},i.prototype.attachmentPreview=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/View/"+e},i.prototype.attachmentPreviewAsPlain=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ViewAsPlain/"+e},i.prototype.upload=function(){return this.sServer+"/Upload/"+this.sSpecSuffix+"/"},i.prototype.uploadContacts=function(){return this.sServer+"/UploadContacts/"+this.sSpecSuffix+"/"},i.prototype.uploadBackground=function(){return this.sServer+"/UploadBackground/"+this.sSpecSuffix+"/"},i.prototype.append=function(){return this.sServer+"/Append/"+this.sSpecSuffix+"/"},i.prototype.change=function(e){return this.sServer+"/Change/"+this.sSpecSuffix+"/"+s.encodeURIComponent(e)+"/"},i.prototype.ajax=function(e){return this.sServer+"/Ajax/"+this.sSpecSuffix+"/"+e},i.prototype.messageViewLink=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ViewAsPlain/"+e},i.prototype.messageDownloadLink=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/Download/"+e},i.prototype.avatarLink=function(e){return this.sServer+"/Raw/0/Avatar/"+s.encodeURIComponent(e)+"/"},i.prototype.inbox=function(){return this.sBase+"mailbox/Inbox"},i.prototype.messagePreview=function(){return this.sBase+"mailbox/message-preview"},i.prototype.settings=function(e){var t=this.sBase+"settings";return o.isUnd(e)||""===e||(t+="/"+e),t},i.prototype.about=function(){return this.sBase+"about"},i.prototype.admin=function(e){var t=this.sBase;switch(e){case"AdminDomains":t+="domains";break;case"AdminSecurity":t+="security";break;case"AdminLicensing":t+="licensing"}return t},i.prototype.mailBox=function(e,t,i){t=o.isNormal(t)?o.pInt(t):1,i=o.pString(i);var s=this.sBase+"mailbox/";return""!==e&&(s+=encodeURI(e)),t>1&&(s=s.replace(/[\/]+$/,""),s+="/p"+t),""!==i&&(s=s.replace(/[\/]+$/,""),s+="/"+encodeURI(i)),s},i.prototype.phpInfo=function(){return this.sServer+"Info"},i.prototype.langLink=function(e){return this.sServer+"/Lang/0/"+encodeURI(e)+"/"+this.sVersion+"/"},i.prototype.exportContactsVcf=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsVcf/"},i.prototype.exportContactsCsv=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsCsv/"},i.prototype.emptyContactPic=function(){return this.sStaticPrefix+"css/images/empty-contact.png"},i.prototype.sound=function(e){return this.sStaticPrefix+"sounds/"+e},i.prototype.themePreviewLink=function(e){var t="rainloop/v/"+this.sVersion+"/";return"@custom"===e.substr(-7)&&(e=o.trim(e.substring(0,e.length-7)),t=""),t+"themes/"+encodeURI(e)+"/images/preview.png"},i.prototype.notificationMailIcon=function(){return this.sStaticPrefix+"css/images/icom-message-notification.png"},i.prototype.openPgpJs=function(){return this.sStaticPrefix+"js/openpgp.min.js"},i.prototype.socialGoogle=function(){return this.sServer+"SocialGoogle"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},i.prototype.socialTwitter=function(){return this.sServer+"SocialTwitter"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},i.prototype.socialFacebook=function(){return this.sServer+"SocialFacebook"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},e.exports=new i}(t,e)},{"Storage:Settings":75,Utils:14,window:32}],12:[function(e,t){!function(e,t){"use strict";var i={__boot:null,__remote:null,__data:null},s=t("_"),o=t("Utils"),n=t("Storage:Settings");i.oViewModelsHooks={},i.oSimpleHooks={},i.regViewModelHook=function(e,t){t&&(t.__hookName=e)},i.addHook=function(e,t){o.isFunc(t)&&(o.isArray(i.oSimpleHooks[e])||(i.oSimpleHooks[e]=[]),i.oSimpleHooks[e].push(t))},i.runHook=function(e,t){o.isArray(i.oSimpleHooks[e])&&(t=t||[],s.each(i.oSimpleHooks[e],function(e){e.apply(null,t)}))},i.mainSettingsGet=function(e){return n.settingsGet(e)},i.remoteRequest=function(e,t,s,o,n,a){i.__remote&&i.__remote.defaultRequest(e,t,s,o,n,a)},i.settingsGet=function(e,t){var i=n.settingsGet("Plugins");return i=i&&!o.isUnd(i[e])?i[e]:null,i?o.isUnd(i[t])?null:i[t]:null},e.exports=i}(t,e)},{"Storage:Settings":75,Utils:14,_:31}],13:[function(e,t){!function(e,t){"use strict";function i(e,t,i,s,a,r){this.list=e,this.listChecked=n.computed(function(){return o.filter(this.list(),function(e){return e.checked()})},this).extend({rateLimit:0}),this.isListChecked=n.computed(function(){return 0<this.listChecked().length},this),this.focusedItem=n.observable(null),this.selectedItem=t,this.selectedItemUseCallback=!0,this.itemSelectedThrottle=o.debounce(o.bind(this.itemSelected,this),300),this.listChecked.subscribe(function(e){0<e.length?null===this.selectedItem()?this.selectedItem.valueHasMutated():this.selectedItem(null):this.bAutoSelect&&this.focusedItem()&&this.selectedItem(this.focusedItem())},this),this.selectedItem.subscribe(function(e){e?(this.isListChecked()&&o.each(this.listChecked(),function(e){e.checked(!1)}),this.selectedItemUseCallback&&this.itemSelectedThrottle(e)):this.selectedItemUseCallback&&this.itemSelected(null)},this),this.selectedItem.extend({toggleSubscribe:[null,function(e){e&&e.selected(!1)},function(e){e&&e.selected(!0)}]}),this.focusedItem.extend({toggleSubscribe:[null,function(e){e&&e.focused(!1)},function(e){e&&e.focused(!0)}]}),this.oContentVisible=null,this.oContentScrollable=null,this.sItemSelector=i,this.sItemSelectedSelector=s,this.sItemCheckedSelector=a,this.sItemFocusedSelector=r,this.sLastUid="",this.bAutoSelect=!0,this.oCallbacks={},this.emptyFunction=function(){},this.focusedItem.subscribe(function(e){e&&(this.sLastUid=this.getItemUid(e))},this);var c=[],u=[],d=null,p=null;this.list.subscribe(function(e){var t=this;l.isArray(e)&&o.each(e,function(e){if(e){var i=t.getItemUid(e);c.push(i),e.checked()&&u.push(i),null===d&&e.focused()&&(d=i),null===p&&e.selected()&&(p=i)}})},this,"beforeChange"),this.list.subscribe(function(e){var t=this,i=null,s=!1,n=[],a=d,r=!1,h=!1,g=0;this.selectedItemUseCallback=!1,this.focusedItem(null),this.selectedItem(null),l.isArray(e)&&(g=u.length,o.each(e,function(e){var i=t.getItemUid(e);n.push(i),null!==d&&d===i&&(t.focusedItem(e),d=null),g>0&&-1<l.inArray(i,u)&&(r=!0,e.checked(!0),g--),r||null===p||p!==i||(h=!0,t.selectedItem(e),p=null)}),this.selectedItemUseCallback=!0,r||h||!this.bAutoSelect||(t.focusedItem()?t.selectedItem(t.focusedItem()):0<e.length&&(null!==a&&(s=!1,a=o.find(c,function(e){return s&&-1<l.inArray(e,n)?e:(a===e&&(s=!0),!1)}),a&&(i=o.find(e,function(e){return a===t.getItemUid(e)}))),t.selectedItem(i||null),t.focusedItem(t.selectedItem())))),c=[],u=[],d=null,p=null},this)}var s=t("$"),o=t("_"),n=t("ko"),a=t("key"),r=t("Enums"),l=t("Utils");i.prototype.itemSelected=function(e){this.isListChecked()?e||(this.oCallbacks.onItemSelect||this.emptyFunction)(e||null):e&&(this.oCallbacks.onItemSelect||this.emptyFunction)(e)},i.prototype.goDown=function(e){this.newSelectPosition(r.EventKeyCode.Down,!1,e)},i.prototype.goUp=function(e){this.newSelectPosition(r.EventKeyCode.Up,!1,e)},i.prototype.init=function(e,t,i){if(this.oContentVisible=e,this.oContentScrollable=t,i=i||"all",this.oContentVisible&&this.oContentScrollable){var o=this;s(this.oContentVisible).on("selectstart",function(e){e&&e.preventDefault&&e.preventDefault()}).on("click",this.sItemSelector,function(e){o.actionClick(n.dataFor(this),e)}).on("click",this.sItemCheckedSelector,function(e){var t=n.dataFor(this);t&&(e&&e.shiftKey?o.actionClick(t,e):(o.focusedItem(t),t.checked(!t.checked())))}),a("enter",i,function(){return o.focusedItem()&&!o.focusedItem().selected()?(o.actionClick(o.focusedItem()),!1):!0}),a("ctrl+up, command+up, ctrl+down, command+down",i,function(){return!1}),a("up, shift+up, down, shift+down, home, end, pageup, pagedown, insert, space",i,function(e,t){if(e&&t&&t.shortcut){var i=0;switch(t.shortcut){case"up":case"shift+up":i=r.EventKeyCode.Up;break;case"down":case"shift+down":i=r.EventKeyCode.Down;break;case"insert":i=r.EventKeyCode.Insert;break;case"space":i=r.EventKeyCode.Space;break;case"home":i=r.EventKeyCode.Home;break;case"end":i=r.EventKeyCode.End;break;case"pageup":i=r.EventKeyCode.PageUp;break;case"pagedown":i=r.EventKeyCode.PageDown}if(i>0)return o.newSelectPosition(i,a.shift),!1}})}},i.prototype.autoSelect=function(e){this.bAutoSelect=!!e},i.prototype.getItemUid=function(e){var t="",i=this.oCallbacks.onItemGetUid||null;return i&&e&&(t=i(e)),t.toString()},i.prototype.newSelectPosition=function(e,t,i){var s=0,n=10,a=!1,l=!1,c=null,u=this.list(),d=u?u.length:0,p=this.focusedItem();if(d>0)if(p){if(p)if(r.EventKeyCode.Down===e||r.EventKeyCode.Up===e||r.EventKeyCode.Insert===e||r.EventKeyCode.Space===e)o.each(u,function(t){if(!l)switch(e){case r.EventKeyCode.Up:p===t?l=!0:c=t;break;case r.EventKeyCode.Down:case r.EventKeyCode.Insert:a?(c=t,l=!0):p===t&&(a=!0)}});else if(r.EventKeyCode.Home===e||r.EventKeyCode.End===e)r.EventKeyCode.Home===e?c=u[0]:r.EventKeyCode.End===e&&(c=u[u.length-1]);else if(r.EventKeyCode.PageDown===e){for(;d>s;s++)if(p===u[s]){s+=n,s=s>d-1?d-1:s,c=u[s];break}}else if(r.EventKeyCode.PageUp===e)for(s=d;s>=0;s--)if(p===u[s]){s-=n,s=0>s?0:s,c=u[s];break}}else r.EventKeyCode.Down===e||r.EventKeyCode.Insert===e||r.EventKeyCode.Space===e||r.EventKeyCode.Home===e||r.EventKeyCode.PageUp===e?c=u[0]:(r.EventKeyCode.Up===e||r.EventKeyCode.End===e||r.EventKeyCode.PageDown===e)&&(c=u[u.length-1]);c?(this.focusedItem(c),p&&(t?(r.EventKeyCode.Up===e||r.EventKeyCode.Down===e)&&p.checked(!p.checked()):(r.EventKeyCode.Insert===e||r.EventKeyCode.Space===e)&&p.checked(!p.checked())),!this.bAutoSelect&&!i||this.isListChecked()||r.EventKeyCode.Space===e||this.selectedItem(c),this.scrollToFocused()):p&&(!t||r.EventKeyCode.Up!==e&&r.EventKeyCode.Down!==e?(r.EventKeyCode.Insert===e||r.EventKeyCode.Space===e)&&p.checked(!p.checked()):p.checked(!p.checked()),this.focusedItem(p))},i.prototype.scrollToFocused=function(){if(!this.oContentVisible||!this.oContentScrollable)return!1;var e=20,t=s(this.sItemFocusedSelector,this.oContentScrollable),i=t.position(),o=this.oContentVisible.height(),n=t.outerHeight();return i&&(i.top<0||i.top+n>o)?(this.oContentScrollable.scrollTop(i.top<0?this.oContentScrollable.scrollTop()+i.top-e:this.oContentScrollable.scrollTop()+i.top-o+n+e),!0):!1},i.prototype.scrollToTop=function(e){return this.oContentVisible&&this.oContentScrollable?(e?this.oContentScrollable.scrollTop(0):this.oContentScrollable.stop().animate({scrollTop:0},200),!0):!1},i.prototype.eventClickFunction=function(e,t){var i=this.getItemUid(e),s=0,o=0,n=null,a="",r=!1,l=!1,c=[],u=!1;if(t&&t.shiftKey&&""!==i&&""!==this.sLastUid&&i!==this.sLastUid)for(c=this.list(),u=e.checked(),s=0,o=c.length;o>s;s++)n=c[s],a=this.getItemUid(n),r=!1,(a===this.sLastUid||a===i)&&(r=!0),r&&(l=!l),(l||r)&&n.checked(u);this.sLastUid=""===i?"":i},i.prototype.actionClick=function(e,t){if(e){var i=!0,s=this.getItemUid(e);t&&(!t.shiftKey||t.ctrlKey||t.altKey?!t.ctrlKey||t.shiftKey||t.altKey||(i=!1,this.focusedItem(e),this.selectedItem()&&e!==this.selectedItem()&&this.selectedItem().checked(!0),e.checked(!e.checked())):(i=!1,""===this.sLastUid&&(this.sLastUid=s),e.checked(!e.checked()),this.eventClickFunction(e,t),this.focusedItem(e))),i&&(this.focusedItem(e),this.selectedItem(e),this.scrollToFocused())}},i.prototype.on=function(e,t){this.oCallbacks[e]=t},e.exports=i}(t,e)},{$:26,Enums:7,Utils:14,_:31,key:27,ko:28}],14:[function(e,t){!function(e,t){"use strict";var i={},s=t("$"),o=t("_"),n=t("ko"),a=t("window"),r=t("$win"),l=t("$html"),c=t("$div"),u=t("$doc"),d=t("NotificationClass"),p=t("Enums"),h=t("Consts"),g=t("Globals");i.trim=s.trim,i.inArray=s.inArray,i.isArray=o.isArray,i.isFunc=o.isFunction,i.isUnd=o.isUndefined,i.isNull=o.isNull,i.emptyFunction=function(){},i.isNormal=function(e){return!i.isUnd(e)&&!i.isNull(e)},i.windowResize=o.debounce(function(e){i.isUnd(e)?r.resize():a.setTimeout(function(){r.resize()},e)},50),i.isPosNumeric=function(e,t){return i.isNormal(e)?(i.isUnd(t)?0:!t)?/^[1-9]+[0-9]*$/.test(e.toString()):/^[0-9]*$/.test(e.toString()):!1},i.pInt=function(e,t){var s=i.isNormal(e)&&""!==e?a.parseInt(e,10):t||0;return a.isNaN(s)?t||0:s},i.pString=function(e){return i.isNormal(e)?""+e:""},i.isNonEmptyArray=function(e){return i.isArray(e)&&0<e.length},i.simpleQueryParser=function(e){var t={},i=[],s=[],o=0,n=0;for(i=e.split("&"),o=0,n=i.length;n>o;o++)s=i[o].split("="),t[a.decodeURIComponent(s[0])]=a.decodeURIComponent(s[1]);return t},i.rsaEncode=function(e,t,s,o){if(a.crypto&&a.crypto.getRandomValues&&a.RSAKey&&t&&s&&o){var n=new a.RSAKey;if(n.setPublic(o,s),e=n.encrypt(i.fakeMd5()+":"+e+":"+i.fakeMd5()),!1!==e)return"rsa:"+t+":"+e}return!1},i.rsaEncode.supported=!!(a.crypto&&a.crypto.getRandomValues&&a.RSAKey),i.exportPath=function(e,t,s){for(var o=null,n=e.split("."),r=s||a;n.length&&(o=n.shift());)n.length||i.isUnd(t)?r=r[o]?r[o]:r[o]={}:r[o]=t},i.pImport=function(e,t,i){e[t]=i},i.pExport=function(e,t,s){return i.isUnd(e[t])?s:e[t]},i.encodeHtml=function(e){return i.isNormal(e)?e.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;"):""},i.splitPlainText=function(e,t){var s="",o="",n=e,a=0,r=0;for(t=i.isUnd(t)?100:t;n.length>t;)o=n.substring(0,t),a=o.lastIndexOf(" "),r=o.lastIndexOf("\n"),-1!==r&&(a=r),-1===a&&(a=t),s+=o.substring(0,a)+"\n",n=n.substring(a+1);return s+n},i.timeOutAction=function(){var e={};return function(t,s,o){i.isUnd(e[t])&&(e[t]=0),a.clearTimeout(e[t]),e[t]=a.setTimeout(s,o)}}(),i.timeOutActionSecond=function(){var e={};return function(t,i,s){e[t]||(e[t]=a.setTimeout(function(){i(),e[t]=0},s))}}(),i.audio=function(){var e=!1;return function(t,i){if(!1===e)if(g.bIsiOSDevice)e=null;else{var s=!1,o=!1,n=a.Audio?new a.Audio:null;n&&n.canPlayType&&n.play?(s=""!==n.canPlayType('audio/mpeg; codecs="mp3"'),s||(o=""!==n.canPlayType('audio/ogg; codecs="vorbis"')),s||o?(e=n,e.preload="none",e.loop=!1,e.autoplay=!1,e.muted=!1,e.src=s?t:i):e=null):e=null}return e}}(),i.hos=function(e,t){return e&&a.Object&&a.Object.hasOwnProperty?a.Object.hasOwnProperty.call(e,t):!1},i.i18n=function(e,t,s){var o="",n=i.isUnd(g.oI18N[e])?i.isUnd(s)?e:s:g.oI18N[e];if(!i.isUnd(t)&&!i.isNull(t))for(o in t)i.hos(t,o)&&(n=n.replace("%"+o+"%",t[o]));return n},i.i18nToNode=function(e){o.defer(function(){s(".i18n",e).each(function(){var e=s(this),t="";t=e.data("i18n-text"),t?e.text(i.i18n(t)):(t=e.data("i18n-html"),t&&e.html(i.i18n(t)),t=e.data("i18n-placeholder"),t&&e.attr("placeholder",i.i18n(t)),t=e.data("i18n-title"),t&&e.attr("title",i.i18n(t)))})})},i.i18nReload=function(){a.rainloopI18N&&(g.oI18N=a.rainloopI18N||{},i.i18nToNode(u),g.langChangeTrigger(!g.langChangeTrigger())),a.rainloopI18N=null},i.initOnStartOrLangChange=function(e,t,i){e&&e.call(t),i?g.langChangeTrigger.subscribe(function(){e&&e.call(t),i.call(t)}):e&&g.langChangeTrigger.subscribe(e,t)},i.inFocus=function(){return a.document.activeElement?(i.isUnd(a.document.activeElement.__inFocusCache)&&(a.document.activeElement.__inFocusCache=s(a.document.activeElement).is("input,textarea,iframe,.cke_editable")),!!a.document.activeElement.__inFocusCache):!1},i.removeInFocus=function(){if(a.document&&a.document.activeElement&&a.document.activeElement.blur){var e=s(a.document.activeElement);e.is("input,textarea")&&a.document.activeElement.blur()}},i.removeSelection=function(){if(a&&a.getSelection){var e=a.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else a.document&&a.document.selection&&a.document.selection.empty&&a.document.selection.empty()},i.replySubjectAdd=function(e,t){e=i.trim(e.toUpperCase()),t=i.trim(t.replace(/[\s]+/g," "));var s=0,o="",n=!1,a="",r=[],l=[],c="RE"===e,u="FWD"===e,d=!u;if(""!==t){for(n=!1,l=t.split(":"),s=0;s<l.length;s++)a=i.trim(l[s]),n||!/^(RE|FWD)$/i.test(a)&&!/^(RE|FWD)[\[\(][\d]+[\]\)]$/i.test(a)?(r.push(l[s]),n=!0):(c||(c=!!/^RE/i.test(a)),u||(u=!!/^FWD/i.test(a)));0<r.length&&(o=i.trim(r.join(":")))}return d?c=!1:u=!1,i.trim((d?"Re: ":"Fwd: ")+(c?"Re: ":"")+(u?"Fwd: ":"")+o)},i.fixLongSubject=function(e){var t=30,s=/^Re([\[\(]([\d]+)[\]\)]|):[\s]{0,3}Re([\[\(]([\d]+)[\]\)]|):/gi,o=null;e=i.trim(e.replace(/[\s]+/g," "));do t--,o=s.exec(e),(!o||i.isUnd(o[0]))&&(o=null),o&&(e=e.replace(s,"Re:"));while(o||t>0);return e.replace(/[\s]+/g," ")},i._replySubjectAdd_=function(e,t,s){var o=null,n=i.trim(t);return n=null===(o=new a.RegExp("^"+e+"[\\s]?\\:(.*)$","gi").exec(t))||i.isUnd(o[1])?null===(o=new a.RegExp("^("+e+"[\\s]?[\\[\\(]?)([\\d]+)([\\]\\)]?[\\s]?\\:.*)$","gi").exec(t))||i.isUnd(o[1])||i.isUnd(o[2])||i.isUnd(o[3])?e+": "+t:o[1]+(i.pInt(o[2])+1)+o[3]:e+"[2]: "+o[1],n=n.replace(/[\s]+/g," "),n=(i.isUnd(s)?!0:s)?i.fixLongSubject(n):n},i._fixLongSubject_=function(e){var t=0,s=null;e=i.trim(e.replace(/[\s]+/g," "));do s=/^Re(\[([\d]+)\]|):[\s]{0,3}Re(\[([\d]+)\]|):/gi.exec(e),(!s||i.isUnd(s[0]))&&(s=null),s&&(t=0,t+=i.isUnd(s[2])?1:0+i.pInt(s[2]),t+=i.isUnd(s[4])?1:0+i.pInt(s[4]),e=e.replace(/^Re(\[[\d]+\]|):[\s]{0,3}Re(\[[\d]+\]|):/gi,"Re"+(t>0?"["+t+"]":"")+":"));while(s);return e=e.replace(/[\s]+/g," ")},i.roundNumber=function(e,t){return a.Math.round(e*a.Math.pow(10,t))/a.Math.pow(10,t)},i.friendlySize=function(e){return e=i.pInt(e),e>=1073741824?i.roundNumber(e/1073741824,1)+"GB":e>=1048576?i.roundNumber(e/1048576,1)+"MB":e>=1024?i.roundNumber(e/1024,0)+"KB":e+"B"},i.log=function(e){a.console&&a.console.log&&a.console.log(e)},i.getNotification=function(e,t){return e=i.pInt(e),p.Notification.ClientViewError===e&&t?t:i.isUnd(g.oNotificationI18N[e])?"":g.oNotificationI18N[e]},i.initNotificationLanguage=function(){var e=g.oNotificationI18N||{};e[p.Notification.InvalidToken]=i.i18n("NOTIFICATIONS/INVALID_TOKEN"),e[p.Notification.AuthError]=i.i18n("NOTIFICATIONS/AUTH_ERROR"),e[p.Notification.AccessError]=i.i18n("NOTIFICATIONS/ACCESS_ERROR"),e[p.Notification.ConnectionError]=i.i18n("NOTIFICATIONS/CONNECTION_ERROR"),e[p.Notification.CaptchaError]=i.i18n("NOTIFICATIONS/CAPTCHA_ERROR"),e[p.Notification.SocialFacebookLoginAccessDisable]=i.i18n("NOTIFICATIONS/SOCIAL_FACEBOOK_LOGIN_ACCESS_DISABLE"),e[p.Notification.SocialTwitterLoginAccessDisable]=i.i18n("NOTIFICATIONS/SOCIAL_TWITTER_LOGIN_ACCESS_DISABLE"),e[p.Notification.SocialGoogleLoginAccessDisable]=i.i18n("NOTIFICATIONS/SOCIAL_GOOGLE_LOGIN_ACCESS_DISABLE"),e[p.Notification.DomainNotAllowed]=i.i18n("NOTIFICATIONS/DOMAIN_NOT_ALLOWED"),e[p.Notification.AccountNotAllowed]=i.i18n("NOTIFICATIONS/ACCOUNT_NOT_ALLOWED"),e[p.Notification.AccountTwoFactorAuthRequired]=i.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_REQUIRED"),e[p.Notification.AccountTwoFactorAuthError]=i.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_ERROR"),e[p.Notification.CouldNotSaveNewPassword]=i.i18n("NOTIFICATIONS/COULD_NOT_SAVE_NEW_PASSWORD"),e[p.Notification.CurrentPasswordIncorrect]=i.i18n("NOTIFICATIONS/CURRENT_PASSWORD_INCORRECT"),e[p.Notification.NewPasswordShort]=i.i18n("NOTIFICATIONS/NEW_PASSWORD_SHORT"),e[p.Notification.NewPasswordWeak]=i.i18n("NOTIFICATIONS/NEW_PASSWORD_WEAK"),e[p.Notification.NewPasswordForbidden]=i.i18n("NOTIFICATIONS/NEW_PASSWORD_FORBIDDENT"),e[p.Notification.ContactsSyncError]=i.i18n("NOTIFICATIONS/CONTACTS_SYNC_ERROR"),e[p.Notification.CantGetMessageList]=i.i18n("NOTIFICATIONS/CANT_GET_MESSAGE_LIST"),e[p.Notification.CantGetMessage]=i.i18n("NOTIFICATIONS/CANT_GET_MESSAGE"),e[p.Notification.CantDeleteMessage]=i.i18n("NOTIFICATIONS/CANT_DELETE_MESSAGE"),e[p.Notification.CantMoveMessage]=i.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),e[p.Notification.CantCopyMessage]=i.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),e[p.Notification.CantSaveMessage]=i.i18n("NOTIFICATIONS/CANT_SAVE_MESSAGE"),e[p.Notification.CantSendMessage]=i.i18n("NOTIFICATIONS/CANT_SEND_MESSAGE"),e[p.Notification.InvalidRecipients]=i.i18n("NOTIFICATIONS/INVALID_RECIPIENTS"),e[p.Notification.CantCreateFolder]=i.i18n("NOTIFICATIONS/CANT_CREATE_FOLDER"),e[p.Notification.CantRenameFolder]=i.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER"),e[p.Notification.CantDeleteFolder]=i.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER"),e[p.Notification.CantDeleteNonEmptyFolder]=i.i18n("NOTIFICATIONS/CANT_DELETE_NON_EMPTY_FOLDER"),e[p.Notification.CantSubscribeFolder]=i.i18n("NOTIFICATIONS/CANT_SUBSCRIBE_FOLDER"),e[p.Notification.CantUnsubscribeFolder]=i.i18n("NOTIFICATIONS/CANT_UNSUBSCRIBE_FOLDER"),e[p.Notification.CantSaveSettings]=i.i18n("NOTIFICATIONS/CANT_SAVE_SETTINGS"),e[p.Notification.CantSavePluginSettings]=i.i18n("NOTIFICATIONS/CANT_SAVE_PLUGIN_SETTINGS"),e[p.Notification.DomainAlreadyExists]=i.i18n("NOTIFICATIONS/DOMAIN_ALREADY_EXISTS"),e[p.Notification.CantInstallPackage]=i.i18n("NOTIFICATIONS/CANT_INSTALL_PACKAGE"),e[p.Notification.CantDeletePackage]=i.i18n("NOTIFICATIONS/CANT_DELETE_PACKAGE"),e[p.Notification.InvalidPluginPackage]=i.i18n("NOTIFICATIONS/INVALID_PLUGIN_PACKAGE"),e[p.Notification.UnsupportedPluginPackage]=i.i18n("NOTIFICATIONS/UNSUPPORTED_PLUGIN_PACKAGE"),e[p.Notification.LicensingServerIsUnavailable]=i.i18n("NOTIFICATIONS/LICENSING_SERVER_IS_UNAVAILABLE"),e[p.Notification.LicensingExpired]=i.i18n("NOTIFICATIONS/LICENSING_EXPIRED"),e[p.Notification.LicensingBanned]=i.i18n("NOTIFICATIONS/LICENSING_BANNED"),e[p.Notification.DemoSendMessageError]=i.i18n("NOTIFICATIONS/DEMO_SEND_MESSAGE_ERROR"),e[p.Notification.AccountAlreadyExists]=i.i18n("NOTIFICATIONS/ACCOUNT_ALREADY_EXISTS"),e[p.Notification.MailServerError]=i.i18n("NOTIFICATIONS/MAIL_SERVER_ERROR"),e[p.Notification.InvalidInputArgument]=i.i18n("NOTIFICATIONS/INVALID_INPUT_ARGUMENT"),e[p.Notification.UnknownNotification]=i.i18n("NOTIFICATIONS/UNKNOWN_ERROR"),e[p.Notification.UnknownError]=i.i18n("NOTIFICATIONS/UNKNOWN_ERROR")},i.getUploadErrorDescByCode=function(e){var t="";switch(i.pInt(e)){case p.UploadErrorCode.FileIsTooBig:t=i.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG");break;case p.UploadErrorCode.FilePartiallyUploaded:t=i.i18n("UPLOAD/ERROR_FILE_PARTIALLY_UPLOADED");break;case p.UploadErrorCode.FileNoUploaded:t=i.i18n("UPLOAD/ERROR_NO_FILE_UPLOADED");break;case p.UploadErrorCode.MissingTempFolder:t=i.i18n("UPLOAD/ERROR_MISSING_TEMP_FOLDER");break;case p.UploadErrorCode.FileOnSaveingError:t=i.i18n("UPLOAD/ERROR_ON_SAVING_FILE");break;case p.UploadErrorCode.FileType:t=i.i18n("UPLOAD/ERROR_FILE_TYPE");break;default:t=i.i18n("UPLOAD/ERROR_UNKNOWN")}return t},i.delegateRun=function(e,t,s,n){e&&e[t]&&(n=i.pInt(n),0>=n?e[t].apply(e,i.isArray(s)?s:[]):o.delay(function(){e[t].apply(e,i.isArray(s)?s:[])},n))},i.killCtrlAandS=function(e){if(e=e||a.event,e&&e.ctrlKey&&!e.shiftKey&&!e.altKey){var t=e.target||e.srcElement,i=e.keyCode||e.which;if(i===p.EventKeyCode.S)return void e.preventDefault();if(t&&t.tagName&&t.tagName.match(/INPUT|TEXTAREA/i))return;i===p.EventKeyCode.A&&(a.getSelection?a.getSelection().removeAllRanges():a.document.selection&&a.document.selection.clear&&a.document.selection.clear(),e.preventDefault())}},i.createCommand=function(e,t,s){var o=t?function(){return o&&o.canExecute&&o.canExecute()&&t.apply(e,Array.prototype.slice.call(arguments)),!1}:function(){};return o.enabled=n.observable(!0),s=i.isUnd(s)?!0:s,o.canExecute=n.computed(i.isFunc(s)?function(){return o.enabled()&&s.call(e)}:function(){return o.enabled()&&!!s}),o},i.initDataConstructorBySettings=function(e){e.editorDefaultType=n.observable(p.EditorDefaultType.Html),e.showImages=n.observable(!1),e.interfaceAnimation=n.observable(p.InterfaceAnimation.Full),e.contactsAutosave=n.observable(!1),g.sAnimationType=p.InterfaceAnimation.Full,e.capaThemes=n.observable(!1),e.allowLanguagesOnSettings=n.observable(!0),e.allowLanguagesOnLogin=n.observable(!0),e.useLocalProxyForExternalImages=n.observable(!1),e.desktopNotifications=n.observable(!1),e.useThreads=n.observable(!0),e.replySameFolder=n.observable(!0),e.useCheckboxesInList=n.observable(!0),e.layout=n.observable(p.Layout.SidePreview),e.usePreviewPane=n.computed(function(){return p.Layout.NoPreview!==e.layout()}),e.interfaceAnimation.subscribe(function(e){if(g.bMobileDevice||e===p.InterfaceAnimation.None)l.removeClass("rl-anim rl-anim-full").addClass("no-rl-anim"),g.sAnimationType=p.InterfaceAnimation.None;else switch(e){case p.InterfaceAnimation.Full:l.removeClass("no-rl-anim").addClass("rl-anim rl-anim-full"),g.sAnimationType=e;break;case p.InterfaceAnimation.Normal:l.removeClass("no-rl-anim rl-anim-full").addClass("rl-anim"),g.sAnimationType=e}}),e.interfaceAnimation.valueHasMutated(),e.desktopNotificationsPermisions=n.computed(function(){e.desktopNotifications();var t=p.DesktopNotifications.NotSupported;if(d&&d.permission)switch(d.permission.toLowerCase()){case"granted":t=p.DesktopNotifications.Allowed;break;case"denied":t=p.DesktopNotifications.Denied;break;case"default":t=p.DesktopNotifications.NotAllowed}else a.webkitNotifications&&a.webkitNotifications.checkPermission&&(t=a.webkitNotifications.checkPermission());return t}),e.useDesktopNotifications=n.computed({read:function(){return e.desktopNotifications()&&p.DesktopNotifications.Allowed===e.desktopNotificationsPermisions()
},write:function(t){if(t){var i=e.desktopNotificationsPermisions();p.DesktopNotifications.Allowed===i?e.desktopNotifications(!0):p.DesktopNotifications.NotAllowed===i?d.requestPermission(function(){e.desktopNotifications.valueHasMutated(),p.DesktopNotifications.Allowed===e.desktopNotificationsPermisions()?e.desktopNotifications()?e.desktopNotifications.valueHasMutated():e.desktopNotifications(!0):e.desktopNotifications()?e.desktopNotifications(!1):e.desktopNotifications.valueHasMutated()}):e.desktopNotifications(!1)}else e.desktopNotifications(!1)}}),e.language=n.observable(""),e.languages=n.observableArray([]),e.mainLanguage=n.computed({read:e.language,write:function(t){t!==e.language()?-1<i.inArray(t,e.languages())?e.language(t):0<e.languages().length&&e.language(e.languages()[0]):e.language.valueHasMutated()}}),e.theme=n.observable(""),e.themes=n.observableArray([]),e.mainTheme=n.computed({read:e.theme,write:function(t){if(t!==e.theme()){var s=e.themes();-1<i.inArray(t,s)?e.theme(t):0<s.length&&e.theme(s[0])}else e.theme.valueHasMutated()}}),e.capaAdditionalAccounts=n.observable(!1),e.capaAdditionalIdentities=n.observable(!1),e.capaGravatar=n.observable(!1),e.determineUserLanguage=n.observable(!1),e.determineUserDomain=n.observable(!1),e.messagesPerPage=n.observable(h.Defaults.MessagesPerPage),e.mainMessagesPerPage=e.messagesPerPage,e.mainMessagesPerPage=n.computed({read:e.messagesPerPage,write:function(t){-1<i.inArray(i.pInt(t),h.Defaults.MessagesPerPageArray)?t!==e.messagesPerPage()&&e.messagesPerPage(t):e.messagesPerPage.valueHasMutated()}}),e.facebookSupported=n.observable(!1),e.facebookEnable=n.observable(!1),e.facebookAppID=n.observable(""),e.facebookAppSecret=n.observable(""),e.twitterEnable=n.observable(!1),e.twitterConsumerKey=n.observable(""),e.twitterConsumerSecret=n.observable(""),e.googleEnable=n.observable(!1),e.googleClientID=n.observable(""),e.googleClientSecret=n.observable(""),e.googleApiKey=n.observable(""),e.dropboxEnable=n.observable(!1),e.dropboxApiKey=n.observable(""),e.contactsIsAllowed=n.observable(!1)},i.createMomentDate=function(e){return i.isUnd(e.moment)&&(e.moment=n.observable(moment())),n.computed(function(){g.momentTrigger();var e=this.moment();return 1970===e.year()?"":e.fromNow()},e)},i.createMomentShortDate=function(e){return n.computed(function(){var e="",t=moment(),s=this.moment(),o=this.momentDate();return e=1970===s.year()?"":4>=t.diff(s,"hours")?o:t.format("L")===s.format("L")?i.i18n("MESSAGE_LIST/TODAY_AT",{TIME:s.format("LT")}):t.clone().subtract("days",1).format("L")===s.format("L")?i.i18n("MESSAGE_LIST/YESTERDAY_AT",{TIME:s.format("LT")}):s.format(t.year()===s.year()?"D MMM.":"LL")},e)},i.initBlockquoteSwitcher=function(e){if(e){var t=s("blockquote:not(.rl-bq-switcher)",e).filter(function(){return 0===s(this).parent().closest("blockquote",e).length});t&&0<t.length&&t.each(function(){var e=s(this),t=e.height();(0===t||t>100)&&(e.addClass("rl-bq-switcher hidden-bq"),s('<span class="rlBlockquoteSwitcher"><i class="icon-ellipsis" /></span>').insertBefore(e).click(function(){e.toggleClass("hidden-bq"),i.windowResize()}).after("<br />").before("<br />"))})}},i.removeBlockquoteSwitcher=function(e){e&&(s(e).find("blockquote.rl-bq-switcher").each(function(){s(this).removeClass("rl-bq-switcher hidden-bq")}),s(e).find(".rlBlockquoteSwitcher").each(function(){s(this).remove()}))},i.toggleMessageBlockquote=function(e){e&&e.find(".rlBlockquoteSwitcher").click()},i.convertThemeName=function(e){return"@custom"===e.substr(-7)&&(e=i.trim(e.substring(0,e.length-7))),i.trim(e.replace(/[^a-zA-Z]+/g," ").replace(/([A-Z])/g," $1").replace(/[\s]+/g," "))},i.quoteName=function(e){return e.replace(/["]/g,'\\"')},i.microtime=function(){return(new Date).getTime()},i.convertLangName=function(e,t){return i.i18n("LANGS_NAMES"+(!0===t?"_EN":"")+"/LANG_"+e.toUpperCase().replace(/[^a-zA-Z0-9]+/g,"_"),null,e)},i.fakeMd5=function(e){var t="",s="0123456789abcdefghijklmnopqrstuvwxyz";for(e=i.isUnd(e)?32:i.pInt(e);t.length<e;)t+=s.substr(a.Math.round(a.Math.random()*s.length),1);return t},i.md5=function(e){function t(e,t){return e<<t|e>>>32-t}function i(e,t){var i,s,o,n,a;return o=2147483648&e,n=2147483648&t,i=1073741824&e,s=1073741824&t,a=(1073741823&e)+(1073741823&t),i&s?2147483648^a^o^n:i|s?1073741824&a?3221225472^a^o^n:1073741824^a^o^n:a^o^n}function s(e,t,i){return e&t|~e&i}function o(e,t,i){return e&i|t&~i}function n(e,t,i){return e^t^i}function a(e,t,i){return t^(e|~i)}function r(e,o,n,a,r,l,c){return e=i(e,i(i(s(o,n,a),r),c)),i(t(e,l),o)}function l(e,s,n,a,r,l,c){return e=i(e,i(i(o(s,n,a),r),c)),i(t(e,l),s)}function c(e,s,o,a,r,l,c){return e=i(e,i(i(n(s,o,a),r),c)),i(t(e,l),s)}function u(e,s,o,n,r,l,c){return e=i(e,i(i(a(s,o,n),r),c)),i(t(e,l),s)}function d(e){for(var t,i=e.length,s=i+8,o=(s-s%64)/64,n=16*(o+1),a=Array(n-1),r=0,l=0;i>l;)t=(l-l%4)/4,r=l%4*8,a[t]=a[t]|e.charCodeAt(l)<<r,l++;return t=(l-l%4)/4,r=l%4*8,a[t]=a[t]|128<<r,a[n-2]=i<<3,a[n-1]=i>>>29,a}function p(e){var t,i,s="",o="";for(i=0;3>=i;i++)t=e>>>8*i&255,o="0"+t.toString(16),s+=o.substr(o.length-2,2);return s}function h(e){e=e.replace(/rn/g,"n");for(var t="",i=0;i<e.length;i++){var s=e.charCodeAt(i);128>s?t+=String.fromCharCode(s):s>127&&2048>s?(t+=String.fromCharCode(s>>6|192),t+=String.fromCharCode(63&s|128)):(t+=String.fromCharCode(s>>12|224),t+=String.fromCharCode(s>>6&63|128),t+=String.fromCharCode(63&s|128))}return t}var g,m,f,b,S,y,v,w,C,A=Array(),T=7,F=12,R=17,L=22,E=5,N=9,P=14,I=20,M=4,k=11,D=16,_=23,U=6,O=10,x=15,V=21;for(e=h(e),A=d(e),y=1732584193,v=4023233417,w=2562383102,C=271733878,g=0;g<A.length;g+=16)m=y,f=v,b=w,S=C,y=r(y,v,w,C,A[g+0],T,3614090360),C=r(C,y,v,w,A[g+1],F,3905402710),w=r(w,C,y,v,A[g+2],R,606105819),v=r(v,w,C,y,A[g+3],L,3250441966),y=r(y,v,w,C,A[g+4],T,4118548399),C=r(C,y,v,w,A[g+5],F,1200080426),w=r(w,C,y,v,A[g+6],R,2821735955),v=r(v,w,C,y,A[g+7],L,4249261313),y=r(y,v,w,C,A[g+8],T,1770035416),C=r(C,y,v,w,A[g+9],F,2336552879),w=r(w,C,y,v,A[g+10],R,4294925233),v=r(v,w,C,y,A[g+11],L,2304563134),y=r(y,v,w,C,A[g+12],T,1804603682),C=r(C,y,v,w,A[g+13],F,4254626195),w=r(w,C,y,v,A[g+14],R,2792965006),v=r(v,w,C,y,A[g+15],L,1236535329),y=l(y,v,w,C,A[g+1],E,4129170786),C=l(C,y,v,w,A[g+6],N,3225465664),w=l(w,C,y,v,A[g+11],P,643717713),v=l(v,w,C,y,A[g+0],I,3921069994),y=l(y,v,w,C,A[g+5],E,3593408605),C=l(C,y,v,w,A[g+10],N,38016083),w=l(w,C,y,v,A[g+15],P,3634488961),v=l(v,w,C,y,A[g+4],I,3889429448),y=l(y,v,w,C,A[g+9],E,568446438),C=l(C,y,v,w,A[g+14],N,3275163606),w=l(w,C,y,v,A[g+3],P,4107603335),v=l(v,w,C,y,A[g+8],I,1163531501),y=l(y,v,w,C,A[g+13],E,2850285829),C=l(C,y,v,w,A[g+2],N,4243563512),w=l(w,C,y,v,A[g+7],P,1735328473),v=l(v,w,C,y,A[g+12],I,2368359562),y=c(y,v,w,C,A[g+5],M,4294588738),C=c(C,y,v,w,A[g+8],k,2272392833),w=c(w,C,y,v,A[g+11],D,1839030562),v=c(v,w,C,y,A[g+14],_,4259657740),y=c(y,v,w,C,A[g+1],M,2763975236),C=c(C,y,v,w,A[g+4],k,1272893353),w=c(w,C,y,v,A[g+7],D,4139469664),v=c(v,w,C,y,A[g+10],_,3200236656),y=c(y,v,w,C,A[g+13],M,681279174),C=c(C,y,v,w,A[g+0],k,3936430074),w=c(w,C,y,v,A[g+3],D,3572445317),v=c(v,w,C,y,A[g+6],_,76029189),y=c(y,v,w,C,A[g+9],M,3654602809),C=c(C,y,v,w,A[g+12],k,3873151461),w=c(w,C,y,v,A[g+15],D,530742520),v=c(v,w,C,y,A[g+2],_,3299628645),y=u(y,v,w,C,A[g+0],U,4096336452),C=u(C,y,v,w,A[g+7],O,1126891415),w=u(w,C,y,v,A[g+14],x,2878612391),v=u(v,w,C,y,A[g+5],V,4237533241),y=u(y,v,w,C,A[g+12],U,1700485571),C=u(C,y,v,w,A[g+3],O,2399980690),w=u(w,C,y,v,A[g+10],x,4293915773),v=u(v,w,C,y,A[g+1],V,2240044497),y=u(y,v,w,C,A[g+8],U,1873313359),C=u(C,y,v,w,A[g+15],O,4264355552),w=u(w,C,y,v,A[g+6],x,2734768916),v=u(v,w,C,y,A[g+13],V,1309151649),y=u(y,v,w,C,A[g+4],U,4149444226),C=u(C,y,v,w,A[g+11],O,3174756917),w=u(w,C,y,v,A[g+2],x,718787259),v=u(v,w,C,y,A[g+9],V,3951481745),y=i(y,m),v=i(v,f),w=i(w,b),C=i(C,S);var K=p(y)+p(v)+p(w)+p(C);return K.toLowerCase()},i.convertPlainTextToHtml=function(e){return e.toString().replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/\r/g,"").replace(/\n/g,"<br />")},i.draggeblePlace=function(){return s('<div class="draggablePlace"><span class="text"></span>&nbsp;<i class="icon-copy icon-white visible-on-ctrl"></i><i class="icon-mail icon-white hidden-on-ctrl"></i></div>').appendTo("#rl-hidden")},i.defautOptionsAfterRender=function(e,t){t&&!i.isUnd(t.disabled)&&e&&s(e).toggleClass("disabled",t.disabled).prop("disabled",t.disabled)},i.windowPopupKnockout=function(e,t,o,r){var l=null,c=a.open(""),u="__OpenerApplyBindingsUid"+i.fakeMd5()+"__",d=s("#"+t);a[u]=function(){if(c&&c.document.body&&d&&d[0]){var t=s(c.document.body);s("#rl-content",t).html(d.html()),s("html",c.document).addClass("external "+s("html").attr("class")),i.i18nToNode(t),e&&s("#rl-content",t)[0]&&n.applyBindings(e,s("#rl-content",t)[0]),a[u]=null,r(c)}},c.document.open(),c.document.write('<html><head><meta charset="utf-8" /><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /><meta name="viewport" content="user-scalable=no" /><meta name="apple-mobile-web-app-capable" content="yes" /><meta name="robots" content="noindex, nofollow, noodp" /><title>'+i.encodeHtml(o)+'</title></head><body><div id="rl-content"></div></body></html>'),c.document.close(),l=c.document.createElement("script"),l.type="text/javascript",l.innerHTML="if(window&&window.opener&&window.opener['"+u+"']){window.opener['"+u+"']();window.opener['"+u+"']=null}",c.document.getElementsByTagName("head")[0].appendChild(l)},i.settingsSaveHelperFunction=function(e,t,s,n){return s=s||null,n=i.isUnd(n)?1e3:i.pInt(n),function(i,a,r,l,c){t.call(s,a&&a.Result?p.SaveSettingsStep.TrueResult:p.SaveSettingsStep.FalseResult),e&&e.call(s,i,a,r,l,c),o.delay(function(){t.call(s,p.SaveSettingsStep.Idle)},n)}},i.settingsSaveHelperSimpleFunction=function(e,t){return i.settingsSaveHelperFunction(null,e,t,1e3)},i.htmlToPlain=function(e){var t=0,i=0,o=0,n=0,a=0,r="",l=function(e){for(var t=100,i="",s="",o=e,n=0,a=0;o.length>t;)s=o.substring(0,t),n=s.lastIndexOf(" "),a=s.lastIndexOf("\n"),-1!==a&&(n=a),-1===n&&(n=t),i+=s.substring(0,n)+"\n",o=o.substring(n+1);return i+o},u=function(e){return e=l(s.trim(e)),e="> "+e.replace(/\n/gm,"\n> "),e.replace(/(^|\n)([> ]+)/gm,function(){return arguments&&2<arguments.length?arguments[1]+s.trim(arguments[2].replace(/[\s]/g,""))+" ":""})},d=function(){if(arguments&&1<arguments.length){var e=s.trim(arguments[1]);return 0<e.length&&(e=e.replace(/<div[^>]*>([\s\S\r\n]*)<\/div>/gim,d),e="\n"+s.trim(e)+"\n"),e}return""},p=function(){return arguments&&1<arguments.length?arguments[1].toString().replace(/[\n]/gm,"<br />"):""},h=function(){return arguments&&1<arguments.length?""+arguments[1]+arguments[2].replace(/</g,"&lt;").replace(/>/g,"&gt;"):""},g=function(){return arguments&&1<arguments.length?s.trim(arguments[1]):""};for(r=e.replace(/<pre[^>]*>([\s\S\r\n]*)<\/pre>/gim,p).replace(/[\s]+/gm," ").replace(/((?:href|data)\s?=\s?)("[^"]+?"|'[^']+?')/gim,h).replace(/<br[^>]*>/gim,"\n").replace(/<\/h[\d]>/gi,"\n").replace(/<\/p>/gi,"\n\n").replace(/<\/li>/gi,"\n").replace(/<\/td>/gi,"\n").replace(/<\/tr>/gi,"\n").replace(/<hr[^>]*>/gim,"\n_______________________________\n\n").replace(/<div[^>]*>([\s\S\r\n]*)<\/div>/gim,d).replace(/<blockquote[^>]*>/gim,"\n__bq__start__\n").replace(/<\/blockquote>/gim,"\n__bq__end__\n").replace(/<a [^>]*>([\s\S\r\n]*?)<\/a>/gim,g).replace(/<\/div>/gi,"\n").replace(/&nbsp;/gi," ").replace(/&quot;/gi,'"').replace(/<[^>]*>/gm,""),r=c.html(r).text(),r=r.replace(/\n[ \t]+/gm,"\n").replace(/[\n]{3,}/gm,"\n\n").replace(/&gt;/gi,">").replace(/&lt;/gi,"<").replace(/&amp;/gi,"&"),t=0,a=100;a>0&&(a--,i=r.indexOf("__bq__start__",t),i>-1);)o=r.indexOf("__bq__start__",i+5),n=r.indexOf("__bq__end__",i+5),(-1===o||o>n)&&n>i?(r=r.substring(0,i)+u(r.substring(i+13,n))+r.substring(n+11),t=0):t=o>-1&&n>o?o-1:0;return r=r.replace(/__bq__start__/gm,"").replace(/__bq__end__/gm,"")},i.plainToHtml=function(e,t){e=e.toString().replace(/\r/g,"");var s=!1,o=!0,n=!0,a=[],r="",l=0,c=e.split("\n");do{for(o=!1,a=[],l=0;l<c.length;l++)r=c[l],n=">"===r.substr(0,1),n&&!s?(o=!0,s=!0,a.push("~~~blockquote~~~"),a.push(r.substr(1))):!n&&s?(s=!1,a.push("~~~/blockquote~~~"),a.push(r)):a.push(n&&s?r.substr(1):r);s&&(s=!1,a.push("~~~/blockquote~~~")),c=a}while(o);return e=c.join("\n"),e=e.replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/~~~blockquote~~~[\s]*/g,"<blockquote>").replace(/[\s]*~~~\/blockquote~~~/g,"</blockquote>").replace(/[\-_~]{10,}/g,"<hr />").replace(/\n/g,"<br />"),t?i.linkify(e):e},a.rainloop_Utils_htmlToPlain=i.htmlToPlain,a.rainloop_Utils_plainToHtml=i.plainToHtml,i.linkify=function(e){return s.fn&&s.fn.linkify&&(e=c.html(e.replace(/&amp;/gi,"amp_amp_12345_amp_amp")).linkify().find(".linkified").removeClass("linkified").end().html().replace(/amp_amp_12345_amp_amp/g,"&amp;")),e},i.resizeAndCrop=function(e,t,i){var s=new a.Image;s.onload=function(){var e=[0,0],s=a.document.createElement("canvas"),o=s.getContext("2d");s.width=t,s.height=t,e=this.width>this.height?[this.width-this.height,0]:[0,this.height-this.width],o.fillStyle="#fff",o.fillRect(0,0,t,t),o.drawImage(this,e[0]/2,e[1]/2,this.width-e[0],this.height-e[1],0,0,t,t),i(s.toDataURL("image/jpeg"))},s.src=e},i.folderListOptionsBuilder=function(e,t,s,o,n,r,l,c,u,d){var h=null,g=!1,m=0,f=0,b="   ",S=[];for(u=i.isNormal(u)?u:0<e.length,d=i.isUnd(d)?!1:!!d,n=i.isNormal(n)?n:0,r=i.isNormal(r)?r:null,l=i.isNormal(l)?l:null,c=i.isNormal(c)?c:null,i.isArray(s)||(s=[]),i.isArray(o)||(o=[]),m=0,f=o.length;f>m;m++)S.push({id:o[m][0],name:o[m][1],system:!1,seporator:!1,disabled:!1});for(g=!0,m=0,f=e.length;f>m;m++)h=e[m],(l?l.call(null,h):!0)&&(g&&0<S.length&&S.push({id:"---",name:"---",system:!1,seporator:!0,disabled:!0}),g=!1,S.push({id:h.fullNameRaw,name:c?c.call(null,h):h.name(),system:!0,seporator:!1,disabled:!h.selectable||-1<i.inArray(h.fullNameRaw,s)||(r?r.call(null,h):!1)}));for(g=!0,m=0,f=t.length;f>m;m++)h=t[m],(h.subScribed()||!h.existen)&&(l?l.call(null,h):!0)&&(p.FolderType.User===h.type()||!u||0<h.subFolders().length)&&(g&&0<S.length&&S.push({id:"---",name:"---",system:!1,seporator:!0,disabled:!0}),g=!1,S.push({id:h.fullNameRaw,name:new a.Array(h.deep+1-n).join(b)+(c?c.call(null,h):h.name()),system:!1,seporator:!1,disabled:!h.selectable||-1<i.inArray(h.fullNameRaw,s)||(r?r.call(null,h):!1)})),h.subScribed()&&0<h.subFolders().length&&(S=S.concat(i.folderListOptionsBuilder([],h.subFolders(),s,[],n,r,l,c,u,d)));return S},i.computedPagenatorHelper=function(e,t){return function(){var s=0,o=0,n=2,r=[],l=e(),c=t(),u=function(e,t,s){var o={current:e===l,name:i.isUnd(s)?e.toString():s.toString(),custom:i.isUnd(s)?!1:!0,title:i.isUnd(s)?"":e.toString(),value:e.toString()};(i.isUnd(t)?0:!t)?r.unshift(o):r.push(o)};if(c>1||c>0&&l>c){for(l>c?(u(c),s=c,o=c):((3>=l||l>=c-2)&&(n+=2),u(l),s=l,o=l);n>0;)if(s-=1,o+=1,s>0&&(u(s,!1),n--),c>=o)u(o,!0),n--;else if(0>=s)break;3===s?u(2,!1):s>3&&u(a.Math.round((s-1)/2),!1,"..."),c-2===o?u(c-1,!0):c-2>o&&u(a.Math.round((c+o)/2),!0,"..."),s>1&&u(1,!1),c>o&&u(c,!0)}return r}},i.selectElement=function(e){if(a.getSelection){var t=a.getSelection();t.removeAllRanges();var i=a.document.createRange();i.selectNodeContents(e),t.addRange(i)}else if(a.document.selection){var s=a.document.body.createTextRange();s.moveToElementText(e),s.select()}},i.detectDropdownVisibility=o.debounce(function(){g.dropdownVisibility(!!o.find(g.aBootstrapDropdowns,function(e){return e.hasClass("open")}))},50),i.triggerAutocompleteInputChange=function(e){var t=function(){s(".checkAutocomplete").trigger("change")};e?o.delay(t,100):t()},e.exports=i}(t,e)},{$:26,$div:15,$doc:16,$html:17,$win:18,Consts:6,Enums:7,Globals:9,NotificationClass:22,_:31,ko:28,window:32}],15:[function(e,t){t.exports=e("$")("<div></div>")},{$:26}],16:[function(e,t){t.exports=e("$")(window.document)},{$:26}],17:[function(e,t){t.exports=e("$")("html")},{$:26}],18:[function(e,t){t.exports=e("$")(window)},{$:26}],19:[function(e,t){t.exports=e("window").rainloopAppData||{}},{window:32}],20:[function(e,t){t.exports=JSON},{}],21:[function(e,t){t.exports=Jua},{}],22:[function(e,t){var i=e("window");t.exports=i.Notification&&i.Notification.requestPermission?i.Notification:null},{window:32}],23:[function(e,t){t.exports=crossroads},{}],24:[function(e,t){t.exports=hasher},{}],25:[function(e,t){t.exports=ifvisible},{}],26:[function(e,t){t.exports=$},{}],27:[function(e,t){t.exports=key},{}],28:[function(e,t){!function(t,i){"use strict";var s=e("window"),o=e("_"),n=e("$"),a=e("$win"),r=e("$doc");i.bindingHandlers.tooltip={init:function(t,s){var o=e("Globals"),a=e("Utils");if(!o.bMobileDevice){var r=n(t),l=r.data("tooltip-class")||"",c=r.data("tooltip-placement")||"top";r.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:c,trigger:"hover",title:function(){return r.is(".disabled")||o.dropdownVisibility()?"":'<span class="tooltip-class '+l+'">'+a.i18n(i.utils.unwrapObservable(s()))+"</span>"}}).click(function(){r.tooltip("hide")}),o.tooltipTrigger.subscribe(function(){r.tooltip("hide")})}}},i.bindingHandlers.tooltip2={init:function(t,i){var s=e("Globals"),o=n(t),a=o.data("tooltip-class")||"",r=o.data("tooltip-placement")||"top";o.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:r,title:function(){return o.is(".disabled")||s.dropdownVisibility()?"":'<span class="tooltip-class '+a+'">'+i()()+"</span>"}}).click(function(){o.tooltip("hide")}),s.tooltipTrigger.subscribe(function(){o.tooltip("hide")})}},i.bindingHandlers.tooltip3={init:function(t){var i=n(t),s=e("Globals");i.tooltip({container:"body",trigger:"hover manual",title:function(){return i.data("tooltip3-data")||""}}),r.click(function(){i.tooltip("hide")}),s.tooltipTrigger.subscribe(function(){i.tooltip("hide")})},update:function(e,t){var s=i.utils.unwrapObservable(t());""===s?n(e).data("tooltip3-data","").tooltip("hide"):n(e).data("tooltip3-data",s).tooltip("show")}},i.bindingHandlers.registrateBootstrapDropdown={init:function(t){var i=e("Globals");i.aBootstrapDropdowns.push(n(t))}},i.bindingHandlers.openDropdownTrigger={update:function(t,s){if(i.utils.unwrapObservable(s())){var o=n(t),a=e("Utils");o.hasClass("open")||(o.find(".dropdown-toggle").dropdown("toggle"),a.detectDropdownVisibility()),s()(!1)}}},i.bindingHandlers.dropdownCloser={init:function(e){n(e).closest(".dropdown").on("click",".e-item",function(){n(e).dropdown("toggle")})}},i.bindingHandlers.popover={init:function(e,t){n(e).popover(i.utils.unwrapObservable(t()))}},i.bindingHandlers.csstext={init:function(t,s){var o=e("Utils");t&&t.styleSheet&&!o.isUnd(t.styleSheet.cssText)?t.styleSheet.cssText=i.utils.unwrapObservable(s()):n(t).text(i.utils.unwrapObservable(s()))},update:function(t,s){var o=e("Utils");t&&t.styleSheet&&!o.isUnd(t.styleSheet.cssText)?t.styleSheet.cssText=i.utils.unwrapObservable(s()):n(t).text(i.utils.unwrapObservable(s()))}},i.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"})}},i.bindingHandlers.onEnter={init:function(e,t,i,o){n(e).on("keypress",function(i){i&&13===s.parseInt(i.keyCode,10)&&(n(e).trigger("change"),t().call(o))})}},i.bindingHandlers.onEsc={init:function(e,t,i,o){n(e).on("keypress",function(i){i&&27===s.parseInt(i.keyCode,10)&&(n(e).trigger("change"),t().call(o))})}},i.bindingHandlers.clickOnTrue={update:function(e,t){i.utils.unwrapObservable(t())&&n(e).click()}},i.bindingHandlers.modal={init:function(t,s){var o=e("Globals"),a=e("Utils");n(t).toggleClass("fade",!o.bMobileDevice).modal({keyboard:!1,show:i.utils.unwrapObservable(s())}).on("shown",function(){a.windowResize()}).find(".close").click(function(){s()(!1)})},update:function(e,t){n(e).modal(i.utils.unwrapObservable(t())?"show":"hide")}},i.bindingHandlers.i18nInit={init:function(t){var i=e("Utils");i.i18nToNode(t)}},i.bindingHandlers.i18nUpdate={update:function(t,s){var o=e("Utils");i.utils.unwrapObservable(s()),o.i18nToNode(t)}},i.bindingHandlers.link={update:function(e,t){n(e).attr("href",i.utils.unwrapObservable(t()))}},i.bindingHandlers.title={update:function(e,t){n(e).attr("title",i.utils.unwrapObservable(t()))}},i.bindingHandlers.textF={init:function(e,t){n(e).text(i.utils.unwrapObservable(t()))}},i.bindingHandlers.initDom={init:function(e,t){t()(e)}},i.bindingHandlers.initResizeTrigger={init:function(e,t){var s=i.utils.unwrapObservable(t());n(e).css({height:s[1],"min-height":s[1]})},update:function(t,s){var o=e("Utils"),r=i.utils.unwrapObservable(s()),l=o.pInt(r[1]),c=0,u=n(t).offset().top;u>0&&(u+=o.pInt(r[2]),c=a.height()-u,c>l&&(l=c),n(t).css({height:l,"min-height":l}))}},i.bindingHandlers.appendDom={update:function(e,t){n(e).hide().empty().append(i.utils.unwrapObservable(t())).show()}},i.bindingHandlers.draggable={init:function(t,o,a){var r=e("Globals"),l=e("Utils");if(!r.bMobileDevice){var c=100,u=3,d=a(),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,i=null,o=n(this),a=o.offset(),r=a.top+o.height();s.clearInterval(o.data("timerScroll")),o.data("timerScroll",!1),e.pageX>=a.left&&e.pageX<=a.left+o.width()&&(e.pageY>=r-c&&e.pageY<=r&&(t=function(){o.scrollTop(o.scrollTop()+u),l.windowResize()},o.data("timerScroll",s.setInterval(t,10)),t()),e.pageY>=a.top&&e.pageY<=a.top+c&&(i=function(){o.scrollTop(o.scrollTop()-u),l.windowResize()},o.data("timerScroll",s.setInterval(i,10)),i()))})},h.stop=function(){n(p).each(function(){s.clearInterval(n(this).data("timerScroll")),n(this).data("timerScroll",!1)})}),h.helper=function(e){return o()(e&&e.target?i.dataFor(e.target):null)},n(t).draggable(h).on("mousedown",function(){l.removeInFocus()})}}},i.bindingHandlers.droppable={init:function(t,i,s){var o=e("Globals");if(!o.bMobileDevice){var a=i(),r=s(),l=r&&r.droppableOver?r.droppableOver:null,c=r&&r.droppableOut?r.droppableOut:null,u={tolerance:"pointer",hoverClass:"droppableHover"};a&&(u.drop=function(e,t){a(e,t)},l&&(u.over=function(e,t){l(e,t)}),c&&(u.out=function(e,t){c(e,t)}),n(t).droppable(u))}}},i.bindingHandlers.nano={init:function(t){var i=e("Globals");i.bDisableNanoScroll||n(t).addClass("nano").nanoScroller({iOSNativeScrolling:!1,preventPageScrolling:!0})}},i.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('&nbsp;&nbsp;<i class="icon-spinner animated"></i><i class="icon-remove error"></i><i class="icon-ok success"></i>').addClass("settings-saved-trigger"):t.addClass("settings-saved-trigger-input")},update:function(e,t){var s=i.utils.unwrapObservable(t()),o=n(e);if("custom"===o.data("save-trigger-type"))switch(s.toString()){case"1":o.find(".animated,.error").hide().removeClass("visible").end().find(".success").show().addClass("visible");break;case"0":o.find(".animated,.success").hide().removeClass("visible").end().find(".error").show().addClass("visible");break;case"-2":o.find(".error,.success").hide().removeClass("visible").end().find(".animated").show().addClass("visible");break;default:o.find(".animated").hide().end().find(".error,.success").removeClass("visible")}else switch(s.toString()){case"1":o.addClass("success").removeClass("error");break;case"0":o.addClass("error").removeClass("success");break;case"-2":break;default:o.removeClass("error success")}}},i.bindingHandlers.emailsTags={init:function(t,i,s){var a=e("Utils"),r=e("Model:Email"),l=n(t),c=i(),u=s(),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 o.map(e,function(e){var t=a.trim(e),i=null;return""!==t?(i=new r,i.mailsoParse(t),i.clearDuplicateName(),[i.toLine(!1),i]):[t,null]})},change:o.bind(function(e){l.data("EmailsTagsValue",e.target.value),c(e.target.value)},this)})},update:function(e,t,s){var o=n(e),a=s(),r=a.emailsTagsFilter||null,l=i.utils.unwrapObservable(t());o.data("EmailsTagsValue")!==l&&(o.val(l),o.data("EmailsTagsValue",l),o.inputosaurus("refresh")),r&&i.utils.unwrapObservable(r)&&o.inputosaurus("focus")}},i.bindingHandlers.contactTags={init:function(t,i,s){var a=e("Utils"),r=e("Model:ContactTag"),l=n(t),c=i(),u=s(),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 o.map(e,function(e){var t=a.trim(e),i=null;return""!==t?(i=new r,i.name(t),[i.toLine(!1),i]):[t,null]})},change:o.bind(function(e){l.data("ContactTagsValue",e.target.value),c(e.target.value)},this)})},update:function(e,t,s){var o=n(e),a=s(),r=a.contactTagsFilter||null,l=i.utils.unwrapObservable(t());o.data("ContactTagsValue")!==l&&(o.val(l),o.data("ContactTagsValue",l),o.inputosaurus("refresh")),r&&i.utils.unwrapObservable(r)&&o.inputosaurus("focus")}},i.bindingHandlers.command={init:function(e,t,s,o){var a=n(e),r=t();if(!r||!r.enabled||!r.canExecute)throw new Error("You are not using command function");a.addClass("command"),i.bindingHandlers[a.is("form")?"submit":"click"].init.apply(o,arguments)},update:function(e,t){var i=!0,s=n(e),o=t();i=o.enabled(),s.toggleClass("command-not-enabled",!i),i&&(i=o.canExecute(),s.toggleClass("command-can-not-be-execute",!i)),s.toggleClass("command-disabled disable disabled",!i).toggleClass("no-disabled",!!i),(s.is("input")||s.is("button"))&&s.prop("disabled",!i)}},i.extenders.trimmer=function(t){var s=e("Utils"),o=i.computed({read:t,write:function(e){t(s.trim(e.toString()))},owner:this});return o(t()),o},i.extenders.posInterer=function(t,s){var o=e("Utils"),n=i.computed({read:t,write:function(e){var i=o.pInt(e.toString(),s);0>=i&&(i=s),i===t()&&""+i!=""+e&&t(i+1),t(i)}});return n(t()),n},i.extenders.reversible=function(e){var t=e();return e.commit=function(){t=e()},e.reverse=function(){e(t)},e.commitedValue=function(){return t},e},i.extenders.toggleSubscribe=function(e,t){return e.subscribe(t[1],t[0],"beforeChange"),e.subscribe(t[2],t[0]),e},i.extenders.falseTimeout=function(t,i){var o=e("Utils");return t.iTimeout=0,t.subscribe(function(e){e&&(s.clearTimeout(t.iTimeout),t.iTimeout=s.setTimeout(function(){t(!1),t.iTimeout=0},o.pInt(i)))}),t},i.observable.fn.validateNone=function(){return this.hasError=i.observable(!1),this},i.observable.fn.validateEmail=function(){var t=e("Utils");return this.hasError=i.observable(!1),this.subscribe(function(e){e=t.trim(e),this.hasError(""!==e&&!/^[^@\s]+@[^@\s]+$/.test(e))},this),this.valueHasMutated(),this},i.observable.fn.validateSimpleEmail=function(){var t=e("Utils");return this.hasError=i.observable(!1),this.subscribe(function(e){e=t.trim(e),this.hasError(""!==e&&!/^.+@.+$/.test(e))},this),this.valueHasMutated(),this},i.observable.fn.validateFunc=function(t){var s=e("Utils");return this.hasFuncError=i.observable(!1),s.isFunc(t)&&(this.subscribe(function(e){this.hasFuncError(!t(e))},this),this.valueHasMutated()),this},t.exports=i}(t,ko)},{$:26,$doc:16,$win:18,Globals:9,"Model:ContactTag":42,"Model:Email":43,Utils:14,_:31,window:32}],29:[function(e,t){t.exports=moment},{}],30:[function(e,t){t.exports=ssm},{}],31:[function(e,t){t.exports=_},{}],32:[function(e,t){t.exports=window},{}],33:[function(e,t){!function(e,t){"use strict";function i(){this.oScreens={},this.sDefaultScreenName="",this.oCurrentScreen=null}var s=t("$"),o=t("_"),n=t("ko"),a=t("hasher"),r=t("crossroads"),l=t("$html"),c=t("Globals"),u=t("Plugins"),d=t("Utils"),p=t("Knoin:AbstractViewModel");i.prototype.oScreens={},i.prototype.sDefaultScreenName="",i.prototype.oCurrentScreen=null,i.prototype.hideLoading=function(){s("#rl-loading").hide()},i.prototype.constructorEnd=function(e){d.isFunc(e.__constructor_end)&&e.__constructor_end.call(e)},i.prototype.extendAsViewModel=function(e,t,i){t&&(i||(i=p),t.__name=e,u.regViewModelHook(e,t),o.extend(t.prototype,i.prototype))},i.prototype.addSettingsViewModel=function(e,t,i,s,o){e.__rlSettingsData={Label:i,Template:t,Route:s,IsDefault:!!o},c.aViewModels.settings.push(e)},i.prototype.removeSettingsViewModel=function(e){c.aViewModels["settings-removed"].push(e)},i.prototype.disableSettingsViewModel=function(e){c.aViewModels["settings-disabled"].push(e)},i.prototype.routeOff=function(){a.changed.active=!1},i.prototype.routeOn=function(){a.changed.active=!0},i.prototype.screen=function(e){return""===e||d.isUnd(this.oScreens[e])?null:this.oScreens[e]},i.prototype.buildViewModel=function(e,t){if(e&&!e.__builded){var i=this,a=new e(t),r=a.viewModelPosition(),l=s("#rl-content #rl-"+r.toLowerCase()),p=null;e.__builded=!0,e.__vm=a,a.viewModelName=e.__name,l&&1===l.length?(p=s("<div></div>").addClass("rl-view-model").addClass("RL-"+a.viewModelTemplate()).hide(),p.appendTo(l),a.viewModelDom=p,e.__dom=p,"Popups"===r&&(a.cancelCommand=a.closeCommand=d.createCommand(a,function(){i.hideScreenPopup(e)}),a.modalVisibility.subscribe(function(e){var t=this;e?(this.viewModelDom.show(),this.storeAndSetKeyScope(),c.popupVisibilityNames.push(this.viewModelName),a.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),a.viewModelDom.css("z-index",2e3),c.tooltipTrigger(!c.tooltipTrigger()),o.delay(function(){t.viewModelDom.hide()},300))},a)),u.runHook("view-model-pre-build",[e.__name,a,p]),n.applyBindingAccessorsToNode(p[0],{i18nInit:!0,template:function(){return{name:a.viewModelTemplate()}}},a),d.delegateRun(a,"onBuild",[p]),a&&"Popups"===r&&a.registerPopupKeyDown(),u.runHook("view-model-post-build",[e.__name,a,p])):d.log("Cannot find view model position: "+r)}return e?e.__vm:null},i.prototype.hideScreenPopup=function(e){e&&e.__vm&&e.__dom&&(e.__vm.modalVisibility(!1),u.runHook("view-model-on-hide",[e.__name,e.__vm]))},i.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||[]])))},i.prototype.isPopupVisible=function(e){return e&&e.__vm?e.__vm.modalVisibility():!1},i.prototype.screenOnRoute=function(e,t){var i=this,s=null,n=null;""===d.pString(e)&&(e=this.sDefaultScreenName),""!==e&&(s=this.screen(e),s||(s=this.screen(this.sDefaultScreenName),s&&(t=e+"/"+t,e=this.sDefaultScreenName)),s&&s.__started&&(s.__builded||(s.__builded=!0,d.isNonEmptyArray(s.viewModels())&&o.each(s.viewModels(),function(e){this.buildViewModel(e,s)},this),d.delegateRun(s,"onBuild")),o.defer(function(){i.oCurrentScreen&&(d.delegateRun(i.oCurrentScreen,"onHide"),d.isNonEmptyArray(i.oCurrentScreen.viewModels())&&o.each(i.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.hide(),e.__vm.viewModelVisibility(!1),d.delegateRun(e.__vm,"onHide"))})),i.oCurrentScreen=s,i.oCurrentScreen&&(d.delegateRun(i.oCurrentScreen,"onShow"),u.runHook("screen-on-show",[i.oCurrentScreen.screenName(),i.oCurrentScreen]),d.isNonEmptyArray(i.oCurrentScreen.viewModels())&&o.each(i.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]))},i)),n=s.__cross?s.__cross():null,n&&n.parse(t)})))},i.prototype.startScreens=function(e){s("#rl-content").css({visibility:"hidden"}),o.each(e,function(e){var t=new e,i=t?t.screenName():"";t&&""!==i&&(""===this.sDefaultScreenName&&(this.sDefaultScreenName=i),this.oScreens[i]=t)},this),o.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=r.create();t.addRoute(/^([a-zA-Z0-9\-]*)\/?(.*)$/,o.bind(this.screenOnRoute,this)),a.initialized.add(t.parse,t),a.changed.add(t.parse,t),a.init(),s("#rl-content").css({visibility:"visible"}),o.delay(function(){l.removeClass("rl-started-trigger").addClass("rl-started")},50)},i.prototype.setHash=function(e,t,i){e="#"===e.substr(0,1)?e.substr(1):e,e="/"===e.substr(0,1)?e.substr(1):e,i=d.isUnd(i)?!1:!!i,(d.isUnd(t)?1:!t)?(a.changed.active=!0,a[i?"replaceHash":"setHash"](e),a.setHash(e)):(a.changed.active=!1,a[i?"replaceHash":"setHash"](e),a.changed.active=!0)},e.exports=new i}(t,e)},{$:26,$html:17,Globals:9,"Knoin:AbstractViewModel":36,Plugins:12,Utils:14,_:31,crossroads:23,hasher:24,ko:28}],34:[function(e,t){!function(e){"use strict";function t(){}t.prototype.bootstart=function(){},e.exports=t}(t,e)},{}],35:[function(e,t){!function(e,t){"use strict";function i(e,t){this.sScreenName=e,this.aViewModels=o.isArray(t)?t:[]}var s=t("crossroads"),o=t("Utils");i.prototype.oCross=null,i.prototype.sScreenName="",i.prototype.aViewModels=[],i.prototype.viewModels=function(){return this.aViewModels},i.prototype.screenName=function(){return this.sScreenName},i.prototype.routes=function(){return null},i.prototype.__cross=function(){return this.oCross},i.prototype.__start=function(){var e=this.routes(),t=null,i=null;o.isNonEmptyArray(e)&&(i=_.bind(this.onRoute||o.emptyFunction,this),t=s.create(),_.each(e,function(e){t.addRoute(e[0],i).rules=e[1]}),this.oCross=t)},e.exports=i}(t,e)},{Utils:14,crossroads:23}],36:[function(e,t){!function(e,t){"use strict";function i(e,t){this.bDisabeCloseOnEsc=!1,this.sPosition=r.pString(e),this.sTemplate=r.pString(t),this.sDefaultKeyScope=n.KeyState.None,this.sCurrentKeyScope=this.sDefaultKeyScope,this.viewModelName="",this.viewModelVisibility=s.observable(!1),this.modalVisibility=s.observable(!1).extend({rateLimit:0}),this.viewModelDom=null}var s=t("ko"),o=t("$win"),n=t("Enums"),a=t("Globals"),r=t("Utils");i.prototype.sPosition="",i.prototype.sTemplate="",i.prototype.viewModelName="",i.prototype.viewModelDom=null,i.prototype.viewModelTemplate=function(){return this.sTemplate},i.prototype.viewModelPosition=function(){return this.sPosition},i.prototype.cancelCommand=function(){},i.prototype.closeCommand=function(){},i.prototype.storeAndSetKeyScope=function(){this.sCurrentKeyScope=a.keyScope(),a.keyScope(this.sDefaultKeyScope)},i.prototype.restoreKeyScope=function(){a.keyScope(this.sCurrentKeyScope)},i.prototype.registerPopupKeyDown=function(){var e=this;o.on("keydown",function(t){if(t&&e.modalVisibility&&e.modalVisibility()){if(!this.bDisabeCloseOnEsc&&n.EventKeyCode.Esc===t.keyCode)return r.delegateRun(e,"cancelCommand"),!1;if(n.EventKeyCode.Backspace===t.keyCode&&!r.inFocus())return!1}return!0})},e.exports=i}(t,e)},{$win:18,Enums:7,Globals:9,Utils:14,ko:28}],37:[function(e,t){!function(e,t){"use strict";function i(e,t){this.email=e,this.deleteAccess=s.observable(!1),this.canBeDalete=s.observable(o.isUnd(t)?!0:!!t)}var s=t("ko"),o=t("Utils");i.prototype.email="",i.prototype.changeAccountLink=function(){return t("LinkBuilder").change(this.email)},e.exports=i}(t,e)},{LinkBuilder:11,Utils:14,ko:28}],38:[function(e,t){!function(e,t){"use strict";function i(){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 s=t("window"),o=t("Globals"),n=t("Utils"),a=t("LinkBuilder");i.newInstanceFromJson=function(e){var t=new i;return t.initByJson(e)?t:null},i.prototype.mimeType="",i.prototype.fileName="",i.prototype.estimatedSize=0,i.prototype.friendlySize="",i.prototype.isInline=!1,i.prototype.isLinked=!1,i.prototype.cid="",i.prototype.cidWithOutTags="",i.prototype.contentLocation="",i.prototype.download="",i.prototype.folder="",i.prototype.uid="",i.prototype.mimeIndex="",i.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},i.prototype.isImage=function(){return-1<n.inArray(this.mimeType.toLowerCase(),["image/png","image/jpg","image/jpeg","image/gif"])},i.prototype.isText=function(){return"text/"===this.mimeType.substr(0,5)&&-1===n.inArray(this.mimeType,["text/html"])},i.prototype.isPdf=function(){return o.bAllowPdfPreview&&"application/pdf"===this.mimeType},i.prototype.linkDownload=function(){return a.attachmentDownload(this.download)},i.prototype.linkPreview=function(){return a.attachmentPreview(this.download)},i.prototype.linkPreviewAsPlain=function(){return a.attachmentPreviewAsPlain(this.download)},i.prototype.generateTransferDownloadUrl=function(){var e=this.linkDownload();return"http"!==e.substr(0,4)&&(e=s.location.protocol+"//"+s.location.host+s.location.pathname+e),this.mimeType+":"+this.fileName+":"+e},i.prototype.eventDragStart=function(e,t){var i=t.originalEvent||t;return e&&i&&i.dataTransfer&&i.dataTransfer.setData&&i.dataTransfer.setData("DownloadURL",this.generateTransferDownloadUrl()),!0},i.prototype.iconClass=function(){var e=this.mimeType.toLocaleString().split("/"),t="icon-file";return e&&e[1]&&("image"===e[0]?t="icon-file-image":"text"===e[0]?t="icon-file-text":"audio"===e[0]?t="icon-file-music":"video"===e[0]?t="icon-file-movie":-1<n.inArray(e[1],["zip","7z","tar","rar","gzip","bzip","bzip2","x-zip","x-7z","x-rar","x-tar","x-gzip","x-bzip","x-bzip2","x-zip-compressed","x-7z-compressed","x-rar-compressed"])?t="icon-file-zip":-1<n.inArray(e[1],["rtf","msword","vnd.msword","vnd.openxmlformats-officedocument.wordprocessingml.document","vnd.openxmlformats-officedocument.wordprocessingml.template","vnd.ms-word.document.macroEnabled.12","vnd.ms-word.template.macroEnabled.12"])?t="icon-file-text":-1<n.inArray(e[1],["excel","ms-excel","vnd.ms-excel","vnd.openxmlformats-officedocument.spreadsheetml.sheet","vnd.openxmlformats-officedocument.spreadsheetml.template","vnd.ms-excel.sheet.macroEnabled.12","vnd.ms-excel.template.macroEnabled.12","vnd.ms-excel.addin.macroEnabled.12","vnd.ms-excel.sheet.binary.macroEnabled.12"])?t="icon-file-excel":-1<n.inArray(e[1],["powerpoint","ms-powerpoint","vnd.ms-powerpoint","vnd.openxmlformats-officedocument.presentationml.presentation","vnd.openxmlformats-officedocument.presentationml.template","vnd.openxmlformats-officedocument.presentationml.slideshow","vnd.ms-powerpoint.addin.macroEnabled.12","vnd.ms-powerpoint.presentation.macroEnabled.12","vnd.ms-powerpoint.template.macroEnabled.12","vnd.ms-powerpoint.slideshow.macroEnabled.12"])&&(t="icon-file-chart-graph")),t},e.exports=i}(t,e)},{Globals:9,LinkBuilder:11,Utils:14,window:32}],39:[function(e,t){!function(e,t){"use strict";function i(e,t,i,n,a,r,l){this.id=e,this.isInline=o.isUnd(n)?!1:!!n,this.isLinked=o.isUnd(a)?!1:!!a,this.CID=o.isUnd(r)?"":r,this.contentLocation=o.isUnd(l)?"":l,this.fromMessage=!1,this.fileName=s.observable(t),this.size=s.observable(o.isUnd(i)?null:i),this.tempName=s.observable(""),this.progress=s.observable(""),this.error=s.observable(""),this.waiting=s.observable(!0),this.uploading=s.observable(!1),this.enabled=s.observable(!0),this.friendlySize=s.computed(function(){var e=this.size();return null===e?"":o.friendlySize(this.size())},this)}var s=t("ko"),o=t("Utils");i.prototype.id="",i.prototype.isInline=!1,i.prototype.isLinked=!1,i.prototype.CID="",i.prototype.contentLocation="",i.prototype.fromMessage=!1,i.prototype.cancel=o.emptyFunction,i.prototype.initByUploadJson=function(e){var t=!1;return e&&(this.fileName(e.Name),this.size(o.isUnd(e.Size)?0:o.pInt(e.Size)),this.tempName(o.isUnd(e.TempName)?"":e.TempName),this.isInline=!1,t=!0),t},e.exports=i}(t,e)},{Utils:14,ko:28}],40:[function(e,t){!function(e,t){"use strict";function i(){this.idContact=0,this.display="",this.properties=[],this.tags="",this.readOnly=!1,this.focused=o.observable(!1),this.selected=o.observable(!1),this.checked=o.observable(!1),this.deleted=o.observable(!1)}var s=t("_"),o=t("ko"),n=t("Enums"),a=t("Utils"),r=t("LinkBuilder");i.prototype.getNameAndEmailHelper=function(){var e="",t="";return a.isNonEmptyArray(this.properties)&&s.each(this.properties,function(i){i&&(n.ContactPropertyType.FirstName===i[0]?e=a.trim(i[1]+" "+e):n.ContactPropertyType.LastName===i[0]?e=a.trim(e+" "+i[1]):""===t&&n.ContactPropertyType.Email===i[0]&&(t=i[1]))},this),""===t?null:[t,e]},i.prototype.parse=function(e){var t=!1;return e&&"Object/Contact"===e["@Object"]&&(this.idContact=a.pInt(e.IdContact),this.display=a.pString(e.Display),this.readOnly=!!e.ReadOnly,this.tags="",a.isNonEmptyArray(e.Properties)&&s.each(e.Properties,function(e){e&&e.Type&&a.isNormal(e.Value)&&a.isNormal(e.TypeStr)&&this.properties.push([a.pInt(e.Type),a.pString(e.Value),a.pString(e.TypeStr)])},this),a.isNonEmptyArray(e.Tags)&&(this.tags=e.Tags.join(",")),t=!0),t},i.prototype.srcAttr=function(){return r.emptyContactPic()},i.prototype.generateUid=function(){return""+this.idContact},i.prototype.lineAsCcc=function(){var e=[];return this.deleted()&&e.push("deleted"),this.selected()&&e.push("selected"),this.checked()&&e.push("checked"),this.focused()&&e.push("focused"),e.join(" ")},e.exports=i}(t,e)},{Enums:7,LinkBuilder:11,Utils:14,_:31,ko:28}],41:[function(e,t){!function(e,t){"use strict";function i(e,t,i,a,r){this.type=s.observable(n.isUnd(e)?o.ContactPropertyType.Unknown:e),this.typeStr=s.observable(n.isUnd(t)?"":t),this.focused=s.observable(n.isUnd(a)?!1:!!a),this.value=s.observable(n.pString(i)),this.placeholder=s.observable(r||""),this.placeholderValue=s.computed(function(){var e=this.placeholder();return e?n.i18n(e):""},this),this.largeValue=s.computed(function(){return o.ContactPropertyType.Note===this.type()},this)}var s=t("ko"),o=t("Enums"),n=t("Utils");e.exports=i}(t,e)},{Enums:7,Utils:14,ko:28}],42:[function(e,t){!function(e,t){"use strict";function i(){this.idContactTag=0,this.name=s.observable(""),this.readOnly=!1}var s=t("ko"),o=t("Utils");i.prototype.parse=function(e){var t=!1;return e&&"Object/Tag"===e["@Object"]&&(this.idContact=o.pInt(e.IdContactTag),this.name(o.pString(e.Name)),this.readOnly=!!e.ReadOnly,t=!0),t},i.prototype.filterHelper=function(e){return-1!==this.name().toLowerCase().indexOf(e.toLowerCase())},i.prototype.toLine=function(e){return(o.isUnd(e)?1:!e)?this.name():o.encodeHtml(this.name())},e.exports=i}(t,e)},{Utils:14,ko:28}],43:[function(e,t){!function(e,t){"use strict";function i(e,t){this.email=e||"",this.name=t||"",this.privateType=null,this.clearDuplicateName()}var s=t("Enums"),o=t("Utils");i.newInstanceFromJson=function(e){var t=new i;return t.initByJson(e)?t:null},i.prototype.name="",i.prototype.email="",i.prototype.privateType=null,i.prototype.clear=function(){this.email="",this.name="",this.privateType=null},i.prototype.validate=function(){return""!==this.name||""!==this.email},i.prototype.hash=function(e){return"#"+(e?"":this.name)+"#"+this.email+"#"},i.prototype.clearDuplicateName=function(){this.name===this.email&&(this.name="")},i.prototype.type=function(){return null===this.privateType&&(this.email&&"@facebook.com"===this.email.substr(-13)&&(this.privateType=s.EmailType.Facebook),null===this.privateType&&(this.privateType=s.EmailType.Default)),this.privateType},i.prototype.search=function(e){return-1<(this.name+" "+this.email).toLowerCase().indexOf(e.toLowerCase())},i.prototype.parse=function(e){this.clear(),e=o.trim(e);var t=/(?:"([^"]+)")? ?<?(.*?@[^>,]+)>?,? ?/g,i=t.exec(e);i?(this.name=i[1]||"",this.email=i[2]||"",this.clearDuplicateName()):/^[^@]+@[^@]+$/.test(e)&&(this.name="",this.email=e)},i.prototype.initByJson=function(e){var t=!1;return e&&"Object/Email"===e["@Object"]&&(this.name=o.trim(e.Name),this.email=o.trim(e.Email),t=""!==this.email,this.clearDuplicateName()),t},i.prototype.toLine=function(e,t,i){var s="";return""!==this.email&&(t=o.isUnd(t)?!1:!!t,i=o.isUnd(i)?!1:!!i,e&&""!==this.name?s=t?'<a href="mailto:'+o.encodeHtml('"'+this.name+'" <'+this.email+">")+'" target="_blank" tabindex="-1">'+o.encodeHtml(this.name)+"</a>":i?o.encodeHtml(this.name):this.name:(s=this.email,""!==this.name?t?s=o.encodeHtml('"'+this.name+'" <')+'<a href="mailto:'+o.encodeHtml('"'+this.name+'" <'+this.email+">")+'" target="_blank" tabindex="-1">'+o.encodeHtml(s)+"</a>"+o.encodeHtml(">"):(s='"'+this.name+'" <'+s+">",i&&(s=o.encodeHtml(s))):t&&(s='<a href="mailto:'+o.encodeHtml(this.email)+'" target="_blank" tabindex="-1">'+o.encodeHtml(this.email)+"</a>"))),s},i.prototype.mailsoParse=function(e){if(e=o.trim(e),""===e)return!1;for(var t=function(e,t,i){e+="";var s=e.length;return 0>t&&(t+=s),s="undefined"==typeof i?s:0>i?i+s:i+t,t>=e.length||0>t||t>s?!1:e.slice(t,s)},i=function(e,t,i,s){return 0>i&&(i+=e.length),s=void 0!==s?s:e.length,0>s&&(s=s+e.length-i),e.slice(0,i)+t.substr(0,s)+t.slice(s)+e.slice(i+s)},s="",n="",a="",r=!1,l=!1,c=!1,u=null,d=0,p=0,h=0;h<e.length;){switch(e.substr(h,1)){case'"':r||l||c?l||c||(p=h,s=t(e,d+1,p-d-1),e=i(e,"",d,p-d+1),p=0,h=0,d=0,r=!1):(r=!0,d=h);break;case"<":r||l||c||(h>0&&0===s.length&&(s=t(e,0,h)),l=!0,d=h);break;case">":l&&(p=h,n=t(e,d+1,p-d-1),e=i(e,"",d,p-d+1),p=0,h=0,d=0,l=!1);break;case"(":r||l||c||(c=!0,d=h);break;case")":c&&(p=h,a=t(e,d+1,p-d-1),e=i(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]:s=e),n.length>0&&0===s.length&&0===a.length&&(s=e.replace(n,"")),n=o.trim(n).replace(/^[<]+/,"").replace(/[>]+$/,""),s=o.trim(s).replace(/^["']+/,"").replace(/["']+$/,""),a=o.trim(a).replace(/^[(]+/,"").replace(/[)]+$/,""),s=s.replace(/\\\\(.)/g,"$1"),a=a.replace(/\\\\(.)/g,"$1"),this.name=s,this.email=n,this.clearDuplicateName(),!0},i.prototype.inputoTagLine=function(){return 0<this.name.length?this.name+" ("+this.email+")":this.email},e.exports=i}(t,e)},{Enums:7,Utils:14}],44:[function(e,t){!function(e,t){"use strict";function i(e){this.parentList=e,this.field=s.observable(o.FilterConditionField.From),this.fieldOptions=[{id:o.FilterConditionField.From,name:"From"},{id:o.FilterConditionField.Recipient,name:"Recipient (To or CC)"},{id:o.FilterConditionField.To,name:"To"},{id:o.FilterConditionField.Subject,name:"Subject"}],this.type=s.observable(o.FilterConditionType.EqualTo),this.typeOptions=[{id:o.FilterConditionType.EqualTo,name:"Equal To"},{id:o.FilterConditionType.NotEqualTo,name:"Not Equal To"},{id:o.FilterConditionType.Contains,name:"Contains"},{id:o.FilterConditionType.NotContains,name:"Not Contains"}],this.value=s.observable(""),this.template=s.computed(function(){var e="";switch(this.type()){default:e="SettingsFiltersConditionDefault"}return e},this)}var s=t("ko"),o=t("Enums");i.prototype.removeSelf=function(){this.parentList.remove(this)},e.exports=i}(t,e)},{Enums:7,ko:28}],45:[function(e,t){!function(e,t){"use strict";function i(){this.isNew=s.observable(!0),this.enabled=s.observable(!0),this.name=s.observable(""),this.conditionsType=s.observable(o.FilterRulesType.And),this.conditions=s.observableArray([]),this.conditions.subscribe(function(){n.windowResize()}),this.actionMarkAsRead=s.observable(!1),this.actionSkipOtherFilters=s.observable(!0),this.actionValue=s.observable(""),this.actionType=s.observable(o.FiltersAction.Move),this.actionTypeOptions=[{id:o.FiltersAction.None,name:"Action - None"},{id:o.FiltersAction.Move,name:"Action - Move to"},{id:o.FiltersAction.Discard,name:"Action - Discard"}],this.actionMarkAsReadVisiblity=s.computed(function(){return-1<n.inArray(this.actionType(),[o.FiltersAction.None,o.FiltersAction.Forward,o.FiltersAction.Move])},this),this.actionTemplate=s.computed(function(){var e="";switch(this.actionType()){default:case o.FiltersAction.Move:e="SettingsFiltersActionValueAsFolders";break;case o.FiltersAction.Forward:e="SettingsFiltersActionWithValue";break;case o.FiltersAction.None:case o.FiltersAction.Discard:e="SettingsFiltersActionNoValue"}return e},this)}var s=t("ko"),o=t("Enums"),n=t("Utils"),a=t("Model:FilterCondition");i.prototype.addCondition=function(){this.conditions.push(new a(this.conditions))},i.prototype.parse=function(e){var t=!1;return e&&"Object/Filter"===e["@Object"]&&(this.name(n.pString(e.Name)),t=!0),t},e.exports=i}(t,e)},{Enums:7,"Model:FilterCondition":44,Utils:14,ko:28}],46:[function(e,t){!function(e,t){"use strict";function i(){this.name=o.observable(""),this.fullName="",this.fullNameRaw="",this.fullNameHash="",this.delimiter="",this.namespace="",this.deep=0,this.interval=0,this.selectable=!1,this.existen=!0,this.type=o.observable(n.FolderType.User),this.focused=o.observable(!1),this.selected=o.observable(!1),this.edited=o.observable(!1),this.collapsed=o.observable(!0),this.subScribed=o.observable(!0),this.subFolders=o.observableArray([]),this.deleteAccess=o.observable(!1),this.actionBlink=o.observable(!1).extend({falseTimeout:1e3}),this.nameForEdit=o.observable(""),this.privateMessageCountAll=o.observable(0),this.privateMessageCountUnread=o.observable(0),this.collapsedPrivate=o.observable(!0)}var s=t("_"),o=t("ko"),n=t("Enums"),a=t("Globals"),r=t("Utils"),l=t("Events");i.newInstanceFromJson=function(e){var t=new i;return t.initByJson(e)?t.initComputed():null},i.prototype.initComputed=function(){return this.hasSubScribedSubfolders=o.computed(function(){return!!s.find(this.subFolders(),function(e){return e.subScribed()&&!e.isSystemFolder()})},this),this.canBeEdited=o.computed(function(){return n.FolderType.User===this.type()&&this.existen&&this.selectable},this),this.visible=o.computed(function(){var e=this.subScribed(),t=this.hasSubScribedSubfolders();return e||t&&(!this.existen||!this.selectable)},this),this.isSystemFolder=o.computed(function(){return n.FolderType.User!==this.type()},this),this.hidden=o.computed(function(){var e=this.isSystemFolder(),t=this.hasSubScribedSubfolders();return e&&!t||!this.selectable&&!t},this),this.selectableForFolderList=o.computed(function(){return!this.isSystemFolder()&&this.selectable},this),this.messageCountAll=o.computed({read:this.privateMessageCountAll,write:function(e){r.isPosNumeric(e,!0)?this.privateMessageCountAll(e):this.privateMessageCountAll.valueHasMutated()},owner:this}),this.messageCountUnread=o.computed({read:this.privateMessageCountUnread,write:function(e){r.isPosNumeric(e,!0)?this.privateMessageCountUnread(e):this.privateMessageCountUnread.valueHasMutated()},owner:this}),this.printableUnreadCount=o.computed(function(){var e=this.messageCountAll(),t=this.messageCountUnread(),i=this.type();if(e>0){if(n.FolderType.Draft===i)return""+e;if(t>0&&n.FolderType.Trash!==i&&n.FolderType.Archive!==i&&n.FolderType.SentItems!==i)return""+t}return""},this),this.canBeDeleted=o.computed(function(){var e=this.isSystemFolder();return!e&&0===this.subFolders().length&&"INBOX"!==this.fullNameRaw},this),this.canBeSubScribed=o.computed(function(){return!this.isSystemFolder()&&this.selectable&&"INBOX"!==this.fullNameRaw},this),this.localName=o.computed(function(){a.langChangeTrigger();var e=this.type(),t=this.name();if(this.isSystemFolder())switch(e){case n.FolderType.Inbox:t=r.i18n("FOLDER_LIST/INBOX_NAME");break;case n.FolderType.SentItems:t=r.i18n("FOLDER_LIST/SENT_NAME");break;case n.FolderType.Draft:t=r.i18n("FOLDER_LIST/DRAFTS_NAME");break;case n.FolderType.Spam:t=r.i18n("FOLDER_LIST/SPAM_NAME");break;case n.FolderType.Trash:t=r.i18n("FOLDER_LIST/TRASH_NAME");break;case n.FolderType.Archive:t=r.i18n("FOLDER_LIST/ARCHIVE_NAME")}return t},this),this.manageFolderSystemName=o.computed(function(){a.langChangeTrigger();var e="",t=this.type(),i=this.name();if(this.isSystemFolder())switch(t){case n.FolderType.Inbox:e="("+r.i18n("FOLDER_LIST/INBOX_NAME")+")";break;case n.FolderType.SentItems:e="("+r.i18n("FOLDER_LIST/SENT_NAME")+")";break;case n.FolderType.Draft:e="("+r.i18n("FOLDER_LIST/DRAFTS_NAME")+")";break;case n.FolderType.Spam:e="("+r.i18n("FOLDER_LIST/SPAM_NAME")+")";break;case n.FolderType.Trash:e="("+r.i18n("FOLDER_LIST/TRASH_NAME")+")";break;case n.FolderType.Archive:e="("+r.i18n("FOLDER_LIST/ARCHIVE_NAME")+")"}return(""!==e&&"("+i+")"===e||"(inbox)"===e.toLowerCase())&&(e=""),e},this),this.collapsed=o.computed({read:function(){return!this.hidden()&&this.collapsedPrivate()},write:function(e){this.collapsedPrivate(e)},owner:this}),this.hasUnreadMessages=o.computed(function(){return 0<this.messageCountUnread()},this),this.hasSubScribedUnreadMessagesSubfolders=o.computed(function(){return!!s.find(this.subFolders(),function(e){return e.hasUnreadMessages()||e.hasSubScribedUnreadMessagesSubfolders()})},this),this.name.subscribe(function(e){this.nameForEdit(e)},this),this.edited.subscribe(function(e){e&&this.nameForEdit(this.name())},this),this.messageCountUnread.subscribe(function(e){n.FolderType.Inbox===this.type()&&l.pub("mailbox.inbox-unread-count",[e])},this),this},i.prototype.fullName="",i.prototype.fullNameRaw="",i.prototype.fullNameHash="",i.prototype.delimiter="",i.prototype.namespace="",i.prototype.deep=0,i.prototype.interval=0,i.prototype.collapsedCss=function(){return this.hasSubScribedSubfolders()?this.collapsed()?"icon-right-mini e-collapsed-sign":"icon-down-mini e-collapsed-sign":"icon-none e-collapsed-sign"},i.prototype.initByJson=function(e){var t=!1;return e&&"Object/Folder"===e["@Object"]&&(this.name(e.Name),this.delimiter=e.Delimiter,this.fullName=e.FullName,this.fullNameRaw=e.FullNameRaw,this.fullNameHash=e.FullNameHash,this.deep=e.FullNameRaw.split(this.delimiter).length-1,this.selectable=!!e.IsSelectable,this.existen=!!e.IsExists,this.subScribed(!!e.IsSubscribed),this.type("INBOX"===this.fullNameRaw?n.FolderType.Inbox:n.FolderType.User),t=!0),t},i.prototype.printableFullName=function(){return this.fullName.split(this.delimiter).join(" / ")},e.exports=i}(t,e)},{Enums:7,Events:8,Globals:9,Utils:14,_:31,ko:28}],47:[function(e,t){!function(e,t){"use strict";function i(e,t,i){this.id=e,this.email=s.observable(t),this.name=s.observable(""),this.replyTo=s.observable(""),this.bcc=s.observable(""),this.deleteAccess=s.observable(!1),this.canBeDalete=s.observable(i)}var s=t("ko"),o=t("Utils");i.prototype.formattedName=function(){var e=this.name();return""===e?this.email():e+" <"+this.email()+">"},i.prototype.formattedNameForCompose=function(){var e=this.name();return""===e?this.email():e+" ("+this.email()+")"},i.prototype.formattedNameForEmail=function(){var e=this.name();return""===e?this.email():'"'+o.quoteName(e)+'" <'+this.email()+">"},e.exports=i}(t,e)},{Utils:14,ko:28}],48:[function(e,t){!function(e,t){"use strict";function i(){this.folderFullNameRaw="",this.uid="",this.hash="",this.requestHash="",this.subject=a.observable(""),this.subjectPrefix=a.observable(""),this.subjectSuffix=a.observable(""),this.size=a.observable(0),this.dateTimeStampInUTC=a.observable(0),this.priority=a.observable(u.MessagePriority.Normal),this.proxy=!1,this.fromEmailString=a.observable(""),this.fromClearEmailString=a.observable(""),this.toEmailsString=a.observable(""),this.toClearEmailsString=a.observable(""),this.senderEmailsString=a.observable(""),this.senderClearEmailsString=a.observable(""),this.emails=[],this.from=[],this.to=[],this.cc=[],this.bcc=[],this.replyTo=[],this.deliveredTo=[],this.newForAnimation=a.observable(!1),this.deleted=a.observable(!1),this.unseen=a.observable(!1),this.flagged=a.observable(!1),this.answered=a.observable(!1),this.forwarded=a.observable(!1),this.isReadReceipt=a.observable(!1),this.focused=a.observable(!1),this.selected=a.observable(!1),this.checked=a.observable(!1),this.hasAttachments=a.observable(!1),this.attachmentsMainType=a.observable(""),this.moment=a.observable(r(r.unix(0))),this.attachmentIconClass=a.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=a.computed(function(){return i.calculateFullFromatDateValue(this.dateTimeStampInUTC())},this),this.momentDate=d.createMomentDate(this),this.momentShortDate=d.createMomentShortDate(this),this.dateTimeStampInUTC.subscribe(function(e){var t=r().unix();this.moment(r.unix(e>t?t:e))},this),this.body=null,this.plainRaw="",this.isHtml=a.observable(!1),this.hasImages=a.observable(!1),this.attachments=a.observableArray([]),this.isPgpSigned=a.observable(!1),this.isPgpEncrypted=a.observable(!1),this.pgpSignedVerifyStatus=a.observable(u.SignedVerifyStatus.None),this.pgpSignedVerifyUser=a.observable(""),this.priority=a.observable(u.MessagePriority.Normal),this.readReceipt=a.observable(""),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid=a.observable(0),this.threads=a.observableArray([]),this.threadsLen=a.observable(0),this.hasUnseenSubMessage=a.observable(!1),this.hasFlaggedSubMessage=a.observable(!1),this.lastInCollapsedThread=a.observable(!1),this.lastInCollapsedThreadLoading=a.observable(!1),this.threadsLenResult=a.computed(function(){var e=this.threadsLen();return 0===this.parentUid()&&e>0?e+1:""},this)}var s=t("window"),o=t("$"),n=t("_"),a=t("ko"),r=t("moment"),l=t("$win"),c=t("$div"),u=t("Enums"),d=t("Utils"),p=t("LinkBuilder"),h=t("Model:Email"),g=t("Model:Attachment");i.newInstanceFromJson=function(e){var t=new i;return t.initByJson(e)?t:null},i.calculateFullFromatDateValue=function(e){return e>0?r.unix(e).format("LLL"):""},i.emailsToLine=function(e,t,i){var s=[],o=0,n=0;if(d.isNonEmptyArray(e))for(o=0,n=e.length;n>o;o++)s.push(e[o].toLine(t,i));return s.join(", ")},i.emailsToLineClear=function(e){var t=[],i=0,s=0;if(d.isNonEmptyArray(e))for(i=0,s=e.length;s>i;i++)e[i]&&e[i].email&&""!==e[i].name&&t.push(e[i].email);return t.join(", ")},i.initEmailsFromJson=function(e){var t=0,i=0,s=null,o=[];if(d.isNonEmptyArray(e))for(t=0,i=e.length;i>t;t++)s=h.newInstanceFromJson(e[t]),s&&o.push(s);return o},i.replyHelper=function(e,t,i){if(e&&0<e.length)for(var s=0,o=e.length;o>s;s++)d.isUnd(t[e[s].email])&&(t[e[s].email]=!0,i.push(e[s]))},i.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)},i.prototype.computeSenderEmail=function(){var e=t("Storage:RainLoop:Data"),i=e.sentFolder(),s=e.draftFolder();this.senderEmailsString(this.folderFullNameRaw===i||this.folderFullNameRaw===s?this.toEmailsString():this.fromEmailString()),this.senderClearEmailsString(this.folderFullNameRaw===i||this.folderFullNameRaw===s?this.toClearEmailsString():this.fromClearEmailString())},i.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=i.initEmailsFromJson(e.From),this.to=i.initEmailsFromJson(e.To),this.cc=i.initEmailsFromJson(e.Cc),this.bcc=i.initEmailsFromJson(e.Bcc),this.replyTo=i.initEmailsFromJson(e.ReplyTo),this.deliveredTo=i.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(i.emailsToLine(this.from,!0)),this.fromClearEmailString(i.emailsToLineClear(this.from)),this.toEmailsString(i.emailsToLine(this.to,!0)),this.toClearEmailsString(i.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},i.prototype.initUpdateByMessageJson=function(e){var i=t("Storage:RainLoop:Data"),s=!1,o=u.MessagePriority.Normal;return e&&"Object/Message"===e["@Object"]&&(o=d.pInt(e.Priority),this.priority(-1<d.inArray(o,[u.MessagePriority.High,u.MessagePriority.Low])?o:u.MessagePriority.Normal),this.aDraftInfo=e.DraftInfo,this.sMessageId=e.MessageId,this.sInReplyTo=e.InReplyTo,this.sReferences=e.References,this.proxy=!!e.ExternalProxy,i.capaOpenPGP()&&(this.isPgpSigned(!!e.PgpSigned),this.isPgpEncrypted(!!e.PgpEncrypted)),this.hasAttachments(!!e.HasAttachments),this.attachmentsMainType(e.AttachmentsMainType),this.foundedCIDs=d.isArray(e.FoundedCIDs)?e.FoundedCIDs:[],this.attachments(this.initAttachmentsFromJson(e.Attachments)),this.readReceipt(e.ReadReceipt||""),this.computeSenderEmail(),s=!0),s},i.prototype.initAttachmentsFromJson=function(e){var t=0,i=0,s=null,o=[];if(e&&"Collection/AttachmentCollection"===e["@Object"]&&d.isNonEmptyArray(e["@Collection"]))for(t=0,i=e["@Collection"].length;i>t;t++)s=g.newInstanceFromJson(e["@Collection"][t]),s&&(""!==s.cidWithOutTags&&0<this.foundedCIDs.length&&0<=d.inArray(s.cidWithOutTags,this.foundedCIDs)&&(s.isLinked=!0),o.push(s));return o},i.prototype.initFlagsByJson=function(e){var t=!1;return e&&"Object/Message"===e["@Object"]&&(this.unseen(!e.IsSeen),this.flagged(!!e.IsFlagged),this.answered(!!e.IsAnswered),this.forwarded(!!e.IsForwarded),this.isReadReceipt(!!e.IsReadReceipt),t=!0),t},i.prototype.fromToLine=function(e,t){return i.emailsToLine(this.from,e,t)},i.prototype.toToLine=function(e,t){return i.emailsToLine(this.to,e,t)},i.prototype.ccToLine=function(e,t){return i.emailsToLine(this.cc,e,t)},i.prototype.bccToLine=function(e,t){return i.emailsToLine(this.bcc,e,t)},i.prototype.lineAsCcc=function(){var e=[];if(this.deleted()&&e.push("deleted"),this.selected()&&e.push("selected"),this.checked()&&e.push("checked"),this.flagged()&&e.push("flagged"),this.unseen()&&e.push("unseen"),this.answered()&&e.push("answered"),this.forwarded()&&e.push("forwarded"),this.focused()&&e.push("focused"),this.hasAttachments())switch(e.push("withAttachments"),this.attachmentsMainType()){case"image":e.push("imageOnlyAttachments");break;case"archive":e.push("archiveOnlyAttachments")}return this.newForAnimation()&&e.push("new"),""===this.subject()&&e.push("emptySubject"),0<this.parentUid()&&e.push("hasParentMessage"),0<this.threadsLen()&&0===this.parentUid()&&e.push("hasChildrenMessage"),this.hasUnseenSubMessage()&&e.push("hasUnseenSubMessage"),this.hasFlaggedSubMessage()&&e.push("hasFlaggedSubMessage"),e.join(" ")},i.prototype.hasVisibleAttachments=function(){return!!n.find(this.attachments(),function(e){return!e.isLinked})},i.prototype.findAttachmentByCid=function(e){var t=null,i=this.attachments();return d.isNonEmptyArray(i)&&(e=e.replace(/^<+/,"").replace(/>+$/,""),t=n.find(i,function(t){return e===t.cidWithOutTags
})),t||null},i.prototype.findAttachmentByContentLocation=function(e){var t=null,i=this.attachments();return d.isNonEmptyArray(i)&&(t=n.find(i,function(t){return e===t.contentLocation})),t||null},i.prototype.messageId=function(){return this.sMessageId},i.prototype.inReplyTo=function(){return this.sInReplyTo},i.prototype.references=function(){return this.sReferences},i.prototype.fromAsSingleEmail=function(){return d.isArray(this.from)&&this.from[0]?this.from[0].email:""},i.prototype.viewLink=function(){return p.messageViewLink(this.requestHash)},i.prototype.downloadLink=function(){return p.messageDownloadLink(this.requestHash)},i.prototype.replyEmails=function(e){var t=[],s=d.isUnd(e)?{}:e;return i.replyHelper(this.replyTo,s,t),0===t.length&&i.replyHelper(this.from,s,t),t},i.prototype.replyAllEmails=function(e){var t=[],s=[],o=d.isUnd(e)?{}:e;return i.replyHelper(this.replyTo,o,t),0===t.length&&i.replyHelper(this.from,o,t),i.replyHelper(this.to,o,t),i.replyHelper(this.cc,o,s),[t,s]},i.prototype.textBodyToString=function(){return this.body?this.body.html():""},i.prototype.attachmentsToStringLine=function(){var e=n.map(this.attachments(),function(e){return e.fileName+" ("+e.friendlySize+")"});return e&&0<e.length?e.join(", "):""},i.prototype.getDataForWindowPopup=function(){return{popupFrom:this.fromToLine(!1),popupTo:this.toToLine(!1),popupCc:this.ccToLine(!1),popupBcc:this.bccToLine(!1),popupSubject:this.subject(),popupDate:this.fullFormatDateValue(),popupAttachments:this.attachmentsToStringLine(),popupBody:this.textBodyToString()}},i.prototype.viewPopupMessage=function(e){d.windowPopupKnockout(this.getDataForWindowPopup(),"PopupsWindowSimpleMessage",this.subject(),function(t){t&&t.document&&t.document.body&&(o("img.lazy",t.document.body).each(function(e,t){var i=o(t),s=i.data("original"),n=i.attr("src");e>=0&&s&&!n&&i.attr("src",s)}),e&&s.setTimeout(function(){t.print()},100))})},i.prototype.printMessage=function(){this.viewPopupMessage(!0)},i.prototype.generateUid=function(){return this.folderFullNameRaw+"/"+this.uid},i.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},i.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",o("["+t+"]",this.body).each(function(){e&&o(this).is("img")?o(this).addClass("lazy").attr("data-original",o(this).attr(t)).removeAttr(t):o(this).attr("src",o(this).attr(t)).removeAttr(t)}),t=this.proxy?"data-x-additional-style-url":"data-x-style-url",o("["+t+"]",this.body).each(function(){var e=d.trim(o(this).attr("style"));e=""===e?"":";"===e.substr(-1)?e+" ":e+"; ",o(this).attr("style",e+o(this).attr(t)).removeAttr(t)}),e&&(o("img.lazy",this.body).addClass("lazy-inited").lazyload({threshold:400,effect:"fadeIn",skip_invisible:!1,container:o(".RL-MailMessageView .messageView .messageItem .content")[0]}),l.resize()),d.windowResize(500)}},i.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;o("[data-x-src-cid]",this.body).each(function(){var i=t.findAttachmentByCid(o(this).attr("data-x-src-cid"));i&&i.download&&(e&&o(this).is("img")?o(this).addClass("lazy").attr("data-original",i.linkPreview()):o(this).attr("src",i.linkPreview()))}),o("[data-x-src-location]",this.body).each(function(){var i=t.findAttachmentByContentLocation(o(this).attr("data-x-src-location"));i||(i=t.findAttachmentByCid(o(this).attr("data-x-src-location"))),i&&i.download&&(e&&o(this).is("img")?o(this).addClass("lazy").attr("data-original",i.linkPreview()):o(this).attr("src",i.linkPreview()))}),o("[data-x-style-cid]",this.body).each(function(){var e="",i="",s=t.findAttachmentByCid(o(this).attr("data-x-style-cid"));s&&s.linkPreview&&(i=o(this).attr("data-x-style-cid-name"),""!==i&&(e=d.trim(o(this).attr("style")),e=""===e?"":";"===e.substr(-1)?e+" ":e+"; ",o(this).attr("style",e+i+": url('"+s.linkPreview()+"')")))}),e&&!function(e,t){n.delay(function(){e.addClass("lazy-inited").lazyload({threshold:400,effect:"fadeIn",skip_invisible:!1,container:t})},300)}(o("img.lazy",t.body),o(".RL-MailMessageView .messageView .messageItem .content")[0]),d.windowResize(500)}},i.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 e=t("Storage:RainLoop:Data");e.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()))}},i.prototype.storePgpVerifyDataToDom=function(){var e=t("Storage:RainLoop:Data");this.body&&e.capaOpenPGP()&&(this.body.data("rl-pgp-verify-status",this.pgpSignedVerifyStatus()),this.body.data("rl-pgp-verify-user",this.pgpSignedVerifyUser()))},i.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 e=t("Storage:RainLoop:Data");e.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(""))}},i.prototype.verifyPgpSignedClearMessage=function(){if(this.isPgpSigned()){var e=[],i=null,a=t("Storage:RainLoop:Data"),r=this.from&&this.from[0]&&this.from[0].email?this.from[0].email:"",l=a.findPublicKeysByEmail(r),d=null,p=null,h="";this.pgpSignedVerifyStatus(u.SignedVerifyStatus.Error),this.pgpSignedVerifyUser("");try{i=s.openpgp.cleartext.readArmored(this.plainRaw),i&&i.getText&&(this.pgpSignedVerifyStatus(l.length?u.SignedVerifyStatus.Unverified:u.SignedVerifyStatus.UnknownPublicKeys),e=i.verify(l),e&&0<e.length&&(d=n.find(e,function(e){return e&&e.keyid&&e.valid}),d&&(p=a.findPublicKeyByHex(d.keyid.toHex()),p&&(h=i.getText(),this.pgpSignedVerifyStatus(u.SignedVerifyStatus.Success),this.pgpSignedVerifyUser(p.user),h=c.empty().append(o('<pre class="b-plain-openpgp signed verified"></pre>').text(h)).html(),c.empty(),this.replacePlaneTextBody(h)))))}catch(g){}this.storePgpVerifyDataToDom()}},i.prototype.decryptPgpEncryptedMessage=function(e){if(this.isPgpEncrypted()){var i=[],a=null,r=null,l=t("Storage:RainLoop:Data"),d=this.from&&this.from[0]&&this.from[0].email?this.from[0].email:"",p=l.findPublicKeysByEmail(d),h=l.findSelfPrivateKey(e),g=null,m=null,f="";this.pgpSignedVerifyStatus(u.SignedVerifyStatus.Error),this.pgpSignedVerifyUser(""),h||this.pgpSignedVerifyStatus(u.SignedVerifyStatus.UnknownPrivateKey);try{a=s.openpgp.message.readArmored(this.plainRaw),a&&h&&a.decrypt&&(this.pgpSignedVerifyStatus(u.SignedVerifyStatus.Unverified),r=a.decrypt(h),r&&(i=r.verify(p),i&&0<i.length&&(g=n.find(i,function(e){return e&&e.keyid&&e.valid}),g&&(m=l.findPublicKeyByHex(g.keyid.toHex()),m&&(this.pgpSignedVerifyStatus(u.SignedVerifyStatus.Success),this.pgpSignedVerifyUser(m.user)))),f=r.getText(),f=c.empty().append(o('<pre class="b-plain-openpgp signed verified"></pre>').text(f)).html(),c.empty(),this.replacePlaneTextBody(f)))}catch(b){}this.storePgpVerifyDataToDom()}},i.prototype.replacePlaneTextBody=function(e){this.body&&this.body.html(e).addClass("b-text-part plain")},i.prototype.flagHash=function(){return[this.deleted(),this.unseen(),this.flagged(),this.answered(),this.forwarded(),this.isReadReceipt()].join("")},e.exports=i}(t,e)},{$:26,$div:15,$win:18,Enums:7,LinkBuilder:11,"Model:Attachment":38,"Model:Email":43,"Storage:RainLoop:Data":70,Utils:14,_:31,ko:28,moment:29,window:32}],49:[function(e,t){!function(e,t){"use strict";function i(e,t,i,o,n,a,r){this.index=e,this.id=i,this.guid=t,this.user=o,this.email=n,this.armor=r,this.isPrivate=!!a,this.deleteAccess=s.observable(!1)}var s=t("ko");i.prototype.index=0,i.prototype.id="",i.prototype.guid="",i.prototype.user="",i.prototype.email="",i.prototype.armor="",i.prototype.isPrivate=!1,e.exports=i}(t,e)},{ko:28}],50:[function(e,t){!function(e,t){"use strict";function i(){o.call(this,"about",[t("View:RainLoop:About")])}var s=t("_"),o=t("Knoin:AbstractScreen");s.extend(i.prototype,o.prototype),i.prototype.onShow=function(){t("App:RainLoop").setTitle("RainLoop")},e.exports=i}(t,e)},{"App:RainLoop":3,"Knoin:AbstractScreen":35,"View:RainLoop:About":76,_:31}],51:[function(e,t){!function(e,t){"use strict";function i(e){u.call(this,"settings",e),this.menu=n.observableArray([]),this.oCurrentSubScreen=null,this.oViewModelPlace=null}var s=t("$"),o=t("_"),n=t("ko"),a=t("Globals"),r=t("Utils"),l=t("LinkBuilder"),c=t("App:Knoin"),u=t("Knoin:AbstractScreen");o.extend(i.prototype,u.prototype),i.prototype.onRoute=function(e){var t=this,i=null,u=null,d=null,p=null;u=o.find(a.aViewModels.settings,function(t){return t&&t.__rlSettingsData&&e===t.__rlSettingsData.Route}),u&&(o.find(a.aViewModels["settings-removed"],function(e){return e&&e===u})&&(u=null),u&&o.find(a.aViewModels["settings-disabled"],function(e){return e&&e===u})&&(u=null)),u?(u.__builded&&u.__vm?i=u.__vm:(d=this.oViewModelPlace,d&&1===d.length?(i=new u,p=s("<div></div>").addClass("rl-settings-view-model").hide(),p.appendTo(d),i.viewModelDom=p,i.__rlSettingsData=u.__rlSettingsData,u.__dom=p,u.__builded=!0,u.__vm=i,n.applyBindingAccessorsToNode(p[0],{i18nInit:!0,template:function(){return{name:u.__rlSettingsData.Template}}},i),r.delegateRun(i,"onBuild",[p])):r.log("Cannot find sub settings view model position: SettingsSubScreen")),i&&o.defer(function(){t.oCurrentSubScreen&&(r.delegateRun(t.oCurrentSubScreen,"onHide"),t.oCurrentSubScreen.viewModelDom.hide()),t.oCurrentSubScreen=i,t.oCurrentSubScreen&&(t.oCurrentSubScreen.viewModelDom.show(),r.delegateRun(t.oCurrentSubScreen,"onShow"),r.delegateRun(t.oCurrentSubScreen,"onFocus",[],200),o.each(t.menu(),function(e){e.selected(i&&i.__rlSettingsData&&e.route===i.__rlSettingsData.Route)}),s("#rl-content .b-settings .b-content .content").scrollTop(0)),r.windowResize()})):c.setHash(l.settings(),!1,!0)},i.prototype.onHide=function(){this.oCurrentSubScreen&&this.oCurrentSubScreen.viewModelDom&&(r.delegateRun(this.oCurrentSubScreen,"onHide"),this.oCurrentSubScreen.viewModelDom.hide())},i.prototype.onBuild=function(){o.each(a.aViewModels.settings,function(e){e&&e.__rlSettingsData&&!o.find(a.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:!!o.find(a.aViewModels["settings-disabled"],function(t){return t&&t===e})})},this),this.oViewModelPlace=s("#rl-content #rl-settings-subscreen")},i.prototype.routes=function(){var e=o.find(a.aViewModels.settings,function(e){return e&&e.__rlSettingsData&&e.__rlSettingsData.IsDefault}),t=e?e.__rlSettingsData.Route:"general",i={subname:/^(.*)$/,normalize_:function(e,i){return i.subname=r.isUnd(i.subname)?t:r.pString(i.subname),[i.subname]}};return[["{subname}/",i],["{subname}",i],["",i]]},e.exports=i}(t,e)},{$:26,"App:Knoin":33,Globals:9,"Knoin:AbstractScreen":35,LinkBuilder:11,Utils:14,_:31,ko:28}],52:[function(e,t){!function(e,t){"use strict";function i(){o.call(this,"login",[t("View:RainLoop:Login")])}var s=t("_"),o=t("Knoin:AbstractScreen");s.extend(i.prototype,o.prototype),i.prototype.onShow=function(){t("App:RainLoop").setTitle("")},e.exports=i}(t,e)},{"App:RainLoop":3,"Knoin:AbstractScreen":35,"View:RainLoop:Login":78,_:31}],53:[function(e,t){!function(e,t){"use strict";function i(){c.call(this,"mailbox",[t("View:RainLoop:MailBoxSystemDropDown"),t("View:RainLoop:MailBoxFolderList"),t("View:RainLoop:MailBoxMessageList"),t("View:RainLoop:MailBoxMessageView")]),this.oLastRoute={}}var s=t("_"),o=t("$html"),n=t("Enums"),a=t("Globals"),r=t("Utils"),l=t("Events"),c=t("Knoin:AbstractScreen"),u=t("Storage:Settings"),d=t("Storage:RainLoop:Data"),p=t("Storage:RainLoop:Cache"),h=t("Storage:RainLoop:Remote");s.extend(i.prototype,c.prototype),i.prototype.oLastRoute={},i.prototype.setNewTitle=function(){var e=d.accountEmail(),i=d.foldersInboxUnreadCount();t("App:RainLoop").setTitle((""===e?"":(i>0?"("+i+") ":" ")+e+" - ")+r.i18n("TITLES/MAILBOX"))},i.prototype.onShow=function(){this.setNewTitle(),a.keyScope(n.KeyState.MessageList)},i.prototype.onRoute=function(e,i,s,o){if(r.isUnd(o)?1:!o){var a=p.getFolderFullNameRaw(e),l=p.getFolderFromCacheList(a);l&&(d.currentFolder(l).messageListPage(i).messageListSearch(s),n.Layout.NoPreview===d.layout()&&d.message()&&d.message(null),t("App:RainLoop").reloadMessageList())}else n.Layout.NoPreview!==d.layout()||d.message()||t("App:RainLoop").historyBack()},i.prototype.onStart=function(){var e=function(){r.windowResize()};(u.capa(n.Capa.AdditionalAccounts)||u.capa(n.Capa.AdditionalIdentities))&&t("App:RainLoop").accountsAndIdentities(),s.delay(function(){"INBOX"!==d.currentFolderFullNameRaw()&&t("App:RainLoop").folderInformation("INBOX")},1e3),s.delay(function(){t("App:RainLoop").quota()},5e3),s.delay(function(){h.appDelayStart(r.emptyFunction)},35e3),o.toggleClass("rl-no-preview-pane",n.Layout.NoPreview===d.layout()),d.folderList.subscribe(e),d.messageList.subscribe(e),d.message.subscribe(e),d.layout.subscribe(function(e){o.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)},i.prototype.routes=function(){var e=function(){return["Inbox",1,"",!0]},t=function(e,t){return t[0]=r.pString(t[0]),t[1]=r.pInt(t[1]),t[1]=0>=t[1]?1:t[1],t[2]=r.pString(t[2]),""===e&&(t[0]="Inbox",t[1]=1),[decodeURI(t[0]),t[1],decodeURI(t[2]),!1]},i=function(e,t){return t[0]=r.pString(t[0]),t[1]=r.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_:i}],[/^message-preview$/,{normalize_:e}],[/^([^\/]*)$/,{normalize_:t}]]},e.exports=i}(t,e)},{$html:17,"App:RainLoop":3,Enums:7,Events:8,Globals:9,"Knoin:AbstractScreen":35,"Storage:RainLoop:Cache":69,"Storage:RainLoop:Data":70,"Storage:RainLoop:Remote":74,"Storage:Settings":75,Utils:14,"View:RainLoop:MailBoxFolderList":79,"View:RainLoop:MailBoxMessageList":80,"View:RainLoop:MailBoxMessageView":81,"View:RainLoop:MailBoxSystemDropDown":82,_:31}],54:[function(e,t){!function(e,t){"use strict";function i(){r.call(this,[t("View:RainLoop:SettingsSystemDropDown"),t("View:RainLoop:SettingsMenu"),t("View:RainLoop:SettingsPane")]),n.initOnStartOrLangChange(function(){this.sSettingsTitle=n.i18n("TITLES/SETTINGS")},this,function(){this.setSettingsTitle()})}var s=t("_"),o=t("Enums"),n=t("Utils"),a=t("Globals"),r=t("Screen:AbstractSettings");s.extend(i.prototype,r.prototype),i.prototype.onShow=function(){this.setSettingsTitle(),a.keyScope(o.KeyState.Settings)},i.prototype.setSettingsTitle=function(){t("App:RainLoop").setTitle(this.sSettingsTitle)},e.exports=i}(t,e)},{"App:RainLoop":3,Enums:7,Globals:9,"Screen:AbstractSettings":51,Utils:14,"View:RainLoop:SettingsMenu":100,"View:RainLoop:SettingsPane":101,"View:RainLoop:SettingsSystemDropDown":102,_:31}],55:[function(e,t){!function(e,t){"use strict";function i(){this.accounts=c.accounts,this.processText=n.computed(function(){return c.accountsLoading()?r.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 s=t("window"),o=t("_"),n=t("ko"),a=t("Enums"),r=t("Utils"),l=t("LinkBuilder"),c=t("Storage:RainLoop:Data"),u=t("Storage:RainLoop:Remote");i.prototype.addNewAccount=function(){t("App:Knoin").showScreenPopup(t("View:Popup:AddAccount"))},i.prototype.deleteAccount=function(e){if(e&&e.deleteAccess()){this.accountForDeletion(null);var i=t("App:Knoin"),n=function(t){return e===t};e&&(this.accounts.remove(n),u.accountDelete(function(e,n){a.StorageResultType.Success===e&&n&&n.Result&&n.Reload?(i.routeOff(),i.setHash(l.root(),!0),i.routeOff(),o.defer(function(){s.location.reload()})):t("App:RainLoop").accountsAndIdentities()},e.email))}},e.exports=i}(t,e)},{"App:Knoin":33,"App:RainLoop":3,Enums:7,LinkBuilder:11,"Storage:RainLoop:Data":70,"Storage:RainLoop:Remote":74,Utils:14,"View:Popup:AddAccount":83,_:31,ko:28,window:32}],56:[function(e,t){!function(e,t){"use strict";function i(){this.changeProcess=o.observable(!1),this.errorDescription=o.observable(""),this.passwordMismatch=o.observable(!1),this.passwordUpdateError=o.observable(!1),this.passwordUpdateSuccess=o.observable(!1),this.currentPassword=o.observable(""),this.currentPassword.error=o.observable(!1),this.newPassword=o.observable(""),this.newPassword2=o.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=a.createCommand(this,function(){this.newPassword()!==this.newPassword2()?(this.passwordMismatch(!0),this.errorDescription(a.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(""),r.changePassword(this.onChangePasswordResponse,this.currentPassword(),this.newPassword()))},function(){return!this.changeProcess()&&""!==this.currentPassword()&&""!==this.newPassword()&&""!==this.newPassword2()}),this.onChangePasswordResponse=s.bind(this.onChangePasswordResponse,this)}var s=t("_"),o=t("ko"),n=t("Enums"),a=t("Utils"),r=t("Storage:RainLoop:Remote");i.prototype.onHide=function(){this.changeProcess(!1),this.currentPassword(""),this.newPassword(""),this.newPassword2(""),this.errorDescription(""),this.passwordMismatch(!1),this.currentPassword.error(!1)},i.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(a.getNotification(t&&t.ErrorCode?t.ErrorCode:n.Notification.CouldNotSaveNewPassword)))},e.exports=i}(t,e)},{Enums:7,"Storage:RainLoop:Remote":74,Utils:14,_:31,ko:28}],57:[function(e,t){!function(e,t){"use strict";function i(){this.contactsAutosave=a.contactsAutosave,this.allowContactsSync=a.allowContactsSync,this.enableContactsSync=a.enableContactsSync,this.contactsSyncUrl=a.contactsSyncUrl,this.contactsSyncUser=a.contactsSyncUser,this.contactsSyncPass=a.contactsSyncPass,this.saveTrigger=s.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 s=t("ko"),o=t("Utils"),n=t("Storage:RainLoop:Remote"),a=t("Storage:RainLoop:Data");i.prototype.onBuild=function(){a.contactsAutosave.subscribe(function(e){n.saveSettings(o.emptyFunction,{ContactsAutosave:e?"1":"0"})})},e.exports=i}(t,e)},{"Storage:RainLoop:Data":70,"Storage:RainLoop:Remote":74,Utils:14,ko:28}],58:[function(e,t){!function(e,t){"use strict";function i(){this.filters=s.observableArray([]),this.filters.loading=s.observable(!1),this.filters.subscribe(function(){o.windowResize()})}var s=t("ko"),o=t("Utils");i.prototype.deleteFilter=function(e){this.filters.remove(e)},i.prototype.addFilter=function(){var e=t("Model:Filter");t("App:Knoin").showScreenPopup(t("View:Popup:Filter"),[new e])},e.exports=i}(t,e)},{"App:Knoin":33,"Model:Filter":45,Utils:14,"View:Popup:Filter":90,ko:28}],59:[function(e,t){!function(e,t){"use strict";function i(){this.foldersListError=l.foldersListError,this.folderList=l.folderList,this.processText=s.computed(function(){var e=l.foldersLoading(),t=l.foldersCreating(),i=l.foldersDeleting(),s=l.foldersRenaming();return t?n.i18n("SETTINGS_FOLDERS/CREATING_PROCESS"):i?n.i18n("SETTINGS_FOLDERS/DELETING_PROCESS"):s?n.i18n("SETTINGS_FOLDERS/RENAMING_PROCESS"):e?n.i18n("SETTINGS_FOLDERS/LOADING_PROCESS"):""},this),this.visibility=s.computed(function(){return""===this.processText()?"hidden":"visible"},this),this.folderForDeletion=s.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1)},function(e){e&&e.deleteAccess(!0)}]}),this.folderForEdit=s.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 s=t("ko"),o=t("Enums"),n=t("Utils"),a=t("Storage:Settings"),r=t("Storage:LocalStorage"),l=t("Storage:RainLoop:Data"),c=t("Storage:RainLoop:Cache"),u=t("Storage:RainLoop:Remote");i.prototype.folderEditOnEnter=function(e){var i=e?n.trim(e.nameForEdit()):"";""!==i&&e.name()!==i&&(r.set(o.ClientSideKeyName.FoldersLashHash,""),l.foldersRenaming(!0),u.folderRename(function(e,i){l.foldersRenaming(!1),o.StorageResultType.Success===e&&i&&i.Result||l.foldersListError(i&&i.ErrorCode?n.getNotification(i.ErrorCode):n.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER")),t("App:RainLoop").folders()},e.fullNameRaw,i),c.removeFolderFromCacheList(e.fullNameRaw),e.name(i)),e.edited(!1)},i.prototype.folderEditOnEsc=function(e){e&&e.edited(!1)},i.prototype.onShow=function(){l.foldersListError("")},i.prototype.createFolder=function(){t("App:Knoin").showScreenPopup(t("View:Popup:FolderCreate"))},i.prototype.systemFolder=function(){t("App:Knoin").showScreenPopup(t("View:Popup:FolderSystem"))},i.prototype.deleteFolder=function(e){if(e&&e.canBeDeleted()&&e.deleteAccess()&&0===e.privateMessageCountAll()){this.folderForDeletion(null);var i=function(t){return e===t?!0:(t.subFolders.remove(i),!1)};e&&(r.set(o.ClientSideKeyName.FoldersLashHash,""),l.folderList.remove(i),l.foldersDeleting(!0),u.folderDelete(function(e,i){l.foldersDeleting(!1),o.StorageResultType.Success===e&&i&&i.Result||l.foldersListError(i&&i.ErrorCode?n.getNotification(i.ErrorCode):n.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER")),t("App:RainLoop").folders()},e.fullNameRaw),c.removeFolderFromCacheList(e.fullNameRaw))}else 0<e.privateMessageCountAll()&&l.foldersListError(n.getNotification(o.Notification.CantDeleteNonEmptyFolder))},i.prototype.subscribeFolder=function(e){r.set(o.ClientSideKeyName.FoldersLashHash,""),u.folderSetSubscribe(n.emptyFunction,e.fullNameRaw,!0),e.subScribed(!0)},i.prototype.unSubscribeFolder=function(e){r.set(o.ClientSideKeyName.FoldersLashHash,""),u.folderSetSubscribe(n.emptyFunction,e.fullNameRaw,!1),e.subScribed(!1)},e.exports=i}(t,e)},{"App:Knoin":33,"App:RainLoop":3,Enums:7,"Storage:LocalStorage":71,"Storage:RainLoop:Cache":69,"Storage:RainLoop:Data":70,"Storage:RainLoop:Remote":74,"Storage:Settings":75,Utils:14,"View:Popup:FolderCreate":92,"View:Popup:FolderSystem":93,ko:28}],60:[function(e,t){!function(e,t){"use strict";function i(){this.mainLanguage=d.mainLanguage,this.mainMessagesPerPage=d.mainMessagesPerPage,this.mainMessagesPerPageArray=r.Defaults.MessagesPerPageArray,this.editorDefaultType=d.editorDefaultType,this.showImages=d.showImages,this.interfaceAnimation=d.interfaceAnimation,this.useDesktopNotifications=d.useDesktopNotifications,this.threading=d.threading,this.useThreads=d.useThreads,this.replySameFolder=d.replySameFolder,this.layout=d.layout,this.usePreviewPane=d.usePreviewPane,this.useCheckboxesInList=d.useCheckboxesInList,this.allowLanguagesOnSettings=d.allowLanguagesOnSettings,this.isDesktopNotificationsSupported=o.computed(function(){return a.DesktopNotifications.NotSupported!==d.desktopNotificationsPermisions()}),this.isDesktopNotificationsDenied=o.computed(function(){return a.DesktopNotifications.NotSupported===d.desktopNotificationsPermisions()||a.DesktopNotifications.Denied===d.desktopNotificationsPermisions()}),this.mainLanguageFullName=o.computed(function(){return c.convertLangName(this.mainLanguage())},this),this.languageTrigger=o.observable(a.SaveSettingsStep.Idle).extend({throttle:100}),this.mppTrigger=o.observable(a.SaveSettingsStep.Idle),this.isAnimationSupported=l.bAnimationSupported}var s=t("$"),o=t("ko"),n=t("_"),a=t("Enums"),r=t("Consts"),l=t("Globals"),c=t("Utils"),u=t("LinkBuilder"),d=t("Storage:RainLoop:Data"),p=t("Storage:RainLoop:Remote");i.prototype.toggleLayout=function(){this.layout(a.Layout.NoPreview===this.layout()?a.Layout.SidePreview:a.Layout.NoPreview)},i.prototype.onBuild=function(){var e=this;n.delay(function(){var t=c.settingsSaveHelperSimpleFunction(e.mppTrigger,e);d.language.subscribe(function(t){e.languageTrigger(a.SaveSettingsStep.Animate),s.ajax({url:u.langLink(t),dataType:"script",cache:!0}).done(function(){c.i18nReload(),e.languageTrigger(a.SaveSettingsStep.TrueResult)}).fail(function(){e.languageTrigger(a.SaveSettingsStep.FalseResult)}).always(function(){n.delay(function(){e.languageTrigger(a.SaveSettingsStep.Idle)},1e3)}),p.saveSettings(c.emptyFunction,{Language:t})}),d.editorDefaultType.subscribe(function(e){p.saveSettings(c.emptyFunction,{EditorDefaultType:e})}),d.messagesPerPage.subscribe(function(e){p.saveSettings(t,{MPP:e})}),d.showImages.subscribe(function(e){p.saveSettings(c.emptyFunction,{ShowImages:e?"1":"0"})}),d.interfaceAnimation.subscribe(function(e){p.saveSettings(c.emptyFunction,{InterfaceAnimation:e})}),d.useDesktopNotifications.subscribe(function(e){c.timeOutAction("SaveDesktopNotifications",function(){p.saveSettings(c.emptyFunction,{DesktopNotifications:e?"1":"0"})},3e3)}),d.replySameFolder.subscribe(function(e){c.timeOutAction("SaveReplySameFolder",function(){p.saveSettings(c.emptyFunction,{ReplySameFolder:e?"1":"0"})},3e3)}),d.useThreads.subscribe(function(e){d.messageList([]),p.saveSettings(c.emptyFunction,{UseThreads:e?"1":"0"})}),d.layout.subscribe(function(e){d.messageList([]),p.saveSettings(c.emptyFunction,{Layout:e})}),d.useCheckboxesInList.subscribe(function(e){p.saveSettings(c.emptyFunction,{UseCheckboxesInList:e?"1":"0"})})},50)},i.prototype.onShow=function(){d.desktopNotifications.valueHasMutated()},i.prototype.selectLanguage=function(){t("App:Knoin").showScreenPopup(t("View:Popup:Languages"))},e.exports=i}(t,e)},{$:26,"App:Knoin":33,Consts:6,Enums:7,Globals:9,LinkBuilder:11,"Storage:RainLoop:Data":70,"Storage:RainLoop:Remote":74,Utils:14,"View:Popup:Languages":96,_:31,ko:28}],61:[function(e,t){!function(e,t){"use strict";function i(){this.editor=null,this.defautOptionsAfterRender=a.defautOptionsAfterRender,this.accountEmail=l.accountEmail,this.displayName=l.displayName,this.signature=l.signature,this.signatureToAll=l.signatureToAll,this.replyTo=l.replyTo,this.signatureDom=s.observable(null),this.defaultIdentityIDTrigger=s.observable(n.SaveSettingsStep.Idle),this.displayNameTrigger=s.observable(n.SaveSettingsStep.Idle),this.replyTrigger=s.observable(n.SaveSettingsStep.Idle),this.signatureTrigger=s.observable(n.SaveSettingsStep.Idle),this.identities=l.identities,this.defaultIdentityID=l.defaultIdentityID,this.identitiesOptions=s.computed(function(){var e=this.identities(),t=[];return 0<e.length&&(t.push({id:this.accountEmail.peek(),name:this.formattedAccountIdentity(),seporator:!1}),t.push({id:"---",name:"---",seporator:!0,disabled:!0}),o.each(e,function(e){t.push({id:e.id,name:e.formattedNameForEmail(),seporator:!1})})),t},this),this.processText=s.computed(function(){return l.identitiesLoading()?a.i18n("SETTINGS_IDENTITIES/LOADING_PROCESS"):""},this),this.visibility=s.computed(function(){return""===this.processText()?"hidden":"visible"},this),this.identityForDeletion=s.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1)},function(e){e&&e.deleteAccess(!0)}]})}var s=t("ko"),o=t("_"),n=t("Enums"),a=t("Utils"),r=t("HtmlEditor"),l=t("Storage:RainLoop:Data"),c=t("Storage:RainLoop:Remote");i.prototype.formattedAccountIdentity=function(){var e=this.displayName.peek(),t=this.accountEmail.peek();return""===e?t:'"'+a.quoteName(e)+'" <'+t+">"},i.prototype.addNewIdentity=function(){t("App:Knoin").showScreenPopup(t("View:Popup:Identity"))},i.prototype.editIdentity=function(e){t("App:Knoin").showScreenPopup(t("View:Popup:Identity"),[e])},i.prototype.deleteIdentity=function(e){if(e&&e.deleteAccess()){this.identityForDeletion(null);var i=function(t){return e===t};e&&(this.identities.remove(i),c.identityDelete(function(){t("App:RainLoop").accountsAndIdentities()},e.id))}},i.prototype.onFocus=function(){if(!this.editor&&this.signatureDom()){var e=this,t=l.signature();this.editor=new r(e.signatureDom(),function(){l.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)})}},i.prototype.onBuild=function(e){var t=this;e.on("click",".identity-item .e-action",function(){var e=s.dataFor(this);e&&t.editIdentity(e)}),o.delay(function(){var e=a.settingsSaveHelperSimpleFunction(t.displayNameTrigger,t),i=a.settingsSaveHelperSimpleFunction(t.replyTrigger,t),s=a.settingsSaveHelperSimpleFunction(t.signatureTrigger,t),o=a.settingsSaveHelperSimpleFunction(t.defaultIdentityIDTrigger,t);l.defaultIdentityID.subscribe(function(e){c.saveSettings(o,{DefaultIdentityID:e})}),l.displayName.subscribe(function(t){c.saveSettings(e,{DisplayName:t})}),l.replyTo.subscribe(function(e){c.saveSettings(i,{ReplyTo:e})}),l.signature.subscribe(function(e){c.saveSettings(s,{Signature:e})}),l.signatureToAll.subscribe(function(e){c.saveSettings(null,{SignatureToAll:e?"1":"0"})})},50)},e.exports=i}(t,e)},{"App:Knoin":33,"App:RainLoop":3,Enums:7,HtmlEditor:10,"Storage:RainLoop:Data":70,"Storage:RainLoop:Remote":74,Utils:14,"View:Popup:Identity":94,_:31,ko:28}],62:[function(e,t){!function(e,t){"use strict";
function i(){this.editor=null,this.displayName=l.displayName,this.signature=l.signature,this.signatureToAll=l.signatureToAll,this.replyTo=l.replyTo,this.signatureDom=s.observable(null),this.displayNameTrigger=s.observable(n.SaveSettingsStep.Idle),this.replyTrigger=s.observable(n.SaveSettingsStep.Idle),this.signatureTrigger=s.observable(n.SaveSettingsStep.Idle)}var s=t("ko"),o=t("_"),n=t("Enums"),a=t("Utils"),r=t("HtmlEditor"),l=t("Storage:RainLoop:Data"),c=t("Storage:RainLoop:Remote");i.prototype.onFocus=function(){if(!this.editor&&this.signatureDom()){var e=this,t=l.signature();this.editor=new r(e.signatureDom(),function(){l.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)})}},i.prototype.onBuild=function(){var e=this;o.delay(function(){var t=a.settingsSaveHelperSimpleFunction(e.displayNameTrigger,e),i=a.settingsSaveHelperSimpleFunction(e.replyTrigger,e),s=a.settingsSaveHelperSimpleFunction(e.signatureTrigger,e);l.displayName.subscribe(function(e){c.saveSettings(t,{DisplayName:e})}),l.replyTo.subscribe(function(e){c.saveSettings(i,{ReplyTo:e})}),l.signature.subscribe(function(e){c.saveSettings(s,{Signature:e})}),l.signatureToAll.subscribe(function(e){c.saveSettings(null,{SignatureToAll:e?"1":"0"})})},50)},e.exports=i}(t,e)},{Enums:7,HtmlEditor:10,"Storage:RainLoop:Data":70,"Storage:RainLoop:Remote":74,Utils:14,_:31,ko:28}],63:[function(e,t){!function(e,t){"use strict";function i(){this.openpgpkeys=n.openpgpkeys,this.openpgpkeysPublic=n.openpgpkeysPublic,this.openpgpkeysPrivate=n.openpgpkeysPrivate,this.openPgpKeyForDeletion=s.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1)},function(e){e&&e.deleteAccess(!0)}]})}var s=t("ko"),o=t("App:Knoin"),n=t("Storage:RainLoop:Data");i.prototype.addOpenPgpKey=function(){o.showScreenPopup(t("View:Popup:AddOpenPgpKey"))},i.prototype.generateOpenPgpKey=function(){o.showScreenPopup(t("View:Popup:NewOpenPgpKey"))},i.prototype.viewOpenPgpKey=function(e){e&&o.showScreenPopup(t("View:Popup:ViewOpenPgpKey"),[e])},i.prototype.deleteOpenPgpKey=function(e){e&&e.deleteAccess()&&(this.openPgpKeyForDeletion(null),e&&n.openpgpKeyring&&(this.openpgpkeys.remove(function(t){return e===t}),n.openpgpKeyring[e.isPrivate?"privateKeys":"publicKeys"].removeForId(e.guid),n.openpgpKeyring.store(),t("App:RainLoop").reloadOpenPgpKeys()))},e.exports=i}(t,e)},{"App:Knoin":33,"App:RainLoop":3,"Storage:RainLoop:Data":70,"View:Popup:AddOpenPgpKey":84,"View:Popup:NewOpenPgpKey":97,"View:Popup:ViewOpenPgpKey":99,ko:28}],64:[function(e,t){!function(e,t){"use strict";function i(){this.processing=s.observable(!1),this.clearing=s.observable(!1),this.secreting=s.observable(!1),this.viewUser=s.observable(""),this.viewEnable=s.observable(!1),this.viewEnable.subs=!0,this.twoFactorStatus=s.observable(!1),this.viewSecret=s.observable(""),this.viewBackupCodes=s.observable(""),this.viewUrl=s.observable(""),this.bFirst=!0,this.viewTwoFactorStatus=s.computed(function(){return n.langChangeTrigger(),a.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 s=t("ko"),o=t("Enums"),n=t("Globals"),a=t("Utils"),r=t("Storage:RainLoop:Remote");i.prototype.showSecret=function(){this.secreting(!0),r.showTwoFactorSecret(this.onSecretResult)},i.prototype.hideSecret=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")},i.prototype.createTwoFactor=function(){this.processing(!0),r.createTwoFactor(this.onResult)},i.prototype.enableTwoFactor=function(){this.processing(!0),r.enableTwoFactor(this.onResult,this.viewEnable())},i.prototype.testTwoFactor=function(){t("App:Knoin").showScreenPopup(t("View:Popup:TwoFactorTest"))},i.prototype.clearTwoFactor=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl(""),this.clearing(!0),r.clearTwoFactor(this.onResult)},i.prototype.onShow=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")},i.prototype.onResult=function(e,t){if(this.processing(!1),this.clearing(!1),o.StorageResultType.Success===e&&t&&t.Result?(this.viewUser(a.pString(t.Result.User)),this.viewEnable(!!t.Result.Enable),this.twoFactorStatus(!!t.Result.IsSet),this.viewSecret(a.pString(t.Result.Secret)),this.viewBackupCodes(a.pString(t.Result.BackupCodes).replace(/[\s]+/g," ")),this.viewUrl(a.pString(t.Result.Url))):(this.viewUser(""),this.viewEnable(!1),this.twoFactorStatus(!1),this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")),this.bFirst){this.bFirst=!1;var i=this;this.viewEnable.subscribe(function(e){this.viewEnable.subs&&r.enableTwoFactor(function(e,t){o.StorageResultType.Success===e&&t&&t.Result||(i.viewEnable.subs=!1,i.viewEnable(!1),i.viewEnable.subs=!0)},e)},this)}},i.prototype.onSecretResult=function(e,t){this.secreting(!1),o.StorageResultType.Success===e&&t&&t.Result?(this.viewSecret(a.pString(t.Result.Secret)),this.viewUrl(a.pString(t.Result.Url))):(this.viewSecret(""),this.viewUrl(""))},i.prototype.onBuild=function(){this.processing(!0),r.getTwoFactor(this.onResult)},e.exports=i}(t,e)},{"App:Knoin":33,Enums:7,Globals:9,"Storage:RainLoop:Remote":74,Utils:14,"View:Popup:TwoFactorTest":98,ko:28}],65:[function(e,t){!function(e,t){"use strict";function i(){var e=t("Utils"),i=t("Storage:RainLoop:Data");this.googleEnable=i.googleEnable,this.googleActions=i.googleActions,this.googleLoggined=i.googleLoggined,this.googleUserName=i.googleUserName,this.facebookEnable=i.facebookEnable,this.facebookActions=i.facebookActions,this.facebookLoggined=i.facebookLoggined,this.facebookUserName=i.facebookUserName,this.twitterEnable=i.twitterEnable,this.twitterActions=i.twitterActions,this.twitterLoggined=i.twitterLoggined,this.twitterUserName=i.twitterUserName,this.connectGoogle=e.createCommand(this,function(){this.googleLoggined()||t("App:RainLoop").googleConnect()},function(){return!this.googleLoggined()&&!this.googleActions()}),this.disconnectGoogle=e.createCommand(this,function(){t("App:RainLoop").googleDisconnect()}),this.connectFacebook=e.createCommand(this,function(){this.facebookLoggined()||t("App:RainLoop").facebookConnect()},function(){return!this.facebookLoggined()&&!this.facebookActions()}),this.disconnectFacebook=e.createCommand(this,function(){t("App:RainLoop").facebookDisconnect()}),this.connectTwitter=e.createCommand(this,function(){this.twitterLoggined()||t("App:RainLoop").twitterConnect()},function(){return!this.twitterLoggined()&&!this.twitterActions()}),this.disconnectTwitter=e.createCommand(this,function(){t("App:RainLoop").twitterDisconnect()})}e.exports=i}(t,e)},{"App:RainLoop":3,"Storage:RainLoop:Data":70,Utils:14}],66:[function(e,t){!function(e,t){"use strict";function i(){var e=this;this.mainTheme=u.mainTheme,this.themesObjects=n.observableArray([]),this.themeTrigger=n.observable(r.SaveSettingsStep.Idle).extend({throttle:100}),this.oLastAjax=null,this.iTimer=0,u.theme.subscribe(function(t){a.each(this.themesObjects(),function(e){e.selected(t===e.name)});var i=o("#rlThemeLink"),n=o("#rlThemeStyle"),c=i.attr("href");c||(c=n.attr("data-href")),c&&(c=c.toString().replace(/\/-\/[^\/]+\/\-\//,"/-/"+t+"/-/"),c=c.toString().replace(/\/Css\/[^\/]+\/User\//,"/Css/0/User/"),"Json/"!==c.substring(c.length-5,c.length)&&(c+="Json/"),s.clearTimeout(e.iTimer),e.themeTrigger(r.SaveSettingsStep.Animate),this.oLastAjax&&this.oLastAjax.abort&&this.oLastAjax.abort(),this.oLastAjax=o.ajax({url:c,dataType:"json"}).done(function(t){t&&l.isArray(t)&&2===t.length&&(!i||!i[0]||n&&n[0]||(n=o('<style id="rlThemeStyle"></style>'),i.after(n),i.remove()),n&&n[0]&&(n.attr("data-href",c).attr("data-theme",t[0]),n&&n[0]&&n[0].styleSheet&&!l.isUnd(n[0].styleSheet.cssText)?n[0].styleSheet.cssText=t[1]:n.text(t[1])),e.themeTrigger(r.SaveSettingsStep.TrueResult))}).always(function(){e.iTimer=s.setTimeout(function(){e.themeTrigger(r.SaveSettingsStep.Idle)},1e3),e.oLastAjax=null})),d.saveSettings(null,{Theme:t})},this)}var s=t("window"),o=t("$"),n=t("ko"),a=t("_"),r=t("Enums"),l=t("Utils"),c=t("LinkBuilder"),u=t("Storage:RainLoop:Data"),d=t("Storage:RainLoop:Remote");i.prototype.onBuild=function(){var e=u.theme();this.themesObjects(a.map(u.themes(),function(t){return{name:t,nameDisplay:l.convertThemeName(t),selected:n.observable(t===e),themePreviewSrc:c.themePreviewLink(t)}}))},e.exports=i}(t,e)},{$:26,Enums:7,LinkBuilder:11,"Storage:RainLoop:Data":70,"Storage:RainLoop:Remote":74,Utils:14,_:31,ko:28,window:32}],67:[function(e,t){!function(e,t){"use strict";function i(){o.initDataConstructorBySettings(this)}var s=t("Enums"),o=t("Utils"),n=t("Storage:Settings");i.prototype.populateDataOnStart=function(){var e=o.pInt(n.settingsGet("Layout")),t=n.settingsGet("Languages"),i=n.settingsGet("Themes");o.isArray(t)&&this.languages(t),o.isArray(i)&&this.themes(i),this.mainLanguage(n.settingsGet("Language")),this.mainTheme(n.settingsGet("Theme")),this.capaAdditionalAccounts(n.capa(s.Capa.AdditionalAccounts)),this.capaAdditionalIdentities(n.capa(s.Capa.AdditionalIdentities)),this.capaGravatar(n.capa(s.Capa.Gravatar)),this.determineUserLanguage(!!n.settingsGet("DetermineUserLanguage")),this.determineUserDomain(!!n.settingsGet("DetermineUserDomain")),this.capaThemes(n.capa(s.Capa.Themes)),this.allowLanguagesOnLogin(!!n.settingsGet("AllowLanguagesOnLogin")),this.allowLanguagesOnSettings(!!n.settingsGet("AllowLanguagesOnSettings")),this.useLocalProxyForExternalImages(!!n.settingsGet("UseLocalProxyForExternalImages")),this.editorDefaultType(n.settingsGet("EditorDefaultType")),this.showImages(!!n.settingsGet("ShowImages")),this.contactsAutosave(!!n.settingsGet("ContactsAutosave")),this.interfaceAnimation(n.settingsGet("InterfaceAnimation")),this.mainMessagesPerPage(n.settingsGet("MPP")),this.desktopNotifications(!!n.settingsGet("DesktopNotifications")),this.useThreads(!!n.settingsGet("UseThreads")),this.replySameFolder(!!n.settingsGet("ReplySameFolder")),this.useCheckboxesInList(!!n.settingsGet("UseCheckboxesInList")),this.layout(s.Layout.SidePreview),-1<o.inArray(e,[s.Layout.NoPreview,s.Layout.SidePreview,s.Layout.BottomPreview])&&this.layout(e),this.facebookSupported(!!n.settingsGet("SupportedFacebookSocial")),this.facebookEnable(!!n.settingsGet("AllowFacebookSocial")),this.facebookAppID(n.settingsGet("FacebookAppID")),this.facebookAppSecret(n.settingsGet("FacebookAppSecret")),this.twitterEnable(!!n.settingsGet("AllowTwitterSocial")),this.twitterConsumerKey(n.settingsGet("TwitterConsumerKey")),this.twitterConsumerSecret(n.settingsGet("TwitterConsumerSecret")),this.googleEnable(!!n.settingsGet("AllowGoogleSocial")),this.googleClientID(n.settingsGet("GoogleClientID")),this.googleClientSecret(n.settingsGet("GoogleClientSecret")),this.googleApiKey(n.settingsGet("GoogleApiKey")),this.dropboxEnable(!!n.settingsGet("AllowDropboxSocial")),this.dropboxApiKey(n.settingsGet("DropboxApiKey")),this.contactsIsAllowed(!!n.settingsGet("ContactsIsAllowed"))},e.exports=i}(t,e)},{Enums:7,"Storage:Settings":75,Utils:14}],68:[function(e,t){!function(e,t){"use strict";function i(){this.oRequests={}}var s=t("window"),o=t("$"),n=t("_"),a=t("Consts"),r=t("Enums"),l=t("Globals"),c=t("Utils"),u=t("Plugins"),d=t("LinkBuilder"),p=t("Storage:Settings");i.prototype.oRequests={},i.prototype.defaultResponse=function(e,t,i,o,d,p){var h=function(){r.StorageResultType.Success!==i&&l.bUnload&&(i=r.StorageResultType.Unload),r.StorageResultType.Success===i&&o&&!o.Result?(o&&-1<c.inArray(o.ErrorCode,[r.Notification.AuthError,r.Notification.AccessError,r.Notification.ConnectionError,r.Notification.DomainNotAllowed,r.Notification.AccountNotAllowed,r.Notification.MailServerError,r.Notification.UnknownNotification,r.Notification.UnknownError])&&l.iAjaxErrorCount++,o&&r.Notification.InvalidToken===o.ErrorCode&&l.iTokenErrorCount++,a.Values.TokenErrorLimit<l.iTokenErrorCount&&l.__APP&&l.__APP.loginAndLogoutReload(!0),(o.Logout||a.Values.AjaxErrorLimit<l.iAjaxErrorCount)&&(s.__rlah_clear&&s.__rlah_clear(),l.__APP&&l.__APP.loginAndLogoutReload(!0))):r.StorageResultType.Success===i&&o&&o.Result&&(l.iAjaxErrorCount=0,l.iTokenErrorCount=0),e&&(u.runHook("ajax-default-response",[t,r.StorageResultType.Success===i?o:null,i,d,p]),e(i,r.StorageResultType.Success===i?o:null,d,t,p))};switch(i){case"success":i=r.StorageResultType.Success;break;case"abort":i=r.StorageResultType.Abort;break;default:i=r.StorageResultType.Error}r.StorageResultType.Error===i?n.delay(h,300):h()},i.prototype.ajaxRequest=function(e,t,i,a,r){var l=this,u=""===a,h={},g=(new s.Date).getTime(),m=null,f="";return t=t||{},i=c.isNormal(i)?i:2e4,a=c.isUnd(a)?"":c.pString(a),r=c.isArray(r)?r:[],f=t.Action||"",f&&0<r.length&&n.each(r,function(e){l.oRequests[e]&&(l.oRequests[e].__aborted=!0,l.oRequests[e].abort&&l.oRequests[e].abort(),l.oRequests[e]=null)}),u&&(t.XToken=p.settingsGet("Token")),m=o.ajax({type:u?"POST":"GET",url:d.ajax(a),async:!0,dataType:"json",data:u?t:{},headers:h,timeout:i,global:!0}),m.always(function(i,o){var n=!1;i&&i.Time&&(n=c.pInt(i.Time)>(new s.Date).getTime()-g),f&&l.oRequests[f]&&(l.oRequests[f].__aborted&&(o="abort"),l.oRequests[f]=null),l.defaultResponse(e,f,o,i,n,t)}),f&&0<r.length&&-1<c.inArray(f,r)&&(this.oRequests[f]&&(this.oRequests[f].__aborted=!0,this.oRequests[f].abort&&this.oRequests[f].abort(),this.oRequests[f]=null),this.oRequests[f]=m),m},i.prototype.defaultRequest=function(e,t,i,s,o,n){i=i||{},i.Action=t,o=c.pString(o),u.runHook("ajax-default-request",[t,i,o]),this.ajaxRequest(e,i,c.isUnd(s)?a.Defaults.DefaultAjaxTimeout:c.pInt(s),o,n)},i.prototype.noop=function(e){this.defaultRequest(e,"Noop")},i.prototype.jsError=function(e,t,i,s,o,n,a){this.defaultRequest(e,"JsError",{Message:t,FileName:i,LineNo:s,Location:o,HtmlCapa:n,TimeOnPage:a})},i.prototype.jsInfo=function(e,t,i,s){this.defaultRequest(e,"JsInfo",{Type:t,Data:i,IsError:(c.isUnd(s)?1:!s)?"0":"1"})},i.prototype.getPublicKey=function(e){this.defaultRequest(e,"GetPublicKey")},i.prototype.jsVersion=function(e,t){this.defaultRequest(e,"Version",{Version:t})},e.exports=i}(t,e)},{$:26,Consts:6,Enums:7,Globals:9,LinkBuilder:11,Plugins:12,"Storage:Settings":75,Utils:14,_:31,window:32}],69:[function(e,t){!function(e,t){"use strict";function i(){this.oFoldersCache={},this.oFoldersNamesCache={},this.oFolderHashCache={},this.oFolderUidNextCache={},this.oMessageListHashCache={},this.oMessageFlagsCache={},this.oNewMessage={},this.oRequestedMessage={},this.bCapaGravatar=r.capa(o.Capa.Gravatar)}var s=t("_"),o=t("Enums"),n=t("Utils"),a=t("LinkBuilder"),r=t("Storage:Settings");i.prototype.bCapaGravatar=!1,i.prototype.oFoldersCache={},i.prototype.oFoldersNamesCache={},i.prototype.oFolderHashCache={},i.prototype.oFolderUidNextCache={},i.prototype.oMessageListHashCache={},i.prototype.oMessageFlagsCache={},i.prototype.oBodies={},i.prototype.oNewMessage={},i.prototype.oRequestedMessage={},i.prototype.clear=function(){this.oFoldersCache={},this.oFoldersNamesCache={},this.oFolderHashCache={},this.oFolderUidNextCache={},this.oMessageListHashCache={},this.oMessageFlagsCache={},this.oBodies={}},i.prototype.getUserPic=function(e,t){e=n.trim(e),t(this.bCapaGravatar&&""!==e?a.avatarLink(e):"",e)},i.prototype.getMessageKey=function(e,t){return e+"#"+t},i.prototype.addRequestedMessage=function(e,t){this.oRequestedMessage[this.getMessageKey(e,t)]=!0},i.prototype.hasRequestedMessage=function(e,t){return!0===this.oRequestedMessage[this.getMessageKey(e,t)]},i.prototype.addNewMessageCache=function(e,t){this.oNewMessage[this.getMessageKey(e,t)]=!0},i.prototype.hasNewMessageAndRemoveFromCache=function(e,t){return this.oNewMessage[this.getMessageKey(e,t)]?(this.oNewMessage[this.getMessageKey(e,t)]=null,!0):!1},i.prototype.clearNewMessageCache=function(){this.oNewMessage={}},i.prototype.getFolderFullNameRaw=function(e){return""!==e&&this.oFoldersNamesCache[e]?this.oFoldersNamesCache[e]:""},i.prototype.setFolderFullNameRaw=function(e,t){this.oFoldersNamesCache[e]=t},i.prototype.getFolderHash=function(e){return""!==e&&this.oFolderHashCache[e]?this.oFolderHashCache[e]:""},i.prototype.setFolderHash=function(e,t){this.oFolderHashCache[e]=t},i.prototype.getFolderUidNext=function(e){return""!==e&&this.oFolderUidNextCache[e]?this.oFolderUidNextCache[e]:""},i.prototype.setFolderUidNext=function(e,t){this.oFolderUidNextCache[e]=t},i.prototype.getFolderFromCacheList=function(e){return""!==e&&this.oFoldersCache[e]?this.oFoldersCache[e]:null},i.prototype.setFolderToCacheList=function(e,t){this.oFoldersCache[e]=t},i.prototype.removeFolderFromCacheList=function(e){this.setFolderToCacheList(e,null)},i.prototype.getMessageFlagsFromCache=function(e,t){return this.oMessageFlagsCache[e]&&this.oMessageFlagsCache[e][t]?this.oMessageFlagsCache[e][t]:null},i.prototype.setMessageFlagsToCache=function(e,t,i){this.oMessageFlagsCache[e]||(this.oMessageFlagsCache[e]={}),this.oMessageFlagsCache[e][t]=i},i.prototype.clearMessageFlagsFromCacheByFolder=function(e){this.oMessageFlagsCache[e]={}},i.prototype.initMessageFlagsFromCache=function(e){if(e){var t=this,i=this.getMessageFlagsFromCache(e.folderFullNameRaw,e.uid),o=null,a=null;i&&0<i.length&&(e.unseen(!!i[0]),e.flagged(!!i[1]),e.answered(!!i[2]),e.forwarded(!!i[3]),e.isReadReceipt(!!i[4])),0<e.threads().length&&(o=s.find(e.threads(),function(i){var s=t.getMessageFlagsFromCache(e.folderFullNameRaw,i);return s&&0<s.length&&!!s[0]}),a=s.find(e.threads(),function(i){var s=t.getMessageFlagsFromCache(e.folderFullNameRaw,i);return s&&0<s.length&&!!s[1]}),e.hasUnseenSubMessage(o&&0<n.pInt(o)),e.hasFlaggedSubMessage(a&&0<n.pInt(a)))}},i.prototype.storeMessageFlagsToCache=function(e){e&&this.setMessageFlagsToCache(e.folderFullNameRaw,e.uid,[e.unseen(),e.flagged(),e.answered(),e.forwarded(),e.isReadReceipt()])},i.prototype.storeMessageFlagsToCacheByFolderAndUid=function(e,t,i){n.isArray(i)&&0<i.length&&this.setMessageFlagsToCache(e,t,i)},e.exports=new i}(t,e)},{Enums:7,LinkBuilder:11,"Storage:Settings":75,Utils:14,_:31}],70:[function(e,t){!function(e,t){"use strict";function i(){v.call(this);var e=function(e){return function(){var t=f.getFolderFromCacheList(e());t&&t.type(d.FolderType.User)}},t=function(e){return function(t){var i=f.getFolderFromCacheList(t);i&&i.type(e)}};this.devEmail="",this.devPassword="",this.accountEmail=a.observable(""),this.accountIncLogin=a.observable(""),this.accountOutLogin=a.observable(""),this.projectHash=a.observable(""),this.threading=a.observable(!1),this.lastFoldersHash="",this.remoteSuggestions=!1,this.sentFolder=a.observable(""),this.draftFolder=a.observable(""),this.spamFolder=a.observable(""),this.trashFolder=a.observable(""),this.archiveFolder=a.observable(""),this.sentFolder.subscribe(e(this.sentFolder),this,"beforeChange"),this.draftFolder.subscribe(e(this.draftFolder),this,"beforeChange"),this.spamFolder.subscribe(e(this.spamFolder),this,"beforeChange"),this.trashFolder.subscribe(e(this.trashFolder),this,"beforeChange"),this.archiveFolder.subscribe(e(this.archiveFolder),this,"beforeChange"),this.sentFolder.subscribe(t(d.FolderType.SentItems),this),this.draftFolder.subscribe(t(d.FolderType.Draft),this),this.spamFolder.subscribe(t(d.FolderType.Spam),this),this.trashFolder.subscribe(t(d.FolderType.Trash),this),this.archiveFolder.subscribe(t(d.FolderType.Archive),this),this.draftFolderNotEnabled=a.computed(function(){return""===this.draftFolder()||u.Values.UnuseOptionValue===this.draftFolder()},this),this.displayName=a.observable(""),this.signature=a.observable(""),this.signatureToAll=a.observable(!1),this.replyTo=a.observable(""),this.enableTwoFactor=a.observable(!1),this.accounts=a.observableArray([]),this.accountsLoading=a.observable(!1).extend({throttle:100}),this.defaultIdentityID=a.observable(""),this.identities=a.observableArray([]),this.identitiesLoading=a.observable(!1).extend({throttle:100}),this.contactTags=a.observableArray([]),this.contacts=a.observableArray([]),this.contacts.loading=a.observable(!1).extend({throttle:200}),this.contacts.importing=a.observable(!1).extend({throttle:200}),this.contacts.syncing=a.observable(!1).extend({throttle:200}),this.contacts.exportingVcf=a.observable(!1).extend({throttle:200}),this.contacts.exportingCsv=a.observable(!1).extend({throttle:200}),this.allowContactsSync=a.observable(!1),this.enableContactsSync=a.observable(!1),this.contactsSyncUrl=a.observable(""),this.contactsSyncUser=a.observable(""),this.contactsSyncPass=a.observable(""),this.allowContactsSync=a.observable(!!m.settingsGet("ContactsSyncIsAllowed")),this.enableContactsSync=a.observable(!!m.settingsGet("EnableContactsSync")),this.contactsSyncUrl=a.observable(m.settingsGet("ContactsSyncUrl")),this.contactsSyncUser=a.observable(m.settingsGet("ContactsSyncUser")),this.contactsSyncPass=a.observable(m.settingsGet("ContactsSyncPassword")),this.namespace="",this.folderList=a.observableArray([]),this.folderList.focused=a.observable(!1),this.foldersListError=a.observable(""),this.foldersLoading=a.observable(!1),this.foldersCreating=a.observable(!1),this.foldersDeleting=a.observable(!1),this.foldersRenaming=a.observable(!1),this.foldersChanging=a.computed(function(){var e=this.foldersLoading(),t=this.foldersCreating(),i=this.foldersDeleting(),s=this.foldersRenaming();return e||t||i||s},this),this.foldersInboxUnreadCount=a.observable(0),this.currentFolder=a.observable(null).extend({toggleSubscribe:[null,function(e){e&&e.selected(!1)},function(e){e&&e.selected(!0)}]}),this.currentFolderFullNameRaw=a.computed(function(){return this.currentFolder()?this.currentFolder().fullNameRaw:""},this),this.currentFolderFullName=a.computed(function(){return this.currentFolder()?this.currentFolder().fullName:""},this),this.currentFolderFullNameHash=a.computed(function(){return this.currentFolder()?this.currentFolder().fullNameHash:""},this),this.currentFolderName=a.computed(function(){return this.currentFolder()?this.currentFolder().name():""},this),this.folderListSystemNames=a.computed(function(){var e=["INBOX"],t=this.folderList(),i=this.sentFolder(),s=this.draftFolder(),o=this.spamFolder(),n=this.trashFolder(),a=this.archiveFolder();return h.isArray(t)&&0<t.length&&(""!==i&&u.Values.UnuseOptionValue!==i&&e.push(i),""!==s&&u.Values.UnuseOptionValue!==s&&e.push(s),""!==o&&u.Values.UnuseOptionValue!==o&&e.push(o),""!==n&&u.Values.UnuseOptionValue!==n&&e.push(n),""!==a&&u.Values.UnuseOptionValue!==a&&e.push(a)),e},this),this.folderListSystem=a.computed(function(){return n.compact(n.map(this.folderListSystemNames(),function(e){return f.getFolderFromCacheList(e)}))},this),this.folderMenuForMove=a.computed(function(){return h.folderListOptionsBuilder(this.folderListSystem(),this.folderList(),[this.currentFolderFullNameRaw()],null,null,null,null,function(e){return e?e.localName():""})},this),this.staticMessageList=[],this.messageList=a.observableArray([]).extend({rateLimit:0}),this.messageListCount=a.observable(0),this.messageListSearch=a.observable(""),this.messageListPage=a.observable(1),this.messageListThreadFolder=a.observable(""),this.messageListThreadUids=a.observableArray([]),this.messageListThreadFolder.subscribe(function(){this.messageListThreadUids([])},this),this.messageListEndFolder=a.observable(""),this.messageListEndSearch=a.observable(""),this.messageListEndPage=a.observable(1),this.messageListEndHash=a.computed(function(){return this.messageListEndFolder()+"|"+this.messageListEndSearch()+"|"+this.messageListEndPage()},this),this.messageListPageCount=a.computed(function(){var e=s.Math.ceil(this.messageListCount()/this.messagesPerPage());return 0>=e?1:e},this),this.mainMessageListSearch=a.computed({read:this.messageListSearch,write:function(e){b.setHash(g.mailBox(this.currentFolderFullNameHash(),1,h.trim(e.toString())))},owner:this}),this.messageListError=a.observable(""),this.messageListLoading=a.observable(!1),this.messageListIsNotCompleted=a.observable(!1),this.messageListCompleteLoadingThrottle=a.observable(!1).extend({throttle:200}),this.messageListCompleteLoading=a.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=a.observable(null),this.messageLoading=a.observable(!1),this.messageLoadingThrottle=a.observable(!1).extend({throttle:50}),this.message.focused=a.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()&&-1<s.location.hash.indexOf("message-preview")&&p.__APP&&p.__APP.historyBack())},this),this.message.focused.subscribe(function(e){e?(this.folderList.focused(!1),p.keyScope(d.KeyState.MessageView)):d.KeyState.MessageView===p.keyScope()&&p.keyScope(d.Layout.NoPreview===this.layout()&&this.message()?d.KeyState.MessageView:d.KeyState.MessageList)},this),this.folderList.focused.subscribe(function(e){e?p.keyScope(d.KeyState.FolderList):d.KeyState.FolderList===p.keyScope()&&p.keyScope(d.KeyState.MessageList)}),this.messageLoading.subscribe(function(e){this.messageLoadingThrottle(e)},this),this.messageFullScreenMode=a.observable(!1),this.messageError=a.observable(""),this.messagesBodiesDom=a.observable(null),this.messagesBodiesDom.subscribe(function(e){!e||e instanceof o||this.messagesBodiesDom(o(e))},this),this.messageActiveDom=a.observable(null),this.isMessageSelected=a.computed(function(){return null!==this.message()},this),this.currentMessage=a.observable(null),this.messageListChecked=a.computed(function(){return n.filter(this.messageList(),function(e){return e.checked()})},this).extend({rateLimit:0}),this.hasCheckedMessages=a.computed(function(){return 0<this.messageListChecked().length},this).extend({rateLimit:0}),this.messageListCheckedOrSelected=a.computed(function(){var e=this.messageListChecked(),t=this.currentMessage();return n.union(e,t?[t]:[])},this),this.messageListCheckedOrSelectedUidsWithSubMails=a.computed(function(){var e=[];return n.each(this.messageListCheckedOrSelected(),function(t){t&&(e.push(t.uid),0<t.threadsLen()&&0===t.parentUid()&&t.lastInCollapsedThread()&&(e=n.union(e,t.threads())))}),e},this),this.userQuota=a.observable(0),this.userUsageSize=a.observable(0),this.userUsageProc=a.computed(function(){var e=this.userQuota(),t=this.userUsageSize();return e>0?s.Math.ceil(t/e*100):0},this),this.capaOpenPGP=a.observable(!1),this.openpgpkeys=a.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=a.observable(!1),this.googleLoggined=a.observable(!1),this.googleUserName=a.observable(""),this.facebookActions=a.observable(!1),this.facebookLoggined=a.observable(!1),this.facebookUserName=a.observable(""),this.twitterActions=a.observable(!1),this.twitterLoggined=a.observable(!1),this.twitterUserName=a.observable(""),this.customThemeType=a.observable(d.CustomThemeType.Light),this.purgeMessageBodyCacheThrottle=n.throttle(this.purgeMessageBodyCache,3e4)}var s=t("window"),o=t("$"),n=t("_"),a=t("ko"),r=t("moment"),l=t("$div"),c=t("NotificationClass"),u=t("Consts"),d=t("Enums"),p=t("Globals"),h=t("Utils"),g=t("LinkBuilder"),m=t("Storage:Settings"),f=t("Storage:RainLoop:Cache"),b=t("App:Knoin"),S=t("Model:Message"),y=t("Storage:LocalStorage"),v=t("Storage:Abstract:Data");n.extend(i.prototype,v.prototype),i.prototype.purgeMessageBodyCache=function(){var e=0,t=null,i=p.iMessageBodyCacheCount-u.Values.MessageBodyCacheLimit;i>0&&(t=this.messagesBodiesDom(),t&&(t.find(".rl-cache-class").each(function(){var t=o(this);i>t.data("rl-cache-count")&&(t.addClass("rl-cache-purge"),e++)}),e>0&&n.delay(function(){t.find(".rl-cache-purge").remove()},300)))},i.prototype.populateDataOnStart=function(){v.prototype.populateDataOnStart.call(this),this.accountEmail(m.settingsGet("Email")),this.accountIncLogin(m.settingsGet("IncLogin")),this.accountOutLogin(m.settingsGet("OutLogin")),this.projectHash(m.settingsGet("ProjectHash")),this.defaultIdentityID(m.settingsGet("DefaultIdentityID")),this.displayName(m.settingsGet("DisplayName")),this.replyTo(m.settingsGet("ReplyTo")),this.signature(m.settingsGet("Signature")),this.signatureToAll(!!m.settingsGet("SignatureToAll")),this.enableTwoFactor(!!m.settingsGet("EnableTwoFactor")),this.lastFoldersHash=y.get(d.ClientSideKeyName.FoldersLashHash)||"",this.remoteSuggestions=!!m.settingsGet("RemoteSuggestions"),this.devEmail=m.settingsGet("DevEmail"),this.devPassword=m.settingsGet("DevPassword")},i.prototype.initUidNextAndNewMessages=function(e,t,i){if("INBOX"===e&&h.isNormal(t)&&""!==t){if(h.isArray(i)&&0<i.length){var o=this,a=0,r=i.length,l=function(e,t,i){var n=null;c&&o.useDesktopNotifications()&&(n=new c(t,{body:i,icon:e}),n&&(n.show&&n.show(),s.setTimeout(function(e){return function(){e.cancel?e.cancel():e.close&&e.close()}}(n),7e3)))};if(n.each(i,function(t){f.addNewMessageCache(e,t.Uid)}),r>3)l(g.notificationMailIcon(),this.accountEmail(),h.i18n("MESSAGE_LIST/NEW_MESSAGE_NOTIFICATION",{COUNT:r}));else for(;r>a;a++)l(g.notificationMailIcon(),S.emailsToLine(S.initEmailsFromJson(i[a].From),!1),i[a].Subject)}f.setFolderUidNext(e,t)}},i.prototype.hideMessageBodies=function(){var e=this.messagesBodiesDom();e&&e.find(".b-text-part").hide()},i.prototype.getNextFolderNames=function(e){e=h.isUnd(e)?!1:!!e;var t=[],i=10,s=r().unix(),o=s-300,a=[],l=function(t){n.each(t,function(t){t&&"INBOX"!==t.fullNameRaw&&t.selectable&&t.existen&&o>t.interval&&(!e||t.subScribed())&&a.push([t.interval,t.fullNameRaw]),t&&0<t.subFolders().length&&l(t.subFolders())})};return l(this.folderList()),a.sort(function(e,t){return e[0]<t[0]?-1:e[0]>t[0]?1:0}),n.find(a,function(e){var o=f.getFolderFromCacheList(e[1]);return o&&(o.interval=s,t.push(e[1])),i<=t.length}),n.uniq(t)},i.prototype.removeMessagesFromList=function(e,t,i,s){i=h.isNormal(i)?i:"",s=h.isUnd(s)?!1:!!s,t=n.map(t,function(e){return h.pInt(e)});var o=this,a=0,r=this.messageList(),l=f.getFolderFromCacheList(e),c=""===i?null:f.getFolderFromCacheList(i||""),u=this.currentFolderFullNameRaw(),d=this.message(),p=u===e?n.filter(r,function(e){return e&&-1<h.inArray(h.pInt(e.uid),t)}):[];n.each(p,function(e){e&&e.unseen()&&a++}),l&&!s&&(l.messageCountAll(0<=l.messageCountAll()-t.length?l.messageCountAll()-t.length:0),a>0&&l.messageCountUnread(0<=l.messageCountUnread()-a?l.messageCountUnread()-a:0)),c&&(c.messageCountAll(c.messageCountAll()+t.length),a>0&&c.messageCountUnread(c.messageCountUnread()+a),c.actionBlink(!0)),0<p.length&&(s?n.each(p,function(e){e.checked(!1)}):(this.messageListIsNotCompleted(!0),n.each(p,function(e){d&&d.hash===e.hash&&(d=null,o.message(null)),e.deleted(!0)}),n.delay(function(){n.each(p,function(e){o.messageList.remove(e)})},400))),""!==e&&f.setFolderHash(e,""),""!==i&&f.setFolderHash(i,"")},i.prototype.setMessage=function(e,t){var i=!1,s=!1,n=!1,a=null,r=null,c="",u="",g=!1,m=!1,b=this.messagesBodiesDom(),S=this.message();e&&S&&e.Result&&"Object/Message"===e.Result["@Object"]&&S.folderFullNameRaw===e.Result.Folder&&S.uid===e.Result.Uid&&(this.messageError(""),S.initUpdateByMessageJson(e.Result),f.addRequestedMessage(S.folderFullNameRaw,S.uid),t||S.initFlagsByJson(e.Result),b=b&&b[0]?b:null,b&&(c="rl-mgs-"+S.hash.replace(/[^a-zA-Z0-9]/g,""),r=b.find("#"+c),r&&r[0]?(S.body=r,S.body&&(S.body.data("rl-cache-count",++p.iMessageBodyCacheCount),S.fetchDataToDom())):(s=!!e.Result.HasExternals,n=!!e.Result.HasInternals,a=o('<div id="'+c+'" />').hide().addClass("rl-cache-class"),a.data("rl-cache-count",++p.iMessageBodyCacheCount),h.isNormal(e.Result.Html)&&""!==e.Result.Html?(i=!0,u=e.Result.Html.toString()):h.isNormal(e.Result.Plain)&&""!==e.Result.Plain?(i=!1,u=h.plainToHtml(e.Result.Plain.toString(),!1),(S.isPgpSigned()||S.isPgpEncrypted())&&this.capaOpenPGP()&&(S.plainRaw=h.pString(e.Result.Plain),m=/---BEGIN PGP MESSAGE---/.test(S.plainRaw),m||(g=/-----BEGIN PGP SIGNED MESSAGE-----/.test(S.plainRaw)&&/-----BEGIN PGP SIGNATURE-----/.test(S.plainRaw)),l.empty(),g&&S.isPgpSigned()?u=l.append(o('<pre class="b-plain-openpgp signed"></pre>').text(S.plainRaw)).html():m&&S.isPgpEncrypted()&&(u=l.append(o('<pre class="b-plain-openpgp encrypted"></pre>').text(S.plainRaw)).html()),l.empty(),S.isPgpSigned(g),S.isPgpEncrypted(m))):i=!1,a.html(h.linkify(u)).addClass("b-text-part "+(i?"html":"plain")),S.isHtml(!!i),S.hasImages(!!s),S.pgpSignedVerifyStatus(d.SignedVerifyStatus.None),S.pgpSignedVerifyUser(""),S.body=a,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(),a&&h.initBlockquoteSwitcher(a)),f.initMessageFlagsFromCache(S),S.unseen()&&p.__APP&&p.__APP.setMessageSeen(S),h.windowResize())
},i.prototype.calculateMessageListHash=function(e){return n.map(e,function(e){return""+e.hash+"_"+e.threadsLen()+"_"+e.flagHash()}).join("|")},i.prototype.findPublicKeyByHex=function(e){return n.find(this.openpgpkeysPublic(),function(t){return t&&e===t.id})},i.prototype.findPublicKeysByEmail=function(e){return n.compact(n.map(this.openpgpkeysPublic(),function(t){var i=null;if(t&&e===t.email)try{if(i=s.openpgp.key.readArmored(t.armor),i&&!i.err&&i.keys&&i.keys[0])return i.keys[0]}catch(o){}return null}))},i.prototype.findPrivateKeyByEmail=function(e,t){var i=null,o=n.find(this.openpgpkeysPrivate(),function(t){return t&&e===t.email});if(o)try{i=s.openpgp.key.readArmored(o.armor),i&&!i.err&&i.keys&&i.keys[0]?(i=i.keys[0],i.decrypt(h.pString(t))):i=null}catch(a){i=null}return i},i.prototype.findSelfPrivateKey=function(e){return this.findPrivateKeyByEmail(this.accountEmail(),e)},e.exports=new i}(t,e)},{$:26,$div:15,"App:Knoin":33,Consts:6,Enums:7,Globals:9,LinkBuilder:11,"Model:Message":48,NotificationClass:22,"Storage:Abstract:Data":67,"Storage:LocalStorage":71,"Storage:RainLoop:Cache":69,"Storage:Settings":75,Utils:14,_:31,ko:28,moment:29,window:32}],71:[function(e,t){!function(e,t){"use strict";function i(){var e=t("_"),i=e.find([t("Storage:LocalStorage:Cookie"),t("Storage:LocalStorage:LocalStorage")],function(e){return e.supported()});this.oDriver=null,i&&(this.oDriver=new i)}i.prototype.oDriver=null,i.prototype.set=function(e,t){return this.oDriver?this.oDriver.set("p"+e,t):!1},i.prototype.get=function(e){return this.oDriver?this.oDriver.get("p"+e):null},e.exports=new i}(t,e)},{"Storage:LocalStorage:Cookie":72,"Storage:LocalStorage:LocalStorage":73,_:31}],72:[function(e,t){!function(e,t){"use strict";function i(){}var s=t("$"),o=t("JSON"),n=t("Consts"),a=t("Utils");i.supported=function(){return!0},i.prototype.set=function(e,t){var i=s.cookie(n.Values.ClientSideCookieIndexName),a=!1,r=null;try{r=null===i?null:o.parse(i),r||(r={}),r[e]=t,s.cookie(n.Values.ClientSideCookieIndexName,o.stringify(r),{expires:30}),a=!0}catch(l){}return a},i.prototype.get=function(e){var t=s.cookie(n.Values.ClientSideCookieIndexName),i=null;try{i=null===t?null:o.parse(t),i=i&&!a.isUnd(i[e])?i[e]:null}catch(r){}return i},e.exports=i}(t,e)},{$:26,Consts:6,JSON:20,Utils:14}],73:[function(e,t){!function(e,t){"use strict";function i(){}var s=t("window"),o=t("JSON"),n=t("Consts"),a=t("Utils");i.supported=function(){return!!s.localStorage},i.prototype.set=function(e,t){var i=s.localStorage[n.Values.ClientSideCookieIndexName]||null,a=!1,r=null;try{r=null===i?null:o.parse(i),r||(r={}),r[e]=t,s.localStorage[n.Values.ClientSideCookieIndexName]=o.stringify(r),a=!0}catch(l){}return a},i.prototype.get=function(e){var t=s.localStorage[n.Values.ClientSideCookieIndexName]||null,i=null;try{i=null===t?null:o.parse(t),i=i&&!a.isUnd(i[e])?i[e]:null}catch(r){}return i},e.exports=i}(t,e)},{Consts:6,JSON:20,Utils:14,window:32}],74:[function(e,t){!function(e,t){"use strict";function i(){d.call(this),this.oRequests={}}var s=t("_"),o=t("Utils"),n=t("Consts"),a=t("Globals"),r=t("Base64"),l=t("Storage:Settings"),c=t("Storage:RainLoop:Cache"),u=t("Storage:RainLoop:Data"),d=t("Storage:Abstract:Remote");s.extend(i.prototype,d.prototype),i.prototype.folders=function(e){this.defaultRequest(e,"Folders",{SentFolder:l.settingsGet("SentFolder"),DraftFolder:l.settingsGet("DraftFolder"),SpamFolder:l.settingsGet("SpamFolder"),TrashFolder:l.settingsGet("TrashFolder"),ArchiveFolder:l.settingsGet("ArchiveFolder")},null,"",["Folders"])},i.prototype.login=function(e,t,i,s,o,n,a,r){this.defaultRequest(e,"Login",{Email:t,Login:i,Password:s,Language:n||"",AdditionalCode:a||"",AdditionalCodeSignMe:r?"1":"0",SignMe:o?"1":"0"})},i.prototype.getTwoFactor=function(e){this.defaultRequest(e,"GetTwoFactorInfo")},i.prototype.createTwoFactor=function(e){this.defaultRequest(e,"CreateTwoFactorSecret")},i.prototype.clearTwoFactor=function(e){this.defaultRequest(e,"ClearTwoFactorInfo")},i.prototype.showTwoFactorSecret=function(e){this.defaultRequest(e,"ShowTwoFactorSecret")},i.prototype.testTwoFactor=function(e,t){this.defaultRequest(e,"TestTwoFactorInfo",{Code:t})},i.prototype.enableTwoFactor=function(e,t){this.defaultRequest(e,"EnableTwoFactor",{Enable:t?"1":"0"})},i.prototype.clearTwoFactorInfo=function(e){this.defaultRequest(e,"ClearTwoFactorInfo")},i.prototype.contactsSync=function(e){this.defaultRequest(e,"ContactsSync",null,n.Defaults.ContactsSyncAjaxTimeout)},i.prototype.saveContactsSyncData=function(e,t,i,s,o){this.defaultRequest(e,"SaveContactsSyncData",{Enable:t?"1":"0",Url:i,User:s,Password:o})},i.prototype.accountAdd=function(e,t,i,s){this.defaultRequest(e,"AccountAdd",{Email:t,Login:i,Password:s})},i.prototype.accountDelete=function(e,t){this.defaultRequest(e,"AccountDelete",{EmailToDelete:t})},i.prototype.identityUpdate=function(e,t,i,s,o,n){this.defaultRequest(e,"IdentityUpdate",{Id:t,Email:i,Name:s,ReplyTo:o,Bcc:n})},i.prototype.identityDelete=function(e,t){this.defaultRequest(e,"IdentityDelete",{IdToDelete:t})},i.prototype.accountsAndIdentities=function(e){this.defaultRequest(e,"AccountsAndIdentities")},i.prototype.messageList=function(e,t,i,s,a,l){t=o.pString(t);var d=c.getFolderHash(t);l=o.isUnd(l)?!1:!!l,i=o.isUnd(i)?0:o.pInt(i),s=o.isUnd(i)?20:o.pInt(s),a=o.pString(a),""===d||""!==a&&-1!==a.indexOf("is:")?this.defaultRequest(e,"MessageList",{Folder:t,Offset:i,Limit:s,Search:a,UidNext:"INBOX"===t?c.getFolderUidNext(t):"",UseThreads:u.threading()&&u.useThreads()?"1":"0",ExpandedThreadUid:u.threading()&&t===u.messageListThreadFolder()?u.messageListThreadUids().join(","):""},""===a?n.Defaults.DefaultAjaxTimeout:n.Defaults.SearchAjaxTimeout,"",l?[]:["MessageList"]):this.defaultRequest(e,"MessageList",{},""===a?n.Defaults.DefaultAjaxTimeout:n.Defaults.SearchAjaxTimeout,"MessageList/"+r.urlsafe_encode([t,i,s,a,u.projectHash(),d,"INBOX"===t?c.getFolderUidNext(t):"",u.threading()&&u.useThreads()?"1":"0",u.threading()&&t===u.messageListThreadFolder()?u.messageListThreadUids().join(","):""].join(String.fromCharCode(0))),l?[]:["MessageList"])},i.prototype.messageUploadAttachments=function(e,t){this.defaultRequest(e,"MessageUploadAttachments",{Attachments:t},999e3)},i.prototype.message=function(e,t,i){return t=o.pString(t),i=o.pInt(i),c.getFolderFromCacheList(t)&&i>0?(this.defaultRequest(e,"Message",{},null,"Message/"+r.urlsafe_encode([t,i,u.projectHash(),u.threading()&&u.useThreads()?"1":"0"].join(String.fromCharCode(0))),["Message"]),!0):!1},i.prototype.composeUploadExternals=function(e,t){this.defaultRequest(e,"ComposeUploadExternals",{Externals:t},999e3)},i.prototype.composeUploadDrive=function(e,t,i){this.defaultRequest(e,"ComposeUploadDrive",{AccessToken:i,Url:t},999e3)},i.prototype.folderInformation=function(e,t,i){var n=!0,r=[];o.isArray(i)&&0<i.length&&(n=!1,s.each(i,function(e){c.getMessageFlagsFromCache(e.folderFullNameRaw,e.uid)||r.push(e.uid),0<e.threads().length&&s.each(e.threads(),function(t){c.getMessageFlagsFromCache(e.folderFullNameRaw,t)||r.push(t)})}),0<r.length&&(n=!0)),n?this.defaultRequest(e,"FolderInformation",{Folder:t,FlagsUids:o.isArray(r)?r.join(","):"",UidNext:"INBOX"===t?c.getFolderUidNext(t):""}):u.useThreads()&&a.__APP&&a.__APP.reloadFlagsCurrentMessageListAndMessageFromCache()},i.prototype.folderInformationMultiply=function(e,t){this.defaultRequest(e,"FolderInformationMultiply",{Folders:t})},i.prototype.logout=function(e){this.defaultRequest(e,"Logout")},i.prototype.messageSetFlagged=function(e,t,i,s){this.defaultRequest(e,"MessageSetFlagged",{Folder:t,Uids:i.join(","),SetAction:s?"1":"0"})},i.prototype.messageSetSeen=function(e,t,i,s){this.defaultRequest(e,"MessageSetSeen",{Folder:t,Uids:i.join(","),SetAction:s?"1":"0"})},i.prototype.messageSetSeenToAll=function(e,t,i){this.defaultRequest(e,"MessageSetSeenToAll",{Folder:t,SetAction:i?"1":"0"})},i.prototype.saveMessage=function(e,t,i,s,o,a,r,l,c,u,d,p,h,g,m){this.defaultRequest(e,"SaveMessage",{MessageFolder:t,MessageUid:i,DraftFolder:s,From:o,To:a,Cc:r,Bcc:l,Subject:c,TextIsHtml:u?"1":"0",Text:d,DraftInfo:h,InReplyTo:g,References:m,Attachments:p},n.Defaults.SaveMessageAjaxTimeout)},i.prototype.sendReadReceiptMessage=function(e,t,i,s,o,n){this.defaultRequest(e,"SendReadReceiptMessage",{MessageFolder:t,MessageUid:i,ReadReceipt:s,Subject:o,Text:n})},i.prototype.sendMessage=function(e,t,i,s,o,a,r,l,c,u,d,p,h,g,m,f){this.defaultRequest(e,"SendMessage",{MessageFolder:t,MessageUid:i,SentFolder:s,From:o,To:a,Cc:r,Bcc:l,Subject:c,TextIsHtml:u?"1":"0",Text:d,DraftInfo:h,InReplyTo:g,References:m,ReadReceiptRequest:f?"1":"0",Attachments:p},n.Defaults.SendMessageAjaxTimeout)},i.prototype.saveSystemFolders=function(e,t){this.defaultRequest(e,"SystemFoldersUpdate",t)},i.prototype.saveSettings=function(e,t){this.defaultRequest(e,"SettingsUpdate",t)},i.prototype.changePassword=function(e,t,i){this.defaultRequest(e,"ChangePassword",{PrevPassword:t,NewPassword:i})},i.prototype.folderCreate=function(e,t,i){this.defaultRequest(e,"FolderCreate",{Folder:t,Parent:i},null,"",["Folders"])},i.prototype.folderDelete=function(e,t){this.defaultRequest(e,"FolderDelete",{Folder:t},null,"",["Folders"])},i.prototype.folderRename=function(e,t,i){this.defaultRequest(e,"FolderRename",{Folder:t,NewFolderName:i},null,"",["Folders"])},i.prototype.folderClear=function(e,t){this.defaultRequest(e,"FolderClear",{Folder:t})},i.prototype.folderSetSubscribe=function(e,t,i){this.defaultRequest(e,"FolderSubscribe",{Folder:t,Subscribe:i?"1":"0"})},i.prototype.messagesMove=function(e,t,i,s,o){this.defaultRequest(e,"MessageMove",{FromFolder:t,ToFolder:i,Uids:s.join(","),Learning:o||""},null,"",["MessageList"])},i.prototype.messagesCopy=function(e,t,i,s){this.defaultRequest(e,"MessageCopy",{FromFolder:t,ToFolder:i,Uids:s.join(",")})},i.prototype.messagesDelete=function(e,t,i){this.defaultRequest(e,"MessageDelete",{Folder:t,Uids:i.join(",")},null,"",["MessageList"])},i.prototype.appDelayStart=function(e){this.defaultRequest(e,"AppDelayStart")},i.prototype.quota=function(e){this.defaultRequest(e,"Quota")},i.prototype.contacts=function(e,t,i,s){this.defaultRequest(e,"Contacts",{Offset:t,Limit:i,Search:s},null,"",["Contacts"])},i.prototype.contactSave=function(e,t,i,s,n){this.defaultRequest(e,"ContactSave",{RequestUid:t,Uid:o.trim(i),Tags:o.trim(s),Properties:n})},i.prototype.contactsDelete=function(e,t){this.defaultRequest(e,"ContactsDelete",{Uids:t.join(",")})},i.prototype.suggestions=function(e,t,i){this.defaultRequest(e,"Suggestions",{Query:t,Page:i},null,"",["Suggestions"])},i.prototype.facebookUser=function(e){this.defaultRequest(e,"SocialFacebookUserInformation")},i.prototype.facebookDisconnect=function(e){this.defaultRequest(e,"SocialFacebookDisconnect")},i.prototype.twitterUser=function(e){this.defaultRequest(e,"SocialTwitterUserInformation")},i.prototype.twitterDisconnect=function(e){this.defaultRequest(e,"SocialTwitterDisconnect")},i.prototype.googleUser=function(e){this.defaultRequest(e,"SocialGoogleUserInformation")},i.prototype.googleDisconnect=function(e){this.defaultRequest(e,"SocialGoogleDisconnect")},i.prototype.socialUsers=function(e){this.defaultRequest(e,"SocialUsers")},e.exports=new i}(t,e)},{Base64:5,Consts:6,Globals:9,"Storage:Abstract:Remote":68,"Storage:RainLoop:Cache":69,"Storage:RainLoop:Data":70,"Storage:Settings":75,Utils:14,_:31}],75:[function(e,t){!function(e,t){"use strict";function i(){this.oSettings=t("AppData"),this.oSettings=s.isNormal(this.oSettings)?this.oSettings:{}}var s=t("Utils");i.prototype.oSettings=null,i.prototype.settingsGet=function(e){return s.isUnd(this.oSettings[e])?null:this.oSettings[e]},i.prototype.settingsSet=function(e,t){this.oSettings[e]=t},i.prototype.capa=function(e){var t=this.settingsGet("Capa");return s.isArray(t)&&s.isNormal(e)&&-1<s.inArray(e,t)},e.exports=new i}(t,e)},{AppData:19,Utils:14}],76:[function(e,t){!function(e,t){"use strict";function i(){a.call(this,"Center","About"),this.version=s.observable(n.settingsGet("Version")),o.constructorEnd(this)}var s=t("ko"),o=t("App:Knoin"),n=t("Storage:Settings"),a=t("Knoin:AbstractViewModel");o.extendAsViewModel("AboutViewModel",i),e.exports=i}(t,e)},{"App:Knoin":33,"Knoin:AbstractViewModel":36,"Storage:Settings":75,ko:28}],77:[function(e,t){!function(e,t){"use strict";function i(){h.call(this,"Right","SystemDropDown"),this.accounts=d.accounts,this.accountEmail=d.accountEmail,this.accountsLoading=d.accountsLoading,this.accountMenuDropdownTrigger=o.observable(!1),this.capaAdditionalAccounts=u.capa(r.Capa.AdditionalAccounts),this.loading=o.computed(function(){return this.accountsLoading()},this),this.accountClick=s.bind(this.accountClick,this)}var s=t("_"),o=t("ko"),n=t("window"),a=t("key"),r=t("Enums"),l=t("Utils"),c=t("LinkBuilder"),u=t("Storage:Settings"),d=t("Storage:RainLoop:Data"),p=t("Storage:RainLoop:Remote"),h=t("Knoin:AbstractViewModel");s.extend(i.prototype,h.prototype),i.prototype.accountClick=function(e,t){if(e&&t&&!l.isUnd(t.which)&&1===t.which){var i=this;this.accountsLoading(!0),s.delay(function(){i.accountsLoading(!1)},1e3)}return!0},i.prototype.emailTitle=function(){return d.accountEmail()},i.prototype.settingsClick=function(){t("App:Knoin").setHash(c.settings())},i.prototype.settingsHelp=function(){t("App:Knoin").showScreenPopup(t("View:Popup:KeyboardShortcutsHelp"))},i.prototype.addAccountClick=function(){this.capaAdditionalAccounts&&t("App:Knoin").showScreenPopup(t("View:Popup:AddAccount"))},i.prototype.logoutClick=function(){p.logout(function(){n.__rlah_clear&&n.__rlah_clear(),t("App:RainLoop").loginAndLogoutReload(!0,u.settingsGet("ParentEmail")&&0<u.settingsGet("ParentEmail").length)})},i.prototype.onBuild=function(){var e=this;a("`",[r.KeyState.MessageList,r.KeyState.MessageView,r.KeyState.Settings],function(){e.viewModelVisibility()&&e.accountMenuDropdownTrigger(!0)}),a("shift+/",[r.KeyState.MessageList,r.KeyState.MessageView,r.KeyState.Settings],function(){return e.viewModelVisibility()?(t("App:Knoin").showScreenPopup(t("View:Popup:KeyboardShortcutsHelp")),!1):void 0})},e.exports=i}(t,e)},{"App:Knoin":33,"App:RainLoop":3,Enums:7,"Knoin:AbstractViewModel":36,LinkBuilder:11,"Storage:RainLoop:Data":70,"Storage:RainLoop:Remote":74,"Storage:Settings":75,Utils:14,"View:Popup:AddAccount":83,"View:Popup:KeyboardShortcutsHelp":95,_:31,key:27,ko:28,window:32}],78:[function(e,t){!function(e,t){"use strict";function i(){g.call(this,"Center","Login"),this.email=a.observable(""),this.password=a.observable(""),this.signMe=a.observable(!1),this.additionalCode=a.observable(""),this.additionalCode.error=a.observable(!1),this.additionalCode.focused=a.observable(!1),this.additionalCode.visibility=a.observable(!1),this.additionalCodeSignMe=a.observable(!1),this.logoImg=r.trim(u.settingsGet("LoginLogo")),this.loginDescription=r.trim(u.settingsGet("LoginDescription")),this.logoCss=r.trim(u.settingsGet("LoginCss")),this.emailError=a.observable(!1),this.passwordError=a.observable(!1),this.emailFocus=a.observable(!1),this.submitFocus=a.observable(!1),this.email.subscribe(function(){this.emailError(!1),this.additionalCode(""),this.additionalCode.visibility(!1)},this),this.password.subscribe(function(){this.passwordError(!1)},this),this.additionalCode.subscribe(function(){this.additionalCode.error(!1)},this),this.additionalCode.visibility.subscribe(function(){this.additionalCode.error(!1)},this),this.submitRequest=a.observable(!1),this.submitError=a.observable(""),this.allowLanguagesOnLogin=d.allowLanguagesOnLogin,this.langRequest=a.observable(!1),this.mainLanguage=d.mainLanguage,this.bSendLanguage=!1,this.mainLanguageFullName=a.computed(function(){return r.convertLangName(this.mainLanguage())},this),this.signMeType=a.observable(l.LoginSignMeType.Unused),this.signMeType.subscribe(function(e){this.signMe(l.LoginSignMeType.DefaultOn===e)},this),this.signMeVisibility=a.computed(function(){return l.LoginSignMeType.Unused!==this.signMeType()},this),this.submitCommand=r.createCommand(this,function(){if(r.triggerAutocompleteInputChange(),this.emailError(""===r.trim(this.email())),this.passwordError(""===r.trim(this.password())),this.additionalCode.visibility()&&this.additionalCode.error(""===r.trim(this.additionalCode())),this.emailError()||this.passwordError()||this.additionalCode.error())return!1;this.submitRequest(!0);var e=this.password(),i=n.bind(function(e){p.login(n.bind(function(e,i){l.StorageResultType.Success===e&&i&&"Login"===i.Action?i.Result?i.TwoFactorAuth?(this.additionalCode(""),this.additionalCode.visibility(!0),this.additionalCode.focused(!0),this.submitRequest(!1)):t("App:RainLoop").loginAndLogoutReload():i.ErrorCode?(this.submitRequest(!1),this.submitError(r.getNotification(i.ErrorCode)),""===this.submitError()&&this.submitError(r.getNotification(l.Notification.UnknownError))):this.submitRequest(!1):(this.submitRequest(!1),this.submitError(r.getNotification(l.Notification.UnknownError)))},this),this.email(),"",e,!!this.signMe(),this.bSendLanguage?this.mainLanguage():"",this.additionalCode.visibility()?this.additionalCode():"",this.additionalCode.visibility()?!!this.additionalCodeSignMe():!1)},this);return u.settingsGet("UseRsaEncryption")&&r.rsaEncode.supported?p.getPublicKey(n.bind(function(t,s){var o=!1;if(l.StorageResultType.Success===t&&s&&s.Result&&r.isArray(s.Result)&&s.Result[0]&&s.Result[1]&&s.Result[2]){var n=r.rsaEncode(e,s.Result[0],s.Result[1],s.Result[2]);n&&(i(n),o=!0)}o||(this.submitRequest(!1),this.submitError(r.getNotification(l.Notification.UnknownError)))},this)):i(e),!0},function(){return!this.submitRequest()}),this.facebookLoginEnabled=a.observable(!1),this.facebookCommand=r.createCommand(this,function(){return s.open(c.socialFacebook(),"Facebook","left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes"),!0},function(){return!this.submitRequest()&&this.facebookLoginEnabled()}),this.googleLoginEnabled=a.observable(!1),this.googleCommand=r.createCommand(this,function(){return s.open(c.socialGoogle(),"Google","left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes"),!0},function(){return!this.submitRequest()&&this.googleLoginEnabled()}),this.twitterLoginEnabled=a.observable(!1),this.twitterCommand=r.createCommand(this,function(){return s.open(c.socialTwitter(),"Twitter","left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes"),!0},function(){return!this.submitRequest()&&this.twitterLoginEnabled()}),this.socialLoginEnabled=a.computed(function(){var e=this.facebookLoginEnabled(),t=this.googleLoginEnabled(),i=this.twitterLoginEnabled();return e||t||i},this),h.constructorEnd(this)}var s=t("window"),o=t("$"),n=t("_"),a=t("ko"),r=t("Utils"),l=t("Enums"),c=t("LinkBuilder"),u=t("Storage:Settings"),d=t("Storage:RainLoop:Data"),p=t("Storage:RainLoop:Remote"),h=t("App:Knoin"),g=t("Knoin:AbstractViewModel");h.extendAsViewModel("LoginViewModel",i),i.prototype.onShow=function(){h.routeOff(),n.delay(n.bind(function(){""!==this.email()&&""!==this.password()?this.submitFocus(!0):this.emailFocus(!0),u.settingsGet("UserLanguage")&&o.cookie("rllang",d.language(),{expires:30})},this),100)},i.prototype.onHide=function(){this.submitFocus(!1),this.emailFocus(!1)},i.prototype.onBuild=function(){var e=this,i=u.settingsGet("JsHash"),a=function(i){i=r.pInt(i),0===i?(e.submitRequest(!0),t("App:RainLoop").loginAndLogoutReload()):e.submitError(r.getNotification(i))};switch(this.facebookLoginEnabled(!!u.settingsGet("AllowFacebookSocial")),this.twitterLoginEnabled(!!u.settingsGet("AllowTwitterSocial")),this.googleLoginEnabled(!!u.settingsGet("AllowGoogleSocial")),(u.settingsGet("SignMe")||"unused").toLowerCase()){case l.LoginSignMeTypeAsString.DefaultOff:this.signMeType(l.LoginSignMeType.DefaultOff);break;case l.LoginSignMeTypeAsString.DefaultOn:this.signMeType(l.LoginSignMeType.DefaultOn);break;default:case l.LoginSignMeTypeAsString.Unused:this.signMeType(l.LoginSignMeType.Unused)}this.email(d.devEmail),this.password(d.devPassword),this.googleLoginEnabled()&&(s["rl_"+i+"_google_login_service"]=a),this.facebookLoginEnabled()&&(s["rl_"+i+"_facebook_login_service"]=a),this.twitterLoginEnabled()&&(s["rl_"+i+"_twitter_login_service"]=a),n.delay(function(){d.language.subscribe(function(t){e.langRequest(!0),o.ajax({url:c.langLink(t),dataType:"script",cache:!0}).done(function(){e.bSendLanguage=!0,r.i18nReload(),o.cookie("rllang",d.language(),{expires:30})}).always(function(){e.langRequest(!1)})})},50),r.triggerAutocompleteInputChange(!0)},i.prototype.submitForm=function(){this.submitCommand()},i.prototype.selectLanguage=function(){h.showScreenPopup(t("View:Popup:Languages"))},e.exports=i}(t,e)},{$:26,"App:Knoin":33,"App:RainLoop":3,Enums:7,"Knoin:AbstractViewModel":36,LinkBuilder:11,"Storage:RainLoop:Data":70,"Storage:RainLoop:Remote":74,"Storage:Settings":75,Utils:14,"View:Popup:Languages":96,_:31,ko:28,window:32}],79:[function(e,t){!function(e,t){"use strict";function i(){f.call(this,"Left","MailFolderList"),this.oContentVisible=null,this.oContentScrollable=null,this.messageList=g.messageList,this.folderList=g.folderList,this.folderListSystem=g.folderListSystem,this.foldersChanging=g.foldersChanging,this.leftPanelDisabled=u.leftPanelDisabled,this.iDropOverTimer=0,this.allowContacts=!!p.settingsGet("ContactsIsAllowed"),m.constructorEnd(this)}var s=t("window"),o=t("$"),n=t("ko"),a=t("key"),r=t("$html"),l=t("Utils"),c=t("Enums"),u=t("Globals"),d=t("LinkBuilder"),p=t("Storage:Settings"),h=t("Storage:RainLoop:Cache"),g=t("Storage:RainLoop:Data"),m=t("App:Knoin"),f=t("Knoin:AbstractViewModel");m.extendAsViewModel("MailBoxFolderListViewModel",i),i.prototype.onBuild=function(e){this.oContentVisible=o(".b-content",e),this.oContentScrollable=o(".content",this.oContentVisible);var i=this;e.on("click",".b-folders .e-item .e-link .e-collapsed-sign",function(e){var i=n.dataFor(this),s=!1;i&&e&&(s=i.collapsed(),t("App:RainLoop").setExpandedFolder(i.fullNameHash,s),i.collapsed(!s),e.preventDefault(),e.stopPropagation())}).on("click",".b-folders .e-item .e-link.selectable",function(e){e.preventDefault();var t=n.dataFor(this);t&&(c.Layout.NoPreview===g.layout()&&g.message(null),t.fullNameRaw===g.currentFolderFullNameRaw()&&h.setFolderHash(t.fullNameRaw,""),m.setHash(d.mailBox(t.fullNameHash)))}),a("up, down",c.KeyState.FolderList,function(t,s){var n=-1,a=s&&"up"===s.shortcut?38:40,r=o(".b-folders .e-item .e-link:not(.hidden):visible",e);return t&&r.length&&(n=r.index(r.filter(".focused")),n>-1&&r.eq(n).removeClass("focused"),38===a&&n>0?n--:40===a&&n<r.length-1&&n++,r.eq(n).addClass("focused"),i.scrollToFocused()),!1}),a("enter",c.KeyState.FolderList,function(){var t=o(".b-folders .e-item .e-link:not(.hidden).focused",e);return t.length&&t[0]&&(i.folderList.focused(!1),t.click()),!1}),a("space",c.KeyState.FolderList,function(){var i=!0,s=null,a=o(".b-folders .e-item .e-link:not(.hidden).focused",e);return a.length&&a[0]&&(s=n.dataFor(a[0]),s&&(i=s.collapsed(),t("App:RainLoop").setExpandedFolder(s.fullNameHash,i),s.collapsed(!i))),!1}),a("esc, tab, shift+tab, right",c.KeyState.FolderList,function(){return i.folderList.focused(!1),!1}),i.folderList.focused.subscribe(function(t){o(".b-folders .e-item .e-link.focused",e).removeClass("focused"),t&&o(".b-folders .e-item .e-link.selected",e).addClass("focused")})},i.prototype.messagesDropOver=function(e){s.clearTimeout(this.iDropOverTimer),e&&e.collapsed()&&(this.iDropOverTimer=s.setTimeout(function(){e.collapsed(!1),t("App:RainLoop").setExpandedFolder(e.fullNameHash,!0),l.windowResize()},500))},i.prototype.messagesDropOut=function(){s.clearTimeout(this.iDropOverTimer)},i.prototype.scrollToFocused=function(){if(!this.oContentVisible||!this.oContentScrollable)return!1;var e=20,t=o(".e-item .e-link.focused",this.oContentScrollable),i=t.position(),s=this.oContentVisible.height(),n=t.outerHeight();return i&&(i.top<0||i.top+n>s)?(this.oContentScrollable.scrollTop(i.top<0?this.oContentScrollable.scrollTop()+i.top-e:this.oContentScrollable.scrollTop()+i.top-s+n+e),!0):!1},i.prototype.messagesDrop=function(e,i){if(e&&i&&i.helper){var s=i.helper.data("rl-folder"),o=r.hasClass("rl-ctrl-key-pressed"),n=i.helper.data("rl-uids");l.isNormal(s)&&""!==s&&l.isArray(n)&&t("App:RainLoop").moveMessagesToFolder(s,n,e.fullNameRaw,o)}},i.prototype.composeClick=function(){m.showScreenPopup(t("View:Popup:Compose"))},i.prototype.createFolder=function(){m.showScreenPopup(t("View:Popup:FolderCreate"))},i.prototype.configureFolders=function(){m.setHash(d.settings("folders"))},i.prototype.contactsClick=function(){this.allowContacts&&m.showScreenPopup(t("View:Popup:Contacts"))},e.exports=i}(t,e)},{$:26,$html:17,"App:Knoin":33,"App:RainLoop":3,Enums:7,Globals:9,"Knoin:AbstractViewModel":36,LinkBuilder:11,"Storage:RainLoop:Cache":69,"Storage:RainLoop:Data":70,"Storage:Settings":75,Utils:14,"View:Popup:Compose":88,"View:Popup:Contacts":89,"View:Popup:FolderCreate":92,key:27,ko:28,window:32}],80:[function(e,t){!function(e,t){"use strict";function i(){w.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 0<S.messageListChecked().length},write:function(e){e=!!e,o.each(S.messageList(),function(t){t.checked(e)})}}),this.inputMessageListSearchFocus=n.observable(!1),this.sLastSearchValue="",this.inputProxyMessageListSearch=n.computed({read:this.mainMessageListSearch,write:function(e){this.sLastSearchValue=e},owner:this}),this.isIncompleteChecked=n.computed(function(){var e=S.messageList().length,t=S.messageListChecked().length;return e>0&&t>0&&e>t},this),this.hasMessages=n.computed(function(){return 0<this.messageList().length},this),this.hasCheckedOrSelectedLines=n.computed(function(){return 0<this.messageListCheckedOrSelected().length},this),this.isSpamFolder=n.computed(function(){return S.spamFolder()===this.messageListEndFolder()&&""!==S.spamFolder()},this),this.isSpamDisabled=n.computed(function(){return u.Values.UnuseOptionValue===S.spamFolder()},this),this.isTrashFolder=n.computed(function(){return S.trashFolder()===this.messageListEndFolder()&&""!==S.trashFolder()},this),this.isDraftFolder=n.computed(function(){return S.draftFolder()===this.messageListEndFolder()&&""!==S.draftFolder()},this),this.isSentFolder=n.computed(function(){return S.sentFolder()===this.messageListEndFolder()&&""!==S.sentFolder()},this),this.isArchiveFolder=n.computed(function(){return S.archiveFolder()===this.messageListEndFolder()&&""!==S.archiveFolder()},this),this.isArchiveDisabled=n.computed(function(){return u.Values.UnuseOptionValue===S.archiveFolder()},this),this.canBeMoved=this.hasCheckedOrSelectedLines,this.clearCommand=p.createCommand(this,function(){v.showScreenPopup(t("View:Popup:FolderClear"),[S.currentFolder()])}),this.multyForwardCommand=p.createCommand(this,function(){v.showScreenPopup(t("View:Popup:Compose"),[c.ComposeType.ForwardAsAttachment,S.messageListCheckedOrSelected()])},this.canBeMoved),this.deleteWithoutMoveCommand=p.createCommand(this,function(){t("App:RainLoop").deleteMessagesFromFolder(c.FolderType.Trash,S.currentFolderFullNameRaw(),S.messageListCheckedOrSelectedUidsWithSubMails(),!1)},this.canBeMoved),this.deleteCommand=p.createCommand(this,function(){t("App:RainLoop").deleteMessagesFromFolder(c.FolderType.Trash,S.currentFolderFullNameRaw(),S.messageListCheckedOrSelectedUidsWithSubMails(),!0)},this.canBeMoved),this.archiveCommand=p.createCommand(this,function(){t("App:RainLoop").deleteMessagesFromFolder(c.FolderType.Archive,S.currentFolderFullNameRaw(),S.messageListCheckedOrSelectedUidsWithSubMails(),!0)},this.canBeMoved),this.spamCommand=p.createCommand(this,function(){t("App:RainLoop").deleteMessagesFromFolder(c.FolderType.Spam,S.currentFolderFullNameRaw(),S.messageListCheckedOrSelectedUidsWithSubMails(),!0)},this.canBeMoved),this.notSpamCommand=p.createCommand(this,function(){t("App:RainLoop").deleteMessagesFromFolder(c.FolderType.NotSpam,S.currentFolderFullNameRaw(),S.messageListCheckedOrSelectedUidsWithSubMails(),!0)},this.canBeMoved),this.moveCommand=p.createCommand(this,p.emptyFunction,this.canBeMoved),this.reloadCommand=p.createCommand(this,function(){S.messageListCompleteLoadingThrottle()||t("App:RainLoop").reloadMessageList(!1,!0)}),this.quotaTooltip=o.bind(this.quotaTooltip,this),this.selector=new m(this.messageList,this.currentMessage,".messageListItem .actionHandle",".messageListItem.selected",".messageListItem .checkboxMessage",".messageListItem.focused"),this.selector.on("onItemSelect",o.bind(function(e){e?(S.message(S.staticMessageList.populateByMessageListItem(e)),this.populateMessageBody(S.message()),c.Layout.NoPreview===S.layout()&&(v.setHash(h.messagePreview(),!0),S.message.focused(!0))):S.message(null)},this)),this.selector.on("onItemGetUid",function(e){return e?e.generateUid():""}),S.messageListEndHash.subscribe(function(){this.selector.scrollToTop()},this),S.layout.subscribe(function(e){this.selector.autoSelect(c.Layout.NoPreview!==e)},this),S.layout.valueHasMutated(),g.sub("mailbox.message-list.selector.go-down",function(){this.selector.goDown(!0)},this).sub("mailbox.message-list.selector.go-up",function(){this.selector.goUp(!0)},this),v.constructorEnd(this)}var s=t("$"),o=t("_"),n=t("ko"),a=t("key"),r=t("ifvisible"),l=t("Jua"),c=t("Enums"),u=t("Consts"),d=t("Globals"),p=t("Utils"),h=t("LinkBuilder"),g=t("Events"),m=t("Selector"),f=t("Storage:Settings"),b=t("Storage:RainLoop:Cache"),S=t("Storage:RainLoop:Data"),y=t("Storage:RainLoop:Remote"),v=t("App:Knoin"),w=t("Knoin:AbstractViewModel");v.extendAsViewModel("MailBoxMessageListViewModel",i),i.prototype.emptySubjectValue="",i.prototype.searchEnterAction=function(){this.mainMessageListSearch(this.sLastSearchValue),this.inputMessageListSearchFocus(!1)},i.prototype.printableMessageCountForDeletion=function(){var e=this.messageListCheckedOrSelectedUidsWithSubMails().length;return e>1?" ("+(100>e?e:"99+")+")":""},i.prototype.cancelSearch=function(){this.mainMessageListSearch(""),this.inputMessageListSearchFocus(!1)},i.prototype.moveSelectedMessagesToFolder=function(e,i){return this.canBeMoved()&&t("App:RainLoop").moveMessagesToFolder(S.currentFolderFullNameRaw(),S.messageListCheckedOrSelectedUidsWithSubMails(),e,i),!1},i.prototype.dragAndDronHelper=function(e){e&&e.checked(!0);var t=p.draggeblePlace(),i=S.messageListCheckedOrSelectedUidsWithSubMails();
return t.data("rl-folder",S.currentFolderFullNameRaw()),t.data("rl-uids",i),t.find(".text").text(""+i.length),o.defer(function(){var e=S.messageListCheckedOrSelectedUidsWithSubMails();t.data("rl-uids",e),t.find(".text").text(""+e.length)}),t},i.prototype.onMessageResponse=function(e,t,i){S.hideMessageBodies(),S.messageLoading(!1),c.StorageResultType.Success===e&&t&&t.Result?S.setMessage(t,i):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)))},i.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]"))},i.prototype.setAction=function(e,i,s){var n=[],a=null,r=0;if(p.isUnd(s)&&(s=S.messageListChecked()),n=o.map(s,function(e){return e.uid}),""!==e&&0<n.length){switch(i){case c.MessageSetAction.SetSeen:o.each(s,function(e){e.unseen()&&r++,e.unseen(!1),b.storeMessageFlagsToCache(e)}),a=b.getFolderFromCacheList(e),a&&a.messageCountUnread(a.messageCountUnread()-r),y.messageSetSeen(p.emptyFunction,e,n,!0);break;case c.MessageSetAction.UnsetSeen:o.each(s,function(e){e.unseen()&&r++,e.unseen(!0),b.storeMessageFlagsToCache(e)}),a=b.getFolderFromCacheList(e),a&&a.messageCountUnread(a.messageCountUnread()-r+n.length),y.messageSetSeen(p.emptyFunction,e,n,!1);break;case c.MessageSetAction.SetFlag:o.each(s,function(e){e.flagged(!0),b.storeMessageFlagsToCache(e)}),y.messageSetFlagged(p.emptyFunction,e,n,!0);break;case c.MessageSetAction.UnsetFlag:o.each(s,function(e){e.flagged(!1),b.storeMessageFlagsToCache(e)}),y.messageSetFlagged(p.emptyFunction,e,n,!1)}t("App:RainLoop").reloadFlagsCurrentMessageListAndMessageFromCache()}},i.prototype.setActionForAll=function(e,i){var s=null,n=S.messageList();if(""!==e&&(s=b.getFolderFromCacheList(e))){switch(i){case c.MessageSetAction.SetSeen:s=b.getFolderFromCacheList(e),s&&(o.each(n,function(e){e.unseen(!1)}),s.messageCountUnread(0),b.clearMessageFlagsFromCacheByFolder(e)),y.messageSetSeenToAll(p.emptyFunction,e,!0);break;case c.MessageSetAction.UnsetSeen:s=b.getFolderFromCacheList(e),s&&(o.each(n,function(e){e.unseen(!0)}),s.messageCountUnread(s.messageCountAll()),b.clearMessageFlagsFromCacheByFolder(e)),y.messageSetSeenToAll(p.emptyFunction,e,!1)}t("App:RainLoop").reloadFlagsCurrentMessageListAndMessageFromCache()}},i.prototype.listSetSeen=function(){this.setAction(S.currentFolderFullNameRaw(),c.MessageSetAction.SetSeen,S.messageListCheckedOrSelected())},i.prototype.listSetAllSeen=function(){this.setActionForAll(S.currentFolderFullNameRaw(),c.MessageSetAction.SetSeen)},i.prototype.listUnsetSeen=function(){this.setAction(S.currentFolderFullNameRaw(),c.MessageSetAction.UnsetSeen,S.messageListCheckedOrSelected())},i.prototype.listSetFlags=function(){this.setAction(S.currentFolderFullNameRaw(),c.MessageSetAction.SetFlag,S.messageListCheckedOrSelected())},i.prototype.listUnsetFlags=function(){this.setAction(S.currentFolderFullNameRaw(),c.MessageSetAction.UnsetFlag,S.messageListCheckedOrSelected())},i.prototype.flagMessages=function(e){var t=this.messageListCheckedOrSelected(),i=[];e&&(0<t.length&&(i=o.map(t,function(e){return e.uid})),0<i.length&&-1<p.inArray(e.uid,i)?this.setAction(e.folderFullNameRaw,e.flagged()?c.MessageSetAction.UnsetFlag:c.MessageSetAction.SetFlag,t):this.setAction(e.folderFullNameRaw,e.flagged()?c.MessageSetAction.UnsetFlag:c.MessageSetAction.SetFlag,[e]))},i.prototype.flagMessagesFast=function(e){var t=this.messageListCheckedOrSelected(),i=[];0<t.length&&(i=o.filter(t,function(e){return e.flagged()}),p.isUnd(e)?this.setAction(t[0].folderFullNameRaw,t.length===i.length?c.MessageSetAction.UnsetFlag:c.MessageSetAction.SetFlag,t):this.setAction(t[0].folderFullNameRaw,e?c.MessageSetAction.SetFlag:c.MessageSetAction.UnsetFlag,t))},i.prototype.seenMessagesFast=function(e){var t=this.messageListCheckedOrSelected(),i=[];0<t.length&&(i=o.filter(t,function(e){return e.unseen()}),p.isUnd(e)?this.setAction(t[0].folderFullNameRaw,0<i.length?c.MessageSetAction.SetSeen:c.MessageSetAction.UnsetSeen,t):this.setAction(t[0].folderFullNameRaw,e?c.MessageSetAction.SetSeen:c.MessageSetAction.UnsetSeen,t))},i.prototype.onBuild=function(e){var i=this;this.oContentVisible=s(".b-content",e),this.oContentScrollable=s(".content",this.oContentVisible),this.oContentVisible.on("click",".fullThreadHandle",function(){var e=[],i=n.dataFor(this);return i&&!i.lastInCollapsedThreadLoading()&&(S.messageListThreadFolder(i.folderFullNameRaw),e=S.messageListThreadUids(),i.lastInCollapsedThread()?e.push(0<i.parentUid()?i.parentUid():i.uid):e=o.without(e,0<i.parentUid()?i.parentUid():i.uid),S.messageListThreadUids(o.uniq(e)),i.lastInCollapsedThreadLoading(!0),i.lastInCollapsedThread(!i.lastInCollapsedThread()),t("App:RainLoop").reloadMessageList()),!1}),this.selector.init(this.oContentVisible,this.oContentScrollable,c.KeyState.MessageList),e.on("click",".messageList .b-message-list-wrapper",function(){i.message.focused()&&i.message.focused(!1)}).on("click",".e-pagenator .e-page",function(){var e=n.dataFor(this);e&&v.setHash(h.mailBox(S.currentFolderFullNameHash(),e.value,S.messageListSearch()))}).on("click",".messageList .checkboxCkeckAll",function(){i.checkAll(!i.checkAll())}).on("click",".messageList .messageListItem .flagParent",function(){i.flagMessages(n.dataFor(this))}),this.initUploaderForAppend(),this.initShortcuts(),!d.bMobileDevice&&f.capa(c.Capa.Prefetch)&&r&&(r.setIdleDuration(10),r.idle(function(){i.prefetchNextTick()}))},i.prototype.initShortcuts=function(){var e=this;a("ctrl+p, command+p",c.KeyState.MessageList,function(){return!1}),a("z",[c.KeyState.MessageList,c.KeyState.MessageView],function(){return e.archiveCommand(),!1}),a("delete, shift+delete, shift+3",c.KeyState.MessageList,function(t,i){return t?(0<S.messageListCheckedOrSelected().length&&(i&&"shift+delete"===i.shortcut?e.deleteWithoutMoveCommand():e.deleteCommand()),!1):void 0}),a("ctrl+r, command+r",[c.KeyState.FolderList,c.KeyState.MessageList,c.KeyState.MessageView],function(){return e.reloadCommand(),!1}),a("ctrl+a, command+a",c.KeyState.MessageList,function(){return e.checkAll(!(e.checkAll()&&!e.isIncompleteChecked())),!1}),a("w,c",[c.KeyState.MessageList,c.KeyState.MessageView],function(){return v.showScreenPopup(t("View:Popup:Compose")),!1}),a("i",[c.KeyState.MessageList,c.KeyState.MessageView],function(){return e.flagMessagesFast(),!1}),a("m",c.KeyState.MessageList,function(){return e.moveDropdownTrigger(!0),!1}),a("q",[c.KeyState.MessageList,c.KeyState.MessageView],function(){return e.seenMessagesFast(!0),!1}),a("u",[c.KeyState.MessageList,c.KeyState.MessageView],function(){return e.seenMessagesFast(!1),!1}),a("shift+f",[c.KeyState.MessageList,c.KeyState.MessageView],function(){return e.multyForwardCommand(),!1}),a("/",[c.KeyState.MessageList,c.KeyState.MessageView],function(){return e.inputMessageListSearchFocus(!0),!1}),a("esc",c.KeyState.MessageList,function(){return""!==e.messageListSearchDesc()?(e.cancelSearch(),!1):void 0}),a("tab, shift+tab, left, right",c.KeyState.MessageList,function(t,i){return t&&i&&"shift+tab"===i.shortcut||"left"===i.shortcut?e.folderList.focused(!0):e.message()&&e.message.focused(!0),!1}),a("ctrl+left, command+left",c.KeyState.MessageView,function(){return!1}),a("ctrl+right, command+right",c.KeyState.MessageView,function(){return!1})},i.prototype.prefetchNextTick=function(){if(!this.bPrefetch&&!r.now()&&this.viewModelVisibility()){var e=this,t=o.find(this.messageList(),function(e){return e&&!b.hasRequestedMessage(e.folderFullNameRaw,e.uid)});t&&(this.bPrefetch=!0,b.addRequestedMessage(t.folderFullNameRaw,t.uid),y.message(function(t,i){var s=!(c.StorageResultType.Success!==t||!i||!i.Result);o.delay(function(){e.bPrefetch=!1,s&&e.prefetchNextTick()},1e3)},t.folderFullNameRaw,t.uid))}},i.prototype.composeClick=function(){v.showScreenPopup(t("View:Popup:Compose"))},i.prototype.advancedSearchClick=function(){v.showScreenPopup(t("View:Popup:AdvancedSearch"))},i.prototype.quotaTooltip=function(){return p.i18n("MESSAGE_LIST/QUOTA_SIZE",{SIZE:p.friendlySize(this.userUsageSize()),PROC:this.userUsageProc(),LIMIT:p.friendlySize(this.userQuota())})},i.prototype.initUploaderForAppend=function(){if(!f.settingsGet("AllowAppendMessage")||!this.dragOverArea())return!1;var e=new l({action:h.append(),name:"AppendFile",queueSize:1,multipleSizeLimit:1,disableFolderDragAndDrop:!0,hidden:{Folder:function(){return S.currentFolderFullNameRaw()}},dragAndDropElement:this.dragOverArea(),dragAndDropBodyElement:this.dragOverBodyArea()});return e.on("onDragEnter",o.bind(function(){this.dragOverEnter(!0)},this)).on("onDragLeave",o.bind(function(){this.dragOverEnter(!1)},this)).on("onBodyDragEnter",o.bind(function(){this.dragOver(!0)},this)).on("onBodyDragLeave",o.bind(function(){this.dragOver(!1)},this)).on("onSelect",o.bind(function(e,t){return e&&t&&"message/rfc822"===t.Type?(S.messageListLoading(!0),!0):!1},this)).on("onComplete",o.bind(function(){t("App:RainLoop").reloadMessageList(!0,!0)},this)),!!e},e.exports=i}(t,e)},{$:26,"App:Knoin":33,"App:RainLoop":3,Consts:6,Enums:7,Events:8,Globals:9,Jua:21,"Knoin:AbstractViewModel":36,LinkBuilder:11,Selector:13,"Storage:RainLoop:Cache":69,"Storage:RainLoop:Data":70,"Storage:RainLoop:Remote":74,"Storage:Settings":75,Utils:14,"View:Popup:AdvancedSearch":85,"View:Popup:Compose":88,"View:Popup:FolderClear":91,_:31,ifvisible:25,key:27,ko:28}],81:[function(e,t){!function(e,t){"use strict";function i(){f.call(this,"Right","MailMessageView");var e=this,i="",s=function(t){return u.createCommand(e,function(){this.replyOrforward(t)},e.canBeRepliedOrForwarded)};this.oMessageScrollerDom=null,this.message=h.message,this.currentMessage=h.currentMessage,this.messageListChecked=h.messageListChecked,this.hasCheckedMessages=h.hasCheckedMessages,this.messageListCheckedOrSelectedUidsWithSubMails=h.messageListCheckedOrSelectedUidsWithSubMails,this.messageLoading=h.messageLoading,this.messageLoadingThrottle=h.messageLoadingThrottle,this.messagesBodiesDom=h.messagesBodiesDom,this.useThreads=h.useThreads,this.replySameFolder=h.replySameFolder,this.layout=h.layout,this.usePreviewPane=h.usePreviewPane,this.isMessageSelected=h.isMessageSelected,this.messageActiveDom=h.messageActiveDom,this.messageError=h.messageError,this.fullScreenMode=h.messageFullScreenMode,this.showFullInfo=o.observable(!1),this.moreDropdownTrigger=o.observable(!1),this.messageDomFocused=o.observable(!1).extend({rateLimit:0}),this.messageVisibility=o.computed(function(){return!this.messageLoadingThrottle()&&!!this.message()},this),this.message.subscribe(function(e){e||this.currentMessage(null)},this),this.canBeRepliedOrForwarded=this.messageVisibility,this.closeMessage=u.createCommand(this,function(){h.message(null)}),this.replyCommand=s(l.ComposeType.Reply),this.replyAllCommand=s(l.ComposeType.ReplyAll),this.forwardCommand=s(l.ComposeType.Forward),this.forwardAsAttachmentCommand=s(l.ComposeType.ForwardAsAttachment),this.editAsNewCommand=s(l.ComposeType.EditAsNew),this.messageVisibilityCommand=u.createCommand(this,u.emptyFunction,this.messageVisibility),this.messageEditCommand=u.createCommand(this,function(){this.editMessage()},this.messageVisibility),this.deleteCommand=u.createCommand(this,function(){this.message()&&t("App:RainLoop").deleteMessagesFromFolder(l.FolderType.Trash,this.message().folderFullNameRaw,[this.message().uid],!0)},this.messageVisibility),this.deleteWithoutMoveCommand=u.createCommand(this,function(){this.message()&&t("App:RainLoop").deleteMessagesFromFolder(l.FolderType.Trash,h.currentFolderFullNameRaw(),[this.message().uid],!1)},this.messageVisibility),this.archiveCommand=u.createCommand(this,function(){this.message()&&t("App:RainLoop").deleteMessagesFromFolder(l.FolderType.Archive,this.message().folderFullNameRaw,[this.message().uid],!0)},this.messageVisibility),this.spamCommand=u.createCommand(this,function(){this.message()&&t("App:RainLoop").deleteMessagesFromFolder(l.FolderType.Spam,this.message().folderFullNameRaw,[this.message().uid],!0)},this.messageVisibility),this.notSpamCommand=u.createCommand(this,function(){this.message()&&t("App:RainLoop").deleteMessagesFromFolder(l.FolderType.NotSpam,this.message().folderFullNameRaw,[this.message().uid],!0)},this.messageVisibility),this.viewHash="",this.viewSubject=o.observable(""),this.viewFromShort=o.observable(""),this.viewToShort=o.observable(""),this.viewFrom=o.observable(""),this.viewTo=o.observable(""),this.viewCc=o.observable(""),this.viewBcc=o.observable(""),this.viewDate=o.observable(""),this.viewMoment=o.observable(""),this.viewLineAsCcc=o.observable(""),this.viewViewLink=o.observable(""),this.viewDownloadLink=o.observable(""),this.viewUserPic=o.observable(r.DataImages.UserDotPic),this.viewUserPicVisible=o.observable(!1),this.viewPgpPassword=o.observable(""),this.viewPgpSignedVerifyStatus=o.computed(function(){return this.message()?this.message().pgpSignedVerifyStatus():l.SignedVerifyStatus.None},this),this.viewPgpSignedVerifyUser=o.computed(function(){return this.message()?this.message().pgpSignedVerifyUser():""},this),this.message.subscribe(function(t){this.messageActiveDom(null),this.viewPgpPassword(""),t?(this.viewHash!==t.hash&&this.scrollMessageToTop(),this.viewHash=t.hash,this.viewSubject(t.subject()),this.viewFromShort(t.fromToLine(!0,!0)),this.viewToShort(t.toToLine(!0,!0)),this.viewFrom(t.fromToLine(!1)),this.viewTo(t.toToLine(!1)),this.viewCc(t.ccToLine(!1)),this.viewBcc(t.bccToLine(!1)),this.viewDate(t.fullFormatDateValue()),this.viewMoment(t.momentDate()),this.viewLineAsCcc(t.lineAsCcc()),this.viewViewLink(t.viewLink()),this.viewDownloadLink(t.downloadLink()),i=t.fromAsSingleEmail(),p.getUserPic(i,function(t,s){t!==e.viewUserPic()&&i===s&&(e.viewUserPicVisible(!1),e.viewUserPic(r.DataImages.UserDotPic),""!==t&&(e.viewUserPicVisible(!0),e.viewUserPic(t)))})):(this.viewHash="",this.scrollMessageToTop())},this),this.fullScreenMode.subscribe(function(e){e?a.addClass("rl-message-fullscreen"):a.removeClass("rl-message-fullscreen"),u.windowResize()}),this.messageLoadingThrottle.subscribe(function(e){e&&u.windowResize()}),this.goUpCommand=u.createCommand(this,function(){d.pub("mailbox.message-list.selector.go-up")}),this.goDownCommand=u.createCommand(this,function(){d.pub("mailbox.message-list.selector.go-down")}),m.constructorEnd(this)}var s=t("$"),o=t("ko"),n=t("key"),a=t("$html"),r=t("Consts"),l=t("Enums"),c=t("Globals"),u=t("Utils"),d=t("Events"),p=t("Storage:RainLoop:Cache"),h=t("Storage:RainLoop:Data"),g=t("Storage:RainLoop:Remote"),m=t("App:Knoin"),f=t("Knoin:AbstractViewModel");m.extendAsViewModel("MailBoxMessageViewViewModel",i),i.prototype.isPgpActionVisible=function(){return l.SignedVerifyStatus.Success!==this.viewPgpSignedVerifyStatus()},i.prototype.isPgpStatusVerifyVisible=function(){return l.SignedVerifyStatus.None!==this.viewPgpSignedVerifyStatus()},i.prototype.isPgpStatusVerifySuccess=function(){return l.SignedVerifyStatus.Success===this.viewPgpSignedVerifyStatus()},i.prototype.pgpStatusVerifyMessage=function(){var e="";switch(this.viewPgpSignedVerifyStatus()){case l.SignedVerifyStatus.UnknownPublicKeys:e=u.i18n("PGP_NOTIFICATIONS/NO_PUBLIC_KEYS_FOUND");break;case l.SignedVerifyStatus.UnknownPrivateKey:e=u.i18n("PGP_NOTIFICATIONS/NO_PRIVATE_KEY_FOUND");break;case l.SignedVerifyStatus.Unverified:e=u.i18n("PGP_NOTIFICATIONS/UNVERIFIRED_SIGNATURE");break;case l.SignedVerifyStatus.Error:e=u.i18n("PGP_NOTIFICATIONS/DECRYPTION_ERROR");break;case l.SignedVerifyStatus.Success:e=u.i18n("PGP_NOTIFICATIONS/GOOD_SIGNATURE",{USER:this.viewPgpSignedVerifyUser()})}return e},i.prototype.scrollToTop=function(){var e=s(".messageItem.nano .content",this.viewModelDom);e&&e[0]?e.scrollTop(0):s(".messageItem",this.viewModelDom).scrollTop(0),u.windowResize()},i.prototype.fullScreen=function(){this.fullScreenMode(!0),u.windowResize()},i.prototype.unFullScreen=function(){this.fullScreenMode(!1),u.windowResize()},i.prototype.toggleFullScreen=function(){u.removeSelection(),this.fullScreenMode(!this.fullScreenMode()),u.windowResize()},i.prototype.replyOrforward=function(e){m.showScreenPopup(t("View:Popup:Compose"),[e,h.message()])},i.prototype.onBuild=function(e){var i=this;this.fullScreenMode.subscribe(function(e){e&&i.message.focused(!0)},this),s(".attachmentsPlace",e).magnificPopup({delegate:".magnificPopupImage:visible",type:"image",gallery:{enabled:!0,preload:[1,1],navigateByImgClick:!0},callbacks:{open:function(){c.useKeyboardShortcuts(!1)},close:function(){c.useKeyboardShortcuts(!0)}},mainClass:"mfp-fade",removalDelay:400}),e.on("click",".messageView .messageItem .messageItemHeader",function(){c.useKeyboardShortcuts()&&i.message()&&i.message.focused(!0)}).on("click","a",function(e){return!(e&&3!==e.which&&t("App:RainLoop").mailToHelper(s(this).attr("href")))}).on("click",".attachmentsPlace .attachmentPreview",function(e){e&&e.stopPropagation&&e.stopPropagation()}).on("click",".attachmentsPlace .attachmentItem",function(){var e=o.dataFor(this);e&&e.download&&t("App:RainLoop").download(e.linkDownload())}),this.message.focused.subscribe(function(e){this.messageDomFocused(e&&!u.inFocus()?!0:!1)},this),this.messageDomFocused.subscribe(function(e){e||l.KeyState.MessageView!==c.keyScope()||this.message.focused(!1)},this),c.keyScope.subscribe(function(e){l.KeyState.MessageView===e&&this.message.focused()&&this.messageDomFocused(!0)},this),this.oMessageScrollerDom=e.find(".messageItem .content"),this.oMessageScrollerDom=this.oMessageScrollerDom&&this.oMessageScrollerDom[0]?this.oMessageScrollerDom:null,this.initShortcuts()},i.prototype.escShortcuts=function(){return this.viewModelVisibility()&&this.message()?(this.fullScreenMode()?this.fullScreenMode(!1):l.Layout.NoPreview===h.layout()?this.message(null):this.message.focused(!1),!1):void 0},i.prototype.initShortcuts=function(){var e=this;n("esc",l.KeyState.MessageView,_.bind(this.escShortcuts,this)),n("enter",l.KeyState.MessageView,function(){return e.toggleFullScreen(),!1}),n("enter",l.KeyState.MessageList,function(){return l.Layout.NoPreview!==h.layout()&&e.message()?(e.toggleFullScreen(),!1):void 0}),n("r",[l.KeyState.MessageList,l.KeyState.MessageView],function(){return h.message()?(e.replyCommand(),!1):void 0}),n("a",[l.KeyState.MessageList,l.KeyState.MessageView],function(){return h.message()?(e.replyAllCommand(),!1):void 0}),n("f",[l.KeyState.MessageList,l.KeyState.MessageView],function(){return h.message()?(e.forwardCommand(),!1):void 0}),n("b",[l.KeyState.MessageList,l.KeyState.MessageView],function(){return h.message()&&h.message().body?(u.toggleMessageBlockquote(h.message().body),!1):void 0}),n("ctrl+left, command+left, ctrl+up, command+up",l.KeyState.MessageView,function(){return e.goUpCommand(),!1}),n("ctrl+right, command+right, ctrl+down, command+down",l.KeyState.MessageView,function(){return e.goDownCommand(),!1}),n("ctrl+p, command+p",l.KeyState.MessageView,function(){return e.message()&&e.message().printMessage(),!1}),n("delete, shift+delete",l.KeyState.MessageView,function(t,i){return t?(i&&"shift+delete"===i.shortcut?e.deleteWithoutMoveCommand():e.deleteCommand(),!1):void 0}),n("tab, shift+tab, left",l.KeyState.MessageView,function(){return!e.fullScreenMode()&&e.message()&&l.Layout.NoPreview!==h.layout()&&e.message.focused(!1),!1})},i.prototype.isDraftFolder=function(){return h.message()&&h.draftFolder()===h.message().folderFullNameRaw},i.prototype.isSentFolder=function(){return h.message()&&h.sentFolder()===h.message().folderFullNameRaw},i.prototype.isSpamFolder=function(){return h.message()&&h.spamFolder()===h.message().folderFullNameRaw},i.prototype.isSpamDisabled=function(){return h.message()&&h.spamFolder()===r.Values.UnuseOptionValue},i.prototype.isArchiveFolder=function(){return h.message()&&h.archiveFolder()===h.message().folderFullNameRaw},i.prototype.isArchiveDisabled=function(){return h.message()&&h.archiveFolder()===r.Values.UnuseOptionValue},i.prototype.isDraftOrSentFolder=function(){return this.isDraftFolder()||this.isSentFolder()},i.prototype.composeClick=function(){m.showScreenPopup(t("View:Popup:Compose"))},i.prototype.editMessage=function(){h.message()&&m.showScreenPopup(t("View:Popup:Compose"),[l.ComposeType.Draft,h.message()])},i.prototype.scrollMessageToTop=function(){this.oMessageScrollerDom&&this.oMessageScrollerDom.scrollTop(0)},i.prototype.showImages=function(e){e&&e.showExternalImages&&e.showExternalImages(!0)},i.prototype.printableCheckedMessageCount=function(){var e=this.messageListCheckedOrSelectedUidsWithSubMails().length;return e>0?100>e?e:"99+":""},i.prototype.verifyPgpSignedClearMessage=function(e){e&&e.verifyPgpSignedClearMessage()},i.prototype.decryptPgpEncryptedMessage=function(e){e&&e.decryptPgpEncryptedMessage(this.viewPgpPassword())},i.prototype.readReceipt=function(e){e&&""!==e.readReceipt()&&(g.sendReadReceiptMessage(u.emptyFunction,e.folderFullNameRaw,e.uid,e.readReceipt(),u.i18n("READ_RECEIPT/SUBJECT",{SUBJECT:e.subject()}),u.i18n("READ_RECEIPT/BODY",{"READ-RECEIPT":h.accountEmail()})),e.isReadReceipt(!0),p.storeMessageFlagsToCache(e),t("App:RainLoop").reloadFlagsCurrentMessageListAndMessageFromCache())},e.exports=i}(t,e)},{$:26,$html:17,"App:Knoin":33,"App:RainLoop":3,Consts:6,Enums:7,Events:8,Globals:9,"Knoin:AbstractViewModel":36,"Storage:RainLoop:Cache":69,"Storage:RainLoop:Data":70,"Storage:RainLoop:Remote":74,Utils:14,"View:Popup:Compose":88,key:27,ko:28}],82:[function(e,t){!function(e,t){"use strict";function i(){o.call(this),s.constructorEnd(this)}var s=t("App:Knoin"),o=t("View:RainLoop:AbstractSystemDropDown");s.extendAsViewModel("MailBoxSystemDropDownViewModel",i,o),e.exports=i}(t,e)},{"App:Knoin":33,"View:RainLoop:AbstractSystemDropDown":77}],83:[function(e,t){!function(e,t){"use strict";function i(){c.call(this,"Popups","PopupsAddAccount"),this.email=o.observable(""),this.password=o.observable(""),this.emailError=o.observable(!1),this.passwordError=o.observable(!1),this.email.subscribe(function(){this.emailError(!1)},this),this.password.subscribe(function(){this.passwordError(!1)},this),this.submitRequest=o.observable(!1),this.submitError=o.observable(""),this.emailFocus=o.observable(!1),this.addAccountCommand=a.createCommand(this,function(){return this.emailError(""===a.trim(this.email())),this.passwordError(""===a.trim(this.password())),this.emailError()||this.passwordError()?!1:(this.submitRequest(!0),r.accountAdd(s.bind(function(e,i){this.submitRequest(!1),n.StorageResultType.Success===e&&i&&"AccountAdd"===i.Action?i.Result?(t("App:RainLoop").accountsAndIdentities(),this.cancelCommand()):i.ErrorCode&&this.submitError(a.getNotification(i.ErrorCode)):this.submitError(a.getNotification(n.Notification.UnknownError))},this),this.email(),"",this.password()),!0)},function(){return!this.submitRequest()}),l.constructorEnd(this)}var s=t("_"),o=t("ko"),n=t("Enums"),a=t("Utils"),r=t("Storage:RainLoop:Remote"),l=t("App:Knoin"),c=t("Knoin:AbstractViewModel");l.extendAsViewModel("PopupsAddAccountViewModel",i),i.prototype.clearPopup=function(){this.email(""),this.password(""),this.emailError(!1),this.passwordError(!1),this.submitRequest(!1),this.submitError("")},i.prototype.onShow=function(){this.clearPopup()},i.prototype.onFocus=function(){this.emailFocus(!0)},e.exports=i}(t,e)},{"App:Knoin":33,"App:RainLoop":3,Enums:7,"Knoin:AbstractViewModel":36,"Storage:RainLoop:Remote":74,Utils:14,_:31,ko:28}],84:[function(e,t){!function(e,t){"use strict";function i(){r.call(this,"Popups","PopupsAddOpenPgpKey"),this.key=s.observable(""),this.key.error=s.observable(!1),this.key.focus=s.observable(!1),this.key.subscribe(function(){this.key.error(!1)},this),this.addOpenPgpKeyCommand=o.createCommand(this,function(){var e=30,i=null,s=o.trim(this.key()),a=/[\-]{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,r=n.openpgpKeyring;if(s=s.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(""===s),!r||this.key.error())return!1;for(;;){if(i=a.exec(s),!i||0>e)break;i[0]&&i[1]&&i[2]&&i[1]===i[2]&&("PRIVATE"===i[1]?r.privateKeys.importKey(i[0]):"PUBLIC"===i[1]&&r.publicKeys.importKey(i[0])),e--}return r.store(),t("App:RainLoop").reloadOpenPgpKeys(),o.delegateRun(this,"cancelCommand"),!0}),a.constructorEnd(this)}var s=t("ko"),o=t("Utils"),n=t("Storage:RainLoop:Data"),a=t("App:Knoin"),r=t("Knoin:AbstractViewModel");a.extendAsViewModel("PopupsAddOpenPgpKeyViewModel",i),i.prototype.clearPopup=function(){this.key(""),this.key.error(!1)},i.prototype.onShow=function(){this.clearPopup()},i.prototype.onFocus=function(){this.key.focus(!0)},e.exports=i}(t,e)},{"App:Knoin":33,"App:RainLoop":3,"Knoin:AbstractViewModel":36,"Storage:RainLoop:Data":70,Utils:14,ko:28}],85:[function(e,t){!function(e,t){"use strict";function i(){l.call(this,"Popups","PopupsAdvancedSearch"),this.fromFocus=s.observable(!1),this.from=s.observable(""),this.to=s.observable(""),this.subject=s.observable(""),this.text=s.observable(""),this.selectedDateValue=s.observable(-1),this.hasAttachment=s.observable(!1),this.starred=s.observable(!1),this.unseen=s.observable(!1),this.searchCommand=n.createCommand(this,function(){var e=this.buildSearchString();""!==e&&a.mainMessageListSearch(e),this.cancelCommand()}),r.constructorEnd(this)}var s=t("ko"),o=t("moment"),n=t("Utils"),a=t("Storage:RainLoop:Data"),r=t("App:Knoin"),l=t("Knoin:AbstractViewModel");r.extendAsViewModel("PopupsAdvancedSearchViewModel",i),i.prototype.buildSearchStringValue=function(e){return-1<e.indexOf(" ")&&(e='"'+e+'"'),e},i.prototype.buildSearchString=function(){var e=[],t=n.trim(this.from()),i=n.trim(this.to()),s=n.trim(this.subject()),a=n.trim(this.text()),r=[],l=[];return t&&""!==t&&e.push("from:"+this.buildSearchStringValue(t)),i&&""!==i&&e.push("to:"+this.buildSearchStringValue(i)),s&&""!==s&&e.push("subject:"+this.buildSearchStringValue(s)),this.hasAttachment()&&l.push("attachment"),this.unseen()&&r.push("unseen"),this.starred()&&r.push("flagged"),0<l.length&&e.push("has:"+l.join(",")),0<r.length&&e.push("is:"+r.join(",")),-1<this.selectedDateValue()&&e.push("date:"+o().subtract("days",this.selectedDateValue()).format("YYYY.MM.DD")+"/"),a&&""!==a&&e.push("text:"+this.buildSearchStringValue(a)),n.trim(e.join(" "))},i.prototype.clearPopup=function(){this.from(""),this.to(""),this.subject(""),this.text(""),this.selectedDateValue(-1),this.hasAttachment(!1),this.starred(!1),this.unseen(!1),this.fromFocus(!0)},i.prototype.onShow=function(){this.clearPopup()},i.prototype.onFocus=function(){this.fromFocus(!0)},e.exports=i}(t,e)},{"App:Knoin":33,"Knoin:AbstractViewModel":36,"Storage:RainLoop:Data":70,Utils:14,ko:28,moment:29}],86:[function(e,t){!function(e,t){"use strict";function i(){l.call(this,"Popups","PopupsAsk"),this.askDesc=s.observable(""),this.yesButton=s.observable(""),this.noButton=s.observable(""),this.yesFocus=s.observable(!1),this.noFocus=s.observable(!1),this.fYesAction=null,this.fNoAction=null,this.bDisabeCloseOnEsc=!0,this.sDefaultKeyScope=n.KeyState.PopupAsk,r.constructorEnd(this)}var s=t("ko"),o=t("key"),n=t("Enums"),a=t("Utils"),r=t("App:Knoin"),l=t("Knoin:AbstractViewModel");r.extendAsViewModel("PopupsAskViewModel",i),i.prototype.clearPopup=function(){this.askDesc(""),this.yesButton(a.i18n("POPUPS_ASK/BUTTON_YES")),this.noButton(a.i18n("POPUPS_ASK/BUTTON_NO")),this.yesFocus(!1),this.noFocus(!1),this.fYesAction=null,this.fNoAction=null},i.prototype.yesClick=function(){this.cancelCommand(),a.isFunc(this.fYesAction)&&this.fYesAction.call(null)},i.prototype.noClick=function(){this.cancelCommand(),a.isFunc(this.fNoAction)&&this.fNoAction.call(null)},i.prototype.onShow=function(e,t,i,s,o){this.clearPopup(),this.fYesAction=t||null,this.fNoAction=i||null,this.askDesc(e||""),s&&this.yesButton(s),s&&this.yesButton(o)},i.prototype.onFocus=function(){this.yesFocus(!0)},i.prototype.onBuild=function(){o("tab, shift+tab, right, left",n.KeyState.PopupAsk,_.bind(function(){return this.yesFocus()?this.noFocus(!0):this.yesFocus(!0),!1},this)),o("esc",n.KeyState.PopupAsk,_.bind(function(){return this.noClick(),!1},this))},e.exports=i}(t,e)},{"App:Knoin":33,Enums:7,"Knoin:AbstractViewModel":36,Utils:14,key:27,ko:28}],87:[function(e,t){!function(e,t){"use strict";function i(){p.call(this,"Popups","PopupsComposeOpenPgp"),this.notification=n.observable(""),this.sign=n.observable(!0),this.encrypt=n.observable(!0),this.password=n.observable(""),this.password.focus=n.observable(!1),this.buttonFocus=n.observable(!1),this.from=n.observable(""),this.to=n.observableArray([]),this.text=n.observable(""),this.resultCallback=null,this.submitRequest=n.observable(!1),this.doCommand=r.createCommand(this,function(){var e=this,t=!0,i=null,n=[];this.submitRequest(!0),t&&this.sign()&&""===this.from()&&(this.notification(r.i18n("PGP_NOTIFICATIONS/SPECIFY_FROM_EMAIL")),t=!1),t&&this.sign()&&(i=c.findPrivateKeyByEmail(this.from(),this.password()),i||(this.notification(r.i18n("PGP_NOTIFICATIONS/NO_PRIVATE_KEY_FOUND_FOR",{EMAIL:this.from()})),t=!1)),t&&this.encrypt()&&0===this.to().length&&(this.notification(r.i18n("PGP_NOTIFICATIONS/SPECIFY_AT_LEAST_ONE_RECIPIENT")),t=!1),t&&this.encrypt()&&(n=[],o.each(this.to(),function(i){var s=c.findPublicKeysByEmail(i);0===s.length&&t&&(e.notification(r.i18n("PGP_NOTIFICATIONS/NO_PUBLIC_KEYS_FOUND_FOR",{EMAIL:i})),t=!1),n=n.concat(s)}),!t||0!==n.length&&this.to().length===n.length||(t=!1)),o.delay(function(){if(e.resultCallback&&t)try{i&&0===n.length?e.resultCallback(s.openpgp.signClearMessage([i],e.text())):i&&0<n.length?e.resultCallback(s.openpgp.signAndEncryptMessage(n,i,e.text())):!i&&0<n.length&&e.resultCallback(s.openpgp.encryptMessage(n,e.text()))}catch(o){e.notification(r.i18n("PGP_NOTIFICATIONS/PGP_ERROR",{ERROR:""+o})),t=!1}t&&e.cancelCommand(),e.submitRequest(!1)},10)},function(){return!this.submitRequest()&&(this.sign()||this.encrypt())}),this.sDefaultKeyScope=l.KeyState.PopupComposeOpenPGP,d.constructorEnd(this)}var s=t("window"),o=t("_"),n=t("ko"),a=t("key"),r=t("Utils"),l=t("Enums"),c=t("Storage:RainLoop:Data"),u=t("Model:Email"),d=t("App:Knoin"),p=t("Knoin:AbstractViewModel");d.extendAsViewModel("PopupsComposeOpenPgpViewModel",i),i.prototype.clearPopup=function(){this.notification(""),this.password(""),this.password.focus(!1),this.buttonFocus(!1),this.from(""),this.to([]),this.text(""),this.submitRequest(!1),this.resultCallback=null},i.prototype.onBuild=function(){a("tab,shift+tab",l.KeyState.PopupComposeOpenPGP,o.bind(function(){switch(!0){case this.password.focus():this.buttonFocus(!0);break;case this.buttonFocus():this.password.focus(!0)}return!1},this))},i.prototype.onHide=function(){this.clearPopup()},i.prototype.onFocus=function(){this.sign()?this.password.focus(!0):this.buttonFocus(!0)},i.prototype.onShow=function(e,t,i,s,n,a){this.clearPopup();var l=new u,c="",d=[];this.resultCallback=e,l.clear(),l.mailsoParse(i),""!==l.email&&(c=l.email),""!==s&&d.push(s),""!==n&&d.push(n),""!==a&&d.push(a),d=d.join(", ").split(","),d=o.compact(o.map(d,function(e){return l.clear(),l.mailsoParse(r.trim(e)),""===l.email?!1:l.email})),this.from(c),this.to(d),this.text(t)},e.exports=i}(t,e)},{"App:Knoin":33,Enums:7,"Knoin:AbstractViewModel":36,"Model:Email":43,"Storage:RainLoop:Data":70,Utils:14,_:31,key:27,ko:28,window:32}],88:[function(e,t){!function(e,t){"use strict";function i(){T.call(this,"Popups","PopupsCompose"),this.oEditor=null,this.aDraftInfo=null,this.sInReplyTo="",this.bFromDraft=!1,this.bSkipNext=!1,this.sReferences="",this.bCapaAdditionalIdentities=S.capa(d.Capa.AdditionalIdentities);var e=this,o=function(t){!1===e.showCcAndBcc()&&0<t.length&&e.showCcAndBcc(!0)};this.capaOpenPGP=y.capaOpenPGP,this.resizer=a.observable(!1).extend({throttle:50}),this.identitiesDropdownTrigger=a.observable(!1),this.to=a.observable(""),this.to.focusTrigger=a.observable(!1),this.cc=a.observable(""),this.bcc=a.observable(""),this.replyTo=a.observable(""),this.subject=a.observable(""),this.isHtml=a.observable(!1),this.requestReadReceipt=a.observable(!1),this.sendError=a.observable(!1),this.sendSuccessButSaveError=a.observable(!1),this.savedError=a.observable(!1),this.savedTime=a.observable(0),this.savedOrSendingText=a.observable(""),this.emptyToError=a.observable(!1),this.attachmentsInProcessError=a.observable(!1),this.showCcAndBcc=a.observable(!1),this.cc.subscribe(o,this),this.bcc.subscribe(o,this),this.draftFolder=a.observable(""),this.draftUid=a.observable(""),this.sending=a.observable(!1),this.saving=a.observable(!1),this.attachments=a.observableArray([]),this.attachmentsInProcess=this.attachments.filter(function(e){return e&&""===e.tempName()
}),this.attachmentsInReady=this.attachments.filter(function(e){return e&&""!==e.tempName()}),this.attachments.subscribe(function(){this.triggerForResize()},this),this.isDraftFolderMessage=a.computed(function(){return""!==this.draftFolder()&&""!==this.draftUid()},this),this.composeUploaderButton=a.observable(null),this.composeUploaderDropPlace=a.observable(null),this.dragAndDropEnabled=a.observable(!1),this.dragAndDropOver=a.observable(!1).extend({throttle:1}),this.dragAndDropVisible=a.observable(!1).extend({throttle:1}),this.attacheMultipleAllowed=a.observable(!1),this.addAttachmentEnabled=a.observable(!1),this.composeEditorArea=a.observable(null),this.identities=y.identities,this.defaultIdentityID=y.defaultIdentityID,this.currentIdentityID=a.observable(""),this.currentIdentityString=a.observable(""),this.currentIdentityResultEmail=a.observable(""),this.identitiesOptions=a.computed(function(){var e=[{optValue:y.accountEmail(),optText:this.formattedFrom(!1)}];return n.each(y.identities(),function(t){e.push({optValue:t.id,optText:t.formattedNameForCompose()})}),e},this),a.computed(function(){var e="",t="",i=null,s=this.identities(),o=this.currentIdentityID();return this.bCapaAdditionalIdentities&&o&&o!==y.accountEmail()&&(i=n.find(s,function(e){return e&&o===e.id}),e=i?i.formattedNameForCompose():"",t=i?i.formattedNameForEmail():"",""===e&&s[0])?(this.currentIdentityID(s[0].id),""):(""===e&&(e=this.formattedFrom(!1),t=this.formattedFrom(!0)),this.currentIdentityString(e),this.currentIdentityResultEmail(t),e)},this),this.to.subscribe(function(e){this.emptyToError()&&0<e.length&&this.emptyToError(!1)},this),this.attachmentsInProcess.subscribe(function(e){this.attachmentsInProcessError()&&h.isArray(e)&&0===e.length&&this.attachmentsInProcessError(!1)},this),this.editorResizeThrottle=n.throttle(n.bind(this.editorResize,this),100),this.resizer.subscribe(function(){this.editorResizeThrottle()},this),this.canBeSendedOrSaved=a.computed(function(){return!this.sending()&&!this.saving()},this),this.deleteCommand=h.createCommand(this,function(){t("App:RainLoop").deleteMessagesFromFolderWithoutCheck(this.draftFolder(),[this.draftUid()]),A.hideScreenPopup(i)},function(){return this.isDraftFolderMessage()}),this.sendMessageResponse=n.bind(this.sendMessageResponse,this),this.saveMessageResponse=n.bind(this.saveMessageResponse,this),this.sendCommand=h.createCommand(this,function(){var e=h.trim(this.to()),i=y.sentFolder(),s=[];0<this.attachmentsInProcess().length?this.attachmentsInProcessError(!0):0===e.length?this.emptyToError(!0):(y.replySameFolder()&&h.isArray(this.aDraftInfo)&&3===this.aDraftInfo.length&&h.isNormal(this.aDraftInfo[2])&&0<this.aDraftInfo[2].length&&(i=this.aDraftInfo[2]),""===i?A.showScreenPopup(t("View:Popup:FolderSystem"),[d.SetSystemFoldersNotification.Sent]):(this.sendError(!1),this.sending(!0),h.isArray(this.aDraftInfo)&&3===this.aDraftInfo.length&&(s=v.getMessageFlagsFromCache(this.aDraftInfo[2],this.aDraftInfo[1]),s&&("forward"===this.aDraftInfo[0]?s[3]=!0:s[2]=!0,v.setMessageFlagsToCache(this.aDraftInfo[2],this.aDraftInfo[1],s),t("App:RainLoop").reloadFlagsCurrentMessageListAndMessageFromCache(),v.setFolderHash(this.aDraftInfo[2],""))),i=p.Values.UnuseOptionValue===i?"":i,v.setFolderHash(this.draftFolder(),""),v.setFolderHash(i,""),w.sendMessage(this.sendMessageResponse,this.draftFolder(),this.draftUid(),i,this.currentIdentityResultEmail(),e,this.cc(),this.bcc(),this.subject(),this.oEditor?this.oEditor.isHtml():!1,this.oEditor?this.oEditor.getData(!0):"",this.prepearAttachmentsForSendOrSave(),this.aDraftInfo,this.sInReplyTo,this.sReferences,this.requestReadReceipt())))},this.canBeSendedOrSaved),this.saveCommand=h.createCommand(this,function(){y.draftFolderNotEnabled()?A.showScreenPopup(t("View:Popup:FolderSystem"),[d.SetSystemFoldersNotification.Draft]):(this.savedError(!1),this.saving(!0),this.bSkipNext=!0,v.setFolderHash(y.draftFolder(),""),w.saveMessage(this.saveMessageResponse,this.draftFolder(),this.draftUid(),y.draftFolder(),this.currentIdentityResultEmail(),this.to(),this.cc(),this.bcc(),this.subject(),this.oEditor?this.oEditor.isHtml():!1,this.oEditor?this.oEditor.getData(!0):"",this.prepearAttachmentsForSendOrSave(),this.aDraftInfo,this.sInReplyTo,this.sReferences))},this.canBeSendedOrSaved),f.sub("interval.1m",function(){!this.modalVisibility()||y.draftFolderNotEnabled()||this.isEmptyForm(!1)||this.bSkipNext||this.saving()||this.sending()||this.savedError()||(this.bSkipNext=!1,this.saveCommand())},this),this.showCcAndBcc.subscribe(function(){this.triggerForResize()},this),this.dropboxEnabled=a.observable(!!S.settingsGet("DropboxApiKey")),this.dropboxCommand=h.createCommand(this,function(){return s.Dropbox&&s.Dropbox.choose({success:function(t){t&&t[0]&&t[0].link&&e.addDropboxAttachment(t[0])},linkType:"direct",multiselect:!1}),!0},function(){return this.dropboxEnabled()}),this.driveEnabled=a.observable(g.bXMLHttpRequestSupported&&!!S.settingsGet("GoogleClientID")&&!!S.settingsGet("GoogleApiKey")),this.driveVisible=a.observable(!1),this.driveCommand=h.createCommand(this,function(){return this.driveOpenPopup(),!0},function(){return this.driveEnabled()}),this.driveCallback=n.bind(this.driveCallback,this),this.bDisabeCloseOnEsc=!0,this.sDefaultKeyScope=d.KeyState.Compose,this.tryToClosePopup=n.debounce(n.bind(this.tryToClosePopup,this),200),this.emailsSource=n.bind(this.emailsSource,this),A.constructorEnd(this)}var s=t("window"),o=t("$"),n=t("_"),a=t("ko"),r=t("moment"),l=t("$win"),c=t("JSON"),u=t("Jua"),d=t("Enums"),p=t("Consts"),h=t("Utils"),g=t("Globals"),m=t("LinkBuilder"),f=t("Events"),b=t("HtmlEditor"),S=t("Storage:Settings"),y=t("Storage:RainLoop:Data"),v=t("Storage:RainLoop:Cache"),w=t("Storage:RainLoop:Remote"),C=t("Model:ComposeAttachment"),A=t("App:Knoin"),T=t("Knoin:AbstractViewModel");A.extendAsViewModel("PopupsComposeViewModel",i),i.prototype.emailsSource=function(e,i){t("App:RainLoop").getAutocomplete(e.term,function(e){i(n.map(e,function(e){return e.toLine(!1)}))})},i.prototype.openOpenPgpPopup=function(){if(this.capaOpenPGP()&&this.oEditor&&!this.oEditor.isHtml()){var e=this;A.showScreenPopup(t("View:Popup:ComposeOpenPgp"),[function(t){e.editor(function(e){e.setPlain(t)})},this.oEditor.getData(),this.currentIdentityResultEmail(),this.to(),this.cc(),this.bcc()])}},i.prototype.reloadDraftFolder=function(){var e=y.draftFolder();""!==e&&(v.setFolderHash(e,""),y.currentFolderFullNameRaw()===e?t("App:RainLoop").reloadMessageList(!0):t("App:RainLoop").folderInformation(e))},i.prototype.findIdentityIdByMessage=function(e,t){var i={},s="",o=function(e){return e&&e.email&&i[e.email]?(s=i[e.email],!0):!1};if(this.bCapaAdditionalIdentities&&n.each(this.identities(),function(e){i[e.email()]=e.id}),i[y.accountEmail()]=y.accountEmail(),t)switch(e){case d.ComposeType.Empty:break;case d.ComposeType.Reply:case d.ComposeType.ReplyAll:case d.ComposeType.Forward:case d.ComposeType.ForwardAsAttachment:n.find(n.union(t.to,t.cc,t.bcc,t.deliveredTo),o);break;case d.ComposeType.Draft:n.find(n.union(t.from,t.replyTo),o)}return""===s&&(s=this.defaultIdentityID()),""===s&&(s=y.accountEmail()),s},i.prototype.selectIdentity=function(e){e&&this.currentIdentityID(e.optValue)},i.prototype.formattedFrom=function(e){var t=y.displayName(),i=y.accountEmail();return""===t?i:(h.isUnd(e)?1:!e)?t+" ("+i+")":'"'+h.quoteName(t)+'" <'+i+">"},i.prototype.sendMessageResponse=function(e,t){var i=!1,o="";this.sending(!1),d.StorageResultType.Success===e&&t&&t.Result&&(i=!0,this.modalVisibility()&&h.delegateRun(this,"closeCommand")),this.modalVisibility()&&!i&&(t&&d.Notification.CantSaveMessage===t.ErrorCode?(this.sendSuccessButSaveError(!0),s.alert(h.trim(h.i18n("COMPOSE/SAVED_ERROR_ON_SEND")))):(o=h.getNotification(t&&t.ErrorCode?t.ErrorCode:d.Notification.CantSendMessage,t&&t.ErrorMessage?t.ErrorMessage:""),this.sendError(!0),s.alert(o||h.getNotification(d.Notification.CantSendMessage)))),this.reloadDraftFolder()},i.prototype.saveMessageResponse=function(e,t){var i=!1,o=null;this.saving(!1),d.StorageResultType.Success===e&&t&&t.Result&&t.Result.NewFolder&&t.Result.NewUid&&(this.bFromDraft&&(o=y.message(),o&&this.draftFolder()===o.folderFullNameRaw&&this.draftUid()===o.uid&&y.message(null)),this.draftFolder(t.Result.NewFolder),this.draftUid(t.Result.NewUid),this.modalVisibility()&&(this.savedTime(s.Math.round((new s.Date).getTime()/1e3)),this.savedOrSendingText(0<this.savedTime()?h.i18n("COMPOSE/SAVED_TIME",{TIME:r.unix(this.savedTime()-1).format("LT")}):""),i=!0,this.bFromDraft&&v.setFolderHash(this.draftFolder(),""))),this.modalVisibility()||i||(this.savedError(!0),this.savedOrSendingText(h.getNotification(d.Notification.CantSaveMessage))),this.reloadDraftFolder()},i.prototype.onHide=function(){this.reset(),A.routeOn()},i.prototype.convertSignature=function(e,t,i,s){var o=!1,n=!1;if(""!==e&&(":HTML:"===e.substr(0,6)&&(o=!0,e=e.substr(6)),e=e.replace(/[\r]/g,""),t=h.pString(t),""!==t&&(e=e.replace(/{{FROM}}/g,t)),e=e.replace(/[\s]{1,2}{{FROM}}/g,"{{FROM}}"),e=e.replace(/{{FROM}}/g,""),e=e.replace(/{{DATE}}/g,r().format("llll")),i&&d.ComposeType.Empty===s&&-1<e.indexOf("{{DATA}}")&&(n=!0,e=e.replace("{{DATA}}",i)),e=e.replace(/{{DATA}}/g,""),o||(e=h.convertPlainTextToHtml(e))),i&&!n)switch(s){case d.ComposeType.Empty:e=i+"<br />"+e;break;default:e=e+"<br />"+i}return e},i.prototype.editor=function(e){if(e){var t=this;!this.oEditor&&this.composeEditorArea()?n.delay(function(){t.oEditor=new b(t.composeEditorArea(),null,function(){e(t.oEditor)},function(e){t.isHtml(!!e)})},300):this.oEditor&&e(this.oEditor)}},i.prototype.onShow=function(e,t,i,s,a){A.routeOff();var r=this,l="",c="",u="",p="",g="",m=null,f="",b="",S=[],v={},C=y.accountEmail(),T=y.signature(),F=y.signatureToAll(),R=[],L=null,E=null,N=e||d.ComposeType.Empty,P=function(e,t){for(var i=0,s=e.length,o=[];s>i;i++)o.push(e[i].toLine(!!t));return o.join(", ")};if(t=t||null,t&&h.isNormal(t)&&(E=h.isArray(t)&&1===t.length?t[0]:h.isArray(t)?null:t),null!==C&&(v[C]=!0),this.currentIdentityID(this.findIdentityIdByMessage(N,E)),this.reset(),h.isNonEmptyArray(i)&&this.to(P(i)),""!==N&&E){switch(p=E.fullFormatDateValue(),g=E.subject(),L=E.aDraftInfo,m=o(E.body).clone(),h.removeBlockquoteSwitcher(m),m.find("[data-html-editor-font-wrapper]").removeAttr("data-html-editor-font-wrapper"),f=m.html(),N){case d.ComposeType.Empty:break;case d.ComposeType.Reply:this.to(P(E.replyEmails(v))),this.subject(h.replySubjectAdd("Re",g)),this.prepearMessageAttachments(E,N),this.aDraftInfo=["reply",E.uid,E.folderFullNameRaw],this.sInReplyTo=E.sMessageId,this.sReferences=h.trim(this.sInReplyTo+" "+E.sReferences);break;case d.ComposeType.ReplyAll:S=E.replyAllEmails(v),this.to(P(S[0])),this.cc(P(S[1])),this.subject(h.replySubjectAdd("Re",g)),this.prepearMessageAttachments(E,N),this.aDraftInfo=["reply",E.uid,E.folderFullNameRaw],this.sInReplyTo=E.sMessageId,this.sReferences=h.trim(this.sInReplyTo+" "+E.references());break;case d.ComposeType.Forward:this.subject(h.replySubjectAdd("Fwd",g)),this.prepearMessageAttachments(E,N),this.aDraftInfo=["forward",E.uid,E.folderFullNameRaw],this.sInReplyTo=E.sMessageId,this.sReferences=h.trim(this.sInReplyTo+" "+E.sReferences);break;case d.ComposeType.ForwardAsAttachment:this.subject(h.replySubjectAdd("Fwd",g)),this.prepearMessageAttachments(E,N),this.aDraftInfo=["forward",E.uid,E.folderFullNameRaw],this.sInReplyTo=E.sMessageId,this.sReferences=h.trim(this.sInReplyTo+" "+E.sReferences);break;case d.ComposeType.Draft:this.to(P(E.to)),this.cc(P(E.cc)),this.bcc(P(E.bcc)),this.bFromDraft=!0,this.draftFolder(E.folderFullNameRaw),this.draftUid(E.uid),this.subject(g),this.prepearMessageAttachments(E,N),this.aDraftInfo=h.isNonEmptyArray(L)&&3===L.length?L:null,this.sInReplyTo=E.sInReplyTo,this.sReferences=E.sReferences;break;case d.ComposeType.EditAsNew:this.to(P(E.to)),this.cc(P(E.cc)),this.bcc(P(E.bcc)),this.subject(g),this.prepearMessageAttachments(E,N),this.aDraftInfo=h.isNonEmptyArray(L)&&3===L.length?L:null,this.sInReplyTo=E.sInReplyTo,this.sReferences=E.sReferences}switch(N){case d.ComposeType.Reply:case d.ComposeType.ReplyAll:l=E.fromToLine(!1,!0),b=h.i18n("COMPOSE/REPLY_MESSAGE_TITLE",{DATETIME:p,EMAIL:l}),f="<br /><br />"+b+":<blockquote><p>"+f+"</p></blockquote>";break;case d.ComposeType.Forward:l=E.fromToLine(!1,!0),c=E.toToLine(!1,!0),u=E.ccToLine(!1,!0),f="<br /><br /><br />"+h.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TITLE")+"<br />"+h.i18n("COMPOSE/FORWARD_MESSAGE_TOP_FROM")+": "+l+"<br />"+h.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TO")+": "+c+(0<u.length?"<br />"+h.i18n("COMPOSE/FORWARD_MESSAGE_TOP_CC")+": "+u:"")+"<br />"+h.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SENT")+": "+h.encodeHtml(p)+"<br />"+h.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SUBJECT")+": "+h.encodeHtml(g)+"<br /><br />"+f;break;case d.ComposeType.ForwardAsAttachment:f=""}F&&""!==T&&d.ComposeType.EditAsNew!==N&&d.ComposeType.Draft!==N&&(f=this.convertSignature(T,P(E.from,!0),f,N)),this.editor(function(e){e.setHtml(f,!1),E.isHtml()||e.modeToggle(!1)})}else d.ComposeType.Empty===N?(this.subject(h.isNormal(s)?""+s:""),f=h.isNormal(a)?""+a:"",F&&""!==T&&(f=this.convertSignature(T,"",h.convertPlainTextToHtml(f),N)),this.editor(function(e){e.setHtml(f,!1),d.EditorDefaultType.Html!==y.editorDefaultType()&&e.modeToggle(!1)})):h.isNonEmptyArray(t)&&n.each(t,function(e){r.addMessageAsAttachment(e)});R=this.getAttachmentsDownloadsForUpload(),h.isNonEmptyArray(R)&&w.messageUploadAttachments(function(e,t){if(d.StorageResultType.Success===e&&t&&t.Result){var i=null,s="";if(!r.viewModelVisibility())for(s in t.Result)t.Result.hasOwnProperty(s)&&(i=r.getAttachmentById(t.Result[s]),i&&i.tempName(s))}else r.setMessageAttachmentFailedDowbloadText()},R),this.triggerForResize()},i.prototype.onFocus=function(){""===this.to()?this.to.focusTrigger(!this.to.focusTrigger()):this.oEditor&&this.oEditor.focus(),this.triggerForResize()},i.prototype.editorResize=function(){this.oEditor&&this.oEditor.resize()},i.prototype.tryToClosePopup=function(){var e=this,i=t("View:Popup:Ask");A.isPopupVisible(i)||A.showScreenPopup(i,[h.i18n("POPUPS_ASK/DESC_WANT_CLOSE_THIS_WINDOW"),function(){e.modalVisibility()&&h.delegateRun(e,"closeCommand")}])},i.prototype.onBuild=function(){this.initUploader();var e=this,t=null;key("ctrl+q, command+q",d.KeyState.Compose,function(){return e.identitiesDropdownTrigger(!0),!1}),key("ctrl+s, command+s",d.KeyState.Compose,function(){return e.saveCommand(),!1}),key("ctrl+enter, command+enter",d.KeyState.Compose,function(){return e.sendCommand(),!1}),key("esc",d.KeyState.Compose,function(){return e.modalVisibility()&&e.tryToClosePopup(),!1}),l.on("resize",function(){e.triggerForResize()}),this.dropboxEnabled()&&(t=s.document.createElement("script"),t.type="text/javascript",t.src="https://www.dropbox.com/static/api/1/dropins.js",o(t).attr("id","dropboxjs").attr("data-app-key",S.settingsGet("DropboxApiKey")),s.document.body.appendChild(t)),this.driveEnabled()&&o.getScript("https://apis.google.com/js/api.js",function(){s.gapi&&e.driveVisible(!0)})},i.prototype.driveCallback=function(e,t){if(t&&s.XMLHttpRequest&&s.google&&t[s.google.picker.Response.ACTION]===s.google.picker.Action.PICKED&&t[s.google.picker.Response.DOCUMENTS]&&t[s.google.picker.Response.DOCUMENTS][0]&&t[s.google.picker.Response.DOCUMENTS][0].id){var i=this,o=new s.XMLHttpRequest;o.open("GET","https://www.googleapis.com/drive/v2/files/"+t[s.google.picker.Response.DOCUMENTS][0].id),o.setRequestHeader("Authorization","Bearer "+e),o.addEventListener("load",function(){if(o&&o.responseText){var t=c.parse(o.responseText),s=function(e,t,i){e&&e.exportLinks&&(e.exportLinks[t]?(e.downloadUrl=e.exportLinks[t],e.title=e.title+"."+i,e.mimeType=t):e.exportLinks["application/pdf"]&&(e.downloadUrl=e.exportLinks["application/pdf"],e.title=e.title+".pdf",e.mimeType="application/pdf"))};if(t&&!t.downloadUrl&&t.mimeType&&t.exportLinks)switch(t.mimeType.toString().toLowerCase()){case"application/vnd.google-apps.document":s(t,"application/vnd.openxmlformats-officedocument.wordprocessingml.document","docx");break;case"application/vnd.google-apps.spreadsheet":s(t,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","xlsx");break;case"application/vnd.google-apps.drawing":s(t,"image/png","png");break;case"application/vnd.google-apps.presentation":s(t,"application/vnd.openxmlformats-officedocument.presentationml.presentation","pptx");break;default:s(t,"application/pdf","pdf")}t&&t.downloadUrl&&i.addDriveAttachment(t,e)}}),o.send()}},i.prototype.driveCreatePiker=function(e){if(s.gapi&&e&&e.access_token){var t=this;s.gapi.load("picker",{callback:function(){if(s.google&&s.google.picker){var i=(new s.google.picker.PickerBuilder).addView((new s.google.picker.DocsView).setIncludeFolders(!0)).setAppId(S.settingsGet("GoogleClientID")).setOAuthToken(e.access_token).setCallback(n.bind(t.driveCallback,t,e.access_token)).enableFeature(s.google.picker.Feature.NAV_HIDDEN).build();i.setVisible(!0)}}})}},i.prototype.driveOpenPopup=function(){if(s.gapi){var e=this;s.gapi.load("auth",{callback:function(){var t=s.gapi.auth.getToken();t?e.driveCreatePiker(t):s.gapi.auth.authorize({client_id:S.settingsGet("GoogleClientID"),scope:"https://www.googleapis.com/auth/drive.readonly",immediate:!0},function(t){if(t&&!t.error){var i=s.gapi.auth.getToken();i&&e.driveCreatePiker(i)}else s.gapi.auth.authorize({client_id:S.settingsGet("GoogleClientID"),scope:"https://www.googleapis.com/auth/drive.readonly",immediate:!1},function(t){if(t&&!t.error){var i=s.gapi.auth.getToken();i&&e.driveCreatePiker(i)}})})}})}},i.prototype.getAttachmentById=function(e){for(var t=this.attachments(),i=0,s=t.length;s>i;i++)if(t[i]&&e===t[i].id)return t[i];return null},i.prototype.initUploader=function(){if(this.composeUploaderButton()){var e={},t=h.pInt(S.settingsGet("AttachmentLimit")),i=new u({action:m.upload(),name:"uploader",queueSize:2,multipleSizeLimit:50,disableFolderDragAndDrop:!1,clickElement:this.composeUploaderButton(),dragAndDropElement:this.composeUploaderDropPlace()});i?(i.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,i,o){var n=null;h.isUnd(e[t])?(n=this.getAttachmentById(t),n&&(e[t]=n)):n=e[t],n&&n.progress(" - "+s.Math.floor(i/o*100)+"%")},this)).on("onSelect",n.bind(function(e,s){this.dragAndDropOver(!1);var o=this,n=h.isUnd(s.FileName)?"":s.FileName.toString(),a=h.isNormal(s.Size)?h.pInt(s.Size):null,r=new C(e,n,a);return r.cancel=function(e){return function(){o.attachments.remove(function(t){return t&&t.id===e}),i&&i.cancel(e)}}(e),this.attachments.push(r),a>0&&t>0&&a>t?(r.error(h.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):!0},this)).on("onStart",n.bind(function(t){var i=null;h.isUnd(e[t])?(i=this.getAttachmentById(t),i&&(e[t]=i)):i=e[t],i&&(i.waiting(!1),i.uploading(!0))},this)).on("onComplete",n.bind(function(t,i,s){var o="",n=null,a=null,r=this.getAttachmentById(t);a=i&&s&&s.Result&&s.Result.Attachment?s.Result.Attachment:null,n=s&&s.Result&&s.Result.ErrorCode?s.Result.ErrorCode:null,null!==n?o=h.getUploadErrorDescByCode(n):a||(o=h.i18n("UPLOAD/ERROR_UNKNOWN")),r&&(""!==o&&0<o.length?r.waiting(!1).uploading(!1).error(o):a&&(r.waiting(!1).uploading(!1),r.initByUploadJson(a)),h.isUnd(e[t])&&delete e[t])},this)),this.addAttachmentEnabled(!0).dragAndDropEnabled(i.isDragAndDropSupported())):this.addAttachmentEnabled(!1).dragAndDropEnabled(!1)}},i.prototype.prepearAttachmentsForSendOrSave=function(){var e={};return n.each(this.attachmentsInReady(),function(t){t&&""!==t.tempName()&&t.enabled()&&(e[t.tempName()]=[t.fileName(),t.isInline?"1":"0",t.CID,t.contentLocation])}),e},i.prototype.addMessageAsAttachment=function(e){if(e){var t=this,i=null,s=e.subject(),o=function(e){return function(){t.attachments.remove(function(t){return t&&t.id===e})}};s=".eml"===s.substr(-4).toLowerCase()?s:s+".eml",i=new C(e.requestHash,s,e.size()),i.fromMessage=!0,i.cancel=o(e.requestHash),i.waiting(!1).uploading(!0),this.attachments.push(i)}},i.prototype.addDropboxAttachment=function(e){var t=this,i=null,s=function(e){return function(){t.attachments.remove(function(t){return t&&t.id===e})}},o=h.pInt(S.settingsGet("AttachmentLimit")),n=e.bytes;return i=new C(e.link,e.name,n),i.fromMessage=!1,i.cancel=s(e.link),i.waiting(!1).uploading(!0),this.attachments.push(i),n>0&&o>0&&n>o?(i.uploading(!1),i.error(h.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(w.composeUploadExternals(function(e,t){var s=!1;i.uploading(!1),d.StorageResultType.Success===e&&t&&t.Result&&t.Result[i.id]&&(s=!0,i.tempName(t.Result[i.id])),s||i.error(h.getUploadErrorDescByCode(d.UploadErrorCode.FileNoUploaded))},[e.link]),!0)},i.prototype.addDriveAttachment=function(e,t){var i=this,s=function(e){return function(){i.attachments.remove(function(t){return t&&t.id===e})}},o=h.pInt(S.settingsGet("AttachmentLimit")),n=null,a=e.fileSize?h.pInt(e.fileSize):0;return n=new C(e.downloadUrl,e.title,a),n.fromMessage=!1,n.cancel=s(e.downloadUrl),n.waiting(!1).uploading(!0),this.attachments.push(n),a>0&&o>0&&a>o?(n.uploading(!1),n.error(h.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(w.composeUploadDrive(function(e,t){var i=!1;n.uploading(!1),d.StorageResultType.Success===e&&t&&t.Result&&t.Result[n.id]&&(i=!0,n.tempName(t.Result[n.id][0]),n.size(h.pInt(t.Result[n.id][1]))),i||n.error(h.getUploadErrorDescByCode(d.UploadErrorCode.FileNoUploaded))},e.downloadUrl,t),!0)},i.prototype.prepearMessageAttachments=function(e,t){if(e){var i=this,s=h.isNonEmptyArray(e.attachments())?e.attachments():[],o=0,n=s.length,a=null,r=null,l=!1,c=function(e){return function(){i.attachments.remove(function(t){return t&&t.id===e})}};if(d.ComposeType.ForwardAsAttachment===t)this.addMessageAsAttachment(e);else for(;n>o;o++){switch(r=s[o],l=!1,t){case d.ComposeType.Reply:case d.ComposeType.ReplyAll:l=r.isLinked;break;case d.ComposeType.Forward:case d.ComposeType.Draft:case d.ComposeType.EditAsNew:l=!0}l&&(a=new C(r.download,r.fileName,r.estimatedSize,r.isInline,r.isLinked,r.cid,r.contentLocation),a.fromMessage=!0,a.cancel=c(r.download),a.waiting(!1).uploading(!0),this.attachments.push(a))}}},i.prototype.removeLinkedAttachments=function(){this.attachments.remove(function(e){return e&&e.isLinked})},i.prototype.setMessageAttachmentFailedDowbloadText=function(){n.each(this.attachments(),function(e){e&&e.fromMessage&&e.waiting(!1).uploading(!1).error(h.getUploadErrorDescByCode(d.UploadErrorCode.FileNoUploaded))},this)},i.prototype.isEmptyForm=function(e){e=h.isUnd(e)?!0:!!e;var t=e?0===this.attachments().length:0===this.attachmentsInReady().length;return 0===this.to().length&&0===this.cc().length&&0===this.bcc().length&&0===this.subject().length&&t&&(!this.oEditor||""===this.oEditor.getData())},i.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)},i.prototype.getAttachmentsDownloadsForUpload=function(){return n.map(n.filter(this.attachments(),function(e){return e&&""===e.tempName()}),function(e){return e.id})},i.prototype.triggerForResize=function(){this.resizer(!this.resizer()),this.editorResizeThrottle()},e.exports=i}(t,e)},{$:26,$win:18,"App:Knoin":33,"App:RainLoop":3,Consts:6,Enums:7,Events:8,Globals:9,HtmlEditor:10,JSON:20,Jua:21,"Knoin:AbstractViewModel":36,LinkBuilder:11,"Model:ComposeAttachment":39,"Storage:RainLoop:Cache":69,"Storage:RainLoop:Data":70,"Storage:RainLoop:Remote":74,"Storage:Settings":75,Utils:14,"View:Popup:Ask":86,"View:Popup:ComposeOpenPgp":87,"View:Popup:FolderSystem":93,_:31,ko:28,moment:29,window:32}],89:[function(e,t){!function(e,t){"use strict";function i(){w.call(this,"Popups","PopupsContacts");var e=this,i=function(t){t&&0<t.length&&e.viewProperties.removeAll(t)};this.allowContactsSync=g.allowContactsSync,this.enableContactsSync=g.enableContactsSync,this.allowExport=!u.bMobileDevice,this.search=a.observable(""),this.contactsCount=a.observable(0),this.contacts=g.contacts,this.contactTags=g.contactTags,this.currentContact=a.observable(null),this.importUploaderButton=a.observable(null),this.contactsPage=a.observable(1),this.contactsPageCount=a.computed(function(){var e=s.Math.ceil(this.contactsCount()/c.Defaults.ContactsPerPage);return 0>=e?1:e},this),this.contactsPagenator=a.computed(d.computedPagenatorHelper(this.contactsPage,this.contactsPageCount)),this.emptySelection=a.observable(!0),this.viewClearSearch=a.observable(!1),this.viewID=a.observable(""),this.viewReadOnly=a.observable(!1),this.viewProperties=a.observableArray([]),this.viewTags=a.observable(""),this.viewTags.visibility=a.observable(!1),this.viewTags.focusTrigger=a.observable(!1),this.viewTags.focusTrigger.subscribe(function(e){e||""!==this.viewTags()?e&&this.viewTags.visibility(!0):this.viewTags.visibility(!1)},this),this.viewSaveTrigger=a.observable(l.SaveSettingsStep.Idle),this.viewPropertiesNames=this.viewProperties.filter(function(e){return-1<d.inArray(e.type(),[l.ContactPropertyType.FirstName,l.ContactPropertyType.LastName])}),this.viewPropertiesOther=this.viewProperties.filter(function(e){return-1<d.inArray(e.type(),[l.ContactPropertyType.Note])}),this.viewPropertiesOther=a.computed(function(){var e=n.filter(this.viewProperties(),function(e){return-1<d.inArray(e.type(),[l.ContactPropertyType.Nick])});return n.sortBy(e,function(e){return e.type()})},this),this.viewPropertiesEmails=this.viewProperties.filter(function(e){return l.ContactPropertyType.Email===e.type()}),this.viewPropertiesWeb=this.viewProperties.filter(function(e){return l.ContactPropertyType.Web===e.type()}),this.viewHasNonEmptyRequaredProperties=a.computed(function(){var e=this.viewPropertiesNames(),t=this.viewPropertiesEmails(),i=function(e){return""!==d.trim(e.value())};return!(!n.find(e,i)&&!n.find(t,i))},this),this.viewPropertiesPhones=this.viewProperties.filter(function(e){return l.ContactPropertyType.Phone===e.type()}),this.viewPropertiesEmailsNonEmpty=this.viewPropertiesNames.filter(function(e){return""!==d.trim(e.value())}),this.viewPropertiesEmailsEmptyAndOnFocused=this.viewPropertiesEmails.filter(function(e){var t=e.focused();return""===d.trim(e.value())&&!t}),this.viewPropertiesPhonesEmptyAndOnFocused=this.viewPropertiesPhones.filter(function(e){var t=e.focused();return""===d.trim(e.value())&&!t}),this.viewPropertiesWebEmptyAndOnFocused=this.viewPropertiesWeb.filter(function(e){var t=e.focused();return""===d.trim(e.value())&&!t}),this.viewPropertiesOtherEmptyAndOnFocused=a.computed(function(){return n.filter(this.viewPropertiesOther(),function(e){var t=e.focused();return""===d.trim(e.value())&&!t})},this),this.viewPropertiesEmailsEmptyAndOnFocused.subscribe(function(e){i(e)}),this.viewPropertiesPhonesEmptyAndOnFocused.subscribe(function(e){i(e)}),this.viewPropertiesWebEmptyAndOnFocused.subscribe(function(e){i(e)}),this.viewPropertiesOtherEmptyAndOnFocused.subscribe(function(e){i(e)}),this.viewSaving=a.observable(!1),this.useCheckboxesInList=g.useCheckboxesInList,this.search.subscribe(function(){this.reloadContactList()},this),this.contacts.subscribe(function(){d.windowResize()},this),this.viewProperties.subscribe(function(){d.windowResize()},this),this.contactsChecked=a.computed(function(){return n.filter(this.contacts(),function(e){return e.checked()})},this),this.contactsCheckedOrSelected=a.computed(function(){var e=this.contactsChecked(),t=this.currentContact();return n.union(e,t?[t]:[])},this),this.contactsCheckedOrSelectedUids=a.computed(function(){return n.map(this.contactsCheckedOrSelected(),function(e){return e.idContact})},this),this.selector=new h(this.contacts,this.currentContact,".e-contact-item .actionHandle",".e-contact-item.selected",".e-contact-item .checkboxItem",".e-contact-item.focused"),this.selector.on("onItemSelect",n.bind(function(e){this.populateViewContact(e?e:null),e||this.emptySelection(!0)},this)),this.selector.on("onItemGetUid",function(e){return e?e.generateUid():""}),this.newCommand=d.createCommand(this,function(){this.populateViewContact(null),this.currentContact(null)}),this.deleteCommand=d.createCommand(this,function(){this.deleteSelectedContacts(),this.emptySelection(!0)},function(){return 0<this.contactsCheckedOrSelected().length}),this.newMessageCommand=d.createCommand(this,function(){var e=this.contactsCheckedOrSelected(),i=[];d.isNonEmptyArray(e)&&(i=n.map(e,function(e){if(e){var t=e.getNameAndEmailHelper(),i=t?new f(t[0],t[1]):null;if(i&&i.validate())return i}return null}),i=n.compact(i)),d.isNonEmptyArray(i)&&(v.hideScreenPopup(t("View:Popup:Contacts")),v.showScreenPopup(t("View:Popup:Compose"),[l.ComposeType.Empty,null,i]))},function(){return 0<this.contactsCheckedOrSelected().length}),this.clearCommand=d.createCommand(this,function(){this.search("")}),this.saveCommand=d.createCommand(this,function(){this.viewSaving(!0),this.viewSaveTrigger(l.SaveSettingsStep.Animate);var t=d.fakeMd5(),i=[];n.each(this.viewProperties(),function(e){e.type()&&""!==d.trim(e.value())&&i.push([e.type(),e.value(),e.typeStr()])}),m.contactSave(function(i,s){var o=!1;e.viewSaving(!1),l.StorageResultType.Success===i&&s&&s.Result&&s.Result.RequestUid===t&&0<d.pInt(s.Result.ResultID)&&(""===e.viewID()&&e.viewID(d.pInt(s.Result.ResultID)),e.reloadContactList(),o=!0),n.delay(function(){e.viewSaveTrigger(o?l.SaveSettingsStep.TrueResult:l.SaveSettingsStep.FalseResult)},300),o&&(e.watchDirty(!1),n.delay(function(){e.viewSaveTrigger(l.SaveSettingsStep.Idle)},1e3))},t,this.viewID(),this.viewTags(),i)},function(){var e=this.viewHasNonEmptyRequaredProperties(),t=this.viewReadOnly();return!this.viewSaving()&&e&&!t}),this.syncCommand=d.createCommand(this,function(){var e=this;t("App:RainLoop").contactsSync(function(t,i){l.StorageResultType.Success===t&&i&&i.Result||s.alert(d.getNotification(i&&i.ErrorCode?i.ErrorCode:l.Notification.ContactsSyncError)),e.reloadContactList(!0)})},function(){return!this.contacts.syncing()&&!this.contacts.importing()}),this.bDropPageAfterDelete=!1,this.watchDirty=a.observable(!1),this.watchHash=a.observable(!1),this.viewHash=a.computed(function(){return""+e.viewTags()+"|"+n.map(e.viewProperties(),function(e){return e.value()}).join("")}),this.viewHash.subscribe(function(){!this.watchHash()||this.viewReadOnly()||this.watchDirty()||this.watchDirty(!0)},this),this.sDefaultKeyScope=l.KeyState.ContactList,this.contactTagsSource=n.bind(this.contactTagsSource,this),v.constructorEnd(this)}var s=t("window"),o=t("$"),n=t("_"),a=t("ko"),r=t("key"),l=t("Enums"),c=t("Consts"),u=t("Globals"),d=t("Utils"),p=t("LinkBuilder"),h=t("Selector"),g=t("Storage:RainLoop:Data"),m=t("Storage:RainLoop:Remote"),f=t("Model:Email"),b=t("Model:Contact"),S=t("Model:ContactTag"),y=t("Model:ContactProperty"),v=t("App:Knoin"),w=t("Knoin:AbstractViewModel");v.extendAsViewModel("PopupsContactsViewModel",i),i.prototype.contactTagsSource=function(e,i){t("App:RainLoop").getContactTagsAutocomplete(e.term,function(e){i(n.map(e,function(e){return e.toLine(!1)}))})},i.prototype.getPropertyPlceholder=function(e){var t="";switch(e){case l.ContactPropertyType.LastName:t="CONTACTS/PLACEHOLDER_ENTER_LAST_NAME";break;case l.ContactPropertyType.FirstName:t="CONTACTS/PLACEHOLDER_ENTER_FIRST_NAME";break;case l.ContactPropertyType.Nick:t="CONTACTS/PLACEHOLDER_ENTER_NICK_NAME"}return t},i.prototype.addNewProperty=function(e,t){this.viewProperties.push(new y(e,t||"","",!0,this.getPropertyPlceholder(e)))},i.prototype.addNewOrFocusProperty=function(e,t){var i=n.find(this.viewProperties(),function(t){return e===t.type()
});i?i.focused(!0):this.addNewProperty(e,t)},i.prototype.addNewTag=function(){this.viewTags.visibility(!0),this.viewTags.focusTrigger(!0)},i.prototype.addNewEmail=function(){this.addNewProperty(l.ContactPropertyType.Email,"Home")},i.prototype.addNewPhone=function(){this.addNewProperty(l.ContactPropertyType.Phone,"Mobile")},i.prototype.addNewWeb=function(){this.addNewProperty(l.ContactPropertyType.Web)},i.prototype.addNewNickname=function(){this.addNewOrFocusProperty(l.ContactPropertyType.Nick)},i.prototype.addNewNotes=function(){this.addNewOrFocusProperty(l.ContactPropertyType.Note)},i.prototype.addNewBirthday=function(){this.addNewOrFocusProperty(l.ContactPropertyType.Birthday)},i.prototype.exportVcf=function(){t("App:RainLoop").download(p.exportContactsVcf())},i.prototype.exportCsv=function(){t("App:RainLoop").download(p.exportContactsCsv())},i.prototype.initUploader=function(){if(this.importUploaderButton()){var e=new Jua({action:p.uploadContacts(),name:"uploader",queueSize:1,multipleSizeLimit:1,disableFolderDragAndDrop:!0,disableDragAndDrop:!0,disableMultiple:!0,disableDocumentDropPrevent:!0,clickElement:this.importUploaderButton()});e&&e.on("onStart",n.bind(function(){this.contacts.importing(!0)},this)).on("onComplete",n.bind(function(e,t,i){this.contacts.importing(!1),this.reloadContactList(),e&&t&&i&&i.Result||s.alert(d.i18n("CONTACTS/ERROR_IMPORT_FILE"))},this))}},i.prototype.removeCheckedOrSelectedContactsFromList=function(){var e=this,t=this.contacts,i=this.currentContact(),s=this.contacts().length,o=this.contactsCheckedOrSelected();0<o.length&&(n.each(o,function(t){i&&i.idContact===t.idContact&&(i=null,e.currentContact(null)),t.deleted(!0),s--}),0>=s&&(this.bDropPageAfterDelete=!0),n.delay(function(){n.each(o,function(e){t.remove(e)})},500))},i.prototype.deleteSelectedContacts=function(){0<this.contactsCheckedOrSelected().length&&(m.contactsDelete(n.bind(this.deleteResponse,this),this.contactsCheckedOrSelectedUids()),this.removeCheckedOrSelectedContactsFromList())},i.prototype.deleteResponse=function(e,t){500<(l.StorageResultType.Success===e&&t&&t.Time?d.pInt(t.Time):0)?this.reloadContactList(this.bDropPageAfterDelete):n.delay(function(e){return function(){e.reloadContactList(e.bDropPageAfterDelete)}}(this),500)},i.prototype.removeProperty=function(e){this.viewProperties.remove(e)},i.prototype.populateViewContact=function(e){var t="",i="",s="",o=[];this.watchHash(!1),this.emptySelection(!1),this.viewReadOnly(!1),this.viewTags(""),e&&(t=e.idContact,d.isNonEmptyArray(e.properties)&&n.each(e.properties,function(e){e&&e[0]&&(l.ContactPropertyType.LastName===e[0]?i=e[1]:l.ContactPropertyType.FirstName===e[0]?s=e[1]:o.push(new y(e[0],e[2]||"",e[1])))}),this.viewTags(e.tags),this.viewReadOnly(!!e.readOnly)),this.viewTags.focusTrigger.valueHasMutated(),this.viewTags.visibility(""!==this.viewTags()),o.unshift(new y(l.ContactPropertyType.LastName,"",i,!1,this.getPropertyPlceholder(l.ContactPropertyType.LastName))),o.unshift(new y(l.ContactPropertyType.FirstName,"",s,!e,this.getPropertyPlceholder(l.ContactPropertyType.FirstName))),this.viewID(t),this.viewProperties([]),this.viewProperties(o),this.watchDirty(!1),this.watchHash(!0)},i.prototype.reloadContactList=function(e){var t=this,i=(this.contactsPage()-1)*c.Defaults.ContactsPerPage;this.bDropPageAfterDelete=!1,(d.isUnd(e)?1:!e)||(this.contactsPage(1),i=0),this.contacts.loading(!0),m.contacts(function(e,i){var s=0,o=[],a=[];l.StorageResultType.Success===e&&i&&i.Result&&i.Result.List&&(d.isNonEmptyArray(i.Result.List)&&(o=n.map(i.Result.List,function(e){var t=new b;return t.parse(e)?t:null}),o=n.compact(o),s=d.pInt(i.Result.Count),s=s>0?s:0),d.isNonEmptyArray(i.Result.Tags)&&(a=n.map(i.Result.Tags,function(e){var t=new S;return t.parse(e)?t:null}),a=n.compact(a))),t.contactsCount(s),t.contacts(o),t.contacts.loading(!1),t.contactTags(a),t.viewClearSearch(""!==t.search())},i,c.Defaults.ContactsPerPage,this.search())},i.prototype.onBuild=function(e){this.oContentVisible=o(".b-list-content",e),this.oContentScrollable=o(".content",this.oContentVisible),this.selector.init(this.oContentVisible,this.oContentScrollable,l.KeyState.ContactList);var t=this;r("delete",l.KeyState.ContactList,function(){return t.deleteCommand(),!1}),e.on("click",".e-pagenator .e-page",function(){var e=a.dataFor(this);e&&(t.contactsPage(d.pInt(e.value)),t.reloadContactList())}),this.initUploader()},i.prototype.onShow=function(){v.routeOff(),this.reloadContactList(!0)},i.prototype.onHide=function(){v.routeOn(),this.currentContact(null),this.emptySelection(!0),this.search(""),this.contactsCount(0),this.contacts([])},e.exports=i}(t,e)},{$:26,"App:Knoin":33,"App:RainLoop":3,Consts:6,Enums:7,Globals:9,"Knoin:AbstractViewModel":36,LinkBuilder:11,"Model:Contact":40,"Model:ContactProperty":41,"Model:ContactTag":42,"Model:Email":43,Selector:13,"Storage:RainLoop:Data":70,"Storage:RainLoop:Remote":74,Utils:14,"View:Popup:Compose":88,"View:Popup:Contacts":89,_:31,key:27,ko:28,window:32}],90:[function(e,t){!function(e,t){"use strict";function i(){l.call(this,"Popups","PopupsFilter"),this.filter=s.observable(null),this.selectedFolderValue=s.observable(o.Values.UnuseOptionValue),this.folderSelectList=a.folderMenuForMove,this.defautOptionsAfterRender=n.defautOptionsAfterRender,r.constructorEnd(this)}var s=t("ko"),o=t("Consts"),n=t("Utils"),a=t("Storage:RainLoop:Data"),r=t("App:Knoin"),l=t("Knoin:AbstractViewModel");r.extendAsViewModel("PopupsFilterViewModel",i),i.prototype.clearPopup=function(){},i.prototype.onShow=function(e){this.clearPopup(),this.filter(e)},e.exports=i}(t,e)},{"App:Knoin":33,Consts:6,"Knoin:AbstractViewModel":36,"Storage:RainLoop:Data":70,Utils:14,ko:28}],91:[function(e,t){!function(e,t){"use strict";function i(){u.call(this,"Popups","PopupsFolderClear"),this.selectedFolder=s.observable(null),this.clearingProcess=s.observable(!1),this.clearingError=s.observable(""),this.folderFullNameForClear=s.computed(function(){var e=this.selectedFolder();return e?e.printableFullName():""},this),this.folderNameForClear=s.computed(function(){var e=this.selectedFolder();return e?e.localName():""},this),this.dangerDescHtml=s.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,i=this.selectedFolder();i&&(a.message(null),a.messageList([]),this.clearingProcess(!0),i.messageCountAll(0),i.messageCountUnread(0),r.setFolderHash(i.fullNameRaw,""),l.folderClear(function(i,s){e.clearingProcess(!1),o.StorageResultType.Success===i&&s&&s.Result?(t("App:RainLoop").reloadMessageList(!0),e.cancelCommand()):e.clearingError(s&&s.ErrorCode?n.getNotification(s.ErrorCode):n.getNotification(o.Notification.MailServerError))},i.fullNameRaw))},function(){var e=this.selectedFolder(),t=this.clearingProcess();return!t&&null!==e}),c.constructorEnd(this)}var s=t("ko"),o=t("Enums"),n=t("Utils"),a=t("Storage:RainLoop:Data"),r=t("Storage:RainLoop:Cache"),l=t("Storage:RainLoop:Remote"),c=t("App:Knoin"),u=t("Knoin:AbstractViewModel");c.extendAsViewModel("PopupsFolderClearViewModel",i),i.prototype.clearPopup=function(){this.clearingProcess(!1),this.selectedFolder(null)},i.prototype.onShow=function(e){this.clearPopup(),e&&this.selectedFolder(e)},e.exports=i}(t,e)},{"App:Knoin":33,"App:RainLoop":3,Enums:7,"Knoin:AbstractViewModel":36,"Storage:RainLoop:Cache":69,"Storage:RainLoop:Data":70,"Storage:RainLoop:Remote":74,Utils:14,ko:28}],92:[function(e,t){!function(e,t){"use strict";function i(){u.call(this,"Popups","PopupsFolderCreate"),a.initOnStartOrLangChange(function(){this.sNoParentText=a.i18n("POPUPS_CREATE_FOLDER/SELECT_NO_PARENT")},this),this.folderName=s.observable(""),this.folderName.focused=s.observable(!1),this.selectedParentValue=s.observable(n.Values.UnuseOptionValue),this.parentFolderSelectList=s.computed(function(){var e=[],t=null,i=null,s=r.folderList(),o=function(e){return e?e.isSystemFolder()?e.name()+" "+e.manageFolderSystemName():e.name():""};return e.push(["",this.sNoParentText]),""!==r.namespace&&(t=function(e){return r.namespace!==e.fullNameRaw.substr(0,r.namespace.length)}),a.folderListOptionsBuilder([],s,[],e,null,t,i,o)},this),this.createFolder=a.createCommand(this,function(){var e=this.selectedParentValue();""===e&&1<r.namespace.length&&(e=r.namespace.substr(0,r.namespace.length-1)),r.foldersCreating(!0),l.folderCreate(function(e,i){r.foldersCreating(!1),o.StorageResultType.Success===e&&i&&i.Result?t("App:RainLoop").folders():r.foldersListError(i&&i.ErrorCode?a.getNotification(i.ErrorCode):a.i18n("NOTIFICATIONS/CANT_CREATE_FOLDER"))},this.folderName(),e),this.cancelCommand()},function(){return this.simpleFolderNameValidation(this.folderName())}),this.defautOptionsAfterRender=a.defautOptionsAfterRender,c.constructorEnd(this)}var s=t("ko"),o=t("Enums"),n=t("Consts"),a=t("Utils"),r=t("Storage:RainLoop:Data"),l=t("Storage:RainLoop:Remote"),c=t("App:Knoin"),u=t("Knoin:AbstractViewModel");c.extendAsViewModel("PopupsFolderCreateViewModel",i),i.prototype.sNoParentText="",i.prototype.simpleFolderNameValidation=function(e){return/^[^\\\/]+$/g.test(a.trim(e))},i.prototype.clearPopup=function(){this.folderName(""),this.selectedParentValue(""),this.folderName.focused(!1)},i.prototype.onShow=function(){this.clearPopup()},i.prototype.onFocus=function(){this.folderName.focused(!0)},e.exports=i}(t,e)},{"App:Knoin":33,"App:RainLoop":3,Consts:6,Enums:7,"Knoin:AbstractViewModel":36,"Storage:RainLoop:Data":70,"Storage:RainLoop:Remote":74,Utils:14,ko:28}],93:[function(e,t){!function(e,t){"use strict";function i(){d.call(this,"Popups","PopupsFolderSystem"),a.initOnStartOrLangChange(function(){this.sChooseOnText=a.i18n("POPUPS_SYSTEM_FOLDERS/SELECT_CHOOSE_ONE"),this.sUnuseText=a.i18n("POPUPS_SYSTEM_FOLDERS/SELECT_UNUSE_NAME")},this),this.notification=s.observable(""),this.folderSelectList=s.computed(function(){return a.folderListOptionsBuilder([],l.folderList(),l.folderListSystemNames(),[["",this.sChooseOnText],[n.Values.UnuseOptionValue,this.sUnuseText]])},this);var e=this,t=null,i=null;this.sentFolder=l.sentFolder,this.draftFolder=l.draftFolder,this.spamFolder=l.spamFolder,this.trashFolder=l.trashFolder,this.archiveFolder=l.archiveFolder,t=_.debounce(function(){r.settingsSet("SentFolder",e.sentFolder()),r.settingsSet("DraftFolder",e.draftFolder()),r.settingsSet("SpamFolder",e.spamFolder()),r.settingsSet("TrashFolder",e.trashFolder()),r.settingsSet("ArchiveFolder",e.archiveFolder()),c.saveSystemFolders(a.emptyFunction,{SentFolder:e.sentFolder(),DraftFolder:e.draftFolder(),SpamFolder:e.spamFolder(),TrashFolder:e.trashFolder(),ArchiveFolder:e.archiveFolder(),NullFolder:"NullFolder"})},1e3),i=function(){r.settingsSet("SentFolder",e.sentFolder()),r.settingsSet("DraftFolder",e.draftFolder()),r.settingsSet("SpamFolder",e.spamFolder()),r.settingsSet("TrashFolder",e.trashFolder()),r.settingsSet("ArchiveFolder",e.archiveFolder()),t()},this.sentFolder.subscribe(i),this.draftFolder.subscribe(i),this.spamFolder.subscribe(i),this.trashFolder.subscribe(i),this.archiveFolder.subscribe(i),this.defautOptionsAfterRender=a.defautOptionsAfterRender,u.constructorEnd(this)}var s=t("ko"),o=t("Enums"),n=t("Consts"),a=t("Utils"),r=t("Storage:Settings"),l=t("Storage:RainLoop:Data"),c=t("Storage:RainLoop:Remote"),u=t("App:Knoin"),d=t("Knoin:AbstractViewModel");u.extendAsViewModel("PopupsFolderSystemViewModel",i),i.prototype.sChooseOnText="",i.prototype.sUnuseText="",i.prototype.onShow=function(e){var t="";switch(e=a.isUnd(e)?o.SetSystemFoldersNotification.None:e){case o.SetSystemFoldersNotification.Sent:t=a.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SENT");break;case o.SetSystemFoldersNotification.Draft:t=a.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_DRAFTS");break;case o.SetSystemFoldersNotification.Spam:t=a.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SPAM");break;case o.SetSystemFoldersNotification.Trash:t=a.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_TRASH");break;case o.SetSystemFoldersNotification.Archive:t=a.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_ARCHIVE")}this.notification(t)},e.exports=i}(t,e)},{"App:Knoin":33,Consts:6,Enums:7,"Knoin:AbstractViewModel":36,"Storage:RainLoop:Data":70,"Storage:RainLoop:Remote":74,"Storage:Settings":75,Utils:14,ko:28}],94:[function(e,t){!function(e,t){"use strict";function i(){c.call(this,"Popups","PopupsIdentity"),this.id="",this.edit=s.observable(!1),this.owner=s.observable(!1),this.email=s.observable("").validateEmail(),this.email.focused=s.observable(!1),this.name=s.observable(""),this.name.focused=s.observable(!1),this.replyTo=s.observable("").validateSimpleEmail(),this.replyTo.focused=s.observable(!1),this.bcc=s.observable("").validateSimpleEmail(),this.bcc.focused=s.observable(!1),this.submitRequest=s.observable(!1),this.submitError=s.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),r.identityUpdate(_.bind(function(e,i){this.submitRequest(!1),o.StorageResultType.Success===e&&i?i.Result?(t("App:RainLoop").accountsAndIdentities(),this.cancelCommand()):i.ErrorCode&&this.submitError(n.getNotification(i.ErrorCode)):this.submitError(n.getNotification(o.Notification.UnknownError))},this),this.id,this.email(),this.name(),this.replyTo(),this.bcc()),!0)},function(){return!this.submitRequest()}),this.label=s.computed(function(){return n.i18n("POPUPS_IDENTITIES/"+(this.edit()?"TITLE_UPDATE_IDENTITY":"TITLE_ADD_IDENTITY"))},this),this.button=s.computed(function(){return n.i18n("POPUPS_IDENTITIES/"+(this.edit()?"BUTTON_UPDATE_IDENTITY":"BUTTON_ADD_IDENTITY"))},this),a.constructorEnd(this)}var s=t("ko"),o=t("Enums"),n=t("Utils"),a=t("App:Knoin"),r=t("Storage:RainLoop:Remote"),l=t("Storage:RainLoop:Data"),c=t("Knoin:AbstractViewModel");a.extendAsViewModel("PopupsIdentityViewModel",i),i.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("")},i.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()))},i.prototype.onFocus=function(){this.owner()||this.email.focused(!0)},e.exports=i}(t,e)},{"App:Knoin":33,"App:RainLoop":3,Enums:7,"Knoin:AbstractViewModel":36,"Storage:RainLoop:Data":70,"Storage:RainLoop:Remote":74,Utils:14,ko:28}],95:[function(e,t){!function(e,t){"use strict";function i(){r.call(this,"Popups","PopupsKeyboardShortcutsHelp"),this.sDefaultKeyScope=n.KeyState.PopupKeyboardShortcutsHelp,a.constructorEnd(this)}var s=t("_"),o=t("key"),n=t("Enums"),a=t("App:Knoin"),r=t("Knoin:AbstractViewModel");a.extendAsViewModel("PopupsKeyboardShortcutsHelpViewModel",i),i.prototype.onBuild=function(e){o("tab, shift+tab, left, right",n.KeyState.PopupKeyboardShortcutsHelp,s.bind(function(t,i){if(t&&i){var s=e.find(".nav.nav-tabs > li"),o=i&&("tab"===i.shortcut||"right"===i.shortcut),n=s.index(s.filter(".active"));return!o&&n>0?n--:o&&n<s.length-1?n++:n=o?0:s.length-1,s.eq(n).find('a[data-toggle="tab"]').tab("show"),!1}},this))},e.exports=i}(t,e)},{"App:Knoin":33,Enums:7,"Knoin:AbstractViewModel":36,_:31,key:27}],96:[function(e,t){!function(e,t){"use strict";function i(){l.call(this,"Popups","PopupsLanguages"),this.exp=o.observable(!1),this.languages=o.computed(function(){return s.map(a.languages(),function(e){return{key:e,selected:o.observable(!1),fullName:n.convertLangName(e)}})}),a.mainLanguage.subscribe(function(){this.resetMainLanguage()},this),r.constructorEnd(this)}var s=t("_"),o=t("ko"),n=t("Utils"),a=t("Storage:RainLoop:Data"),r=t("App:Knoin"),l=t("Knoin:AbstractViewModel");r.extendAsViewModel("PopupsLanguagesViewModel",i),i.prototype.languageEnName=function(e){return n.convertLangName(e,!0)},i.prototype.resetMainLanguage=function(){var e=a.mainLanguage();s.each(this.languages(),function(t){t.selected(t.key===e)})},i.prototype.onShow=function(){this.exp(!0),this.resetMainLanguage()},i.prototype.onHide=function(){this.exp(!1)},i.prototype.changeLanguage=function(e){a.mainLanguage(e),this.cancelCommand()},e.exports=i}(t,e)},{"App:Knoin":33,"Knoin:AbstractViewModel":36,"Storage:RainLoop:Data":70,Utils:14,_:31,ko:28}],97:[function(e,t){!function(e,t){"use strict";function i(){c.call(this,"Popups","PopupsNewOpenPgpKey"),this.email=n.observable(""),this.email.focus=n.observable(""),this.email.error=n.observable(!1),this.name=n.observable(""),this.password=n.observable(""),this.keyBitLength=n.observable(2048),this.submitRequest=n.observable(!1),this.email.subscribe(function(){this.email.error(!1)},this),this.generateOpenPgpKeyCommand=a.createCommand(this,function(){var e=this,i="",n=null,l=r.openpgpKeyring;return this.email.error(""===a.trim(this.email())),!l||this.email.error()?!1:(i=this.email(),""!==this.name()&&(i=this.name()+" <"+i+">"),this.submitRequest(!0),o.delay(function(){n=s.openpgp.generateKeyPair({userId:i,numBits:a.pInt(e.keyBitLength()),passphrase:a.trim(e.password())}),n&&n.privateKeyArmored&&(l.privateKeys.importKey(n.privateKeyArmored),l.publicKeys.importKey(n.publicKeyArmored),l.store(),t("App:RainLoop").reloadOpenPgpKeys(),a.delegateRun(e,"cancelCommand")),e.submitRequest(!1)},100),!0)}),l.constructorEnd(this)}var s=t("window"),o=t("_"),n=t("ko"),a=t("Utils"),r=t("Storage:RainLoop:Data"),l=t("App:Knoin"),c=t("Knoin:AbstractViewModel");l.extendAsViewModel("PopupsNewOpenPgpKeyViewModel",i),i.prototype.clearPopup=function(){this.name(""),this.password(""),this.email(""),this.email.error(!1),this.keyBitLength(2048)},i.prototype.onShow=function(){this.clearPopup()},i.prototype.onFocus=function(){this.email.focus(!0)},e.exports=i}(t,e)},{"App:Knoin":33,"App:RainLoop":3,"Knoin:AbstractViewModel":36,"Storage:RainLoop:Data":70,Utils:14,_:31,ko:28,window:32}],98:[function(e,t){!function(e,t){"use strict";function i(){l.call(this,"Popups","PopupsTwoFactorTest");var e=this;this.code=s.observable(""),this.code.focused=s.observable(!1),this.code.status=s.observable(null),this.testing=s.observable(!1),this.testCode=n.createCommand(this,function(){this.testing(!0),a.testTwoFactor(function(t,i){e.testing(!1),e.code.status(o.StorageResultType.Success===t&&i&&i.Result?!0:!1)},this.code())},function(){return""!==this.code()&&!this.testing()}),r.constructorEnd(this)}var s=t("ko"),o=t("Enums"),n=t("Utils"),a=t("Storage:RainLoop:Remote"),r=t("App:Knoin"),l=t("Knoin:AbstractViewModel");r.extendAsViewModel("PopupsTwoFactorTestViewModel",i),i.prototype.clearPopup=function(){this.code(""),this.code.focused(!1),this.code.status(null),this.testing(!1)},i.prototype.onShow=function(){this.clearPopup()},i.prototype.onFocus=function(){this.code.focused(!0)},e.exports=i}(t,e)},{"App:Knoin":33,Enums:7,"Knoin:AbstractViewModel":36,"Storage:RainLoop:Remote":74,Utils:14,ko:28}],99:[function(e,t){!function(e,t){"use strict";function i(){a.call(this,"Popups","PopupsViewOpenPgpKey"),this.key=s.observable(""),this.keyDom=s.observable(null),n.constructorEnd(this)}var s=t("ko"),o=t("Utils"),n=t("App:Knoin"),a=t("Knoin:AbstractViewModel");n.extendAsViewModel("PopupsViewOpenPgpKeyViewModel",i),i.prototype.clearPopup=function(){this.key("")},i.prototype.selectKey=function(){var e=this.keyDom();e&&o.selectElement(e)},i.prototype.onShow=function(e){this.clearPopup(),e&&this.key(e.armor)},e.exports=i}(t,e)},{"App:Knoin":33,"Knoin:AbstractViewModel":36,Utils:14,ko:28}],100:[function(e,t){!function(e,t){"use strict";function i(e){a.call(this,"Left","SettingsMenu"),this.leftPanelDisabled=o.leftPanelDisabled,this.menu=e.menu,n.constructorEnd(this)}var s=t("LinkBuilder"),o=t("Globals"),n=t("App:Knoin"),a=t("Knoin:AbstractViewModel");n.extendAsViewModel("SettingsMenuViewModel",i),i.prototype.link=function(e){return s.settings(e)},i.prototype.backToMailBoxClick=function(){n.setHash(s.inbox())},e.exports=i}(t,e)},{"App:Knoin":33,Globals:9,"Knoin:AbstractViewModel":36,LinkBuilder:11}],101:[function(e,t){!function(e,t){"use strict";function i(){l.call(this,"Right","SettingsPane"),r.constructorEnd(this)}var s=t("key"),o=t("Enums"),n=t("LinkBuilder"),a=t("Storage:RainLoop:Data"),r=t("App:Knoin"),l=t("Knoin:AbstractViewModel");r.extendAsViewModel("SettingsPaneViewModel",i),i.prototype.onBuild=function(){var e=this;s("esc",o.KeyState.Settings,function(){e.backToMailBoxClick()})},i.prototype.onShow=function(){a.message(null)},i.prototype.backToMailBoxClick=function(){r.setHash(n.inbox())},e.exports=i}(t,e)},{"App:Knoin":33,Enums:7,"Knoin:AbstractViewModel":36,LinkBuilder:11,"Storage:RainLoop:Data":70,key:27}],102:[function(e,t){!function(e,t){"use strict";function i(){o.call(this),s.constructorEnd(this)}var s=t("App:Knoin"),o=t("View:RainLoop:AbstractSystemDropDown");s.extendAsViewModel("SettingsSystemDropDownViewModel",i,o),e.exports=i}(t,e)},{"App:Knoin":33,"View:RainLoop:AbstractSystemDropDown":77}]},{},[1]);