scanbot-web-sdk 8.1.0 → 8.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/@types/ui2/document/model/document-detection-ui-result.d.ts +1 -0
  2. package/bundle/ScanbotSDK.min.js +3 -3
  3. package/bundle/ScanbotSDK.ui2.min.js +2 -2
  4. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
  5. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
  6. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
  7. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm.wasm +0 -0
  8. package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
  9. package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd.js +1 -1
  10. package/bundle/bin/barcode-scanner/ScanbotSDK.Core.js +1 -1
  11. package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.js +1 -1
  12. package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.wasm +0 -0
  13. package/bundle/bin/complete/ScanbotSDK.Asm-simd.wasm +0 -0
  14. package/bundle/bin/complete/ScanbotSDK.Asm.wasm +0 -0
  15. package/bundle/bin/complete/ScanbotSDK.Core-simd-threads.js +1 -1
  16. package/bundle/bin/complete/ScanbotSDK.Core-simd.js +1 -1
  17. package/bundle/bin/complete/ScanbotSDK.Core.js +1 -1
  18. package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
  19. package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
  20. package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
  21. package/bundle/bin/document-scanner/ScanbotSDK.Asm.wasm +0 -0
  22. package/bundle/bin/document-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
  23. package/bundle/bin/document-scanner/ScanbotSDK.Core-simd.js +1 -1
  24. package/bundle/bin/document-scanner/ScanbotSDK.Core.js +1 -1
  25. package/package.json +1 -1
