You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

186 lines
435 KiB

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;a.ready=new Promise(function(b){aa=b});var g;if("undefined"!==typeof window)g=function(b){window.crypto.getRandomValues(b)};else if(module.exports){var ba=require("crypto");g=function(b){var c=ba.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 ca in OLM_OPTIONS)OLM_OPTIONS.hasOwnProperty(ca)&&(a[ca]=OLM_OPTIONS[ca]);
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 da={},l;for(l in a)a.hasOwnProperty(l)&&(da[l]=a[l]);var ea=!1,m=!1,fa=!1,ha=!1;ea="object"===typeof window;m="function"===typeof importScripts;fa="object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node;ha=!ea&&!fa&&!m;var p="",ia,ja,la,ma;
if(fa)p=m?require("path").dirname(p)+"/":__dirname+"/",ia=function(b,c){var d=q(b);if(d)return c?d:d.toString();la||(la=require("fs"));ma||(ma=require("path"));b=ma.normalize(b);return la.readFileSync(b,c?null:"utf8")},ja=function(b){b=ia(b,!0);b.buffer||(b=new Uint8Array(b));assert(b.buffer);return b},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),process.on("uncaughtException",function(b){throw b;}),process.on("unhandledRejection",r),a.inspect=function(){return"[Emscripten Module object]"};
else if(ha)"undefined"!=typeof read&&(ia=function(b){var c=q(b);return c?na(c):read(b)}),ja=function(b){var c;if(c=q(b))return c;if("function"===typeof readbuffer)return new Uint8Array(readbuffer(b));c=read(b,"binary");assert("object"===typeof c);return c},"undefined"!==typeof print&&("undefined"===typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!==typeof printErr?printErr:print);else if(ea||m)m?p=self.location.href:document.currentScript&&(p=document.currentScript.src),
_scriptDir&&(p=_scriptDir),0!==p.indexOf("blob:")?p=p.substr(0,p.lastIndexOf("/")+1):p="",ia=function(b){try{var c=new XMLHttpRequest;c.open("GET",b,!1);c.send(null);return c.responseText}catch(d){if(b=q(b))return na(b);throw d;}},m&&(ja=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=q(b))return b;throw d;}});var oa=a.print||console.log.bind(console),pa=a.printErr||console.warn.bind(console);
for(l in da)da.hasOwnProperty(l)&&(a[l]=da[l]);da=null;var t;a.wasmBinary&&(t=a.wasmBinary);var noExitRuntime;a.noExitRuntime&&(noExitRuntime=a.noExitRuntime);function qa(){this.buffer=new ArrayBuffer(ra/65536*65536);this.grow=function(b){return sa(b)}}function ta(){this.exports=(
// EMSCRIPTEN_START_ASM
function a(asmLibraryArg,wasmMemory,wasmTable){var scratchBuffer=new ArrayBuffer(8);var b=new Int32Array(scratchBuffer);var c=new Float32Array(scratchBuffer);var d=new Float64Array(scratchBuffer);function e(index){return b[index]}function f(index,value){b[index]=value}function g(){return d[0]}function h(value){d[0]=value}function i(global,env,buffer){var j=env.memory;var k=wasmTable;var l=new global.Int8Array(buffer);var m=new global.Int16Array(buffer);var n=new global.Int32Array(buffer);var o=new global.Uint8Array(buffer);var p=new global.Uint16Array(buffer);var q=new global.Uint32Array(buffer);var r=new global.Float32Array(buffer);var s=new global.Float64Array(buffer);var t=global.Math.imul;var u=global.Math.fround;var v=global.Math.abs;var w=global.Math.clz32;var x=global.Math.min;var y=global.Math.max;var z=global.Math.floor;var A=global.Math.ceil;var B=global.Math.sqrt;var C=env.abort;var D=global.NaN;var E=global.Infinity;var F=env.emscripten_memcpy_big;var G=env.emscripten_resize_heap;var H=5281376;var I=0;
// EMSCRIPTEN_START_FUNCS
function ub(a,b,c){var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,m=0,p=0,q=0,r=0,s=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,V=0,W=0,Y=0,Z=0,_=0,aa=0,ba=0,ca=0,da=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0;d=H-2592|0;H=d;f=o[b+28|0]|o[b+29|0]<<8|(o[b+30|0]<<16|o[b+31|0]<<24);n[d+24>>2]=o[b+24|0]|o[b+25|0]<<8|(o[b+26|0]<<16|o[b+27|0]<<24);n[d+28>>2]=f;f=o[b+20|0]|o[b+21|0]<<8|(o[b+22|0]<<16|o[b+23|0]<<24);n[d+16>>2]=o[b+16|0]|o[b+17|0]<<8|(o[b+18|0]<<16|o[b+19|0]<<24);n[d+20>>2]=f;f=o[b+4|0]|o[b+5|0]<<8|(o[b+6|0]<<16|o[b+7|0]<<24);e=o[b|0]|o[b+1|0]<<8|(o[b+2|0]<<16|o[b+3|0]<<24);n[d>>2]=e;n[d+4>>2]=f;f=o[b+12|0]|o[b+13|0]<<8|(o[b+14|0]<<16|o[b+15|0]<<24);n[d+8>>2]=o[b+8|0]|o[b+9|0]<<8|(o[b+10|0]<<16|o[b+11|0]<<24);n[d+12>>2]=f;l[d|0]=e&248;l[d+31|0]=o[d+31|0]&63|64;h=o[c+3|0];f=h;b=f<<24&50331648;f=o[c+2|0];e=f>>>16|0;n[d+112>>2]=b|(o[c|0]|o[c+1|0]<<8|f<<16);n[d+116>>2]=e;f=o[c+4|0];e=f>>>24|0;b=f<<8|h;f=o[c+5|0];i=f>>>16|0;g=b|f<<16;h=e|i;q=o[c+6|0];f=q;e=f>>>8|0;u=f<<24;f=e|h;e=g|u;n[d+120>>2]=((f&3)<<30|e>>>2)&33554431;n[d+124>>2]=0;f=o[c+7|0];e=f>>>24|0;g=f<<8|q;f=e;b=g;g=o[c+8|0];e=g>>>16|0;g=b|g<<16;h=e|f;q=o[c+9|0];f=q;e=f>>>8|0;u=f<<24;f=e|h;e=g|u;n[d+128>>2]=((f&7)<<29|e>>>3)&67108863;n[d+132>>2]=0;f=o[c+10|0];e=f>>>24|0;b=f<<8|q;f=o[c+11|0];i=f>>>16|0;g=b|f<<16;h=e|i;q=o[c+12|0];f=q;e=f>>>8|0;u=f<<24;f=e|h;e=g|u;n[d+136>>2]=((f&31)<<27|e>>>5)&33554431;n[d+140>>2]=0;f=o[c+13|0];e=f>>>24|0;g=f<<8|q;f=e;b=g;g=o[c+14|0];e=g>>>16|0;g=b|g<<16;h=e|f;f=o[c+15|0];e=f>>>8|0;q=f<<24;f=e|h;e=g|q;n[d+144>>2]=(f&63)<<26|e>>>6;n[d+148>>2]=f>>>6;h=o[c+19|0];f=h;b=f<<24&16777216;f=o[c+18|0];e=f>>>16|0;n[d+152>>2]=b|(o[c+16|0]|o[c+17|0]<<8|f<<16);n[d+156>>2]=e;f=o[c+20|0];e=f>>>24|0;b=f<<8|h;f=o[c+21|0];i=f>>>16|0;g=b|f<<16;h=e|i;q=o[c+22|0];f=q;e=f>>>8|0;u=f<<24;f=e|h;e=g|u;n[d+160>>2]=((f&1)<<31|e>>>1)&67108863;n[d+164>>2]=0;f=o[c+23|0];e=f>>>24|0;g=f<<8|q;f=e;b=g;g=o[c+24|0];e=g>>>16|0;g=b|g<<16;h=e|f;q=o[c+25|0];f=q;e=f>>>8|0;u=f<<24;f=e|h;e=g|u;n[d+168>>2]=((f&7)<<29|e>>>3)&33554431;n[d+172>>2]=0;f=o[c+26|0];e=f>>>24|0;b=f<<8|q;f=o[c+27|0];i=f>>>16|0;g=b|f<<16;h=e|i;q=o[c+28|0];f=q;e=f>>>8|0;u=f<<24;f=e|h;e=g|u;n[d+176>>2]=((f&15)<<28|e>>>4)&67108863;n[d+180>>2]=0;f=o[c+29|0];e=f>>>24|0;g=f<<8|q;f=e;b=g;g=o[c+30|0];e=g>>>16|0;g=b|g<<16;f=e|f;c=o[c+31|0];e=c>>>8|0;h=c<<24;c=e|f;f=g|h;n[d+184>>2]=((c&63)<<26|f>>>6)&33554431;n[d+188>>2]=0;ea(d+1312|0,0,152);n[d+1312>>2]=1;n[d+1316>>2]=0;ea(d+1152|0,0,152);n[d+1152>>2]=1;n[d+1156>>2]=0;ea(d+992|0,0,152);ea(d+832|0,0,152);ea(d+672|0,0,152);n[d+672>>2]=1;n[d+676>>2]=0;ea(d+512|0,0,152);ea(d+352|0,0,152);n[d+352>>2]=1;n[d+356>>2]=0;ea(d+1552|0,0,72);X(d+1472|0,d+112|0,80);qa=d+272|0;q=d+512|0;f=d+832|0;u=d+352|0;h=d+672|0;c=d+992|0;p=d+1472|0;b=d+1152|0;s=d+1312|0;while(1){oa=o[(d-na|0)+31|0];pa=0;while(1){M=f;w=b;f=p;ma=(oa&128)>>>7|0;Oa(b,f,ma);G=c;g=s;Oa(c,g,ma);e=b;v=e;R=n[c+4>>2];S=n[e+4>>2];k=R+S|0;s=n[c>>2];p=n[e>>2];m=p;r=s+m|0;if(r>>>0<m>>>0){k=k+1|0}n[v>>2]=r;n[e+4>>2]=k;v=b;T=n[c+12>>2];V=n[e+12>>2];j=T+V|0;m=n[c+8>>2];r=n[e+8>>2];y=m+r|0;if(y>>>0<r>>>0){j=j+1|0}n[v+8>>2]=y;n[e+12>>2]=j;W=n[c+20>>2];Y=n[b+20>>2];e=W+Y|0;y=n[c+16>>2];A=n[b+16>>2];z=y+A|0;if(z>>>0<A>>>0){e=e+1|0}n[b+16>>2]=z;n[b+20>>2]=e;e=b;v=e;Z=n[c+28>>2];_=n[e+28>>2];i=Z+_|0;x=n[c+24>>2];L=n[e+24>>2];z=L;J=x+z|0;if(J>>>0<z>>>0){i=i+1|0}n[v+24>>2]=J;n[e+28>>2]=i;aa=n[c+36>>2];ba=n[b+36>>2];e=aa+ba|0;J=n[c+32>>2];N=n[b+32>>2];E=N;B=J+E|0;if(B>>>0<E>>>0){e=e+1|0}n[b+32>>2]=B;n[b+36>>2]=e;e=b;v=e;ca=n[c+44>>2];da=n[e+44>>2];k=ca+da|0;z=n[c+40>>2];E=n[e+40>>2];B=E;K=z+B|0;if(K>>>0<B>>>0){k=k+1|0}n[v+40>>2]=K;n[e+44>>2]=k;v=b;ga=n[c+52>>2];O=n[e+52>>2];j=ga+O|0;B=n[c+48>>2];K=n[e+48>>2];k=K;F=B+k|0;if(F>>>0<k>>>0){j=j+1|0}n[v+48>>2]=F;n[e+52>>2]=j;ha=n[c+60>>2];ia=n[b+60>>2];e=ha+ia|0;F=n[c+56>>2];v=n[b+56>>2];D=v;i=F+D|0;if(i>>>0<D>>>0){e=e+1|0}n[b+56>>2]=i;n[b+60>>2]=e;e=b;Q=e;P=n[c+68>>2];ja=n[e+68>>2];i=P+ja|0;k=n[c+64>>2];D=n[e+64>>2];j=D;C=k+j|0;if(C>>>0<j>>>0){i=i+1|0}n[Q+64>>2]=C;n[e+68>>2]=i;la=n[c+76>>2];ka=n[b+76>>2];e=la+ka|0;j=n[c+72>>
function Bd(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;f=H-16|0;H=f;g=-1;b=Ia(b,c,d,e,a+300|0);a:{if((b|0)==-1){break a}b=b+d|0;d=aa(d,b,f+12|0);if(n[f+12>>2]+ -1>>>0>=2){n[a+300>>2]=9;break a}c=a+296|0;d=Da(Xa(a+132|0,Xa(a,d,b),b),b,a+264|0);b:{if(n[f+12>>2]==1){n[c>>2]=1;break b}if((b|0)!=(d|0)){l[c|0]=o[d|0]!=0;d=d+1|0}}g=e;if((b|0)==(d|0)){break a}n[a+300>>2]=10;g=-1}H=f+16|0;return g|0}function Gb(a){var b=0,c=0,d=0,e=0,f=0;b=a+48|0;d=n[a+44>>2];e=36;a:{if((b|0)==(d|0)){break a}c=4;while(1){c=c+100|0;b=b+100|0;if((d|0)!=(b|0)){continue}break}e=c+32|0}d=4;c=4;b=a+152|0;f=n[a+148>>2];if((b|0)!=(f|0)){while(1){c=c+68|0;b=b+68|0;if((f|0)!=(b|0)){continue}break}}b=a+496|0;a=n[a+492>>2];if((b|0)!=(a|0)){while(1){d=d+68|0;b=b+68|0;if((a|0)!=(b|0)){continue}break}}return(c+e|0)+d|0}function vc(a,b,c,d){var e=0,f=0;l[d+1|0]=10;l[d|0]=3;d=d+2|0;l[d|0]=32;d=d+1|0;n[a>>2]=d;d=d+32|0;l[d|0]=16;d=d+1|0;if(b>>>0>=128){e=b;while(1){l[d|0]=b|128;d=d+1|0;f=e>>>0>16383;b=e>>>7|0;e=b;if(f){continue}break}}l[d+1|0]=34;l[d|0]=b;d=d+2|0;if(c>>>0>=128){e=c;while(1){l[d|0]=c|128;d=d+1|0;b=e>>>0>16383;c=e>>>7|0;e=c;if(b){continue}break}}l[d|0]=c;n[a+4>>2]=d+1}function Yb(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=H-16|0;H=h;a:{if(!(!f|43<=g>>>0)){n[a>>2]=2;g=-1;break a}g=-1;b=Ia(b,c,d,e,a);if((b|0)==-1){break a}b=b+d|0;c=b+1|0;d=aa(d,c,h+12|0);if(n[h+12>>2]!=1){n[a>>2]=9;break a}if((Ba(d,c,a+4|0)|0)!=(b|0)){if(n[a>>2]){break a}n[a>>2]=10;break a}if(f){ha(a+4|0,32,f)}g=e}H=h+16|0;return g|0}function fe(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,i=0,j=0;h=gb(a,c);i=h+2|0;j=(i>>>0)/3|0;if((j<<2|i-t(j,3))+ -2>>>0>g>>>0){n[a+3216>>2]=2;return-1}g=a;i=b;a=h+2|0;b=(a>>>0)/3|0;b=qc(g,i,c,d,e,(((b<<2|a-t(b,3))+ -2|0)+f|0)-h|0,h);W(d,e);a=-1;if((b|0)!=-1){a=h+2|0;b=(a>>>0)/3|0;a=(b<<2|a-t(b,3))+ -2|0;ha((f+a|0)-h|0,h,f)}return a|0}function Cc(a,b,c){var d=0,e=0,f=0;a:{d=n[c+16>>2];if(!d){if(Dc(c)){break a}d=n[c+16>>2]}f=n[c+20>>2];if(d-f>>>0<b>>>0){k[n[c+36>>2]](c,a,b)|0;return}b:{if(l[c+75|0]<0){break b}d=b;while(1){e=d;if(!e){break b}d=e+ -1|0;if(o[d+a|0]!=10){continue}break}if(k[n[c+36>>2]](c,a,e)>>>0<e>>>0){break a}b=b-e|0;a=a+e|0;f=n[c+20>>2]}X(f,a,b);n[c+20>>2]=n[c+20>>2]+b}}function Ic(a,b){var c=0,d=0;c=Ca(Bb(Z(a,3),b),b+96|0);a=b+164|0;c=Z(c,(n[b+160>>2]-a|0)/72|0);d=n[b+160>>2];if((d|0)!=(a|0)){while(1){c=Z(c,n[a>>2]);l[c|0]=o[a+4|0];c=Ca(c+1|0,a+5|0);a=a+72|0;if((d|0)!=(a|0)){continue}break}}a=Z(c,n[b+7364>>2]);l[a|0]=o[b+7368|0];a=Z(Ca(a+1|0,b+7369|0),n[b+7436>>2]);l[a|0]=o[b+7440|0];Z(Ca(a+1|0,b+7441|0),n[b+7508>>2])}function tc(a,b,c,d){var e=0,f=0,g=0;l[c+1|0]=8;l[c|0]=3;e=c+2|0;if(a>>>0>=128){f=a;while(1){l[e|0]=a|128;e=e+1|0;g=f>>>0>16383;a=f>>>7|0;f=a;if(g){continue}break}}l[e+1|0]=18;l[e|0]=a;e=e+2|0;a:{if(b>>>0<128){a=b;break a}a=b;f=a;while(1){l[e|0]=a|128;e=e+1|0;g=f>>>0>16383;a=f>>>7|0;f=a;if(g){continue}break}}l[e|0]=a;a=e+1|0;n[d>>2]=a;return(a+b|0)-c|0}function uc(a,b,c){var d=0,e=0;l[c+1|0]=10;l[c|0]=3;c=c+2|0;l[c|0]=32;c=c+1|0;n[a+8>>2]=c;c=c+32|0;l[c|0]=18;c=c+1|0;l[c|0]=32;c=c+1|0;n[a+4>>2]=c;c=c+32|0;l[c|0]=26;c=c+1|0;l[c|0]=32;c=c+1|0;n[a>>2]=c;c=c+32|0;l[c|0]=34;c=c+1|0;if(b>>>0>=128){d=b;while(1){l[c|0]=b|128;c=c+1|0;e=d>>>0>16383;b=d>>>7|0;d=b;if(e){continue}break}}l[c|0]=b;n[a+12>>2]=c+1}function Wb(a,b,c,d,e,f,g,h,i){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0;e=H-80|0;H=e;j=n[371];a:{if(k[j](n[9136],ca(g))>>>0>i>>>0){n[a>>2]=2;g=-1;break a}da(b,c,e+48|0);la(a+4|0,e+48|0,e+16|0);da(d,11,e+8|0);b=ca(g);da(f,g,f);g=k[n[372]](n[9136],e+16|0,32,e+8|0,8,f,b,h,i)|0;if((g|0)!=-1){break a}n[a>>2]=5}H=e+80|0;return g|0}function Mc(a,b,c,d){var e=0,f=0;e=H-160|0;H=e;X(e+8|0,36392,144);a:{b:{if(b+ -1>>>0>=2147483647){if(b){break b}b=1;a=e+159|0}n[e+52>>2]=a;n[e+28>>2]=a;f=-2-a|0;b=b>>>0>f>>>0?f:b;n[e+56>>2]=b;a=a+b|0;n[e+36>>2]=a;n[e+24>>2]=a;a=Rc(e+8|0,c,d);if(!b){break a}b=n[e+28>>2];l[b-((b|0)==n[e+24>>2])|0]=0;break a}n[9440]=61;a=-1}H=e+160|0;return a}function Ad(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0;d=H-32|0;H=d;e=-1;c=xa(b,c,b);a:{if((c|0)==-
function se(a,b,c){a=a|0;b=b|0;c=c|0;a=Vc(a,b,c);W(b,c);return a|0}function De(a,b,c){a=a|0;b=b|0;c=c|0;a=Rd(a,b,c);W(b,c);return a|0}function re(a){a=a|0;if(o[a+7368|0]){a=72}else{a=18}return a|0}function gb(a,b){b=ab(a,b);if(!o[a+3220|0]){b=nb(b)}return b}function xe(a,b,c){a=a|0;b=b|0;c=c|0;return wd(a,b,c)|0}function qe(a,b,c){a=a|0;b=b|0;c=c|0;return Tc(a,b,c)|0}function Be(a,b,c){a=a|0;b=b|0;c=c|0;return Md(a,b,c)|0}function Xa(a,b,c){return aa(Ea(b,c,a,128),c,a+128|0)}function he(a){a=a|0;return(n[a+44>>2]==(a+48|0))<<5}function Sb(a){a=a|0;W(a,100);ea(a,0,100);return 100}function Ya(a,b){return Z(Fa(b,a,128),n[a+128>>2])}function kb(a){Jb(a);l[a+3220|0]=0;n[a+3216>>2]=0}function $b(a){a=a|0;W(a,68);ea(a,0,68);return 68}function Ne(a){a=a|0;W(a,4);n[a>>2]=0;return a|0}function Le(a){a=a|0;W(a,3320);kb(a);return 3320}function tb(a,b){if(!a){return 0}return Sc(a,b)}function Oe(a){a=a|0;W(a,3320);kb(a);return a|0}function Nb(a,b){a=a|0;b=b|0;return(b&-16)+16|0}function le(a,b,c){a=a|0;b=b|0;c=c|0;nc(a,b,c)}function Ke(a){a=a|0;W(a,4);n[a>>2]=0;return 4}function yc(a){a=a|0;a=H-a&-16;H=a;return a|0}function _(a,b,c){if(!(o[a|0]&32)){Cc(b,c,a)}}function Sa(a,b,c,d){return(Od(d,b,c,a)|0)!=0}function ef(a,b,c,d){a=cf(a,b,c,d);return a}function La(a,b,c){n[a+128>>2]=c;X(a,b,128)}function ue(a,b){a=a|0;b=b|0;return b<<5}function sd(a){a=a|0;W(a,104);return a|0}function rd(a){a=a|0;W(a,104);return 104}function hd(a){a=a|0;W(a,232);return a|0}function gd(a){a=a|0;W(a,232);return 232}function Tb(a){a=a|0;W(a,100);return a|0}function Jd(a){a=a|0;W(a,304);return a|0}function Id(a){a=a|0;W(a,304);return 304}function xd(a){a=a|0;return n[a+296>>2]}function xb(a){a=a|0;return n[a+128>>2]}function nd(a){a=a|0;return n[a+100>>2]}function hc(a){a=a|0;W(a,36);return a|0}function hb(a){a=a|0;return o[a+3220|0]}function ac(a){a=a|0;W(a,68);return a|0}function Ma(a,b,c,d){Nd(d,b,c,a,a+32|0)}function Lb(a,b){a=a|0;b=b|0;return b|0}function Je(a){a=a|0;return oa(pb(a))|0}function Ie(a){a=a|0;return oa(fb(a))|0}function Fa(a,b,c){return X(a,b,c)+c|0}function ed(a){a=a|0;return oa(232)|0}function Dd(a){a=a|0;return oa(301)|0}function _b(a){a=a|0;return oa(68)|0}function ye(a){a=a|0;return Gd(a)|0}function we(a){a=a|0;return ld(a)|0}function ff(a,b,c){return df(a,b,c)}function xc(a){a=a|0;return C()|0}function la(a,b,c){ub(c,a+32|0,b)}function fb(a){return Gb(a)+101|0}function ve(a){a=a|0;return 100}function vd(a){a=a|0;return 220}function bd(a){a=a|0;return 160}function Xc(a){a=a|0;return 306}function Ta(a,b){Qd(b,b+32|0,a)}function Ce(a){a=a|0;return 116}function bb(a){a=a|0;return 32}function Cb(a){a=a|0;return 64}function Ae(a){a=a|0;return 86}function Aa(a){a=a|0;return 43}function Ob(a){a=a|0;return 8}function Se(){return 7516}function Re(){return 3320}function zc(a){a=a|0;H=a}function td(){return 104}function id(){return 232}function Ub(){return 100}function Kd(){return 304}function Bc(){return H|0}function ic(){return 36}function db(){return 43}function bc(){return 68}function Ra(){return 32}function Qb(){return 86}function Ve(){return-1}function Qe(){return 4}function bf(){}
// EMSCRIPTEN_END_FUNCS
k[1]=Ob;k[2]=Nb;k[3]=Mb;k[4]=Lb;k[5]=Kb;k[6]=Oc;k[7]=Nc;k[8]=Lc;function J(){return buffer.byteLength/65536|0}return{"__wasm_call_ctors":bf,"olm_pk_encryption_last_error":Ga,"olm_pk_encryption_size":ic,"olm_pk_encryption":hc,"olm_clear_pk_encryption":gc,"olm_pk_encryption_set_recipient_key":fc,"olm_pk_key_length":db,"olm_pk_ciphertext_length":ec,"olm_pk_mac_length":dc,"olm_pk_encrypt_random_length":bb,"olm_pk_encrypt":cc,"olm_pk_decryption_last_error":Ga,"olm_pk_decryption_size":bc,"olm_pk_decryption":ac,"olm_clear_pk_decryption":$b,"olm_pk_private_key_length":Ra,"olm_pk_generate_key_random_length":Ra,"olm_pk_key_from_private":cb,"olm_pk_generate_key":cb,"olm_pickle_pk_decryption_length":_b,"olm_pickle_pk_decryption":Zb,"olm_unpickle_pk_decryption":Yb,"olm_pk_max_plaintext_length":Xb,"olm_pk_decrypt":Wb,"olm_pk_get_private_key":Vb,"olm_pk_signing_size":Ub,"olm_pk_signing":Tb,"olm_pk_signing_last_error":Ga,"olm_clear_pk_signing":Sb,"olm_pk_signing_seed_length":Ra,"olm_pk_signing_public_key_length":db,"olm_pk_signing_key_from_seed":Rb,"olm_pk_signature_length":Qb,"olm_pk_sign":Pb,"olm_get_library_version":We,"olm_error":Ve,"olm_account_last_error":Ue,"olm_session_last_error":Te,"olm_utility_last_error":Ga,"olm_account_size":Se,"olm_session_size":Re,"olm_utility_size":Qe,"olm_account":Pe,"olm_session":Oe,"olm_utility":Ne,"olm_clear_account":Me,"olm_clear_session":Le,"olm_clear_utility":Ke,"olm_pickle_account_length":Je,"olm_pickle_session_length":Ie,"olm_pickle_account":He,"olm_pickle_session":Ge,"olm_unpickle_account":Fe,"olm_unpickle_session":Ee,"olm_create_account_random_length":Cb,"olm_create_account":De,"olm_account_identity_keys_length":Ce,"olm_account_identity_keys":Be,"olm_account_signature_length":Ae,"olm_account_sign":ze,"olm_account_one_time_keys_length":ye,"olm_account_one_time_keys":xe,"olm_account_mark_keys_as_published":we,"olm_account_max_number_of_one_time_keys":ve,"olm_account_generate_one_time_keys_random_length":ue,"olm_account_generate_one_time_keys":te,"olm_account_generate_fallback_key_random_length":bb,"olm_account_generate_fallback_key":se,"olm_account_fallback_key_length":re,"olm_account_fallback_key":qe,"olm_create_outbound_session_random_length":Cb,"olm_create_outbound_session":pe,"olm_create_inbound_session":oe,"olm_create_inbound_session_from":ne,"olm_session_id_length":Aa,"olm_session_id":me,"olm_session_has_received_message":hb,"olm_session_describe":le,"olm_matches_inbound_session":ke,"olm_matches_inbound_session_from":je,"olm_remove_one_time_keys":ie,"olm_encrypt_message_type":hb,"olm_encrypt_random_length":he,"olm_encrypt_message_length":ge,"olm_encrypt":fe,"olm_decrypt_max_plaintext_length":ee,"olm_decrypt":de,"olm_sha256_length":Aa,"olm_sha256":ce,"olm_ed25519_verify":be,"olm_inbound_group_session_size":Kd,"olm_inbound_group_session":Jd,"olm_clear_inbound_group_session":Id,"olm_inbound_group_session_last_error":Hd,"olm_init_inbound_group_session":Fd,"olm_import_inbound_group_session":Ed,"olm_pickle_inbound_group_session_length":Dd,"olm_pickle_inbound_group_session":Cd,"olm_unpickle_inbound_group_session":Bd,"olm_group_decrypt_max_plaintext_length":Ad,"olm_group_decrypt":zd,"olm_inbound_group_session_id_length":Aa,"olm_inbound_group_session_id":yd,"olm_inbound_group_session_first_known_index":xb,"olm_inbound_group_session_is_verified":xd,"olm_export_inbound_group_session_length":vd,"olm_export_inbound_group_session":ud,"olm_sas_last_error":Ga,"olm_sas_size":td,"olm_sas":sd,"olm_clear_sas":rd,"olm_create_sas_random_length":bb,"olm_create_sas":qd,"olm_sas_pubkey_length":Aa,"olm_sas_get_pubkey":pd,"olm_sas_set_their_key":od,"olm_sas_is_their_key_set":nd,"olm_sas_generate_bytes":md,"olm_sas_mac_length":Aa,"olm_sas_calculate_mac":kd,"olm_sas_calculate_mac_long_kdf":jd,"olm_outbound_group_session_size":id,"olm_outbound_group_session":hd,"olm_clear_outbound_group_session":gd,"olm_outbound_group_session_last_error":fd,"olm_pickle_outbound_group_session_length":ed,"olm_pickle_outbound_group_session":dd,"olm_unpickle_outbound_group_session":cd,"olm_init_outbound_group_session_random_length":bd,"ol
// EMSCRIPTEN_END_ASM
)(ua,u,va)}function wa(){return{then:function(b){b({instance:new ta})}}}var xa=Error,WebAssembly={};t=[];"object"!==typeof WebAssembly&&r("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":ya[b>>1]=0;break;case "i32":y[b>>2]=0;break;case "i64":za=[0,(Aa=0,1<=+Ba(Aa)?0<Aa?(Ca(+Da(Aa/4294967296),4294967295)|0)>>>0:~~+Ea((Aa-+(~~Aa>>>0))/4294967296)>>>0:0)];y[b>>2]=za[0];y[b+4>>2]=za[1];break;case "float":Fa[b>>2]=0;break;case "double":Ga[b>>3]=0;break;default:r("invalid type for setValue: "+c)}}
function Ia(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 ya[b>>1];case "i32":return y[b>>2];case "i64":return y[b>>2];case "float":return Fa[b>>2];case "double":return Ga[b>>3];default:r("invalid type for getValue: "+c)}return null}
var u,va=new function(b){var c=Array(b.initial);c.grow=function(){9<=c.length&&r("Unable to grow wasm table. Use a higher value for RESERVED_FUNCTION_POINTERS or set ALLOW_TABLE_GROWTH.");c.push(null)};c.set=function(d,e){c[d]=e};c.get=function(d){return c[d]};return c}({initial:9,maximum:9,element:"anyfunc"}),Ja=!1;function assert(b,c){b||r("Assertion failed: "+c)}var Ka="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&&Ka)b=Ka.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 n=d[b++]&63;f=224==(f&240)?(f&15)<<12|k<<6|n:(f&7)<<18|k<<12|n<<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 La(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 n=b.charCodeAt(k);if(55296<=n&&57343>=n){var v=b.charCodeAt(++k);n=65536+((n&1023)<<10)|v&1023}if(127>=n){if(d>=e)break;c[d++]=n}else{if(2047>=n){if(d+1>=e)break;c[d++]=192|n>>6}else{if(65535>=n){if(d+2>=e)break;c[d++]=224|n>>12}else{if(d+3>=e)break;c[d++]=240|n>>18;c[d++]=128|n>>12&63}c[d++]=128|n>>6&63}c[d++]=128|n&63}}c[d]=0;return d-f}
function Ma(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 Na(b,c){for(var d=0;d<b.length;++d)x[c++>>0]=b.charCodeAt(d)}var Oa,x,A,ya,y,Fa,Ga,ra=a.INITIAL_MEMORY||16777216;a.wasmMemory?u=a.wasmMemory:u=new qa;u&&(Oa=u.buffer);ra=Oa.byteLength;var B=Oa;Oa=B;a.HEAP8=x=new Int8Array(B);a.HEAP16=ya=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=Fa=new Float32Array(B);a.HEAPF64=Ga=new Float64Array(B);y[9584]=5281376;function Pa(b){for(;0<b.length;){var c=b.shift();if("function"==typeof c)c(a);else{var d=c.f;"number"===typeof d?void 0===c.c?a.dynCall_v(d):a.dynCall_vi(d,c.c):d(void 0===c.c?null:c.c)}}}var Qa=[],Ra=[],Sa=[],Ta=[];function Ua(){var b=a.preRun.shift();Qa.unshift(b)}var Ba=Math.abs,Ea=Math.ceil,Da=Math.floor,Ca=Math.min,C=0,Va=null,Wa=null;a.preloadedImages={};
a.preloadedAudios={};function r(b){if(a.onAbort)a.onAbort(b);oa(b);pa(b);Ja=!0;throw new xa("abort("+b+"). Build with -s ASSERTIONS=1 for more info.");}function Xa(b,c){return String.prototype.startsWith?b.startsWith(c):0===b.indexOf(c)}var Ya="data:application/octet-stream;base64,",D="olm_legacy.wasm";if(!Xa(D,Ya)){var Za=D;D=a.locateFile?a.locateFile(Za,p):p+Za}
function $a(){try{if(t)return new Uint8Array(t);var b=q(D);if(b)return b;if(ja)return ja(D);throw"both async and sync fetching of the wasm failed";}catch(c){r(c)}}function ab(){return t||!ea&&!m||"function"!==typeof fetch||Xa(D,"file://")?new Promise(function(b){b($a())}):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 $a()})}var Aa,za;Ra.push({f:function(){bb()}});var cb=!1;
function na(b){for(var c=[],d=0;d<b.length;d++){var e=b[d];255<e&&(cb&&assert(!1,"Character code "+e+" ("+String.fromCharCode(e)+") at offset "+d+" not in 0x00-0xFF."),e&=255);c.push(String.fromCharCode(e))}return c.join("")}
var db="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 n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(d++));e=e<<2|f>>4;
f=(f&15)<<4|k>>2;var v=(k&3)<<6|n;c+=String.fromCharCode(e);64!==k&&(c+=String.fromCharCode(f));64!==n&&(c+=String.fromCharCode(v))}while(d<b.length);return c};
function q(b){if(Xa(b,Ya)){b=b.slice(Ya.length);if("boolean"===typeof fa&&fa){try{var c=Buffer.from(b,"base64")}catch(k){c=new Buffer(b,"base64")}var d=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}else try{var e=db(b),f=new Uint8Array(e.length);for(c=0;c<e.length;++c)f[c]=e.charCodeAt(c);d=f}catch(k){throw Error("Converting base64 string to bytes failed.");}return d}}var ua={emscripten_memcpy_big:function(b,c,d){A.copyWithin(b,c,c+d)},emscripten_resize_heap:function(){r("OOM")},memory:u,table:va};
(function(){function b(f){a.asm=f.exports;C--;a.monitorRunDependencies&&a.monitorRunDependencies(C);0==C&&(null!==Va&&(clearInterval(Va),Va=null),Wa&&(f=Wa,Wa=null,f()))}function c(f){b(f.instance)}function d(f){return ab().then(function(){return wa()}).then(f,function(k){pa("failed to asynchronously prepare wasm: "+k);r(k)})}var e={env:ua,wasi_snapshot_preview1:ua};C++;a.monitorRunDependencies&&a.monitorRunDependencies(C);if(a.instantiateWasm)try{return a.instantiateWasm(e,b)}catch(f){return pa("Module.instantiateWasm callback failed with error: "+
f),!1}(function(){if(t||"function"!==typeof WebAssembly.instantiateStreaming||Xa(D,Ya)||Xa(D,"file://")||"function"!==typeof fetch)return d(c);fetch(D,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,e).then(c,function(k){pa("wasm streaming compile failed: "+k);pa("falling back to ArrayBuffer instantiation");return d(c)})})})();return{}})();var bb=a.___wasm_call_ctors=function(){return(bb=a.___wasm_call_ctors=a.asm.__wasm_call_ctors).apply(null,arguments)};
a._olm_pk_encryption_last_error=function(){return(a._olm_pk_encryption_last_error=a.asm.olm_pk_encryption_last_error).apply(null,arguments)};a._olm_pk_encryption_size=function(){return(a._olm_pk_encryption_size=a.asm.olm_pk_encryption_size).apply(null,arguments)};a._olm_pk_encryption=function(){return(a._olm_pk_encryption=a.asm.olm_pk_encryption).apply(null,arguments)};a._olm_clear_pk_encryption=function(){return(a._olm_clear_pk_encryption=a.asm.olm_clear_pk_encryption).apply(null,arguments)};
a._olm_pk_encryption_set_recipient_key=function(){return(a._olm_pk_encryption_set_recipient_key=a.asm.olm_pk_encryption_set_recipient_key).apply(null,arguments)};a._olm_pk_key_length=function(){return(a._olm_pk_key_length=a.asm.olm_pk_key_length).apply(null,arguments)};a._olm_pk_ciphertext_length=function(){return(a._olm_pk_ciphertext_length=a.asm.olm_pk_ciphertext_length).apply(null,arguments)};a._olm_pk_mac_length=function(){return(a._olm_pk_mac_length=a.asm.olm_pk_mac_length).apply(null,arguments)};
a._olm_pk_encrypt_random_length=function(){return(a._olm_pk_encrypt_random_length=a.asm.olm_pk_encrypt_random_length).apply(null,arguments)};a._olm_pk_encrypt=function(){return(a._olm_pk_encrypt=a.asm.olm_pk_encrypt).apply(null,arguments)};a._olm_pk_decryption_last_error=function(){return(a._olm_pk_decryption_last_error=a.asm.olm_pk_decryption_last_error).apply(null,arguments)};a._olm_pk_decryption_size=function(){return(a._olm_pk_decryption_size=a.asm.olm_pk_decryption_size).apply(null,arguments)};
a._olm_pk_decryption=function(){return(a._olm_pk_decryption=a.asm.olm_pk_decryption).apply(null,arguments)};a._olm_clear_pk_decryption=function(){return(a._olm_clear_pk_decryption=a.asm.olm_clear_pk_decryption).apply(null,arguments)};a._olm_pk_private_key_length=function(){return(a._olm_pk_private_key_length=a.asm.olm_pk_private_key_length).apply(null,arguments)};
a._olm_pk_generate_key_random_length=function(){return(a._olm_pk_generate_key_random_length=a.asm.olm_pk_generate_key_random_length).apply(null,arguments)};a._olm_pk_key_from_private=function(){return(a._olm_pk_key_from_private=a.asm.olm_pk_key_from_private).apply(null,arguments)};a._olm_pk_generate_key=function(){return(a._olm_pk_generate_key=a.asm.olm_pk_generate_key).apply(null,arguments)};
a._olm_pickle_pk_decryption_length=function(){return(a._olm_pickle_pk_decryption_length=a.asm.olm_pickle_pk_decryption_length).apply(null,arguments)};a._olm_pickle_pk_decryption=function(){return(a._olm_pickle_pk_decryption=a.asm.olm_pickle_pk_decryption).apply(null,arguments)};a._olm_unpickle_pk_decryption=function(){return(a._olm_unpickle_pk_decryption=a.asm.olm_unpickle_pk_decryption).apply(null,arguments)};
a._olm_pk_max_plaintext_length=function(){return(a._olm_pk_max_plaintext_length=a.asm.olm_pk_max_plaintext_length).apply(null,arguments)};a._olm_pk_decrypt=function(){return(a._olm_pk_decrypt=a.asm.olm_pk_decrypt).apply(null,arguments)};a._olm_pk_get_private_key=function(){return(a._olm_pk_get_private_key=a.asm.olm_pk_get_private_key).apply(null,arguments)};a._olm_pk_signing_size=function(){return(a._olm_pk_signing_size=a.asm.olm_pk_signing_size).apply(null,arguments)};
a._olm_pk_signing=function(){return(a._olm_pk_signing=a.asm.olm_pk_signing).apply(null,arguments)};a._olm_pk_signing_last_error=function(){return(a._olm_pk_signing_last_error=a.asm.olm_pk_signing_last_error).apply(null,arguments)};a._olm_clear_pk_signing=function(){return(a._olm_clear_pk_signing=a.asm.olm_clear_pk_signing).apply(null,arguments)};a._olm_pk_signing_seed_length=function(){return(a._olm_pk_signing_seed_length=a.asm.olm_pk_signing_seed_length).apply(null,arguments)};
a._olm_pk_signing_public_key_length=function(){return(a._olm_pk_signing_public_key_length=a.asm.olm_pk_signing_public_key_length).apply(null,arguments)};a._olm_pk_signing_key_from_seed=function(){return(a._olm_pk_signing_key_from_seed=a.asm.olm_pk_signing_key_from_seed).apply(null,arguments)};a._olm_pk_signature_length=function(){return(a._olm_pk_signature_length=a.asm.olm_pk_signature_length).apply(null,arguments)};a._olm_pk_sign=function(){return(a._olm_pk_sign=a.asm.olm_pk_sign).apply(null,arguments)};
a._olm_get_library_version=function(){return(a._olm_get_library_version=a.asm.olm_get_library_version).apply(null,arguments)};a._olm_error=function(){return(a._olm_error=a.asm.olm_error).apply(null,arguments)};a._olm_account_last_error=function(){return(a._olm_account_last_error=a.asm.olm_account_last_error).apply(null,arguments)};a._olm_session_last_error=function(){return(a._olm_session_last_error=a.asm.olm_session_last_error).apply(null,arguments)};
a._olm_utility_last_error=function(){return(a._olm_utility_last_error=a.asm.olm_utility_last_error).apply(null,arguments)};a._olm_account_size=function(){return(a._olm_account_size=a.asm.olm_account_size).apply(null,arguments)};a._olm_session_size=function(){return(a._olm_session_size=a.asm.olm_session_size).apply(null,arguments)};a._olm_utility_size=function(){return(a._olm_utility_size=a.asm.olm_utility_size).apply(null,arguments)};
a._olm_account=function(){return(a._olm_account=a.asm.olm_account).apply(null,arguments)};a._olm_session=function(){return(a._olm_session=a.asm.olm_session).apply(null,arguments)};a._olm_utility=function(){return(a._olm_utility=a.asm.olm_utility).apply(null,arguments)};a._olm_clear_account=function(){return(a._olm_clear_account=a.asm.olm_clear_account).apply(null,arguments)};a._olm_clear_session=function(){return(a._olm_clear_session=a.asm.olm_clear_session).apply(null,arguments)};
a._olm_clear_utility=function(){return(a._olm_clear_utility=a.asm.olm_clear_utility).apply(null,arguments)};a._olm_pickle_account_length=function(){return(a._olm_pickle_account_length=a.asm.olm_pickle_account_length).apply(null,arguments)};a._olm_pickle_session_length=function(){return(a._olm_pickle_session_length=a.asm.olm_pickle_session_length).apply(null,arguments)};a._olm_pickle_account=function(){return(a._olm_pickle_account=a.asm.olm_pickle_account).apply(null,arguments)};
a._olm_pickle_session=function(){return(a._olm_pickle_session=a.asm.olm_pickle_session).apply(null,arguments)};a._olm_unpickle_account=function(){return(a._olm_unpickle_account=a.asm.olm_unpickle_account).apply(null,arguments)};a._olm_unpickle_session=function(){return(a._olm_unpickle_session=a.asm.olm_unpickle_session).apply(null,arguments)};a._olm_create_account_random_length=function(){return(a._olm_create_account_random_length=a.asm.olm_create_account_random_length).apply(null,arguments)};
a._olm_create_account=function(){return(a._olm_create_account=a.asm.olm_create_account).apply(null,arguments)};a._olm_account_identity_keys_length=function(){return(a._olm_account_identity_keys_length=a.asm.olm_account_identity_keys_length).apply(null,arguments)};a._olm_account_identity_keys=function(){return(a._olm_account_identity_keys=a.asm.olm_account_identity_keys).apply(null,arguments)};
a._olm_account_signature_length=function(){return(a._olm_account_signature_length=a.asm.olm_account_signature_length).apply(null,arguments)};a._olm_account_sign=function(){return(a._olm_account_sign=a.asm.olm_account_sign).apply(null,arguments)};a._olm_account_one_time_keys_length=function(){return(a._olm_account_one_time_keys_length=a.asm.olm_account_one_time_keys_length).apply(null,arguments)};
a._olm_account_one_time_keys=function(){return(a._olm_account_one_time_keys=a.asm.olm_account_one_time_keys).apply(null,arguments)};a._olm_account_mark_keys_as_published=function(){return(a._olm_account_mark_keys_as_published=a.asm.olm_account_mark_keys_as_published).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.olm_account_max_number_of_one_time_keys).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.olm_account_generate_one_time_keys_random_length).apply(null,arguments)};a._olm_account_generate_one_time_keys=function(){return(a._olm_account_generate_one_time_keys=a.asm.olm_account_generate_one_time_keys).apply(null,arguments)};
a._olm_account_generate_fallback_key_random_length=function(){return(a._olm_account_generate_fallback_key_random_length=a.asm.olm_account_generate_fallback_key_random_length).apply(null,arguments)};a._olm_account_generate_fallback_key=function(){return(a._olm_account_generate_fallback_key=a.asm.olm_account_generate_fallback_key).apply(null,arguments)};a._olm_account_fallback_key_length=function(){return(a._olm_account_fallback_key_length=a.asm.olm_account_fallback_key_length).apply(null,arguments)};
a._olm_account_fallback_key=function(){return(a._olm_account_fallback_key=a.asm.olm_account_fallback_key).apply(null,arguments)};a._olm_create_outbound_session_random_length=function(){return(a._olm_create_outbound_session_random_length=a.asm.olm_create_outbound_session_random_length).apply(null,arguments)};a._olm_create_outbound_session=function(){return(a._olm_create_outbound_session=a.asm.olm_create_outbound_session).apply(null,arguments)};
a._olm_create_inbound_session=function(){return(a._olm_create_inbound_session=a.asm.olm_create_inbound_session).apply(null,arguments)};a._olm_create_inbound_session_from=function(){return(a._olm_create_inbound_session_from=a.asm.olm_create_inbound_session_from).apply(null,arguments)};a._olm_session_id_length=function(){return(a._olm_session_id_length=a.asm.olm_session_id_length).apply(null,arguments)};a._olm_session_id=function(){return(a._olm_session_id=a.asm.olm_session_id).apply(null,arguments)};
a._olm_session_has_received_message=function(){return(a._olm_session_has_received_message=a.asm.olm_session_has_received_message).apply(null,arguments)};a._olm_session_describe=function(){return(a._olm_session_describe=a.asm.olm_session_describe).apply(null,arguments)};a._olm_matches_inbound_session=function(){return(a._olm_matches_inbound_session=a.asm.olm_matches_inbound_session).apply(null,arguments)};
a._olm_matches_inbound_session_from=function(){return(a._olm_matches_inbound_session_from=a.asm.olm_matches_inbound_session_from).apply(null,arguments)};a._olm_remove_one_time_keys=function(){return(a._olm_remove_one_time_keys=a.asm.olm_remove_one_time_keys).apply(null,arguments)};a._olm_encrypt_message_type=function(){return(a._olm_encrypt_message_type=a.asm.olm_encrypt_message_type).apply(null,arguments)};
a._olm_encrypt_random_length=function(){return(a._olm_encrypt_random_length=a.asm.olm_encrypt_random_length).apply(null,arguments)};a._olm_encrypt_message_length=function(){return(a._olm_encrypt_message_length=a.asm.olm_encrypt_message_length).apply(null,arguments)};a._olm_encrypt=function(){return(a._olm_encrypt=a.asm.olm_encrypt).apply(null,arguments)};a._olm_decrypt_max_plaintext_length=function(){return(a._olm_decrypt_max_plaintext_length=a.asm.olm_decrypt_max_plaintext_length).apply(null,arguments)};
a._olm_decrypt=function(){return(a._olm_decrypt=a.asm.olm_decrypt).apply(null,arguments)};a._olm_sha256_length=function(){return(a._olm_sha256_length=a.asm.olm_sha256_length).apply(null,arguments)};a._olm_sha256=function(){return(a._olm_sha256=a.asm.olm_sha256).apply(null,arguments)};a._olm_ed25519_verify=function(){return(a._olm_ed25519_verify=a.asm.olm_ed25519_verify).apply(null,arguments)};
a._olm_inbound_group_session_size=function(){return(a._olm_inbound_group_session_size=a.asm.olm_inbound_group_session_size).apply(null,arguments)};a._olm_inbound_group_session=function(){return(a._olm_inbound_group_session=a.asm.olm_inbound_group_session).apply(null,arguments)};a._olm_clear_inbound_group_session=function(){return(a._olm_clear_inbound_group_session=a.asm.olm_clear_inbound_group_session).apply(null,arguments)};
a._olm_inbound_group_session_last_error=function(){return(a._olm_inbound_group_session_last_error=a.asm.olm_inbound_group_session_last_error).apply(null,arguments)};a._olm_init_inbound_group_session=function(){return(a._olm_init_inbound_group_session=a.asm.olm_init_inbound_group_session).apply(null,arguments)};a._olm_import_inbound_group_session=function(){return(a._olm_import_inbound_group_session=a.asm.olm_import_inbound_group_session).apply(null,arguments)};
a._olm_pickle_inbound_group_session_length=function(){return(a._olm_pickle_inbound_group_session_length=a.asm.olm_pickle_inbound_group_session_length).apply(null,arguments)};a._olm_pickle_inbound_group_session=function(){return(a._olm_pickle_inbound_group_session=a.asm.olm_pickle_inbound_group_session).apply(null,arguments)};a._olm_unpickle_inbound_group_session=function(){return(a._olm_unpickle_inbound_group_session=a.asm.olm_unpickle_inbound_group_session).apply(null,arguments)};
a._olm_group_decrypt_max_plaintext_length=function(){return(a._olm_group_decrypt_max_plaintext_length=a.asm.olm_group_decrypt_max_plaintext_length).apply(null,arguments)};a._olm_group_decrypt=function(){return(a._olm_group_decrypt=a.asm.olm_group_decrypt).apply(null,arguments)};a._olm_inbound_group_session_id_length=function(){return(a._olm_inbound_group_session_id_length=a.asm.olm_inbound_group_session_id_length).apply(null,arguments)};
a._olm_inbound_group_session_id=function(){return(a._olm_inbound_group_session_id=a.asm.olm_inbound_group_session_id).apply(null,arguments)};a._olm_inbound_group_session_first_known_index=function(){return(a._olm_inbound_group_session_first_known_index=a.asm.olm_inbound_group_session_first_known_index).apply(null,arguments)};a._olm_inbound_group_session_is_verified=function(){return(a._olm_inbound_group_session_is_verified=a.asm.olm_inbound_group_session_is_verified).apply(null,arguments)};
a._olm_export_inbound_group_session_length=function(){return(a._olm_export_inbound_group_session_length=a.asm.olm_export_inbound_group_session_length).apply(null,arguments)};a._olm_export_inbound_group_session=function(){return(a._olm_export_inbound_group_session=a.asm.olm_export_inbound_group_session).apply(null,arguments)};a._olm_sas_last_error=function(){return(a._olm_sas_last_error=a.asm.olm_sas_last_error).apply(null,arguments)};
a._olm_sas_size=function(){return(a._olm_sas_size=a.asm.olm_sas_size).apply(null,arguments)};a._olm_sas=function(){return(a._olm_sas=a.asm.olm_sas).apply(null,arguments)};a._olm_clear_sas=function(){return(a._olm_clear_sas=a.asm.olm_clear_sas).apply(null,arguments)};a._olm_create_sas_random_length=function(){return(a._olm_create_sas_random_length=a.asm.olm_create_sas_random_length).apply(null,arguments)};a._olm_create_sas=function(){return(a._olm_create_sas=a.asm.olm_create_sas).apply(null,arguments)};
a._olm_sas_pubkey_length=function(){return(a._olm_sas_pubkey_length=a.asm.olm_sas_pubkey_length).apply(null,arguments)};a._olm_sas_get_pubkey=function(){return(a._olm_sas_get_pubkey=a.asm.olm_sas_get_pubkey).apply(null,arguments)};a._olm_sas_set_their_key=function(){return(a._olm_sas_set_their_key=a.asm.olm_sas_set_their_key).apply(null,arguments)};a._olm_sas_is_their_key_set=function(){return(a._olm_sas_is_their_key_set=a.asm.olm_sas_is_their_key_set).apply(null,arguments)};
a._olm_sas_generate_bytes=function(){return(a._olm_sas_generate_bytes=a.asm.olm_sas_generate_bytes).apply(null,arguments)};a._olm_sas_mac_length=function(){return(a._olm_sas_mac_length=a.asm.olm_sas_mac_length).apply(null,arguments)};a._olm_sas_calculate_mac=function(){return(a._olm_sas_calculate_mac=a.asm.olm_sas_calculate_mac).apply(null,arguments)};a._olm_sas_calculate_mac_long_kdf=function(){return(a._olm_sas_calculate_mac_long_kdf=a.asm.olm_sas_calculate_mac_long_kdf).apply(null,arguments)};
a._olm_outbound_group_session_size=function(){return(a._olm_outbound_group_session_size=a.asm.olm_outbound_group_session_size).apply(null,arguments)};a._olm_outbound_group_session=function(){return(a._olm_outbound_group_session=a.asm.olm_outbound_group_session).apply(null,arguments)};a._olm_clear_outbound_group_session=function(){return(a._olm_clear_outbound_group_session=a.asm.olm_clear_outbound_group_session).apply(null,arguments)};
a._olm_outbound_group_session_last_error=function(){return(a._olm_outbound_group_session_last_error=a.asm.olm_outbound_group_session_last_error).apply(null,arguments)};a._olm_pickle_outbound_group_session_length=function(){return(a._olm_pickle_outbound_group_session_length=a.asm.olm_pickle_outbound_group_session_length).apply(null,arguments)};a._olm_pickle_outbound_group_session=function(){return(a._olm_pickle_outbound_group_session=a.asm.olm_pickle_outbound_group_session).apply(null,arguments)};
a._olm_unpickle_outbound_group_session=function(){return(a._olm_unpickle_outbound_group_session=a.asm.olm_unpickle_outbound_group_session).apply(null,arguments)};a._olm_init_outbound_group_session_random_length=function(){return(a._olm_init_outbound_group_session_random_length=a.asm.olm_init_outbound_group_session_random_length).apply(null,arguments)};a._olm_init_outbound_group_session=function(){return(a._olm_init_outbound_group_session=a.asm.olm_init_outbound_group_session).apply(null,arguments)};
a._olm_group_encrypt_message_length=function(){return(a._olm_group_encrypt_message_length=a.asm.olm_group_encrypt_message_length).apply(null,arguments)};a._olm_group_encrypt=function(){return(a._olm_group_encrypt=a.asm.olm_group_encrypt).apply(null,arguments)};a._olm_outbound_group_session_id_length=function(){return(a._olm_outbound_group_session_id_length=a.asm.olm_outbound_group_session_id_length).apply(null,arguments)};
a._olm_outbound_group_session_id=function(){return(a._olm_outbound_group_session_id=a.asm.olm_outbound_group_session_id).apply(null,arguments)};a._olm_outbound_group_session_message_index=function(){return(a._olm_outbound_group_session_message_index=a.asm.olm_outbound_group_session_message_index).apply(null,arguments)};a._olm_outbound_group_session_key_length=function(){return(a._olm_outbound_group_session_key_length=a.asm.olm_outbound_group_session_key_length).apply(null,arguments)};
a._olm_outbound_group_session_key=function(){return(a._olm_outbound_group_session_key=a.asm.olm_outbound_group_session_key).apply(null,arguments)};a._malloc=function(){return(a._malloc=a.asm.malloc).apply(null,arguments)};a._free=function(){return(a._free=a.asm.free).apply(null,arguments)};
var eb=a.stackSave=function(){return(eb=a.stackSave=a.asm.stackSave).apply(null,arguments)},fb=a.stackRestore=function(){return(fb=a.stackRestore=a.asm.stackRestore).apply(null,arguments)},gb=a.stackAlloc=function(){return(gb=a.stackAlloc=a.asm.stackAlloc).apply(null,arguments)},sa=a.__growWasmMemory=function(){return(sa=a.__growWasmMemory=a.asm.__growWasmMemory).apply(null,arguments)};a.ALLOC_STACK=1;var hb;Wa=function ib(){hb||jb();hb||(Wa=ib)};
function jb(){function b(){if(!hb&&(hb=!0,a.calledRun=!0,!Ja)){Pa(Ra);Pa(Sa);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();Ta.unshift(c)}Pa(Ta)}}if(!(0<C)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)Ua();Pa(Qa);0<C||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);b()},1)):b())}}
a.run=jb;if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();noExitRuntime=!0;jb();function E(){var b=a._olm_outbound_group_session_size();this.b=F(b);this.a=a._olm_outbound_group_session(this.b)}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.a);I(this.a)};
E.prototype.pickle=J(function(b){b=K(b);var c=G(a._olm_pickle_outbound_group_session_length)(this.a),d=L(b),e=L(c+1);try{G(a._olm_pickle_outbound_group_session)(this.a,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.a,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.a),c=N(b,g);G(a._olm_init_outbound_group_session)(this.a,c,b)});E.prototype.encrypt=function(b){try{var c=Ma(b);var d=G(a._olm_group_encrypt_message_length)(this.a,c);var e=F(c+1);La(b,A,e,c+1);var f=F(d+1);G(a._olm_group_encrypt)(this.a,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.a),c=L(b+1);G(a._olm_outbound_group_session_id)(this.a,c,b);return z(c,b)});E.prototype.session_key=J(function(){var b=G(a._olm_outbound_group_session_key_length)(this.a),c=L(b+1);G(a._olm_outbound_group_session_key)(this.a,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.a)};olm_exports.OutboundGroupSession=E;
function O(){var b=a._olm_inbound_group_session_size();this.b=F(b);this.a=a._olm_inbound_group_session(this.b)}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.a);I(this.a)};
O.prototype.pickle=J(function(b){b=K(b);var c=P(a._olm_pickle_inbound_group_session_length)(this.a),d=L(b),e=L(c+1);try{P(a._olm_pickle_inbound_group_session)(this.a,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.a,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.a,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.a,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);Na(b,c);var d=P(a._olm_group_decrypt_max_plaintext_length)(this.a,c,b.length);Na(b,c);var e=F(d+1);var f=L(4);var k=P(a._olm_group_decrypt)(this.a,c,b.length,e,d,f);w(e+k);return{plaintext:z(e,k),message_index:Ia(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.a),c=L(b+1);P(a._olm_inbound_group_session_id)(this.a,c,b);return z(c,b)});
O.prototype.first_known_index=J(function(){return P(a._olm_inbound_group_session_first_known_index)(this.a)});O.prototype.export_session=J(function(b){var c=P(a._olm_export_inbound_group_session_length)(this.a),d=L(c+1);G(a._olm_export_inbound_group_session)(this.a,d,c,b);b=z(d,c);M(d,c);return b});olm_exports.InboundGroupSession=O;function kb(){var b=a._olm_pk_encryption_size();this.b=F(b);this.a=a._olm_pk_encryption(this.b)}
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}}kb.prototype.free=function(){a._olm_clear_pk_encryption(this.a);I(this.a)};kb.prototype.set_recipient_key=J(function(b){b=K(b);var c=L(b);Q(a._olm_pk_encryption_set_recipient_key)(this.a,c,b.length)});
kb.prototype.encrypt=J(function(b){try{var c=Ma(b);var d=F(c+1);La(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.a,c);var n=F(k+1);var v=Q(a._olm_pk_mac_length)(this.a),ka=L(v+1);w(ka+v);var V=Q(a._olm_pk_key_length)(),H=L(V+1);w(H+V);Q(a._olm_pk_encrypt)(this.a,d,c,n,k,ka,v,H,V,f,e);w(n+k);return{ciphertext:z(n,k),mac:z(ka,v),ephemeral:z(H,V)}}finally{void 0!==f&&M(f,e),void 0!==d&&(M(d,c+1),I(d)),void 0!==n&&I(n)}});
function R(){var b=a._olm_pk_decryption_size();this.b=F(b);this.a=a._olm_pk_decryption(this.b)}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.a);I(this.a)};
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.a,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.a,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.a,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.a),d=L(b),e=L(c+1);try{S(a._olm_pickle_pk_decryption)(this.a,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.a,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=Ma(d);var f=F(e+1);La(d,A,f,e+1);var k=K(b),n=L(k),v=K(c),ka=L(v);var V=S(a._olm_pk_max_plaintext_length)(this.a,e);var H=F(V+1);var Ha=S(a._olm_pk_decrypt)(this.a,n,k.length,ka,v.length,f,e,H,V);w(H+Ha);return z(H,Ha)}finally{void 0!==H&&(M(H,Ha+1),I(H)),void 0!==f&&I(f)}});function lb(){var b=a._olm_pk_signing_size();this.b=F(b);this.a=a._olm_pk_signing(this.b)}
function mb(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}}lb.prototype.free=function(){a._olm_clear_pk_signing(this.a);I(this.a)};lb.prototype.init_with_seed=J(function(b){var c=L(b.length);a.HEAPU8.set(b,c);var d=mb(a._olm_pk_signing_public_key_length)(),e=L(d+1);try{mb(a._olm_pk_signing_key_from_seed)(this.a,e,d,c,b.length)}finally{M(c,b.length)}return z(e,d)});
lb.prototype.generate_seed=J(function(){var b=mb(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});lb.prototype.sign=J(function(b){try{var c=Ma(b);var d=F(c+1);La(b,A,d,c+1);var e=mb(a._olm_pk_signature_length)(),f=L(e+1);mb(a._olm_pk_sign)(this.a,d,c,f,e);return z(f,e)}finally{void 0!==d&&(M(d,c+1),I(d))}});
function T(){var b=a._olm_sas_size(),c=a._olm_create_sas_random_length(),d=N(c,g);this.b=F(b);this.a=a._olm_sas(this.b);a._olm_create_sas(this.a,d,c);M(d,c)}function U(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}}T.prototype.free=function(){a._olm_clear_sas(this.a);I(this.a)};T.prototype.get_pubkey=J(function(){var b=U(a._olm_sas_pubkey_length)(this.a),c=L(b+1);U(a._olm_sas_get_pubkey)(this.a,c,b);return z(c,b)});
T.prototype.set_their_key=J(function(b){b=K(b);var c=L(b);U(a._olm_sas_set_their_key)(this.a,c,b.length)});T.prototype.is_their_key_set=J(function(){return U(a._olm_sas_is_their_key_set)(this.a)?!0:!1});T.prototype.generate_bytes=J(function(b,c){b=K(b);var d=L(b),e=L(c);U(a._olm_sas_generate_bytes)(this.a,d,b.length,e,c);return new Uint8Array(new Uint8Array(a.HEAPU8.buffer,e,c))});
T.prototype.calculate_mac=J(function(b,c){b=K(b);var d=L(b);c=K(c);var e=L(c),f=U(a._olm_sas_mac_length)(this.a),k=L(f+1);U(a._olm_sas_calculate_mac)(this.a,d,b.length,e,c.length,k,f);return z(k,f)});T.prototype.calculate_mac_long_kdf=J(function(b,c){b=K(b);var d=L(b);c=K(c);var e=L(c),f=U(a._olm_sas_mac_length)(this.a),k=L(f+1);U(a._olm_sas_calculate_mac_long_kdf)(this.a,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=gb(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(Ma(b)+1),b=La(b,c,0,c.length),c.length=b;return c}function J(b){return function(){var c=eb();try{return b.apply(this,arguments)}finally{fb(c)}}}function M(b,c){for(;0<c--;)a.HEAP8[b++]=0}
function W(){var b=a._olm_account_size();this.b=F(b);this.a=a._olm_account(this.b)}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.a);I(this.a)};W.prototype.create=J(function(){var b=X(a._olm_create_account_random_length)(this.a),c=N(b,g);X(a._olm_create_account)(this.a,c,b)});
W.prototype.identity_keys=J(function(){var b=X(a._olm_account_identity_keys_length)(this.a),c=L(b+1);X(a._olm_account_identity_keys)(this.a,c,b);return z(c,b)});W.prototype.sign=J(function(b){var c=X(a._olm_account_signature_length)(this.a);b=K(b);var d=L(b),e=L(c+1);try{X(a._olm_account_sign)(this.a,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.a),c=L(b+1);X(a._olm_account_one_time_keys)(this.a,c,b);return z(c,b)});W.prototype.mark_keys_as_published=J(function(){X(a._olm_account_mark_keys_as_published)(this.a)});W.prototype.max_number_of_one_time_keys=J(function(){return X(a._olm_account_max_number_of_one_time_keys)(this.a)});
W.prototype.generate_one_time_keys=J(function(b){var c=X(a._olm_account_generate_one_time_keys_random_length)(this.a,b),d=N(c,g);X(a._olm_account_generate_one_time_keys)(this.a,b,d,c)});W.prototype.remove_one_time_keys=J(function(b){X(a._olm_remove_one_time_keys)(this.a,b.a)});W.prototype.generate_fallback_key=J(function(){var b=X(a._olm_account_generate_fallback_key_random_length)(this.a),c=N(b,g);X(a._olm_account_generate_fallback_key)(this.a,c,b)});
W.prototype.fallback_key=J(function(){var b=X(a._olm_account_fallback_key_length)(this.a),c=L(b+1);X(a._olm_account_fallback_key)(this.a,c,b);return z(c,b)});W.prototype.pickle=J(function(b){b=K(b);var c=X(a._olm_pickle_account_length)(this.a),d=L(b),e=L(c+1);try{X(a._olm_pickle_account)(this.a,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.a,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.b=F(b);this.a=a._olm_session(this.b)}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.a);I(this.a)};
Y.prototype.pickle=J(function(b){b=K(b);var c=Z(a._olm_pickle_session_length)(this.a),d=L(b),e=L(c+1);try{Z(a._olm_pickle_session)(this.a,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.a,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.a),f=N(e,g);c=K(c);d=K(d);var k=L(c),n=L(d);try{Z(a._olm_create_outbound_session)(this.a,b.a,k,c.length,n,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.a,b.a,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.a,b.a,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.a),c=L(b+1);Z(a._olm_session_id)(this.a,c,b);return z(c,b)});Y.prototype.has_received_message=function(){return Z(a._olm_session_has_received_message)(this.a)?!0:!1};
Y.prototype.matches_inbound=J(function(b){b=K(b);var c=L(b);return Z(a._olm_matches_inbound_session)(this.a,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.a,d,b.length,e,c.length)?!0:!1});
Y.prototype.encrypt=J(function(b){try{var c=Z(a._olm_encrypt_random_length)(this.a);var d=Z(a._olm_encrypt_message_type)(this.a);var e=Ma(b);var f=Z(a._olm_encrypt_message_length)(this.a,e);var k=N(c,g);var n=F(e+1);La(b,A,n,e+1);var v=F(f+1);Z(a._olm_encrypt)(this.a,n,e,k,c,v,f);w(v+f);return{type:d,body:z(v,f)}}finally{void 0!==k&&M(k,c),void 0!==n&&(M(n,e+1),I(n)),void 0!==v&&I(v)}});
Y.prototype.decrypt=J(function(b,c){try{var d=F(c.length);Na(c,d);var e=Z(a._olm_decrypt_max_plaintext_length)(this.a,b,d,c.length);Na(c,d);var f=F(e+1);var k=Z(a._olm_decrypt)(this.a,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.a,b,256);return z(b)}finally{void 0!==b&&I(b)}});function nb(){var b=a._olm_utility_size();this.b=F(b);this.a=a._olm_utility(this.b)}
function ob(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}}nb.prototype.free=function(){a._olm_clear_utility(this.a);I(this.a)};nb.prototype.sha256=J(function(b){var c=ob(a._olm_sha256_length)(this.a);b=K(b);var d=L(b),e=L(c+1);try{ob(a._olm_sha256)(this.a,d,b.length,e,c)}finally{for(M(d,b.length),d=0;d<b.length;d++)b[d]=0}return z(e,c)});
nb.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{ob(a._olm_ed25519_verify)(this.a,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=nb;olm_exports.PkEncryption=kb;olm_exports.PkDecryption=R;olm_exports.PkSigning=lb;olm_exports.SAS=T;
olm_exports.get_library_version=J(function(){var b=L(3);a._olm_get_library_version(b,b+1,b+2);return[Ia(b,"i8"),Ia(b+1,"i8"),Ia(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;
}