nwlink 0.0.7 → 0.0.8
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.
- package/README.md +2 -2
- package/dist/index.js +1 -1
- package/dist/ld.wasm +0 -0
- package/dist/objcopy.wasm +0 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var e={5827:(e,t,r)=>{var n,o=(n=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||__filename,function(e){var t,o,i=void 0!==(e=e||{})?e:{};i.ready=new Promise((function(e,r){t=e,o=r}));var a,s,u,c,l,f,h=Object.assign({},i),d=[],p="./this.program",m=(e,t)=>{throw t},g="object"==typeof window,y="function"==typeof importScripts,v="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,w="";v?(w=y?r(1017).dirname(w)+"/":__dirname+"/",f=()=>{l||(c=r(7147),l=r(1017))},a=function(e,t){return f(),e=l.normalize(e),c.readFileSync(e,t?void 0:"utf8")},u=e=>{var t=a(e,!0);return t.buffer||(t=new Uint8Array(t)),t},s=(e,t,r)=>{f(),e=l.normalize(e),c.readFile(e,(function(e,n){e?r(e):t(n.buffer)}))},process.argv.length>1&&(p=process.argv[1].replace(/\\/g,"/")),d=process.argv.slice(2),process.on("uncaughtException",(function(e){if(!(e instanceof ke))throw e})),process.on("unhandledRejection",(function(e){throw e})),m=(e,t)=>{if($())throw process.exitCode=e,t;var r;(r=t)instanceof ke||_("exiting due to exception: "+r),process.exit(e)},i.inspect=function(){return"[Emscripten Module object]"}):(g||y)&&(y?w=self.location.href:"undefined"!=typeof document&&document.currentScript&&(w=document.currentScript.src),n&&(w=n),w=0!==w.indexOf("blob:")?w.substr(0,w.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},y&&(u=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),s=(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 b,E=i.print||console.log.bind(console),_=i.printErr||console.warn.bind(console);Object.assign(i,h),h=null,i.arguments&&(d=i.arguments),i.thisProgram&&(p=i.thisProgram),i.quit&&(m=i.quit),i.wasmBinary&&(b=i.wasmBinary);var S,A=i.noExitRuntime||!0;"object"!=typeof WebAssembly&&te("no native wasm support detected");var I,k=!1;function C(e,t){e||te(t)}var P,O,T,x,R,D="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function M(e,t,r){for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&D)return D.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 F(e,t){return e?M(T,e,t):""}function N(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 L(e,t,r){return N(e,T,t,r)}function H(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&e.charCodeAt(++r)),n<=127?++t:t+=n<=2047?2:n<=65535?3:4}return t}function U(e){var t=H(e)+1,r=Ie(t);return N(e,O,r,t),r}i.INITIAL_MEMORY;var B,z=[],j=[],V=[],G=[];function $(){return A}var X,K,W,q,Y=0,Z=null,J=null;function Q(e){Y++,i.monitorRunDependencies&&i.monitorRunDependencies(Y)}function ee(e){if(Y--,i.monitorRunDependencies&&i.monitorRunDependencies(Y),0==Y&&(null!==Z&&(clearInterval(Z),Z=null),J)){var t=J;J=null,t()}}function te(e){i.onAbort&&i.onAbort(e),_(e="Aborted("+e+")"),k=!0,I=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw o(t),t}function re(e){return e.startsWith("data:application/octet-stream;base64,")}function ne(e){return e.startsWith("file://")}function oe(e){try{if(e==X&&b)return new Uint8Array(b);if(u)return u(e);throw"both async and sync fetching of the wasm failed"}catch(e){te(e)}}function ie(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var r=t.func;"number"==typeof r?void 0===t.arg?ae(r)():ae(r)(t.arg):r(void 0===t.arg?null:t.arg)}else t(i)}}function ae(e){return B.get(e)}re(X="ld.wasm")||(K=X,X=i.locateFile?i.locateFile(K,w):w+K);var se,ue={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=ue.isAbs(e),r="/"===e.substr(-1);return(e=ue.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=ue.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=ue.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments,0);return ue.normalize(e.join("/"))},join2:(e,t)=>ue.normalize(e+"/"+t)},ce={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:he.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t=ue.isAbs(n)}return(t?"/":"")+(e=ue.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=ce.resolve(e).substr(1),t=ce.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("/")}},le={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){le.ttys[e]={input:[],output:[],ops:t},he.registerDevice(e,le.stream_ops)},stream_ops:{open:function(e){var t=le.ttys[e.node.rdev];if(!t)throw new he.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 he.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 he.ErrnoError(29)}if(void 0===s&&0===i)throw new he.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 he.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,t[r+i])}catch(e){throw new he.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(v){var r=Buffer.alloc(256),n=0;try{n=c.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=Ee(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(E(M(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(E(M(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(_(M(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(_(M(e.output,0)),e.output=[])}}},fe={ops_table:null,mount:function(e){return fe.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(he.isBlkdev(r)||he.isFIFO(r))throw new he.ErrnoError(63);fe.ops_table||(fe.ops_table={dir:{node:{getattr:fe.node_ops.getattr,setattr:fe.node_ops.setattr,lookup:fe.node_ops.lookup,mknod:fe.node_ops.mknod,rename:fe.node_ops.rename,unlink:fe.node_ops.unlink,rmdir:fe.node_ops.rmdir,readdir:fe.node_ops.readdir,symlink:fe.node_ops.symlink},stream:{llseek:fe.stream_ops.llseek}},file:{node:{getattr:fe.node_ops.getattr,setattr:fe.node_ops.setattr},stream:{llseek:fe.stream_ops.llseek,read:fe.stream_ops.read,write:fe.stream_ops.write,allocate:fe.stream_ops.allocate,mmap:fe.stream_ops.mmap,msync:fe.stream_ops.msync}},link:{node:{getattr:fe.node_ops.getattr,setattr:fe.node_ops.setattr,readlink:fe.node_ops.readlink},stream:{}},chrdev:{node:{getattr:fe.node_ops.getattr,setattr:fe.node_ops.setattr},stream:he.chrdev_stream_ops}});var o=he.createNode(e,t,r,n);return he.isDir(o.mode)?(o.node_ops=fe.ops_table.dir.node,o.stream_ops=fe.ops_table.dir.stream,o.contents={}):he.isFile(o.mode)?(o.node_ops=fe.ops_table.file.node,o.stream_ops=fe.ops_table.file.stream,o.usedBytes=0,o.contents=null):he.isLink(o.mode)?(o.node_ops=fe.ops_table.link.node,o.stream_ops=fe.ops_table.link.stream):he.isChrdev(o.mode)&&(o.node_ops=fe.ops_table.chrdev.node,o.stream_ops=fe.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=he.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,he.isDir(e.mode)?t.size=4096:he.isFile(e.mode)?t.size=e.usedBytes:he.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&&fe.resizeFileStorage(e,t.size)},lookup:function(e,t){throw he.genericErrors[44]},mknod:function(e,t,r,n){return fe.createNode(e,t,r,n)},rename:function(e,t,r){if(he.isDir(e.mode)){var n;try{n=he.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new he.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=he.lookupNode(e,t);for(var n in r.contents)throw new he.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=fe.createNode(e,t,41471,0);return n.link=r,n},readlink:function(e){if(!he.isLink(e.mode))throw new he.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(fe.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&&he.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new he.ErrnoError(28);return n},allocate:function(e,t,r){fe.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap:function(e,t,r,n,o,i){if(0!==t)throw new he.ErrnoError(28);if(!he.isFile(e.node.mode))throw new he.ErrnoError(43);var a,s,u=e.node.contents;if(2&i||u.buffer!==P){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,!(a=void te()))throw new he.ErrnoError(48);O.set(u,a)}else s=!1,a=u.byteOffset;return{ptr:a,allocated:s}},msync:function(e,t,r,n,o){if(!he.isFile(e.node.mode))throw new he.ErrnoError(43);return 2&o||fe.stream_ops.write(e,t,0,n,r,!1),0}}},he={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=ce.resolve(he.cwd(),e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new he.ErrnoError(32);for(var r=ue.normalizeArray(e.split("/").filter((e=>!!e)),!1),n=he.root,o="/",i=0;i<r.length;i++){var a=i===r.length-1;if(a&&t.parent)break;if(n=he.lookupNode(n,r[i]),o=ue.join2(o,r[i]),he.isMountpoint(n)&&(!a||a&&t.follow_mount)&&(n=n.mounted.root),!a||t.follow)for(var s=0;he.isLink(n.mode);){var u=he.readlink(o);if(o=ce.resolve(ue.dirname(o),u),n=he.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new he.ErrnoError(32)}}return{path:o,node:n}},getPath:e=>{for(var t;;){if(he.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)%he.nameTable.length},hashAddNode:e=>{var t=he.hashName(e.parent.id,e.name);e.name_next=he.nameTable[t],he.nameTable[t]=e},hashRemoveNode:e=>{var t=he.hashName(e.parent.id,e.name);if(he.nameTable[t]===e)he.nameTable[t]=e.name_next;else for(var r=he.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:(e,t)=>{var r=he.mayLookup(e);if(r)throw new he.ErrnoError(r,e);for(var n=he.hashName(e.id,t),o=he.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return he.lookup(e,t)},createNode:(e,t,r,n)=>{var o=new he.FSNode(e,t,r,n);return he.hashAddNode(o),o},destroyNode:e=>{he.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),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:e=>{var t=he.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:e=>{var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>he.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=he.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate:(e,t)=>{try{return he.lookupNode(e,t),20}catch(e){}return he.nodePermissions(e,"wx")},mayDelete:(e,t,r)=>{var n;try{n=he.lookupNode(e,t)}catch(e){return e.errno}var o=he.nodePermissions(e,"wx");if(o)return o;if(r){if(!he.isDir(n.mode))return 54;if(he.isRoot(n)||he.getPath(n)===he.cwd())return 10}else if(he.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?he.isLink(e.mode)?32:he.isDir(e.mode)&&("r"!==he.flagsToPermissionString(t)||512&t)?31:he.nodePermissions(e,he.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:(e=0,t=he.MAX_OPEN_FDS)=>{for(var r=e;r<=t;r++)if(!he.streams[r])return r;throw new he.ErrnoError(33)},getStream:e=>he.streams[e],createStream:(e,t,r)=>{he.FSStream||(he.FSStream=function(){this.shared={}},he.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 he.FSStream,e);var n=he.nextfd(t,r);return e.fd=n,he.streams[n]=e,e},closeStream:e=>{he.streams[e]=null},chrdev_stream_ops:{open:e=>{var t=he.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new he.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice:(e,t)=>{he.devices[e]={stream_ops:t}},getDevice:e=>he.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),he.syncFSRequests++,he.syncFSRequests>1&&_("warning: "+he.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=he.getMounts(he.root.mount),n=0;function o(e){return he.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((t=>{if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)}))},mount:(e,t,r)=>{var n,o="/"===r,i=!r;if(o&&he.root)throw new he.ErrnoError(10);if(!o&&!i){var a=he.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,he.isMountpoint(n))throw new he.ErrnoError(10);if(!he.isDir(n.mode))throw new he.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?he.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:e=>{var t=he.lookupPath(e,{follow_mount:!1});if(!he.isMountpoint(t.node))throw new he.ErrnoError(28);var r=t.node,n=r.mounted,o=he.getMounts(n);Object.keys(he.nameTable).forEach((e=>{for(var t=he.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&he.destroyNode(t),t=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(n);r.mount.mounts.splice(i,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod:(e,t,r)=>{var n=he.lookupPath(e,{parent:!0}).node,o=ue.basename(e);if(!o||"."===o||".."===o)throw new he.ErrnoError(28);var i=he.mayCreate(n,o);if(i)throw new he.ErrnoError(i);if(!n.node_ops.mknod)throw new he.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,he.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,he.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{he.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,he.mknod(e,t,r)),symlink:(e,t)=>{if(!ce.resolve(e))throw new he.ErrnoError(44);var r=he.lookupPath(t,{parent:!0}).node;if(!r)throw new he.ErrnoError(44);var n=ue.basename(t),o=he.mayCreate(r,n);if(o)throw new he.ErrnoError(o);if(!r.node_ops.symlink)throw new he.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename:(e,t)=>{var r,n,o=ue.dirname(e),i=ue.dirname(t),a=ue.basename(e),s=ue.basename(t);if(r=he.lookupPath(e,{parent:!0}).node,n=he.lookupPath(t,{parent:!0}).node,!r||!n)throw new he.ErrnoError(44);if(r.mount!==n.mount)throw new he.ErrnoError(75);var u,c=he.lookupNode(r,a),l=ce.relative(e,i);if("."!==l.charAt(0))throw new he.ErrnoError(28);if("."!==(l=ce.relative(t,o)).charAt(0))throw new he.ErrnoError(55);try{u=he.lookupNode(n,s)}catch(e){}if(c!==u){var f=he.isDir(c.mode),h=he.mayDelete(r,a,f);if(h)throw new he.ErrnoError(h);if(h=u?he.mayDelete(n,s,f):he.mayCreate(n,s))throw new he.ErrnoError(h);if(!r.node_ops.rename)throw new he.ErrnoError(63);if(he.isMountpoint(c)||u&&he.isMountpoint(u))throw new he.ErrnoError(10);if(n!==r&&(h=he.nodePermissions(r,"w")))throw new he.ErrnoError(h);he.hashRemoveNode(c);try{r.node_ops.rename(c,n,s)}catch(e){throw e}finally{he.hashAddNode(c)}}},rmdir:e=>{var t=he.lookupPath(e,{parent:!0}).node,r=ue.basename(e),n=he.lookupNode(t,r),o=he.mayDelete(t,r,!0);if(o)throw new he.ErrnoError(o);if(!t.node_ops.rmdir)throw new he.ErrnoError(63);if(he.isMountpoint(n))throw new he.ErrnoError(10);t.node_ops.rmdir(t,r),he.destroyNode(n)},readdir:e=>{var t=he.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new he.ErrnoError(54);return t.node_ops.readdir(t)},unlink:e=>{var t=he.lookupPath(e,{parent:!0}).node;if(!t)throw new he.ErrnoError(44);var r=ue.basename(e),n=he.lookupNode(t,r),o=he.mayDelete(t,r,!1);if(o)throw new he.ErrnoError(o);if(!t.node_ops.unlink)throw new he.ErrnoError(63);if(he.isMountpoint(n))throw new he.ErrnoError(10);t.node_ops.unlink(t,r),he.destroyNode(n)},readlink:e=>{var t=he.lookupPath(e).node;if(!t)throw new he.ErrnoError(44);if(!t.node_ops.readlink)throw new he.ErrnoError(28);return ce.resolve(he.getPath(t.parent),t.node_ops.readlink(t))},stat:(e,t)=>{var r=he.lookupPath(e,{follow:!t}).node;if(!r)throw new he.ErrnoError(44);if(!r.node_ops.getattr)throw new he.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>he.stat(e,!0),chmod:(e,t,r)=>{var n;if(!(n="string"==typeof e?he.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new he.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:(e,t)=>{he.chmod(e,t,!0)},fchmod:(e,t)=>{var r=he.getStream(e);if(!r)throw new he.ErrnoError(8);he.chmod(r.node,t)},chown:(e,t,r,n)=>{var o;if(!(o="string"==typeof e?he.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new he.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(e,t,r)=>{he.chown(e,t,r,!0)},fchown:(e,t,r)=>{var n=he.getStream(e);if(!n)throw new he.ErrnoError(8);he.chown(n.node,t,r)},truncate:(e,t)=>{if(t<0)throw new he.ErrnoError(28);var r;if(!(r="string"==typeof e?he.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new he.ErrnoError(63);if(he.isDir(r.mode))throw new he.ErrnoError(31);if(!he.isFile(r.mode))throw new he.ErrnoError(28);var n=he.nodePermissions(r,"w");if(n)throw new he.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:(e,t)=>{var r=he.getStream(e);if(!r)throw new he.ErrnoError(8);if(0==(2097155&r.flags))throw new he.ErrnoError(28);he.truncate(r.node,t)},utime:(e,t,r)=>{var n=he.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:(e,t,r,n,o)=>{if(""===e)throw new he.ErrnoError(44);var a;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?he.modeStringToFlags(t):t)?4095&r|32768:0,"object"==typeof e)a=e;else{e=ue.normalize(e);try{a=he.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var s=!1;if(64&t)if(a){if(128&t)throw new he.ErrnoError(20)}else a=he.mknod(e,r,0),s=!0;if(!a)throw new he.ErrnoError(44);if(he.isChrdev(a.mode)&&(t&=-513),65536&t&&!he.isDir(a.mode))throw new he.ErrnoError(54);if(!s){var u=he.mayOpen(a,t);if(u)throw new he.ErrnoError(u)}512&t&&he.truncate(a,0),t&=-131713;var c=he.createStream({node:a,path:he.getPath(a),flags:t,seekable:!0,position:0,stream_ops:a.stream_ops,ungotten:[],error:!1},n,o);return c.stream_ops.open&&c.stream_ops.open(c),!i.logReadFiles||1&t||(he.readFiles||(he.readFiles={}),e in he.readFiles||(he.readFiles[e]=1)),c},close:e=>{if(he.isClosed(e))throw new he.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{he.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,t,r)=>{if(he.isClosed(e))throw new he.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new he.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new he.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 he.ErrnoError(28);if(he.isClosed(e))throw new he.ErrnoError(8);if(1==(2097155&e.flags))throw new he.ErrnoError(8);if(he.isDir(e.node.mode))throw new he.ErrnoError(31);if(!e.stream_ops.read)throw new he.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new he.ErrnoError(70)}else o=e.position;var a=e.stream_ops.read(e,t,r,n,o);return i||(e.position+=a),a},write:(e,t,r,n,o,i)=>{if(n<0||o<0)throw new he.ErrnoError(28);if(he.isClosed(e))throw new he.ErrnoError(8);if(0==(2097155&e.flags))throw new he.ErrnoError(8);if(he.isDir(e.node.mode))throw new he.ErrnoError(31);if(!e.stream_ops.write)throw new he.ErrnoError(28);e.seekable&&1024&e.flags&&he.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new he.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:(e,t,r)=>{if(he.isClosed(e))throw new he.ErrnoError(8);if(t<0||r<=0)throw new he.ErrnoError(28);if(0==(2097155&e.flags))throw new he.ErrnoError(8);if(!he.isFile(e.node.mode)&&!he.isDir(e.node.mode))throw new he.ErrnoError(43);if(!e.stream_ops.allocate)throw new he.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap:(e,t,r,n,o,i)=>{if(0!=(2&o)&&0==(2&i)&&2!=(2097155&e.flags))throw new he.ErrnoError(2);if(1==(2097155&e.flags))throw new he.ErrnoError(2);if(!e.stream_ops.mmap)throw new he.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,o,i)},msync:(e,t,r,n,o)=>e&&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 he.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=he.open(e,t.flags),o=he.stat(e).size,i=new Uint8Array(o);return he.read(n,i,0,o,0),"utf8"===t.encoding?r=M(i,0):"binary"===t.encoding&&(r=i),he.close(n),r},writeFile:(e,t,r={})=>{r.flags=r.flags||577;var n=he.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(H(t)+1),i=N(t,o,0,o.length);he.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");he.write(n,t,0,t.byteLength,void 0,r.canOwn)}he.close(n)},cwd:()=>he.currentPath,chdir:e=>{var t=he.lookupPath(e,{follow:!0});if(null===t.node)throw new he.ErrnoError(44);if(!he.isDir(t.node.mode))throw new he.ErrnoError(54);var r=he.nodePermissions(t.node,"x");if(r)throw new he.ErrnoError(r);he.currentPath=t.path},createDefaultDirectories:()=>{he.mkdir("/tmp"),he.mkdir("/home"),he.mkdir("/home/web_user")},createDefaultDevices:()=>{he.mkdir("/dev"),he.registerDevice(he.makedev(1,3),{read:()=>0,write:(e,t,r,n,o)=>n}),he.mkdev("/dev/null",he.makedev(1,3)),le.register(he.makedev(5,0),le.default_tty_ops),le.register(he.makedev(6,0),le.default_tty1_ops),he.mkdev("/dev/tty",he.makedev(5,0)),he.mkdev("/dev/tty1",he.makedev(6,0));var e=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}if(v)try{var t=r(6113);return function(){return t.randomBytes(1)[0]}}catch(e){}return function(){te("randomDevice")}}();he.createDevice("/dev","random",e),he.createDevice("/dev","urandom",e),he.mkdir("/dev/shm"),he.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{he.mkdir("/proc");var e=he.mkdir("/proc/self");he.mkdir("/proc/self/fd"),he.mount({mount:()=>{var t=he.createNode(e,"fd",16895,73);return t.node_ops={lookup:(e,t)=>{var r=+t,n=he.getStream(r);if(!n)throw new he.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams:()=>{i.stdin?he.createDevice("/dev","stdin",i.stdin):he.symlink("/dev/tty","/dev/stdin"),i.stdout?he.createDevice("/dev","stdout",null,i.stdout):he.symlink("/dev/tty","/dev/stdout"),i.stderr?he.createDevice("/dev","stderr",null,i.stderr):he.symlink("/dev/tty1","/dev/stderr"),he.open("/dev/stdin",0),he.open("/dev/stdout",1),he.open("/dev/stderr",1)},ensureErrnoError:()=>{he.ErrnoError||(he.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},he.ErrnoError.prototype=new Error,he.ErrnoError.prototype.constructor=he.ErrnoError,[44].forEach((e=>{he.genericErrors[e]=new he.ErrnoError(e),he.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:()=>{he.ensureErrnoError(),he.nameTable=new Array(4096),he.mount(fe,{},"/"),he.createDefaultDirectories(),he.createDefaultDevices(),he.createSpecialDirectories(),he.filesystems={MEMFS:fe}},init:(e,t,r)=>{he.init.initialized=!0,he.ensureErrnoError(),i.stdin=e||i.stdin,i.stdout=t||i.stdout,i.stderr=r||i.stderr,he.createStandardStreams()},quit:()=>{he.init.initialized=!1;for(var e=0;e<he.streams.length;e++){var t=he.streams[e];t&&he.close(t)}},getMode:(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},findObject:(e,t)=>{var r=he.analyzePath(e,t);return r.exists?r.object:null},analyzePath:(e,t)=>{try{e=(n=he.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=he.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=ue.basename(e),n=he.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:he.getPath(e);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var a=ue.join2(e,i);try{he.mkdir(a)}catch(e){}e=a}}return a},createFile:(e,t,r,n,o)=>{var i=ue.join2("string"==typeof e?e:he.getPath(e),t),a=he.getMode(n,o);return he.create(i,a)},createDataFile:(e,t,r,n,o,i)=>{var a=t;e&&(e="string"==typeof e?e:he.getPath(e),a=t?ue.join2(e,t):e);var s=he.getMode(n,o),u=he.create(a,s);if(r){if("string"==typeof r){for(var c=new Array(r.length),l=0,f=r.length;l<f;++l)c[l]=r.charCodeAt(l);r=c}he.chmod(u,146|s);var h=he.open(u,577);he.write(h,r,0,r.length,0,i),he.close(h),he.chmod(u,s)}return u},createDevice:(e,t,r,n)=>{var o=ue.join2("string"==typeof e?e:he.getPath(e),t),i=he.getMode(!!r,!!n);he.createDevice.major||(he.createDevice.major=64);var a=he.makedev(he.createDevice.major++,0);return he.registerDevice(a,{open:e=>{e.seekable=!1},close:e=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(e,t,n,o,i)=>{for(var a=0,s=0;s<o;s++){var u;try{u=r()}catch(e){throw new he.ErrnoError(29)}if(void 0===u&&0===a)throw new he.ErrnoError(6);if(null==u)break;a++,t[n+s]=u}return a&&(e.node.timestamp=Date.now()),a},write:(e,t,r,o,i)=>{for(var a=0;a<o;a++)try{n(t[r+a])}catch(e){throw new he.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),a}}),he.mkdev(o,i,a)},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(!a)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=Ee(a(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new he.ErrnoError(29)}},createLazyFile:(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((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]=((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||[]):Ee(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(!y)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=he.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={};return Object.keys(u.stream_ops).forEach((e=>{var t=u.stream_ops[e];c[e]=function(){return he.forceLoadFile(u),t.apply(null,arguments)}})),c.read=(e,t,r,n,o)=>{he.forceLoadFile(u);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},u.stream_ops=c,u},createPreloadedFile:(e,t,r,n,o,i,a,u,c,l)=>{var f=t?ce.resolve(ue.join2(e,t)):e;function h(r){function s(r){l&&l(),u||he.createDataFile(e,t,r,n,o,c),i&&i(),ee()}Browser.handledByPreloadPlugin(r,f,s,(()=>{a&&a(),ee()}))||s(r)}Q(),"string"==typeof r?function(e,t,r,n){var o=n?"":"al "+e;s(e,(function(r){C(r,'Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(r)),o&&ee()}),(function(t){if(!r)throw'Loading data file "'+e+'" failed.';r()})),o&&Q()}(r,(e=>h(e)),a):h(r)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var n=he.indexedDB();try{var o=n.open(he.DB_NAME(),he.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=()=>{E("creating db"),o.result.createObjectStore(he.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([he.DB_STORE_NAME],"readwrite"),i=n.objectStore(he.DB_STORE_NAME),a=0,s=0,u=e.length;function c(){0==s?t():r()}e.forEach((e=>{var t=i.put(he.analyzePath(e).object.contents,e);t.onsuccess=()=>{++a+s==u&&c()},t.onerror=()=>{s++,a+s==u&&c()}})),n.onerror=r},o.onerror=r},loadFilesFromDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var n=he.indexedDB();try{var o=n.open(he.DB_NAME(),he.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=r,o.onsuccess=()=>{var n=o.result;try{var i=n.transaction([he.DB_STORE_NAME],"readonly")}catch(e){return void r(e)}var a=i.objectStore(he.DB_STORE_NAME),s=0,u=0,c=e.length;function l(){0==u?t():r()}e.forEach((e=>{var t=a.get(e);t.onsuccess=()=>{he.analyzePath(e).exists&&he.unlink(e),he.createDataFile(ue.dirname(e),ue.basename(e),t.result,!0,!0,!0),++s+u==c&&l()},t.onerror=()=>{u++,s+u==c&&l()}})),i.onerror=r},o.onerror=r}},de={DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){if(ue.isAbs(t))return t;var n;if(-100===e)n=he.cwd();else{var o=he.getStream(e);if(!o)throw new he.ErrnoError(8);n=o.path}if(0==t.length){if(!r)throw new he.ErrnoError(44);return n}return ue.join2(n,t)},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&ue.normalize(t)!==ue.normalize(he.getPath(e.node)))return-54;throw e}return R[r>>2]=n.dev,R[r+4>>2]=0,R[r+8>>2]=n.ino,R[r+12>>2]=n.mode,R[r+16>>2]=n.nlink,R[r+20>>2]=n.uid,R[r+24>>2]=n.gid,R[r+28>>2]=n.rdev,R[r+32>>2]=0,q=[n.size>>>0,(W=n.size,+Math.abs(W)>=1?W>0?(0|Math.min(+Math.floor(W/4294967296),4294967295))>>>0:~~+Math.ceil((W-+(~~W>>>0))/4294967296)>>>0:0)],R[r+40>>2]=q[0],R[r+44>>2]=q[1],R[r+48>>2]=4096,R[r+52>>2]=n.blocks,R[r+56>>2]=n.atime.getTime()/1e3|0,R[r+60>>2]=0,R[r+64>>2]=n.mtime.getTime()/1e3|0,R[r+68>>2]=0,R[r+72>>2]=n.ctime.getTime()/1e3|0,R[r+76>>2]=0,q=[n.ino>>>0,(W=n.ino,+Math.abs(W)>=1?W>0?(0|Math.min(+Math.floor(W/4294967296),4294967295))>>>0:~~+Math.ceil((W-+(~~W>>>0))/4294967296)>>>0:0)],R[r+80>>2]=q[0],R[r+84>>2]=q[1],0},doMsync:function(e,t,r,n,o){var i=T.slice(e,e+r);he.msync(t,i,o,r,n)},doMknod:function(e,t,r){switch(61440&t){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return he.mknod(e,t,r),0},doReadlink:function(e,t,r){if(r<=0)return-28;var n=he.readlink(e),o=Math.min(r,H(n)),i=O[t+o];return L(n,t,r+1),O[t+o]=i,o},doAccess:function(e,t){if(-8&t)return-28;var r=he.lookupPath(e,{follow:!0}).node;if(!r)return-44;var n="";return 4&t&&(n+="r"),2&t&&(n+="w"),1&t&&(n+="x"),n&&he.nodePermissions(r,n)?-2:0},doReadv:function(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=R[t>>2],s=R[t+4>>2];t+=8;var u=he.read(e,O,a,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o},doWritev:function(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=R[t>>2],s=R[t+4>>2];t+=8;var u=he.write(e,O,a,s,n);if(u<0)return-1;o+=u}return o},varargs:void 0,get:function(){return de.varargs+=4,R[de.varargs-4>>2]},getStr:function(e){return F(e)},getStreamFromFD:function(e){var t=he.getStream(e);if(!t)throw new he.ErrnoError(8);return t}},pe={BUCKET_BUFFER_SIZE:8192,mount:function(e){return he.createNode(null,"/",16895,0)},createPipe:function(){var e={buckets:[],refcnt:2};e.buckets.push({buffer:new Uint8Array(pe.BUCKET_BUFFER_SIZE),offset:0,roffset:0});var t=pe.nextname(),r=pe.nextname(),n=he.createNode(pe.root,t,4096,0),o=he.createNode(pe.root,r,4096,0);n.pipe=e,o.pipe=e;var i=he.createStream({path:t,node:n,flags:0,seekable:!1,stream_ops:pe.stream_ops});n.stream=i;var a=he.createStream({path:r,node:o,flags:1,seekable:!1,stream_ops:pe.stream_ops});return o.stream=a,{readable_fd:i.fd,writable_fd:a.fd}},stream_ops:{poll:function(e){var t=e.node.pipe;if(1==(2097155&e.flags))return 260;if(t.buckets.length>0)for(var r=0;r<t.buckets.length;r++){var n=t.buckets[r];if(n.offset-n.roffset>0)return 65}return 0},ioctl:function(e,t,r){return 28},fsync:function(e){return 28},read:function(e,t,r,n,o){for(var i=e.node.pipe,a=0,s=0;s<i.buckets.length;s++){var u=i.buckets[s];a+=u.offset-u.roffset}C(t instanceof ArrayBuffer||ArrayBuffer.isView(t));var c=t.subarray(r,r+n);if(n<=0)return 0;if(0==a)throw new he.ErrnoError(6);var l=Math.min(a,n),f=l,h=0;for(s=0;s<i.buckets.length;s++){var d=i.buckets[s],p=d.offset-d.roffset;if(l<=p){var m=d.buffer.subarray(d.roffset,d.offset);l<p?(m=m.subarray(0,l),d.roffset+=l):h++,c.set(m);break}m=d.buffer.subarray(d.roffset,d.offset),c.set(m),c=c.subarray(m.byteLength),l-=m.byteLength,h++}return h&&h==i.buckets.length&&(h--,i.buckets[h].offset=0,i.buckets[h].roffset=0),i.buckets.splice(0,h),f},write:function(e,t,r,n,o){var i=e.node.pipe;C(t instanceof ArrayBuffer||ArrayBuffer.isView(t));var a=t.subarray(r,r+n),s=a.byteLength;if(s<=0)return 0;var u=null;0==i.buckets.length?(u={buffer:new Uint8Array(pe.BUCKET_BUFFER_SIZE),offset:0,roffset:0},i.buckets.push(u)):u=i.buckets[i.buckets.length-1],C(u.offset<=pe.BUCKET_BUFFER_SIZE);var c=pe.BUCKET_BUFFER_SIZE-u.offset;if(c>=s)return u.buffer.set(a,u.offset),u.offset+=s,s;c>0&&(u.buffer.set(a.subarray(0,c),u.offset),u.offset+=c,a=a.subarray(c,a.byteLength));for(var l=a.byteLength/pe.BUCKET_BUFFER_SIZE|0,f=a.byteLength%pe.BUCKET_BUFFER_SIZE,h=0;h<l;h++){var d={buffer:new Uint8Array(pe.BUCKET_BUFFER_SIZE),offset:pe.BUCKET_BUFFER_SIZE,roffset:0};i.buckets.push(d),d.buffer.set(a.subarray(0,pe.BUCKET_BUFFER_SIZE)),a=a.subarray(pe.BUCKET_BUFFER_SIZE,a.byteLength)}return f>0&&(d={buffer:new Uint8Array(pe.BUCKET_BUFFER_SIZE),offset:a.byteLength,roffset:0},i.buckets.push(d),d.buffer.set(a)),s},close:function(e){var t=e.node.pipe;t.refcnt--,0===t.refcnt&&(t.buckets=null)}},nextname:function(){return pe.nextname.current||(pe.nextname.current=0),"pipe["+pe.nextname.current+++"]"}},me="To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking";se=v?()=>{var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:()=>performance.now();var ge={};function ye(){if(!ye.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",_:p||"./this.program"};for(var t in ge)void 0===ge[t]?delete e[t]:e[t]=ge[t];var r=[];for(var t in e)r.push(t+"="+e[t]);ye.strings=r}return ye.strings}var ve=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=he.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},we=365,be=146;function Ee(e,t,r){var n=r>0?r:H(e)+1,o=new Array(n),i=N(e,o,0,o.length);return t&&(o.length=i),o}Object.defineProperties(ve.prototype,{read:{get:function(){return(this.mode&we)===we},set:function(e){e?this.mode|=we:this.mode&=-366}},write:{get:function(){return(this.mode&be)===be},set:function(e){e?this.mode|=be:this.mode&=-147}},isFolder:{get:function(){return he.isDir(this.mode)}},isDevice:{get:function(){return he.isChrdev(this.mode)}}}),he.FSNode=ve,he.staticInit();var _e,Se={a:function(e,t,r,n){te("Assertion failed: "+F(e)+", at: "+[t?F(t):"unknown filename",r,n?F(n):"unknown function"])},G:function(e,t){try{return e=de.getStr(e),he.chmod(e,t),0}catch(e){if(void 0===he||!(e instanceof he.ErrnoError))throw e;return-e.errno}},F:function(e){try{var t=de.getStreamFromFD(e);return he.createStream(t,0).fd}catch(e){if(void 0===he||!(e instanceof he.ErrnoError))throw e;return-e.errno}},H:function(e,t,r,n){try{return t=de.getStr(t),t=de.calculateAt(e,t),de.doAccess(t,r)}catch(e){if(void 0===he||!(e instanceof he.ErrnoError))throw e;return-e.errno}},e:function(e,t,r){de.varargs=r;try{var n=de.getStreamFromFD(e);switch(t){case 0:return(o=de.get())<0?-28:he.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=de.get();return n.flags|=o,0;case 5:return o=de.get(),x[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return i=28,R[Ae()>>2]=i,-1}}catch(e){if(void 0===he||!(e instanceof he.ErrnoError))throw e;return-e.errno}var i},z:function(e,t){try{var r=de.getStreamFromFD(e);return de.doStat(he.stat,r.path,t)}catch(e){if(void 0===he||!(e instanceof he.ErrnoError))throw e;return-e.errno}},v:function(e,t){try{if(0===t)return-28;var r=he.cwd(),n=H(r)+1;return t<n?-68:(L(r,e,t),n)}catch(e){if(void 0===he||!(e instanceof he.ErrnoError))throw e;return-e.errno}},m:function(e,t,r){de.varargs=r;try{var n=de.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=de.get();return R[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:return o=de.get(),he.ioctl(n,t,o);default:te("bad ioctl syscall "+t)}}catch(e){if(void 0===he||!(e instanceof he.ErrnoError))throw e;return-e.errno}},x:function(e,t){try{return e=de.getStr(e),de.doStat(he.lstat,e,t)}catch(e){if(void 0===he||!(e instanceof he.ErrnoError))throw e;return-e.errno}},w:function(e,t,r,n){try{t=de.getStr(t);var o=256&n,i=4096&n;return n&=-4353,t=de.calculateAt(e,t,i),de.doStat(o?he.lstat:he.stat,t,r)}catch(e){if(void 0===he||!(e instanceof he.ErrnoError))throw e;return-e.errno}},h:function(e,t,r,n){de.varargs=n;try{t=de.getStr(t),t=de.calculateAt(e,t);var o=n?de.get():0;return he.open(t,r,o).fd}catch(e){if(void 0===he||!(e instanceof he.ErrnoError))throw e;return-e.errno}},t:function(e){try{if(0==e)throw new he.ErrnoError(21);var t=pe.createPipe();return R[e>>2]=t.readable_fd,R[e+4>>2]=t.writable_fd,0}catch(e){if(void 0===he||!(e instanceof he.ErrnoError))throw e;return-e.errno}},s:function(e,t,r,n){try{return t=de.getStr(t),t=de.calculateAt(e,t),de.doReadlink(t,r,n)}catch(e){if(void 0===he||!(e instanceof he.ErrnoError))throw e;return-e.errno}},q:function(e){try{return e=de.getStr(e),he.rmdir(e),0}catch(e){if(void 0===he||!(e instanceof he.ErrnoError))throw e;return-e.errno}},y:function(e,t){try{return e=de.getStr(e),de.doStat(he.stat,e,t)}catch(e){if(void 0===he||!(e instanceof he.ErrnoError))throw e;return-e.errno}},g:function(e,t,r){try{return t=de.getStr(t),t=de.calculateAt(e,t),0===r?he.unlink(t):512===r?he.rmdir(t):te("Invalid flags passed to unlinkat"),0}catch(e){if(void 0===he||!(e instanceof he.ErrnoError))throw e;return-e.errno}},C:function(e){},E:function(e,t){te(me)},D:function(e,t){te(me)},l:function(){return Date.now()},B:function(){return!0},b:function(){te("")},k:se,A:function(e,t,r){T.copyWithin(e,t,t+r)},f:function(e){T.length,te("OOM")},n:function(e,t){var r=0;return ye().forEach((function(n,o){var i=t+r;R[e+4*o>>2]=i,function(e,t,r){for(var n=0;n<e.length;++n)O[t++>>0]=e.charCodeAt(n);r||(O[t>>0]=0)}(n,i),r+=n.length+1})),0},r:function(e,t){var r=ye();R[e>>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),R[t>>2]=n,0},d:function(e){Oe(e)},c:function(e){try{var t=de.getStreamFromFD(e);return he.close(t),0}catch(e){if(void 0===he||!(e instanceof he.ErrnoError))throw e;return e.errno}},u:function(e,t){try{var r=de.getStreamFromFD(e),n=r.tty?2:he.isDir(r.mode)?3:he.isLink(r.mode)?7:4;return O[t>>0]=n,0}catch(e){if(void 0===he||!(e instanceof he.ErrnoError))throw e;return e.errno}},o:function(e,t,r,n,o,i){try{var a=de.getStreamFromFD(e),s=de.doReadv(a,t,r,n);return R[i>>2]=s,0}catch(e){if(void 0===he||!(e instanceof he.ErrnoError))throw e;return e.errno}},j:function(e,t,r,n){try{var o=de.getStreamFromFD(e),i=de.doReadv(o,t,r);return R[n>>2]=i,0}catch(e){if(void 0===he||!(e instanceof he.ErrnoError))throw e;return e.errno}},p:function(e,t,r,n,o){try{var i=de.getStreamFromFD(e),a=4294967296*r+(t>>>0),s=9007199254740992;return a<=-s||a>=s?-61:(he.llseek(i,a,n),q=[i.position>>>0,(W=i.position,+Math.abs(W)>=1?W>0?(0|Math.min(+Math.floor(W/4294967296),4294967295))>>>0:~~+Math.ceil((W-+(~~W>>>0))/4294967296)>>>0:0)],R[o>>2]=q[0],R[o+4>>2]=q[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0)}catch(e){if(void 0===he||!(e instanceof he.ErrnoError))throw e;return e.errno}},i:function(e,t,r,n){try{var o=de.getStreamFromFD(e),i=de.doWritev(o,t,r);return R[n>>2]=i,0}catch(e){if(void 0===he||!(e instanceof he.ErrnoError))throw e;return e.errno}},I:function(e){Te(e)}},Ae=(function(){var e={a:Se};function t(e,t){var r,n,o=e.exports;i.asm=o,S=i.asm.J,r=S.buffer,P=r,i.HEAP8=O=new Int8Array(r),i.HEAP16=x=new Int16Array(r),i.HEAP32=R=new Int32Array(r),i.HEAPU8=T=new Uint8Array(r),i.HEAPU16=new Uint16Array(r),i.HEAPU32=new Uint32Array(r),i.HEAPF32=new Float32Array(r),i.HEAPF64=new Float64Array(r),B=i.asm.N,n=i.asm.K,j.unshift(n),ee()}function r(e){t(e.instance)}function n(t){return function(){if(!b&&(g||y)){if("function"==typeof fetch&&!ne(X))return fetch(X,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+X+"'";return e.arrayBuffer()})).catch((function(){return oe(X)}));if(s)return new Promise((function(e,t){s(X,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return oe(X)}))}().then((function(t){return WebAssembly.instantiate(t,e)})).then((function(e){return e})).then(t,(function(e){_("failed to asynchronously prepare wasm: "+e),te(e)}))}if(Q(),i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(e){return _("Module.instantiateWasm callback failed with error: "+e),!1}(b||"function"!=typeof WebAssembly.instantiateStreaming||re(X)||ne(X)||"function"!=typeof fetch?n(r):fetch(X,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(r,(function(e){return _("wasm streaming compile failed: "+e),_("falling back to ArrayBuffer instantiation"),n(r)}))}))).catch(o)}(),i.___wasm_call_ctors=function(){return(i.___wasm_call_ctors=i.asm.K).apply(null,arguments)},i.___errno_location=function(){return(Ae=i.___errno_location=i.asm.L).apply(null,arguments)}),Ie=(i._main=function(){return(i._main=i.asm.M).apply(null,arguments)},i.stackAlloc=function(){return(Ie=i.stackAlloc=i.asm.O).apply(null,arguments)});function ke(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Ce(e){var t=i._main,r=(e=e||[]).length+1,n=Ie(4*(r+1));R[n>>2]=U(p);for(var o=1;o<r;o++)R[(n>>2)+o]=U(e[o-1]);R[(n>>2)+r]=0;try{var a=t(r,n);return Oe(a),a}catch(e){return function(e){if(e instanceof ke||"unwind"==e)return I;m(1,e)}(e)}}function Pe(e){function r(){_e||(_e=!0,i.calledRun=!0,k||(i.noFSInit||he.init.initialized||he.init(),he.ignorePermissions=!1,le.init(),pe.root=he.mount(pe,{},null),ie(j),ie(V),t(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),xe&&Ce(e),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)e=i.postRun.shift(),G.unshift(e);var e;ie(G)}()))}e=e||d,Y>0||(function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)e=i.preRun.shift(),z.unshift(e);var e;ie(z)}(),Y>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),r()}),1)):r()))}function Oe(e,t){I=e,Te(e)}function Te(e){I=e,$()||(i.onExit&&i.onExit(e),k=!0),m(e,new ke(e))}if(i.FS=he,J=function e(){_e||Pe(),_e||(J=e)},i.run=Pe,i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();var xe=!0;return i.noInitialRun&&(xe=!1),Pe(),e.ready});e.exports=o},2890:(e,t,r)=>{var n,o=(n=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||__filename,function(e){var t,o,i=void 0!==(e=e||{})?e:{};i.ready=new Promise((function(e,r){t=e,o=r}));var a,s,u,c,l,f,h=Object.assign({},i),d=[],p="./this.program",m=(e,t)=>{throw t},g="object"==typeof window,y="function"==typeof importScripts,v="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,w="";v?(w=y?r(1017).dirname(w)+"/":__dirname+"/",f=()=>{l||(c=r(7147),l=r(1017))},a=function(e,t){return f(),e=l.normalize(e),c.readFileSync(e,t?void 0:"utf8")},u=e=>{var t=a(e,!0);return t.buffer||(t=new Uint8Array(t)),t},s=(e,t,r)=>{f(),e=l.normalize(e),c.readFile(e,(function(e,n){e?r(e):t(n.buffer)}))},process.argv.length>1&&(p=process.argv[1].replace(/\\/g,"/")),d=process.argv.slice(2),process.on("uncaughtException",(function(e){if(!(e instanceof Se))throw e})),process.on("unhandledRejection",(function(e){throw e})),m=(e,t)=>{if(G())throw process.exitCode=e,t;var r;(r=t)instanceof Se||_("exiting due to exception: "+r),process.exit(e)},i.inspect=function(){return"[Emscripten Module object]"}):(g||y)&&(y?w=self.location.href:"undefined"!=typeof document&&document.currentScript&&(w=document.currentScript.src),n&&(w=n),w=0!==w.indexOf("blob:")?w.substr(0,w.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},y&&(u=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),s=(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 b,E=i.print||console.log.bind(console),_=i.printErr||console.warn.bind(console);Object.assign(i,h),h=null,i.arguments&&(d=i.arguments),i.thisProgram&&(p=i.thisProgram),i.quit&&(m=i.quit),i.wasmBinary&&(b=i.wasmBinary);var S,A=i.noExitRuntime||!0;"object"!=typeof WebAssembly&&ee("no native wasm support detected");var I,k,C,P,O,T,x=!1,R="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function D(e,t,r){for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&R)return R.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 M(e,t){return e?D(P,e,t):""}function F(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 N(e,t,r){return F(e,P,t,r)}function L(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&e.charCodeAt(++r)),n<=127?++t:t+=n<=2047?2:n<=65535?3:4}return t}function H(e){var t=L(e)+1,r=_e(t);return F(e,C,r,t),r}i.INITIAL_MEMORY;var U,B=[],z=[],j=[],V=[];function G(){return A}var $,X,K,W,q=0,Y=null,Z=null;function J(e){q++,i.monitorRunDependencies&&i.monitorRunDependencies(q)}function Q(e){if(q--,i.monitorRunDependencies&&i.monitorRunDependencies(q),0==q&&(null!==Y&&(clearInterval(Y),Y=null),Z)){var t=Z;Z=null,t()}}function ee(e){i.onAbort&&i.onAbort(e),_(e="Aborted("+e+")"),x=!0,I=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw o(t),t}function te(e){return e.startsWith("data:application/octet-stream;base64,")}function re(e){return e.startsWith("file://")}function ne(e){try{if(e==$&&b)return new Uint8Array(b);if(u)return u(e);throw"both async and sync fetching of the wasm failed"}catch(e){ee(e)}}function oe(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var r=t.func;"number"==typeof r?void 0===t.arg?ie(r)():ie(r)(t.arg):r(void 0===t.arg?null:t.arg)}else t(i)}}function ie(e){return U.get(e)}te($="objcopy.wasm")||(X=$,$=i.locateFile?i.locateFile(X,w):w+X);var ae={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=ae.isAbs(e),r="/"===e.substr(-1);return(e=ae.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=ae.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=ae.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments,0);return ae.normalize(e.join("/"))},join2:(e,t)=>ae.normalize(e+"/"+t)},se={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:fe.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t=ae.isAbs(n)}return(t?"/":"")+(e=ae.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=se.resolve(e).substr(1),t=se.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("/")}},ue={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){ue.ttys[e]={input:[],output:[],ops:t},fe.registerDevice(e,ue.stream_ops)},stream_ops:{open:function(e){var t=ue.ttys[e.node.rdev];if(!t)throw new fe.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 fe.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 fe.ErrnoError(29)}if(void 0===s&&0===i)throw new fe.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 fe.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,t[r+i])}catch(e){throw new fe.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(v){var r=Buffer.alloc(256),n=0;try{n=c.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=ve(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(E(D(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(E(D(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(_(D(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(_(D(e.output,0)),e.output=[])}}},ce={ops_table:null,mount:function(e){return ce.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(fe.isBlkdev(r)||fe.isFIFO(r))throw new fe.ErrnoError(63);ce.ops_table||(ce.ops_table={dir:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr,lookup:ce.node_ops.lookup,mknod:ce.node_ops.mknod,rename:ce.node_ops.rename,unlink:ce.node_ops.unlink,rmdir:ce.node_ops.rmdir,readdir:ce.node_ops.readdir,symlink:ce.node_ops.symlink},stream:{llseek:ce.stream_ops.llseek}},file:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr},stream:{llseek:ce.stream_ops.llseek,read:ce.stream_ops.read,write:ce.stream_ops.write,allocate:ce.stream_ops.allocate,mmap:ce.stream_ops.mmap,msync:ce.stream_ops.msync}},link:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr,readlink:ce.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr},stream:fe.chrdev_stream_ops}});var o=fe.createNode(e,t,r,n);return fe.isDir(o.mode)?(o.node_ops=ce.ops_table.dir.node,o.stream_ops=ce.ops_table.dir.stream,o.contents={}):fe.isFile(o.mode)?(o.node_ops=ce.ops_table.file.node,o.stream_ops=ce.ops_table.file.stream,o.usedBytes=0,o.contents=null):fe.isLink(o.mode)?(o.node_ops=ce.ops_table.link.node,o.stream_ops=ce.ops_table.link.stream):fe.isChrdev(o.mode)&&(o.node_ops=ce.ops_table.chrdev.node,o.stream_ops=ce.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=fe.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,fe.isDir(e.mode)?t.size=4096:fe.isFile(e.mode)?t.size=e.usedBytes:fe.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&&ce.resizeFileStorage(e,t.size)},lookup:function(e,t){throw fe.genericErrors[44]},mknod:function(e,t,r,n){return ce.createNode(e,t,r,n)},rename:function(e,t,r){if(fe.isDir(e.mode)){var n;try{n=fe.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new fe.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=fe.lookupNode(e,t);for(var n in r.contents)throw new fe.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=ce.createNode(e,t,41471,0);return n.link=r,n},readlink:function(e){if(!fe.isLink(e.mode))throw new fe.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(ce.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&&fe.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new fe.ErrnoError(28);return n},allocate:function(e,t,r){ce.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap:function(e,t,r,n,o,i){if(0!==t)throw new fe.ErrnoError(28);if(!fe.isFile(e.node.mode))throw new fe.ErrnoError(43);var a,s,u=e.node.contents;if(2&i||u.buffer!==k){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,!(a=void ee()))throw new fe.ErrnoError(48);C.set(u,a)}else s=!1,a=u.byteOffset;return{ptr:a,allocated:s}},msync:function(e,t,r,n,o){if(!fe.isFile(e.node.mode))throw new fe.ErrnoError(43);return 2&o||ce.stream_ops.write(e,t,0,n,r,!1),0}}};function le(e,t,r,n){var o=n?"":"al "+e;s(e,(function(r){var n;n='Loading data file "'+e+'" failed (no arrayBuffer).',r||ee(n),t(new Uint8Array(r)),o&&Q()}),(function(t){if(!r)throw'Loading data file "'+e+'" failed.';r()})),o&&J()}var fe={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=se.resolve(fe.cwd(),e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new fe.ErrnoError(32);for(var r=ae.normalizeArray(e.split("/").filter((e=>!!e)),!1),n=fe.root,o="/",i=0;i<r.length;i++){var a=i===r.length-1;if(a&&t.parent)break;if(n=fe.lookupNode(n,r[i]),o=ae.join2(o,r[i]),fe.isMountpoint(n)&&(!a||a&&t.follow_mount)&&(n=n.mounted.root),!a||t.follow)for(var s=0;fe.isLink(n.mode);){var u=fe.readlink(o);if(o=se.resolve(ae.dirname(o),u),n=fe.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new fe.ErrnoError(32)}}return{path:o,node:n}},getPath:e=>{for(var t;;){if(fe.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)%fe.nameTable.length},hashAddNode:e=>{var t=fe.hashName(e.parent.id,e.name);e.name_next=fe.nameTable[t],fe.nameTable[t]=e},hashRemoveNode:e=>{var t=fe.hashName(e.parent.id,e.name);if(fe.nameTable[t]===e)fe.nameTable[t]=e.name_next;else for(var r=fe.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:(e,t)=>{var r=fe.mayLookup(e);if(r)throw new fe.ErrnoError(r,e);for(var n=fe.hashName(e.id,t),o=fe.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return fe.lookup(e,t)},createNode:(e,t,r,n)=>{var o=new fe.FSNode(e,t,r,n);return fe.hashAddNode(o),o},destroyNode:e=>{fe.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),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:e=>{var t=fe.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:e=>{var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>fe.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=fe.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate:(e,t)=>{try{return fe.lookupNode(e,t),20}catch(e){}return fe.nodePermissions(e,"wx")},mayDelete:(e,t,r)=>{var n;try{n=fe.lookupNode(e,t)}catch(e){return e.errno}var o=fe.nodePermissions(e,"wx");if(o)return o;if(r){if(!fe.isDir(n.mode))return 54;if(fe.isRoot(n)||fe.getPath(n)===fe.cwd())return 10}else if(fe.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?fe.isLink(e.mode)?32:fe.isDir(e.mode)&&("r"!==fe.flagsToPermissionString(t)||512&t)?31:fe.nodePermissions(e,fe.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:(e=0,t=fe.MAX_OPEN_FDS)=>{for(var r=e;r<=t;r++)if(!fe.streams[r])return r;throw new fe.ErrnoError(33)},getStream:e=>fe.streams[e],createStream:(e,t,r)=>{fe.FSStream||(fe.FSStream=function(){this.shared={}},fe.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 fe.FSStream,e);var n=fe.nextfd(t,r);return e.fd=n,fe.streams[n]=e,e},closeStream:e=>{fe.streams[e]=null},chrdev_stream_ops:{open:e=>{var t=fe.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new fe.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice:(e,t)=>{fe.devices[e]={stream_ops:t}},getDevice:e=>fe.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),fe.syncFSRequests++,fe.syncFSRequests>1&&_("warning: "+fe.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=fe.getMounts(fe.root.mount),n=0;function o(e){return fe.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((t=>{if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)}))},mount:(e,t,r)=>{var n,o="/"===r,i=!r;if(o&&fe.root)throw new fe.ErrnoError(10);if(!o&&!i){var a=fe.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,fe.isMountpoint(n))throw new fe.ErrnoError(10);if(!fe.isDir(n.mode))throw new fe.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?fe.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:e=>{var t=fe.lookupPath(e,{follow_mount:!1});if(!fe.isMountpoint(t.node))throw new fe.ErrnoError(28);var r=t.node,n=r.mounted,o=fe.getMounts(n);Object.keys(fe.nameTable).forEach((e=>{for(var t=fe.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&fe.destroyNode(t),t=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(n);r.mount.mounts.splice(i,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod:(e,t,r)=>{var n=fe.lookupPath(e,{parent:!0}).node,o=ae.basename(e);if(!o||"."===o||".."===o)throw new fe.ErrnoError(28);var i=fe.mayCreate(n,o);if(i)throw new fe.ErrnoError(i);if(!n.node_ops.mknod)throw new fe.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,fe.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,fe.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{fe.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,fe.mknod(e,t,r)),symlink:(e,t)=>{if(!se.resolve(e))throw new fe.ErrnoError(44);var r=fe.lookupPath(t,{parent:!0}).node;if(!r)throw new fe.ErrnoError(44);var n=ae.basename(t),o=fe.mayCreate(r,n);if(o)throw new fe.ErrnoError(o);if(!r.node_ops.symlink)throw new fe.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename:(e,t)=>{var r,n,o=ae.dirname(e),i=ae.dirname(t),a=ae.basename(e),s=ae.basename(t);if(r=fe.lookupPath(e,{parent:!0}).node,n=fe.lookupPath(t,{parent:!0}).node,!r||!n)throw new fe.ErrnoError(44);if(r.mount!==n.mount)throw new fe.ErrnoError(75);var u,c=fe.lookupNode(r,a),l=se.relative(e,i);if("."!==l.charAt(0))throw new fe.ErrnoError(28);if("."!==(l=se.relative(t,o)).charAt(0))throw new fe.ErrnoError(55);try{u=fe.lookupNode(n,s)}catch(e){}if(c!==u){var f=fe.isDir(c.mode),h=fe.mayDelete(r,a,f);if(h)throw new fe.ErrnoError(h);if(h=u?fe.mayDelete(n,s,f):fe.mayCreate(n,s))throw new fe.ErrnoError(h);if(!r.node_ops.rename)throw new fe.ErrnoError(63);if(fe.isMountpoint(c)||u&&fe.isMountpoint(u))throw new fe.ErrnoError(10);if(n!==r&&(h=fe.nodePermissions(r,"w")))throw new fe.ErrnoError(h);fe.hashRemoveNode(c);try{r.node_ops.rename(c,n,s)}catch(e){throw e}finally{fe.hashAddNode(c)}}},rmdir:e=>{var t=fe.lookupPath(e,{parent:!0}).node,r=ae.basename(e),n=fe.lookupNode(t,r),o=fe.mayDelete(t,r,!0);if(o)throw new fe.ErrnoError(o);if(!t.node_ops.rmdir)throw new fe.ErrnoError(63);if(fe.isMountpoint(n))throw new fe.ErrnoError(10);t.node_ops.rmdir(t,r),fe.destroyNode(n)},readdir:e=>{var t=fe.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new fe.ErrnoError(54);return t.node_ops.readdir(t)},unlink:e=>{var t=fe.lookupPath(e,{parent:!0}).node;if(!t)throw new fe.ErrnoError(44);var r=ae.basename(e),n=fe.lookupNode(t,r),o=fe.mayDelete(t,r,!1);if(o)throw new fe.ErrnoError(o);if(!t.node_ops.unlink)throw new fe.ErrnoError(63);if(fe.isMountpoint(n))throw new fe.ErrnoError(10);t.node_ops.unlink(t,r),fe.destroyNode(n)},readlink:e=>{var t=fe.lookupPath(e).node;if(!t)throw new fe.ErrnoError(44);if(!t.node_ops.readlink)throw new fe.ErrnoError(28);return se.resolve(fe.getPath(t.parent),t.node_ops.readlink(t))},stat:(e,t)=>{var r=fe.lookupPath(e,{follow:!t}).node;if(!r)throw new fe.ErrnoError(44);if(!r.node_ops.getattr)throw new fe.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>fe.stat(e,!0),chmod:(e,t,r)=>{var n;if(!(n="string"==typeof e?fe.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new fe.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:(e,t)=>{fe.chmod(e,t,!0)},fchmod:(e,t)=>{var r=fe.getStream(e);if(!r)throw new fe.ErrnoError(8);fe.chmod(r.node,t)},chown:(e,t,r,n)=>{var o;if(!(o="string"==typeof e?fe.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new fe.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(e,t,r)=>{fe.chown(e,t,r,!0)},fchown:(e,t,r)=>{var n=fe.getStream(e);if(!n)throw new fe.ErrnoError(8);fe.chown(n.node,t,r)},truncate:(e,t)=>{if(t<0)throw new fe.ErrnoError(28);var r;if(!(r="string"==typeof e?fe.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new fe.ErrnoError(63);if(fe.isDir(r.mode))throw new fe.ErrnoError(31);if(!fe.isFile(r.mode))throw new fe.ErrnoError(28);var n=fe.nodePermissions(r,"w");if(n)throw new fe.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:(e,t)=>{var r=fe.getStream(e);if(!r)throw new fe.ErrnoError(8);if(0==(2097155&r.flags))throw new fe.ErrnoError(28);fe.truncate(r.node,t)},utime:(e,t,r)=>{var n=fe.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:(e,t,r,n,o)=>{if(""===e)throw new fe.ErrnoError(44);var a;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?fe.modeStringToFlags(t):t)?4095&r|32768:0,"object"==typeof e)a=e;else{e=ae.normalize(e);try{a=fe.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var s=!1;if(64&t)if(a){if(128&t)throw new fe.ErrnoError(20)}else a=fe.mknod(e,r,0),s=!0;if(!a)throw new fe.ErrnoError(44);if(fe.isChrdev(a.mode)&&(t&=-513),65536&t&&!fe.isDir(a.mode))throw new fe.ErrnoError(54);if(!s){var u=fe.mayOpen(a,t);if(u)throw new fe.ErrnoError(u)}512&t&&fe.truncate(a,0),t&=-131713;var c=fe.createStream({node:a,path:fe.getPath(a),flags:t,seekable:!0,position:0,stream_ops:a.stream_ops,ungotten:[],error:!1},n,o);return c.stream_ops.open&&c.stream_ops.open(c),!i.logReadFiles||1&t||(fe.readFiles||(fe.readFiles={}),e in fe.readFiles||(fe.readFiles[e]=1)),c},close:e=>{if(fe.isClosed(e))throw new fe.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{fe.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,t,r)=>{if(fe.isClosed(e))throw new fe.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new fe.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new fe.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 fe.ErrnoError(28);if(fe.isClosed(e))throw new fe.ErrnoError(8);if(1==(2097155&e.flags))throw new fe.ErrnoError(8);if(fe.isDir(e.node.mode))throw new fe.ErrnoError(31);if(!e.stream_ops.read)throw new fe.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new fe.ErrnoError(70)}else o=e.position;var a=e.stream_ops.read(e,t,r,n,o);return i||(e.position+=a),a},write:(e,t,r,n,o,i)=>{if(n<0||o<0)throw new fe.ErrnoError(28);if(fe.isClosed(e))throw new fe.ErrnoError(8);if(0==(2097155&e.flags))throw new fe.ErrnoError(8);if(fe.isDir(e.node.mode))throw new fe.ErrnoError(31);if(!e.stream_ops.write)throw new fe.ErrnoError(28);e.seekable&&1024&e.flags&&fe.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new fe.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:(e,t,r)=>{if(fe.isClosed(e))throw new fe.ErrnoError(8);if(t<0||r<=0)throw new fe.ErrnoError(28);if(0==(2097155&e.flags))throw new fe.ErrnoError(8);if(!fe.isFile(e.node.mode)&&!fe.isDir(e.node.mode))throw new fe.ErrnoError(43);if(!e.stream_ops.allocate)throw new fe.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap:(e,t,r,n,o,i)=>{if(0!=(2&o)&&0==(2&i)&&2!=(2097155&e.flags))throw new fe.ErrnoError(2);if(1==(2097155&e.flags))throw new fe.ErrnoError(2);if(!e.stream_ops.mmap)throw new fe.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,o,i)},msync:(e,t,r,n,o)=>e&&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 fe.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=fe.open(e,t.flags),o=fe.stat(e).size,i=new Uint8Array(o);return fe.read(n,i,0,o,0),"utf8"===t.encoding?r=D(i,0):"binary"===t.encoding&&(r=i),fe.close(n),r},writeFile:(e,t,r={})=>{r.flags=r.flags||577;var n=fe.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(L(t)+1),i=F(t,o,0,o.length);fe.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");fe.write(n,t,0,t.byteLength,void 0,r.canOwn)}fe.close(n)},cwd:()=>fe.currentPath,chdir:e=>{var t=fe.lookupPath(e,{follow:!0});if(null===t.node)throw new fe.ErrnoError(44);if(!fe.isDir(t.node.mode))throw new fe.ErrnoError(54);var r=fe.nodePermissions(t.node,"x");if(r)throw new fe.ErrnoError(r);fe.currentPath=t.path},createDefaultDirectories:()=>{fe.mkdir("/tmp"),fe.mkdir("/home"),fe.mkdir("/home/web_user")},createDefaultDevices:()=>{fe.mkdir("/dev"),fe.registerDevice(fe.makedev(1,3),{read:()=>0,write:(e,t,r,n,o)=>n}),fe.mkdev("/dev/null",fe.makedev(1,3)),ue.register(fe.makedev(5,0),ue.default_tty_ops),ue.register(fe.makedev(6,0),ue.default_tty1_ops),fe.mkdev("/dev/tty",fe.makedev(5,0)),fe.mkdev("/dev/tty1",fe.makedev(6,0));var e=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}if(v)try{var t=r(6113);return function(){return t.randomBytes(1)[0]}}catch(e){}return function(){ee("randomDevice")}}();fe.createDevice("/dev","random",e),fe.createDevice("/dev","urandom",e),fe.mkdir("/dev/shm"),fe.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{fe.mkdir("/proc");var e=fe.mkdir("/proc/self");fe.mkdir("/proc/self/fd"),fe.mount({mount:()=>{var t=fe.createNode(e,"fd",16895,73);return t.node_ops={lookup:(e,t)=>{var r=+t,n=fe.getStream(r);if(!n)throw new fe.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams:()=>{i.stdin?fe.createDevice("/dev","stdin",i.stdin):fe.symlink("/dev/tty","/dev/stdin"),i.stdout?fe.createDevice("/dev","stdout",null,i.stdout):fe.symlink("/dev/tty","/dev/stdout"),i.stderr?fe.createDevice("/dev","stderr",null,i.stderr):fe.symlink("/dev/tty1","/dev/stderr"),fe.open("/dev/stdin",0),fe.open("/dev/stdout",1),fe.open("/dev/stderr",1)},ensureErrnoError:()=>{fe.ErrnoError||(fe.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},fe.ErrnoError.prototype=new Error,fe.ErrnoError.prototype.constructor=fe.ErrnoError,[44].forEach((e=>{fe.genericErrors[e]=new fe.ErrnoError(e),fe.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:()=>{fe.ensureErrnoError(),fe.nameTable=new Array(4096),fe.mount(ce,{},"/"),fe.createDefaultDirectories(),fe.createDefaultDevices(),fe.createSpecialDirectories(),fe.filesystems={MEMFS:ce}},init:(e,t,r)=>{fe.init.initialized=!0,fe.ensureErrnoError(),i.stdin=e||i.stdin,i.stdout=t||i.stdout,i.stderr=r||i.stderr,fe.createStandardStreams()},quit:()=>{fe.init.initialized=!1;for(var e=0;e<fe.streams.length;e++){var t=fe.streams[e];t&&fe.close(t)}},getMode:(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},findObject:(e,t)=>{var r=fe.analyzePath(e,t);return r.exists?r.object:null},analyzePath:(e,t)=>{try{e=(n=fe.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=fe.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=ae.basename(e),n=fe.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:fe.getPath(e);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var a=ae.join2(e,i);try{fe.mkdir(a)}catch(e){}e=a}}return a},createFile:(e,t,r,n,o)=>{var i=ae.join2("string"==typeof e?e:fe.getPath(e),t),a=fe.getMode(n,o);return fe.create(i,a)},createDataFile:(e,t,r,n,o,i)=>{var a=t;e&&(e="string"==typeof e?e:fe.getPath(e),a=t?ae.join2(e,t):e);var s=fe.getMode(n,o),u=fe.create(a,s);if(r){if("string"==typeof r){for(var c=new Array(r.length),l=0,f=r.length;l<f;++l)c[l]=r.charCodeAt(l);r=c}fe.chmod(u,146|s);var h=fe.open(u,577);fe.write(h,r,0,r.length,0,i),fe.close(h),fe.chmod(u,s)}return u},createDevice:(e,t,r,n)=>{var o=ae.join2("string"==typeof e?e:fe.getPath(e),t),i=fe.getMode(!!r,!!n);fe.createDevice.major||(fe.createDevice.major=64);var a=fe.makedev(fe.createDevice.major++,0);return fe.registerDevice(a,{open:e=>{e.seekable=!1},close:e=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(e,t,n,o,i)=>{for(var a=0,s=0;s<o;s++){var u;try{u=r()}catch(e){throw new fe.ErrnoError(29)}if(void 0===u&&0===a)throw new fe.ErrnoError(6);if(null==u)break;a++,t[n+s]=u}return a&&(e.node.timestamp=Date.now()),a},write:(e,t,r,o,i)=>{for(var a=0;a<o;a++)try{n(t[r+a])}catch(e){throw new fe.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),a}}),fe.mkdev(o,i,a)},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(!a)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=ve(a(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new fe.ErrnoError(29)}},createLazyFile:(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((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]=((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||[]):ve(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(!y)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=fe.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={};return Object.keys(u.stream_ops).forEach((e=>{var t=u.stream_ops[e];c[e]=function(){return fe.forceLoadFile(u),t.apply(null,arguments)}})),c.read=(e,t,r,n,o)=>{fe.forceLoadFile(u);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},u.stream_ops=c,u},createPreloadedFile:(e,t,r,n,o,i,a,s,u,c)=>{var l=t?se.resolve(ae.join2(e,t)):e;function f(r){function f(r){c&&c(),s||fe.createDataFile(e,t,r,n,o,u),i&&i(),Q()}Browser.handledByPreloadPlugin(r,l,f,(()=>{a&&a(),Q()}))||f(r)}J(),"string"==typeof r?le(r,(e=>f(e)),a):f(r)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var n=fe.indexedDB();try{var o=n.open(fe.DB_NAME(),fe.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=()=>{E("creating db"),o.result.createObjectStore(fe.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([fe.DB_STORE_NAME],"readwrite"),i=n.objectStore(fe.DB_STORE_NAME),a=0,s=0,u=e.length;function c(){0==s?t():r()}e.forEach((e=>{var t=i.put(fe.analyzePath(e).object.contents,e);t.onsuccess=()=>{++a+s==u&&c()},t.onerror=()=>{s++,a+s==u&&c()}})),n.onerror=r},o.onerror=r},loadFilesFromDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var n=fe.indexedDB();try{var o=n.open(fe.DB_NAME(),fe.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=r,o.onsuccess=()=>{var n=o.result;try{var i=n.transaction([fe.DB_STORE_NAME],"readonly")}catch(e){return void r(e)}var a=i.objectStore(fe.DB_STORE_NAME),s=0,u=0,c=e.length;function l(){0==u?t():r()}e.forEach((e=>{var t=a.get(e);t.onsuccess=()=>{fe.analyzePath(e).exists&&fe.unlink(e),fe.createDataFile(ae.dirname(e),ae.basename(e),t.result,!0,!0,!0),++s+u==c&&l()},t.onerror=()=>{u++,s+u==c&&l()}})),i.onerror=r},o.onerror=r}},he={DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){if(ae.isAbs(t))return t;var n;if(-100===e)n=fe.cwd();else{var o=fe.getStream(e);if(!o)throw new fe.ErrnoError(8);n=o.path}if(0==t.length){if(!r)throw new fe.ErrnoError(44);return n}return ae.join2(n,t)},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&ae.normalize(t)!==ae.normalize(fe.getPath(e.node)))return-54;throw e}return T[r>>2]=n.dev,T[r+4>>2]=0,T[r+8>>2]=n.ino,T[r+12>>2]=n.mode,T[r+16>>2]=n.nlink,T[r+20>>2]=n.uid,T[r+24>>2]=n.gid,T[r+28>>2]=n.rdev,T[r+32>>2]=0,W=[n.size>>>0,(K=n.size,+Math.abs(K)>=1?K>0?(0|Math.min(+Math.floor(K/4294967296),4294967295))>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],T[r+40>>2]=W[0],T[r+44>>2]=W[1],T[r+48>>2]=4096,T[r+52>>2]=n.blocks,T[r+56>>2]=n.atime.getTime()/1e3|0,T[r+60>>2]=0,T[r+64>>2]=n.mtime.getTime()/1e3|0,T[r+68>>2]=0,T[r+72>>2]=n.ctime.getTime()/1e3|0,T[r+76>>2]=0,W=[n.ino>>>0,(K=n.ino,+Math.abs(K)>=1?K>0?(0|Math.min(+Math.floor(K/4294967296),4294967295))>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],T[r+80>>2]=W[0],T[r+84>>2]=W[1],0},doMsync:function(e,t,r,n,o){var i=P.slice(e,e+r);fe.msync(t,i,o,r,n)},doMknod:function(e,t,r){switch(61440&t){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return fe.mknod(e,t,r),0},doReadlink:function(e,t,r){if(r<=0)return-28;var n=fe.readlink(e),o=Math.min(r,L(n)),i=C[t+o];return N(n,t,r+1),C[t+o]=i,o},doAccess:function(e,t){if(-8&t)return-28;var r=fe.lookupPath(e,{follow:!0}).node;if(!r)return-44;var n="";return 4&t&&(n+="r"),2&t&&(n+="w"),1&t&&(n+="x"),n&&fe.nodePermissions(r,n)?-2:0},doReadv:function(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=T[t>>2],s=T[t+4>>2];t+=8;var u=fe.read(e,C,a,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o},doWritev:function(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=T[t>>2],s=T[t+4>>2];t+=8;var u=fe.write(e,C,a,s,n);if(u<0)return-1;o+=u}return o},varargs:void 0,get:function(){return he.varargs+=4,T[he.varargs-4>>2]},getStr:function(e){return M(e)},getStreamFromFD:function(e){var t=fe.getStream(e);if(!t)throw new fe.ErrnoError(8);return t}},de={};function pe(){if(!pe.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",_:p||"./this.program"};for(var t in de)void 0===de[t]?delete e[t]:e[t]=de[t];var r=[];for(var t in e)r.push(t+"="+e[t]);pe.strings=r}return pe.strings}var me=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=fe.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},ge=365,ye=146;function ve(e,t,r){var n=r>0?r:L(e)+1,o=new Array(n),i=F(e,o,0,o.length);return t&&(o.length=i),o}Object.defineProperties(me.prototype,{read:{get:function(){return(this.mode&ge)===ge},set:function(e){e?this.mode|=ge:this.mode&=-366}},write:{get:function(){return(this.mode&ye)===ye},set:function(e){e?this.mode|=ye:this.mode&=-147}},isFolder:{get:function(){return fe.isDir(this.mode)}},isDevice:{get:function(){return fe.isChrdev(this.mode)}}}),fe.FSNode=me,fe.staticInit();var we,be={b:function(e,t,r,n){ee("Assertion failed: "+M(e)+", at: "+[t?M(t):"unknown filename",r,n?M(n):"unknown function"])},k:function(e,t){try{return e=he.getStr(e),fe.chmod(e,t),0}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},D:function(e){try{var t=he.getStreamFromFD(e);return fe.createStream(t,0).fd}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},E:function(e,t,r,n){try{return t=he.getStr(t),t=he.calculateAt(e,t),he.doAccess(t,r)}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},B:function(e,t){try{return fe.fchmod(e,t),0}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},d:function(e,t,r){he.varargs=r;try{var n=he.getStreamFromFD(e);switch(t){case 0:return(o=he.get())<0?-28:fe.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(),O[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return i=28,T[Ee()>>2]=i,-1}}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}var i},z:function(e,t){try{var r=he.getStreamFromFD(e);return he.doStat(fe.stat,r.path,t)}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},v:function(e,t){try{if(0===t)return-28;var r=fe.cwd(),n=L(r)+1;return t<n?-68:(N(r,e,t),n)}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},l: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 T[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:return o=he.get(),fe.ioctl(n,t,o);default:ee("bad ioctl syscall "+t)}}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},x:function(e,t){try{return e=he.getStr(e),he.doStat(fe.lstat,e,t)}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},u:function(e,t,r){try{return t=he.getStr(t),t=he.calculateAt(e,t),"/"===(t=ae.normalize(t))[t.length-1]&&(t=t.substr(0,t.length-1)),fe.mkdir(t,r,0),0}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},w:function(e,t,r,n){try{t=he.getStr(t);var o=256&n,i=4096&n;return n&=-4353,t=he.calculateAt(e,t,i),he.doStat(o?fe.lstat:fe.stat,t,r)}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},i: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 fe.open(t,r,o).fd}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},t:function(e,t,r,n){try{return t=he.getStr(t),t=he.calculateAt(e,t),he.doReadlink(t,r,n)}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},s:function(e){try{return e=he.getStr(e),fe.rmdir(e),0}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},y:function(e,t){try{return e=he.getStr(e),he.doStat(fe.stat,e,t)}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},r:function(e,t,r){try{return t=he.getStr(t),t=he.calculateAt(e,t),0===r?fe.unlink(t):512===r?fe.rmdir(t):ee("Invalid flags passed to unlinkat"),0}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},q:function(e,t,r,n){try{if(t=he.getStr(t),t=he.calculateAt(e,t,!0),r){var o=T[r>>2],i=T[r+4>>2];a=1e3*o+i/1e6,s=1e3*(o=T[(r+=8)>>2])+(i=T[r+4>>2])/1e6}else var a=Date.now(),s=a;return fe.utime(t,a,s),0}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return-e.errno}},j:function(){return Date.now()},C:function(){return!0},a:function(){ee("")},A:function(e,t,r){P.copyWithin(e,t,t+r)},e:function(e){P.length,ee("OOM")},m:function(e,t){var r=0;return pe().forEach((function(n,o){var i=t+r;T[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},o:function(e,t){var r=pe();T[e>>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),T[t>>2]=n,0},f:function(e){ke(e)},c:function(e){try{var t=he.getStreamFromFD(e);return fe.close(t),0}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return e.errno}},p:function(e,t){try{var r=he.getStreamFromFD(e),n=r.tty?2:fe.isDir(r.mode)?3:fe.isLink(r.mode)?7:4;return C[t>>0]=n,0}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return e.errno}},h:function(e,t,r,n){try{var o=he.getStreamFromFD(e),i=he.doReadv(o,t,r);return T[n>>2]=i,0}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return e.errno}},n:function(e,t,r,n,o){try{var i=he.getStreamFromFD(e),a=4294967296*r+(t>>>0),s=9007199254740992;return a<=-s||a>=s?-61:(fe.llseek(i,a,n),W=[i.position>>>0,(K=i.position,+Math.abs(K)>=1?K>0?(0|Math.min(+Math.floor(K/4294967296),4294967295))>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],T[o>>2]=W[0],T[o+4>>2]=W[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0)}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return e.errno}},g:function(e,t,r,n){try{var o=he.getStreamFromFD(e),i=he.doWritev(o,t,r);return T[n>>2]=i,0}catch(e){if(void 0===fe||!(e instanceof fe.ErrnoError))throw e;return e.errno}},F:function(e){Ce(e)}},Ee=(function(){var e={a:be};function t(e,t){var r,n,o=e.exports;i.asm=o,S=i.asm.G,r=S.buffer,k=r,i.HEAP8=C=new Int8Array(r),i.HEAP16=O=new Int16Array(r),i.HEAP32=T=new Int32Array(r),i.HEAPU8=P=new Uint8Array(r),i.HEAPU16=new Uint16Array(r),i.HEAPU32=new Uint32Array(r),i.HEAPF32=new Float32Array(r),i.HEAPF64=new Float64Array(r),U=i.asm.K,n=i.asm.H,z.unshift(n),Q()}function r(e){t(e.instance)}function n(t){return function(){if(!b&&(g||y)){if("function"==typeof fetch&&!re($))return fetch($,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+$+"'";return e.arrayBuffer()})).catch((function(){return ne($)}));if(s)return new Promise((function(e,t){s($,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return ne($)}))}().then((function(t){return WebAssembly.instantiate(t,e)})).then((function(e){return e})).then(t,(function(e){_("failed to asynchronously prepare wasm: "+e),ee(e)}))}if(J(),i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(e){return _("Module.instantiateWasm callback failed with error: "+e),!1}(b||"function"!=typeof WebAssembly.instantiateStreaming||te($)||re($)||"function"!=typeof fetch?n(r):fetch($,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(r,(function(e){return _("wasm streaming compile failed: "+e),_("falling back to ArrayBuffer instantiation"),n(r)}))}))).catch(o)}(),i.___wasm_call_ctors=function(){return(i.___wasm_call_ctors=i.asm.H).apply(null,arguments)},i._main=function(){return(i._main=i.asm.I).apply(null,arguments)},i.___errno_location=function(){return(Ee=i.___errno_location=i.asm.J).apply(null,arguments)}),_e=i.stackAlloc=function(){return(_e=i.stackAlloc=i.asm.L).apply(null,arguments)};function Se(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Ae(e){var t=i._main,r=(e=e||[]).length+1,n=_e(4*(r+1));T[n>>2]=H(p);for(var o=1;o<r;o++)T[(n>>2)+o]=H(e[o-1]);T[(n>>2)+r]=0;try{var a=t(r,n);return ke(a),a}catch(e){return function(e){if(e instanceof Se||"unwind"==e)return I;m(1,e)}(e)}}function Ie(e){function r(){we||(we=!0,i.calledRun=!0,x||(i.noFSInit||fe.init.initialized||fe.init(),fe.ignorePermissions=!1,ue.init(),oe(z),oe(j),t(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),Pe&&Ae(e),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)e=i.postRun.shift(),V.unshift(e);var e;oe(V)}()))}e=e||d,q>0||(function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)e=i.preRun.shift(),B.unshift(e);var e;oe(B)}(),q>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),r()}),1)):r()))}function ke(e,t){I=e,Ce(e)}function Ce(e){I=e,G()||(i.onExit&&i.onExit(e),x=!0),m(e,new Se(e))}if(i.FS=fe,Z=function e(){we||Ie(),we||(Z=e)},i.run=Ie,i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();var Pe=!0;return i.noInitialRun&&(Pe=!1),Ie(),e.ready});e.exports=o},7757:(e,t,r)=>{e.exports=r(5666)},382:(e,t,r)=>{if("undefined"!=typeof SHARED_CONFIG)r.p=SHARED_CONFIG.url_base.cdn+"/";else{var n=r(1017).resolve;r.p=n(__dirname)+"/"}},4435:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toNumberSafe=t.divide=t.add=t.subtract=void 0,t.subtract=function(e,t){return"bigint"==typeof e&&"bigint"==typeof t||"number"==typeof e&&"number"==typeof t?e-t:BigInt(e)-BigInt(t)},t.add=function(e,t){return"bigint"==typeof e&&"bigint"==typeof t||"number"==typeof e&&"number"==typeof t?e+t:BigInt(e)+BigInt(t)},t.divide=function(e,t){return"bigint"==typeof e&&"bigint"==typeof t?e/t:"number"==typeof e&&"number"==typeof t?parseInt(e/t):BigInt(e)/BigInt(t)};const r=BigInt(1e51);t.toNumberSafe=function(e,t){if("bigint"==typeof e){if(!(e>r))return Number(e);if(!t)throw new Error("BigInt Overflow");t.push("BigInt Overflow")}else if("number"==typeof e)return e;throw new Error("Invalid Input for BigInt conversion")}},8411:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debug=void 0;const n=r(2524);function o(e,t=0){if(void 0!==e){const r=e.toString(16);return 0==t&&(t="bigint"==typeof e?8:r.length<=2?2:r.length<=4?4:8),`0x${r.padStart(t,"0")}`}return"<undefined>"}t.debug=function(e){let t="";const r=e.elf?e.elf:e;if(r){const e=r.bits?r.bits/4:8;if(t+=`Path: ${r.path}\n`,t+=`Class: ${r.classDescription} (${r.class})\n`,t+=`Bits: ${r.bits} bits\n`,t+=`Data: ${r.dataDescription} (${r.data})\n`,t+=`Version: ${r.version}\n`,t+=`OS/ABI: ${r.abiDescription} (${o(r.abi)})\n`,t+=`ABI version: ${r.abiVersion}\n`,t+=`Type: ${r.typeDescription} (${o(r.type)})\n`,t+=`ISA/machine: ${r.isaDescription} (${o(r.isa)})\n`,t+=`ISA/machine version: ${r.isaVersion}\n`,t+=`Entry Point: ${o(r.entryPoint)}\n`,t+=`Program header offset: ${o(r.programHeaderOffset)}\n`,t+=`Section header offset: ${o(r.sectionHeaderOffset)}\n`,t+=`Flags: ${r.flagsDescription} (${o(r.flags)})\n`,t+=`Program headers: ${r.programHeaderEntrySize} bytes × ${r.segments.length}\n`,t+=`Section headers: ${r.sectionHeaderEntrySize} bytes × ${r.sections.length}\n`,t+=`String table section index: ${r.shstrIndex}\n`,r.segments.length){t+="\n\nProgram Header Entries:\n\n",32==r.bits?t+=" # Type Offset VirtAddr PhysAddr FileSize MemSiz Align Flags\n":t+=" # Type Offset VirtAddr PhysAddr FileSize MemSiz Align Flags\n";for(const n of r.segments)t+=` ${n.index.toString().padEnd(3)} `,t+=`${n.typeDescription.padEnd(20)} `,t+=`${o(n.offset,e)} `,t+=`${o(n.vaddr,e)} `,t+=`${o(n.paddr,e)} `,t+=`${o(n.filesz,e)} `,t+=`${o(n.memsz,e)} `,t+=`${o(n.align,8)} `,t+=`${n.flagsDescription}\n`}if(r.sections.length){t+="\n\nSections:\n\n",32==r.bits?t+=" # Name Type Address Offset Size EntSize Link Info Align Flags\n":t+=" # Name Type Address Offset Size EntSize Link Info Align Flags\n";for(const n of r.sections)t+=` ${n.index.toString().padEnd(3)} `,t+=`${n.name.substr(0,18).padEnd(18)} `,t+=`${n.typeDescription.padEnd(32)} `,t+=`${o(n.addr,e)} `,t+=`${o(n.offset,e)} `,t+=`${o(n.size,e)} `,t+=`${o(n.entsize,e)} `,t+=`${(n.link||"").toString().padStart(4)} `,t+=`${(n.info||"").toString().padStart(4)} `,t+=`${o(n.addralign,8)} `,t+=`${n.flagsDescription}\n`}for(const i of r.sections)if(t+=`\n\n${i.typeDescription} section #${i.index} ${i.name}:\n\n`,(0,n.isSymbolSection)(i)){32==r.bits?t+=" # Value Size Type Bind Visibility Name\n":t+=" # Value Info Type Bind Visibility Name\n";let n=0;for(const r of i.symbols)t+=` ${(n++).toString().padStart(5)} `,t+=`${o(r.value,e)} `,t+=`${o(r.size,8)} `,t+=`${r.typeDescription.padEnd(28)} `,t+=`${r.bindingDescription.padEnd(6)} `,t+=`${r.visibilityDescription.padEnd(10)} `,t+=`${r.name}\n`}else if((0,n.isStringSection)(i))for(const e in i.strings)t+=` #${e} - ${i.strings[e]}\n`;else if((0,n.isRelocationSection)(i)){32==r.bits?t+=" # Offset Size Type Bind Visibility Name\n":t+=" # Offset Size Type Bind Visibility Name\n";let n=0;for(const r of i.relocations)t+=` ${(n++).toString().padStart(5)} `,t+=`${o(r.addr,e)} `,t+=`${o(r.info,e)} `,t+="\n"}}else t+="<undefined>";return t}},2302:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDisassembler=t.available=t.getCapstone=void 0;const n=r(1735),o=r(8744),i=Symbol.for("__capstone"),a=void 0!==typeof global?global:void 0!==typeof window?window:void 0;function s(){return a[i]}function u(e){switch(e){case o.ISA.ARM:return n.Architecture.ARM;case o.ISA.AARCH64:return n.Architecture.ARM64;case o.ISA.MIPS:case o.ISA.MIPS_RS3_LE:case o.ISA.MIPS_X:return n.Architecture.MIPS;case o.ISA.x86:case o.ISA.X86_64:return n.Architecture.X86;case o.ISA.PPC:case o.ISA.PPC64:return n.Architecture.PPC;case o.ISA.SPARC:case o.ISA.SPARC32PLUS:case o.ISA.SPARCV9:return n.Architecture.SPARC;case o.ISA.XCORE:return n.Architecture.XCORE;case o.ISA.ISA68K:return n.Architecture.M68K;case o.ISA.BPF:return n.Architecture.BPF;case o.ISA.RISCV:return n.Architecture.RISCV;case o.ISA.XTENSA:return n.Architecture.XTENSA;default:return}}t.getCapstone=s,t.available=function(){return a&&!!a[i]};const c={},l=new WeakMap;t.getDisassembler=function(e){const t=function(e){const t=u(e.isa);if(t){const r=`${n.Architecture[t]}-${e.bits.toString()}-${2==e.data?"big":"little"}`;return c[r]||(c[r]={})}}(e);if(t){const r=l.get(t);if(r)return r;{const r=function(e){const t=s();if(t){let r=(2==e.data?n.Mode.BIG_ENDIAN:n.Mode.LittleEndian)|(64==e.bits?n.Mode.Bits64:n.Mode.Bits32),o=u(e.isa);if(void 0!==o){const e=t.createInstance(o,r);if(e)return{normal:e,thumb:o===n.Architecture.ARM?t.createInstance(o,r|n.Mode.Thumb):void 0}}}}(e);if(r)return l.set(t,r),r}}}},798:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.disassembleWithReader=t.disassemble=t.getSymbolsByName=t.getSymbolByName=t.getSectionsByName=t.getSectionByName=t.fileOffsetToVirtualAddress=t.fileOffsetToPhysicalAddress=t.physicalAddressToFileOffset=t.physicalAddressToVirtual=t.virtualAddressToFileOffset=t.virtualAddressToPhysical=t.getSegmentsAtPhysicalMemoryLocation=t.getSegmentsAtVirtualMemoryLocation=t.getSectionsAtPhysicalMemoryLocation=t.getSectionsAtVirtualMemoryLocation=t.getSymbolsAtPhysicalMemoryLocation=t.getSymbolsAtVirtualMemoryLocation=t.getSegmentForSymbol=t.getSegmentsForSymbol=t.getSectionForSymbol=t.getSectionsForSymbol=t.getSectionsInSegment=t.getSymbolsInSegment=t.getSymbolsInSection=t.getSymbols=void 0;const n=r(4435),o=r(2524),i=r(280),a=r(2302);function s(e,t,r){const i=(0,n.add)(t,r),a=[];for(const r of e.sections)if((0,o.isSymbolSection)(r))for(const e of r.symbols)e.virtualAddress&&e.virtualAddress>=t&&e.virtualAddress<i&&a.push(e);return a}function u(e,t){const r=[];for(const o of e.sections)t.virtualAddress&&t.virtualAddress>=o.addr&&t.virtualAddress<=(0,n.add)(o.addr,o.size)&&r.push(o);return r}function c(e,t){const r=[];for(const o of e.segments)t.virtualAddress&&t.virtualAddress>=o.vaddr&&t.virtualAddress<=(0,n.add)(o.vaddr,o.memsz)&&r.push(o);return r}function l(e,t){const r=[];for(const i of e.sections)if((0,o.isSymbolSection)(i))for(const e of i.symbols)0==e.size?e.virtualAddress===t&&r.push(e):e.virtualAddress&&t>=e.virtualAddress&&t<(0,n.add)(e.virtualAddress,e.size)&&r.push(e);return r}function f(e,t){const r=[];for(const o of e.sections)t>=o.addr&&t<(0,n.add)(o.addr,o.size)&&r.push(o);return r}function h(e,t){for(const r of e.segments)if(t>=r.vaddr&&t<(0,n.add)(r.vaddr,r.memsz)){const e=(0,n.toNumberSafe)((0,n.subtract)(t,r.vaddr));if(e<r.filesz)return r.offset+e}}function d(e,t){for(const r of e.segments)if(t>=r.paddr&&t<(0,n.add)(r.paddr,r.filesz)){const e=(0,n.subtract)(t,r.paddr);return(0,n.add)(r.vaddr,e)}}function p(e,t){return e.sections.filter((e=>e.name.toUpperCase()==t.toUpperCase()))}t.getSymbols=function(e){const t=[];for(const r of e.sections)if((0,o.isSymbolSection)(r))for(const e of r.symbols)t.push(e);return t},t.getSymbolsInSection=function(e,t){const r="number"==typeof t?e.sections[t]:t;return s(e,r.addr,r.size)},t.getSymbolsInSegment=function(e,t){const r="number"==typeof t?e.segments[t]:t;return s(e,r.vaddr,r.memsz)},t.getSectionsInSegment=function(e,t){const r="number"==typeof t?e.segments[t]:t;return e.sections.filter((e=>e.addr>r.vaddr&&e.addr<(0,n.add)(r.vaddr,r.memsz)))},t.getSectionsForSymbol=u,t.getSectionForSymbol=function(e,t){return u(e,t)[0]},t.getSegmentsForSymbol=c,t.getSegmentForSymbol=function(e,t){return c(e,t)[0]},t.getSymbolsAtVirtualMemoryLocation=l,t.getSymbolsAtPhysicalMemoryLocation=function(e,t){const r=d(e,t);return r?l(e,r):[]},t.getSectionsAtVirtualMemoryLocation=f,t.getSectionsAtPhysicalMemoryLocation=function(e,t){const r=d(e,t);return r?f(e,r):[]},t.getSegmentsAtVirtualMemoryLocation=function(e,t){const r=[];for(const o of e.segments)t>=o.vaddr&&t<(0,n.add)(o.vaddr,o.memsz)&&r.push(o);return r},t.getSegmentsAtPhysicalMemoryLocation=function(e,t){const r=[];for(const o of e.segments)t>=o.paddr&&t<(0,n.add)(o.paddr,o.filesz)&&r.push(o);return r},t.virtualAddressToPhysical=function(e,t){for(const r of e.segments)if(t>=r.vaddr&&t<=(0,n.add)(r.vaddr,r.memsz)){const e=(0,n.subtract)(t,r.vaddr);if(e<r.filesz)return(0,n.add)(r.paddr,e)}},t.virtualAddressToFileOffset=h,t.physicalAddressToVirtual=d,t.physicalAddressToFileOffset=function(e,t){for(const r of e.segments)if(t>=r.paddr&&t<(0,n.add)(r.paddr,r.filesz)){const e=(0,n.toNumberSafe)((0,n.subtract)(t,r.paddr));return r.offset+e}},t.fileOffsetToPhysicalAddress=function(e,t){for(const r of e.segments)if(t>=r.offset&&t<(0,n.add)(r.offset,r.filesz)){const e=(0,n.subtract)(t,r.offset);return(0,n.add)(r.paddr,e)}},t.fileOffsetToVirtualAddress=function(e,t){for(const r of e.segments)if(t>=r.offset&&t<(0,n.add)(r.offset,r.filesz)){const e=(0,n.subtract)(t,r.offset);return(0,n.add)(r.vaddr,e)}},t.getSectionByName=function(e,t){return p(e,t)[0]},t.getSectionsByName=p,t.getSymbolByName=function(e,t){for(const r of e.sections)if((0,o.isSymbolSection)(r))for(const e of r.symbols)if(e.name&&e.name.toUpperCase()==t.toUpperCase())return e},t.getSymbolsByName=function(e,t){const r=[];for(const n of e.sections)if((0,o.isSymbolSection)(n))for(const e of n.symbols)e.name&&e.name.toUpperCase()==t.toUpperCase()&&r.push(e);return r},t.disassemble=function(e,t,r){const n=null==t?void 0:t.virtualAddress;if(t.type===i.SymbolType.Function&&t.size>0&&void 0!==n){const o=t.data;if(o&&o.byteLength>0){const t=(0,a.getDisassembler)(e);if(t){const e="number"==typeof n?BigInt(n):n;return t.normal.disassemble(o,e)}if(r)throw new Error("Could not create a disassembler instance.")}else if(r)throw new Error("Symbol data is not available.")}else if(r)throw new Error("the symbol is not valid for disassembly.");return[]},t.disassembleWithReader=async function(e,t,r,n){const o=null==t?void 0:t.virtualAddress;if(t.type===i.SymbolType.Function&&t.size>0&&void 0!==o){const i=h(e,o);if(i){const s=await r.view(t.size,i);if(s&&s.byteLength>0){const t=(0,a.getDisassembler)(e);if(t){const e="number"==typeof o?BigInt(o):o;return t.normal.disassemble(s,e)}if(n)throw new Error("Could not create a disassembler instance.")}else if(n)throw new Error("Symbol data is not available.")}else if(n)throw new Error("Symbol does not have a file offset.")}else if(n)throw new Error("the symbol is not valid for disassembly.");return[]}},5501:(e,t,r)=>{"use strict";let n;Object.defineProperty(t,"__esModule",{value:!0}),t.decode=void 0,t.decode=function(e,t,r){if(n)return n(e,t,r);throw new Error("There is no supported utf-8 decoder")};try{const{StringDecoder:e}=r(1576),t=new e("utf8");t&&(n=(e,r,n)=>t.end(e.subarray(r,r+n)))}catch(e){}if(void 0===n&&"undefined"!=typeof TextDecoder){const e=new TextDecoder;n=(t,r,n)=>e.decode(t.subarray(r,r+n))}},280:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t},a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.open=void 0;const s=i(r(9091)),u=r(3366);t.open=function(e,t,r){let n;var o;return t||(t={}),e instanceof Uint8Array||e instanceof ArrayBuffer?n=(0,u.readElf)(s.buffer(e),t):e instanceof Array?n=(0,u.readElf)(s.array(e),t):n="object"==typeof(o=e)&&"function"==typeof o.close&&"function"==typeof o.open&&"function"==typeof o.read&&"function"==typeof o.size&&"function"==typeof o.view?(0,u.readElf)(e,t):"number"==typeof e?(0,u.readElf)(s.syncfile(e),t):function(e){return"object"==typeof e&&"number"==typeof e.fd&&"function"==typeof e.stat&&"function"==typeof e.read}(e)?(0,u.readElf)(s.asyncfile(e),t):function(e){return"object"==typeof e&&"number"==typeof e.size&&"function"==typeof e.arrayBuffer}(e)?(0,u.readElf)(s.blob(e),t):"string"==typeof e?(0,u.readElf)(s.file(e),t):new Promise((e=>{e({success:!1,errors:["unsupported input type"],warnings:[]})})),r&&n.then(r),n},a(r(9091),t),a(r(798),t),a(r(8744),t),a(r(8411),t)},3366:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.readElf=void 0;const n=r(1228),o=r(8744),i=r(8533),a=r(2524),s=r(798),u=r(4435);t.readElf=async function(e,t){var r,c;let l=!1;const f=[],h=[];let d,p;try{await e.open();const p=await e.size();if(p<=64)f.push("Not a valid ELF file. Too small.");else{const m=await e.view(16),g=1179403647;m.getInt32(0,!0)!==g&&h.push("Not a valid ELF file. The file does not start with 0x7f ELF.");const y=m.getUint8(4),v=m.getUint8(5),w=m.getUint8(6),b=m.getUint8(7),E=m.getUint8(8);if((y<1||y>2)&&f.push("Not a valid ELF file. Class is invalid"),(v<1||v>2)&&f.push("Not a valid ELF file. Endianness is invalid"),1!=w&&h.push("Not a valid ELF file. Version is invalid"),0==f.length){const h=1===y?32:64,m=1!==v,g=b,_=32==h?36:48,S=await e.view(_),A=e=>S.getUint16(e,!m),I=e=>S.getUint32(e,!m),k=e=>S.getBigUint64(e,!m);let C=0;const P=A(C);C+=2;const O=A(C);C+=2;const T=I(C);let x,R,D;C+=4,32===h?(x=I(C),C+=4,R=I(C),C+=4,D=I(C),C+=4):(x=k(C),C+=8,R=(0,u.toNumberSafe)(k(C)),C+=8,D=(0,u.toNumberSafe)(k(C)),C+=8);const M=I(C);C+=4;const F=A(C);C+=2;const N=A(C);C+=2;const L=A(C);C+=2;const H=A(C);C+=2;const U=A(C);C+=2;const B=A(C);if(C+=2,(32===h&&52!==F||64==h&&64!==F)&&f.push("Invalid ELF file. Unexpected header size"),(0!=L&&(R<F||R>p)||0!=U&&(D<F||D>p))&&f.push("Invalid ELF file. Invalid offsets"),0!=L&&(32==h&&N<32||64==h&&N<56||N>255)&&f.push("Invalid ELF file. Program header entry size invalid"),0!=U&&(32==h&&H<40||64==h&&H<64||N>255)&&f.push("Invalid ELF file. Section header entry size invalid"),0==f.length){const f=P,p=O,b=await(0,i.readProgramHeaderEntries)(e,R,N,L,h,m),_=await(0,a.readSectionHeaderEntries)(e,D,H,U,h,m,B,null!==(r=t.readSymbolData)&&void 0!==r&&r);d={path:e.path,class:y,classDescription:1==y?"ELF32":"ELF64",data:v,dataDescription:1==v?"Little endian":"Big endian",version:w,bits:h,abi:g,abiVersion:E,abiDescription:(0,n.abiToString)(g),isa:p,isaDescription:(0,n.isaToString)(p),isaVersion:T,type:f,typeDescription:(0,n.objectTypeToString)(f),flags:M,flagsDescription:(0,n.elfFlagsToString)(p,M),entryPoint:x,programHeaderOffset:R,programHeaderEntrySize:N,numProgramHeaderEntries:L,sectionHeaderOffset:D,sectionHeaderEntrySize:H,numSectionHeaderEntries:U,shstrIndex:B,segments:b,sections:_},await async function(e,t,r){const n=t.size(),i=e.type;if(i===o.ObjectType.Executable||i===o.ObjectType.Relocatable||i===o.ObjectType.Shared)for(const c of e.sections)if((0,a.isSymbolSection)(c))for(const a of c.symbols)if(i===o.ObjectType.Relocatable?a.shndx<e.sections.length?a.virtualAddress=(0,u.add)(a.value,e.sections[a.shndx].addr):65521==a.shndx&&(a.virtualAddress=a.value):a.virtualAddress=a.value,r&&a.virtualAddress&&(a.type===o.SymbolType.Function||a.type===o.SymbolType.Object)&&a.size){const r=(0,s.virtualAddressToFileOffset)(e,a.value);r&&r+a.size<=n&&(a.data=await t.read(a.size,r))}}(d,e,null!==(c=t.readSymbolData)&&void 0!==c&&c),l=!0}}}}catch(e){f.push(`Exception caught: ${e.toString()}`)}if(t.returnReader)p=e;else{p=void 0;try{e&&await e.close()}catch(e){f.push(`Exception caught: ${e.toString()}`)}}return{success:l,errors:f,warnings:h,elf:d,reader:p}}},9091:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.blob=t.file=t.syncfile=t.asyncfile=t.buffer=t.array=void 0;const a=r(3292),s=i(r(7147)),u=i(r(1017));function c(e,t,r){let n=!1;const{array:o}=e;return o?t?(r||(r=e.position,n=!0),r<=e.size?(r+t>e.size&&(t=e.size-r),t<0&&(t=0),n&&(e.position+=t),Promise.resolve(new Uint8Array(o,e.offset+r,t))):Promise.reject("read past end of file")):Promise.reject("Length must be specified"):Promise.reject("state.array must be defined")}async function l(e,t,r){if(!e)throw"File not open";const n=new Uint8Array(t),{bytesRead:o}=await e.read(n,0,t,r);return o<t?n.slice(0,o):n}function f(e,t,r){return new Promise(((n,o)=>{const i=new Uint8Array(t);s.read(e,i,0,t,null!=r?r:null,((e,r)=>{e?o(e):n(r<t?i.slice(0,r):i)}))}))}function h(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function d(e){return{open:()=>Promise.reject(e),read:(t,r)=>Promise.reject(e),view:(t,r)=>Promise.reject(e),size:()=>-1,close:()=>Promise.reject(e)}}function p(e){const t={array:e instanceof Uint8Array?e.buffer:e,offset:0,position:0,size:e.byteLength};return e instanceof Uint8Array&&(t.offset=e.byteOffset),{open:()=>Promise.resolve(),size:()=>t.size,close:()=>Promise.resolve(),read:(e,r)=>c(t,e,r),view:(e,r)=>c(t,e,r).then(h)}}t.array=function(e){return p(Uint8Array.from(e))},t.buffer=p,t.asyncfile=function(e,t){if(!s)return d("No filesystem");const r={fh:e,size:0,ownshandle:t};return{open:()=>r.fh.stat().then((e=>{r.size=e.size})),read:(e,t)=>l(r.fh,e,t),view:(e,t)=>l(r.fh,e,t).then(h),size:()=>r.size,close:()=>r.ownshandle?r.fh.close():Promise.resolve()}},t.syncfile=function(e,t){if(!s)return d("No filesystem");const r={ownshandle:t,handle:e,size:0};return{open:()=>new Promise(((e,t)=>s.fstat(r.handle,((n,o)=>{n?t(n):(r.size=o.size,e())})))),read:(e,t)=>f(r.handle,e,t),view:(e,t)=>f(r.handle,e,t).then(h),size:()=>r.size,close:()=>new Promise(((e,t)=>{r.ownshandle?s.close(r.handle,(r=>{r?t(r):e()})):e()}))}},t.file=function(e){if(!s)return d("No filesystem");const t={path:e,fh:void 0,size:0};return{open:()=>(0,a.open)(t.path,"r").then((e=>(t.fh=e,e.stat().then((e=>{t.size=e.size}))))),read:(e,r)=>l(t.fh,e,r),view:(e,r)=>l(t.fh,e,r).then(h),size:()=>t.size,close:()=>t.fh?t.fh.close():Promise.resolve(),path:u.resolve(e)}},t.blob=function(e){const t={offset:0,position:0,size:0};return{open:()=>e.arrayBuffer().then((e=>{t.array=e,t.offset=0,t.position=0,t.size=e.byteLength})),close:()=>Promise.resolve(),size:()=>t.size,read:(e,r)=>c(t,e,r),view:(e,r)=>c(t,e,r).then(h)}}},2524:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isRelocationSection=t.isSymbolSection=t.isStringSection=t.readSectionHeaderEntries=void 0;const n=r(8744),o=r(1228),i=r(4435),a=r(5501);function s(e,t){let r=e[t];if(!r)for(const n in e){const o=parseInt(n);if(o<t){const n=e[o];if(o+n.length>t){r=n.substr(t-o);break}}}return r}async function u(e,t,r){const n=await e.read(Number(r),Number(t));let o=0;const i={};for(let e=0;e<r;e++)if(0==n[e]){const t=e-o;t>0&&(i[o]=(0,a.decode)(n,o,t)),o=e+1}return i}async function c(e,t,r,n,a,s){await e.size();const u=(0,i.divide)(r,n);const c=[];for(let r=0;r<u;r++){const i=await e.view(n,t+r*n),u=i.getUint8.bind(i),l=e=>i.getUint16(e,!a),f=e=>i.getUint32(e,!a),h=e=>i.getBigUint64(e,!a);let d,p,m,g,y,v,w=0;32==s?(d=f(w),w+=4,y=f(w),w+=4,v=f(w),w+=4,p=u(w),w+=1,m=u(w),w+=1,g=l(w),w+=2):(d=f(w),w+=4,p=u(w),w+=1,m=u(w),w+=1,g=l(w),w+=2,y=h(w),w+=8,v=Number(h(w)),w+=8);const b=15&p,E=p>>4,_=3&m;c[r]={nameix:d,name:"",info:p,other:m,shndx:g,value:y,size:v,type:b,binding:E,visibility:_,typeDescription:(0,o.symbolTypeToString)(b),bindingDescription:(0,o.symbolBindingToString)(E),visibilityDescription:(0,o.symbolVisibilityToString)(_)}}return c}async function l(e,t,r,n,o,a,s){await e.size();const u=(0,i.toNumberSafe)((0,i.divide)(r,n));const c=new Array(u);for(let r=0;r<u;r++){const u=await e.view(n,t+r*n),l=e=>u.getUint32(e,!o),f=e=>u.getBigUint64(e,!o),h=e=>u.getInt32(e,!o),d=e=>u.getBigInt64(e,!o);let p,m,g,y,v,w=0;32==a?(p=l(w),w+=4,m=l(w),w+=4,s&&(v=h(w),w+=4),g=m>>8,y=255&m):(p=f(w),w+=8,m=f(w),w+=8,s&&(v=d(w),w+=8),g=(0,i.toNumberSafe)(m>>BigInt(32)),y=(0,i.toNumberSafe)(m&BigInt(4294967295))),c[r]={addr:p,info:m,addend:v,symbolIndex:g,type:y}}return c}function f(e,t){if(t)for(let r=0;r<e.length;r++)e[r].name=s(t,e[r].nameix)||""}function h(e){return(null==e?void 0:e.type)===n.SectionHeaderEntryType.StrTab}function d(e){return(null==e?void 0:e.type)===n.SectionHeaderEntryType.DynSym||(null==e?void 0:e.type)===n.SectionHeaderEntryType.SymTab}function p(e){return(null==e?void 0:e.type)===n.SectionHeaderEntryType.Rel||(null==e?void 0:e.type)===n.SectionHeaderEntryType.Rela}t.readSectionHeaderEntries=async function(e,t,r,a,m,g,y,v){if(0==a)return[];const w=new Array(a);for(let n=0;n<a;n++){const a=await e.view(r,Number(t)+n*Number(r)),s=e=>a.getUint32(e,!g),u=e=>a.getBigUint64(e,!g),c=s(0),l=s(4);let f,h,d,p,y,v,b,E,_=8;32==m?(f=s(_),_+=4,h=s(_),_+=4,d=s(_),_+=4,p=s(_),_+=4,y=s(_),_+=4,v=s(_),_+=4,b=s(_),_+=4,E=s(_),_+=4):(f=(0,i.toNumberSafe)(u(_)),_+=8,h=u(_),_+=8,d=(0,i.toNumberSafe)(u(_)),_+=8,p=(0,i.toNumberSafe)(u(_)),_+=8,y=s(_),_+=4,v=s(_),_+=4,b=(0,i.toNumberSafe)(u(_)),_+=8,E=(0,i.toNumberSafe)(u(_)),_+=8);const S={index:n,name:"",nameix:c,type:l,typeDescription:(0,o.sectionHeaderEntryTypeToString)(l),flags:f,flagsDescription:(0,o.sectionFlagsToString)(f),addr:h,offset:d,size:p,link:y,info:v,addralign:b,entsize:E};w[n]=S}for(const t of w)if(h(t)){const{size:r,offset:n}=t;t.strings=await u(e,n,r)}for(const t of w){if(d(t)){const{size:r,offset:n,entsize:o,link:i}=t;if(t.symbols=await c(e,n,r,o,g,m),i>=0&&i<w.length){const e=w[i];h(e)&&f(t.symbols,e.strings)}}if(p(t)){const{size:r,offset:o,entsize:i}=t;t.relocations=await l(e,o,r,i,g,m,t.type===n.SectionHeaderEntryType.Rela)}}return function(e,t){if(t<e.length){const r=e[t];if(h(r)){const t=r.strings;t&&e.forEach((e=>{if(0==e.nameix)e.name="<null>";else{const r=s(t,e.nameix);r&&(e.name=r)}}))}}}(w,y),w},t.isStringSection=h,t.isSymbolSection=d,t.isRelocationSection=p},8533:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.readProgramHeaderEntries=void 0;const n=r(1228),o=r(4435);t.readProgramHeaderEntries=async function(e,t,r,i,a,s){if(0==i)return[];const u=new Array(i);for(let c=0;c<i;c++){const i=await e.view(r,Number(t)+c*Number(r)),l=e=>i.getUint32(e,!s),f=e=>i.getBigUint64(e,!s),h=l(0);let d,p,m,g,y,v,w,b=4;32==a?(p=l(b),b+=4,m=l(b),b+=4,g=l(b),b+=4,y=l(b),b+=4,v=l(b),b+=4,d=l(b),b+=4,w=l(b),b+=4):(d=l(b),b+=4,p=(0,o.toNumberSafe)(f(b)),b+=8,m=f(b),b+=8,g=f(b),b+=8,y=(0,o.toNumberSafe)(f(b)),b+=8,v=(0,o.toNumberSafe)(f(b)),b+=8,w=(0,o.toNumberSafe)(f(b)),b+=8),u[c]={index:c,type:h,typeDescription:(0,n.programHeaderEntryTypeToString)(h),flags:d,flagsDescription:(0,n.programHeaderFlagsToString)(d),offset:p,vaddr:m,paddr:g,filesz:y,memsz:v,align:w}}return u}},1228:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.symbolVisibilityToString=t.symbolBindingToString=t.symbolTypeToString=t.elfFlagsToString=t.programHeaderFlagsToString=t.sectionFlagsToString=t.sectionHeaderEntryTypeToString=t.programHeaderEntryTypeToString=t.objectTypeToString=t.abiToString=t.isaToString=void 0;const n=r(8744);t.isaToString=function(e){switch(e){case n.ISA.None:return"No machine";case n.ISA.M32:return"AT&T WE 32100";case n.ISA.SPARC:return"SUN SPARC";case n.ISA.x86:return"Intel x86";case n.ISA.ISA68K:return"Motorola m68k family";case n.ISA.ISA88K:return"Motorola m88k family";case n.ISA.IAMCU:return"Intel MCU";case n.ISA.ISA860:return"Intel 80860";case n.ISA.MIPS:return"MIPS R3000 big-endian";case n.ISA.S370:return"IBM System/370";case n.ISA.MIPS_RS3_LE:return"MIPS R3000 little-endian";case n.ISA.PARISC:return"HPPA";case n.ISA.VPP500:return"Fujitsu VPP500";case n.ISA.SPARC32PLUS:return'Sun\'s "v8plus"';case n.ISA.ISA960:return"Intel 80960";case n.ISA.PPC:return"PowerPC";case n.ISA.PPC64:return"PowerPC 64-bit";case n.ISA.S390:return"IBM S390";case n.ISA.SPU:return"IBM SPU/SPC";case n.ISA.V800:return"NEC V800 series";case n.ISA.FR20:return"Fujitsu FR20";case n.ISA.RH32:return"TRW RH-32";case n.ISA.RCE:return"Motorola RCE";case n.ISA.ARM:return"ARM";case n.ISA.FAKE_ALPHA:return"Digital Alpha";case n.ISA.SH:return"Hitachi SH";case n.ISA.SPARCV9:return"SPARC v9 64-bit";case n.ISA.TRICORE:return"Siemens Tricore";case n.ISA.ARC:return"Argonaut RISC Core";case n.ISA.H8_300:return"Hitachi H8/300";case n.ISA.H8_300H:return"Hitachi H8/300H";case n.ISA.H8S:return"Hitachi H8S";case n.ISA.H8_500:return"Hitachi H8/500";case n.ISA.IA_64:return"Intel Merced";case n.ISA.MIPS_X:return"Stanford MIPS-X";case n.ISA.COLDFIRE:return"Motorola Coldfire";case n.ISA.ISA68HC12:return"Motorola M68HC12";case n.ISA.MMA:return"Fujitsu MMA Multimedia Accelerator";case n.ISA.PCP:return"Siemens PCP";case n.ISA.NCPU:return"Sony nCPU embeeded RISC";case n.ISA.NDR1:return"Denso NDR1 microprocessor";case n.ISA.STARCORE:return"Motorola Start*Core processor";case n.ISA.ME16:return"Toyota ME16 processor";case n.ISA.ST100:return"STMicroelectronic ST100 processor";case n.ISA.TINYJ:return"Advanced Logic Corp. Tinyj emb.fam";case n.ISA.X86_64:return"AMD x86-64 architecture";case n.ISA.PDSP:return"Sony DSP Processor";case n.ISA.PDP10:return"Digital PDP-10";case n.ISA.PDP11:return"Digital PDP-11";case n.ISA.FX66:return"Siemens FX66 microcontroller";case n.ISA.ST9PLUS:return"STMicroelectronics ST9+ 8/16 mc";case n.ISA.ST7:return"STmicroelectronics ST7 8 bit mc";case n.ISA.ISA68HC16:return"Motorola MC68HC16 microcontroller";case n.ISA.ISA68HC11:return"Motorola MC68HC11 microcontroller";case n.ISA.ISA68HC08:return"Motorola MC68HC08 microcontroller";case n.ISA.ISA68HC05:return"Motorola MC68HC05 microcontroller";case n.ISA.SVX:return"Silicon Graphics SVx";case n.ISA.ST19:return"STMicroelectronics ST19 8 bit mc";case n.ISA.VAX:return"Digital VAX";case n.ISA.CRIS:return"Axis Communications 32-bit emb.proc";case n.ISA.JAVELIN:return"Infineon Technologies 32-bit emb.proc";case n.ISA.FIREPATH:return"Element 14 64-bit DSP Processor";case n.ISA.ZSP:return"LSI Logic 16-bit DSP Processor";case n.ISA.MMIX:return"Donald Knuth's educational 64-bit proc";case n.ISA.HUANY:return"Harvard University machine-independent object files";case n.ISA.PRISM:return"SiTera Prism";case n.ISA.AVR:return"Atmel AVR 8-bit microcontroller";case n.ISA.FR30:return"Fujitsu FR30";case n.ISA.D10V:return"Mitsubishi D10V";case n.ISA.D30V:return"Mitsubishi D30V";case n.ISA.V850:return"NEC v850";case n.ISA.M32R:return"Mitsubishi M32R";case n.ISA.MN10300:return"Matsushita MN10300";case n.ISA.MN10200:return"Matsushita MN10200";case n.ISA.PJ:return"picoJava";case n.ISA.OPENRISC:return"OpenRISC 32-bit embedded processor";case n.ISA.ARC_COMPACT:return"ARC International ARCompact";case n.ISA.XTENSA:return"Tensilica Xtensa Architecture";case n.ISA.VIDEOCORE:return"Alphamosaic VideoCore";case n.ISA.TMM_GPP:return"Thompson Multimedia General Purpose Proc";case n.ISA.NS32K:return"National Semi. 32000";case n.ISA.TPC:return"Tenor Network TPC";case n.ISA.SNP1K:return"Trebia SNP 1000";case n.ISA.ST200:return"STMicroelectronics ST200";case n.ISA.IP2K:return"Ubicom IP2xxx";case n.ISA.MAX:return"MAX processor";case n.ISA.CR:return"National Semi. CompactRISC";case n.ISA.F2MC16:return"Fujitsu F2MC16";case n.ISA.MSP430:return"Texas Instruments msp430";case n.ISA.BLACKFIN:return"Analog Devices Blackfin DSP";case n.ISA.SE_C33:return"Seiko Epson S1C33 family";case n.ISA.SEP:return"Sharp embedded microprocessor";case n.ISA.ARCA:return"Arca RISC";case n.ISA.UNICORE:return"PKU-Unity & MPRC Peking Uni. mc series";case n.ISA.EXCESS:return"eXcess configurable cpu";case n.ISA.DXP:return"Icera Semi. Deep Execution Processor";case n.ISA.ALTERA_NIOS2:return"Altera Nios II";case n.ISA.CRX:return"National Semi. CompactRISC CRX";case n.ISA.XGATE:return"Motorola XGATE";case n.ISA.C166:return"Infineon C16x/XC16x";case n.ISA.M16C:return"Renesas M16C";case n.ISA.DSPIC30F:return"Microchip Technology dsPIC30F";case n.ISA.CE:return"Freescale Communication Engine RISC";case n.ISA.M32C:return"Renesas M32C";case n.ISA.TSK3000:return"Altium TSK3000";case n.ISA.RS08:return"Freescale RS08";case n.ISA.SHARC:return"Analog Devices SHARC family";case n.ISA.ECOG2:return"Cyan Technology eCOG2";case n.ISA.SCORE7:return"Sunplus S+core7 RISC";case n.ISA.DSP24:return"New Japan Radio (NJR) 24-bit DSP";case n.ISA.VIDEOCORE3:return"Broadcom VideoCore III";case n.ISA.LATTICEMICO32:return"RISC for Lattice FPGA";case n.ISA.SE_C17:return"Seiko Epson C17";case n.ISA.TI_C6000:return"Texas Instruments TMS320C6000 DSP";case n.ISA.TI_C2000:return"Texas Instruments TMS320C2000 DSP";case n.ISA.TI_C5500:return"Texas Instruments TMS320C55x DSP";case n.ISA.TI_ARP32:return"Texas Instruments App. Specific RISC";case n.ISA.TI_PRU:return"Texas Instruments Prog. Realtime Unit";case n.ISA.MMDSP_PLUS:return"STMicroelectronics 64bit VLIW DSP";case n.ISA.CYPRESS_M8C:return"Cypress M8C";case n.ISA.R32C:return"Renesas R32C";case n.ISA.TRIMEDIA:return"NXP Semi. TriMedia";case n.ISA.QDSP6:return"QUALCOMM DSP6";case n.ISA.ISA8051:return"Intel 8051 and variants";case n.ISA.STXP7X:return"STMicroelectronics STxP7x";case n.ISA.NDS32:return"Andes Tech. compact code emb. RISC";case n.ISA.ECOG1X:return"Cyan Technology eCOG1X";case n.ISA.MAXQ30:return"Dallas Semi. MAXQ30 mc";case n.ISA.XIMO16:return"New Japan Radio (NJR) 16-bit DSP";case n.ISA.MANIK:return"M2000 Reconfigurable RISC";case n.ISA.CRAYNV2:return"Cray NV2 vector architecture";case n.ISA.RX:return"Renesas RX";case n.ISA.METAG:return"Imagination Tech. META";case n.ISA.MCST_ELBRUS:return"MCST Elbrus";case n.ISA.ECOG16:return"Cyan Technology eCOG16";case n.ISA.CR16:return"National Semi. CompactRISC CR16";case n.ISA.ETPU:return"Freescale Extended Time Processing Unit";case n.ISA.SLE9X:return"Infineon Tech. SLE9X";case n.ISA.L10M:return"Intel L10M";case n.ISA.K10M:return"Intel K10M";case n.ISA.AARCH64:return"ARM AARCH64";case n.ISA.AVR32:return"Amtel 32-bit microprocessor";case n.ISA.STM8:return"STMicroelectronics STM8";case n.ISA.TILE64:return"Tileta TILE64";case n.ISA.TILEPRO:return"Tilera TILEPro";case n.ISA.MICROBLAZE:return"Xilinx MicroBlaze";case n.ISA.CUDA:return"NVIDIA CUDA";case n.ISA.TILEGX:return"Tilera TILE-Gx";case n.ISA.CLOUDSHIELD:return"CloudShield";case n.ISA.COREA_1ST:return"KIPO-KAIST Core-A 1st gen.";case n.ISA.COREA_2ND:return"KIPO-KAIST Core-A 2nd gen.";case n.ISA.ARC_COMPACT2:return"Synopsys ARCompact V2";case n.ISA.OPEN8:return"Open8 RISC";case n.ISA.RL78:return"Renesas RL78";case n.ISA.VIDEOCORE5:return"Broadcom VideoCore V";case n.ISA.ISA78KOR:return"Renesas 78KOR";case n.ISA.ISA56800EX:return"Freescale 56800EX DSC";case n.ISA.BA1:return"Beyond BA1";case n.ISA.BA2:return"Beyond BA2";case n.ISA.XCORE:return"XMOS xCORE";case n.ISA.MCHP_PIC:return"Microchip 8-bit PIC(r)";case n.ISA.KM32:return"KM211 KM32";case n.ISA.KMX32:return"KM211 KMX32";case n.ISA.EMX16:return"KM211 KMX16";case n.ISA.EMX8:return"KM211 KMX8";case n.ISA.KVARC:return"KM211 KVARC";case n.ISA.CDP:return"Paneve CDP";case n.ISA.COGE:return"Cognitive Smart Memory Processor";case n.ISA.COOL:return"Bluechip CoolEngine";case n.ISA.NORC:return"Nanoradio Optimized RISC";case n.ISA.CSR_KALIMBA:return"CSR Kalimba";case n.ISA.Z80:return"Zilog Z80";case n.ISA.VISIUM:return"Controls and Data Services VISIUMcore";case n.ISA.FT32:return"FTDI Chip FT32";case n.ISA.MOXIE:return"Moxie processor";case n.ISA.AMDGPU:return"AMD GPU";case n.ISA.RISCV:return"RISC-V";case n.ISA.BPF:return"Linux BPF";case n.ISA.CSKY:return"C-SKY"}},t.abiToString=function(e){switch(e){case n.ABI.GNUHurd:return"GNU Hurd";case n.ABI.NovelloModesto:return"Novello Modesto";case n.ABI.HPUX:return"HP-UX";case n.ABI.NonStopKernel:return"NonStop Kernel";case n.ABI.FenixOS:return"Fenix OS";case n.ABI.ARMEABI:return"ARM EABI";default:return n.ABI[e]||e.toString()}},t.objectTypeToString=function(e){return n.ObjectType[e]||e.toString()},t.programHeaderEntryTypeToString=function(e){switch(e){case n.ProgramHeaderEntryType.ProgramHeaderTable:return"Program Header Table";case n.ProgramHeaderEntryType.GnuEhFrame:return"GNU EH frame";case n.ProgramHeaderEntryType.GnuStack:return"GNU stack info";case n.ProgramHeaderEntryType.GnuRelRo:return"GNU ro relocation";default:return n.ProgramHeaderEntryType[e]||e.toString()}},t.sectionHeaderEntryTypeToString=function(e){switch(e){case n.SectionHeaderEntryType.Null:return"NULL";case n.SectionHeaderEntryType.ProgBits:return"Prog bits";case n.SectionHeaderEntryType.SymTab:return"Symbol table";case n.SectionHeaderEntryType.StrTab:return"String table";case n.SectionHeaderEntryType.Rela:return"Relocation with addends";case n.SectionHeaderEntryType.Hash:return"Symbol hash table";case n.SectionHeaderEntryType.Dynamic:return"Dynamic";case n.SectionHeaderEntryType.Note:return"Note";case n.SectionHeaderEntryType.NoBits:return"No bits";case n.SectionHeaderEntryType.Rel:return"Relocation";case n.SectionHeaderEntryType.ShLib:return"ShLib";case n.SectionHeaderEntryType.DynSym:return"Dynamic linking symbols";case n.SectionHeaderEntryType.InitArray:return"Init array";case n.SectionHeaderEntryType.FiniArray:return"Fini array";case n.SectionHeaderEntryType.PreInitArray:return"Pre-init array";case n.SectionHeaderEntryType.Group:return"Section group";case n.SectionHeaderEntryType.ShNdx:return"Extended symbol table index";case n.SectionHeaderEntryType.Num:return"Num";case n.SectionHeaderEntryType.GnuAttributes:return"GNU object attributes";case n.SectionHeaderEntryType.GnuHash:return"GNU hash";case n.SectionHeaderEntryType.GnuLibList:return"GNU pre-link library list";case n.SectionHeaderEntryType.GnuVerDef:return"GNU version definition";case n.SectionHeaderEntryType.GnuVerNeed:return"GNU version needs";case n.SectionHeaderEntryType.GnuVerSym:return"GNU version symbol table";default:return n.SectionHeaderEntryType[e]||Number(e).toString()}},t.sectionFlagsToString=function(e){let t=[];return 1&(e=Number(e))&&t.push("Writeable"),2&e&&t.push("Alloc"),4&e&&t.push("Executable"),16&e&&t.push("Merge"),32&e&&t.push("Strings"),64&e&&t.push("Info Link"),128&e&&t.push("Link Order"),256&e&&t.push("Nonconforming"),512&e&&t.push("Group"),1024&e&&t.push("Thread Local Storage"),67108864&e&&t.push("Special ordering"),134217728&e&&t.push("Exclude"),0==t.length?"<none>":t.join(" | ")},t.programHeaderFlagsToString=function(e){let t=[];return 4&e&&t.push("Read"),2&e&&t.push("Write"),1&e&&t.push("Execute"),t.join(" | ")},t.elfFlagsToString=function(e,t){if(e===n.ISA.ARM){const e=(4278190080&t)>>24;let r=[`Version: ${e}`];return 8388608&t&&r.push("BE-8"),e<=4&&4194304&t&&r.push("Legacy"),e>=5&&1024&t&&r.push("Hard Float"),e>=5&&512&t&&r.push("Soft Float"),r.join(" | ")}return t.toString()},t.symbolTypeToString=function(e){switch(e){case n.SymbolType.RelocationExpression:return"Relocation Expression";case n.SymbolType.SignedRelocationExpression:return"Signed Relocation Expression";case n.SymbolType.ThreadLocalStorage:return"Thread Local Storage";default:return n.SymbolType[e]||e.toString()}},t.symbolBindingToString=function(e){return n.SymbolBinding[e]||e.toString()},t.symbolVisibilityToString=function(e){return n.SymbolVisibility[e]||e.toString()}},8744:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SymbolVisibility=t.SymbolBinding=t.SymbolType=t.SectionHeaderEntryType=t.ProgramHeaderEntryType=t.ObjectType=t.ABI=t.ISA=void 0,function(e){e[e.None=0]="None",e[e.M32=1]="M32",e[e.SPARC=2]="SPARC",e[e.x86=3]="x86",e[e.ISA68K=4]="ISA68K",e[e.ISA88K=5]="ISA88K",e[e.IAMCU=6]="IAMCU",e[e.ISA860=7]="ISA860",e[e.MIPS=8]="MIPS",e[e.S370=9]="S370",e[e.MIPS_RS3_LE=10]="MIPS_RS3_LE",e[e.PARISC=15]="PARISC",e[e.VPP500=17]="VPP500",e[e.SPARC32PLUS=18]="SPARC32PLUS",e[e.ISA960=19]="ISA960",e[e.PPC=20]="PPC",e[e.PPC64=21]="PPC64",e[e.S390=22]="S390",e[e.SPU=23]="SPU",e[e.V800=36]="V800",e[e.FR20=37]="FR20",e[e.RH32=38]="RH32",e[e.RCE=39]="RCE",e[e.ARM=40]="ARM",e[e.FAKE_ALPHA=41]="FAKE_ALPHA",e[e.SH=42]="SH",e[e.SPARCV9=43]="SPARCV9",e[e.TRICORE=44]="TRICORE",e[e.ARC=45]="ARC",e[e.H8_300=46]="H8_300",e[e.H8_300H=47]="H8_300H",e[e.H8S=48]="H8S",e[e.H8_500=49]="H8_500",e[e.IA_64=50]="IA_64",e[e.MIPS_X=51]="MIPS_X",e[e.COLDFIRE=52]="COLDFIRE",e[e.ISA68HC12=53]="ISA68HC12",e[e.MMA=54]="MMA",e[e.PCP=55]="PCP",e[e.NCPU=56]="NCPU",e[e.NDR1=57]="NDR1",e[e.STARCORE=58]="STARCORE",e[e.ME16=59]="ME16",e[e.ST100=60]="ST100",e[e.TINYJ=61]="TINYJ",e[e.X86_64=62]="X86_64",e[e.PDSP=63]="PDSP",e[e.PDP10=64]="PDP10",e[e.PDP11=65]="PDP11",e[e.FX66=66]="FX66",e[e.ST9PLUS=67]="ST9PLUS",e[e.ST7=68]="ST7",e[e.ISA68HC16=69]="ISA68HC16",e[e.ISA68HC11=70]="ISA68HC11",e[e.ISA68HC08=71]="ISA68HC08",e[e.ISA68HC05=72]="ISA68HC05",e[e.SVX=73]="SVX",e[e.ST19=74]="ST19",e[e.VAX=75]="VAX",e[e.CRIS=76]="CRIS",e[e.JAVELIN=77]="JAVELIN",e[e.FIREPATH=78]="FIREPATH",e[e.ZSP=79]="ZSP",e[e.MMIX=80]="MMIX",e[e.HUANY=81]="HUANY",e[e.PRISM=82]="PRISM",e[e.AVR=83]="AVR",e[e.FR30=84]="FR30",e[e.D10V=85]="D10V",e[e.D30V=86]="D30V",e[e.V850=87]="V850",e[e.M32R=88]="M32R",e[e.MN10300=89]="MN10300",e[e.MN10200=90]="MN10200",e[e.PJ=91]="PJ",e[e.OPENRISC=92]="OPENRISC",e[e.ARC_COMPACT=93]="ARC_COMPACT",e[e.XTENSA=94]="XTENSA",e[e.VIDEOCORE=95]="VIDEOCORE",e[e.TMM_GPP=96]="TMM_GPP",e[e.NS32K=97]="NS32K",e[e.TPC=98]="TPC",e[e.SNP1K=99]="SNP1K",e[e.ST200=100]="ST200",e[e.IP2K=101]="IP2K",e[e.MAX=102]="MAX",e[e.CR=103]="CR",e[e.F2MC16=104]="F2MC16",e[e.MSP430=105]="MSP430",e[e.BLACKFIN=106]="BLACKFIN",e[e.SE_C33=107]="SE_C33",e[e.SEP=108]="SEP",e[e.ARCA=109]="ARCA",e[e.UNICORE=110]="UNICORE",e[e.EXCESS=111]="EXCESS",e[e.DXP=112]="DXP",e[e.ALTERA_NIOS2=113]="ALTERA_NIOS2",e[e.CRX=114]="CRX",e[e.XGATE=115]="XGATE",e[e.C166=116]="C166",e[e.M16C=117]="M16C",e[e.DSPIC30F=118]="DSPIC30F",e[e.CE=119]="CE",e[e.M32C=120]="M32C",e[e.TSK3000=131]="TSK3000",e[e.RS08=132]="RS08",e[e.SHARC=133]="SHARC",e[e.ECOG2=134]="ECOG2",e[e.SCORE7=135]="SCORE7",e[e.DSP24=136]="DSP24",e[e.VIDEOCORE3=137]="VIDEOCORE3",e[e.LATTICEMICO32=138]="LATTICEMICO32",e[e.SE_C17=139]="SE_C17",e[e.TI_C6000=140]="TI_C6000",e[e.TI_C2000=141]="TI_C2000",e[e.TI_C5500=142]="TI_C5500",e[e.TI_ARP32=143]="TI_ARP32",e[e.TI_PRU=144]="TI_PRU",e[e.MMDSP_PLUS=160]="MMDSP_PLUS",e[e.CYPRESS_M8C=161]="CYPRESS_M8C",e[e.R32C=162]="R32C",e[e.TRIMEDIA=163]="TRIMEDIA",e[e.QDSP6=164]="QDSP6",e[e.ISA8051=165]="ISA8051",e[e.STXP7X=166]="STXP7X",e[e.NDS32=167]="NDS32",e[e.ECOG1X=168]="ECOG1X",e[e.MAXQ30=169]="MAXQ30",e[e.XIMO16=170]="XIMO16",e[e.MANIK=171]="MANIK",e[e.CRAYNV2=172]="CRAYNV2",e[e.RX=173]="RX",e[e.METAG=174]="METAG",e[e.MCST_ELBRUS=175]="MCST_ELBRUS",e[e.ECOG16=176]="ECOG16",e[e.CR16=177]="CR16",e[e.ETPU=178]="ETPU",e[e.SLE9X=179]="SLE9X",e[e.L10M=180]="L10M",e[e.K10M=181]="K10M",e[e.AARCH64=183]="AARCH64",e[e.AVR32=185]="AVR32",e[e.STM8=186]="STM8",e[e.TILE64=187]="TILE64",e[e.TILEPRO=188]="TILEPRO",e[e.MICROBLAZE=189]="MICROBLAZE",e[e.CUDA=190]="CUDA",e[e.TILEGX=191]="TILEGX",e[e.CLOUDSHIELD=192]="CLOUDSHIELD",e[e.COREA_1ST=193]="COREA_1ST",e[e.COREA_2ND=194]="COREA_2ND",e[e.ARC_COMPACT2=195]="ARC_COMPACT2",e[e.OPEN8=196]="OPEN8",e[e.RL78=197]="RL78",e[e.VIDEOCORE5=198]="VIDEOCORE5",e[e.ISA78KOR=199]="ISA78KOR",e[e.ISA56800EX=200]="ISA56800EX",e[e.BA1=201]="BA1",e[e.BA2=202]="BA2",e[e.XCORE=203]="XCORE",e[e.MCHP_PIC=204]="MCHP_PIC",e[e.KM32=210]="KM32",e[e.KMX32=211]="KMX32",e[e.EMX16=212]="EMX16",e[e.EMX8=213]="EMX8",e[e.KVARC=214]="KVARC",e[e.CDP=215]="CDP",e[e.COGE=216]="COGE",e[e.COOL=217]="COOL",e[e.NORC=218]="NORC",e[e.CSR_KALIMBA=219]="CSR_KALIMBA",e[e.Z80=220]="Z80",e[e.VISIUM=221]="VISIUM",e[e.FT32=222]="FT32",e[e.MOXIE=223]="MOXIE",e[e.AMDGPU=224]="AMDGPU",e[e.RISCV=243]="RISCV",e[e.BPF=247]="BPF",e[e.CSKY=252]="CSKY"}(t.ISA||(t.ISA={})),function(e){e[e.SystemV=0]="SystemV",e[e.HPUX=1]="HPUX",e[e.NetBSD=2]="NetBSD",e[e.Linux=3]="Linux",e[e.GNUHurd=4]="GNUHurd",e[e.Solaris=6]="Solaris",e[e.AIX=7]="AIX",e[e.IRIX=8]="IRIX",e[e.FreeBSD=9]="FreeBSD",e[e.Tru64=10]="Tru64",e[e.NovelloModesto=11]="NovelloModesto",e[e.OpenBSD=12]="OpenBSD",e[e.OpenVMS=13]="OpenVMS",e[e.NonStopKernel=14]="NonStopKernel",e[e.AROS=15]="AROS",e[e.FenixOS=16]="FenixOS",e[e.CloudABI=17]="CloudABI",e[e.ARMEABI=64]="ARMEABI",e[e.ARM=97]="ARM",e[e.Standalone=255]="Standalone"}(t.ABI||(t.ABI={})),function(e){e[e.None=0]="None",e[e.Relocatable=1]="Relocatable",e[e.Executable=2]="Executable",e[e.Shared=3]="Shared",e[e.Core=4]="Core"}(t.ObjectType||(t.ObjectType={})),function(e){e[e.Null=0]="Null",e[e.Load=1]="Load",e[e.Dynamic=2]="Dynamic",e[e.Interp=3]="Interp",e[e.Note=4]="Note",e[e.ShLib=5]="ShLib",e[e.ProgramHeaderTable=6]="ProgramHeaderTable",e[e.GnuEhFrame=1685382480]="GnuEhFrame",e[e.GnuStack=1685382481]="GnuStack",e[e.GnuRelRo=1685382482]="GnuRelRo"}(t.ProgramHeaderEntryType||(t.ProgramHeaderEntryType={})),function(e){e[e.Null=0]="Null",e[e.ProgBits=1]="ProgBits",e[e.SymTab=2]="SymTab",e[e.StrTab=3]="StrTab",e[e.Rela=4]="Rela",e[e.Hash=5]="Hash",e[e.Dynamic=6]="Dynamic",e[e.Note=7]="Note",e[e.NoBits=8]="NoBits",e[e.Rel=9]="Rel",e[e.ShLib=10]="ShLib",e[e.DynSym=11]="DynSym",e[e.InitArray=14]="InitArray",e[e.FiniArray=15]="FiniArray",e[e.PreInitArray=16]="PreInitArray",e[e.Group=17]="Group",e[e.ShNdx=18]="ShNdx",e[e.Num=19]="Num",e[e.GnuAttributes=1879048181]="GnuAttributes",e[e.GnuHash=1879048182]="GnuHash",e[e.GnuLibList=1879048183]="GnuLibList",e[e.GnuVerDef=1879048189]="GnuVerDef",e[e.GnuVerNeed=1879048190]="GnuVerNeed",e[e.GnuVerSym=1879048191]="GnuVerSym"}(t.SectionHeaderEntryType||(t.SectionHeaderEntryType={})),function(e){e[e.None=0]="None",e[e.Object=1]="Object",e[e.Function=2]="Function",e[e.Section=3]="Section",e[e.File=4]="File",e[e.Common=5]="Common",e[e.ThreadLocalStorage=6]="ThreadLocalStorage",e[e.RelocationExpression=7]="RelocationExpression",e[e.SignedRelocationExpression=8]="SignedRelocationExpression"}(t.SymbolType||(t.SymbolType={})),function(e){e[e.Local=0]="Local",e[e.Global=1]="Global",e[e.Weak=2]="Weak"}(t.SymbolBinding||(t.SymbolBinding={})),function(e){e[e.Default=0]="Default",e[e.Internal=1]="Internal",e[e.Hidden=2]="Hidden",e[e.Protected=3]="Protected"}(t.SymbolVisibility||(t.SymbolVisibility={}))},9397:(e,t)=>{!function(e){var t=/\S/,r=/\"/g,n=/\n/g,o=/\r/g,i=/\\/g,a=/\u2028/,s=/\u2029/;function u(e){"}"===e.n.substr(e.n.length-1)&&(e.n=e.n.substring(0,e.n.length-1))}function c(e){return e.trim?e.trim():e.replace(/^\s*|\s*$/g,"")}function l(e,t,r){if(t.charAt(r)!=e.charAt(0))return!1;for(var n=1,o=e.length;n<o;n++)if(t.charAt(r+n)!=e.charAt(n))return!1;return!0}e.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},e.scan=function(r,n){var o=r.length,i=0,a=null,s=null,f="",h=[],d=!1,p=0,m=0,g="{{",y="}}";function v(){f.length>0&&(h.push({tag:"_t",text:new String(f)}),f="")}function w(r,n){if(v(),r&&function(){for(var r=!0,n=m;n<h.length;n++)if(!(r=e.tags[h[n].tag]<e.tags._v||"_t"==h[n].tag&&null===h[n].text.match(t)))return!1;return r}())for(var o,i=m;i<h.length;i++)h[i].text&&((o=h[i+1])&&">"==o.tag&&(o.indent=h[i].text.toString()),h.splice(i,1));else n||h.push({tag:"\n"});d=!1,m=h.length}function b(e,t){var r="="+y,n=e.indexOf(r,t),o=c(e.substring(e.indexOf("=",t)+1,n)).split(" ");return g=o[0],y=o[o.length-1],n+r.length-1}for(n&&(n=n.split(" "),g=n[0],y=n[1]),p=0;p<o;p++)0==i?l(g,r,p)?(--p,v(),i=1):"\n"==r.charAt(p)?w(d):f+=r.charAt(p):1==i?(p+=g.length-1,"="==(a=(s=e.tags[r.charAt(p+1)])?r.charAt(p+1):"_v")?(p=b(r,p),i=0):(s&&p++,i=2),d=p):l(y,r,p)?(h.push({tag:a,n:c(f),otag:g,ctag:y,i:"/"==a?d-g.length:p+y.length}),f="",p+=y.length-1,i=0,"{"==a&&("}}"==y?p++:u(h[h.length-1]))):f+=r.charAt(p);return w(d,!0),h};var f={_t:!0,"\n":!0,$:!0,"/":!0};function h(t,r,n,o){var i,a=[],s=null,u=null;for(i=n[n.length-1];t.length>0;){if(u=t.shift(),i&&"<"==i.tag&&!(u.tag in f))throw new Error("Illegal content in < super tag.");if(e.tags[u.tag]<=e.tags.$||d(u,o))n.push(u),u.nodes=h(t,u.tag,n,o);else{if("/"==u.tag){if(0===n.length)throw new Error("Closing tag without opener: /"+u.n);if(s=n.pop(),u.n!=s.n&&!p(u.n,s.n,o))throw new Error("Nesting error: "+s.n+" vs. "+u.n);return s.end=u.i,a}"\n"==u.tag&&(u.last=0==t.length||"\n"==t[0].tag)}a.push(u)}if(n.length>0)throw new Error("missing closing tag: "+n.pop().n);return a}function d(e,t){for(var r=0,n=t.length;r<n;r++)if(t[r].o==e.n)return e.tag="#",!0}function p(e,t,r){for(var n=0,o=r.length;n<o;n++)if(r[n].c==e&&r[n].o==t)return!0}function m(e){var t=[];for(var r in e.partials)t.push('"'+y(r)+'":{name:"'+y(e.partials[r].name)+'", '+m(e.partials[r])+"}");return"partials: {"+t.join(",")+"}, subs: "+function(e){var t=[];for(var r in e)t.push('"'+y(r)+'": function(c,p,t,i) {'+e[r]+"}");return"{ "+t.join(",")+" }"}(e.subs)}e.stringify=function(t,r,n){return"{code: function (c,p,i) { "+e.wrapMain(t.code)+" },"+m(t)+"}"};var g=0;function y(e){return e.replace(i,"\\\\").replace(r,'\\"').replace(n,"\\n").replace(o,"\\r").replace(a,"\\u2028").replace(s,"\\u2029")}function v(e){return~e.indexOf(".")?"d":"f"}function w(e,t){var r="<"+(t.prefix||"")+e.n+g++;return t.partials[r]={name:e.n,partials:{}},t.code+='t.b(t.rp("'+y(r)+'",c,p,"'+(e.indent||"")+'"));',r}function b(e,t){t.code+="t.b(t.t(t."+v(e.n)+'("'+y(e.n)+'",c,p,0)));'}function E(e){return"t.b("+e+");"}e.generate=function(t,r,n){g=0;var o={code:"",subs:{},partials:{}};return e.walk(t,o),n.asString?this.stringify(o,r,n):this.makeTemplate(o,r,n)},e.wrapMain=function(e){return'var t=this;t.b(i=i||"");'+e+"return t.fl();"},e.template=e.Template,e.makeTemplate=function(e,t,r){var n=this.makePartials(e);return n.code=new Function("c","p","i",this.wrapMain(e.code)),new this.template(n,t,this,r)},e.makePartials=function(e){var t,r={subs:{},partials:e.partials,name:e.name};for(t in r.partials)r.partials[t]=this.makePartials(r.partials[t]);for(t in e.subs)r.subs[t]=new Function("c","p","t","i",e.subs[t]);return r},e.codegen={"#":function(t,r){r.code+="if(t.s(t."+v(t.n)+'("'+y(t.n)+'",c,p,1),c,p,0,'+t.i+","+t.end+',"'+t.otag+" "+t.ctag+'")){t.rs(c,p,function(c,p,t){',e.walk(t.nodes,r),r.code+="});c.pop();}"},"^":function(t,r){r.code+="if(!t.s(t."+v(t.n)+'("'+y(t.n)+'",c,p,1),c,p,1,0,0,"")){',e.walk(t.nodes,r),r.code+="};"},">":w,"<":function(t,r){var n={partials:{},code:"",subs:{},inPartial:!0};e.walk(t.nodes,n);var o=r.partials[w(t,r)];o.subs=n.subs,o.partials=n.partials},$:function(t,r){var n={subs:{},code:"",partials:r.partials,prefix:t.n};e.walk(t.nodes,n),r.subs[t.n]=n.code,r.inPartial||(r.code+='t.sub("'+y(t.n)+'",c,p,i);')},"\n":function(e,t){t.code+=E('"\\n"'+(e.last?"":" + i"))},_v:function(e,t){t.code+="t.b(t.v(t."+v(e.n)+'("'+y(e.n)+'",c,p,0)));'},_t:function(e,t){t.code+=E('"'+y(e.text)+'"')},"{":b,"&":b},e.walk=function(t,r){for(var n,o=0,i=t.length;o<i;o++)(n=e.codegen[t[o].tag])&&n(t[o],r);return r},e.parse=function(e,t,r){return h(e,0,[],(r=r||{}).sectionTags||[])},e.cache={},e.cacheKey=function(e,t){return[e,!!t.asString,!!t.disableLambda,t.delimiters,!!t.modelGet].join("||")},e.compile=function(t,r){r=r||{};var n=e.cacheKey(t,r),o=this.cache[n];if(o){var i=o.partials;for(var a in i)delete i[a].instance;return o}return o=this.generate(this.parse(this.scan(t,r.delimiters),t,r),t,r),this.cache[n]=o}}(t)},5485:(e,t,r)=>{var n=r(9397);n.Template=r(2882).Template,n.template=n.Template,e.exports=n},2882:(e,t)=>{!function(e){function t(e,t,r){var n;return t&&"object"==typeof t&&(void 0!==t[e]?n=t[e]:r&&t.get&&"function"==typeof t.get&&(n=t.get(e))),n}e.Template=function(e,t,r,n){e=e||{},this.r=e.code||this.r,this.c=r,this.options=n||{},this.text=t||"",this.partials=e.partials||{},this.subs=e.subs||{},this.buf=""},e.Template.prototype={r:function(e,t,r){return""},v:function(e){return e=u(e),s.test(e)?e.replace(r,"&").replace(n,"<").replace(o,">").replace(i,"'").replace(a,"""):e},t:u,render:function(e,t,r){return this.ri([e],t||{},r)},ri:function(e,t,r){return this.r(e,t,r)},ep:function(e,t){var r=this.partials[e],n=t[r.name];if(r.instance&&r.base==n)return r.instance;if("string"==typeof n){if(!this.c)throw new Error("No compiler available.");n=this.c.compile(n,this.options)}if(!n)return null;if(this.partials[e].base=n,r.subs){for(key in t.stackText||(t.stackText={}),r.subs)t.stackText[key]||(t.stackText[key]=void 0!==this.activeSub&&t.stackText[this.activeSub]?t.stackText[this.activeSub]:this.text);n=function(e,t,r,n,o,i){function a(){}function s(){}var u;a.prototype=e,s.prototype=e.subs;var c=new a;for(u in c.subs=new s,c.subsText={},c.buf="",n=n||{},c.stackSubs=n,c.subsText=i,t)n[u]||(n[u]=t[u]);for(u in n)c.subs[u]=n[u];for(u in o=o||{},c.stackPartials=o,r)o[u]||(o[u]=r[u]);for(u in o)c.partials[u]=o[u];return c}(n,r.subs,r.partials,this.stackSubs,this.stackPartials,t.stackText)}return this.partials[e].instance=n,n},rp:function(e,t,r,n){var o=this.ep(e,r);return o?o.ri(t,r,n):""},rs:function(e,t,r){var n=e[e.length-1];if(c(n))for(var o=0;o<n.length;o++)e.push(n[o]),r(e,t,this),e.pop();else r(e,t,this)},s:function(e,t,r,n,o,i,a){var s;return(!c(e)||0!==e.length)&&("function"==typeof e&&(e=this.ms(e,t,r,n,o,i,a)),s=!!e,!n&&s&&t&&t.push("object"==typeof e?e:t[t.length-1]),s)},d:function(e,r,n,o){var i,a=e.split("."),s=this.f(a[0],r,n,o),u=this.options.modelGet,l=null;if("."===e&&c(r[r.length-2]))s=r[r.length-1];else for(var f=1;f<a.length;f++)void 0!==(i=t(a[f],s,u))?(l=s,s=i):s="";return!(o&&!s)&&(o||"function"!=typeof s||(r.push(l),s=this.mv(s,r,n),r.pop()),s)},f:function(e,r,n,o){for(var i=!1,a=!1,s=this.options.modelGet,u=r.length-1;u>=0;u--)if(void 0!==(i=t(e,r[u],s))){a=!0;break}return a?(o||"function"!=typeof i||(i=this.mv(i,r,n)),i):!o&&""},ls:function(e,t,r,n,o){var i=this.options.delimiters;return this.options.delimiters=o,this.b(this.ct(u(e.call(t,n)),t,r)),this.options.delimiters=i,!1},ct:function(e,t,r){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(e,this.options).render(t,r)},b:function(e){this.buf+=e},fl:function(){var e=this.buf;return this.buf="",e},ms:function(e,t,r,n,o,i,a){var s,u=t[t.length-1],c=e.call(u);return"function"==typeof c?!!n||(s=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(c,u,r,s.substring(o,i),a)):c},mv:function(e,t,r){var n=t[t.length-1],o=e.call(n);return"function"==typeof o?this.ct(u(o.call(n)),n,r):o},sub:function(e,t,r,n){var o=this.subs[e];o&&(this.activeSub=e,o(t,r,this,n),this.activeSub=!1)}};var r=/&/g,n=/</g,o=/>/g,i=/\'/g,a=/\"/g,s=/[&<>\"\']/;function u(e){return String(null==e?"":e)}var c=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}}(t)},5405:(e,t,r)=>{var n=r(8887),o=r(6325),i=65536,a=15,s=h(5<<20),u=function(){try{return new Uint32Array(i)}catch(r){for(var e=new Array(i),t=0;t<i;t++)e[t]=0;return e}}(),c=407708164,l=2147483648,f={4:65536,5:262144,6:1048576,7:4194304};function h(e){try{return new Uint8Array(e)}catch(n){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t}}function d(e,t,r){if(void 0!==typeof e.buffer){if(Uint8Array.prototype.slice)return e.slice(t,r);var n=e.length;t=(t|=0)<0?Math.max(n+t,0):Math.min(t,n),r=(r=void 0===r?n:0|r)<0?Math.max(n+r,0):Math.min(r,n);for(var o=new Uint8Array(r-t),i=t,a=0;i<r;)o[a++]=e[i++];return o}return e.slice(t,r)}t.compressBound=function(e){return e+e/255+16|0},t.decompressBound=function(e){var t=0;if(o.readU32(e,t)!==c)throw new Error("invalid magic number");t+=4;var r=e[t++];if(64!=(192&r))throw new Error("incompatible descriptor version "+(192&r));var n=0!=(16&r),i=0!=(8&r),a=e[t++]>>4&7;if(void 0===f[a])throw new Error("invalid block size "+a);var s=f[a];if(i)return o.readU64(e,t);t++;for(var u=0;;){var h=o.readU32(e,t);if(t+=4,u+=h&l?h&=2147483647:s,0===h)return u;n&&(t+=4),t+=h}},t.makeBuffer=h,t.decompressBlock=function(e,t,r,n,o){var i,a,s,u,c;for(s=r+n;r<s;){var l=e[r++],f=l>>4;if(f>0){if(15===f)for(;f+=e[r],255===e[r++];);for(u=r+f;r<u;)t[o++]=e[r++]}if(r>=s)break;if(i=15&l,a=e[r++]|e[r++]<<8,15===i)for(;i+=e[r],255===e[r++];);for(u=(c=o-a)+(i+=4);c<u;)t[o++]=0|t[c++]}return o},t.compressBlock=function(e,t,r,n,i){var s,u,c,l,f,h,d,p;if(h=0,d=n+r,u=r,n>=13)for(var m=67;r+4<d-5;){var g=o.readU32(e,r),y=o.hashU32(g)>>>0;if(s=i[y=(y>>16^y)>>>0&65535]-1,i[y]=r+1,s<0||r-s>>>16>0||o.readU32(e,s)!==g)r+=m++>>6;else{for(m=67,f=r-u,l=r-s,s+=4,c=r+=4;r<d-5&&e[r]===e[s];)r++,s++;var v=(c=r-c)<15?c:15;if(f>=a){for(t[h++]=240+v,p=f-a;p>=255;p-=255)t[h++]=255;t[h++]=p}else t[h++]=(f<<4)+v;for(var w=0;w<f;w++)t[h++]=e[u+w];if(t[h++]=l,t[h++]=l>>8,c>=15){for(p=c-15;p>=255;p-=255)t[h++]=255;t[h++]=p}u=r}}if(0===u)return 0;if((f=d-u)>=a){for(t[h++]=240,p=f-a;p>=255;p-=255)t[h++]=255;t[h++]=p}else t[h++]=f<<4;for(r=u;r<d;)t[h++]=e[r++];return h},t.decompressFrame=function(e,r){var n,i,a,s,u=0,h=0;if(o.readU32(e,u)!==c)throw new Error("invalid magic number");if(u+=4,64!=(192&(s=e[u++])))throw new Error("incompatible descriptor version");n=0!=(16&s),i=0!=(4&s),a=0!=(8&s);var d=e[u++]>>4&7;if(void 0===f[d])throw new Error("invalid block size");for(a&&(u+=8),u++;;){var p;if(p=o.readU32(e,u),u+=4,0===p)break;if(n&&(u+=4),0!=(p&l)){p&=2147483647;for(var m=0;m<p;m++)r[h++]=e[u++]}else h=t.decompressBlock(e,r,u,p,h),u+=p}return i&&(u+=4),h},t.compressFrame=function(e,r){var a=0;o.writeU32(r,a,c),a+=4,r[a++]=64,r[a++]=112,r[a]=n.hash(0,r,4,a-4)>>8,a++;var l=f[7],h=e.length,d=0;for(!function(e){for(var t=0;t<i;t++)u[t]=0}();h>0;){var p,m=h>l?l:h;if((p=t.compressBlock(e,s,d,m,u))>m||0===p){o.writeU32(r,a,2147483648|m),a+=4;for(var g=d+m;d<g;)r[a++]=e[d++];h-=m}else{o.writeU32(r,a,p),a+=4;for(var y=0;y<p;)r[a++]=s[y++];d+=m,h-=m}}return o.writeU32(r,a,0),a+=4},t.decompress=function(e,r){var n,o;return void 0===r&&(r=t.decompressBound(e)),n=t.makeBuffer(r),(o=t.decompressFrame(e,n))!==r&&(n=d(n,0,o)),n},t.compress=function(e,r){var n,o;return void 0===r&&(r=t.compressBound(e.length)),n=t.makeBuffer(r),(o=t.compressFrame(e,n))!==r&&(n=d(n,0,o)),n}},6325:(e,t)=>{t.hashU32=function(e){return-1252372727^(e=(e=(e=(e=-949894596^(e=(e|=0)+2127912214+(e<<12)|0)^e>>>19)+374761393+(e<<5)|0)+-744332180^e<<9)+-42973499+(e<<3)|0)^e>>>16|0},t.readU64=function(e,t){var r=0;return r|=e[t++]<<0,r|=e[t++]<<8,r|=e[t++]<<16,r|=e[t++]<<24,r|=e[t++]<<32,r|=e[t++]<<40,r|=e[t++]<<48,r|=e[t++]<<56},t.readU32=function(e,t){var r=0;return r|=e[t++]<<0,r|=e[t++]<<8,r|=e[t++]<<16,r|=e[t++]<<24},t.writeU32=function(e,t,r){e[t++]=r>>0&255,e[t++]=r>>8&255,e[t++]=r>>16&255,e[t++]=r>>24&255},t.imul=function(e,t){var r=65535&e,n=65535&t;return r*n+((e>>>16)*n+r*(t>>>16)<<16)|0}},8887:(e,t,r)=>{var n=r(6325),o=2654435761,i=2246822519,a=3266489917,s=374761393;function u(e,t){return(e|=0)>>>(32-(t|=0)|0)|e<<t|0}function c(e,t,r){return e|=0,t|=0,r|=0,0|n.imul(e>>>(32-t|0)|e<<t,r)}function l(e,t){return(e|=0)>>>(t|=0)^e|0}function f(e,t,r,o,i){return c(n.imul(t,r)+e,o,i)}function h(e,t,r){return c(e+n.imul(t[r],s),11,o)}function d(e,t,r){return f(e,n.readU32(t,r),a,17,668265263)}function p(e,t,r){return[f(e[0],n.readU32(t,r+0),i,13,o),f(e[1],n.readU32(t,r+4),i,13,o),f(e[2],n.readU32(t,r+8),i,13,o),f(e[3],n.readU32(t,r+12),i,13,o)]}t.hash=function(e,t,r,c){var f,m;if(m=c,c>=16){for(f=[e+o+i,e+i,e,e-o];c>=16;)f=p(f,t,r),r+=16,c-=16;f=u(f[0],1)+u(f[1],7)+u(f[2],12)+u(f[3],18)+m}else f=e+s+c>>>0;for(;c>=4;)f=d(f,t,r),r+=4,c-=4;for(;c>0;)f=h(f,t,r),r++,c--;return(f=l(n.imul(l(n.imul(l(f,15),i),13),a),16))>>>0}},118:(e,t,r)=>{var n=r(5485);e.exports=function(){var e=new n.Template({code:function(e,t,r){var n=this;return n.b(r=r||""),n.b("MEMORY {"),n.b("\n"+r),n.b(" FLASH (rx) : ORIGIN = "),n.b(n.v(n.f("flashStart",e,t,0))),n.b(", LENGTH = "),n.b(n.v(n.f("flashLength",e,t,0))),n.b("\n"+r),n.b(" RAM (rwx) : ORIGIN = "),n.b(n.v(n.f("ramStart",e,t,0))),n.b(", LENGTH = "),n.b(n.v(n.f("ramLength",e,t,0))),n.b("\n"+r),n.b("}"),n.b("\n"),n.b("\n"+r),n.b("ENTRY(_eadk_start)"),n.b("\n"+r),n.b("PROVIDE(eadk_external_data = _binary_input_dat_start);"),n.b("\n"),n.b("\n"+r),n.b("SECTIONS {"),n.b("\n"+r),n.b(" .eadk_app_info ORIGIN(FLASH) : {"),n.b("\n"+r),n.b(" LONG(0xDEC0BEBA);"),n.b("\n"+r),n.b(" *(.rodata.eadk_app_api_level)"),n.b("\n"+r),n.b(" LONG(eadk_app_name - ORIGIN(FLASH)); /* This symbol must be defined and point to a NULL-terminated UTF-8 string */"),n.b("\n"+r),n.b(" LONG(SIZEOF(.rodata.eadk_app_icon));"),n.b("\n"+r),n.b(" LONG(ADDR(.rodata.eadk_app_icon) - ORIGIN(FLASH));"),n.b("\n"+r),n.b(" LONG(_eadk_start - ORIGIN(FLASH));"),n.b("\n"+r),n.b(" LONG(_eadk_app_end - ORIGIN(FLASH));"),n.b("\n"+r),n.b(" LONG(0xDEC0BEBA);"),n.b("\n"+r),n.b(" } >FLASH"),n.b("\n"),n.b("\n"+r),n.b(" .text : {"),n.b("\n"+r),n.b(" KEEP(*(.text._eadk_start))"),n.b("\n"+r),n.b(" *(.text)"),n.b("\n"+r),n.b(" } >FLASH"),n.b("\n"),n.b("\n"+r),n.b(" .rodata : {"),n.b("\n"+r),n.b(" . = ALIGN(4);"),n.b("\n"+r),n.b(" *(.rodata)"),n.b("\n"+r),n.b(" _eadk_app_end = .;"),n.b("\n"+r),n.b(" } >FLASH"),n.b("\n"),n.b("\n"+r),n.b(" .data : {"),n.b("\n"+r),n.b(" . = ALIGN(4);"),n.b("\n"+r),n.b(" _data_section_start_flash = LOADADDR(.data);"),n.b("\n"+r),n.b(" _data_section_start_ram = .;"),n.b("\n"+r),n.b(" *(.data)"),n.b("\n"+r),n.b(" _data_section_end_ram = .;"),n.b("\n"+r),n.b(" } >RAM AT >FLASH"),n.b("\n"),n.b("\n"+r),n.b(" .bss : {"),n.b("\n"+r),n.b(" . = ALIGN(4);"),n.b("\n"+r),n.b(" _bss_section_start_ram = .;"),n.b("\n"+r),n.b(" *(.bss)"),n.b("\n"+r),n.b(" _bss_section_end_ram = .;"),n.b("\n"+r),n.b(" } >RAM"),n.b("\n"),n.b("\n"+r),n.b(" .heap : {"),n.b("\n"+r),n.b(" _heap_start = .;"),n.b("\n"+r),n.b(" . = (ORIGIN(RAM) + LENGTH(RAM));"),n.b("\n"+r),n.b(" _heap_end = .;"),n.b("\n"+r),n.b(" } >RAM"),n.b("\n"+r),n.b("}"),n.b("\n"),n.fl()},partials:{},subs:{}},"MEMORY {\n FLASH (rx) : ORIGIN = {{ flashStart }}, LENGTH = {{ flashLength }}\n RAM (rwx) : ORIGIN = {{ ramStart }}, LENGTH = {{ ramLength }}\n}\n\nENTRY(_eadk_start)\nPROVIDE(eadk_external_data = _binary_input_dat_start);\n\nSECTIONS {\n .eadk_app_info ORIGIN(FLASH) : {\n LONG(0xDEC0BEBA);\n *(.rodata.eadk_app_api_level)\n LONG(eadk_app_name - ORIGIN(FLASH)); /* This symbol must be defined and point to a NULL-terminated UTF-8 string */\n LONG(SIZEOF(.rodata.eadk_app_icon));\n LONG(ADDR(.rodata.eadk_app_icon) - ORIGIN(FLASH));\n LONG(_eadk_start - ORIGIN(FLASH));\n LONG(_eadk_app_end - ORIGIN(FLASH));\n LONG(0xDEC0BEBA);\n } >FLASH\n\n .text : {\n KEEP(*(.text._eadk_start))\n *(.text)\n } >FLASH\n\n .rodata : {\n . = ALIGN(4);\n *(.rodata)\n _eadk_app_end = .;\n } >FLASH\n\n .data : {\n . = ALIGN(4);\n _data_section_start_flash = LOADADDR(.data);\n _data_section_start_ram = .;\n *(.data)\n _data_section_end_ram = .;\n } >RAM AT >FLASH\n\n .bss : {\n . = ALIGN(4);\n _bss_section_start_ram = .;\n *(.bss)\n _bss_section_end_ram = .;\n } >RAM\n\n .heap : {\n _heap_start = .;\n . = (ORIGIN(RAM) + LENGTH(RAM));\n _heap_end = .;\n } >RAM\n}\n",n);return e.render.apply(e,arguments)}},9983:(e,t,r)=>{"use strict";let n=r(7084),o=[function(){},function(e,t,r,n){if(n===t.length)throw new Error("Ran out of data");let o=t[n];e[r]=o,e[r+1]=o,e[r+2]=o,e[r+3]=255},function(e,t,r,n){if(n+1>=t.length)throw new Error("Ran out of data");let o=t[n];e[r]=o,e[r+1]=o,e[r+2]=o,e[r+3]=t[n+1]},function(e,t,r,n){if(n+2>=t.length)throw new Error("Ran out of data");e[r]=t[n],e[r+1]=t[n+1],e[r+2]=t[n+2],e[r+3]=255},function(e,t,r,n){if(n+3>=t.length)throw new Error("Ran out of data");e[r]=t[n],e[r+1]=t[n+1],e[r+2]=t[n+2],e[r+3]=t[n+3]}],i=[function(){},function(e,t,r,n){let o=t[0];e[r]=o,e[r+1]=o,e[r+2]=o,e[r+3]=n},function(e,t,r){let n=t[0];e[r]=n,e[r+1]=n,e[r+2]=n,e[r+3]=t[1]},function(e,t,r,n){e[r]=t[0],e[r+1]=t[1],e[r+2]=t[2],e[r+3]=n},function(e,t,r){e[r]=t[0],e[r+1]=t[1],e[r+2]=t[2],e[r+3]=t[3]}];function a(e,t,r,n,i,a){let s=e.width,u=e.height,c=e.index;for(let e=0;e<u;e++)for(let u=0;u<s;u++){let s=r(u,e,c);o[n](t,i,s,a),a+=n}return a}function s(e,t,r,n,o,a){let s=e.width,u=e.height,c=e.index;for(let e=0;e<u;e++){for(let u=0;u<s;u++){let s=o.get(n),l=r(u,e,c);i[n](t,s,l,a)}o.resetAfterLine()}}t.dataToBitMap=function(e,t){let r,o,i=t.width,u=t.height,c=t.depth,l=t.bpp,f=t.interlace;8!==c&&(r=function(e,t){let r=[],n=0;function o(){if(n===e.length)throw new Error("Ran out of data");let o,i,a,s,u,c,l,f,h=e[n];switch(n++,t){default:throw new Error("unrecognised depth");case 16:l=e[n],n++,r.push((h<<8)+l);break;case 4:l=15&h,f=h>>4,r.push(f,l);break;case 2:u=3&h,c=h>>2&3,l=h>>4&3,f=h>>6&3,r.push(f,l,c,u);break;case 1:o=1&h,i=h>>1&1,a=h>>2&1,s=h>>3&1,u=h>>4&1,c=h>>5&1,l=h>>6&1,f=h>>7&1,r.push(f,l,c,u,s,a,i,o)}}return{get:function(e){for(;r.length<e;)o();let t=r.slice(0,e);return r=r.slice(e),t},resetAfterLine:function(){r.length=0},end:function(){if(n!==e.length)throw new Error("extra data found")}}}(e,c)),o=c<=8?Buffer.alloc(i*u*4):new Uint16Array(i*u*4);let h,d,p=Math.pow(2,c)-1,m=0;if(f)h=n.getImagePasses(i,u),d=n.getInterlaceIterator(i,u);else{let e=0;d=function(){let t=e;return e+=4,t},h=[{width:i,height:u}]}for(let t=0;t<h.length;t++)8===c?m=a(h[t],o,d,l,e,m):s(h[t],o,d,l,r,p);if(8===c){if(m!==e.length)throw new Error("extra data found")}else r.end();return o}},9027:(e,t,r)=>{"use strict";let n=r(3482);e.exports=function(e,t,r,o){let i=-1!==[n.COLORTYPE_COLOR_ALPHA,n.COLORTYPE_ALPHA].indexOf(o.colorType);if(o.colorType===o.inputColorType){let t=function(){let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256!==new Int16Array(e)[0]}();if(8===o.bitDepth||16===o.bitDepth&&t)return e}let a=16!==o.bitDepth?e:new Uint16Array(e.buffer),s=255,u=n.COLORTYPE_TO_BPP_MAP[o.inputColorType];4!==u||o.inputHasAlpha||(u=3);let c=n.COLORTYPE_TO_BPP_MAP[o.colorType];16===o.bitDepth&&(s=65535,c*=2);let l=Buffer.alloc(t*r*c),f=0,h=0,d=o.bgColor||{};function p(){let e,t,r,u=s;switch(o.inputColorType){case n.COLORTYPE_COLOR_ALPHA:u=a[f+3],e=a[f],t=a[f+1],r=a[f+2];break;case n.COLORTYPE_COLOR:e=a[f],t=a[f+1],r=a[f+2];break;case n.COLORTYPE_ALPHA:u=a[f+1],e=a[f],t=e,r=e;break;case n.COLORTYPE_GRAYSCALE:e=a[f],t=e,r=e;break;default:throw new Error("input color type:"+o.inputColorType+" is not supported at present")}return o.inputHasAlpha&&(i||(u/=s,e=Math.min(Math.max(Math.round((1-u)*d.red+u*e),0),s),t=Math.min(Math.max(Math.round((1-u)*d.green+u*t),0),s),r=Math.min(Math.max(Math.round((1-u)*d.blue+u*r),0),s))),{red:e,green:t,blue:r,alpha:u}}void 0===d.red&&(d.red=s),void 0===d.green&&(d.green=s),void 0===d.blue&&(d.blue=s);for(let e=0;e<r;e++)for(let e=0;e<t;e++){let e=p();switch(o.colorType){case n.COLORTYPE_COLOR_ALPHA:case n.COLORTYPE_COLOR:8===o.bitDepth?(l[h]=e.red,l[h+1]=e.green,l[h+2]=e.blue,i&&(l[h+3]=e.alpha)):(l.writeUInt16BE(e.red,h),l.writeUInt16BE(e.green,h+2),l.writeUInt16BE(e.blue,h+4),i&&l.writeUInt16BE(e.alpha,h+6));break;case n.COLORTYPE_ALPHA:case n.COLORTYPE_GRAYSCALE:{let t=(e.red+e.green+e.blue)/3;8===o.bitDepth?(l[h]=t,i&&(l[h+1]=e.alpha)):(l.writeUInt16BE(t,h),i&&l.writeUInt16BE(e.alpha,h+2));break}default:throw new Error("unrecognised color Type "+o.colorType)}f+=u,h+=c}return l}},8442:(e,t,r)=>{"use strict";let n=r(3837),o=r(2781),i=e.exports=function(){o.call(this),this._buffers=[],this._buffered=0,this._reads=[],this._paused=!1,this._encoding="utf8",this.writable=!0};n.inherits(i,o),i.prototype.read=function(e,t){this._reads.push({length:Math.abs(e),allowLess:e<0,func:t}),process.nextTick(function(){this._process(),this._paused&&this._reads&&this._reads.length>0&&(this._paused=!1,this.emit("drain"))}.bind(this))},i.prototype.write=function(e,t){if(!this.writable)return this.emit("error",new Error("Stream not writable")),!1;let r;return r=Buffer.isBuffer(e)?e:Buffer.from(e,t||this._encoding),this._buffers.push(r),this._buffered+=r.length,this._process(),this._reads&&0===this._reads.length&&(this._paused=!0),this.writable&&!this._paused},i.prototype.end=function(e,t){e&&this.write(e,t),this.writable=!1,this._buffers&&(0===this._buffers.length?this._end():(this._buffers.push(null),this._process()))},i.prototype.destroySoon=i.prototype.end,i.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("Unexpected end of input")),this.destroy()},i.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))},i.prototype._processReadAllowingLess=function(e){this._reads.shift();let t=this._buffers[0];t.length>e.length?(this._buffered-=e.length,this._buffers[0]=t.slice(e.length),e.func.call(this,t.slice(0,e.length))):(this._buffered-=t.length,this._buffers.shift(),e.func.call(this,t))},i.prototype._processRead=function(e){this._reads.shift();let t=0,r=0,n=Buffer.alloc(e.length);for(;t<e.length;){let o=this._buffers[r++],i=Math.min(o.length,e.length-t);o.copy(n,t,0,i),t+=i,i!==o.length&&(this._buffers[--r]=o.slice(i))}r>0&&this._buffers.splice(0,r),this._buffered-=e.length,e.func.call(this,n)},i.prototype._process=function(){try{for(;this._buffered>0&&this._reads&&this._reads.length>0;){let e=this._reads[0];if(e.allowLess)this._processReadAllowingLess(e);else{if(!(this._buffered>=e.length))break;this._processRead(e)}}this._buffers&&!this.writable&&this._end()}catch(e){this.emit("error",e)}}},3482:e=>{"use strict";e.exports={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5}},3500:e=>{"use strict";let t=[];!function(){for(let e=0;e<256;e++){let r=e;for(let e=0;e<8;e++)1&r?r=3988292384^r>>>1:r>>>=1;t[e]=r}}();let r=e.exports=function(){this._crc=-1};r.prototype.write=function(e){for(let r=0;r<e.length;r++)this._crc=t[255&(this._crc^e[r])]^this._crc>>>8;return!0},r.prototype.crc32=function(){return-1^this._crc},r.crc32=function(e){let r=-1;for(let n=0;n<e.length;n++)r=t[255&(r^e[n])]^r>>>8;return-1^r}},8876:(e,t,r)=>{"use strict";let n=r(6744);let o={0:function(e,t,r,n,o){for(let i=0;i<r;i++)n[o+i]=e[t+i]},1:function(e,t,r,n,o,i){for(let a=0;a<r;a++){let r=a>=i?e[t+a-i]:0,s=e[t+a]-r;n[o+a]=s}},2:function(e,t,r,n,o){for(let i=0;i<r;i++){let a=t>0?e[t+i-r]:0,s=e[t+i]-a;n[o+i]=s}},3:function(e,t,r,n,o,i){for(let a=0;a<r;a++){let s=a>=i?e[t+a-i]:0,u=t>0?e[t+a-r]:0,c=e[t+a]-(s+u>>1);n[o+a]=c}},4:function(e,t,r,o,i,a){for(let s=0;s<r;s++){let u=s>=a?e[t+s-a]:0,c=t>0?e[t+s-r]:0,l=t>0&&s>=a?e[t+s-(r+a)]:0,f=e[t+s]-n(u,c,l);o[i+s]=f}}},i={0:function(e,t,r){let n=0,o=t+r;for(let r=t;r<o;r++)n+=Math.abs(e[r]);return n},1:function(e,t,r,n){let o=0;for(let i=0;i<r;i++){let r=i>=n?e[t+i-n]:0,a=e[t+i]-r;o+=Math.abs(a)}return o},2:function(e,t,r){let n=0,o=t+r;for(let i=t;i<o;i++){let o=t>0?e[i-r]:0,a=e[i]-o;n+=Math.abs(a)}return n},3:function(e,t,r,n){let o=0;for(let i=0;i<r;i++){let a=i>=n?e[t+i-n]:0,s=t>0?e[t+i-r]:0,u=e[t+i]-(a+s>>1);o+=Math.abs(u)}return o},4:function(e,t,r,o){let i=0;for(let a=0;a<r;a++){let s=a>=o?e[t+a-o]:0,u=t>0?e[t+a-r]:0,c=t>0&&a>=o?e[t+a-(r+o)]:0,l=e[t+a]-n(s,u,c);i+=Math.abs(l)}return i}};e.exports=function(e,t,r,n,a){let s;if("filterType"in n&&-1!==n.filterType){if("number"!=typeof n.filterType)throw new Error("unrecognised filter types");s=[n.filterType]}else s=[0,1,2,3,4];16===n.bitDepth&&(a*=2);let u=t*a,c=0,l=0,f=Buffer.alloc((u+1)*r),h=s[0];for(let t=0;t<r;t++){if(s.length>1){let t=1/0;for(let r=0;r<s.length;r++){let n=i[s[r]](e,l,u,a);n<t&&(h=s[r],t=n)}}f[c]=h,c++,o[h](e,l,u,f,c,a),c+=u,l+=u}return f}},4603:(e,t,r)=>{"use strict";let n=r(3837),o=r(8442),i=r(2769),a=e.exports=function(e){o.call(this);let t=[],r=this;this._filter=new i(e,{read:this.read.bind(this),write:function(e){t.push(e)},complete:function(){r.emit("complete",Buffer.concat(t))}}),this._filter.start()};n.inherits(a,o)},8692:(e,t,r)=>{"use strict";let n=r(33),o=r(2769);t.process=function(e,t){let r=[],i=new n(e);return new o(t,{read:i.read.bind(i),write:function(e){r.push(e)},complete:function(){}}).start(),i.process(),Buffer.concat(r)}},2769:(e,t,r)=>{"use strict";let n=r(7084),o=r(6744);function i(e,t,r){let n=e*t;return 8!==r&&(n=Math.ceil(n/(8/r))),n}let a=e.exports=function(e,t){let r=e.width,o=e.height,a=e.interlace,s=e.bpp,u=e.depth;if(this.read=t.read,this.write=t.write,this.complete=t.complete,this._imageIndex=0,this._images=[],a){let e=n.getImagePasses(r,o);for(let t=0;t<e.length;t++)this._images.push({byteWidth:i(e[t].width,s,u),height:e[t].height,lineIndex:0})}else this._images.push({byteWidth:i(r,s,u),height:o,lineIndex:0});this._xComparison=8===u?s:16===u?2*s:1};a.prototype.start=function(){this.read(this._images[this._imageIndex].byteWidth+1,this._reverseFilterLine.bind(this))},a.prototype._unFilterType1=function(e,t,r){let n=this._xComparison,o=n-1;for(let i=0;i<r;i++){let r=e[1+i],a=i>o?t[i-n]:0;t[i]=r+a}},a.prototype._unFilterType2=function(e,t,r){let n=this._lastLine;for(let o=0;o<r;o++){let r=e[1+o],i=n?n[o]:0;t[o]=r+i}},a.prototype._unFilterType3=function(e,t,r){let n=this._xComparison,o=n-1,i=this._lastLine;for(let a=0;a<r;a++){let r=e[1+a],s=i?i[a]:0,u=a>o?t[a-n]:0,c=Math.floor((u+s)/2);t[a]=r+c}},a.prototype._unFilterType4=function(e,t,r){let n=this._xComparison,i=n-1,a=this._lastLine;for(let s=0;s<r;s++){let r=e[1+s],u=a?a[s]:0,c=s>i?t[s-n]:0,l=s>i&&a?a[s-n]:0,f=o(c,u,l);t[s]=r+f}},a.prototype._reverseFilterLine=function(e){let t,r=e[0],n=this._images[this._imageIndex],o=n.byteWidth;if(0===r)t=e.slice(1,o+1);else switch(t=Buffer.alloc(o),r){case 1:this._unFilterType1(e,t,o);break;case 2:this._unFilterType2(e,t,o);break;case 3:this._unFilterType3(e,t,o);break;case 4:this._unFilterType4(e,t,o);break;default:throw new Error("Unrecognised filter type - "+r)}this.write(t),n.lineIndex++,n.lineIndex>=n.height?(this._lastLine=null,this._imageIndex++,n=this._images[this._imageIndex]):this._lastLine=t,n?this.read(n.byteWidth+1,this._reverseFilterLine.bind(this)):(this._lastLine=null,this.complete())}},8417:e=>{"use strict";e.exports=function(e,t,r=!1){let n=t.depth,o=t.width,i=t.height,a=t.colorType,s=t.transColor,u=t.palette,c=e;return 3===a?function(e,t,r,n,o){let i=0;for(let a=0;a<n;a++)for(let n=0;n<r;n++){let r=o[e[i]];if(!r)throw new Error("index "+e[i]+" not in palette");for(let e=0;e<4;e++)t[i+e]=r[e];i+=4}}(e,c,o,i,u):(s&&function(e,t,r,n,o){let i=0;for(let a=0;a<n;a++)for(let n=0;n<r;n++){let r=!1;if(1===o.length?o[0]===e[i]&&(r=!0):o[0]===e[i]&&o[1]===e[i+1]&&o[2]===e[i+2]&&(r=!0),r)for(let e=0;e<4;e++)t[i+e]=0;i+=4}}(e,c,o,i,s),8===n||r||(16===n&&(c=Buffer.alloc(o*i*4)),function(e,t,r,n,o){let i=Math.pow(2,o)-1,a=0;for(let o=0;o<n;o++)for(let n=0;n<r;n++){for(let r=0;r<4;r++)t[a+r]=Math.floor(255*e[a+r]/i+.5);a+=4}}(e,c,o,i,n))),c}},7084:(e,t)=>{"use strict";let r=[{x:[0],y:[0]},{x:[4],y:[0]},{x:[0,4],y:[4]},{x:[2,6],y:[0,4]},{x:[0,2,4,6],y:[2,6]},{x:[1,3,5,7],y:[0,2,4,6]},{x:[0,1,2,3,4,5,6,7],y:[1,3,5,7]}];t.getImagePasses=function(e,t){let n=[],o=e%8,i=t%8,a=(e-o)/8,s=(t-i)/8;for(let e=0;e<r.length;e++){let t=r[e],u=a*t.x.length,c=s*t.y.length;for(let e=0;e<t.x.length&&t.x[e]<o;e++)u++;for(let e=0;e<t.y.length&&t.y[e]<i;e++)c++;u>0&&c>0&&n.push({width:u,height:c,index:e})}return n},t.getInterlaceIterator=function(e){return function(t,n,o){let i=t%r[o].x.length,a=(t-i)/r[o].x.length*8+r[o].x[i],s=n%r[o].y.length;return 4*a+((n-s)/r[o].y.length*8+r[o].y[s])*e*4}}},6838:(e,t,r)=>{"use strict";let n=r(3837),o=r(2781),i=r(3482),a=r(9432),s=e.exports=function(e){o.call(this);let t=e||{};this._packer=new a(t),this._deflate=this._packer.createDeflate(),this.readable=!0};n.inherits(s,o),s.prototype.pack=function(e,t,r,n){this.emit("data",Buffer.from(i.PNG_SIGNATURE)),this.emit("data",this._packer.packIHDR(t,r)),n&&this.emit("data",this._packer.packGAMA(n));let o=this._packer.filterData(e,t,r);this._deflate.on("error",this.emit.bind(this,"error")),this._deflate.on("data",function(e){this.emit("data",this._packer.packIDAT(e))}.bind(this)),this._deflate.on("end",function(){this.emit("data",this._packer.packIEND()),this.emit("end")}.bind(this)),this._deflate.end(o)}},8360:(e,t,r)=>{"use strict";let n=!0,o=r(9796);o.deflateSync||(n=!1);let i=r(3482),a=r(9432);e.exports=function(e,t){if(!n)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let r=new a(t||{}),s=[];s.push(Buffer.from(i.PNG_SIGNATURE)),s.push(r.packIHDR(e.width,e.height)),e.gamma&&s.push(r.packGAMA(e.gamma));let u=r.filterData(e.data,e.width,e.height),c=o.deflateSync(u,r.getDeflateOptions());if(u=null,!c||!c.length)throw new Error("bad png - invalid compressed data response");return s.push(r.packIDAT(c)),s.push(r.packIEND()),Buffer.concat(s)}},9432:(e,t,r)=>{"use strict";let n=r(3482),o=r(3500),i=r(9027),a=r(8876),s=r(9796),u=e.exports=function(e){if(this._options=e,e.deflateChunkSize=e.deflateChunkSize||32768,e.deflateLevel=null!=e.deflateLevel?e.deflateLevel:9,e.deflateStrategy=null!=e.deflateStrategy?e.deflateStrategy:3,e.inputHasAlpha=null==e.inputHasAlpha||e.inputHasAlpha,e.deflateFactory=e.deflateFactory||s.createDeflate,e.bitDepth=e.bitDepth||8,e.colorType="number"==typeof e.colorType?e.colorType:n.COLORTYPE_COLOR_ALPHA,e.inputColorType="number"==typeof e.inputColorType?e.inputColorType:n.COLORTYPE_COLOR_ALPHA,-1===[n.COLORTYPE_GRAYSCALE,n.COLORTYPE_COLOR,n.COLORTYPE_COLOR_ALPHA,n.COLORTYPE_ALPHA].indexOf(e.colorType))throw new Error("option color type:"+e.colorType+" is not supported at present");if(-1===[n.COLORTYPE_GRAYSCALE,n.COLORTYPE_COLOR,n.COLORTYPE_COLOR_ALPHA,n.COLORTYPE_ALPHA].indexOf(e.inputColorType))throw new Error("option input color type:"+e.inputColorType+" is not supported at present");if(8!==e.bitDepth&&16!==e.bitDepth)throw new Error("option bit depth:"+e.bitDepth+" is not supported at present")};u.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}},u.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())},u.prototype.filterData=function(e,t,r){let o=i(e,t,r,this._options),s=n.COLORTYPE_TO_BPP_MAP[this._options.colorType];return a(o,t,r,this._options,s)},u.prototype._packChunk=function(e,t){let r=t?t.length:0,n=Buffer.alloc(r+12);return n.writeUInt32BE(r,0),n.writeUInt32BE(e,4),t&&t.copy(n,8),n.writeInt32BE(o.crc32(n.slice(4,n.length-4)),n.length-4),n},u.prototype.packGAMA=function(e){let t=Buffer.alloc(4);return t.writeUInt32BE(Math.floor(e*n.GAMMA_DIVISION),0),this._packChunk(n.TYPE_gAMA,t)},u.prototype.packIHDR=function(e,t){let r=Buffer.alloc(13);return r.writeUInt32BE(e,0),r.writeUInt32BE(t,4),r[8]=this._options.bitDepth,r[9]=this._options.colorType,r[10]=0,r[11]=0,r[12]=0,this._packChunk(n.TYPE_IHDR,r)},u.prototype.packIDAT=function(e){return this._packChunk(n.TYPE_IDAT,e)},u.prototype.packIEND=function(){return this._packChunk(n.TYPE_IEND,null)}},6744:e=>{"use strict";e.exports=function(e,t,r){let n=e+t-r,o=Math.abs(n-e),i=Math.abs(n-t),a=Math.abs(n-r);return o<=i&&o<=a?e:i<=a?t:r}},7900:(e,t,r)=>{"use strict";let n=r(3837),o=r(9796),i=r(8442),a=r(4603),s=r(8550),u=r(9983),c=r(8417),l=e.exports=function(e){i.call(this),this._parser=new s(e,{read:this.read.bind(this),error:this._handleError.bind(this),metadata:this._handleMetaData.bind(this),gamma:this.emit.bind(this,"gamma"),palette:this._handlePalette.bind(this),transColor:this._handleTransColor.bind(this),finished:this._finished.bind(this),inflateData:this._inflateData.bind(this),simpleTransparency:this._simpleTransparency.bind(this),headersFinished:this._headersFinished.bind(this)}),this._options=e,this.writable=!0,this._parser.start()};n.inherits(l,i),l.prototype._handleError=function(e){this.emit("error",e),this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy&&this._inflate.destroy(),this._filter&&(this._filter.destroy(),this._filter.on("error",(function(){}))),this.errord=!0},l.prototype._inflateData=function(e){if(!this._inflate)if(this._bitmapInfo.interlace)this._inflate=o.createInflate(),this._inflate.on("error",this.emit.bind(this,"error")),this._filter.on("complete",this._complete.bind(this)),this._inflate.pipe(this._filter);else{let e=(1+(this._bitmapInfo.width*this._bitmapInfo.bpp*this._bitmapInfo.depth+7>>3))*this._bitmapInfo.height,t=Math.max(e,o.Z_MIN_CHUNK);this._inflate=o.createInflate({chunkSize:t});let r=e,n=this.emit.bind(this,"error");this._inflate.on("error",(function(e){r&&n(e)})),this._filter.on("complete",this._complete.bind(this));let i=this._filter.write.bind(this._filter);this._inflate.on("data",(function(e){r&&(e.length>r&&(e=e.slice(0,r)),r-=e.length,i(e))})),this._inflate.on("end",this._filter.end.bind(this._filter))}this._inflate.write(e)},l.prototype._handleMetaData=function(e){this._metaData=e,this._bitmapInfo=Object.create(e),this._filter=new a(this._bitmapInfo)},l.prototype._handleTransColor=function(e){this._bitmapInfo.transColor=e},l.prototype._handlePalette=function(e){this._bitmapInfo.palette=e},l.prototype._simpleTransparency=function(){this._metaData.alpha=!0},l.prototype._headersFinished=function(){this.emit("metadata",this._metaData)},l.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"))},l.prototype._complete=function(e){if(this.errord)return;let t;try{let r=u.dataToBitMap(e,this._bitmapInfo);t=c(r,this._bitmapInfo,this._options.skipRescale),r=null}catch(e){return void this._handleError(e)}this.emit("parsed",t)}},2416:(e,t,r)=>{"use strict";let n=!0,o=r(9796),i=r(9653);o.deflateSync||(n=!1);let a=r(33),s=r(8692),u=r(8550),c=r(9983),l=r(8417);e.exports=function(e,t){if(!n)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let r,f,h;let d=[];let p=new a(e),m=new u(t,{read:p.read.bind(p),error:function(e){r=e},metadata:function(e){f=e},gamma:function(e){h=e},palette:function(e){f.palette=e},transColor:function(e){f.transColor=e},inflateData:function(e){d.push(e)},simpleTransparency:function(){f.alpha=!0}});if(m.start(),p.process(),r)throw r;let g,y=Buffer.concat(d);if(d.length=0,f.interlace)g=o.inflateSync(y);else{let e=(1+(f.width*f.bpp*f.depth+7>>3))*f.height;g=i(y,{chunkSize:e,maxLength:e})}if(y=null,!g||!g.length)throw new Error("bad png - invalid inflate data response");let v=s.process(g,f);y=null;let w=c.dataToBitMap(v,f);v=null;let b=l(w,f,t.skipRescale);return f.data=b,f.gamma=h||0,f}},8550:(e,t,r)=>{"use strict";let n=r(3482),o=r(3500),i=e.exports=function(e,t){this._options=e,e.checkCRC=!1!==e.checkCRC,this._hasIHDR=!1,this._hasIEND=!1,this._emittedHeadersFinished=!1,this._palette=[],this._colorType=0,this._chunks={},this._chunks[n.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[n.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[n.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[n.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[n.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[n.TYPE_gAMA]=this._handleGAMA.bind(this),this.read=t.read,this.error=t.error,this.metadata=t.metadata,this.gamma=t.gamma,this.transColor=t.transColor,this.palette=t.palette,this.parsed=t.parsed,this.inflateData=t.inflateData,this.finished=t.finished,this.simpleTransparency=t.simpleTransparency,this.headersFinished=t.headersFinished||function(){}};i.prototype.start=function(){this.read(n.PNG_SIGNATURE.length,this._parseSignature.bind(this))},i.prototype._parseSignature=function(e){let t=n.PNG_SIGNATURE;for(let r=0;r<t.length;r++)if(e[r]!==t[r])return void this.error(new Error("Invalid file signature"));this.read(8,this._parseChunkBegin.bind(this))},i.prototype._parseChunkBegin=function(e){let t=e.readUInt32BE(0),r=e.readUInt32BE(4),i="";for(let t=4;t<8;t++)i+=String.fromCharCode(e[t]);let a=Boolean(32&e[4]);if(this._hasIHDR||r===n.TYPE_IHDR){if(this._crc=new o,this._crc.write(Buffer.from(i)),this._chunks[r])return this._chunks[r](t);a?this.read(t+4,this._skipChunk.bind(this)):this.error(new Error("Unsupported critical chunk type "+i))}else this.error(new Error("Expected IHDR on beggining"))},i.prototype._skipChunk=function(){this.read(8,this._parseChunkBegin.bind(this))},i.prototype._handleChunkEnd=function(){this.read(4,this._parseChunkEnd.bind(this))},i.prototype._parseChunkEnd=function(e){let t=e.readInt32BE(0),r=this._crc.crc32();this._options.checkCRC&&r!==t?this.error(new Error("Crc error - "+t+" - "+r)):this._hasIEND||this.read(8,this._parseChunkBegin.bind(this))},i.prototype._handleIHDR=function(e){this.read(e,this._parseIHDR.bind(this))},i.prototype._parseIHDR=function(e){this._crc.write(e);let t=e.readUInt32BE(0),r=e.readUInt32BE(4),o=e[8],i=e[9],a=e[10],s=e[11],u=e[12];if(8!==o&&4!==o&&2!==o&&1!==o&&16!==o)return void this.error(new Error("Unsupported bit depth "+o));if(!(i in n.COLORTYPE_TO_BPP_MAP))return void this.error(new Error("Unsupported color type"));if(0!==a)return void this.error(new Error("Unsupported compression method"));if(0!==s)return void this.error(new Error("Unsupported filter method"));if(0!==u&&1!==u)return void this.error(new Error("Unsupported interlace method"));this._colorType=i;let c=n.COLORTYPE_TO_BPP_MAP[this._colorType];this._hasIHDR=!0,this.metadata({width:t,height:r,depth:o,interlace:Boolean(u),palette:Boolean(i&n.COLORTYPE_PALETTE),color:Boolean(i&n.COLORTYPE_COLOR),alpha:Boolean(i&n.COLORTYPE_ALPHA),bpp:c,colorType:i}),this._handleChunkEnd()},i.prototype._handlePLTE=function(e){this.read(e,this._parsePLTE.bind(this))},i.prototype._parsePLTE=function(e){this._crc.write(e);let t=Math.floor(e.length/3);for(let r=0;r<t;r++)this._palette.push([e[3*r],e[3*r+1],e[3*r+2],255]);this.palette(this._palette),this._handleChunkEnd()},i.prototype._handleTRNS=function(e){this.simpleTransparency(),this.read(e,this._parseTRNS.bind(this))},i.prototype._parseTRNS=function(e){if(this._crc.write(e),this._colorType===n.COLORTYPE_PALETTE_COLOR){if(0===this._palette.length)return void this.error(new Error("Transparency chunk must be after palette"));if(e.length>this._palette.length)return void this.error(new Error("More transparent colors than palette size"));for(let t=0;t<e.length;t++)this._palette[t][3]=e[t];this.palette(this._palette)}this._colorType===n.COLORTYPE_GRAYSCALE&&this.transColor([e.readUInt16BE(0)]),this._colorType===n.COLORTYPE_COLOR&&this.transColor([e.readUInt16BE(0),e.readUInt16BE(2),e.readUInt16BE(4)]),this._handleChunkEnd()},i.prototype._handleGAMA=function(e){this.read(e,this._parseGAMA.bind(this))},i.prototype._parseGAMA=function(e){this._crc.write(e),this.gamma(e.readUInt32BE(0)/n.GAMMA_DIVISION),this._handleChunkEnd()},i.prototype._handleIDAT=function(e){this._emittedHeadersFinished||(this._emittedHeadersFinished=!0,this.headersFinished()),this.read(-e,this._parseIDAT.bind(this,e))},i.prototype._parseIDAT=function(e,t){if(this._crc.write(t),this._colorType===n.COLORTYPE_PALETTE_COLOR&&0===this._palette.length)throw new Error("Expected palette not found");this.inflateData(t);let r=e-t.length;r>0?this._handleIDAT(r):this._handleChunkEnd()},i.prototype._handleIEND=function(e){this.read(e,this._parseIEND.bind(this))},i.prototype._parseIEND=function(e){this._crc.write(e),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()}},6117:(e,t,r)=>{"use strict";let n=r(2416),o=r(8360);t.read=function(e,t){return n(e,t||{})},t.write=function(e,t){return o(e,t)}},5477:(e,t,r)=>{"use strict";let n=r(3837),o=r(2781),i=r(7900),a=r(6838),s=r(6117),u=t.y=function(e){o.call(this),e=e||{},this.width=0|e.width,this.height=0|e.height,this.data=this.width>0&&this.height>0?Buffer.alloc(4*this.width*this.height):null,e.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new i(e),this._parser.on("error",this.emit.bind(this,"error")),this._parser.on("close",this._handleClose.bind(this)),this._parser.on("metadata",this._metadata.bind(this)),this._parser.on("gamma",this._gamma.bind(this)),this._parser.on("parsed",function(e){this.data=e,this.emit("parsed",e)}.bind(this)),this._packer=new a(e),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};n.inherits(u,o),u.sync=s,u.prototype.pack=function(){return this.data&&this.data.length?(process.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this)),this):(this.emit("error","No data provided"),this)},u.prototype.parse=function(e,t){if(t){let e,r;e=function(e){this.removeListener("error",r),this.data=e,t(null,this)}.bind(this),r=function(r){this.removeListener("parsed",e),t(r,null)}.bind(this),this.once("parsed",e),this.once("error",r)}return this.end(e),this},u.prototype.write=function(e){return this._parser.write(e),!0},u.prototype.end=function(e){this._parser.end(e)},u.prototype._metadata=function(e){this.width=e.width,this.height=e.height,this.emit("metadata",e)},u.prototype._gamma=function(e){this.gamma=e},u.prototype._handleClose=function(){this._parser.writable||this._packer.readable||this.emit("close")},u.bitblt=function(e,t,r,n,o,i,a,s){if(n|=0,o|=0,i|=0,a|=0,s|=0,(r|=0)>e.width||n>e.height||r+o>e.width||n+i>e.height)throw new Error("bitblt reading outside image");if(a>t.width||s>t.height||a+o>t.width||s+i>t.height)throw new Error("bitblt writing outside image");for(let u=0;u<i;u++)e.data.copy(t.data,(s+u)*t.width+a<<2,(n+u)*e.width+r<<2,(n+u)*e.width+r+o<<2)},u.prototype.bitblt=function(e,t,r,n,o,i,a){return u.bitblt(this,e,t,r,n,o,i,a),this},u.adjustGamma=function(e){if(e.gamma){for(let t=0;t<e.height;t++)for(let r=0;r<e.width;r++){let n=e.width*t+r<<2;for(let t=0;t<3;t++){let r=e.data[n+t]/255;r=Math.pow(r,1/2.2/e.gamma),e.data[n+t]=Math.round(255*r)}}e.gamma=0}},u.prototype.adjustGamma=function(){u.adjustGamma(this)}},9653:(e,t,r)=>{"use strict";let n=r(9491).ok,o=r(9796),i=r(3837),a=r(4300).kMaxLength;function s(e){if(!(this instanceof s))return new s(e);e&&e.chunkSize<o.Z_MIN_CHUNK&&(e.chunkSize=o.Z_MIN_CHUNK),o.Inflate.call(this,e),this._offset=void 0===this._offset?this._outOffset:this._offset,this._buffer=this._buffer||this._outBuffer,e&&null!=e.maxLength&&(this._maxLength=e.maxLength)}function u(e,t){t&&process.nextTick(t),e._handle&&(e._handle.close(),e._handle=null)}function c(e,t){return function(e,t){if("string"==typeof t&&(t=Buffer.from(t)),!(t instanceof Buffer))throw new TypeError("Not a string or buffer");let r=e._finishFlushFlag;return null==r&&(r=o.Z_FINISH),e._processChunk(t,r)}(new s(t),e)}s.prototype._processChunk=function(e,t,r){if("function"==typeof r)return o.Inflate._processChunk.call(this,e,t,r);let i,s,c=this,l=e&&e.length,f=this._chunkSize-this._offset,h=this._maxLength,d=0,p=[],m=0;function g(e,t){if(c._hadError)return;let r=f-t;if(n(r>=0,"have should not go down"),r>0){let e=c._buffer.slice(c._offset,c._offset+r);if(c._offset+=r,e.length>h&&(e=e.slice(0,h)),p.push(e),m+=e.length,h-=e.length,0===h)return!1}return(0===t||c._offset>=c._chunkSize)&&(f=c._chunkSize,c._offset=0,c._buffer=Buffer.allocUnsafe(c._chunkSize)),0===t&&(d+=l-e,l=e,!0)}this.on("error",(function(e){i=e})),n(this._handle,"zlib binding closed");do{s=this._handle.writeSync(t,e,d,l,this._buffer,this._offset,f),s=s||this._writeState}while(!this._hadError&&g(s[0],s[1]));if(this._hadError)throw i;if(m>=a)throw u(this),new RangeError("Cannot create final Buffer. It would be larger than 0x"+a.toString(16)+" bytes");let y=Buffer.concat(p,m);return u(this),y},i.inherits(s,o.Inflate),e.exports=t=c,t.Inflate=s,t.createInflate=function(e){return new s(e)},t.inflateSync=c},33:e=>{"use strict";let t=e.exports=function(e){this._buffer=e,this._reads=[]};t.prototype.read=function(e,t){this._reads.push({length:Math.abs(e),allowLess:e<0,func:t})},t.prototype.process=function(){for(;this._reads.length>0&&this._buffer.length;){let e=this._reads[0];if(!this._buffer.length||!(this._buffer.length>=e.length||e.allowLess))break;{this._reads.shift();let t=this._buffer;this._buffer=t.slice(e.length),e.func.call(this,t.slice(0,e.length))}}if(this._reads.length>0)throw new Error("There are some read requests waitng on finished stream");if(this._buffer.length>0)throw new Error("unrecognised content at end of stream")}},5666:e=>{var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o=t&&t.prototype instanceof g?t:g,i=Object.create(o.prototype),a=new P(n||[]);return i._invoke=function(e,t,r){var n=f;return function(o,i){if(n===d)throw new Error("Generator is already running");if(n===p){if("throw"===o)throw i;return T()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=I(a,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=d;var u=l(e,t,r);if("normal"===u.type){if(n=r.done?p:h,u.arg===m)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=p,r.method="throw",r.arg=u.arg)}}}(e,r,a),i}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var f="suspendedStart",h="suspendedYield",d="executing",p="completed",m={};function g(){}function y(){}function v(){}var w={};u(w,i,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(O([])));E&&E!==r&&n.call(E,i)&&(w=E);var _=v.prototype=g.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function r(o,i,a,s){var u=l(e[o],e,i);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(f).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var o;this._invoke=function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}}function I(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,I(e,r),"throw"===r.method))return m;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var o=l(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function O(e){if(e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:T}}function T(){return{value:t,done:!0}}return y.prototype=v,u(_,"constructor",v),u(v,"constructor",y),y.displayName=u(v,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,u(e,s,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},S(A.prototype),u(A.prototype,a,(function(){return this})),e.AsyncIterator=A,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new A(c(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(_),u(_,s,"Generator"),u(_,i,(function(){return this})),u(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=O,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:O(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},9898:e=>{"use strict";e.exports={type:"Buffer",data:[127,69,76,70,1,1,1,0,0,0,0,0,0,0,0,0,1,0,40,0,1,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,5,52,0,0,0,0,0,40,0,9,0,8,0,223,248,32,0,8,74,8,181,8,73,18,26,255,247,254,255,7,72,8,74,0,33,18,26,255,247,254,255,189,232,8,64,255,247,254,191,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,68,3,70,147,66,0,209,112,71,3,248,1,27,249,231,67,30,10,68,16,181,145,66,0,209,16,189,17,248,1,75,3,248,1,79,247,231,16,181,1,223,4,70,224,178,16,189,2,223,112,71,16,181,3,223,4,70,224,178,16,189,16,181,4,223,4,70,224,178,16,189,5,223,16,238,16,202,0,238,16,202,112,71,130,176,2,171,3,233,3,0,18,223,2,176,112,71,130,176,2,171,3,233,3,0,19,223,2,176,112,71,130,176,2,171,3,233,3,0,20,223,2,176,112,71,16,181,21,223,4,70,224,178,16,189,51,180,189,248,16,80,1,145,124,70,164,13,4,149,164,5,4,245,128,52,36,107,164,70,2,176,48,188,96,71,0,34,0,35,19,181,108,70,205,233,0,35,34,223,32,96,97,96,212,233,0,1,2,176,16,189,0,34,0,35,19,181,108,70,205,233,0,35,48,223,32,96,97,96,212,233,0,1,2,176,16,189,49,223,112,71,50,223,112,71,16,181,45,223,4,70,32,70,16,189,65,36,0,0,0,97,101,97,98,105,0,1,26,0,0,0,5,67,111,114,116,101,120,45,77,55,0,6,13,7,77,9,2,10,8,27,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,4,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,4,0,0,0,36,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,56,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,5,0,7,0,0,0,1,0,0,0,0,0,0,0,18,0,1,0,19,0,0,0,72,0,0,0,0,0,0,0,16,0,1,0,31,0,0,0,56,0,0,0,0,0,0,0,16,0,1,0,43,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,54,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,78,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,126,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,149,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,170,0,0,0,94,0,0,0,0,0,0,0,16,0,1,0,196,0,0,0,104,0,0,0,0,0,0,0,16,0,1,0,226,0,0,0,108,0,0,0,0,0,0,0,16,0,1,0,251,0,0,0,118,0,0,0,0,0,0,0,16,0,1,0,14,1,0,0,128,0,0,0,0,0,0,0,16,0,1,0,35,1,0,0,140,0,0,0,0,0,0,0,16,0,1,0,58,1,0,0,154,0,0,0,0,0,0,0,16,0,1,0,81,1,0,0,168,0,0,0,0,0,0,0,16,0,1,0,112,1,0,0,182,0,0,0,0,0,0,0,16,0,1,0,141,1,0,0,192,0,0,0,0,0,0,0,16,0,1,0,166,1,0,0,222,0,0,0,0,0,0,0,16,0,1,0,185,1,0,0,248,0,0,0,0,0,0,0,16,0,1,0,204,1,0,0,18,1,0,0,0,0,0,0,16,0,1,0,223,1,0,0,22,1,0,0,0,0,0,0,16,0,1,0,242,1,0,0,26,1,0,0,0,0,0,0,16,0,1,0,0,36,116,0,36,100,0,95,101,97,100,107,95,115,116,97,114,116,0,101,97,100,107,95,109,101,109,99,112,121,0,101,97,100,107,95,109,101,109,115,101,116,0,95,101,97,100,107,95,109,97,105,110,0,95,100,97,116,97,95,115,101,99,116,105,111,110,95,115,116,97,114,116,95,114,97,109,0,95,100,97,116,97,95,115,101,99,116,105,111,110,95,101,110,100,95,114,97,109,0,95,100,97,116,97,95,115,101,99,116,105,111,110,95,115,116,97,114,116,95,102,108,97,115,104,0,95,98,115,115,95,115,101,99,116,105,111,110,95,115,116,97,114,116,95,114,97,109,0,95,98,115,115,95,115,101,99,116,105,111,110,95,101,110,100,95,114,97,109,0,101,97,100,107,95,98,97,99,107,108,105,103,104,116,95,98,114,105,103,104,116,110,101,115,115,0,101,97,100,107,95,98,97,99,107,108,105,103,104,116,95,115,101,116,95,98,114,105,103,104,116,110,101,115,115,0,101,97,100,107,95,98,97,116,116,101,114,121,95,105,115,95,99,104,97,114,103,105,110,103,0,101,97,100,107,95,98,97,116,116,101,114,121,95,108,101,118,101,108,0,101,97,100,107,95,98,97,116,116,101,114,121,95,118,111,108,116,97,103,101,0,101,97,100,107,95,100,105,115,112,108,97,121,95,112,117,108,108,95,114,101,99,116,0,101,97,100,107,95,100,105,115,112,108,97,121,95,112,117,115,104,95,114,101,99,116,0,101,97,100,107,95,100,105,115,112,108,97,121,95,112,117,115,104,95,114,101,99,116,95,117,110,105,102,111,114,109,0,101,97,100,107,95,100,105,115,112,108,97,121,95,119,97,105,116,95,102,111,114,95,118,98,108,97,110,107,0,101,97,100,107,95,100,105,115,112,108,97,121,95,100,114,97,119,95,115,116,114,105,110,103,0,101,97,100,107,95,107,101,121,98,111,97,114,100,95,115,99,97,110,0,101,97,100,107,95,116,105,109,105,110,103,95,109,105,108,108,105,115,0,101,97,100,107,95,116,105,109,105,110,103,95,109,115,108,101,101,112,0,101,97,100,107,95,116,105,109,105,110,103,95,117,115,108,101,101,112,0,101,97,100,107,95,114,97,110,100,111,109,0,0,0,12,0,0,0,10,9,0,0,24,0,0,0,10,10,0,0,36,0,0,0,2,12,0,0,40,0,0,0,2,13,0,0,44,0,0,0,2,14,0,0,48,0,0,0,2,15,0,0,52,0,0,0,2,16,0,0,32,0,0,0,30,11,0,0,0,46,115,121,109,116,97,98,0,46,115,116,114,116,97,98,0,46,115,104,115,116,114,116,97,98,0,46,114,101,108,46,116,101,120,116,0,46,100,97,116,97,0,46,98,115,115,0,46,65,82,77,46,97,116,116,114,105,98,117,116,101,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,52,0,0,0,36,1,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,27,0,0,0,9,0,0,0,64,0,0,0,0,0,0,0,128,5,0,0,64,0,0,0,6,0,0,0,1,0,0,0,4,0,0,0,8,0,0,0,37,0,0,0,1,0,0,0,3,0,0,0,0,0,0,0,88,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,43,0,0,0,8,0,0,0,3,0,0,0,0,0,0,0,88,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,48,0,0,0,3,0,0,112,0,0,0,0,0,0,0,0,88,1,0,0,37,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,128,1,0,0,0,2,0,0,7,0,0,0,8,0,0,0,4,0,0,0,16,0,0,0,9,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,128,3,0,0,254,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,17,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,192,5,0,0,64,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0]}},7573:(e,t,r)=>{"use strict";e.exports=r.p+"ld.wasm"},3835:(e,t,r)=>{"use strict";e.exports=r.p+"objcopy.wasm"},9491:e=>{"use strict";e.exports=require("assert")},4300:e=>{"use strict";e.exports=require("buffer")},2081:e=>{"use strict";e.exports=require("child_process")},6113:e=>{"use strict";e.exports=require("crypto")},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},3292:e=>{"use strict";e.exports=require("fs/promises")},1017:e=>{"use strict";e.exports=require("path")},7282:e=>{"use strict";e.exports=require("process")},2781:e=>{"use strict";e.exports=require("stream")},1576:e=>{"use strict";e.exports=require("string_decoder")},3837:e=>{"use strict";e.exports=require("util")},9796:e=>{"use strict";e.exports=require("zlib")},1735:()=>{},7461:(e,t,r)=>{const{Argument:n}=r(8998),{Command:o}=r(5282),{CommanderError:i,InvalidArgumentError:a}=r(8056),{Help:s}=r(8917),{Option:u}=r(5790);(t=e.exports=new o).program=t,t.Argument=n,t.Command=o,t.CommanderError=i,t.Help=s,t.InvalidArgumentError=a,t.InvalidOptionArgumentError=a,t.Option=u},8998:(e,t,r)=>{const{InvalidArgumentError:n}=r(8056);t.Argument=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e}this._name.length>3&&"..."===this._name.slice(-3)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?t.concat(e):[e]}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,t)=>{if(!this.argChoices.includes(e))throw new n(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(e,t):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}},t.humanReadableArgName=function(e){const t=e.name()+(!0===e.variadic?"...":"");return e.required?"<"+t+">":"["+t+"]"}},5282:(e,t,r)=>{const n=r(2361).EventEmitter,o=r(2081),i=r(1017),a=r(7147),s=r(7282),{Argument:u,humanReadableArgName:c}=r(8998),{CommanderError:l}=r(8056),{Help:f}=r(8917),{Option:h,splitOptionFlags:d,DualOptions:p}=r(5790),{suggestSimilar:m}=r(1812);class g extends n{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this._args=[],this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:e=>s.stdout.write(e),writeErr:e=>s.stderr.write(e),getOutHelpWidth:()=>s.stdout.isTTY?s.stdout.columns:void 0,getErrHelpWidth:()=>s.stderr.isTTY?s.stderr.columns:void 0,outputError:(e,t)=>t(e)},this._hidden=!1,this._hasHelpOption=!0,this._helpFlags="-h, --help",this._helpDescription="display help for command",this._helpShortFlag="-h",this._helpLongFlag="--help",this._addImplicitHelpCommand=void 0,this._helpCommandName="help",this._helpCommandnameAndArgs="help [command]",this._helpCommandDescription="display help for command",this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._hasHelpOption=e._hasHelpOption,this._helpFlags=e._helpFlags,this._helpDescription=e._helpDescription,this._helpShortFlag=e._helpShortFlag,this._helpLongFlag=e._helpLongFlag,this._helpCommandName=e._helpCommandName,this._helpCommandnameAndArgs=e._helpCommandnameAndArgs,this._helpCommandDescription=e._helpCommandDescription,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}command(e,t,r){let n=t,o=r;"object"==typeof n&&null!==n&&(o=n,n=null),o=o||{};const[,i,a]=e.match(/([^ ]+) *(.*)/),s=this.createCommand(i);return n&&(s.description(n),s._executableHandler=!0),o.isDefault&&(this._defaultCommandName=s._name),s._hidden=!(!o.noHelp&&!o.hidden),s._executableFile=o.executableFile||null,a&&s.arguments(a),this.commands.push(s),s.parent=this,s.copyInheritedSettings(this),n?this:s}createCommand(e){return new g(e)}createHelp(){return Object.assign(new f,this.configureHelp())}configureHelp(e){return void 0===e?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return void 0===e?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return"string"!=typeof e&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error("Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()");return(t=t||{}).isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this.commands.push(e),e.parent=this,this}createArgument(e,t){return new u(e,t)}argument(e,t,r,n){const o=this.createArgument(e,t);return"function"==typeof r?o.default(n).argParser(r):o.default(r),this.addArgument(o),this}arguments(e){return e.split(/ +/).forEach((e=>{this.argument(e)})),this}addArgument(e){const t=this._args.slice(-1)[0];if(t&&t.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&void 0!==e.defaultValue&&void 0===e.parseArg)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this._args.push(e),this}addHelpCommand(e,t){return!1===e?this._addImplicitHelpCommand=!1:(this._addImplicitHelpCommand=!0,"string"==typeof e&&(this._helpCommandName=e.split(" ")[0],this._helpCommandnameAndArgs=e),this._helpCommandDescription=t||this._helpCommandDescription),this}_hasImplicitHelpCommand(){return void 0===this._addImplicitHelpCommand?this.commands.length&&!this._actionHandler&&!this._findCommand("help"):this._addImplicitHelpCommand}hook(e,t){const r=["preAction","postAction"];if(!r.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.\nExpecting one of '${r.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return this._exitCallback=e||(e=>{if("commander.executeSubCommandAsync"!==e.code)throw e}),this}_exit(e,t,r){this._exitCallback&&this._exitCallback(new l(e,t,r)),s.exit(e)}action(e){return this._actionHandler=t=>{const r=this._args.length,n=t.slice(0,r);return this._storeOptionsAsProperties?n[r]=this:n[r]=this.opts(),n.push(this),e.apply(this,n)},this}createOption(e,t){return new h(e,t)}addOption(e){const t=e.name(),r=e.attributeName();if(e.negate){const t=e.long.replace(/^--no-/,"--");this._findOption(t)||this.setOptionValueWithSource(r,void 0===e.defaultValue||e.defaultValue,"default")}else void 0!==e.defaultValue&&this.setOptionValueWithSource(r,e.defaultValue,"default");this.options.push(e);const n=(t,n,o)=>{null==t&&void 0!==e.presetArg&&(t=e.presetArg);const i=this.getOptionValue(r);if(null!==t&&e.parseArg)try{t=e.parseArg(t,i)}catch(e){if("commander.invalidArgument"===e.code){const t=`${n} ${e.message}`;this.error(t,{exitCode:e.exitCode,code:e.code})}throw e}else null!==t&&e.variadic&&(t=e._concatValue(t,i));null==t&&(t=!e.negate&&(!(!e.isBoolean()&&!e.optional)||"")),this.setOptionValueWithSource(r,t,o)};return this.on("option:"+t,(t=>{const r=`error: option '${e.flags}' argument '${t}' is invalid.`;n(t,r,"cli")})),e.envVar&&this.on("optionEnv:"+t,(t=>{const r=`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`;n(t,r,"env")})),this}_optionEx(e,t,r,n,o){if("object"==typeof t&&t instanceof h)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");const i=this.createOption(t,r);if(i.makeOptionMandatory(!!e.mandatory),"function"==typeof n)i.default(o).argParser(n);else if(n instanceof RegExp){const e=n;n=(t,r)=>{const n=e.exec(t);return n?n[0]:r},i.default(o).argParser(n)}else i.default(n);return this.addOption(i)}option(e,t,r,n){return this._optionEx({},e,t,r,n)}requiredOption(e,t,r,n){return this._optionEx({mandatory:!0},e,t,r,n)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){if(this._passThroughOptions=!!e,this.parent&&e&&!this.parent._enablePositionalOptions)throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");return this}storeOptionsAsProperties(e=!0){if(this._storeOptionsAsProperties=!!e,this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");return this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this}setOptionValueWithSource(e,t,r){return this.setOptionValue(e,t),this._optionValueSources[e]=r,this}getOptionValueSource(e){return this._optionValueSources[e]}_prepareUserArgs(e,t){if(void 0!==e&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");let r;switch(t=t||{},void 0===e&&(e=s.argv,s.versions&&s.versions.electron&&(t.from="electron")),this.rawArgs=e.slice(),t.from){case void 0:case"node":this._scriptPath=e[1],r=e.slice(2);break;case"electron":s.defaultApp?(this._scriptPath=e[1],r=e.slice(2)):r=e.slice(1);break;case"user":r=e.slice(0);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",r}parse(e,t){const r=this._prepareUserArgs(e,t);return this._parseCommand([],r),this}async parseAsync(e,t){const r=this._prepareUserArgs(e,t);return await this._parseCommand([],r),this}_executeSubCommand(e,t){t=t.slice();let r=!1;const n=[".js",".ts",".tsx",".mjs",".cjs"];function u(e,t){const r=i.resolve(e,t);if(a.existsSync(r))return r;if(n.includes(i.extname(t)))return;const o=n.find((e=>a.existsSync(`${r}${e}`)));return o?`${r}${o}`:void 0}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let c,f=e._executableFile||`${this._name}-${e._name}`,h=this._executableDir||"";if(this._scriptPath){let e;try{e=a.realpathSync(this._scriptPath)}catch(t){e=this._scriptPath}h=i.resolve(i.dirname(e),h)}if(h){let t=u(h,f);if(!t&&!e._executableFile&&this._scriptPath){const r=i.basename(this._scriptPath,i.extname(this._scriptPath));r!==this._name&&(t=u(h,`${r}-${e._name}`))}f=t||f}if(r=n.includes(i.extname(f)),"win32"!==s.platform?r?(t.unshift(f),t=v(s.execArgv).concat(t),c=o.spawn(s.argv[0],t,{stdio:"inherit"})):c=o.spawn(f,t,{stdio:"inherit"}):(t.unshift(f),t=v(s.execArgv).concat(t),c=o.spawn(s.execPath,t,{stdio:"inherit"})),!c.killed){["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((e=>{s.on(e,(()=>{!1===c.killed&&null===c.exitCode&&c.kill(e)}))}))}const d=this._exitCallback;d?c.on("close",(()=>{d(new l(s.exitCode||0,"commander.executeSubCommandAsync","(close)"))})):c.on("close",s.exit.bind(s)),c.on("error",(t=>{if("ENOENT"===t.code){const t=h?`searched for local subcommand relative to directory '${h}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",r=`'${f}' does not exist\n - if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${t}`;throw new Error(r)}if("EACCES"===t.code)throw new Error(`'${f}' not executable`);if(d){const e=new l(1,"commander.executeSubCommandAsync","(error)");e.nestedError=t,d(e)}else s.exit(1)})),this.runningCommand=c}_dispatchSubcommand(e,t,r){const n=this._findCommand(e);if(n||this.help({error:!0}),!n._executableHandler)return n._parseCommand(t,r);this._executeSubCommand(n,t.concat(r))}_checkNumberOfArguments(){this._args.forEach(((e,t)=>{e.required&&null==this.args[t]&&this.missingArgument(e.name())})),this._args.length>0&&this._args[this._args.length-1].variadic||this.args.length>this._args.length&&this._excessArguments(this.args)}_processArguments(){const e=(e,t,r)=>{let n=t;if(null!==t&&e.parseArg)try{n=e.parseArg(t,r)}catch(r){if("commander.invalidArgument"===r.code){const n=`error: command-argument value '${t}' is invalid for argument '${e.name()}'. ${r.message}`;this.error(n,{exitCode:r.exitCode,code:r.code})}throw r}return n};this._checkNumberOfArguments();const t=[];this._args.forEach(((r,n)=>{let o=r.defaultValue;r.variadic?n<this.args.length?(o=this.args.slice(n),r.parseArg&&(o=o.reduce(((t,n)=>e(r,n,t)),r.defaultValue))):void 0===o&&(o=[]):n<this.args.length&&(o=this.args[n],r.parseArg&&(o=e(r,o,r.defaultValue))),t[n]=o})),this.processedArgs=t}_chainOrCall(e,t){return e&&e.then&&"function"==typeof e.then?e.then((()=>t())):t()}_chainOrCallHooks(e,t){let r=e;const n=[];return w(this).reverse().filter((e=>void 0!==e._lifeCycleHooks[t])).forEach((e=>{e._lifeCycleHooks[t].forEach((t=>{n.push({hookedCommand:e,callback:t})}))})),"postAction"===t&&n.reverse(),n.forEach((e=>{r=this._chainOrCall(r,(()=>e.callback(e.hookedCommand,this)))})),r}_parseCommand(e,t){const r=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(r.operands),t=r.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._hasImplicitHelpCommand()&&e[0]===this._helpCommandName)return 1===e.length&&this.help(),this._dispatchSubcommand(e[1],[],[this._helpLongFlag]);if(this._defaultCommandName)return y(this,t),this._dispatchSubcommand(this._defaultCommandName,e,t);!this.commands.length||0!==this.args.length||this._actionHandler||this._defaultCommandName||this.help({error:!0}),y(this,r.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();const n=()=>{r.unknown.length>0&&this.unknownOption(r.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){let r;return n(),this._processArguments(),r=this._chainOrCallHooks(r,"preAction"),r=this._chainOrCall(r,(()=>this._actionHandler(this.processedArgs))),this.parent&&(r=this._chainOrCall(r,(()=>{this.parent.emit(o,e,t)}))),r=this._chainOrCallHooks(r,"postAction"),r}if(this.parent&&this.parent.listenerCount(o))n(),this._processArguments(),this.parent.emit(o,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(n(),this._processArguments())}else this.commands.length?(n(),this.help({error:!0})):(n(),this._processArguments())}_findCommand(e){if(e)return this.commands.find((t=>t._name===e||t._aliases.includes(e)))}_findOption(e){return this.options.find((t=>t.is(e)))}_checkForMissingMandatoryOptions(){for(let e=this;e;e=e.parent)e.options.forEach((t=>{t.mandatory&&void 0===e.getOptionValue(t.attributeName())&&e.missingMandatoryOptionValue(t)}))}_checkForConflictingLocalOptions(){const e=this.options.filter((e=>{const t=e.attributeName();return void 0!==this.getOptionValue(t)&&"default"!==this.getOptionValueSource(t)}));e.filter((e=>e.conflictsWith.length>0)).forEach((t=>{const r=e.find((e=>t.conflictsWith.includes(e.attributeName())));r&&this._conflictingOption(t,r)}))}_checkForConflictingOptions(){for(let e=this;e;e=e.parent)e._checkForConflictingLocalOptions()}parseOptions(e){const t=[],r=[];let n=t;const o=e.slice();function i(e){return e.length>1&&"-"===e[0]}let a=null;for(;o.length;){const e=o.shift();if("--"===e){n===r&&n.push(e),n.push(...o);break}if(!a||i(e)){if(a=null,i(e)){const t=this._findOption(e);if(t){if(t.required){const e=o.shift();void 0===e&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,e)}else if(t.optional){let e=null;o.length>0&&!i(o[0])&&(e=o.shift()),this.emit(`option:${t.name()}`,e)}else this.emit(`option:${t.name()}`);a=t.variadic?t:null;continue}}if(e.length>2&&"-"===e[0]&&"-"!==e[1]){const t=this._findOption(`-${e[1]}`);if(t){t.required||t.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${t.name()}`,e.slice(2)):(this.emit(`option:${t.name()}`),o.unshift(`-${e.slice(2)}`));continue}}if(/^--[^=]+=/.test(e)){const t=e.indexOf("="),r=this._findOption(e.slice(0,t));if(r&&(r.required||r.optional)){this.emit(`option:${r.name()}`,e.slice(t+1));continue}}if(i(e)&&(n=r),(this._enablePositionalOptions||this._passThroughOptions)&&0===t.length&&0===r.length){if(this._findCommand(e)){t.push(e),o.length>0&&r.push(...o);break}if(e===this._helpCommandName&&this._hasImplicitHelpCommand()){t.push(e),o.length>0&&t.push(...o);break}if(this._defaultCommandName){r.push(e),o.length>0&&r.push(...o);break}}if(this._passThroughOptions){n.push(e),o.length>0&&n.push(...o);break}n.push(e)}else this.emit(`option:${a.name()}`,e)}return{operands:t,unknown:r}}opts(){if(this._storeOptionsAsProperties){const e={},t=this.options.length;for(let r=0;r<t;r++){const t=this.options[r].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return w(this).reduce(((e,t)=>Object.assign(e,t.opts())),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr),"string"==typeof this._showHelpAfterError?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr("\n"),this.outputHelp({error:!0}));const r=t||{},n=r.exitCode||1,o=r.code||"commander.error";this._exit(n,o,e)}_parseOptionsEnv(){this.options.forEach((e=>{if(e.envVar&&e.envVar in s.env){const t=e.attributeName();(void 0===this.getOptionValue(t)||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,s.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}}))}_parseOptionsImplied(){const e=new p(this.options),t=e=>void 0!==this.getOptionValue(e)&&!["default","implied"].includes(this.getOptionValueSource(e));this.options.filter((r=>void 0!==r.implied&&t(r.attributeName())&&e.valueFromOption(this.getOptionValue(r.attributeName()),r))).forEach((e=>{Object.keys(e.implied).filter((e=>!t(e))).forEach((t=>{this.setOptionValueWithSource(t,e.implied[t],"implied")}))}))}missingArgument(e){const t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){const t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){const t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){const r=e=>{const t=e.attributeName(),r=this.getOptionValue(t),n=this.options.find((e=>e.negate&&t===e.attributeName())),o=this.options.find((e=>!e.negate&&t===e.attributeName()));return n&&(void 0===n.presetArg&&!1===r||void 0!==n.presetArg&&r===n.presetArg)?n:o||e},n=e=>{const t=r(e),n=t.attributeName();return"env"===this.getOptionValueSource(n)?`environment variable '${t.envVar}'`:`option '${t.flags}'`},o=`error: ${n(e)} cannot be used with ${n(t)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let r=[],n=this;do{const e=n.createHelp().visibleOptions(n).filter((e=>e.long)).map((e=>e.long));r=r.concat(e),n=n.parent}while(n&&!n._enablePositionalOptions);t=m(e,r)}const r=`error: unknown option '${e}'${t}`;this.error(r,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;const t=this._args.length,r=1===t?"":"s",n=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${r} but got ${e.length}.`;this.error(n,{code:"commander.excessArguments"})}unknownCommand(){const e=this.args[0];let t="";if(this._showSuggestionAfterError){const r=[];this.createHelp().visibleCommands(this).forEach((e=>{r.push(e.name()),e.alias()&&r.push(e.alias())})),t=m(e,r)}const r=`error: unknown command '${e}'${t}`;this.error(r,{code:"commander.unknownCommand"})}version(e,t,r){if(void 0===e)return this._version;this._version=e,t=t||"-V, --version",r=r||"output the version number";const n=this.createOption(t,r);return this._versionOptionName=n.attributeName(),this.options.push(n),this.on("option:"+n.name(),(()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,"commander.version",e)})),this}description(e,t){return void 0===e&&void 0===t?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return void 0===e?this._summary:(this._summary=e,this)}alias(e){if(void 0===e)return this._aliases[0];let t=this;if(0!==this.commands.length&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");return t._aliases.push(e),this}aliases(e){return void 0===e?this._aliases:(e.forEach((e=>this.alias(e))),this)}usage(e){if(void 0===e){if(this._usage)return this._usage;const e=this._args.map((e=>c(e)));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?e:[]).join(" ")}return this._usage=e,this}name(e){return void 0===e?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=i.basename(e,i.extname(e)),this}executableDir(e){return void 0===e?this._executableDir:(this._executableDir=e,this)}helpInformation(e){const t=this.createHelp();return void 0===t.helpWidth&&(t.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),t.formatHelp(this,t)}_getHelpContext(e){const t={error:!!(e=e||{}).error};let r;return r=t.error?e=>this._outputConfiguration.writeErr(e):e=>this._outputConfiguration.writeOut(e),t.write=e.write||r,t.command=this,t}outputHelp(e){let t;"function"==typeof e&&(t=e,e=void 0);const r=this._getHelpContext(e);w(this).reverse().forEach((e=>e.emit("beforeAllHelp",r))),this.emit("beforeHelp",r);let n=this.helpInformation(r);if(t&&(n=t(n),"string"!=typeof n&&!Buffer.isBuffer(n)))throw new Error("outputHelp callback must return a string or a Buffer");r.write(n),this.emit(this._helpLongFlag),this.emit("afterHelp",r),w(this).forEach((e=>e.emit("afterAllHelp",r)))}helpOption(e,t){if("boolean"==typeof e)return this._hasHelpOption=e,this;this._helpFlags=e||this._helpFlags,this._helpDescription=t||this._helpDescription;const r=d(this._helpFlags);return this._helpShortFlag=r.shortFlag,this._helpLongFlag=r.longFlag,this}help(e){this.outputHelp(e);let t=s.exitCode||0;0===t&&e&&"function"!=typeof e&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){const r=["beforeAll","before","after","afterAll"];if(!r.includes(e))throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${r.join("', '")}'`);const n=`${e}Help`;return this.on(n,(e=>{let r;r="function"==typeof t?t({error:e.error,command:e.command}):t,r&&e.write(`${r}\n`)})),this}}function y(e,t){e._hasHelpOption&&t.find((t=>t===e._helpLongFlag||t===e._helpShortFlag))&&(e.outputHelp(),e._exit(0,"commander.helpDisplayed","(outputHelp)"))}function v(e){return e.map((e=>{if(!e.startsWith("--inspect"))return e;let t,r,n="127.0.0.1",o="9229";return null!==(r=e.match(/^(--inspect(-brk)?)$/))?t=r[1]:null!==(r=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))?(t=r[1],/^\d+$/.test(r[3])?o=r[3]:n=r[3]):null!==(r=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))&&(t=r[1],n=r[3],o=r[4]),t&&"0"!==o?`${t}=${n}:${parseInt(o)+1}`:e}))}function w(e){const t=[];for(let r=e;r;r=r.parent)t.push(r);return t}t.Command=g},8056:(e,t)=>{class r extends Error{constructor(e,t,r){super(r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}}t.CommanderError=r,t.InvalidArgumentError=class extends r{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}},8917:(e,t,r)=>{const{humanReadableArgName:n}=r(8998);t.Help=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1}visibleCommands(e){const t=e.commands.filter((e=>!e._hidden));if(e._hasImplicitHelpCommand()){const[,r,n]=e._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),o=e.createCommand(r).helpOption(!1);o.description(e._helpCommandDescription),n&&o.arguments(n),t.push(o)}return this.sortSubcommands&&t.sort(((e,t)=>e.name().localeCompare(t.name()))),t}visibleOptions(e){const t=e.options.filter((e=>!e.hidden)),r=e._hasHelpOption&&e._helpShortFlag&&!e._findOption(e._helpShortFlag),n=e._hasHelpOption&&!e._findOption(e._helpLongFlag);if(r||n){let o;o=r?n?e.createOption(e._helpFlags,e._helpDescription):e.createOption(e._helpShortFlag,e._helpDescription):e.createOption(e._helpLongFlag,e._helpDescription),t.push(o)}if(this.sortOptions){const e=e=>e.short?e.short.replace(/^-/,""):e.long.replace(/^--/,"");t.sort(((t,r)=>e(t).localeCompare(e(r))))}return t}visibleArguments(e){return e._argsDescription&&e._args.forEach((t=>{t.description=t.description||e._argsDescription[t.name()]||""})),e._args.find((e=>e.description))?e._args:[]}subcommandTerm(e){const t=e._args.map((e=>n(e))).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce(((e,r)=>Math.max(e,t.subcommandTerm(r).length)),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce(((e,r)=>Math.max(e,t.optionTerm(r).length)),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce(((e,r)=>Math.max(e,t.argumentTerm(r).length)),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let r="";for(let t=e.parent;t;t=t.parent)r=t.name()+" "+r;return r+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){const t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map((e=>JSON.stringify(e))).join(", ")}`),void 0!==e.defaultValue){(e.required||e.optional||e.isBoolean()&&"boolean"==typeof e.defaultValue)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`)}return void 0!==e.presetArg&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),void 0!==e.envVar&&t.push(`env: ${e.envVar}`),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){const t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map((e=>JSON.stringify(e))).join(", ")}`),void 0!==e.defaultValue&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){const r=`(${t.join(", ")})`;return e.description?`${e.description} ${r}`:r}return e.description}formatHelp(e,t){const r=t.padWidth(e,t),n=t.helpWidth||80;function o(e,o){if(o){const i=`${e.padEnd(r+2)}${o}`;return t.wrap(i,n-2,r+2)}return e}function i(e){return e.join("\n").replace(/^/gm," ".repeat(2))}let a=[`Usage: ${t.commandUsage(e)}`,""];const s=t.commandDescription(e);s.length>0&&(a=a.concat([s,""]));const u=t.visibleArguments(e).map((e=>o(t.argumentTerm(e),t.argumentDescription(e))));u.length>0&&(a=a.concat(["Arguments:",i(u),""]));const c=t.visibleOptions(e).map((e=>o(t.optionTerm(e),t.optionDescription(e))));c.length>0&&(a=a.concat(["Options:",i(c),""]));const l=t.visibleCommands(e).map((e=>o(t.subcommandTerm(e),t.subcommandDescription(e))));return l.length>0&&(a=a.concat(["Commands:",i(l),""])),a.join("\n")}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,r,n=40){if(e.match(/[\n]\s+/))return e;const o=t-r;if(o<n)return e;const i=e.slice(0,r),a=e.slice(r),s=" ".repeat(r),u=new RegExp(".{1,"+(o-1)+"}([\\s]|$)|[^\\s]+?([\\s]|$)","g");return i+(a.match(u)||[]).map(((e,t)=>("\n"===e.slice(-1)&&(e=e.slice(0,e.length-1)),(t>0?s:"")+e.trimRight()))).join("\n")}}},5790:(e,t,r)=>{const{InvalidArgumentError:n}=r(8056);function o(e){let t,r;const n=e.split(/[ |,]+/);return n.length>1&&!/^[[<]/.test(n[1])&&(t=n.shift()),r=n.shift(),!t&&/^-[^-]$/.test(r)&&(t=r,r=void 0),{shortFlag:t,longFlag:r}}t.Option=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;const r=o(e);this.short=r.shortFlag,this.long=r.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){return this.implied=Object.assign(this.implied||{},e),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?t.concat(e):[e]}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,t)=>{if(!this.argChoices.includes(e))throw new n(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(e,t):e},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.name().replace(/^no-/,"").split("-").reduce(((e,t)=>e+t[0].toUpperCase()+t.slice(1)))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},t.splitOptionFlags=o,t.DualOptions=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach((e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)})),this.negativeOptions.forEach(((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)}))}valueFromOption(e,t){const r=t.attributeName();if(!this.dualOptions.has(r))return!0;const n=this.negativeOptions.get(r).presetArg,o=void 0!==n&&n;return t.negate===(o===e)}}},1812:(e,t)=>{t.suggestSimilar=function(e,t){if(!t||0===t.length)return"";t=Array.from(new Set(t));const r=e.startsWith("--");r&&(e=e.slice(2),t=t.map((e=>e.slice(2))));let n=[],o=3;return t.forEach((t=>{if(t.length<=1)return;const r=function(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);const r=[];for(let t=0;t<=e.length;t++)r[t]=[t];for(let e=0;e<=t.length;e++)r[0][e]=e;for(let n=1;n<=t.length;n++)for(let o=1;o<=e.length;o++){let i=1;i=e[o-1]===t[n-1]?0:1,r[o][n]=Math.min(r[o-1][n]+1,r[o][n-1]+1,r[o-1][n-1]+i),o>1&&n>1&&e[o-1]===t[n-2]&&e[o-2]===t[n-1]&&(r[o][n]=Math.min(r[o][n],r[o-2][n-2]+1))}return r[e.length][t.length]}(e,t),i=Math.max(e.length,t.length);(i-r)/i>.4&&(r<o?(o=r,n=[t]):r===o&&n.push(t))})),n.sort(((e,t)=>e.localeCompare(t))),r&&(n=n.map((e=>`--${e}`))),n.length>1?`\n(Did you mean one of ${n.join(", ")}?)`:1===n.length?`\n(Did you mean ${n[0]}?)`:""}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},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.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.p="";var n={};(()=>{"use strict";r.d(n,{default:()=>Qt});var e=r(7757),t=r.n(e);const o=require("usb");function i(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,n.key,n)}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function u(e){var t="function"==typeof Map?new Map:void 0;return u=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return c(e,arguments,h(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),f(n,e)},u(e)}function c(e,t,r){return c=l()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&f(o,r.prototype),o},c.apply(null,arguments)}function l(){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}}function f(e,t){return f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},f(e,t)}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}const d=function(e){!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&&f(e,t)}(d,e);var t,r,n,o,u,c=(t=d,r=l(),function(){var e,n=h(t);if(r){var o=h(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return s(this,e)});function d(e){var t;a(this,d);for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return(t=c.call.apply(c,[this].concat(n))).name=e,t}return n=d,o&&i(n.prototype,o),u&&i(n,u),Object.defineProperty(n,"prototype",{writable:!1}),n}(u(Error));function p(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,n.key,n)}}var m=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r,n;return t=e,n=[{key:"append",value:function(t){for(var r="",n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];o.forEach((function(e){r+=e+","})),e.Content+=+new Date+","+t+","+r+"\n"}},{key:"info",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e.append.apply(e,["info"].concat(r))}},{key:"warn",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e.append.apply(e,["warn"].concat(r))}},{key:"error",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e.append.apply(e,["error"].concat(r))}}],(r=null)&&p(t.prototype,r),n&&p(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();m.Content="";const g=m;function y(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return v(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return v(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function w(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function b(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){w(i,n,o,a,s,"next",e)}function s(e){w(i,n,o,a,s,"throw",e)}a(void 0)}))}}function E(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,n.key,n)}}function _(e,t,r){return t&&E(e.prototype,t),r&&E(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function S(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function A(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&&I(e,t)}function I(e,t){return I=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},I(e,t)}function k(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=P(e);if(t){var o=P(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return C(this,r)}}function C(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function P(e){return P=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},P(e)}var O=6,T=8,x=10,R=2,D=3,M=4,F=1033;function N(e){return{bLength:e.getUint8(0),bDescriptorType:e.getUint8(1),bInterfaceNumber:e.getUint8(2),bAlternateSetting:e.getUint8(3),bNumEndpoints:e.getUint8(4),bInterfaceClass:e.getUint8(5),bInterfaceSubClass:e.getUint8(6),bInterfaceProtocol:e.getUint8(7),iInterface:e.getUint8(8),endpoints:[]}}function L(e){var t=function(e){for(var t,r=e,n=[];r.byteLength>2;){var o=r.getUint8(0),i=r.getUint8(1),a=new DataView(r.buffer.slice(0,o));if(i==M)t=N(a),n.push(t);else{var s={bLength:o,bDescriptorType:i,data:a};t?t.endpoints.push(s):n.push(s)}r=new DataView(r.buffer.slice(o))}return n}(new DataView(e.buffer.slice(9)));return{bLength:e.getUint8(0),bDescriptorType:e.getUint8(1),wTotalLength:e.getUint16(2,!0),bNumInterfaces:e.getUint8(4),bConfigurationValue:e.getUint8(5),iConfiguration:e.getUint8(6),bmAttributes:e.getUint8(7),bMaxPower:e.getUint8(8),interfaces:t}}function H(e){return g.info("DFU","getConfiguration"),new Promise((function(t,r){e.device.controlTransferIn({requestType:"standard",recipient:"device",request:T,value:0,index:0},1).then((function(e){"ok"==e.status?t(e.data.getInt8(0)):r(new Error("Wrong getConfiguration status: "+e.status))})).catch((function(e){r(new Error("Get configuration failed --\x3e "+e))}))}))}function U(e){return g.info("DFU","getInterface"),new Promise((function(t,r){e.device.controlTransferIn({requestType:"standard",recipient:"interface",request:x,value:0,index:e.settings.interface.interfaceNumber},1).then((function(e){"ok"==e.status?t(e.data.getInt8(0)):r(new Error("Wrong getInterface status: "+e.status))})).catch((function(e){r(new Error("Get interface failed --\x3e "+e))}))}))}function B(e,t){return g.info("DFU","getConfigurationDescriptor","index "+t),new Promise((function(r,n){e.device.controlTransferIn({requestType:"standard",recipient:"device",request:O,value:t|R<<8,index:0},4).then((function(o){if("ok"==o.status){var i=o.data.getUint16(2,!0);e.device.controlTransferIn({requestType:"standard",recipient:"device",request:O,value:t|R<<8,index:0},i).then((function(e){"ok"==e.status?r(L(e.data)):n(new Error("Wrong getConfigurationDescriptor status: "+e.status))})).catch((function(e){n(e)}))}else n(new Error("Wrong getConfigurationDescriptor status: "+o.status))})).catch((function(e){n(new Error("Get configuration descriptor failed --\x3e "+e))}))}))}function z(e,t){return g.info("DFU","getStringDescriptor","index "+t),new Promise((function(r,n){e.device.controlTransferIn({requestType:"standard",recipient:"device",request:O,value:t|D<<8,index:F},255).then((function(e){"ok"==e.status?(e.data.getInt8(1)!=D&&n(new Error("Wrong descriptor type: "+e.data.getInt8(1))),r(new TextDecoder("utf-16").decode(new Uint16Array(e.data.buffer,2)))):n(new Error("Wrong getStringDescriptor status: "+e.status))})).catch((function(e){n(new Error("Get string descriptor failed --\x3e "+e))}))}))}var j={Offset:0,Size:11,Signature:{Offset:0,Size:5}},V={Offset:11,TargetPrefix:{Offset:0,Size:274,Signature:{Offset:0,Size:6},NbElements:{Offset:270,Size:4}},Element:{Offset:274,Address:{Offset:0,Size:4},Size:{Offset:4,Size:4},Data:{Offset:8}}},G=1,$=2,X=3,K=4,W=5,q=6,Y=0,Z=2,J=4,Q=5,ee=7,te=10,re=33,ne=65,oe=function(e){A(r,e);var t=k(r);function r(){S(this,r);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.call.apply(t,[this,"DFUError"].concat(n))}return _(r)}(d),ie=function(e){A(r,e);var t=k(r);function r(){S(this,r);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.call.apply(t,[this,"DFUInterfaceError"].concat(n))}return _(r)}(d);function ae(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return g.info("DFU","requestIn","bRequest: "+t,"data: "+r,"wValue: "+n),new Promise((function(o,i){e.device.controlTransferIn({requestType:"class",recipient:"interface",request:t,value:n,index:e.settings.interface.interfaceNumber},r).then((function(e){"ok"==e.status?o(e.data):i(new Error("Wrong requestIn status: "+e.status))})).catch((function(e){i(new Error("ControlTransferIn failed --\x3e "+e))}))}))}function se(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return g.info("DFU","requestOut","bRequest: "+t,"data: "+r,"wValue: "+n),new Promise((function(o,i){e.device.controlTransferOut({requestType:"class",recipient:"interface",request:t,value:n,index:e.settings.interface.interfaceNumber},r).then((function(e){"ok"==e.status?o(e.bytesWritten):i(new Error("Wrong requestOut status: "+e.status))})).catch((function(e){i(new Error("ControlTransferOut failed --\x3e "+e))}))}))}function ue(e){return g.info("DFU","getState"),new Promise((function(t,r){ae(e,W,1).then((function(e){t(e.getUint8(0))})).catch((function(e){r(new Error("Get state failed --\x3e "+e))}))}))}function ce(e){return g.info("DFU","getStatus"),new Promise((function(t,r){ae(e,X,6).then((function(e){t({status:e.getUint8(0),pollTimeout:16777215&e.getUint32(1,!0),state:e.getUint8(4)})})).catch((function(e){r(new Error("Get status failed --\x3e "+e))}))}))}function le(e){return fe.apply(this,arguments)}function fe(){return fe=b(t().mark((function e(r){var n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g.info("DFU","abortToIdle"),e.prev=1,e.next=4,se(r,q);case 4:return e.next=6,ue(r);case 6:if((n=e.sent)!=te){e.next=13;break}return e.next=10,se(r,K);case 10:return e.next=12,ue(r);case 12:n=e.sent;case 13:if(n==Z){e.next=15;break}throw new Error("State is "+n.state+"instead of DFU IDLE (2).");case 15:e.next=20;break;case 17:throw e.prev=17,e.t0=e.catch(1),new Error("Abort to idle failed --\x3e "+e.t0);case 20:case"end":return e.stop()}}),e,null,[[1,17]])}))),fe.apply(this,arguments)}function he(e,t){return de.apply(this,arguments)}function de(){return de=b(t().mark((function e(r,n){var o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=function(e){return new Promise((function(t,r){setTimeout(t,e)}))},g.info("DFU","pollUntil",n),e.prev=2,e.next=5,ce(r);case 5:i=e.sent;case 6:if(n(i.state)||i.state==te){e.next=14;break}return e.next=9,o(i.pollTimeout);case 9:return e.next=11,ce(r);case 11:i=e.sent,e.next=6;break;case 14:return e.abrupt("return",i);case 17:throw e.prev=17,e.t0=e.catch(2),new Error("Poll until failed --\x3e "+e.t0);case 20:case"end":return e.stop()}}),e,null,[[2,17]])}))),de.apply(this,arguments)}function pe(e,t){return me.apply(this,arguments)}function me(){return me=b(t().mark((function e(r,n){var o,i,a;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g.info("DFU","setAddress",Number(n).toString(16)),o=new ArrayBuffer(5),(i=new DataView(o)).setUint8(0,re),i.setUint32(1,n,!0),e.prev=5,e.next=8,se(r,G,o,0);case 8:return e.next=10,he(r,(function(e){return e!=J}));case 10:if((a=e.sent).status==Y){e.next=13;break}throw"Status is "+a.status+" instead of Status OK (0).";case 13:e.next=18;break;case 15:throw e.prev=15,e.t0=e.catch(5),"Set address to "+n+" failed --\x3e "+e.t0;case 18:case"end":return e.stop()}}),e,null,[[5,15]])}))),me.apply(this,arguments)}const ge=function(){function e(r,n){S(this,e),this.open=b(t().mark((function e(){var r,n,o;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g.info("DFU","open"),e.prev=1,e.next=4,this.device.open();case 4:e.next=9;break;case 6:throw e.prev=6,e.t0=e.catch(1),new oe("OPEN failed --\x3e "+e.t0);case 9:if(r=this.settings.configuration.configurationValue,null!=this.device.configuration&&this.device.configuration.configurationValue==r){e.next=19;break}return e.prev=11,e.next=14,this.device.selectConfiguration(r);case 14:e.next=19;break;case 16:throw e.prev=16,e.t1=e.catch(11),new oe("OPEN failed: could not select configuration --\x3e "+e.t1);case 19:if(n=this.settings.interface.interfaceNumber,this.device.configuration.interfaces[n].claimed){e.next=29;break}return e.prev=21,e.next=24,this.device.claimInterface(n);case 24:e.next=29;break;case 26:throw e.prev=26,e.t2=e.catch(21),new ie("OPEN failed: could not claim interface --\x3e "+e.t2);case 29:if(o=this.settings.alternate.alternateSetting,null!=this.device.configuration.interfaces[n].alternate&&this.device.configuration.interfaces[n].alternate==o){e.next=39;break}return e.prev=31,e.next=34,this.device.selectAlternateInterface(n,o);case 34:e.next=39;break;case 36:throw e.prev=36,e.t3=e.catch(31),new oe("OPEN failed: could not select alternate interface --\x3e "+e.t3);case 39:case"end":return e.stop()}}),e,this,[[1,6],[11,16],[21,26],[31,36]])}))),this.close=b(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g.info("DFU","close"),e.prev=1,e.next=4,this.device.close();case 4:e.next=9;break;case 6:throw e.prev=6,e.t0=e.catch(1),new oe("CLOSE failed --\x3e "+e.t0);case 9:case"end":return e.stop()}}),e,this,[[1,6]])}))),this.getMemoryLayout=b(t().mark((function e(){var r,n=this;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g.info("DFU","getMemoryLayout"),e.prev=1,e.delegateYield(t().mark((function e(){var r,o,i,a,s,u,c,l,f;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,H(n);case 2:return r=e.sent,e.next=5,B(n,r-1);case 5:return o=e.sent,e.next=8,U(n);case 8:return i=e.sent,a=o.interfaces[i].iInterface,e.next=12,z(n,a);case 12:for(s=e.sent,u=s.split("/"),c=[],l=function(e){var t=parseInt(u[e]),r=u[e+1].split(","),n=/(\d+)\*(\d+)([K|M])g/;r.forEach((function(e){var r=e.match(n),o=parseInt(r[1]),i=parseInt(r[2]),a=r[3];"K"==a?i*=1024:"M"==a&&(i*=1048576);var s=o*i,u={address:t,lastAddress:t+s-1,size:s,nbPage:o,pageSize:i};c.push(u),t+=s}))},f=1;f<u.length;f+=2)l(f);return e.abrupt("return",{v:c});case 18:case"end":return e.stop()}}),e)}))(),"t0",3);case 3:if("object"!=typeof(r=e.t0)){e.next=6;break}return e.abrupt("return",r.v);case 6:e.next=11;break;case 8:throw e.prev=8,e.t1=e.catch(1),new oe("GET MEMORY LAYOUT failed --\x3e "+e.t1);case 11:case"end":return e.stop()}}),e,null,[[1,8]])}))),this.upload=function(){var e=b(t().mark((function e(r,n,o){var i,a,s,u,c,l;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g.info("DFU","upload","address "+Number(r).toString(16),"Length "+Number(n).toString(16)),e.prev=1,e.next=4,ue(this);case 4:if(e.sent==Z){e.next=8;break}return e.next=8,le(this);case 8:return e.next=10,pe(this,r);case 10:return e.next=12,le(this);case 12:i=2,a=new Uint8Array(n),s=0,o&&o(0);case 16:return c=Math.min(this.TransferSize,n-s),g.info("DFU","upload","block number "+i,"bytes to read "+c),e.next=20,ae(this,$,c,i++);case 20:(u=e.sent).byteLength>0&&(l=new Uint8Array(u.buffer),a.set(l,s),s+=u.byteLength),o&&o(s/n);case 23:if(s<n){e.next=16;break}case 24:return e.next=26,le(this);case 26:return e.abrupt("return",a);case 29:return e.prev=29,e.t0=e.catch(1),e.next=33,le(this);case 33:throw new oe("UPLOAD failed at address "+r+" of length "+n+" --\x3e "+e.t0);case 34:case"end":return e.stop()}}),e,this,[[1,29]])})));return function(t,r,n){return e.apply(this,arguments)}}(),this.download=function(){var e=b(t().mark((function e(r,n,o){var i,a,s,u,c,l,f;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:g.info("DFU","download","address "+Number(r).toString(16)),e.prev=1,i=0,a=n.byteLength,s=r,o&&o(0);case 6:if(!(i<a)){e.next=27;break}return u=a-i,c=Math.min(u,this.TransferSize),g.info("DFU","download step, at address "+Number(r).toString(16)),l=0,f=void 0,e.next=14,pe(this,s);case 14:return e.next=16,se(this,G,n.slice(i,i+c),2);case 16:return l=e.sent,e.next=19,he(this,(function(e){return e==Q||e==Z}));case 19:if(f=e.sent,s+=c,f.status==Y){e.next=23;break}throw"state=".concat(f.state,", status=").concat(f.status);case 23:i+=l,o&&o(i/a),e.next=6;break;case 27:e.next=32;break;case 29:throw e.prev=29,e.t0=e.catch(1),new oe("DOWNLOAD failed at address "+Number(r).toString(16)+" --\x3e "+e.t0);case 32:case"end":return e.stop()}}),e,this,[[1,29]])})));return function(t,r,n){return e.apply(this,arguments)}}(),this.leave=function(){var e=b(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g.info("DFU","leave","address "+Number(r).toString(16)),e.prev=1,e.next=4,pe(this,r);case 4:return e.next=6,se(this,G,new ArrayBuffer,2);case 6:return e.next=8,he(this,(function(e){return e==ee}));case 8:e.next=13;break;case 10:throw e.prev=10,e.t0=e.catch(1),new oe("LEAVE failed at address "+Number(r).toString(16)+" --\x3e "+e.t0);case 13:case"end":return e.stop()}}),e,this,[[1,10]])})));return function(t){return e.apply(this,arguments)}}(),this.eraseSegment=function(){var e=b(t().mark((function e(r){var n,o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g.info("DFU","eraseSegment","address "+Number(r).toString(16)),e.prev=1,e.next=4,ue(this);case 4:if(e.sent==Z){e.next=8;break}return e.next=8,le(this);case 8:return n=new ArrayBuffer(5),(o=new DataView(n)).setUint8(0,ne),o.setUint32(1,r,!0),e.next=14,se(this,G,n,0);case 14:return e.next=16,ce(this);case 16:if((i=e.sent).state==J){e.next=19;break}throw"wrong DFU state: "+i.state;case 19:return e.next=21,he(this,(function(e){return e!=J}));case 21:if((i=e.sent).status==Y){e.next=24;break}throw"wrong DFU status: "+i.status;case 24:e.next=29;break;case 26:throw e.prev=26,e.t0=e.catch(1),new oe("ERASE SEGMENT failed at address "+r+" --\x3e "+e.t0);case 29:case"end":return e.stop()}}),e,this,[[1,26]])})));return function(t){return e.apply(this,arguments)}}(),this.TransferSize=n,this.device=r;var o,i=y(r.configurations);try{for(i.s();!(o=i.n()).done;){var a,s=o.value,u=y(s.interfaces);try{for(u.s();!(a=u.n()).done;){var c,l=a.value,f=y(l.alternates);try{for(f.s();!(c=f.n()).done;){var h=c.value;if(254==h.interfaceClass&&1==h.interfaceSubclass&&(1==h.interfaceProtocol||2==h.interfaceProtocol))return this.settings={configuration:s,interface:l,alternate:h},this}}catch(e){f.e(e)}finally{f.f()}}}catch(e){u.e(e)}finally{u.f()}}}catch(e){i.e(e)}finally{i.f()}return this.settings={configuration:{configurationValue:1},interface:{interfaceNumber:0},alternate:{alternateSetting:0}},this}return _(e,null,[{key:"Parse",value:function(e){new DataView(e);var t=new TextDecoder("utf-8").decode(new Uint8Array(e.slice(j.Signature.Offset,j.Signature.Offset+j.Signature.Size)));if("DfuSe"!=t)throw new oe("Parsed file is not a DFU file (invalid signature)");var r=e.slice(V.Offset);if("Target"!=(t=new TextDecoder("utf-8").decode(new Uint8Array(r.slice(V.TargetPrefix.Signature.Offset,V.TargetPrefix.Signature.Size)))))throw new oe("Corrupted DFU file (invalid target signature)");for(var n=[],o=new DataView(r,V.TargetPrefix.NbElements.Offset,V.TargetPrefix.NbElements.Offset+V.TargetPrefix.NbElements.Size).getUint32(0,!0),i=r.slice(V.Element.Offset),a=0;a<o;a++){var s=new DataView(i,V.Element.Address.Offset,V.Element.Address.Offset+V.Element.Address.Size).getUint32(0,!0),u=new DataView(i,V.Element.Size.Offset,V.Element.Address.Offset+V.Element.Size.Size).getUint32(0,!0),c=i.slice(V.Element.Data.Offset,V.Element.Data.Offset+u);i=i.slice(V.Element.Data.Offset+u),n.push({address:s,size:u,data:c})}return n}}]),e}();function ye(e){return new TextDecoder("utf-8").decode(e.subarray(0,e.indexOf(0)))}function ve(e){var t=new TextEncoder("utf-8").encode(e),r=new Uint8Array(t.length+1);return r.set(t,0),r.set([0],t.length),r}function we(e){for(var t=new Uint8Array(e.length/2),r=0;r<t.length;r++)t[r]=parseInt(e.substr(2*r,2),16);return t}function be(e){for(var t=atob(e),r="",n=0;n<t.length;n++){var o=t.charCodeAt(n).toString(16);r+=2===o.length?o:"0"+o}return r.toUpperCase()}function Ee(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return _e(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _e(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function _e(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Se(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,n.key,n)}}function Ae(e,t,r){return t&&Se(e.prototype,t),r&&Se(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ke(e,t){return ke=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ke(e,t)}function Ce(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=Oe(e);if(t){var o=Oe(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Pe(this,r)}}function Pe(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Oe(e){return Oe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Oe(e)}var Te=function(e){!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&&ke(e,t)}(r,e);var t=Ce(r);function r(){Ie(this,r);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.call.apply(t,[this,"StorageError"].concat(n))}return Ae(r)}(d);function xe(e){return new DataView(e.buffer,e.byteOffset).getUint16(0,!0)}function Re(e){var t={size:0,name:"unknown",content:"unknown"};return t.size=xe(e),t.name=ye(e.subarray(2)),t.content=e.subarray(2+t.name.length+1,t.size),t}var De=function(e){function t(e){Ie(this,t),this.records=e}return Ae(t,[{key:Symbol.iterator,value:function(){var e=this.records;return{next:function(){var t=xe(e);if(0===t)return{done:!0};var r=Re(e);return e=e.subarray(t),{value:r,done:!1}}}}}]),t}();const Me=Ae((function e(t){Ie(this,e),this.availableSize=function(){var e,t=0,r=Ee(new De(this.data));try{for(r.s();!(e=r.n()).done;){t+=e.value.size}}catch(e){r.e(e)}finally{r.f()}return this.totalSize()-t},this.totalSize=function(){return this.data.byteLength-2},this.recordsWithExtension=function(e){var t,r=[],n=Ee(new De(this.data));try{for(n.s();!(t=n.n()).done;){var o=t.value;o.name.endsWith(e)&&r.push(o.name)}}catch(e){n.e(e)}finally{n.f()}return r},this.size=function(e){var t,r=Ee(new De(this.data));try{for(r.s();!(t=r.n()).done;){var n=t.value;if(n.name===e)return n.size}}catch(e){r.e(e)}finally{r.f()}},this.content=function(e){var t,r=Ee(new De(this.data));try{for(r.s();!(t=r.n()).done;){var n=t.value;if(n.name===e)return n.content}}catch(e){r.e(e)}finally{r.f()}},this.setContent=function(e,t){var r,n=0,o=0,i=Ee(new De(this.data));try{for(i.s();!(r=i.n()).done;){var a=r.value;if(a.name===e){o=a.size;break}n+=a.size}}catch(e){i.e(e)}finally{i.f()}var s=this.data.slice(n+o),u=n,c=function(e,t){if(void 0!==t){var r=e.length+1+t.byteLength+2,n=new Uint8Array(r);return new DataView(n.buffer,n.byteOffset).setUint16(0,r,!0),n.set(ve(e),2),n.set(t,2+e.length+1),n}}(e,t);if(void 0!==c){if(Re(c).size>this.availableSize()+o)throw new Te("The storage on calculator is full");this.data.set(c,n),u+=c.length,s=s.slice(0,this.data.length-(n+c.length))}this.data.set(s,u),this.data.fill(0,u+s.length)},this.data=t}));function Fe(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Ne(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ne(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function Ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Le(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function He(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Le(i,n,o,a,s,"next",e)}function s(e){Le(i,n,o,a,s,"throw",e)}a(void 0)}))}}function Ue(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,n.key,n)}}function Be(e,t,r){return t&&Ue(e.prototype,t),r&&Ue(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ze(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function je(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&&Ve(e,t)}function Ve(e,t){return Ve=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ve(e,t)}function Ge(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=Xe(e);if(t){var o=Xe(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return $e(this,r)}}function $e(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Xe(e){return Xe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Xe(e)}var Ke=we("F00DC0DE"),We=we("FEEDC0DE"),qe=we("BADBEEEF"),Ye=function(e){je(r,e);var t=Ge(r);function r(){ze(this,r);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.call.apply(t,[this,"CalculatorMemoryCorruption"].concat(n))}return Be(r)}(d),Ze=function(e){je(r,e);var t=Ge(r);function r(){ze(this,r);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.call.apply(t,[this,"BusyCalculatorError"].concat(n))}return Be(r)}(d),Je=function(e){je(r,e);var t=Ge(r);function r(){ze(this,r);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.call.apply(t,[this,"WebUSBError"].concat(n))}return Be(r)}(d),Qe=function(e){je(r,e);var t=Ge(r);function r(){ze(this,r);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.call.apply(t,[this,"USBConnectionError"].concat(n))}return Be(r)}(d),et=function(e){je(r,e);var t=Ge(r);function r(){ze(this,r);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.call.apply(t,[this,"ForbiddenMemoryAccessError"].concat(n))}return Be(r)}(d),tt={N0100:{name:"N0100",RAMAddressStart:536870912,RAMAddressEnd:537133056},N0110:{name:"N0110",RAMAddressStart:536870912,RAMAddressEnd:537133056},N0120:{name:"N0120",RAMAddressStart:603979776,RAMAddressEnd:604307456},N0120Prototype:{displayed_name:"N0120",name:"N0120_PORTUGAL_PROTOTYPE_20210930",RAMAddressStart:603979776,RAMAddressEnd:604307456}},rt=we("BADD0BEE");function nt(e,t){if(e.length<t.length)return!1;for(var r=0;r<t.length;r++)if(e[r]!==t[r])return!1;return!0}function ot(e,t){return!(e.length<t.length)&&nt(e.subarray(e.length-t.length),t)}function it(e,t){if(!(e>=134217728&&e+t<=135266304||e>=2415919104&&e+t<=2424307712))throw new et("Access to address: "+e+" (length "+t+") is out of flash range")}function at(e,t,r){if(t<e.RAMAddressStart||t+r>=e.RAMAddressEnd)throw new et("Access to address: "+t+" (length "+r+") is out of RAM range")}function st(e){if(g.info("Calculator","parseSlotInfo","header info "+e),!nt(e,qe)||!ot(e,qe))return null;var t=new DataView(e.buffer,e.byteOffset);return{kernelHeaderAddress:t.getUint32(4,!0),userlandHeaderAddress:t.getUint32(8,!0)}}function ut(e,t){if(g.info("Calculator","parseFirmwareHeader","header "+e),!nt(e,Ke))return t;t.version=ye(e.subarray(4)),t.patch=ye(e.subarray(12));var r=e.subarray(20);if(nt(r,Ke))return t;var n=new DataView(e.buffer,e.byteOffset);return t.storageAddress=n.getUint32(20,!0),nt(r=e.subarray(24),Ke)||(t.storageSize=n.getUint32(24,!0)),t}function ct(e,t){if(g.info("Calculator","parseUserlandHeader","header "+e),!nt(e,We))return t;t.userlandVersion=ye(e.subarray(4));var r=new DataView(e.buffer,e.byteOffset),n=12;return t.storageAddress=r.getUint32(n,!0),n+=4,t.storageSize=r.getUint32(n,!0),n+=4,t.externalAppsFlashStart=r.getUint32(n,!0),n+=4,t.externalAppsFlashEnd=r.getUint32(n,!0),n+=4,t.externalAppsRamStart=r.getUint32(n,!0),n+=4,t.externalAppsRamEnd=r.getUint32(n,!0),t}function lt(){return(lt=He(t().mark((function e(r,n,o){var i,a,s,u,c,l,f,h;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g.info("Calculator","uploadHeader","address "+Number(n[0].address).toString(16)),i={version:"0.0.0",patch:"0000000",userlandVersion:"unknown",externalAppsFlashStart:"unknown",externalAppsFlashEnd:"unknown",externalAppsRamStart:"unknown",externalAppsRamEnd:"unknown",storageAddress:"unknown",storageSize:4096},e.prev=2,a=n[0].address+pt.Header0.Offset,s=pt.Header0.Size,it(a,s),e.next=8,r.upload(a,s);case 8:if(!nt(u=e.sent,Ke)||!ot(u,Ke)){e.next=13;break}return e.abrupt("return",ut(u,i));case 13:return a=n[0].address+pt.Header1.Offset,s=pt.Header1.Size,it(a,s),e.next=18,r.upload(a,s);case 18:if(!nt(u=e.sent,Ke)||!ot(u,Ke)){e.next=23;break}return e.abrupt("return",ut(u,i));case 23:return a=o.RAMAddressStart,s=pt.Header2.SlotInfoSize,at(o,a,s),e.prev=26,e.next=29,r.upload(a,s);case 29:if(c=e.sent,null!=(l=st(c))){e.next=33;break}throw new Ye("The slot info was corrupted");case 33:return a=l.kernelHeaderAddress,s=pt.Header2.KernelHeaderSize,it(a,s),e.next=38,r.upload(a,s);case 38:return f=e.sent,i=ut(f,i),a=l.userlandHeaderAddress,s=pt.Header2.UserlandHeaderSize,it(a,s),e.next=45,r.upload(a,s);case 45:return h=e.sent,i=ct(h,i),e.abrupt("return",i);case 50:return e.prev=50,e.t0=e.catch(26),e.abrupt("return",ut(u,i));case 53:e.next=59;break;case 55:throw e.prev=55,e.t1=e.catch(2),e.t1.message="Upload header failed --\x3e "+e.t1.message,e.t1;case 59:case"end":return e.stop()}}),e,null,[[2,55],[26,50]])})))).apply(this,arguments)}function ft(e,t){if(g.info("Calculator","calculatorGetStorage","address "+Number(t.firmware.storageAddress).toString(16)),"unknown"===t.firmware.storageAddress)throw new Ye("The Storage address could not be found in header");try{at(t.model,t.firmware.storageAddress,t.firmware.storageSize+2*rt.length)}catch(e){throw new Ye("Calculator Get Storage failed --\x3e "+e)}return!1!==e.storage?e.storage:new Promise((function(r,n){e.dfu.upload(t.firmware.storageAddress,t.firmware.storageSize+2*rt.length).then((function(o){if(nt(o,rt)&&ot(o,rt)){var i=o.subarray(rt.length,t.firmware.storageSize+rt.length);e.storage=new Me(i),r(e.storage)}else n(new Ye("Memory is corrupted: could not find storage tags"))})).catch((function(e){e.message="CalculationGetStorage failed --\x3e "+e.message,n(e)}))}))}function ht(e,t,r){g.info("Calculator","calculatorSetStorage","address "+Number(t.firmware.storageAddress).toString(16));try{at(t.model,t.firmware.storageAddress+rt.length,r.data)}catch(e){throw new Ye("Calculator Set Storage failed --\x3e "+e)}return new Promise((function(n,o){e.dfu.download(t.firmware.storageAddress+rt.length,r.data).then((function(){n(!0)})).catch((function(e){e.message="CalculationSetStorage failed --\x3e "+e.message,o(e)}))}))}function dt(e){var t=ve(e),r=new Uint8Array(t.length+1);return r[0]=1,r.set(t,1),r}var pt=function(){function e(){ze(this,e),this.dfu=!1,this.running=!1,this.storage=!1,this.infos=!1}return Be(e,[{key:"connectAndProcess",value:function(t){var r,n=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[e.Product.Numworks],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return g.info("Calculator","connectAndProcess"),new Promise((function(e,a){n.running?new Promise((function(e,t){e(!0)})).then((function(){return a(new Ze("Calculator is already processing another request"))})):(n.running=!0,n.connect(o,i).then((function(o){if(!o.connected())return n.running=!1,a(new Qe("No usb connection found"));n.dfu.open().then((function(){return t(o)})).then((function(e){if(r=e,n.dfu.opened)return n.dfu.close()})).then((function(){return n.running=!1,e(r)})).catch((function(e){return n.running=!1,a(e)}))})).catch((function(e){n.running=!1,a(e)})))}))}},{key:"connected",value:function(){return!1!==this.dfu}},{key:"connect",value:function(t,r){var n=this;g.info("Calculator","connect",t),this.storage=!1,this.dfu=!1,this.infos=!1;var o=t.map((function(t){return t==e.Product.Numworks?41617:57105})),i=[];return o.forEach((function(e){return i.push({vendorId:1155,productId:e})})),new Promise((function(e,t){null==navigator.usb?new Promise((function(e,t){e(!0)})).then((function(){return t(new Je("Web usb unvailable"))})):r?(g.info("Calculator","connect","request device"),navigator.usb.requestDevice({filters:i}).then((function(t){return n.dfu=new ge(t,2048),e(n)})).catch((function(e){t(new Qe("Usb device selection failure: "+e))}))):(g.info("Calculator","connect","get device"),navigator.usb.getDevices().then((function(t){var r,i=Fe(t);try{for(i.s();!(r=i.n()).done;){var a=r.value;1155===a.vendorId&&o.includes(a.productId)&&(n.dfu=new ge(a,2048))}}catch(e){i.e(e)}finally{i.f()}return e(n)})).catch((function(e){t(new Qe("Usb device failed: "+e))})))}))}},{key:"getInfos",value:function(){var e=this;return g.info("Calculator","getInfos"),new Promise((function(t,r){var n,o;return!1!==e.infos?t(e.infos):e.dfu.getMemoryLayout().then((function(t){return n=t,o=function(e,t){if("NumWorks Calculator"==e.productName&&2==e.deviceVersionMinor)return"EAAbABVROTUxNDM4"==e.serialNumber?tt.N0120Prototype:tt.N0120;var r=t[t.length-1].lastAddress;return r>135135232&&r<2415919104?tt.N0100:tt.N0110}(e.dfu.device,n),function(e,t,r){return lt.apply(this,arguments)}(e.dfu,n,o)})).then((function(t){e.infos={serialNumber:be(e.dfu.device.serialNumber),displayedSerialNumber:e.dfu.device.serialNumber,model:o,memoryLayout:n,firmware:t}})).then((function(){t(e.infos)})).catch((function(e){e.message="getInfos failed --\x3e "+e.message,r(e)}))}))}},{key:"uploadFlash",value:function(e,t,r){var n=this;return g.info("Calculator","uploadFlash","address "+Number(e).toString(16),"length "+Number(t).toString(16)),new Promise((function(o,i){try{it(e,t)}catch(e){e.message="uploadFlash failed --\x3e "+e.message,i(e)}n.dfu.upload(e,t,r).then((function(e){o(e)})).catch((function(e){e.message="uploadFlash failed --\x3e "+e.message,i(e)}))}))}},{key:"downloadFlash",value:function(e,r,n,o,i){var a=this;return g.info("Calculator","downloadFlash","address "+Number(e).toString(16)),new Promise((function(s,u){var c=function(){var e=He(t().mark((function e(r,n,o,i,a){var s,u,c,l,f,h,d,p,m,g,y,v,w;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=0,u=0,c=-1,l=-1,f=-1,h=-1,d=0;case 7:if(!(d<n.length)){e.next=33;break}if(!(c<0)){e.next=14;break}if(!(o>n[d].lastAddress)){e.next=13;break}return e.abrupt("continue",30);case 13:c=d;case 14:p=0;case 15:if(!(p<n[d].nbPage)){e.next=30;break}if(!(l<0)){e.next=22;break}if(o!=n[d].address+p*n[d].pageSize){e.next=21;break}l=p,e.next=22;break;case 21:return e.abrupt("continue",27);case 22:if(!((s+=n[d].pageSize)>=i.byteLength)){e.next=27;break}return f=d,h=p,e.abrupt("break",33);case 27:p++,e.next=15;break;case 30:d++,e.next=7;break;case 33:m=c;case 34:if(!(m<=f)){e.next=51;break}g=m==c?l:0,y=m==f?h+1:n[m].nbPage,v=g;case 38:if(!(v<y)){e.next=48;break}return w=n[m].address+v*n[m].pageSize,e.next=42,r.eraseSegment(w);case 42:u+=n[m].pageSize,a(u/s),w+=n[m].pageSize;case 45:v++,e.next=38;break;case 48:m++,e.next=34;break;case 51:case"end":return e.stop()}}),e)})));return function(t,r,n,o,i){return e.apply(this,arguments)}}();try{it(e,r.byteLength)}catch(e){e.message="downloadFlash failed --\x3e "+e.message,u(e)}c(a.dfu,n.memoryLayout,e,r,(function(e){return o(e)})).then((function(){s(a.dfu.download(e,r,(function(e){return i(e)})))})).catch((function(e){e.message="downloadFlash failed --\x3e "+e.message,u(e)}))}))}},{key:"reset",value:function(e){var t=this;return g.info("Calculator","reset"),new Promise((function(r,n){try{it(e.memoryLayout[0].address,0)}catch(e){e.message="reset failed --\x3e "+e.message,n(e)}return t.dfu.leave(134217728).then((function(e){r(!0)})).catch((function(e){e.message="reset failed --\x3e "+e.message,n(e)}))}))}},{key:"getAvailableSpaceInfo",value:function(){var e=this;return g.info("Calculator","getAvailableSpaceInfo"),new Promise((function(t,r){var n={availableSize:!1,totalSize:!1};e.getInfos().then((function(t){return ft(e,t)})).then((function(e){n.availableSize=e.availableSize(),n.totalSize=e.totalSize(),t(n)})).catch((function(e){e.message="getAvailableSpaceInfo failed --\x3e "+e.message,r(e)}))}))}},{key:"getScripts",value:function(){var e=this;return g.info("Calculator","getScripts"),new Promise((function(t,r){e.getInfos().then((function(t){return ft(e,t)})).then((function(e){return e.recordsWithExtension(".py").map((function(t,r){return{name:t,size:e.size(t),content:ye(e.content(t).subarray(1))}}))})).then((function(e){t(e)})).catch((function(e){e.message="getScripts failed --\x3e "+e.message,r(e)}))}))}},{key:"removeScripts",value:function(){var e=this;return g.info("Calculator","removeScripts"),new Promise((function(t,r){e.getInfos().then((function(t){return ft(e,t)})).then((function(t){t.recordsWithExtension(".py").map((function(e,r){t.setContent(e)}));return ht(e,e.infos,t)})).then((function(){t(!0)})).catch((function(e){e.message="removeScripts failed --\x3e "+e.message,r(e)}))}))}},{key:"getSizeForRecord",value:function(e){var t=this;return g.info("Calculator","getSizeForRecord","name "+e),new Promise((function(r,n){var o;t.getInfos().then((function(e){return ft(t,e)})).then((function(t){o=t.size(e),r(o)})).catch((function(e){e.message="getSizeForRecord failed --\x3e "+e.message,n(e)}))}))}},{key:"setContentForRecord",value:function(e,t){var r=this;return g.info("Calculator","setContentForRecord","name "+e),new Promise((function(n,o){r.getInfos().then((function(e){return ft(r,e)})).then((function(n){try{n.setContent(e,t)}catch(e){o(e)}return ht(r,r.infos,n)})).then((function(){n(!0)})).catch((function(e){e.message="setContentForRecord failed --\x3e "+e.message,o(e)}))}))}},{key:"setContentForScript",value:function(e,t){var r=this;return g.info("Calculator","setContentForScript","name "+e),new Promise((function(n,o){r.setContentForRecord(e,dt(t)).then((function(){n(!0)})).catch((function(e){e.message="setContentForScript failed --\x3e "+e.message,o(e)}))}))}},{key:"setRecords",value:function(e){var t=this;return g.info("Calculator","setRecords",e),new Promise((function(r,n){t.getInfos().then((function(e){return ft(t,e)})).then((function(t){try{e.forEach((function(e,r){t.setContent(e.name,e.content)}))}catch(e){n(e)}return t})).then((function(e){return ht(t,t.infos,e)})).then((function(){r(!0)})).catch((function(e){e.message="setRecords failed --\x3e "+e.message,n(e)}))}))}},{key:"setScripts",value:function(e){var t=this;return g.info("Calculator","setScripts",e),new Promise((function(r,n){var o=[];e.forEach((function(e,t){o[t]={name:e.name,content:dt(e.content)}})),t.setRecords(o).then((function(){r(!0)})).catch((function(e){e.message="setScripts failed --\x3e "+e.message,n(e)}))}))}},{key:"removeRecord",value:function(e){var t=this;return g.info("Calculator","removeRecord","name "+e),new Promise((function(r,n){t.getInfos().then((function(e){return ft(t,e)})).then((function(r){return r.setContent(e),ht(t,t.infos,r)})).then((function(){r(!0)})).catch((function(e){e.memory="removeRecord failed --\x3e "+e.message,n(e)}))}))}}],[{key:"CheckFirmware",value:function(e,t){for(var r=0;r<t.byteLength;r++)if(e[r]!=t[r])throw new Ye("The uploaded firmware differs from the reference at byte "+r);return!0}}]),e}();pt.Product={Numworks:"numworks",ST:"ST"},pt.Header0={Offset:428,Size:24},pt.Header1={Offset:452,Size:32},pt.Header2={SlotInfoSize:16,KernelHeaderSize:24,UserlandHeaderSize:40};const mt=pt;r(382);var gt=r(280),yt=(r(8744),r(5405)),vt=r(5477);function wt(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,n.key,n)}}function bt(e,t){return Math.round(255/((1<<t)-1)*e)}var Et=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.rgba8888Data=t}var t,r,n;return t=e,n=[{key:"fromPNG",value:function(t){var r=vt.y.sync.read(t);if(r.width!=e.Width)throw"Icon has an invalid width";if(r.height!=e.Height)throw"Icon has an invalid height";return new e(r.data)}},{key:"fromNWI",value:function(t){console.log("Creating image from NWI",t);var r=new Uint8Array(e.Width*e.Height*2);yt.decompressBlock(t,r,0,t.length,0);var n=function(e){for(var t=e.length/2,r=new Uint8Array(4*t),n=0;n<t;n++){var o=e[2*n+1]<<8|e[2*n],i=o>>11&31,a=o>>5&63,s=31&o;r[4*n]=bt(i,5),r[4*n+1]=bt(a,6),r[4*n+2]=bt(s,5),r[4*n+3]=255}return r}(r);return new e(n)}}],(r=[{key:"toPNG",value:function(){console.log("this.rgba8888Data",this.rgba8888Data);var t=new ImageData(new Uint8ClampedArray(this.rgba8888Data.buffer),e.Width,e.Height),r=document.createElement("canvas");return r.width=e.Width,r.height=e.Height,r.getContext("2d").putImageData(t,0,0),r.toDataURL()}},{key:"toNWI",value:function(){var e=function(e){for(var t=e.length/4,r=new Uint8Array(2*t),n=0;n<t;n++){var o=e[4*n]>>3<<11|e[4*n+1]>>2<<5|e[4*n+2]>>3;r[2*n]=255&o,r[2*n+1]=o>>8&255}return r}(this.rgba8888Data),t=yt.compressBlock(e,new Uint8Array(0),0,e.length,yt.makeBuffer(65536)),r=new Uint8Array(t);return yt.compressBlock(e,r,0,e.length,yt.makeBuffer(65536)),r}}])&&wt(t.prototype,r),n&&wt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();Et.Width=55,Et.Height=56;const _t=Et;var St=r(5827),At=r.n(St),It=r(2890),kt=r.n(It);function Ct(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Pt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Pt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ot(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function Tt(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Ot(i,n,o,a,s,"next",e)}function s(e){Ot(i,n,o,a,s,"throw",e)}a(void 0)}))}}function xt(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,n.key,n)}}var Rt=r(118),Dt=r(9898),Mt=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.packedElfData=t,this.packedElfAnalysis=r,this.size=void 0,this.refreshNeedsExternalData(),this.refreshSize()}var n,o,i,a,s,u,c;return n=e,o=[{key:"name",value:function(){var e=this.dataForSymbolNamed("eadk_app_name");return(new TextDecoder).decode(e)}},{key:"refreshSize",value:(c=Tt(t().mark((function r(){var n,o;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.needsExternalData){t.next=6;break}return t.next=3,this.flatBin({flashStart:2415919104,flashLength:8388608,ramStart:536870912,ramLength:262144});case 3:n=t.sent,o=n.byteLength+(e.AppSectorSize-n.byteLength%e.AppSectorSize),this.size=o;case 6:case"end":return t.stop()}}),r,this)}))),function(){return c.apply(this,arguments)})},{key:"icon",value:function(){var e=this.dataForSymbolNamed("eadk_app_icon"),t=_t.fromNWI(e);return t.toPNG()}},{key:"flatElf",value:(u=Tt(t().mark((function e(r){var n,o;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n={arguments:["--script","linker.ld","eadk.o","app-pack.elf"],inputs:{"linker.ld":Rt(r),"app-pack.elf":this.packedElfData,"eadk.o":new Uint8Array(Dt.data)}},!this.externalData){e.next=7;break}return o="extra-data.o",n.arguments.push(o),e.next=6,this.externalObject();case 6:n.inputs[o]=e.sent;case 7:return e.next=9,this.ld(n);case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"flatBin",value:(s=Tt(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=this,e.t1=["--output-target","binary"],e.next=4,this.flatElf(r);case 4:return e.t2=e.sent,e.t3={arguments:e.t1,input:e.t2},e.next=8,e.t0.objcopy.call(e.t0,e.t3);case 8:return e.abrupt("return",e.sent);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"setExternalData",value:function(e){this.externalData=e,this.refreshNeedsExternalData(),this.refreshSize()}},{key:"symbols",value:function(){return gt.getSymbols(this.packedElfAnalysis)}},{key:"symbolNamed",value:function(e){return this.symbols().find((function(t){return t.name==e}))}},{key:"dataForSymbol",value:function(e){var t=this.sectionForSymbol(e),r=t.offset+(e.virtualAddress-t.addr);return this.packedElfData.slice(r,r+e.size)}},{key:"dataForSymbolNamed",value:function(e){return this.dataForSymbol(this.symbolNamed(e))}},{key:"sectionForSymbol",value:function(e){return this.packedElfAnalysis.sections.find((function(t){return t.addr<=e.virtualAddress&&t.addr+t.size>=e.virtualAddress+e.size}))}},{key:"ld",value:function(e){return new Promise((function(t,n){var o={locateFile:function(e,t){return r(7573)},preRun:function(){for(var t=0,r=Object.entries(e.inputs);t<r.length;t++){var n=Ct(r[t],2),i=n[0],a=n[1];o.FS.writeFile(i,a)}},onAbort:n,arguments:e.arguments.concat(["--output","output.elf"]),postRun:function(){t(o.FS.readFile("output.elf"))}};At()(o)}))}},{key:"objcopy",value:function(e){return new Promise((function(t,n){var o={locateFile:function(e,t){return r(3835)},preRun:function(){o.FS.writeFile("input.dat",e.input)},onAbort:n,arguments:e.arguments.concat(["input.dat","output.dat"]),postRun:function(){t(o.FS.readFile(e.output||"output.dat"))}};kt()(o)}))}},{key:"rgb565ToRGBA8888",value:function(e){for(var t=new Uint8ClampedArray(2*e.length),r=0;r<e.length/2;r++){var n=function(e,t){return e<<8-t},o=e[2*r+1]<<8|e[2*r],i=o>>11&31,a=o>>5&63,s=31&o;t[4*r]=n(i,5),t[4*r+1]=n(a,6),t[4*r+2]=n(s,5),t[4*r+3]=255}return t}},{key:"refreshNeedsExternalData",value:function(){var e=void 0!==this.symbolNamed("eadk_external_data"),t=void 0!==this.externalData;this.needsExternalData=e&&!t}},{key:"externalObject",value:function(){return this.objcopy({arguments:["--input-target","binary","--output-target","elf32-littlearm","--rename-section",".data=.rodata"],input:this.externalData})}}],i=[{key:"from",value:(a=Tt(t().mark((function r(n){var o;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,gt.open(n,{readSymbolData:!0});case 2:return o=t.sent,t.abrupt("return",new e(n,o.elf));case 4:case"end":return t.stop()}}),r)}))),function(e){return a.apply(this,arguments)})}],o&&xt(n.prototype,o),i&&xt(n,i),Object.defineProperty(n,"prototype",{writable:!1}),e}();Mt.AppSectorSize=65536;const Ft=Mt;function Nt(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function Lt(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Nt(i,n,o,a,s,"next",e)}function s(e){Nt(i,n,o,a,s,"throw",e)}a(void 0)}))}}function Ht(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Ut(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ut(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function Ut(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Bt(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,n.key,n)}}function zt(e,t,r){return t&&Bt(e.prototype,t),r&&Bt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function jt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vt(e,t){return Vt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Vt(e,t)}function Gt(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=Xt(e);if(t){var o=Xt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return $t(this,r)}}function $t(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Xt(e){return Xt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Xt(e)}var Kt=function(e){!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&&Vt(e,t)}(r,e);var t=Gt(r);function r(){jt(this,r);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.call.apply(t,[this,"CalculatorMemoryOverflow"].concat(n))}return zt(r)}(d);const Wt=function(){function e(){jt(this,e),this.apps=[]}var r,n;return zt(e,[{key:"push",value:function(e){this.apps.push(e)}},{key:"isReadyToUpload",value:function(){var e,t=Ht(this.apps);try{for(t.s();!(e=t.n()).done;){if(e.value.needsExternalData)return!1}}catch(e){t.e(e)}finally{t.f()}return this.apps.length>0}},{key:"upload",value:(n=Lt(t().mark((function e(r,n){var o,i,a;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.infos.firmware,i={flashStart:o.externalAppsFlashStart,flashLength:o.externalAppsFlashEnd-o.externalAppsFlashStart,ramStart:o.externalAppsRamStart,ramLength:o.externalAppsRamEnd-o.externalAppsRamStart},e.next=4,this.flatBin(i);case 4:a=e.sent,r.downloadFlash(i.flashStart,a,r.infos,(function(e){n(.2*e)}),(function(e){n(.2+.8*e)})).then((function(){r.dfu.leave(i.flashStart)}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"concatenateU8A",value:function(e,t){var r=new Uint8Array(e.byteLength+t.byteLength);return r.set(e,0),r.set(t,e.byteLength),r}},{key:"flatBin",value:(r=Lt(t().mark((function e(r){var n,o,i,a,s,u,c,l,f,h,d;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new Uint8Array(0),o=r.flashStart+r.flashLength,i=r.flashStart,a=Ht(this.apps),e.prev=4,a.s();case 6:if((s=a.n()).done){e.next=19;break}if(u=s.value,!(i>=o)){e.next=10;break}throw new Kt("External app sector would be overflown");case 10:return e.next=12,u.flatBin({flashStart:i,flashLength:o-i,ramStart:r.ramStart,ramLength:r.ramLength});case 12:c=e.sent,n=this.concatenateU8A(n,c),i+=c.byteLength,(l=c.byteLength%Ft.AppSectorSize)>0&&(f=Ft.AppSectorSize-l,(h=new Uint8Array(f)).fill(255),n=this.concatenateU8A(n,h),i+=f);case 17:e.next=6;break;case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(4),a.e(e.t0);case 24:return e.prev=24,a.f(),e.finish(24);case 27:return i<o&&((d=new Uint8Array(Ft.AppSectorSize)).fill(255),n=this.concatenateU8A(n,d)),e.abrupt("return",n);case 29:case"end":return e.stop()}}),e,this,[[4,21,24,27]])}))),function(e){return r.apply(this,arguments)})},{key:"totalSize",value:function(){var e,t=0,r=Ht(this.apps);try{for(r.s();!(e=r.n()).done;){t+=e.value.size||0}}catch(e){r.e(e)}finally{r.f()}return t}},{key:"removeAppAtIndex",value:function(e){this.apps.splice(e,1)}}]),e}();function qt(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function Yt(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){qt(i,n,o,a,s,"next",e)}function s(e){qt(i,n,o,a,s,"throw",e)}a(void 0)}))}}r(1017).resolve;var Zt=r(7147),Jt=r(7461).Command;function Qt(e){var r=new Jt;function n(){return n=Yt(t().mark((function e(r,n){var o,i,a,s,u;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("Installing",r,"with",n),o=Zt.readFileSync(r),e.next=4,Ft.from(o);case 4:i=e.sent,n.data&&(a=Zt.readFileSync(n.data),i.setExternalData(a)),(s=new Wt).push(i),(u=new mt).connectAndProcess(function(){var e=Yt(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("Got infos"),e.next=3,r.getInfos();case 3:e.sent,s.upload(u,(function(e){console.log("Upload progress",e)}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[mt.Product.Numworks],!0);case 10:case"end":return e.stop()}}),e)}))),n.apply(this,arguments)}r.name("nwlink").description("Command-line tool to interact with a NumWorks calculator").version(require("../package.json").version),r.command("install-nwa").description("Install a NWA app").argument("<string>","string to split").option("-d, --data <file>","Data file").action((function(e,t){return n.apply(this,arguments)})),r.command("convert-nwi").description("Convert a PNG file to a NWI image (LZ4-compressed RGB565)").argument("<file.png>","Input PNG file").argument("<file.nwi>","Output NWI file").action((function(e,t){var r=Zt.readFileSync(e),n=_t.fromPNG(r);Zt.writeFileSync(t,n.toNWI())})),r.parseAsync(e)}global.navigator={usb:o.webusb}})(),module.exports=n.default})();
|
|
1
|
+
(()=>{var e={5827:(e,t,r)=>{var n,o=(n=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||__filename,function(e){var t,o,i=void 0!==(e=e||{})?e:{};i.ready=new Promise((function(e,r){t=e,o=r}));var a,s,u,c,l,f,h=Object.assign({},i),d=[],p="./this.program",m=(e,t)=>{throw t},g="object"==typeof window,y="function"==typeof importScripts,v="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,w="";v?(w=y?r(1017).dirname(w)+"/":__dirname+"/",f=()=>{l||(c=r(7147),l=r(1017))},a=function(e,t){return f(),e=l.normalize(e),c.readFileSync(e,t?void 0:"utf8")},u=e=>{var t=a(e,!0);return t.buffer||(t=new Uint8Array(t)),t},s=(e,t,r)=>{f(),e=l.normalize(e),c.readFile(e,(function(e,n){e?r(e):t(n.buffer)}))},process.argv.length>1&&(p=process.argv[1].replace(/\\/g,"/")),d=process.argv.slice(2),process.on("uncaughtException",(function(e){if(!(e instanceof ke))throw e})),process.on("unhandledRejection",(function(e){throw e})),m=(e,t)=>{if(G())throw process.exitCode=e,t;var r;(r=t)instanceof ke||_("exiting due to exception: "+r),process.exit(e)},i.inspect=function(){return"[Emscripten Module object]"}):(g||y)&&(y?w=self.location.href:"undefined"!=typeof document&&document.currentScript&&(w=document.currentScript.src),n&&(w=n),w=0!==w.indexOf("blob:")?w.substr(0,w.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},y&&(u=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),s=(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 b,E=i.print||console.log.bind(console),_=i.printErr||console.warn.bind(console);Object.assign(i,h),h=null,i.arguments&&(d=i.arguments),i.thisProgram&&(p=i.thisProgram),i.quit&&(m=i.quit),i.wasmBinary&&(b=i.wasmBinary);var S,A=i.noExitRuntime||!0;"object"!=typeof WebAssembly&&ee("no native wasm support detected");var I,k=!1;function C(e,t){e||ee(t)}var P,O,T,x,R,D,M="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function F(e,t,r){for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&M)return M.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 N(e,t){return e?F(T,e,t):""}function L(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 H(e,t,r){return L(e,T,t,r)}function U(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&e.charCodeAt(++r)),n<=127?++t:t+=n<=2047?2:n<=65535?3:4}return t}i.INITIAL_MEMORY;var B=[],z=[],j=[],V=[];function G(){return A}var $,X,K,q,W=0,Y=null,Z=null;function J(e){W++,i.monitorRunDependencies&&i.monitorRunDependencies(W)}function Q(e){if(W--,i.monitorRunDependencies&&i.monitorRunDependencies(W),0==W&&(null!==Y&&(clearInterval(Y),Y=null),Z)){var t=Z;Z=null,t()}}function ee(e){i.onAbort&&i.onAbort(e),_(e="Aborted("+e+")"),k=!0,I=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw o(t),t}function te(e){return e.startsWith("data:application/octet-stream;base64,")}function re(e){try{if(e==$&&b)return new Uint8Array(b);if(u)return u(e);throw"both async and sync fetching of the wasm failed"}catch(e){ee(e)}}function ne(e){for(;e.length>0;)e.shift()(i)}te($="ld.wasm")||(X=$,$=i.locateFile?i.locateFile(X,w):w+X);var oe={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=oe.isAbs(e),r="/"===e.substr(-1);return(e=oe.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=oe.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=oe.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments,0);return oe.normalize(e.join("/"))},join2:(e,t)=>oe.normalize(e+"/"+t)},ie={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:le.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t=oe.isAbs(n)}return(t?"/":"")+(e=oe.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=ie.resolve(e).substr(1),t=ie.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("/")}},ae={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){ae.ttys[e]={input:[],output:[],ops:t},le.registerDevice(e,ae.stream_ops)},stream_ops:{open:function(e){var t=ae.ttys[e.node.rdev];if(!t)throw new le.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 le.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 le.ErrnoError(29)}if(void 0===s&&0===i)throw new le.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 le.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,t[r+i])}catch(e){throw new le.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(v){var r=Buffer.alloc(256),n=0;try{n=c.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=Ee(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(E(F(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(E(F(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(_(F(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(_(F(e.output,0)),e.output=[])}}};function se(e){ee()}var ue,ce={ops_table:null,mount:function(e){return ce.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(le.isBlkdev(r)||le.isFIFO(r))throw new le.ErrnoError(63);ce.ops_table||(ce.ops_table={dir:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr,lookup:ce.node_ops.lookup,mknod:ce.node_ops.mknod,rename:ce.node_ops.rename,unlink:ce.node_ops.unlink,rmdir:ce.node_ops.rmdir,readdir:ce.node_ops.readdir,symlink:ce.node_ops.symlink},stream:{llseek:ce.stream_ops.llseek}},file:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr},stream:{llseek:ce.stream_ops.llseek,read:ce.stream_ops.read,write:ce.stream_ops.write,allocate:ce.stream_ops.allocate,mmap:ce.stream_ops.mmap,msync:ce.stream_ops.msync}},link:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr,readlink:ce.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ce.node_ops.getattr,setattr:ce.node_ops.setattr},stream:le.chrdev_stream_ops}});var o=le.createNode(e,t,r,n);return le.isDir(o.mode)?(o.node_ops=ce.ops_table.dir.node,o.stream_ops=ce.ops_table.dir.stream,o.contents={}):le.isFile(o.mode)?(o.node_ops=ce.ops_table.file.node,o.stream_ops=ce.ops_table.file.stream,o.usedBytes=0,o.contents=null):le.isLink(o.mode)?(o.node_ops=ce.ops_table.link.node,o.stream_ops=ce.ops_table.link.stream):le.isChrdev(o.mode)&&(o.node_ops=ce.ops_table.chrdev.node,o.stream_ops=ce.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=le.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,le.isDir(e.mode)?t.size=4096:le.isFile(e.mode)?t.size=e.usedBytes:le.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&&ce.resizeFileStorage(e,t.size)},lookup:function(e,t){throw le.genericErrors[44]},mknod:function(e,t,r,n){return ce.createNode(e,t,r,n)},rename:function(e,t,r){if(le.isDir(e.mode)){var n;try{n=le.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new le.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=le.lookupNode(e,t);for(var n in r.contents)throw new le.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=ce.createNode(e,t,41471,0);return n.link=r,n},readlink:function(e){if(!le.isLink(e.mode))throw new le.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(ce.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&&le.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new le.ErrnoError(28);return n},allocate:function(e,t,r){ce.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap:function(e,t,r,n,o){if(!le.isFile(e.node.mode))throw new le.ErrnoError(43);var i,a,s=e.node.contents;if(2&o||s.buffer!==P){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=se()))throw new le.ErrnoError(48);O.set(s,i)}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:function(e,t,r,n,o){if(!le.isFile(e.node.mode))throw new le.ErrnoError(43);return 2&o||ce.stream_ops.write(e,t,0,n,r,!1),0}}},le={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=ie.resolve(le.cwd(),e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new le.ErrnoError(32);for(var r=oe.normalizeArray(e.split("/").filter((e=>!!e)),!1),n=le.root,o="/",i=0;i<r.length;i++){var a=i===r.length-1;if(a&&t.parent)break;if(n=le.lookupNode(n,r[i]),o=oe.join2(o,r[i]),le.isMountpoint(n)&&(!a||a&&t.follow_mount)&&(n=n.mounted.root),!a||t.follow)for(var s=0;le.isLink(n.mode);){var u=le.readlink(o);if(o=ie.resolve(oe.dirname(o),u),n=le.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new le.ErrnoError(32)}}return{path:o,node:n}},getPath:e=>{for(var t;;){if(le.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)%le.nameTable.length},hashAddNode:e=>{var t=le.hashName(e.parent.id,e.name);e.name_next=le.nameTable[t],le.nameTable[t]=e},hashRemoveNode:e=>{var t=le.hashName(e.parent.id,e.name);if(le.nameTable[t]===e)le.nameTable[t]=e.name_next;else for(var r=le.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:(e,t)=>{var r=le.mayLookup(e);if(r)throw new le.ErrnoError(r,e);for(var n=le.hashName(e.id,t),o=le.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return le.lookup(e,t)},createNode:(e,t,r,n)=>{var o=new le.FSNode(e,t,r,n);return le.hashAddNode(o),o},destroyNode:e=>{le.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),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:e=>{var t=le.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:e=>{var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>le.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=le.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate:(e,t)=>{try{return le.lookupNode(e,t),20}catch(e){}return le.nodePermissions(e,"wx")},mayDelete:(e,t,r)=>{var n;try{n=le.lookupNode(e,t)}catch(e){return e.errno}var o=le.nodePermissions(e,"wx");if(o)return o;if(r){if(!le.isDir(n.mode))return 54;if(le.isRoot(n)||le.getPath(n)===le.cwd())return 10}else if(le.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?le.isLink(e.mode)?32:le.isDir(e.mode)&&("r"!==le.flagsToPermissionString(t)||512&t)?31:le.nodePermissions(e,le.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:(e=0,t=le.MAX_OPEN_FDS)=>{for(var r=e;r<=t;r++)if(!le.streams[r])return r;throw new le.ErrnoError(33)},getStream:e=>le.streams[e],createStream:(e,t,r)=>{le.FSStream||(le.FSStream=function(){this.shared={}},le.FSStream.prototype={},Object.defineProperties(le.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 le.FSStream,e);var n=le.nextfd(t,r);return e.fd=n,le.streams[n]=e,e},closeStream:e=>{le.streams[e]=null},chrdev_stream_ops:{open:e=>{var t=le.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new le.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice:(e,t)=>{le.devices[e]={stream_ops:t}},getDevice:e=>le.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),le.syncFSRequests++,le.syncFSRequests>1&&_("warning: "+le.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=le.getMounts(le.root.mount),n=0;function o(e){return le.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((t=>{if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)}))},mount:(e,t,r)=>{var n,o="/"===r,i=!r;if(o&&le.root)throw new le.ErrnoError(10);if(!o&&!i){var a=le.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,le.isMountpoint(n))throw new le.ErrnoError(10);if(!le.isDir(n.mode))throw new le.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?le.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:e=>{var t=le.lookupPath(e,{follow_mount:!1});if(!le.isMountpoint(t.node))throw new le.ErrnoError(28);var r=t.node,n=r.mounted,o=le.getMounts(n);Object.keys(le.nameTable).forEach((e=>{for(var t=le.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&le.destroyNode(t),t=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(n);r.mount.mounts.splice(i,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod:(e,t,r)=>{var n=le.lookupPath(e,{parent:!0}).node,o=oe.basename(e);if(!o||"."===o||".."===o)throw new le.ErrnoError(28);var i=le.mayCreate(n,o);if(i)throw new le.ErrnoError(i);if(!n.node_ops.mknod)throw new le.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,le.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,le.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{le.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,le.mknod(e,t,r)),symlink:(e,t)=>{if(!ie.resolve(e))throw new le.ErrnoError(44);var r=le.lookupPath(t,{parent:!0}).node;if(!r)throw new le.ErrnoError(44);var n=oe.basename(t),o=le.mayCreate(r,n);if(o)throw new le.ErrnoError(o);if(!r.node_ops.symlink)throw new le.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename:(e,t)=>{var r,n,o=oe.dirname(e),i=oe.dirname(t),a=oe.basename(e),s=oe.basename(t);if(r=le.lookupPath(e,{parent:!0}).node,n=le.lookupPath(t,{parent:!0}).node,!r||!n)throw new le.ErrnoError(44);if(r.mount!==n.mount)throw new le.ErrnoError(75);var u,c=le.lookupNode(r,a),l=ie.relative(e,i);if("."!==l.charAt(0))throw new le.ErrnoError(28);if("."!==(l=ie.relative(t,o)).charAt(0))throw new le.ErrnoError(55);try{u=le.lookupNode(n,s)}catch(e){}if(c!==u){var f=le.isDir(c.mode),h=le.mayDelete(r,a,f);if(h)throw new le.ErrnoError(h);if(h=u?le.mayDelete(n,s,f):le.mayCreate(n,s))throw new le.ErrnoError(h);if(!r.node_ops.rename)throw new le.ErrnoError(63);if(le.isMountpoint(c)||u&&le.isMountpoint(u))throw new le.ErrnoError(10);if(n!==r&&(h=le.nodePermissions(r,"w")))throw new le.ErrnoError(h);le.hashRemoveNode(c);try{r.node_ops.rename(c,n,s)}catch(e){throw e}finally{le.hashAddNode(c)}}},rmdir:e=>{var t=le.lookupPath(e,{parent:!0}).node,r=oe.basename(e),n=le.lookupNode(t,r),o=le.mayDelete(t,r,!0);if(o)throw new le.ErrnoError(o);if(!t.node_ops.rmdir)throw new le.ErrnoError(63);if(le.isMountpoint(n))throw new le.ErrnoError(10);t.node_ops.rmdir(t,r),le.destroyNode(n)},readdir:e=>{var t=le.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new le.ErrnoError(54);return t.node_ops.readdir(t)},unlink:e=>{var t=le.lookupPath(e,{parent:!0}).node;if(!t)throw new le.ErrnoError(44);var r=oe.basename(e),n=le.lookupNode(t,r),o=le.mayDelete(t,r,!1);if(o)throw new le.ErrnoError(o);if(!t.node_ops.unlink)throw new le.ErrnoError(63);if(le.isMountpoint(n))throw new le.ErrnoError(10);t.node_ops.unlink(t,r),le.destroyNode(n)},readlink:e=>{var t=le.lookupPath(e).node;if(!t)throw new le.ErrnoError(44);if(!t.node_ops.readlink)throw new le.ErrnoError(28);return ie.resolve(le.getPath(t.parent),t.node_ops.readlink(t))},stat:(e,t)=>{var r=le.lookupPath(e,{follow:!t}).node;if(!r)throw new le.ErrnoError(44);if(!r.node_ops.getattr)throw new le.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>le.stat(e,!0),chmod:(e,t,r)=>{var n;if(!(n="string"==typeof e?le.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new le.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:(e,t)=>{le.chmod(e,t,!0)},fchmod:(e,t)=>{var r=le.getStream(e);if(!r)throw new le.ErrnoError(8);le.chmod(r.node,t)},chown:(e,t,r,n)=>{var o;if(!(o="string"==typeof e?le.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new le.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(e,t,r)=>{le.chown(e,t,r,!0)},fchown:(e,t,r)=>{var n=le.getStream(e);if(!n)throw new le.ErrnoError(8);le.chown(n.node,t,r)},truncate:(e,t)=>{if(t<0)throw new le.ErrnoError(28);var r;if(!(r="string"==typeof e?le.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new le.ErrnoError(63);if(le.isDir(r.mode))throw new le.ErrnoError(31);if(!le.isFile(r.mode))throw new le.ErrnoError(28);var n=le.nodePermissions(r,"w");if(n)throw new le.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:(e,t)=>{var r=le.getStream(e);if(!r)throw new le.ErrnoError(8);if(0==(2097155&r.flags))throw new le.ErrnoError(28);le.truncate(r.node,t)},utime:(e,t,r)=>{var n=le.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:(e,t,r)=>{if(""===e)throw new le.ErrnoError(44);var n;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?le.modeStringToFlags(t):t)?4095&r|32768:0,"object"==typeof e)n=e;else{e=oe.normalize(e);try{n=le.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var o=!1;if(64&t)if(n){if(128&t)throw new le.ErrnoError(20)}else n=le.mknod(e,r,0),o=!0;if(!n)throw new le.ErrnoError(44);if(le.isChrdev(n.mode)&&(t&=-513),65536&t&&!le.isDir(n.mode))throw new le.ErrnoError(54);if(!o){var a=le.mayOpen(n,t);if(a)throw new le.ErrnoError(a)}512&t&&!o&&le.truncate(n,0),t&=-131713;var s=le.createStream({node:n,path:le.getPath(n),flags:t,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!i.logReadFiles||1&t||(le.readFiles||(le.readFiles={}),e in le.readFiles||(le.readFiles[e]=1)),s},close:e=>{if(le.isClosed(e))throw new le.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{le.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,t,r)=>{if(le.isClosed(e))throw new le.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new le.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new le.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 le.ErrnoError(28);if(le.isClosed(e))throw new le.ErrnoError(8);if(1==(2097155&e.flags))throw new le.ErrnoError(8);if(le.isDir(e.node.mode))throw new le.ErrnoError(31);if(!e.stream_ops.read)throw new le.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new le.ErrnoError(70)}else o=e.position;var a=e.stream_ops.read(e,t,r,n,o);return i||(e.position+=a),a},write:(e,t,r,n,o,i)=>{if(n<0||o<0)throw new le.ErrnoError(28);if(le.isClosed(e))throw new le.ErrnoError(8);if(0==(2097155&e.flags))throw new le.ErrnoError(8);if(le.isDir(e.node.mode))throw new le.ErrnoError(31);if(!e.stream_ops.write)throw new le.ErrnoError(28);e.seekable&&1024&e.flags&&le.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new le.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:(e,t,r)=>{if(le.isClosed(e))throw new le.ErrnoError(8);if(t<0||r<=0)throw new le.ErrnoError(28);if(0==(2097155&e.flags))throw new le.ErrnoError(8);if(!le.isFile(e.node.mode)&&!le.isDir(e.node.mode))throw new le.ErrnoError(43);if(!e.stream_ops.allocate)throw new le.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 le.ErrnoError(2);if(1==(2097155&e.flags))throw new le.ErrnoError(2);if(!e.stream_ops.mmap)throw new le.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,o)},msync:(e,t,r,n,o)=>e&&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 le.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=le.open(e,t.flags),o=le.stat(e).size,i=new Uint8Array(o);return le.read(n,i,0,o,0),"utf8"===t.encoding?r=F(i,0):"binary"===t.encoding&&(r=i),le.close(n),r},writeFile:(e,t,r={})=>{r.flags=r.flags||577;var n=le.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(U(t)+1),i=L(t,o,0,o.length);le.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");le.write(n,t,0,t.byteLength,void 0,r.canOwn)}le.close(n)},cwd:()=>le.currentPath,chdir:e=>{var t=le.lookupPath(e,{follow:!0});if(null===t.node)throw new le.ErrnoError(44);if(!le.isDir(t.node.mode))throw new le.ErrnoError(54);var r=le.nodePermissions(t.node,"x");if(r)throw new le.ErrnoError(r);le.currentPath=t.path},createDefaultDirectories:()=>{le.mkdir("/tmp"),le.mkdir("/home"),le.mkdir("/home/web_user")},createDefaultDevices:()=>{le.mkdir("/dev"),le.registerDevice(le.makedev(1,3),{read:()=>0,write:(e,t,r,n,o)=>n}),le.mkdev("/dev/null",le.makedev(1,3)),ae.register(le.makedev(5,0),ae.default_tty_ops),ae.register(le.makedev(6,0),ae.default_tty1_ops),le.mkdev("/dev/tty",le.makedev(5,0)),le.mkdev("/dev/tty1",le.makedev(6,0));var e=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}if(v)try{var t=r(6113);return function(){return t.randomBytes(1)[0]}}catch(e){}return function(){ee("randomDevice")}}();le.createDevice("/dev","random",e),le.createDevice("/dev","urandom",e),le.mkdir("/dev/shm"),le.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{le.mkdir("/proc");var e=le.mkdir("/proc/self");le.mkdir("/proc/self/fd"),le.mount({mount:()=>{var t=le.createNode(e,"fd",16895,73);return t.node_ops={lookup:(e,t)=>{var r=+t,n=le.getStream(r);if(!n)throw new le.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams:()=>{i.stdin?le.createDevice("/dev","stdin",i.stdin):le.symlink("/dev/tty","/dev/stdin"),i.stdout?le.createDevice("/dev","stdout",null,i.stdout):le.symlink("/dev/tty","/dev/stdout"),i.stderr?le.createDevice("/dev","stderr",null,i.stderr):le.symlink("/dev/tty1","/dev/stderr"),le.open("/dev/stdin",0),le.open("/dev/stdout",1),le.open("/dev/stderr",1)},ensureErrnoError:()=>{le.ErrnoError||(le.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},le.ErrnoError.prototype=new Error,le.ErrnoError.prototype.constructor=le.ErrnoError,[44].forEach((e=>{le.genericErrors[e]=new le.ErrnoError(e),le.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:()=>{le.ensureErrnoError(),le.nameTable=new Array(4096),le.mount(ce,{},"/"),le.createDefaultDirectories(),le.createDefaultDevices(),le.createSpecialDirectories(),le.filesystems={MEMFS:ce}},init:(e,t,r)=>{le.init.initialized=!0,le.ensureErrnoError(),i.stdin=e||i.stdin,i.stdout=t||i.stdout,i.stderr=r||i.stderr,le.createStandardStreams()},quit:()=>{le.init.initialized=!1;for(var e=0;e<le.streams.length;e++){var t=le.streams[e];t&&le.close(t)}},getMode:(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},findObject:(e,t)=>{var r=le.analyzePath(e,t);return r.exists?r.object:null},analyzePath:(e,t)=>{try{e=(n=le.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=le.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=oe.basename(e),n=le.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:le.getPath(e);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var a=oe.join2(e,i);try{le.mkdir(a)}catch(e){}e=a}}return a},createFile:(e,t,r,n,o)=>{var i=oe.join2("string"==typeof e?e:le.getPath(e),t),a=le.getMode(n,o);return le.create(i,a)},createDataFile:(e,t,r,n,o,i)=>{var a=t;e&&(e="string"==typeof e?e:le.getPath(e),a=t?oe.join2(e,t):e);var s=le.getMode(n,o),u=le.create(a,s);if(r){if("string"==typeof r){for(var c=new Array(r.length),l=0,f=r.length;l<f;++l)c[l]=r.charCodeAt(l);r=c}le.chmod(u,146|s);var h=le.open(u,577);le.write(h,r,0,r.length,0,i),le.close(h),le.chmod(u,s)}return u},createDevice:(e,t,r,n)=>{var o=oe.join2("string"==typeof e?e:le.getPath(e),t),i=le.getMode(!!r,!!n);le.createDevice.major||(le.createDevice.major=64);var a=le.makedev(le.createDevice.major++,0);return le.registerDevice(a,{open:e=>{e.seekable=!1},close:e=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(e,t,n,o,i)=>{for(var a=0,s=0;s<o;s++){var u;try{u=r()}catch(e){throw new le.ErrnoError(29)}if(void 0===u&&0===a)throw new le.ErrnoError(6);if(null==u)break;a++,t[n+s]=u}return a&&(e.node.timestamp=Date.now()),a},write:(e,t,r,o,i)=>{for(var a=0;a<o;a++)try{n(t[r+a])}catch(e){throw new le.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),a}}),le.mkdev(o,i,a)},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(!a)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=Ee(a(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new le.ErrnoError(29)}},createLazyFile:(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((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]=((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||[]):Ee(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(!y)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=le.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 l(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((e=>{var t=u.stream_ops[e];c[e]=function(){return le.forceLoadFile(u),t.apply(null,arguments)}})),c.read=(e,t,r,n,o)=>(le.forceLoadFile(u),l(e,t,r,n,o)),c.mmap=(e,t,r,n,o)=>{le.forceLoadFile(u);var i=se();if(!i)throw new le.ErrnoError(48);return l(e,O,i,t,r),{ptr:i,allocated:!0}},u.stream_ops=c,u},createPreloadedFile:(e,t,r,n,o,i,a,u,c,l)=>{var f=t?ie.resolve(oe.join2(e,t)):e;function h(r){function s(r){l&&l(),u||le.createDataFile(e,t,r,n,o,c),i&&i(),Q()}Browser.handledByPreloadPlugin(r,f,s,(()=>{a&&a(),Q()}))||s(r)}J(),"string"==typeof r?function(e,t,r,n){var o=n?"":"al "+e;s(e,(function(r){C(r,'Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(r)),o&&Q()}),(function(t){if(!r)throw'Loading data file "'+e+'" failed.';r()})),o&&J()}(r,(e=>h(e)),a):h(r)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var n=le.indexedDB();try{var o=n.open(le.DB_NAME(),le.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=()=>{E("creating db"),o.result.createObjectStore(le.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([le.DB_STORE_NAME],"readwrite"),i=n.objectStore(le.DB_STORE_NAME),a=0,s=0,u=e.length;function c(){0==s?t():r()}e.forEach((e=>{var t=i.put(le.analyzePath(e).object.contents,e);t.onsuccess=()=>{++a+s==u&&c()},t.onerror=()=>{s++,a+s==u&&c()}})),n.onerror=r},o.onerror=r},loadFilesFromDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var n=le.indexedDB();try{var o=n.open(le.DB_NAME(),le.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=r,o.onsuccess=()=>{var n=o.result;try{var i=n.transaction([le.DB_STORE_NAME],"readonly")}catch(e){return void r(e)}var a=i.objectStore(le.DB_STORE_NAME),s=0,u=0,c=e.length;function l(){0==u?t():r()}e.forEach((e=>{var t=a.get(e);t.onsuccess=()=>{le.analyzePath(e).exists&&le.unlink(e),le.createDataFile(oe.dirname(e),oe.basename(e),t.result,!0,!0,!0),++s+u==c&&l()},t.onerror=()=>{u++,s+u==c&&l()}})),i.onerror=r},o.onerror=r}},fe={DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){if(oe.isAbs(t))return t;var n;if(-100===e)n=le.cwd();else{var o=le.getStream(e);if(!o)throw new le.ErrnoError(8);n=o.path}if(0==t.length){if(!r)throw new le.ErrnoError(44);return n}return oe.join2(n,t)},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&oe.normalize(t)!==oe.normalize(le.getPath(e.node)))return-54;throw e}return R[r>>2]=n.dev,R[r+4>>2]=0,R[r+8>>2]=n.ino,R[r+12>>2]=n.mode,R[r+16>>2]=n.nlink,R[r+20>>2]=n.uid,R[r+24>>2]=n.gid,R[r+28>>2]=n.rdev,R[r+32>>2]=0,q=[n.size>>>0,(K=n.size,+Math.abs(K)>=1?K>0?(0|Math.min(+Math.floor(K/4294967296),4294967295))>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],R[r+40>>2]=q[0],R[r+44>>2]=q[1],R[r+48>>2]=4096,R[r+52>>2]=n.blocks,R[r+56>>2]=n.atime.getTime()/1e3|0,R[r+60>>2]=0,R[r+64>>2]=n.mtime.getTime()/1e3|0,R[r+68>>2]=0,R[r+72>>2]=n.ctime.getTime()/1e3|0,R[r+76>>2]=0,q=[n.ino>>>0,(K=n.ino,+Math.abs(K)>=1?K>0?(0|Math.min(+Math.floor(K/4294967296),4294967295))>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],R[r+80>>2]=q[0],R[r+84>>2]=q[1],0},doMsync:function(e,t,r,n,o){var i=T.slice(e,e+r);le.msync(t,i,o,r,n)},varargs:void 0,get:function(){return fe.varargs+=4,R[fe.varargs-4>>2]},getStr:function(e){return N(e)},getStreamFromFD:function(e){var t=le.getStream(e);if(!t)throw new le.ErrnoError(8);return t}},he={BUCKET_BUFFER_SIZE:8192,mount:function(e){return le.createNode(null,"/",16895,0)},createPipe:function(){var e={buckets:[],refcnt:2};e.buckets.push({buffer:new Uint8Array(he.BUCKET_BUFFER_SIZE),offset:0,roffset:0});var t=he.nextname(),r=he.nextname(),n=le.createNode(he.root,t,4096,0),o=le.createNode(he.root,r,4096,0);n.pipe=e,o.pipe=e;var i=le.createStream({path:t,node:n,flags:0,seekable:!1,stream_ops:he.stream_ops});n.stream=i;var a=le.createStream({path:r,node:o,flags:1,seekable:!1,stream_ops:he.stream_ops});return o.stream=a,{readable_fd:i.fd,writable_fd:a.fd}},stream_ops:{poll:function(e){var t=e.node.pipe;if(1==(2097155&e.flags))return 260;if(t.buckets.length>0)for(var r=0;r<t.buckets.length;r++){var n=t.buckets[r];if(n.offset-n.roffset>0)return 65}return 0},ioctl:function(e,t,r){return 28},fsync:function(e){return 28},read:function(e,t,r,n,o){for(var i=e.node.pipe,a=0,s=0;s<i.buckets.length;s++){var u=i.buckets[s];a+=u.offset-u.roffset}C(t instanceof ArrayBuffer||ArrayBuffer.isView(t));var c=t.subarray(r,r+n);if(n<=0)return 0;if(0==a)throw new le.ErrnoError(6);var l=Math.min(a,n),f=l,h=0;for(s=0;s<i.buckets.length;s++){var d=i.buckets[s],p=d.offset-d.roffset;if(l<=p){var m=d.buffer.subarray(d.roffset,d.offset);l<p?(m=m.subarray(0,l),d.roffset+=l):h++,c.set(m);break}m=d.buffer.subarray(d.roffset,d.offset),c.set(m),c=c.subarray(m.byteLength),l-=m.byteLength,h++}return h&&h==i.buckets.length&&(h--,i.buckets[h].offset=0,i.buckets[h].roffset=0),i.buckets.splice(0,h),f},write:function(e,t,r,n,o){var i=e.node.pipe;C(t instanceof ArrayBuffer||ArrayBuffer.isView(t));var a=t.subarray(r,r+n),s=a.byteLength;if(s<=0)return 0;var u=null;0==i.buckets.length?(u={buffer:new Uint8Array(he.BUCKET_BUFFER_SIZE),offset:0,roffset:0},i.buckets.push(u)):u=i.buckets[i.buckets.length-1],C(u.offset<=he.BUCKET_BUFFER_SIZE);var c=he.BUCKET_BUFFER_SIZE-u.offset;if(c>=s)return u.buffer.set(a,u.offset),u.offset+=s,s;c>0&&(u.buffer.set(a.subarray(0,c),u.offset),u.offset+=c,a=a.subarray(c,a.byteLength));for(var l=a.byteLength/he.BUCKET_BUFFER_SIZE|0,f=a.byteLength%he.BUCKET_BUFFER_SIZE,h=0;h<l;h++){var d={buffer:new Uint8Array(he.BUCKET_BUFFER_SIZE),offset:he.BUCKET_BUFFER_SIZE,roffset:0};i.buckets.push(d),d.buffer.set(a.subarray(0,he.BUCKET_BUFFER_SIZE)),a=a.subarray(he.BUCKET_BUFFER_SIZE,a.byteLength)}return f>0&&(d={buffer:new Uint8Array(he.BUCKET_BUFFER_SIZE),offset:a.byteLength,roffset:0},i.buckets.push(d),d.buffer.set(a)),s},close:function(e){var t=e.node.pipe;t.refcnt--,0===t.refcnt&&(t.buckets=null)}},nextname:function(){return he.nextname.current||(he.nextname.current=0),"pipe["+he.nextname.current+++"]"}},de="To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking";ue=v?()=>{var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:()=>performance.now();var pe={};function me(){if(!me.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",_:p||"./this.program"};for(var t in pe)void 0===pe[t]?delete e[t]:e[t]=pe[t];var r=[];for(var t in e)r.push(t+"="+e[t]);me.strings=r}return me.strings}function ge(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=D[t>>2],s=D[t+4>>2];t+=8;var u=le.read(e,O,a,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o}function ye(e,t){return t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN}var ve=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=le.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},we=365,be=146;function Ee(e,t,r){var n=r>0?r:U(e)+1,o=new Array(n),i=L(e,o,0,o.length);return t&&(o.length=i),o}Object.defineProperties(ve.prototype,{read:{get:function(){return(this.mode&we)===we},set:function(e){e?this.mode|=we:this.mode&=-366}},write:{get:function(){return(this.mode&be)===be},set:function(e){e?this.mode|=be:this.mode&=-147}},isFolder:{get:function(){return le.isDir(this.mode)}},isDevice:{get:function(){return le.isChrdev(this.mode)}}}),le.FSNode=ve,le.staticInit();var _e,Se={a:function(e,t,r,n){ee("Assertion failed: "+N(e)+", at: "+[t?N(t):"unknown filename",r,n?N(n):"unknown function"])},G:function(e,t){try{return e=fe.getStr(e),le.chmod(e,t),0}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return-e.errno}},F:function(e){try{var t=fe.getStreamFromFD(e);return le.createStream(t,0).fd}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return-e.errno}},H:function(e,t,r,n){try{if(t=fe.getStr(t),t=fe.calculateAt(e,t),-8&r)return-28;var o=le.lookupPath(t,{follow:!0}).node;if(!o)return-44;var i="";return 4&r&&(i+="r"),2&r&&(i+="w"),1&r&&(i+="x"),i&&le.nodePermissions(o,i)?-2:0}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return-e.errno}},e:function(e,t,r){fe.varargs=r;try{var n=fe.getStreamFromFD(e);switch(t){case 0:return(o=fe.get())<0?-28:le.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.get(),x[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return i=28,R[Ae()>>2]=i,-1}}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return-e.errno}var i},z:function(e,t){try{var r=fe.getStreamFromFD(e);return fe.doStat(le.stat,r.path,t)}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return-e.errno}},v:function(e,t){try{if(0===t)return-28;var r=le.cwd(),n=U(r)+1;return t<n?-68:(H(r,e,t),n)}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return-e.errno}},m:function(e,t,r){fe.varargs=r;try{var n=fe.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=fe.get();return R[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:return o=fe.get(),le.ioctl(n,t,o);default:ee("bad ioctl syscall "+t)}}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return-e.errno}},x:function(e,t){try{return e=fe.getStr(e),fe.doStat(le.lstat,e,t)}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return-e.errno}},w:function(e,t,r,n){try{t=fe.getStr(t);var o=256&n,i=4096&n;return n&=-4353,t=fe.calculateAt(e,t,i),fe.doStat(o?le.lstat:le.stat,t,r)}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return-e.errno}},h:function(e,t,r,n){fe.varargs=n;try{t=fe.getStr(t),t=fe.calculateAt(e,t);var o=n?fe.get():0;return le.open(t,r,o).fd}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return-e.errno}},t:function(e){try{if(0==e)throw new le.ErrnoError(21);var t=he.createPipe();return R[e>>2]=t.readable_fd,R[e+4>>2]=t.writable_fd,0}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return-e.errno}},s:function(e,t,r,n){try{if(t=fe.getStr(t),t=fe.calculateAt(e,t),n<=0)return-28;var o=le.readlink(t),i=Math.min(n,U(o)),a=O[r+i];return H(o,r,n+1),O[r+i]=a,i}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return-e.errno}},q:function(e){try{return e=fe.getStr(e),le.rmdir(e),0}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return-e.errno}},y:function(e,t){try{return e=fe.getStr(e),fe.doStat(le.stat,e,t)}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return-e.errno}},g:function(e,t,r){try{return t=fe.getStr(t),t=fe.calculateAt(e,t),0===r?le.unlink(t):512===r?le.rmdir(t):ee("Invalid flags passed to unlinkat"),0}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return-e.errno}},C:function(e){},E:function(e,t){ee(de)},D:function(e,t){ee(de)},l:function(){return Date.now()},B:function(){return!0},b:function(){ee("")},k:ue,A:function(e,t,r){T.copyWithin(e,t,t+r)},f:function(e){T.length,ee("OOM")},n:function(e,t){var r=0;return me().forEach((function(n,o){var i=t+r;D[e+4*o>>2]=i,function(e,t,r){for(var n=0;n<e.length;++n)O[t++>>0]=e.charCodeAt(n);r||(O[t>>0]=0)}(n,i),r+=n.length+1})),0},r:function(e,t){var r=me();D[e>>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),D[t>>2]=n,0},d:function(e){Oe(e)},c:function(e){try{var t=fe.getStreamFromFD(e);return le.close(t),0}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return e.errno}},u:function(e,t){try{var r=fe.getStreamFromFD(e),n=r.tty?2:le.isDir(r.mode)?3:le.isLink(r.mode)?7:4;return O[t>>0]=n,0}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return e.errno}},o:function(e,t,r,n,o,i){try{var a=ye(n,o);if(isNaN(a))return 61;var s=ge(fe.getStreamFromFD(e),t,r,a);return R[i>>2]=s,0}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return e.errno}},j:function(e,t,r,n){try{var o=ge(fe.getStreamFromFD(e),t,r);return R[n>>2]=o,0}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return e.errno}},p:function(e,t,r,n,o){try{var i=ye(t,r);if(isNaN(i))return 61;var a=fe.getStreamFromFD(e);return le.llseek(a,i,n),q=[a.position>>>0,(K=a.position,+Math.abs(K)>=1?K>0?(0|Math.min(+Math.floor(K/4294967296),4294967295))>>>0:~~+Math.ceil((K-+(~~K>>>0))/4294967296)>>>0:0)],R[o>>2]=q[0],R[o+4>>2]=q[1],a.getdents&&0===i&&0===n&&(a.getdents=null),0}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return e.errno}},i:function(e,t,r,n){try{var o=function(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=D[t>>2],s=D[t+4>>2];t+=8;var u=le.write(e,O,a,s,n);if(u<0)return-1;o+=u}return o}(fe.getStreamFromFD(e),t,r);return D[n>>2]=o,0}catch(e){if(void 0===le||!(e instanceof le.ErrnoError))throw e;return e.errno}},I:function(e){Te(e)}},Ae=(function(){var e={a:Se};function t(e,t){var r,n,o=e.exports;i.asm=o,S=i.asm.J,r=S.buffer,P=r,i.HEAP8=O=new Int8Array(r),i.HEAP16=x=new Int16Array(r),i.HEAP32=R=new Int32Array(r),i.HEAPU8=T=new Uint8Array(r),i.HEAPU16=new Uint16Array(r),i.HEAPU32=D=new Uint32Array(r),i.HEAPF32=new Float32Array(r),i.HEAPF64=new Float64Array(r),i.asm.N,n=i.asm.K,z.unshift(n),Q()}function r(e){t(e.instance)}function n(t){return(b||!g&&!y||"function"!=typeof fetch?Promise.resolve().then((function(){return re($)})):fetch($,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+$+"'";return e.arrayBuffer()})).catch((function(){return re($)}))).then((function(t){return WebAssembly.instantiate(t,e)})).then((function(e){return e})).then(t,(function(e){_("failed to asynchronously prepare wasm: "+e),ee(e)}))}if(J(),i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(e){return _("Module.instantiateWasm callback failed with error: "+e),!1}(b||"function"!=typeof WebAssembly.instantiateStreaming||te($)||v||"function"!=typeof fetch?n(r):fetch($,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(r,(function(e){return _("wasm streaming compile failed: "+e),_("falling back to ArrayBuffer instantiation"),n(r)}))}))).catch(o)}(),i.___wasm_call_ctors=function(){return(i.___wasm_call_ctors=i.asm.K).apply(null,arguments)},i.___errno_location=function(){return(Ae=i.___errno_location=i.asm.L).apply(null,arguments)}),Ie=(i._main=function(){return(i._main=i.asm.M).apply(null,arguments)},i.stackAlloc=function(){return(Ie=i.stackAlloc=i.asm.O).apply(null,arguments)});function ke(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Ce(e){var t=i._main;(e=e||[]).unshift(p);var r=e.length,n=Ie(4*(r+1)),o=n>>2;e.forEach((e=>{R[o++]=function(e){var t=U(e)+1,r=Ie(t);return L(e,O,r,t),r}(e)})),R[o]=0;try{var a=t(r,n);return Oe(a),a}catch(e){return function(e){if(e instanceof ke||"unwind"==e)return I;m(1,e)}(e)}}function Pe(e){function r(){_e||(_e=!0,i.calledRun=!0,k||(i.noFSInit||le.init.initialized||le.init(),le.ignorePermissions=!1,ae.init(),he.root=le.mount(he,{},null),ne(z),ne(j),t(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),xe&&Ce(e),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)e=i.postRun.shift(),V.unshift(e);var e;ne(V)}()))}e=e||d,W>0||(function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)e=i.preRun.shift(),B.unshift(e);var e;ne(B)}(),W>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),r()}),1)):r()))}function Oe(e,t){I=e,Te(e)}function Te(e){I=e,G()||(i.onExit&&i.onExit(e),k=!0),m(e,new ke(e))}if(i.FS=le,Z=function e(){_e||Pe(),_e||(Z=e)},i.run=Pe,i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();var xe=!0;return i.noInitialRun&&(xe=!1),Pe(),e.ready});e.exports=o},2890:(e,t,r)=>{var n,o=(n=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||__filename,function(e){var t,o,i=void 0!==(e=e||{})?e:{};i.ready=new Promise((function(e,r){t=e,o=r}));var a,s,u,c,l,f,h=Object.assign({},i),d=[],p="./this.program",m=(e,t)=>{throw t},g="object"==typeof window,y="function"==typeof importScripts,v="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,w="";v?(w=y?r(1017).dirname(w)+"/":__dirname+"/",f=()=>{l||(c=r(7147),l=r(1017))},a=function(e,t){return f(),e=l.normalize(e),c.readFileSync(e,t?void 0:"utf8")},u=e=>{var t=a(e,!0);return t.buffer||(t=new Uint8Array(t)),t},s=(e,t,r)=>{f(),e=l.normalize(e),c.readFile(e,(function(e,n){e?r(e):t(n.buffer)}))},process.argv.length>1&&(p=process.argv[1].replace(/\\/g,"/")),d=process.argv.slice(2),process.on("uncaughtException",(function(e){if(!(e instanceof Ee))throw e})),process.on("unhandledRejection",(function(e){throw e})),m=(e,t)=>{if(V())throw process.exitCode=e,t;var r;(r=t)instanceof Ee||_("exiting due to exception: "+r),process.exit(e)},i.inspect=function(){return"[Emscripten Module object]"}):(g||y)&&(y?w=self.location.href:"undefined"!=typeof document&&document.currentScript&&(w=document.currentScript.src),n&&(w=n),w=0!==w.indexOf("blob:")?w.substr(0,w.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},y&&(u=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),s=(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 b,E=i.print||console.log.bind(console),_=i.printErr||console.warn.bind(console);Object.assign(i,h),h=null,i.arguments&&(d=i.arguments),i.thisProgram&&(p=i.thisProgram),i.quit&&(m=i.quit),i.wasmBinary&&(b=i.wasmBinary);var S,A=i.noExitRuntime||!0;"object"!=typeof WebAssembly&&Q("no native wasm support detected");var I,k,C,P,O,T,x,R=!1,D="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function M(e,t,r){for(var n=t+r,o=t;e[o]&&!(o>=n);)++o;if(o-t>16&&e.buffer&&D)return D.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 F(e,t){return e?M(P,e,t):""}function N(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 L(e,t,r){return N(e,P,t,r)}function H(e){for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&e.charCodeAt(++r)),n<=127?++t:t+=n<=2047?2:n<=65535?3:4}return t}i.INITIAL_MEMORY;var U=[],B=[],z=[],j=[];function V(){return A}var G,$,X,K,q=0,W=null,Y=null;function Z(e){q++,i.monitorRunDependencies&&i.monitorRunDependencies(q)}function J(e){if(q--,i.monitorRunDependencies&&i.monitorRunDependencies(q),0==q&&(null!==W&&(clearInterval(W),W=null),Y)){var t=Y;Y=null,t()}}function Q(e){i.onAbort&&i.onAbort(e),_(e="Aborted("+e+")"),R=!0,I=1,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw o(t),t}function ee(e){return e.startsWith("data:application/octet-stream;base64,")}function te(e){try{if(e==G&&b)return new Uint8Array(b);if(u)return u(e);throw"both async and sync fetching of the wasm failed"}catch(e){Q(e)}}function re(e){for(;e.length>0;)e.shift()(i)}ee(G="objcopy.wasm")||($=G,G=i.locateFile?i.locateFile($,w):w+$);var ne={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=ne.isAbs(e),r="/"===e.substr(-1);return(e=ne.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=ne.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=ne.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments,0);return ne.normalize(e.join("/"))},join2:(e,t)=>ne.normalize(e+"/"+t)},oe={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:ce.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t=ne.isAbs(n)}return(t?"/":"")+(e=ne.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=oe.resolve(e).substr(1),t=oe.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("/")}},ie={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){ie.ttys[e]={input:[],output:[],ops:t},ce.registerDevice(e,ie.stream_ops)},stream_ops:{open:function(e){var t=ie.ttys[e.node.rdev];if(!t)throw new ce.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 ce.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 ce.ErrnoError(29)}if(void 0===s&&0===i)throw new ce.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 ce.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,t[r+i])}catch(e){throw new ce.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(v){var r=Buffer.alloc(256),n=0;try{n=c.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=ge(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(E(M(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(E(M(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(_(M(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(_(M(e.output,0)),e.output=[])}}};function ae(e){Q()}var se={ops_table:null,mount:function(e){return se.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(ce.isBlkdev(r)||ce.isFIFO(r))throw new ce.ErrnoError(63);se.ops_table||(se.ops_table={dir:{node:{getattr:se.node_ops.getattr,setattr:se.node_ops.setattr,lookup:se.node_ops.lookup,mknod:se.node_ops.mknod,rename:se.node_ops.rename,unlink:se.node_ops.unlink,rmdir:se.node_ops.rmdir,readdir:se.node_ops.readdir,symlink:se.node_ops.symlink},stream:{llseek:se.stream_ops.llseek}},file:{node:{getattr:se.node_ops.getattr,setattr:se.node_ops.setattr},stream:{llseek:se.stream_ops.llseek,read:se.stream_ops.read,write:se.stream_ops.write,allocate:se.stream_ops.allocate,mmap:se.stream_ops.mmap,msync:se.stream_ops.msync}},link:{node:{getattr:se.node_ops.getattr,setattr:se.node_ops.setattr,readlink:se.node_ops.readlink},stream:{}},chrdev:{node:{getattr:se.node_ops.getattr,setattr:se.node_ops.setattr},stream:ce.chrdev_stream_ops}});var o=ce.createNode(e,t,r,n);return ce.isDir(o.mode)?(o.node_ops=se.ops_table.dir.node,o.stream_ops=se.ops_table.dir.stream,o.contents={}):ce.isFile(o.mode)?(o.node_ops=se.ops_table.file.node,o.stream_ops=se.ops_table.file.stream,o.usedBytes=0,o.contents=null):ce.isLink(o.mode)?(o.node_ops=se.ops_table.link.node,o.stream_ops=se.ops_table.link.stream):ce.isChrdev(o.mode)&&(o.node_ops=se.ops_table.chrdev.node,o.stream_ops=se.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=ce.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,ce.isDir(e.mode)?t.size=4096:ce.isFile(e.mode)?t.size=e.usedBytes:ce.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&&se.resizeFileStorage(e,t.size)},lookup:function(e,t){throw ce.genericErrors[44]},mknod:function(e,t,r,n){return se.createNode(e,t,r,n)},rename:function(e,t,r){if(ce.isDir(e.mode)){var n;try{n=ce.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new ce.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=ce.lookupNode(e,t);for(var n in r.contents)throw new ce.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=se.createNode(e,t,41471,0);return n.link=r,n},readlink:function(e){if(!ce.isLink(e.mode))throw new ce.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(se.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&&ce.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new ce.ErrnoError(28);return n},allocate:function(e,t,r){se.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap:function(e,t,r,n,o){if(!ce.isFile(e.node.mode))throw new ce.ErrnoError(43);var i,a,s=e.node.contents;if(2&o||s.buffer!==k){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=ae()))throw new ce.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(!ce.isFile(e.node.mode))throw new ce.ErrnoError(43);return 2&o||se.stream_ops.write(e,t,0,n,r,!1),0}}};function ue(e,t,r,n){var o=n?"":"al "+e;s(e,(function(r){var n;n='Loading data file "'+e+'" failed (no arrayBuffer).',r||Q(n),t(new Uint8Array(r)),o&&J()}),(function(t){if(!r)throw'Loading data file "'+e+'" failed.';r()})),o&&Z()}var ce={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=oe.resolve(ce.cwd(),e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new ce.ErrnoError(32);for(var r=ne.normalizeArray(e.split("/").filter((e=>!!e)),!1),n=ce.root,o="/",i=0;i<r.length;i++){var a=i===r.length-1;if(a&&t.parent)break;if(n=ce.lookupNode(n,r[i]),o=ne.join2(o,r[i]),ce.isMountpoint(n)&&(!a||a&&t.follow_mount)&&(n=n.mounted.root),!a||t.follow)for(var s=0;ce.isLink(n.mode);){var u=ce.readlink(o);if(o=oe.resolve(ne.dirname(o),u),n=ce.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new ce.ErrnoError(32)}}return{path:o,node:n}},getPath:e=>{for(var t;;){if(ce.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)%ce.nameTable.length},hashAddNode:e=>{var t=ce.hashName(e.parent.id,e.name);e.name_next=ce.nameTable[t],ce.nameTable[t]=e},hashRemoveNode:e=>{var t=ce.hashName(e.parent.id,e.name);if(ce.nameTable[t]===e)ce.nameTable[t]=e.name_next;else for(var r=ce.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:(e,t)=>{var r=ce.mayLookup(e);if(r)throw new ce.ErrnoError(r,e);for(var n=ce.hashName(e.id,t),o=ce.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return ce.lookup(e,t)},createNode:(e,t,r,n)=>{var o=new ce.FSNode(e,t,r,n);return ce.hashAddNode(o),o},destroyNode:e=>{ce.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),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:e=>{var t=ce.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:e=>{var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>ce.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=ce.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate:(e,t)=>{try{return ce.lookupNode(e,t),20}catch(e){}return ce.nodePermissions(e,"wx")},mayDelete:(e,t,r)=>{var n;try{n=ce.lookupNode(e,t)}catch(e){return e.errno}var o=ce.nodePermissions(e,"wx");if(o)return o;if(r){if(!ce.isDir(n.mode))return 54;if(ce.isRoot(n)||ce.getPath(n)===ce.cwd())return 10}else if(ce.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?ce.isLink(e.mode)?32:ce.isDir(e.mode)&&("r"!==ce.flagsToPermissionString(t)||512&t)?31:ce.nodePermissions(e,ce.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:(e=0,t=ce.MAX_OPEN_FDS)=>{for(var r=e;r<=t;r++)if(!ce.streams[r])return r;throw new ce.ErrnoError(33)},getStream:e=>ce.streams[e],createStream:(e,t,r)=>{ce.FSStream||(ce.FSStream=function(){this.shared={}},ce.FSStream.prototype={},Object.defineProperties(ce.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 ce.FSStream,e);var n=ce.nextfd(t,r);return e.fd=n,ce.streams[n]=e,e},closeStream:e=>{ce.streams[e]=null},chrdev_stream_ops:{open:e=>{var t=ce.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new ce.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice:(e,t)=>{ce.devices[e]={stream_ops:t}},getDevice:e=>ce.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),ce.syncFSRequests++,ce.syncFSRequests>1&&_("warning: "+ce.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=ce.getMounts(ce.root.mount),n=0;function o(e){return ce.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((t=>{if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)}))},mount:(e,t,r)=>{var n,o="/"===r,i=!r;if(o&&ce.root)throw new ce.ErrnoError(10);if(!o&&!i){var a=ce.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,ce.isMountpoint(n))throw new ce.ErrnoError(10);if(!ce.isDir(n.mode))throw new ce.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},u=e.mount(s);return u.mount=s,s.root=u,o?ce.root=u:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),u},unmount:e=>{var t=ce.lookupPath(e,{follow_mount:!1});if(!ce.isMountpoint(t.node))throw new ce.ErrnoError(28);var r=t.node,n=r.mounted,o=ce.getMounts(n);Object.keys(ce.nameTable).forEach((e=>{for(var t=ce.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&ce.destroyNode(t),t=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(n);r.mount.mounts.splice(i,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod:(e,t,r)=>{var n=ce.lookupPath(e,{parent:!0}).node,o=ne.basename(e);if(!o||"."===o||".."===o)throw new ce.ErrnoError(28);var i=ce.mayCreate(n,o);if(i)throw new ce.ErrnoError(i);if(!n.node_ops.mknod)throw new ce.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,ce.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,ce.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{ce.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,ce.mknod(e,t,r)),symlink:(e,t)=>{if(!oe.resolve(e))throw new ce.ErrnoError(44);var r=ce.lookupPath(t,{parent:!0}).node;if(!r)throw new ce.ErrnoError(44);var n=ne.basename(t),o=ce.mayCreate(r,n);if(o)throw new ce.ErrnoError(o);if(!r.node_ops.symlink)throw new ce.ErrnoError(63);return r.node_ops.symlink(r,n,e)},rename:(e,t)=>{var r,n,o=ne.dirname(e),i=ne.dirname(t),a=ne.basename(e),s=ne.basename(t);if(r=ce.lookupPath(e,{parent:!0}).node,n=ce.lookupPath(t,{parent:!0}).node,!r||!n)throw new ce.ErrnoError(44);if(r.mount!==n.mount)throw new ce.ErrnoError(75);var u,c=ce.lookupNode(r,a),l=oe.relative(e,i);if("."!==l.charAt(0))throw new ce.ErrnoError(28);if("."!==(l=oe.relative(t,o)).charAt(0))throw new ce.ErrnoError(55);try{u=ce.lookupNode(n,s)}catch(e){}if(c!==u){var f=ce.isDir(c.mode),h=ce.mayDelete(r,a,f);if(h)throw new ce.ErrnoError(h);if(h=u?ce.mayDelete(n,s,f):ce.mayCreate(n,s))throw new ce.ErrnoError(h);if(!r.node_ops.rename)throw new ce.ErrnoError(63);if(ce.isMountpoint(c)||u&&ce.isMountpoint(u))throw new ce.ErrnoError(10);if(n!==r&&(h=ce.nodePermissions(r,"w")))throw new ce.ErrnoError(h);ce.hashRemoveNode(c);try{r.node_ops.rename(c,n,s)}catch(e){throw e}finally{ce.hashAddNode(c)}}},rmdir:e=>{var t=ce.lookupPath(e,{parent:!0}).node,r=ne.basename(e),n=ce.lookupNode(t,r),o=ce.mayDelete(t,r,!0);if(o)throw new ce.ErrnoError(o);if(!t.node_ops.rmdir)throw new ce.ErrnoError(63);if(ce.isMountpoint(n))throw new ce.ErrnoError(10);t.node_ops.rmdir(t,r),ce.destroyNode(n)},readdir:e=>{var t=ce.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new ce.ErrnoError(54);return t.node_ops.readdir(t)},unlink:e=>{var t=ce.lookupPath(e,{parent:!0}).node;if(!t)throw new ce.ErrnoError(44);var r=ne.basename(e),n=ce.lookupNode(t,r),o=ce.mayDelete(t,r,!1);if(o)throw new ce.ErrnoError(o);if(!t.node_ops.unlink)throw new ce.ErrnoError(63);if(ce.isMountpoint(n))throw new ce.ErrnoError(10);t.node_ops.unlink(t,r),ce.destroyNode(n)},readlink:e=>{var t=ce.lookupPath(e).node;if(!t)throw new ce.ErrnoError(44);if(!t.node_ops.readlink)throw new ce.ErrnoError(28);return oe.resolve(ce.getPath(t.parent),t.node_ops.readlink(t))},stat:(e,t)=>{var r=ce.lookupPath(e,{follow:!t}).node;if(!r)throw new ce.ErrnoError(44);if(!r.node_ops.getattr)throw new ce.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>ce.stat(e,!0),chmod:(e,t,r)=>{var n;if(!(n="string"==typeof e?ce.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new ce.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:(e,t)=>{ce.chmod(e,t,!0)},fchmod:(e,t)=>{var r=ce.getStream(e);if(!r)throw new ce.ErrnoError(8);ce.chmod(r.node,t)},chown:(e,t,r,n)=>{var o;if(!(o="string"==typeof e?ce.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new ce.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(e,t,r)=>{ce.chown(e,t,r,!0)},fchown:(e,t,r)=>{var n=ce.getStream(e);if(!n)throw new ce.ErrnoError(8);ce.chown(n.node,t,r)},truncate:(e,t)=>{if(t<0)throw new ce.ErrnoError(28);var r;if(!(r="string"==typeof e?ce.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new ce.ErrnoError(63);if(ce.isDir(r.mode))throw new ce.ErrnoError(31);if(!ce.isFile(r.mode))throw new ce.ErrnoError(28);var n=ce.nodePermissions(r,"w");if(n)throw new ce.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:(e,t)=>{var r=ce.getStream(e);if(!r)throw new ce.ErrnoError(8);if(0==(2097155&r.flags))throw new ce.ErrnoError(28);ce.truncate(r.node,t)},utime:(e,t,r)=>{var n=ce.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:(e,t,r)=>{if(""===e)throw new ce.ErrnoError(44);var n;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?ce.modeStringToFlags(t):t)?4095&r|32768:0,"object"==typeof e)n=e;else{e=ne.normalize(e);try{n=ce.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var o=!1;if(64&t)if(n){if(128&t)throw new ce.ErrnoError(20)}else n=ce.mknod(e,r,0),o=!0;if(!n)throw new ce.ErrnoError(44);if(ce.isChrdev(n.mode)&&(t&=-513),65536&t&&!ce.isDir(n.mode))throw new ce.ErrnoError(54);if(!o){var a=ce.mayOpen(n,t);if(a)throw new ce.ErrnoError(a)}512&t&&!o&&ce.truncate(n,0),t&=-131713;var s=ce.createStream({node:n,path:ce.getPath(n),flags:t,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!i.logReadFiles||1&t||(ce.readFiles||(ce.readFiles={}),e in ce.readFiles||(ce.readFiles[e]=1)),s},close:e=>{if(ce.isClosed(e))throw new ce.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{ce.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,t,r)=>{if(ce.isClosed(e))throw new ce.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new ce.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new ce.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 ce.ErrnoError(28);if(ce.isClosed(e))throw new ce.ErrnoError(8);if(1==(2097155&e.flags))throw new ce.ErrnoError(8);if(ce.isDir(e.node.mode))throw new ce.ErrnoError(31);if(!e.stream_ops.read)throw new ce.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new ce.ErrnoError(70)}else o=e.position;var a=e.stream_ops.read(e,t,r,n,o);return i||(e.position+=a),a},write:(e,t,r,n,o,i)=>{if(n<0||o<0)throw new ce.ErrnoError(28);if(ce.isClosed(e))throw new ce.ErrnoError(8);if(0==(2097155&e.flags))throw new ce.ErrnoError(8);if(ce.isDir(e.node.mode))throw new ce.ErrnoError(31);if(!e.stream_ops.write)throw new ce.ErrnoError(28);e.seekable&&1024&e.flags&&ce.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new ce.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:(e,t,r)=>{if(ce.isClosed(e))throw new ce.ErrnoError(8);if(t<0||r<=0)throw new ce.ErrnoError(28);if(0==(2097155&e.flags))throw new ce.ErrnoError(8);if(!ce.isFile(e.node.mode)&&!ce.isDir(e.node.mode))throw new ce.ErrnoError(43);if(!e.stream_ops.allocate)throw new ce.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 ce.ErrnoError(2);if(1==(2097155&e.flags))throw new ce.ErrnoError(2);if(!e.stream_ops.mmap)throw new ce.ErrnoError(43);return e.stream_ops.mmap(e,t,r,n,o)},msync:(e,t,r,n,o)=>e&&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 ce.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=ce.open(e,t.flags),o=ce.stat(e).size,i=new Uint8Array(o);return ce.read(n,i,0,o,0),"utf8"===t.encoding?r=M(i,0):"binary"===t.encoding&&(r=i),ce.close(n),r},writeFile:(e,t,r={})=>{r.flags=r.flags||577;var n=ce.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(H(t)+1),i=N(t,o,0,o.length);ce.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");ce.write(n,t,0,t.byteLength,void 0,r.canOwn)}ce.close(n)},cwd:()=>ce.currentPath,chdir:e=>{var t=ce.lookupPath(e,{follow:!0});if(null===t.node)throw new ce.ErrnoError(44);if(!ce.isDir(t.node.mode))throw new ce.ErrnoError(54);var r=ce.nodePermissions(t.node,"x");if(r)throw new ce.ErrnoError(r);ce.currentPath=t.path},createDefaultDirectories:()=>{ce.mkdir("/tmp"),ce.mkdir("/home"),ce.mkdir("/home/web_user")},createDefaultDevices:()=>{ce.mkdir("/dev"),ce.registerDevice(ce.makedev(1,3),{read:()=>0,write:(e,t,r,n,o)=>n}),ce.mkdev("/dev/null",ce.makedev(1,3)),ie.register(ce.makedev(5,0),ie.default_tty_ops),ie.register(ce.makedev(6,0),ie.default_tty1_ops),ce.mkdev("/dev/tty",ce.makedev(5,0)),ce.mkdev("/dev/tty1",ce.makedev(6,0));var e=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return function(){return crypto.getRandomValues(e),e[0]}}if(v)try{var t=r(6113);return function(){return t.randomBytes(1)[0]}}catch(e){}return function(){Q("randomDevice")}}();ce.createDevice("/dev","random",e),ce.createDevice("/dev","urandom",e),ce.mkdir("/dev/shm"),ce.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{ce.mkdir("/proc");var e=ce.mkdir("/proc/self");ce.mkdir("/proc/self/fd"),ce.mount({mount:()=>{var t=ce.createNode(e,"fd",16895,73);return t.node_ops={lookup:(e,t)=>{var r=+t,n=ce.getStream(r);if(!n)throw new ce.ErrnoError(8);var o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},t}},{},"/proc/self/fd")},createStandardStreams:()=>{i.stdin?ce.createDevice("/dev","stdin",i.stdin):ce.symlink("/dev/tty","/dev/stdin"),i.stdout?ce.createDevice("/dev","stdout",null,i.stdout):ce.symlink("/dev/tty","/dev/stdout"),i.stderr?ce.createDevice("/dev","stderr",null,i.stderr):ce.symlink("/dev/tty1","/dev/stderr"),ce.open("/dev/stdin",0),ce.open("/dev/stdout",1),ce.open("/dev/stderr",1)},ensureErrnoError:()=>{ce.ErrnoError||(ce.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},ce.ErrnoError.prototype=new Error,ce.ErrnoError.prototype.constructor=ce.ErrnoError,[44].forEach((e=>{ce.genericErrors[e]=new ce.ErrnoError(e),ce.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:()=>{ce.ensureErrnoError(),ce.nameTable=new Array(4096),ce.mount(se,{},"/"),ce.createDefaultDirectories(),ce.createDefaultDevices(),ce.createSpecialDirectories(),ce.filesystems={MEMFS:se}},init:(e,t,r)=>{ce.init.initialized=!0,ce.ensureErrnoError(),i.stdin=e||i.stdin,i.stdout=t||i.stdout,i.stderr=r||i.stderr,ce.createStandardStreams()},quit:()=>{ce.init.initialized=!1;for(var e=0;e<ce.streams.length;e++){var t=ce.streams[e];t&&ce.close(t)}},getMode:(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},findObject:(e,t)=>{var r=ce.analyzePath(e,t);return r.exists?r.object:null},analyzePath:(e,t)=>{try{e=(n=ce.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=ce.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=ne.basename(e),n=ce.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:ce.getPath(e);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var a=ne.join2(e,i);try{ce.mkdir(a)}catch(e){}e=a}}return a},createFile:(e,t,r,n,o)=>{var i=ne.join2("string"==typeof e?e:ce.getPath(e),t),a=ce.getMode(n,o);return ce.create(i,a)},createDataFile:(e,t,r,n,o,i)=>{var a=t;e&&(e="string"==typeof e?e:ce.getPath(e),a=t?ne.join2(e,t):e);var s=ce.getMode(n,o),u=ce.create(a,s);if(r){if("string"==typeof r){for(var c=new Array(r.length),l=0,f=r.length;l<f;++l)c[l]=r.charCodeAt(l);r=c}ce.chmod(u,146|s);var h=ce.open(u,577);ce.write(h,r,0,r.length,0,i),ce.close(h),ce.chmod(u,s)}return u},createDevice:(e,t,r,n)=>{var o=ne.join2("string"==typeof e?e:ce.getPath(e),t),i=ce.getMode(!!r,!!n);ce.createDevice.major||(ce.createDevice.major=64);var a=ce.makedev(ce.createDevice.major++,0);return ce.registerDevice(a,{open:e=>{e.seekable=!1},close:e=>{n&&n.buffer&&n.buffer.length&&n(10)},read:(e,t,n,o,i)=>{for(var a=0,s=0;s<o;s++){var u;try{u=r()}catch(e){throw new ce.ErrnoError(29)}if(void 0===u&&0===a)throw new ce.ErrnoError(6);if(null==u)break;a++,t[n+s]=u}return a&&(e.node.timestamp=Date.now()),a},write:(e,t,r,o,i)=>{for(var a=0;a<o;a++)try{n(t[r+a])}catch(e){throw new ce.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),a}}),ce.mkdev(o,i,a)},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(!a)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=ge(a(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new ce.ErrnoError(29)}},createLazyFile:(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((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]=((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||[]):ge(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(!y)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=ce.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 l(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((e=>{var t=u.stream_ops[e];c[e]=function(){return ce.forceLoadFile(u),t.apply(null,arguments)}})),c.read=(e,t,r,n,o)=>(ce.forceLoadFile(u),l(e,t,r,n,o)),c.mmap=(e,t,r,n,o)=>{ce.forceLoadFile(u);var i=ae();if(!i)throw new ce.ErrnoError(48);return l(e,C,i,t,r),{ptr:i,allocated:!0}},u.stream_ops=c,u},createPreloadedFile:(e,t,r,n,o,i,a,s,u,c)=>{var l=t?oe.resolve(ne.join2(e,t)):e;function f(r){function f(r){c&&c(),s||ce.createDataFile(e,t,r,n,o,u),i&&i(),J()}Browser.handledByPreloadPlugin(r,l,f,(()=>{a&&a(),J()}))||f(r)}Z(),"string"==typeof r?ue(r,(e=>f(e)),a):f(r)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var n=ce.indexedDB();try{var o=n.open(ce.DB_NAME(),ce.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=()=>{E("creating db"),o.result.createObjectStore(ce.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([ce.DB_STORE_NAME],"readwrite"),i=n.objectStore(ce.DB_STORE_NAME),a=0,s=0,u=e.length;function c(){0==s?t():r()}e.forEach((e=>{var t=i.put(ce.analyzePath(e).object.contents,e);t.onsuccess=()=>{++a+s==u&&c()},t.onerror=()=>{s++,a+s==u&&c()}})),n.onerror=r},o.onerror=r},loadFilesFromDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var n=ce.indexedDB();try{var o=n.open(ce.DB_NAME(),ce.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=r,o.onsuccess=()=>{var n=o.result;try{var i=n.transaction([ce.DB_STORE_NAME],"readonly")}catch(e){return void r(e)}var a=i.objectStore(ce.DB_STORE_NAME),s=0,u=0,c=e.length;function l(){0==u?t():r()}e.forEach((e=>{var t=a.get(e);t.onsuccess=()=>{ce.analyzePath(e).exists&&ce.unlink(e),ce.createDataFile(ne.dirname(e),ne.basename(e),t.result,!0,!0,!0),++s+u==c&&l()},t.onerror=()=>{u++,s+u==c&&l()}})),i.onerror=r},o.onerror=r}},le={DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){if(ne.isAbs(t))return t;var n;if(-100===e)n=ce.cwd();else{var o=ce.getStream(e);if(!o)throw new ce.ErrnoError(8);n=o.path}if(0==t.length){if(!r)throw new ce.ErrnoError(44);return n}return ne.join2(n,t)},doStat:function(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&ne.normalize(t)!==ne.normalize(ce.getPath(e.node)))return-54;throw e}return T[r>>2]=n.dev,T[r+4>>2]=0,T[r+8>>2]=n.ino,T[r+12>>2]=n.mode,T[r+16>>2]=n.nlink,T[r+20>>2]=n.uid,T[r+24>>2]=n.gid,T[r+28>>2]=n.rdev,T[r+32>>2]=0,K=[n.size>>>0,(X=n.size,+Math.abs(X)>=1?X>0?(0|Math.min(+Math.floor(X/4294967296),4294967295))>>>0:~~+Math.ceil((X-+(~~X>>>0))/4294967296)>>>0:0)],T[r+40>>2]=K[0],T[r+44>>2]=K[1],T[r+48>>2]=4096,T[r+52>>2]=n.blocks,T[r+56>>2]=n.atime.getTime()/1e3|0,T[r+60>>2]=0,T[r+64>>2]=n.mtime.getTime()/1e3|0,T[r+68>>2]=0,T[r+72>>2]=n.ctime.getTime()/1e3|0,T[r+76>>2]=0,K=[n.ino>>>0,(X=n.ino,+Math.abs(X)>=1?X>0?(0|Math.min(+Math.floor(X/4294967296),4294967295))>>>0:~~+Math.ceil((X-+(~~X>>>0))/4294967296)>>>0:0)],T[r+80>>2]=K[0],T[r+84>>2]=K[1],0},doMsync:function(e,t,r,n,o){var i=P.slice(e,e+r);ce.msync(t,i,o,r,n)},varargs:void 0,get:function(){return le.varargs+=4,T[le.varargs-4>>2]},getStr:function(e){return F(e)},getStreamFromFD:function(e){var t=ce.getStream(e);if(!t)throw new ce.ErrnoError(8);return t}},fe={};function he(){if(!he.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",_:p||"./this.program"};for(var t in fe)void 0===fe[t]?delete e[t]:e[t]=fe[t];var r=[];for(var t in e)r.push(t+"="+e[t]);he.strings=r}return he.strings}var de=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=ce.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},pe=365,me=146;function ge(e,t,r){var n=r>0?r:H(e)+1,o=new Array(n),i=N(e,o,0,o.length);return t&&(o.length=i),o}Object.defineProperties(de.prototype,{read:{get:function(){return(this.mode&pe)===pe},set:function(e){e?this.mode|=pe:this.mode&=-366}},write:{get:function(){return(this.mode&me)===me},set:function(e){e?this.mode|=me:this.mode&=-147}},isFolder:{get:function(){return ce.isDir(this.mode)}},isDevice:{get:function(){return ce.isChrdev(this.mode)}}}),ce.FSNode=de,ce.staticInit();var ye,ve={b:function(e,t,r,n){Q("Assertion failed: "+F(e)+", at: "+[t?F(t):"unknown filename",r,n?F(n):"unknown function"])},k:function(e,t){try{return e=le.getStr(e),ce.chmod(e,t),0}catch(e){if(void 0===ce||!(e instanceof ce.ErrnoError))throw e;return-e.errno}},D:function(e){try{var t=le.getStreamFromFD(e);return ce.createStream(t,0).fd}catch(e){if(void 0===ce||!(e instanceof ce.ErrnoError))throw e;return-e.errno}},E:function(e,t,r,n){try{if(t=le.getStr(t),t=le.calculateAt(e,t),-8&r)return-28;var o=ce.lookupPath(t,{follow:!0}).node;if(!o)return-44;var i="";return 4&r&&(i+="r"),2&r&&(i+="w"),1&r&&(i+="x"),i&&ce.nodePermissions(o,i)?-2:0}catch(e){if(void 0===ce||!(e instanceof ce.ErrnoError))throw e;return-e.errno}},B:function(e,t){try{return ce.fchmod(e,t),0}catch(e){if(void 0===ce||!(e instanceof ce.ErrnoError))throw e;return-e.errno}},d:function(e,t,r){le.varargs=r;try{var n=le.getStreamFromFD(e);switch(t){case 0:return(o=le.get())<0?-28:ce.createStream(n,o).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var o=le.get();return n.flags|=o,0;case 5:return o=le.get(),O[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return i=28,T[we()>>2]=i,-1}}catch(e){if(void 0===ce||!(e instanceof ce.ErrnoError))throw e;return-e.errno}var i},z:function(e,t){try{var r=le.getStreamFromFD(e);return le.doStat(ce.stat,r.path,t)}catch(e){if(void 0===ce||!(e instanceof ce.ErrnoError))throw e;return-e.errno}},v:function(e,t){try{if(0===t)return-28;var r=ce.cwd(),n=H(r)+1;return t<n?-68:(L(r,e,t),n)}catch(e){if(void 0===ce||!(e instanceof ce.ErrnoError))throw e;return-e.errno}},l:function(e,t,r){le.varargs=r;try{var n=le.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=le.get();return T[o>>2]=0,0;case 21520:return n.tty?-28:-59;case 21531:return o=le.get(),ce.ioctl(n,t,o);default:Q("bad ioctl syscall "+t)}}catch(e){if(void 0===ce||!(e instanceof ce.ErrnoError))throw e;return-e.errno}},x:function(e,t){try{return e=le.getStr(e),le.doStat(ce.lstat,e,t)}catch(e){if(void 0===ce||!(e instanceof ce.ErrnoError))throw e;return-e.errno}},u:function(e,t,r){try{return t=le.getStr(t),t=le.calculateAt(e,t),"/"===(t=ne.normalize(t))[t.length-1]&&(t=t.substr(0,t.length-1)),ce.mkdir(t,r,0),0}catch(e){if(void 0===ce||!(e instanceof ce.ErrnoError))throw e;return-e.errno}},w:function(e,t,r,n){try{t=le.getStr(t);var o=256&n,i=4096&n;return n&=-4353,t=le.calculateAt(e,t,i),le.doStat(o?ce.lstat:ce.stat,t,r)}catch(e){if(void 0===ce||!(e instanceof ce.ErrnoError))throw e;return-e.errno}},i:function(e,t,r,n){le.varargs=n;try{t=le.getStr(t),t=le.calculateAt(e,t);var o=n?le.get():0;return ce.open(t,r,o).fd}catch(e){if(void 0===ce||!(e instanceof ce.ErrnoError))throw e;return-e.errno}},t:function(e,t,r,n){try{if(t=le.getStr(t),t=le.calculateAt(e,t),n<=0)return-28;var o=ce.readlink(t),i=Math.min(n,H(o)),a=C[r+i];return L(o,r,n+1),C[r+i]=a,i}catch(e){if(void 0===ce||!(e instanceof ce.ErrnoError))throw e;return-e.errno}},s:function(e){try{return e=le.getStr(e),ce.rmdir(e),0}catch(e){if(void 0===ce||!(e instanceof ce.ErrnoError))throw e;return-e.errno}},y:function(e,t){try{return e=le.getStr(e),le.doStat(ce.stat,e,t)}catch(e){if(void 0===ce||!(e instanceof ce.ErrnoError))throw e;return-e.errno}},r:function(e,t,r){try{return t=le.getStr(t),t=le.calculateAt(e,t),0===r?ce.unlink(t):512===r?ce.rmdir(t):Q("Invalid flags passed to unlinkat"),0}catch(e){if(void 0===ce||!(e instanceof ce.ErrnoError))throw e;return-e.errno}},q:function(e,t,r,n){try{if(t=le.getStr(t),t=le.calculateAt(e,t,!0),r){var o=T[r>>2],i=T[r+4>>2];a=1e3*o+i/1e6,s=1e3*(o=T[(r+=8)>>2])+(i=T[r+4>>2])/1e6}else var a=Date.now(),s=a;return ce.utime(t,a,s),0}catch(e){if(void 0===ce||!(e instanceof ce.ErrnoError))throw e;return-e.errno}},j:function(){return Date.now()},C:function(){return!0},a:function(){Q("")},A:function(e,t,r){P.copyWithin(e,t,t+r)},e:function(e){P.length,Q("OOM")},m:function(e,t){var r=0;return he().forEach((function(n,o){var i=t+r;x[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},o:function(e,t){var r=he();x[e>>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),x[t>>2]=n,0},f:function(e){Ae(e)},c:function(e){try{var t=le.getStreamFromFD(e);return ce.close(t),0}catch(e){if(void 0===ce||!(e instanceof ce.ErrnoError))throw e;return e.errno}},p:function(e,t){try{var r=le.getStreamFromFD(e),n=r.tty?2:ce.isDir(r.mode)?3:ce.isLink(r.mode)?7:4;return C[t>>0]=n,0}catch(e){if(void 0===ce||!(e instanceof ce.ErrnoError))throw e;return e.errno}},h:function(e,t,r,n){try{var o=function(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=x[t>>2],s=x[t+4>>2];t+=8;var u=ce.read(e,C,a,s,n);if(u<0)return-1;if(o+=u,u<s)break}return o}(le.getStreamFromFD(e),t,r);return T[n>>2]=o,0}catch(e){if(void 0===ce||!(e instanceof ce.ErrnoError))throw e;return e.errno}},n: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=le.getStreamFromFD(e);return ce.llseek(a,i,n),K=[a.position>>>0,(X=a.position,+Math.abs(X)>=1?X>0?(0|Math.min(+Math.floor(X/4294967296),4294967295))>>>0:~~+Math.ceil((X-+(~~X>>>0))/4294967296)>>>0:0)],T[o>>2]=K[0],T[o+4>>2]=K[1],a.getdents&&0===i&&0===n&&(a.getdents=null),0}catch(e){if(void 0===ce||!(e instanceof ce.ErrnoError))throw e;return e.errno}var s,u},g:function(e,t,r,n){try{var o=function(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=x[t>>2],s=x[t+4>>2];t+=8;var u=ce.write(e,C,a,s,n);if(u<0)return-1;o+=u}return o}(le.getStreamFromFD(e),t,r);return x[n>>2]=o,0}catch(e){if(void 0===ce||!(e instanceof ce.ErrnoError))throw e;return e.errno}},F:function(e){Ie(e)}},we=(function(){var e={a:ve};function t(e,t){var r,n,o=e.exports;i.asm=o,S=i.asm.G,r=S.buffer,k=r,i.HEAP8=C=new Int8Array(r),i.HEAP16=O=new Int16Array(r),i.HEAP32=T=new Int32Array(r),i.HEAPU8=P=new Uint8Array(r),i.HEAPU16=new Uint16Array(r),i.HEAPU32=x=new Uint32Array(r),i.HEAPF32=new Float32Array(r),i.HEAPF64=new Float64Array(r),i.asm.K,n=i.asm.H,B.unshift(n),J()}function r(e){t(e.instance)}function n(t){return(b||!g&&!y||"function"!=typeof fetch?Promise.resolve().then((function(){return te(G)})):fetch(G,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+G+"'";return e.arrayBuffer()})).catch((function(){return te(G)}))).then((function(t){return WebAssembly.instantiate(t,e)})).then((function(e){return e})).then(t,(function(e){_("failed to asynchronously prepare wasm: "+e),Q(e)}))}if(Z(),i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(e){return _("Module.instantiateWasm callback failed with error: "+e),!1}(b||"function"!=typeof WebAssembly.instantiateStreaming||ee(G)||v||"function"!=typeof fetch?n(r):fetch(G,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(r,(function(e){return _("wasm streaming compile failed: "+e),_("falling back to ArrayBuffer instantiation"),n(r)}))}))).catch(o)}(),i.___wasm_call_ctors=function(){return(i.___wasm_call_ctors=i.asm.H).apply(null,arguments)},i._main=function(){return(i._main=i.asm.I).apply(null,arguments)},i.___errno_location=function(){return(we=i.___errno_location=i.asm.J).apply(null,arguments)}),be=i.stackAlloc=function(){return(be=i.stackAlloc=i.asm.L).apply(null,arguments)};function Ee(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function _e(e){var t=i._main;(e=e||[]).unshift(p);var r=e.length,n=be(4*(r+1)),o=n>>2;e.forEach((e=>{T[o++]=function(e){var t=H(e)+1,r=be(t);return N(e,C,r,t),r}(e)})),T[o]=0;try{var a=t(r,n);return Ae(a),a}catch(e){return function(e){if(e instanceof Ee||"unwind"==e)return I;m(1,e)}(e)}}function Se(e){function r(){ye||(ye=!0,i.calledRun=!0,R||(i.noFSInit||ce.init.initialized||ce.init(),ce.ignorePermissions=!1,ie.init(),re(B),re(z),t(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),ke&&_e(e),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)e=i.postRun.shift(),j.unshift(e);var e;re(j)}()))}e=e||d,q>0||(function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)e=i.preRun.shift(),U.unshift(e);var e;re(U)}(),q>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),r()}),1)):r()))}function Ae(e,t){I=e,Ie(e)}function Ie(e){I=e,V()||(i.onExit&&i.onExit(e),R=!0),m(e,new Ee(e))}if(i.FS=ce,Y=function e(){ye||Se(),ye||(Y=e)},i.run=Se,i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();var ke=!0;return i.noInitialRun&&(ke=!1),Se(),e.ready});e.exports=o},7757:(e,t,r)=>{e.exports=r(5666)},382:(e,t,r)=>{if("undefined"!=typeof SHARED_CONFIG)r.p=SHARED_CONFIG.url_base.cdn+"/";else{var n=r(1017).resolve;r.p=n(__dirname)+"/"}},4435:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toNumberSafe=t.divide=t.add=t.subtract=void 0,t.subtract=function(e,t){return"bigint"==typeof e&&"bigint"==typeof t||"number"==typeof e&&"number"==typeof t?e-t:BigInt(e)-BigInt(t)},t.add=function(e,t){return"bigint"==typeof e&&"bigint"==typeof t||"number"==typeof e&&"number"==typeof t?e+t:BigInt(e)+BigInt(t)},t.divide=function(e,t){return"bigint"==typeof e&&"bigint"==typeof t?e/t:"number"==typeof e&&"number"==typeof t?parseInt(e/t):BigInt(e)/BigInt(t)};const r=BigInt(1e51);t.toNumberSafe=function(e,t){if("bigint"==typeof e){if(!(e>r))return Number(e);if(!t)throw new Error("BigInt Overflow");t.push("BigInt Overflow")}else if("number"==typeof e)return e;throw new Error("Invalid Input for BigInt conversion")}},8411:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debug=void 0;const n=r(2524);function o(e,t=0){if(void 0!==e){const r=e.toString(16);return 0==t&&(t="bigint"==typeof e?8:r.length<=2?2:r.length<=4?4:8),`0x${r.padStart(t,"0")}`}return"<undefined>"}t.debug=function(e){let t="";const r=e.elf?e.elf:e;if(r){const e=r.bits?r.bits/4:8;if(t+=`Path: ${r.path}\n`,t+=`Class: ${r.classDescription} (${r.class})\n`,t+=`Bits: ${r.bits} bits\n`,t+=`Data: ${r.dataDescription} (${r.data})\n`,t+=`Version: ${r.version}\n`,t+=`OS/ABI: ${r.abiDescription} (${o(r.abi)})\n`,t+=`ABI version: ${r.abiVersion}\n`,t+=`Type: ${r.typeDescription} (${o(r.type)})\n`,t+=`ISA/machine: ${r.isaDescription} (${o(r.isa)})\n`,t+=`ISA/machine version: ${r.isaVersion}\n`,t+=`Entry Point: ${o(r.entryPoint)}\n`,t+=`Program header offset: ${o(r.programHeaderOffset)}\n`,t+=`Section header offset: ${o(r.sectionHeaderOffset)}\n`,t+=`Flags: ${r.flagsDescription} (${o(r.flags)})\n`,t+=`Program headers: ${r.programHeaderEntrySize} bytes × ${r.segments.length}\n`,t+=`Section headers: ${r.sectionHeaderEntrySize} bytes × ${r.sections.length}\n`,t+=`String table section index: ${r.shstrIndex}\n`,r.segments.length){t+="\n\nProgram Header Entries:\n\n",32==r.bits?t+=" # Type Offset VirtAddr PhysAddr FileSize MemSiz Align Flags\n":t+=" # Type Offset VirtAddr PhysAddr FileSize MemSiz Align Flags\n";for(const n of r.segments)t+=` ${n.index.toString().padEnd(3)} `,t+=`${n.typeDescription.padEnd(20)} `,t+=`${o(n.offset,e)} `,t+=`${o(n.vaddr,e)} `,t+=`${o(n.paddr,e)} `,t+=`${o(n.filesz,e)} `,t+=`${o(n.memsz,e)} `,t+=`${o(n.align,8)} `,t+=`${n.flagsDescription}\n`}if(r.sections.length){t+="\n\nSections:\n\n",32==r.bits?t+=" # Name Type Address Offset Size EntSize Link Info Align Flags\n":t+=" # Name Type Address Offset Size EntSize Link Info Align Flags\n";for(const n of r.sections)t+=` ${n.index.toString().padEnd(3)} `,t+=`${n.name.substr(0,18).padEnd(18)} `,t+=`${n.typeDescription.padEnd(32)} `,t+=`${o(n.addr,e)} `,t+=`${o(n.offset,e)} `,t+=`${o(n.size,e)} `,t+=`${o(n.entsize,e)} `,t+=`${(n.link||"").toString().padStart(4)} `,t+=`${(n.info||"").toString().padStart(4)} `,t+=`${o(n.addralign,8)} `,t+=`${n.flagsDescription}\n`}for(const i of r.sections)if(t+=`\n\n${i.typeDescription} section #${i.index} ${i.name}:\n\n`,(0,n.isSymbolSection)(i)){32==r.bits?t+=" # Value Size Type Bind Visibility Name\n":t+=" # Value Info Type Bind Visibility Name\n";let n=0;for(const r of i.symbols)t+=` ${(n++).toString().padStart(5)} `,t+=`${o(r.value,e)} `,t+=`${o(r.size,8)} `,t+=`${r.typeDescription.padEnd(28)} `,t+=`${r.bindingDescription.padEnd(6)} `,t+=`${r.visibilityDescription.padEnd(10)} `,t+=`${r.name}\n`}else if((0,n.isStringSection)(i))for(const e in i.strings)t+=` #${e} - ${i.strings[e]}\n`;else if((0,n.isRelocationSection)(i)){32==r.bits?t+=" # Offset Size Type Bind Visibility Name\n":t+=" # Offset Size Type Bind Visibility Name\n";let n=0;for(const r of i.relocations)t+=` ${(n++).toString().padStart(5)} `,t+=`${o(r.addr,e)} `,t+=`${o(r.info,e)} `,t+="\n"}}else t+="<undefined>";return t}},2302:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDisassembler=t.available=t.getCapstone=void 0;const n=r(1735),o=r(8744),i=Symbol.for("__capstone"),a=void 0!==typeof global?global:void 0!==typeof window?window:void 0;function s(){return a[i]}function u(e){switch(e){case o.ISA.ARM:return n.Architecture.ARM;case o.ISA.AARCH64:return n.Architecture.ARM64;case o.ISA.MIPS:case o.ISA.MIPS_RS3_LE:case o.ISA.MIPS_X:return n.Architecture.MIPS;case o.ISA.x86:case o.ISA.X86_64:return n.Architecture.X86;case o.ISA.PPC:case o.ISA.PPC64:return n.Architecture.PPC;case o.ISA.SPARC:case o.ISA.SPARC32PLUS:case o.ISA.SPARCV9:return n.Architecture.SPARC;case o.ISA.XCORE:return n.Architecture.XCORE;case o.ISA.ISA68K:return n.Architecture.M68K;case o.ISA.BPF:return n.Architecture.BPF;case o.ISA.RISCV:return n.Architecture.RISCV;case o.ISA.XTENSA:return n.Architecture.XTENSA;default:return}}t.getCapstone=s,t.available=function(){return a&&!!a[i]};const c={},l=new WeakMap;t.getDisassembler=function(e){const t=function(e){const t=u(e.isa);if(t){const r=`${n.Architecture[t]}-${e.bits.toString()}-${2==e.data?"big":"little"}`;return c[r]||(c[r]={})}}(e);if(t){const r=l.get(t);if(r)return r;{const r=function(e){const t=s();if(t){let r=(2==e.data?n.Mode.BIG_ENDIAN:n.Mode.LittleEndian)|(64==e.bits?n.Mode.Bits64:n.Mode.Bits32),o=u(e.isa);if(void 0!==o){const e=t.createInstance(o,r);if(e)return{normal:e,thumb:o===n.Architecture.ARM?t.createInstance(o,r|n.Mode.Thumb):void 0}}}}(e);if(r)return l.set(t,r),r}}}},798:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.disassembleWithReader=t.disassemble=t.getSymbolsByName=t.getSymbolByName=t.getSectionsByName=t.getSectionByName=t.fileOffsetToVirtualAddress=t.fileOffsetToPhysicalAddress=t.physicalAddressToFileOffset=t.physicalAddressToVirtual=t.virtualAddressToFileOffset=t.virtualAddressToPhysical=t.getSegmentsAtPhysicalMemoryLocation=t.getSegmentsAtVirtualMemoryLocation=t.getSectionsAtPhysicalMemoryLocation=t.getSectionsAtVirtualMemoryLocation=t.getSymbolsAtPhysicalMemoryLocation=t.getSymbolsAtVirtualMemoryLocation=t.getSegmentForSymbol=t.getSegmentsForSymbol=t.getSectionForSymbol=t.getSectionsForSymbol=t.getSectionsInSegment=t.getSymbolsInSegment=t.getSymbolsInSection=t.getSymbols=void 0;const n=r(4435),o=r(2524),i=r(280),a=r(2302);function s(e,t,r){const i=(0,n.add)(t,r),a=[];for(const r of e.sections)if((0,o.isSymbolSection)(r))for(const e of r.symbols)e.virtualAddress&&e.virtualAddress>=t&&e.virtualAddress<i&&a.push(e);return a}function u(e,t){const r=[];for(const o of e.sections)t.virtualAddress&&t.virtualAddress>=o.addr&&t.virtualAddress<=(0,n.add)(o.addr,o.size)&&r.push(o);return r}function c(e,t){const r=[];for(const o of e.segments)t.virtualAddress&&t.virtualAddress>=o.vaddr&&t.virtualAddress<=(0,n.add)(o.vaddr,o.memsz)&&r.push(o);return r}function l(e,t){const r=[];for(const i of e.sections)if((0,o.isSymbolSection)(i))for(const e of i.symbols)0==e.size?e.virtualAddress===t&&r.push(e):e.virtualAddress&&t>=e.virtualAddress&&t<(0,n.add)(e.virtualAddress,e.size)&&r.push(e);return r}function f(e,t){const r=[];for(const o of e.sections)t>=o.addr&&t<(0,n.add)(o.addr,o.size)&&r.push(o);return r}function h(e,t){for(const r of e.segments)if(t>=r.vaddr&&t<(0,n.add)(r.vaddr,r.memsz)){const e=(0,n.toNumberSafe)((0,n.subtract)(t,r.vaddr));if(e<r.filesz)return r.offset+e}}function d(e,t){for(const r of e.segments)if(t>=r.paddr&&t<(0,n.add)(r.paddr,r.filesz)){const e=(0,n.subtract)(t,r.paddr);return(0,n.add)(r.vaddr,e)}}function p(e,t){return e.sections.filter((e=>e.name.toUpperCase()==t.toUpperCase()))}t.getSymbols=function(e){const t=[];for(const r of e.sections)if((0,o.isSymbolSection)(r))for(const e of r.symbols)t.push(e);return t},t.getSymbolsInSection=function(e,t){const r="number"==typeof t?e.sections[t]:t;return s(e,r.addr,r.size)},t.getSymbolsInSegment=function(e,t){const r="number"==typeof t?e.segments[t]:t;return s(e,r.vaddr,r.memsz)},t.getSectionsInSegment=function(e,t){const r="number"==typeof t?e.segments[t]:t;return e.sections.filter((e=>e.addr>r.vaddr&&e.addr<(0,n.add)(r.vaddr,r.memsz)))},t.getSectionsForSymbol=u,t.getSectionForSymbol=function(e,t){return u(e,t)[0]},t.getSegmentsForSymbol=c,t.getSegmentForSymbol=function(e,t){return c(e,t)[0]},t.getSymbolsAtVirtualMemoryLocation=l,t.getSymbolsAtPhysicalMemoryLocation=function(e,t){const r=d(e,t);return r?l(e,r):[]},t.getSectionsAtVirtualMemoryLocation=f,t.getSectionsAtPhysicalMemoryLocation=function(e,t){const r=d(e,t);return r?f(e,r):[]},t.getSegmentsAtVirtualMemoryLocation=function(e,t){const r=[];for(const o of e.segments)t>=o.vaddr&&t<(0,n.add)(o.vaddr,o.memsz)&&r.push(o);return r},t.getSegmentsAtPhysicalMemoryLocation=function(e,t){const r=[];for(const o of e.segments)t>=o.paddr&&t<(0,n.add)(o.paddr,o.filesz)&&r.push(o);return r},t.virtualAddressToPhysical=function(e,t){for(const r of e.segments)if(t>=r.vaddr&&t<=(0,n.add)(r.vaddr,r.memsz)){const e=(0,n.subtract)(t,r.vaddr);if(e<r.filesz)return(0,n.add)(r.paddr,e)}},t.virtualAddressToFileOffset=h,t.physicalAddressToVirtual=d,t.physicalAddressToFileOffset=function(e,t){for(const r of e.segments)if(t>=r.paddr&&t<(0,n.add)(r.paddr,r.filesz)){const e=(0,n.toNumberSafe)((0,n.subtract)(t,r.paddr));return r.offset+e}},t.fileOffsetToPhysicalAddress=function(e,t){for(const r of e.segments)if(t>=r.offset&&t<(0,n.add)(r.offset,r.filesz)){const e=(0,n.subtract)(t,r.offset);return(0,n.add)(r.paddr,e)}},t.fileOffsetToVirtualAddress=function(e,t){for(const r of e.segments)if(t>=r.offset&&t<(0,n.add)(r.offset,r.filesz)){const e=(0,n.subtract)(t,r.offset);return(0,n.add)(r.vaddr,e)}},t.getSectionByName=function(e,t){return p(e,t)[0]},t.getSectionsByName=p,t.getSymbolByName=function(e,t){for(const r of e.sections)if((0,o.isSymbolSection)(r))for(const e of r.symbols)if(e.name&&e.name.toUpperCase()==t.toUpperCase())return e},t.getSymbolsByName=function(e,t){const r=[];for(const n of e.sections)if((0,o.isSymbolSection)(n))for(const e of n.symbols)e.name&&e.name.toUpperCase()==t.toUpperCase()&&r.push(e);return r},t.disassemble=function(e,t,r){const n=null==t?void 0:t.virtualAddress;if(t.type===i.SymbolType.Function&&t.size>0&&void 0!==n){const o=t.data;if(o&&o.byteLength>0){const t=(0,a.getDisassembler)(e);if(t){const e="number"==typeof n?BigInt(n):n;return t.normal.disassemble(o,e)}if(r)throw new Error("Could not create a disassembler instance.")}else if(r)throw new Error("Symbol data is not available.")}else if(r)throw new Error("the symbol is not valid for disassembly.");return[]},t.disassembleWithReader=async function(e,t,r,n){const o=null==t?void 0:t.virtualAddress;if(t.type===i.SymbolType.Function&&t.size>0&&void 0!==o){const i=h(e,o);if(i){const s=await r.view(t.size,i);if(s&&s.byteLength>0){const t=(0,a.getDisassembler)(e);if(t){const e="number"==typeof o?BigInt(o):o;return t.normal.disassemble(s,e)}if(n)throw new Error("Could not create a disassembler instance.")}else if(n)throw new Error("Symbol data is not available.")}else if(n)throw new Error("Symbol does not have a file offset.")}else if(n)throw new Error("the symbol is not valid for disassembly.");return[]}},5501:(e,t,r)=>{"use strict";let n;Object.defineProperty(t,"__esModule",{value:!0}),t.decode=void 0,t.decode=function(e,t,r){if(n)return n(e,t,r);throw new Error("There is no supported utf-8 decoder")};try{const{StringDecoder:e}=r(1576),t=new e("utf8");t&&(n=(e,r,n)=>t.end(e.subarray(r,r+n)))}catch(e){}if(void 0===n&&"undefined"!=typeof TextDecoder){const e=new TextDecoder;n=(t,r,n)=>e.decode(t.subarray(r,r+n))}},280:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t},a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.open=void 0;const s=i(r(9091)),u=r(3366);t.open=function(e,t,r){let n;var o;return t||(t={}),e instanceof Uint8Array||e instanceof ArrayBuffer?n=(0,u.readElf)(s.buffer(e),t):e instanceof Array?n=(0,u.readElf)(s.array(e),t):n="object"==typeof(o=e)&&"function"==typeof o.close&&"function"==typeof o.open&&"function"==typeof o.read&&"function"==typeof o.size&&"function"==typeof o.view?(0,u.readElf)(e,t):"number"==typeof e?(0,u.readElf)(s.syncfile(e),t):function(e){return"object"==typeof e&&"number"==typeof e.fd&&"function"==typeof e.stat&&"function"==typeof e.read}(e)?(0,u.readElf)(s.asyncfile(e),t):function(e){return"object"==typeof e&&"number"==typeof e.size&&"function"==typeof e.arrayBuffer}(e)?(0,u.readElf)(s.blob(e),t):"string"==typeof e?(0,u.readElf)(s.file(e),t):new Promise((e=>{e({success:!1,errors:["unsupported input type"],warnings:[]})})),r&&n.then(r),n},a(r(9091),t),a(r(798),t),a(r(8744),t),a(r(8411),t)},3366:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.readElf=void 0;const n=r(1228),o=r(8744),i=r(8533),a=r(2524),s=r(798),u=r(4435);t.readElf=async function(e,t){var r,c;let l=!1;const f=[],h=[];let d,p;try{await e.open();const p=await e.size();if(p<=64)f.push("Not a valid ELF file. Too small.");else{const m=await e.view(16),g=1179403647;m.getInt32(0,!0)!==g&&h.push("Not a valid ELF file. The file does not start with 0x7f ELF.");const y=m.getUint8(4),v=m.getUint8(5),w=m.getUint8(6),b=m.getUint8(7),E=m.getUint8(8);if((y<1||y>2)&&f.push("Not a valid ELF file. Class is invalid"),(v<1||v>2)&&f.push("Not a valid ELF file. Endianness is invalid"),1!=w&&h.push("Not a valid ELF file. Version is invalid"),0==f.length){const h=1===y?32:64,m=1!==v,g=b,_=32==h?36:48,S=await e.view(_),A=e=>S.getUint16(e,!m),I=e=>S.getUint32(e,!m),k=e=>S.getBigUint64(e,!m);let C=0;const P=A(C);C+=2;const O=A(C);C+=2;const T=I(C);let x,R,D;C+=4,32===h?(x=I(C),C+=4,R=I(C),C+=4,D=I(C),C+=4):(x=k(C),C+=8,R=(0,u.toNumberSafe)(k(C)),C+=8,D=(0,u.toNumberSafe)(k(C)),C+=8);const M=I(C);C+=4;const F=A(C);C+=2;const N=A(C);C+=2;const L=A(C);C+=2;const H=A(C);C+=2;const U=A(C);C+=2;const B=A(C);if(C+=2,(32===h&&52!==F||64==h&&64!==F)&&f.push("Invalid ELF file. Unexpected header size"),(0!=L&&(R<F||R>p)||0!=U&&(D<F||D>p))&&f.push("Invalid ELF file. Invalid offsets"),0!=L&&(32==h&&N<32||64==h&&N<56||N>255)&&f.push("Invalid ELF file. Program header entry size invalid"),0!=U&&(32==h&&H<40||64==h&&H<64||N>255)&&f.push("Invalid ELF file. Section header entry size invalid"),0==f.length){const f=P,p=O,b=await(0,i.readProgramHeaderEntries)(e,R,N,L,h,m),_=await(0,a.readSectionHeaderEntries)(e,D,H,U,h,m,B,null!==(r=t.readSymbolData)&&void 0!==r&&r);d={path:e.path,class:y,classDescription:1==y?"ELF32":"ELF64",data:v,dataDescription:1==v?"Little endian":"Big endian",version:w,bits:h,abi:g,abiVersion:E,abiDescription:(0,n.abiToString)(g),isa:p,isaDescription:(0,n.isaToString)(p),isaVersion:T,type:f,typeDescription:(0,n.objectTypeToString)(f),flags:M,flagsDescription:(0,n.elfFlagsToString)(p,M),entryPoint:x,programHeaderOffset:R,programHeaderEntrySize:N,numProgramHeaderEntries:L,sectionHeaderOffset:D,sectionHeaderEntrySize:H,numSectionHeaderEntries:U,shstrIndex:B,segments:b,sections:_},await async function(e,t,r){const n=t.size(),i=e.type;if(i===o.ObjectType.Executable||i===o.ObjectType.Relocatable||i===o.ObjectType.Shared)for(const c of e.sections)if((0,a.isSymbolSection)(c))for(const a of c.symbols)if(i===o.ObjectType.Relocatable?a.shndx<e.sections.length?a.virtualAddress=(0,u.add)(a.value,e.sections[a.shndx].addr):65521==a.shndx&&(a.virtualAddress=a.value):a.virtualAddress=a.value,r&&a.virtualAddress&&(a.type===o.SymbolType.Function||a.type===o.SymbolType.Object)&&a.size){const r=(0,s.virtualAddressToFileOffset)(e,a.value);r&&r+a.size<=n&&(a.data=await t.read(a.size,r))}}(d,e,null!==(c=t.readSymbolData)&&void 0!==c&&c),l=!0}}}}catch(e){f.push(`Exception caught: ${e.toString()}`)}if(t.returnReader)p=e;else{p=void 0;try{e&&await e.close()}catch(e){f.push(`Exception caught: ${e.toString()}`)}}return{success:l,errors:f,warnings:h,elf:d,reader:p}}},9091:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.blob=t.file=t.syncfile=t.asyncfile=t.buffer=t.array=void 0;const a=r(3292),s=i(r(7147)),u=i(r(1017));function c(e,t,r){let n=!1;const{array:o}=e;return o?t?(r||(r=e.position,n=!0),r<=e.size?(r+t>e.size&&(t=e.size-r),t<0&&(t=0),n&&(e.position+=t),Promise.resolve(new Uint8Array(o,e.offset+r,t))):Promise.reject("read past end of file")):Promise.reject("Length must be specified"):Promise.reject("state.array must be defined")}async function l(e,t,r){if(!e)throw"File not open";const n=new Uint8Array(t),{bytesRead:o}=await e.read(n,0,t,r);return o<t?n.slice(0,o):n}function f(e,t,r){return new Promise(((n,o)=>{const i=new Uint8Array(t);s.read(e,i,0,t,null!=r?r:null,((e,r)=>{e?o(e):n(r<t?i.slice(0,r):i)}))}))}function h(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function d(e){return{open:()=>Promise.reject(e),read:(t,r)=>Promise.reject(e),view:(t,r)=>Promise.reject(e),size:()=>-1,close:()=>Promise.reject(e)}}function p(e){const t={array:e instanceof Uint8Array?e.buffer:e,offset:0,position:0,size:e.byteLength};return e instanceof Uint8Array&&(t.offset=e.byteOffset),{open:()=>Promise.resolve(),size:()=>t.size,close:()=>Promise.resolve(),read:(e,r)=>c(t,e,r),view:(e,r)=>c(t,e,r).then(h)}}t.array=function(e){return p(Uint8Array.from(e))},t.buffer=p,t.asyncfile=function(e,t){if(!s)return d("No filesystem");const r={fh:e,size:0,ownshandle:t};return{open:()=>r.fh.stat().then((e=>{r.size=e.size})),read:(e,t)=>l(r.fh,e,t),view:(e,t)=>l(r.fh,e,t).then(h),size:()=>r.size,close:()=>r.ownshandle?r.fh.close():Promise.resolve()}},t.syncfile=function(e,t){if(!s)return d("No filesystem");const r={ownshandle:t,handle:e,size:0};return{open:()=>new Promise(((e,t)=>s.fstat(r.handle,((n,o)=>{n?t(n):(r.size=o.size,e())})))),read:(e,t)=>f(r.handle,e,t),view:(e,t)=>f(r.handle,e,t).then(h),size:()=>r.size,close:()=>new Promise(((e,t)=>{r.ownshandle?s.close(r.handle,(r=>{r?t(r):e()})):e()}))}},t.file=function(e){if(!s)return d("No filesystem");const t={path:e,fh:void 0,size:0};return{open:()=>(0,a.open)(t.path,"r").then((e=>(t.fh=e,e.stat().then((e=>{t.size=e.size}))))),read:(e,r)=>l(t.fh,e,r),view:(e,r)=>l(t.fh,e,r).then(h),size:()=>t.size,close:()=>t.fh?t.fh.close():Promise.resolve(),path:u.resolve(e)}},t.blob=function(e){const t={offset:0,position:0,size:0};return{open:()=>e.arrayBuffer().then((e=>{t.array=e,t.offset=0,t.position=0,t.size=e.byteLength})),close:()=>Promise.resolve(),size:()=>t.size,read:(e,r)=>c(t,e,r),view:(e,r)=>c(t,e,r).then(h)}}},2524:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isRelocationSection=t.isSymbolSection=t.isStringSection=t.readSectionHeaderEntries=void 0;const n=r(8744),o=r(1228),i=r(4435),a=r(5501);function s(e,t){let r=e[t];if(!r)for(const n in e){const o=parseInt(n);if(o<t){const n=e[o];if(o+n.length>t){r=n.substr(t-o);break}}}return r}async function u(e,t,r){const n=await e.read(Number(r),Number(t));let o=0;const i={};for(let e=0;e<r;e++)if(0==n[e]){const t=e-o;t>0&&(i[o]=(0,a.decode)(n,o,t)),o=e+1}return i}async function c(e,t,r,n,a,s){await e.size();const u=(0,i.divide)(r,n);const c=[];for(let r=0;r<u;r++){const i=await e.view(n,t+r*n),u=i.getUint8.bind(i),l=e=>i.getUint16(e,!a),f=e=>i.getUint32(e,!a),h=e=>i.getBigUint64(e,!a);let d,p,m,g,y,v,w=0;32==s?(d=f(w),w+=4,y=f(w),w+=4,v=f(w),w+=4,p=u(w),w+=1,m=u(w),w+=1,g=l(w),w+=2):(d=f(w),w+=4,p=u(w),w+=1,m=u(w),w+=1,g=l(w),w+=2,y=h(w),w+=8,v=Number(h(w)),w+=8);const b=15&p,E=p>>4,_=3&m;c[r]={nameix:d,name:"",info:p,other:m,shndx:g,value:y,size:v,type:b,binding:E,visibility:_,typeDescription:(0,o.symbolTypeToString)(b),bindingDescription:(0,o.symbolBindingToString)(E),visibilityDescription:(0,o.symbolVisibilityToString)(_)}}return c}async function l(e,t,r,n,o,a,s){await e.size();const u=(0,i.toNumberSafe)((0,i.divide)(r,n));const c=new Array(u);for(let r=0;r<u;r++){const u=await e.view(n,t+r*n),l=e=>u.getUint32(e,!o),f=e=>u.getBigUint64(e,!o),h=e=>u.getInt32(e,!o),d=e=>u.getBigInt64(e,!o);let p,m,g,y,v,w=0;32==a?(p=l(w),w+=4,m=l(w),w+=4,s&&(v=h(w),w+=4),g=m>>8,y=255&m):(p=f(w),w+=8,m=f(w),w+=8,s&&(v=d(w),w+=8),g=(0,i.toNumberSafe)(m>>BigInt(32)),y=(0,i.toNumberSafe)(m&BigInt(4294967295))),c[r]={addr:p,info:m,addend:v,symbolIndex:g,type:y}}return c}function f(e,t){if(t)for(let r=0;r<e.length;r++)e[r].name=s(t,e[r].nameix)||""}function h(e){return(null==e?void 0:e.type)===n.SectionHeaderEntryType.StrTab}function d(e){return(null==e?void 0:e.type)===n.SectionHeaderEntryType.DynSym||(null==e?void 0:e.type)===n.SectionHeaderEntryType.SymTab}function p(e){return(null==e?void 0:e.type)===n.SectionHeaderEntryType.Rel||(null==e?void 0:e.type)===n.SectionHeaderEntryType.Rela}t.readSectionHeaderEntries=async function(e,t,r,a,m,g,y,v){if(0==a)return[];const w=new Array(a);for(let n=0;n<a;n++){const a=await e.view(r,Number(t)+n*Number(r)),s=e=>a.getUint32(e,!g),u=e=>a.getBigUint64(e,!g),c=s(0),l=s(4);let f,h,d,p,y,v,b,E,_=8;32==m?(f=s(_),_+=4,h=s(_),_+=4,d=s(_),_+=4,p=s(_),_+=4,y=s(_),_+=4,v=s(_),_+=4,b=s(_),_+=4,E=s(_),_+=4):(f=(0,i.toNumberSafe)(u(_)),_+=8,h=u(_),_+=8,d=(0,i.toNumberSafe)(u(_)),_+=8,p=(0,i.toNumberSafe)(u(_)),_+=8,y=s(_),_+=4,v=s(_),_+=4,b=(0,i.toNumberSafe)(u(_)),_+=8,E=(0,i.toNumberSafe)(u(_)),_+=8);const S={index:n,name:"",nameix:c,type:l,typeDescription:(0,o.sectionHeaderEntryTypeToString)(l),flags:f,flagsDescription:(0,o.sectionFlagsToString)(f),addr:h,offset:d,size:p,link:y,info:v,addralign:b,entsize:E};w[n]=S}for(const t of w)if(h(t)){const{size:r,offset:n}=t;t.strings=await u(e,n,r)}for(const t of w){if(d(t)){const{size:r,offset:n,entsize:o,link:i}=t;if(t.symbols=await c(e,n,r,o,g,m),i>=0&&i<w.length){const e=w[i];h(e)&&f(t.symbols,e.strings)}}if(p(t)){const{size:r,offset:o,entsize:i}=t;t.relocations=await l(e,o,r,i,g,m,t.type===n.SectionHeaderEntryType.Rela)}}return function(e,t){if(t<e.length){const r=e[t];if(h(r)){const t=r.strings;t&&e.forEach((e=>{if(0==e.nameix)e.name="<null>";else{const r=s(t,e.nameix);r&&(e.name=r)}}))}}}(w,y),w},t.isStringSection=h,t.isSymbolSection=d,t.isRelocationSection=p},8533:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.readProgramHeaderEntries=void 0;const n=r(1228),o=r(4435);t.readProgramHeaderEntries=async function(e,t,r,i,a,s){if(0==i)return[];const u=new Array(i);for(let c=0;c<i;c++){const i=await e.view(r,Number(t)+c*Number(r)),l=e=>i.getUint32(e,!s),f=e=>i.getBigUint64(e,!s),h=l(0);let d,p,m,g,y,v,w,b=4;32==a?(p=l(b),b+=4,m=l(b),b+=4,g=l(b),b+=4,y=l(b),b+=4,v=l(b),b+=4,d=l(b),b+=4,w=l(b),b+=4):(d=l(b),b+=4,p=(0,o.toNumberSafe)(f(b)),b+=8,m=f(b),b+=8,g=f(b),b+=8,y=(0,o.toNumberSafe)(f(b)),b+=8,v=(0,o.toNumberSafe)(f(b)),b+=8,w=(0,o.toNumberSafe)(f(b)),b+=8),u[c]={index:c,type:h,typeDescription:(0,n.programHeaderEntryTypeToString)(h),flags:d,flagsDescription:(0,n.programHeaderFlagsToString)(d),offset:p,vaddr:m,paddr:g,filesz:y,memsz:v,align:w}}return u}},1228:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.symbolVisibilityToString=t.symbolBindingToString=t.symbolTypeToString=t.elfFlagsToString=t.programHeaderFlagsToString=t.sectionFlagsToString=t.sectionHeaderEntryTypeToString=t.programHeaderEntryTypeToString=t.objectTypeToString=t.abiToString=t.isaToString=void 0;const n=r(8744);t.isaToString=function(e){switch(e){case n.ISA.None:return"No machine";case n.ISA.M32:return"AT&T WE 32100";case n.ISA.SPARC:return"SUN SPARC";case n.ISA.x86:return"Intel x86";case n.ISA.ISA68K:return"Motorola m68k family";case n.ISA.ISA88K:return"Motorola m88k family";case n.ISA.IAMCU:return"Intel MCU";case n.ISA.ISA860:return"Intel 80860";case n.ISA.MIPS:return"MIPS R3000 big-endian";case n.ISA.S370:return"IBM System/370";case n.ISA.MIPS_RS3_LE:return"MIPS R3000 little-endian";case n.ISA.PARISC:return"HPPA";case n.ISA.VPP500:return"Fujitsu VPP500";case n.ISA.SPARC32PLUS:return'Sun\'s "v8plus"';case n.ISA.ISA960:return"Intel 80960";case n.ISA.PPC:return"PowerPC";case n.ISA.PPC64:return"PowerPC 64-bit";case n.ISA.S390:return"IBM S390";case n.ISA.SPU:return"IBM SPU/SPC";case n.ISA.V800:return"NEC V800 series";case n.ISA.FR20:return"Fujitsu FR20";case n.ISA.RH32:return"TRW RH-32";case n.ISA.RCE:return"Motorola RCE";case n.ISA.ARM:return"ARM";case n.ISA.FAKE_ALPHA:return"Digital Alpha";case n.ISA.SH:return"Hitachi SH";case n.ISA.SPARCV9:return"SPARC v9 64-bit";case n.ISA.TRICORE:return"Siemens Tricore";case n.ISA.ARC:return"Argonaut RISC Core";case n.ISA.H8_300:return"Hitachi H8/300";case n.ISA.H8_300H:return"Hitachi H8/300H";case n.ISA.H8S:return"Hitachi H8S";case n.ISA.H8_500:return"Hitachi H8/500";case n.ISA.IA_64:return"Intel Merced";case n.ISA.MIPS_X:return"Stanford MIPS-X";case n.ISA.COLDFIRE:return"Motorola Coldfire";case n.ISA.ISA68HC12:return"Motorola M68HC12";case n.ISA.MMA:return"Fujitsu MMA Multimedia Accelerator";case n.ISA.PCP:return"Siemens PCP";case n.ISA.NCPU:return"Sony nCPU embeeded RISC";case n.ISA.NDR1:return"Denso NDR1 microprocessor";case n.ISA.STARCORE:return"Motorola Start*Core processor";case n.ISA.ME16:return"Toyota ME16 processor";case n.ISA.ST100:return"STMicroelectronic ST100 processor";case n.ISA.TINYJ:return"Advanced Logic Corp. Tinyj emb.fam";case n.ISA.X86_64:return"AMD x86-64 architecture";case n.ISA.PDSP:return"Sony DSP Processor";case n.ISA.PDP10:return"Digital PDP-10";case n.ISA.PDP11:return"Digital PDP-11";case n.ISA.FX66:return"Siemens FX66 microcontroller";case n.ISA.ST9PLUS:return"STMicroelectronics ST9+ 8/16 mc";case n.ISA.ST7:return"STmicroelectronics ST7 8 bit mc";case n.ISA.ISA68HC16:return"Motorola MC68HC16 microcontroller";case n.ISA.ISA68HC11:return"Motorola MC68HC11 microcontroller";case n.ISA.ISA68HC08:return"Motorola MC68HC08 microcontroller";case n.ISA.ISA68HC05:return"Motorola MC68HC05 microcontroller";case n.ISA.SVX:return"Silicon Graphics SVx";case n.ISA.ST19:return"STMicroelectronics ST19 8 bit mc";case n.ISA.VAX:return"Digital VAX";case n.ISA.CRIS:return"Axis Communications 32-bit emb.proc";case n.ISA.JAVELIN:return"Infineon Technologies 32-bit emb.proc";case n.ISA.FIREPATH:return"Element 14 64-bit DSP Processor";case n.ISA.ZSP:return"LSI Logic 16-bit DSP Processor";case n.ISA.MMIX:return"Donald Knuth's educational 64-bit proc";case n.ISA.HUANY:return"Harvard University machine-independent object files";case n.ISA.PRISM:return"SiTera Prism";case n.ISA.AVR:return"Atmel AVR 8-bit microcontroller";case n.ISA.FR30:return"Fujitsu FR30";case n.ISA.D10V:return"Mitsubishi D10V";case n.ISA.D30V:return"Mitsubishi D30V";case n.ISA.V850:return"NEC v850";case n.ISA.M32R:return"Mitsubishi M32R";case n.ISA.MN10300:return"Matsushita MN10300";case n.ISA.MN10200:return"Matsushita MN10200";case n.ISA.PJ:return"picoJava";case n.ISA.OPENRISC:return"OpenRISC 32-bit embedded processor";case n.ISA.ARC_COMPACT:return"ARC International ARCompact";case n.ISA.XTENSA:return"Tensilica Xtensa Architecture";case n.ISA.VIDEOCORE:return"Alphamosaic VideoCore";case n.ISA.TMM_GPP:return"Thompson Multimedia General Purpose Proc";case n.ISA.NS32K:return"National Semi. 32000";case n.ISA.TPC:return"Tenor Network TPC";case n.ISA.SNP1K:return"Trebia SNP 1000";case n.ISA.ST200:return"STMicroelectronics ST200";case n.ISA.IP2K:return"Ubicom IP2xxx";case n.ISA.MAX:return"MAX processor";case n.ISA.CR:return"National Semi. CompactRISC";case n.ISA.F2MC16:return"Fujitsu F2MC16";case n.ISA.MSP430:return"Texas Instruments msp430";case n.ISA.BLACKFIN:return"Analog Devices Blackfin DSP";case n.ISA.SE_C33:return"Seiko Epson S1C33 family";case n.ISA.SEP:return"Sharp embedded microprocessor";case n.ISA.ARCA:return"Arca RISC";case n.ISA.UNICORE:return"PKU-Unity & MPRC Peking Uni. mc series";case n.ISA.EXCESS:return"eXcess configurable cpu";case n.ISA.DXP:return"Icera Semi. Deep Execution Processor";case n.ISA.ALTERA_NIOS2:return"Altera Nios II";case n.ISA.CRX:return"National Semi. CompactRISC CRX";case n.ISA.XGATE:return"Motorola XGATE";case n.ISA.C166:return"Infineon C16x/XC16x";case n.ISA.M16C:return"Renesas M16C";case n.ISA.DSPIC30F:return"Microchip Technology dsPIC30F";case n.ISA.CE:return"Freescale Communication Engine RISC";case n.ISA.M32C:return"Renesas M32C";case n.ISA.TSK3000:return"Altium TSK3000";case n.ISA.RS08:return"Freescale RS08";case n.ISA.SHARC:return"Analog Devices SHARC family";case n.ISA.ECOG2:return"Cyan Technology eCOG2";case n.ISA.SCORE7:return"Sunplus S+core7 RISC";case n.ISA.DSP24:return"New Japan Radio (NJR) 24-bit DSP";case n.ISA.VIDEOCORE3:return"Broadcom VideoCore III";case n.ISA.LATTICEMICO32:return"RISC for Lattice FPGA";case n.ISA.SE_C17:return"Seiko Epson C17";case n.ISA.TI_C6000:return"Texas Instruments TMS320C6000 DSP";case n.ISA.TI_C2000:return"Texas Instruments TMS320C2000 DSP";case n.ISA.TI_C5500:return"Texas Instruments TMS320C55x DSP";case n.ISA.TI_ARP32:return"Texas Instruments App. Specific RISC";case n.ISA.TI_PRU:return"Texas Instruments Prog. Realtime Unit";case n.ISA.MMDSP_PLUS:return"STMicroelectronics 64bit VLIW DSP";case n.ISA.CYPRESS_M8C:return"Cypress M8C";case n.ISA.R32C:return"Renesas R32C";case n.ISA.TRIMEDIA:return"NXP Semi. TriMedia";case n.ISA.QDSP6:return"QUALCOMM DSP6";case n.ISA.ISA8051:return"Intel 8051 and variants";case n.ISA.STXP7X:return"STMicroelectronics STxP7x";case n.ISA.NDS32:return"Andes Tech. compact code emb. RISC";case n.ISA.ECOG1X:return"Cyan Technology eCOG1X";case n.ISA.MAXQ30:return"Dallas Semi. MAXQ30 mc";case n.ISA.XIMO16:return"New Japan Radio (NJR) 16-bit DSP";case n.ISA.MANIK:return"M2000 Reconfigurable RISC";case n.ISA.CRAYNV2:return"Cray NV2 vector architecture";case n.ISA.RX:return"Renesas RX";case n.ISA.METAG:return"Imagination Tech. META";case n.ISA.MCST_ELBRUS:return"MCST Elbrus";case n.ISA.ECOG16:return"Cyan Technology eCOG16";case n.ISA.CR16:return"National Semi. CompactRISC CR16";case n.ISA.ETPU:return"Freescale Extended Time Processing Unit";case n.ISA.SLE9X:return"Infineon Tech. SLE9X";case n.ISA.L10M:return"Intel L10M";case n.ISA.K10M:return"Intel K10M";case n.ISA.AARCH64:return"ARM AARCH64";case n.ISA.AVR32:return"Amtel 32-bit microprocessor";case n.ISA.STM8:return"STMicroelectronics STM8";case n.ISA.TILE64:return"Tileta TILE64";case n.ISA.TILEPRO:return"Tilera TILEPro";case n.ISA.MICROBLAZE:return"Xilinx MicroBlaze";case n.ISA.CUDA:return"NVIDIA CUDA";case n.ISA.TILEGX:return"Tilera TILE-Gx";case n.ISA.CLOUDSHIELD:return"CloudShield";case n.ISA.COREA_1ST:return"KIPO-KAIST Core-A 1st gen.";case n.ISA.COREA_2ND:return"KIPO-KAIST Core-A 2nd gen.";case n.ISA.ARC_COMPACT2:return"Synopsys ARCompact V2";case n.ISA.OPEN8:return"Open8 RISC";case n.ISA.RL78:return"Renesas RL78";case n.ISA.VIDEOCORE5:return"Broadcom VideoCore V";case n.ISA.ISA78KOR:return"Renesas 78KOR";case n.ISA.ISA56800EX:return"Freescale 56800EX DSC";case n.ISA.BA1:return"Beyond BA1";case n.ISA.BA2:return"Beyond BA2";case n.ISA.XCORE:return"XMOS xCORE";case n.ISA.MCHP_PIC:return"Microchip 8-bit PIC(r)";case n.ISA.KM32:return"KM211 KM32";case n.ISA.KMX32:return"KM211 KMX32";case n.ISA.EMX16:return"KM211 KMX16";case n.ISA.EMX8:return"KM211 KMX8";case n.ISA.KVARC:return"KM211 KVARC";case n.ISA.CDP:return"Paneve CDP";case n.ISA.COGE:return"Cognitive Smart Memory Processor";case n.ISA.COOL:return"Bluechip CoolEngine";case n.ISA.NORC:return"Nanoradio Optimized RISC";case n.ISA.CSR_KALIMBA:return"CSR Kalimba";case n.ISA.Z80:return"Zilog Z80";case n.ISA.VISIUM:return"Controls and Data Services VISIUMcore";case n.ISA.FT32:return"FTDI Chip FT32";case n.ISA.MOXIE:return"Moxie processor";case n.ISA.AMDGPU:return"AMD GPU";case n.ISA.RISCV:return"RISC-V";case n.ISA.BPF:return"Linux BPF";case n.ISA.CSKY:return"C-SKY"}},t.abiToString=function(e){switch(e){case n.ABI.GNUHurd:return"GNU Hurd";case n.ABI.NovelloModesto:return"Novello Modesto";case n.ABI.HPUX:return"HP-UX";case n.ABI.NonStopKernel:return"NonStop Kernel";case n.ABI.FenixOS:return"Fenix OS";case n.ABI.ARMEABI:return"ARM EABI";default:return n.ABI[e]||e.toString()}},t.objectTypeToString=function(e){return n.ObjectType[e]||e.toString()},t.programHeaderEntryTypeToString=function(e){switch(e){case n.ProgramHeaderEntryType.ProgramHeaderTable:return"Program Header Table";case n.ProgramHeaderEntryType.GnuEhFrame:return"GNU EH frame";case n.ProgramHeaderEntryType.GnuStack:return"GNU stack info";case n.ProgramHeaderEntryType.GnuRelRo:return"GNU ro relocation";default:return n.ProgramHeaderEntryType[e]||e.toString()}},t.sectionHeaderEntryTypeToString=function(e){switch(e){case n.SectionHeaderEntryType.Null:return"NULL";case n.SectionHeaderEntryType.ProgBits:return"Prog bits";case n.SectionHeaderEntryType.SymTab:return"Symbol table";case n.SectionHeaderEntryType.StrTab:return"String table";case n.SectionHeaderEntryType.Rela:return"Relocation with addends";case n.SectionHeaderEntryType.Hash:return"Symbol hash table";case n.SectionHeaderEntryType.Dynamic:return"Dynamic";case n.SectionHeaderEntryType.Note:return"Note";case n.SectionHeaderEntryType.NoBits:return"No bits";case n.SectionHeaderEntryType.Rel:return"Relocation";case n.SectionHeaderEntryType.ShLib:return"ShLib";case n.SectionHeaderEntryType.DynSym:return"Dynamic linking symbols";case n.SectionHeaderEntryType.InitArray:return"Init array";case n.SectionHeaderEntryType.FiniArray:return"Fini array";case n.SectionHeaderEntryType.PreInitArray:return"Pre-init array";case n.SectionHeaderEntryType.Group:return"Section group";case n.SectionHeaderEntryType.ShNdx:return"Extended symbol table index";case n.SectionHeaderEntryType.Num:return"Num";case n.SectionHeaderEntryType.GnuAttributes:return"GNU object attributes";case n.SectionHeaderEntryType.GnuHash:return"GNU hash";case n.SectionHeaderEntryType.GnuLibList:return"GNU pre-link library list";case n.SectionHeaderEntryType.GnuVerDef:return"GNU version definition";case n.SectionHeaderEntryType.GnuVerNeed:return"GNU version needs";case n.SectionHeaderEntryType.GnuVerSym:return"GNU version symbol table";default:return n.SectionHeaderEntryType[e]||Number(e).toString()}},t.sectionFlagsToString=function(e){let t=[];return 1&(e=Number(e))&&t.push("Writeable"),2&e&&t.push("Alloc"),4&e&&t.push("Executable"),16&e&&t.push("Merge"),32&e&&t.push("Strings"),64&e&&t.push("Info Link"),128&e&&t.push("Link Order"),256&e&&t.push("Nonconforming"),512&e&&t.push("Group"),1024&e&&t.push("Thread Local Storage"),67108864&e&&t.push("Special ordering"),134217728&e&&t.push("Exclude"),0==t.length?"<none>":t.join(" | ")},t.programHeaderFlagsToString=function(e){let t=[];return 4&e&&t.push("Read"),2&e&&t.push("Write"),1&e&&t.push("Execute"),t.join(" | ")},t.elfFlagsToString=function(e,t){if(e===n.ISA.ARM){const e=(4278190080&t)>>24;let r=[`Version: ${e}`];return 8388608&t&&r.push("BE-8"),e<=4&&4194304&t&&r.push("Legacy"),e>=5&&1024&t&&r.push("Hard Float"),e>=5&&512&t&&r.push("Soft Float"),r.join(" | ")}return t.toString()},t.symbolTypeToString=function(e){switch(e){case n.SymbolType.RelocationExpression:return"Relocation Expression";case n.SymbolType.SignedRelocationExpression:return"Signed Relocation Expression";case n.SymbolType.ThreadLocalStorage:return"Thread Local Storage";default:return n.SymbolType[e]||e.toString()}},t.symbolBindingToString=function(e){return n.SymbolBinding[e]||e.toString()},t.symbolVisibilityToString=function(e){return n.SymbolVisibility[e]||e.toString()}},8744:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SymbolVisibility=t.SymbolBinding=t.SymbolType=t.SectionHeaderEntryType=t.ProgramHeaderEntryType=t.ObjectType=t.ABI=t.ISA=void 0,function(e){e[e.None=0]="None",e[e.M32=1]="M32",e[e.SPARC=2]="SPARC",e[e.x86=3]="x86",e[e.ISA68K=4]="ISA68K",e[e.ISA88K=5]="ISA88K",e[e.IAMCU=6]="IAMCU",e[e.ISA860=7]="ISA860",e[e.MIPS=8]="MIPS",e[e.S370=9]="S370",e[e.MIPS_RS3_LE=10]="MIPS_RS3_LE",e[e.PARISC=15]="PARISC",e[e.VPP500=17]="VPP500",e[e.SPARC32PLUS=18]="SPARC32PLUS",e[e.ISA960=19]="ISA960",e[e.PPC=20]="PPC",e[e.PPC64=21]="PPC64",e[e.S390=22]="S390",e[e.SPU=23]="SPU",e[e.V800=36]="V800",e[e.FR20=37]="FR20",e[e.RH32=38]="RH32",e[e.RCE=39]="RCE",e[e.ARM=40]="ARM",e[e.FAKE_ALPHA=41]="FAKE_ALPHA",e[e.SH=42]="SH",e[e.SPARCV9=43]="SPARCV9",e[e.TRICORE=44]="TRICORE",e[e.ARC=45]="ARC",e[e.H8_300=46]="H8_300",e[e.H8_300H=47]="H8_300H",e[e.H8S=48]="H8S",e[e.H8_500=49]="H8_500",e[e.IA_64=50]="IA_64",e[e.MIPS_X=51]="MIPS_X",e[e.COLDFIRE=52]="COLDFIRE",e[e.ISA68HC12=53]="ISA68HC12",e[e.MMA=54]="MMA",e[e.PCP=55]="PCP",e[e.NCPU=56]="NCPU",e[e.NDR1=57]="NDR1",e[e.STARCORE=58]="STARCORE",e[e.ME16=59]="ME16",e[e.ST100=60]="ST100",e[e.TINYJ=61]="TINYJ",e[e.X86_64=62]="X86_64",e[e.PDSP=63]="PDSP",e[e.PDP10=64]="PDP10",e[e.PDP11=65]="PDP11",e[e.FX66=66]="FX66",e[e.ST9PLUS=67]="ST9PLUS",e[e.ST7=68]="ST7",e[e.ISA68HC16=69]="ISA68HC16",e[e.ISA68HC11=70]="ISA68HC11",e[e.ISA68HC08=71]="ISA68HC08",e[e.ISA68HC05=72]="ISA68HC05",e[e.SVX=73]="SVX",e[e.ST19=74]="ST19",e[e.VAX=75]="VAX",e[e.CRIS=76]="CRIS",e[e.JAVELIN=77]="JAVELIN",e[e.FIREPATH=78]="FIREPATH",e[e.ZSP=79]="ZSP",e[e.MMIX=80]="MMIX",e[e.HUANY=81]="HUANY",e[e.PRISM=82]="PRISM",e[e.AVR=83]="AVR",e[e.FR30=84]="FR30",e[e.D10V=85]="D10V",e[e.D30V=86]="D30V",e[e.V850=87]="V850",e[e.M32R=88]="M32R",e[e.MN10300=89]="MN10300",e[e.MN10200=90]="MN10200",e[e.PJ=91]="PJ",e[e.OPENRISC=92]="OPENRISC",e[e.ARC_COMPACT=93]="ARC_COMPACT",e[e.XTENSA=94]="XTENSA",e[e.VIDEOCORE=95]="VIDEOCORE",e[e.TMM_GPP=96]="TMM_GPP",e[e.NS32K=97]="NS32K",e[e.TPC=98]="TPC",e[e.SNP1K=99]="SNP1K",e[e.ST200=100]="ST200",e[e.IP2K=101]="IP2K",e[e.MAX=102]="MAX",e[e.CR=103]="CR",e[e.F2MC16=104]="F2MC16",e[e.MSP430=105]="MSP430",e[e.BLACKFIN=106]="BLACKFIN",e[e.SE_C33=107]="SE_C33",e[e.SEP=108]="SEP",e[e.ARCA=109]="ARCA",e[e.UNICORE=110]="UNICORE",e[e.EXCESS=111]="EXCESS",e[e.DXP=112]="DXP",e[e.ALTERA_NIOS2=113]="ALTERA_NIOS2",e[e.CRX=114]="CRX",e[e.XGATE=115]="XGATE",e[e.C166=116]="C166",e[e.M16C=117]="M16C",e[e.DSPIC30F=118]="DSPIC30F",e[e.CE=119]="CE",e[e.M32C=120]="M32C",e[e.TSK3000=131]="TSK3000",e[e.RS08=132]="RS08",e[e.SHARC=133]="SHARC",e[e.ECOG2=134]="ECOG2",e[e.SCORE7=135]="SCORE7",e[e.DSP24=136]="DSP24",e[e.VIDEOCORE3=137]="VIDEOCORE3",e[e.LATTICEMICO32=138]="LATTICEMICO32",e[e.SE_C17=139]="SE_C17",e[e.TI_C6000=140]="TI_C6000",e[e.TI_C2000=141]="TI_C2000",e[e.TI_C5500=142]="TI_C5500",e[e.TI_ARP32=143]="TI_ARP32",e[e.TI_PRU=144]="TI_PRU",e[e.MMDSP_PLUS=160]="MMDSP_PLUS",e[e.CYPRESS_M8C=161]="CYPRESS_M8C",e[e.R32C=162]="R32C",e[e.TRIMEDIA=163]="TRIMEDIA",e[e.QDSP6=164]="QDSP6",e[e.ISA8051=165]="ISA8051",e[e.STXP7X=166]="STXP7X",e[e.NDS32=167]="NDS32",e[e.ECOG1X=168]="ECOG1X",e[e.MAXQ30=169]="MAXQ30",e[e.XIMO16=170]="XIMO16",e[e.MANIK=171]="MANIK",e[e.CRAYNV2=172]="CRAYNV2",e[e.RX=173]="RX",e[e.METAG=174]="METAG",e[e.MCST_ELBRUS=175]="MCST_ELBRUS",e[e.ECOG16=176]="ECOG16",e[e.CR16=177]="CR16",e[e.ETPU=178]="ETPU",e[e.SLE9X=179]="SLE9X",e[e.L10M=180]="L10M",e[e.K10M=181]="K10M",e[e.AARCH64=183]="AARCH64",e[e.AVR32=185]="AVR32",e[e.STM8=186]="STM8",e[e.TILE64=187]="TILE64",e[e.TILEPRO=188]="TILEPRO",e[e.MICROBLAZE=189]="MICROBLAZE",e[e.CUDA=190]="CUDA",e[e.TILEGX=191]="TILEGX",e[e.CLOUDSHIELD=192]="CLOUDSHIELD",e[e.COREA_1ST=193]="COREA_1ST",e[e.COREA_2ND=194]="COREA_2ND",e[e.ARC_COMPACT2=195]="ARC_COMPACT2",e[e.OPEN8=196]="OPEN8",e[e.RL78=197]="RL78",e[e.VIDEOCORE5=198]="VIDEOCORE5",e[e.ISA78KOR=199]="ISA78KOR",e[e.ISA56800EX=200]="ISA56800EX",e[e.BA1=201]="BA1",e[e.BA2=202]="BA2",e[e.XCORE=203]="XCORE",e[e.MCHP_PIC=204]="MCHP_PIC",e[e.KM32=210]="KM32",e[e.KMX32=211]="KMX32",e[e.EMX16=212]="EMX16",e[e.EMX8=213]="EMX8",e[e.KVARC=214]="KVARC",e[e.CDP=215]="CDP",e[e.COGE=216]="COGE",e[e.COOL=217]="COOL",e[e.NORC=218]="NORC",e[e.CSR_KALIMBA=219]="CSR_KALIMBA",e[e.Z80=220]="Z80",e[e.VISIUM=221]="VISIUM",e[e.FT32=222]="FT32",e[e.MOXIE=223]="MOXIE",e[e.AMDGPU=224]="AMDGPU",e[e.RISCV=243]="RISCV",e[e.BPF=247]="BPF",e[e.CSKY=252]="CSKY"}(t.ISA||(t.ISA={})),function(e){e[e.SystemV=0]="SystemV",e[e.HPUX=1]="HPUX",e[e.NetBSD=2]="NetBSD",e[e.Linux=3]="Linux",e[e.GNUHurd=4]="GNUHurd",e[e.Solaris=6]="Solaris",e[e.AIX=7]="AIX",e[e.IRIX=8]="IRIX",e[e.FreeBSD=9]="FreeBSD",e[e.Tru64=10]="Tru64",e[e.NovelloModesto=11]="NovelloModesto",e[e.OpenBSD=12]="OpenBSD",e[e.OpenVMS=13]="OpenVMS",e[e.NonStopKernel=14]="NonStopKernel",e[e.AROS=15]="AROS",e[e.FenixOS=16]="FenixOS",e[e.CloudABI=17]="CloudABI",e[e.ARMEABI=64]="ARMEABI",e[e.ARM=97]="ARM",e[e.Standalone=255]="Standalone"}(t.ABI||(t.ABI={})),function(e){e[e.None=0]="None",e[e.Relocatable=1]="Relocatable",e[e.Executable=2]="Executable",e[e.Shared=3]="Shared",e[e.Core=4]="Core"}(t.ObjectType||(t.ObjectType={})),function(e){e[e.Null=0]="Null",e[e.Load=1]="Load",e[e.Dynamic=2]="Dynamic",e[e.Interp=3]="Interp",e[e.Note=4]="Note",e[e.ShLib=5]="ShLib",e[e.ProgramHeaderTable=6]="ProgramHeaderTable",e[e.GnuEhFrame=1685382480]="GnuEhFrame",e[e.GnuStack=1685382481]="GnuStack",e[e.GnuRelRo=1685382482]="GnuRelRo"}(t.ProgramHeaderEntryType||(t.ProgramHeaderEntryType={})),function(e){e[e.Null=0]="Null",e[e.ProgBits=1]="ProgBits",e[e.SymTab=2]="SymTab",e[e.StrTab=3]="StrTab",e[e.Rela=4]="Rela",e[e.Hash=5]="Hash",e[e.Dynamic=6]="Dynamic",e[e.Note=7]="Note",e[e.NoBits=8]="NoBits",e[e.Rel=9]="Rel",e[e.ShLib=10]="ShLib",e[e.DynSym=11]="DynSym",e[e.InitArray=14]="InitArray",e[e.FiniArray=15]="FiniArray",e[e.PreInitArray=16]="PreInitArray",e[e.Group=17]="Group",e[e.ShNdx=18]="ShNdx",e[e.Num=19]="Num",e[e.GnuAttributes=1879048181]="GnuAttributes",e[e.GnuHash=1879048182]="GnuHash",e[e.GnuLibList=1879048183]="GnuLibList",e[e.GnuVerDef=1879048189]="GnuVerDef",e[e.GnuVerNeed=1879048190]="GnuVerNeed",e[e.GnuVerSym=1879048191]="GnuVerSym"}(t.SectionHeaderEntryType||(t.SectionHeaderEntryType={})),function(e){e[e.None=0]="None",e[e.Object=1]="Object",e[e.Function=2]="Function",e[e.Section=3]="Section",e[e.File=4]="File",e[e.Common=5]="Common",e[e.ThreadLocalStorage=6]="ThreadLocalStorage",e[e.RelocationExpression=7]="RelocationExpression",e[e.SignedRelocationExpression=8]="SignedRelocationExpression"}(t.SymbolType||(t.SymbolType={})),function(e){e[e.Local=0]="Local",e[e.Global=1]="Global",e[e.Weak=2]="Weak"}(t.SymbolBinding||(t.SymbolBinding={})),function(e){e[e.Default=0]="Default",e[e.Internal=1]="Internal",e[e.Hidden=2]="Hidden",e[e.Protected=3]="Protected"}(t.SymbolVisibility||(t.SymbolVisibility={}))},9397:(e,t)=>{!function(e){var t=/\S/,r=/\"/g,n=/\n/g,o=/\r/g,i=/\\/g,a=/\u2028/,s=/\u2029/;function u(e){"}"===e.n.substr(e.n.length-1)&&(e.n=e.n.substring(0,e.n.length-1))}function c(e){return e.trim?e.trim():e.replace(/^\s*|\s*$/g,"")}function l(e,t,r){if(t.charAt(r)!=e.charAt(0))return!1;for(var n=1,o=e.length;n<o;n++)if(t.charAt(r+n)!=e.charAt(n))return!1;return!0}e.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},e.scan=function(r,n){var o=r.length,i=0,a=null,s=null,f="",h=[],d=!1,p=0,m=0,g="{{",y="}}";function v(){f.length>0&&(h.push({tag:"_t",text:new String(f)}),f="")}function w(r,n){if(v(),r&&function(){for(var r=!0,n=m;n<h.length;n++)if(!(r=e.tags[h[n].tag]<e.tags._v||"_t"==h[n].tag&&null===h[n].text.match(t)))return!1;return r}())for(var o,i=m;i<h.length;i++)h[i].text&&((o=h[i+1])&&">"==o.tag&&(o.indent=h[i].text.toString()),h.splice(i,1));else n||h.push({tag:"\n"});d=!1,m=h.length}function b(e,t){var r="="+y,n=e.indexOf(r,t),o=c(e.substring(e.indexOf("=",t)+1,n)).split(" ");return g=o[0],y=o[o.length-1],n+r.length-1}for(n&&(n=n.split(" "),g=n[0],y=n[1]),p=0;p<o;p++)0==i?l(g,r,p)?(--p,v(),i=1):"\n"==r.charAt(p)?w(d):f+=r.charAt(p):1==i?(p+=g.length-1,"="==(a=(s=e.tags[r.charAt(p+1)])?r.charAt(p+1):"_v")?(p=b(r,p),i=0):(s&&p++,i=2),d=p):l(y,r,p)?(h.push({tag:a,n:c(f),otag:g,ctag:y,i:"/"==a?d-g.length:p+y.length}),f="",p+=y.length-1,i=0,"{"==a&&("}}"==y?p++:u(h[h.length-1]))):f+=r.charAt(p);return w(d,!0),h};var f={_t:!0,"\n":!0,$:!0,"/":!0};function h(t,r,n,o){var i,a=[],s=null,u=null;for(i=n[n.length-1];t.length>0;){if(u=t.shift(),i&&"<"==i.tag&&!(u.tag in f))throw new Error("Illegal content in < super tag.");if(e.tags[u.tag]<=e.tags.$||d(u,o))n.push(u),u.nodes=h(t,u.tag,n,o);else{if("/"==u.tag){if(0===n.length)throw new Error("Closing tag without opener: /"+u.n);if(s=n.pop(),u.n!=s.n&&!p(u.n,s.n,o))throw new Error("Nesting error: "+s.n+" vs. "+u.n);return s.end=u.i,a}"\n"==u.tag&&(u.last=0==t.length||"\n"==t[0].tag)}a.push(u)}if(n.length>0)throw new Error("missing closing tag: "+n.pop().n);return a}function d(e,t){for(var r=0,n=t.length;r<n;r++)if(t[r].o==e.n)return e.tag="#",!0}function p(e,t,r){for(var n=0,o=r.length;n<o;n++)if(r[n].c==e&&r[n].o==t)return!0}function m(e){var t=[];for(var r in e.partials)t.push('"'+y(r)+'":{name:"'+y(e.partials[r].name)+'", '+m(e.partials[r])+"}");return"partials: {"+t.join(",")+"}, subs: "+function(e){var t=[];for(var r in e)t.push('"'+y(r)+'": function(c,p,t,i) {'+e[r]+"}");return"{ "+t.join(",")+" }"}(e.subs)}e.stringify=function(t,r,n){return"{code: function (c,p,i) { "+e.wrapMain(t.code)+" },"+m(t)+"}"};var g=0;function y(e){return e.replace(i,"\\\\").replace(r,'\\"').replace(n,"\\n").replace(o,"\\r").replace(a,"\\u2028").replace(s,"\\u2029")}function v(e){return~e.indexOf(".")?"d":"f"}function w(e,t){var r="<"+(t.prefix||"")+e.n+g++;return t.partials[r]={name:e.n,partials:{}},t.code+='t.b(t.rp("'+y(r)+'",c,p,"'+(e.indent||"")+'"));',r}function b(e,t){t.code+="t.b(t.t(t."+v(e.n)+'("'+y(e.n)+'",c,p,0)));'}function E(e){return"t.b("+e+");"}e.generate=function(t,r,n){g=0;var o={code:"",subs:{},partials:{}};return e.walk(t,o),n.asString?this.stringify(o,r,n):this.makeTemplate(o,r,n)},e.wrapMain=function(e){return'var t=this;t.b(i=i||"");'+e+"return t.fl();"},e.template=e.Template,e.makeTemplate=function(e,t,r){var n=this.makePartials(e);return n.code=new Function("c","p","i",this.wrapMain(e.code)),new this.template(n,t,this,r)},e.makePartials=function(e){var t,r={subs:{},partials:e.partials,name:e.name};for(t in r.partials)r.partials[t]=this.makePartials(r.partials[t]);for(t in e.subs)r.subs[t]=new Function("c","p","t","i",e.subs[t]);return r},e.codegen={"#":function(t,r){r.code+="if(t.s(t."+v(t.n)+'("'+y(t.n)+'",c,p,1),c,p,0,'+t.i+","+t.end+',"'+t.otag+" "+t.ctag+'")){t.rs(c,p,function(c,p,t){',e.walk(t.nodes,r),r.code+="});c.pop();}"},"^":function(t,r){r.code+="if(!t.s(t."+v(t.n)+'("'+y(t.n)+'",c,p,1),c,p,1,0,0,"")){',e.walk(t.nodes,r),r.code+="};"},">":w,"<":function(t,r){var n={partials:{},code:"",subs:{},inPartial:!0};e.walk(t.nodes,n);var o=r.partials[w(t,r)];o.subs=n.subs,o.partials=n.partials},$:function(t,r){var n={subs:{},code:"",partials:r.partials,prefix:t.n};e.walk(t.nodes,n),r.subs[t.n]=n.code,r.inPartial||(r.code+='t.sub("'+y(t.n)+'",c,p,i);')},"\n":function(e,t){t.code+=E('"\\n"'+(e.last?"":" + i"))},_v:function(e,t){t.code+="t.b(t.v(t."+v(e.n)+'("'+y(e.n)+'",c,p,0)));'},_t:function(e,t){t.code+=E('"'+y(e.text)+'"')},"{":b,"&":b},e.walk=function(t,r){for(var n,o=0,i=t.length;o<i;o++)(n=e.codegen[t[o].tag])&&n(t[o],r);return r},e.parse=function(e,t,r){return h(e,0,[],(r=r||{}).sectionTags||[])},e.cache={},e.cacheKey=function(e,t){return[e,!!t.asString,!!t.disableLambda,t.delimiters,!!t.modelGet].join("||")},e.compile=function(t,r){r=r||{};var n=e.cacheKey(t,r),o=this.cache[n];if(o){var i=o.partials;for(var a in i)delete i[a].instance;return o}return o=this.generate(this.parse(this.scan(t,r.delimiters),t,r),t,r),this.cache[n]=o}}(t)},5485:(e,t,r)=>{var n=r(9397);n.Template=r(2882).Template,n.template=n.Template,e.exports=n},2882:(e,t)=>{!function(e){function t(e,t,r){var n;return t&&"object"==typeof t&&(void 0!==t[e]?n=t[e]:r&&t.get&&"function"==typeof t.get&&(n=t.get(e))),n}e.Template=function(e,t,r,n){e=e||{},this.r=e.code||this.r,this.c=r,this.options=n||{},this.text=t||"",this.partials=e.partials||{},this.subs=e.subs||{},this.buf=""},e.Template.prototype={r:function(e,t,r){return""},v:function(e){return e=u(e),s.test(e)?e.replace(r,"&").replace(n,"<").replace(o,">").replace(i,"'").replace(a,"""):e},t:u,render:function(e,t,r){return this.ri([e],t||{},r)},ri:function(e,t,r){return this.r(e,t,r)},ep:function(e,t){var r=this.partials[e],n=t[r.name];if(r.instance&&r.base==n)return r.instance;if("string"==typeof n){if(!this.c)throw new Error("No compiler available.");n=this.c.compile(n,this.options)}if(!n)return null;if(this.partials[e].base=n,r.subs){for(key in t.stackText||(t.stackText={}),r.subs)t.stackText[key]||(t.stackText[key]=void 0!==this.activeSub&&t.stackText[this.activeSub]?t.stackText[this.activeSub]:this.text);n=function(e,t,r,n,o,i){function a(){}function s(){}var u;a.prototype=e,s.prototype=e.subs;var c=new a;for(u in c.subs=new s,c.subsText={},c.buf="",n=n||{},c.stackSubs=n,c.subsText=i,t)n[u]||(n[u]=t[u]);for(u in n)c.subs[u]=n[u];for(u in o=o||{},c.stackPartials=o,r)o[u]||(o[u]=r[u]);for(u in o)c.partials[u]=o[u];return c}(n,r.subs,r.partials,this.stackSubs,this.stackPartials,t.stackText)}return this.partials[e].instance=n,n},rp:function(e,t,r,n){var o=this.ep(e,r);return o?o.ri(t,r,n):""},rs:function(e,t,r){var n=e[e.length-1];if(c(n))for(var o=0;o<n.length;o++)e.push(n[o]),r(e,t,this),e.pop();else r(e,t,this)},s:function(e,t,r,n,o,i,a){var s;return(!c(e)||0!==e.length)&&("function"==typeof e&&(e=this.ms(e,t,r,n,o,i,a)),s=!!e,!n&&s&&t&&t.push("object"==typeof e?e:t[t.length-1]),s)},d:function(e,r,n,o){var i,a=e.split("."),s=this.f(a[0],r,n,o),u=this.options.modelGet,l=null;if("."===e&&c(r[r.length-2]))s=r[r.length-1];else for(var f=1;f<a.length;f++)void 0!==(i=t(a[f],s,u))?(l=s,s=i):s="";return!(o&&!s)&&(o||"function"!=typeof s||(r.push(l),s=this.mv(s,r,n),r.pop()),s)},f:function(e,r,n,o){for(var i=!1,a=!1,s=this.options.modelGet,u=r.length-1;u>=0;u--)if(void 0!==(i=t(e,r[u],s))){a=!0;break}return a?(o||"function"!=typeof i||(i=this.mv(i,r,n)),i):!o&&""},ls:function(e,t,r,n,o){var i=this.options.delimiters;return this.options.delimiters=o,this.b(this.ct(u(e.call(t,n)),t,r)),this.options.delimiters=i,!1},ct:function(e,t,r){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(e,this.options).render(t,r)},b:function(e){this.buf+=e},fl:function(){var e=this.buf;return this.buf="",e},ms:function(e,t,r,n,o,i,a){var s,u=t[t.length-1],c=e.call(u);return"function"==typeof c?!!n||(s=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(c,u,r,s.substring(o,i),a)):c},mv:function(e,t,r){var n=t[t.length-1],o=e.call(n);return"function"==typeof o?this.ct(u(o.call(n)),n,r):o},sub:function(e,t,r,n){var o=this.subs[e];o&&(this.activeSub=e,o(t,r,this,n),this.activeSub=!1)}};var r=/&/g,n=/</g,o=/>/g,i=/\'/g,a=/\"/g,s=/[&<>\"\']/;function u(e){return String(null==e?"":e)}var c=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}}(t)},5405:(e,t,r)=>{var n=r(8887),o=r(6325),i=65536,a=15,s=h(5<<20),u=function(){try{return new Uint32Array(i)}catch(r){for(var e=new Array(i),t=0;t<i;t++)e[t]=0;return e}}(),c=407708164,l=2147483648,f={4:65536,5:262144,6:1048576,7:4194304};function h(e){try{return new Uint8Array(e)}catch(n){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t}}function d(e,t,r){if(void 0!==typeof e.buffer){if(Uint8Array.prototype.slice)return e.slice(t,r);var n=e.length;t=(t|=0)<0?Math.max(n+t,0):Math.min(t,n),r=(r=void 0===r?n:0|r)<0?Math.max(n+r,0):Math.min(r,n);for(var o=new Uint8Array(r-t),i=t,a=0;i<r;)o[a++]=e[i++];return o}return e.slice(t,r)}t.compressBound=function(e){return e+e/255+16|0},t.decompressBound=function(e){var t=0;if(o.readU32(e,t)!==c)throw new Error("invalid magic number");t+=4;var r=e[t++];if(64!=(192&r))throw new Error("incompatible descriptor version "+(192&r));var n=0!=(16&r),i=0!=(8&r),a=e[t++]>>4&7;if(void 0===f[a])throw new Error("invalid block size "+a);var s=f[a];if(i)return o.readU64(e,t);t++;for(var u=0;;){var h=o.readU32(e,t);if(t+=4,u+=h&l?h&=2147483647:s,0===h)return u;n&&(t+=4),t+=h}},t.makeBuffer=h,t.decompressBlock=function(e,t,r,n,o){var i,a,s,u,c;for(s=r+n;r<s;){var l=e[r++],f=l>>4;if(f>0){if(15===f)for(;f+=e[r],255===e[r++];);for(u=r+f;r<u;)t[o++]=e[r++]}if(r>=s)break;if(i=15&l,a=e[r++]|e[r++]<<8,15===i)for(;i+=e[r],255===e[r++];);for(u=(c=o-a)+(i+=4);c<u;)t[o++]=0|t[c++]}return o},t.compressBlock=function(e,t,r,n,i){var s,u,c,l,f,h,d,p;if(h=0,d=n+r,u=r,n>=13)for(var m=67;r+4<d-5;){var g=o.readU32(e,r),y=o.hashU32(g)>>>0;if(s=i[y=(y>>16^y)>>>0&65535]-1,i[y]=r+1,s<0||r-s>>>16>0||o.readU32(e,s)!==g)r+=m++>>6;else{for(m=67,f=r-u,l=r-s,s+=4,c=r+=4;r<d-5&&e[r]===e[s];)r++,s++;var v=(c=r-c)<15?c:15;if(f>=a){for(t[h++]=240+v,p=f-a;p>=255;p-=255)t[h++]=255;t[h++]=p}else t[h++]=(f<<4)+v;for(var w=0;w<f;w++)t[h++]=e[u+w];if(t[h++]=l,t[h++]=l>>8,c>=15){for(p=c-15;p>=255;p-=255)t[h++]=255;t[h++]=p}u=r}}if(0===u)return 0;if((f=d-u)>=a){for(t[h++]=240,p=f-a;p>=255;p-=255)t[h++]=255;t[h++]=p}else t[h++]=f<<4;for(r=u;r<d;)t[h++]=e[r++];return h},t.decompressFrame=function(e,r){var n,i,a,s,u=0,h=0;if(o.readU32(e,u)!==c)throw new Error("invalid magic number");if(u+=4,64!=(192&(s=e[u++])))throw new Error("incompatible descriptor version");n=0!=(16&s),i=0!=(4&s),a=0!=(8&s);var d=e[u++]>>4&7;if(void 0===f[d])throw new Error("invalid block size");for(a&&(u+=8),u++;;){var p;if(p=o.readU32(e,u),u+=4,0===p)break;if(n&&(u+=4),0!=(p&l)){p&=2147483647;for(var m=0;m<p;m++)r[h++]=e[u++]}else h=t.decompressBlock(e,r,u,p,h),u+=p}return i&&(u+=4),h},t.compressFrame=function(e,r){var a=0;o.writeU32(r,a,c),a+=4,r[a++]=64,r[a++]=112,r[a]=n.hash(0,r,4,a-4)>>8,a++;var l=f[7],h=e.length,d=0;for(!function(e){for(var t=0;t<i;t++)u[t]=0}();h>0;){var p,m=h>l?l:h;if((p=t.compressBlock(e,s,d,m,u))>m||0===p){o.writeU32(r,a,2147483648|m),a+=4;for(var g=d+m;d<g;)r[a++]=e[d++];h-=m}else{o.writeU32(r,a,p),a+=4;for(var y=0;y<p;)r[a++]=s[y++];d+=m,h-=m}}return o.writeU32(r,a,0),a+=4},t.decompress=function(e,r){var n,o;return void 0===r&&(r=t.decompressBound(e)),n=t.makeBuffer(r),(o=t.decompressFrame(e,n))!==r&&(n=d(n,0,o)),n},t.compress=function(e,r){var n,o;return void 0===r&&(r=t.compressBound(e.length)),n=t.makeBuffer(r),(o=t.compressFrame(e,n))!==r&&(n=d(n,0,o)),n}},6325:(e,t)=>{t.hashU32=function(e){return-1252372727^(e=(e=(e=(e=-949894596^(e=(e|=0)+2127912214+(e<<12)|0)^e>>>19)+374761393+(e<<5)|0)+-744332180^e<<9)+-42973499+(e<<3)|0)^e>>>16|0},t.readU64=function(e,t){var r=0;return r|=e[t++]<<0,r|=e[t++]<<8,r|=e[t++]<<16,r|=e[t++]<<24,r|=e[t++]<<32,r|=e[t++]<<40,r|=e[t++]<<48,r|=e[t++]<<56},t.readU32=function(e,t){var r=0;return r|=e[t++]<<0,r|=e[t++]<<8,r|=e[t++]<<16,r|=e[t++]<<24},t.writeU32=function(e,t,r){e[t++]=r>>0&255,e[t++]=r>>8&255,e[t++]=r>>16&255,e[t++]=r>>24&255},t.imul=function(e,t){var r=65535&e,n=65535&t;return r*n+((e>>>16)*n+r*(t>>>16)<<16)|0}},8887:(e,t,r)=>{var n=r(6325),o=2654435761,i=2246822519,a=3266489917,s=374761393;function u(e,t){return(e|=0)>>>(32-(t|=0)|0)|e<<t|0}function c(e,t,r){return e|=0,t|=0,r|=0,0|n.imul(e>>>(32-t|0)|e<<t,r)}function l(e,t){return(e|=0)>>>(t|=0)^e|0}function f(e,t,r,o,i){return c(n.imul(t,r)+e,o,i)}function h(e,t,r){return c(e+n.imul(t[r],s),11,o)}function d(e,t,r){return f(e,n.readU32(t,r),a,17,668265263)}function p(e,t,r){return[f(e[0],n.readU32(t,r+0),i,13,o),f(e[1],n.readU32(t,r+4),i,13,o),f(e[2],n.readU32(t,r+8),i,13,o),f(e[3],n.readU32(t,r+12),i,13,o)]}t.hash=function(e,t,r,c){var f,m;if(m=c,c>=16){for(f=[e+o+i,e+i,e,e-o];c>=16;)f=p(f,t,r),r+=16,c-=16;f=u(f[0],1)+u(f[1],7)+u(f[2],12)+u(f[3],18)+m}else f=e+s+c>>>0;for(;c>=4;)f=d(f,t,r),r+=4,c-=4;for(;c>0;)f=h(f,t,r),r++,c--;return(f=l(n.imul(l(n.imul(l(f,15),i),13),a),16))>>>0}},118:(e,t,r)=>{var n=r(5485);e.exports=function(){var e=new n.Template({code:function(e,t,r){var n=this;return n.b(r=r||""),n.b("MEMORY {"),n.b("\n"+r),n.b(" FLASH (rx) : ORIGIN = "),n.b(n.v(n.f("flashStart",e,t,0))),n.b(", LENGTH = "),n.b(n.v(n.f("flashLength",e,t,0))),n.b("\n"+r),n.b(" RAM (rwx) : ORIGIN = "),n.b(n.v(n.f("ramStart",e,t,0))),n.b(", LENGTH = "),n.b(n.v(n.f("ramLength",e,t,0))),n.b("\n"+r),n.b("}"),n.b("\n"),n.b("\n"+r),n.b("ENTRY(_eadk_start)"),n.b("\n"+r),n.b("PROVIDE(eadk_external_data = _binary_input_dat_start);"),n.b("\n"),n.b("\n"+r),n.b("SECTIONS {"),n.b("\n"+r),n.b(" .eadk_app_info ORIGIN(FLASH) : {"),n.b("\n"+r),n.b(" LONG(0xDEC0BEBA);"),n.b("\n"+r),n.b(" *(.rodata.eadk_app_api_level)"),n.b("\n"+r),n.b(" LONG(eadk_app_name - ORIGIN(FLASH)); /* This symbol must be defined and point to a NULL-terminated UTF-8 string */"),n.b("\n"+r),n.b(" LONG(SIZEOF(.rodata.eadk_app_icon));"),n.b("\n"+r),n.b(" LONG(ADDR(.rodata.eadk_app_icon) - ORIGIN(FLASH));"),n.b("\n"+r),n.b(" LONG(_eadk_start - ORIGIN(FLASH));"),n.b("\n"+r),n.b(" LONG(_eadk_app_end - ORIGIN(FLASH));"),n.b("\n"+r),n.b(" LONG(0xDEC0BEBA);"),n.b("\n"+r),n.b(" } >FLASH"),n.b("\n"),n.b("\n"+r),n.b(" .text : {"),n.b("\n"+r),n.b(" KEEP(*(.text._eadk_start))"),n.b("\n"+r),n.b(" *(.text)"),n.b("\n"+r),n.b(" } >FLASH"),n.b("\n"),n.b("\n"+r),n.b(" .rodata : {"),n.b("\n"+r),n.b(" . = ALIGN(4);"),n.b("\n"+r),n.b(" *(.rodata)"),n.b("\n"+r),n.b(" _eadk_app_end = .;"),n.b("\n"+r),n.b(" } >FLASH"),n.b("\n"),n.b("\n"+r),n.b(" .data : {"),n.b("\n"+r),n.b(" . = ALIGN(4);"),n.b("\n"+r),n.b(" _data_section_start_flash = LOADADDR(.data);"),n.b("\n"+r),n.b(" _data_section_start_ram = .;"),n.b("\n"+r),n.b(" *(.data)"),n.b("\n"+r),n.b(" _data_section_end_ram = .;"),n.b("\n"+r),n.b(" } >RAM AT >FLASH"),n.b("\n"),n.b("\n"+r),n.b(" .bss : {"),n.b("\n"+r),n.b(" . = ALIGN(4);"),n.b("\n"+r),n.b(" _bss_section_start_ram = .;"),n.b("\n"+r),n.b(" *(.bss)"),n.b("\n"+r),n.b(" _bss_section_end_ram = .;"),n.b("\n"+r),n.b(" } >RAM"),n.b("\n"),n.b("\n"+r),n.b(" .heap : {"),n.b("\n"+r),n.b(" _heap_start = .;"),n.b("\n"+r),n.b(" . = (ORIGIN(RAM) + LENGTH(RAM));"),n.b("\n"+r),n.b(" _heap_end = .;"),n.b("\n"+r),n.b(" } >RAM"),n.b("\n"+r),n.b("}"),n.b("\n"),n.fl()},partials:{},subs:{}},"MEMORY {\n FLASH (rx) : ORIGIN = {{ flashStart }}, LENGTH = {{ flashLength }}\n RAM (rwx) : ORIGIN = {{ ramStart }}, LENGTH = {{ ramLength }}\n}\n\nENTRY(_eadk_start)\nPROVIDE(eadk_external_data = _binary_input_dat_start);\n\nSECTIONS {\n .eadk_app_info ORIGIN(FLASH) : {\n LONG(0xDEC0BEBA);\n *(.rodata.eadk_app_api_level)\n LONG(eadk_app_name - ORIGIN(FLASH)); /* This symbol must be defined and point to a NULL-terminated UTF-8 string */\n LONG(SIZEOF(.rodata.eadk_app_icon));\n LONG(ADDR(.rodata.eadk_app_icon) - ORIGIN(FLASH));\n LONG(_eadk_start - ORIGIN(FLASH));\n LONG(_eadk_app_end - ORIGIN(FLASH));\n LONG(0xDEC0BEBA);\n } >FLASH\n\n .text : {\n KEEP(*(.text._eadk_start))\n *(.text)\n } >FLASH\n\n .rodata : {\n . = ALIGN(4);\n *(.rodata)\n _eadk_app_end = .;\n } >FLASH\n\n .data : {\n . = ALIGN(4);\n _data_section_start_flash = LOADADDR(.data);\n _data_section_start_ram = .;\n *(.data)\n _data_section_end_ram = .;\n } >RAM AT >FLASH\n\n .bss : {\n . = ALIGN(4);\n _bss_section_start_ram = .;\n *(.bss)\n _bss_section_end_ram = .;\n } >RAM\n\n .heap : {\n _heap_start = .;\n . = (ORIGIN(RAM) + LENGTH(RAM));\n _heap_end = .;\n } >RAM\n}\n",n);return e.render.apply(e,arguments)}},9983:(e,t,r)=>{"use strict";let n=r(7084),o=[function(){},function(e,t,r,n){if(n===t.length)throw new Error("Ran out of data");let o=t[n];e[r]=o,e[r+1]=o,e[r+2]=o,e[r+3]=255},function(e,t,r,n){if(n+1>=t.length)throw new Error("Ran out of data");let o=t[n];e[r]=o,e[r+1]=o,e[r+2]=o,e[r+3]=t[n+1]},function(e,t,r,n){if(n+2>=t.length)throw new Error("Ran out of data");e[r]=t[n],e[r+1]=t[n+1],e[r+2]=t[n+2],e[r+3]=255},function(e,t,r,n){if(n+3>=t.length)throw new Error("Ran out of data");e[r]=t[n],e[r+1]=t[n+1],e[r+2]=t[n+2],e[r+3]=t[n+3]}],i=[function(){},function(e,t,r,n){let o=t[0];e[r]=o,e[r+1]=o,e[r+2]=o,e[r+3]=n},function(e,t,r){let n=t[0];e[r]=n,e[r+1]=n,e[r+2]=n,e[r+3]=t[1]},function(e,t,r,n){e[r]=t[0],e[r+1]=t[1],e[r+2]=t[2],e[r+3]=n},function(e,t,r){e[r]=t[0],e[r+1]=t[1],e[r+2]=t[2],e[r+3]=t[3]}];function a(e,t,r,n,i,a){let s=e.width,u=e.height,c=e.index;for(let e=0;e<u;e++)for(let u=0;u<s;u++){let s=r(u,e,c);o[n](t,i,s,a),a+=n}return a}function s(e,t,r,n,o,a){let s=e.width,u=e.height,c=e.index;for(let e=0;e<u;e++){for(let u=0;u<s;u++){let s=o.get(n),l=r(u,e,c);i[n](t,s,l,a)}o.resetAfterLine()}}t.dataToBitMap=function(e,t){let r,o,i=t.width,u=t.height,c=t.depth,l=t.bpp,f=t.interlace;8!==c&&(r=function(e,t){let r=[],n=0;function o(){if(n===e.length)throw new Error("Ran out of data");let o,i,a,s,u,c,l,f,h=e[n];switch(n++,t){default:throw new Error("unrecognised depth");case 16:l=e[n],n++,r.push((h<<8)+l);break;case 4:l=15&h,f=h>>4,r.push(f,l);break;case 2:u=3&h,c=h>>2&3,l=h>>4&3,f=h>>6&3,r.push(f,l,c,u);break;case 1:o=1&h,i=h>>1&1,a=h>>2&1,s=h>>3&1,u=h>>4&1,c=h>>5&1,l=h>>6&1,f=h>>7&1,r.push(f,l,c,u,s,a,i,o)}}return{get:function(e){for(;r.length<e;)o();let t=r.slice(0,e);return r=r.slice(e),t},resetAfterLine:function(){r.length=0},end:function(){if(n!==e.length)throw new Error("extra data found")}}}(e,c)),o=c<=8?Buffer.alloc(i*u*4):new Uint16Array(i*u*4);let h,d,p=Math.pow(2,c)-1,m=0;if(f)h=n.getImagePasses(i,u),d=n.getInterlaceIterator(i,u);else{let e=0;d=function(){let t=e;return e+=4,t},h=[{width:i,height:u}]}for(let t=0;t<h.length;t++)8===c?m=a(h[t],o,d,l,e,m):s(h[t],o,d,l,r,p);if(8===c){if(m!==e.length)throw new Error("extra data found")}else r.end();return o}},9027:(e,t,r)=>{"use strict";let n=r(3482);e.exports=function(e,t,r,o){let i=-1!==[n.COLORTYPE_COLOR_ALPHA,n.COLORTYPE_ALPHA].indexOf(o.colorType);if(o.colorType===o.inputColorType){let t=function(){let e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256!==new Int16Array(e)[0]}();if(8===o.bitDepth||16===o.bitDepth&&t)return e}let a=16!==o.bitDepth?e:new Uint16Array(e.buffer),s=255,u=n.COLORTYPE_TO_BPP_MAP[o.inputColorType];4!==u||o.inputHasAlpha||(u=3);let c=n.COLORTYPE_TO_BPP_MAP[o.colorType];16===o.bitDepth&&(s=65535,c*=2);let l=Buffer.alloc(t*r*c),f=0,h=0,d=o.bgColor||{};function p(){let e,t,r,u=s;switch(o.inputColorType){case n.COLORTYPE_COLOR_ALPHA:u=a[f+3],e=a[f],t=a[f+1],r=a[f+2];break;case n.COLORTYPE_COLOR:e=a[f],t=a[f+1],r=a[f+2];break;case n.COLORTYPE_ALPHA:u=a[f+1],e=a[f],t=e,r=e;break;case n.COLORTYPE_GRAYSCALE:e=a[f],t=e,r=e;break;default:throw new Error("input color type:"+o.inputColorType+" is not supported at present")}return o.inputHasAlpha&&(i||(u/=s,e=Math.min(Math.max(Math.round((1-u)*d.red+u*e),0),s),t=Math.min(Math.max(Math.round((1-u)*d.green+u*t),0),s),r=Math.min(Math.max(Math.round((1-u)*d.blue+u*r),0),s))),{red:e,green:t,blue:r,alpha:u}}void 0===d.red&&(d.red=s),void 0===d.green&&(d.green=s),void 0===d.blue&&(d.blue=s);for(let e=0;e<r;e++)for(let e=0;e<t;e++){let e=p();switch(o.colorType){case n.COLORTYPE_COLOR_ALPHA:case n.COLORTYPE_COLOR:8===o.bitDepth?(l[h]=e.red,l[h+1]=e.green,l[h+2]=e.blue,i&&(l[h+3]=e.alpha)):(l.writeUInt16BE(e.red,h),l.writeUInt16BE(e.green,h+2),l.writeUInt16BE(e.blue,h+4),i&&l.writeUInt16BE(e.alpha,h+6));break;case n.COLORTYPE_ALPHA:case n.COLORTYPE_GRAYSCALE:{let t=(e.red+e.green+e.blue)/3;8===o.bitDepth?(l[h]=t,i&&(l[h+1]=e.alpha)):(l.writeUInt16BE(t,h),i&&l.writeUInt16BE(e.alpha,h+2));break}default:throw new Error("unrecognised color Type "+o.colorType)}f+=u,h+=c}return l}},8442:(e,t,r)=>{"use strict";let n=r(3837),o=r(2781),i=e.exports=function(){o.call(this),this._buffers=[],this._buffered=0,this._reads=[],this._paused=!1,this._encoding="utf8",this.writable=!0};n.inherits(i,o),i.prototype.read=function(e,t){this._reads.push({length:Math.abs(e),allowLess:e<0,func:t}),process.nextTick(function(){this._process(),this._paused&&this._reads&&this._reads.length>0&&(this._paused=!1,this.emit("drain"))}.bind(this))},i.prototype.write=function(e,t){if(!this.writable)return this.emit("error",new Error("Stream not writable")),!1;let r;return r=Buffer.isBuffer(e)?e:Buffer.from(e,t||this._encoding),this._buffers.push(r),this._buffered+=r.length,this._process(),this._reads&&0===this._reads.length&&(this._paused=!0),this.writable&&!this._paused},i.prototype.end=function(e,t){e&&this.write(e,t),this.writable=!1,this._buffers&&(0===this._buffers.length?this._end():(this._buffers.push(null),this._process()))},i.prototype.destroySoon=i.prototype.end,i.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("Unexpected end of input")),this.destroy()},i.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))},i.prototype._processReadAllowingLess=function(e){this._reads.shift();let t=this._buffers[0];t.length>e.length?(this._buffered-=e.length,this._buffers[0]=t.slice(e.length),e.func.call(this,t.slice(0,e.length))):(this._buffered-=t.length,this._buffers.shift(),e.func.call(this,t))},i.prototype._processRead=function(e){this._reads.shift();let t=0,r=0,n=Buffer.alloc(e.length);for(;t<e.length;){let o=this._buffers[r++],i=Math.min(o.length,e.length-t);o.copy(n,t,0,i),t+=i,i!==o.length&&(this._buffers[--r]=o.slice(i))}r>0&&this._buffers.splice(0,r),this._buffered-=e.length,e.func.call(this,n)},i.prototype._process=function(){try{for(;this._buffered>0&&this._reads&&this._reads.length>0;){let e=this._reads[0];if(e.allowLess)this._processReadAllowingLess(e);else{if(!(this._buffered>=e.length))break;this._processRead(e)}}this._buffers&&!this.writable&&this._end()}catch(e){this.emit("error",e)}}},3482:e=>{"use strict";e.exports={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5}},3500:e=>{"use strict";let t=[];!function(){for(let e=0;e<256;e++){let r=e;for(let e=0;e<8;e++)1&r?r=3988292384^r>>>1:r>>>=1;t[e]=r}}();let r=e.exports=function(){this._crc=-1};r.prototype.write=function(e){for(let r=0;r<e.length;r++)this._crc=t[255&(this._crc^e[r])]^this._crc>>>8;return!0},r.prototype.crc32=function(){return-1^this._crc},r.crc32=function(e){let r=-1;for(let n=0;n<e.length;n++)r=t[255&(r^e[n])]^r>>>8;return-1^r}},8876:(e,t,r)=>{"use strict";let n=r(6744);let o={0:function(e,t,r,n,o){for(let i=0;i<r;i++)n[o+i]=e[t+i]},1:function(e,t,r,n,o,i){for(let a=0;a<r;a++){let r=a>=i?e[t+a-i]:0,s=e[t+a]-r;n[o+a]=s}},2:function(e,t,r,n,o){for(let i=0;i<r;i++){let a=t>0?e[t+i-r]:0,s=e[t+i]-a;n[o+i]=s}},3:function(e,t,r,n,o,i){for(let a=0;a<r;a++){let s=a>=i?e[t+a-i]:0,u=t>0?e[t+a-r]:0,c=e[t+a]-(s+u>>1);n[o+a]=c}},4:function(e,t,r,o,i,a){for(let s=0;s<r;s++){let u=s>=a?e[t+s-a]:0,c=t>0?e[t+s-r]:0,l=t>0&&s>=a?e[t+s-(r+a)]:0,f=e[t+s]-n(u,c,l);o[i+s]=f}}},i={0:function(e,t,r){let n=0,o=t+r;for(let r=t;r<o;r++)n+=Math.abs(e[r]);return n},1:function(e,t,r,n){let o=0;for(let i=0;i<r;i++){let r=i>=n?e[t+i-n]:0,a=e[t+i]-r;o+=Math.abs(a)}return o},2:function(e,t,r){let n=0,o=t+r;for(let i=t;i<o;i++){let o=t>0?e[i-r]:0,a=e[i]-o;n+=Math.abs(a)}return n},3:function(e,t,r,n){let o=0;for(let i=0;i<r;i++){let a=i>=n?e[t+i-n]:0,s=t>0?e[t+i-r]:0,u=e[t+i]-(a+s>>1);o+=Math.abs(u)}return o},4:function(e,t,r,o){let i=0;for(let a=0;a<r;a++){let s=a>=o?e[t+a-o]:0,u=t>0?e[t+a-r]:0,c=t>0&&a>=o?e[t+a-(r+o)]:0,l=e[t+a]-n(s,u,c);i+=Math.abs(l)}return i}};e.exports=function(e,t,r,n,a){let s;if("filterType"in n&&-1!==n.filterType){if("number"!=typeof n.filterType)throw new Error("unrecognised filter types");s=[n.filterType]}else s=[0,1,2,3,4];16===n.bitDepth&&(a*=2);let u=t*a,c=0,l=0,f=Buffer.alloc((u+1)*r),h=s[0];for(let t=0;t<r;t++){if(s.length>1){let t=1/0;for(let r=0;r<s.length;r++){let n=i[s[r]](e,l,u,a);n<t&&(h=s[r],t=n)}}f[c]=h,c++,o[h](e,l,u,f,c,a),c+=u,l+=u}return f}},4603:(e,t,r)=>{"use strict";let n=r(3837),o=r(8442),i=r(2769),a=e.exports=function(e){o.call(this);let t=[],r=this;this._filter=new i(e,{read:this.read.bind(this),write:function(e){t.push(e)},complete:function(){r.emit("complete",Buffer.concat(t))}}),this._filter.start()};n.inherits(a,o)},8692:(e,t,r)=>{"use strict";let n=r(33),o=r(2769);t.process=function(e,t){let r=[],i=new n(e);return new o(t,{read:i.read.bind(i),write:function(e){r.push(e)},complete:function(){}}).start(),i.process(),Buffer.concat(r)}},2769:(e,t,r)=>{"use strict";let n=r(7084),o=r(6744);function i(e,t,r){let n=e*t;return 8!==r&&(n=Math.ceil(n/(8/r))),n}let a=e.exports=function(e,t){let r=e.width,o=e.height,a=e.interlace,s=e.bpp,u=e.depth;if(this.read=t.read,this.write=t.write,this.complete=t.complete,this._imageIndex=0,this._images=[],a){let e=n.getImagePasses(r,o);for(let t=0;t<e.length;t++)this._images.push({byteWidth:i(e[t].width,s,u),height:e[t].height,lineIndex:0})}else this._images.push({byteWidth:i(r,s,u),height:o,lineIndex:0});this._xComparison=8===u?s:16===u?2*s:1};a.prototype.start=function(){this.read(this._images[this._imageIndex].byteWidth+1,this._reverseFilterLine.bind(this))},a.prototype._unFilterType1=function(e,t,r){let n=this._xComparison,o=n-1;for(let i=0;i<r;i++){let r=e[1+i],a=i>o?t[i-n]:0;t[i]=r+a}},a.prototype._unFilterType2=function(e,t,r){let n=this._lastLine;for(let o=0;o<r;o++){let r=e[1+o],i=n?n[o]:0;t[o]=r+i}},a.prototype._unFilterType3=function(e,t,r){let n=this._xComparison,o=n-1,i=this._lastLine;for(let a=0;a<r;a++){let r=e[1+a],s=i?i[a]:0,u=a>o?t[a-n]:0,c=Math.floor((u+s)/2);t[a]=r+c}},a.prototype._unFilterType4=function(e,t,r){let n=this._xComparison,i=n-1,a=this._lastLine;for(let s=0;s<r;s++){let r=e[1+s],u=a?a[s]:0,c=s>i?t[s-n]:0,l=s>i&&a?a[s-n]:0,f=o(c,u,l);t[s]=r+f}},a.prototype._reverseFilterLine=function(e){let t,r=e[0],n=this._images[this._imageIndex],o=n.byteWidth;if(0===r)t=e.slice(1,o+1);else switch(t=Buffer.alloc(o),r){case 1:this._unFilterType1(e,t,o);break;case 2:this._unFilterType2(e,t,o);break;case 3:this._unFilterType3(e,t,o);break;case 4:this._unFilterType4(e,t,o);break;default:throw new Error("Unrecognised filter type - "+r)}this.write(t),n.lineIndex++,n.lineIndex>=n.height?(this._lastLine=null,this._imageIndex++,n=this._images[this._imageIndex]):this._lastLine=t,n?this.read(n.byteWidth+1,this._reverseFilterLine.bind(this)):(this._lastLine=null,this.complete())}},8417:e=>{"use strict";e.exports=function(e,t,r=!1){let n=t.depth,o=t.width,i=t.height,a=t.colorType,s=t.transColor,u=t.palette,c=e;return 3===a?function(e,t,r,n,o){let i=0;for(let a=0;a<n;a++)for(let n=0;n<r;n++){let r=o[e[i]];if(!r)throw new Error("index "+e[i]+" not in palette");for(let e=0;e<4;e++)t[i+e]=r[e];i+=4}}(e,c,o,i,u):(s&&function(e,t,r,n,o){let i=0;for(let a=0;a<n;a++)for(let n=0;n<r;n++){let r=!1;if(1===o.length?o[0]===e[i]&&(r=!0):o[0]===e[i]&&o[1]===e[i+1]&&o[2]===e[i+2]&&(r=!0),r)for(let e=0;e<4;e++)t[i+e]=0;i+=4}}(e,c,o,i,s),8===n||r||(16===n&&(c=Buffer.alloc(o*i*4)),function(e,t,r,n,o){let i=Math.pow(2,o)-1,a=0;for(let o=0;o<n;o++)for(let n=0;n<r;n++){for(let r=0;r<4;r++)t[a+r]=Math.floor(255*e[a+r]/i+.5);a+=4}}(e,c,o,i,n))),c}},7084:(e,t)=>{"use strict";let r=[{x:[0],y:[0]},{x:[4],y:[0]},{x:[0,4],y:[4]},{x:[2,6],y:[0,4]},{x:[0,2,4,6],y:[2,6]},{x:[1,3,5,7],y:[0,2,4,6]},{x:[0,1,2,3,4,5,6,7],y:[1,3,5,7]}];t.getImagePasses=function(e,t){let n=[],o=e%8,i=t%8,a=(e-o)/8,s=(t-i)/8;for(let e=0;e<r.length;e++){let t=r[e],u=a*t.x.length,c=s*t.y.length;for(let e=0;e<t.x.length&&t.x[e]<o;e++)u++;for(let e=0;e<t.y.length&&t.y[e]<i;e++)c++;u>0&&c>0&&n.push({width:u,height:c,index:e})}return n},t.getInterlaceIterator=function(e){return function(t,n,o){let i=t%r[o].x.length,a=(t-i)/r[o].x.length*8+r[o].x[i],s=n%r[o].y.length;return 4*a+((n-s)/r[o].y.length*8+r[o].y[s])*e*4}}},6838:(e,t,r)=>{"use strict";let n=r(3837),o=r(2781),i=r(3482),a=r(9432),s=e.exports=function(e){o.call(this);let t=e||{};this._packer=new a(t),this._deflate=this._packer.createDeflate(),this.readable=!0};n.inherits(s,o),s.prototype.pack=function(e,t,r,n){this.emit("data",Buffer.from(i.PNG_SIGNATURE)),this.emit("data",this._packer.packIHDR(t,r)),n&&this.emit("data",this._packer.packGAMA(n));let o=this._packer.filterData(e,t,r);this._deflate.on("error",this.emit.bind(this,"error")),this._deflate.on("data",function(e){this.emit("data",this._packer.packIDAT(e))}.bind(this)),this._deflate.on("end",function(){this.emit("data",this._packer.packIEND()),this.emit("end")}.bind(this)),this._deflate.end(o)}},8360:(e,t,r)=>{"use strict";let n=!0,o=r(9796);o.deflateSync||(n=!1);let i=r(3482),a=r(9432);e.exports=function(e,t){if(!n)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let r=new a(t||{}),s=[];s.push(Buffer.from(i.PNG_SIGNATURE)),s.push(r.packIHDR(e.width,e.height)),e.gamma&&s.push(r.packGAMA(e.gamma));let u=r.filterData(e.data,e.width,e.height),c=o.deflateSync(u,r.getDeflateOptions());if(u=null,!c||!c.length)throw new Error("bad png - invalid compressed data response");return s.push(r.packIDAT(c)),s.push(r.packIEND()),Buffer.concat(s)}},9432:(e,t,r)=>{"use strict";let n=r(3482),o=r(3500),i=r(9027),a=r(8876),s=r(9796),u=e.exports=function(e){if(this._options=e,e.deflateChunkSize=e.deflateChunkSize||32768,e.deflateLevel=null!=e.deflateLevel?e.deflateLevel:9,e.deflateStrategy=null!=e.deflateStrategy?e.deflateStrategy:3,e.inputHasAlpha=null==e.inputHasAlpha||e.inputHasAlpha,e.deflateFactory=e.deflateFactory||s.createDeflate,e.bitDepth=e.bitDepth||8,e.colorType="number"==typeof e.colorType?e.colorType:n.COLORTYPE_COLOR_ALPHA,e.inputColorType="number"==typeof e.inputColorType?e.inputColorType:n.COLORTYPE_COLOR_ALPHA,-1===[n.COLORTYPE_GRAYSCALE,n.COLORTYPE_COLOR,n.COLORTYPE_COLOR_ALPHA,n.COLORTYPE_ALPHA].indexOf(e.colorType))throw new Error("option color type:"+e.colorType+" is not supported at present");if(-1===[n.COLORTYPE_GRAYSCALE,n.COLORTYPE_COLOR,n.COLORTYPE_COLOR_ALPHA,n.COLORTYPE_ALPHA].indexOf(e.inputColorType))throw new Error("option input color type:"+e.inputColorType+" is not supported at present");if(8!==e.bitDepth&&16!==e.bitDepth)throw new Error("option bit depth:"+e.bitDepth+" is not supported at present")};u.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}},u.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())},u.prototype.filterData=function(e,t,r){let o=i(e,t,r,this._options),s=n.COLORTYPE_TO_BPP_MAP[this._options.colorType];return a(o,t,r,this._options,s)},u.prototype._packChunk=function(e,t){let r=t?t.length:0,n=Buffer.alloc(r+12);return n.writeUInt32BE(r,0),n.writeUInt32BE(e,4),t&&t.copy(n,8),n.writeInt32BE(o.crc32(n.slice(4,n.length-4)),n.length-4),n},u.prototype.packGAMA=function(e){let t=Buffer.alloc(4);return t.writeUInt32BE(Math.floor(e*n.GAMMA_DIVISION),0),this._packChunk(n.TYPE_gAMA,t)},u.prototype.packIHDR=function(e,t){let r=Buffer.alloc(13);return r.writeUInt32BE(e,0),r.writeUInt32BE(t,4),r[8]=this._options.bitDepth,r[9]=this._options.colorType,r[10]=0,r[11]=0,r[12]=0,this._packChunk(n.TYPE_IHDR,r)},u.prototype.packIDAT=function(e){return this._packChunk(n.TYPE_IDAT,e)},u.prototype.packIEND=function(){return this._packChunk(n.TYPE_IEND,null)}},6744:e=>{"use strict";e.exports=function(e,t,r){let n=e+t-r,o=Math.abs(n-e),i=Math.abs(n-t),a=Math.abs(n-r);return o<=i&&o<=a?e:i<=a?t:r}},7900:(e,t,r)=>{"use strict";let n=r(3837),o=r(9796),i=r(8442),a=r(4603),s=r(8550),u=r(9983),c=r(8417),l=e.exports=function(e){i.call(this),this._parser=new s(e,{read:this.read.bind(this),error:this._handleError.bind(this),metadata:this._handleMetaData.bind(this),gamma:this.emit.bind(this,"gamma"),palette:this._handlePalette.bind(this),transColor:this._handleTransColor.bind(this),finished:this._finished.bind(this),inflateData:this._inflateData.bind(this),simpleTransparency:this._simpleTransparency.bind(this),headersFinished:this._headersFinished.bind(this)}),this._options=e,this.writable=!0,this._parser.start()};n.inherits(l,i),l.prototype._handleError=function(e){this.emit("error",e),this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy&&this._inflate.destroy(),this._filter&&(this._filter.destroy(),this._filter.on("error",(function(){}))),this.errord=!0},l.prototype._inflateData=function(e){if(!this._inflate)if(this._bitmapInfo.interlace)this._inflate=o.createInflate(),this._inflate.on("error",this.emit.bind(this,"error")),this._filter.on("complete",this._complete.bind(this)),this._inflate.pipe(this._filter);else{let e=(1+(this._bitmapInfo.width*this._bitmapInfo.bpp*this._bitmapInfo.depth+7>>3))*this._bitmapInfo.height,t=Math.max(e,o.Z_MIN_CHUNK);this._inflate=o.createInflate({chunkSize:t});let r=e,n=this.emit.bind(this,"error");this._inflate.on("error",(function(e){r&&n(e)})),this._filter.on("complete",this._complete.bind(this));let i=this._filter.write.bind(this._filter);this._inflate.on("data",(function(e){r&&(e.length>r&&(e=e.slice(0,r)),r-=e.length,i(e))})),this._inflate.on("end",this._filter.end.bind(this._filter))}this._inflate.write(e)},l.prototype._handleMetaData=function(e){this._metaData=e,this._bitmapInfo=Object.create(e),this._filter=new a(this._bitmapInfo)},l.prototype._handleTransColor=function(e){this._bitmapInfo.transColor=e},l.prototype._handlePalette=function(e){this._bitmapInfo.palette=e},l.prototype._simpleTransparency=function(){this._metaData.alpha=!0},l.prototype._headersFinished=function(){this.emit("metadata",this._metaData)},l.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"))},l.prototype._complete=function(e){if(this.errord)return;let t;try{let r=u.dataToBitMap(e,this._bitmapInfo);t=c(r,this._bitmapInfo,this._options.skipRescale),r=null}catch(e){return void this._handleError(e)}this.emit("parsed",t)}},2416:(e,t,r)=>{"use strict";let n=!0,o=r(9796),i=r(9653);o.deflateSync||(n=!1);let a=r(33),s=r(8692),u=r(8550),c=r(9983),l=r(8417);e.exports=function(e,t){if(!n)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let r,f,h;let d=[];let p=new a(e),m=new u(t,{read:p.read.bind(p),error:function(e){r=e},metadata:function(e){f=e},gamma:function(e){h=e},palette:function(e){f.palette=e},transColor:function(e){f.transColor=e},inflateData:function(e){d.push(e)},simpleTransparency:function(){f.alpha=!0}});if(m.start(),p.process(),r)throw r;let g,y=Buffer.concat(d);if(d.length=0,f.interlace)g=o.inflateSync(y);else{let e=(1+(f.width*f.bpp*f.depth+7>>3))*f.height;g=i(y,{chunkSize:e,maxLength:e})}if(y=null,!g||!g.length)throw new Error("bad png - invalid inflate data response");let v=s.process(g,f);y=null;let w=c.dataToBitMap(v,f);v=null;let b=l(w,f,t.skipRescale);return f.data=b,f.gamma=h||0,f}},8550:(e,t,r)=>{"use strict";let n=r(3482),o=r(3500),i=e.exports=function(e,t){this._options=e,e.checkCRC=!1!==e.checkCRC,this._hasIHDR=!1,this._hasIEND=!1,this._emittedHeadersFinished=!1,this._palette=[],this._colorType=0,this._chunks={},this._chunks[n.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[n.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[n.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[n.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[n.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[n.TYPE_gAMA]=this._handleGAMA.bind(this),this.read=t.read,this.error=t.error,this.metadata=t.metadata,this.gamma=t.gamma,this.transColor=t.transColor,this.palette=t.palette,this.parsed=t.parsed,this.inflateData=t.inflateData,this.finished=t.finished,this.simpleTransparency=t.simpleTransparency,this.headersFinished=t.headersFinished||function(){}};i.prototype.start=function(){this.read(n.PNG_SIGNATURE.length,this._parseSignature.bind(this))},i.prototype._parseSignature=function(e){let t=n.PNG_SIGNATURE;for(let r=0;r<t.length;r++)if(e[r]!==t[r])return void this.error(new Error("Invalid file signature"));this.read(8,this._parseChunkBegin.bind(this))},i.prototype._parseChunkBegin=function(e){let t=e.readUInt32BE(0),r=e.readUInt32BE(4),i="";for(let t=4;t<8;t++)i+=String.fromCharCode(e[t]);let a=Boolean(32&e[4]);if(this._hasIHDR||r===n.TYPE_IHDR){if(this._crc=new o,this._crc.write(Buffer.from(i)),this._chunks[r])return this._chunks[r](t);a?this.read(t+4,this._skipChunk.bind(this)):this.error(new Error("Unsupported critical chunk type "+i))}else this.error(new Error("Expected IHDR on beggining"))},i.prototype._skipChunk=function(){this.read(8,this._parseChunkBegin.bind(this))},i.prototype._handleChunkEnd=function(){this.read(4,this._parseChunkEnd.bind(this))},i.prototype._parseChunkEnd=function(e){let t=e.readInt32BE(0),r=this._crc.crc32();this._options.checkCRC&&r!==t?this.error(new Error("Crc error - "+t+" - "+r)):this._hasIEND||this.read(8,this._parseChunkBegin.bind(this))},i.prototype._handleIHDR=function(e){this.read(e,this._parseIHDR.bind(this))},i.prototype._parseIHDR=function(e){this._crc.write(e);let t=e.readUInt32BE(0),r=e.readUInt32BE(4),o=e[8],i=e[9],a=e[10],s=e[11],u=e[12];if(8!==o&&4!==o&&2!==o&&1!==o&&16!==o)return void this.error(new Error("Unsupported bit depth "+o));if(!(i in n.COLORTYPE_TO_BPP_MAP))return void this.error(new Error("Unsupported color type"));if(0!==a)return void this.error(new Error("Unsupported compression method"));if(0!==s)return void this.error(new Error("Unsupported filter method"));if(0!==u&&1!==u)return void this.error(new Error("Unsupported interlace method"));this._colorType=i;let c=n.COLORTYPE_TO_BPP_MAP[this._colorType];this._hasIHDR=!0,this.metadata({width:t,height:r,depth:o,interlace:Boolean(u),palette:Boolean(i&n.COLORTYPE_PALETTE),color:Boolean(i&n.COLORTYPE_COLOR),alpha:Boolean(i&n.COLORTYPE_ALPHA),bpp:c,colorType:i}),this._handleChunkEnd()},i.prototype._handlePLTE=function(e){this.read(e,this._parsePLTE.bind(this))},i.prototype._parsePLTE=function(e){this._crc.write(e);let t=Math.floor(e.length/3);for(let r=0;r<t;r++)this._palette.push([e[3*r],e[3*r+1],e[3*r+2],255]);this.palette(this._palette),this._handleChunkEnd()},i.prototype._handleTRNS=function(e){this.simpleTransparency(),this.read(e,this._parseTRNS.bind(this))},i.prototype._parseTRNS=function(e){if(this._crc.write(e),this._colorType===n.COLORTYPE_PALETTE_COLOR){if(0===this._palette.length)return void this.error(new Error("Transparency chunk must be after palette"));if(e.length>this._palette.length)return void this.error(new Error("More transparent colors than palette size"));for(let t=0;t<e.length;t++)this._palette[t][3]=e[t];this.palette(this._palette)}this._colorType===n.COLORTYPE_GRAYSCALE&&this.transColor([e.readUInt16BE(0)]),this._colorType===n.COLORTYPE_COLOR&&this.transColor([e.readUInt16BE(0),e.readUInt16BE(2),e.readUInt16BE(4)]),this._handleChunkEnd()},i.prototype._handleGAMA=function(e){this.read(e,this._parseGAMA.bind(this))},i.prototype._parseGAMA=function(e){this._crc.write(e),this.gamma(e.readUInt32BE(0)/n.GAMMA_DIVISION),this._handleChunkEnd()},i.prototype._handleIDAT=function(e){this._emittedHeadersFinished||(this._emittedHeadersFinished=!0,this.headersFinished()),this.read(-e,this._parseIDAT.bind(this,e))},i.prototype._parseIDAT=function(e,t){if(this._crc.write(t),this._colorType===n.COLORTYPE_PALETTE_COLOR&&0===this._palette.length)throw new Error("Expected palette not found");this.inflateData(t);let r=e-t.length;r>0?this._handleIDAT(r):this._handleChunkEnd()},i.prototype._handleIEND=function(e){this.read(e,this._parseIEND.bind(this))},i.prototype._parseIEND=function(e){this._crc.write(e),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()}},6117:(e,t,r)=>{"use strict";let n=r(2416),o=r(8360);t.read=function(e,t){return n(e,t||{})},t.write=function(e,t){return o(e,t)}},5477:(e,t,r)=>{"use strict";let n=r(3837),o=r(2781),i=r(7900),a=r(6838),s=r(6117),u=t.y=function(e){o.call(this),e=e||{},this.width=0|e.width,this.height=0|e.height,this.data=this.width>0&&this.height>0?Buffer.alloc(4*this.width*this.height):null,e.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new i(e),this._parser.on("error",this.emit.bind(this,"error")),this._parser.on("close",this._handleClose.bind(this)),this._parser.on("metadata",this._metadata.bind(this)),this._parser.on("gamma",this._gamma.bind(this)),this._parser.on("parsed",function(e){this.data=e,this.emit("parsed",e)}.bind(this)),this._packer=new a(e),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};n.inherits(u,o),u.sync=s,u.prototype.pack=function(){return this.data&&this.data.length?(process.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this)),this):(this.emit("error","No data provided"),this)},u.prototype.parse=function(e,t){if(t){let e,r;e=function(e){this.removeListener("error",r),this.data=e,t(null,this)}.bind(this),r=function(r){this.removeListener("parsed",e),t(r,null)}.bind(this),this.once("parsed",e),this.once("error",r)}return this.end(e),this},u.prototype.write=function(e){return this._parser.write(e),!0},u.prototype.end=function(e){this._parser.end(e)},u.prototype._metadata=function(e){this.width=e.width,this.height=e.height,this.emit("metadata",e)},u.prototype._gamma=function(e){this.gamma=e},u.prototype._handleClose=function(){this._parser.writable||this._packer.readable||this.emit("close")},u.bitblt=function(e,t,r,n,o,i,a,s){if(n|=0,o|=0,i|=0,a|=0,s|=0,(r|=0)>e.width||n>e.height||r+o>e.width||n+i>e.height)throw new Error("bitblt reading outside image");if(a>t.width||s>t.height||a+o>t.width||s+i>t.height)throw new Error("bitblt writing outside image");for(let u=0;u<i;u++)e.data.copy(t.data,(s+u)*t.width+a<<2,(n+u)*e.width+r<<2,(n+u)*e.width+r+o<<2)},u.prototype.bitblt=function(e,t,r,n,o,i,a){return u.bitblt(this,e,t,r,n,o,i,a),this},u.adjustGamma=function(e){if(e.gamma){for(let t=0;t<e.height;t++)for(let r=0;r<e.width;r++){let n=e.width*t+r<<2;for(let t=0;t<3;t++){let r=e.data[n+t]/255;r=Math.pow(r,1/2.2/e.gamma),e.data[n+t]=Math.round(255*r)}}e.gamma=0}},u.prototype.adjustGamma=function(){u.adjustGamma(this)}},9653:(e,t,r)=>{"use strict";let n=r(9491).ok,o=r(9796),i=r(3837),a=r(4300).kMaxLength;function s(e){if(!(this instanceof s))return new s(e);e&&e.chunkSize<o.Z_MIN_CHUNK&&(e.chunkSize=o.Z_MIN_CHUNK),o.Inflate.call(this,e),this._offset=void 0===this._offset?this._outOffset:this._offset,this._buffer=this._buffer||this._outBuffer,e&&null!=e.maxLength&&(this._maxLength=e.maxLength)}function u(e,t){t&&process.nextTick(t),e._handle&&(e._handle.close(),e._handle=null)}function c(e,t){return function(e,t){if("string"==typeof t&&(t=Buffer.from(t)),!(t instanceof Buffer))throw new TypeError("Not a string or buffer");let r=e._finishFlushFlag;return null==r&&(r=o.Z_FINISH),e._processChunk(t,r)}(new s(t),e)}s.prototype._processChunk=function(e,t,r){if("function"==typeof r)return o.Inflate._processChunk.call(this,e,t,r);let i,s,c=this,l=e&&e.length,f=this._chunkSize-this._offset,h=this._maxLength,d=0,p=[],m=0;function g(e,t){if(c._hadError)return;let r=f-t;if(n(r>=0,"have should not go down"),r>0){let e=c._buffer.slice(c._offset,c._offset+r);if(c._offset+=r,e.length>h&&(e=e.slice(0,h)),p.push(e),m+=e.length,h-=e.length,0===h)return!1}return(0===t||c._offset>=c._chunkSize)&&(f=c._chunkSize,c._offset=0,c._buffer=Buffer.allocUnsafe(c._chunkSize)),0===t&&(d+=l-e,l=e,!0)}this.on("error",(function(e){i=e})),n(this._handle,"zlib binding closed");do{s=this._handle.writeSync(t,e,d,l,this._buffer,this._offset,f),s=s||this._writeState}while(!this._hadError&&g(s[0],s[1]));if(this._hadError)throw i;if(m>=a)throw u(this),new RangeError("Cannot create final Buffer. It would be larger than 0x"+a.toString(16)+" bytes");let y=Buffer.concat(p,m);return u(this),y},i.inherits(s,o.Inflate),e.exports=t=c,t.Inflate=s,t.createInflate=function(e){return new s(e)},t.inflateSync=c},33:e=>{"use strict";let t=e.exports=function(e){this._buffer=e,this._reads=[]};t.prototype.read=function(e,t){this._reads.push({length:Math.abs(e),allowLess:e<0,func:t})},t.prototype.process=function(){for(;this._reads.length>0&&this._buffer.length;){let e=this._reads[0];if(!this._buffer.length||!(this._buffer.length>=e.length||e.allowLess))break;{this._reads.shift();let t=this._buffer;this._buffer=t.slice(e.length),e.func.call(this,t.slice(0,e.length))}}if(this._reads.length>0)throw new Error("There are some read requests waitng on finished stream");if(this._buffer.length>0)throw new Error("unrecognised content at end of stream")}},5666:e=>{var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o=t&&t.prototype instanceof g?t:g,i=Object.create(o.prototype),a=new P(n||[]);return i._invoke=function(e,t,r){var n=f;return function(o,i){if(n===d)throw new Error("Generator is already running");if(n===p){if("throw"===o)throw i;return T()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=I(a,r);if(s){if(s===m)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=d;var u=l(e,t,r);if("normal"===u.type){if(n=r.done?p:h,u.arg===m)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=p,r.method="throw",r.arg=u.arg)}}}(e,r,a),i}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var f="suspendedStart",h="suspendedYield",d="executing",p="completed",m={};function g(){}function y(){}function v(){}var w={};u(w,i,(function(){return this}));var b=Object.getPrototypeOf,E=b&&b(b(O([])));E&&E!==r&&n.call(E,i)&&(w=E);var _=v.prototype=g.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function r(o,i,a,s){var u=l(e[o],e,i);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(f).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var o;this._invoke=function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}}function I(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,I(e,r),"throw"===r.method))return m;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var o=l(n,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function O(e){if(e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:T}}function T(){return{value:t,done:!0}}return y.prototype=v,u(_,"constructor",v),u(v,"constructor",y),y.displayName=u(v,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,u(e,s,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},S(A.prototype),u(A.prototype,a,(function(){return this})),e.AsyncIterator=A,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new A(c(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(_),u(_,s,"Generator"),u(_,i,(function(){return this})),u(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=O,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:O(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},9898:e=>{"use strict";e.exports={type:"Buffer",data:[127,69,76,70,1,1,1,0,0,0,0,0,0,0,0,0,1,0,40,0,1,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,5,52,0,0,0,0,0,40,0,9,0,8,0,223,248,32,0,8,74,8,181,8,73,18,26,255,247,254,255,7,72,8,74,0,33,18,26,255,247,254,255,189,232,8,64,255,247,254,191,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,68,3,70,147,66,0,209,112,71,3,248,1,27,249,231,67,30,10,68,16,181,145,66,0,209,16,189,17,248,1,75,3,248,1,79,247,231,16,181,1,223,4,70,224,178,16,189,2,223,112,71,16,181,3,223,4,70,224,178,16,189,16,181,4,223,4,70,224,178,16,189,5,223,16,238,16,202,0,238,16,202,112,71,130,176,2,171,3,233,3,0,18,223,2,176,112,71,130,176,2,171,3,233,3,0,19,223,2,176,112,71,130,176,2,171,3,233,3,0,20,223,2,176,112,71,16,181,21,223,4,70,224,178,16,189,51,180,189,248,16,80,1,145,124,70,164,13,4,149,164,5,4,245,128,52,36,107,164,70,2,176,48,188,96,71,0,34,0,35,19,181,108,70,205,233,0,35,34,223,32,96,97,96,212,233,0,1,2,176,16,189,0,34,0,35,19,181,108,70,205,233,0,35,48,223,32,96,97,96,212,233,0,1,2,176,16,189,49,223,112,71,50,223,112,71,16,181,45,223,4,70,32,70,16,189,65,36,0,0,0,97,101,97,98,105,0,1,26,0,0,0,5,67,111,114,116,101,120,45,77,55,0,6,13,7,77,9,2,10,8,27,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,4,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,4,0,0,0,36,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,56,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,5,0,7,0,0,0,1,0,0,0,0,0,0,0,18,0,1,0,19,0,0,0,72,0,0,0,0,0,0,0,16,0,1,0,31,0,0,0,56,0,0,0,0,0,0,0,16,0,1,0,43,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,54,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,78,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,126,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,149,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,170,0,0,0,94,0,0,0,0,0,0,0,16,0,1,0,196,0,0,0,104,0,0,0,0,0,0,0,16,0,1,0,226,0,0,0,108,0,0,0,0,0,0,0,16,0,1,0,251,0,0,0,118,0,0,0,0,0,0,0,16,0,1,0,14,1,0,0,128,0,0,0,0,0,0,0,16,0,1,0,35,1,0,0,140,0,0,0,0,0,0,0,16,0,1,0,58,1,0,0,154,0,0,0,0,0,0,0,16,0,1,0,81,1,0,0,168,0,0,0,0,0,0,0,16,0,1,0,112,1,0,0,182,0,0,0,0,0,0,0,16,0,1,0,141,1,0,0,192,0,0,0,0,0,0,0,16,0,1,0,166,1,0,0,222,0,0,0,0,0,0,0,16,0,1,0,185,1,0,0,248,0,0,0,0,0,0,0,16,0,1,0,204,1,0,0,18,1,0,0,0,0,0,0,16,0,1,0,223,1,0,0,22,1,0,0,0,0,0,0,16,0,1,0,242,1,0,0,26,1,0,0,0,0,0,0,16,0,1,0,0,36,116,0,36,100,0,95,101,97,100,107,95,115,116,97,114,116,0,101,97,100,107,95,109,101,109,99,112,121,0,101,97,100,107,95,109,101,109,115,101,116,0,95,101,97,100,107,95,109,97,105,110,0,95,100,97,116,97,95,115,101,99,116,105,111,110,95,115,116,97,114,116,95,114,97,109,0,95,100,97,116,97,95,115,101,99,116,105,111,110,95,101,110,100,95,114,97,109,0,95,100,97,116,97,95,115,101,99,116,105,111,110,95,115,116,97,114,116,95,102,108,97,115,104,0,95,98,115,115,95,115,101,99,116,105,111,110,95,115,116,97,114,116,95,114,97,109,0,95,98,115,115,95,115,101,99,116,105,111,110,95,101,110,100,95,114,97,109,0,101,97,100,107,95,98,97,99,107,108,105,103,104,116,95,98,114,105,103,104,116,110,101,115,115,0,101,97,100,107,95,98,97,99,107,108,105,103,104,116,95,115,101,116,95,98,114,105,103,104,116,110,101,115,115,0,101,97,100,107,95,98,97,116,116,101,114,121,95,105,115,95,99,104,97,114,103,105,110,103,0,101,97,100,107,95,98,97,116,116,101,114,121,95,108,101,118,101,108,0,101,97,100,107,95,98,97,116,116,101,114,121,95,118,111,108,116,97,103,101,0,101,97,100,107,95,100,105,115,112,108,97,121,95,112,117,108,108,95,114,101,99,116,0,101,97,100,107,95,100,105,115,112,108,97,121,95,112,117,115,104,95,114,101,99,116,0,101,97,100,107,95,100,105,115,112,108,97,121,95,112,117,115,104,95,114,101,99,116,95,117,110,105,102,111,114,109,0,101,97,100,107,95,100,105,115,112,108,97,121,95,119,97,105,116,95,102,111,114,95,118,98,108,97,110,107,0,101,97,100,107,95,100,105,115,112,108,97,121,95,100,114,97,119,95,115,116,114,105,110,103,0,101,97,100,107,95,107,101,121,98,111,97,114,100,95,115,99,97,110,0,101,97,100,107,95,116,105,109,105,110,103,95,109,105,108,108,105,115,0,101,97,100,107,95,116,105,109,105,110,103,95,109,115,108,101,101,112,0,101,97,100,107,95,116,105,109,105,110,103,95,117,115,108,101,101,112,0,101,97,100,107,95,114,97,110,100,111,109,0,0,0,12,0,0,0,10,9,0,0,24,0,0,0,10,10,0,0,36,0,0,0,2,12,0,0,40,0,0,0,2,13,0,0,44,0,0,0,2,14,0,0,48,0,0,0,2,15,0,0,52,0,0,0,2,16,0,0,32,0,0,0,30,11,0,0,0,46,115,121,109,116,97,98,0,46,115,116,114,116,97,98,0,46,115,104,115,116,114,116,97,98,0,46,114,101,108,46,116,101,120,116,0,46,100,97,116,97,0,46,98,115,115,0,46,65,82,77,46,97,116,116,114,105,98,117,116,101,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,52,0,0,0,36,1,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,27,0,0,0,9,0,0,0,64,0,0,0,0,0,0,0,128,5,0,0,64,0,0,0,6,0,0,0,1,0,0,0,4,0,0,0,8,0,0,0,37,0,0,0,1,0,0,0,3,0,0,0,0,0,0,0,88,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,43,0,0,0,8,0,0,0,3,0,0,0,0,0,0,0,88,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,48,0,0,0,3,0,0,112,0,0,0,0,0,0,0,0,88,1,0,0,37,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,128,1,0,0,0,2,0,0,7,0,0,0,8,0,0,0,4,0,0,0,16,0,0,0,9,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,128,3,0,0,254,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,17,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,192,5,0,0,64,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0]}},7573:(e,t,r)=>{"use strict";e.exports=r.p+"ld.wasm"},3835:(e,t,r)=>{"use strict";e.exports=r.p+"objcopy.wasm"},9491:e=>{"use strict";e.exports=require("assert")},4300:e=>{"use strict";e.exports=require("buffer")},2081:e=>{"use strict";e.exports=require("child_process")},6113:e=>{"use strict";e.exports=require("crypto")},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},3292:e=>{"use strict";e.exports=require("fs/promises")},1017:e=>{"use strict";e.exports=require("path")},7282:e=>{"use strict";e.exports=require("process")},2781:e=>{"use strict";e.exports=require("stream")},1576:e=>{"use strict";e.exports=require("string_decoder")},3837:e=>{"use strict";e.exports=require("util")},9796:e=>{"use strict";e.exports=require("zlib")},1735:()=>{},7461:(e,t,r)=>{const{Argument:n}=r(8998),{Command:o}=r(5282),{CommanderError:i,InvalidArgumentError:a}=r(8056),{Help:s}=r(8917),{Option:u}=r(5790);(t=e.exports=new o).program=t,t.Argument=n,t.Command=o,t.CommanderError=i,t.Help=s,t.InvalidArgumentError=a,t.InvalidOptionArgumentError=a,t.Option=u},8998:(e,t,r)=>{const{InvalidArgumentError:n}=r(8056);t.Argument=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e}this._name.length>3&&"..."===this._name.slice(-3)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?t.concat(e):[e]}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,t)=>{if(!this.argChoices.includes(e))throw new n(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(e,t):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}},t.humanReadableArgName=function(e){const t=e.name()+(!0===e.variadic?"...":"");return e.required?"<"+t+">":"["+t+"]"}},5282:(e,t,r)=>{const n=r(2361).EventEmitter,o=r(2081),i=r(1017),a=r(7147),s=r(7282),{Argument:u,humanReadableArgName:c}=r(8998),{CommanderError:l}=r(8056),{Help:f}=r(8917),{Option:h,splitOptionFlags:d,DualOptions:p}=r(5790),{suggestSimilar:m}=r(1812);class g extends n{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this._args=[],this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:e=>s.stdout.write(e),writeErr:e=>s.stderr.write(e),getOutHelpWidth:()=>s.stdout.isTTY?s.stdout.columns:void 0,getErrHelpWidth:()=>s.stderr.isTTY?s.stderr.columns:void 0,outputError:(e,t)=>t(e)},this._hidden=!1,this._hasHelpOption=!0,this._helpFlags="-h, --help",this._helpDescription="display help for command",this._helpShortFlag="-h",this._helpLongFlag="--help",this._addImplicitHelpCommand=void 0,this._helpCommandName="help",this._helpCommandnameAndArgs="help [command]",this._helpCommandDescription="display help for command",this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._hasHelpOption=e._hasHelpOption,this._helpFlags=e._helpFlags,this._helpDescription=e._helpDescription,this._helpShortFlag=e._helpShortFlag,this._helpLongFlag=e._helpLongFlag,this._helpCommandName=e._helpCommandName,this._helpCommandnameAndArgs=e._helpCommandnameAndArgs,this._helpCommandDescription=e._helpCommandDescription,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}command(e,t,r){let n=t,o=r;"object"==typeof n&&null!==n&&(o=n,n=null),o=o||{};const[,i,a]=e.match(/([^ ]+) *(.*)/),s=this.createCommand(i);return n&&(s.description(n),s._executableHandler=!0),o.isDefault&&(this._defaultCommandName=s._name),s._hidden=!(!o.noHelp&&!o.hidden),s._executableFile=o.executableFile||null,a&&s.arguments(a),this.commands.push(s),s.parent=this,s.copyInheritedSettings(this),n?this:s}createCommand(e){return new g(e)}createHelp(){return Object.assign(new f,this.configureHelp())}configureHelp(e){return void 0===e?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return void 0===e?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return"string"!=typeof e&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error("Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()");return(t=t||{}).isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this.commands.push(e),e.parent=this,this}createArgument(e,t){return new u(e,t)}argument(e,t,r,n){const o=this.createArgument(e,t);return"function"==typeof r?o.default(n).argParser(r):o.default(r),this.addArgument(o),this}arguments(e){return e.split(/ +/).forEach((e=>{this.argument(e)})),this}addArgument(e){const t=this._args.slice(-1)[0];if(t&&t.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&void 0!==e.defaultValue&&void 0===e.parseArg)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this._args.push(e),this}addHelpCommand(e,t){return!1===e?this._addImplicitHelpCommand=!1:(this._addImplicitHelpCommand=!0,"string"==typeof e&&(this._helpCommandName=e.split(" ")[0],this._helpCommandnameAndArgs=e),this._helpCommandDescription=t||this._helpCommandDescription),this}_hasImplicitHelpCommand(){return void 0===this._addImplicitHelpCommand?this.commands.length&&!this._actionHandler&&!this._findCommand("help"):this._addImplicitHelpCommand}hook(e,t){const r=["preAction","postAction"];if(!r.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.\nExpecting one of '${r.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return this._exitCallback=e||(e=>{if("commander.executeSubCommandAsync"!==e.code)throw e}),this}_exit(e,t,r){this._exitCallback&&this._exitCallback(new l(e,t,r)),s.exit(e)}action(e){return this._actionHandler=t=>{const r=this._args.length,n=t.slice(0,r);return this._storeOptionsAsProperties?n[r]=this:n[r]=this.opts(),n.push(this),e.apply(this,n)},this}createOption(e,t){return new h(e,t)}addOption(e){const t=e.name(),r=e.attributeName();if(e.negate){const t=e.long.replace(/^--no-/,"--");this._findOption(t)||this.setOptionValueWithSource(r,void 0===e.defaultValue||e.defaultValue,"default")}else void 0!==e.defaultValue&&this.setOptionValueWithSource(r,e.defaultValue,"default");this.options.push(e);const n=(t,n,o)=>{null==t&&void 0!==e.presetArg&&(t=e.presetArg);const i=this.getOptionValue(r);if(null!==t&&e.parseArg)try{t=e.parseArg(t,i)}catch(e){if("commander.invalidArgument"===e.code){const t=`${n} ${e.message}`;this.error(t,{exitCode:e.exitCode,code:e.code})}throw e}else null!==t&&e.variadic&&(t=e._concatValue(t,i));null==t&&(t=!e.negate&&(!(!e.isBoolean()&&!e.optional)||"")),this.setOptionValueWithSource(r,t,o)};return this.on("option:"+t,(t=>{const r=`error: option '${e.flags}' argument '${t}' is invalid.`;n(t,r,"cli")})),e.envVar&&this.on("optionEnv:"+t,(t=>{const r=`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`;n(t,r,"env")})),this}_optionEx(e,t,r,n,o){if("object"==typeof t&&t instanceof h)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");const i=this.createOption(t,r);if(i.makeOptionMandatory(!!e.mandatory),"function"==typeof n)i.default(o).argParser(n);else if(n instanceof RegExp){const e=n;n=(t,r)=>{const n=e.exec(t);return n?n[0]:r},i.default(o).argParser(n)}else i.default(n);return this.addOption(i)}option(e,t,r,n){return this._optionEx({},e,t,r,n)}requiredOption(e,t,r,n){return this._optionEx({mandatory:!0},e,t,r,n)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){if(this._passThroughOptions=!!e,this.parent&&e&&!this.parent._enablePositionalOptions)throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");return this}storeOptionsAsProperties(e=!0){if(this._storeOptionsAsProperties=!!e,this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");return this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this}setOptionValueWithSource(e,t,r){return this.setOptionValue(e,t),this._optionValueSources[e]=r,this}getOptionValueSource(e){return this._optionValueSources[e]}_prepareUserArgs(e,t){if(void 0!==e&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");let r;switch(t=t||{},void 0===e&&(e=s.argv,s.versions&&s.versions.electron&&(t.from="electron")),this.rawArgs=e.slice(),t.from){case void 0:case"node":this._scriptPath=e[1],r=e.slice(2);break;case"electron":s.defaultApp?(this._scriptPath=e[1],r=e.slice(2)):r=e.slice(1);break;case"user":r=e.slice(0);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",r}parse(e,t){const r=this._prepareUserArgs(e,t);return this._parseCommand([],r),this}async parseAsync(e,t){const r=this._prepareUserArgs(e,t);return await this._parseCommand([],r),this}_executeSubCommand(e,t){t=t.slice();let r=!1;const n=[".js",".ts",".tsx",".mjs",".cjs"];function u(e,t){const r=i.resolve(e,t);if(a.existsSync(r))return r;if(n.includes(i.extname(t)))return;const o=n.find((e=>a.existsSync(`${r}${e}`)));return o?`${r}${o}`:void 0}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let c,f=e._executableFile||`${this._name}-${e._name}`,h=this._executableDir||"";if(this._scriptPath){let e;try{e=a.realpathSync(this._scriptPath)}catch(t){e=this._scriptPath}h=i.resolve(i.dirname(e),h)}if(h){let t=u(h,f);if(!t&&!e._executableFile&&this._scriptPath){const r=i.basename(this._scriptPath,i.extname(this._scriptPath));r!==this._name&&(t=u(h,`${r}-${e._name}`))}f=t||f}if(r=n.includes(i.extname(f)),"win32"!==s.platform?r?(t.unshift(f),t=v(s.execArgv).concat(t),c=o.spawn(s.argv[0],t,{stdio:"inherit"})):c=o.spawn(f,t,{stdio:"inherit"}):(t.unshift(f),t=v(s.execArgv).concat(t),c=o.spawn(s.execPath,t,{stdio:"inherit"})),!c.killed){["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((e=>{s.on(e,(()=>{!1===c.killed&&null===c.exitCode&&c.kill(e)}))}))}const d=this._exitCallback;d?c.on("close",(()=>{d(new l(s.exitCode||0,"commander.executeSubCommandAsync","(close)"))})):c.on("close",s.exit.bind(s)),c.on("error",(t=>{if("ENOENT"===t.code){const t=h?`searched for local subcommand relative to directory '${h}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",r=`'${f}' does not exist\n - if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${t}`;throw new Error(r)}if("EACCES"===t.code)throw new Error(`'${f}' not executable`);if(d){const e=new l(1,"commander.executeSubCommandAsync","(error)");e.nestedError=t,d(e)}else s.exit(1)})),this.runningCommand=c}_dispatchSubcommand(e,t,r){const n=this._findCommand(e);if(n||this.help({error:!0}),!n._executableHandler)return n._parseCommand(t,r);this._executeSubCommand(n,t.concat(r))}_checkNumberOfArguments(){this._args.forEach(((e,t)=>{e.required&&null==this.args[t]&&this.missingArgument(e.name())})),this._args.length>0&&this._args[this._args.length-1].variadic||this.args.length>this._args.length&&this._excessArguments(this.args)}_processArguments(){const e=(e,t,r)=>{let n=t;if(null!==t&&e.parseArg)try{n=e.parseArg(t,r)}catch(r){if("commander.invalidArgument"===r.code){const n=`error: command-argument value '${t}' is invalid for argument '${e.name()}'. ${r.message}`;this.error(n,{exitCode:r.exitCode,code:r.code})}throw r}return n};this._checkNumberOfArguments();const t=[];this._args.forEach(((r,n)=>{let o=r.defaultValue;r.variadic?n<this.args.length?(o=this.args.slice(n),r.parseArg&&(o=o.reduce(((t,n)=>e(r,n,t)),r.defaultValue))):void 0===o&&(o=[]):n<this.args.length&&(o=this.args[n],r.parseArg&&(o=e(r,o,r.defaultValue))),t[n]=o})),this.processedArgs=t}_chainOrCall(e,t){return e&&e.then&&"function"==typeof e.then?e.then((()=>t())):t()}_chainOrCallHooks(e,t){let r=e;const n=[];return w(this).reverse().filter((e=>void 0!==e._lifeCycleHooks[t])).forEach((e=>{e._lifeCycleHooks[t].forEach((t=>{n.push({hookedCommand:e,callback:t})}))})),"postAction"===t&&n.reverse(),n.forEach((e=>{r=this._chainOrCall(r,(()=>e.callback(e.hookedCommand,this)))})),r}_parseCommand(e,t){const r=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(r.operands),t=r.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._hasImplicitHelpCommand()&&e[0]===this._helpCommandName)return 1===e.length&&this.help(),this._dispatchSubcommand(e[1],[],[this._helpLongFlag]);if(this._defaultCommandName)return y(this,t),this._dispatchSubcommand(this._defaultCommandName,e,t);!this.commands.length||0!==this.args.length||this._actionHandler||this._defaultCommandName||this.help({error:!0}),y(this,r.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();const n=()=>{r.unknown.length>0&&this.unknownOption(r.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){let r;return n(),this._processArguments(),r=this._chainOrCallHooks(r,"preAction"),r=this._chainOrCall(r,(()=>this._actionHandler(this.processedArgs))),this.parent&&(r=this._chainOrCall(r,(()=>{this.parent.emit(o,e,t)}))),r=this._chainOrCallHooks(r,"postAction"),r}if(this.parent&&this.parent.listenerCount(o))n(),this._processArguments(),this.parent.emit(o,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(n(),this._processArguments())}else this.commands.length?(n(),this.help({error:!0})):(n(),this._processArguments())}_findCommand(e){if(e)return this.commands.find((t=>t._name===e||t._aliases.includes(e)))}_findOption(e){return this.options.find((t=>t.is(e)))}_checkForMissingMandatoryOptions(){for(let e=this;e;e=e.parent)e.options.forEach((t=>{t.mandatory&&void 0===e.getOptionValue(t.attributeName())&&e.missingMandatoryOptionValue(t)}))}_checkForConflictingLocalOptions(){const e=this.options.filter((e=>{const t=e.attributeName();return void 0!==this.getOptionValue(t)&&"default"!==this.getOptionValueSource(t)}));e.filter((e=>e.conflictsWith.length>0)).forEach((t=>{const r=e.find((e=>t.conflictsWith.includes(e.attributeName())));r&&this._conflictingOption(t,r)}))}_checkForConflictingOptions(){for(let e=this;e;e=e.parent)e._checkForConflictingLocalOptions()}parseOptions(e){const t=[],r=[];let n=t;const o=e.slice();function i(e){return e.length>1&&"-"===e[0]}let a=null;for(;o.length;){const e=o.shift();if("--"===e){n===r&&n.push(e),n.push(...o);break}if(!a||i(e)){if(a=null,i(e)){const t=this._findOption(e);if(t){if(t.required){const e=o.shift();void 0===e&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,e)}else if(t.optional){let e=null;o.length>0&&!i(o[0])&&(e=o.shift()),this.emit(`option:${t.name()}`,e)}else this.emit(`option:${t.name()}`);a=t.variadic?t:null;continue}}if(e.length>2&&"-"===e[0]&&"-"!==e[1]){const t=this._findOption(`-${e[1]}`);if(t){t.required||t.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${t.name()}`,e.slice(2)):(this.emit(`option:${t.name()}`),o.unshift(`-${e.slice(2)}`));continue}}if(/^--[^=]+=/.test(e)){const t=e.indexOf("="),r=this._findOption(e.slice(0,t));if(r&&(r.required||r.optional)){this.emit(`option:${r.name()}`,e.slice(t+1));continue}}if(i(e)&&(n=r),(this._enablePositionalOptions||this._passThroughOptions)&&0===t.length&&0===r.length){if(this._findCommand(e)){t.push(e),o.length>0&&r.push(...o);break}if(e===this._helpCommandName&&this._hasImplicitHelpCommand()){t.push(e),o.length>0&&t.push(...o);break}if(this._defaultCommandName){r.push(e),o.length>0&&r.push(...o);break}}if(this._passThroughOptions){n.push(e),o.length>0&&n.push(...o);break}n.push(e)}else this.emit(`option:${a.name()}`,e)}return{operands:t,unknown:r}}opts(){if(this._storeOptionsAsProperties){const e={},t=this.options.length;for(let r=0;r<t;r++){const t=this.options[r].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return w(this).reduce(((e,t)=>Object.assign(e,t.opts())),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr),"string"==typeof this._showHelpAfterError?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr("\n"),this.outputHelp({error:!0}));const r=t||{},n=r.exitCode||1,o=r.code||"commander.error";this._exit(n,o,e)}_parseOptionsEnv(){this.options.forEach((e=>{if(e.envVar&&e.envVar in s.env){const t=e.attributeName();(void 0===this.getOptionValue(t)||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,s.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}}))}_parseOptionsImplied(){const e=new p(this.options),t=e=>void 0!==this.getOptionValue(e)&&!["default","implied"].includes(this.getOptionValueSource(e));this.options.filter((r=>void 0!==r.implied&&t(r.attributeName())&&e.valueFromOption(this.getOptionValue(r.attributeName()),r))).forEach((e=>{Object.keys(e.implied).filter((e=>!t(e))).forEach((t=>{this.setOptionValueWithSource(t,e.implied[t],"implied")}))}))}missingArgument(e){const t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){const t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){const t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){const r=e=>{const t=e.attributeName(),r=this.getOptionValue(t),n=this.options.find((e=>e.negate&&t===e.attributeName())),o=this.options.find((e=>!e.negate&&t===e.attributeName()));return n&&(void 0===n.presetArg&&!1===r||void 0!==n.presetArg&&r===n.presetArg)?n:o||e},n=e=>{const t=r(e),n=t.attributeName();return"env"===this.getOptionValueSource(n)?`environment variable '${t.envVar}'`:`option '${t.flags}'`},o=`error: ${n(e)} cannot be used with ${n(t)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let r=[],n=this;do{const e=n.createHelp().visibleOptions(n).filter((e=>e.long)).map((e=>e.long));r=r.concat(e),n=n.parent}while(n&&!n._enablePositionalOptions);t=m(e,r)}const r=`error: unknown option '${e}'${t}`;this.error(r,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;const t=this._args.length,r=1===t?"":"s",n=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${r} but got ${e.length}.`;this.error(n,{code:"commander.excessArguments"})}unknownCommand(){const e=this.args[0];let t="";if(this._showSuggestionAfterError){const r=[];this.createHelp().visibleCommands(this).forEach((e=>{r.push(e.name()),e.alias()&&r.push(e.alias())})),t=m(e,r)}const r=`error: unknown command '${e}'${t}`;this.error(r,{code:"commander.unknownCommand"})}version(e,t,r){if(void 0===e)return this._version;this._version=e,t=t||"-V, --version",r=r||"output the version number";const n=this.createOption(t,r);return this._versionOptionName=n.attributeName(),this.options.push(n),this.on("option:"+n.name(),(()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,"commander.version",e)})),this}description(e,t){return void 0===e&&void 0===t?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return void 0===e?this._summary:(this._summary=e,this)}alias(e){if(void 0===e)return this._aliases[0];let t=this;if(0!==this.commands.length&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");return t._aliases.push(e),this}aliases(e){return void 0===e?this._aliases:(e.forEach((e=>this.alias(e))),this)}usage(e){if(void 0===e){if(this._usage)return this._usage;const e=this._args.map((e=>c(e)));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?e:[]).join(" ")}return this._usage=e,this}name(e){return void 0===e?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=i.basename(e,i.extname(e)),this}executableDir(e){return void 0===e?this._executableDir:(this._executableDir=e,this)}helpInformation(e){const t=this.createHelp();return void 0===t.helpWidth&&(t.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),t.formatHelp(this,t)}_getHelpContext(e){const t={error:!!(e=e||{}).error};let r;return r=t.error?e=>this._outputConfiguration.writeErr(e):e=>this._outputConfiguration.writeOut(e),t.write=e.write||r,t.command=this,t}outputHelp(e){let t;"function"==typeof e&&(t=e,e=void 0);const r=this._getHelpContext(e);w(this).reverse().forEach((e=>e.emit("beforeAllHelp",r))),this.emit("beforeHelp",r);let n=this.helpInformation(r);if(t&&(n=t(n),"string"!=typeof n&&!Buffer.isBuffer(n)))throw new Error("outputHelp callback must return a string or a Buffer");r.write(n),this.emit(this._helpLongFlag),this.emit("afterHelp",r),w(this).forEach((e=>e.emit("afterAllHelp",r)))}helpOption(e,t){if("boolean"==typeof e)return this._hasHelpOption=e,this;this._helpFlags=e||this._helpFlags,this._helpDescription=t||this._helpDescription;const r=d(this._helpFlags);return this._helpShortFlag=r.shortFlag,this._helpLongFlag=r.longFlag,this}help(e){this.outputHelp(e);let t=s.exitCode||0;0===t&&e&&"function"!=typeof e&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){const r=["beforeAll","before","after","afterAll"];if(!r.includes(e))throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${r.join("', '")}'`);const n=`${e}Help`;return this.on(n,(e=>{let r;r="function"==typeof t?t({error:e.error,command:e.command}):t,r&&e.write(`${r}\n`)})),this}}function y(e,t){e._hasHelpOption&&t.find((t=>t===e._helpLongFlag||t===e._helpShortFlag))&&(e.outputHelp(),e._exit(0,"commander.helpDisplayed","(outputHelp)"))}function v(e){return e.map((e=>{if(!e.startsWith("--inspect"))return e;let t,r,n="127.0.0.1",o="9229";return null!==(r=e.match(/^(--inspect(-brk)?)$/))?t=r[1]:null!==(r=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))?(t=r[1],/^\d+$/.test(r[3])?o=r[3]:n=r[3]):null!==(r=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))&&(t=r[1],n=r[3],o=r[4]),t&&"0"!==o?`${t}=${n}:${parseInt(o)+1}`:e}))}function w(e){const t=[];for(let r=e;r;r=r.parent)t.push(r);return t}t.Command=g},8056:(e,t)=>{class r extends Error{constructor(e,t,r){super(r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}}t.CommanderError=r,t.InvalidArgumentError=class extends r{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}},8917:(e,t,r)=>{const{humanReadableArgName:n}=r(8998);t.Help=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1}visibleCommands(e){const t=e.commands.filter((e=>!e._hidden));if(e._hasImplicitHelpCommand()){const[,r,n]=e._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),o=e.createCommand(r).helpOption(!1);o.description(e._helpCommandDescription),n&&o.arguments(n),t.push(o)}return this.sortSubcommands&&t.sort(((e,t)=>e.name().localeCompare(t.name()))),t}visibleOptions(e){const t=e.options.filter((e=>!e.hidden)),r=e._hasHelpOption&&e._helpShortFlag&&!e._findOption(e._helpShortFlag),n=e._hasHelpOption&&!e._findOption(e._helpLongFlag);if(r||n){let o;o=r?n?e.createOption(e._helpFlags,e._helpDescription):e.createOption(e._helpShortFlag,e._helpDescription):e.createOption(e._helpLongFlag,e._helpDescription),t.push(o)}if(this.sortOptions){const e=e=>e.short?e.short.replace(/^-/,""):e.long.replace(/^--/,"");t.sort(((t,r)=>e(t).localeCompare(e(r))))}return t}visibleArguments(e){return e._argsDescription&&e._args.forEach((t=>{t.description=t.description||e._argsDescription[t.name()]||""})),e._args.find((e=>e.description))?e._args:[]}subcommandTerm(e){const t=e._args.map((e=>n(e))).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce(((e,r)=>Math.max(e,t.subcommandTerm(r).length)),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce(((e,r)=>Math.max(e,t.optionTerm(r).length)),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce(((e,r)=>Math.max(e,t.argumentTerm(r).length)),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let r="";for(let t=e.parent;t;t=t.parent)r=t.name()+" "+r;return r+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){const t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map((e=>JSON.stringify(e))).join(", ")}`),void 0!==e.defaultValue){(e.required||e.optional||e.isBoolean()&&"boolean"==typeof e.defaultValue)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`)}return void 0!==e.presetArg&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),void 0!==e.envVar&&t.push(`env: ${e.envVar}`),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){const t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map((e=>JSON.stringify(e))).join(", ")}`),void 0!==e.defaultValue&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){const r=`(${t.join(", ")})`;return e.description?`${e.description} ${r}`:r}return e.description}formatHelp(e,t){const r=t.padWidth(e,t),n=t.helpWidth||80;function o(e,o){if(o){const i=`${e.padEnd(r+2)}${o}`;return t.wrap(i,n-2,r+2)}return e}function i(e){return e.join("\n").replace(/^/gm," ".repeat(2))}let a=[`Usage: ${t.commandUsage(e)}`,""];const s=t.commandDescription(e);s.length>0&&(a=a.concat([s,""]));const u=t.visibleArguments(e).map((e=>o(t.argumentTerm(e),t.argumentDescription(e))));u.length>0&&(a=a.concat(["Arguments:",i(u),""]));const c=t.visibleOptions(e).map((e=>o(t.optionTerm(e),t.optionDescription(e))));c.length>0&&(a=a.concat(["Options:",i(c),""]));const l=t.visibleCommands(e).map((e=>o(t.subcommandTerm(e),t.subcommandDescription(e))));return l.length>0&&(a=a.concat(["Commands:",i(l),""])),a.join("\n")}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,r,n=40){if(e.match(/[\n]\s+/))return e;const o=t-r;if(o<n)return e;const i=e.slice(0,r),a=e.slice(r),s=" ".repeat(r),u=new RegExp(".{1,"+(o-1)+"}([\\s]|$)|[^\\s]+?([\\s]|$)","g");return i+(a.match(u)||[]).map(((e,t)=>("\n"===e.slice(-1)&&(e=e.slice(0,e.length-1)),(t>0?s:"")+e.trimRight()))).join("\n")}}},5790:(e,t,r)=>{const{InvalidArgumentError:n}=r(8056);function o(e){let t,r;const n=e.split(/[ |,]+/);return n.length>1&&!/^[[<]/.test(n[1])&&(t=n.shift()),r=n.shift(),!t&&/^-[^-]$/.test(r)&&(t=r,r=void 0),{shortFlag:t,longFlag:r}}t.Option=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;const r=o(e);this.short=r.shortFlag,this.long=r.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){return this.implied=Object.assign(this.implied||{},e),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?t.concat(e):[e]}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,t)=>{if(!this.argChoices.includes(e))throw new n(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(e,t):e},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.name().replace(/^no-/,"").split("-").reduce(((e,t)=>e+t[0].toUpperCase()+t.slice(1)))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},t.splitOptionFlags=o,t.DualOptions=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach((e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)})),this.negativeOptions.forEach(((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)}))}valueFromOption(e,t){const r=t.attributeName();if(!this.dualOptions.has(r))return!0;const n=this.negativeOptions.get(r).presetArg,o=void 0!==n&&n;return t.negate===(o===e)}}},1812:(e,t)=>{t.suggestSimilar=function(e,t){if(!t||0===t.length)return"";t=Array.from(new Set(t));const r=e.startsWith("--");r&&(e=e.slice(2),t=t.map((e=>e.slice(2))));let n=[],o=3;return t.forEach((t=>{if(t.length<=1)return;const r=function(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);const r=[];for(let t=0;t<=e.length;t++)r[t]=[t];for(let e=0;e<=t.length;e++)r[0][e]=e;for(let n=1;n<=t.length;n++)for(let o=1;o<=e.length;o++){let i=1;i=e[o-1]===t[n-1]?0:1,r[o][n]=Math.min(r[o-1][n]+1,r[o][n-1]+1,r[o-1][n-1]+i),o>1&&n>1&&e[o-1]===t[n-2]&&e[o-2]===t[n-1]&&(r[o][n]=Math.min(r[o][n],r[o-2][n-2]+1))}return r[e.length][t.length]}(e,t),i=Math.max(e.length,t.length);(i-r)/i>.4&&(r<o?(o=r,n=[t]):r===o&&n.push(t))})),n.sort(((e,t)=>e.localeCompare(t))),r&&(n=n.map((e=>`--${e}`))),n.length>1?`\n(Did you mean one of ${n.join(", ")}?)`:1===n.length?`\n(Did you mean ${n[0]}?)`:""}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},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.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.p="";var n={};(()=>{"use strict";r.d(n,{default:()=>Qt});var e=r(7757),t=r.n(e);const o=require("usb");function i(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,n.key,n)}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function u(e){var t="function"==typeof Map?new Map:void 0;return u=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return c(e,arguments,h(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),f(n,e)},u(e)}function c(e,t,r){return c=l()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&f(o,r.prototype),o},c.apply(null,arguments)}function l(){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}}function f(e,t){return f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},f(e,t)}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}const d=function(e){!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&&f(e,t)}(d,e);var t,r,n,o,u,c=(t=d,r=l(),function(){var e,n=h(t);if(r){var o=h(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return s(this,e)});function d(e){var t;a(this,d);for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return(t=c.call.apply(c,[this].concat(n))).name=e,t}return n=d,o&&i(n.prototype,o),u&&i(n,u),Object.defineProperty(n,"prototype",{writable:!1}),n}(u(Error));function p(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,n.key,n)}}var m=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r,n;return t=e,n=[{key:"append",value:function(t){for(var r="",n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];o.forEach((function(e){r+=e+","})),e.Content+=+new Date+","+t+","+r+"\n"}},{key:"info",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e.append.apply(e,["info"].concat(r))}},{key:"warn",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e.append.apply(e,["warn"].concat(r))}},{key:"error",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e.append.apply(e,["error"].concat(r))}}],(r=null)&&p(t.prototype,r),n&&p(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();m.Content="";const g=m;function y(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return v(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return v(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function w(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function b(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){w(i,n,o,a,s,"next",e)}function s(e){w(i,n,o,a,s,"throw",e)}a(void 0)}))}}function E(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,n.key,n)}}function _(e,t,r){return t&&E(e.prototype,t),r&&E(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function S(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function A(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&&I(e,t)}function I(e,t){return I=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},I(e,t)}function k(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=P(e);if(t){var o=P(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return C(this,r)}}function C(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function P(e){return P=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},P(e)}var O=6,T=8,x=10,R=2,D=3,M=4,F=1033;function N(e){return{bLength:e.getUint8(0),bDescriptorType:e.getUint8(1),bInterfaceNumber:e.getUint8(2),bAlternateSetting:e.getUint8(3),bNumEndpoints:e.getUint8(4),bInterfaceClass:e.getUint8(5),bInterfaceSubClass:e.getUint8(6),bInterfaceProtocol:e.getUint8(7),iInterface:e.getUint8(8),endpoints:[]}}function L(e){var t=function(e){for(var t,r=e,n=[];r.byteLength>2;){var o=r.getUint8(0),i=r.getUint8(1),a=new DataView(r.buffer.slice(0,o));if(i==M)t=N(a),n.push(t);else{var s={bLength:o,bDescriptorType:i,data:a};t?t.endpoints.push(s):n.push(s)}r=new DataView(r.buffer.slice(o))}return n}(new DataView(e.buffer.slice(9)));return{bLength:e.getUint8(0),bDescriptorType:e.getUint8(1),wTotalLength:e.getUint16(2,!0),bNumInterfaces:e.getUint8(4),bConfigurationValue:e.getUint8(5),iConfiguration:e.getUint8(6),bmAttributes:e.getUint8(7),bMaxPower:e.getUint8(8),interfaces:t}}function H(e){return g.info("DFU","getConfiguration"),new Promise((function(t,r){e.device.controlTransferIn({requestType:"standard",recipient:"device",request:T,value:0,index:0},1).then((function(e){"ok"==e.status?t(e.data.getInt8(0)):r(new Error("Wrong getConfiguration status: "+e.status))})).catch((function(e){r(new Error("Get configuration failed --\x3e "+e))}))}))}function U(e){return g.info("DFU","getInterface"),new Promise((function(t,r){e.device.controlTransferIn({requestType:"standard",recipient:"interface",request:x,value:0,index:e.settings.interface.interfaceNumber},1).then((function(e){"ok"==e.status?t(e.data.getInt8(0)):r(new Error("Wrong getInterface status: "+e.status))})).catch((function(e){r(new Error("Get interface failed --\x3e "+e))}))}))}function B(e,t){return g.info("DFU","getConfigurationDescriptor","index "+t),new Promise((function(r,n){e.device.controlTransferIn({requestType:"standard",recipient:"device",request:O,value:t|R<<8,index:0},4).then((function(o){if("ok"==o.status){var i=o.data.getUint16(2,!0);e.device.controlTransferIn({requestType:"standard",recipient:"device",request:O,value:t|R<<8,index:0},i).then((function(e){"ok"==e.status?r(L(e.data)):n(new Error("Wrong getConfigurationDescriptor status: "+e.status))})).catch((function(e){n(e)}))}else n(new Error("Wrong getConfigurationDescriptor status: "+o.status))})).catch((function(e){n(new Error("Get configuration descriptor failed --\x3e "+e))}))}))}function z(e,t){return g.info("DFU","getStringDescriptor","index "+t),new Promise((function(r,n){e.device.controlTransferIn({requestType:"standard",recipient:"device",request:O,value:t|D<<8,index:F},255).then((function(e){"ok"==e.status?(e.data.getInt8(1)!=D&&n(new Error("Wrong descriptor type: "+e.data.getInt8(1))),r(new TextDecoder("utf-16").decode(new Uint16Array(e.data.buffer,2)))):n(new Error("Wrong getStringDescriptor status: "+e.status))})).catch((function(e){n(new Error("Get string descriptor failed --\x3e "+e))}))}))}var j={Offset:0,Size:11,Signature:{Offset:0,Size:5}},V={Offset:11,TargetPrefix:{Offset:0,Size:274,Signature:{Offset:0,Size:6},NbElements:{Offset:270,Size:4}},Element:{Offset:274,Address:{Offset:0,Size:4},Size:{Offset:4,Size:4},Data:{Offset:8}}},G=1,$=2,X=3,K=4,q=5,W=6,Y=0,Z=2,J=4,Q=5,ee=7,te=10,re=33,ne=65,oe=function(e){A(r,e);var t=k(r);function r(){S(this,r);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.call.apply(t,[this,"DFUError"].concat(n))}return _(r)}(d),ie=function(e){A(r,e);var t=k(r);function r(){S(this,r);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.call.apply(t,[this,"DFUInterfaceError"].concat(n))}return _(r)}(d);function ae(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return g.info("DFU","requestIn","bRequest: "+t,"data: "+r,"wValue: "+n),new Promise((function(o,i){e.device.controlTransferIn({requestType:"class",recipient:"interface",request:t,value:n,index:e.settings.interface.interfaceNumber},r).then((function(e){"ok"==e.status?o(e.data):i(new Error("Wrong requestIn status: "+e.status))})).catch((function(e){i(new Error("ControlTransferIn failed --\x3e "+e))}))}))}function se(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return g.info("DFU","requestOut","bRequest: "+t,"data: "+r,"wValue: "+n),new Promise((function(o,i){e.device.controlTransferOut({requestType:"class",recipient:"interface",request:t,value:n,index:e.settings.interface.interfaceNumber},r).then((function(e){"ok"==e.status?o(e.bytesWritten):i(new Error("Wrong requestOut status: "+e.status))})).catch((function(e){i(new Error("ControlTransferOut failed --\x3e "+e))}))}))}function ue(e){return g.info("DFU","getState"),new Promise((function(t,r){ae(e,q,1).then((function(e){t(e.getUint8(0))})).catch((function(e){r(new Error("Get state failed --\x3e "+e))}))}))}function ce(e){return g.info("DFU","getStatus"),new Promise((function(t,r){ae(e,X,6).then((function(e){t({status:e.getUint8(0),pollTimeout:16777215&e.getUint32(1,!0),state:e.getUint8(4)})})).catch((function(e){r(new Error("Get status failed --\x3e "+e))}))}))}function le(e){return fe.apply(this,arguments)}function fe(){return fe=b(t().mark((function e(r){var n;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g.info("DFU","abortToIdle"),e.prev=1,e.next=4,se(r,W);case 4:return e.next=6,ue(r);case 6:if((n=e.sent)!=te){e.next=13;break}return e.next=10,se(r,K);case 10:return e.next=12,ue(r);case 12:n=e.sent;case 13:if(n==Z){e.next=15;break}throw new Error("State is "+n.state+"instead of DFU IDLE (2).");case 15:e.next=20;break;case 17:throw e.prev=17,e.t0=e.catch(1),new Error("Abort to idle failed --\x3e "+e.t0);case 20:case"end":return e.stop()}}),e,null,[[1,17]])}))),fe.apply(this,arguments)}function he(e,t){return de.apply(this,arguments)}function de(){return de=b(t().mark((function e(r,n){var o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=function(e){return new Promise((function(t,r){setTimeout(t,e)}))},g.info("DFU","pollUntil",n),e.prev=2,e.next=5,ce(r);case 5:i=e.sent;case 6:if(n(i.state)||i.state==te){e.next=14;break}return e.next=9,o(i.pollTimeout);case 9:return e.next=11,ce(r);case 11:i=e.sent,e.next=6;break;case 14:return e.abrupt("return",i);case 17:throw e.prev=17,e.t0=e.catch(2),new Error("Poll until failed --\x3e "+e.t0);case 20:case"end":return e.stop()}}),e,null,[[2,17]])}))),de.apply(this,arguments)}function pe(e,t){return me.apply(this,arguments)}function me(){return me=b(t().mark((function e(r,n){var o,i,a;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g.info("DFU","setAddress",Number(n).toString(16)),o=new ArrayBuffer(5),(i=new DataView(o)).setUint8(0,re),i.setUint32(1,n,!0),e.prev=5,e.next=8,se(r,G,o,0);case 8:return e.next=10,he(r,(function(e){return e!=J}));case 10:if((a=e.sent).status==Y){e.next=13;break}throw"Status is "+a.status+" instead of Status OK (0).";case 13:e.next=18;break;case 15:throw e.prev=15,e.t0=e.catch(5),"Set address to "+n+" failed --\x3e "+e.t0;case 18:case"end":return e.stop()}}),e,null,[[5,15]])}))),me.apply(this,arguments)}const ge=function(){function e(r,n){S(this,e),this.open=b(t().mark((function e(){var r,n,o;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g.info("DFU","open"),e.prev=1,e.next=4,this.device.open();case 4:e.next=9;break;case 6:throw e.prev=6,e.t0=e.catch(1),new oe("OPEN failed --\x3e "+e.t0);case 9:if(r=this.settings.configuration.configurationValue,null!=this.device.configuration&&this.device.configuration.configurationValue==r){e.next=19;break}return e.prev=11,e.next=14,this.device.selectConfiguration(r);case 14:e.next=19;break;case 16:throw e.prev=16,e.t1=e.catch(11),new oe("OPEN failed: could not select configuration --\x3e "+e.t1);case 19:if(n=this.settings.interface.interfaceNumber,this.device.configuration.interfaces[n].claimed){e.next=29;break}return e.prev=21,e.next=24,this.device.claimInterface(n);case 24:e.next=29;break;case 26:throw e.prev=26,e.t2=e.catch(21),new ie("OPEN failed: could not claim interface --\x3e "+e.t2);case 29:if(o=this.settings.alternate.alternateSetting,null!=this.device.configuration.interfaces[n].alternate&&this.device.configuration.interfaces[n].alternate==o){e.next=39;break}return e.prev=31,e.next=34,this.device.selectAlternateInterface(n,o);case 34:e.next=39;break;case 36:throw e.prev=36,e.t3=e.catch(31),new oe("OPEN failed: could not select alternate interface --\x3e "+e.t3);case 39:case"end":return e.stop()}}),e,this,[[1,6],[11,16],[21,26],[31,36]])}))),this.close=b(t().mark((function e(){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g.info("DFU","close"),e.prev=1,e.next=4,this.device.close();case 4:e.next=9;break;case 6:throw e.prev=6,e.t0=e.catch(1),new oe("CLOSE failed --\x3e "+e.t0);case 9:case"end":return e.stop()}}),e,this,[[1,6]])}))),this.getMemoryLayout=b(t().mark((function e(){var r,n=this;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g.info("DFU","getMemoryLayout"),e.prev=1,e.delegateYield(t().mark((function e(){var r,o,i,a,s,u,c,l,f;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,H(n);case 2:return r=e.sent,e.next=5,B(n,r-1);case 5:return o=e.sent,e.next=8,U(n);case 8:return i=e.sent,a=o.interfaces[i].iInterface,e.next=12,z(n,a);case 12:for(s=e.sent,u=s.split("/"),c=[],l=function(e){var t=parseInt(u[e]),r=u[e+1].split(","),n=/(\d+)\*(\d+)([K|M])g/;r.forEach((function(e){var r=e.match(n),o=parseInt(r[1]),i=parseInt(r[2]),a=r[3];"K"==a?i*=1024:"M"==a&&(i*=1048576);var s=o*i,u={address:t,lastAddress:t+s-1,size:s,nbPage:o,pageSize:i};c.push(u),t+=s}))},f=1;f<u.length;f+=2)l(f);return e.abrupt("return",{v:c});case 18:case"end":return e.stop()}}),e)}))(),"t0",3);case 3:if("object"!=typeof(r=e.t0)){e.next=6;break}return e.abrupt("return",r.v);case 6:e.next=11;break;case 8:throw e.prev=8,e.t1=e.catch(1),new oe("GET MEMORY LAYOUT failed --\x3e "+e.t1);case 11:case"end":return e.stop()}}),e,null,[[1,8]])}))),this.upload=function(){var e=b(t().mark((function e(r,n,o){var i,a,s,u,c,l;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g.info("DFU","upload","address "+Number(r).toString(16),"Length "+Number(n).toString(16)),e.prev=1,e.next=4,ue(this);case 4:if(e.sent==Z){e.next=8;break}return e.next=8,le(this);case 8:return e.next=10,pe(this,r);case 10:return e.next=12,le(this);case 12:i=2,a=new Uint8Array(n),s=0,o&&o(0);case 16:return c=Math.min(this.TransferSize,n-s),g.info("DFU","upload","block number "+i,"bytes to read "+c),e.next=20,ae(this,$,c,i++);case 20:(u=e.sent).byteLength>0&&(l=new Uint8Array(u.buffer),a.set(l,s),s+=u.byteLength),o&&o(s/n);case 23:if(s<n){e.next=16;break}case 24:return e.next=26,le(this);case 26:return e.abrupt("return",a);case 29:return e.prev=29,e.t0=e.catch(1),e.next=33,le(this);case 33:throw new oe("UPLOAD failed at address "+r+" of length "+n+" --\x3e "+e.t0);case 34:case"end":return e.stop()}}),e,this,[[1,29]])})));return function(t,r,n){return e.apply(this,arguments)}}(),this.download=function(){var e=b(t().mark((function e(r,n,o){var i,a,s,u,c,l,f;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:g.info("DFU","download","address "+Number(r).toString(16)),e.prev=1,i=0,a=n.byteLength,s=r,o&&o(0);case 6:if(!(i<a)){e.next=27;break}return u=a-i,c=Math.min(u,this.TransferSize),g.info("DFU","download step, at address "+Number(r).toString(16)),l=0,f=void 0,e.next=14,pe(this,s);case 14:return e.next=16,se(this,G,n.slice(i,i+c),2);case 16:return l=e.sent,e.next=19,he(this,(function(e){return e==Q||e==Z}));case 19:if(f=e.sent,s+=c,f.status==Y){e.next=23;break}throw"state=".concat(f.state,", status=").concat(f.status);case 23:i+=l,o&&o(i/a),e.next=6;break;case 27:e.next=32;break;case 29:throw e.prev=29,e.t0=e.catch(1),new oe("DOWNLOAD failed at address "+Number(r).toString(16)+" --\x3e "+e.t0);case 32:case"end":return e.stop()}}),e,this,[[1,29]])})));return function(t,r,n){return e.apply(this,arguments)}}(),this.leave=function(){var e=b(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g.info("DFU","leave","address "+Number(r).toString(16)),e.prev=1,e.next=4,pe(this,r);case 4:return e.next=6,se(this,G,new ArrayBuffer,2);case 6:return e.next=8,he(this,(function(e){return e==ee}));case 8:e.next=13;break;case 10:throw e.prev=10,e.t0=e.catch(1),new oe("LEAVE failed at address "+Number(r).toString(16)+" --\x3e "+e.t0);case 13:case"end":return e.stop()}}),e,this,[[1,10]])})));return function(t){return e.apply(this,arguments)}}(),this.eraseSegment=function(){var e=b(t().mark((function e(r){var n,o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g.info("DFU","eraseSegment","address "+Number(r).toString(16)),e.prev=1,e.next=4,ue(this);case 4:if(e.sent==Z){e.next=8;break}return e.next=8,le(this);case 8:return n=new ArrayBuffer(5),(o=new DataView(n)).setUint8(0,ne),o.setUint32(1,r,!0),e.next=14,se(this,G,n,0);case 14:return e.next=16,ce(this);case 16:if((i=e.sent).state==J){e.next=19;break}throw"wrong DFU state: "+i.state;case 19:return e.next=21,he(this,(function(e){return e!=J}));case 21:if((i=e.sent).status==Y){e.next=24;break}throw"wrong DFU status: "+i.status;case 24:e.next=29;break;case 26:throw e.prev=26,e.t0=e.catch(1),new oe("ERASE SEGMENT failed at address "+r+" --\x3e "+e.t0);case 29:case"end":return e.stop()}}),e,this,[[1,26]])})));return function(t){return e.apply(this,arguments)}}(),this.TransferSize=n,this.device=r;var o,i=y(r.configurations);try{for(i.s();!(o=i.n()).done;){var a,s=o.value,u=y(s.interfaces);try{for(u.s();!(a=u.n()).done;){var c,l=a.value,f=y(l.alternates);try{for(f.s();!(c=f.n()).done;){var h=c.value;if(254==h.interfaceClass&&1==h.interfaceSubclass&&(1==h.interfaceProtocol||2==h.interfaceProtocol))return this.settings={configuration:s,interface:l,alternate:h},this}}catch(e){f.e(e)}finally{f.f()}}}catch(e){u.e(e)}finally{u.f()}}}catch(e){i.e(e)}finally{i.f()}return this.settings={configuration:{configurationValue:1},interface:{interfaceNumber:0},alternate:{alternateSetting:0}},this}return _(e,null,[{key:"Parse",value:function(e){new DataView(e);var t=new TextDecoder("utf-8").decode(new Uint8Array(e.slice(j.Signature.Offset,j.Signature.Offset+j.Signature.Size)));if("DfuSe"!=t)throw new oe("Parsed file is not a DFU file (invalid signature)");var r=e.slice(V.Offset);if("Target"!=(t=new TextDecoder("utf-8").decode(new Uint8Array(r.slice(V.TargetPrefix.Signature.Offset,V.TargetPrefix.Signature.Size)))))throw new oe("Corrupted DFU file (invalid target signature)");for(var n=[],o=new DataView(r,V.TargetPrefix.NbElements.Offset,V.TargetPrefix.NbElements.Offset+V.TargetPrefix.NbElements.Size).getUint32(0,!0),i=r.slice(V.Element.Offset),a=0;a<o;a++){var s=new DataView(i,V.Element.Address.Offset,V.Element.Address.Offset+V.Element.Address.Size).getUint32(0,!0),u=new DataView(i,V.Element.Size.Offset,V.Element.Address.Offset+V.Element.Size.Size).getUint32(0,!0),c=i.slice(V.Element.Data.Offset,V.Element.Data.Offset+u);i=i.slice(V.Element.Data.Offset+u),n.push({address:s,size:u,data:c})}return n}}]),e}();function ye(e){return new TextDecoder("utf-8").decode(e.subarray(0,e.indexOf(0)))}function ve(e){var t=new TextEncoder("utf-8").encode(e),r=new Uint8Array(t.length+1);return r.set(t,0),r.set([0],t.length),r}function we(e){for(var t=new Uint8Array(e.length/2),r=0;r<t.length;r++)t[r]=parseInt(e.substr(2*r,2),16);return t}function be(e){for(var t=atob(e),r="",n=0;n<t.length;n++){var o=t.charCodeAt(n).toString(16);r+=2===o.length?o:"0"+o}return r.toUpperCase()}function Ee(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return _e(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _e(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function _e(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Se(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,n.key,n)}}function Ae(e,t,r){return t&&Se(e.prototype,t),r&&Se(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ke(e,t){return ke=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ke(e,t)}function Ce(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=Oe(e);if(t){var o=Oe(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Pe(this,r)}}function Pe(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Oe(e){return Oe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Oe(e)}var Te=function(e){!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&&ke(e,t)}(r,e);var t=Ce(r);function r(){Ie(this,r);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.call.apply(t,[this,"StorageError"].concat(n))}return Ae(r)}(d);function xe(e){return new DataView(e.buffer,e.byteOffset).getUint16(0,!0)}function Re(e){var t={size:0,name:"unknown",content:"unknown"};return t.size=xe(e),t.name=ye(e.subarray(2)),t.content=e.subarray(2+t.name.length+1,t.size),t}var De=function(e){function t(e){Ie(this,t),this.records=e}return Ae(t,[{key:Symbol.iterator,value:function(){var e=this.records;return{next:function(){var t=xe(e);if(0===t)return{done:!0};var r=Re(e);return e=e.subarray(t),{value:r,done:!1}}}}}]),t}();const Me=Ae((function e(t){Ie(this,e),this.availableSize=function(){var e,t=0,r=Ee(new De(this.data));try{for(r.s();!(e=r.n()).done;){t+=e.value.size}}catch(e){r.e(e)}finally{r.f()}return this.totalSize()-t},this.totalSize=function(){return this.data.byteLength-2},this.recordsWithExtension=function(e){var t,r=[],n=Ee(new De(this.data));try{for(n.s();!(t=n.n()).done;){var o=t.value;o.name.endsWith(e)&&r.push(o.name)}}catch(e){n.e(e)}finally{n.f()}return r},this.size=function(e){var t,r=Ee(new De(this.data));try{for(r.s();!(t=r.n()).done;){var n=t.value;if(n.name===e)return n.size}}catch(e){r.e(e)}finally{r.f()}},this.content=function(e){var t,r=Ee(new De(this.data));try{for(r.s();!(t=r.n()).done;){var n=t.value;if(n.name===e)return n.content}}catch(e){r.e(e)}finally{r.f()}},this.setContent=function(e,t){var r,n=0,o=0,i=Ee(new De(this.data));try{for(i.s();!(r=i.n()).done;){var a=r.value;if(a.name===e){o=a.size;break}n+=a.size}}catch(e){i.e(e)}finally{i.f()}var s=this.data.slice(n+o),u=n,c=function(e,t){if(void 0!==t){var r=e.length+1+t.byteLength+2,n=new Uint8Array(r);return new DataView(n.buffer,n.byteOffset).setUint16(0,r,!0),n.set(ve(e),2),n.set(t,2+e.length+1),n}}(e,t);if(void 0!==c){if(Re(c).size>this.availableSize()+o)throw new Te("The storage on calculator is full");this.data.set(c,n),u+=c.length,s=s.slice(0,this.data.length-(n+c.length))}this.data.set(s,u),this.data.fill(0,u+s.length)},this.data=t}));function Fe(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Ne(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ne(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function Ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Le(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function He(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Le(i,n,o,a,s,"next",e)}function s(e){Le(i,n,o,a,s,"throw",e)}a(void 0)}))}}function Ue(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,n.key,n)}}function Be(e,t,r){return t&&Ue(e.prototype,t),r&&Ue(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ze(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function je(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&&Ve(e,t)}function Ve(e,t){return Ve=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ve(e,t)}function Ge(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=Xe(e);if(t){var o=Xe(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return $e(this,r)}}function $e(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Xe(e){return Xe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Xe(e)}var Ke=we("F00DC0DE"),qe=we("FEEDC0DE"),We=we("BADBEEEF"),Ye=function(e){je(r,e);var t=Ge(r);function r(){ze(this,r);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.call.apply(t,[this,"CalculatorMemoryCorruption"].concat(n))}return Be(r)}(d),Ze=function(e){je(r,e);var t=Ge(r);function r(){ze(this,r);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.call.apply(t,[this,"BusyCalculatorError"].concat(n))}return Be(r)}(d),Je=function(e){je(r,e);var t=Ge(r);function r(){ze(this,r);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.call.apply(t,[this,"WebUSBError"].concat(n))}return Be(r)}(d),Qe=function(e){je(r,e);var t=Ge(r);function r(){ze(this,r);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.call.apply(t,[this,"USBConnectionError"].concat(n))}return Be(r)}(d),et=function(e){je(r,e);var t=Ge(r);function r(){ze(this,r);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.call.apply(t,[this,"ForbiddenMemoryAccessError"].concat(n))}return Be(r)}(d),tt={N0100:{name:"N0100",RAMAddressStart:536870912,RAMAddressEnd:537133056},N0110:{name:"N0110",RAMAddressStart:536870912,RAMAddressEnd:537133056},N0120:{name:"N0120",RAMAddressStart:603979776,RAMAddressEnd:604307456},N0120Prototype:{displayed_name:"N0120",name:"N0120_PORTUGAL_PROTOTYPE_20210930",RAMAddressStart:603979776,RAMAddressEnd:604307456}},rt=we("BADD0BEE");function nt(e,t){if(e.length<t.length)return!1;for(var r=0;r<t.length;r++)if(e[r]!==t[r])return!1;return!0}function ot(e,t){return!(e.length<t.length)&&nt(e.subarray(e.length-t.length),t)}function it(e,t){if(!(e>=134217728&&e+t<=135266304||e>=2415919104&&e+t<=2424307712))throw new et("Access to address: "+e+" (length "+t+") is out of flash range")}function at(e,t,r){if(t<e.RAMAddressStart||t+r>=e.RAMAddressEnd)throw new et("Access to address: "+t+" (length "+r+") is out of RAM range")}function st(e){if(g.info("Calculator","parseSlotInfo","header info "+e),!nt(e,We)||!ot(e,We))return null;var t=new DataView(e.buffer,e.byteOffset);return{kernelHeaderAddress:t.getUint32(4,!0),userlandHeaderAddress:t.getUint32(8,!0)}}function ut(e,t){if(g.info("Calculator","parseFirmwareHeader","header "+e),!nt(e,Ke))return t;t.version=ye(e.subarray(4)),t.patch=ye(e.subarray(12));var r=e.subarray(20);if(nt(r,Ke))return t;var n=new DataView(e.buffer,e.byteOffset);return t.storageAddress=n.getUint32(20,!0),nt(r=e.subarray(24),Ke)||(t.storageSize=n.getUint32(24,!0)),t}function ct(e,t){if(g.info("Calculator","parseUserlandHeader","header "+e),!nt(e,qe))return t;t.userlandVersion=ye(e.subarray(4));var r=new DataView(e.buffer,e.byteOffset),n=12;return t.storageAddress=r.getUint32(n,!0),n+=4,t.storageSize=r.getUint32(n,!0),n+=4,t.externalAppsFlashStart=r.getUint32(n,!0),n+=4,t.externalAppsFlashEnd=r.getUint32(n,!0),n+=4,t.externalAppsRamStart=r.getUint32(n,!0),n+=4,t.externalAppsRamEnd=r.getUint32(n,!0),t}function lt(){return(lt=He(t().mark((function e(r,n,o){var i,a,s,u,c,l,f,h;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g.info("Calculator","uploadHeader","address "+Number(n[0].address).toString(16)),i={version:"0.0.0",patch:"0000000",userlandVersion:"unknown",externalAppsFlashStart:"unknown",externalAppsFlashEnd:"unknown",externalAppsRamStart:"unknown",externalAppsRamEnd:"unknown",storageAddress:"unknown",storageSize:4096},e.prev=2,a=n[0].address+pt.Header0.Offset,s=pt.Header0.Size,it(a,s),e.next=8,r.upload(a,s);case 8:if(!nt(u=e.sent,Ke)||!ot(u,Ke)){e.next=13;break}return e.abrupt("return",ut(u,i));case 13:return a=n[0].address+pt.Header1.Offset,s=pt.Header1.Size,it(a,s),e.next=18,r.upload(a,s);case 18:if(!nt(u=e.sent,Ke)||!ot(u,Ke)){e.next=23;break}return e.abrupt("return",ut(u,i));case 23:return a=o.RAMAddressStart,s=pt.Header2.SlotInfoSize,at(o,a,s),e.prev=26,e.next=29,r.upload(a,s);case 29:if(c=e.sent,null!=(l=st(c))){e.next=33;break}throw new Ye("The slot info was corrupted");case 33:return a=l.kernelHeaderAddress,s=pt.Header2.KernelHeaderSize,it(a,s),e.next=38,r.upload(a,s);case 38:return f=e.sent,i=ut(f,i),a=l.userlandHeaderAddress,s=pt.Header2.UserlandHeaderSize,it(a,s),e.next=45,r.upload(a,s);case 45:return h=e.sent,i=ct(h,i),e.abrupt("return",i);case 50:return e.prev=50,e.t0=e.catch(26),e.abrupt("return",ut(u,i));case 53:e.next=59;break;case 55:throw e.prev=55,e.t1=e.catch(2),e.t1.message="Upload header failed --\x3e "+e.t1.message,e.t1;case 59:case"end":return e.stop()}}),e,null,[[2,55],[26,50]])})))).apply(this,arguments)}function ft(e,t){if(g.info("Calculator","calculatorGetStorage","address "+Number(t.firmware.storageAddress).toString(16)),"unknown"===t.firmware.storageAddress)throw new Ye("The Storage address could not be found in header");try{at(t.model,t.firmware.storageAddress,t.firmware.storageSize+2*rt.length)}catch(e){throw new Ye("Calculator Get Storage failed --\x3e "+e)}return!1!==e.storage?e.storage:new Promise((function(r,n){e.dfu.upload(t.firmware.storageAddress,t.firmware.storageSize+2*rt.length).then((function(o){if(nt(o,rt)&&ot(o,rt)){var i=o.subarray(rt.length,t.firmware.storageSize+rt.length);e.storage=new Me(i),r(e.storage)}else n(new Ye("Memory is corrupted: could not find storage tags"))})).catch((function(e){e.message="CalculationGetStorage failed --\x3e "+e.message,n(e)}))}))}function ht(e,t,r){g.info("Calculator","calculatorSetStorage","address "+Number(t.firmware.storageAddress).toString(16));try{at(t.model,t.firmware.storageAddress+rt.length,r.data)}catch(e){throw new Ye("Calculator Set Storage failed --\x3e "+e)}return new Promise((function(n,o){e.dfu.download(t.firmware.storageAddress+rt.length,r.data).then((function(){n(!0)})).catch((function(e){e.message="CalculationSetStorage failed --\x3e "+e.message,o(e)}))}))}function dt(e){var t=ve(e),r=new Uint8Array(t.length+1);return r[0]=1,r.set(t,1),r}var pt=function(){function e(){ze(this,e),this.dfu=!1,this.running=!1,this.storage=!1,this.infos=!1}return Be(e,[{key:"connectAndProcess",value:function(t){var r,n=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[e.Product.Numworks],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return g.info("Calculator","connectAndProcess"),new Promise((function(e,a){n.running?new Promise((function(e,t){e(!0)})).then((function(){return a(new Ze("Calculator is already processing another request"))})):(n.running=!0,n.connect(o,i).then((function(o){if(!o.connected())return n.running=!1,a(new Qe("No usb connection found"));n.dfu.open().then((function(){return t(o)})).then((function(e){if(r=e,n.dfu.opened)return n.dfu.close()})).then((function(){return n.running=!1,e(r)})).catch((function(e){return n.running=!1,a(e)}))})).catch((function(e){n.running=!1,a(e)})))}))}},{key:"connected",value:function(){return!1!==this.dfu}},{key:"connect",value:function(t,r){var n=this;g.info("Calculator","connect",t),this.storage=!1,this.dfu=!1,this.infos=!1;var o=t.map((function(t){return t==e.Product.Numworks?41617:57105})),i=[];return o.forEach((function(e){return i.push({vendorId:1155,productId:e})})),new Promise((function(e,t){null==navigator.usb?new Promise((function(e,t){e(!0)})).then((function(){return t(new Je("Web usb unvailable"))})):r?(g.info("Calculator","connect","request device"),navigator.usb.requestDevice({filters:i}).then((function(t){return n.dfu=new ge(t,2048),e(n)})).catch((function(e){t(new Qe("Usb device selection failure: "+e))}))):(g.info("Calculator","connect","get device"),navigator.usb.getDevices().then((function(t){var r,i=Fe(t);try{for(i.s();!(r=i.n()).done;){var a=r.value;1155===a.vendorId&&o.includes(a.productId)&&(n.dfu=new ge(a,2048))}}catch(e){i.e(e)}finally{i.f()}return e(n)})).catch((function(e){t(new Qe("Usb device failed: "+e))})))}))}},{key:"getInfos",value:function(){var e=this;return g.info("Calculator","getInfos"),new Promise((function(t,r){var n,o;return!1!==e.infos?t(e.infos):e.dfu.getMemoryLayout().then((function(t){return n=t,o=function(e,t){if("NumWorks Calculator"==e.productName&&2==e.deviceVersionMinor)return"EAAbABVROTUxNDM4"==e.serialNumber?tt.N0120Prototype:tt.N0120;var r=t[t.length-1].lastAddress;return r>135135232&&r<2415919104?tt.N0100:tt.N0110}(e.dfu.device,n),function(e,t,r){return lt.apply(this,arguments)}(e.dfu,n,o)})).then((function(t){e.infos={serialNumber:be(e.dfu.device.serialNumber),displayedSerialNumber:e.dfu.device.serialNumber,model:o,memoryLayout:n,firmware:t}})).then((function(){t(e.infos)})).catch((function(e){e.message="getInfos failed --\x3e "+e.message,r(e)}))}))}},{key:"uploadFlash",value:function(e,t,r){var n=this;return g.info("Calculator","uploadFlash","address "+Number(e).toString(16),"length "+Number(t).toString(16)),new Promise((function(o,i){try{it(e,t)}catch(e){e.message="uploadFlash failed --\x3e "+e.message,i(e)}n.dfu.upload(e,t,r).then((function(e){o(e)})).catch((function(e){e.message="uploadFlash failed --\x3e "+e.message,i(e)}))}))}},{key:"downloadFlash",value:function(e,r,n,o,i){var a=this;return g.info("Calculator","downloadFlash","address "+Number(e).toString(16)),new Promise((function(s,u){var c=function(){var e=He(t().mark((function e(r,n,o,i,a){var s,u,c,l,f,h,d,p,m,g,y,v,w;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=0,u=0,c=-1,l=-1,f=-1,h=-1,d=0;case 7:if(!(d<n.length)){e.next=33;break}if(!(c<0)){e.next=14;break}if(!(o>n[d].lastAddress)){e.next=13;break}return e.abrupt("continue",30);case 13:c=d;case 14:p=0;case 15:if(!(p<n[d].nbPage)){e.next=30;break}if(!(l<0)){e.next=22;break}if(o!=n[d].address+p*n[d].pageSize){e.next=21;break}l=p,e.next=22;break;case 21:return e.abrupt("continue",27);case 22:if(!((s+=n[d].pageSize)>=i.byteLength)){e.next=27;break}return f=d,h=p,e.abrupt("break",33);case 27:p++,e.next=15;break;case 30:d++,e.next=7;break;case 33:m=c;case 34:if(!(m<=f)){e.next=51;break}g=m==c?l:0,y=m==f?h+1:n[m].nbPage,v=g;case 38:if(!(v<y)){e.next=48;break}return w=n[m].address+v*n[m].pageSize,e.next=42,r.eraseSegment(w);case 42:u+=n[m].pageSize,a(u/s),w+=n[m].pageSize;case 45:v++,e.next=38;break;case 48:m++,e.next=34;break;case 51:case"end":return e.stop()}}),e)})));return function(t,r,n,o,i){return e.apply(this,arguments)}}();try{it(e,r.byteLength)}catch(e){e.message="downloadFlash failed --\x3e "+e.message,u(e)}c(a.dfu,n.memoryLayout,e,r,(function(e){return o(e)})).then((function(){s(a.dfu.download(e,r,(function(e){return i(e)})))})).catch((function(e){e.message="downloadFlash failed --\x3e "+e.message,u(e)}))}))}},{key:"reset",value:function(e){var t=this;return g.info("Calculator","reset"),new Promise((function(r,n){try{it(e.memoryLayout[0].address,0)}catch(e){e.message="reset failed --\x3e "+e.message,n(e)}return t.dfu.leave(134217728).then((function(e){r(!0)})).catch((function(e){e.message="reset failed --\x3e "+e.message,n(e)}))}))}},{key:"getAvailableSpaceInfo",value:function(){var e=this;return g.info("Calculator","getAvailableSpaceInfo"),new Promise((function(t,r){var n={availableSize:!1,totalSize:!1};e.getInfos().then((function(t){return ft(e,t)})).then((function(e){n.availableSize=e.availableSize(),n.totalSize=e.totalSize(),t(n)})).catch((function(e){e.message="getAvailableSpaceInfo failed --\x3e "+e.message,r(e)}))}))}},{key:"getScripts",value:function(){var e=this;return g.info("Calculator","getScripts"),new Promise((function(t,r){e.getInfos().then((function(t){return ft(e,t)})).then((function(e){return e.recordsWithExtension(".py").map((function(t,r){return{name:t,size:e.size(t),content:ye(e.content(t).subarray(1))}}))})).then((function(e){t(e)})).catch((function(e){e.message="getScripts failed --\x3e "+e.message,r(e)}))}))}},{key:"removeScripts",value:function(){var e=this;return g.info("Calculator","removeScripts"),new Promise((function(t,r){e.getInfos().then((function(t){return ft(e,t)})).then((function(t){t.recordsWithExtension(".py").map((function(e,r){t.setContent(e)}));return ht(e,e.infos,t)})).then((function(){t(!0)})).catch((function(e){e.message="removeScripts failed --\x3e "+e.message,r(e)}))}))}},{key:"getSizeForRecord",value:function(e){var t=this;return g.info("Calculator","getSizeForRecord","name "+e),new Promise((function(r,n){var o;t.getInfos().then((function(e){return ft(t,e)})).then((function(t){o=t.size(e),r(o)})).catch((function(e){e.message="getSizeForRecord failed --\x3e "+e.message,n(e)}))}))}},{key:"setContentForRecord",value:function(e,t){var r=this;return g.info("Calculator","setContentForRecord","name "+e),new Promise((function(n,o){r.getInfos().then((function(e){return ft(r,e)})).then((function(n){try{n.setContent(e,t)}catch(e){o(e)}return ht(r,r.infos,n)})).then((function(){n(!0)})).catch((function(e){e.message="setContentForRecord failed --\x3e "+e.message,o(e)}))}))}},{key:"setContentForScript",value:function(e,t){var r=this;return g.info("Calculator","setContentForScript","name "+e),new Promise((function(n,o){r.setContentForRecord(e,dt(t)).then((function(){n(!0)})).catch((function(e){e.message="setContentForScript failed --\x3e "+e.message,o(e)}))}))}},{key:"setRecords",value:function(e){var t=this;return g.info("Calculator","setRecords",e),new Promise((function(r,n){t.getInfos().then((function(e){return ft(t,e)})).then((function(t){try{e.forEach((function(e,r){t.setContent(e.name,e.content)}))}catch(e){n(e)}return t})).then((function(e){return ht(t,t.infos,e)})).then((function(){r(!0)})).catch((function(e){e.message="setRecords failed --\x3e "+e.message,n(e)}))}))}},{key:"setScripts",value:function(e){var t=this;return g.info("Calculator","setScripts",e),new Promise((function(r,n){var o=[];e.forEach((function(e,t){o[t]={name:e.name,content:dt(e.content)}})),t.setRecords(o).then((function(){r(!0)})).catch((function(e){e.message="setScripts failed --\x3e "+e.message,n(e)}))}))}},{key:"removeRecord",value:function(e){var t=this;return g.info("Calculator","removeRecord","name "+e),new Promise((function(r,n){t.getInfos().then((function(e){return ft(t,e)})).then((function(r){return r.setContent(e),ht(t,t.infos,r)})).then((function(){r(!0)})).catch((function(e){e.memory="removeRecord failed --\x3e "+e.message,n(e)}))}))}}],[{key:"CheckFirmware",value:function(e,t){for(var r=0;r<t.byteLength;r++)if(e[r]!=t[r])throw new Ye("The uploaded firmware differs from the reference at byte "+r);return!0}}]),e}();pt.Product={Numworks:"numworks",ST:"ST"},pt.Header0={Offset:428,Size:24},pt.Header1={Offset:452,Size:32},pt.Header2={SlotInfoSize:16,KernelHeaderSize:24,UserlandHeaderSize:40};const mt=pt;r(382);var gt=r(280),yt=(r(8744),r(5405)),vt=r(5477);function wt(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,n.key,n)}}function bt(e,t){return Math.round(255/((1<<t)-1)*e)}var Et=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.rgba8888Data=t}var t,r,n;return t=e,n=[{key:"fromPNG",value:function(t){var r=vt.y.sync.read(t);if(r.width!=e.Width)throw"Icon has an invalid width";if(r.height!=e.Height)throw"Icon has an invalid height";return new e(r.data)}},{key:"fromNWI",value:function(t){console.log("Creating image from NWI",t);var r=new Uint8Array(e.Width*e.Height*2);yt.decompressBlock(t,r,0,t.length,0);var n=function(e){for(var t=e.length/2,r=new Uint8Array(4*t),n=0;n<t;n++){var o=e[2*n+1]<<8|e[2*n],i=o>>11&31,a=o>>5&63,s=31&o;r[4*n]=bt(i,5),r[4*n+1]=bt(a,6),r[4*n+2]=bt(s,5),r[4*n+3]=255}return r}(r);return new e(n)}}],(r=[{key:"toPNG",value:function(){console.log("this.rgba8888Data",this.rgba8888Data);var t=new ImageData(new Uint8ClampedArray(this.rgba8888Data.buffer),e.Width,e.Height),r=document.createElement("canvas");return r.width=e.Width,r.height=e.Height,r.getContext("2d").putImageData(t,0,0),r.toDataURL()}},{key:"toNWI",value:function(){var e=function(e){for(var t=e.length/4,r=new Uint8Array(2*t),n=0;n<t;n++){var o=e[4*n]>>3<<11|e[4*n+1]>>2<<5|e[4*n+2]>>3;r[2*n]=255&o,r[2*n+1]=o>>8&255}return r}(this.rgba8888Data),t=yt.compressBlock(e,new Uint8Array(0),0,e.length,yt.makeBuffer(65536)),r=new Uint8Array(t);return yt.compressBlock(e,r,0,e.length,yt.makeBuffer(65536)),r}}])&&wt(t.prototype,r),n&&wt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();Et.Width=55,Et.Height=56;const _t=Et;var St=r(5827),At=r.n(St),It=r(2890),kt=r.n(It);function Ct(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Pt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Pt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ot(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function Tt(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Ot(i,n,o,a,s,"next",e)}function s(e){Ot(i,n,o,a,s,"throw",e)}a(void 0)}))}}function xt(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,n.key,n)}}var Rt=r(118),Dt=r(9898),Mt=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.packedElfData=t,this.packedElfAnalysis=r,this.size=void 0,this.refreshNeedsExternalData(),this.refreshSize()}var n,o,i,a,s,u,c;return n=e,o=[{key:"name",value:function(){var e=this.dataForSymbolNamed("eadk_app_name");return(new TextDecoder).decode(e)}},{key:"refreshSize",value:(c=Tt(t().mark((function r(){var n,o;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.needsExternalData){t.next=6;break}return t.next=3,this.flatBin({flashStart:2415919104,flashLength:8388608,ramStart:536870912,ramLength:262144});case 3:n=t.sent,o=n.byteLength+(e.AppSectorSize-n.byteLength%e.AppSectorSize),this.size=o;case 6:case"end":return t.stop()}}),r,this)}))),function(){return c.apply(this,arguments)})},{key:"icon",value:function(){var e=this.dataForSymbolNamed("eadk_app_icon"),t=_t.fromNWI(e);return t.toPNG()}},{key:"flatElf",value:(u=Tt(t().mark((function e(r){var n,o;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n={arguments:["--script","linker.ld","eadk.o","app-pack.elf"],inputs:{"linker.ld":Rt(r),"app-pack.elf":this.packedElfData,"eadk.o":new Uint8Array(Dt.data)}},!this.externalData){e.next=7;break}return o="extra-data.o",n.arguments.push(o),e.next=6,this.externalObject();case 6:n.inputs[o]=e.sent;case 7:return e.next=9,this.ld(n);case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"flatBin",value:(s=Tt(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=this,e.t1=["--output-target","binary"],e.next=4,this.flatElf(r);case 4:return e.t2=e.sent,e.t3={arguments:e.t1,input:e.t2},e.next=8,e.t0.objcopy.call(e.t0,e.t3);case 8:return e.abrupt("return",e.sent);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"setExternalData",value:function(e){this.externalData=e,this.refreshNeedsExternalData(),this.refreshSize()}},{key:"symbols",value:function(){return gt.getSymbols(this.packedElfAnalysis)}},{key:"symbolNamed",value:function(e){return this.symbols().find((function(t){return t.name==e}))}},{key:"dataForSymbol",value:function(e){var t=this.sectionForSymbol(e),r=t.offset+(e.virtualAddress-t.addr);return this.packedElfData.slice(r,r+e.size)}},{key:"dataForSymbolNamed",value:function(e){return this.dataForSymbol(this.symbolNamed(e))}},{key:"sectionForSymbol",value:function(e){return this.packedElfAnalysis.sections.find((function(t){return t.addr<=e.virtualAddress&&t.addr+t.size>=e.virtualAddress+e.size}))}},{key:"ld",value:function(e){return new Promise((function(t,n){var o={locateFile:function(e,t){return r(7573)},preRun:function(){for(var t=0,r=Object.entries(e.inputs);t<r.length;t++){var n=Ct(r[t],2),i=n[0],a=n[1];o.FS.writeFile(i,a)}},onAbort:n,arguments:e.arguments.concat(["--output","output.elf"]),postRun:function(){t(o.FS.readFile("output.elf"))}};At()(o)}))}},{key:"objcopy",value:function(e){return new Promise((function(t,n){var o={locateFile:function(e,t){return r(3835)},preRun:function(){o.FS.writeFile("input.dat",e.input)},onAbort:n,arguments:e.arguments.concat(["input.dat","output.dat"]),postRun:function(){t(o.FS.readFile(e.output||"output.dat"))}};kt()(o)}))}},{key:"rgb565ToRGBA8888",value:function(e){for(var t=new Uint8ClampedArray(2*e.length),r=0;r<e.length/2;r++){var n=function(e,t){return e<<8-t},o=e[2*r+1]<<8|e[2*r],i=o>>11&31,a=o>>5&63,s=31&o;t[4*r]=n(i,5),t[4*r+1]=n(a,6),t[4*r+2]=n(s,5),t[4*r+3]=255}return t}},{key:"refreshNeedsExternalData",value:function(){var e=void 0!==this.symbolNamed("eadk_external_data"),t=void 0!==this.externalData;this.needsExternalData=e&&!t}},{key:"externalObject",value:function(){return this.objcopy({arguments:["--input-target","binary","--output-target","elf32-littlearm","--rename-section",".data=.rodata"],input:this.externalData})}}],i=[{key:"from",value:(a=Tt(t().mark((function r(n){var o;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,gt.open(n,{readSymbolData:!0});case 2:return o=t.sent,t.abrupt("return",new e(n,o.elf));case 4:case"end":return t.stop()}}),r)}))),function(e){return a.apply(this,arguments)})}],o&&xt(n.prototype,o),i&&xt(n,i),Object.defineProperty(n,"prototype",{writable:!1}),e}();Mt.AppSectorSize=65536;const Ft=Mt;function Nt(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function Lt(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Nt(i,n,o,a,s,"next",e)}function s(e){Nt(i,n,o,a,s,"throw",e)}a(void 0)}))}}function Ht(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return Ut(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ut(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function Ut(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Bt(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,n.key,n)}}function zt(e,t,r){return t&&Bt(e.prototype,t),r&&Bt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function jt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vt(e,t){return Vt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Vt(e,t)}function Gt(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=Xt(e);if(t){var o=Xt(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return $t(this,r)}}function $t(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Xt(e){return Xt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Xt(e)}var Kt=function(e){!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&&Vt(e,t)}(r,e);var t=Gt(r);function r(){jt(this,r);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return t.call.apply(t,[this,"CalculatorMemoryOverflow"].concat(n))}return zt(r)}(d);const qt=function(){function e(){jt(this,e),this.apps=[]}var r,n;return zt(e,[{key:"push",value:function(e){this.apps.push(e)}},{key:"isReadyToUpload",value:function(){var e,t=Ht(this.apps);try{for(t.s();!(e=t.n()).done;){if(e.value.needsExternalData)return!1}}catch(e){t.e(e)}finally{t.f()}return this.apps.length>0}},{key:"upload",value:(n=Lt(t().mark((function e(r,n){var o,i,a;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=r.infos.firmware,i={flashStart:o.externalAppsFlashStart,flashLength:o.externalAppsFlashEnd-o.externalAppsFlashStart,ramStart:o.externalAppsRamStart,ramLength:o.externalAppsRamEnd-o.externalAppsRamStart},e.next=4,this.flatBin(i);case 4:a=e.sent,r.downloadFlash(i.flashStart,a,r.infos,(function(e){n(.2*e)}),(function(e){n(.2+.8*e)})).then((function(){r.dfu.leave(i.flashStart)}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"concatenateU8A",value:function(e,t){var r=new Uint8Array(e.byteLength+t.byteLength);return r.set(e,0),r.set(t,e.byteLength),r}},{key:"flatBin",value:(r=Lt(t().mark((function e(r){var n,o,i,a,s,u,c,l,f,h,d;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new Uint8Array(0),o=r.flashStart+r.flashLength,i=r.flashStart,a=Ht(this.apps),e.prev=4,a.s();case 6:if((s=a.n()).done){e.next=19;break}if(u=s.value,!(i>=o)){e.next=10;break}throw new Kt("External app sector would be overflown");case 10:return e.next=12,u.flatBin({flashStart:i,flashLength:o-i,ramStart:r.ramStart,ramLength:r.ramLength});case 12:c=e.sent,n=this.concatenateU8A(n,c),i+=c.byteLength,(l=c.byteLength%Ft.AppSectorSize)>0&&(f=Ft.AppSectorSize-l,(h=new Uint8Array(f)).fill(255),n=this.concatenateU8A(n,h),i+=f);case 17:e.next=6;break;case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(4),a.e(e.t0);case 24:return e.prev=24,a.f(),e.finish(24);case 27:return i<o&&((d=new Uint8Array(Ft.AppSectorSize)).fill(255),n=this.concatenateU8A(n,d)),e.abrupt("return",n);case 29:case"end":return e.stop()}}),e,this,[[4,21,24,27]])}))),function(e){return r.apply(this,arguments)})},{key:"totalSize",value:function(){var e,t=0,r=Ht(this.apps);try{for(r.s();!(e=r.n()).done;){t+=e.value.size||0}}catch(e){r.e(e)}finally{r.f()}return t}},{key:"removeAppAtIndex",value:function(e){this.apps.splice(e,1)}}]),e}();function Wt(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function Yt(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Wt(i,n,o,a,s,"next",e)}function s(e){Wt(i,n,o,a,s,"throw",e)}a(void 0)}))}}r(1017).resolve;var Zt=r(7147),Jt=r(7461).Command;function Qt(e){var r=new Jt;function n(){return n=Yt(t().mark((function e(r,n){var o,i,a,s,u;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("Installing",r,"with",n),o=Zt.readFileSync(r),e.next=4,Ft.from(o);case 4:i=e.sent,n.data&&(a=Zt.readFileSync(n.data),i.setExternalData(a)),(s=new qt).push(i),(u=new mt).connectAndProcess(function(){var e=Yt(t().mark((function e(r){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("Got infos"),e.next=3,r.getInfos();case 3:e.sent,s.upload(u,(function(e){console.log("Upload progress",e)}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[mt.Product.Numworks],!0);case 10:case"end":return e.stop()}}),e)}))),n.apply(this,arguments)}function o(){return(o=Yt(t().mark((function e(r,n,o){var i,a,s,u;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Zt.readFileSync(r),e.next=3,Ft.from(i);case 3:return a=e.sent,o.data&&(s=Zt.readFileSync(o.data),a.setExternalData(s)),e.next=7,a.flatBin(o);case 7:u=e.sent,Zt.writeFileSync(n,u);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}r.name("nwlink").description("Command-line tool to interact with a NumWorks calculator").version(require("../package.json").version),r.command("install-nwa").description("Install a NWA app").argument("<input.nwa>","Input NWA file").option("-d, --external-data <file>","External data file").action((function(e,t){return n.apply(this,arguments)})),r.command("link-nwa").description("Link a NWA app").argument("<input.nwa>","Input NWA file").argument("<output.bin>","Output BIN file").option("-d, --external-data <file>","External data file").option("-fs, --flash-start <flashStart>","Flash memory start address","0x90000000").option("-fl, --flash-length <flashLength>","Flash memory length","8M").option("-rs, --ram-start <flashStart>","RAM start address","0x20000000").option("-rl, --ram-length <flashLength>","RAM length","256K").action((function(e,t,r){return o.apply(this,arguments)})),r.command("convert-nwi").description("Convert a PNG file to a NWI image (LZ4-compressed RGB565)").argument("<file.png>","Input PNG file").argument("<file.nwi>","Output NWI file").action((function(e,t){var r=Zt.readFileSync(e),n=_t.fromPNG(r);Zt.writeFileSync(t,n.toNWI())})),r.parseAsync(e)}global.navigator={usb:o.webusb}})(),module.exports=n.default})();
|