@@ -1 +1 @@
1
- (()=>{var t={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!=S.buffer&&Z(),S}function o(){return M.buffer!=S.buffer&&Z(),P}function a(){return M.buffer!=S.buffer&&Z(),$}function i(){return M.buffer!=S.buffer&&Z(),j}function s(){return M.buffer!=S.buffer&&Z(),D}function u(){return M.buffer!=S.buffer&&Z(),A}function c(){return M.buffer!=S.buffer&&Z(),R}var l,d,h=t;h.ready=new Promise(((t,e)=>{l=t,d=e}));var f,p,m,v=Object.assign({},h),y="./this.program",g=(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),T=h.printErr||console.error.bind(console);Object.assign(h,v),v=null,h.arguments&&h.arguments,h.thisProgram&&(y=h.thisProgram),h.quit&&(g=h.quit),h.wasmBinary&&(E=h.wasmBinary);var M,W,C=h.noExitRuntime||!0;"object"!=typeof WebAssembly&&nt("no native wasm support detected");var F,S,P,$,j,D,A,x,R,I=!1;function V(t,e){t||nt(e)}function Z(){var t=M.buffer;h.HEAP8=S=new Int8Array(t),h.HEAP16=$=new Int16Array(t),h.HEAPU8=P=new Uint8Array(t),h.HEAPU16=j=new Uint16Array(t),h.HEAP32=D=new Int32Array(t),h.HEAPU32=A=new Uint32Array(t),h.HEAPF32=x=new Float32Array(t),h.HEAPF64=R=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 T("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 Y(){return C||L>0}function X(){w||(h.noFSInit||Wt.init.initialized||Wt.init(),Wt.ignorePermissions=!1,_t.init(),Dt(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),T(t="Aborted("+t+")"),I=!0,F=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 at(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 it(t,e,r){return function(t){return E||"function"!=typeof fetch?Promise.resolve().then((()=>at(t))):fetch(t,{credentials:"same-origin"}).then((e=>{if(!e.ok)throw"failed to load wasm binary file at '"+t+"'";return e.arrayBuffer()})).catch((()=>at(t)))}(t).then((t=>WebAssembly.instantiate(t,e))).then((t=>t)).then(r,(t=>{T(`failed to asynchronously prepare wasm: ${t}`),nt(t)}))}ot(H="ScanbotSDK.Asm-simd-threads.wasm")||(H=_(H));var st={1472444:t=>hn(function(){return this[Ct(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=jt.pthreads[t];V(e),jt.returnWorkerToPool(e)},dt=t=>{var e=jt.getNewWorker();if(!e)return 6;jt.runningWorkers.push(e),jt.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]:Wt.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<t.length&&""===t[e];e++);for(var r=t.length-1;r>=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=pt.resolve(t).substr(1),e=pt.resolve(e).substr(1);for(var n=r(t.split("/")),o=r(e.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var u=[];for(s=i;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(i))).join("/")}},mt="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,vt=(t,e,r)=>{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 a="";e<o;){var i=t[e++];if(128&i){var s=63&t[e++];if(192!=(224&i)){var u=63&t[e++];if((i=224==(240&i)?(15&i)<<12|s<<6|u:(7&i)<<18|s<<12|u<<6|63&t[e++])<65536)a+=String.fromCharCode(i);else{var c=i-65536;a+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a},yt=[],gt=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++r):e+=3}return e},wt=(t,e,r,n)=>{if(!(n>0))return 0;for(var o=r,a=r+n-1,i=0;i<t.length;++i){var s=t.charCodeAt(i);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&t.charCodeAt(++i)),s<=127){if(r>=a)break;e[r++]=s}else if(s<=2047){if(r+1>=a)break;e[r++]=192|s>>6,e[r++]=128|63&s}else if(s<=65535){if(r+2>=a)break;e[r++]=224|s>>12,e[r++]=128|s>>6&63,e[r++]=128|63&s}else{if(r+3>=a)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:gt(t)+1,o=new Array(n),a=wt(t,o,0,o.length);return e&&(o.length=a),o}var _t={ttys:[],init(){},shutdown(){},register(t,e){_t.ttys[t]={input:[],output:[],ops:e},Wt.registerDevice(t,_t.stream_ops)},stream_ops:{open(t){var e=_t.ttys[t.node.rdev];if(!e)throw new Wt.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 Wt.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=t.tty.ops.get_char(t.tty)}catch(t){throw new Wt.ErrnoError(29)}if(void 0===s&&0===a)throw new Wt.ErrnoError(6);if(null==s)break;a++,e[r+i]=s}return a&&(t.node.timestamp=Date.now()),a},write(t,e,r,n,o){if(!t.tty||!t.tty.ops.put_char)throw new Wt.ErrnoError(60);try{for(var a=0;a<n;a++)t.tty.ops.put_char(t.tty,e[r+a])}catch(t){throw new Wt.ErrnoError(29)}return n&&(t.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:t=>(()=>{if(!yt.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;yt=bt(t,!0)}return yt.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?(T(vt(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},fsync(t){t.output&&t.output.length>0&&(T(vt(t.output,0)),t.output=[])}}},Et=t=>{t=((t,e)=>Math.ceil(t/e)*e)(t,65536);var e=Fn(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(Wt.isBlkdev(r)||Wt.isFIFO(r))throw new Wt.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:Wt.chrdev_stream_ops}});var o=Wt.createNode(t,e,r,n);return Wt.isDir(o.mode)?(o.node_ops=kt.ops_table.dir.node,o.stream_ops=kt.ops_table.dir.stream,o.contents={}):Wt.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):Wt.isLink(o.mode)?(o.node_ops=kt.ops_table.link.node,o.stream_ops=kt.ops_table.link.stream):Wt.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=Wt.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,Wt.isDir(t.mode)?e.size=4096:Wt.isFile(t.mode)?e.size=t.usedBytes:Wt.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 Wt.genericErrors[44]},mknod:(t,e,r,n)=>kt.createNode(t,e,r,n),rename(t,e,r){if(Wt.isDir(t.mode)){var n;try{n=Wt.lookupNode(e,r)}catch(t){}if(n)for(var o in n.contents)throw new Wt.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=Wt.lookupNode(t,e);for(var n in r.contents)throw new Wt.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(!Wt.isLink(t.mode))throw new Wt.ErrnoError(28);return t.link}},stream_ops:{read(t,e,r,n,o){var a=t.node.contents;if(o>=t.node.usedBytes)return 0;var i=Math.min(t.node.usedBytes-o,n);if(i>8&&a.subarray)e.set(a.subarray(o,o+i),r);else for(var s=0;s<i;s++)e[r+s]=a[o+s];return i},write(t,r,n,o,a,i){if(r.buffer===e().buffer&&(i=!1),!o)return 0;var s=t.node;if(s.timestamp=Date.now(),r.subarray&&(!s.contents||s.contents.subarray)){if(i)return s.contents=r.subarray(n,n+o),s.usedBytes=o,o;if(0===s.usedBytes&&0===a)return s.contents=r.slice(n,n+o),s.usedBytes=o,o;if(a+o<=s.usedBytes)return s.contents.set(r.subarray(n,n+o),a),o}if(kt.expandFileStorage(s,a+o),s.contents.subarray&&r.subarray)s.contents.set(r.subarray(n,n+o),a);else for(var u=0;u<o;u++)s.contents[a+u]=r[n+u];return s.usedBytes=Math.max(s.usedBytes,a+o),o},llseek(t,e,r){var n=e;if(1===r?n+=t.position:2===r&&Wt.isFile(t.node.mode)&&(n+=t.node.usedBytes),n<0)throw new Wt.ErrnoError(28);return n},allocate(t,e,r){kt.expandFileStorage(t.node,e+r),t.node.usedBytes=Math.max(t.node.usedBytes,e+r)},mmap(t,r,n,o,a){if(!Wt.isFile(t.node.mode))throw new Wt.ErrnoError(43);var i,s,u=t.node.contents;if(2&a||u.buffer!==e().buffer){if((n>0||n+r<u.length)&&(u=u.subarray?u.subarray(n,n+r):Array.prototype.slice.call(u,n,n+r)),s=!0,!(i=Et(r)))throw new Wt.ErrnoError(48);e().set(u,i)}else s=!1,i=u.byteOffset;return{ptr:i,allocated:s}},msync:(t,e,r,n,o)=>(kt.stream_ops.write(t,e,0,n,r,!1),0)}},Tt=h.preloadPlugins||[],Mt=(t,e)=>{var r=0;return t&&(r|=365),e&&(r|=146),r},Wt={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 Wt.ErrnoError(32);for(var r=t.split("/").filter((t=>!!t)),n=Wt.root,o="/",a=0;a<r.length;a++){var i=a===r.length-1;if(i&&e.parent)break;if(n=Wt.lookupNode(n,r[a]),o=ht.join2(o,r[a]),Wt.isMountpoint(n)&&(!i||i&&e.follow_mount)&&(n=n.mounted.root),!i||e.follow)for(var s=0;Wt.isLink(n.mode);){var u=Wt.readlink(o);if(o=pt.resolve(ht.dirname(o),u),n=Wt.lookupPath(o,{recurse_count:e.recurse_count+1}).node,s++>40)throw new Wt.ErrnoError(32)}}return{path:o,node:n}},getPath(t){for(var e;;){if(Wt.isRoot(t)){var r=t.mount.mountpoint;return e?"/"!==r[r.length-1]?`${r}/${e}`:r+e:r}e=e?`${t.name}/${e}`:t.name,t=t.parent}},hashName(t,e){for(var r=0,n=0;n<e.length;n++)r=(r<<5)-r+e.charCodeAt(n)|0;return(t+r>>>0)%Wt.nameTable.length},hashAddNode(t){var e=Wt.hashName(t.parent.id,t.name);t.name_next=Wt.nameTable[e],Wt.nameTable[e]=t},hashRemoveNode(t){var e=Wt.hashName(t.parent.id,t.name);if(Wt.nameTable[e]===t)Wt.nameTable[e]=t.name_next;else for(var r=Wt.nameTable[e];r;){if(r.name_next===t){r.name_next=t.name_next;break}r=r.name_next}},lookupNode(t,e){var r=Wt.mayLookup(t);if(r)throw new Wt.ErrnoError(r,t);for(var n=Wt.hashName(t.id,e),o=Wt.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===t.id&&a===e)return o}return Wt.lookup(t,e)},createNode(t,e,r,n){var o=new Wt.FSNode(t,e,r,n);return Wt.hashAddNode(o),o},destroyNode(t){Wt.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)=>Wt.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=Wt.nodePermissions(t,"x");return e||(t.node_ops.lookup?0:2)},mayCreate(t,e){try{return Wt.lookupNode(t,e),20}catch(t){}return Wt.nodePermissions(t,"wx")},mayDelete(t,e,r){var n;try{n=Wt.lookupNode(t,e)}catch(t){return t.errno}var o=Wt.nodePermissions(t,"wx");if(o)return o;if(r){if(!Wt.isDir(n.mode))return 54;if(Wt.isRoot(n)||Wt.getPath(n)===Wt.cwd())return 10}else if(Wt.isDir(n.mode))return 31;return 0},mayOpen:(t,e)=>t?Wt.isLink(t.mode)?32:Wt.isDir(t.mode)&&("r"!==Wt.flagsToPermissionString(e)||512&e)?31:Wt.nodePermissions(t,Wt.flagsToPermissionString(e)):44,MAX_OPEN_FDS:4096,nextfd(){for(var t=0;t<=Wt.MAX_OPEN_FDS;t++)if(!Wt.streams[t])return t;throw new Wt.ErrnoError(33)},getStreamChecked(t){var e=Wt.getStream(t);if(!e)throw new Wt.ErrnoError(8);return e},getStream:t=>Wt.streams[t],createStream:(t,e=-1)=>(Wt.FSStream||(Wt.FSStream=function(){this.shared={}},Wt.FSStream.prototype={},Object.defineProperties(Wt.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 Wt.FSStream,t),-1==e&&(e=Wt.nextfd()),t.fd=e,Wt.streams[e]=t,t),closeStream(t){Wt.streams[t]=null},chrdev_stream_ops:{open(t){var e=Wt.getDevice(t.node.rdev);t.stream_ops=e.stream_ops,t.stream_ops.open&&t.stream_ops.open(t)},llseek(){throw new Wt.ErrnoError(70)}},major:t=>t>>8,minor:t=>255&t,makedev:(t,e)=>t<<8|e,registerDevice(t,e){Wt.devices[t]={stream_ops:e}},getDevice:t=>Wt.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),Wt.syncFSRequests++,Wt.syncFSRequests>1&&T(`warning: ${Wt.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var r=Wt.getMounts(Wt.root.mount),n=0;function o(t){return Wt.syncFSRequests--,e(t)}function a(t){if(t)return a.errored?void 0:(a.errored=!0,o(t));++n>=r.length&&o(null)}r.forEach((e=>{if(!e.type.syncfs)return a(null);e.type.syncfs(e,t,a)}))},mount(t,e,r){var n,o="/"===r,a=!r;if(o&&Wt.root)throw new Wt.ErrnoError(10);if(!o&&!a){var i=Wt.lookupPath(r,{follow_mount:!1});if(r=i.path,n=i.node,Wt.isMountpoint(n))throw new Wt.ErrnoError(10);if(!Wt.isDir(n.mode))throw new Wt.ErrnoError(54)}var s={type:t,opts:e,mountpoint:r,mounts:[]},u=t.mount(s);return u.mount=s,s.root=u,o?Wt.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount(t){var e=Wt.lookupPath(t,{follow_mount:!1});if(!Wt.isMountpoint(e.node))throw new Wt.ErrnoError(28);var r=e.node,n=r.mounted,o=Wt.getMounts(n);Object.keys(Wt.nameTable).forEach((t=>{for(var e=Wt.nameTable[t];e;){var r=e.name_next;o.includes(e.mount)&&Wt.destroyNode(e),e=r}})),r.mounted=null;var a=r.mount.mounts.indexOf(n);r.mount.mounts.splice(a,1)},lookup:(t,e)=>t.node_ops.lookup(t,e),mknod(t,e,r){var n=Wt.lookupPath(t,{parent:!0}).node,o=ht.basename(t);if(!o||"."===o||".."===o)throw new Wt.ErrnoError(28);var a=Wt.mayCreate(n,o);if(a)throw new Wt.ErrnoError(a);if(!n.node_ops.mknod)throw new Wt.ErrnoError(63);return n.node_ops.mknod(n,o,e,r)},create:(t,e)=>(e=void 0!==e?e:438,e&=4095,e|=32768,Wt.mknod(t,e,0)),mkdir:(t,e)=>(e=void 0!==e?e:511,e&=1023,e|=16384,Wt.mknod(t,e,0)),mkdirTree(t,e){for(var r=t.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{Wt.mkdir(n,e)}catch(t){if(20!=t.errno)throw t}}},mkdev:(t,e,r)=>("undefined"==typeof r&&(r=e,e=438),e|=8192,Wt.mknod(t,e,r)),symlink(t,e){if(!pt.resolve(t))throw new Wt.ErrnoError(44);var r=Wt.lookupPath(e,{parent:!0}).node;if(!r)throw new Wt.ErrnoError(44);var n=ht.basename(e),o=Wt.mayCreate(r,n);if(o)throw new Wt.ErrnoError(o);if(!r.node_ops.symlink)throw new Wt.ErrnoError(63);return r.node_ops.symlink(r,n,t)},rename(t,e){var r,n,o=ht.dirname(t),a=ht.dirname(e),i=ht.basename(t),s=ht.basename(e);if(r=Wt.lookupPath(t,{parent:!0}).node,n=Wt.lookupPath(e,{parent:!0}).node,!r||!n)throw new Wt.ErrnoError(44);if(r.mount!==n.mount)throw new Wt.ErrnoError(75);var u,c=Wt.lookupNode(r,i),l=pt.relative(t,a);if("."!==l.charAt(0))throw new Wt.ErrnoError(28);if("."!==(l=pt.relative(e,o)).charAt(0))throw new Wt.ErrnoError(55);try{u=Wt.lookupNode(n,s)}catch(t){}if(c!==u){var d=Wt.isDir(c.mode),h=Wt.mayDelete(r,i,d);if(h)throw new Wt.ErrnoError(h);if(h=u?Wt.mayDelete(n,s,d):Wt.mayCreate(n,s))throw new Wt.ErrnoError(h);if(!r.node_ops.rename)throw new Wt.ErrnoError(63);if(Wt.isMountpoint(c)||u&&Wt.isMountpoint(u))throw new Wt.ErrnoError(10);if(n!==r&&(h=Wt.nodePermissions(r,"w")))throw new Wt.ErrnoError(h);Wt.hashRemoveNode(c);try{r.node_ops.rename(c,n,s)}catch(t){throw t}finally{Wt.hashAddNode(c)}}},rmdir(t){var e=Wt.lookupPath(t,{parent:!0}).node,r=ht.basename(t),n=Wt.lookupNode(e,r),o=Wt.mayDelete(e,r,!0);if(o)throw new Wt.ErrnoError(o);if(!e.node_ops.rmdir)throw new Wt.ErrnoError(63);if(Wt.isMountpoint(n))throw new Wt.ErrnoError(10);e.node_ops.rmdir(e,r),Wt.destroyNode(n)},readdir(t){var e=Wt.lookupPath(t,{follow:!0}).node;if(!e.node_ops.readdir)throw new Wt.ErrnoError(54);return e.node_ops.readdir(e)},unlink(t){var e=Wt.lookupPath(t,{parent:!0}).node;if(!e)throw new Wt.ErrnoError(44);var r=ht.basename(t),n=Wt.lookupNode(e,r),o=Wt.mayDelete(e,r,!1);if(o)throw new Wt.ErrnoError(o);if(!e.node_ops.unlink)throw new Wt.ErrnoError(63);if(Wt.isMountpoint(n))throw new Wt.ErrnoError(10);e.node_ops.unlink(e,r),Wt.destroyNode(n)},readlink(t){var e=Wt.lookupPath(t).node;if(!e)throw new Wt.ErrnoError(44);if(!e.node_ops.readlink)throw new Wt.ErrnoError(28);return pt.resolve(Wt.getPath(e.parent),e.node_ops.readlink(e))},stat(t,e){var r=Wt.lookupPath(t,{follow:!e}).node;if(!r)throw new Wt.ErrnoError(44);if(!r.node_ops.getattr)throw new Wt.ErrnoError(63);return r.node_ops.getattr(r)},lstat:t=>Wt.stat(t,!0),chmod(t,e,r){var n;if(!(n="string"==typeof t?Wt.lookupPath(t,{follow:!r}).node:t).node_ops.setattr)throw new Wt.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&e|-4096&n.mode,timestamp:Date.now()})},lchmod(t,e){Wt.chmod(t,e,!0)},fchmod(t,e){var r=Wt.getStreamChecked(t);Wt.chmod(r.node,e)},chown(t,e,r,n){var o;if(!(o="string"==typeof t?Wt.lookupPath(t,{follow:!n}).node:t).node_ops.setattr)throw new Wt.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(t,e,r){Wt.chown(t,e,r,!0)},fchown(t,e,r){var n=Wt.getStreamChecked(t);Wt.chown(n.node,e,r)},truncate(t,e){if(e<0)throw new Wt.ErrnoError(28);var r;if(!(r="string"==typeof t?Wt.lookupPath(t,{follow:!0}).node:t).node_ops.setattr)throw new Wt.ErrnoError(63);if(Wt.isDir(r.mode))throw new Wt.ErrnoError(31);if(!Wt.isFile(r.mode))throw new Wt.ErrnoError(28);var n=Wt.nodePermissions(r,"w");if(n)throw new Wt.ErrnoError(n);r.node_ops.setattr(r,{size:e,timestamp:Date.now()})},ftruncate(t,e){var r=Wt.getStreamChecked(t);if(0==(2097155&r.flags))throw new Wt.ErrnoError(28);Wt.truncate(r.node,e)},utime(t,e,r){var n=Wt.lookupPath(t,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(e,r)})},open(t,e,r){if(""===t)throw new Wt.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=Wt.lookupPath(t,{follow:!(131072&e)}).node}catch(t){}}var o=!1;if(64&e)if(n){if(128&e)throw new Wt.ErrnoError(20)}else n=Wt.mknod(t,r,0),o=!0;if(!n)throw new Wt.ErrnoError(44);if(Wt.isChrdev(n.mode)&&(e&=-513),65536&e&&!Wt.isDir(n.mode))throw new Wt.ErrnoError(54);if(!o){var a=Wt.mayOpen(n,e);if(a)throw new Wt.ErrnoError(a)}512&e&&!o&&Wt.truncate(n,0),e&=-131713;var i=Wt.createStream({node:n,path:Wt.getPath(n),flags:e,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return i.stream_ops.open&&i.stream_ops.open(i),!h.logReadFiles||1&e||(Wt.readFiles||(Wt.readFiles={}),t in Wt.readFiles||(Wt.readFiles[t]=1)),i},close(t){if(Wt.isClosed(t))throw new Wt.ErrnoError(8);t.getdents&&(t.getdents=null);try{t.stream_ops.close&&t.stream_ops.close(t)}catch(t){throw t}finally{Wt.closeStream(t.fd)}t.fd=null},isClosed:t=>null===t.fd,llseek(t,e,r){if(Wt.isClosed(t))throw new Wt.ErrnoError(8);if(!t.seekable||!t.stream_ops.llseek)throw new Wt.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new Wt.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 Wt.ErrnoError(28);if(Wt.isClosed(t))throw new Wt.ErrnoError(8);if(1==(2097155&t.flags))throw new Wt.ErrnoError(8);if(Wt.isDir(t.node.mode))throw new Wt.ErrnoError(31);if(!t.stream_ops.read)throw new Wt.ErrnoError(28);var a="undefined"!=typeof o;if(a){if(!t.seekable)throw new Wt.ErrnoError(70)}else o=t.position;var i=t.stream_ops.read(t,e,r,n,o);return a||(t.position+=i),i},write(t,e,r,n,o,a){if(n<0||o<0)throw new Wt.ErrnoError(28);if(Wt.isClosed(t))throw new Wt.ErrnoError(8);if(0==(2097155&t.flags))throw new Wt.ErrnoError(8);if(Wt.isDir(t.node.mode))throw new Wt.ErrnoError(31);if(!t.stream_ops.write)throw new Wt.ErrnoError(28);t.seekable&&1024&t.flags&&Wt.llseek(t,0,2);var i="undefined"!=typeof o;if(i){if(!t.seekable)throw new Wt.ErrnoError(70)}else o=t.position;var s=t.stream_ops.write(t,e,r,n,o,a);return i||(t.position+=s),s},allocate(t,e,r){if(Wt.isClosed(t))throw new Wt.ErrnoError(8);if(e<0||r<=0)throw new Wt.ErrnoError(28);if(0==(2097155&t.flags))throw new Wt.ErrnoError(8);if(!Wt.isFile(t.node.mode)&&!Wt.isDir(t.node.mode))throw new Wt.ErrnoError(43);if(!t.stream_ops.allocate)throw new Wt.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 Wt.ErrnoError(2);if(1==(2097155&t.flags))throw new Wt.ErrnoError(2);if(!t.stream_ops.mmap)throw new Wt.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 Wt.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=Wt.open(t,e.flags),o=Wt.stat(t).size,a=new Uint8Array(o);return Wt.read(n,a,0,o,0),"utf8"===e.encoding?r=vt(a,0):"binary"===e.encoding&&(r=a),Wt.close(n),r},writeFile(t,e,r={}){r.flags=r.flags||577;var n=Wt.open(t,r.flags,r.mode);if("string"==typeof e){var o=new Uint8Array(gt(e)+1),a=wt(e,o,0,o.length);Wt.write(n,o,0,a,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");Wt.write(n,e,0,e.byteLength,void 0,r.canOwn)}Wt.close(n)},cwd:()=>Wt.currentPath,chdir(t){var e=Wt.lookupPath(t,{follow:!0});if(null===e.node)throw new Wt.ErrnoError(44);if(!Wt.isDir(e.node.mode))throw new Wt.ErrnoError(54);var r=Wt.nodePermissions(e.node,"x");if(r)throw new Wt.ErrnoError(r);Wt.currentPath=e.path},createDefaultDirectories(){Wt.mkdir("/tmp"),Wt.mkdir("/home"),Wt.mkdir("/home/web_user")},createDefaultDevices(){Wt.mkdir("/dev"),Wt.registerDevice(Wt.makedev(1,3),{read:()=>0,write:(t,e,r,n,o)=>n}),Wt.mkdev("/dev/null",Wt.makedev(1,3)),_t.register(Wt.makedev(5,0),_t.default_tty_ops),_t.register(Wt.makedev(6,0),_t.default_tty1_ops),Wt.mkdev("/dev/tty",Wt.makedev(5,0)),Wt.mkdev("/dev/tty1",Wt.makedev(6,0));var t=new Uint8Array(1024),e=0,r=()=>(0===e&&(e=ft(t).byteLength),t[--e]);Wt.createDevice("/dev","random",r),Wt.createDevice("/dev","urandom",r),Wt.mkdir("/dev/shm"),Wt.mkdir("/dev/shm/tmp")},createSpecialDirectories(){Wt.mkdir("/proc");var t=Wt.mkdir("/proc/self");Wt.mkdir("/proc/self/fd"),Wt.mount({mount(){var e=Wt.createNode(t,"fd",16895,73);return e.node_ops={lookup(t,e){var r=+e,n=Wt.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?Wt.createDevice("/dev","stdin",h.stdin):Wt.symlink("/dev/tty","/dev/stdin"),h.stdout?Wt.createDevice("/dev","stdout",null,h.stdout):Wt.symlink("/dev/tty","/dev/stdout"),h.stderr?Wt.createDevice("/dev","stderr",null,h.stderr):Wt.symlink("/dev/tty1","/dev/stderr"),Wt.open("/dev/stdin",0),Wt.open("/dev/stdout",1),Wt.open("/dev/stderr",1)},ensureErrnoError(){Wt.ErrnoError||(Wt.ErrnoError=function(t,e){this.name="ErrnoError",this.node=e,this.setErrno=function(t){this.errno=t},this.setErrno(t),this.message="FS error"},Wt.ErrnoError.prototype=new Error,Wt.ErrnoError.prototype.constructor=Wt.ErrnoError,[44].forEach((t=>{Wt.genericErrors[t]=new Wt.ErrnoError(t),Wt.genericErrors[t].stack="<generic error, no stack>"})))},staticInit(){Wt.ensureErrnoError(),Wt.nameTable=new Array(4096),Wt.mount(kt,{},"/"),Wt.createDefaultDirectories(),Wt.createDefaultDevices(),Wt.createSpecialDirectories(),Wt.filesystems={MEMFS:kt}},init(t,e,r){Wt.init.initialized=!0,Wt.ensureErrnoError(),h.stdin=t||h.stdin,h.stdout=e||h.stdout,h.stderr=r||h.stderr,Wt.createStandardStreams()},quit(){Wt.init.initialized=!1;for(var t=0;t<Wt.streams.length;t++){var e=Wt.streams[t];e&&Wt.close(e)}},findObject(t,e){var r=Wt.analyzePath(t,e);return r.exists?r.object:null},analyzePath(t,e){try{t=(n=Wt.lookupPath(t,{follow:!e})).path}catch(t){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=Wt.lookupPath(t,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=ht.basename(t),n=Wt.lookupPath(t,{follow:!e}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(t){r.error=t.errno}return r},createPath(t,e,r,n){t="string"==typeof t?t:Wt.getPath(t);for(var o=e.split("/").reverse();o.length;){var a=o.pop();if(a){var i=ht.join2(t,a);try{Wt.mkdir(i)}catch(t){}t=i}}return i},createFile(t,e,r,n,o){var a=ht.join2("string"==typeof t?t:Wt.getPath(t),e),i=Mt(n,o);return Wt.create(a,i)},createDataFile(t,e,r,n,o,a){var i=e;t&&(t="string"==typeof t?t:Wt.getPath(t),i=e?ht.join2(t,e):t);var s=Mt(n,o),u=Wt.create(i,s);if(r){if("string"==typeof r){for(var c=new Array(r.length),l=0,d=r.length;l<d;++l)c[l]=r.charCodeAt(l);r=c}Wt.chmod(u,146|s);var h=Wt.open(u,577);Wt.write(h,r,0,r.length,0,a),Wt.close(h),Wt.chmod(u,s)}return u},createDevice(t,e,r,n){var o=ht.join2("string"==typeof t?t:Wt.getPath(t),e),a=Mt(!!r,!!n);Wt.createDevice.major||(Wt.createDevice.major=64);var i=Wt.makedev(Wt.createDevice.major++,0);return Wt.registerDevice(i,{open(t){t.seekable=!1},close(t){n&&n.buffer&&n.buffer.length&&n(10)},read(t,e,n,o,a){for(var i=0,s=0;s<o;s++){var u;try{u=r()}catch(t){throw new Wt.ErrnoError(29)}if(void 0===u&&0===i)throw new Wt.ErrnoError(6);if(null==u)break;i++,e[n+s]=u}return i&&(t.node.timestamp=Date.now()),i},write(t,e,r,o,a){for(var i=0;i<o;i++)try{n(e[r+i])}catch(t){throw new Wt.ErrnoError(29)}return o&&(t.node.timestamp=Date.now()),i}}),Wt.mkdev(o,a,i)},forceLoadFile(t){if(t.isDevice||t.isFolder||t.link||t.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!f)throw new Error("Cannot load without read() or XMLHttpRequest.");try{t.contents=bt(f(t.url),!0),t.usedBytes=t.contents.length}catch(t){throw new Wt.ErrnoError(29)}},createLazyFile(t,r,n,o,a){function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(t){if(!(t>this.length-1||t<0)){var e=t%this.chunkSize,r=t/this.chunkSize|0;return this.getter(r)[e]}},i.prototype.setDataGetter=function(t){this.getter=t},i.prototype.cacheLength=function(){var t=new XMLHttpRequest;if(t.open("HEAD",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,a=(e=t.getResponseHeader("Content-Encoding"))&&"gzip"===e,i=1048576;o||(i=r);var s=this;s.setDataGetter((t=>{var e=t*i,o=(t+1)*i-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!==i&&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]})),!a&&r||(i=r=1,r=this.getter(0).length,i=r,k("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=r,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){var s=new i;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=Wt.createFile(t,r,u,o,a);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 a=t.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s<i;s++)e[r+s]=a[o+s];else for(s=0;s<i;s++)e[r+s]=a.get(o+s);return i}return Object.keys(c.stream_ops).forEach((t=>{var e=c.stream_ops[t];l[t]=function(){return Wt.forceLoadFile(c),e.apply(null,arguments)}})),l.read=(t,e,r,n,o)=>(Wt.forceLoadFile(c),d(t,e,r,n,o)),l.mmap=(t,r,n,o,a)=>{Wt.forceLoadFile(c);var i=Et(r);if(!i)throw new Wt.ErrnoError(48);return d(t,e(),i,r,n),{ptr:i,allocated:!0}},c.stream_ops=l,c}},Ct=(t,e)=>t?vt(o(),t,e):"",Ft={DEFAULT_POLLMASK:5,calculateAt(t,e,r){if(ht.isAbs(e))return e;var n;if(n=-100===t?Wt.cwd():Ft.getStreamFromFD(t).path,0==e.length){if(!r)throw new Wt.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(Wt.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(),a=n.mtime.getTime(),i=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(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+56>>2]=J[0],s()[r+60>>2]=J[1],u()[r+64>>2]=a%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+72>>2]=J[0],s()[r+76>>2]=J[1],u()[r+80>>2]=i%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,a){if(!Wt.isFile(e.node.mode))throw new Wt.ErrnoError(43);if(2&n)return 0;var i=o().slice(t,t+r);Wt.msync(e,i,a,r,n)},varargs:void 0,get(){var t=s()[Ft.varargs>>2];return Ft.varargs+=4,t},getp:()=>Ft.get(),getStr:t=>Ct(t),getStreamFromFD:t=>Wt.getStreamChecked(t)};function St(t){if(w)return Ar(0,1,t);F=t,Y()||(jt.terminateAllThreads(),h.onExit&&h.onExit(t),I=!0),g(t,new ut(t))}var Pt=(t,e)=>{if(F=t,w)throw At(t),"unwind";St(t)},$t=t=>{if(t instanceof ut||"unwind"==t)return F;g(1,t)},jt={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],pthreads:{},init(){w?jt.initWorker():jt.initMainThread()},initMainThread(){for(var t=Math.min(4,Math.max(1,navigator.hardwareConcurrency-1));t--;)jt.allocateUnusedWorker();B((()=>{et(),jt.loadWasmModuleToAllWorkers((()=>rt()))}))},initWorker(){C=!1},setExitStatus:t=>{F=t},terminateAllThreads__deps:["$terminateWorker"],terminateAllThreads:()=>{for(var t of jt.runningWorkers)ct(t);for(var t of jt.unusedWorkers)ct(t);jt.unusedWorkers=[],jt.runningWorkers=[],jt.pthreads=[]},returnWorkerToPool:t=>{var e=t.pthread_ptr;delete jt.pthreads[e],jt.unusedWorkers.push(t),jt.runningWorkers.splice(jt.runningWorkers.indexOf(t),1),t.pthread_ptr=0,jn(e)},receiveObjectTransfer(t){},threadInitTLS(){jt.tlsInitFunctions.forEach((t=>t()))},loadWasmModuleToWorker:t=>new Promise((e=>{t.onmessage=r=>{var n=r.data,o=n.cmd;if(n.targetThread&&n.targetThread!=Wn()){var a=jt.pthreads[n.targetThread];a?a.postMessage(n,n.transferList):T(`Internal error! Worker sent a message "${o}" to target pthread ${n.targetThread}, but that thread no longer exists!`)}else{var i;"checkMailbox"===o?jr():"spawnThread"===o?dt(n):"cleanupThread"===o?lt(n.thread):"killThread"===o?(t=>{var e=jt.pthreads[t];delete jt.pthreads[t],ct(e),jn(t),jt.runningWorkers.splice(jt.runningWorkers.indexOf(e),1),e.pthread_ptr=0})(n.thread):"cancelThread"===o?(i=n.thread,jt.pthreads[i].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&&T(`worker sent an unknown command ${o}`)}},t.onerror=t=>{throw T(`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:W})})),loadWasmModuleToAllWorkers(t){if(w)return t();Promise.all(jt.unusedWorkers.map(jt.loadWasmModuleToWorker)).then(t)},allocateUnusedWorker(){var t,e=_("ScanbotSDK.Asm-simd-threads.worker.js");t=new Worker(e),jt.unusedWorkers.push(t)},getNewWorker:()=>(0==jt.unusedWorkers.length&&(jt.allocateUnusedWorker(),jt.loadWasmModuleToWorker(jt.unusedWorkers[0])),jt.unusedWorkers.pop())};h.PThread=jt;var Dt=t=>{for(;t.length>0;)t.shift()(h)};function At(t){if(w)return Ar(1,0,t);Pt(t)}h.establishStackSpace=()=>{var t=Wn(),e=s()[t+52>>2],r=s()[t+56>>2];Rn(e,e-r),Vn(e)};var xt=t=>O.get(t);h.invokeEntryPoint=(t,e)=>{!function(t){Y()?jt.setExitStatus(t):Dn(t)}(xt(t)(e))};var Rt=t=>{jt.tlsInitFunctions.push(t)},It=[],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 Cn(0),0;var r=new Ot(e);r.set_adjusted_ptr(e);var n=r.get_type();if(!n)return Cn(0),e;for(var o in t){var a=t[o];if(0===a||a===n)break;var i=r.ptr+16;if(zn(a,n,i))return Cn(a),e}return Cn(n),e},zt=()=>{var t=It.pop();t||nt("no exception to throw");var e=t.excPtr;throw t.get_rethrown()||(It.push(t),t.set_rethrown(!0),t.set_caught(!1),Vt++),Zt=e};function Gt(t,e,r,n){return w?Ar(2,1,t,e,r,n):Ut(t,e,r,n)}var Ut=(t,e,r,n)=>{if("undefined"==typeof SharedArrayBuffer)return T("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 a={startRoutine:r,pthread_ptr:t,arg:n,transferList:o};return w?(a.cmd="spawnThread",postMessage(a,o),0):dt(a)};function Lt(t,e,r,n,o){if(w)return Ar(3,1,t,e,r,n,o);try{for(var a=0,i=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,y=0,g=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<t;k++){var T=1<<k%32;if(E(k,b,_,T)){var M=Ft.getStreamFromFD(k),W=Ft.DEFAULT_POLLMASK;if(M.stream_ops.poll){var C=-1;o&&(C=1e3*((e?s()[o>>2]:0)+(e?s()[o+8>>2]:0)/1e6)),W=M.stream_ops.poll(M,C)}1&W&&E(k,i,u,T)&&(k<32?f|=T:p|=T,a++),4&W&&E(k,c,l,T)&&(k<32?m|=T:v|=T,a++),2&W&&E(k,d,h,T)&&(k<32?y|=T:g|=T,a++)}}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]=y,s()[n+4>>2]=g),a}catch(t){if("undefined"==typeof Wt||"ErrnoError"!==t.name)throw t;return-t.errno}}function Yt(t,e){if(w)return Ar(4,1,t,e);try{return t=Ft.getStr(t),Wt.chmod(t,e),0}catch(t){if("undefined"==typeof Wt||"ErrnoError"!==t.name)throw t;return-t.errno}}function Xt(t,e){if(w)return Ar(5,1,t,e);try{return Wt.fchmod(t,e),0}catch(t){if("undefined"==typeof Wt||"ErrnoError"!==t.name)throw t;return-t.errno}}function Bt(t,e,r){if(w)return Ar(6,1,t,e,r);Ft.varargs=r;try{var n=Ft.getStreamFromFD(t);switch(e){case 0:if((o=Ft.get())<0)return-28;for(;Wt.streams[o];)o++;return Wt.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=Ft.get();return n.flags|=o,0;case 5:return o=Ft.getp(),a()[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return i=28,s()[Mn()>>2]=i,-1}}catch(t){if("undefined"==typeof Wt||"ErrnoError"!==t.name)throw t;return-t.errno}var i}function Ht(t,e){if(w)return Ar(7,1,t,e);try{var r=Ft.getStreamFromFD(t);return Ft.doStat(Wt.stat,r.path,e)}catch(t){if("undefined"==typeof Wt||"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 Ar(8,1,t,e,r);var n=Kt(e,r);try{return isNaN(n)?61:(Wt.ftruncate(t,n),0)}catch(t){if("undefined"==typeof Wt||"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 Ar(9,1,t,e);try{if(0===e)return-28;var r=Wt.cwd(),n=gt(r)+1;return e<n?-68:(Qt(r,t,e),n)}catch(t){if("undefined"==typeof Wt||"ErrnoError"!==t.name)throw t;return-t.errno}}function te(t,r,n){if(w)return Ar(10,1,t,r,n);try{var o=Ft.getStreamFromFD(t);o.getdents||(o.getdents=Wt.readdir(o.path));for(var i=280,u=0,c=Wt.llseek(o,0,1),l=Math.floor(c/i);l<o.getdents.length&&u+i<=n;){var d,h,f=o.getdents[l];if("."===f)d=o.node.id,h=4;else if(".."===f)d=Wt.lookupPath(o.path,{parent:!0}).node.id,h=4;else{var p=Wt.lookupNode(o.node,f);d=p.id,h=Wt.isChrdev(p.mode)?2:Wt.isDir(p.mode)?4:Wt.isLink(p.mode)?10:8}J=[d>>>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)*i>>>0,(K=(l+1)*i,+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],a()[r+u+16>>1]=280,e()[r+u+18>>0]=h,Qt(f,r+u+19,256),u+=i,l+=1}return Wt.llseek(o,l*i,0),u}catch(t){if("undefined"==typeof Wt||"ErrnoError"!==t.name)throw t;return-t.errno}}function ee(t,r,n){if(w)return Ar(11,1,t,r,n);Ft.varargs=n;try{var o=Ft.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 i=o.tty.ops.ioctl_tcgets(o),u=Ft.getp();s()[u>>2]=i.c_iflag||0,s()[u+4>>2]=i.c_oflag||0,s()[u+8>>2]=i.c_cflag||0,s()[u+12>>2]=i.c_lflag||0;for(var c=0;c<32;c++)e()[u+c+17>>0]=i.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=Ft.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=Ft.getp(),s()[u>>2]=0,0):-59;case 21520:return o.tty?-28:-59;case 21531:return u=Ft.getp(),Wt.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=Ft.getp(),a()[u>>1]=m[0],a()[u+2>>1]=m[1]}return 0;default:return-28}}catch(t){if("undefined"==typeof Wt||"ErrnoError"!==t.name)throw t;return-t.errno}}function re(t,e){if(w)return Ar(12,1,t,e);try{return t=Ft.getStr(t),Ft.doStat(Wt.lstat,t,e)}catch(t){if("undefined"==typeof Wt||"ErrnoError"!==t.name)throw t;return-t.errno}}function ne(t,e,r){if(w)return Ar(13,1,t,e,r);try{return e=Ft.getStr(e),e=Ft.calculateAt(t,e),"/"===(e=ht.normalize(e))[e.length-1]&&(e=e.substr(0,e.length-1)),Wt.mkdir(e,r,0),0}catch(t){if("undefined"==typeof Wt||"ErrnoError"!==t.name)throw t;return-t.errno}}function oe(t,e,r,n){if(w)return Ar(14,1,t,e,r,n);try{e=Ft.getStr(e);var o=256&n,a=4096&n;return n&=-6401,e=Ft.calculateAt(t,e,a),Ft.doStat(o?Wt.lstat:Wt.stat,e,r)}catch(t){if("undefined"==typeof Wt||"ErrnoError"!==t.name)throw t;return-t.errno}}function ae(t,e,r,n){if(w)return Ar(15,1,t,e,r,n);Ft.varargs=n;try{e=Ft.getStr(e),e=Ft.calculateAt(t,e);var o=n?Ft.get():0;return Wt.open(e,r,o).fd}catch(t){if("undefined"==typeof Wt||"ErrnoError"!==t.name)throw t;return-t.errno}}function ie(t,r,n,o){if(w)return Ar(16,1,t,r,n,o);try{if(r=Ft.getStr(r),r=Ft.calculateAt(t,r),o<=0)return-28;var a=Wt.readlink(r),i=Math.min(o,gt(a)),s=e()[n+i];return Qt(a,n,o+1),e()[n+i]=s,i}catch(t){if("undefined"==typeof Wt||"ErrnoError"!==t.name)throw t;return-t.errno}}function se(t){if(w)return Ar(17,1,t);try{return t=Ft.getStr(t),Wt.rmdir(t),0}catch(t){if("undefined"==typeof Wt||"ErrnoError"!==t.name)throw t;return-t.errno}}function ue(t,e){if(w)return Ar(18,1,t,e);try{return t=Ft.getStr(t),Ft.doStat(Wt.stat,t,e)}catch(t){if("undefined"==typeof Wt||"ErrnoError"!==t.name)throw t;return-t.errno}}function ce(t,e){if(w)return Ar(19,1,t,e);try{return t=Ft.getStr(t),e=Ft.getStr(e),Wt.symlink(t,e),0}catch(t){if("undefined"==typeof Wt||"ErrnoError"!==t.name)throw t;return-t.errno}}function le(t,e,r){if(w)return Ar(20,1,t,e,r);try{return e=Ft.getStr(e),e=Ft.calculateAt(t,e),0===r?Wt.unlink(e):512===r?Wt.rmdir(e):nt("Invalid flags passed to unlinkat"),0}catch(t){if("undefined"==typeof Wt||"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,ye=t=>{throw new ve(t)},ge=void 0,we=t=>{throw new ge(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<t.length;++o)_e(t[o],n[o])}t.forEach((function(t){me[t]=e}));var o=new Array(e.length),a=[],i=0;e.forEach(((t,e)=>{pe.hasOwnProperty(t)?o[e]=pe[t]:(a.push(t),fe.hasOwnProperty(t)||(fe[t]=[]),fe[t].push((()=>{o[e]=pe[t],++i===a.length&&n(o)})))})),0===a.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||ye(`type "${n}" must have a positive integer typeid pointer`),pe.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;ye(`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=>{ye(t.$$.ptrType.registeredClass.name+" instance already deleted")},Te=!1,Me=t=>{},We=t=>{t.count.value-=1,0===t.count.value&&(t=>{t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)})(t)},Ce=(t,e,r)=>{if(e===r)return t;if(void 0===r.baseClass)return null;var n=Ce(t,e,r.baseClass);return null===n?null:r.downcast(n)},Fe={},Se=()=>Object.keys(xe).length,Pe=()=>{var t=[];for(var e in xe)xe.hasOwnProperty(e)&&t.push(xe[e]);return t},$e=[],je=()=>{for(;$e.length;){var t=$e.pop();t.$$.deleteScheduled=!1,t.delete()}},De=void 0,Ae=t=>{De=t,$e.length&&De&&De(je)},xe={},Re=(t,e)=>(e=((t,e)=>{for(void 0===e&&ye("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e})(t,e),xe[e]),Ie=(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=Re(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?Ie(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):Ie(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var a,i=this.registeredClass.getActualType(e),s=Fe[i];if(!s)return o.call(this);a=this.isConst?s.constPointerType:s.pointerType;var u=Ce(e,this.registeredClass,a.registeredClass);return null===u?o.call(this):this.isSmartPointer?Ie(a.registeredClass.instancePrototype,{ptrType:a,ptr:u,smartPtrType:this,smartPtr:t}):Ie(a.registeredClass.instancePrototype,{ptrType:a,ptr:u})}var Ze=t=>"undefined"==typeof FinalizationRegistry?(Ze=t=>t,t):(Te=new FinalizationRegistry((t=>{We(t.$$)})),Ze=t=>{var e=t.$$;if(e.smartPtr){var r={$$:e};Te.register(t,r,t)}return t},Me=t=>Te.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&&ye("Object already scheduled for deletion"),Me(this),We(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&&ye("Object already scheduled for deletion"),$e.push(this),1===$e.length&&De&&De(je),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 Ye(t,e){return{[t=Le(t)]:function(){return e.apply(this,arguments)}}[t]}var Xe=(t,e,r)=>{if(void 0===t[e].overloadTable){var n=t[e];t[e]=function(){return t[e].overloadTable.hasOwnProperty(arguments.length)||ye(`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])&&ye(`Cannot register public name '${t}' twice`),Xe(h,t,t),h.hasOwnProperty(r)&&ye(`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,a,i,s){this.name=t,this.constructor=e,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=a,this.upcast=i,this.downcast=s,this.pureVirtualFunctions=[]}var Ke=(t,e,r)=>{for(;e!==r;)e.upcast||ye(`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&&ye(`null is not a valid ${this.name}`),0;e.$$||ye(`Cannot pass "${br(e)}" as a ${this.name}`),e.$$.ptr||ye(`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&&ye(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),null!==t&&t.push(this.rawDestructor,r),r):0;e.$$||ye(`Cannot pass "${br(e)}" as a ${this.name}`),e.$$.ptr||ye(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&e.$$.ptrType.isConst&&ye(`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&&ye("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:e.$$.smartPtrType===this?r=e.$$.smartPtr:ye(`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,gr.toHandle((()=>o.delete()))),null!==t&&t.push(this.rawDestructor,r)}break;default:ye("Unsupporting sharing policy")}return r}function qe(t,e){if(null===e)return this.isReference&&ye(`null is not a valid ${this.name}`),0;e.$$||ye(`Cannot pass "${br(e)}" as a ${this.name}`),e.$$.ptr||ye(`Cannot pass deleted object as a pointer of type ${this.name}`),e.$$.ptrType.isConst&&ye(`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,a,i,s,u,c,l){this.name=t,this.registeredClass=e,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=a,this.sharingPolicy=i,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 ar=(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)},ir=(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,a=(t=he(t)).includes("j")?(r=t,n=e,o=[],function(){return o.length=0,Object.assign(o,arguments),ir(r,n,o)}):xt(e);return"function"!=typeof a&&ye(`unknown function pointer with signature ${t}: ${e}`),a},ur=void 0,cr=t=>{var e=Sn(t),r=he(e);return Tn(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,a){var i=e.length;i<2&&ye("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var s=null!==e[1]&&null!==r,u=!1,c=1;c<e.length;++c)if(null!==e[c]&&void 0===e[c].destructorFunction){u=!0;break}var l="void"!==e[0].name,d=i-2,h=new Array(d),f=[],p=[];return function(){var r;arguments.length!==d&&ye(`function ${t} called with ${arguments.length} arguments, expected ${d}`),p.length=0,f.length=s?2:1,f[0]=o,s&&(r=e[1].toWireType(p,this),f[1]=r);for(var a=0;a<d;++a)h[a]=e[a+2].toWireType(p,arguments[a]),f.push(h[a]);var i=n.apply(null,f);function c(t){if(u)dr(p);else for(var n=s?1:2;n<e.length;n++){var o=1===n?r:h[n-2];null!==e[n].destructorFunction&&e[n].destructorFunction(o)}if(l)return e[0].fromWireType(t)}return c(i)}}var fr=(t,e)=>{for(var r=[],n=0;n<t;n++)r.push(u()[e+4*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)},yr=()=>{for(var t=0,e=mr.reserved;e<mr.allocated.length;++e)void 0!==mr.allocated[e]&&++t;return t},gr={toValue:t=>(t||ye("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!=S.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=>a()[t>>1]:t=>i()[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,Tr=(t,e)=>{for(var r=t,n=r>>1,s=n+e/2;!(n>=s)&&i()[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=a()[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,i=0;i<o;++i){var s=t.charCodeAt(i);a()[e>>1]=s,e+=2}return a()[e>>1]=0,e-n},Wr=t=>2*t.length,Cr=(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 a=o-65536;n+=String.fromCharCode(55296|a>>10,56320|1023&a)}else n+=String.fromCharCode(o)}return n},Fr=(t,e,r)=>{if(void 0===r&&(r=2147483647),r<4)return 0;for(var n=e,o=n+r-4,a=0;a<t.length;++a){var i=t.charCodeAt(a);if(i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&t.charCodeAt(++a)),s()[e>>2]=i,(e+=4)+4>o)break}return s()[e>>2]=0,e-n},Sr=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);n>=55296&&n<=57343&&++r,e+=4}return e},Pr=t=>{if(!I)try{t(),(()=>{if(!Y())try{w?Dn(F):Pt(F)}catch(t){$t(t)}})()}catch(t){$t(t)}},$r=t=>{if("function"==typeof Atomics.waitAsync){Atomics.waitAsync(s(),t>>2,t).value.then(jr);var e=t+128;Atomics.store(s(),e>>2,1)}};h.__emscripten_thread_mailbox_await=$r;var jr=()=>{var t=Wn();t&&($r(t),Pr((()=>An())))};h.checkMailbox=jr;var Dr=t=>{var e=In(),r=t();return Vn(e),r},Ar=function(t,e){var r=arguments.length-2,n=arguments;return Dr((()=>{for(var o=r,a=Zn(8*o),i=a>>3,s=0;s<r;s++){var u=n[2+s];c()[i+s]=u}return $n(t,o,a,e)}))},xr=[],Rr=(t,e)=>{var r=pe[t];return void 0===r&&ye(e+" has unknown type "+cr(t)),r},Ir={},Vr=t=>{var e=Ir[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,a,i,c){if(w)return Ar(21,1,t,e,r,n,o,a,i,c);var l=Kt(o,a);try{if(isNaN(l))return 61;var d=Ft.getStreamFromFD(n),h=Wt.mmap(d,t,l,e,r),f=h.ptr;return s()[i>>2]=h.allocated,u()[c>>2]=f,0}catch(t){if("undefined"==typeof Wt||"ErrnoError"!==t.name)throw t;return-t.errno}}function Yr(t,e,r,n,o,a,i){if(w)return Ar(22,1,t,e,r,n,o,a,i);var s=Kt(a,i);try{if(isNaN(s))return 61;var u=Ft.getStreamFromFD(o);2&r&&Ft.doMsync(t,u,e,n,s),Wt.munmap(u)}catch(t){if("undefined"==typeof Wt||"ErrnoError"!==t.name)throw t;return-t.errno}}var Xr,Br=t=>{var e=gt(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)};Xr=()=>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",_:y||"./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 Ar(23,1,t,r);var n=0;return tn().forEach(((o,a)=>{var i=r+n;u()[t+4*a>>2]=i,((t,r)=>{for(var n=0;n<t.length;++n)e()[r++>>0]=t.charCodeAt(n);e()[r>>0]=0})(o,i),n+=o.length+1})),0},rn=function(t,e){if(w)return Ar(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 Ar(25,1,t);try{var e=Ft.getStreamFromFD(t);return Wt.close(e),0}catch(t){if("undefined"==typeof Wt||"ErrnoError"!==t.name)throw t;return t.errno}}function on(t,r){if(w)return Ar(26,1,t,r);try{var n=Ft.getStreamFromFD(t),o=n.tty?2:Wt.isDir(n.mode)?3:Wt.isLink(n.mode)?7:4;return e()[r>>0]=o,a()[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 Wt||"ErrnoError"!==t.name)throw t;return t.errno}}function an(t,r,n,o){if(w)return Ar(27,1,t,r,n,o);try{var a=((t,r,n,o)=>{for(var a=0,i=0;i<n;i++){var s=u()[r>>2],c=u()[r+4>>2];r+=8;var l=Wt.read(t,e(),s,c,o);if(l<0)return-1;if(a+=l,l<c)break;"undefined"!=typeof o&&(o+=l)}return a})(Ft.getStreamFromFD(t),r,n);return u()[o>>2]=a,0}catch(t){if("undefined"==typeof Wt||"ErrnoError"!==t.name)throw t;return t.errno}}function sn(t,e,r,n,o){if(w)return Ar(28,1,t,e,r,n,o);var a=Kt(e,r);try{if(isNaN(a))return 61;var i=Ft.getStreamFromFD(t);return Wt.llseek(i,a,n),J=[i.position>>>0,(K=i.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],i.getdents&&0===a&&0===n&&(i.getdents=null),0}catch(t){if("undefined"==typeof Wt||"ErrnoError"!==t.name)throw t;return t.errno}}function un(t,r,n,o){if(w)return Ar(29,1,t,r,n,o);try{var a=((t,r,n,o)=>{for(var a=0,i=0;i<n;i++){var s=u()[r>>2],c=u()[r+4>>2];r+=8;var l=Wt.write(t,e(),s,c,o);if(l<0)return-1;a+=l,"undefined"!=typeof o&&(o+=l)}return a})(Ft.getStreamFromFD(t),r,n);return u()[o>>2]=a,0}catch(t){if("undefined"==typeof Wt||"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 a=u()[o+40>>2],i={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:a?Ct(a):""},c=Ct(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.length<e;)n=r[0]+n;return n}function m(t,e){return p(t,e,"0")}function v(t,e){function r(t){return t<0?-1:t>0?1:0}var n;return 0===(n=r(t.getFullYear()-e.getFullYear()))&&0===(n=r(t.getMonth()-e.getMonth()))&&(n=r(t.getDate()-e.getDate())),n}function y(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 g(t){var e=((t,e)=>{for(var r=new Date(t.getTime());e>0;){var n=zr(r.getFullYear()),o=r.getMonth(),a=(n?cn:ln)[o];if(!(e>a-r.getDate()))return r.setDate(r.getDate()+e),r;e-=a-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=y(r),a=y(n);return v(o,e)<=0?v(a,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=>g(t).toString().substring(2),"%G":t=>g(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](i)));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;jt.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=Wt.nextInode++,this.name=e,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},yn=365,gn=146;Object.defineProperties(vn.prototype,{read:{get:function(){return(this.mode&yn)===yn},set:function(t){t?this.mode|=yn:this.mode&=-366}},write:{get:function(){return(this.mode&gn)===gn},set:function(t){t?this.mode|=gn:this.mode&=-147}},isFolder:{get:function(){return Wt.isDir(this.mode)}},isDevice:{get:function(){return Wt.isChrdev(this.mode)}}}),Wt.FSNode=vn,Wt.createPreloadedFile=(t,e,r,n,o,a,i,s,u,c)=>{var l=e?pt.resolve(ht.join2(t,e)):t;function d(r){function d(r){c&&c(),s||Wt.createDataFile(t,e,r,n,o,u),a&&a(),rt()}((t,e,r,n)=>{"undefined"!=typeof Browser&&Browser.init();var o=!1;return Tt.forEach((a=>{o||a.canHandle(e)&&(a.handle(t,e,r,n),o=!0)})),o})(r,l,d,(()=>{i&&i(),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)),i):d(r)},Wt.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"}},ge=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=Se,h.getLiveInheritedInstances=Pe,h.flushPendingDeletes=je,h.setDelayFunction=Ae,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=Ye(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=yr;var wn,bn=[St,At,Gt,Lt,Yt,Xt,Bt,Ht,Jt,qt,te,ee,re,ne,oe,ae,ie,se,ue,ce,le,Lr,Yr,en,rn,nn,on,an,sn,un],_n={m:(t,e,r,n)=>{nt(`Assertion failed: ${Ct(t)}, at: `+[e?Ct(e):"unknown filename",r,n?Ct(n):"unknown function"])},u:t=>{var e=new Ot(t);return e.get_caught()||(e.set_caught(!0),Vt--),e.set_rethrown(!1),It.push(e),Nn(e.excPtr),e.get_exception_ptr()},Gb:()=>{if(!It.length)return 0;var t=It[It.length-1];return Nn(t.excPtr),t.excPtr},w:()=>{xn(0,0);var t=It.pop();On(t.excPtr),Zt=0},b:()=>Nt([]),i:t=>Nt([t]),q:(t,e)=>Nt([t,e]),ka:zt,Eb:t=>{if(t){var e=new Ot(t);It.push(e),e.set_rethrown(!0),zt()}},t:(t,e,r)=>{throw new Ot(t).init(e,r),Vt++,Zt=t},Hb:()=>Vt,Ub:t=>{Pn(t,!1,1,!0,4194304,!1),jt.threadInitTLS()},Ba:t=>{w?postMessage({cmd:"cleanupThread",thread:t}):lt(t)},Qb:Ut,c:t=>{throw Zt||(Zt=t),Zt},Nb:Lt,xb:Yt,yb:Xt,Fa:Bt,$b:Ht,hb:Jt,Bb:qt,zb:te,ac:ee,Yb:re,Sb:ne,Zb:oe,Ga:ae,Ab:ie,Ob:se,_b:ue,wb:ce,Pb:le,qb:(t,e,r,n,o)=>{},Ja:(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})},W:(t,e,r,n,o,a,i,s,u,c,l,d,h)=>{l=he(l),a=sr(o,a),s&&(s=sr(i,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 i=Ye(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:i}});i.prototype=u;var d=new He(l,i,u,h,r,a,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 Fe[t]={pointerType:m,constPointerType:v},ar(f,i),[p,m,v]}))},V:(t,e,r,n,o,a,i,s)=>{var u=fr(r,n);e=he(e),a=sr(o,a),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):(Xe(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,a,i);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,a,i,s,u)=>{var c=fr(r,n);e=he(e),a=sr(o,a),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):(Xe(u,e,n),u[e].overloadTable[r-2]=o),be([],c,(function(o){var s=hr(n,o,t,a,i);return void 0===u[e].overloadTable?(s.argCount=r-2,u[e]=s):u[e].overloadTable[r-2]=s,[]})),[]}))},ec:(t,e)=>{_e(t,{name:e=he(e),fromWireType:t=>{var e=gr.toValue(t);return vr(t),e},toWireType:(t,e)=>gr.toHandle(e),argPackAdvance:8,readValueFromPointer:wr,destructorFunction:null})},Ia:(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,a,i)=>{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 ar(t,hr(t,n,null,o,a),e-1),[]}))},N:(t,e,r,n,o)=>{e=he(e),-1===o&&(o=4294967295);var a=t=>t;if(0===n){var i=32-8*r;a=t=>t<<i>>>i}var s=e.includes("unsigned");_e(t,{name:e,fromWireType:a,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})},F:(t,r,n)=>{var o=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function a(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:a,argPackAdvance:8,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})},Ha:(t,e)=>{var r="std::string"===(e=he(e));_e(t,{name:e,fromWireType:t=>{var e,n=u()[t>>2],a=t+4;if(r)for(var i=a,s=0;s<=n;++s){var c=a+s;if(s==n||0==o()[c]){var l=Ct(i,c-i);void 0===e?e=l:(e+=String.fromCharCode(0),e+=l),i=c+1}}else{var d=new Array(n);for(s=0;s<n;++s)d[s]=String.fromCharCode(o()[a+s]);e=d.join("")}return Tn(t),e},toWireType:(t,e)=>{var n;e instanceof ArrayBuffer&&(e=new Uint8Array(e));var a="string"==typeof e;a||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array||ye("Cannot pass non-string to std::string"),n=r&&a?gt(e):e.length;var i=kn(4+n+1),s=i+4;if(u()[i>>2]=n,r&&a)Qt(e,s,n+1);else if(a)for(var c=0;c<n;++c){var l=e.charCodeAt(c);l>255&&(Tn(s),ye("String has UTF-16 code units that do not fit in 8 bits")),o()[s+c]=l}else for(c=0;c<n;++c)o()[s+c]=e[c];return null!==t&&t.push(Tn,i),i},argPackAdvance:8,readValueFromPointer:tr,destructorFunction:t=>Tn(t)})},ta:(t,e,r)=>{var n,o,a,s,c;r=he(r),2===e?(n=Tr,o=Mr,s=Wr,a=()=>i(),c=1):4===e&&(n=Cr,o=Fr,s=Sr,a=()=>u(),c=2),_e(t,{name:r,fromWireType:t=>{for(var r,o=u()[t>>2],i=a(),s=t+4,l=0;l<=o;++l){var d=t+4+l*e;if(l==o||0==i[d>>c]){var h=n(s,d-s);void 0===r?r=h:(r+=String.fromCharCode(0),r+=h),s=d+e}}return Tn(t),r},toWireType:(t,n)=>{"string"!=typeof n&&ye(`Cannot pass non-string to C++ string type ${r}`);var a=s(n),i=kn(4+a+e);return u()[i>>2]=a>>c,o(n,i+4,a+e),null!==t&&t.push(Tn,i),i},argPackAdvance:8,readValueFromPointer:wr,destructorFunction:t=>Tn(t)})},Ka:(t,e)=>{_e(t,{isVoid:!0,name:e=he(e),argPackAdvance:0,fromWireType:()=>{},toWireType:(t,e)=>{}})},dc:()=>!0,Lb:(t,e,r)=>{if(t==e)setTimeout((()=>jr()));else if(w)postMessage({targetThread:t,cmd:"checkMailbox"});else{var n=jt.pthreads[t];if(!n)return;n.postMessage({cmd:"checkMailbox"})}},Rb:(t,e,r,n)=>{xr.length=r;for(var o=n>>3,a=0;a<r;a++)xr[a]=c()[o+a];var i=t<0?st[-t-1]:bn[t];jt.currentProxiedOperationCallerThread=e;var s=i.apply(null,xr);return jt.currentProxiedOperationCallerThread=0,s},Tb:$r,cc:t=>{},Ib:()=>{throw 1/0},Z:(t,e,r)=>{t=gr.toValue(t),e=Rr(e,"emval::as");var n=[],o=gr.toHandle(n);return u()[r>>2]=o,e.toWireType(n,t)},fa:(t,e,r,n,o)=>(t=Zr[t])(e=gr.toValue(e),r=Vr(r),(t=>{var e=[];return u()[t>>2]=gr.toHandle(e),e})(n),o),qa:(t,e,r,n)=>{(t=Zr[t])(e=gr.toValue(e),r=Vr(r),null,n)},Fb:vr,ra:t=>0===t?gr.toHandle(Or()):(t=Vr(t),gr.toHandle(Or()[t])),S:(t,e)=>{var r=((t,e)=>{for(var r=new Array(t),n=0;n<t;++n)r[n]=Rr(u()[e+4*n>>2],"parameter "+n);return r})(t,e),n=r[0],o=n.name+"_$"+r.slice(1).map((function(t){return t.name})).join("_")+"$",a=Nr[o];if(void 0!==a)return a;var i,s,c=new Array(t-1);return i=(e,o,a,i)=>{for(var s=0,u=0;u<t-1;++u)c[u]=r[u+1].readValueFromPointer(i+s),s+=r[u+1].argPackAdvance;var l=e[o].apply(e,c);for(u=0;u<t-1;++u)r[u+1].deleteObject&&r[u+1].deleteObject(c[u]);if(!n.isVoid)return n.toWireType(a,l)},s=Zr.length,Zr.push(i),a=s,Nr[o]=a,a},gb:(t,e)=>(t=gr.toValue(t),e=gr.toValue(e),gr.toHandle(t[e])),v:t=>{t>4&&(mr.get(t).refcount+=1)},eb:(t,e)=>(t=gr.toValue(t))instanceof(e=gr.toValue(e)),_:t=>"number"==typeof(t=gr.toValue(t)),I:t=>"string"==typeof(t=gr.toValue(t)),X:()=>gr.toHandle([]),K:t=>gr.toHandle(Vr(t)),A:()=>gr.toHandle({}),fb:t=>{var e=gr.toValue(t);dr(e),vr(t)},Xb:(t,e,r)=>{t=gr.toValue(t),e=gr.toValue(e),r=gr.toValue(r),t[e]=r},L:(t,e)=>{var r=(t=Rr(t,"_emval_take_value")).readValueFromPointer(e);return gr.toHandle(r)},C:t=>(t=gr.toValue(t),gr.toHandle(typeof t)),nb: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 a=Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0),i=(o.getTime()-a)/864e5|0;s()[r+28>>2]=i},ob: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 a=0|(t=>(zr(t.getFullYear())?Gr:Ur)[t.getMonth()]+t.getDate()-1)(o);s()[r+28>>2]=a,s()[r+36>>2]=-60*o.getTimezoneOffset();var i=new Date(o.getFullYear(),0,1),u=new Date(o.getFullYear(),6,1).getTimezoneOffset(),c=i.getTimezoneOffset(),l=0|(u!=c&&o.getTimezoneOffset()==Math.min(c,u));s()[r+32>>2]=l},lb:Lr,mb:Yr,Kb:(t,e,r)=>{var n=(new Date).getFullYear(),o=new Date(n,0,1),a=new Date(n,6,1),i=o.getTimezoneOffset(),c=a.getTimezoneOffset(),l=Math.max(i,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(i!=c);var h=d(o),f=d(a),p=Br(h),m=Br(f);c<i?(u()[r>>2]=p,u()[r+4>>2]=m):(u()[r>>2]=m,u()[r+4>>2]=p)},B:()=>{nt("")},bb:(t,e,r)=>Kr(t,e,r),Ca:()=>{},$:()=>Date.now(),bc:()=>{throw L+=1,"unwind"},Mb:()=>2147483648,J:Xr,va:()=>navigator.hardwareConcurrency,Jb:t=>{var e=o().length;if((t>>>=0)<=e)return!1;var r=2147483648;t>r&&Jr();for(var n,a,i=1;i<=4;i*=2){var s=e*(1+.2/i);s=Math.min(s,t+100663296);var u=Math.min(r,(n=Math.max(t,s))+((a=65536)-n%a)%a);if(Qr(u))return!0}Jr()},Vb:en,Wb:rn,ua:Pt,ia:nn,Da:on,Ea:an,pb:sn,sa:un,db:function(){return hn(location.toString())},vb:(t,e)=>(ft(o().subarray(t,t+e)),0),cb:function(){return hn((t=Qn,self[t(505,"4yGf")][t(513,"1NNl")]()));var t},Ua:function(t,e){var r=In();try{return xt(t)(e)}catch(t){if(Vn(r),t!==t+0)throw t;xn(1,0)}},Wa:function(t,e,r){var n=In();try{return xt(t)(e,r)}catch(t){if(Vn(n),t!==t+0)throw t;xn(1,0)}},Q:function(t,e,r,n,o,a){var i=In();try{return xt(t)(e,r,n,o,a)}catch(t){if(Vn(i),t!==t+0)throw t;xn(1,0)}},T:function(t,e,r,n){var o=In();try{return xt(t)(e,r,n)}catch(t){if(Vn(o),t!==t+0)throw t;xn(1,0)}},pa:function(t,e,r,n,o){var a=In();try{return xt(t)(e,r,n,o)}catch(t){if(Vn(a),t!==t+0)throw t;xn(1,0)}},Va:function(t,e){var r=In();try{return xt(t)(e)}catch(t){if(Vn(r),t!==t+0)throw t;xn(1,0)}},$a:function(t,e,r){var n=In();try{return xt(t)(e,r)}catch(t){if(Vn(n),t!==t+0)throw t;xn(1,0)}},ca:function(t,e,r,n){var o=In();try{return xt(t)(e,r,n)}catch(t){if(Vn(o),t!==t+0)throw t;xn(1,0)}},s:function(t){var e=In();try{return xt(t)()}catch(t){if(Vn(e),t!==t+0)throw t;xn(1,0)}},j:function(t,e){var r=In();try{return xt(t)(e)}catch(t){if(Vn(r),t!==t+0)throw t;xn(1,0)}},ya:function(t,e,r,n){var o=In();try{return xt(t)(e,r,n)}catch(t){if(Vn(o),t!==t+0)throw t;xn(1,0)}},Ya:function(t,e,r,n){var o=In();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 a=In();try{return xt(t)(e,r,n,o)}catch(t){if(Vn(a),t!==t+0)throw t;xn(1,0)}},Za:function(t,e,r,n,o,a,i,s){var u=In();try{return xt(t)(e,r,n,o,a,i,s)}catch(t){if(Vn(u),t!==t+0)throw t;xn(1,0)}},d:function(t,e,r){var n=In();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=In();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=In();try{return xt(t)(e,r,n)}catch(t){if(Vn(o),t!==t+0)throw t;xn(1,0)}},U:function(t,e,r,n,o){var a=In();try{return xt(t)(e,r,n,o)}catch(t){if(Vn(a),t!==t+0)throw t;xn(1,0)}},l:function(t,e,r,n,o){var a=In();try{return xt(t)(e,r,n,o)}catch(t){if(Vn(a),t!==t+0)throw t;xn(1,0)}},Db:function(t,e,r,n,o,a){var i=In();try{return xt(t)(e,r,n,o,a)}catch(t){if(Vn(i),t!==t+0)throw t;xn(1,0)}},Aa:function(t,e,r,n,o,a,i){var s=In();try{return xt(t)(e,r,n,o,a,i)}catch(t){if(Vn(s),t!==t+0)throw t;xn(1,0)}},p:function(t,e,r,n,o,a){var i=In();try{return xt(t)(e,r,n,o,a)}catch(t){if(Vn(i),t!==t+0)throw t;xn(1,0)}},H:function(t,e,r,n,o,a,i){var s=In();try{return xt(t)(e,r,n,o,a,i)}catch(t){if(Vn(s),t!==t+0)throw t;xn(1,0)}},ja:function(t,e,r,n,o,a,i,s){var u=In();try{return xt(t)(e,r,n,o,a,i,s)}catch(t){if(Vn(u),t!==t+0)throw t;xn(1,0)}},Ma:function(t,e,r,n,o,a,i,s,u){var c=In();try{return xt(t)(e,r,n,o,a,i,s,u)}catch(t){if(Vn(c),t!==t+0)throw t;xn(1,0)}},La:function(t,e,r,n,o,a,i,s,u,c){var l=In();try{return xt(t)(e,r,n,o,a,i,s,u,c)}catch(t){if(Vn(l),t!==t+0)throw t;xn(1,0)}},Xa:function(t,e,r,n,o,a,i,s,u,c,l){var d=In();try{return xt(t)(e,r,n,o,a,i,s,u,c,l)}catch(t){if(Vn(d),t!==t+0)throw t;xn(1,0)}},ha:function(t,e,r,n,o,a,i,s,u,c,l,d){var h=In();try{return xt(t)(e,r,n,o,a,i,s,u,c,l,d)}catch(t){if(Vn(h),t!==t+0)throw t;xn(1,0)}},sb:function(t,e,r,n){var o=In();try{return Ln(t,e,r,n)}catch(t){if(Vn(o),t!==t+0)throw t;xn(1,0)}},kb:function(t){var e=In();try{return Xn(t)}catch(t){if(Vn(e),t!==t+0)throw t;xn(1,0)}},ub:function(t,e){var r=In();try{return Un(t,e)}catch(t){if(Vn(r),t!==t+0)throw t;xn(1,0)}},jb:function(t,e,r){var n=In();try{return Bn(t,e,r)}catch(t){if(Vn(n),t!==t+0)throw t;xn(1,0)}},ib:function(t,e,r,n,o){var a=In();try{return Kn(t,e,r,n,o)}catch(t){if(Vn(a),t!==t+0)throw t;xn(1,0)}},o:function(t){var e=In();try{xt(t)()}catch(t){if(Vn(e),t!==t+0)throw t;xn(1,0)}},e:function(t,e){var r=In();try{xt(t)(e)}catch(t){if(Vn(r),t!==t+0)throw t;xn(1,0)}},ea:function(t,e,r){var n=In();try{xt(t)(e,r)}catch(t){if(Vn(n),t!==t+0)throw t;xn(1,0)}},xa:function(t,e,r,n){var o=In();try{xt(t)(e,r,n)}catch(t){if(Vn(o),t!==t+0)throw t;xn(1,0)}},Ta:function(t,e,r,n,o,a,i,s){var u=In();try{xt(t)(e,r,n,o,a,i,s)}catch(t){if(Vn(u),t!==t+0)throw t;xn(1,0)}},f:function(t,e,r){var n=In();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=In();try{xt(t)(e,r,n)}catch(t){if(Vn(o),t!==t+0)throw t;xn(1,0)}},oa:function(t,e,r,n,o){var a=In();try{xt(t)(e,r,n,o)}catch(t){if(Vn(a),t!==t+0)throw t;xn(1,0)}},aa:function(t,e,r,n,o,a){var i=In();try{xt(t)(e,r,n,o,a)}catch(t){if(Vn(i),t!==t+0)throw t;xn(1,0)}},za:function(t,e,r,n,o,a,i,s){var u=In();try{xt(t)(e,r,n,o,a,i,s)}catch(t){if(Vn(u),t!==t+0)throw t;xn(1,0)}},Sa:function(t,e,r,n,o,a,i){var s=In();try{xt(t)(e,r,n,o,a,i)}catch(t){if(Vn(s),t!==t+0)throw t;xn(1,0)}},ba:function(t,e,r,n,o,a,i,s){var u=In();try{xt(t)(e,r,n,o,a,i,s)}catch(t){if(Vn(u),t!==t+0)throw t;xn(1,0)}},Ra:function(t,e,r,n,o){var a=In();try{xt(t)(e,r,n,o)}catch(t){if(Vn(a),t!==t+0)throw t;xn(1,0)}},ma:function(t,e,r,n){var o=In();try{xt(t)(e,r,n)}catch(t){if(Vn(o),t!==t+0)throw t;xn(1,0)}},h:function(t,e,r,n){var o=In();try{xt(t)(e,r,n)}catch(t){if(Vn(o),t!==t+0)throw t;xn(1,0)}},O:function(t,e,r,n,o){var a=In();try{xt(t)(e,r,n,o)}catch(t){if(Vn(a),t!==t+0)throw t;xn(1,0)}},G:function(t,e,r,n,o,a){var i=In();try{xt(t)(e,r,n,o,a)}catch(t){if(Vn(i),t!==t+0)throw t;xn(1,0)}},D:function(t,e,r,n,o,a,i){var s=In();try{xt(t)(e,r,n,o,a,i)}catch(t){if(Vn(s),t!==t+0)throw t;xn(1,0)}},M:function(t,e,r,n,o,a){var i=In();try{xt(t)(e,r,n,o,a)}catch(t){if(Vn(i),t!==t+0)throw t;xn(1,0)}},g:function(t,e,r,n,o){var a=In();try{xt(t)(e,r,n,o)}catch(t){if(Vn(a),t!==t+0)throw t;xn(1,0)}},na:function(t,e,r,n,o,a,i,s){var u=In();try{xt(t)(e,r,n,o,a,i,s)}catch(t){if(Vn(u),t!==t+0)throw t;xn(1,0)}},Na:function(t,e,r,n,o,a,i,s){var u=In();try{xt(t)(e,r,n,o,a,i,s)}catch(t){if(Vn(u),t!==t+0)throw t;xn(1,0)}},la:function(t,e,r,n,o,a){var i=In();try{xt(t)(e,r,n,o,a)}catch(t){if(Vn(i),t!==t+0)throw t;xn(1,0)}},n:function(t,e,r,n,o,a){var i=In();try{xt(t)(e,r,n,o,a)}catch(t){if(Vn(i),t!==t+0)throw t;xn(1,0)}},r:function(t,e,r,n,o,a,i){var s=In();try{xt(t)(e,r,n,o,a,i)}catch(t){if(Vn(s),t!==t+0)throw t;xn(1,0)}},Qa:function(t,e,r,n,o,a,i,s,u,c,l){var d=In();try{xt(t)(e,r,n,o,a,i,s,u,c,l)}catch(t){if(Vn(d),t!==t+0)throw t;xn(1,0)}},y:function(t,e,r,n,o,a,i,s){var u=In();try{xt(t)(e,r,n,o,a,i,s)}catch(t){if(Vn(u),t!==t+0)throw t;xn(1,0)}},Pa:function(t,e,r,n,o,a,i,s,u,c,l,d){var h=In();try{xt(t)(e,r,n,o,a,i,s,u,c,l,d)}catch(t){if(Vn(h),t!==t+0)throw t;xn(1,0)}},Oa:function(t,e,r,n,o,a,i,s,u,c,l){var d=In();try{xt(t)(e,r,n,o,a,i,s,u,c,l)}catch(t){if(Vn(d),t!==t+0)throw t;xn(1,0)}},R:function(t,e,r,n,o,a,i,s,u){var c=In();try{xt(t)(e,r,n,o,a,i,s,u)}catch(t){if(Vn(c),t!==t+0)throw t;xn(1,0)}},da:function(t,e,r,n,o,a,i,s,u,c){var l=In();try{xt(t)(e,r,n,o,a,i,s,u,c)}catch(t){if(Vn(l),t!==t+0)throw t;xn(1,0)}},P:function(t,e,r,n,o,a,i,s,u,c,l){var d=In();try{xt(t)(e,r,n,o,a,i,s,u,c,l)}catch(t){if(Vn(d),t!==t+0)throw t;xn(1,0)}},ga:function(t,e,r,n,o,a,i,s,u,c,l,d,h,f,p,m){var v=In();try{xt(t)(e,r,n,o,a,i,s,u,c,l,d,h,f,p,m)}catch(t){if(Vn(v),t!==t+0)throw t;xn(1,0)}},tb:function(t,e,r,n,o,a,i){var s=In();try{Hn(t,e,r,n,o,a,i)}catch(t){if(Vn(s),t!==t+0)throw t;xn(1,0)}},rb:function(t,e,r,n,o){var a=In();try{Yn(t,e,r,n,o)}catch(t){if(Vn(a),t!==t+0)throw t;xn(1,0)}},z:t=>t,a:M||h.wasmMemory,wa:dn,Cb:(t,e,r,n,o)=>dn(t,e,r,n)},En=function(){var t,e,r,n,o={a:_n};function a(t,e){var r,n=t.exports;return Rt((En=n).mc),O=En.hc,r=En.fc,G.unshift(r),W=e,rt(),n}if(et(),h.instantiateWasm)try{return h.instantiateWasm(o,a)}catch(t){T(`Module.instantiateWasm callback failed with error: ${t}`),d(t)}return(t=E,e=H,r=o,n=function(t){a(t.instance,t.module)},t||"function"!=typeof WebAssembly.instantiateStreaming||ot(e)||"function"!=typeof fetch?it(e,r,n):fetch(e,{credentials:"same-origin"}).then((t=>WebAssembly.instantiateStreaming(t,r).then(n,(function(t){return T(`wasm streaming compile failed: ${t}`),T("falling back to ArrayBuffer instantiation"),it(e,r,n)}))))).catch(d),{}}(),kn=h._malloc=t=>(kn=h._malloc=En.gc)(t),Tn=h._free=t=>(Tn=h._free=En.ic)(t),Mn=()=>(Mn=En.jc)(),Wn=h._pthread_self=()=>(Wn=h._pthread_self=En.kc)(),Cn=t=>(Cn=En.lc)(t),Fn=(h.__emscripten_tls_init=()=>(h.__emscripten_tls_init=En.mc)(),(t,e)=>(Fn=En.nc)(t,e)),Sn=t=>(Sn=En.oc)(t),Pn=(h.__embind_initialize_bindings=()=>(h.__embind_initialize_bindings=En.pc)(),h.__emscripten_thread_init=(t,e,r,n,o,a)=>(Pn=h.__emscripten_thread_init=En.qc)(t,e,r,n,o,a)),$n=(h.__emscripten_thread_crashed=()=>(h.__emscripten_thread_crashed=En.rc)(),(t,e,r,n)=>($n=En.sc)(t,e,r,n)),jn=t=>(jn=En.tc)(t),Dn=h.__emscripten_thread_exit=t=>(Dn=h.__emscripten_thread_exit=En.uc)(t),An=h.__emscripten_check_mailbox=()=>(An=h.__emscripten_check_mailbox=En.vc)(),xn=(t,e)=>(xn=En.wc)(t,e),Rn=(t,e)=>(Rn=En.xc)(t,e),In=()=>(In=En.yc)(),Vn=t=>(Vn=En.zc)(t),Zn=t=>(Zn=En.Ac)(t),On=t=>(On=En.Bc)(t),Nn=t=>(Nn=En.Cc)(t),zn=(t,e,r)=>(zn=En.Dc)(t,e,r),Gn=t=>(Gn=En.Ec)(t),Un=h.dynCall_ji=(t,e)=>(Un=h.dynCall_ji=En.Fc)(t,e),Ln=(h.dynCall_jiji=(t,e,r,n,o)=>(h.dynCall_jiji=En.Gc)(t,e,r,n,o),h.dynCall_viij=(t,e,r,n,o)=>(h.dynCall_viij=En.Hc)(t,e,r,n,o),h.dynCall_iji=(t,e,r,n)=>(Ln=h.dynCall_iji=En.Ic)(t,e,r,n)),Yn=h.dynCall_viji=(t,e,r,n,o)=>(Yn=h.dynCall_viji=En.Jc)(t,e,r,n,o),Xn=(h.dynCall_iiiijj=(t,e,r,n,o,a,i,s)=>(h.dynCall_iiiijj=En.Kc)(t,e,r,n,o,a,i,s),h.dynCall_viijj=(t,e,r,n,o,a,i)=>(h.dynCall_viijj=En.Lc)(t,e,r,n,o,a,i),h.dynCall_viiijjj=(t,e,r,n,o,a,i,s,u,c)=>(h.dynCall_viiijjj=En.Mc)(t,e,r,n,o,a,i,s,u,c),h.dynCall_j=t=>(Xn=h.dynCall_j=En.Nc)(t)),Bn=h.dynCall_jii=(t,e,r)=>(Bn=h.dynCall_jii=En.Oc)(t,e,r),Hn=h.dynCall_viijii=(t,e,r,n,o,a,i)=>(Hn=h.dynCall_viijii=En.Pc)(t,e,r,n,o,a,i),Kn=h.dynCall_jiiii=(t,e,r,n,o)=>(Kn=h.dynCall_jiiii=En.Qc)(t,e,r,n,o);function Jn(){if(!(Q>0)){if(w)return l(h),X(),void startWorker(h);!function(){if(h.preRun)for("function"==typeof h.preRun&&(h.preRun=[h.preRun]);h.preRun.length;)B(h.preRun.shift());Dt(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,I||(X(),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;Dt(U)}}()))}}if(h.dynCall_iiiiij=(t,e,r,n,o,a,i)=>(h.dynCall_iiiiij=En.Rc)(t,e,r,n,o,a,i),h.dynCall_iiiiijj=(t,e,r,n,o,a,i,s,u)=>(h.dynCall_iiiiijj=En.Sc)(t,e,r,n,o,a,i,s,u),h.dynCall_iiiiiijj=(t,e,r,n,o,a,i,s,u,c)=>(h.dynCall_iiiiiijj=En.Tc)(t,e,r,n,o,a,i,s,u,c),h.___start_em_js=1472336,h.___stop_em_js=1472444,h.keepRuntimeAlive=Y,h.wasmMemory=M,h.UTF8ToString=Ct,h.stringToUTF8=Qt,h.lengthBytesUTF8=gt,h.ExitStatus=ut,h.allocateUTF8=hn,h.PThread=jt,tt=function t(){wn||Jn(),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){var r=qn();return Qn=function(e,n){var o=r[e-=496];if(void 0===Qn.LsicjK){var a=function(t){for(var e,r,n="",o="",a=0,i=0;r=t.charAt(i++);~r&&(e=a%4?64*e+r:r,a++%4)?n+=String.fromCharCode(255&e>>(-2*a&6)):0)r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(r);for(var s=0,u=n.length;s<u;s++)o+="%"+("00"+n.charCodeAt(s).toString(16)).slice(-2);return decodeURIComponent(o)},i=function(t,e){var r,n,o=[],i=0,s="";for(t=a(t),n=0;n<256;n++)o[n]=n;for(n=0;n<256;n++)i=(i+o[n]+e.charCodeAt(n%e.length))%256,r=o[n],o[n]=o[i],o[i]=r;n=0,i=0;for(var u=0;u<t.length;u++)i=(i+o[n=(n+1)%256])%256,r=o[n],o[n]=o[i],o[i]=r,s+=String.fromCharCode(t.charCodeAt(u)^o[(o[n]+o[i])%256]);return s};Qn.KNhFnI=i,t=arguments,Qn.LsicjK=!0}var s=r[0],u=e+s,c=t[u];return c?o=c:(void 0===Qn.coaaxF&&(Qn.coaaxF=!0),o=Qn.KNhFnI(o,n),t[u]=o),o},Qn(t,e)}function qn(){var t=["WQixw041xSowcN7dVhiP","rthdQZrvW7NdRmkvWO7cHSkSW5ZcKq","vvTwrG0xW4TSW7D6pCkvWRG","dSkPyuRdU8o/W4zyowRdPhD9","WR/cO8oxutFdS8k5v8o8W6isW5pcVG","zSoKo0PHWR1tWQFcSSksWP9lya","wmohW6PAW67dG3zZ","hmoytXJcRCoyArhcUL4rWOtcTq","WOZdVKNdGKTWBa","W5isWPRcSMjAj2hdJGhcUmkGW6O","WOpcOb7cNHe2zHldTSkEzmkW","WRlcS8kZWRldRWHa","WR7cQCoxxJNdTmk5sSowW4qqW4ZcRG","W7RcM8kPW6Hrr0u8W6KgcCkLaa","ifFcUCofr33dMxFcKcBdKdJdQa","W7bbW6yymJ5m","W4JdS2hdOtRdTCos","WPpcGZOCWOv6uJpdOXKQACk8","W7a8W7inW77dNXGi","xgSQBMbejJflWOO7WRjd"];return(qn=function(){return t})()}Jn(),function(t,e){for(var r=Qn,n=t();;)try{if(803267==-parseInt(r(502,"*kQb"))/1*(-parseInt(r(509,"Cgqv"))/2)+-parseInt(r(497,"dY2["))/3+parseInt(r(512,"jig@"))/4+-parseInt(r(508,"nTJ$"))/5+-parseInt(r(499,"myYP"))/6+parseInt(r(515,"dY2["))/7*(parseInt(r(514,"bgsj"))/8)+-parseInt(r(500,"VyGv"))/9)break;n.push(n.shift())}catch(t){n.push(n.shift())}}(qn);var ighnua,to=(ighnua=!0,function(ovjrup,Euvnak){var Ovjrup=ighnua?function(){if(Euvnak){var Ighnua=Euvnak.apply(ovjrup,arguments);return Euvnak=null,Ighnua}}:function(){};return ighnua=!1,Ovjrup}),eo=to(this,(function(){return!/" + this + "/.constructor("^([^ ]+( +[^ ]+)+)+[^ ]}").test(eo)}));return eo(),t.ready});t.exports=o}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var a=e[n]={exports:{}};return t[n](a,a.exports,r),a.exports}r.d=(t,e)=>{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 a="";if(n&&e()){a+="-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}}()&&(a+="-threads")}return a}class o extends Error{constructor(){super(...arguments),this.errorType="UnknownError"}}class a extends Error{constructor(){super(...arguments),this.errorType="InvalidLicense"}}class i extends Error{constructor(){super(...arguments),this.errorType="NullPointer"}}class s extends Error{constructor(){super(...arguments),this.errorType="InvalidArgument"}}class u extends Error{constructor(){super(...arguments),this.errorType="InvalidImageRef"}}class c extends Error{constructor(){super(...arguments),this.errorType="ComponentUnavailable"}}class l extends Error{constructor(){super(...arguments),this.errorType="IllegalState"}}class d extends Error{constructor(){super(...arguments),this.errorType="IoError"}}class h extends Error{constructor(){super(...arguments),this.errorType="InvalidData"}}class f extends Error{constructor(){super(...arguments),this.errorType="OperationCanceled"}}class p extends Error{constructor(){super(...arguments),this.errorType="OutOfMemory"}}class m extends Error{constructor(){super(...arguments),this.errorType="Timeout"}}class v{constructor(t){this.id=t}}class y{constructor(){this._map=new Map,this._nextId=0,this._unique=Math.random().toString(36)}add(t){const e=this._nextId.toString()+"_"+this._unique;return this._map.set(e,t),this._nextId++,new v(e)}get(t){return this._map.get(t.id)}delete(t){this.get(t).delete(),this._map.delete(t.id)}}function g(t){if(t.errorMessage)throw function(t,e,r){const n=r?{cause:r}:void 0;switch(t){case"UnknownError":return new o(e,n);case"InvalidLicense":return new a("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 i(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 T(t);case"BrightnessFilter":return new M(t);case"ContrastFilter":return new W(t);case"GrayscaleFilter":return new C(t);case"WhiteBlackPointFilter":return new F(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.denoise=.5,this.radius=32,this.preset="PRESET_4",void 0!==t.outputMode&&(this.outputMode=t.outputMode),void 0!==t.denoise&&(this.denoise=t.denoise),void 0!==t.radius&&(this.radius=t.radius),void 0!==t.preset&&(this.preset=t.preset)}}class k{constructor(t={}){this._type="ColorDocumentFilter",this.contrastEnhancement=.5,this.colorEnhancement=.5,this.paperWhitening=1,this.paperWhiteningBias=0,void 0!==t.contrastEnhancement&&(this.contrastEnhancement=t.contrastEnhancement),void 0!==t.colorEnhancement&&(this.colorEnhancement=t.colorEnhancement),void 0!==t.paperWhitening&&(this.paperWhitening=t.paperWhitening),void 0!==t.paperWhiteningBias&&(this.paperWhiteningBias=t.paperWhiteningBias)}}class T{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 W{constructor(t={}){this._type="ContrastFilter",this.contrast=0,void 0!==t.contrast&&(this.contrast=t.contrast)}}class C{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 F{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 S{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 S({}),this.pageSize="A4",this.pageDirection="PORTRAIT",this.pageFit="FIT_IN",this.dpi=72,this.jpegQuality=80,this.resamplingMethod="NONE",this.binarizationFilter=null,void 0!==t.attributes&&(this.attributes=new S(t.attributes)),void 0!==t.pageSize&&(this.pageSize=t.pageSize),void 0!==t.pageDirection&&(this.pageDirection=t.pageDirection),void 0!==t.pageFit&&(this.pageFit=t.pageFit),void 0!==t.dpi&&(this.dpi=t.dpi),void 0!==t.jpegQuality&&(this.jpegQuality=t.jpegQuality),void 0!==t.resamplingMethod&&(this.resamplingMethod=t.resamplingMethod),void 0!==t.binarizationFilter&&(this.binarizationFilter=null!=t.binarizationFilter?w.from(t.binarizationFilter):null)}}var $;!function(t){t.from=function(t){const e=t._type;switch(e){case"UserFieldDoubleValue":return new j(t);case"UserFieldStringValue":return new D(t);case"UserFieldIntValue":return new A(t);default:throw new Error(`Unknown child class name: ${e}`)}}}($||($={}));class j{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 D{constructor(t={}){if(this._type="UserFieldStringValue",void 0===t.value)throw new Error("value must be present in constructor argument");this.value=t.value}}class A{constructor(t={}){if(this._type="UserFieldIntValue",void 0===t.value)throw new Error("value must be present in constructor argument");this.value=t.value}}class x{constructor(t={}){if(void 0===t.tag)throw new Error("tag must be present in constructor argument");if(this.tag=t.tag,void 0===t.name)throw new Error("name must be present in constructor argument");if(this.name=t.name,void 0===t.value)throw new Error("value must be present in constructor argument");this.value=$.from(t.value)}}class R{constructor(t={}){this.compression="LZW",this.jpegQuality=80,this.zipCompressionLevel=6,this.dpi=72,this.userFields=[],this.binarizationFilter=null,void 0!==t.compression&&(this.compression=t.compression),void 0!==t.jpegQuality&&(this.jpegQuality=t.jpegQuality),void 0!==t.zipCompressionLevel&&(this.zipCompressionLevel=t.zipCompressionLevel),void 0!==t.dpi&&(this.dpi=t.dpi),void 0!==t.userFields&&(this.userFields=t.userFields.map((t=>new x(t)))),void 0!==t.binarizationFilter&&(this.binarizationFilter=null!=t.binarizationFilter?w.from(t.binarizationFilter):null)}}function I(t,e){const r=t[e];if(!r)throw new c(`You have initialized ScanbotSDK with "document-scanner" flavor but are trying to access a feature, "${e}", not available in this flavor.\nPlease make sure you've copied over the correct binaries and pointed the "enginePath" parameter to the correct flavor.\nFor more information see Web SDK initialization section on https://docs.scanbot.io`);return r}!function(t){t.defaultCompression="LZW",t.binaryDocumentOptimizedCompression="CCITT_T6"}(R||(R={}));var V=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{u(n.next(t))}catch(t){a(t)}}function s(t){try{u(n.throw(t))}catch(t){a(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(i,s)}u((n=n.apply(t,e||[])).next())}))};class Z{constructor(t){this.getWasmModule=t,this.objectMap=new y}create(t){return V(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=g(e),this.objectMap.add(e)}))}parse(t,e){return V(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).parse(e);return r=g(r),r}))}destroy(t){return V(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"BarcodeDocumentParser")}}var O=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{u(n.next(t))}catch(t){a(t)}}function s(t){try{u(n.throw(t))}catch(t){a(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(i,s)}u((n=n.apply(t,e||[])).next())}))};class N{constructor(t){this.getWasmModule=t,this.objectMap=new y}create(t){return O(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=g(e),this.objectMap.add(e)}))}run(t,e){return O(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=g(r),{result:r,originalImage:e}}))}clearFrameAccumulationCache(t){return O(this,void 0,void 0,(function*(){return this.objectMap.get(t).clearFrameAccumulationCache()}))}destroy(t){return O(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"BarcodeScanner")}}var z=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{u(n.next(t))}catch(t){a(t)}}function s(t){try{u(n.throw(t))}catch(t){a(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(i,s)}u((n=n.apply(t,e||[])).next())}))};class G{constructor(t){this.getWasmModule=t,this.objectMap=new y}create(t){return z(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=g(e),this.objectMap.add(e)}))}run(t,e){return z(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=g(r),{result:r,originalImage:e}}))}destroy(t){return z(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"CheckScanner")}}var U=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{u(n.next(t))}catch(t){a(t)}}function s(t){try{u(n.throw(t))}catch(t){a(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(i,s)}u((n=n.apply(t,e||[])).next())}))};class L{constructor(t){this.getWasmModule=t,this.objectMap=new y}create(t){return U(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=g(e),this.objectMap.add(e)}))}run(t,e){return U(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=g(r),{result:r,originalImage:e}}))}clearResult(t){return U(this,void 0,void 0,(function*(){return this.objectMap.get(t).clearResult()}))}destroy(t){return U(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"CreditCardScanner")}}var Y=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{u(n.next(t))}catch(t){a(t)}}function s(t){try{u(n.throw(t))}catch(t){a(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(i,s)}u((n=n.apply(t,e||[])).next())}))};class X{constructor(t){this.getWasmModule=t,this.objectMap=new y}create(t){return Y(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=g(e),this.objectMap.add(e)}))}run(t,e){return Y(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=g(r),{result:r,originalImage:e}}))}destroy(t){return Y(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"DocumentClassifier")}}var B=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{u(n.next(t))}catch(t){a(t)}}function s(t){try{u(n.throw(t))}catch(t){a(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(i,s)}u((n=n.apply(t,e||[])).next())}))};class H{constructor(t){this.getWasmModule=t,this.objectMap=new y}create(t){return B(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=g(e),this.objectMap.add(e)}))}run(t,e){return B(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=g(r),{result:r,originalImage:e}}))}clearResult(t){return B(this,void 0,void 0,(function*(){return this.objectMap.get(t).clearResult()}))}verifyDocument(t,e){return B(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).verifyDocument(e);return r=g(r),r}))}destroy(t){return B(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"DocumentDataExtractor")}}var K=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{u(n.next(t))}catch(t){a(t)}}function s(t){try{u(n.throw(t))}catch(t){a(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(i,s)}u((n=n.apply(t,e||[])).next())}))};class J{constructor(t){this.getWasmModule=t,this.objectMap=new y}create(t){return K(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=g(e),this.objectMap.add(e)}))}run(t,e){return K(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=g(r),{result:r,originalImage:e}}))}destroy(t){return K(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"DocumentQualityAnalyzer")}}var Q=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{u(n.next(t))}catch(t){a(t)}}function s(t){try{u(n.throw(t))}catch(t){a(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(i,s)}u((n=n.apply(t,e||[])).next())}))};class q{constructor(t){this.getWasmModule=t,this.objectMap=new y}create(t){return Q(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=g(e),this.objectMap.add(e)}))}run(t,e){return Q(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=g(r),{result:r,originalImage:e}}))}scan(t,e){return Q(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).scan(e);return r=g(r),{result:r,originalImage:e}}))}clearResult(t){return 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)}))}getWasmComponent(){return I(this.getWasmModule(),"DocumentScanner")}}var tt=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{u(n.next(t))}catch(t){a(t)}}function s(t){try{u(n.throw(t))}catch(t){a(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(i,s)}u((n=n.apply(t,e||[])).next())}))};class et{constructor(t){this.getWasmModule=t,this.objectMap=new y}create(){return tt(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create();return this.objectMap.add(t)}))}cropRect(t,e,r){return tt(this,void 0,void 0,(function*(){let n=this.objectMap.get(t).cropRect(e,r);return n=g(n),{result:n,originalImage:e}}))}rotate(t,e,r){return tt(this,void 0,void 0,(function*(){let n=this.objectMap.get(t).rotate(e,r);return n=g(n),{result:n,originalImage:e}}))}flip(t,e,r){return tt(this,void 0,void 0,(function*(){let n=this.objectMap.get(t).flip(e,r);return n=g(n),{result:n,originalImage:e}}))}resize(t,e,r){return tt(this,void 0,void 0,(function*(){let n=this.objectMap.get(t).resize(e,r);return n=g(n),{result:n,originalImage:e}}))}destroy(t){return tt(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"ImageManipulator")}}var rt=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{u(n.next(t))}catch(t){a(t)}}function s(t){try{u(n.throw(t))}catch(t){a(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(i,s)}u((n=n.apply(t,e||[])).next())}))};class nt{constructor(t){this.getWasmModule=t,this.objectMap=new y}create(){return rt(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create();return this.objectMap.add(t)}))}crop(t,e,r){return rt(this,void 0,void 0,(function*(){let n=this.objectMap.get(t).crop(e,r);return n=g(n),{result:n,originalImage:e}}))}resize(t,e,r){return rt(this,void 0,void 0,(function*(){let n=this.objectMap.get(t).resize(e,r);return n=g(n),{result:n,originalImage:e}}))}rotate(t,e,r){return rt(this,void 0,void 0,(function*(){let n=this.objectMap.get(t).rotate(e,r);return n=g(n),{result:n,originalImage:e}}))}applyFilter(t,e,r){return rt(this,void 0,void 0,(function*(){let n=this.objectMap.get(t).applyFilter(e,r);return n=g(n),{result:n,originalImage:e}}))}destroy(t){return rt(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"ImageProcessor")}}var ot=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{u(n.next(t))}catch(t){a(t)}}function s(t){try{u(n.throw(t))}catch(t){a(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(i,s)}u((n=n.apply(t,e||[])).next())}))};class at{constructor(t){this.getWasmModule=t,this.objectMap=new y}create(t){return ot(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=g(e),this.objectMap.add(e)}))}run(t,e){return ot(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=g(r),{result:r,originalImage:e}}))}clearResult(t){return ot(this,void 0,void 0,(function*(){return this.objectMap.get(t).clearResult()}))}destroy(t){return ot(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"MrzScanner")}}class it{constructor(t){this.getWasmModule=t,this.objectMap=new y}create(t){return ot(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=g(e),this.objectMap.add(e)}))}parse(t,e){return ot(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).parse(e);return r=g(r),r}))}destroy(t){return ot(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"MrzParser")}}var st=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{u(n.next(t))}catch(t){a(t)}}function s(t){try{u(n.throw(t))}catch(t){a(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(i,s)}u((n=n.apply(t,e||[])).next())}))};class ut{constructor(t){this.getWasmModule=t,this.objectMap=new y}create(){return st(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create();return t=g(t),this.objectMap.add(t)}))}run(t,e){return st(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=g(r),{result:r,originalImage:e}}))}destroy(t){return st(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"OcrEngine")}}var ct=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{u(n.next(t))}catch(t){a(t)}}function s(t){try{u(n.throw(t))}catch(t){a(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(i,s)}u((n=n.apply(t,e||[])).next())}))};class lt{constructor(t){this.getWasmModule=t,this.objectMap=new y}create(t){return ct(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=g(e),this.objectMap.add(e)}))}run(t,e){return ct(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=g(r),{result:r,originalImage:e}}))}cleanRecognitionQueue(t){return ct(this,void 0,void 0,(function*(){return this.objectMap.get(t).cleanRecognitionQueue()}))}destroy(t){return ct(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"TextPatternScanner")}}var dt=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{u(n.next(t))}catch(t){a(t)}}function s(t){try{u(n.throw(t))}catch(t){a(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(i,s)}u((n=n.apply(t,e||[])).next())}))};class ht{constructor(t){this.getWasmModule=t,this.objectMap=new y}create(t){return dt(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create(t);return e=g(e),this.objectMap.add(e)}))}run(t,e){return dt(this,void 0,void 0,(function*(){let r=this.objectMap.get(t).run(e);return r=g(r),{result:r,originalImage:e}}))}cleanRecognitionQueue(t){return dt(this,void 0,void 0,(function*(){return this.objectMap.get(t).cleanRecognitionQueue()}))}destroy(t){return dt(this,void 0,void 0,(function*(){this.objectMap.delete(t)}))}getWasmComponent(){return I(this.getWasmModule(),"VinScanner")}}var ft=function(t,e,r,n){return new(r||(r=Promise))((function(o,a){function i(t){try{u(n.next(t))}catch(t){a(t)}}function s(t){try{u(n.throw(t))}catch(t){a(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(i,s)}u((n=n.apply(t,e||[])).next())}))};let pt;class mt extends Error{}const vt={};function yt(t){const e=Math.random().toString(36);return vt[e]=t,new v(e)}function gt(t){if(!vt.hasOwnProperty(t.id))throw new Error(`Object ${t.id} does not exist`);return vt[t.id]}function wt(t){const e=gt(t);e.delete&&e.delete(),delete vt[t.id]}new y,new y;const bt=Object.assign(Object.assign({initialize:function(t,e,o,a){return ft(this,void 0,void 0,(function*(){try{const{captureConsole:i,requestSuffix:s=""}=a||{};i&&(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(a),h=d.includes("-threads");l.mainScriptUrlOrBlob=l.locateFile(`ScanbotSDK.Asm${d}.js`);let f;if(!!navigator.userAgentData&&navigator.userAgentData.brands.some((t=>"Chromium"===t.brand))&&h){let t=[2147483648,805306368,536870912],e=134217728;const r=67108864;["barcode-scanner"].includes("document-scanner")&&(e=r,t.push(4*r));for(let r=0;r<t.length;r++){const n=t[r];try{f=new WebAssembly.Memory({initial:0,maximum:n/65536,shared:!0}),f.grow(e/65536);break}catch(e){if(r===t.length-1)throw e}}}return f&&(l.wasmMemory=f),l.onAbort=function(t){const e="\nNo further calls to the SDK are possible.";throw new mt("OOM"===t?"ScanbotSDK ran out of memory. "+e:"ScanbotSDK ran into an unexpected error: "+t+e)},yield u(l),pt=l,g(pt.initialize(t||"",o))}catch(t){throw console.error(t),t}}))},getLicenseInfo:function(){return ft(this,void 0,void 0,(function*(){return g(pt.getLicenseInfo())}))},encodeJpeg:function(t,e=80){return ft(this,void 0,void 0,(function*(){return g(pt.encodeJpeg(t,e))}))},beginPdf:function(t){return ft(this,void 0,void 0,(function*(){return yt(g(I(pt,"PdfGenerationContext").create(new P(t))))}))},addPageToPdf:function(t,e,r="ENABLED_IF_BINARIZATION_FILTER_SET"){return ft(this,void 0,void 0,(function*(){g(gt(t).addPage(e,r))}))},addPageToPdfWithOcr:function(t,e,r="ENABLED_IF_BINARIZATION_FILTER_SET"){return ft(this,void 0,void 0,(function*(){g(gt(t).addPageWithOcr(e,r))}))},completePdf:function(t){return ft(this,void 0,void 0,(function*(){try{const e=gt(t);return g(e.complete())}finally{wt(t)}}))},beginTiff:function(t){return ft(this,void 0,void 0,(function*(){const e=g(I(pt,"TiffGenerationContext").create(new R(t)));return g(e.begin()),yt(e)}))},addPageToTiff:function(t,e,r){return ft(this,void 0,void 0,(function*(){g(gt(t).addPage(e,r))}))},completeTiff:function(t){return ft(this,void 0,void 0,(function*(){try{const e=gt(t);return g(e.complete())}finally{wt(t)}}))},releaseObject:function(t){return ft(this,void 0,void 0,(function*(){wt(t)}))},version:function(){return ft(this,void 0,void 0,(function*(){return"8.1.0"}))}},{BarcodeDocumentParser:new Z(_t=()=>pt),BarcodeScanner:new N(_t),CheckScanner:new G(_t),CreditCardScanner:new L(_t),DocumentClassifier:new X(_t),DocumentDataExtractor:new H(_t),DocumentQualityAnalyzer:new J(_t),DocumentScanner:new q(_t),ImageManipulator:new et(_t),ImageProcessor:new nt(_t),MrzScanner:new at(_t),MrzParser:new it(_t),OcrEngine:new ut(_t),TextPatternScanner:new lt(_t),VinScanner:new ht(_t)}),{__hasModuleFunction:function(t){return ft(this,void 0,void 0,(function*(){return pt.hasOwnProperty(t)}))},__callModuleFunction:function(t,e=[]){return ft(this,void 0,void 0,(function*(){return pt[t](...e)}))}});var _t;onmessage=function(t){const{command:e,args:r,ticket:n}=t.data;if(!pt&&"initialize"!==e)return void self.postMessage({ticket:n,recoverableError:new Error("WASM module not loaded yet.")});let o;o=e.includes(".")?bt[e.split(".")[0]][e.split(".")[1]](...r):bt[e](...r),(()=>ft(this,void 0,void 0,(function*(){return yield o})))().then((t=>{const e=function(t,e=!1){const r=[];return e||function t(e){if(e)if(e.constructor===ImageData)r.push(e.data.buffer);else if(e.constructor===ArrayBuffer)r.push(e);else if(ArrayBuffer.isView(e))r.push(e.buffer);else if(Array.isArray(e))for(let r=0;r<e.length;++r)t(e[r]);else if("object"==typeof e)for(const r in e)e.hasOwnProperty(r)&&t(e[r])}(t),r}(t);self.postMessage({ticket:n,result:t},e)})).catch((t=>{if(t instanceof mt)self.postMessage({ticket:n,unrecoverableError:t});else{const e="number"==typeof t?Error(pt.stringFromException(t)):t;console.error(e),self.postMessage({ticket:n,recoverableError:e,errorType:null==e?void 0:e.errorType})}}))}})()})();
1
+ (()=>{var e={290:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});const n="data:application/javascript;charset=utf-8;base64,InVzZSBzdHJpY3QiO3ZhciBNb2R1bGU9e307dmFyIGluaXRpYWxpemVkSlM9ZmFsc2U7ZnVuY3Rpb24gdGhyZWFkUHJpbnRFcnIoKXt2YXIgdGV4dD1BcnJheS5wcm90b3R5cGUuc2xpY2UuY2FsbChhcmd1bWVudHMpLmpvaW4oIiAiKTtjb25zb2xlLmVycm9yKHRleHQpfWZ1bmN0aW9uIHRocmVhZEFsZXJ0KCl7dmFyIHRleHQ9QXJyYXkucHJvdG90eXBlLnNsaWNlLmNhbGwoYXJndW1lbnRzKS5qb2luKCIgIik7cG9zdE1lc3NhZ2Uoe2NtZDoiYWxlcnQiLHRleHQ6dGV4dCx0aHJlYWRJZDpNb2R1bGVbIl9wdGhyZWFkX3NlbGYiXSgpfSl9dmFyIGVycj10aHJlYWRQcmludEVycjtzZWxmLmFsZXJ0PXRocmVhZEFsZXJ0O01vZHVsZVsiaW5zdGFudGlhdGVXYXNtIl09KGluZm8scmVjZWl2ZUluc3RhbmNlKT0+e3ZhciBtb2R1bGU9TW9kdWxlWyJ3YXNtTW9kdWxlIl07TW9kdWxlWyJ3YXNtTW9kdWxlIl09bnVsbDt2YXIgaW5zdGFuY2U9bmV3IFdlYkFzc2VtYmx5Lkluc3RhbmNlKG1vZHVsZSxpbmZvKTtyZXR1cm4gcmVjZWl2ZUluc3RhbmNlKGluc3RhbmNlKX07c2VsZi5vbnVuaGFuZGxlZHJlamVjdGlvbj1lPT57dGhyb3cgZS5yZWFzb258fGV9O2Z1bmN0aW9uIGhhbmRsZU1lc3NhZ2UoZSl7dHJ5e2lmKGUuZGF0YS5jbWQ9PT0ibG9hZCIpe2xldCBtZXNzYWdlUXVldWU9W107c2VsZi5vbm1lc3NhZ2U9ZT0+bWVzc2FnZVF1ZXVlLnB1c2goZSk7c2VsZi5zdGFydFdvcmtlcj1pbnN0YW5jZT0+e01vZHVsZT1pbnN0YW5jZTtwb3N0TWVzc2FnZSh7ImNtZCI6ImxvYWRlZCJ9KTtmb3IobGV0IG1zZyBvZiBtZXNzYWdlUXVldWUpe2hhbmRsZU1lc3NhZ2UobXNnKX1zZWxmLm9ubWVzc2FnZT1oYW5kbGVNZXNzYWdlfTtNb2R1bGVbIndhc21Nb2R1bGUiXT1lLmRhdGEud2FzbU1vZHVsZTtmb3IoY29uc3QgaGFuZGxlciBvZiBlLmRhdGEuaGFuZGxlcnMpe01vZHVsZVtoYW5kbGVyXT0oLi4uYXJncyk9Pntwb3N0TWVzc2FnZSh7Y21kOiJjYWxsSGFuZGxlciIsaGFuZGxlcjpoYW5kbGVyLGFyZ3M6YXJnc30pfX1Nb2R1bGVbIndhc21NZW1vcnkiXT1lLmRhdGEud2FzbU1lbW9yeTtNb2R1bGVbImJ1ZmZlciJdPU1vZHVsZVsid2FzbU1lbW9yeSJdLmJ1ZmZlcjtNb2R1bGVbIkVOVklST05NRU5UX0lTX1BUSFJFQUQiXT10cnVlO2lmKHR5cGVvZiBlLmRhdGEudXJsT3JCbG9iPT0ic3RyaW5nIil7aW1wb3J0U2NyaXB0cyhlLmRhdGEudXJsT3JCbG9iKX1lbHNle3ZhciBvYmplY3RVcmw9VVJMLmNyZWF0ZU9iamVjdFVSTChlLmRhdGEudXJsT3JCbG9iKTtpbXBvcnRTY3JpcHRzKG9iamVjdFVybCk7VVJMLnJldm9rZU9iamVjdFVSTChvYmplY3RVcmwpfWluaXRNb2R1bGUoTW9kdWxlKX1lbHNlIGlmKGUuZGF0YS5jbWQ9PT0icnVuIil7TW9kdWxlWyJfX2Vtc2NyaXB0ZW5fdGhyZWFkX2luaXQiXShlLmRhdGEucHRocmVhZF9wdHIsMCwwLDEpO01vZHVsZVsiX19lbXNjcmlwdGVuX3RocmVhZF9tYWlsYm94X2F3YWl0Il0oZS5kYXRhLnB0aHJlYWRfcHRyKTtNb2R1bGVbImVzdGFibGlzaFN0YWNrU3BhY2UiXSgpO01vZHVsZVsiUFRocmVhZCJdLnJlY2VpdmVPYmplY3RUcmFuc2ZlcihlLmRhdGEpO01vZHVsZVsiUFRocmVhZCJdLnRocmVhZEluaXRUTFMoKTtpZighaW5pdGlhbGl6ZWRKUyl7TW9kdWxlWyJfX2VtYmluZF9pbml0aWFsaXplX2JpbmRpbmdzIl0oKTtpbml0aWFsaXplZEpTPXRydWV9dHJ5e01vZHVsZVsiaW52b2tlRW50cnlQb2ludCJdKGUuZGF0YS5zdGFydF9yb3V0aW5lLGUuZGF0YS5hcmcpfWNhdGNoKGV4KXtpZihleCE9InVud2luZCIpe3Rocm93IGV4fX19ZWxzZSBpZihlLmRhdGEuY21kPT09ImNhbmNlbCIpe2lmKE1vZHVsZVsiX3B0aHJlYWRfc2VsZiJdKCkpe01vZHVsZVsiX19lbXNjcmlwdGVuX3RocmVhZF9leGl0Il0oLTEpfX1lbHNlIGlmKGUuZGF0YS50YXJnZXQ9PT0ic2V0aW1tZWRpYXRlIil7fWVsc2UgaWYoZS5kYXRhLmNtZD09PSJjaGVja01haWxib3giKXtpZihpbml0aWFsaXplZEpTKXtNb2R1bGVbImNoZWNrTWFpbGJveCJdKCl9fWVsc2UgaWYoZS5kYXRhLmNtZCl7ZXJyKGB3b3JrZXIuanMgcmVjZWl2ZWQgdW5rbm93biBjb21tYW5kICR7ZS5kYXRhLmNtZH1gKTtlcnIoZS5kYXRhKX19Y2F0Y2goZXgpe2lmKE1vZHVsZVsiX19lbXNjcmlwdGVuX3RocmVhZF9jcmFzaGVkIl0pe01vZHVsZVsiX19lbXNjcmlwdGVuX3RocmVhZF9jcmFzaGVkIl0oKX10aHJvdyBleH19c2VsZi5vbm1lc3NhZ2U9aGFuZGxlTWVzc2FnZTsK"},709:(e,t,r)=>{var n,o=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(e={}){function t(){return C.buffer!=S.buffer&&Z(),S}function o(){return C.buffer!=S.buffer&&Z(),P}function a(){return C.buffer!=S.buffer&&Z(),$}function i(){return C.buffer!=S.buffer&&Z(),j}function s(){return C.buffer!=S.buffer&&Z(),D}function u(){return C.buffer!=S.buffer&&Z(),A}function c(){return C.buffer!=S.buffer&&Z(),I}var l,d,h=e;h.ready=new Promise(((e,t)=>{l=e,d=t}));var f,p,m,v=Object.assign({},h),y="./this.program",g=(e,t)=>{throw t},w=h.ENVIRONMENT_IS_PTHREAD||!1,b="";function E(e){return h.locateFile?h.locateFile(e,b):b+e}b=self.location.href,n&&(b=n),b=0!==b.indexOf("blob:")?b.substr(0,b.replace(/[?#].*/,"").lastIndexOf("/")+1):"",f=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},m=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)},p=(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)};var _,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&&(y=h.thisProgram),h.quit&&(g=h.quit),h.wasmBinary&&(_=h.wasmBinary);var C,M,T=h.noExitRuntime||!0;"object"!=typeof WebAssembly&&ne("no native wasm support detected");var F,S,P,$,j,D,A,R,I,x=!1;function V(e,t){e||ne(t)}function Z(){var e=C.buffer;h.HEAP8=S=new Int8Array(e),h.HEAP16=$=new Int16Array(e),h.HEAPU8=P=new Uint8Array(e),h.HEAPU16=j=new Uint16Array(e),h.HEAP32=D=new Int32Array(e),h.HEAPU32=A=new Uint32Array(e),h.HEAPF32=R=new Float32Array(e),h.HEAPF64=I=new Float64Array(e)}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)C=h.wasmMemory;else if(h.wasmMemory)C=h.wasmMemory;else if(!((C=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=C.buffer.byteLength;var z=[],U=[],G=[],L=0;function Y(){return T||L>0}function B(){w||(h.noFSInit||Me.init.initialized||Me.init(),Me.ignorePermissions=!1,Ee.init(),De(U))}function H(e){z.unshift(e)}var X,J,K,Q=0,q=null,ee=null;function te(e){Q++,h.monitorRunDependencies&&h.monitorRunDependencies(Q)}function re(e){if(Q--,h.monitorRunDependencies&&h.monitorRunDependencies(Q),0==Q&&(null!==q&&(clearInterval(q),q=null),ee)){var t=ee;ee=null,t()}}function ne(e){h.onAbort&&h.onAbort(e),W(e="Aborted("+e+")"),x=!0,F=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw d(t),t}function oe(e){return e.startsWith("data:application/octet-stream;base64,")}function ae(e){if(e==X&&_)return new Uint8Array(_);if(m)return m(e);throw"both async and sync fetching of the wasm failed"}function ie(e,t,r){return function(e){return _||"function"!=typeof fetch?Promise.resolve().then((()=>ae(e))):fetch(e,{credentials:"same-origin"}).then((t=>{if(!t.ok)throw"failed to load wasm binary file at '"+e+"'";return t.arrayBuffer()})).catch((()=>ae(e)))}(e).then((e=>WebAssembly.instantiate(e,t))).then((e=>e)).then(r,(e=>{W(`failed to asynchronously prepare wasm: ${e}`),ne(e)}))}oe(X="ScanbotSDK.Asm-simd-threads.wasm")||(X=E(X));var se={1472444:e=>hn(function(){return this[Te(e)].toString()}.apply(function(){return this}.call(void 0)))};function ue(e){this.name="ExitStatus",this.message=`Program terminated with exit(${e})`,this.status=e}var ce=e=>{e.terminate(),e.onmessage=e=>{}},le=e=>{var t=je.pthreads[e];V(t),je.returnWorkerToPool(t)},de=e=>{var t=je.getNewWorker();if(!t)return 6;je.runningWorkers.push(t),je.pthreads[e.pthread_ptr]=t,t.pthread_ptr=e.pthread_ptr;var r={cmd:"run",start_routine:e.startRoutine,arg:e.arg,pthread_ptr:e.pthread_ptr};return t.postMessage(r,e.transferList),0},he={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:e=>{var t=he.isAbs(e),r="/"===e.substr(-1);return(e=he.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=he.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:e=>{if("/"===e)return"/";var t=(e=(e=he.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return he.normalize(e.join("/"))},join2:(e,t)=>he.normalize(e+"/"+t)},fe=e=>(fe=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>(e.set(crypto.getRandomValues(new Uint8Array(e.byteLength))),e);ne("initRandomDevice")})())(e),pe={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:Me.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t=he.isAbs(n)}return(t?"/":"")+(e=he.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||"."},relative:(e,t)=>{function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=pe.resolve(e).substr(1),t=pe.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var u=[];for(s=i;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(i))).join("/")}},me="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,ve=(e,t,r)=>{for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&me)return me.decode(e.buffer instanceof SharedArrayBuffer?e.slice(t,o):e.subarray(t,o));for(var a="";t<o;){var i=e[t++];if(128&i){var s=63&e[t++];if(192!=(224&i)){var u=63&e[t++];if((i=224==(240&i)?(15&i)<<12|s<<6|u:(7&i)<<18|s<<12|u<<6|63&e[t++])<65536)a+=String.fromCharCode(i);else{var c=i-65536;a+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a},ye=[],ge=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t},we=(e,t,r,n)=>{if(!(n>0))return 0;for(var o=r,a=r+n-1,i=0;i<e.length;++i){var s=e.charCodeAt(i);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++i)),s<=127){if(r>=a)break;t[r++]=s}else if(s<=2047){if(r+1>=a)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=a)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=a)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-o};function be(e,t,r){var n=r>0?r:ge(e)+1,o=new Array(n),a=we(e,o,0,o.length);return t&&(o.length=a),o}var Ee={ttys:[],init(){},shutdown(){},register(e,t){Ee.ttys[e]={input:[],output:[],ops:t},Me.registerDevice(e,Ee.stream_ops)},stream_ops:{open(e){var t=Ee.ttys[e.node.rdev];if(!t)throw new Me.ErrnoError(43);e.tty=t,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,t,r,n,o){if(!e.tty||!e.tty.ops.get_char)throw new Me.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new Me.ErrnoError(29)}if(void 0===s&&0===a)throw new Me.ErrnoError(6);if(null==s)break;a++,t[r+i]=s}return a&&(e.node.timestamp=Date.now()),a},write(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new Me.ErrnoError(60);try{for(var a=0;a<n;a++)e.tty.ops.put_char(e.tty,t[r+a])}catch(e){throw new Me.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:e=>(()=>{if(!ye.length){var e=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&null!==(e=readline())&&(e+="\n"),!e)return null;ye=be(e,!0)}return ye.shift()})(),put_char(e,t){null===t||10===t?(k(ve(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(k(ve(e.output,0)),e.output=[])},ioctl_tcgets:e=>({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:(e,t,r)=>0,ioctl_tiocgwinsz:e=>[24,80]},default_tty1_ops:{put_char(e,t){null===t||10===t?(W(ve(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&e.output.length>0&&(W(ve(e.output,0)),e.output=[])}}},_e=e=>{e=((e,t)=>Math.ceil(e/t)*t)(e,65536);var t=Fn(65536,e);return t?((e,t)=>(o().fill(0,e,e+t),e))(t,e):0},ke={ops_table:null,mount:e=>ke.createNode(null,"/",16895,0),createNode(e,t,r,n){if(Me.isBlkdev(r)||Me.isFIFO(r))throw new Me.ErrnoError(63);ke.ops_table||(ke.ops_table={dir:{node:{getattr:ke.node_ops.getattr,setattr:ke.node_ops.setattr,lookup:ke.node_ops.lookup,mknod:ke.node_ops.mknod,rename:ke.node_ops.rename,unlink:ke.node_ops.unlink,rmdir:ke.node_ops.rmdir,readdir:ke.node_ops.readdir,symlink:ke.node_ops.symlink},stream:{llseek:ke.stream_ops.llseek}},file:{node:{getattr:ke.node_ops.getattr,setattr:ke.node_ops.setattr},stream:{llseek:ke.stream_ops.llseek,read:ke.stream_ops.read,write:ke.stream_ops.write,allocate:ke.stream_ops.allocate,mmap:ke.stream_ops.mmap,msync:ke.stream_ops.msync}},link:{node:{getattr:ke.node_ops.getattr,setattr:ke.node_ops.setattr,readlink:ke.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ke.node_ops.getattr,setattr:ke.node_ops.setattr},stream:Me.chrdev_stream_ops}});var o=Me.createNode(e,t,r,n);return Me.isDir(o.mode)?(o.node_ops=ke.ops_table.dir.node,o.stream_ops=ke.ops_table.dir.stream,o.contents={}):Me.isFile(o.mode)?(o.node_ops=ke.ops_table.file.node,o.stream_ops=ke.ops_table.file.stream,o.usedBytes=0,o.contents=null):Me.isLink(o.mode)?(o.node_ops=ke.ops_table.link.node,o.stream_ops=ke.ops_table.link.stream):Me.isChrdev(o.mode)&&(o.node_ops=ke.ops_table.chrdev.node,o.stream_ops=ke.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:e=>e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0),expandFileStorage(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr(e){var t={};return t.dev=Me.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,Me.isDir(e.mode)?t.size=4096:Me.isFile(e.mode)?t.size=e.usedBytes:Me.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&ke.resizeFileStorage(e,t.size)},lookup(e,t){throw Me.genericErrors[44]},mknod:(e,t,r,n)=>ke.createNode(e,t,r,n),rename(e,t,r){if(Me.isDir(e.mode)){var n;try{n=Me.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new Me.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir(e,t){var r=Me.lookupNode(e,t);for(var n in r.contents)throw new Me.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink(e,t,r){var n=ke.createNode(e,t,41471,0);return n.link=r,n},readlink(e){if(!Me.isLink(e.mode))throw new Me.ErrnoError(28);return e.link}},stream_ops:{read(e,t,r,n,o){var a=e.node.contents;if(o>=e.node.usedBytes)return 0;var i=Math.min(e.node.usedBytes-o,n);if(i>8&&a.subarray)t.set(a.subarray(o,o+i),r);else for(var s=0;s<i;s++)t[r+s]=a[o+s];return i},write(e,r,n,o,a,i){if(r.buffer===t().buffer&&(i=!1),!o)return 0;var s=e.node;if(s.timestamp=Date.now(),r.subarray&&(!s.contents||s.contents.subarray)){if(i)return s.contents=r.subarray(n,n+o),s.usedBytes=o,o;if(0===s.usedBytes&&0===a)return s.contents=r.slice(n,n+o),s.usedBytes=o,o;if(a+o<=s.usedBytes)return s.contents.set(r.subarray(n,n+o),a),o}if(ke.expandFileStorage(s,a+o),s.contents.subarray&&r.subarray)s.contents.set(r.subarray(n,n+o),a);else for(var u=0;u<o;u++)s.contents[a+u]=r[n+u];return s.usedBytes=Math.max(s.usedBytes,a+o),o},llseek(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&Me.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new Me.ErrnoError(28);return n},allocate(e,t,r){ke.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap(e,r,n,o,a){if(!Me.isFile(e.node.mode))throw new Me.ErrnoError(43);var i,s,u=e.node.contents;if(2&a||u.buffer!==t().buffer){if((n>0||n+r<u.length)&&(u=u.subarray?u.subarray(n,n+r):Array.prototype.slice.call(u,n,n+r)),s=!0,!(i=_e(r)))throw new Me.ErrnoError(48);t().set(u,i)}else s=!1,i=u.byteOffset;return{ptr:i,allocated:s}},msync:(e,t,r,n,o)=>(ke.stream_ops.write(e,t,0,n,r,!1),0)}},We=h.preloadPlugins||[],Ce=(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},Me={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(e,t={}){if(!(e=pe.resolve(e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new Me.ErrnoError(32);for(var r=e.split("/").filter((e=>!!e)),n=Me.root,o="/",a=0;a<r.length;a++){var i=a===r.length-1;if(i&&t.parent)break;if(n=Me.lookupNode(n,r[a]),o=he.join2(o,r[a]),Me.isMountpoint(n)&&(!i||i&&t.follow_mount)&&(n=n.mounted.root),!i||t.follow)for(var s=0;Me.isLink(n.mode);){var u=Me.readlink(o);if(o=pe.resolve(he.dirname(o),u),n=Me.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new Me.ErrnoError(32)}}return{path:o,node:n}},getPath(e){for(var t;;){if(Me.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?`${r}/${t}`:r+t:r}t=t?`${e.name}/${t}`:e.name,e=e.parent}},hashName(e,t){for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%Me.nameTable.length},hashAddNode(e){var t=Me.hashName(e.parent.id,e.name);e.name_next=Me.nameTable[t],Me.nameTable[t]=e},hashRemoveNode(e){var t=Me.hashName(e.parent.id,e.name);if(Me.nameTable[t]===e)Me.nameTable[t]=e.name_next;else for(var r=Me.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode(e,t){var r=Me.mayLookup(e);if(r)throw new Me.ErrnoError(r,e);for(var n=Me.hashName(e.id,t),o=Me.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===t)return o}return Me.lookup(e,t)},createNode(e,t,r,n){var o=new Me.FSNode(e,t,r,n);return Me.hashAddNode(o),o},destroyNode(e){Me.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>49152==(49152&e),flagsToPermissionString(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>Me.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup(e){var t=Me.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate(e,t){try{return Me.lookupNode(e,t),20}catch(e){}return Me.nodePermissions(e,"wx")},mayDelete(e,t,r){var n;try{n=Me.lookupNode(e,t)}catch(e){return e.errno}var o=Me.nodePermissions(e,"wx");if(o)return o;if(r){if(!Me.isDir(n.mode))return 54;if(Me.isRoot(n)||Me.getPath(n)===Me.cwd())return 10}else if(Me.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?Me.isLink(e.mode)?32:Me.isDir(e.mode)&&("r"!==Me.flagsToPermissionString(t)||512&t)?31:Me.nodePermissions(e,Me.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=Me.MAX_OPEN_FDS;e++)if(!Me.streams[e])return e;throw new Me.ErrnoError(33)},getStreamChecked(e){var t=Me.getStream(e);if(!t)throw new Me.ErrnoError(8);return t},getStream:e=>Me.streams[e],createStream:(e,t=-1)=>(Me.FSStream||(Me.FSStream=function(){this.shared={}},Me.FSStream.prototype={},Object.defineProperties(Me.FSStream.prototype,{object:{get(){return this.node},set(e){this.node=e}},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(e){this.shared.flags=e}},position:{get(){return this.shared.position},set(e){this.shared.position=e}}})),e=Object.assign(new Me.FSStream,e),-1==t&&(t=Me.nextfd()),e.fd=t,Me.streams[t]=e,e),closeStream(e){Me.streams[e]=null},chrdev_stream_ops:{open(e){var t=Me.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek(){throw new Me.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice(e,t){Me.devices[e]={stream_ops:t}},getDevice:e=>Me.devices[e],getMounts(e){for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push.apply(r,n.mounts)}return t},syncfs(e,t){"function"==typeof e&&(t=e,e=!1),Me.syncFSRequests++,Me.syncFSRequests>1&&W(`warning: ${Me.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var r=Me.getMounts(Me.root.mount),n=0;function o(e){return Me.syncFSRequests--,t(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,o(e));++n>=r.length&&o(null)}r.forEach((t=>{if(!t.type.syncfs)return a(null);t.type.syncfs(t,e,a)}))},mount(e,t,r){var n,o="/"===r,a=!r;if(o&&Me.root)throw new Me.ErrnoError(10);if(!o&&!a){var i=Me.lookupPath(r,{follow_mount:!1});if(r=i.path,n=i.node,Me.isMountpoint(n))throw new Me.ErrnoError(10);if(!Me.isDir(n.mode))throw new Me.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?Me.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount(e){var t=Me.lookupPath(e,{follow_mount:!1});if(!Me.isMountpoint(t.node))throw new Me.ErrnoError(28);var r=t.node,n=r.mounted,o=Me.getMounts(n);Object.keys(Me.nameTable).forEach((e=>{for(var t=Me.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&Me.destroyNode(t),t=r}})),r.mounted=null;var a=r.mount.mounts.indexOf(n);r.mount.mounts.splice(a,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod(e,t,r){var n=Me.lookupPath(e,{parent:!0}).node,o=he.basename(e);if(!o||"."===o||".."===o)throw new Me.ErrnoError(28);var a=Me.mayCreate(n,o);if(a)throw new Me.ErrnoError(a);if(!n.node_ops.mknod)throw new Me.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,Me.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,Me.mknod(e,t,0)),mkdirTree(e,t){for(var r=e.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{Me.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>("undefined"==typeof r&&(r=t,t=438),t|=8192,Me.mknod(e,t,r)),symlink(e,t){if(!pe.resolve(e))throw new Me.ErrnoError(44);var r=Me.lookupPath(t,{parent:!0}).node;if(!r)throw new Me.ErrnoError(44);var n=he.basename(t),o=Me.mayCreate(r,n);if(o)throw new Me.ErrnoError(o);if(!r.node_ops.symlink)throw new Me.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename(e,t){var r,n,o=he.dirname(e),a=he.dirname(t),i=he.basename(e),s=he.basename(t);if(r=Me.lookupPath(e,{parent:!0}).node,n=Me.lookupPath(t,{parent:!0}).node,!r||!n)throw new Me.ErrnoError(44);if(r.mount!==n.mount)throw new Me.ErrnoError(75);var u,c=Me.lookupNode(r,i),l=pe.relative(e,a);if("."!==l.charAt(0))throw new Me.ErrnoError(28);if("."!==(l=pe.relative(t,o)).charAt(0))throw new Me.ErrnoError(55);try{u=Me.lookupNode(n,s)}catch(e){}if(c!==u){var d=Me.isDir(c.mode),h=Me.mayDelete(r,i,d);if(h)throw new Me.ErrnoError(h);if(h=u?Me.mayDelete(n,s,d):Me.mayCreate(n,s))throw new Me.ErrnoError(h);if(!r.node_ops.rename)throw new Me.ErrnoError(63);if(Me.isMountpoint(c)||u&&Me.isMountpoint(u))throw new Me.ErrnoError(10);if(n!==r&&(h=Me.nodePermissions(r,"w")))throw new Me.ErrnoError(h);Me.hashRemoveNode(c);try{r.node_ops.rename(c,n,s)}catch(e){throw e}finally{Me.hashAddNode(c)}}},rmdir(e){var t=Me.lookupPath(e,{parent:!0}).node,r=he.basename(e),n=Me.lookupNode(t,r),o=Me.mayDelete(t,r,!0);if(o)throw new Me.ErrnoError(o);if(!t.node_ops.rmdir)throw new Me.ErrnoError(63);if(Me.isMountpoint(n))throw new Me.ErrnoError(10);t.node_ops.rmdir(t,r),Me.destroyNode(n)},readdir(e){var t=Me.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new Me.ErrnoError(54);return t.node_ops.readdir(t)},unlink(e){var t=Me.lookupPath(e,{parent:!0}).node;if(!t)throw new Me.ErrnoError(44);var r=he.basename(e),n=Me.lookupNode(t,r),o=Me.mayDelete(t,r,!1);if(o)throw new Me.ErrnoError(o);if(!t.node_ops.unlink)throw new Me.ErrnoError(63);if(Me.isMountpoint(n))throw new Me.ErrnoError(10);t.node_ops.unlink(t,r),Me.destroyNode(n)},readlink(e){var t=Me.lookupPath(e).node;if(!t)throw new Me.ErrnoError(44);if(!t.node_ops.readlink)throw new Me.ErrnoError(28);return pe.resolve(Me.getPath(t.parent),t.node_ops.readlink(t))},stat(e,t){var r=Me.lookupPath(e,{follow:!t}).node;if(!r)throw new Me.ErrnoError(44);if(!r.node_ops.getattr)throw new Me.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>Me.stat(e,!0),chmod(e,t,r){var n;if(!(n="string"==typeof e?Me.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new Me.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod(e,t){Me.chmod(e,t,!0)},fchmod(e,t){var r=Me.getStreamChecked(e);Me.chmod(r.node,t)},chown(e,t,r,n){var o;if(!(o="string"==typeof e?Me.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new Me.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(e,t,r){Me.chown(e,t,r,!0)},fchown(e,t,r){var n=Me.getStreamChecked(e);Me.chown(n.node,t,r)},truncate(e,t){if(t<0)throw new Me.ErrnoError(28);var r;if(!(r="string"==typeof e?Me.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new Me.ErrnoError(63);if(Me.isDir(r.mode))throw new Me.ErrnoError(31);if(!Me.isFile(r.mode))throw new Me.ErrnoError(28);var n=Me.nodePermissions(r,"w");if(n)throw new Me.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate(e,t){var r=Me.getStreamChecked(e);if(0==(2097155&r.flags))throw new Me.ErrnoError(28);Me.truncate(r.node,t)},utime(e,t,r){var n=Me.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open(e,t,r){if(""===e)throw new Me.ErrnoError(44);var n;if(r="undefined"==typeof r?438:r,r=64&(t="string"==typeof t?(e=>{var t={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[e];if("undefined"==typeof t)throw new Error(`Unknown file open mode: ${e}`);return t})(t):t)?4095&r|32768:0,"object"==typeof e)n=e;else{e=he.normalize(e);try{n=Me.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var o=!1;if(64&t)if(n){if(128&t)throw new Me.ErrnoError(20)}else n=Me.mknod(e,r,0),o=!0;if(!n)throw new Me.ErrnoError(44);if(Me.isChrdev(n.mode)&&(t&=-513),65536&t&&!Me.isDir(n.mode))throw new Me.ErrnoError(54);if(!o){var a=Me.mayOpen(n,t);if(a)throw new Me.ErrnoError(a)}512&t&&!o&&Me.truncate(n,0),t&=-131713;var i=Me.createStream({node:n,path:Me.getPath(n),flags:t,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return i.stream_ops.open&&i.stream_ops.open(i),!h.logReadFiles||1&t||(Me.readFiles||(Me.readFiles={}),e in Me.readFiles||(Me.readFiles[e]=1)),i},close(e){if(Me.isClosed(e))throw new Me.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{Me.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek(e,t,r){if(Me.isClosed(e))throw new Me.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new Me.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new Me.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read(e,t,r,n,o){if(n<0||o<0)throw new Me.ErrnoError(28);if(Me.isClosed(e))throw new Me.ErrnoError(8);if(1==(2097155&e.flags))throw new Me.ErrnoError(8);if(Me.isDir(e.node.mode))throw new Me.ErrnoError(31);if(!e.stream_ops.read)throw new Me.ErrnoError(28);var a="undefined"!=typeof o;if(a){if(!e.seekable)throw new Me.ErrnoError(70)}else o=e.position;var i=e.stream_ops.read(e,t,r,n,o);return a||(e.position+=i),i},write(e,t,r,n,o,a){if(n<0||o<0)throw new Me.ErrnoError(28);if(Me.isClosed(e))throw new Me.ErrnoError(8);if(0==(2097155&e.flags))throw new Me.ErrnoError(8);if(Me.isDir(e.node.mode))throw new Me.ErrnoError(31);if(!e.stream_ops.write)throw new Me.ErrnoError(28);e.seekable&&1024&e.flags&&Me.llseek(e,0,2);var i="undefined"!=typeof o;if(i){if(!e.seekable)throw new Me.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,t,r,n,o,a);return i||(e.position+=s),s},allocate(e,t,r){if(Me.isClosed(e))throw new Me.ErrnoError(8);if(t<0||r<=0)throw new Me.ErrnoError(28);if(0==(2097155&e.flags))throw new Me.ErrnoError(8);if(!Me.isFile(e.node.mode)&&!Me.isDir(e.node.mode))throw new Me.ErrnoError(43);if(!e.stream_ops.allocate)throw new Me.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap(e,t,r,n,o){if(0!=(2&n)&&0==(2&o)&&2!=(2097155&e.flags))throw new Me.ErrnoError(2);if(1==(2097155&e.flags))throw new Me.ErrnoError(2);if(!e.stream_ops.mmap)throw new Me.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,o)},msync:(e,t,r,n,o)=>e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,o):0,munmap:e=>0,ioctl(e,t,r){if(!e.stream_ops.ioctl)throw new Me.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile(e,t={}){if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error(`Invalid encoding type "${t.encoding}"`);var r,n=Me.open(e,t.flags),o=Me.stat(e).size,a=new Uint8Array(o);return Me.read(n,a,0,o,0),"utf8"===t.encoding?r=ve(a,0):"binary"===t.encoding&&(r=a),Me.close(n),r},writeFile(e,t,r={}){r.flags=r.flags||577;var n=Me.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(ge(t)+1),a=we(t,o,0,o.length);Me.write(n,o,0,a,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");Me.write(n,t,0,t.byteLength,void 0,r.canOwn)}Me.close(n)},cwd:()=>Me.currentPath,chdir(e){var t=Me.lookupPath(e,{follow:!0});if(null===t.node)throw new Me.ErrnoError(44);if(!Me.isDir(t.node.mode))throw new Me.ErrnoError(54);var r=Me.nodePermissions(t.node,"x");if(r)throw new Me.ErrnoError(r);Me.currentPath=t.path},createDefaultDirectories(){Me.mkdir("/tmp"),Me.mkdir("/home"),Me.mkdir("/home/web_user")},createDefaultDevices(){Me.mkdir("/dev"),Me.registerDevice(Me.makedev(1,3),{read:()=>0,write:(e,t,r,n,o)=>n}),Me.mkdev("/dev/null",Me.makedev(1,3)),Ee.register(Me.makedev(5,0),Ee.default_tty_ops),Ee.register(Me.makedev(6,0),Ee.default_tty1_ops),Me.mkdev("/dev/tty",Me.makedev(5,0)),Me.mkdev("/dev/tty1",Me.makedev(6,0));var e=new Uint8Array(1024),t=0,r=()=>(0===t&&(t=fe(e).byteLength),e[--t]);Me.createDevice("/dev","random",r),Me.createDevice("/dev","urandom",r),Me.mkdir("/dev/shm"),Me.mkdir("/dev/shm/tmp")},createSpecialDirectories(){Me.mkdir("/proc");var e=Me.mkdir("/proc/self");Me.mkdir("/proc/self/fd"),Me.mount({mount(){var t=Me.createNode(e,"fd",16895,73);return t.node_ops={lookup(e,t){var r=+t,n=Me.getStreamChecked(r),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams(){h.stdin?Me.createDevice("/dev","stdin",h.stdin):Me.symlink("/dev/tty","/dev/stdin"),h.stdout?Me.createDevice("/dev","stdout",null,h.stdout):Me.symlink("/dev/tty","/dev/stdout"),h.stderr?Me.createDevice("/dev","stderr",null,h.stderr):Me.symlink("/dev/tty1","/dev/stderr"),Me.open("/dev/stdin",0),Me.open("/dev/stdout",1),Me.open("/dev/stderr",1)},ensureErrnoError(){Me.ErrnoError||(Me.ErrnoError=function(e,t){this.name="ErrnoError",this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},Me.ErrnoError.prototype=new Error,Me.ErrnoError.prototype.constructor=Me.ErrnoError,[44].forEach((e=>{Me.genericErrors[e]=new Me.ErrnoError(e),Me.genericErrors[e].stack="<generic error, no stack>"})))},staticInit(){Me.ensureErrnoError(),Me.nameTable=new Array(4096),Me.mount(ke,{},"/"),Me.createDefaultDirectories(),Me.createDefaultDevices(),Me.createSpecialDirectories(),Me.filesystems={MEMFS:ke}},init(e,t,r){Me.init.initialized=!0,Me.ensureErrnoError(),h.stdin=e||h.stdin,h.stdout=t||h.stdout,h.stderr=r||h.stderr,Me.createStandardStreams()},quit(){Me.init.initialized=!1;for(var e=0;e<Me.streams.length;e++){var t=Me.streams[e];t&&Me.close(t)}},findObject(e,t){var r=Me.analyzePath(e,t);return r.exists?r.object:null},analyzePath(e,t){try{e=(n=Me.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=Me.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=he.basename(e),n=Me.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(e){r.error=e.errno}return r},createPath(e,t,r,n){e="string"==typeof e?e:Me.getPath(e);for(var o=t.split("/").reverse();o.length;){var a=o.pop();if(a){var i=he.join2(e,a);try{Me.mkdir(i)}catch(e){}e=i}}return i},createFile(e,t,r,n,o){var a=he.join2("string"==typeof e?e:Me.getPath(e),t),i=Ce(n,o);return Me.create(a,i)},createDataFile(e,t,r,n,o,a){var i=t;e&&(e="string"==typeof e?e:Me.getPath(e),i=t?he.join2(e,t):e);var s=Ce(n,o),u=Me.create(i,s);if(r){if("string"==typeof r){for(var c=new Array(r.length),l=0,d=r.length;l<d;++l)c[l]=r.charCodeAt(l);r=c}Me.chmod(u,146|s);var h=Me.open(u,577);Me.write(h,r,0,r.length,0,a),Me.close(h),Me.chmod(u,s)}return u},createDevice(e,t,r,n){var o=he.join2("string"==typeof e?e:Me.getPath(e),t),a=Ce(!!r,!!n);Me.createDevice.major||(Me.createDevice.major=64);var i=Me.makedev(Me.createDevice.major++,0);return Me.registerDevice(i,{open(e){e.seekable=!1},close(e){n&&n.buffer&&n.buffer.length&&n(10)},read(e,t,n,o,a){for(var i=0,s=0;s<o;s++){var u;try{u=r()}catch(e){throw new Me.ErrnoError(29)}if(void 0===u&&0===i)throw new Me.ErrnoError(6);if(null==u)break;i++,t[n+s]=u}return i&&(e.node.timestamp=Date.now()),i},write(e,t,r,o,a){for(var i=0;i<o;i++)try{n(t[r+i])}catch(e){throw new Me.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),i}}),Me.mkdev(o,a,i)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!f)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=be(f(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new Me.ErrnoError(29)}},createLazyFile(e,r,n,o,a){function i(){this.lengthKnown=!1,this.chunks=[]}if(i.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",n,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+n+". Status: "+e.status);var t,r=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,a=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,i=1048576;o||(i=r);var s=this;s.setDataGetter((e=>{var t=e*i,o=(e+1)*i-1;if(o=Math.min(o,r-1),"undefined"==typeof s.chunks[e]&&(s.chunks[e]=((e,t)=>{if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>r-1)throw new Error("only "+r+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",n,!1),r!==i&&o.setRequestHeader("Range","bytes="+e+"-"+t),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||[]):be(o.responseText||"",!0)})(t,o)),"undefined"==typeof s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!a&&r||(i=r=1,r=this.getter(0).length,i=r,k("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=r,this._chunkSize=i,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){var s=new i;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=Me.createFile(e,r,u,o,a);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(e,t,r,n,o){var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s<i;s++)t[r+s]=a[o+s];else for(s=0;s<i;s++)t[r+s]=a.get(o+s);return i}return Object.keys(c.stream_ops).forEach((e=>{var t=c.stream_ops[e];l[e]=function(){return Me.forceLoadFile(c),t.apply(null,arguments)}})),l.read=(e,t,r,n,o)=>(Me.forceLoadFile(c),d(e,t,r,n,o)),l.mmap=(e,r,n,o,a)=>{Me.forceLoadFile(c);var i=_e(r);if(!i)throw new Me.ErrnoError(48);return d(e,t(),i,r,n),{ptr:i,allocated:!0}},c.stream_ops=l,c}},Te=(e,t)=>e?ve(o(),e,t):"",Fe={DEFAULT_POLLMASK:5,calculateAt(e,t,r){if(he.isAbs(t))return t;var n;if(n=-100===e?Me.cwd():Fe.getStreamFromFD(e).path,0==t.length){if(!r)throw new Me.ErrnoError(44);return n}return he.join2(n,t)},doStat(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&he.normalize(t)!==he.normalize(Me.getPath(e.node)))return-54;throw e}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,K=[n.size>>>0,(J=n.size,+Math.abs(J)>=1?J>0?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],s()[r+24>>2]=K[0],s()[r+28>>2]=K[1],s()[r+32>>2]=4096,s()[r+36>>2]=n.blocks;var o=n.atime.getTime(),a=n.mtime.getTime(),i=n.ctime.getTime();return K=[Math.floor(o/1e3)>>>0,(J=Math.floor(o/1e3),+Math.abs(J)>=1?J>0?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],s()[r+40>>2]=K[0],s()[r+44>>2]=K[1],u()[r+48>>2]=o%1e3*1e3,K=[Math.floor(a/1e3)>>>0,(J=Math.floor(a/1e3),+Math.abs(J)>=1?J>0?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],s()[r+56>>2]=K[0],s()[r+60>>2]=K[1],u()[r+64>>2]=a%1e3*1e3,K=[Math.floor(i/1e3)>>>0,(J=Math.floor(i/1e3),+Math.abs(J)>=1?J>0?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],s()[r+72>>2]=K[0],s()[r+76>>2]=K[1],u()[r+80>>2]=i%1e3*1e3,K=[n.ino>>>0,(J=n.ino,+Math.abs(J)>=1?J>0?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],s()[r+88>>2]=K[0],s()[r+92>>2]=K[1],0},doMsync(e,t,r,n,a){if(!Me.isFile(t.node.mode))throw new Me.ErrnoError(43);if(2&n)return 0;var i=o().slice(e,e+r);Me.msync(t,i,a,r,n)},varargs:void 0,get(){var e=s()[Fe.varargs>>2];return Fe.varargs+=4,e},getp:()=>Fe.get(),getStr:e=>Te(e),getStreamFromFD:e=>Me.getStreamChecked(e)};function Se(e){if(w)return Ar(0,1,e);F=e,Y()||(je.terminateAllThreads(),h.onExit&&h.onExit(e),x=!0),g(e,new ue(e))}var Pe=(e,t)=>{if(F=e,w)throw Ae(e),"unwind";Se(e)},$e=e=>{if(e instanceof ue||"unwind"==e)return F;g(1,e)},je={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],pthreads:{},init(){w?je.initWorker():je.initMainThread()},initMainThread(){for(var e=Math.min(4,Math.max(1,navigator.hardwareConcurrency-1));e--;)je.allocateUnusedWorker();H((()=>{te(),je.loadWasmModuleToAllWorkers((()=>re()))}))},initWorker(){T=!1},setExitStatus:e=>{F=e},terminateAllThreads__deps:["$terminateWorker"],terminateAllThreads:()=>{for(var e of je.runningWorkers)ce(e);for(var e of je.unusedWorkers)ce(e);je.unusedWorkers=[],je.runningWorkers=[],je.pthreads=[]},returnWorkerToPool:e=>{var t=e.pthread_ptr;delete je.pthreads[t],je.unusedWorkers.push(e),je.runningWorkers.splice(je.runningWorkers.indexOf(e),1),e.pthread_ptr=0,jn(t)},receiveObjectTransfer(e){},threadInitTLS(){je.tlsInitFunctions.forEach((e=>e()))},loadWasmModuleToWorker:e=>new Promise((t=>{e.onmessage=r=>{var n=r.data,o=n.cmd;if(n.targetThread&&n.targetThread!=Mn()){var a=je.pthreads[n.targetThread];a?a.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 i;"checkMailbox"===o?jr():"spawnThread"===o?de(n):"cleanupThread"===o?le(n.thread):"killThread"===o?(e=>{var t=je.pthreads[e];delete je.pthreads[e],ce(t),jn(e),je.runningWorkers.splice(je.runningWorkers.indexOf(t),1),t.pthread_ptr=0})(n.thread):"cancelThread"===o?(i=n.thread,je.pthreads[i].postMessage({cmd:"cancel"})):"loaded"===o?(e.loaded=!0,t(e)):"alert"===o?alert(`Thread ${n.threadId}: ${n.text}`):"setimmediate"===n.target?e.postMessage(n):"callHandler"===o?h[n.handler](...n.args):o&&W(`worker sent an unknown command ${o}`)}},e.onerror=e=>{throw W(`worker sent an error! ${e.filename}:${e.lineno}: ${e.message}`),e};var r=[];for(var o of["onExit","onAbort","print","printErr"])h.hasOwnProperty(o)&&r.push(o);e.postMessage({cmd:"load",handlers:r,urlOrBlob:h.mainScriptUrlOrBlob||n,wasmMemory:C,wasmModule:M})})),loadWasmModuleToAllWorkers(e){if(w)return e();Promise.all(je.unusedWorkers.map(je.loadWasmModuleToWorker)).then(e)},allocateUnusedWorker(){var e,t=E("ScanbotSDK.Asm-simd-threads.worker.js");e=new Worker(t),je.unusedWorkers.push(e)},getNewWorker:()=>(0==je.unusedWorkers.length&&(je.allocateUnusedWorker(),je.loadWasmModuleToWorker(je.unusedWorkers[0])),je.unusedWorkers.pop())};h.PThread=je;var De=e=>{for(;e.length>0;)e.shift()(h)};function Ae(e){if(w)return Ar(1,0,e);Pe(e)}h.establishStackSpace=()=>{var e=Mn(),t=s()[e+52>>2],r=s()[e+56>>2];In(t,t-r),Vn(t)};var Re=e=>O.get(e);h.invokeEntryPoint=(e,t)=>{!function(e){Y()?je.setExitStatus(e):Dn(e)}(Re(e)(t))};var Ie=e=>{je.tlsInitFunctions.push(e)},xe=[],Ve=0,Ze=0;function Oe(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){u()[this.ptr+4>>2]=e},this.get_type=function(){return u()[this.ptr+4>>2]},this.set_destructor=function(e){u()[this.ptr+8>>2]=e},this.get_destructor=function(){return u()[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,t()[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=t()[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,t()[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=t()[this.ptr+13>>0]},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)},this.set_adjusted_ptr=function(e){u()[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return u()[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Un(this.get_type()))return u()[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}var Ne=e=>{var t=Ze;if(!t)return Tn(0),0;var r=new Oe(t);r.set_adjusted_ptr(t);var n=r.get_type();if(!n)return Tn(0),t;for(var o in e){var a=e[o];if(0===a||a===n)break;var i=r.ptr+16;if(zn(a,n,i))return Tn(a),t}return Tn(n),t},ze=()=>{var e=xe.pop();e||ne("no exception to throw");var t=e.excPtr;throw e.get_rethrown()||(xe.push(e),e.set_rethrown(!0),e.set_caught(!1),Ve++),Ze=t};function Ue(e,t,r,n){return w?Ar(2,1,e,t,r,n):Ge(e,t,r,n)}var Ge=(e,t,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 Ue(e,t,r,n);var a={startRoutine:r,pthread_ptr:e,arg:n,transferList:o};return w?(a.cmd="spawnThread",postMessage(a,o),0):de(a)};function Le(e,t,r,n,o){if(w)return Ar(3,1,e,t,r,n,o);try{for(var a=0,i=t?s()[t>>2]:0,u=t?s()[t+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,y=0,g=0,b=(t?s()[t>>2]:0)|(r?s()[r>>2]:0)|(n?s()[n>>2]:0),E=(t?s()[t+4>>2]:0)|(r?s()[r+4>>2]:0)|(n?s()[n+4>>2]:0),_=function(e,t,r,n){return e<32?t&n:r&n},k=0;k<e;k++){var W=1<<k%32;if(_(k,b,E,W)){var C=Fe.getStreamFromFD(k),M=Fe.DEFAULT_POLLMASK;if(C.stream_ops.poll){var T=-1;o&&(T=1e3*((t?s()[o>>2]:0)+(t?s()[o+8>>2]:0)/1e6)),M=C.stream_ops.poll(C,T)}1&M&&_(k,i,u,W)&&(k<32?f|=W:p|=W,a++),4&M&&_(k,c,l,W)&&(k<32?m|=W:v|=W,a++),2&M&&_(k,d,h,W)&&(k<32?y|=W:g|=W,a++)}}return t&&(s()[t>>2]=f,s()[t+4>>2]=p),r&&(s()[r>>2]=m,s()[r+4>>2]=v),n&&(s()[n>>2]=y,s()[n+4>>2]=g),a}catch(e){if("undefined"==typeof Me||"ErrnoError"!==e.name)throw e;return-e.errno}}function Ye(e,t){if(w)return Ar(4,1,e,t);try{return e=Fe.getStr(e),Me.chmod(e,t),0}catch(e){if("undefined"==typeof Me||"ErrnoError"!==e.name)throw e;return-e.errno}}function Be(e,t){if(w)return Ar(5,1,e,t);try{return Me.fchmod(e,t),0}catch(e){if("undefined"==typeof Me||"ErrnoError"!==e.name)throw e;return-e.errno}}function He(e,t,r){if(w)return Ar(6,1,e,t,r);Fe.varargs=r;try{var n=Fe.getStreamFromFD(e);switch(t){case 0:if((o=Fe.get())<0)return-28;for(;Me.streams[o];)o++;return Me.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=Fe.get();return n.flags|=o,0;case 5:return o=Fe.getp(),a()[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return i=28,s()[Cn()>>2]=i,-1}}catch(e){if("undefined"==typeof Me||"ErrnoError"!==e.name)throw e;return-e.errno}var i}function Xe(e,t){if(w)return Ar(7,1,e,t);try{var r=Fe.getStreamFromFD(e);return Fe.doStat(Me.stat,r.path,t)}catch(e){if("undefined"==typeof Me||"ErrnoError"!==e.name)throw e;return-e.errno}}var Je=(e,t)=>t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN;function Ke(e,t,r){if(w)return Ar(8,1,e,t,r);var n=Je(t,r);try{return isNaN(n)?61:(Me.ftruncate(e,n),0)}catch(e){if("undefined"==typeof Me||"ErrnoError"!==e.name)throw e;return-e.errno}}var Qe=(e,t,r)=>we(e,o(),t,r);function qe(e,t){if(w)return Ar(9,1,e,t);try{if(0===t)return-28;var r=Me.cwd(),n=ge(r)+1;return t<n?-68:(Qe(r,e,t),n)}catch(e){if("undefined"==typeof Me||"ErrnoError"!==e.name)throw e;return-e.errno}}function et(e,r,n){if(w)return Ar(10,1,e,r,n);try{var o=Fe.getStreamFromFD(e);o.getdents||(o.getdents=Me.readdir(o.path));for(var i=280,u=0,c=Me.llseek(o,0,1),l=Math.floor(c/i);l<o.getdents.length&&u+i<=n;){var d,h,f=o.getdents[l];if("."===f)d=o.node.id,h=4;else if(".."===f)d=Me.lookupPath(o.path,{parent:!0}).node.id,h=4;else{var p=Me.lookupNode(o.node,f);d=p.id,h=Me.isChrdev(p.mode)?2:Me.isDir(p.mode)?4:Me.isLink(p.mode)?10:8}K=[d>>>0,(J=d,+Math.abs(J)>=1?J>0?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],s()[r+u>>2]=K[0],s()[r+u+4>>2]=K[1],K=[(l+1)*i>>>0,(J=(l+1)*i,+Math.abs(J)>=1?J>0?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],s()[r+u+8>>2]=K[0],s()[r+u+12>>2]=K[1],a()[r+u+16>>1]=280,t()[r+u+18>>0]=h,Qe(f,r+u+19,256),u+=i,l+=1}return Me.llseek(o,l*i,0),u}catch(e){if("undefined"==typeof Me||"ErrnoError"!==e.name)throw e;return-e.errno}}function tt(e,r,n){if(w)return Ar(11,1,e,r,n);Fe.varargs=n;try{var o=Fe.getStreamFromFD(e);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 i=o.tty.ops.ioctl_tcgets(o),u=Fe.getp();s()[u>>2]=i.c_iflag||0,s()[u+4>>2]=i.c_oflag||0,s()[u+8>>2]=i.c_cflag||0,s()[u+12>>2]=i.c_lflag||0;for(var c=0;c<32;c++)t()[u+c+17>>0]=i.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=Fe.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(t()[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=Fe.getp(),s()[u>>2]=0,0):-59;case 21520:return o.tty?-28:-59;case 21531:return u=Fe.getp(),Me.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=Fe.getp(),a()[u>>1]=m[0],a()[u+2>>1]=m[1]}return 0;default:return-28}}catch(e){if("undefined"==typeof Me||"ErrnoError"!==e.name)throw e;return-e.errno}}function rt(e,t){if(w)return Ar(12,1,e,t);try{return e=Fe.getStr(e),Fe.doStat(Me.lstat,e,t)}catch(e){if("undefined"==typeof Me||"ErrnoError"!==e.name)throw e;return-e.errno}}function nt(e,t,r){if(w)return Ar(13,1,e,t,r);try{return t=Fe.getStr(t),t=Fe.calculateAt(e,t),"/"===(t=he.normalize(t))[t.length-1]&&(t=t.substr(0,t.length-1)),Me.mkdir(t,r,0),0}catch(e){if("undefined"==typeof Me||"ErrnoError"!==e.name)throw e;return-e.errno}}function ot(e,t,r,n){if(w)return Ar(14,1,e,t,r,n);try{t=Fe.getStr(t);var o=256&n,a=4096&n;return n&=-6401,t=Fe.calculateAt(e,t,a),Fe.doStat(o?Me.lstat:Me.stat,t,r)}catch(e){if("undefined"==typeof Me||"ErrnoError"!==e.name)throw e;return-e.errno}}function at(e,t,r,n){if(w)return Ar(15,1,e,t,r,n);Fe.varargs=n;try{t=Fe.getStr(t),t=Fe.calculateAt(e,t);var o=n?Fe.get():0;return Me.open(t,r,o).fd}catch(e){if("undefined"==typeof Me||"ErrnoError"!==e.name)throw e;return-e.errno}}function it(e,r,n,o){if(w)return Ar(16,1,e,r,n,o);try{if(r=Fe.getStr(r),r=Fe.calculateAt(e,r),o<=0)return-28;var a=Me.readlink(r),i=Math.min(o,ge(a)),s=t()[n+i];return Qe(a,n,o+1),t()[n+i]=s,i}catch(e){if("undefined"==typeof Me||"ErrnoError"!==e.name)throw e;return-e.errno}}function st(e){if(w)return Ar(17,1,e);try{return e=Fe.getStr(e),Me.rmdir(e),0}catch(e){if("undefined"==typeof Me||"ErrnoError"!==e.name)throw e;return-e.errno}}function ut(e,t){if(w)return Ar(18,1,e,t);try{return e=Fe.getStr(e),Fe.doStat(Me.stat,e,t)}catch(e){if("undefined"==typeof Me||"ErrnoError"!==e.name)throw e;return-e.errno}}function ct(e,t){if(w)return Ar(19,1,e,t);try{return e=Fe.getStr(e),t=Fe.getStr(t),Me.symlink(e,t),0}catch(e){if("undefined"==typeof Me||"ErrnoError"!==e.name)throw e;return-e.errno}}function lt(e,t,r){if(w)return Ar(20,1,e,t,r);try{return t=Fe.getStr(t),t=Fe.calculateAt(e,t),0===r?Me.unlink(t):512===r?Me.rmdir(t):ne("Invalid flags passed to unlinkat"),0}catch(e){if("undefined"==typeof Me||"ErrnoError"!==e.name)throw e;return-e.errno}}var dt=void 0,ht=e=>{for(var t="",r=e;o()[r];)t+=dt[o()[r++]];return t},ft={},pt={},mt={},vt=void 0,yt=e=>{throw new vt(e)},gt=void 0,wt=e=>{throw new gt(e)},bt=(e,t,r)=>{function n(t){var n=r(t);n.length!==e.length&&wt("Mismatched type converter count");for(var o=0;o<e.length;++o)Et(e[o],n[o])}e.forEach((function(e){mt[e]=t}));var o=new Array(t.length),a=[],i=0;t.forEach(((e,t)=>{pt.hasOwnProperty(e)?o[t]=pt[e]:(a.push(e),ft.hasOwnProperty(e)||(ft[e]=[]),ft[e].push((()=>{o[t]=pt[e],++i===a.length&&n(o)})))})),0===a.length&&n(o)};function Et(e,t,r={}){if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");return function(e,t,r={}){var n=t.name;if(e||yt(`type "${n}" must have a positive integer typeid pointer`),pt.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;yt(`Cannot register type '${n}' twice`)}if(pt[e]=t,delete mt[e],ft.hasOwnProperty(e)){var o=ft[e];delete ft[e],o.forEach((e=>e()))}}(e,t,r)}function _t(e){if(!(this instanceof Gt))return!1;if(!(e instanceof Gt))return!1;for(var t=this.$$.ptrType.registeredClass,r=this.$$.ptr,n=e.$$.ptrType.registeredClass,o=e.$$.ptr;t.baseClass;)r=t.upcast(r),t=t.baseClass;for(;n.baseClass;)o=n.upcast(o),n=n.baseClass;return t===n&&r===o}var kt=e=>{yt(e.$$.ptrType.registeredClass.name+" instance already deleted")},Wt=!1,Ct=e=>{},Mt=e=>{e.count.value-=1,0===e.count.value&&(e=>{e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)})(e)},Tt=(e,t,r)=>{if(t===r)return e;if(void 0===r.baseClass)return null;var n=Tt(e,t,r.baseClass);return null===n?null:r.downcast(n)},Ft={},St=()=>Object.keys(Rt).length,Pt=()=>{var e=[];for(var t in Rt)Rt.hasOwnProperty(t)&&e.push(Rt[t]);return e},$t=[],jt=()=>{for(;$t.length;){var e=$t.pop();e.$$.deleteScheduled=!1,e.delete()}},Dt=void 0,At=e=>{Dt=e,$t.length&&Dt&&Dt(jt)},Rt={},It=(e,t)=>(t=((e,t)=>{for(void 0===t&&yt("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t})(e,t),Rt[t]),xt=(e,t)=>(t.ptrType&&t.ptr||wt("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&wt("Both smartPtrType and smartPtr must be specified"),t.count={value:1},Zt(Object.create(e,{$$:{value:t}})));function Vt(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=It(this.registeredClass,t);if(void 0!==r){if(0===r.$$.count.value)return r.$$.ptr=t,r.$$.smartPtr=e,r.clone();var n=r.clone();return this.destructor(e),n}function o(){return this.isSmartPointer?xt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):xt(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var a,i=this.registeredClass.getActualType(t),s=Ft[i];if(!s)return o.call(this);a=this.isConst?s.constPointerType:s.pointerType;var u=Tt(t,this.registeredClass,a.registeredClass);return null===u?o.call(this):this.isSmartPointer?xt(a.registeredClass.instancePrototype,{ptrType:a,ptr:u,smartPtrType:this,smartPtr:e}):xt(a.registeredClass.instancePrototype,{ptrType:a,ptr:u})}var Zt=e=>"undefined"==typeof FinalizationRegistry?(Zt=e=>e,e):(Wt=new FinalizationRegistry((e=>{Mt(e.$$)})),Zt=e=>{var t=e.$$;if(t.smartPtr){var r={$$:t};Wt.register(e,r,e)}return e},Ct=e=>Wt.unregister(e),Zt(e));function Ot(){if(this.$$.ptr||kt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=Zt(Object.create(Object.getPrototypeOf(this),{$$:{value:(e=this.$$,{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType})}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t}function Nt(){this.$$.ptr||kt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&yt("Object already scheduled for deletion"),Ct(this),Mt(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function zt(){return!this.$$.ptr}function Ut(){return this.$$.ptr||kt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&yt("Object already scheduled for deletion"),$t.push(this),1===$t.length&&Dt&&Dt(jt),this.$$.deleteScheduled=!0,this}function Gt(){}var Lt=e=>{if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=48&&t<=57?`_${e}`:e};function Yt(e,t){return{[e=Lt(e)]:function(){return t.apply(this,arguments)}}[e]}var Bt=(e,t,r)=>{if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||yt(`Function '${r}' called with an invalid number of arguments (${arguments.length}) - expects one of (${e[t].overloadTable})!`),e[t].overloadTable[arguments.length].apply(this,arguments)},e[t].overloadTable=[],e[t].overloadTable[n.argCount]=n}},Ht=(e,t,r)=>{h.hasOwnProperty(e)?((void 0===r||void 0!==h[e].overloadTable&&void 0!==h[e].overloadTable[r])&&yt(`Cannot register public name '${e}' twice`),Bt(h,e,e),h.hasOwnProperty(r)&&yt(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`),h[e].overloadTable[r]=t):(h[e]=t,void 0!==r&&(h[e].numArguments=r))};function Xt(e,t,r,n,o,a,i,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=a,this.upcast=i,this.downcast=s,this.pureVirtualFunctions=[]}var Jt=(e,t,r)=>{for(;t!==r;)t.upcast||yt(`Expected null or instance of ${r.name}, got an instance of ${t.name}`),e=t.upcast(e),t=t.baseClass;return e};function Kt(e,t){if(null===t)return this.isReference&&yt(`null is not a valid ${this.name}`),0;t.$$||yt(`Cannot pass "${br(t)}" as a ${this.name}`),t.$$.ptr||yt(`Cannot pass deleted object as a pointer of type ${this.name}`);var r=t.$$.ptrType.registeredClass;return Jt(t.$$.ptr,r,this.registeredClass)}function Qt(e,t){var r;if(null===t)return this.isReference&&yt(`null is not a valid ${this.name}`),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t.$$||yt(`Cannot pass "${br(t)}" as a ${this.name}`),t.$$.ptr||yt(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&t.$$.ptrType.isConst&&yt(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);var n=t.$$.ptrType.registeredClass;if(r=Jt(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&yt("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:yt(`Cannot convert argument of type ${t.$$.smartPtrType?t.$$.smartPtrType.name:t.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:r=t.$$.smartPtr;break;case 2:if(t.$$.smartPtrType===this)r=t.$$.smartPtr;else{var o=t.clone();r=this.rawShare(r,gr.toHandle((()=>o.delete()))),null!==e&&e.push(this.rawDestructor,r)}break;default:yt("Unsupporting sharing policy")}return r}function qt(e,t){if(null===t)return this.isReference&&yt(`null is not a valid ${this.name}`),0;t.$$||yt(`Cannot pass "${br(t)}" as a ${this.name}`),t.$$.ptr||yt(`Cannot pass deleted object as a pointer of type ${this.name}`),t.$$.ptrType.isConst&&yt(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);var r=t.$$.ptrType.registeredClass;return Jt(t.$$.ptr,r,this.registeredClass)}function er(e){return this.fromWireType(u()[e>>2])}function tr(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function rr(e){this.rawDestructor&&this.rawDestructor(e)}var nr=e=>{null!==e&&e.delete()};function or(e,t,r,n,o,a,i,s,u,c,l){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=a,this.sharingPolicy=i,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=c,this.rawDestructor=l,o||void 0!==t.baseClass?this.toWireType=Qt:n?(this.toWireType=Kt,this.destructorFunction=null):(this.toWireType=qt,this.destructorFunction=null)}var ar=(e,t,r)=>{h.hasOwnProperty(e)||wt("Replacing nonexistant public symbol"),void 0!==h[e].overloadTable&&void 0!==r?h[e].overloadTable[r]=t:(h[e]=t,h[e].argCount=r)},ir=(e,t,r)=>e.includes("j")?((e,t,r)=>{var n=h["dynCall_"+e];return r&&r.length?n.apply(null,[t].concat(r)):n.call(null,t)})(e,t,r):Re(t).apply(null,r),sr=(e,t)=>{var r,n,o,a=(e=ht(e)).includes("j")?(r=e,n=t,o=[],function(){return o.length=0,Object.assign(o,arguments),ir(r,n,o)}):Re(t);return"function"!=typeof a&&yt(`unknown function pointer with signature ${e}: ${t}`),a},ur=void 0,cr=e=>{var t=Sn(e),r=ht(t);return Wn(t),r},lr=(e,t)=>{var r=[],n={};throw t.forEach((function e(t){n[t]||pt[t]||(mt[t]?mt[t].forEach(e):(r.push(t),n[t]=!0))})),new ur(`${e}: `+r.map(cr).join([", "]))},dr=e=>{for(;e.length;){var t=e.pop();e.pop()(t)}};function hr(e,t,r,n,o,a){var i=t.length;i<2&&yt("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var s=null!==t[1]&&null!==r,u=!1,c=1;c<t.length;++c)if(null!==t[c]&&void 0===t[c].destructorFunction){u=!0;break}var l="void"!==t[0].name,d=i-2,h=new Array(d),f=[],p=[];return function(){var r;arguments.length!==d&&yt(`function ${e} called with ${arguments.length} arguments, expected ${d}`),p.length=0,f.length=s?2:1,f[0]=o,s&&(r=t[1].toWireType(p,this),f[1]=r);for(var a=0;a<d;++a)h[a]=t[a+2].toWireType(p,arguments[a]),f.push(h[a]);var i=n.apply(null,f);function c(e){if(u)dr(p);else for(var n=s?1:2;n<t.length;n++){var o=1===n?r:h[n-2];null!==t[n].destructorFunction&&t[n].destructorFunction(o)}if(l)return t[0].fromWireType(e)}return c(i)}}var fr=(e,t)=>{for(var r=[],n=0;n<e;n++)r.push(u()[t+4*n>>2]);return r};function pr(){this.allocated=[void 0],this.freelist=[]}var mr=new pr,vr=e=>{e>=mr.reserved&&0==--mr.get(e).refcount&&mr.free(e)},yr=()=>{for(var e=0,t=mr.reserved;t<mr.allocated.length;++t)void 0!==mr.allocated[t]&&++e;return e},gr={toValue:e=>(e||yt("Cannot use deleted val. handle = "+e),mr.get(e).value),toHandle:e=>{switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return mr.allocate({refcount:1,value:e})}}};function wr(e){return this.fromWireType(s()[e>>2])}var br=e=>{if(null===e)return"null";var t=typeof e;return"object"===t||"array"===t||"function"===t?e.toString():""+e},Er=(e,t)=>{switch(t){case 4:return function(e){return this.fromWireType((C.buffer!=S.buffer&&Z(),R)[e>>2])};case 8:return function(e){return this.fromWireType(c()[e>>3])};default:throw new TypeError(`invalid float width (${t}): ${e}`)}},_r=(e,r,n)=>{switch(r){case 1:return n?e=>t()[e>>0]:e=>o()[e>>0];case 2:return n?e=>a()[e>>1]:e=>i()[e>>1];case 4:return n?e=>s()[e>>2]:e=>u()[e>>2];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}},kr="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Wr=(e,t)=>{for(var r=e,n=r>>1,s=n+t/2;!(n>=s)&&i()[n];)++n;if((r=n<<1)-e>32&&kr)return kr.decode(o().slice(e,r));for(var u="",c=0;!(c>=t/2);++c){var l=a()[e+2*c>>1];if(0==l)break;u+=String.fromCharCode(l)}return u},Cr=(e,t,r)=>{if(void 0===r&&(r=2147483647),r<2)return 0;for(var n=t,o=(r-=2)<2*e.length?r/2:e.length,i=0;i<o;++i){var s=e.charCodeAt(i);a()[t>>1]=s,t+=2}return a()[t>>1]=0,t-n},Mr=e=>2*e.length,Tr=(e,t)=>{for(var r=0,n="";!(r>=t/4);){var o=s()[e+4*r>>2];if(0==o)break;if(++r,o>=65536){var a=o-65536;n+=String.fromCharCode(55296|a>>10,56320|1023&a)}else n+=String.fromCharCode(o)}return n},Fr=(e,t,r)=>{if(void 0===r&&(r=2147483647),r<4)return 0;for(var n=t,o=n+r-4,a=0;a<e.length;++a){var i=e.charCodeAt(a);if(i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++a)),s()[t>>2]=i,(t+=4)+4>o)break}return s()[t>>2]=0,t-n},Sr=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&++r,t+=4}return t},Pr=e=>{if(!x)try{e(),(()=>{if(!Y())try{w?Dn(F):Pe(F)}catch(e){$e(e)}})()}catch(e){$e(e)}},$r=e=>{if("function"==typeof Atomics.waitAsync){Atomics.waitAsync(s(),e>>2,e).value.then(jr);var t=e+128;Atomics.store(s(),t>>2,1)}};h.__emscripten_thread_mailbox_await=$r;var jr=()=>{var e=Mn();e&&($r(e),Pr((()=>An())))};h.checkMailbox=jr;var Dr=e=>{var t=xn(),r=e();return Vn(t),r},Ar=function(e,t){var r=arguments.length-2,n=arguments;return Dr((()=>{for(var o=r,a=Zn(8*o),i=a>>3,s=0;s<r;s++){var u=n[2+s];c()[i+s]=u}return $n(e,o,a,t)}))},Rr=[],Ir=(e,t)=>{var r=pt[e];return void 0===r&&yt(t+" has unknown type "+cr(e)),r},xr={},Vr=e=>{var t=xr[e];return void 0===t?ht(e):t},Zr=[],Or=()=>{if("object"==typeof globalThis)return globalThis;function e(e){e.$$$embind_global$$$=e;var t="object"==typeof $$$embind_global$$$&&e.$$$embind_global$$$==e;return t||delete e.$$$embind_global$$$,t}if("object"==typeof $$$embind_global$$$)return $$$embind_global$$$;if("object"==typeof r.g&&e(r.g)?$$$embind_global$$$=r.g:"object"==typeof self&&e(self)&&($$$embind_global$$$=self),"object"==typeof $$$embind_global$$$)return $$$embind_global$$$;throw Error("unable to get global object.")},Nr=[],zr=e=>e%4==0&&(e%100!=0||e%400==0),Ur=[0,31,60,91,121,152,182,213,244,274,305,335],Gr=[0,31,59,90,120,151,181,212,243,273,304,334];function Lr(e,t,r,n,o,a,i,c){if(w)return Ar(21,1,e,t,r,n,o,a,i,c);var l=Je(o,a);try{if(isNaN(l))return 61;var d=Fe.getStreamFromFD(n),h=Me.mmap(d,e,l,t,r),f=h.ptr;return s()[i>>2]=h.allocated,u()[c>>2]=f,0}catch(e){if("undefined"==typeof Me||"ErrnoError"!==e.name)throw e;return-e.errno}}function Yr(e,t,r,n,o,a,i){if(w)return Ar(22,1,e,t,r,n,o,a,i);var s=Je(a,i);try{if(isNaN(s))return 61;var u=Fe.getStreamFromFD(o);2&r&&Fe.doMsync(e,u,t,n,s),Me.munmap(u)}catch(e){if("undefined"==typeof Me||"ErrnoError"!==e.name)throw e;return-e.errno}}var Br,Hr=e=>{var t=ge(e)+1,r=kn(t);return r&&Qe(e,r,t),r},Xr=[],Jr=(e,t,r)=>{var n=((e,t)=>{var r;for(Xr.length=0;r=o()[e++];)t+=105!=r&&t%8?4:0,Xr.push(105==r?s()[t>>2]:c()[t>>3]),t+=105==r?4:8;return Xr})(t,r);return se[e].apply(null,n)};Br=()=>performance.timeOrigin+performance.now();var Kr=e=>{ne("OOM")},Qr=e=>{var t=(e-C.buffer.byteLength+65535)/65536;try{return C.grow(t),Z(),1}catch(e){}},qr={},en=()=>{if(!en.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:y||"./this.program"};for(var t in qr)void 0===qr[t]?delete e[t]:e[t]=qr[t];var r=[];for(var t in e)r.push(`${t}=${e[t]}`);en.strings=r}return en.strings},tn=function(e,r){if(w)return Ar(23,1,e,r);var n=0;return en().forEach(((o,a)=>{var i=r+n;u()[e+4*a>>2]=i,((e,r)=>{for(var n=0;n<e.length;++n)t()[r++>>0]=e.charCodeAt(n);t()[r>>0]=0})(o,i),n+=o.length+1})),0},rn=function(e,t){if(w)return Ar(24,1,e,t);var r=en();u()[e>>2]=r.length;var n=0;return r.forEach((e=>n+=e.length+1)),u()[t>>2]=n,0};function nn(e){if(w)return Ar(25,1,e);try{var t=Fe.getStreamFromFD(e);return Me.close(t),0}catch(e){if("undefined"==typeof Me||"ErrnoError"!==e.name)throw e;return e.errno}}function on(e,r){if(w)return Ar(26,1,e,r);try{var n=Fe.getStreamFromFD(e),o=n.tty?2:Me.isDir(n.mode)?3:Me.isLink(n.mode)?7:4;return t()[r>>0]=o,a()[r+2>>1]=0,K=[0,(J=0,+Math.abs(J)>=1?J>0?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],s()[r+8>>2]=K[0],s()[r+12>>2]=K[1],K=[0,(J=0,+Math.abs(J)>=1?J>0?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],s()[r+16>>2]=K[0],s()[r+20>>2]=K[1],0}catch(e){if("undefined"==typeof Me||"ErrnoError"!==e.name)throw e;return e.errno}}function an(e,r,n,o){if(w)return Ar(27,1,e,r,n,o);try{var a=((e,r,n,o)=>{for(var a=0,i=0;i<n;i++){var s=u()[r>>2],c=u()[r+4>>2];r+=8;var l=Me.read(e,t(),s,c,o);if(l<0)return-1;if(a+=l,l<c)break;"undefined"!=typeof o&&(o+=l)}return a})(Fe.getStreamFromFD(e),r,n);return u()[o>>2]=a,0}catch(e){if("undefined"==typeof Me||"ErrnoError"!==e.name)throw e;return e.errno}}function sn(e,t,r,n,o){if(w)return Ar(28,1,e,t,r,n,o);var a=Je(t,r);try{if(isNaN(a))return 61;var i=Fe.getStreamFromFD(e);return Me.llseek(i,a,n),K=[i.position>>>0,(J=i.position,+Math.abs(J)>=1?J>0?+Math.floor(J/4294967296)>>>0:~~+Math.ceil((J-+(~~J>>>0))/4294967296)>>>0:0)],s()[o>>2]=K[0],s()[o+4>>2]=K[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0}catch(e){if("undefined"==typeof Me||"ErrnoError"!==e.name)throw e;return e.errno}}function un(e,r,n,o){if(w)return Ar(29,1,e,r,n,o);try{var a=((e,r,n,o)=>{for(var a=0,i=0;i<n;i++){var s=u()[r>>2],c=u()[r+4>>2];r+=8;var l=Me.write(e,t(),s,c,o);if(l<0)return-1;a+=l,"undefined"!=typeof o&&(o+=l)}return a})(Fe.getStreamFromFD(e),r,n);return u()[o>>2]=a,0}catch(e){if("undefined"==typeof Me||"ErrnoError"!==e.name)throw e;return e.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=(e,r,n,o)=>{var a=u()[o+40>>2],i={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:a?Te(a):""},c=Te(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(e,t,r){for(var n="number"==typeof e?e.toString():e||"";n.length<t;)n=r[0]+n;return n}function m(e,t){return p(e,t,"0")}function v(e,t){function r(e){return e<0?-1:e>0?1:0}var n;return 0===(n=r(e.getFullYear()-t.getFullYear()))&&0===(n=r(e.getMonth()-t.getMonth()))&&(n=r(e.getDate()-t.getDate())),n}function y(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function g(e){var t=((e,t)=>{for(var r=new Date(e.getTime());t>0;){var n=zr(r.getFullYear()),o=r.getMonth(),a=(n?cn:ln)[o];if(!(t>a-r.getDate()))return r.setDate(r.getDate()+t),r;t-=a-r.getDate()+1,r.setDate(1),o<11?r.setMonth(o+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r})(new Date(e.tm_year+1900,0,1),e.tm_yday),r=new Date(t.getFullYear(),0,4),n=new Date(t.getFullYear()+1,0,4),o=y(r),a=y(n);return v(o,t)<=0?v(a,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var w={"%a":e=>h[e.tm_wday].substring(0,3),"%A":e=>h[e.tm_wday],"%b":e=>f[e.tm_mon].substring(0,3),"%B":e=>f[e.tm_mon],"%C":e=>m((e.tm_year+1900)/100|0,2),"%d":e=>m(e.tm_mday,2),"%e":e=>p(e.tm_mday,2," "),"%g":e=>g(e).toString().substring(2),"%G":e=>g(e),"%H":e=>m(e.tm_hour,2),"%I":e=>{var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),m(t,2)},"%j":e=>m(e.tm_mday+((e,t)=>{for(var r=0,n=0;n<=t;r+=e[n++]);return r})(zr(e.tm_year+1900)?cn:ln,e.tm_mon-1),3),"%m":e=>m(e.tm_mon+1,2),"%M":e=>m(e.tm_min,2),"%n":()=>"\n","%p":e=>e.tm_hour>=0&&e.tm_hour<12?"AM":"PM","%S":e=>m(e.tm_sec,2),"%t":()=>"\t","%u":e=>e.tm_wday||7,"%U":e=>{var t=e.tm_yday+7-e.tm_wday;return m(Math.floor(t/7),2)},"%V":e=>{var t=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&t++,t){if(53==t){var r=(e.tm_wday+371-e.tm_yday)%7;4==r||3==r&&zr(e.tm_year)||(t=1)}}else{t=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&zr(e.tm_year%400-1))&&t++}return m(t,2)},"%w":e=>e.tm_wday,"%W":e=>{var t=e.tm_yday+7-(e.tm_wday+6)%7;return m(Math.floor(t/7),2)},"%y":e=>(e.tm_year+1900).toString().substring(2),"%Y":e=>e.tm_year+1900,"%z":e=>{var t=e.tm_gmtoff,r=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(r?"+":"-")+String("0000"+t).slice(-4)},"%Z":e=>e.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](i)));var b,E,_=be(c=c.replace(/\0\0/g,"%"),!1);return _.length>r?0:(b=_,E=e,t().set(b,E),_.length-1)},hn=Hr;je.init();var fn,pn,mn,vn=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=Me.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},yn=365,gn=146;Object.defineProperties(vn.prototype,{read:{get:function(){return(this.mode&yn)===yn},set:function(e){e?this.mode|=yn:this.mode&=-366}},write:{get:function(){return(this.mode&gn)===gn},set:function(e){e?this.mode|=gn:this.mode&=-147}},isFolder:{get:function(){return Me.isDir(this.mode)}},isDevice:{get:function(){return Me.isChrdev(this.mode)}}}),Me.FSNode=vn,Me.createPreloadedFile=(e,t,r,n,o,a,i,s,u,c)=>{var l=t?pe.resolve(he.join2(e,t)):e;function d(r){function d(r){c&&c(),s||Me.createDataFile(e,t,r,n,o,u),a&&a(),re()}((e,t,r,n)=>{"undefined"!=typeof Browser&&Browser.init();var o=!1;return We.forEach((a=>{o||a.canHandle(t)&&(a.handle(e,t,r,n),o=!0)})),o})(r,l,d,(()=>{i&&i(),re()}))||d(r)}te(),"string"==typeof r?((e,t,r,n)=>{var o=n?"":`al ${e}`;p(e,(r=>{V(r,`Loading data file "${e}" failed (no arrayBuffer).`),t(new Uint8Array(r)),o&&re()}),(t=>{if(!r)throw`Loading data file "${e}" failed.`;r()})),o&&te()})(r,(e=>d(e)),i):d(r)},Me.staticInit(),(()=>{for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);dt=e})(),vt=h.BindingError=class extends Error{constructor(e){super(e),this.name="BindingError"}},gt=h.InternalError=class extends Error{constructor(e){super(e),this.name="InternalError"}},Gt.prototype.isAliasOf=_t,Gt.prototype.clone=Ot,Gt.prototype.delete=Nt,Gt.prototype.isDeleted=zt,Gt.prototype.deleteLater=Ut,h.getInheritedInstanceCount=St,h.getLiveInheritedInstances=Pt,h.flushPendingDeletes=jt,h.setDelayFunction=At,or.prototype.getPointee=tr,or.prototype.destructor=rr,or.prototype.argPackAdvance=8,or.prototype.readValueFromPointer=er,or.prototype.deleteObject=nr,or.prototype.fromWireType=Vt,ur=h.UnboundTypeError=(fn=Error,(mn=Yt(pn="UnboundTypeError",(function(e){this.name=pn,this.message=e;var t=new Error(e).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.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(e){return this.allocated[e]},has(e){return void 0!==this.allocated[e]},allocate(e){var t=this.freelist.pop()||this.allocated.length;return this.allocated[t]=e,t},free(e){this.allocated[e]=void 0,this.freelist.push(e)}}),mr.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),mr.reserved=mr.allocated.length,h.count_emval_handles=yr;var wn,bn=[Se,Ae,Ue,Le,Ye,Be,He,Xe,Ke,qe,et,tt,rt,nt,ot,at,it,st,ut,ct,lt,Lr,Yr,tn,rn,nn,on,an,sn,un],En={m:(e,t,r,n)=>{ne(`Assertion failed: ${Te(e)}, at: `+[t?Te(t):"unknown filename",r,n?Te(n):"unknown function"])},u:e=>{var t=new Oe(e);return t.get_caught()||(t.set_caught(!0),Ve--),t.set_rethrown(!1),xe.push(t),Nn(t.excPtr),t.get_exception_ptr()},Gb:()=>{if(!xe.length)return 0;var e=xe[xe.length-1];return Nn(e.excPtr),e.excPtr},w:()=>{Rn(0,0);var e=xe.pop();On(e.excPtr),Ze=0},b:()=>Ne([]),i:e=>Ne([e]),q:(e,t)=>Ne([e,t]),ka:ze,Eb:e=>{if(e){var t=new Oe(e);xe.push(t),t.set_rethrown(!0),ze()}},t:(e,t,r)=>{throw new Oe(e).init(t,r),Ve++,Ze=e},Hb:()=>Ve,Ub:e=>{Pn(e,!1,1,!0,4194304,!1),je.threadInitTLS()},Ba:e=>{w?postMessage({cmd:"cleanupThread",thread:e}):le(e)},Qb:Ge,c:e=>{throw Ze||(Ze=e),Ze},Nb:Le,xb:Ye,yb:Be,Fa:He,$b:Xe,hb:Ke,Bb:qe,zb:et,ac:tt,Yb:rt,Sb:nt,Zb:ot,Ga:at,Ab:it,Ob:st,_b:ut,wb:ct,Pb:lt,qb:(e,t,r,n,o)=>{},Ja:(e,t,r,n)=>{Et(e,{name:t=ht(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?r:n},argPackAdvance:8,readValueFromPointer:function(e){return this.fromWireType(o()[e])},destructorFunction:null})},W:(e,t,r,n,o,a,i,s,u,c,l,d,h)=>{l=ht(l),a=sr(o,a),s&&(s=sr(i,s)),c&&(c=sr(u,c)),h=sr(d,h);var f=Lt(l);Ht(f,(function(){lr(`Cannot construct ${l} due to unbound types`,[n])})),bt([e,t,r],n?[n]:[],(function(t){var r,o;t=t[0],o=n?(r=t.registeredClass).instancePrototype:Gt.prototype;var i=Yt(f,(function(){if(Object.getPrototypeOf(this)!==u)throw new vt("Use 'new' to construct "+l);if(void 0===d.constructor_body)throw new vt(l+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new vt(`Tried to invoke ctor of ${l} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(d.constructor_body).toString()}) parameters instead!`);return e.apply(this,arguments)})),u=Object.create(o,{constructor:{value:i}});i.prototype=u;var d=new Xt(l,i,u,h,r,a,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 Ft[e]={pointerType:m,constPointerType:v},ar(f,i),[p,m,v]}))},V:(e,t,r,n,o,a,i,s)=>{var u=fr(r,n);t=ht(t),a=sr(o,a),bt([],[e],(function(e){var n=`${(e=e[0]).name}.${t}`;function o(){lr(`Cannot call ${n} due to unbound types`,u)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]);var s=e.registeredClass.constructor;return void 0===s[t]?(o.argCount=r-1,s[t]=o):(Bt(s,t,n),s[t].overloadTable[r-1]=o),bt([],u,(function(o){var u=[o[0],null].concat(o.slice(1)),c=hr(n,u,null,a,i);if(void 0===s[t].overloadTable?(c.argCount=r-1,s[t]=c):s[t].overloadTable[r-1]=c,e.registeredClass.__derivedClasses)for(const r of e.registeredClass.__derivedClasses)r.constructor.hasOwnProperty(t)||(r.constructor[t]=c);return[]})),[]}))},E:(e,t,r,n,o,a,i,s,u)=>{var c=fr(r,n);t=ht(t),a=sr(o,a),bt([],[e],(function(e){var n=`${(e=e[0]).name}.${t}`;function o(){lr(`Cannot call ${n} due to unbound types`,c)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);var u=e.registeredClass.instancePrototype,l=u[t];return void 0===l||void 0===l.overloadTable&&l.className!==e.name&&l.argCount===r-2?(o.argCount=r-2,o.className=e.name,u[t]=o):(Bt(u,t,n),u[t].overloadTable[r-2]=o),bt([],c,(function(o){var s=hr(n,o,e,a,i);return void 0===u[t].overloadTable?(s.argCount=r-2,u[t]=s):u[t].overloadTable[r-2]=s,[]})),[]}))},ec:(e,t)=>{Et(e,{name:t=ht(t),fromWireType:e=>{var t=gr.toValue(e);return vr(e),t},toWireType:(e,t)=>gr.toHandle(t),argPackAdvance:8,readValueFromPointer:wr,destructorFunction:null})},Ia:(e,t,r)=>{Et(e,{name:t=ht(t),fromWireType:e=>e,toWireType:(e,t)=>t,argPackAdvance:8,readValueFromPointer:Er(t,r),destructorFunction:null})},Y:(e,t,r,n,o,a,i)=>{var s=fr(t,r);e=ht(e),o=sr(n,o),Ht(e,(function(){lr(`Cannot call ${e} due to unbound types`,s)}),t-1),bt([],s,(function(r){var n=[r[0],null].concat(r.slice(1));return ar(e,hr(e,n,null,o,a),t-1),[]}))},N:(e,t,r,n,o)=>{t=ht(t),-1===o&&(o=4294967295);var a=e=>e;if(0===n){var i=32-8*r;a=e=>e<<i>>>i}var s=t.includes("unsigned");Et(e,{name:t,fromWireType:a,toWireType:s?function(e,t){return this.name,t>>>0}:function(e,t){return this.name,t},argPackAdvance:8,readValueFromPointer:_r(t,r,0!==n),destructorFunction:null})},F:(e,r,n)=>{var o=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function a(e){var r=u()[e>>2],n=u()[e+4>>2];return new o(t().buffer,n,r)}Et(e,{name:n=ht(n),fromWireType:a,argPackAdvance:8,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})},Ha:(e,t)=>{var r="std::string"===(t=ht(t));Et(e,{name:t,fromWireType:e=>{var t,n=u()[e>>2],a=e+4;if(r)for(var i=a,s=0;s<=n;++s){var c=a+s;if(s==n||0==o()[c]){var l=Te(i,c-i);void 0===t?t=l:(t+=String.fromCharCode(0),t+=l),i=c+1}}else{var d=new Array(n);for(s=0;s<n;++s)d[s]=String.fromCharCode(o()[a+s]);t=d.join("")}return Wn(e),t},toWireType:(e,t)=>{var n;t instanceof ArrayBuffer&&(t=new Uint8Array(t));var a="string"==typeof t;a||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||yt("Cannot pass non-string to std::string"),n=r&&a?ge(t):t.length;var i=kn(4+n+1),s=i+4;if(u()[i>>2]=n,r&&a)Qe(t,s,n+1);else if(a)for(var c=0;c<n;++c){var l=t.charCodeAt(c);l>255&&(Wn(s),yt("String has UTF-16 code units that do not fit in 8 bits")),o()[s+c]=l}else for(c=0;c<n;++c)o()[s+c]=t[c];return null!==e&&e.push(Wn,i),i},argPackAdvance:8,readValueFromPointer:er,destructorFunction:e=>Wn(e)})},ta:(e,t,r)=>{var n,o,a,s,c;r=ht(r),2===t?(n=Wr,o=Cr,s=Mr,a=()=>i(),c=1):4===t&&(n=Tr,o=Fr,s=Sr,a=()=>u(),c=2),Et(e,{name:r,fromWireType:e=>{for(var r,o=u()[e>>2],i=a(),s=e+4,l=0;l<=o;++l){var d=e+4+l*t;if(l==o||0==i[d>>c]){var h=n(s,d-s);void 0===r?r=h:(r+=String.fromCharCode(0),r+=h),s=d+t}}return Wn(e),r},toWireType:(e,n)=>{"string"!=typeof n&&yt(`Cannot pass non-string to C++ string type ${r}`);var a=s(n),i=kn(4+a+t);return u()[i>>2]=a>>c,o(n,i+4,a+t),null!==e&&e.push(Wn,i),i},argPackAdvance:8,readValueFromPointer:wr,destructorFunction:e=>Wn(e)})},Ka:(e,t)=>{Et(e,{isVoid:!0,name:t=ht(t),argPackAdvance:0,fromWireType:()=>{},toWireType:(e,t)=>{}})},dc:()=>!0,Lb:(e,t,r)=>{if(e==t)setTimeout((()=>jr()));else if(w)postMessage({targetThread:e,cmd:"checkMailbox"});else{var n=je.pthreads[e];if(!n)return;n.postMessage({cmd:"checkMailbox"})}},Rb:(e,t,r,n)=>{Rr.length=r;for(var o=n>>3,a=0;a<r;a++)Rr[a]=c()[o+a];var i=e<0?se[-e-1]:bn[e];je.currentProxiedOperationCallerThread=t;var s=i.apply(null,Rr);return je.currentProxiedOperationCallerThread=0,s},Tb:$r,cc:e=>{},Ib:()=>{throw 1/0},Z:(e,t,r)=>{e=gr.toValue(e),t=Ir(t,"emval::as");var n=[],o=gr.toHandle(n);return u()[r>>2]=o,t.toWireType(n,e)},fa:(e,t,r,n,o)=>(e=Zr[e])(t=gr.toValue(t),r=Vr(r),(e=>{var t=[];return u()[e>>2]=gr.toHandle(t),t})(n),o),qa:(e,t,r,n)=>{(e=Zr[e])(t=gr.toValue(t),r=Vr(r),null,n)},Fb:vr,ra:e=>0===e?gr.toHandle(Or()):(e=Vr(e),gr.toHandle(Or()[e])),S:(e,t)=>{var r=((e,t)=>{for(var r=new Array(e),n=0;n<e;++n)r[n]=Ir(u()[t+4*n>>2],"parameter "+n);return r})(e,t),n=r[0],o=n.name+"_$"+r.slice(1).map((function(e){return e.name})).join("_")+"$",a=Nr[o];if(void 0!==a)return a;var i,s,c=new Array(e-1);return i=(t,o,a,i)=>{for(var s=0,u=0;u<e-1;++u)c[u]=r[u+1].readValueFromPointer(i+s),s+=r[u+1].argPackAdvance;var l=t[o].apply(t,c);for(u=0;u<e-1;++u)r[u+1].deleteObject&&r[u+1].deleteObject(c[u]);if(!n.isVoid)return n.toWireType(a,l)},s=Zr.length,Zr.push(i),a=s,Nr[o]=a,a},gb:(e,t)=>(e=gr.toValue(e),t=gr.toValue(t),gr.toHandle(e[t])),v:e=>{e>4&&(mr.get(e).refcount+=1)},eb:(e,t)=>(e=gr.toValue(e))instanceof(t=gr.toValue(t)),_:e=>"number"==typeof(e=gr.toValue(e)),I:e=>"string"==typeof(e=gr.toValue(e)),X:()=>gr.toHandle([]),K:e=>gr.toHandle(Vr(e)),A:()=>gr.toHandle({}),fb:e=>{var t=gr.toValue(e);dr(t),vr(e)},Xb:(e,t,r)=>{e=gr.toValue(e),t=gr.toValue(t),r=gr.toValue(r),e[t]=r},L:(e,t)=>{var r=(e=Ir(e,"_emval_take_value")).readValueFromPointer(t);return gr.toHandle(r)},C:e=>(e=gr.toValue(e),gr.toHandle(typeof e)),nb:function(e,t,r){var n=Je(e,t),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 a=Date.UTC(o.getUTCFullYear(),0,1,0,0,0,0),i=(o.getTime()-a)/864e5|0;s()[r+28>>2]=i},ob:function(e,t,r){var n=Je(e,t),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 a=0|(e=>(zr(e.getFullYear())?Ur:Gr)[e.getMonth()]+e.getDate()-1)(o);s()[r+28>>2]=a,s()[r+36>>2]=-60*o.getTimezoneOffset();var i=new Date(o.getFullYear(),0,1),u=new Date(o.getFullYear(),6,1).getTimezoneOffset(),c=i.getTimezoneOffset(),l=0|(u!=c&&o.getTimezoneOffset()==Math.min(c,u));s()[r+32>>2]=l},lb:Lr,mb:Yr,Kb:(e,t,r)=>{var n=(new Date).getFullYear(),o=new Date(n,0,1),a=new Date(n,6,1),i=o.getTimezoneOffset(),c=a.getTimezoneOffset(),l=Math.max(i,c);function d(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}u()[e>>2]=60*l,s()[t>>2]=Number(i!=c);var h=d(o),f=d(a),p=Hr(h),m=Hr(f);c<i?(u()[r>>2]=p,u()[r+4>>2]=m):(u()[r>>2]=m,u()[r+4>>2]=p)},B:()=>{ne("")},bb:(e,t,r)=>Jr(e,t,r),Ca:()=>{},$:()=>Date.now(),bc:()=>{throw L+=1,"unwind"},Mb:()=>2147483648,J:Br,va:()=>navigator.hardwareConcurrency,Jb:e=>{var t=o().length;if((e>>>=0)<=t)return!1;var r=2147483648;e>r&&Kr();for(var n,a,i=1;i<=4;i*=2){var s=t*(1+.2/i);s=Math.min(s,e+100663296);var u=Math.min(r,(n=Math.max(e,s))+((a=65536)-n%a)%a);if(Qr(u))return!0}Kr()},Vb:tn,Wb:rn,ua:Pe,ia:nn,Da:on,Ea:an,pb:sn,sa:un,db:function(){return hn(location.toString())},vb:(e,t)=>(fe(o().subarray(e,e+t)),0),cb:function(){return hn((e=Qn,self[e(231,"mBYV")][e(241,"vCNw")]()));var e},Ua:function(e,t){var r=xn();try{return Re(e)(t)}catch(e){if(Vn(r),e!==e+0)throw e;Rn(1,0)}},Wa:function(e,t,r){var n=xn();try{return Re(e)(t,r)}catch(e){if(Vn(n),e!==e+0)throw e;Rn(1,0)}},Q:function(e,t,r,n,o,a){var i=xn();try{return Re(e)(t,r,n,o,a)}catch(e){if(Vn(i),e!==e+0)throw e;Rn(1,0)}},T:function(e,t,r,n){var o=xn();try{return Re(e)(t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;Rn(1,0)}},pa:function(e,t,r,n,o){var a=xn();try{return Re(e)(t,r,n,o)}catch(e){if(Vn(a),e!==e+0)throw e;Rn(1,0)}},Va:function(e,t){var r=xn();try{return Re(e)(t)}catch(e){if(Vn(r),e!==e+0)throw e;Rn(1,0)}},$a:function(e,t,r){var n=xn();try{return Re(e)(t,r)}catch(e){if(Vn(n),e!==e+0)throw e;Rn(1,0)}},ca:function(e,t,r,n){var o=xn();try{return Re(e)(t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;Rn(1,0)}},s:function(e){var t=xn();try{return Re(e)()}catch(e){if(Vn(t),e!==e+0)throw e;Rn(1,0)}},j:function(e,t){var r=xn();try{return Re(e)(t)}catch(e){if(Vn(r),e!==e+0)throw e;Rn(1,0)}},ya:function(e,t,r,n){var o=xn();try{return Re(e)(t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;Rn(1,0)}},Ya:function(e,t,r,n){var o=xn();try{return Re(e)(t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;Rn(1,0)}},_a:function(e,t,r,n,o){var a=xn();try{return Re(e)(t,r,n,o)}catch(e){if(Vn(a),e!==e+0)throw e;Rn(1,0)}},Za:function(e,t,r,n,o,a,i,s){var u=xn();try{return Re(e)(t,r,n,o,a,i,s)}catch(e){if(Vn(u),e!==e+0)throw e;Rn(1,0)}},d:function(e,t,r){var n=xn();try{return Re(e)(t,r)}catch(e){if(Vn(n),e!==e+0)throw e;Rn(1,0)}},ab:function(e,t,r,n){var o=xn();try{return Re(e)(t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;Rn(1,0)}},k:function(e,t,r,n){var o=xn();try{return Re(e)(t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;Rn(1,0)}},U:function(e,t,r,n,o){var a=xn();try{return Re(e)(t,r,n,o)}catch(e){if(Vn(a),e!==e+0)throw e;Rn(1,0)}},l:function(e,t,r,n,o){var a=xn();try{return Re(e)(t,r,n,o)}catch(e){if(Vn(a),e!==e+0)throw e;Rn(1,0)}},Db:function(e,t,r,n,o,a){var i=xn();try{return Re(e)(t,r,n,o,a)}catch(e){if(Vn(i),e!==e+0)throw e;Rn(1,0)}},Aa:function(e,t,r,n,o,a,i){var s=xn();try{return Re(e)(t,r,n,o,a,i)}catch(e){if(Vn(s),e!==e+0)throw e;Rn(1,0)}},p:function(e,t,r,n,o,a){var i=xn();try{return Re(e)(t,r,n,o,a)}catch(e){if(Vn(i),e!==e+0)throw e;Rn(1,0)}},H:function(e,t,r,n,o,a,i){var s=xn();try{return Re(e)(t,r,n,o,a,i)}catch(e){if(Vn(s),e!==e+0)throw e;Rn(1,0)}},ja:function(e,t,r,n,o,a,i,s){var u=xn();try{return Re(e)(t,r,n,o,a,i,s)}catch(e){if(Vn(u),e!==e+0)throw e;Rn(1,0)}},Ma:function(e,t,r,n,o,a,i,s,u){var c=xn();try{return Re(e)(t,r,n,o,a,i,s,u)}catch(e){if(Vn(c),e!==e+0)throw e;Rn(1,0)}},La:function(e,t,r,n,o,a,i,s,u,c){var l=xn();try{return Re(e)(t,r,n,o,a,i,s,u,c)}catch(e){if(Vn(l),e!==e+0)throw e;Rn(1,0)}},Xa:function(e,t,r,n,o,a,i,s,u,c,l){var d=xn();try{return Re(e)(t,r,n,o,a,i,s,u,c,l)}catch(e){if(Vn(d),e!==e+0)throw e;Rn(1,0)}},ha:function(e,t,r,n,o,a,i,s,u,c,l,d){var h=xn();try{return Re(e)(t,r,n,o,a,i,s,u,c,l,d)}catch(e){if(Vn(h),e!==e+0)throw e;Rn(1,0)}},sb:function(e,t,r,n){var o=xn();try{return Ln(e,t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;Rn(1,0)}},kb:function(e){var t=xn();try{return Bn(e)}catch(e){if(Vn(t),e!==e+0)throw e;Rn(1,0)}},ub:function(e,t){var r=xn();try{return Gn(e,t)}catch(e){if(Vn(r),e!==e+0)throw e;Rn(1,0)}},jb:function(e,t,r){var n=xn();try{return Hn(e,t,r)}catch(e){if(Vn(n),e!==e+0)throw e;Rn(1,0)}},ib:function(e,t,r,n,o){var a=xn();try{return Jn(e,t,r,n,o)}catch(e){if(Vn(a),e!==e+0)throw e;Rn(1,0)}},o:function(e){var t=xn();try{Re(e)()}catch(e){if(Vn(t),e!==e+0)throw e;Rn(1,0)}},e:function(e,t){var r=xn();try{Re(e)(t)}catch(e){if(Vn(r),e!==e+0)throw e;Rn(1,0)}},ea:function(e,t,r){var n=xn();try{Re(e)(t,r)}catch(e){if(Vn(n),e!==e+0)throw e;Rn(1,0)}},xa:function(e,t,r,n){var o=xn();try{Re(e)(t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;Rn(1,0)}},Ta:function(e,t,r,n,o,a,i,s){var u=xn();try{Re(e)(t,r,n,o,a,i,s)}catch(e){if(Vn(u),e!==e+0)throw e;Rn(1,0)}},f:function(e,t,r){var n=xn();try{Re(e)(t,r)}catch(e){if(Vn(n),e!==e+0)throw e;Rn(1,0)}},x:function(e,t,r,n){var o=xn();try{Re(e)(t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;Rn(1,0)}},oa:function(e,t,r,n,o){var a=xn();try{Re(e)(t,r,n,o)}catch(e){if(Vn(a),e!==e+0)throw e;Rn(1,0)}},aa:function(e,t,r,n,o,a){var i=xn();try{Re(e)(t,r,n,o,a)}catch(e){if(Vn(i),e!==e+0)throw e;Rn(1,0)}},za:function(e,t,r,n,o,a,i,s){var u=xn();try{Re(e)(t,r,n,o,a,i,s)}catch(e){if(Vn(u),e!==e+0)throw e;Rn(1,0)}},Sa:function(e,t,r,n,o,a,i){var s=xn();try{Re(e)(t,r,n,o,a,i)}catch(e){if(Vn(s),e!==e+0)throw e;Rn(1,0)}},ba:function(e,t,r,n,o,a,i,s){var u=xn();try{Re(e)(t,r,n,o,a,i,s)}catch(e){if(Vn(u),e!==e+0)throw e;Rn(1,0)}},Ra:function(e,t,r,n,o){var a=xn();try{Re(e)(t,r,n,o)}catch(e){if(Vn(a),e!==e+0)throw e;Rn(1,0)}},ma:function(e,t,r,n){var o=xn();try{Re(e)(t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;Rn(1,0)}},h:function(e,t,r,n){var o=xn();try{Re(e)(t,r,n)}catch(e){if(Vn(o),e!==e+0)throw e;Rn(1,0)}},O:function(e,t,r,n,o){var a=xn();try{Re(e)(t,r,n,o)}catch(e){if(Vn(a),e!==e+0)throw e;Rn(1,0)}},G:function(e,t,r,n,o,a){var i=xn();try{Re(e)(t,r,n,o,a)}catch(e){if(Vn(i),e!==e+0)throw e;Rn(1,0)}},D:function(e,t,r,n,o,a,i){var s=xn();try{Re(e)(t,r,n,o,a,i)}catch(e){if(Vn(s),e!==e+0)throw e;Rn(1,0)}},M:function(e,t,r,n,o,a){var i=xn();try{Re(e)(t,r,n,o,a)}catch(e){if(Vn(i),e!==e+0)throw e;Rn(1,0)}},g:function(e,t,r,n,o){var a=xn();try{Re(e)(t,r,n,o)}catch(e){if(Vn(a),e!==e+0)throw e;Rn(1,0)}},na:function(e,t,r,n,o,a,i,s){var u=xn();try{Re(e)(t,r,n,o,a,i,s)}catch(e){if(Vn(u),e!==e+0)throw e;Rn(1,0)}},Na:function(e,t,r,n,o,a,i,s){var u=xn();try{Re(e)(t,r,n,o,a,i,s)}catch(e){if(Vn(u),e!==e+0)throw e;Rn(1,0)}},la:function(e,t,r,n,o,a){var i=xn();try{Re(e)(t,r,n,o,a)}catch(e){if(Vn(i),e!==e+0)throw e;Rn(1,0)}},n:function(e,t,r,n,o,a){var i=xn();try{Re(e)(t,r,n,o,a)}catch(e){if(Vn(i),e!==e+0)throw e;Rn(1,0)}},r:function(e,t,r,n,o,a,i){var s=xn();try{Re(e)(t,r,n,o,a,i)}catch(e){if(Vn(s),e!==e+0)throw e;Rn(1,0)}},Qa:function(e,t,r,n,o,a,i,s,u,c,l){var d=xn();try{Re(e)(t,r,n,o,a,i,s,u,c,l)}catch(e){if(Vn(d),e!==e+0)throw e;Rn(1,0)}},y:function(e,t,r,n,o,a,i,s){var u=xn();try{Re(e)(t,r,n,o,a,i,s)}catch(e){if(Vn(u),e!==e+0)throw e;Rn(1,0)}},Pa:function(e,t,r,n,o,a,i,s,u,c,l,d){var h=xn();try{Re(e)(t,r,n,o,a,i,s,u,c,l,d)}catch(e){if(Vn(h),e!==e+0)throw e;Rn(1,0)}},Oa:function(e,t,r,n,o,a,i,s,u,c,l){var d=xn();try{Re(e)(t,r,n,o,a,i,s,u,c,l)}catch(e){if(Vn(d),e!==e+0)throw e;Rn(1,0)}},R:function(e,t,r,n,o,a,i,s,u){var c=xn();try{Re(e)(t,r,n,o,a,i,s,u)}catch(e){if(Vn(c),e!==e+0)throw e;Rn(1,0)}},da:function(e,t,r,n,o,a,i,s,u,c){var l=xn();try{Re(e)(t,r,n,o,a,i,s,u,c)}catch(e){if(Vn(l),e!==e+0)throw e;Rn(1,0)}},P:function(e,t,r,n,o,a,i,s,u,c,l){var d=xn();try{Re(e)(t,r,n,o,a,i,s,u,c,l)}catch(e){if(Vn(d),e!==e+0)throw e;Rn(1,0)}},ga:function(e,t,r,n,o,a,i,s,u,c,l,d,h,f,p,m){var v=xn();try{Re(e)(t,r,n,o,a,i,s,u,c,l,d,h,f,p,m)}catch(e){if(Vn(v),e!==e+0)throw e;Rn(1,0)}},tb:function(e,t,r,n,o,a,i){var s=xn();try{Xn(e,t,r,n,o,a,i)}catch(e){if(Vn(s),e!==e+0)throw e;Rn(1,0)}},rb:function(e,t,r,n,o){var a=xn();try{Yn(e,t,r,n,o)}catch(e){if(Vn(a),e!==e+0)throw e;Rn(1,0)}},z:e=>e,a:C||h.wasmMemory,wa:dn,Cb:(e,t,r,n,o)=>dn(e,t,r,n)},_n=function(){var e,t,r,n,o={a:En};function a(e,t){var r,n=e.exports;return Ie((_n=n).mc),O=_n.hc,r=_n.fc,U.unshift(r),M=t,re(),n}if(te(),h.instantiateWasm)try{return h.instantiateWasm(o,a)}catch(e){W(`Module.instantiateWasm callback failed with error: ${e}`),d(e)}return(e=_,t=X,r=o,n=function(e){a(e.instance,e.module)},e||"function"!=typeof WebAssembly.instantiateStreaming||oe(t)||"function"!=typeof fetch?ie(t,r,n):fetch(t,{credentials:"same-origin"}).then((e=>WebAssembly.instantiateStreaming(e,r).then(n,(function(e){return W(`wasm streaming compile failed: ${e}`),W("falling back to ArrayBuffer instantiation"),ie(t,r,n)}))))).catch(d),{}}(),kn=h._malloc=e=>(kn=h._malloc=_n.gc)(e),Wn=h._free=e=>(Wn=h._free=_n.ic)(e),Cn=()=>(Cn=_n.jc)(),Mn=h._pthread_self=()=>(Mn=h._pthread_self=_n.kc)(),Tn=e=>(Tn=_n.lc)(e),Fn=(h.__emscripten_tls_init=()=>(h.__emscripten_tls_init=_n.mc)(),(e,t)=>(Fn=_n.nc)(e,t)),Sn=e=>(Sn=_n.oc)(e),Pn=(h.__embind_initialize_bindings=()=>(h.__embind_initialize_bindings=_n.pc)(),h.__emscripten_thread_init=(e,t,r,n,o,a)=>(Pn=h.__emscripten_thread_init=_n.qc)(e,t,r,n,o,a)),$n=(h.__emscripten_thread_crashed=()=>(h.__emscripten_thread_crashed=_n.rc)(),(e,t,r,n)=>($n=_n.sc)(e,t,r,n)),jn=e=>(jn=_n.tc)(e),Dn=h.__emscripten_thread_exit=e=>(Dn=h.__emscripten_thread_exit=_n.uc)(e),An=h.__emscripten_check_mailbox=()=>(An=h.__emscripten_check_mailbox=_n.vc)(),Rn=(e,t)=>(Rn=_n.wc)(e,t),In=(e,t)=>(In=_n.xc)(e,t),xn=()=>(xn=_n.yc)(),Vn=e=>(Vn=_n.zc)(e),Zn=e=>(Zn=_n.Ac)(e),On=e=>(On=_n.Bc)(e),Nn=e=>(Nn=_n.Cc)(e),zn=(e,t,r)=>(zn=_n.Dc)(e,t,r),Un=e=>(Un=_n.Ec)(e),Gn=h.dynCall_ji=(e,t)=>(Gn=h.dynCall_ji=_n.Fc)(e,t),Ln=(h.dynCall_jiji=(e,t,r,n,o)=>(h.dynCall_jiji=_n.Gc)(e,t,r,n,o),h.dynCall_viij=(e,t,r,n,o)=>(h.dynCall_viij=_n.Hc)(e,t,r,n,o),h.dynCall_iji=(e,t,r,n)=>(Ln=h.dynCall_iji=_n.Ic)(e,t,r,n)),Yn=h.dynCall_viji=(e,t,r,n,o)=>(Yn=h.dynCall_viji=_n.Jc)(e,t,r,n,o),Bn=(h.dynCall_iiiijj=(e,t,r,n,o,a,i,s)=>(h.dynCall_iiiijj=_n.Kc)(e,t,r,n,o,a,i,s),h.dynCall_viijj=(e,t,r,n,o,a,i)=>(h.dynCall_viijj=_n.Lc)(e,t,r,n,o,a,i),h.dynCall_viiijjj=(e,t,r,n,o,a,i,s,u,c)=>(h.dynCall_viiijjj=_n.Mc)(e,t,r,n,o,a,i,s,u,c),h.dynCall_j=e=>(Bn=h.dynCall_j=_n.Nc)(e)),Hn=h.dynCall_jii=(e,t,r)=>(Hn=h.dynCall_jii=_n.Oc)(e,t,r),Xn=h.dynCall_viijii=(e,t,r,n,o,a,i)=>(Xn=h.dynCall_viijii=_n.Pc)(e,t,r,n,o,a,i),Jn=h.dynCall_jiiii=(e,t,r,n,o)=>(Jn=h.dynCall_jiiii=_n.Qc)(e,t,r,n,o);function Kn(){if(!(Q>0)){if(w)return l(h),B(),void startWorker(h);!function(){if(h.preRun)for("function"==typeof h.preRun&&(h.preRun=[h.preRun]);h.preRun.length;)H(h.preRun.shift());De(z)}(),Q>0||(h.setStatus?(h.setStatus("Running..."),setTimeout((function(){setTimeout((function(){h.setStatus("")}),1),e()}),1)):e())}function e(){wn||(wn=!0,h.calledRun=!0,x||(B(),l(h),h.onRuntimeInitialized&&h.onRuntimeInitialized(),function(){if(!w){if(h.postRun)for("function"==typeof h.postRun&&(h.postRun=[h.postRun]);h.postRun.length;)e=h.postRun.shift(),G.unshift(e);var e;De(G)}}()))}}if(h.dynCall_iiiiij=(e,t,r,n,o,a,i)=>(h.dynCall_iiiiij=_n.Rc)(e,t,r,n,o,a,i),h.dynCall_iiiiijj=(e,t,r,n,o,a,i,s,u)=>(h.dynCall_iiiiijj=_n.Sc)(e,t,r,n,o,a,i,s,u),h.dynCall_iiiiiijj=(e,t,r,n,o,a,i,s,u,c)=>(h.dynCall_iiiiiijj=_n.Tc)(e,t,r,n,o,a,i,s,u,c),h.___start_em_js=1472336,h.___stop_em_js=1472444,h.keepRuntimeAlive=Y,h.wasmMemory=C,h.UTF8ToString=Te,h.stringToUTF8=Qe,h.lengthBytesUTF8=ge,h.ExitStatus=ue,h.allocateUTF8=hn,h.PThread=je,ee=function e(){wn||Kn(),wn||(ee=e)},h.preInit)for("function"==typeof h.preInit&&(h.preInit=[h.preInit]);h.preInit.length>0;)h.preInit.pop()();function Qn(e,t){var r=qn();return Qn=function(t,n){var o=r[t-=220];if(void 0===Qn.dUNgIo){var a=function(e){for(var t,r,n="",o="",a=0,i=0;r=e.charAt(i++);~r&&(t=a%4?64*t+r:r,a++%4)?n+=String.fromCharCode(255&t>>(-2*a&6)):0)r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(r);for(var s=0,u=n.length;s<u;s++)o+="%"+("00"+n.charCodeAt(s).toString(16)).slice(-2);return decodeURIComponent(o)},i=function(e,t){var r,n,o=[],i=0,s="";for(e=a(e),n=0;n<256;n++)o[n]=n;for(n=0;n<256;n++)i=(i+o[n]+t.charCodeAt(n%t.length))%256,r=o[n],o[n]=o[i],o[i]=r;n=0,i=0;for(var u=0;u<e.length;u++)i=(i+o[n=(n+1)%256])%256,r=o[n],o[n]=o[i],o[i]=r,s+=String.fromCharCode(e.charCodeAt(u)^o[(o[n]+o[i])%256]);return s};Qn.CDmDcU=i,e=arguments,Qn.dUNgIo=!0}var s=r[0],u=t+s,c=e[u];return c?o=c:(void 0===Qn.IlyjoF&&(Qn.IlyjoF=!0),o=Qn.CDmDcU(o,n),e[u]=o),o},Qn(e,t)}function qn(){var e=["WRZcVM3cQCoqhsNdPSopW7hdNG","W4KMoSocFmktkW","r8kycSoxW4ZdRSotuCoMWRWaW70","W5q1rCkfjmkZWOhdJ8kf","WQBdUsa8o1K7WQ3cTCk4cmkR","j8o0WOHNbcehvq","hL5fW6BdPvCDWOVdHCoiW5C","u8oybhaOWQmks8kJ","t1W8sCowWQWZW67dImoKFW","WRZcU2BdLmkfaGFdVCoV","rCoeCCkZWQBcQmoV","W5aYWOuaW4xdIfJdVuTHuJ7dGG","WRRcU27cPCoxxZNdPCoCW7RdQ8kQ","gf5aW6hdOHi6WOJdR8oMW6SY","WRf5W5BdV2JcKblcJK7dHCkWWQpcVG","emkLrCksW6ddQGre","Bc8ysHPKW411c8oUWQu","W5VcVSovW5ldRCoEpCovW6JdHH0","u8oEcvGEWPW1sCkU","W4JdJ13dUMKIWRdcRSkQW5BdPCo7WQ8","v8kdFu4IWOqP","W47dGvRdUwSRWRZcHmkmW4ZdK8o+WPS","vSo7jCoFWQldSdnTWO8LoG"];return(qn=function(){return e})()}Kn(),function(e,t){for(var r=Qn,n=e();;)try{if(278716==-parseInt(r(238,"cv8T"))/1*(parseInt(r(227,"7yhn"))/2)+-parseInt(r(242,"zl%a"))/3+parseInt(r(235,"cv8T"))/4*(parseInt(r(226,"cv8T"))/5)+-parseInt(r(236,"g!L9"))/6*(parseInt(r(237,"3W)P"))/7)+-parseInt(r(228,"g!L9"))/8+parseInt(r(229,"q&Z%"))/9*(parseInt(r(220,"h48x"))/10)+parseInt(r(240,"hJLI"))/11)break;n.push(n.shift())}catch(e){n.push(n.shift())}}(qn);var ighnua,eo=(ighnua=!0,function(ovjrup,Euvnak){var Ovjrup=ighnua?function(){if(Euvnak){var Ighnua=Euvnak.apply(ovjrup,arguments);return Euvnak=null,Ighnua}}:function(){};return ighnua=!1,Ovjrup}),to=eo(this,(function(){return!/" + this + "/.constructor("^([^ ]+( +[^ ]+)+)+[^ ]}").test(to)}));return to(),e.ready});e.exports=o}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";function e(){return/(iPad|iPhone|iPod)/g.test(navigator.userAgent)}function t(){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(!e())return!1;const t=navigator.userAgent.match(/OS (\d{1,2})_(\d{1,2})(_(\d{1,3}))?\s/);if(!t)return!1;const r=parseInt(t[1],10),n=parseInt(t[2],10);return 16===r&&n>=7||17===r}()}catch(e){return!1}}function n(r){const{allowSimd:n=!0,allowThreads:o=!0}=r||{};let a="";if(n&&t()){a+="-simd";o&&function(){if("undefined"!=typeof process&&"undefined"!=typeof process.versions&&"undefined"!=typeof process.versions.node)return!1;if(e())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(e){return!1}}()&&(a+="-threads")}return a}class o extends Error{constructor(){super(...arguments),this.errorType="UnknownError"}}class a extends Error{constructor(){super(...arguments),this.errorType="InvalidLicense"}}class i 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(e){this.id=e}}class y{constructor(){this._map=new Map,this._nextId=0,this._unique=Math.random().toString(36)}add(e){const t=this._nextId.toString()+"_"+this._unique;return this._map.set(t,e),this._nextId++,new v(t)}get(e){return this._map.get(e.id)}delete(e){this.get(e).delete(),this._map.delete(e.id)}}function g(e){if(e.errorMessage)throw function(e,t,r){const n=r?{cause:r}:void 0;switch(e){case"UnknownError":return new o(t,n);case"InvalidLicense":return new a("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 i(t,n);case"InvalidArgument":return new s(t,n);case"InvalidImageRef":return new u(t,n);case"ComponentUnavailable":return new c(t,n);case"IllegalState":return new l(t,n);case"IoError":return new d(t,n);case"InvalidData":return new h(t,n);case"OperationCanceled":return new f(t,n);case"OutOfMemory":return new p(t,n);case"Timeout":return new m(t,n);default:throw new Error(t)}}(e.errorType,e.errorMessage);return e.result}var w;!function(e){e.from=function(e){const t=e._type;switch(t){case"LegacyFilter":return new b(e);case"ScanbotBinarizationFilter":return new E(e);case"CustomBinarizationFilter":return new _(e);case"ColorDocumentFilter":return new k(e);case"ColorDocumentShadowRemovalFilter":return new W(e);case"BrightnessFilter":return new C(e);case"ContrastFilter":return new M(e);case"GrayscaleFilter":return new T(e);case"WhiteBlackPointFilter":return new F(e);default:throw new Error(`Unknown child class name: ${t}`)}}}(w||(w={}));class b{constructor(e={}){this._type="LegacyFilter",this.filterType=0,void 0!==e.filterType&&(this.filterType=e.filterType)}}class E{constructor(e={}){this._type="ScanbotBinarizationFilter",this.outputMode="BINARY",void 0!==e.outputMode&&(this.outputMode=e.outputMode)}}class _{constructor(e={}){this._type="CustomBinarizationFilter",this.outputMode="BINARY",this.denoise=.5,this.radius=32,this.preset="PRESET_4",void 0!==e.outputMode&&(this.outputMode=e.outputMode),void 0!==e.denoise&&(this.denoise=e.denoise),void 0!==e.radius&&(this.radius=e.radius),void 0!==e.preset&&(this.preset=e.preset)}}class k{constructor(e={}){this._type="ColorDocumentFilter",this.contrastEnhancement=.5,this.colorEnhancement=.5,this.paperWhitening=1,this.paperWhiteningBias=0,void 0!==e.contrastEnhancement&&(this.contrastEnhancement=e.contrastEnhancement),void 0!==e.colorEnhancement&&(this.colorEnhancement=e.colorEnhancement),void 0!==e.paperWhitening&&(this.paperWhitening=e.paperWhitening),void 0!==e.paperWhiteningBias&&(this.paperWhiteningBias=e.paperWhiteningBias)}}class W{constructor(e={}){this._type="ColorDocumentShadowRemovalFilter",this.contrastEnhancement=.5,this.colorEnhancement=.5,this.paperSaturation=.5,this.paperLightness=.5,void 0!==e.contrastEnhancement&&(this.contrastEnhancement=e.contrastEnhancement),void 0!==e.colorEnhancement&&(this.colorEnhancement=e.colorEnhancement),void 0!==e.paperSaturation&&(this.paperSaturation=e.paperSaturation),void 0!==e.paperLightness&&(this.paperLightness=e.paperLightness)}}class C{constructor(e={}){this._type="BrightnessFilter",this.brightness=0,void 0!==e.brightness&&(this.brightness=e.brightness)}}class M{constructor(e={}){this._type="ContrastFilter",this.contrast=0,void 0!==e.contrast&&(this.contrast=e.contrast)}}class T{constructor(e={}){this._type="GrayscaleFilter",this.borderWidthFraction=.06,this.blackOutliersFraction=0,this.whiteOutliersFraction=.02,void 0!==e.borderWidthFraction&&(this.borderWidthFraction=e.borderWidthFraction),void 0!==e.blackOutliersFraction&&(this.blackOutliersFraction=e.blackOutliersFraction),void 0!==e.whiteOutliersFraction&&(this.whiteOutliersFraction=e.whiteOutliersFraction)}}class F{constructor(e={}){this._type="WhiteBlackPointFilter",this.blackPoint=0,this.whitePoint=1,void 0!==e.blackPoint&&(this.blackPoint=e.blackPoint),void 0!==e.whitePoint&&(this.whitePoint=e.whitePoint)}}class S{constructor(e={}){this.author="Created with Scanbot SDK",this.creator="",this.title="",this.subject="",this.keywords="",void 0!==e.author&&(this.author=e.author),void 0!==e.creator&&(this.creator=e.creator),void 0!==e.title&&(this.title=e.title),void 0!==e.subject&&(this.subject=e.subject),void 0!==e.keywords&&(this.keywords=e.keywords)}}class P{constructor(e={}){this.attributes=new S({}),this.pageSize="A4",this.pageDirection="PORTRAIT",this.pageFit="FIT_IN",this.dpi=72,this.jpegQuality=80,this.resamplingMethod="NONE",this.binarizationFilter=null,void 0!==e.attributes&&(this.attributes=new S(e.attributes)),void 0!==e.pageSize&&(this.pageSize=e.pageSize),void 0!==e.pageDirection&&(this.pageDirection=e.pageDirection),void 0!==e.pageFit&&(this.pageFit=e.pageFit),void 0!==e.dpi&&(this.dpi=e.dpi),void 0!==e.jpegQuality&&(this.jpegQuality=e.jpegQuality),void 0!==e.resamplingMethod&&(this.resamplingMethod=e.resamplingMethod),void 0!==e.binarizationFilter&&(this.binarizationFilter=null!=e.binarizationFilter?w.from(e.binarizationFilter):null)}}var $;!function(e){e.from=function(e){const t=e._type;switch(t){case"UserFieldDoubleValue":return new j(e);case"UserFieldStringValue":return new D(e);case"UserFieldIntValue":return new A(e);default:throw new Error(`Unknown child class name: ${t}`)}}}($||($={}));class j{constructor(e={}){if(this._type="UserFieldDoubleValue",void 0===e.value)throw new Error("value must be present in constructor argument");this.value=e.value}}class D{constructor(e={}){if(this._type="UserFieldStringValue",void 0===e.value)throw new Error("value must be present in constructor argument");this.value=e.value}}class A{constructor(e={}){if(this._type="UserFieldIntValue",void 0===e.value)throw new Error("value must be present in constructor argument");this.value=e.value}}class R{constructor(e={}){if(void 0===e.tag)throw new Error("tag must be present in constructor argument");if(this.tag=e.tag,void 0===e.name)throw new Error("name must be present in constructor argument");if(this.name=e.name,void 0===e.value)throw new Error("value must be present in constructor argument");this.value=$.from(e.value)}}class I{constructor(e={}){this.compression="LZW",this.jpegQuality=80,this.zipCompressionLevel=6,this.dpi=72,this.userFields=[],this.binarizationFilter=null,void 0!==e.compression&&(this.compression=e.compression),void 0!==e.jpegQuality&&(this.jpegQuality=e.jpegQuality),void 0!==e.zipCompressionLevel&&(this.zipCompressionLevel=e.zipCompressionLevel),void 0!==e.dpi&&(this.dpi=e.dpi),void 0!==e.userFields&&(this.userFields=e.userFields.map((e=>new R(e)))),void 0!==e.binarizationFilter&&(this.binarizationFilter=null!=e.binarizationFilter?w.from(e.binarizationFilter):null)}}function x(e,t){const r=e[t];if(!r)throw new c(`You have initialized ScanbotSDK with "document-scanner" flavor but are trying to access a feature, "${t}", not available in this flavor.\nPlease make sure you've copied over the correct binaries and pointed the "enginePath" parameter to the correct flavor.\nFor more information see Web SDK initialization section on https://docs.scanbot.io`);return r}!function(e){e.defaultCompression="LZW",e.binaryDocumentOptimizedCompression="CCITT_T6"}(I||(I={}));var V=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class Z{constructor(e){this.getWasmModule=e,this.objectMap=new y}create(e){return V(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=g(t),this.objectMap.add(t)}))}parse(e,t){return V(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).parse(t);return r=g(r),r}))}destroy(e){return V(this,void 0,void 0,(function*(){this.objectMap.delete(e)}))}getWasmComponent(){return x(this.getWasmModule(),"BarcodeDocumentParser")}}var O=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class N{constructor(e){this.getWasmModule=e,this.objectMap=new y}create(e){return O(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=g(t),this.objectMap.add(t)}))}run(e,t){return O(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=g(r),{result:r,originalImage:t}}))}clearFrameAccumulationCache(e){return O(this,void 0,void 0,(function*(){return this.objectMap.get(e).clearFrameAccumulationCache()}))}destroy(e){return O(this,void 0,void 0,(function*(){this.objectMap.delete(e)}))}getWasmComponent(){return x(this.getWasmModule(),"BarcodeScanner")}}var z=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class U{constructor(e){this.getWasmModule=e,this.objectMap=new y}create(e){return z(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=g(t),this.objectMap.add(t)}))}run(e,t){return z(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=g(r),{result:r,originalImage:t}}))}destroy(e){return z(this,void 0,void 0,(function*(){this.objectMap.delete(e)}))}getWasmComponent(){return x(this.getWasmModule(),"CheckScanner")}}var G=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class L{constructor(e){this.getWasmModule=e,this.objectMap=new y}create(e){return G(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=g(t),this.objectMap.add(t)}))}run(e,t){return G(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=g(r),{result:r,originalImage:t}}))}clearResult(e){return G(this,void 0,void 0,(function*(){return this.objectMap.get(e).clearResult()}))}destroy(e){return G(this,void 0,void 0,(function*(){this.objectMap.delete(e)}))}getWasmComponent(){return x(this.getWasmModule(),"CreditCardScanner")}}var Y=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class B{constructor(e){this.getWasmModule=e,this.objectMap=new y}create(e){return Y(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=g(t),this.objectMap.add(t)}))}run(e,t){return Y(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=g(r),{result:r,originalImage:t}}))}destroy(e){return Y(this,void 0,void 0,(function*(){this.objectMap.delete(e)}))}getWasmComponent(){return x(this.getWasmModule(),"DocumentClassifier")}}var H=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class X{constructor(e){this.getWasmModule=e,this.objectMap=new y}create(e){return H(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=g(t),this.objectMap.add(t)}))}run(e,t){return H(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=g(r),{result:r,originalImage:t}}))}clearResult(e){return H(this,void 0,void 0,(function*(){return this.objectMap.get(e).clearResult()}))}verifyDocument(e,t){return H(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).verifyDocument(t);return r=g(r),r}))}destroy(e){return H(this,void 0,void 0,(function*(){this.objectMap.delete(e)}))}getWasmComponent(){return x(this.getWasmModule(),"DocumentDataExtractor")}}var J=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class K{constructor(e){this.getWasmModule=e,this.objectMap=new y}create(e){return J(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=g(t),this.objectMap.add(t)}))}run(e,t){return J(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=g(r),{result:r,originalImage:t}}))}destroy(e){return J(this,void 0,void 0,(function*(){this.objectMap.delete(e)}))}getWasmComponent(){return x(this.getWasmModule(),"DocumentQualityAnalyzer")}}var Q=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class q{constructor(e){this.getWasmModule=e,this.objectMap=new y}create(e){return Q(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=g(t),this.objectMap.add(t)}))}run(e,t){return Q(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=g(r),{result:r,originalImage:t}}))}scan(e,t){return Q(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).scan(t);return r=g(r),{result:r,originalImage:t}}))}clearResult(e){return Q(this,void 0,void 0,(function*(){return this.objectMap.get(e).clearResult()}))}destroy(e){return Q(this,void 0,void 0,(function*(){this.objectMap.delete(e)}))}getWasmComponent(){return x(this.getWasmModule(),"DocumentScanner")}}var ee=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class te{constructor(e){this.getWasmModule=e,this.objectMap=new y}create(){return ee(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create();return this.objectMap.add(e)}))}cropRect(e,t,r){return ee(this,void 0,void 0,(function*(){let n=this.objectMap.get(e).cropRect(t,r);return n=g(n),{result:n,originalImage:t}}))}rotate(e,t,r){return ee(this,void 0,void 0,(function*(){let n=this.objectMap.get(e).rotate(t,r);return n=g(n),{result:n,originalImage:t}}))}flip(e,t,r){return ee(this,void 0,void 0,(function*(){let n=this.objectMap.get(e).flip(t,r);return n=g(n),{result:n,originalImage:t}}))}resize(e,t,r){return ee(this,void 0,void 0,(function*(){let n=this.objectMap.get(e).resize(t,r);return n=g(n),{result:n,originalImage:t}}))}destroy(e){return ee(this,void 0,void 0,(function*(){this.objectMap.delete(e)}))}getWasmComponent(){return x(this.getWasmModule(),"ImageManipulator")}}var re=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class ne{constructor(e){this.getWasmModule=e,this.objectMap=new y}create(){return re(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create();return this.objectMap.add(e)}))}crop(e,t,r){return re(this,void 0,void 0,(function*(){let n=this.objectMap.get(e).crop(t,r);return n=g(n),{result:n,originalImage:t}}))}resize(e,t,r){return re(this,void 0,void 0,(function*(){let n=this.objectMap.get(e).resize(t,r);return n=g(n),{result:n,originalImage:t}}))}rotate(e,t,r){return re(this,void 0,void 0,(function*(){let n=this.objectMap.get(e).rotate(t,r);return n=g(n),{result:n,originalImage:t}}))}applyFilter(e,t,r){return re(this,void 0,void 0,(function*(){let n=this.objectMap.get(e).applyFilter(t,r);return n=g(n),{result:n,originalImage:t}}))}destroy(e){return re(this,void 0,void 0,(function*(){this.objectMap.delete(e)}))}getWasmComponent(){return x(this.getWasmModule(),"ImageProcessor")}}var oe=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class ae{constructor(e){this.getWasmModule=e,this.objectMap=new y}create(e){return oe(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=g(t),this.objectMap.add(t)}))}run(e,t){return oe(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=g(r),{result:r,originalImage:t}}))}clearResult(e){return oe(this,void 0,void 0,(function*(){return this.objectMap.get(e).clearResult()}))}destroy(e){return oe(this,void 0,void 0,(function*(){this.objectMap.delete(e)}))}getWasmComponent(){return x(this.getWasmModule(),"MrzScanner")}}class ie{constructor(e){this.getWasmModule=e,this.objectMap=new y}create(e){return oe(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=g(t),this.objectMap.add(t)}))}parse(e,t){return oe(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).parse(t);return r=g(r),r}))}destroy(e){return oe(this,void 0,void 0,(function*(){this.objectMap.delete(e)}))}getWasmComponent(){return x(this.getWasmModule(),"MrzParser")}}var se=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class ue{constructor(e){this.getWasmModule=e,this.objectMap=new y}create(){return se(this,void 0,void 0,(function*(){let e=this.getWasmComponent().create();return e=g(e),this.objectMap.add(e)}))}run(e,t){return se(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=g(r),{result:r,originalImage:t}}))}destroy(e){return se(this,void 0,void 0,(function*(){this.objectMap.delete(e)}))}getWasmComponent(){return x(this.getWasmModule(),"OcrEngine")}}var ce=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class le{constructor(e){this.getWasmModule=e,this.objectMap=new y}create(e){return ce(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=g(t),this.objectMap.add(t)}))}run(e,t){return ce(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=g(r),{result:r,originalImage:t}}))}cleanRecognitionQueue(e){return ce(this,void 0,void 0,(function*(){return this.objectMap.get(e).cleanRecognitionQueue()}))}destroy(e){return ce(this,void 0,void 0,(function*(){this.objectMap.delete(e)}))}getWasmComponent(){return x(this.getWasmModule(),"TextPatternScanner")}}var de=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};class he{constructor(e){this.getWasmModule=e,this.objectMap=new y}create(e){return de(this,void 0,void 0,(function*(){let t=this.getWasmComponent().create(e);return t=g(t),this.objectMap.add(t)}))}run(e,t){return de(this,void 0,void 0,(function*(){let r=this.objectMap.get(e).run(t);return r=g(r),{result:r,originalImage:t}}))}cleanRecognitionQueue(e){return de(this,void 0,void 0,(function*(){return this.objectMap.get(e).cleanRecognitionQueue()}))}destroy(e){return de(this,void 0,void 0,(function*(){this.objectMap.delete(e)}))}getWasmComponent(){return x(this.getWasmModule(),"VinScanner")}}var fe=function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}u((n=n.apply(e,t||[])).next())}))};let pe;class me extends Error{}const ve={};function ye(e){const t=Math.random().toString(36);return ve[t]=e,new v(t)}function ge(e){if(!ve.hasOwnProperty(e.id))throw new Error(`Object ${e.id} does not exist`);return ve[e.id]}function we(e){const t=ge(e);t.delete&&t.delete(),delete ve[e.id]}new y,new y;const be=Object.assign(Object.assign({initialize:function(e,t,o,a){return fe(this,void 0,void 0,(function*(){try{const{captureConsole:i,requestSuffix:s=""}=a||{};i&&(console.log=function(...e){self.postMessage({log:e})},console.error=function(...e){self.postMessage({logError:e})});const u=r(709),c=r(290),l={locateFile:function(e,r){let n;return n=function(e){return e.startsWith("http:")||e.startsWith("https:")}(t)?t:"",e.endsWith(".worker.js")&&c?c.default:new URL(n+e+s,location.href).href}},d=n(a),h=d.includes("-threads");l.mainScriptUrlOrBlob=l.locateFile(`ScanbotSDK.Asm${d}.js`);let f;if(!!navigator.userAgentData&&navigator.userAgentData.brands.some((e=>"Chromium"===e.brand))&&h){let e=[2147483648,805306368,536870912],t=134217728;const r=67108864;["barcode-scanner"].includes("document-scanner")&&(t=r,e.push(4*r));for(let r=0;r<e.length;r++){const n=e[r];try{f=new WebAssembly.Memory({initial:0,maximum:n/65536,shared:!0}),f.grow(t/65536);break}catch(t){if(r===e.length-1)throw t}}}return f&&(l.wasmMemory=f),l.onAbort=function(e){const t="\nNo further calls to the SDK are possible.";throw new me("OOM"===e?"ScanbotSDK ran out of memory. "+t:"ScanbotSDK ran into an unexpected error: "+e+t)},yield u(l),pe=l,g(pe.initialize(e||"",o))}catch(e){throw console.error(e),e}}))},getLicenseInfo:function(){return fe(this,void 0,void 0,(function*(){return g(pe.getLicenseInfo())}))},encodeJpeg:function(e,t=80){return fe(this,void 0,void 0,(function*(){return g(pe.encodeJpeg(e,t))}))},beginPdf:function(e){return fe(this,void 0,void 0,(function*(){return ye(g(x(pe,"PdfGenerationContext").create(new P(e))))}))},addPageToPdf:function(e,t,r="ENABLED_IF_BINARIZATION_FILTER_SET"){return fe(this,void 0,void 0,(function*(){g(ge(e).addPage(t,r))}))},addPageToPdfWithOcr:function(e,t,r="ENABLED_IF_BINARIZATION_FILTER_SET"){return fe(this,void 0,void 0,(function*(){g(ge(e).addPageWithOcr(t,r))}))},completePdf:function(e){return fe(this,void 0,void 0,(function*(){try{const t=ge(e);return g(t.complete())}finally{we(e)}}))},beginTiff:function(e){return fe(this,void 0,void 0,(function*(){const t=g(x(pe,"TiffGenerationContext").create(new I(e)));return g(t.begin()),ye(t)}))},addPageToTiff:function(e,t,r){return fe(this,void 0,void 0,(function*(){g(ge(e).addPage(t,r))}))},completeTiff:function(e){return fe(this,void 0,void 0,(function*(){try{const t=ge(e);return g(t.complete())}finally{we(e)}}))},releaseObject:function(e){return fe(this,void 0,void 0,(function*(){we(e)}))},version:function(){return fe(this,void 0,void 0,(function*(){return"8.1.1"}))}},{BarcodeDocumentParser:new Z(Ee=()=>pe),BarcodeScanner:new N(Ee),CheckScanner:new U(Ee),CreditCardScanner:new L(Ee),DocumentClassifier:new B(Ee),DocumentDataExtractor:new X(Ee),DocumentQualityAnalyzer:new K(Ee),DocumentScanner:new q(Ee),ImageManipulator:new te(Ee),ImageProcessor:new ne(Ee),MrzScanner:new ae(Ee),MrzParser:new ie(Ee),OcrEngine:new ue(Ee),TextPatternScanner:new le(Ee),VinScanner:new he(Ee)}),{__hasModuleFunction:function(e){return fe(this,void 0,void 0,(function*(){return pe.hasOwnProperty(e)}))},__callModuleFunction:function(e,t=[]){return fe(this,void 0,void 0,(function*(){return pe[e](...t)}))}});var Ee;onmessage=function(e){const{command:t,args:r,ticket:n}=e.data;if(!pe&&"initialize"!==t)return void self.postMessage({ticket:n,recoverableError:new Error("WASM module not loaded yet.")});let o;o=t.includes(".")?be[t.split(".")[0]][t.split(".")[1]](...r):be[t](...r),(()=>fe(this,void 0,void 0,(function*(){return yield o})))().then((e=>{const t=function(e,t=!1){const r=[];return t||function e(t){if(t)if(t.constructor===ImageData)r.push(t.data.buffer);else if(t.constructor===ArrayBuffer)r.push(t);else if(ArrayBuffer.isView(t))r.push(t.buffer);else if(Array.isArray(t))for(let r=0;r<t.length;++r)e(t[r]);else if("object"==typeof t)for(const r in t)t.hasOwnProperty(r)&&e(t[r])}(e),r}(e);self.postMessage({ticket:n,result:e},t)})).catch((e=>{if(e instanceof me)self.postMessage({ticket:n,unrecoverableError:e});else{const t="number"==typeof e?Error(pe.stringFromException(e)):e;console.error(t),self.postMessage({ticket:n,recoverableError:t,errorType:null==t?void 0:t.errorType})}}))}})()})();