mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 04:29:21 +03:00
11 lines
No EOL
324 KiB
JavaScript
11 lines
No EOL
324 KiB
JavaScript
!function e(t,s,o){function i(r,a){if(!s[r]){if(!t[r]){var l="function"==typeof require&&require;if(!a&&l)return l(r,!0);if(n)return n(r,!0);var c=new Error("Cannot find module '"+r+"'");throw c.code="MODULE_NOT_FOUND",c}var u=s[r]={exports:{}};t[r][0].call(u.exports,function(e){var s=t[r][1][e];return i(s?s:e)},u,u.exports,e,t,s,o)}return s[r].exports}for(var n="function"==typeof require&&require,r=0;r<o.length;r++)i(o[r]);return i}({1:[function(e){"use strict";var t=e("./Boots/Boot.js");t(e("./Boots/RainLoopApp.js"))},{"./Boots/Boot.js":3,"./Boots/RainLoopApp.js":4}],2:[function(e,t){!function(t){"use strict";function s(e){m.call(this),this.isLocalAutocomplete=!0,this.iframe=o('<iframe style="display:none" src="javascript:;" />').appendTo("body"),a.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():"",r.attr("class"),u.microtime()-c.now)}),l.on("keydown",function(e){e&&e.ctrlKey&&r.addClass("rl-ctrl-key-pressed")}).on("keyup",function(e){e&&!e.ctrlKey&&r.removeClass("rl-ctrl-key-pressed")})}var o=e("../External/jquery.js"),i=e("../External/underscore.js"),n=e("../External/window.js"),r=e("../External/$html.js"),a=e("../External/$window.js"),l=e("../External/$doc.js"),c=e("../Common/Globals.js"),u=e("../Common/Utils.js"),d=e("../Common/LinkBuilder.js"),p=e("../Common/Events.js"),h=e("../Storages/AppSettings.js"),m=e("../Knoin/KnoinAbstractBoot.js");i.extend(s.prototype,m.prototype),s.prototype.remote=function(){return null},s.prototype.data=function(){return null},s.prototype.setupSettings=function(){return!0},s.prototype.download=function(e){var t=null,s=null,o=n.navigator.userAgent.toLowerCase();return o&&(o.indexOf("chrome")>-1||o.indexOf("chrome")>-1)&&(s=n.document.createElement("a"),s.href=e,n.document.createEvent&&(t=n.document.createEvent("MouseEvents"),t&&t.initEvent&&s.dispatchEvent))?(t.initEvent("click",!0,!0),s.dispatchEvent(t),!0):(c.bMobileDevice?(n.open(e,"_self"),n.focus()):this.iframe.attr("src",e),!0)},s.prototype.setTitle=function(e){e=(u.isNormal(e)&&0<e.length?e+" - ":"")+h.settingsGet("Title")||"",n.document.title="_",n.document.title=e},s.prototype.loginAndLogoutReload=function(t,s){var o=e("../Knoin/Knoin.js"),r=u.pString(h.settingsGet("CustomLogoutLink")),a=!!h.settingsGet("InIframe");t=u.isUnd(t)?!1:!!t,s=u.isUnd(s)?!1:!!s,t&&s&&n.close&&n.close(),t&&""!==r&&n.location.href!==r?i.delay(function(){a&&n.parent?n.parent.location.href=r:n.location.href=r},100):(o.routeOff(),o.setHash(d.root(),!0),o.routeOff(),i.delay(function(){a&&n.parent?n.parent.location.reload():n.location.reload()},100))},s.prototype.historyBack=function(){n.history.back()},s.prototype.bootstart=function(){p.pub("rl.bootstart");var t=e("../External/ssm.js");u.initOnStartOrLangChange(function(){u.initNotificationLanguage()},null),i.delay(function(){u.windowResize()},1e3),t.addState({id:"mobile",maxWidth:767,onEnter:function(){r.addClass("ssm-state-mobile"),p.pub("ssm.mobile-enter")},onLeave:function(){r.removeClass("ssm-state-mobile"),p.pub("ssm.mobile-leave")}}),t.addState({id:"tablet",minWidth:768,maxWidth:999,onEnter:function(){r.addClass("ssm-state-tablet")},onLeave:function(){r.removeClass("ssm-state-tablet")}}),t.addState({id:"desktop",minWidth:1e3,maxWidth:1400,onEnter:function(){r.addClass("ssm-state-desktop")},onLeave:function(){r.removeClass("ssm-state-desktop")}}),t.addState({id:"desktop-large",minWidth:1400,onEnter:function(){r.addClass("ssm-state-desktop-large")},onLeave:function(){r.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){r.toggleClass("rl-left-panel-disabled",e)}),t.ready()},t.exports=s}(t)},{"../Common/Events.js":8,"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/$doc.js":16,"../External/$html.js":17,"../External/$window.js":18,"../External/jquery.js":26,"../External/ssm.js":30,"../External/underscore.js":31,"../External/window.js":32,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractBoot.js":34,"../Storages/AppSettings.js":68}],3:[function(e,t){!function(t){"use strict";var s=e("../External/window.js"),o=e("../External/underscore.js"),i=e("../External/jquery.js"),n=e("../External/$window.js"),r=e("../External/$html.js"),a=e("../Common/Globals.js"),l=e("../Common/Plugins.js"),c=e("../Common/Utils.js");t.exports=function(t){a.__RL=t,t.setupSettings(),l.__boot=t,l.__remote=t.remote(),l.__data=t.data(),r.addClass(a.bMobileDevice?"mobile":"no-mobile"),n.keydown(c.killCtrlAandS).keyup(c.killCtrlAandS),n.unload(function(){a.bUnload=!0}),r.on("click.dropdown.data-api",function(){c.detectDropdownVisibility()}),s.rl=s.rl||{},s.rl.addHook=l.addHook,s.rl.settingsGet=l.mainSettingsGet,s.rl.remoteRequest=l.remoteRequest,s.rl.pluginSettingsGet=l.settingsGet,s.rl.createCommand=c.createCommand,s.rl.EmailModel=e("../Models/EmailModel.js"),s.rl.Enums=e("../Common/Enums.js"),s.__RLBOOT=function(e){i(function(){s.rainloopTEMPLATES&&s.rainloopTEMPLATES[0]?(i("#rl-templates").html(s.rainloopTEMPLATES[0]),o.delay(function(){t.bootstart(),r.removeClass("no-js rl-booted-trigger").addClass("rl-booted")},50)):e(!1),s.__RLBOOT=null})}}}(t)},{"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/Plugins.js":12,"../Common/Utils.js":14,"../External/$html.js":17,"../External/$window.js":18,"../External/jquery.js":26,"../External/underscore.js":31,"../External/window.js":32,"../Models/EmailModel.js":43}],4:[function(e,t){!function(t){"use strict";function s(){P.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);var e=this;o.setInterval(function(){h.pub("interval.30s")},3e4),o.setInterval(function(){h.pub("interval.1m")},6e4),o.setInterval(function(){h.pub("interval.2m")},12e4),o.setInterval(function(){h.pub("interval.3m")},18e4),o.setInterval(function(){h.pub("interval.5m")},3e5),o.setInterval(function(){h.pub("interval.10m")},6e5),o.setTimeout(function(){o.setInterval(function(){h.pub("interval.10m-after5m")},6e5)},3e5),i.wakeUp(function(){y.jsVersion(function(t,s){a.StorageResultType.Success===t&&s&&!s.Result&&(o.parent&&e.settingsGet("InIframe")?o.parent.location.reload():o.location.reload())},e.settingsGet("Version"))},{},36e5),this.socialUsers=n.bind(this.socialUsers,this)}var o=e("../External/window.js"),i=e("../External/jquery.js"),n=e("../External/underscore.js"),r=e("../External/moment.js"),a=e("../Common/Enums.js"),l=e("../Common/Globals.js"),c=e("../Common/Consts.js"),u=e("../Common/Plugins.js"),d=e("../Common/Utils.js"),p=e("../Common/LinkBuilder.js"),h=e("../Common/Events.js"),m=e("../Knoin/Knoin.js"),g=e("../Storages/LocalStorage.js"),f=e("../Storages/AppSettings.js"),b=e("../Storages/WebMailDataStorage.js"),S=e("../Storages/WebMailCacheStorage.js"),y=e("../Storages/WebMailAjaxRemoteStorage.js"),v=e("../Models/EmailModel.js"),C=e("../Models/FolderModel.js"),w=e("../Models/MessageModel.js"),E=e("../Models/AccountModel.js"),A=e("../Models/IdentityModel.js"),j=e("../Models/OpenPgpKeyModel.js"),T=e("../ViewModels/Popups/PopupsAskViewModel.js"),F=e("../ViewModels/Popups/PopupsAskViewModel.js"),M=e("../ViewModels/Popups/PopupsComposeViewModel.js"),N=e("../Screens/MailBoxScreen.js"),R=e("../Screens/SettingsScreen.js"),L=e("../Screens/LoginScreen.js"),P=e("./AbstractApp.js");n.extend(s.prototype,P.prototype),s.prototype.remote=function(){return y},s.prototype.data=function(){return b},s.prototype.setupSettings=function(){var t=e("../Settings/SettingsGeneral.js"),s=e("../Settings/SettingsContacts.js"),o=e("../Settings/SettingsAccounts.js"),i=e("../Settings/SettingsIdentity.js"),n=e("../Settings/SettingsIdentities.js"),r=e("../Settings/SettingsFilters.js"),l=e("../Settings/SettingsSecurity.js"),c=e("../Settings/SettingsSocial.js"),u=e("../Settings/SettingsChangePassword.js"),d=e("../Settings/SettingsFolders.js"),p=e("../Settings/SettingsThemes.js"),h=e("../Settings/SettingsOpenPGP.js");return m.addSettingsViewModel(t,"SettingsGeneral","SETTINGS_LABELS/LABEL_GENERAL_NAME","general",!0),f.settingsGet("ContactsIsAllowed")&&m.addSettingsViewModel(s,"SettingsContacts","SETTINGS_LABELS/LABEL_CONTACTS_NAME","contacts"),f.capa(a.Capa.AdditionalAccounts)&&m.addSettingsViewModel(o,"SettingsAccounts","SETTINGS_LABELS/LABEL_ACCOUNTS_NAME","accounts"),f.capa(a.Capa.AdditionalIdentities)?m.addSettingsViewModel(n,"SettingsIdentities","SETTINGS_LABELS/LABEL_IDENTITIES_NAME","identities"):m.addSettingsViewModel(i,"SettingsIdentity","SETTINGS_LABELS/LABEL_IDENTITY_NAME","identity"),f.capa(a.Capa.Filters)&&m.addSettingsViewModel(r,"SettingsFilters","SETTINGS_LABELS/LABEL_FILTERS_NAME","filters"),f.capa(a.Capa.TwoFactor)&&m.addSettingsViewModel(l,"SettingsSecurity","SETTINGS_LABELS/LABEL_SECURITY_NAME","security"),f.settingsGet("AllowGoogleSocial")||f.settingsGet("AllowFacebookSocial")||f.settingsGet("AllowTwitterSocial")||m.addSettingsViewModel(c,"SettingsSocial","SETTINGS_LABELS/LABEL_SOCIAL_NAME","social"),f.settingsGet("ChangePasswordIsAllowed")&&m.addSettingsViewModel(u,"SettingsChangePassword","SETTINGS_LABELS/LABEL_CHANGE_PASSWORD_NAME","change-password"),m.addSettingsViewModel(d,"SettingsFolders","SETTINGS_LABELS/LABEL_FOLDERS_NAME","folders"),f.capa(a.Capa.Themes)&&m.addSettingsViewModel(p,"SettingsThemes","SETTINGS_LABELS/LABEL_THEMES_NAME","themes"),f.capa(a.Capa.OpenPGP)&&m.addSettingsViewModel(h,"SettingsOpenPGP","SETTINGS_LABELS/LABEL_OPEN_PGP_NAME","openpgp"),!0},s.prototype.reloadFlagsCurrentMessageListAndMessageFromCache=function(){n.each(b.messageList(),function(e){S.initMessageFlagsFromCache(e)}),S.initMessageFlagsFromCache(b.message())},s.prototype.reloadMessageList=function(e,t){var s=this,o=(b.messageListPage()-1)*b.messagesPerPage();(d.isUnd(t)?1:!t)||S.setFolderHash(b.currentFolderFullNameRaw(),""),(d.isUnd(e)?1:!e)||(b.messageListPage(1),o=0),b.messageListLoading(!0),y.messageList(function(e,t,o){a.StorageResultType.Success===e&&t&&t.Result?(b.messageListError(""),b.messageListLoading(!1),s.setMessageList(t,o)):a.StorageResultType.Unload===e?(b.messageListError(""),b.messageListLoading(!1)):a.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(),o,b.messagesPerPage(),b.messageListSearch())},s.prototype.recacheInboxMessageList=function(){y.messageList(d.emptyFunction,"INBOX",0,b.messagesPerPage(),"",!0)},s.prototype.reloadMessageListHelper=function(e){this.reloadMessageList(e)},s.prototype.contactsSync=function(e){var t=b.contacts;return t.importing()||t.syncing()||!b.enableContactsSync()||!b.allowContactsSync()?!1:(t.syncing(!0),y.contactsSync(function(s,o){t.syncing(!1),e&&e(s,o)}),!0)},s.prototype.messagesMoveTrigger=function(){var e=this,t=b.spamFolder();n.each(this.oMoveCache,function(s){var o=t===s.To,i=!o&&t===s.From&&"INBOX"===s.To;y.messagesMove(e.moveOrDeleteResponseHelper,s.From,s.To,s.Uid,o?"SPAM":i?"HAM":"")}),this.oMoveCache={}},s.prototype.messagesMoveHelper=function(e,t,s){var o="$$"+e+"$$"+t+"$$";this.oMoveCache[o]||(this.oMoveCache[o]={From:e,To:t,Uid:[]}),this.oMoveCache[o].Uid=n.union(this.oMoveCache[o].Uid,s),this.messagesMoveTrigger()},s.prototype.messagesCopyHelper=function(e,t,s){y.messagesCopy(this.moveOrDeleteResponseHelper,e,t,s)},s.prototype.messagesDeleteHelper=function(e,t){y.messagesDelete(this.moveOrDeleteResponseHelper,e,t)},s.prototype.moveOrDeleteResponseHelper=function(e,t){a.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,[a.Notification.CantMoveMessage,a.Notification.CantCopyMessage])&&o.alert(d.getNotification(t.ErrorCode))),this.reloadMessageListHelper(0===b.messageList().length),this.quotaDebounce())},s.prototype.deleteMessagesFromFolderWithoutCheck=function(e,t){this.messagesDeleteHelper(e,t),b.removeMessagesFromList(e,t)},s.prototype.deleteMessagesFromFolder=function(e,t,s,o){var i=this,n=null,r=null;switch(e){case a.FolderType.Spam:n=S.getFolderFromCacheList(b.spamFolder()),r=a.SetSystemFoldersNotification.Spam;break;case a.FolderType.NotSpam:n=S.getFolderFromCacheList("INBOX");break;case a.FolderType.Trash:n=S.getFolderFromCacheList(b.trashFolder()),r=a.SetSystemFoldersNotification.Trash;break;case a.FolderType.Archive:n=S.getFolderFromCacheList(b.archiveFolder()),r=a.SetSystemFoldersNotification.Archive}o=d.isUnd(o)?!0:!!o,o&&(a.FolderType.Spam===e&&c.Values.UnuseOptionValue===b.spamFolder()||a.FolderType.Trash===e&&c.Values.UnuseOptionValue===b.trashFolder()||a.FolderType.Archive===e&&c.Values.UnuseOptionValue===b.archiveFolder())&&(o=!1),!n&&o?m.showScreenPopup(T,[r]):o&&(a.FolderType.Trash!==e||t!==b.spamFolder()&&t!==b.trashFolder())?n&&(this.messagesMoveHelper(t,n.fullNameRaw,s),b.removeMessagesFromList(t,s,n.fullNameRaw)):m.showScreenPopup(F,[d.i18n("POPUPS_ASK/DESC_WANT_DELETE_MESSAGES"),function(){i.messagesDeleteHelper(t,s),b.removeMessagesFromList(t,s)}])},s.prototype.moveMessagesToFolder=function(e,t,s,o){if(e!==s&&d.isArray(t)&&0<t.length){var i=S.getFolderFromCacheList(e),n=S.getFolderFromCacheList(s);if(i&&n)return(d.isUnd(o)?1:!o)?this.messagesMoveHelper(i.fullNameRaw,n.fullNameRaw,t):this.messagesCopyHelper(i.fullNameRaw,n.fullNameRaw,t),b.removeMessagesFromList(i.fullNameRaw,t,n.fullNameRaw,o),!0}return!1},s.prototype.folders=function(e){b.foldersLoading(!0),y.folders(n.bind(function(t,s){b.foldersLoading(!1),a.StorageResultType.Success===t?(this.setFolders(s),e&&e(!0)):e&&e(!1)},this))},s.prototype.reloadOpenPgpKeys=function(){if(b.capaOpenPGP()){var e=[],t=new v,s=b.openpgpKeyring,o=s?s.getAllKeys():[];n.each(o,function(s,o){if(s&&s.primaryKey){var i=s.getPrimaryUser(),n=i&&i.user?i.user.userId.userid:s.users&&s.users[0]?s.users[0].userId.userid:"";t.clear(),t.mailsoParse(n),t.validate()&&e.push(new j(o,s.primaryKey.getFingerprint(),s.primaryKey.getKeyId().toHex().toLowerCase(),n,t.email,s.isPrivate(),s.armor()))}}),b.openpgpkeys(e)}},s.prototype.accountsAndIdentities=function(){b.accountsLoading(!0),b.identitiesLoading(!0),y.accountsAndIdentities(function(e,t){if(b.accountsLoading(!1),b.identitiesLoading(!1),a.StorageResultType.Success===e&&t.Result){var s=f.settingsGet("ParentEmail"),o=b.accountEmail();s=""===s?o:s,d.isArray(t.Result.Accounts)&&b.accounts(n.map(t.Result.Accounts,function(e){return new E(e,e!==s)})),d.isArray(t.Result.Identities)&&b.identities(n.map(t.Result.Identities,function(e){var t=d.pString(e.Id),s=d.pString(e.Email),i=new A(t,s,t!==o);return i.name(d.pString(e.Name)),i.replyTo(d.pString(e.ReplyTo)),i.bcc(d.pString(e.Bcc)),i}))}})},s.prototype.quota=function(){y.quota(function(e,t){a.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])))})},s.prototype.folderInformation=function(e,t){if(""!==d.trim(e)){var s=this;y.folderInformation(function(e,t){if(a.StorageResultType.Success===e&&t&&t.Result&&t.Result.Hash&&t.Result.Folder){var o=r().unix(),i=S.getFolderHash(t.Result.Folder),n=S.getFolderFromCacheList(t.Result.Folder),l=!1,c="",u=[],p=!1,h=null;if(n){if(n.interval=o,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&&s.reloadFlagsCurrentMessageListAndMessageFromCache()}b.initUidNextAndNewMessages(n.fullNameRaw,t.Result.UidNext,t.Result.NewMessages),t.Result.Hash!==i||""===i?n.fullNameRaw===b.currentFolderFullNameRaw()?s.reloadMessageList():"INBOX"===n.fullNameRaw&&s.recacheInboxMessageList():p&&n.fullNameRaw===b.currentFolderFullNameRaw()&&(u=b.messageList(),d.isNonEmptyArray(u)&&s.folderInformation(n.fullNameRaw,u))}}},e,t)}},s.prototype.folderInformationMultiply=function(e){e=d.isUnd(e)?!1:!!e;var t=this,s=r().unix(),o=b.getNextFolderNames(e);d.isNonEmptyArray(o)&&y.folderInformationMultiply(function(o,i){a.StorageResultType.Success===o&&i&&i.Result&&i.Result.List&&d.isNonEmptyArray(i.Result.List)&&(n.each(i.Result.List,function(e){var o=[],i=S.getFolderHash(e.Folder),n=S.getFolderFromCacheList(e.Folder),r=!1;n&&(n.interval=s,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)&&(r=!0),n.messageCountUnread(e.MessageUnseenCount)),r&&S.clearMessageFlagsFromCacheByFolder(n.fullNameRaw),e.Hash!==i||""===i?n.fullNameRaw===b.currentFolderFullNameRaw()&&t.reloadMessageList():r&&n.fullNameRaw===b.currentFolderFullNameRaw()&&(o=b.messageList(),d.isNonEmptyArray(o)&&t.folderInformation(n.fullNameRaw,o)))}),e&&t.folderInformationMultiply(!0))},o)},s.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)},s.prototype.googleConnect=function(){o.open(p.socialGoogle(),"Google","left=200,top=100,width=650,height=600,menubar=no,status=no,resizable=yes,scrollbars=yes")},s.prototype.twitterConnect=function(){o.open(p.socialTwitter(),"Twitter","left=200,top=100,width=650,height=350,menubar=no,status=no,resizable=yes,scrollbars=yes")},s.prototype.facebookConnect=function(){o.open(p.socialFacebook(),"Facebook","left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes")},s.prototype.socialUsers=function(e){e&&(b.googleActions(!0),b.facebookActions(!0),b.twitterActions(!0)),y.socialUsers(function(e,t){a.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)})},s.prototype.googleDisconnect=function(){b.googleActions(!0),y.googleDisconnect(this.socialUsers)},s.prototype.facebookDisconnect=function(){b.facebookActions(!0),y.facebookDisconnect(this.socialUsers)},s.prototype.twitterDisconnect=function(){b.twitterActions(!0),y.twitterDisconnect(this.socialUsers)},s.prototype.getAutocomplete=function(e,t){var s=[];y.suggestions(function(e,o){a.StorageResultType.Success===e&&o&&d.isArray(o.Result)?(s=n.map(o.Result,function(e){return e&&e[0]?new v(e[0],e[1]):null}),t(n.compact(s))):a.StorageResultType.Abort!==e&&t([])},e)},s.prototype.getContactTagsAutocomplete=function(e,t){t(n.filter(b.contactTags(),function(t){return t&&t.filterHelper(e)}))},s.prototype.setMessageList=function(e,t){if(e&&e.Result&&"Collection/MessageCollection"===e.Result["@Object"]&&e.Result["@Collection"]&&d.isArray(e.Result["@Collection"])){var s=null,i=0,n=0,l=0,c=0,u=[],p=r().unix(),h=b.staticMessageList,m=null,g=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)&&(s=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),i=0,n=e.Result["@Collection"].length;n>i;i++)m=e.Result["@Collection"][i],m&&"Object/Message"===m["@Object"]&&(g=h[i],g&&g.initByJson(m)||(g=w.newInstanceFromJson(m)),g&&(S.hasNewMessageAndRemoveFromCache(g.folderFullNameRaw,g.uid)&&5>=y&&(y++,g.newForAnimation(!0)),g.deleted(!1),t?S.initMessageFlagsFromCache(g):S.storeMessageFlagsToCache(g),g.lastInCollapsedThread(s&&-1<d.inArray(d.pInt(g.uid),s)?!0:!1),u.push(g)));b.messageListCount(l),b.messageListSearch(d.isNormal(e.Result.Search)?e.Result.Search:""),b.messageListPage(o.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:a.Notification.CantGetMessageList))},s.prototype.folderResponseParseRec=function(e,t){var s=this,o=0,i=0,n=null,r=null,a="",l=[],c=[];for(o=0,i=t.length;i>o;o++)n=t[o],n&&(a=n.FullNameRaw,r=S.getFolderFromCacheList(a),r||(r=C.newInstanceFromJson(n),r&&(S.setFolderToCacheList(a,r),S.setFolderFullNameRaw(r.fullNameHash,a))),r&&(r.collapsed(!s.isFolderExpanded(r.fullNameHash)),n.Extended&&(n.Extended.Hash&&S.setFolderHash(r.fullNameRaw,n.Extended.Hash),d.isNormal(n.Extended.MessageCount)&&r.messageCountAll(n.Extended.MessageCount),d.isNormal(n.Extended.MessageUnseenCount)&&r.messageCountUnread(n.Extended.MessageUnseenCount)),l=n.SubFolders,l&&"Collection/FolderCollection"===l["@Object"]&&l["@Collection"]&&d.isArray(l["@Collection"])&&r.subFolders(this.folderResponseParseRec(e,l["@Collection"])),c.push(r)));return c},s.prototype.setFolders=function(e){var t=[],s=!1,o=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),s=!0),b.sentFolder(o(f.settingsGet("SentFolder"))),b.draftFolder(o(f.settingsGet("DraftFolder"))),b.spamFolder(o(f.settingsGet("SpamFolder"))),b.trashFolder(o(f.settingsGet("TrashFolder"))),b.archiveFolder(o(f.settingsGet("ArchiveFolder"))),s&&y.saveSystemFolders(d.emptyFunction,{SentFolder:b.sentFolder(),DraftFolder:b.draftFolder(),SpamFolder:b.spamFolder(),TrashFolder:b.trashFolder(),ArchiveFolder:b.archiveFolder(),NullFolder:"NullFolder"}),g.set(a.ClientSideKeyName.FoldersLashHash,e.Result.FoldersHash))},s.prototype.isFolderExpanded=function(e){var t=g.get(a.ClientSideKeyName.ExpandedFolders);return n.isArray(t)&&-1!==n.indexOf(t,e)},s.prototype.setExpandedFolder=function(e,t){var s=g.get(a.ClientSideKeyName.ExpandedFolders);n.isArray(s)||(s=[]),t?(s.push(e),s=n.uniq(s)):s=n.without(s,e),g.set(a.ClientSideKeyName.ExpandedFolders,s)},s.prototype.initLayoutResizer=function(e,t,s){var o=60,n=155,r=i(e),a=i(t),l=g.get(s)||null,c=function(e){e&&(r.css({width:""+e+"px"}),a.css({left:""+e+"px"}))},u=function(e){if(e)r.resizable("disable"),c(o);else{r.resizable("enable");var t=d.pInt(g.get(s))||n;c(t>n?t:n)}},p=function(e,t){t&&t.size&&t.size.width&&(g.set(s,t.size.width),a.css({left:""+t.size.width+"px"}))};null!==l&&c(l>n?l:n),r.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)})},s.prototype.mailToHelper=function(e){if(e&&"mailto:"===e.toString().substr(0,7).toLowerCase()){e=e.toString().substr(7);var t={},s=null,i=e.replace(/\?.+$/,""),n=e.replace(/^[^\?]*\?/,"");return s=new v,s.parse(o.decodeURIComponent(i)),s&&s.email&&(t=d.simpleQueryParser(n),m.showScreenPopup(M,[a.ComposeType.Empty,null,[s],d.isUnd(t.subject)?null:d.pString(t.subject),d.isUnd(t.body)?null:d.plainToHtml(d.pString(t.body))])),!0}return!1},s.prototype.bootstart=function(){P.prototype.bootstart.call(this),b.populateDataOnStart();var e=this,t="",s=f.settingsGet("JsHash"),r=d.pInt(f.settingsGet("ContactsSyncInterval")),c=f.settingsGet("AllowGoogleSocial"),g=f.settingsGet("AllowFacebookSocial"),S=f.settingsGet("AllowTwitterSocial");d.initOnStartOrLangChange(function(){i.extend(!0,i.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),o.SimplePace&&(o.SimplePace.set(70),o.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(t){m.hideLoading(),t?(o.$LAB&&o.crypto&&o.crypto.getRandomValues&&f.capa(a.Capa.OpenPGP)?o.$LAB.script(o.openpgp?"":p.openPgpJs()).wait(function(){o.openpgp&&(b.openpgpKeyring=new o.openpgp.Keyring,b.capaOpenPGP(!0),h.pub("openpgp.init"),e.reloadOpenPgpKeys())}):b.capaOpenPGP(!1),m.startScreens([N,R]),(c||g||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()}),r=r>=5?r:20,r=320>=r?r:320,o.setInterval(function(){e.contactsSync()},6e4*r+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")&&o.navigator.registerProtocolHandler&&n.delay(function(){try{o.navigator.registerProtocolHandler("mailto",o.location.protocol+"//"+o.location.host+o.location.pathname+"?mailto&to=%s",""+(f.settingsGet("Title")||"RainLoop"))}catch(t){}f.settingsGet("MailToEmail")&&e.mailToHelper(f.settingsGet("MailToEmail"))},500)):(m.startScreens([L]),u.runHook("rl-start-login-screens"),h.pub("rl.bootstart-login-screens")),o.SimplePace&&o.SimplePace.set(100),l.bMobileDevice||n.defer(function(){e.initLayoutResizer("#rl-left","#rl-right",a.ClientSideKeyName.FolderListSize)})},this))):(t=d.pString(f.settingsGet("CustomLoginLink")),t?(m.routeOff(),m.setHash(p.root(),!0),m.routeOff(),n.defer(function(){o.location.href=t})):(m.hideLoading(),m.startScreens([L]),u.runHook("rl-start-login-screens"),h.pub("rl.bootstart-login-screens"),o.SimplePace&&o.SimplePace.set(100))),c&&(o["rl_"+s+"_google_service"]=function(){b.googleActions(!0),e.socialUsers()}),g&&(o["rl_"+s+"_facebook_service"]=function(){b.facebookActions(!0),e.socialUsers()}),S&&(o["rl_"+s+"_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")},t.exports=new s}(t)},{"../Common/Consts.js":6,"../Common/Enums.js":7,"../Common/Events.js":8,"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Plugins.js":12,"../Common/Utils.js":14,"../External/jquery.js":26,"../External/moment.js":29,"../External/underscore.js":31,"../External/window.js":32,"../Knoin/Knoin.js":33,"../Models/AccountModel.js":37,"../Models/EmailModel.js":43,"../Models/FolderModel.js":46,"../Models/IdentityModel.js":47,"../Models/MessageModel.js":48,"../Models/OpenPgpKeyModel.js":49,"../Screens/LoginScreen.js":51,"../Screens/MailBoxScreen.js":52,"../Screens/SettingsScreen.js":53,"../Settings/SettingsAccounts.js":54,"../Settings/SettingsChangePassword.js":55,"../Settings/SettingsContacts.js":56,"../Settings/SettingsFilters.js":57,"../Settings/SettingsFolders.js":58,"../Settings/SettingsGeneral.js":59,"../Settings/SettingsIdentities.js":60,"../Settings/SettingsIdentity.js":61,"../Settings/SettingsOpenPGP.js":62,"../Settings/SettingsSecurity.js":63,"../Settings/SettingsSocial.js":64,"../Settings/SettingsThemes.js":65,"../Storages/AppSettings.js":68,"../Storages/LocalStorage.js":69,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailCacheStorage.js":73,"../Storages/WebMailDataStorage.js":74,"../ViewModels/Popups/PopupsAskViewModel.js":84,"../ViewModels/Popups/PopupsComposeViewModel.js":86,"./AbstractApp.js":2}],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 s,o,i,n,r,a,l,c="",u=0;for(e=t._utf8_encode(e);u<e.length;)s=e.charCodeAt(u++),o=e.charCodeAt(u++),i=e.charCodeAt(u++),n=s>>2,r=(3&s)<<4|o>>4,a=(15&o)<<2|i>>6,l=63&i,isNaN(o)?a=l=64:isNaN(i)&&(l=64),c=c+this._keyStr.charAt(n)+this._keyStr.charAt(r)+this._keyStr.charAt(a)+this._keyStr.charAt(l);return c},decode:function(e){var s,o,i,n,r,a,l,c="",u=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");u<e.length;)n=this._keyStr.indexOf(e.charAt(u++)),r=this._keyStr.indexOf(e.charAt(u++)),a=this._keyStr.indexOf(e.charAt(u++)),l=this._keyStr.indexOf(e.charAt(u++)),s=n<<2|r>>4,o=(15&r)<<4|a>>2,i=(3&a)<<6|l,c+=String.fromCharCode(s),64!==a&&(c+=String.fromCharCode(o)),64!==l&&(c+=String.fromCharCode(i));return t._utf8_decode(c)},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");for(var t="",s=0,o=e.length,i=0;o>s;s++)i=e.charCodeAt(s),128>i?t+=String.fromCharCode(i):i>127&&2048>i?(t+=String.fromCharCode(i>>6|192),t+=String.fromCharCode(63&i|128)):(t+=String.fromCharCode(i>>12|224),t+=String.fromCharCode(i>>6&63|128),t+=String.fromCharCode(63&i|128));return t},_utf8_decode:function(e){for(var t="",s=0,o=0,i=0,n=0;s<e.length;)o=e.charCodeAt(s),128>o?(t+=String.fromCharCode(o),s++):o>191&&224>o?(i=e.charCodeAt(s+1),t+=String.fromCharCode((31&o)<<6|63&i),s+=2):(i=e.charCodeAt(s+1),n=e.charCodeAt(s+2),t+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&n),s+=3);return t}};e.exports=t}(t)},{}],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)},{}],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)},{}],8:[function(e,t){!function(t){"use strict";function s(){this.oSubs={}}var o=e("../External/underscore.js"),i=e("./Utils.js"),n=e("./Plugins.js");s.prototype.oSubs={},s.prototype.sub=function(e,t,s){return i.isUnd(this.oSubs[e])&&(this.oSubs[e]=[]),this.oSubs[e].push([t,s]),this},s.prototype.pub=function(e,t){return n.runHook("rl-pub",[e,t]),i.isUnd(this.oSubs[e])||o.each(this.oSubs[e],function(e){e[0]&&e[0].apply(e[1]||null,t||[])}),this},t.exports=new s}(t)},{"../External/underscore.js":31,"./Plugins.js":12,"./Utils.js":14}],9:[function(e,t){!function(t){"use strict";var s={},o=e("../External/window.js"),i=e("../External/ko.js"),n=e("../External/key.js"),r=e("../External/$html.js"),a=e("../Common/Enums.js");s.now=(new o.Date).getTime(),s.momentTrigger=i.observable(!0),s.dropdownVisibility=i.observable(!1).extend({rateLimit:0}),s.tooltipTrigger=i.observable(!1).extend({rateLimit:0}),s.langChangeTrigger=i.observable(!0),s.useKeyboardShortcuts=i.observable(!0),s.iAjaxErrorCount=0,s.iTokenErrorCount=0,s.iMessageBodyCacheCount=0,s.bUnload=!1,s.sUserAgent=(o.navigator.userAgent||"").toLowerCase(),s.bIsiOSDevice=-1<s.sUserAgent.indexOf("iphone")||-1<s.sUserAgent.indexOf("ipod")||-1<s.sUserAgent.indexOf("ipad"),s.bIsAndroidDevice=-1<s.sUserAgent.indexOf("android"),s.bMobileDevice=s.bIsiOSDevice||s.bIsAndroidDevice,s.bDisableNanoScroll=s.bMobileDevice,s.bAllowPdfPreview=!s.bMobileDevice,s.bAnimationSupported=!s.bMobileDevice&&r.hasClass("csstransitions"),s.bXMLHttpRequestSupported=!!o.XMLHttpRequest,s.sAnimationType="",s.__RL=null,s.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"},s.oHtmlEditorLangsMap={de:"de",es:"es",fr:"fr",hu:"hu",is:"is",it:"it",ko:"ko","ko-kr":"ko",lv:"lv",nl:"nl",no:"no",pl:"pl",pt:"pt","pt-pt":"pt","pt-br":"pt-br",ru:"ru",ro:"ro",zh:"zh","zh-cn":"zh-cn"},s.bAllowPdfPreview&&o.navigator&&o.navigator.mimeTypes&&(s.bAllowPdfPreview=!!_.find(o.navigator.mimeTypes,function(e){return e&&"application/pdf"===e.type})),s.oI18N=o.rainloopI18N||{},s.oNotificationI18N={},s.aBootstrapDropdowns=[],s.aViewModels={settings:[],"settings-removed":[],"settings-disabled":[]},s.leftPanelDisabled=i.observable(!1),s.popupVisibilityNames=i.observableArray([]),s.popupVisibility=i.computed(function(){return 0<s.popupVisibilityNames().length},this),s.keyScopeReal=i.observable(a.KeyState.All),s.keyScopeFake=i.observable(a.KeyState.All),s.keyScope=i.computed({owner:this,read:function(){return s.keyScopeFake()},write:function(e){a.KeyState.Menu!==e&&(n.filter=a.KeyState.Compose===e?function(){return s.useKeyboardShortcuts()}:function(e){if(s.useKeyboardShortcuts()){var t=e.target||e.srcElement,o=t?t.tagName:"";return o=o.toUpperCase(),!("INPUT"===o||"SELECT"===o||"TEXTAREA"===o||t&&"DIV"===o&&"editorHtmlArea"===t.className&&t.contentEditable)}return!1},s.keyScopeFake(e),s.dropdownVisibility()&&(e=a.KeyState.Menu)),s.keyScopeReal(e)}}),s.keyScopeReal.subscribe(function(e){n.setScope(e)}),s.dropdownVisibility.subscribe(function(e){e?(s.tooltipTrigger(!s.tooltipTrigger()),s.keyScope(a.KeyState.Menu)):a.KeyState.Menu===n.getScope()&&s.keyScope(s.keyScopeFake())}),t.exports=s}(t)},{"../Common/Enums.js":7,"../External/$html.js":17,"../External/key.js":27,"../External/ko.js":28,"../External/window.js":32}],10:[function(e,t){!function(t){"use strict";function s(){var t=e("../Storages/AppSettings.js");this.sBase="#/",this.sServer="./?",this.sVersion=t.settingsGet("Version"),this.sSpecSuffix=t.settingsGet("AuthAccountHash")||"0",this.sStaticPrefix=t.settingsGet("StaticPrefix")||"rainloop/v/"+this.sVersion+"/static/"}var o=e("../External/window.js"),i=e("./Utils.js");s.prototype.root=function(){return this.sBase},s.prototype.attachmentDownload=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/Download/"+e},s.prototype.attachmentPreview=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/View/"+e},s.prototype.attachmentPreviewAsPlain=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ViewAsPlain/"+e},s.prototype.upload=function(){return this.sServer+"/Upload/"+this.sSpecSuffix+"/"},s.prototype.uploadContacts=function(){return this.sServer+"/UploadContacts/"+this.sSpecSuffix+"/"},s.prototype.uploadBackground=function(){return this.sServer+"/UploadBackground/"+this.sSpecSuffix+"/"},s.prototype.append=function(){return this.sServer+"/Append/"+this.sSpecSuffix+"/"},s.prototype.change=function(e){return this.sServer+"/Change/"+this.sSpecSuffix+"/"+o.encodeURIComponent(e)+"/"},s.prototype.ajax=function(e){return this.sServer+"/Ajax/"+this.sSpecSuffix+"/"+e},s.prototype.messageViewLink=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ViewAsPlain/"+e},s.prototype.messageDownloadLink=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/Download/"+e},s.prototype.avatarLink=function(e){return this.sServer+"/Raw/0/Avatar/"+o.encodeURIComponent(e)+"/"},s.prototype.inbox=function(){return this.sBase+"mailbox/Inbox"},s.prototype.messagePreview=function(){return this.sBase+"mailbox/message-preview"},s.prototype.settings=function(e){var t=this.sBase+"settings";return i.isUnd(e)||""===e||(t+="/"+e),t},s.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},s.prototype.mailBox=function(e,t,s){t=i.isNormal(t)?i.pInt(t):1,s=i.pString(s);var o=this.sBase+"mailbox/";return""!==e&&(o+=encodeURI(e)),t>1&&(o=o.replace(/[\/]+$/,""),o+="/p"+t),""!==s&&(o=o.replace(/[\/]+$/,""),o+="/"+encodeURI(s)),o},s.prototype.phpInfo=function(){return this.sServer+"Info"},s.prototype.langLink=function(e){return this.sServer+"/Lang/0/"+encodeURI(e)+"/"+this.sVersion+"/"},s.prototype.exportContactsVcf=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsVcf/"},s.prototype.exportContactsCsv=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsCsv/"},s.prototype.emptyContactPic=function(){return this.sStaticPrefix+"css/images/empty-contact.png"},s.prototype.sound=function(e){return this.sStaticPrefix+"sounds/"+e},s.prototype.themePreviewLink=function(e){var t="rainloop/v/"+this.sVersion+"/";return"@custom"===e.substr(-7)&&(e=i.trim(e.substring(0,e.length-7)),t=""),t+"themes/"+encodeURI(e)+"/images/preview.png"},s.prototype.notificationMailIcon=function(){return this.sStaticPrefix+"css/images/icom-message-notification.png"},s.prototype.openPgpJs=function(){return this.sStaticPrefix+"js/openpgp.min.js"},s.prototype.socialGoogle=function(){return this.sServer+"SocialGoogle"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},s.prototype.socialTwitter=function(){return this.sServer+"SocialTwitter"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},s.prototype.socialFacebook=function(){return this.sServer+"SocialFacebook"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},t.exports=new s}(t)},{"../External/window.js":32,"../Storages/AppSettings.js":68,"./Utils.js":14}],11:[function(e,t){!function(t){"use strict";function s(e,t,s,o){this.editor=null,this.iBlurTimer=0,this.fOnBlur=t||null,this.fOnReady=s||null,this.fOnModeChange=o||null,this.$element=$(e),this.resize=i.throttle(i.bind(this.resize,this),100),this.init()}var o=e("../External/window.js"),i=e("../External/underscore.js"),n=e("./Globals.js"),r=e("../Storages/AppSettings.js");s.prototype.blurTrigger=function(){if(this.fOnBlur){var e=this;o.clearTimeout(this.iBlurTimer),this.iBlurTimer=o.setTimeout(function(){e.fOnBlur()},200)}},s.prototype.focusTrigger=function(){this.fOnBlur&&o.clearTimeout(this.iBlurTimer)},s.prototype.isHtml=function(){return this.editor?"wysiwyg"===this.editor.mode:!1},s.prototype.checkDirty=function(){return this.editor?this.editor.checkDirty():!1},s.prototype.resetDirty=function(){this.editor&&this.editor.resetDirty()},s.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():""},s.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())},s.prototype.setHtml=function(e,t){this.editor&&(this.modeToggle(!0),this.editor.setData(e),t&&this.focus())},s.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()}},s.prototype.init=function(){if(this.$element&&this.$element[0]){var e=this,t=function(){var t=n.oHtmlEditorDefaultConfig,s=r.settingsGet("Language"),i=!!r.settingsGet("AllowHtmlEditorSourceButton");i&&t.toolbarGroups&&!t.toolbarGroups.__SourceInited&&(t.toolbarGroups.__SourceInited=!0,t.toolbarGroups.push({name:"document",groups:["mode","document","doctools"]})),t.enterMode=o.CKEDITOR.ENTER_BR,t.shiftEnterMode=o.CKEDITOR.ENTER_BR,t.language=n.oHtmlEditorLangsMap[s]||"en",o.CKEDITOR.env&&(o.CKEDITOR.env.isCompatible=!0),e.editor=o.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(o.CKEDITOR.CTRL+65,"selectAll"),e.fOnReady(),e.__resizable=!0,e.resize()})};o.CKEDITOR?t():o.__initEditor=t}},s.prototype.focus=function(){this.editor&&this.editor.focus()},s.prototype.blur=function(){this.editor&&this.editor.focusManager.blur(!0)},s.prototype.resize=function(){if(this.editor&&this.__resizable)try{this.editor.resize(this.$element.width(),this.$element.innerHeight())}catch(e){}},s.prototype.clear=function(e){this.setHtml("",e)},t.exports=s}(t)},{"../External/underscore.js":31,"../External/window.js":32,"../Storages/AppSettings.js":68,"./Globals.js":9}],12:[function(e,t){!function(t){"use strict";var s={__boot:null,__remote:null,__data:null},o=e("../External/underscore.js"),i=e("./Utils.js");s.oViewModelsHooks={},s.oSimpleHooks={},s.regViewModelHook=function(e,t){t&&(t.__hookName=e)},s.addHook=function(e,t){i.isFunc(t)&&(i.isArray(s.oSimpleHooks[e])||(s.oSimpleHooks[e]=[]),s.oSimpleHooks[e].push(t))},s.runHook=function(e,t){i.isArray(s.oSimpleHooks[e])&&(t=t||[],o.each(s.oSimpleHooks[e],function(e){e.apply(null,t)}))},s.mainSettingsGet=function(e){return s.__boot?s.__boot.settingsGet(e):null},s.remoteRequest=function(e,t,o,i,n,r){s.__remote&&s.__remote.defaultRequest(e,t,o,i,n,r)},s.settingsGet=function(e,t){var o=s.mainSettingsGet("Plugins");return o=o&&i.isUnd(o[e])?null:o[e],o?i.isUnd(o[t])?null:o[t]:null},t.exports=s}(t)},{"../External/underscore.js":31,"./Utils.js":14}],13:[function(e,t){!function(t){"use strict";function s(e,t,s,o,r,a){this.list=e,this.listChecked=n.computed(function(){return i.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=i.debounce(i.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()&&i.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=s,this.sItemSelectedSelector=o,this.sItemCheckedSelector=r,this.sItemFocusedSelector=a,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)&&i.each(e,function(e){if(e){var s=t.getItemUid(e);c.push(s),e.checked()&&u.push(s),null===d&&e.focused()&&(d=s),null===p&&e.selected()&&(p=s)}})},this,"beforeChange"),this.list.subscribe(function(e){var t=this,s=null,o=!1,n=[],r=d,a=!1,h=!1,m=0;this.selectedItemUseCallback=!1,this.focusedItem(null),this.selectedItem(null),l.isArray(e)&&(m=u.length,i.each(e,function(e){var s=t.getItemUid(e);n.push(s),null!==d&&d===s&&(t.focusedItem(e),d=null),m>0&&-1<l.inArray(s,u)&&(a=!0,e.checked(!0),m--),a||null===p||p!==s||(h=!0,t.selectedItem(e),p=null)}),this.selectedItemUseCallback=!0,a||h||!this.bAutoSelect||(t.focusedItem()?t.selectedItem(t.focusedItem()):0<e.length&&(null!==r&&(o=!1,r=i.find(c,function(e){return o&&-1<l.inArray(e,n)?e:(r===e&&(o=!0),!1)}),r&&(s=i.find(e,function(e){return r===t.getItemUid(e)}))),t.selectedItem(s||null),t.focusedItem(t.selectedItem())))),c=[],u=[],d=null,p=null},this)}var o=e("../External/jquery.js"),i=e("../External/underscore.js"),n=e("../External/ko.js"),r=e("../External/key.js"),a=e("./Enums.js"),l=e("./Utils.js");s.prototype.itemSelected=function(e){this.isListChecked()?e||(this.oCallbacks.onItemSelect||this.emptyFunction)(e||null):e&&(this.oCallbacks.onItemSelect||this.emptyFunction)(e)},s.prototype.goDown=function(e){this.newSelectPosition(a.EventKeyCode.Down,!1,e)},s.prototype.goUp=function(e){this.newSelectPosition(a.EventKeyCode.Up,!1,e)},s.prototype.init=function(e,t,s){if(this.oContentVisible=e,this.oContentScrollable=t,s=s||"all",this.oContentVisible&&this.oContentScrollable){var i=this;o(this.oContentVisible).on("selectstart",function(e){e&&e.preventDefault&&e.preventDefault()}).on("click",this.sItemSelector,function(e){i.actionClick(n.dataFor(this),e)}).on("click",this.sItemCheckedSelector,function(e){var t=n.dataFor(this);t&&(e&&e.shiftKey?i.actionClick(t,e):(i.focusedItem(t),t.checked(!t.checked())))}),r("enter",s,function(){return i.focusedItem()&&!i.focusedItem().selected()?(i.actionClick(i.focusedItem()),!1):!0}),r("ctrl+up, command+up, ctrl+down, command+down",s,function(){return!1}),r("up, shift+up, down, shift+down, home, end, pageup, pagedown, insert, space",s,function(e,t){if(e&&t&&t.shortcut){var s=0;switch(t.shortcut){case"up":case"shift+up":s=a.EventKeyCode.Up;break;case"down":case"shift+down":s=a.EventKeyCode.Down;break;case"insert":s=a.EventKeyCode.Insert;break;case"space":s=a.EventKeyCode.Space;break;case"home":s=a.EventKeyCode.Home;break;case"end":s=a.EventKeyCode.End;break;case"pageup":s=a.EventKeyCode.PageUp;break;case"pagedown":s=a.EventKeyCode.PageDown}if(s>0)return i.newSelectPosition(s,r.shift),!1}})}},s.prototype.autoSelect=function(e){this.bAutoSelect=!!e},s.prototype.getItemUid=function(e){var t="",s=this.oCallbacks.onItemGetUid||null;return s&&e&&(t=s(e)),t.toString()},s.prototype.newSelectPosition=function(e,t,s){var o=0,n=10,r=!1,l=!1,c=null,u=this.list(),d=u?u.length:0,p=this.focusedItem();if(d>0)if(p){if(p)if(a.EventKeyCode.Down===e||a.EventKeyCode.Up===e||a.EventKeyCode.Insert===e||a.EventKeyCode.Space===e)i.each(u,function(t){if(!l)switch(e){case a.EventKeyCode.Up:p===t?l=!0:c=t;break;case a.EventKeyCode.Down:case a.EventKeyCode.Insert:r?(c=t,l=!0):p===t&&(r=!0)}});else if(a.EventKeyCode.Home===e||a.EventKeyCode.End===e)a.EventKeyCode.Home===e?c=u[0]:a.EventKeyCode.End===e&&(c=u[u.length-1]);else if(a.EventKeyCode.PageDown===e){for(;d>o;o++)if(p===u[o]){o+=n,o=o>d-1?d-1:o,c=u[o];break}}else if(a.EventKeyCode.PageUp===e)for(o=d;o>=0;o--)if(p===u[o]){o-=n,o=0>o?0:o,c=u[o];break}}else a.EventKeyCode.Down===e||a.EventKeyCode.Insert===e||a.EventKeyCode.Space===e||a.EventKeyCode.Home===e||a.EventKeyCode.PageUp===e?c=u[0]:(a.EventKeyCode.Up===e||a.EventKeyCode.End===e||a.EventKeyCode.PageDown===e)&&(c=u[u.length-1]);c?(this.focusedItem(c),p&&(t?(a.EventKeyCode.Up===e||a.EventKeyCode.Down===e)&&p.checked(!p.checked()):(a.EventKeyCode.Insert===e||a.EventKeyCode.Space===e)&&p.checked(!p.checked())),!this.bAutoSelect&&!s||this.isListChecked()||a.EventKeyCode.Space===e||this.selectedItem(c),this.scrollToFocused()):p&&(!t||a.EventKeyCode.Up!==e&&a.EventKeyCode.Down!==e?(a.EventKeyCode.Insert===e||a.EventKeyCode.Space===e)&&p.checked(!p.checked()):p.checked(!p.checked()),this.focusedItem(p))},s.prototype.scrollToFocused=function(){if(!this.oContentVisible||!this.oContentScrollable)return!1;var e=20,t=o(this.sItemFocusedSelector,this.oContentScrollable),s=t.position(),i=this.oContentVisible.height(),n=t.outerHeight();return s&&(s.top<0||s.top+n>i)?(this.oContentScrollable.scrollTop(s.top<0?this.oContentScrollable.scrollTop()+s.top-e:this.oContentScrollable.scrollTop()+s.top-i+n+e),!0):!1},s.prototype.scrollToTop=function(e){return this.oContentVisible&&this.oContentScrollable?(e?this.oContentScrollable.scrollTop(0):this.oContentScrollable.stop().animate({scrollTop:0},200),!0):!1},s.prototype.eventClickFunction=function(e,t){var s=this.getItemUid(e),o=0,i=0,n=null,r="",a=!1,l=!1,c=[],u=!1;if(t&&t.shiftKey&&""!==s&&""!==this.sLastUid&&s!==this.sLastUid)for(c=this.list(),u=e.checked(),o=0,i=c.length;i>o;o++)n=c[o],r=this.getItemUid(n),a=!1,(r===this.sLastUid||r===s)&&(a=!0),a&&(l=!l),(l||a)&&n.checked(u);this.sLastUid=""===s?"":s},s.prototype.actionClick=function(e,t){if(e){var s=!0,o=this.getItemUid(e);t&&(!t.shiftKey||t.ctrlKey||t.altKey?!t.ctrlKey||t.shiftKey||t.altKey||(s=!1,this.focusedItem(e),this.selectedItem()&&e!==this.selectedItem()&&this.selectedItem().checked(!0),e.checked(!e.checked())):(s=!1,""===this.sLastUid&&(this.sLastUid=o),e.checked(!e.checked()),this.eventClickFunction(e,t),this.focusedItem(e))),s&&(this.focusedItem(e),this.selectedItem(e),this.scrollToFocused())}},s.prototype.on=function(e,t){this.oCallbacks[e]=t},t.exports=s}(t)},{"../External/jquery.js":26,"../External/key.js":27,"../External/ko.js":28,"../External/underscore.js":31,"./Enums.js":7,"./Utils.js":14}],14:[function(e,t){!function(t){"use strict";var s={},o=e("../External/jquery.js"),i=e("../External/underscore.js"),n=e("../External/ko.js"),r=e("../External/window.js"),a=e("../External/$window.js"),l=e("../External/$html.js"),c=e("../External/$div.js"),u=e("../External/$doc.js"),d=e("../External/NotificationClass.js"),p=e("./Enums.js"),h=e("./Consts.js"),m=e("./Globals.js");s.trim=o.trim,s.inArray=o.inArray,s.isArray=i.isArray,s.isFunc=i.isFunction,s.isUnd=i.isUndefined,s.isNull=i.isNull,s.emptyFunction=function(){},s.isNormal=function(e){return!s.isUnd(e)&&!s.isNull(e)},s.windowResize=i.debounce(function(e){s.isUnd(e)?a.resize():r.setTimeout(function(){a.resize()},e)},50),s.isPosNumeric=function(e,t){return s.isNormal(e)?(s.isUnd(t)?0:!t)?/^[1-9]+[0-9]*$/.test(e.toString()):/^[0-9]*$/.test(e.toString()):!1},s.pInt=function(e,t){var o=s.isNormal(e)&&""!==e?r.parseInt(e,10):t||0;return r.isNaN(o)?t||0:o},s.pString=function(e){return s.isNormal(e)?""+e:""},s.isNonEmptyArray=function(e){return s.isArray(e)&&0<e.length},s.simpleQueryParser=function(e){var t={},s=[],o=[],i=0,n=0;for(s=e.split("&"),i=0,n=s.length;n>i;i++)o=s[i].split("="),t[r.decodeURIComponent(o[0])]=r.decodeURIComponent(o[1]);return t},s.rsaEncode=function(e,t,o,i){if(r.crypto&&r.crypto.getRandomValues&&r.RSAKey&&t&&o&&i){var n=new r.RSAKey;if(n.setPublic(i,o),e=n.encrypt(s.fakeMd5()+":"+e+":"+s.fakeMd5()),!1!==e)return"rsa:"+t+":"+e}return!1},s.rsaEncode.supported=!!(r.crypto&&r.crypto.getRandomValues&&r.RSAKey),s.exportPath=function(e,t,o){for(var i=null,n=e.split("."),a=o||r;n.length&&(i=n.shift());)n.length||s.isUnd(t)?a=a[i]?a[i]:a[i]={}:a[i]=t},s.pImport=function(e,t,s){e[t]=s},s.pExport=function(e,t,o){return s.isUnd(e[t])?o:e[t]},s.encodeHtml=function(e){return s.isNormal(e)?e.toString().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):""},s.splitPlainText=function(e,t){var o="",i="",n=e,r=0,a=0;for(t=s.isUnd(t)?100:t;n.length>t;)i=n.substring(0,t),r=i.lastIndexOf(" "),a=i.lastIndexOf("\n"),-1!==a&&(r=a),-1===r&&(r=t),o+=i.substring(0,r)+"\n",n=n.substring(r+1);return o+n},s.timeOutAction=function(){var e={};return function(t,o,i){s.isUnd(e[t])&&(e[t]=0),r.clearTimeout(e[t]),e[t]=r.setTimeout(o,i)}}(),s.timeOutActionSecond=function(){var e={};return function(t,s,o){e[t]||(e[t]=r.setTimeout(function(){s(),e[t]=0},o))}}(),s.audio=function(){var e=!1;return function(t,s){if(!1===e)if(m.bIsiOSDevice)e=null;else{var o=!1,i=!1,n=r.Audio?new r.Audio:null;n&&n.canPlayType&&n.play?(o=""!==n.canPlayType('audio/mpeg; codecs="mp3"'),o||(i=""!==n.canPlayType('audio/ogg; codecs="vorbis"')),o||i?(e=n,e.preload="none",e.loop=!1,e.autoplay=!1,e.muted=!1,e.src=o?t:s):e=null):e=null}return e}}(),s.hos=function(e,t){return e&&r.Object&&r.Object.hasOwnProperty?r.Object.hasOwnProperty.call(e,t):!1},s.i18n=function(e,t,o){var i="",n=s.isUnd(m.oI18N[e])?s.isUnd(o)?e:o:m.oI18N[e];if(!s.isUnd(t)&&!s.isNull(t))for(i in t)s.hos(t,i)&&(n=n.replace("%"+i+"%",t[i]));return n},s.i18nToNode=function(e){i.defer(function(){o(".i18n",e).each(function(){var e=o(this),t="";t=e.data("i18n-text"),t?e.text(s.i18n(t)):(t=e.data("i18n-html"),t&&e.html(s.i18n(t)),t=e.data("i18n-placeholder"),t&&e.attr("placeholder",s.i18n(t)),t=e.data("i18n-title"),t&&e.attr("title",s.i18n(t)))})})},s.i18nReload=function(){r.rainloopI18N&&(m.oI18N=r.rainloopI18N||{},s.i18nToNode(u),m.langChangeTrigger(!m.langChangeTrigger())),r.rainloopI18N=null},s.initOnStartOrLangChange=function(e,t,s){e&&e.call(t),s?m.langChangeTrigger.subscribe(function(){e&&e.call(t),s.call(t)}):e&&m.langChangeTrigger.subscribe(e,t)},s.inFocus=function(){return r.document.activeElement?(s.isUnd(r.document.activeElement.__inFocusCache)&&(r.document.activeElement.__inFocusCache=o(r.document.activeElement).is("input,textarea,iframe,.cke_editable")),!!r.document.activeElement.__inFocusCache):!1},s.removeInFocus=function(){if(r.document&&r.document.activeElement&&r.document.activeElement.blur){var e=o(r.document.activeElement);e.is("input,textarea")&&r.document.activeElement.blur()}},s.removeSelection=function(){if(r&&r.getSelection){var e=r.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else r.document&&r.document.selection&&r.document.selection.empty&&r.document.selection.empty()},s.replySubjectAdd=function(e,t){e=s.trim(e.toUpperCase()),t=s.trim(t.replace(/[\s]+/," "));var o=0,i="",n=!1,r="",a=[],l=[],c="RE"===e,u="FWD"===e,d=!u;if(""!==t){for(n=!1,l=t.split(":"),o=0;o<l.length;o++)r=s.trim(l[o]),n||!/^(RE|FWD)$/i.test(r)&&!/^(RE|FWD)[\[\(][\d]+[\]\)]$/i.test(r)?(a.push(l[o]),n=!0):(c||(c=!!/^RE/i.test(r)),u||(u=!!/^FWD/i.test(r)));0<a.length&&(i=s.trim(a.join(":")))}return d?c=!1:u=!1,s.trim((d?"Re: ":"Fwd: ")+(c?"Re: ":"")+(u?"Fwd: ":"")+i)},s.fixLongSubject=function(e){var t=30,o=/^Re([\[\(]([\d]+)[\]\)]|):[\s]{0,3}Re([\[\(]([\d]+)[\]\)]|):/gi,i=null;e=s.trim(e.replace(/[\s]+/," "));do t--,i=o.exec(e),(!i||s.isUnd(i[0]))&&(i=null),i&&(e=e.replace(o,"Re:"));while(i||t>0);return e.replace(/[\s]+/," ")},s._replySubjectAdd_=function(e,t,o){var i=null,n=s.trim(t);return n=null===(i=new r.RegExp("^"+e+"[\\s]?\\:(.*)$","gi").exec(t))||s.isUnd(i[1])?null===(i=new r.RegExp("^("+e+"[\\s]?[\\[\\(]?)([\\d]+)([\\]\\)]?[\\s]?\\:.*)$","gi").exec(t))||s.isUnd(i[1])||s.isUnd(i[2])||s.isUnd(i[3])?e+": "+t:i[1]+(s.pInt(i[2])+1)+i[3]:e+"[2]: "+i[1],n=n.replace(/[\s]+/g," "),n=(s.isUnd(o)?!0:o)?s.fixLongSubject(n):n},s._fixLongSubject_=function(e){var t=0,o=null;e=s.trim(e.replace(/[\s]+/," "));do o=/^Re(\[([\d]+)\]|):[\s]{0,3}Re(\[([\d]+)\]|):/gi.exec(e),(!o||s.isUnd(o[0]))&&(o=null),o&&(t=0,t+=s.isUnd(o[2])?1:0+s.pInt(o[2]),t+=s.isUnd(o[4])?1:0+s.pInt(o[4]),e=e.replace(/^Re(\[[\d]+\]|):[\s]{0,3}Re(\[[\d]+\]|):/gi,"Re"+(t>0?"["+t+"]":"")+":"));while(o);return e=e.replace(/[\s]+/," ")},s.roundNumber=function(e,t){return r.Math.round(e*r.Math.pow(10,t))/r.Math.pow(10,t)},s.friendlySize=function(e){return e=s.pInt(e),e>=1073741824?s.roundNumber(e/1073741824,1)+"GB":e>=1048576?s.roundNumber(e/1048576,1)+"MB":e>=1024?s.roundNumber(e/1024,0)+"KB":e+"B"},s.log=function(e){r.console&&r.console.log&&r.console.log(e)},s.getNotification=function(e,t){return e=s.pInt(e),p.Notification.ClientViewError===e&&t?t:s.isUnd(m.oNotificationI18N[e])?"":m.oNotificationI18N[e]},s.initNotificationLanguage=function(){var e=m.oNotificationI18N||{};e[p.Notification.InvalidToken]=s.i18n("NOTIFICATIONS/INVALID_TOKEN"),e[p.Notification.AuthError]=s.i18n("NOTIFICATIONS/AUTH_ERROR"),e[p.Notification.AccessError]=s.i18n("NOTIFICATIONS/ACCESS_ERROR"),e[p.Notification.ConnectionError]=s.i18n("NOTIFICATIONS/CONNECTION_ERROR"),e[p.Notification.CaptchaError]=s.i18n("NOTIFICATIONS/CAPTCHA_ERROR"),e[p.Notification.SocialFacebookLoginAccessDisable]=s.i18n("NOTIFICATIONS/SOCIAL_FACEBOOK_LOGIN_ACCESS_DISABLE"),e[p.Notification.SocialTwitterLoginAccessDisable]=s.i18n("NOTIFICATIONS/SOCIAL_TWITTER_LOGIN_ACCESS_DISABLE"),e[p.Notification.SocialGoogleLoginAccessDisable]=s.i18n("NOTIFICATIONS/SOCIAL_GOOGLE_LOGIN_ACCESS_DISABLE"),e[p.Notification.DomainNotAllowed]=s.i18n("NOTIFICATIONS/DOMAIN_NOT_ALLOWED"),e[p.Notification.AccountNotAllowed]=s.i18n("NOTIFICATIONS/ACCOUNT_NOT_ALLOWED"),e[p.Notification.AccountTwoFactorAuthRequired]=s.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_REQUIRED"),e[p.Notification.AccountTwoFactorAuthError]=s.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_ERROR"),e[p.Notification.CouldNotSaveNewPassword]=s.i18n("NOTIFICATIONS/COULD_NOT_SAVE_NEW_PASSWORD"),e[p.Notification.CurrentPasswordIncorrect]=s.i18n("NOTIFICATIONS/CURRENT_PASSWORD_INCORRECT"),e[p.Notification.NewPasswordShort]=s.i18n("NOTIFICATIONS/NEW_PASSWORD_SHORT"),e[p.Notification.NewPasswordWeak]=s.i18n("NOTIFICATIONS/NEW_PASSWORD_WEAK"),e[p.Notification.NewPasswordForbidden]=s.i18n("NOTIFICATIONS/NEW_PASSWORD_FORBIDDENT"),e[p.Notification.ContactsSyncError]=s.i18n("NOTIFICATIONS/CONTACTS_SYNC_ERROR"),e[p.Notification.CantGetMessageList]=s.i18n("NOTIFICATIONS/CANT_GET_MESSAGE_LIST"),e[p.Notification.CantGetMessage]=s.i18n("NOTIFICATIONS/CANT_GET_MESSAGE"),e[p.Notification.CantDeleteMessage]=s.i18n("NOTIFICATIONS/CANT_DELETE_MESSAGE"),e[p.Notification.CantMoveMessage]=s.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),e[p.Notification.CantCopyMessage]=s.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),e[p.Notification.CantSaveMessage]=s.i18n("NOTIFICATIONS/CANT_SAVE_MESSAGE"),e[p.Notification.CantSendMessage]=s.i18n("NOTIFICATIONS/CANT_SEND_MESSAGE"),e[p.Notification.InvalidRecipients]=s.i18n("NOTIFICATIONS/INVALID_RECIPIENTS"),e[p.Notification.CantCreateFolder]=s.i18n("NOTIFICATIONS/CANT_CREATE_FOLDER"),e[p.Notification.CantRenameFolder]=s.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER"),e[p.Notification.CantDeleteFolder]=s.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER"),e[p.Notification.CantDeleteNonEmptyFolder]=s.i18n("NOTIFICATIONS/CANT_DELETE_NON_EMPTY_FOLDER"),e[p.Notification.CantSubscribeFolder]=s.i18n("NOTIFICATIONS/CANT_SUBSCRIBE_FOLDER"),e[p.Notification.CantUnsubscribeFolder]=s.i18n("NOTIFICATIONS/CANT_UNSUBSCRIBE_FOLDER"),e[p.Notification.CantSaveSettings]=s.i18n("NOTIFICATIONS/CANT_SAVE_SETTINGS"),e[p.Notification.CantSavePluginSettings]=s.i18n("NOTIFICATIONS/CANT_SAVE_PLUGIN_SETTINGS"),e[p.Notification.DomainAlreadyExists]=s.i18n("NOTIFICATIONS/DOMAIN_ALREADY_EXISTS"),e[p.Notification.CantInstallPackage]=s.i18n("NOTIFICATIONS/CANT_INSTALL_PACKAGE"),e[p.Notification.CantDeletePackage]=s.i18n("NOTIFICATIONS/CANT_DELETE_PACKAGE"),e[p.Notification.InvalidPluginPackage]=s.i18n("NOTIFICATIONS/INVALID_PLUGIN_PACKAGE"),e[p.Notification.UnsupportedPluginPackage]=s.i18n("NOTIFICATIONS/UNSUPPORTED_PLUGIN_PACKAGE"),e[p.Notification.LicensingServerIsUnavailable]=s.i18n("NOTIFICATIONS/LICENSING_SERVER_IS_UNAVAILABLE"),e[p.Notification.LicensingExpired]=s.i18n("NOTIFICATIONS/LICENSING_EXPIRED"),e[p.Notification.LicensingBanned]=s.i18n("NOTIFICATIONS/LICENSING_BANNED"),e[p.Notification.DemoSendMessageError]=s.i18n("NOTIFICATIONS/DEMO_SEND_MESSAGE_ERROR"),e[p.Notification.AccountAlreadyExists]=s.i18n("NOTIFICATIONS/ACCOUNT_ALREADY_EXISTS"),e[p.Notification.MailServerError]=s.i18n("NOTIFICATIONS/MAIL_SERVER_ERROR"),e[p.Notification.InvalidInputArgument]=s.i18n("NOTIFICATIONS/INVALID_INPUT_ARGUMENT"),e[p.Notification.UnknownNotification]=s.i18n("NOTIFICATIONS/UNKNOWN_ERROR"),e[p.Notification.UnknownError]=s.i18n("NOTIFICATIONS/UNKNOWN_ERROR")
|
||
},s.getUploadErrorDescByCode=function(e){var t="";switch(s.pInt(e)){case p.UploadErrorCode.FileIsTooBig:t=s.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG");break;case p.UploadErrorCode.FilePartiallyUploaded:t=s.i18n("UPLOAD/ERROR_FILE_PARTIALLY_UPLOADED");break;case p.UploadErrorCode.FileNoUploaded:t=s.i18n("UPLOAD/ERROR_NO_FILE_UPLOADED");break;case p.UploadErrorCode.MissingTempFolder:t=s.i18n("UPLOAD/ERROR_MISSING_TEMP_FOLDER");break;case p.UploadErrorCode.FileOnSaveingError:t=s.i18n("UPLOAD/ERROR_ON_SAVING_FILE");break;case p.UploadErrorCode.FileType:t=s.i18n("UPLOAD/ERROR_FILE_TYPE");break;default:t=s.i18n("UPLOAD/ERROR_UNKNOWN")}return t},s.delegateRun=function(e,t,o,n){e&&e[t]&&(n=s.pInt(n),0>=n?e[t].apply(e,s.isArray(o)?o:[]):i.delay(function(){e[t].apply(e,s.isArray(o)?o:[])},n))},s.killCtrlAandS=function(e){if(e=e||r.event,e&&e.ctrlKey&&!e.shiftKey&&!e.altKey){var t=e.target||e.srcElement,s=e.keyCode||e.which;if(s===p.EventKeyCode.S)return void e.preventDefault();if(t&&t.tagName&&t.tagName.match(/INPUT|TEXTAREA/i))return;s===p.EventKeyCode.A&&(r.getSelection?r.getSelection().removeAllRanges():r.document.selection&&r.document.selection.clear&&r.document.selection.clear(),e.preventDefault())}},s.createCommand=function(e,t,o){var i=t?function(){return i&&i.canExecute&&i.canExecute()&&t.apply(e,Array.prototype.slice.call(arguments)),!1}:function(){};return i.enabled=n.observable(!0),o=s.isUnd(o)?!0:o,i.canExecute=n.computed(s.isFunc(o)?function(){return i.enabled()&&o.call(e)}:function(){return i.enabled()&&!!o}),i},s.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),m.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(m.bMobileDevice||e===p.InterfaceAnimation.None)l.removeClass("rl-anim rl-anim-full").addClass("no-rl-anim"),m.sAnimationType=p.InterfaceAnimation.None;else switch(e){case p.InterfaceAnimation.Full:l.removeClass("no-rl-anim").addClass("rl-anim rl-anim-full"),m.sAnimationType=e;break;case p.InterfaceAnimation.Normal:l.removeClass("no-rl-anim rl-anim-full").addClass("rl-anim"),m.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 r.webkitNotifications&&r.webkitNotifications.checkPermission&&(t=r.webkitNotifications.checkPermission());return t}),e.useDesktopNotifications=n.computed({read:function(){return e.desktopNotifications()&&p.DesktopNotifications.Allowed===e.desktopNotificationsPermisions()},write:function(t){if(t){var s=e.desktopNotificationsPermisions();p.DesktopNotifications.Allowed===s?e.desktopNotifications(!0):p.DesktopNotifications.NotAllowed===s?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<s.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 o=e.themes();-1<s.inArray(t,o)?e.theme(t):0<o.length&&e.theme(o[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<s.inArray(s.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)},s.createMomentDate=function(e){return s.isUnd(e.moment)&&(e.moment=n.observable(moment())),n.computed(function(){m.momentTrigger();var e=this.moment();return 1970===e.year()?"":e.fromNow()},e)},s.createMomentShortDate=function(e){return n.computed(function(){var e="",t=moment(),o=this.moment(),i=this.momentDate();return e=1970===o.year()?"":4>=t.diff(o,"hours")?i:t.format("L")===o.format("L")?s.i18n("MESSAGE_LIST/TODAY_AT",{TIME:o.format("LT")}):t.clone().subtract("days",1).format("L")===o.format("L")?s.i18n("MESSAGE_LIST/YESTERDAY_AT",{TIME:o.format("LT")}):o.format(t.year()===o.year()?"D MMM.":"LL")},e)},s.initBlockquoteSwitcher=function(e){if(e){var t=o("blockquote:not(.rl-bq-switcher)",e).filter(function(){return 0===o(this).parent().closest("blockquote",e).length});t&&0<t.length&&t.each(function(){var e=o(this),t=e.height();(0===t||t>100)&&(e.addClass("rl-bq-switcher hidden-bq"),o('<span class="rlBlockquoteSwitcher"><i class="icon-ellipsis" /></span>').insertBefore(e).click(function(){e.toggleClass("hidden-bq"),s.windowResize()}).after("<br />").before("<br />"))})}},s.removeBlockquoteSwitcher=function(e){e&&(o(e).find("blockquote.rl-bq-switcher").each(function(){o(this).removeClass("rl-bq-switcher hidden-bq")}),o(e).find(".rlBlockquoteSwitcher").each(function(){o(this).remove()}))},s.toggleMessageBlockquote=function(e){e&&e.find(".rlBlockquoteSwitcher").click()},s.convertThemeName=function(e){return"@custom"===e.substr(-7)&&(e=s.trim(e.substring(0,e.length-7))),s.trim(e.replace(/[^a-zA-Z]+/g," ").replace(/([A-Z])/g," $1").replace(/[\s]+/g," "))},s.quoteName=function(e){return e.replace(/["]/g,'\\"')},s.microtime=function(){return(new Date).getTime()},s.convertLangName=function(e,t){return s.i18n("LANGS_NAMES"+(!0===t?"_EN":"")+"/LANG_"+e.toUpperCase().replace(/[^a-zA-Z0-9]+/,"_"),null,e)},s.fakeMd5=function(e){var t="",o="0123456789abcdefghijklmnopqrstuvwxyz";for(e=s.isUnd(e)?32:s.pInt(e);t.length<e;)t+=o.substr(r.Math.round(r.Math.random()*o.length),1);return t},s.md5=function(e){function t(e,t){return e<<t|e>>>32-t}function s(e,t){var s,o,i,n,r;return i=2147483648&e,n=2147483648&t,s=1073741824&e,o=1073741824&t,r=(1073741823&e)+(1073741823&t),s&o?2147483648^r^i^n:s|o?1073741824&r?3221225472^r^i^n:1073741824^r^i^n:r^i^n}function o(e,t,s){return e&t|~e&s}function i(e,t,s){return e&s|t&~s}function n(e,t,s){return e^t^s}function r(e,t,s){return t^(e|~s)}function a(e,i,n,r,a,l,c){return e=s(e,s(s(o(i,n,r),a),c)),s(t(e,l),i)}function l(e,o,n,r,a,l,c){return e=s(e,s(s(i(o,n,r),a),c)),s(t(e,l),o)}function c(e,o,i,r,a,l,c){return e=s(e,s(s(n(o,i,r),a),c)),s(t(e,l),o)}function u(e,o,i,n,a,l,c){return e=s(e,s(s(r(o,i,n),a),c)),s(t(e,l),o)}function d(e){for(var t,s=e.length,o=s+8,i=(o-o%64)/64,n=16*(i+1),r=Array(n-1),a=0,l=0;s>l;)t=(l-l%4)/4,a=l%4*8,r[t]=r[t]|e.charCodeAt(l)<<a,l++;return t=(l-l%4)/4,a=l%4*8,r[t]=r[t]|128<<a,r[n-2]=s<<3,r[n-1]=s>>>29,r}function p(e){var t,s,o="",i="";for(s=0;3>=s;s++)t=e>>>8*s&255,i="0"+t.toString(16),o+=i.substr(i.length-2,2);return o}function h(e){e=e.replace(/rn/g,"n");for(var t="",s=0;s<e.length;s++){var o=e.charCodeAt(s);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}var m,g,f,b,S,y,v,C,w,E=Array(),A=7,j=12,T=17,F=22,M=5,N=9,R=14,L=20,P=4,I=11,x=16,k=23,D=6,U=10,O=15,_=21;for(e=h(e),E=d(e),y=1732584193,v=4023233417,C=2562383102,w=271733878,m=0;m<E.length;m+=16)g=y,f=v,b=C,S=w,y=a(y,v,C,w,E[m+0],A,3614090360),w=a(w,y,v,C,E[m+1],j,3905402710),C=a(C,w,y,v,E[m+2],T,606105819),v=a(v,C,w,y,E[m+3],F,3250441966),y=a(y,v,C,w,E[m+4],A,4118548399),w=a(w,y,v,C,E[m+5],j,1200080426),C=a(C,w,y,v,E[m+6],T,2821735955),v=a(v,C,w,y,E[m+7],F,4249261313),y=a(y,v,C,w,E[m+8],A,1770035416),w=a(w,y,v,C,E[m+9],j,2336552879),C=a(C,w,y,v,E[m+10],T,4294925233),v=a(v,C,w,y,E[m+11],F,2304563134),y=a(y,v,C,w,E[m+12],A,1804603682),w=a(w,y,v,C,E[m+13],j,4254626195),C=a(C,w,y,v,E[m+14],T,2792965006),v=a(v,C,w,y,E[m+15],F,1236535329),y=l(y,v,C,w,E[m+1],M,4129170786),w=l(w,y,v,C,E[m+6],N,3225465664),C=l(C,w,y,v,E[m+11],R,643717713),v=l(v,C,w,y,E[m+0],L,3921069994),y=l(y,v,C,w,E[m+5],M,3593408605),w=l(w,y,v,C,E[m+10],N,38016083),C=l(C,w,y,v,E[m+15],R,3634488961),v=l(v,C,w,y,E[m+4],L,3889429448),y=l(y,v,C,w,E[m+9],M,568446438),w=l(w,y,v,C,E[m+14],N,3275163606),C=l(C,w,y,v,E[m+3],R,4107603335),v=l(v,C,w,y,E[m+8],L,1163531501),y=l(y,v,C,w,E[m+13],M,2850285829),w=l(w,y,v,C,E[m+2],N,4243563512),C=l(C,w,y,v,E[m+7],R,1735328473),v=l(v,C,w,y,E[m+12],L,2368359562),y=c(y,v,C,w,E[m+5],P,4294588738),w=c(w,y,v,C,E[m+8],I,2272392833),C=c(C,w,y,v,E[m+11],x,1839030562),v=c(v,C,w,y,E[m+14],k,4259657740),y=c(y,v,C,w,E[m+1],P,2763975236),w=c(w,y,v,C,E[m+4],I,1272893353),C=c(C,w,y,v,E[m+7],x,4139469664),v=c(v,C,w,y,E[m+10],k,3200236656),y=c(y,v,C,w,E[m+13],P,681279174),w=c(w,y,v,C,E[m+0],I,3936430074),C=c(C,w,y,v,E[m+3],x,3572445317),v=c(v,C,w,y,E[m+6],k,76029189),y=c(y,v,C,w,E[m+9],P,3654602809),w=c(w,y,v,C,E[m+12],I,3873151461),C=c(C,w,y,v,E[m+15],x,530742520),v=c(v,C,w,y,E[m+2],k,3299628645),y=u(y,v,C,w,E[m+0],D,4096336452),w=u(w,y,v,C,E[m+7],U,1126891415),C=u(C,w,y,v,E[m+14],O,2878612391),v=u(v,C,w,y,E[m+5],_,4237533241),y=u(y,v,C,w,E[m+12],D,1700485571),w=u(w,y,v,C,E[m+3],U,2399980690),C=u(C,w,y,v,E[m+10],O,4293915773),v=u(v,C,w,y,E[m+1],_,2240044497),y=u(y,v,C,w,E[m+8],D,1873313359),w=u(w,y,v,C,E[m+15],U,4264355552),C=u(C,w,y,v,E[m+6],O,2734768916),v=u(v,C,w,y,E[m+13],_,1309151649),y=u(y,v,C,w,E[m+4],D,4149444226),w=u(w,y,v,C,E[m+11],U,3174756917),C=u(C,w,y,v,E[m+2],O,718787259),v=u(v,C,w,y,E[m+9],_,3951481745),y=s(y,g),v=s(v,f),C=s(C,b),w=s(w,S);var V=p(y)+p(v)+p(C)+p(w);return V.toLowerCase()},s.convertPlainTextToHtml=function(e){return e.toString().replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/\r/g,"").replace(/\n/g,"<br />")},s.draggeblePlace=function(){return o('<div class="draggablePlace"><span class="text"></span> <i class="icon-copy icon-white visible-on-ctrl"></i><i class="icon-mail icon-white hidden-on-ctrl"></i></div>').appendTo("#rl-hidden")},s.defautOptionsAfterRender=function(e,t){t&&!s.isUnd(t.disabled)&&e&&o(e).toggleClass("disabled",t.disabled).prop("disabled",t.disabled)},s.windowPopupKnockout=function(e,t,i,a){var l=null,c=r.open(""),u="__OpenerApplyBindingsUid"+s.fakeMd5()+"__",d=o("#"+t);r[u]=function(){if(c&&c.document.body&&d&&d[0]){var t=o(c.document.body);o("#rl-content",t).html(d.html()),o("html",c.document).addClass("external "+o("html").attr("class")),s.i18nToNode(t),e&&o("#rl-content",t)[0]&&n.applyBindings(e,o("#rl-content",t)[0]),r[u]=null,a(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>'+s.encodeHtml(i)+'</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)},s.settingsSaveHelperFunction=function(e,t,o,n){return o=o||null,n=s.isUnd(n)?1e3:s.pInt(n),function(s,r,a,l,c){t.call(o,r&&r.Result?p.SaveSettingsStep.TrueResult:p.SaveSettingsStep.FalseResult),e&&e.call(o,s,r,a,l,c),i.delay(function(){t.call(o,p.SaveSettingsStep.Idle)},n)}},s.settingsSaveHelperSimpleFunction=function(e,t){return s.settingsSaveHelperFunction(null,e,t,1e3)},s.htmlToPlain=function(e){var t=0,s=0,i=0,n=0,r=0,a="",l=function(e){for(var t=100,s="",o="",i=e,n=0,r=0;i.length>t;)o=i.substring(0,t),n=o.lastIndexOf(" "),r=o.lastIndexOf("\n"),-1!==r&&(n=r),-1===n&&(n=t),s+=o.substring(0,n)+"\n",i=i.substring(n+1);return s+i},u=function(e){return e=l(o.trim(e)),e="> "+e.replace(/\n/gm,"\n> "),e.replace(/(^|\n)([> ]+)/gm,function(){return arguments&&2<arguments.length?arguments[1]+o.trim(arguments[2].replace(/[\s]/,""))+" ":""})},d=function(){if(arguments&&1<arguments.length){var e=o.trim(arguments[1]);return 0<e.length&&(e=e.replace(/<div[^>]*>([\s\S\r\n]*)<\/div>/gim,d),e="\n"+o.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,"<").replace(/>/g,">"):""},m=function(){return arguments&&1<arguments.length?o.trim(arguments[1]):""};for(a=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,m).replace(/<\/div>/gi,"\n").replace(/ /gi," ").replace(/"/gi,'"').replace(/<[^>]*>/gm,""),a=c.html(a).text(),a=a.replace(/\n[ \t]+/gm,"\n").replace(/[\n]{3,}/gm,"\n\n").replace(/>/gi,">").replace(/</gi,"<").replace(/&/gi,"&"),t=0,r=100;r>0&&(r--,s=a.indexOf("__bq__start__",t),s>-1);)i=a.indexOf("__bq__start__",s+5),n=a.indexOf("__bq__end__",s+5),(-1===i||i>n)&&n>s?(a=a.substring(0,s)+u(a.substring(s+13,n))+a.substring(n+11),t=0):t=i>-1&&n>i?i-1:0;return a=a.replace(/__bq__start__/gm,"").replace(/__bq__end__/gm,"")},s.plainToHtml=function(e,t){e=e.toString().replace(/\r/g,"");var o=!1,i=!0,n=!0,r=[],a="",l=0,c=e.split("\n");do{for(i=!1,r=[],l=0;l<c.length;l++)a=c[l],n=">"===a.substr(0,1),n&&!o?(i=!0,o=!0,r.push("~~~blockquote~~~"),r.push(a.substr(1))):!n&&o?(o=!1,r.push("~~~/blockquote~~~"),r.push(a)):r.push(n&&o?a.substr(1):a);o&&(o=!1,r.push("~~~/blockquote~~~")),c=r}while(i);return e=c.join("\n"),e=e.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/~~~blockquote~~~[\s]*/g,"<blockquote>").replace(/[\s]*~~~\/blockquote~~~/g,"</blockquote>").replace(/[\-_~]{10,}/g,"<hr />").replace(/\n/g,"<br />"),t?s.linkify(e):e},r.rainloop_Utils_htmlToPlain=s.htmlToPlain,r.rainloop_Utils_plainToHtml=s.plainToHtml,s.linkify=function(e){return o.fn&&o.fn.linkify&&(e=c.html(e.replace(/&/gi,"amp_amp_12345_amp_amp")).linkify().find(".linkified").removeClass("linkified").end().html().replace(/amp_amp_12345_amp_amp/g,"&")),e},s.resizeAndCrop=function(e,t,s){var o=new r.Image;o.onload=function(){var e=[0,0],o=r.document.createElement("canvas"),i=o.getContext("2d");o.width=t,o.height=t,e=this.width>this.height?[this.width-this.height,0]:[0,this.height-this.width],i.fillStyle="#fff",i.fillRect(0,0,t,t),i.drawImage(this,e[0]/2,e[1]/2,this.width-e[0],this.height-e[1],0,0,t,t),s(o.toDataURL("image/jpeg"))},o.src=e},s.folderListOptionsBuilder=function(e,t,o,i,n,a,l,c,u,d){var h=null,m=!1,g=0,f=0,b=" ",S=[];for(u=s.isNormal(u)?u:0<e.length,d=s.isUnd(d)?!1:!!d,n=s.isNormal(n)?n:0,a=s.isNormal(a)?a:null,l=s.isNormal(l)?l:null,c=s.isNormal(c)?c:null,s.isArray(o)||(o=[]),s.isArray(i)||(i=[]),g=0,f=i.length;f>g;g++)S.push({id:i[g][0],name:i[g][1],system:!1,seporator:!1,disabled:!1});for(m=!0,g=0,f=e.length;f>g;g++)h=e[g],(l?l.call(null,h):!0)&&(m&&0<S.length&&S.push({id:"---",name:"---",system:!1,seporator:!0,disabled:!0}),m=!1,S.push({id:h.fullNameRaw,name:c?c.call(null,h):h.name(),system:!0,seporator:!1,disabled:!h.selectable||-1<s.inArray(h.fullNameRaw,o)||(a?a.call(null,h):!1)}));for(m=!0,g=0,f=t.length;f>g;g++)h=t[g],(h.subScribed()||!h.existen)&&(l?l.call(null,h):!0)&&(p.FolderType.User===h.type()||!u||0<h.subFolders().length)&&(m&&0<S.length&&S.push({id:"---",name:"---",system:!1,seporator:!0,disabled:!0}),m=!1,S.push({id:h.fullNameRaw,name:new r.Array(h.deep+1-n).join(b)+(c?c.call(null,h):h.name()),system:!1,seporator:!1,disabled:!h.selectable||-1<s.inArray(h.fullNameRaw,o)||(a?a.call(null,h):!1)})),h.subScribed()&&0<h.subFolders().length&&(S=S.concat(s.folderListOptionsBuilder([],h.subFolders(),o,[],n,a,l,c,u,d)));return S},s.computedPagenatorHelper=function(e,t){return function(){var o=0,i=0,n=2,a=[],l=e(),c=t(),u=function(e,t,o){var i={current:e===l,name:s.isUnd(o)?e.toString():o.toString(),custom:s.isUnd(o)?!1:!0,title:s.isUnd(o)?"":e.toString(),value:e.toString()};(s.isUnd(t)?0:!t)?a.unshift(i):a.push(i)};if(c>1||c>0&&l>c){for(l>c?(u(c),o=c,i=c):((3>=l||l>=c-2)&&(n+=2),u(l),o=l,i=l);n>0;)if(o-=1,i+=1,o>0&&(u(o,!1),n--),c>=i)u(i,!0),n--;else if(0>=o)break;3===o?u(2,!1):o>3&&u(r.Math.round((o-1)/2),!1,"..."),c-2===i?u(c-1,!0):c-2>i&&u(r.Math.round((c+i)/2),!0,"..."),o>1&&u(1,!1),c>i&&u(c,!0)}return a}},s.selectElement=function(e){if(r.getSelection){var t=r.getSelection();t.removeAllRanges();var s=r.document.createRange();s.selectNodeContents(e),t.addRange(s)}else if(r.document.selection){var o=r.document.body.createTextRange();o.moveToElementText(e),o.select()}},s.detectDropdownVisibility=i.debounce(function(){m.dropdownVisibility(!!i.find(m.aBootstrapDropdowns,function(e){return e.hasClass("open")}))},50),s.triggerAutocompleteInputChange=function(e){var t=function(){o(".checkAutocomplete").trigger("change")};e?i.delay(t,100):t()},t.exports=s}(t)},{"../External/$div.js":15,"../External/$doc.js":16,"../External/$html.js":17,"../External/$window.js":18,"../External/NotificationClass.js":22,"../External/jquery.js":26,"../External/ko.js":28,"../External/underscore.js":31,"../External/window.js":32,"./Consts.js":6,"./Enums.js":7,"./Globals.js":9}],15:[function(e,t){"use strict";t.exports=e("./jquery.js")("<div></div>")},{"./jquery.js":26}],16:[function(e,t){"use strict";t.exports=e("./jquery.js")(window.document)},{"./jquery.js":26}],17:[function(e,t){"use strict";t.exports=e("./jquery.js")("html")},{"./jquery.js":26}],18:[function(e,t){"use strict";t.exports=e("./jquery.js")(window)},{"./jquery.js":26}],19:[function(e,t){"use strict";t.exports=e("./window.js").rainloopAppData||{}},{"./window.js":32}],20:[function(e,t){"use strict";t.exports=JSON},{}],21:[function(e,t){"use strict";t.exports=Jua},{}],22:[function(e,t){"use strict";var s=e("./window.js");t.exports=s.Notification&&s.Notification.requestPermission?s.Notification:null},{"./window.js":32}],23:[function(e,t){"use strict";t.exports=crossroads},{}],24:[function(e,t){"use strict";t.exports=hasher},{}],25:[function(e,t){"use strict";t.exports=ifvisible},{}],26:[function(e,t){"use strict";t.exports=$},{}],27:[function(e,t){"use strict";t.exports=key},{}],28:[function(e,t){!function(t,s){"use strict";var o=e("./window.js"),i=e("./underscore.js"),n=e("./jquery.js"),r=e("./$window.js"),a=e("./$doc.js");s.bindingHandlers.tooltip={init:function(t,o){var i=e("../Common/Globals.js"),r=e("../Common/Utils.js");if(!i.bMobileDevice){var a=n(t),l=a.data("tooltip-class")||"",c=a.data("tooltip-placement")||"top";a.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:c,trigger:"hover",title:function(){return a.is(".disabled")||i.dropdownVisibility()?"":'<span class="tooltip-class '+l+'">'+r.i18n(s.utils.unwrapObservable(o()))+"</span>"}}).click(function(){a.tooltip("hide")}),i.tooltipTrigger.subscribe(function(){a.tooltip("hide")})}}},s.bindingHandlers.tooltip2={init:function(t,s){var o=e("../Common/Globals.js"),i=n(t),r=i.data("tooltip-class")||"",a=i.data("tooltip-placement")||"top";i.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:a,title:function(){return i.is(".disabled")||o.dropdownVisibility()?"":'<span class="tooltip-class '+r+'">'+s()()+"</span>"}}).click(function(){i.tooltip("hide")}),o.tooltipTrigger.subscribe(function(){i.tooltip("hide")})}},s.bindingHandlers.tooltip3={init:function(t){var s=n(t),o=e("../Common/Globals.js");s.tooltip({container:"body",trigger:"hover manual",title:function(){return s.data("tooltip3-data")||""}}),a.click(function(){s.tooltip("hide")}),o.tooltipTrigger.subscribe(function(){s.tooltip("hide")})},update:function(e,t){var o=s.utils.unwrapObservable(t());""===o?n(e).data("tooltip3-data","").tooltip("hide"):n(e).data("tooltip3-data",o).tooltip("show")}},s.bindingHandlers.registrateBootstrapDropdown={init:function(t){var s=e("../Common/Globals.js");s.aBootstrapDropdowns.push(n(t))}},s.bindingHandlers.openDropdownTrigger={update:function(t,o){if(s.utils.unwrapObservable(o())){var i=n(t),r=e("../Common/Utils.js");i.hasClass("open")||(i.find(".dropdown-toggle").dropdown("toggle"),r.detectDropdownVisibility()),o()(!1)}}},s.bindingHandlers.dropdownCloser={init:function(e){n(e).closest(".dropdown").on("click",".e-item",function(){n(e).dropdown("toggle")})}},s.bindingHandlers.popover={init:function(e,t){n(e).popover(s.utils.unwrapObservable(t()))}},s.bindingHandlers.csstext={init:function(t,o){var i=e("../Common/Utils.js");t&&t.styleSheet&&!i.isUnd(t.styleSheet.cssText)?t.styleSheet.cssText=s.utils.unwrapObservable(o()):n(t).text(s.utils.unwrapObservable(o()))},update:function(t,o){var i=e("../Common/Utils.js");t&&t.styleSheet&&!i.isUnd(t.styleSheet.cssText)?t.styleSheet.cssText=s.utils.unwrapObservable(o()):n(t).text(s.utils.unwrapObservable(o()))}},s.bindingHandlers.resizecrop={init:function(e){n(e).addClass("resizecrop").resizecrop({width:"100",height:"100",wrapperCSS:{"border-radius":"10px"}})},update:function(e,t){t()(),n(e).resizecrop({width:"100",height:"100"})}},s.bindingHandlers.onEnter={init:function(e,t,s,i){n(e).on("keypress",function(s){s&&13===o.parseInt(s.keyCode,10)&&(n(e).trigger("change"),t().call(i))})}},s.bindingHandlers.onEsc={init:function(e,t,s,i){n(e).on("keypress",function(s){s&&27===o.parseInt(s.keyCode,10)&&(n(e).trigger("change"),t().call(i))})}},s.bindingHandlers.clickOnTrue={update:function(e,t){s.utils.unwrapObservable(t())&&n(e).click()}},s.bindingHandlers.modal={init:function(t,o){var i=e("../Common/Globals.js"),r=e("../Common/Utils.js");n(t).toggleClass("fade",!i.bMobileDevice).modal({keyboard:!1,show:s.utils.unwrapObservable(o())}).on("shown",function(){r.windowResize()}).find(".close").click(function(){o()(!1)})},update:function(e,t){n(e).modal(s.utils.unwrapObservable(t())?"show":"hide")}},s.bindingHandlers.i18nInit={init:function(t){var s=e("../Common/Utils.js");s.i18nToNode(t)}},s.bindingHandlers.i18nUpdate={update:function(t,o){var i=e("../Common/Utils.js");s.utils.unwrapObservable(o()),i.i18nToNode(t)}},s.bindingHandlers.link={update:function(e,t){n(e).attr("href",s.utils.unwrapObservable(t()))}},s.bindingHandlers.title={update:function(e,t){n(e).attr("title",s.utils.unwrapObservable(t()))}},s.bindingHandlers.textF={init:function(e,t){n(e).text(s.utils.unwrapObservable(t()))}},s.bindingHandlers.initDom={init:function(e,t){t()(e)}},s.bindingHandlers.initResizeTrigger={init:function(e,t){var o=s.utils.unwrapObservable(t());n(e).css({height:o[1],"min-height":o[1]})},update:function(t,o){var i=e("../Common/Utils.js"),a=s.utils.unwrapObservable(o()),l=i.pInt(a[1]),c=0,u=n(t).offset().top;u>0&&(u+=i.pInt(a[2]),c=r.height()-u,c>l&&(l=c),n(t).css({height:l,"min-height":l}))}},s.bindingHandlers.appendDom={update:function(e,t){n(e).hide().empty().append(s.utils.unwrapObservable(t())).show()}},s.bindingHandlers.draggable={init:function(t,i,r){var a=e("../Common/Globals.js"),l=e("../Common/Utils.js");if(!a.bMobileDevice){var c=100,u=3,d=r(),p=d&&d.droppableSelector?d.droppableSelector:"",h={distance:20,handle:".dragHandle",cursorAt:{top:22,left:3},refreshPositions:!0,scroll:!0};p&&(h.drag=function(e){n(p).each(function(){var t=null,s=null,i=n(this),r=i.offset(),a=r.top+i.height();o.clearInterval(i.data("timerScroll")),i.data("timerScroll",!1),e.pageX>=r.left&&e.pageX<=r.left+i.width()&&(e.pageY>=a-c&&e.pageY<=a&&(t=function(){i.scrollTop(i.scrollTop()+u),l.windowResize()},i.data("timerScroll",o.setInterval(t,10)),t()),e.pageY>=r.top&&e.pageY<=r.top+c&&(s=function(){i.scrollTop(i.scrollTop()-u),l.windowResize()},i.data("timerScroll",o.setInterval(s,10)),s()))})},h.stop=function(){n(p).each(function(){o.clearInterval(n(this).data("timerScroll")),n(this).data("timerScroll",!1)})}),h.helper=function(e){return i()(e&&e.target?s.dataFor(e.target):null)},n(t).draggable(h).on("mousedown",function(){l.removeInFocus()})}}},s.bindingHandlers.droppable={init:function(t,s,o){var i=e("../Common/Globals.js");if(!i.bMobileDevice){var r=s(),a=o(),l=a&&a.droppableOver?a.droppableOver:null,c=a&&a.droppableOut?a.droppableOut:null,u={tolerance:"pointer",hoverClass:"droppableHover"};r&&(u.drop=function(e,t){r(e,t)},l&&(u.over=function(e,t){l(e,t)}),c&&(u.out=function(e,t){c(e,t)}),n(t).droppable(u))}}},s.bindingHandlers.nano={init:function(t){var s=e("../Common/Globals.js");s.bDisableNanoScroll||n(t).addClass("nano").nanoScroller({iOSNativeScrolling:!1,preventPageScrolling:!0})}},s.bindingHandlers.saveTrigger={init:function(e){var t=n(e);t.data("save-trigger-type",t.is("input[type=text],input[type=email],input[type=password],select,textarea")?"input":"custom"),"custom"===t.data("save-trigger-type")?t.append(' <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 o=s.utils.unwrapObservable(t()),i=n(e);if("custom"===i.data("save-trigger-type"))switch(o.toString()){case"1":i.find(".animated,.error").hide().removeClass("visible").end().find(".success").show().addClass("visible");break;case"0":i.find(".animated,.success").hide().removeClass("visible").end().find(".error").show().addClass("visible");break;case"-2":i.find(".error,.success").hide().removeClass("visible").end().find(".animated").show().addClass("visible");break;default:i.find(".animated").hide().end().find(".error,.success").removeClass("visible")}else switch(o.toString()){case"1":i.addClass("success").removeClass("error");break;case"0":i.addClass("error").removeClass("success");break;case"-2":break;default:i.removeClass("error success")}}},s.bindingHandlers.emailsTags={init:function(t,s,o){var r=e("../Common/Utils.js"),a=e("../Models/EmailModel.js"),l=n(t),c=s(),u=o(),d=u.autoCompleteSource||null,p=function(e){c&&c.focusTrigger&&c.focusTrigger(e)};l.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!0,focusCallback:p,inputDelimiters:[",",";"],autoCompleteSource:d,parseHook:function(e){return i.map(e,function(e){var t=r.trim(e),s=null;return""!==t?(s=new a,s.mailsoParse(t),s.clearDuplicateName(),[s.toLine(!1),s]):[t,null]})},change:i.bind(function(e){l.data("EmailsTagsValue",e.target.value),c(e.target.value)},this)})},update:function(e,t,o){var i=n(e),r=o(),a=r.emailsTagsFilter||null,l=s.utils.unwrapObservable(t());i.data("EmailsTagsValue")!==l&&(i.val(l),i.data("EmailsTagsValue",l),i.inputosaurus("refresh")),a&&s.utils.unwrapObservable(a)&&i.inputosaurus("focus")}},s.bindingHandlers.contactTags={init:function(t,s,o){var r=e("../Common/Utils.js"),a=e("../Models/ContactTagModel.js"),l=n(t),c=s(),u=o(),d=u.autoCompleteSource||null,p=function(e){c&&c.focusTrigger&&c.focusTrigger(e)};l.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!1,focusCallback:p,inputDelimiters:[",",";"],outputDelimiter:",",autoCompleteSource:d,parseHook:function(e){return i.map(e,function(e){var t=r.trim(e),s=null;return""!==t?(s=new a,s.name(t),[s.toLine(!1),s]):[t,null]})},change:i.bind(function(e){l.data("ContactTagsValue",e.target.value),c(e.target.value)},this)})},update:function(e,t,o){var i=n(e),r=o(),a=r.contactTagsFilter||null,l=s.utils.unwrapObservable(t());i.data("ContactTagsValue")!==l&&(i.val(l),i.data("ContactTagsValue",l),i.inputosaurus("refresh")),a&&s.utils.unwrapObservable(a)&&i.inputosaurus("focus")}},s.bindingHandlers.command={init:function(e,t,o,i){var r=n(e),a=t();if(!a||!a.enabled||!a.canExecute)throw new Error("You are not using command function");r.addClass("command"),s.bindingHandlers[r.is("form")?"submit":"click"].init.apply(i,arguments)},update:function(e,t){var s=!0,o=n(e),i=t();s=i.enabled(),o.toggleClass("command-not-enabled",!s),s&&(s=i.canExecute(),o.toggleClass("command-can-not-be-execute",!s)),o.toggleClass("command-disabled disable disabled",!s).toggleClass("no-disabled",!!s),(o.is("input")||o.is("button"))&&o.prop("disabled",!s)}},s.extenders.trimmer=function(t){var o=e("../Common/Utils.js"),i=s.computed({read:t,write:function(e){t(o.trim(e.toString()))},owner:this});return i(t()),i},s.extenders.posInterer=function(t,o){var i=e("../Common/Utils.js"),n=s.computed({read:t,write:function(e){var s=i.pInt(e.toString(),o);0>=s&&(s=o),s===t()&&""+s!=""+e&&t(s+1),t(s)}});return n(t()),n},s.extenders.reversible=function(e){var t=e();return e.commit=function(){t=e()},e.reverse=function(){e(t)},e.commitedValue=function(){return t},e},s.extenders.toggleSubscribe=function(e,t){return e.subscribe(t[1],t[0],"beforeChange"),e.subscribe(t[2],t[0]),e},s.extenders.falseTimeout=function(t,s){var i=e("../Common/Utils.js");return t.iTimeout=0,t.subscribe(function(e){e&&(o.clearTimeout(t.iTimeout),t.iTimeout=o.setTimeout(function(){t(!1),t.iTimeout=0},i.pInt(s)))}),t},s.observable.fn.validateNone=function(){return this.hasError=s.observable(!1),this},s.observable.fn.validateEmail=function(){var t=e("../Common/Utils.js");return this.hasError=s.observable(!1),this.subscribe(function(e){e=t.trim(e),this.hasError(""!==e&&!/^[^@\s]+@[^@\s]+$/.test(e))},this),this.valueHasMutated(),this},s.observable.fn.validateSimpleEmail=function(){var t=e("../Common/Utils.js");return this.hasError=s.observable(!1),this.subscribe(function(e){e=t.trim(e),this.hasError(""!==e&&!/^.+@.+$/.test(e))},this),this.valueHasMutated(),this},s.observable.fn.validateFunc=function(t){var o=e("../Common/Utils.js");return this.hasFuncError=s.observable(!1),o.isFunc(t)&&(this.subscribe(function(e){this.hasFuncError(!t(e))},this),this.valueHasMutated()),this},t.exports=s}(t,ko)},{"../Common/Globals.js":9,"../Common/Utils.js":14,"../Models/ContactTagModel.js":42,"../Models/EmailModel.js":43,"./$doc.js":16,"./$window.js":18,"./jquery.js":26,"./underscore.js":31,"./window.js":32}],29:[function(e,t){"use strict";t.exports=moment},{}],30:[function(e,t){"use strict";t.exports=ssm},{}],31:[function(e,t){"use strict";t.exports=_},{}],32:[function(e,t){"use strict";t.exports=window},{}],33:[function(e,t){!function(t){"use strict";function s(){this.sDefaultScreenName="",this.oScreens={},this.oCurrentScreen=null}var o=e("../External/jquery.js"),i=e("../External/underscore.js"),n=e("../External/ko.js"),r=e("../External/hasher.js"),a=e("../External/crossroads.js"),l=e("../External/$html.js"),c=e("../Common/Globals.js"),u=e("../Common/Plugins.js"),d=e("../Common/Utils.js"),p=e("../Knoin/KnoinAbstractViewModel.js");
|
||
s.prototype.sDefaultScreenName="",s.prototype.oScreens={},s.prototype.oCurrentScreen=null,s.prototype.hideLoading=function(){o("#rl-loading").hide()},s.prototype.constructorEnd=function(e){d.isFunc(e.__constructor_end)&&e.__constructor_end.call(e)},s.prototype.extendAsViewModel=function(e,t,s){t&&(s||(s=p),t.__name=e,u.regViewModelHook(e,t),i.extend(t.prototype,s.prototype))},s.prototype.addSettingsViewModel=function(e,t,s,o,i){e.__rlSettingsData={Label:s,Template:t,Route:o,IsDefault:!!i},c.aViewModels.settings.push(e)},s.prototype.removeSettingsViewModel=function(e){c.aViewModels["settings-removed"].push(e)},s.prototype.disableSettingsViewModel=function(e){c.aViewModels["settings-disabled"].push(e)},s.prototype.routeOff=function(){r.changed.active=!1},s.prototype.routeOn=function(){r.changed.active=!0},s.prototype.screen=function(e){return""===e||d.isUnd(this.oScreens[e])?null:this.oScreens[e]},s.prototype.buildViewModel=function(e,t){if(e&&!e.__builded){var s=this,r=new e(t),a=r.viewModelPosition(),l=o("#rl-content #rl-"+a.toLowerCase()),p=null;e.__builded=!0,e.__vm=r,r.viewModelName=e.__name,l&&1===l.length?(p=o("<div></div>").addClass("rl-view-model").addClass("RL-"+r.viewModelTemplate()).hide(),p.appendTo(l),r.viewModelDom=p,e.__dom=p,"Popups"===a&&(r.cancelCommand=r.closeCommand=d.createCommand(r,function(){s.hideScreenPopup(e)}),r.modalVisibility.subscribe(function(e){var t=this;e?(this.viewModelDom.show(),this.storeAndSetKeyScope(),c.popupVisibilityNames.push(this.viewModelName),r.viewModelDom.css("z-index",3e3+c.popupVisibilityNames().length+10),d.delegateRun(this,"onFocus",[],500)):(d.delegateRun(this,"onHide"),this.restoreKeyScope(),c.popupVisibilityNames.remove(this.viewModelName),r.viewModelDom.css("z-index",2e3),c.tooltipTrigger(!c.tooltipTrigger()),i.delay(function(){t.viewModelDom.hide()},300))},r)),u.runHook("view-model-pre-build",[e.__name,r,p]),n.applyBindingAccessorsToNode(p[0],{i18nInit:!0,template:function(){return{name:r.viewModelTemplate()}}},r),d.delegateRun(r,"onBuild",[p]),r&&"Popups"===a&&r.registerPopupKeyDown(),u.runHook("view-model-post-build",[e.__name,r,p])):d.log("Cannot find view model position: "+a)}return e?e.__vm:null},s.prototype.hideScreenPopup=function(e){e&&e.__vm&&e.__dom&&(e.__vm.modalVisibility(!1),u.runHook("view-model-on-hide",[e.__name,e.__vm]))},s.prototype.showScreenPopup=function(e,t){e&&(this.buildViewModel(e),e.__vm&&e.__dom&&(e.__vm.modalVisibility(!0),d.delegateRun(e.__vm,"onShow",t||[]),u.runHook("view-model-on-show",[e.__name,e.__vm,t||[]])))},s.prototype.isPopupVisible=function(e){return e&&e.__vm?e.__vm.modalVisibility():!1},s.prototype.screenOnRoute=function(e,t){var s=this,o=null,n=null;""===d.pString(e)&&(e=this.sDefaultScreenName),""!==e&&(o=this.screen(e),o||(o=this.screen(this.sDefaultScreenName),o&&(t=e+"/"+t,e=this.sDefaultScreenName)),o&&o.__started&&(o.__builded||(o.__builded=!0,d.isNonEmptyArray(o.viewModels())&&i.each(o.viewModels(),function(e){this.buildViewModel(e,o)},this),d.delegateRun(o,"onBuild")),i.defer(function(){s.oCurrentScreen&&(d.delegateRun(s.oCurrentScreen,"onHide"),d.isNonEmptyArray(s.oCurrentScreen.viewModels())&&i.each(s.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.hide(),e.__vm.viewModelVisibility(!1),d.delegateRun(e.__vm,"onHide"))})),s.oCurrentScreen=o,s.oCurrentScreen&&(d.delegateRun(s.oCurrentScreen,"onShow"),u.runHook("screen-on-show",[s.oCurrentScreen.screenName(),s.oCurrentScreen]),d.isNonEmptyArray(s.oCurrentScreen.viewModels())&&i.each(s.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.show(),e.__vm.viewModelVisibility(!0),d.delegateRun(e.__vm,"onShow"),d.delegateRun(e.__vm,"onFocus",[],200),u.runHook("view-model-on-show",[e.__name,e.__vm]))},s)),n=o.__cross(),n&&n.parse(t)})))},s.prototype.startScreens=function(e){o("#rl-content").css({visibility:"hidden"}),i.each(e,function(e){var t=new e,s=t?t.screenName():"";t&&""!==s&&(""===this.sDefaultScreenName&&(this.sDefaultScreenName=s),this.oScreens[s]=t)},this),i.each(this.oScreens,function(e){e&&!e.__started&&e.__start&&(e.__started=!0,e.__start(),u.runHook("screen-pre-start",[e.screenName(),e]),d.delegateRun(e,"onStart"),u.runHook("screen-post-start",[e.screenName(),e]))},this);var t=a.create();t.addRoute(/^([a-zA-Z0-9\-]*)\/?(.*)$/,i.bind(this.screenOnRoute,this)),r.initialized.add(t.parse,t),r.changed.add(t.parse,t),r.init(),o("#rl-content").css({visibility:"visible"}),i.delay(function(){l.removeClass("rl-started-trigger").addClass("rl-started")},50)},s.prototype.setHash=function(e,t,s){e="#"===e.substr(0,1)?e.substr(1):e,e="/"===e.substr(0,1)?e.substr(1):e,s=d.isUnd(s)?!1:!!s,(d.isUnd(t)?1:!t)?(r.changed.active=!0,r[s?"replaceHash":"setHash"](e),r.setHash(e)):(r.changed.active=!1,r[s?"replaceHash":"setHash"](e),r.changed.active=!0)},t.exports=new s}(t)},{"../Common/Globals.js":9,"../Common/Plugins.js":12,"../Common/Utils.js":14,"../External/$html.js":17,"../External/crossroads.js":23,"../External/hasher.js":24,"../External/jquery.js":26,"../External/ko.js":28,"../External/underscore.js":31,"../Knoin/KnoinAbstractViewModel.js":36}],34:[function(e,t){!function(e){"use strict";function t(){}t.prototype.bootstart=function(){},e.exports=t}(t)},{}],35:[function(e,t){!function(t){"use strict";function s(e,t){this.sScreenName=e,this.aViewModels=i.isArray(t)?t:[]}var o=e("../External/crossroads.js"),i=e("../Common/Utils.js");s.prototype.oCross=null,s.prototype.sScreenName="",s.prototype.aViewModels=[],s.prototype.viewModels=function(){return this.aViewModels},s.prototype.screenName=function(){return this.sScreenName},s.prototype.routes=function(){return null},s.prototype.__cross=function(){return this.oCross},s.prototype.__start=function(){var e=this.routes(),t=null,s=null;i.isNonEmptyArray(e)&&(s=_.bind(this.onRoute||i.emptyFunction,this),t=o.create(),_.each(e,function(e){t.addRoute(e[0],s).rules=e[1]}),this.oCross=t)},t.exports=s}(t)},{"../Common/Utils.js":14,"../External/crossroads.js":23}],36:[function(e,t){!function(t){"use strict";function s(e,t){this.bDisabeCloseOnEsc=!1,this.sPosition=a.pString(e),this.sTemplate=a.pString(t),this.sDefaultKeyScope=n.KeyState.None,this.sCurrentKeyScope=this.sDefaultKeyScope,this.viewModelName="",this.viewModelVisibility=o.observable(!1),this.modalVisibility=o.observable(!1).extend({rateLimit:0}),this.viewModelDom=null}var o=e("../External/ko.js"),i=e("../External/$window.js"),n=e("../Common/Enums.js"),r=e("../Common/Globals.js"),a=e("../Common/Utils.js");s.prototype.sPosition="",s.prototype.sTemplate="",s.prototype.viewModelName="",s.prototype.viewModelDom=null,s.prototype.viewModelTemplate=function(){return this.sTemplate},s.prototype.viewModelPosition=function(){return this.sPosition},s.prototype.cancelCommand=function(){},s.prototype.closeCommand=function(){},s.prototype.storeAndSetKeyScope=function(){this.sCurrentKeyScope=r.keyScope(),r.keyScope(this.sDefaultKeyScope)},s.prototype.restoreKeyScope=function(){r.keyScope(this.sCurrentKeyScope)},s.prototype.registerPopupKeyDown=function(){var e=this;i.on("keydown",function(t){if(t&&e.modalVisibility&&e.modalVisibility()){if(!this.bDisabeCloseOnEsc&&n.EventKeyCode.Esc===t.keyCode)return a.delegateRun(e,"cancelCommand"),!1;if(n.EventKeyCode.Backspace===t.keyCode&&!a.inFocus())return!1}return!0})},t.exports=s}(t)},{"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/$window.js":18,"../External/ko.js":28}],37:[function(e,t){!function(t){"use strict";function s(e,t){this.email=e,this.deleteAccess=o.observable(!1),this.canBeDalete=o.observable(t)}var o=e("../External/ko.js");s.prototype.email="",s.prototype.changeAccountLink=function(){return e("../Common/LinkBuilder.js").change(this.email)},t.exports=s}(t)},{"../Common/LinkBuilder.js":10,"../External/ko.js":28}],38:[function(e,t){!function(t){"use strict";function s(){this.mimeType="",this.fileName="",this.estimatedSize=0,this.friendlySize="",this.isInline=!1,this.isLinked=!1,this.cid="",this.cidWithOutTags="",this.contentLocation="",this.download="",this.folder="",this.uid="",this.mimeIndex=""}var o=e("../External/window.js"),i=e("../Common/Globals.js"),n=e("../Common/Utils.js"),r=e("../Common/LinkBuilder.js");s.newInstanceFromJson=function(e){var t=new s;return t.initByJson(e)?t:null},s.prototype.mimeType="",s.prototype.fileName="",s.prototype.estimatedSize=0,s.prototype.friendlySize="",s.prototype.isInline=!1,s.prototype.isLinked=!1,s.prototype.cid="",s.prototype.cidWithOutTags="",s.prototype.contentLocation="",s.prototype.download="",s.prototype.folder="",s.prototype.uid="",s.prototype.mimeIndex="",s.prototype.initByJson=function(e){var t=!1;return e&&"Object/Attachment"===e["@Object"]&&(this.mimeType=(e.MimeType||"").toLowerCase(),this.fileName=e.FileName,this.estimatedSize=n.pInt(e.EstimatedSize),this.isInline=!!e.IsInline,this.isLinked=!!e.IsLinked,this.cid=e.CID,this.contentLocation=e.ContentLocation,this.download=e.Download,this.folder=e.Folder,this.uid=e.Uid,this.mimeIndex=e.MimeIndex,this.friendlySize=n.friendlySize(this.estimatedSize),this.cidWithOutTags=this.cid.replace(/^<+/,"").replace(/>+$/,""),t=!0),t},s.prototype.isImage=function(){return-1<n.inArray(this.mimeType.toLowerCase(),["image/png","image/jpg","image/jpeg","image/gif"])},s.prototype.isText=function(){return"text/"===this.mimeType.substr(0,5)&&-1===n.inArray(this.mimeType,["text/html"])},s.prototype.isPdf=function(){return i.bAllowPdfPreview&&"application/pdf"===this.mimeType},s.prototype.linkDownload=function(){return r.attachmentDownload(this.download)},s.prototype.linkPreview=function(){return r.attachmentPreview(this.download)},s.prototype.linkPreviewAsPlain=function(){return r.attachmentPreviewAsPlain(this.download)},s.prototype.generateTransferDownloadUrl=function(){var e=this.linkDownload();return"http"!==e.substr(0,4)&&(e=o.location.protocol+"//"+o.location.host+o.location.pathname+e),this.mimeType+":"+this.fileName+":"+e},s.prototype.eventDragStart=function(e,t){var s=t.originalEvent||t;return e&&s&&s.dataTransfer&&s.dataTransfer.setData&&s.dataTransfer.setData("DownloadURL",this.generateTransferDownloadUrl()),!0},s.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},t.exports=s}(t)},{"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/window.js":32}],39:[function(e,t){!function(t){"use strict";function s(e,t,s,n,r,a,l){this.id=e,this.isInline=i.isUnd(n)?!1:!!n,this.isLinked=i.isUnd(r)?!1:!!r,this.CID=i.isUnd(a)?"":a,this.contentLocation=i.isUnd(l)?"":l,this.fromMessage=!1,this.fileName=o.observable(t),this.size=o.observable(i.isUnd(s)?null:s),this.tempName=o.observable(""),this.progress=o.observable(""),this.error=o.observable(""),this.waiting=o.observable(!0),this.uploading=o.observable(!1),this.enabled=o.observable(!0),this.friendlySize=o.computed(function(){var e=this.size();return null===e?"":i.friendlySize(this.size())},this)}var o=e("../External/ko.js"),i=e("../Common/Utils.js");s.prototype.id="",s.prototype.isInline=!1,s.prototype.isLinked=!1,s.prototype.CID="",s.prototype.contentLocation="",s.prototype.fromMessage=!1,s.prototype.cancel=i.emptyFunction,s.prototype.initByUploadJson=function(e){var t=!1;return e&&(this.fileName(e.Name),this.size(i.isUnd(e.Size)?0:i.pInt(e.Size)),this.tempName(i.isUnd(e.TempName)?"":e.TempName),this.isInline=!1,t=!0),t},t.exports=s}(t)},{"../Common/Utils.js":14,"../External/ko.js":28}],40:[function(e,t){!function(t){"use strict";function s(){this.idContact=0,this.display="",this.properties=[],this.tags="",this.readOnly=!1,this.focused=i.observable(!1),this.selected=i.observable(!1),this.checked=i.observable(!1),this.deleted=i.observable(!1)}var o=e("../External/underscore.js"),i=e("../External/ko.js"),n=e("../Common/Enums.js"),r=e("../Common/Utils.js"),a=e("../Common/LinkBuilder.js");s.prototype.getNameAndEmailHelper=function(){var e="",t="";return r.isNonEmptyArray(this.properties)&&o.each(this.properties,function(s){s&&(n.ContactPropertyType.FirstName===s[0]?e=r.trim(s[1]+" "+e):n.ContactPropertyType.LastName===s[0]?e=r.trim(e+" "+s[1]):""===t&&n.ContactPropertyType.Email===s[0]&&(t=s[1]))},this),""===t?null:[t,e]},s.prototype.parse=function(e){var t=!1;return e&&"Object/Contact"===e["@Object"]&&(this.idContact=r.pInt(e.IdContact),this.display=r.pString(e.Display),this.readOnly=!!e.ReadOnly,this.tags="",r.isNonEmptyArray(e.Properties)&&o.each(e.Properties,function(e){e&&e.Type&&r.isNormal(e.Value)&&r.isNormal(e.TypeStr)&&this.properties.push([r.pInt(e.Type),r.pString(e.Value),r.pString(e.TypeStr)])},this),r.isNonEmptyArray(e.Tags)&&(this.tags=e.Tags.join(",")),t=!0),t},s.prototype.srcAttr=function(){return a.emptyContactPic()},s.prototype.generateUid=function(){return""+this.idContact},s.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(" ")},t.exports=s}(t)},{"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/ko.js":28,"../External/underscore.js":31}],41:[function(e,t){!function(t){"use strict";function s(e,t,s,r,a){this.type=o.observable(n.isUnd(e)?i.ContactPropertyType.Unknown:e),this.typeStr=o.observable(n.isUnd(t)?"":t),this.focused=o.observable(n.isUnd(r)?!1:!!r),this.value=o.observable(n.pString(s)),this.placeholder=o.observable(a||""),this.placeholderValue=o.computed(function(){var e=this.placeholder();return e?n.i18n(e):""},this),this.largeValue=o.computed(function(){return i.ContactPropertyType.Note===this.type()},this)}var o=e("../External/ko.js"),i=e("../Common/Enums.js"),n=e("../Common/Utils.js");t.exports=s}(t)},{"../Common/Enums.js":7,"../Common/Utils.js":14,"../External/ko.js":28}],42:[function(e,t){!function(t){"use strict";function s(){this.idContactTag=0,this.name=o.observable(""),this.readOnly=!1}var o=e("../External/ko.js"),i=e("../Common/Utils.js");s.prototype.parse=function(e){var t=!1;return e&&"Object/Tag"===e["@Object"]&&(this.idContact=i.pInt(e.IdContactTag),this.name(i.pString(e.Name)),this.readOnly=!!e.ReadOnly,t=!0),t},s.prototype.filterHelper=function(e){return-1!==this.name().toLowerCase().indexOf(e.toLowerCase())},s.prototype.toLine=function(e){return(i.isUnd(e)?1:!e)?this.name():i.encodeHtml(this.name())},t.exports=s}(t)},{"../Common/Utils.js":14,"../External/ko.js":28}],43:[function(e,t){!function(t){"use strict";function s(e,t){this.email=e||"",this.name=t||"",this.privateType=null,this.clearDuplicateName()}var o=e("../Common/Enums.js"),i=e("../Common/Utils.js");s.newInstanceFromJson=function(e){var t=new s;return t.initByJson(e)?t:null},s.prototype.name="",s.prototype.email="",s.prototype.privateType=null,s.prototype.clear=function(){this.email="",this.name="",this.privateType=null},s.prototype.validate=function(){return""!==this.name||""!==this.email},s.prototype.hash=function(e){return"#"+(e?"":this.name)+"#"+this.email+"#"},s.prototype.clearDuplicateName=function(){this.name===this.email&&(this.name="")},s.prototype.type=function(){return null===this.privateType&&(this.email&&"@facebook.com"===this.email.substr(-13)&&(this.privateType=o.EmailType.Facebook),null===this.privateType&&(this.privateType=o.EmailType.Default)),this.privateType},s.prototype.search=function(e){return-1<(this.name+" "+this.email).toLowerCase().indexOf(e.toLowerCase())},s.prototype.parse=function(e){this.clear(),e=i.trim(e);var t=/(?:"([^"]+)")? ?<?(.*?@[^>,]+)>?,? ?/g,s=t.exec(e);s?(this.name=s[1]||"",this.email=s[2]||"",this.clearDuplicateName()):/^[^@]+@[^@]+$/.test(e)&&(this.name="",this.email=e)},s.prototype.initByJson=function(e){var t=!1;return e&&"Object/Email"===e["@Object"]&&(this.name=i.trim(e.Name),this.email=i.trim(e.Email),t=""!==this.email,this.clearDuplicateName()),t},s.prototype.toLine=function(e,t,s){var o="";return""!==this.email&&(t=i.isUnd(t)?!1:!!t,s=i.isUnd(s)?!1:!!s,e&&""!==this.name?o=t?'<a href="mailto:'+i.encodeHtml('"'+this.name+'" <'+this.email+">")+'" target="_blank" tabindex="-1">'+i.encodeHtml(this.name)+"</a>":s?i.encodeHtml(this.name):this.name:(o=this.email,""!==this.name?t?o=i.encodeHtml('"'+this.name+'" <')+'<a href="mailto:'+i.encodeHtml('"'+this.name+'" <'+this.email+">")+'" target="_blank" tabindex="-1">'+i.encodeHtml(o)+"</a>"+i.encodeHtml(">"):(o='"'+this.name+'" <'+o+">",s&&(o=i.encodeHtml(o))):t&&(o='<a href="mailto:'+i.encodeHtml(this.email)+'" target="_blank" tabindex="-1">'+i.encodeHtml(this.email)+"</a>"))),o},s.prototype.mailsoParse=function(e){if(e=i.trim(e),""===e)return!1;for(var t=function(e,t,s){e+="";var o=e.length;return 0>t&&(t+=o),o="undefined"==typeof s?o:0>s?s+o:s+t,t>=e.length||0>t||t>o?!1:e.slice(t,o)},s=function(e,t,s,o){return 0>s&&(s+=e.length),o=void 0!==o?o:e.length,0>o&&(o=o+e.length-s),e.slice(0,s)+t.substr(0,o)+t.slice(o)+e.slice(s+o)},o="",n="",r="",a=!1,l=!1,c=!1,u=null,d=0,p=0,h=0;h<e.length;){switch(e.substr(h,1)){case'"':a||l||c?l||c||(p=h,o=t(e,d+1,p-d-1),e=s(e,"",d,p-d+1),p=0,h=0,d=0,a=!1):(a=!0,d=h);break;case"<":a||l||c||(h>0&&0===o.length&&(o=t(e,0,h)),l=!0,d=h);break;case">":l&&(p=h,n=t(e,d+1,p-d-1),e=s(e,"",d,p-d+1),p=0,h=0,d=0,l=!1);break;case"(":a||l||c||(c=!0,d=h);break;case")":c&&(p=h,r=t(e,d+1,p-d-1),e=s(e,"",d,p-d+1),p=0,h=0,d=0,c=!1);break;case"\\":h++}h++}return 0===n.length&&(u=e.match(/[^@\s]+@\S+/i),u&&u[0]?n=u[0]:o=e),n.length>0&&0===o.length&&0===r.length&&(o=e.replace(n,"")),n=i.trim(n).replace(/^[<]+/,"").replace(/[>]+$/,""),o=i.trim(o).replace(/^["']+/,"").replace(/["']+$/,""),r=i.trim(r).replace(/^[(]+/,"").replace(/[)]+$/,""),o=o.replace(/\\\\(.)/,"$1"),r=r.replace(/\\\\(.)/,"$1"),this.name=o,this.email=n,this.clearDuplicateName(),!0},s.prototype.inputoTagLine=function(){return 0<this.name.length?this.name+" ("+this.email+")":this.email},t.exports=s}(t)},{"../Common/Enums.js":7,"../Common/Utils.js":14}],44:[function(e,t){!function(t){"use strict";function s(e){this.parentList=e,this.field=o.observable(i.FilterConditionField.From),this.fieldOptions=[{id:i.FilterConditionField.From,name:"From"},{id:i.FilterConditionField.Recipient,name:"Recipient (To or CC)"},{id:i.FilterConditionField.To,name:"To"},{id:i.FilterConditionField.Subject,name:"Subject"}],this.type=o.observable(i.FilterConditionType.EqualTo),this.typeOptions=[{id:i.FilterConditionType.EqualTo,name:"Equal To"},{id:i.FilterConditionType.NotEqualTo,name:"Not Equal To"},{id:i.FilterConditionType.Contains,name:"Contains"},{id:i.FilterConditionType.NotContains,name:"Not Contains"}],this.value=o.observable(""),this.template=o.computed(function(){var e="";switch(this.type()){default:e="SettingsFiltersConditionDefault"}return e},this)}var o=e("../External/ko.js"),i=e("../Common/Enums.js");s.prototype.removeSelf=function(){this.parentList.remove(this)},t.exports=s}(t)},{"../Common/Enums.js":7,"../External/ko.js":28}],45:[function(e,t){!function(t){"use strict";function s(){this.new=o.observable(!0),this.enabled=o.observable(!0),this.name=o.observable(""),this.conditionsType=o.observable(i.FilterRulesType.And),this.conditions=o.observableArray([]),this.conditions.subscribe(function(){n.windowResize()}),this.actionMarkAsRead=o.observable(!1),this.actionSkipOtherFilters=o.observable(!0),this.actionValue=o.observable(""),this.actionType=o.observable(i.FiltersAction.Move),this.actionTypeOptions=[{id:i.FiltersAction.None,name:"Action - None"},{id:i.FiltersAction.Move,name:"Action - Move to"},{id:i.FiltersAction.Discard,name:"Action - Discard"}],this.actionMarkAsReadVisiblity=o.computed(function(){return-1<n.inArray(this.actionType(),[i.FiltersAction.None,i.FiltersAction.Forward,i.FiltersAction.Move])},this),this.actionTemplate=o.computed(function(){var e="";switch(this.actionType()){default:case i.FiltersAction.Move:e="SettingsFiltersActionValueAsFolders";break;case i.FiltersAction.Forward:e="SettingsFiltersActionWithValue";break;case i.FiltersAction.None:case i.FiltersAction.Discard:e="SettingsFiltersActionNoValue"}return e},this)}var o=e("../External/ko.js"),i=e("../Common/Enums.js"),n=e("../Common/Utils.js"),r=e("./FilterConditionModel.js");s.prototype.addCondition=function(){this.conditions.push(new r(this.conditions))},s.prototype.parse=function(e){var t=!1;return e&&"Object/Filter"===e["@Object"]&&(this.name(n.pString(e.Name)),t=!0),t},t.exports=s}(t)},{"../Common/Enums.js":7,"../Common/Utils.js":14,"../External/ko.js":28,"./FilterConditionModel.js":44}],46:[function(e,t){!function(t){"use strict";function s(){this.name=i.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=i.observable(r.FolderType.User),this.focused=i.observable(!1),this.selected=i.observable(!1),this.edited=i.observable(!1),this.collapsed=i.observable(!0),this.subScribed=i.observable(!0),this.subFolders=i.observableArray([]),this.deleteAccess=i.observable(!1),this.actionBlink=i.observable(!1).extend({falseTimeout:1e3}),this.nameForEdit=i.observable(""),this.privateMessageCountAll=i.observable(0),this.privateMessageCountUnread=i.observable(0),this.collapsedPrivate=i.observable(!0)}var o=e("../External/underscore.js"),i=e("../External/ko.js"),n=e("../External/$window.js"),r=e("../Common/Enums.js"),a=e("../Common/Globals.js"),l=e("../Common/Utils.js"),c=e("../Common/Events.js");s.newInstanceFromJson=function(e){var t=new s;return t.initByJson(e)?t.initComputed():null},s.prototype.initComputed=function(){return this.hasSubScribedSubfolders=i.computed(function(){return!!o.find(this.subFolders(),function(e){return e.subScribed()&&!e.isSystemFolder()})},this),this.canBeEdited=i.computed(function(){return r.FolderType.User===this.type()&&this.existen&&this.selectable},this),this.visible=i.computed(function(){var e=this.subScribed(),t=this.hasSubScribedSubfolders();return e||t&&(!this.existen||!this.selectable)},this),this.isSystemFolder=i.computed(function(){return r.FolderType.User!==this.type()},this),this.hidden=i.computed(function(){var e=this.isSystemFolder(),t=this.hasSubScribedSubfolders();return e&&!t||!this.selectable&&!t},this),this.selectableForFolderList=i.computed(function(){return!this.isSystemFolder()&&this.selectable},this),this.messageCountAll=i.computed({read:this.privateMessageCountAll,write:function(e){l.isPosNumeric(e,!0)?this.privateMessageCountAll(e):this.privateMessageCountAll.valueHasMutated()},owner:this}),this.messageCountUnread=i.computed({read:this.privateMessageCountUnread,write:function(e){l.isPosNumeric(e,!0)?this.privateMessageCountUnread(e):this.privateMessageCountUnread.valueHasMutated()},owner:this}),this.printableUnreadCount=i.computed(function(){var e=this.messageCountAll(),t=this.messageCountUnread(),s=this.type();if(e>0){if(r.FolderType.Draft===s)return""+e;if(t>0&&r.FolderType.Trash!==s&&r.FolderType.Archive!==s&&r.FolderType.SentItems!==s)return""+t}return""},this),this.canBeDeleted=i.computed(function(){var e=this.isSystemFolder();return!e&&0===this.subFolders().length&&"INBOX"!==this.fullNameRaw},this),this.canBeSubScribed=i.computed(function(){return!this.isSystemFolder()&&this.selectable&&"INBOX"!==this.fullNameRaw},this),this.visible.subscribe(function(){l.timeOutAction("folder-list-folder-visibility-change",function(){n.trigger("folder-list-folder-visibility-change")},100)}),this.localName=i.computed(function(){a.langChangeTrigger();var e=this.type(),t=this.name();if(this.isSystemFolder())switch(e){case r.FolderType.Inbox:t=l.i18n("FOLDER_LIST/INBOX_NAME");break;case r.FolderType.SentItems:t=l.i18n("FOLDER_LIST/SENT_NAME");break;case r.FolderType.Draft:t=l.i18n("FOLDER_LIST/DRAFTS_NAME");break;case r.FolderType.Spam:t=l.i18n("FOLDER_LIST/SPAM_NAME");break;case r.FolderType.Trash:t=l.i18n("FOLDER_LIST/TRASH_NAME");break;case r.FolderType.Archive:t=l.i18n("FOLDER_LIST/ARCHIVE_NAME")}return t},this),this.manageFolderSystemName=i.computed(function(){a.langChangeTrigger();var e="",t=this.type(),s=this.name();if(this.isSystemFolder())switch(t){case r.FolderType.Inbox:e="("+l.i18n("FOLDER_LIST/INBOX_NAME")+")";break;case r.FolderType.SentItems:e="("+l.i18n("FOLDER_LIST/SENT_NAME")+")";break;case r.FolderType.Draft:e="("+l.i18n("FOLDER_LIST/DRAFTS_NAME")+")";break;case r.FolderType.Spam:e="("+l.i18n("FOLDER_LIST/SPAM_NAME")+")";break;case r.FolderType.Trash:e="("+l.i18n("FOLDER_LIST/TRASH_NAME")+")";break;case r.FolderType.Archive:e="("+l.i18n("FOLDER_LIST/ARCHIVE_NAME")+")"}return(""!==e&&"("+s+")"===e||"(inbox)"===e.toLowerCase())&&(e=""),e},this),this.collapsed=i.computed({read:function(){return!this.hidden()&&this.collapsedPrivate()},write:function(e){this.collapsedPrivate(e)},owner:this}),this.hasUnreadMessages=i.computed(function(){return 0<this.messageCountUnread()},this),this.hasSubScribedUnreadMessagesSubfolders=i.computed(function(){return!!o.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){r.FolderType.Inbox===this.type()&&c.pub("mailbox.inbox-unread-count",[e])},this),this},s.prototype.fullName="",s.prototype.fullNameRaw="",s.prototype.fullNameHash="",s.prototype.delimiter="",s.prototype.namespace="",s.prototype.deep=0,s.prototype.interval=0,s.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"},s.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?r.FolderType.Inbox:r.FolderType.User),t=!0),t},s.prototype.printableFullName=function(){return this.fullName.split(this.delimiter).join(" / ")},t.exports=s}(t)},{"../Common/Enums.js":7,"../Common/Events.js":8,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/$window.js":18,"../External/ko.js":28,"../External/underscore.js":31}],47:[function(e,t){!function(t){"use strict";function s(e,t,s){this.id=e,this.email=o.observable(t),this.name=o.observable(""),this.replyTo=o.observable(""),this.bcc=o.observable(""),this.deleteAccess=o.observable(!1),this.canBeDalete=o.observable(s)}var o=e("../External/ko.js"),i=e("../Common/Utils.js");s.prototype.formattedName=function(){var e=this.name();return""===e?this.email():e+" <"+this.email()+">"},s.prototype.formattedNameForCompose=function(){var e=this.name();return""===e?this.email():e+" ("+this.email()+")"},s.prototype.formattedNameForEmail=function(){var e=this.name();return""===e?this.email():'"'+i.quoteName(e)+'" <'+this.email()+">"},t.exports=s}(t)},{"../Common/Utils.js":14,"../External/ko.js":28}],48:[function(e,t){!function(t){"use strict";function s(){this.folderFullNameRaw="",this.uid="",this.hash="",this.requestHash="",this.subject=r.observable(""),this.subjectPrefix=r.observable(""),this.subjectSuffix=r.observable(""),this.size=r.observable(0),this.dateTimeStampInUTC=r.observable(0),this.priority=r.observable(u.MessagePriority.Normal),this.proxy=!1,this.fromEmailString=r.observable(""),this.fromClearEmailString=r.observable(""),this.toEmailsString=r.observable(""),this.toClearEmailsString=r.observable(""),this.senderEmailsString=r.observable(""),this.senderClearEmailsString=r.observable(""),this.emails=[],this.from=[],this.to=[],this.cc=[],this.bcc=[],this.replyTo=[],this.deliveredTo=[],this.newForAnimation=r.observable(!1),this.deleted=r.observable(!1),this.unseen=r.observable(!1),this.flagged=r.observable(!1),this.answered=r.observable(!1),this.forwarded=r.observable(!1),this.isReadReceipt=r.observable(!1),this.focused=r.observable(!1),this.selected=r.observable(!1),this.checked=r.observable(!1),this.hasAttachments=r.observable(!1),this.attachmentsMainType=r.observable(""),this.moment=r.observable(a(a.unix(0))),this.attachmentIconClass=r.computed(function(){var e="";if(this.hasAttachments())switch(e="icon-attachment",this.attachmentsMainType()){case"image":e="icon-image";break;case"archive":e="icon-file-zip";break;case"doc":e="icon-file-text"}return e},this),this.fullFormatDateValue=r.computed(function(){return s.calculateFullFromatDateValue(this.dateTimeStampInUTC())},this),this.momentDate=d.createMomentDate(this),this.momentShortDate=d.createMomentShortDate(this),this.dateTimeStampInUTC.subscribe(function(e){var t=a().unix();this.moment(a.unix(e>t?t:e))},this),this.body=null,this.plainRaw="",this.isHtml=r.observable(!1),this.hasImages=r.observable(!1),this.attachments=r.observableArray([]),this.isPgpSigned=r.observable(!1),this.isPgpEncrypted=r.observable(!1),this.pgpSignedVerifyStatus=r.observable(u.SignedVerifyStatus.None),this.pgpSignedVerifyUser=r.observable(""),this.priority=r.observable(u.MessagePriority.Normal),this.readReceipt=r.observable(""),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid=r.observable(0),this.threads=r.observableArray([]),this.threadsLen=r.observable(0),this.hasUnseenSubMessage=r.observable(!1),this.hasFlaggedSubMessage=r.observable(!1),this.lastInCollapsedThread=r.observable(!1),this.lastInCollapsedThreadLoading=r.observable(!1),this.threadsLenResult=r.computed(function(){var e=this.threadsLen();return 0===this.parentUid()&&e>0?e+1:""},this)}var o=e("../External/window.js"),i=e("../External/jquery.js"),n=e("../External/underscore.js"),r=e("../External/ko.js"),a=e("../External/moment.js"),l=e("../External/$window.js"),c=e("../External/$div.js"),u=e("../Common/Enums.js"),d=e("../Common/Utils.js"),p=e("../Common/LinkBuilder.js"),h=e("./EmailModel.js"),m=e("./AttachmentModel.js");s.newInstanceFromJson=function(e){var t=new s;return t.initByJson(e)?t:null},s.calculateFullFromatDateValue=function(e){return e>0?a.unix(e).format("LLL"):""},s.emailsToLine=function(e,t,s){var o=[],i=0,n=0;if(d.isNonEmptyArray(e))for(i=0,n=e.length;n>i;i++)o.push(e[i].toLine(t,s));return o.join(", ")},s.emailsToLineClear=function(e){var t=[],s=0,o=0;if(d.isNonEmptyArray(e))for(s=0,o=e.length;o>s;s++)e[s]&&e[s].email&&""!==e[s].name&&t.push(e[s].email);return t.join(", ")},s.initEmailsFromJson=function(e){var t=0,s=0,o=null,i=[];
|
||
if(d.isNonEmptyArray(e))for(t=0,s=e.length;s>t;t++)o=h.newInstanceFromJson(e[t]),o&&i.push(o);return i},s.replyHelper=function(e,t,s){if(e&&0<e.length)for(var o=0,i=e.length;i>o;o++)d.isUnd(t[e[o].email])&&(t[e[o].email]=!0,s.push(e[o]))},s.prototype.clear=function(){this.folderFullNameRaw="",this.uid="",this.hash="",this.requestHash="",this.subject(""),this.subjectPrefix(""),this.subjectSuffix(""),this.size(0),this.dateTimeStampInUTC(0),this.priority(u.MessagePriority.Normal),this.proxy=!1,this.fromEmailString(""),this.fromClearEmailString(""),this.toEmailsString(""),this.toClearEmailsString(""),this.senderEmailsString(""),this.senderClearEmailsString(""),this.emails=[],this.from=[],this.to=[],this.cc=[],this.bcc=[],this.replyTo=[],this.deliveredTo=[],this.newForAnimation(!1),this.deleted(!1),this.unseen(!1),this.flagged(!1),this.answered(!1),this.forwarded(!1),this.isReadReceipt(!1),this.selected(!1),this.checked(!1),this.hasAttachments(!1),this.attachmentsMainType(""),this.body=null,this.isHtml(!1),this.hasImages(!1),this.attachments([]),this.isPgpSigned(!1),this.isPgpEncrypted(!1),this.pgpSignedVerifyStatus(u.SignedVerifyStatus.None),this.pgpSignedVerifyUser(""),this.priority(u.MessagePriority.Normal),this.readReceipt(""),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid(0),this.threads([]),this.threadsLen(0),this.hasUnseenSubMessage(!1),this.hasFlaggedSubMessage(!1),this.lastInCollapsedThread(!1),this.lastInCollapsedThreadLoading(!1)},s.prototype.computeSenderEmail=function(){var t=e("../Storages/WebMailDataStorage.js"),s=t.sentFolder(),o=t.draftFolder();this.senderEmailsString(this.folderFullNameRaw===s||this.folderFullNameRaw===o?this.toEmailsString():this.fromEmailString()),this.senderClearEmailsString(this.folderFullNameRaw===s||this.folderFullNameRaw===o?this.toClearEmailsString():this.fromClearEmailString())},s.prototype.initByJson=function(e){var t=!1;return e&&"Object/Message"===e["@Object"]&&(this.folderFullNameRaw=e.Folder,this.uid=e.Uid,this.hash=e.Hash,this.requestHash=e.RequestHash,this.proxy=!!e.ExternalProxy,this.size(d.pInt(e.Size)),this.from=s.initEmailsFromJson(e.From),this.to=s.initEmailsFromJson(e.To),this.cc=s.initEmailsFromJson(e.Cc),this.bcc=s.initEmailsFromJson(e.Bcc),this.replyTo=s.initEmailsFromJson(e.ReplyTo),this.deliveredTo=s.initEmailsFromJson(e.DeliveredTo),this.subject(e.Subject),d.isArray(e.SubjectParts)?(this.subjectPrefix(e.SubjectParts[0]),this.subjectSuffix(e.SubjectParts[1])):(this.subjectPrefix(""),this.subjectSuffix(this.subject())),this.dateTimeStampInUTC(d.pInt(e.DateTimeStampInUTC)),this.hasAttachments(!!e.HasAttachments),this.attachmentsMainType(e.AttachmentsMainType),this.fromEmailString(s.emailsToLine(this.from,!0)),this.fromClearEmailString(s.emailsToLineClear(this.from)),this.toEmailsString(s.emailsToLine(this.to,!0)),this.toClearEmailsString(s.emailsToLineClear(this.to)),this.parentUid(d.pInt(e.ParentThread)),this.threads(d.isArray(e.Threads)?e.Threads:[]),this.threadsLen(d.pInt(e.ThreadsLen)),this.initFlagsByJson(e),this.computeSenderEmail(),t=!0),t},s.prototype.initUpdateByMessageJson=function(t){var s=e("../Storages/WebMailDataStorage.js"),o=!1,i=u.MessagePriority.Normal;return t&&"Object/Message"===t["@Object"]&&(i=d.pInt(t.Priority),this.priority(-1<d.inArray(i,[u.MessagePriority.High,u.MessagePriority.Low])?i:u.MessagePriority.Normal),this.aDraftInfo=t.DraftInfo,this.sMessageId=t.MessageId,this.sInReplyTo=t.InReplyTo,this.sReferences=t.References,this.proxy=!!t.ExternalProxy,s.capaOpenPGP()&&(this.isPgpSigned(!!t.PgpSigned),this.isPgpEncrypted(!!t.PgpEncrypted)),this.hasAttachments(!!t.HasAttachments),this.attachmentsMainType(t.AttachmentsMainType),this.foundedCIDs=d.isArray(t.FoundedCIDs)?t.FoundedCIDs:[],this.attachments(this.initAttachmentsFromJson(t.Attachments)),this.readReceipt(t.ReadReceipt||""),this.computeSenderEmail(),o=!0),o},s.prototype.initAttachmentsFromJson=function(e){var t=0,s=0,o=null,i=[];if(e&&"Collection/AttachmentCollection"===e["@Object"]&&d.isNonEmptyArray(e["@Collection"]))for(t=0,s=e["@Collection"].length;s>t;t++)o=m.newInstanceFromJson(e["@Collection"][t]),o&&(""!==o.cidWithOutTags&&0<this.foundedCIDs.length&&0<=d.inArray(o.cidWithOutTags,this.foundedCIDs)&&(o.isLinked=!0),i.push(o));return i},s.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},s.prototype.fromToLine=function(e,t){return s.emailsToLine(this.from,e,t)},s.prototype.toToLine=function(e,t){return s.emailsToLine(this.to,e,t)},s.prototype.ccToLine=function(e,t){return s.emailsToLine(this.cc,e,t)},s.prototype.bccToLine=function(e,t){return s.emailsToLine(this.bcc,e,t)},s.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(" ")},s.prototype.hasVisibleAttachments=function(){return!!n.find(this.attachments(),function(e){return!e.isLinked})},s.prototype.findAttachmentByCid=function(e){var t=null,s=this.attachments();return d.isNonEmptyArray(s)&&(e=e.replace(/^<+/,"").replace(/>+$/,""),t=n.find(s,function(t){return e===t.cidWithOutTags})),t||null},s.prototype.findAttachmentByContentLocation=function(e){var t=null,s=this.attachments();return d.isNonEmptyArray(s)&&(t=n.find(s,function(t){return e===t.contentLocation})),t||null},s.prototype.messageId=function(){return this.sMessageId},s.prototype.inReplyTo=function(){return this.sInReplyTo},s.prototype.references=function(){return this.sReferences},s.prototype.fromAsSingleEmail=function(){return d.isArray(this.from)&&this.from[0]?this.from[0].email:""},s.prototype.viewLink=function(){return p.messageViewLink(this.requestHash)},s.prototype.downloadLink=function(){return p.messageDownloadLink(this.requestHash)},s.prototype.replyEmails=function(e){var t=[],o=d.isUnd(e)?{}:e;return s.replyHelper(this.replyTo,o,t),0===t.length&&s.replyHelper(this.from,o,t),t},s.prototype.replyAllEmails=function(e){var t=[],o=[],i=d.isUnd(e)?{}:e;return s.replyHelper(this.replyTo,i,t),0===t.length&&s.replyHelper(this.from,i,t),s.replyHelper(this.to,i,t),s.replyHelper(this.cc,i,o),[t,o]},s.prototype.textBodyToString=function(){return this.body?this.body.html():""},s.prototype.attachmentsToStringLine=function(){var e=n.map(this.attachments(),function(e){return e.fileName+" ("+e.friendlySize+")"});return e&&0<e.length?e.join(", "):""},s.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()}},s.prototype.viewPopupMessage=function(e){d.windowPopupKnockout(this.getDataForWindowPopup(),"PopupsWindowSimpleMessage",this.subject(),function(t){t&&t.document&&t.document.body&&(i("img.lazy",t.document.body).each(function(e,t){var s=i(t),o=s.data("original"),n=s.attr("src");e>=0&&o&&!n&&s.attr("src",o)}),e&&o.setTimeout(function(){t.print()},100))})},s.prototype.printMessage=function(){this.viewPopupMessage(!0)},s.prototype.generateUid=function(){return this.folderFullNameRaw+"/"+this.uid},s.prototype.populateByMessageListItem=function(e){return this.folderFullNameRaw=e.folderFullNameRaw,this.uid=e.uid,this.hash=e.hash,this.requestHash=e.requestHash,this.subject(e.subject()),this.subjectPrefix(this.subjectPrefix()),this.subjectSuffix(this.subjectSuffix()),this.size(e.size()),this.dateTimeStampInUTC(e.dateTimeStampInUTC()),this.priority(e.priority()),this.proxy=e.proxy,this.fromEmailString(e.fromEmailString()),this.fromClearEmailString(e.fromClearEmailString()),this.toEmailsString(e.toEmailsString()),this.toClearEmailsString(e.toClearEmailsString()),this.emails=e.emails,this.from=e.from,this.to=e.to,this.cc=e.cc,this.bcc=e.bcc,this.replyTo=e.replyTo,this.deliveredTo=e.deliveredTo,this.unseen(e.unseen()),this.flagged(e.flagged()),this.answered(e.answered()),this.forwarded(e.forwarded()),this.isReadReceipt(e.isReadReceipt()),this.selected(e.selected()),this.checked(e.checked()),this.hasAttachments(e.hasAttachments()),this.attachmentsMainType(e.attachmentsMainType()),this.moment(e.moment()),this.body=null,this.priority(u.MessagePriority.Normal),this.aDraftInfo=[],this.sMessageId="",this.sInReplyTo="",this.sReferences="",this.parentUid(e.parentUid()),this.threads(e.threads()),this.threadsLen(e.threadsLen()),this.computeSenderEmail(),this},s.prototype.showExternalImages=function(e){if(this.body&&this.body.data("rl-has-images")){var t="";e=d.isUnd(e)?!1:e,this.hasImages(!1),this.body.data("rl-has-images",!1),t=this.proxy?"data-x-additional-src":"data-x-src",i("["+t+"]",this.body).each(function(){e&&i(this).is("img")?i(this).addClass("lazy").attr("data-original",i(this).attr(t)).removeAttr(t):i(this).attr("src",i(this).attr(t)).removeAttr(t)}),t=this.proxy?"data-x-additional-style-url":"data-x-style-url",i("["+t+"]",this.body).each(function(){var e=d.trim(i(this).attr("style"));e=""===e?"":";"===e.substr(-1)?e+" ":e+"; ",i(this).attr("style",e+i(this).attr(t)).removeAttr(t)}),e&&(i("img.lazy",this.body).addClass("lazy-inited").lazyload({threshold:400,effect:"fadeIn",skip_invisible:!1,container:i(".RL-MailMessageView .messageView .messageItem .content")[0]}),l.resize()),d.windowResize(500)}},s.prototype.showInternalImages=function(e){if(this.body&&!this.body.data("rl-init-internal-images")){this.body.data("rl-init-internal-images",!0),e=d.isUnd(e)?!1:e;var t=this;i("[data-x-src-cid]",this.body).each(function(){var s=t.findAttachmentByCid(i(this).attr("data-x-src-cid"));s&&s.download&&(e&&i(this).is("img")?i(this).addClass("lazy").attr("data-original",s.linkPreview()):i(this).attr("src",s.linkPreview()))}),i("[data-x-src-location]",this.body).each(function(){var s=t.findAttachmentByContentLocation(i(this).attr("data-x-src-location"));s||(s=t.findAttachmentByCid(i(this).attr("data-x-src-location"))),s&&s.download&&(e&&i(this).is("img")?i(this).addClass("lazy").attr("data-original",s.linkPreview()):i(this).attr("src",s.linkPreview()))}),i("[data-x-style-cid]",this.body).each(function(){var e="",s="",o=t.findAttachmentByCid(i(this).attr("data-x-style-cid"));o&&o.linkPreview&&(s=i(this).attr("data-x-style-cid-name"),""!==s&&(e=d.trim(i(this).attr("style")),e=""===e?"":";"===e.substr(-1)?e+" ":e+"; ",i(this).attr("style",e+s+": url('"+o.linkPreview()+"')")))}),e&&!function(e,t){n.delay(function(){e.addClass("lazy-inited").lazyload({threshold:400,effect:"fadeIn",skip_invisible:!1,container:t})},300)}(i("img.lazy",t.body),i(".RL-MailMessageView .messageView .messageItem .content")[0]),d.windowResize(500)}},s.prototype.storeDataToDom=function(){if(this.body){this.body.data("rl-is-html",!!this.isHtml()),this.body.data("rl-has-images",!!this.hasImages()),this.body.data("rl-plain-raw",this.plainRaw);var t=e("../Storages/WebMailDataStorage.js");t.capaOpenPGP()&&(this.body.data("rl-plain-pgp-signed",!!this.isPgpSigned()),this.body.data("rl-plain-pgp-encrypted",!!this.isPgpEncrypted()),this.body.data("rl-pgp-verify-status",this.pgpSignedVerifyStatus()),this.body.data("rl-pgp-verify-user",this.pgpSignedVerifyUser()))}},s.prototype.storePgpVerifyDataToDom=function(){var t=e("../Storages/WebMailDataStorage.js");this.body&&t.capaOpenPGP()&&(this.body.data("rl-pgp-verify-status",this.pgpSignedVerifyStatus()),this.body.data("rl-pgp-verify-user",this.pgpSignedVerifyUser()))},s.prototype.fetchDataToDom=function(){if(this.body){this.isHtml(!!this.body.data("rl-is-html")),this.hasImages(!!this.body.data("rl-has-images")),this.plainRaw=d.pString(this.body.data("rl-plain-raw"));var t=e("../Storages/WebMailDataStorage.js");t.capaOpenPGP()?(this.isPgpSigned(!!this.body.data("rl-plain-pgp-signed")),this.isPgpEncrypted(!!this.body.data("rl-plain-pgp-encrypted")),this.pgpSignedVerifyStatus(this.body.data("rl-pgp-verify-status")),this.pgpSignedVerifyUser(this.body.data("rl-pgp-verify-user"))):(this.isPgpSigned(!1),this.isPgpEncrypted(!1),this.pgpSignedVerifyStatus(u.SignedVerifyStatus.None),this.pgpSignedVerifyUser(""))}},s.prototype.verifyPgpSignedClearMessage=function(){if(this.isPgpSigned()){var t=[],s=null,r=e("../Storages/WebMailDataStorage.js"),a=this.from&&this.from[0]&&this.from[0].email?this.from[0].email:"",l=r.findPublicKeysByEmail(a),d=null,p=null,h="";this.pgpSignedVerifyStatus(u.SignedVerifyStatus.Error),this.pgpSignedVerifyUser("");try{s=o.openpgp.cleartext.readArmored(this.plainRaw),s&&s.getText&&(this.pgpSignedVerifyStatus(l.length?u.SignedVerifyStatus.Unverified:u.SignedVerifyStatus.UnknownPublicKeys),t=s.verify(l),t&&0<t.length&&(d=n.find(t,function(e){return e&&e.keyid&&e.valid}),d&&(p=r.findPublicKeyByHex(d.keyid.toHex()),p&&(h=s.getText(),this.pgpSignedVerifyStatus(u.SignedVerifyStatus.Success),this.pgpSignedVerifyUser(p.user),h=c.empty().append(i('<pre class="b-plain-openpgp signed verified"></pre>').text(h)).html(),c.empty(),this.replacePlaneTextBody(h)))))}catch(m){}this.storePgpVerifyDataToDom()}},s.prototype.decryptPgpEncryptedMessage=function(t){if(this.isPgpEncrypted()){var s=[],r=null,a=null,l=e("../Storages/WebMailDataStorage.js"),d=this.from&&this.from[0]&&this.from[0].email?this.from[0].email:"",p=l.findPublicKeysByEmail(d),h=l.findSelfPrivateKey(t),m=null,g=null,f="";this.pgpSignedVerifyStatus(u.SignedVerifyStatus.Error),this.pgpSignedVerifyUser(""),h||this.pgpSignedVerifyStatus(u.SignedVerifyStatus.UnknownPrivateKey);try{r=o.openpgp.message.readArmored(this.plainRaw),r&&h&&r.decrypt&&(this.pgpSignedVerifyStatus(u.SignedVerifyStatus.Unverified),a=r.decrypt(h),a&&(s=a.verify(p),s&&0<s.length&&(m=n.find(s,function(e){return e&&e.keyid&&e.valid}),m&&(g=l.findPublicKeyByHex(m.keyid.toHex()),g&&(this.pgpSignedVerifyStatus(u.SignedVerifyStatus.Success),this.pgpSignedVerifyUser(g.user)))),f=a.getText(),f=c.empty().append(i('<pre class="b-plain-openpgp signed verified"></pre>').text(f)).html(),c.empty(),this.replacePlaneTextBody(f)))}catch(b){}this.storePgpVerifyDataToDom()}},s.prototype.replacePlaneTextBody=function(e){this.body&&this.body.html(e).addClass("b-text-part plain")},s.prototype.flagHash=function(){return[this.deleted(),this.unseen(),this.flagged(),this.answered(),this.forwarded(),this.isReadReceipt()].join("")},t.exports=s}(t)},{"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/$div.js":15,"../External/$window.js":18,"../External/jquery.js":26,"../External/ko.js":28,"../External/moment.js":29,"../External/underscore.js":31,"../External/window.js":32,"../Storages/WebMailDataStorage.js":74,"./AttachmentModel.js":38,"./EmailModel.js":43}],49:[function(e,t){!function(t){"use strict";function s(e,t,s,i,n,r,a){this.index=e,this.id=s,this.guid=t,this.user=i,this.email=n,this.armor=a,this.isPrivate=!!r,this.deleteAccess=o.observable(!1)}var o=e("../External/ko.js");s.prototype.index=0,s.prototype.id="",s.prototype.guid="",s.prototype.user="",s.prototype.email="",s.prototype.armor="",s.prototype.isPrivate=!1,t.exports=s}(t)},{"../External/ko.js":28}],50:[function(e,t){!function(t){"use strict";function s(e){u.call(this,"settings",e),this.menu=n.observableArray([]),this.oCurrentSubScreen=null,this.oViewModelPlace=null}var o=e("../External/jquery.js"),i=e("../External/underscore.js"),n=e("../External/ko.js"),r=e("../Common/Globals.js"),a=e("../Common/Utils.js"),l=e("../Common/LinkBuilder.js"),c=e("../Knoin/Knoin.js"),u=e("../Knoin/KnoinAbstractScreen.js");i.extend(s.prototype,u.prototype),s.prototype.onRoute=function(e){var t=this,s=null,u=null,d=null,p=null;u=i.find(r.aViewModels.settings,function(t){return t&&t.__rlSettingsData&&e===t.__rlSettingsData.Route}),u&&(i.find(r.aViewModels["settings-removed"],function(e){return e&&e===u})&&(u=null),u&&i.find(r.aViewModels["settings-disabled"],function(e){return e&&e===u})&&(u=null)),u?(u.__builded&&u.__vm?s=u.__vm:(d=this.oViewModelPlace,d&&1===d.length?(u=u,s=new u,p=o("<div></div>").addClass("rl-settings-view-model").hide(),p.appendTo(d),s.viewModelDom=p,s.__rlSettingsData=u.__rlSettingsData,u.__dom=p,u.__builded=!0,u.__vm=s,n.applyBindingAccessorsToNode(p[0],{i18nInit:!0,template:function(){return{name:u.__rlSettingsData.Template}}},s),a.delegateRun(s,"onBuild",[p])):a.log("Cannot find sub settings view model position: SettingsSubScreen")),s&&i.defer(function(){t.oCurrentSubScreen&&(a.delegateRun(t.oCurrentSubScreen,"onHide"),t.oCurrentSubScreen.viewModelDom.hide()),t.oCurrentSubScreen=s,t.oCurrentSubScreen&&(t.oCurrentSubScreen.viewModelDom.show(),a.delegateRun(t.oCurrentSubScreen,"onShow"),a.delegateRun(t.oCurrentSubScreen,"onFocus",[],200),i.each(t.menu(),function(e){e.selected(s&&s.__rlSettingsData&&e.route===s.__rlSettingsData.Route)}),o("#rl-content .b-settings .b-content .content").scrollTop(0)),a.windowResize()})):c.setHash(l.settings(),!1,!0)},s.prototype.onHide=function(){this.oCurrentSubScreen&&this.oCurrentSubScreen.viewModelDom&&(a.delegateRun(this.oCurrentSubScreen,"onHide"),this.oCurrentSubScreen.viewModelDom.hide())},s.prototype.onBuild=function(){i.each(r.aViewModels.settings,function(e){e&&e.__rlSettingsData&&!i.find(r.aViewModels["settings-removed"],function(t){return t&&t===e})&&this.menu.push({route:e.__rlSettingsData.Route,label:e.__rlSettingsData.Label,selected:n.observable(!1),disabled:!!i.find(r.aViewModels["settings-disabled"],function(t){return t&&t===e})})},this),this.oViewModelPlace=o("#rl-content #rl-settings-subscreen")},s.prototype.routes=function(){var e=i.find(r.aViewModels.settings,function(e){return e&&e.__rlSettingsData&&e.__rlSettingsData.IsDefault}),t=e?e.__rlSettingsData.Route:"general",s={subname:/^(.*)$/,normalize_:function(e,s){return s.subname=a.isUnd(s.subname)?t:a.pString(s.subname),[s.subname]}};return[["{subname}/",s],["{subname}",s],["",s]]},t.exports=s}(t)},{"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/jquery.js":26,"../External/ko.js":28,"../External/underscore.js":31,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractScreen.js":35}],51:[function(e,t){!function(t){"use strict";function s(){var t=e("../ViewModels/LoginViewModel.js");i.call(this,"login",[t])}var o=e("../External/underscore.js"),i=e("../Knoin/KnoinAbstractScreen.js");o.extend(s.prototype,i.prototype),s.prototype.onShow=function(){var t=e("../Boots/RainLoopApp.js");t.setTitle("")},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../External/underscore.js":31,"../Knoin/KnoinAbstractScreen.js":35,"../ViewModels/LoginViewModel.js":76}],52:[function(e,t){!function(t){"use strict";function s(){var t=e("../ViewModels/MailBoxSystemDropDownViewModel.js"),s=e("../ViewModels/MailBoxFolderListViewModel.js"),o=e("../ViewModels/MailBoxMessageListViewModel.js"),i=e("../ViewModels/MailBoxMessageViewViewModel.js");c.call(this,"mailbox",[t,s,o,i]),this.oLastRoute={}}var o=e("../External/underscore.js"),i=e("../External/$html.js"),n=e("../Common/Enums.js"),r=e("../Common/Globals.js"),a=e("../Common/Utils.js"),l=e("../Common/Events.js"),c=e("../Knoin/KnoinAbstractScreen.js"),u=e("../Storages/AppSettings.js"),d=e("../Storages/WebMailDataStorage.js"),p=e("../Storages/WebMailCacheStorage.js"),h=e("../Storages/WebMailAjaxRemoteStorage.js");o.extend(s.prototype,c.prototype),s.prototype.oLastRoute={},s.prototype.setNewTitle=function(){var t=e("../Boots/RainLoopApp.js"),s=d.accountEmail(),o=d.foldersInboxUnreadCount();t.setTitle((""===s?"":(o>0?"("+o+") ":" ")+s+" - ")+a.i18n("TITLES/MAILBOX"))},s.prototype.onShow=function(){this.setNewTitle(),r.keyScope(n.KeyState.MessageList)},s.prototype.onRoute=function(t,s,o,i){var r=e("../Boots/RainLoopApp.js");if(a.isUnd(i)?1:!i){var l=p.getFolderFullNameRaw(t),c=p.getFolderFromCacheList(l);c&&(d.currentFolder(c).messageListPage(s).messageListSearch(o),n.Layout.NoPreview===d.layout()&&d.message()&&d.message(null),r.reloadMessageList())}else n.Layout.NoPreview!==d.layout()||d.message()||r.historyBack()},s.prototype.onStart=function(){var t=e("../Boots/RainLoopApp.js"),s=function(){a.windowResize()};(u.capa(n.Capa.AdditionalAccounts)||u.capa(n.Capa.AdditionalIdentities))&&t.accountsAndIdentities(),o.delay(function(){"INBOX"!==d.currentFolderFullNameRaw()&&t.folderInformation("INBOX")},1e3),o.delay(function(){t.quota()},5e3),o.delay(function(){h.appDelayStart(a.emptyFunction)},35e3),i.toggleClass("rl-no-preview-pane",n.Layout.NoPreview===d.layout()),d.folderList.subscribe(s),d.messageList.subscribe(s),d.message.subscribe(s),d.layout.subscribe(function(e){i.toggleClass("rl-no-preview-pane",n.Layout.NoPreview===e)}),l.sub("mailbox.inbox-unread-count",function(e){d.foldersInboxUnreadCount(e)}),d.foldersInboxUnreadCount.subscribe(function(){this.setNewTitle()},this)},s.prototype.routes=function(){var e=function(){return["Inbox",1,"",!0]},t=function(e,t){return t[0]=a.pString(t[0]),t[1]=a.pInt(t[1]),t[1]=0>=t[1]?1:t[1],t[2]=a.pString(t[2]),""===e&&(t[0]="Inbox",t[1]=1),[decodeURI(t[0]),t[1],decodeURI(t[2]),!1]},s=function(e,t){return t[0]=a.pString(t[0]),t[1]=a.pString(t[1]),""===e&&(t[0]="Inbox"),[decodeURI(t[0]),1,decodeURI(t[1]),!1]};return[[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)\/(.+)\/?$/,{normalize_:t}],[/^([a-zA-Z0-9]+)\/p([1-9][0-9]*)$/,{normalize_:t}],[/^([a-zA-Z0-9]+)\/(.+)\/?$/,{normalize_:s}],[/^message-preview$/,{normalize_:e}],[/^([^\/]*)$/,{normalize_:t}]]},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/Events.js":8,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/$html.js":17,"../External/underscore.js":31,"../Knoin/KnoinAbstractScreen.js":35,"../Storages/AppSettings.js":68,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailCacheStorage.js":73,"../Storages/WebMailDataStorage.js":74,"../ViewModels/MailBoxFolderListViewModel.js":77,"../ViewModels/MailBoxMessageListViewModel.js":78,"../ViewModels/MailBoxMessageViewViewModel.js":79,"../ViewModels/MailBoxSystemDropDownViewModel.js":80}],53:[function(e,t){!function(t){"use strict";function s(){var t=e("../Boots/RainLoopApp.js"),s=e("../ViewModels/SettingsSystemDropDownViewModel.js"),o=e("../ViewModels/SettingsMenuViewModel.js"),i=e("../ViewModels/SettingsPaneViewModel.js");a.call(this,[s,o,i]),n.initOnStartOrLangChange(function(){this.sSettingsTitle=n.i18n("TITLES/SETTINGS")},this,function(){t.setTitle(this.sSettingsTitle)})}var o=e("../External/underscore.js"),i=e("../Common/Enums.js"),n=e("../Common/Utils.js"),r=e("../Common/Globals.js"),a=e("./AbstractSettings.js");o.extend(s.prototype,a.prototype),s.prototype.onShow=function(){var t=e("../Boots/RainLoopApp.js");t.setTitle(this.sSettingsTitle),r.keyScope(i.KeyState.Settings)},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/underscore.js":31,"../ViewModels/SettingsMenuViewModel.js":98,"../ViewModels/SettingsPaneViewModel.js":99,"../ViewModels/SettingsSystemDropDownViewModel.js":100,"./AbstractSettings.js":50}],54:[function(e,t){!function(t){"use strict";function s(){this.accounts=c.accounts,this.processText=n.computed(function(){return c.accountsLoading()?a.i18n("SETTINGS_ACCOUNTS/LOADING_PROCESS"):""},this),this.visibility=n.computed(function(){return""===this.processText()?"hidden":"visible"},this),this.accountForDeletion=n.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1)},function(e){e&&e.deleteAccess(!0)}]})}var o=e("../External/window.js"),i=e("../External/underscore.js"),n=e("../External/ko.js"),r=e("../Common/Enums.js"),a=e("../Common/Utils.js"),l=e("../Common/LinkBuilder.js"),c=e("../Storages/WebMailDataStorage.js"),u=e("../Storages/WebMailAjaxRemoteStorage.js"),d=e("../Knoin/Knoin.js"),p=e("../ViewModels/Popups/PopupsAddAccountViewModel.js");s.prototype.addNewAccount=function(){d.showScreenPopup(p)},s.prototype.deleteAccount=function(t){if(t&&t.deleteAccess()){this.accountForDeletion(null);var s=e("../Boots/RainLoopApp.js"),n=function(e){return t===e};t&&(this.accounts.remove(n),u.accountDelete(function(e,t){r.StorageResultType.Success===e&&t&&t.Result&&t.Reload?(d.routeOff(),d.setHash(l.root(),!0),d.routeOff(),i.defer(function(){o.location.reload()})):s.accountsAndIdentities()},t.email))}},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/ko.js":28,"../External/underscore.js":31,"../External/window.js":32,"../Knoin/Knoin.js":33,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailDataStorage.js":74,"../ViewModels/Popups/PopupsAddAccountViewModel.js":81}],55:[function(e,t){!function(t){"use strict";function s(){this.changeProcess=i.observable(!1),this.errorDescription=i.observable(""),this.passwordMismatch=i.observable(!1),this.passwordUpdateError=i.observable(!1),this.passwordUpdateSuccess=i.observable(!1),this.currentPassword=i.observable(""),this.currentPassword.error=i.observable(!1),this.newPassword=i.observable(""),this.newPassword2=i.observable(""),this.currentPassword.subscribe(function(){this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.currentPassword.error(!1)},this),this.newPassword.subscribe(function(){this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.passwordMismatch(!1)},this),this.newPassword2.subscribe(function(){this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.passwordMismatch(!1)},this),this.saveNewPasswordCommand=r.createCommand(this,function(){this.newPassword()!==this.newPassword2()?(this.passwordMismatch(!0),this.errorDescription(r.i18n("SETTINGS_CHANGE_PASSWORD/ERROR_PASSWORD_MISMATCH"))):(this.changeProcess(!0),this.passwordUpdateError(!1),this.passwordUpdateSuccess(!1),this.currentPassword.error(!1),this.passwordMismatch(!1),this.errorDescription(""),a.changePassword(this.onChangePasswordResponse,this.currentPassword(),this.newPassword()))},function(){return!this.changeProcess()&&""!==this.currentPassword()&&""!==this.newPassword()&&""!==this.newPassword2()}),this.onChangePasswordResponse=o.bind(this.onChangePasswordResponse,this)}var o=e("../External/underscore.js"),i=e("../External/ko.js"),n=e("../Common/Enums.js"),r=e("../Common/Utils.js"),a=e("../Storages/WebMailAjaxRemoteStorage.js");s.prototype.onHide=function(){this.changeProcess(!1),this.currentPassword(""),this.newPassword(""),this.newPassword2(""),this.errorDescription(""),this.passwordMismatch(!1),this.currentPassword.error(!1)},s.prototype.onChangePasswordResponse=function(e,t){this.changeProcess(!1),this.passwordMismatch(!1),this.errorDescription(""),this.currentPassword.error(!1),n.StorageResultType.Success===e&&t&&t.Result?(this.currentPassword(""),this.newPassword(""),this.newPassword2(""),this.passwordUpdateSuccess(!0),this.currentPassword.error(!1)):(t&&n.Notification.CurrentPasswordIncorrect===t.ErrorCode&&this.currentPassword.error(!0),this.passwordUpdateError(!0),this.errorDescription(r.getNotification(t&&t.ErrorCode?t.ErrorCode:n.Notification.CouldNotSaveNewPassword)))},t.exports=s}(t)},{"../Common/Enums.js":7,"../Common/Utils.js":14,"../External/ko.js":28,"../External/underscore.js":31,"../Storages/WebMailAjaxRemoteStorage.js":72}],56:[function(e,t){!function(t){"use strict";function s(){this.contactsAutosave=r.contactsAutosave,this.allowContactsSync=r.allowContactsSync,this.enableContactsSync=r.enableContactsSync,this.contactsSyncUrl=r.contactsSyncUrl,this.contactsSyncUser=r.contactsSyncUser,this.contactsSyncPass=r.contactsSyncPass,this.saveTrigger=o.computed(function(){return[this.enableContactsSync()?"1":"0",this.contactsSyncUrl(),this.contactsSyncUser(),this.contactsSyncPass()].join("|")},this).extend({throttle:500}),this.saveTrigger.subscribe(function(){n.saveContactsSyncData(null,this.enableContactsSync(),this.contactsSyncUrl(),this.contactsSyncUser(),this.contactsSyncPass())},this)}var o=e("../External/ko.js"),i=e("../Common/Utils.js"),n=e("../Storages/WebMailAjaxRemoteStorage.js"),r=e("../Storages/WebMailDataStorage.js");s.prototype.onBuild=function(){r.contactsAutosave.subscribe(function(e){n.saveSettings(i.emptyFunction,{ContactsAutosave:e?"1":"0"})})},t.exports=s}(t)},{"../Common/Utils.js":14,"../External/ko.js":28,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailDataStorage.js":74}],57:[function(e,t){!function(t){"use strict";function s(){this.filters=o.observableArray([]),this.filters.loading=o.observable(!1),this.filters.subscribe(function(){i.windowResize()})}var o=e("../External/ko.js"),i=e("../Common/Utils.js");s.prototype.deleteFilter=function(e){this.filters.remove(e)},s.prototype.addFilter=function(){var t=e("../Knoin/Knoin.js"),s=e("../Models/FilterModel.js"),o=e("../ViewModels/Popups/PopupsFilterViewModel.js");t.showScreenPopup(o,[new s])},t.exports=s}(t)},{"../Common/Utils.js":14,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Models/FilterModel.js":45,"../ViewModels/Popups/PopupsFilterViewModel.js":88}],58:[function(e,t){!function(t){"use strict";function s(){this.foldersListError=c.foldersListError,this.folderList=c.folderList,this.processText=o.computed(function(){var e=c.foldersLoading(),t=c.foldersCreating(),s=c.foldersDeleting(),o=c.foldersRenaming();return t?n.i18n("SETTINGS_FOLDERS/CREATING_PROCESS"):s?n.i18n("SETTINGS_FOLDERS/DELETING_PROCESS"):o?n.i18n("SETTINGS_FOLDERS/RENAMING_PROCESS"):e?n.i18n("SETTINGS_FOLDERS/LOADING_PROCESS"):""},this),this.visibility=o.computed(function(){return""===this.processText()?"hidden":"visible"},this),this.folderForDeletion=o.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1)},function(e){e&&e.deleteAccess(!0)}]}),this.folderForEdit=o.observable(null).extend({toggleSubscribe:[this,function(e){e&&e.edited(!1)},function(e){e&&e.canBeEdited()&&e.edited(!0)}]}),this.useImapSubscribe=!!a.settingsGet("UseImapSubscribe")}var o=e("../External/ko.js"),i=e("../Common/Enums.js"),n=e("../Common/Utils.js"),r=e("../Knoin/Knoin.js"),a=e("../Storages/AppSettings.js"),l=e("../Storages/LocalStorage.js"),c=e("../Storages/WebMailDataStorage.js"),u=e("../Storages/WebMailCacheStorage.js"),d=e("../Storages/WebMailAjaxRemoteStorage.js"),p=e("../ViewModels/Popups/PopupsFolderCreateViewModel.js"),h=e("../ViewModels/Popups/PopupsFolderSystemViewModel.js");s.prototype.folderEditOnEnter=function(t){var s=e("../Boots/RainLoopApp.js"),o=t?n.trim(t.nameForEdit()):"";""!==o&&t.name()!==o&&(l.set(i.ClientSideKeyName.FoldersLashHash,""),c.foldersRenaming(!0),d.folderRename(function(e,t){c.foldersRenaming(!1),i.StorageResultType.Success===e&&t&&t.Result||c.foldersListError(t&&t.ErrorCode?n.getNotification(t.ErrorCode):n.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER")),s.folders()},t.fullNameRaw,o),u.removeFolderFromCacheList(t.fullNameRaw),t.name(o)),t.edited(!1)},s.prototype.folderEditOnEsc=function(e){e&&e.edited(!1)},s.prototype.onShow=function(){c.foldersListError("")},s.prototype.createFolder=function(){r.showScreenPopup(p)},s.prototype.systemFolder=function(){r.showScreenPopup(h)},s.prototype.deleteFolder=function(t){if(t&&t.canBeDeleted()&&t.deleteAccess()&&0===t.privateMessageCountAll()){this.folderForDeletion(null);var s=e("../Boots/RainLoopApp.js"),o=function(e){return t===e?!0:(e.subFolders.remove(o),!1)
|
||
};t&&(l.set(i.ClientSideKeyName.FoldersLashHash,""),c.folderList.remove(o),c.foldersDeleting(!0),d.folderDelete(function(e,t){c.foldersDeleting(!1),i.StorageResultType.Success===e&&t&&t.Result||c.foldersListError(t&&t.ErrorCode?n.getNotification(t.ErrorCode):n.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER")),s.folders()},t.fullNameRaw),u.removeFolderFromCacheList(t.fullNameRaw))}else 0<t.privateMessageCountAll()&&c.foldersListError(n.getNotification(i.Notification.CantDeleteNonEmptyFolder))},s.prototype.subscribeFolder=function(e){l.set(i.ClientSideKeyName.FoldersLashHash,""),d.folderSetSubscribe(n.emptyFunction,e.fullNameRaw,!0),e.subScribed(!0)},s.prototype.unSubscribeFolder=function(e){l.set(i.ClientSideKeyName.FoldersLashHash,""),d.folderSetSubscribe(n.emptyFunction,e.fullNameRaw,!1),e.subScribed(!1)},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/Utils.js":14,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Storages/AppSettings.js":68,"../Storages/LocalStorage.js":69,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailCacheStorage.js":73,"../Storages/WebMailDataStorage.js":74,"../ViewModels/Popups/PopupsFolderCreateViewModel.js":90,"../ViewModels/Popups/PopupsFolderSystemViewModel.js":91}],59:[function(e,t){!function(t){"use strict";function s(){this.mainLanguage=u.mainLanguage,this.mainMessagesPerPage=u.mainMessagesPerPage,this.mainMessagesPerPageArray=r.Defaults.MessagesPerPageArray,this.editorDefaultType=u.editorDefaultType,this.showImages=u.showImages,this.interfaceAnimation=u.interfaceAnimation,this.useDesktopNotifications=u.useDesktopNotifications,this.threading=u.threading,this.useThreads=u.useThreads,this.replySameFolder=u.replySameFolder,this.layout=u.layout,this.usePreviewPane=u.usePreviewPane,this.useCheckboxesInList=u.useCheckboxesInList,this.allowLanguagesOnSettings=u.allowLanguagesOnSettings,this.isDesktopNotificationsSupported=i.computed(function(){return n.DesktopNotifications.NotSupported!==u.desktopNotificationsPermisions()}),this.isDesktopNotificationsDenied=i.computed(function(){return n.DesktopNotifications.NotSupported===u.desktopNotificationsPermisions()||n.DesktopNotifications.Denied===u.desktopNotificationsPermisions()}),this.mainLanguageFullName=i.computed(function(){return l.convertLangName(this.mainLanguage())},this),this.languageTrigger=i.observable(n.SaveSettingsStep.Idle).extend({throttle:100}),this.mppTrigger=i.observable(n.SaveSettingsStep.Idle),this.isAnimationSupported=a.bAnimationSupported}var o=e("../External/jquery.js"),i=e("../External/ko.js"),n=e("../Common/Enums.js"),r=e("../Common/Consts.js"),a=e("../Common/Globals.js"),l=e("../Common/Utils.js"),c=e("../Common/LinkBuilder.js"),u=e("../Storages/WebMailDataStorage.js"),d=e("../Storages/WebMailAjaxRemoteStorage.js"),p=e("../Knoin/Knoin.js"),h=e("../ViewModels/Popups/PopupsLanguagesViewModel.js");s.prototype.toggleLayout=function(){this.layout(n.Layout.NoPreview===this.layout()?n.Layout.SidePreview:n.Layout.NoPreview)},s.prototype.onBuild=function(){var e=this;_.delay(function(){var t=l.settingsSaveHelperSimpleFunction(e.mppTrigger,e);u.language.subscribe(function(t){e.languageTrigger(n.SaveSettingsStep.Animate),o.ajax({url:c.langLink(t),dataType:"script",cache:!0}).done(function(){l.i18nReload(),e.languageTrigger(n.SaveSettingsStep.TrueResult)}).fail(function(){e.languageTrigger(n.SaveSettingsStep.FalseResult)}).always(function(){_.delay(function(){e.languageTrigger(n.SaveSettingsStep.Idle)},1e3)}),d.saveSettings(l.emptyFunction,{Language:t})}),u.editorDefaultType.subscribe(function(e){d.saveSettings(l.emptyFunction,{EditorDefaultType:e})}),u.messagesPerPage.subscribe(function(e){d.saveSettings(t,{MPP:e})}),u.showImages.subscribe(function(e){d.saveSettings(l.emptyFunction,{ShowImages:e?"1":"0"})}),u.interfaceAnimation.subscribe(function(e){d.saveSettings(l.emptyFunction,{InterfaceAnimation:e})}),u.useDesktopNotifications.subscribe(function(e){l.timeOutAction("SaveDesktopNotifications",function(){d.saveSettings(l.emptyFunction,{DesktopNotifications:e?"1":"0"})},3e3)}),u.replySameFolder.subscribe(function(e){l.timeOutAction("SaveReplySameFolder",function(){d.saveSettings(l.emptyFunction,{ReplySameFolder:e?"1":"0"})},3e3)}),u.useThreads.subscribe(function(e){u.messageList([]),d.saveSettings(l.emptyFunction,{UseThreads:e?"1":"0"})}),u.layout.subscribe(function(e){u.messageList([]),d.saveSettings(l.emptyFunction,{Layout:e})}),u.useCheckboxesInList.subscribe(function(e){d.saveSettings(l.emptyFunction,{UseCheckboxesInList:e?"1":"0"})})},50)},s.prototype.onShow=function(){u.desktopNotifications.valueHasMutated()},s.prototype.selectLanguage=function(){p.showScreenPopup(h)},t.exports=s}(t)},{"../Common/Consts.js":6,"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/jquery.js":26,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailDataStorage.js":74,"../ViewModels/Popups/PopupsLanguagesViewModel.js":95}],60:[function(e,t){!function(t){"use strict";function s(){this.editor=null,this.defautOptionsAfterRender=n.defautOptionsAfterRender,this.accountEmail=a.accountEmail,this.displayName=a.displayName,this.signature=a.signature,this.signatureToAll=a.signatureToAll,this.replyTo=a.replyTo,this.signatureDom=o.observable(null),this.defaultIdentityIDTrigger=o.observable(i.SaveSettingsStep.Idle),this.displayNameTrigger=o.observable(i.SaveSettingsStep.Idle),this.replyTrigger=o.observable(i.SaveSettingsStep.Idle),this.signatureTrigger=o.observable(i.SaveSettingsStep.Idle),this.identities=a.identities,this.defaultIdentityID=a.defaultIdentityID,this.identitiesOptions=o.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}),_.each(e,function(e){t.push({id:e.id,name:e.formattedNameForEmail(),seporator:!1})})),t},this),this.processText=o.computed(function(){return a.identitiesLoading()?n.i18n("SETTINGS_IDENTITIES/LOADING_PROCESS"):""},this),this.visibility=o.computed(function(){return""===this.processText()?"hidden":"visible"},this),this.identityForDeletion=o.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1)},function(e){e&&e.deleteAccess(!0)}]})}var o=e("../External/ko.js"),i=e("../Common/Enums.js"),n=e("../Common/Utils.js"),r=e("../Common/NewHtmlEditorWrapper.js"),a=e("../Storages/WebMailDataStorage.js"),l=e("../Storages/WebMailAjaxRemoteStorage.js"),c=e("../Knoin/Knoin.js"),u=e("../ViewModels/Popups/PopupsIdentityViewModel.js");s.prototype.formattedAccountIdentity=function(){var e=this.displayName.peek(),t=this.accountEmail.peek();return""===e?t:'"'+n.quoteName(e)+'" <'+t+">"},s.prototype.addNewIdentity=function(){c.showScreenPopup(u)},s.prototype.editIdentity=function(e){c.showScreenPopup(u,[e])},s.prototype.deleteIdentity=function(t){if(t&&t.deleteAccess()){this.identityForDeletion(null);var s=e("../Boots/RainLoopApp.js"),o=function(e){return t===e};t&&(this.identities.remove(o),l.identityDelete(function(){s.accountsAndIdentities()},t.id))}},s.prototype.onFocus=function(){if(!this.editor&&this.signatureDom()){var e=this,t=a.signature();this.editor=new r(e.signatureDom(),function(){a.signature((e.editor.isHtml()?":HTML:":"")+e.editor.getData())},function(){":HTML:"===t.substr(0,6)?e.editor.setHtml(t.substr(6),!1):e.editor.setPlain(t,!1)})}},s.prototype.onBuild=function(e){var t=this;e.on("click",".identity-item .e-action",function(){var e=o.dataFor(this);e&&t.editIdentity(e)}),_.delay(function(){var e=n.settingsSaveHelperSimpleFunction(t.displayNameTrigger,t),s=n.settingsSaveHelperSimpleFunction(t.replyTrigger,t),o=n.settingsSaveHelperSimpleFunction(t.signatureTrigger,t),i=n.settingsSaveHelperSimpleFunction(t.defaultIdentityIDTrigger,t);a.defaultIdentityID.subscribe(function(e){l.saveSettings(i,{DefaultIdentityID:e})}),a.displayName.subscribe(function(t){l.saveSettings(e,{DisplayName:t})}),a.replyTo.subscribe(function(e){l.saveSettings(s,{ReplyTo:e})}),a.signature.subscribe(function(e){l.saveSettings(o,{Signature:e})}),a.signatureToAll.subscribe(function(e){l.saveSettings(null,{SignatureToAll:e?"1":"0"})})},50)},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/NewHtmlEditorWrapper.js":11,"../Common/Utils.js":14,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailDataStorage.js":74,"../ViewModels/Popups/PopupsIdentityViewModel.js":93}],61:[function(e,t){!function(t){"use strict";function s(){this.editor=null,this.displayName=a.displayName,this.signature=a.signature,this.signatureToAll=a.signatureToAll,this.replyTo=a.replyTo,this.signatureDom=o.observable(null),this.displayNameTrigger=o.observable(i.SaveSettingsStep.Idle),this.replyTrigger=o.observable(i.SaveSettingsStep.Idle),this.signatureTrigger=o.observable(i.SaveSettingsStep.Idle)}var o=e("../External/ko.js"),i=e("../Common/Enums.js"),n=e("../Common/Utils.js"),r=e("../Common/NewHtmlEditorWrapper.js"),a=e("../Storages/WebMailDataStorage.js"),l=e("../Storages/WebMailAjaxRemoteStorage.js");s.prototype.onFocus=function(){if(!this.editor&&this.signatureDom()){var e=this,t=a.signature();this.editor=new r(e.signatureDom(),function(){a.signature((e.editor.isHtml()?":HTML:":"")+e.editor.getData())},function(){":HTML:"===t.substr(0,6)?e.editor.setHtml(t.substr(6),!1):e.editor.setPlain(t,!1)})}},s.prototype.onBuild=function(){var e=this;_.delay(function(){var t=n.settingsSaveHelperSimpleFunction(e.displayNameTrigger,e),s=n.settingsSaveHelperSimpleFunction(e.replyTrigger,e),o=n.settingsSaveHelperSimpleFunction(e.signatureTrigger,e);a.displayName.subscribe(function(e){l.saveSettings(t,{DisplayName:e})}),a.replyTo.subscribe(function(e){l.saveSettings(s,{ReplyTo:e})}),a.signature.subscribe(function(e){l.saveSettings(o,{Signature:e})}),a.signatureToAll.subscribe(function(e){l.saveSettings(null,{SignatureToAll:e?"1":"0"})})},50)},t.exports=s}(t)},{"../Common/Enums.js":7,"../Common/NewHtmlEditorWrapper.js":11,"../Common/Utils.js":14,"../External/ko.js":28,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailDataStorage.js":74}],62:[function(e,t){!function(t){"use strict";function s(){this.openpgpkeys=n.openpgpkeys,this.openpgpkeysPublic=n.openpgpkeysPublic,this.openpgpkeysPrivate=n.openpgpkeysPrivate,this.openPgpKeyForDeletion=o.observable(null).extend({falseTimeout:3e3}).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1)},function(e){e&&e.deleteAccess(!0)}]})}var o=e("../External/ko.js"),i=e("../Knoin/Knoin.js"),n=e("../Storages/WebMailDataStorage.js"),r=e("../ViewModels/Popups/PopupsAddOpenPgpKeyViewModel.js"),a=e("../ViewModels/Popups/PopupsGenerateNewOpenPgpKeyViewModel.js"),l=e("../ViewModels/Popups/PopupsViewOpenPgpKeyViewModel.js");s.prototype.addOpenPgpKey=function(){i.showScreenPopup(r)},s.prototype.generateOpenPgpKey=function(){i.showScreenPopup(a)},s.prototype.viewOpenPgpKey=function(e){e&&i.showScreenPopup(l,[e])},s.prototype.deleteOpenPgpKey=function(t){if(t&&t.deleteAccess()&&(this.openPgpKeyForDeletion(null),t&&n.openpgpKeyring)){this.openpgpkeys.remove(function(e){return t===e}),n.openpgpKeyring[t.isPrivate?"privateKeys":"publicKeys"].removeForId(t.guid),n.openpgpKeyring.store();var s=e("../Boots/RainLoopApp.js");s.reloadOpenPgpKeys()}},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Storages/WebMailDataStorage.js":74,"../ViewModels/Popups/PopupsAddOpenPgpKeyViewModel.js":82,"../ViewModels/Popups/PopupsGenerateNewOpenPgpKeyViewModel.js":92,"../ViewModels/Popups/PopupsViewOpenPgpKeyViewModel.js":97}],63:[function(e,t){!function(t){"use strict";function s(){this.processing=o.observable(!1),this.clearing=o.observable(!1),this.secreting=o.observable(!1),this.viewUser=o.observable(""),this.viewEnable=o.observable(!1),this.viewEnable.subs=!0,this.twoFactorStatus=o.observable(!1),this.viewSecret=o.observable(""),this.viewBackupCodes=o.observable(""),this.viewUrl=o.observable(""),this.bFirst=!0,this.viewTwoFactorStatus=o.computed(function(){return n.langChangeTrigger(),r.i18n(this.twoFactorStatus()?"SETTINGS_SECURITY/TWO_FACTOR_SECRET_CONFIGURED_DESC":"SETTINGS_SECURITY/TWO_FACTOR_SECRET_NOT_CONFIGURED_DESC")},this),this.onResult=_.bind(this.onResult,this),this.onSecretResult=_.bind(this.onSecretResult,this)}var o=e("../External/ko.js"),i=e("../Common/Enums.js"),n=e("../Common/Globals.js"),r=e("../Common/Utils.js"),a=e("../Storages/WebMailAjaxRemoteStorage.js"),l=e("../Knoin/Knoin.js"),c=e("../ViewModels/Popups/PopupsTwoFactorTestViewModel.js");s.prototype.showSecret=function(){this.secreting(!0),a.showTwoFactorSecret(this.onSecretResult)},s.prototype.hideSecret=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")},s.prototype.createTwoFactor=function(){this.processing(!0),a.createTwoFactor(this.onResult)},s.prototype.enableTwoFactor=function(){this.processing(!0),a.enableTwoFactor(this.onResult,this.viewEnable())},s.prototype.testTwoFactor=function(){l.showScreenPopup(c)},s.prototype.clearTwoFactor=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl(""),this.clearing(!0),a.clearTwoFactor(this.onResult)},s.prototype.onShow=function(){this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")},s.prototype.onResult=function(e,t){if(this.processing(!1),this.clearing(!1),i.StorageResultType.Success===e&&t&&t.Result?(this.viewUser(r.pString(t.Result.User)),this.viewEnable(!!t.Result.Enable),this.twoFactorStatus(!!t.Result.IsSet),this.viewSecret(r.pString(t.Result.Secret)),this.viewBackupCodes(r.pString(t.Result.BackupCodes).replace(/[\s]+/g," ")),this.viewUrl(r.pString(t.Result.Url))):(this.viewUser(""),this.viewEnable(!1),this.twoFactorStatus(!1),this.viewSecret(""),this.viewBackupCodes(""),this.viewUrl("")),this.bFirst){this.bFirst=!1;var s=this;this.viewEnable.subscribe(function(e){this.viewEnable.subs&&a.enableTwoFactor(function(e,t){i.StorageResultType.Success===e&&t&&t.Result||(s.viewEnable.subs=!1,s.viewEnable(!1),s.viewEnable.subs=!0)},e)},this)}},s.prototype.onSecretResult=function(e,t){this.secreting(!1),i.StorageResultType.Success===e&&t&&t.Result?(this.viewSecret(r.pString(t.Result.Secret)),this.viewUrl(r.pString(t.Result.Url))):(this.viewSecret(""),this.viewUrl(""))},s.prototype.onBuild=function(){this.processing(!0),a.getTwoFactor(this.onResult)},t.exports=s}(t)},{"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Storages/WebMailAjaxRemoteStorage.js":72,"../ViewModels/Popups/PopupsTwoFactorTestViewModel.js":96}],64:[function(e,t){!function(t){"use strict";function s(){var t=e("../Common/Utils.js"),s=e("../Boots/RainLoopApp.js"),o=e("../Storages/WebMailDataStorage.js");this.googleEnable=o.googleEnable,this.googleActions=o.googleActions,this.googleLoggined=o.googleLoggined,this.googleUserName=o.googleUserName,this.facebookEnable=o.facebookEnable,this.facebookActions=o.facebookActions,this.facebookLoggined=o.facebookLoggined,this.facebookUserName=o.facebookUserName,this.twitterEnable=o.twitterEnable,this.twitterActions=o.twitterActions,this.twitterLoggined=o.twitterLoggined,this.twitterUserName=o.twitterUserName,this.connectGoogle=t.createCommand(this,function(){this.googleLoggined()||s.googleConnect()},function(){return!this.googleLoggined()&&!this.googleActions()}),this.disconnectGoogle=t.createCommand(this,function(){s.googleDisconnect()}),this.connectFacebook=t.createCommand(this,function(){this.facebookLoggined()||s.facebookConnect()},function(){return!this.facebookLoggined()&&!this.facebookActions()}),this.disconnectFacebook=t.createCommand(this,function(){s.facebookDisconnect()}),this.connectTwitter=t.createCommand(this,function(){this.twitterLoggined()||s.twitterConnect()},function(){return!this.twitterLoggined()&&!this.twitterActions()}),this.disconnectTwitter=t.createCommand(this,function(){s.twitterDisconnect()})}t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Utils.js":14,"../Storages/WebMailDataStorage.js":74}],65:[function(e,t){!function(t){"use strict";function s(){var e=this;this.mainTheme=c.mainTheme,this.themesObjects=n.observableArray([]),this.themeTrigger=n.observable(r.SaveSettingsStep.Idle).extend({throttle:100}),this.oLastAjax=null,this.iTimer=0,c.theme.subscribe(function(t){_.each(this.themesObjects(),function(e){e.selected(t===e.name)});var s=i("#rlThemeLink"),n=i("#rlThemeStyle"),l=s.attr("href");l||(l=n.attr("data-href")),l&&(l=l.toString().replace(/\/-\/[^\/]+\/\-\//,"/-/"+t+"/-/"),l=l.toString().replace(/\/Css\/[^\/]+\/User\//,"/Css/0/User/"),"Json/"!==l.substring(l.length-5,l.length)&&(l+="Json/"),o.clearTimeout(e.iTimer),e.themeTrigger(r.SaveSettingsStep.Animate),this.oLastAjax&&this.oLastAjax.abort&&this.oLastAjax.abort(),this.oLastAjax=i.ajax({url:l,dataType:"json"}).done(function(t){t&&a.isArray(t)&&2===t.length&&(!s||!s[0]||n&&n[0]||(n=i('<style id="rlThemeStyle"></style>'),s.after(n),s.remove()),n&&n[0]&&(n.attr("data-href",l).attr("data-theme",t[0]),n&&n[0]&&n[0].styleSheet&&!a.isUnd(n[0].styleSheet.cssText)?n[0].styleSheet.cssText=t[1]:n.text(t[1])),e.themeTrigger(r.SaveSettingsStep.TrueResult))}).always(function(){e.iTimer=o.setTimeout(function(){e.themeTrigger(r.SaveSettingsStep.Idle)},1e3),e.oLastAjax=null})),u.saveSettings(null,{Theme:t})},this)}var o=e("../External/window.js"),i=e("../External/jquery.js"),n=e("../External/ko.js"),r=e("../Common/Enums.js"),a=e("../Common/Utils.js"),l=e("../Common/LinkBuilder.js"),c=e("../Storages/WebMailDataStorage.js"),u=e("../Storages/WebMailAjaxRemoteStorage.js");s.prototype.onBuild=function(){var e=c.theme();this.themesObjects(_.map(c.themes(),function(t){return{name:t,nameDisplay:a.convertThemeName(t),selected:n.observable(t===e),themePreviewSrc:l.themePreviewLink(t)}}))},t.exports=s}(t)},{"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/jquery.js":26,"../External/ko.js":28,"../External/window.js":32,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailDataStorage.js":74}],66:[function(e,t){!function(t){"use strict";function s(){this.oRequests={}}var o=e("../External/window.js"),i=e("../External/jquery.js"),n=e("../Common/Consts.js"),r=e("../Common/Enums.js"),a=e("../Common/Globals.js"),l=e("../Common/Utils.js"),c=e("../Common/Plugins.js"),u=e("../Common/LinkBuilder.js"),d=e("./AppSettings.js");s.prototype.oRequests={},s.prototype.defaultResponse=function(e,t,s,i,u,d){var p=function(){r.StorageResultType.Success!==s&&a.bUnload&&(s=r.StorageResultType.Unload),r.StorageResultType.Success===s&&i&&!i.Result?(i&&-1<l.inArray(i.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])&&a.iAjaxErrorCount++,i&&r.Notification.InvalidToken===i.ErrorCode&&a.iTokenErrorCount++,n.Values.TokenErrorLimit<a.iTokenErrorCount&&a.__RL&&a.__RL.loginAndLogoutReload(!0),(i.Logout||n.Values.AjaxErrorLimit<a.iAjaxErrorCount)&&(o.__rlah_clear&&o.__rlah_clear(),a.__RL&&a.__RL.loginAndLogoutReload(!0))):r.StorageResultType.Success===s&&i&&i.Result&&(a.iAjaxErrorCount=0,a.iTokenErrorCount=0),e&&(c.runHook("ajax-default-response",[t,r.StorageResultType.Success===s?i:null,s,u,d]),e(s,r.StorageResultType.Success===s?i:null,u,t,d))};switch(s){case"success":s=r.StorageResultType.Success;break;case"abort":s=r.StorageResultType.Abort;break;default:s=r.StorageResultType.Error}r.StorageResultType.Error===s?_.delay(p,300):p()},s.prototype.ajaxRequest=function(e,t,s,n,r){var a=this,c=""===n,p={},h=(new o.Date).getTime(),m=null,g="";return t=t||{},s=l.isNormal(s)?s:2e4,n=l.isUnd(n)?"":l.pString(n),r=l.isArray(r)?r:[],g=t.Action||"",g&&0<r.length&&_.each(r,function(e){a.oRequests[e]&&(a.oRequests[e].__aborted=!0,a.oRequests[e].abort&&a.oRequests[e].abort(),a.oRequests[e]=null)}),c&&(t.XToken=d.settingsGet("Token")),m=i.ajax({type:c?"POST":"GET",url:u.ajax(n),async:!0,dataType:"json",data:c?t:{},headers:p,timeout:s,global:!0}),m.always(function(s,i){var n=!1;s&&s.Time&&(n=l.pInt(s.Time)>(new o.Date).getTime()-h),g&&a.oRequests[g]&&(a.oRequests[g].__aborted&&(i="abort"),a.oRequests[g]=null),a.defaultResponse(e,g,i,s,n,t)}),g&&0<r.length&&-1<l.inArray(g,r)&&(this.oRequests[g]&&(this.oRequests[g].__aborted=!0,this.oRequests[g].abort&&this.oRequests[g].abort(),this.oRequests[g]=null),this.oRequests[g]=m),m},s.prototype.defaultRequest=function(e,t,s,o,i,r){s=s||{},s.Action=t,i=l.pString(i),c.runHook("ajax-default-request",[t,s,i]),this.ajaxRequest(e,s,l.isUnd(o)?n.Defaults.DefaultAjaxTimeout:l.pInt(o),i,r)},s.prototype.noop=function(e){this.defaultRequest(e,"Noop")},s.prototype.jsError=function(e,t,s,o,i,n,r){this.defaultRequest(e,"JsError",{Message:t,FileName:s,LineNo:o,Location:i,HtmlCapa:n,TimeOnPage:r})},s.prototype.jsInfo=function(e,t,s,o){this.defaultRequest(e,"JsInfo",{Type:t,Data:s,IsError:(l.isUnd(o)?1:!o)?"0":"1"})},s.prototype.getPublicKey=function(e){this.defaultRequest(e,"GetPublicKey")},s.prototype.jsVersion=function(e,t){this.defaultRequest(e,"Version",{Version:t})},t.exports=s}(t)},{"../Common/Consts.js":6,"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Plugins.js":12,"../Common/Utils.js":14,"../External/jquery.js":26,"../External/window.js":32,"./AppSettings.js":68}],67:[function(e,t){!function(t){"use strict";function s(){i.initDataConstructorBySettings(this)}var o=e("../Common/Enums.js"),i=e("../Common/Utils.js"),n=e("./AppSettings.js");s.prototype.populateDataOnStart=function(){var e=i.pInt(n.settingsGet("Layout")),t=n.settingsGet("Languages"),s=n.settingsGet("Themes");i.isArray(t)&&this.languages(t),i.isArray(s)&&this.themes(s),this.mainLanguage(n.settingsGet("Language")),this.mainTheme(n.settingsGet("Theme")),this.capaAdditionalAccounts(n.capa(o.Capa.AdditionalAccounts)),this.capaAdditionalIdentities(n.capa(o.Capa.AdditionalIdentities)),this.capaGravatar(n.capa(o.Capa.Gravatar)),this.determineUserLanguage(!!n.settingsGet("DetermineUserLanguage")),this.determineUserDomain(!!n.settingsGet("DetermineUserDomain")),this.capaThemes(n.capa(o.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(o.Layout.SidePreview),-1<i.inArray(e,[o.Layout.NoPreview,o.Layout.SidePreview,o.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"))},t.exports=s}(t)},{"../Common/Enums.js":7,"../Common/Utils.js":14,"./AppSettings.js":68}],68:[function(e,t){!function(t){"use strict";function s(){this.oSettings=null}var o=e("../External/AppData.js"),i=e("../Common/Utils.js");s.prototype.oSettings=null,s.prototype.settingsGet=function(e){return null===this.oSettings&&(this.oSettings=i.isNormal(o)?o:{}),i.isUnd(this.oSettings[e])?null:this.oSettings[e]},s.prototype.settingsSet=function(e,t){null===this.oSettings&&(this.oSettings=i.isNormal(o)?o:{}),this.oSettings[e]=t},s.prototype.capa=function(e){var t=this.settingsGet("Capa");return i.isArray(t)&&i.isNormal(e)&&-1<i.inArray(e,t)},t.exports=new s}(t)},{"../Common/Utils.js":14,"../External/AppData.js":19}],69:[function(e,t){!function(t){"use strict";function s(){var e=o.find([n,i],function(e){return e.supported()});e&&(e=e,this.oDriver=new e)}var o=e("../External/underscore.js"),i=e("./LocalStorages/CookieDriver.js"),n=e("./LocalStorages/LocalStorageDriver.js");s.prototype.oDriver=null,s.prototype.set=function(e,t){return this.oDriver?this.oDriver.set("p"+e,t):!1},s.prototype.get=function(e){return this.oDriver?this.oDriver.get("p"+e):null},t.exports=new s}(t)},{"../External/underscore.js":31,"./LocalStorages/CookieDriver.js":70,"./LocalStorages/LocalStorageDriver.js":71}],70:[function(e,t){!function(t){"use strict";function s(){}var o=e("../../External/jquery.js"),i=e("../../External/JSON.js"),n=e("../../Common/Consts.js"),r=e("../../Common/Utils.js");s.supported=function(){return!0},s.prototype.set=function(e,t){var s=o.cookie(n.Values.ClientSideCookieIndexName),r=!1,a=null;try{a=null===s?null:i.parse(s),a||(a={}),a[e]=t,o.cookie(n.Values.ClientSideCookieIndexName,i.stringify(a),{expires:30}),r=!0}catch(l){}return r},s.prototype.get=function(e){var t=o.cookie(n.Values.ClientSideCookieIndexName),s=null;try{s=null===t?null:i.parse(t),s=s&&!r.isUnd(s[e])?s[e]:null}catch(a){}return s},t.exports=s}(t)},{"../../Common/Consts.js":6,"../../Common/Utils.js":14,"../../External/JSON.js":20,"../../External/jquery.js":26}],71:[function(e,t){!function(t){"use strict";function s(){}var o=e("../../External/window.js"),i=e("../../External/JSON.js"),n=e("../../Common/Consts.js"),r=e("../../Common/Utils.js");s.supported=function(){return!!o.localStorage},s.prototype.set=function(e,t){var s=o.localStorage[n.Values.ClientSideCookieIndexName]||null,r=!1,a=null;try{a=null===s?null:i.parse(s),a||(a={}),a[e]=t,o.localStorage[n.Values.ClientSideCookieIndexName]=i.stringify(a),r=!0}catch(l){}return r},s.prototype.get=function(e){var t=o.localStorage[n.Values.ClientSideCookieIndexName]||null,s=null;try{s=null===t?null:i.parse(t),s=s&&!r.isUnd(s[e])?s[e]:null}catch(a){}return s},t.exports=s}(t)},{"../../Common/Consts.js":6,"../../Common/Utils.js":14,"../../External/JSON.js":20,"../../External/window.js":32}],72:[function(e,t){!function(t){"use strict";function s(){d.call(this),this.oRequests={}}var o=e("../External/underscore.js"),i=e("../Common/Utils.js"),n=e("../Common/Consts.js"),r=e("../Common/Globals.js"),a=e("../Common/Base64.js"),l=e("./AppSettings.js"),c=e("./WebMailCacheStorage.js"),u=e("./WebMailDataStorage.js"),d=e("./AbstractAjaxRemoteStorage.js");o.extend(s.prototype,d.prototype),s.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"])},s.prototype.login=function(e,t,s,o,i,n,r,a){this.defaultRequest(e,"Login",{Email:t,Login:s,Password:o,Language:n||"",AdditionalCode:r||"",AdditionalCodeSignMe:a?"1":"0",SignMe:i?"1":"0"})},s.prototype.getTwoFactor=function(e){this.defaultRequest(e,"GetTwoFactorInfo")},s.prototype.createTwoFactor=function(e){this.defaultRequest(e,"CreateTwoFactorSecret")},s.prototype.clearTwoFactor=function(e){this.defaultRequest(e,"ClearTwoFactorInfo")},s.prototype.showTwoFactorSecret=function(e){this.defaultRequest(e,"ShowTwoFactorSecret")},s.prototype.testTwoFactor=function(e,t){this.defaultRequest(e,"TestTwoFactorInfo",{Code:t})},s.prototype.enableTwoFactor=function(e,t){this.defaultRequest(e,"EnableTwoFactor",{Enable:t?"1":"0"})},s.prototype.clearTwoFactorInfo=function(e){this.defaultRequest(e,"ClearTwoFactorInfo")},s.prototype.contactsSync=function(e){this.defaultRequest(e,"ContactsSync",null,n.Defaults.ContactsSyncAjaxTimeout)},s.prototype.saveContactsSyncData=function(e,t,s,o,i){this.defaultRequest(e,"SaveContactsSyncData",{Enable:t?"1":"0",Url:s,User:o,Password:i})},s.prototype.accountAdd=function(e,t,s,o){this.defaultRequest(e,"AccountAdd",{Email:t,Login:s,Password:o})},s.prototype.accountDelete=function(e,t){this.defaultRequest(e,"AccountDelete",{EmailToDelete:t})},s.prototype.identityUpdate=function(e,t,s,o,i,n){this.defaultRequest(e,"IdentityUpdate",{Id:t,Email:s,Name:o,ReplyTo:i,Bcc:n})},s.prototype.identityDelete=function(e,t){this.defaultRequest(e,"IdentityDelete",{IdToDelete:t})},s.prototype.accountsAndIdentities=function(e){this.defaultRequest(e,"AccountsAndIdentities")},s.prototype.messageList=function(e,t,s,o,r,l){t=i.pString(t);var d=c.getFolderHash(t);l=i.isUnd(l)?!1:!!l,s=i.isUnd(s)?0:i.pInt(s),o=i.isUnd(s)?20:i.pInt(o),r=i.pString(r),""===d||""!==r&&-1!==r.indexOf("is:")?this.defaultRequest(e,"MessageList",{Folder:t,Offset:s,Limit:o,Search:r,UidNext:"INBOX"===t?c.getFolderUidNext(t):"",UseThreads:u.threading()&&u.useThreads()?"1":"0",ExpandedThreadUid:u.threading()&&t===u.messageListThreadFolder()?u.messageListThreadUids().join(","):""},""===r?n.Defaults.DefaultAjaxTimeout:n.Defaults.SearchAjaxTimeout,"",l?[]:["MessageList"]):this.defaultRequest(e,"MessageList",{},""===r?n.Defaults.DefaultAjaxTimeout:n.Defaults.SearchAjaxTimeout,"MessageList/"+a.urlsafe_encode([t,s,o,r,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"])},s.prototype.messageUploadAttachments=function(e,t){this.defaultRequest(e,"MessageUploadAttachments",{Attachments:t},999e3)},s.prototype.message=function(e,t,s){return t=i.pString(t),s=i.pInt(s),c.getFolderFromCacheList(t)&&s>0?(this.defaultRequest(e,"Message",{},null,"Message/"+a.urlsafe_encode([t,s,u.projectHash(),u.threading()&&u.useThreads()?"1":"0"].join(String.fromCharCode(0))),["Message"]),!0):!1},s.prototype.composeUploadExternals=function(e,t){this.defaultRequest(e,"ComposeUploadExternals",{Externals:t},999e3)},s.prototype.composeUploadDrive=function(e,t,s){this.defaultRequest(e,"ComposeUploadDrive",{AccessToken:s,Url:t},999e3)},s.prototype.folderInformation=function(e,t,s){var n=!0,a=[];i.isArray(s)&&0<s.length&&(n=!1,o.each(s,function(e){c.getMessageFlagsFromCache(e.folderFullNameRaw,e.uid)||a.push(e.uid),0<e.threads().length&&o.each(e.threads(),function(t){c.getMessageFlagsFromCache(e.folderFullNameRaw,t)||a.push(t)})}),0<a.length&&(n=!0)),n?this.defaultRequest(e,"FolderInformation",{Folder:t,FlagsUids:i.isArray(a)?a.join(","):"",UidNext:"INBOX"===t?c.getFolderUidNext(t):""}):u.useThreads()&&r.__RL&&r.__RL.reloadFlagsCurrentMessageListAndMessageFromCache()},s.prototype.folderInformationMultiply=function(e,t){this.defaultRequest(e,"FolderInformationMultiply",{Folders:t})},s.prototype.logout=function(e){this.defaultRequest(e,"Logout")},s.prototype.messageSetFlagged=function(e,t,s,o){this.defaultRequest(e,"MessageSetFlagged",{Folder:t,Uids:s.join(","),SetAction:o?"1":"0"})},s.prototype.messageSetSeen=function(e,t,s,o){this.defaultRequest(e,"MessageSetSeen",{Folder:t,Uids:s.join(","),SetAction:o?"1":"0"})},s.prototype.messageSetSeenToAll=function(e,t,s){this.defaultRequest(e,"MessageSetSeenToAll",{Folder:t,SetAction:s?"1":"0"})},s.prototype.saveMessage=function(e,t,s,o,i,r,a,l,c,u,d,p,h,m,g){this.defaultRequest(e,"SaveMessage",{MessageFolder:t,MessageUid:s,DraftFolder:o,From:i,To:r,Cc:a,Bcc:l,Subject:c,TextIsHtml:u?"1":"0",Text:d,DraftInfo:h,InReplyTo:m,References:g,Attachments:p},n.Defaults.SaveMessageAjaxTimeout)
|
||
},s.prototype.sendReadReceiptMessage=function(e,t,s,o,i,n){this.defaultRequest(e,"SendReadReceiptMessage",{MessageFolder:t,MessageUid:s,ReadReceipt:o,Subject:i,Text:n})},s.prototype.sendMessage=function(e,t,s,o,i,r,a,l,c,u,d,p,h,m,g,f){this.defaultRequest(e,"SendMessage",{MessageFolder:t,MessageUid:s,SentFolder:o,From:i,To:r,Cc:a,Bcc:l,Subject:c,TextIsHtml:u?"1":"0",Text:d,DraftInfo:h,InReplyTo:m,References:g,ReadReceiptRequest:f?"1":"0",Attachments:p},n.Defaults.SendMessageAjaxTimeout)},s.prototype.saveSystemFolders=function(e,t){this.defaultRequest(e,"SystemFoldersUpdate",t)},s.prototype.saveSettings=function(e,t){this.defaultRequest(e,"SettingsUpdate",t)},s.prototype.changePassword=function(e,t,s){this.defaultRequest(e,"ChangePassword",{PrevPassword:t,NewPassword:s})},s.prototype.folderCreate=function(e,t,s){this.defaultRequest(e,"FolderCreate",{Folder:t,Parent:s},null,"",["Folders"])},s.prototype.folderDelete=function(e,t){this.defaultRequest(e,"FolderDelete",{Folder:t},null,"",["Folders"])},s.prototype.folderRename=function(e,t,s){this.defaultRequest(e,"FolderRename",{Folder:t,NewFolderName:s},null,"",["Folders"])},s.prototype.folderClear=function(e,t){this.defaultRequest(e,"FolderClear",{Folder:t})},s.prototype.folderSetSubscribe=function(e,t,s){this.defaultRequest(e,"FolderSubscribe",{Folder:t,Subscribe:s?"1":"0"})},s.prototype.messagesMove=function(e,t,s,o,i){this.defaultRequest(e,"MessageMove",{FromFolder:t,ToFolder:s,Uids:o.join(","),Learning:i||""},null,"",["MessageList"])},s.prototype.messagesCopy=function(e,t,s,o){this.defaultRequest(e,"MessageCopy",{FromFolder:t,ToFolder:s,Uids:o.join(",")})},s.prototype.messagesDelete=function(e,t,s){this.defaultRequest(e,"MessageDelete",{Folder:t,Uids:s.join(",")},null,"",["MessageList"])},s.prototype.appDelayStart=function(e){this.defaultRequest(e,"AppDelayStart")},s.prototype.quota=function(e){this.defaultRequest(e,"Quota")},s.prototype.contacts=function(e,t,s,o){this.defaultRequest(e,"Contacts",{Offset:t,Limit:s,Search:o},null,"",["Contacts"])},s.prototype.contactSave=function(e,t,s,o,n){this.defaultRequest(e,"ContactSave",{RequestUid:t,Uid:i.trim(s),Tags:i.trim(o),Properties:n})},s.prototype.contactsDelete=function(e,t){this.defaultRequest(e,"ContactsDelete",{Uids:t.join(",")})},s.prototype.suggestions=function(e,t,s){this.defaultRequest(e,"Suggestions",{Query:t,Page:s},null,"",["Suggestions"])},s.prototype.facebookUser=function(e){this.defaultRequest(e,"SocialFacebookUserInformation")},s.prototype.facebookDisconnect=function(e){this.defaultRequest(e,"SocialFacebookDisconnect")},s.prototype.twitterUser=function(e){this.defaultRequest(e,"SocialTwitterUserInformation")},s.prototype.twitterDisconnect=function(e){this.defaultRequest(e,"SocialTwitterDisconnect")},s.prototype.googleUser=function(e){this.defaultRequest(e,"SocialGoogleUserInformation")},s.prototype.googleDisconnect=function(e){this.defaultRequest(e,"SocialGoogleDisconnect")},s.prototype.socialUsers=function(e){this.defaultRequest(e,"SocialUsers")},t.exports=new s}(t)},{"../Common/Base64.js":5,"../Common/Consts.js":6,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/underscore.js":31,"./AbstractAjaxRemoteStorage.js":66,"./AppSettings.js":68,"./WebMailCacheStorage.js":73,"./WebMailDataStorage.js":74}],73:[function(e,t){!function(t){"use strict";function s(){this.oFoldersCache={},this.oFoldersNamesCache={},this.oFolderHashCache={},this.oFolderUidNextCache={},this.oMessageListHashCache={},this.oMessageFlagsCache={},this.oNewMessage={},this.oRequestedMessage={},this.bCapaGravatar=a.capa(i.Capa.Gravatar)}var o=e("../External/underscore.js"),i=e("../Common/Enums.js"),n=e("../Common/Utils.js"),r=e("../Common/LinkBuilder.js"),a=e("./AppSettings.js");s.prototype.bCapaGravatar=!1,s.prototype.oFoldersCache={},s.prototype.oFoldersNamesCache={},s.prototype.oFolderHashCache={},s.prototype.oFolderUidNextCache={},s.prototype.oMessageListHashCache={},s.prototype.oMessageFlagsCache={},s.prototype.oBodies={},s.prototype.oNewMessage={},s.prototype.oRequestedMessage={},s.prototype.clear=function(){this.oFoldersCache={},this.oFoldersNamesCache={},this.oFolderHashCache={},this.oFolderUidNextCache={},this.oMessageListHashCache={},this.oMessageFlagsCache={},this.oBodies={}},s.prototype.getUserPic=function(e,t){e=n.trim(e),t(this.bCapaGravatar&&""!==e?r.avatarLink(e):"",e)},s.prototype.getMessageKey=function(e,t){return e+"#"+t},s.prototype.addRequestedMessage=function(e,t){this.oRequestedMessage[this.getMessageKey(e,t)]=!0},s.prototype.hasRequestedMessage=function(e,t){return!0===this.oRequestedMessage[this.getMessageKey(e,t)]},s.prototype.addNewMessageCache=function(e,t){this.oNewMessage[this.getMessageKey(e,t)]=!0},s.prototype.hasNewMessageAndRemoveFromCache=function(e,t){return this.oNewMessage[this.getMessageKey(e,t)]?(this.oNewMessage[this.getMessageKey(e,t)]=null,!0):!1},s.prototype.clearNewMessageCache=function(){this.oNewMessage={}},s.prototype.getFolderFullNameRaw=function(e){return""!==e&&this.oFoldersNamesCache[e]?this.oFoldersNamesCache[e]:""},s.prototype.setFolderFullNameRaw=function(e,t){this.oFoldersNamesCache[e]=t},s.prototype.getFolderHash=function(e){return""!==e&&this.oFolderHashCache[e]?this.oFolderHashCache[e]:""},s.prototype.setFolderHash=function(e,t){this.oFolderHashCache[e]=t},s.prototype.getFolderUidNext=function(e){return""!==e&&this.oFolderUidNextCache[e]?this.oFolderUidNextCache[e]:""},s.prototype.setFolderUidNext=function(e,t){this.oFolderUidNextCache[e]=t},s.prototype.getFolderFromCacheList=function(e){return""!==e&&this.oFoldersCache[e]?this.oFoldersCache[e]:null},s.prototype.setFolderToCacheList=function(e,t){this.oFoldersCache[e]=t},s.prototype.removeFolderFromCacheList=function(e){this.setFolderToCacheList(e,null)},s.prototype.getMessageFlagsFromCache=function(e,t){return this.oMessageFlagsCache[e]&&this.oMessageFlagsCache[e][t]?this.oMessageFlagsCache[e][t]:null},s.prototype.setMessageFlagsToCache=function(e,t,s){this.oMessageFlagsCache[e]||(this.oMessageFlagsCache[e]={}),this.oMessageFlagsCache[e][t]=s},s.prototype.clearMessageFlagsFromCacheByFolder=function(e){this.oMessageFlagsCache[e]={}},s.prototype.initMessageFlagsFromCache=function(e){if(e){var t=this,s=this.getMessageFlagsFromCache(e.folderFullNameRaw,e.uid),i=null,r=null;s&&0<s.length&&(e.unseen(!!s[0]),e.flagged(!!s[1]),e.answered(!!s[2]),e.forwarded(!!s[3]),e.isReadReceipt(!!s[4])),0<e.threads().length&&(i=o.find(e.threads(),function(s){var o=t.getMessageFlagsFromCache(e.folderFullNameRaw,s);return o&&0<o.length&&!!o[0]}),r=o.find(e.threads(),function(s){var o=t.getMessageFlagsFromCache(e.folderFullNameRaw,s);return o&&0<o.length&&!!o[1]}),e.hasUnseenSubMessage(i&&0<n.pInt(i)),e.hasFlaggedSubMessage(r&&0<n.pInt(r)))}},s.prototype.storeMessageFlagsToCache=function(e){e&&this.setMessageFlagsToCache(e.folderFullNameRaw,e.uid,[e.unseen(),e.flagged(),e.answered(),e.forwarded(),e.isReadReceipt()])},s.prototype.storeMessageFlagsToCacheByFolderAndUid=function(e,t,s){n.isArray(s)&&0<s.length&&this.setMessageFlagsToCache(e,t,s)},t.exports=new s}(t)},{"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/underscore.js":31,"./AppSettings.js":68}],74:[function(e,t){!function(t){"use strict";function s(){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 s=f.getFolderFromCacheList(t);s&&s.type(e)}};this.devEmail="",this.devPassword="",this.accountEmail=r.observable(""),this.accountIncLogin=r.observable(""),this.accountOutLogin=r.observable(""),this.projectHash=r.observable(""),this.threading=r.observable(!1),this.lastFoldersHash="",this.remoteSuggestions=!1,this.sentFolder=r.observable(""),this.draftFolder=r.observable(""),this.spamFolder=r.observable(""),this.trashFolder=r.observable(""),this.archiveFolder=r.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=r.computed(function(){return""===this.draftFolder()||u.Values.UnuseOptionValue===this.draftFolder()},this),this.displayName=r.observable(""),this.signature=r.observable(""),this.signatureToAll=r.observable(!1),this.replyTo=r.observable(""),this.enableTwoFactor=r.observable(!1),this.accounts=r.observableArray([]),this.accountsLoading=r.observable(!1).extend({throttle:100}),this.defaultIdentityID=r.observable(""),this.identities=r.observableArray([]),this.identitiesLoading=r.observable(!1).extend({throttle:100}),this.contactTags=r.observableArray([]),this.contacts=r.observableArray([]),this.contacts.loading=r.observable(!1).extend({throttle:200}),this.contacts.importing=r.observable(!1).extend({throttle:200}),this.contacts.syncing=r.observable(!1).extend({throttle:200}),this.contacts.exportingVcf=r.observable(!1).extend({throttle:200}),this.contacts.exportingCsv=r.observable(!1).extend({throttle:200}),this.allowContactsSync=r.observable(!1),this.enableContactsSync=r.observable(!1),this.contactsSyncUrl=r.observable(""),this.contactsSyncUser=r.observable(""),this.contactsSyncPass=r.observable(""),this.allowContactsSync=r.observable(!!g.settingsGet("ContactsSyncIsAllowed")),this.enableContactsSync=r.observable(!!g.settingsGet("EnableContactsSync")),this.contactsSyncUrl=r.observable(g.settingsGet("ContactsSyncUrl")),this.contactsSyncUser=r.observable(g.settingsGet("ContactsSyncUser")),this.contactsSyncPass=r.observable(g.settingsGet("ContactsSyncPassword")),this.namespace="",this.folderList=r.observableArray([]),this.folderList.focused=r.observable(!1),this.foldersListError=r.observable(""),this.foldersLoading=r.observable(!1),this.foldersCreating=r.observable(!1),this.foldersDeleting=r.observable(!1),this.foldersRenaming=r.observable(!1),this.foldersChanging=r.computed(function(){var e=this.foldersLoading(),t=this.foldersCreating(),s=this.foldersDeleting(),o=this.foldersRenaming();return e||t||s||o},this),this.foldersInboxUnreadCount=r.observable(0),this.currentFolder=r.observable(null).extend({toggleSubscribe:[null,function(e){e&&e.selected(!1)},function(e){e&&e.selected(!0)}]}),this.currentFolderFullNameRaw=r.computed(function(){return this.currentFolder()?this.currentFolder().fullNameRaw:""},this),this.currentFolderFullName=r.computed(function(){return this.currentFolder()?this.currentFolder().fullName:""},this),this.currentFolderFullNameHash=r.computed(function(){return this.currentFolder()?this.currentFolder().fullNameHash:""},this),this.currentFolderName=r.computed(function(){return this.currentFolder()?this.currentFolder().name():""},this),this.folderListSystemNames=r.computed(function(){var e=["INBOX"],t=this.folderList(),s=this.sentFolder(),o=this.draftFolder(),i=this.spamFolder(),n=this.trashFolder(),r=this.archiveFolder();return h.isArray(t)&&0<t.length&&(""!==s&&u.Values.UnuseOptionValue!==s&&e.push(s),""!==o&&u.Values.UnuseOptionValue!==o&&e.push(o),""!==i&&u.Values.UnuseOptionValue!==i&&e.push(i),""!==n&&u.Values.UnuseOptionValue!==n&&e.push(n),""!==r&&u.Values.UnuseOptionValue!==r&&e.push(r)),e},this),this.folderListSystem=r.computed(function(){return n.compact(n.map(this.folderListSystemNames(),function(e){return f.getFolderFromCacheList(e)}))},this),this.folderMenuForMove=r.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=r.observableArray([]).extend({rateLimit:0}),this.messageListCount=r.observable(0),this.messageListSearch=r.observable(""),this.messageListPage=r.observable(1),this.messageListThreadFolder=r.observable(""),this.messageListThreadUids=r.observableArray([]),this.messageListThreadFolder.subscribe(function(){this.messageListThreadUids([])},this),this.messageListEndFolder=r.observable(""),this.messageListEndSearch=r.observable(""),this.messageListEndPage=r.observable(1),this.messageListEndHash=r.computed(function(){return this.messageListEndFolder()+"|"+this.messageListEndSearch()+"|"+this.messageListEndPage()},this),this.messageListPageCount=r.computed(function(){var e=o.Math.ceil(this.messageListCount()/this.messagesPerPage());return 0>=e?1:e},this),this.mainMessageListSearch=r.computed({read:this.messageListSearch,write:function(e){b.setHash(m.mailBox(this.currentFolderFullNameHash(),1,h.trim(e.toString())))},owner:this}),this.messageListError=r.observable(""),this.messageListLoading=r.observable(!1),this.messageListIsNotCompleted=r.observable(!1),this.messageListCompleteLoadingThrottle=r.observable(!1).extend({throttle:200}),this.messageListCompleteLoading=r.computed(function(){var e=this.messageListLoading(),t=this.messageListIsNotCompleted();return e||t},this),this.messageListCompleteLoading.subscribe(function(e){this.messageListCompleteLoadingThrottle(e)},this),this.messageList.subscribe(n.debounce(function(e){n.each(e,function(e){e.newForAnimation()&&e.newForAnimation(!1)})},500)),this.staticMessageList=new S,this.message=r.observable(null),this.messageLoading=r.observable(!1),this.messageLoadingThrottle=r.observable(!1).extend({throttle:50}),this.message.focused=r.observable(!1),this.message.subscribe(function(e){e?d.Layout.NoPreview===this.layout()&&this.message.focused(!0):(this.message.focused(!1),this.messageFullScreenMode(!1),this.hideMessageBodies(),d.Layout.NoPreview===this.layout()&&-1<o.location.hash.indexOf("message-preview")&&p.__RL&&p.__RL.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=r.observable(!1),this.messageError=r.observable(""),this.messagesBodiesDom=r.observable(null),this.messagesBodiesDom.subscribe(function(e){!e||e instanceof i||this.messagesBodiesDom(i(e))},this),this.messageActiveDom=r.observable(null),this.isMessageSelected=r.computed(function(){return null!==this.message()},this),this.currentMessage=r.observable(null),this.messageListChecked=r.computed(function(){return n.filter(this.messageList(),function(e){return e.checked()})},this).extend({rateLimit:0}),this.hasCheckedMessages=r.computed(function(){return 0<this.messageListChecked().length},this).extend({rateLimit:0}),this.messageListCheckedOrSelected=r.computed(function(){var e=this.messageListChecked(),t=this.currentMessage();return n.union(e,t?[t]:[])},this),this.messageListCheckedOrSelectedUidsWithSubMails=r.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=r.observable(0),this.userUsageSize=r.observable(0),this.userUsageProc=r.computed(function(){var e=this.userQuota(),t=this.userUsageSize();return e>0?o.Math.ceil(t/e*100):0},this),this.capaOpenPGP=r.observable(!1),this.openpgpkeys=r.observableArray([]),this.openpgpKeyring=null,this.openpgpkeysPublic=this.openpgpkeys.filter(function(e){return!(!e||e.isPrivate)}),this.openpgpkeysPrivate=this.openpgpkeys.filter(function(e){return!(!e||!e.isPrivate)}),this.googleActions=r.observable(!1),this.googleLoggined=r.observable(!1),this.googleUserName=r.observable(""),this.facebookActions=r.observable(!1),this.facebookLoggined=r.observable(!1),this.facebookUserName=r.observable(""),this.twitterActions=r.observable(!1),this.twitterLoggined=r.observable(!1),this.twitterUserName=r.observable(""),this.customThemeType=r.observable(d.CustomThemeType.Light),this.purgeMessageBodyCacheThrottle=n.throttle(this.purgeMessageBodyCache,3e4)}var o=e("../External/window.js"),i=e("../External/jquery.js"),n=e("../External/underscore.js"),r=e("../External/ko.js"),a=e("../External/moment.js"),l=e("../External/$div.js"),c=e("../External/NotificationClass.js"),u=e("../Common/Consts.js"),d=e("../Common/Enums.js"),p=e("../Common/Globals.js"),h=e("../Common/Utils.js"),m=e("../Common/LinkBuilder.js"),g=e("./AppSettings.js"),f=e("./WebMailCacheStorage.js"),b=e("../Knoin/Knoin.js"),S=e("../Models/MessageModel.js"),y=e("./LocalStorage.js"),v=e("./AbstractData.js");n.extend(s.prototype,v.prototype),s.prototype.purgeMessageBodyCache=function(){var e=0,t=null,s=p.iMessageBodyCacheCount-u.Values.MessageBodyCacheLimit;s>0&&(t=this.messagesBodiesDom(),t&&(t.find(".rl-cache-class").each(function(){var t=i(this);s>t.data("rl-cache-count")&&(t.addClass("rl-cache-purge"),e++)}),e>0&&n.delay(function(){t.find(".rl-cache-purge").remove()},300)))},s.prototype.populateDataOnStart=function(){v.prototype.populateDataOnStart.call(this),this.accountEmail(g.settingsGet("Email")),this.accountIncLogin(g.settingsGet("IncLogin")),this.accountOutLogin(g.settingsGet("OutLogin")),this.projectHash(g.settingsGet("ProjectHash")),this.defaultIdentityID(g.settingsGet("DefaultIdentityID")),this.displayName(g.settingsGet("DisplayName")),this.replyTo(g.settingsGet("ReplyTo")),this.signature(g.settingsGet("Signature")),this.signatureToAll(!!g.settingsGet("SignatureToAll")),this.enableTwoFactor(!!g.settingsGet("EnableTwoFactor")),this.lastFoldersHash=y.get(d.ClientSideKeyName.FoldersLashHash)||"",this.remoteSuggestions=!!g.settingsGet("RemoteSuggestions"),this.devEmail=g.settingsGet("DevEmail"),this.devPassword=g.settingsGet("DevPassword")},s.prototype.initUidNextAndNewMessages=function(e,t,s){if("INBOX"===e&&h.isNormal(t)&&""!==t){if(h.isArray(s)&&0<s.length){var i=this,r=0,a=s.length,l=function(e,t,s){var n=null;c&&i.useDesktopNotifications()&&(n=new c(t,{body:s,icon:e}),n&&(n.show&&n.show(),o.setTimeout(function(e){return function(){e.cancel?e.cancel():e.close&&e.close()}}(n),7e3)))};if(n.each(s,function(t){f.addNewMessageCache(e,t.Uid)}),a>3)l(m.notificationMailIcon(),this.accountEmail(),h.i18n("MESSAGE_LIST/NEW_MESSAGE_NOTIFICATION",{COUNT:a}));else for(;a>r;r++)l(m.notificationMailIcon(),S.emailsToLine(S.initEmailsFromJson(s[r].From),!1),s[r].Subject)}f.setFolderUidNext(e,t)}},s.prototype.hideMessageBodies=function(){var e=this.messagesBodiesDom();e&&e.find(".b-text-part").hide()},s.prototype.getNextFolderNames=function(e){e=h.isUnd(e)?!1:!!e;var t=[],s=10,o=a().unix(),i=o-300,r=[],l=function(t){n.each(t,function(t){t&&"INBOX"!==t.fullNameRaw&&t.selectable&&t.existen&&i>t.interval&&(!e||t.subScribed())&&r.push([t.interval,t.fullNameRaw]),t&&0<t.subFolders().length&&l(t.subFolders())})};return l(this.folderList()),r.sort(function(e,t){return e[0]<t[0]?-1:e[0]>t[0]?1:0}),n.find(r,function(e){var i=f.getFolderFromCacheList(e[1]);return i&&(i.interval=o,t.push(e[1])),s<=t.length}),n.uniq(t)},s.prototype.removeMessagesFromList=function(e,t,s,o){s=h.isNormal(s)?s:"",o=h.isUnd(o)?!1:!!o,t=n.map(t,function(e){return h.pInt(e)});var i=this,r=0,a=this.messageList(),l=f.getFolderFromCacheList(e),c=""===s?null:f.getFolderFromCacheList(s||""),u=this.currentFolderFullNameRaw(),d=this.message(),p=u===e?n.filter(a,function(e){return e&&-1<h.inArray(h.pInt(e.uid),t)}):[];n.each(p,function(e){e&&e.unseen()&&r++}),l&&!o&&(l.messageCountAll(0<=l.messageCountAll()-t.length?l.messageCountAll()-t.length:0),r>0&&l.messageCountUnread(0<=l.messageCountUnread()-r?l.messageCountUnread()-r:0)),c&&(c.messageCountAll(c.messageCountAll()+t.length),r>0&&c.messageCountUnread(c.messageCountUnread()+r),c.actionBlink(!0)),0<p.length&&(o?n.each(p,function(e){e.checked(!1)}):(this.messageListIsNotCompleted(!0),n.each(p,function(e){d&&d.hash===e.hash&&(d=null,i.message(null)),e.deleted(!0)}),n.delay(function(){n.each(p,function(e){i.messageList.remove(e)})},400))),""!==e&&f.setFolderHash(e,""),""!==s&&f.setFolderHash(s,"")},s.prototype.setMessage=function(e,t){var s=!1,o=!1,n=!1,r=null,a=null,c="",u="",m=!1,g=!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,""),a=b.find("#"+c),a&&a[0]?(S.body=a,S.body&&(S.body.data("rl-cache-count",++p.iMessageBodyCacheCount),S.fetchDataToDom())):(o=!!e.Result.HasExternals,n=!!e.Result.HasInternals,r=i('<div id="'+c+'" />').hide().addClass("rl-cache-class"),r.data("rl-cache-count",++p.iMessageBodyCacheCount),h.isNormal(e.Result.Html)&&""!==e.Result.Html?(s=!0,u=e.Result.Html.toString()):h.isNormal(e.Result.Plain)&&""!==e.Result.Plain?(s=!1,u=h.plainToHtml(e.Result.Plain.toString(),!1),(S.isPgpSigned()||S.isPgpEncrypted())&&this.capaOpenPGP()&&(S.plainRaw=h.pString(e.Result.Plain),g=/---BEGIN PGP MESSAGE---/.test(S.plainRaw),g||(m=/-----BEGIN PGP SIGNED MESSAGE-----/.test(S.plainRaw)&&/-----BEGIN PGP SIGNATURE-----/.test(S.plainRaw)),l.empty(),m&&S.isPgpSigned()?u=l.append(i('<pre class="b-plain-openpgp signed"></pre>').text(S.plainRaw)).html():g&&S.isPgpEncrypted()&&(u=l.append(i('<pre class="b-plain-openpgp encrypted"></pre>').text(S.plainRaw)).html()),l.empty(),S.isPgpSigned(m),S.isPgpEncrypted(g))):s=!1,r.html(h.linkify(u)).addClass("b-text-part "+(s?"html":"plain")),S.isHtml(!!s),S.hasImages(!!o),S.pgpSignedVerifyStatus(d.SignedVerifyStatus.None),S.pgpSignedVerifyUser(""),S.body=r,S.body&&b.append(S.body),S.storeDataToDom(),n&&S.showInternalImages(!0),S.hasImages()&&this.showImages()&&S.showExternalImages(!0),this.purgeMessageBodyCacheThrottle()),this.messageActiveDom(S.body),this.hideMessageBodies(),S.body.show(),r&&h.initBlockquoteSwitcher(r)),f.initMessageFlagsFromCache(S),S.unseen()&&p.__RL&&p.__RL.setMessageSeen(S),h.windowResize())},s.prototype.calculateMessageListHash=function(e){return n.map(e,function(e){return""+e.hash+"_"+e.threadsLen()+"_"+e.flagHash()}).join("|")},s.prototype.findPublicKeyByHex=function(e){return n.find(this.openpgpkeysPublic(),function(t){return t&&e===t.id})},s.prototype.findPublicKeysByEmail=function(e){return n.compact(n.map(this.openpgpkeysPublic(),function(t){var s=null;if(t&&e===t.email)try{if(s=o.openpgp.key.readArmored(t.armor),s&&!s.err&&s.keys&&s.keys[0])return s.keys[0]}catch(i){}return null}))},s.prototype.findPrivateKeyByEmail=function(e,t){var s=null,i=n.find(this.openpgpkeysPrivate(),function(t){return t&&e===t.email});if(i)try{s=o.openpgp.key.readArmored(i.armor),s&&!s.err&&s.keys&&s.keys[0]?(s=s.keys[0],s.decrypt(h.pString(t))):s=null}catch(r){s=null}return s},s.prototype.findSelfPrivateKey=function(e){return this.findPrivateKeyByEmail(this.accountEmail(),e)},t.exports=new s}(t)},{"../Common/Consts.js":6,"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/$div.js":15,"../External/NotificationClass.js":22,"../External/jquery.js":26,"../External/ko.js":28,"../External/moment.js":29,"../External/underscore.js":31,"../External/window.js":32,"../Knoin/Knoin.js":33,"../Models/MessageModel.js":48,"./AbstractData.js":67,"./AppSettings.js":68,"./LocalStorage.js":69,"./WebMailCacheStorage.js":73}],75:[function(e,t){!function(t){"use strict";function s(){f.call(this,"Right","SystemDropDown"),this.accounts=d.accounts,this.accountEmail=d.accountEmail,this.accountsLoading=d.accountsLoading,this.accountMenuDropdownTrigger=i.observable(!1),this.capaAdditionalAccounts=u.capa(a.Capa.AdditionalAccounts),this.loading=i.computed(function(){return this.accountsLoading()},this),this.accountClick=o.bind(this.accountClick,this)}var o=e("../External/underscore.js"),i=e("../External/ko.js"),n=e("../External/window.js"),r=e("../External/key.js"),a=e("../Common/Enums.js"),l=e("../Common/Utils.js"),c=e("../Common/LinkBuilder.js"),u=e("../Storages/AppSettings.js"),d=e("../Storages/WebMailDataStorage.js"),p=e("../Storages/WebMailAjaxRemoteStorage.js"),h=e("../ViewModels/Popups/PopupsKeyboardShortcutsHelpViewModel.js"),m=e("../ViewModels/Popups/PopupsKeyboardShortcutsHelpViewModel.js"),g=e("../Knoin/Knoin.js"),f=e("../Knoin/KnoinAbstractViewModel.js");o.extend(s.prototype,f.prototype),s.prototype.accountClick=function(e,t){if(e&&t&&!l.isUnd(t.which)&&1===t.which){var s=this;this.accountsLoading(!0),o.delay(function(){s.accountsLoading(!1)},1e3)}return!0},s.prototype.emailTitle=function(){return d.accountEmail()},s.prototype.settingsClick=function(){g.setHash(c.settings())},s.prototype.settingsHelp=function(){g.showScreenPopup(h)},s.prototype.addAccountClick=function(){this.capaAdditionalAccounts&&g.showScreenPopup(m)},s.prototype.logoutClick=function(){var t=e("../Boots/RainLoopApp.js");p.logout(function(){n.__rlah_clear&&n.__rlah_clear(),t.loginAndLogoutReload(!0,u.settingsGet("ParentEmail")&&0<u.settingsGet("ParentEmail").length)})},s.prototype.onBuild=function(){var e=this;r("`",[a.KeyState.MessageList,a.KeyState.MessageView,a.KeyState.Settings],function(){e.viewModelVisibility()&&e.accountMenuDropdownTrigger(!0)}),r("shift+/",[a.KeyState.MessageList,a.KeyState.MessageView,a.KeyState.Settings],function(){return e.viewModelVisibility()?(g.showScreenPopup(h),!1):void 0})},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/key.js":27,"../External/ko.js":28,"../External/underscore.js":31,"../External/window.js":32,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractViewModel.js":36,"../Storages/AppSettings.js":68,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailDataStorage.js":74,"../ViewModels/Popups/PopupsKeyboardShortcutsHelpViewModel.js":94}],76:[function(e,t){!function(t){"use strict";function s(){m.call(this,"Center","Login"),this.email=r.observable(""),this.password=r.observable(""),this.signMe=r.observable(!1),this.additionalCode=r.observable(""),this.additionalCode.error=r.observable(!1),this.additionalCode.focused=r.observable(!1),this.additionalCode.visibility=r.observable(!1),this.additionalCodeSignMe=r.observable(!1),this.logoImg=a.trim(u.settingsGet("LoginLogo")),this.loginDescription=a.trim(u.settingsGet("LoginDescription")),this.logoCss=a.trim(u.settingsGet("LoginCss")),this.emailError=r.observable(!1),this.passwordError=r.observable(!1),this.emailFocus=r.observable(!1),this.submitFocus=r.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=r.observable(!1),this.submitError=r.observable(""),this.allowLanguagesOnLogin=d.allowLanguagesOnLogin,this.langRequest=r.observable(!1),this.mainLanguage=d.mainLanguage,this.bSendLanguage=!1,this.mainLanguageFullName=r.computed(function(){return a.convertLangName(this.mainLanguage())},this),this.signMeType=r.observable(l.LoginSignMeType.Unused),this.signMeType.subscribe(function(e){this.signMe(l.LoginSignMeType.DefaultOn===e)},this),this.signMeVisibility=r.computed(function(){return l.LoginSignMeType.Unused!==this.signMeType()},this),this.submitCommand=a.createCommand(this,function(){if(a.triggerAutocompleteInputChange(),this.emailError(""===a.trim(this.email())),this.passwordError(""===a.trim(this.password())),this.additionalCode.visibility()&&this.additionalCode.error(""===a.trim(this.additionalCode())),this.emailError()||this.passwordError()||this.additionalCode.error())return!1;this.submitRequest(!0);var t=this.password(),s=n.bind(function(t){p.login(n.bind(function(t,s){if(l.StorageResultType.Success===t&&s&&"Login"===s.Action)if(s.Result)if(s.TwoFactorAuth)this.additionalCode(""),this.additionalCode.visibility(!0),this.additionalCode.focused(!0),this.submitRequest(!1);else{var o=e("../Boots/RainLoopApp.js");o.loginAndLogoutReload()}else s.ErrorCode?(this.submitRequest(!1),this.submitError(a.getNotification(s.ErrorCode)),""===this.submitError()&&this.submitError(a.getNotification(l.Notification.UnknownError))):this.submitRequest(!1);else this.submitRequest(!1),this.submitError(a.getNotification(l.Notification.UnknownError))},this),this.email(),"",t,!!this.signMe(),this.bSendLanguage?this.mainLanguage():"",this.additionalCode.visibility()?this.additionalCode():"",this.additionalCode.visibility()?!!this.additionalCodeSignMe():!1)},this);return u.settingsGet("UseRsaEncryption")&&a.rsaEncode.supported?p.getPublicKey(n.bind(function(e,o){var i=!1;if(l.StorageResultType.Success===e&&o&&o.Result&&a.isArray(o.Result)&&o.Result[0]&&o.Result[1]&&o.Result[2]){var n=a.rsaEncode(t,o.Result[0],o.Result[1],o.Result[2]);n&&(s(n),i=!0)}i||(this.submitRequest(!1),this.submitError(a.getNotification(l.Notification.UnknownError)))},this)):s(t),!0},function(){return!this.submitRequest()}),this.facebookLoginEnabled=r.observable(!1),this.facebookCommand=a.createCommand(this,function(){return o.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=r.observable(!1),this.googleCommand=a.createCommand(this,function(){return o.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=r.observable(!1),this.twitterCommand=a.createCommand(this,function(){return o.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=r.computed(function(){var e=this.facebookLoginEnabled(),t=this.googleLoginEnabled(),s=this.twitterLoginEnabled();return e||t||s},this),h.constructorEnd(this)}var o=e("../External/window.js"),i=e("../External/jquery.js"),n=e("../External/underscore.js"),r=e("../External/ko.js"),a=e("../Common/Utils.js"),l=e("../Common/Enums.js"),c=e("../Common/LinkBuilder.js"),u=e("../Storages/AppSettings.js"),d=e("../Storages/WebMailDataStorage.js"),p=e("../Storages/WebMailAjaxRemoteStorage.js"),h=e("../Knoin/Knoin.js"),m=e("../Knoin/KnoinAbstractViewModel.js"),g=e("../ViewModels/Popups/PopupsLanguagesViewModel.js");h.extendAsViewModel("LoginViewModel",s),s.prototype.onShow=function(){h.routeOff(),n.delay(n.bind(function(){""!==this.email()&&""!==this.password()?this.submitFocus(!0):this.emailFocus(!0),u.settingsGet("UserLanguage")&&i.cookie("rllang",d.language(),{expires:30})},this),100)},s.prototype.onHide=function(){this.submitFocus(!1),this.emailFocus(!1)},s.prototype.onBuild=function(){var t=this,s=u.settingsGet("JsHash"),r=function(s){if(s=a.pInt(s),0===s){t.submitRequest(!0);var o=e("../Boots/RainLoopApp.js");o.loginAndLogoutReload()}else t.submitError(a.getNotification(s))};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()&&(o["rl_"+s+"_google_login_service"]=r),this.facebookLoginEnabled()&&(o["rl_"+s+"_facebook_login_service"]=r),this.twitterLoginEnabled()&&(o["rl_"+s+"_twitter_login_service"]=r),n.delay(function(){d.language.subscribe(function(e){t.langRequest(!0),i.ajax({url:c.langLink(e),dataType:"script",cache:!0}).done(function(){t.bSendLanguage=!0,a.i18nReload(),i.cookie("rllang",d.language(),{expires:30})}).always(function(){t.langRequest(!1)})})},50),a.triggerAutocompleteInputChange(!0)},s.prototype.submitForm=function(){this.submitCommand()},s.prototype.selectLanguage=function(){h.showScreenPopup(g)},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/jquery.js":26,"../External/ko.js":28,"../External/underscore.js":31,"../External/window.js":32,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractViewModel.js":36,"../Storages/AppSettings.js":68,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailDataStorage.js":74,"../ViewModels/Popups/PopupsLanguagesViewModel.js":95}],77:[function(e,t){!function(t){"use strict";function s(){y.call(this,"Left","MailFolderList"),this.oContentVisible=null,this.oContentScrollable=null,this.messageList=m.messageList,this.folderList=m.folderList,this.folderListSystem=m.folderListSystem,this.foldersChanging=m.foldersChanging,this.leftPanelDisabled=u.leftPanelDisabled,this.iDropOverTimer=0,this.allowContacts=!!p.settingsGet("ContactsIsAllowed"),S.constructorEnd(this)}var o=e("../External/window.js"),i=e("../External/jquery.js"),n=e("../External/ko.js"),r=e("../External/key.js"),a=e("../External/$html.js"),l=e("../Common/Utils.js"),c=e("../Common/Enums.js"),u=e("../Common/Globals.js"),d=e("../Common/LinkBuilder.js"),p=e("../Storages/AppSettings.js"),h=e("../Storages/WebMailCacheStorage.js"),m=e("../Storages/WebMailDataStorage.js"),g=e("./Popups/PopupsComposeViewModel.js"),f=e("./Popups/PopupsFolderCreateViewModel.js"),b=e("./Popups/PopupsContactsViewModel.js"),S=e("../Knoin/Knoin.js"),y=e("../Knoin/KnoinAbstractViewModel.js");S.extendAsViewModel("MailBoxFolderListViewModel",s),s.prototype.onBuild=function(t){this.oContentVisible=i(".b-content",t),this.oContentScrollable=i(".content",this.oContentVisible);var s=this,o=e("../Boots/RainLoopApp.js");t.on("click",".b-folders .e-item .e-link .e-collapsed-sign",function(e){var t=n.dataFor(this),s=!1;t&&e&&(s=t.collapsed(),o.setExpandedFolder(t.fullNameHash,s),t.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===m.layout()&&m.message(null),t.fullNameRaw===m.currentFolderFullNameRaw()&&h.setFolderHash(t.fullNameRaw,""),S.setHash(d.mailBox(t.fullNameHash)))}),r("up, down",c.KeyState.FolderList,function(e,o){var n=-1,r=o&&"up"===o.shortcut?38:40,a=i(".b-folders .e-item .e-link:not(.hidden):visible",t);return e&&a.length&&(n=a.index(a.filter(".focused")),n>-1&&a.eq(n).removeClass("focused"),38===r&&n>0?n--:40===r&&n<a.length-1&&n++,a.eq(n).addClass("focused"),s.scrollToFocused()),!1}),r("enter",c.KeyState.FolderList,function(){var e=i(".b-folders .e-item .e-link:not(.hidden).focused",t);return e.length&&e[0]&&(s.folderList.focused(!1),e.click()),!1}),r("space",c.KeyState.FolderList,function(){var e=!0,s=null,r=i(".b-folders .e-item .e-link:not(.hidden).focused",t);return r.length&&r[0]&&(s=n.dataFor(r[0]),s&&(e=s.collapsed(),o.setExpandedFolder(s.fullNameHash,e),s.collapsed(!e))),!1}),r("esc, tab, shift+tab, right",c.KeyState.FolderList,function(){return s.folderList.focused(!1),!1}),s.folderList.focused.subscribe(function(e){i(".b-folders .e-item .e-link.focused",t).removeClass("focused"),e&&i(".b-folders .e-item .e-link.selected",t).addClass("focused")})},s.prototype.messagesDropOver=function(t){if(o.clearTimeout(this.iDropOverTimer),t&&t.collapsed()){var s=e("../Boots/RainLoopApp.js");this.iDropOverTimer=o.setTimeout(function(){t.collapsed(!1),s.setExpandedFolder(t.fullNameHash,!0),l.windowResize()},500)}},s.prototype.messagesDropOut=function(){o.clearTimeout(this.iDropOverTimer)},s.prototype.scrollToFocused=function(){if(!this.oContentVisible||!this.oContentScrollable)return!1;var e=20,t=i(".e-item .e-link.focused",this.oContentScrollable),s=t.position(),o=this.oContentVisible.height(),n=t.outerHeight();return s&&(s.top<0||s.top+n>o)?(this.oContentScrollable.scrollTop(s.top<0?this.oContentScrollable.scrollTop()+s.top-e:this.oContentScrollable.scrollTop()+s.top-o+n+e),!0):!1},s.prototype.messagesDrop=function(t,s){if(t&&s&&s.helper){var o=e("../Boots/RainLoopApp.js"),i=s.helper.data("rl-folder"),n=a.hasClass("rl-ctrl-key-pressed"),r=s.helper.data("rl-uids");l.isNormal(i)&&""!==i&&l.isArray(r)&&o.moveMessagesToFolder(i,r,t.fullNameRaw,n)}},s.prototype.composeClick=function(){S.showScreenPopup(g)},s.prototype.createFolder=function(){S.showScreenPopup(f)},s.prototype.configureFolders=function(){S.setHash(d.settings("folders"))},s.prototype.contactsClick=function(){this.allowContacts&&S.showScreenPopup(b)},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Enums.js":7,"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Utils.js":14,"../External/$html.js":17,"../External/jquery.js":26,"../External/key.js":27,"../External/ko.js":28,"../External/window.js":32,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractViewModel.js":36,"../Storages/AppSettings.js":68,"../Storages/WebMailCacheStorage.js":73,"../Storages/WebMailDataStorage.js":74,"./Popups/PopupsComposeViewModel.js":86,"./Popups/PopupsContactsViewModel.js":87,"./Popups/PopupsFolderCreateViewModel.js":90}],78:[function(e,t){!function(t){"use strict";function s(){var t=e("../Boots/RainLoopApp.js");C.call(this,"Right","MailMessageList"),this.sLastUid=null,this.bPrefetch=!1,this.emptySubjectValue="",this.hideDangerousActions=!!f.settingsGet("HideDangerousActions"),this.popupVisibility=d.popupVisibility,this.message=S.message,this.messageList=S.messageList,this.folderList=S.folderList,this.currentMessage=S.currentMessage,this.isMessageSelected=S.isMessageSelected,this.messageListSearch=S.messageListSearch,this.messageListError=S.messageListError,this.folderMenuForMove=S.folderMenuForMove,this.useCheckboxesInList=S.useCheckboxesInList,this.mainMessageListSearch=S.mainMessageListSearch,this.messageListEndFolder=S.messageListEndFolder,this.messageListChecked=S.messageListChecked,this.messageListCheckedOrSelected=S.messageListCheckedOrSelected,this.messageListCheckedOrSelectedUidsWithSubMails=S.messageListCheckedOrSelectedUidsWithSubMails,this.messageListCompleteLoadingThrottle=S.messageListCompleteLoadingThrottle,p.initOnStartOrLangChange(function(){this.emptySubjectValue=p.i18n("MESSAGE_LIST/EMPTY_SUBJECT_TEXT")},this),this.userQuota=S.userQuota,this.userUsageSize=S.userUsageSize,this.userUsageProc=S.userUsageProc,this.moveDropdownTrigger=n.observable(!1),this.moreDropdownTrigger=n.observable(!1),this.dragOver=n.observable(!1).extend({throttle:1}),this.dragOverEnter=n.observable(!1).extend({throttle:1}),this.dragOverArea=n.observable(null),this.dragOverBodyArea=n.observable(null),this.messageListItemTemplate=n.computed(function(){return c.Layout.NoPreview!==S.layout()?"MailMessageListItem":"MailMessageListItemNoPreviewPane"}),this.messageListSearchDesc=n.computed(function(){var e=S.messageListEndSearch();return""===e?"":p.i18n("MESSAGE_LIST/SEARCH_RESULT_FOR",{SEARCH:e})}),this.messageListPagenator=n.computed(p.computedPagenatorHelper(S.messageListPage,S.messageListPageCount)),this.checkAll=n.computed({read:function(){return 0<S.messageListChecked().length},write:function(e){e=!!e,i.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(A,[S.currentFolder()])}),this.multyForwardCommand=p.createCommand(this,function(){v.showScreenPopup(w,[c.ComposeType.ForwardAsAttachment,S.messageListCheckedOrSelected()])},this.canBeMoved),this.deleteWithoutMoveCommand=p.createCommand(this,function(){t.deleteMessagesFromFolder(c.FolderType.Trash,S.currentFolderFullNameRaw(),S.messageListCheckedOrSelectedUidsWithSubMails(),!1)},this.canBeMoved),this.deleteCommand=p.createCommand(this,function(){t.deleteMessagesFromFolder(c.FolderType.Trash,S.currentFolderFullNameRaw(),S.messageListCheckedOrSelectedUidsWithSubMails(),!0)},this.canBeMoved),this.archiveCommand=p.createCommand(this,function(){t.deleteMessagesFromFolder(c.FolderType.Archive,S.currentFolderFullNameRaw(),S.messageListCheckedOrSelectedUidsWithSubMails(),!0)},this.canBeMoved),this.spamCommand=p.createCommand(this,function(){t.deleteMessagesFromFolder(c.FolderType.Spam,S.currentFolderFullNameRaw(),S.messageListCheckedOrSelectedUidsWithSubMails(),!0)},this.canBeMoved),this.notSpamCommand=p.createCommand(this,function(){t.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.reloadMessageList(!1,!0)}),this.quotaTooltip=i.bind(this.quotaTooltip,this),this.selector=new g(this.messageList,this.currentMessage,".messageListItem .actionHandle",".messageListItem.selected",".messageListItem .checkboxMessage",".messageListItem.focused"),this.selector.on("onItemSelect",i.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(),m.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 o=e("../External/jquery.js"),i=e("../External/underscore.js"),n=e("../External/ko.js"),r=e("../External/key.js"),a=e("../External/ifvisible.js"),l=e("../External/Jua.js"),c=e("../Common/Enums.js"),u=e("../Common/Consts.js"),d=e("../Common/Globals.js"),p=e("../Common/Utils.js"),h=e("../Common/LinkBuilder.js"),m=e("../Common/Events.js"),g=e("../Common/Selector.js"),f=e("../Storages/AppSettings.js"),b=e("../Storages/WebMailCacheStorage.js"),S=e("../Storages/WebMailDataStorage.js"),y=e("../Storages/WebMailAjaxRemoteStorage.js"),v=e("../Knoin/Knoin.js"),C=e("../Knoin/KnoinAbstractViewModel.js"),w=e("./Popups/PopupsComposeViewModel.js"),E=e("./Popups/PopupsAdvancedSearchViewModel.js"),A=e("./Popups/PopupsFolderClearViewModel.js");v.extendAsViewModel("MailBoxMessageListViewModel",s),s.prototype.emptySubjectValue="",s.prototype.searchEnterAction=function(){this.mainMessageListSearch(this.sLastSearchValue),this.inputMessageListSearchFocus(!1)},s.prototype.printableMessageCountForDeletion=function(){var e=this.messageListCheckedOrSelectedUidsWithSubMails().length;return e>1?" ("+(100>e?e:"99+")+")":""},s.prototype.cancelSearch=function(){this.mainMessageListSearch(""),this.inputMessageListSearchFocus(!1)},s.prototype.moveSelectedMessagesToFolder=function(e,t){return this.canBeMoved()&&RL.moveMessagesToFolder(S.currentFolderFullNameRaw(),S.messageListCheckedOrSelectedUidsWithSubMails(),e,t),!1},s.prototype.dragAndDronHelper=function(e){e&&e.checked(!0);var t=p.draggeblePlace(),s=S.messageListCheckedOrSelectedUidsWithSubMails();return t.data("rl-folder",S.currentFolderFullNameRaw()),t.data("rl-uids",s),t.find(".text").text(""+s.length),i.defer(function(){var e=S.messageListCheckedOrSelectedUidsWithSubMails();t.data("rl-uids",e),t.find(".text").text(""+e.length)}),t},s.prototype.onMessageResponse=function(e,t,s){S.hideMessageBodies(),S.messageLoading(!1),c.StorageResultType.Success===e&&t&&t.Result?S.setMessage(t,s):c.StorageResultType.Unload===e?(S.message(null),S.messageError("")):c.StorageResultType.Abort!==e&&(S.message(null),S.messageError(p.getNotification(t&&t.ErrorCode?t.ErrorCode:c.Notification.UnknownError)))},s.prototype.populateMessageBody=function(e){e&&(y.message(this.onMessageResponse,e.folderFullNameRaw,e.uid)?S.messageLoading(!0):p.log("Error: Unknown message request: "+e.folderFullNameRaw+" ~ "+e.uid+" [e-101]"))},s.prototype.setAction=function(e,t,s){var o=[],n=null,r=0;if(p.isUnd(s)&&(s=S.messageListChecked()),o=i.map(s,function(e){return e.uid}),""!==e&&0<o.length){switch(t){case c.MessageSetAction.SetSeen:i.each(s,function(e){e.unseen()&&r++,e.unseen(!1),b.storeMessageFlagsToCache(e)}),n=b.getFolderFromCacheList(e),n&&n.messageCountUnread(n.messageCountUnread()-r),y.messageSetSeen(p.emptyFunction,e,o,!0);break;case c.MessageSetAction.UnsetSeen:i.each(s,function(e){e.unseen()&&r++,e.unseen(!0),b.storeMessageFlagsToCache(e)}),n=b.getFolderFromCacheList(e),n&&n.messageCountUnread(n.messageCountUnread()-r+o.length),y.messageSetSeen(p.emptyFunction,e,o,!1);break;case c.MessageSetAction.SetFlag:i.each(s,function(e){e.flagged(!0),b.storeMessageFlagsToCache(e)}),y.messageSetFlagged(p.emptyFunction,e,o,!0);break;case c.MessageSetAction.UnsetFlag:i.each(s,function(e){e.flagged(!1),b.storeMessageFlagsToCache(e)}),y.messageSetFlagged(p.emptyFunction,e,o,!1)}RL.reloadFlagsCurrentMessageListAndMessageFromCache()}},s.prototype.setActionForAll=function(e,t){var s=null,o=S.messageList();if(""!==e&&(s=b.getFolderFromCacheList(e))){switch(t){case c.MessageSetAction.SetSeen:s=b.getFolderFromCacheList(e),s&&(i.each(o,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&&(i.each(o,function(e){e.unseen(!0)}),s.messageCountUnread(s.messageCountAll()),b.clearMessageFlagsFromCacheByFolder(e)),y.messageSetSeenToAll(p.emptyFunction,e,!1)}RL.reloadFlagsCurrentMessageListAndMessageFromCache()}},s.prototype.listSetSeen=function(){this.setAction(S.currentFolderFullNameRaw(),c.MessageSetAction.SetSeen,S.messageListCheckedOrSelected())},s.prototype.listSetAllSeen=function(){this.setActionForAll(S.currentFolderFullNameRaw(),c.MessageSetAction.SetSeen)},s.prototype.listUnsetSeen=function(){this.setAction(S.currentFolderFullNameRaw(),c.MessageSetAction.UnsetSeen,S.messageListCheckedOrSelected())},s.prototype.listSetFlags=function(){this.setAction(S.currentFolderFullNameRaw(),c.MessageSetAction.SetFlag,S.messageListCheckedOrSelected())},s.prototype.listUnsetFlags=function(){this.setAction(S.currentFolderFullNameRaw(),c.MessageSetAction.UnsetFlag,S.messageListCheckedOrSelected())},s.prototype.flagMessages=function(e){var t=this.messageListCheckedOrSelected(),s=[];e&&(0<t.length&&(s=i.map(t,function(e){return e.uid})),0<s.length&&-1<p.inArray(e.uid,s)?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]))},s.prototype.flagMessagesFast=function(e){var t=this.messageListCheckedOrSelected(),s=[];0<t.length&&(s=i.filter(t,function(e){return e.flagged()}),p.isUnd(e)?this.setAction(t[0].folderFullNameRaw,t.length===s.length?c.MessageSetAction.UnsetFlag:c.MessageSetAction.SetFlag,t):this.setAction(t[0].folderFullNameRaw,e?c.MessageSetAction.SetFlag:c.MessageSetAction.UnsetFlag,t))},s.prototype.seenMessagesFast=function(e){var t=this.messageListCheckedOrSelected(),s=[];0<t.length&&(s=i.filter(t,function(e){return e.unseen()}),p.isUnd(e)?this.setAction(t[0].folderFullNameRaw,0<s.length?c.MessageSetAction.SetSeen:c.MessageSetAction.UnsetSeen,t):this.setAction(t[0].folderFullNameRaw,e?c.MessageSetAction.SetSeen:c.MessageSetAction.UnsetSeen,t))},s.prototype.onBuild=function(e){var t=this;this.oContentVisible=o(".b-content",e),this.oContentScrollable=o(".content",this.oContentVisible),this.oContentVisible.on("click",".fullThreadHandle",function(){var e=[],t=n.dataFor(this);return t&&!t.lastInCollapsedThreadLoading()&&(S.messageListThreadFolder(t.folderFullNameRaw),e=S.messageListThreadUids(),t.lastInCollapsedThread()?e.push(0<t.parentUid()?t.parentUid():t.uid):e=i.without(e,0<t.parentUid()?t.parentUid():t.uid),S.messageListThreadUids(i.uniq(e)),t.lastInCollapsedThreadLoading(!0),t.lastInCollapsedThread(!t.lastInCollapsedThread()),RL.reloadMessageList()),!1}),this.selector.init(this.oContentVisible,this.oContentScrollable,c.KeyState.MessageList),e.on("click",".messageList .b-message-list-wrapper",function(){t.message.focused()&&t.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(){t.checkAll(!t.checkAll())}).on("click",".messageList .messageListItem .flagParent",function(){t.flagMessages(n.dataFor(this))}),this.initUploaderForAppend(),this.initShortcuts(),!d.bMobileDevice&&f.capa(c.Capa.Prefetch)&&a&&(a.setIdleDuration(10),a.idle(function(){t.prefetchNextTick()}))},s.prototype.initShortcuts=function(){var e=this;r("ctrl+p, command+p",c.KeyState.MessageList,function(){return!1}),r("z",[c.KeyState.MessageList,c.KeyState.MessageView],function(){return e.archiveCommand(),!1}),r("delete, shift+delete, shift+3",c.KeyState.MessageList,function(t,s){return t?(0<S.messageListCheckedOrSelected().length&&(s&&"shift+delete"===s.shortcut?e.deleteWithoutMoveCommand():e.deleteCommand()),!1):void 0}),r("ctrl+r, command+r",[c.KeyState.FolderList,c.KeyState.MessageList,c.KeyState.MessageView],function(){return e.reloadCommand(),!1}),r("ctrl+a, command+a",c.KeyState.MessageList,function(){return e.checkAll(!(e.checkAll()&&!e.isIncompleteChecked())),!1}),r("w,c",[c.KeyState.MessageList,c.KeyState.MessageView],function(){return v.showScreenPopup(w),!1}),r("i",[c.KeyState.MessageList,c.KeyState.MessageView],function(){return e.flagMessagesFast(),!1}),r("m",c.KeyState.MessageList,function(){return e.moveDropdownTrigger(!0),!1}),r("q",[c.KeyState.MessageList,c.KeyState.MessageView],function(){return e.seenMessagesFast(!0),!1}),r("u",[c.KeyState.MessageList,c.KeyState.MessageView],function(){return e.seenMessagesFast(!1),!1}),r("shift+f",[c.KeyState.MessageList,c.KeyState.MessageView],function(){return e.multyForwardCommand(),!1}),r("/",[c.KeyState.MessageList,c.KeyState.MessageView],function(){return e.inputMessageListSearchFocus(!0),!1}),r("esc",c.KeyState.MessageList,function(){return""!==e.messageListSearchDesc()?(e.cancelSearch(),!1):void 0}),r("tab, shift+tab, left, right",c.KeyState.MessageList,function(t,s){return t&&s&&"shift+tab"===s.shortcut||"left"===s.shortcut?e.folderList.focused(!0):e.message()&&e.message.focused(!0),!1}),r("ctrl+left, command+left",c.KeyState.MessageView,function(){return!1}),r("ctrl+right, command+right",c.KeyState.MessageView,function(){return!1})},s.prototype.prefetchNextTick=function(){if(!this.bPrefetch&&!a.now()&&this.viewModelVisibility()){var e=this,t=i.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,s){var o=!(c.StorageResultType.Success!==t||!s||!s.Result);i.delay(function(){e.bPrefetch=!1,o&&e.prefetchNextTick()},1e3)},t.folderFullNameRaw,t.uid))}},s.prototype.composeClick=function(){v.showScreenPopup(w)},s.prototype.advancedSearchClick=function(){v.showScreenPopup(E)},s.prototype.quotaTooltip=function(){return p.i18n("MESSAGE_LIST/QUOTA_SIZE",{SIZE:p.friendlySize(this.userUsageSize()),PROC:this.userUsageProc(),LIMIT:p.friendlySize(this.userQuota())})},s.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",i.bind(function(){this.dragOverEnter(!0)},this)).on("onDragLeave",i.bind(function(){this.dragOverEnter(!1)},this)).on("onBodyDragEnter",i.bind(function(){this.dragOver(!0)},this)).on("onBodyDragLeave",i.bind(function(){this.dragOver(!1)},this)).on("onSelect",i.bind(function(e,t){return e&&t&&"message/rfc822"===t.Type?(S.messageListLoading(!0),!0):!1},this)).on("onComplete",i.bind(function(){RL.reloadMessageList(!0,!0)},this)),!!e},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Consts.js":6,"../Common/Enums.js":7,"../Common/Events.js":8,"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Common/Selector.js":13,"../Common/Utils.js":14,"../External/Jua.js":21,"../External/ifvisible.js":25,"../External/jquery.js":26,"../External/key.js":27,"../External/ko.js":28,"../External/underscore.js":31,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractViewModel.js":36,"../Storages/AppSettings.js":68,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailCacheStorage.js":73,"../Storages/WebMailDataStorage.js":74,"./Popups/PopupsAdvancedSearchViewModel.js":83,"./Popups/PopupsComposeViewModel.js":86,"./Popups/PopupsFolderClearViewModel.js":89}],79:[function(e,t){!function(t){"use strict";function s(){b.call(this,"Right","MailMessageView");var t=this,s="",o=e("../Boots/RainLoopApp.js"),n=function(e){return u.createCommand(t,function(){this.replyOrforward(e)},t.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=i.observable(!1),this.moreDropdownTrigger=i.observable(!1),this.messageDomFocused=i.observable(!1).extend({rateLimit:0}),this.messageVisibility=i.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=n(l.ComposeType.Reply),this.replyAllCommand=n(l.ComposeType.ReplyAll),this.forwardCommand=n(l.ComposeType.Forward),this.forwardAsAttachmentCommand=n(l.ComposeType.ForwardAsAttachment),this.editAsNewCommand=n(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()&&o.deleteMessagesFromFolder(l.FolderType.Trash,this.message().folderFullNameRaw,[this.message().uid],!0)},this.messageVisibility),this.deleteWithoutMoveCommand=u.createCommand(this,function(){this.message()&&o.deleteMessagesFromFolder(l.FolderType.Trash,h.currentFolderFullNameRaw(),[this.message().uid],!1)},this.messageVisibility),this.archiveCommand=u.createCommand(this,function(){this.message()&&o.deleteMessagesFromFolder(l.FolderType.Archive,this.message().folderFullNameRaw,[this.message().uid],!0)},this.messageVisibility),this.spamCommand=u.createCommand(this,function(){this.message()&&o.deleteMessagesFromFolder(l.FolderType.Spam,this.message().folderFullNameRaw,[this.message().uid],!0)},this.messageVisibility),this.notSpamCommand=u.createCommand(this,function(){this.message()&&o.deleteMessagesFromFolder(l.FolderType.NotSpam,this.message().folderFullNameRaw,[this.message().uid],!0)},this.messageVisibility),this.viewHash="",this.viewSubject=i.observable(""),this.viewFromShort=i.observable(""),this.viewToShort=i.observable(""),this.viewFrom=i.observable(""),this.viewTo=i.observable(""),this.viewCc=i.observable(""),this.viewBcc=i.observable(""),this.viewDate=i.observable(""),this.viewMoment=i.observable(""),this.viewLineAsCcc=i.observable(""),this.viewViewLink=i.observable(""),this.viewDownloadLink=i.observable(""),this.viewUserPic=i.observable(a.DataImages.UserDotPic),this.viewUserPicVisible=i.observable(!1),this.viewPgpPassword=i.observable(""),this.viewPgpSignedVerifyStatus=i.computed(function(){return this.message()?this.message().pgpSignedVerifyStatus():l.SignedVerifyStatus.None},this),this.viewPgpSignedVerifyUser=i.computed(function(){return this.message()?this.message().pgpSignedVerifyUser():""},this),this.message.subscribe(function(e){this.messageActiveDom(null),this.viewPgpPassword(""),e?(this.viewHash!==e.hash&&this.scrollMessageToTop(),this.viewHash=e.hash,this.viewSubject(e.subject()),this.viewFromShort(e.fromToLine(!0,!0)),this.viewToShort(e.toToLine(!0,!0)),this.viewFrom(e.fromToLine(!1)),this.viewTo(e.toToLine(!1)),this.viewCc(e.ccToLine(!1)),this.viewBcc(e.bccToLine(!1)),this.viewDate(e.fullFormatDateValue()),this.viewMoment(e.momentDate()),this.viewLineAsCcc(e.lineAsCcc()),this.viewViewLink(e.viewLink()),this.viewDownloadLink(e.downloadLink()),s=e.fromAsSingleEmail(),p.getUserPic(s,function(e,o){e!==t.viewUserPic()&&s===o&&(t.viewUserPicVisible(!1),t.viewUserPic(a.DataImages.UserDotPic),""!==e&&(t.viewUserPicVisible(!0),t.viewUserPic(e)))})):(this.viewHash="",this.scrollMessageToTop())},this),this.fullScreenMode.subscribe(function(e){e?r.addClass("rl-message-fullscreen"):r.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")}),f.constructorEnd(this)}var o=e("../External/jquery.js"),i=e("../External/ko.js"),n=e("../External/key.js"),r=e("../External/$html.js"),a=e("../Common/Consts.js"),l=e("../Common/Enums.js"),c=e("../Common/Globals.js"),u=e("../Common/Utils.js"),d=e("../Common/Events.js"),p=e("../Storages/WebMailCacheStorage.js"),h=e("../Storages/WebMailDataStorage.js"),m=e("../Storages/WebMailAjaxRemoteStorage.js"),g=e("./Popups/PopupsComposeViewModel.js"),f=e("../Knoin/Knoin.js"),b=e("../Knoin/KnoinAbstractViewModel.js");f.extendAsViewModel("MailBoxMessageViewViewModel",s),s.prototype.isPgpActionVisible=function(){return l.SignedVerifyStatus.Success!==this.viewPgpSignedVerifyStatus()},s.prototype.isPgpStatusVerifyVisible=function(){return l.SignedVerifyStatus.None!==this.viewPgpSignedVerifyStatus()},s.prototype.isPgpStatusVerifySuccess=function(){return l.SignedVerifyStatus.Success===this.viewPgpSignedVerifyStatus()},s.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},s.prototype.scrollToTop=function(){var e=o(".messageItem.nano .content",this.viewModelDom);e&&e[0]?e.scrollTop(0):o(".messageItem",this.viewModelDom).scrollTop(0),u.windowResize()},s.prototype.fullScreen=function(){this.fullScreenMode(!0),u.windowResize()},s.prototype.unFullScreen=function(){this.fullScreenMode(!1),u.windowResize()},s.prototype.toggleFullScreen=function(){u.removeSelection(),this.fullScreenMode(!this.fullScreenMode()),u.windowResize()},s.prototype.replyOrforward=function(e){f.showScreenPopup(g,[e,h.message()])},s.prototype.onBuild=function(t){var s=this,n=e("../Boots/RainLoopApp.js");this.fullScreenMode.subscribe(function(e){e&&s.message.focused(!0)},this),o(".attachmentsPlace",t).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}),t.on("click",".messageView .messageItem .messageItemHeader",function(){c.useKeyboardShortcuts()&&s.message()&&s.message.focused(!0)}).on("click","a",function(e){return!(e&&3!==e.which&&n.mailToHelper(o(this).attr("href")))}).on("click",".attachmentsPlace .attachmentPreview",function(e){e&&e.stopPropagation&&e.stopPropagation()}).on("click",".attachmentsPlace .attachmentItem",function(){var e=i.dataFor(this);e&&e.download&&n.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=t.find(".messageItem .content"),this.oMessageScrollerDom=this.oMessageScrollerDom&&this.oMessageScrollerDom[0]?this.oMessageScrollerDom:null,this.initShortcuts()},s.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},s.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,s){return t?(s&&"shift+delete"===s.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})},s.prototype.isDraftFolder=function(){return h.message()&&h.draftFolder()===h.message().folderFullNameRaw},s.prototype.isSentFolder=function(){return h.message()&&h.sentFolder()===h.message().folderFullNameRaw},s.prototype.isSpamFolder=function(){return h.message()&&h.spamFolder()===h.message().folderFullNameRaw},s.prototype.isSpamDisabled=function(){return h.message()&&h.spamFolder()===a.Values.UnuseOptionValue},s.prototype.isArchiveFolder=function(){return h.message()&&h.archiveFolder()===h.message().folderFullNameRaw},s.prototype.isArchiveDisabled=function(){return h.message()&&h.archiveFolder()===a.Values.UnuseOptionValue},s.prototype.isDraftOrSentFolder=function(){return this.isDraftFolder()||this.isSentFolder()},s.prototype.composeClick=function(){f.showScreenPopup(g)},s.prototype.editMessage=function(){h.message()&&f.showScreenPopup(g,[l.ComposeType.Draft,h.message()])},s.prototype.scrollMessageToTop=function(){this.oMessageScrollerDom&&this.oMessageScrollerDom.scrollTop(0)},s.prototype.showImages=function(e){e&&e.showExternalImages&&e.showExternalImages(!0)},s.prototype.printableCheckedMessageCount=function(){var e=this.messageListCheckedOrSelectedUidsWithSubMails().length;return e>0?100>e?e:"99+":""},s.prototype.verifyPgpSignedClearMessage=function(e){e&&e.verifyPgpSignedClearMessage()},s.prototype.decryptPgpEncryptedMessage=function(e){e&&e.decryptPgpEncryptedMessage(this.viewPgpPassword())},s.prototype.readReceipt=function(t){if(t&&""!==t.readReceipt()){m.sendReadReceiptMessage(u.emptyFunction,t.folderFullNameRaw,t.uid,t.readReceipt(),u.i18n("READ_RECEIPT/SUBJECT",{SUBJECT:t.subject()}),u.i18n("READ_RECEIPT/BODY",{"READ-RECEIPT":h.accountEmail()})),t.isReadReceipt(!0),p.storeMessageFlagsToCache(t);var s=e("../Boots/RainLoopApp.js");s.reloadFlagsCurrentMessageListAndMessageFromCache()}},t.exports=s}(t)},{"../Boots/RainLoopApp.js":4,"../Common/Consts.js":6,"../Common/Enums.js":7,"../Common/Events.js":8,"../Common/Globals.js":9,"../Common/Utils.js":14,"../External/$html.js":17,"../External/jquery.js":26,"../External/key.js":27,"../External/ko.js":28,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractViewModel.js":36,"../Storages/WebMailAjaxRemoteStorage.js":72,"../Storages/WebMailCacheStorage.js":73,"../Storages/WebMailDataStorage.js":74,"./Popups/PopupsComposeViewModel.js":86}],80:[function(e,t){!function(t){"use strict";function s(){i.call(this),o.constructorEnd(this)}var o=e("../Knoin/Knoin.js"),i=e("./AbstractSystemDropDownViewModel.js");o.extendAsViewModel("MailBoxSystemDropDownViewModel",s,i),t.exports=s}(t)},{"../Knoin/Knoin.js":33,"./AbstractSystemDropDownViewModel.js":75}],81:[function(e,t){!function(t){"use strict";function s(){c.call(this,"Popups","PopupsAddAccount");var t=e("../../Boots/RainLoopApp.js");this.email=i.observable(""),this.password=i.observable(""),this.emailError=i.observable(!1),this.passwordError=i.observable(!1),this.email.subscribe(function(){this.emailError(!1)},this),this.password.subscribe(function(){this.passwordError(!1)},this),this.submitRequest=i.observable(!1),this.submitError=i.observable(""),this.emailFocus=i.observable(!1),this.addAccountCommand=r.createCommand(this,function(){return this.emailError(""===r.trim(this.email())),this.passwordError(""===r.trim(this.password())),this.emailError()||this.passwordError()?!1:(this.submitRequest(!0),a.accountAdd(o.bind(function(e,s){this.submitRequest(!1),n.StorageResultType.Success===e&&s&&"AccountAdd"===s.Action?s.Result?(t.accountsAndIdentities(),this.cancelCommand()):s.ErrorCode&&this.submitError(r.getNotification(s.ErrorCode)):this.submitError(r.getNotification(n.Notification.UnknownError))},this),this.email(),"",this.password()),!0)},function(){return!this.submitRequest()}),l.constructorEnd(this)}var o=e("../../External/underscore.js"),i=e("../../External/ko.js"),n=e("../../Common/Enums.js"),r=e("../../Common/Utils.js"),a=e("../../Storages/WebMailAjaxRemoteStorage.js"),l=e("../../Knoin/Knoin.js"),c=e("../../Knoin/KnoinAbstractViewModel.js");l.extendAsViewModel("PopupsAddAccountViewModel",s),s.prototype.clearPopup=function(){this.email(""),this.password(""),this.emailError(!1),this.passwordError(!1),this.submitRequest(!1),this.submitError("")},s.prototype.onShow=function(){this.clearPopup()},s.prototype.onFocus=function(){this.emailFocus(!0)},t.exports=s}(t)},{"../../Boots/RainLoopApp.js":4,"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../External/underscore.js":31,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailAjaxRemoteStorage.js":72}],82:[function(e,t){!function(t){"use strict";function s(){a.call(this,"Popups","PopupsAddOpenPgpKey");var t=e("../../Boots/RainLoopApp.js");this.key=o.observable(""),this.key.error=o.observable(!1),this.key.focus=o.observable(!1),this.key.subscribe(function(){this.key.error(!1)},this),this.addOpenPgpKeyCommand=i.createCommand(this,function(){var e=30,s=null,o=i.trim(this.key()),r=/[\-]{3,6}BEGIN[\s]PGP[\s](PRIVATE|PUBLIC)[\s]KEY[\s]BLOCK[\-]{3,6}[\s\S]+?[\-]{3,6}END[\s]PGP[\s](PRIVATE|PUBLIC)[\s]KEY[\s]BLOCK[\-]{3,6}/gi,a=n.openpgpKeyring;if(o=o.replace(/[\r\n]([a-zA-Z0-9]{2,}:[^\r\n]+)[\r\n]+([a-zA-Z0-9\/\\+=]{10,})/g,"\n$1!-!N!-!$2").replace(/[\n\r]+/g,"\n").replace(/!-!N!-!/g,"\n\n"),this.key.error(""===o),!a||this.key.error())return!1;for(;;){if(s=r.exec(o),!s||0>e)break;s[0]&&s[1]&&s[2]&&s[1]===s[2]&&("PRIVATE"===s[1]?a.privateKeys.importKey(s[0]):"PUBLIC"===s[1]&&a.publicKeys.importKey(s[0])),e--}return a.store(),t.reloadOpenPgpKeys(),i.delegateRun(this,"cancelCommand"),!0}),r.constructorEnd(this)}var o=e("../../External/ko.js"),i=e("../../Common/Utils.js"),n=e("../../Storages/WebMailDataStorage.js"),r=e("../../Knoin/Knoin.js"),a=e("../../Knoin/KnoinAbstractViewModel.js");r.extendAsViewModel("PopupsAddOpenPgpKeyViewModel",s),s.prototype.clearPopup=function(){this.key(""),this.key.error(!1)},s.prototype.onShow=function(){this.clearPopup()},s.prototype.onFocus=function(){this.key.focus(!0)},t.exports=s}(t)},{"../../Boots/RainLoopApp.js":4,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailDataStorage.js":74}],83:[function(e,t){!function(t){"use strict";function s(){l.call(this,"Popups","PopupsAdvancedSearch"),this.fromFocus=o.observable(!1),this.from=o.observable(""),this.to=o.observable(""),this.subject=o.observable(""),this.text=o.observable(""),this.selectedDateValue=o.observable(-1),this.hasAttachment=o.observable(!1),this.starred=o.observable(!1),this.unseen=o.observable(!1),this.searchCommand=n.createCommand(this,function(){var e=this.buildSearchString();""!==e&&r.mainMessageListSearch(e),this.cancelCommand()}),a.constructorEnd(this)}var o=e("../../External/ko.js"),i=e("../../External/moment.js"),n=e("../../Common/Utils.js"),r=e("../../Storages/WebMailDataStorage.js"),a=e("../../Knoin/Knoin.js"),l=e("../../Knoin/KnoinAbstractViewModel.js");a.extendAsViewModel("PopupsAdvancedSearchViewModel",s),s.prototype.buildSearchStringValue=function(e){return-1<e.indexOf(" ")&&(e='"'+e+'"'),e},s.prototype.buildSearchString=function(){var e=[],t=n.trim(this.from()),s=n.trim(this.to()),o=n.trim(this.subject()),r=n.trim(this.text()),a=[],l=[];return t&&""!==t&&e.push("from:"+this.buildSearchStringValue(t)),s&&""!==s&&e.push("to:"+this.buildSearchStringValue(s)),o&&""!==o&&e.push("subject:"+this.buildSearchStringValue(o)),this.hasAttachment()&&l.push("attachment"),this.unseen()&&a.push("unseen"),this.starred()&&a.push("flagged"),0<l.length&&e.push("has:"+l.join(",")),0<a.length&&e.push("is:"+a.join(",")),-1<this.selectedDateValue()&&e.push("date:"+i().subtract("days",this.selectedDateValue()).format("YYYY.MM.DD")+"/"),r&&""!==r&&e.push("text:"+this.buildSearchStringValue(r)),n.trim(e.join(" "))},s.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)},s.prototype.onShow=function(){this.clearPopup()},s.prototype.onFocus=function(){this.fromFocus(!0)},t.exports=s}(t)},{"../../Common/Utils.js":14,"../../External/ko.js":28,"../../External/moment.js":29,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailDataStorage.js":74}],84:[function(e,t){!function(t){"use strict";function s(){l.call(this,"Popups","PopupsAsk"),this.askDesc=o.observable(""),this.yesButton=o.observable(""),this.noButton=o.observable(""),this.yesFocus=o.observable(!1),this.noFocus=o.observable(!1),this.fYesAction=null,this.fNoAction=null,this.bDisabeCloseOnEsc=!0,this.sDefaultKeyScope=n.KeyState.PopupAsk,a.constructorEnd(this)}var o=e("../../External/ko.js"),i=e("../../External/key.js"),n=e("../../Common/Enums.js"),r=e("../../Common/Utils.js"),a=e("../../Knoin/Knoin.js"),l=e("../../Knoin/KnoinAbstractViewModel.js");a.extendAsViewModel("PopupsAskViewModel",s),s.prototype.clearPopup=function(){this.askDesc(""),this.yesButton(r.i18n("POPUPS_ASK/BUTTON_YES")),this.noButton(r.i18n("POPUPS_ASK/BUTTON_NO")),this.yesFocus(!1),this.noFocus(!1),this.fYesAction=null,this.fNoAction=null},s.prototype.yesClick=function(){this.cancelCommand(),r.isFunc(this.fYesAction)&&this.fYesAction.call(null)},s.prototype.noClick=function(){this.cancelCommand(),r.isFunc(this.fNoAction)&&this.fNoAction.call(null)},s.prototype.onShow=function(e,t,s,o,i){this.clearPopup(),this.fYesAction=t||null,this.fNoAction=s||null,this.askDesc(e||""),o&&this.yesButton(o),o&&this.yesButton(i)},s.prototype.onFocus=function(){this.yesFocus(!0)},s.prototype.onBuild=function(){i("tab, shift+tab, right, left",n.KeyState.PopupAsk,_.bind(function(){return this.yesFocus()?this.noFocus(!0):this.yesFocus(!0),!1},this)),i("esc",n.KeyState.PopupAsk,_.bind(function(){return this.noClick(),!1},this))},t.exports=s}(t)},{"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/key.js":27,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36}],85:[function(e,t){!function(t){"use strict";function s(){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=a.createCommand(this,function(){var e=this,t=!0,s=null,n=[];this.submitRequest(!0),t&&this.sign()&&""===this.from()&&(this.notification(a.i18n("PGP_NOTIFICATIONS/SPECIFY_FROM_EMAIL")),t=!1),t&&this.sign()&&(s=c.findPrivateKeyByEmail(this.from(),this.password()),s||(this.notification(a.i18n("PGP_NOTIFICATIONS/NO_PRIVATE_KEY_FOUND_FOR",{EMAIL:this.from()})),t=!1)),t&&this.encrypt()&&0===this.to().length&&(this.notification(a.i18n("PGP_NOTIFICATIONS/SPECIFY_AT_LEAST_ONE_RECIPIENT")),t=!1),t&&this.encrypt()&&(n=[],i.each(this.to(),function(s){var o=c.findPublicKeysByEmail(s);0===o.length&&t&&(e.notification(a.i18n("PGP_NOTIFICATIONS/NO_PUBLIC_KEYS_FOUND_FOR",{EMAIL:s})),t=!1),n=n.concat(o)}),!t||0!==n.length&&this.to().length===n.length||(t=!1)),i.delay(function(){if(e.resultCallback&&t)try{s&&0===n.length?e.resultCallback(o.openpgp.signClearMessage([s],e.text())):s&&0<n.length?e.resultCallback(o.openpgp.signAndEncryptMessage(n,s,e.text())):!s&&0<n.length&&e.resultCallback(o.openpgp.encryptMessage(n,e.text()))}catch(i){e.notification(a.i18n("PGP_NOTIFICATIONS/PGP_ERROR",{ERROR:""+i})),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 o=e("../../External/window.js"),i=e("../../External/underscore.js"),n=e("../../External/ko.js"),r=e("../../External/key.js"),a=e("../../Common/Utils.js"),l=e("../../Common/Enums.js"),c=e("../../Storages/WebMailDataStorage.js"),u=e("../../Models/EmailModel.js"),d=e("../../Knoin/Knoin.js"),p=e("../../Knoin/KnoinAbstractViewModel.js");d.extendAsViewModel("PopupsComposeOpenPgpViewModel",s),s.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},s.prototype.onBuild=function(){r("tab,shift+tab",l.KeyState.PopupComposeOpenPGP,i.bind(function(){switch(!0){case this.password.focus():this.buttonFocus(!0);break;case this.buttonFocus():this.password.focus(!0)}return!1},this))},s.prototype.onHide=function(){this.clearPopup()},s.prototype.onFocus=function(){this.sign()?this.password.focus(!0):this.buttonFocus(!0)},s.prototype.onShow=function(e,t,s,o,n,r){this.clearPopup();var l=new u,c="",d=[];this.resultCallback=e,l.clear(),l.mailsoParse(s),""!==l.email&&(c=l.email),""!==o&&d.push(o),""!==n&&d.push(n),""!==r&&d.push(r),d=d.join(", ").split(","),d=i.compact(i.map(d,function(e){return l.clear(),l.mailsoParse(a.trim(e)),""===l.email?!1:l.email})),this.from(c),this.to(d),this.text(t)},t.exports=s}(t)},{"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/key.js":27,"../../External/ko.js":28,"../../External/underscore.js":31,"../../External/window.js":32,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Models/EmailModel.js":43,"../../Storages/WebMailDataStorage.js":74}],86:[function(e,t){!function(t){"use strict";function s(){T.call(this,"Popups","PopupsCompose");var t=e("../../Boots/RainLoopApp.js");this.oEditor=null,this.aDraftInfo=null,this.sInReplyTo="",this.bFromDraft=!1,this.bSkipNext=!1,this.sReferences="",this.bCapaAdditionalIdentities=b.capa(u.Capa.AdditionalIdentities);var i=this,a=function(e){!1===i.showCcAndBcc()&&0<e.length&&i.showCcAndBcc(!0)};this.capaOpenPGP=S.capaOpenPGP,this.resizer=r.observable(!1).extend({throttle:50}),this.identitiesDropdownTrigger=r.observable(!1),this.to=r.observable(""),this.to.focusTrigger=r.observable(!1),this.cc=r.observable(""),this.bcc=r.observable(""),this.replyTo=r.observable(""),this.subject=r.observable(""),this.isHtml=r.observable(!1),this.requestReadReceipt=r.observable(!1),this.sendError=r.observable(!1),this.sendSuccessButSaveError=r.observable(!1),this.savedError=r.observable(!1),this.savedTime=r.observable(0),this.savedOrSendingText=r.observable(""),this.emptyToError=r.observable(!1),this.attachmentsInProcessError=r.observable(!1),this.showCcAndBcc=r.observable(!1),this.cc.subscribe(a,this),this.bcc.subscribe(a,this),this.draftFolder=r.observable(""),this.draftUid=r.observable(""),this.sending=r.observable(!1),this.saving=r.observable(!1),this.attachments=r.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=r.computed(function(){return""!==this.draftFolder()&&""!==this.draftUid()},this),this.composeUploaderButton=r.observable(null),this.composeUploaderDropPlace=r.observable(null),this.dragAndDropEnabled=r.observable(!1),this.dragAndDropOver=r.observable(!1).extend({throttle:1}),this.dragAndDropVisible=r.observable(!1).extend({throttle:1}),this.attacheMultipleAllowed=r.observable(!1),this.addAttachmentEnabled=r.observable(!1),this.composeEditorArea=r.observable(null),this.identities=S.identities,this.defaultIdentityID=S.defaultIdentityID,this.currentIdentityID=r.observable(""),this.currentIdentityString=r.observable(""),this.currentIdentityResultEmail=r.observable(""),this.identitiesOptions=r.computed(function(){var e=[{optValue:S.accountEmail(),optText:this.formattedFrom(!1)}];return n.each(S.identities(),function(t){e.push({optValue:t.id,optText:t.formattedNameForCompose()})}),e},this),r.computed(function(){var e="",t="",s=null,o=this.identities(),i=this.currentIdentityID();return this.bCapaAdditionalIdentities&&i&&i!==S.accountEmail()&&(s=n.find(o,function(e){return e&&i===e.id}),e=s?s.formattedNameForCompose():"",t=s?s.formattedNameForEmail():"",""===e&&o[0])?(this.currentIdentityID(o[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()&&p.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=r.computed(function(){return!this.sending()&&!this.saving()},this),this.deleteCommand=p.createCommand(this,function(){t.deleteMessagesFromFolderWithoutCheck(this.draftFolder(),[this.draftUid()]),j.hideScreenPopup(s)},function(){return this.isDraftFolderMessage()}),this.sendMessageResponse=n.bind(this.sendMessageResponse,this),this.saveMessageResponse=n.bind(this.saveMessageResponse,this),this.sendCommand=p.createCommand(this,function(){var e=p.trim(this.to()),s=S.sentFolder(),o=[];0<this.attachmentsInProcess().length?this.attachmentsInProcessError(!0):0===e.length?this.emptyToError(!0):(S.replySameFolder()&&p.isArray(this.aDraftInfo)&&3===this.aDraftInfo.length&&p.isNormal(this.aDraftInfo[2])&&0<this.aDraftInfo[2].length&&(s=this.aDraftInfo[2]),""===s?j.showScreenPopup(E,[u.SetSystemFoldersNotification.Sent]):(this.sendError(!1),this.sending(!0),p.isArray(this.aDraftInfo)&&3===this.aDraftInfo.length&&(o=y.getMessageFlagsFromCache(this.aDraftInfo[2],this.aDraftInfo[1]),o&&("forward"===this.aDraftInfo[0]?o[3]=!0:o[2]=!0,y.setMessageFlagsToCache(this.aDraftInfo[2],this.aDraftInfo[1],o),t.reloadFlagsCurrentMessageListAndMessageFromCache(),y.setFolderHash(this.aDraftInfo[2],""))),s=d.Values.UnuseOptionValue===s?"":s,y.setFolderHash(this.draftFolder(),""),y.setFolderHash(s,""),v.sendMessage(this.sendMessageResponse,this.draftFolder(),this.draftUid(),s,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=p.createCommand(this,function(){S.draftFolderNotEnabled()?j.showScreenPopup(E,[u.SetSystemFoldersNotification.Draft]):(this.savedError(!1),this.saving(!0),this.bSkipNext=!0,y.setFolderHash(S.draftFolder(),""),v.saveMessage(this.saveMessageResponse,this.draftFolder(),this.draftUid(),S.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),g.sub("interval.1m",function(){!this.modalVisibility()||S.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=r.observable(!!b.settingsGet("DropboxApiKey")),this.dropboxCommand=p.createCommand(this,function(){return o.Dropbox&&o.Dropbox.choose({success:function(e){e&&e[0]&&e[0].link&&i.addDropboxAttachment(e[0])},linkType:"direct",multiselect:!1}),!0},function(){return this.dropboxEnabled()}),this.driveEnabled=r.observable(h.bXMLHttpRequestSupported&&!!b.settingsGet("GoogleClientID")&&!!b.settingsGet("GoogleApiKey")),this.driveVisible=r.observable(!1),this.driveCommand=p.createCommand(this,function(){return this.driveOpenPopup(),!0},function(){return this.driveEnabled()}),this.driveCallback=n.bind(this.driveCallback,this),this.bDisabeCloseOnEsc=!0,this.sDefaultKeyScope=u.KeyState.Compose,this.tryToClosePopup=n.debounce(n.bind(this.tryToClosePopup,this),200),this.emailsSource=n.bind(this.emailsSource,this),j.constructorEnd(this)}var o=e("../../External/window.js"),i=e("../../External/jquery.js"),n=e("../../External/underscore.js"),r=e("../../External/ko.js"),a=e("../../External/moment.js"),l=e("../../External/$window.js"),c=e("../../External/JSON.js"),u=e("../../Common/Enums.js"),d=e("../../Common/Consts.js"),p=e("../../Common/Utils.js"),h=e("../../Common/Globals.js"),m=e("../../Common/LinkBuilder.js"),g=e("../../Common/Events.js"),f=e("../../Common/NewHtmlEditorWrapper.js"),b=e("../../Storages/AppSettings.js"),S=e("../../Storages/WebMailDataStorage.js"),y=e("../../Storages/WebMailCacheStorage.js"),v=e("../../Storages/WebMailAjaxRemoteStorage.js"),C=e("../../Models/ComposeAttachmentModel.js"),w=e("./PopupsComposeOpenPgpViewModel.js"),E=e("./PopupsFolderSystemViewModel.js"),A=e("./PopupsAskViewModel.js"),j=e("../../Knoin/Knoin.js"),T=e("../../Knoin/KnoinAbstractViewModel.js");j.extendAsViewModel("PopupsComposeViewModel",s),s.prototype.emailsSource=function(t,s){var o=e("../../Boots/RainLoopApp.js");o.getAutocomplete(t.term,function(e){s(n.map(e,function(e){return e.toLine(!1)}))})},s.prototype.openOpenPgpPopup=function(){if(this.capaOpenPGP()&&this.oEditor&&!this.oEditor.isHtml()){var e=this;j.showScreenPopup(w,[function(t){e.editor(function(e){e.setPlain(t)})},this.oEditor.getData(),this.currentIdentityResultEmail(),this.to(),this.cc(),this.bcc()])}},s.prototype.reloadDraftFolder=function(){var t=e("../../Boots/RainLoopApp.js"),s=S.draftFolder();""!==s&&(y.setFolderHash(s,""),S.currentFolderFullNameRaw()===s?t.reloadMessageList(!0):t.folderInformation(s))},s.prototype.findIdentityIdByMessage=function(e,t){var s={},o="",i=function(e){return e&&e.email&&s[e.email]?(o=s[e.email],!0):!1};if(this.bCapaAdditionalIdentities&&n.each(this.identities(),function(e){s[e.email()]=e.id}),s[S.accountEmail()]=S.accountEmail(),t)switch(e){case u.ComposeType.Empty:break;case u.ComposeType.Reply:case u.ComposeType.ReplyAll:case u.ComposeType.Forward:case u.ComposeType.ForwardAsAttachment:n.find(n.union(t.to,t.cc,t.bcc,t.deliveredTo),i);break;case u.ComposeType.Draft:n.find(n.union(t.from,t.replyTo),i)}return""===o&&(o=this.defaultIdentityID()),""===o&&(o=S.accountEmail()),o},s.prototype.selectIdentity=function(e){e&&this.currentIdentityID(e.optValue)},s.prototype.formattedFrom=function(e){var t=S.displayName(),s=S.accountEmail();return""===t?s:(p.isUnd(e)?1:!e)?t+" ("+s+")":'"'+p.quoteName(t)+'" <'+s+">"},s.prototype.sendMessageResponse=function(e,t){var s=!1,i="";this.sending(!1),u.StorageResultType.Success===e&&t&&t.Result&&(s=!0,this.modalVisibility()&&p.delegateRun(this,"closeCommand")),this.modalVisibility()&&!s&&(t&&u.Notification.CantSaveMessage===t.ErrorCode?(this.sendSuccessButSaveError(!0),o.alert(p.trim(p.i18n("COMPOSE/SAVED_ERROR_ON_SEND")))):(i=p.getNotification(t&&t.ErrorCode?t.ErrorCode:u.Notification.CantSendMessage,t&&t.ErrorMessage?t.ErrorMessage:""),this.sendError(!0),o.alert(i||p.getNotification(u.Notification.CantSendMessage)))),this.reloadDraftFolder()},s.prototype.saveMessageResponse=function(e,t){var s=!1,i=null;this.saving(!1),u.StorageResultType.Success===e&&t&&t.Result&&t.Result.NewFolder&&t.Result.NewUid&&(this.bFromDraft&&(i=S.message(),i&&this.draftFolder()===i.folderFullNameRaw&&this.draftUid()===i.uid&&S.message(null)),this.draftFolder(t.Result.NewFolder),this.draftUid(t.Result.NewUid),this.modalVisibility()&&(this.savedTime(o.Math.round((new o.Date).getTime()/1e3)),this.savedOrSendingText(0<this.savedTime()?p.i18n("COMPOSE/SAVED_TIME",{TIME:a.unix(this.savedTime()-1).format("LT")}):""),s=!0,this.bFromDraft&&y.setFolderHash(this.draftFolder(),""))),this.modalVisibility()||s||(this.savedError(!0),this.savedOrSendingText(p.getNotification(u.Notification.CantSaveMessage))),this.reloadDraftFolder()},s.prototype.onHide=function(){this.reset(),j.routeOn()},s.prototype.convertSignature=function(e,t,s,o){var i=!1,n=!1;if(""!==e&&(":HTML:"===e.substr(0,6)&&(i=!0,e=e.substr(6)),e=e.replace(/[\r]/,""),t=p.pString(t),""!==t&&(e=e.replace(/{{FROM}}/,t)),e=e.replace(/[\s]{1,2}{{FROM}}/,"{{FROM}}"),e=e.replace(/{{FROM}}/,""),e=e.replace(/{{DATE}}/,a().format("llll")),s&&u.ComposeType.Empty===o&&-1<e.indexOf("{{DATA}}")&&(n=!0,e=e.replace("{{DATA}}",s)),e=e.replace(/{{DATA}}/,""),i||(e=p.convertPlainTextToHtml(e))),s&&!n)switch(o){case u.ComposeType.Empty:e=s+"<br />"+e;break;default:e=e+"<br />"+s}return e},s.prototype.editor=function(e){if(e){var t=this;!this.oEditor&&this.composeEditorArea()?n.delay(function(){t.oEditor=new f(t.composeEditorArea(),null,function(){e(t.oEditor)},function(e){t.isHtml(!!e)})},300):this.oEditor&&e(this.oEditor)}},s.prototype.onShow=function(e,t,s,o,r){j.routeOff();var a=this,l="",c="",d="",h="",m="",g=null,f=null,b="",y="",C=[],w={},E=S.accountEmail(),A=S.signature(),T=S.signatureToAll(),F=[],M=null,N=null,R=e||u.ComposeType.Empty,L=function(e,t){for(var s=0,o=e.length,i=[];o>s;s++)i.push(e[s].toLine(!!t));return i.join(", ")};if(t=t||null,t&&p.isNormal(t)&&(N=p.isArray(t)&&1===t.length?t[0]:p.isArray(t)?null:t),null!==E&&(w[E]=!0),this.currentIdentityID(this.findIdentityIdByMessage(R,N)),this.reset(),p.isNonEmptyArray(s)&&this.to(L(s)),""!==R&&N){switch(h=N.fullFormatDateValue(),m=N.subject(),M=N.aDraftInfo,g=i(N.body).clone(),p.removeBlockquoteSwitcher(g),f=g.find("[data-html-editor-font-wrapper=true]"),b=f&&f[0]?f.html():g.html(),R){case u.ComposeType.Empty:break;case u.ComposeType.Reply:this.to(L(N.replyEmails(w))),this.subject(p.replySubjectAdd("Re",m)),this.prepearMessageAttachments(N,R),this.aDraftInfo=["reply",N.uid,N.folderFullNameRaw],this.sInReplyTo=N.sMessageId,this.sReferences=p.trim(this.sInReplyTo+" "+N.sReferences);break;case u.ComposeType.ReplyAll:C=N.replyAllEmails(w),this.to(L(C[0])),this.cc(L(C[1])),this.subject(p.replySubjectAdd("Re",m)),this.prepearMessageAttachments(N,R),this.aDraftInfo=["reply",N.uid,N.folderFullNameRaw],this.sInReplyTo=N.sMessageId,this.sReferences=p.trim(this.sInReplyTo+" "+N.references());break;case u.ComposeType.Forward:this.subject(p.replySubjectAdd("Fwd",m)),this.prepearMessageAttachments(N,R),this.aDraftInfo=["forward",N.uid,N.folderFullNameRaw],this.sInReplyTo=N.sMessageId,this.sReferences=p.trim(this.sInReplyTo+" "+N.sReferences);break;case u.ComposeType.ForwardAsAttachment:this.subject(p.replySubjectAdd("Fwd",m)),this.prepearMessageAttachments(N,R),this.aDraftInfo=["forward",N.uid,N.folderFullNameRaw],this.sInReplyTo=N.sMessageId,this.sReferences=p.trim(this.sInReplyTo+" "+N.sReferences);break;case u.ComposeType.Draft:this.to(L(N.to)),this.cc(L(N.cc)),this.bcc(L(N.bcc)),this.bFromDraft=!0,this.draftFolder(N.folderFullNameRaw),this.draftUid(N.uid),this.subject(m),this.prepearMessageAttachments(N,R),this.aDraftInfo=p.isNonEmptyArray(M)&&3===M.length?M:null,this.sInReplyTo=N.sInReplyTo,this.sReferences=N.sReferences;break;case u.ComposeType.EditAsNew:this.to(L(N.to)),this.cc(L(N.cc)),this.bcc(L(N.bcc)),this.subject(m),this.prepearMessageAttachments(N,R),this.aDraftInfo=p.isNonEmptyArray(M)&&3===M.length?M:null,this.sInReplyTo=N.sInReplyTo,this.sReferences=N.sReferences}switch(R){case u.ComposeType.Reply:case u.ComposeType.ReplyAll:l=N.fromToLine(!1,!0),y=p.i18n("COMPOSE/REPLY_MESSAGE_TITLE",{DATETIME:h,EMAIL:l}),b="<br /><br />"+y+":<blockquote><p>"+b+"</p></blockquote>";break;case u.ComposeType.Forward:l=N.fromToLine(!1,!0),c=N.toToLine(!1,!0),d=N.ccToLine(!1,!0),b="<br /><br /><br />"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TITLE")+"<br />"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_FROM")+": "+l+"<br />"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_TO")+": "+c+(0<d.length?"<br />"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_CC")+": "+d:"")+"<br />"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SENT")+": "+p.encodeHtml(h)+"<br />"+p.i18n("COMPOSE/FORWARD_MESSAGE_TOP_SUBJECT")+": "+p.encodeHtml(m)+"<br /><br />"+b;break;case u.ComposeType.ForwardAsAttachment:b=""}T&&""!==A&&u.ComposeType.EditAsNew!==R&&u.ComposeType.Draft!==R&&(b=this.convertSignature(A,L(N.from,!0),b,R)),this.editor(function(e){e.setHtml(b,!1),N.isHtml()||e.modeToggle(!1)})}else u.ComposeType.Empty===R?(this.subject(p.isNormal(o)?""+o:""),b=p.isNormal(r)?""+r:"",T&&""!==A&&(b=this.convertSignature(A,"",p.convertPlainTextToHtml(b),R)),this.editor(function(e){e.setHtml(b,!1),u.EditorDefaultType.Html!==S.editorDefaultType()&&e.modeToggle(!1)})):p.isNonEmptyArray(t)&&n.each(t,function(e){a.addMessageAsAttachment(e)});F=this.getAttachmentsDownloadsForUpload(),p.isNonEmptyArray(F)&&v.messageUploadAttachments(function(e,t){if(u.StorageResultType.Success===e&&t&&t.Result){var s=null,o="";if(!a.viewModelVisibility())for(o in t.Result)t.Result.hasOwnProperty(o)&&(s=a.getAttachmentById(t.Result[o]),s&&s.tempName(o))}else a.setMessageAttachmentFailedDowbloadText()},F),this.triggerForResize()},s.prototype.onFocus=function(){""===this.to()?this.to.focusTrigger(!this.to.focusTrigger()):this.oEditor&&this.oEditor.focus(),this.triggerForResize()},s.prototype.editorResize=function(){this.oEditor&&this.oEditor.resize()},s.prototype.tryToClosePopup=function(){var e=this;j.isPopupVisible(A)||j.showScreenPopup(A,[p.i18n("POPUPS_ASK/DESC_WANT_CLOSE_THIS_WINDOW"),function(){e.modalVisibility()&&p.delegateRun(e,"closeCommand")}])},s.prototype.onBuild=function(){this.initUploader();var e=this,t=null;key("ctrl+q, command+q",u.KeyState.Compose,function(){return e.identitiesDropdownTrigger(!0),!1}),key("ctrl+s, command+s",u.KeyState.Compose,function(){return e.saveCommand(),!1}),key("ctrl+enter, command+enter",u.KeyState.Compose,function(){return e.sendCommand(),!1}),key("esc",u.KeyState.Compose,function(){return e.modalVisibility()&&e.tryToClosePopup(),!1}),l.on("resize",function(){e.triggerForResize()}),this.dropboxEnabled()&&(t=o.document.createElement("script"),t.type="text/javascript",t.src="https://www.dropbox.com/static/api/1/dropins.js",i(t).attr("id","dropboxjs").attr("data-app-key",b.settingsGet("DropboxApiKey")),o.document.body.appendChild(t)),this.driveEnabled()&&i.getScript("https://apis.google.com/js/api.js",function(){o.gapi&&e.driveVisible(!0)})},s.prototype.driveCallback=function(e,t){if(t&&o.XMLHttpRequest&&o.google&&t[o.google.picker.Response.ACTION]===o.google.picker.Action.PICKED&&t[o.google.picker.Response.DOCUMENTS]&&t[o.google.picker.Response.DOCUMENTS][0]&&t[o.google.picker.Response.DOCUMENTS][0].id){var s=this,i=new o.XMLHttpRequest;i.open("GET","https://www.googleapis.com/drive/v2/files/"+t[o.google.picker.Response.DOCUMENTS][0].id),i.setRequestHeader("Authorization","Bearer "+e),i.addEventListener("load",function(){if(i&&i.responseText){var t=c.parse(i.responseText),o=function(e,t,s){e&&e.exportLinks&&(e.exportLinks[t]?(e.downloadUrl=e.exportLinks[t],e.title=e.title+"."+s,e.mimeType=t):e.exportLinks["application/pdf"]&&(e.downloadUrl=e.exportLinks["application/pdf"],e.title=e.title+".pdf",e.mimeType="application/pdf"))
|
||
};if(t&&!t.downloadUrl&&t.mimeType&&t.exportLinks)switch(t.mimeType.toString().toLowerCase()){case"application/vnd.google-apps.document":o(t,"application/vnd.openxmlformats-officedocument.wordprocessingml.document","docx");break;case"application/vnd.google-apps.spreadsheet":o(t,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","xlsx");break;case"application/vnd.google-apps.drawing":o(t,"image/png","png");break;case"application/vnd.google-apps.presentation":o(t,"application/vnd.openxmlformats-officedocument.presentationml.presentation","pptx");break;default:o(t,"application/pdf","pdf")}t&&t.downloadUrl&&s.addDriveAttachment(t,e)}}),i.send()}},s.prototype.driveCreatePiker=function(e){if(o.gapi&&e&&e.access_token){var t=this;o.gapi.load("picker",{callback:function(){if(o.google&&o.google.picker){var s=(new o.google.picker.PickerBuilder).addView((new o.google.picker.DocsView).setIncludeFolders(!0)).setAppId(b.settingsGet("GoogleClientID")).setOAuthToken(e.access_token).setCallback(n.bind(t.driveCallback,t,e.access_token)).enableFeature(o.google.picker.Feature.NAV_HIDDEN).build();s.setVisible(!0)}}})}},s.prototype.driveOpenPopup=function(){if(o.gapi){var e=this;o.gapi.load("auth",{callback:function(){var t=o.gapi.auth.getToken();t?e.driveCreatePiker(t):o.gapi.auth.authorize({client_id:b.settingsGet("GoogleClientID"),scope:"https://www.googleapis.com/auth/drive.readonly",immediate:!0},function(t){if(t&&!t.error){var s=o.gapi.auth.getToken();s&&e.driveCreatePiker(s)}else o.gapi.auth.authorize({client_id:b.settingsGet("GoogleClientID"),scope:"https://www.googleapis.com/auth/drive.readonly",immediate:!1},function(t){if(t&&!t.error){var s=o.gapi.auth.getToken();s&&e.driveCreatePiker(s)}})})}})}},s.prototype.getAttachmentById=function(e){for(var t=this.attachments(),s=0,o=t.length;o>s;s++)if(t[s]&&e===t[s].id)return t[s];return null},s.prototype.initUploader=function(){if(this.composeUploaderButton()){var e={},t=p.pInt(b.settingsGet("AttachmentLimit")),s=new Jua({action:m.upload(),name:"uploader",queueSize:2,multipleSizeLimit:50,disableFolderDragAndDrop:!1,clickElement:this.composeUploaderButton(),dragAndDropElement:this.composeUploaderDropPlace()});s?(s.on("onDragEnter",n.bind(function(){this.dragAndDropOver(!0)},this)).on("onDragLeave",n.bind(function(){this.dragAndDropOver(!1)},this)).on("onBodyDragEnter",n.bind(function(){this.dragAndDropVisible(!0)},this)).on("onBodyDragLeave",n.bind(function(){this.dragAndDropVisible(!1)},this)).on("onProgress",n.bind(function(t,s,i){var n=null;p.isUnd(e[t])?(n=this.getAttachmentById(t),n&&(e[t]=n)):n=e[t],n&&n.progress(" - "+o.Math.floor(s/i*100)+"%")},this)).on("onSelect",n.bind(function(e,o){this.dragAndDropOver(!1);var i=this,n=p.isUnd(o.FileName)?"":o.FileName.toString(),r=p.isNormal(o.Size)?p.pInt(o.Size):null,a=new C(e,n,r);return a.cancel=function(e){return function(){i.attachments.remove(function(t){return t&&t.id===e}),s&&s.cancel(e)}}(e),this.attachments.push(a),r>0&&t>0&&r>t?(a.error(p.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):!0},this)).on("onStart",n.bind(function(t){var s=null;p.isUnd(e[t])?(s=this.getAttachmentById(t),s&&(e[t]=s)):s=e[t],s&&(s.waiting(!1),s.uploading(!0))},this)).on("onComplete",n.bind(function(t,s,o){var i="",n=null,r=null,a=this.getAttachmentById(t);r=s&&o&&o.Result&&o.Result.Attachment?o.Result.Attachment:null,n=o&&o.Result&&o.Result.ErrorCode?o.Result.ErrorCode:null,null!==n?i=p.getUploadErrorDescByCode(n):r||(i=p.i18n("UPLOAD/ERROR_UNKNOWN")),a&&(""!==i&&0<i.length?a.waiting(!1).uploading(!1).error(i):r&&(a.waiting(!1).uploading(!1),a.initByUploadJson(r)),p.isUnd(e[t])&&delete e[t])},this)),this.addAttachmentEnabled(!0).dragAndDropEnabled(s.isDragAndDropSupported())):this.addAttachmentEnabled(!1).dragAndDropEnabled(!1)}},s.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},s.prototype.addMessageAsAttachment=function(e){if(e){var t=this,s=null,o=e.subject(),i=function(e){return function(){t.attachments.remove(function(t){return t&&t.id===e})}};o=".eml"===o.substr(-4).toLowerCase()?o:o+".eml",s=new C(e.requestHash,o,e.size()),s.fromMessage=!0,s.cancel=i(e.requestHash),s.waiting(!1).uploading(!0),this.attachments.push(s)}},s.prototype.addDropboxAttachment=function(e){var t=this,s=null,o=function(e){return function(){t.attachments.remove(function(t){return t&&t.id===e})}},i=p.pInt(b.settingsGet("AttachmentLimit")),n=e.bytes;return s=new C(e.link,e.name,n),s.fromMessage=!1,s.cancel=o(e.link),s.waiting(!1).uploading(!0),this.attachments.push(s),n>0&&i>0&&n>i?(s.uploading(!1),s.error(p.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(v.composeUploadExternals(function(e,t){var o=!1;s.uploading(!1),u.StorageResultType.Success===e&&t&&t.Result&&t.Result[s.id]&&(o=!0,s.tempName(t.Result[s.id])),o||s.error(p.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},[e.link]),!0)},s.prototype.addDriveAttachment=function(e,t){var s=this,o=function(e){return function(){s.attachments.remove(function(t){return t&&t.id===e})}},i=p.pInt(b.settingsGet("AttachmentLimit")),n=null,r=e.fileSize?p.pInt(e.fileSize):0;return n=new C(e.downloadUrl,e.title,r),n.fromMessage=!1,n.cancel=o(e.downloadUrl),n.waiting(!1).uploading(!0),this.attachments.push(n),r>0&&i>0&&r>i?(n.uploading(!1),n.error(p.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG")),!1):(v.composeUploadDrive(function(e,t){var s=!1;n.uploading(!1),u.StorageResultType.Success===e&&t&&t.Result&&t.Result[n.id]&&(s=!0,n.tempName(t.Result[n.id][0]),n.size(p.pInt(t.Result[n.id][1]))),s||n.error(p.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},e.downloadUrl,t),!0)},s.prototype.prepearMessageAttachments=function(e,t){if(e){var s=this,o=p.isNonEmptyArray(e.attachments())?e.attachments():[],i=0,n=o.length,r=null,a=null,l=!1,c=function(e){return function(){s.attachments.remove(function(t){return t&&t.id===e})}};if(u.ComposeType.ForwardAsAttachment===t)this.addMessageAsAttachment(e);else for(;n>i;i++){switch(a=o[i],l=!1,t){case u.ComposeType.Reply:case u.ComposeType.ReplyAll:l=a.isLinked;break;case u.ComposeType.Forward:case u.ComposeType.Draft:case u.ComposeType.EditAsNew:l=!0}l&&(r=new C(a.download,a.fileName,a.estimatedSize,a.isInline,a.isLinked,a.cid,a.contentLocation),r.fromMessage=!0,r.cancel=c(a.download),r.waiting(!1).uploading(!0),this.attachments.push(r))}}},s.prototype.removeLinkedAttachments=function(){this.attachments.remove(function(e){return e&&e.isLinked})},s.prototype.setMessageAttachmentFailedDowbloadText=function(){n.each(this.attachments(),function(e){e&&e.fromMessage&&e.waiting(!1).uploading(!1).error(p.getUploadErrorDescByCode(u.UploadErrorCode.FileNoUploaded))},this)},s.prototype.isEmptyForm=function(e){e=p.isUnd(e)?!0:!!e;var t=e?0===this.attachments().length:0===this.attachmentsInReady().length;return 0===this.to().length&&0===this.cc().length&&0===this.bcc().length&&0===this.subject().length&&t&&(!this.oEditor||""===this.oEditor.getData())},s.prototype.reset=function(){this.to(""),this.cc(""),this.bcc(""),this.replyTo(""),this.subject(""),this.requestReadReceipt(!1),this.aDraftInfo=null,this.sInReplyTo="",this.bFromDraft=!1,this.sReferences="",this.sendError(!1),this.sendSuccessButSaveError(!1),this.savedError(!1),this.savedTime(0),this.savedOrSendingText(""),this.emptyToError(!1),this.attachmentsInProcessError(!1),this.showCcAndBcc(!1),this.attachments([]),this.dragAndDropOver(!1),this.dragAndDropVisible(!1),this.draftFolder(""),this.draftUid(""),this.sending(!1),this.saving(!1),this.oEditor&&this.oEditor.clear(!1)},s.prototype.getAttachmentsDownloadsForUpload=function(){return n.map(n.filter(this.attachments(),function(e){return e&&""===e.tempName()}),function(e){return e.id})},s.prototype.triggerForResize=function(){this.resizer(!this.resizer()),this.editorResizeThrottle()},t.exports=s}(t)},{"../../Boots/RainLoopApp.js":4,"../../Common/Consts.js":6,"../../Common/Enums.js":7,"../../Common/Events.js":8,"../../Common/Globals.js":9,"../../Common/LinkBuilder.js":10,"../../Common/NewHtmlEditorWrapper.js":11,"../../Common/Utils.js":14,"../../External/$window.js":18,"../../External/JSON.js":20,"../../External/jquery.js":26,"../../External/ko.js":28,"../../External/moment.js":29,"../../External/underscore.js":31,"../../External/window.js":32,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Models/ComposeAttachmentModel.js":39,"../../Storages/AppSettings.js":68,"../../Storages/WebMailAjaxRemoteStorage.js":72,"../../Storages/WebMailCacheStorage.js":73,"../../Storages/WebMailDataStorage.js":74,"./PopupsAskViewModel.js":84,"./PopupsComposeOpenPgpViewModel.js":85,"./PopupsFolderSystemViewModel.js":91}],87:[function(e,t){!function(t){"use strict";function s(){w.call(this,"Popups","PopupsContacts");var t=this,i=function(e){e&&0<e.length&&t.viewProperties.removeAll(e)};this.allowContactsSync=m.allowContactsSync,this.enableContactsSync=m.enableContactsSync,this.allowExport=!u.bMobileDevice,this.search=r.observable(""),this.contactsCount=r.observable(0),this.contacts=m.contacts,this.contactTags=m.contactTags,this.currentContact=r.observable(null),this.importUploaderButton=r.observable(null),this.contactsPage=r.observable(1),this.contactsPageCount=r.computed(function(){var e=o.Math.ceil(this.contactsCount()/c.Defaults.ContactsPerPage);return 0>=e?1:e},this),this.contactsPagenator=r.computed(d.computedPagenatorHelper(this.contactsPage,this.contactsPageCount)),this.emptySelection=r.observable(!0),this.viewClearSearch=r.observable(!1),this.viewID=r.observable(""),this.viewReadOnly=r.observable(!1),this.viewProperties=r.observableArray([]),this.viewTags=r.observable(""),this.viewTags.visibility=r.observable(!1),this.viewTags.focusTrigger=r.observable(!1),this.viewTags.focusTrigger.subscribe(function(e){e||""!==this.viewTags()?e&&this.viewTags.visibility(!0):this.viewTags.visibility(!1)},this),this.viewSaveTrigger=r.observable(l.SaveSettingsStep.Idle),this.viewPropertiesNames=this.viewProperties.filter(function(e){return-1<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=r.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=r.computed(function(){var e=this.viewPropertiesNames(),t=this.viewPropertiesEmails(),s=function(e){return""!==d.trim(e.value())};return!(!n.find(e,s)&&!n.find(t,s))},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=r.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=r.observable(!1),this.useCheckboxesInList=m.useCheckboxesInList,this.search.subscribe(function(){this.reloadContactList()},this),this.contacts.subscribe(function(){d.windowResize()},this),this.viewProperties.subscribe(function(){d.windowResize()},this),this.contactsChecked=r.computed(function(){return n.filter(this.contacts(),function(e){return e.checked()})},this),this.contactsCheckedOrSelected=r.computed(function(){var e=this.contactsChecked(),t=this.currentContact();return n.union(e,t?[t]:[])},this),this.contactsCheckedOrSelectedUids=r.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(),t=[];d.isNonEmptyArray(e)&&(t=n.map(e,function(e){if(e){var t=e.getNameAndEmailHelper(),s=t?new f(t[0],t[1]):null;if(s&&s.validate())return s}return null}),t=n.compact(t)),d.isNonEmptyArray(t)&&(C.hideScreenPopup(s),C.showScreenPopup(v,[l.ComposeType.Empty,null,t]))},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 e=d.fakeMd5(),s=[];n.each(this.viewProperties(),function(e){e.type()&&""!==d.trim(e.value())&&s.push([e.type(),e.value(),e.typeStr()])}),g.contactSave(function(s,o){var i=!1;t.viewSaving(!1),l.StorageResultType.Success===s&&o&&o.Result&&o.Result.RequestUid===e&&0<d.pInt(o.Result.ResultID)&&(""===t.viewID()&&t.viewID(d.pInt(o.Result.ResultID)),t.reloadContactList(),i=!0),n.delay(function(){t.viewSaveTrigger(i?l.SaveSettingsStep.TrueResult:l.SaveSettingsStep.FalseResult)},300),i&&(t.watchDirty(!1),n.delay(function(){t.viewSaveTrigger(l.SaveSettingsStep.Idle)},1e3))},e,this.viewID(),this.viewTags(),s)},function(){var e=this.viewHasNonEmptyRequaredProperties(),t=this.viewReadOnly();return!this.viewSaving()&&e&&!t}),this.syncCommand=d.createCommand(this,function(){var t=this,s=e("../../Boots/RainLoopApp.js");s.contactsSync(function(e,s){l.StorageResultType.Success===e&&s&&s.Result||o.alert(d.getNotification(s&&s.ErrorCode?s.ErrorCode:l.Notification.ContactsSyncError)),t.reloadContactList(!0)})},function(){return!this.contacts.syncing()&&!this.contacts.importing()}),this.bDropPageAfterDelete=!1,this.watchDirty=r.observable(!1),this.watchHash=r.observable(!1),this.viewHash=r.computed(function(){return""+t.viewTags()+"|"+n.map(t.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),C.constructorEnd(this)}var o=e("../../External/window.js"),i=e("../../External/jquery.js"),n=e("../../External/underscore.js"),r=e("../../External/ko.js"),a=e("../../External/key.js"),l=e("../../Common/Enums.js"),c=e("../../Common/Consts.js"),u=e("../../Common/Globals.js"),d=e("../../Common/Utils.js"),p=e("../../Common/LinkBuilder.js"),h=e("../../Common/Selector.js"),m=e("../../Storages/WebMailDataStorage.js"),g=e("../../Storages/WebMailAjaxRemoteStorage.js"),f=e("../../Models/EmailModel.js"),b=e("../../Models/ContactModel.js"),S=e("../../Models/ContactTagModel.js"),y=e("../../Models/ContactPropertyModel.js"),v=e("./PopupsComposeViewModel.js"),C=e("../../Knoin/Knoin.js"),w=e("../../Knoin/KnoinAbstractViewModel.js");C.extendAsViewModel("PopupsContactsViewModel",s),s.prototype.contactTagsSource=function(t,s){var o=e("../../Boots/RainLoopApp.js");o.getContactTagsAutocomplete(t.term,function(e){s(n.map(e,function(e){return e.toLine(!1)}))})},s.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},s.prototype.addNewProperty=function(e,t){this.viewProperties.push(new y(e,t||"","",!0,this.getPropertyPlceholder(e)))},s.prototype.addNewOrFocusProperty=function(e,t){var s=n.find(this.viewProperties(),function(t){return e===t.type()});s?s.focused(!0):this.addNewProperty(e,t)},s.prototype.addNewTag=function(){this.viewTags.visibility(!0),this.viewTags.focusTrigger(!0)},s.prototype.addNewEmail=function(){this.addNewProperty(l.ContactPropertyType.Email,"Home")},s.prototype.addNewPhone=function(){this.addNewProperty(l.ContactPropertyType.Phone,"Mobile")},s.prototype.addNewWeb=function(){this.addNewProperty(l.ContactPropertyType.Web)},s.prototype.addNewNickname=function(){this.addNewOrFocusProperty(l.ContactPropertyType.Nick)},s.prototype.addNewNotes=function(){this.addNewOrFocusProperty(l.ContactPropertyType.Note)},s.prototype.addNewBirthday=function(){this.addNewOrFocusProperty(l.ContactPropertyType.Birthday)},s.prototype.exportVcf=function(){var t=e("../../Boots/RainLoopApp.js");t.download(p.exportContactsVcf())},s.prototype.exportCsv=function(){var t=e("../../Boots/RainLoopApp.js");t.download(p.exportContactsCsv())},s.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,s){this.contacts.importing(!1),this.reloadContactList(),e&&t&&s&&s.Result||o.alert(d.i18n("CONTACTS/ERROR_IMPORT_FILE"))},this))}},s.prototype.removeCheckedOrSelectedContactsFromList=function(){var e=this,t=this.contacts,s=this.currentContact(),o=this.contacts().length,i=this.contactsCheckedOrSelected();0<i.length&&(n.each(i,function(t){s&&s.idContact===t.idContact&&(s=null,e.currentContact(null)),t.deleted(!0),o--}),0>=o&&(this.bDropPageAfterDelete=!0),n.delay(function(){n.each(i,function(e){t.remove(e)})},500))},s.prototype.deleteSelectedContacts=function(){0<this.contactsCheckedOrSelected().length&&(g.contactsDelete(n.bind(this.deleteResponse,this),this.contactsCheckedOrSelectedUids()),this.removeCheckedOrSelectedContactsFromList())},s.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)},s.prototype.removeProperty=function(e){this.viewProperties.remove(e)},s.prototype.populateViewContact=function(e){var t="",s="",o="",i=[];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]?s=e[1]:l.ContactPropertyType.FirstName===e[0]?o=e[1]:i.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()),i.unshift(new y(l.ContactPropertyType.LastName,"",s,!1,this.getPropertyPlceholder(l.ContactPropertyType.LastName))),i.unshift(new y(l.ContactPropertyType.FirstName,"",o,!e,this.getPropertyPlceholder(l.ContactPropertyType.FirstName))),this.viewID(t),this.viewProperties([]),this.viewProperties(i),this.watchDirty(!1),this.watchHash(!0)},s.prototype.reloadContactList=function(e){var t=this,s=(this.contactsPage()-1)*c.Defaults.ContactsPerPage;this.bDropPageAfterDelete=!1,(d.isUnd(e)?1:!e)||(this.contactsPage(1),s=0),this.contacts.loading(!0),g.contacts(function(e,s){var o=0,i=[],r=[];l.StorageResultType.Success===e&&s&&s.Result&&s.Result.List&&(d.isNonEmptyArray(s.Result.List)&&(i=n.map(s.Result.List,function(e){var t=new b;return t.parse(e)?t:null}),i=n.compact(i),o=d.pInt(s.Result.Count),o=o>0?o:0),d.isNonEmptyArray(s.Result.Tags)&&(r=n.map(s.Result.Tags,function(e){var t=new S;return t.parse(e)?t:null}),r=n.compact(r))),t.contactsCount(o),t.contacts(i),t.contacts.loading(!1),t.contactTags(r),t.viewClearSearch(""!==t.search())},s,c.Defaults.ContactsPerPage,this.search())},s.prototype.onBuild=function(e){this.oContentVisible=i(".b-list-content",e),this.oContentScrollable=i(".content",this.oContentVisible),this.selector.init(this.oContentVisible,this.oContentScrollable,l.KeyState.ContactList);var t=this;a("delete",l.KeyState.ContactList,function(){return t.deleteCommand(),!1}),e.on("click",".e-pagenator .e-page",function(){var e=r.dataFor(this);e&&(t.contactsPage(d.pInt(e.value)),t.reloadContactList())}),this.initUploader()},s.prototype.onShow=function(){C.routeOff(),this.reloadContactList(!0)},s.prototype.onHide=function(){C.routeOn(),this.currentContact(null),this.emptySelection(!0),this.search(""),this.contactsCount(0),this.contacts([])},t.exports=s}(t)},{"../../Boots/RainLoopApp.js":4,"../../Common/Consts.js":6,"../../Common/Enums.js":7,"../../Common/Globals.js":9,"../../Common/LinkBuilder.js":10,"../../Common/Selector.js":13,"../../Common/Utils.js":14,"../../External/jquery.js":26,"../../External/key.js":27,"../../External/ko.js":28,"../../External/underscore.js":31,"../../External/window.js":32,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Models/ContactModel.js":40,"../../Models/ContactPropertyModel.js":41,"../../Models/ContactTagModel.js":42,"../../Models/EmailModel.js":43,"../../Storages/WebMailAjaxRemoteStorage.js":72,"../../Storages/WebMailDataStorage.js":74,"./PopupsComposeViewModel.js":86}],88:[function(e,t){!function(t){"use strict";function s(){l.call(this,"Popups","PopupsFilter"),this.filter=o.observable(null),this.selectedFolderValue=o.observable(i.Values.UnuseOptionValue),this.folderSelectList=r.folderMenuForMove,this.defautOptionsAfterRender=n.defautOptionsAfterRender,a.constructorEnd(this)}var o=e("../../External/ko.js"),i=e("../../Common/Consts.js"),n=e("../../Common/Utils.js"),r=e("../../Storages/WebMailDataStorage.js"),a=e("../../Knoin/Knoin.js"),l=e("../../Knoin/KnoinAbstractViewModel.js");a.extendAsViewModel("PopupsFilterViewModel",s),s.prototype.clearPopup=function(){},s.prototype.onShow=function(e){this.clearPopup(),this.filter(e)},t.exports=s}(t)},{"../../Common/Consts.js":6,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailDataStorage.js":74}],89:[function(e,t){!function(t){"use strict";function s(){u.call(this,"Popups","PopupsFolderClear");var t=e("../../Boots/RainLoopApp.js");this.selectedFolder=o.observable(null),this.clearingProcess=o.observable(!1),this.clearingError=o.observable(""),this.folderFullNameForClear=o.computed(function(){var e=this.selectedFolder();return e?e.printableFullName():""},this),this.folderNameForClear=o.computed(function(){var e=this.selectedFolder();return e?e.localName():""},this),this.dangerDescHtml=o.computed(function(){return n.i18n("POPUPS_CLEAR_FOLDER/DANGER_DESC_HTML_1",{FOLDER:this.folderNameForClear()})},this),this.clearCommand=n.createCommand(this,function(){var e=this,s=this.selectedFolder();s&&(r.message(null),r.messageList([]),this.clearingProcess(!0),a.setFolderHash(s.fullNameRaw,""),l.folderClear(function(s,o){e.clearingProcess(!1),i.StorageResultType.Success===s&&o&&o.Result?(t.reloadMessageList(!0),e.cancelCommand()):e.clearingError(o&&o.ErrorCode?n.getNotification(o.ErrorCode):n.getNotification(i.Notification.MailServerError))},s.fullNameRaw))},function(){var e=this.selectedFolder(),t=this.clearingProcess();return!t&&null!==e}),c.constructorEnd(this)}var o=e("../../External/ko.js"),i=e("../../Common/Enums.js"),n=e("../../Common/Utils.js"),r=e("../../Storages/WebMailDataStorage.js"),a=e("../../Storages/WebMailCacheStorage.js"),l=e("../../Storages/WebMailAjaxRemoteStorage.js"),c=e("../../Knoin/Knoin.js"),u=e("../../Knoin/KnoinAbstractViewModel.js");c.extendAsViewModel("PopupsFolderClearViewModel",s),s.prototype.clearPopup=function(){this.clearingProcess(!1),this.selectedFolder(null)},s.prototype.onShow=function(e){this.clearPopup(),e&&this.selectedFolder(e)},t.exports=s}(t)},{"../../Boots/RainLoopApp.js":4,"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailAjaxRemoteStorage.js":72,"../../Storages/WebMailCacheStorage.js":73,"../../Storages/WebMailDataStorage.js":74}],90:[function(e,t){!function(t){"use strict";function s(){u.call(this,"Popups","PopupsFolderCreate"),r.initOnStartOrLangChange(function(){this.sNoParentText=r.i18n("POPUPS_CREATE_FOLDER/SELECT_NO_PARENT")},this),this.folderName=o.observable(""),this.folderName.focused=o.observable(!1),this.selectedParentValue=o.observable(n.Values.UnuseOptionValue),this.parentFolderSelectList=o.computed(function(){var e=[],t=null,s=null,o=a.folderList(),i=function(e){return e?e.isSystemFolder()?e.name()+" "+e.manageFolderSystemName():e.name():""};return e.push(["",this.sNoParentText]),""!==a.namespace&&(t=function(e){return a.namespace!==e.fullNameRaw.substr(0,a.namespace.length)}),r.folderListOptionsBuilder([],o,[],e,null,t,s,i)},this),this.createFolder=r.createCommand(this,function(){var t=e("../../Boots/RainLoopApp.js"),s=this.selectedParentValue();""===s&&1<a.namespace.length&&(s=a.namespace.substr(0,a.namespace.length-1)),a.foldersCreating(!0),l.folderCreate(function(e,s){a.foldersCreating(!1),i.StorageResultType.Success===e&&s&&s.Result?t.folders():a.foldersListError(s&&s.ErrorCode?r.getNotification(s.ErrorCode):r.i18n("NOTIFICATIONS/CANT_CREATE_FOLDER"))},this.folderName(),s),this.cancelCommand()},function(){return this.simpleFolderNameValidation(this.folderName())}),this.defautOptionsAfterRender=r.defautOptionsAfterRender,c.constructorEnd(this)}var o=e("../../External/ko.js"),i=e("../../Common/Enums.js"),n=e("../../Common/Consts.js"),r=e("../../Common/Utils.js"),a=e("../../Storages/WebMailDataStorage.js"),l=e("../../Storages/WebMailAjaxRemoteStorage.js"),c=e("../../Knoin/Knoin.js"),u=e("../../Knoin/KnoinAbstractViewModel.js");c.extendAsViewModel("PopupsFolderCreateViewModel",s),s.prototype.sNoParentText="",s.prototype.simpleFolderNameValidation=function(e){return/^[^\\\/]+$/g.test(r.trim(e))},s.prototype.clearPopup=function(){this.folderName(""),this.selectedParentValue(""),this.folderName.focused(!1)},s.prototype.onShow=function(){this.clearPopup()},s.prototype.onFocus=function(){this.folderName.focused(!0)},t.exports=s}(t)},{"../../Boots/RainLoopApp.js":4,"../../Common/Consts.js":6,"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailAjaxRemoteStorage.js":72,"../../Storages/WebMailDataStorage.js":74}],91:[function(e,t){!function(t){"use strict";function s(){d.call(this,"Popups","PopupsFolderSystem"),r.initOnStartOrLangChange(function(){this.sChooseOnText=r.i18n("POPUPS_SYSTEM_FOLDERS/SELECT_CHOOSE_ONE"),this.sUnuseText=r.i18n("POPUPS_SYSTEM_FOLDERS/SELECT_UNUSE_NAME")},this),this.notification=o.observable(""),this.folderSelectList=o.computed(function(){return r.folderListOptionsBuilder([],l.folderList(),l.folderListSystemNames(),[["",this.sChooseOnText],[n.Values.UnuseOptionValue,this.sUnuseText]])},this);var e=this,t=null,s=null;this.sentFolder=l.sentFolder,this.draftFolder=l.draftFolder,this.spamFolder=l.spamFolder,this.trashFolder=l.trashFolder,this.archiveFolder=l.archiveFolder,t=_.debounce(function(){a.settingsSet("SentFolder",e.sentFolder()),a.settingsSet("DraftFolder",e.draftFolder()),a.settingsSet("SpamFolder",e.spamFolder()),a.settingsSet("TrashFolder",e.trashFolder()),a.settingsSet("ArchiveFolder",e.archiveFolder()),c.saveSystemFolders(r.emptyFunction,{SentFolder:e.sentFolder(),DraftFolder:e.draftFolder(),SpamFolder:e.spamFolder(),TrashFolder:e.trashFolder(),ArchiveFolder:e.archiveFolder(),NullFolder:"NullFolder"})},1e3),s=function(){a.settingsSet("SentFolder",e.sentFolder()),a.settingsSet("DraftFolder",e.draftFolder()),a.settingsSet("SpamFolder",e.spamFolder()),a.settingsSet("TrashFolder",e.trashFolder()),a.settingsSet("ArchiveFolder",e.archiveFolder()),t()},this.sentFolder.subscribe(s),this.draftFolder.subscribe(s),this.spamFolder.subscribe(s),this.trashFolder.subscribe(s),this.archiveFolder.subscribe(s),this.defautOptionsAfterRender=r.defautOptionsAfterRender,u.constructorEnd(this)}var o=e("../../External/ko.js"),i=e("../../Common/Enums.js"),n=e("../../Common/Consts.js"),r=e("../../Common/Utils.js"),a=e("../../Storages/AppSettings.js"),l=e("../../Storages/WebMailDataStorage.js"),c=e("../../Storages/WebMailAjaxRemoteStorage.js"),u=e("../../Knoin/Knoin.js"),d=e("../../Knoin/KnoinAbstractViewModel.js");u.extendAsViewModel("PopupsFolderSystemViewModel",s),s.prototype.sChooseOnText="",s.prototype.sUnuseText="",s.prototype.onShow=function(e){var t="";switch(e=r.isUnd(e)?i.SetSystemFoldersNotification.None:e){case i.SetSystemFoldersNotification.Sent:t=r.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SENT");break;case i.SetSystemFoldersNotification.Draft:t=r.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_DRAFTS");break;case i.SetSystemFoldersNotification.Spam:t=r.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_SPAM");break;case i.SetSystemFoldersNotification.Trash:t=r.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_TRASH");break;case i.SetSystemFoldersNotification.Archive:t=r.i18n("POPUPS_SYSTEM_FOLDERS/NOTIFICATION_ARCHIVE")}this.notification(t)},t.exports=s}(t)},{"../../Common/Consts.js":6,"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/AppSettings.js":68,"../../Storages/WebMailAjaxRemoteStorage.js":72,"../../Storages/WebMailDataStorage.js":74}],92:[function(e,t){!function(t){"use strict";function s(){c.call(this,"Popups","PopupsGenerateNewOpenPgpKey");var t=e("../../Boots/RainLoopApp.js");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=r.createCommand(this,function(){var e=this,s="",n=null,l=a.openpgpKeyring;return this.email.error(""===r.trim(this.email())),!l||this.email.error()?!1:(s=this.email(),""!==this.name()&&(s=this.name()+" <"+s+">"),this.submitRequest(!0),i.delay(function(){n=o.openpgp.generateKeyPair({userId:s,numBits:r.pInt(e.keyBitLength()),passphrase:r.trim(e.password())}),n&&n.privateKeyArmored&&(l.privateKeys.importKey(n.privateKeyArmored),l.publicKeys.importKey(n.publicKeyArmored),l.store(),t.reloadOpenPgpKeys(),r.delegateRun(e,"cancelCommand")),e.submitRequest(!1)},100),!0)}),l.constructorEnd(this)}var o=e("../../External/window.js"),i=e("../../External/underscore.js"),n=e("../../External/ko.js"),r=e("../../Common/Utils.js"),a=e("../../Storages/WebMailDataStorage.js"),l=e("../../Knoin/Knoin.js"),c=e("../../Knoin/KnoinAbstractViewModel.js");l.extendAsViewModel("PopupsGenerateNewOpenPgpKeyViewModel",s),s.prototype.clearPopup=function(){this.name(""),this.password(""),this.email(""),this.email.error(!1),this.keyBitLength(2048)
|
||
},s.prototype.onShow=function(){this.clearPopup()},s.prototype.onFocus=function(){this.email.focus(!0)},t.exports=s}(t)},{"../../Boots/RainLoopApp.js":4,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../External/underscore.js":31,"../../External/window.js":32,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailDataStorage.js":74}],93:[function(e,t){!function(t){"use strict";function s(){c.call(this,"Popups","PopupsIdentity");var t=e("../../Boots/RainLoopApp.js");this.id="",this.edit=o.observable(!1),this.owner=o.observable(!1),this.email=o.observable("").validateEmail(),this.email.focused=o.observable(!1),this.name=o.observable(""),this.name.focused=o.observable(!1),this.replyTo=o.observable("").validateSimpleEmail(),this.replyTo.focused=o.observable(!1),this.bcc=o.observable("").validateSimpleEmail(),this.bcc.focused=o.observable(!1),this.submitRequest=o.observable(!1),this.submitError=o.observable(""),this.addOrEditIdentityCommand=n.createCommand(this,function(){return this.email.hasError()||this.email.hasError(""===n.trim(this.email())),this.email.hasError()?(this.owner()||this.email.focused(!0),!1):this.replyTo.hasError()?(this.replyTo.focused(!0),!1):this.bcc.hasError()?(this.bcc.focused(!0),!1):(this.submitRequest(!0),a.identityUpdate(_.bind(function(e,s){this.submitRequest(!1),i.StorageResultType.Success===e&&s?s.Result?(t.accountsAndIdentities(),this.cancelCommand()):s.ErrorCode&&this.submitError(n.getNotification(s.ErrorCode)):this.submitError(n.getNotification(i.Notification.UnknownError))},this),this.id,this.email(),this.name(),this.replyTo(),this.bcc()),!0)},function(){return!this.submitRequest()}),this.label=o.computed(function(){return n.i18n("POPUPS_IDENTITIES/"+(this.edit()?"TITLE_UPDATE_IDENTITY":"TITLE_ADD_IDENTITY"))},this),this.button=o.computed(function(){return n.i18n("POPUPS_IDENTITIES/"+(this.edit()?"BUTTON_UPDATE_IDENTITY":"BUTTON_ADD_IDENTITY"))},this),r.constructorEnd(this)}var o=e("../../External/ko.js"),i=e("../../Common/Enums.js"),n=e("../../Common/Utils.js"),r=e("../../Knoin/Knoin.js"),a=e("../../Storages/WebMailAjaxRemoteStorage.js"),l=e("../../Storages/WebMailDataStorage.js"),c=e("../../Knoin/KnoinAbstractViewModel.js");r.extendAsViewModel("PopupsIdentityViewModel",s),s.prototype.clearPopup=function(){this.id="",this.edit(!1),this.owner(!1),this.name(""),this.email(""),this.replyTo(""),this.bcc(""),this.email.hasError(!1),this.replyTo.hasError(!1),this.bcc.hasError(!1),this.submitRequest(!1),this.submitError("")},s.prototype.onShow=function(e){this.clearPopup(),e&&(this.edit(!0),this.id=e.id,this.name(e.name()),this.email(e.email()),this.replyTo(e.replyTo()),this.bcc(e.bcc()),this.owner(this.id===l.accountEmail()))},s.prototype.onFocus=function(){this.owner()||this.email.focused(!0)},t.exports=s}(t)},{"../../Boots/RainLoopApp.js":4,"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailAjaxRemoteStorage.js":72,"../../Storages/WebMailDataStorage.js":74}],94:[function(e,t){!function(t){"use strict";function s(){a.call(this,"Popups","PopupsKeyboardShortcutsHelp"),this.sDefaultKeyScope=n.KeyState.PopupKeyboardShortcutsHelp,r.constructorEnd(this)}var o=e("../../External/underscore.js"),i=e("../../External/key.js"),n=e("../../Common/Enums.js"),r=e("../../Knoin/Knoin.js"),a=e("../../Knoin/KnoinAbstractViewModel.js");r.extendAsViewModel("PopupsKeyboardShortcutsHelpViewModel",s),s.prototype.onBuild=function(e){i("tab, shift+tab, left, right",n.KeyState.PopupKeyboardShortcutsHelp,o.bind(function(t,s){if(t&&s){var o=e.find(".nav.nav-tabs > li"),i=s&&("tab"===s.shortcut||"right"===s.shortcut),n=o.index(o.filter(".active"));return!i&&n>0?n--:i&&n<o.length-1?n++:n=i?0:o.length-1,o.eq(n).find('a[data-toggle="tab"]').tab("show"),!1}},this))},t.exports=s}(t)},{"../../Common/Enums.js":7,"../../External/key.js":27,"../../External/underscore.js":31,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36}],95:[function(e,t){!function(t){"use strict";function s(){l.call(this,"Popups","PopupsLanguages"),this.exp=i.observable(!1),this.languages=i.computed(function(){return o.map(r.languages(),function(e){return{key:e,selected:i.observable(!1),fullName:n.convertLangName(e)}})}),r.mainLanguage.subscribe(function(){this.resetMainLanguage()},this),a.constructorEnd(this)}var o=e("../../External/underscore.js"),i=e("../../External/ko.js"),n=e("../../Common/Utils.js"),r=e("../../Storages/WebMailDataStorage.js"),a=e("../../Knoin/Knoin.js"),l=e("../../Knoin/KnoinAbstractViewModel.js");a.extendAsViewModel("PopupsLanguagesViewModel",s),s.prototype.languageEnName=function(e){return n.convertLangName(e,!0)},s.prototype.resetMainLanguage=function(){var e=r.mainLanguage();o.each(this.languages(),function(t){t.selected(t.key===e)})},s.prototype.onShow=function(){this.exp(!0),this.resetMainLanguage()},s.prototype.onHide=function(){this.exp(!1)},s.prototype.changeLanguage=function(e){r.mainLanguage(e),this.cancelCommand()},t.exports=s}(t)},{"../../Common/Utils.js":14,"../../External/ko.js":28,"../../External/underscore.js":31,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailDataStorage.js":74}],96:[function(e,t){!function(t){"use strict";function s(){l.call(this,"Popups","PopupsTwoFactorTest");var e=this;this.code=o.observable(""),this.code.focused=o.observable(!1),this.code.status=o.observable(null),this.testing=o.observable(!1),this.testCode=n.createCommand(this,function(){this.testing(!0),r.testTwoFactor(function(t,s){e.testing(!1),e.code.status(i.StorageResultType.Success===t&&s&&s.Result?!0:!1)},this.code())},function(){return""!==this.code()&&!this.testing()}),a.constructorEnd(this)}var o=e("../../External/ko.js"),i=e("../../Common/Enums.js"),n=e("../../Common/Utils.js"),r=e("../../Storages/WebMailAjaxRemoteStorage.js"),a=e("../../Knoin/Knoin.js"),l=e("../../Knoin/KnoinAbstractViewModel.js");a.extendAsViewModel("PopupsTwoFactorTestViewModel",s),s.prototype.clearPopup=function(){this.code(""),this.code.focused(!1),this.code.status(null),this.testing(!1)},s.prototype.onShow=function(){this.clearPopup()},s.prototype.onFocus=function(){this.code.focused(!0)},t.exports=s}(t)},{"../../Common/Enums.js":7,"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36,"../../Storages/WebMailAjaxRemoteStorage.js":72}],97:[function(e,t){!function(t){"use strict";function s(){r.call(this,"Popups","PopupsViewOpenPgpKey"),this.key=o.observable(""),this.keyDom=o.observable(null),n.constructorEnd(this)}var o=e("../../External/ko.js"),i=e("../../Common/Utils.js"),n=e("../../Knoin/Knoin.js"),r=e("../../Knoin/KnoinAbstractViewModel.js");n.extendAsViewModel("PopupsViewOpenPgpKeyViewModel",s),s.prototype.clearPopup=function(){this.key("")},s.prototype.selectKey=function(){var e=this.keyDom();e&&i.selectElement(e)},s.prototype.onShow=function(e){this.clearPopup(),e&&this.key(e.armor)},t.exports=s}(t)},{"../../Common/Utils.js":14,"../../External/ko.js":28,"../../Knoin/Knoin.js":33,"../../Knoin/KnoinAbstractViewModel.js":36}],98:[function(e,t){!function(t){"use strict";function s(e){r.call(this,"Left","SettingsMenu"),this.leftPanelDisabled=i.leftPanelDisabled,this.menu=e.menu,n.constructorEnd(this)}var o=e("../Common/LinkBuilder.js"),i=e("../Common/Globals.js"),n=e("../Knoin/Knoin.js"),r=e("../Knoin/KnoinAbstractViewModel.js");n.extendAsViewModel("SettingsMenuViewModel",s),s.prototype.link=function(e){return o.settings(e)},s.prototype.backToMailBoxClick=function(){n.setHash(o.inbox())},t.exports=s}(t)},{"../Common/Globals.js":9,"../Common/LinkBuilder.js":10,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractViewModel.js":36}],99:[function(e,t){!function(t){"use strict";function s(){l.call(this,"Right","SettingsPane"),a.constructorEnd(this)}var o=e("../External/key.js"),i=e("../Common/Enums.js"),n=e("../Common/LinkBuilder.js"),r=e("../Storages/WebMailDataStorage.js"),a=e("../Knoin/Knoin.js"),l=e("../Knoin/KnoinAbstractViewModel.js");a.extendAsViewModel("SettingsPaneViewModel",s),s.prototype.onBuild=function(){var e=this;o("esc",i.KeyState.Settings,function(){e.backToMailBoxClick()})},s.prototype.onShow=function(){r.message(null)},s.prototype.backToMailBoxClick=function(){a.setHash(n.inbox())},t.exports=s}(t)},{"../Common/Enums.js":7,"../Common/LinkBuilder.js":10,"../External/key.js":27,"../Knoin/Knoin.js":33,"../Knoin/KnoinAbstractViewModel.js":36,"../Storages/WebMailDataStorage.js":74}],100:[function(e,t){!function(t){"use strict";function s(){i.call(this),o.constructorEnd(this)}var o=e("../Knoin/Knoin.js"),i=e("./AbstractSystemDropDownViewModel.js");o.extendAsViewModel("SettingsSystemDropDownViewModel",s,i),t.exports=s}(t)},{"../Knoin/Knoin.js":33,"./AbstractSystemDropDownViewModel.js":75}]},{},[1]); |