scanbot-web-sdk 8.1.0 → 8.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/@types/ui2/document/model/document-detection-ui-result.d.ts +1 -0
  2. package/bundle/ScanbotSDK.min.js +3 -3
  3. package/bundle/ScanbotSDK.ui2.min.js +2 -2
  4. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
  5. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
  6. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
  7. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm.wasm +0 -0
  8. package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
  9. package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd.js +1 -1
  10. package/bundle/bin/barcode-scanner/ScanbotSDK.Core.js +1 -1
  11. package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.js +1 -1
  12. package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.wasm +0 -0
  13. package/bundle/bin/complete/ScanbotSDK.Asm-simd.wasm +0 -0
  14. package/bundle/bin/complete/ScanbotSDK.Asm.wasm +0 -0
  15. package/bundle/bin/complete/ScanbotSDK.Core-simd-threads.js +1 -1
  16. package/bundle/bin/complete/ScanbotSDK.Core-simd.js +1 -1
  17. package/bundle/bin/complete/ScanbotSDK.Core.js +1 -1
  18. package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
  19. package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
  20. package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
  21. package/bundle/bin/document-scanner/ScanbotSDK.Asm.wasm +0 -0
  22. package/bundle/bin/document-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
  23. package/bundle/bin/document-scanner/ScanbotSDK.Core-simd.js +1 -1
  24. package/bundle/bin/document-scanner/ScanbotSDK.Core.js +1 -1
  25. package/package.json +1 -1
