mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-28 19:49:20 +03:00
5 lines
No EOL
120 KiB
JavaScript
5 lines
No EOL
120 KiB
JavaScript
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
|
||
!function e(t,i,n){function o(a,r){if(!i[a]){if(!t[a]){var l="function"==typeof require&&require;if(!r&&l)return l(a,!0);if(s)return s(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=i[a]={exports:{}};t[a][0].call(u.exports,function(e){var i=t[a][1][e];return o(i?i:e)},u,u.exports,e,t,i,n)}return i[a].exports}for(var s="function"==typeof require&&require,a=0;a<n.length;a++)o(n[a]);return o}({1:[function(e){!function(e){"use strict";e("App:Boot")(e("App:Admin"))}(e)},{"App:Admin":3,"App:Boot":4}],2:[function(e,t){!function(e,t){"use strict";function i(e){p.call(this),this.isLocalAutocomplete=!0,this.iframe=s('<iframe style="display:none" src="javascript:;" />').appendTo("body"),a.$win.on("error",function(t){t&&t.originalEvent&&t.originalEvent.message&&-1===r.inArray(t.originalEvent.message,["Script error.","Uncaught Error: Error calling method on NPObject."])&&e.jsError(r.emptyFunction,t.originalEvent.message,t.originalEvent.filename,t.originalEvent.lineno,n.location&&n.location.toString?n.location.toString():"",a.$html.attr("class"),r.microtime()-a.now)}),a.$doc.on("keydown",function(e){e&&e.ctrlKey&&a.$html.addClass("rl-ctrl-key-pressed")}).on("keyup",function(e){e&&!e.ctrlKey&&a.$html.removeClass("rl-ctrl-key-pressed")})}var n=t("window"),o=t("_"),s=t("$"),a=t("Globals"),r=t("Utils"),l=t("LinkBuilder"),c=t("Events"),u=t("Storage:Settings"),p=t("Knoin:AbstractBoot");o.extend(i.prototype,p.prototype),i.prototype.remote=function(){return null},i.prototype.data=function(){return null},i.prototype.setupSettings=function(){return!0},i.prototype.download=function(e){var t=null,i=null,o=n.navigator.userAgent.toLowerCase();return o&&(o.indexOf("chrome")>-1||o.indexOf("chrome")>-1)&&(i=n.document.createElement("a"),i.href=e,n.document.createEvent&&(t=n.document.createEvent("MouseEvents"),t&&t.initEvent&&i.dispatchEvent))?(t.initEvent("click",!0,!0),i.dispatchEvent(t),!0):(a.bMobileDevice?(n.open(e,"_self"),n.focus()):this.iframe.attr("src",e),!0)},i.prototype.setTitle=function(e){e=(r.isNormal(e)&&0<e.length?e+" - ":"")+u.settingsGet("Title")||"",n.document.title="_",n.document.title=e},i.prototype.loginAndLogoutReload=function(e,i){var s=t("App:Knoin"),a=r.pString(u.settingsGet("CustomLogoutLink")),c=!!u.settingsGet("InIframe");e=r.isUnd(e)?!1:!!e,i=r.isUnd(i)?!1:!!i,e&&i&&n.close&&n.close(),e&&""!==a&&n.location.href!==a?o.delay(function(){c&&n.parent?n.parent.location.href=a:n.location.href=a},100):(s.routeOff(),s.setHash(l.root(),!0),s.routeOff(),o.delay(function(){c&&n.parent?n.parent.location.reload():n.location.reload()},100))},i.prototype.historyBack=function(){n.history.back()},i.prototype.bootstart=function(){c.pub("rl.bootstart");var e=t("ssm");r.initOnStartOrLangChange(function(){r.initNotificationLanguage()},null),o.delay(function(){r.windowResize()},1e3),e.addState({id:"mobile",maxWidth:767,onEnter:function(){a.$html.addClass("ssm-state-mobile"),c.pub("ssm.mobile-enter")},onLeave:function(){a.$html.removeClass("ssm-state-mobile"),c.pub("ssm.mobile-leave")}}),e.addState({id:"tablet",minWidth:768,maxWidth:999,onEnter:function(){a.$html.addClass("ssm-state-tablet")},onLeave:function(){a.$html.removeClass("ssm-state-tablet")}}),e.addState({id:"desktop",minWidth:1e3,maxWidth:1400,onEnter:function(){a.$html.addClass("ssm-state-desktop")},onLeave:function(){a.$html.removeClass("ssm-state-desktop")}}),e.addState({id:"desktop-large",minWidth:1400,onEnter:function(){a.$html.addClass("ssm-state-desktop-large")},onLeave:function(){a.$html.removeClass("ssm-state-desktop-large")}}),c.sub("ssm.mobile-enter",function(){a.leftPanelDisabled(!0)}),c.sub("ssm.mobile-leave",function(){a.leftPanelDisabled(!1)}),a.leftPanelDisabled.subscribe(function(e){a.$html.toggleClass("rl-left-panel-disabled",e)}),e.ready()},e.exports=i}(t,e)},{$:14,"App:Knoin":21,Events:7,Globals:8,"Knoin:AbstractBoot":22,LinkBuilder:9,"Storage:Settings":45,Utils:11,_:19,ssm:18,window:20}],3:[function(e,t){!function(e,t){"use strict";function i(){h.call(this,p)}var n=t("window"),o=t("_"),s=t("ko"),a=t("Enums"),r=t("Utils"),l=t("LinkBuilder"),c=t("Storage:Settings"),u=t("Storage:Admin:Data"),p=t("Storage:Admin:Remote"),d=t("Screen:Admin:Settings"),g=t("Screen:Admin:Login"),m=t("App:Knoin"),h=t("App:Abstract");o.extend(i.prototype,h.prototype),i.prototype.remote=function(){return p},i.prototype.data=function(){return u},i.prototype.setupSettings=function(){return m.addSettingsViewModel(t("Settings:Admin:General"),"AdminSettingsGeneral","General","general",!0),m.addSettingsViewModel(t("Settings:Admin:Login"),"AdminSettingsLogin","Login","login"),c.capa(a.Capa.Prem)&&m.addSettingsViewModel(t("Settings:Admin:Branding"),"AdminSettingsBranding","Branding","branding"),m.addSettingsViewModel(t("Settings:Admin:Contacts"),"AdminSettingsContacts","Contacts","contacts"),m.addSettingsViewModel(t("Settings:Admin:Domains"),"AdminSettingsDomains","Domains","domains"),m.addSettingsViewModel(t("Settings:Admin:Security"),"AdminSettingsSecurity","Security","security"),m.addSettingsViewModel(t("Settings:Admin:Social"),"AdminSettingsSocial","Social","social"),m.addSettingsViewModel(t("Settings:Admin:Plugins"),"AdminSettingsPlugins","Plugins","plugins"),m.addSettingsViewModel(t("Settings:Admin:Packages"),"AdminSettingsPackages","Packages","packages"),m.addSettingsViewModel(t("Settings:Admin:Licensing"),"AdminSettingsLicensing","Licensing","licensing"),m.addSettingsViewModel(t("Settings:Admin:About"),"AdminSettingsAbout","About","about"),!0},i.prototype.reloadDomainList=function(){u.domainsLoading(!0),p.domainList(function(e,t){if(u.domainsLoading(!1),a.StorageResultType.Success===e&&t&&t.Result){var i=o.map(t.Result,function(e,t){return{name:t,disabled:s.observable(!e),deleteAccess:s.observable(!1)}},this);u.domains(i)}})},i.prototype.reloadPluginList=function(){u.pluginsLoading(!0),p.pluginList(function(e,t){if(u.pluginsLoading(!1),a.StorageResultType.Success===e&&t&&t.Result){var i=o.map(t.Result,function(e){return{name:e.Name,disabled:s.observable(!e.Enabled),configured:s.observable(!!e.Configured)}},this);u.plugins(i)}})},i.prototype.reloadPackagesList=function(){u.packagesLoading(!0),u.packagesReal(!0),p.packagesList(function(e,t){if(u.packagesLoading(!1),a.StorageResultType.Success===e&&t&&t.Result){u.packagesReal(!!t.Result.Real),u.packagesMainUpdatable(!!t.Result.MainUpdatable);var i=[],n={};o.each(u.packages(),function(e){e&&e.loading()&&(n[e.file]=e)}),r.isArray(t.Result.List)&&(i=o.compact(o.map(t.Result.List,function(e){return e?(e.loading=s.observable(!r.isUnd(n[e.file])),"core"!==e.type||e.canBeInstalled?e:null):null}))),u.packages(i)}else u.packagesReal(!1)})},i.prototype.updateCoreData=function(){u.coreUpdating(!0),p.updateCoreData(function(e,t){u.coreUpdating(!1),u.coreRemoteVersion(""),u.coreRemoteRelease(""),u.coreVersionCompare(-2),a.StorageResultType.Success===e&&t&&t.Result?(u.coreReal(!0),n.location.reload()):u.coreReal(!1)})},i.prototype.reloadCoreData=function(){u.coreChecking(!0),u.coreReal(!0),p.coreData(function(e,t){u.coreChecking(!1),a.StorageResultType.Success===e&&t&&t.Result?(u.coreReal(!!t.Result.Real),u.coreUpdatable(!!t.Result.Updatable),u.coreAccess(!!t.Result.Access),u.coreRemoteVersion(t.Result.RemoteVersion||""),u.coreRemoteRelease(t.Result.RemoteRelease||""),u.coreVersionCompare(r.pInt(t.Result.VersionCompare))):(u.coreReal(!1),u.coreRemoteVersion(""),u.coreRemoteRelease(""),u.coreVersionCompare(-2))})},i.prototype.reloadLicensing=function(e){e=r.isUnd(e)?!1:!!e,u.licensingProcess(!0),u.licenseError(""),p.licensing(function(e,t){u.licensingProcess(!1),a.StorageResultType.Success===e&&t&&t.Result&&r.isNormal(t.Result.Expired)?(u.licenseValid(!0),u.licenseExpired(r.pInt(t.Result.Expired)),u.licenseError(""),u.licensing(!0)):t&&t.ErrorCode&&-1<r.inArray(r.pInt(t.ErrorCode),[a.Notification.LicensingServerIsUnavailable,a.Notification.LicensingExpired])?(u.licenseError(r.getNotification(r.pInt(t.ErrorCode))),u.licensing(!0)):a.StorageResultType.Abort===e?(u.licenseError(r.getNotification(a.Notification.LicensingServerIsUnavailable)),u.licensing(!0)):u.licensing(!1)},e)},i.prototype.bootstart=function(){h.prototype.bootstart.call(this),u.populateDataOnStart(),m.hideLoading(),c.settingsGet("AllowAdminPanel")?m.startScreens(c.settingsGet("Auth")?[d]:[g]):(m.routeOff(),m.setHash(l.root(),!0),m.routeOff(),o.defer(function(){n.location.href="/"})),n.SimplePace&&n.SimplePace.set(100)},e.exports=new i}(t,e)},{"App:Abstract":2,"App:Knoin":21,Enums:6,LinkBuilder:9,"Screen:Admin:Login":28,"Screen:Admin:Settings":29,"Settings:Admin:About":30,"Settings:Admin:Branding":31,"Settings:Admin:Contacts":32,"Settings:Admin:Domains":33,"Settings:Admin:General":34,"Settings:Admin:Licensing":35,"Settings:Admin:Login":36,"Settings:Admin:Packages":37,"Settings:Admin:Plugins":38,"Settings:Admin:Security":39,"Settings:Admin:Social":40,"Storage:Admin:Data":43,"Storage:Admin:Remote":44,"Storage:Settings":45,Utils:11,_:19,ko:16,window:20}],4:[function(e,t){!function(e,t){"use strict";e.exports=function(e){var i=t("window"),n=t("_"),o=t("$"),s=t("Globals"),a=t("Plugins"),r=t("Utils"),l=t("Enums"),c=t("Model:Email");s.__APP=e,e.setupSettings(),a.__boot=e,a.__remote=e.remote(),a.__data=e.data(),s.$html.addClass(s.bMobileDevice?"mobile":"no-mobile"),s.$win.keydown(r.killCtrlAandS).keyup(r.killCtrlAandS),s.$win.unload(function(){s.bUnload=!0}),s.$html.on("click.dropdown.data-api",function(){r.detectDropdownVisibility()}),i.rl=i.rl||{},i.rl.addHook=n.bind(a.addHook,a),i.rl.settingsGet=n.bind(a.mainSettingsGet,a),i.rl.remoteRequest=n.bind(a.remoteRequest,a),i.rl.pluginSettingsGet=n.bind(a.settingsGet,a),i.rl.createCommand=r.createCommand,i.rl.EmailModel=c,i.rl.Enums=l,i.__APP_BOOT=function(t){o(function(){i.rainloopTEMPLATES&&i.rainloopTEMPLATES[0]?(o("#rl-templates").html(i.rainloopTEMPLATES[0]),n.delay(function(){e.bootstart(),s.$html.removeClass("no-js rl-booted-trigger").addClass("rl-booted")},10)):t(!1),i.__APP_BOOT=null})}}}(t,e)},{$:14,Enums:6,Globals:8,"Model:Email":26,Plugins:10,Utils:11,_:19,window:20}],5:[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)},{}],6:[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.SaveSettingsStep={Animate:-2,Idle:-1,TrueResult:1,FalseResult:0},t.InterfaceAnimation={None:"None",Normal:"Normal",Full:"Full"},t.Layout={NoPreview:0,SidePreview:1,BottomPreview:2},t.FilterConditionField={From:"From",To:"To",Recipient:"Recipient",Subject:"Subject"},t.FilterConditionType={Contains:"Contains",NotContains:"NotContains",EqualTo:"EqualTo",NotEqualTo:"NotEqualTo"},t.FiltersAction={None:"None",Move:"Move",Discard:"Discard",Forward:"Forward"},t.FilterRulesType={And:"And",Or:"Or"},t.SignedVerifyStatus={UnknownPublicKeys:-4,UnknownPrivateKey:-3,Unverified:-2,Error:-1,None:0,Success:1},t.ContactPropertyType={Unknown:0,FullName:10,FirstName:15,LastName:16,MiddleName:16,Nick:18,NamePrefix:20,NameSuffix:21,Email:30,Phone:31,Web:32,Birthday:40,Facebook:90,Skype:91,GitHub:92,Note:110,Custom:250},t.Notification={InvalidToken:101,AuthError:102,AccessError:103,ConnectionError:104,CaptchaError:105,SocialFacebookLoginAccessDisable:106,SocialTwitterLoginAccessDisable:107,SocialGoogleLoginAccessDisable:108,DomainNotAllowed:109,AccountNotAllowed:110,AccountTwoFactorAuthRequired:120,AccountTwoFactorAuthError:121,CouldNotSaveNewPassword:130,CurrentPasswordIncorrect:131,NewPasswordShort:132,NewPasswordWeak:133,NewPasswordForbidden:134,ContactsSyncError:140,CantGetMessageList:201,CantGetMessage:202,CantDeleteMessage:203,CantMoveMessage:204,CantCopyMessage:205,CantSaveMessage:301,CantSendMessage:302,InvalidRecipients:303,CantCreateFolder:400,CantRenameFolder:401,CantDeleteFolder:402,CantSubscribeFolder:403,CantUnsubscribeFolder:404,CantDeleteNonEmptyFolder:405,CantSaveSettings:501,CantSavePluginSettings:502,DomainAlreadyExists:601,CantInstallPackage:701,CantDeletePackage:702,InvalidPluginPackage:703,UnsupportedPluginPackage:704,LicensingServerIsUnavailable:710,LicensingExpired:711,LicensingBanned:712,DemoSendMessageError:750,AccountAlreadyExists:801,MailServerError:901,ClientViewError:902,InvalidInputArgument:903,UnknownNotification:999,UnknownError:999},e.exports=t}(t,e)},{}],7:[function(e,t){!function(e,t){"use strict";function i(){this.oSubs={}}var n=t("_"),o=t("Utils"),s=t("Plugins");i.prototype.oSubs={},i.prototype.sub=function(e,t,i){return o.isUnd(this.oSubs[e])&&(this.oSubs[e]=[]),this.oSubs[e].push([t,i]),this},i.prototype.pub=function(e,t){return s.runHook("rl-pub",[e,t]),o.isUnd(this.oSubs[e])||n.each(this.oSubs[e],function(e){e[0]&&e[0].apply(e[1]||null,t||[])}),this},e.exports=new i}(t,e)},{Plugins:10,Utils:11,_:19}],8:[function(e,t){!function(e,t){"use strict";var i={},n=t("window"),o=t("_"),s=t("$"),a=t("ko"),r=t("key"),l=t("Enums");i.$win=s(n),i.$doc=s(n.document),i.$html=s("html"),i.$div=s("<div></div>"),i.now=(new n.Date).getTime(),i.momentTrigger=a.observable(!0),i.dropdownVisibility=a.observable(!1).extend({rateLimit:0}),i.tooltipTrigger=a.observable(!1).extend({rateLimit:0}),i.langChangeTrigger=a.observable(!0),i.useKeyboardShortcuts=a.observable(!0),i.iAjaxErrorCount=0,i.iTokenErrorCount=0,i.iMessageBodyCacheCount=0,i.bUnload=!1,i.sUserAgent=(n.navigator.userAgent||"").toLowerCase(),i.bIsiOSDevice=-1<i.sUserAgent.indexOf("iphone")||-1<i.sUserAgent.indexOf("ipod")||-1<i.sUserAgent.indexOf("ipad"),i.bIsAndroidDevice=-1<i.sUserAgent.indexOf("android"),i.bMobileDevice=i.bIsiOSDevice||i.bIsAndroidDevice,i.bDisableNanoScroll=i.bMobileDevice,i.bAllowPdfPreview=!i.bMobileDevice,i.bAnimationSupported=!i.bMobileDevice&&i.$html.hasClass("csstransitions"),i.bXMLHttpRequestSupported=!!n.XMLHttpRequest,i.sAnimationType="",i.__APP=null,i.oHtmlEditorDefaultConfig={title:!1,stylesSet:!1,customConfig:"",contentsCss:"",toolbarGroups:[{name:"spec"},{name:"styles"},{name:"basicstyles",groups:["basicstyles","cleanup"]},{name:"colors"},{name:"paragraph",groups:["list","indent","blocks","align"]},{name:"links"},{name:"insert"},{name:"others"}],removePlugins:"contextmenu",removeButtons:"Format,Undo,Redo,Cut,Copy,Paste,Anchor,Strike,Subscript,Superscript,Image,SelectAll",removeDialogTabs:"link:advanced;link:target;image:advanced;images:advanced",extraPlugins:"plain",allowedContent:!0,autoParagraph:!1,font_defaultLabel:"Arial",fontSize_defaultLabel:"13",fontSize_sizes:"10/10px;12/12px;13/13px;14/14px;16/16px;18/18px;20/20px;24/24px;28/28px;36/36px;48/48px"},i.oHtmlEditorLangsMap={de:"de",es:"es",fr:"fr",hu:"hu",is:"is",it:"it",ja:"ja","ja-jp":"ja",ko:"ko","ko-kr":"ko",lv:"lv",nl:"nl",no:"no",pl:"pl",pt:"pt","pt-pt":"pt","pt-br":"pt-br",ro:"ro",ru:"ru",sk:"sk",tr:"tr",ua:"ru",zh:"zh","zh-cn":"zh-cn"},i.bAllowPdfPreview&&n.navigator&&n.navigator.mimeTypes&&(i.bAllowPdfPreview=!!o.find(n.navigator.mimeTypes,function(e){return e&&"application/pdf"===e.type})),i.oI18N=n.rainloopI18N||{},i.oNotificationI18N={},i.aBootstrapDropdowns=[],i.aViewModels={settings:[],"settings-removed":[],"settings-disabled":[]},i.leftPanelDisabled=a.observable(!1),i.popupVisibilityNames=a.observableArray([]),i.popupVisibility=a.computed(function(){return 0<i.popupVisibilityNames().length},this),i.keyScopeReal=a.observable(l.KeyState.All),i.keyScopeFake=a.observable(l.KeyState.All),i.keyScope=a.computed({owner:this,read:function(){return i.keyScopeFake()},write:function(e){l.KeyState.Menu!==e&&(r.filter=l.KeyState.Compose===e?function(){return i.useKeyboardShortcuts()}:function(e){if(i.useKeyboardShortcuts()){var t=e.target||e.srcElement,n=t?t.tagName:"";return n=n.toUpperCase(),!("INPUT"===n||"SELECT"===n||"TEXTAREA"===n||t&&"DIV"===n&&"editorHtmlArea"===t.className&&t.contentEditable)}return!1},i.keyScopeFake(e),i.dropdownVisibility()&&(e=l.KeyState.Menu)),i.keyScopeReal(e)}}),i.keyScopeReal.subscribe(function(e){r.setScope(e)}),i.dropdownVisibility.subscribe(function(e){e?(i.tooltipTrigger(!i.tooltipTrigger()),i.keyScope(l.KeyState.Menu)):l.KeyState.Menu===r.getScope()&&i.keyScope(i.keyScopeFake())}),e.exports=i}(t,e)},{$:14,Enums:6,_:19,key:15,ko:16,window:20}],9:[function(e,t){!function(e,t){"use strict";function i(){var e=t("Storage:Settings");this.sBase="#/",this.sServer="./?",this.sVersion=e.settingsGet("Version"),this.sSpecSuffix=e.settingsGet("AuthAccountHash")||"0",this.sStaticPrefix=e.settingsGet("StaticPrefix")||"rainloop/v/"+this.sVersion+"/static/"}var n=t("window"),o=t("Utils");i.prototype.root=function(){return this.sBase},i.prototype.attachmentDownload=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/Download/"+e},i.prototype.attachmentPreview=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/View/"+e},i.prototype.attachmentPreviewAsPlain=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ViewAsPlain/"+e},i.prototype.upload=function(){return this.sServer+"/Upload/"+this.sSpecSuffix+"/"},i.prototype.uploadContacts=function(){return this.sServer+"/UploadContacts/"+this.sSpecSuffix+"/"},i.prototype.uploadBackground=function(){return this.sServer+"/UploadBackground/"+this.sSpecSuffix+"/"},i.prototype.append=function(){return this.sServer+"/Append/"+this.sSpecSuffix+"/"},i.prototype.change=function(e){return this.sServer+"/Change/"+this.sSpecSuffix+"/"+n.encodeURIComponent(e)+"/"},i.prototype.ajax=function(e){return this.sServer+"/Ajax/"+this.sSpecSuffix+"/"+e},i.prototype.messageViewLink=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ViewAsPlain/"+e},i.prototype.messageDownloadLink=function(e){return this.sServer+"/Raw/"+this.sSpecSuffix+"/Download/"+e},i.prototype.avatarLink=function(e){return this.sServer+"/Raw/0/Avatar/"+n.encodeURIComponent(e)+"/"},i.prototype.inbox=function(){return this.sBase+"mailbox/Inbox"},i.prototype.messagePreview=function(){return this.sBase+"mailbox/message-preview"},i.prototype.settings=function(e){var t=this.sBase+"settings";return o.isUnd(e)||""===e||(t+="/"+e),t},i.prototype.about=function(){return this.sBase+"about"},i.prototype.admin=function(e){var t=this.sBase;switch(e){case"AdminDomains":t+="domains";break;case"AdminSecurity":t+="security";break;case"AdminLicensing":t+="licensing"}return t},i.prototype.mailBox=function(e,t,i){t=o.isNormal(t)?o.pInt(t):1,i=o.pString(i);var n=this.sBase+"mailbox/";return""!==e&&(n+=encodeURI(e)),t>1&&(n=n.replace(/[\/]+$/,""),n+="/p"+t),""!==i&&(n=n.replace(/[\/]+$/,""),n+="/"+encodeURI(i)),n},i.prototype.phpInfo=function(){return this.sServer+"Info"},i.prototype.langLink=function(e){return this.sServer+"/Lang/0/"+encodeURI(e)+"/"+this.sVersion+"/"},i.prototype.exportContactsVcf=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsVcf/"},i.prototype.exportContactsCsv=function(){return this.sServer+"/Raw/"+this.sSpecSuffix+"/ContactsCsv/"},i.prototype.emptyContactPic=function(){return this.sStaticPrefix+"css/images/empty-contact.png"},i.prototype.sound=function(e){return this.sStaticPrefix+"sounds/"+e},i.prototype.themePreviewLink=function(e){var t="rainloop/v/"+this.sVersion+"/";return"@custom"===e.substr(-7)&&(e=o.trim(e.substring(0,e.length-7)),t=""),t+"themes/"+encodeURI(e)+"/images/preview.png"},i.prototype.notificationMailIcon=function(){return this.sStaticPrefix+"css/images/icom-message-notification.png"},i.prototype.openPgpJs=function(){return this.sStaticPrefix+"js/openpgp.min.js"},i.prototype.socialGoogle=function(){return this.sServer+"SocialGoogle"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},i.prototype.socialTwitter=function(){return this.sServer+"SocialTwitter"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},i.prototype.socialFacebook=function(){return this.sServer+"SocialFacebook"+(""!==this.sSpecSuffix?"/"+this.sSpecSuffix+"/":"")},e.exports=new i}(t,e)},{"Storage:Settings":45,Utils:11,window:20}],10:[function(e,t){!function(e,t){"use strict";function i(){this.__boot=null,this.__data=null,this.__remote=null,this.oSettings=t("Storage:Settings"),this.oViewModelsHooks={},this.oSimpleHooks={}}var n=t("_"),o=t("Utils");i.prototype.__boot=null,i.prototype.__data=null,i.prototype.__remote=null,i.prototype.oViewModelsHooks={},i.prototype.oSimpleHooks={},i.prototype.addHook=function(e,t){o.isFunc(t)&&(o.isArray(this.oSimpleHooks[e])||(this.oSimpleHooks[e]=[]),this.oSimpleHooks[e].push(t))},i.prototype.runHook=function(e,t){o.isArray(this.oSimpleHooks[e])&&(t=t||[],n.each(this.oSimpleHooks[e],function(e){e.apply(null,t)}))},i.prototype.mainSettingsGet=function(e){return this.oSettings.settingsGet(e)},i.prototype.remoteRequest=function(e,t,i,n,o,s){this.__remote&&this.__remote.defaultRequest(e,t,i,n,o,s)},i.prototype.settingsGet=function(e,t){var i=this.oSettings.settingsGet("Plugins");return i=i&&!o.isUnd(i[e])?i[e]:null,i?o.isUnd(i[t])?null:i[t]:null},e.exports=new i}(t,e)},{"Storage:Settings":45,Utils:11,_:19}],11:[function(e,t){!function(e,t){"use strict";var i={},n=t("window"),o=t("_"),s=t("$"),a=t("ko"),r=t("Enums"),l=t("Consts"),c=t("Globals");i.trim=s.trim,i.inArray=s.inArray,i.isArray=o.isArray,i.isFunc=o.isFunction,i.isUnd=o.isUndefined,i.isNull=o.isNull,i.emptyFunction=function(){},i.isNormal=function(e){return!i.isUnd(e)&&!i.isNull(e)},i.windowResize=o.debounce(function(e){i.isUnd(e)?c.$win.resize():n.setTimeout(function(){c.$win.resize()},e)},50),i.isPosNumeric=function(e,t){return i.isNormal(e)?(i.isUnd(t)?0:!t)?/^[1-9]+[0-9]*$/.test(e.toString()):/^[0-9]*$/.test(e.toString()):!1},i.pInt=function(e,t){var o=i.isNormal(e)&&""!==e?n.parseInt(e,10):t||0;return n.isNaN(o)?t||0:o},i.pString=function(e){return i.isNormal(e)?""+e:""},i.isNonEmptyArray=function(e){return i.isArray(e)&&0<e.length},i.notificationClass=function(){return n.Notification&&n.Notification.requestPermission?n.Notification:null},i.simpleQueryParser=function(e){var t={},i=[],o=[],s=0,a=0;for(i=e.split("&"),s=0,a=i.length;a>s;s++)o=i[s].split("="),t[n.decodeURIComponent(o[0])]=n.decodeURIComponent(o[1]);return t},i.mailToHelper=function(e,o){if(e&&"mailto:"===e.toString().substr(0,7).toLowerCase()){e=e.toString().substr(7);var s={},a=null,l=e.replace(/\?.+$/,""),c=e.replace(/^[^\?]*\?/,""),u=t("Model:Email");return a=new u,a.parse(n.decodeURIComponent(l)),a&&a.email&&(s=i.simpleQueryParser(c),t("App:Knoin").showScreenPopup(o,[r.ComposeType.Empty,null,[a],i.isUnd(s.subject)?null:i.pString(s.subject),i.isUnd(s.body)?null:i.plainToHtml(i.pString(s.body))])),!0}return!1},i.rsaEncode=function(e,t,o,s){if(n.crypto&&n.crypto.getRandomValues&&n.RSAKey&&t&&o&&s){var a=new n.RSAKey;if(a.setPublic(s,o),e=a.encrypt(i.fakeMd5()+":"+e+":"+i.fakeMd5()),!1!==e)return"rsa:"+t+":"+e}return!1},i.rsaEncode.supported=!!(n.crypto&&n.crypto.getRandomValues&&n.RSAKey),i.exportPath=function(e,t,o){for(var s=null,a=e.split("."),r=o||n;a.length&&(s=a.shift());)a.length||i.isUnd(t)?r=r[s]?r[s]:r[s]={}:r[s]=t},i.pImport=function(e,t,i){e[t]=i},i.pExport=function(e,t,n){return i.isUnd(e[t])?n:e[t]},i.encodeHtml=function(e){return i.isNormal(e)?e.toString().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):""},i.splitPlainText=function(e,t){var n="",o="",s=e,a=0,r=0;for(t=i.isUnd(t)?100:t;s.length>t;)o=s.substring(0,t),a=o.lastIndexOf(" "),r=o.lastIndexOf("\n"),-1!==r&&(a=r),-1===a&&(a=t),n+=o.substring(0,a)+"\n",s=s.substring(a+1);return n+s},i.timeOutAction=function(){var e={};return function(t,o,s){i.isUnd(e[t])&&(e[t]=0),n.clearTimeout(e[t]),e[t]=n.setTimeout(o,s)}}(),i.timeOutActionSecond=function(){var e={};return function(t,i,o){e[t]||(e[t]=n.setTimeout(function(){i(),e[t]=0},o))}}(),i.audio=function(){var e=!1;return function(t,i){if(!1===e)if(c.bIsiOSDevice)e=null;else{var o=!1,s=!1,a=n.Audio?new n.Audio:null;a&&a.canPlayType&&a.play?(o=""!==a.canPlayType('audio/mpeg; codecs="mp3"'),o||(s=""!==a.canPlayType('audio/ogg; codecs="vorbis"')),o||s?(e=a,e.preload="none",e.loop=!1,e.autoplay=!1,e.muted=!1,e.src=o?t:i):e=null):e=null}return e}}(),i.hos=function(e,t){return e&&n.Object&&n.Object.hasOwnProperty?n.Object.hasOwnProperty.call(e,t):!1},i.i18n=function(e,t,n){var o="",s=i.isUnd(c.oI18N[e])?i.isUnd(n)?e:n:c.oI18N[e];if(!i.isUnd(t)&&!i.isNull(t))for(o in t)i.hos(t,o)&&(s=s.replace("%"+o+"%",t[o]));return s},i.i18nToNode=function(e){o.defer(function(){s(".i18n",e).each(function(){var e=s(this),t="";t=e.data("i18n-text"),t?e.text(i.i18n(t)):(t=e.data("i18n-html"),t&&e.html(i.i18n(t)),t=e.data("i18n-placeholder"),t&&e.attr("placeholder",i.i18n(t)),t=e.data("i18n-title"),t&&e.attr("title",i.i18n(t)))})})},i.i18nReload=function(){n.rainloopI18N&&(c.oI18N=n.rainloopI18N||{},i.i18nToNode(c.$doc),c.langChangeTrigger(!c.langChangeTrigger())),n.rainloopI18N=null},i.initOnStartOrLangChange=function(e,t,i){e&&e.call(t),i?c.langChangeTrigger.subscribe(function(){e&&e.call(t),i.call(t)}):e&&c.langChangeTrigger.subscribe(e,t)},i.inFocus=function(){return n.document.activeElement?(i.isUnd(n.document.activeElement.__inFocusCache)&&(n.document.activeElement.__inFocusCache=s(n.document.activeElement).is("input,textarea,iframe,.cke_editable")),!!n.document.activeElement.__inFocusCache):!1},i.removeInFocus=function(){if(n.document&&n.document.activeElement&&n.document.activeElement.blur){var e=s(n.document.activeElement);e.is("input,textarea")&&n.document.activeElement.blur()}},i.removeSelection=function(){if(n&&n.getSelection){var e=n.getSelection();e&&e.removeAllRanges&&e.removeAllRanges()}else n.document&&n.document.selection&&n.document.selection.empty&&n.document.selection.empty()},i.replySubjectAdd=function(e,t){e=i.trim(e.toUpperCase()),t=i.trim(t.replace(/[\s]+/g," "));var n=!1,s=[],a="RE"===e,r="FWD"===e,l=!r;return""!==t&&o.each(t.split(":"),function(e){var t=i.trim(e);n||!/^(RE|FWD)$/i.test(t)&&!/^(RE|FWD)[\[\(][\d]+[\]\)]$/i.test(t)?(s.push(e),n=!0):(a||(a=!!/^RE/i.test(t)),r||(r=!!/^FWD/i.test(t)))}),l?a=!1:r=!1,i.trim((l?"Re: ":"Fwd: ")+(a?"Re: ":"")+(r?"Fwd: ":"")+i.trim(s.join(":")))},i.roundNumber=function(e,t){return n.Math.round(e*n.Math.pow(10,t))/n.Math.pow(10,t)},i.friendlySize=function(e){return e=i.pInt(e),e>=1073741824?i.roundNumber(e/1073741824,1)+"GB":e>=1048576?i.roundNumber(e/1048576,1)+"MB":e>=1024?i.roundNumber(e/1024,0)+"KB":e+"B"},i.log=function(e){n.console&&n.console.log&&n.console.log(e)},i.getNotification=function(e,t){return e=i.pInt(e),r.Notification.ClientViewError===e&&t?t:i.isUnd(c.oNotificationI18N[e])?"":c.oNotificationI18N[e]},i.initNotificationLanguage=function(){var e=c.oNotificationI18N||{};e[r.Notification.InvalidToken]=i.i18n("NOTIFICATIONS/INVALID_TOKEN"),e[r.Notification.AuthError]=i.i18n("NOTIFICATIONS/AUTH_ERROR"),e[r.Notification.AccessError]=i.i18n("NOTIFICATIONS/ACCESS_ERROR"),e[r.Notification.ConnectionError]=i.i18n("NOTIFICATIONS/CONNECTION_ERROR"),e[r.Notification.CaptchaError]=i.i18n("NOTIFICATIONS/CAPTCHA_ERROR"),e[r.Notification.SocialFacebookLoginAccessDisable]=i.i18n("NOTIFICATIONS/SOCIAL_FACEBOOK_LOGIN_ACCESS_DISABLE"),e[r.Notification.SocialTwitterLoginAccessDisable]=i.i18n("NOTIFICATIONS/SOCIAL_TWITTER_LOGIN_ACCESS_DISABLE"),e[r.Notification.SocialGoogleLoginAccessDisable]=i.i18n("NOTIFICATIONS/SOCIAL_GOOGLE_LOGIN_ACCESS_DISABLE"),e[r.Notification.DomainNotAllowed]=i.i18n("NOTIFICATIONS/DOMAIN_NOT_ALLOWED"),e[r.Notification.AccountNotAllowed]=i.i18n("NOTIFICATIONS/ACCOUNT_NOT_ALLOWED"),e[r.Notification.AccountTwoFactorAuthRequired]=i.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_REQUIRED"),e[r.Notification.AccountTwoFactorAuthError]=i.i18n("NOTIFICATIONS/ACCOUNT_TWO_FACTOR_AUTH_ERROR"),e[r.Notification.CouldNotSaveNewPassword]=i.i18n("NOTIFICATIONS/COULD_NOT_SAVE_NEW_PASSWORD"),e[r.Notification.CurrentPasswordIncorrect]=i.i18n("NOTIFICATIONS/CURRENT_PASSWORD_INCORRECT"),e[r.Notification.NewPasswordShort]=i.i18n("NOTIFICATIONS/NEW_PASSWORD_SHORT"),e[r.Notification.NewPasswordWeak]=i.i18n("NOTIFICATIONS/NEW_PASSWORD_WEAK"),e[r.Notification.NewPasswordForbidden]=i.i18n("NOTIFICATIONS/NEW_PASSWORD_FORBIDDENT"),e[r.Notification.ContactsSyncError]=i.i18n("NOTIFICATIONS/CONTACTS_SYNC_ERROR"),e[r.Notification.CantGetMessageList]=i.i18n("NOTIFICATIONS/CANT_GET_MESSAGE_LIST"),e[r.Notification.CantGetMessage]=i.i18n("NOTIFICATIONS/CANT_GET_MESSAGE"),e[r.Notification.CantDeleteMessage]=i.i18n("NOTIFICATIONS/CANT_DELETE_MESSAGE"),e[r.Notification.CantMoveMessage]=i.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),e[r.Notification.CantCopyMessage]=i.i18n("NOTIFICATIONS/CANT_MOVE_MESSAGE"),e[r.Notification.CantSaveMessage]=i.i18n("NOTIFICATIONS/CANT_SAVE_MESSAGE"),e[r.Notification.CantSendMessage]=i.i18n("NOTIFICATIONS/CANT_SEND_MESSAGE"),e[r.Notification.InvalidRecipients]=i.i18n("NOTIFICATIONS/INVALID_RECIPIENTS"),e[r.Notification.CantCreateFolder]=i.i18n("NOTIFICATIONS/CANT_CREATE_FOLDER"),e[r.Notification.CantRenameFolder]=i.i18n("NOTIFICATIONS/CANT_RENAME_FOLDER"),e[r.Notification.CantDeleteFolder]=i.i18n("NOTIFICATIONS/CANT_DELETE_FOLDER"),e[r.Notification.CantDeleteNonEmptyFolder]=i.i18n("NOTIFICATIONS/CANT_DELETE_NON_EMPTY_FOLDER"),e[r.Notification.CantSubscribeFolder]=i.i18n("NOTIFICATIONS/CANT_SUBSCRIBE_FOLDER"),e[r.Notification.CantUnsubscribeFolder]=i.i18n("NOTIFICATIONS/CANT_UNSUBSCRIBE_FOLDER"),e[r.Notification.CantSaveSettings]=i.i18n("NOTIFICATIONS/CANT_SAVE_SETTINGS"),e[r.Notification.CantSavePluginSettings]=i.i18n("NOTIFICATIONS/CANT_SAVE_PLUGIN_SETTINGS"),e[r.Notification.DomainAlreadyExists]=i.i18n("NOTIFICATIONS/DOMAIN_ALREADY_EXISTS"),e[r.Notification.CantInstallPackage]=i.i18n("NOTIFICATIONS/CANT_INSTALL_PACKAGE"),e[r.Notification.CantDeletePackage]=i.i18n("NOTIFICATIONS/CANT_DELETE_PACKAGE"),e[r.Notification.InvalidPluginPackage]=i.i18n("NOTIFICATIONS/INVALID_PLUGIN_PACKAGE"),e[r.Notification.UnsupportedPluginPackage]=i.i18n("NOTIFICATIONS/UNSUPPORTED_PLUGIN_PACKAGE"),e[r.Notification.LicensingServerIsUnavailable]=i.i18n("NOTIFICATIONS/LICENSING_SERVER_IS_UNAVAILABLE"),e[r.Notification.LicensingExpired]=i.i18n("NOTIFICATIONS/LICENSING_EXPIRED"),e[r.Notification.LicensingBanned]=i.i18n("NOTIFICATIONS/LICENSING_BANNED"),e[r.Notification.DemoSendMessageError]=i.i18n("NOTIFICATIONS/DEMO_SEND_MESSAGE_ERROR"),e[r.Notification.AccountAlreadyExists]=i.i18n("NOTIFICATIONS/ACCOUNT_ALREADY_EXISTS"),e[r.Notification.MailServerError]=i.i18n("NOTIFICATIONS/MAIL_SERVER_ERROR"),e[r.Notification.InvalidInputArgument]=i.i18n("NOTIFICATIONS/INVALID_INPUT_ARGUMENT"),e[r.Notification.UnknownNotification]=i.i18n("NOTIFICATIONS/UNKNOWN_ERROR"),e[r.Notification.UnknownError]=i.i18n("NOTIFICATIONS/UNKNOWN_ERROR")
|
||
},i.getUploadErrorDescByCode=function(e){var t="";switch(i.pInt(e)){case r.UploadErrorCode.FileIsTooBig:t=i.i18n("UPLOAD/ERROR_FILE_IS_TOO_BIG");break;case r.UploadErrorCode.FilePartiallyUploaded:t=i.i18n("UPLOAD/ERROR_FILE_PARTIALLY_UPLOADED");break;case r.UploadErrorCode.FileNoUploaded:t=i.i18n("UPLOAD/ERROR_NO_FILE_UPLOADED");break;case r.UploadErrorCode.MissingTempFolder:t=i.i18n("UPLOAD/ERROR_MISSING_TEMP_FOLDER");break;case r.UploadErrorCode.FileOnSaveingError:t=i.i18n("UPLOAD/ERROR_ON_SAVING_FILE");break;case r.UploadErrorCode.FileType:t=i.i18n("UPLOAD/ERROR_FILE_TYPE");break;default:t=i.i18n("UPLOAD/ERROR_UNKNOWN")}return t},i.delegateRun=function(e,t,n,s){e&&e[t]&&(s=i.pInt(s),0>=s?e[t].apply(e,i.isArray(n)?n:[]):o.delay(function(){e[t].apply(e,i.isArray(n)?n:[])},s))},i.killCtrlAandS=function(e){if(e=e||n.event,e&&e.ctrlKey&&!e.shiftKey&&!e.altKey){var t=e.target||e.srcElement,i=e.keyCode||e.which;if(i===r.EventKeyCode.S)return void e.preventDefault();if(t&&t.tagName&&t.tagName.match(/INPUT|TEXTAREA/i))return;i===r.EventKeyCode.A&&(n.getSelection?n.getSelection().removeAllRanges():n.document.selection&&n.document.selection.clear&&n.document.selection.clear(),e.preventDefault())}},i.createCommand=function(e,t,n){var o=t?function(){return o&&o.canExecute&&o.canExecute()&&t.apply(e,Array.prototype.slice.call(arguments)),!1}:function(){};return o.enabled=a.observable(!0),n=i.isUnd(n)?!0:n,o.canExecute=a.computed(i.isFunc(n)?function(){return o.enabled()&&n.call(e)}:function(){return o.enabled()&&!!n}),o},i.initDataConstructorBySettings=function(e){e.editorDefaultType=a.observable(r.EditorDefaultType.Html),e.showImages=a.observable(!1),e.interfaceAnimation=a.observable(r.InterfaceAnimation.Full),e.contactsAutosave=a.observable(!1),c.sAnimationType=r.InterfaceAnimation.Full,e.capaThemes=a.observable(!1),e.allowLanguagesOnSettings=a.observable(!0),e.allowLanguagesOnLogin=a.observable(!0),e.useLocalProxyForExternalImages=a.observable(!1),e.desktopNotifications=a.observable(!1),e.useThreads=a.observable(!0),e.replySameFolder=a.observable(!0),e.useCheckboxesInList=a.observable(!0),e.layout=a.observable(r.Layout.SidePreview),e.usePreviewPane=a.computed(function(){return r.Layout.NoPreview!==e.layout()}),e.interfaceAnimation.subscribe(function(e){if(c.bMobileDevice||e===r.InterfaceAnimation.None)c.$html.removeClass("rl-anim rl-anim-full").addClass("no-rl-anim"),c.sAnimationType=r.InterfaceAnimation.None;else switch(e){case r.InterfaceAnimation.Full:c.$html.removeClass("no-rl-anim").addClass("rl-anim rl-anim-full"),c.sAnimationType=e;break;case r.InterfaceAnimation.Normal:c.$html.removeClass("no-rl-anim rl-anim-full").addClass("rl-anim"),c.sAnimationType=e}}),e.interfaceAnimation.valueHasMutated(),e.desktopNotificationsPermisions=a.computed(function(){e.desktopNotifications();var t=i.notificationClass(),o=r.DesktopNotifications.NotSupported;if(t&&t.permission)switch(t.permission.toLowerCase()){case"granted":o=r.DesktopNotifications.Allowed;break;case"denied":o=r.DesktopNotifications.Denied;break;case"default":o=r.DesktopNotifications.NotAllowed}else n.webkitNotifications&&n.webkitNotifications.checkPermission&&(o=n.webkitNotifications.checkPermission());return o}),e.useDesktopNotifications=a.computed({read:function(){return e.desktopNotifications()&&r.DesktopNotifications.Allowed===e.desktopNotificationsPermisions()},write:function(t){if(t){var n=i.notificationClass(),o=e.desktopNotificationsPermisions();n&&r.DesktopNotifications.Allowed===o?e.desktopNotifications(!0):n&&r.DesktopNotifications.NotAllowed===o?n.requestPermission(function(){e.desktopNotifications.valueHasMutated(),r.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=a.observable(""),e.languages=a.observableArray([]),e.mainLanguage=a.computed({read:e.language,write:function(t){t!==e.language()?-1<i.inArray(t,e.languages())?e.language(t):0<e.languages().length&&e.language(e.languages()[0]):e.language.valueHasMutated()}}),e.theme=a.observable(""),e.themes=a.observableArray([]),e.mainTheme=a.computed({read:e.theme,write:function(t){if(t!==e.theme()){var n=e.themes();-1<i.inArray(t,n)?e.theme(t):0<n.length&&e.theme(n[0])}else e.theme.valueHasMutated()}}),e.capaAdditionalAccounts=a.observable(!1),e.capaAdditionalIdentities=a.observable(!1),e.capaGravatar=a.observable(!1),e.determineUserLanguage=a.observable(!1),e.determineUserDomain=a.observable(!1),e.messagesPerPage=a.observable(l.Defaults.MessagesPerPage),e.mainMessagesPerPage=e.messagesPerPage,e.mainMessagesPerPage=a.computed({read:e.messagesPerPage,write:function(t){-1<i.inArray(i.pInt(t),l.Defaults.MessagesPerPageArray)?t!==e.messagesPerPage()&&e.messagesPerPage(t):e.messagesPerPage.valueHasMutated()}}),e.facebookSupported=a.observable(!1),e.facebookEnable=a.observable(!1),e.facebookAppID=a.observable(""),e.facebookAppSecret=a.observable(""),e.twitterEnable=a.observable(!1),e.twitterConsumerKey=a.observable(""),e.twitterConsumerSecret=a.observable(""),e.googleEnable=a.observable(!1),e.googleClientID=a.observable(""),e.googleClientSecret=a.observable(""),e.googleApiKey=a.observable(""),e.dropboxEnable=a.observable(!1),e.dropboxApiKey=a.observable(""),e.contactsIsAllowed=a.observable(!1)},i.createMomentDate=function(e){return i.isUnd(e.moment)&&(e.moment=a.observable(moment())),a.computed(function(){c.momentTrigger();var e=this.moment();return 1970===e.year()?"":e.fromNow()},e)},i.createMomentShortDate=function(e){return a.computed(function(){var e="",t=moment(),n=this.moment(),o=this.momentDate();return e=1970===n.year()?"":4>=t.diff(n,"hours")?o:t.format("L")===n.format("L")?i.i18n("MESSAGE_LIST/TODAY_AT",{TIME:n.format("LT")}):t.clone().subtract("days",1).format("L")===n.format("L")?i.i18n("MESSAGE_LIST/YESTERDAY_AT",{TIME:n.format("LT")}):n.format(t.year()===n.year()?"D MMM.":"LL")},e)},i.convertThemeName=function(e){return"@custom"===e.substr(-7)&&(e=i.trim(e.substring(0,e.length-7))),i.trim(e.replace(/[^a-zA-Z0-9]+/g," ").replace(/([A-Z])/g," $1").replace(/[\s]+/g," "))},i.quoteName=function(e){return e.replace(/["]/g,'\\"')},i.microtime=function(){return(new Date).getTime()},i.convertLangName=function(e,t){return i.i18n("LANGS_NAMES"+(!0===t?"_EN":"")+"/LANG_"+e.toUpperCase().replace(/[^a-zA-Z0-9]+/g,"_"),null,e)},i.fakeMd5=function(e){var t="",o="0123456789abcdefghijklmnopqrstuvwxyz";for(e=i.isUnd(e)?32:i.pInt(e);t.length<e;)t+=o.substr(n.Math.round(n.Math.random()*o.length),1);return t},i.convertPlainTextToHtml=function(e){return e.toString().replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/\r/g,"").replace(/\n/g,"<br />")},i.draggeblePlace=function(){return s('<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")},i.defautOptionsAfterRender=function(e,t){t&&!i.isUnd(t.disabled)&&e&&s(e).toggleClass("disabled",t.disabled).prop("disabled",t.disabled)},i.windowPopupKnockout=function(e,t,o,r){var l=null,c=n.open(""),u="__OpenerApplyBindingsUid"+i.fakeMd5()+"__",p=s("#"+t);n[u]=function(){if(c&&c.document.body&&p&&p[0]){var t=s(c.document.body);s("#rl-content",t).html(p.html()),s("html",c.document).addClass("external "+s("html").attr("class")),i.i18nToNode(t),e&&s("#rl-content",t)[0]&&a.applyBindings(e,s("#rl-content",t)[0]),n[u]=null,r(c)}},c.document.open(),c.document.write('<html><head><meta charset="utf-8" /><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /><meta name="viewport" content="user-scalable=no" /><meta name="apple-mobile-web-app-capable" content="yes" /><meta name="robots" content="noindex, nofollow, noodp" /><title>'+i.encodeHtml(o)+'</title></head><body><div id="rl-content"></div></body></html>'),c.document.close(),l=c.document.createElement("script"),l.type="text/javascript",l.innerHTML="if(window&&window.opener&&window.opener['"+u+"']){window.opener['"+u+"']();window.opener['"+u+"']=null}",c.document.getElementsByTagName("head")[0].appendChild(l)},i.settingsSaveHelperFunction=function(e,t,n,s){return n=n||null,s=i.isUnd(s)?1e3:i.pInt(s),function(i,a,l,c,u){t.call(n,a&&a.Result?r.SaveSettingsStep.TrueResult:r.SaveSettingsStep.FalseResult),e&&e.call(n,i,a,l,c,u),o.delay(function(){t.call(n,r.SaveSettingsStep.Idle)},s)}},i.settingsSaveHelperSimpleFunction=function(e,t){return i.settingsSaveHelperFunction(null,e,t,1e3)},i.htmlToPlain=function(e){var t=0,i=0,n=0,o=0,a=0,r="",l=function(e){for(var t=100,i="",n="",o=e,s=0,a=0;o.length>t;)n=o.substring(0,t),s=n.lastIndexOf(" "),a=n.lastIndexOf("\n"),-1!==a&&(s=a),-1===s&&(s=t),i+=n.substring(0,s)+"\n",o=o.substring(s+1);return i+o},u=function(e){return e=l(s.trim(e)),e="> "+e.replace(/\n/gm,"\n> "),e.replace(/(^|\n)([> ]+)/gm,function(){return arguments&&2<arguments.length?arguments[1]+s.trim(arguments[2].replace(/[\s]/g,""))+" ":""})},p=function(){if(arguments&&1<arguments.length){var e=s.trim(arguments[1]);return 0<e.length&&(e=e.replace(/<div[^>]*>([\s\S\r\n]*)<\/div>/gim,p),e="\n"+s.trim(e)+"\n"),e}return""},d=function(){return arguments&&1<arguments.length?arguments[1].toString().replace(/[\n]/gm,"<br />"):""},g=function(){return arguments&&1<arguments.length?""+arguments[1]+arguments[2].replace(/</g,"<").replace(/>/g,">"):""},m=function(){return arguments&&1<arguments.length?s.trim(arguments[1]):""};for(r=e.replace(/<pre[^>]*>([\s\S\r\n]*)<\/pre>/gim,d).replace(/[\s]+/gm," ").replace(/((?:href|data)\s?=\s?)("[^"]+?"|'[^']+?')/gim,g).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,p).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,""),r=c.$div.html(r).text(),r=r.replace(/\n[ \t]+/gm,"\n").replace(/[\n]{3,}/gm,"\n\n").replace(/>/gi,">").replace(/</gi,"<").replace(/&/gi,"&"),t=0,a=100;a>0&&(a--,i=r.indexOf("__bq__start__",t),i>-1);)n=r.indexOf("__bq__start__",i+5),o=r.indexOf("__bq__end__",i+5),(-1===n||n>o)&&o>i?(r=r.substring(0,i)+u(r.substring(i+13,o))+r.substring(o+11),t=0):t=n>-1&&o>n?n-1:0;return r=r.replace(/__bq__start__/gm,"").replace(/__bq__end__/gm,"")},i.plainToHtml=function(e,t){e=e.toString().replace(/\r/g,"");var n=!1,o=!0,s=!0,a=[],r="",l=0,c=e.split("\n");do{for(o=!1,a=[],l=0;l<c.length;l++)r=c[l],s=">"===r.substr(0,1),s&&!n?(o=!0,n=!0,a.push("~~~blockquote~~~"),a.push(r.substr(1))):!s&&n?(n=!1,a.push("~~~/blockquote~~~"),a.push(r)):a.push(s&&n?r.substr(1):r);n&&(n=!1,a.push("~~~/blockquote~~~")),c=a}while(o);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?i.linkify(e):e},n.rainloop_Utils_htmlToPlain=i.htmlToPlain,n.rainloop_Utils_plainToHtml=i.plainToHtml,i.linkify=function(e){return s.fn&&s.fn.linkify&&(e=c.$div.html(e.replace(/&/gi,"amp_amp_12345_amp_amp")).linkify().find(".linkified").removeClass("linkified").end().html().replace(/amp_amp_12345_amp_amp/g,"&")),e},i.resizeAndCrop=function(e,t,i){var o=new n.Image;o.onload=function(){var e=[0,0],o=n.document.createElement("canvas"),s=o.getContext("2d");o.width=t,o.height=t,e=this.width>this.height?[this.width-this.height,0]:[0,this.height-this.width],s.fillStyle="#fff",s.fillRect(0,0,t,t),s.drawImage(this,e[0]/2,e[1]/2,this.width-e[0],this.height-e[1],0,0,t,t),i(o.toDataURL("image/jpeg"))},o.src=e},i.folderListOptionsBuilder=function(e,t,o,s,a,l,c,u,p,d){var g=null,m=!1,h=0,f=0,b=" ",S=[];for(p=i.isNormal(p)?p:0<e.length,d=i.isUnd(d)?!1:!!d,a=i.isNormal(a)?a:0,l=i.isNormal(l)?l:null,c=i.isNormal(c)?c:null,u=i.isNormal(u)?u:null,i.isArray(o)||(o=[]),i.isArray(s)||(s=[]),h=0,f=s.length;f>h;h++)S.push({id:s[h][0],name:s[h][1],system:!1,seporator:!1,disabled:!1});for(m=!0,h=0,f=e.length;f>h;h++)g=e[h],(c?c.call(null,g):!0)&&(m&&0<S.length&&S.push({id:"---",name:"---",system:!1,seporator:!0,disabled:!0}),m=!1,S.push({id:g.fullNameRaw,name:u?u.call(null,g):g.name(),system:!0,seporator:!1,disabled:!g.selectable||-1<i.inArray(g.fullNameRaw,o)||(l?l.call(null,g):!1)}));for(m=!0,h=0,f=t.length;f>h;h++)g=t[h],(g.subScribed()||!g.existen)&&(c?c.call(null,g):!0)&&(r.FolderType.User===g.type()||!p||0<g.subFolders().length)&&(m&&0<S.length&&S.push({id:"---",name:"---",system:!1,seporator:!0,disabled:!0}),m=!1,S.push({id:g.fullNameRaw,name:new n.Array(g.deep+1-a).join(b)+(u?u.call(null,g):g.name()),system:!1,seporator:!1,disabled:!g.selectable||-1<i.inArray(g.fullNameRaw,o)||(l?l.call(null,g):!1)})),g.subScribed()&&0<g.subFolders().length&&(S=S.concat(i.folderListOptionsBuilder([],g.subFolders(),o,[],a,l,c,u,p,d)));return S},i.computedPagenatorHelper=function(e,t){return function(){var o=0,s=0,a=2,r=[],l=e(),c=t(),u=function(e,t,n){var o={current:e===l,name:i.isUnd(n)?e.toString():n.toString(),custom:i.isUnd(n)?!1:!0,title:i.isUnd(n)?"":e.toString(),value:e.toString()};(i.isUnd(t)?0:!t)?r.unshift(o):r.push(o)};if(c>1||c>0&&l>c){for(l>c?(u(c),o=c,s=c):((3>=l||l>=c-2)&&(a+=2),u(l),o=l,s=l);a>0;)if(o-=1,s+=1,o>0&&(u(o,!1),a--),c>=s)u(s,!0),a--;else if(0>=o)break;3===o?u(2,!1):o>3&&u(n.Math.round((o-1)/2),!1,"..."),c-2===s?u(c-1,!0):c-2>s&&u(n.Math.round((c+s)/2),!0,"..."),o>1&&u(1,!1),c>s&&u(c,!0)}return r}},i.selectElement=function(e){var t,i;n.getSelection?(t=n.getSelection(),t.removeAllRanges(),i=n.document.createRange(),i.selectNodeContents(e),t.addRange(i)):n.document.selection&&(i=n.document.body.createTextRange(),i.moveToElementText(e),i.select())},i.detectDropdownVisibility=o.debounce(function(){c.dropdownVisibility(!!o.find(c.aBootstrapDropdowns,function(e){return e.hasClass("open")}))},50),i.triggerAutocompleteInputChange=function(e){var t=function(){s(".checkAutocomplete").trigger("change")};(i.isUnd(e)?1:!e)?t():o.delay(t,100)},e.exports=i}(t,e)},{$:14,"App:Knoin":21,Consts:5,Enums:6,Globals:8,"Model:Email":26,_:19,ko:16,window:20}],12:[function(e,t){t.exports=crossroads},{}],13:[function(e,t){t.exports=hasher},{}],14:[function(e,t){t.exports=$},{}],15:[function(e,t){t.exports=key},{}],16:[function(e,t){!function(t,i){"use strict";var n=e("window"),o=e("_"),s=e("$");i.bindingHandlers.tooltip={init:function(t,n){var o=e("Globals"),a=e("Utils");if(!o.bMobileDevice){var r=s(t),l=r.data("tooltip-class")||"",c=r.data("tooltip-placement")||"top";r.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:c,trigger:"hover",title:function(){return r.is(".disabled")||o.dropdownVisibility()?"":'<span class="tooltip-class '+l+'">'+a.i18n(i.utils.unwrapObservable(n()))+"</span>"}}).click(function(){r.tooltip("hide")}),o.tooltipTrigger.subscribe(function(){r.tooltip("hide")})}}},i.bindingHandlers.tooltip2={init:function(t,i){var n=e("Globals"),o=s(t),a=o.data("tooltip-class")||"",r=o.data("tooltip-placement")||"top";o.tooltip({delay:{show:500,hide:100},html:!0,container:"body",placement:r,title:function(){return o.is(".disabled")||n.dropdownVisibility()?"":'<span class="tooltip-class '+a+'">'+i()()+"</span>"}}).click(function(){o.tooltip("hide")}),n.tooltipTrigger.subscribe(function(){o.tooltip("hide")})}},i.bindingHandlers.tooltip3={init:function(t){var i=s(t),o=e("Globals");i.tooltip({container:"body",trigger:"hover manual",title:function(){return i.data("tooltip3-data")||""}}),s(n.document).click(function(){i.tooltip("hide")}),o.tooltipTrigger.subscribe(function(){i.tooltip("hide")})},update:function(e,t){var n=i.utils.unwrapObservable(t());""===n?s(e).data("tooltip3-data","").tooltip("hide"):s(e).data("tooltip3-data",n).tooltip("show")}},i.bindingHandlers.registrateBootstrapDropdown={init:function(t){var i=e("Globals");i.aBootstrapDropdowns.push(s(t))}},i.bindingHandlers.openDropdownTrigger={update:function(t,n){if(i.utils.unwrapObservable(n())){var o=s(t),a=e("Utils");o.hasClass("open")||(o.find(".dropdown-toggle").dropdown("toggle"),a.detectDropdownVisibility()),n()(!1)}}},i.bindingHandlers.dropdownCloser={init:function(e){s(e).closest(".dropdown").on("click",".e-item",function(){s(e).dropdown("toggle")})}},i.bindingHandlers.popover={init:function(e,t){s(e).popover(i.utils.unwrapObservable(t()))}},i.bindingHandlers.csstext={init:function(t,n){var o=e("Utils");t&&t.styleSheet&&!o.isUnd(t.styleSheet.cssText)?t.styleSheet.cssText=i.utils.unwrapObservable(n()):s(t).text(i.utils.unwrapObservable(n()))},update:function(t,n){var o=e("Utils");t&&t.styleSheet&&!o.isUnd(t.styleSheet.cssText)?t.styleSheet.cssText=i.utils.unwrapObservable(n()):s(t).text(i.utils.unwrapObservable(n()))}},i.bindingHandlers.resizecrop={init:function(e){s(e).addClass("resizecrop").resizecrop({width:"100",height:"100",wrapperCSS:{"border-radius":"10px"}})},update:function(e,t){t()(),s(e).resizecrop({width:"100",height:"100"})}},i.bindingHandlers.onEnter={init:function(e,t,i,o){s(e).on("keypress",function(i){i&&13===n.parseInt(i.keyCode,10)&&(s(e).trigger("change"),t().call(o))})}},i.bindingHandlers.onEsc={init:function(e,t,i,o){s(e).on("keypress",function(i){i&&27===n.parseInt(i.keyCode,10)&&(s(e).trigger("change"),t().call(o))})}},i.bindingHandlers.clickOnTrue={update:function(e,t){i.utils.unwrapObservable(t())&&s(e).click()}},i.bindingHandlers.modal={init:function(t,n){var o=e("Globals"),a=e("Utils");s(t).toggleClass("fade",!o.bMobileDevice).modal({keyboard:!1,show:i.utils.unwrapObservable(n())}).on("shown",function(){a.windowResize()}).find(".close").click(function(){n()(!1)})},update:function(e,t){s(e).modal(i.utils.unwrapObservable(t())?"show":"hide")}},i.bindingHandlers.i18nInit={init:function(t){var i=e("Utils");i.i18nToNode(t)}},i.bindingHandlers.i18nUpdate={update:function(t,n){var o=e("Utils");i.utils.unwrapObservable(n()),o.i18nToNode(t)}},i.bindingHandlers.link={update:function(e,t){s(e).attr("href",i.utils.unwrapObservable(t()))}},i.bindingHandlers.title={update:function(e,t){s(e).attr("title",i.utils.unwrapObservable(t()))}},i.bindingHandlers.textF={init:function(e,t){s(e).text(i.utils.unwrapObservable(t()))}},i.bindingHandlers.initDom={init:function(e,t){t()(e)}},i.bindingHandlers.initResizeTrigger={init:function(e,t){var n=i.utils.unwrapObservable(t());s(e).css({height:n[1],"min-height":n[1]})},update:function(t,n){var o=e("Utils"),a=e("Globals"),r=i.utils.unwrapObservable(n()),l=o.pInt(r[1]),c=0,u=s(t).offset().top;u>0&&(u+=o.pInt(r[2]),c=a.$win.height()-u,c>l&&(l=c),s(t).css({height:l,"min-height":l}))}},i.bindingHandlers.appendDom={update:function(e,t){s(e).hide().empty().append(i.utils.unwrapObservable(t())).show()}},i.bindingHandlers.draggable={init:function(t,o,a){var r=e("Globals"),l=e("Utils");if(!r.bMobileDevice){var c=100,u=3,p=a(),d=p&&p.droppableSelector?p.droppableSelector:"",g={distance:20,handle:".dragHandle",cursorAt:{top:22,left:3},refreshPositions:!0,scroll:!0};d&&(g.drag=function(e){s(d).each(function(){var t=null,i=null,o=s(this),a=o.offset(),r=a.top+o.height();n.clearInterval(o.data("timerScroll")),o.data("timerScroll",!1),e.pageX>=a.left&&e.pageX<=a.left+o.width()&&(e.pageY>=r-c&&e.pageY<=r&&(t=function(){o.scrollTop(o.scrollTop()+u),l.windowResize()},o.data("timerScroll",n.setInterval(t,10)),t()),e.pageY>=a.top&&e.pageY<=a.top+c&&(i=function(){o.scrollTop(o.scrollTop()-u),l.windowResize()},o.data("timerScroll",n.setInterval(i,10)),i()))})},g.stop=function(){s(d).each(function(){n.clearInterval(s(this).data("timerScroll")),s(this).data("timerScroll",!1)})}),g.helper=function(e){return o()(e&&e.target?i.dataFor(e.target):null)},s(t).draggable(g).on("mousedown",function(){l.removeInFocus()})}}},i.bindingHandlers.droppable={init:function(t,i,n){var o=e("Globals");if(!o.bMobileDevice){var a=i(),r=n(),l=r&&r.droppableOver?r.droppableOver:null,c=r&&r.droppableOut?r.droppableOut:null,u={tolerance:"pointer",hoverClass:"droppableHover"};a&&(u.drop=function(e,t){a(e,t)},l&&(u.over=function(e,t){l(e,t)}),c&&(u.out=function(e,t){c(e,t)}),s(t).droppable(u))}}},i.bindingHandlers.nano={init:function(t){var i=e("Globals");i.bDisableNanoScroll||s(t).addClass("nano").nanoScroller({iOSNativeScrolling:!1,preventPageScrolling:!0})}},i.bindingHandlers.saveTrigger={init:function(e){var t=s(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 n=i.utils.unwrapObservable(t()),o=s(e);if("custom"===o.data("save-trigger-type"))switch(n.toString()){case"1":o.find(".animated,.error").hide().removeClass("visible").end().find(".success").show().addClass("visible");break;case"0":o.find(".animated,.success").hide().removeClass("visible").end().find(".error").show().addClass("visible");break;case"-2":o.find(".error,.success").hide().removeClass("visible").end().find(".animated").show().addClass("visible");break;default:o.find(".animated").hide().end().find(".error,.success").removeClass("visible")}else switch(n.toString()){case"1":o.addClass("success").removeClass("error");break;case"0":o.addClass("error").removeClass("success");break;case"-2":break;default:o.removeClass("error success")}}},i.bindingHandlers.emailsTags={init:function(t,i,n){var a=e("Utils"),r=e("Model:Email"),l=s(t),c=i(),u=n(),p=u.autoCompleteSource||null,d=function(e){c&&c.focusTrigger&&c.focusTrigger(e)};l.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!0,focusCallback:d,inputDelimiters:[",",";"],autoCompleteSource:p,parseHook:function(e){return o.map(e,function(e){var t=a.trim(e),i=null;return""!==t?(i=new r,i.mailsoParse(t),i.clearDuplicateName(),[i.toLine(!1),i]):[t,null]})},change:o.bind(function(e){l.data("EmailsTagsValue",e.target.value),c(e.target.value)},this)})},update:function(e,t,n){var o=s(e),a=n(),r=a.emailsTagsFilter||null,l=i.utils.unwrapObservable(t());o.data("EmailsTagsValue")!==l&&(o.val(l),o.data("EmailsTagsValue",l),o.inputosaurus("refresh")),r&&i.utils.unwrapObservable(r)&&o.inputosaurus("focus")}},i.bindingHandlers.contactTags={init:function(t,i,n){var a=e("Utils"),r=e("Model:ContactTag"),l=s(t),c=i(),u=n(),p=u.autoCompleteSource||null,d=function(e){c&&c.focusTrigger&&c.focusTrigger(e)};l.inputosaurus({parseOnBlur:!0,allowDragAndDrop:!1,focusCallback:d,inputDelimiters:[",",";"],outputDelimiter:",",autoCompleteSource:p,parseHook:function(e){return o.map(e,function(e){var t=a.trim(e),i=null;return""!==t?(i=new r,i.name(t),[i.toLine(!1),i]):[t,null]})},change:o.bind(function(e){l.data("ContactTagsValue",e.target.value),c(e.target.value)},this)})},update:function(e,t,n){var o=s(e),a=n(),r=a.contactTagsFilter||null,l=i.utils.unwrapObservable(t());o.data("ContactTagsValue")!==l&&(o.val(l),o.data("ContactTagsValue",l),o.inputosaurus("refresh")),r&&i.utils.unwrapObservable(r)&&o.inputosaurus("focus")}},i.bindingHandlers.command={init:function(e,t,n,o){var a=s(e),r=t();if(!r||!r.enabled||!r.canExecute)throw new Error("You are not using command function");a.addClass("command"),i.bindingHandlers[a.is("form")?"submit":"click"].init.apply(o,arguments)},update:function(e,t){var i=!0,n=s(e),o=t();i=o.enabled(),n.toggleClass("command-not-enabled",!i),i&&(i=o.canExecute(),n.toggleClass("command-can-not-be-execute",!i)),n.toggleClass("command-disabled disable disabled",!i).toggleClass("no-disabled",!!i),(n.is("input")||n.is("button"))&&n.prop("disabled",!i)}},i.extenders.trimmer=function(t){var n=e("Utils"),o=i.computed({read:t,write:function(e){t(n.trim(e.toString()))},owner:this});return o(t()),o},i.extenders.posInterer=function(t,n){var o=e("Utils"),s=i.computed({read:t,write:function(e){var i=o.pInt(e.toString(),n);0>=i&&(i=n),i===t()&&""+i!=""+e&&t(i+1),t(i)}});return s(t()),s},i.extenders.reversible=function(e){var t=e();return e.commit=function(){t=e()},e.reverse=function(){e(t)},e.commitedValue=function(){return t},e},i.extenders.toggleSubscribe=function(e,t){return e.subscribe(t[1],t[0],"beforeChange"),e.subscribe(t[2],t[0]),e},i.extenders.falseTimeout=function(t,i){var o=e("Utils");return t.iTimeout=0,t.subscribe(function(e){e&&(n.clearTimeout(t.iTimeout),t.iTimeout=n.setTimeout(function(){t(!1),t.iTimeout=0},o.pInt(i)))}),t},i.observable.fn.validateNone=function(){return this.hasError=i.observable(!1),this},i.observable.fn.validateEmail=function(){var t=e("Utils");return this.hasError=i.observable(!1),this.subscribe(function(e){e=t.trim(e),this.hasError(""!==e&&!/^[^@\s]+@[^@\s]+$/.test(e))},this),this.valueHasMutated(),this},i.observable.fn.validateSimpleEmail=function(){var t=e("Utils");return this.hasError=i.observable(!1),this.subscribe(function(e){e=t.trim(e),this.hasError(""!==e&&!/^.+@.+$/.test(e))},this),this.valueHasMutated(),this},i.observable.fn.validateFunc=function(t){var n=e("Utils");return this.hasFuncError=i.observable(!1),n.isFunc(t)&&(this.subscribe(function(e){this.hasFuncError(!t(e))},this),this.valueHasMutated()),this},t.exports=i}(t,ko)},{$:14,Globals:8,"Model:ContactTag":25,"Model:Email":26,Utils:11,_:19,window:20}],17:[function(e,t){t.exports=moment},{}],18:[function(e,t){t.exports=ssm},{}],19:[function(e,t){t.exports=_},{}],20:[function(e,t){t.exports=window},{}],21:[function(e,t){!function(e,t){"use strict";function i(){this.oScreens={},this.sDefaultScreenName="",this.oCurrentScreen=null}var n=t("_"),o=t("$"),s=t("ko"),a=t("hasher"),r=t("crossroads"),l=t("Globals"),c=t("Plugins"),u=t("Utils");i.prototype.oScreens={},i.prototype.sDefaultScreenName="",i.prototype.oCurrentScreen=null,i.prototype.hideLoading=function(){o("#rl-loading").hide()},i.prototype.constructorEnd=function(e){u.isFunc(e.__constructor_end)&&e.__constructor_end.call(e)},i.prototype.extendAsViewModel=function(e,t){t&&(t.__names=u.isArray(e)?e:[e],t.__name=t.__names[0])},i.prototype.addSettingsViewModel=function(e,t,i,n,o){e.__rlSettingsData={Label:i,Template:t,Route:n,IsDefault:!!o},l.aViewModels.settings.push(e)},i.prototype.removeSettingsViewModel=function(e){l.aViewModels["settings-removed"].push(e)},i.prototype.disableSettingsViewModel=function(e){l.aViewModels["settings-disabled"].push(e)},i.prototype.routeOff=function(){a.changed.active=!1},i.prototype.routeOn=function(){a.changed.active=!0},i.prototype.screen=function(e){return""===e||u.isUnd(this.oScreens[e])?null:this.oScreens[e]},i.prototype.buildViewModel=function(e,t){if(e&&!e.__builded){var i=this,a=new e(t),r=a.viewModelPosition(),p=o("#rl-content #rl-"+r.toLowerCase()),d=null;e.__builded=!0,e.__vm=a,a.viewModelName=e.__name,a.viewModelNames=e.__names,p&&1===p.length?(d=o("<div></div>").addClass("rl-view-model").addClass("RL-"+a.viewModelTemplate()).hide(),d.appendTo(p),a.viewModelDom=d,e.__dom=d,"Popups"===r&&(a.cancelCommand=a.closeCommand=u.createCommand(a,function(){i.hideScreenPopup(e)}),a.modalVisibility.subscribe(function(e){var t=this;e?(this.viewModelDom.show(),this.storeAndSetKeyScope(),l.popupVisibilityNames.push(this.viewModelName),a.viewModelDom.css("z-index",3e3+l.popupVisibilityNames().length+10),u.delegateRun(this,"onFocus",[],500)):(u.delegateRun(this,"onHide"),this.restoreKeyScope(),n.each(this.viewModelNames,function(e){c.runHook("view-model-on-hide",[e,t])}),l.popupVisibilityNames.remove(this.viewModelName),a.viewModelDom.css("z-index",2e3),l.tooltipTrigger(!l.tooltipTrigger()),n.delay(function(){t.viewModelDom.hide()},300))},a)),n.each(e.__names,function(e){c.runHook("view-model-pre-build",[e,a,d])}),s.applyBindingAccessorsToNode(d[0],{i18nInit:!0,template:function(){return{name:a.viewModelTemplate()}}},a),u.delegateRun(a,"onBuild",[d]),a&&"Popups"===r&&a.registerPopupKeyDown(),n.each(e.__names,function(e){c.runHook("view-model-post-build",[e,a,d])})):u.log("Cannot find view model position: "+r)}return e?e.__vm:null},i.prototype.hideScreenPopup=function(e){e&&e.__vm&&e.__dom&&e.__vm.modalVisibility(!1)},i.prototype.showScreenPopup=function(e,t){e&&(this.buildViewModel(e),e.__vm&&e.__dom&&(e.__vm.modalVisibility(!0),u.delegateRun(e.__vm,"onShow",t||[]),n.each(e.__names,function(i){c.runHook("view-model-on-show",[i,e.__vm,t||[]])})))},i.prototype.isPopupVisible=function(e){return e&&e.__vm?e.__vm.modalVisibility():!1},i.prototype.screenOnRoute=function(e,t){var i=this,o=null,s=null;""===u.pString(e)&&(e=this.sDefaultScreenName),""!==e&&(o=this.screen(e),o||(o=this.screen(this.sDefaultScreenName),o&&(t=e+"/"+t,e=this.sDefaultScreenName)),o&&o.__started&&(o.__builded||(o.__builded=!0,u.isNonEmptyArray(o.viewModels())&&n.each(o.viewModels(),function(e){this.buildViewModel(e,o)},this),u.delegateRun(o,"onBuild")),n.defer(function(){i.oCurrentScreen&&(u.delegateRun(i.oCurrentScreen,"onHide"),u.isNonEmptyArray(i.oCurrentScreen.viewModels())&&n.each(i.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.hide(),e.__vm.viewModelVisibility(!1),u.delegateRun(e.__vm,"onHide"))})),i.oCurrentScreen=o,i.oCurrentScreen&&(u.delegateRun(i.oCurrentScreen,"onShow"),c.runHook("screen-on-show",[i.oCurrentScreen.screenName(),i.oCurrentScreen]),u.isNonEmptyArray(i.oCurrentScreen.viewModels())&&n.each(i.oCurrentScreen.viewModels(),function(e){e.__vm&&e.__dom&&"Popups"!==e.__vm.viewModelPosition()&&(e.__dom.show(),e.__vm.viewModelVisibility(!0),u.delegateRun(e.__vm,"onShow"),u.delegateRun(e.__vm,"onFocus",[],200),n.each(e.__names,function(t){c.runHook("view-model-on-show",[t,e.__vm])}))},i)),s=o.__cross?o.__cross():null,s&&s.parse(t)})))},i.prototype.startScreens=function(e){o("#rl-content").css({visibility:"hidden"}),n.each(e,function(e){var t=new e,i=t?t.screenName():"";t&&""!==i&&(""===this.sDefaultScreenName&&(this.sDefaultScreenName=i),this.oScreens[i]=t)},this),n.each(this.oScreens,function(e){e&&!e.__started&&e.__start&&(e.__started=!0,e.__start(),c.runHook("screen-pre-start",[e.screenName(),e]),u.delegateRun(e,"onStart"),c.runHook("screen-post-start",[e.screenName(),e]))},this);var t=r.create();t.addRoute(/^([a-zA-Z0-9\-]*)\/?(.*)$/,n.bind(this.screenOnRoute,this)),a.initialized.add(t.parse,t),a.changed.add(t.parse,t),a.init(),o("#rl-content").css({visibility:"visible"}),n.delay(function(){l.$html.removeClass("rl-started-trigger").addClass("rl-started")},50)},i.prototype.setHash=function(e,t,i){e="#"===e.substr(0,1)?e.substr(1):e,e="/"===e.substr(0,1)?e.substr(1):e,i=u.isUnd(i)?!1:!!i,(u.isUnd(t)?1:!t)?(a.changed.active=!0,a[i?"replaceHash":"setHash"](e),a.setHash(e)):(a.changed.active=!1,a[i?"replaceHash":"setHash"](e),a.changed.active=!0)},e.exports=new i}(t,e)},{$:14,Globals:8,Plugins:10,Utils:11,_:19,crossroads:12,hasher:13,ko:16}],22:[function(e,t){!function(e){"use strict";function t(){}t.prototype.bootstart=function(){},e.exports=t}(t,e)},{}],23:[function(e,t){!function(e,t){"use strict";function i(e,t){this.sScreenName=e,this.aViewModels=s.isArray(t)?t:[]}var n=t("_"),o=t("crossroads"),s=t("Utils");i.prototype.oCross=null,i.prototype.sScreenName="",i.prototype.aViewModels=[],i.prototype.viewModels=function(){return this.aViewModels},i.prototype.screenName=function(){return this.sScreenName},i.prototype.routes=function(){return null},i.prototype.__cross=function(){return this.oCross},i.prototype.__start=function(){var e=this.routes(),t=null,i=null;s.isNonEmptyArray(e)&&(i=n.bind(this.onRoute||s.emptyFunction,this),t=o.create(),n.each(e,function(e){t.addRoute(e[0],i).rules=e[1]}),this.oCross=t)},e.exports=i}(t,e)},{Utils:11,_:19,crossroads:12}],24:[function(e,t){!function(e,t){"use strict";
|
||
function i(e,t){this.bDisabeCloseOnEsc=!1,this.sPosition=s.pString(e),this.sTemplate=s.pString(t),this.sDefaultKeyScope=o.KeyState.None,this.sCurrentKeyScope=this.sDefaultKeyScope,this.viewModelVisibility=n.observable(!1),this.modalVisibility=n.observable(!1).extend({rateLimit:0}),this.viewModelName="",this.viewModelNames=[],this.viewModelDom=null}var n=t("ko"),o=t("Enums"),s=t("Utils"),a=t("Globals");i.prototype.bDisabeCloseOnEsc=!1,i.prototype.sPosition="",i.prototype.sTemplate="",i.prototype.sDefaultKeyScope=o.KeyState.None,i.prototype.sCurrentKeyScope=o.KeyState.None,i.prototype.viewModelName="",i.prototype.viewModelNames=[],i.prototype.viewModelDom=null,i.prototype.viewModelTemplate=function(){return this.sTemplate},i.prototype.viewModelPosition=function(){return this.sPosition},i.prototype.cancelCommand=function(){},i.prototype.closeCommand=function(){},i.prototype.storeAndSetKeyScope=function(){this.sCurrentKeyScope=a.keyScope(),a.keyScope(this.sDefaultKeyScope)},i.prototype.restoreKeyScope=function(){a.keyScope(this.sCurrentKeyScope)},i.prototype.registerPopupKeyDown=function(){var e=this;a.$win.on("keydown",function(t){if(t&&e.modalVisibility&&e.modalVisibility()){if(!this.bDisabeCloseOnEsc&&o.EventKeyCode.Esc===t.keyCode)return s.delegateRun(e,"cancelCommand"),!1;if(o.EventKeyCode.Backspace===t.keyCode&&!s.inFocus())return!1}return!0})},e.exports=i}(t,e)},{Enums:6,Globals:8,Utils:11,ko:16}],25:[function(e,t){!function(e,t){"use strict";function i(){this.idContactTag=0,this.name=n.observable(""),this.readOnly=!1}var n=t("ko"),o=t("Utils");i.prototype.parse=function(e){var t=!1;return e&&"Object/Tag"===e["@Object"]&&(this.idContact=o.pInt(e.IdContactTag),this.name(o.pString(e.Name)),this.readOnly=!!e.ReadOnly,t=!0),t},i.prototype.filterHelper=function(e){return-1!==this.name().toLowerCase().indexOf(e.toLowerCase())},i.prototype.toLine=function(e){return(o.isUnd(e)?1:!e)?this.name():o.encodeHtml(this.name())},e.exports=i}(t,e)},{Utils:11,ko:16}],26:[function(e,t){!function(e,t){"use strict";function i(e,t){this.email=e||"",this.name=t||"",this.clearDuplicateName()}var n=t("Utils");i.newInstanceFromJson=function(e){var t=new i;return t.initByJson(e)?t:null},i.prototype.name="",i.prototype.email="",i.prototype.clear=function(){this.email="",this.name=""},i.prototype.validate=function(){return""!==this.name||""!==this.email},i.prototype.hash=function(e){return"#"+(e?"":this.name)+"#"+this.email+"#"},i.prototype.clearDuplicateName=function(){this.name===this.email&&(this.name="")},i.prototype.search=function(e){return-1<(this.name+" "+this.email).toLowerCase().indexOf(e.toLowerCase())},i.prototype.parse=function(e){this.clear(),e=n.trim(e);var t=/(?:"([^"]+)")? ?<?(.*?@[^>,]+)>?,? ?/g,i=t.exec(e);i?(this.name=i[1]||"",this.email=i[2]||"",this.clearDuplicateName()):/^[^@]+@[^@]+$/.test(e)&&(this.name="",this.email=e)},i.prototype.initByJson=function(e){var t=!1;return e&&"Object/Email"===e["@Object"]&&(this.name=n.trim(e.Name),this.email=n.trim(e.Email),t=""!==this.email,this.clearDuplicateName()),t},i.prototype.toLine=function(e,t,i){var o="";return""!==this.email&&(t=n.isUnd(t)?!1:!!t,i=n.isUnd(i)?!1:!!i,e&&""!==this.name?o=t?'<a href="mailto:'+n.encodeHtml('"'+this.name+'" <'+this.email+">")+'" target="_blank" tabindex="-1">'+n.encodeHtml(this.name)+"</a>":i?n.encodeHtml(this.name):this.name:(o=this.email,""!==this.name?t?o=n.encodeHtml('"'+this.name+'" <')+'<a href="mailto:'+n.encodeHtml('"'+this.name+'" <'+this.email+">")+'" target="_blank" tabindex="-1">'+n.encodeHtml(o)+"</a>"+n.encodeHtml(">"):(o='"'+this.name+'" <'+o+">",i&&(o=n.encodeHtml(o))):t&&(o='<a href="mailto:'+n.encodeHtml(this.email)+'" target="_blank" tabindex="-1">'+n.encodeHtml(this.email)+"</a>"))),o},i.prototype.mailsoParse=function(e){if(e=n.trim(e),""===e)return!1;for(var t=function(e,t,i){e+="";var n=e.length;return 0>t&&(t+=n),n="undefined"==typeof i?n:0>i?i+n:i+t,t>=e.length||0>t||t>n?!1:e.slice(t,n)},i=function(e,t,i,n){return 0>i&&(i+=e.length),n=void 0!==n?n:e.length,0>n&&(n=n+e.length-i),e.slice(0,i)+t.substr(0,n)+t.slice(n)+e.slice(i+n)},o="",s="",a="",r=!1,l=!1,c=!1,u=null,p=0,d=0,g=0;g<e.length;){switch(e.substr(g,1)){case'"':r||l||c?l||c||(d=g,o=t(e,p+1,d-p-1),e=i(e,"",p,d-p+1),d=0,g=0,p=0,r=!1):(r=!0,p=g);break;case"<":r||l||c||(g>0&&0===o.length&&(o=t(e,0,g)),l=!0,p=g);break;case">":l&&(d=g,s=t(e,p+1,d-p-1),e=i(e,"",p,d-p+1),d=0,g=0,p=0,l=!1);break;case"(":r||l||c||(c=!0,p=g);break;case")":c&&(d=g,a=t(e,p+1,d-p-1),e=i(e,"",p,d-p+1),d=0,g=0,p=0,c=!1);break;case"\\":g++}g++}return 0===s.length&&(u=e.match(/[^@\s]+@\S+/i),u&&u[0]?s=u[0]:o=e),s.length>0&&0===o.length&&0===a.length&&(o=e.replace(s,"")),s=n.trim(s).replace(/^[<]+/,"").replace(/[>]+$/,""),o=n.trim(o).replace(/^["']+/,"").replace(/["']+$/,""),a=n.trim(a).replace(/^[(]+/,"").replace(/[)]+$/,""),o=o.replace(/\\\\(.)/g,"$1"),a=a.replace(/\\\\(.)/g,"$1"),this.name=o,this.email=s,this.clearDuplicateName(),!0},i.prototype.inputoTagLine=function(){return 0<this.name.length?this.name+" ("+this.email+")":this.email},e.exports=i}(t,e)},{Utils:11}],27:[function(e,t){!function(e,t){"use strict";function i(e){u.call(this,"settings",e),this.menu=s.observableArray([]),this.oCurrentSubScreen=null,this.oViewModelPlace=null}var n=t("_"),o=t("$"),s=t("ko"),a=t("Globals"),r=t("Utils"),l=t("LinkBuilder"),c=t("App:Knoin"),u=t("Knoin:AbstractScreen");n.extend(i.prototype,u.prototype),i.prototype.onRoute=function(e){var t=this,i=null,u=null,p=null,d=null;u=n.find(a.aViewModels.settings,function(t){return t&&t.__rlSettingsData&&e===t.__rlSettingsData.Route}),u&&(n.find(a.aViewModels["settings-removed"],function(e){return e&&e===u})&&(u=null),u&&n.find(a.aViewModels["settings-disabled"],function(e){return e&&e===u})&&(u=null)),u?(u.__builded&&u.__vm?i=u.__vm:(p=this.oViewModelPlace,p&&1===p.length?(i=new u,d=o("<div></div>").addClass("rl-settings-view-model").hide(),d.appendTo(p),i.viewModelDom=d,i.__rlSettingsData=u.__rlSettingsData,u.__dom=d,u.__builded=!0,u.__vm=i,s.applyBindingAccessorsToNode(d[0],{i18nInit:!0,template:function(){return{name:u.__rlSettingsData.Template}}},i),r.delegateRun(i,"onBuild",[d])):r.log("Cannot find sub settings view model position: SettingsSubScreen")),i&&n.defer(function(){t.oCurrentSubScreen&&(r.delegateRun(t.oCurrentSubScreen,"onHide"),t.oCurrentSubScreen.viewModelDom.hide()),t.oCurrentSubScreen=i,t.oCurrentSubScreen&&(t.oCurrentSubScreen.viewModelDom.show(),r.delegateRun(t.oCurrentSubScreen,"onShow"),r.delegateRun(t.oCurrentSubScreen,"onFocus",[],200),n.each(t.menu(),function(e){e.selected(i&&i.__rlSettingsData&&e.route===i.__rlSettingsData.Route)}),o("#rl-content .b-settings .b-content .content").scrollTop(0)),r.windowResize()})):c.setHash(l.settings(),!1,!0)},i.prototype.onHide=function(){this.oCurrentSubScreen&&this.oCurrentSubScreen.viewModelDom&&(r.delegateRun(this.oCurrentSubScreen,"onHide"),this.oCurrentSubScreen.viewModelDom.hide())},i.prototype.onBuild=function(){n.each(a.aViewModels.settings,function(e){e&&e.__rlSettingsData&&!n.find(a.aViewModels["settings-removed"],function(t){return t&&t===e})&&this.menu.push({route:e.__rlSettingsData.Route,label:e.__rlSettingsData.Label,selected:s.observable(!1),disabled:!!n.find(a.aViewModels["settings-disabled"],function(t){return t&&t===e})})},this),this.oViewModelPlace=o("#rl-content #rl-settings-subscreen")},i.prototype.routes=function(){var e=n.find(a.aViewModels.settings,function(e){return e&&e.__rlSettingsData&&e.__rlSettingsData.IsDefault}),t=e?e.__rlSettingsData.Route:"general",i={subname:/^(.*)$/,normalize_:function(e,i){return i.subname=r.isUnd(i.subname)?t:r.pString(i.subname),[i.subname]}};return[["{subname}/",i],["{subname}",i],["",i]]},e.exports=i}(t,e)},{$:14,"App:Knoin":21,Globals:8,"Knoin:AbstractScreen":23,LinkBuilder:9,Utils:11,_:19,ko:16}],28:[function(e,t){!function(e,t){"use strict";function i(){o.call(this,"login",[t("View:Admin:Login")])}var n=t("_"),o=t("Knoin:AbstractScreen");n.extend(i.prototype,o.prototype),i.prototype.onShow=function(){t("App:Admin").setTitle("")},e.exports=i}(t,e)},{"App:Admin":3,"Knoin:AbstractScreen":23,"View:Admin:Login":46,_:19}],29:[function(e,t){!function(e,t){"use strict";function i(){o.call(this,[t("View:Admin:SettingsMenu"),t("View:Admin:SettingsPane")])}var n=t("_"),o=t("Screen:AbstractSettings");n.extend(i.prototype,o.prototype),i.prototype.onShow=function(){t("App:Admin").setTitle("")},e.exports=i}(t,e)},{"App:Admin":3,"Screen:AbstractSettings":27,"View:Admin:SettingsMenu":47,"View:Admin:SettingsPane":48,_:19}],30:[function(e,t){!function(e,t){"use strict";function i(){var e=t("Storage:Settings"),i=t("Storage:Admin:Data");this.version=n.observable(e.settingsGet("Version")),this.access=n.observable(!!e.settingsGet("CoreAccess")),this.errorDesc=n.observable(""),this.coreReal=i.coreReal,this.coreUpdatable=i.coreUpdatable,this.coreAccess=i.coreAccess,this.coreChecking=i.coreChecking,this.coreUpdating=i.coreUpdating,this.coreRemoteVersion=i.coreRemoteVersion,this.coreRemoteRelease=i.coreRemoteRelease,this.coreVersionCompare=i.coreVersionCompare,this.statusType=n.computed(function(){var e="",t=this.coreVersionCompare(),i=this.coreChecking(),n=this.coreUpdating(),o=this.coreReal();return i?e="checking":n?e="updating":o&&0===t?e="up-to-date":o&&-1===t?e="available":o||(e="error",this.errorDesc("Cannot access the repository at the moment.")),e},this)}var n=t("ko");i.prototype.onBuild=function(){this.access()&&t("App:Admin").reloadCoreData()},i.prototype.updateCoreData=function(){this.coreUpdating()||t("App:Admin").updateCoreData()},e.exports=i}(t,e)},{"App:Admin":3,"Storage:Admin:Data":43,"Storage:Settings":45,ko:16}],31:[function(e,t){!function(e,t){"use strict";function i(){var e=t("Enums"),i=t("Storage:Settings");this.title=o.observable(i.settingsGet("Title")),this.title.trigger=o.observable(e.SaveSettingsStep.Idle),this.loadingDesc=o.observable(i.settingsGet("LoadingDescription")),this.loadingDesc.trigger=o.observable(e.SaveSettingsStep.Idle),this.loginLogo=o.observable(i.settingsGet("LoginLogo")),this.loginLogo.trigger=o.observable(e.SaveSettingsStep.Idle),this.loginDescription=o.observable(i.settingsGet("LoginDescription")),this.loginDescription.trigger=o.observable(e.SaveSettingsStep.Idle),this.loginCss=o.observable(i.settingsGet("LoginCss")),this.loginCss.trigger=o.observable(e.SaveSettingsStep.Idle)}var n=t("_"),o=t("ko"),s=t("Utils");i.prototype.onBuild=function(){var e=this,i=t("Storage:Admin:Remote");n.delay(function(){var t=s.settingsSaveHelperSimpleFunction(e.title.trigger,e),n=s.settingsSaveHelperSimpleFunction(e.loadingDesc.trigger,e),o=s.settingsSaveHelperSimpleFunction(e.loginLogo.trigger,e),a=s.settingsSaveHelperSimpleFunction(e.loginDescription.trigger,e),r=s.settingsSaveHelperSimpleFunction(e.loginCss.trigger,e);e.title.subscribe(function(e){i.saveAdminConfig(t,{Title:s.trim(e)})}),e.loadingDesc.subscribe(function(e){i.saveAdminConfig(n,{LoadingDescription:s.trim(e)})}),e.loginLogo.subscribe(function(e){i.saveAdminConfig(o,{LoginLogo:s.trim(e)})}),e.loginDescription.subscribe(function(e){i.saveAdminConfig(a,{LoginDescription:s.trim(e)})}),e.loginCss.subscribe(function(e){i.saveAdminConfig(r,{LoginCss:s.trim(e)})})},50)},e.exports=i}(t,e)},{Enums:6,"Storage:Admin:Remote":44,"Storage:Settings":45,Utils:11,_:19,ko:16}],32:[function(e,t){!function(e,t){"use strict";function i(){var e=t("Storage:Admin:Remote");this.defautOptionsAfterRender=a.defautOptionsAfterRender,this.enableContacts=o.observable(!!r.settingsGet("ContactsEnable")),this.contactsSharing=o.observable(!!r.settingsGet("ContactsSharing")),this.contactsSync=o.observable(!!r.settingsGet("ContactsSync"));var i=["sqlite","mysql","pgsql"],l=[],c=function(e){switch(e){case"sqlite":e="SQLite";break;case"mysql":e="MySQL";break;case"pgsql":e="PostgreSQL"}return e};r.settingsGet("SQLiteIsSupported")&&l.push("sqlite"),r.settingsGet("MySqlIsSupported")&&l.push("mysql"),r.settingsGet("PostgreSqlIsSupported")&&l.push("pgsql"),this.contactsSupported=0<l.length,this.contactsTypes=o.observableArray([]),this.contactsTypesOptions=this.contactsTypes.map(function(e){var t=-1===a.inArray(e,l);return{id:e,name:c(e)+(t?" (not supported)":""),disabled:t}}),this.contactsTypes(i),this.contactsType=o.observable(""),this.mainContactsType=o.computed({owner:this,read:this.contactsType,write:function(e){e!==this.contactsType()?-1<a.inArray(e,l)?this.contactsType(e):0<l.length&&this.contactsType(""):this.contactsType.valueHasMutated()}}),this.contactsType.subscribe(function(){this.testContactsSuccess(!1),this.testContactsError(!1),this.testContactsErrorMessage("")},this),this.pdoDsn=o.observable(r.settingsGet("ContactsPdoDsn")),this.pdoUser=o.observable(r.settingsGet("ContactsPdoUser")),this.pdoPassword=o.observable(r.settingsGet("ContactsPdoPassword")),this.pdoDsnTrigger=o.observable(s.SaveSettingsStep.Idle),this.pdoUserTrigger=o.observable(s.SaveSettingsStep.Idle),this.pdoPasswordTrigger=o.observable(s.SaveSettingsStep.Idle),this.contactsTypeTrigger=o.observable(s.SaveSettingsStep.Idle),this.testing=o.observable(!1),this.testContactsSuccess=o.observable(!1),this.testContactsError=o.observable(!1),this.testContactsErrorMessage=o.observable(""),this.testContactsCommand=a.createCommand(this,function(){this.testContactsSuccess(!1),this.testContactsError(!1),this.testContactsErrorMessage(""),this.testing(!0),e.testContacts(this.onTestContactsResponse,{ContactsPdoType:this.contactsType(),ContactsPdoDsn:this.pdoDsn(),ContactsPdoUser:this.pdoUser(),ContactsPdoPassword:this.pdoPassword()})},function(){return""!==this.pdoDsn()&&""!==this.pdoUser()}),this.contactsType(r.settingsGet("ContactsPdoType")),this.onTestContactsResponse=n.bind(this.onTestContactsResponse,this)}var n=t("_"),o=t("ko"),s=t("Enums"),a=t("Utils"),r=t("Storage:Settings");i.prototype.onTestContactsResponse=function(e,t){this.testContactsSuccess(!1),this.testContactsError(!1),this.testContactsErrorMessage(""),s.StorageResultType.Success===e&&t&&t.Result&&t.Result.Result?this.testContactsSuccess(!0):(this.testContactsError(!0),this.testContactsErrorMessage(t&&t.Result?t.Result.Message||"":"")),this.testing(!1)},i.prototype.onShow=function(){this.testContactsSuccess(!1),this.testContactsError(!1),this.testContactsErrorMessage("")},i.prototype.onBuild=function(){var e=this,i=t("Storage:Admin:Remote");n.delay(function(){var t=a.settingsSaveHelperSimpleFunction(e.pdoDsnTrigger,e),n=a.settingsSaveHelperSimpleFunction(e.pdoUserTrigger,e),o=a.settingsSaveHelperSimpleFunction(e.pdoPasswordTrigger,e),s=a.settingsSaveHelperSimpleFunction(e.contactsTypeTrigger,e);e.enableContacts.subscribe(function(e){i.saveAdminConfig(null,{ContactsEnable:e?"1":"0"})}),e.contactsSharing.subscribe(function(e){i.saveAdminConfig(null,{ContactsSharing:e?"1":"0"})}),e.contactsSync.subscribe(function(e){i.saveAdminConfig(null,{ContactsSync:e?"1":"0"})}),e.contactsType.subscribe(function(e){i.saveAdminConfig(s,{ContactsPdoType:e})}),e.pdoDsn.subscribe(function(e){i.saveAdminConfig(t,{ContactsPdoDsn:a.trim(e)})}),e.pdoUser.subscribe(function(e){i.saveAdminConfig(n,{ContactsPdoUser:a.trim(e)})}),e.pdoPassword.subscribe(function(e){i.saveAdminConfig(o,{ContactsPdoPassword:a.trim(e)})}),e.contactsType(r.settingsGet("ContactsPdoType"))},50)},e.exports=i}(t,e)},{Enums:6,"Storage:Admin:Remote":44,"Storage:Settings":45,Utils:11,_:19,ko:16}],33:[function(e,t){!function(e,t){"use strict";function i(){this.domains=l.domains,this.domainsLoading=l.domainsLoading,this.iDomainForDeletionTimeout=0,this.visibility=s.computed(function(){return l.domainsLoading()?"visible":"hidden"},this),this.domainForDeletion=s.observable(null).extend({toggleSubscribe:[this,function(e){e&&e.deleteAccess(!1)},function(e){e&&(e.deleteAccess(!0),this.startDomainForDeletionTimeout())}]})}var n=t("window"),o=t("_"),s=t("ko"),a=t("Enums"),r=t("View:Popup:Domain"),l=t("Storage:Admin:Data"),c=t("Storage:Admin:Remote");i.prototype.startDomainForDeletionTimeout=function(){var e=this;n.clearInterval(this.iDomainForDeletionTimeout),this.iDomainForDeletionTimeout=n.setTimeout(function(){e.domainForDeletion(null)},3e3)},i.prototype.createDomain=function(){t("App:Knoin").showScreenPopup(r)},i.prototype.deleteDomain=function(e){this.domains.remove(e),c.domainDelete(o.bind(this.onDomainListChangeRequest,this),e.name)},i.prototype.disableDomain=function(e){e.disabled(!e.disabled()),c.domainDisable(o.bind(this.onDomainListChangeRequest,this),e.name,e.disabled())},i.prototype.onBuild=function(e){var i=this;e.on("click",".b-admin-domains-list-table .e-item .e-action",function(){var e=s.dataFor(this);e&&c.domain(o.bind(i.onDomainLoadRequest,i),e.name)}),t("App:Admin").reloadDomainList()},i.prototype.onDomainLoadRequest=function(e,i){a.StorageResultType.Success===e&&i&&i.Result&&t("App:Knoin").showScreenPopup(r,[i.Result])},i.prototype.onDomainListChangeRequest=function(){t("App:Admin").reloadDomainList()},e.exports=i}(t,e)},{"App:Admin":3,"App:Knoin":21,Enums:6,"Storage:Admin:Data":43,"Storage:Admin:Remote":44,"View:Popup:Domain":51,_:19,ko:16,window:20}],34:[function(e,t){!function(e,t){"use strict";function i(){this.mainLanguage=c.mainLanguage,this.mainTheme=c.mainTheme,this.language=c.language,this.theme=c.theme,this.allowLanguagesOnSettings=c.allowLanguagesOnSettings,this.capaThemes=c.capaThemes,this.capaGravatar=c.capaGravatar,this.capaAdditionalAccounts=c.capaAdditionalAccounts,this.capaAdditionalIdentities=c.capaAdditionalIdentities,this.mainAttachmentLimit=o.observable(a.pInt(l.settingsGet("AttachmentLimit"))/1048576).extend({posInterer:25}),this.uploadData=l.settingsGet("PhpUploadSizes"),this.uploadDataDesc=this.uploadData&&(this.uploadData.upload_max_filesize||this.uploadData.post_max_size)?[this.uploadData.upload_max_filesize?"upload_max_filesize = "+this.uploadData.upload_max_filesize+"; ":"",this.uploadData.post_max_size?"post_max_size = "+this.uploadData.post_max_size:""].join(""):"",this.themesOptions=o.computed(function(){return n.map(c.themes(),function(e){return{optValue:e,optText:a.convertThemeName(e)}})}),this.mainLanguageFullName=o.computed(function(){return a.convertLangName(this.mainLanguage())},this),this.weakPassword=!!l.settingsGet("WeakPassword"),this.attachmentLimitTrigger=o.observable(s.SaveSettingsStep.Idle),this.languageTrigger=o.observable(s.SaveSettingsStep.Idle),this.themeTrigger=o.observable(s.SaveSettingsStep.Idle)}var n=t("_"),o=t("ko"),s=t("Enums"),a=t("Utils"),r=t("LinkBuilder"),l=t("Storage:Settings"),c=t("Storage:Admin:Data");i.prototype.onBuild=function(){var e=this,i=t("Storage:Admin:Remote");n.delay(function(){var t=a.settingsSaveHelperSimpleFunction(e.attachmentLimitTrigger,e),n=a.settingsSaveHelperSimpleFunction(e.languageTrigger,e),o=a.settingsSaveHelperSimpleFunction(e.themeTrigger,e);e.mainAttachmentLimit.subscribe(function(e){i.saveAdminConfig(t,{AttachmentLimit:a.pInt(e)})}),e.language.subscribe(function(e){i.saveAdminConfig(n,{Language:a.trim(e)})}),e.theme.subscribe(function(e){i.saveAdminConfig(o,{Theme:a.trim(e)})}),e.capaAdditionalAccounts.subscribe(function(e){i.saveAdminConfig(null,{CapaAdditionalAccounts:e?"1":"0"})}),e.capaAdditionalIdentities.subscribe(function(e){i.saveAdminConfig(null,{CapaAdditionalIdentities:e?"1":"0"})}),e.capaGravatar.subscribe(function(e){i.saveAdminConfig(null,{CapaGravatar:e?"1":"0"})}),e.capaThemes.subscribe(function(e){i.saveAdminConfig(null,{CapaThemes:e?"1":"0"})}),e.allowLanguagesOnSettings.subscribe(function(e){i.saveAdminConfig(null,{AllowLanguagesOnSettings:e?"1":"0"})})},50)},i.prototype.selectLanguage=function(){t("App:Knoin").showScreenPopup(t("View:Popup:Languages"))},i.prototype.phpInfoLink=function(){return r.phpInfo()},e.exports=i}(t,e)},{"App:Knoin":21,Enums:6,LinkBuilder:9,"Storage:Admin:Data":43,"Storage:Admin:Remote":44,"Storage:Settings":45,Utils:11,"View:Popup:Languages":52,_:19,ko:16}],35:[function(e,t){!function(e,t){"use strict";function i(){this.licensing=a.licensing,this.licensingProcess=a.licensingProcess,this.licenseValid=a.licenseValid,this.licenseExpired=a.licenseExpired,this.licenseError=a.licenseError,this.licenseTrigger=a.licenseTrigger,this.adminDomain=n.observable(""),this.subscriptionEnabled=n.observable(!!s.settingsGet("SubscriptionEnabled")),this.licenseTrigger.subscribe(function(){this.subscriptionEnabled()&&t("App:Admin").reloadLicensing(!0)},this)}var n=t("ko"),o=t("moment"),s=t("Storage:Settings"),a=t("Storage:Admin:Data");i.prototype.onBuild=function(){this.subscriptionEnabled()&&t("App:Admin").reloadLicensing(!1)},i.prototype.onShow=function(){this.adminDomain(s.settingsGet("AdminDomain"))},i.prototype.showActivationForm=function(){t("App:Knoin").showScreenPopup(t("View:Popup:Activate"))},i.prototype.licenseExpiredMomentValue=function(){var e=this.licenseExpired(),t=o.unix(e);return e&&1898625600===e?"Never":t.format("LL")+" ("+t.from(o())+")"},e.exports=i}(t,e)},{"App:Admin":3,"App:Knoin":21,"Storage:Admin:Data":43,"Storage:Settings":45,"View:Popup:Activate":49,ko:16,moment:17}],36:[function(e,t){!function(e,t){"use strict";function i(){this.determineUserLanguage=l.determineUserLanguage,this.determineUserDomain=l.determineUserDomain,this.defaultDomain=o.observable(r.settingsGet("LoginDefaultDomain")),this.allowLanguagesOnLogin=l.allowLanguagesOnLogin,this.defaultDomainTrigger=o.observable(s.SaveSettingsStep.Idle)}var n=t("_"),o=t("ko"),s=t("Enums"),a=t("Utils"),r=t("Storage:Settings"),l=t("Storage:Admin:Data");i.prototype.onBuild=function(){var e=this,i=t("Storage:Admin:Remote");n.delay(function(){var t=a.settingsSaveHelperSimpleFunction(e.defaultDomainTrigger,e);e.determineUserLanguage.subscribe(function(e){i.saveAdminConfig(null,{DetermineUserLanguage:e?"1":"0"})}),e.determineUserDomain.subscribe(function(e){i.saveAdminConfig(null,{DetermineUserDomain:e?"1":"0"})}),e.allowLanguagesOnLogin.subscribe(function(e){i.saveAdminConfig(null,{AllowLanguagesOnLogin:e?"1":"0"})}),e.defaultDomain.subscribe(function(e){i.saveAdminConfig(t,{LoginDefaultDomain:a.trim(e)})})},50)},e.exports=i}(t,e)},{Enums:6,"Storage:Admin:Data":43,"Storage:Admin:Remote":44,"Storage:Settings":45,Utils:11,_:19,ko:16}],37:[function(e,t){!function(e,t){"use strict";function i(){this.packagesError=o.observable(""),this.packages=r.packages,this.packagesLoading=r.packagesLoading,this.packagesReal=r.packagesReal,this.packagesMainUpdatable=r.packagesMainUpdatable,this.packagesCurrent=this.packages.filter(function(e){return e&&""!==e.installed&&!e.compare}),this.packagesAvailableForUpdate=this.packages.filter(function(e){return e&&""!==e.installed&&!!e.compare}),this.packagesAvailableForInstallation=this.packages.filter(function(e){return e&&""===e.installed}),this.visibility=o.computed(function(){return r.packagesLoading()?"visible":"hidden"},this)}var n=t("window"),o=t("ko"),s=t("Enums"),a=t("Utils"),r=t("Storage:Admin:Data"),l=t("Storage:Admin:Remote");i.prototype.onShow=function(){this.packagesError("")},i.prototype.onBuild=function(){t("App:Admin").reloadPackagesList()},i.prototype.requestHelper=function(e,i){var o=this;return function(l,c){s.StorageResultType.Success===l&&c&&c.Result||o.packagesError(c&&c.ErrorCode?a.getNotification(c.ErrorCode):a.getNotification(i?s.Notification.CantInstallPackage:s.Notification.CantDeletePackage)),_.each(r.packages(),function(t){t&&e&&t.loading()&&e.file===t.file&&(e.loading(!1),t.loading(!1))}),s.StorageResultType.Success===l&&c&&c.Result&&c.Result.Reload?n.location.reload():t("App:Admin").reloadPackagesList()}},i.prototype.deletePackage=function(e){e&&(e.loading(!0),l.packageDelete(this.requestHelper(e,!1),e))},i.prototype.installPackage=function(e){e&&(e.loading(!0),l.packageInstall(this.requestHelper(e,!0),e))},e.exports=i}(t,e)},{"App:Admin":3,Enums:6,"Storage:Admin:Data":43,"Storage:Admin:Remote":44,Utils:11,ko:16,window:20}],38:[function(e,t){!function(e,t){"use strict";function i(){this.enabledPlugins=o.observable(!!r.settingsGet("EnabledPlugins")),this.pluginsError=o.observable(""),this.plugins=l.plugins,this.pluginsLoading=l.pluginsLoading,this.visibility=o.computed(function(){return l.pluginsLoading()?"visible":"hidden"},this),this.onPluginLoadRequest=n.bind(this.onPluginLoadRequest,this),this.onPluginDisableRequest=n.bind(this.onPluginDisableRequest,this)}var n=t("_"),o=t("ko"),s=t("Enums"),a=t("Utils"),r=t("Storage:Settings"),l=t("Storage:Admin:Data"),c=t("Storage:Admin:Remote");i.prototype.disablePlugin=function(e){e.disabled(!e.disabled()),c.pluginDisable(this.onPluginDisableRequest,e.name,e.disabled())},i.prototype.configurePlugin=function(e){c.plugin(this.onPluginLoadRequest,e.name)},i.prototype.onBuild=function(e){var t=this;e.on("click",".e-item .configure-plugin-action",function(){var e=o.dataFor(this);e&&t.configurePlugin(e)}).on("click",".e-item .disabled-plugin",function(){var e=o.dataFor(this);e&&t.disablePlugin(e)}),this.enabledPlugins.subscribe(function(e){c.saveAdminConfig(a.emptyFunction,{EnabledPlugins:e?"1":"0"})})},i.prototype.onShow=function(){this.pluginsError(""),t("App:Admin").reloadPluginList()},i.prototype.onPluginLoadRequest=function(e,i){s.StorageResultType.Success===e&&i&&i.Result&&t("App:Knoin").showScreenPopup(t("View:Popup:Plugin"),[i.Result])},i.prototype.onPluginDisableRequest=function(e,i){s.StorageResultType.Success===e&&i&&!i.Result&&i.ErrorCode&&this.pluginsError(s.Notification.UnsupportedPluginPackage===i.ErrorCode&&i.ErrorMessage&&""!==i.ErrorMessage?i.ErrorMessage:a.getNotification(i.ErrorCode)),t("App:Admin").reloadPluginList()},e.exports=i}(t,e)},{"App:Admin":3,"App:Knoin":21,Enums:6,"Storage:Admin:Data":43,"Storage:Admin:Remote":44,"Storage:Settings":45,Utils:11,"View:Popup:Plugin":53,_:19,ko:16}],39:[function(e,t){!function(e,t){"use strict";function i(){this.useLocalProxyForExternalImages=c.useLocalProxyForExternalImages,this.capaOpenPGP=o.observable(l.capa(s.Capa.OpenPGP)),this.capaTwoFactorAuth=o.observable(l.capa(s.Capa.TwoFactor)),this.adminLogin=o.observable(l.settingsGet("AdminLogin")),this.adminPassword=o.observable(""),this.adminPasswordNew=o.observable(""),this.adminPasswordNew2=o.observable(""),this.adminPasswordNewError=o.observable(!1),this.adminPasswordUpdateError=o.observable(!1),this.adminPasswordUpdateSuccess=o.observable(!1),this.adminPassword.subscribe(function(){this.adminPasswordUpdateError(!1),this.adminPasswordUpdateSuccess(!1)},this),this.adminPasswordNew.subscribe(function(){this.adminPasswordUpdateError(!1),this.adminPasswordUpdateSuccess(!1),this.adminPasswordNewError(!1)},this),this.adminPasswordNew2.subscribe(function(){this.adminPasswordUpdateError(!1),this.adminPasswordUpdateSuccess(!1),this.adminPasswordNewError(!1)},this),this.saveNewAdminPasswordCommand=a.createCommand(this,function(){return this.adminPasswordNew()!==this.adminPasswordNew2()?(this.adminPasswordNewError(!0),!1):(this.adminPasswordUpdateError(!1),this.adminPasswordUpdateSuccess(!1),void u.saveNewAdminPassword(this.onNewAdminPasswordResponse,{Password:this.adminPassword(),NewPassword:this.adminPasswordNew()}))},function(){return""!==this.adminPassword()&&""!==this.adminPasswordNew()&&""!==this.adminPasswordNew2()}),this.onNewAdminPasswordResponse=n.bind(this.onNewAdminPasswordResponse,this)}var n=t("_"),o=t("ko"),s=t("Enums"),a=t("Utils"),r=t("LinkBuilder"),l=t("Storage:Settings"),c=t("Storage:Admin:Data"),u=t("Storage:Admin:Remote");i.prototype.onNewAdminPasswordResponse=function(e,t){s.StorageResultType.Success===e&&t&&t.Result?(this.adminPassword(""),this.adminPasswordNew(""),this.adminPasswordNew2(""),this.adminPasswordUpdateSuccess(!0)):this.adminPasswordUpdateError(!0)},i.prototype.onBuild=function(){var e=t("Storage:Admin:Remote");this.capaOpenPGP.subscribe(function(t){e.saveAdminConfig(a.emptyFunction,{CapaOpenPGP:t?"1":"0"})}),this.capaTwoFactorAuth.subscribe(function(t){e.saveAdminConfig(a.emptyFunction,{CapaTwoFactorAuth:t?"1":"0"})}),this.useLocalProxyForExternalImages.subscribe(function(t){e.saveAdminConfig(null,{UseLocalProxyForExternalImages:t?"1":"0"})})},i.prototype.onHide=function(){this.adminPassword(""),this.adminPasswordNew(""),this.adminPasswordNew2("")},i.prototype.phpInfoLink=function(){return r.phpInfo()},e.exports=i}(t,e)},{Enums:6,LinkBuilder:9,"Storage:Admin:Data":43,"Storage:Admin:Remote":44,"Storage:Settings":45,Utils:11,_:19,ko:16}],40:[function(e,t){!function(e,t){"use strict";function i(){var e=t("Storage:Admin:Data");this.googleEnable=e.googleEnable,this.googleClientID=e.googleClientID,this.googleApiKey=e.googleApiKey,this.googleClientSecret=e.googleClientSecret,this.googleTrigger1=o.observable(s.SaveSettingsStep.Idle),this.googleTrigger2=o.observable(s.SaveSettingsStep.Idle),this.googleTrigger3=o.observable(s.SaveSettingsStep.Idle),this.facebookSupported=e.facebookSupported,this.facebookEnable=e.facebookEnable,this.facebookAppID=e.facebookAppID,this.facebookAppSecret=e.facebookAppSecret,this.facebookTrigger1=o.observable(s.SaveSettingsStep.Idle),this.facebookTrigger2=o.observable(s.SaveSettingsStep.Idle),this.twitterEnable=e.twitterEnable,this.twitterConsumerKey=e.twitterConsumerKey,this.twitterConsumerSecret=e.twitterConsumerSecret,this.twitterTrigger1=o.observable(s.SaveSettingsStep.Idle),this.twitterTrigger2=o.observable(s.SaveSettingsStep.Idle),this.dropboxEnable=e.dropboxEnable,this.dropboxApiKey=e.dropboxApiKey,this.dropboxTrigger1=o.observable(s.SaveSettingsStep.Idle)}var n=t("_"),o=t("ko"),s=t("Enums"),a=t("Utils");i.prototype.onBuild=function(){var e=this,i=t("Storage:Admin:Remote");n.delay(function(){var t=a.settingsSaveHelperSimpleFunction(e.facebookTrigger1,e),n=a.settingsSaveHelperSimpleFunction(e.facebookTrigger2,e),o=a.settingsSaveHelperSimpleFunction(e.twitterTrigger1,e),s=a.settingsSaveHelperSimpleFunction(e.twitterTrigger2,e),r=a.settingsSaveHelperSimpleFunction(e.googleTrigger1,e),l=a.settingsSaveHelperSimpleFunction(e.googleTrigger2,e),c=a.settingsSaveHelperSimpleFunction(e.googleTrigger3,e),u=a.settingsSaveHelperSimpleFunction(e.dropboxTrigger1,e);e.facebookEnable.subscribe(function(t){e.facebookSupported()&&i.saveAdminConfig(a.emptyFunction,{FacebookEnable:t?"1":"0"})}),e.facebookAppID.subscribe(function(n){e.facebookSupported()&&i.saveAdminConfig(t,{FacebookAppID:a.trim(n)})}),e.facebookAppSecret.subscribe(function(t){e.facebookSupported()&&i.saveAdminConfig(n,{FacebookAppSecret:a.trim(t)})}),e.twitterEnable.subscribe(function(e){i.saveAdminConfig(a.emptyFunction,{TwitterEnable:e?"1":"0"})}),e.twitterConsumerKey.subscribe(function(e){i.saveAdminConfig(o,{TwitterConsumerKey:a.trim(e)})}),e.twitterConsumerSecret.subscribe(function(e){i.saveAdminConfig(s,{TwitterConsumerSecret:a.trim(e)})}),e.googleEnable.subscribe(function(e){i.saveAdminConfig(a.emptyFunction,{GoogleEnable:e?"1":"0"})}),e.googleClientID.subscribe(function(e){i.saveAdminConfig(r,{GoogleClientID:a.trim(e)})}),e.googleClientSecret.subscribe(function(e){i.saveAdminConfig(l,{GoogleClientSecret:a.trim(e)})}),e.googleApiKey.subscribe(function(e){i.saveAdminConfig(c,{GoogleApiKey:a.trim(e)})}),e.dropboxEnable.subscribe(function(e){i.saveAdminConfig(a.emptyFunction,{DropboxEnable:e?"1":"0"})}),e.dropboxApiKey.subscribe(function(e){i.saveAdminConfig(u,{DropboxApiKey:a.trim(e)})})},50)},e.exports=i}(t,e)},{Enums:6,"Storage:Admin:Data":43,"Storage:Admin:Remote":44,Utils:11,_:19,ko:16}],41:[function(e,t){!function(e,t){"use strict";function i(){o.initDataConstructorBySettings(this)}var n=t("Enums"),o=t("Utils"),s=t("Storage:Settings");i.prototype.populateDataOnStart=function(){var e=o.pInt(s.settingsGet("Layout")),t=s.settingsGet("Languages"),i=s.settingsGet("Themes");o.isArray(t)&&this.languages(t),o.isArray(i)&&this.themes(i),this.mainLanguage(s.settingsGet("Language")),this.mainTheme(s.settingsGet("Theme")),this.capaAdditionalAccounts(s.capa(n.Capa.AdditionalAccounts)),this.capaAdditionalIdentities(s.capa(n.Capa.AdditionalIdentities)),this.capaGravatar(s.capa(n.Capa.Gravatar)),this.determineUserLanguage(!!s.settingsGet("DetermineUserLanguage")),this.determineUserDomain(!!s.settingsGet("DetermineUserDomain")),this.capaThemes(s.capa(n.Capa.Themes)),this.allowLanguagesOnLogin(!!s.settingsGet("AllowLanguagesOnLogin")),this.allowLanguagesOnSettings(!!s.settingsGet("AllowLanguagesOnSettings")),this.useLocalProxyForExternalImages(!!s.settingsGet("UseLocalProxyForExternalImages")),this.editorDefaultType(s.settingsGet("EditorDefaultType")),this.showImages(!!s.settingsGet("ShowImages")),this.contactsAutosave(!!s.settingsGet("ContactsAutosave")),this.interfaceAnimation(s.settingsGet("InterfaceAnimation")),this.mainMessagesPerPage(s.settingsGet("MPP")),this.desktopNotifications(!!s.settingsGet("DesktopNotifications")),this.useThreads(!!s.settingsGet("UseThreads")),this.replySameFolder(!!s.settingsGet("ReplySameFolder")),this.useCheckboxesInList(!!s.settingsGet("UseCheckboxesInList")),this.layout(n.Layout.SidePreview),-1<o.inArray(e,[n.Layout.NoPreview,n.Layout.SidePreview,n.Layout.BottomPreview])&&this.layout(e),this.facebookSupported(!!s.settingsGet("SupportedFacebookSocial")),this.facebookEnable(!!s.settingsGet("AllowFacebookSocial")),this.facebookAppID(s.settingsGet("FacebookAppID")),this.facebookAppSecret(s.settingsGet("FacebookAppSecret")),this.twitterEnable(!!s.settingsGet("AllowTwitterSocial")),this.twitterConsumerKey(s.settingsGet("TwitterConsumerKey")),this.twitterConsumerSecret(s.settingsGet("TwitterConsumerSecret")),this.googleEnable(!!s.settingsGet("AllowGoogleSocial")),this.googleClientID(s.settingsGet("GoogleClientID")),this.googleClientSecret(s.settingsGet("GoogleClientSecret")),this.googleApiKey(s.settingsGet("GoogleApiKey")),this.dropboxEnable(!!s.settingsGet("AllowDropboxSocial")),this.dropboxApiKey(s.settingsGet("DropboxApiKey")),this.contactsIsAllowed(!!s.settingsGet("ContactsIsAllowed"))
|
||
},e.exports=i}(t,e)},{Enums:6,"Storage:Settings":45,Utils:11}],42:[function(e,t){!function(e,t){"use strict";function i(){this.oRequests={}}var n=t("window"),o=t("_"),s=t("$"),a=t("Consts"),r=t("Enums"),l=t("Globals"),c=t("Utils"),u=t("Plugins"),p=t("LinkBuilder"),d=t("Storage:Settings");i.prototype.oRequests={},i.prototype.defaultResponse=function(e,t,i,s,p,d){var g=function(){r.StorageResultType.Success!==i&&l.bUnload&&(i=r.StorageResultType.Unload),r.StorageResultType.Success===i&&s&&!s.Result?(s&&-1<c.inArray(s.ErrorCode,[r.Notification.AuthError,r.Notification.AccessError,r.Notification.ConnectionError,r.Notification.DomainNotAllowed,r.Notification.AccountNotAllowed,r.Notification.MailServerError,r.Notification.UnknownNotification,r.Notification.UnknownError])&&l.iAjaxErrorCount++,s&&r.Notification.InvalidToken===s.ErrorCode&&l.iTokenErrorCount++,a.Values.TokenErrorLimit<l.iTokenErrorCount&&l.__APP&&l.__APP.loginAndLogoutReload(!0),(s.Logout||a.Values.AjaxErrorLimit<l.iAjaxErrorCount)&&(n.__rlah_clear&&n.__rlah_clear(),l.__APP&&l.__APP.loginAndLogoutReload(!0))):r.StorageResultType.Success===i&&s&&s.Result&&(l.iAjaxErrorCount=0,l.iTokenErrorCount=0),e&&(u.runHook("ajax-default-response",[t,r.StorageResultType.Success===i?s:null,i,p,d]),e(i,r.StorageResultType.Success===i?s:null,p,t,d))};switch(i){case"success":i=r.StorageResultType.Success;break;case"abort":i=r.StorageResultType.Abort;break;default:i=r.StorageResultType.Error}r.StorageResultType.Error===i?o.delay(g,300):g()},i.prototype.ajaxRequest=function(e,t,i,a,r){var l=this,u=""===a,g={},m=(new n.Date).getTime(),h=null,f="";return t=t||{},i=c.isNormal(i)?i:2e4,a=c.isUnd(a)?"":c.pString(a),r=c.isArray(r)?r:[],f=t.Action||"",f&&0<r.length&&o.each(r,function(e){l.oRequests[e]&&(l.oRequests[e].__aborted=!0,l.oRequests[e].abort&&l.oRequests[e].abort(),l.oRequests[e]=null)}),u&&(t.XToken=d.settingsGet("Token")),h=s.ajax({type:u?"POST":"GET",url:p.ajax(a),async:!0,dataType:"json",data:u?t:{},headers:g,timeout:i,global:!0}),h.always(function(i,o){var s=!1;i&&i.Time&&(s=c.pInt(i.Time)>(new n.Date).getTime()-m),f&&l.oRequests[f]&&(l.oRequests[f].__aborted&&(o="abort"),l.oRequests[f]=null),l.defaultResponse(e,f,o,i,s,t)}),f&&0<r.length&&-1<c.inArray(f,r)&&(this.oRequests[f]&&(this.oRequests[f].__aborted=!0,this.oRequests[f].abort&&this.oRequests[f].abort(),this.oRequests[f]=null),this.oRequests[f]=h),h},i.prototype.defaultRequest=function(e,t,i,n,o,s){i=i||{},i.Action=t,o=c.pString(o),u.runHook("ajax-default-request",[t,i,o]),this.ajaxRequest(e,i,c.isUnd(n)?a.Defaults.DefaultAjaxTimeout:c.pInt(n),o,s)},i.prototype.noop=function(e){this.defaultRequest(e,"Noop")},i.prototype.jsError=function(e,t,i,n,o,s,a){this.defaultRequest(e,"JsError",{Message:t,FileName:i,LineNo:n,Location:o,HtmlCapa:s,TimeOnPage:a})},i.prototype.jsInfo=function(e,t,i,n){this.defaultRequest(e,"JsInfo",{Type:t,Data:i,IsError:(c.isUnd(n)?1:!n)?"0":"1"})},i.prototype.getPublicKey=function(e){this.defaultRequest(e,"GetPublicKey")},i.prototype.jsVersion=function(e,t){this.defaultRequest(e,"Version",{Version:t})},e.exports=i}(t,e)},{$:14,Consts:5,Enums:6,Globals:8,LinkBuilder:9,Plugins:10,"Storage:Settings":45,Utils:11,_:19,window:20}],43:[function(e,t){!function(e,t){"use strict";function i(){s.call(this),this.domainsLoading=o.observable(!1).extend({throttle:100}),this.domains=o.observableArray([]),this.pluginsLoading=o.observable(!1).extend({throttle:100}),this.plugins=o.observableArray([]),this.packagesReal=o.observable(!0),this.packagesMainUpdatable=o.observable(!0),this.packagesLoading=o.observable(!1).extend({throttle:100}),this.packages=o.observableArray([]),this.coreReal=o.observable(!0),this.coreUpdatable=o.observable(!0),this.coreAccess=o.observable(!0),this.coreChecking=o.observable(!1).extend({throttle:100}),this.coreUpdating=o.observable(!1).extend({throttle:100}),this.coreRemoteVersion=o.observable(""),this.coreRemoteRelease=o.observable(""),this.coreVersionCompare=o.observable(-2),this.licensing=o.observable(!1),this.licensingProcess=o.observable(!1),this.licenseValid=o.observable(!1),this.licenseExpired=o.observable(0),this.licenseError=o.observable(""),this.licenseTrigger=o.observable(!1),this.adminManLoading=o.computed(function(){return"000"!==[this.domainsLoading()?"1":"0",this.pluginsLoading()?"1":"0",this.packagesLoading()?"1":"0"].join("")},this),this.adminManLoadingVisibility=o.computed(function(){return this.adminManLoading()?"visible":"hidden"},this).extend({rateLimit:300})}var n=t("_"),o=t("ko"),s=t("Storage:Abstract:Data");n.extend(i.prototype,s.prototype),i.prototype.populateDataOnStart=function(){s.prototype.populateDataOnStart.call(this)},e.exports=new i}(t,e)},{"Storage:Abstract:Data":41,_:19,ko:16}],44:[function(e,t){!function(e,t){"use strict";function i(){o.call(this),this.oRequests={}}var n=t("_"),o=t("Storage:Abstract:Remote");n.extend(i.prototype,o.prototype),i.prototype.adminLogin=function(e,t,i){this.defaultRequest(e,"AdminLogin",{Login:t,Password:i})},i.prototype.adminLogout=function(e){this.defaultRequest(e,"AdminLogout")},i.prototype.saveAdminConfig=function(e,t){this.defaultRequest(e,"AdminSettingsUpdate",t)},i.prototype.domainList=function(e){this.defaultRequest(e,"AdminDomainList")},i.prototype.pluginList=function(e){this.defaultRequest(e,"AdminPluginList")},i.prototype.packagesList=function(e){this.defaultRequest(e,"AdminPackagesList")},i.prototype.coreData=function(e){this.defaultRequest(e,"AdminCoreData")},i.prototype.updateCoreData=function(e){this.defaultRequest(e,"AdminUpdateCoreData",{},9e4)},i.prototype.packageInstall=function(e,t){this.defaultRequest(e,"AdminPackageInstall",{Id:t.id,Type:t.type,File:t.file},6e4)},i.prototype.packageDelete=function(e,t){this.defaultRequest(e,"AdminPackageDelete",{Id:t.id})},i.prototype.domain=function(e,t){this.defaultRequest(e,"AdminDomainLoad",{Name:t})},i.prototype.plugin=function(e,t){this.defaultRequest(e,"AdminPluginLoad",{Name:t})},i.prototype.domainDelete=function(e,t){this.defaultRequest(e,"AdminDomainDelete",{Name:t})},i.prototype.domainDisable=function(e,t,i){return this.defaultRequest(e,"AdminDomainDisable",{Name:t,Disabled:i?"1":"0"})},i.prototype.pluginSettingsUpdate=function(e,t){return this.defaultRequest(e,"AdminPluginSettingsUpdate",t)},i.prototype.licensing=function(e,t){return this.defaultRequest(e,"AdminLicensing",{Force:t?"1":"0"})},i.prototype.licensingActivate=function(e,t,i){return this.defaultRequest(e,"AdminLicensingActivate",{Domain:t,Key:i})},i.prototype.pluginDisable=function(e,t,i){return this.defaultRequest(e,"AdminPluginDisable",{Name:t,Disabled:i?"1":"0"})},i.prototype.createOrUpdateDomain=function(e,t,i,n,o,s,a,r,l,c,u,p,d){this.defaultRequest(e,"AdminDomainSave",{Create:t?"1":"0",Name:i,IncHost:n,IncPort:o,IncSecure:s,IncShortLogin:a?"1":"0",OutHost:r,OutPort:l,OutSecure:c,OutShortLogin:u?"1":"0",OutAuth:p?"1":"0",WhiteList:d})},i.prototype.testConnectionForDomain=function(e,t,i,n,o,s,a,r,l){this.defaultRequest(e,"AdminDomainTest",{Name:t,IncHost:i,IncPort:n,IncSecure:o,OutHost:s,OutPort:a,OutSecure:r,OutAuth:l?"1":"0"})},i.prototype.testContacts=function(e,t){this.defaultRequest(e,"AdminContactsTest",t)},i.prototype.saveNewAdminPassword=function(e,t){this.defaultRequest(e,"AdminPasswordUpdate",t)},i.prototype.adminPing=function(e){this.defaultRequest(e,"AdminPing")},e.exports=new i}(t,e)},{"Storage:Abstract:Remote":42,_:19}],45:[function(e,t){!function(e,t){"use strict";function i(){this.oSettings=n.rainloopAppData||{},this.oSettings=o.isNormal(this.oSettings)?this.oSettings:{}}var n=t("window"),o=t("Utils");i.prototype.oSettings=null,i.prototype.settingsGet=function(e){return o.isUnd(this.oSettings[e])?null:this.oSettings[e]},i.prototype.settingsSet=function(e,t){this.oSettings[e]=t},i.prototype.capa=function(e){var t=this.settingsGet("Capa");return o.isArray(t)&&o.isNormal(e)&&-1<o.inArray(e,t)},e.exports=new i}(t,e)},{Utils:11,window:20}],46:[function(e,t){!function(e,t){"use strict";function i(){c.call(this,"Center","AdminLogin"),this.login=o.observable(""),this.password=o.observable(""),this.loginError=o.observable(!1),this.passwordError=o.observable(!1),this.loginFocus=o.observable(!1),this.login.subscribe(function(){this.loginError(!1)},this),this.password.subscribe(function(){this.passwordError(!1)},this),this.submitRequest=o.observable(!1),this.submitError=o.observable(""),this.submitCommand=a.createCommand(this,function(){return a.triggerAutocompleteInputChange(),this.loginError(""===a.trim(this.login())),this.passwordError(""===a.trim(this.password())),this.loginError()||this.passwordError()?!1:(this.submitRequest(!0),r.adminLogin(n.bind(function(e,i){s.StorageResultType.Success===e&&i&&"AdminLogin"===i.Action?i.Result?t("App:Admin").loginAndLogoutReload():i.ErrorCode&&(this.submitRequest(!1),this.submitError(a.getNotification(i.ErrorCode))):(this.submitRequest(!1),this.submitError(a.getNotification(s.Notification.UnknownError)))},this),this.login(),this.password()),!0)},function(){return!this.submitRequest()}),l.constructorEnd(this)}var n=t("_"),o=t("ko"),s=t("Enums"),a=t("Utils"),r=t("Storage:Admin:Remote"),l=t("App:Knoin"),c=t("Knoin:AbstractViewModel");l.extendAsViewModel(["View:Admin:Login","AdminLoginViewModel"],i),n.extend(i.prototype,c.prototype),i.prototype.onShow=function(){l.routeOff(),n.delay(n.bind(function(){this.loginFocus(!0)},this),100)},i.prototype.onHide=function(){this.loginFocus(!1)},i.prototype.onBuild=function(){a.triggerAutocompleteInputChange(!0)},i.prototype.submitForm=function(){this.submitCommand()},e.exports=i}(t,e)},{"App:Admin":3,"App:Knoin":21,Enums:6,"Knoin:AbstractViewModel":24,"Storage:Admin:Remote":44,Utils:11,_:19,ko:16}],47:[function(e,t){!function(e,t){"use strict";function i(e){a.call(this,"Left","AdminMenu"),this.leftPanelDisabled=o.leftPanelDisabled,this.menu=e.menu,s.constructorEnd(this)}var n=t("_"),o=t("Globals"),s=t("App:Knoin"),a=t("Knoin:AbstractViewModel");s.extendAsViewModel(["View:Admin:SettingsMenu","AdminSettingsMenuViewModel"],i),n.extend(i.prototype,a.prototype),i.prototype.link=function(e){return"#/"+e},e.exports=i}(t,e)},{"App:Knoin":21,Globals:8,"Knoin:AbstractViewModel":24,_:19}],48:[function(e,t){!function(e,t){"use strict";function i(){c.call(this,"Right","AdminPane"),this.adminDomain=o.observable(s.settingsGet("AdminDomain")),this.version=o.observable(s.settingsGet("Version")),this.adminManLoadingVisibility=a.adminManLoadingVisibility,l.constructorEnd(this)}var n=t("_"),o=t("ko"),s=t("Storage:Settings"),a=t("Storage:Admin:Data"),r=t("Storage:Admin:Remote"),l=t("App:Knoin"),c=t("Knoin:AbstractViewModel");l.extendAsViewModel(["View:Admin:SettingsPane","AdminSettingsPaneViewModel"],i),n.extend(i.prototype,c.prototype),i.prototype.logoutClick=function(){r.adminLogout(function(){t("App:Admin").loginAndLogoutReload()})},e.exports=i}(t,e)},{"App:Admin":3,"App:Knoin":21,"Knoin:AbstractViewModel":24,"Storage:Admin:Data":43,"Storage:Admin:Remote":44,"Storage:Settings":45,_:19,ko:16}],49:[function(e,t){!function(e,t){"use strict";function i(){p.call(this,"Popups","PopupsActivate");var e=this;this.domain=o.observable(""),this.key=o.observable(""),this.key.focus=o.observable(!1),this.activationSuccessed=o.observable(!1),this.licenseTrigger=l.licenseTrigger,this.activateProcess=o.observable(!1),this.activateText=o.observable(""),this.activateText.isError=o.observable(!1),this.key.subscribe(function(){this.activateText(""),this.activateText.isError(!1)},this),this.activationSuccessed.subscribe(function(e){e&&this.licenseTrigger(!this.licenseTrigger())},this),this.activateCommand=a.createCommand(this,function(){this.activateProcess(!0),this.validateSubscriptionKey()?c.licensingActivate(function(t,i){e.activateProcess(!1),s.StorageResultType.Success===t&&i.Result?!0===i.Result?(e.activationSuccessed(!0),e.activateText("Subscription Key Activated Successfully"),e.activateText.isError(!1)):(e.activateText(i.Result),e.activateText.isError(!0),e.key.focus(!0)):i.ErrorCode?(e.activateText(a.getNotification(i.ErrorCode)),e.activateText.isError(!0),e.key.focus(!0)):(e.activateText(a.getNotification(s.Notification.UnknownError)),e.activateText.isError(!0),e.key.focus(!0))},this.domain(),this.key()):(this.activateProcess(!1),this.activateText("Invalid Subscription Key"),this.activateText.isError(!0),this.key.focus(!0))},function(){return!this.activateProcess()&&""!==this.domain()&&""!==this.key()&&!this.activationSuccessed()}),u.constructorEnd(this)}var n=t("_"),o=t("ko"),s=t("Enums"),a=t("Utils"),r=t("Storage:Settings"),l=t("Storage:Admin:Data"),c=t("Storage:Admin:Remote"),u=t("App:Knoin"),p=t("Knoin:AbstractViewModel");u.extendAsViewModel(["View:Popup:Activate","PopupsActivateViewModel"],i),n.extend(i.prototype,p.prototype),i.prototype.onShow=function(){this.domain(r.settingsGet("AdminDomain")),this.activateProcess()||(this.key(""),this.activateText(""),this.activateText.isError(!1),this.activationSuccessed(!1))},i.prototype.onFocus=function(){this.activateProcess()||this.key.focus(!0)},i.prototype.validateSubscriptionKey=function(){var e=this.key();return""===e||!!/^RL[\d]+-[A-Z0-9\-]+Z$/.test(a.trim(e))},e.exports=i}(t,e)},{"App:Knoin":21,Enums:6,"Knoin:AbstractViewModel":24,"Storage:Admin:Data":43,"Storage:Admin:Remote":44,"Storage:Settings":45,Utils:11,_:19,ko:16}],50:[function(e,t){!function(e,t){"use strict";function i(){c.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=a.KeyState.PopupAsk,l.constructorEnd(this)}var n=t("_"),o=t("ko"),s=t("key"),a=t("Enums"),r=t("Utils"),l=t("App:Knoin"),c=t("Knoin:AbstractViewModel");l.extendAsViewModel(["View:Popup:Ask","PopupsAskViewModel"],i),n.extend(i.prototype,c.prototype),i.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},i.prototype.yesClick=function(){this.cancelCommand(),r.isFunc(this.fYesAction)&&this.fYesAction.call(null)},i.prototype.noClick=function(){this.cancelCommand(),r.isFunc(this.fNoAction)&&this.fNoAction.call(null)},i.prototype.onShow=function(e,t,i,n,o){this.clearPopup(),this.fYesAction=t||null,this.fNoAction=i||null,this.askDesc(e||""),n&&this.yesButton(n),n&&this.yesButton(o)},i.prototype.onFocus=function(){this.yesFocus(!0)},i.prototype.onBuild=function(){s("tab, shift+tab, right, left",a.KeyState.PopupAsk,n.bind(function(){return this.yesFocus()?this.noFocus(!0):this.yesFocus(!0),!1},this)),s("esc",a.KeyState.PopupAsk,n.bind(function(){return this.noClick(),!1},this))},e.exports=i}(t,e)},{"App:Knoin":21,Enums:6,"Knoin:AbstractViewModel":24,Utils:11,_:19,key:15,ko:16}],51:[function(e,t){!function(e,t){"use strict";function i(){u.call(this,"Popups","PopupsDomain"),this.edit=o.observable(!1),this.saving=o.observable(!1),this.savingError=o.observable(""),this.whiteListPage=o.observable(!1),this.testing=o.observable(!1),this.testingDone=o.observable(!1),this.testingImapError=o.observable(!1),this.testingSmtpError=o.observable(!1),this.testingImapErrorDesc=o.observable(""),this.testingSmtpErrorDesc=o.observable(""),this.testingImapError.subscribe(function(e){e||this.testingImapErrorDesc("")},this),this.testingSmtpError.subscribe(function(e){e||this.testingSmtpErrorDesc("")},this),this.testingImapErrorDesc=o.observable(""),this.testingSmtpErrorDesc=o.observable(""),this.imapServerFocus=o.observable(!1),this.smtpServerFocus=o.observable(!1),this.name=o.observable(""),this.name.focused=o.observable(!1),this.imapServer=o.observable(""),this.imapPort=o.observable(""+a.Values.ImapDefaulPort),this.imapSecure=o.observable(s.ServerSecure.None),this.imapShortLogin=o.observable(!1),this.smtpServer=o.observable(""),this.smtpPort=o.observable(""+a.Values.SmtpDefaulPort),this.smtpSecure=o.observable(s.ServerSecure.None),this.smtpShortLogin=o.observable(!1),this.smtpAuth=o.observable(!0),this.whiteList=o.observable(""),this.headerText=o.computed(function(){var e=this.name();return this.edit()?'Edit Domain "'+e+'"':"Add Domain"+(""===e?"":' "'+e+'"')},this),this.domainIsComputed=o.computed(function(){return""!==this.name()&&""!==this.imapServer()&&""!==this.imapPort()&&""!==this.smtpServer()&&""!==this.smtpPort()},this),this.canBeTested=o.computed(function(){return!this.testing()&&this.domainIsComputed()},this),this.canBeSaved=o.computed(function(){return!this.saving()&&this.domainIsComputed()},this),this.createOrAddCommand=r.createCommand(this,function(){this.saving(!0),l.createOrUpdateDomain(n.bind(this.onDomainCreateOrSaveResponse,this),!this.edit(),this.name(),this.imapServer(),r.pInt(this.imapPort()),this.imapSecure(),this.imapShortLogin(),this.smtpServer(),r.pInt(this.smtpPort()),this.smtpSecure(),this.smtpShortLogin(),this.smtpAuth(),this.whiteList())},this.canBeSaved),this.testConnectionCommand=r.createCommand(this,function(){this.whiteListPage(!1),this.testingDone(!1),this.testingImapError(!1),this.testingSmtpError(!1),this.testing(!0),l.testConnectionForDomain(n.bind(this.onTestConnectionResponse,this),this.name(),this.imapServer(),r.pInt(this.imapPort()),this.imapSecure(),this.smtpServer(),r.pInt(this.smtpPort()),this.smtpSecure(),this.smtpAuth())},this.canBeTested),this.whiteListCommand=r.createCommand(this,function(){this.whiteListPage(!this.whiteListPage())}),this.imapServerFocus.subscribe(function(e){e&&""!==this.name()&&""===this.imapServer()&&this.imapServer(this.name().replace(/[.]?[*][.]?/g,""))},this),this.smtpServerFocus.subscribe(function(e){e&&""!==this.imapServer()&&""===this.smtpServer()&&this.smtpServer(this.imapServer().replace(/imap/gi,"smtp"))},this),this.imapSecure.subscribe(function(e){var t=r.pInt(this.imapPort());switch(e=r.pString(e)){case"0":993===t&&this.imapPort("143");break;case"1":143===t&&this.imapPort("993")}},this),this.smtpSecure.subscribe(function(e){var t=r.pInt(this.smtpPort());switch(e=r.pString(e)){case"0":(465===t||587===t)&&this.smtpPort("25");break;case"1":(25===t||587===t)&&this.smtpPort("465");break;case"2":(25===t||465===t)&&this.smtpPort("587")}},this),c.constructorEnd(this)}var n=t("_"),o=t("ko"),s=t("Enums"),a=t("Consts"),r=t("Utils"),l=t("Storage:Admin:Remote"),c=t("App:Knoin"),u=t("Knoin:AbstractViewModel");c.extendAsViewModel(["View:Popup:Domain","PopupsDomainViewModel"],i),n.extend(i.prototype,u.prototype),i.prototype.onTestConnectionResponse=function(e,t){this.testing(!1),s.StorageResultType.Success===e&&t.Result?(this.testingDone(!0),this.testingImapError(!0!==t.Result.Imap),this.testingSmtpError(!0!==t.Result.Smtp),this.testingImapError()&&t.Result.Imap&&this.testingImapErrorDesc(t.Result.Imap),this.testingSmtpError()&&t.Result.Smtp&&this.testingSmtpErrorDesc(t.Result.Smtp)):(this.testingImapError(!0),this.testingSmtpError(!0))},i.prototype.onDomainCreateOrSaveResponse=function(e,i){this.saving(!1),s.StorageResultType.Success===e&&i?i.Result?(t("App:Admin").reloadDomainList(),this.closeCommand()):s.Notification.DomainAlreadyExists===i.ErrorCode&&this.savingError("Domain already exists"):this.savingError("Unknown error")},i.prototype.onHide=function(){this.whiteListPage(!1)},i.prototype.onShow=function(e){this.saving(!1),this.whiteListPage(!1),this.testing(!1),this.testingDone(!1),this.testingImapError(!1),this.testingSmtpError(!1),this.clearForm(),e&&(this.edit(!0),this.name(r.trim(e.Name)),this.imapServer(r.trim(e.IncHost)),this.imapPort(""+r.pInt(e.IncPort)),this.imapSecure(r.trim(e.IncSecure)),this.imapShortLogin(!!e.IncShortLogin),this.smtpServer(r.trim(e.OutHost)),this.smtpPort(""+r.pInt(e.OutPort)),this.smtpSecure(r.trim(e.OutSecure)),this.smtpShortLogin(!!e.OutShortLogin),this.smtpAuth(!!e.OutAuth),this.whiteList(r.trim(e.WhiteList)))},i.prototype.onFocus=function(){""===this.name()&&this.name.focused(!0)},i.prototype.clearForm=function(){this.edit(!1),this.whiteListPage(!1),this.savingError(""),this.name(""),this.name.focused(!1),this.imapServer(""),this.imapPort(""+a.Values.ImapDefaulPort),this.imapSecure(s.ServerSecure.None),this.imapShortLogin(!1),this.smtpServer(""),this.smtpPort(""+a.Values.SmtpDefaulPort),this.smtpSecure(s.ServerSecure.None),this.smtpShortLogin(!1),this.smtpAuth(!0),this.whiteList("")},e.exports=i}(t,e)},{"App:Admin":3,"App:Knoin":21,Consts:5,Enums:6,"Knoin:AbstractViewModel":24,"Storage:Admin:Remote":44,Utils:11,_:19,ko:16}],52:[function(e,t){!function(e,t){"use strict";function i(){l.call(this,"Popups","PopupsLanguages"),this.Data=a.__APP.data(),this.exp=o.observable(!1),this.languages=o.computed(function(){return n.map(this.Data.languages(),function(e){return{key:e,selected:o.observable(!1),fullName:s.convertLangName(e)}})},this),this.Data.mainLanguage.subscribe(function(){this.resetMainLanguage()},this),r.constructorEnd(this)}var n=t("_"),o=t("ko"),s=t("Utils"),a=t("Globals"),r=t("App:Knoin"),l=t("Knoin:AbstractViewModel");r.extendAsViewModel(["View:Popup:Languages","PopupsLanguagesViewModel"],i),n.extend(i.prototype,l.prototype),i.prototype.languageEnName=function(e){return s.convertLangName(e,!0)},i.prototype.resetMainLanguage=function(){var e=this.Data.mainLanguage();n.each(this.languages(),function(t){t.selected(t.key===e)})},i.prototype.onShow=function(){this.exp(!0),this.resetMainLanguage()},i.prototype.onHide=function(){this.exp(!1)},i.prototype.changeLanguage=function(e){this.Data.mainLanguage(e),this.cancelCommand()},e.exports=i}(t,e)},{"App:Knoin":21,Globals:8,"Knoin:AbstractViewModel":24,Utils:11,_:19,ko:16}],53:[function(e,t){!function(e,t){"use strict";function i(){u.call(this,"Popups","PopupsPlugin");var e=this;this.onPluginSettingsUpdateResponse=n.bind(this.onPluginSettingsUpdateResponse,this),this.saveError=o.observable(""),this.name=o.observable(""),this.readme=o.observable(""),this.configures=o.observableArray([]),this.hasReadme=o.computed(function(){return""!==this.readme()},this),this.hasConfiguration=o.computed(function(){return 0<this.configures().length},this),this.readmePopoverConf={placement:"top",trigger:"hover",title:"About",content:function(){return e.readme()}},this.saveCommand=r.createCommand(this,function(){var e={};e.Name=this.name(),n.each(this.configures(),function(t){var i=t.value();(!1===i||!0===i)&&(i=i?"1":"0"),e["_"+t.Name]=i},this),this.saveError(""),l.pluginSettingsUpdate(this.onPluginSettingsUpdateResponse,e)},this.hasConfiguration),this.bDisabeCloseOnEsc=!0,this.sDefaultKeyScope=a.KeyState.All,this.tryToClosePopup=n.debounce(n.bind(this.tryToClosePopup,this),200),c.constructorEnd(this)}var n=t("_"),o=t("ko"),s=t("key"),a=t("Enums"),r=t("Utils"),l=t("Storage:Admin:Remote"),c=t("App:Knoin"),u=t("Knoin:AbstractViewModel");c.extendAsViewModel(["View:Popup:Plugin","PopupsPluginViewModel"],i),n.extend(i.prototype,u.prototype),i.prototype.onPluginSettingsUpdateResponse=function(e,t){a.StorageResultType.Success===e&&t&&t.Result?this.cancelCommand():(this.saveError(""),this.saveError(t&&t.ErrorCode?r.getNotification(t.ErrorCode):r.getNotification(a.Notification.CantSavePluginSettings)))},i.prototype.onShow=function(e){if(this.name(),this.readme(),this.configures([]),e){this.name(e.Name),this.readme(e.Readme);var t=e.Config;r.isNonEmptyArray(t)&&this.configures(n.map(t,function(e){return{value:o.observable(e[0]),Name:e[1],Type:e[2],Label:e[3],Default:e[4],Desc:e[5]}}))}},i.prototype.tryToClosePopup=function(){var e=this,i=t("View:Popup:Ask");c.isPopupVisible(i)||c.showScreenPopup(i,[r.i18n("POPUPS_ASK/DESC_WANT_CLOSE_THIS_WINDOW"),function(){e.modalVisibility()&&r.delegateRun(e,"cancelCommand")}])},i.prototype.onBuild=function(){s("esc",a.KeyState.All,n.bind(function(){return this.modalVisibility()&&this.tryToClosePopup(),!1},this))},e.exports=i}(t,e)},{"App:Knoin":21,Enums:6,"Knoin:AbstractViewModel":24,"Storage:Admin:Remote":44,Utils:11,"View:Popup:Ask":50,_:19,key:15,ko:16}]},{},[1]); |