{"version":3,"sources":["webpack:///./node_modules/matrix-react-sdk/src/async-components/views/dialogs/security/ExportE2eKeysDialog.js","webpack:///./node_modules/file-saver/FileSaver.js","webpack:///(webpack)/buildin/amd-define.js","webpack:///(webpack)/buildin/amd-options.js","webpack:///./node_modules/matrix-react-sdk/src/utils/MegolmExportEncryption.js"],"names":["ExportE2eKeysDialog","React","Component","constructor","props","super","ev","preventDefault","passphrase","this","_passphrase1","current","value","_passphrase2","setState","errStr","_t","_startExport","onFinished","_unmounted","createRef","state","phase","componentWillUnmount","Promise","resolve","then","matrixClient","exportRoomKeys","k","MegolmExportEncryption","JSON","stringify","f","blob","Blob","type","FileSaver","saveAs","catch","e","console","error","msg","friendlyText","render","BaseDialog","sdk","disableForm","className","title","onSubmit","_onPassphraseFormSubmit","htmlFor","ref","id","autoFocus","size","disabled","onClick","_onCancelClick","PropTypes","instanceOf","MatrixClient","isRequired","func","view","navigator","test","userAgent","doc","document","get_URL","URL","webkitURL","save_link","createElementNS","can_use_save_link","is_safari","HTMLElement","safari","is_chrome_ios","throw_outside","ex","setImmediate","setTimeout","revoke","file","revokeObjectURL","remove","auto_bom","String","fromCharCode","name","no_auto_bom","object_url","filesaver","force","dispatch_all","event_types","event","i","concat","length","listener","call","dispatch","split","readyState","INIT","createObjectURL","node","href","download","MouseEvent","dispatchEvent","DONE","FileReader","reader","onloadend","url","result","replace","open","location","undefined","readAsDataURL","fs_error","FS_proto","prototype","msSaveOrOpenBlob","abort","WRITING","onwritestart","onprogress","onwrite","onabort","onerror","onwriteend","self","window","content","module","exports","Error","__webpack_amd_options__","TextEncoder","TextEncodingUtf8","TextDecoder","subtleCrypto","crypto","subtle","webkitSubtle","friendlyError","cryptoFailMsg","async","decryptMegolmKeyFile","data","password","body","fileStr","decode","Uint8Array","lineStart","lineEnd","indexOf","line","slice","trim","HEADER_LINE","dataStart","dataEnd","base64","latin1String","atob","uint8Array","charCodeAt","decodeBase64","unpackMegolmKeyFile","brand","SdkConfig","get","ciphertextLength","salt","subarray","iv","iterations","ciphertext","hmac","aesKey","hmacKey","deriveKeys","toVerify","isValid","plaintext","verify","decrypt","counter","encryptMegolmKeyFile","options","kdfRounds","kdf_rounds","getRandomValues","encodedData","encode","encrypt","cipherArray","bodyLength","resultBuffer","idx","set","toSign","sign","hmacArray","nLines","Math","ceil","lines","Array","o","encodeBase64","join","buffer","packMegolmKeyFile","start","Date","key","keybits","importKey","deriveBits","hash","now","log","aesProm","hmacProm","all","apply","btoa"],"mappings":";oPA4Be,MAAMA,UAA4BC,IAAMC,UAMnDC,YAAYC,GACRC,MAAMD,GADS,mCAkBQE,IACvBA,EAAGC,iBAEH,MAAMC,EAAaC,KAAKC,aAAaC,QAAQC,MAC7C,OAAIJ,IAAeC,KAAKI,aAAaF,QAAQC,OACzCH,KAAKK,SAAS,CAACC,OAAQC,YAAG,6BACnB,GAENR,GAKLC,KAAKQ,aAAaT,IACX,IALHC,KAAKK,SAAS,CAACC,OAAQC,YAAG,mCACnB,KA5BI,0BAoEDV,IACdA,EAAGC,iBACHE,KAAKL,MAAMc,YAAW,IACf,IApEPT,KAAKU,YAAa,EAElBV,KAAKC,aAAeU,sBACpBX,KAAKI,aAAeO,sBAEpBX,KAAKY,MAAQ,CACTC,MAlBO,EAmBPP,OAAQ,MAIhBQ,uBACId,KAAKU,YAAa,EAoBtBF,aAAaT,GAGTgB,QAAQC,UAAUC,KAAK,IACZjB,KAAKL,MAAMuB,aAAaC,kBAChCF,KAAMG,GACEC,IACHC,KAAKC,UAAUH,GAAIrB,IAExBkB,KAAMO,IACL,MAAMC,EAAO,IAAIC,KAAK,CAACF,GAAI,CACvBG,KAAM,gCAEVC,IAAUC,OAAOJ,EAAM,oBACvBzB,KAAKL,MAAMc,YAAW,KACvBqB,MAAOC,IAEN,GADAC,QAAQC,MAAM,4BAA6BF,GACvC/B,KAAKU,WACL,OAEJ,MAAMwB,EAAMH,EAAEI,cAAgB5B,YAAG,iBACjCP,KAAKK,SAAS,CACVC,OAAQ4B,EACR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