@@ -1 +1 @@
1
- (()=>{var t={772:()=>{},801:(t,e,r)=>{var n,o=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(t={}){var e,o,i=t;i.ready=new Promise(((t,r)=>{e=t,o=r}));var a,s,u,c=Object.assign({},i),l="./this.program",d=(t,e)=>{throw e},h="";h=self.location.href,n&&(h=n),h=0!==h.indexOf("blob:")?h.substr(0,h.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},u=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)},s=(t,e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?e(n.response):r()},n.onerror=r,n.send(null)};var f,p=i.print||console.log.bind(console),m=i.printErr||console.error.bind(console);Object.assign(i,c),c=null,i.arguments&&i.arguments,i.thisProgram&&(l=i.thisProgram),i.quit&&(d=i.quit),i.wasmBinary&&(f=i.wasmBinary);var v,y=i.noExitRuntime||!0;"object"!=typeof WebAssembly&&U("no native wasm support detected");var g,w,b,E,_,k,C,M,$,P=!1;function S(){var t=v.buffer;i.HEAP8=g=new Int8Array(t),i.HEAP16=b=new Int16Array(t),i.HEAPU8=w=new Uint8Array(t),i.HEAPU16=E=new Uint16Array(t),i.HEAP32=_=new Int32Array(t),i.HEAPU32=k=new Uint32Array(t),i.HEAPF32=C=new Float32Array(t),i.HEAPF64=M=new Float64Array(t)}var F,T,j,D,W=[],A=[],x=[],O=0,I=null,z=null;function R(t){O++,i.monitorRunDependencies&&i.monitorRunDependencies(O)}function N(t){if(O--,i.monitorRunDependencies&&i.monitorRunDependencies(O),0==O&&(null!==I&&(clearInterval(I),I=null),z)){var e=z;z=null,e()}}function U(t){i.onAbort&&i.onAbort(t),m(t="Aborted("+t+")"),P=!0,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw o(e),e}function B(t){return t.startsWith("data:application/octet-stream;base64,")}function L(t){if(t==F&&f)return new Uint8Array(f);if(u)return u(t);throw"both async and sync fetching of the wasm failed"}function H(t,e,r){return function(t){return f||"function"!=typeof fetch?Promise.resolve().then((()=>L(t))):fetch(t,{credentials:"same-origin"}).then((e=>{if(!e.ok)throw"failed to load wasm binary file at '"+t+"'";return e.arrayBuffer()})).catch((()=>L(t)))}(t).then((t=>WebAssembly.instantiate(t,e))).then((t=>t)).then(r,(t=>{m(`failed to asynchronously prepare wasm: ${t}`),U(t)}))}B(F="ScanbotSDK.Asm-simd.wasm")||(T=F,F=i.locateFile?i.locateFile(T,h):h+T);var V={1463040:t=>dr(function(){return this[K(t)].toString()}.apply(function(){return this}.call(void 0)))};function Y(t){this.name="ExitStatus",this.message=`Program terminated with exit(${t})`,this.status=t}var q=t=>{for(;t.length>0;)t.shift()(i)},Q="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,G=(t,e,r)=>{for(var n=e+r,o=e;t[o]&&!(o>=n);)++o;if(o-e>16&&t.buffer&&Q)return Q.decode(t.subarray(e,o));for(var i="";e<o;){var a=t[e++];if(128&a){var s=63&t[e++];if(192!=(224&a)){var u=63&t[e++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&t[e++])<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i},K=(t,e)=>t?G(w,t,e):"",X=[],J=0,Z=0;function tt(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(t){k[this.ptr+4>>2]=t},this.get_type=function(){return k[this.ptr+4>>2]},this.set_destructor=function(t){k[this.ptr+8>>2]=t},this.get_destructor=function(){return k[this.ptr+8>>2]},this.set_caught=function(t){t=t?1:0,g[this.ptr+12>>0]=t},this.get_caught=function(){return 0!=g[this.ptr+12>>0]},this.set_rethrown=function(t){t=t?1:0,g[this.ptr+13>>0]=t},this.get_rethrown=function(){return 0!=g[this.ptr+13>>0]},this.init=function(t,e){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(e)},this.set_adjusted_ptr=function(t){k[this.ptr+16>>2]=t},this.get_adjusted_ptr=function(){return k[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Tr(this.get_type()))return k[this.excPtr>>2];var t=this.get_adjusted_ptr();return 0!==t?t:this.excPtr}}var et=t=>{var e=Z;if(!e)return Er(0),0;var r=new tt(e);r.set_adjusted_ptr(e);var n=r.get_type();if(!n)return Er(0),e;for(var o in t){var i=t[o];if(0===i||i===n)break;var a=r.ptr+16;if(Fr(i,n,a))return Er(i),e}return Er(n),e},rt=()=>{var t=X.pop();t||U("no exception to throw");var e=t.excPtr;throw t.get_rethrown()||(X.push(t),t.set_rethrown(!0),t.set_caught(!1),J++),Z=e},nt={isAbs:t=>"/"===t.charAt(0),splitPath:t=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1),normalizeArray:(t,e)=>{for(var r=0,n=t.length-1;n>=0;n--){var o=t[n];"."===o?t.splice(n,1):".."===o?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r;r--)t.unshift("..");return t},normalize:t=>{var e=nt.isAbs(t),r="/"===t.substr(-1);return(t=nt.normalizeArray(t.split("/").filter((t=>!!t)),!e).join("/"))||e||(t="."),t&&r&&(t+="/"),(e?"/":"")+t},dirname:t=>{var e=nt.splitPath(t),r=e[0],n=e[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:t=>{if("/"===t)return"/";var e=(t=(t=nt.normalize(t)).replace(/\/$/,"")).lastIndexOf("/");return-1===e?t:t.substr(e+1)},join:function(){var t=Array.prototype.slice.call(arguments);return nt.normalize(t.join("/"))},join2:(t,e)=>nt.normalize(t+"/"+e)},ot=t=>(ot=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return t=>crypto.getRandomValues(t);U("initRandomDevice")})())(t),it={resolve:function(){for(var t="",e=!1,r=arguments.length-1;r>=-1&&!e;r--){var n=r>=0?arguments[r]:vt.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";t=n+"/"+t,e=nt.isAbs(n)}return(e?"/":"")+(t=nt.normalizeArray(t.split("/").filter((t=>!!t)),!e).join("/"))||"."},relative:(t,e)=>{function r(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;r>=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=it.resolve(t).substr(1),e=it.resolve(e).substr(1);for(var n=r(t.split("/")),o=r(e.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var u=[];for(s=a;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(a))).join("/")}},at=[],st=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++r):e+=3}return e},ut=(t,e,r,n)=>{if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a<t.length;++a){var s=t.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&t.charCodeAt(++a)),s<=127){if(r>=i)break;e[r++]=s}else if(s<=2047){if(r+1>=i)break;e[r++]=192|s>>6,e[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;e[r++]=224|s>>12,e[r++]=128|s>>6&63,e[r++]=128|63&s}else{if(r+3>=i)break;e[r++]=240|s>>18,e[r++]=128|s>>12&63,e[r++]=128|s>>6&63,e[r++]=128|63&s}}return e[r]=0,r-o};function ct(t,e,r){var n=r>0?r:st(t)+1,o=new Array(n),i=ut(t,o,0,o.length);return e&&(o.length=i),o}var lt={ttys:[],init(){},shutdown(){},register(t,e){lt.ttys[t]={input:[],output:[],ops:e},vt.registerDevice(t,lt.stream_ops)},stream_ops:{open(t){var e=lt.ttys[t.node.rdev];if(!e)throw new vt.ErrnoError(43);t.tty=e,t.seekable=!1},close(t){t.tty.ops.fsync(t.tty)},fsync(t){t.tty.ops.fsync(t.tty)},read(t,e,r,n,o){if(!t.tty||!t.tty.ops.get_char)throw new vt.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=t.tty.ops.get_char(t.tty)}catch(t){throw new vt.ErrnoError(29)}if(void 0===s&&0===i)throw new vt.ErrnoError(6);if(null==s)break;i++,e[r+a]=s}return i&&(t.node.timestamp=Date.now()),i},write(t,e,r,n,o){if(!t.tty||!t.tty.ops.put_char)throw new vt.ErrnoError(60);try{for(var i=0;i<n;i++)t.tty.ops.put_char(t.tty,e[r+i])}catch(t){throw new vt.ErrnoError(29)}return n&&(t.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:t=>(()=>{if(!at.length){var t=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n"),!t)return null;at=ct(t,!0)}return at.shift()})(),put_char(t,e){null===e||10===e?(p(G(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},fsync(t){t.output&&t.output.length>0&&(p(G(t.output,0)),t.output=[])},ioctl_tcgets:t=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(t,e,r)=>0,ioctl_tiocgwinsz:t=>[24,80]},default_tty1_ops:{put_char(t,e){null===e||10===e?(m(G(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},fsync(t){t.output&&t.output.length>0&&(m(G(t.output,0)),t.output=[])}}},dt=t=>{t=((t,e)=>Math.ceil(t/e)*e)(t,65536);var e=kr(65536,t);return e?((t,e)=>(w.fill(0,t,t+e),t))(e,t):0},ht={ops_table:null,mount:t=>ht.createNode(null,"/",16895,0),createNode(t,e,r,n){if(vt.isBlkdev(r)||vt.isFIFO(r))throw new vt.ErrnoError(63);ht.ops_table||(ht.ops_table={dir:{node:{getattr:ht.node_ops.getattr,setattr:ht.node_ops.setattr,lookup:ht.node_ops.lookup,mknod:ht.node_ops.mknod,rename:ht.node_ops.rename,unlink:ht.node_ops.unlink,rmdir:ht.node_ops.rmdir,readdir:ht.node_ops.readdir,symlink:ht.node_ops.symlink},stream:{llseek:ht.stream_ops.llseek}},file:{node:{getattr:ht.node_ops.getattr,setattr:ht.node_ops.setattr},stream:{llseek:ht.stream_ops.llseek,read:ht.stream_ops.read,write:ht.stream_ops.write,allocate:ht.stream_ops.allocate,mmap:ht.stream_ops.mmap,msync:ht.stream_ops.msync}},link:{node:{getattr:ht.node_ops.getattr,setattr:ht.node_ops.setattr,readlink:ht.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ht.node_ops.getattr,setattr:ht.node_ops.setattr},stream:vt.chrdev_stream_ops}});var o=vt.createNode(t,e,r,n);return vt.isDir(o.mode)?(o.node_ops=ht.ops_table.dir.node,o.stream_ops=ht.ops_table.dir.stream,o.contents={}):vt.isFile(o.mode)?(o.node_ops=ht.ops_table.file.node,o.stream_ops=ht.ops_table.file.stream,o.usedBytes=0,o.contents=null):vt.isLink(o.mode)?(o.node_ops=ht.ops_table.link.node,o.stream_ops=ht.ops_table.link.stream):vt.isChrdev(o.mode)&&(o.node_ops=ht.ops_table.chrdev.node,o.stream_ops=ht.ops_table.chrdev.stream),o.timestamp=Date.now(),t&&(t.contents[e]=o,t.timestamp=o.timestamp),o},getFileDataAsTypedArray:t=>t.contents?t.contents.subarray?t.contents.subarray(0,t.usedBytes):new Uint8Array(t.contents):new Uint8Array(0),expandFileStorage(t,e){var r=t.contents?t.contents.length:0;if(!(r>=e)){e=Math.max(e,r*(r<1048576?2:1.125)>>>0),0!=r&&(e=Math.max(e,256));var n=t.contents;t.contents=new Uint8Array(e),t.usedBytes>0&&t.contents.set(n.subarray(0,t.usedBytes),0)}},resizeFileStorage(t,e){if(t.usedBytes!=e)if(0==e)t.contents=null,t.usedBytes=0;else{var r=t.contents;t.contents=new Uint8Array(e),r&&t.contents.set(r.subarray(0,Math.min(e,t.usedBytes))),t.usedBytes=e}},node_ops:{getattr(t){var e={};return e.dev=vt.isChrdev(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,vt.isDir(t.mode)?e.size=4096:vt.isFile(t.mode)?e.size=t.usedBytes:vt.isLink(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.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr(t,e){void 0!==e.mode&&(t.mode=e.mode),void 0!==e.timestamp&&(t.timestamp=e.timestamp),void 0!==e.size&&ht.resizeFileStorage(t,e.size)},lookup(t,e){throw vt.genericErrors[44]},mknod:(t,e,r,n)=>ht.createNode(t,e,r,n),rename(t,e,r){if(vt.isDir(t.mode)){var n;try{n=vt.lookupNode(e,r)}catch(t){}if(n)for(var o in n.contents)throw new vt.ErrnoError(55)}delete t.parent.contents[t.name],t.parent.timestamp=Date.now(),t.name=r,e.contents[r]=t,e.timestamp=t.parent.timestamp,t.parent=e},unlink(t,e){delete t.contents[e],t.timestamp=Date.now()},rmdir(t,e){var r=vt.lookupNode(t,e);for(var n in r.contents)throw new vt.ErrnoError(55);delete t.contents[e],t.timestamp=Date.now()},readdir(t){var e=[".",".."];for(var r in t.contents)t.contents.hasOwnProperty(r)&&e.push(r);return e},symlink(t,e,r){var n=ht.createNode(t,e,41471,0);return n.link=r,n},readlink(t){if(!vt.isLink(t.mode))throw new vt.ErrnoError(28);return t.link}},stream_ops:{read(t,e,r,n,o){var i=t.node.contents;if(o>=t.node.usedBytes)return 0;var a=Math.min(t.node.usedBytes-o,n);if(a>8&&i.subarray)e.set(i.subarray(o,o+a),r);else for(var s=0;s<a;s++)e[r+s]=i[o+s];return a},write(t,e,r,n,o,i){if(e.buffer===g.buffer&&(i=!1),!n)return 0;var a=t.node;if(a.timestamp=Date.now(),e.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=e.subarray(r,r+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=e.slice(r,r+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(e.subarray(r,r+n),o),n}if(ht.expandFileStorage(a,o+n),a.contents.subarray&&e.subarray)a.contents.set(e.subarray(r,r+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=e[r+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek(t,e,r){var n=e;if(1===r?n+=t.position:2===r&&vt.isFile(t.node.mode)&&(n+=t.node.usedBytes),n<0)throw new vt.ErrnoError(28);return n},allocate(t,e,r){ht.expandFileStorage(t.node,e+r),t.node.usedBytes=Math.max(t.node.usedBytes,e+r)},mmap(t,e,r,n,o){if(!vt.isFile(t.node.mode))throw new vt.ErrnoError(43);var i,a,s=t.node.contents;if(2&o||s.buffer!==g.buffer){if((r>0||r+e<s.length)&&(s=s.subarray?s.subarray(r,r+e):Array.prototype.slice.call(s,r,r+e)),a=!0,!(i=dt(e)))throw new vt.ErrnoError(48);g.set(s,i)}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:(t,e,r,n,o)=>(ht.stream_ops.write(t,e,0,n,r,!1),0)}},ft=(t,e,r,n)=>{var o=n?"":`al ${t}`;s(t,(r=>{var n;n=`Loading data file "${t}" failed (no arrayBuffer).`,r||U(n),e(new Uint8Array(r)),o&&N()}),(e=>{if(!r)throw`Loading data file "${t}" failed.`;r()})),o&&R()},pt=i.preloadPlugins||[],mt=(t,e)=>{var r=0;return t&&(r|=365),e&&(r|=146),r},vt={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(t,e={}){if(!(t=it.resolve(t)))return{path:"",node:null};if((e=Object.assign({follow_mount:!0,recurse_count:0},e)).recurse_count>8)throw new vt.ErrnoError(32);for(var r=t.split("/").filter((t=>!!t)),n=vt.root,o="/",i=0;i<r.length;i++){var a=i===r.length-1;if(a&&e.parent)break;if(n=vt.lookupNode(n,r[i]),o=nt.join2(o,r[i]),vt.isMountpoint(n)&&(!a||a&&e.follow_mount)&&(n=n.mounted.root),!a||e.follow)for(var s=0;vt.isLink(n.mode);){var u=vt.readlink(o);if(o=it.resolve(nt.dirname(o),u),n=vt.lookupPath(o,{recurse_count:e.recurse_count+1}).node,s++>40)throw new vt.ErrnoError(32)}}return{path:o,node:n}},getPath(t){for(var e;;){if(vt.isRoot(t)){var r=t.mount.mountpoint;return e?"/"!==r[r.length-1]?`${r}/${e}`:r+e:r}e=e?`${t.name}/${e}`:t.name,t=t.parent}},hashName(t,e){for(var r=0,n=0;n<e.length;n++)r=(r<<5)-r+e.charCodeAt(n)|0;return(t+r>>>0)%vt.nameTable.length},hashAddNode(t){var e=vt.hashName(t.parent.id,t.name);t.name_next=vt.nameTable[e],vt.nameTable[e]=t},hashRemoveNode(t){var e=vt.hashName(t.parent.id,t.name);if(vt.nameTable[e]===t)vt.nameTable[e]=t.name_next;else for(var r=vt.nameTable[e];r;){if(r.name_next===t){r.name_next=t.name_next;break}r=r.name_next}},lookupNode(t,e){var r=vt.mayLookup(t);if(r)throw new vt.ErrnoError(r,t);for(var n=vt.hashName(t.id,e),o=vt.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===t.id&&i===e)return o}return vt.lookup(t,e)},createNode(t,e,r,n){var o=new vt.FSNode(t,e,r,n);return vt.hashAddNode(o),o},destroyNode(t){vt.hashRemoveNode(t)},isRoot:t=>t===t.parent,isMountpoint:t=>!!t.mounted,isFile:t=>32768==(61440&t),isDir:t=>16384==(61440&t),isLink:t=>40960==(61440&t),isChrdev:t=>8192==(61440&t),isBlkdev:t=>24576==(61440&t),isFIFO:t=>4096==(61440&t),isSocket:t=>49152==(49152&t),flagsToPermissionString(t){var e=["r","w","rw"][3&t];return 512&t&&(e+="w"),e},nodePermissions:(t,e)=>vt.ignorePermissions||(!e.includes("r")||292&t.mode)&&(!e.includes("w")||146&t.mode)&&(!e.includes("x")||73&t.mode)?0:2,mayLookup(t){var e=vt.nodePermissions(t,"x");return e||(t.node_ops.lookup?0:2)},mayCreate(t,e){try{return vt.lookupNode(t,e),20}catch(t){}return vt.nodePermissions(t,"wx")},mayDelete(t,e,r){var n;try{n=vt.lookupNode(t,e)}catch(t){return t.errno}var o=vt.nodePermissions(t,"wx");if(o)return o;if(r){if(!vt.isDir(n.mode))return 54;if(vt.isRoot(n)||vt.getPath(n)===vt.cwd())return 10}else if(vt.isDir(n.mode))return 31;return 0},mayOpen:(t,e)=>t?vt.isLink(t.mode)?32:vt.isDir(t.mode)&&("r"!==vt.flagsToPermissionString(e)||512&e)?31:vt.nodePermissions(t,vt.flagsToPermissionString(e)):44,MAX_OPEN_FDS:4096,nextfd(){for(var t=0;t<=vt.MAX_OPEN_FDS;t++)if(!vt.streams[t])return t;throw new vt.ErrnoError(33)},getStreamChecked(t){var e=vt.getStream(t);if(!e)throw new vt.ErrnoError(8);return e},getStream:t=>vt.streams[t],createStream:(t,e=-1)=>(vt.FSStream||(vt.FSStream=function(){this.shared={}},vt.FSStream.prototype={},Object.defineProperties(vt.FSStream.prototype,{object:{get(){return this.node},set(t){this.node=t}},isRead:{get(){return 1!=(2097155&this.flags)}},isWrite:{get(){return 0!=(2097155&this.flags)}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(t){this.shared.flags=t}},position:{get(){return this.shared.position},set(t){this.shared.position=t}}})),t=Object.assign(new vt.FSStream,t),-1==e&&(e=vt.nextfd()),t.fd=e,vt.streams[e]=t,t),closeStream(t){vt.streams[t]=null},chrdev_stream_ops:{open(t){var e=vt.getDevice(t.node.rdev);t.stream_ops=e.stream_ops,t.stream_ops.open&&t.stream_ops.open(t)},llseek(){throw new vt.ErrnoError(70)}},major:t=>t>>8,minor:t=>255&t,makedev:(t,e)=>t<<8|e,registerDevice(t,e){vt.devices[t]={stream_ops:e}},getDevice:t=>vt.devices[t],getMounts(t){for(var e=[],r=[t];r.length;){var n=r.pop();e.push(n),r.push.apply(r,n.mounts)}return e},syncfs(t,e){"function"==typeof t&&(e=t,t=!1),vt.syncFSRequests++,vt.syncFSRequests>1&&m(`warning: ${vt.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var r=vt.getMounts(vt.root.mount),n=0;function o(t){return vt.syncFSRequests--,e(t)}function i(t){if(t)return i.errored?void 0:(i.errored=!0,o(t));++n>=r.length&&o(null)}r.forEach((e=>{if(!e.type.syncfs)return i(null);e.type.syncfs(e,t,i)}))},mount(t,e,r){var n,o="/"===r,i=!r;if(o&&vt.root)throw new vt.ErrnoError(10);if(!o&&!i){var a=vt.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,vt.isMountpoint(n))throw new vt.ErrnoError(10);if(!vt.isDir(n.mode))throw new vt.ErrnoError(54)}var s={type:t,opts:e,mountpoint:r,mounts:[]},u=t.mount(s);return u.mount=s,s.root=u,o?vt.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount(t){var e=vt.lookupPath(t,{follow_mount:!1});if(!vt.isMountpoint(e.node))throw new vt.ErrnoError(28);var r=e.node,n=r.mounted,o=vt.getMounts(n);Object.keys(vt.nameTable).forEach((t=>{for(var e=vt.nameTable[t];e;){var r=e.name_next;o.includes(e.mount)&&vt.destroyNode(e),e=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(n);r.mount.mounts.splice(i,1)},lookup:(t,e)=>t.node_ops.lookup(t,e),mknod(t,e,r){var n=vt.lookupPath(t,{parent:!0}).node,o=nt.basename(t);if(!o||"."===o||".."===o)throw new vt.ErrnoError(28);var i=vt.mayCreate(n,o);if(i)throw new vt.ErrnoError(i);if(!n.node_ops.mknod)throw new vt.ErrnoError(63);return n.node_ops.mknod(n,o,e,r)},create:(t,e)=>(e=void 0!==e?e:438,e&=4095,e|=32768,vt.mknod(t,e,0)),mkdir:(t,e)=>(e=void 0!==e?e:511,e&=1023,e|=16384,vt.mknod(t,e,0)),mkdirTree(t,e){for(var r=t.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{vt.mkdir(n,e)}catch(t){if(20!=t.errno)throw t}}},mkdev:(t,e,r)=>("undefined"==typeof r&&(r=e,e=438),e|=8192,vt.mknod(t,e,r)),symlink(t,e){if(!it.resolve(t))throw new vt.ErrnoError(44);var r=vt.lookupPath(e,{parent:!0}).node;if(!r)throw new vt.ErrnoError(44);var n=nt.basename(e),o=vt.mayCreate(r,n);if(o)throw new vt.ErrnoError(o);if(!r.node_ops.symlink)throw new vt.ErrnoError(63);return r.node_ops.symlink(r,n,t)},rename(t,e){var r,n,o=nt.dirname(t),i=nt.dirname(e),a=nt.basename(t),s=nt.basename(e);if(r=vt.lookupPath(t,{parent:!0}).node,n=vt.lookupPath(e,{parent:!0}).node,!r||!n)throw new vt.ErrnoError(44);if(r.mount!==n.mount)throw new vt.ErrnoError(75);var u,c=vt.lookupNode(r,a),l=it.relative(t,i);if("."!==l.charAt(0))throw new vt.ErrnoError(28);if("."!==(l=it.relative(e,o)).charAt(0))throw new vt.ErrnoError(55);try{u=vt.lookupNode(n,s)}catch(t){}if(c!==u){var d=vt.isDir(c.mode),h=vt.mayDelete(r,a,d);if(h)throw new vt.ErrnoError(h);if(h=u?vt.mayDelete(n,s,d):vt.mayCreate(n,s))throw new vt.ErrnoError(h);if(!r.node_ops.rename)throw new vt.ErrnoError(63);if(vt.isMountpoint(c)||u&&vt.isMountpoint(u))throw new vt.ErrnoError(10);if(n!==r&&(h=vt.nodePermissions(r,"w")))throw new vt.ErrnoError(h);vt.hashRemoveNode(c);try{r.node_ops.rename(c,n,s)}catch(t){throw t}finally{vt.hashAddNode(c)}}},rmdir(t){var e=vt.lookupPath(t,{parent:!0}).node,r=nt.basename(t),n=vt.lookupNode(e,r),o=vt.mayDelete(e,r,!0);if(o)throw new vt.ErrnoError(o);if(!e.node_ops.rmdir)throw new vt.ErrnoError(63);if(vt.isMountpoint(n))throw new vt.ErrnoError(10);e.node_ops.rmdir(e,r),vt.destroyNode(n)},readdir(t){var e=vt.lookupPath(t,{follow:!0}).node;if(!e.node_ops.readdir)throw new vt.ErrnoError(54);return e.node_ops.readdir(e)},unlink(t){var e=vt.lookupPath(t,{parent:!0}).node;if(!e)throw new vt.ErrnoError(44);var r=nt.basename(t),n=vt.lookupNode(e,r),o=vt.mayDelete(e,r,!1);if(o)throw new vt.ErrnoError(o);if(!e.node_ops.unlink)throw new vt.ErrnoError(63);if(vt.isMountpoint(n))throw new vt.ErrnoError(10);e.node_ops.unlink(e,r),vt.destroyNode(n)},readlink(t){var e=vt.lookupPath(t).node;if(!e)throw new vt.ErrnoError(44);if(!e.node_ops.readlink)throw new vt.ErrnoError(28);return it.resolve(vt.getPath(e.parent),e.node_ops.readlink(e))},stat(t,e){var r=vt.lookupPath(t,{follow:!e}).node;if(!r)throw new vt.ErrnoError(44);if(!r.node_ops.getattr)throw new vt.ErrnoError(63);return r.node_ops.getattr(r)},lstat:t=>vt.stat(t,!0),chmod(t,e,r){var n;if(!(n="string"==typeof t?vt.lookupPath(t,{follow:!r}).node:t).node_ops.setattr)throw new vt.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&e|-4096&n.mode,timestamp:Date.now()})},lchmod(t,e){vt.chmod(t,e,!0)},fchmod(t,e){var r=vt.getStreamChecked(t);vt.chmod(r.node,e)},chown(t,e,r,n){var o;if(!(o="string"==typeof t?vt.lookupPath(t,{follow:!n}).node:t).node_ops.setattr)throw new vt.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(t,e,r){vt.chown(t,e,r,!0)},fchown(t,e,r){var n=vt.getStreamChecked(t);vt.chown(n.node,e,r)},truncate(t,e){if(e<0)throw new vt.ErrnoError(28);var r;if(!(r="string"==typeof t?vt.lookupPath(t,{follow:!0}).node:t).node_ops.setattr)throw new vt.ErrnoError(63);if(vt.isDir(r.mode))throw new vt.ErrnoError(31);if(!vt.isFile(r.mode))throw new vt.ErrnoError(28);var n=vt.nodePermissions(r,"w");if(n)throw new vt.ErrnoError(n);r.node_ops.setattr(r,{size:e,timestamp:Date.now()})},ftruncate(t,e){var r=vt.getStreamChecked(t);if(0==(2097155&r.flags))throw new vt.ErrnoError(28);vt.truncate(r.node,e)},utime(t,e,r){var n=vt.lookupPath(t,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(e,r)})},open(t,e,r){if(""===t)throw new vt.ErrnoError(44);var n;if(r="undefined"==typeof r?438:r,r=64&(e="string"==typeof e?(t=>{var e={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[t];if("undefined"==typeof e)throw new Error(`Unknown file open mode: ${t}`);return e})(e):e)?4095&r|32768:0,"object"==typeof t)n=t;else{t=nt.normalize(t);try{n=vt.lookupPath(t,{follow:!(131072&e)}).node}catch(t){}}var o=!1;if(64&e)if(n){if(128&e)throw new vt.ErrnoError(20)}else n=vt.mknod(t,r,0),o=!0;if(!n)throw new vt.ErrnoError(44);if(vt.isChrdev(n.mode)&&(e&=-513),65536&e&&!vt.isDir(n.mode))throw new vt.ErrnoError(54);if(!o){var a=vt.mayOpen(n,e);if(a)throw new vt.ErrnoError(a)}512&e&&!o&&vt.truncate(n,0),e&=-131713;var s=vt.createStream({node:n,path:vt.getPath(n),flags:e,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!i.logReadFiles||1&e||(vt.readFiles||(vt.readFiles={}),t in vt.readFiles||(vt.readFiles[t]=1)),s},close(t){if(vt.isClosed(t))throw new vt.ErrnoError(8);t.getdents&&(t.getdents=null);try{t.stream_ops.close&&t.stream_ops.close(t)}catch(t){throw t}finally{vt.closeStream(t.fd)}t.fd=null},isClosed:t=>null===t.fd,llseek(t,e,r){if(vt.isClosed(t))throw new vt.ErrnoError(8);if(!t.seekable||!t.stream_ops.llseek)throw new vt.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new vt.ErrnoError(28);return t.position=t.stream_ops.llseek(t,e,r),t.ungotten=[],t.position},read(t,e,r,n,o){if(n<0||o<0)throw new vt.ErrnoError(28);if(vt.isClosed(t))throw new vt.ErrnoError(8);if(1==(2097155&t.flags))throw new vt.ErrnoError(8);if(vt.isDir(t.node.mode))throw new vt.ErrnoError(31);if(!t.stream_ops.read)throw new vt.ErrnoError(28);var i="undefined"!=typeof o;if(i){if(!t.seekable)throw new vt.ErrnoError(70)}else o=t.position;var a=t.stream_ops.read(t,e,r,n,o);return i||(t.position+=a),a},write(t,e,r,n,o,i){if(n<0||o<0)throw new vt.ErrnoError(28);if(vt.isClosed(t))throw new vt.ErrnoError(8);if(0==(2097155&t.flags))throw new vt.ErrnoError(8);if(vt.isDir(t.node.mode))throw new vt.ErrnoError(31);if(!t.stream_ops.write)throw new vt.ErrnoError(28);t.seekable&&1024&t.flags&&vt.llseek(t,0,2);var a="undefined"!=typeof o;if(a){if(!t.seekable)throw new vt.ErrnoError(70)}else o=t.position;var s=t.stream_ops.write(t,e,r,n,o,i);return a||(t.position+=s),s},allocate(t,e,r){if(vt.isClosed(t))throw new vt.ErrnoError(8);if(e<0||r<=0)throw new vt.ErrnoError(28);if(0==(2097155&t.flags))throw new vt.ErrnoError(8);if(!vt.isFile(t.node.mode)&&!vt.isDir(t.node.mode))throw new vt.ErrnoError(43);if(!t.stream_ops.allocate)throw new vt.ErrnoError(138);t.stream_ops.allocate(t,e,r)},mmap(t,e,r,n,o){if(0!=(2&n)&&0==(2&o)&&2!=(2097155&t.flags))throw new vt.ErrnoError(2);if(1==(2097155&t.flags))throw new vt.ErrnoError(2);if(!t.stream_ops.mmap)throw new vt.ErrnoError(43);return t.stream_ops.mmap(t,e,r,n,o)},msync:(t,e,r,n,o)=>t.stream_ops.msync?t.stream_ops.msync(t,e,r,n,o):0,munmap:t=>0,ioctl(t,e,r){if(!t.stream_ops.ioctl)throw new vt.ErrnoError(59);return t.stream_ops.ioctl(t,e,r)},readFile(t,e={}){if(e.flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding)throw new Error(`Invalid encoding type "${e.encoding}"`);var r,n=vt.open(t,e.flags),o=vt.stat(t).size,i=new Uint8Array(o);return vt.read(n,i,0,o,0),"utf8"===e.encoding?r=G(i,0):"binary"===e.encoding&&(r=i),vt.close(n),r},writeFile(t,e,r={}){r.flags=r.flags||577;var n=vt.open(t,r.flags,r.mode);if("string"==typeof e){var o=new Uint8Array(st(e)+1),i=ut(e,o,0,o.length);vt.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");vt.write(n,e,0,e.byteLength,void 0,r.canOwn)}vt.close(n)},cwd:()=>vt.currentPath,chdir(t){var e=vt.lookupPath(t,{follow:!0});if(null===e.node)throw new vt.ErrnoError(44);if(!vt.isDir(e.node.mode))throw new vt.ErrnoError(54);var r=vt.nodePermissions(e.node,"x");if(r)throw new vt.ErrnoError(r);vt.currentPath=e.path},createDefaultDirectories(){vt.mkdir("/tmp"),vt.mkdir("/home"),vt.mkdir("/home/web_user")},createDefaultDevices(){vt.mkdir("/dev"),vt.registerDevice(vt.makedev(1,3),{read:()=>0,write:(t,e,r,n,o)=>n}),vt.mkdev("/dev/null",vt.makedev(1,3)),lt.register(vt.makedev(5,0),lt.default_tty_ops),lt.register(vt.makedev(6,0),lt.default_tty1_ops),vt.mkdev("/dev/tty",vt.makedev(5,0)),vt.mkdev("/dev/tty1",vt.makedev(6,0));var t=new Uint8Array(1024),e=0,r=()=>(0===e&&(e=ot(t).byteLength),t[--e]);vt.createDevice("/dev","random",r),vt.createDevice("/dev","urandom",r),vt.mkdir("/dev/shm"),vt.mkdir("/dev/shm/tmp")},createSpecialDirectories(){vt.mkdir("/proc");var t=vt.mkdir("/proc/self");vt.mkdir("/proc/self/fd"),vt.mount({mount(){var e=vt.createNode(t,"fd",16895,73);return e.node_ops={lookup(t,e){var r=+e,n=vt.getStreamChecked(r),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},e}},{},"/proc/self/fd")},createStandardStreams(){i.stdin?vt.createDevice("/dev","stdin",i.stdin):vt.symlink("/dev/tty","/dev/stdin"),i.stdout?vt.createDevice("/dev","stdout",null,i.stdout):vt.symlink("/dev/tty","/dev/stdout"),i.stderr?vt.createDevice("/dev","stderr",null,i.stderr):vt.symlink("/dev/tty1","/dev/stderr"),vt.open("/dev/stdin",0),vt.open("/dev/stdout",1),vt.open("/dev/stderr",1)},ensureErrnoError(){vt.ErrnoError||(vt.ErrnoError=function(t,e){this.name="ErrnoError",this.node=e,this.setErrno=function(t){this.errno=t},this.setErrno(t),this.message="FS error"},vt.ErrnoError.prototype=new Error,vt.ErrnoError.prototype.constructor=vt.ErrnoError,[44].forEach((t=>{vt.genericErrors[t]=new vt.ErrnoError(t),vt.genericErrors[t].stack="<generic error, no stack>"})))},staticInit(){vt.ensureErrnoError(),vt.nameTable=new Array(4096),vt.mount(ht,{},"/"),vt.createDefaultDirectories(),vt.createDefaultDevices(),vt.createSpecialDirectories(),vt.filesystems={MEMFS:ht}},init(t,e,r){vt.init.initialized=!0,vt.ensureErrnoError(),i.stdin=t||i.stdin,i.stdout=e||i.stdout,i.stderr=r||i.stderr,vt.createStandardStreams()},quit(){vt.init.initialized=!1;for(var t=0;t<vt.streams.length;t++){var e=vt.streams[t];e&&vt.close(e)}},findObject(t,e){var r=vt.analyzePath(t,e);return r.exists?r.object:null},analyzePath(t,e){try{t=(n=vt.lookupPath(t,{follow:!e})).path}catch(t){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=vt.lookupPath(t,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=nt.basename(t),n=vt.lookupPath(t,{follow:!e}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(t){r.error=t.errno}return r},createPath(t,e,r,n){t="string"==typeof t?t:vt.getPath(t);for(var o=e.split("/").reverse();o.length;){var i=o.pop();if(i){var a=nt.join2(t,i);try{vt.mkdir(a)}catch(t){}t=a}}return a},createFile(t,e,r,n,o){var i=nt.join2("string"==typeof t?t:vt.getPath(t),e),a=mt(n,o);return vt.create(i,a)},createDataFile(t,e,r,n,o,i){var a=e;t&&(t="string"==typeof t?t:vt.getPath(t),a=e?nt.join2(t,e):t);var s=mt(n,o),u=vt.create(a,s);if(r){if("string"==typeof r){for(var c=new Array(r.length),l=0,d=r.length;l<d;++l)c[l]=r.charCodeAt(l);r=c}vt.chmod(u,146|s);var h=vt.open(u,577);vt.write(h,r,0,r.length,0,i),vt.close(h),vt.chmod(u,s)}return u},createDevice(t,e,r,n){var o=nt.join2("string"==typeof t?t:vt.getPath(t),e),i=mt(!!r,!!n);vt.createDevice.major||(vt.createDevice.major=64);var a=vt.makedev(vt.createDevice.major++,0);return vt.registerDevice(a,{open(t){t.seekable=!1},close(t){n&&n.buffer&&n.buffer.length&&n(10)},read(t,e,n,o,i){for(var a=0,s=0;s<o;s++){var u;try{u=r()}catch(t){throw new vt.ErrnoError(29)}if(void 0===u&&0===a)throw new vt.ErrnoError(6);if(null==u)break;a++,e[n+s]=u}return a&&(t.node.timestamp=Date.now()),a},write(t,e,r,o,i){for(var a=0;a<o;a++)try{n(e[r+a])}catch(t){throw new vt.ErrnoError(29)}return o&&(t.node.timestamp=Date.now()),a}}),vt.mkdev(o,i,a)},forceLoadFile(t){if(t.isDevice||t.isFolder||t.link||t.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!a)throw new Error("Cannot load without read() or XMLHttpRequest.");try{t.contents=ct(a(t.url),!0),t.usedBytes=t.contents.length}catch(t){throw new vt.ErrnoError(29)}},createLazyFile(t,e,r,n,o){function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(t){if(!(t>this.length-1||t<0)){var e=t%this.chunkSize,r=t/this.chunkSize|0;return this.getter(r)[e]}},i.prototype.setDataGetter=function(t){this.getter=t},i.prototype.cacheLength=function(){var t=new XMLHttpRequest;if(t.open("HEAD",r,!1),t.send(null),!(t.status>=200&&t.status<300||304===t.status))throw new Error("Couldn't load "+r+". Status: "+t.status);var e,n=Number(t.getResponseHeader("Content-length")),o=(e=t.getResponseHeader("Accept-Ranges"))&&"bytes"===e,i=(e=t.getResponseHeader("Content-Encoding"))&&"gzip"===e,a=1048576;o||(a=n);var s=this;s.setDataGetter((t=>{var e=t*a,o=(t+1)*a-1;if(o=Math.min(o,n-1),"undefined"==typeof s.chunks[t]&&(s.chunks[t]=((t,e)=>{if(t>e)throw new Error("invalid range ("+t+", "+e+") or no bytes requested!");if(e>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==a&&o.setRequestHeader("Range","bytes="+t+"-"+e),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):ct(o.responseText||"",!0)})(e,o)),"undefined"==typeof s.chunks[t])throw new Error("doXHR failed!");return s.chunks[t]})),!i&&n||(a=n=1,n=this.getter(0).length,a=n,p("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:a}}else s={isDevice:!1,url:r};var u=vt.createFile(t,e,s,n,o);s.contents?u.contents=s.contents:s.url&&(u.contents=null,u.url=s.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var c={};function l(t,e,r,n,o){var i=t.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var s=0;s<a;s++)e[r+s]=i[o+s];else for(s=0;s<a;s++)e[r+s]=i.get(o+s);return a}return Object.keys(u.stream_ops).forEach((t=>{var e=u.stream_ops[t];c[t]=function(){return vt.forceLoadFile(u),e.apply(null,arguments)}})),c.read=(t,e,r,n,o)=>(vt.forceLoadFile(u),l(t,e,r,n,o)),c.mmap=(t,e,r,n,o)=>{vt.forceLoadFile(u);var i=dt(e);if(!i)throw new vt.ErrnoError(48);return l(t,g,i,e,r),{ptr:i,allocated:!0}},u.stream_ops=c,u}},yt={DEFAULT_POLLMASK:5,calculateAt(t,e,r){if(nt.isAbs(e))return e;var n;if(n=-100===t?vt.cwd():yt.getStreamFromFD(t).path,0==e.length){if(!r)throw new vt.ErrnoError(44);return n}return nt.join2(n,e)},doStat(t,e,r){try{var n=t(e)}catch(t){if(t&&t.node&&nt.normalize(e)!==nt.normalize(vt.getPath(t.node)))return-54;throw t}_[r>>2]=n.dev,_[r+4>>2]=n.mode,k[r+8>>2]=n.nlink,_[r+12>>2]=n.uid,_[r+16>>2]=n.gid,_[r+20>>2]=n.rdev,D=[n.size>>>0,(j=n.size,+Math.abs(j)>=1?j>0?+Math.floor(j/4294967296)>>>0:~~+Math.ceil((j-+(~~j>>>0))/4294967296)>>>0:0)],_[r+24>>2]=D[0],_[r+28>>2]=D[1],_[r+32>>2]=4096,_[r+36>>2]=n.blocks;var o=n.atime.getTime(),i=n.mtime.getTime(),a=n.ctime.getTime();return D=[Math.floor(o/1e3)>>>0,(j=Math.floor(o/1e3),+Math.abs(j)>=1?j>0?+Math.floor(j/4294967296)>>>0:~~+Math.ceil((j-+(~~j>>>0))/4294967296)>>>0:0)],_[r+40>>2]=D[0],_[r+44>>2]=D[1],k[r+48>>2]=o%1e3*1e3,D=[Math.floor(i/1e3)>>>0,(j=Math.floor(i/1e3),+Math.abs(j)>=1?j>0?+Math.floor(j/4294967296)>>>0:~~+Math.ceil((j-+(~~j>>>0))/4294967296)>>>0:0)],_[r+56>>2]=D[0],_[r+60>>2]=D[1],k[r+64>>2]=i%1e3*1e3,D=[Math.floor(a/1e3)>>>0,(j=Math.floor(a/1e3),+Math.abs(j)>=1?j>0?+Math.floor(j/4294967296)>>>0:~~+Math.ceil((j-+(~~j>>>0))/4294967296)>>>0:0)],_[r+72>>2]=D[0],_[r+76>>2]=D[1],k[r+80>>2]=a%1e3*1e3,D=[n.ino>>>0,(j=n.ino,+Math.abs(j)>=1?j>0?+Math.floor(j/4294967296)>>>0:~~+Math.ceil((j-+(~~j>>>0))/4294967296)>>>0:0)],_[r+88>>2]=D[0],_[r+92>>2]=D[1],0},doMsync(t,e,r,n,o){if(!vt.isFile(e.node.mode))throw new vt.ErrnoError(43);if(2&n)return 0;var i=w.slice(t,t+r);vt.msync(e,i,o,r,n)},varargs:void 0,get(){var t=_[yt.varargs>>2];return yt.varargs+=4,t},getp:()=>yt.get(),getStr:t=>K(t),getStreamFromFD:t=>vt.getStreamChecked(t)},gt=(t,e)=>e+2097152>>>0<4194305-!!t?(t>>>0)+4294967296*e:NaN,wt=(t,e,r)=>ut(t,w,e,r),bt=void 0,Et=t=>{for(var e="",r=t;w[r];)e+=bt[w[r++]];return e},_t={},kt={},Ct={},Mt=void 0,$t=t=>{throw new Mt(t)},Pt=void 0,St=t=>{throw new Pt(t)},Ft=(t,e,r)=>{function n(e){var n=r(e);n.length!==t.length&&St("Mismatched type converter count");for(var o=0;o<t.length;++o)Tt(t[o],n[o])}t.forEach((function(t){Ct[t]=e}));var o=new Array(e.length),i=[],a=0;e.forEach(((t,e)=>{kt.hasOwnProperty(t)?o[e]=kt[t]:(i.push(t),_t.hasOwnProperty(t)||(_t[t]=[]),_t[t].push((()=>{o[e]=kt[t],++a===i.length&&n(o)})))})),0===i.length&&n(o)};function Tt(t,e,r={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(t,e,r={}){var n=e.name;if(t||$t(`type "${n}" must have a positive integer typeid pointer`),kt.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;$t(`Cannot register type '${n}' twice`)}if(kt[t]=e,delete Ct[t],_t.hasOwnProperty(t)){var o=_t[t];delete _t[t],o.forEach((t=>t()))}}(t,e,r)}function jt(t){if(!(this instanceof Zt))return!1;if(!(t instanceof Zt))return!1;for(var e=this.$$.ptrType.registeredClass,r=this.$$.ptr,n=t.$$.ptrType.registeredClass,o=t.$$.ptr;e.baseClass;)r=e.upcast(r),e=e.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return e===n&&r===o}var Dt=t=>{$t(t.$$.ptrType.registeredClass.name+" instance already deleted")},Wt=!1,At=t=>{},xt=t=>{t.count.value-=1,0===t.count.value&&(t=>{t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)})(t)},Ot=(t,e,r)=>{if(e===r)return t;if(void 0===r.baseClass)return null;var n=Ot(t,e,r.baseClass);return null===n?null:r.downcast(n)},It={},zt=()=>Object.keys(Ht).length,Rt=()=>{var t=[];for(var e in Ht)Ht.hasOwnProperty(e)&&t.push(Ht[e]);return t},Nt=[],Ut=()=>{for(;Nt.length;){var t=Nt.pop();t.$$.deleteScheduled=!1,t.delete()}},Bt=void 0,Lt=t=>{Bt=t,Nt.length&&Bt&&Bt(Ut)},Ht={},Vt=(t,e)=>(e=((t,e)=>{for(void 0===e&&$t("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e})(t,e),Ht[e]),Yt=(t,e)=>(e.ptrType&&e.ptr||St("makeClassHandle requires ptr and ptrType"),!!e.smartPtrType!=!!e.smartPtr&&St("Both smartPtrType and smartPtr must be specified"),e.count={value:1},Qt(Object.create(t,{$$:{value:e}})));function qt(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=Vt(this.registeredClass,e);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=e,r.$$.smartPtr=t,r.clone();var n=r.clone();return this.destructor(t),n}function o(){return this.isSmartPointer?Yt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):Yt(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var i,a=this.registeredClass.getActualType(e),s=It[a];if(!s)return o.call(this);i=this.isConst?s.constPointerType:s.pointerType;var u=Ot(e,this.registeredClass,i.registeredClass);return null===u?o.call(this):this.isSmartPointer?Yt(i.registeredClass.instancePrototype,{ptrType:i,ptr:u,smartPtrType:this,smartPtr:t}):Yt(i.registeredClass.instancePrototype,{ptrType:i,ptr:u})}var Qt=t=>"undefined"==typeof FinalizationRegistry?(Qt=t=>t,t):(Wt=new FinalizationRegistry((t=>{xt(t.$$)})),Qt=t=>{var e=t.$$;if(e.smartPtr){var r={$$:e};Wt.register(t,r,t)}return t},At=t=>Wt.unregister(t),Qt(t));function Gt(){if(this.$$.ptr||Dt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t,e=Qt(Object.create(Object.getPrototypeOf(this),{$$:{value:(t=this.$$,{count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType})}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e}function Kt(){this.$$.ptr||Dt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&$t("Object already scheduled for deletion"),At(this),xt(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function Xt(){return!this.$$.ptr}function Jt(){return this.$$.ptr||Dt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&$t("Object already scheduled for deletion"),Nt.push(this),1===Nt.length&&Bt&&Bt(Ut),this.$$.deleteScheduled=!0,this}function Zt(){}var te=t=>{if(void 0===t)return"_unknown";var e=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return e>=48&&e<=57?`_${t}`:t};function ee(t,e){return{[t=te(t)]:function(){return e.apply(this,arguments)}}[t]}var re=(t,e,r)=>{if(void 0===t[e].overloadTable){var n=t[e];t[e]=function(){return t[e].overloadTable.hasOwnProperty(arguments.length)||$t(`Function '${r}' called with an invalid number of arguments (${arguments.length}) - expects one of (${t[e].overloadTable})!`),t[e].overloadTable[arguments.length].apply(this,arguments)},t[e].overloadTable=[],t[e].overloadTable[n.argCount]=n}},ne=(t,e,r)=>{i.hasOwnProperty(t)?((void 0===r||void 0!==i[t].overloadTable&&void 0!==i[t].overloadTable[r])&&$t(`Cannot register public name '${t}' twice`),re(i,t,t),i.hasOwnProperty(r)&&$t(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),i[t].overloadTable[r]=e):(i[t]=e,void 0!==r&&(i[t].numArguments=r))};function oe(t,e,r,n,o,i,a,s){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=i,this.upcast=a,this.downcast=s,this.pureVirtualFunctions=[]}var ie=(t,e,r)=>{for(;e!==r;)e.upcast||$t(`Expected null or instance of ${r.name}, got an instance of ${e.name}`),t=e.upcast(t),e=e.baseClass;return t};function ae(t,e){if(null===e)return this.isReference&&$t(`null is not a valid ${this.name}`),0;e.$$||$t(`Cannot pass "${je(e)}" as a ${this.name}`),e.$$.ptr||$t(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=e.$$.ptrType.registeredClass;return ie(e.$$.ptr,r,this.registeredClass)}function se(t,e){var r;if(null===e)return this.isReference&&$t(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),null!==t&&t.push(this.rawDestructor,r),r):0;e.$$||$t(`Cannot pass "${je(e)}" as a ${this.name}`),e.$$.ptr||$t(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&e.$$.ptrType.isConst&&$t(`Cannot convert argument of type ${e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name} to parameter type ${this.name}`);var n=e.$$.ptrType.registeredClass;if(r=ie(e.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===e.$$.smartPtr&&$t("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:e.$$.smartPtrType===this?r=e.$$.smartPtr:$t(`Cannot convert argument of type ${e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=e.$$.smartPtr;break;case 2:if(e.$$.smartPtrType===this)r=e.$$.smartPtr;else{var o=e.clone();r=this.rawShare(r,Se.toHandle((()=>o.delete()))),null!==t&&t.push(this.rawDestructor,r)}break;default:$t("Unsupporting sharing policy")}return r}function ue(t,e){if(null===e)return this.isReference&&$t(`null is not a valid ${this.name}`),0;e.$$||$t(`Cannot pass "${je(e)}" as a ${this.name}`),e.$$.ptr||$t(`Cannot pass deleted object as a pointer of type ${this.name}`),e.$$.ptrType.isConst&&$t(`Cannot convert argument of type ${e.$$.ptrType.name} to parameter type ${this.name}`);var r=e.$$.ptrType.registeredClass;return ie(e.$$.ptr,r,this.registeredClass)}function ce(t){return this.fromWireType(k[t>>2])}function le(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t}function de(t){this.rawDestructor&&this.rawDestructor(t)}var he=t=>{null!==t&&t.delete()};function fe(t,e,r,n,o,i,a,s,u,c,l){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=a,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=c,this.rawDestructor=l,o||void 0!==e.baseClass?this.toWireType=se:n?(this.toWireType=ae,this.destructorFunction=null):(this.toWireType=ue,this.destructorFunction=null)}var pe=(t,e,r)=>{i.hasOwnProperty(t)||St("Replacing nonexistant public symbol"),void 0!==i[t].overloadTable&&void 0!==r?i[t].overloadTable[r]=e:(i[t]=e,i[t].argCount=r)},me=t=>$.get(t),ve=(t,e,r)=>t.includes("j")?((t,e,r)=>{var n=i["dynCall_"+t];return r&&r.length?n.apply(null,[e].concat(r)):n.call(null,e)})(t,e,r):me(e).apply(null,r),ye=(t,e)=>{var r,n,o,i=(t=Et(t)).includes("j")?(r=t,n=e,o=[],function(){return o.length=0,Object.assign(o,arguments),ve(r,n,o)}):me(e);return"function"!=typeof i&&$t(`unknown function pointer with signature ${t}: ${e}`),i},ge=void 0,we=t=>{var e=_r(t),r=Et(e);return wr(e),r},be=(t,e)=>{var r=[],n={};throw e.forEach((function t(e){n[e]||kt[e]||(Ct[e]?Ct[e].forEach(t):(r.push(e),n[e]=!0))})),new ge(`${t}: `+r.map(we).join([", "]))},Ee=t=>{for(;t.length;){var e=t.pop();t.pop()(e)}};function _e(t,e,r,n,o,i){var a=e.length;a<2&&$t("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var s=null!==e[1]&&null!==r,u=!1,c=1;c<e.length;++c)if(null!==e[c]&&void 0===e[c].destructorFunction){u=!0;break}var l="void"!==e[0].name,d=a-2,h=new Array(d),f=[],p=[];return function(){var r;arguments.length!==d&&$t(`function ${t} called with ${arguments.length} arguments, expected ${d}`),p.length=0,f.length=s?2:1,f[0]=o,s&&(r=e[1].toWireType(p,this),f[1]=r);for(var i=0;i<d;++i)h[i]=e[i+2].toWireType(p,arguments[i]),f.push(h[i]);var a=n.apply(null,f);function c(t){if(u)Ee(p);else for(var n=s?1:2;n<e.length;n++){var o=1===n?r:h[n-2];null!==e[n].destructorFunction&&e[n].destructorFunction(o)}if(l)return e[0].fromWireType(t)}return c(a)}}var ke=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(k[e+4*n>>2]);return r};function Ce(){this.allocated=[void 0],this.freelist=[]}var Me=new Ce,$e=t=>{t>=Me.reserved&&0==--Me.get(t).refcount&&Me.free(t)},Pe=()=>{for(var t=0,e=Me.reserved;e<Me.allocated.length;++e)void 0!==Me.allocated[e]&&++t;return t},Se={toValue:t=>(t||$t("Cannot use deleted val. handle = "+t),Me.get(t).value),toHandle:t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return Me.allocate({refcount:1,value:t})}}};function Fe(t){return this.fromWireType(_[t>>2])}var Te,je=t=>{if(null===t)return"null";var e=typeof t;return"object"===e||"array"===e||"function"===e?t.toString():""+t},De=(t,e)=>{switch(e){case 4:return function(t){return this.fromWireType(C[t>>2])};case 8:return function(t){return this.fromWireType(M[t>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},We=(t,e,r)=>{switch(e){case 1:return r?t=>g[t>>0]:t=>w[t>>0];case 2:return r?t=>b[t>>1]:t=>E[t>>1];case 4:return r?t=>_[t>>2]:t=>k[t>>2];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},Ae="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,xe=(t,e)=>{for(var r=t,n=r>>1,o=n+e/2;!(n>=o)&&E[n];)++n;if((r=n<<1)-t>32&&Ae)return Ae.decode(w.subarray(t,r));for(var i="",a=0;!(a>=e/2);++a){var s=b[t+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i},Oe=(t,e,r)=>{if(void 0===r&&(r=2147483647),r<2)return 0;for(var n=e,o=(r-=2)<2*t.length?r/2:t.length,i=0;i<o;++i){var a=t.charCodeAt(i);b[e>>1]=a,e+=2}return b[e>>1]=0,e-n},Ie=t=>2*t.length,ze=(t,e)=>{for(var r=0,n="";!(r>=e/4);){var o=_[t+4*r>>2];if(0==o)break;if(++r,o>=65536){var i=o-65536;n+=String.fromCharCode(55296|i>>10,56320|1023&i)}else n+=String.fromCharCode(o)}return n},Re=(t,e,r)=>{if(void 0===r&&(r=2147483647),r<4)return 0;for(var n=e,o=n+r-4,i=0;i<t.length;++i){var a=t.charCodeAt(i);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++i)),_[e>>2]=a,(e+=4)+4>o)break}return _[e>>2]=0,e-n},Ne=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n>=55296&&n<=57343&&++r,e+=4}return e},Ue=(t,e)=>{var r=kt[t];return void 0===r&&$t(e+" has unknown type "+we(t)),r},Be={},Le=t=>{var e=Be[t];return void 0===e?Et(t):e},He=[],Ve=()=>{if("object"==typeof globalThis)return globalThis;function t(t){t.$$$embind_global$$$=t;var e="object"==typeof $$$embind_global$$$&&t.$$$embind_global$$$==t;return e||delete t.$$$embind_global$$$,e}if("object"==typeof $$$embind_global$$$)return $$$embind_global$$$;if("object"==typeof r.g&&t(r.g)?$$$embind_global$$$=r.g:"object"==typeof self&&t(self)&&($$$embind_global$$$=self),"object"==typeof $$$embind_global$$$)return $$$embind_global$$$;throw Error("unable to get global object.")},Ye=[],qe=t=>t%4==0&&(t%100!=0||t%400==0),Qe=[0,31,60,91,121,152,182,213,244,274,305,335],Ge=[0,31,59,90,120,151,181,212,243,273,304,334],Ke=t=>{var e=st(t)+1,r=gr(e);return r&&wt(t,r,e),r},Xe=[],Je=(t,e,r)=>{var n=((t,e)=>{var r;for(Xe.length=0;r=w[t++];)e+=105!=r&&e%8?4:0,Xe.push(105==r?_[e>>2]:M[e>>3]),e+=105==r?4:8;return Xe})(e,r);return V[t].apply(null,n)};Te=()=>performance.now();var Ze,tr,er,rr=t=>{U("OOM")},nr=t=>{var e=(t-v.buffer.byteLength+65535)/65536;try{return v.grow(e),S(),1}catch(t){}},or={},ir=()=>{if(!ir.strings){var t={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",_:l||"./this.program"};for(var e in or)void 0===or[e]?delete t[e]:t[e]=or[e];var r=[];for(var e in t)r.push(`${e}=${t[e]}`);ir.strings=r}return ir.strings},ar=t=>{y||(i.onExit&&i.onExit(t),P=!0),d(t,new Y(t))},sr=(t,e)=>{ar(t)},ur=[31,29,31,30,31,30,31,31,30,31,30,31],cr=[31,28,31,30,31,30,31,31,30,31,30,31],lr=(t,e,r,n)=>{var o=k[n+40>>2],i={tm_sec:_[n>>2],tm_min:_[n+4>>2],tm_hour:_[n+8>>2],tm_mday:_[n+12>>2],tm_mon:_[n+16>>2],tm_year:_[n+20>>2],tm_wday:_[n+24>>2],tm_yday:_[n+28>>2],tm_isdst:_[n+32>>2],tm_gmtoff:_[n+36>>2],tm_zone:o?K(o):""},a=K(r),s={"%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"};for(var u in s)a=a.replace(new RegExp(u,"g"),s[u]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],l=["January","February","March","April","May","June","July","August","September","October","November","December"];function d(t,e,r){for(var n="number"==typeof t?t.toString():t||"";n.length<e;)n=r[0]+n;return n}function h(t,e){return d(t,e,"0")}function f(t,e){function r(t){return t<0?-1:t>0?1:0}var n;return 0===(n=r(t.getFullYear()-e.getFullYear()))&&0===(n=r(t.getMonth()-e.getMonth()))&&(n=r(t.getDate()-e.getDate())),n}function p(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 m(t){var e=((t,e)=>{for(var r=new Date(t.getTime());e>0;){var n=qe(r.getFullYear()),o=r.getMonth(),i=(n?ur:cr)[o];if(!(e>i-r.getDate()))return r.setDate(r.getDate()+e),r;e-=i-r.getDate()+1,r.setDate(1),o<11?r.setMonth(o+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r})(new Date(t.tm_year+1900,0,1),t.tm_yday),r=new Date(e.getFullYear(),0,4),n=new Date(e.getFullYear()+1,0,4),o=p(r),i=p(n);return f(o,e)<=0?f(i,e)<=0?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var v={"%a":t=>c[t.tm_wday].substring(0,3),"%A":t=>c[t.tm_wday],"%b":t=>l[t.tm_mon].substring(0,3),"%B":t=>l[t.tm_mon],"%C":t=>h((t.tm_year+1900)/100|0,2),"%d":t=>h(t.tm_mday,2),"%e":t=>d(t.tm_mday,2," "),"%g":t=>m(t).toString().substring(2),"%G":t=>m(t),"%H":t=>h(t.tm_hour,2),"%I":t=>{var e=t.tm_hour;return 0==e?e=12:e>12&&(e-=12),h(e,2)},"%j":t=>h(t.tm_mday+((t,e)=>{for(var r=0,n=0;n<=e;r+=t[n++]);return r})(qe(t.tm_year+1900)?ur:cr,t.tm_mon-1),3),"%m":t=>h(t.tm_mon+1,2),"%M":t=>h(t.tm_min,2),"%n":()=>"\n","%p":t=>t.tm_hour>=0&&t.tm_hour<12?"AM":"PM","%S":t=>h(t.tm_sec,2),"%t":()=>"\t","%u":t=>t.tm_wday||7,"%U":t=>{var e=t.tm_yday+7-t.tm_wday;return h(Math.floor(e/7),2)},"%V":t=>{var e=Math.floor((t.tm_yday+7-(t.tm_wday+6)%7)/7);if((t.tm_wday+371-t.tm_yday-2)%7<=2&&e++,e){if(53==e){var r=(t.tm_wday+371-t.tm_yday)%7;4==r||3==r&&qe(t.tm_year)||(e=1)}}else{e=52;var n=(t.tm_wday+7-t.tm_yday-1)%7;(4==n||5==n&&qe(t.tm_year%400-1))&&e++}return h(e,2)},"%w":t=>t.tm_wday,"%W":t=>{var e=t.tm_yday+7-(t.tm_wday+6)%7;return h(Math.floor(e/7),2)},"%y":t=>(t.tm_year+1900).toString().substring(2),"%Y":t=>t.tm_year+1900,"%z":t=>{var e=t.tm_gmtoff,r=e>=0;return e=(e=Math.abs(e)/60)/60*100+e%60,(r?"+":"-")+String("0000"+e).slice(-4)},"%Z":t=>t.tm_zone,"%%":()=>"%"};for(var u in a=a.replace(/%%/g,"\0\0"),v)a.includes(u)&&(a=a.replace(new RegExp(u,"g"),v[u](i)));var y,w,b=ct(a=a.replace(/\0\0/g,"%"),!1);return b.length>e?0:(y=b,w=t,g.set(y,w),b.length-1)},dr=Ke,hr=function(t,e,r,n){t||(t=this),this.parent=t,this.mount=t.mount,this.mounted=null,this.id=vt.nextInode++,this.name=e,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},fr=365,pr=146;Object.defineProperties(hr.prototype,{read:{get:function(){return(this.mode&fr)===fr},set:function(t){t?this.mode|=fr:this.mode&=-366}},write:{get:function(){return(this.mode&pr)===pr},set:function(t){t?this.mode|=pr:this.mode&=-147}},isFolder:{get:function(){return vt.isDir(this.mode)}},isDevice:{get:function(){return vt.isChrdev(this.mode)}}}),vt.FSNode=hr,vt.createPreloadedFile=(t,e,r,n,o,i,a,s,u,c)=>{var l=e?it.resolve(nt.join2(t,e)):t;function d(r){function d(r){c&&c(),s||vt.createDataFile(t,e,r,n,o,u),i&&i(),N()}((t,e,r,n)=>{"undefined"!=typeof Browser&&Browser.init();var o=!1;return pt.forEach((i=>{o||i.canHandle(e)&&(i.handle(t,e,r,n),o=!0)})),o})(r,l,d,(()=>{a&&a(),N()}))||d(r)}R(),"string"==typeof r?ft(r,(t=>d(t)),a):d(r)},vt.staticInit(),(()=>{for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);bt=t})(),Mt=i.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},Pt=i.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},Zt.prototype.isAliasOf=jt,Zt.prototype.clone=Gt,Zt.prototype.delete=Kt,Zt.prototype.isDeleted=Xt,Zt.prototype.deleteLater=Jt,i.getInheritedInstanceCount=zt,i.getLiveInheritedInstances=Rt,i.flushPendingDeletes=Ut,i.setDelayFunction=Lt,fe.prototype.getPointee=le,fe.prototype.destructor=de,fe.prototype.argPackAdvance=8,fe.prototype.readValueFromPointer=ce,fe.prototype.deleteObject=he,fe.prototype.fromWireType=qt,ge=i.UnboundTypeError=(Ze=Error,(er=ee(tr="UnboundTypeError",(function(t){this.name=tr,this.message=t;var e=new Error(t).stack;void 0!==e&&(this.stack=this.toString()+"\n"+e.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(Ze.prototype),er.prototype.constructor=er,er.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},er),Object.assign(Ce.prototype,{get(t){return this.allocated[t]},has(t){return void 0!==this.allocated[t]},allocate(t){var e=this.freelist.pop()||this.allocated.length;return this.allocated[e]=t,e},free(t){this.allocated[t]=void 0,this.freelist.push(t)}}),Me.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),Me.reserved=Me.allocated.length,i.count_emval_handles=Pe;var mr,vr={l:(t,e,r,n)=>{U(`Assertion failed: ${K(t)}, at: `+[e?K(e):"unknown filename",r,n?K(n):"unknown function"])},t:t=>{var e=new tt(t);return e.get_caught()||(e.set_caught(!0),J--),e.set_rethrown(!1),X.push(e),Sr(e.excPtr),e.get_exception_ptr()},Bb:()=>{if(!X.length)return 0;var t=X[X.length-1];return Sr(t.excPtr),t.excPtr},v:()=>{Cr(0,0);var t=X.pop();Pr(t.excPtr),Z=0},a:()=>et([]),h:t=>et([t]),p:(t,e)=>et([t,e]),ja:rt,Ab:t=>{if(t){var e=new tt(t);X.push(e),e.set_rethrown(!0),rt()}},s:(t,e,r)=>{throw new tt(t).init(e,r),J++,Z=t},Cb:()=>J,b:t=>{throw Z||(Z=t),Z},Hb:function(t,e,r,n,o){try{for(var i=0,a=e?_[e>>2]:0,s=e?_[e+4>>2]:0,u=r?_[r>>2]:0,c=r?_[r+4>>2]:0,l=n?_[n>>2]:0,d=n?_[n+4>>2]:0,h=0,f=0,p=0,m=0,v=0,y=0,g=(e?_[e>>2]:0)|(r?_[r>>2]:0)|(n?_[n>>2]:0),w=(e?_[e+4>>2]:0)|(r?_[r+4>>2]:0)|(n?_[n+4>>2]:0),b=function(t,e,r,n){return t<32?e&n:r&n},E=0;E<t;E++){var k=1<<E%32;if(b(E,g,w,k)){var C=yt.getStreamFromFD(E),M=yt.DEFAULT_POLLMASK;if(C.stream_ops.poll){var $=-1;o&&($=1e3*((e?_[o>>2]:0)+(e?_[o+8>>2]:0)/1e6)),M=C.stream_ops.poll(C,$)}1&M&&b(E,a,s,k)&&(E<32?h|=k:f|=k,i++),4&M&&b(E,u,c,k)&&(E<32?p|=k:m|=k,i++),2&M&&b(E,l,d,k)&&(E<32?v|=k:y|=k,i++)}}return e&&(_[e>>2]=h,_[e+4>>2]=f),r&&(_[r>>2]=p,_[r+4>>2]=m),n&&(_[n>>2]=v,_[n+4>>2]=y),i}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},sb:function(t,e){try{return t=yt.getStr(t),vt.chmod(t,e),0}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},ub:function(t,e){try{return vt.fchmod(t,e),0}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},Aa:function(t,e,r){yt.varargs=r;try{var n=yt.getStreamFromFD(t);switch(e){case 0:if((o=yt.get())<0)return-28;for(;vt.streams[o];)o++;return vt.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=yt.get();return n.flags|=o,0;case 5:return o=yt.getp(),b[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return i=28,_[br()>>2]=i,-1}}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}var i},Rb:function(t,e){try{var r=yt.getStreamFromFD(t);return yt.doStat(vt.stat,r.path,e)}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},db:function(t,e,r){var n=gt(e,r);try{return isNaN(n)?61:(vt.ftruncate(t,n),0)}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},xb:function(t,e){try{if(0===e)return-28;var r=vt.cwd(),n=st(r)+1;return e<n?-68:(wt(r,t,e),n)}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},vb:function(t,e,r){try{var n=yt.getStreamFromFD(t);n.getdents||(n.getdents=vt.readdir(n.path));for(var o=280,i=0,a=vt.llseek(n,0,1),s=Math.floor(a/o);s<n.getdents.length&&i+o<=r;){var u,c,l=n.getdents[s];if("."===l)u=n.node.id,c=4;else if(".."===l)u=vt.lookupPath(n.path,{parent:!0}).node.id,c=4;else{var d=vt.lookupNode(n.node,l);u=d.id,c=vt.isChrdev(d.mode)?2:vt.isDir(d.mode)?4:vt.isLink(d.mode)?10:8}D=[u>>>0,(j=u,+Math.abs(j)>=1?j>0?+Math.floor(j/4294967296)>>>0:~~+Math.ceil((j-+(~~j>>>0))/4294967296)>>>0:0)],_[e+i>>2]=D[0],_[e+i+4>>2]=D[1],D=[(s+1)*o>>>0,(j=(s+1)*o,+Math.abs(j)>=1?j>0?+Math.floor(j/4294967296)>>>0:~~+Math.ceil((j-+(~~j>>>0))/4294967296)>>>0:0)],_[e+i+8>>2]=D[0],_[e+i+12>>2]=D[1],b[e+i+16>>1]=280,g[e+i+18>>0]=c,wt(l,e+i+19,256),i+=o,s+=1}return vt.llseek(n,s*o,0),i}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},Sb:function(t,e,r){yt.varargs=r;try{var n=yt.getStreamFromFD(t);switch(e){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.tty?0:-59;case 21505:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),i=yt.getp();_[i>>2]=o.c_iflag||0,_[i+4>>2]=o.c_oflag||0,_[i+8>>2]=o.c_cflag||0,_[i+12>>2]=o.c_lflag||0;for(var a=0;a<32;a++)g[i+a+17>>0]=o.c_cc[a]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){i=yt.getp();var s=_[i>>2],u=_[i+4>>2],c=_[i+8>>2],l=_[i+12>>2],d=[];for(a=0;a<32;a++)d.push(g[i+a+17>>0]);return n.tty.ops.ioctl_tcsets(n.tty,e,{c_iflag:s,c_oflag:u,c_cflag:c,c_lflag:l,c_cc:d})}return 0;case 21519:return n.tty?(i=yt.getp(),_[i>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return i=yt.getp(),vt.ioctl(n,e,i);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var h=n.tty.ops.ioctl_tiocgwinsz(n.tty);i=yt.getp(),b[i>>1]=h[0],b[i+2>>1]=h[1]}return 0;default:return-28}}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},Ob:function(t,e){try{return t=yt.getStr(t),yt.doStat(vt.lstat,t,e)}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},Kb:function(t,e,r){try{return e=yt.getStr(e),e=yt.calculateAt(t,e),"/"===(e=nt.normalize(e))[e.length-1]&&(e=e.substr(0,e.length-1)),vt.mkdir(e,r,0),0}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},Pb:function(t,e,r,n){try{e=yt.getStr(e);var o=256&n,i=4096&n;return n&=-6401,e=yt.calculateAt(t,e,i),yt.doStat(o?vt.lstat:vt.stat,e,r)}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},Ba:function(t,e,r,n){yt.varargs=n;try{e=yt.getStr(e),e=yt.calculateAt(t,e);var o=n?yt.get():0;return vt.open(e,r,o).fd}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},wb:function(t,e,r,n){try{if(e=yt.getStr(e),e=yt.calculateAt(t,e),n<=0)return-28;var o=vt.readlink(e),i=Math.min(n,st(o)),a=g[r+i];return wt(o,r,n+1),g[r+i]=a,i}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},Ib:function(t){try{return t=yt.getStr(t),vt.rmdir(t),0}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},Qb:function(t,e){try{return t=yt.getStr(t),yt.doStat(vt.stat,t,e)}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},rb:function(t,e){try{return t=yt.getStr(t),e=yt.getStr(e),vt.symlink(t,e),0}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},Jb:function(t,e,r){try{return e=yt.getStr(e),e=yt.calculateAt(t,e),0===r?vt.unlink(e):512===r?vt.rmdir(e):U("Invalid flags passed to unlinkat"),0}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},mb:(t,e,r,n,o)=>{},Ea:(t,e,r,n)=>{Tt(t,{name:e=Et(e),fromWireType:function(t){return!!t},toWireType:function(t,e){return e?r:n},argPackAdvance:8,readValueFromPointer:function(t){return this.fromWireType(w[t])},destructorFunction:null})},U:(t,e,r,n,o,i,a,s,u,c,l,d,h)=>{l=Et(l),i=ye(o,i),s&&(s=ye(a,s)),c&&(c=ye(u,c)),h=ye(d,h);var f=te(l);ne(f,(function(){be(`Cannot construct ${l} due to unbound types`,[n])})),Ft([t,e,r],n?[n]:[],(function(e){var r,o;e=e[0],o=n?(r=e.registeredClass).instancePrototype:Zt.prototype;var a=ee(f,(function(){if(Object.getPrototypeOf(this)!==u)throw new Mt("Use 'new' to construct "+l);if(void 0===d.constructor_body)throw new Mt(l+" has no accessible constructor");var t=d.constructor_body[arguments.length];if(void 0===t)throw new Mt(`Tried to invoke ctor of ${l} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(d.constructor_body).toString()}) parameters instead!`);return t.apply(this,arguments)})),u=Object.create(o,{constructor:{value:a}});a.prototype=u;var d=new oe(l,a,u,h,r,i,s,c);d.baseClass&&(void 0===d.baseClass.__derivedClasses&&(d.baseClass.__derivedClasses=[]),d.baseClass.__derivedClasses.push(d));var p=new fe(l,d,!0,!1,!1),m=new fe(l+"*",d,!1,!1,!1),v=new fe(l+" const*",d,!1,!0,!1);return It[t]={pointerType:m,constPointerType:v},pe(f,a),[p,m,v]}))},T:(t,e,r,n,o,i,a,s)=>{var u=ke(r,n);e=Et(e),i=ye(o,i),Ft([],[t],(function(t){var n=`${(t=t[0]).name}.${e}`;function o(){be(`Cannot call ${n} due to unbound types`,u)}e.startsWith("@@")&&(e=Symbol[e.substring(2)]);var s=t.registeredClass.constructor;return void 0===s[e]?(o.argCount=r-1,s[e]=o):(re(s,e,n),s[e].overloadTable[r-1]=o),Ft([],u,(function(o){var u=[o[0],null].concat(o.slice(1)),c=_e(n,u,null,i,a);if(void 0===s[e].overloadTable?(c.argCount=r-1,s[e]=c):s[e].overloadTable[r-1]=c,t.registeredClass.__derivedClasses)for(const r of t.registeredClass.__derivedClasses)r.constructor.hasOwnProperty(e)||(r.constructor[e]=c);return[]})),[]}))},D:(t,e,r,n,o,i,a,s,u)=>{var c=ke(r,n);e=Et(e),i=ye(o,i),Ft([],[t],(function(t){var n=`${(t=t[0]).name}.${e}`;function o(){be(`Cannot call ${n} due to unbound types`,c)}e.startsWith("@@")&&(e=Symbol[e.substring(2)]),s&&t.registeredClass.pureVirtualFunctions.push(e);var u=t.registeredClass.instancePrototype,l=u[e];return void 0===l||void 0===l.overloadTable&&l.className!==t.name&&l.argCount===r-2?(o.argCount=r-2,o.className=t.name,u[e]=o):(re(u,e,n),u[e].overloadTable[r-2]=o),Ft([],c,(function(o){var s=_e(n,o,t,i,a);return void 0===u[e].overloadTable?(s.argCount=r-2,u[e]=s):u[e].overloadTable[r-2]=s,[]})),[]}))},Vb:(t,e)=>{Tt(t,{name:e=Et(e),fromWireType:t=>{var e=Se.toValue(t);return $e(t),e},toWireType:(t,e)=>Se.toHandle(e),argPackAdvance:8,readValueFromPointer:Fe,destructorFunction:null})},Da:(t,e,r)=>{Tt(t,{name:e=Et(e),fromWireType:t=>t,toWireType:(t,e)=>e,argPackAdvance:8,readValueFromPointer:De(e,r),destructorFunction:null})},X:(t,e,r,n,o,i,a)=>{var s=ke(e,r);t=Et(t),o=ye(n,o),ne(t,(function(){be(`Cannot call ${t} due to unbound types`,s)}),e-1),Ft([],s,(function(r){var n=[r[0],null].concat(r.slice(1));return pe(t,_e(t,n,null,o,i),e-1),[]}))},L:(t,e,r,n,o)=>{e=Et(e),-1===o&&(o=4294967295);var i=t=>t;if(0===n){var a=32-8*r;i=t=>t<<a>>>a}var s=e.includes("unsigned");Tt(t,{name:e,fromWireType:i,toWireType:s?function(t,e){return this.name,e>>>0}:function(t,e){return this.name,e},argPackAdvance:8,readValueFromPointer:We(e,r,0!==n),destructorFunction:null})},E:(t,e,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];function o(t){var e=k[t>>2],r=k[t+4>>2];return new n(g.buffer,r,e)}Tt(t,{name:r=Et(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Ca:(t,e)=>{var r="std::string"===(e=Et(e));Tt(t,{name:e,fromWireType:t=>{var e,n=k[t>>2],o=t+4;if(r)for(var i=o,a=0;a<=n;++a){var s=o+a;if(a==n||0==w[s]){var u=K(i,s-i);void 0===e?e=u:(e+=String.fromCharCode(0),e+=u),i=s+1}}else{var c=new Array(n);for(a=0;a<n;++a)c[a]=String.fromCharCode(w[o+a]);e=c.join("")}return wr(t),e},toWireType:(t,e)=>{var n;e instanceof ArrayBuffer&&(e=new Uint8Array(e));var o="string"==typeof e;o||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array||$t("Cannot pass non-string to std::string"),n=r&&o?st(e):e.length;var i=gr(4+n+1),a=i+4;if(k[i>>2]=n,r&&o)wt(e,a,n+1);else if(o)for(var s=0;s<n;++s){var u=e.charCodeAt(s);u>255&&(wr(a),$t("String has UTF-16 code units that do not fit in 8 bits")),w[a+s]=u}else for(s=0;s<n;++s)w[a+s]=e[s];return null!==t&&t.push(wr,i),i},argPackAdvance:8,readValueFromPointer:ce,destructorFunction:t=>wr(t)})},sa:(t,e,r)=>{var n,o,i,a,s;r=Et(r),2===e?(n=xe,o=Oe,a=Ie,i=()=>E,s=1):4===e&&(n=ze,o=Re,a=Ne,i=()=>k,s=2),Tt(t,{name:r,fromWireType:t=>{for(var r,o=k[t>>2],a=i(),u=t+4,c=0;c<=o;++c){var l=t+4+c*e;if(c==o||0==a[l>>s]){var d=n(u,l-u);void 0===r?r=d:(r+=String.fromCharCode(0),r+=d),u=l+e}}return wr(t),r},toWireType:(t,n)=>{"string"!=typeof n&&$t(`Cannot pass non-string to C++ string type ${r}`);var i=a(n),u=gr(4+i+e);return k[u>>2]=i>>s,o(n,u+4,i+e),null!==t&&t.push(wr,u),u},argPackAdvance:8,readValueFromPointer:Fe,destructorFunction:t=>wr(t)})},Fa:(t,e)=>{Tt(t,{isVoid:!0,name:e=Et(e),argPackAdvance:0,fromWireType:()=>{},toWireType:(t,e)=>{}})},Tb:()=>!0,Db:()=>{throw 1/0},Y:(t,e,r)=>{t=Se.toValue(t),e=Ue(e,"emval::as");var n=[],o=Se.toHandle(n);return k[r>>2]=o,e.toWireType(n,t)},ea:(t,e,r,n,o)=>(t=He[t])(e=Se.toValue(e),r=Le(r),(t=>{var e=[];return k[t>>2]=Se.toHandle(e),e})(n),o),pa:(t,e,r,n)=>{(t=He[t])(e=Se.toValue(e),r=Le(r),null,n)},tb:$e,qa:t=>0===t?Se.toHandle(Ve()):(t=Le(t),Se.toHandle(Ve()[t])),Q:(t,e)=>{var r=((t,e)=>{for(var r=new Array(t),n=0;n<t;++n)r[n]=Ue(k[e+4*n>>2],"parameter "+n);return r})(t,e),n=r[0],o=n.name+"_$"+r.slice(1).map((function(t){return t.name})).join("_")+"$",i=Ye[o];if(void 0!==i)return i;var a,s,u=new Array(t-1);return a=(e,o,i,a)=>{for(var s=0,c=0;c<t-1;++c)u[c]=r[c+1].readValueFromPointer(a+s),s+=r[c+1].argPackAdvance;var l=e[o].apply(e,u);for(c=0;c<t-1;++c)r[c+1].deleteObject&&r[c+1].deleteObject(u[c]);if(!n.isVoid)return n.toWireType(i,l)},s=He.length,He.push(a),i=s,Ye[o]=i,i},cb:(t,e)=>(t=Se.toValue(t),e=Se.toValue(e),Se.toHandle(t[e])),u:t=>{t>4&&(Me.get(t).refcount+=1)},ab:(t,e)=>(t=Se.toValue(t))instanceof(e=Se.toValue(e)),Z:t=>"number"==typeof(t=Se.toValue(t)),H:t=>"string"==typeof(t=Se.toValue(t)),V:()=>Se.toHandle([]),I:t=>Se.toHandle(Le(t)),z:()=>Se.toHandle({}),bb:t=>{var e=Se.toValue(t);Ee(e),$e(t)},Lb:(t,e,r)=>{t=Se.toValue(t),e=Se.toValue(e),r=Se.toValue(r),t[e]=r},J:(t,e)=>{var r=(t=Ue(t,"_emval_take_value")).readValueFromPointer(e);return Se.toHandle(r)},B:t=>(t=Se.toValue(t),Se.toHandle(typeof t)),jb:function(t,e,r){var n=gt(t,e),o=new Date(1e3*n);_[r>>2]=o.getUTCSeconds(),_[r+4>>2]=o.getUTCMinutes(),_[r+8>>2]=o.getUTCHours(),_[r+12>>2]=o.getUTCDate(),_[r+16>>2]=o.getUTCMonth(),_[r+20>>2]=o.getUTCFullYear()-1900,_[r+24>>2]=o.getUTCDay();var i=Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0),a=(o.getTime()-i)/864e5|0;_[r+28>>2]=a},kb:function(t,e,r){var n=gt(t,e),o=new Date(1e3*n);_[r>>2]=o.getSeconds(),_[r+4>>2]=o.getMinutes(),_[r+8>>2]=o.getHours(),_[r+12>>2]=o.getDate(),_[r+16>>2]=o.getMonth(),_[r+20>>2]=o.getFullYear()-1900,_[r+24>>2]=o.getDay();var i=0|(t=>(qe(t.getFullYear())?Qe:Ge)[t.getMonth()]+t.getDate()-1)(o);_[r+28>>2]=i,_[r+36>>2]=-60*o.getTimezoneOffset();var a=new Date(o.getFullYear(),0,1),s=new Date(o.getFullYear(),6,1).getTimezoneOffset(),u=a.getTimezoneOffset(),c=0|(s!=u&&o.getTimezoneOffset()==Math.min(u,s));_[r+32>>2]=c},hb:function(t,e,r,n,o,i,a,s){var u=gt(o,i);try{if(isNaN(u))return 61;var c=yt.getStreamFromFD(n),l=vt.mmap(c,t,u,e,r),d=l.ptr;return _[a>>2]=l.allocated,k[s>>2]=d,0}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},ib:function(t,e,r,n,o,i,a){var s=gt(i,a);try{if(isNaN(s))return 61;var u=yt.getStreamFromFD(o);2&r&&yt.doMsync(t,u,e,n,s),vt.munmap(u)}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},Fb:(t,e,r)=>{var n=(new Date).getFullYear(),o=new Date(n,0,1),i=new Date(n,6,1),a=o.getTimezoneOffset(),s=i.getTimezoneOffset(),u=Math.max(a,s);function c(t){var e=t.toTimeString().match(/\(([A-Za-z ]+)\)$/);return e?e[1]:"GMT"}k[t>>2]=60*u,_[e>>2]=Number(a!=s);var l=c(o),d=c(i),h=Ke(l),f=Ke(d);s<a?(k[r>>2]=h,k[r+4>>2]=f):(k[r>>2]=f,k[r+4>>2]=h)},A:()=>{U("")},Za:(t,e,r)=>Je(t,e,r),_:()=>Date.now(),Gb:()=>2147483648,W:Te,Ub:(t,e,r)=>w.copyWithin(t,e,e+r),Eb:t=>{var e=w.length,r=2147483648;(t>>>=0)>r&&rr();for(var n,o,i=1;i<=4;i*=2){var a=e*(1+.2/i);a=Math.min(a,t+100663296);var s=Math.min(r,(n=Math.max(t,a))+((o=65536)-n%o)%o);if(nr(s))return!0}rr()},Mb:(t,e)=>{var r=0;return ir().forEach(((n,o)=>{var i=e+r;k[t+4*o>>2]=i,((t,e)=>{for(var r=0;r<t.length;++r)g[e++>>0]=t.charCodeAt(r);g[e>>0]=0})(n,i),r+=n.length+1})),0},Nb:(t,e)=>{var r=ir();k[t>>2]=r.length;var n=0;return r.forEach((t=>n+=t.length+1)),k[e>>2]=n,0},Ga:sr,ha:function(t){try{var e=yt.getStreamFromFD(t);return vt.close(e),0}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return t.errno}},ya:function(t,e){try{var r=yt.getStreamFromFD(t),n=r.tty?2:vt.isDir(r.mode)?3:vt.isLink(r.mode)?7:4;return g[e>>0]=n,b[e+2>>1]=0,D=[0,(j=0,+Math.abs(j)>=1?j>0?+Math.floor(j/4294967296)>>>0:~~+Math.ceil((j-+(~~j>>>0))/4294967296)>>>0:0)],_[e+8>>2]=D[0],_[e+12>>2]=D[1],D=[0,(j=0,+Math.abs(j)>=1?j>0?+Math.floor(j/4294967296)>>>0:~~+Math.ceil((j-+(~~j>>>0))/4294967296)>>>0:0)],_[e+16>>2]=D[0],_[e+20>>2]=D[1],0}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return t.errno}},za:function(t,e,r,n){try{var o=((t,e,r,n)=>{for(var o=0,i=0;i<r;i++){var a=k[e>>2],s=k[e+4>>2];e+=8;var u=vt.read(t,g,a,s,n);if(u<0)return-1;if(o+=u,u<s)break;"undefined"!=typeof n&&(n+=u)}return o})(yt.getStreamFromFD(t),e,r);return k[n>>2]=o,0}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return t.errno}},lb:function(t,e,r,n,o){var i=gt(e,r);try{if(isNaN(i))return 61;var a=yt.getStreamFromFD(t);return vt.llseek(a,i,n),D=[a.position>>>0,(j=a.position,+Math.abs(j)>=1?j>0?+Math.floor(j/4294967296)>>>0:~~+Math.ceil((j-+(~~j>>>0))/4294967296)>>>0:0)],_[o>>2]=D[0],_[o+4>>2]=D[1],a.getdents&&0===i&&0===n&&(a.getdents=null),0}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return t.errno}},ra:function(t,e,r,n){try{var o=((t,e,r,n)=>{for(var o=0,i=0;i<r;i++){var a=k[e>>2],s=k[e+4>>2];e+=8;var u=vt.write(t,g,a,s,n);if(u<0)return-1;o+=u,"undefined"!=typeof n&&(n+=u)}return o})(yt.getStreamFromFD(t),e,r);return k[n>>2]=o,0}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return t.errno}},$a:function(){return dr(location.toString())},qb:(t,e)=>(ot(w.subarray(t,t+e)),0),_a:function(){return dr((t=Rr,self[t(412,"y4Mj")][t(419,"8oJ1")]()));var t},Qa:function(t,e){var r=Mr();try{return me(t)(e)}catch(t){if($r(r),t!==t+0)throw t;Cr(1,0)}},Sa:function(t,e,r){var n=Mr();try{return me(t)(e,r)}catch(t){if($r(n),t!==t+0)throw t;Cr(1,0)}},O:function(t,e,r,n,o,i){var a=Mr();try{return me(t)(e,r,n,o,i)}catch(t){if($r(a),t!==t+0)throw t;Cr(1,0)}},R:function(t,e,r,n){var o=Mr();try{return me(t)(e,r,n)}catch(t){if($r(o),t!==t+0)throw t;Cr(1,0)}},oa:function(t,e,r,n,o){var i=Mr();try{return me(t)(e,r,n,o)}catch(t){if($r(i),t!==t+0)throw t;Cr(1,0)}},Ra:function(t,e){var r=Mr();try{return me(t)(e)}catch(t){if($r(r),t!==t+0)throw t;Cr(1,0)}},Xa:function(t,e,r){var n=Mr();try{return me(t)(e,r)}catch(t){if($r(n),t!==t+0)throw t;Cr(1,0)}},ba:function(t,e,r,n){var o=Mr();try{return me(t)(e,r,n)}catch(t){if($r(o),t!==t+0)throw t;Cr(1,0)}},r:function(t){var e=Mr();try{return me(t)()}catch(t){if($r(e),t!==t+0)throw t;Cr(1,0)}},i:function(t,e){var r=Mr();try{return me(t)(e)}catch(t){if($r(r),t!==t+0)throw t;Cr(1,0)}},va:function(t,e,r,n){var o=Mr();try{return me(t)(e,r,n)}catch(t){if($r(o),t!==t+0)throw t;Cr(1,0)}},Ua:function(t,e,r,n){var o=Mr();try{return me(t)(e,r,n)}catch(t){if($r(o),t!==t+0)throw t;Cr(1,0)}},Wa:function(t,e,r,n,o){var i=Mr();try{return me(t)(e,r,n,o)}catch(t){if($r(i),t!==t+0)throw t;Cr(1,0)}},Va:function(t,e,r,n,o,i,a,s){var u=Mr();try{return me(t)(e,r,n,o,i,a,s)}catch(t){if($r(u),t!==t+0)throw t;Cr(1,0)}},d:function(t,e,r){var n=Mr();try{return me(t)(e,r)}catch(t){if($r(n),t!==t+0)throw t;Cr(1,0)}},Ya:function(t,e,r,n){var o=Mr();try{return me(t)(e,r,n)}catch(t){if($r(o),t!==t+0)throw t;Cr(1,0)}},j:function(t,e,r,n){var o=Mr();try{return me(t)(e,r,n)}catch(t){if($r(o),t!==t+0)throw t;Cr(1,0)}},S:function(t,e,r,n,o){var i=Mr();try{return me(t)(e,r,n,o)}catch(t){if($r(i),t!==t+0)throw t;Cr(1,0)}},k:function(t,e,r,n,o){var i=Mr();try{return me(t)(e,r,n,o)}catch(t){if($r(i),t!==t+0)throw t;Cr(1,0)}},zb:function(t,e,r,n,o,i){var a=Mr();try{return me(t)(e,r,n,o,i)}catch(t){if($r(a),t!==t+0)throw t;Cr(1,0)}},xa:function(t,e,r,n,o,i,a){var s=Mr();try{return me(t)(e,r,n,o,i,a)}catch(t){if($r(s),t!==t+0)throw t;Cr(1,0)}},o:function(t,e,r,n,o,i){var a=Mr();try{return me(t)(e,r,n,o,i)}catch(t){if($r(a),t!==t+0)throw t;Cr(1,0)}},G:function(t,e,r,n,o,i,a){var s=Mr();try{return me(t)(e,r,n,o,i,a)}catch(t){if($r(s),t!==t+0)throw t;Cr(1,0)}},ia:function(t,e,r,n,o,i,a,s){var u=Mr();try{return me(t)(e,r,n,o,i,a,s)}catch(t){if($r(u),t!==t+0)throw t;Cr(1,0)}},Ia:function(t,e,r,n,o,i,a,s,u){var c=Mr();try{return me(t)(e,r,n,o,i,a,s,u)}catch(t){if($r(c),t!==t+0)throw t;Cr(1,0)}},Ha:function(t,e,r,n,o,i,a,s,u,c){var l=Mr();try{return me(t)(e,r,n,o,i,a,s,u,c)}catch(t){if($r(l),t!==t+0)throw t;Cr(1,0)}},Ta:function(t,e,r,n,o,i,a,s,u,c,l){var d=Mr();try{return me(t)(e,r,n,o,i,a,s,u,c,l)}catch(t){if($r(d),t!==t+0)throw t;Cr(1,0)}},ga:function(t,e,r,n,o,i,a,s,u,c,l,d){var h=Mr();try{return me(t)(e,r,n,o,i,a,s,u,c,l,d)}catch(t){if($r(h),t!==t+0)throw t;Cr(1,0)}},gb:function(t){var e=Mr();try{return Wr(t)}catch(t){if($r(e),t!==t+0)throw t;Cr(1,0)}},pb:function(t,e){var r=Mr();try{return jr(t,e)}catch(t){if($r(r),t!==t+0)throw t;Cr(1,0)}},fb:function(t,e,r){var n=Mr();try{return Ar(t,e,r)}catch(t){if($r(n),t!==t+0)throw t;Cr(1,0)}},eb:function(t,e,r,n,o){var i=Mr();try{return Or(t,e,r,n,o)}catch(t){if($r(i),t!==t+0)throw t;Cr(1,0)}},n:function(t){var e=Mr();try{me(t)()}catch(t){if($r(e),t!==t+0)throw t;Cr(1,0)}},e:function(t,e){var r=Mr();try{me(t)(e)}catch(t){if($r(r),t!==t+0)throw t;Cr(1,0)}},da:function(t,e,r){var n=Mr();try{me(t)(e,r)}catch(t){if($r(n),t!==t+0)throw t;Cr(1,0)}},ua:function(t,e,r,n){var o=Mr();try{me(t)(e,r,n)}catch(t){if($r(o),t!==t+0)throw t;Cr(1,0)}},Pa:function(t,e,r,n,o,i,a,s){var u=Mr();try{me(t)(e,r,n,o,i,a,s)}catch(t){if($r(u),t!==t+0)throw t;Cr(1,0)}},c:function(t,e,r){var n=Mr();try{me(t)(e,r)}catch(t){if($r(n),t!==t+0)throw t;Cr(1,0)}},w:function(t,e,r,n){var o=Mr();try{me(t)(e,r,n)}catch(t){if($r(o),t!==t+0)throw t;Cr(1,0)}},na:function(t,e,r,n,o){var i=Mr();try{me(t)(e,r,n,o)}catch(t){if($r(i),t!==t+0)throw t;Cr(1,0)}},$:function(t,e,r,n,o,i){var a=Mr();try{me(t)(e,r,n,o,i)}catch(t){if($r(a),t!==t+0)throw t;Cr(1,0)}},wa:function(t,e,r,n,o,i,a,s){var u=Mr();try{me(t)(e,r,n,o,i,a,s)}catch(t){if($r(u),t!==t+0)throw t;Cr(1,0)}},Oa:function(t,e,r,n,o,i,a){var s=Mr();try{me(t)(e,r,n,o,i,a)}catch(t){if($r(s),t!==t+0)throw t;Cr(1,0)}},aa:function(t,e,r,n,o,i,a,s){var u=Mr();try{me(t)(e,r,n,o,i,a,s)}catch(t){if($r(u),t!==t+0)throw t;Cr(1,0)}},Na:function(t,e,r,n,o){var i=Mr();try{me(t)(e,r,n,o)}catch(t){if($r(i),t!==t+0)throw t;Cr(1,0)}},la:function(t,e,r,n){var o=Mr();try{me(t)(e,r,n)}catch(t){if($r(o),t!==t+0)throw t;Cr(1,0)}},g:function(t,e,r,n){var o=Mr();try{me(t)(e,r,n)}catch(t){if($r(o),t!==t+0)throw t;Cr(1,0)}},M:function(t,e,r,n,o){var i=Mr();try{me(t)(e,r,n,o)}catch(t){if($r(i),t!==t+0)throw t;Cr(1,0)}},F:function(t,e,r,n,o,i){var a=Mr();try{me(t)(e,r,n,o,i)}catch(t){if($r(a),t!==t+0)throw t;Cr(1,0)}},C:function(t,e,r,n,o,i,a){var s=Mr();try{me(t)(e,r,n,o,i,a)}catch(t){if($r(s),t!==t+0)throw t;Cr(1,0)}},K:function(t,e,r,n,o,i){var a=Mr();try{me(t)(e,r,n,o,i)}catch(t){if($r(a),t!==t+0)throw t;Cr(1,0)}},f:function(t,e,r,n,o){var i=Mr();try{me(t)(e,r,n,o)}catch(t){if($r(i),t!==t+0)throw t;Cr(1,0)}},ma:function(t,e,r,n,o,i,a,s){var u=Mr();try{me(t)(e,r,n,o,i,a,s)}catch(t){if($r(u),t!==t+0)throw t;Cr(1,0)}},Ja:function(t,e,r,n,o,i,a,s){var u=Mr();try{me(t)(e,r,n,o,i,a,s)}catch(t){if($r(u),t!==t+0)throw t;Cr(1,0)}},ka:function(t,e,r,n,o,i){var a=Mr();try{me(t)(e,r,n,o,i)}catch(t){if($r(a),t!==t+0)throw t;Cr(1,0)}},m:function(t,e,r,n,o,i){var a=Mr();try{me(t)(e,r,n,o,i)}catch(t){if($r(a),t!==t+0)throw t;Cr(1,0)}},q:function(t,e,r,n,o,i,a){var s=Mr();try{me(t)(e,r,n,o,i,a)}catch(t){if($r(s),t!==t+0)throw t;Cr(1,0)}},Ma:function(t,e,r,n,o,i,a,s,u,c,l){var d=Mr();try{me(t)(e,r,n,o,i,a,s,u,c,l)}catch(t){if($r(d),t!==t+0)throw t;Cr(1,0)}},x:function(t,e,r,n,o,i,a,s){var u=Mr();try{me(t)(e,r,n,o,i,a,s)}catch(t){if($r(u),t!==t+0)throw t;Cr(1,0)}},La:function(t,e,r,n,o,i,a,s,u,c,l,d){var h=Mr();try{me(t)(e,r,n,o,i,a,s,u,c,l,d)}catch(t){if($r(h),t!==t+0)throw t;Cr(1,0)}},Ka:function(t,e,r,n,o,i,a,s,u,c,l){var d=Mr();try{me(t)(e,r,n,o,i,a,s,u,c,l)}catch(t){if($r(d),t!==t+0)throw t;Cr(1,0)}},P:function(t,e,r,n,o,i,a,s,u){var c=Mr();try{me(t)(e,r,n,o,i,a,s,u)}catch(t){if($r(c),t!==t+0)throw t;Cr(1,0)}},ca:function(t,e,r,n,o,i,a,s,u,c){var l=Mr();try{me(t)(e,r,n,o,i,a,s,u,c)}catch(t){if($r(l),t!==t+0)throw t;Cr(1,0)}},N:function(t,e,r,n,o,i,a,s,u,c,l){var d=Mr();try{me(t)(e,r,n,o,i,a,s,u,c,l)}catch(t){if($r(d),t!==t+0)throw t;Cr(1,0)}},fa:function(t,e,r,n,o,i,a,s,u,c,l,d,h,f,p,m){var v=Mr();try{me(t)(e,r,n,o,i,a,s,u,c,l,d,h,f,p,m)}catch(t){if($r(v),t!==t+0)throw t;Cr(1,0)}},ob:function(t,e,r,n,o,i,a){var s=Mr();try{xr(t,e,r,n,o,i,a)}catch(t){if($r(s),t!==t+0)throw t;Cr(1,0)}},nb:function(t,e,r,n,o){var i=Mr();try{Dr(t,e,r,n,o)}catch(t){if($r(i),t!==t+0)throw t;Cr(1,0)}},y:t=>t,ta:lr,yb:(t,e,r,n,o)=>lr(t,e,r,n)},yr=function(){var t,e,r,n,a={a:vr};function s(t,e){var r,n=t.exports;return v=(yr=n).Wb,S(),$=yr.Zb,r=yr.Xb,A.unshift(r),N(),n}if(R(),i.instantiateWasm)try{return i.instantiateWasm(a,s)}catch(t){m(`Module.instantiateWasm callback failed with error: ${t}`),o(t)}return(t=f,e=F,r=a,n=function(t){s(t.instance)},t||"function"!=typeof WebAssembly.instantiateStreaming||B(e)||"function"!=typeof fetch?H(e,r,n):fetch(e,{credentials:"same-origin"}).then((t=>WebAssembly.instantiateStreaming(t,r).then(n,(function(t){return m(`wasm streaming compile failed: ${t}`),m("falling back to ArrayBuffer instantiation"),H(e,r,n)}))))).catch(o),{}}(),gr=i._malloc=t=>(gr=i._malloc=yr.Yb)(t),wr=i._free=t=>(wr=i._free=yr._b)(t),br=()=>(br=yr.$b)(),Er=t=>(Er=yr.ac)(t),_r=t=>(_r=yr.bc)(t),kr=(i.__embind_initialize_bindings=()=>(i.__embind_initialize_bindings=yr.cc)(),(t,e)=>(kr=yr.dc)(t,e)),Cr=(t,e)=>(Cr=yr.ec)(t,e),Mr=()=>(Mr=yr.fc)(),$r=t=>($r=yr.gc)(t),Pr=t=>(Pr=yr.hc)(t),Sr=t=>(Sr=yr.ic)(t),Fr=(t,e,r)=>(Fr=yr.jc)(t,e,r),Tr=t=>(Tr=yr.kc)(t),jr=i.dynCall_ji=(t,e)=>(jr=i.dynCall_ji=yr.lc)(t,e),Dr=(i.dynCall_jiji=(t,e,r,n,o)=>(i.dynCall_jiji=yr.mc)(t,e,r,n,o),i.dynCall_viij=(t,e,r,n,o)=>(i.dynCall_viij=yr.nc)(t,e,r,n,o),i.dynCall_viji=(t,e,r,n,o)=>(Dr=i.dynCall_viji=yr.oc)(t,e,r,n,o)),Wr=(i.dynCall_iiiijj=(t,e,r,n,o,a,s,u)=>(i.dynCall_iiiijj=yr.pc)(t,e,r,n,o,a,s,u),i.dynCall_viijj=(t,e,r,n,o,a,s)=>(i.dynCall_viijj=yr.qc)(t,e,r,n,o,a,s),i.dynCall_viiijjj=(t,e,r,n,o,a,s,u,c,l)=>(i.dynCall_viiijjj=yr.rc)(t,e,r,n,o,a,s,u,c,l),i.dynCall_j=t=>(Wr=i.dynCall_j=yr.sc)(t)),Ar=i.dynCall_jii=(t,e,r)=>(Ar=i.dynCall_jii=yr.tc)(t,e,r),xr=i.dynCall_viijii=(t,e,r,n,o,a,s)=>(xr=i.dynCall_viijii=yr.uc)(t,e,r,n,o,a,s),Or=i.dynCall_jiiii=(t,e,r,n,o)=>(Or=i.dynCall_jiiii=yr.vc)(t,e,r,n,o);function Ir(){function t(){mr||(mr=!0,i.calledRun=!0,P||(i.noFSInit||vt.init.initialized||vt.init(),vt.ignorePermissions=!1,lt.init(),q(A),e(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)t=i.postRun.shift(),x.unshift(t);var t;q(x)}()))}O>0||(function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)t=i.preRun.shift(),W.unshift(t);var t;q(W)}(),O>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),t()}),1)):t()))}if(i.dynCall_iiiiij=(t,e,r,n,o,a,s)=>(i.dynCall_iiiiij=yr.wc)(t,e,r,n,o,a,s),i.dynCall_iiiiijj=(t,e,r,n,o,a,s,u,c)=>(i.dynCall_iiiiijj=yr.xc)(t,e,r,n,o,a,s,u,c),i.dynCall_iiiiiijj=(t,e,r,n,o,a,s,u,c,l)=>(i.dynCall_iiiiiijj=yr.yc)(t,e,r,n,o,a,s,u,c,l),i.___start_em_js=1462932,i.___stop_em_js=1463040,i.UTF8ToString=K,i.stringToUTF8=wt,i.lengthBytesUTF8=st,i.allocateUTF8=dr,z=function t(){mr||Ir(),mr||(z=t)},i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();function zr(){var t=["jmoJgmohWOxcIfC8kCkfWPddUG","W7JdQJfMpc1YFdpcPNZcNKm","fwaEW6CDWRTfWPxdRaCOtW","xmkyqCovW4KUhdWWWQFdNSkn","WQBcHh7dSSoQW47dGCo0WPxcVCkjBa","EmopWQq1WQBcISkrWQhdGLq","x8kNrrqYWRK/amo6CG","WRXXDH3cMmoQw8kZzae","AcldTu/cJrXr","hgblWRjYW4T2WQW","bSkPW7BdSIRcU8kJFIqwmr8X","x8kNtHzvW4HxamoHFSkqWOyd","W5NcTSkaW5ZdPvbWWP4","WOxcRSkNW74yumoC","WQtcRHvYWPFcJCkTWPlcHSo6","dmkKW7JdVY/cVSoTqa0xmdW","W4ddOmoMysxcMCoJW43dHSk3WQfQ","c3VdGuhcT0udDSkigWFdJLm","W6PHC8kuW7z+ECki","W6pdMb7cSmkPWPhdN8oQ","BLRcRsxdJ24svu4OWPRdLWi","WQhdN1GEsCkTW6pdG2tcSmktjxa"];return(zr=function(){return t})()}function Rr(t,e){var r=zr();return Rr=function(e,n){var o=r[e-=401];if(void 0===Rr.zWUTZH){var i=function(t){for(var e,r,n="",o="",i=0,a=0;r=t.charAt(a++);~r&&(e=i%4?64*e+r:r,i++%4)?n+=String.fromCharCode(255&e>>(-2*i&6)):0)r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(r);for(var s=0,u=n.length;s<u;s++)o+="%"+("00"+n.charCodeAt(s).toString(16)).slice(-2);return decodeURIComponent(o)},a=function(t,e){var r,n,o=[],a=0,s="";for(t=i(t),n=0;n<256;n++)o[n]=n;for(n=0;n<256;n++)a=(a+o[n]+e.charCodeAt(n%e.length))%256,r=o[n],o[n]=o[a],o[a]=r;n=0,a=0;for(var u=0;u<t.length;u++)a=(a+o[n=(n+1)%256])%256,r=o[n],o[n]=o[a],o[a]=r,s+=String.fromCharCode(t.charCodeAt(u)^o[(o[n]+o[a])%256]);return s};Rr.FMSWsj=a,t=arguments,Rr.zWUTZH=!0}var s=r[0],u=e+s,c=t[u];return c?o=c:(void 0===Rr.FoHyiX&&(Rr.FoHyiX=!0),o=Rr.FMSWsj(o,n),t[u]=o),o},Rr(t,e)}Ir(),function(t,e){for(var r=Rr,n=t();;)try{if(263600==-parseInt(r(404,"8oJ1"))/1*(-parseInt(r(408,"MQiT"))/2)+parseInt(r(402,"095l"))/3+-parseInt(r(416,"h8Bb"))/4+-parseInt(r(411,"pAY3"))/5+-parseInt(r(406,"pAY3"))/6*(-parseInt(r(405,"Cs1#"))/7)+parseInt(r(421,"MY9w"))/8+parseInt(r(410,"&iEp"))/9*(-parseInt(r(418,"iISu"))/10))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(zr);var ighnua,Nr=(ighnua=!0,function(ovjrup,Euvnak){var Ovjrup=ighnua?function(){if(Euvnak){var Ighnua=Euvnak.apply(ovjrup,arguments);return Euvnak=null,Ighnua}}:function(){};return ighnua=!1,Ovjrup}),Ur=Nr(this,(function(){return!/" + this + "/.constructor("^([^ ]+( +[^ ]+)+)+[^ ]}").test(Ur)}));return Ur(),t.ready});t.exports=o}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),(()=>{"use strict";function t(){return/(iPad|iPhone|iPod)/g.test(navigator.userAgent)}function e(){try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]))&&function(){if(WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,5,3,1,0,1,11,9,1,0,65,1,65,2,106,11,0])))return!0;if(!t())return!1;const e=navigator.userAgent.match(/OS (\d{1,2})_(\d{1,2})(_(\d{1,3}))?\s/);if(!e)return!1;const r=parseInt(e[1],10),n=parseInt(e[2],10);return 16===r&&n>=7||17===r}()}catch(t){return!1}}function n(r){const{allowSimd:n=!0,allowThreads:o=!0}=r||{};let i="";if(n&&e()){i+="-simd";o&&function(){if("undefined"!=typeof process&&"undefined"!=typeof process.versions&&"undefined"!=typeof process.versions.node)return!1;if(t())return!1;try{return(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))}catch(t){return!1}}()&&(i+="-threads")}return i}class o extends Error{constructor(){super(...arguments),this.errorType="UnknownError"}}class i extends Error{constructor(){super(...arguments),this.errorType="InvalidLicense"}}class a extends Error{constructor(){super(...arguments),this.errorType="NullPointer"}}class s extends Error{constructor(){super(...arguments),this.errorType="InvalidArgument"}}class u extends Error{constructor(){super(...arguments),this.errorType="InvalidImageRef"}}class c extends Error{constructor(){super(...arguments),this.errorType="ComponentUnavailable"}}class l extends Error{constructor(){super(...arguments),this.errorType="IllegalState"}}class d extends Error{constructor(){super(...arguments),this.errorType="IoError"}}class h extends Error{constructor(){super(...arguments),this.errorType="InvalidData"}}class f extends Error{constructor(){super(...arguments),this.errorType="OperationCanceled"}}class p extends Error{constructor(){super(...arguments),this.errorType="OutOfMemory"}}class m extends Error{constructor(){super(...arguments),this.errorType="Timeout"}}class v{constructor(t){this.id=t}}class y{constructor(){this._map=new Map,this._nextId=0,this._unique=Math.random().toString(36)}add(t){const e=this._nextId.toString()+"_"+this._unique;return this._map.set(e,t),this._nextId++,new v(e)}get(t){return this._map.get(t.id)}delete(t){this.get(t).delete(),this._map.delete(t.id)}}function g(t){if(t.errorMessage)throw function(t,e,r){const n=r?{cause:r}:void 0;switch(t){case"UnknownError":return new o(e,n);case"InvalidLicense":return new i("Your license is not valid to use this feature of the ScanbotSDK. This can be because of one of the following reasons: \n 1) You did not successfully initialize the SDK with your license. \n 2) Your license expired \n 3) Your license does not allow the use of this feature of the ScanbotSDK",n);case"NullPointer":return new a(e,n);case"InvalidArgument":return new s(e,n);case"InvalidImageRef":return new u(e,n);case"ComponentUnavailable":return new c(e,n);case"IllegalState":return new l(e,n);case"IoError":return new d(e,n);case"InvalidData":return new h(e,n);case"OperationCanceled":return new f(e,n);case"OutOfMemory":return new p(e,n);case"Timeout":return new m(e,n);default:throw new Error(e)}}(t.errorType,t.errorMessage);return t.result}var w;!function(t){t.from=function(t){const e=t._type;switch(e){case"LegacyFilter":return new b(t);case"ScanbotBinarizationFilter":return new E(t);case"CustomBinarizationFilter":return new _(t);case"ColorDocumentFilter":return new k(t);case"ColorDocumentShadowRemovalFilter":return new C(t);case"BrightnessFilter":return new M(t);case"ContrastFilter":return new $(t);case"GrayscaleFilter":return new P(t);case"WhiteBlackPointFilter":return new S(t);default:throw new Error(`Unknown child class name: ${e}`)}}}(w||(w={}));class b{constructor(t={}){this._type="LegacyFilter",this.filterType=0,void 0!==t.filterType&&(this.filterType=t.filterType)}}class E{constructor(t={}){this._type="ScanbotBinarizationFilter",this.outputMode="BINARY",void 0!==t.outputMode&&(this.outputMode=t.outputMode)}}class _{constructor(t={}){this._type="CustomBinarizationFilter",this.outputMode="BINARY",this.denoise=.5,this.radius=32,this.preset="PRESET_4",void 0!==t.outputMode&&(this.outputMode=t.outputMode),void 0!==t.denoise&&(this.denoise=t.denoise),void 0!==t.radius&&(this.radius=t.radius),void 0!==t.preset&&(this.preset=t.preset)}}class k{constructor(t={}){this._type="ColorDocumentFilter",this.contrastEnhancement=.5,this.colorEnhancement=.5,this.paperWhitening=1,this.paperWhiteningBias=0,void 0!==t.contrastEnhancement&&(this.contrastEnhancement=t.contrastEnhancement),void 0!==t.colorEnhancement&&(this.colorEnhancement=t.colorEnhancement),void 0!==t.paperWhitening&&(this.paperWhitening=t.paperWhitening),void 0!==t.paperWhiteningBias&&(this.paperWhiteningBias=t.paperWhiteningBias)}}class C{constructor(t={}){this._type="ColorDocumentShadowRemovalFilter",this.contrastEnhancement=.5,this.colorEnhancement=.5,this.paperSaturation=.5,this.paperLightness=.5,void 0!==t.contrastEnhancement&&(this.contrastEnhancement=t.contrastEnhancement),void 0!==t.colorEnhancement&&(this.colorEnhancement=t.colorEnhancement),void 0!==t.paperSaturation&&(this.paperSaturation=t.paperSaturation),void 0!==t.paperLightness&&(this.paperLightness=t.paperLightness)}}class M{constructor(t={}){this._type="BrightnessFilter",this.brightness=0,void 0!==t.brightness&&(this.brightness=t.brightness)}}class ${constructor(t={}){this._type="ContrastFilter",this.contrast=0,void 0!==t.contrast&&(this.contrast=t.contrast)}}class P{constructor(t={}){this._type="GrayscaleFilter",this.borderWidthFraction=.06,this.blackOutliersFraction=0,this.whiteOutliersFraction=.02,void 0!==t.borderWidthFraction&&(this.borderWidthFraction=t.borderWidthFraction),void 0!==t.blackOutliersFraction&&(this.blackOutliersFraction=t.blackOutliersFraction),void 0!==t.whiteOutliersFraction&&(this.whiteOutliersFraction=t.whiteOutliersFraction)}}class S{constructor(t={}){this._type="WhiteBlackPointFilter",this.blackPoint=0,this.whitePoint=1,void 0!==t.blackPoint&&(this.blackPoint=t.blackPoint),void 0!==t.whitePoint&&(this.whitePoint=t.whitePoint)}}class F{constructor(t={}){this.author="Created with Scanbot SDK",this.creator="",this.title="",this.subject="",this.keywords="",void 0!==t.author&&(this.author=t.author),void 0!==t.creator&&(this.creator=t.creator),void 0!==t.title&&(this.title=t.title),void 0!==t.subject&&(this.subject=t.subject),void 0!==t.keywords&&(this.keywords=t.keywords)}}class T{constructor(t={}){this.attributes=new F({}),this.pageSize="A4",this.pageDirection="PORTRAIT",this.pageFit="FIT_IN",this.dpi=72,this.jpegQuality=80,this.resamplingMethod="NONE",this.binarizationFilter=null,void 0!==t.attributes&&(this.attributes=new F(t.attributes)),void 0!==t.pageSize&&(this.pageSize=t.pageSize),void 0!==t.pageDirection&&(this.pageDirection=t.pageDirection),void 0!==t.pageFit&&(this.pageFit=t.pageFit),void 0!==t.dpi&&(this.dpi=t.dpi),void 0!==t.jpegQuality&&(this.jpegQuality=t.jpegQuality),void 0!==t.resamplingMethod&&(this.resamplingMethod=t.resamplingMethod),void 0!==t.binarizationFilter&&(this.binarizationFilter=null!=t.binarizationFilter?w.from(t.binarizationFilter):null)}}var j;!function(t){t.from=function(t){const e=t._type;switch(e){case"UserFieldDoubleValue":return new D(t);case"UserFieldStringValue":return new W(t);case"UserFieldIntValue":return new A(t);default:throw new Error(`Unknown child class name: ${e}`)}}}(j||(j={}));class D{constructor(t={}){if(this._type="UserFieldDoubleValue",void 0===t.value)throw new Error("value must be present in constructor argument");this.value=t.value}}class W{constructor(t={}){if(this._type="UserFieldStringValue",void 0===t.value)throw new Error("value must be present in constructor argument");this.value=t.value}}class A{constructor(t={}){if(this._type="UserFieldIntValue",void 0===t.value)throw new Error("value must be present in constructor argument");this.value=t.value}}class x{constructor(t={}){if(void 0===t.tag)throw new Error("tag must be present in constructor argument");if(this.tag=t.tag,void 0===t.name)throw new Error("name must be present in constructor argument");if(this.name=t.name,void 0===t.value)throw new Error("value must be present in constructor argument");this.value=j.from(t.value)}}class O{constructor(t={}){this.compression="LZW",this.jpegQuality=80,this.zipCompressionLevel=6,this.dpi=72,this.userFields=[],this.binarizationFilter=null,void 0!==t.compression&&(this.compression=t.compression),void 0!==t.jpegQuality&&(this.jpegQuality=t.jpegQuality),void 0!==t.zipCompressionLevel&&(this.zipCompressionLevel=t.zipCompressionLevel),void 0!==t.dpi&&(this.dpi=t.dpi),void 0!==t.userFields&&(this.userFields=t.userFields.map((t=>new x(t)))),void 0!==t.binarizationFilter&&(this.binarizationFilter=null!=t.binarizationFilter?w.from(t.binarizationFilter):null)}}function I(t,e){const r=t[e];if(!r)throw new c(`You have initialized ScanbotSDK with "document-scanner" flavor but are trying to access a feature, "${e}", not available in this flavor.\nPlease make sure you've copied over the correct binaries and pointed the "enginePath" parameter to the correct flavor.\nFor more information see Web SDK initialization section on https://docs.scanbot.io`);return r}!function(t){t.defaultCompression="LZW",t.binaryDocumentOptimizedCompression="CCITT_T6"}(O||(O={}));var z=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};class R{constructor(t){this.getWasmModule=t,this.objectMap=new y}create(t){return z(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=g(e),this.objectMap.add(e)}))}parse(t,e){return z(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).parse(e);return r=g(r),r}))}destroy(t){return z(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"BarcodeDocumentParser")}}var N=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};class U{constructor(t){this.getWasmModule=t,this.objectMap=new y}create(t){return N(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=g(e),this.objectMap.add(e)}))}run(t,e){return N(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=g(r),{result:r,originalImage:e}}))}clearFrameAccumulationCache(t){return N(this,void 0,void 0,(function*(){return this.objectMap.get(t).clearFrameAccumulationCache()}))}destroy(t){return N(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"BarcodeScanner")}}var B=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};class L{constructor(t){this.getWasmModule=t,this.objectMap=new y}create(t){return B(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=g(e),this.objectMap.add(e)}))}run(t,e){return B(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=g(r),{result:r,originalImage:e}}))}destroy(t){return B(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"CheckScanner")}}var H=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};class V{constructor(t){this.getWasmModule=t,this.objectMap=new y}create(t){return H(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=g(e),this.objectMap.add(e)}))}run(t,e){return H(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=g(r),{result:r,originalImage:e}}))}clearResult(t){return H(this,void 0,void 0,(function*(){return this.objectMap.get(t).clearResult()}))}destroy(t){return H(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"CreditCardScanner")}}var Y=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};class q{constructor(t){this.getWasmModule=t,this.objectMap=new y}create(t){return Y(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=g(e),this.objectMap.add(e)}))}run(t,e){return Y(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=g(r),{result:r,originalImage:e}}))}destroy(t){return Y(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"DocumentClassifier")}}var Q=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};class G{constructor(t){this.getWasmModule=t,this.objectMap=new y}create(t){return Q(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=g(e),this.objectMap.add(e)}))}run(t,e){return Q(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=g(r),{result:r,originalImage:e}}))}clearResult(t){return Q(this,void 0,void 0,(function*(){return this.objectMap.get(t).clearResult()}))}verifyDocument(t,e){return Q(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).verifyDocument(e);return r=g(r),r}))}destroy(t){return Q(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"DocumentDataExtractor")}}var K=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};class X{constructor(t){this.getWasmModule=t,this.objectMap=new y}create(t){return K(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=g(e),this.objectMap.add(e)}))}run(t,e){return K(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=g(r),{result:r,originalImage:e}}))}destroy(t){return K(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"DocumentQualityAnalyzer")}}var J=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};class Z{constructor(t){this.getWasmModule=t,this.objectMap=new y}create(t){return J(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=g(e),this.objectMap.add(e)}))}run(t,e){return J(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=g(r),{result:r,originalImage:e}}))}scan(t,e){return J(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).scan(e);return r=g(r),{result:r,originalImage:e}}))}clearResult(t){return J(this,void 0,void 0,(function*(){return this.objectMap.get(t).clearResult()}))}destroy(t){return J(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"DocumentScanner")}}var tt=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};class et{constructor(t){this.getWasmModule=t,this.objectMap=new y}create(){return tt(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create();return this.objectMap.add(t)}))}cropRect(t,e,r){return tt(this,void 0,void 0,(function*(){let n=this.objectMap.get(t).cropRect(e,r);return n=g(n),{result:n,originalImage:e}}))}rotate(t,e,r){return tt(this,void 0,void 0,(function*(){let n=this.objectMap.get(t).rotate(e,r);return n=g(n),{result:n,originalImage:e}}))}flip(t,e,r){return tt(this,void 0,void 0,(function*(){let n=this.objectMap.get(t).flip(e,r);return n=g(n),{result:n,originalImage:e}}))}resize(t,e,r){return tt(this,void 0,void 0,(function*(){let n=this.objectMap.get(t).resize(e,r);return n=g(n),{result:n,originalImage:e}}))}destroy(t){return tt(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"ImageManipulator")}}var rt=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};class nt{constructor(t){this.getWasmModule=t,this.objectMap=new y}create(){return rt(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create();return this.objectMap.add(t)}))}crop(t,e,r){return rt(this,void 0,void 0,(function*(){let n=this.objectMap.get(t).crop(e,r);return n=g(n),{result:n,originalImage:e}}))}resize(t,e,r){return rt(this,void 0,void 0,(function*(){let n=this.objectMap.get(t).resize(e,r);return n=g(n),{result:n,originalImage:e}}))}rotate(t,e,r){return rt(this,void 0,void 0,(function*(){let n=this.objectMap.get(t).rotate(e,r);return n=g(n),{result:n,originalImage:e}}))}applyFilter(t,e,r){return rt(this,void 0,void 0,(function*(){let n=this.objectMap.get(t).applyFilter(e,r);return n=g(n),{result:n,originalImage:e}}))}destroy(t){return rt(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"ImageProcessor")}}var ot=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};class it{constructor(t){this.getWasmModule=t,this.objectMap=new y}create(t){return ot(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=g(e),this.objectMap.add(e)}))}run(t,e){return ot(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=g(r),{result:r,originalImage:e}}))}clearResult(t){return ot(this,void 0,void 0,(function*(){return this.objectMap.get(t).clearResult()}))}destroy(t){return ot(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"MrzScanner")}}class at{constructor(t){this.getWasmModule=t,this.objectMap=new y}create(t){return ot(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=g(e),this.objectMap.add(e)}))}parse(t,e){return ot(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).parse(e);return r=g(r),r}))}destroy(t){return ot(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"MrzParser")}}var st=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};class ut{constructor(t){this.getWasmModule=t,this.objectMap=new y}create(){return st(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create();return t=g(t),this.objectMap.add(t)}))}run(t,e){return st(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=g(r),{result:r,originalImage:e}}))}destroy(t){return st(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"OcrEngine")}}var ct=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};class lt{constructor(t){this.getWasmModule=t,this.objectMap=new y}create(t){return ct(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=g(e),this.objectMap.add(e)}))}run(t,e){return ct(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=g(r),{result:r,originalImage:e}}))}cleanRecognitionQueue(t){return ct(this,void 0,void 0,(function*(){return this.objectMap.get(t).cleanRecognitionQueue()}))}destroy(t){return ct(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"TextPatternScanner")}}var dt=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};class ht{constructor(t){this.getWasmModule=t,this.objectMap=new y}create(t){return dt(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=g(e),this.objectMap.add(e)}))}run(t,e){return dt(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=g(r),{result:r,originalImage:e}}))}cleanRecognitionQueue(t){return dt(this,void 0,void 0,(function*(){return this.objectMap.get(t).cleanRecognitionQueue()}))}destroy(t){return dt(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"VinScanner")}}var ft=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};let pt;class mt extends Error{}const vt={};function yt(t){const e=Math.random().toString(36);return vt[e]=t,new v(e)}function gt(t){if(!vt.hasOwnProperty(t.id))throw new Error(`Object ${t.id} does not exist`);return vt[t.id]}function wt(t){const e=gt(t);e.delete&&e.delete(),delete vt[t.id]}new y,new y;const bt=Object.assign(Object.assign({initialize:function(t,e,o,i){return ft(this,void 0,void 0,(function*(){try{const{captureConsole:a,requestSuffix:s=""}=i||{};a&&(console.log=function(...t){self.postMessage({log:t})},console.error=function(...t){self.postMessage({logError:t})});const u=r(801),c=r(772),l={locateFile:function(t,r){let n;return n=function(t){return t.startsWith("http:")||t.startsWith("https:")}(e)?e:"",t.endsWith(".worker.js")&&c?c.default:new URL(n+t+s,location.href).href}},d=n(i),h=d.includes("-threads");l.mainScriptUrlOrBlob=l.locateFile(`ScanbotSDK.Asm${d}.js`);let f;if(!!navigator.userAgentData&&navigator.userAgentData.brands.some((t=>"Chromium"===t.brand))&&h){let t=[2147483648,805306368,536870912],e=134217728;const r=67108864;["barcode-scanner"].includes("document-scanner")&&(e=r,t.push(4*r));for(let r=0;r<t.length;r++){const n=t[r];try{f=new WebAssembly.Memory({initial:0,maximum:n/65536,shared:!0}),f.grow(e/65536);break}catch(e){if(r===t.length-1)throw e}}}return f&&(l.wasmMemory=f),l.onAbort=function(t){const e="\nNo further calls to the SDK are possible.";throw new mt("OOM"===t?"ScanbotSDK ran out of memory. "+e:"ScanbotSDK ran into an unexpected error: "+t+e)},yield u(l),pt=l,g(pt.initialize(t||"",o))}catch(t){throw console.error(t),t}}))},getLicenseInfo:function(){return ft(this,void 0,void 0,(function*(){return g(pt.getLicenseInfo())}))},encodeJpeg:function(t,e=80){return ft(this,void 0,void 0,(function*(){return g(pt.encodeJpeg(t,e))}))},beginPdf:function(t){return ft(this,void 0,void 0,(function*(){return yt(g(I(pt,"PdfGenerationContext").create(new T(t))))}))},addPageToPdf:function(t,e,r="ENABLED_IF_BINARIZATION_FILTER_SET"){return ft(this,void 0,void 0,(function*(){g(gt(t).addPage(e,r))}))},addPageToPdfWithOcr:function(t,e,r="ENABLED_IF_BINARIZATION_FILTER_SET"){return ft(this,void 0,void 0,(function*(){g(gt(t).addPageWithOcr(e,r))}))},completePdf:function(t){return ft(this,void 0,void 0,(function*(){try{const e=gt(t);return g(e.complete())}finally{wt(t)}}))},beginTiff:function(t){return ft(this,void 0,void 0,(function*(){const e=g(I(pt,"TiffGenerationContext").create(new O(t)));return g(e.begin()),yt(e)}))},addPageToTiff:function(t,e,r){return ft(this,void 0,void 0,(function*(){g(gt(t).addPage(e,r))}))},completeTiff:function(t){return ft(this,void 0,void 0,(function*(){try{const e=gt(t);return g(e.complete())}finally{wt(t)}}))},releaseObject:function(t){return ft(this,void 0,void 0,(function*(){wt(t)}))},version:function(){return ft(this,void 0,void 0,(function*(){return"8.1.0"}))}},{BarcodeDocumentParser:new R(Et=()=>pt),BarcodeScanner:new U(Et),CheckScanner:new L(Et),CreditCardScanner:new V(Et),DocumentClassifier:new q(Et),DocumentDataExtractor:new G(Et),DocumentQualityAnalyzer:new X(Et),DocumentScanner:new Z(Et),ImageManipulator:new et(Et),ImageProcessor:new nt(Et),MrzScanner:new it(Et),MrzParser:new at(Et),OcrEngine:new ut(Et),TextPatternScanner:new lt(Et),VinScanner:new ht(Et)}),{__hasModuleFunction:function(t){return ft(this,void 0,void 0,(function*(){return pt.hasOwnProperty(t)}))},__callModuleFunction:function(t,e=[]){return ft(this,void 0,void 0,(function*(){return pt[t](...e)}))}});var Et;onmessage=function(t){const{command:e,args:r,ticket:n}=t.data;if(!pt&&"initialize"!==e)return void self.postMessage({ticket:n,recoverableError:new Error("WASM module not loaded yet.")});let o;o=e.includes(".")?bt[e.split(".")[0]][e.split(".")[1]](...r):bt[e](...r),(()=>ft(this,void 0,void 0,(function*(){return yield o})))().then((t=>{const e=function(t,e=!1){const r=[];return e||function t(e){if(e)if(e.constructor===ImageData)r.push(e.data.buffer);else if(e.constructor===ArrayBuffer)r.push(e);else if(ArrayBuffer.isView(e))r.push(e.buffer);else if(Array.isArray(e))for(let r=0;r<e.length;++r)t(e[r]);else if("object"==typeof e)for(const r in e)e.hasOwnProperty(r)&&t(e[r])}(t),r}(t);self.postMessage({ticket:n,result:t},e)})).catch((t=>{if(t instanceof mt)self.postMessage({ticket:n,unrecoverableError:t});else{const e="number"==typeof t?Error(pt.stringFromException(t)):t;console.error(e),self.postMessage({ticket:n,recoverableError:e,errorType:null==e?void 0:e.errorType})}}))}})()})();
1
+ (()=>{var t={772:()=>{},801:(t,e,r)=>{var n,o=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(t={}){var e,o,i=t;i.ready=new Promise(((t,r)=>{e=t,o=r}));var a,s,u,c=Object.assign({},i),l="./this.program",d=(t,e)=>{throw e},h="";h=self.location.href,n&&(h=n),h=0!==h.indexOf("blob:")?h.substr(0,h.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},u=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)},s=(t,e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?e(n.response):r()},n.onerror=r,n.send(null)};var f,p=i.print||console.log.bind(console),m=i.printErr||console.error.bind(console);Object.assign(i,c),c=null,i.arguments&&i.arguments,i.thisProgram&&(l=i.thisProgram),i.quit&&(d=i.quit),i.wasmBinary&&(f=i.wasmBinary);var v,g=i.noExitRuntime||!0;"object"!=typeof WebAssembly&&U("no native wasm support detected");var y,w,b,E,_,k,C,M,$,P=!1;function S(){var t=v.buffer;i.HEAP8=y=new Int8Array(t),i.HEAP16=b=new Int16Array(t),i.HEAPU8=w=new Uint8Array(t),i.HEAPU16=E=new Uint16Array(t),i.HEAP32=_=new Int32Array(t),i.HEAPU32=k=new Uint32Array(t),i.HEAPF32=C=new Float32Array(t),i.HEAPF64=M=new Float64Array(t)}var F,T,j,D,W=[],A=[],x=[],O=0,I=null,R=null;function z(t){O++,i.monitorRunDependencies&&i.monitorRunDependencies(O)}function N(t){if(O--,i.monitorRunDependencies&&i.monitorRunDependencies(O),0==O&&(null!==I&&(clearInterval(I),I=null),R)){var e=R;R=null,e()}}function U(t){i.onAbort&&i.onAbort(t),m(t="Aborted("+t+")"),P=!0,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw o(e),e}function L(t){return t.startsWith("data:application/octet-stream;base64,")}function B(t){if(t==F&&f)return new Uint8Array(f);if(u)return u(t);throw"both async and sync fetching of the wasm failed"}function H(t,e,r){return function(t){return f||"function"!=typeof fetch?Promise.resolve().then((()=>B(t))):fetch(t,{credentials:"same-origin"}).then((e=>{if(!e.ok)throw"failed to load wasm binary file at '"+t+"'";return e.arrayBuffer()})).catch((()=>B(t)))}(t).then((t=>WebAssembly.instantiate(t,e))).then((t=>t)).then(r,(t=>{m(`failed to asynchronously prepare wasm: ${t}`),U(t)}))}L(F="ScanbotSDK.Asm-simd.wasm")||(T=F,F=i.locateFile?i.locateFile(T,h):h+T);var V={1463040:t=>dr(function(){return this[K(t)].toString()}.apply(function(){return this}.call(void 0)))};function Y(t){this.name="ExitStatus",this.message=`Program terminated with exit(${t})`,this.status=t}var Q=t=>{for(;t.length>0;)t.shift()(i)},q="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,G=(t,e,r)=>{for(var n=e+r,o=e;t[o]&&!(o>=n);)++o;if(o-e>16&&t.buffer&&q)return q.decode(t.subarray(e,o));for(var i="";e<o;){var a=t[e++];if(128&a){var s=63&t[e++];if(192!=(224&a)){var u=63&t[e++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&t[e++])<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i},K=(t,e)=>t?G(w,t,e):"",X=[],Z=0,J=0;function tt(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(t){k[this.ptr+4>>2]=t},this.get_type=function(){return k[this.ptr+4>>2]},this.set_destructor=function(t){k[this.ptr+8>>2]=t},this.get_destructor=function(){return k[this.ptr+8>>2]},this.set_caught=function(t){t=t?1:0,y[this.ptr+12>>0]=t},this.get_caught=function(){return 0!=y[this.ptr+12>>0]},this.set_rethrown=function(t){t=t?1:0,y[this.ptr+13>>0]=t},this.get_rethrown=function(){return 0!=y[this.ptr+13>>0]},this.init=function(t,e){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(e)},this.set_adjusted_ptr=function(t){k[this.ptr+16>>2]=t},this.get_adjusted_ptr=function(){return k[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Tr(this.get_type()))return k[this.excPtr>>2];var t=this.get_adjusted_ptr();return 0!==t?t:this.excPtr}}var et=t=>{var e=J;if(!e)return Er(0),0;var r=new tt(e);r.set_adjusted_ptr(e);var n=r.get_type();if(!n)return Er(0),e;for(var o in t){var i=t[o];if(0===i||i===n)break;var a=r.ptr+16;if(Fr(i,n,a))return Er(i),e}return Er(n),e},rt=()=>{var t=X.pop();t||U("no exception to throw");var e=t.excPtr;throw t.get_rethrown()||(X.push(t),t.set_rethrown(!0),t.set_caught(!1),Z++),J=e},nt={isAbs:t=>"/"===t.charAt(0),splitPath:t=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1),normalizeArray:(t,e)=>{for(var r=0,n=t.length-1;n>=0;n--){var o=t[n];"."===o?t.splice(n,1):".."===o?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r;r--)t.unshift("..");return t},normalize:t=>{var e=nt.isAbs(t),r="/"===t.substr(-1);return(t=nt.normalizeArray(t.split("/").filter((t=>!!t)),!e).join("/"))||e||(t="."),t&&r&&(t+="/"),(e?"/":"")+t},dirname:t=>{var e=nt.splitPath(t),r=e[0],n=e[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:t=>{if("/"===t)return"/";var e=(t=(t=nt.normalize(t)).replace(/\/$/,"")).lastIndexOf("/");return-1===e?t:t.substr(e+1)},join:function(){var t=Array.prototype.slice.call(arguments);return nt.normalize(t.join("/"))},join2:(t,e)=>nt.normalize(t+"/"+e)},ot=t=>(ot=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return t=>crypto.getRandomValues(t);U("initRandomDevice")})())(t),it={resolve:function(){for(var t="",e=!1,r=arguments.length-1;r>=-1&&!e;r--){var n=r>=0?arguments[r]:vt.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";t=n+"/"+t,e=nt.isAbs(n)}return(e?"/":"")+(t=nt.normalizeArray(t.split("/").filter((t=>!!t)),!e).join("/"))||"."},relative:(t,e)=>{function r(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;r>=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=it.resolve(t).substr(1),e=it.resolve(e).substr(1);for(var n=r(t.split("/")),o=r(e.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var u=[];for(s=a;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(a))).join("/")}},at=[],st=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++r):e+=3}return e},ut=(t,e,r,n)=>{if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a<t.length;++a){var s=t.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&t.charCodeAt(++a)),s<=127){if(r>=i)break;e[r++]=s}else if(s<=2047){if(r+1>=i)break;e[r++]=192|s>>6,e[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;e[r++]=224|s>>12,e[r++]=128|s>>6&63,e[r++]=128|63&s}else{if(r+3>=i)break;e[r++]=240|s>>18,e[r++]=128|s>>12&63,e[r++]=128|s>>6&63,e[r++]=128|63&s}}return e[r]=0,r-o};function ct(t,e,r){var n=r>0?r:st(t)+1,o=new Array(n),i=ut(t,o,0,o.length);return e&&(o.length=i),o}var lt={ttys:[],init(){},shutdown(){},register(t,e){lt.ttys[t]={input:[],output:[],ops:e},vt.registerDevice(t,lt.stream_ops)},stream_ops:{open(t){var e=lt.ttys[t.node.rdev];if(!e)throw new vt.ErrnoError(43);t.tty=e,t.seekable=!1},close(t){t.tty.ops.fsync(t.tty)},fsync(t){t.tty.ops.fsync(t.tty)},read(t,e,r,n,o){if(!t.tty||!t.tty.ops.get_char)throw new vt.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=t.tty.ops.get_char(t.tty)}catch(t){throw new vt.ErrnoError(29)}if(void 0===s&&0===i)throw new vt.ErrnoError(6);if(null==s)break;i++,e[r+a]=s}return i&&(t.node.timestamp=Date.now()),i},write(t,e,r,n,o){if(!t.tty||!t.tty.ops.put_char)throw new vt.ErrnoError(60);try{for(var i=0;i<n;i++)t.tty.ops.put_char(t.tty,e[r+i])}catch(t){throw new vt.ErrnoError(29)}return n&&(t.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:t=>(()=>{if(!at.length){var t=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n"),!t)return null;at=ct(t,!0)}return at.shift()})(),put_char(t,e){null===e||10===e?(p(G(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},fsync(t){t.output&&t.output.length>0&&(p(G(t.output,0)),t.output=[])},ioctl_tcgets:t=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(t,e,r)=>0,ioctl_tiocgwinsz:t=>[24,80]},default_tty1_ops:{put_char(t,e){null===e||10===e?(m(G(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},fsync(t){t.output&&t.output.length>0&&(m(G(t.output,0)),t.output=[])}}},dt=t=>{t=((t,e)=>Math.ceil(t/e)*e)(t,65536);var e=kr(65536,t);return e?((t,e)=>(w.fill(0,t,t+e),t))(e,t):0},ht={ops_table:null,mount:t=>ht.createNode(null,"/",16895,0),createNode(t,e,r,n){if(vt.isBlkdev(r)||vt.isFIFO(r))throw new vt.ErrnoError(63);ht.ops_table||(ht.ops_table={dir:{node:{getattr:ht.node_ops.getattr,setattr:ht.node_ops.setattr,lookup:ht.node_ops.lookup,mknod:ht.node_ops.mknod,rename:ht.node_ops.rename,unlink:ht.node_ops.unlink,rmdir:ht.node_ops.rmdir,readdir:ht.node_ops.readdir,symlink:ht.node_ops.symlink},stream:{llseek:ht.stream_ops.llseek}},file:{node:{getattr:ht.node_ops.getattr,setattr:ht.node_ops.setattr},stream:{llseek:ht.stream_ops.llseek,read:ht.stream_ops.read,write:ht.stream_ops.write,allocate:ht.stream_ops.allocate,mmap:ht.stream_ops.mmap,msync:ht.stream_ops.msync}},link:{node:{getattr:ht.node_ops.getattr,setattr:ht.node_ops.setattr,readlink:ht.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ht.node_ops.getattr,setattr:ht.node_ops.setattr},stream:vt.chrdev_stream_ops}});var o=vt.createNode(t,e,r,n);return vt.isDir(o.mode)?(o.node_ops=ht.ops_table.dir.node,o.stream_ops=ht.ops_table.dir.stream,o.contents={}):vt.isFile(o.mode)?(o.node_ops=ht.ops_table.file.node,o.stream_ops=ht.ops_table.file.stream,o.usedBytes=0,o.contents=null):vt.isLink(o.mode)?(o.node_ops=ht.ops_table.link.node,o.stream_ops=ht.ops_table.link.stream):vt.isChrdev(o.mode)&&(o.node_ops=ht.ops_table.chrdev.node,o.stream_ops=ht.ops_table.chrdev.stream),o.timestamp=Date.now(),t&&(t.contents[e]=o,t.timestamp=o.timestamp),o},getFileDataAsTypedArray:t=>t.contents?t.contents.subarray?t.contents.subarray(0,t.usedBytes):new Uint8Array(t.contents):new Uint8Array(0),expandFileStorage(t,e){var r=t.contents?t.contents.length:0;if(!(r>=e)){e=Math.max(e,r*(r<1048576?2:1.125)>>>0),0!=r&&(e=Math.max(e,256));var n=t.contents;t.contents=new Uint8Array(e),t.usedBytes>0&&t.contents.set(n.subarray(0,t.usedBytes),0)}},resizeFileStorage(t,e){if(t.usedBytes!=e)if(0==e)t.contents=null,t.usedBytes=0;else{var r=t.contents;t.contents=new Uint8Array(e),r&&t.contents.set(r.subarray(0,Math.min(e,t.usedBytes))),t.usedBytes=e}},node_ops:{getattr(t){var e={};return e.dev=vt.isChrdev(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,vt.isDir(t.mode)?e.size=4096:vt.isFile(t.mode)?e.size=t.usedBytes:vt.isLink(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.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr(t,e){void 0!==e.mode&&(t.mode=e.mode),void 0!==e.timestamp&&(t.timestamp=e.timestamp),void 0!==e.size&&ht.resizeFileStorage(t,e.size)},lookup(t,e){throw vt.genericErrors[44]},mknod:(t,e,r,n)=>ht.createNode(t,e,r,n),rename(t,e,r){if(vt.isDir(t.mode)){var n;try{n=vt.lookupNode(e,r)}catch(t){}if(n)for(var o in n.contents)throw new vt.ErrnoError(55)}delete t.parent.contents[t.name],t.parent.timestamp=Date.now(),t.name=r,e.contents[r]=t,e.timestamp=t.parent.timestamp,t.parent=e},unlink(t,e){delete t.contents[e],t.timestamp=Date.now()},rmdir(t,e){var r=vt.lookupNode(t,e);for(var n in r.contents)throw new vt.ErrnoError(55);delete t.contents[e],t.timestamp=Date.now()},readdir(t){var e=[".",".."];for(var r in t.contents)t.contents.hasOwnProperty(r)&&e.push(r);return e},symlink(t,e,r){var n=ht.createNode(t,e,41471,0);return n.link=r,n},readlink(t){if(!vt.isLink(t.mode))throw new vt.ErrnoError(28);return t.link}},stream_ops:{read(t,e,r,n,o){var i=t.node.contents;if(o>=t.node.usedBytes)return 0;var a=Math.min(t.node.usedBytes-o,n);if(a>8&&i.subarray)e.set(i.subarray(o,o+a),r);else for(var s=0;s<a;s++)e[r+s]=i[o+s];return a},write(t,e,r,n,o,i){if(e.buffer===y.buffer&&(i=!1),!n)return 0;var a=t.node;if(a.timestamp=Date.now(),e.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=e.subarray(r,r+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=e.slice(r,r+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(e.subarray(r,r+n),o),n}if(ht.expandFileStorage(a,o+n),a.contents.subarray&&e.subarray)a.contents.set(e.subarray(r,r+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=e[r+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek(t,e,r){var n=e;if(1===r?n+=t.position:2===r&&vt.isFile(t.node.mode)&&(n+=t.node.usedBytes),n<0)throw new vt.ErrnoError(28);return n},allocate(t,e,r){ht.expandFileStorage(t.node,e+r),t.node.usedBytes=Math.max(t.node.usedBytes,e+r)},mmap(t,e,r,n,o){if(!vt.isFile(t.node.mode))throw new vt.ErrnoError(43);var i,a,s=t.node.contents;if(2&o||s.buffer!==y.buffer){if((r>0||r+e<s.length)&&(s=s.subarray?s.subarray(r,r+e):Array.prototype.slice.call(s,r,r+e)),a=!0,!(i=dt(e)))throw new vt.ErrnoError(48);y.set(s,i)}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:(t,e,r,n,o)=>(ht.stream_ops.write(t,e,0,n,r,!1),0)}},ft=(t,e,r,n)=>{var o=n?"":`al ${t}`;s(t,(r=>{var n;n=`Loading data file "${t}" failed (no arrayBuffer).`,r||U(n),e(new Uint8Array(r)),o&&N()}),(e=>{if(!r)throw`Loading data file "${t}" failed.`;r()})),o&&z()},pt=i.preloadPlugins||[],mt=(t,e)=>{var r=0;return t&&(r|=365),e&&(r|=146),r},vt={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(t,e={}){if(!(t=it.resolve(t)))return{path:"",node:null};if((e=Object.assign({follow_mount:!0,recurse_count:0},e)).recurse_count>8)throw new vt.ErrnoError(32);for(var r=t.split("/").filter((t=>!!t)),n=vt.root,o="/",i=0;i<r.length;i++){var a=i===r.length-1;if(a&&e.parent)break;if(n=vt.lookupNode(n,r[i]),o=nt.join2(o,r[i]),vt.isMountpoint(n)&&(!a||a&&e.follow_mount)&&(n=n.mounted.root),!a||e.follow)for(var s=0;vt.isLink(n.mode);){var u=vt.readlink(o);if(o=it.resolve(nt.dirname(o),u),n=vt.lookupPath(o,{recurse_count:e.recurse_count+1}).node,s++>40)throw new vt.ErrnoError(32)}}return{path:o,node:n}},getPath(t){for(var e;;){if(vt.isRoot(t)){var r=t.mount.mountpoint;return e?"/"!==r[r.length-1]?`${r}/${e}`:r+e:r}e=e?`${t.name}/${e}`:t.name,t=t.parent}},hashName(t,e){for(var r=0,n=0;n<e.length;n++)r=(r<<5)-r+e.charCodeAt(n)|0;return(t+r>>>0)%vt.nameTable.length},hashAddNode(t){var e=vt.hashName(t.parent.id,t.name);t.name_next=vt.nameTable[e],vt.nameTable[e]=t},hashRemoveNode(t){var e=vt.hashName(t.parent.id,t.name);if(vt.nameTable[e]===t)vt.nameTable[e]=t.name_next;else for(var r=vt.nameTable[e];r;){if(r.name_next===t){r.name_next=t.name_next;break}r=r.name_next}},lookupNode(t,e){var r=vt.mayLookup(t);if(r)throw new vt.ErrnoError(r,t);for(var n=vt.hashName(t.id,e),o=vt.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===t.id&&i===e)return o}return vt.lookup(t,e)},createNode(t,e,r,n){var o=new vt.FSNode(t,e,r,n);return vt.hashAddNode(o),o},destroyNode(t){vt.hashRemoveNode(t)},isRoot:t=>t===t.parent,isMountpoint:t=>!!t.mounted,isFile:t=>32768==(61440&t),isDir:t=>16384==(61440&t),isLink:t=>40960==(61440&t),isChrdev:t=>8192==(61440&t),isBlkdev:t=>24576==(61440&t),isFIFO:t=>4096==(61440&t),isSocket:t=>49152==(49152&t),flagsToPermissionString(t){var e=["r","w","rw"][3&t];return 512&t&&(e+="w"),e},nodePermissions:(t,e)=>vt.ignorePermissions||(!e.includes("r")||292&t.mode)&&(!e.includes("w")||146&t.mode)&&(!e.includes("x")||73&t.mode)?0:2,mayLookup(t){var e=vt.nodePermissions(t,"x");return e||(t.node_ops.lookup?0:2)},mayCreate(t,e){try{return vt.lookupNode(t,e),20}catch(t){}return vt.nodePermissions(t,"wx")},mayDelete(t,e,r){var n;try{n=vt.lookupNode(t,e)}catch(t){return t.errno}var o=vt.nodePermissions(t,"wx");if(o)return o;if(r){if(!vt.isDir(n.mode))return 54;if(vt.isRoot(n)||vt.getPath(n)===vt.cwd())return 10}else if(vt.isDir(n.mode))return 31;return 0},mayOpen:(t,e)=>t?vt.isLink(t.mode)?32:vt.isDir(t.mode)&&("r"!==vt.flagsToPermissionString(e)||512&e)?31:vt.nodePermissions(t,vt.flagsToPermissionString(e)):44,MAX_OPEN_FDS:4096,nextfd(){for(var t=0;t<=vt.MAX_OPEN_FDS;t++)if(!vt.streams[t])return t;throw new vt.ErrnoError(33)},getStreamChecked(t){var e=vt.getStream(t);if(!e)throw new vt.ErrnoError(8);return e},getStream:t=>vt.streams[t],createStream:(t,e=-1)=>(vt.FSStream||(vt.FSStream=function(){this.shared={}},vt.FSStream.prototype={},Object.defineProperties(vt.FSStream.prototype,{object:{get(){return this.node},set(t){this.node=t}},isRead:{get(){return 1!=(2097155&this.flags)}},isWrite:{get(){return 0!=(2097155&this.flags)}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(t){this.shared.flags=t}},position:{get(){return this.shared.position},set(t){this.shared.position=t}}})),t=Object.assign(new vt.FSStream,t),-1==e&&(e=vt.nextfd()),t.fd=e,vt.streams[e]=t,t),closeStream(t){vt.streams[t]=null},chrdev_stream_ops:{open(t){var e=vt.getDevice(t.node.rdev);t.stream_ops=e.stream_ops,t.stream_ops.open&&t.stream_ops.open(t)},llseek(){throw new vt.ErrnoError(70)}},major:t=>t>>8,minor:t=>255&t,makedev:(t,e)=>t<<8|e,registerDevice(t,e){vt.devices[t]={stream_ops:e}},getDevice:t=>vt.devices[t],getMounts(t){for(var e=[],r=[t];r.length;){var n=r.pop();e.push(n),r.push.apply(r,n.mounts)}return e},syncfs(t,e){"function"==typeof t&&(e=t,t=!1),vt.syncFSRequests++,vt.syncFSRequests>1&&m(`warning: ${vt.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var r=vt.getMounts(vt.root.mount),n=0;function o(t){return vt.syncFSRequests--,e(t)}function i(t){if(t)return i.errored?void 0:(i.errored=!0,o(t));++n>=r.length&&o(null)}r.forEach((e=>{if(!e.type.syncfs)return i(null);e.type.syncfs(e,t,i)}))},mount(t,e,r){var n,o="/"===r,i=!r;if(o&&vt.root)throw new vt.ErrnoError(10);if(!o&&!i){var a=vt.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,vt.isMountpoint(n))throw new vt.ErrnoError(10);if(!vt.isDir(n.mode))throw new vt.ErrnoError(54)}var s={type:t,opts:e,mountpoint:r,mounts:[]},u=t.mount(s);return u.mount=s,s.root=u,o?vt.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount(t){var e=vt.lookupPath(t,{follow_mount:!1});if(!vt.isMountpoint(e.node))throw new vt.ErrnoError(28);var r=e.node,n=r.mounted,o=vt.getMounts(n);Object.keys(vt.nameTable).forEach((t=>{for(var e=vt.nameTable[t];e;){var r=e.name_next;o.includes(e.mount)&&vt.destroyNode(e),e=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(n);r.mount.mounts.splice(i,1)},lookup:(t,e)=>t.node_ops.lookup(t,e),mknod(t,e,r){var n=vt.lookupPath(t,{parent:!0}).node,o=nt.basename(t);if(!o||"."===o||".."===o)throw new vt.ErrnoError(28);var i=vt.mayCreate(n,o);if(i)throw new vt.ErrnoError(i);if(!n.node_ops.mknod)throw new vt.ErrnoError(63);return n.node_ops.mknod(n,o,e,r)},create:(t,e)=>(e=void 0!==e?e:438,e&=4095,e|=32768,vt.mknod(t,e,0)),mkdir:(t,e)=>(e=void 0!==e?e:511,e&=1023,e|=16384,vt.mknod(t,e,0)),mkdirTree(t,e){for(var r=t.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{vt.mkdir(n,e)}catch(t){if(20!=t.errno)throw t}}},mkdev:(t,e,r)=>("undefined"==typeof r&&(r=e,e=438),e|=8192,vt.mknod(t,e,r)),symlink(t,e){if(!it.resolve(t))throw new vt.ErrnoError(44);var r=vt.lookupPath(e,{parent:!0}).node;if(!r)throw new vt.ErrnoError(44);var n=nt.basename(e),o=vt.mayCreate(r,n);if(o)throw new vt.ErrnoError(o);if(!r.node_ops.symlink)throw new vt.ErrnoError(63);return r.node_ops.symlink(r,n,t)},rename(t,e){var r,n,o=nt.dirname(t),i=nt.dirname(e),a=nt.basename(t),s=nt.basename(e);if(r=vt.lookupPath(t,{parent:!0}).node,n=vt.lookupPath(e,{parent:!0}).node,!r||!n)throw new vt.ErrnoError(44);if(r.mount!==n.mount)throw new vt.ErrnoError(75);var u,c=vt.lookupNode(r,a),l=it.relative(t,i);if("."!==l.charAt(0))throw new vt.ErrnoError(28);if("."!==(l=it.relative(e,o)).charAt(0))throw new vt.ErrnoError(55);try{u=vt.lookupNode(n,s)}catch(t){}if(c!==u){var d=vt.isDir(c.mode),h=vt.mayDelete(r,a,d);if(h)throw new vt.ErrnoError(h);if(h=u?vt.mayDelete(n,s,d):vt.mayCreate(n,s))throw new vt.ErrnoError(h);if(!r.node_ops.rename)throw new vt.ErrnoError(63);if(vt.isMountpoint(c)||u&&vt.isMountpoint(u))throw new vt.ErrnoError(10);if(n!==r&&(h=vt.nodePermissions(r,"w")))throw new vt.ErrnoError(h);vt.hashRemoveNode(c);try{r.node_ops.rename(c,n,s)}catch(t){throw t}finally{vt.hashAddNode(c)}}},rmdir(t){var e=vt.lookupPath(t,{parent:!0}).node,r=nt.basename(t),n=vt.lookupNode(e,r),o=vt.mayDelete(e,r,!0);if(o)throw new vt.ErrnoError(o);if(!e.node_ops.rmdir)throw new vt.ErrnoError(63);if(vt.isMountpoint(n))throw new vt.ErrnoError(10);e.node_ops.rmdir(e,r),vt.destroyNode(n)},readdir(t){var e=vt.lookupPath(t,{follow:!0}).node;if(!e.node_ops.readdir)throw new vt.ErrnoError(54);return e.node_ops.readdir(e)},unlink(t){var e=vt.lookupPath(t,{parent:!0}).node;if(!e)throw new vt.ErrnoError(44);var r=nt.basename(t),n=vt.lookupNode(e,r),o=vt.mayDelete(e,r,!1);if(o)throw new vt.ErrnoError(o);if(!e.node_ops.unlink)throw new vt.ErrnoError(63);if(vt.isMountpoint(n))throw new vt.ErrnoError(10);e.node_ops.unlink(e,r),vt.destroyNode(n)},readlink(t){var e=vt.lookupPath(t).node;if(!e)throw new vt.ErrnoError(44);if(!e.node_ops.readlink)throw new vt.ErrnoError(28);return it.resolve(vt.getPath(e.parent),e.node_ops.readlink(e))},stat(t,e){var r=vt.lookupPath(t,{follow:!e}).node;if(!r)throw new vt.ErrnoError(44);if(!r.node_ops.getattr)throw new vt.ErrnoError(63);return r.node_ops.getattr(r)},lstat:t=>vt.stat(t,!0),chmod(t,e,r){var n;if(!(n="string"==typeof t?vt.lookupPath(t,{follow:!r}).node:t).node_ops.setattr)throw new vt.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&e|-4096&n.mode,timestamp:Date.now()})},lchmod(t,e){vt.chmod(t,e,!0)},fchmod(t,e){var r=vt.getStreamChecked(t);vt.chmod(r.node,e)},chown(t,e,r,n){var o;if(!(o="string"==typeof t?vt.lookupPath(t,{follow:!n}).node:t).node_ops.setattr)throw new vt.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(t,e,r){vt.chown(t,e,r,!0)},fchown(t,e,r){var n=vt.getStreamChecked(t);vt.chown(n.node,e,r)},truncate(t,e){if(e<0)throw new vt.ErrnoError(28);var r;if(!(r="string"==typeof t?vt.lookupPath(t,{follow:!0}).node:t).node_ops.setattr)throw new vt.ErrnoError(63);if(vt.isDir(r.mode))throw new vt.ErrnoError(31);if(!vt.isFile(r.mode))throw new vt.ErrnoError(28);var n=vt.nodePermissions(r,"w");if(n)throw new vt.ErrnoError(n);r.node_ops.setattr(r,{size:e,timestamp:Date.now()})},ftruncate(t,e){var r=vt.getStreamChecked(t);if(0==(2097155&r.flags))throw new vt.ErrnoError(28);vt.truncate(r.node,e)},utime(t,e,r){var n=vt.lookupPath(t,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(e,r)})},open(t,e,r){if(""===t)throw new vt.ErrnoError(44);var n;if(r="undefined"==typeof r?438:r,r=64&(e="string"==typeof e?(t=>{var e={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[t];if("undefined"==typeof e)throw new Error(`Unknown file open mode: ${t}`);return e})(e):e)?4095&r|32768:0,"object"==typeof t)n=t;else{t=nt.normalize(t);try{n=vt.lookupPath(t,{follow:!(131072&e)}).node}catch(t){}}var o=!1;if(64&e)if(n){if(128&e)throw new vt.ErrnoError(20)}else n=vt.mknod(t,r,0),o=!0;if(!n)throw new vt.ErrnoError(44);if(vt.isChrdev(n.mode)&&(e&=-513),65536&e&&!vt.isDir(n.mode))throw new vt.ErrnoError(54);if(!o){var a=vt.mayOpen(n,e);if(a)throw new vt.ErrnoError(a)}512&e&&!o&&vt.truncate(n,0),e&=-131713;var s=vt.createStream({node:n,path:vt.getPath(n),flags:e,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!i.logReadFiles||1&e||(vt.readFiles||(vt.readFiles={}),t in vt.readFiles||(vt.readFiles[t]=1)),s},close(t){if(vt.isClosed(t))throw new vt.ErrnoError(8);t.getdents&&(t.getdents=null);try{t.stream_ops.close&&t.stream_ops.close(t)}catch(t){throw t}finally{vt.closeStream(t.fd)}t.fd=null},isClosed:t=>null===t.fd,llseek(t,e,r){if(vt.isClosed(t))throw new vt.ErrnoError(8);if(!t.seekable||!t.stream_ops.llseek)throw new vt.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new vt.ErrnoError(28);return t.position=t.stream_ops.llseek(t,e,r),t.ungotten=[],t.position},read(t,e,r,n,o){if(n<0||o<0)throw new vt.ErrnoError(28);if(vt.isClosed(t))throw new vt.ErrnoError(8);if(1==(2097155&t.flags))throw new vt.ErrnoError(8);if(vt.isDir(t.node.mode))throw new vt.ErrnoError(31);if(!t.stream_ops.read)throw new vt.ErrnoError(28);var i="undefined"!=typeof o;if(i){if(!t.seekable)throw new vt.ErrnoError(70)}else o=t.position;var a=t.stream_ops.read(t,e,r,n,o);return i||(t.position+=a),a},write(t,e,r,n,o,i){if(n<0||o<0)throw new vt.ErrnoError(28);if(vt.isClosed(t))throw new vt.ErrnoError(8);if(0==(2097155&t.flags))throw new vt.ErrnoError(8);if(vt.isDir(t.node.mode))throw new vt.ErrnoError(31);if(!t.stream_ops.write)throw new vt.ErrnoError(28);t.seekable&&1024&t.flags&&vt.llseek(t,0,2);var a="undefined"!=typeof o;if(a){if(!t.seekable)throw new vt.ErrnoError(70)}else o=t.position;var s=t.stream_ops.write(t,e,r,n,o,i);return a||(t.position+=s),s},allocate(t,e,r){if(vt.isClosed(t))throw new vt.ErrnoError(8);if(e<0||r<=0)throw new vt.ErrnoError(28);if(0==(2097155&t.flags))throw new vt.ErrnoError(8);if(!vt.isFile(t.node.mode)&&!vt.isDir(t.node.mode))throw new vt.ErrnoError(43);if(!t.stream_ops.allocate)throw new vt.ErrnoError(138);t.stream_ops.allocate(t,e,r)},mmap(t,e,r,n,o){if(0!=(2&n)&&0==(2&o)&&2!=(2097155&t.flags))throw new vt.ErrnoError(2);if(1==(2097155&t.flags))throw new vt.ErrnoError(2);if(!t.stream_ops.mmap)throw new vt.ErrnoError(43);return t.stream_ops.mmap(t,e,r,n,o)},msync:(t,e,r,n,o)=>t.stream_ops.msync?t.stream_ops.msync(t,e,r,n,o):0,munmap:t=>0,ioctl(t,e,r){if(!t.stream_ops.ioctl)throw new vt.ErrnoError(59);return t.stream_ops.ioctl(t,e,r)},readFile(t,e={}){if(e.flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding)throw new Error(`Invalid encoding type "${e.encoding}"`);var r,n=vt.open(t,e.flags),o=vt.stat(t).size,i=new Uint8Array(o);return vt.read(n,i,0,o,0),"utf8"===e.encoding?r=G(i,0):"binary"===e.encoding&&(r=i),vt.close(n),r},writeFile(t,e,r={}){r.flags=r.flags||577;var n=vt.open(t,r.flags,r.mode);if("string"==typeof e){var o=new Uint8Array(st(e)+1),i=ut(e,o,0,o.length);vt.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");vt.write(n,e,0,e.byteLength,void 0,r.canOwn)}vt.close(n)},cwd:()=>vt.currentPath,chdir(t){var e=vt.lookupPath(t,{follow:!0});if(null===e.node)throw new vt.ErrnoError(44);if(!vt.isDir(e.node.mode))throw new vt.ErrnoError(54);var r=vt.nodePermissions(e.node,"x");if(r)throw new vt.ErrnoError(r);vt.currentPath=e.path},createDefaultDirectories(){vt.mkdir("/tmp"),vt.mkdir("/home"),vt.mkdir("/home/web_user")},createDefaultDevices(){vt.mkdir("/dev"),vt.registerDevice(vt.makedev(1,3),{read:()=>0,write:(t,e,r,n,o)=>n}),vt.mkdev("/dev/null",vt.makedev(1,3)),lt.register(vt.makedev(5,0),lt.default_tty_ops),lt.register(vt.makedev(6,0),lt.default_tty1_ops),vt.mkdev("/dev/tty",vt.makedev(5,0)),vt.mkdev("/dev/tty1",vt.makedev(6,0));var t=new Uint8Array(1024),e=0,r=()=>(0===e&&(e=ot(t).byteLength),t[--e]);vt.createDevice("/dev","random",r),vt.createDevice("/dev","urandom",r),vt.mkdir("/dev/shm"),vt.mkdir("/dev/shm/tmp")},createSpecialDirectories(){vt.mkdir("/proc");var t=vt.mkdir("/proc/self");vt.mkdir("/proc/self/fd"),vt.mount({mount(){var e=vt.createNode(t,"fd",16895,73);return e.node_ops={lookup(t,e){var r=+e,n=vt.getStreamChecked(r),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},e}},{},"/proc/self/fd")},createStandardStreams(){i.stdin?vt.createDevice("/dev","stdin",i.stdin):vt.symlink("/dev/tty","/dev/stdin"),i.stdout?vt.createDevice("/dev","stdout",null,i.stdout):vt.symlink("/dev/tty","/dev/stdout"),i.stderr?vt.createDevice("/dev","stderr",null,i.stderr):vt.symlink("/dev/tty1","/dev/stderr"),vt.open("/dev/stdin",0),vt.open("/dev/stdout",1),vt.open("/dev/stderr",1)},ensureErrnoError(){vt.ErrnoError||(vt.ErrnoError=function(t,e){this.name="ErrnoError",this.node=e,this.setErrno=function(t){this.errno=t},this.setErrno(t),this.message="FS error"},vt.ErrnoError.prototype=new Error,vt.ErrnoError.prototype.constructor=vt.ErrnoError,[44].forEach((t=>{vt.genericErrors[t]=new vt.ErrnoError(t),vt.genericErrors[t].stack="<generic error, no stack>"})))},staticInit(){vt.ensureErrnoError(),vt.nameTable=new Array(4096),vt.mount(ht,{},"/"),vt.createDefaultDirectories(),vt.createDefaultDevices(),vt.createSpecialDirectories(),vt.filesystems={MEMFS:ht}},init(t,e,r){vt.init.initialized=!0,vt.ensureErrnoError(),i.stdin=t||i.stdin,i.stdout=e||i.stdout,i.stderr=r||i.stderr,vt.createStandardStreams()},quit(){vt.init.initialized=!1;for(var t=0;t<vt.streams.length;t++){var e=vt.streams[t];e&&vt.close(e)}},findObject(t,e){var r=vt.analyzePath(t,e);return r.exists?r.object:null},analyzePath(t,e){try{t=(n=vt.lookupPath(t,{follow:!e})).path}catch(t){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=vt.lookupPath(t,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=nt.basename(t),n=vt.lookupPath(t,{follow:!e}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(t){r.error=t.errno}return r},createPath(t,e,r,n){t="string"==typeof t?t:vt.getPath(t);for(var o=e.split("/").reverse();o.length;){var i=o.pop();if(i){var a=nt.join2(t,i);try{vt.mkdir(a)}catch(t){}t=a}}return a},createFile(t,e,r,n,o){var i=nt.join2("string"==typeof t?t:vt.getPath(t),e),a=mt(n,o);return vt.create(i,a)},createDataFile(t,e,r,n,o,i){var a=e;t&&(t="string"==typeof t?t:vt.getPath(t),a=e?nt.join2(t,e):t);var s=mt(n,o),u=vt.create(a,s);if(r){if("string"==typeof r){for(var c=new Array(r.length),l=0,d=r.length;l<d;++l)c[l]=r.charCodeAt(l);r=c}vt.chmod(u,146|s);var h=vt.open(u,577);vt.write(h,r,0,r.length,0,i),vt.close(h),vt.chmod(u,s)}return u},createDevice(t,e,r,n){var o=nt.join2("string"==typeof t?t:vt.getPath(t),e),i=mt(!!r,!!n);vt.createDevice.major||(vt.createDevice.major=64);var a=vt.makedev(vt.createDevice.major++,0);return vt.registerDevice(a,{open(t){t.seekable=!1},close(t){n&&n.buffer&&n.buffer.length&&n(10)},read(t,e,n,o,i){for(var a=0,s=0;s<o;s++){var u;try{u=r()}catch(t){throw new vt.ErrnoError(29)}if(void 0===u&&0===a)throw new vt.ErrnoError(6);if(null==u)break;a++,e[n+s]=u}return a&&(t.node.timestamp=Date.now()),a},write(t,e,r,o,i){for(var a=0;a<o;a++)try{n(e[r+a])}catch(t){throw new vt.ErrnoError(29)}return o&&(t.node.timestamp=Date.now()),a}}),vt.mkdev(o,i,a)},forceLoadFile(t){if(t.isDevice||t.isFolder||t.link||t.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!a)throw new Error("Cannot load without read() or XMLHttpRequest.");try{t.contents=ct(a(t.url),!0),t.usedBytes=t.contents.length}catch(t){throw new vt.ErrnoError(29)}},createLazyFile(t,e,r,n,o){function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(t){if(!(t>this.length-1||t<0)){var e=t%this.chunkSize,r=t/this.chunkSize|0;return this.getter(r)[e]}},i.prototype.setDataGetter=function(t){this.getter=t},i.prototype.cacheLength=function(){var t=new XMLHttpRequest;if(t.open("HEAD",r,!1),t.send(null),!(t.status>=200&&t.status<300||304===t.status))throw new Error("Couldn't load "+r+". Status: "+t.status);var e,n=Number(t.getResponseHeader("Content-length")),o=(e=t.getResponseHeader("Accept-Ranges"))&&"bytes"===e,i=(e=t.getResponseHeader("Content-Encoding"))&&"gzip"===e,a=1048576;o||(a=n);var s=this;s.setDataGetter((t=>{var e=t*a,o=(t+1)*a-1;if(o=Math.min(o,n-1),"undefined"==typeof s.chunks[t]&&(s.chunks[t]=((t,e)=>{if(t>e)throw new Error("invalid range ("+t+", "+e+") or no bytes requested!");if(e>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==a&&o.setRequestHeader("Range","bytes="+t+"-"+e),o.responseType="arraybuffer",o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):ct(o.responseText||"",!0)})(e,o)),"undefined"==typeof s.chunks[t])throw new Error("doXHR failed!");return s.chunks[t]})),!i&&n||(a=n=1,n=this.getter(0).length,a=n,p("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:a}}else s={isDevice:!1,url:r};var u=vt.createFile(t,e,s,n,o);s.contents?u.contents=s.contents:s.url&&(u.contents=null,u.url=s.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var c={};function l(t,e,r,n,o){var i=t.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var s=0;s<a;s++)e[r+s]=i[o+s];else for(s=0;s<a;s++)e[r+s]=i.get(o+s);return a}return Object.keys(u.stream_ops).forEach((t=>{var e=u.stream_ops[t];c[t]=function(){return vt.forceLoadFile(u),e.apply(null,arguments)}})),c.read=(t,e,r,n,o)=>(vt.forceLoadFile(u),l(t,e,r,n,o)),c.mmap=(t,e,r,n,o)=>{vt.forceLoadFile(u);var i=dt(e);if(!i)throw new vt.ErrnoError(48);return l(t,y,i,e,r),{ptr:i,allocated:!0}},u.stream_ops=c,u}},gt={DEFAULT_POLLMASK:5,calculateAt(t,e,r){if(nt.isAbs(e))return e;var n;if(n=-100===t?vt.cwd():gt.getStreamFromFD(t).path,0==e.length){if(!r)throw new vt.ErrnoError(44);return n}return nt.join2(n,e)},doStat(t,e,r){try{var n=t(e)}catch(t){if(t&&t.node&&nt.normalize(e)!==nt.normalize(vt.getPath(t.node)))return-54;throw t}_[r>>2]=n.dev,_[r+4>>2]=n.mode,k[r+8>>2]=n.nlink,_[r+12>>2]=n.uid,_[r+16>>2]=n.gid,_[r+20>>2]=n.rdev,D=[n.size>>>0,(j=n.size,+Math.abs(j)>=1?j>0?+Math.floor(j/4294967296)>>>0:~~+Math.ceil((j-+(~~j>>>0))/4294967296)>>>0:0)],_[r+24>>2]=D[0],_[r+28>>2]=D[1],_[r+32>>2]=4096,_[r+36>>2]=n.blocks;var o=n.atime.getTime(),i=n.mtime.getTime(),a=n.ctime.getTime();return D=[Math.floor(o/1e3)>>>0,(j=Math.floor(o/1e3),+Math.abs(j)>=1?j>0?+Math.floor(j/4294967296)>>>0:~~+Math.ceil((j-+(~~j>>>0))/4294967296)>>>0:0)],_[r+40>>2]=D[0],_[r+44>>2]=D[1],k[r+48>>2]=o%1e3*1e3,D=[Math.floor(i/1e3)>>>0,(j=Math.floor(i/1e3),+Math.abs(j)>=1?j>0?+Math.floor(j/4294967296)>>>0:~~+Math.ceil((j-+(~~j>>>0))/4294967296)>>>0:0)],_[r+56>>2]=D[0],_[r+60>>2]=D[1],k[r+64>>2]=i%1e3*1e3,D=[Math.floor(a/1e3)>>>0,(j=Math.floor(a/1e3),+Math.abs(j)>=1?j>0?+Math.floor(j/4294967296)>>>0:~~+Math.ceil((j-+(~~j>>>0))/4294967296)>>>0:0)],_[r+72>>2]=D[0],_[r+76>>2]=D[1],k[r+80>>2]=a%1e3*1e3,D=[n.ino>>>0,(j=n.ino,+Math.abs(j)>=1?j>0?+Math.floor(j/4294967296)>>>0:~~+Math.ceil((j-+(~~j>>>0))/4294967296)>>>0:0)],_[r+88>>2]=D[0],_[r+92>>2]=D[1],0},doMsync(t,e,r,n,o){if(!vt.isFile(e.node.mode))throw new vt.ErrnoError(43);if(2&n)return 0;var i=w.slice(t,t+r);vt.msync(e,i,o,r,n)},varargs:void 0,get(){var t=_[gt.varargs>>2];return gt.varargs+=4,t},getp:()=>gt.get(),getStr:t=>K(t),getStreamFromFD:t=>vt.getStreamChecked(t)},yt=(t,e)=>e+2097152>>>0<4194305-!!t?(t>>>0)+4294967296*e:NaN,wt=(t,e,r)=>ut(t,w,e,r),bt=void 0,Et=t=>{for(var e="",r=t;w[r];)e+=bt[w[r++]];return e},_t={},kt={},Ct={},Mt=void 0,$t=t=>{throw new Mt(t)},Pt=void 0,St=t=>{throw new Pt(t)},Ft=(t,e,r)=>{function n(e){var n=r(e);n.length!==t.length&&St("Mismatched type converter count");for(var o=0;o<t.length;++o)Tt(t[o],n[o])}t.forEach((function(t){Ct[t]=e}));var o=new Array(e.length),i=[],a=0;e.forEach(((t,e)=>{kt.hasOwnProperty(t)?o[e]=kt[t]:(i.push(t),_t.hasOwnProperty(t)||(_t[t]=[]),_t[t].push((()=>{o[e]=kt[t],++a===i.length&&n(o)})))})),0===i.length&&n(o)};function Tt(t,e,r={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(t,e,r={}){var n=e.name;if(t||$t(`type "${n}" must have a positive integer typeid pointer`),kt.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;$t(`Cannot register type '${n}' twice`)}if(kt[t]=e,delete Ct[t],_t.hasOwnProperty(t)){var o=_t[t];delete _t[t],o.forEach((t=>t()))}}(t,e,r)}function jt(t){if(!(this instanceof Jt))return!1;if(!(t instanceof Jt))return!1;for(var e=this.$$.ptrType.registeredClass,r=this.$$.ptr,n=t.$$.ptrType.registeredClass,o=t.$$.ptr;e.baseClass;)r=e.upcast(r),e=e.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return e===n&&r===o}var Dt=t=>{$t(t.$$.ptrType.registeredClass.name+" instance already deleted")},Wt=!1,At=t=>{},xt=t=>{t.count.value-=1,0===t.count.value&&(t=>{t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)})(t)},Ot=(t,e,r)=>{if(e===r)return t;if(void 0===r.baseClass)return null;var n=Ot(t,e,r.baseClass);return null===n?null:r.downcast(n)},It={},Rt=()=>Object.keys(Ht).length,zt=()=>{var t=[];for(var e in Ht)Ht.hasOwnProperty(e)&&t.push(Ht[e]);return t},Nt=[],Ut=()=>{for(;Nt.length;){var t=Nt.pop();t.$$.deleteScheduled=!1,t.delete()}},Lt=void 0,Bt=t=>{Lt=t,Nt.length&&Lt&&Lt(Ut)},Ht={},Vt=(t,e)=>(e=((t,e)=>{for(void 0===e&&$t("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e})(t,e),Ht[e]),Yt=(t,e)=>(e.ptrType&&e.ptr||St("makeClassHandle requires ptr and ptrType"),!!e.smartPtrType!=!!e.smartPtr&&St("Both smartPtrType and smartPtr must be specified"),e.count={value:1},qt(Object.create(t,{$$:{value:e}})));function Qt(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=Vt(this.registeredClass,e);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=e,r.$$.smartPtr=t,r.clone();var n=r.clone();return this.destructor(t),n}function o(){return this.isSmartPointer?Yt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):Yt(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var i,a=this.registeredClass.getActualType(e),s=It[a];if(!s)return o.call(this);i=this.isConst?s.constPointerType:s.pointerType;var u=Ot(e,this.registeredClass,i.registeredClass);return null===u?o.call(this):this.isSmartPointer?Yt(i.registeredClass.instancePrototype,{ptrType:i,ptr:u,smartPtrType:this,smartPtr:t}):Yt(i.registeredClass.instancePrototype,{ptrType:i,ptr:u})}var qt=t=>"undefined"==typeof FinalizationRegistry?(qt=t=>t,t):(Wt=new FinalizationRegistry((t=>{xt(t.$$)})),qt=t=>{var e=t.$$;if(e.smartPtr){var r={$$:e};Wt.register(t,r,t)}return t},At=t=>Wt.unregister(t),qt(t));function Gt(){if(this.$$.ptr||Dt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t,e=qt(Object.create(Object.getPrototypeOf(this),{$$:{value:(t=this.$$,{count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType})}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e}function Kt(){this.$$.ptr||Dt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&$t("Object already scheduled for deletion"),At(this),xt(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function Xt(){return!this.$$.ptr}function Zt(){return this.$$.ptr||Dt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&$t("Object already scheduled for deletion"),Nt.push(this),1===Nt.length&&Lt&&Lt(Ut),this.$$.deleteScheduled=!0,this}function Jt(){}var te=t=>{if(void 0===t)return"_unknown";var e=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return e>=48&&e<=57?`_${t}`:t};function ee(t,e){return{[t=te(t)]:function(){return e.apply(this,arguments)}}[t]}var re=(t,e,r)=>{if(void 0===t[e].overloadTable){var n=t[e];t[e]=function(){return t[e].overloadTable.hasOwnProperty(arguments.length)||$t(`Function '${r}' called with an invalid number of arguments (${arguments.length}) - expects one of (${t[e].overloadTable})!`),t[e].overloadTable[arguments.length].apply(this,arguments)},t[e].overloadTable=[],t[e].overloadTable[n.argCount]=n}},ne=(t,e,r)=>{i.hasOwnProperty(t)?((void 0===r||void 0!==i[t].overloadTable&&void 0!==i[t].overloadTable[r])&&$t(`Cannot register public name '${t}' twice`),re(i,t,t),i.hasOwnProperty(r)&&$t(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),i[t].overloadTable[r]=e):(i[t]=e,void 0!==r&&(i[t].numArguments=r))};function oe(t,e,r,n,o,i,a,s){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=i,this.upcast=a,this.downcast=s,this.pureVirtualFunctions=[]}var ie=(t,e,r)=>{for(;e!==r;)e.upcast||$t(`Expected null or instance of ${r.name}, got an instance of ${e.name}`),t=e.upcast(t),e=e.baseClass;return t};function ae(t,e){if(null===e)return this.isReference&&$t(`null is not a valid ${this.name}`),0;e.$$||$t(`Cannot pass "${je(e)}" as a ${this.name}`),e.$$.ptr||$t(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=e.$$.ptrType.registeredClass;return ie(e.$$.ptr,r,this.registeredClass)}function se(t,e){var r;if(null===e)return this.isReference&&$t(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),null!==t&&t.push(this.rawDestructor,r),r):0;e.$$||$t(`Cannot pass "${je(e)}" as a ${this.name}`),e.$$.ptr||$t(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&e.$$.ptrType.isConst&&$t(`Cannot convert argument of type ${e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name} to parameter type ${this.name}`);var n=e.$$.ptrType.registeredClass;if(r=ie(e.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===e.$$.smartPtr&&$t("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:e.$$.smartPtrType===this?r=e.$$.smartPtr:$t(`Cannot convert argument of type ${e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=e.$$.smartPtr;break;case 2:if(e.$$.smartPtrType===this)r=e.$$.smartPtr;else{var o=e.clone();r=this.rawShare(r,Se.toHandle((()=>o.delete()))),null!==t&&t.push(this.rawDestructor,r)}break;default:$t("Unsupporting sharing policy")}return r}function ue(t,e){if(null===e)return this.isReference&&$t(`null is not a valid ${this.name}`),0;e.$$||$t(`Cannot pass "${je(e)}" as a ${this.name}`),e.$$.ptr||$t(`Cannot pass deleted object as a pointer of type ${this.name}`),e.$$.ptrType.isConst&&$t(`Cannot convert argument of type ${e.$$.ptrType.name} to parameter type ${this.name}`);var r=e.$$.ptrType.registeredClass;return ie(e.$$.ptr,r,this.registeredClass)}function ce(t){return this.fromWireType(k[t>>2])}function le(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t}function de(t){this.rawDestructor&&this.rawDestructor(t)}var he=t=>{null!==t&&t.delete()};function fe(t,e,r,n,o,i,a,s,u,c,l){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=a,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=c,this.rawDestructor=l,o||void 0!==e.baseClass?this.toWireType=se:n?(this.toWireType=ae,this.destructorFunction=null):(this.toWireType=ue,this.destructorFunction=null)}var pe=(t,e,r)=>{i.hasOwnProperty(t)||St("Replacing nonexistant public symbol"),void 0!==i[t].overloadTable&&void 0!==r?i[t].overloadTable[r]=e:(i[t]=e,i[t].argCount=r)},me=t=>$.get(t),ve=(t,e,r)=>t.includes("j")?((t,e,r)=>{var n=i["dynCall_"+t];return r&&r.length?n.apply(null,[e].concat(r)):n.call(null,e)})(t,e,r):me(e).apply(null,r),ge=(t,e)=>{var r,n,o,i=(t=Et(t)).includes("j")?(r=t,n=e,o=[],function(){return o.length=0,Object.assign(o,arguments),ve(r,n,o)}):me(e);return"function"!=typeof i&&$t(`unknown function pointer with signature ${t}: ${e}`),i},ye=void 0,we=t=>{var e=_r(t),r=Et(e);return wr(e),r},be=(t,e)=>{var r=[],n={};throw e.forEach((function t(e){n[e]||kt[e]||(Ct[e]?Ct[e].forEach(t):(r.push(e),n[e]=!0))})),new ye(`${t}: `+r.map(we).join([", "]))},Ee=t=>{for(;t.length;){var e=t.pop();t.pop()(e)}};function _e(t,e,r,n,o,i){var a=e.length;a<2&&$t("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var s=null!==e[1]&&null!==r,u=!1,c=1;c<e.length;++c)if(null!==e[c]&&void 0===e[c].destructorFunction){u=!0;break}var l="void"!==e[0].name,d=a-2,h=new Array(d),f=[],p=[];return function(){var r;arguments.length!==d&&$t(`function ${t} called with ${arguments.length} arguments, expected ${d}`),p.length=0,f.length=s?2:1,f[0]=o,s&&(r=e[1].toWireType(p,this),f[1]=r);for(var i=0;i<d;++i)h[i]=e[i+2].toWireType(p,arguments[i]),f.push(h[i]);var a=n.apply(null,f);function c(t){if(u)Ee(p);else for(var n=s?1:2;n<e.length;n++){var o=1===n?r:h[n-2];null!==e[n].destructorFunction&&e[n].destructorFunction(o)}if(l)return e[0].fromWireType(t)}return c(a)}}var ke=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(k[e+4*n>>2]);return r};function Ce(){this.allocated=[void 0],this.freelist=[]}var Me=new Ce,$e=t=>{t>=Me.reserved&&0==--Me.get(t).refcount&&Me.free(t)},Pe=()=>{for(var t=0,e=Me.reserved;e<Me.allocated.length;++e)void 0!==Me.allocated[e]&&++t;return t},Se={toValue:t=>(t||$t("Cannot use deleted val. handle = "+t),Me.get(t).value),toHandle:t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return Me.allocate({refcount:1,value:t})}}};function Fe(t){return this.fromWireType(_[t>>2])}var Te,je=t=>{if(null===t)return"null";var e=typeof t;return"object"===e||"array"===e||"function"===e?t.toString():""+t},De=(t,e)=>{switch(e){case 4:return function(t){return this.fromWireType(C[t>>2])};case 8:return function(t){return this.fromWireType(M[t>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},We=(t,e,r)=>{switch(e){case 1:return r?t=>y[t>>0]:t=>w[t>>0];case 2:return r?t=>b[t>>1]:t=>E[t>>1];case 4:return r?t=>_[t>>2]:t=>k[t>>2];default:throw new TypeError(`invalid integer width (${e}): ${t}`)}},Ae="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,xe=(t,e)=>{for(var r=t,n=r>>1,o=n+e/2;!(n>=o)&&E[n];)++n;if((r=n<<1)-t>32&&Ae)return Ae.decode(w.subarray(t,r));for(var i="",a=0;!(a>=e/2);++a){var s=b[t+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i},Oe=(t,e,r)=>{if(void 0===r&&(r=2147483647),r<2)return 0;for(var n=e,o=(r-=2)<2*t.length?r/2:t.length,i=0;i<o;++i){var a=t.charCodeAt(i);b[e>>1]=a,e+=2}return b[e>>1]=0,e-n},Ie=t=>2*t.length,Re=(t,e)=>{for(var r=0,n="";!(r>=e/4);){var o=_[t+4*r>>2];if(0==o)break;if(++r,o>=65536){var i=o-65536;n+=String.fromCharCode(55296|i>>10,56320|1023&i)}else n+=String.fromCharCode(o)}return n},ze=(t,e,r)=>{if(void 0===r&&(r=2147483647),r<4)return 0;for(var n=e,o=n+r-4,i=0;i<t.length;++i){var a=t.charCodeAt(i);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++i)),_[e>>2]=a,(e+=4)+4>o)break}return _[e>>2]=0,e-n},Ne=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n>=55296&&n<=57343&&++r,e+=4}return e},Ue=(t,e)=>{var r=kt[t];return void 0===r&&$t(e+" has unknown type "+we(t)),r},Le={},Be=t=>{var e=Le[t];return void 0===e?Et(t):e},He=[],Ve=()=>{if("object"==typeof globalThis)return globalThis;function t(t){t.$$$embind_global$$$=t;var e="object"==typeof $$$embind_global$$$&&t.$$$embind_global$$$==t;return e||delete t.$$$embind_global$$$,e}if("object"==typeof $$$embind_global$$$)return $$$embind_global$$$;if("object"==typeof r.g&&t(r.g)?$$$embind_global$$$=r.g:"object"==typeof self&&t(self)&&($$$embind_global$$$=self),"object"==typeof $$$embind_global$$$)return $$$embind_global$$$;throw Error("unable to get global object.")},Ye=[],Qe=t=>t%4==0&&(t%100!=0||t%400==0),qe=[0,31,60,91,121,152,182,213,244,274,305,335],Ge=[0,31,59,90,120,151,181,212,243,273,304,334],Ke=t=>{var e=st(t)+1,r=yr(e);return r&&wt(t,r,e),r},Xe=[],Ze=(t,e,r)=>{var n=((t,e)=>{var r;for(Xe.length=0;r=w[t++];)e+=105!=r&&e%8?4:0,Xe.push(105==r?_[e>>2]:M[e>>3]),e+=105==r?4:8;return Xe})(e,r);return V[t].apply(null,n)};Te=()=>performance.now();var Je,tr,er,rr=t=>{U("OOM")},nr=t=>{var e=(t-v.buffer.byteLength+65535)/65536;try{return v.grow(e),S(),1}catch(t){}},or={},ir=()=>{if(!ir.strings){var t={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",_:l||"./this.program"};for(var e in or)void 0===or[e]?delete t[e]:t[e]=or[e];var r=[];for(var e in t)r.push(`${e}=${t[e]}`);ir.strings=r}return ir.strings},ar=t=>{g||(i.onExit&&i.onExit(t),P=!0),d(t,new Y(t))},sr=(t,e)=>{ar(t)},ur=[31,29,31,30,31,30,31,31,30,31,30,31],cr=[31,28,31,30,31,30,31,31,30,31,30,31],lr=(t,e,r,n)=>{var o=k[n+40>>2],i={tm_sec:_[n>>2],tm_min:_[n+4>>2],tm_hour:_[n+8>>2],tm_mday:_[n+12>>2],tm_mon:_[n+16>>2],tm_year:_[n+20>>2],tm_wday:_[n+24>>2],tm_yday:_[n+28>>2],tm_isdst:_[n+32>>2],tm_gmtoff:_[n+36>>2],tm_zone:o?K(o):""},a=K(r),s={"%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"};for(var u in s)a=a.replace(new RegExp(u,"g"),s[u]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],l=["January","February","March","April","May","June","July","August","September","October","November","December"];function d(t,e,r){for(var n="number"==typeof t?t.toString():t||"";n.length<e;)n=r[0]+n;return n}function h(t,e){return d(t,e,"0")}function f(t,e){function r(t){return t<0?-1:t>0?1:0}var n;return 0===(n=r(t.getFullYear()-e.getFullYear()))&&0===(n=r(t.getMonth()-e.getMonth()))&&(n=r(t.getDate()-e.getDate())),n}function p(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 m(t){var e=((t,e)=>{for(var r=new Date(t.getTime());e>0;){var n=Qe(r.getFullYear()),o=r.getMonth(),i=(n?ur:cr)[o];if(!(e>i-r.getDate()))return r.setDate(r.getDate()+e),r;e-=i-r.getDate()+1,r.setDate(1),o<11?r.setMonth(o+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r})(new Date(t.tm_year+1900,0,1),t.tm_yday),r=new Date(e.getFullYear(),0,4),n=new Date(e.getFullYear()+1,0,4),o=p(r),i=p(n);return f(o,e)<=0?f(i,e)<=0?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var v={"%a":t=>c[t.tm_wday].substring(0,3),"%A":t=>c[t.tm_wday],"%b":t=>l[t.tm_mon].substring(0,3),"%B":t=>l[t.tm_mon],"%C":t=>h((t.tm_year+1900)/100|0,2),"%d":t=>h(t.tm_mday,2),"%e":t=>d(t.tm_mday,2," "),"%g":t=>m(t).toString().substring(2),"%G":t=>m(t),"%H":t=>h(t.tm_hour,2),"%I":t=>{var e=t.tm_hour;return 0==e?e=12:e>12&&(e-=12),h(e,2)},"%j":t=>h(t.tm_mday+((t,e)=>{for(var r=0,n=0;n<=e;r+=t[n++]);return r})(Qe(t.tm_year+1900)?ur:cr,t.tm_mon-1),3),"%m":t=>h(t.tm_mon+1,2),"%M":t=>h(t.tm_min,2),"%n":()=>"\n","%p":t=>t.tm_hour>=0&&t.tm_hour<12?"AM":"PM","%S":t=>h(t.tm_sec,2),"%t":()=>"\t","%u":t=>t.tm_wday||7,"%U":t=>{var e=t.tm_yday+7-t.tm_wday;return h(Math.floor(e/7),2)},"%V":t=>{var e=Math.floor((t.tm_yday+7-(t.tm_wday+6)%7)/7);if((t.tm_wday+371-t.tm_yday-2)%7<=2&&e++,e){if(53==e){var r=(t.tm_wday+371-t.tm_yday)%7;4==r||3==r&&Qe(t.tm_year)||(e=1)}}else{e=52;var n=(t.tm_wday+7-t.tm_yday-1)%7;(4==n||5==n&&Qe(t.tm_year%400-1))&&e++}return h(e,2)},"%w":t=>t.tm_wday,"%W":t=>{var e=t.tm_yday+7-(t.tm_wday+6)%7;return h(Math.floor(e/7),2)},"%y":t=>(t.tm_year+1900).toString().substring(2),"%Y":t=>t.tm_year+1900,"%z":t=>{var e=t.tm_gmtoff,r=e>=0;return e=(e=Math.abs(e)/60)/60*100+e%60,(r?"+":"-")+String("0000"+e).slice(-4)},"%Z":t=>t.tm_zone,"%%":()=>"%"};for(var u in a=a.replace(/%%/g,"\0\0"),v)a.includes(u)&&(a=a.replace(new RegExp(u,"g"),v[u](i)));var g,w,b=ct(a=a.replace(/\0\0/g,"%"),!1);return b.length>e?0:(g=b,w=t,y.set(g,w),b.length-1)},dr=Ke,hr=function(t,e,r,n){t||(t=this),this.parent=t,this.mount=t.mount,this.mounted=null,this.id=vt.nextInode++,this.name=e,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},fr=365,pr=146;Object.defineProperties(hr.prototype,{read:{get:function(){return(this.mode&fr)===fr},set:function(t){t?this.mode|=fr:this.mode&=-366}},write:{get:function(){return(this.mode&pr)===pr},set:function(t){t?this.mode|=pr:this.mode&=-147}},isFolder:{get:function(){return vt.isDir(this.mode)}},isDevice:{get:function(){return vt.isChrdev(this.mode)}}}),vt.FSNode=hr,vt.createPreloadedFile=(t,e,r,n,o,i,a,s,u,c)=>{var l=e?it.resolve(nt.join2(t,e)):t;function d(r){function d(r){c&&c(),s||vt.createDataFile(t,e,r,n,o,u),i&&i(),N()}((t,e,r,n)=>{"undefined"!=typeof Browser&&Browser.init();var o=!1;return pt.forEach((i=>{o||i.canHandle(e)&&(i.handle(t,e,r,n),o=!0)})),o})(r,l,d,(()=>{a&&a(),N()}))||d(r)}z(),"string"==typeof r?ft(r,(t=>d(t)),a):d(r)},vt.staticInit(),(()=>{for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);bt=t})(),Mt=i.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},Pt=i.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},Jt.prototype.isAliasOf=jt,Jt.prototype.clone=Gt,Jt.prototype.delete=Kt,Jt.prototype.isDeleted=Xt,Jt.prototype.deleteLater=Zt,i.getInheritedInstanceCount=Rt,i.getLiveInheritedInstances=zt,i.flushPendingDeletes=Ut,i.setDelayFunction=Bt,fe.prototype.getPointee=le,fe.prototype.destructor=de,fe.prototype.argPackAdvance=8,fe.prototype.readValueFromPointer=ce,fe.prototype.deleteObject=he,fe.prototype.fromWireType=Qt,ye=i.UnboundTypeError=(Je=Error,(er=ee(tr="UnboundTypeError",(function(t){this.name=tr,this.message=t;var e=new Error(t).stack;void 0!==e&&(this.stack=this.toString()+"\n"+e.replace(/^Error(:[^\n]*)?\n/,""))}))).prototype=Object.create(Je.prototype),er.prototype.constructor=er,er.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},er),Object.assign(Ce.prototype,{get(t){return this.allocated[t]},has(t){return void 0!==this.allocated[t]},allocate(t){var e=this.freelist.pop()||this.allocated.length;return this.allocated[e]=t,e},free(t){this.allocated[t]=void 0,this.freelist.push(t)}}),Me.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),Me.reserved=Me.allocated.length,i.count_emval_handles=Pe;var mr,vr={l:(t,e,r,n)=>{U(`Assertion failed: ${K(t)}, at: `+[e?K(e):"unknown filename",r,n?K(n):"unknown function"])},t:t=>{var e=new tt(t);return e.get_caught()||(e.set_caught(!0),Z--),e.set_rethrown(!1),X.push(e),Sr(e.excPtr),e.get_exception_ptr()},Bb:()=>{if(!X.length)return 0;var t=X[X.length-1];return Sr(t.excPtr),t.excPtr},v:()=>{Cr(0,0);var t=X.pop();Pr(t.excPtr),J=0},a:()=>et([]),h:t=>et([t]),p:(t,e)=>et([t,e]),ja:rt,Ab:t=>{if(t){var e=new tt(t);X.push(e),e.set_rethrown(!0),rt()}},s:(t,e,r)=>{throw new tt(t).init(e,r),Z++,J=t},Cb:()=>Z,b:t=>{throw J||(J=t),J},Hb:function(t,e,r,n,o){try{for(var i=0,a=e?_[e>>2]:0,s=e?_[e+4>>2]:0,u=r?_[r>>2]:0,c=r?_[r+4>>2]:0,l=n?_[n>>2]:0,d=n?_[n+4>>2]:0,h=0,f=0,p=0,m=0,v=0,g=0,y=(e?_[e>>2]:0)|(r?_[r>>2]:0)|(n?_[n>>2]:0),w=(e?_[e+4>>2]:0)|(r?_[r+4>>2]:0)|(n?_[n+4>>2]:0),b=function(t,e,r,n){return t<32?e&n:r&n},E=0;E<t;E++){var k=1<<E%32;if(b(E,y,w,k)){var C=gt.getStreamFromFD(E),M=gt.DEFAULT_POLLMASK;if(C.stream_ops.poll){var $=-1;o&&($=1e3*((e?_[o>>2]:0)+(e?_[o+8>>2]:0)/1e6)),M=C.stream_ops.poll(C,$)}1&M&&b(E,a,s,k)&&(E<32?h|=k:f|=k,i++),4&M&&b(E,u,c,k)&&(E<32?p|=k:m|=k,i++),2&M&&b(E,l,d,k)&&(E<32?v|=k:g|=k,i++)}}return e&&(_[e>>2]=h,_[e+4>>2]=f),r&&(_[r>>2]=p,_[r+4>>2]=m),n&&(_[n>>2]=v,_[n+4>>2]=g),i}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},sb:function(t,e){try{return t=gt.getStr(t),vt.chmod(t,e),0}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},ub:function(t,e){try{return vt.fchmod(t,e),0}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},Aa:function(t,e,r){gt.varargs=r;try{var n=gt.getStreamFromFD(t);switch(e){case 0:if((o=gt.get())<0)return-28;for(;vt.streams[o];)o++;return vt.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=gt.get();return n.flags|=o,0;case 5:return o=gt.getp(),b[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return i=28,_[br()>>2]=i,-1}}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}var i},Rb:function(t,e){try{var r=gt.getStreamFromFD(t);return gt.doStat(vt.stat,r.path,e)}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},db:function(t,e,r){var n=yt(e,r);try{return isNaN(n)?61:(vt.ftruncate(t,n),0)}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},xb:function(t,e){try{if(0===e)return-28;var r=vt.cwd(),n=st(r)+1;return e<n?-68:(wt(r,t,e),n)}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},vb:function(t,e,r){try{var n=gt.getStreamFromFD(t);n.getdents||(n.getdents=vt.readdir(n.path));for(var o=280,i=0,a=vt.llseek(n,0,1),s=Math.floor(a/o);s<n.getdents.length&&i+o<=r;){var u,c,l=n.getdents[s];if("."===l)u=n.node.id,c=4;else if(".."===l)u=vt.lookupPath(n.path,{parent:!0}).node.id,c=4;else{var d=vt.lookupNode(n.node,l);u=d.id,c=vt.isChrdev(d.mode)?2:vt.isDir(d.mode)?4:vt.isLink(d.mode)?10:8}D=[u>>>0,(j=u,+Math.abs(j)>=1?j>0?+Math.floor(j/4294967296)>>>0:~~+Math.ceil((j-+(~~j>>>0))/4294967296)>>>0:0)],_[e+i>>2]=D[0],_[e+i+4>>2]=D[1],D=[(s+1)*o>>>0,(j=(s+1)*o,+Math.abs(j)>=1?j>0?+Math.floor(j/4294967296)>>>0:~~+Math.ceil((j-+(~~j>>>0))/4294967296)>>>0:0)],_[e+i+8>>2]=D[0],_[e+i+12>>2]=D[1],b[e+i+16>>1]=280,y[e+i+18>>0]=c,wt(l,e+i+19,256),i+=o,s+=1}return vt.llseek(n,s*o,0),i}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},Sb:function(t,e,r){gt.varargs=r;try{var n=gt.getStreamFromFD(t);switch(e){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.tty?0:-59;case 21505:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),i=gt.getp();_[i>>2]=o.c_iflag||0,_[i+4>>2]=o.c_oflag||0,_[i+8>>2]=o.c_cflag||0,_[i+12>>2]=o.c_lflag||0;for(var a=0;a<32;a++)y[i+a+17>>0]=o.c_cc[a]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){i=gt.getp();var s=_[i>>2],u=_[i+4>>2],c=_[i+8>>2],l=_[i+12>>2],d=[];for(a=0;a<32;a++)d.push(y[i+a+17>>0]);return n.tty.ops.ioctl_tcsets(n.tty,e,{c_iflag:s,c_oflag:u,c_cflag:c,c_lflag:l,c_cc:d})}return 0;case 21519:return n.tty?(i=gt.getp(),_[i>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return i=gt.getp(),vt.ioctl(n,e,i);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var h=n.tty.ops.ioctl_tiocgwinsz(n.tty);i=gt.getp(),b[i>>1]=h[0],b[i+2>>1]=h[1]}return 0;default:return-28}}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},Ob:function(t,e){try{return t=gt.getStr(t),gt.doStat(vt.lstat,t,e)}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},Kb:function(t,e,r){try{return e=gt.getStr(e),e=gt.calculateAt(t,e),"/"===(e=nt.normalize(e))[e.length-1]&&(e=e.substr(0,e.length-1)),vt.mkdir(e,r,0),0}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},Pb:function(t,e,r,n){try{e=gt.getStr(e);var o=256&n,i=4096&n;return n&=-6401,e=gt.calculateAt(t,e,i),gt.doStat(o?vt.lstat:vt.stat,e,r)}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},Ba:function(t,e,r,n){gt.varargs=n;try{e=gt.getStr(e),e=gt.calculateAt(t,e);var o=n?gt.get():0;return vt.open(e,r,o).fd}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},wb:function(t,e,r,n){try{if(e=gt.getStr(e),e=gt.calculateAt(t,e),n<=0)return-28;var o=vt.readlink(e),i=Math.min(n,st(o)),a=y[r+i];return wt(o,r,n+1),y[r+i]=a,i}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},Ib:function(t){try{return t=gt.getStr(t),vt.rmdir(t),0}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},Qb:function(t,e){try{return t=gt.getStr(t),gt.doStat(vt.stat,t,e)}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},rb:function(t,e){try{return t=gt.getStr(t),e=gt.getStr(e),vt.symlink(t,e),0}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},Jb:function(t,e,r){try{return e=gt.getStr(e),e=gt.calculateAt(t,e),0===r?vt.unlink(e):512===r?vt.rmdir(e):U("Invalid flags passed to unlinkat"),0}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},mb:(t,e,r,n,o)=>{},Ea:(t,e,r,n)=>{Tt(t,{name:e=Et(e),fromWireType:function(t){return!!t},toWireType:function(t,e){return e?r:n},argPackAdvance:8,readValueFromPointer:function(t){return this.fromWireType(w[t])},destructorFunction:null})},U:(t,e,r,n,o,i,a,s,u,c,l,d,h)=>{l=Et(l),i=ge(o,i),s&&(s=ge(a,s)),c&&(c=ge(u,c)),h=ge(d,h);var f=te(l);ne(f,(function(){be(`Cannot construct ${l} due to unbound types`,[n])})),Ft([t,e,r],n?[n]:[],(function(e){var r,o;e=e[0],o=n?(r=e.registeredClass).instancePrototype:Jt.prototype;var a=ee(f,(function(){if(Object.getPrototypeOf(this)!==u)throw new Mt("Use 'new' to construct "+l);if(void 0===d.constructor_body)throw new Mt(l+" has no accessible constructor");var t=d.constructor_body[arguments.length];if(void 0===t)throw new Mt(`Tried to invoke ctor of ${l} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(d.constructor_body).toString()}) parameters instead!`);return t.apply(this,arguments)})),u=Object.create(o,{constructor:{value:a}});a.prototype=u;var d=new oe(l,a,u,h,r,i,s,c);d.baseClass&&(void 0===d.baseClass.__derivedClasses&&(d.baseClass.__derivedClasses=[]),d.baseClass.__derivedClasses.push(d));var p=new fe(l,d,!0,!1,!1),m=new fe(l+"*",d,!1,!1,!1),v=new fe(l+" const*",d,!1,!0,!1);return It[t]={pointerType:m,constPointerType:v},pe(f,a),[p,m,v]}))},T:(t,e,r,n,o,i,a,s)=>{var u=ke(r,n);e=Et(e),i=ge(o,i),Ft([],[t],(function(t){var n=`${(t=t[0]).name}.${e}`;function o(){be(`Cannot call ${n} due to unbound types`,u)}e.startsWith("@@")&&(e=Symbol[e.substring(2)]);var s=t.registeredClass.constructor;return void 0===s[e]?(o.argCount=r-1,s[e]=o):(re(s,e,n),s[e].overloadTable[r-1]=o),Ft([],u,(function(o){var u=[o[0],null].concat(o.slice(1)),c=_e(n,u,null,i,a);if(void 0===s[e].overloadTable?(c.argCount=r-1,s[e]=c):s[e].overloadTable[r-1]=c,t.registeredClass.__derivedClasses)for(const r of t.registeredClass.__derivedClasses)r.constructor.hasOwnProperty(e)||(r.constructor[e]=c);return[]})),[]}))},D:(t,e,r,n,o,i,a,s,u)=>{var c=ke(r,n);e=Et(e),i=ge(o,i),Ft([],[t],(function(t){var n=`${(t=t[0]).name}.${e}`;function o(){be(`Cannot call ${n} due to unbound types`,c)}e.startsWith("@@")&&(e=Symbol[e.substring(2)]),s&&t.registeredClass.pureVirtualFunctions.push(e);var u=t.registeredClass.instancePrototype,l=u[e];return void 0===l||void 0===l.overloadTable&&l.className!==t.name&&l.argCount===r-2?(o.argCount=r-2,o.className=t.name,u[e]=o):(re(u,e,n),u[e].overloadTable[r-2]=o),Ft([],c,(function(o){var s=_e(n,o,t,i,a);return void 0===u[e].overloadTable?(s.argCount=r-2,u[e]=s):u[e].overloadTable[r-2]=s,[]})),[]}))},Vb:(t,e)=>{Tt(t,{name:e=Et(e),fromWireType:t=>{var e=Se.toValue(t);return $e(t),e},toWireType:(t,e)=>Se.toHandle(e),argPackAdvance:8,readValueFromPointer:Fe,destructorFunction:null})},Da:(t,e,r)=>{Tt(t,{name:e=Et(e),fromWireType:t=>t,toWireType:(t,e)=>e,argPackAdvance:8,readValueFromPointer:De(e,r),destructorFunction:null})},X:(t,e,r,n,o,i,a)=>{var s=ke(e,r);t=Et(t),o=ge(n,o),ne(t,(function(){be(`Cannot call ${t} due to unbound types`,s)}),e-1),Ft([],s,(function(r){var n=[r[0],null].concat(r.slice(1));return pe(t,_e(t,n,null,o,i),e-1),[]}))},L:(t,e,r,n,o)=>{e=Et(e),-1===o&&(o=4294967295);var i=t=>t;if(0===n){var a=32-8*r;i=t=>t<<a>>>a}var s=e.includes("unsigned");Tt(t,{name:e,fromWireType:i,toWireType:s?function(t,e){return this.name,e>>>0}:function(t,e){return this.name,e},argPackAdvance:8,readValueFromPointer:We(e,r,0!==n),destructorFunction:null})},E:(t,e,r)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];function o(t){var e=k[t>>2],r=k[t+4>>2];return new n(y.buffer,r,e)}Tt(t,{name:r=Et(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},Ca:(t,e)=>{var r="std::string"===(e=Et(e));Tt(t,{name:e,fromWireType:t=>{var e,n=k[t>>2],o=t+4;if(r)for(var i=o,a=0;a<=n;++a){var s=o+a;if(a==n||0==w[s]){var u=K(i,s-i);void 0===e?e=u:(e+=String.fromCharCode(0),e+=u),i=s+1}}else{var c=new Array(n);for(a=0;a<n;++a)c[a]=String.fromCharCode(w[o+a]);e=c.join("")}return wr(t),e},toWireType:(t,e)=>{var n;e instanceof ArrayBuffer&&(e=new Uint8Array(e));var o="string"==typeof e;o||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array||$t("Cannot pass non-string to std::string"),n=r&&o?st(e):e.length;var i=yr(4+n+1),a=i+4;if(k[i>>2]=n,r&&o)wt(e,a,n+1);else if(o)for(var s=0;s<n;++s){var u=e.charCodeAt(s);u>255&&(wr(a),$t("String has UTF-16 code units that do not fit in 8 bits")),w[a+s]=u}else for(s=0;s<n;++s)w[a+s]=e[s];return null!==t&&t.push(wr,i),i},argPackAdvance:8,readValueFromPointer:ce,destructorFunction:t=>wr(t)})},sa:(t,e,r)=>{var n,o,i,a,s;r=Et(r),2===e?(n=xe,o=Oe,a=Ie,i=()=>E,s=1):4===e&&(n=Re,o=ze,a=Ne,i=()=>k,s=2),Tt(t,{name:r,fromWireType:t=>{for(var r,o=k[t>>2],a=i(),u=t+4,c=0;c<=o;++c){var l=t+4+c*e;if(c==o||0==a[l>>s]){var d=n(u,l-u);void 0===r?r=d:(r+=String.fromCharCode(0),r+=d),u=l+e}}return wr(t),r},toWireType:(t,n)=>{"string"!=typeof n&&$t(`Cannot pass non-string to C++ string type ${r}`);var i=a(n),u=yr(4+i+e);return k[u>>2]=i>>s,o(n,u+4,i+e),null!==t&&t.push(wr,u),u},argPackAdvance:8,readValueFromPointer:Fe,destructorFunction:t=>wr(t)})},Fa:(t,e)=>{Tt(t,{isVoid:!0,name:e=Et(e),argPackAdvance:0,fromWireType:()=>{},toWireType:(t,e)=>{}})},Tb:()=>!0,Db:()=>{throw 1/0},Y:(t,e,r)=>{t=Se.toValue(t),e=Ue(e,"emval::as");var n=[],o=Se.toHandle(n);return k[r>>2]=o,e.toWireType(n,t)},ea:(t,e,r,n,o)=>(t=He[t])(e=Se.toValue(e),r=Be(r),(t=>{var e=[];return k[t>>2]=Se.toHandle(e),e})(n),o),pa:(t,e,r,n)=>{(t=He[t])(e=Se.toValue(e),r=Be(r),null,n)},tb:$e,qa:t=>0===t?Se.toHandle(Ve()):(t=Be(t),Se.toHandle(Ve()[t])),Q:(t,e)=>{var r=((t,e)=>{for(var r=new Array(t),n=0;n<t;++n)r[n]=Ue(k[e+4*n>>2],"parameter "+n);return r})(t,e),n=r[0],o=n.name+"_$"+r.slice(1).map((function(t){return t.name})).join("_")+"$",i=Ye[o];if(void 0!==i)return i;var a,s,u=new Array(t-1);return a=(e,o,i,a)=>{for(var s=0,c=0;c<t-1;++c)u[c]=r[c+1].readValueFromPointer(a+s),s+=r[c+1].argPackAdvance;var l=e[o].apply(e,u);for(c=0;c<t-1;++c)r[c+1].deleteObject&&r[c+1].deleteObject(u[c]);if(!n.isVoid)return n.toWireType(i,l)},s=He.length,He.push(a),i=s,Ye[o]=i,i},cb:(t,e)=>(t=Se.toValue(t),e=Se.toValue(e),Se.toHandle(t[e])),u:t=>{t>4&&(Me.get(t).refcount+=1)},ab:(t,e)=>(t=Se.toValue(t))instanceof(e=Se.toValue(e)),Z:t=>"number"==typeof(t=Se.toValue(t)),H:t=>"string"==typeof(t=Se.toValue(t)),V:()=>Se.toHandle([]),I:t=>Se.toHandle(Be(t)),z:()=>Se.toHandle({}),bb:t=>{var e=Se.toValue(t);Ee(e),$e(t)},Lb:(t,e,r)=>{t=Se.toValue(t),e=Se.toValue(e),r=Se.toValue(r),t[e]=r},J:(t,e)=>{var r=(t=Ue(t,"_emval_take_value")).readValueFromPointer(e);return Se.toHandle(r)},B:t=>(t=Se.toValue(t),Se.toHandle(typeof t)),jb:function(t,e,r){var n=yt(t,e),o=new Date(1e3*n);_[r>>2]=o.getUTCSeconds(),_[r+4>>2]=o.getUTCMinutes(),_[r+8>>2]=o.getUTCHours(),_[r+12>>2]=o.getUTCDate(),_[r+16>>2]=o.getUTCMonth(),_[r+20>>2]=o.getUTCFullYear()-1900,_[r+24>>2]=o.getUTCDay();var i=Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0),a=(o.getTime()-i)/864e5|0;_[r+28>>2]=a},kb:function(t,e,r){var n=yt(t,e),o=new Date(1e3*n);_[r>>2]=o.getSeconds(),_[r+4>>2]=o.getMinutes(),_[r+8>>2]=o.getHours(),_[r+12>>2]=o.getDate(),_[r+16>>2]=o.getMonth(),_[r+20>>2]=o.getFullYear()-1900,_[r+24>>2]=o.getDay();var i=0|(t=>(Qe(t.getFullYear())?qe:Ge)[t.getMonth()]+t.getDate()-1)(o);_[r+28>>2]=i,_[r+36>>2]=-60*o.getTimezoneOffset();var a=new Date(o.getFullYear(),0,1),s=new Date(o.getFullYear(),6,1).getTimezoneOffset(),u=a.getTimezoneOffset(),c=0|(s!=u&&o.getTimezoneOffset()==Math.min(u,s));_[r+32>>2]=c},hb:function(t,e,r,n,o,i,a,s){var u=yt(o,i);try{if(isNaN(u))return 61;var c=gt.getStreamFromFD(n),l=vt.mmap(c,t,u,e,r),d=l.ptr;return _[a>>2]=l.allocated,k[s>>2]=d,0}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},ib:function(t,e,r,n,o,i,a){var s=yt(i,a);try{if(isNaN(s))return 61;var u=gt.getStreamFromFD(o);2&r&&gt.doMsync(t,u,e,n,s),vt.munmap(u)}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return-t.errno}},Fb:(t,e,r)=>{var n=(new Date).getFullYear(),o=new Date(n,0,1),i=new Date(n,6,1),a=o.getTimezoneOffset(),s=i.getTimezoneOffset(),u=Math.max(a,s);function c(t){var e=t.toTimeString().match(/\(([A-Za-z ]+)\)$/);return e?e[1]:"GMT"}k[t>>2]=60*u,_[e>>2]=Number(a!=s);var l=c(o),d=c(i),h=Ke(l),f=Ke(d);s<a?(k[r>>2]=h,k[r+4>>2]=f):(k[r>>2]=f,k[r+4>>2]=h)},A:()=>{U("")},Za:(t,e,r)=>Ze(t,e,r),_:()=>Date.now(),Gb:()=>2147483648,W:Te,Ub:(t,e,r)=>w.copyWithin(t,e,e+r),Eb:t=>{var e=w.length,r=2147483648;(t>>>=0)>r&&rr();for(var n,o,i=1;i<=4;i*=2){var a=e*(1+.2/i);a=Math.min(a,t+100663296);var s=Math.min(r,(n=Math.max(t,a))+((o=65536)-n%o)%o);if(nr(s))return!0}rr()},Mb:(t,e)=>{var r=0;return ir().forEach(((n,o)=>{var i=e+r;k[t+4*o>>2]=i,((t,e)=>{for(var r=0;r<t.length;++r)y[e++>>0]=t.charCodeAt(r);y[e>>0]=0})(n,i),r+=n.length+1})),0},Nb:(t,e)=>{var r=ir();k[t>>2]=r.length;var n=0;return r.forEach((t=>n+=t.length+1)),k[e>>2]=n,0},Ga:sr,ha:function(t){try{var e=gt.getStreamFromFD(t);return vt.close(e),0}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return t.errno}},ya:function(t,e){try{var r=gt.getStreamFromFD(t),n=r.tty?2:vt.isDir(r.mode)?3:vt.isLink(r.mode)?7:4;return y[e>>0]=n,b[e+2>>1]=0,D=[0,(j=0,+Math.abs(j)>=1?j>0?+Math.floor(j/4294967296)>>>0:~~+Math.ceil((j-+(~~j>>>0))/4294967296)>>>0:0)],_[e+8>>2]=D[0],_[e+12>>2]=D[1],D=[0,(j=0,+Math.abs(j)>=1?j>0?+Math.floor(j/4294967296)>>>0:~~+Math.ceil((j-+(~~j>>>0))/4294967296)>>>0:0)],_[e+16>>2]=D[0],_[e+20>>2]=D[1],0}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return t.errno}},za:function(t,e,r,n){try{var o=((t,e,r,n)=>{for(var o=0,i=0;i<r;i++){var a=k[e>>2],s=k[e+4>>2];e+=8;var u=vt.read(t,y,a,s,n);if(u<0)return-1;if(o+=u,u<s)break;"undefined"!=typeof n&&(n+=u)}return o})(gt.getStreamFromFD(t),e,r);return k[n>>2]=o,0}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return t.errno}},lb:function(t,e,r,n,o){var i=yt(e,r);try{if(isNaN(i))return 61;var a=gt.getStreamFromFD(t);return vt.llseek(a,i,n),D=[a.position>>>0,(j=a.position,+Math.abs(j)>=1?j>0?+Math.floor(j/4294967296)>>>0:~~+Math.ceil((j-+(~~j>>>0))/4294967296)>>>0:0)],_[o>>2]=D[0],_[o+4>>2]=D[1],a.getdents&&0===i&&0===n&&(a.getdents=null),0}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return t.errno}},ra:function(t,e,r,n){try{var o=((t,e,r,n)=>{for(var o=0,i=0;i<r;i++){var a=k[e>>2],s=k[e+4>>2];e+=8;var u=vt.write(t,y,a,s,n);if(u<0)return-1;o+=u,"undefined"!=typeof n&&(n+=u)}return o})(gt.getStreamFromFD(t),e,r);return k[n>>2]=o,0}catch(t){if("undefined"==typeof vt||"ErrnoError"!==t.name)throw t;return t.errno}},$a:function(){return dr(location.toString())},qb:(t,e)=>(ot(w.subarray(t,t+e)),0),_a:function(){return dr((t=Rr,self[t(128,"e2(U")][t(131,"e2(U")]()));var t},Qa:function(t,e){var r=Mr();try{return me(t)(e)}catch(t){if($r(r),t!==t+0)throw t;Cr(1,0)}},Sa:function(t,e,r){var n=Mr();try{return me(t)(e,r)}catch(t){if($r(n),t!==t+0)throw t;Cr(1,0)}},O:function(t,e,r,n,o,i){var a=Mr();try{return me(t)(e,r,n,o,i)}catch(t){if($r(a),t!==t+0)throw t;Cr(1,0)}},R:function(t,e,r,n){var o=Mr();try{return me(t)(e,r,n)}catch(t){if($r(o),t!==t+0)throw t;Cr(1,0)}},oa:function(t,e,r,n,o){var i=Mr();try{return me(t)(e,r,n,o)}catch(t){if($r(i),t!==t+0)throw t;Cr(1,0)}},Ra:function(t,e){var r=Mr();try{return me(t)(e)}catch(t){if($r(r),t!==t+0)throw t;Cr(1,0)}},Xa:function(t,e,r){var n=Mr();try{return me(t)(e,r)}catch(t){if($r(n),t!==t+0)throw t;Cr(1,0)}},ba:function(t,e,r,n){var o=Mr();try{return me(t)(e,r,n)}catch(t){if($r(o),t!==t+0)throw t;Cr(1,0)}},r:function(t){var e=Mr();try{return me(t)()}catch(t){if($r(e),t!==t+0)throw t;Cr(1,0)}},i:function(t,e){var r=Mr();try{return me(t)(e)}catch(t){if($r(r),t!==t+0)throw t;Cr(1,0)}},va:function(t,e,r,n){var o=Mr();try{return me(t)(e,r,n)}catch(t){if($r(o),t!==t+0)throw t;Cr(1,0)}},Ua:function(t,e,r,n){var o=Mr();try{return me(t)(e,r,n)}catch(t){if($r(o),t!==t+0)throw t;Cr(1,0)}},Wa:function(t,e,r,n,o){var i=Mr();try{return me(t)(e,r,n,o)}catch(t){if($r(i),t!==t+0)throw t;Cr(1,0)}},Va:function(t,e,r,n,o,i,a,s){var u=Mr();try{return me(t)(e,r,n,o,i,a,s)}catch(t){if($r(u),t!==t+0)throw t;Cr(1,0)}},d:function(t,e,r){var n=Mr();try{return me(t)(e,r)}catch(t){if($r(n),t!==t+0)throw t;Cr(1,0)}},Ya:function(t,e,r,n){var o=Mr();try{return me(t)(e,r,n)}catch(t){if($r(o),t!==t+0)throw t;Cr(1,0)}},j:function(t,e,r,n){var o=Mr();try{return me(t)(e,r,n)}catch(t){if($r(o),t!==t+0)throw t;Cr(1,0)}},S:function(t,e,r,n,o){var i=Mr();try{return me(t)(e,r,n,o)}catch(t){if($r(i),t!==t+0)throw t;Cr(1,0)}},k:function(t,e,r,n,o){var i=Mr();try{return me(t)(e,r,n,o)}catch(t){if($r(i),t!==t+0)throw t;Cr(1,0)}},zb:function(t,e,r,n,o,i){var a=Mr();try{return me(t)(e,r,n,o,i)}catch(t){if($r(a),t!==t+0)throw t;Cr(1,0)}},xa:function(t,e,r,n,o,i,a){var s=Mr();try{return me(t)(e,r,n,o,i,a)}catch(t){if($r(s),t!==t+0)throw t;Cr(1,0)}},o:function(t,e,r,n,o,i){var a=Mr();try{return me(t)(e,r,n,o,i)}catch(t){if($r(a),t!==t+0)throw t;Cr(1,0)}},G:function(t,e,r,n,o,i,a){var s=Mr();try{return me(t)(e,r,n,o,i,a)}catch(t){if($r(s),t!==t+0)throw t;Cr(1,0)}},ia:function(t,e,r,n,o,i,a,s){var u=Mr();try{return me(t)(e,r,n,o,i,a,s)}catch(t){if($r(u),t!==t+0)throw t;Cr(1,0)}},Ia:function(t,e,r,n,o,i,a,s,u){var c=Mr();try{return me(t)(e,r,n,o,i,a,s,u)}catch(t){if($r(c),t!==t+0)throw t;Cr(1,0)}},Ha:function(t,e,r,n,o,i,a,s,u,c){var l=Mr();try{return me(t)(e,r,n,o,i,a,s,u,c)}catch(t){if($r(l),t!==t+0)throw t;Cr(1,0)}},Ta:function(t,e,r,n,o,i,a,s,u,c,l){var d=Mr();try{return me(t)(e,r,n,o,i,a,s,u,c,l)}catch(t){if($r(d),t!==t+0)throw t;Cr(1,0)}},ga:function(t,e,r,n,o,i,a,s,u,c,l,d){var h=Mr();try{return me(t)(e,r,n,o,i,a,s,u,c,l,d)}catch(t){if($r(h),t!==t+0)throw t;Cr(1,0)}},gb:function(t){var e=Mr();try{return Wr(t)}catch(t){if($r(e),t!==t+0)throw t;Cr(1,0)}},pb:function(t,e){var r=Mr();try{return jr(t,e)}catch(t){if($r(r),t!==t+0)throw t;Cr(1,0)}},fb:function(t,e,r){var n=Mr();try{return Ar(t,e,r)}catch(t){if($r(n),t!==t+0)throw t;Cr(1,0)}},eb:function(t,e,r,n,o){var i=Mr();try{return Or(t,e,r,n,o)}catch(t){if($r(i),t!==t+0)throw t;Cr(1,0)}},n:function(t){var e=Mr();try{me(t)()}catch(t){if($r(e),t!==t+0)throw t;Cr(1,0)}},e:function(t,e){var r=Mr();try{me(t)(e)}catch(t){if($r(r),t!==t+0)throw t;Cr(1,0)}},da:function(t,e,r){var n=Mr();try{me(t)(e,r)}catch(t){if($r(n),t!==t+0)throw t;Cr(1,0)}},ua:function(t,e,r,n){var o=Mr();try{me(t)(e,r,n)}catch(t){if($r(o),t!==t+0)throw t;Cr(1,0)}},Pa:function(t,e,r,n,o,i,a,s){var u=Mr();try{me(t)(e,r,n,o,i,a,s)}catch(t){if($r(u),t!==t+0)throw t;Cr(1,0)}},c:function(t,e,r){var n=Mr();try{me(t)(e,r)}catch(t){if($r(n),t!==t+0)throw t;Cr(1,0)}},w:function(t,e,r,n){var o=Mr();try{me(t)(e,r,n)}catch(t){if($r(o),t!==t+0)throw t;Cr(1,0)}},na:function(t,e,r,n,o){var i=Mr();try{me(t)(e,r,n,o)}catch(t){if($r(i),t!==t+0)throw t;Cr(1,0)}},$:function(t,e,r,n,o,i){var a=Mr();try{me(t)(e,r,n,o,i)}catch(t){if($r(a),t!==t+0)throw t;Cr(1,0)}},wa:function(t,e,r,n,o,i,a,s){var u=Mr();try{me(t)(e,r,n,o,i,a,s)}catch(t){if($r(u),t!==t+0)throw t;Cr(1,0)}},Oa:function(t,e,r,n,o,i,a){var s=Mr();try{me(t)(e,r,n,o,i,a)}catch(t){if($r(s),t!==t+0)throw t;Cr(1,0)}},aa:function(t,e,r,n,o,i,a,s){var u=Mr();try{me(t)(e,r,n,o,i,a,s)}catch(t){if($r(u),t!==t+0)throw t;Cr(1,0)}},Na:function(t,e,r,n,o){var i=Mr();try{me(t)(e,r,n,o)}catch(t){if($r(i),t!==t+0)throw t;Cr(1,0)}},la:function(t,e,r,n){var o=Mr();try{me(t)(e,r,n)}catch(t){if($r(o),t!==t+0)throw t;Cr(1,0)}},g:function(t,e,r,n){var o=Mr();try{me(t)(e,r,n)}catch(t){if($r(o),t!==t+0)throw t;Cr(1,0)}},M:function(t,e,r,n,o){var i=Mr();try{me(t)(e,r,n,o)}catch(t){if($r(i),t!==t+0)throw t;Cr(1,0)}},F:function(t,e,r,n,o,i){var a=Mr();try{me(t)(e,r,n,o,i)}catch(t){if($r(a),t!==t+0)throw t;Cr(1,0)}},C:function(t,e,r,n,o,i,a){var s=Mr();try{me(t)(e,r,n,o,i,a)}catch(t){if($r(s),t!==t+0)throw t;Cr(1,0)}},K:function(t,e,r,n,o,i){var a=Mr();try{me(t)(e,r,n,o,i)}catch(t){if($r(a),t!==t+0)throw t;Cr(1,0)}},f:function(t,e,r,n,o){var i=Mr();try{me(t)(e,r,n,o)}catch(t){if($r(i),t!==t+0)throw t;Cr(1,0)}},ma:function(t,e,r,n,o,i,a,s){var u=Mr();try{me(t)(e,r,n,o,i,a,s)}catch(t){if($r(u),t!==t+0)throw t;Cr(1,0)}},Ja:function(t,e,r,n,o,i,a,s){var u=Mr();try{me(t)(e,r,n,o,i,a,s)}catch(t){if($r(u),t!==t+0)throw t;Cr(1,0)}},ka:function(t,e,r,n,o,i){var a=Mr();try{me(t)(e,r,n,o,i)}catch(t){if($r(a),t!==t+0)throw t;Cr(1,0)}},m:function(t,e,r,n,o,i){var a=Mr();try{me(t)(e,r,n,o,i)}catch(t){if($r(a),t!==t+0)throw t;Cr(1,0)}},q:function(t,e,r,n,o,i,a){var s=Mr();try{me(t)(e,r,n,o,i,a)}catch(t){if($r(s),t!==t+0)throw t;Cr(1,0)}},Ma:function(t,e,r,n,o,i,a,s,u,c,l){var d=Mr();try{me(t)(e,r,n,o,i,a,s,u,c,l)}catch(t){if($r(d),t!==t+0)throw t;Cr(1,0)}},x:function(t,e,r,n,o,i,a,s){var u=Mr();try{me(t)(e,r,n,o,i,a,s)}catch(t){if($r(u),t!==t+0)throw t;Cr(1,0)}},La:function(t,e,r,n,o,i,a,s,u,c,l,d){var h=Mr();try{me(t)(e,r,n,o,i,a,s,u,c,l,d)}catch(t){if($r(h),t!==t+0)throw t;Cr(1,0)}},Ka:function(t,e,r,n,o,i,a,s,u,c,l){var d=Mr();try{me(t)(e,r,n,o,i,a,s,u,c,l)}catch(t){if($r(d),t!==t+0)throw t;Cr(1,0)}},P:function(t,e,r,n,o,i,a,s,u){var c=Mr();try{me(t)(e,r,n,o,i,a,s,u)}catch(t){if($r(c),t!==t+0)throw t;Cr(1,0)}},ca:function(t,e,r,n,o,i,a,s,u,c){var l=Mr();try{me(t)(e,r,n,o,i,a,s,u,c)}catch(t){if($r(l),t!==t+0)throw t;Cr(1,0)}},N:function(t,e,r,n,o,i,a,s,u,c,l){var d=Mr();try{me(t)(e,r,n,o,i,a,s,u,c,l)}catch(t){if($r(d),t!==t+0)throw t;Cr(1,0)}},fa:function(t,e,r,n,o,i,a,s,u,c,l,d,h,f,p,m){var v=Mr();try{me(t)(e,r,n,o,i,a,s,u,c,l,d,h,f,p,m)}catch(t){if($r(v),t!==t+0)throw t;Cr(1,0)}},ob:function(t,e,r,n,o,i,a){var s=Mr();try{xr(t,e,r,n,o,i,a)}catch(t){if($r(s),t!==t+0)throw t;Cr(1,0)}},nb:function(t,e,r,n,o){var i=Mr();try{Dr(t,e,r,n,o)}catch(t){if($r(i),t!==t+0)throw t;Cr(1,0)}},y:t=>t,ta:lr,yb:(t,e,r,n,o)=>lr(t,e,r,n)},gr=function(){var t,e,r,n,a={a:vr};function s(t,e){var r,n=t.exports;return v=(gr=n).Wb,S(),$=gr.Zb,r=gr.Xb,A.unshift(r),N(),n}if(z(),i.instantiateWasm)try{return i.instantiateWasm(a,s)}catch(t){m(`Module.instantiateWasm callback failed with error: ${t}`),o(t)}return(t=f,e=F,r=a,n=function(t){s(t.instance)},t||"function"!=typeof WebAssembly.instantiateStreaming||L(e)||"function"!=typeof fetch?H(e,r,n):fetch(e,{credentials:"same-origin"}).then((t=>WebAssembly.instantiateStreaming(t,r).then(n,(function(t){return m(`wasm streaming compile failed: ${t}`),m("falling back to ArrayBuffer instantiation"),H(e,r,n)}))))).catch(o),{}}(),yr=i._malloc=t=>(yr=i._malloc=gr.Yb)(t),wr=i._free=t=>(wr=i._free=gr._b)(t),br=()=>(br=gr.$b)(),Er=t=>(Er=gr.ac)(t),_r=t=>(_r=gr.bc)(t),kr=(i.__embind_initialize_bindings=()=>(i.__embind_initialize_bindings=gr.cc)(),(t,e)=>(kr=gr.dc)(t,e)),Cr=(t,e)=>(Cr=gr.ec)(t,e),Mr=()=>(Mr=gr.fc)(),$r=t=>($r=gr.gc)(t),Pr=t=>(Pr=gr.hc)(t),Sr=t=>(Sr=gr.ic)(t),Fr=(t,e,r)=>(Fr=gr.jc)(t,e,r),Tr=t=>(Tr=gr.kc)(t),jr=i.dynCall_ji=(t,e)=>(jr=i.dynCall_ji=gr.lc)(t,e),Dr=(i.dynCall_jiji=(t,e,r,n,o)=>(i.dynCall_jiji=gr.mc)(t,e,r,n,o),i.dynCall_viij=(t,e,r,n,o)=>(i.dynCall_viij=gr.nc)(t,e,r,n,o),i.dynCall_viji=(t,e,r,n,o)=>(Dr=i.dynCall_viji=gr.oc)(t,e,r,n,o)),Wr=(i.dynCall_iiiijj=(t,e,r,n,o,a,s,u)=>(i.dynCall_iiiijj=gr.pc)(t,e,r,n,o,a,s,u),i.dynCall_viijj=(t,e,r,n,o,a,s)=>(i.dynCall_viijj=gr.qc)(t,e,r,n,o,a,s),i.dynCall_viiijjj=(t,e,r,n,o,a,s,u,c,l)=>(i.dynCall_viiijjj=gr.rc)(t,e,r,n,o,a,s,u,c,l),i.dynCall_j=t=>(Wr=i.dynCall_j=gr.sc)(t)),Ar=i.dynCall_jii=(t,e,r)=>(Ar=i.dynCall_jii=gr.tc)(t,e,r),xr=i.dynCall_viijii=(t,e,r,n,o,a,s)=>(xr=i.dynCall_viijii=gr.uc)(t,e,r,n,o,a,s),Or=i.dynCall_jiiii=(t,e,r,n,o)=>(Or=i.dynCall_jiiii=gr.vc)(t,e,r,n,o);function Ir(){function t(){mr||(mr=!0,i.calledRun=!0,P||(i.noFSInit||vt.init.initialized||vt.init(),vt.ignorePermissions=!1,lt.init(),Q(A),e(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)t=i.postRun.shift(),x.unshift(t);var t;Q(x)}()))}O>0||(function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)t=i.preRun.shift(),W.unshift(t);var t;Q(W)}(),O>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),t()}),1)):t()))}if(i.dynCall_iiiiij=(t,e,r,n,o,a,s)=>(i.dynCall_iiiiij=gr.wc)(t,e,r,n,o,a,s),i.dynCall_iiiiijj=(t,e,r,n,o,a,s,u,c)=>(i.dynCall_iiiiijj=gr.xc)(t,e,r,n,o,a,s,u,c),i.dynCall_iiiiiijj=(t,e,r,n,o,a,s,u,c,l)=>(i.dynCall_iiiiiijj=gr.yc)(t,e,r,n,o,a,s,u,c,l),i.___start_em_js=1462932,i.___stop_em_js=1463040,i.UTF8ToString=K,i.stringToUTF8=wt,i.lengthBytesUTF8=st,i.allocateUTF8=dr,R=function t(){mr||Ir(),mr||(R=t)},i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();function Rr(t,e){var r=zr();return Rr=function(e,n){var o=r[e-=118];if(void 0===Rr.lUTbvC){var i=function(t){for(var e,r,n="",o="",i=0,a=0;r=t.charAt(a++);~r&&(e=i%4?64*e+r:r,i++%4)?n+=String.fromCharCode(255&e>>(-2*i&6)):0)r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(r);for(var s=0,u=n.length;s<u;s++)o+="%"+("00"+n.charCodeAt(s).toString(16)).slice(-2);return decodeURIComponent(o)},a=function(t,e){var r,n,o=[],a=0,s="";for(t=i(t),n=0;n<256;n++)o[n]=n;for(n=0;n<256;n++)a=(a+o[n]+e.charCodeAt(n%e.length))%256,r=o[n],o[n]=o[a],o[a]=r;n=0,a=0;for(var u=0;u<t.length;u++)a=(a+o[n=(n+1)%256])%256,r=o[n],o[n]=o[a],o[a]=r,s+=String.fromCharCode(t.charCodeAt(u)^o[(o[n]+o[a])%256]);return s};Rr.UoNOms=a,t=arguments,Rr.lUTbvC=!0}var s=r[0],u=e+s,c=t[u];return c?o=c:(void 0===Rr.Rgvtxj&&(Rr.Rgvtxj=!0),o=Rr.UoNOms(o,n),t[u]=o),o},Rr(t,e)}function zr(){var t=["W6RcT311c1CVAHv6DmoHga","tI4qqmoZWQRdQ0iyWObZ","WRb+m8oOWQFdPCoyFW","W4NcNmoGWRTZbmk8W6TtWQFcLIxcMa","fhNcIuddVMhcK8kzWR/cHq","WOuAW5zGW4anWOeVWRFcJg/cQLG","W4VdQCk7j8kGt8kDCH/cUhWqmW","W6DxW4eesmooW5RdHsWRW48W","W4/dR8k8j8kGtSkzEaNcVKG7kW","WO1HaWuDtSowWQGQWP9rsmkw","fNVcJbxdLLFcQ8kFWPW","jmk+vNtcTSodWQhdSLq","W7JdSmoDWPzEWOBcQ8kG","ECkhdNGYWQPyamkrWO8qW4S","l8oGlSk/W4NdGSkhW74","W6ddSmoTWOnyWOBcQSkP","aSk+ySknW5VdVmoiWPhcShi0WOu","q2OdhbuKow/cPKi","WQjgW605WRavCCk7gmoeChPc","W69wW4zBomkDW6ddIGe","WPy0iSopmCk4mW","WQZdTxbCW4KbW6lcSSo3W7FdTG","WPabW7ldUSkWDJ4gyNaBrq","rwGegMjTEglcQhThW6FcRa","WRqRWQHguSkGWQu","WOzLWQBdQufObrTI"];return(zr=function(){return t})()}Ir(),function(t,e){for(var r=Rr,n=t();;)try{if(871609==-parseInt(r(123,"CFi]"))/1+parseInt(r(125,"WEPJ"))/2+-parseInt(r(129,"iN7e"))/3*(parseInt(r(135,"CFi]"))/4)+-parseInt(r(118,"bplO"))/5*(parseInt(r(124,"D[i5"))/6)+parseInt(r(120,"mDjw"))/7*(-parseInt(r(137,"MpzE"))/8)+-parseInt(r(140,"#7l9"))/9*(-parseInt(r(122,"D[i5"))/10)+parseInt(r(127,"IDt2"))/11*(parseInt(r(121,"!3R@"))/12))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(zr);var ighnua,Nr=(ighnua=!0,function(ovjrup,Euvnak){var Ovjrup=ighnua?function(){if(Euvnak){var Ighnua=Euvnak.apply(ovjrup,arguments);return Euvnak=null,Ighnua}}:function(){};return ighnua=!1,Ovjrup}),Ur=Nr(this,(function(){return!/" + this + "/.constructor("^([^ ]+( +[^ ]+)+)+[^ ]}").test(Ur)}));return Ur(),t.ready});t.exports=o}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),(()=>{"use strict";function t(){return/(iPad|iPhone|iPod)/g.test(navigator.userAgent)}function e(){try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]))&&function(){if(WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,5,3,1,0,1,11,9,1,0,65,1,65,2,106,11,0])))return!0;if(!t())return!1;const e=navigator.userAgent.match(/OS (\d{1,2})_(\d{1,2})(_(\d{1,3}))?\s/);if(!e)return!1;const r=parseInt(e[1],10),n=parseInt(e[2],10);return 16===r&&n>=7||17===r}()}catch(t){return!1}}function n(r){const{allowSimd:n=!0,allowThreads:o=!0}=r||{};let i="";if(n&&e()){i+="-simd";o&&function(){if("undefined"!=typeof process&&"undefined"!=typeof process.versions&&"undefined"!=typeof process.versions.node)return!1;if(t())return!1;try{return(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))}catch(t){return!1}}()&&(i+="-threads")}return i}class o extends Error{constructor(){super(...arguments),this.errorType="UnknownError"}}class i extends Error{constructor(){super(...arguments),this.errorType="InvalidLicense"}}class a extends Error{constructor(){super(...arguments),this.errorType="NullPointer"}}class s extends Error{constructor(){super(...arguments),this.errorType="InvalidArgument"}}class u extends Error{constructor(){super(...arguments),this.errorType="InvalidImageRef"}}class c extends Error{constructor(){super(...arguments),this.errorType="ComponentUnavailable"}}class l extends Error{constructor(){super(...arguments),this.errorType="IllegalState"}}class d extends Error{constructor(){super(...arguments),this.errorType="IoError"}}class h extends Error{constructor(){super(...arguments),this.errorType="InvalidData"}}class f extends Error{constructor(){super(...arguments),this.errorType="OperationCanceled"}}class p extends Error{constructor(){super(...arguments),this.errorType="OutOfMemory"}}class m extends Error{constructor(){super(...arguments),this.errorType="Timeout"}}class v{constructor(t){this.id=t}}class g{constructor(){this._map=new Map,this._nextId=0,this._unique=Math.random().toString(36)}add(t){const e=this._nextId.toString()+"_"+this._unique;return this._map.set(e,t),this._nextId++,new v(e)}get(t){return this._map.get(t.id)}delete(t){this.get(t).delete(),this._map.delete(t.id)}}function y(t){if(t.errorMessage)throw function(t,e,r){const n=r?{cause:r}:void 0;switch(t){case"UnknownError":return new o(e,n);case"InvalidLicense":return new i("Your license is not valid to use this feature of the ScanbotSDK. This can be because of one of the following reasons: \n 1) You did not successfully initialize the SDK with your license. \n 2) Your license expired \n 3) Your license does not allow the use of this feature of the ScanbotSDK",n);case"NullPointer":return new a(e,n);case"InvalidArgument":return new s(e,n);case"InvalidImageRef":return new u(e,n);case"ComponentUnavailable":return new c(e,n);case"IllegalState":return new l(e,n);case"IoError":return new d(e,n);case"InvalidData":return new h(e,n);case"OperationCanceled":return new f(e,n);case"OutOfMemory":return new p(e,n);case"Timeout":return new m(e,n);default:throw new Error(e)}}(t.errorType,t.errorMessage);return t.result}var w;!function(t){t.from=function(t){const e=t._type;switch(e){case"LegacyFilter":return new b(t);case"ScanbotBinarizationFilter":return new E(t);case"CustomBinarizationFilter":return new _(t);case"ColorDocumentFilter":return new k(t);case"ColorDocumentShadowRemovalFilter":return new C(t);case"BrightnessFilter":return new M(t);case"ContrastFilter":return new $(t);case"GrayscaleFilter":return new P(t);case"WhiteBlackPointFilter":return new S(t);default:throw new Error(`Unknown child class name: ${e}`)}}}(w||(w={}));class b{constructor(t={}){this._type="LegacyFilter",this.filterType=0,void 0!==t.filterType&&(this.filterType=t.filterType)}}class E{constructor(t={}){this._type="ScanbotBinarizationFilter",this.outputMode="BINARY",void 0!==t.outputMode&&(this.outputMode=t.outputMode)}}class _{constructor(t={}){this._type="CustomBinarizationFilter",this.outputMode="BINARY",this.denoise=.5,this.radius=32,this.preset="PRESET_4",void 0!==t.outputMode&&(this.outputMode=t.outputMode),void 0!==t.denoise&&(this.denoise=t.denoise),void 0!==t.radius&&(this.radius=t.radius),void 0!==t.preset&&(this.preset=t.preset)}}class k{constructor(t={}){this._type="ColorDocumentFilter",this.contrastEnhancement=.5,this.colorEnhancement=.5,this.paperWhitening=1,this.paperWhiteningBias=0,void 0!==t.contrastEnhancement&&(this.contrastEnhancement=t.contrastEnhancement),void 0!==t.colorEnhancement&&(this.colorEnhancement=t.colorEnhancement),void 0!==t.paperWhitening&&(this.paperWhitening=t.paperWhitening),void 0!==t.paperWhiteningBias&&(this.paperWhiteningBias=t.paperWhiteningBias)}}class C{constructor(t={}){this._type="ColorDocumentShadowRemovalFilter",this.contrastEnhancement=.5,this.colorEnhancement=.5,this.paperSaturation=.5,this.paperLightness=.5,void 0!==t.contrastEnhancement&&(this.contrastEnhancement=t.contrastEnhancement),void 0!==t.colorEnhancement&&(this.colorEnhancement=t.colorEnhancement),void 0!==t.paperSaturation&&(this.paperSaturation=t.paperSaturation),void 0!==t.paperLightness&&(this.paperLightness=t.paperLightness)}}class M{constructor(t={}){this._type="BrightnessFilter",this.brightness=0,void 0!==t.brightness&&(this.brightness=t.brightness)}}class ${constructor(t={}){this._type="ContrastFilter",this.contrast=0,void 0!==t.contrast&&(this.contrast=t.contrast)}}class P{constructor(t={}){this._type="GrayscaleFilter",this.borderWidthFraction=.06,this.blackOutliersFraction=0,this.whiteOutliersFraction=.02,void 0!==t.borderWidthFraction&&(this.borderWidthFraction=t.borderWidthFraction),void 0!==t.blackOutliersFraction&&(this.blackOutliersFraction=t.blackOutliersFraction),void 0!==t.whiteOutliersFraction&&(this.whiteOutliersFraction=t.whiteOutliersFraction)}}class S{constructor(t={}){this._type="WhiteBlackPointFilter",this.blackPoint=0,this.whitePoint=1,void 0!==t.blackPoint&&(this.blackPoint=t.blackPoint),void 0!==t.whitePoint&&(this.whitePoint=t.whitePoint)}}class F{constructor(t={}){this.author="Created with Scanbot SDK",this.creator="",this.title="",this.subject="",this.keywords="",void 0!==t.author&&(this.author=t.author),void 0!==t.creator&&(this.creator=t.creator),void 0!==t.title&&(this.title=t.title),void 0!==t.subject&&(this.subject=t.subject),void 0!==t.keywords&&(this.keywords=t.keywords)}}class T{constructor(t={}){this.attributes=new F({}),this.pageSize="A4",this.pageDirection="PORTRAIT",this.pageFit="FIT_IN",this.dpi=72,this.jpegQuality=80,this.resamplingMethod="NONE",this.binarizationFilter=null,void 0!==t.attributes&&(this.attributes=new F(t.attributes)),void 0!==t.pageSize&&(this.pageSize=t.pageSize),void 0!==t.pageDirection&&(this.pageDirection=t.pageDirection),void 0!==t.pageFit&&(this.pageFit=t.pageFit),void 0!==t.dpi&&(this.dpi=t.dpi),void 0!==t.jpegQuality&&(this.jpegQuality=t.jpegQuality),void 0!==t.resamplingMethod&&(this.resamplingMethod=t.resamplingMethod),void 0!==t.binarizationFilter&&(this.binarizationFilter=null!=t.binarizationFilter?w.from(t.binarizationFilter):null)}}var j;!function(t){t.from=function(t){const e=t._type;switch(e){case"UserFieldDoubleValue":return new D(t);case"UserFieldStringValue":return new W(t);case"UserFieldIntValue":return new A(t);default:throw new Error(`Unknown child class name: ${e}`)}}}(j||(j={}));class D{constructor(t={}){if(this._type="UserFieldDoubleValue",void 0===t.value)throw new Error("value must be present in constructor argument");this.value=t.value}}class W{constructor(t={}){if(this._type="UserFieldStringValue",void 0===t.value)throw new Error("value must be present in constructor argument");this.value=t.value}}class A{constructor(t={}){if(this._type="UserFieldIntValue",void 0===t.value)throw new Error("value must be present in constructor argument");this.value=t.value}}class x{constructor(t={}){if(void 0===t.tag)throw new Error("tag must be present in constructor argument");if(this.tag=t.tag,void 0===t.name)throw new Error("name must be present in constructor argument");if(this.name=t.name,void 0===t.value)throw new Error("value must be present in constructor argument");this.value=j.from(t.value)}}class O{constructor(t={}){this.compression="LZW",this.jpegQuality=80,this.zipCompressionLevel=6,this.dpi=72,this.userFields=[],this.binarizationFilter=null,void 0!==t.compression&&(this.compression=t.compression),void 0!==t.jpegQuality&&(this.jpegQuality=t.jpegQuality),void 0!==t.zipCompressionLevel&&(this.zipCompressionLevel=t.zipCompressionLevel),void 0!==t.dpi&&(this.dpi=t.dpi),void 0!==t.userFields&&(this.userFields=t.userFields.map((t=>new x(t)))),void 0!==t.binarizationFilter&&(this.binarizationFilter=null!=t.binarizationFilter?w.from(t.binarizationFilter):null)}}function I(t,e){const r=t[e];if(!r)throw new c(`You have initialized ScanbotSDK with "document-scanner" flavor but are trying to access a feature, "${e}", not available in this flavor.\nPlease make sure you've copied over the correct binaries and pointed the "enginePath" parameter to the correct flavor.\nFor more information see Web SDK initialization section on https://docs.scanbot.io`);return r}!function(t){t.defaultCompression="LZW",t.binaryDocumentOptimizedCompression="CCITT_T6"}(O||(O={}));var R=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};class z{constructor(t){this.getWasmModule=t,this.objectMap=new g}create(t){return R(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=y(e),this.objectMap.add(e)}))}parse(t,e){return R(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).parse(e);return r=y(r),r}))}destroy(t){return R(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"BarcodeDocumentParser")}}var N=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};class U{constructor(t){this.getWasmModule=t,this.objectMap=new g}create(t){return N(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=y(e),this.objectMap.add(e)}))}run(t,e){return N(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=y(r),{result:r,originalImage:e}}))}clearFrameAccumulationCache(t){return N(this,void 0,void 0,(function*(){return this.objectMap.get(t).clearFrameAccumulationCache()}))}destroy(t){return N(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"BarcodeScanner")}}var L=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};class B{constructor(t){this.getWasmModule=t,this.objectMap=new g}create(t){return L(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=y(e),this.objectMap.add(e)}))}run(t,e){return L(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=y(r),{result:r,originalImage:e}}))}destroy(t){return L(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"CheckScanner")}}var H=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};class V{constructor(t){this.getWasmModule=t,this.objectMap=new g}create(t){return H(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=y(e),this.objectMap.add(e)}))}run(t,e){return H(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=y(r),{result:r,originalImage:e}}))}clearResult(t){return H(this,void 0,void 0,(function*(){return this.objectMap.get(t).clearResult()}))}destroy(t){return H(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"CreditCardScanner")}}var Y=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};class Q{constructor(t){this.getWasmModule=t,this.objectMap=new g}create(t){return Y(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=y(e),this.objectMap.add(e)}))}run(t,e){return Y(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=y(r),{result:r,originalImage:e}}))}destroy(t){return Y(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"DocumentClassifier")}}var q=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};class G{constructor(t){this.getWasmModule=t,this.objectMap=new g}create(t){return q(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=y(e),this.objectMap.add(e)}))}run(t,e){return q(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=y(r),{result:r,originalImage:e}}))}clearResult(t){return q(this,void 0,void 0,(function*(){return this.objectMap.get(t).clearResult()}))}verifyDocument(t,e){return q(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).verifyDocument(e);return r=y(r),r}))}destroy(t){return q(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"DocumentDataExtractor")}}var K=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};class X{constructor(t){this.getWasmModule=t,this.objectMap=new g}create(t){return K(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=y(e),this.objectMap.add(e)}))}run(t,e){return K(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=y(r),{result:r,originalImage:e}}))}destroy(t){return K(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"DocumentQualityAnalyzer")}}var Z=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};class J{constructor(t){this.getWasmModule=t,this.objectMap=new g}create(t){return Z(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=y(e),this.objectMap.add(e)}))}run(t,e){return Z(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=y(r),{result:r,originalImage:e}}))}scan(t,e){return Z(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).scan(e);return r=y(r),{result:r,originalImage:e}}))}clearResult(t){return Z(this,void 0,void 0,(function*(){return this.objectMap.get(t).clearResult()}))}destroy(t){return Z(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"DocumentScanner")}}var tt=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};class et{constructor(t){this.getWasmModule=t,this.objectMap=new g}create(){return tt(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create();return this.objectMap.add(t)}))}cropRect(t,e,r){return tt(this,void 0,void 0,(function*(){let n=this.objectMap.get(t).cropRect(e,r);return n=y(n),{result:n,originalImage:e}}))}rotate(t,e,r){return tt(this,void 0,void 0,(function*(){let n=this.objectMap.get(t).rotate(e,r);return n=y(n),{result:n,originalImage:e}}))}flip(t,e,r){return tt(this,void 0,void 0,(function*(){let n=this.objectMap.get(t).flip(e,r);return n=y(n),{result:n,originalImage:e}}))}resize(t,e,r){return tt(this,void 0,void 0,(function*(){let n=this.objectMap.get(t).resize(e,r);return n=y(n),{result:n,originalImage:e}}))}destroy(t){return tt(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"ImageManipulator")}}var rt=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};class nt{constructor(t){this.getWasmModule=t,this.objectMap=new g}create(){return rt(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create();return this.objectMap.add(t)}))}crop(t,e,r){return rt(this,void 0,void 0,(function*(){let n=this.objectMap.get(t).crop(e,r);return n=y(n),{result:n,originalImage:e}}))}resize(t,e,r){return rt(this,void 0,void 0,(function*(){let n=this.objectMap.get(t).resize(e,r);return n=y(n),{result:n,originalImage:e}}))}rotate(t,e,r){return rt(this,void 0,void 0,(function*(){let n=this.objectMap.get(t).rotate(e,r);return n=y(n),{result:n,originalImage:e}}))}applyFilter(t,e,r){return rt(this,void 0,void 0,(function*(){let n=this.objectMap.get(t).applyFilter(e,r);return n=y(n),{result:n,originalImage:e}}))}destroy(t){return rt(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"ImageProcessor")}}var ot=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};class it{constructor(t){this.getWasmModule=t,this.objectMap=new g}create(t){return ot(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=y(e),this.objectMap.add(e)}))}run(t,e){return ot(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=y(r),{result:r,originalImage:e}}))}clearResult(t){return ot(this,void 0,void 0,(function*(){return this.objectMap.get(t).clearResult()}))}destroy(t){return ot(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"MrzScanner")}}class at{constructor(t){this.getWasmModule=t,this.objectMap=new g}create(t){return ot(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=y(e),this.objectMap.add(e)}))}parse(t,e){return ot(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).parse(e);return r=y(r),r}))}destroy(t){return ot(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"MrzParser")}}var st=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};class ut{constructor(t){this.getWasmModule=t,this.objectMap=new g}create(){return st(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create();return t=y(t),this.objectMap.add(t)}))}run(t,e){return st(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=y(r),{result:r,originalImage:e}}))}destroy(t){return st(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"OcrEngine")}}var ct=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};class lt{constructor(t){this.getWasmModule=t,this.objectMap=new g}create(t){return ct(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=y(e),this.objectMap.add(e)}))}run(t,e){return ct(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=y(r),{result:r,originalImage:e}}))}cleanRecognitionQueue(t){return ct(this,void 0,void 0,(function*(){return this.objectMap.get(t).cleanRecognitionQueue()}))}destroy(t){return ct(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"TextPatternScanner")}}var dt=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};class ht{constructor(t){this.getWasmModule=t,this.objectMap=new g}create(t){return dt(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=y(e),this.objectMap.add(e)}))}run(t,e){return dt(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=y(r),{result:r,originalImage:e}}))}cleanRecognitionQueue(t){return dt(this,void 0,void 0,(function*(){return this.objectMap.get(t).cleanRecognitionQueue()}))}destroy(t){return dt(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"VinScanner")}}var ft=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((n=n.apply(t,e||[])).next())}))};let pt;class mt extends Error{}const vt={};function gt(t){const e=Math.random().toString(36);return vt[e]=t,new v(e)}function yt(t){if(!vt.hasOwnProperty(t.id))throw new Error(`Object ${t.id} does not exist`);return vt[t.id]}function wt(t){const e=yt(t);e.delete&&e.delete(),delete vt[t.id]}new g,new g;const bt=Object.assign(Object.assign({initialize:function(t,e,o,i){return ft(this,void 0,void 0,(function*(){try{const{captureConsole:a,requestSuffix:s=""}=i||{};a&&(console.log=function(...t){self.postMessage({log:t})},console.error=function(...t){self.postMessage({logError:t})});const u=r(801),c=r(772),l={locateFile:function(t,r){let n;return n=function(t){return t.startsWith("http:")||t.startsWith("https:")}(e)?e:"",t.endsWith(".worker.js")&&c?c.default:new URL(n+t+s,location.href).href}},d=n(i),h=d.includes("-threads");l.mainScriptUrlOrBlob=l.locateFile(`ScanbotSDK.Asm${d}.js`);let f;if(!!navigator.userAgentData&&navigator.userAgentData.brands.some((t=>"Chromium"===t.brand))&&h){let t=[2147483648,805306368,536870912],e=134217728;const r=67108864;["barcode-scanner"].includes("document-scanner")&&(e=r,t.push(4*r));for(let r=0;r<t.length;r++){const n=t[r];try{f=new WebAssembly.Memory({initial:0,maximum:n/65536,shared:!0}),f.grow(e/65536);break}catch(e){if(r===t.length-1)throw e}}}return f&&(l.wasmMemory=f),l.onAbort=function(t){const e="\nNo further calls to the SDK are possible.";throw new mt("OOM"===t?"ScanbotSDK ran out of memory. "+e:"ScanbotSDK ran into an unexpected error: "+t+e)},yield u(l),pt=l,y(pt.initialize(t||"",o))}catch(t){throw console.error(t),t}}))},getLicenseInfo:function(){return ft(this,void 0,void 0,(function*(){return y(pt.getLicenseInfo())}))},encodeJpeg:function(t,e=80){return ft(this,void 0,void 0,(function*(){return y(pt.encodeJpeg(t,e))}))},beginPdf:function(t){return ft(this,void 0,void 0,(function*(){return gt(y(I(pt,"PdfGenerationContext").create(new T(t))))}))},addPageToPdf:function(t,e,r="ENABLED_IF_BINARIZATION_FILTER_SET"){return ft(this,void 0,void 0,(function*(){y(yt(t).addPage(e,r))}))},addPageToPdfWithOcr:function(t,e,r="ENABLED_IF_BINARIZATION_FILTER_SET"){return ft(this,void 0,void 0,(function*(){y(yt(t).addPageWithOcr(e,r))}))},completePdf:function(t){return ft(this,void 0,void 0,(function*(){try{const e=yt(t);return y(e.complete())}finally{wt(t)}}))},beginTiff:function(t){return ft(this,void 0,void 0,(function*(){const e=y(I(pt,"TiffGenerationContext").create(new O(t)));return y(e.begin()),gt(e)}))},addPageToTiff:function(t,e,r){return ft(this,void 0,void 0,(function*(){y(yt(t).addPage(e,r))}))},completeTiff:function(t){return ft(this,void 0,void 0,(function*(){try{const e=yt(t);return y(e.complete())}finally{wt(t)}}))},releaseObject:function(t){return ft(this,void 0,void 0,(function*(){wt(t)}))},version:function(){return ft(this,void 0,void 0,(function*(){return"8.1.1"}))}},{BarcodeDocumentParser:new z(Et=()=>pt),BarcodeScanner:new U(Et),CheckScanner:new B(Et),CreditCardScanner:new V(Et),DocumentClassifier:new Q(Et),DocumentDataExtractor:new G(Et),DocumentQualityAnalyzer:new X(Et),DocumentScanner:new J(Et),ImageManipulator:new et(Et),ImageProcessor:new nt(Et),MrzScanner:new it(Et),MrzParser:new at(Et),OcrEngine:new ut(Et),TextPatternScanner:new lt(Et),VinScanner:new ht(Et)}),{__hasModuleFunction:function(t){return ft(this,void 0,void 0,(function*(){return pt.hasOwnProperty(t)}))},__callModuleFunction:function(t,e=[]){return ft(this,void 0,void 0,(function*(){return pt[t](...e)}))}});var Et;onmessage=function(t){const{command:e,args:r,ticket:n}=t.data;if(!pt&&"initialize"!==e)return void self.postMessage({ticket:n,recoverableError:new Error("WASM module not loaded yet.")});let o;o=e.includes(".")?bt[e.split(".")[0]][e.split(".")[1]](...r):bt[e](...r),(()=>ft(this,void 0,void 0,(function*(){return yield o})))().then((t=>{const e=function(t,e=!1){const r=[];return e||function t(e){if(e)if(e.constructor===ImageData)r.push(e.data.buffer);else if(e.constructor===ArrayBuffer)r.push(e);else if(ArrayBuffer.isView(e))r.push(e.buffer);else if(Array.isArray(e))for(let r=0;r<e.length;++r)t(e[r]);else if("object"==typeof e)for(const r in e)e.hasOwnProperty(r)&&t(e[r])}(t),r}(t);self.postMessage({ticket:n,result:t},e)})).catch((t=>{if(t instanceof mt)self.postMessage({ticket:n,unrecoverableError:t});else{const e="number"==typeof t?Error(pt.stringFromException(t)):t;console.error(e),self.postMessage({ticket:n,recoverableError:e,errorType:null==e?void 0:e.errorType})}}))}})()})();