/home/ivoiecob/email.hirewise-va.com/static/js/OpenPgpWebclient.app.80556550086ffd897712.min.js
/*! For license information please see OpenPgpWebclient.app.80556550086ffd897712.min.js.LICENSE.txt */
"use strict";(self.webpackChunkafterlogic_aurora_platform=self.webpackChunkafterlogic_aurora_platform||[]).push([[1995],{"22M0":(e,t,n)=>{var o=n("a7T2"),r=n("M4cL"),i=n("p09A"),s=n("yU9o"),a=n("rBrp"),c=n("LKDt"),p=n("5D2l"),u=n("D2Gh"),l=n("69av"),h=n("RIpb"),f=n("vfpp"),E=n("E7cO");function y(){l.call(this),this.emails=i.observableArray([]),this.selectedEmail=i.observable(""),this.password=i.observable(""),this.keyLengthOptions=[2048,4096],this.selectedKeyLength=i.observable(2048),this.process=i.observable(!1),this.keysExistText=i.observable("")}o.extendOwn(y.prototype,l.prototype),y.prototype.PopupTemplate="OpenPgpWebclient_GenerateKeyPopup",y.prototype.onOpen=function(){var e=s.getUserPublicId?[s.getUserPublicId()]:[],t=p.run("MailWebclient","getAllAccountsFullEmails")||e,n=E.getKeys(),r=o.map(n,function(e){return a.getEmailParts(e.user).email}),i=[];o.each(t,function(e){var t=a.getEmailParts(e);-1===o.indexOf(r,t.email)&&i.push(e)}),0===i.length&&this.keysExistText(c.i18n("OPENPGPWEBCLIENT/INFO_KEYS_EXIST_PLURAL",{},null,t.length)),this.emails(i),this.selectedEmail(""),this.password(""),this.selectedKeyLength(2048),this.process(!1)},y.prototype.generate=function(){if(0!==this.emails().length){var e=o.bind(function(){u.showReport(c.i18n("OPENPGPWEBCLIENT/REPORT_KEY_SUCCESSFULLY_GENERATED")),this.process(!1),this.closePopup()},this),t=o.bind(function(){h.showPgpErrorByCode({},f.PgpAction.Generate),this.process(!1),this.closePopup()},this);this.process(!0),o.delay(o.bind(function(){E.generateKey(this.selectedEmail(),r.trim(this.password()),this.selectedKeyLength(),e,t)},this))}},e.exports=new y},"5MYD":(e,t,n)=>{function o(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",s=n.toStringTag||"@@toStringTag";function a(n,o,i,s){var a=o&&o.prototype instanceof p?o:p,u=Object.create(a.prototype);return r(u,"_invoke",function(n,o,r){var i,s,a,p=0,u=r||[],l=!1,h={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,a=e,h.n=n,c}};function f(n,o){for(s=n,a=o,t=0;!l&&p&&!r&&t<u.length;t++){var r,i=u[t],f=h.p,E=i[2];n>3?(r=E===o)&&(a=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((r=n<2&&f<i[1])?(s=0,h.v=o,h.n=i[1]):f<E&&(r=n<3||i[0]>o||o>E)&&(i[4]=n,i[5]=o,h.n=E,s=0))}if(r||n>1)return c;throw l=!0,o}return function(r,u,E){if(p>1)throw TypeError("Generator is already running");for(l&&1===u&&f(u,E),s=u,a=E;(t=s<2?e:a)||!l;){i||(s?s<3?(s>1&&(h.n=-1),f(s,a)):h.n=a:h.v=a);try{if(p=2,i){if(s||(r="next"),t=i[r]){if(!(t=t.call(i,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(a=TypeError("The iterator does not provide a '"+r+"' method"),s=1);i=e}else if((t=(l=h.n<0)?a:n.call(o,h))!==c)break}catch(t){i=e,s=1,a=t}finally{p=1}}return{value:t,done:l}}}(n,i,s),!0),u}var c={};function p(){}function u(){}function l(){}t=Object.getPrototypeOf;var h=[][i]?t(t([][i]())):(r(t={},i,function(){return this}),t),f=l.prototype=p.prototype=Object.create(h);function E(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,r(e,s,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=l,r(f,"constructor",l),r(l,"constructor",u),u.displayName="GeneratorFunction",r(l,s,"GeneratorFunction"),r(f),r(f,s,"Generator"),r(f,i,function(){return this}),r(f,"toString",function(){return"[object Generator]"}),(o=function(){return{w:a,m:E}})()}function r(e,t,n,o){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}r=function(e,t,n,o){function s(t,n){r(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[t]=n:(s("next",0),s("throw",1),s("return",2))},r(e,t,n,o)}function i(e,t,n,o,r,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(o,r)}var s=n("a7T2"),a=n("p09A"),c=n("LKDt"),p=n("yU9o"),u=n("5D2l"),l=n("PMEU"),h=n("D2Gh"),f=u.run("SettingsWebclient","getAbstractSettingsFormViewClass"),E=n("RIpb"),y=n("22M0"),m=n("RqIR"),P=n("E7cO"),d=n("a9Z8"),g=n("Eq1/"),b=n("7EIX"),v=u.isModuleAvailable("TeamContacts");function T(){f.call(this,d.ServerModuleName),this.bTeamContactsAvailable=v,this.enableOpenPgpInMail=a.observable(d.enableOpenPgpInMail()),this.rememberPassphrase=d.rememberPassphrase,this.isMailAvailable=u.isModuleAvailable("Mail"),this.keys=a.observableArray(P.getKeys()),P.getKeysObservable().subscribe(function(){this.keys(P.getKeys())},this),this.noOwnKeyInTeamContacts=a.computed(function(){return!1===P.ownKeyFromTeamContacts()}),this.publicKeysFromThisDevice=a.computed(function(){return this.keys().filter(function(e){return!e.isFromContacts&&e.isPublic()}).map(function(e){var t=v&&e.getEmail()===p.getUserPublicId(),n=P.ownKeyFromTeamContacts(),o=t&&n&&e.getId()===n.getId();return{key:e,user:e.getUser(),isOwn:t,hasOwnKeyFromTeamContacts:!!n,isSameKeyFromTeamContacts:o}})},this),this.privateKeysFromThisDevice=a.computed(function(){return this.keys().filter(function(e){return!e.isFromContacts&&e.isPrivate()}).map(function(e){return{key:e,user:e.getUser()}})},this),this.keysFromPersonalContacts=a.computed(function(){return this.keys().filter(function(e){return e.isFromContacts}).map(function(e){return{key:e,user:e.getUser()}})},this),this.oPgpKeyControlsView=u.run("OpenPgpWebclient","getPgpKeyControlsView")}s.extendOwn(T.prototype,f.prototype),T.prototype.ViewTemplate="OpenPgpWebclient_OpenPgpSettingsFormView",T.prototype.saveOwnKeyToTeamContact=function(){var e,t=(e=o().m(function e(t){var n,r;return o().w(function(e){for(;;)switch(e.n){case 0:return n=t.getArmor(),e.n=1,P.addKeyToContact(n,"",!0);case 1:(r=e.v)&&r.result?h.showReport(c.i18n("OPENPGPWEBCLIENT/REPORT_KEY_SUCCESSFULLY_IMPORTED_PLURAL",{},null,1)):E.showPgpErrorByCode(r,Enums.PgpAction.Import,c.i18n("OPENPGPWEBCLIENT/ERROR_IMPORT_KEY"));case 2:return e.a(2)}},e)}),function(){var t=this,n=arguments;return new Promise(function(o,r){var s=e.apply(t,n);function a(e){i(s,o,r,a,c,"next",e)}function c(e){i(s,o,r,a,c,"throw",e)}a(void 0)})});return function(e){return t.apply(this,arguments)}}(),T.prototype.exportAllPublicKeys=function(){var e=s.map(s.union(this.publicKeysFromThisDevice(),this.keysFromPersonalContacts()),function(e){return e.key.getArmor()});e.length>0&&l.showPopup(g,[e.join("\n")])},T.prototype.importKey=function(){l.showPopup(m,[{}])},T.prototype.generateNewKey=function(){l.showPopup(y)},T.prototype.removeKeyFromContacts=function(e){this.oPgpKeyControlsView.removeKeyFromContacts(e)},T.prototype.removeKeyFromThisDevice=function(e){this.oPgpKeyControlsView.removeKeyFromThisDevice(e)},T.prototype.showArmor=function(e){var t=this;e.isPublic()?this.oPgpKeyControlsView.showArmor(e):l.showPopup(b,[e,function(){t.oPgpKeyControlsView.showArmor(e)}])},T.prototype.getCurrentValues=function(){return[this.enableOpenPgpInMail(),this.rememberPassphrase()]},T.prototype.revertGlobalValues=function(){this.enableOpenPgpInMail(d.enableOpenPgpInMail()),this.rememberPassphrase(d.rememberPassphrase())},T.prototype.getParametersForSave=function(){return{EnableModule:this.enableOpenPgpInMail(),RememberPassphrase:this.rememberPassphrase()}},T.prototype.applySavedValues=function(e){d.update(e.EnableModule)},e.exports=new T},"7EIX":(e,t,n)=>{function o(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",s=n.toStringTag||"@@toStringTag";function a(n,o,i,s){var a=o&&o.prototype instanceof p?o:p,u=Object.create(a.prototype);return r(u,"_invoke",function(n,o,r){var i,s,a,p=0,u=r||[],l=!1,h={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,a=e,h.n=n,c}};function f(n,o){for(s=n,a=o,t=0;!l&&p&&!r&&t<u.length;t++){var r,i=u[t],f=h.p,E=i[2];n>3?(r=E===o)&&(a=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((r=n<2&&f<i[1])?(s=0,h.v=o,h.n=i[1]):f<E&&(r=n<3||i[0]>o||o>E)&&(i[4]=n,i[5]=o,h.n=E,s=0))}if(r||n>1)return c;throw l=!0,o}return function(r,u,E){if(p>1)throw TypeError("Generator is already running");for(l&&1===u&&f(u,E),s=u,a=E;(t=s<2?e:a)||!l;){i||(s?s<3?(s>1&&(h.n=-1),f(s,a)):h.n=a:h.v=a);try{if(p=2,i){if(s||(r="next"),t=i[r]){if(!(t=t.call(i,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(a=TypeError("The iterator does not provide a '"+r+"' method"),s=1);i=e}else if((t=(l=h.n<0)?a:n.call(o,h))!==c)break}catch(t){i=e,s=1,a=t}finally{p=1}}return{value:t,done:l}}}(n,i,s),!0),u}var c={};function p(){}function u(){}function l(){}t=Object.getPrototypeOf;var h=[][i]?t(t([][i]())):(r(t={},i,function(){return this}),t),f=l.prototype=p.prototype=Object.create(h);function E(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,r(e,s,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=l,r(f,"constructor",l),r(l,"constructor",u),u.displayName="GeneratorFunction",r(l,s,"GeneratorFunction"),r(f),r(f,s,"Generator"),r(f,i,function(){return this}),r(f,"toString",function(){return"[object Generator]"}),(o=function(){return{w:a,m:E}})()}function r(e,t,n,o){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}r=function(e,t,n,o){function s(t,n){r(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[t]=n:(s("next",0),s("throw",1),s("return",2))},r(e,t,n,o)}function i(e,t,n,o,r,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(o,r)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(o,r){var s=e.apply(t,n);function a(e){i(s,o,r,a,c,"next",e)}function c(e){i(s,o,r,a,c,"throw",e)}a(void 0)})}}var a=n("a7T2"),c=n("p09A"),p=n("69av"),u=n("RIpb"),l=n("E7cO");function h(){p.call(this),this.password=c.observable(""),this.oKey=null,this.fOkCallback=null}a.extendOwn(h.prototype,p.prototype),h.prototype.PopupTemplate="OpenPgpWebclient_VerifyPasswordPopup",h.prototype.onOpen=function(e,t){this.password(""),this.oKey=e,this.fOkCallback=t},h.prototype.confirmPasswordAndView=s(o().m(function e(){var t;return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,l.verifyKeyPassword(this.oKey,this.password());case 1:(t=e.v).errors?u.showPgpErrorByCode(t):a.isFunction(this.fOkCallback)&&(this.fOkCallback(),this.closePopup());case 2:return e.a(2)}},e,this)})),e.exports=new h},"Eq1/":(e,t,n)=>{var o=n("a7T2"),r=n("p09A"),i=n("LKDt"),s=n("8QQh"),a=n("5D2l"),c=n("D2Gh"),p=a.run("MailWebclient","getComposeMessageWithAttachments"),u=n("69av");function l(){u.call(this),this.bAllowSendEmails=o.isFunction(p),this.armors=r.observable(""),this.htmlArmor=r.computed(function(){return i.encodeHtml(this.armors().replace(/\r/g,""))},this),this.popupHeading=r.computed(function(){return i.i18n("OPENPGPWEBCLIENT/HEADING_VIEW_ALL_PUBLIC_KEYS")},this),this.downloadLinkHref=r.computed(function(){var e="#",t=null;return Blob&&window.URL&&o.isFunction(window.URL.createObjectURL)&&(t=new Blob([this.armors()],{type:"text/plain"}),e=window.URL.createObjectURL(t)),e},this),this.downloadLinkFilename=r.computed(function(){return i.i18n("OPENPGPWEBCLIENT/TEXT_ALL_PUBLIC_KEYS_FILENAME")+".asc"},this),this.domKey=r.observable(null)}o.extendOwn(l.prototype,u.prototype),l.prototype.PopupTemplate="OpenPgpWebclient_ShowKeyArmorPopup",l.prototype.onOpen=function(e){this.armors(e)},l.prototype.send=function(){this.bAllowSendEmails&&""!==this.armors()&&""!==this.downloadLinkFilename()&&s.send("OpenPgpWebclient","SaveKeyAsTempFile",{Content:this.armors(),FileName:this.downloadLinkFilename()},function(e){e.Result&&(p([e.Result]),this.closePopup())},this)},l.prototype.select=function(){var e=this.domKey()&&1===this.domKey().length?this.domKey()[0]:null,t=null,n=null;e&&window.getSelection&&document.createRange&&((n=document.createRange()).setStart(e,0),n.setEnd(e,1),(t=window.getSelection()).removeAllRanges(),t.addRange(n),document.queryCommandSupported("copy")&&(document.execCommand("copy"),c.showReport(i.i18n("OPENPGPWEBCLIENT/REPORT_KEY_IN_CLIPBOARD"))))},e.exports=new l},Jrnf:(e,t,n)=>{function o(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",s=n.toStringTag||"@@toStringTag";function a(n,o,i,s){var a=o&&o.prototype instanceof p?o:p,u=Object.create(a.prototype);return r(u,"_invoke",function(n,o,r){var i,s,a,p=0,u=r||[],l=!1,h={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,a=e,h.n=n,c}};function f(n,o){for(s=n,a=o,t=0;!l&&p&&!r&&t<u.length;t++){var r,i=u[t],f=h.p,E=i[2];n>3?(r=E===o)&&(a=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((r=n<2&&f<i[1])?(s=0,h.v=o,h.n=i[1]):f<E&&(r=n<3||i[0]>o||o>E)&&(i[4]=n,i[5]=o,h.n=E,s=0))}if(r||n>1)return c;throw l=!0,o}return function(r,u,E){if(p>1)throw TypeError("Generator is already running");for(l&&1===u&&f(u,E),s=u,a=E;(t=s<2?e:a)||!l;){i||(s?s<3?(s>1&&(h.n=-1),f(s,a)):h.n=a:h.v=a);try{if(p=2,i){if(s||(r="next"),t=i[r]){if(!(t=t.call(i,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(a=TypeError("The iterator does not provide a '"+r+"' method"),s=1);i=e}else if((t=(l=h.n<0)?a:n.call(o,h))!==c)break}catch(t){i=e,s=1,a=t}finally{p=1}}return{value:t,done:l}}}(n,i,s),!0),u}var c={};function p(){}function u(){}function l(){}t=Object.getPrototypeOf;var h=[][i]?t(t([][i]())):(r(t={},i,function(){return this}),t),f=l.prototype=p.prototype=Object.create(h);function E(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,r(e,s,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=l,r(f,"constructor",l),r(l,"constructor",u),u.displayName="GeneratorFunction",r(l,s,"GeneratorFunction"),r(f),r(f,s,"Generator"),r(f,i,function(){return this}),r(f,"toString",function(){return"[object Generator]"}),(o=function(){return{w:a,m:E}})()}function r(e,t,n,o){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}r=function(e,t,n,o){function s(t,n){r(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[t]=n:(s("next",0),s("throw",1),s("return",2))},r(e,t,n,o)}function i(e,t,n,o,r,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(o,r)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(o,r){var s=e.apply(t,n);function a(e){i(s,o,r,a,c,"next",e)}function c(e){i(s,o,r,a,c,"throw",e)}a(void 0)})}}var a=n("a7T2");e.exports=function(e){if(!window.crypto||!window.crypto.getRandomValues)return null;var t=n("uQaC"),r=n("yU9o"),i=n("PMEU"),c=n("LKDt"),p=null,u={getKeyInfo:function(e,t){return s(o().m(function r(){var i,s,c,p;return o().w(function(o){for(;;)switch(o.n){case 0:return i=n("h/lg"),s=n("/bge"),c=null,p=null,o.n=1,i.key.readArmored(e);case 1:return(c=o.v)&&!c.err&&c.keys&&c.keys[0]&&(p=new s(c.keys[0])),a.isFunction(t)&&t(p),o.a(2,p)}},r)}))()},getOpenPgpEncryptor:function(){return n("E7cO")},getPgpKeyControlsView:function(e){var t=n("drFo");return t.setAfterRemoveContactKeyHandler(e),t},getSuggestionsAutocompleteFilteredCallback:function(e){return function(t,o){e(t,function(e){var t=n("E7cO").getPublicKeys().map(function(e){return e.getEmail()});e.forEach(function(e){e.hasKey||(e.hasKey=t.includes(e.email))}),o(e)})}},getPrivateKeyPassword:function(e,t){return s(o().m(function r(){var i,s;return o().w(function(o){for(;;)switch(o.n){case 0:return i=n("E7cO"),o.n=1,i.getPrivateKeyPassword(e);case 1:s=o.v,t(s);case 2:return o.a(2)}},r)}))()},encryptSign:function(e,t,o,r,i,s){var p=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"",u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,l=n("D2Gh"),h=n("RIpb"),f=n("vfpp"),E=n("E7cO"),y=t?p:"",m="",P=a.bind(function(t){a.isFunction(s)&&s(t.result,e)},this),d=function(e){h.showPgpErrorByCode(e,m)};if(e)if(0===r.length)l.showError(c.i18n("OPENPGPWEBCLIENT/ERROR_TO_ENCRYPT_SPECIFY_RECIPIENTS"));else{var g=[p],b=E.findKeysByEmails(g,!0).length>0?a.union(r,g):r;t?(m=f.PgpAction.EncryptSign,E.signAndEncrypt(o,y,b,u,P,d,i)):(m=f.PgpAction.Encrypt,E.encrypt(o,b,P,d,i))}else t&&(m=f.PgpAction.Sign,E.sign(o,y,P,d,u))}};if(r.isUserNormalOrTenant()){var l=n("a9Z8");l.init(e),a.extendOwn(u,{start:function(e){var u=this;p=n("RqIR"),r.subscribeEvent("MailWebclient::RegisterMessagePaneController",function(e){e(n("rPFn"),"BeforeMessageHeaders")}),r.isMobile()?e.run("MailMobileWebclient","registerComposeToolbarController",[n("XQac")]):e.run("MailWebclient","registerComposeToolbarController",[n("XQac")]),e.run("SettingsWebclient","registerSettingsTab",[function(){return n("5MYD")},l.HashModuleName,c.i18n("OPENPGPWEBCLIENT/LABEL_SETTINGS_TAB")]),r.subscribeEvent("MailWebclient::ParseFile::after",function(o){if(o&&a.isFunction(o.addAction)&&"asc"===t.getFileExtension(o.fileName())&&o.content&&o.content()){var s=n("E7cO"),u=n("xLBO"),l=function(){if(o.folderName()&&o.messageUid()){var t=r.currentAccountEmail?r.currentAccountEmail():"",n=s.getPublicKeysIfExistsByEmail(t);n&&n[0]&&e.run("MailWebclient","getMessage",[o.folderName(),o.messageUid(),function(e){i.showPopup(u,[e,n[0]])}])}},h={Text:c.i18n("OPENPGPWEBCLIENT/ACTION_FILE_IMPORT_KEY"),Handler:function(){i.showPopup(p,[{armor:o.content(),onSuccessCallback:l}])}};o.addAction("import",!0,h),o.removeAction("view")}}),r.subscribeEvent("FilesWebclient::ParseFile::after",function(e){var n=e[0];if(n&&a.isFunction(n.addAction)&&"asc"===t.getFileExtension(n.fileName())&&n.content&&n.content()){var o={Text:c.i18n("OPENPGPWEBCLIENT/ACTION_FILE_IMPORT_KEY"),Handler:function(){i.showPopup(p,[{armor:n.content()}])}};n.addAction("import",!0,o)}});var h=function(){var e=s(o().m(function e(t){var n,r,i,s;return o().w(function(e){for(;;)switch(e.n){case 0:if(n=t.Contact,r=t.Callback,i=null,s={Error:!1,ErrorMessage:""},""==n.PublicPgpKey){e.n=2;break}return e.n=1,u.getKeyInfo(n.PublicPgpKey);case 1:(i=e.v)?i.getEmail()!==n.ViewEmail?(s.Error=!0,s.ErrorMessage=c.i18n("OPENPGPWEBCLIENT/ERROR_EMAILS_DO_NOT_MATCH")):i.isPrivate()&&(s.Error=!0,s.ErrorMessage=c.i18n("OPENPGPWEBCLIENT/ERROR_ADDED_KEY_NOT_PUBLIC")):(s.Error=!0,s.ErrorMessage=c.i18n("OPENPGPWEBCLIENT/ERROR_IMPORT_NO_KEY_FOUND"));case 2:r(s);case 3:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}();r.subscribeEvent("ContactsWebclient::beforeCreateContactRequest",h),r.subscribeEvent("ContactsWebclient::beforeUpdateContactRequest",h)},getOpenPgpInMailEnabledObservable:function(){return l.enableOpenPgpInMail}})}return u}},QGkc:(e,t,n)=>{var o=n("a7T2"),r=n("p09A"),i=n("LKDt"),s=n("uQaC"),a=(n("8QQh"),n("D2Gh")),c=n("69av"),p=n("RIpb"),u=n("vfpp"),l=n("E7cO");function h(){c.call(this),this.data=r.observable(""),this.fromEmail=r.observable(""),this.emails=r.observableArray([]),this.contactsUUIDs=[],this.successEncryptCallback=function(){},this.needToSign=r.observable(!0),this.needToEncrypt=r.observable(!0),this.signEncryptButtonText=r.computed(function(){var e=i.i18n("OPENPGPWEBCLIENT/ACTION_SIGN_ENCRYPT");return this.needToSign()&&!this.needToEncrypt()&&(e=i.i18n("OPENPGPWEBCLIENT/ACTION_SIGN")),!this.needToSign()&&this.needToEncrypt()&&(e=i.i18n("OPENPGPWEBCLIENT/ACTION_ENCRYPT")),e},this),this.isEnableSignEncrypt=r.computed(function(){return this.needToSign()||this.needToEncrypt()},this),this.signEncryptCommand=s.createCommand(this,this.executeSignEncrypt,this.isEnableSignEncrypt)}o.extendOwn(h.prototype,c.prototype),h.prototype.PopupTemplate="OpenPgpWebclient_EncryptPopup",h.prototype.onOpen=function(e,t,n,r){this.data(e),this.fromEmail(t),this.emails(n.map(function(e){return e.email})),this.contactsUUIDs=n.map(function(e){return e.uuid}),this.successEncryptCallback=o.isFunction(r)?r:function(){},this.needToSign(!0),this.needToEncrypt(!0)},h.prototype.executeSignEncrypt=function(){var e=this,t=this.data(),n=this.needToSign()?this.fromEmail():"",r=function(t){a.showReport(c),e.closePopup(),e.successEncryptCallback(t.result,e.needToEncrypt())},s=function(e){e&&e.userCanceled||p.showPgpErrorByCode(e,h)},c="",h="";if(this.needToEncrypt())if(0===this.emails().length)a.showError(i.i18n("OPENPGPWEBCLIENT/ERROR_TO_ENCRYPT_SPECIFY_RECIPIENTS"));else{var f=[this.fromEmail()],E=l.findKeysByEmails(f,!0).length>0?o.union(this.emails(),f):this.emails();this.needToSign()?(h=u.PgpAction.EncryptSign,c=i.i18n("OPENPGPWEBCLIENT/REPORT_MESSAGE_SIGNED_ENCRYPTED_SUCCSESSFULLY"),l.signAndEncrypt(t,n,E,"",r,s,this.contactsUUIDs)):(h=u.PgpAction.Encrypt,c=i.i18n("OPENPGPWEBCLIENT/REPORT_MESSAGE_ENCRYPTED_SUCCSESSFULLY"),l.encrypt(t,E,r,s,this.contactsUUIDs))}else this.needToSign()&&(h=u.PgpAction.Sign,c=i.i18n("OPENPGPWEBCLIENT/REPORT_MESSAGE_SIGNED_SUCCSESSFULLY"),l.sign(t,n,r,s,""))},h.prototype.cancelPopup=function(){this.closePopup()},e.exports=new h},XQac:(e,t,n)=>{var o=n("a7T2"),r=n("p09A"),i=n("uQaC"),s=n("LKDt"),a=n("yU9o"),c=n("D2Gh"),p=n("PMEU"),u=n("MYiO"),l=n("QGkc"),h=n("a9Z8");function f(){this.sId="OpenPgp",this.bAllowMobile=!0,this.enableOpenPgpInMail=h.enableOpenPgpInMail,this.pgpSecured=r.observable(!1),this.pgpEncrypted=r.observable(!1),this.fromDrafts=r.observable(!1),this.disableHeadersEdit=this.pgpEncrypted,this.disableBodyEdit=this.pgpSecured,this.disableAutosave=this.pgpSecured,this.disableFromEdit=r.computed(function(){return this.pgpEncrypted()||this.pgpSecured()},this),this.visibleDoPgpButton=r.computed(function(){return this.enableOpenPgpInMail()&&(!this.pgpSecured()||this.pgpEncrypted()&&this.fromDrafts())},this),this.visibleUndoPgpButton=r.computed(function(){return this.enableOpenPgpInMail()&&this.pgpSecured()&&(!this.pgpEncrypted()||!this.fromDrafts())},this),this.isEnableOpenPgpCommand=r.computed(function(){return this.enableOpenPgpInMail()&&!this.pgpSecured()},this),this.openPgpCommand=i.createCommand(this,this.confirmOpenPgp,this.isEnableOpenPgpCommand),this.bComposeModeChanged=!1}f.prototype.ViewTemplate=a.isMobile()?"OpenPgpWebclient_ComposeButtonsMobileView":"OpenPgpWebclient_ComposeButtonsView",f.prototype.assignComposeExtInterface=function(e){this.oCompose=e},f.prototype.doAfterApplyingMainTabParameters=function(e){e.OpenPgp&&(this.pgpSecured(e.OpenPgp.Secured),this.pgpEncrypted(e.OpenPgp.Encrypted),this.fromDrafts(e.OpenPgp.FromDrafts),(this.pgpSecured()||this.pgpEncrypted())&&this.fromDrafts(!0))},f.prototype.doAfterPreparingMainTabParameters=function(e){e.OpenPgp={Secured:this.pgpSecured(),Encrypted:this.pgpEncrypted(),FromDrafts:this.fromDrafts()}},f.prototype.doAfterPopulatingMessage=function(e){if(this.bComposeModeChanged=!1,this.fromDrafts(e.bDraft),e.bPlain){var t=-1!==e.sRawText.indexOf("-----BEGIN PGP MESSAGE-----"),n=-1!==e.sRawText.indexOf("-----BEGIN PGP SIGNED MESSAGE-----");this.pgpSecured(n||t),this.pgpEncrypted(t)}else this.pgpSecured(!1),this.pgpEncrypted(!1)},f.prototype.doBeforeSave=function(e){return!!this.pgpSecured()&&(p.showPopup(u,[s.i18n("OPENPGPWEBCLIENT/CONFIRM_SAVE_ENCRYPTED_DRAFT"),e,"",s.i18n("COREWEBCLIENT/ACTION_SAVE")]),!0)},f.prototype.confirmOpenPgp=function(){if(this.oCompose)if(this.oCompose.getRecipientEmails().length<1)c.showError(s.i18n("OPENPGPWEBCLIENT/ERROR_TO_ENCRYPT_SPECIFY_RECIPIENTS"));else if(this.oCompose.isHtml()){var e=s.i18n("OPENPGPWEBCLIENT/CONFIRM_HTML_TO_PLAIN_FORMATTING"),t=o.bind(function(e){e&&this.openPgpPopup()},this);this.oCompose.hasAttachments()&&(e+="\r\n\r\n"+s.i18n("OPENPGPWEBCLIENT/CONFIRM_HTML_TO_PLAIN_ATTACHMENTS")),p.showPopup(u,[e,t])}else this.openPgpPopup()},f.prototype.openPgpPopup=function(){var e=this;this.oCompose&&p.showPopup(l,[this.oCompose.getPlainText(),this.oCompose.getFromEmail(),this.oCompose.getRecipientsInfo(),function(t,n){e.oCompose.isHtml()&&(e.oCompose.setPlainTextMode(),e.bComposeModeChanged=!0),e.oCompose.setPlainText(t),e.pgpSecured(!0),e.pgpEncrypted(n)}])},f.prototype.undoPgp=function(){var e="",t=[];this.oCompose&&this.pgpSecured()&&(this.bComposeModeChanged&&(this.oCompose.setHtmlTextMode(),this.bComposeModeChanged=!1),this.fromDrafts()&&!this.pgpEncrypted()?(2===(t=(e=this.oCompose.getPlainText()).split("-----BEGIN PGP SIGNED MESSAGE-----")).length&&(e=t[1]),2===(t=e.split("-----BEGIN PGP SIGNATURE-----")).length&&(e=t[0]),(t=e.split("\r\n\r\n")).length>0&&(t.shift(),e=t.join("\r\n\r\n")),this.oCompose.isHtml()?this.oCompose.setHtmlText("<div>"+e.replace(/\r\n/gi,"<br />")+"</div>"):this.oCompose.setPlainText(e)):this.oCompose.undoHtml(),this.pgpSecured(!1),this.pgpEncrypted(!1))},e.exports=new f},drFo:(e,t,n)=>{function o(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",s=n.toStringTag||"@@toStringTag";function a(n,o,i,s){var a=o&&o.prototype instanceof p?o:p,u=Object.create(a.prototype);return r(u,"_invoke",function(n,o,r){var i,s,a,p=0,u=r||[],l=!1,h={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,a=e,h.n=n,c}};function f(n,o){for(s=n,a=o,t=0;!l&&p&&!r&&t<u.length;t++){var r,i=u[t],f=h.p,E=i[2];n>3?(r=E===o)&&(a=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((r=n<2&&f<i[1])?(s=0,h.v=o,h.n=i[1]):f<E&&(r=n<3||i[0]>o||o>E)&&(i[4]=n,i[5]=o,h.n=E,s=0))}if(r||n>1)return c;throw l=!0,o}return function(r,u,E){if(p>1)throw TypeError("Generator is already running");for(l&&1===u&&f(u,E),s=u,a=E;(t=s<2?e:a)||!l;){i||(s?s<3?(s>1&&(h.n=-1),f(s,a)):h.n=a:h.v=a);try{if(p=2,i){if(s||(r="next"),t=i[r]){if(!(t=t.call(i,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(a=TypeError("The iterator does not provide a '"+r+"' method"),s=1);i=e}else if((t=(l=h.n<0)?a:n.call(o,h))!==c)break}catch(t){i=e,s=1,a=t}finally{p=1}}return{value:t,done:l}}}(n,i,s),!0),u}var c={};function p(){}function u(){}function l(){}t=Object.getPrototypeOf;var h=[][i]?t(t([][i]())):(r(t={},i,function(){return this}),t),f=l.prototype=p.prototype=Object.create(h);function E(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,r(e,s,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=l,r(f,"constructor",l),r(l,"constructor",u),u.displayName="GeneratorFunction",r(l,s,"GeneratorFunction"),r(f),r(f,s,"Generator"),r(f,i,function(){return this}),r(f,"toString",function(){return"[object Generator]"}),(o=function(){return{w:a,m:E}})()}function r(e,t,n,o){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}r=function(e,t,n,o){function s(t,n){r(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[t]=n:(s("next",0),s("throw",1),s("return",2))},r(e,t,n,o)}function i(e,t,n,o,r,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(o,r)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(o,r){var s=e.apply(t,n);function a(e){i(s,o,r,a,c,"next",e)}function c(e){i(s,o,r,a,c,"throw",e)}a(void 0)})}}var a=n("LKDt"),c=n("MYiO"),p=n("PMEU"),u=n("D2Gh"),l=n("E7cO"),h=n("rvaB");function f(){}f.prototype.ViewTemplate="OpenPgpWebclient_PgpKeyControlsView";var E=function(){var e=s(o().m(function e(t,n,r){var i;return o().w(function(e){for(;;)switch(e.n){case 0:if("string"!=typeof t){e.n=2;break}return e.n=1,l.getKeysFromArmors([{Email:n,PublicPgpKey:t,UUID:r}]);case 1:return i=e.v,e.a(2,1===i.length?i[0]:null);case 2:return e.a(2,t)}},e)}));return function(t,n,o){return e.apply(this,arguments)}}();f.prototype.showArmor=function(){var e=s(o().m(function e(t,n,r){var i;return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,E(t,n,r);case 1:(i=e.v)&&p.showPopup(h,[i]);case 2:return e.a(2)}},e)}));return function(t,n,o){return e.apply(this,arguments)}}(),f.prototype.setAfterRemoveContactKeyHandler=function(e){this.afterRemoveContactKeyHandler="function"==typeof e?e:function(){}},f.prototype.removeKeyFromContacts=function(){var e=s(o().m(function e(t,n,r){return o().w(function(e){for(;;)switch(e.n){case 0:this.removeKey(t,n,r,"removeKeyFromContacts");case 1:return e.a(2)}},e,this)}));return function(t,n,o){return e.apply(this,arguments)}}(),f.prototype.removeKeyFromThisDevice=function(){var e=s(o().m(function e(t,n,r){return o().w(function(e){for(;;)switch(e.n){case 0:this.removeKey(t,n,r,"removeKeyFromThisDevice");case 1:return e.a(2)}},e,this)}));return function(t,n,o){return e.apply(this,arguments)}}(),f.prototype.removeKey=function(){var e=s(o().m(function e(t,n,r,i){var h,f,y,m=this;return o().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,E(t,n,r);case 1:h=e.v,f=function(){var e=s(o().m(function e(t){return o().w(function(e){for(;;)switch(e.n){case 0:if(!t){e.n=2;break}return e.n=1,l[i](h);case 1:e.v.result?m.afterRemoveContactKeyHandler():u.showError(a.i18n("OPENPGPWEBCLIENT/ERROR_DELETE_KEY"));case 2:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),y=a.i18n("OPENPGPWEBCLIENT/CONFIRM_DELETE_KEY",{KEYEMAIL:h.getEmail()}),p.showPopup(c,[y,f]);case 2:return e.a(2)}},e)}));return function(t,n,o,r){return e.apply(this,arguments)}}(),e.exports=new f},rPFn:(e,t,n)=>{var o=n("a7T2"),r=n("p09A"),i=n("LKDt"),s=n("D2Gh"),a=n("RIpb"),c=n("vfpp"),p=n("E7cO"),u=n("a9Z8");function l(){this.sText="",this.sAccountEmail="",this.sFromEmail="",this.oEncryptionKey=null,this.isEncryptedMessage=r.observable(!1),this.visibleDecryptControl=r.observable(!1),this.visibleVerifyControl=r.observable(!1)}l.prototype.ViewTemplate="OpenPgpWebclient_MessageControlsView",l.prototype.reset=function(){this.sText="",this.sAccountEmail="",this.sFromEmail="",this.isEncryptedMessage(!1),this.visibleDecryptControl(!1),this.visibleVerifyControl(!1)},l.prototype.assignMessagePaneExtInterface=function(e){this.oMessagePane=e},l.prototype.doAfterPopulatingMessage=function(e){var t=this;e&&e.bPlain?(this.sText=e.sRawText,this.sAccountEmail=e.sAccountEmail,this.sFromEmail=e.sFromEmail,u.enableOpenPgpInMail()?(this.isEncryptedMessage(-1!==e.sText.indexOf("-----BEGIN PGP MESSAGE-----")),this.visibleVerifyControl(-1!==e.sText.indexOf("-----BEGIN PGP SIGNED MESSAGE-----")),this.isEncryptedMessage()&&p.getEncryptionKeyFromArmoredMessage(this.sText).then(function(e){e?(t.visibleDecryptControl(!0),t.oEncryptionKey=e):t.visibleDecryptControl(!1)}),this.visibleDecryptControl(this.isEncryptedMessage())):this.visibleDecryptControl(!1),(this.visibleVerifyControl()||this.visibleDecryptControl())&&this.oMessagePane&&this.oMessagePane.changeText("<pre>"+i.encodeHtml(this.sText)+"</pre>")):this.reset()},l.prototype.decryptMessage=function(){var e=o.bind(function(e){e&&e.result&&!e.errors&&this.oMessagePane&&(this.oMessagePane.changeText("<pre>"+i.plainToHtml(e.result,!0)+"</pre>"),this.isEncryptedMessage(!1),this.visibleDecryptControl(!1),e.notices?s.showError(i.i18n("OPENPGPWEBCLIENT/ERROR_MESSAGE_SUCCESSFULLY_DECRYPTED_BUT_NOT_VERIFIED")):s.showReport(i.i18n("OPENPGPWEBCLIENT/REPORT_MESSAGE_SUCCESSFULLY_DECRYPTED_AND_VERIFIED")))},this);p.decryptAndVerify(this.sText,this.oEncryptionKey,this.sFromEmail,"",e,function(e){e&&(e.errors||e.notices)&&a.showPgpErrorByCode(e,c.PgpAction.DecryptVerify)&&s.showReport(i.i18n("OPENPGPWEBCLIENT/REPORT_MESSAGE_SUCCESSFULLY_DECRYPTED_AND_NOT_SIGNED"))})},l.prototype.verifyMessage=function(){var e=o.bind(function(e){e&&e.result&&!e.errors&&!e.notices&&this.oMessagePane&&(this.oMessagePane.changeText("<pre>"+i.encodeHtml(e.result)+"</pre>"),this.visibleVerifyControl(!1),s.showReport(i.i18n("OPENPGPWEBCLIENT/REPORT_MESSAGE_SUCCESSFULLY_VERIFIED")))},this);p.verify(this.sText,this.sFromEmail,e,function(e){e&&(e.errors||e.notices)&&a.showPgpErrorByCode(e,c.PgpAction.Verify)})},e.exports=new l},rvaB:(e,t,n)=>{var o=n("a7T2"),r=n("p09A"),i=n("LKDt"),s=n("8QQh"),a=n("5D2l"),c=n("D2Gh"),p=n("PMEU"),u=n("MYiO"),l=a.run("MailWebclient","getComposeMessageWithAttachments"),h=n("69av");function f(){h.call(this),this.bAllowSendEmails=o.isFunction(l),this.armor=r.observable(""),this.htmlArmor=r.computed(function(){return i.encodeHtml(this.armor().replace(/\r/g,""))},this),this.user=r.observable(""),this.private=r.observable(!1),this.popupHeading=r.computed(function(){return this.private()?i.i18n("OPENPGPWEBCLIENT/HEADING_VIEW_PRIVATE_KEY",{USER:this.user()}):i.i18n("OPENPGPWEBCLIENT/HEADING_VIEW_PUBLIC_KEY",{USER:this.user()})},this),this.downloadLinkHref=r.computed(function(){var e="#",t=null;return Blob&&window.URL&&o.isFunction(window.URL.createObjectURL)&&(t=new Blob([this.armor()],{type:"text/plain"}),e=window.URL.createObjectURL(t)),e},this),this.downloadLinkFilename=r.computed(function(){var e=this.user().replace(/</g,"").replace(/>/g,""),t=this.private()?"OPENPGPWEBCLIENT/TEXT_PRIVATE_KEY_FILENAME":"OPENPGPWEBCLIENT/TEXT_PUBLIC_KEY_FILENAME";return i.i18n(t,{USER:e})+".asc"},this),this.domKey=r.observable(null)}o.extendOwn(f.prototype,h.prototype),f.prototype.PopupTemplate="OpenPgpWebclient_ShowKeyArmorPopup",f.prototype.onOpen=function(e){this.armor(e.getArmor()),this.user(e.getUser()),this.private(e.isPrivate())},f.prototype.send=function(){var e=this,t=function(){e.bAllowSendEmails&&""!==e.armor()&&""!==e.downloadLinkFilename()&&s.send("OpenPgpWebclient","SaveKeyAsTempFile",{Content:e.armor(),FileName:e.downloadLinkFilename()},function(e){e.Result&&(l([e.Result]),this.closePopup())},e)};if(this.private()){var n=i.i18n("OPENPGPWEBCLIENT/CONFIRM_SEND_PRIVATE_KEY");p.showPopup(u,[n,function(e){e&&t()}])}else t()},f.prototype.select=function(){var e=this.domKey()&&1===this.domKey().length?this.domKey()[0]:null,t=null,n=null;e&&window.getSelection&&document.createRange&&((n=document.createRange()).setStart(e,0),n.setEnd(e,1),(t=window.getSelection()).removeAllRanges(),t.addRange(n),document.queryCommandSupported("copy")&&(document.execCommand("copy"),c.showReport(i.i18n("OPENPGPWEBCLIENT/REPORT_KEY_IN_CLIPBOARD"))))},e.exports=new f},xLBO:(e,t,n)=>{function o(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",s=n.toStringTag||"@@toStringTag";function a(n,o,i,s){var a=o&&o.prototype instanceof p?o:p,u=Object.create(a.prototype);return r(u,"_invoke",function(n,o,r){var i,s,a,p=0,u=r||[],l=!1,h={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,s=0,a=e,h.n=n,c}};function f(n,o){for(s=n,a=o,t=0;!l&&p&&!r&&t<u.length;t++){var r,i=u[t],f=h.p,E=i[2];n>3?(r=E===o)&&(a=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=f&&((r=n<2&&f<i[1])?(s=0,h.v=o,h.n=i[1]):f<E&&(r=n<3||i[0]>o||o>E)&&(i[4]=n,i[5]=o,h.n=E,s=0))}if(r||n>1)return c;throw l=!0,o}return function(r,u,E){if(p>1)throw TypeError("Generator is already running");for(l&&1===u&&f(u,E),s=u,a=E;(t=s<2?e:a)||!l;){i||(s?s<3?(s>1&&(h.n=-1),f(s,a)):h.n=a:h.v=a);try{if(p=2,i){if(s||(r="next"),t=i[r]){if(!(t=t.call(i,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(a=TypeError("The iterator does not provide a '"+r+"' method"),s=1);i=e}else if((t=(l=h.n<0)?a:n.call(o,h))!==c)break}catch(t){i=e,s=1,a=t}finally{p=1}}return{value:t,done:l}}}(n,i,s),!0),u}var c={};function p(){}function u(){}function l(){}t=Object.getPrototypeOf;var h=[][i]?t(t([][i]())):(r(t={},i,function(){return this}),t),f=l.prototype=p.prototype=Object.create(h);function E(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,r(e,s,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=l,r(f,"constructor",l),r(l,"constructor",u),u.displayName="GeneratorFunction",r(l,s,"GeneratorFunction"),r(f),r(f,s,"Generator"),r(f,i,function(){return this}),r(f,"toString",function(){return"[object Generator]"}),(o=function(){return{w:a,m:E}})()}function r(e,t,n,o){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}r=function(e,t,n,o){function s(t,n){r(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[t]=n:(s("next",0),s("throw",1),s("return",2))},r(e,t,n,o)}function i(e,t,n,o,r,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(o,r)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(o,r){var s=e.apply(t,n);function a(e){i(s,o,r,a,c,"next",e)}function c(e){i(s,o,r,a,c,"throw",e)}a(void 0)})}}var a=n("a7T2"),c=n("p09A"),p=n("8QQh"),u=n("5D2l").run("MailWebclient","getComposeMessageWithData"),l=n("69av"),h=n("LKDt");function f(){l.call(this),this.bAllowSendEmails=a.isFunction(u),this.sEmail=c.observable(""),this.oMessage=c.observable(null),this.sSendKeyText=c.observable(""),this.oPublicKey=null,this.downloadLinkFilename=c.observable("")}a.extendOwn(f.prototype,l.prototype),f.prototype.PopupTemplate="OpenPgpWebclient_SendKeyPopup",f.prototype.onOpen=function(e,t){this.oMessage(e),this.sEmail(e.oFrom.getFirstEmail()),this.sSendKeyText(h.i18n("OPENPGPWEBCLIENT/INFO_SEND_KEY",{EMAIL:this.sEmail()})),this.oPublicKey=t;var n=this.oPublicKey.getUser().replace(/</g,"").replace(/>/g,"");this.downloadLinkFilename(h.i18n("OPENPGPWEBCLIENT/TEXT_PUBLIC_KEY_FILENAME",{USER:n})+".asc")},f.prototype.sendKey=s(o().m(function e(){var t=this;return o().w(function(e){for(;;)switch(e.n){case 0:this.bAllowSendEmails&&""!==this.oPublicKey.getArmor()&&""!==this.downloadLinkFilename()&&p.send("OpenPgpWebclient","SaveKeyAsTempFile",{Content:this.oPublicKey.getArmor(),FileName:this.downloadLinkFilename()},function(e){e.Result&&(u({attachments:[e.Result],replyToMessage:t.oMessage()}),t.closePopup())},this);case 1:return e.a(2)}},e,this)})),e.exports=new f}}]);