(()=>{var t={290:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>n});const n="data:application/javascript;charset=utf-8;base64,InVzZSBzdHJpY3QiO3ZhciBNb2R1bGU9e307dmFyIGluaXRpYWxpemVkSlM9ZmFsc2U7ZnVuY3Rpb24gdGhyZWFkUHJpbnRFcnIoKXt2YXIgdGV4dD1BcnJheS5wcm90b3R5cGUuc2xpY2UuY2FsbChhcmd1bWVudHMpLmpvaW4oIiAiKTtjb25zb2xlLmVycm9yKHRleHQpfWZ1bmN0aW9uIHRocmVhZEFsZXJ0KCl7dmFyIHRleHQ9QXJyYXkucHJvdG90eXBlLnNsaWNlLmNhbGwoYXJndW1lbnRzKS5qb2luKCIgIik7cG9zdE1lc3NhZ2Uoe2NtZDoiYWxlcnQiLHRleHQ6dGV4dCx0aHJlYWRJZDpNb2R1bGVbIl9wdGhyZWFkX3NlbGYiXSgpfSl9dmFyIGVycj10aHJlYWRQcmludEVycjtzZWxmLmFsZXJ0PXRocmVhZEFsZXJ0O01vZHVsZVsiaW5zdGFudGlhdGVXYXNtIl09KGluZm8scmVjZWl2ZUluc3RhbmNlKT0+e3ZhciBtb2R1bGU9TW9kdWxlWyJ3YXNtTW9kdWxlIl07TW9kdWxlWyJ3YXNtTW9kdWxlIl09bnVsbDt2YXIgaW5zdGFuY2U9bmV3IFdlYkFzc2VtYmx5Lkluc3RhbmNlKG1vZHVsZSxpbmZvKTtyZXR1cm4gcmVjZWl2ZUluc3RhbmNlKGluc3RhbmNlKX07c2VsZi5vbnVuaGFuZGxlZHJlamVjdGlvbj1lPT57dGhyb3cgZS5yZWFzb258fGV9O2Z1bmN0aW9uIGhhbmRsZU1lc3NhZ2UoZSl7dHJ5e2lmKGUuZGF0YS5jbWQ9PT0ibG9hZCIpe2xldCBtZXNzYWdlUXVldWU9W107c2VsZi5vbm1lc3NhZ2U9ZT0+bWVzc2FnZVF1ZXVlLnB1c2goZSk7c2VsZi5zdGFydFdvcmtlcj1pbnN0YW5jZT0+e01vZHVsZT1pbnN0YW5jZTtwb3N0TWVzc2FnZSh7ImNtZCI6ImxvYWRlZCJ9KTtmb3IobGV0IG1zZyBvZiBtZXNzYWdlUXVldWUpe2hhbmRsZU1lc3NhZ2UobXNnKX1zZWxmLm9ubWVzc2FnZT1oYW5kbGVNZXNzYWdlfTtNb2R1bGVbIndhc21Nb2R1bGUiXT1lLmRhdGEud2FzbU1vZHVsZTtmb3IoY29uc3QgaGFuZGxlciBvZiBlLmRhdGEuaGFuZGxlcnMpe01vZHVsZVtoYW5kbGVyXT0oLi4uYXJncyk9Pntwb3N0TWVzc2FnZSh7Y21kOiJjYWxsSGFuZGxlciIsaGFuZGxlcjpoYW5kbGVyLGFyZ3M6YXJnc30pfX1Nb2R1bGVbIndhc21NZW1vcnkiXT1lLmRhdGEud2FzbU1lbW9yeTtNb2R1bGVbImJ1ZmZlciJdPU1vZHVsZVsid2FzbU1lbW9yeSJdLmJ1ZmZlcjtNb2R1bGVbIkVOVklST05NRU5UX0lTX1BUSFJFQUQiXT10cnVlO2lmKHR5cGVvZiBlLmRhdGEudXJsT3JCbG9iPT0ic3RyaW5nIil7aW1wb3J0U2NyaXB0cyhlLmRhdGEudXJsT3JCbG9iKX1lbHNle3ZhciBvYmplY3RVcmw9VVJMLmNyZWF0ZU9iamVjdFVSTChlLmRhdGEudXJsT3JCbG9iKTtpbXBvcnRTY3JpcHRzKG9iamVjdFVybCk7VVJMLnJldm9rZU9iamVjdFVSTChvYmplY3RVcmwpfWluaXRNb2R1bGUoTW9kdWxlKX1lbHNlIGlmKGUuZGF0YS5jbWQ9PT0icnVuIil7TW9kdWxlWyJfX2Vtc2NyaXB0ZW5fdGhyZWFkX2luaXQiXShlLmRhdGEucHRocmVhZF9wdHIsMCwwLDEpO01vZHVsZVsiX19lbXNjcmlwdGVuX3RocmVhZF9tYWlsYm94X2F3YWl0Il0oZS5kYXRhLnB0aHJlYWRfcHRyKTtNb2R1bGVbImVzdGFibGlzaFN0YWNrU3BhY2UiXSgpO01vZHVsZVsiUFRocmVhZCJdLnJlY2VpdmVPYmplY3RUcmFuc2ZlcihlLmRhdGEpO01vZHVsZVsiUFRocmVhZCJdLnRocmVhZEluaXRUTFMoKTtpZighaW5pdGlhbGl6ZWRKUyl7TW9kdWxlWyJfX2VtYmluZF9pbml0aWFsaXplX2JpbmRpbmdzIl0oKTtpbml0aWFsaXplZEpTPXRydWV9dHJ5e01vZHVsZVsiaW52b2tlRW50cnlQb2ludCJdKGUuZGF0YS5zdGFydF9yb3V0aW5lLGUuZGF0YS5hcmcpfWNhdGNoKGV4KXtpZihleCE9InVud2luZCIpe3Rocm93IGV4fX19ZWxzZSBpZihlLmRhdGEuY21kPT09ImNhbmNlbCIpe2lmKE1vZHVsZVsiX3B0aHJlYWRfc2VsZiJdKCkpe01vZHVsZVsiX19lbXNjcmlwdGVuX3RocmVhZF9leGl0Il0oLTEpfX1lbHNlIGlmKGUuZGF0YS50YXJnZXQ9PT0ic2V0aW1tZWRpYXRlIil7fWVsc2UgaWYoZS5kYXRhLmNtZD09PSJjaGVja01haWxib3giKXtpZihpbml0aWFsaXplZEpTKXtNb2R1bGVbImNoZWNrTWFpbGJveCJdKCl9fWVsc2UgaWYoZS5kYXRhLmNtZCl7ZXJyKGB3b3JrZXIuanMgcmVjZWl2ZWQgdW5rbm93biBjb21tYW5kICR7ZS5kYXRhLmNtZH1gKTtlcnIoZS5kYXRhKX19Y2F0Y2goZXgpe2lmKE1vZHVsZVsiX19lbXNjcmlwdGVuX3RocmVhZF9jcmFzaGVkIl0pe01vZHVsZVsiX19lbXNjcmlwdGVuX3RocmVhZF9jcmFzaGVkIl0oKX10aHJvdyBleH19c2VsZi5vbm1lc3NhZ2U9aGFuZGxlTWVzc2FnZTsK"},709:(t,e,r)=>{var n,o=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(t={}){function e(){return M.buffer!=F.buffer&&Z(),F}function o(){return M.buffer!=F.buffer&&Z(),P}function i(){return M.buffer!=F.buffer&&Z(),j}function a(){return M.buffer!=F.buffer&&Z(),$}function s(){return M.buffer!=F.buffer&&Z(),A}function u(){return M.buffer!=F.buffer&&Z(),D}function c(){return M.buffer!=F.buffer&&Z(),I}var l,d,h=t;h.ready=new Promise(((t,e)=>{l=t,d=e}));var f,p,m,v=Object.assign({},h),g="./this.program",y=(t,e)=>{throw e},w=h.ENVIRONMENT_IS_PTHREAD||!1,b="";function _(t){return h.locateFile?h.locateFile(t,b):b+t}b=self.location.href,n&&(b=n),b=0!==b.indexOf("blob:")?b.substr(0,b.replace(/[?#].*/,"").lastIndexOf("/")+1):"",f=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},m=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)},p=(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 E,k=h.print||console.log.bind(console),W=h.printErr||console.error.bind(console);Object.assign(h,v),v=null,h.arguments&&h.arguments,h.thisProgram&&(g=h.thisProgram),h.quit&&(y=h.quit),h.wasmBinary&&(E=h.wasmBinary);var M,C,T=h.noExitRuntime||!0;"object"!=typeof WebAssembly&&nt("no native wasm support detected");var S,F,P,j,$,A,D,x,I,R=!1;function V(t,e){t||nt(e)}function Z(){var t=M.buffer;h.HEAP8=F=new Int8Array(t),h.HEAP16=j=new Int16Array(t),h.HEAPU8=P=new Uint8Array(t),h.HEAPU16=$=new Uint16Array(t),h.HEAP32=A=new Int32Array(t),h.HEAPU32=D=new Uint32Array(t),h.HEAPF32=x=new Float32Array(t),h.HEAPF64=I=new Float64Array(t)}var O,N=h.INITIAL_MEMORY||134217728;if(V(N>=4194304,"INITIAL_MEMORY should be larger than STACK_SIZE, was "+N+"! (STACK_SIZE=4194304)"),w)M=h.wasmMemory;else if(h.wasmMemory)M=h.wasmMemory;else if(!((M=new WebAssembly.Memory({initial:N/65536,maximum:32768,shared:!0})).buffer instanceof SharedArrayBuffer))throw W("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),Error("bad memory");Z(),N=M.buffer.byteLength;var z=[],G=[],U=[],L=0;function X(){return T||L>0}function Y(){w||(h.noFSInit||Ct.init.initialized||Ct.init(),Ct.ignorePermissions=!1,_t.init(),At(G))}function B(t){z.unshift(t)}var H,K,J,Q=0,q=null,tt=null;function et(t){Q++,h.monitorRunDependencies&&h.monitorRunDependencies(Q)}function rt(t){if(Q--,h.monitorRunDependencies&&h.monitorRunDependencies(Q),0==Q&&(null!==q&&(clearInterval(q),q=null),tt)){var e=tt;tt=null,e()}}function nt(t){h.onAbort&&h.onAbort(t),W(t="Aborted("+t+")"),R=!0,S=1,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw d(e),e}function ot(t){return t.startsWith("data:application/octet-stream;base64,")}function it(t){if(t==H&&E)return new Uint8Array(E);if(m)return m(t);throw"both async and sync fetching of the wasm failed"}function at(t,e,r){return function(t){return E||"function"!=typeof fetch?Promise.resolve().then((()=>it(t))):fetch(t,{credentials:"same-origin"}).then((e=>{if(!e.ok)throw"failed to load wasm binary file at '"+t+"'";return e.arrayBuffer()})).catch((()=>it(t)))}(t).then((t=>WebAssembly.instantiate(t,e))).then((t=>t)).then(r,(t=>{W(`failed to asynchronously prepare wasm: ${t}`),nt(t)}))}ot(H="ScanbotSDK.Asm-simd-threads.wasm")||(H=_(H));var st={1825548:t=>hn(function(){return this[Tt(t)].toString()}.apply(function(){return this}.call(void 0)))};function ut(t){this.name="ExitStatus",this.message=`Program terminated with exit(${t})`,this.status=t}var ct=t=>{t.terminate(),t.onmessage=t=>{}},lt=t=>{var e=$t.pthreads[t];V(e),$t.returnWorkerToPool(e)},dt=t=>{var e=$t.getNewWorker();if(!e)return 6;$t.runningWorkers.push(e),$t.pthreads[t.pthread_ptr]=e,e.pthread_ptr=t.pthread_ptr;var r={cmd:"run",start_routine:t.startRoutine,arg:t.arg,pthread_ptr:t.pthread_ptr};return e.postMessage(r,t.transferList),0},ht={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=ht.isAbs(t),r="/"===t.substr(-1);return(t=ht.normalizeArray(t.split("/").filter((t=>!!t)),!e).join("/"))||e||(t="."),t&&r&&(t+="/"),(e?"/":"")+t},dirname:t=>{var e=ht.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=ht.normalize(t)).replace(/\/$/,"")).lastIndexOf("/");return-1===e?t:t.substr(e+1)},join:function(){var t=Array.prototype.slice.call(arguments);return ht.normalize(t.join("/"))},join2:(t,e)=>ht.normalize(t+"/"+e)},ft=t=>(ft=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return t=>(t.set(crypto.getRandomValues(new Uint8Array(t.byteLength))),t);nt("initRandomDevice")})())(t),pt={resolve:function(){for(var t="",e=!1,r=arguments.length-1;r>=-1&&!e;r--){var n=r>=0?arguments[r]:Ct.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";t=n+"/"+t,e=ht.isAbs(n)}return(e?"/":"")+(t=ht.normalizeArray(t.split("/").filter((t=>!!t)),!e).join("/"))||"."},relative:(t,e)=>{function r(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=pt.resolve(t).substr(1),e=pt.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{for(var n=e+r,o=e;t[o]&&!(o>=n);)++o;if(o-e>16&&t.buffer&&mt)return mt.decode(t.buffer instanceof SharedArrayBuffer?t.slice(e,o):t.subarray(e,o));for(var i="";e>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i},gt=[],yt=t=>{for(var e=0,r=0;r=55296&&n<=57343?(e+=4,++r):e+=3}return e},wt=(t,e,r,n)=>{if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a=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 bt(t,e,r){var n=r>0?r:yt(t)+1,o=new Array(n),i=wt(t,o,0,o.length);return e&&(o.length=i),o}var _t={ttys:[],init(){},shutdown(){},register(t,e){_t.ttys[t]={input:[],output:[],ops:e},Ct.registerDevice(t,_t.stream_ops)},stream_ops:{open(t){var e=_t.ttys[t.node.rdev];if(!e)throw new Ct.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 Ct.ErrnoError(60);for(var i=0,a=0;a(()=>{if(!gt.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;gt=bt(t,!0)}return gt.shift()})(),put_char(t,e){null===e||10===e?(k(vt(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},fsync(t){t.output&&t.output.length>0&&(k(vt(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?(W(vt(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},fsync(t){t.output&&t.output.length>0&&(W(vt(t.output,0)),t.output=[])}}},Et=t=>{t=((t,e)=>Math.ceil(t/e)*e)(t,65536);var e=Sn(65536,t);return e?((t,e)=>(o().fill(0,t,t+e),t))(e,t):0},kt={ops_table:null,mount:t=>kt.createNode(null,"/",16895,0),createNode(t,e,r,n){if(Ct.isBlkdev(r)||Ct.isFIFO(r))throw new Ct.ErrnoError(63);kt.ops_table||(kt.ops_table={dir:{node:{getattr:kt.node_ops.getattr,setattr:kt.node_ops.setattr,lookup:kt.node_ops.lookup,mknod:kt.node_ops.mknod,rename:kt.node_ops.rename,unlink:kt.node_ops.unlink,rmdir:kt.node_ops.rmdir,readdir:kt.node_ops.readdir,symlink:kt.node_ops.symlink},stream:{llseek:kt.stream_ops.llseek}},file:{node:{getattr:kt.node_ops.getattr,setattr:kt.node_ops.setattr},stream:{llseek:kt.stream_ops.llseek,read:kt.stream_ops.read,write:kt.stream_ops.write,allocate:kt.stream_ops.allocate,mmap:kt.stream_ops.mmap,msync:kt.stream_ops.msync}},link:{node:{getattr:kt.node_ops.getattr,setattr:kt.node_ops.setattr,readlink:kt.node_ops.readlink},stream:{}},chrdev:{node:{getattr:kt.node_ops.getattr,setattr:kt.node_ops.setattr},stream:Ct.chrdev_stream_ops}});var o=Ct.createNode(t,e,r,n);return Ct.isDir(o.mode)?(o.node_ops=kt.ops_table.dir.node,o.stream_ops=kt.ops_table.dir.stream,o.contents={}):Ct.isFile(o.mode)?(o.node_ops=kt.ops_table.file.node,o.stream_ops=kt.ops_table.file.stream,o.usedBytes=0,o.contents=null):Ct.isLink(o.mode)?(o.node_ops=kt.ops_table.link.node,o.stream_ops=kt.ops_table.link.stream):Ct.isChrdev(o.mode)&&(o.node_ops=kt.ops_table.chrdev.node,o.stream_ops=kt.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=Ct.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,Ct.isDir(t.mode)?e.size=4096:Ct.isFile(t.mode)?e.size=t.usedBytes:Ct.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&&kt.resizeFileStorage(t,e.size)},lookup(t,e){throw Ct.genericErrors[44]},mknod:(t,e,r,n)=>kt.createNode(t,e,r,n),rename(t,e,r){if(Ct.isDir(t.mode)){var n;try{n=Ct.lookupNode(e,r)}catch(t){}if(n)for(var o in n.contents)throw new Ct.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=Ct.lookupNode(t,e);for(var n in r.contents)throw new Ct.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=kt.createNode(t,e,41471,0);return n.link=r,n},readlink(t){if(!Ct.isLink(t.mode))throw new Ct.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;s0||n+r(kt.stream_ops.write(t,e,0,n,r,!1),0)}},Wt=h.preloadPlugins||[],Mt=(t,e)=>{var r=0;return t&&(r|=365),e&&(r|=146),r},Ct={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=pt.resolve(t)))return{path:"",node:null};if((e=Object.assign({follow_mount:!0,recurse_count:0},e)).recurse_count>8)throw new Ct.ErrnoError(32);for(var r=t.split("/").filter((t=>!!t)),n=Ct.root,o="/",i=0;i40)throw new Ct.ErrnoError(32)}}return{path:o,node:n}},getPath(t){for(var e;;){if(Ct.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>>0)%Ct.nameTable.length},hashAddNode(t){var e=Ct.hashName(t.parent.id,t.name);t.name_next=Ct.nameTable[e],Ct.nameTable[e]=t},hashRemoveNode(t){var e=Ct.hashName(t.parent.id,t.name);if(Ct.nameTable[e]===t)Ct.nameTable[e]=t.name_next;else for(var r=Ct.nameTable[e];r;){if(r.name_next===t){r.name_next=t.name_next;break}r=r.name_next}},lookupNode(t,e){var r=Ct.mayLookup(t);if(r)throw new Ct.ErrnoError(r,t);for(var n=Ct.hashName(t.id,e),o=Ct.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===t.id&&i===e)return o}return Ct.lookup(t,e)},createNode(t,e,r,n){var o=new Ct.FSNode(t,e,r,n);return Ct.hashAddNode(o),o},destroyNode(t){Ct.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)=>Ct.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=Ct.nodePermissions(t,"x");return e||(t.node_ops.lookup?0:2)},mayCreate(t,e){try{return Ct.lookupNode(t,e),20}catch(t){}return Ct.nodePermissions(t,"wx")},mayDelete(t,e,r){var n;try{n=Ct.lookupNode(t,e)}catch(t){return t.errno}var o=Ct.nodePermissions(t,"wx");if(o)return o;if(r){if(!Ct.isDir(n.mode))return 54;if(Ct.isRoot(n)||Ct.getPath(n)===Ct.cwd())return 10}else if(Ct.isDir(n.mode))return 31;return 0},mayOpen:(t,e)=>t?Ct.isLink(t.mode)?32:Ct.isDir(t.mode)&&("r"!==Ct.flagsToPermissionString(e)||512&e)?31:Ct.nodePermissions(t,Ct.flagsToPermissionString(e)):44,MAX_OPEN_FDS:4096,nextfd(){for(var t=0;t<=Ct.MAX_OPEN_FDS;t++)if(!Ct.streams[t])return t;throw new Ct.ErrnoError(33)},getStreamChecked(t){var e=Ct.getStream(t);if(!e)throw new Ct.ErrnoError(8);return e},getStream:t=>Ct.streams[t],createStream:(t,e=-1)=>(Ct.FSStream||(Ct.FSStream=function(){this.shared={}},Ct.FSStream.prototype={},Object.defineProperties(Ct.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 Ct.FSStream,t),-1==e&&(e=Ct.nextfd()),t.fd=e,Ct.streams[e]=t,t),closeStream(t){Ct.streams[t]=null},chrdev_stream_ops:{open(t){var e=Ct.getDevice(t.node.rdev);t.stream_ops=e.stream_ops,t.stream_ops.open&&t.stream_ops.open(t)},llseek(){throw new Ct.ErrnoError(70)}},major:t=>t>>8,minor:t=>255&t,makedev:(t,e)=>t<<8|e,registerDevice(t,e){Ct.devices[t]={stream_ops:e}},getDevice:t=>Ct.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),Ct.syncFSRequests++,Ct.syncFSRequests>1&&W(`warning: ${Ct.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var r=Ct.getMounts(Ct.root.mount),n=0;function o(t){return Ct.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&&Ct.root)throw new Ct.ErrnoError(10);if(!o&&!i){var a=Ct.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,Ct.isMountpoint(n))throw new Ct.ErrnoError(10);if(!Ct.isDir(n.mode))throw new Ct.ErrnoError(54)}var s={type:t,opts:e,mountpoint:r,mounts:[]},u=t.mount(s);return u.mount=s,s.root=u,o?Ct.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount(t){var e=Ct.lookupPath(t,{follow_mount:!1});if(!Ct.isMountpoint(e.node))throw new Ct.ErrnoError(28);var r=e.node,n=r.mounted,o=Ct.getMounts(n);Object.keys(Ct.nameTable).forEach((t=>{for(var e=Ct.nameTable[t];e;){var r=e.name_next;o.includes(e.mount)&&Ct.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=Ct.lookupPath(t,{parent:!0}).node,o=ht.basename(t);if(!o||"."===o||".."===o)throw new Ct.ErrnoError(28);var i=Ct.mayCreate(n,o);if(i)throw new Ct.ErrnoError(i);if(!n.node_ops.mknod)throw new Ct.ErrnoError(63);return n.node_ops.mknod(n,o,e,r)},create:(t,e)=>(e=void 0!==e?e:438,e&=4095,e|=32768,Ct.mknod(t,e,0)),mkdir:(t,e)=>(e=void 0!==e?e:511,e&=1023,e|=16384,Ct.mknod(t,e,0)),mkdirTree(t,e){for(var r=t.split("/"),n="",o=0;o("undefined"==typeof r&&(r=e,e=438),e|=8192,Ct.mknod(t,e,r)),symlink(t,e){if(!pt.resolve(t))throw new Ct.ErrnoError(44);var r=Ct.lookupPath(e,{parent:!0}).node;if(!r)throw new Ct.ErrnoError(44);var n=ht.basename(e),o=Ct.mayCreate(r,n);if(o)throw new Ct.ErrnoError(o);if(!r.node_ops.symlink)throw new Ct.ErrnoError(63);return r.node_ops.symlink(r,n,t)},rename(t,e){var r,n,o=ht.dirname(t),i=ht.dirname(e),a=ht.basename(t),s=ht.basename(e);if(r=Ct.lookupPath(t,{parent:!0}).node,n=Ct.lookupPath(e,{parent:!0}).node,!r||!n)throw new Ct.ErrnoError(44);if(r.mount!==n.mount)throw new Ct.ErrnoError(75);var u,c=Ct.lookupNode(r,a),l=pt.relative(t,i);if("."!==l.charAt(0))throw new Ct.ErrnoError(28);if("."!==(l=pt.relative(e,o)).charAt(0))throw new Ct.ErrnoError(55);try{u=Ct.lookupNode(n,s)}catch(t){}if(c!==u){var d=Ct.isDir(c.mode),h=Ct.mayDelete(r,a,d);if(h)throw new Ct.ErrnoError(h);if(h=u?Ct.mayDelete(n,s,d):Ct.mayCreate(n,s))throw new Ct.ErrnoError(h);if(!r.node_ops.rename)throw new Ct.ErrnoError(63);if(Ct.isMountpoint(c)||u&&Ct.isMountpoint(u))throw new Ct.ErrnoError(10);if(n!==r&&(h=Ct.nodePermissions(r,"w")))throw new Ct.ErrnoError(h);Ct.hashRemoveNode(c);try{r.node_ops.rename(c,n,s)}catch(t){throw t}finally{Ct.hashAddNode(c)}}},rmdir(t){var e=Ct.lookupPath(t,{parent:!0}).node,r=ht.basename(t),n=Ct.lookupNode(e,r),o=Ct.mayDelete(e,r,!0);if(o)throw new Ct.ErrnoError(o);if(!e.node_ops.rmdir)throw new Ct.ErrnoError(63);if(Ct.isMountpoint(n))throw new Ct.ErrnoError(10);e.node_ops.rmdir(e,r),Ct.destroyNode(n)},readdir(t){var e=Ct.lookupPath(t,{follow:!0}).node;if(!e.node_ops.readdir)throw new Ct.ErrnoError(54);return e.node_ops.readdir(e)},unlink(t){var e=Ct.lookupPath(t,{parent:!0}).node;if(!e)throw new Ct.ErrnoError(44);var r=ht.basename(t),n=Ct.lookupNode(e,r),o=Ct.mayDelete(e,r,!1);if(o)throw new Ct.ErrnoError(o);if(!e.node_ops.unlink)throw new Ct.ErrnoError(63);if(Ct.isMountpoint(n))throw new Ct.ErrnoError(10);e.node_ops.unlink(e,r),Ct.destroyNode(n)},readlink(t){var e=Ct.lookupPath(t).node;if(!e)throw new Ct.ErrnoError(44);if(!e.node_ops.readlink)throw new Ct.ErrnoError(28);return pt.resolve(Ct.getPath(e.parent),e.node_ops.readlink(e))},stat(t,e){var r=Ct.lookupPath(t,{follow:!e}).node;if(!r)throw new Ct.ErrnoError(44);if(!r.node_ops.getattr)throw new Ct.ErrnoError(63);return r.node_ops.getattr(r)},lstat:t=>Ct.stat(t,!0),chmod(t,e,r){var n;if(!(n="string"==typeof t?Ct.lookupPath(t,{follow:!r}).node:t).node_ops.setattr)throw new Ct.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&e|-4096&n.mode,timestamp:Date.now()})},lchmod(t,e){Ct.chmod(t,e,!0)},fchmod(t,e){var r=Ct.getStreamChecked(t);Ct.chmod(r.node,e)},chown(t,e,r,n){var o;if(!(o="string"==typeof t?Ct.lookupPath(t,{follow:!n}).node:t).node_ops.setattr)throw new Ct.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(t,e,r){Ct.chown(t,e,r,!0)},fchown(t,e,r){var n=Ct.getStreamChecked(t);Ct.chown(n.node,e,r)},truncate(t,e){if(e<0)throw new Ct.ErrnoError(28);var r;if(!(r="string"==typeof t?Ct.lookupPath(t,{follow:!0}).node:t).node_ops.setattr)throw new Ct.ErrnoError(63);if(Ct.isDir(r.mode))throw new Ct.ErrnoError(31);if(!Ct.isFile(r.mode))throw new Ct.ErrnoError(28);var n=Ct.nodePermissions(r,"w");if(n)throw new Ct.ErrnoError(n);r.node_ops.setattr(r,{size:e,timestamp:Date.now()})},ftruncate(t,e){var r=Ct.getStreamChecked(t);if(0==(2097155&r.flags))throw new Ct.ErrnoError(28);Ct.truncate(r.node,e)},utime(t,e,r){var n=Ct.lookupPath(t,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(e,r)})},open(t,e,r){if(""===t)throw new Ct.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=ht.normalize(t);try{n=Ct.lookupPath(t,{follow:!(131072&e)}).node}catch(t){}}var o=!1;if(64&e)if(n){if(128&e)throw new Ct.ErrnoError(20)}else n=Ct.mknod(t,r,0),o=!0;if(!n)throw new Ct.ErrnoError(44);if(Ct.isChrdev(n.mode)&&(e&=-513),65536&e&&!Ct.isDir(n.mode))throw new Ct.ErrnoError(54);if(!o){var i=Ct.mayOpen(n,e);if(i)throw new Ct.ErrnoError(i)}512&e&&!o&&Ct.truncate(n,0),e&=-131713;var a=Ct.createStream({node:n,path:Ct.getPath(n),flags:e,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return a.stream_ops.open&&a.stream_ops.open(a),!h.logReadFiles||1&e||(Ct.readFiles||(Ct.readFiles={}),t in Ct.readFiles||(Ct.readFiles[t]=1)),a},close(t){if(Ct.isClosed(t))throw new Ct.ErrnoError(8);t.getdents&&(t.getdents=null);try{t.stream_ops.close&&t.stream_ops.close(t)}catch(t){throw t}finally{Ct.closeStream(t.fd)}t.fd=null},isClosed:t=>null===t.fd,llseek(t,e,r){if(Ct.isClosed(t))throw new Ct.ErrnoError(8);if(!t.seekable||!t.stream_ops.llseek)throw new Ct.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new Ct.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 Ct.ErrnoError(28);if(Ct.isClosed(t))throw new Ct.ErrnoError(8);if(1==(2097155&t.flags))throw new Ct.ErrnoError(8);if(Ct.isDir(t.node.mode))throw new Ct.ErrnoError(31);if(!t.stream_ops.read)throw new Ct.ErrnoError(28);var i="undefined"!=typeof o;if(i){if(!t.seekable)throw new Ct.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 Ct.ErrnoError(28);if(Ct.isClosed(t))throw new Ct.ErrnoError(8);if(0==(2097155&t.flags))throw new Ct.ErrnoError(8);if(Ct.isDir(t.node.mode))throw new Ct.ErrnoError(31);if(!t.stream_ops.write)throw new Ct.ErrnoError(28);t.seekable&&1024&t.flags&&Ct.llseek(t,0,2);var a="undefined"!=typeof o;if(a){if(!t.seekable)throw new Ct.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(Ct.isClosed(t))throw new Ct.ErrnoError(8);if(e<0||r<=0)throw new Ct.ErrnoError(28);if(0==(2097155&t.flags))throw new Ct.ErrnoError(8);if(!Ct.isFile(t.node.mode)&&!Ct.isDir(t.node.mode))throw new Ct.ErrnoError(43);if(!t.stream_ops.allocate)throw new Ct.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 Ct.ErrnoError(2);if(1==(2097155&t.flags))throw new Ct.ErrnoError(2);if(!t.stream_ops.mmap)throw new Ct.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 Ct.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=Ct.open(t,e.flags),o=Ct.stat(t).size,i=new Uint8Array(o);return Ct.read(n,i,0,o,0),"utf8"===e.encoding?r=vt(i,0):"binary"===e.encoding&&(r=i),Ct.close(n),r},writeFile(t,e,r={}){r.flags=r.flags||577;var n=Ct.open(t,r.flags,r.mode);if("string"==typeof e){var o=new Uint8Array(yt(e)+1),i=wt(e,o,0,o.length);Ct.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");Ct.write(n,e,0,e.byteLength,void 0,r.canOwn)}Ct.close(n)},cwd:()=>Ct.currentPath,chdir(t){var e=Ct.lookupPath(t,{follow:!0});if(null===e.node)throw new Ct.ErrnoError(44);if(!Ct.isDir(e.node.mode))throw new Ct.ErrnoError(54);var r=Ct.nodePermissions(e.node,"x");if(r)throw new Ct.ErrnoError(r);Ct.currentPath=e.path},createDefaultDirectories(){Ct.mkdir("/tmp"),Ct.mkdir("/home"),Ct.mkdir("/home/web_user")},createDefaultDevices(){Ct.mkdir("/dev"),Ct.registerDevice(Ct.makedev(1,3),{read:()=>0,write:(t,e,r,n,o)=>n}),Ct.mkdev("/dev/null",Ct.makedev(1,3)),_t.register(Ct.makedev(5,0),_t.default_tty_ops),_t.register(Ct.makedev(6,0),_t.default_tty1_ops),Ct.mkdev("/dev/tty",Ct.makedev(5,0)),Ct.mkdev("/dev/tty1",Ct.makedev(6,0));var t=new Uint8Array(1024),e=0,r=()=>(0===e&&(e=ft(t).byteLength),t[--e]);Ct.createDevice("/dev","random",r),Ct.createDevice("/dev","urandom",r),Ct.mkdir("/dev/shm"),Ct.mkdir("/dev/shm/tmp")},createSpecialDirectories(){Ct.mkdir("/proc");var t=Ct.mkdir("/proc/self");Ct.mkdir("/proc/self/fd"),Ct.mount({mount(){var e=Ct.createNode(t,"fd",16895,73);return e.node_ops={lookup(t,e){var r=+e,n=Ct.getStreamChecked(r),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},e}},{},"/proc/self/fd")},createStandardStreams(){h.stdin?Ct.createDevice("/dev","stdin",h.stdin):Ct.symlink("/dev/tty","/dev/stdin"),h.stdout?Ct.createDevice("/dev","stdout",null,h.stdout):Ct.symlink("/dev/tty","/dev/stdout"),h.stderr?Ct.createDevice("/dev","stderr",null,h.stderr):Ct.symlink("/dev/tty1","/dev/stderr"),Ct.open("/dev/stdin",0),Ct.open("/dev/stdout",1),Ct.open("/dev/stderr",1)},ensureErrnoError(){Ct.ErrnoError||(Ct.ErrnoError=function(t,e){this.name="ErrnoError",this.node=e,this.setErrno=function(t){this.errno=t},this.setErrno(t),this.message="FS error"},Ct.ErrnoError.prototype=new Error,Ct.ErrnoError.prototype.constructor=Ct.ErrnoError,[44].forEach((t=>{Ct.genericErrors[t]=new Ct.ErrnoError(t),Ct.genericErrors[t].stack=""})))},staticInit(){Ct.ensureErrnoError(),Ct.nameTable=new Array(4096),Ct.mount(kt,{},"/"),Ct.createDefaultDirectories(),Ct.createDefaultDevices(),Ct.createSpecialDirectories(),Ct.filesystems={MEMFS:kt}},init(t,e,r){Ct.init.initialized=!0,Ct.ensureErrnoError(),h.stdin=t||h.stdin,h.stdout=e||h.stdout,h.stderr=r||h.stderr,Ct.createStandardStreams()},quit(){Ct.init.initialized=!1;for(var t=0;tthis.length-1||t<0)){var e=t%this.chunkSize,r=t/this.chunkSize|0;return this.getter(r)[e]}},a.prototype.setDataGetter=function(t){this.getter=t},a.prototype.cacheLength=function(){var t=new XMLHttpRequest;if(t.open("HEAD",n,!1),t.send(null),!(t.status>=200&&t.status<300||304===t.status))throw new Error("Couldn't load "+n+". Status: "+t.status);var e,r=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=r);var s=this;s.setDataGetter((t=>{var e=t*a,o=(t+1)*a-1;if(o=Math.min(o,r-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>r-1)throw new Error("only "+r+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",n,!1),r!==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 "+n+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):bt(o.responseText||"",!0)})(e,o)),"undefined"==typeof s.chunks[t])throw new Error("doXHR failed!");return s.chunks[t]})),!i&&r||(a=r=1,r=this.getter(0).length,a=r,k("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=r,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){var s=new a;Object.defineProperties(s,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var u={isDevice:!1,contents:s}}else u={isDevice:!1,url:n};var c=Ct.createFile(t,r,u,o,i);u.contents?c.contents=u.contents:u.url&&(c.contents=null,c.url=u.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var l={};function d(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{var e=c.stream_ops[t];l[t]=function(){return Ct.forceLoadFile(c),e.apply(null,arguments)}})),l.read=(t,e,r,n,o)=>(Ct.forceLoadFile(c),d(t,e,r,n,o)),l.mmap=(t,r,n,o,i)=>{Ct.forceLoadFile(c);var a=Et(r);if(!a)throw new Ct.ErrnoError(48);return d(t,e(),a,r,n),{ptr:a,allocated:!0}},c.stream_ops=l,c}},Tt=(t,e)=>t?vt(o(),t,e):"",St={DEFAULT_POLLMASK:5,calculateAt(t,e,r){if(ht.isAbs(e))return e;var n;if(n=-100===t?Ct.cwd():St.getStreamFromFD(t).path,0==e.length){if(!r)throw new Ct.ErrnoError(44);return n}return ht.join2(n,e)},doStat(t,e,r){try{var n=t(e)}catch(t){if(t&&t.node&&ht.normalize(e)!==ht.normalize(Ct.getPath(t.node)))return-54;throw t}s()[r>>2]=n.dev,s()[r+4>>2]=n.mode,u()[r+8>>2]=n.nlink,s()[r+12>>2]=n.uid,s()[r+16>>2]=n.gid,s()[r+20>>2]=n.rdev,J=[n.size>>>0,(K=n.size,+Math.abs(K)>=1?K>0?+Math.floor(K/4294967296)>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],s()[r+24>>2]=J[0],s()[r+28>>2]=J[1],s()[r+32>>2]=4096,s()[r+36>>2]=n.blocks;var o=n.atime.getTime(),i=n.mtime.getTime(),a=n.ctime.getTime();return J=[Math.floor(o/1e3)>>>0,(K=Math.floor(o/1e3),+Math.abs(K)>=1?K>0?+Math.floor(K/4294967296)>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],s()[r+40>>2]=J[0],s()[r+44>>2]=J[1],u()[r+48>>2]=o%1e3*1e3,J=[Math.floor(i/1e3)>>>0,(K=Math.floor(i/1e3),+Math.abs(K)>=1?K>0?+Math.floor(K/4294967296)>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],s()[r+56>>2]=J[0],s()[r+60>>2]=J[1],u()[r+64>>2]=i%1e3*1e3,J=[Math.floor(a/1e3)>>>0,(K=Math.floor(a/1e3),+Math.abs(K)>=1?K>0?+Math.floor(K/4294967296)>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],s()[r+72>>2]=J[0],s()[r+76>>2]=J[1],u()[r+80>>2]=a%1e3*1e3,J=[n.ino>>>0,(K=n.ino,+Math.abs(K)>=1?K>0?+Math.floor(K/4294967296)>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],s()[r+88>>2]=J[0],s()[r+92>>2]=J[1],0},doMsync(t,e,r,n,i){if(!Ct.isFile(e.node.mode))throw new Ct.ErrnoError(43);if(2&n)return 0;var a=o().slice(t,t+r);Ct.msync(e,a,i,r,n)},varargs:void 0,get(){var t=s()[St.varargs>>2];return St.varargs+=4,t},getp:()=>St.get(),getStr:t=>Tt(t),getStreamFromFD:t=>Ct.getStreamChecked(t)};function Ft(t){if(w)return Dr(0,1,t);S=t,X()||($t.terminateAllThreads(),h.onExit&&h.onExit(t),R=!0),y(t,new ut(t))}var Pt=(t,e)=>{if(S=t,w)throw Dt(t),"unwind";Ft(t)},jt=t=>{if(t instanceof ut||"unwind"==t)return S;y(1,t)},$t={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],pthreads:{},init(){w?$t.initWorker():$t.initMainThread()},initMainThread(){for(var t=Math.min(4,Math.max(1,navigator.hardwareConcurrency-1));t--;)$t.allocateUnusedWorker();B((()=>{et(),$t.loadWasmModuleToAllWorkers((()=>rt()))}))},initWorker(){T=!1},setExitStatus:t=>{S=t},terminateAllThreads__deps:["$terminateWorker"],terminateAllThreads:()=>{for(var t of $t.runningWorkers)ct(t);for(var t of $t.unusedWorkers)ct(t);$t.unusedWorkers=[],$t.runningWorkers=[],$t.pthreads=[]},returnWorkerToPool:t=>{var e=t.pthread_ptr;delete $t.pthreads[e],$t.unusedWorkers.push(t),$t.runningWorkers.splice($t.runningWorkers.indexOf(t),1),t.pthread_ptr=0,$n(e)},receiveObjectTransfer(t){},threadInitTLS(){$t.tlsInitFunctions.forEach((t=>t()))},loadWasmModuleToWorker:t=>new Promise((e=>{t.onmessage=r=>{var n=r.data,o=n.cmd;if(n.targetThread&&n.targetThread!=Cn()){var i=$t.pthreads[n.targetThread];i?i.postMessage(n,n.transferList):W(`Internal error! Worker sent a message "${o}" to target pthread ${n.targetThread}, but that thread no longer exists!`)}else{var a;"checkMailbox"===o?$r():"spawnThread"===o?dt(n):"cleanupThread"===o?lt(n.thread):"killThread"===o?(t=>{var e=$t.pthreads[t];delete $t.pthreads[t],ct(e),$n(t),$t.runningWorkers.splice($t.runningWorkers.indexOf(e),1),e.pthread_ptr=0})(n.thread):"cancelThread"===o?(a=n.thread,$t.pthreads[a].postMessage({cmd:"cancel"})):"loaded"===o?(t.loaded=!0,e(t)):"alert"===o?alert(`Thread ${n.threadId}: ${n.text}`):"setimmediate"===n.target?t.postMessage(n):"callHandler"===o?h[n.handler](...n.args):o&&W(`worker sent an unknown command ${o}`)}},t.onerror=t=>{throw W(`worker sent an error! ${t.filename}:${t.lineno}: ${t.message}`),t};var r=[];for(var o of["onExit","onAbort","print","printErr"])h.hasOwnProperty(o)&&r.push(o);t.postMessage({cmd:"load",handlers:r,urlOrBlob:h.mainScriptUrlOrBlob||n,wasmMemory:M,wasmModule:C})})),loadWasmModuleToAllWorkers(t){if(w)return t();Promise.all($t.unusedWorkers.map($t.loadWasmModuleToWorker)).then(t)},allocateUnusedWorker(){var t,e=_("ScanbotSDK.Asm-simd-threads.worker.js");t=new Worker(e),$t.unusedWorkers.push(t)},getNewWorker:()=>(0==$t.unusedWorkers.length&&($t.allocateUnusedWorker(),$t.loadWasmModuleToWorker($t.unusedWorkers[0])),$t.unusedWorkers.pop())};h.PThread=$t;var At=t=>{for(;t.length>0;)t.shift()(h)};function Dt(t){if(w)return Dr(1,0,t);Pt(t)}h.establishStackSpace=()=>{var t=Cn(),e=s()[t+52>>2],r=s()[t+56>>2];In(e,e-r),Vn(e)};var xt=t=>O.get(t);h.invokeEntryPoint=(t,e)=>{!function(t){X()?$t.setExitStatus(t):An(t)}(xt(t)(e))};var It=t=>{$t.tlsInitFunctions.push(t)},Rt=[],Vt=0,Zt=0;function Ot(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(t){u()[this.ptr+4>>2]=t},this.get_type=function(){return u()[this.ptr+4>>2]},this.set_destructor=function(t){u()[this.ptr+8>>2]=t},this.get_destructor=function(){return u()[this.ptr+8>>2]},this.set_caught=function(t){t=t?1:0,e()[this.ptr+12>>0]=t},this.get_caught=function(){return 0!=e()[this.ptr+12>>0]},this.set_rethrown=function(t){t=t?1:0,e()[this.ptr+13>>0]=t},this.get_rethrown=function(){return 0!=e()[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){u()[this.ptr+16>>2]=t},this.get_adjusted_ptr=function(){return u()[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Gn(this.get_type()))return u()[this.excPtr>>2];var t=this.get_adjusted_ptr();return 0!==t?t:this.excPtr}}var Nt=t=>{var e=Zt;if(!e)return Tn(0),0;var r=new Ot(e);r.set_adjusted_ptr(e);var n=r.get_type();if(!n)return Tn(0),e;for(var o in t){var i=t[o];if(0===i||i===n)break;var a=r.ptr+16;if(zn(i,n,a))return Tn(i),e}return Tn(n),e},zt=()=>{var t=Rt.pop();t||nt("no exception to throw");var e=t.excPtr;throw t.get_rethrown()||(Rt.push(t),t.set_rethrown(!0),t.set_caught(!1),Vt++),Zt=e};function Gt(t,e,r,n){return w?Dr(2,1,t,e,r,n):Ut(t,e,r,n)}var Ut=(t,e,r,n)=>{if("undefined"==typeof SharedArrayBuffer)return W("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var o=[];if(w&&0===o.length)return Gt(t,e,r,n);var i={startRoutine:r,pthread_ptr:t,arg:n,transferList:o};return w?(i.cmd="spawnThread",postMessage(i,o),0):dt(i)};function Lt(t,e,r,n,o){if(w)return Dr(3,1,t,e,r,n,o);try{for(var i=0,a=e?s()[e>>2]:0,u=e?s()[e+4>>2]:0,c=r?s()[r>>2]:0,l=r?s()[r+4>>2]:0,d=n?s()[n>>2]:0,h=n?s()[n+4>>2]:0,f=0,p=0,m=0,v=0,g=0,y=0,b=(e?s()[e>>2]:0)|(r?s()[r>>2]:0)|(n?s()[n>>2]:0),_=(e?s()[e+4>>2]:0)|(r?s()[r+4>>2]:0)|(n?s()[n+4>>2]:0),E=function(t,e,r,n){return t<32?e&n:r&n},k=0;k>2]:0)+(e?s()[o+8>>2]:0)/1e6)),C=M.stream_ops.poll(M,T)}1&C&&E(k,a,u,W)&&(k<32?f|=W:p|=W,i++),4&C&&E(k,c,l,W)&&(k<32?m|=W:v|=W,i++),2&C&&E(k,d,h,W)&&(k<32?g|=W:y|=W,i++)}}return e&&(s()[e>>2]=f,s()[e+4>>2]=p),r&&(s()[r>>2]=m,s()[r+4>>2]=v),n&&(s()[n>>2]=g,s()[n+4>>2]=y),i}catch(t){if("undefined"==typeof Ct||"ErrnoError"!==t.name)throw t;return-t.errno}}function Xt(t,e){if(w)return Dr(4,1,t,e);try{return t=St.getStr(t),Ct.chmod(t,e),0}catch(t){if("undefined"==typeof Ct||"ErrnoError"!==t.name)throw t;return-t.errno}}function Yt(t,e){if(w)return Dr(5,1,t,e);try{return Ct.fchmod(t,e),0}catch(t){if("undefined"==typeof Ct||"ErrnoError"!==t.name)throw t;return-t.errno}}function Bt(t,e,r){if(w)return Dr(6,1,t,e,r);St.varargs=r;try{var n=St.getStreamFromFD(t);switch(e){case 0:if((o=St.get())<0)return-28;for(;Ct.streams[o];)o++;return Ct.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=St.get();return n.flags|=o,0;case 5:return o=St.getp(),i()[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return a=28,s()[Mn()>>2]=a,-1}}catch(t){if("undefined"==typeof Ct||"ErrnoError"!==t.name)throw t;return-t.errno}var a}function Ht(t,e){if(w)return Dr(7,1,t,e);try{var r=St.getStreamFromFD(t);return St.doStat(Ct.stat,r.path,e)}catch(t){if("undefined"==typeof Ct||"ErrnoError"!==t.name)throw t;return-t.errno}}var Kt=(t,e)=>e+2097152>>>0<4194305-!!t?(t>>>0)+4294967296*e:NaN;function Jt(t,e,r){if(w)return Dr(8,1,t,e,r);var n=Kt(e,r);try{return isNaN(n)?61:(Ct.ftruncate(t,n),0)}catch(t){if("undefined"==typeof Ct||"ErrnoError"!==t.name)throw t;return-t.errno}}var Qt=(t,e,r)=>wt(t,o(),e,r);function qt(t,e){if(w)return Dr(9,1,t,e);try{if(0===e)return-28;var r=Ct.cwd(),n=yt(r)+1;return e>>0,(K=d,+Math.abs(K)>=1?K>0?+Math.floor(K/4294967296)>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],s()[r+u>>2]=J[0],s()[r+u+4>>2]=J[1],J=[(l+1)*a>>>0,(K=(l+1)*a,+Math.abs(K)>=1?K>0?+Math.floor(K/4294967296)>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],s()[r+u+8>>2]=J[0],s()[r+u+12>>2]=J[1],i()[r+u+16>>1]=280,e()[r+u+18>>0]=h,Qt(f,r+u+19,256),u+=a,l+=1}return Ct.llseek(o,l*a,0),u}catch(t){if("undefined"==typeof Ct||"ErrnoError"!==t.name)throw t;return-t.errno}}function ee(t,r,n){if(w)return Dr(11,1,t,r,n);St.varargs=n;try{var o=St.getStreamFromFD(t);switch(r){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return o.tty?0:-59;case 21505:if(!o.tty)return-59;if(o.tty.ops.ioctl_tcgets){var a=o.tty.ops.ioctl_tcgets(o),u=St.getp();s()[u>>2]=a.c_iflag||0,s()[u+4>>2]=a.c_oflag||0,s()[u+8>>2]=a.c_cflag||0,s()[u+12>>2]=a.c_lflag||0;for(var c=0;c<32;c++)e()[u+c+17>>0]=a.c_cc[c]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!o.tty)return-59;if(o.tty.ops.ioctl_tcsets){u=St.getp();var l=s()[u>>2],d=s()[u+4>>2],h=s()[u+8>>2],f=s()[u+12>>2],p=[];for(c=0;c<32;c++)p.push(e()[u+c+17>>0]);return o.tty.ops.ioctl_tcsets(o.tty,r,{c_iflag:l,c_oflag:d,c_cflag:h,c_lflag:f,c_cc:p})}return 0;case 21519:return o.tty?(u=St.getp(),s()[u>>2]=0,0):-59;case 21520:return o.tty?-28:-59;case 21531:return u=St.getp(),Ct.ioctl(o,r,u);case 21523:if(!o.tty)return-59;if(o.tty.ops.ioctl_tiocgwinsz){var m=o.tty.ops.ioctl_tiocgwinsz(o.tty);u=St.getp(),i()[u>>1]=m[0],i()[u+2>>1]=m[1]}return 0;default:return-28}}catch(t){if("undefined"==typeof Ct||"ErrnoError"!==t.name)throw t;return-t.errno}}function re(t,e){if(w)return Dr(12,1,t,e);try{return t=St.getStr(t),St.doStat(Ct.lstat,t,e)}catch(t){if("undefined"==typeof Ct||"ErrnoError"!==t.name)throw t;return-t.errno}}function ne(t,e,r){if(w)return Dr(13,1,t,e,r);try{return e=St.getStr(e),e=St.calculateAt(t,e),"/"===(e=ht.normalize(e))[e.length-1]&&(e=e.substr(0,e.length-1)),Ct.mkdir(e,r,0),0}catch(t){if("undefined"==typeof Ct||"ErrnoError"!==t.name)throw t;return-t.errno}}function oe(t,e,r,n){if(w)return Dr(14,1,t,e,r,n);try{e=St.getStr(e);var o=256&n,i=4096&n;return n&=-6401,e=St.calculateAt(t,e,i),St.doStat(o?Ct.lstat:Ct.stat,e,r)}catch(t){if("undefined"==typeof Ct||"ErrnoError"!==t.name)throw t;return-t.errno}}function ie(t,e,r,n){if(w)return Dr(15,1,t,e,r,n);St.varargs=n;try{e=St.getStr(e),e=St.calculateAt(t,e);var o=n?St.get():0;return Ct.open(e,r,o).fd}catch(t){if("undefined"==typeof Ct||"ErrnoError"!==t.name)throw t;return-t.errno}}function ae(t,r,n,o){if(w)return Dr(16,1,t,r,n,o);try{if(r=St.getStr(r),r=St.calculateAt(t,r),o<=0)return-28;var i=Ct.readlink(r),a=Math.min(o,yt(i)),s=e()[n+a];return Qt(i,n,o+1),e()[n+a]=s,a}catch(t){if("undefined"==typeof Ct||"ErrnoError"!==t.name)throw t;return-t.errno}}function se(t){if(w)return Dr(17,1,t);try{return t=St.getStr(t),Ct.rmdir(t),0}catch(t){if("undefined"==typeof Ct||"ErrnoError"!==t.name)throw t;return-t.errno}}function ue(t,e){if(w)return Dr(18,1,t,e);try{return t=St.getStr(t),St.doStat(Ct.stat,t,e)}catch(t){if("undefined"==typeof Ct||"ErrnoError"!==t.name)throw t;return-t.errno}}function ce(t,e){if(w)return Dr(19,1,t,e);try{return t=St.getStr(t),e=St.getStr(e),Ct.symlink(t,e),0}catch(t){if("undefined"==typeof Ct||"ErrnoError"!==t.name)throw t;return-t.errno}}function le(t,e,r){if(w)return Dr(20,1,t,e,r);try{return e=St.getStr(e),e=St.calculateAt(t,e),0===r?Ct.unlink(e):512===r?Ct.rmdir(e):nt("Invalid flags passed to unlinkat"),0}catch(t){if("undefined"==typeof Ct||"ErrnoError"!==t.name)throw t;return-t.errno}}var de=void 0,he=t=>{for(var e="",r=t;o()[r];)e+=de[o()[r++]];return e},fe={},pe={},me={},ve=void 0,ge=t=>{throw new ve(t)},ye=void 0,we=t=>{throw new ye(t)},be=(t,e,r)=>{function n(e){var n=r(e);n.length!==t.length&&we("Mismatched type converter count");for(var o=0;o{pe.hasOwnProperty(t)?o[e]=pe[t]:(i.push(t),fe.hasOwnProperty(t)||(fe[t]=[]),fe[t].push((()=>{o[e]=pe[t],++a===i.length&&n(o)})))})),0===i.length&&n(o)};function _e(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||ge(`type "${n}" must have a positive integer typeid pointer`),pe.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;ge(`Cannot register type '${n}' twice`)}if(pe[t]=e,delete me[t],fe.hasOwnProperty(t)){var o=fe[t];delete fe[t],o.forEach((t=>t()))}}(t,e,r)}function Ee(t){if(!(this instanceof Ue))return!1;if(!(t instanceof Ue))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 ke=t=>{ge(t.$$.ptrType.registeredClass.name+" instance already deleted")},We=!1,Me=t=>{},Ce=t=>{t.count.value-=1,0===t.count.value&&(t=>{t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)})(t)},Te=(t,e,r)=>{if(e===r)return t;if(void 0===r.baseClass)return null;var n=Te(t,e,r.baseClass);return null===n?null:r.downcast(n)},Se={},Fe=()=>Object.keys(xe).length,Pe=()=>{var t=[];for(var e in xe)xe.hasOwnProperty(e)&&t.push(xe[e]);return t},je=[],$e=()=>{for(;je.length;){var t=je.pop();t.$$.deleteScheduled=!1,t.delete()}},Ae=void 0,De=t=>{Ae=t,je.length&&Ae&&Ae($e)},xe={},Ie=(t,e)=>(e=((t,e)=>{for(void 0===e&&ge("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e})(t,e),xe[e]),Re=(t,e)=>(e.ptrType&&e.ptr||we("makeClassHandle requires ptr and ptrType"),!!e.smartPtrType!=!!e.smartPtr&&we("Both smartPtrType and smartPtr must be specified"),e.count={value:1},Ze(Object.create(t,{$$:{value:e}})));function Ve(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var r=Ie(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?Re(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):Re(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var i,a=this.registeredClass.getActualType(e),s=Se[a];if(!s)return o.call(this);i=this.isConst?s.constPointerType:s.pointerType;var u=Te(e,this.registeredClass,i.registeredClass);return null===u?o.call(this):this.isSmartPointer?Re(i.registeredClass.instancePrototype,{ptrType:i,ptr:u,smartPtrType:this,smartPtr:t}):Re(i.registeredClass.instancePrototype,{ptrType:i,ptr:u})}var Ze=t=>"undefined"==typeof FinalizationRegistry?(Ze=t=>t,t):(We=new FinalizationRegistry((t=>{Ce(t.$$)})),Ze=t=>{var e=t.$$;if(e.smartPtr){var r={$$:e};We.register(t,r,t)}return t},Me=t=>We.unregister(t),Ze(t));function Oe(){if(this.$$.ptr||ke(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t,e=Ze(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 Ne(){this.$$.ptr||ke(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ge("Object already scheduled for deletion"),Me(this),Ce(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function ze(){return!this.$$.ptr}function Ge(){return this.$$.ptr||ke(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ge("Object already scheduled for deletion"),je.push(this),1===je.length&&Ae&&Ae($e),this.$$.deleteScheduled=!0,this}function Ue(){}var Le=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 Xe(t,e){return{[t=Le(t)]:function(){return e.apply(this,arguments)}}[t]}var Ye=(t,e,r)=>{if(void 0===t[e].overloadTable){var n=t[e];t[e]=function(){return t[e].overloadTable.hasOwnProperty(arguments.length)||ge(`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}},Be=(t,e,r)=>{h.hasOwnProperty(t)?((void 0===r||void 0!==h[t].overloadTable&&void 0!==h[t].overloadTable[r])&&ge(`Cannot register public name '${t}' twice`),Ye(h,t,t),h.hasOwnProperty(r)&&ge(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),h[t].overloadTable[r]=e):(h[t]=e,void 0!==r&&(h[t].numArguments=r))};function He(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 Ke=(t,e,r)=>{for(;e!==r;)e.upcast||ge(`Expected null or instance of ${r.name}, got an instance of ${e.name}`),t=e.upcast(t),e=e.baseClass;return t};function Je(t,e){if(null===e)return this.isReference&&ge(`null is not a valid ${this.name}`),0;e.$$||ge(`Cannot pass "${br(e)}" as a ${this.name}`),e.$$.ptr||ge(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=e.$$.ptrType.registeredClass;return Ke(e.$$.ptr,r,this.registeredClass)}function Qe(t,e){var r;if(null===e)return this.isReference&&ge(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),null!==t&&t.push(this.rawDestructor,r),r):0;e.$$||ge(`Cannot pass "${br(e)}" as a ${this.name}`),e.$$.ptr||ge(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&e.$$.ptrType.isConst&&ge(`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=Ke(e.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===e.$$.smartPtr&&ge("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:e.$$.smartPtrType===this?r=e.$$.smartPtr:ge(`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,yr.toHandle((()=>o.delete()))),null!==t&&t.push(this.rawDestructor,r)}break;default:ge("Unsupporting sharing policy")}return r}function qe(t,e){if(null===e)return this.isReference&&ge(`null is not a valid ${this.name}`),0;e.$$||ge(`Cannot pass "${br(e)}" as a ${this.name}`),e.$$.ptr||ge(`Cannot pass deleted object as a pointer of type ${this.name}`),e.$$.ptrType.isConst&&ge(`Cannot convert argument of type ${e.$$.ptrType.name} to parameter type ${this.name}`);var r=e.$$.ptrType.registeredClass;return Ke(e.$$.ptr,r,this.registeredClass)}function tr(t){return this.fromWireType(u()[t>>2])}function er(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t}function rr(t){this.rawDestructor&&this.rawDestructor(t)}var nr=t=>{null!==t&&t.delete()};function or(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=Qe:n?(this.toWireType=Je,this.destructorFunction=null):(this.toWireType=qe,this.destructorFunction=null)}var ir=(t,e,r)=>{h.hasOwnProperty(t)||we("Replacing nonexistant public symbol"),void 0!==h[t].overloadTable&&void 0!==r?h[t].overloadTable[r]=e:(h[t]=e,h[t].argCount=r)},ar=(t,e,r)=>t.includes("j")?((t,e,r)=>{var n=h["dynCall_"+t];return r&&r.length?n.apply(null,[e].concat(r)):n.call(null,e)})(t,e,r):xt(e).apply(null,r),sr=(t,e)=>{var r,n,o,i=(t=he(t)).includes("j")?(r=t,n=e,o=[],function(){return o.length=0,Object.assign(o,arguments),ar(r,n,o)}):xt(e);return"function"!=typeof i&&ge(`unknown function pointer with signature ${t}: ${e}`),i},ur=void 0,cr=t=>{var e=Fn(t),r=he(e);return Wn(e),r},lr=(t,e)=>{var r=[],n={};throw e.forEach((function t(e){n[e]||pe[e]||(me[e]?me[e].forEach(t):(r.push(e),n[e]=!0))})),new ur(`${t}: `+r.map(cr).join([", "]))},dr=t=>{for(;t.length;){var e=t.pop();t.pop()(e)}};function hr(t,e,r,n,o,i){var a=e.length;a<2&&ge("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{for(var r=[],n=0;n>2]);return r};function pr(){this.allocated=[void 0],this.freelist=[]}var mr=new pr,vr=t=>{t>=mr.reserved&&0==--mr.get(t).refcount&&mr.free(t)},gr=()=>{for(var t=0,e=mr.reserved;e(t||ge("Cannot use deleted val. handle = "+t),mr.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 mr.allocate({refcount:1,value:t})}}};function wr(t){return this.fromWireType(s()[t>>2])}var br=t=>{if(null===t)return"null";var e=typeof t;return"object"===e||"array"===e||"function"===e?t.toString():""+t},_r=(t,e)=>{switch(e){case 4:return function(t){return this.fromWireType((M.buffer!=F.buffer&&Z(),x)[t>>2])};case 8:return function(t){return this.fromWireType(c()[t>>3])};default:throw new TypeError(`invalid float width (${e}): ${t}`)}},Er=(t,r,n)=>{switch(r){case 1:return n?t=>e()[t>>0]:t=>o()[t>>0];case 2:return n?t=>i()[t>>1]:t=>a()[t>>1];case 4:return n?t=>s()[t>>2]:t=>u()[t>>2];default:throw new TypeError(`invalid integer width (${r}): ${t}`)}},kr="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Wr=(t,e)=>{for(var r=t,n=r>>1,s=n+e/2;!(n>=s)&&a()[n];)++n;if((r=n<<1)-t>32&&kr)return kr.decode(o().slice(t,r));for(var u="",c=0;!(c>=e/2);++c){var l=i()[t+2*c>>1];if(0==l)break;u+=String.fromCharCode(l)}return u},Mr=(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,a=0;a>1]=s,e+=2}return i()[e>>1]=0,e-n},Cr=t=>2*t.length,Tr=(t,e)=>{for(var r=0,n="";!(r>=e/4);){var o=s()[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},Sr=(t,e,r)=>{if(void 0===r&&(r=2147483647),r<4)return 0;for(var n=e,o=n+r-4,i=0;i=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++i)),s()[e>>2]=a,(e+=4)+4>o)break}return s()[e>>2]=0,e-n},Fr=t=>{for(var e=0,r=0;r=55296&&n<=57343&&++r,e+=4}return e},Pr=t=>{if(!R)try{t(),(()=>{if(!X())try{w?An(S):Pt(S)}catch(t){jt(t)}})()}catch(t){jt(t)}},jr=t=>{if("function"==typeof Atomics.waitAsync){Atomics.waitAsync(s(),t>>2,t).value.then($r);var e=t+128;Atomics.store(s(),e>>2,1)}};h.__emscripten_thread_mailbox_await=jr;var $r=()=>{var t=Cn();t&&(jr(t),Pr((()=>Dn())))};h.checkMailbox=$r;var Ar=t=>{var e=Rn(),r=t();return Vn(e),r},Dr=function(t,e){var r=arguments.length-2,n=arguments;return Ar((()=>{for(var o=r,i=Zn(8*o),a=i>>3,s=0;s{var r=pe[t];return void 0===r&&ge(e+" has unknown type "+cr(t)),r},Rr={},Vr=t=>{var e=Rr[t];return void 0===e?he(t):e},Zr=[],Or=()=>{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.")},Nr=[],zr=t=>t%4==0&&(t%100!=0||t%400==0),Gr=[0,31,60,91,121,152,182,213,244,274,305,335],Ur=[0,31,59,90,120,151,181,212,243,273,304,334];function Lr(t,e,r,n,o,i,a,c){if(w)return Dr(21,1,t,e,r,n,o,i,a,c);var l=Kt(o,i);try{if(isNaN(l))return 61;var d=St.getStreamFromFD(n),h=Ct.mmap(d,t,l,e,r),f=h.ptr;return s()[a>>2]=h.allocated,u()[c>>2]=f,0}catch(t){if("undefined"==typeof Ct||"ErrnoError"!==t.name)throw t;return-t.errno}}function Xr(t,e,r,n,o,i,a){if(w)return Dr(22,1,t,e,r,n,o,i,a);var s=Kt(i,a);try{if(isNaN(s))return 61;var u=St.getStreamFromFD(o);2&r&&St.doMsync(t,u,e,n,s),Ct.munmap(u)}catch(t){if("undefined"==typeof Ct||"ErrnoError"!==t.name)throw t;return-t.errno}}var Yr,Br=t=>{var e=yt(t)+1,r=kn(e);return r&&Qt(t,r,e),r},Hr=[],Kr=(t,e,r)=>{var n=((t,e)=>{var r;for(Hr.length=0;r=o()[t++];)e+=105!=r&&e%8?4:0,Hr.push(105==r?s()[e>>2]:c()[e>>3]),e+=105==r?4:8;return Hr})(e,r);return st[t].apply(null,n)};Yr=()=>performance.timeOrigin+performance.now();var Jr=t=>{nt("OOM")},Qr=t=>{var e=(t-M.buffer.byteLength+65535)/65536;try{return M.grow(e),Z(),1}catch(t){}},qr={},tn=()=>{if(!tn.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",_:g||"./this.program"};for(var e in qr)void 0===qr[e]?delete t[e]:t[e]=qr[e];var r=[];for(var e in t)r.push(`${e}=${t[e]}`);tn.strings=r}return tn.strings},en=function(t,r){if(w)return Dr(23,1,t,r);var n=0;return tn().forEach(((o,i)=>{var a=r+n;u()[t+4*i>>2]=a,((t,r)=>{for(var n=0;n>0]=t.charCodeAt(n);e()[r>>0]=0})(o,a),n+=o.length+1})),0},rn=function(t,e){if(w)return Dr(24,1,t,e);var r=tn();u()[t>>2]=r.length;var n=0;return r.forEach((t=>n+=t.length+1)),u()[e>>2]=n,0};function nn(t){if(w)return Dr(25,1,t);try{var e=St.getStreamFromFD(t);return Ct.close(e),0}catch(t){if("undefined"==typeof Ct||"ErrnoError"!==t.name)throw t;return t.errno}}function on(t,r){if(w)return Dr(26,1,t,r);try{var n=St.getStreamFromFD(t),o=n.tty?2:Ct.isDir(n.mode)?3:Ct.isLink(n.mode)?7:4;return e()[r>>0]=o,i()[r+2>>1]=0,J=[0,(K=0,+Math.abs(K)>=1?K>0?+Math.floor(K/4294967296)>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],s()[r+8>>2]=J[0],s()[r+12>>2]=J[1],J=[0,(K=0,+Math.abs(K)>=1?K>0?+Math.floor(K/4294967296)>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],s()[r+16>>2]=J[0],s()[r+20>>2]=J[1],0}catch(t){if("undefined"==typeof Ct||"ErrnoError"!==t.name)throw t;return t.errno}}function an(t,r,n,o){if(w)return Dr(27,1,t,r,n,o);try{var i=((t,r,n,o)=>{for(var i=0,a=0;a>2],c=u()[r+4>>2];r+=8;var l=Ct.read(t,e(),s,c,o);if(l<0)return-1;if(i+=l,l>2]=i,0}catch(t){if("undefined"==typeof Ct||"ErrnoError"!==t.name)throw t;return t.errno}}function sn(t,e,r,n,o){if(w)return Dr(28,1,t,e,r,n,o);var i=Kt(e,r);try{if(isNaN(i))return 61;var a=St.getStreamFromFD(t);return Ct.llseek(a,i,n),J=[a.position>>>0,(K=a.position,+Math.abs(K)>=1?K>0?+Math.floor(K/4294967296)>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],s()[o>>2]=J[0],s()[o+4>>2]=J[1],a.getdents&&0===i&&0===n&&(a.getdents=null),0}catch(t){if("undefined"==typeof Ct||"ErrnoError"!==t.name)throw t;return t.errno}}function un(t,r,n,o){if(w)return Dr(29,1,t,r,n,o);try{var i=((t,r,n,o)=>{for(var i=0,a=0;a>2],c=u()[r+4>>2];r+=8;var l=Ct.write(t,e(),s,c,o);if(l<0)return-1;i+=l,"undefined"!=typeof o&&(o+=l)}return i})(St.getStreamFromFD(t),r,n);return u()[o>>2]=i,0}catch(t){if("undefined"==typeof Ct||"ErrnoError"!==t.name)throw t;return t.errno}}var cn=[31,29,31,30,31,30,31,31,30,31,30,31],ln=[31,28,31,30,31,30,31,31,30,31,30,31],dn=(t,r,n,o)=>{var i=u()[o+40>>2],a={tm_sec:s()[o>>2],tm_min:s()[o+4>>2],tm_hour:s()[o+8>>2],tm_mday:s()[o+12>>2],tm_mon:s()[o+16>>2],tm_year:s()[o+20>>2],tm_wday:s()[o+24>>2],tm_yday:s()[o+28>>2],tm_isdst:s()[o+32>>2],tm_gmtoff:s()[o+36>>2],tm_zone:i?Tt(i):""},c=Tt(n),l={"%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 d in l)c=c.replace(new RegExp(d,"g"),l[d]);var h=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],f=["January","February","March","April","May","June","July","August","September","October","November","December"];function p(t,e,r){for(var n="number"==typeof t?t.toString():t||"";n.length0?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 g(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 y(t){var e=((t,e)=>{for(var r=new Date(t.getTime());e>0;){var n=zr(r.getFullYear()),o=r.getMonth(),i=(n?cn:ln)[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=g(r),i=g(n);return v(o,e)<=0?v(i,e)<=0?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}var w={"%a":t=>h[t.tm_wday].substring(0,3),"%A":t=>h[t.tm_wday],"%b":t=>f[t.tm_mon].substring(0,3),"%B":t=>f[t.tm_mon],"%C":t=>m((t.tm_year+1900)/100|0,2),"%d":t=>m(t.tm_mday,2),"%e":t=>p(t.tm_mday,2," "),"%g":t=>y(t).toString().substring(2),"%G":t=>y(t),"%H":t=>m(t.tm_hour,2),"%I":t=>{var e=t.tm_hour;return 0==e?e=12:e>12&&(e-=12),m(e,2)},"%j":t=>m(t.tm_mday+((t,e)=>{for(var r=0,n=0;n<=e;r+=t[n++]);return r})(zr(t.tm_year+1900)?cn:ln,t.tm_mon-1),3),"%m":t=>m(t.tm_mon+1,2),"%M":t=>m(t.tm_min,2),"%n":()=>"\n","%p":t=>t.tm_hour>=0&&t.tm_hour<12?"AM":"PM","%S":t=>m(t.tm_sec,2),"%t":()=>"\t","%u":t=>t.tm_wday||7,"%U":t=>{var e=t.tm_yday+7-t.tm_wday;return m(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&&zr(t.tm_year)||(e=1)}}else{e=52;var n=(t.tm_wday+7-t.tm_yday-1)%7;(4==n||5==n&&zr(t.tm_year%400-1))&&e++}return m(e,2)},"%w":t=>t.tm_wday,"%W":t=>{var e=t.tm_yday+7-(t.tm_wday+6)%7;return m(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 d in c=c.replace(/%%/g,"\0\0"),w)c.includes(d)&&(c=c.replace(new RegExp(d,"g"),w[d](a)));var b,_,E=bt(c=c.replace(/\0\0/g,"%"),!1);return E.length>r?0:(b=E,_=t,e().set(b,_),E.length-1)},hn=Br;$t.init();var fn,pn,mn,vn=function(t,e,r,n){t||(t=this),this.parent=t,this.mount=t.mount,this.mounted=null,this.id=Ct.nextInode++,this.name=e,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},gn=365,yn=146;Object.defineProperties(vn.prototype,{read:{get:function(){return(this.mode&gn)===gn},set:function(t){t?this.mode|=gn:this.mode&=-366}},write:{get:function(){return(this.mode&yn)===yn},set:function(t){t?this.mode|=yn:this.mode&=-147}},isFolder:{get:function(){return Ct.isDir(this.mode)}},isDevice:{get:function(){return Ct.isChrdev(this.mode)}}}),Ct.FSNode=vn,Ct.createPreloadedFile=(t,e,r,n,o,i,a,s,u,c)=>{var l=e?pt.resolve(ht.join2(t,e)):t;function d(r){function d(r){c&&c(),s||Ct.createDataFile(t,e,r,n,o,u),i&&i(),rt()}((t,e,r,n)=>{"undefined"!=typeof Browser&&Browser.init();var o=!1;return Wt.forEach((i=>{o||i.canHandle(e)&&(i.handle(t,e,r,n),o=!0)})),o})(r,l,d,(()=>{a&&a(),rt()}))||d(r)}et(),"string"==typeof r?((t,e,r,n)=>{var o=n?"":`al ${t}`;p(t,(r=>{V(r,`Loading data file "${t}" failed (no arrayBuffer).`),e(new Uint8Array(r)),o&&rt()}),(e=>{if(!r)throw`Loading data file "${t}" failed.`;r()})),o&&et()})(r,(t=>d(t)),a):d(r)},Ct.staticInit(),(()=>{for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);de=t})(),ve=h.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},ye=h.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},Ue.prototype.isAliasOf=Ee,Ue.prototype.clone=Oe,Ue.prototype.delete=Ne,Ue.prototype.isDeleted=ze,Ue.prototype.deleteLater=Ge,h.getInheritedInstanceCount=Fe,h.getLiveInheritedInstances=Pe,h.flushPendingDeletes=$e,h.setDelayFunction=De,or.prototype.getPointee=er,or.prototype.destructor=rr,or.prototype.argPackAdvance=8,or.prototype.readValueFromPointer=tr,or.prototype.deleteObject=nr,or.prototype.fromWireType=Ve,ur=h.UnboundTypeError=(fn=Error,(mn=Xe(pn="UnboundTypeError",(function(t){this.name=pn,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(fn.prototype),mn.prototype.constructor=mn,mn.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},mn),Object.assign(pr.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)}}),mr.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),mr.reserved=mr.allocated.length,h.count_emval_handles=gr;var wn,bn=[Ft,Dt,Gt,Lt,Xt,Yt,Bt,Ht,Jt,qt,te,ee,re,ne,oe,ie,ae,se,ue,ce,le,Lr,Xr,en,rn,nn,on,an,sn,un],_n={m:(t,e,r,n)=>{nt(`Assertion failed: ${Tt(t)}, at: `+[e?Tt(e):"unknown filename",r,n?Tt(n):"unknown function"])},t:t=>{var e=new Ot(t);return e.get_caught()||(e.set_caught(!0),Vt--),e.set_rethrown(!1),Rt.push(e),Nn(e.excPtr),e.get_exception_ptr()},Ib:()=>{if(!Rt.length)return 0;var t=Rt[Rt.length-1];return Nn(t.excPtr),t.excPtr},w:()=>{xn(0,0);var t=Rt.pop();On(t.excPtr),Zt=0},b:()=>Nt([]),h:t=>Nt([t]),r:(t,e)=>Nt([t,e]),ma:zt,Hb:t=>{if(t){var e=new Ot(t);Rt.push(e),e.set_rethrown(!0),zt()}},u:(t,e,r)=>{throw new Ot(t).init(e,r),Vt++,Zt=t},Jb:()=>Vt,Xb:t=>{Pn(t,!1,1,!0,4194304,!1),$t.threadInitTLS()},Ga:t=>{w?postMessage({cmd:"cleanupThread",thread:t}):lt(t)},Tb:Ut,c:t=>{throw Zt||(Zt=t),Zt},Qb:Lt,Ab:Xt,Bb:Yt,Ka:Bt,bc:Ht,jb:Jt,Eb:qt,Cb:te,dc:ee,_b:re,Vb:ne,$b:oe,La:ie,Db:ae,Rb:se,ac:ue,zb:ce,Sb:le,sb:(t,e,r,n,o)=>{},ic:(t,e,r,n)=>{_e(t,{name:e=he(e),fromWireType:function(t){return!!t},toWireType:function(t,e){return e?r:n},argPackAdvance:8,readValueFromPointer:function(t){return this.fromWireType(o()[t])},destructorFunction:null})},U:(t,e,r,n,o,i,a,s,u,c,l,d,h)=>{l=he(l),i=sr(o,i),s&&(s=sr(a,s)),c&&(c=sr(u,c)),h=sr(d,h);var f=Le(l);Be(f,(function(){lr(`Cannot construct ${l} due to unbound types`,[n])})),be([t,e,r],n?[n]:[],(function(e){var r,o;e=e[0],o=n?(r=e.registeredClass).instancePrototype:Ue.prototype;var a=Xe(f,(function(){if(Object.getPrototypeOf(this)!==u)throw new ve("Use 'new' to construct "+l);if(void 0===d.constructor_body)throw new ve(l+" has no accessible constructor");var t=d.constructor_body[arguments.length];if(void 0===t)throw new ve(`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 He(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 or(l,d,!0,!1,!1),m=new or(l+"*",d,!1,!1,!1),v=new or(l+" const*",d,!1,!0,!1);return Se[t]={pointerType:m,constPointerType:v},ir(f,a),[p,m,v]}))},T:(t,e,r,n,o,i,a,s)=>{var u=fr(r,n);e=he(e),i=sr(o,i),be([],[t],(function(t){var n=`${(t=t[0]).name}.${e}`;function o(){lr(`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):(Ye(s,e,n),s[e].overloadTable[r-1]=o),be([],u,(function(o){var u=[o[0],null].concat(o.slice(1)),c=hr(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[]})),[]}))},E:(t,e,r,n,o,i,a,s,u)=>{var c=fr(r,n);e=he(e),i=sr(o,i),be([],[t],(function(t){var n=`${(t=t[0]).name}.${e}`;function o(){lr(`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):(Ye(u,e,n),u[e].overloadTable[r-2]=o),be([],c,(function(o){var s=hr(n,o,t,i,a);return void 0===u[e].overloadTable?(s.argCount=r-2,u[e]=s):u[e].overloadTable[r-2]=s,[]})),[]}))},hc:(t,e)=>{_e(t,{name:e=he(e),fromWireType:t=>{var e=yr.toValue(t);return vr(t),e},toWireType:(t,e)=>yr.toHandle(e),argPackAdvance:8,readValueFromPointer:wr,destructorFunction:null})},Na:(t,e,r)=>{_e(t,{name:e=he(e),fromWireType:t=>t,toWireType:(t,e)=>e,argPackAdvance:8,readValueFromPointer:_r(e,r),destructorFunction:null})},Y:(t,e,r,n,o,i,a)=>{var s=fr(e,r);t=he(t),o=sr(n,o),Be(t,(function(){lr(`Cannot call ${t} due to unbound types`,s)}),e-1),be([],s,(function(r){var n=[r[0],null].concat(r.slice(1));return ir(t,hr(t,n,null,o,i),e-1),[]}))},R:(t,e,r,n,o)=>{e=he(e),-1===o&&(o=4294967295);var i=t=>t;if(0===n){var a=32-8*r;i=t=>t<>>a}var s=e.includes("unsigned");_e(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:Er(e,r,0!==n),destructorFunction:null})},H:(t,r,n)=>{var o=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function i(t){var r=u()[t>>2],n=u()[t+4>>2];return new o(e().buffer,n,r)}_e(t,{name:n=he(n),fromWireType:i,argPackAdvance:8,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},Ma:(t,e)=>{var r="std::string"===(e=he(e));_e(t,{name:e,fromWireType:t=>{var e,n=u()[t>>2],i=t+4;if(r)for(var a=i,s=0;s<=n;++s){var c=i+s;if(s==n||0==o()[c]){var l=Tt(a,c-a);void 0===e?e=l:(e+=String.fromCharCode(0),e+=l),a=c+1}}else{var d=new Array(n);for(s=0;s{var n;e instanceof ArrayBuffer&&(e=new Uint8Array(e));var i="string"==typeof e;i||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array||ge("Cannot pass non-string to std::string"),n=r&&i?yt(e):e.length;var a=kn(4+n+1),s=a+4;if(u()[a>>2]=n,r&&i)Qt(e,s,n+1);else if(i)for(var c=0;c255&&(Wn(s),ge("String has UTF-16 code units that do not fit in 8 bits")),o()[s+c]=l}else for(c=0;cWn(t)})},ua:(t,e,r)=>{var n,o,i,s,c;r=he(r),2===e?(n=Wr,o=Mr,s=Cr,i=()=>a(),c=1):4===e&&(n=Tr,o=Sr,s=Fr,i=()=>u(),c=2),_e(t,{name:r,fromWireType:t=>{for(var r,o=u()[t>>2],a=i(),s=t+4,l=0;l<=o;++l){var d=t+4+l*e;if(l==o||0==a[d>>c]){var h=n(s,d-s);void 0===r?r=h:(r+=String.fromCharCode(0),r+=h),s=d+e}}return Wn(t),r},toWireType:(t,n)=>{"string"!=typeof n&&ge(`Cannot pass non-string to C++ string type ${r}`);var i=s(n),a=kn(4+i+e);return u()[a>>2]=i>>c,o(n,a+4,i+e),null!==t&&t.push(Wn,a),a},argPackAdvance:8,readValueFromPointer:wr,destructorFunction:t=>Wn(t)})},jc:(t,e)=>{_e(t,{isVoid:!0,name:e=he(e),argPackAdvance:0,fromWireType:()=>{},toWireType:(t,e)=>{}})},gc:()=>!0,Ob:(t,e,r)=>{if(t==e)setTimeout((()=>$r()));else if(w)postMessage({targetThread:t,cmd:"checkMailbox"});else{var n=$t.pthreads[t];if(!n)return;n.postMessage({cmd:"checkMailbox"})}},Ub:(t,e,r,n)=>{xr.length=r;for(var o=n>>3,i=0;i{},Kb:()=>{throw 1/0},Z:(t,e,r)=>{t=yr.toValue(t),e=Ir(e,"emval::as");var n=[],o=yr.toHandle(n);return u()[r>>2]=o,e.toWireType(n,t)},ha:(t,e,r,n,o)=>(t=Zr[t])(e=yr.toValue(e),r=Vr(r),(t=>{var e=[];return u()[t>>2]=yr.toHandle(e),e})(n),o),ra:(t,e,r,n)=>{(t=Zr[t])(e=yr.toValue(e),r=Vr(r),null,n)},Mb:vr,sa:t=>0===t?yr.toHandle(Or()):(t=Vr(t),yr.toHandle(Or()[t])),V:(t,e)=>{var r=((t,e)=>{for(var r=new Array(t),n=0;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=Nr[o];if(void 0!==i)return i;var a,s,c=new Array(t-1);return a=(e,o,i,a)=>{for(var s=0,u=0;u(t=yr.toValue(t),e=yr.toValue(e),yr.toHandle(t[e])),v:t=>{t>4&&(mr.get(t).refcount+=1)},gb:(t,e)=>(t=yr.toValue(t))instanceof(e=yr.toValue(e)),_:t=>"number"==typeof(t=yr.toValue(t)),J:t=>"string"==typeof(t=yr.toValue(t)),S:()=>yr.toHandle([]),L:t=>yr.toHandle(Vr(t)),B:()=>yr.toHandle({}),hb:t=>{var e=yr.toValue(t);dr(e),vr(t)},cc:(t,e,r)=>{t=yr.toValue(t),e=yr.toValue(e),r=yr.toValue(r),t[e]=r},P:(t,e)=>{var r=(t=Ir(t,"_emval_take_value")).readValueFromPointer(e);return yr.toHandle(r)},D:t=>(t=yr.toValue(t),yr.toHandle(typeof t)),pb:function(t,e,r){var n=Kt(t,e),o=new Date(1e3*n);s()[r>>2]=o.getUTCSeconds(),s()[r+4>>2]=o.getUTCMinutes(),s()[r+8>>2]=o.getUTCHours(),s()[r+12>>2]=o.getUTCDate(),s()[r+16>>2]=o.getUTCMonth(),s()[r+20>>2]=o.getUTCFullYear()-1900,s()[r+24>>2]=o.getUTCDay();var i=Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0),a=(o.getTime()-i)/864e5|0;s()[r+28>>2]=a},qb:function(t,e,r){var n=Kt(t,e),o=new Date(1e3*n);s()[r>>2]=o.getSeconds(),s()[r+4>>2]=o.getMinutes(),s()[r+8>>2]=o.getHours(),s()[r+12>>2]=o.getDate(),s()[r+16>>2]=o.getMonth(),s()[r+20>>2]=o.getFullYear()-1900,s()[r+24>>2]=o.getDay();var i=0|(t=>(zr(t.getFullYear())?Gr:Ur)[t.getMonth()]+t.getDate()-1)(o);s()[r+28>>2]=i,s()[r+36>>2]=-60*o.getTimezoneOffset();var a=new Date(o.getFullYear(),0,1),u=new Date(o.getFullYear(),6,1).getTimezoneOffset(),c=a.getTimezoneOffset(),l=0|(u!=c&&o.getTimezoneOffset()==Math.min(c,u));s()[r+32>>2]=l},nb:Lr,ob:Xr,Nb:(t,e,r)=>{var n=(new Date).getFullYear(),o=new Date(n,0,1),i=new Date(n,6,1),a=o.getTimezoneOffset(),c=i.getTimezoneOffset(),l=Math.max(a,c);function d(t){var e=t.toTimeString().match(/\(([A-Za-z ]+)\)$/);return e?e[1]:"GMT"}u()[t>>2]=60*l,s()[e>>2]=Number(a!=c);var h=d(o),f=d(i),p=Br(h),m=Br(f);c>2]=p,u()[r+4>>2]=m):(u()[r>>2]=m,u()[r+4>>2]=p)},C:()=>{nt("")},db:(t,e,r)=>Kr(t,e,r),Ha:()=>{},$:()=>Date.now(),ec:()=>{throw L+=1,"unwind"},Pb:()=>2147483648,M:Yr,va:()=>navigator.hardwareConcurrency,Lb:t=>{var e=o().length;if((t>>>=0)<=e)return!1;var r=2147483648;t>r&&Jr();for(var n,i,a=1;a<=4;a*=2){var s=e*(1+.2/a);s=Math.min(s,t+100663296);var u=Math.min(r,(n=Math.max(t,s))+((i=65536)-n%i)%i);if(Qr(u))return!0}Jr()},Yb:en,Zb:rn,Oa:Pt,ka:nn,Ia:on,Ja:an,rb:sn,ta:un,fb:function(){return hn(location.toString())},yb:(t,e)=>(ft(o().subarray(t,t+e)),0),eb:function(){return hn((t=qn,self[t(373,"jL8N")][t(376,"cPlx")]()));var t},Fa:function(t,e){var r=Rn();try{return xt(t)(e)}catch(t){if(Vn(r),t!==t+0)throw t;xn(1,0)}},Ea:function(t,e,r){var n=Rn();try{return xt(t)(e,r)}catch(t){if(Vn(n),t!==t+0)throw t;xn(1,0)}},N:function(t,e,r,n,o,i){var a=Rn();try{return xt(t)(e,r,n,o,i)}catch(t){if(Vn(a),t!==t+0)throw t;xn(1,0)}},W:function(t,e,r,n){var o=Rn();try{return xt(t)(e,r,n)}catch(t){if(Vn(o),t!==t+0)throw t;xn(1,0)}},qa:function(t,e,r,n,o){var i=Rn();try{return xt(t)(e,r,n,o)}catch(t){if(Vn(i),t!==t+0)throw t;xn(1,0)}},Ca:function(t,e,r){var n=Rn();try{return xt(t)(e,r)}catch(t){if(Vn(n),t!==t+0)throw t;xn(1,0)}},ba:function(t,e,r,n){var o=Rn();try{return xt(t)(e,r,n)}catch(t){if(Vn(o),t!==t+0)throw t;xn(1,0)}},Va:function(t,e,r,n,o){var i=Rn();try{return xt(t)(e,r,n,o)}catch(t){if(Vn(i),t!==t+0)throw t;xn(1,0)}},s:function(t){var e=Rn();try{return xt(t)()}catch(t){if(Vn(e),t!==t+0)throw t;xn(1,0)}},j:function(t,e){var r=Rn();try{return xt(t)(e)}catch(t){if(Vn(r),t!==t+0)throw t;xn(1,0)}},Aa:function(t,e,r,n){var o=Rn();try{return xt(t)(e,r,n)}catch(t){if(Vn(o),t!==t+0)throw t;xn(1,0)}},Za:function(t,e,r,n){var o=Rn();try{return xt(t)(e,r,n)}catch(t){if(Vn(o),t!==t+0)throw t;xn(1,0)}},$a:function(t,e,r,n,o){var i=Rn();try{return xt(t)(e,r,n,o)}catch(t){if(Vn(i),t!==t+0)throw t;xn(1,0)}},_a:function(t,e,r,n,o,i,a,s){var u=Rn();try{return xt(t)(e,r,n,o,i,a,s)}catch(t){if(Vn(u),t!==t+0)throw t;xn(1,0)}},d:function(t,e,r){var n=Rn();try{return xt(t)(e,r)}catch(t){if(Vn(n),t!==t+0)throw t;xn(1,0)}},ab:function(t,e,r,n){var o=Rn();try{return xt(t)(e,r,n)}catch(t){if(Vn(o),t!==t+0)throw t;xn(1,0)}},k:function(t,e,r,n){var o=Rn();try{return xt(t)(e,r,n)}catch(t){if(Vn(o),t!==t+0)throw t;xn(1,0)}},fa:function(t,e,r,n,o){var i=Rn();try{return xt(t)(e,r,n,o)}catch(t){if(Vn(i),t!==t+0)throw t;xn(1,0)}},l:function(t,e,r,n,o){var i=Rn();try{return xt(t)(e,r,n,o)}catch(t){if(Vn(i),t!==t+0)throw t;xn(1,0)}},Gb:function(t,e,r,n,o,i){var a=Rn();try{return xt(t)(e,r,n,o,i)}catch(t){if(Vn(a),t!==t+0)throw t;xn(1,0)}},Da:function(t,e,r,n,o,i,a){var s=Rn();try{return xt(t)(e,r,n,o,i,a)}catch(t){if(Vn(s),t!==t+0)throw t;xn(1,0)}},p:function(t,e,r,n,o,i){var a=Rn();try{return xt(t)(e,r,n,o,i)}catch(t){if(Vn(a),t!==t+0)throw t;xn(1,0)}},I:function(t,e,r,n,o,i,a){var s=Rn();try{return xt(t)(e,r,n,o,i,a)}catch(t){if(Vn(s),t!==t+0)throw t;xn(1,0)}},la:function(t,e,r,n,o,i,a,s){var u=Rn();try{return xt(t)(e,r,n,o,i,a,s)}catch(t){if(Vn(u),t!==t+0)throw t;xn(1,0)}},Qa:function(t,e,r,n,o,i,a,s,u){var c=Rn();try{return xt(t)(e,r,n,o,i,a,s,u)}catch(t){if(Vn(c),t!==t+0)throw t;xn(1,0)}},Pa:function(t,e,r,n,o,i,a,s,u,c){var l=Rn();try{return xt(t)(e,r,n,o,i,a,s,u,c)}catch(t){if(Vn(l),t!==t+0)throw t;xn(1,0)}},Ya:function(t,e,r,n,o,i,a,s,u,c,l){var d=Rn();try{return xt(t)(e,r,n,o,i,a,s,u,c,l)}catch(t){if(Vn(d),t!==t+0)throw t;xn(1,0)}},ja:function(t,e,r,n,o,i,a,s,u,c,l,d){var h=Rn();try{return xt(t)(e,r,n,o,i,a,s,u,c,l,d)}catch(t){if(Vn(h),t!==t+0)throw t;xn(1,0)}},vb:function(t,e,r,n,o,i,a){var s=Rn();try{return Ln(t,e,r,n,o,i,a)}catch(t){if(Vn(s),t!==t+0)throw t;xn(1,0)}},ub:function(t,e,r,n){var o=Rn();try{return Xn(t,e,r,n)}catch(t){if(Vn(o),t!==t+0)throw t;xn(1,0)}},mb:function(t){var e=Rn();try{return Bn(t)}catch(t){if(Vn(e),t!==t+0)throw t;xn(1,0)}},xb:function(t,e){var r=Rn();try{return Un(t,e)}catch(t){if(Vn(r),t!==t+0)throw t;xn(1,0)}},lb:function(t,e,r){var n=Rn();try{return Hn(t,e,r)}catch(t){if(Vn(n),t!==t+0)throw t;xn(1,0)}},kb:function(t,e,r,n,o){var i=Rn();try{return Jn(t,e,r,n,o)}catch(t){if(Vn(i),t!==t+0)throw t;xn(1,0)}},n:function(t){var e=Rn();try{xt(t)()}catch(t){if(Vn(e),t!==t+0)throw t;xn(1,0)}},f:function(t,e){var r=Rn();try{xt(t)(e)}catch(t){if(Vn(r),t!==t+0)throw t;xn(1,0)}},ga:function(t,e,r){var n=Rn();try{xt(t)(e,r)}catch(t){if(Vn(n),t!==t+0)throw t;xn(1,0)}},za:function(t,e,r,n){var o=Rn();try{xt(t)(e,r,n)}catch(t){if(Vn(o),t!==t+0)throw t;xn(1,0)}},cb:function(t,e,r,n,o,i,a,s){var u=Rn();try{xt(t)(e,r,n,o,i,a,s)}catch(t){if(Vn(u),t!==t+0)throw t;xn(1,0)}},ya:function(t,e,r){var n=Rn();try{xt(t)(e,r)}catch(t){if(Vn(n),t!==t+0)throw t;xn(1,0)}},e:function(t,e,r){var n=Rn();try{xt(t)(e,r)}catch(t){if(Vn(n),t!==t+0)throw t;xn(1,0)}},x:function(t,e,r,n){var o=Rn();try{xt(t)(e,r,n)}catch(t){if(Vn(o),t!==t+0)throw t;xn(1,0)}},ea:function(t,e,r,n,o){var i=Rn();try{xt(t)(e,r,n,o)}catch(t){if(Vn(i),t!==t+0)throw t;xn(1,0)}},aa:function(t,e,r,n,o,i){var a=Rn();try{xt(t)(e,r,n,o,i)}catch(t){if(Vn(a),t!==t+0)throw t;xn(1,0)}},Ba:function(t,e,r,n,o,i,a,s){var u=Rn();try{xt(t)(e,r,n,o,i,a,s)}catch(t){if(Vn(u),t!==t+0)throw t;xn(1,0)}},bb:function(t,e,r,n,o,i,a){var s=Rn();try{xt(t)(e,r,n,o,i,a)}catch(t){if(Vn(s),t!==t+0)throw t;xn(1,0)}},X:function(t,e,r,n,o,i,a,s){var u=Rn();try{xt(t)(e,r,n,o,i,a,s)}catch(t){if(Vn(u),t!==t+0)throw t;xn(1,0)}},da:function(t,e,r,n,o){var i=Rn();try{xt(t)(e,r,n,o)}catch(t){if(Vn(i),t!==t+0)throw t;xn(1,0)}},oa:function(t,e,r,n){var o=Rn();try{xt(t)(e,r,n)}catch(t){if(Vn(o),t!==t+0)throw t;xn(1,0)}},xa:function(t,e,r,n,o,i,a){var s=Rn();try{xt(t)(e,r,n,o,i,a)}catch(t){if(Vn(s),t!==t+0)throw t;xn(1,0)}},i:function(t,e,r,n){var o=Rn();try{xt(t)(e,r,n)}catch(t){if(Vn(o),t!==t+0)throw t;xn(1,0)}},Q:function(t,e,r,n,o){var i=Rn();try{xt(t)(e,r,n,o)}catch(t){if(Vn(i),t!==t+0)throw t;xn(1,0)}},F:function(t,e,r,n,o,i){var a=Rn();try{xt(t)(e,r,n,o,i)}catch(t){if(Vn(a),t!==t+0)throw t;xn(1,0)}},z:function(t,e,r,n,o,i,a){var s=Rn();try{xt(t)(e,r,n,o,i,a)}catch(t){if(Vn(s),t!==t+0)throw t;xn(1,0)}},K:function(t,e,r,n,o,i){var a=Rn();try{xt(t)(e,r,n,o,i)}catch(t){if(Vn(a),t!==t+0)throw t;xn(1,0)}},Xa:function(t,e,r,n,o){var i=Rn();try{xt(t)(e,r,n,o)}catch(t){if(Vn(i),t!==t+0)throw t;xn(1,0)}},Wa:function(t,e,r,n,o,i){var a=Rn();try{xt(t)(e,r,n,o,i)}catch(t){if(Vn(a),t!==t+0)throw t;xn(1,0)}},g:function(t,e,r,n,o){var i=Rn();try{xt(t)(e,r,n,o)}catch(t){if(Vn(i),t!==t+0)throw t;xn(1,0)}},Ra:function(t,e,r,n,o,i,a,s){var u=Rn();try{xt(t)(e,r,n,o,i,a,s)}catch(t){if(Vn(u),t!==t+0)throw t;xn(1,0)}},na:function(t,e,r,n,o,i){var a=Rn();try{xt(t)(e,r,n,o,i)}catch(t){if(Vn(a),t!==t+0)throw t;xn(1,0)}},o:function(t,e,r,n,o,i){var a=Rn();try{xt(t)(e,r,n,o,i)}catch(t){if(Vn(a),t!==t+0)throw t;xn(1,0)}},pa:function(t,e,r,n,o,i,a,s,u){var c=Rn();try{xt(t)(e,r,n,o,i,a,s,u)}catch(t){if(Vn(c),t!==t+0)throw t;xn(1,0)}},q:function(t,e,r,n,o,i,a){var s=Rn();try{xt(t)(e,r,n,o,i,a)}catch(t){if(Vn(s),t!==t+0)throw t;xn(1,0)}},Ua:function(t,e,r,n,o,i,a,s,u,c,l){var d=Rn();try{xt(t)(e,r,n,o,i,a,s,u,c,l)}catch(t){if(Vn(d),t!==t+0)throw t;xn(1,0)}},y:function(t,e,r,n,o,i,a,s){var u=Rn();try{xt(t)(e,r,n,o,i,a,s)}catch(t){if(Vn(u),t!==t+0)throw t;xn(1,0)}},Ta:function(t,e,r,n,o,i,a,s,u,c,l,d){var h=Rn();try{xt(t)(e,r,n,o,i,a,s,u,c,l,d)}catch(t){if(Vn(h),t!==t+0)throw t;xn(1,0)}},Sa:function(t,e,r,n,o,i,a,s,u,c,l){var d=Rn();try{xt(t)(e,r,n,o,i,a,s,u,c,l)}catch(t){if(Vn(d),t!==t+0)throw t;xn(1,0)}},G:function(t,e,r,n,o,i,a,s,u){var c=Rn();try{xt(t)(e,r,n,o,i,a,s,u)}catch(t){if(Vn(c),t!==t+0)throw t;xn(1,0)}},ca:function(t,e,r,n,o,i,a,s,u,c){var l=Rn();try{xt(t)(e,r,n,o,i,a,s,u,c)}catch(t){if(Vn(l),t!==t+0)throw t;xn(1,0)}},O:function(t,e,r,n,o,i,a,s,u,c,l){var d=Rn();try{xt(t)(e,r,n,o,i,a,s,u,c,l)}catch(t){if(Vn(d),t!==t+0)throw t;xn(1,0)}},ia:function(t,e,r,n,o,i,a,s,u,c,l,d,h,f,p,m){var v=Rn();try{xt(t)(e,r,n,o,i,a,s,u,c,l,d,h,f,p,m)}catch(t){if(Vn(v),t!==t+0)throw t;xn(1,0)}},wb:function(t,e,r,n,o,i,a){var s=Rn();try{Kn(t,e,r,n,o,i,a)}catch(t){if(Vn(s),t!==t+0)throw t;xn(1,0)}},tb:function(t,e,r,n,o){var i=Rn();try{Yn(t,e,r,n,o)}catch(t){if(Vn(i),t!==t+0)throw t;xn(1,0)}},A:t=>t,a:M||h.wasmMemory,wa:dn,Fb:(t,e,r,n,o)=>dn(t,e,r,n)},En=function(){var t,e,r,n,o={a:_n};function i(t,e){var r,n=t.exports;return It((En=n).rc),O=En.mc,r=En.kc,G.unshift(r),C=e,rt(),n}if(et(),h.instantiateWasm)try{return h.instantiateWasm(o,i)}catch(t){W(`Module.instantiateWasm callback failed with error: ${t}`),d(t)}return(t=E,e=H,r=o,n=function(t){i(t.instance,t.module)},t||"function"!=typeof WebAssembly.instantiateStreaming||ot(e)||"function"!=typeof fetch?at(e,r,n):fetch(e,{credentials:"same-origin"}).then((t=>WebAssembly.instantiateStreaming(t,r).then(n,(function(t){return W(`wasm streaming compile failed: ${t}`),W("falling back to ArrayBuffer instantiation"),at(e,r,n)}))))).catch(d),{}}(),kn=h._malloc=t=>(kn=h._malloc=En.lc)(t),Wn=h._free=t=>(Wn=h._free=En.nc)(t),Mn=()=>(Mn=En.oc)(),Cn=h._pthread_self=()=>(Cn=h._pthread_self=En.pc)(),Tn=t=>(Tn=En.qc)(t),Sn=(h.__emscripten_tls_init=()=>(h.__emscripten_tls_init=En.rc)(),(t,e)=>(Sn=En.sc)(t,e)),Fn=t=>(Fn=En.tc)(t),Pn=(h.__embind_initialize_bindings=()=>(h.__embind_initialize_bindings=En.uc)(),h.__emscripten_thread_init=(t,e,r,n,o,i)=>(Pn=h.__emscripten_thread_init=En.vc)(t,e,r,n,o,i)),jn=(h.__emscripten_thread_crashed=()=>(h.__emscripten_thread_crashed=En.wc)(),(t,e,r,n)=>(jn=En.xc)(t,e,r,n)),$n=t=>($n=En.yc)(t),An=h.__emscripten_thread_exit=t=>(An=h.__emscripten_thread_exit=En.zc)(t),Dn=h.__emscripten_check_mailbox=()=>(Dn=h.__emscripten_check_mailbox=En.Ac)(),xn=(t,e)=>(xn=En.Bc)(t,e),In=(t,e)=>(In=En.Cc)(t,e),Rn=()=>(Rn=En.Dc)(),Vn=t=>(Vn=En.Ec)(t),Zn=t=>(Zn=En.Fc)(t),On=t=>(On=En.Gc)(t),Nn=t=>(Nn=En.Hc)(t),zn=(t,e,r)=>(zn=En.Ic)(t,e,r),Gn=t=>(Gn=En.Jc)(t),Un=h.dynCall_ji=(t,e)=>(Un=h.dynCall_ji=En.Kc)(t,e),Ln=(h.dynCall_jiji=(t,e,r,n,o)=>(h.dynCall_jiji=En.Lc)(t,e,r,n,o),h.dynCall_viij=(t,e,r,n,o)=>(h.dynCall_viij=En.Mc)(t,e,r,n,o),h.dynCall_iiijii=(t,e,r,n,o,i,a)=>(Ln=h.dynCall_iiijii=En.Nc)(t,e,r,n,o,i,a)),Xn=h.dynCall_iji=(t,e,r,n)=>(Xn=h.dynCall_iji=En.Oc)(t,e,r,n),Yn=h.dynCall_viji=(t,e,r,n,o)=>(Yn=h.dynCall_viji=En.Pc)(t,e,r,n,o),Bn=(h.dynCall_iiiijj=(t,e,r,n,o,i,a,s)=>(h.dynCall_iiiijj=En.Qc)(t,e,r,n,o,i,a,s),h.dynCall_viijj=(t,e,r,n,o,i,a)=>(h.dynCall_viijj=En.Rc)(t,e,r,n,o,i,a),h.dynCall_viiijjj=(t,e,r,n,o,i,a,s,u,c)=>(h.dynCall_viiijjj=En.Sc)(t,e,r,n,o,i,a,s,u,c),h.dynCall_j=t=>(Bn=h.dynCall_j=En.Tc)(t)),Hn=h.dynCall_jii=(t,e,r)=>(Hn=h.dynCall_jii=En.Uc)(t,e,r),Kn=h.dynCall_viijii=(t,e,r,n,o,i,a)=>(Kn=h.dynCall_viijii=En.Vc)(t,e,r,n,o,i,a),Jn=h.dynCall_jiiii=(t,e,r,n,o)=>(Jn=h.dynCall_jiiii=En.Wc)(t,e,r,n,o);function Qn(){if(!(Q>0)){if(w)return l(h),Y(),void startWorker(h);!function(){if(h.preRun)for("function"==typeof h.preRun&&(h.preRun=[h.preRun]);h.preRun.length;)B(h.preRun.shift());At(z)}(),Q>0||(h.setStatus?(h.setStatus("Running..."),setTimeout((function(){setTimeout((function(){h.setStatus("")}),1),t()}),1)):t())}function t(){wn||(wn=!0,h.calledRun=!0,R||(Y(),l(h),h.onRuntimeInitialized&&h.onRuntimeInitialized(),function(){if(!w){if(h.postRun)for("function"==typeof h.postRun&&(h.postRun=[h.postRun]);h.postRun.length;)t=h.postRun.shift(),U.unshift(t);var t;At(U)}}()))}}if(h.dynCall_iiiiij=(t,e,r,n,o,i,a)=>(h.dynCall_iiiiij=En.Xc)(t,e,r,n,o,i,a),h.dynCall_iiiiijj=(t,e,r,n,o,i,a,s,u)=>(h.dynCall_iiiiijj=En.Yc)(t,e,r,n,o,i,a,s,u),h.dynCall_iiiiiijj=(t,e,r,n,o,i,a,s,u,c)=>(h.dynCall_iiiiiijj=En.Zc)(t,e,r,n,o,i,a,s,u,c),h.___start_em_js=1825440,h.___stop_em_js=1825548,h.keepRuntimeAlive=X,h.wasmMemory=M,h.UTF8ToString=Tt,h.stringToUTF8=Qt,h.lengthBytesUTF8=yt,h.ExitStatus=ut,h.allocateUTF8=hn,h.PThread=$t,tt=function t(){wn||Qn(),wn||(tt=t)},h.preInit)for("function"==typeof h.preInit&&(h.preInit=[h.preInit]);h.preInit.length>0;)h.preInit.pop()();function qn(t,e){t-=359;var r=to(),n=r[t];void 0===qn.NpKXyi&&(qn.JyecKA=function(t,e){var r,n,o=[],i=0,a="";for(t=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{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{"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 _(t);case"CustomBinarizationFilter":return new E(t);case"ColorDocumentFilter":return new k(t);case"ColorDocumentShadowRemovalFilter":return new W(t);case"BrightnessFilter":return new M(t);case"ContrastFilter":return new C(t);case"GrayscaleFilter":return new T(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 _{constructor(t={}){this._type="ScanbotBinarizationFilter",this.outputMode="BINARY",void 0!==t.outputMode&&(this.outputMode=t.outputMode)}}class E{constructor(t={}){this._type="CustomBinarizationFilter",this.outputMode="BINARY",this.strokeWeight=.5,this.denoise=.5,this.radius=32,this.preset="PRESET_4",void 0!==t.outputMode&&(this.outputMode=t.outputMode),void 0!==t.strokeWeight&&(this.strokeWeight=t.strokeWeight),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 W{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 C{constructor(t={}){this._type="ContrastFilter",this.contrast=0,void 0!==t.contrast&&(this.contrast=t.contrast)}}class T{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 P{constructor(t={}){this.attributes=new F({}),this.pageSize="A4",this.pageDirection="PORTRAIT",this.pageFit="FIT_IN",this.dpi=72,this.jpegQuality=80,this.jpegOptimize=!1,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.jpegOptimize&&(this.jpegOptimize=t.jpegOptimize),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 $(t);case"UserFieldStringValue":return new A(t);case"UserFieldIntValue":return new D(t);default:throw new Error(`Unknown child class name: ${e}`)}}}(j||(j={}));class ${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 A{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 D{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 I{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 R(t,e){return!!t[e]}function V(t,e){if(R(t,e))return t[e];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`)}!function(t){t.defaultCompression="LZW",t.binaryDocumentOptimizedCompression="CCITT_T6"}(I||(I={}));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 O{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)}))}parse(t,e){return Z(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).parse(e);return r=y(r),r}))}destroy(t){return Z(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}isAvailable(){return Z(this,void 0,void 0,(function*(){return R(this.getWasmModule(),"BarcodeDocumentParser")}))}getWasmComponent(){return V(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 z{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)}))}isAvailable(){return N(this,void 0,void 0,(function*(){return R(this.getWasmModule(),"BarcodeScanner")}))}getWasmComponent(){return V(this.getWasmModule(),"BarcodeScanner")}}var G=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 G(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=y(e),this.objectMap.add(e)}))}run(t,e){return G(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 G(this,void 0,void 0,(function*(){return this.objectMap.get(t).clearResult()}))}destroy(t){return G(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}isAvailable(){return G(this,void 0,void 0,(function*(){return R(this.getWasmModule(),"CheckScanner")}))}getWasmComponent(){return V(this.getWasmModule(),"CheckScanner")}}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 X{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}}))}clearResult(t){return L(this,void 0,void 0,(function*(){return this.objectMap.get(t).clearResult()}))}destroy(t){return L(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}isAvailable(){return L(this,void 0,void 0,(function*(){return R(this.getWasmModule(),"CreditCardScanner")}))}getWasmComponent(){return V(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 B{constructor(t){this.getWasmModule=t,this.objectMap=new g}create(t,e){return Y(this,void 0,void 0,(function*(){let r=this.getWasmComponent().create(t,e);return r=y(r),this.objectMap.add(r)}))}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,originalMask:e}}))}undo(t){return Y(this,void 0,void 0,(function*(){let e=this.objectMap.get(t).undo();return e=y(e),e}))}redo(t){return Y(this,void 0,void 0,(function*(){let e=this.objectMap.get(t).redo();return e=y(e),e}))}reset(t){return Y(this,void 0,void 0,(function*(){let e=this.objectMap.get(t).reset();return e=y(e),e}))}canUndo(t){return Y(this,void 0,void 0,(function*(){return this.objectMap.get(t).canUndo()}))}canRedo(t){return Y(this,void 0,void 0,(function*(){return this.objectMap.get(t).canRedo()}))}destroy(t){return Y(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}isAvailable(){return Y(this,void 0,void 0,(function*(){return R(this.getWasmModule(),"DocumentCleanup")}))}getWasmComponent(){return V(this.getWasmModule(),"DocumentCleanup")}}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 K{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()}))}verifyDocument(t,e){return H(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).verifyDocument(e);return r=y(r),r}))}destroy(t){return H(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}isAvailable(){return H(this,void 0,void 0,(function*(){return R(this.getWasmModule(),"DocumentDataExtractor")}))}getWasmComponent(){return V(this.getWasmModule(),"DocumentDataExtractor")}}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 Q{constructor(t){this.getWasmModule=t,this.objectMap=new g}create(t){return J(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=y(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=y(r),{result:r,originalImage:e}}))}destroy(t){return J(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}isAvailable(){return J(this,void 0,void 0,(function*(){return R(this.getWasmModule(),"DocumentQualityAnalyzer")}))}getWasmComponent(){return V(this.getWasmModule(),"DocumentQualityAnalyzer")}}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 tt{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}}))}scan(t,e){return q(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 q(this,void 0,void 0,(function*(){return this.objectMap.get(t).clearResult()}))}destroy(t){return q(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}isAvailable(){return q(this,void 0,void 0,(function*(){return R(this.getWasmModule(),"DocumentScanner")}))}getWasmComponent(){return V(this.getWasmModule(),"DocumentScanner")}}var et=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 rt{constructor(t){this.getWasmModule=t,this.objectMap=new g}create(){return et(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create();return t=y(t),this.objectMap.add(t)}))}run(t,e,r,n){return et(this,void 0,void 0,(function*(){let o=this.objectMap.get(t).run(e,r,n);return o=y(o),{result:o,originalImage:e}}))}isStraighteningModeAvailable(t){return et(this,void 0,void 0,(function*(){return this.getWasmComponent().isStraighteningModeAvailable(t)}))}destroy(t){return et(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}isAvailable(){return et(this,void 0,void 0,(function*(){return R(this.getWasmModule(),"DocumentStraightener")}))}getWasmComponent(){return V(this.getWasmModule(),"DocumentStraightener")}}var nt=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 ot{constructor(t){this.getWasmModule=t,this.objectMap=new g}create(){return nt(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create();return this.objectMap.add(t)}))}cropRect(t,e,r){return nt(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 nt(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 nt(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 nt(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 nt(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}isAvailable(){return nt(this,void 0,void 0,(function*(){return R(this.getWasmModule(),"ImageManipulator")}))}getWasmComponent(){return V(this.getWasmModule(),"ImageManipulator")}}var it=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 at{constructor(t){this.getWasmModule=t,this.objectMap=new g}create(){return it(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create();return this.objectMap.add(t)}))}crop(t,e,r,n){return it(this,void 0,void 0,(function*(){let o=this.objectMap.get(t).crop(e,r,n);return o=y(o),{result:o,originalImage:e}}))}resize(t,e,r){return it(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 it(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 it(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 it(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}isAvailable(){return it(this,void 0,void 0,(function*(){return R(this.getWasmModule(),"ImageProcessor")}))}getWasmComponent(){return V(this.getWasmModule(),"ImageProcessor")}}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(t){return st(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=y(e),this.objectMap.add(e)}))}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}}))}clearResult(t){return st(this,void 0,void 0,(function*(){return this.objectMap.get(t).clearResult()}))}destroy(t){return st(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}isAvailable(){return st(this,void 0,void 0,(function*(){return R(this.getWasmModule(),"MrzScanner")}))}getWasmComponent(){return V(this.getWasmModule(),"MrzScanner")}}class ct{constructor(t){this.getWasmModule=t,this.objectMap=new g}create(t){return st(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=y(e),this.objectMap.add(e)}))}parse(t,e){return st(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).parse(e);return r=y(r),r}))}destroy(t){return st(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}isAvailable(){return st(this,void 0,void 0,(function*(){return R(this.getWasmModule(),"MrzParser")}))}getWasmComponent(){return V(this.getWasmModule(),"MrzParser")}}var lt=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 dt{constructor(t){this.getWasmModule=t,this.objectMap=new g}create(){return lt(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create();return t=y(t),this.objectMap.add(t)}))}run(t,e){return lt(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 lt(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}isAvailable(){return lt(this,void 0,void 0,(function*(){return R(this.getWasmModule(),"OcrEngine")}))}getWasmComponent(){return V(this.getWasmModule(),"OcrEngine")}}var ht=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 ft{constructor(t){this.getWasmModule=t,this.objectMap=new g}create(t){return ht(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=y(e),this.objectMap.add(e)}))}run(t,e){return ht(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 ht(this,void 0,void 0,(function*(){return this.objectMap.get(t).cleanRecognitionQueue()}))}destroy(t){return ht(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}isAvailable(){return ht(this,void 0,void 0,(function*(){return R(this.getWasmModule(),"TextPatternScanner")}))}getWasmComponent(){return V(this.getWasmModule(),"TextPatternScanner")}}var pt=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 mt{constructor(t){this.getWasmModule=t,this.objectMap=new g}create(t){return pt(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=y(e),this.objectMap.add(e)}))}run(t,e){return pt(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 pt(this,void 0,void 0,(function*(){return this.objectMap.get(t).cleanRecognitionQueue()}))}destroy(t){return pt(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}isAvailable(){return pt(this,void 0,void 0,(function*(){return R(this.getWasmModule(),"VinScanner")}))}getWasmComponent(){return V(this.getWasmModule(),"VinScanner")}}var vt=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 gt;class yt extends Error{}const wt={PdfGenerationContext:new g,TiffGenerationContext:new g},bt=Object.assign(Object.assign({initialize:function(t,e,o,i){return vt(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(709),c=r(290),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;rgt),BarcodeScanner:new z(_t),CheckScanner:new U(_t),CreditCardScanner:new X(_t),DocumentCleanup:new B(_t),DocumentDataExtractor:new K(_t),DocumentQualityAnalyzer:new Q(_t),DocumentScanner:new tt(_t),DocumentStraightener:new rt(_t),ImageManipulator:new ot(_t),ImageProcessor:new at(_t),MrzScanner:new ut(_t),MrzParser:new ct(_t),OcrEngine:new dt(_t),TextPatternScanner:new ft(_t),VinScanner:new mt(_t)}),{__hasModuleFunction:function(t){return vt(this,void 0,void 0,(function*(){return gt.hasOwnProperty(t)}))},__callModuleFunction:function(t,e=[]){return vt(this,void 0,void 0,(function*(){return gt[t](...e)}))}});var _t;onmessage=function(t){const{command:e,args:r,ticket:n}=t.data;if(!gt&&"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),(()=>vt(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{if(t instanceof yt)self.postMessage({ticket:n,unrecoverableError:t});else{const e="number"==typeof t?new Error(gt.stringFromException(t)):t;console.error(e),self.postMessage({ticket:n,recoverableError:e,errorType:null==e?void 0:e.errorType})}}))}})()})();