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.

182 lines
445 KiB

// @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.12
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",function(b){throw b;}),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.replace(/[?#].*/,"").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,"LSsgICAwWDB4AC0wWCswWCAwWC0weCsweCAweABuYW4AaW5mAFBpY2tsZQAgJWQAQkFEX0FDQ09VTlRfS0VZAEJBRF9TRVNTSU9OX0tFWQBVTktOT1dOX01FU1NBR0VfSU5ERVgAT0xNX1NBU19USEVJUl9LRVlfTk9UX1NFVABCQURfTUVTU0FHRV9GT1JNQVQATUVHT0xNX0tFWVMAU1VDQ0VTUwBVTktOT1dOX0VSUk9SAFVOS05PV05fUElDS0xFX1ZFUlNJT04AQkFEX01FU1NBR0VfVkVSU0lPTgBOQU4ATk9UX0VOT1VHSF9SQU5ET00AT1VUUFVUX0JVRkZFUl9UT09fU01BTEwAT0xNX0lOUFVUX0JVRkZFUl9UT09fU01BTEwASU5GAEJBRF9TSUdOQVRVUkUAQkFEX0xFR0FDWV9BQ0NPVU5UX1BJQ0tMRQBDT1JSVVBURURfUElDS0xFAEJBRF9NRVNTQUdFX0tFWV9JRABCQURfTUVTU0FHRV9NQUMAT0xNX1BJQ0tMRV9FWFRSQV9EQVRBACBza2lwcGVkIG1lc3NhZ2Uga2V5czoAcmVjZWl2ZXIgY2hhaW4gaW5kaWNlczoAImN1cnZlMjU1MTkiOgAiZWQyNTUxOSI6AElOVkFMSURfQkFTRTY0AC4AKG51bGwpAHNlbmRlciBjaGFpbiBpbmRleDogJWQg");l(e,1568,"QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrL/////////////////////////////////////////////////////////8+////PzQ1Njc4OTo7PD3/////////AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBn///////8aGxwdHh8gISIjJCUmJygpKissLS4vMDEyM///////AQAAAAIAAAADAAAABAAAAAU=");l(e,1824,"CQ==");l(e,1856,"4AYAABYGAAAAAAAAAQIAAGwHAAAIAAAAdQcAAAsAAADgBgAAgQcAAAgAAABPTE1fUk9PVABPTE1fUkFUQ0hFVABPTE1fS0VZUwAAAAAAAAC2eFn/hXLTAL1uFf8PCmoAKcABAJjoef+8PKD/mXHO/wC34v60DUj/AAAAAAAAAACwoA7+08mG/54YjwB/aTUAYAy9AKfX+/+fTID+amXh/x78BACSDK4=");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/02bLQ
// EMSCRIPTEN_START_FUNCS
function Fb(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,qa=0,ra=0,sa=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;pa(z,0,152);F[g+1152>>2]=1;F[g+1156>>2]=0;b=g+992|0;pa(b,0,152);F[g+992>>2]=1;F[g+996>>2]=0;c=g+832|0;pa(c,0,152);j=g+672|0;pa(j,0,152);k=g+512|0;pa(k,0,152);F[g+512>>2]=1;F[g+516>>2]=0;r=g+352|0;pa(r,0,152);Q=g+192|0;pa(Q,0,152);F[g+192>>2]=1;F[g+196>>2]=0;pa(g+1392|0,0,72);t=g+1312|0;ja(t,g+112|0,80);Ma=g+2512|0;while(1){ua=G[(g-sa|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 Pb(a,b,c,d){var e=0,f=0,g=0;e=_-48|0;_=e;$a(e+8|0,c,d);d=0;c=F[e+12>>2];f=(c|b)!=0;a:{b:{if(c){if(!f){break a}if(F[e+16>>2]==32){break b}break a}if(!f){break a}}if(!F[e+36>>2]){break a}f=F[e+20>>2];if(!f|F[e+24>>2]!=32){break a}g=F[e+28>>2];if(!g|F[e+32>>2]!=32){break a}c:{d:{if(c){c=La(c,a+3221|0);if(b){if(c){break a}break d}if(!c){break c}break a}if(!b){break c}}if(La(b,a+3221|0)){break a}}if(La(f,a+3253|0)){break a}d=!La(g,a+3285|0)}_=e+48|0;return d}function ac(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=oa(d);if((e|0)==-1){F[a+3216>>2]=7;return-1}sa(c,d,c);d=_-48|0;_=d;a:{b:{if((b|0)!=1){$a(d+8|0,c,e);c=F[d+36>>2];if(!c){F[a+3216>>2]=4;break b}e=F[d+40>>2]}b=_-32|0;_=b;f=c;c=F[a+4>>2];eb(b,f,e,aa[F[F[c>>2]>>2]](c)|0);c:{if(!F[b+24>>2]){F[a+8>>2]=4;c=-1;break c}c=F[a+4>>2];c=aa[F[F[c>>2]+12>>2]](c,F[b+28>>2])|0}_=b+32|0;if((c|0)!=-1){break a}F[a+3216>>2]=F[a+8>>2];F[a+8>>2]=0}c=-1}_=d+48|0;return c|0}function Ja(a,b,c){var d=0,e=0,f=0;d=_-16|0;D[d+15|0]=0;a:{if(!c){break a}f=c-1|0;e=c&3;if(e){while(1){D[d+15|0]=G[d+15|0]|G[b|0]^G[a|0];b=b+1|0;a=a+1|0;c=c-1|0;e=e-1|0;if(e){continue}break}}if(f>>>0<3){break a}while(1){D[d+15|0]=G[d+15|0]|G[a|0]^G[b|0];D[d+15|0]=G[d+15|0]|G[a+1|0]^G[b+1|0];D[d+15|0]=G[d+15|0]|G[a+2|0]^G[b+2|0];D[d+15|0]=G[d+15|0]|G[a+3|0]^G[b+3|0];b=b+4|0;a=a+4|0;c=c-4|0;if(c){continue}break}}return!G[d+15|0]}function ce(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,k=0;j=_-80|0;_=j;k=F[443];a:{if(aa[k|0](F[9096],oa(g))>>>0>i>>>0){F[a>>2]=2;g=-1;break a}k=oa(g);if((k|0)!=-1?(c|0)!=43|(e|0)!=11:1){F[a>>2]=7;g=-1;break a}c=b;b=j+48|0;sa(c,43,b);c=b;b=j+16|0;za(a+4|0,c,b);c=j+8|0;sa(d,11,c);sa(f,g,f);g=aa[F[444]](F[9096],b,32,c,8,f,k,h,i)|0;if((g|0)!=-1){break a}F[a>>2]=5}_=j+80|0;return g|0}function ee(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=_-16|0;_=h;a:{if(!(!f|g>>>0>=43)){F[a>>2]=2;g=-1;break a}g=-1;b=Xa(b,c,d,e,a);if((b|0)==-1){break a}b:{b=b+d|0;c=va(d,b,h+12|0);c:{if(!c){break c}if(F[h+12>>2]!=1){F[a>>2]=9;break c}c=Ia(c,b,a+4|0);if(c){break b}}if(F[a>>2]){break a}F[a>>2]=10;break a}if((b|0)!=(c|0)){F[a>>2]=17;break a}if(f){ma(a+4|0,32,f)}g=e}_=h+16|0;return g|0}function Nb(a){var b=0,c=0,d=0,e=0,f=0;b=a+48|0;d=F[a+44>>2];if((b|0)==(d|0)){d=36}else{c=4;while(1){c=c+100|0;b=b+100|0;if((d|0)!=(b|0)){continue}break}d=c+32|0}e=4;c=4;b=a+152|0;f=F[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=F[a+492>>2];if((b|0)!=(a|0)){while(1){e=e+68|0;b=b+68|0;if((a|0)!=(b|0)){continue}break}}return((c+d|0)+e|0)+101|0}function ue(a,b,c){var d=0,e=0,f=0,g=0;g=c&63;f=g;e=f&31;if(f>>>0>=32){f=-1>>>e|0}else{f=-1>>>e|0;d=f;f=d|(1<<e)-1<<32-e}f=f&a;d=b&d;e=g&31;if(g>>>0>=32){d=f<<e;g=0}else{d=(1<<e)-1&f>>>32-e|d<<e;g=f<<e}f=d;e=0-c&63;d=e&31;if(e>>>0>=32){d=-1<<d;c=0}else{c=-1<<d;d=c|(1<<d)-1&-1>>>32-d}a=c&a;b=b&d;d=e&31;if(e>>>0>=32){c=0;a=b>>>d|0}else{c=b>>>d|0;a=((1<<d)-1&b)<<32-d|a>>>d}a=a|g;$=c|f;return a}
function na(a,b,c){var d=0,e=0,f=0;if(!(G[a|0]&32)){a:{e=b;d=c;b=a;a=F[b+16>>2];b:{if(!a){if(zb(b)){break b}a=F[b+16>>2]}f=F[b+20>>2];if(a-f>>>0<d>>>0){aa[F[b+36>>2]](b,e,c)|0;break a}c:{if(F[b+80>>2]<0){break c}a=c;while(1){d=a;if(!d){break c}a=d-1|0;if(G[e+a|0]!=10){continue}break}if(aa[F[b+36>>2]](b,e,d)>>>0<d>>>0){break b}e=d+e|0;c=c-d|0;f=F[b+20>>2]}ja(f,e,c);F[b+20>>2]=F[b+20>>2]+c}}}}function bd(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0;e=F[a+84>>2];f=F[e+4>>2];g=F[a+28>>2];d=F[a+20>>2]-g|0;d=d>>>0>f>>>0?f:d;if(d){ja(F[e>>2],g,d);F[e>>2]=d+F[e>>2];f=F[e+4>>2]-d|0;F[e+4>>2]=f}d=F[e>>2];f=c>>>0>f>>>0?f:c;if(f){ja(d,b,f);d=f+F[e>>2]|0;F[e>>2]=d;F[e+4>>2]=F[e+4>>2]-f}D[d|0]=0;b=F[a+44>>2];F[a+28>>2]=b;F[a+20>>2]=b;return c|0}function wd(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=db(d,b,f+12|0);b:{if(!c){d=10;break b}d=9;if(F[f+12>>2]!=1){break b}c=hb(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 Jd(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=Oa(b,c,b);a:{if((c|0)==-1){F[a+300>>2]=7;break a}f=b;b=F[9340];vb(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[9340];e=aa[F[F[a>>2]+12>>2]](a,F[d+24>>2])|0}_=d+32|0;return e|0}function Jb(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;ra(d,a,b);Ba(d,c);ia(d,112);_=d+112|0}function La(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 Zb(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}sa(b,c,h);c=-1;b=oa(g);if((b|0)==-1){F[a>>2]=7;break a}sa(f,g,f);b:{if(b>>>0>=64){c=0;if(gb(h,d,e,f)){break b}}F[a>>2]=5;c=-1}}_=h+32|0;return c|0}function Qa(a,b,c){var d=0,e=0,f=0;a:{if(b>>>0<1){d=a;break a}while(1){d=se(a,b,10);e=$;f=e;e=re(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 ra(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){fb(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 gd(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 rc(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 Db(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=Db(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 ed(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}_=
// EMSCRIPTEN_END_FUNCS
e=G;p(da);var aa=c([null,Yb,qe,he,Zd,Vd,dd,cd,bd]);function ba(){return C.byteLength/65536|0}return{"d":Vb,"e":aa,"f":Xc,"g":Wc,"h":Vc,"i":Ud,"j":Uc,"k":Tc,"l":Sc,"m":Va,"n":Ua,"o":Rc,"p":Qc,"q":Pc,"r":Oc,"s":Nc,"t":Mc,"u":Lc,"v":Kc,"w":Jc,"x":Ic,"y":Hc,"z":Gc,"A":Fc,"B":Ec,"C":Dc,"D":tb,"E":Cc,"F":Bc,"G":Ac,"H":zc,"I":yc,"J":xc,"K":wc,"L":vc,"M":uc,"N":tc,"O":sc,"P":pb,"Q":rc,"R":qc,"S":pc,"T":oc,"U":nc,"V":mc,"W":tb,"X":lc,"Y":kc,"Z":jc,"_":Pa,"$":ic,"aa":sb,"ba":hc,"ca":gc,"da":fc,"ea":ec,"fa":sb,"ga":dc,"ha":cc,"ia":bc,"ja":ac,"ka":$b,"la":Pa,"ma":_b,"na":Zb,"oa":Va,"pa":Ua,"qa":Xb,"ra":Wb,"sa":pe,"ta":oe,"ua":Ub,"va":ne,"wa":me,"xa":pb,"ya":le,"za":Va,"Aa":Ua,"Ba":ke,"Ca":je,"Da":ie,"Ea":ob,"Fa":ob,"Ga":Tb,"Ha":Tb,"Ia":ge,"Ja":fe,"Ka":ee,"La":de,"Ma":ce,"Na":be,"Oa":ae,"Pa":$d,"Qa":Va,"Ra":Ua,"Sa":_d,"Ta":ob,"Ua":Ub,"Va":Yd,"Wa":Xd,"Xa":Wd,"Ya":Td,"Za":Sd,"_a":Rd,"$a":Qd,"ab":Pd,"bb":Od,"cb":Nd,"db":Md,"eb":Ld,"fb":Kd,"gb":Jd,"hb":Id,"ib":Pa,"jb":Hd,"kb":Kb,"lb":Gd,"mb":Fd,"nb":Ed,"ob":Dd,"pb":Cd,"qb":Bd,"rb":Ad,"sb":zd,"tb":yd,"ub":xd,"vb":wd,"wb":vd,"xb":ud,"yb":td,"zb":sd,"Ab":Pa,"Bb":rd,"Cb":Kb,"Db":qd,"Eb":pd,"Fb":Va,"Gb":Ua,"Hb":od,"Ib":nd,"Jb":md,"Kb":pb,"Lb":ld,"Mb":Pa,"Nb":kd,"Ob":jd,"Pb":id,"Qb":hd,"Rb":Pa,"Sb":gd,"Tb":fd,"Ub":ed,"Vb":ad,"Wb":$c,"Xb":_c,"Yb":Zc,"Zb":Yc}}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 Number(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);b="Aborted("+b+")";oa(b);Ca=!0;b=new ua(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?Va(d)():Va(d)(c.bc):d(void 0===c.bc?null:c.bc)}}}var Wa=[];function Va(b){var c=Wa[b];c||(b>=Wa.length&&(Wa.length=b+1),Wa[b]=c=Ja.get(b));return c}
var na=!1,Xa="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=Xa(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_get_library_version=function(){return(a._olm_get_library_version=a.asm.f).apply(null,arguments)};a._olm_error=function(){return(a._olm_error=a.asm.g).apply(null,arguments)};a._olm_account_last_error=function(){return(a._olm_account_last_error=a.asm.h).apply(null,arguments)};a.__olm_error_to_string=function(){return(a.__olm_error_to_string=a.asm.i).apply(null,arguments)};
a._olm_account_last_error_code=function(){return(a._olm_account_last_error_code=a.asm.j).apply(null,arguments)};a._olm_session_last_error=function(){return(a._olm_session_last_error=a.asm.k).apply(null,arguments)};a._olm_session_last_error_code=function(){return(a._olm_session_last_error_code=a.asm.l).apply(null,arguments)};a._olm_utility_last_error=function(){return(a._olm_utility_last_error=a.asm.m).apply(null,arguments)};
a._olm_utility_last_error_code=function(){return(a._olm_utility_last_error_code=a.asm.n).apply(null,arguments)};a._olm_account_size=function(){return(a._olm_account_size=a.asm.o).apply(null,arguments)};a._olm_session_size=function(){return(a._olm_session_size=a.asm.p).apply(null,arguments)};a._olm_utility_size=function(){return(a._olm_utility_size=a.asm.q).apply(null,arguments)};a._olm_account=function(){return(a._olm_account=a.asm.r).apply(null,arguments)};
a._olm_session=function(){return(a._olm_session=a.asm.s).apply(null,arguments)};a._olm_utility=function(){return(a._olm_utility=a.asm.t).apply(null,arguments)};a._olm_clear_account=function(){return(a._olm_clear_account=a.asm.u).apply(null,arguments)};a._olm_clear_session=function(){return(a._olm_clear_session=a.asm.v).apply(null,arguments)};a._olm_clear_utility=function(){return(a._olm_clear_utility=a.asm.w).apply(null,arguments)};
a._olm_pickle_account_length=function(){return(a._olm_pickle_account_length=a.asm.x).apply(null,arguments)};a._olm_pickle_session_length=function(){return(a._olm_pickle_session_length=a.asm.y).apply(null,arguments)};a._olm_pickle_account=function(){return(a._olm_pickle_account=a.asm.z).apply(null,arguments)};a._olm_pickle_session=function(){return(a._olm_pickle_session=a.asm.A).apply(null,arguments)};a._olm_unpickle_account=function(){return(a._olm_unpickle_account=a.asm.B).apply(null,arguments)};
a._olm_unpickle_session=function(){return(a._olm_unpickle_session=a.asm.C).apply(null,arguments)};a._olm_create_account_random_length=function(){return(a._olm_create_account_random_length=a.asm.D).apply(null,arguments)};a._olm_create_account=function(){return(a._olm_create_account=a.asm.E).apply(null,arguments)};a._olm_account_identity_keys_length=function(){return(a._olm_account_identity_keys_length=a.asm.F).apply(null,arguments)};
a._olm_account_identity_keys=function(){return(a._olm_account_identity_keys=a.asm.G).apply(null,arguments)};a._olm_account_signature_length=function(){return(a._olm_account_signature_length=a.asm.H).apply(null,arguments)};a._olm_account_sign=function(){return(a._olm_account_sign=a.asm.I).apply(null,arguments)};a._olm_account_one_time_keys_length=function(){return(a._olm_account_one_time_keys_length=a.asm.J).apply(null,arguments)};
a._olm_account_one_time_keys=function(){return(a._olm_account_one_time_keys=a.asm.K).apply(null,arguments)};a._olm_account_mark_keys_as_published=function(){return(a._olm_account_mark_keys_as_published=a.asm.L).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.M).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.N).apply(null,arguments)};a._olm_account_generate_one_time_keys=function(){return(a._olm_account_generate_one_time_keys=a.asm.O).apply(null,arguments)};a._olm_account_generate_fallback_key_random_length=function(){return(a._olm_account_generate_fallback_key_random_length=a.asm.P).apply(null,arguments)};
a._olm_account_generate_fallback_key=function(){return(a._olm_account_generate_fallback_key=a.asm.Q).apply(null,arguments)};a._olm_account_fallback_key_length=function(){return(a._olm_account_fallback_key_length=a.asm.R).apply(null,arguments)};a._olm_account_fallback_key=function(){return(a._olm_account_fallback_key=a.asm.S).apply(null,arguments)};a._olm_account_unpublished_fallback_key_length=function(){return(a._olm_account_unpublished_fallback_key_length=a.asm.T).apply(null,arguments)};
a._olm_account_unpublished_fallback_key=function(){return(a._olm_account_unpublished_fallback_key=a.asm.U).apply(null,arguments)};a._olm_account_forget_old_fallback_key=function(){return(a._olm_account_forget_old_fallback_key=a.asm.V).apply(null,arguments)};a._olm_create_outbound_session_random_length=function(){return(a._olm_create_outbound_session_random_length=a.asm.W).apply(null,arguments)};a._olm_create_outbound_session=function(){return(a._olm_create_outbound_session=a.asm.X).apply(null,arguments)};
a._olm_create_inbound_session=function(){return(a._olm_create_inbound_session=a.asm.Y).apply(null,arguments)};a._olm_create_inbound_session_from=function(){return(a._olm_create_inbound_session_from=a.asm.Z).apply(null,arguments)};a._olm_session_id_length=function(){return(a._olm_session_id_length=a.asm._).apply(null,arguments)};a._olm_session_id=function(){return(a._olm_session_id=a.asm.$).apply(null,arguments)};
a._olm_session_has_received_message=function(){return(a._olm_session_has_received_message=a.asm.aa).apply(null,arguments)};a._olm_session_describe=function(){return(a._olm_session_describe=a.asm.ba).apply(null,arguments)};a._olm_matches_inbound_session=function(){return(a._olm_matches_inbound_session=a.asm.ca).apply(null,arguments)};a._olm_matches_inbound_session_from=function(){return(a._olm_matches_inbound_session_from=a.asm.da).apply(null,arguments)};
a._olm_remove_one_time_keys=function(){return(a._olm_remove_one_time_keys=a.asm.ea).apply(null,arguments)};a._olm_encrypt_message_type=function(){return(a._olm_encrypt_message_type=a.asm.fa).apply(null,arguments)};a._olm_encrypt_random_length=function(){return(a._olm_encrypt_random_length=a.asm.ga).apply(null,arguments)};a._olm_encrypt_message_length=function(){return(a._olm_encrypt_message_length=a.asm.ha).apply(null,arguments)};
a._olm_encrypt=function(){return(a._olm_encrypt=a.asm.ia).apply(null,arguments)};a._olm_decrypt_max_plaintext_length=function(){return(a._olm_decrypt_max_plaintext_length=a.asm.ja).apply(null,arguments)};a._olm_decrypt=function(){return(a._olm_decrypt=a.asm.ka).apply(null,arguments)};a._olm_sha256_length=function(){return(a._olm_sha256_length=a.asm.la).apply(null,arguments)};a._olm_sha256=function(){return(a._olm_sha256=a.asm.ma).apply(null,arguments)};
a._olm_ed25519_verify=function(){return(a._olm_ed25519_verify=a.asm.na).apply(null,arguments)};a._olm_pk_encryption_last_error=function(){return(a._olm_pk_encryption_last_error=a.asm.oa).apply(null,arguments)};a._olm_pk_encryption_last_error_code=function(){return(a._olm_pk_encryption_last_error_code=a.asm.pa).apply(null,arguments)};a._olm_pk_encryption_size=function(){return(a._olm_pk_encryption_size=a.asm.qa).apply(null,arguments)};
a._olm_pk_encryption=function(){return(a._olm_pk_encryption=a.asm.ra).apply(null,arguments)};a._olm_clear_pk_encryption=function(){return(a._olm_clear_pk_encryption=a.asm.sa).apply(null,arguments)};a._olm_pk_encryption_set_recipient_key=function(){return(a._olm_pk_encryption_set_recipient_key=a.asm.ta).apply(null,arguments)};a._olm_pk_key_length=function(){return(a._olm_pk_key_length=a.asm.ua).apply(null,arguments)};
a._olm_pk_ciphertext_length=function(){return(a._olm_pk_ciphertext_length=a.asm.va).apply(null,arguments)};a._olm_pk_mac_length=function(){return(a._olm_pk_mac_length=a.asm.wa).apply(null,arguments)};a._olm_pk_encrypt_random_length=function(){return(a._olm_pk_encrypt_random_length=a.asm.xa).apply(null,arguments)};a._olm_pk_encrypt=function(){return(a._olm_pk_encrypt=a.asm.ya).apply(null,arguments)};
a._olm_pk_decryption_last_error=function(){return(a._olm_pk_decryption_last_error=a.asm.za).apply(null,arguments)};a._olm_pk_decryption_last_error_code=function(){return(a._olm_pk_decryption_last_error_code=a.asm.Aa).apply(null,arguments)};a._olm_pk_decryption_size=function(){return(a._olm_pk_decryption_size=a.asm.Ba).apply(null,arguments)};a._olm_pk_decryption=function(){return(a._olm_pk_decryption=a.asm.Ca).apply(null,arguments)};
a._olm_clear_pk_decryption=function(){return(a._olm_clear_pk_decryption=a.asm.Da).apply(null,arguments)};a._olm_pk_private_key_length=function(){return(a._olm_pk_private_key_length=a.asm.Ea).apply(null,arguments)};a._olm_pk_generate_key_random_length=function(){return(a._olm_pk_generate_key_random_length=a.asm.Fa).apply(null,arguments)};a._olm_pk_key_from_private=function(){return(a._olm_pk_key_from_private=a.asm.Ga).apply(null,arguments)};
a._olm_pk_generate_key=function(){return(a._olm_pk_generate_key=a.asm.Ha).apply(null,arguments)};a._olm_pickle_pk_decryption_length=function(){return(a._olm_pickle_pk_decryption_length=a.asm.Ia).apply(null,arguments)};a._olm_pickle_pk_decryption=function(){return(a._olm_pickle_pk_decryption=a.asm.Ja).apply(null,arguments)};a._olm_unpickle_pk_decryption=function(){return(a._olm_unpickle_pk_decryption=a.asm.Ka).apply(null,arguments)};
a._olm_pk_max_plaintext_length=function(){return(a._olm_pk_max_plaintext_length=a.asm.La).apply(null,arguments)};a._olm_pk_decrypt=function(){return(a._olm_pk_decrypt=a.asm.Ma).apply(null,arguments)};a._olm_pk_get_private_key=function(){return(a._olm_pk_get_private_key=a.asm.Na).apply(null,arguments)};a._olm_pk_signing_size=function(){return(a._olm_pk_signing_size=a.asm.Oa).apply(null,arguments)};a._olm_pk_signing=function(){return(a._olm_pk_signing=a.asm.Pa).apply(null,arguments)};
a._olm_pk_signing_last_error=function(){return(a._olm_pk_signing_last_error=a.asm.Qa).apply(null,arguments)};a._olm_pk_signing_last_error_code=function(){return(a._olm_pk_signing_last_error_code=a.asm.Ra).apply(null,arguments)};a._olm_clear_pk_signing=function(){return(a._olm_clear_pk_signing=a.asm.Sa).apply(null,arguments)};a._olm_pk_signing_seed_length=function(){return(a._olm_pk_signing_seed_length=a.asm.Ta).apply(null,arguments)};
a._olm_pk_signing_public_key_length=function(){return(a._olm_pk_signing_public_key_length=a.asm.Ua).apply(null,arguments)};a._olm_pk_signing_key_from_seed=function(){return(a._olm_pk_signing_key_from_seed=a.asm.Va).apply(null,arguments)};a._olm_pk_signature_length=function(){return(a._olm_pk_signature_length=a.asm.Wa).apply(null,arguments)};a._olm_pk_sign=function(){return(a._olm_pk_sign=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_outbound_group_session_size=function(){return(a._olm_outbound_group_session_size=a.asm.ob).apply(null,arguments)};a._olm_outbound_group_session=function(){return(a._olm_outbound_group_session=a.asm.pb).apply(null,arguments)};a._olm_clear_outbound_group_session=function(){return(a._olm_clear_outbound_group_session=a.asm.qb).apply(null,arguments)};
a._olm_outbound_group_session_last_error=function(){return(a._olm_outbound_group_session_last_error=a.asm.rb).apply(null,arguments)};a._olm_outbound_group_session_last_error_code=function(){return(a._olm_outbound_group_session_last_error_code=a.asm.sb).apply(null,arguments)};a._olm_pickle_outbound_group_session_length=function(){return(a._olm_pickle_outbound_group_session_length=a.asm.tb).apply(null,arguments)};
a._olm_pickle_outbound_group_session=function(){return(a._olm_pickle_outbound_group_session=a.asm.ub).apply(null,arguments)};a._olm_unpickle_outbound_group_session=function(){return(a._olm_unpickle_outbound_group_session=a.asm.vb).apply(null,arguments)};a._olm_init_outbound_group_session_random_length=function(){return(a._olm_init_outbound_group_session_random_length=a.asm.wb).apply(null,arguments)};
a._olm_init_outbound_group_session=function(){return(a._olm_init_outbound_group_session=a.asm.xb).apply(null,arguments)};a._olm_group_encrypt_message_length=function(){return(a._olm_group_encrypt_message_length=a.asm.yb).apply(null,arguments)};a._olm_group_encrypt=function(){return(a._olm_group_encrypt=a.asm.zb).apply(null,arguments)};a._olm_outbound_group_session_id_length=function(){return(a._olm_outbound_group_session_id_length=a.asm.Ab).apply(null,arguments)};
a._olm_outbound_group_session_id=function(){return(a._olm_outbound_group_session_id=a.asm.Bb).apply(null,arguments)};a._olm_outbound_group_session_message_index=function(){return(a._olm_outbound_group_session_message_index=a.asm.Cb).apply(null,arguments)};a._olm_outbound_group_session_key_length=function(){return(a._olm_outbound_group_session_key_length=a.asm.Db).apply(null,arguments)};a._olm_outbound_group_session_key=function(){return(a._olm_outbound_group_session_key=a.asm.Eb).apply(null,arguments)};
a._olm_sas_last_error=function(){return(a._olm_sas_last_error=a.asm.Fb).apply(null,arguments)};a._olm_sas_last_error_code=function(){return(a._olm_sas_last_error_code=a.asm.Gb).apply(null,arguments)};a._olm_sas_size=function(){return(a._olm_sas_size=a.asm.Hb).apply(null,arguments)};a._olm_sas=function(){return(a._olm_sas=a.asm.Ib).apply(null,arguments)};a._olm_clear_sas=function(){return(a._olm_clear_sas=a.asm.Jb).apply(null,arguments)};
a._olm_create_sas_random_length=function(){return(a._olm_create_sas_random_length=a.asm.Kb).apply(null,arguments)};a._olm_create_sas=function(){return(a._olm_create_sas=a.asm.Lb).apply(null,arguments)};a._olm_sas_pubkey_length=function(){return(a._olm_sas_pubkey_length=a.asm.Mb).apply(null,arguments)};a._olm_sas_get_pubkey=function(){return(a._olm_sas_get_pubkey=a.asm.Nb).apply(null,arguments)};a._olm_sas_set_their_key=function(){return(a._olm_sas_set_their_key=a.asm.Ob).apply(null,arguments)};
a._olm_sas_is_their_key_set=function(){return(a._olm_sas_is_their_key_set=a.asm.Pb).apply(null,arguments)};a._olm_sas_generate_bytes=function(){return(a._olm_sas_generate_bytes=a.asm.Qb).apply(null,arguments)};a._olm_sas_mac_length=function(){return(a._olm_sas_mac_length=a.asm.Rb).apply(null,arguments)};a._olm_sas_calculate_mac_fixed_base64=function(){return(a._olm_sas_calculate_mac_fixed_base64=a.asm.Sb).apply(null,arguments)};
a._olm_sas_calculate_mac=function(){return(a._olm_sas_calculate_mac=a.asm.Tb).apply(null,arguments)};a._olm_sas_calculate_mac_long_kdf=function(){return(a._olm_sas_calculate_mac_long_kdf=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 Ya=a.stackSave=function(){return(Ya=a.stackSave=a.asm.Xb).apply(null,arguments)},Za=a.stackRestore=function(){return(Za=a.stackRestore=a.asm.Yb).apply(null,arguments)},$a=a.stackAlloc=function(){return($a=a.stackAlloc=a.asm.Zb).apply(null,arguments)};a.ALLOC_STACK=1;var ab;Pa=function bb(){ab||cb();ab||(Pa=bb)};
function cb(){function b(){if(!ab&&(ab=!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=cb;
if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();cb();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);H(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),H(e)),void 0!==f&&H(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);H(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&&H(c),void 0!==e&&(M(e,k),H(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 db(){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}}db.prototype.free=function(){a._olm_clear_pk_encryption(this.$b);H(this.$b)};db.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)});
db.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)(),I=L(T+1);w(I+T);Q(a._olm_pk_encrypt)(this.$b,d,c,p,k,ja,v,I,T,f,e);w(p+k);return{ciphertext:z(p,k),mac:z(ja,v),ephemeral:z(I,T)}}finally{void 0!==f&&M(f,e),void 0!==d&&(M(d,c+1),H(d)),void 0!==p&&H(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);H(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 I=F(T+1);var Ha=S(a._olm_pk_decrypt)(this.$b,p,k.length,ja,v.length,f,e,I,T);w(I+Ha);return z(I,Ha)}finally{void 0!==I&&(M(I,Ha+1),H(I)),void 0!==f&&H(f)}});function eb(){var b=a._olm_pk_signing_size();this.ac=F(b);this.$b=a._olm_pk_signing(this.ac)}
function fb(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}}eb.prototype.free=function(){a._olm_clear_pk_signing(this.$b);H(this.$b)};eb.prototype.init_with_seed=J(function(b){var c=L(b.length);a.HEAPU8.set(b,c);var d=fb(a._olm_pk_signing_public_key_length)(),e=L(d+1);try{fb(a._olm_pk_signing_key_from_seed)(this.$b,e,d,c,b.length)}finally{M(c,b.length)}return z(e,d)});
eb.prototype.generate_seed=J(function(){var b=fb(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});eb.prototype.sign=J(function(b){try{var c=Fa(b);var d=F(c+1);Ea(b,A,d,c+1);var e=fb(a._olm_pk_signature_length)(),f=L(e+1);fb(a._olm_pk_sign)(this.$b,d,c,f,e);return z(f,e)}finally{void 0!==d&&(M(d,c+1),H(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);H(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_fixed_base64=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_fixed_base64)(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,H=a._free,h;
function N(b,c){var d=$a(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=Ya();try{return b.apply(this,arguments)}finally{Za(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);H(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);H(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),H(p)),void 0!==v&&H(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&&H(d),void 0!==f&&(M(f,e),H(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&&H(b)}});function gb(){var b=a._olm_utility_size();this.ac=F(b);this.$b=a._olm_utility(this.ac)}
function hb(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}}gb.prototype.free=function(){a._olm_clear_utility(this.$b);H(this.$b)};gb.prototype.sha256=J(function(b){var c=hb(a._olm_sha256_length)(this.$b);b=K(b);var d=L(b),e=L(c+1);try{hb(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)});
gb.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{hb(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=gb;olm_exports.PkEncryption=db;olm_exports.PkDecryption=R;olm_exports.PkSigning=eb;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