clvm_tools
Version:
Javascript implementation of clvm_tools
1 lines • 156 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.clvm_tools=e():t.clvm_tools=e()}(this,(function(){return t={2513:function(t,e,n){var r,o=(r=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){var e,o,i;t=t||{},e||(e=void 0!==t?t:{}),e.ready=new Promise((function(t,e){o=t,i=e}));var s,a={};for(s in e)e.hasOwnProperty(s)&&(a[s]=e[s]);var u,c,f,l,p="./this.program";u="object"==typeof window,c="function"==typeof importScripts,f="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,l=!u&&!f&&!c;var _,h,d,m,y,g="";f?(g=c?n(7091).dirname(g)+"/":"//",_=function(t,e){return m||(m=n(4130)),y||(y=n(7091)),t=y.normalize(t),m.readFileSync(t,e?null:"utf8")},d=function(t){return(t=_(t,!0)).buffer||(t=new Uint8Array(t)),T(t.buffer),t},1<process.argv.length&&(p=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",(function(t){throw t})),process.on("unhandledRejection",J),e.inspect=function(){return"[Emscripten Module object]"}):l?("undefined"!=typeof read&&(_=function(t){return read(t)}),d=function(t){return"function"==typeof readbuffer?new Uint8Array(readbuffer(t)):(T("object"==typeof(t=read(t,"binary"))),t)},"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(u||c)&&(c?g=self.location.href:"undefined"!=typeof document&&document.currentScript&&(g=document.currentScript.src),r&&(g=r),g=0!==g.indexOf("blob:")?g.substr(0,g.lastIndexOf("/")+1):"",_=function(t){var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},c&&(d=function(t){var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),h=function(t,e,n){var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=function(){200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)});var w,E=e.print||console.log.bind(console),b=e.printErr||console.warn.bind(console);for(s in a)a.hasOwnProperty(s)&&(e[s]=a[s]);a=null,e.thisProgram&&(p=e.thisProgram),e.wasmBinary&&(w=e.wasmBinary),e.noExitRuntime,"object"!=typeof WebAssembly&&J("no native wasm support detected");var v,O=!1;function T(t,e){t||J("Assertion failed: "+e)}var S="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function A(t,e,n){var r=e+n;for(n=e;t[n]&&!(n>=r);)++n;if(16<n-e&&t.subarray&&S)return S.decode(t.subarray(e,n));for(r="";e<n;){var o=t[e++];if(128&o){var i=63&t[e++];if(192==(224&o))r+=String.fromCharCode((31&o)<<6|i);else{var s=63&t[e++];65536>(o=224==(240&o)?(15&o)<<12|i<<6|s:(7&o)<<18|i<<12|s<<6|63&t[e++])?r+=String.fromCharCode(o):(o-=65536,r+=String.fromCharCode(55296|o>>10,56320|1023&o))}}else r+=String.fromCharCode(o)}return r}function x(t,e,n,r){if(!(0<r))return 0;var o=n;r=n+r-1;for(var i=0;i<t.length;++i){var s=t.charCodeAt(i);if(55296<=s&&57343>=s&&(s=65536+((1023&s)<<10)|1023&t.charCodeAt(++i)),127>=s){if(n>=r)break;e[n++]=s}else{if(2047>=s){if(n+1>=r)break;e[n++]=192|s>>6}else{if(65535>=s){if(n+2>=r)break;e[n++]=224|s>>12}else{if(n+3>=r)break;e[n++]=240|s>>18,e[n++]=128|s>>12&63}e[n++]=128|s>>6&63}e[n++]=128|63&s}}return e[n]=0,n-o}function P(t){for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);55296<=r&&57343>=r&&(r=65536+((1023&r)<<10)|1023&t.charCodeAt(++n)),127>=r?++e:e=2047>=r?e+2:65535>=r?e+3:e+4}return e}var C="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function R(t,e){for(var n=t>>1,r=n+e/2;!(n>=r)&&D[n];)++n;if(32<(n<<=1)-t&&C)return C.decode(k.subarray(t,n));for(n="",r=0;!(r>=e/2);++r){var o=q[t+2*r>>1];if(0==o)break;n+=String.fromCharCode(o)}return n}function B(t,e,n){if(void 0===n&&(n=2147483647),2>n)return 0;var r=e;n=(n-=2)<2*t.length?n/2:t.length;for(var o=0;o<n;++o)q[e>>1]=t.charCodeAt(o),e+=2;return q[e>>1]=0,e-r}function I(t){return 2*t.length}function N(t,e){for(var n=0,r="";!(n>=e/4);){var o=F[t+4*n>>2];if(0==o)break;++n,65536<=o?(o-=65536,r+=String.fromCharCode(55296|o>>10,56320|1023&o)):r+=String.fromCharCode(o)}return r}function M(t,e,n){if(void 0===n&&(n=2147483647),4>n)return 0;var r=e;n=r+n-4;for(var o=0;o<t.length;++o){var i=t.charCodeAt(o);if(55296<=i&&57343>=i&&(i=65536+((1023&i)<<10)|1023&t.charCodeAt(++o)),F[e>>2]=i,(e+=4)+4>n)break}return F[e>>2]=0,e-r}function L(t){for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);55296<=r&&57343>=r&&++n,e+=4}return e}var U,j,k,q,D,F,Y,W,$,H,G=[],z=[],V=[];function X(){var t=e.preRun.shift();G.unshift(t)}var Q=0,Z=null,K=null;function J(t){throw e.onAbort&&e.onAbort(t),b(t),O=!0,t=new WebAssembly.RuntimeError("abort("+t+"). Build with -s ASSERTIONS=1 for more info."),i(t),t}function tt(){return et.startsWith("data:application/octet-stream;base64,")}e.preloadedImages={},e.preloadedAudios={};var et="blsjs.wasm";if(!tt()){var nt=et;et=e.locateFile?e.locateFile(nt,g):g+nt}function rt(){var t=et;try{if(t==et&&w)return new Uint8Array(w);if(d)return d(t);throw"both async and sync fetching of the wasm failed"}catch(t){J(t)}}var ot={765704:function(){return e.Ia()},765740:function(){if(void 0===e.Ia)try{var t="object"==typeof window?window:self,r=void 0!==t.crypto?t.crypto:t.msCrypto;(t=function(){var t=new Uint32Array(1);return r.getRandomValues(t),t[0]>>>0})(),e.Ia=t}catch(r){try{var o=n(4135);(t=function(){var t=o.randomBytes(4);return(t[0]<<24|t[1]<<16|t[2]<<8|t[3])>>>0})(),e.Ia=t}catch(t){throw"No secure random number generator found"}}}};function it(t){for(;0<t.length;){var n=t.shift();if("function"==typeof n)n(e);else{var r=n.Bb;"number"==typeof r?void 0===n.Ha?H.get(r)():H.get(r)(n.Ha):r(void 0===n.Ha?null:n.Ha)}}}function st(t){this.Z=t-16,this.ub=function(t){F[this.Z+8>>2]=t},this.rb=function(t){F[this.Z+0>>2]=t},this.sb=function(){F[this.Z+4>>2]=0},this.qb=function(){j[this.Z+12>>0]=0},this.tb=function(){j[this.Z+13>>0]=0},this.gb=function(t,e){this.ub(t),this.rb(e),this.sb(),this.qb(),this.tb()}}function at(t,e){for(var n=0,r=t.length-1;0<=r;r--){var o=t[r];"."===o?t.splice(r,1):".."===o?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n;n--)t.unshift("..");return t}function ut(t){var e="/"===t.charAt(0),n="/"===t.substr(-1);return(t=at(t.split("/").filter((function(t){return!!t})),!e).join("/"))||e||(t="."),t&&n&&(t+="/"),(e?"/":"")+t}function ct(t){var e=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1);return t=e[0],e=e[1],t||e?(e&&(e=e.substr(0,e.length-1)),t+e):"."}function ft(t){if("/"===t)return"/";var e=(t=(t=ut(t)).replace(/\/$/,"")).lastIndexOf("/");return-1===e?t:t.substr(e+1)}function lt(){for(var t="",e=!1,n=arguments.length-1;-1<=n&&!e;n--){if("string"!=typeof(e=0<=n?arguments[n]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!e)return"";t=e+"/"+t,e="/"===e.charAt(0)}return(e?"/":"")+(t=at(t.split("/").filter((function(t){return!!t})),!e).join("/"))||"."}var pt=[];function _t(t,e){pt[t]={input:[],output:[],ta:e},Ut(t,ht)}var ht={open:function(t){var e=pt[t.node.rdev];if(!e)throw new Tt(43);t.tty=e,t.seekable=!1},close:function(t){t.tty.ta.flush(t.tty)},flush:function(t){t.tty.ta.flush(t.tty)},read:function(t,e,n,r){if(!t.tty||!t.tty.ta.Ta)throw new Tt(60);for(var o=0,i=0;i<r;i++){try{var s=t.tty.ta.Ta(t.tty)}catch(t){throw new Tt(29)}if(void 0===s&&0===o)throw new Tt(6);if(null==s)break;o++,e[n+i]=s}return o&&(t.node.timestamp=Date.now()),o},write:function(t,e,n,r){if(!t.tty||!t.tty.ta.Ka)throw new Tt(60);try{for(var o=0;o<r;o++)t.tty.ta.Ka(t.tty,e[n+o])}catch(t){throw new Tt(29)}return r&&(t.node.timestamp=Date.now()),o}},dt={Ta:function(t){if(!t.input.length){var e=null;if(f){var n=Buffer.Ya?Buffer.Ya(256):new Buffer(256),r=0;try{r=m.readSync(process.stdin.fd,n,0,256,null)}catch(t){if(!t.toString().includes("EOF"))throw t;r=0}e=0<r?n.slice(0,r).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n");if(!e)return null;t.input=dn(e,!0)}return t.input.shift()},Ka:function(t,e){null===e||10===e?(E(A(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},flush:function(t){t.output&&0<t.output.length&&(E(A(t.output,0)),t.output=[])}},mt={Ka:function(t,e){null===e||10===e?(b(A(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},flush:function(t){t.output&&0<t.output.length&&(b(A(t.output,0)),t.output=[])}},yt={ja:null,ma:function(){return yt.createNode(null,"/",16895,0)},createNode:function(t,e,n,r){if(24576==(61440&n)||4096==(61440&n))throw new Tt(63);return yt.ja||(yt.ja={dir:{node:{na:yt.Y.na,ka:yt.Y.ka,lookup:yt.Y.lookup,Ca:yt.Y.Ca,rename:yt.Y.rename,unlink:yt.Y.unlink,rmdir:yt.Y.rmdir,readdir:yt.Y.readdir,symlink:yt.Y.symlink},stream:{wa:yt.aa.wa}},file:{node:{na:yt.Y.na,ka:yt.Y.ka},stream:{wa:yt.aa.wa,read:yt.aa.read,write:yt.aa.write,Na:yt.aa.Na,Ua:yt.aa.Ua,Wa:yt.aa.Wa}},link:{node:{na:yt.Y.na,ka:yt.Y.ka,readlink:yt.Y.readlink},stream:{}},Oa:{node:{na:yt.Y.na,ka:yt.Y.ka},stream:Lt}}),16384==(61440&(n=Rt(t,e,n,r)).mode)?(n.Y=yt.ja.dir.node,n.aa=yt.ja.dir.stream,n.X={}):32768==(61440&n.mode)?(n.Y=yt.ja.file.node,n.aa=yt.ja.file.stream,n.ba=0,n.X=null):40960==(61440&n.mode)?(n.Y=yt.ja.link.node,n.aa=yt.ja.link.stream):8192==(61440&n.mode)&&(n.Y=yt.ja.Oa.node,n.aa=yt.ja.Oa.stream),n.timestamp=Date.now(),t&&(t.X[e]=n,t.timestamp=n.timestamp),n},Cb:function(t){return t.X?t.X.subarray?t.X.subarray(0,t.ba):new Uint8Array(t.X):new Uint8Array(0)},Qa:function(t,e){var n=t.X?t.X.length:0;n>=e||(e=Math.max(e,n*(1048576>n?2:1.125)>>>0),0!=n&&(e=Math.max(e,256)),n=t.X,t.X=new Uint8Array(e),0<t.ba&&t.X.set(n.subarray(0,t.ba),0))},ob:function(t,e){if(t.ba!=e)if(0==e)t.X=null,t.ba=0;else{var n=t.X;t.X=new Uint8Array(e),n&&t.X.set(n.subarray(0,Math.min(e,t.ba))),t.ba=e}},Y:{na:function(t){var e={};return e.dev=8192==(61440&t.mode)?t.id:1,e.ino=t.id,e.mode=t.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=t.rdev,16384==(61440&t.mode)?e.size=4096:32768==(61440&t.mode)?e.size=t.ba:40960==(61440&t.mode)?e.size=t.link.length:e.size=0,e.atime=new Date(t.timestamp),e.mtime=new Date(t.timestamp),e.ctime=new Date(t.timestamp),e.Za=4096,e.blocks=Math.ceil(e.size/e.Za),e},ka:function(t,e){void 0!==e.mode&&(t.mode=e.mode),void 0!==e.timestamp&&(t.timestamp=e.timestamp),void 0!==e.size&&yt.ob(t,e.size)},lookup:function(){throw St[44]},Ca:function(t,e,n,r){return yt.createNode(t,e,n,r)},rename:function(t,e,n){if(16384==(61440&t.mode)){try{var r=Ct(e,n)}catch(t){}if(r)for(var o in r.X)throw new Tt(55)}delete t.parent.X[t.name],t.parent.timestamp=Date.now(),t.name=n,e.X[n]=t,e.timestamp=t.parent.timestamp,t.parent=e},unlink:function(t,e){delete t.X[e],t.timestamp=Date.now()},rmdir:function(t,e){var n,r=Ct(t,e);for(n in r.X)throw new Tt(55);delete t.X[e],t.timestamp=Date.now()},readdir:function(t){var e,n=[".",".."];for(e in t.X)t.X.hasOwnProperty(e)&&n.push(e);return n},symlink:function(t,e,n){return(t=yt.createNode(t,e,41471,0)).link=n,t},readlink:function(t){if(40960!=(61440&t.mode))throw new Tt(28);return t.link}},aa:{read:function(t,e,n,r,o){var i=t.node.X;if(o>=t.node.ba)return 0;if(8<(t=Math.min(t.node.ba-o,r))&&i.subarray)e.set(i.subarray(o,o+t),n);else for(r=0;r<t;r++)e[n+r]=i[o+r];return t},write:function(t,e,n,r,o,i){if(!r)return 0;if((t=t.node).timestamp=Date.now(),e.subarray&&(!t.X||t.X.subarray)){if(i)return t.X=e.subarray(n,n+r),t.ba=r;if(0===t.ba&&0===o)return t.X=e.slice(n,n+r),t.ba=r;if(o+r<=t.ba)return t.X.set(e.subarray(n,n+r),o),r}if(yt.Qa(t,o+r),t.X.subarray&&e.subarray)t.X.set(e.subarray(n,n+r),o);else for(i=0;i<r;i++)t.X[o+i]=e[n+i];return t.ba=Math.max(t.ba,o+r),r},wa:function(t,e,n){if(1===n?e+=t.position:2===n&&32768==(61440&t.node.mode)&&(e+=t.node.ba),0>e)throw new Tt(28);return e},Na:function(t,e,n){yt.Qa(t.node,e+n),t.node.ba=Math.max(t.node.ba,e+n)},Ua:function(t,e,n,r,o,i){if(0!==e)throw new Tt(28);if(32768!=(61440&t.node.mode))throw new Tt(43);if(t=t.node.X,2&i||t.buffer!==U){for((0<r||r+n<t.length)&&(t=t.subarray?t.subarray(r,r+n):Array.prototype.slice.call(t,r,r+n)),r=!0,i=65536*Math.ceil(n/65536),e=gn(i);n<i;)j[e+n++]=0;if(!(n=e))throw new Tt(48);j.set(t,n)}else r=!1,n=t.byteOffset;return{Z:n,Ab:r}},Wa:function(t,e,n,r,o){if(32768!=(61440&t.node.mode))throw new Tt(43);return 2&o||yt.aa.write(t,e,0,r,n,!1),0}}},gt=null,wt={},Et=[],bt=1,vt=null,Ot={},Tt=null,St={};function At(t,e){if(e=e||{},!(t=lt("/",t)))return{path:"",node:null};var n,r={Sa:!0,La:0};for(n in r)void 0===e[n]&&(e[n]=r[n]);if(8<e.La)throw new Tt(32);t=at(t.split("/").filter((function(t){return!!t})),!1);var o=gt;for(r="/",n=0;n<t.length;n++){var i=n===t.length-1;if(i&&e.parent)break;if(o=Ct(o,t[n]),r=ut(r+"/"+t[n]),o.Da&&(!i||i&&e.Sa)&&(o=o.Da.root),!i||e.Ra)for(i=0;40960==(61440&o.mode);)if(o=Yt(r),o=At(r=lt(ct(r),o),{La:e.La}).node,40<i++)throw new Tt(32)}return{path:r,node:o}}function xt(t){for(var e;;){if(t===t.parent)return t=t.ma.Va,e?"/"!==t[t.length-1]?t+"/"+e:t+e:t;e=e?t.name+"/"+e:t.name,t=t.parent}}function Pt(t,e){for(var n=0,r=0;r<e.length;r++)n=(n<<5)-n+e.charCodeAt(r)|0;return(t+n>>>0)%vt.length}function Ct(t,e){var n;if(n=t.Y.lookup?0:2)throw new Tt(n,t);for(n=vt[Pt(t.id,e)];n;n=n.jb){var r=n.name;if(n.parent.id===t.id&&r===e)return n}return t.Y.lookup(t,e)}function Rt(t,e,n,r){return e=Pt((t=new pn(t,e,n,r)).parent.id,t.name),t.jb=vt[e],vt[e]=t}var Bt={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090};function It(t,e){try{return Ct(t,e),20}catch(t){}return 0}function Nt(t){zt||((zt=function(){}).prototype={});var e,n=new zt;for(e in t)n[e]=t[e];return t=n,n=function(){for(var t=0;t<=4096;t++)if(!Et[t])return t;throw new Tt(33)}(),t.fd=n,Et[n]=t}var Mt,Lt={open:function(t){t.aa=wt[t.node.rdev].aa,t.aa.open&&t.aa.open(t)},wa:function(){throw new Tt(70)}};function Ut(t,e){wt[t]={aa:e}}function jt(t,e){var n="/"===e,r=!e;if(n&>)throw new Tt(10);if(!n&&!r){var o=At(e,{Sa:!1});if(e=o.path,(o=o.node).Da)throw new Tt(10);if(16384!=(61440&o.mode))throw new Tt(54)}e={type:t,Db:{},Va:e,ib:[]},(t=t.ma(e)).ma=e,e.root=t,n?gt=t:o&&(o.Da=e,o.ma&&o.ma.ib.push(e))}function kt(t,e,n){var r=At(t,{parent:!0}).node;if(!(t=ft(t))||"."===t||".."===t)throw new Tt(28);var o=It(r,t);if(o)throw new Tt(o);if(!r.Y.Ca)throw new Tt(63);return r.Y.Ca(r,t,e,n)}function qt(t){return kt(t,16895,0)}function Dt(t,e,n){void 0===n&&(n=e,e=438),kt(t,8192|e,n)}function Ft(t,e){if(!lt(t))throw new Tt(44);var n=At(e,{parent:!0}).node;if(!n)throw new Tt(44);var r=It(n,e=ft(e));if(r)throw new Tt(r);if(!n.Y.symlink)throw new Tt(63);n.Y.symlink(n,e,t)}function Yt(t){if(!(t=At(t).node))throw new Tt(44);if(!t.Y.readlink)throw new Tt(28);return lt(xt(t.parent),t.Y.readlink(t))}function Wt(t,n,r){if(""===t)throw new Tt(44);if("string"==typeof n){var o=Bt[n];if(void 0===o)throw Error("Unknown file open mode: "+n);n=o}if(r=64&n?4095&(void 0===r?438:r)|32768:0,"object"==typeof t)var i=t;else{t=ut(t);try{i=At(t,{Ra:!(131072&n)}).node}catch(t){}}if(o=!1,64&n)if(i){if(128&n)throw new Tt(20)}else i=kt(t,r,0),o=!0;if(!i)throw new Tt(44);if(8192==(61440&i.mode)&&(n&=-513),65536&n&&16384!=(61440&i.mode))throw new Tt(54);if(!o&&(i?40960==(61440&i.mode)?r=32:((r=16384==(61440&i.mode))&&(r=["r","w","rw"][3&n],512&n&&(r+="w"),r="r"!==r||512&n),r=r?31:0):r=44,r))throw new Tt(r);if(512&n){if(!(r="string"==typeof(r=i)?At(r,{Ra:!0}).node:r).Y.ka)throw new Tt(63);if(16384==(61440&r.mode))throw new Tt(31);if(32768!=(61440&r.mode))throw new Tt(28);r.Y.ka(r,{size:0,timestamp:Date.now()})}n&=-131713,(i=Nt({node:i,path:xt(i),flags:n,seekable:!0,position:0,aa:i.aa,Fb:[],error:!1})).aa.open&&i.aa.open(i),!e.logReadFiles||1&n||(Vt||(Vt={}),t in Vt||(Vt[t]=1,b("FS.trackingDelegate error on read file: "+t)));try{Ot.onOpenFile&&(r=0,1!=(2097155&n)&&(r|=1),0!=(2097155&n)&&(r|=2),Ot.onOpenFile(t,r))}catch(e){b("FS.trackingDelegate['onOpenFile']('"+t+"', flags) threw an exception: "+e.message)}return i}function $t(){Tt||((Tt=function(t,e){this.node=e,this.pb=function(t){this.va=t},this.pb(t),this.message="FS error"}).prototype=Error(),Tt.prototype.constructor=Tt,[44].forEach((function(t){St[t]=new Tt(t),St[t].stack="<generic error, no stack>"})))}function Ht(t,e,n){t=ut("/dev/"+t);var r=function(t,e){var n=0;return t&&(n|=365),e&&(n|=146),n}(!!e,!!n);Gt||(Gt=64);var o=Gt++<<8|0;Ut(o,{open:function(t){t.seekable=!1},close:function(){n&&n.buffer&&n.buffer.length&&n(10)},read:function(t,n,r,o){for(var i=0,s=0;s<o;s++){try{var a=e()}catch(t){throw new Tt(29)}if(void 0===a&&0===i)throw new Tt(6);if(null==a)break;i++,n[r+s]=a}return i&&(t.node.timestamp=Date.now()),i},write:function(t,e,r,o){for(var i=0;i<o;i++)try{n(e[r+i])}catch(t){throw new Tt(29)}return o&&(t.node.timestamp=Date.now()),i}}),Dt(t,r,o)}var Gt,zt,Vt,Xt={},Qt=void 0;function Zt(t){if(!(t=Et[t]))throw new Tt(8);return t}function Kt(t){switch(t){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+t)}}var Jt=void 0;function te(t){for(var e="";k[t];)e+=Jt[k[t++]];return e}var ee={},ne={},re={};function oe(t){if(void 0===t)return"_unknown";var e=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=e&&57>=e?"_"+t:t}function ie(t,e){return t=oe(t),new Function("body","return function "+t+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(e)}function se(t){var e=Error,n=ie(t,(function(e){this.name=t,this.message=e,void 0!==(e=Error(e).stack)&&(this.stack=this.toString()+"\n"+e.replace(/^Error(:[^\n]*)?\n/,""))}));return n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},n}var ae=void 0;function ue(t){throw new ae(t)}var ce=void 0;function fe(t){throw new ce(t)}function le(t,e,n){function r(e){(e=n(e)).length!==t.length&&fe("Mismatched type converter count");for(var r=0;r<t.length;++r)pe(t[r],e[r])}t.forEach((function(t){re[t]=e}));var o=Array(e.length),i=[],s=0;e.forEach((function(t,e){ne.hasOwnProperty(t)?o[e]=ne[t]:(i.push(t),ee.hasOwnProperty(t)||(ee[t]=[]),ee[t].push((function(){o[e]=ne[t],++s===i.length&&r(o)})))})),0===i.length&&r(o)}function pe(t,e,n){if(n=n||{},!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");var r=e.name;if(t||ue('type "'+r+'" must have a positive integer typeid pointer'),ne.hasOwnProperty(t)){if(n.fb)return;ue("Cannot register type '"+r+"' twice")}ne[t]=e,delete re[t],ee.hasOwnProperty(t)&&(e=ee[t],delete ee[t],e.forEach((function(t){t()})))}function _e(t){ue(t.W.da.$.name+" instance already deleted")}var he=!1;function de(){}function me(t){--t.count.value,0===t.count.value&&(t.ga?t.ha.pa(t.ga):t.da.$.pa(t.Z))}function ye(t){return"undefined"==typeof FinalizationGroup?(ye=function(t){return t},t):(he=new FinalizationGroup((function(t){for(var e=t.next();!e.done;e=t.next())(e=e.value).Z?me(e):console.warn("object already deleted: "+e.Z)})),de=function(t){he.unregister(t.W)},(ye=function(t){return he.register(t,t.W,t.W),t})(t))}var ge=void 0,we=[];function Ee(){for(;we.length;){var t=we.pop();t.W.ra=!1,t.delete()}}function be(){}var ve={};function Oe(t,e,n){if(void 0===t[e].ea){var r=t[e];t[e]=function(){return t[e].ea.hasOwnProperty(arguments.length)||ue("Function '"+n+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+t[e].ea+")!"),t[e].ea[arguments.length].apply(this,arguments)},t[e].ea=[],t[e].ea[r.qa]=r}}function Te(t,e,n,r,o,i,s,a){this.name=t,this.constructor=e,this.sa=n,this.pa=r,this.ia=o,this.bb=i,this.za=s,this.ab=a,this.lb=[]}function Se(t,e,n){for(;e!==n;)e.za||ue("Expected null or instance of "+n.name+", got an instance of "+e.name),t=e.za(t),e=e.ia;return t}function Ae(t,e){return null===e?(this.Ja&&ue("null is not a valid "+this.name),0):(e.W||ue('Cannot pass "'+Ge(e)+'" as a '+this.name),e.W.Z||ue("Cannot pass deleted object as a pointer of type "+this.name),Se(e.W.Z,e.W.da.$,this.$))}function xe(t,e){if(null===e){if(this.Ja&&ue("null is not a valid "+this.name),this.Ba){var n=this.mb();return null!==t&&t.push(this.pa,n),n}return 0}if(e.W||ue('Cannot pass "'+Ge(e)+'" as a '+this.name),e.W.Z||ue("Cannot pass deleted object as a pointer of type "+this.name),!this.Aa&&e.W.da.Aa&&ue("Cannot convert argument of type "+(e.W.ha?e.W.ha.name:e.W.da.name)+" to parameter type "+this.name),n=Se(e.W.Z,e.W.da.$,this.$),this.Ba)switch(void 0===e.W.ga&&ue("Passing raw pointer to smart pointer is illegal"),this.vb){case 0:e.W.ha===this?n=e.W.ga:ue("Cannot convert argument of type "+(e.W.ha?e.W.ha.name:e.W.da.name)+" to parameter type "+this.name);break;case 1:n=e.W.ga;break;case 2:if(e.W.ha===this)n=e.W.ga;else{var r=e.clone();n=this.nb(n,He((function(){r.delete()}))),null!==t&&t.push(this.pa,n)}break;default:ue("Unsupporting sharing policy")}return n}function Pe(t,e){return null===e?(this.Ja&&ue("null is not a valid "+this.name),0):(e.W||ue('Cannot pass "'+Ge(e)+'" as a '+this.name),e.W.Z||ue("Cannot pass deleted object as a pointer of type "+this.name),e.W.da.Aa&&ue("Cannot convert argument of type "+e.W.da.name+" to parameter type "+this.name),Se(e.W.Z,e.W.da.$,this.$))}function Ce(t){return this.fromWireType(Y[t>>2])}function Re(t,e,n){return e===n?t:void 0===n.ia||null===(t=Re(t,e,n.ia))?null:n.ab(t)}var Be={};function Ie(t,e){return e.da&&e.Z||fe("makeClassHandle requires ptr and ptrType"),!!e.ha!=!!e.ga&&fe("Both smartPtrType and smartPtr must be specified"),e.count={value:1},ye(Object.create(t,{W:{value:e}}))}function Ne(t,e,n,r){this.name=t,this.$=e,this.Ja=n,this.Aa=r,this.Ba=!1,this.pa=this.nb=this.mb=this.Xa=this.vb=this.kb=void 0,void 0!==e.ia?this.toWireType=xe:(this.toWireType=r?Ae:Pe,this.la=null)}function Me(t,n){var r=(t=te(t)).includes("j")?function(t,n){var r=[];return function(){r.length=arguments.length;for(var o=0;o<arguments.length;o++)r[o]=arguments[o];return t.includes("j")?(o=e["dynCall_"+t],o=r&&r.length?o.apply(null,[n].concat(r)):o.call(null,n)):o=H.get(n).apply(null,r),o}}(t,n):H.get(n);return"function"!=typeof r&&ue("unknown function pointer with signature "+t+": "+n),r}var Le=void 0;function Ue(t){var e=te(t=En(t));return wn(t),e}function je(t,e){var n=[],r={};throw e.forEach((function t(e){r[e]||ne[e]||(re[e]?re[e].forEach(t):(n.push(e),r[e]=!0))})),new Le(t+": "+n.map(Ue).join([", "]))}function ke(t){var e=Function;if(!(e instanceof Function))throw new TypeError("new_ called with constructor type "+typeof e+" which is not a function");var n=ie(e.name||"unknownFunctionName",(function(){}));return n.prototype=e.prototype,n=new n,(t=e.apply(n,t))instanceof Object?t:n}function qe(t){for(;t.length;){var e=t.pop();t.pop()(e)}}function De(t,e,n,r,o){var i=e.length;2>i&&ue("argTypes array size mismatch! Must at least get return value and 'this' types!");var s=null!==e[1]&&null!==n,a=!1;for(n=1;n<e.length;++n)if(null!==e[n]&&void 0===e[n].la){a=!0;break}var u="void"!==e[0].name,c="",f="";for(n=0;n<i-2;++n)c+=(0!==n?", ":"")+"arg"+n,f+=(0!==n?", ":"")+"arg"+n+"Wired";t="return function "+oe(t)+"("+c+") {\nif (arguments.length !== "+(i-2)+") {\nthrowBindingError('function "+t+" called with ' + arguments.length + ' arguments, expected "+(i-2)+" args!');\n}\n",a&&(t+="var destructors = [];\n");var l=a?"destructors":"null";for(c="throwBindingError invoker fn runDestructors retType classParam".split(" "),r=[ue,r,o,qe,e[0],e[1]],s&&(t+="var thisWired = classParam.toWireType("+l+", this);\n"),n=0;n<i-2;++n)t+="var arg"+n+"Wired = argType"+n+".toWireType("+l+", arg"+n+"); // "+e[n+2].name+"\n",c.push("argType"+n),r.push(e[n+2]);if(s&&(f="thisWired"+(0<f.length?", ":"")+f),t+=(u?"var rv = ":"")+"invoker(fn"+(0<f.length?", ":"")+f+");\n",a)t+="runDestructors(destructors);\n";else for(n=s?1:2;n<e.length;++n)i=1===n?"thisWired":"arg"+(n-2)+"Wired",null!==e[n].la&&(t+=i+"_dtor("+i+"); // "+e[n].name+"\n",c.push(i+"_dtor"),r.push(e[n].la));return u&&(t+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),c.push(t+"}\n"),ke(c).apply(null,r)}function Fe(t,e){for(var n=[],r=0;r<t;r++)n.push(F[(e>>2)+r]);return n}var Ye=[],We=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function $e(t){4<t&&0==--We[t].Ma&&(We[t]=void 0,Ye.push(t))}function He(t){switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var e=Ye.length?Ye.pop():We.length;return We[e]={Ma:1,value:t},e}}function Ge(t){if(null===t)return"null";var e=typeof t;return"object"===e||"array"===e||"function"===e?t.toString():""+t}function ze(t,e){switch(e){case 2:return function(t){return this.fromWireType(W[t>>2])};case 3:return function(t){return this.fromWireType($[t>>3])};default:throw new TypeError("Unknown float type: "+t)}}function Ve(t,e,n){switch(e){case 0:return n?function(t){return j[t]}:function(t){return k[t]};case 1:return n?function(t){return q[t>>1]}:function(t){return D[t>>1]};case 2:return n?function(t){return F[t>>2]}:function(t){return Y[t>>2]};default:throw new TypeError("Unknown integer type: "+t)}}function Xe(t){return t||ue("Cannot use deleted val. handle = "+t),We[t].value}function Qe(t,e){var n=ne[t];return void 0===n&&ue(e+" has unknown type "+Ue(t)),n}var Ze={};function Ke(t){var e=Ze[t];return void 0===e?te(t):e}var Je=[];function tn(){return"object"==typeof globalThis?globalThis:Function("return this")()}var en,nn={},rn=[],on={};function sn(){if(!en){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:p||"./this.program"};for(t in on)e[t]=on[t];var n=[];for(t in e)n.push(t+"="+e[t]);en=n}return en}function an(t){return 0==t%4&&(0!=t%100||0==t%400)}function un(t,e){for(var n=0,r=0;r<=e;n+=t[r++]);return n}var cn=[31,29,31,30,31,30,31,31,30,31,30,31],fn=[31,28,31,30,31,30,31,31,30,31,30,31];function ln(t,e){for(t=new Date(t.getTime());0<e;){var n=t.getMonth(),r=(an(t.getFullYear())?cn:fn)[n];if(!(e>r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return t}function pn(t,e,n,r){t||(t=this),this.parent=t,this.ma=t.ma,this.Da=null,this.id=bt++,this.name=e,this.mode=n,this.Y={},this.aa={},this.rdev=r}Object.defineProperties(pn.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(t){t?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(t){t?this.mode|=146:this.mode&=-147}}}),$t(),vt=Array(4096),jt(yt,"/"),qt("/tmp"),qt("/home"),qt("/home/web_user"),function(){qt("/dev"),Ut(259,{read:function(){return 0},write:function(t,e,n,r){return r}}),Dt("/dev/null",259),_t(1280,dt),_t(1536,mt),Dt("/dev/tty",1280),Dt("/dev/tty1",1536);var t=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return function(){return crypto.getRandomValues(t),t[0]}}if(f)try{var e=n(4135);return function(){return e.randomBytes(1)[0]}}catch(t){}return function(){J("randomDevice")}}();Ht("random",t),Ht("urandom",t),qt("/dev/shm"),qt("/dev/shm/tmp")}(),function(){qt("/proc");var t=qt("/proc/self");qt("/proc/self/fd"),jt({ma:function(){var e=Rt(t,"fd",16895,73);return e.Y={lookup:function(t,e){var n=Et[+e];if(!n)throw new Tt(8);return(t={parent:null,ma:{Va:"fake"},Y:{readlink:function(){return n.path}}}).parent=t}},e}},"/proc/self/fd")}();for(var _n=Array(256),hn=0;256>hn;++hn)_n[hn]=String.fromCharCode(hn);function dn(t,e){var n=Array(P(t)+1);return t=x(t,n,0,n.length),e&&(n.length=t),n}Jt=_n,ae=e.BindingError=se("BindingError"),ce=e.InternalError=se("InternalError"),be.prototype.isAliasOf=function(t){if(!(this instanceof be&&t instanceof be))return!1;var e=this.W.da.$,n=this.W.Z,r=t.W.da.$;for(t=t.W.Z;e.ia;)n=e.za(n),e=e.ia;for(;r.ia;)t=r.za(t),r=r.ia;return e===r&&n===t},be.prototype.clone=function(){if(this.W.Z||_e(this),this.W.xa)return this.W.count.value+=1,this;var t=ye,e=Object,n=e.create,r=Object.getPrototypeOf(this),o=this.W;return(t=t(n.call(e,r,{W:{value:{count:o.count,ra:o.ra,xa:o.xa,Z:o.Z,da:o.da,ga:o.ga,ha:o.ha}}}))).W.count.value+=1,t.W.ra=!1,t},be.prototype.delete=function(){this.W.Z||_e(this),this.W.ra&&!this.W.xa&&ue("Object already scheduled for deletion"),de(this),me(this.W),this.W.xa||(this.W.ga=void 0,this.W.Z=void 0)},be.prototype.isDeleted=function(){return!this.W.Z},be.prototype.deleteLater=function(){return this.W.Z||_e(this),this.W.ra&&!this.W.xa&&ue("Object already scheduled for deletion"),we.push(this),1===we.length&&ge&&ge(Ee),this.W.ra=!0,this},Ne.prototype.cb=function(t){return this.Xa&&(t=this.Xa(t)),t},Ne.prototype.Pa=function(t){this.pa&&this.pa(t)},Ne.prototype.argPackAdvance=8,Ne.prototype.readValueFromPointer=Ce,Ne.prototype.deleteObject=function(t){null!==t&&t.delete()},Ne.prototype.fromWireType=function(t){function e(){return this.Ba?Ie(this.$.sa,{da:this.kb,Z:n,ha:this,ga:t}):Ie(this.$.sa,{da:this,Z:t})}var n=this.cb(t);if(!n)return this.Pa(t),null;var r=function(t,e){for(void 0===e&&ue("ptr should not be undefined");t.ia;)e=t.za(e),t=t.ia;return Be[e]}(this.$,n);if(void 0!==r)return 0===r.W.count.value?(r.W.Z=n,r.W.ga=t,r.clone()):(r=r.clone(),this.Pa(t),r);if(r=this.$.bb(n),!(r=ve[r]))return e.call(this);r=this.Aa?r.$a:r.pointerType;var o=Re(n,this.$,r.$);return null===o?e.call(this):this.Ba?Ie(r.$.sa,{da:r,Z:o,ha:this,ga:t}):Ie(r.$.sa,{da:r,Z:o})},e.getInheritedInstanceCount=function(){return Object.keys(Be).length},e.getLiveInheritedInstances=function(){var t,e=[];for(t in Be)Be.hasOwnProperty(t)&&e.push(Be[t]);return e},e.flushPendingDeletes=Ee,e.setDelayFunction=function(t){ge=t,we.length&&ge&&ge(Ee)},Le=e.UnboundTypeError=se("UnboundTypeError"),e.count_emval_handles=function(){for(var t=0,e=5;e<We.length;++e)void 0!==We[e]&&++t;return t},e.get_first_emval=function(){for(var t=5;t<We.length;++t)if(void 0!==We[t])return We[t];return null};var mn={d:function(t){return gn(t+16)+16},e:function(t,e,n){throw new st(t).gb(e,n),t},E:function(t,e,n){Qt=n;try{var r=t?A(k,t,void 0):"";if(n)var o=F[(Qt+=4)-4>>2];else o=0;return Wt(r,e,o).fd}catch(t){return void 0!==Xt&&t instanceof Tt||J(t),-t.va}},x:function(){},G:function(t,e,n,r,o){var i=Kt(n);pe(t,{name:e=te(e),fromWireType:function(t){return!!t},toWireType:function(t,e){return e?r:o},argPackAdvance:8,readValueFromPointer:function(t){if(1===n)var r=j;else if(2===n)r=q;else{if(4!==n)throw new TypeError("Unknown boolean type size: "+e);r=F}return this.fromWireType(r[t>>i])},la:null})},l:function(t,n,r,o,i,s,a,u,c,f,l,p,_){l=te(l),s=Me(i,s),u&&(u=Me(a,u)),f&&(f=Me(c,f)),_=Me(p,_);var h=oe(l);!function(t,n){e.hasOwnProperty(t)?(ue("Cannot register public name '"+t+"' twice"),Oe(e,t,t),e.hasOwnProperty(void 0)&&ue("Cannot register multiple overloads of a function with the same number of arguments (undefined)!"),e[t].ea[void 0]=n):e[t]=n}(h,(function(){je("Cannot construct "+l+" due to unbound types",[o])})),le([t,n,r],o?[o]:[],(function(n){if(n=n[0],o)var r=n.$,i=r.sa;else i=be.prototype;n=ie(h,(function(){if(Object.getPrototypeOf(this)!==a)throw new ae("Use 'new' to construct "+l);if(void 0===c.oa)throw new ae(l+" has no accessible constructor");var t=c.oa[arguments.length];if(void 0===t)throw new ae("Tried to invoke ctor of "+l+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(c.oa).toString()+") parameters instead!");return t.apply(this,arguments)}));var a=Object.create(i,{constructor:{value:n}});n.prototype=a;var c=new Te(l,n,a,_,r,s,u,f);r=new Ne(l,c,!0,!1),i=new Ne(l+"*",c,!1,!1);var p=new Ne(l+" const*",c,!1,!0);return ve[t]={pointerType:i,$a:p},function(t,n){e.hasOwnProperty(t)||fe("Replacing nonexistant public symbol"),e[t]=n,e[t].qa=void 0}(h,n),[r,i,p]}))},b:function(t,e,n,r,o,i,s){var a=Fe(n,r);e=te(e),i=Me(o,i),le([],[t],(function(t){function r(){je("Cannot call "+o+" due to unbound types",a)}var o=(t=t[0]).name+"."+e;e.startsWith("@@")&&(e=Symbol[e.substring(2)]);var u=t.$.constructor;return void 0===u[e]?(r.qa=n-1,u[e]=r):(Oe(u,e,o),u[e].ea[n-1]=r),le([],a,(function(t){return t=[t[0],null].concat(t.slice(1)),t=De(o,t,null,i,s),void 0===u[e].ea?(t.qa=n-1,u[e]=t):u[e].ea[n-1]=t,[]})),[]}))},p:function(t,e,n,r,o,i,s,a){e=te(e),i=Me(o,i),le([],[t],(function(t){var o=(t=t[0]).name+"."+e,u={get:function(){je("Cannot access "+o+" due to unbound types",[n])},enumerable:!0,configurable:!0};return u.set=a?function(){je("Cannot access "+o+" due to unbound types",[n])}:function(){ue(o+" is a read-only property")},Object.defineProperty(t.$.constructor,e,u),le([],[n],(function(n){n=n[0];var o={get:function(){return n.fromWireType(i(r))},enumerable:!0};return a&&(a=Me(s,a),o.set=function(t){var e=[];a(r,n.toWireType(e,t)),qe(e)}),Object.defineProperty(t.$.constructor,e,o),[]})),[]}))},q:function(t,e,n,r,o,i){T(0<e);var s=Fe(e,n);o=Me(r,o);var a=[i],u=[];le([],[t],(function(t){var n="constructor "+(t=t[0]).name;if(void 0===t.$.oa&&(t.$.oa=[]),void 0!==t.$.oa[e-1])throw new ae("Cannot register multiple constructors with identical number of parameters ("+(e-1)+") for class '"+t.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return t.$.oa[e-1]=function(){je("Cannot construct "+t.name+" due to unbound types",s)},le([],s,(function(r){return t.$.oa[e-1]=function(){arguments.length!==e-1&&ue(n+" called with "+arguments.length+" arguments, expected "+(e-1)),u.length=0,a.length=e;for(var t=1;t<e;++t)a[t]=r[t].toWireType(u,arguments[t-1]);return t=o.apply(null,a),qe(u),r[0].fromWireType(t)},[]})),[]}))},f:function(t,e,n,r,o,i,s,a){var u=Fe(n,r);e=te(e),i=Me(o,i),le([],[t],(function(t){function r(){je("Cannot call "+o+" due to unbound types",u)}var o=(t=t[0]).name+"."+e;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),a&&t.$.lb.push(e);var c=t.$.sa,f=c[e];return void 0===f||void 0===f.ea&&f.className!==t.name&&f.qa===n-2?(r.qa=n-2,r.className=t.name,c[e]=r):(Oe(c,e,o),c[e].ea[n-2]=r),le([],u,(function(r){return r=De(o,r,t,i,s),void 0===c[e].ea?(r.qa=n-2,c[e]=r):c[e].ea[n-2]=r,[]})),[]}))},F:function(t,e){pe(t,{name:e=te(e),fromWireType:function(t){var e=We[t].value;return $e(t),e},toWireType:function(t,e){return He(e)},argPackAdvance:8,readValueFromPointer:Ce,la:null})},r:function(t,e,n){n=Kt(n),pe(t,{name:e=te(e),fromWireType:function(t){return t},toWireType:function(t,e){if("number"!=typeof e&&"boolean"!=typeof e)throw new TypeError('Cannot convert "'+Ge(e)+'" to '+this.name);return e},argPackAdvance:8,readValueFromPointer:ze(e,n),la:null})},k:function(t,e,n,r,o){function i(t){return t}e=te(e),-1===o&&(o=4294967295);var s=Kt(n);if(0===r){var a=32-8*n;i=function(t){return t<<a>>>a}}var u=e.includes("unsigned");pe(t,{name:e,fromWireType:i,toWireType:function(t,n){if("number"!=typeof n&&"boolean"!=typeof n)throw new TypeError('Cannot convert "'+Ge(n)+'" to '+this.name);if(n<r||n>o)throw new TypeError('Passing a number "'+Ge(n)+'" from JS side to C/C++ side to an argument of type "'+e+'", which is outside the valid range ['+r+", "+o+"]!");return u?n>>>0:0|n},argPackAdvance:8,readValueFromPointer:Ve(e,s,0!==r),la:null})},g:function(t,e,n){function r(t){var e=Y;return new o(U,e[1+(t>>=2)],e[t])}var o=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];pe(t,{name:n=te(n),fromWireType:r,argPackAdvance:8,readValueFromPointer:r},{fb:!0})},s:function(t,e){var n="std::string"===(e=te(e));pe(t,{name:e,fromWireType:function(t){var e=Y[t>>2];if(n)for(var r=t+4,o=0;o<=e;++o){var i=t+4+o;if(o==e||0==k[i]){if(r=r?A(k,r,i-r):"",void 0===s)var s=r;else s+=String.fromCharCode(0),s+=r;r=i+1}}else{for(s=Array(e),o=0;o<e;++o)s[o]=String.fromCharCode(k[t+4+o]);s=s.join("")}return wn(t),s},toWireType:function(t,e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));var r="string"==typeof e;r||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array||ue("Cannot pass non-string to std::string");var o=(n&&r?function(){return P(e)}:function(){return e.length})(),i=gn(4+o+1);if(Y[i>>2]=o,n&&r)x(e,k,i+4,o+1);else if(r)for(r=0;r<o;++r){var s=e.charCodeAt(r);255<s&&(wn(i),ue("String has UTF-16 code units that do not fit in 8 bits")),k[i+4+r]=s}else for(r=0;r<o;++r)k[i+4+r]=e[r];return null!==t&&t.push(wn,i),i},argPackAdvance:8,readValueFromPointer:Ce,la:function(t){wn(t)}})},o:function(t,e,n){if(n=te(n),2===e)var r=R,o=B,i=I,s=function(){return D},a=1;else 4===e&&(r=N,o=M,i=L,s=function(){return Y},a=2);pe(t,{name:n,fromWireType:function(t){for(var n,o=Y[t>>2],i=s(),u=t+4,c=0;c<=o;++c){var f=t+4+c*e;c!=o&&0!=i[f>>a]||(u=r(u,f-u),void 0===n?n=u:(n+=String.fromCharCode(0),n+=u),u=f+e)}return wn(t),n},toWireType:function(t,r){"string"!=typeof r&&ue("Cannot pass non-string to C++ string type "+n);var s=i(r),u=gn(4+s+e);return Y[u>>2]=s>>a,o(r,u+4,s+e),null!==t&&t.push(wn,u),u},argPackAdvance:8,readValueFromPointer:Ce,la:function(t){wn(t)}})},H:function(t,e){pe(t,{hb:!0,name:e=te(e),argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},i:function(t,e,n){t=Xe(t),e=Qe(e,"emval::as");var r=[],o=He(r);return F[n>>2]=o,e.toWireType(r,t)},I:function(t,e,n,r,o){t=Je[t],e=Xe(e),n=Ke(n);var i=[];return F[r>>2]=He(i),t(e,n,i,o)},J:function(t,e,n,r){(t=Je[t])(e=Xe(e),n=Ke(n),null,r)},a:$e,w:function(t){return 0===t?He(tn()):(t=Ke(t),He(tn()[t]))},v:function(t,e){for(var n=(e=function(t,e){for(var n=Array(t),r=0;r<t;++r)n[r]=Qe(F[(e>>2)+r],"parameter "+r);return n}(t,e))[0],r=n.name+"_$"+e.slice(1).map((function(t){return t.name})).join("_")+"$",o=["retType"],i=[n],s="",a=0;a<t-1;++a)s+=(0!==a?", ":"")+"arg"+a,o.push("argType"+a),i.push(e[1+a]);r="return function "+oe("methodCaller_"+r)+"(handle, name, destructors, args) {\n";var u=0;for(a=0;a<t-1;++a)r+=" var arg"+a+" = argType"+a+".readValueFromPointer(args"+(u?"+"+u:"")+");\n",u+=e[a+1].argPackAdvance;for(r+=" var rv = handle[name]("+s+");\n",a=0;a<t-1;++a)e[a+1].deleteObject&&(r+=" argType"+a+".deleteObject(arg"+a+");\n");return n.hb||(r+=" return retType.toWireType(destructors, rv);\n"),o.push(r+"};\n"),function(t){var e=Je.length;return Je.push(t),e}(t=ke(o).apply(null,i))},j:function(t,e){return He((t=Xe(t))[e=Xe(e)])},c:function(t){4<t&&(We[t].Ma+=1)},K:function(t,n,r,o){t=Xe(t);var i=nn[n];if(!i){i="";for(var s=0;s<n;++s)i+=(0!==s?", ":"")+"arg"+s;var a="return function emval_allocator_"+n+"(constructor, argTypes, args) {\n";for(s=0;s<n;++s)a+="var argType"+s+" = requireRegisteredType(Module['HEAP32'][(argTypes >>> 2) + "+s+'], "parameter '+s+'");\nvar arg'+s+" = argType"+s+".readValueFromPointer(args);\nargs += argType"+s+"['argPackAdvance'];\n";i=new Function("requireRegisteredType","Module","__emval_register",a+"var obj = new constructor("+i+");\nreturn __emval_register(obj);\n}\n")(Qe,e,He),nn[n]=i}return i(t,r,o)},m:function(t){return He(Ke(t))},h:function(t){qe(We[t].value),$e(t)},n:function(t,e){return He(t=(t=Qe(t,"_emval_take_value")).readValueFromPointer(e))},t:function(){J()},u:function(t,e,n){var r;for(rn.length=0,n>>=2;r=k[e++];)(r=105>r)&&1&n&&n++,rn.push(r?$[n++>>1]:F[n]),++n;return ot[t].apply(null,rn)},y:function(){J("OOM")},A:function(t,e){try{var n=0;return sn().forEach((function(r,o){var i=e+n;for(o=F[t+4*o>>2]=i,i=0;i<r.length;++i)j[o++>>0]=r.charCodeAt(i);j[o>>0]=0,n+=r.length+1})),0}catch(t){return void 0!==Xt&&t instanceof Tt||J(t),t.va}},B:function(t,e){try{var n=sn();F[t>>2]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),F[e>>2]=r,0}catch(t){return void 0!==Xt&&t instanceof Tt||J(t),t.va}},C:function(t){try{var e=Zt(t);if(null===e.fd)throw new Tt(8);e.eb&&(e.eb=null);try{e.aa.close&&e.aa.close(e)}catch(t){throw t}finally{Et[e.fd]=null}return e.fd=null,0}catch(t){return void 0!==Xt&&t instanceof Tt||J(t),t.va}},D:function(t,e,n,r){try{t:{for(var o=Zt(t),i=t=0;i<n;i++){var s=F[e+(8*i+4)>>2],a=o,u=F[e+8*i>>2],c=s,f=void 0,l=j;if(0>c||0>f)throw new Tt(28);if(null===a.fd)throw new Tt(8);if(1==(2097155&a.flags))throw new Tt(8);if(16384==(61440&a.node.mode))throw new Tt(31);if(!a.aa.read)throw new Tt(28);var p=void 0!==f;if(p){if(!a.seekable)throw new Tt(70)}else f=a.position;var _=a.aa.read(a,l,u,c,f);p||(a.position+=_);var h=_;if(0>h){var d=-1;break t}if(t+=h,h<s)break}d=t}return F[r>>2]=d,0}catch(t){return void 0!==Xt&&t instanceof Tt||J(t),t.va}},z:function(t,e,n,r){return function(t,e,n,r){function o(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.length<e;)t=n[0]+t;return t}function i(t,e){return o(t,e,"0")}function s(t,e){function n(t){return 0>t?-1:0<t?1:0}var r;return 0===(r=n(t.getFullYear()-e.getFullYear()))&&0===(r=n(t.getMonth()-e.getMonth()))&&(r=n(t.getDate()-e.getDate())),r}function a(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function u(t){t=ln(new Date(t.fa+1900,0,1),t.Ga);var e=new Date(t.getFullYear()+1,0,4),n=a(new Date(t.getFullYear(),0,4));return e=a(e),0>=s(n,t)?0>=s(e,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var c=F[r+40>>2];for(var f in r={yb:F[r>>2],xb:F[r+4>>2],Ea:F[r+8>>2],ya:F[r+12>>2],ua:F[r+16>>2],fa:F[r+20>>2],Fa:F[r+24>>2],Ga:F[r+28>>2],Eb:F[r+32>>2],wb:F[r+36>>2],zb:c&&c?A(k,c,void 0):""},n=n?A(k,n,void 0):"",c={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(f,"g"),c[f]);var l="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),p="January February March April May June July August September October November December".split(" ");for(f in c={"%a":function(t){return l[t.Fa].substring(0,3)},"%A":function(t){return l[t.Fa]},"%b":function(t){return p[t.ua].substring(0,3)},"%B":function(t){return p[t.ua]},"%C":function(t){return i((t.fa+1900)/100|0,2)},"%d":function(t){return i(t.ya,2)},"%e":function(t){return o(t.ya,2," ")},"%g":function(t){return u(t).toString().substring(2)},"%G":function(t){return u(t)},"%H":function(t){return i(t.Ea,2)},"%I":function(t){return 0==(t=t.Ea)?t=12:12<t&&(t-=12),i(t,2)},"%j":function(t){return i(t.ya+un(an(t.fa+1900)?cn:fn,t.ua-1),3)},"%m":function(t){return i(t.ua+1,2)},"%M":function(t){return i(t.xb,2)},"%n":function(){return"\n"},"%p":function(t){return 0<=t.Ea&&12>t.Ea?"AM":"PM"},"%S":function(t){return i(t.yb,2)},"%t":function(){return"\t"},"%u":function(t){return t.Fa||7},"%U":function(t){var e=new Date(t.fa+1900,0,1),n=0===e.getDay()?e:ln(e,7-e.getDay());return 0>s(n,t=new Date(t.fa+1900,t.ua,t.ya))?i(Math.ceil((31-n.getDate()+(un(an(t.getFullYear())?cn:fn,t.getMonth()-1)-31)+t.getDate())/7),2):0===s(n,e)?"01":"00"},"%V":function(t){var e=new Date(t.fa+1901,0,4),n=a(new Date(t.fa+1900,0,4));e=a(e);var r=ln(new Date(t.fa+1900,0,1),t.Ga);return 0>s(r,n)?"53":0>=s(e,r)?"01":i(Math.ceil((n.getFullYear()<t.fa+1900?t.Ga+32-n.getDate():t.Ga+1-n.getDate())/7),2)},"%w":function(t){return t.Fa},"%W":function(t){var e=new Date(t.fa,0,1),n=1===e.getDay()?e:ln(e,0===e.getDay()?1:7-e.getDay()+1);return 0>s(n,t=new Date(t.fa+1900,t.ua,t.ya))?i(Math.ceil((31-n.getDate()+(un(an(t.getFullYear())?cn:fn,t.getMonth()-1)-31)+t.getDate())/7),2):0===s(n,e)?"01":"00"},"%y":function(t){return(t.fa+1900).toString().substring(2)},"%Y":function(t){return t.fa+1900},"%z":function(t){var e=0<=(t=t.wb);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.zb},"%%":function(){return"%"}})n.includes(f)&&(n=n.replace(new RegExp(f,"g"),c[f](r)));return(f=dn(n,!1)).length>e?0:(j.set(f,t),f.length-1)}(t,e,n,r)}};!function(){function t(t){e.asm=t.exports,v=e.asm.L,U=t=v.buffer,e.HEAP8=j=new Int8Array(t),e.HEAP16=q=new Int16Array(t),e.HEAP32=F=new Int32Array(t),e.HEAPU8=k=new Uint8Array(t),e.HEAPU16=D=new Uint16Array(t),e.HEAPU32=Y=new Uint32Array(t),e.HEAPF32=W=new Float32Array(t),e.HEAPF64=$=new Float64Array(t),H=e.asm.O,z.unshift(e.asm.M),Q--,e.monitorRunDependencies&&e.monitorRunDependencies(Q),0==Q&&(null!==Z&&(clearInterval(Z),Z=null),K&&(t=K,K=null,t()))}function n(e){t(e.instance)}function r(t){return function(){if(!w&&(u||c)){if("function"==typeof fetch&&!et.startsWith("file://"))return fetch(et,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+et+"'";return t.arrayBuffer()})).catch((function(){return rt()}));if(h)return new Promise((function(t,e){h(et,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return rt()}))}().then((function(t){return WebAssembly.instantiate(t,o)})).then(t,(function(t){b("failed to asynchronously prepare wasm: "+t),J(t)}))}var o={a:mn};if(Q++,e.monitorRunDependencies&&e.monitorRunDependencies(Q),e.instantiateWasm)try{return e.instantiateWasm(o,t)}catch(t){return b("Module.instantiateWasm callback failed with error: "+t),!1}(w||"function"!=typeof WebAssembly.instantiateStreaming||tt()||et.startsWith("file://")||"function"!=typeof fetch?r(n):fetch(et,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,o).then(n,(function(t){return b("wasm streaming compile failed: "+t),b("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(i)}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.M).apply(null,arguments)};var yn,gn=e._malloc=function(){return(gn=e._malloc=e.asm.N).apply(null,arguments)},wn=e._free=function(){return(wn=e._free=e.asm.P).apply(null,arguments)},En=e.___getTypeName=function(){return(En=e.___getTypeName=e.asm.Q).apply(null,arguments)};function bn(){function t(){if(!yn&&(yn=!0,e.calledRun=!0,!O)){if(e.noFSInit||Mt||(Mt=!0,$t(),e.stdin=e.stdin,e.stdout=e.stdout,e.stderr=e.stderr,e.stdin?Ht("stdin",e.stdin):Ft("/dev/tty","/dev/stdin"),e.stdout?Ht("stdout",null,e.stdout):Ft("/dev/tty","/dev/stdout"),e.stderr?Ht("stderr",null,e.stderr):Ft("/dev/tty1","/dev/stderr"),Wt("/dev/stdin",0),Wt("/dev/stdout",1),Wt("/dev/stderr",1)),it(z),o(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var t=e.postRun.shift();V.unshift(t)}it(V)}}if(!(0<Q)){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)X();it(G),0<Q||(e.setStatus?(e.setStatus("Running..."),setTimeout((function(){setTimeout((function(){e.setStatus("")}),1),t()}),1)):t())}}if(e.___embind_register_native_and_builtin_types=function(){return(e.___embind_register_native_and_builtin_types=e.asm.R).apply(null,arguments)},e.dynCall_iiiiij=function(){return(e.dynCall_iiiiij=e.asm.S).apply(null,arguments)},e.dynCall_iiiiijj=function(){return(e.dynCall_iiiiijj=e.asm.T).apply(null,arguments)},e.dynCall_iiiiiijj=function(){return(e.dynCall_iiiiiijj=e.asm.U).apply(null,arguments)},e.dynCall_viijii=function(){return(e.dynCall_viijii=e.asm.V).apply(null,arguments)},K=function t(){yn||bn(),yn||(K=t)},e.run=bn,e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);0<e.preInit.length;)e.preInit.pop()();return bn(),t.ready});t.exports=o},2460:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isCLVMObject=e.isCons=e.isAtom=e.CLVMObject=void 0;const r=n(7287),o=n(2326),i=n(7185);function s(t){return t&&void 0!==t.atom&&void 0!==t.pair}e.CLVMObject=class{constructor(t){this._atom=r.None,this._pair=r.None,s(t)?(this._atom=t.atom,this._pair=t.pair):o.isTuple(t)?(this._pair=t,this._atom=r.None):(this._atom=t,this._pair=r.None)}get atom(){return this._atom}get pair(){return this._pair}},e.isAtom=function(t){if(t.atom&&t.pair||!t.atom&&!t.pair)throw new i.EvalError("Invalid clvm",t);return Boolean(t.atom&&!t.pair)},e.isCons=function(t){if(t.atom&&t.pair||!t.atom&&!t.pair)throw new i.EvalError("Invalid clvm",t);return Boolean(!t.atom&&t.pair)},e.isCLVMObject=s},7185:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EvalError=void 0;class n extends Error{constructor(t,e){super(t),this.name="EvalError",this._sexp=e}}e.EvalError=n},3872:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isSExp=e.SExp=e.to_sexp_type=e.convert_atom_to_bytes=e.looks_like_clvm_object=void 0;const r=n(7287),o=n(2460),i=n(2326),s=n(8475),a=n(5213),u=n(60),c=n(7185);function f(t){return!(!t||"object"!=typeof t)&&Boolean("atom"in t&&"pair"in t)}function l(t){if(i.isBytes(t))return t;if("string"==typeof t)return i.Bytes.from(t,"utf8");if("number"==typeof t)return s.int_to_bytes(t,{signed:!0});if("boolean"==typeof t)return s.int_to_bytes(t?1:0,{signed:!0});if("bigint"==typeof t)return s.bigint_to_bytes(t,{signed:!0});if(t===r.None||!t)return i.Bytes.NULL;if(i.isIterable(t)){if(t.length>0)throw new Error(`can't cast ${JSON.stringify(t)} to bytes`);return i.Bytes.NULL}if("function"==typeof t.serialize)return i.Bytes.from(t,"G1Element");throw new Error(`can't cast ${JSON.stringify(t)} to bytes`)}function p(t){let e=t;const n=[e],s=[i.t(0,r.None)];for(;s.length;){const t=s.pop(),a=t[0];let u=t[1];if(0!==a){if(null===u)throw new Error("Invalid target. target is null");1===a?n[u]=new o.CLVMObject(i.t(new o.CLVMObject(n.pop()),n[u].pair[1])):2===a?n[u]=new o.CLVMObject(i.t(n[u].pair[0],new o.CLVMObject(n.pop()))):3===a&&(n[u]=new o.CLVMObject(i.t(n.pop(),n[u])))}else{if(f(n[n.length-1]))continue;if(e=n.pop(),i.isTuple(e)){if(2!==e.length)throw new Error(`can't cast tuple of size ${e.length}`);const[t,a]=e;u=n.length,n.push(new o.CLVMObject(i.t(t,a))),f(a)||(n.push(a),s.push(i.t(2,u)),s.push(i.t(0,r.None))),f(t)||(n.push(t),s.push(i.t(1,u)),s.push(i.t(0,r.None)));continue}if(Array.isArray