nwlink 0.0.7 → 0.0.10

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/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,"&amp;").replace(n,"&lt;").replace(o,"&gt;").replace(i,"&#39;").replace(a,"&quot;"):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,c,u,l,f,h=Object.assign({},i),p=[],d="./this.program",m=(e,t)=>{throw t},g="object"==typeof window,v="function"==typeof importScripts,y="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,_="";y?(_=v?r(1017).dirname(_)+"/":__dirname+"/",f=()=>{l||(u=r(7147),l=r(1017))},a=function(e,t){return f(),e=l.normalize(e),u.readFileSync(e,t?void 0:"utf8")},c=e=>{var t=a(e,!0);return t.buffer||(t=new Uint8Array(t)),t},s=(e,t,r)=>{f(),e=l.normalize(e),u.readFile(e,(function(e,n){e?r(e):t(n.buffer)}))},process.argv.length>1&&(d=process.argv[1].replace(/\\/g,"/")),p=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||E("exiting due to exception: "+r),process.exit(e)},i.inspect=function(){return"[Emscripten Module object]"}):(g||v)&&(v?_=self.location.href:"undefined"!=typeof document&&document.currentScript&&(_=document.currentScript.src),n&&(_=n),_=0!==_.indexOf("blob:")?_.substr(0,_.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},v&&(c=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,w=i.print||console.log.bind(console),E=i.printErr||console.warn.bind(console);Object.assign(i,h),h=null,i.arguments&&(p=i.arguments),i.thisProgram&&(d=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 C,k=!1;function x(e,t){e||ee(t)}var P,I,T,O,R,F,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 c=63&e[t++];if((a=224==(240&a)?(15&a)<<12|s<<6|c:(7&a)<<18|s<<12|c<<6|63&e[t++])<65536)i+=String.fromCharCode(a);else{var u=a-65536;i+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else i+=String.fromCharCode((31&a)<<6|s)}else i+=String.fromCharCode(a)}return i}function N(e,t){return e?M(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 j(e,t,r){return L(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}i.INITIAL_MEMORY;var B=[],U=[],z=[],V=[];function G(){return A}var $,X,q,K,W=0,Y=null,Z=null;function Q(e){W++,i.monitorRunDependencies&&i.monitorRunDependencies(W)}function J(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(e="Aborted("+e+")"),k=!0,C=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(c)return c(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,_):_+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 c=[];for(s=a;s<n.length;s++)c.push("..");return(c=c.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(y){var r=Buffer.alloc(256),n=0;try{n=u.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=we(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(w(M(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(w(M(e.output,0)),e.output=[])}},default_tty1_ops:{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=[])}}};function se(e){ee()}var ce,ue={ops_table:null,mount:function(e){return ue.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(le.isBlkdev(r)||le.isFIFO(r))throw new le.ErrnoError(63);ue.ops_table||(ue.ops_table={dir:{node:{getattr:ue.node_ops.getattr,setattr:ue.node_ops.setattr,lookup:ue.node_ops.lookup,mknod:ue.node_ops.mknod,rename:ue.node_ops.rename,unlink:ue.node_ops.unlink,rmdir:ue.node_ops.rmdir,readdir:ue.node_ops.readdir,symlink:ue.node_ops.symlink},stream:{llseek:ue.stream_ops.llseek}},file:{node:{getattr:ue.node_ops.getattr,setattr:ue.node_ops.setattr},stream:{llseek:ue.stream_ops.llseek,read:ue.stream_ops.read,write:ue.stream_ops.write,allocate:ue.stream_ops.allocate,mmap:ue.stream_ops.mmap,msync:ue.stream_ops.msync}},link:{node:{getattr:ue.node_ops.getattr,setattr:ue.node_ops.setattr,readlink:ue.node_ops.readlink},stream:{}},chrdev:{node:{getattr:ue.node_ops.getattr,setattr:ue.node_ops.setattr},stream:le.chrdev_stream_ops}});var o=le.createNode(e,t,r,n);return le.isDir(o.mode)?(o.node_ops=ue.ops_table.dir.node,o.stream_ops=ue.ops_table.dir.stream,o.contents={}):le.isFile(o.mode)?(o.node_ops=ue.ops_table.file.node,o.stream_ops=ue.ops_table.file.stream,o.usedBytes=0,o.contents=null):le.isLink(o.mode)?(o.node_ops=ue.ops_table.link.node,o.stream_ops=ue.ops_table.link.stream):le.isChrdev(o.mode)&&(o.node_ops=ue.ops_table.chrdev.node,o.stream_ops=ue.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&&ue.resizeFileStorage(e,t.size)},lookup:function(e,t){throw le.genericErrors[44]},mknod:function(e,t,r,n){return ue.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=ue.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(ue.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){ue.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);I.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||ue.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 c=le.readlink(o);if(o=ie.resolve(oe.dirname(o),c),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&&E("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:[]},c=e.mount(s);return c.mount=s,s.root=c,o?le.root=c:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),c},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 c,u=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{c=le.lookupNode(n,s)}catch(e){}if(u!==c){var f=le.isDir(u.mode),h=le.mayDelete(r,a,f);if(h)throw new le.ErrnoError(h);if(h=c?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(u)||c&&le.isMountpoint(c))throw new le.ErrnoError(10);if(n!==r&&(h=le.nodePermissions(r,"w")))throw new le.ErrnoError(h);le.hashRemoveNode(u);try{r.node_ops.rename(u,n,s)}catch(e){throw e}finally{le.hashAddNode(u)}}},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=M(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(H(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(y)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(ue,{},"/"),le.createDefaultDirectories(),le.createDefaultDevices(),le.createSpecialDirectories(),le.filesystems={MEMFS:ue}},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),c=le.create(a,s);if(r){if("string"==typeof r){for(var u=new Array(r.length),l=0,f=r.length;l<f;++l)u[l]=r.charCodeAt(l);r=u}le.chmod(c,146|s);var h=le.open(c,577);le.write(h,r,0,r.length,0,i),le.close(h),le.chmod(c,s)}return c},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 c;try{c=r()}catch(e){throw new le.ErrnoError(29)}if(void 0===c&&0===a)throw new le.ErrnoError(6);if(null==c)break;a++,t[n+s]=c}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=we(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||[]):we(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,w("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(!v)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 c=le.createFile(e,t,s,n,o);s.contents?c.contents=s.contents:s.url&&(c.contents=null,c.url=s.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var u={};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(c.stream_ops).forEach((e=>{var t=c.stream_ops[e];u[e]=function(){return le.forceLoadFile(c),t.apply(null,arguments)}})),u.read=(e,t,r,n,o)=>(le.forceLoadFile(c),l(e,t,r,n,o)),u.mmap=(e,t,r,n,o)=>{le.forceLoadFile(c);var i=se();if(!i)throw new le.ErrnoError(48);return l(e,I,i,t,r),{ptr:i,allocated:!0}},c.stream_ops=u,c},createPreloadedFile:(e,t,r,n,o,i,a,c,u,l)=>{var f=t?ie.resolve(oe.join2(e,t)):e;function h(r){function s(r){l&&l(),c||le.createDataFile(e,t,r,n,o,u),i&&i(),J()}Browser.handledByPreloadPlugin(r,f,s,(()=>{a&&a(),J()}))||s(r)}Q(),"string"==typeof r?function(e,t,r,n){var o=n?"":"al "+e;s(e,(function(r){x(r,'Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(r)),o&&J()}),(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=le.indexedDB();try{var o=n.open(le.DB_NAME(),le.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=()=>{w("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,c=e.length;function u(){0==s?t():r()}e.forEach((e=>{var t=i.put(le.analyzePath(e).object.contents,e);t.onsuccess=()=>{++a+s==c&&u()},t.onerror=()=>{s++,a+s==c&&u()}})),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,c=0,u=e.length;function l(){0==c?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+c==u&&l()},t.onerror=()=>{c++,s+c==u&&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,K=[n.size>>>0,(q=n.size,+Math.abs(q)>=1?q>0?(0|Math.min(+Math.floor(q/4294967296),4294967295))>>>0:~~+Math.ceil((q-+(~~q>>>0))/4294967296)>>>0:0)],R[r+40>>2]=K[0],R[r+44>>2]=K[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,K=[n.ino>>>0,(q=n.ino,+Math.abs(q)>=1?q>0?(0|Math.min(+Math.floor(q/4294967296),4294967295))>>>0:~~+Math.ceil((q-+(~~q>>>0))/4294967296)>>>0:0)],R[r+80>>2]=K[0],R[r+84>>2]=K[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 c=i.buckets[s];a+=c.offset-c.roffset}x(t instanceof ArrayBuffer||ArrayBuffer.isView(t));var u=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 p=i.buckets[s],d=p.offset-p.roffset;if(l<=d){var m=p.buffer.subarray(p.roffset,p.offset);l<d?(m=m.subarray(0,l),p.roffset+=l):h++,u.set(m);break}m=p.buffer.subarray(p.roffset,p.offset),u.set(m),u=u.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;x(t instanceof ArrayBuffer||ArrayBuffer.isView(t));var a=t.subarray(r,r+n),s=a.byteLength;if(s<=0)return 0;var c=null;0==i.buckets.length?(c={buffer:new Uint8Array(he.BUCKET_BUFFER_SIZE),offset:0,roffset:0},i.buckets.push(c)):c=i.buckets[i.buckets.length-1],x(c.offset<=he.BUCKET_BUFFER_SIZE);var u=he.BUCKET_BUFFER_SIZE-c.offset;if(u>=s)return c.buffer.set(a,c.offset),c.offset+=s,s;u>0&&(c.buffer.set(a.subarray(0,u),c.offset),c.offset+=u,a=a.subarray(u,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 p={buffer:new Uint8Array(he.BUCKET_BUFFER_SIZE),offset:he.BUCKET_BUFFER_SIZE,roffset:0};i.buckets.push(p),p.buffer.set(a.subarray(0,he.BUCKET_BUFFER_SIZE)),a=a.subarray(he.BUCKET_BUFFER_SIZE,a.byteLength)}return f>0&&(p={buffer:new Uint8Array(he.BUCKET_BUFFER_SIZE),offset:a.byteLength,roffset:0},i.buckets.push(p),p.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+++"]"}},pe="To use dlopen, you need enable dynamic linking, see https://github.com/emscripten-core/emscripten/wiki/Linking";ce=y?()=>{var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:()=>performance.now();var de={};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",_:d||"./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]);me.strings=r}return me.strings}function ge(e,t,r,n){for(var o=0,i=0;i<r;i++){var a=F[t>>2],s=F[t+4>>2];t+=8;var c=le.read(e,I,a,s,n);if(c<0)return-1;if(o+=c,c<s)break}return o}function ve(e,t){return t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN}var ye=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},_e=365,be=146;function we(e,t,r){var n=r>0?r:H(e)+1,o=new Array(n),i=L(e,o,0,o.length);return t&&(o.length=i),o}Object.defineProperties(ye.prototype,{read:{get:function(){return(this.mode&_e)===_e},set:function(e){e?this.mode|=_e: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=ye,le.staticInit();var Ee,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(),O[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=H(r)+1;return t<n?-68:(j(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,H(o)),a=I[r+i];return j(o,r,n+1),I[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(pe)},D:function(e,t){ee(pe)},l:function(){return Date.now()},B:function(){return!0},b:function(){ee("")},k:ce,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;F[e+4*o>>2]=i,function(e,t,r){for(var n=0;n<e.length;++n)I[t++>>0]=e.charCodeAt(n);r||(I[t>>0]=0)}(n,i),r+=n.length+1})),0},r:function(e,t){var r=me();F[e>>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),F[t>>2]=n,0},d:function(e){Ie(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 I[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=ve(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=ve(t,r);if(isNaN(i))return 61;var a=fe.getStreamFromFD(e);return le.llseek(a,i,n),K=[a.position>>>0,(q=a.position,+Math.abs(q)>=1?q>0?(0|Math.min(+Math.floor(q/4294967296),4294967295))>>>0:~~+Math.ceil((q-+(~~q>>>0))/4294967296)>>>0:0)],R[o>>2]=K[0],R[o+4>>2]=K[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=F[t>>2],s=F[t+4>>2];t+=8;var c=le.write(e,I,a,s,n);if(c<0)return-1;o+=c}return o}(fe.getStreamFromFD(e),t,r);return F[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=I=new Int8Array(r),i.HEAP16=O=new Int16Array(r),i.HEAP32=R=new Int32Array(r),i.HEAPU8=T=new Uint8Array(r),i.HEAPU16=new Uint16Array(r),i.HEAPU32=F=new Uint32Array(r),i.HEAPF32=new Float32Array(r),i.HEAPF64=new Float64Array(r),i.asm.N,n=i.asm.K,U.unshift(n),J()}function r(e){t(e.instance)}function n(t){return(b||!g&&!v||"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){E("failed to asynchronously prepare wasm: "+e),ee(e)}))}if(Q(),i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(e){return E("Module.instantiateWasm callback failed with error: "+e),!1}(b||"function"!=typeof WebAssembly.instantiateStreaming||te($)||y||"function"!=typeof fetch?n(r):fetch($,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(r,(function(e){return E("wasm streaming compile failed: "+e),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)}),Ce=(i._main=function(){return(i._main=i.asm.M).apply(null,arguments)},i.stackAlloc=function(){return(Ce=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 xe(e){var t=i._main;(e=e||[]).unshift(d);var r=e.length,n=Ce(4*(r+1)),o=n>>2;e.forEach((e=>{R[o++]=function(e){var t=H(e)+1,r=Ce(t);return L(e,I,r,t),r}(e)})),R[o]=0;try{var a=t(r,n);return Ie(a),a}catch(e){return function(e){if(e instanceof ke||"unwind"==e)return C;m(1,e)}(e)}}function Pe(e){function r(){Ee||(Ee=!0,i.calledRun=!0,k||(i.noFSInit||le.init.initialized||le.init(),le.ignorePermissions=!1,ae.init(),he.root=le.mount(he,{},null),ne(U),ne(z),t(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),Oe&&xe(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||p,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 Ie(e,t){C=e,Te(e)}function Te(e){C=e,G()||(i.onExit&&i.onExit(e),k=!0),m(e,new ke(e))}if(i.FS=le,Z=function e(){Ee||Pe(),Ee||(Z=e)},i.run=Pe,i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();var Oe=!0;return i.noInitialRun&&(Oe=!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,c,u,l,f,h=Object.assign({},i),p=[],d="./this.program",m=(e,t)=>{throw t},g="object"==typeof window,v="function"==typeof importScripts,y="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,_="";y?(_=v?r(1017).dirname(_)+"/":__dirname+"/",f=()=>{l||(u=r(7147),l=r(1017))},a=function(e,t){return f(),e=l.normalize(e),u.readFileSync(e,t?void 0:"utf8")},c=e=>{var t=a(e,!0);return t.buffer||(t=new Uint8Array(t)),t},s=(e,t,r)=>{f(),e=l.normalize(e),u.readFile(e,(function(e,n){e?r(e):t(n.buffer)}))},process.argv.length>1&&(d=process.argv[1].replace(/\\/g,"/")),p=process.argv.slice(2),process.on("uncaughtException",(function(e){if(!(e instanceof we))throw e})),process.on("unhandledRejection",(function(e){throw e})),m=(e,t)=>{if(V())throw process.exitCode=e,t;var r;(r=t)instanceof we||E("exiting due to exception: "+r),process.exit(e)},i.inspect=function(){return"[Emscripten Module object]"}):(g||v)&&(v?_=self.location.href:"undefined"!=typeof document&&document.currentScript&&(_=document.currentScript.src),n&&(_=n),_=0!==_.indexOf("blob:")?_.substr(0,_.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},v&&(c=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,w=i.print||console.log.bind(console),E=i.printErr||console.warn.bind(console);Object.assign(i,h),h=null,i.arguments&&(p=i.arguments),i.thisProgram&&(d=i.thisProgram),i.quit&&(m=i.quit),i.wasmBinary&&(b=i.wasmBinary);var S,A=i.noExitRuntime||!0;"object"!=typeof WebAssembly&&J("no native wasm support detected");var C,k,x,P,I,T,O,R=!1,F="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&&F)return F.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 c=63&e[t++];if((a=224==(240&a)?(15&a)<<12|s<<6|c:(7&a)<<18|s<<12|c<<6|63&e[t++])<65536)i+=String.fromCharCode(a);else{var u=a-65536;i+=String.fromCharCode(55296|u>>10,56320|1023&u)}}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 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 j(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 H=[],B=[],U=[],z=[];function V(){return A}var G,$,X,q,K=0,W=null,Y=null;function Z(e){K++,i.monitorRunDependencies&&i.monitorRunDependencies(K)}function Q(e){if(K--,i.monitorRunDependencies&&i.monitorRunDependencies(K),0==K&&(null!==W&&(clearInterval(W),W=null),Y)){var t=Y;Y=null,t()}}function J(e){i.onAbort&&i.onAbort(e),E(e="Aborted("+e+")"),R=!0,C=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(c)return c(e);throw"both async and sync fetching of the wasm failed"}catch(e){J(e)}}function re(e){for(;e.length>0;)e.shift()(i)}ee(G="objcopy.wasm")||($=G,G=i.locateFile?i.locateFile($,_):_+$);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]:ue.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 c=[];for(s=a;s<n.length;s++)c.push("..");return(c=c.concat(o.slice(a))).join("/")}},ie={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){ie.ttys[e]={input:[],output:[],ops:t},ue.registerDevice(e,ie.stream_ops)},stream_ops:{open:function(e){var t=ie.ttys[e.node.rdev];if(!t)throw new ue.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 ue.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 ue.ErrnoError(29)}if(void 0===s&&0===i)throw new ue.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 ue.ErrnoError(60);try{for(var i=0;i<n;i++)e.tty.ops.put_char(e.tty,t[r+i])}catch(e){throw new ue.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(y){var r=Buffer.alloc(256),n=0;try{n=u.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?(w(D(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(w(D(e.output,0)),e.output=[])}},default_tty1_ops:{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=[])}}};function ae(e){J()}var se={ops_table:null,mount:function(e){return se.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(ue.isBlkdev(r)||ue.isFIFO(r))throw new ue.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:ue.chrdev_stream_ops}});var o=ue.createNode(e,t,r,n);return ue.isDir(o.mode)?(o.node_ops=se.ops_table.dir.node,o.stream_ops=se.ops_table.dir.stream,o.contents={}):ue.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):ue.isLink(o.mode)?(o.node_ops=se.ops_table.link.node,o.stream_ops=se.ops_table.link.stream):ue.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=ue.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,ue.isDir(e.mode)?t.size=4096:ue.isFile(e.mode)?t.size=e.usedBytes:ue.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 ue.genericErrors[44]},mknod:function(e,t,r,n){return se.createNode(e,t,r,n)},rename:function(e,t,r){if(ue.isDir(e.mode)){var n;try{n=ue.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new ue.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=ue.lookupNode(e,t);for(var n in r.contents)throw new ue.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(!ue.isLink(e.mode))throw new ue.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&&ue.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new ue.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(!ue.isFile(e.node.mode))throw new ue.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 ue.ErrnoError(48);x.set(s,i)}else a=!1,i=s.byteOffset;return{ptr:i,allocated:a}},msync:function(e,t,r,n,o){if(!ue.isFile(e.node.mode))throw new ue.ErrnoError(43);return 2&o||se.stream_ops.write(e,t,0,n,r,!1),0}}};function ce(e,t,r,n){var o=n?"":"al "+e;s(e,(function(r){var n;n='Loading data file "'+e+'" failed (no arrayBuffer).',r||J(n),t(new Uint8Array(r)),o&&Q()}),(function(t){if(!r)throw'Loading data file "'+e+'" failed.';r()})),o&&Z()}var ue={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(ue.cwd(),e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new ue.ErrnoError(32);for(var r=ne.normalizeArray(e.split("/").filter((e=>!!e)),!1),n=ue.root,o="/",i=0;i<r.length;i++){var a=i===r.length-1;if(a&&t.parent)break;if(n=ue.lookupNode(n,r[i]),o=ne.join2(o,r[i]),ue.isMountpoint(n)&&(!a||a&&t.follow_mount)&&(n=n.mounted.root),!a||t.follow)for(var s=0;ue.isLink(n.mode);){var c=ue.readlink(o);if(o=oe.resolve(ne.dirname(o),c),n=ue.lookupPath(o,{recurse_count:t.recurse_count+1}).node,s++>40)throw new ue.ErrnoError(32)}}return{path:o,node:n}},getPath:e=>{for(var t;;){if(ue.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)%ue.nameTable.length},hashAddNode:e=>{var t=ue.hashName(e.parent.id,e.name);e.name_next=ue.nameTable[t],ue.nameTable[t]=e},hashRemoveNode:e=>{var t=ue.hashName(e.parent.id,e.name);if(ue.nameTable[t]===e)ue.nameTable[t]=e.name_next;else for(var r=ue.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:(e,t)=>{var r=ue.mayLookup(e);if(r)throw new ue.ErrnoError(r,e);for(var n=ue.hashName(e.id,t),o=ue.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return ue.lookup(e,t)},createNode:(e,t,r,n)=>{var o=new ue.FSNode(e,t,r,n);return ue.hashAddNode(o),o},destroyNode:e=>{ue.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=ue.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)=>ue.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=ue.nodePermissions(e,"x");return t||(e.node_ops.lookup?0:2)},mayCreate:(e,t)=>{try{return ue.lookupNode(e,t),20}catch(e){}return ue.nodePermissions(e,"wx")},mayDelete:(e,t,r)=>{var n;try{n=ue.lookupNode(e,t)}catch(e){return e.errno}var o=ue.nodePermissions(e,"wx");if(o)return o;if(r){if(!ue.isDir(n.mode))return 54;if(ue.isRoot(n)||ue.getPath(n)===ue.cwd())return 10}else if(ue.isDir(n.mode))return 31;return 0},mayOpen:(e,t)=>e?ue.isLink(e.mode)?32:ue.isDir(e.mode)&&("r"!==ue.flagsToPermissionString(t)||512&t)?31:ue.nodePermissions(e,ue.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:(e=0,t=ue.MAX_OPEN_FDS)=>{for(var r=e;r<=t;r++)if(!ue.streams[r])return r;throw new ue.ErrnoError(33)},getStream:e=>ue.streams[e],createStream:(e,t,r)=>{ue.FSStream||(ue.FSStream=function(){this.shared={}},ue.FSStream.prototype={},Object.defineProperties(ue.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 ue.FSStream,e);var n=ue.nextfd(t,r);return e.fd=n,ue.streams[n]=e,e},closeStream:e=>{ue.streams[e]=null},chrdev_stream_ops:{open:e=>{var t=ue.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new ue.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice:(e,t)=>{ue.devices[e]={stream_ops:t}},getDevice:e=>ue.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),ue.syncFSRequests++,ue.syncFSRequests>1&&E("warning: "+ue.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=ue.getMounts(ue.root.mount),n=0;function o(e){return ue.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&&ue.root)throw new ue.ErrnoError(10);if(!o&&!i){var a=ue.lookupPath(r,{follow_mount:!1});if(r=a.path,n=a.node,ue.isMountpoint(n))throw new ue.ErrnoError(10);if(!ue.isDir(n.mode))throw new ue.ErrnoError(54)}var s={type:e,opts:t,mountpoint:r,mounts:[]},c=e.mount(s);return c.mount=s,s.root=c,o?ue.root=c:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),c},unmount:e=>{var t=ue.lookupPath(e,{follow_mount:!1});if(!ue.isMountpoint(t.node))throw new ue.ErrnoError(28);var r=t.node,n=r.mounted,o=ue.getMounts(n);Object.keys(ue.nameTable).forEach((e=>{for(var t=ue.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&ue.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=ue.lookupPath(e,{parent:!0}).node,o=ne.basename(e);if(!o||"."===o||".."===o)throw new ue.ErrnoError(28);var i=ue.mayCreate(n,o);if(i)throw new ue.ErrnoError(i);if(!n.node_ops.mknod)throw new ue.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,ue.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,ue.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{ue.mkdir(n,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,ue.mknod(e,t,r)),symlink:(e,t)=>{if(!oe.resolve(e))throw new ue.ErrnoError(44);var r=ue.lookupPath(t,{parent:!0}).node;if(!r)throw new ue.ErrnoError(44);var n=ne.basename(t),o=ue.mayCreate(r,n);if(o)throw new ue.ErrnoError(o);if(!r.node_ops.symlink)throw new ue.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=ue.lookupPath(e,{parent:!0}).node,n=ue.lookupPath(t,{parent:!0}).node,!r||!n)throw new ue.ErrnoError(44);if(r.mount!==n.mount)throw new ue.ErrnoError(75);var c,u=ue.lookupNode(r,a),l=oe.relative(e,i);if("."!==l.charAt(0))throw new ue.ErrnoError(28);if("."!==(l=oe.relative(t,o)).charAt(0))throw new ue.ErrnoError(55);try{c=ue.lookupNode(n,s)}catch(e){}if(u!==c){var f=ue.isDir(u.mode),h=ue.mayDelete(r,a,f);if(h)throw new ue.ErrnoError(h);if(h=c?ue.mayDelete(n,s,f):ue.mayCreate(n,s))throw new ue.ErrnoError(h);if(!r.node_ops.rename)throw new ue.ErrnoError(63);if(ue.isMountpoint(u)||c&&ue.isMountpoint(c))throw new ue.ErrnoError(10);if(n!==r&&(h=ue.nodePermissions(r,"w")))throw new ue.ErrnoError(h);ue.hashRemoveNode(u);try{r.node_ops.rename(u,n,s)}catch(e){throw e}finally{ue.hashAddNode(u)}}},rmdir:e=>{var t=ue.lookupPath(e,{parent:!0}).node,r=ne.basename(e),n=ue.lookupNode(t,r),o=ue.mayDelete(t,r,!0);if(o)throw new ue.ErrnoError(o);if(!t.node_ops.rmdir)throw new ue.ErrnoError(63);if(ue.isMountpoint(n))throw new ue.ErrnoError(10);t.node_ops.rmdir(t,r),ue.destroyNode(n)},readdir:e=>{var t=ue.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new ue.ErrnoError(54);return t.node_ops.readdir(t)},unlink:e=>{var t=ue.lookupPath(e,{parent:!0}).node;if(!t)throw new ue.ErrnoError(44);var r=ne.basename(e),n=ue.lookupNode(t,r),o=ue.mayDelete(t,r,!1);if(o)throw new ue.ErrnoError(o);if(!t.node_ops.unlink)throw new ue.ErrnoError(63);if(ue.isMountpoint(n))throw new ue.ErrnoError(10);t.node_ops.unlink(t,r),ue.destroyNode(n)},readlink:e=>{var t=ue.lookupPath(e).node;if(!t)throw new ue.ErrnoError(44);if(!t.node_ops.readlink)throw new ue.ErrnoError(28);return oe.resolve(ue.getPath(t.parent),t.node_ops.readlink(t))},stat:(e,t)=>{var r=ue.lookupPath(e,{follow:!t}).node;if(!r)throw new ue.ErrnoError(44);if(!r.node_ops.getattr)throw new ue.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>ue.stat(e,!0),chmod:(e,t,r)=>{var n;if(!(n="string"==typeof e?ue.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new ue.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:(e,t)=>{ue.chmod(e,t,!0)},fchmod:(e,t)=>{var r=ue.getStream(e);if(!r)throw new ue.ErrnoError(8);ue.chmod(r.node,t)},chown:(e,t,r,n)=>{var o;if(!(o="string"==typeof e?ue.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new ue.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:(e,t,r)=>{ue.chown(e,t,r,!0)},fchown:(e,t,r)=>{var n=ue.getStream(e);if(!n)throw new ue.ErrnoError(8);ue.chown(n.node,t,r)},truncate:(e,t)=>{if(t<0)throw new ue.ErrnoError(28);var r;if(!(r="string"==typeof e?ue.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new ue.ErrnoError(63);if(ue.isDir(r.mode))throw new ue.ErrnoError(31);if(!ue.isFile(r.mode))throw new ue.ErrnoError(28);var n=ue.nodePermissions(r,"w");if(n)throw new ue.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:(e,t)=>{var r=ue.getStream(e);if(!r)throw new ue.ErrnoError(8);if(0==(2097155&r.flags))throw new ue.ErrnoError(28);ue.truncate(r.node,t)},utime:(e,t,r)=>{var n=ue.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:(e,t,r)=>{if(""===e)throw new ue.ErrnoError(44);var n;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?ue.modeStringToFlags(t):t)?4095&r|32768:0,"object"==typeof e)n=e;else{e=ne.normalize(e);try{n=ue.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var o=!1;if(64&t)if(n){if(128&t)throw new ue.ErrnoError(20)}else n=ue.mknod(e,r,0),o=!0;if(!n)throw new ue.ErrnoError(44);if(ue.isChrdev(n.mode)&&(t&=-513),65536&t&&!ue.isDir(n.mode))throw new ue.ErrnoError(54);if(!o){var a=ue.mayOpen(n,t);if(a)throw new ue.ErrnoError(a)}512&t&&!o&&ue.truncate(n,0),t&=-131713;var s=ue.createStream({node:n,path:ue.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||(ue.readFiles||(ue.readFiles={}),e in ue.readFiles||(ue.readFiles[e]=1)),s},close:e=>{if(ue.isClosed(e))throw new ue.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{ue.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,t,r)=>{if(ue.isClosed(e))throw new ue.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new ue.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new ue.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 ue.ErrnoError(28);if(ue.isClosed(e))throw new ue.ErrnoError(8);if(1==(2097155&e.flags))throw new ue.ErrnoError(8);if(ue.isDir(e.node.mode))throw new ue.ErrnoError(31);if(!e.stream_ops.read)throw new ue.ErrnoError(28);var i=void 0!==o;if(i){if(!e.seekable)throw new ue.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 ue.ErrnoError(28);if(ue.isClosed(e))throw new ue.ErrnoError(8);if(0==(2097155&e.flags))throw new ue.ErrnoError(8);if(ue.isDir(e.node.mode))throw new ue.ErrnoError(31);if(!e.stream_ops.write)throw new ue.ErrnoError(28);e.seekable&&1024&e.flags&&ue.llseek(e,0,2);var a=void 0!==o;if(a){if(!e.seekable)throw new ue.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(ue.isClosed(e))throw new ue.ErrnoError(8);if(t<0||r<=0)throw new ue.ErrnoError(28);if(0==(2097155&e.flags))throw new ue.ErrnoError(8);if(!ue.isFile(e.node.mode)&&!ue.isDir(e.node.mode))throw new ue.ErrnoError(43);if(!e.stream_ops.allocate)throw new ue.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 ue.ErrnoError(2);if(1==(2097155&e.flags))throw new ue.ErrnoError(2);if(!e.stream_ops.mmap)throw new ue.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 ue.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=ue.open(e,t.flags),o=ue.stat(e).size,i=new Uint8Array(o);return ue.read(n,i,0,o,0),"utf8"===t.encoding?r=D(i,0):"binary"===t.encoding&&(r=i),ue.close(n),r},writeFile:(e,t,r={})=>{r.flags=r.flags||577;var n=ue.open(e,r.flags,r.mode);if("string"==typeof t){var o=new Uint8Array(j(t)+1),i=N(t,o,0,o.length);ue.write(n,o,0,i,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");ue.write(n,t,0,t.byteLength,void 0,r.canOwn)}ue.close(n)},cwd:()=>ue.currentPath,chdir:e=>{var t=ue.lookupPath(e,{follow:!0});if(null===t.node)throw new ue.ErrnoError(44);if(!ue.isDir(t.node.mode))throw new ue.ErrnoError(54);var r=ue.nodePermissions(t.node,"x");if(r)throw new ue.ErrnoError(r);ue.currentPath=t.path},createDefaultDirectories:()=>{ue.mkdir("/tmp"),ue.mkdir("/home"),ue.mkdir("/home/web_user")},createDefaultDevices:()=>{ue.mkdir("/dev"),ue.registerDevice(ue.makedev(1,3),{read:()=>0,write:(e,t,r,n,o)=>n}),ue.mkdev("/dev/null",ue.makedev(1,3)),ie.register(ue.makedev(5,0),ie.default_tty_ops),ie.register(ue.makedev(6,0),ie.default_tty1_ops),ue.mkdev("/dev/tty",ue.makedev(5,0)),ue.mkdev("/dev/tty1",ue.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(y)try{var t=r(6113);return function(){return t.randomBytes(1)[0]}}catch(e){}return function(){J("randomDevice")}}();ue.createDevice("/dev","random",e),ue.createDevice("/dev","urandom",e),ue.mkdir("/dev/shm"),ue.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{ue.mkdir("/proc");var e=ue.mkdir("/proc/self");ue.mkdir("/proc/self/fd"),ue.mount({mount:()=>{var t=ue.createNode(e,"fd",16895,73);return t.node_ops={lookup:(e,t)=>{var r=+t,n=ue.getStream(r);if(!n)throw new ue.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?ue.createDevice("/dev","stdin",i.stdin):ue.symlink("/dev/tty","/dev/stdin"),i.stdout?ue.createDevice("/dev","stdout",null,i.stdout):ue.symlink("/dev/tty","/dev/stdout"),i.stderr?ue.createDevice("/dev","stderr",null,i.stderr):ue.symlink("/dev/tty1","/dev/stderr"),ue.open("/dev/stdin",0),ue.open("/dev/stdout",1),ue.open("/dev/stderr",1)},ensureErrnoError:()=>{ue.ErrnoError||(ue.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},ue.ErrnoError.prototype=new Error,ue.ErrnoError.prototype.constructor=ue.ErrnoError,[44].forEach((e=>{ue.genericErrors[e]=new ue.ErrnoError(e),ue.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:()=>{ue.ensureErrnoError(),ue.nameTable=new Array(4096),ue.mount(se,{},"/"),ue.createDefaultDirectories(),ue.createDefaultDevices(),ue.createSpecialDirectories(),ue.filesystems={MEMFS:se}},init:(e,t,r)=>{ue.init.initialized=!0,ue.ensureErrnoError(),i.stdin=e||i.stdin,i.stdout=t||i.stdout,i.stderr=r||i.stderr,ue.createStandardStreams()},quit:()=>{ue.init.initialized=!1;for(var e=0;e<ue.streams.length;e++){var t=ue.streams[e];t&&ue.close(t)}},getMode:(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},findObject:(e,t)=>{var r=ue.analyzePath(e,t);return r.exists?r.object:null},analyzePath:(e,t)=>{try{e=(n=ue.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=ue.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=ne.basename(e),n=ue.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:ue.getPath(e);for(var o=t.split("/").reverse();o.length;){var i=o.pop();if(i){var a=ne.join2(e,i);try{ue.mkdir(a)}catch(e){}e=a}}return a},createFile:(e,t,r,n,o)=>{var i=ne.join2("string"==typeof e?e:ue.getPath(e),t),a=ue.getMode(n,o);return ue.create(i,a)},createDataFile:(e,t,r,n,o,i)=>{var a=t;e&&(e="string"==typeof e?e:ue.getPath(e),a=t?ne.join2(e,t):e);var s=ue.getMode(n,o),c=ue.create(a,s);if(r){if("string"==typeof r){for(var u=new Array(r.length),l=0,f=r.length;l<f;++l)u[l]=r.charCodeAt(l);r=u}ue.chmod(c,146|s);var h=ue.open(c,577);ue.write(h,r,0,r.length,0,i),ue.close(h),ue.chmod(c,s)}return c},createDevice:(e,t,r,n)=>{var o=ne.join2("string"==typeof e?e:ue.getPath(e),t),i=ue.getMode(!!r,!!n);ue.createDevice.major||(ue.createDevice.major=64);var a=ue.makedev(ue.createDevice.major++,0);return ue.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 c;try{c=r()}catch(e){throw new ue.ErrnoError(29)}if(void 0===c&&0===a)throw new ue.ErrnoError(6);if(null==c)break;a++,t[n+s]=c}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 ue.ErrnoError(29)}return o&&(e.node.timestamp=Date.now()),a}}),ue.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 ue.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,w("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(!v)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 c=ue.createFile(e,t,s,n,o);s.contents?c.contents=s.contents:s.url&&(c.contents=null,c.url=s.url),Object.defineProperties(c,{usedBytes:{get:function(){return this.contents.length}}});var u={};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(c.stream_ops).forEach((e=>{var t=c.stream_ops[e];u[e]=function(){return ue.forceLoadFile(c),t.apply(null,arguments)}})),u.read=(e,t,r,n,o)=>(ue.forceLoadFile(c),l(e,t,r,n,o)),u.mmap=(e,t,r,n,o)=>{ue.forceLoadFile(c);var i=ae();if(!i)throw new ue.ErrnoError(48);return l(e,x,i,t,r),{ptr:i,allocated:!0}},c.stream_ops=u,c},createPreloadedFile:(e,t,r,n,o,i,a,s,c,u)=>{var l=t?oe.resolve(ne.join2(e,t)):e;function f(r){function f(r){u&&u(),s||ue.createDataFile(e,t,r,n,o,c),i&&i(),Q()}Browser.handledByPreloadPlugin(r,l,f,(()=>{a&&a(),Q()}))||f(r)}Z(),"string"==typeof r?ce(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=ue.indexedDB();try{var o=n.open(ue.DB_NAME(),ue.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=()=>{w("creating db"),o.result.createObjectStore(ue.DB_STORE_NAME)},o.onsuccess=()=>{var n=o.result.transaction([ue.DB_STORE_NAME],"readwrite"),i=n.objectStore(ue.DB_STORE_NAME),a=0,s=0,c=e.length;function u(){0==s?t():r()}e.forEach((e=>{var t=i.put(ue.analyzePath(e).object.contents,e);t.onsuccess=()=>{++a+s==c&&u()},t.onerror=()=>{s++,a+s==c&&u()}})),n.onerror=r},o.onerror=r},loadFilesFromDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var n=ue.indexedDB();try{var o=n.open(ue.DB_NAME(),ue.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=r,o.onsuccess=()=>{var n=o.result;try{var i=n.transaction([ue.DB_STORE_NAME],"readonly")}catch(e){return void r(e)}var a=i.objectStore(ue.DB_STORE_NAME),s=0,c=0,u=e.length;function l(){0==c?t():r()}e.forEach((e=>{var t=a.get(e);t.onsuccess=()=>{ue.analyzePath(e).exists&&ue.unlink(e),ue.createDataFile(ne.dirname(e),ne.basename(e),t.result,!0,!0,!0),++s+c==u&&l()},t.onerror=()=>{c++,s+c==u&&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=ue.cwd();else{var o=ue.getStream(e);if(!o)throw new ue.ErrnoError(8);n=o.path}if(0==t.length){if(!r)throw new ue.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(ue.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,q=[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]=q[0],T[r+44>>2]=q[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,q=[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]=q[0],T[r+84>>2]=q[1],0},doMsync:function(e,t,r,n,o){var i=P.slice(e,e+r);ue.msync(t,i,o,r,n)},varargs:void 0,get:function(){return le.varargs+=4,T[le.varargs-4>>2]},getStr:function(e){return M(e)},getStreamFromFD:function(e){var t=ue.getStream(e);if(!t)throw new ue.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",_:d||"./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 pe=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=ue.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n},de=365,me=146;function ge(e,t,r){var n=r>0?r:j(e)+1,o=new Array(n),i=N(e,o,0,o.length);return t&&(o.length=i),o}Object.defineProperties(pe.prototype,{read:{get:function(){return(this.mode&de)===de},set:function(e){e?this.mode|=de: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 ue.isDir(this.mode)}},isDevice:{get:function(){return ue.isChrdev(this.mode)}}}),ue.FSNode=pe,ue.staticInit();var ve,ye={b:function(e,t,r,n){J("Assertion failed: "+M(e)+", at: "+[t?M(t):"unknown filename",r,n?M(n):"unknown function"])},k:function(e,t){try{return e=le.getStr(e),ue.chmod(e,t),0}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return-e.errno}},D:function(e){try{var t=le.getStreamFromFD(e);return ue.createStream(t,0).fd}catch(e){if(void 0===ue||!(e instanceof ue.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=ue.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&&ue.nodePermissions(o,i)?-2:0}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return-e.errno}},B:function(e,t){try{return ue.fchmod(e,t),0}catch(e){if(void 0===ue||!(e instanceof ue.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:ue.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(),I[o+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return i=28,T[_e()>>2]=i,-1}}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return-e.errno}var i},z:function(e,t){try{var r=le.getStreamFromFD(e);return le.doStat(ue.stat,r.path,t)}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return-e.errno}},v:function(e,t){try{if(0===t)return-28;var r=ue.cwd(),n=j(r)+1;return t<n?-68:(L(r,e,t),n)}catch(e){if(void 0===ue||!(e instanceof ue.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(),ue.ioctl(n,t,o);default:J("bad ioctl syscall "+t)}}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return-e.errno}},x:function(e,t){try{return e=le.getStr(e),le.doStat(ue.lstat,e,t)}catch(e){if(void 0===ue||!(e instanceof ue.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)),ue.mkdir(t,r,0),0}catch(e){if(void 0===ue||!(e instanceof ue.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?ue.lstat:ue.stat,t,r)}catch(e){if(void 0===ue||!(e instanceof ue.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 ue.open(t,r,o).fd}catch(e){if(void 0===ue||!(e instanceof ue.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=ue.readlink(t),i=Math.min(n,j(o)),a=x[r+i];return L(o,r,n+1),x[r+i]=a,i}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return-e.errno}},s:function(e){try{return e=le.getStr(e),ue.rmdir(e),0}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return-e.errno}},y:function(e,t){try{return e=le.getStr(e),le.doStat(ue.stat,e,t)}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return-e.errno}},r:function(e,t,r){try{return t=le.getStr(t),t=le.calculateAt(e,t),0===r?ue.unlink(t):512===r?ue.rmdir(t):J("Invalid flags passed to unlinkat"),0}catch(e){if(void 0===ue||!(e instanceof ue.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 ue.utime(t,a,s),0}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return-e.errno}},j:function(){return Date.now()},C:function(){return!0},a:function(){J("")},A:function(e,t,r){P.copyWithin(e,t,t+r)},e:function(e){P.length,J("OOM")},m:function(e,t){var r=0;return he().forEach((function(n,o){var i=t+r;O[e+4*o>>2]=i,function(e,t,r){for(var n=0;n<e.length;++n)x[t++>>0]=e.charCodeAt(n);r||(x[t>>0]=0)}(n,i),r+=n.length+1})),0},o:function(e,t){var r=he();O[e>>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),O[t>>2]=n,0},f:function(e){Ae(e)},c:function(e){try{var t=le.getStreamFromFD(e);return ue.close(t),0}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return e.errno}},p:function(e,t){try{var r=le.getStreamFromFD(e),n=r.tty?2:ue.isDir(r.mode)?3:ue.isLink(r.mode)?7:4;return x[t>>0]=n,0}catch(e){if(void 0===ue||!(e instanceof ue.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=O[t>>2],s=O[t+4>>2];t+=8;var c=ue.read(e,x,a,s,n);if(c<0)return-1;if(o+=c,c<s)break}return o}(le.getStreamFromFD(e),t,r);return T[n>>2]=o,0}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return e.errno}},n:function(e,t,r,n,o){try{var i=(c=r)+2097152>>>0<4194305-!!(s=t)?(s>>>0)+4294967296*c:NaN;if(isNaN(i))return 61;var a=le.getStreamFromFD(e);return ue.llseek(a,i,n),q=[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]=q[0],T[o+4>>2]=q[1],a.getdents&&0===i&&0===n&&(a.getdents=null),0}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return e.errno}var s,c},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=O[t>>2],s=O[t+4>>2];t+=8;var c=ue.write(e,x,a,s,n);if(c<0)return-1;o+=c}return o}(le.getStreamFromFD(e),t,r);return O[n>>2]=o,0}catch(e){if(void 0===ue||!(e instanceof ue.ErrnoError))throw e;return e.errno}},F:function(e){Ce(e)}},_e=(function(){var e={a:ye};function t(e,t){var r,n,o=e.exports;i.asm=o,S=i.asm.G,r=S.buffer,k=r,i.HEAP8=x=new Int8Array(r),i.HEAP16=I=new Int16Array(r),i.HEAP32=T=new Int32Array(r),i.HEAPU8=P=new Uint8Array(r),i.HEAPU16=new Uint16Array(r),i.HEAPU32=O=new Uint32Array(r),i.HEAPF32=new Float32Array(r),i.HEAPF64=new Float64Array(r),i.asm.K,n=i.asm.H,B.unshift(n),Q()}function r(e){t(e.instance)}function n(t){return(b||!g&&!v||"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){E("failed to asynchronously prepare wasm: "+e),J(e)}))}if(Z(),i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(e){return E("Module.instantiateWasm callback failed with error: "+e),!1}(b||"function"!=typeof WebAssembly.instantiateStreaming||ee(G)||y||"function"!=typeof fetch?n(r):fetch(G,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(r,(function(e){return E("wasm streaming compile failed: "+e),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(_e=i.___errno_location=i.asm.J).apply(null,arguments)}),be=i.stackAlloc=function(){return(be=i.stackAlloc=i.asm.L).apply(null,arguments)};function we(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Ee(e){var t=i._main;(e=e||[]).unshift(d);var r=e.length,n=be(4*(r+1)),o=n>>2;e.forEach((e=>{T[o++]=function(e){var t=j(e)+1,r=be(t);return N(e,x,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 we||"unwind"==e)return C;m(1,e)}(e)}}function Se(e){function r(){ve||(ve=!0,i.calledRun=!0,R||(i.noFSInit||ue.init.initialized||ue.init(),ue.ignorePermissions=!1,ie.init(),re(B),re(U),t(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),ke&&Ee(e),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)e=i.postRun.shift(),z.unshift(e);var e;re(z)}()))}e=e||p,K>0||(function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)e=i.preRun.shift(),H.unshift(e);var e;re(H)}(),K>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),r()}),1)):r()))}function Ae(e,t){C=e,Ce(e)}function Ce(e){C=e,V()||(i.onExit&&i.onExit(e),R=!0),m(e,new we(e))}if(i.FS=ue,Y=function e(){ve||Se(),ve||(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)+"/"}},9846:e=>{"use strict";e.exports=function(e){var t=e._SomePromiseArray;function r(e){var r=new t(e),n=r.promise();return r.setHowMany(1),r.setUnwrap(),r.init(),n}e.any=function(e){return r(e)},e.prototype.any=function(){return r(this)}}},4601:(e,t,r)=>{"use strict";var n;try{throw new Error}catch(e){n=e}var o=r(679),i=r(7824);function a(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new i(16),this._normalQueue=new i(16),this._haveDrainedQueues=!1;var e=this;this.drainQueues=function(){e._drainQueues()},this._schedule=o}function s(e){for(;e.length()>0;)c(e)}function c(e){var t=e.shift();if("function"!=typeof t)t._settlePromises();else{var r=e.shift(),n=e.shift();t.call(r,n)}}a.prototype.setScheduler=function(e){var t=this._schedule;return this._schedule=e,this._customScheduler=!0,t},a.prototype.hasCustomScheduler=function(){return this._customScheduler},a.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},a.prototype.fatalError=function(e,t){t?(process.stderr.write("Fatal "+(e instanceof Error?e.stack:e)+"\n"),process.exit(2)):this.throwLater(e)},a.prototype.throwLater=function(e,t){if(1===arguments.length&&(t=e,e=function(){throw t}),"undefined"!=typeof setTimeout)setTimeout((function(){e(t)}),0);else try{this._schedule((function(){e(t)}))}catch(e){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},a.prototype.invokeLater=function(e,t,r){this._lateQueue.push(e,t,r),this._queueTick()},a.prototype.invoke=function(e,t,r){this._normalQueue.push(e,t,r),this._queueTick()},a.prototype.settlePromises=function(e){this._normalQueue._pushOne(e),this._queueTick()},a.prototype._drainQueues=function(){s(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,s(this._lateQueue)},a.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},a.prototype._reset=function(){this._isTickUsed=!1},e.exports=a,e.exports.firstLineError=n},3635:e=>{"use strict";e.exports=function(e,t,r,n){var o=!1,i=function(e,t){this._reject(t)},a=function(e,t){t.promiseRejectionQueued=!0,t.bindingPromise._then(i,i,null,this,e)},s=function(e,t){0==(50397184&this._bitField)&&this._resolveCallback(t.target)},c=function(e,t){t.promiseRejectionQueued||this._reject(e)};e.prototype.bind=function(i){o||(o=!0,e.prototype._propagateFrom=n.propagateFromFunction(),e.prototype._boundValue=n.boundValueFunction());var u=r(i),l=new e(t);l._propagateFrom(this,1);var f=this._target();if(l._setBoundTo(u),u instanceof e){var h={promiseRejectionQueued:!1,promise:l,target:f,bindingPromise:u};f._then(t,a,void 0,l,h),u._then(s,c,void 0,l,h),l._setOnCancel(u)}else l._resolveCallback(f);return l},e.prototype._setBoundTo=function(e){void 0!==e?(this._bitField=2097152|this._bitField,this._boundTo=e):this._bitField=-2097153&this._bitField},e.prototype._isBound=function(){return 2097152==(2097152&this._bitField)},e.bind=function(t,r){return e.resolve(r).bind(t)}}},3786:(e,t,r)=>{"use strict";var n;"undefined"!=typeof Promise&&(n=Promise);var o=r(7502)();o.noConflict=function(){try{Promise===o&&(Promise=n)}catch(e){}return o},e.exports=o},2293:(e,t,r)=>{"use strict";var n=Object.create;if(n){var o=n(null),i=n(null);o[" size"]=i[" size"]=0}e.exports=function(e){var t,n,a=r(5942),s=a.canEvaluate,c=a.isIdentifier,u=function(e){return new Function("ensureMethod"," \n return function(obj) { \n 'use strict' \n var len = this.length; \n ensureMethod(obj, 'methodName'); \n switch(len) { \n case 1: return obj.methodName(this[0]); \n case 2: return obj.methodName(this[0], this[1]); \n case 3: return obj.methodName(this[0], this[1], this[2]); \n case 0: return obj.methodName(); \n default: \n return obj.methodName.apply(obj, this); \n } \n }; \n ".replace(/methodName/g,e))(h)},l=function(e){return new Function("obj"," \n 'use strict'; \n return obj.propertyName; \n ".replace("propertyName",e))},f=function(e,t,r){var n=r[e];if("function"!=typeof n){if(!c(e))return null;if(n=t(e),r[e]=n,r[" size"]++,r[" size"]>512){for(var o=Object.keys(r),i=0;i<256;++i)delete r[o[i]];r[" size"]=o.length-256}}return n};function h(t,r){var n;if(null!=t&&(n=t[r]),"function"!=typeof n){var o="Object "+a.classString(t)+" has no method '"+a.toString(r)+"'";throw new e.TypeError(o)}return n}function p(e){return h(e,this.pop()).apply(e,this)}function d(e){return e[this]}function m(e){var t=+this;return t<0&&(t=Math.max(0,t+e.length)),e[t]}t=function(e){return f(e,u,o)},n=function(e){return f(e,l,i)},e.prototype.call=function(e){for(var r=arguments.length,n=new Array(Math.max(r-1,0)),o=1;o<r;++o)n[o-1]=arguments[o];if(s){var i=t(e);if(null!==i)return this._then(i,void 0,void 0,n,void 0)}return n.push(e),this._then(p,void 0,void 0,n,void 0)},e.prototype.get=function(e){var t;if("number"==typeof e)t=m;else if(s){var r=n(e);t=null!==r?r:d}else t=d;return this._then(t,void 0,void 0,e,void 0)}}},1735:(e,t,r)=>{"use strict";e.exports=function(e,t,n,o){var i=r(5942),a=i.tryCatch,s=i.errorObj,c=e._async;e.prototype.break=e.prototype.cancel=function(){if(!o.cancellation())return this._warn("cancellation is disabled");for(var e=this,t=e;e._isCancellable();){if(!e._cancelBy(t)){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}var r=e._cancellationParent;if(null==r||!r._isCancellable()){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}e._isFollowing()&&e._followee().cancel(),e._setWillBeCancelled(),t=e,e=r}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(e){return e===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),c.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(e,t){if(i.isArray(e))for(var r=0;r<e.length;++r)this._doInvokeOnCancel(e[r],t);else if(void 0!==e)if("function"==typeof e){if(!t){var n=a(e).call(this._boundValue());n===s&&(this._attachExtraTrace(n.e),c.throwLater(n.e))}}else e._resultCancelled(this)},e.prototype._invokeOnCancel=function(){var e=this._onCancel();this._unsetOnCancel(),c.invoke(this._doInvokeOnCancel,this,e)},e.prototype._invokeInternalOnCancel=function(){this._isCancellable()&&(this._doInvokeOnCancel(this._onCancel(),!0),this._unsetOnCancel())},e.prototype._resultCancelled=function(){this.cancel()}}},9976:(e,t,r)=>{"use strict";e.exports=function(e){var t=r(5942),n=r(9571).keys,o=t.tryCatch,i=t.errorObj;return function(r,a,s){return function(c){var u=s._boundValue();e:for(var l=0;l<r.length;++l){var f=r[l];if(f===Error||null!=f&&f.prototype instanceof Error){if(c instanceof f)return o(a).call(u,c)}else if("function"==typeof f){var h=o(f).call(u,c);if(h===i)return h;if(h)return o(a).call(u,c)}else if(t.isObject(c)){for(var p=n(f),d=0;d<p.length;++d){var m=p[d];if(f[m]!=c[m])continue e}return o(a).call(u,c)}}return e}}}},5910:e=>{"use strict";e.exports=function(e){var t=!1,r=[];function n(){this._trace=new n.CapturedTrace(o())}function o(){var e=r.length-1;if(e>=0)return r[e]}return e.prototype._promiseCreated=function(){},e.prototype._pushContext=function(){},e.prototype._popContext=function(){return null},e._peekContext=e.prototype._peekContext=function(){},n.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,r.push(this._trace))},n.prototype._popContext=function(){if(void 0!==this._trace){var e=r.pop(),t=e._promiseCreated;return e._promiseCreated=null,t}return null},n.CapturedTrace=null,n.create=function(){if(t)return new n},n.deactivateLongStackTraces=function(){},n.activateLongStackTraces=function(){var r=e.prototype._pushContext,i=e.prototype._popContext,a=e._peekContext,s=e.prototype._peekContext,c=e.prototype._promiseCreated;n.deactivateLongStackTraces=function(){e.prototype._pushContext=r,e.prototype._popContext=i,e._peekContext=a,e.prototype._peekContext=s,e.prototype._promiseCreated=c,t=!1},t=!0,e.prototype._pushContext=n.prototype._pushContext,e.prototype._popContext=n.prototype._popContext,e._peekContext=e.prototype._peekContext=o,e.prototype._promiseCreated=function(){var e=this._peekContext();e&&null==e._promiseCreated&&(e._promiseCreated=this)}},n}},461:(e,t,r)=>{"use strict";e.exports=function(e,t,n,o){var i,a,s,c,u=e._async,l=r(7621).Warning,f=r(5942),h=r(9571),p=f.canAttachTrace,d=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,m=/\((?:timers\.js):\d+:\d+\)/,g=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,v=null,y=null,_=!1,b=!(0==f.env("BLUEBIRD_DEBUG")||!f.env("BLUEBIRD_DEBUG")&&"development"!==f.env("NODE_ENV")),w=!(0==f.env("BLUEBIRD_WARNINGS")||!b&&!f.env("BLUEBIRD_WARNINGS")),E=!(0==f.env("BLUEBIRD_LONG_STACK_TRACES")||!b&&!f.env("BLUEBIRD_LONG_STACK_TRACES")),S=0!=f.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(w||!!f.env("BLUEBIRD_W_FORGOTTEN_RETURN"));!function(){var t=[];function r(){for(var e=0;e<t.length;++e)t[e]._notifyUnhandledRejection();n()}function n(){t.length=0}c=function(e){t.push(e),setTimeout(r,1)},h.defineProperty(e,"_unhandledRejectionCheck",{value:r}),h.defineProperty(e,"_unhandledRejectionClear",{value:n})}(),e.prototype.suppressUnhandledRejections=function(){var e=this._target();e._bitField=-1048577&e._bitField|524288},e.prototype._ensurePossibleRejectionHandled=function(){0==(524288&this._bitField)&&(this._setRejectionIsUnhandled(),c(this))},e.prototype._notifyUnhandledRejectionIsHandled=function(){q("rejectionHandled",i,void 0,this)},e.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},e.prototype._returnedNonUndefined=function(){return 0!=(268435456&this._bitField)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var e=this._settledValue();this._setUnhandledRejectionIsNotified(),q("unhandledRejection",a,e,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},e.prototype._warn=function(e,t,r){return V(e,t,r||this)},e.onPossiblyUnhandledRejection=function(t){var r=e._getContext();a=f.contextBind(r,t)},e.onUnhandledRejectionHandled=function(t){var r=e._getContext();i=f.contextBind(r,t)};var A=function(){};e.longStackTraces=function(){if(u.haveItemsQueued()&&!te.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!te.longStackTraces&&W()){var r=e.prototype._captureStackTrace,n=e.prototype._attachExtraTrace,o=e.prototype._dereferenceTrace;te.longStackTraces=!0,A=function(){if(u.haveItemsQueued()&&!te.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");e.prototype._captureStackTrace=r,e.prototype._attachExtraTrace=n,e.prototype._dereferenceTrace=o,t.deactivateLongStackTraces(),te.longStackTraces=!1},e.prototype._captureStackTrace=B,e.prototype._attachExtraTrace=U,e.prototype._dereferenceTrace=z,t.activateLongStackTraces()}},e.hasLongStackTraces=function(){return te.longStackTraces&&W()};var C={unhandledrejection:{before:function(){var e=f.global.onunhandledrejection;return f.global.onunhandledrejection=null,e},after:function(e){f.global.onunhandledrejection=e}},rejectionhandled:{before:function(){var e=f.global.onrejectionhandled;return f.global.onrejectionhandled=null,e},after:function(e){f.global.onrejectionhandled=e}}},k=function(){var e=function(e,t){if(!e)return!f.global.dispatchEvent(t);var r;try{return r=e.before(),!f.global.dispatchEvent(t)}finally{e.after(r)}};try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return f.global.dispatchEvent(t),function(t,r){t=t.toLowerCase();var n=new CustomEvent(t,{detail:r,cancelable:!0});return h.defineProperty(n,"promise",{value:r.promise}),h.defineProperty(n,"reason",{value:r.reason}),e(C[t],n)}}if("function"==typeof Event){t=new Event("CustomEvent");return f.global.dispatchEvent(t),function(t,r){t=t.toLowerCase();var n=new Event(t,{cancelable:!0});return n.detail=r,h.defineProperty(n,"promise",{value:r.promise}),h.defineProperty(n,"reason",{value:r.reason}),e(C[t],n)}}return(t=document.createEvent("CustomEvent")).initCustomEvent("testingtheevent",!1,!0,{}),f.global.dispatchEvent(t),function(t,r){t=t.toLowerCase();var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,!1,!0,r),e(C[t],n)}}catch(e){}return function(){return!1}}(),x=f.isNode?function(){return process.emit.apply(process,arguments)}:f.global?function(e){var t="on"+e.toLowerCase(),r=f.global[t];return!!r&&(r.apply(f.global,[].slice.call(arguments,1)),!0)}:function(){return!1};function P(e,t){return{promise:t}}var I={promiseCreated:P,promiseFulfilled:P,promiseRejected:P,promiseResolved:P,promiseCancelled:P,promiseChained:function(e,t,r){return{promise:t,child:r}},warning:function(e,t){return{warning:t}},unhandledRejection:function(e,t,r){return{reason:t,promise:r}},rejectionHandled:P},T=function(e){var t=!1;try{t=x.apply(null,arguments)}catch(e){u.throwLater(e),t=!0}var r=!1;try{r=k(e,I[e].apply(null,arguments))}catch(e){u.throwLater(e),r=!0}return r||t};function O(){return!1}function R(e,t,r){var n=this;try{e(t,r,(function(e){if("function"!=typeof e)throw new TypeError("onCancel must be a function, got: "+f.toString(e));n._attachCancellationCallback(e)}))}catch(e){return e}}function F(e){if(!this._isCancellable())return this;var t=this._onCancel();void 0!==t?f.isArray(t)?t.push(e):this._setOnCancel([t,e]):this._setOnCancel(e)}function D(){return this._onCancelField}function M(e){this._onCancelField=e}function N(){this._cancellationParent=void 0,this._onCancelField=void 0}function L(e,t){if(0!=(1&t)){this._cancellationParent=e;var r=e._branchesRemainingToCancel;void 0===r&&(r=0),e._branchesRemainingToCancel=r+1}0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)}e.config=function(t){if("longStackTraces"in(t=Object(t))&&(t.longStackTraces?e.longStackTraces():!t.longStackTraces&&e.hasLongStackTraces()&&A()),"warnings"in t){var r=t.warnings;te.warnings=!!r,S=te.warnings,f.isObject(r)&&"wForgottenReturn"in r&&(S=!!r.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!te.cancellation){if(u.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");e.prototype._clearCancellationData=N,e.prototype._propagateFrom=L,e.prototype._onCancel=D,e.prototype._setOnCancel=M,e.prototype._attachCancellationCallback=F,e.prototype._execute=R,j=L,te.cancellation=!0}if("monitoring"in t&&(t.monitoring&&!te.monitoring?(te.monitoring=!0,e.prototype._fireEvent=T):!t.monitoring&&te.monitoring&&(te.monitoring=!1,e.prototype._fireEvent=O)),"asyncHooks"in t&&f.nodeSupportsAsyncResource){var i=te.asyncHooks,a=!!t.asyncHooks;i!==a&&(te.asyncHooks=a,a?n():o())}return e},e.prototype._fireEvent=O,e.prototype._execute=function(e,t,r){try{e(t,r)}catch(e){return e}},e.prototype._onCancel=function(){},e.prototype._setOnCancel=function(e){},e.prototype._attachCancellationCallback=function(e){},e.prototype._captureStackTrace=function(){},e.prototype._attachExtraTrace=function(){},e.prototype._dereferenceTrace=function(){},e.prototype._clearCancellationData=function(){},e.prototype._propagateFrom=function(e,t){};var j=function(e,t){0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)};function H(){var t=this._boundTo;return void 0!==t&&t instanceof e?t.isFulfilled()?t.value():void 0:t}function B(){this._trace=new J(this._peekContext())}function U(e,t){if(p(e)){var r=this._trace;if(void 0!==r&&t&&(r=r._parent),void 0!==r)r.attachExtraTrace(e);else if(!e.__stackCleaned__){var n=$(e);f.notEnumerableProp(e,"stack",n.message+"\n"+n.stack.join("\n")),f.notEnumerableProp(e,"__stackCleaned__",!0)}}}function z(){this._trace=void 0}function V(t,r,n){if(te.warnings){var o,i=new l(t);if(r)n._attachExtraTrace(i);else if(te.longStackTraces&&(o=e._peekContext()))o.attachExtraTrace(i);else{var a=$(i);i.stack=a.message+"\n"+a.stack.join("\n")}T("warning",i)||X(i,"",!0)}}function G(e){for(var t=[],r=0;r<e.length;++r){var n=e[r],o=" (No stack trace)"===n||v.test(n),i=o&&Y(n);o&&!i&&(_&&" "!==n.charAt(0)&&(n=" "+n),t.push(n))}return t}function $(e){var t=e.stack,r=e.toString();return t="string"==typeof t&&t.length>0?function(e){for(var t=e.stack.replace(/\s+$/g,"").split("\n"),r=0;r<t.length;++r){var n=t[r];if(" (No stack trace)"===n||v.test(n))break}return r>0&&"SyntaxError"!=e.name&&(t=t.slice(r)),t}(e):[" (No stack trace)"],{message:r,stack:"SyntaxError"==e.name?t:G(t)}}function X(e,t,r){if("undefined"!=typeof console){var n;if(f.isObject(e)){var o=e.stack;n=t+y(o,e)}else n=t+String(e);"function"==typeof s?s(n,r):"function"!=typeof console.log&&"object"!=typeof console.log||console.log(n)}}function q(e,t,r,n){var o=!1;try{"function"==typeof t&&(o=!0,"rejectionHandled"===e?t(n):t(r,n))}catch(e){u.throwLater(e)}"unhandledRejection"===e?T(e,r,n)||o||X(r,"Unhandled rejection "):T(e,n)}function K(e){var t;if("function"==typeof e)t="[function "+(e.name||"anonymous")+"]";else{t=e&&"function"==typeof e.toString?e.toString():f.toString(e);if(/\[object [a-zA-Z0-9$_]+\]/.test(t))try{t=JSON.stringify(e)}catch(e){}0===t.length&&(t="(empty array)")}return"(<"+function(e){var t=41;if(e.length<t)return e;return e.substr(0,t-3)+"..."}(t)+">, no stack trace)"}function W(){return"function"==typeof ee}var Y=function(){return!1},Z=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function Q(e){var t=e.match(Z);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function J(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);ee(this,J),t>32&&this.uncycle()}f.inherits(J,Error),t.CapturedTrace=J,J.prototype.uncycle=function(){var e=this._length;if(!(e<2)){for(var t=[],r={},n=0,o=this;void 0!==o;++n)t.push(o),o=o._parent;for(n=(e=this._length=n)-1;n>=0;--n){var i=t[n].stack;void 0===r[i]&&(r[i]=n)}for(n=0;n<e;++n){var a=r[t[n].stack];if(void 0!==a&&a!==n){a>0&&(t[a-1]._parent=void 0,t[a-1]._length=1),t[n]._parent=void 0,t[n]._length=1;var s=n>0?t[n-1]:this;a<e-1?(s._parent=t[a+1],s._parent.uncycle(),s._length=s._parent._length+1):(s._parent=void 0,s._length=1);for(var c=s._length+1,u=n-2;u>=0;--u)t[u]._length=c,c++;return}}}},J.prototype.attachExtraTrace=function(e){if(!e.__stackCleaned__){this.uncycle();for(var t=$(e),r=t.message,n=[t.stack],o=this;void 0!==o;)n.push(G(o.stack.split("\n"))),o=o._parent;!function(e){for(var t=e[0],r=1;r<e.length;++r){for(var n=e[r],o=t.length-1,i=t[o],a=-1,s=n.length-1;s>=0;--s)if(n[s]===i){a=s;break}for(s=a;s>=0;--s){var c=n[s];if(t[o]!==c)break;t.pop(),o--}t=n}}(n),function(e){for(var t=0;t<e.length;++t)(0===e[t].length||t+1<e.length&&e[t][0]===e[t+1][0])&&(e.splice(t,1),t--)}(n),f.notEnumerableProp(e,"stack",function(e,t){for(var r=0;r<t.length-1;++r)t[r].push("From previous event:"),t[r]=t[r].join("\n");return r<t.length&&(t[r]=t[r].join("\n")),e+"\n"+t.join("\n")}(r,n)),f.notEnumerableProp(e,"__stackCleaned__",!0)}};var ee=function(){var e=/^\s*at\s*/,t=function(e,t){return"string"==typeof e?e:void 0!==t.name&&void 0!==t.message?t.toString():K(t)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,v=e,y=t;var r=Error.captureStackTrace;return Y=function(e){return d.test(e)},function(e,t){Error.stackTraceLimit+=6,r(e,t),Error.stackTraceLimit-=6}}var n,o=new Error;if("string"==typeof o.stack&&o.stack.split("\n")[0].indexOf("stackDetection@")>=0)return v=/@/,y=t,_=!0,function(e){e.stack=(new Error).stack};try{throw new Error}catch(e){n="stack"in e}return!("stack"in o)&&n&&"number"==typeof Error.stackTraceLimit?(v=e,y=t,function(e){Error.stackTraceLimit+=6;try{throw new Error}catch(t){e.stack=t.stack}Error.stackTraceLimit-=6}):(y=function(e,t){return"string"==typeof e?e:"object"!=typeof t&&"function"!=typeof t||void 0===t.name||void 0===t.message?K(t):t.toString()},null)}();"undefined"!=typeof console&&void 0!==console.warn&&(s=function(e){console.warn(e)},f.isNode&&process.stderr.isTTY?s=function(e,t){var r=t?"":"";console.warn(r+e+"\n")}:f.isNode||"string"!=typeof(new Error).stack||(s=function(e,t){console.warn("%c"+e,t?"color: darkorange":"color: red")}));var te={warnings:w,longStackTraces:!1,cancellation:!1,monitoring:!1,asyncHooks:!1};return E&&e.longStackTraces(),{asyncHooks:function(){return te.asyncHooks},longStackTraces:function(){return te.longStackTraces},warnings:function(){return te.warnings},cancellation:function(){return te.cancellation},monitoring:function(){return te.monitoring},propagateFromFunction:function(){return j},boundValueFunction:function(){return H},checkForgottenReturns:function(e,t,r,n,o){if(void 0===e&&null!==t&&S){if(void 0!==o&&o._returnedNonUndefined())return;if(0==(65535&n._bitField))return;r&&(r+=" ");var i="",a="";if(t._trace){for(var s=t._trace.stack.split("\n"),c=G(s),u=c.length-1;u>=0;--u){var l=c[u];if(!m.test(l)){var f=l.match(g);f&&(i="at "+f[1]+":"+f[2]+":"+f[3]+" ");break}}if(c.length>0){var h=c[0];for(u=0;u<s.length;++u)if(s[u]===h){u>0&&(a="\n"+s[u-1]);break}}}var p="a promise was created in a "+r+"handler "+i+"but was not returned from it, see http://goo.gl/rRqMUw"+a;n._warn(p,!0,t)}},setBounds:function(e,t){if(W()){for(var r,n,o=(e.stack||"").split("\n"),i=(t.stack||"").split("\n"),a=-1,s=-1,c=0;c<o.length;++c){if(u=Q(o[c])){r=u.fileName,a=u.line;break}}for(c=0;c<i.length;++c){var u;if(u=Q(i[c])){n=u.fileName,s=u.line;break}}a<0||s<0||!r||!n||r!==n||a>=s||(Y=function(e){if(d.test(e))return!0;var t=Q(e);return!!(t&&t.fileName===r&&a<=t.line&&t.line<=s)})}},warn:V,deprecated:function(e,t){var r=e+" is deprecated and will be removed in a future version.";return t&&(r+=" Use "+t+" instead."),V(r)},CapturedTrace:J,fireDomEvent:k,fireGlobalEvent:x}}},5632:e=>{"use strict";e.exports=function(e){function t(){return this.value}function r(){throw this.reason}e.prototype.return=e.prototype.thenReturn=function(r){return r instanceof e&&r.suppressUnhandledRejections(),this._then(t,void 0,void 0,{value:r},void 0)},e.prototype.throw=e.prototype.thenThrow=function(e){return this._then(r,void 0,void 0,{reason:e},void 0)},e.prototype.catchThrow=function(e){if(arguments.length<=1)return this._then(void 0,r,void 0,{reason:e},void 0);var t=arguments[1],n=function(){throw t};return this.caught(e,n)},e.prototype.catchReturn=function(r){if(arguments.length<=1)return r instanceof e&&r.suppressUnhandledRejections(),this._then(void 0,t,void 0,{value:r},void 0);var n=arguments[1];n instanceof e&&n.suppressUnhandledRejections();var o=function(){return n};return this.caught(r,o)}}},6574:e=>{"use strict";e.exports=function(e,t){var r=e.reduce,n=e.all;function o(){return n(this)}e.prototype.each=function(e){return r(this,e,t,0)._then(o,void 0,void 0,this,void 0)},e.prototype.mapSeries=function(e){return r(this,e,t,t)},e.each=function(e,n){return r(e,n,t,0)._then(o,void 0,void 0,e,void 0)},e.mapSeries=function(e,n){return r(e,n,t,t)}}},7621:(e,t,r)=>{"use strict";var n,o,i=r(9571),a=i.freeze,s=r(5942),c=s.inherits,u=s.notEnumerableProp;function l(e,t){function r(n){if(!(this instanceof r))return new r(n);u(this,"message","string"==typeof n?n:t),u(this,"name",e),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return c(r,Error),r}var f=l("Warning","warning"),h=l("CancellationError","cancellation error"),p=l("TimeoutError","timeout error"),d=l("AggregateError","aggregate error");try{n=TypeError,o=RangeError}catch(e){n=l("TypeError","type error"),o=l("RangeError","range error")}for(var m="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),g=0;g<m.length;++g)"function"==typeof Array.prototype[m[g]]&&(d.prototype[m[g]]=Array.prototype[m[g]]);i.defineProperty(d.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),d.prototype.isOperational=!0;var v=0;function y(e){if(!(this instanceof y))return new y(e);u(this,"name","OperationalError"),u(this,"message",e),this.cause=e,this.isOperational=!0,e instanceof Error?(u(this,"message",e.message),u(this,"stack",e.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}d.prototype.toString=function(){var e=Array(4*v+1).join(" "),t="\n"+e+"AggregateError of:\n";v++,e=Array(4*v+1).join(" ");for(var r=0;r<this.length;++r){for(var n=this[r]===this?"[Circular AggregateError]":this[r]+"",o=n.split("\n"),i=0;i<o.length;++i)o[i]=e+o[i];t+=(n=o.join("\n"))+"\n"}return v--,t},c(y,Error);var _=Error.__BluebirdErrorTypes__;_||(_=a({CancellationError:h,TimeoutError:p,OperationalError:y,RejectionError:y,AggregateError:d}),i.defineProperty(Error,"__BluebirdErrorTypes__",{value:_,writable:!1,enumerable:!1,configurable:!1})),e.exports={Error,TypeError:n,RangeError:o,CancellationError:_.CancellationError,OperationalError:_.OperationalError,TimeoutError:_.TimeoutError,AggregateError:_.AggregateError,Warning:f}},9571:e=>{var t=function(){"use strict";return void 0===this}();if(t)e.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:t,propertyIsWritable:function(e,t){var r=Object.getOwnPropertyDescriptor(e,t);return!(r&&!r.writable&&!r.set)}};else{var r={}.hasOwnProperty,n={}.toString,o={}.constructor.prototype,i=function(e){var t=[];for(var n in e)r.call(e,n)&&t.push(n);return t};e.exports={isArray:function(e){try{return"[object Array]"===n.call(e)}catch(e){return!1}},keys:i,names:i,defineProperty:function(e,t,r){return e[t]=r.value,e},getDescriptor:function(e,t){return{value:e[t]}},freeze:function(e){return e},getPrototypeOf:function(e){try{return Object(e).constructor.prototype}catch(e){return o}},isES5:t,propertyIsWritable:function(){return!0}}}},6777:e=>{"use strict";e.exports=function(e,t){var r=e.map;e.prototype.filter=function(e,n){return r(this,e,n,t)},e.filter=function(e,n,o){return r(e,n,o,t)}}},7707:(e,t,r)=>{"use strict";e.exports=function(e,t,n){var o=r(5942),i=e.CancellationError,a=o.errorObj,s=r(9976)(n);function c(e,t,r){this.promise=e,this.type=t,this.handler=r,this.called=!1,this.cancelPromise=null}function u(e){this.finallyHandler=e}function l(e,t){return null!=e.cancelPromise&&(arguments.length>1?e.cancelPromise._reject(t):e.cancelPromise._cancel(),e.cancelPromise=null,!0)}function f(){return p.call(this,this.promise._target()._settledValue())}function h(e){if(!l(this,e))return a.e=e,a}function p(r){var o=this.promise,s=this.handler;if(!this.called){this.called=!0;var c=this.isFinallyHandler()?s.call(o._boundValue()):s.call(o._boundValue(),r);if(c===n)return c;if(void 0!==c){o._setReturnedNonUndefined();var p=t(c,o);if(p instanceof e){if(null!=this.cancelPromise){if(p._isCancelled()){var d=new i("late cancellation observer");return o._attachExtraTrace(d),a.e=d,a}p.isPending()&&p._attachCancellationCallback(new u(this))}return p._then(f,h,void 0,this,void 0)}}}return o.isRejected()?(l(this),a.e=r,a):(l(this),r)}return c.prototype.isFinallyHandler=function(){return 0===this.type},u.prototype._resultCancelled=function(){l(this.finallyHandler)},e.prototype._passThrough=function(e,t,r,n){return"function"!=typeof e?this.then():this._then(r,n,void 0,new c(this,t,e),void 0)},e.prototype.lastly=e.prototype.finally=function(e){return this._passThrough(e,0,p,p)},e.prototype.tap=function(e){return this._passThrough(e,1,p)},e.prototype.tapCatch=function(t){var r=arguments.length;if(1===r)return this._passThrough(t,1,void 0,p);var n,i=new Array(r-1),a=0;for(n=0;n<r-1;++n){var c=arguments[n];if(!o.isObject(c))return e.reject(new TypeError("tapCatch statement predicate: expecting an object but got "+o.classString(c)));i[a++]=c}i.length=a;var u=arguments[n];return this._passThrough(s(i,u,this),1,void 0,p)},c}},687:(e,t,r)=>{"use strict";e.exports=function(e,t,n,o,i,a){var s=r(7621).TypeError,c=r(5942),u=c.errorObj,l=c.tryCatch,f=[];function h(t,r,o,i){if(a.cancellation()){var s=new e(n),c=this._finallyPromise=new e(n);this._promise=s.lastly((function(){return c})),s._captureStackTrace(),s._setOnCancel(this)}else{(this._promise=new e(n))._captureStackTrace()}this._stack=i,this._generatorFunction=t,this._receiver=r,this._generator=void 0,this._yieldHandlers="function"==typeof o?[o].concat(f):f,this._yieldedPromise=null,this._cancellationPhase=!1}c.inherits(h,i),h.prototype._isResolved=function(){return null===this._promise},h.prototype._cleanup=function(){this._promise=this._generator=null,a.cancellation()&&null!==this._finallyPromise&&(this._finallyPromise._fulfill(),this._finallyPromise=null)},h.prototype._promiseCancelled=function(){if(!this._isResolved()){var t;if(void 0!==this._generator.return)this._promise._pushContext(),t=l(this._generator.return).call(this._generator,void 0),this._promise._popContext();else{var r=new e.CancellationError("generator .return() sentinel");e.coroutine.returnSentinel=r,this._promise._attachExtraTrace(r),this._promise._pushContext(),t=l(this._generator.throw).call(this._generator,r),this._promise._popContext()}this._cancellationPhase=!0,this._yieldedPromise=null,this._continue(t)}},h.prototype._promiseFulfilled=function(e){this._yieldedPromise=null,this._promise._pushContext();var t=l(this._generator.next).call(this._generator,e);this._promise._popContext(),this._continue(t)},h.prototype._promiseRejected=function(e){this._yieldedPromise=null,this._promise._attachExtraTrace(e),this._promise._pushContext();var t=l(this._generator.throw).call(this._generator,e);this._promise._popContext(),this._continue(t)},h.prototype._resultCancelled=function(){if(this._yieldedPromise instanceof e){var t=this._yieldedPromise;this._yieldedPromise=null,t.cancel()}},h.prototype.promise=function(){return this._promise},h.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._promiseFulfilled(void 0)},h.prototype._continue=function(t){var r=this._promise;if(t===u)return this._cleanup(),this._cancellationPhase?r.cancel():r._rejectCallback(t.e,!1);var n=t.value;if(!0===t.done)return this._cleanup(),this._cancellationPhase?r.cancel():r._resolveCallback(n);var i=o(n,this._promise);if(i instanceof e||(i=function(t,r,n){for(var i=0;i<r.length;++i){n._pushContext();var a=l(r[i])(t);if(n._popContext(),a===u){n._pushContext();var s=e.reject(u.e);return n._popContext(),s}var c=o(a,n);if(c instanceof e)return c}return null}(i,this._yieldHandlers,this._promise),null!==i)){var a=(i=i._target())._bitField;0==(50397184&a)?(this._yieldedPromise=i,i._proxy(this,null)):0!=(33554432&a)?e._async.invoke(this._promiseFulfilled,this,i._value()):0!=(16777216&a)?e._async.invoke(this._promiseRejected,this,i._reason()):this._promiseCancelled()}else this._promiseRejected(new s("A value %s was yielded that could not be treated as a promise\n\n See http://goo.gl/MqrFmX\n\n".replace("%s",String(n))+"From coroutine:\n"+this._stack.split("\n").slice(1,-7).join("\n")))},e.coroutine=function(e,t){if("function"!=typeof e)throw new s("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var r=Object(t).yieldHandler,n=h,o=(new Error).stack;return function(){var t=e.apply(this,arguments),i=new n(void 0,void 0,r,o),a=i.promise();return i._generator=t,i._promiseFulfilled(void 0),a}},e.coroutine.addYieldHandler=function(e){if("function"!=typeof e)throw new s("expecting a function but got "+c.classString(e));f.push(e)},e.spawn=function(r){if(a.deprecated("Promise.spawn()","Promise.coroutine()"),"function"!=typeof r)return t("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var n=new h(r,this),o=n.promise();return n._run(e.spawn),o}}},7717:(e,t,r)=>{"use strict";e.exports=function(e,t,n,o,i){var a,s=r(5942),c=s.canEvaluate,u=s.tryCatch,l=s.errorObj;if(c){for(var f=function(e){return new Function("value","holder"," \n 'use strict'; \n holder.pIndex = value; \n holder.checkFulfillment(this); \n ".replace(/Index/g,e))},h=function(e){return new Function("promise","holder"," \n 'use strict'; \n holder.pIndex = promise; \n ".replace(/Index/g,e))},p=function(t){for(var r=new Array(t),n=0;n<r.length;++n)r[n]="this.p"+(n+1);var o=r.join(" = ")+" = null;",a="var promise;\n"+r.map((function(e){return" \n promise = "+e+"; \n if (promise instanceof Promise) { \n promise.cancel(); \n } \n "})).join("\n"),s=r.join(", "),c="Holder$"+t,f="return function(tryCatch, errorObj, Promise, async) { \n 'use strict'; \n function [TheName](fn) { \n [TheProperties] \n this.fn = fn; \n this.asyncNeeded = true; \n this.now = 0; \n } \n \n [TheName].prototype._callFunction = function(promise) { \n promise._pushContext(); \n var ret = tryCatch(this.fn)([ThePassedArguments]); \n promise._popContext(); \n if (ret === errorObj) { \n promise._rejectCallback(ret.e, false); \n } else { \n promise._resolveCallback(ret); \n } \n }; \n \n [TheName].prototype.checkFulfillment = function(promise) { \n var now = ++this.now; \n if (now === [TheTotal]) { \n if (this.asyncNeeded) { \n async.invoke(this._callFunction, this, promise); \n } else { \n this._callFunction(promise); \n } \n \n } \n }; \n \n [TheName].prototype._resultCancelled = function() { \n [CancellationCode] \n }; \n \n return [TheName]; \n }(tryCatch, errorObj, Promise, async); \n ";return f=f.replace(/\[TheName\]/g,c).replace(/\[TheTotal\]/g,t).replace(/\[ThePassedArguments\]/g,s).replace(/\[TheProperties\]/g,o).replace(/\[CancellationCode\]/g,a),new Function("tryCatch","errorObj","Promise","async",f)(u,l,e,i)},d=[],m=[],g=[],v=0;v<8;++v)d.push(p(v+1)),m.push(f(v+1)),g.push(h(v+1));a=function(e){this._reject(e)}}e.join=function(){var r,i=arguments.length-1;if(i>0&&"function"==typeof arguments[i]&&(r=arguments[i],i<=8&&c)){(E=new e(o))._captureStackTrace();for(var u=d[i-1],l=new u(r),f=m,h=0;h<i;++h){var p=n(arguments[h],E);if(p instanceof e){var v=(p=p._target())._bitField;0==(50397184&v)?(p._then(f[h],a,void 0,E,l),g[h](p,l),l.asyncNeeded=!1):0!=(33554432&v)?f[h].call(E,p._value(),l):0!=(16777216&v)?E._reject(p._reason()):E._cancel()}else f[h].call(E,p,l)}if(!E._isFateSealed()){if(l.asyncNeeded){var y=e._getContext();l.fn=s.contextBind(y,l.fn)}E._setAsyncGuaranteed(),E._setOnCancel(l)}return E}for(var _=arguments.length,b=new Array(_),w=0;w<_;++w)b[w]=arguments[w];r&&b.pop();var E=new t(b).promise();return void 0!==r?E.spread(r):E}}},6343:(e,t,r)=>{"use strict";e.exports=function(e,t,n,o,i,a){var s=r(5942),c=s.tryCatch,u=s.errorObj,l=e._async;function f(t,r,n,o){this.constructor$(t),this._promise._captureStackTrace();var a=e._getContext();if(this._callback=s.contextBind(a,r),this._preservedValues=o===i?new Array(this.length()):null,this._limit=n,this._inFlight=0,this._queue=[],l.invoke(this._asyncInit,this,void 0),s.isArray(t))for(var c=0;c<t.length;++c){var u=t[c];u instanceof e&&u.suppressUnhandledRejections()}}function h(t,r,o,i){if("function"!=typeof r)return n("expecting a function but got "+s.classString(r));var a=0;if(void 0!==o){if("object"!=typeof o||null===o)return e.reject(new TypeError("options argument must be an object but it is "+s.classString(o)));if("number"!=typeof o.concurrency)return e.reject(new TypeError("'concurrency' must be a number but it is "+s.classString(o.concurrency)));a=o.concurrency}return new f(t,r,a="number"==typeof a&&isFinite(a)&&a>=1?a:0,i).promise()}s.inherits(f,t),f.prototype._asyncInit=function(){this._init$(void 0,-2)},f.prototype._init=function(){},f.prototype._promiseFulfilled=function(t,r){var n=this._values,i=this.length(),s=this._preservedValues,l=this._limit;if(r<0){if(n[r=-1*r-1]=t,l>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(l>=1&&this._inFlight>=l)return n[r]=t,this._queue.push(r),!1;null!==s&&(s[r]=t);var f=this._promise,h=this._callback,p=f._boundValue();f._pushContext();var d=c(h).call(p,t,r,i),m=f._popContext();if(a.checkForgottenReturns(d,m,null!==s?"Promise.filter":"Promise.map",f),d===u)return this._reject(d.e),!0;var g=o(d,this._promise);if(g instanceof e){var v=(g=g._target())._bitField;if(0==(50397184&v))return l>=1&&this._inFlight++,n[r]=g,g._proxy(this,-1*(r+1)),!1;if(0==(33554432&v))return 0!=(16777216&v)?(this._reject(g._reason()),!0):(this._cancel(),!0);d=g._value()}n[r]=d}return++this._totalResolved>=i&&(null!==s?this._filter(n,s):this._resolve(n),!0)},f.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,r=this._values;e.length>0&&this._inFlight<t;){if(this._isResolved())return;var n=e.pop();this._promiseFulfilled(r[n],n)}},f.prototype._filter=function(e,t){for(var r=t.length,n=new Array(r),o=0,i=0;i<r;++i)e[i]&&(n[o++]=t[i]);n.length=o,this._resolve(n)},f.prototype.preservedValues=function(){return this._preservedValues},e.prototype.map=function(e,t){return h(this,e,t,null)},e.map=function(e,t,r,n){return h(e,t,r,n)}}},6926:(e,t,r)=>{"use strict";e.exports=function(e,t,n,o,i){var a=r(5942),s=a.tryCatch;e.method=function(r){if("function"!=typeof r)throw new e.TypeError("expecting a function but got "+a.classString(r));return function(){var n=new e(t);n._captureStackTrace(),n._pushContext();var o=s(r).apply(this,arguments),a=n._popContext();return i.checkForgottenReturns(o,a,"Promise.method",n),n._resolveFromSyncValue(o),n}},e.attempt=e.try=function(r){if("function"!=typeof r)return o("expecting a function but got "+a.classString(r));var n,c=new e(t);if(c._captureStackTrace(),c._pushContext(),arguments.length>1){i.deprecated("calling Promise.try with more than 1 argument");var u=arguments[1],l=arguments[2];n=a.isArray(u)?s(r).apply(l,u):s(r).call(l,u)}else n=s(r)();var f=c._popContext();return i.checkForgottenReturns(n,f,"Promise.try",c),c._resolveFromSyncValue(n),c},e.prototype._resolveFromSyncValue=function(e){e===a.errorObj?this._rejectCallback(e.e,!1):this._resolveCallback(e,!0)}}},1776:(e,t,r)=>{"use strict";var n=r(5942),o=n.maybeWrapAsError,i=r(7621).OperationalError,a=r(9571);var s=/^(?:name|message|stack|cause)$/;function c(e){var t;if(function(e){return e instanceof Error&&a.getPrototypeOf(e)===Error.prototype}(e)){(t=new i(e)).name=e.name,t.message=e.message,t.stack=e.stack;for(var r=a.keys(e),o=0;o<r.length;++o){var c=r[o];s.test(c)||(t[c]=e[c])}return t}return n.markAsOriginatingFromRejection(e),e}e.exports=function(e,t){return function(r,n){if(null!==e){if(r){var i=c(o(r));e._attachExtraTrace(i),e._reject(i)}else if(t){for(var a=arguments.length,s=new Array(Math.max(a-1,0)),u=1;u<a;++u)s[u-1]=arguments[u];e._fulfill(s)}else e._fulfill(n);e=null}}}},1941:(e,t,r)=>{"use strict";e.exports=function(e){var t=r(5942),n=e._async,o=t.tryCatch,i=t.errorObj;function a(e,r){if(!t.isArray(e))return s.call(this,e,r);var a=o(r).apply(this._boundValue(),[null].concat(e));a===i&&n.throwLater(a.e)}function s(e,t){var r=this._boundValue(),a=void 0===e?o(t).call(r,null):o(t).call(r,null,e);a===i&&n.throwLater(a.e)}function c(e,t){if(!e){var r=new Error(e+"");r.cause=e,e=r}var a=o(t).call(this._boundValue(),e);a===i&&n.throwLater(a.e)}e.prototype.asCallback=e.prototype.nodeify=function(e,t){if("function"==typeof e){var r=s;void 0!==t&&Object(t).spread&&(r=a),this._then(r,c,void 0,this,e)}return this}}},7502:(e,t,r)=>{"use strict";e.exports=function(){var t=function(){return new v("circular promise resolution chain\n\n See http://goo.gl/MqrFmX\n")},n=function(){return new R.PromiseInspection(this._target())},o=function(e){return R.reject(new v(e))};function i(){}var a={},s=r(5942);s.setReflectHandler(n);var c=function(){var e=process.domain;return void 0===e?null:e},u=function(){return{domain:c(),async:null}},l=s.isNode&&s.nodeSupportsAsyncResource?r(852).AsyncResource:null,f=function(){return{domain:c(),async:new l("Bluebird::Promise")}},h=s.isNode?u:function(){return null};s.notEnumerableProp(R,"_getContext",h);var p=r(9571),d=r(4601),m=new d;p.defineProperty(R,"_async",{value:m});var g=r(7621),v=R.TypeError=g.TypeError;R.RangeError=g.RangeError;var y=R.CancellationError=g.CancellationError;R.TimeoutError=g.TimeoutError,R.OperationalError=g.OperationalError,R.RejectionError=g.OperationalError,R.AggregateError=g.AggregateError;var _=function(){},b={},w={},E=r(1778)(R,_),S=r(1640)(R,_,E,o,i),A=r(5910)(R),C=A.create,k=r(461)(R,A,(function(){h=f,s.notEnumerableProp(R,"_getContext",f)}),(function(){h=u,s.notEnumerableProp(R,"_getContext",u)})),x=(k.CapturedTrace,r(7707)(R,E,w)),P=r(9976)(w),I=r(1776),T=s.errorObj,O=s.tryCatch;function R(e){e!==_&&function(e,t){if(null==e||e.constructor!==R)throw new v("the promise constructor cannot be invoked directly\n\n See http://goo.gl/MqrFmX\n");if("function"!=typeof t)throw new v("expecting a function but got "+s.classString(t))}(this,e),this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._resolveFromExecutor(e),this._promiseCreated(),this._fireEvent("promiseCreated",this)}function F(e){this.promise._resolveCallback(e)}function D(e){this.promise._rejectCallback(e,!1)}function M(e){var t=new R(_);t._fulfillmentHandler0=e,t._rejectionHandler0=e,t._promise0=e,t._receiver0=e}return R.prototype.toString=function(){return"[object Promise]"},R.prototype.caught=R.prototype.catch=function(e){var t=arguments.length;if(t>1){var r,n=new Array(t-1),i=0;for(r=0;r<t-1;++r){var a=arguments[r];if(!s.isObject(a))return o("Catch statement predicate: expecting an object but got "+s.classString(a));n[i++]=a}if(n.length=i,"function"!=typeof(e=arguments[r]))throw new v("The last argument to .catch() must be a function, got "+s.toString(e));return this.then(void 0,P(n,e,this))}return this.then(void 0,e)},R.prototype.reflect=function(){return this._then(n,n,void 0,this,void 0)},R.prototype.then=function(e,t){if(k.warnings()&&arguments.length>0&&"function"!=typeof e&&"function"!=typeof t){var r=".then() only accepts functions but was passed: "+s.classString(e);arguments.length>1&&(r+=", "+s.classString(t)),this._warn(r)}return this._then(e,t,void 0,void 0,void 0)},R.prototype.done=function(e,t){this._then(e,t,void 0,void 0,void 0)._setIsFinal()},R.prototype.spread=function(e){return"function"!=typeof e?o("expecting a function but got "+s.classString(e)):this.all()._then(e,void 0,void 0,b,void 0)},R.prototype.toJSON=function(){var e={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(e.fulfillmentValue=this.value(),e.isFulfilled=!0):this.isRejected()&&(e.rejectionReason=this.reason(),e.isRejected=!0),e},R.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new S(this).promise()},R.prototype.error=function(e){return this.caught(s.originatesFromRejection,e)},R.getNewLibraryCopy=e.exports,R.is=function(e){return e instanceof R},R.fromNode=R.fromCallback=function(e){var t=new R(_);t._captureStackTrace();var r=arguments.length>1&&!!Object(arguments[1]).multiArgs,n=O(e)(I(t,r));return n===T&&t._rejectCallback(n.e,!0),t._isFateSealed()||t._setAsyncGuaranteed(),t},R.all=function(e){return new S(e).promise()},R.cast=function(e){var t=E(e);return t instanceof R||((t=new R(_))._captureStackTrace(),t._setFulfilled(),t._rejectionHandler0=e),t},R.resolve=R.fulfilled=R.cast,R.reject=R.rejected=function(e){var t=new R(_);return t._captureStackTrace(),t._rejectCallback(e,!0),t},R.setScheduler=function(e){if("function"!=typeof e)throw new v("expecting a function but got "+s.classString(e));return m.setScheduler(e)},R.prototype._then=function(e,t,r,n,o){var i=void 0!==o,a=i?o:new R(_),c=this._target(),u=c._bitField;i||(a._propagateFrom(this,3),a._captureStackTrace(),void 0===n&&0!=(2097152&this._bitField)&&(n=0!=(50397184&u)?this._boundValue():c===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,a));var l=h();if(0!=(50397184&u)){var f,p,d=c._settlePromiseCtx;0!=(33554432&u)?(p=c._rejectionHandler0,f=e):0!=(16777216&u)?(p=c._fulfillmentHandler0,f=t,c._unsetRejectionIsUnhandled()):(d=c._settlePromiseLateCancellationObserver,p=new y("late cancellation observer"),c._attachExtraTrace(p),f=t),m.invoke(d,c,{handler:s.contextBind(l,f),promise:a,receiver:n,value:p})}else c._addCallbacks(e,t,a,n,l);return a},R.prototype._length=function(){return 65535&this._bitField},R.prototype._isFateSealed=function(){return 0!=(117506048&this._bitField)},R.prototype._isFollowing=function(){return 67108864==(67108864&this._bitField)},R.prototype._setLength=function(e){this._bitField=-65536&this._bitField|65535&e},R.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},R.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},R.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},R.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},R.prototype._isFinal=function(){return(4194304&this._bitField)>0},R.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},R.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},R.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},R.prototype._setAsyncGuaranteed=function(){if(!m.hasCustomScheduler()){var e=this._bitField;this._bitField=e|(536870912&e)>>2^134217728}},R.prototype._setNoAsyncGuarantee=function(){this._bitField=-134217729&(536870912|this._bitField)},R.prototype._receiverAt=function(e){var t=0===e?this._receiver0:this[4*e-4+3];if(t!==a)return void 0===t&&this._isBound()?this._boundValue():t},R.prototype._promiseAt=function(e){return this[4*e-4+2]},R.prototype._fulfillmentHandlerAt=function(e){return this[4*e-4+0]},R.prototype._rejectionHandlerAt=function(e){return this[4*e-4+1]},R.prototype._boundValue=function(){},R.prototype._migrateCallback0=function(e){e._bitField;var t=e._fulfillmentHandler0,r=e._rejectionHandler0,n=e._promise0,o=e._receiverAt(0);void 0===o&&(o=a),this._addCallbacks(t,r,n,o,null)},R.prototype._migrateCallbackAt=function(e,t){var r=e._fulfillmentHandlerAt(t),n=e._rejectionHandlerAt(t),o=e._promiseAt(t),i=e._receiverAt(t);void 0===i&&(i=a),this._addCallbacks(r,n,o,i,null)},R.prototype._addCallbacks=function(e,t,r,n,o){var i=this._length();if(i>=65531&&(i=0,this._setLength(0)),0===i)this._promise0=r,this._receiver0=n,"function"==typeof e&&(this._fulfillmentHandler0=s.contextBind(o,e)),"function"==typeof t&&(this._rejectionHandler0=s.contextBind(o,t));else{var a=4*i-4;this[a+2]=r,this[a+3]=n,"function"==typeof e&&(this[a+0]=s.contextBind(o,e)),"function"==typeof t&&(this[a+1]=s.contextBind(o,t))}return this._setLength(i+1),i},R.prototype._proxy=function(e,t){this._addCallbacks(void 0,void 0,t,e,null)},R.prototype._resolveCallback=function(e,r){if(0==(117506048&this._bitField)){if(e===this)return this._rejectCallback(t(),!1);var n=E(e,this);if(!(n instanceof R))return this._fulfill(e);r&&this._propagateFrom(n,2);var o=n._target();if(o!==this){var i=o._bitField;if(0==(50397184&i)){var a=this._length();a>0&&o._migrateCallback0(this);for(var s=1;s<a;++s)o._migrateCallbackAt(this,s);this._setFollowing(),this._setLength(0),this._setFollowee(n)}else if(0!=(33554432&i))this._fulfill(o._value());else if(0!=(16777216&i))this._reject(o._reason());else{var c=new y("late cancellation observer");o._attachExtraTrace(c),this._reject(c)}}else this._reject(t())}},R.prototype._rejectCallback=function(e,t,r){var n=s.ensureErrorObject(e),o=n===e;if(!o&&!r&&k.warnings()){var i="a promise was rejected with a non-error: "+s.classString(e);this._warn(i,!0)}this._attachExtraTrace(n,!!t&&o),this._reject(e)},R.prototype._resolveFromExecutor=function(e){if(e!==_){var t=this;this._captureStackTrace(),this._pushContext();var r=!0,n=this._execute(e,(function(e){t._resolveCallback(e)}),(function(e){t._rejectCallback(e,r)}));r=!1,this._popContext(),void 0!==n&&t._rejectCallback(n,!0)}},R.prototype._settlePromiseFromHandler=function(e,t,r,n){var o=n._bitField;if(0==(65536&o)){var i;n._pushContext(),t===b?r&&"number"==typeof r.length?i=O(e).apply(this._boundValue(),r):(i=T).e=new v("cannot .spread() a non-array: "+s.classString(r)):i=O(e).call(t,r);var a=n._popContext();0==(65536&(o=n._bitField))&&(i===w?n._reject(r):i===T?n._rejectCallback(i.e,!1):(k.checkForgottenReturns(i,a,"",n,this),n._resolveCallback(i)))}},R.prototype._target=function(){for(var e=this;e._isFollowing();)e=e._followee();return e},R.prototype._followee=function(){return this._rejectionHandler0},R.prototype._setFollowee=function(e){this._rejectionHandler0=e},R.prototype._settlePromise=function(e,t,r,o){var a=e instanceof R,s=this._bitField,c=0!=(134217728&s);0!=(65536&s)?(a&&e._invokeInternalOnCancel(),r instanceof x&&r.isFinallyHandler()?(r.cancelPromise=e,O(t).call(r,o)===T&&e._reject(T.e)):t===n?e._fulfill(n.call(r)):r instanceof i?r._promiseCancelled(e):a||e instanceof S?e._cancel():r.cancel()):"function"==typeof t?a?(c&&e._setAsyncGuaranteed(),this._settlePromiseFromHandler(t,r,o,e)):t.call(r,o,e):r instanceof i?r._isResolved()||(0!=(33554432&s)?r._promiseFulfilled(o,e):r._promiseRejected(o,e)):a&&(c&&e._setAsyncGuaranteed(),0!=(33554432&s)?e._fulfill(o):e._reject(o))},R.prototype._settlePromiseLateCancellationObserver=function(e){var t=e.handler,r=e.promise,n=e.receiver,o=e.value;"function"==typeof t?r instanceof R?this._settlePromiseFromHandler(t,n,o,r):t.call(n,o,r):r instanceof R&&r._reject(o)},R.prototype._settlePromiseCtx=function(e){this._settlePromise(e.promise,e.handler,e.receiver,e.value)},R.prototype._settlePromise0=function(e,t,r){var n=this._promise0,o=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(n,e,o,t)},R.prototype._clearCallbackDataAtIndex=function(e){var t=4*e-4;this[t+2]=this[t+3]=this[t+0]=this[t+1]=void 0},R.prototype._fulfill=function(e){var r=this._bitField;if(!((117506048&r)>>>16)){if(e===this){var n=t();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=e,(65535&r)>0&&(0!=(134217728&r)?this._settlePromises():m.settlePromises(this),this._dereferenceTrace())}},R.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return m.fatalError(e,s.isNode);(65535&t)>0?m.settlePromises(this):this._ensurePossibleRejectionHandled()}},R.prototype._fulfillPromises=function(e,t){for(var r=1;r<e;r++){var n=this._fulfillmentHandlerAt(r),o=this._promiseAt(r),i=this._receiverAt(r);this._clearCallbackDataAtIndex(r),this._settlePromise(o,n,i,t)}},R.prototype._rejectPromises=function(e,t){for(var r=1;r<e;r++){var n=this._rejectionHandlerAt(r),o=this._promiseAt(r),i=this._receiverAt(r);this._clearCallbackDataAtIndex(r),this._settlePromise(o,n,i,t)}},R.prototype._settlePromises=function(){var e=this._bitField,t=65535&e;if(t>0){if(0!=(16842752&e)){var r=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,r,e),this._rejectPromises(t,r)}else{var n=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,n,e),this._fulfillPromises(t,n)}this._setLength(0)}this._clearCancellationData()},R.prototype._settledValue=function(){var e=this._bitField;return 0!=(33554432&e)?this._rejectionHandler0:0!=(16777216&e)?this._fulfillmentHandler0:void 0},"undefined"!=typeof Symbol&&Symbol.toStringTag&&p.defineProperty(R.prototype,Symbol.toStringTag,{get:function(){return"Object"}}),R.defer=R.pending=function(){return k.deprecated("Promise.defer","new Promise"),{promise:new R(_),resolve:F,reject:D}},s.notEnumerableProp(R,"_makeSelfResolutionError",t),r(6926)(R,_,E,o,k),r(3635)(R,_,E,k),r(1735)(R,S,o,k),r(5632)(R),r(1958)(R),r(7717)(R,S,E,_,m),R.Promise=R,R.version="3.7.2",r(2293)(R),r(687)(R,o,_,E,i,k),r(6343)(R,S,o,E,_,k),r(1941)(R),r(9346)(R,_),r(5733)(R,S,E,o),r(4648)(R,_,E,o),r(3609)(R,S,o,E,_,k),r(8615)(R,S,k),r(4488)(R,S,o),r(8418)(R,_,k),r(4525)(R,o,E,C,_,k),r(9846)(R),r(6574)(R,_),r(6777)(R,_),s.toFastProperties(R),s.toFastProperties(R.prototype),M({a:1}),M({b:2}),M({c:3}),M(1),M((function(){})),M(void 0),M(!1),M(new R(_)),k.setBounds(d.firstLineError,s.lastLineError),R}},1640:(e,t,r)=>{"use strict";e.exports=function(e,t,n,o,i){var a=r(5942);a.isArray;function s(r){var n=this._promise=new e(t);r instanceof e&&(n._propagateFrom(r,3),r.suppressUnhandledRejections()),n._setOnCancel(this),this._values=r,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return a.inherits(s,i),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function t(r,i){var s=n(this._values,this._promise);if(s instanceof e){var c=(s=s._target())._bitField;if(this._values=s,0==(50397184&c))return this._promise._setAsyncGuaranteed(),s._then(t,this._reject,void 0,this,i);if(0==(33554432&c))return 0!=(16777216&c)?this._reject(s._reason()):this._cancel();s=s._value()}if(null!==(s=a.asArray(s)))0!==s.length?this._iterate(s):-5===i?this._resolveEmptyArray():this._resolve(function(e){switch(e){case-2:return[];case-3:return{};case-6:return new Map}}(i));else{var u=o("expecting an array or an iterable object but got "+a.classString(s)).reason();this._promise._rejectCallback(u,!1)}},s.prototype._iterate=function(t){var r=this.getActualLength(t.length);this._length=r,this._values=this.shouldCopyValues()?new Array(r):this._values;for(var o=this._promise,i=!1,a=null,s=0;s<r;++s){var c=n(t[s],o);a=c instanceof e?(c=c._target())._bitField:null,i?null!==a&&c.suppressUnhandledRejections():null!==a?0==(50397184&a)?(c._proxy(this,s),this._values[s]=c):i=0!=(33554432&a)?this._promiseFulfilled(c._value(),s):0!=(16777216&a)?this._promiseRejected(c._reason(),s):this._promiseCancelled(s):i=this._promiseFulfilled(c,s)}i||o._setAsyncGuaranteed()},s.prototype._isResolved=function(){return null===this._values},s.prototype._resolve=function(e){this._values=null,this._promise._fulfill(e)},s.prototype._cancel=function(){!this._isResolved()&&this._promise._isCancellable()&&(this._values=null,this._promise._cancel())},s.prototype._reject=function(e){this._values=null,this._promise._rejectCallback(e,!1)},s.prototype._promiseFulfilled=function(e,t){return this._values[t]=e,++this._totalResolved>=this._length&&(this._resolve(this._values),!0)},s.prototype._promiseCancelled=function(){return this._cancel(),!0},s.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var r=0;r<t.length;++r)t[r]instanceof e&&t[r].cancel()}},s.prototype.shouldCopyValues=function(){return!0},s.prototype.getActualLength=function(e){return e},s}},9346:(e,t,r)=>{"use strict";e.exports=function(e,t){var n={},o=r(5942),i=r(1776),a=o.withAppended,s=o.maybeWrapAsError,c=o.canEvaluate,u=r(7621).TypeError,l={__isPromisified__:!0},f=new RegExp("^(?:"+["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"].join("|")+")$"),h=function(e){return o.isIdentifier(e)&&"_"!==e.charAt(0)&&"constructor"!==e};function p(e){return!f.test(e)}function d(e){try{return!0===e.__isPromisified__}catch(e){return!1}}function m(e,t,r){var n=o.getDataPropertyOrDefault(e,t+r,l);return!!n&&d(n)}function g(e,t,r,n){for(var i=o.inheritedDataKeys(e),a=[],s=0;s<i.length;++s){var c=i[s],l=e[c],f=n===h||h(c);"function"!=typeof l||d(l)||m(e,c,t)||!n(c,l,e,f)||a.push(c,l)}return function(e,t,r){for(var n=0;n<e.length;n+=2){var o=e[n];if(r.test(o))for(var i=o.replace(r,""),a=0;a<e.length;a+=2)if(e[a]===i)throw new u("Cannot promisify an API that has normal methods with '%s'-suffix\n\n See http://goo.gl/MqrFmX\n".replace("%s",t))}}(a,t,r),a}var v;v=function(r,c,u,l,f,h){var p=Math.max(0,function(e){return"number"==typeof e.length?Math.max(Math.min(e.length,1024),0):0}(l)-1),d=function(e){for(var t=[e],r=Math.max(0,e-1-3),n=e-1;n>=r;--n)t.push(n);for(n=e+1;n<=3;++n)t.push(n);return t}(p),m="string"==typeof r||c===n;function g(e){var t,r=(t=e,o.filledRange(t,"_arg","")).join(", "),n=e>0?", ":"";return(m?"ret = callback.call(this, {{args}}, nodeback); break;\n":void 0===c?"ret = callback({{args}}, nodeback); break;\n":"ret = callback.call(receiver, {{args}}, nodeback); break;\n").replace("{{args}}",r).replace(", ",n)}var v="string"==typeof r?"this != null ? this['"+r+"'] : fn":"fn",y="'use strict'; \n var ret = function (Parameters) { \n 'use strict'; \n var len = arguments.length; \n var promise = new Promise(INTERNAL); \n promise._captureStackTrace(); \n var nodeback = nodebackForPromise(promise, "+h+"); \n var ret; \n var callback = tryCatch([GetFunctionCode]); \n switch(len) { \n [CodeForSwitchCase] \n } \n if (ret === errorObj) { \n promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n } \n if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); \n return promise; \n }; \n notEnumerableProp(ret, '__isPromisified__', true); \n return ret; \n ".replace("[CodeForSwitchCase]",function(){for(var e="",t=0;t<d.length;++t)e+="case "+d[t]+":"+g(d[t]);return e+=" \n default: \n var args = new Array(len + 1); \n var i = 0; \n for (var i = 0; i < len; ++i) { \n args[i] = arguments[i]; \n } \n args[i] = nodeback; \n [CodeForCall] \n break; \n ".replace("[CodeForCall]",m?"ret = callback.apply(this, args);\n":"ret = callback.apply(receiver, args);\n")}()).replace("[GetFunctionCode]",v);return y=y.replace("Parameters",function(e){return o.filledRange(Math.max(e,3),"_arg","")}(p)),new Function("Promise","fn","receiver","withAppended","maybeWrapAsError","nodebackForPromise","tryCatch","errorObj","notEnumerableProp","INTERNAL",y)(e,l,c,a,s,i,o.tryCatch,o.errorObj,o.notEnumerableProp,t)};var y=c?v:function(r,c,u,l,f,h){var p=function(){return this}(),d=r;function m(){var o=c;c===n&&(o=this);var u=new e(t);u._captureStackTrace();var l="string"==typeof d&&this!==p?this[d]:r,f=i(u,h);try{l.apply(o,a(arguments,f))}catch(e){u._rejectCallback(s(e),!0,!0)}return u._isFateSealed()||u._setAsyncGuaranteed(),u}return"string"==typeof d&&(r=l),o.notEnumerableProp(m,"__isPromisified__",!0),m};function _(e,t,r,i,a){for(var s=new RegExp(t.replace(/([$])/,"\\$")+"$"),c=g(e,t,s,r),u=0,l=c.length;u<l;u+=2){var f=c[u],h=c[u+1],p=f+t;if(i===y)e[p]=y(f,n,f,h,t,a);else{var d=i(h,(function(){return y(f,n,f,h,t,a)}));o.notEnumerableProp(d,"__isPromisified__",!0),e[p]=d}}return o.toFastProperties(e),e}e.promisify=function(e,t){if("function"!=typeof e)throw new u("expecting a function but got "+o.classString(e));if(d(e))return e;var r=function(e,t,r){return y(e,t,void 0,e,null,r)}(e,void 0===(t=Object(t)).context?n:t.context,!!t.multiArgs);return o.copyDescriptors(e,r,p),r},e.promisifyAll=function(e,t){if("function"!=typeof e&&"object"!=typeof e)throw new u("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/MqrFmX\n");var r=!!(t=Object(t)).multiArgs,n=t.suffix;"string"!=typeof n&&(n="Async");var i=t.filter;"function"!=typeof i&&(i=h);var a=t.promisifier;if("function"!=typeof a&&(a=y),!o.isIdentifier(n))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/MqrFmX\n");for(var s=o.inheritedDataKeys(e),c=0;c<s.length;++c){var l=e[s[c]];"constructor"!==s[c]&&o.isClass(l)&&(_(l.prototype,n,i,a,r),_(l,n,i,a,r))}return _(e,n,i,a,r)}}},5733:(e,t,r)=>{"use strict";e.exports=function(e,t,n,o){var i,a=r(5942),s=a.isObject,c=r(9571);"function"==typeof Map&&(i=Map);var u=function(){var e=0,t=0;function r(r,n){this[e]=r,this[e+t]=n,e++}return function(n){t=n.size,e=0;var o=new Array(2*n.size);return n.forEach(r,o),o}}();function l(e){var t,r=!1;if(void 0!==i&&e instanceof i)t=u(e),r=!0;else{var n=c.keys(e),o=n.length;t=new Array(2*o);for(var a=0;a<o;++a){var s=n[a];t[a]=e[s],t[a+o]=s}}this.constructor$(t),this._isMap=r,this._init$(void 0,r?-6:-3)}function f(t){var r,i=n(t);return s(i)?(r=i instanceof e?i._then(e.props,void 0,void 0,void 0,void 0):new l(i).promise(),i instanceof e&&r._propagateFrom(i,2),r):o("cannot await properties of a non-object\n\n See http://goo.gl/MqrFmX\n")}a.inherits(l,t),l.prototype._init=function(){},l.prototype._promiseFulfilled=function(e,t){if(this._values[t]=e,++this._totalResolved>=this._length){var r;if(this._isMap)r=function(e){for(var t=new i,r=e.length/2|0,n=0;n<r;++n){var o=e[r+n],a=e[n];t.set(o,a)}return t}(this._values);else{r={};for(var n=this.length(),o=0,a=this.length();o<a;++o)r[this._values[o+n]]=this._values[o]}return this._resolve(r),!0}return!1},l.prototype.shouldCopyValues=function(){return!1},l.prototype.getActualLength=function(e){return e>>1},e.prototype.props=function(){return f(this)},e.props=function(e){return f(e)}}},7824:e=>{"use strict";function t(e){this._capacity=e,this._length=0,this._front=0}t.prototype._willBeOverCapacity=function(e){return this._capacity<e},t.prototype._pushOne=function(e){var t=this.length();this._checkCapacity(t+1),this[this._front+t&this._capacity-1]=e,this._length=t+1},t.prototype.push=function(e,t,r){var n=this.length()+3;if(this._willBeOverCapacity(n))return this._pushOne(e),this._pushOne(t),void this._pushOne(r);var o=this._front+n-3;this._checkCapacity(n);var i=this._capacity-1;this[o+0&i]=e,this[o+1&i]=t,this[o+2&i]=r,this._length=n},t.prototype.shift=function(){var e=this._front,t=this[e];return this[e]=void 0,this._front=e+1&this._capacity-1,this._length--,t},t.prototype.length=function(){return this._length},t.prototype._checkCapacity=function(e){this._capacity<e&&this._resizeTo(this._capacity<<1)},t.prototype._resizeTo=function(e){var t=this._capacity;this._capacity=e,function(e,t,r,n,o){for(var i=0;i<o;++i)r[i+n]=e[i+t],e[i+t]=void 0}(this,0,this,t,this._front+this._length&t-1)},e.exports=t},4648:(e,t,r)=>{"use strict";e.exports=function(e,t,n,o){var i=r(5942);function a(r,s){var c,u=n(r);if(u instanceof e)return(c=u).then((function(e){return a(e,c)}));if(null===(r=i.asArray(r)))return o("expecting an array or an iterable object but got "+i.classString(r));var l=new e(t);void 0!==s&&l._propagateFrom(s,3);for(var f=l._fulfill,h=l._reject,p=0,d=r.length;p<d;++p){var m=r[p];(void 0!==m||p in r)&&e.cast(m)._then(f,h,void 0,l,null)}return l}e.race=function(e){return a(e,void 0)},e.prototype.race=function(){return a(this,void 0)}}},3609:(e,t,r)=>{"use strict";e.exports=function(e,t,n,o,i,a){var s=r(5942),c=s.tryCatch;function u(t,r,n,o){this.constructor$(t);var a=e._getContext();this._fn=s.contextBind(a,r),void 0!==n&&(n=e.resolve(n))._attachCancellationCallback(this),this._initialValue=n,this._currentCancellable=null,this._eachValues=o===i?Array(this._length):0===o?null:void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}function l(e,t){this.isFulfilled()?t._resolve(e):t._reject(e)}function f(e,t,r,o){return"function"!=typeof t?n("expecting a function but got "+s.classString(t)):new u(e,t,r,o).promise()}function h(t){this.accum=t,this.array._gotAccum(t);var r=o(this.value,this.array._promise);return r instanceof e?(this.array._currentCancellable=r,r._then(p,void 0,void 0,this,void 0)):p.call(this,r)}function p(t){var r,n=this.array,o=n._promise,i=c(n._fn);o._pushContext(),(r=void 0!==n._eachValues?i.call(o._boundValue(),t,this.index,this.length):i.call(o._boundValue(),this.accum,t,this.index,this.length))instanceof e&&(n._currentCancellable=r);var s=o._popContext();return a.checkForgottenReturns(r,s,void 0!==n._eachValues?"Promise.each":"Promise.reduce",o),r}s.inherits(u,t),u.prototype._gotAccum=function(e){void 0!==this._eachValues&&null!==this._eachValues&&e!==i&&this._eachValues.push(e)},u.prototype._eachComplete=function(e){return null!==this._eachValues&&this._eachValues.push(e),this._eachValues},u.prototype._init=function(){},u.prototype._resolveEmptyArray=function(){this._resolve(void 0!==this._eachValues?this._eachValues:this._initialValue)},u.prototype.shouldCopyValues=function(){return!1},u.prototype._resolve=function(e){this._promise._resolveCallback(e),this._values=null},u.prototype._resultCancelled=function(t){if(t===this._initialValue)return this._cancel();this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof e&&this._currentCancellable.cancel(),this._initialValue instanceof e&&this._initialValue.cancel())},u.prototype._iterate=function(t){var r,n;this._values=t;var o=t.length;void 0!==this._initialValue?(r=this._initialValue,n=0):(r=e.resolve(t[0]),n=1),this._currentCancellable=r;for(var i=n;i<o;++i){var a=t[i];a instanceof e&&a.suppressUnhandledRejections()}if(!r.isRejected())for(;n<o;++n){var s={accum:null,value:t[n],index:n,length:o,array:this};r=r._then(h,void 0,void 0,s,void 0),0==(127&n)&&r._setNoAsyncGuarantee()}void 0!==this._eachValues&&(r=r._then(this._eachComplete,void 0,void 0,this,void 0)),r._then(l,l,void 0,r,this)},e.prototype.reduce=function(e,t){return f(this,e,t,null)},e.reduce=function(e,t,r,n){return f(e,t,r,n)}}},679:(e,t,r)=>{"use strict";var n,o=r(5942),i=o.getNativePromise();if(o.isNode&&"undefined"==typeof MutationObserver){var a=global.setImmediate,s=process.nextTick;n=o.isRecentNode?function(e){a.call(global,e)}:function(e){s.call(process,e)}}else if("function"==typeof i&&"function"==typeof i.resolve){var c=i.resolve();n=function(e){c.then(e)}}else n="undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&(window.navigator.standalone||window.cordova)||!("classList"in document.documentElement)?"undefined"!=typeof setImmediate?function(e){setImmediate(e)}:"undefined"!=typeof setTimeout?function(e){setTimeout(e,0)}:function(){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}:function(){var e=document.createElement("div"),t={attributes:!0},r=!1,n=document.createElement("div");new MutationObserver((function(){e.classList.toggle("foo"),r=!1})).observe(n,t);return function(o){var i=new MutationObserver((function(){i.disconnect(),o()}));i.observe(e,t),r||(r=!0,n.classList.toggle("foo"))}}();e.exports=n},8615:(e,t,r)=>{"use strict";e.exports=function(e,t,n){var o=e.PromiseInspection;function i(e){this.constructor$(e)}r(5942).inherits(i,t),i.prototype._promiseResolved=function(e,t){return this._values[e]=t,++this._totalResolved>=this._length&&(this._resolve(this._values),!0)},i.prototype._promiseFulfilled=function(e,t){var r=new o;return r._bitField=33554432,r._settledValueField=e,this._promiseResolved(t,r)},i.prototype._promiseRejected=function(e,t){var r=new o;return r._bitField=16777216,r._settledValueField=e,this._promiseResolved(t,r)},e.settle=function(e){return n.deprecated(".settle()",".reflect()"),new i(e).promise()},e.allSettled=function(e){return new i(e).promise()},e.prototype.settle=function(){return e.settle(this)}}},4488:(e,t,r)=>{"use strict";e.exports=function(e,t,n){var o=r(5942),i=r(7621).RangeError,a=r(7621).AggregateError,s=o.isArray,c={};function u(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}function l(e,t){if((0|t)!==t||t<0)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new u(e),o=r.promise();return r.setHowMany(t),r.init(),o}o.inherits(u,t),u.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var e=s(this._values);!this._isResolved()&&e&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},u.prototype.init=function(){this._initialized=!0,this._init()},u.prototype.setUnwrap=function(){this._unwrap=!0},u.prototype.howMany=function(){return this._howMany},u.prototype.setHowMany=function(e){this._howMany=e},u.prototype._promiseFulfilled=function(e){return this._addFulfilled(e),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},u.prototype._promiseRejected=function(e){return this._addRejected(e),this._checkOutcome()},u.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(c),this._checkOutcome())},u.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var e=new a,t=this.length();t<this._values.length;++t)this._values[t]!==c&&e.push(this._values[t]);return e.length>0?this._reject(e):this._cancel(),!0}return!1},u.prototype._fulfilled=function(){return this._totalResolved},u.prototype._rejected=function(){return this._values.length-this.length()},u.prototype._addRejected=function(e){this._values.push(e)},u.prototype._addFulfilled=function(e){this._values[this._totalResolved++]=e},u.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},u.prototype._getRangeError=function(e){var t="Input array must contain at least "+this._howMany+" items but contains only "+e+" items";return new i(t)},u.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(e,t){return l(e,t)},e.prototype.some=function(e){return l(this,e)},e._SomePromiseArray=u}},1958:e=>{"use strict";e.exports=function(e){function t(e){void 0!==e?(e=e._target(),this._bitField=e._bitField,this._settledValueField=e._isFateSealed()?e._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}t.prototype._settledValue=function(){return this._settledValueField};var r=t.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},n=t.prototype.error=t.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},o=t.prototype.isFulfilled=function(){return 0!=(33554432&this._bitField)},i=t.prototype.isRejected=function(){return 0!=(16777216&this._bitField)},a=t.prototype.isPending=function(){return 0==(50397184&this._bitField)},s=t.prototype.isResolved=function(){return 0!=(50331648&this._bitField)};t.prototype.isCancelled=function(){return 0!=(8454144&this._bitField)},e.prototype.__isCancelled=function(){return 65536==(65536&this._bitField)},e.prototype._isCancelled=function(){return this._target().__isCancelled()},e.prototype.isCancelled=function(){return 0!=(8454144&this._target()._bitField)},e.prototype.isPending=function(){return a.call(this._target())},e.prototype.isRejected=function(){return i.call(this._target())},e.prototype.isFulfilled=function(){return o.call(this._target())},e.prototype.isResolved=function(){return s.call(this._target())},e.prototype.value=function(){return r.call(this._target())},e.prototype.reason=function(){var e=this._target();return e._unsetRejectionIsUnhandled(),n.call(e)},e.prototype._value=function(){return this._settledValue()},e.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},e.PromiseInspection=t}},1778:(e,t,r)=>{"use strict";e.exports=function(e,t){var n=r(5942),o=n.errorObj,i=n.isObject;var a={}.hasOwnProperty;return function(r,s){if(i(r)){if(r instanceof e)return r;var c=function(e){try{return function(e){return e.then}(e)}catch(e){return o.e=e,o}}(r);if(c===o){s&&s._pushContext();var u=e.reject(c.e);return s&&s._popContext(),u}if("function"==typeof c){if(function(e){try{return a.call(e,"_promise0")}catch(e){return!1}}(r)){u=new e(t);return r._then(u._fulfill,u._reject,void 0,u,null),u}return function(r,i,a){var s=new e(t),c=s;a&&a._pushContext();s._captureStackTrace(),a&&a._popContext();var u=!0,l=n.tryCatch(i).call(r,f,h);u=!1,s&&l===o&&(s._rejectCallback(l.e,!0,!0),s=null);function f(e){s&&(s._resolveCallback(e),s=null)}function h(e){s&&(s._rejectCallback(e,u,!0),s=null)}return c}(r,c,s)}}return r}}},8418:(e,t,r)=>{"use strict";e.exports=function(e,t,n){var o=r(5942),i=e.TimeoutError;function a(e){this.handle=e}a.prototype._resultCancelled=function(){clearTimeout(this.handle)};var s=function(e){return c(+this).thenReturn(e)},c=e.delay=function(r,o){var i,c;return void 0!==o?(i=e.resolve(o)._then(s,null,null,r,void 0),n.cancellation()&&o instanceof e&&i._setOnCancel(o)):(i=new e(t),c=setTimeout((function(){i._fulfill()}),+r),n.cancellation()&&i._setOnCancel(new a(c)),i._captureStackTrace()),i._setAsyncGuaranteed(),i};e.prototype.delay=function(e){return c(e,this)};function u(e){return clearTimeout(this.handle),e}function l(e){throw clearTimeout(this.handle),e}e.prototype.timeout=function(e,t){var r,s;e=+e;var c=new a(setTimeout((function(){r.isPending()&&function(e,t,r){var n;n="string"!=typeof t?t instanceof Error?t:new i("operation timed out"):new i(t),o.markAsOriginatingFromRejection(n),e._attachExtraTrace(n),e._reject(n),null!=r&&r.cancel()}(r,t,s)}),e));return n.cancellation()?(s=this.then(),(r=s._then(u,l,void 0,c,void 0))._setOnCancel(c)):r=this._then(u,l,void 0,c,void 0),r}}},4525:(e,t,r)=>{"use strict";e.exports=function(e,t,n,o,i,a){var s=r(5942),c=r(7621).TypeError,u=r(5942).inherits,l=s.errorObj,f=s.tryCatch,h={};function p(e){setTimeout((function(){throw e}),0)}function d(t,r){var o=0,a=t.length,s=new e(i);return function i(){if(o>=a)return s._fulfill();var c=function(e){var t=n(e);return t!==e&&"function"==typeof e._isDisposable&&"function"==typeof e._getDisposer&&e._isDisposable()&&t._setDisposable(e._getDisposer()),t}(t[o++]);if(c instanceof e&&c._isDisposable()){try{c=n(c._getDisposer().tryDispose(r),t.promise)}catch(e){return p(e)}if(c instanceof e)return c._then(i,p,null,null,null)}i()}(),s}function m(e,t,r){this._data=e,this._promise=t,this._context=r}function g(e,t,r){this.constructor$(e,t,r)}function v(e){return m.isDisposer(e)?(this.resources[this.index]._setDisposable(e),e.promise()):e}function y(e){this.length=e,this.promise=null,this[e-1]=null}m.prototype.data=function(){return this._data},m.prototype.promise=function(){return this._promise},m.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():h},m.prototype.tryDispose=function(e){var t=this.resource(),r=this._context;void 0!==r&&r._pushContext();var n=t!==h?this.doDispose(t,e):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,n},m.isDisposer=function(e){return null!=e&&"function"==typeof e.resource&&"function"==typeof e.tryDispose},u(g,m),g.prototype.doDispose=function(e,t){return this.data().call(e,e,t)},y.prototype._resultCancelled=function(){for(var t=this.length,r=0;r<t;++r){var n=this[r];n instanceof e&&n.cancel()}},e.using=function(){var r=arguments.length;if(r<2)return t("you must pass at least 2 arguments to Promise.using");var o,i=arguments[r-1];if("function"!=typeof i)return t("expecting a function but got "+s.classString(i));var c=!0;2===r&&Array.isArray(arguments[0])?(r=(o=arguments[0]).length,c=!1):(o=arguments,r--);for(var u=new y(r),h=0;h<r;++h){var p=o[h];if(m.isDisposer(p)){var g=p;(p=p.promise())._setDisposable(g)}else{var _=n(p);_ instanceof e&&(p=_._then(v,null,null,{resources:u,index:h},void 0))}u[h]=p}var b=new Array(u.length);for(h=0;h<b.length;++h)b[h]=e.resolve(u[h]).reflect();var w=e.all(b).then((function(e){for(var t=0;t<e.length;++t){var r=e[t];if(r.isRejected())return l.e=r.error(),l;if(!r.isFulfilled())return void w.cancel();e[t]=r.value()}E._pushContext(),i=f(i);var n=c?i.apply(void 0,e):i(e),o=E._popContext();return a.checkForgottenReturns(n,o,"Promise.using",E),n})),E=w.lastly((function(){var t=new e.PromiseInspection(w);return d(u,t)}));return u.promise=E,E._setOnCancel(u),E},e.prototype._setDisposable=function(e){this._bitField=131072|this._bitField,this._disposer=e},e.prototype._isDisposable=function(){return(131072&this._bitField)>0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},e.prototype.disposer=function(e){if("function"==typeof e)return new g(e,this,o());throw new c}}},5942:function(e,t,r){"use strict";var n=r(9571),o="undefined"==typeof navigator,i={e:{}},a,s="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0!==this?this:null;function c(){try{var e=a;return a=null,e.apply(this,arguments)}catch(e){return i.e=e,i}}function u(e){return a=e,c}var l=function(e,t){var r={}.hasOwnProperty;function n(){for(var n in this.constructor=e,this.constructor$=t,t.prototype)r.call(t.prototype,n)&&"$"!==n.charAt(n.length-1)&&(this[n+"$"]=t.prototype[n])}return n.prototype=t.prototype,e.prototype=new n,e.prototype};function f(e){return null==e||!0===e||!1===e||"string"==typeof e||"number"==typeof e}function h(e){return"function"==typeof e||"object"==typeof e&&null!==e}function p(e){return f(e)?new Error(C(e)):e}function d(e,t){var r,n=e.length,o=new Array(n+1);for(r=0;r<n;++r)o[r]=e[r];return o[r]=t,o}function m(e,t,r){if(!n.isES5)return{}.hasOwnProperty.call(e,t)?e[t]:void 0;var o=Object.getOwnPropertyDescriptor(e,t);return null!=o?null==o.get&&null==o.set?o.value:r:void 0}function g(e,t,r){if(f(e))return e;var o={value:r,configurable:!0,enumerable:!1,writable:!0};return n.defineProperty(e,t,o),e}function v(e){throw e}var y=function(){var e=[Array.prototype,Object.prototype,Function.prototype],t=function(t){for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1};if(n.isES5){var r=Object.getOwnPropertyNames;return function(e){for(var o=[],i=Object.create(null);null!=e&&!t(e);){var a;try{a=r(e)}catch(e){return o}for(var s=0;s<a.length;++s){var c=a[s];if(!i[c]){i[c]=!0;var u=Object.getOwnPropertyDescriptor(e,c);null!=u&&null==u.get&&null==u.set&&o.push(c)}}e=n.getPrototypeOf(e)}return o}}var o={}.hasOwnProperty;return function(r){if(t(r))return[];var n=[];e:for(var i in r)if(o.call(r,i))n.push(i);else{for(var a=0;a<e.length;++a)if(o.call(e[a],i))continue e;n.push(i)}return n}}(),_=/this\s*\.\s*\S+\s*=/;function b(e){try{if("function"==typeof e){var t=n.names(e.prototype),r=n.isES5&&t.length>1,o=t.length>0&&!(1===t.length&&"constructor"===t[0]),i=_.test(e+"")&&n.names(e).length>0;if(r||o||i)return!0}return!1}catch(e){return!1}}function w(e){function t(){}t.prototype=e;var r=new t;function n(){return typeof r.foo}return n(),n(),e}var E=/^[a-z$_][a-z$_0-9]*$/i;function S(e){return E.test(e)}function A(e,t,r){for(var n=new Array(e),o=0;o<e;++o)n[o]=t+o+r;return n}function C(e){try{return e+""}catch(e){return"[no string representation]"}}function k(e){return e instanceof Error||null!==e&&"object"==typeof e&&"string"==typeof e.message&&"string"==typeof e.name}function x(e){try{g(e,"isOperational",!0)}catch(e){}}function P(e){return null!=e&&(e instanceof Error.__BluebirdErrorTypes__.OperationalError||!0===e.isOperational)}function I(e){return k(e)&&n.propertyIsWritable(e,"stack")}var T="stack"in new Error?function(e){return I(e)?e:new Error(C(e))}:function(e){if(I(e))return e;try{throw new Error(C(e))}catch(e){return e}};function O(e){return{}.toString.call(e)}function R(e,t,r){for(var o=n.names(e),i=0;i<o.length;++i){var a=o[i];if(r(a))try{n.defineProperty(t,a,n.getDescriptor(e,a))}catch(e){}}}var F=function(e){return n.isArray(e)?e:null};if("undefined"!=typeof Symbol&&Symbol.iterator){var D="function"==typeof Array.from?function(e){return Array.from(e)}:function(e){for(var t,r=[],n=e[Symbol.iterator]();!(t=n.next()).done;)r.push(t.value);return r};F=function(e){return n.isArray(e)?e:null!=e&&"function"==typeof e[Symbol.iterator]?D(e):null}}var M="undefined"!=typeof process&&"[object process]"===O(process).toLowerCase(),N="undefined"!=typeof process&&void 0!==process.env,L;function j(e){return N?process.env[e]:void 0}function H(){if("function"==typeof Promise)try{if("[object Promise]"===O(new Promise((function(){}))))return Promise}catch(e){}}function B(e,t){if(null===e||"function"!=typeof t||t===L)return t;null!==e.domain&&(t=e.domain.bind(t));var r=e.async;if(null!==r){var n=t;t=function(){for(var e=arguments.length+2,t=new Array(e),o=2;o<e;++o)t[o]=arguments[o-2];return t[0]=n,t[1]=this,r.runInAsyncScope.apply(r,t)}}return t}var U={setReflectHandler:function(e){L=e},isClass:b,isIdentifier:S,inheritedDataKeys:y,getDataPropertyOrDefault:m,thrower:v,isArray:n.isArray,asArray:F,notEnumerableProp:g,isPrimitive:f,isObject:h,isError:k,canEvaluate:o,errorObj:i,tryCatch:u,inherits:l,withAppended:d,maybeWrapAsError:p,toFastProperties:w,filledRange:A,toString:C,canAttachTrace:I,ensureErrorObject:T,originatesFromRejection:P,markAsOriginatingFromRejection:x,classString:O,copyDescriptors:R,isNode:M,hasEnvVariables:N,env:j,global:s,getNativePromise:H,contextBind:B},z;U.isRecentNode=U.isNode&&(process.versions&&process.versions.node?z=process.versions.node.split(".").map(Number):process.version&&(z=process.version.split(".").map(Number)),0===z[0]&&z[1]>10||z[0]>0),U.nodeSupportsAsyncResource=U.isNode&&function(){var e=!1;try{e="function"==typeof r(852).AsyncResource.prototype.runInAsyncScope}catch(t){e=!1}return e}(),U.isNode&&U.toFastProperties(process);try{throw new Error}catch(e){U.lastLineError=e}e.exports=U},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(9203),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 c(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 u={},l=new WeakMap;t.getDisassembler=function(e){const t=function(e){const t=c(e.isa);if(t){const r=`${n.Architecture[t]}-${e.bits.toString()}-${2==e.data?"big":"little"}`;return u[r]||(u[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=c(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 c(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 u(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 p(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 d(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=c,t.getSectionForSymbol=function(e,t){return c(e,t)[0]},t.getSegmentsForSymbol=u,t.getSegmentForSymbol=function(e,t){return u(e,t)[0]},t.getSymbolsAtVirtualMemoryLocation=l,t.getSymbolsAtPhysicalMemoryLocation=function(e,t){const r=p(e,t);return r?l(e,r):[]},t.getSectionsAtVirtualMemoryLocation=f,t.getSectionsAtPhysicalMemoryLocation=function(e,t){const r=p(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=p,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 d(e,t)[0]},t.getSectionsByName=d,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)),c=r(3366);t.open=function(e,t,r){let n;var o;return t||(t={}),e instanceof Uint8Array||e instanceof ArrayBuffer?n=(0,c.readElf)(s.buffer(e),t):e instanceof Array?n=(0,c.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,c.readElf)(e,t):"number"==typeof e?(0,c.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,c.readElf)(s.asyncfile(e),t):function(e){return"object"==typeof e&&"number"==typeof e.size&&"function"==typeof e.arrayBuffer}(e)?(0,c.readElf)(s.blob(e),t):"string"==typeof e?(0,c.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),c=r(4435);t.readElf=async function(e,t){var r,u;let l=!1;const f=[],h=[];let p,d;try{await e.open();const d=await e.size();if(d<=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 v=m.getUint8(4),y=m.getUint8(5),_=m.getUint8(6),b=m.getUint8(7),w=m.getUint8(8);if((v<1||v>2)&&f.push("Not a valid ELF file. Class is invalid"),(y<1||y>2)&&f.push("Not a valid ELF file. Endianness is invalid"),1!=_&&h.push("Not a valid ELF file. Version is invalid"),0==f.length){const h=1===v?32:64,m=1!==y,g=b,E=32==h?36:48,S=await e.view(E),A=e=>S.getUint16(e,!m),C=e=>S.getUint32(e,!m),k=e=>S.getBigUint64(e,!m);let x=0;const P=A(x);x+=2;const I=A(x);x+=2;const T=C(x);let O,R,F;x+=4,32===h?(O=C(x),x+=4,R=C(x),x+=4,F=C(x),x+=4):(O=k(x),x+=8,R=(0,c.toNumberSafe)(k(x)),x+=8,F=(0,c.toNumberSafe)(k(x)),x+=8);const D=C(x);x+=4;const M=A(x);x+=2;const N=A(x);x+=2;const L=A(x);x+=2;const j=A(x);x+=2;const H=A(x);x+=2;const B=A(x);if(x+=2,(32===h&&52!==M||64==h&&64!==M)&&f.push("Invalid ELF file. Unexpected header size"),(0!=L&&(R<M||R>d)||0!=H&&(F<M||F>d))&&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!=H&&(32==h&&j<40||64==h&&j<64||N>255)&&f.push("Invalid ELF file. Section header entry size invalid"),0==f.length){const f=P,d=I,b=await(0,i.readProgramHeaderEntries)(e,R,N,L,h,m),E=await(0,a.readSectionHeaderEntries)(e,F,j,H,h,m,B,null!==(r=t.readSymbolData)&&void 0!==r&&r);p={path:e.path,class:v,classDescription:1==v?"ELF32":"ELF64",data:y,dataDescription:1==y?"Little endian":"Big endian",version:_,bits:h,abi:g,abiVersion:w,abiDescription:(0,n.abiToString)(g),isa:d,isaDescription:(0,n.isaToString)(d),isaVersion:T,type:f,typeDescription:(0,n.objectTypeToString)(f),flags:D,flagsDescription:(0,n.elfFlagsToString)(d,D),entryPoint:O,programHeaderOffset:R,programHeaderEntrySize:N,numProgramHeaderEntries:L,sectionHeaderOffset:F,sectionHeaderEntrySize:j,numSectionHeaderEntries:H,shstrIndex:B,segments:b,sections:E},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 u of e.sections)if((0,a.isSymbolSection)(u))for(const a of u.symbols)if(i===o.ObjectType.Relocatable?a.shndx<e.sections.length?a.virtualAddress=(0,c.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))}}(p,e,null!==(u=t.readSymbolData)&&void 0!==u&&u),l=!0}}}}catch(e){f.push(`Exception caught: ${e.toString()}`)}if(t.returnReader)d=e;else{d=void 0;try{e&&await e.close()}catch(e){f.push(`Exception caught: ${e.toString()}`)}}return{success:l,errors:f,warnings:h,elf:p,reader:d}}},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)),c=i(r(1017));function u(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 p(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 d(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)=>u(t,e,r),view:(e,r)=>u(t,e,r).then(h)}}t.array=function(e){return d(Uint8Array.from(e))},t.buffer=d,t.asyncfile=function(e,t){if(!s)return p("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 p("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 p("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:c.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)=>u(t,e,r),view:(e,r)=>u(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 c(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 u(e,t,r,n,a,s){await e.size();const c=(0,i.divide)(r,n);const u=[];for(let r=0;r<c;r++){const i=await e.view(n,t+r*n),c=i.getUint8.bind(i),l=e=>i.getUint16(e,!a),f=e=>i.getUint32(e,!a),h=e=>i.getBigUint64(e,!a);let p,d,m,g,v,y,_=0;32==s?(p=f(_),_+=4,v=f(_),_+=4,y=f(_),_+=4,d=c(_),_+=1,m=c(_),_+=1,g=l(_),_+=2):(p=f(_),_+=4,d=c(_),_+=1,m=c(_),_+=1,g=l(_),_+=2,v=h(_),_+=8,y=Number(h(_)),_+=8);const b=15&d,w=d>>4,E=3&m;u[r]={nameix:p,name:"",info:d,other:m,shndx:g,value:v,size:y,type:b,binding:w,visibility:E,typeDescription:(0,o.symbolTypeToString)(b),bindingDescription:(0,o.symbolBindingToString)(w),visibilityDescription:(0,o.symbolVisibilityToString)(E)}}return u}async function l(e,t,r,n,o,a,s){await e.size();const c=(0,i.toNumberSafe)((0,i.divide)(r,n));const u=new Array(c);for(let r=0;r<c;r++){const c=await e.view(n,t+r*n),l=e=>c.getUint32(e,!o),f=e=>c.getBigUint64(e,!o),h=e=>c.getInt32(e,!o),p=e=>c.getBigInt64(e,!o);let d,m,g,v,y,_=0;32==a?(d=l(_),_+=4,m=l(_),_+=4,s&&(y=h(_),_+=4),g=m>>8,v=255&m):(d=f(_),_+=8,m=f(_),_+=8,s&&(y=p(_),_+=8),g=(0,i.toNumberSafe)(m>>BigInt(32)),v=(0,i.toNumberSafe)(m&BigInt(4294967295))),u[r]={addr:d,info:m,addend:y,symbolIndex:g,type:v}}return u}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 p(e){return(null==e?void 0:e.type)===n.SectionHeaderEntryType.DynSym||(null==e?void 0:e.type)===n.SectionHeaderEntryType.SymTab}function d(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,v,y){if(0==a)return[];const _=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),c=e=>a.getBigUint64(e,!g),u=s(0),l=s(4);let f,h,p,d,v,y,b,w,E=8;32==m?(f=s(E),E+=4,h=s(E),E+=4,p=s(E),E+=4,d=s(E),E+=4,v=s(E),E+=4,y=s(E),E+=4,b=s(E),E+=4,w=s(E),E+=4):(f=(0,i.toNumberSafe)(c(E)),E+=8,h=c(E),E+=8,p=(0,i.toNumberSafe)(c(E)),E+=8,d=(0,i.toNumberSafe)(c(E)),E+=8,v=s(E),E+=4,y=s(E),E+=4,b=(0,i.toNumberSafe)(c(E)),E+=8,w=(0,i.toNumberSafe)(c(E)),E+=8);const S={index:n,name:"",nameix:u,type:l,typeDescription:(0,o.sectionHeaderEntryTypeToString)(l),flags:f,flagsDescription:(0,o.sectionFlagsToString)(f),addr:h,offset:p,size:d,link:v,info:y,addralign:b,entsize:w};_[n]=S}for(const t of _)if(h(t)){const{size:r,offset:n}=t;t.strings=await c(e,n,r)}for(const t of _){if(p(t)){const{size:r,offset:n,entsize:o,link:i}=t;if(t.symbols=await u(e,n,r,o,g,m),i>=0&&i<_.length){const e=_[i];h(e)&&f(t.symbols,e.strings)}}if(d(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)}}))}}}(_,v),_},t.isStringSection=h,t.isSymbolSection=p,t.isRelocationSection=d},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 c=new Array(i);for(let u=0;u<i;u++){const i=await e.view(r,Number(t)+u*Number(r)),l=e=>i.getUint32(e,!s),f=e=>i.getBigUint64(e,!s),h=l(0);let p,d,m,g,v,y,_,b=4;32==a?(d=l(b),b+=4,m=l(b),b+=4,g=l(b),b+=4,v=l(b),b+=4,y=l(b),b+=4,p=l(b),b+=4,_=l(b),b+=4):(p=l(b),b+=4,d=(0,o.toNumberSafe)(f(b)),b+=8,m=f(b),b+=8,g=f(b),b+=8,v=(0,o.toNumberSafe)(f(b)),b+=8,y=(0,o.toNumberSafe)(f(b)),b+=8,_=(0,o.toNumberSafe)(f(b)),b+=8),c[u]={index:u,type:h,typeDescription:(0,n.programHeaderEntryTypeToString)(h),flags:p,flagsDescription:(0,n.programHeaderFlagsToString)(p),offset:d,vaddr:m,paddr:g,filesz:v,memsz:y,align:_}}return c}},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 c(e){"}"===e.n.substr(e.n.length-1)&&(e.n=e.n.substring(0,e.n.length-1))}function u(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=[],p=!1,d=0,m=0,g="{{",v="}}";function y(){f.length>0&&(h.push({tag:"_t",text:new String(f)}),f="")}function _(r,n){if(y(),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"});p=!1,m=h.length}function b(e,t){var r="="+v,n=e.indexOf(r,t),o=u(e.substring(e.indexOf("=",t)+1,n)).split(" ");return g=o[0],v=o[o.length-1],n+r.length-1}for(n&&(n=n.split(" "),g=n[0],v=n[1]),d=0;d<o;d++)0==i?l(g,r,d)?(--d,y(),i=1):"\n"==r.charAt(d)?_(p):f+=r.charAt(d):1==i?(d+=g.length-1,"="==(a=(s=e.tags[r.charAt(d+1)])?r.charAt(d+1):"_v")?(d=b(r,d),i=0):(s&&d++,i=2),p=d):l(v,r,d)?(h.push({tag:a,n:u(f),otag:g,ctag:v,i:"/"==a?p-g.length:d+v.length}),f="",d+=v.length-1,i=0,"{"==a&&("}}"==v?d++:c(h[h.length-1]))):f+=r.charAt(d);return _(p,!0),h};var f={_t:!0,"\n":!0,$:!0,"/":!0};function h(t,r,n,o){var i,a=[],s=null,c=null;for(i=n[n.length-1];t.length>0;){if(c=t.shift(),i&&"<"==i.tag&&!(c.tag in f))throw new Error("Illegal content in < super tag.");if(e.tags[c.tag]<=e.tags.$||p(c,o))n.push(c),c.nodes=h(t,c.tag,n,o);else{if("/"==c.tag){if(0===n.length)throw new Error("Closing tag without opener: /"+c.n);if(s=n.pop(),c.n!=s.n&&!d(c.n,s.n,o))throw new Error("Nesting error: "+s.n+" vs. "+c.n);return s.end=c.i,a}"\n"==c.tag&&(c.last=0==t.length||"\n"==t[0].tag)}a.push(c)}if(n.length>0)throw new Error("missing closing tag: "+n.pop().n);return a}function p(e,t){for(var r=0,n=t.length;r<n;r++)if(t[r].o==e.n)return e.tag="#",!0}function d(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('"'+v(r)+'":{name:"'+v(e.partials[r].name)+'", '+m(e.partials[r])+"}");return"partials: {"+t.join(",")+"}, subs: "+function(e){var t=[];for(var r in e)t.push('"'+v(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 v(e){return e.replace(i,"\\\\").replace(r,'\\"').replace(n,"\\n").replace(o,"\\r").replace(a,"\\u2028").replace(s,"\\u2029")}function y(e){return~e.indexOf(".")?"d":"f"}function _(e,t){var r="<"+(t.prefix||"")+e.n+g++;return t.partials[r]={name:e.n,partials:{}},t.code+='t.b(t.rp("'+v(r)+'",c,p,"'+(e.indent||"")+'"));',r}function b(e,t){t.code+="t.b(t.t(t."+y(e.n)+'("'+v(e.n)+'",c,p,0)));'}function w(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."+y(t.n)+'("'+v(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."+y(t.n)+'("'+v(t.n)+'",c,p,1),c,p,1,0,0,"")){',e.walk(t.nodes,r),r.code+="};"},">":_,"<":function(t,r){var n={partials:{},code:"",subs:{},inPartial:!0};e.walk(t.nodes,n);var o=r.partials[_(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("'+v(t.n)+'",c,p,i);')},"\n":function(e,t){t.code+=w('"\\n"'+(e.last?"":" + i"))},_v:function(e,t){t.code+="t.b(t.v(t."+y(e.n)+'("'+v(e.n)+'",c,p,0)));'},_t:function(e,t){t.code+=w('"'+v(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=c(e),s.test(e)?e.replace(r,"&amp;").replace(n,"&lt;").replace(o,"&gt;").replace(i,"&#39;").replace(a,"&quot;"):e},t:c,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 c;a.prototype=e,s.prototype=e.subs;var u=new a;for(c in u.subs=new s,u.subsText={},u.buf="",n=n||{},u.stackSubs=n,u.subsText=i,t)n[c]||(n[c]=t[c]);for(c in n)u.subs[c]=n[c];for(c in o=o||{},u.stackPartials=o,r)o[c]||(o[c]=r[c]);for(c in o)u.partials[c]=o[c];return u}(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(u(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(!u(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),c=this.options.modelGet,l=null;if("."===e&&u(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,c))?(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,c=r.length-1;c>=0;c--)if(void 0!==(i=t(e,r[c],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(c(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,c=t[t.length-1],u=e.call(c);return"function"==typeof u?!!n||(s=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(u,c,r,s.substring(o,i),a)):u},mv:function(e,t,r){var n=t[t.length-1],o=e.call(n);return"function"==typeof o?this.ct(c(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 c(e){return String(null==e?"":e)}var u=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),c=function(){try{return new Uint32Array(i)}catch(r){for(var e=new Array(i),t=0;t<i;t++)e[t]=0;return e}}(),u=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 p(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)!==u)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 c=0;;){var h=o.readU32(e,t);if(t+=4,c+=h&l?h&=2147483647:s,0===h)return c;n&&(t+=4),t+=h}},t.makeBuffer=h,t.decompressBlock=function(e,t,r,n,o){var i,a,s,c,u;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(c=r+f;r<c;)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(c=(u=o-a)+(i+=4);u<c;)t[o++]=0|t[u++]}return o},t.compressBlock=function(e,t,r,n,i){var s,c,u,l,f,h,p,d;if(h=0,p=n+r,c=r,n>=13)for(var m=67;r+4<p-5;){var g=o.readU32(e,r),v=o.hashU32(g)>>>0;if(s=i[v=(v>>16^v)>>>0&65535]-1,i[v]=r+1,s<0||r-s>>>16>0||o.readU32(e,s)!==g)r+=m++>>6;else{for(m=67,f=r-c,l=r-s,s+=4,u=r+=4;r<p-5&&e[r]===e[s];)r++,s++;var y=(u=r-u)<15?u:15;if(f>=a){for(t[h++]=240+y,d=f-a;d>=255;d-=255)t[h++]=255;t[h++]=d}else t[h++]=(f<<4)+y;for(var _=0;_<f;_++)t[h++]=e[c+_];if(t[h++]=l,t[h++]=l>>8,u>=15){for(d=u-15;d>=255;d-=255)t[h++]=255;t[h++]=d}c=r}}if(0===c)return 0;if((f=p-c)>=a){for(t[h++]=240,d=f-a;d>=255;d-=255)t[h++]=255;t[h++]=d}else t[h++]=f<<4;for(r=c;r<p;)t[h++]=e[r++];return h},t.decompressFrame=function(e,r){var n,i,a,s,c=0,h=0;if(o.readU32(e,c)!==u)throw new Error("invalid magic number");if(c+=4,64!=(192&(s=e[c++])))throw new Error("incompatible descriptor version");n=0!=(16&s),i=0!=(4&s),a=0!=(8&s);var p=e[c++]>>4&7;if(void 0===f[p])throw new Error("invalid block size");for(a&&(c+=8),c++;;){var d;if(d=o.readU32(e,c),c+=4,0===d)break;if(n&&(c+=4),0!=(d&l)){d&=2147483647;for(var m=0;m<d;m++)r[h++]=e[c++]}else h=t.decompressBlock(e,r,c,d,h),c+=d}return i&&(c+=4),h},t.compressFrame=function(e,r){var a=0;o.writeU32(r,a,u),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,p=0;for(!function(e){for(var t=0;t<i;t++)c[t]=0}();h>0;){var d,m=h>l?l:h;if((d=t.compressBlock(e,s,p,m,c))>m||0===d){o.writeU32(r,a,2147483648|m),a+=4;for(var g=p+m;p<g;)r[a++]=e[p++];h-=m}else{o.writeU32(r,a,d),a+=4;for(var v=0;v<d;)r[a++]=s[v++];p+=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=p(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=p(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 c(e,t){return(e|=0)>>>(32-(t|=0)|0)|e<<t|0}function u(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 u(n.imul(t,r)+e,o,i)}function h(e,t,r){return u(e+n.imul(t[r],s),11,o)}function p(e,t,r){return f(e,n.readU32(t,r),a,17,668265263)}function d(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,u){var f,m;if(m=u,u>=16){for(f=[e+o+i,e+i,e,e-o];u>=16;)f=d(f,t,r),r+=16,u-=16;f=c(f[0],1)+c(f[1],7)+c(f[2],12)+c(f[3],18)+m}else f=e+s+u>>>0;for(;u>=4;)f=p(f,t,r),r+=4,u-=4;for(;u>0;)f=h(f,t,r),r++,u--;return(f=l(n.imul(l(n.imul(l(f,15),i),13),a),16))>>>0}},7475:(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(_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(" KEEP(*(.rodata.eadk_api_level))"),n.b("\n"+r),n.b(" LONG(ADDR(.rodata.eadk_app_name) - ORIGIN(FLASH));"),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(_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(" . = ALIGN(4);"),n.b("\n"+r),n.b(" *(.text)"),n.b("\n"+r),n.b(" *(.text.*)"),n.b("\n"+r),n.b(" } >FLASH"),n.b("\n"),n.b("\n"+r),n.b(" .rodata.eadk_app_name : {"),n.b("\n"+r),n.b(" KEEP(*(.rodata.eadk_app_name))"),n.b("\n"+r),n.b(" } >FLASH"),n.b("\n"),n.b("\n"+r),n.b(" .rodata.eadk_app_icon : {"),n.b("\n"+r),n.b(" KEEP(*(.rodata.eadk_app_icon))"),n.b("\n"+r),n.b(" } >FLASH"),n.b("\n"),n.b("\n"+r),n.b(" .rodata : {"),n.b("\n"+r),n.b(" *(.rodata)"),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.*)"),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.*)"),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.b("\n"+r),n.b('ASSERT(SIZEOF(.eadk_app_info) == 32, "Missing api level. Please define a .rodata.eadk_api_level section.");'),n.b("\n"+r),n.b('ASSERT(SIZEOF(.rodata.eadk_app_name) > 0, "Missing app name. Please define a .rodata.eadk_app_name section.");'),n.b("\n"+r),n.b('ASSERT(SIZEOF(.rodata.eadk_app_icon) > 0, "Missing app icon. Please define a .rodata.eadk_app_icon section.");'),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(_start);\n\nSECTIONS {\n .eadk_app_info ORIGIN(FLASH) : {\n LONG(0xDEC0BEBA);\n KEEP(*(.rodata.eadk_api_level))\n LONG(ADDR(.rodata.eadk_app_name) - ORIGIN(FLASH));\n LONG(SIZEOF(.rodata.eadk_app_icon));\n LONG(ADDR(.rodata.eadk_app_icon) - ORIGIN(FLASH));\n LONG(_start - ORIGIN(FLASH));\n LONG(_eadk_app_end - ORIGIN(FLASH));\n LONG(0xDEC0BEBA);\n } >FLASH\n\n .text : {\n . = ALIGN(4);\n *(.text)\n *(.text.*)\n } >FLASH\n\n .rodata.eadk_app_name : {\n KEEP(*(.rodata.eadk_app_name))\n } >FLASH\n\n .rodata.eadk_app_icon : {\n KEEP(*(.rodata.eadk_app_icon))\n } >FLASH\n\n .rodata : {\n *(.rodata)\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.*)\n _data_section_end_ram = .;\n } >RAM AT >FLASH\n\n .bss : {\n . = ALIGN(4);\n _bss_section_start_ram = .;\n *(.bss)\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\nASSERT(SIZEOF(.eadk_app_info) == 32, "Missing api level. Please define a .rodata.eadk_api_level section.");\nASSERT(SIZEOF(.rodata.eadk_app_name) > 0, "Missing app name. Please define a .rodata.eadk_app_name section.");\nASSERT(SIZEOF(.rodata.eadk_app_icon) > 0, "Missing app icon. Please define a .rodata.eadk_app_icon section.");\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,c=e.height,u=e.index;for(let e=0;e<c;e++)for(let c=0;c<s;c++){let s=r(c,e,u);o[n](t,i,s,a),a+=n}return a}function s(e,t,r,n,o,a){let s=e.width,c=e.height,u=e.index;for(let e=0;e<c;e++){for(let c=0;c<s;c++){let s=o.get(n),l=r(c,e,u);i[n](t,s,l,a)}o.resetAfterLine()}}t.dataToBitMap=function(e,t){let r,o,i=t.width,c=t.height,u=t.depth,l=t.bpp,f=t.interlace;8!==u&&(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,c,u,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:c=3&h,u=h>>2&3,l=h>>4&3,f=h>>6&3,r.push(f,l,u,c);break;case 1:o=1&h,i=h>>1&1,a=h>>2&1,s=h>>3&1,c=h>>4&1,u=h>>5&1,l=h>>6&1,f=h>>7&1,r.push(f,l,u,c,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,u)),o=u<=8?Buffer.alloc(i*c*4):new Uint16Array(i*c*4);let h,p,d=Math.pow(2,u)-1,m=0;if(f)h=n.getImagePasses(i,c),p=n.getInterlaceIterator(i,c);else{let e=0;p=function(){let t=e;return e+=4,t},h=[{width:i,height:c}]}for(let t=0;t<h.length;t++)8===u?m=a(h[t],o,p,l,e,m):s(h[t],o,p,l,r,d);if(8===u){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,c=n.COLORTYPE_TO_BPP_MAP[o.inputColorType];4!==c||o.inputHasAlpha||(c=3);let u=n.COLORTYPE_TO_BPP_MAP[o.colorType];16===o.bitDepth&&(s=65535,u*=2);let l=Buffer.alloc(t*r*u),f=0,h=0,p=o.bgColor||{};function d(){let e,t,r,c=s;switch(o.inputColorType){case n.COLORTYPE_COLOR_ALPHA:c=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:c=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||(c/=s,e=Math.min(Math.max(Math.round((1-c)*p.red+c*e),0),s),t=Math.min(Math.max(Math.round((1-c)*p.green+c*t),0),s),r=Math.min(Math.max(Math.round((1-c)*p.blue+c*r),0),s))),{red:e,green:t,blue:r,alpha:c}}void 0===p.red&&(p.red=s),void 0===p.green&&(p.green=s),void 0===p.blue&&(p.blue=s);for(let e=0;e<r;e++)for(let e=0;e<t;e++){let e=d();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+=c,h+=u}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,c=t>0?e[t+a-r]:0,u=e[t+a]-(s+c>>1);n[o+a]=u}},4:function(e,t,r,o,i,a){for(let s=0;s<r;s++){let c=s>=a?e[t+s-a]:0,u=t>0?e[t+s-r]:0,l=t>0&&s>=a?e[t+s-(r+a)]:0,f=e[t+s]-n(c,u,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,c=e[t+i]-(a+s>>1);o+=Math.abs(c)}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,c=t>0?e[t+a-r]:0,u=t>0&&a>=o?e[t+a-(r+o)]:0,l=e[t+a]-n(s,c,u);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 c=t*a,u=0,l=0,f=Buffer.alloc((c+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,c,a);n<t&&(h=s[r],t=n)}}f[u]=h,u++,o[h](e,l,c,f,u,a),u+=c,l+=c}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,c=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,c),height:e[t].height,lineIndex:0})}else this._images.push({byteWidth:i(r,s,c),height:o,lineIndex:0});this._xComparison=8===c?s:16===c?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,c=a>o?t[a-n]:0,u=Math.floor((c+s)/2);t[a]=r+u}},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],c=a?a[s]:0,u=s>i?t[s-n]:0,l=s>i&&a?a[s-n]:0,f=o(u,c,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,c=t.palette,u=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,u,o,i,c):(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,u,o,i,s),8===n||r||(16===n&&(u=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,u,o,i,n))),u}},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],c=a*t.x.length,u=s*t.y.length;for(let e=0;e<t.x.length&&t.x[e]<o;e++)c++;for(let e=0;e<t.y.length&&t.y[e]<i;e++)u++;c>0&&u>0&&n.push({width:c,height:u,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 c=r.filterData(e.data,e.width,e.height),u=o.deflateSync(c,r.getDeflateOptions());if(c=null,!u||!u.length)throw new Error("bad png - invalid compressed data response");return s.push(r.packIDAT(u)),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),c=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")};c.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}},c.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())},c.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)},c.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},c.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)},c.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)},c.prototype.packIDAT=function(e){return this._packChunk(n.TYPE_IDAT,e)},c.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),c=r(9983),u=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=c.dataToBitMap(e,this._bitmapInfo);t=u(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),c=r(8550),u=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 p=[];let d=new a(e),m=new c(t,{read:d.read.bind(d),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){p.push(e)},simpleTransparency:function(){f.alpha=!0}});if(m.start(),d.process(),r)throw r;let g,v=Buffer.concat(p);if(p.length=0,f.interlace)g=o.inflateSync(v);else{let e=(1+(f.width*f.bpp*f.depth+7>>3))*f.height;g=i(v,{chunkSize:e,maxLength:e})}if(v=null,!g||!g.length)throw new Error("bad png - invalid inflate data response");let y=s.process(g,f);v=null;let _=u.dataToBitMap(y,f);y=null;let b=l(_,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],c=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!==c&&1!==c)return void this.error(new Error("Unsupported interlace method"));this._colorType=i;let u=n.COLORTYPE_TO_BPP_MAP[this._colorType];this._hasIHDR=!0,this.metadata({width:t,height:r,depth:o,interlace:Boolean(c),palette:Boolean(i&n.COLORTYPE_PALETTE),color:Boolean(i&n.COLORTYPE_COLOR),alpha:Boolean(i&n.COLORTYPE_ALPHA),bpp:u,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),c=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(c,o),c.sync=s,c.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)},c.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},c.prototype.write=function(e){return this._parser.write(e),!0},c.prototype.end=function(e){this._parser.end(e)},c.prototype._metadata=function(e){this.width=e.width,this.height=e.height,this.emit("metadata",e)},c.prototype._gamma=function(e){this.gamma=e},c.prototype._handleClose=function(){this._parser.writable||this._packer.readable||this.emit("close")},c.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 c=0;c<i;c++)e.data.copy(t.data,(s+c)*t.width+a<<2,(n+c)*e.width+r<<2,(n+c)*e.width+r+o<<2)},c.prototype.bitblt=function(e,t,r,n,o,i,a){return c.bitblt(this,e,t,r,n,o,i,a),this},c.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}},c.prototype.adjustGamma=function(){c.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 c(e,t){t&&process.nextTick(t),e._handle&&(e._handle.close(),e._handle=null)}function u(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,u=this,l=e&&e.length,f=this._chunkSize-this._offset,h=this._maxLength,p=0,d=[],m=0;function g(e,t){if(u._hadError)return;let r=f-t;if(n(r>=0,"have should not go down"),r>0){let e=u._buffer.slice(u._offset,u._offset+r);if(u._offset+=r,e.length>h&&(e=e.slice(0,h)),d.push(e),m+=e.length,h-=e.length,0===h)return!1}return(0===t||u._offset>=u._chunkSize)&&(f=u._chunkSize,u._offset=0,u._buffer=Buffer.allocUnsafe(u._chunkSize)),0===t&&(p+=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,p,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 c(this),new RangeError("Cannot create final Buffer. It would be larger than 0x"+a.toString(16)+" bytes");let v=Buffer.concat(d,m);return c(this),v},i.inherits(s,o.Inflate),e.exports=t=u,t.Inflate=s,t.createInflate=function(e){return new s(e)},t.inflateSync=u},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 c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function u(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===p)throw new Error("Generator is already running");if(n===d){if("throw"===o)throw i;return T()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=C(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=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=p;var c=l(e,t,r);if("normal"===c.type){if(n=r.done?d:h,c.arg===m)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=d,r.method="throw",r.arg=c.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=u;var f="suspendedStart",h="suspendedYield",p="executing",d="completed",m={};function g(){}function v(){}function y(){}var _={};c(_,i,(function(){return this}));var b=Object.getPrototypeOf,w=b&&b(b(I([])));w&&w!==r&&n.call(w,i)&&(_=w);var E=y.prototype=g.prototype=Object.create(_);function S(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function r(o,i,a,s){var c=l(e[o],e,i);if("throw"!==c.type){var u=c.arg,f=u.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){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(c.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 C(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,C(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 x(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 I(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 v.prototype=y,c(E,"constructor",y),c(y,"constructor",v),v.displayName=c(y,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,c(e,s,"GeneratorFunction")),e.prototype=Object.create(E),e},e.awrap=function(e){return{__await:e}},S(A.prototype),c(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(u(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(E),c(E,s,"Generator"),c(E,i,(function(){return this})),c(E,"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=I,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(x),!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 c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)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),x(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;x(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(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)}},8006: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,64,12,0,0,0,0,0,5,52,0,0,0,0,0,40,0,40,0,39,0,6,73,10,104,16,68,8,96,5,73,136,66,33,191,12,34,4,75,26,96,79,240,255,50,16,70,112,71,0,0,0,0,0,0,0,0,0,0,0,0,0,32,112,71,1,32,112,71,79,240,255,48,112,71,0,32,112,71,0,32,112,71,79,240,255,48,112,71,79,246,255,115,19,181,8,70,0,147,5,73,0,35,20,70,9,104,26,70,255,247,254,255,32,70,2,176,16,189,0,191,0,0,0,0,11,74,12,75,12,73,155,26,1,59,9,210,11,74,0,33,11,75,155,26,1,59,8,210,0,33,8,70,255,247,254,191,17,248,1,11,2,248,1,11,238,231,2,248,1,27,241,231,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,223,112,71,16,181,1,223,4,70,224,178,16,189,16,181,45,223,4,70,32,70,16,189,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,130,176,2,171,3,233,3,0,18,223,2,176,112,71,16,181,21,223,4,70,224,178,16,189,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,33,223,32,96,97,96,212,233,0,1,2,176,16,189,50,223,112,71,49,223,112,71,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,0,0,119,180,13,77,1,145,41,104,189,248,24,96,17,240,1,15,10,76,8,209,121,70,137,13,137,5,1,245,128,49,48,49,33,96,1,33,41,96,33,104,6,150,12,104,1,153,164,70,3,176,112,188,96,71,0,191,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,71,67,67,58,32,40,71,78,85,32,65,114,109,32,69,109,98,101,100,100,101,100,32,84,111,111,108,99,104,97,105,110,32,49,48,46,51,45,50,48,50,49,46,49,48,41,32,49,48,46,51,46,49,32,50,48,50,49,48,56,50,52,32,40,114,101,108,101,97,115,101,41,0,0,71,67,67,58,32,40,71,78,85,32,65,114,109,32,69,109,98,101,100,100,101,100,32,84,111,111,108,99,104,97,105,110,32,49,48,46,51,45,50,48,50,49,46,49,48,41,32,49,48,46,51,46,49,32,50,48,50,49,48,56,50,52,32,40,114,101,108,101,97,115,101,41,0,0,71,67,67,58,32,40,71,78,85,32,65,114,109,32,69,109,98,101,100,100,101,100,32,84,111,111,108,99,104,97,105,110,32,49,48,46,51,45,50,48,50,49,46,49,48,41,32,49,48,46,51,46,49,32,50,48,50,49,48,56,50,52,32,40,114,101,108,101,97,115,101,41,0,65,51,0,0,0,97,101,97,98,105,0,1,41,0,0,0,5,55,69,45,77,0,6,13,7,77,9,2,10,8,18,4,20,1,21,1,23,3,24,1,25,1,26,1,27,1,28,1,30,4,34,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,3,0,28,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,33,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,34,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,4,0,0,0,28,0,0,0,0,0,0,0,0,0,2,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,9,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,4,0,0,0,32,0,0,0,0,0,0,0,0,0,10,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,4,0,0,0,48,0,0,0,0,0,0,0,0,0,12,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,30,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,28,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,21,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,22,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,23,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,25,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,26,0,4,0,0,0,56,0,0,0,0,0,0,0,0,0,26,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,33,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,34,0,7,0,0,0,1,0,0,0,14,0,0,0,18,0,17,0,30,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,36,0,0,0,1,0,0,0,14,0,0,0,18,0,18,0,67,0,0,0,1,0,0,0,4,0,0,0,18,0,4,0,74,0,0,0,1,0,0,0,26,0,0,0,18,0,22,0,103,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,127,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,137,0,0,0,1,0,0,0,4,0,0,0,18,0,5,0,145,0,0,0,1,0,0,0,6,0,0,0,18,0,6,0,151,0,0,0,1,0,0,0,64,0,0,0,18,0,26,0,176,0,0,0,1,0,0,0,40,0,0,0,18,0,2,0,182,0,0,0,1,0,0,0,4,0,0,0,18,0,24,0,201,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,213,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,206,0,0,0,1,0,0,0,68,0,0,0,18,0,12,0,234,0,0,0,1,0,0,0,4,0,0,0,18,0,8,0,241,0,0,0,1,0,0,0,10,0,0,0,18,0,16,0,253,0,0,0,1,0,0,0,14,0,0,0,18,0,19,0,20,1,0,0,0,0,0,0,0,0,0,0,16,0,0,0,42,1,0,0,0,0,0,0,0,0,0,0,16,0,0,0,47,1,0,0,1,0,0,0,4,0,0,0,18,0,23,0,66,1,0,0,0,0,0,0,0,0,0,0,16,0,0,0,89,1,0,0,1,0,0,0,26,0,0,0,18,0,21,0,108,1,0,0,1,0,0,0,36,0,0,0,18,0,10,0,115,1,0,0,0,0,0,0,0,0,0,0,16,0,0,0,141,1,0,0,1,0,0,0,26,0,0,0,18,0,25,0,160,1,0,0,1,0,0,0,4,0,0,0,18,0,7,0,166,1,0,0,1,0,0,0,10,0,0,0,18,0,20,0,195,1,0,0,1,0,0,0,4,0,0,0,18,0,14,0,225,1,0,0,1,0,0,0,10,0,0,0,18,0,15,0,251,1,0,0,1,0,0,0,6,0,0,0,18,0,9,0,0,36,116,0,36,100,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,114,114,110,111,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,95,102,115,116,97,116,0,95,90,50,51,101,97,100,107,95,107,101,121,98,111,97,114,100,95,112,111,112,95,115,116,97,116,101,118,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,104,101,97,112,95,101,110,100,0,95,105,115,97,116,116,121,0,95,111,112,101,110,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,95,115,98,114,107,0,101,97,100,107,95,116,105,109,105,110,103,95,109,115,108,101,101,112,0,95,104,101,97,112,95,115,116,97,114,116,0,95,98,115,115,95,115,101,99,116,105,111,110,95,101,110,100,95,114,97,109,0,95,108,115,101,101,107,0,101,97,100,107,95,114,97,110,100,111,109,0,101,97,100,107,95,100,105,115,112,108,97,121,95,112,117,108,108,95,114,101,99,116,0,95,100,97,116,97,95,115,101,99,116,105,111,110,95,101,110,100,95,114,97,109,0,109,97,105,110,0,101,97,100,107,95,116,105,109,105,110,103,95,117,115,108,101,101,112,0,95,98,115,115,95,115,101,99,116,105,111,110,95,115,116,97,114,116,95,114,97,109,0,101,97,100,107,95,107,101,121,98,111,97,114,100,95,115,99,97,110,0,95,119,114,105,116,101,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,101,97,100,107,95,116,105,109,105,110,103,95,109,105,108,108,105,115,0,95,114,101,97,100,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,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,99,107,108,105,103,104,116,95,98,114,105,103,104,116,110,101,115,115,0,95,99,108,111,115,101,0,0,0,28,0,0,0,2,2,0,0,32,0,0,0,2,41,0,0,36,0,0,0,2,36,0,0,20,0,0,0,10,44,0,0,32,0,0,0,2,1,0,0,28,0,0,0,30,54,0,0,48,0,0,0,2,40,0,0,52,0,0,0,2,53,0,0,56,0,0,0,2,59,0,0,60,0,0,0,2,56,0,0,64,0,0,0,2,48,0,0,56,0,0,0,2,3,0,0,60,0,0,0,2,4,0,0,0,0,0,0,2,47,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,116,101,120,116,0,46,114,101,108,46,116,101,120,116,46,95,115,98,114,107,0,46,116,101,120,116,46,95,102,115,116,97,116,0,46,116,101,120,116,46,95,105,115,97,116,116,121,0,46,116,101,120,116,46,95,111,112,101,110,0,46,116,101,120,116,46,95,114,101,97,100,0,46,116,101,120,116,46,95,108,115,101,101,107,0,46,116,101,120,116,46,95,99,108,111,115,101,0,46,114,101,108,46,116,101,120,116,46,95,119,114,105,116,101,0,46,114,101,108,46,116,101,120,116,46,95,115,116,97,114,116,0,46,116,101,120,116,46,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,46,116,101,120,116,46,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,46,116,101,120,116,46,101,97,100,107,95,114,97,110,100,111,109,0,46,116,101,120,116,46,101,97,100,107,95,100,105,115,112,108,97,121,95,112,117,115,104,95,114,101,99,116,0,46,116,101,120,116,46,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,46,116,101,120,116,46,101,97,100,107,95,100,105,115,112,108,97,121,95,112,117,108,108,95,114,101,99,116,0,46,116,101,120,116,46,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,46,116,101,120,116,46,101,97,100,107,95,107,101,121,98,111,97,114,100,95,115,99,97,110,0,46,116,101,120,116,46,95,90,50,51,101,97,100,107,95,107,101,121,98,111,97,114,100,95,112,111,112,95,115,116,97,116,101,118,0,46,116,101,120,116,46,101,97,100,107,95,116,105,109,105,110,103,95,117,115,108,101,101,112,0,46,116,101,120,116,46,101,97,100,107,95,116,105,109,105,110,103,95,109,115,108,101,101,112,0,46,116,101,120,116,46,101,97,100,107,95,116,105,109,105,110,103,95,109,105,108,108,105,115,0,46,114,101,108,46,116,101,120,116,46,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,46,114,111,100,97,116,97,46,108,111,99,97,116,105,111,110,46,48,0,46,100,97,116,97,0,46,114,101,108,46,100,97,116,97,46,104,101,97,112,95,101,110,100,46,49,0,46,98,115,115,0,46,98,115,115,46,95,90,71,86,90,76,50,53,116,114,97,109,112,111,108,105,110,101,70,117,110,99,116,105,111,110,65,100,100,114,101,115,115,105,69,54,111,114,105,103,105,110,0,46,98,115,115,46,95,90,90,76,50,53,116,114,97,109,112,111,108,105,110,101,70,117,110,99,116,105,111,110,65,100,100,114,101,115,115,105,69,54,111,114,105,103,105,110,0,46,99,111,109,109,101,110,116,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,27,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,52,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,37,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,52,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,33,0,0,0,9,0,0,0,64,0,0,0,0,0,0,0,4,9,0,0,24,0,0,0,37,0,0,0,2,0,0,0,4,0,0,0,8,0,0,0,49,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,92,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,62,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,96,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,76,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,100,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,88,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,106,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,100,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,110,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,113,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,114,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,130,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,120,0,0,0,36,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,126,0,0,0,9,0,0,0,64,0,0,0,0,0,0,0,28,9,0,0,16,0,0,0,37,0,0,0,10,0,0,0,4,0,0,0,8,0,0,0,147,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,156,0,0,0,68,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,143,0,0,0,9,0,0,0,64,0,0,0,0,0,0,0,44,9,0,0,48,0,0,0,37,0,0,0,12,0,0,0,4,0,0,0,8,0,0,0,160,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,224,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,196,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,228,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,228,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,238,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,246,0,0,0,1,0,0,0,6,0,0,0,0,0,0,0,248,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,19,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,6,1,0,0,14,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,56,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,20,1,0,0,14,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,85,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,34,1,0,0,10,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,120,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,44,1,0,0,26,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,145,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,70,1,0,0,26,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,180,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,96,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,205,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,100,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,230,1,0,0,1,0,0,0,6,0,0,0,0,0,0,0,104,1,0,0,26,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,2,0,0,1,0,0,0,6,0,0,0,0,0,0,0,132,1,0,0,64,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,255,1,0,0,9,0,0,0,64,0,0,0,0,0,0,0,92,9,0,0,16,0,0,0,37,0,0,0,26,0,0,0,4,0,0,0,8,0,0,0,34,2,0,0,1,0,0,0,2,0,0,0,0,0,0,0,196,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,53,2,0,0,1,0,0,0,3,0,0,0,0,0,0,0,200,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,63,2,0,0,1,0,0,0,3,0,0,0,0,0,0,0,200,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,59,2,0,0,9,0,0,0,64,0,0,0,0,0,0,0,108,9,0,0,8,0,0,0,37,0,0,0,30,0,0,0,4,0,0,0,8,0,0,0,80,2,0,0,8,0,0,0,3,0,0,0,0,0,0,0,204,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,85,2,0,0,8,0,0,0,3,0,0,0,0,0,0,0,204,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,133,2,0,0,8,0,0,0,3,0,0,0,0,0,0,0,204,1,0,0,4,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,179,2,0,0,1,0,0,0,48,0,0,0,0,0,0,0,204,1,0,0,222,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,188,2,0,0,3,0,0,112,0,0,0,0,0,0,0,0,170,2,0,0,52,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,224,2,0,0,32,4,0,0,38,0,0,0,35,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,0,7,0,0,2,2,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,116,9,0,0,204,2,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+"toolchain/ld.wasm"},3835:(e,t,r)=>{"use strict";e.exports=r.p+"toolchain/objcopy.wasm"},9491:e=>{"use strict";e.exports=require("assert")},852:e=>{"use strict";e.exports=require("async_hooks")},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")},9203:()=>{},7461:(e,t,r)=>{const{Argument:n}=r(8998),{Command:o}=r(5282),{CommanderError:i,InvalidArgumentError:a}=r(8056),{Help:s}=r(8917),{Option:c}=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=c},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:c,humanReadableArgName:u}=r(8998),{CommanderError:l}=r(8056),{Help:f}=r(8917),{Option:h,splitOptionFlags:p,DualOptions:d}=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 c(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 c(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 u,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=c(h,f);if(!t&&!e._executableFile&&this._scriptPath){const r=i.basename(this._scriptPath,i.extname(this._scriptPath));r!==this._name&&(t=c(h,`${r}-${e._name}`))}f=t||f}if(r=n.includes(i.extname(f)),"win32"!==s.platform?r?(t.unshift(f),t=y(s.execArgv).concat(t),u=o.spawn(s.argv[0],t,{stdio:"inherit"})):u=o.spawn(f,t,{stdio:"inherit"}):(t.unshift(f),t=y(s.execArgv).concat(t),u=o.spawn(s.execPath,t,{stdio:"inherit"})),!u.killed){["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((e=>{s.on(e,(()=>{!1===u.killed&&null===u.exitCode&&u.kill(e)}))}))}const p=this._exitCallback;p?u.on("close",(()=>{p(new l(s.exitCode||0,"commander.executeSubCommandAsync","(close)"))})):u.on("close",s.exit.bind(s)),u.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(p){const e=new l(1,"commander.executeSubCommandAsync","(error)");e.nestedError=t,p(e)}else s.exit(1)})),this.runningCommand=u}_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 _(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 v(this,t),this._dispatchSubcommand(this._defaultCommandName,e,t);!this.commands.length||0!==this.args.length||this._actionHandler||this._defaultCommandName||this.help({error:!0}),v(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 _(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 d(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=>u(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);_(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),_(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=p(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 v(e,t){e._hasHelpOption&&t.find((t=>t===e._helpLongFlag||t===e._helpShortFlag))&&(e.outputHelp(),e._exit(0,"commander.helpDisplayed","(outputHelp)"))}function y(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 _(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 c=t.visibleArguments(e).map((e=>o(t.argumentTerm(e),t.argumentDescription(e))));c.length>0&&(a=a.concat(["Arguments:",i(c),""]));const u=t.visibleOptions(e).map((e=>o(t.optionTerm(e),t.optionDescription(e))));u.length>0&&(a=a.concat(["Options:",i(u),""]));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),c=new RegExp(".{1,"+(o-1)+"}([\\s​]|$)|[^\\s​]+?([\\s​]|$)","g");return i+(a.match(c)||[]).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:()=>hr});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 c(e){var t="function"==typeof Map?new Map:void 0;return c=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 u(e,arguments,h(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),f(n,e)},c(e)}function u(e,t,r){return u=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},u.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 p=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)}(p,e);var t,r,n,o,c,u=(t=p,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 p(e){var t;a(this,p);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=u.call.apply(u,[this].concat(n))).name=e,t}return n=p,o&&i(n.prototype,o),c&&i(n,c),Object.defineProperty(n,"prototype",{writable:!1}),n}(c(Error));function d(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)&&d(t.prototype,r),n&&d(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();m.Content="";const g=m;function v(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 y(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 y(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 y(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 _(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).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){_(i,n,o,a,s,"next",e)}function s(e){_(i,n,o,a,s,"throw",e)}a(void 0)}))}}function w(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(e,t,r){return t&&w(e.prototype,t),r&&w(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&&C(e,t)}function C(e,t){return C=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},C(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 x(this,r)}}function x(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 I=6,T=8,O=10,R=2,F=3,D=4,M=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==D)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 j(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 H(e){return g.info("DFU","getInterface"),new Promise((function(t,r){e.device.controlTransferIn({requestType:"standard",recipient:"interface",request:O,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:I,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:I,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 U(e,t){return g.info("DFU","getStringDescriptor","index "+t),new Promise((function(r,n){e.device.controlTransferIn({requestType:"standard",recipient:"device",request:I,value:t|F<<8,index:M},255).then((function(e){"ok"==e.status?(e.data.getInt8(1)!=F&&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 z={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,q=4,K=5,W=6,Y=0,Z=2,Q=4,J=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 E(r)}(p),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 E(r)}(p);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 ce(e){return g.info("DFU","getState"),new Promise((function(t,r){ae(e,K,1).then((function(e){t(e.getUint8(0))})).catch((function(e){r(new Error("Get state failed --\x3e "+e))}))}))}function ue(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,ce(r);case 6:if((n=e.sent)!=te){e.next=13;break}return e.next=10,se(r,q);case 10:return e.next=12,ce(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 pe.apply(this,arguments)}function pe(){return pe=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,ue(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,ue(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]])}))),pe.apply(this,arguments)}function de(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!=Q}));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,c,u,l,f;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j(n);case 2:return r=e.sent,e.next=5,B(n,r-1);case 5:return o=e.sent,e.next=8,H(n);case 8:return i=e.sent,a=o.interfaces[i].iInterface,e.next=12,U(n,a);case 12:for(s=e.sent,c=s.split("/"),u=[],l=function(e){var t=parseInt(c[e]),r=c[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,c={address:t,lastAddress:t+s-1,size:s,nbPage:o,pageSize:i};u.push(c),t+=s}))},f=1;f<c.length;f+=2)l(f);return e.abrupt("return",{v:u});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,c,u,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,ce(this);case 4:if(e.sent==Z){e.next=8;break}return e.next=8,le(this);case 8:return e.next=10,de(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 u=Math.min(this.TransferSize,n-s),g.info("DFU","upload","block number "+i,"bytes to read "+u),e.next=20,ae(this,$,u,i++);case 20:(c=e.sent).byteLength>0&&(l=new Uint8Array(c.buffer),a.set(l,s),s+=c.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,c,u,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 c=a-i,u=Math.min(c,this.TransferSize),g.info("DFU","download step, at address "+Number(r).toString(16)),l=0,f=void 0,e.next=14,de(this,s);case 14:return e.next=16,se(this,G,n.slice(i,i+u),2);case 16:return l=e.sent,e.next=19,he(this,(function(e){return e==J||e==Z}));case 19:if(f=e.sent,s+=u,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,de(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,ce(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,ue(this);case 16:if((i=e.sent).state==Q){e.next=19;break}throw"wrong DFU state: "+i.state;case 19:return e.next=21,he(this,(function(e){return e!=Q}));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=v(r.configurations);try{for(i.s();!(o=i.n()).done;){var a,s=o.value,c=v(s.interfaces);try{for(c.s();!(a=c.n()).done;){var u,l=a.value,f=v(l.alternates);try{for(f.s();!(u=f.n()).done;){var h=u.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){c.e(e)}finally{c.f()}}}catch(e){i.e(e)}finally{i.f()}return this.settings={configuration:{configurationValue:1},interface:{interfaceNumber:0},alternate:{alternateSetting:0}},this}return E(e,null,[{key:"Parse",value:function(e){new DataView(e);var t=new TextDecoder("utf-8").decode(new Uint8Array(e.slice(z.Signature.Offset,z.Signature.Offset+z.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),c=new DataView(i,V.Element.Size.Offset,V.Element.Address.Offset+V.Element.Size.Size).getUint32(0,!0),u=i.slice(V.Element.Data.Offset,V.Element.Data.Offset+c);i=i.slice(V.Element.Data.Offset+c),n.push({address:s,size:c,data:u})}return n}}]),e}();function ve(e){return new TextDecoder("utf-8").decode(e.subarray(0,e.indexOf(0)))}function ye(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 _e(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 we(e){return btoa(e.match(/\w{2}/g).map((function(e){return String.fromCharCode(parseInt(e,16))})).join(""))}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 Se(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 Se(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 Se(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 Ae(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 Ce(e,t,r){return t&&Ae(e.prototype,t),r&&Ae(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ke(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xe(e,t){return xe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},xe(e,t)}function Pe(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=Te(e);if(t){var o=Te(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Ie(this,r)}}function Ie(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 Te(e){return Te=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Te(e)}var Oe=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&&xe(e,t)}(r,e);var t=Pe(r);function r(){ke(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 Ce(r)}(p);function Re(e){return new DataView(e.buffer,e.byteOffset).getUint16(0,!0)}function Fe(e){var t={size:0,name:"unknown",content:"unknown"};return t.size=Re(e),t.name=ve(e.subarray(2)),t.content=e.subarray(2+t.name.length+1,t.size),t}var De=function(e){function t(e){ke(this,t),this.records=e}return Ce(t,[{key:Symbol.iterator,value:function(){var e=this.records;return{next:function(){var t=Re(e);if(0===t)return{done:!0};var r=Fe(e);return e=e.subarray(t),{value:r,done:!1}}}}}]),t}();const Me=Ce((function e(t){ke(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),c=n,u=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(ye(e),2),n.set(t,2+e.length+1),n}}(e,t);if(void 0!==u){if(Fe(u).size>this.availableSize()+o)throw new Oe("The storage on calculator is full");this.data.set(u,n),c+=u.length,s=s.slice(0,this.data.length-(n+u.length))}this.data.set(s,c),this.data.fill(0,c+s.length)},this.data=t}));function Ne(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 Le(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 Le(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 Le(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 je(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).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){je(i,n,o,a,s,"next",e)}function s(e){je(i,n,o,a,s,"throw",e)}a(void 0)}))}}function Be(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 Ue(e,t,r){return t&&Be(e.prototype,t),r&&Be(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 Ve(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&&Ge(e,t)}function Ge(e,t){return Ge=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ge(e,t)}function $e(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=qe(e);if(t){var o=qe(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Xe(this,r)}}function Xe(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 qe(e){return qe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},qe(e)}var Ke=r(3786),We=2048,Ye=_e("F00DC0DE"),Ze=_e("FEEDC0DE"),Qe=_e("BADBEEEF"),Je=function(e){Ve(r,e);var t=$e(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 Ue(r)}(p),et=function(e){Ve(r,e);var t=$e(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 Ue(r)}(p),tt=function(e){Ve(r,e);var t=$e(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 Ue(r)}(p),rt=function(e){Ve(r,e);var t=$e(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 Ue(r)}(p),nt=function(e){Ve(r,e);var t=$e(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 Ue(r)}(p),ot=function(e){Ve(r,e);var t=$e(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,"DeviceDetectionError"].concat(n))}return Ue(r)}(p),it=function(e){Ve(r,e);var t=$e(r);function r(e){var n;ze(this,r);for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];return(n=t.call.apply(t,[this,"BulkError"].concat(i))).errors=e,n}return Ue(r)}(p),at={N0100:{name:"N0100",ElectronicSignatureAddress:536836624,RAMAddressStart:536870912,RAMAddressEnd:537133056},N0110:{name:"N0110",ElectronicSignatureAddress:535853584,RAMAddressStart:536870912,RAMAddressEnd:537133056},N0120:{name:"N0120",ElectronicSignatureAddress:535947264,RAMAddressStart:603979776,RAMAddressEnd:604307456},N0120Prototype:{displayed_name:"N0120",ElectronicSignatureAddress:535947264,name:"N0120_PORTUGAL_PROTOTYPE_20210930",RAMAddressStart:603979776,RAMAddressEnd:604307456}},st=_e("BADD0BEE");function ct(e){for(var t="",r=0;r<e.byteLength;r++)t+=e[r].toString(16).padStart(2,"0").toUpperCase();return t}function ut(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 lt(e,t){return!(e.length<t.length)&&ut(e.subarray(e.length-t.length),t)}function ft(e,t){if(!(e>=134217728&&e+t<=135266304||e>=2415919104&&e+t<=2424307712))throw new nt("Access to address: "+e+" (length "+t+") is out of flash range")}function ht(e,t,r){if(t<e.RAMAddressStart||t+r>=e.RAMAddressEnd)throw new nt("Access to address: "+t+" (length "+r+") is out of RAM range")}function pt(e){if(g.info("Calculator","parseSlotInfo","header info "+e),!ut(e,Qe)||!lt(e,Qe))return null;var t=new DataView(e.buffer,e.byteOffset);return{kernelHeaderAddress:t.getUint32(4,!0),userlandHeaderAddress:t.getUint32(8,!0)}}function dt(e,t){if(g.info("Calculator","parseFirmwareHeader","header "+e),!ut(e,Ye))return t;t.version=ve(e.subarray(4)),t.patch=ve(e.subarray(12));var r=e.subarray(20);if(ut(r,Ye))return t;var n=new DataView(e.buffer,e.byteOffset);return t.storageAddress=n.getUint32(20,!0),ut(r=e.subarray(24),Ye)||(t.storageSize=n.getUint32(24,!0)),t}function mt(e,t){if(g.info("Calculator","parseUserlandHeader","header "+e),!ut(e,Ze))return t;t.userlandVersion=ve(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 gt(){return(gt=He(t().mark((function e(r,n,o){var i,a,s,c,u,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+St.Header0.Offset,s=St.Header0.Size,ft(a,s),e.next=8,r.upload(a,s);case 8:if(!ut(c=e.sent,Ye)||!lt(c,Ye)){e.next=13;break}return e.abrupt("return",dt(c,i));case 13:return a=n[0].address+St.Header1.Offset,s=St.Header1.Size,ft(a,s),e.next=18,r.upload(a,s);case 18:if(!ut(c=e.sent,Ye)||!lt(c,Ye)){e.next=23;break}return e.abrupt("return",dt(c,i));case 23:return a=o.RAMAddressStart,s=St.Header2.SlotInfoSize,ht(o,a,s),e.prev=26,e.next=29,r.upload(a,s);case 29:if(u=e.sent,null!=(l=pt(u))){e.next=33;break}throw new Je("The slot info was corrupted");case 33:return a=l.kernelHeaderAddress,s=St.Header2.KernelHeaderSize,ft(a,s),e.next=38,r.upload(a,s);case 38:return f=e.sent,i=dt(f,i),a=l.userlandHeaderAddress,s=St.Header2.UserlandHeaderSize,ft(a,s),e.next=45,r.upload(a,s);case 45:return h=e.sent,i=mt(h,i),e.abrupt("return",i);case 50:return e.prev=50,e.t0=e.catch(26),e.abrupt("return",dt(c,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 vt(){return vt=He(t().mark((function e(r,n){var o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(16!=(o=r.device.serialNumber).length){e.next=3;break}return e.abrupt("return",o);case 3:return e.next=5,r.upload(n.ElectronicSignatureAddress-1,13);case 5:return i=e.sent,e.abrupt("return",we(ct(i.subarray(1,13))));case 7:case"end":return e.stop()}}),e)}))),vt.apply(this,arguments)}function yt(e,t){return _t.apply(this,arguments)}function _t(){return _t=He(t().mark((function e(r,n){var o,i;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(g.info("Calculator","calculatorGetStorage","address "+Number(n.firmware.storageAddress).toString(16)),"unknown"!==n.firmware.storageAddress){e.next=3;break}throw new Je("The Storage address could not be found in header");case 3:e.prev=3,ht(n.model,n.firmware.storageAddress,n.firmware.storageSize+2*st.length),e.next=10;break;case 7:throw e.prev=7,e.t0=e.catch(3),new Je("Calculator Get Storage failed --\x3e "+e.t0);case 10:if(!1===r.storage){e.next=12;break}return e.abrupt("return",r.storage);case 12:return e.prev=12,e.next=15,r.dfu.upload(n.firmware.storageAddress,n.firmware.storageSize+2*st.length);case 15:if(!ut(o=e.sent,st)||!lt(o,st)){e.next=22;break}return i=o.subarray(st.length,n.firmware.storageSize+st.length),r.storage=new Me(i),e.abrupt("return",r.storage);case 22:throw new Je("Memory is corrupted: could not find storage tags");case 23:e.next=29;break;case 25:throw e.prev=25,e.t1=e.catch(12),e.t1.message="CalculationGetStorage failed --\x3e "+e.t1.message,e.t1;case 29:case"end":return e.stop()}}),e,null,[[3,7],[12,25]])}))),_t.apply(this,arguments)}function bt(e,t,r){return wt.apply(this,arguments)}function wt(){return wt=He(t().mark((function e(r,n,o){return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:g.info("Calculator","calculatorSetStorage","address "+Number(n.firmware.storageAddress).toString(16)),e.prev=1,ht(n.model,n.firmware.storageAddress+st.length,o.data),e.next=8;break;case 5:throw e.prev=5,e.t0=e.catch(1),new Je("Calculator Set Storage failed --\x3e "+e.t0);case 8:return e.prev=8,e.next=11,r.dfu.download(n.firmware.storageAddress+st.length,o.data);case 11:e.next=17;break;case 13:throw e.prev=13,e.t1=e.catch(8),e.t1.message="CalculationSetStorage failed --\x3e "+e.t1.message,e.t1;case 17:case"end":return e.stop()}}),e,null,[[1,5],[8,13]])}))),wt.apply(this,arguments)}function Et(e){var t=ye(e),r=new Uint8Array(t.length+1);return r[0]=1,r.set(t,1),r}var St=function(){function e(t,r){ze(this,e),this.dfu=new ge(t,r),this.running=!1,this.storage=!1,this.infos=!1}return Ue(e,[{key:"process",value:function(e){var t,r=this;return g.info("Calculator","process"),new Ke((function(n,o){if(r.running)return o(new et("Calculator is already processing another request"));r.running=!0,r.dfu.open().then((function(){return e(r)})).then((function(e){if(t=e,r.dfu.device.opened)return r.dfu.close()})).then((function(){return r.running=!1,n(t)})).catch((function(e){return r.running=!1,o(e)}))}))}},{key:"reconnectAndProcess",value:function(t,r){var n=this;return new Ke((function(o,i){return g.info("Calculator","reconnect"),null==navigator.usb?i(new tt("Web usb unvailable")):e.StallUntilConnect(n.dfu.device.serialNumber,t).then((function(e){return e.process(r)})).then((function(e){o(e)})).catch((function(e){i(e)}))}))}},{key:"extractInfos",value:function(){var e=this;return g.info("Calculator","extractInfos"),new Ke((function(t,r){var n,o,i;return!1!==e.infos?t(e):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?at.N0120Prototype:at.N0120;var r=t[t.length-1].lastAddress;return r>135135232&&r<2415919104?at.N0100:at.N0110}(e.dfu.device,n),function(e,t,r){return gt.apply(this,arguments)}(e.dfu,n,o)})).then((function(t){return i=t,function(e,t){return vt.apply(this,arguments)}(e.dfu,o)})).then((function(r){return e.infos={serialNumber:be(r),displayedSerialNumber:r,model:o,memoryLayout:n,firmware:i},t(e)})).catch((function(e){e.message="extractInfos 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 Ke((function(o,i){try{ft(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 Ke((function(s,c){var u=function(){var e=He(t().mark((function e(r,n,o,i,a){var s,c,u,l,f,h,p,d,m,g,v,y,_;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=0,c=0,u=-1,l=-1,f=-1,h=-1,p=0;case 7:if(!(p<n.length)){e.next=33;break}if(!(u<0)){e.next=14;break}if(!(o>n[p].lastAddress)){e.next=13;break}return e.abrupt("continue",30);case 13:u=p;case 14:d=0;case 15:if(!(d<n[p].nbPage)){e.next=30;break}if(!(l<0)){e.next=22;break}if(o!=n[p].address+d*n[p].pageSize){e.next=21;break}l=d,e.next=22;break;case 21:return e.abrupt("continue",27);case 22:if(!((s+=n[p].pageSize)>=i.byteLength)){e.next=27;break}return f=p,h=d,e.abrupt("break",33);case 27:d++,e.next=15;break;case 30:p++,e.next=7;break;case 33:m=u;case 34:if(!(m<=f)){e.next=51;break}g=m==u?l:0,v=m==f?h+1:n[m].nbPage,y=g;case 38:if(!(y<v)){e.next=48;break}return _=n[m].address+y*n[m].pageSize,e.next=42,r.eraseSegment(_);case 42:c+=n[m].pageSize,a(c/s),_+=n[m].pageSize;case 45:y++,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{ft(e,r.byteLength)}catch(e){e.message="downloadFlash failed --\x3e "+e.message,c(e)}u(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,c(e)}))}))}},{key:"reset",value:function(e){var t=this;return g.info("Calculator","reset"),new Ke((function(r,n){try{ft(e.memoryLayout[0].address,0)}catch(e){e.message="reset failed --\x3e "+e.message,n(e)}return t.dfu.leave(134217728).then((function(){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 Ke((function(t,r){var n={availableSize:!1,totalSize:!1};e.extractInfos().then((function(t){return yt(e,t.infos)})).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 Ke((function(t,r){e.extractInfos().then((function(t){return yt(e,t.infos)})).then((function(e){return e.recordsWithExtension(".py").map((function(t,r){return{name:t,size:e.size(t),content:ve(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 Ke((function(t,r){e.extractInfos().then((function(t){return yt(e,t.infos)})).then((function(t){t.recordsWithExtension(".py").map((function(e,r){t.setContent(e)}));return bt(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 Ke((function(r,n){var o;t.extractInfos().then((function(e){return yt(t,e.infos)})).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 Ke((function(n,o){r.extractInfos().then((function(e){return yt(r,e.infos)})).then((function(n){try{n.setContent(e,t)}catch(e){o(e)}return bt(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 Ke((function(n,o){r.setContentForRecord(e,Et(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 Ke((function(r,n){t.extractInfos().then((function(e){return yt(t,e.infos)})).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 bt(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 Ke((function(r,n){var o=[];e.forEach((function(e,t){o[t]={name:e.name,content:Et(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 Ke((function(r,n){t.extractInfos().then((function(e){return yt(t,e.infos)})).then((function(r){return r.setContent(e),bt(t,t.infos,r)})).then((function(){r(!0)})).catch((function(e){e.memory="removeRecord failed --\x3e "+e.message,n(e)}))}))}}],[{key:"DisplayableFirmwarePatch",value:function(e){return"badbabe"==e?"unofficial":e}},{key:"CheckFirmware",value:function(e,t){for(var r=0;r<t.byteLength;r++)if(e[r]!=t[r])throw new Je("The uploaded firmware differs from the reference at byte "+r);return!0}},{key:"StallUntilConnect",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return g.info("Calculator","StallUntilConnect"),new Ke((function(o,i){return n>60?i(new ot("Device detection timed out")):navigator.usb.getDevices().then((function(a){var s,c=Ne(a);try{for(c.s();!(s=c.n()).done;){var u=s.value;if(u.serialNumber===t)return r(1),o(new e(u,We))}}catch(e){c.e(e)}finally{c.f()}return r((n-1)/n),setTimeout((function(){return e.StallUntilConnect(t,r,n+1).then((function(e){o(e)})).catch((function(e){i(e)}))}),1e3)})).catch((function(e){i(e)}))}))}}]),e}();St.Header0={Offset:428,Size:24},St.Header1={Offset:452,Size:32},St.Header2={SlotInfoSize:16,KernelHeaderSize:24,UserlandHeaderSize:40},St.Product={Numworks:"numworks",ST:"ST"};var At=function(){function e(){ze(this,e),this.calculators=[]}return Ue(e,[{key:"singleConnectAndExtractInfos",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return 1==this.calculators.length&&null!=this.calculators[0].info?this.calculators[0]:this.connectAndProcess((function(e){return e.extractInfos()}),!1,[St.Product.Numworks],e).then((function(e){return e[0]}))}},{key:"connectAndProcess",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[St.Product.Numworks],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];g.info("CalculatorBulk","connectAndProcess");var i=[];return new Ke((function(a,s){r.connect(n,t,o).then((function(t){return r.connected()?Ke.map(t,(function(t){return t.process(e).catch((function(e){i.push({serialNumber:t.infos.serialNumber,error:e})}))})).then((function(e){if(i.length>0){if(1==t.length)throw i[0].error;throw new it(i)}return a(e)})):s(new rt("No usb connection found"))})).catch((function(e){s(e)}))}))}},{key:"connected",value:function(){return this.calculators.length>0}},{key:"connect",value:function(t,r,n){var o=this;return new Ke((function(i,a){e.Connect(t,n).then((function(e){o.calculators=r||0==e.length?e:[e[0]],i(o.calculators)})).catch((function(e){e.memory="connect failed --\x3e "+e.message,a(e)}))}))}}],[{key:"Connect",value:function(e,t){g.info("CalculatorBulk","connect",e);var r=[],n=e.map((function(e){return e==St.Product.Numworks?41617:57105})),o=[];return n.forEach((function(e){return o.push({vendorId:1155,productId:e})})),new Ke((function(e,i){if(null==navigator.usb)return i(new tt("Web usb unvailable"));t?(g.info("CalculatorBulk","connect","request device"),navigator.usb.requestDevice({filters:o}).then((function(t){return r.push(new St(t,We)),e(r)})).catch((function(e){i(new rt("Usb device selection failure: "+e))}))):(g.info("Calculator","connect","get device"),navigator.usb.getDevices().then((function(t){var o,i=Ne(t);try{for(i.s();!(o=i.n()).done;){var a=o.value;1155===a.vendorId&&n.includes(a.productId)&&r.push(new St(a,We))}}catch(e){i.e(e)}finally{i.f()}return e(r)})).catch((function(e){i(new rt("Usb device failed: "+e))})))}))}}]),e}();r(382);var Ct=r(280),kt=(r(8744),r(5405)),xt=r(5477);function Pt(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 It(e,t){return Math.round(255/((1<<t)-1)*e)}var Tt=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=xt.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);kt.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]=It(i,5),r[4*n+1]=It(a,6),r[4*n+2]=It(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=kt.compressBlock(e,new Uint8Array(0),0,e.length,kt.makeBuffer(65536)),r=new Uint8Array(t);return kt.compressBlock(e,r,0,e.length,kt.makeBuffer(65536)),r}}])&&Pt(t.prototype,r),n&&Pt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();Tt.Width=55,Tt.Height=56;const Ot=Tt;var Rt=r(5827),Ft=r.n(Rt),Dt=r(2890),Mt=r.n(Dt);function Nt(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 Lt(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 Lt(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 Lt(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 jt(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function Ht(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){jt(i,n,o,a,s,"next",e)}function s(e){jt(i,n,o,a,s,"throw",e)}a(void 0)}))}}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)}}var Ut=r(7475),zt=r(8006),Vt=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,c,u;return n=e,o=[{key:"name",value:function(){var e=this.dataForSymbolNamed("eadk_app_name");return(new TextDecoder).decode(e)}},{key:"refreshSize",value:(u=Ht(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 u.apply(this,arguments)})},{key:"icon",value:function(){var e=this.dataForSymbolNamed("eadk_app_icon"),t=Ot.fromNWI(e);return t.toPNG()}},{key:"flatElf",value:(c=Ht(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","--gc-sections","--allow-multiple-definition","eadk.o","app-pack.elf"],inputs:{"linker.ld":Ut(r),"app-pack.elf":this.packedElfData,"eadk.o":new Uint8Array(zt.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 c.apply(this,arguments)})},{key:"flatBin",value:(s=Ht(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 Ct.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=Nt(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"))}};Ft()(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"))}};Mt()(o)}))}},{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.eadk_external_data","--redefine-sym","_binary_input_dat_start=eadk_external_data"],input:this.externalData})}}],i=[{key:"from",value:(a=Ht(t().mark((function r(n){var o;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ct.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&&Bt(n.prototype,o),i&&Bt(n,i),Object.defineProperty(n,"prototype",{writable:!1}),e}();Vt.AppSectorSize=65536;const Gt=Vt;function $t(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function Xt(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){$t(i,n,o,a,s,"next",e)}function s(e){$t(i,n,o,a,s,"throw",e)}a(void 0)}))}}function qt(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 Kt(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 Kt(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 Kt(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 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 Yt(e,t,r){return t&&Wt(e.prototype,t),r&&Wt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qt(e,t){return Qt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Qt(e,t)}function Jt(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=tr(e);if(t){var o=tr(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return er(this,r)}}function er(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 tr(e){return tr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},tr(e)}var rr=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&&Qt(e,t)}(r,e);var t=Jt(r);function r(){Zt(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 Yt(r)}(p),nr=function(){function e(){Zt(this,e),this.apps=[]}var r,n;return Yt(e,[{key:"push",value:function(e){this.apps.push(e)}},{key:"isReadyToUpload",value:function(){var e,t=qt(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=Xt(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.process((function(e){return e.downloadFlash(i.flashStart,a,r.infos,(function(e){n(.2*e)}),(function(e){n(.2+.8*e)})).then((function(){return 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=Xt(t().mark((function e(r){var n,o,i,a,s,c,u,l,f,h,p;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=qt(this.apps),e.prev=4,a.s();case 6:if((s=a.n()).done){e.next=19;break}if(c=s.value,!(i>=o)){e.next=10;break}throw new rr("External app sector would be overflown");case 10:return e.next=12,c.flatBin({flashStart:i,flashLength:o-i,ramStart:r.ramStart,ramLength:r.ramLength});case 12:u=e.sent,n=this.concatenateU8A(n,u),i+=u.byteLength,(l=u.byteLength%Gt.AppSectorSize)>0&&(f=Gt.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&&((p=new Uint8Array(Gt.AppSectorSize)).fill(255),n=this.concatenateU8A(n,p)),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=qt(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}();const or=nr,ir=r.p+"eadk/eadk.h";function ar(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function sr(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){ar(i,n,o,a,s,"next",e)}function s(e){ar(i,n,o,a,s,"throw",e)}a(void 0)}))}}var cr=r(1017),ur=cr.dirname,lr=(cr.resolve,r(7147)),fr=r(7461).Command;function hr(e){var r=new fr;function n(e,t){return o.apply(this,arguments)}function o(){return(o=sr(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=lr.readFileSync(r),e.next=3,Gt.from(o);case 3:return i=e.sent,n.externalData&&(a=lr.readFileSync(n.externalData),i.setExternalData(a)),e.abrupt("return",i);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function i(){return i=sr(t().mark((function e(r,o){var i,a,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("Installing",r,"with",o),e.next=3,n(r,o);case 3:return i=e.sent,(a=new or).push(i),s=new At,e.next=9,s.singleConnectAndExtractInfos(!0).then((function(e){return console.log("Got infos"),a.upload(e,(function(e){console.log("Upload progress",e)}))}));case 9:case"end":return e.stop()}}),e)}))),i.apply(this,arguments)}function a(){return(a=sr(t().mark((function e(r,o,i){var a,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n(r,i);case 2:return a=e.sent,e.next=5,a.flatElf(i);case 5:s=e.sent,lr.writeFileSync(o,s);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function s(){return(s=sr(t().mark((function e(r,o,i){var a,s;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n(r,i);case 2:return a=e.sent,e.next=5,a.flatBin(i);case 5:s=e.sent,lr.writeFileSync(o,s);case 7: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 i.apply(this,arguments)})),r.command("nwa-elf").description("Link a NWA app").argument("<input.nwa>","Input NWA file").argument("<output.elf>","Output ELF 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 a.apply(this,arguments)})),r.command("nwa-bin").description("Link a NWA app and convert to binary format").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 s.apply(this,arguments)})),r.command("png-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=lr.readFileSync(e),n=Ot.fromPNG(r);lr.writeFileSync(t,n.toNWI())})),r.command("eadk-cflags").description("Print EADK CFLAGS").action((function(){var e=["-mthumb","-mfloat-abi=hard","-mcpu=cortex-m7","-mfpu=fpv5-sp-d16","-I"+ur(ir)];console.log(e.join(" "))})),r.parseAsync(e)}global.navigator={usb:o.webusb}})(),module.exports=n.default})();