www.federated.computer/public/target/assets/olm_legacy.9dc48f49.js

181 lines
444 KiB
JavaScript
Raw Normal View History

2023-09-19 19:27:32 +00:00
// @license magnet:?xt=urn:btih:8e4f440f4c65981c5bf93c76d35135ba5064d8b7&dn=apache-2.0.txt Apache-2.0
// @source: https://gitlab.matrix.org/matrix-org/olm/-/tree/3.2.8
var Olm = (function() {
var olm_exports = {};
var onInitSuccess;
var onInitFail;
var Module = (function() {
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
return (
function(Module) {
Module = Module || {};
var a;a||(a=typeof Module !== 'undefined' ? Module : {});var aa,ba;a.ready=new Promise(function(b,c){aa=b;ba=c});var g;if("undefined"!==typeof window)g=function(b){window.crypto.getRandomValues(b)};else if(module.exports){var ca=require("crypto");g=function(b){var c=ca.randomBytes(b.length);b.set(c)};process=global.process}else throw Error("Cannot find global to attach library to");
if("undefined"!==typeof OLM_OPTIONS)for(var da in OLM_OPTIONS)OLM_OPTIONS.hasOwnProperty(da)&&(a[da]=OLM_OPTIONS[da]);a.onRuntimeInitialized=function(){h=a._olm_error();olm_exports.PRIVATE_KEY_LENGTH=a._olm_pk_private_key_length();onInitSuccess&&onInitSuccess()};a.onAbort=function(b){onInitFail&&onInitFail(b)};var ea={},l;for(l in a)a.hasOwnProperty(l)&&(ea[l]=a[l]);
var fa="object"===typeof window,ha="function"===typeof importScripts,ia="object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node,m="",ka,la,ma,n,q;
if(ia)m=ha?require("path").dirname(m)+"/":__dirname+"/",ka=function(b,c){var d=r(b);if(d)return c?d:d.toString();n||(n=require("fs"));q||(q=require("path"));b=q.normalize(b);return n.readFileSync(b,c?null:"utf8")},ma=function(b){b=ka(b,!0);b.buffer||(b=new Uint8Array(b));b.buffer||t("Assertion failed: undefined");return b},la=function(b,c,d){var e=r(b);e&&c(e);n||(n=require("fs"));q||(q=require("path"));b=q.normalize(b);n.readFile(b,function(f,k){f?d(f):c(k.buffer)})},1<process.argv.length&&process.argv[1].replace(/\\/g,
"/"),process.argv.slice(2),process.on("uncaughtException",function(b){throw b;}),process.on("unhandledRejection",t),a.inspect=function(){return"[Emscripten Module object]"};else if(fa||ha)ha?m=self.location.href:"undefined"!==typeof document&&document.currentScript&&(m=document.currentScript.src),_scriptDir&&(m=_scriptDir),0!==m.indexOf("blob:")?m=m.substr(0,m.lastIndexOf("/")+1):m="",ka=function(b){try{var c=new XMLHttpRequest;c.open("GET",b,!1);c.send(null);return c.responseText}catch(f){if(b=r(b)){c=
[];for(var d=0;d<b.length;d++){var e=b[d];255<e&&(na&&t("Assertion failed: Character code "+(e+" ("+String.fromCharCode(e)+") at offset "+d+" not in 0x00-0xFF.")),e&=255);c.push(String.fromCharCode(e))}return c.join("")}throw f;}},ha&&(ma=function(b){try{var c=new XMLHttpRequest;c.open("GET",b,!1);c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)}catch(d){if(b=r(b))return b;throw d;}}),la=function(b,c,d){var e=new XMLHttpRequest;e.open("GET",b,!0);e.responseType="arraybuffer";
e.onload=function(){if(200==e.status||0==e.status&&e.response)c(e.response);else{var f=r(b);f?c(f.buffer):d()}};e.onerror=d;e.send(null)};a.print||console.log.bind(console);var oa=a.printErr||console.warn.bind(console);for(l in ea)ea.hasOwnProperty(l)&&(a[l]=ea[l]);ea=null;var u;a.wasmBinary&&(u=a.wasmBinary);var noExitRuntime=a.noExitRuntime||!0;function pa(){this.buffer=new ArrayBuffer(qa/65536*65536)}function ra(){this.exports=(
// EMSCRIPTEN_START_ASM
function instantiate(ea){function c(d){d.set=function(a,b){this[a]=b};d.get=function(a){return this[a]};return d}var e;var f=new Uint8Array(123);for(var a=25;a>=0;--a){f[48+a]=52+a;f[65+a]=a;f[97+a]=26+a}f[43]=62;f[47]=63;function l(m,n,o){var g,h,a=0,i=n,j=o.length,k=n+(j*3>>2)-(o[j-2]=="=")-(o[j-1]=="=");for(;a<j;a+=4){g=f[o.charCodeAt(a+1)];h=f[o.charCodeAt(a+2)];m[i++]=f[o.charCodeAt(a)]<<2|g>>4;if(i<k)m[i++]=g<<4|h>>2;if(i<k)m[i++]=h<<6|f[o.charCodeAt(a+3)]}}function p(q){l(e,1024,"QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrL/////////////////////////////////////////////////////////8+////PzQ1Njc4OTo7PD3/////////AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBn///////8aGxwdHh8gISIjJCUmJygpKissLS4vMDEyM///////LSsgICAwWDB4AC0wWCswWCAwWC0weCsweCAweABuYW4AaW5mAFBpY2tsZQAgJWQAQkFEX0FDQ09VTlRfS0VZAEJBRF9TRVNTSU9OX0tFWQBVTktOT1dOX01FU1NBR0VfSU5ERVgAT0xNX1NBU19USEVJUl9LRVlfTk9UX1NFVABCQURfTUVTU0FHRV9GT1JNQVQATUVHT0xNX0tFWVMAU1VDQ0VTUwBVTktOT1dOX0VSUk9SAFVOS05PV05fUElDS0xFX1ZFUlNJT04AQkFEX01FU1NBR0VfVkVSU0lPTgBOQU4ATk9UX0VOT1VHSF9SQU5ET00AT1VUUFVUX0JVRkZFUl9UT09fU01BTEwAT0xNX0lOUFVUX0JVRkZFUl9UT09fU01BTEwASU5GAEJBRF9TSUdOQVRVUkUAQkFEX0xFR0FDWV9BQ0NPVU5UX1BJQ0tMRQBDT1JSVVBURURfUElDS0xFAEJBRF9NRVNTQUdFX0tFWV9JRABCQURfTUVTU0FHRV9NQUMAT0xNX1BJQ0tMRV9FWFRSQV9EQVRBACBza2lwcGVkIG1lc3NhZ2Uga2V5czoAcmVjZWl2ZXIgY2hhaW4gaW5kaWNlczoAImN1cnZlMjU1MTkiOgAiZWQyNTUxOSI6AElOVkFMSURfQkFTRTY0AC4AKG51bGwpAHNlbmRlciBjaGFpbiBpbmRleDogJWQgAAD0BgAACAAAAP0GAAALAAAAbAcAAAkHAAAIAAAAT0xNX1JPT1QAT0xNX1JBVENIRVQAT0xNX0tFWVM=");l(e,1856,"CQ==");l(e,1888,"bAcAANYGAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAABAg==");l(e,1936,"tnhZ/4Vy0wC9bhX/DwpqACnAAQCY6Hn/vDyg/5lxzv8At+L+tA1I/wAAAAAAAAAAsKAO/tPJhv+eGI8Af2k1AGAMvQCn1/v/n0yA/mpl4f8e/AQAkgyu");l(e,2032,"WfGy/grlpv973Sr+HhTUAFKAAwAw0fMAd3lA/zLjnP8AbsUBZxuQ");l(e,2080,"hTuMAb3xJP/4JcMBYNw3ALdMPv/DQj0AMkykAeGkTP9MPaP/dT4fAFGRQP92QQ4AonPW/waKLgB85vT/CoqPADQawgC49EwAgY8pAb70E/97qnr/YoFEAHnVkwBWZR7/oWebAIxZQ//v5b4BQwu1AMbwif7uRbz/6nE8/yX/Of9Fsrb+gNCzAHYaff4DB9b/8TJN/1XLxf/Th/r/GTBk/7vVtP4RWGkAU9GeAQVzYgAErjz+qzdu/9m1Ef8UvKoAkpxm/lfWrv9yepsB6SyqAH8I7wHW7OoArwXbADFqPf8GQtD/Ampu/1HqE//Xa8D/Q5fuABMqbP/lVXEBMkSH/xFqCQAyZwH/UAGoASOYHv8QqLkBOFno/2XS/AAp+kcAzKpP/w4u7/9QTe8AvdZL/xGN+QAmUEz/vlV1AFbkqgCc2NABw8+k/5ZCTP+v4RD/jVBiAUzb8gDGonIALtqYAJsr8f6boGj/sgn8/mRu1AAOBacA6e+j/xyXnQFlkgr//p5G/kf55ABYHjIARDqg/78YaAGBQoH/wDJV/wiziv8m+skAc1CgAIPmcQB9WJMAWkTHAP1MngAc/3YAcfr+AEJLLgDm2isA5Xi6AZREKwCIfO4Bu2vF/1Q19v8zdP7/M7ulAAIRrwBCVKAB9zoeACNBNf5F7L8ALYb1AaN73QAgbhT/NBelALrWRwDpsGAA8u82ATlZigBTAFT/iKBkAFyOeP5ofL4AtbE+//opVQCYgioBYPz2AJeXP/7vhT4AIDicAC2nvf+OhbMBg1bTALuzlv76qg7/RHEV/966O/9CB/EBRQZIAFacbP43p1kAbTTb/g2wF//ELGr/75VH/6SMff+frQEAMynnAJE+IQCKb10BuVNFAJBzLgBhlxD/GOQaADHZ4gBxS+r+wZkM/7YwYP8ODRoAgMP5/kXBOwCEJVH+fWo8ANbwqQGk40IA0qNOACU0lwBjTRoA7pzV/9XA0QFJLlQAFEEpATbOTwDJg5L+qm8Y/7EhMv6rJsv/Tvd0ANHdmQCFgLIBOiwZAMknOwG9E/wAMeXSAXW7dQC1s7gBAHLbADBekwD1KTgAfQ3M/vStdwAs3SD+VOoUAPmgxgHsfur/jz7dAIFZ1v83iwX+RBS//w7MsgEjw9kALzPOASb2pQDOGwb+nlckANk0kv99e9f/VTwf/6sNBwDa9Vj+/CM8ADfWoP+FZTgA4CAT/pNA6gAakaIBcnZ9APj8+gBlXsT/xo3i/jMqtgCHDAn+bazS/8XswgHxQZoAMJwv/5lDN//apSL+SrSzANpCRwFYemMA1LXb/1wq5//vAJoA9U23/15RqgES1dgAq11HADRe+AASl6H+xdFC/670D/6iMLcAMT3w/rZdwwDH5AYByAUR/4kt7f9slAQAWk/t/yc/Tf81Us8BjhZ2/2XoEgFcGkMABchY/yGoiv+V4UgAAtEb/yz1qAHc7RH/HtNp/o3u3QCAUPX+b/4OAN5fvgHfCfEAkkzU/2zNaP8/dZkAkEUwACPkbwDAIcH/cNa+/nOYlwAXZlgAM0r4AOLHj/7MomX/0GG9AfVoEgDm9h7/F5RFAG5YNP7itVn/0C9a/nKhUP8hdPgAs5hX/0WQsQFY7hr/OiBxAQFNRQA7eTT/mO5TADQIwQDnJ+n/xyKKAN5ErQBbOfL+3NJ//8AH9v6XI7sAw+ylAG9dzgDU94UBmoXR/5vnCgBATiYAevlkAR4TYf8+W/kB+IVNAMU/qP50ClIAuOxx/tTLwv89ZPz+JAXK/3dbmf+BTx0AZ2er/u3Xb//YNUUA7/AXAMKV3f8m4d4A6P+0/nZShf850bEBi+iFAJ6wLv7Ccy4AWPflARxnvwDd3q/+lessAJfkGf7aaWcAjlXSAJWBvv/VQV7+dYbg/1LGdQCd3dwAo2UkAMVyJQBorKb+C7YAAFFIvP9hvBD/RQYKAMeTkf8ICXMBQdav/9mt0QBQf6YA9+UE/qe3fP9aHMz+rzvw/wsp+AFsKDP/kLHD/pb6fgCKW0EBeDze//XB7wAd1r3/gAIZAFCaogBN3GsB6s1K/zamZ/90SAkA5F4v/x7IGf8j1ln/PbCM/1Pio/9LgqwAgCYRAF+JmP/XfJ8BT10AAJRSnf7Dgvv/KMpM//t+4ACdYz7+zwfh/2BEwwCMup3/gxPn/yqA/gA02z3+ZstIAI0HC/+6pNUAH3p3AIXykQDQ/Oj/W9W2/48E+v7510oApR5vAasJ3wDleyIBXIIa/02bLQHDix
// EMSCRIPTEN_START_FUNCS
function Jb(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,H=0,I=0,J=0,K=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ha=0,ia=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ta=0,ua=0,va=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0,Oa=0,Pa=0,Qa=0,Ra=0,Sa=0,Ta=0,Ua=0,Va=0,Wa=0,Xa=0,Ya=0,Za=0,_a=0,$a=0,ab=0;g=_-2592|0;_=g;d=G[b+28|0]|G[b+29|0]<<8|(G[b+30|0]<<16|G[b+31|0]<<24);F[g+24>>2]=G[b+24|0]|G[b+25|0]<<8|(G[b+26|0]<<16|G[b+27|0]<<24);F[g+28>>2]=d;d=G[b+20|0]|G[b+21|0]<<8|(G[b+22|0]<<16|G[b+23|0]<<24);F[g+16>>2]=G[b+16|0]|G[b+17|0]<<8|(G[b+18|0]<<16|G[b+19|0]<<24);F[g+20>>2]=d;d=G[b+4|0]|G[b+5|0]<<8|(G[b+6|0]<<16|G[b+7|0]<<24);f=G[b|0]|G[b+1|0]<<8|(G[b+2|0]<<16|G[b+3|0]<<24);F[g>>2]=f;F[g+4>>2]=d;d=G[b+12|0]|G[b+13|0]<<8|(G[b+14|0]<<16|G[b+15|0]<<24);F[g+8>>2]=G[b+8|0]|G[b+9|0]<<8|(G[b+10|0]<<16|G[b+11|0]<<24);F[g+12>>2]=d;D[g|0]=f&248;D[g+31|0]=G[g+31|0]&63|64;j=G[c+3|0];d=j;b=d<<24&50331648;f=G[c+2|0];d=f>>>16|0;F[g+112>>2]=b|(G[c|0]|G[c+1|0]<<8|f<<16);F[g+116>>2]=d;d=G[c+4|0];f=d>>>24|0;b=d<<8|j;e=G[c+5|0];d=e>>>16|0;e=b|e<<16;j=d|f;s=G[c+6|0];d=s;f=d>>>8|0;h=d<<24;d=f|j;f=e|h;F[g+120>>2]=((d&3)<<30|f>>>2)&33554431;F[g+124>>2]=0;d=G[c+7|0];f=d>>>24|0;b=d<<8|s;e=G[c+8|0];d=e>>>16|0;e=b|e<<16;j=d|f;s=G[c+9|0];d=s;f=d>>>8|0;h=d<<24;d=f|j;f=e|h;F[g+128>>2]=((d&7)<<29|f>>>3)&67108863;F[g+132>>2]=0;d=G[c+10|0];f=d>>>24|0;b=d<<8|s;e=G[c+11|0];d=e>>>16|0;e=b|e<<16;j=d|f;s=G[c+12|0];d=s;f=d>>>8|0;h=d<<24;d=f|j;f=e|h;F[g+136>>2]=((d&31)<<27|f>>>5)&33554431;F[g+140>>2]=0;d=G[c+13|0];f=d>>>24|0;b=d<<8|s;e=G[c+14|0];d=e>>>16|0;e=b|e<<16;j=d|f;d=G[c+15|0];f=d>>>8|0;e=d<<24|e;f=f|j;d=f>>>6|0;F[g+144>>2]=(f&63)<<26|e>>>6;F[g+148>>2]=d;j=G[c+19|0];d=j;b=d<<24&16777216;d=G[c+18|0];f=d>>>16|0;F[g+152>>2]=b|(G[c+16|0]|G[c+17|0]<<8|d<<16);F[g+156>>2]=f;f=G[c+20|0];d=f>>>24|0;e=f<<8|j;f=d;b=e;e=G[c+21|0];d=e>>>16|0;e=b|e<<16;j=d|f;s=G[c+22|0];f=s;d=f>>>8|0;f=f<<24|e;d=d|j;F[g+160>>2]=((d&1)<<31|f>>>1)&67108863;F[g+164>>2]=0;f=G[c+23|0];d=f>>>24|0;b=f<<8|s;e=G[c+24|0];f=e>>>16|0;e=b|e<<16;j=d|f;s=G[c+25|0];f=s;d=f>>>8|0;f=f<<24|e;d=d|j;F[g+168>>2]=((d&7)<<29|f>>>3)&33554431;F[g+172>>2]=0;f=G[c+26|0];d=f>>>24|0;e=f<<8|s;f=d;b=e;e=G[c+27|0];d=e>>>16|0;e=b|e<<16;j=d|f;s=G[c+28|0];f=s;d=f>>>8|0;f=f<<24|e;d=d|j;F[g+176>>2]=((d&15)<<28|f>>>4)&67108863;F[g+180>>2]=0;f=G[c+29|0];d=f>>>24|0;b=f<<8|s;e=G[c+30|0];f=e>>>16|0;e=b|e<<16;f=d|f;c=G[c+31|0];d=c>>>8|0;j=c<<24;c=d|f;d=e|j;F[g+184>>2]=((c&63)<<26|d>>>6)&33554431;F[g+188>>2]=0;z=g+1152|0;ra(z,0,152);F[g+1152>>2]=1;F[g+1156>>2]=0;b=g+992|0;ra(b,0,152);F[g+992>>2]=1;F[g+996>>2]=0;c=g+832|0;ra(c,0,152);j=g+672|0;ra(j,0,152);k=g+512|0;ra(k,0,152);F[g+512>>2]=1;F[g+516>>2]=0;r=g+352|0;ra(r,0,152);Q=g+192|0;ra(Q,0,152);F[g+192>>2]=1;F[g+196>>2]=0;ra(g+1392|0,0,72);t=g+1312|0;ja(t,g+112|0,80);Ma=g+2512|0;while(1){ua=G[(g-ta|0)+31|0];va=0;while(1){J=j;H=0-((ua&128)>>>7|0)|0;j=t;f=F[j>>2];e=F[b>>2];d=H&(f^e);s=b;e=d^e;F[b>>2]=e;F[b+4>>2]=e>>31;d=d^f;F[j>>2]=d;F[j+4>>2]=d>>31;f=F[j+8>>2];e=F[b+8>>2];d=H&(f^e);e=d^e;F[b+8>>2]=e;F[b+12>>2]=e>>31;d=d^f;F[j+8>>2]=d;F[j+12>>2]=d>>31;f=F[j+16>>2];e=F[b+16>>2];d=H&(f^e);e=d^e;F[b+16>>2]=e;F[b+20>>2]=e>>31;d=d^f;F[j+16>>2]=d;F[j+20>>2]=d>>31;f=F[j+24>>2];e=F[b+24>>2];d=H&(f^e);e=d^e;F[b+24>>2]=e;F[b+28>>2]=e>>31;d=d^f;F[j+24>>2]=d;F[j+28>>2]=d>>31;f=F[j+32>>2];e=F[b+32>>2];d=H&(f^e);e=d^e;F[b+32>>2]=e;F[b+36>>2]=e>>31;d=d^f;F[j+32>>2]=d;F[j+36>>2]=d>>31;f=F[j+40>>2];e=F[b+40>>2];d=H&(f^e);e=d^e;F[b+40>>2]=e;F[b+44>>2]=e>>31;d=d^f;F[j+40>>2]=d;F[j+44>>2]=d>>31;f=F[j+48>>2];e=F[b+48>>2];d=H&(f^e);e=d^e;F[b+48>>2]=e;F[b+52>>2]=e>>31;d=d^f;F[j+48>>2]=d;F[j+52>>2]=d>>31;f=F[j+56>>2];e=F[b+56>>2];d=H&(f^e);e=d^e;F[b+56>>2]=e;F[b+60>>2]=e>>31;d=d^f;F[j+56>>2]=d;F[j+60>>2]=d>>31;f=F[j+64>>2];e=F[b+64>>2];d=H&(f^e);e=d^e;F[b+64>>2]=e;F[b+68>>2]=e>>31;d=d^f;F[j+64>>2]=d;F[j+68>>2]=d>>31;f=F[j+72>>2];e=F[b+72>>2];d=H&(f^e);e=d^e;F[b+72>>2]=e;F[b+76>>2]=e>>31;d=d^f;F[j+72>>2]=d;F[j+76>>2]=d>>31;h=z;f=F[h>>2];e=F[c>>2];d=H&(f^e)
function hd(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0;f=_-16|0;_=f;b=Xa(b,c,d,e,a+228|0);a:{if((b|0)!=-1){b=b+d|0;c=kb(d,b,f+12|0);b:{if(!c){d=10;break b}d=9;if(F[f+12>>2]!=1){break b}c=lb(a,c,b);if(!c){d=10;break b}d=10;c=Qb(c,b,a+132|0);if(!c){break b}d=17;if((b|0)==(c|0)){break a}}F[a+228>>2]=d}e=-1}_=f+16|0;return e|0}function Fd(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0;d=_-32|0;_=d;e=-1;c=Ma(b,c,b);a:{if((c|0)==-1){F[a+300>>2]=7;break a}f=b;b=F[9380];Cb(f,c,aa[F[F[b>>2]>>2]](b)|0,d+8|0);if(G[d+8|0]!=3){F[a+300>>2]=3;break a}if(!F[d+20>>2]){F[a+300>>2]=4;break a}a=F[9380];e=aa[F[F[a>>2]+12>>2]](a,F[d+24>>2])|0}_=d+32|0;return e|0}function vb(a,b,c){var d=0;d=_-112|0;_=d;F[d+80>>2]=1779033703;F[d+84>>2]=-1150833019;F[d+72>>2]=0;F[d+76>>2]=0;F[d+64>>2]=0;F[d+104>>2]=528734635;F[d+108>>2]=1541459225;F[d+96>>2]=1359893119;F[d+100>>2]=-1694144372;F[d+88>>2]=1013904242;F[d+92>>2]=-1521486534;pa(d,a,b);Ba(d,c);ia(d,112);_=d+112|0}function Ja(a,b){var c=0,d=0,e=0;c=32;a:{b:{if((a|b)&3){break b}while(1){if(F[a>>2]!=F[b>>2]){break b}b=b+4|0;a=a+4|0;c=c-4|0;if(c>>>0>3){continue}break}if(!c){break a}}while(1){d=G[a|0];e=G[b|0];if((d|0)==(e|0)){b=b+1|0;a=a+1|0;c=c-1|0;if(c){continue}break a}break}return d-e|0}return 0}function ia(a,b){var c=0,d=0;a:{if(!b){break a}c=a;d=b&7;if(d){while(1){D[c|0]=0;c=c+1|0;d=d-1|0;if(d){continue}break}}if(b-1>>>0<7){break a}a=a+b|0;while(1){D[c|0]=0;D[c+1|0]=0;D[c+2|0]=0;D[c+3|0]=0;D[c+4|0]=0;D[c+5|0]=0;D[c+6|0]=0;D[c+7|0]=0;c=c+8|0;if((a|0)!=(c|0)){continue}break}}}function Rd(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0;h=_-32|0;_=h;a:{if((oa(c)|0)!=32){F[a>>2]=7;c=-1;break a}qa(b,c,h);c=-1;b=oa(g);if((b|0)==-1){F[a>>2]=7;break a}qa(f,g,f);b:{if(b>>>0>=64){c=0;if(fb(h,d,e,f)){break b}}F[a>>2]=5;c=-1}}_=h+32|0;return c|0}function Na(a,b,c){var d=0,e=0,f=0;a:{if(b>>>0<1){d=a;break a}while(1){d=re(a,b,10);e=$;f=e;e=qe(d,e,10,0);c=c-1|0;D[c|0]=a-e|48;e=b>>>0>9;a=d;b=f;if(e){continue}break}}if(d){while(1){c=c-1|0;a=(d>>>0)/10|0;D[c|0]=d-L(a,10)|48;b=d>>>0>9;d=a;if(b){continue}break}}return c}function pa(a,b,c){var d=0,e=0,f=0;if(c){d=F[a+64>>2];while(1){D[a+d|0]=G[b+e|0];d=F[a+64>>2]+1|0;F[a+64>>2]=d;if((d|0)==64){jb(a,a);F[a+64>>2]=0;d=F[a+76>>2];f=F[a+72>>2]+512|0;d=f>>>0<512?d+1|0:d;F[a+72>>2]=f;F[a+76>>2]=d;d=0}e=e+1|0;if((e|0)!=(c|0)){continue}break}}}function rd(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0;h=_+-64|0;_=h;a:{if(g>>>0<43){F[a>>2]=2;a=-1;break a}if(!F[a+100>>2]){F[a>>2]=16;a=-1;break a}g=a+68|0;a=h+32|0;Aa(g,32,0,0,d,e,a,32);ka(a,32,b,c,h);Ca(h,32,f);a=0}_=h- -64|0;return a|0}function je(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;a:{if(c>>>0<=31){F[a+7516>>2]=1;a=-1;break a}d=G[a+7364|0];if(d>>>0<=1){D[a+7364|0]=d+1}ja(a+7440|0,a+7368|0,72);D[a+7372|0]=0;d=F[a+7512>>2]+1|0;F[a+7368>>2]=d;F[a+7512>>2]=d;Ea(b,a+7373|0);a=1}ia(b,c);return a|0}function Fb(a,b){var c=0,d=0,e=0;A(+a);c=v(1)|0;d=v(0)|0;e=c;c=c>>>20&2047;if((c|0)!=2047){if(!c){c=b;if(a==0){b=0}else{a=Fb(a*0x10000000000000000,b);b=F[b>>2]+-64|0}F[c>>2]=b;return a}F[b>>2]=c-1022;x(0,d|0);x(1,e&-2146435073|1071644672);a=+z()}return a}function pd(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0;h=_-256|0;_=h;a:{if(g>>>0<43){F[a>>2]=2;a=-1;break a}if(!F[a+100>>2]){F[a>>2]=16;a=-1;break a}Aa(a+68|0,32,0,0,d,e,h,256);ka(h,256,b,c,f);Ca(f,32,f);a=0}_=h+256|0;return a|0}function qd(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0;h=_-32|0;_=h;a:{if(g>>>0<43){F[a>>2]=2;a=-1;break a}if(!F[a+100>>2]){F[a>>2]=16;a=-1;break a}Aa(a+68|0,32,0,0,d,e,h,32);ka(h,32,b,c,f);Ca(f,32,f);a=0}_=h+32|0;return a|0}function Xa(a,b,c,d,e){var f=0,g=0;f=-1;g=oa(d);a:{b:{if((g|0)==-1){c=7;if(e){break b}break a}Ma(c,d,c);d=a;a=g-(aa[F[475]](33528)|0)|0;f=aa[F[479]](33528,d,b,c,g,c,a,c,a)|0;if((f|0)!=-1){return f}c=8;if(!e){break a}}F[e>>2]=c;f=-1}return f}function Ob(a){var b=0,c=0,d=0;d=4;b=a+164|0;c=F[a+160>>2];if((b|0)!=(c|0)){while(1){d=d+69|0;b=b+72|0;if((c|0)!=(b|0)){continue}break}}b=d+165|0;c=b;a:{if(!G[a+7364|0]){break a}b=b+69|0;c=b;if(G[a+7364|0]<2){break a}c=b+69|0}return c
function Vb(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;if(e>>>0<86){F[a+7516>>2]=2;return-1}e=a;a=d+22|0;$a(e,b,c,a);na(a,64,d);return 86}function Bb(a){F[a+8>>2]=0;F[a+4>>2]=1768;F[a>>2]=1752;F[a+492>>2]=a+496;F[a+148>>2]=a+152;F[a+44>>2]=a+48;D[a+3220|0]=0;F[a+3216>>2]=0}function yc(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;if(e>>>0<86){F[a>>2]=2;return-1}e=a+4|0;a=d+22|0;$a(e,b,c,a);na(a,64,d);return 86}function ce(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=oa(d);if((e|0)==-1){F[a+3216>>2]=7;return-1}qa(c,d,c);return Ab(a,b,0,c,e)|0}function Zb(a,b,c){a=a|0;b=b|0;c=c|0;a:{if(c>>>0<=63){F[a+7516>>2]=1;a=-1;break a}gb(b,a);Ea(b+32|0,a+96|0);a=0}ia(b,c);return a|0}function la(a,b){b=b<<8&16711680|b<<24|(b>>>8&65280|b>>>24);D[a|0]=b;D[a+1|0]=b>>>8;D[a+2|0]=b>>>16;D[a+3|0]=b>>>24;return a+4|0}function Sd(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;if(e>>>0<43){F[a>>2]=2;return-1}vb(b,c,d+11|0);na(d+11|0,32,d);return 43}function sd(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;if(!F[a+100>>2]){F[a>>2]=16;return-1}Aa(a+68|0,32,0,0,b,c,d,e);return 0}function fd(a,b,c){a=a|0;b=b|0;c=c|0;if(c>>>0<=159){F[a+228>>2]=1;return-1}_a(a,b,0);gb(b+128|0,a+132|0);ia(b,c);return 0}function _d(a,b,c){a=a|0;b=b|0;c=c|0;var d=0;d=oa(c);if((d|0)==-1){F[a+3216>>2]=7;return-1}qa(b,c,b);return zb(a,0,b,d)|0}function Da(a){var b=0;b=(aa[F[476]](33528,a)+aa[F[475]](33528)|0)+2|0;a=(b>>>0)/3|0;return((b-L(a,3)|0)+(a<<2)|0)-2|0}function Sa(a,b,c,d){var e=0,f=0;a:{if(!a){break a}e=b;b=a+d|0;if(e>>>0<b>>>0){break a}ja(c,a,d);f=b}return f}function Pc(a,b){a=a|0;b=b|0;b=(aa[F[476]](F[9136],b)|0)+2|0;a=(b>>>0)/3|0;return((b-L(a,3)|0)+(a<<2)|0)-2|0}function Oc(a){a=a|0;var b=0;b=(aa[F[475]](F[9136])|0)+2|0;a=(b>>>0)/3|0;return((b-L(a,3)|0)+(a<<2)|0)-2|0}function gc(a){a=a|0;ia(a,7520);F[a+7512>>2]=0;F[a+7516>>2]=0;D[a+7364|0]=0;F[a+160>>2]=a+164;return 7520}function wd(a,b,c){a=a|0;b=b|0;c=c|0;if(c>>>0<=31){F[a>>2]=1;return-1}Ea(b,a+4|0);F[a+100>>2]=0;return 0}function jc(a){a=a|0;ia(a,7520);F[a+7512>>2]=0;F[a+7516>>2]=0;D[a+7364|0]=0;F[a+160>>2]=a+164;return a|0}function cd(a,b,c){a=a|0;b=b|0;c=c|0;if(c>>>0<43){F[a+228>>2]=2;return-1}return Ca(a+132|0,32,b)|0}function Dd(a,b,c){a=a|0;b=b|0;c=c|0;if(c>>>0<43){F[a+300>>2]=2;return-1}return Ca(a+264|0,32,b)|0}function qc(a){a=a|0;a=F[a+7516>>2];if(a>>>0<=17){a=F[(a<<2)+33456>>2]}else{a=1383}return a|0}function oc(a){a=a|0;a=F[a+3216>>2];if(a>>>0<=17){a=F[(a<<2)+33456>>2]}else{a=1383}return a|0}function Qc(a,b,c){a=a|0;b=b|0;c=c|0;if(c>>>0<43){F[a>>2]=15;return-1}qa(b,43,a+4|0);return 0}function vd(a,b,c){a=a|0;b=b|0;c=c|0;if(c>>>0<43){F[a>>2]=2;return-1}Ca(a+4|0,32,b);return 0}function ld(a){a=a|0;a=F[a+228>>2];if(a>>>0<=17){a=F[(a<<2)+33456>>2]}else{a=1383}return a|0}function Md(a){a=a|0;a=F[a+300>>2];if(a>>>0<=17){a=F[(a<<2)+33456>>2]}else{a=1383}return a|0}function Wd(a,b){a=a|0;b=b|0;b=xb(a,b)+2|0;a=(b>>>0)/3|0;return((b-L(a,3)|0)+(a<<2)|0)-2|0}function Va(a){a=a|0;a=F[a>>2];if(a>>>0<=17){a=F[(a<<2)+33456>>2]}else{a=1383}return a|0}function se(a,b){var c=0,d=0;c=b&31;d=(-1>>>c&a)<<c;c=a;a=0-b&31;return d|(c&-1<<a)>>>a}function oa(a){if((a&3)!=1){a=a+2|0;a=((a&3)+L(a>>>2|0,3)|0)-2|0}else{a=-1}return a}function sc(a,b,c){a=a|0;b=b|0;c=c|0;if(a){D[a|0]=3}if(b){D[b|0]=2}if(c){D[c|0]=8}}function lb(a,b,c){b=Sa(b,c,a,128);if(!b){return 0}return kb(b,c,a+128|0)}function ee(a){a=a|0;if(G[a+7364|0]>=2){D[a+7364|0]=1;ia(a+7440|0,72)}}function Gc(a,b){a=a|0;b=b|0;a=F[478];return aa[a|0](F[9136],oa(b))|0}function Qd(a){a=a|0;return(a>>>0<=17?F[(a<<2)+33456>>2]:1383)|0}function ge(a){a=a|0;return(G[a+7372|0]|!G[a+7364|0]?17:71)|0}function xb(a,b){b=db(a,b);if(!G[a+3220|0]){b=Ib(b)}return b}function Bc(a){a=a|0;ia(a,100);ra(a,0,100);return 100}function Xd(a){a=a|0;return(F[a+44>>2]==(a+48|0))<<5}function mb(a,b){return la(Ta(b,a,128),F[a+128>>2])}function Kc(a){a=a|0;ia(a,68);ra(a,0,68);return 68}function hc(a){a=a|0;ia(a,4);F[a>>2]=0;return a|0}function fc(a){a=a|0;ia(a,3320);Bb(a);return 3320}function ie(a){a=a|0;return(G[a+7364|0]?71:17)|0}function ic(a){a=a|0;ia(a,3320);Bb(a);return a|0}function ec(a){a=a|0;ia(a,4);F[a>>2
// EMSCRIPTEN_END_FUNCS
e=G;p(da);var aa=c([null,xc,wc,vc,uc,tc,$c,_c,Zc]);function ba(){return C.byteLength/65536|0}return{"d":Ub,"e":aa,"f":Va,"g":Qd,"h":Ua,"i":Tc,"j":Sc,"k":Rc,"l":Qc,"m":ub,"n":Pc,"o":Oc,"p":qb,"q":Nc,"r":Va,"s":Ua,"t":Mc,"u":Lc,"v":Kc,"w":eb,"x":eb,"y":tb,"z":tb,"A":Jc,"B":Ic,"C":Hc,"D":Gc,"E":Fc,"F":Ec,"G":Dc,"H":Cc,"I":Va,"J":Ua,"K":Bc,"L":eb,"M":ub,"N":Ac,"O":zc,"P":yc,"Q":sc,"R":rc,"S":qc,"T":pc,"U":oc,"V":nc,"W":Va,"X":Ua,"Y":mc,"Z":lc,"_":kc,"$":jc,"aa":ic,"ba":hc,"ca":gc,"da":fc,"ea":ec,"fa":dc,"ga":cc,"ha":bc,"ia":ac,"ja":$b,"ka":_b,"la":rb,"ma":Zb,"na":Yb,"oa":Xb,"pa":Wb,"qa":Vb,"ra":pe,"sa":oe,"ta":ne,"ua":me,"va":le,"wa":ke,"xa":qb,"ya":je,"za":ie,"Aa":he,"Ba":ge,"Ca":fe,"Da":ee,"Ea":rb,"Fa":de,"Ga":ce,"Ha":be,"Ia":Qa,"Ja":ae,"Ka":yb,"La":$d,"Ma":_d,"Na":Zd,"Oa":Yd,"Pa":yb,"Qa":Xd,"Ra":Wd,"Sa":Vd,"Ta":Ud,"Ua":Td,"Va":Qa,"Wa":Sd,"Xa":Rd,"Ya":Pd,"Za":Od,"_a":Nd,"$a":Md,"ab":Ld,"bb":Kd,"cb":Jd,"db":Id,"eb":Hd,"fb":Gd,"gb":Fd,"hb":Ed,"ib":Qa,"jb":Dd,"kb":Pb,"lb":Cd,"mb":Bd,"nb":Ad,"ob":Va,"pb":Ua,"qb":zd,"rb":yd,"sb":xd,"tb":qb,"ub":wd,"vb":Qa,"wb":vd,"xb":ud,"yb":td,"zb":sd,"Ab":Qa,"Bb":rd,"Cb":qd,"Db":pd,"Eb":od,"Fb":nd,"Gb":md,"Hb":ld,"Ib":kd,"Jb":jd,"Kb":id,"Lb":hd,"Mb":gd,"Nb":fd,"Ob":ed,"Pb":dd,"Qb":Qa,"Rb":cd,"Sb":Pb,"Tb":bd,"Ub":ad,"Vb":Yc,"Wb":Xc,"Xb":Wc,"Yb":Vc,"Zb":Uc}}return ca(ea)}
// EMSCRIPTEN_END_ASM
)(sa)}
function ta(){return{then:function(b){b({instance:new ra})}}}var ua=Error,WebAssembly={};u=[];"object"!==typeof WebAssembly&&t("no native wasm support detected");
function w(b){var c="i8";"*"===c.charAt(c.length-1)&&(c="i32");switch(c){case "i1":x[b>>0]=0;break;case "i8":x[b>>0]=0;break;case "i16":va[b>>1]=0;break;case "i32":y[b>>2]=0;break;case "i64":wa=[0,(xa=0,1<=+Math.abs(xa)?0<xa?(Math.min(+Math.floor(xa/4294967296),4294967295)|0)>>>0:~~+Math.ceil((xa-+(~~xa>>>0))/4294967296)>>>0:0)];y[b>>2]=wa[0];y[b+4>>2]=wa[1];break;case "float":ya[b>>2]=0;break;case "double":za[b>>3]=0;break;default:t("invalid type for setValue: "+c)}}
function Aa(b,c){c=c||"i8";"*"===c.charAt(c.length-1)&&(c="i32");switch(c){case "i1":return x[b>>0];case "i8":return x[b>>0];case "i16":return va[b>>1];case "i32":return y[b>>2];case "i64":return y[b>>2];case "float":return ya[b>>2];case "double":return za[b>>3];default:t("invalid type for getValue: "+c)}return null}var Ba,Ca=!1,Da="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0;
function z(b,c){if(b){var d=A,e=b+c;for(c=b;d[c]&&!(c>=e);)++c;if(16<c-b&&d.subarray&&Da)b=Da.decode(d.subarray(b,c));else{for(e="";b<c;){var f=d[b++];if(f&128){var k=d[b++]&63;if(192==(f&224))e+=String.fromCharCode((f&31)<<6|k);else{var p=d[b++]&63;f=224==(f&240)?(f&15)<<12|k<<6|p:(f&7)<<18|k<<12|p<<6|d[b++]&63;65536>f?e+=String.fromCharCode(f):(f-=65536,e+=String.fromCharCode(55296|f>>10,56320|f&1023))}}else e+=String.fromCharCode(f)}b=e}}else b="";return b}
function Ea(b,c,d,e){if(!(0<e))return 0;var f=d;e=d+e-1;for(var k=0;k<b.length;++k){var p=b.charCodeAt(k);if(55296<=p&&57343>=p){var v=b.charCodeAt(++k);p=65536+((p&1023)<<10)|v&1023}if(127>=p){if(d>=e)break;c[d++]=p}else{if(2047>=p){if(d+1>=e)break;c[d++]=192|p>>6}else{if(65535>=p){if(d+2>=e)break;c[d++]=224|p>>12}else{if(d+3>=e)break;c[d++]=240|p>>18;c[d++]=128|p>>12&63}c[d++]=128|p>>6&63}c[d++]=128|p&63}}c[d]=0;return d-f}
function Fa(b){for(var c=0,d=0;d<b.length;++d){var e=b.charCodeAt(d);55296<=e&&57343>=e&&(e=65536+((e&1023)<<10)|b.charCodeAt(++d)&1023);127>=e?++c:c=2047>=e?c+2:65535>=e?c+3:c+4}return c}function Ga(b,c){for(var d=0;d<b.length;++d)x[c++>>0]=b.charCodeAt(d)}var Ia,x,A,va,y,ya,za,qa=a.INITIAL_MEMORY||16777216;a.wasmMemory?Ba=a.wasmMemory:Ba=new pa;Ba&&(Ia=Ba.buffer);qa=Ia.byteLength;var B=Ia;Ia=B;a.HEAP8=x=new Int8Array(B);a.HEAP16=va=new Int16Array(B);a.HEAP32=y=new Int32Array(B);a.HEAPU8=A=new Uint8Array(B);
a.HEAPU16=new Uint16Array(B);a.HEAPU32=new Uint32Array(B);a.HEAPF32=ya=new Float32Array(B);a.HEAPF64=za=new Float64Array(B);var Ja,Ka=[],La=[],Ma=[];function Na(){var b=a.preRun.shift();Ka.unshift(b)}var C=0,Oa=null,Pa=null;a.preloadedImages={};a.preloadedAudios={};function t(b){if(a.onAbort)a.onAbort(b);oa(b);Ca=!0;b=new ua("abort("+b+"). Build with -s ASSERTIONS=1 for more info.");ba(b);throw b;}var Qa="data:application/octet-stream;base64,",D;D="olm_legacy.wasm";
if(!D.startsWith(Qa)){var Ra=D;D=a.locateFile?a.locateFile(Ra,m):m+Ra}function Sa(){var b=D;try{if(b==D&&u)return new Uint8Array(u);var c=r(b);if(c)return c;if(ma)return ma(b);throw"both async and sync fetching of the wasm failed";}catch(d){t(d)}}
function Ta(){if(!u&&(fa||ha)){if("function"===typeof fetch&&!D.startsWith("file://"))return fetch(D,{credentials:"same-origin"}).then(function(b){if(!b.ok)throw"failed to load wasm binary file at '"+D+"'";return b.arrayBuffer()}).catch(function(){return Sa()});if(la)return new Promise(function(b,c){la(D,function(d){b(new Uint8Array(d))},c)})}return Promise.resolve().then(function(){return Sa()})}var xa,wa;
function Ua(b){for(;0<b.length;){var c=b.shift();if("function"==typeof c)c(a);else{var d=c.cc;"number"===typeof d?void 0===c.bc?Ja.get(d)():Ja.get(d)(c.bc):d(void 0===c.bc?null:c.bc)}}}
var na=!1,Va="function"===typeof atob?atob:function(b){var c="",d=0;b=b.replace(/[^A-Za-z0-9\+\/=]/g,"");do{var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(d++));var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(d++));var k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(d++));var p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(d++));e=e<<
2|f>>4;f=(f&15)<<4|k>>2;var v=(k&3)<<6|p;c+=String.fromCharCode(e);64!==k&&(c+=String.fromCharCode(f));64!==p&&(c+=String.fromCharCode(v))}while(d<b.length);return c};
function r(b){if(b.startsWith(Qa)){b=b.slice(Qa.length);if("boolean"===typeof ia&&ia){var c=Buffer.from(b,"base64");c=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}else try{var d=Va(b),e=new Uint8Array(d.length);for(b=0;b<d.length;++b)e[b]=d.charCodeAt(b);c=e}catch(f){throw Error("Converting base64 string to bytes failed.");}return c}}var sa={b:function(b,c,d){A.copyWithin(b,c,c+d)},c:function(){t("OOM")},a:Ba};
(function(){function b(f){a.asm=f.exports;Ja=a.asm.e;La.unshift(a.asm.d);C--;a.monitorRunDependencies&&a.monitorRunDependencies(C);0==C&&(null!==Oa&&(clearInterval(Oa),Oa=null),Pa&&(f=Pa,Pa=null,f()))}function c(f){b(f.instance)}function d(f){return Ta().then(function(){return ta()}).then(function(k){return k}).then(f,function(k){oa("failed to asynchronously prepare wasm: "+k);t(k)})}var e={a:sa};C++;a.monitorRunDependencies&&a.monitorRunDependencies(C);if(a.instantiateWasm)try{return a.instantiateWasm(e,
b)}catch(f){return oa("Module.instantiateWasm callback failed with error: "+f),!1}(function(){return u||"function"!==typeof WebAssembly.instantiateStreaming||D.startsWith(Qa)||D.startsWith("file://")||"function"!==typeof fetch?d(c):fetch(D,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,e).then(c,function(k){oa("wasm streaming compile failed: "+k);oa("falling back to ArrayBuffer instantiation");return d(c)})})})().catch(ba);return{}})();
a.___wasm_call_ctors=function(){return(a.___wasm_call_ctors=a.asm.d).apply(null,arguments)};a._olm_pk_encryption_last_error=function(){return(a._olm_pk_encryption_last_error=a.asm.f).apply(null,arguments)};a.__olm_error_to_string=function(){return(a.__olm_error_to_string=a.asm.g).apply(null,arguments)};a._olm_pk_encryption_last_error_code=function(){return(a._olm_pk_encryption_last_error_code=a.asm.h).apply(null,arguments)};
a._olm_pk_encryption_size=function(){return(a._olm_pk_encryption_size=a.asm.i).apply(null,arguments)};a._olm_pk_encryption=function(){return(a._olm_pk_encryption=a.asm.j).apply(null,arguments)};a._olm_clear_pk_encryption=function(){return(a._olm_clear_pk_encryption=a.asm.k).apply(null,arguments)};a._olm_pk_encryption_set_recipient_key=function(){return(a._olm_pk_encryption_set_recipient_key=a.asm.l).apply(null,arguments)};
a._olm_pk_key_length=function(){return(a._olm_pk_key_length=a.asm.m).apply(null,arguments)};a._olm_pk_ciphertext_length=function(){return(a._olm_pk_ciphertext_length=a.asm.n).apply(null,arguments)};a._olm_pk_mac_length=function(){return(a._olm_pk_mac_length=a.asm.o).apply(null,arguments)};a._olm_pk_encrypt_random_length=function(){return(a._olm_pk_encrypt_random_length=a.asm.p).apply(null,arguments)};a._olm_pk_encrypt=function(){return(a._olm_pk_encrypt=a.asm.q).apply(null,arguments)};
a._olm_pk_decryption_last_error=function(){return(a._olm_pk_decryption_last_error=a.asm.r).apply(null,arguments)};a._olm_pk_decryption_last_error_code=function(){return(a._olm_pk_decryption_last_error_code=a.asm.s).apply(null,arguments)};a._olm_pk_decryption_size=function(){return(a._olm_pk_decryption_size=a.asm.t).apply(null,arguments)};a._olm_pk_decryption=function(){return(a._olm_pk_decryption=a.asm.u).apply(null,arguments)};
a._olm_clear_pk_decryption=function(){return(a._olm_clear_pk_decryption=a.asm.v).apply(null,arguments)};a._olm_pk_private_key_length=function(){return(a._olm_pk_private_key_length=a.asm.w).apply(null,arguments)};a._olm_pk_generate_key_random_length=function(){return(a._olm_pk_generate_key_random_length=a.asm.x).apply(null,arguments)};a._olm_pk_key_from_private=function(){return(a._olm_pk_key_from_private=a.asm.y).apply(null,arguments)};
a._olm_pk_generate_key=function(){return(a._olm_pk_generate_key=a.asm.z).apply(null,arguments)};a._olm_pickle_pk_decryption_length=function(){return(a._olm_pickle_pk_decryption_length=a.asm.A).apply(null,arguments)};a._olm_pickle_pk_decryption=function(){return(a._olm_pickle_pk_decryption=a.asm.B).apply(null,arguments)};a._olm_unpickle_pk_decryption=function(){return(a._olm_unpickle_pk_decryption=a.asm.C).apply(null,arguments)};
a._olm_pk_max_plaintext_length=function(){return(a._olm_pk_max_plaintext_length=a.asm.D).apply(null,arguments)};a._olm_pk_decrypt=function(){return(a._olm_pk_decrypt=a.asm.E).apply(null,arguments)};a._olm_pk_get_private_key=function(){return(a._olm_pk_get_private_key=a.asm.F).apply(null,arguments)};a._olm_pk_signing_size=function(){return(a._olm_pk_signing_size=a.asm.G).apply(null,arguments)};a._olm_pk_signing=function(){return(a._olm_pk_signing=a.asm.H).apply(null,arguments)};
a._olm_pk_signing_last_error=function(){return(a._olm_pk_signing_last_error=a.asm.I).apply(null,arguments)};a._olm_pk_signing_last_error_code=function(){return(a._olm_pk_signing_last_error_code=a.asm.J).apply(null,arguments)};a._olm_clear_pk_signing=function(){return(a._olm_clear_pk_signing=a.asm.K).apply(null,arguments)};a._olm_pk_signing_seed_length=function(){return(a._olm_pk_signing_seed_length=a.asm.L).apply(null,arguments)};
a._olm_pk_signing_public_key_length=function(){return(a._olm_pk_signing_public_key_length=a.asm.M).apply(null,arguments)};a._olm_pk_signing_key_from_seed=function(){return(a._olm_pk_signing_key_from_seed=a.asm.N).apply(null,arguments)};a._olm_pk_signature_length=function(){return(a._olm_pk_signature_length=a.asm.O).apply(null,arguments)};a._olm_pk_sign=function(){return(a._olm_pk_sign=a.asm.P).apply(null,arguments)};
a._olm_get_library_version=function(){return(a._olm_get_library_version=a.asm.Q).apply(null,arguments)};a._olm_error=function(){return(a._olm_error=a.asm.R).apply(null,arguments)};a._olm_account_last_error=function(){return(a._olm_account_last_error=a.asm.S).apply(null,arguments)};a._olm_account_last_error_code=function(){return(a._olm_account_last_error_code=a.asm.T).apply(null,arguments)};a._olm_session_last_error=function(){return(a._olm_session_last_error=a.asm.U).apply(null,arguments)};
a._olm_session_last_error_code=function(){return(a._olm_session_last_error_code=a.asm.V).apply(null,arguments)};a._olm_utility_last_error=function(){return(a._olm_utility_last_error=a.asm.W).apply(null,arguments)};a._olm_utility_last_error_code=function(){return(a._olm_utility_last_error_code=a.asm.X).apply(null,arguments)};a._olm_account_size=function(){return(a._olm_account_size=a.asm.Y).apply(null,arguments)};a._olm_session_size=function(){return(a._olm_session_size=a.asm.Z).apply(null,arguments)};
a._olm_utility_size=function(){return(a._olm_utility_size=a.asm._).apply(null,arguments)};a._olm_account=function(){return(a._olm_account=a.asm.$).apply(null,arguments)};a._olm_session=function(){return(a._olm_session=a.asm.aa).apply(null,arguments)};a._olm_utility=function(){return(a._olm_utility=a.asm.ba).apply(null,arguments)};a._olm_clear_account=function(){return(a._olm_clear_account=a.asm.ca).apply(null,arguments)};
a._olm_clear_session=function(){return(a._olm_clear_session=a.asm.da).apply(null,arguments)};a._olm_clear_utility=function(){return(a._olm_clear_utility=a.asm.ea).apply(null,arguments)};a._olm_pickle_account_length=function(){return(a._olm_pickle_account_length=a.asm.fa).apply(null,arguments)};a._olm_pickle_session_length=function(){return(a._olm_pickle_session_length=a.asm.ga).apply(null,arguments)};a._olm_pickle_account=function(){return(a._olm_pickle_account=a.asm.ha).apply(null,arguments)};
a._olm_pickle_session=function(){return(a._olm_pickle_session=a.asm.ia).apply(null,arguments)};a._olm_unpickle_account=function(){return(a._olm_unpickle_account=a.asm.ja).apply(null,arguments)};a._olm_unpickle_session=function(){return(a._olm_unpickle_session=a.asm.ka).apply(null,arguments)};a._olm_create_account_random_length=function(){return(a._olm_create_account_random_length=a.asm.la).apply(null,arguments)};a._olm_create_account=function(){return(a._olm_create_account=a.asm.ma).apply(null,arguments)};
a._olm_account_identity_keys_length=function(){return(a._olm_account_identity_keys_length=a.asm.na).apply(null,arguments)};a._olm_account_identity_keys=function(){return(a._olm_account_identity_keys=a.asm.oa).apply(null,arguments)};a._olm_account_signature_length=function(){return(a._olm_account_signature_length=a.asm.pa).apply(null,arguments)};a._olm_account_sign=function(){return(a._olm_account_sign=a.asm.qa).apply(null,arguments)};
a._olm_account_one_time_keys_length=function(){return(a._olm_account_one_time_keys_length=a.asm.ra).apply(null,arguments)};a._olm_account_one_time_keys=function(){return(a._olm_account_one_time_keys=a.asm.sa).apply(null,arguments)};a._olm_account_mark_keys_as_published=function(){return(a._olm_account_mark_keys_as_published=a.asm.ta).apply(null,arguments)};a._olm_account_max_number_of_one_time_keys=function(){return(a._olm_account_max_number_of_one_time_keys=a.asm.ua).apply(null,arguments)};
a._olm_account_generate_one_time_keys_random_length=function(){return(a._olm_account_generate_one_time_keys_random_length=a.asm.va).apply(null,arguments)};a._olm_account_generate_one_time_keys=function(){return(a._olm_account_generate_one_time_keys=a.asm.wa).apply(null,arguments)};a._olm_account_generate_fallback_key_random_length=function(){return(a._olm_account_generate_fallback_key_random_length=a.asm.xa).apply(null,arguments)};
a._olm_account_generate_fallback_key=function(){return(a._olm_account_generate_fallback_key=a.asm.ya).apply(null,arguments)};a._olm_account_fallback_key_length=function(){return(a._olm_account_fallback_key_length=a.asm.za).apply(null,arguments)};a._olm_account_fallback_key=function(){return(a._olm_account_fallback_key=a.asm.Aa).apply(null,arguments)};a._olm_account_unpublished_fallback_key_length=function(){return(a._olm_account_unpublished_fallback_key_length=a.asm.Ba).apply(null,arguments)};
a._olm_account_unpublished_fallback_key=function(){return(a._olm_account_unpublished_fallback_key=a.asm.Ca).apply(null,arguments)};a._olm_account_forget_old_fallback_key=function(){return(a._olm_account_forget_old_fallback_key=a.asm.Da).apply(null,arguments)};a._olm_create_outbound_session_random_length=function(){return(a._olm_create_outbound_session_random_length=a.asm.Ea).apply(null,arguments)};
a._olm_create_outbound_session=function(){return(a._olm_create_outbound_session=a.asm.Fa).apply(null,arguments)};a._olm_create_inbound_session=function(){return(a._olm_create_inbound_session=a.asm.Ga).apply(null,arguments)};a._olm_create_inbound_session_from=function(){return(a._olm_create_inbound_session_from=a.asm.Ha).apply(null,arguments)};a._olm_session_id_length=function(){return(a._olm_session_id_length=a.asm.Ia).apply(null,arguments)};
a._olm_session_id=function(){return(a._olm_session_id=a.asm.Ja).apply(null,arguments)};a._olm_session_has_received_message=function(){return(a._olm_session_has_received_message=a.asm.Ka).apply(null,arguments)};a._olm_session_describe=function(){return(a._olm_session_describe=a.asm.La).apply(null,arguments)};a._olm_matches_inbound_session=function(){return(a._olm_matches_inbound_session=a.asm.Ma).apply(null,arguments)};
a._olm_matches_inbound_session_from=function(){return(a._olm_matches_inbound_session_from=a.asm.Na).apply(null,arguments)};a._olm_remove_one_time_keys=function(){return(a._olm_remove_one_time_keys=a.asm.Oa).apply(null,arguments)};a._olm_encrypt_message_type=function(){return(a._olm_encrypt_message_type=a.asm.Pa).apply(null,arguments)};a._olm_encrypt_random_length=function(){return(a._olm_encrypt_random_length=a.asm.Qa).apply(null,arguments)};
a._olm_encrypt_message_length=function(){return(a._olm_encrypt_message_length=a.asm.Ra).apply(null,arguments)};a._olm_encrypt=function(){return(a._olm_encrypt=a.asm.Sa).apply(null,arguments)};a._olm_decrypt_max_plaintext_length=function(){return(a._olm_decrypt_max_plaintext_length=a.asm.Ta).apply(null,arguments)};a._olm_decrypt=function(){return(a._olm_decrypt=a.asm.Ua).apply(null,arguments)};a._olm_sha256_length=function(){return(a._olm_sha256_length=a.asm.Va).apply(null,arguments)};
a._olm_sha256=function(){return(a._olm_sha256=a.asm.Wa).apply(null,arguments)};a._olm_ed25519_verify=function(){return(a._olm_ed25519_verify=a.asm.Xa).apply(null,arguments)};a._olm_inbound_group_session_size=function(){return(a._olm_inbound_group_session_size=a.asm.Ya).apply(null,arguments)};a._olm_inbound_group_session=function(){return(a._olm_inbound_group_session=a.asm.Za).apply(null,arguments)};
a._olm_clear_inbound_group_session=function(){return(a._olm_clear_inbound_group_session=a.asm._a).apply(null,arguments)};a._olm_inbound_group_session_last_error=function(){return(a._olm_inbound_group_session_last_error=a.asm.$a).apply(null,arguments)};a._olm_inbound_group_session_last_error_code=function(){return(a._olm_inbound_group_session_last_error_code=a.asm.ab).apply(null,arguments)};a._olm_init_inbound_group_session=function(){return(a._olm_init_inbound_group_session=a.asm.bb).apply(null,arguments)};
a._olm_import_inbound_group_session=function(){return(a._olm_import_inbound_group_session=a.asm.cb).apply(null,arguments)};a._olm_pickle_inbound_group_session_length=function(){return(a._olm_pickle_inbound_group_session_length=a.asm.db).apply(null,arguments)};a._olm_pickle_inbound_group_session=function(){return(a._olm_pickle_inbound_group_session=a.asm.eb).apply(null,arguments)};a._olm_unpickle_inbound_group_session=function(){return(a._olm_unpickle_inbound_group_session=a.asm.fb).apply(null,arguments)};
a._olm_group_decrypt_max_plaintext_length=function(){return(a._olm_group_decrypt_max_plaintext_length=a.asm.gb).apply(null,arguments)};a._olm_group_decrypt=function(){return(a._olm_group_decrypt=a.asm.hb).apply(null,arguments)};a._olm_inbound_group_session_id_length=function(){return(a._olm_inbound_group_session_id_length=a.asm.ib).apply(null,arguments)};a._olm_inbound_group_session_id=function(){return(a._olm_inbound_group_session_id=a.asm.jb).apply(null,arguments)};
a._olm_inbound_group_session_first_known_index=function(){return(a._olm_inbound_group_session_first_known_index=a.asm.kb).apply(null,arguments)};a._olm_inbound_group_session_is_verified=function(){return(a._olm_inbound_group_session_is_verified=a.asm.lb).apply(null,arguments)};a._olm_export_inbound_group_session_length=function(){return(a._olm_export_inbound_group_session_length=a.asm.mb).apply(null,arguments)};
a._olm_export_inbound_group_session=function(){return(a._olm_export_inbound_group_session=a.asm.nb).apply(null,arguments)};a._olm_sas_last_error=function(){return(a._olm_sas_last_error=a.asm.ob).apply(null,arguments)};a._olm_sas_last_error_code=function(){return(a._olm_sas_last_error_code=a.asm.pb).apply(null,arguments)};a._olm_sas_size=function(){return(a._olm_sas_size=a.asm.qb).apply(null,arguments)};a._olm_sas=function(){return(a._olm_sas=a.asm.rb).apply(null,arguments)};
a._olm_clear_sas=function(){return(a._olm_clear_sas=a.asm.sb).apply(null,arguments)};a._olm_create_sas_random_length=function(){return(a._olm_create_sas_random_length=a.asm.tb).apply(null,arguments)};a._olm_create_sas=function(){return(a._olm_create_sas=a.asm.ub).apply(null,arguments)};a._olm_sas_pubkey_length=function(){return(a._olm_sas_pubkey_length=a.asm.vb).apply(null,arguments)};a._olm_sas_get_pubkey=function(){return(a._olm_sas_get_pubkey=a.asm.wb).apply(null,arguments)};
a._olm_sas_set_their_key=function(){return(a._olm_sas_set_their_key=a.asm.xb).apply(null,arguments)};a._olm_sas_is_their_key_set=function(){return(a._olm_sas_is_their_key_set=a.asm.yb).apply(null,arguments)};a._olm_sas_generate_bytes=function(){return(a._olm_sas_generate_bytes=a.asm.zb).apply(null,arguments)};a._olm_sas_mac_length=function(){return(a._olm_sas_mac_length=a.asm.Ab).apply(null,arguments)};
a._olm_sas_calculate_mac_fixed_base64=function(){return(a._olm_sas_calculate_mac_fixed_base64=a.asm.Bb).apply(null,arguments)};a._olm_sas_calculate_mac=function(){return(a._olm_sas_calculate_mac=a.asm.Cb).apply(null,arguments)};a._olm_sas_calculate_mac_long_kdf=function(){return(a._olm_sas_calculate_mac_long_kdf=a.asm.Db).apply(null,arguments)};a._olm_outbound_group_session_size=function(){return(a._olm_outbound_group_session_size=a.asm.Eb).apply(null,arguments)};
a._olm_outbound_group_session=function(){return(a._olm_outbound_group_session=a.asm.Fb).apply(null,arguments)};a._olm_clear_outbound_group_session=function(){return(a._olm_clear_outbound_group_session=a.asm.Gb).apply(null,arguments)};a._olm_outbound_group_session_last_error=function(){return(a._olm_outbound_group_session_last_error=a.asm.Hb).apply(null,arguments)};a._olm_outbound_group_session_last_error_code=function(){return(a._olm_outbound_group_session_last_error_code=a.asm.Ib).apply(null,arguments)};
a._olm_pickle_outbound_group_session_length=function(){return(a._olm_pickle_outbound_group_session_length=a.asm.Jb).apply(null,arguments)};a._olm_pickle_outbound_group_session=function(){return(a._olm_pickle_outbound_group_session=a.asm.Kb).apply(null,arguments)};a._olm_unpickle_outbound_group_session=function(){return(a._olm_unpickle_outbound_group_session=a.asm.Lb).apply(null,arguments)};
a._olm_init_outbound_group_session_random_length=function(){return(a._olm_init_outbound_group_session_random_length=a.asm.Mb).apply(null,arguments)};a._olm_init_outbound_group_session=function(){return(a._olm_init_outbound_group_session=a.asm.Nb).apply(null,arguments)};a._olm_group_encrypt_message_length=function(){return(a._olm_group_encrypt_message_length=a.asm.Ob).apply(null,arguments)};a._olm_group_encrypt=function(){return(a._olm_group_encrypt=a.asm.Pb).apply(null,arguments)};
a._olm_outbound_group_session_id_length=function(){return(a._olm_outbound_group_session_id_length=a.asm.Qb).apply(null,arguments)};a._olm_outbound_group_session_id=function(){return(a._olm_outbound_group_session_id=a.asm.Rb).apply(null,arguments)};a._olm_outbound_group_session_message_index=function(){return(a._olm_outbound_group_session_message_index=a.asm.Sb).apply(null,arguments)};
a._olm_outbound_group_session_key_length=function(){return(a._olm_outbound_group_session_key_length=a.asm.Tb).apply(null,arguments)};a._olm_outbound_group_session_key=function(){return(a._olm_outbound_group_session_key=a.asm.Ub).apply(null,arguments)};a._malloc=function(){return(a._malloc=a.asm.Vb).apply(null,arguments)};a._free=function(){return(a._free=a.asm.Wb).apply(null,arguments)};
var Wa=a.stackSave=function(){return(Wa=a.stackSave=a.asm.Xb).apply(null,arguments)},Xa=a.stackRestore=function(){return(Xa=a.stackRestore=a.asm.Yb).apply(null,arguments)},Ya=a.stackAlloc=function(){return(Ya=a.stackAlloc=a.asm.Zb).apply(null,arguments)};a.ALLOC_STACK=1;var Za;Pa=function $a(){Za||ab();Za||(Pa=$a)};
function ab(){function b(){if(!Za&&(Za=!0,a.calledRun=!0,!Ca)){Ua(La);aa(a);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;){var c=a.postRun.shift();Ma.unshift(c)}Ua(Ma)}}if(!(0<C)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)Na();Ua(Ka);0<C||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);b()},1)):b())}}a.run=ab;
if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();ab();function E(){var b=a._olm_outbound_group_session_size();this.ac=F(b);this.$b=a._olm_outbound_group_session(this.ac)}function G(b){return function(){var c=b.apply(this,arguments);if(c===h)throw c=z(a._olm_outbound_group_session_last_error(arguments[0])),Error("OLM."+c);return c}}E.prototype.free=function(){a._olm_clear_outbound_group_session(this.$b);I(this.$b)};
E.prototype.pickle=J(function(b){b=K(b);var c=G(a._olm_pickle_outbound_group_session_length)(this.$b),d=L(b),e=L(c+1);try{G(a._olm_pickle_outbound_group_session)(this.$b,d,b.length,e,c)}finally{for(M(d,b.length),d=0;d<b.length;d++)b[d]=0}return z(e,c)});E.prototype.unpickle=J(function(b,c){b=K(b);var d=L(b);c=K(c);var e=L(c);try{G(a._olm_unpickle_outbound_group_session)(this.$b,d,b.length,e,c.length)}finally{for(M(d,b.length),d=0;d<b.length;d++)b[d]=0}});
E.prototype.create=J(function(){var b=G(a._olm_init_outbound_group_session_random_length)(this.$b),c=N(b,g);try{G(a._olm_init_outbound_group_session)(this.$b,c,b)}finally{M(c,b)}});E.prototype.encrypt=function(b){try{var c=Fa(b);var d=G(a._olm_group_encrypt_message_length)(this.$b,c);var e=F(c+1);Ea(b,A,e,c+1);var f=F(d+1);G(a._olm_group_encrypt)(this.$b,e,c,f,d);w(f+d);return z(f,d)}finally{void 0!==e&&(M(e,c+1),I(e)),void 0!==f&&I(f)}};
E.prototype.session_id=J(function(){var b=G(a._olm_outbound_group_session_id_length)(this.$b),c=L(b+1);G(a._olm_outbound_group_session_id)(this.$b,c,b);return z(c,b)});E.prototype.session_key=J(function(){var b=G(a._olm_outbound_group_session_key_length)(this.$b),c=L(b+1);G(a._olm_outbound_group_session_key)(this.$b,c,b);var d=z(c,b);M(c,b);return d});E.prototype.message_index=function(){return G(a._olm_outbound_group_session_message_index)(this.$b)};olm_exports.OutboundGroupSession=E;
function O(){var b=a._olm_inbound_group_session_size();this.ac=F(b);this.$b=a._olm_inbound_group_session(this.ac)}function P(b){return function(){var c=b.apply(this,arguments);if(c===h)throw c=z(a._olm_inbound_group_session_last_error(arguments[0])),Error("OLM."+c);return c}}O.prototype.free=function(){a._olm_clear_inbound_group_session(this.$b);I(this.$b)};
O.prototype.pickle=J(function(b){b=K(b);var c=P(a._olm_pickle_inbound_group_session_length)(this.$b),d=L(b),e=L(c+1);try{P(a._olm_pickle_inbound_group_session)(this.$b,d,b.length,e,c)}finally{for(M(d,b.length),d=0;d<b.length;d++)b[d]=0}return z(e,c)});O.prototype.unpickle=J(function(b,c){b=K(b);var d=L(b);c=K(c);var e=L(c);try{P(a._olm_unpickle_inbound_group_session)(this.$b,d,b.length,e,c.length)}finally{for(M(d,b.length),d=0;d<b.length;d++)b[d]=0}});
O.prototype.create=J(function(b){b=K(b);var c=L(b);try{P(a._olm_init_inbound_group_session)(this.$b,c,b.length)}finally{for(M(c,b.length),c=0;c<b.length;c++)b[c]=0}});O.prototype.import_session=J(function(b){b=K(b);var c=L(b);try{P(a._olm_import_inbound_group_session)(this.$b,c,b.length)}finally{for(M(c,b.length),c=0;c<b.length;c++)b[c]=0}});
O.prototype.decrypt=J(function(b){try{var c=F(b.length);Ga(b,c);var d=P(a._olm_group_decrypt_max_plaintext_length)(this.$b,c,b.length);Ga(b,c);var e=F(d+1);var f=L(4);var k=P(a._olm_group_decrypt)(this.$b,c,b.length,e,d,f);w(e+k);return{plaintext:z(e,k),message_index:Aa(f,"i32")}}finally{void 0!==c&&I(c),void 0!==e&&(M(e,k),I(e))}});O.prototype.session_id=J(function(){var b=P(a._olm_inbound_group_session_id_length)(this.$b),c=L(b+1);P(a._olm_inbound_group_session_id)(this.$b,c,b);return z(c,b)});
O.prototype.first_known_index=J(function(){return P(a._olm_inbound_group_session_first_known_index)(this.$b)});O.prototype.export_session=J(function(b){var c=P(a._olm_export_inbound_group_session_length)(this.$b),d=L(c+1);G(a._olm_export_inbound_group_session)(this.$b,d,c,b);b=z(d,c);M(d,c);return b});olm_exports.InboundGroupSession=O;function bb(){var b=a._olm_pk_encryption_size();this.ac=F(b);this.$b=a._olm_pk_encryption(this.ac)}
function Q(b){return function(){var c=b.apply(this,arguments);if(c===h)throw c=z(a._olm_pk_encryption_last_error(arguments[0])),Error("OLM."+c);return c}}bb.prototype.free=function(){a._olm_clear_pk_encryption(this.$b);I(this.$b)};bb.prototype.set_recipient_key=J(function(b){b=K(b);var c=L(b);Q(a._olm_pk_encryption_set_recipient_key)(this.$b,c,b.length)});
bb.prototype.encrypt=J(function(b){try{var c=Fa(b);var d=F(c+1);Ea(b,A,d,c+1);var e=Q(a._olm_pk_encrypt_random_length)();var f=N(e,g);var k=Q(a._olm_pk_ciphertext_length)(this.$b,c);var p=F(k+1);var v=Q(a._olm_pk_mac_length)(this.$b),ja=L(v+1);w(ja+v);var T=Q(a._olm_pk_key_length)(),H=L(T+1);w(H+T);Q(a._olm_pk_encrypt)(this.$b,d,c,p,k,ja,v,H,T,f,e);w(p+k);return{ciphertext:z(p,k),mac:z(ja,v),ephemeral:z(H,T)}}finally{void 0!==f&&M(f,e),void 0!==d&&(M(d,c+1),I(d)),void 0!==p&&I(p)}});
function R(){var b=a._olm_pk_decryption_size();this.ac=F(b);this.$b=a._olm_pk_decryption(this.ac)}function S(b){return function(){var c=b.apply(this,arguments);if(c===h)throw c=z(a._olm_pk_decryption_last_error(arguments[0])),Error("OLM."+c);return c}}R.prototype.free=function(){a._olm_clear_pk_decryption(this.$b);I(this.$b)};
R.prototype.init_with_private_key=J(function(b){var c=L(b.length);a.HEAPU8.set(b,c);var d=S(a._olm_pk_key_length)(),e=L(d+1);try{S(a._olm_pk_key_from_private)(this.$b,e,d,c,b.length)}finally{M(c,b.length)}return z(e,d)});R.prototype.generate_key=J(function(){var b=S(a._olm_pk_private_key_length)(),c=N(b,g),d=S(a._olm_pk_key_length)(),e=L(d+1);try{S(a._olm_pk_key_from_private)(this.$b,e,d,c,b)}finally{M(c,b)}return z(e,d)});
R.prototype.get_private_key=J(function(){var b=Q(a._olm_pk_private_key_length)(),c=L(b);S(a._olm_pk_get_private_key)(this.$b,c,b);var d=new Uint8Array(new Uint8Array(a.HEAPU8.buffer,c,b));M(c,b);return d});R.prototype.pickle=J(function(b){b=K(b);var c=S(a._olm_pickle_pk_decryption_length)(this.$b),d=L(b),e=L(c+1);try{S(a._olm_pickle_pk_decryption)(this.$b,d,b.length,e,c)}finally{for(M(d,b.length),d=0;d<b.length;d++)b[d]=0}return z(e,c)});
R.prototype.unpickle=J(function(b,c){b=K(b);var d=L(b),e=K(c),f=L(e);c=S(a._olm_pk_key_length)();var k=L(c+1);try{S(a._olm_unpickle_pk_decryption)(this.$b,d,b.length,f,e.length,k,c)}finally{for(M(d,b.length),d=0;d<b.length;d++)b[d]=0}return z(k,c)});
R.prototype.decrypt=J(function(b,c,d){try{var e=Fa(d);var f=F(e+1);Ea(d,A,f,e+1);var k=K(b),p=L(k),v=K(c),ja=L(v);var T=S(a._olm_pk_max_plaintext_length)(this.$b,e);var H=F(T+1);var Ha=S(a._olm_pk_decrypt)(this.$b,p,k.length,ja,v.length,f,e,H,T);w(H+Ha);return z(H,Ha)}finally{void 0!==H&&(M(H,Ha+1),I(H)),void 0!==f&&I(f)}});function cb(){var b=a._olm_pk_signing_size();this.ac=F(b);this.$b=a._olm_pk_signing(this.ac)}
function db(b){return function(){var c=b.apply(this,arguments);if(c===h)throw c=z(a._olm_pk_signing_last_error(arguments[0])),Error("OLM."+c);return c}}cb.prototype.free=function(){a._olm_clear_pk_signing(this.$b);I(this.$b)};cb.prototype.init_with_seed=J(function(b){var c=L(b.length);a.HEAPU8.set(b,c);var d=db(a._olm_pk_signing_public_key_length)(),e=L(d+1);try{db(a._olm_pk_signing_key_from_seed)(this.$b,e,d,c,b.length)}finally{M(c,b.length)}return z(e,d)});
cb.prototype.generate_seed=J(function(){var b=db(a._olm_pk_signing_seed_length)(),c=N(b,g),d=new Uint8Array(new Uint8Array(a.HEAPU8.buffer,c,b));M(c,b);return d});cb.prototype.sign=J(function(b){try{var c=Fa(b);var d=F(c+1);Ea(b,A,d,c+1);var e=db(a._olm_pk_signature_length)(),f=L(e+1);db(a._olm_pk_sign)(this.$b,d,c,f,e);return z(f,e)}finally{void 0!==d&&(M(d,c+1),I(d))}});
function U(){var b=a._olm_sas_size(),c=a._olm_create_sas_random_length(),d=N(c,g);this.ac=F(b);this.$b=a._olm_sas(this.ac);a._olm_create_sas(this.$b,d,c);M(d,c)}function V(b){return function(){var c=b.apply(this,arguments);if(c===h)throw c=z(a._olm_sas_last_error(arguments[0])),Error("OLM."+c);return c}}U.prototype.free=function(){a._olm_clear_sas(this.$b);I(this.$b)};
U.prototype.get_pubkey=J(function(){var b=V(a._olm_sas_pubkey_length)(this.$b),c=L(b+1);V(a._olm_sas_get_pubkey)(this.$b,c,b);return z(c,b)});U.prototype.set_their_key=J(function(b){b=K(b);var c=L(b);V(a._olm_sas_set_their_key)(this.$b,c,b.length)});U.prototype.is_their_key_set=J(function(){return V(a._olm_sas_is_their_key_set)(this.$b)?!0:!1});
U.prototype.generate_bytes=J(function(b,c){b=K(b);var d=L(b),e=L(c);V(a._olm_sas_generate_bytes)(this.$b,d,b.length,e,c);return new Uint8Array(new Uint8Array(a.HEAPU8.buffer,e,c))});U.prototype.calculate_mac=J(function(b,c){b=K(b);var d=L(b);c=K(c);var e=L(c),f=V(a._olm_sas_mac_length)(this.$b),k=L(f+1);V(a._olm_sas_calculate_mac)(this.$b,d,b.length,e,c.length,k,f);return z(k,f)});
U.prototype.calculate_mac_long_kdf=J(function(b,c){b=K(b);var d=L(b);c=K(c);var e=L(c),f=V(a._olm_sas_mac_length)(this.$b),k=L(f+1);V(a._olm_sas_calculate_mac_long_kdf)(this.$b,d,b.length,e,c.length,k,f);return z(k,f)});var F=a._malloc,I=a._free,h;function N(b,c){var d=Ya(b);c(new Uint8Array(a.HEAPU8.buffer,d,b));return d}function L(b){return"number"==typeof b?N(b,function(c){c.fill(0)}):N(b.length,function(c){c.set(b)})}
function K(b){if(b instanceof Uint8Array)var c=b;else c=Array(Fa(b)+1),b=Ea(b,c,0,c.length),c.length=b;return c}function J(b){return function(){var c=Wa();try{return b.apply(this,arguments)}finally{Xa(c)}}}function M(b,c){for(;0<c--;)a.HEAP8[b++]=0}function W(){var b=a._olm_account_size();this.ac=F(b);this.$b=a._olm_account(this.ac)}function X(b){return function(){var c=b.apply(this,arguments);if(c===h)throw c=z(a._olm_account_last_error(arguments[0])),Error("OLM."+c);return c}}
W.prototype.free=function(){a._olm_clear_account(this.$b);I(this.$b)};W.prototype.create=J(function(){var b=X(a._olm_create_account_random_length)(this.$b),c=N(b,g);try{X(a._olm_create_account)(this.$b,c,b)}finally{M(c,b)}});W.prototype.identity_keys=J(function(){var b=X(a._olm_account_identity_keys_length)(this.$b),c=L(b+1);X(a._olm_account_identity_keys)(this.$b,c,b);return z(c,b)});
W.prototype.sign=J(function(b){var c=X(a._olm_account_signature_length)(this.$b);b=K(b);var d=L(b),e=L(c+1);try{X(a._olm_account_sign)(this.$b,d,b.length,e,c)}finally{for(M(d,b.length),d=0;d<b.length;d++)b[d]=0}return z(e,c)});W.prototype.one_time_keys=J(function(){var b=X(a._olm_account_one_time_keys_length)(this.$b),c=L(b+1);X(a._olm_account_one_time_keys)(this.$b,c,b);return z(c,b)});W.prototype.mark_keys_as_published=J(function(){X(a._olm_account_mark_keys_as_published)(this.$b)});
W.prototype.max_number_of_one_time_keys=J(function(){return X(a._olm_account_max_number_of_one_time_keys)(this.$b)});W.prototype.generate_one_time_keys=J(function(b){var c=X(a._olm_account_generate_one_time_keys_random_length)(this.$b,b),d=N(c,g);try{X(a._olm_account_generate_one_time_keys)(this.$b,b,d,c)}finally{M(d,c)}});W.prototype.remove_one_time_keys=J(function(b){X(a._olm_remove_one_time_keys)(this.$b,b.$b)});
W.prototype.generate_fallback_key=J(function(){var b=X(a._olm_account_generate_fallback_key_random_length)(this.$b),c=N(b,g);try{X(a._olm_account_generate_fallback_key)(this.$b,c,b)}finally{M(c,b)}});W.prototype.fallback_key=J(function(){var b=X(a._olm_account_fallback_key_length)(this.$b),c=L(b+1);X(a._olm_account_fallback_key)(this.$b,c,b);return z(c,b)});
W.prototype.unpublished_fallback_key=J(function(){var b=X(a._olm_account_unpublished_fallback_key_length)(this.$b),c=L(b+1);X(a._olm_account_unpublished_fallback_key)(this.$b,c,b);return z(c,b)});W.prototype.forget_old_fallback_key=J(function(){X(a._olm_account_forget_old_fallback_key)(this.$b)});
W.prototype.pickle=J(function(b){b=K(b);var c=X(a._olm_pickle_account_length)(this.$b),d=L(b),e=L(c+1);try{X(a._olm_pickle_account)(this.$b,d,b.length,e,c)}finally{for(M(d,b.length),d=0;d<b.length;d++)b[d]=0}return z(e,c)});W.prototype.unpickle=J(function(b,c){b=K(b);var d=L(b);c=K(c);var e=L(c);try{X(a._olm_unpickle_account)(this.$b,d,b.length,e,c.length)}finally{for(M(d,b.length),d=0;d<b.length;d++)b[d]=0}});function Y(){var b=a._olm_session_size();this.ac=F(b);this.$b=a._olm_session(this.ac)}
function Z(b){return function(){var c=b.apply(this,arguments);if(c===h)throw c=z(a._olm_session_last_error(arguments[0])),Error("OLM."+c);return c}}Y.prototype.free=function(){a._olm_clear_session(this.$b);I(this.$b)};Y.prototype.pickle=J(function(b){b=K(b);var c=Z(a._olm_pickle_session_length)(this.$b),d=L(b),e=L(c+1);try{Z(a._olm_pickle_session)(this.$b,d,b.length,e,c)}finally{for(M(d,b.length),d=0;d<b.length;d++)b[d]=0}return z(e,c)});
Y.prototype.unpickle=J(function(b,c){b=K(b);var d=L(b);c=K(c);var e=L(c);try{Z(a._olm_unpickle_session)(this.$b,d,b.length,e,c.length)}finally{for(M(d,b.length),d=0;d<b.length;d++)b[d]=0}});Y.prototype.create_outbound=J(function(b,c,d){var e=Z(a._olm_create_outbound_session_random_length)(this.$b),f=N(e,g);c=K(c);d=K(d);var k=L(c),p=L(d);try{Z(a._olm_create_outbound_session)(this.$b,b.$b,k,c.length,p,d.length,f,e)}finally{M(f,e)}});
Y.prototype.create_inbound=J(function(b,c){c=K(c);var d=L(c);try{Z(a._olm_create_inbound_session)(this.$b,b.$b,d,c.length)}finally{for(M(d,c.length),b=0;b<c.length;b++)c[b]=0}});Y.prototype.create_inbound_from=J(function(b,c,d){c=K(c);var e=L(c);d=K(d);var f=L(d);try{Z(a._olm_create_inbound_session_from)(this.$b,b.$b,e,c.length,f,d.length)}finally{for(M(f,d.length),b=0;b<d.length;b++)d[b]=0}});
Y.prototype.session_id=J(function(){var b=Z(a._olm_session_id_length)(this.$b),c=L(b+1);Z(a._olm_session_id)(this.$b,c,b);return z(c,b)});Y.prototype.has_received_message=function(){return Z(a._olm_session_has_received_message)(this.$b)?!0:!1};Y.prototype.matches_inbound=J(function(b){b=K(b);var c=L(b);return Z(a._olm_matches_inbound_session)(this.$b,c,b.length)?!0:!1});
Y.prototype.matches_inbound_from=J(function(b,c){b=K(b);var d=L(b);c=K(c);var e=L(c);return Z(a._olm_matches_inbound_session_from)(this.$b,d,b.length,e,c.length)?!0:!1});
Y.prototype.encrypt=J(function(b){try{var c=Z(a._olm_encrypt_random_length)(this.$b);var d=Z(a._olm_encrypt_message_type)(this.$b);var e=Fa(b);var f=Z(a._olm_encrypt_message_length)(this.$b,e);var k=N(c,g);var p=F(e+1);Ea(b,A,p,e+1);var v=F(f+1);Z(a._olm_encrypt)(this.$b,p,e,k,c,v,f);w(v+f);return{type:d,body:z(v,f)}}finally{void 0!==k&&M(k,c),void 0!==p&&(M(p,e+1),I(p)),void 0!==v&&I(v)}});
Y.prototype.decrypt=J(function(b,c){try{var d=F(c.length);Ga(c,d);var e=Z(a._olm_decrypt_max_plaintext_length)(this.$b,b,d,c.length);Ga(c,d);var f=F(e+1);var k=Z(a._olm_decrypt)(this.$b,b,d,c.length,f,e);w(f+k);return z(f,k)}finally{void 0!==d&&I(d),void 0!==f&&(M(f,e),I(f))}});Y.prototype.describe=J(function(){try{var b=F(256);Z(a._olm_session_describe)(this.$b,b,256);return z(b)}finally{void 0!==b&&I(b)}});function eb(){var b=a._olm_utility_size();this.ac=F(b);this.$b=a._olm_utility(this.ac)}
function fb(b){return function(){var c=b.apply(this,arguments);if(c===h)throw c=z(a._olm_utility_last_error(arguments[0])),Error("OLM."+c);return c}}eb.prototype.free=function(){a._olm_clear_utility(this.$b);I(this.$b)};eb.prototype.sha256=J(function(b){var c=fb(a._olm_sha256_length)(this.$b);b=K(b);var d=L(b),e=L(c+1);try{fb(a._olm_sha256)(this.$b,d,b.length,e,c)}finally{for(M(d,b.length),d=0;d<b.length;d++)b[d]=0}return z(e,c)});
eb.prototype.ed25519_verify=J(function(b,c,d){b=K(b);var e=L(b);c=K(c);var f=L(c);d=K(d);var k=L(d);try{fb(a._olm_ed25519_verify)(this.$b,e,b.length,f,c.length,k,d.length)}finally{for(M(f,c.length),b=0;b<c.length;b++)c[b]=0}});olm_exports.Account=W;olm_exports.Session=Y;olm_exports.Utility=eb;olm_exports.PkEncryption=bb;olm_exports.PkDecryption=R;olm_exports.PkSigning=cb;olm_exports.SAS=U;
olm_exports.get_library_version=J(function(){var b=L(3);a._olm_get_library_version(b,b+1,b+2);return[Aa(b,"i8"),Aa(b+1,"i8"),Aa(b+2,"i8")]});
return Module.ready
}
);
})();
if (typeof exports === 'object' && typeof module === 'object')
module.exports = Module;
else if (typeof define === 'function' && define['amd'])
define([], function() { return Module; });
else if (typeof exports === 'object')
exports["Module"] = Module;
var olmInitPromise;
olm_exports['init'] = function(opts) {
if (olmInitPromise) return olmInitPromise;
if (opts) OLM_OPTIONS = opts;
olmInitPromise = new Promise(function(resolve, reject) {
onInitSuccess = function() {
resolve();
};
onInitFail = function(err) {
reject(err);
};
Module();
});
return olmInitPromise;
};
return olm_exports;
})();
if (typeof(window) !== 'undefined') {
// We've been imported directly into a browser. Define the global 'Olm' object.
// (we do this even if module.exports was defined, because it's useful to have
// Olm in the global scope for browserified and webpacked apps.)
window["Olm"] = Olm;
}
if (typeof module === 'object') {
// Emscripten sets the module exports to be its module
// with wrapped c functions. Clobber it with our higher
// level wrapper class.
module.exports = Olm;
}
// @license-end