jessibuca-pro-object-detector-demo.js 79.3 KB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("path"),require("fs"),require("crypto")):"function"==typeof define&&define.amd?define(["path","fs","crypto"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).path,e.fs,e.crypto$1)}(this,(function(e,t,r){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(e),i=n(t),a=n(r);function s(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function u(e,t){return e(t={exports:{}},t.exports),t.exports}var c=s(u((function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports}))),f=u((function(e){function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})),l=s(f),d=u((function(e){var t=f.default;e.exports=function(e,r){if("object"!==t(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,r||"default");if("object"!==t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports}));s(d);var p=u((function(e){var t=f.default;e.exports=function(e){var r=d(e,"string");return"symbol"===t(r)?r:String(r)},e.exports.__esModule=!0,e.exports.default=e.exports}));s(p);var h=s(u((function(e){function t(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,p(n.key),n)}}e.exports=function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports}))),m=u((function(e){function t(r,n){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}));s(m);var v=s(u((function(e){e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports}))),y=u((function(e){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports}));s(y);var g=u((function(e){var t=f.default;e.exports=function(e,r){if(r&&("object"===t(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return y(e)},e.exports.__esModule=!0,e.exports.default=e.exports})),w=s(g),_=u((function(e){function t(r){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})),E=s(_),b=u((function(e,t){var r,n=(r="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,"undefined"!=typeof __filename&&(r=r||__filename),function(t){var n,s;(t=void 0!==(t=t||{})?t:{}).ready=new Promise((function(e,t){n=e,s=t})),(t=void 0!==t?t:{}).locateFile=function(e){return"jessibuca-pro-object-detector-decoder.wasm"==e&&"undefined"!=typeof JESSIBUCA_PRO_OBJECT_DETECTOR_WASM_URL&&""!=JESSIBUCA_PRO_FACE_DETECTOR_WASM_URL?JESSIBUCA_PRO_OBJECT_DETECTOR_WASM_URL:e};var u,c,f,d,p,h,m=Object.assign({},t),v="./this.program",y="object"==("undefined"==typeof window?"undefined":l(window)),g="function"==typeof importScripts,w="object"==("undefined"==typeof process?"undefined":l(process))&&"object"==l(process.versions)&&"string"==typeof process.versions.node,_="";w?(_=g?o.default.dirname(_)+"/":__dirname+"/",h=function(){p||(d=i.default,p=o.default)},u=function(e,t){return h(),e=p.normalize(e),d.readFileSync(e,t?void 0:"utf8")},f=function(e){var t=u(e,!0);return t.buffer||(t=new Uint8Array(t)),t},c=function(e,t,r){h(),e=p.normalize(e),d.readFile(e,(function(e,n){e?r(e):t(n.buffer)}))},process.argv.length>1&&(v=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",(function(e){if(!(e instanceof oe))throw e})),process.on("unhandledRejection",(function(e){throw e})),t.inspect=function(){return"[Emscripten Module object]"}):(y||g)&&(g?_=self.location.href:"undefined"!=typeof document&&document.currentScript&&(_=document.currentScript.src),r&&(_=r),_=0!==_.indexOf("blob:")?_.substr(0,_.replace(/[?#].*/,"").lastIndexOf("/")+1):"",u=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},g&&(f=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),c=function(e,t,r){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=function(){200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)});var E=t.print||console.log.bind(console),b=t.printErr||console.warn.bind(console);Object.assign(t,m),m=null,t.arguments&&t.arguments,t.thisProgram&&(v=t.thisProgram),t.quit&&t.quit;var k,P,T=4;t.wasmBinary&&(k=t.wasmBinary),t.noExitRuntime,"object"!=("undefined"==typeof WebAssembly?"undefined":l(WebAssembly))&&J("no native wasm support detected");var D=!1;function S(e,t){e||J(t)}var F,C,A,x,M,j,$,O,R,B,N="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function z(e,t,r){for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&N)return N.decode(e.subarray(t,o));for(var i="";t<o;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var u=63&e[t++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&e[t++])<65536)i+=String.fromCharCode(a);else{var c=a-65536;i+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function W(e,t){return e?z(A,e,t):""}function I(e,t,r,n){if(!(n>0))return 0;for(var o=r,i=r+n-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(r>=i)break;t[r++]=s}else if(s<=2047){if(r+1>=i)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=i)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+3>=i)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 U(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}t.INITIAL_MEMORY;var L=[],H=[],V=[],q=0,Y=null;function X(e){q++,t.monitorRunDependencies&&t.monitorRunDependencies(q)}function G(e){if(q--,t.monitorRunDependencies&&t.monitorRunDependencies(q),0==q&&Y){var r=Y;Y=null,r()}}function J(e){t.onAbort&&t.onAbort(e),b(e="Aborted("+e+")"),D=!0,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw s(r),r}var K,Z,Q,ee="data:application/octet-stream;base64,";function te(e){return e.startsWith(ee)}function re(e){return e.startsWith("file://")}function ne(e){try{if(e==K&&k)return new Uint8Array(k);if(f)return f(e);throw"both async and sync fetching of the wasm failed"}catch(e){J(e)}}function oe(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function ie(e){for(;e.length>0;)e.shift()(t)}function ae(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){$[this.ptr+4>>2]=e},this.get_type=function(){return $[this.ptr+4>>2]},this.set_destructor=function(e){$[this.ptr+8>>2]=e},this.get_destructor=function(){return $[this.ptr+8>>2]},this.set_refcount=function(e){j[this.ptr>>2]=e},this.set_caught=function(e){e=e?1:0,C[this.ptr+12>>0]=e},this.get_caught=function(){return 0!=C[this.ptr+12>>0]},this.set_rethrown=function(e){e=e?1:0,C[this.ptr+13>>0]=e},this.get_rethrown=function(){return 0!=C[this.ptr+13>>0]},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var e=j[this.ptr>>2];j[this.ptr>>2]=e+1},this.release_ref=function(){var e=j[this.ptr>>2];return j[this.ptr>>2]=e-1,1===e},this.set_adjusted_ptr=function(e){$[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return $[this.ptr+16>>2]},this.get_exception_ptr=function(){if(cr(this.get_type()))return $[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}te(K="jessibuca-pro-object-detector-decoder.wasm")||(K=function(e){return t.locateFile?t.locateFile(e,_):_+e}(K));var se={isAbs:function(e){return"/"===e.charAt(0)},splitPath:function(e){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)},normalizeArray:function(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:function(e){var t=se.isAbs(e),r="/"===e.substr(-1);return(e=se.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:function(e){var t=se.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:function(e){if("/"===e)return"/";var t=(e=(e=se.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments,0);return se.normalize(e.join("/"))},join2:function(e,t){return se.normalize(e+"/"+t)}},ue={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:pe.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t=se.isAbs(n)}return(t?"/":"")+(e=se.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||"."},relative:function(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=ue.resolve(e).substr(1),t=ue.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),i=Math.min(n.length,o.length),a=i,s=0;s<i;s++)if(n[s]!==o[s]){a=s;break}var u=[];for(s=a;s<n.length;s++)u.push("..");return(u=u.concat(o.slice(a))).join("/")}};function ce(e,t,r){var n=r>0?r:U(e)+1,o=new Array(n),i=I(e,o,0,o.length);return t&&(o.length=i),o}var fe={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){fe.ttys[e]={input:[],output:[],ops:t},pe.registerDevice(e,fe.stream_ops)},stream_ops:{open:function(e){var t=fe.ttys[e.node.rdev];if(!t)throw new pe.ErrnoError(43);e.tty=t,e.seekable=!1},close:function(e){e.tty.ops.flush(e.tty)},flush:function(e){e.tty.ops.flush(e.tty)},read:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.get_char)throw new pe.ErrnoError(60);for(var i=0,a=0;a<n;a++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new pe.ErrnoError(29)}if(void 0===s&&0===i)throw new pe.ErrnoError(6);if(null==s)break;i++,t[r+a]=s}return i&&(e.node.timestamp=Date.now()),i},write:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new pe.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,t[r+i])}catch(e){throw new pe.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),i}},default_tty_ops:{get_char:function(e){if(!e.input.length){var t=null;if(w){var r=Buffer.alloc(256),n=0;try{n=d.readSync(process.stdin.fd,r,0,256,-1)}catch(e){if(!e.toString().includes("EOF"))throw e;n=0}t=n>0?r.slice(0,n).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n");if(!t)return null;e.input=ce(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(E(z(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(E(z(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(b(z(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(b(z(e.output,0)),e.output=[])}}};function le(e){J()}var de={ops_table:null,mount:function(e){return de.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(pe.isBlkdev(r)||pe.isFIFO(r))throw new pe.ErrnoError(63);de.ops_table||(de.ops_table={dir:{node:{getattr:de.node_ops.getattr,setattr:de.node_ops.setattr,lookup:de.node_ops.lookup,mknod:de.node_ops.mknod,rename:de.node_ops.rename,unlink:de.node_ops.unlink,rmdir:de.node_ops.rmdir,readdir:de.node_ops.readdir,symlink:de.node_ops.symlink},stream:{llseek:de.stream_ops.llseek}},file:{node:{getattr:de.node_ops.getattr,setattr:de.node_ops.setattr},stream:{llseek:de.stream_ops.llseek,read:de.stream_ops.read,write:de.stream_ops.write,allocate:de.stream_ops.allocate,mmap:de.stream_ops.mmap,msync:de.stream_ops.msync}},link:{node:{getattr:de.node_ops.getattr,setattr:de.node_ops.setattr,readlink:de.node_ops.readlink},stream:{}},chrdev:{node:{getattr:de.node_ops.getattr,setattr:de.node_ops.setattr},stream:pe.chrdev_stream_ops}});var o=pe.createNode(e,t,r,n);return pe.isDir(o.mode)?(o.node_ops=de.ops_table.dir.node,o.stream_ops=de.ops_table.dir.stream,o.contents={}):pe.isFile(o.mode)?(o.node_ops=de.ops_table.file.node,o.stream_ops=de.ops_table.file.stream,o.usedBytes=0,o.contents=null):pe.isLink(o.mode)?(o.node_ops=de.ops_table.link.node,o.stream_ops=de.ops_table.link.stream):pe.isChrdev(o.mode)&&(o.node_ops=de.ops_table.chrdev.node,o.stream_ops=de.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(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:function(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:function(e){var t={};return t.dev=pe.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,pe.isDir(e.mode)?t.size=4096:pe.isFile(e.mode)?t.size=e.usedBytes:pe.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:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&de.resizeFileStorage(e,t.size)},lookup:function(e,t){throw pe.genericErrors[44]},mknod:function(e,t,r,n){return de.createNode(e,t,r,n)},rename:function(e,t,r){if(pe.isDir(e.mode)){var n;try{n=pe.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new pe.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:function(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir:function(e,t){var r=pe.lookupNode(e,t);for(var n in r.contents)throw new pe.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir:function(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink:function(e,t,r){var n=de.createNode(e,t,41471,0);return n.link=r,n},readlink:function(e){if(!pe.isLink(e.mode))throw new pe.ErrnoError(28);return e.link}},stream_ops:{read:function(e,t,r,n,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-o,n);if(a>8&&i.subarray)t.set(i.subarray(o,o+a),r);else for(var s=0;s<a;s++)t[r+s]=i[o+s];return a},write:function(e,t,r,n,o,i){if(!n)return 0;var a=e.node;if(a.timestamp=Date.now(),t.subarray&&(!a.contents||a.contents.subarray)){if(i)return a.contents=t.subarray(r,r+n),a.usedBytes=n,n;if(0===a.usedBytes&&0===o)return a.contents=t.slice(r,r+n),a.usedBytes=n,n;if(o+n<=a.usedBytes)return a.contents.set(t.subarray(r,r+n),o),n}if(de.expandFileStorage(a,o+n),a.contents.subarray&&t.subarray)a.contents.set(t.subarray(r,r+n),o);else for(var s=0;s<n;s++)a.contents[o+s]=t[r+s];return a.usedBytes=Math.max(a.usedBytes,o+n),n},llseek:function(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&pe.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new pe.ErrnoError(28);return n},allocate:function(e,t,r){de.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap:function(e,t,r,n,o){if(!pe.isFile(e.node.mode))throw new pe.ErrnoError(43);var i,a,s=e.node.contents;if(2&o||s.buffer!==F){if((r>0||r+t<s.length)&&(s=s.subarray?s.subarray(r,r+t):Array.prototype.slice.call(s,r,r+t)),a=!0,!(i=le()))throw new pe.ErrnoError(48);C.set(s,i)}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:function(e,t,r,n,o){if(!pe.isFile(e.node.mode))throw new pe.ErrnoError(43);return 2&o||de.stream_ops.write(e,t,0,n,r,!1),0}}},pe={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(e=ue.resolve(pe.cwd(),e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new pe.ErrnoError(32);for(var r=se.normalizeArray(e.split("/").filter((function(e){return!!e})),!1),n=pe.root,o="/",i=0;i<r.length;i++){var a=i===r.length-1;if(a&&t.parent)break;if(n=pe.lookupNode(n,r[i]),o=se.join2(o,r[i]),pe.isMountpoint(n)&&(!a||a&&t.follow_mount)&&(n=n.mounted.root),!a||t.follow)for(var s=0;pe.isLink(n.mode);){var u=pe.readlink(o);if(o=ue.resolve(se.dirname(o),u),n=pe.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new pe.ErrnoError(32)}}return{path:o,node:n}},getPath:function(e){for(var t;;){if(pe.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:function(e,t){for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%pe.nameTable.length},hashAddNode:function(e){var t=pe.hashName(e.parent.id,e.name);e.name_next=pe.nameTable[t],pe.nameTable[t]=e},hashRemoveNode:function(e){var t=pe.hashName(e.parent.id,e.name);if(pe.nameTable[t]===e)pe.nameTable[t]=e.name_next;else for(var r=pe.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:function(e,t){var r=pe.mayLookup(e);if(r)throw new pe.ErrnoError(r,e);for(var n=pe.hashName(e.id,t),o=pe.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return pe.lookup(e,t)},createNode:function(e,t,r,n){var o=new pe.FSNode(e,t,r,n);return pe.hashAddNode(o),o},destroyNode:function(e){pe.hashRemoveNode(e)},isRoot:function(e){return e===e.parent},isMountpoint:function(e){return!!e.mounted},isFile:function(e){return 32768==(61440&e)},isDir:function(e){return 16384==(61440&e)},isLink:function(e){return 40960==(61440&e)},isChrdev:function(e){return 8192==(61440&e)},isBlkdev:function(e){return 24576==(61440&e)},isFIFO:function(e){return 4096==(61440&e)},isSocket:function(e){return 49152==(49152&e)},flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:function(e){var t=pe.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:function(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:function(e,t){return pe.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2},mayLookup:function(e){var t=pe.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate:function(e,t){try{return pe.lookupNode(e,t),20}catch(e){}return pe.nodePermissions(e,"wx")},mayDelete:function(e,t,r){var n;try{n=pe.lookupNode(e,t)}catch(e){return e.errno}var o=pe.nodePermissions(e,"wx");if(o)return o;if(r){if(!pe.isDir(n.mode))return 54;if(pe.isRoot(n)||pe.getPath(n)===pe.cwd())return 10}else if(pe.isDir(n.mode))return 31;return 0},mayOpen:function(e,t){return e?pe.isLink(e.mode)?32:pe.isDir(e.mode)&&("r"!==pe.flagsToPermissionString(t)||512&t)?31:pe.nodePermissions(e,pe.flagsToPermissionString(t)):44},MAX_OPEN_FDS:4096,nextfd:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pe.MAX_OPEN_FDS,r=e;r<=t;r++)if(!pe.streams[r])return r;throw new pe.ErrnoError(33)},getStream:function(e){return pe.streams[e]},createStream:function(e,t,r){pe.FSStream||(pe.FSStream=function(){this.shared={}},pe.FSStream.prototype={},Object.defineProperties(pe.FSStream.prototype,{object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(e){this.shared.flags=e}},position:{get:function(){return this.shared.position},set:function(e){this.shared.position=e}}})),e=Object.assign(new pe.FSStream,e);var n=pe.nextfd(t,r);return e.fd=n,pe.streams[n]=e,e},closeStream:function(e){pe.streams[e]=null},chrdev_stream_ops:{open:function(e){var t=pe.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:function(){throw new pe.ErrnoError(70)}},major:function(e){return e>>8},minor:function(e){return 255&e},makedev:function(e,t){return e<<8|t},registerDevice:function(e,t){pe.devices[e]={stream_ops:t}},getDevice:function(e){return pe.devices[e]},getMounts:function(e){for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push.apply(r,n.mounts)}return t},syncfs:function(e,t){"function"==typeof e&&(t=e,e=!1),pe.syncFSRequests++,pe.syncFSRequests>1&&b("warning: "+pe.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=pe.getMounts(pe.root.mount),n=0;function o(e){return pe.syncFSRequests--,t(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,o(e));++n>=r.length&&o(null)}r.forEach((function(t){if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)}))},mount:function(e,t,r){var n,o="/"===r,i=!r;if(o&&pe.root)throw new pe.ErrnoError(10);if(!o&&!i){var a=pe.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,pe.isMountpoint(n))throw new pe.ErrnoError(10);if(!pe.isDir(n.mode))throw new pe.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?pe.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:function(e){var t=pe.lookupPath(e,{follow_mount:!1});if(!pe.isMountpoint(t.node))throw new pe.ErrnoError(28);var r=t.node,n=r.mounted,o=pe.getMounts(n);Object.keys(pe.nameTable).forEach((function(e){for(var t=pe.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&pe.destroyNode(t),t=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(n);r.mount.mounts.splice(i,1)},lookup:function(e,t){return e.node_ops.lookup(e,t)},mknod:function(e,t,r){var n=pe.lookupPath(e,{parent:!0}).node,o=se.basename(e);if(!o||"."===o||".."===o)throw new pe.ErrnoError(28);var i=pe.mayCreate(n,o);if(i)throw new pe.ErrnoError(i);if(!n.node_ops.mknod)throw new pe.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:function(e,t){return t=void 0!==t?t:438,t&=4095,t|=32768,pe.mknod(e,t,0)},mkdir:function(e,t){return t=void 0!==t?t:511,t&=1023,t|=16384,pe.mknod(e,t,0)},mkdirTree:function(e,t){for(var r=e.split("/"),n="",o=0;o<r.length;++o)if(r[o]){n+="/"+r[o];try{pe.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:function(e,t,r){return void 0===r&&(r=t,t=438),t|=8192,pe.mknod(e,t,r)},symlink:function(e,t){if(!ue.resolve(e))throw new pe.ErrnoError(44);var r=pe.lookupPath(t,{parent:!0}).node;if(!r)throw new pe.ErrnoError(44);var n=se.basename(t),o=pe.mayCreate(r,n);if(o)throw new pe.ErrnoError(o);if(!r.node_ops.symlink)throw new pe.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename:function(e,t){var r,n,o=se.dirname(e),i=se.dirname(t),a=se.basename(e),s=se.basename(t);if(r=pe.lookupPath(e,{parent:!0}).node,n=pe.lookupPath(t,{parent:!0}).node,!r||!n)throw new pe.ErrnoError(44);if(r.mount!==n.mount)throw new pe.ErrnoError(75);var u,c=pe.lookupNode(r,a),f=ue.relative(e,i);if("."!==f.charAt(0))throw new pe.ErrnoError(28);if("."!==(f=ue.relative(t,o)).charAt(0))throw new pe.ErrnoError(55);try{u=pe.lookupNode(n,s)}catch(e){}if(c!==u){var l=pe.isDir(c.mode),d=pe.mayDelete(r,a,l);if(d)throw new pe.ErrnoError(d);if(d=u?pe.mayDelete(n,s,l):pe.mayCreate(n,s))throw new pe.ErrnoError(d);if(!r.node_ops.rename)throw new pe.ErrnoError(63);if(pe.isMountpoint(c)||u&&pe.isMountpoint(u))throw new pe.ErrnoError(10);if(n!==r&&(d=pe.nodePermissions(r,"w")))throw new pe.ErrnoError(d);pe.hashRemoveNode(c);try{r.node_ops.rename(c,n,s)}catch(e){throw e}finally{pe.hashAddNode(c)}}},rmdir:function(e){var t=pe.lookupPath(e,{parent:!0}).node,r=se.basename(e),n=pe.lookupNode(t,r),o=pe.mayDelete(t,r,!0);if(o)throw new pe.ErrnoError(o);if(!t.node_ops.rmdir)throw new pe.ErrnoError(63);if(pe.isMountpoint(n))throw new pe.ErrnoError(10);t.node_ops.rmdir(t,r),pe.destroyNode(n)},readdir:function(e){var t=pe.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new pe.ErrnoError(54);return t.node_ops.readdir(t)},unlink:function(e){var t=pe.lookupPath(e,{parent:!0}).node;if(!t)throw new pe.ErrnoError(44);var r=se.basename(e),n=pe.lookupNode(t,r),o=pe.mayDelete(t,r,!1);if(o)throw new pe.ErrnoError(o);if(!t.node_ops.unlink)throw new pe.ErrnoError(63);if(pe.isMountpoint(n))throw new pe.ErrnoError(10);t.node_ops.unlink(t,r),pe.destroyNode(n)},readlink:function(e){var t=pe.lookupPath(e).node;if(!t)throw new pe.ErrnoError(44);if(!t.node_ops.readlink)throw new pe.ErrnoError(28);return ue.resolve(pe.getPath(t.parent),t.node_ops.readlink(t))},stat:function(e,t){var r=pe.lookupPath(e,{follow:!t}).node;if(!r)throw new pe.ErrnoError(44);if(!r.node_ops.getattr)throw new pe.ErrnoError(63);return r.node_ops.getattr(r)},lstat:function(e){return pe.stat(e,!0)},chmod:function(e,t,r){var n;if(!(n="string"==typeof e?pe.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new pe.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:function(e,t){pe.chmod(e,t,!0)},fchmod:function(e,t){var r=pe.getStream(e);if(!r)throw new pe.ErrnoError(8);pe.chmod(r.node,t)},chown:function(e,t,r,n){var o;if(!(o="string"==typeof e?pe.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new pe.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:function(e,t,r){pe.chown(e,t,r,!0)},fchown:function(e,t,r){var n=pe.getStream(e);if(!n)throw new pe.ErrnoError(8);pe.chown(n.node,t,r)},truncate:function(e,t){if(t<0)throw new pe.ErrnoError(28);var r;if(!(r="string"==typeof e?pe.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new pe.ErrnoError(63);if(pe.isDir(r.mode))throw new pe.ErrnoError(31);if(!pe.isFile(r.mode))throw new pe.ErrnoError(28);var n=pe.nodePermissions(r,"w");if(n)throw new pe.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:function(e,t){var r=pe.getStream(e);if(!r)throw new pe.ErrnoError(8);if(0==(2097155&r.flags))throw new pe.ErrnoError(28);pe.truncate(r.node,t)},utime:function(e,t,r){var n=pe.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:function(e,r,n){if(""===e)throw new pe.ErrnoError(44);var o;if(n=void 0===n?438:n,n=64&(r="string"==typeof r?pe.modeStringToFlags(r):r)?4095&n|32768:0,"object"==l(e))o=e;else{e=se.normalize(e);try{o=pe.lookupPath(e,{follow:!(131072&r)}).node}catch(e){}}var i=!1;if(64&r)if(o){if(128&r)throw new pe.ErrnoError(20)}else o=pe.mknod(e,n,0),i=!0;if(!o)throw new pe.ErrnoError(44);if(pe.isChrdev(o.mode)&&(r&=-513),65536&r&&!pe.isDir(o.mode))throw new pe.ErrnoError(54);if(!i){var a=pe.mayOpen(o,r);if(a)throw new pe.ErrnoError(a)}512&r&&!i&&pe.truncate(o,0),r&=-131713;var s=pe.createStream({node:o,path:pe.getPath(o),flags:r,seekable:!0,position:0,stream_ops:o.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!t.logReadFiles||1&r||(pe.readFiles||(pe.readFiles={}),e in pe.readFiles||(pe.readFiles[e]=1)),s},close:function(e){if(pe.isClosed(e))throw new pe.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{pe.closeStream(e.fd)}e.fd=null},isClosed:function(e){return null===e.fd},llseek:function(e,t,r){if(pe.isClosed(e))throw new pe.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new pe.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new pe.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read:function(e,t,r,n,o){if(n<0||o<0)throw new pe.ErrnoError(28);if(pe.isClosed(e))throw new pe.ErrnoError(8);if(1==(2097155&e.flags))throw new pe.ErrnoError(8);if(pe.isDir(e.node.mode))throw new pe.ErrnoError(31);if(!e.stream_ops.read)throw new pe.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new pe.ErrnoError(70)}else o=e.position;var a=e.stream_ops.read(e,t,r,n,o);return i||(e.position+=a),a},write:function(e,t,r,n,o,i){if(n<0||o<0)throw new pe.ErrnoError(28);if(pe.isClosed(e))throw new pe.ErrnoError(8);if(0==(2097155&e.flags))throw new pe.ErrnoError(8);if(pe.isDir(e.node.mode))throw new pe.ErrnoError(31);if(!e.stream_ops.write)throw new pe.ErrnoError(28);e.seekable&&1024&e.flags&&pe.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new pe.ErrnoError(70)}else o=e.position;var s=e.stream_ops.write(e,t,r,n,o,i);return a||(e.position+=s),s},allocate:function(e,t,r){if(pe.isClosed(e))throw new pe.ErrnoError(8);if(t<0||r<=0)throw new pe.ErrnoError(28);if(0==(2097155&e.flags))throw new pe.ErrnoError(8);if(!pe.isFile(e.node.mode)&&!pe.isDir(e.node.mode))throw new pe.ErrnoError(43);if(!e.stream_ops.allocate)throw new pe.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap:function(e,t,r,n,o){if(0!=(2&n)&&0==(2&o)&&2!=(2097155&e.flags))throw new pe.ErrnoError(2);if(1==(2097155&e.flags))throw new pe.ErrnoError(2);if(!e.stream_ops.mmap)throw new pe.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,o)},msync:function(e,t,r,n,o){return e&&e.stream_ops.msync?e.stream_ops.msync(e,t,r,n,o):0},munmap:function(e){return 0},ioctl:function(e,t,r){if(!e.stream_ops.ioctl)throw new pe.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r.flags=r.flags||0,r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw new Error('Invalid encoding type "'+r.encoding+'"');var n=pe.open(e,r.flags),o=pe.stat(e).size,i=new Uint8Array(o);return pe.read(n,i,0,o,0),"utf8"===r.encoding?t=z(i,0):"binary"===r.encoding&&(t=i),pe.close(n),t},writeFile:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.flags=r.flags||577;var n=pe.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(U(t)+1),i=I(t,o,0,o.length);pe.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");pe.write(n,t,0,t.byteLength,void 0,r.canOwn)}pe.close(n)},cwd:function(){return pe.currentPath},chdir:function(e){var t=pe.lookupPath(e,{follow:!0});if(null===t.node)throw new pe.ErrnoError(44);if(!pe.isDir(t.node.mode))throw new pe.ErrnoError(54);var r=pe.nodePermissions(t.node,"x");if(r)throw new pe.ErrnoError(r);pe.currentPath=t.path},createDefaultDirectories:function(){pe.mkdir("/tmp"),pe.mkdir("/home"),pe.mkdir("/home/web_user")},createDefaultDevices:function(){pe.mkdir("/dev"),pe.registerDevice(pe.makedev(1,3),{read:function(){return 0},write:function(e,t,r,n,o){return n}}),pe.mkdev("/dev/null",pe.makedev(1,3)),fe.register(pe.makedev(5,0),fe.default_tty_ops),fe.register(pe.makedev(6,0),fe.default_tty1_ops),pe.mkdev("/dev/tty",pe.makedev(5,0)),pe.mkdev("/dev/tty1",pe.makedev(6,0));var e=function(){if("object"==("undefined"==typeof crypto?"undefined":l(crypto))&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}if(w)try{var t=a.default;return function(){return t.randomBytes(1)[0]}}catch(e){}return function(){return J("randomDevice")}}();pe.createDevice("/dev","random",e),pe.createDevice("/dev","urandom",e),pe.mkdir("/dev/shm"),pe.mkdir("/dev/shm/tmp")},createSpecialDirectories:function(){pe.mkdir("/proc");var e=pe.mkdir("/proc/self");pe.mkdir("/proc/self/fd"),pe.mount({mount:function(){var t=pe.createNode(e,"fd",16895,73);return t.node_ops={lookup:function(e,t){var r=+t,n=pe.getStream(r);if(!n)throw new pe.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:function(){return n.path}}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams:function(){t.stdin?pe.createDevice("/dev","stdin",t.stdin):pe.symlink("/dev/tty","/dev/stdin"),t.stdout?pe.createDevice("/dev","stdout",null,t.stdout):pe.symlink("/dev/tty","/dev/stdout"),t.stderr?pe.createDevice("/dev","stderr",null,t.stderr):pe.symlink("/dev/tty1","/dev/stderr"),pe.open("/dev/stdin",0),pe.open("/dev/stdout",1),pe.open("/dev/stderr",1)},ensureErrnoError:function(){pe.ErrnoError||(pe.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},pe.ErrnoError.prototype=new Error,pe.ErrnoError.prototype.constructor=pe.ErrnoError,[44].forEach((function(e){pe.genericErrors[e]=new pe.ErrnoError(e),pe.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:function(){pe.ensureErrnoError(),pe.nameTable=new Array(4096),pe.mount(de,{},"/"),pe.createDefaultDirectories(),pe.createDefaultDevices(),pe.createSpecialDirectories(),pe.filesystems={MEMFS:de}},init:function(e,r,n){pe.init.initialized=!0,pe.ensureErrnoError(),t.stdin=e||t.stdin,t.stdout=r||t.stdout,t.stderr=n||t.stderr,pe.createStandardStreams()},quit:function(){pe.init.initialized=!1;for(var e=0;e<pe.streams.length;e++){var t=pe.streams[e];t&&pe.close(t)}},getMode:function(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r},findObject:function(e,t){var r=pe.analyzePath(e,t);return r.exists?r.object:null},analyzePath:function(e,t){try{e=(n=pe.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=pe.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=se.basename(e),n=pe.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:function(e,t,r,n){e="string"==typeof e?e:pe.getPath(e);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var a=se.join2(e,i);try{pe.mkdir(a)}catch(e){}e=a}}return a},createFile:function(e,t,r,n,o){var i=se.join2("string"==typeof e?e:pe.getPath(e),t),a=pe.getMode(n,o);return pe.create(i,a)},createDataFile:function(e,t,r,n,o,i){var a=t;e&&(e="string"==typeof e?e:pe.getPath(e),a=t?se.join2(e,t):e);var s=pe.getMode(n,o),u=pe.create(a,s);if(r){if("string"==typeof r){for(var c=new Array(r.length),f=0,l=r.length;f<l;++f)c[f]=r.charCodeAt(f);r=c}pe.chmod(u,146|s);var d=pe.open(u,577);pe.write(d,r,0,r.length,0,i),pe.close(d),pe.chmod(u,s)}return u},createDevice:function(e,t,r,n){var o=se.join2("string"==typeof e?e:pe.getPath(e),t),i=pe.getMode(!!r,!!n);pe.createDevice.major||(pe.createDevice.major=64);var a=pe.makedev(pe.createDevice.major++,0);return pe.registerDevice(a,{open:function(e){e.seekable=!1},close:function(e){n&&n.buffer&&n.buffer.length&&n(10)},read:function(e,t,n,o,i){for(var a=0,s=0;s<o;s++){var u;try{u=r()}catch(e){throw new pe.ErrnoError(29)}if(void 0===u&&0===a)throw new pe.ErrnoError(6);if(null==u)break;a++,t[n+s]=u}return a&&(e.node.timestamp=Date.now()),a},write:function(e,t,r,o,i){for(var a=0;a<o;a++)try{n(t[r+a])}catch(e){throw new pe.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),a}}),pe.mkdev(o,i,a)},forceLoadFile:function(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(!u)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=ce(u(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new pe.ErrnoError(29)}},createLazyFile:function(e,t,r,n,o){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",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,i=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,a=1048576;o||(a=n);var s=this;s.setDataGetter((function(e){var t=e*a,o=(e+1)*a-1;if(o=Math.min(o,n-1),void 0===s.chunks[e]&&(s.chunks[e]=function(e,t){if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==a&&o.setRequestHeader("Range","bytes="+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 "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):ce(o.responseText||"",!0)}(t,o)),void 0===s.chunks[e])throw new Error("doXHR failed!");return s.chunks[e]})),!i&&n||(a=n=1,n=this.getter(0).length,a=n,E("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=a,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!g)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a=new i;Object.defineProperties(a,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var s={isDevice:!1,contents:a}}else s={isDevice:!1,url:r};var u=pe.createFile(e,t,s,n,o);s.contents?u.contents=s.contents:s.url&&(u.contents=null,u.url=s.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var c={};function f(e,t,r,n,o){var i=e.node.contents;if(o>=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var s=0;s<a;s++)t[r+s]=i[o+s];else for(s=0;s<a;s++)t[r+s]=i.get(o+s);return a}return Object.keys(u.stream_ops).forEach((function(e){var t=u.stream_ops[e];c[e]=function(){return pe.forceLoadFile(u),t.apply(null,arguments)}})),c.read=function(e,t,r,n,o){return pe.forceLoadFile(u),f(e,t,r,n,o)},c.mmap=function(e,t,r,n,o){pe.forceLoadFile(u);var i=le();if(!i)throw new pe.ErrnoError(48);return f(e,C,i,t,r),{ptr:i,allocated:!0}},u.stream_ops=c,u},createPreloadedFile:function(e,t,r,n,o,i,a,s,u,f){var l=t?ue.resolve(se.join2(e,t)):e;function d(r){function c(r){f&&f(),s||pe.createDataFile(e,t,r,n,o,u),i&&i(),G()}Browser.handledByPreloadPlugin(r,l,c,(function(){a&&a(),G()}))||c(r)}X(),"string"==typeof r?function(e,t,r,n){var o=n?"":"al "+e;c(e,(function(r){S(r,'Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(r)),o&&G()}),(function(t){if(!r)throw'Loading data file "'+e+'" failed.';r()})),o&&X()}(r,(function(e){return d(e)}),a):d(r)},indexedDB:function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB},DB_NAME:function(){return"EM_FS_"+window.location.pathname},DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:function(e,t,r){t=t||function(){},r=r||function(){};var n=pe.indexedDB();try{var o=n.open(pe.DB_NAME(),pe.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=function(){E("creating db"),o.result.createObjectStore(pe.DB_STORE_NAME)},o.onsuccess=function(){var n=o.result.transaction([pe.DB_STORE_NAME],"readwrite"),i=n.objectStore(pe.DB_STORE_NAME),a=0,s=0,u=e.length;function c(){0==s?t():r()}e.forEach((function(e){var t=i.put(pe.analyzePath(e).object.contents,e);t.onsuccess=function(){++a+s==u&&c()},t.onerror=function(){s++,a+s==u&&c()}})),n.onerror=r},o.onerror=r},loadFilesFromDB:function(e,t,r){t=t||function(){},r=r||function(){};var n=pe.indexedDB();try{var o=n.open(pe.DB_NAME(),pe.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=r,o.onsuccess=function(){var n=o.result;try{var i=n.transaction([pe.DB_STORE_NAME],"readonly")}catch(e){return void r(e)}var a=i.objectStore(pe.DB_STORE_NAME),s=0,u=0,c=e.length;function f(){0==u?t():r()}e.forEach((function(e){var t=a.get(e);t.onsuccess=function(){pe.analyzePath(e).exists&&pe.unlink(e),pe.createDataFile(se.dirname(e),se.basename(e),t.result,!0,!0,!0),++s+u==c&&f()},t.onerror=function(){u++,s+u==c&&f()}})),i.onerror=r},o.onerror=r}},he={DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){if(se.isAbs(t))return t;var n;if(-100===e)n=pe.cwd();else{var o=pe.getStream(e);if(!o)throw new pe.ErrnoError(8);n=o.path}if(0==t.length){if(!r)throw new pe.ErrnoError(44);return n}return se.join2(n,t)},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&se.normalize(t)!==se.normalize(pe.getPath(e.node)))return-54;throw e}return j[r>>2]=n.dev,j[r+4>>2]=0,j[r+8>>2]=n.ino,j[r+12>>2]=n.mode,j[r+16>>2]=n.nlink,j[r+20>>2]=n.uid,j[r+24>>2]=n.gid,j[r+28>>2]=n.rdev,j[r+32>>2]=0,Q=[n.size>>>0,(Z=n.size,+Math.abs(Z)>=1?Z>0?(0|Math.min(+Math.floor(Z/4294967296),4294967295))>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],j[r+40>>2]=Q[0],j[r+44>>2]=Q[1],j[r+48>>2]=4096,j[r+52>>2]=n.blocks,Q=[Math.floor(n.atime.getTime()/1e3)>>>0,(Z=Math.floor(n.atime.getTime()/1e3),+Math.abs(Z)>=1?Z>0?(0|Math.min(+Math.floor(Z/4294967296),4294967295))>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],j[r+56>>2]=Q[0],j[r+60>>2]=Q[1],j[r+64>>2]=0,Q=[Math.floor(n.mtime.getTime()/1e3)>>>0,(Z=Math.floor(n.mtime.getTime()/1e3),+Math.abs(Z)>=1?Z>0?(0|Math.min(+Math.floor(Z/4294967296),4294967295))>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],j[r+72>>2]=Q[0],j[r+76>>2]=Q[1],j[r+80>>2]=0,Q=[Math.floor(n.ctime.getTime()/1e3)>>>0,(Z=Math.floor(n.ctime.getTime()/1e3),+Math.abs(Z)>=1?Z>0?(0|Math.min(+Math.floor(Z/4294967296),4294967295))>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],j[r+88>>2]=Q[0],j[r+92>>2]=Q[1],j[r+96>>2]=0,Q=[n.ino>>>0,(Z=n.ino,+Math.abs(Z)>=1?Z>0?(0|Math.min(+Math.floor(Z/4294967296),4294967295))>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],j[r+104>>2]=Q[0],j[r+108>>2]=Q[1],0},doMsync:function(e,t,r,n,o){var i=A.slice(e,e+r);pe.msync(t,i,o,r,n)},varargs:void 0,get:function(){return he.varargs+=4,j[he.varargs-4>>2]},getStr:function(e){return W(e)},getStreamFromFD:function(e){var t=pe.getStream(e);if(!t)throw new pe.ErrnoError(8);return t}},me={};function ve(e){for(;e.length;){var t=e.pop();e.pop()(t)}}function ye(e){return this.fromWireType(j[e>>2])}var ge={},we={},_e={},Ee=48,be=57;function ke(e){if(void 0===e)return"_unknown";var t=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return t>=Ee&&t<=be?"_"+e:e}function Pe(e,t){return e=ke(e),new Function("body","return function "+e+'() {\n    "use strict";    return body.apply(this, arguments);\n};\n')(t)}function Te(e,t){var r=Pe(t,(function(e){this.name=t,this.message=e;var r=new Error(e).stack;void 0!==r&&(this.stack=this.toString()+"\n"+r.replace(/^Error(:[^\n]*)?\n/,""))}));return r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},r}var De=void 0;function Se(e){throw new De(e)}function Fe(e,t,r){function n(t){var n=r(t);n.length!==e.length&&Se("Mismatched type converter count");for(var o=0;o<e.length;++o)$e(e[o],n[o])}e.forEach((function(e){_e[e]=t}));var o=new Array(t.length),i=[],a=0;t.forEach((function(e,t){we.hasOwnProperty(e)?o[t]=we[e]:(i.push(e),ge.hasOwnProperty(e)||(ge[e]=[]),ge[e].push((function(){o[t]=we[e],++a===i.length&&n(o)})))})),0===i.length&&n(o)}function Ce(e){switch(e){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+e)}}var Ae=void 0;function xe(e){for(var t="",r=e;A[r];)t+=Ae[A[r++]];return t}var Me=void 0;function je(e){throw new Me(e)}function $e(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!("argPackAdvance"in t))throw new TypeError("registerType registeredInstance requires argPackAdvance");var n=t.name;if(e||je('type "'+n+'" must have a positive integer typeid pointer'),we.hasOwnProperty(e)){if(r.ignoreDuplicateRegistrations)return;je("Cannot register type '"+n+"' twice")}if(we[e]=t,delete _e[e],ge.hasOwnProperty(e)){var o=ge[e];delete ge[e],o.forEach((function(e){return e()}))}}function Oe(e){if(!(this instanceof nt))return!1;if(!(e instanceof nt))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}function Re(e){je(e.$$.ptrType.registeredClass.name+" instance already deleted")}var Be=!1;function Ne(e){}function ze(e){e.count.value-=1,0===e.count.value&&function(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}(e)}function We(e,t,r){if(t===r)return e;if(void 0===r.baseClass)return null;var n=We(e,t,r.baseClass);return null===n?null:r.downcast(n)}var Ie={};function Ue(){return Object.keys(Xe).length}function Le(){var e=[];for(var t in Xe)Xe.hasOwnProperty(t)&&e.push(Xe[t]);return e}var He=[];function Ve(){for(;He.length;){var e=He.pop();e.$$.deleteScheduled=!1,e.delete()}}var qe=void 0;function Ye(e){qe=e,He.length&&qe&&qe(Ve)}var Xe={};function Ge(e,t){return t=function(e,t){for(void 0===t&&je("ptr should not be undefined");e.baseClass;)t=e.upcast(t),e=e.baseClass;return t}(e,t),Xe[t]}function Je(e,t){return t.ptrType&&t.ptr||Se("makeClassHandle requires ptr and ptrType"),!!t.smartPtrType!=!!t.smartPtr&&Se("Both smartPtrType and smartPtr must be specified"),t.count={value:1},Ze(Object.create(e,{$$:{value:t}}))}function Ke(e){var t=this.getPointee(e);if(!t)return this.destructor(e),null;var r=Ge(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?Je(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:t,smartPtrType:this,smartPtr:e}):Je(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var i,a=this.registeredClass.getActualType(t),s=Ie[a];if(!s)return o.call(this);i=this.isConst?s.constPointerType:s.pointerType;var u=We(t,this.registeredClass,i.registeredClass);return null===u?o.call(this):this.isSmartPointer?Je(i.registeredClass.instancePrototype,{ptrType:i,ptr:u,smartPtrType:this,smartPtr:e}):Je(i.registeredClass.instancePrototype,{ptrType:i,ptr:u})}function Ze(e){return"undefined"==typeof FinalizationRegistry?(Ze=function(e){return e},e):(Be=new FinalizationRegistry((function(e){ze(e.$$)})),Ze=function(e){var t=e.$$;if(t.smartPtr){var r={$$:t};Be.register(e,r,e)}return e},Ne=function(e){return Be.unregister(e)},Ze(e))}function Qe(){if(this.$$.ptr||Re(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e,t=Ze(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 et(){this.$$.ptr||Re(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&je("Object already scheduled for deletion"),Ne(this),ze(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function tt(){return!this.$$.ptr}function rt(){return this.$$.ptr||Re(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&je("Object already scheduled for deletion"),He.push(this),1===He.length&&qe&&qe(Ve),this.$$.deleteScheduled=!0,this}function nt(){}function ot(e,t,r){if(void 0===e[t].overloadTable){var n=e[t];e[t]=function(){return e[t].overloadTable.hasOwnProperty(arguments.length)||je("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}}function it(e,t,r,n,o,i,a,s){this.name=e,this.constructor=t,this.instancePrototype=r,this.rawDestructor=n,this.baseClass=o,this.getActualType=i,this.upcast=a,this.downcast=s,this.pureVirtualFunctions=[]}function at(e,t,r){for(;t!==r;)t.upcast||je("Expected null or instance of "+r.name+", got an instance of "+t.name),e=t.upcast(e),t=t.baseClass;return e}function st(e,t){if(null===t)return this.isReference&&je("null is not a valid "+this.name),0;t.$$||je('Cannot pass "'+At(t)+'" as a '+this.name),t.$$.ptr||je("Cannot pass deleted object as a pointer of type "+this.name);var r=t.$$.ptrType.registeredClass;return at(t.$$.ptr,r,this.registeredClass)}function ut(e,t){var r;if(null===t)return this.isReference&&je("null is not a valid "+this.name),this.isSmartPointer?(r=this.rawConstructor(),null!==e&&e.push(this.rawDestructor,r),r):0;t.$$||je('Cannot pass "'+At(t)+'" as a '+this.name),t.$$.ptr||je("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&t.$$.ptrType.isConst&&je("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=at(t.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(void 0===t.$$.smartPtr&&je("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:t.$$.smartPtrType===this?r=t.$$.smartPtr:je("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,Ct.toHandle((function(){o.delete()}))),null!==e&&e.push(this.rawDestructor,r)}break;default:je("Unsupporting sharing policy")}return r}function ct(e,t){if(null===t)return this.isReference&&je("null is not a valid "+this.name),0;t.$$||je('Cannot pass "'+At(t)+'" as a '+this.name),t.$$.ptr||je("Cannot pass deleted object as a pointer of type "+this.name),t.$$.ptrType.isConst&&je("Cannot convert argument of type "+t.$$.ptrType.name+" to parameter type "+this.name);var r=t.$$.ptrType.registeredClass;return at(t.$$.ptr,r,this.registeredClass)}function ft(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function lt(e){this.rawDestructor&&this.rawDestructor(e)}function dt(e){null!==e&&e.delete()}function pt(e,t,r,n,o,i,a,s,u,c,f){this.name=e,this.registeredClass=t,this.isReference=r,this.isConst=n,this.isSmartPointer=o,this.pointeeType=i,this.sharingPolicy=a,this.rawGetPointee=s,this.rawConstructor=u,this.rawShare=c,this.rawDestructor=f,o||void 0!==t.baseClass?this.toWireType=ut:n?(this.toWireType=st,this.destructorFunction=null):(this.toWireType=ct,this.destructorFunction=null)}var ht=[];function mt(e){var t=ht[e];return t||(e>=ht.length&&(ht.length=e+1),ht[e]=t=B.get(e)),t}function vt(e,r,n){return e.includes("j")?function(e,r,n){var o=t["dynCall_"+e];return n&&n.length?o.apply(null,[r].concat(n)):o.call(null,r)}(e,r,n):mt(r).apply(null,n)}function yt(e,t){var r,n,o,i=(e=xe(e)).includes("j")?(r=e,n=t,o=[],function(){return o.length=0,Object.assign(o,arguments),vt(r,n,o)}):mt(t);return"function"!=typeof i&&je("unknown function pointer with signature "+e+": "+t),i}var gt=void 0;function wt(e){var t=sr(e),r=xe(t);return ir(t),r}function _t(e,t){var r=[],n={};throw t.forEach((function e(t){n[t]||we[t]||(_e[t]?_e[t].forEach(e):(r.push(t),n[t]=!0))})),new gt(e+": "+r.map(wt).join([", "]))}function Et(e,t){for(var r=[],n=0;n<e;n++)r.push($[t+4*n>>2]);return r}function bt(e,t){if(!(e instanceof Function))throw new TypeError("new_ called with constructor type "+l(e)+" which is not a function");var r=Pe(e.name||"unknownFunctionName",(function(){}));r.prototype=e.prototype;var n=new r,o=e.apply(n,t);return o instanceof Object?o:n}function kt(e,t,r,n,o){var i=t.length;i<2&&je("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var a=null!==t[1]&&null!==r,s=!1,u=1;u<t.length;++u)if(null!==t[u]&&void 0===t[u].destructorFunction){s=!0;break}var c="void"!==t[0].name,f="",l="";for(u=0;u<i-2;++u)f+=(0!==u?", ":"")+"arg"+u,l+=(0!==u?", ":"")+"arg"+u+"Wired";var d="return function "+ke(e)+"("+f+") {\nif (arguments.length !== "+(i-2)+") {\nthrowBindingError('function "+e+" called with ' + arguments.length + ' arguments, expected "+(i-2)+" args!');\n}\n";s&&(d+="var destructors = [];\n");var p=s?"destructors":"null",h=["throwBindingError","invoker","fn","runDestructors","retType","classParam"],m=[je,n,o,ve,t[0],t[1]];for(a&&(d+="var thisWired = classParam.toWireType("+p+", this);\n"),u=0;u<i-2;++u)d+="var arg"+u+"Wired = argType"+u+".toWireType("+p+", arg"+u+"); // "+t[u+2].name+"\n",h.push("argType"+u),m.push(t[u+2]);if(a&&(l="thisWired"+(l.length>0?", ":"")+l),d+=(c?"var rv = ":"")+"invoker(fn"+(l.length>0?", ":"")+l+");\n",s)d+="runDestructors(destructors);\n";else for(u=a?1:2;u<t.length;++u){var v=1===u?"thisWired":"arg"+(u-2)+"Wired";null!==t[u].destructorFunction&&(d+=v+"_dtor("+v+"); // "+t[u].name+"\n",h.push(v+"_dtor"),m.push(t[u].destructorFunction))}return c&&(d+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),d+="}\n",h.push(d),bt(Function,h).apply(null,m)}var Pt=[],Tt=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function Dt(e){e>4&&0==--Tt[e].refcount&&(Tt[e]=void 0,Pt.push(e))}function St(){for(var e=0,t=5;t<Tt.length;++t)void 0!==Tt[t]&&++e;return e}function Ft(){for(var e=5;e<Tt.length;++e)if(void 0!==Tt[e])return Tt[e];return null}var Ct={toValue:function(e){return e||je("Cannot use deleted val. handle = "+e),Tt[e].value},toHandle:function(e){switch(e){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var t=Pt.length?Pt.pop():Tt.length;return Tt[t]={refcount:1,value:e},t}}};function At(e){if(null===e)return"null";var t=l(e);return"object"===t||"array"===t||"function"===t?e.toString():""+e}function xt(e,t){switch(t){case 2:return function(e){return this.fromWireType(O[e>>2])};case 3:return function(e){return this.fromWireType(R[e>>3])};default:throw new TypeError("Unknown float type: "+e)}}function Mt(e,t,r){switch(t){case 0:return r?function(e){return C[e]}:function(e){return A[e]};case 1:return r?function(e){return x[e>>1]}:function(e){return M[e>>1]};case 2:return r?function(e){return j[e>>2]}:function(e){return $[e>>2]};default:throw new TypeError("Unknown integer type: "+e)}}var jt="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function $t(e,t){for(var r=e,n=r>>1,o=n+t/2;!(n>=o)&&M[n];)++n;if((r=n<<1)-e>32&&jt)return jt.decode(A.subarray(e,r));for(var i="",a=0;!(a>=t/2);++a){var s=x[e+2*a>>1];if(0==s)break;i+=String.fromCharCode(s)}return i}function Ot(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 a=e.charCodeAt(i);x[t>>1]=a,t+=2}return x[t>>1]=0,t-n}function Rt(e){return 2*e.length}function Bt(e,t){for(var r=0,n="";!(r>=t/4);){var o=j[e+4*r>>2];if(0==o)break;if(++r,o>=65536){var i=o-65536;n+=String.fromCharCode(55296|i>>10,56320|1023&i)}else n+=String.fromCharCode(o)}return n}function Nt(e,t,r){if(void 0===r&&(r=2147483647),r<4)return 0;for(var n=t,o=n+r-4,i=0;i<e.length;++i){var a=e.charCodeAt(i);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i)),j[t>>2]=a,(t+=4)+4>o)break}return j[t>>2]=0,t-n}function zt(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}var Wt=!0;function It(e,t){var r=we[e];return void 0===r&&je(t+" has unknown type "+wt(e)),r}var Ut={};function Lt(e){var t=Ut[e];return void 0===t?xe(e):t}var Ht=[];function Vt(){return"object"==("undefined"==typeof globalThis?"undefined":l(globalThis))?globalThis:Function("return this")()}var qt,Yt=[];qt=w?function(){var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:function(){return performance.now()};var Xt={};function Gt(){if(!Gt.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==("undefined"==typeof navigator?"undefined":l(navigator))&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:v||"./this.program"};for(var t in Xt)void 0===Xt[t]?delete e[t]:e[t]=Xt[t];var r=[];for(var t in e)r.push(t+"="+e[t]);Gt.strings=r}return Gt.strings}function Jt(e){return e%4==0&&(e%100!=0||e%400==0)}var Kt=[31,29,31,30,31,30,31,31,30,31,30,31],Zt=[31,28,31,30,31,30,31,31,30,31,30,31];function Qt(e,t,r,n){var o=j[n+40>>2],i={tm_sec:j[n>>2],tm_min:j[n+4>>2],tm_hour:j[n+8>>2],tm_mday:j[n+12>>2],tm_mon:j[n+16>>2],tm_year:j[n+20>>2],tm_wday:j[n+24>>2],tm_yday:j[n+28>>2],tm_isdst:j[n+32>>2],tm_gmtoff:j[n+36>>2],tm_zone:o?W(o):""},a=W(r),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var u in s)a=a.replace(new RegExp(u,"g"),s[u]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],f=["January","February","March","April","May","June","July","August","September","October","November","December"];function l(e,t,r){for(var n="number"==typeof e?e.toString():e||"";n.length<t;)n=r[0]+n;return n}function d(e,t){return l(e,t,"0")}function p(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 h(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 m(e){var t=function(e,t){for(var r=new Date(e.getTime());t>0;){var n=Jt(r.getFullYear()),o=r.getMonth(),i=(n?Kt:Zt)[o];if(!(t>i-r.getDate()))return r.setDate(r.getDate()+t),r;t-=i-r.getDate()+1,r.setDate(1),o<11?r.setMonth(o+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r}(new Date(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=h(r),i=h(n);return p(o,t)<=0?p(i,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var v={"%a":function(e){return c[e.tm_wday].substring(0,3)},"%A":function(e){return c[e.tm_wday]},"%b":function(e){return f[e.tm_mon].substring(0,3)},"%B":function(e){return f[e.tm_mon]},"%C":function(e){return d((e.tm_year+1900)/100|0,2)},"%d":function(e){return d(e.tm_mday,2)},"%e":function(e){return l(e.tm_mday,2," ")},"%g":function(e){return m(e).toString().substring(2)},"%G":function(e){return m(e)},"%H":function(e){return d(e.tm_hour,2)},"%I":function(e){var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),d(t,2)},"%j":function(e){return d(e.tm_mday+function(e,t){for(var r=0,n=0;n<=t;r+=e[n++]);return r}(Jt(e.tm_year+1900)?Kt:Zt,e.tm_mon-1),3)},"%m":function(e){return d(e.tm_mon+1,2)},"%M":function(e){return d(e.tm_min,2)},"%n":function(){return"\n"},"%p":function(e){return e.tm_hour>=0&&e.tm_hour<12?"AM":"PM"},"%S":function(e){return d(e.tm_sec,2)},"%t":function(){return"\t"},"%u":function(e){return e.tm_wday||7},"%U":function(e){var t=e.tm_yday+7-e.tm_wday;return d(Math.floor(t/7),2)},"%V":function(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&&Jt(e.tm_year)||(t=1)}}else{t=52;var n=(e.tm_wday+7-e.tm_yday-1)%7;(4==n||5==n&&Jt(e.tm_year%400-1))&&t++}return d(t,2)},"%w":function(e){return e.tm_wday},"%W":function(e){var t=e.tm_yday+7-(e.tm_wday+6)%7;return d(Math.floor(t/7),2)},"%y":function(e){return(e.tm_year+1900).toString().substring(2)},"%Y":function(e){return e.tm_year+1900},"%z":function(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":function(e){return e.tm_zone},"%%":function(){return"%"}};for(var u in a=a.replace(/%%/g,"\0\0"),v)a.includes(u)&&(a=a.replace(new RegExp(u,"g"),v[u](i)));var y=ce(a=a.replace(/\0\0/g,"%"),!1);return y.length>t?0:(function(e,t){C.set(e,t)}(y,e),y.length-1)}var er=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=pe.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},tr=365,rr=146;Object.defineProperties(er.prototype,{read:{get:function(){return(this.mode&tr)===tr},set:function(e){e?this.mode|=tr:this.mode&=-366}},write:{get:function(){return(this.mode&rr)===rr},set:function(e){e?this.mode|=rr:this.mode&=-147}},isFolder:{get:function(){return pe.isDir(this.mode)}},isDevice:{get:function(){return pe.isChrdev(this.mode)}}}),pe.FSNode=er,pe.staticInit(),t.FS_createPath=pe.createPath,t.FS_createDataFile=pe.createDataFile,t.FS_createPreloadedFile=pe.createPreloadedFile,t.FS_unlink=pe.unlink,t.FS_createLazyFile=pe.createLazyFile,t.FS_createDevice=pe.createDevice,De=t.InternalError=Te(Error,"InternalError"),function(){for(var e=new Array(256),t=0;t<256;++t)e[t]=String.fromCharCode(t);Ae=e}(),Me=t.BindingError=Te(Error,"BindingError"),nt.prototype.isAliasOf=Oe,nt.prototype.clone=Qe,nt.prototype.delete=et,nt.prototype.isDeleted=tt,nt.prototype.deleteLater=rt,t.getInheritedInstanceCount=Ue,t.getLiveInheritedInstances=Le,t.flushPendingDeletes=Ve,t.setDelayFunction=Ye,pt.prototype.getPointee=ft,pt.prototype.destructor=lt,pt.prototype.argPackAdvance=8,pt.prototype.readValueFromPointer=ye,pt.prototype.deleteObject=dt,pt.prototype.fromWireType=Ke,gt=t.UnboundTypeError=Te(Error,"UnboundTypeError"),t.count_emval_handles=St,t.get_first_emval=Ft;var nr={j:function(e){return or(e+24)+24},i:function(e,t,r){throw new ae(e).init(t,r),e},v:function(e,t,r){he.varargs=r;try{var n=he.getStreamFromFD(e);switch(t){case 0:return(o=he.get())<0?-28:pe.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=he.get();return n.flags|=o,0;case 5:return o=he.get(),x[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return i=28,j[ar()>>2]=i,-1}}catch(e){if(void 0===pe||!(e instanceof pe.ErrnoError))throw e;return-e.errno}var i},I:function(e,t,r){he.varargs=r;try{var n=he.getStreamFromFD(e);switch(t){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=he.get();return j[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:return o=he.get(),pe.ioctl(n,t,o);default:J("bad ioctl syscall "+t)}}catch(e){if(void 0===pe||!(e instanceof pe.ErrnoError))throw e;return-e.errno}},u:function(e,t,r,n){he.varargs=n;try{t=he.getStr(t),t=he.calculateAt(e,t);var o=n?he.get():0;return pe.open(t,r,o).fd}catch(e){if(void 0===pe||!(e instanceof pe.ErrnoError))throw e;return-e.errno}},y:function(e){var t=me[e];delete me[e];var r=t.rawConstructor,n=t.rawDestructor,o=t.fields;Fe([e],o.map((function(e){return e.getterReturnType})).concat(o.map((function(e){return e.setterArgumentType}))),(function(e){var i={};return o.forEach((function(t,r){var n=t.fieldName,a=e[r],s=t.getter,u=t.getterContext,c=e[r+o.length],f=t.setter,l=t.setterContext;i[n]={read:function(e){return a.fromWireType(s(u,e))},write:function(e,t){var r=[];f(l,e,c.toWireType(r,t)),ve(r)}}})),[{name:t.name,fromWireType:function(e){var t={};for(var r in i)t[r]=i[r].read(e);return n(e),t},toWireType:function(e,t){for(var o in i)if(!(o in t))throw new TypeError('Missing field:  "'+o+'"');var a=r();for(o in i)i[o].write(a,t[o]);return null!==e&&e.push(n,a),a},argPackAdvance:8,readValueFromPointer:ye,destructorFunction:n}]}))},D:function(e,t,r,n,o){},O:function(e,t,r,n,o){var i=Ce(r);$e(e,{name:t=xe(t),fromWireType:function(e){return!!e},toWireType:function(e,t){return t?n:o},argPackAdvance:8,readValueFromPointer:function(e){var n;if(1===r)n=C;else if(2===r)n=x;else{if(4!==r)throw new TypeError("Unknown boolean type size: "+t);n=j}return this.fromWireType(n[e>>i])},destructorFunction:null})},T:function(e,r,n,o,i,a,s,u,c,f,l,d,p){l=xe(l),a=yt(i,a),u&&(u=yt(s,u)),f&&(f=yt(c,f)),p=yt(d,p);var h=ke(l);!function(e,r,n){t.hasOwnProperty(e)?((void 0===n||void 0!==t[e].overloadTable&&void 0!==t[e].overloadTable[n])&&je("Cannot register public name '"+e+"' twice"),ot(t,e,e),t.hasOwnProperty(n)&&je("Cannot register multiple overloads of a function with the same number of arguments ("+n+")!"),t[e].overloadTable[n]=r):(t[e]=r,void 0!==n&&(t[e].numArguments=n))}(h,(function(){_t("Cannot construct "+l+" due to unbound types",[o])})),Fe([e,r,n],o?[o]:[],(function(r){var n,i;r=r[0],i=o?(n=r.registeredClass).instancePrototype:nt.prototype;var s=Pe(h,(function(){if(Object.getPrototypeOf(this)!==c)throw new Me("Use 'new' to construct "+l);if(void 0===d.constructor_body)throw new Me(l+" has no accessible constructor");var e=d.constructor_body[arguments.length];if(void 0===e)throw new Me("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)})),c=Object.create(i,{constructor:{value:s}});s.prototype=c;var d=new it(l,s,c,p,n,a,u,f),m=new pt(l,d,!0,!1,!1),v=new pt(l+"*",d,!1,!1,!1),y=new pt(l+" const*",d,!1,!0,!1);return Ie[e]={pointerType:v,constPointerType:y},function(e,r,n){t.hasOwnProperty(e)||Se("Replacing nonexistant public symbol"),void 0!==t[e].overloadTable&&void 0!==n?t[e].overloadTable[n]=r:(t[e]=r,t[e].argCount=n)}(h,s),[m,v,y]}))},S:function(e,t,r,n,o,i){S(t>0);var a=Et(t,r);o=yt(n,o),Fe([],[e],(function(e){var r="constructor "+(e=e[0]).name;if(void 0===e.registeredClass.constructor_body&&(e.registeredClass.constructor_body=[]),void 0!==e.registeredClass.constructor_body[t-1])throw new Me("Cannot register multiple constructors with identical number of parameters ("+(t-1)+") for class '"+e.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return e.registeredClass.constructor_body[t-1]=function(){_t("Cannot construct "+e.name+" due to unbound types",a)},Fe([],a,(function(n){return n.splice(1,0,null),e.registeredClass.constructor_body[t-1]=kt(r,n,null,o,i),[]})),[]}))},k:function(e,t,r,n,o,i,a,s){var u=Et(r,n);t=xe(t),i=yt(o,i),Fe([],[e],(function(e){var n=(e=e[0]).name+"."+t;function o(){_t("Cannot call "+n+" due to unbound types",u)}t.startsWith("@@")&&(t=Symbol[t.substring(2)]),s&&e.registeredClass.pureVirtualFunctions.push(t);var c=e.registeredClass.instancePrototype,f=c[t];return void 0===f||void 0===f.overloadTable&&f.className!==e.name&&f.argCount===r-2?(o.argCount=r-2,o.className=e.name,c[t]=o):(ot(c,t,n),c[t].overloadTable[r-2]=o),Fe([],u,(function(o){var s=kt(n,o,e,i,a);return void 0===c[t].overloadTable?(s.argCount=r-2,c[t]=s):c[t].overloadTable[r-2]=s,[]})),[]}))},N:function(e,t){$e(e,{name:t=xe(t),fromWireType:function(e){var t=Ct.toValue(e);return Dt(e),t},toWireType:function(e,t){return Ct.toHandle(t)},argPackAdvance:8,readValueFromPointer:ye,destructorFunction:null})},x:function(e,t,r){var n=Ce(r);$e(e,{name:t=xe(t),fromWireType:function(e){return e},toWireType:function(e,t){return t},argPackAdvance:8,readValueFromPointer:xt(t,n),destructorFunction:null})},e:function(e,t,r,n,o){t=xe(t);var i=Ce(r),a=function(e){return e};if(0===n){var s=32-8*r;a=function(e){return e<<s>>>s}}var u=t.includes("unsigned");$e(e,{name:t,fromWireType:a,toWireType:u?function(e,t){return this.name,t>>>0}:function(e,t){return this.name,t},argPackAdvance:8,readValueFromPointer:Mt(t,i,0!==n),destructorFunction:null})},b:function(e,t,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][t];function o(e){var t=$,r=t[e>>=2],o=t[e+1];return new n(F,o,r)}$e(e,{name:r=xe(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},w:function(e,t){var r="std::string"===(t=xe(t));$e(e,{name:t,fromWireType:function(e){var t,n=$[e>>2],o=e+4;if(r)for(var i=o,a=0;a<=n;++a){var s=o+a;if(a==n||0==A[s]){var u=W(i,s-i);void 0===t?t=u:(t+=String.fromCharCode(0),t+=u),i=s+1}}else{var c=new Array(n);for(a=0;a<n;++a)c[a]=String.fromCharCode(A[o+a]);t=c.join("")}return ir(e),t},toWireType:function(e,t){var n;t instanceof ArrayBuffer&&(t=new Uint8Array(t));var o="string"==typeof t;o||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int8Array||je("Cannot pass non-string to std::string"),n=r&&o?U(t):t.length;var i=or(4+n+1),a=i+4;if($[i>>2]=n,r&&o)I(t,A,a,n+1);else if(o)for(var s=0;s<n;++s){var u=t.charCodeAt(s);u>255&&(ir(a),je("String has UTF-16 code units that do not fit in 8 bits")),A[a+s]=u}else for(s=0;s<n;++s)A[a+s]=t[s];return null!==e&&e.push(ir,i),i},argPackAdvance:8,readValueFromPointer:ye,destructorFunction:function(e){ir(e)}})},r:function(e,t,r){var n,o,i,a,s;r=xe(r),2===t?(n=$t,o=Ot,a=Rt,i=function(){return M},s=1):4===t&&(n=Bt,o=Nt,a=zt,i=function(){return $},s=2),$e(e,{name:r,fromWireType:function(e){for(var r,o=$[e>>2],a=i(),u=e+4,c=0;c<=o;++c){var f=e+4+c*t;if(c==o||0==a[f>>s]){var l=n(u,f-u);void 0===r?r=l:(r+=String.fromCharCode(0),r+=l),u=f+t}}return ir(e),r},toWireType:function(e,n){"string"!=typeof n&&je("Cannot pass non-string to C++ string type "+r);var i=a(n),u=or(4+i+t);return $[u>>2]=i>>s,o(n,u+4,i+t),null!==e&&e.push(ir,u),u},argPackAdvance:8,readValueFromPointer:ye,destructorFunction:function(e){ir(e)}})},z:function(e,t,r,n,o,i){me[e]={name:xe(t),rawConstructor:yt(r,n),rawDestructor:yt(o,i),fields:[]}},h:function(e,t,r,n,o,i,a,s,u,c){me[e].fields.push({fieldName:xe(t),getterReturnType:r,getter:yt(n,o),getterContext:i,setterArgumentType:a,setter:yt(s,u),setterContext:c})},P:function(e,t){$e(e,{isVoid:!0,name:t=xe(t),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,t){}})},L:function(){return Date.now()},Q:function(e){do{var t=$[e>>2],r=$[(e+=4)>>2],n=$[(e+=4)>>2];e+=4;var o=W(t);pe.createPath("/",se.dirname(o),!0,!0),pe.createDataFile(o,null,C.subarray(n,n+r),!0,!0,!0)}while($[e>>2])},K:function(){return Wt},g:function(e,t,r){e=Ct.toValue(e),t=It(t,"emval::as");var n=[],o=Ct.toHandle(n);return $[r>>2]=o,t.toWireType(n,e)},A:function(e,t,r,n,o){return(e=Ht[e])(t=Ct.toValue(t),r=Lt(r),function(e){var t=[];return $[e>>2]=Ct.toHandle(t),t}(n),o)},s:function(e,t,r,n){(e=Ht[e])(t=Ct.toValue(t),r=Lt(r),null,n)},a:Dt,B:function(e){return 0===e?Ct.toHandle(Vt()):(e=Lt(e),Ct.toHandle(Vt()[e]))},m:function(e,t){var r=function(e,t){for(var r=new Array(e),n=0;n<e;++n)r[n]=It($[t+n*T>>2],"parameter "+n);return r}(e,t),n=r[0],o=n.name+"_$"+r.slice(1).map((function(e){return e.name})).join("_")+"$",i=Yt[o];if(void 0!==i)return i;for(var a=["retType"],s=[n],u="",c=0;c<e-1;++c)u+=(0!==c?", ":"")+"arg"+c,a.push("argType"+c),s.push(r[1+c]);var f="return function "+ke("methodCaller_"+o)+"(handle, name, destructors, args) {\n",l=0;for(c=0;c<e-1;++c)f+="    var arg"+c+" = argType"+c+".readValueFromPointer(args"+(l?"+"+l:"")+");\n",l+=r[c+1].argPackAdvance;for(f+="    var rv = handle[name]("+u+");\n",c=0;c<e-1;++c)r[c+1].deleteObject&&(f+="    argType"+c+".deleteObject(arg"+c+");\n");n.isVoid||(f+="    return retType.toWireType(destructors, rv);\n"),f+="};\n",a.push(f);var d,p,h=bt(Function,a).apply(null,s);return d=h,p=Ht.length,Ht.push(d),i=p,Yt[o]=i,i},d:function(e,t){return e=Ct.toValue(e),t=Ct.toValue(t),Ct.toHandle(e[t])},l:function(e){e>4&&(Tt[e].refcount+=1)},R:function(){return Ct.toHandle([])},c:function(e){return Ct.toHandle(Lt(e))},f:function(e){ve(Ct.toValue(e)),Dt(e)},o:function(){J("")},J:qt,M:function(e,t,r){A.copyWithin(e,t,t+r)},F:function(e){A.length,J("OOM")},G:function(e,t){var r=0;return Gt().forEach((function(n,o){var i=t+r;$[e+4*o>>2]=i,function(e,t,r){for(var n=0;n<e.length;++n)C[t++>>0]=e.charCodeAt(n);r||(C[t>>0]=0)}(n,i),r+=n.length+1})),0},H:function(e,t){var r=Gt();$[e>>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),$[t>>2]=n,0},q:function(e){try{var t=he.getStreamFromFD(e);return pe.close(t),0}catch(e){if(void 0===pe||!(e instanceof pe.ErrnoError))throw e;return e.errno}},t:function(e,t,r,n){try{var o=function(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=$[t>>2],s=$[t+4>>2];t+=8;var u=pe.read(e,C,a,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o}(he.getStreamFromFD(e),t,r);return j[n>>2]=o,0}catch(e){if(void 0===pe||!(e instanceof pe.ErrnoError))throw e;return e.errno}},C:function(e,t,r,n,o){try{var i=(u=r)+2097152>>>0<4194305-!!(s=t)?(s>>>0)+4294967296*u:NaN;if(isNaN(i))return 61;var a=he.getStreamFromFD(e);return pe.llseek(a,i,n),Q=[a.position>>>0,(Z=a.position,+Math.abs(Z)>=1?Z>0?(0|Math.min(+Math.floor(Z/4294967296),4294967295))>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],j[o>>2]=Q[0],j[o+4>>2]=Q[1],a.getdents&&0===i&&0===n&&(a.getdents=null),0}catch(e){if(void 0===pe||!(e instanceof pe.ErrnoError))throw e;return e.errno}var s,u},p:function(e,t,r,n){try{var o=function(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=$[t>>2],s=$[t+4>>2];t+=8;var u=pe.write(e,C,a,s,n);if(u<0)return-1;o+=u}return o}(he.getStreamFromFD(e),t,r);return $[n>>2]=o,0}catch(e){if(void 0===pe||!(e instanceof pe.ErrnoError))throw e;return e.errno}},n:function(e){},E:function(e,t,r,n){return Qt(e,t,r,n)}};!function(){var e={a:nr};function r(e,r){var n,o,i=e.exports;t.asm=i,P=t.asm.U,n=P.buffer,F=n,t.HEAP8=C=new Int8Array(n),t.HEAP16=x=new Int16Array(n),t.HEAP32=j=new Int32Array(n),t.HEAPU8=A=new Uint8Array(n),t.HEAPU16=M=new Uint16Array(n),t.HEAPU32=$=new Uint32Array(n),t.HEAPF32=O=new Float32Array(n),t.HEAPF64=R=new Float64Array(n),B=t.asm.X,o=t.asm.V,H.unshift(o),G()}function n(e){r(e.instance)}function o(t){return function(){if(!k&&(y||g)){if("function"==typeof fetch&&!re(K))return fetch(K,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+K+"'";return e.arrayBuffer()})).catch((function(){return ne(K)}));if(c)return new Promise((function(e,t){c(K,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return ne(K)}))}().then((function(t){return WebAssembly.instantiate(t,e)})).then((function(e){return e})).then(t,(function(e){b("failed to asynchronously prepare wasm: "+e),J(e)}))}if(X(),t.instantiateWasm)try{return t.instantiateWasm(e,r)}catch(e){return b("Module.instantiateWasm callback failed with error: "+e),!1}(k||"function"!=typeof WebAssembly.instantiateStreaming||te(K)||re(K)||w||"function"!=typeof fetch?o(n):fetch(K,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(n,(function(e){return b("wasm streaming compile failed: "+e),b("falling back to ArrayBuffer instantiation"),o(n)}))}))).catch(s)}(),t.___wasm_call_ctors=function(){return(t.___wasm_call_ctors=t.asm.V).apply(null,arguments)};var or=t._malloc=function(){return(or=t._malloc=t.asm.W).apply(null,arguments)},ir=t._free=function(){return(ir=t._free=t.asm.Y).apply(null,arguments)},ar=t.___errno_location=function(){return(ar=t.___errno_location=t.asm.Z).apply(null,arguments)},sr=t.___getTypeName=function(){return(sr=t.___getTypeName=t.asm._).apply(null,arguments)};t.___embind_register_native_and_builtin_types=function(){return(t.___embind_register_native_and_builtin_types=t.asm.$).apply(null,arguments)};var ur,cr=t.___cxa_is_pointer_type=function(){return(cr=t.___cxa_is_pointer_type=t.asm.aa).apply(null,arguments)};function fr(e){function r(){ur||(ur=!0,t.calledRun=!0,D||(t.noFSInit||pe.init.initialized||pe.init(),pe.ignorePermissions=!1,ie(H),n(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),function(){if(t.postRun)for("function"==typeof t.postRun&&(t.postRun=[t.postRun]);t.postRun.length;)e=t.postRun.shift(),V.unshift(e);var e;ie(V)}()))}q>0||(function(){if(t.preRun)for("function"==typeof t.preRun&&(t.preRun=[t.preRun]);t.preRun.length;)e=t.preRun.shift(),L.unshift(e);var e;ie(L)}(),q>0||(t.setStatus?(t.setStatus("Running..."),setTimeout((function(){setTimeout((function(){t.setStatus("")}),1),r()}),1)):r()))}if(t.dynCall_ji=function(){return(t.dynCall_ji=t.asm.ba).apply(null,arguments)},t.dynCall_jiii=function(){return(t.dynCall_jiii=t.asm.ca).apply(null,arguments)},t.dynCall_jiji=function(){return(t.dynCall_jiji=t.asm.da).apply(null,arguments)},t.dynCall_viijii=function(){return(t.dynCall_viijii=t.asm.ea).apply(null,arguments)},t.dynCall_iiiiij=function(){return(t.dynCall_iiiiij=t.asm.fa).apply(null,arguments)},t.dynCall_iiiiijj=function(){return(t.dynCall_iiiiijj=t.asm.ga).apply(null,arguments)},t.dynCall_iiiiiijj=function(){return(t.dynCall_iiiiiijj=t.asm.ha).apply(null,arguments)},t.___emscripten_embedded_file_data=3932716,t.addRunDependency=X,t.removeRunDependency=G,t.FS_createPath=pe.createPath,t.FS_createDataFile=pe.createDataFile,t.FS_createPreloadedFile=pe.createPreloadedFile,t.FS_createLazyFile=pe.createLazyFile,t.FS_createDevice=pe.createDevice,t.FS_unlink=pe.unlink,Y=function e(){ur||fr(),ur||(Y=e)},t.preInit)for("function"==typeof t.preInit&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.pop()();return fr(),e.exports=t,t.ready});e.exports=n})),k=function(){function e(){c(this,e)}return h(e,[{key:"on",value:function(e,t,r){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:t,ctx:r}),this}},{key:"once",value:function(e,t,r){var n=this;function o(){n.off(e,o);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];t.apply(r,a)}return o._=t,this.on(e,o,r)}},{key:"emit",value:function(e){for(var t=((this.e||(this.e={}))[e]||[]).slice(),r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];for(var i=0;i<t.length;i+=1)t[i].fn.apply(t[i].ctx,n);return this}},{key:"off",value:function(e,t){var r=this.e||(this.e={});if(!e)return Object.keys(r).forEach((function(e){delete r[e]})),void delete this.e;var n=r[e],o=[];if(n&&t)for(var i=0,a=n.length;i<a;i+=1)n[i].fn!==t&&n[i].fn._!==t&&o.push(n[i]);return o.length?r[e]=o:delete r[e],this}}]),e}();function P(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=E(e);if(t){var o=E(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return w(this,r)}}var T=function(e){v(r,e);var t=P(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return c(this,r),(e=t.call(this)).module=null,e.detector=null,e.startTimestamp=null,e.detectWidth=n.detectWidth||192,e}return h(r,[{key:"destroy",value:function(){this.off(),this.detector&&(this.detector.clear(),this.detector.delete()),this.module&&(this.module=null),this.startTimestamp=null}},{key:"load",value:function(){var e=this;return new Promise((function(t,r){b().then((function(n){e.module=n,e.module.ObjectDetector?(t(),e.detector=new e.module.ObjectDetector(e),e.detector.setDetectWidth(e.detectWidth)):r("load jessibuca object detector fail")})).catch((function(e){console.error(e),r("load jessibuca object detector error")}))}))}},{key:"setParams",value:function(e){this.detector&&this.detector.setParams({showInfo:!0,rectangleColor:{r:0,g:255,b:0},textColor:{r:255,g:0,b:255}})}},{key:"notifyDetectInfo",value:function(e){this.detector&&this.emit("jessibuca-pro-object-detector-info",e)}},{key:"detect",value:function(e){if(!this.detector)return e.data;if(null===this.startTimestamp&&(this.startTimestamp=Date.now()),Date.now()-this.startTimestamp>6e5)return e.data;var t=this.detector.detect(e.data,e.width,e.height),r=t+3*(e.width*e.height)/2;return this.module.HEAPU8.subarray(t,r)}}]),r}(k);window.JessibucaProObjectDetector=T}));