/* ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. *****************************************************************************/ 'use strict';(function(){function mc(c,a=self){a.addEventListener("message",function e(d){if(d&&d.data){var {id:f,type:g,path:h}=Object.assign({path:[]},d.data),k=(d.data.argumentList||[]).map(Fa);try{let a=h.slice(0,-1).reduce((a,c)=>a[c],c),e=h.reduce((a,c)=>a[c],c);switch(g){case 0:var t=e;break;case 1:a[h.slice(-1)[0]]=Fa(d.data.value);t=!0;break;case 2:t=e.apply(a,k);break;case 3:{let a=new e(...k);t=Object.assign(a,{[vd]:!0})}break;case 4:{let {port1:a,port2:d}=new MessageChannel;mc(c,d);t= Cf(a,[a])}break;case 5:t=void 0}}catch(q){t=q,nc.add(q)}Promise.resolve(t).catch(a=>{nc.add(a);return a}).then(c=>{let [d,h]=oc(c);a.postMessage(Object.assign(Object.assign({},d),{id:f}),h);5===g&&(a.removeEventListener("message",e),"MessagePort"===a.constructor.name&&a.close())})}});a.start&&a.start()}function Db(c){if(c)throw Error("Proxy has been released and is not useable");}function pc(c,a=[],b=function(){}){let d=!1,e=new Proxy(b,{get(b,g){Db(d);if(g===Df)return()=>Ta(c,{type:5,path:a.map(a=> a.toString())}).then(()=>{"MessagePort"===c.constructor.name&&c.close();d=!0});if("then"===g){if(0===a.length)return{then:()=>e};b=Ta(c,{type:0,path:a.map(a=>a.toString())}).then(Fa);return b.then.bind(b)}return pc(c,[...a,g])},set(b,e,h){Db(d);const [f,g]=oc(h);return Ta(c,{type:1,path:[...a,e].map(a=>a.toString()),value:f},g).then(Fa)},apply(b,e,h){Db(d);b=a[a.length-1];if(b===Ef)return Ta(c,{type:4}).then(Fa);if("bind"===b)return pc(c,a.slice(0,-1));const [f,g]=wd(h);return Ta(c,{type:2,path:a.map(a=> a.toString()),argumentList:f},g).then(Fa)},construct(b,e){Db(d);const [f,g]=wd(e);return Ta(c,{type:3,path:a.map(a=>a.toString()),argumentList:f},g).then(Fa)}});return e}function wd(c){c=c.map(oc);return[c.map(a=>a[0]),Array.prototype.concat.apply([],c.map(a=>a[1]))]}function Cf(c,a){xd.set(c,a);return c}function oc(c){for(let [a,b]of yd)if(b.canHandle(c)){let [d,e]=b.serialize(c);return[{type:3,name:a,value:d},e]}return[{type:0,value:c},xd.get(c)||[]]}function Fa(c){switch(c.type){case 3:return yd.get(c.name).deserialize(c.value); case 0:return c.value}}function Ta(c,a,b){return new Promise(d=>{let e=Ff();c.addEventListener("message",function h(a){a.data&&a.data.id&&a.data.id===e&&(c.removeEventListener("message",h),d(a.data))});c.start&&c.start();c.postMessage(Object.assign({id:e},a),b)})}function Ff(){return Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}function zd(c,a){function b(){this.constructor=c}qc(c,a);c.prototype=null===a?Object.create(a):(b.prototype=a.prototype, new b)}function Eb(c,a,b,d){return new (b||(b=Promise))(function(e,f){function g(a){try{k(d.next(a))}catch(q){f(q)}}function h(a){try{k(d["throw"](a))}catch(q){f(q)}}function k(a){a.done?e(a.value):(new b(function(c){c(a.value)})).then(g,h)}k((d=d.apply(c,a||[])).next())})}function Fb(c,a){function b(a){return function(c){return d([a,c])}}function d(b){if(f)throw new TypeError("Generator is already executing.");for(;e;)try{if(f=1,g&&(h=b[0]&2?g["return"]:b[0]?g["throw"]||((h=g["return"])&&h.call(g), 0):g.next)&&!(h=h.call(g,b[1])).done)return h;if(g=0,h)b=[b[0]&2,h.value];switch(b[0]){case 0:case 1:h=b;break;case 4:return e.label++,{value:b[1],done:!1};case 5:e.label++;g=b[1];b=[0];continue;case 7:b=e.ops.pop();e.trys.pop();continue;default:if(!(h=e.trys,h=0h[0]&&b[1]h[0]&&b[1]=c.length&&(c=void 0);return{value:c&&c[b++],done:!c}}}}function If(c,a){var b="function"===typeof Symbol&&c[Symbol.iterator];if(!b)return c;c=b.call(c);var d,e=[];try{for(;(void 0===a||0c;++c)R[c]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c],H["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(c)]= c;H[45]=62;H[95]=63}function Kf(c,a,b){for(var d=[],e=a;e>18&63]+R[a>>12&63]+R[a>>6&63]+R[a&63]);return d.join("")}function Bd(c){sc||Ad();for(var a=c.length,b=a%3,d="",e=[],f=0,g=a-b;fg?g:f+16383));1===b?(c=c[a-1],d+=R[c>>2],d+=R[c<<4&63],d+="=="):2===b&&(c=(c[a-2]<<8)+c[a-1],d+=R[c>>10],d+=R[c>>4&63],d+=R[c<<2&63],d+="=");e.push(d);return e.join("")}function Gb(c,a,b,d,e){var f=8*e-d-1,g=(1<>1,k=-7;e= b?e-1:0;var t=b?-1:1,q=c[a+e];e+=t;b=q&(1<<-k)-1;q>>=-k;for(k+=f;0>=-k;for(k+=d;0>1,q=23===e?Math.pow(2,-24)-Math.pow(2,-77):0;f=d?0:f-1;var A=d?1:-1,r=0>a||0===a&&0>1/a?1:0;a=Math.abs(a);for(isNaN(a)||Infinity===a?(a=isNaN(a)?1:0,d=k):(d=Math.floor(Math.log(a)/ Math.LN2),1>a*(g=Math.pow(2,-d))&&(d--,g*=2),a=1<=d+t?a+q/g:a+q*Math.pow(2,1-t),2<=a*g&&(d++,g/=2),d+t>=k?(a=0,d=k):1<=d+t?(a=(a*g-1)*Math.pow(2,e),d+=t):(a=a*Math.pow(2,t-1)*Math.pow(2,e),d=0));8<=e;c[b+f]=a&255,f+=A,a/=256,e-=8);d=d<b||a.byteLengthc)throw new RangeError('"size" argument must not be negative');}function tc(c,a){Ed(a);c=ja(c,0>a?0:vc(a)|0);if(!l.TYPED_ARRAY_SUPPORT)for(var b=0;ba.length?0:vc(a.length)|0;c=ja(c,b);for(var d=0;d=(l.TYPED_ARRAY_SUPPORT?2147483647:1073741823))throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+(l.TYPED_ARRAY_SUPPORT?2147483647:1073741823).toString(16)+" bytes");return c|0}function W(c){return!(null== c||!c._isBuffer)}function Dd(c,a){if(W(c))return c.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(c)||c instanceof ArrayBuffer))return c.byteLength;"string"!==typeof c&&(c=""+c);var b=c.length;if(0===b)return 0;for(var d=!1;;)switch(a){case "ascii":case "latin1":case "binary":return b;case "utf8":case "utf-8":case void 0:return Ib(c).length;case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return 2*b;case "hex":return b>>>1;case "base64":return Gd(c).length; default:if(d)return Ib(c).length;a=(""+a).toLowerCase();d=!0}}function Mf(c,a,b){var d=!1;if(void 0===a||0>a)a=0;if(a>this.length)return"";if(void 0===b||b>this.length)b=this.length;if(0>=b)return"";b>>>=0;a>>>=0;if(b<=a)return"";for(c||(c="utf8");;)switch(c){case "hex":c=a;a=b;b=this.length;if(!c||0>c)c=0;if(!a||0>a||a>b)a=b;d="";for(b=c;bd?"0"+d.toString(16):d.toString(16),d=c+d;return d;case "utf8":case "utf-8":return Hd(this,a,b);case "ascii":c="";for(b=Math.min(this.length, b);ab&&(b=-2147483648);b=+b;isNaN(b)&&(b=e?0:c.length-1);0>b&&(b=c.length+b);if(b>=c.length){if(e)return-1;b=c.length-1}else if(0>b)if(e)b=0;else return-1;"string"===typeof a&&(a=l.from(a,d));if(W(a))return 0===a.length?-1:Jd(c,a,b,d,e);if("number"===typeof a)return a&=255,l.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?e?Uint8Array.prototype.indexOf.call(c, a,b):Uint8Array.prototype.lastIndexOf.call(c,a,b):Jd(c,[a],b,d,e);throw new TypeError("val must be string, number or Buffer");}function Jd(c,a,b,d,e){function f(a,c){return 1===g?a[c]:a.readUInt16BE(c*g)}var g=1,h=c.length,k=a.length;if(void 0!==d&&(d=String(d).toLowerCase(),"ucs2"===d||"ucs-2"===d||"utf16le"===d||"utf-16le"===d)){if(2>c.length||2>a.length)return-1;g=2;h/=2;k/=2;b/=2}if(e)for(d=-1;bh&&(b=h-k);0<=b;b--){h=!0;for(d=0;de&&(f=e);break;case 2:var h=c[a+1];128===(h&192)&&(e=(e&31)<<6|h&63,127e||57343e&&(f=e))}null===f?(f=65533,g=1):65535>>10&1023|55296),f=56320|f&1023);d.push(f);a+=g}c=d.length;if(c<=Kd)d=String.fromCharCode.apply(String,d);else{b="";for(a=0;ac)throw new RangeError("offset is not uint");if(c+a>b)throw new RangeError("Trying to access beyond buffer length"); }function T(c,a,b,d,e,f){if(!W(c))throw new TypeError('"buffer" argument must be a Buffer instance');if(a>e||ac.length)throw new RangeError("Index out of range");}function Jb(c,a,b,d){0>a&&(a=65535+a+1);for(var e=0,f=Math.min(c.length-b,2);e>>8*(d?e:1-e)}function Kb(c,a,b,d){0>a&&(a=4294967295+a+1);for(var e=0,f=Math.min(c.length-b,4);e>>8*(d?e:3-e)&255}function Lb(c,a,b,d){if(b+ d>c.length)throw new RangeError("Index out of range");if(0>b)throw new RangeError("Index out of range");}function Ib(c,a){a=a||Infinity;for(var b,d=c.length,e=null,f=[],g=0;gb){if(!e){if(56319b){-1<(a-=3)&&f.push(239,191,189);e=b;continue}b=(e-55296<<10|b-56320)+65536}else e&&-1<(a-=3)&&f.push(239,191,189);e=null;if(128>b){if(0>--a)break; f.push(b)}else if(2048>b){if(0>(a-=2))break;f.push(b>>6|192,b&63|128)}else if(65536>b){if(0>(a-=3))break;f.push(b>>12|224,b>>6&63|128,b&63|128)}else if(1114112>b){if(0>(a-=4))break;f.push(b>>18|240,b>>12&63|128,b>>6&63|128,b&63|128)}else throw Error("Invalid code point");}return f}function Ld(c){for(var a=[],b=0;bc.length)c="";else for(;0!==c.length%4;)c+="=";sc||Ad(); var a=c.length;if(0>16&255;d[f++]=g>>8&255;d[f++]=g&255}2===b?(g=H[c.charCodeAt(a)]<<2|H[c.charCodeAt(a+1)]>>4,d[f++]=g&255):1===b&&(g=H[c.charCodeAt(a)]<<10|H[c.charCodeAt(a+1)]<<4|H[c.charCodeAt(a+2)]>>2,d[f++]=g>>8&255,d[f++]=g&255); return d}function nb(c,a,b,d){for(var e=0;e=a.length||e>=c.length);++e)a[e+b]=c[e];return e}function pa(c){return null!=c&&(!!c._isBuffer||Md(c)||"function"===typeof c.readFloatLE&&"function"===typeof c.slice&&Md(c.slice(0,0)))}function Md(c){return!!c.constructor&&"function"===typeof c.constructor.isBuffer&&c.constructor.isBuffer(c)}function Nd(){throw Error("setTimeout has not been defined");}function Od(){throw Error("clearTimeout has not been defined");}function Pd(c){if(ua===setTimeout)return setTimeout(c, 0);if((ua===Nd||!ua)&&setTimeout)return ua=setTimeout,setTimeout(c,0);try{return ua(c,0)}catch(a){try{return ua.call(null,c,0)}catch(b){return ua.call(this,c,0)}}}function Pf(c){if(va===clearTimeout)return clearTimeout(c);if((va===Od||!va)&&clearTimeout)return va=clearTimeout,clearTimeout(c);try{return va(c)}catch(a){try{return va.call(null,c)}catch(b){return va.call(this,c)}}}function Qf(){Ua&&Ha&&(Ua=!1,Ha.length?ka=Ha.concat(ka):Mb=-1,ka.length&&Qd())}function Qd(){if(!Ua){var c=Pd(Qf);Ua=!0;for(var a= ka.length;a;){Ha=ka;for(ka=[];++Mb=e)return a;switch(a){case "%s":return String(d[b++]);case "%d":return Number(d[b++]);case "%j":try{return JSON.stringify(d[b++])}catch(h){return"[Circular]"}default:return a}});for(var f=d[b];bb)return Xa(a)?c.stylize(RegExp.prototype.toString.call(a),"regexp"):c.stylize("[Object]","special");c.seen.push(a);e=g?Wf(c,a,b,f,e):e.map(function(d){return Bc(c,a,b,f,d,g)});c.seen.pop();return Xf(e,d,h)}function Vf(c,a){if(la(a))return c.stylize("undefined","undefined");if(Ja(a))return a="'"+JSON.stringify(a).replace(/^"|"$/g, "").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'",c.stylize(a,"string");if(Vd(a))return c.stylize(""+a,"number");if(zc(a))return c.stylize(""+a,"boolean");if(null===a)return c.stylize("null","null")}function Ac(c){return"["+Error.prototype.toString.call(c)+"]"}function Wf(c,a,b,d,e){for(var f=[],g=0,h=a.length;gc.seen.indexOf(a.value)?(h=null===b?Ob(c,a.value,null):Ob(c,a.value,b-1),-1c?"0"+c.toString(10):c.toString(10)}function Yf(){var c=new Date,a=[Dc(c.getHours()),Dc(c.getMinutes()),Dc(c.getSeconds())].join(":");return[c.getDate(),Zf[c.getMonth()],a].join(" ")}function Td(c,a){if(!a||!wa(a))return c;for(var b=Object.keys(a),d=b.length;d--;)c[b[d]]=a[b[d]];return c}function Wd(c,a){if(c===a)return 0;for(var b= c.length,d=a.length,e=0,f=Math.min(b,d);eb?[]:a.slice(c,b-c+1)}c=Hc(c).substr(1);a=Hc(a).substr(1);c=b(c.split("/"));a=b(a.split("/"));for(var d=Math.min(c.length,a.length),e=d,f=0;fb&&(f.warned= !0,b=Error("Possible EventEmitter memory leak detected. "+f.length+" "+a+" listeners added. Use emitter.setMaxListeners() to increase limit"),b.name="MaxListenersExceededWarning",b.emitter=c,b.type=a,b.count=f.length,"function"===typeof console.warn?console.warn(b):console.log(b))):(e[a]=b,++c._eventsCount);return c}function oe(c,a,b){function d(){c.removeListener(a,d);e||(e=!0,b.apply(c,arguments))}var e=!1;d.listener=b;return d}function pe(c){var a=this._events;if(a){c=a[c];if("function"===typeof c)return 1; if(c)return c.length}return 0}function qb(c,a){for(var b=Array(a);a--;)b[a]=c[a];return b}function La(){this.tail=this.head=null;this.length=0}function rb(c){this.encoding=(c||"utf8").toLowerCase().replace(/[-_]/,"");if(c&&!dg(c))throw Error("Unknown encoding: "+c);switch(this.encoding){case "utf8":this.surrogateSize=3;break;case "ucs2":case "utf16le":this.surrogateSize=2;this.detectIncompleteChar=eg;break;case "base64":this.surrogateSize=3;this.detectIncompleteChar=fg;break;default:this.write=gg; return}this.charBuffer=new l(6);this.charLength=this.charReceived=0}function gg(c){return c.toString(this.encoding)}function eg(c){this.charLength=(this.charReceived=c.length%2)?2:0}function fg(c){this.charLength=(this.charReceived=c.length%3)?3:0}function hg(c,a,b){if("function"===typeof c.prependListener)return c.prependListener(a,b);if(c._events&&c._events[a])Array.isArray(c._events[a])?c._events[a].unshift(b):c._events[a]=[b,c._events[a]];else c.on(a,b)}function qe(c,a){c=c||{};this.objectMode= !!c.objectMode;a instanceof U&&(this.objectMode=this.objectMode||!!c.readableObjectMode);a=c.highWaterMark;var b=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:b;this.highWaterMark=~~this.highWaterMark;this.buffer=new La;this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.reading=this.endEmitted=this.ended=!1;this.sync=!0;this.resumeScheduled=this.readableListening=this.emittedReadable=this.needReadable=!1;this.defaultEncoding=c.defaultEncoding||"utf8";this.ranOut=!1;this.awaitDrain= 0;this.readingMore=!1;this.encoding=this.decoder=null;c.encoding&&(this.decoder=new rb(c.encoding),this.encoding=c.encoding)}function y(c){if(!(this instanceof y))return new y(c);this._readableState=new qe(c,this);this.readable=!0;c&&"function"===typeof c.read&&(this._read=c.read);x.call(this)}function re(c,a,b,d,e){var f=b,g=null;pa(f)||"string"===typeof f||null===f||void 0===f||a.objectMode||(g=new TypeError("Invalid non-string/buffer chunk"));if(f=g)c.emit("error",f);else if(null===b)a.reading= !1,a.ended||(a.decoder&&(b=a.decoder.end())&&b.length&&(a.buffer.push(b),a.length+=a.objectMode?1:b.length),a.ended=!0,Qb(c));else if(a.objectMode||b&&0=c||0===a.length&&a.ended)return 0;if(a.objectMode)return 1;if(c!==c)return a.flowing&&a.length?a.buffer.head.data.length:a.length;if(c>a.highWaterMark){var b=c;8388608<=b?b=8388608:(b--,b|=b>>>1,b|=b>>>2,b|=b>>>4,b|=b>>>8,b|=b>>>16,b++);a.highWaterMark=b}return c<=a.length?c: a.ended?a.length:(a.needReadable=!0,0)}function Qb(c){var a=c._readableState;a.needReadable=!1;a.emittedReadable||(z("emitReadable",a.flowing),a.emittedReadable=!0,a.sync?X(te,c):te(c))}function te(c){z("emit readable");c.emit("readable");Ic(c)}function ig(c,a){for(var b=a.length;!a.reading&&!a.flowing&&!a.ended&&a.length=a.length)b= a.decoder?a.buffer.join(""):1===a.buffer.length?a.buffer.head.data:a.buffer.concat(a.length),a.buffer.clear();else{b=a.buffer;a=a.decoder;if(cf.length?f.length:c;e=g===f.length?e+f:e+f.slice(0,c);c-=g;if(0===c){g===f.length?(++d,b.head=a.next?a.next:b.tail=null):(b.head=a,a.data=f.slice(g));break}++d}b.length-= d;b=e}else{a=l.allocUnsafe(c);d=b.head;e=1;d.data.copy(a);for(c-=d.data.length;d=d.next;){f=d.data;g=c>f.length?f.length:c;f.copy(a,a.length-c,0,g);c-=g;if(0===c){g===f.length?(++e,b.head=d.next?d.next:b.tail=null):(b.head=d,d.data=f.slice(g));break}++e}b.length-=e;b=a}a=b}b=a}return b}function Jc(c){var a=c._readableState;if(0c)-((0!=a)<<5)}function vg(c){return tg(c,function(a){if(wg.test(a)){var c,d=[],e=[],f=0;for(c=a.length;f=g&&fq&&d.push(Mc(q))}for((f=c=d.length)&&d.push("-");f=e&&qZa((2147483647-k)/r))throw new RangeError(De.overflow);k+=(A-e)*r;e=A;for(g=0;g=t+26?26:A-t;if(P>1;for(k+=Za(k/t);455a&&(d=a);for(a=0;aCg?"":c.hostname.toLowerCase();g||(c.hostname=vg(c.hostname));d=c.port?":"+c.port:"";c.host=(c.hostname||"")+d;c.href+=c.host;g&&(c.hostname=c.hostname.substr(1,c.hostname.length-2),"/"!==e[0]&&(e="/"+e))}if(!Dg[f])for(d=0,a=Oc.length;d=c.length&&(c=void 0);return{value:c&&c[b++],done:!c}}}}function Tb(c,a){var b="function"===typeof Symbol&&c[Symbol.iterator];if(!b)return c;c=b.call(c);var d,e=[];try{for(;(void 0===a||0c;++c)ea[c]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[c],M["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(c)]=c;M[45]=62;M[95]=63}function Fg(c,a,b){for(var d=[],e=a;e>18&63]+ea[a>>12&63]+ea[a>>6&63]+ea[a&63]);return d.join("")}function Ne(c){Sc||Me();for(var a=c.length,b=a%3,d="",e=[],f=0,g=a-b;fg?g:f+16383));1=== b?(c=c[a-1],d+=ea[c>>2],d+=ea[c<<4&63],d+="=="):2===b&&(c=(c[a-2]<<8)+c[a-1],d+=ea[c>>10],d+=ea[c>>4&63],d+=ea[c<<2&63],d+="=");e.push(d);return e.join("")}function Vb(c,a,b,d,e){var f=8*e-d-1,g=(1<>1,k=-7;e=b?e-1:0;var t=b?-1:1,q=c[a+e];e+=t;b=q&(1<<-k)-1;q>>=-k;for(k+=f;0>=-k;for(k+=d;0>1,q=23===e?Math.pow(2,-24)-Math.pow(2,-77):0;f=d?0:f-1;var A=d?1:-1,r=0>a||0===a&&0>1/a?1:0;a=Math.abs(a);for(isNaN(a)||Infinity===a?(a=isNaN(a)?1:0,d=k):(d=Math.floor(Math.log(a)/Math.LN2),1>a*(g=Math.pow(2,-d))&&(d--,g*=2),a=1<=d+t?a+q/g:a+q*Math.pow(2,1-t),2<=a*g&&(d++,g/=2),d+t>=k?(a=0,d=k):1<=d+t?(a=(a*g-1)*Math.pow(2,e),d+=t):(a=a*Math.pow(2,t-1)*Math.pow(2,e),d=0));8<=e;c[b+f]=a&255,f+=A,a/=256,e-=8);d=d<b||a.byteLengthc)throw new RangeError('"size" argument must not be negative');}function Tc(c,a){Qe(a);c=ma(c,0>a?0:Vc(a)|0);if(!m.TYPED_ARRAY_SUPPORT)for(var b=0;ba.length?0:Vc(a.length)|0;c=ma(c,b);for(var d=0;d=(m.TYPED_ARRAY_SUPPORT?2147483647:1073741823))throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+(m.TYPED_ARRAY_SUPPORT?2147483647:1073741823).toString(16)+" bytes");return c|0}function fa(c){return!(null==c||!c._isBuffer)}function Pe(c,a){if(fa(c))return c.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(c)||c instanceof ArrayBuffer))return c.byteLength;"string"!==typeof c&&(c=""+c);var b=c.length; if(0===b)return 0;for(var d=!1;;)switch(a){case "ascii":case "latin1":case "binary":return b;case "utf8":case "utf-8":case void 0:return Xb(c).length;case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return 2*b;case "hex":return b>>>1;case "base64":return Se(c).length;default:if(d)return Xb(c).length;a=(""+a).toLowerCase();d=!0}}function Hg(c,a,b){var d=!1;if(void 0===a||0>a)a=0;if(a>this.length)return"";if(void 0===b||b>this.length)b=this.length;if(0>=b)return"";b>>>=0;a>>>=0;if(b<=a)return""; for(c||(c="utf8");;)switch(c){case "hex":c=a;a=b;b=this.length;if(!c||0>c)c=0;if(!a||0>a||a>b)a=b;d="";for(b=c;bd?"0"+d.toString(16):d.toString(16),d=c+d;return d;case "utf8":case "utf-8":return Te(this,a,b);case "ascii":c="";for(b=Math.min(this.length,b);ab&&(b=-2147483648);b=+b;isNaN(b)&&(b=e?0:c.length-1);0>b&&(b=c.length+b);if(b>= c.length){if(e)return-1;b=c.length-1}else if(0>b)if(e)b=0;else return-1;"string"===typeof a&&(a=m.from(a,d));if(fa(a))return 0===a.length?-1:Ve(c,a,b,d,e);if("number"===typeof a)return a&=255,m.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?e?Uint8Array.prototype.indexOf.call(c,a,b):Uint8Array.prototype.lastIndexOf.call(c,a,b):Ve(c,[a],b,d,e);throw new TypeError("val must be string, number or Buffer");}function Ve(c,a,b,d,e){function f(a,c){return 1===g?a[c]:a.readUInt16BE(c* g)}var g=1,h=c.length,k=a.length;if(void 0!==d&&(d=String(d).toLowerCase(),"ucs2"===d||"ucs-2"===d||"utf16le"===d||"utf-16le"===d)){if(2>c.length||2>a.length)return-1;g=2;h/=2;k/=2;b/=2}if(e)for(d=-1;bh&&(b=h-k);0<=b;b--){h=!0;for(d=0;de&&(f=e);break;case 2:var h=c[a+1];128===(h&192)&&(e=(e&31)<<6|h&63,127e||57343e&&(f=e))}null===f?(f=65533,g=1):65535>>10&1023|55296),f=56320|f&1023); d.push(f);a+=g}c=d.length;if(c<=We)d=String.fromCharCode.apply(String,d);else{b="";for(a=0;ac)throw new RangeError("offset is not uint");if(c+a>b)throw new RangeError("Trying to access beyond buffer length");}function V(c,a,b,d,e,f){if(!fa(c))throw new TypeError('"buffer" argument must be a Buffer instance');if(a>e||ac.length)throw new RangeError("Index out of range"); }function Yb(c,a,b,d){0>a&&(a=65535+a+1);for(var e=0,f=Math.min(c.length-b,2);e>>8*(d?e:1-e)}function Zb(c,a,b,d){0>a&&(a=4294967295+a+1);for(var e=0,f=Math.min(c.length-b,4);e>>8*(d?e:3-e)&255}function $b(c,a,b,d){if(b+d>c.length)throw new RangeError("Index out of range");if(0>b)throw new RangeError("Index out of range");}function Xb(c,a){a=a||Infinity;for(var b,d=c.length,e=null,f=[],g=0;gb){if(!e){if(56319< b){-1<(a-=3)&&f.push(239,191,189);continue}else if(g+1===d){-1<(a-=3)&&f.push(239,191,189);continue}e=b;continue}if(56320>b){-1<(a-=3)&&f.push(239,191,189);e=b;continue}b=(e-55296<<10|b-56320)+65536}else e&&-1<(a-=3)&&f.push(239,191,189);e=null;if(128>b){if(0>--a)break;f.push(b)}else if(2048>b){if(0>(a-=2))break;f.push(b>>6|192,b&63|128)}else if(65536>b){if(0>(a-=3))break;f.push(b>>12|224,b>>6&63|128,b&63|128)}else if(1114112>b){if(0>(a-=4))break;f.push(b>>18|240,b>>12&63|128,b>>6&63|128,b&63|128)}else throw Error("Invalid code point"); }return f}function Xe(c){for(var a=[],b=0;bc.length)c="";else for(;0!==c.length%4;)c+="=";Sc||Me();var a=c.length;if(0>16&255;d[f++]=g>>8&255;d[f++]=g&255}2===b?(g=M[c.charCodeAt(a)]<<2|M[c.charCodeAt(a+1)]>>4,d[f++]=g&255):1===b&&(g=M[c.charCodeAt(a)]<<10|M[c.charCodeAt(a+1)]<<4|M[c.charCodeAt(a+2)]>>2,d[f++]=g>>8&255,d[f++]=g&255);return d}function ub(c,a,b,d){for(var e=0;e=a.length||e>=c.length);++e)a[e+b]=c[e];return e}function Ye(c){return null!=c&&(!!c._isBuffer||Ze(c)||"function"===typeof c.readFloatLE&&"function"===typeof c.slice&&Ze(c.slice(0,0)))}function Ze(c){return!!c.constructor&& "function"===typeof c.constructor.isBuffer&&c.constructor.isBuffer(c)}function Wc(c,a){return a={exports:{}},c(a,a.exports),a.exports}function $e(){throw Error("setTimeout has not been defined");}function af(){throw Error("clearTimeout has not been defined");}function bf(c){if(ra===setTimeout)return setTimeout(c,0);if((ra===$e||!ra)&&setTimeout)return ra=setTimeout,setTimeout(c,0);try{return ra(c,0)}catch(a){try{return ra.call(null,c,0)}catch(b){return ra.call(this,c,0)}}}function Kg(c){if(ya===clearTimeout)return clearTimeout(c); if((ya===af||!ya)&&clearTimeout)return ya=clearTimeout,clearTimeout(c);try{return ya(c)}catch(a){try{return ya.call(null,c)}catch(b){return ya.call(this,c)}}}function Lg(){ab&&Na&&(ab=!1,Na.length?sa=Na.concat(sa):ac=-1,sa.length&&cf())}function cf(){if(!ab){var c=bf(Lg);ab=!0;for(var a=sa.length;a;){Na=sa;for(sa=[];++acb.length||2!==d||46!==b.charCodeAt(b.length-1)||46!==b.charCodeAt(b.length-2))if(2c&&c[vd],serialize(c){const {port1:a,port2:b}=new MessageChannel;mc(c,a);return[b,[b]]},deserialize:c=>{c.start();return pc(c,[],void 0)}}],["throw",{canHandle:c=>nc.has(c),serialize(c){const a=c instanceof Error;let b=c;a&&(b={isError:a,message:c.message, stack:c.stack});return[b,[]]},deserialize(c){if(c.isError)throw Object.assign(Error(),c);throw c;}}]]),xd=new WeakMap;var qc=function(c,a){qc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var b in c)c.hasOwnProperty(b)&&(a[b]=c[b])};return qc(c,a)},db=function(){db=Object.assign||function(c){for(var a,b=1,d=arguments.length;b=c?ja(null,c):void 0!==a?"string"===typeof b?ja(null,c).fill(a,b):ja(null,c).fill(a):ja(null,c)};l.allocUnsafe=function(c){return tc(null,c)};l.allocUnsafeSlow=function(c){return tc(null,c)};l.isBuffer=pa;l.compare=function(c,a){if(!W(c)||!W(a))throw new TypeError("Arguments must be Buffers");if(c===a)return 0;for(var b=c.length,d=a.length,e=0,f=Math.min(b,d);e"};l.prototype.compare=function(c,a,b,d,e){if(!W(c))throw new TypeError("Argument must be a Buffer");void 0===a&&(a=0);void 0=== b&&(b=c?c.length:0);void 0===d&&(d=0);void 0===e&&(e=this.length);if(0>a||b>c.length||0>d||e>this.length)throw new RangeError("out of range index");if(d>=e&&a>=b)return 0;if(d>=e)return-1;if(a>=b)return 1;a>>>=0;b>>>=0;d>>>=0;e>>>=0;if(this===c)return 0;var f=e-d,g=b-a,h=Math.min(f,g);d=this.slice(d,e);c=c.slice(a,b);for(a=0;ae)b=e;if(0b||0>a)||a>this.length)throw new RangeError("Attempt to write outside buffer bounds"); d||(d="utf8");for(e=!1;;)switch(d){case "hex":a:{a=Number(a)||0;d=this.length-a;b?(b=Number(b),b>d&&(b=d)):b=d;d=c.length;if(0!==d%2)throw new TypeError("Invalid hex string");b>d/2&&(b=d/2);for(d=0;d(e-=2));++g){var h=d.charCodeAt(g);c=h>>8;h%=256;f.push(h);f.push(c)}return nb(f,this,a,b);default:if(e)throw new TypeError("Unknown encoding: "+d);d=(""+d).toLowerCase();e=!0}};l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Kd=4096;l.prototype.slice=function(c,a){var b=this.length;c=~~c;a=void 0===a?b:~~a;0>c?(c+=b,0>c&&(c=0)):c>b&&(c=b);0>a?(a+=b,0>a&&(a=0)):a>b&&(a=b);a=128*d&&(b-=Math.pow(2,8*a));return b};l.prototype.readIntBE=function(c,a,b){c|=0;a|=0;b||D(c,a,this.length);b=a;for(var d=1,e=this[c+--b];0=128*d&&(e-=Math.pow(2,8*a));return e};l.prototype.readInt8=function(c,a){a||D(c,1,this.length);return this[c]&128?-1*(255-this[c]+1):this[c]};l.prototype.readInt16LE=function(c,a){a||D(c,2,this.length);c=this[c]|this[c+1]<<8;return c&32768?c|4294901760:c};l.prototype.readInt16BE=function(c,a){a||D(c,2,this.length); c=this[c+1]|this[c]<<8;return c&32768?c|4294901760:c};l.prototype.readInt32LE=function(c,a){a||D(c,4,this.length);return this[c]|this[c+1]<<8|this[c+2]<<16|this[c+3]<<24};l.prototype.readInt32BE=function(c,a){a||D(c,4,this.length);return this[c]<<24|this[c+1]<<16|this[c+2]<<8|this[c+3]};l.prototype.readFloatLE=function(c,a){a||D(c,4,this.length);return Gb(this,c,!0,23,4)};l.prototype.readFloatBE=function(c,a){a||D(c,4,this.length);return Gb(this,c,!1,23,4)};l.prototype.readDoubleLE=function(c,a){a|| D(c,8,this.length);return Gb(this,c,!0,52,8)};l.prototype.readDoubleBE=function(c,a){a||D(c,8,this.length);return Gb(this,c,!1,52,8)};l.prototype.writeUIntLE=function(c,a,b,d){c=+c;a|=0;b|=0;d||T(this,c,a,b,Math.pow(2,8*b)-1,0);d=1;var e=0;for(this[a]=c&255;++e>>8):Jb(this,c,a,!0);return a+2};l.prototype.writeUInt16BE=function(c,a,b){c=+c;a|=0;b||T(this,c,a,2,65535,0);l.TYPED_ARRAY_SUPPORT?(this[a]=c>>>8,this[a+1]=c&255):Jb(this,c,a,!1);return a+2};l.prototype.writeUInt32LE=function(c,a,b){c=+c;a|=0;b||T(this,c,a,4, 4294967295,0);l.TYPED_ARRAY_SUPPORT?(this[a+3]=c>>>24,this[a+2]=c>>>16,this[a+1]=c>>>8,this[a]=c&255):Kb(this,c,a,!0);return a+4};l.prototype.writeUInt32BE=function(c,a,b){c=+c;a|=0;b||T(this,c,a,4,4294967295,0);l.TYPED_ARRAY_SUPPORT?(this[a]=c>>>24,this[a+1]=c>>>16,this[a+2]=c>>>8,this[a+3]=c&255):Kb(this,c,a,!1);return a+4};l.prototype.writeIntLE=function(c,a,b,d){c=+c;a|=0;d||(d=Math.pow(2,8*b-1),T(this,c,a,b,d-1,-d));d=0;var e=1,f=0;for(this[a]=c&255;++dc&&0===f&&0!==this[a+d- 1]&&(f=1),this[a+d]=(c/e>>0)-f&255;return a+b};l.prototype.writeIntBE=function(c,a,b,d){c=+c;a|=0;d||(d=Math.pow(2,8*b-1),T(this,c,a,b,d-1,-d));d=b-1;var e=1,f=0;for(this[a+d]=c&255;0<=--d&&(e*=256);)0>c&&0===f&&0!==this[a+d+1]&&(f=1),this[a+d]=(c/e>>0)-f&255;return a+b};l.prototype.writeInt8=function(c,a,b){c=+c;a|=0;b||T(this,c,a,1,127,-128);l.TYPED_ARRAY_SUPPORT||(c=Math.floor(c));0>c&&(c=255+c+1);this[a]=c&255;return a+1};l.prototype.writeInt16LE=function(c,a,b){c=+c;a|=0;b||T(this,c,a,2,32767, -32768);l.TYPED_ARRAY_SUPPORT?(this[a]=c&255,this[a+1]=c>>>8):Jb(this,c,a,!0);return a+2};l.prototype.writeInt16BE=function(c,a,b){c=+c;a|=0;b||T(this,c,a,2,32767,-32768);l.TYPED_ARRAY_SUPPORT?(this[a]=c>>>8,this[a+1]=c&255):Jb(this,c,a,!1);return a+2};l.prototype.writeInt32LE=function(c,a,b){c=+c;a|=0;b||T(this,c,a,4,2147483647,-2147483648);l.TYPED_ARRAY_SUPPORT?(this[a]=c&255,this[a+1]=c>>>8,this[a+2]=c>>>16,this[a+3]=c>>>24):Kb(this,c,a,!0);return a+4};l.prototype.writeInt32BE=function(c,a,b){c= +c;a|=0;b||T(this,c,a,4,2147483647,-2147483648);0>c&&(c=4294967295+c+1);l.TYPED_ARRAY_SUPPORT?(this[a]=c>>>24,this[a+1]=c>>>16,this[a+2]=c>>>8,this[a+3]=c&255):Kb(this,c,a,!1);return a+4};l.prototype.writeFloatLE=function(c,a,b){b||Lb(this,c,a,4);Hb(this,c,a,!0,23,4);return a+4};l.prototype.writeFloatBE=function(c,a,b){b||Lb(this,c,a,4);Hb(this,c,a,!1,23,4);return a+4};l.prototype.writeDoubleLE=function(c,a,b){b||Lb(this,c,a,8);Hb(this,c,a,!0,52,8);return a+8};l.prototype.writeDoubleBE=function(c, a,b){b||Lb(this,c,a,8);Hb(this,c,a,!1,52,8);return a+8};l.prototype.copy=function(c,a,b,d){b||(b=0);d||0===d||(d=this.length);a>=c.length&&(a=c.length);a||(a=0);0a)throw new RangeError("targetStart out of bounds");if(0>b||b>=this.length)throw new RangeError("sourceStart out of bounds");if(0>d)throw new RangeError("sourceEnd out of bounds");d>this.length&&(d=this.length);c.length-ae||!l.TYPED_ARRAY_SUPPORT)for(d=0;de&&(c=e)}if(void 0!==d&&"string"!==typeof d)throw new TypeError("encoding must be a string");if("string"===typeof d&&!l.isEncoding(d))throw new TypeError("Unknown encoding: "+ d);}else"number"===typeof c&&(c&=255);if(0>a||this.length>>=0;b=void 0===b?this.length:b>>>0;c||(c=0);if("number"===typeof c)for(d=a;da&&(b--,a+=1E9));return[b,a]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-Ug)/1E3}},za="function"===typeof Object.create?function(c,a){c.super_=a;c.prototype=Object.create(a.prototype, {constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}})}:function(c,a){function b(){}c.super_=a;b.prototype=a.prototype;c.prototype=new b;c.prototype.constructor=c},Rf=/%[sdj%]/g,Nb={},yc;aa.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};aa.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta", regexp:"red"};var Zf="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),wb={inherits:za,_extend:Td,log:function(){console.log("%s - %s",Yf(),wc.apply(null,arguments))},isBuffer:function(c){return pa(c)},isPrimitive:Cc,isFunction:Wa,isError:ob,isDate:pb,isObject:wa,isRegExp:Xa,isUndefined:la,isSymbol:function(c){return"symbol"===typeof c},isString:Ja,isNumber:Vd,isNullOrUndefined:function(c){return null==c},isNull:function(c){return null===c},isBoolean:zc,isArray:Ud,inspect:aa,deprecate:xc, format:wc,debuglog:Sd},Vg=Object.prototype.hasOwnProperty,ge=Object.keys||function(c){var a=[],b;for(b in c)Vg.call(c,b)&&a.push(b);return a},fe=Array.prototype.slice,Ec,$f=/\s*function\s+([^\(\s]*)\s*/;E.AssertionError=Gc;za(Gc,Error);E.fail=S;E.ok=Fc;E.equal=be;E.notEqual=ce;E.deepEqual=de;E.deepStrictEqual=ee;E.notDeepEqual=he;E.notDeepStrictEqual=ie;E.strictEqual=je;E.notStrictEqual=ke;E.throws=function(c,a,b){me(!0,c,a,b)};E.doesNotThrow=function(c,a,b){me(!1,c,a,b)};E.ifError=function(c){if(c)throw c; };var xb=K(function(c,a){function b(a){return function(a){function c(c){for(var b=[],e=1;e 0 and < 65536");e("ERR_SOCKET_BAD_TYPE","Bad socket type specified. Valid types are: udp4, udp6"); e("ERR_SOCKET_CANNOT_SEND","Unable to send data");e("ERR_SOCKET_CLOSED","Socket is closed");e("ERR_SOCKET_DGRAM_NOT_RUNNING","Not running");e("ERR_STDERR_CLOSE","process.stderr cannot be closed");e("ERR_STDOUT_CLOSE","process.stdout cannot be closed");e("ERR_STREAM_WRAP","Stream has StringDecoder set or is in objectMode");e("ERR_TLS_CERT_ALTNAME_INVALID","Hostname/IP does not match certificate's altnames: %s");e("ERR_TLS_DH_PARAM_SIZE",function(a){return"DH parameter size "+a+" is less than 2048"}); e("ERR_TLS_HANDSHAKE_TIMEOUT","TLS handshake timeout");e("ERR_TLS_RENEGOTIATION_FAILED","Failed to renegotiate");e("ERR_TLS_REQUIRED_SERVER_NAME",'"servername" is required parameter for Server.addContext');e("ERR_TLS_SESSION_ATTACK","TSL session renegotiation attack detected");e("ERR_TRANSFORM_ALREADY_TRANSFORMING","Calling transform done when still transforming");e("ERR_TRANSFORM_WITH_LENGTH_0","Calling transform done when writableState.length != 0");e("ERR_UNKNOWN_ENCODING","Unknown encoding: %s"); e("ERR_UNKNOWN_SIGNAL","Unknown signal: %s");e("ERR_UNKNOWN_STDIN_TYPE","Unknown stdin file type");e("ERR_UNKNOWN_STREAM_TYPE","Unknown stream file type");e("ERR_V8BREAKITERATOR","Full ICU data not installed. See https://github.com/nodejs/node/wiki/Intl")});Q(xb);var oa=K(function(c,a){Object.defineProperty(a,"__esModule",{value:!0});a.ENCODING_UTF8="utf8";a.assertEncoding=function(a){if(a&&!J.Buffer.isEncoding(a))throw new xb.TypeError("ERR_INVALID_OPT_VALUE_ENCODING",a);};a.strToEncoding=function(c, d){return d&&d!==a.ENCODING_UTF8?"buffer"===d?new J.Buffer(c):(new J.Buffer(c)).toString(d):c}});Q(oa);var $c=K(function(c,a){Object.defineProperty(a,"__esModule",{value:!0});var b=u.constants.S_IFMT,d=u.constants.S_IFDIR,e=u.constants.S_IFREG,f=u.constants.S_IFBLK,g=u.constants.S_IFCHR,h=u.constants.S_IFLNK,k=u.constants.S_IFIFO,t=u.constants.S_IFSOCK;c=function(){function a(){this.name="";this.mode=0}a.build=function(c,b){var d=new a,e=c.getNode().mode;d.name=oa.strToEncoding(c.getName(),b);d.mode= e;return d};a.prototype._checkModeProperty=function(a){return(this.mode&b)===a};a.prototype.isDirectory=function(){return this._checkModeProperty(d)};a.prototype.isFile=function(){return this._checkModeProperty(e)};a.prototype.isBlockDevice=function(){return this._checkModeProperty(f)};a.prototype.isCharacterDevice=function(){return this._checkModeProperty(g)};a.prototype.isSymbolicLink=function(){return this._checkModeProperty(h)};a.prototype.isFIFO=function(){return this._checkModeProperty(k)}; a.prototype.isSocket=function(){return this._checkModeProperty(t)};return a}();a.Dirent=c;a.default=c});Q($c);"ab".substr(-1);var gb=K(function(c,a){Object.defineProperty(a,"__esModule",{value:!0});c="function"===typeof setImmediate?setImmediate.bind(N):setTimeout.bind(N);a.default=c});Q(gb);var Y=K(function(c,a){function b(){var a=Va||{};a.getuid||(a.getuid=function(){return 0});a.getgid||(a.getgid=function(){return 0});a.cwd||(a.cwd=function(){return"/"});a.nextTick||(a.nextTick=gb.default);a.emitWarning|| (a.emitWarning=function(a,c){console.warn(""+c+(c?": ":"")+a)});a.env||(a.env={});return a}Object.defineProperty(a,"__esModule",{value:!0});a.createProcess=b;a.default=b()});Q(Y);qa.prototype=Object.create(null);x.EventEmitter=x;x.usingDomains=!1;x.prototype.domain=void 0;x.prototype._events=void 0;x.prototype._maxListeners=void 0;x.defaultMaxListeners=10;x.init=function(){this.domain=null;this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new qa,this._eventsCount=0); this._maxListeners=this._maxListeners||void 0};x.prototype.setMaxListeners=function(c){if("number"!==typeof c||0>c||isNaN(c))throw new TypeError('"n" argument must be a positive number');this._maxListeners=c;return this};x.prototype.getMaxListeners=function(){return void 0===this._maxListeners?x.defaultMaxListeners:this._maxListeners};x.prototype.emit=function(c){var a,b,d="error"===c;if(a=this._events)d=d&&null==a.error;else if(!d)return!1;var e=this.domain;if(d){a=arguments[1];if(e)a||(a=Error('Uncaught, unspecified "error" event')), a.domainEmitter=this,a.domain=e,a.domainThrown=!1,e.emit("error",a);else{if(a instanceof Error)throw a;e=Error('Uncaught, unspecified "error" event. ('+a+")");e.context=a;throw e;}return!1}e=a[c];if(!e)return!1;a="function"===typeof e;var f=arguments.length;switch(f){case 1:if(a)e.call(this);else for(a=e.length,e=qb(e,a),d=0;df)return this;if(1===e.length){e[0]=void 0;if(0===--this._eventsCount)return this._events=new qa,this;delete d[c]}else{b=f+1;for(var h= e.length;bthis.buf.length){var e=J.bufferAllocUnsafe(d+b);this.buf.copy(e,0,0,this.buf.length); this.buf=e}a.copy(this.buf,d,c,c+b);this.touch();return b};c.prototype.read=function(a,c,b,d){void 0===c&&(c=0);void 0===b&&(b=a.byteLength);void 0===d&&(d=0);this.buf||(this.buf=J.bufferAllocUnsafe(0));b>a.byteLength&&(b=a.byteLength);b+d>this.buf.length&&(b=this.buf.length-d);this.buf.copy(a,c,d,d+b);return b};c.prototype.truncate=function(a){void 0===a&&(a=0);if(a)if(this.buf||(this.buf=J.bufferAllocUnsafe(0)),a<=this.buf.length)this.buf=this.buf.slice(0,a);else{var c=J.bufferAllocUnsafe(0);this.buf.copy(c); c.fill(0,a)}else this.buf=J.bufferAllocUnsafe(0);this.touch()};c.prototype.chmod=function(a){this.perm=a;this.mode=this.mode&-512|a;this.touch()};c.prototype.chown=function(a,c){this.uid=a;this.gid=c;this.touch()};c.prototype.touch=function(){this.mtime=new Date;this.emit("change",this)};c.prototype.canRead=function(a,c){void 0===a&&(a=Y.default.getuid());void 0===c&&(c=Y.default.getgid());return this.perm&4||c===this.gid&&this.perm&32||a===this.uid&&this.perm&256?!0:!1};c.prototype.canWrite=function(a, c){void 0===a&&(a=Y.default.getuid());void 0===c&&(c=Y.default.getgid());return this.perm&2||c===this.gid&&this.perm&16||a===this.uid&&this.perm&128?!0:!1};c.prototype.del=function(){this.emit("delete",this)};c.prototype.toJSON=function(){return{ino:this.ino,uid:this.uid,gid:this.gid,atime:this.atime.getTime(),mtime:this.mtime.getTime(),ctime:this.ctime.getTime(),perm:this.perm,mode:this.mode,nlink:this.nlink,symlink:this.symlink,data:this.getString()}};return c}(x.EventEmitter);a.Node=c;c=function(c){function d(a, b,d){var e=c.call(this)||this;e.children={};e.steps=[];e.ino=0;e.length=0;e.vol=a;e.parent=b;e.steps=b?b.steps.concat([d]):[d];return e}b(d,c);d.prototype.setNode=function(a){this.node=a;this.ino=a.ino};d.prototype.getNode=function(){return this.node};d.prototype.createChild=function(a,c){void 0===c&&(c=this.vol.createNode());var b=new d(this.vol,this,a);b.setNode(c);c.isDirectory();this.setChild(a,b);return b};d.prototype.setChild=function(a,c){void 0===c&&(c=new d(this.vol,this,a));this.children[a]= c;c.parent=this;this.length++;this.emit("child:add",c,this);return c};d.prototype.deleteChild=function(a){delete this.children[a.getName()];this.length--;this.emit("child:delete",a,this)};d.prototype.getChild=function(a){if(Object.hasOwnProperty.call(this.children,a))return this.children[a]};d.prototype.getPath=function(){return this.steps.join(a.SEP)};d.prototype.getName=function(){return this.steps[this.steps.length-1]};d.prototype.walk=function(a,c,b){void 0===c&&(c=a.length);void 0===b&&(b=0); if(b>=a.length||b>=c)return this;var d=this.getChild(a[b]);return d?d.walk(a,c,b+1):null};d.prototype.toJSON=function(){return{steps:this.steps,ino:this.ino,children:Object.keys(this.children)}};return d}(x.EventEmitter);a.Link=c;c=function(){function a(a,c,b,d){this.position=0;this.link=a;this.node=c;this.flags=b;this.fd=d}a.prototype.getString=function(){return this.node.getString()};a.prototype.setString=function(a){this.node.setString(a)};a.prototype.getBuffer=function(){return this.node.getBuffer()}; a.prototype.setBuffer=function(a){this.node.setBuffer(a)};a.prototype.getSize=function(){return this.node.getSize()};a.prototype.truncate=function(a){this.node.truncate(a)};a.prototype.seekTo=function(a){this.position=a};a.prototype.stats=function(){return eb.default.build(this.node)};a.prototype.write=function(a,c,b,d){void 0===c&&(c=0);void 0===b&&(b=a.length);"number"!==typeof d&&(d=this.position);this.flags&h&&(d=this.getSize());a=this.node.write(a,c,b,d);this.position=d+a;return a};a.prototype.read= function(a,c,b,d){void 0===c&&(c=0);void 0===b&&(b=a.byteLength);"number"!==typeof d&&(d=this.position);a=this.node.read(a,c,b,d);this.position=d+a;return a};a.prototype.chmod=function(a){this.node.chmod(a)};a.prototype.chown=function(a,c){this.node.chown(a,c)};return a}();a.File=c});Q(yb);var Wg=yb.Node,mf=K(function(c,a){Object.defineProperty(a,"__esModule",{value:!0});a.default=function(a,c,e){var b=setTimeout.apply(null,arguments);b&&"object"===typeof b&&"function"===typeof b.unref&&b.unref(); return b}});Q(mf);La.prototype.push=function(c){c={data:c,next:null};0>>0);for(var a=this.head,b=0;a;)a.data.copy(c,b),b+=a.data.length,a=a.next;return c};var dg=l.isEncoding||function(c){switch(c&&c.toLowerCase()){case "hex":case "utf8":case "utf-8":case "ascii":case "binary":case "base64":case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":case "raw":return!0; default:return!1}};rb.prototype.write=function(c){for(var a="";this.charLength;){a=c.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:c.length;c.copy(this.charBuffer,this.charReceived,0,a);this.charReceived+=a;if(this.charReceived=b)this.charLength+=this.surrogateSize,a="";else{this.charReceived=this.charLength= 0;if(0===c.length)return a;break}}this.detectIncompleteChar(c);var d=c.length;this.charLength&&(c.copy(this.charBuffer,0,c.length-this.charReceived,d),d-=this.charReceived);a+=c.toString(this.encoding,0,d);d=a.length-1;b=a.charCodeAt(d);return 55296<=b&&56319>=b?(b=this.surrogateSize,this.charLength+=b,this.charReceived+=b,this.charBuffer.copy(this.charBuffer,b,0,b),c.copy(this.charBuffer,0,0,b),a.substring(0,d)):a};rb.prototype.detectIncompleteChar=function(c){for(var a=3<=c.length?3:c.length;0< a;a--){var b=c[c.length-a];if(1==a&&6==b>>5){this.charLength=2;break}if(2>=a&&14==b>>4){this.charLength=3;break}if(3>=a&&30==b>>3){this.charLength=4;break}}this.charReceived=a};rb.prototype.end=function(c){var a="";c&&c.length&&(a=this.write(c));this.charReceived&&(c=this.encoding,a+=this.charBuffer.slice(0,this.charReceived).toString(c));return a};y.ReadableState=qe;var z=Sd("stream");za(y,x);y.prototype.push=function(c,a){var b=this._readableState;b.objectMode||"string"!==typeof c||(a=a||b.defaultEncoding, a!==b.encoding&&(c=l.from(c,a),a=""));return re(this,b,c,a,!1)};y.prototype.unshift=function(c){return re(this,this._readableState,c,"",!0)};y.prototype.isPaused=function(){return!1===this._readableState.flowing};y.prototype.setEncoding=function(c){this._readableState.decoder=new rb(c);this._readableState.encoding=c;return this};y.prototype.read=function(c){z("read",c);c=parseInt(c,10);var a=this._readableState,b=c;0!==c&&(a.emittedReadable=!1);if(0===c&&a.needReadable&&(a.length>=a.highWaterMark|| a.ended))return z("read: emitReadable",a.length,a.ended),0===a.length&&a.ended?Jc(this):Qb(this),null;c=se(c,a);if(0===c&&a.ended)return 0===a.length&&Jc(this),null;var d=a.needReadable;z("need readable",d);if(0===a.length||a.length-carguments.length?a:d.apply(null,[a].concat(Xg.call(arguments,2)))},of=K(function(a,b){function d(a,b,d){void 0===d&&(d=function(a){return a});return function(){for(var f=[],h=0;h= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Za=Math.floor,Mc=String.fromCharCode,Fe=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)},yg=Object.keys||function(a){var b=[],d;for(d in a)Object.prototype.hasOwnProperty.call(a, d)&&b.push(d);return b},Zg={parse:Rb,resolve:function(a,b){return Rb(a,!1,!0).resolve(b)},resolveObject:function(a,b){return a?Rb(a,!1,!0).resolveObject(b):b},format:function(a){Ja(a)&&(a=He({},a));return Pc(a)},Url:da},Ag=/^([a-z0-9.+-]+:)/i,Eg=/:[0-9]*$/,zg=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,$g="{}|\\^`".split("").concat('<>"` \r\n\t'.split("")),Oc=["'"].concat($g),Je=["%","/","?",";","#"].concat(Oc),Ie=["/","?","#"],Cg=255,Le=/^[+a-z0-9A-Z_-]{0,63}$/,Bg=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Dg={javascript:!0, "javascript:":!0},Nc={javascript:!0,"javascript:":!0},$a={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};da.prototype.parse=function(a,b,d){return He(this,a,b,d)};da.prototype.format=function(){return Pc(this)};da.prototype.resolve=function(a){return this.resolveObject(Rb(a,!1,!0)).format()};da.prototype.resolveObject=function(a){if(Ja(a)){var b=new da;b.parse(a,!1,!0);a=b}b=new da;for(var d=Object.keys(this),e=0;eg.length&&g.unshift("");b.pathname=g.join("/")}b.search=a.search;b.query=a.query;b.host=a.host||"";b.auth=a.auth;b.hostname=a.hostname||a.host;b.port=a.port;if(b.pathname||b.search)b.path=(b.pathname||"")+(b.search||"");b.slashes=b.slashes||a.slashes;b.href=b.format();return b}d=b.pathname&&"/"===b.pathname.charAt(0);var h=a.host||a.pathname&&"/"===a.pathname.charAt(0),k=d=h|| d||b.host&&a.pathname;e=b.pathname&&b.pathname.split("/")||[];f=b.protocol&&!$a[b.protocol];g=a.pathname&&a.pathname.split("/")||[];f&&(b.hostname="",b.port=null,b.host&&(""===e[0]?e[0]=b.host:e.unshift(b.host)),b.host="",a.protocol&&(a.hostname=null,a.port=null,a.host&&(""===g[0]?g[0]=a.host:g.unshift(a.host)),a.host=null),d=d&&(""===g[0]||""===e[0]));if(h)b.host=a.host||""===a.host?a.host:b.host,b.hostname=a.hostname||""===a.hostname?a.hostname:b.hostname,b.search=a.search,b.query=a.query,e=g;else if(g.length)e|| (e=[]),e.pop(),e=e.concat(g),b.search=a.search,b.query=a.query;else if(null!=a.search){f&&(b.hostname=b.host=e.shift(),f=b.host&&0e)e=b;else{for(;d(b,e);)e--;e=b.substr(0,e+1)}return e.replace(/^([a-zA-Z]+:|\.\/)/,"")}return a}Object.defineProperty(b,"__esModule",{value:!0});b.unixify=e;b.correctPath=function(a){return e(a.replace(/^\\\\\?\\.:\\/,"\\"))};var f="win32"===Va.platform});Q(pf);var Qa=K(function(a,b){function d(a,b){void 0===b&&(b=Y.default.cwd());return ah(b,a)}function e(a,b){return"function"===typeof a?[f(),a]:[f(a),r(b)]}function f(a){void 0===a&&(a= {});return xa({},ua,a)}function g(a){return"number"===typeof a?xa({},ka,{mode:a}):xa({},ka,a)}function h(a,b,d,e){void 0===b&&(b="");void 0===d&&(d="");void 0===e&&(e="");var v="";d&&(v=" '"+d+"'");e&&(v+=" -> '"+e+"'");switch(a){case "ENOENT":return"ENOENT: no such file or directory, "+b+v;case "EBADF":return"EBADF: bad file descriptor, "+b+v;case "EINVAL":return"EINVAL: invalid argument, "+b+v;case "EPERM":return"EPERM: operation not permitted, "+b+v;case "EPROTO":return"EPROTO: protocol error, "+ b+v;case "EEXIST":return"EEXIST: file already exists, "+b+v;case "ENOTDIR":return"ENOTDIR: not a directory, "+b+v;case "EISDIR":return"EISDIR: illegal operation on a directory, "+b+v;case "EACCES":return"EACCES: permission denied, "+b+v;case "ENOTEMPTY":return"ENOTEMPTY: directory not empty, "+b+v;case "EMFILE":return"EMFILE: too many open files, "+b+v;case "ENOSYS":return"ENOSYS: function not implemented, "+b+v;default:return a+": error occurred, "+b+v}}function k(a,b,d,e,f){void 0===b&&(b="");void 0=== d&&(d="");void 0===e&&(e="");void 0===f&&(f=Error);b=new f(h(a,b,d,e));b.code=a;return b}function l(a){if("number"===typeof a)return a;if("string"===typeof a){var b=R[a];if("undefined"!==typeof b)return b}throw new xb.TypeError("ERR_INVALID_OPT_VALUE","flags",a);}function q(a,b){if(b){var d=typeof b;switch(d){case "string":a=xa({},a,{encoding:b});break;case "object":a=xa({},a,b);break;default:throw TypeError("Expected options to be either an object or a string, but got "+d+" instead");}}else return a; "buffer"!==a.encoding&&oa.assertEncoding(a.encoding);return a}function m(a){return function(b){return q(a,b)}}function r(a){if("function"!==typeof a)throw TypeError(M.CB);return a}function P(a){return function(b,d){return"function"===typeof b?[a(),b]:[a(b),r(d)]}}function p(a){if("string"!==typeof a&&!J.Buffer.isBuffer(a)){try{if(!(a instanceof Zg.URL))throw new TypeError(M.PATH_STR);}catch(cd){throw new TypeError(M.PATH_STR);}if(""!==a.hostname)throw new xb.TypeError("ERR_INVALID_FILE_URL_HOST", Y.default.platform);a=a.pathname;for(var b=0;b>>0!==a)throw TypeError(M.FD);}function D(a){if("string"===typeof a&&+a==a)return+a; if(a instanceof Date)return a.getTime()/1E3;if(isFinite(a))return 0>a?Date.now()/1E3:a;throw Error("Cannot parse time: "+a);}function w(a){if("number"!==typeof a)throw TypeError(M.UID);}function F(a){if("number"!==typeof a)throw TypeError(M.GID);}function bc(a){a.emit("stop")}function ta(a,b,d){if(!(this instanceof ta))return new ta(a,b,d);this._vol=a;d=xa({},q(d,{}));void 0===d.highWaterMark&&(d.highWaterMark=65536);ca.Readable.call(this,d);this.path=p(b);this.fd=void 0===d.fd?null:d.fd;this.flags= void 0===d.flags?"r":d.flags;this.mode=void 0===d.mode?438:d.mode;this.start=d.start;this.end=d.end;this.autoClose=void 0===d.autoClose?!0:d.autoClose;this.pos=void 0;this.bytesRead=0;if(void 0!==this.start){if("number"!==typeof this.start)throw new TypeError('"start" option must be a Number');if(void 0===this.end)this.end=Infinity;else if("number"!==typeof this.end)throw new TypeError('"end" option must be a Number');if(this.start>this.end)throw Error('"start" option must be <= "end" option');this.pos= this.start}"number"!==typeof this.fd&&this.open();this.on("end",function(){this.autoClose&&this.destroy&&this.destroy()})}function bh(){this.close()}function Z(a,b,d){if(!(this instanceof Z))return new Z(a,b,d);this._vol=a;d=xa({},q(d,{}));ca.Writable.call(this,d);this.path=p(b);this.fd=void 0===d.fd?null:d.fd;this.flags=void 0===d.flags?"w":d.flags;this.mode=void 0===d.mode?438:d.mode;this.start=d.start;this.autoClose=void 0===d.autoClose?!0:!!d.autoClose;this.pos=void 0;this.bytesWritten=0;if(void 0!== this.start){if("number"!==typeof this.start)throw new TypeError('"start" option must be a Number');if(0>this.start)throw Error('"start" must be >= zero');this.pos=this.start}d.encoding&&this.setDefaultEncoding(d.encoding);"number"!==typeof this.fd&&this.open();this.once("finish",function(){this.autoClose&&this.close()})}var hb=N&&N.__extends||function(){function a(b,d){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var d in b)b.hasOwnProperty(d)&& (a[d]=b[d])};return a(b,d)}return function(b,d){function e(){this.constructor=b}a(b,d);b.prototype=null===d?Object.create(d):(e.prototype=d.prototype,new e)}}(),fd=N&&N.__spreadArrays||function(){for(var a=0,b=0,d=arguments.length;b>>0!==a)throw TypeError(M.FD);a=this.getFileByFd(a);if(!a)throw k("EBADF",b);return a}; a.prototype.getNodeByIdOrCreate=function(a,b,d){if("number"===typeof a){a=this.getFileByFd(a);if(!a)throw Error("File nto found");return a.node}var e=B(a),f=this.getLink(e);if(f)return f.getNode();if(b&O&&(b=this.getLinkParent(e)))return f=this.createLink(b,e[e.length-1],!1,d),f.getNode();throw k("ENOENT","getNodeByIdOrCreate",p(a));};a.prototype.wrapAsync=function(a,b,d){var e=this;r(d);gb.default(function(){try{d(null,a.apply(e,b))}catch(Ab){d(Ab)}})};a.prototype._toJSON=function(a,b,d){var e;void 0=== a&&(a=this.root);void 0===b&&(b={});var f=!0,v=a.children;a.getNode().isFile()&&(v=(e={},e[a.getName()]=a.parent.getChild(a.getName()),e),a=a.parent);for(var h in v){f=!1;v=a.getChild(h);if(!v)throw Error("_toJSON: unexpected undefined");e=v.getNode();e.isFile()?(v=v.getPath(),d&&(v=Pb(d,v)),b[v]=e.getString()):e.isDirectory()&&this._toJSON(v,b,d)}a=a.getPath();d&&(a=Pb(d,a));a&&f&&(b[a]=null);return b};a.prototype.toJSON=function(a,b,d){void 0===b&&(b={});void 0===d&&(d=!1);var e=[];if(a){a instanceof Array||(a=[a]);for(var f=0;f=this.maxFiles)throw k("EMFILE","open",a.getPath());var e=a;d&&(e=this.resolveSymlinks(a));if(!e)throw k("ENOENT","open",a.getPath());d=e.getNode();if(d.isDirectory()){if((b&(cc|Aa|ib))!==cc)throw k("EISDIR","open",a.getPath()); }else if(b&T)throw k("ENOTDIR","open",a.getPath());if(!(b&ib||d.canRead()))throw k("EACCES","open",a.getPath());a=new this.props.File(a,d,b,this.newFdNumber());this.fds[a.fd]=a;this.openFiles++;b&K&&a.truncate();return a};a.prototype.openFile=function(a,b,d,e){void 0===e&&(e=!0);var f=n(a),v=e?this.getResolvedLink(f):this.getLink(f);if(!v&&b&O){var h=this.getResolvedLink(f.slice(0,f.length-1));if(!h)throw k("ENOENT","open",H+f.join(H));b&O&&"number"===typeof d&&(v=this.createLink(h,f[f.length-1], !1,d))}if(v)return this.openLink(v,b,e);throw k("ENOENT","open",a);};a.prototype.openBase=function(a,b,d,e){void 0===e&&(e=!0);b=this.openFile(a,b,d,e);if(!b)throw k("ENOENT","open",a);return b.fd};a.prototype.openSync=function(a,b,d){void 0===d&&(d=438);d=y(d);a=p(a);b=l(b);return this.openBase(a,b,d)};a.prototype.open=function(a,b,d,e){var f=d;"function"===typeof d&&(f=438,e=d);d=y(f||438);a=p(a);b=l(b);this.wrapAsync(this.openBase,[a,b,d],e)};a.prototype.closeFile=function(a){this.fds[a.fd]&&(this.openFiles--, delete this.fds[a.fd],this.releasedFds.push(a.fd))};a.prototype.closeSync=function(a){G(a);a=this.getFileByFdOrThrow(a,"close");this.closeFile(a)};a.prototype.close=function(a,b){G(a);this.wrapAsync(this.closeSync,[a],b)};a.prototype.openFileOrGetById=function(a,b,d){if("number"===typeof a){a=this.fds[a];if(!a)throw k("ENOENT");return a}return this.openFile(p(a),b,d)};a.prototype.readBase=function(a,b,d,e,f){return this.getFileByFdOrThrow(a).read(b,Number(d),Number(e),f)};a.prototype.readSync=function(a, b,d,e,f){G(a);return this.readBase(a,b,d,e,f)};a.prototype.read=function(a,b,d,e,f,h){var g=this;r(h);if(0===e)return Y.default.nextTick(function(){h&&h(null,0,b)});gb.default(function(){try{var v=g.readBase(a,b,d,e,f);h(null,v,b)}catch(ch){h(ch)}})};a.prototype.readFileBase=function(a,b,d){var e="number"===typeof a&&a>>>0===a;if(!e){var f=p(a);f=n(f);if((f=this.getResolvedLink(f))&&f.getNode().isDirectory())throw k("EISDIR","open",f.getPath());a=this.openSync(a,b)}try{var h=C(this.getFileByFdOrThrow(a).getBuffer(), d)}finally{e||this.closeSync(a)}return h};a.prototype.readFileSync=function(a,b){b=ba(b);var d=l(b.flag);return this.readFileBase(a,d,b.encoding)};a.prototype.readFile=function(a,b,d){d=P(ba)(b,d);b=d[0];d=d[1];var e=l(b.flag);this.wrapAsync(this.readFileBase,[a,e,b.encoding],d)};a.prototype.writeBase=function(a,b,d,e,f){return this.getFileByFdOrThrow(a,"write").write(b,d,e,f)};a.prototype.writeSync=function(a,b,d,e,f){G(a);var h="string"!==typeof b;if(h){var g=(d||0)|0,v=e;d=f}else var zb=e;b=z(b, zb);h?"undefined"===typeof v&&(v=b.length):(g=0,v=b.length);return this.writeBase(a,b,g,v,d)};a.prototype.write=function(a,b,d,e,f,h){var g=this;G(a);var v=typeof b,zb=typeof d,cd=typeof e,k=typeof f;if("string"!==v)if("function"===zb)var w=d;else if("function"===cd){var F=d|0;w=e}else if("function"===k){F=d|0;var l=e;w=f}else{F=d|0;l=e;var dd=f;w=h}else if("function"===zb)w=d;else if("function"===cd)dd=d,w=e;else if("function"===k){dd=d;var q=e;w=f}var p=z(b,q);"string"!==v?"undefined"===typeof l&& (l=p.length):(F=0,l=p.length);var m=r(w);gb.default(function(){try{var d=g.writeBase(a,p,F,l,dd);"string"!==v?m(null,d,p):m(null,d,b)}catch(dh){m(dh)}})};a.prototype.writeFileBase=function(a,b,d,e){var f="number"===typeof a;a=f?a:this.openBase(p(a),d,e);e=0;var h=b.length;d=d&L?void 0:0;try{for(;0=a.nlink&&this.deleteNode(a)};a.prototype.unlinkSync=function(a){a=p(a);this.unlinkBase(a)};a.prototype.unlink=function(a,b){a=p(a);this.wrapAsync(this.unlinkBase,[a],b)};a.prototype.symlinkBase=function(a,b){var d=n(b),e=this.getLinkParent(d);if(!e)throw k("ENOENT", "symlink",a,b);d=d[d.length-1];if(e.getChild(d))throw k("EEXIST","symlink",a,b);b=e.createChild(d);b.getNode().makeSymlink(n(a));return b};a.prototype.symlinkSync=function(a,b){a=p(a);b=p(b);this.symlinkBase(a,b)};a.prototype.symlink=function(a,b,d,e){d=r("function"===typeof d?d:e);a=p(a);b=p(b);this.wrapAsync(this.symlinkBase,[a,b],d)};a.prototype.realpathBase=function(a,b){var d=n(a);d=this.getResolvedLink(d);if(!d)throw k("ENOENT","realpath",a);return oa.strToEncoding(d.getPath(),b)};a.prototype.realpathSync= function(a,b){return this.realpathBase(p(a),ja(b).encoding)};a.prototype.realpath=function(a,b,d){d=pa(b,d);b=d[0];d=d[1];a=p(a);this.wrapAsync(this.realpathBase,[a,b.encoding],d)};a.prototype.lstatBase=function(a,b){void 0===b&&(b=!1);var d=this.getLink(n(a));if(!d)throw k("ENOENT","lstat",a);return eb.default.build(d.getNode(),b)};a.prototype.lstatSync=function(a,b){return this.lstatBase(p(a),f(b).bigint)};a.prototype.lstat=function(a,b,d){d=e(b,d);b=d[0];d=d[1];this.wrapAsync(this.lstatBase,[p(a), b.bigint],d)};a.prototype.statBase=function(a,b){void 0===b&&(b=!1);var d=this.getResolvedLink(n(a));if(!d)throw k("ENOENT","stat",a);return eb.default.build(d.getNode(),b)};a.prototype.statSync=function(a,b){return this.statBase(p(a),f(b).bigint)};a.prototype.stat=function(a,b,d){d=e(b,d);b=d[0];d=d[1];this.wrapAsync(this.statBase,[p(a),b.bigint],d)};a.prototype.fstatBase=function(a,b){void 0===b&&(b=!1);a=this.getFileByFd(a);if(!a)throw k("EBADF","fstat");return eb.default.build(a.node,b)};a.prototype.fstatSync= function(a,b){return this.fstatBase(a,f(b).bigint)};a.prototype.fstat=function(a,b,d){b=e(b,d);this.wrapAsync(this.fstatBase,[a,b[0].bigint],b[1])};a.prototype.renameBase=function(a,b){var d=this.getLink(n(a));if(!d)throw k("ENOENT","rename",a,b);var e=n(b),f=this.getLinkParent(e);if(!f)throw k("ENOENT","rename",a,b);(a=d.parent)&&a.deleteChild(d);d.steps=fd(f.steps,[e[e.length-1]]);f.setChild(d.getName(),d)};a.prototype.renameSync=function(a,b){a=p(a);b=p(b);this.renameBase(a,b)};a.prototype.rename= function(a,b,d){a=p(a);b=p(b);this.wrapAsync(this.renameBase,[a,b],d)};a.prototype.existsBase=function(a){return!!this.statBase(a)};a.prototype.existsSync=function(a){try{return this.existsBase(p(a))}catch(zb){return!1}};a.prototype.exists=function(a,b){var d=this,e=p(a);if("function"!==typeof b)throw Error(M.CB);gb.default(function(){try{b(d.existsBase(e))}catch(Ab){b(!1)}})};a.prototype.accessBase=function(a){this.getLinkOrThrow(a,"access")};a.prototype.accessSync=function(a,b){void 0===b&&(b=S); a=p(a);this.accessBase(a,b|0)};a.prototype.access=function(a,b,d){var e=S;"function"!==typeof b&&(e=b|0,b=r(d));a=p(a);this.wrapAsync(this.accessBase,[a,e],b)};a.prototype.appendFileSync=function(a,b,d){void 0===d&&(d=fa);d=ha(d);d.flag&&a>>>0!==a||(d.flag="a");this.writeFileSync(a,b,d)};a.prototype.appendFile=function(a,b,d,e){e=na(d,e);d=e[0];e=e[1];d.flag&&a>>>0!==a||(d.flag="a");this.writeFile(a,b,d,e)};a.prototype.readdirBase=function(a,b){var d=n(a);d=this.getResolvedLink(d);if(!d)throw k("ENOENT", "readdir",a);if(!d.getNode().isDirectory())throw k("ENOTDIR","scandir",a);if(b.withFileTypes){var e=[];for(f in d.children)(a=d.getChild(f))&&e.push($c.default.build(a,b.encoding));U||"buffer"===b.encoding||e.sort(function(a,b){return a.nameb.name?1:0});return e}var f=[];for(e in d.children)f.push(oa.strToEncoding(e,b.encoding));U||"buffer"===b.encoding||f.sort();return f};a.prototype.readdirSync=function(a,b){b=ma(b);a=p(a);return this.readdirBase(a,b)};a.prototype.readdir=function(a, b,d){d=sa(b,d);b=d[0];d=d[1];a=p(a);this.wrapAsync(this.readdirBase,[a,b],d)};a.prototype.readlinkBase=function(a,b){var d=this.getLinkOrThrow(a,"readlink").getNode();if(!d.isSymlink())throw k("EINVAL","readlink",a);a=H+d.symlink.join(H);return oa.strToEncoding(a,b)};a.prototype.readlinkSync=function(a,b){b=W(b);a=p(a);return this.readlinkBase(a,b.encoding)};a.prototype.readlink=function(a,b,d){d=aa(b,d);b=d[0];d=d[1];a=p(a);this.wrapAsync(this.readlinkBase,[a,b.encoding],d)};a.prototype.fsyncBase= function(a){this.getFileByFdOrThrow(a,"fsync")};a.prototype.fsyncSync=function(a){this.fsyncBase(a)};a.prototype.fsync=function(a,b){this.wrapAsync(this.fsyncBase,[a],b)};a.prototype.fdatasyncBase=function(a){this.getFileByFdOrThrow(a,"fdatasync")};a.prototype.fdatasyncSync=function(a){this.fdatasyncBase(a)};a.prototype.fdatasync=function(a,b){this.wrapAsync(this.fdatasyncBase,[a],b)};a.prototype.ftruncateBase=function(a,b){this.getFileByFdOrThrow(a,"ftruncate").truncate(b)};a.prototype.ftruncateSync= function(a,b){this.ftruncateBase(a,b)};a.prototype.ftruncate=function(a,b,d){var e="number"===typeof b?b:0;b=r("number"===typeof b?d:b);this.wrapAsync(this.ftruncateBase,[a,e],b)};a.prototype.truncateBase=function(a,b){a=this.openSync(a,"r+");try{this.ftruncateSync(a,b)}finally{this.closeSync(a)}};a.prototype.truncateSync=function(a,b){if(a>>>0===a)return this.ftruncateSync(a,b);this.truncateBase(a,b)};a.prototype.truncate=function(a,b,d){var e="number"===typeof b?b:0;b=r("number"===typeof b?d:b); if(a>>>0===a)return this.ftruncate(a,e,b);this.wrapAsync(this.truncateBase,[a,e],b)};a.prototype.futimesBase=function(a,b,d){a=this.getFileByFdOrThrow(a,"futimes").node;a.atime=new Date(1E3*b);a.mtime=new Date(1E3*d)};a.prototype.futimesSync=function(a,b,d){this.futimesBase(a,D(b),D(d))};a.prototype.futimes=function(a,b,d,e){this.wrapAsync(this.futimesBase,[a,D(b),D(d)],e)};a.prototype.utimesBase=function(a,b,d){a=this.openSync(a,"r+");try{this.futimesBase(a,b,d)}finally{this.closeSync(a)}};a.prototype.utimesSync= function(a,b,d){this.utimesBase(p(a),D(b),D(d))};a.prototype.utimes=function(a,b,d,e){this.wrapAsync(this.utimesBase,[p(a),D(b),D(d)],e)};a.prototype.mkdirBase=function(a,b){var d=n(a);if(!d.length)throw k("EISDIR","mkdir",a);var e=this.getLinkParentAsDirOrThrow(a,"mkdir");d=d[d.length-1];if(e.getChild(d))throw k("EEXIST","mkdir",a);e.createChild(d,this.createNode(!0,b))};a.prototype.mkdirpBase=function(a,b){a=n(a);for(var d=this.root,e=0;ethis.prev.mtimeMs||a.nlink!==this.prev.nlink?!0:!1};b.prototype.start=function(a,b,d){void 0===b&&(b=!0);void 0===d&&(d=5007);this.filename=p(a);this.setTimeout=b?setTimeout:mf.default;this.interval=d;this.prev=this.vol.statSync(this.filename);this.loop()};b.prototype.stop=function(){clearTimeout(this.timeoutRef);Y.default.nextTick(bc,this)};return b}(x.EventEmitter); b.StatWatcher=qa;var ia;wb.inherits(ta,ca.Readable);b.ReadStream=ta;ta.prototype.open=function(){var a=this;this._vol.open(this.path,this.flags,this.mode,function(b,d){b?(a.autoClose&&a.destroy&&a.destroy(),a.emit("error",b)):(a.fd=d,a.emit("open",d),a.read())})};ta.prototype._read=function(a){if("number"!==typeof this.fd)return this.once("open",function(){this._read(a)});if(!this.destroyed){if(!ia||128>ia.length-ia.used)ia=J.bufferAllocUnsafe(this._readableState.highWaterMark),ia.used=0;var b=ia, d=Math.min(ia.length-ia.used,a),e=ia.used;void 0!==this.pos&&(d=Math.min(this.end-this.pos+1,d));if(0>=d)return this.push(null);var f=this;this._vol.read(this.fd,ia,ia.used,d,this.pos,function(a,d){a?(f.autoClose&&f.destroy&&f.destroy(),f.emit("error",a)):(a=null,0=a?ma(null,a):void 0!==b?"string"===typeof d?ma(null,a).fill(b,d):ma(null,a).fill(b):ma(null,a)};m.allocUnsafe=function(a){return Tc(null,a)};m.allocUnsafeSlow=function(a){return Tc(null,a)};m.isBuffer=Ye;m.compare=function(a,b){if(!fa(a)||!fa(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var d=a.length,e=b.length, f=0,g=Math.min(d,e);f"};m.prototype.compare=function(a,b,d,e,f){if(!fa(a))throw new TypeError("Argument must be a Buffer");void 0===b&&(b=0);void 0===d&&(d=a?a.length:0);void 0===e&&(e=0);void 0===f&&(f=this.length);if(0>b||d>a.length||0>e||f>this.length)throw new RangeError("out of range index");if(e>=f&&b>=d)return 0; if(e>=f)return-1;if(b>=d)return 1;b>>>=0;d>>>=0;e>>>=0;f>>>=0;if(this===a)return 0;var g=f-e,h=d-b,k=Math.min(g,h);e=this.slice(e,f);a=a.slice(b,d);for(b=0;bf)d=f;if(0d||0>b)||b>this.length)throw new RangeError("Attempt to write outside buffer bounds");e||(e="utf8");for(f=!1;;)switch(e){case "hex":a:{b=Number(b)||0;e=this.length-b;d?(d=Number(d),d>e&&(d=e)):d=e;e=a.length;if(0!==e%2)throw new TypeError("Invalid hex string"); d>e/2&&(d=e/2);for(e=0;e(f-=2));++h){var k=e.charCodeAt(h);a=k>>8;k%=256;g.push(k);g.push(a)}return ub(g, this,b,d);default:if(f)throw new TypeError("Unknown encoding: "+e);e=(""+e).toLowerCase();f=!0}};m.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var We=4096;m.prototype.slice=function(a,b){var d=this.length;a=~~a;b=void 0===b?d:~~b;0>a?(a+=d,0>a&&(a=0)):a>d&&(a=d);0>b?(b+=d,0>b&&(b=0)):b>d&&(b=d);b=128*e&&(d-=Math.pow(2,8*b));return d};m.prototype.readIntBE=function(a,b,d){a|=0;b|=0;d||I(a, b,this.length);d=b;for(var e=1,f=this[a+--d];0=128*e&&(f-=Math.pow(2,8*b));return f};m.prototype.readInt8=function(a,b){b||I(a,1,this.length);return this[a]&128?-1*(255-this[a]+1):this[a]};m.prototype.readInt16LE=function(a,b){b||I(a,2,this.length);a=this[a]|this[a+1]<<8;return a&32768?a|4294901760:a};m.prototype.readInt16BE=function(a,b){b||I(a,2,this.length);a=this[a+1]|this[a]<<8;return a&32768?a|4294901760:a};m.prototype.readInt32LE=function(a,b){b||I(a,4,this.length); return this[a]|this[a+1]<<8|this[a+2]<<16|this[a+3]<<24};m.prototype.readInt32BE=function(a,b){b||I(a,4,this.length);return this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]};m.prototype.readFloatLE=function(a,b){b||I(a,4,this.length);return Vb(this,a,!0,23,4)};m.prototype.readFloatBE=function(a,b){b||I(a,4,this.length);return Vb(this,a,!1,23,4)};m.prototype.readDoubleLE=function(a,b){b||I(a,8,this.length);return Vb(this,a,!0,52,8)};m.prototype.readDoubleBE=function(a,b){b||I(a,8,this.length);return Vb(this, a,!1,52,8)};m.prototype.writeUIntLE=function(a,b,d,e){a=+a;b|=0;d|=0;e||V(this,a,b,d,Math.pow(2,8*d)-1,0);e=1;var f=0;for(this[b]=a&255;++f>>8):Yb(this,a,b,!0);return b+2};m.prototype.writeUInt16BE=function(a,b,d){a=+a;b|=0;d||V(this,a,b,2,65535,0);m.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=a&255):Yb(this,a,b,!1);return b+2};m.prototype.writeUInt32LE=function(a,b,d){a=+a;b|=0;d||V(this,a,b,4,4294967295,0);m.TYPED_ARRAY_SUPPORT?(this[b+3]=a>>>24,this[b+2]=a>>>16,this[b+1]=a>>>8,this[b]=a&255):Zb(this,a,b,!0);return b+4};m.prototype.writeUInt32BE= function(a,b,d){a=+a;b|=0;d||V(this,a,b,4,4294967295,0);m.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=a&255):Zb(this,a,b,!1);return b+4};m.prototype.writeIntLE=function(a,b,d,e){a=+a;b|=0;e||(e=Math.pow(2,8*d-1),V(this,a,b,d,e-1,-e));e=0;var f=1,g=0;for(this[b]=a&255;++ea&&0===g&&0!==this[b+e-1]&&(g=1),this[b+e]=(a/f>>0)-g&255;return b+d};m.prototype.writeIntBE=function(a,b,d,e){a=+a;b|=0;e||(e=Math.pow(2,8*d-1),V(this,a,b,d,e-1,-e));e=d-1;var f= 1,g=0;for(this[b+e]=a&255;0<=--e&&(f*=256);)0>a&&0===g&&0!==this[b+e+1]&&(g=1),this[b+e]=(a/f>>0)-g&255;return b+d};m.prototype.writeInt8=function(a,b,d){a=+a;b|=0;d||V(this,a,b,1,127,-128);m.TYPED_ARRAY_SUPPORT||(a=Math.floor(a));0>a&&(a=255+a+1);this[b]=a&255;return b+1};m.prototype.writeInt16LE=function(a,b,d){a=+a;b|=0;d||V(this,a,b,2,32767,-32768);m.TYPED_ARRAY_SUPPORT?(this[b]=a&255,this[b+1]=a>>>8):Yb(this,a,b,!0);return b+2};m.prototype.writeInt16BE=function(a,b,d){a=+a;b|=0;d||V(this,a,b, 2,32767,-32768);m.TYPED_ARRAY_SUPPORT?(this[b]=a>>>8,this[b+1]=a&255):Yb(this,a,b,!1);return b+2};m.prototype.writeInt32LE=function(a,b,d){a=+a;b|=0;d||V(this,a,b,4,2147483647,-2147483648);m.TYPED_ARRAY_SUPPORT?(this[b]=a&255,this[b+1]=a>>>8,this[b+2]=a>>>16,this[b+3]=a>>>24):Zb(this,a,b,!0);return b+4};m.prototype.writeInt32BE=function(a,b,d){a=+a;b|=0;d||V(this,a,b,4,2147483647,-2147483648);0>a&&(a=4294967295+a+1);m.TYPED_ARRAY_SUPPORT?(this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]= a&255):Zb(this,a,b,!1);return b+4};m.prototype.writeFloatLE=function(a,b,d){d||$b(this,a,b,4);Wb(this,a,b,!0,23,4);return b+4};m.prototype.writeFloatBE=function(a,b,d){d||$b(this,a,b,4);Wb(this,a,b,!1,23,4);return b+4};m.prototype.writeDoubleLE=function(a,b,d){d||$b(this,a,b,8);Wb(this,a,b,!0,52,8);return b+8};m.prototype.writeDoubleBE=function(a,b,d){d||$b(this,a,b,8);Wb(this,a,b,!1,52,8);return b+8};m.prototype.copy=function(a,b,d,e){d||(d=0);e||0===e||(e=this.length);b>=a.length&&(b=a.length); b||(b=0);0b)throw new RangeError("targetStart out of bounds");if(0>d||d>=this.length)throw new RangeError("sourceStart out of bounds");if(0>e)throw new RangeError("sourceEnd out of bounds");e>this.length&&(e=this.length);a.length-bf||!m.TYPED_ARRAY_SUPPORT)for(e=0;ef&&(a=f)}if(void 0!==e&&"string"!==typeof e)throw new TypeError("encoding must be a string");if("string"===typeof e&&!m.isEncoding(e))throw new TypeError("Unknown encoding: "+e);}else"number"===typeof a&&(a&=255);if(0>b||this.length>>=0;d=void 0===d?this.length:d>>>0;a||(a=0);if("number"===typeof a)for(e=b;eb&&(d--,b+=1E9));return[d,b]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-mh)/1E3}},tf=Wc(function(a,b){function d(a,b){for(var d in a)b[d]=a[d]}function e(a,b,d){return f(a, b,d)}var f=fc.Buffer;f.from&&f.alloc&&f.allocUnsafe&&f.allocUnsafeSlow?a.exports=fc:(d(fc,b),b.Buffer=e);e.prototype=Object.create(f.prototype);d(f,e);e.from=function(a,b,d){if("number"===typeof a)throw new TypeError("Argument must not be a number");return f(a,b,d)};e.alloc=function(a,b,d){if("number"!==typeof a)throw new TypeError("Argument must be a number");a=f(a);void 0!==b?"string"===typeof d?a.fill(b,d):a.fill(b):a.fill(0);return a};e.allocUnsafe=function(a){if("number"!==typeof a)throw new TypeError("Argument must be a number"); return f(a)};e.allocUnsafeSlow=function(a){if("number"!==typeof a)throw new TypeError("Argument must be a number");return fc.SlowBuffer(a)}}),oh=Wc(function(a,b){function d(){throw Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11");}function e(a,b){if("number"!==typeof a||a!==a)throw new TypeError("offset must be a number");if(a>r||0>a)throw new TypeError("offset must be a uint32");if(a>m||a>b)throw new RangeError("offset out of range"); }function f(a,b,d){if("number"!==typeof a||a!==a)throw new TypeError("size must be a number");if(a>r||0>a)throw new TypeError("size must be a uint32");if(a+b>d||a>m)throw new RangeError("buffer too small");}function g(a,b,d,g){if(!(l.isBuffer(a)||a instanceof gc.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"===typeof b)g=b,b=0,d=a.length;else if("function"===typeof d)g=d,d=a.length-b;else if("function"!==typeof g)throw new TypeError('"cb" argument must be a function'); e(b,a.length);f(d,b,a.length);return h(a,b,d,g)}function h(a,b,d,e){b=new Uint8Array(a.buffer,b,d);n.getRandomValues(b);if(e)df(function(){e(null,a)});else return a}function k(a,b,d){"undefined"===typeof b&&(b=0);if(!(l.isBuffer(a)||a instanceof gc.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');e(b,a.length);void 0===d&&(d=a.length-b);f(d,b,a.length);return h(a,b,d)}var l=tf.Buffer,m=tf.kMaxLength,n=gc.crypto||gc.msCrypto,r=Math.pow(2,32)-1;n&&n.getRandomValues?(b.randomFill= g,b.randomFillSync=k):(b.randomFill=d,b.randomFillSync=d)}),ph=Wc(function(a){a.exports=oh}).randomFillSync,qh=Math.floor(.001*(Date.now()-performance.now())),Cb={resolve:function(){for(var a="",b=!1,d,e=arguments.length-1;-1<=e&&!b;e--){if(0<=e)var f=arguments[e];else void 0===d&&(d=nh.cwd()),f=d;ha(f);0!==f.length&&(a=f+"/"+a,b=47===f.charCodeAt(0))}a=ff(a,!b);return b?0k){if(47===b.charCodeAt(g+m))return b.slice(g+m+1);if(0===m)return b.slice(g+m)}else f>k&&(47===a.charCodeAt(d+m)?l=m:0===m&&(l=0));break}var n=a.charCodeAt(d+m),r=b.charCodeAt(g+m);if(n!==r)break;else 47===n&&(l=m)}f="";for(m=d+l+1;m<=e;++m)if(m===e||47===a.charCodeAt(m))f=0===f.length?f+"..":f+"/..";if(0=f;--m)if(d=a.charCodeAt(m),47===d){if(!l){h=m+1;break}}else-1===k&&(l=!1,k=m+1),46===d?-1===g?g=m:1!==n&&(n=1):-1!==g&&(n=-1);-1===g||-1===k||0===n||1===n&&g===k-1&&g===h+1?-1!==k&&(b.base=0===h&&e?b.name=a.slice(1,k):b.name=a.slice(h,k)):(0===h&&e?(b.name=a.slice(1,g),b.base=a.slice(1,k)):(b.name=a.slice(h,g),b.base=a.slice(h,k)),b.ext=a.slice(g,k));0b&&(d--,b+=1E9));return[d,b]}),exit:function(a){throw new vf(a);},kill:function(a){throw new sh(a);},randomFillSync:ph,isTTY:function(){return!0},path:rh,fs:null},C,Ra=n(1),Ba=n(2),kb=n(4),lb=n(8),Ca=n(16),hd=n(32),Da=n(64),mb=n(128), hc=n(256),id=n(512),jd=n(1024),kd=n(2048),ld=n(4096),ic=n(8192),jc=n(16384),md=n(32768),nd=n(65536),od=n(131072),pd=n(262144),qd=n(524288),rd=n(1048576),Ea=n(2097152),kc=n(4194304),lc=n(8388608),sd=n(16777216),td=n(33554432),ud=n(67108864),Sa=n(134217728),xf=n(268435456),cb=Ra|Ba|kb|lb|Ca|hd|Da|mb|hc|id|jd|kd|ld|ic|jc|md|nd|od|pd|qd|rd|Ea|lc|kc|sd|ud|td|Sa|xf,lf=Ra|Ba|kb|lb|Ca|hd|Da|mb|hc|Ea|kc|lc|Sa,Pg=n(0),Yc=lb|Ca|mb|id|jd|kd|ld|ic|jc|md|nd|od|pd|qd|rd|Ea|lc|sd|ud|td|Sa,jf=Yc|lf,kf=Ba|lb|Da|Ea| Sa|xf,Ng=Ba|lb|Da|Ea|Sa,Og=n(0),Mg={E2BIG:1,EACCES:2,EADDRINUSE:3,EADDRNOTAVAIL:4,EAFNOSUPPORT:5,EALREADY:7,EAGAIN:6,EBADF:8,EBADMSG:9,EBUSY:10,ECANCELED:11,ECHILD:12,ECONNABORTED:13,ECONNREFUSED:14,ECONNRESET:15,EDEADLOCK:16,EDESTADDRREQ:17,EDOM:18,EDQUOT:19,EEXIST:20,EFAULT:21,EFBIG:22,EHOSTDOWN:23,EHOSTUNREACH:23,EIDRM:24,EILSEQ:25,EINPROGRESS:26,EINTR:27,EINVAL:28,EIO:29,EISCONN:30,EISDIR:31,ELOOP:32,EMFILE:33,EMLINK:34,EMSGSIZE:35,EMULTIHOP:36,ENAMETOOLONG:37,ENETDOWN:38,ENETRESET:39,ENETUNREACH:40, ENFILE:41,ENOBUFS:42,ENODEV:43,ENOENT:44,ENOEXEC:45,ENOLCK:46,ENOLINK:47,ENOMEM:48,ENOMSG:49,ENOPROTOOPT:50,ENOSPC:51,ENOSYS:52,ENOTCONN:53,ENOTDIR:54,ENOTEMPTY:55,ENOTRECOVERABLE:56,ENOTSOCK:57,ENOTTY:59,ENXIO:60,EOVERFLOW:61,EOWNERDEAD:62,EPERM:63,EPIPE:64,EPROTO:65,EPROTONOSUPPORT:66,EPROTOTYPE:67,ERANGE:68,EROFS:69,ESPIPE:70,ESRCH:71,ESTALE:72,ETIMEDOUT:73,ETXTBSY:74,EXDEV:75},yf=(C={},C[6]="SIGHUP",C[8]="SIGINT",C[11]="SIGQUIT",C[7]="SIGILL",C[15]="SIGTRAP",C[0]="SIGABRT",C[2]="SIGBUS",C[5]= "SIGFPE",C[9]="SIGKILL",C[20]="SIGUSR1",C[12]="SIGSEGV",C[21]="SIGUSR2",C[10]="SIGPIPE",C[1]="SIGALRM",C[14]="SIGTERM",C[3]="SIGCHLD",C[4]="SIGCONT",C[13]="SIGSTOP",C[16]="SIGTSTP",C[17]="SIGTTIN",C[18]="SIGTTOU",C[19]="SIGURG",C[23]="SIGXCPU",C[24]="SIGXFSZ",C[22]="SIGVTALRM",C),th=Ra|Ba|Ca|mb|Ea|Sa,zf=Ra|Da|Ca|mb|Ea|Sa,Xc=function(a){function b(d){var e=a.call(this)||this;e.errno=d;Object.setPrototypeOf(e,b.prototype);return e}Rc(b,a);return b}(Error),vf=function(a){function b(d){var e=a.call(this, "WASI Exit error: "+d)||this;e.code=d;Object.setPrototypeOf(e,b.prototype);return e}Rc(b,a);return b}(Error),sh=function(a){function b(d){var e=a.call(this,"WASI Kill signal: "+d)||this;e.signal=d;Object.setPrototypeOf(e,b.prototype);return e}Rc(b,a);return b}(Error),Af=function(){function a(a){function b(a){switch(a){case 1:return A.hrtime();case 0:return Pa(Date.now());case 2:case 3:return A.hrtime()-I;default:return null}}function e(a,b){a=gf(h,a);if(b!==n(0)&&(a.rights.base&b)===n(0))throw new Xc(63); return a}function f(a,b){h.refreshMemory();return Array.from({length:b},function(b,d){d=a+8*d;b=h.view.getUint32(d,!0);d=h.view.getUint32(d+4,!0);return new Uint8Array(h.memory.buffer,b,d)})}var g,h=this,k={};a&&a.preopens?k=a.preopens:a&&a.preopenDirectories&&(k=a.preopenDirectories);var l={};a&&a.env&&(l=a.env);var m=[];a&&a.args&&(m=a.args);var A=wf;a&&a.bindings&&(A=a.bindings);this.view=this.memory=void 0;this.bindings=A;this.FD_MAP=new Map([[0,{real:0,filetype:2,rights:{base:th,inheriting:n(0)}, path:void 0}],[1,{real:1,filetype:2,rights:{base:zf,inheriting:n(0)},path:void 0}],[2,{real:2,filetype:2,rights:{base:zf,inheriting:n(0)},path:void 0}]]);var r=this.bindings.fs,u=this.bindings.path;try{for(var p=Sb(Object.entries(k)),x=p.next();!x.done;x=p.next()){var y=Tb(x.value,2),z=y[0],C=y[1],D=r.openSync(C,r.constants.O_RDONLY),E=Ub(this.FD_MAP.keys()).reverse()[0]+1;this.FD_MAP.set(E,{real:D,filetype:3,rights:{base:Yc,inheriting:jf},fakePath:z,path:C})}}catch(w){var H={error:w}}finally{try{x&& !x.done&&(g=p.return)&&g.call(p)}finally{if(H)throw H.error;}}var I=A.hrtime();this.wasiImport={args_get:function(a,b){h.refreshMemory();var d=a,e=b;m.forEach(function(a){h.view.setUint32(d,e,!0);d+=4;e+=G.from(h.memory.buffer).write(a+"\x00",e)});return 0},args_sizes_get:function(a,b){h.refreshMemory();h.view.setUint32(a,m.length,!0);a=m.reduce(function(a,b){return a+G.byteLength(b)+1},0);h.view.setUint32(b,a,!0);return 0},environ_get:function(a,b){h.refreshMemory();var d=a,e=b;Object.entries(l).forEach(function(a){var b= Tb(a,2);a=b[0];b=b[1];h.view.setUint32(d,e,!0);d+=4;e+=G.from(h.memory.buffer).write(a+"="+b+"\x00",e)});return 0},environ_sizes_get:function(a,b){h.refreshMemory();var d=Object.entries(l).map(function(a){a=Tb(a,2);return a[0]+"="+a[1]+"\x00"}),e=d.reduce(function(a,b){return a+G.byteLength(b)},0);h.view.setUint32(a,d.length,!0);h.view.setUint32(b,e,!0);return 0},clock_res_get:function(a,b){switch(a){case 1:case 2:case 3:var d=n(1);break;case 0:d=n(1E3)}h.view.setBigUint64(b,d);return 0},clock_time_get:function(a, d,e){h.refreshMemory();a=b(a);if(null===a)return 28;h.view.setBigUint64(e,n(a),!0);return 0},fd_advise:B(function(a){e(a,mb);return 52}),fd_allocate:B(function(a){e(a,hc);return 52}),fd_close:B(function(a){var b=e(a,n(0));r.closeSync(b.real);h.FD_MAP.delete(a);return 0}),fd_datasync:B(function(a){a=e(a,Ra);r.fdatasyncSync(a.real);return 0}),fd_fdstat_get:B(function(a,b){a=e(a,n(0));h.refreshMemory();h.view.setUint8(b,a.filetype);h.view.setUint16(b+2,0,!0);h.view.setUint16(b+4,0,!0);h.view.setBigUint64(b+ 8,n(a.rights.base),!0);h.view.setBigUint64(b+8+8,n(a.rights.inheriting),!0);return 0}),fd_fdstat_set_flags:B(function(a){e(a,lb);return 52}),fd_fdstat_set_rights:B(function(a,b,d){a=e(a,n(0));if((a.rights.base|b)>a.rights.base||(a.rights.inheriting|d)>a.rights.inheriting)return 63;a.rights.base=b;a.rights.inheriting=d;return 0}),fd_filestat_get:B(function(a,b){a=e(a,Ea);var d=r.fstatSync(a.real);h.refreshMemory();h.view.setBigUint64(b,n(d.dev),!0);b+=8;h.view.setBigUint64(b,n(d.ino),!0);b+=8;h.view.setUint8(b, a.filetype);b+=8;h.view.setBigUint64(b,n(d.nlink),!0);b+=8;h.view.setBigUint64(b,n(d.size),!0);b+=8;h.view.setBigUint64(b,Pa(d.atimeMs),!0);b+=8;h.view.setBigUint64(b,Pa(d.mtimeMs),!0);h.view.setBigUint64(b+8,Pa(d.ctimeMs),!0);return 0}),fd_filestat_set_size:B(function(a,b){a=e(a,kc);r.ftruncateSync(a.real,Number(b));return 0}),fd_filestat_set_times:B(function(a,d,f,h){a=e(a,lc);var g=r.fstatSync(a.real),k=g.atime;g=g.mtime;var l=bb(b(0));if(3===(h&3)||12===(h&12))return 28;1===(h&1)?k=bb(d):2=== (h&2)&&(k=l);4===(h&4)?g=bb(f):8===(h&8)&&(g=l);r.futimesSync(a.real,new Date(k),new Date(g));return 0}),fd_prestat_get:B(function(a,b){a=e(a,n(0));if(!a.path)return 28;h.refreshMemory();h.view.setUint8(b,0);h.view.setUint32(b+4,G.byteLength(a.fakePath),!0);return 0}),fd_prestat_dir_name:B(function(a,b,d){a=e(a,n(0));if(!a.path)return 28;h.refreshMemory();G.from(h.memory.buffer).write(a.fakePath,b,d,"utf8");return 0}),fd_pwrite:B(function(a,b,d,g,k){var l=e(a,Da|kb),m=0;f(b,d).forEach(function(a){for(var b= 0;bd)break;h.view.setBigUint64(b,n(f+1),!0);b+=8;if(b-l>d)break;var p=r.statSync(u.resolve(a.path, m.name));h.view.setBigUint64(b,n(p.ino),!0);b+=8;if(b-l>d)break;h.view.setUint32(b,w,!0);b+=4;if(b-l>d)break;switch(!0){case p.isBlockDevice():p=1;break;case p.isCharacterDevice():p=2;break;case p.isDirectory():p=3;break;case p.isFIFO():p=6;break;case p.isFile():p=4;break;case p.isSocket():p=6;break;case p.isSymbolicLink():p=7;break;default:p=0}h.view.setUint8(b,p);b+=1;b+=3;if(b+w>=l+d)break;G.from(h.memory.buffer).write(m.name,b);b+=w}h.view.setUint32(g,Math.min(b-l,d),!0);return 0}),fd_renumber:B(function(a, b){e(a,n(0));e(b,n(0));r.closeSync(h.FD_MAP.get(a).real);h.FD_MAP.set(a,h.FD_MAP.get(b));h.FD_MAP.delete(b);return 0}),fd_seek:B(function(a,b,d,f){a=e(a,kb);h.refreshMemory();switch(d){case 1:a.offset=(a.offset?a.offset:n(0))+n(b);break;case 2:d=r.fstatSync(a.real).size;a.offset=n(d)+n(b);break;case 0:a.offset=n(b)}h.view.setBigUint64(f,a.offset,!0);return 0}),fd_tell:B(function(a,b){a=e(a,hd);h.refreshMemory();a.offset||(a.offset=n(0));h.view.setBigUint64(b,a.offset,!0);return 0}),fd_sync:B(function(a){a= e(a,Ca);r.fsyncSync(a.real);return 0}),path_create_directory:B(function(a,b,d){a=e(a,id);if(!a.path)return 28;h.refreshMemory();b=G.from(h.memory.buffer,b,d).toString();r.mkdirSync(u.resolve(a.path,b));return 0}),path_filestat_get:B(function(a,b,d,f,g){a=e(a,pd);if(!a.path)return 28;h.refreshMemory();d=G.from(h.memory.buffer,d,f).toString();d=r.statSync(u.resolve(a.path,d));h.view.setBigUint64(g,n(d.dev),!0);g+=8;h.view.setBigUint64(g,n(d.ino),!0);g+=8;h.view.setUint8(g,hf(h,void 0,d).filetype);g+= 8;h.view.setBigUint64(g,n(d.nlink),!0);g+=8;h.view.setBigUint64(g,n(d.size),!0);g+=8;h.view.setBigUint64(g,Pa(d.atimeMs),!0);g+=8;h.view.setBigUint64(g,Pa(d.mtimeMs),!0);h.view.setBigUint64(g+8,Pa(d.ctimeMs),!0);return 0}),path_filestat_set_times:B(function(a,d,f,g,k,l,m){a=e(a,rd);if(!a.path)return 28;h.refreshMemory();var n=r.fstatSync(a.real);d=n.atime;n=n.mtime;var p=bb(b(0));if(3===(m&3)||12===(m&12))return 28;1===(m&1)?d=bb(k):2===(m&2)&&(d=p);4===(m&4)?n=bb(l):8===(m&8)&&(n=p);f=G.from(h.memory.buffer, f,g).toString();r.utimesSync(u.resolve(a.path,f),new Date(d),new Date(n));return 0}),path_link:B(function(a,b,d,f,g,k,l){a=e(a,kd);g=e(g,ld);if(!a.path||!g.path)return 28;h.refreshMemory();d=G.from(h.memory.buffer,d,f).toString();k=G.from(h.memory.buffer,k,l).toString();r.linkSync(u.resolve(a.path,d),u.resolve(g.path,k));return 0}),path_open:B(function(a,b,d,f,g,k,l,m,p){b=e(a,ic);k=n(k);l=n(l);a=(k&(Ba|jc))!==n(0);var q=(k&(Ra|Da|hc|kc))!==n(0);if(q&&a)var w=r.constants.O_RDWR;else a?w=r.constants.O_RDONLY: q&&(w=r.constants.O_WRONLY);a=k|ic;k|=l;0!==(g&1)&&(w|=r.constants.O_CREAT,a|=jd);0!==(g&2)&&(w|=r.constants.O_DIRECTORY);0!==(g&4)&&(w|=r.constants.O_EXCL);0!==(g&8)&&(w|=r.constants.O_TRUNC,a|=qd);0!==(m&1)&&(w|=r.constants.O_APPEND);0!==(m&2)&&(w=r.constants.O_DSYNC?w|r.constants.O_DSYNC:w|r.constants.O_SYNC,k|=Ra);0!==(m&4)&&(w|=r.constants.O_NONBLOCK);0!==(m&8)&&(w=r.constants.O_RSYNC?w|r.constants.O_RSYNC:w|r.constants.O_SYNC,k|=Ca);0!==(m&16)&&(w|=r.constants.O_SYNC,k|=Ca);q&&0===(w&(r.constants.O_APPEND| r.constants.O_TRUNC))&&(k|=kb);h.refreshMemory();d=G.from(h.memory.buffer,d,f).toString();d=u.resolve(b.path,d);if(u.relative(b.path,d).startsWith(".."))return 76;try{var t=r.realpathSync(d);if(u.relative(b.path,t).startsWith(".."))return 76}catch(O){if("ENOENT"===O.code)t=d;else throw O;}try{var F=r.statSync(t).isDirectory()}catch(O){}w=!q&&F?r.openSync(t,r.constants.O_RDONLY):r.openSync(t,w);F=Ub(h.FD_MAP.keys()).reverse()[0]+1;h.FD_MAP.set(F,{real:w,filetype:void 0,rights:{base:a,inheriting:k}, path:t});gf(h,F);h.view.setUint32(p,F,!0);return 0}),path_readlink:B(function(a,b,d,f,g,k){a=e(a,md);if(!a.path)return 28;h.refreshMemory();b=G.from(h.memory.buffer,b,d).toString();b=u.resolve(a.path,b);b=r.readlinkSync(b);f=G.from(h.memory.buffer).write(b,f,g);h.view.setUint32(k,f,!0);return 0}),path_remove_directory:B(function(a,b,d){a=e(a,td);if(!a.path)return 28;h.refreshMemory();b=G.from(h.memory.buffer,b,d).toString();r.rmdirSync(u.resolve(a.path,b));return 0}),path_rename:B(function(a,b,d, f,g,k){a=e(a,nd);f=e(f,od);if(!a.path||!f.path)return 28;h.refreshMemory();b=G.from(h.memory.buffer,b,d).toString();g=G.from(h.memory.buffer,g,k).toString();r.renameSync(u.resolve(a.path,b),u.resolve(f.path,g));return 0}),path_symlink:B(function(a,b,d,f,g){d=e(d,sd);if(!d.path)return 28;h.refreshMemory();a=G.from(h.memory.buffer,a,b).toString();f=G.from(h.memory.buffer,f,g).toString();r.symlinkSync(a,u.resolve(d.path,f));return 0}),path_unlink_file:B(function(a,b,d){a=e(a,ud);if(!a.path)return 28; h.refreshMemory();b=G.from(h.memory.buffer,b,d).toString();r.unlinkSync(u.resolve(a.path,b));return 0}),poll_oneoff:function(a,d,e,f){var g=0,k=0;h.refreshMemory();for(var l=0;lk?p:k);h.view.setBigUint64(d,m,!0);d+=8;h.view.setUint16(d,r,!0);d+=2;h.view.setUint8(d,0);d+=1;d+=5;g+=1;break;case 1:case 2:a+=3;h.view.getUint32(a,!0);a+=4;h.view.setBigUint64(d,m,!0);d+=8;h.view.setUint16(d,52,!0);d+=2;h.view.setUint8(d,p);d+=1;d+=5;g+=1;break;default:return 28}}for(h.view.setUint32(f,g,!0);A.hrtime() "+f);return f}catch(Z){throw console.log("Catched error: "+Z),Z;}}})}a.prototype.refreshMemory= function(){this.view&&0!==this.view.buffer.byteLength||(this.view=new ec(this.memory.buffer))};a.prototype.setMemory=function(a){this.memory=a};a.prototype.start=function(a){a=a.exports;if(null===a||"object"!==typeof a)throw Error("instance.exports must be an Object. Received "+a+".");var b=a.memory;if(!(b instanceof WebAssembly.Memory))throw Error("instance.exports.memory must be a WebAssembly.Memory. Recceived "+b+".");this.setMemory(b);a._start&&a._start()};a.prototype.getImportNamespace=function(a){var b, e=null;try{for(var f=Sb(WebAssembly.Module.imports(a)),g=f.next();!g.done;g=f.next()){var h=g.value;if("function"===h.kind&&h.module.startsWith("wasi_"))if(!e)e=h.module;else if(e!==h.module)throw Error("Multiple namespaces detected.");}}catch(t){var k={error:t}}finally{try{g&&!g.done&&(b=f.return)&&b.call(f)}finally{if(k)throw k.error;}}return e};a.prototype.getImports=function(a){switch(this.getImportNamespace(a)){case "wasi_unstable":return{wasi_unstable:this.wasiImport};case "wasi_snapshot_preview1":return{wasi_snapshot_preview1:this.wasiImport}; default:throw Error("Can't detect a WASI namespace for the WebAssembly Module");}};a.defaultBindings=wf;return a}(),Bf=function(){function a(a){this.options=a}a.prototype.run=function(a){return Eb(this,void 0,void 0,function(){return Fb(this,function(a){throw Error("run not implemented by the Command subclass");})})};return a}(),uh=function(a){function b(b){var d=a.call(this,b)||this;if(!b.module)throw Error("Did not find a WebAssembly.Module for the WASI Command");return d}zd(b,a);b.prototype.run= function(a){return Eb(this,void 0,void 0,function(){var b,d,g,h;return Fb(this,function(e){switch(e.label){case 0:return b={preopens:db({".":".","/":"/"},this.options.preopens||{}),env:this.options.env,args:this.options.args,bindings:db(db({},Af.defaultBindings),{fs:a.fs})},d=new Af(b),g=this.options.module,[4,WebAssembly.instantiate(g,db({},d.getImports(g)))];case 1:return h=e.sent(),d.start(h),[2]}})})};return b}(Bf),vh=function(a){function b(b){var d=a.call(this,b)||this;if(!b.callback)throw Error("The Command Options provided are not for a Callback Command"); d.callback=b.callback;return d}zd(b,a);b.prototype.run=function(a){return Eb(this,void 0,void 0,function(){var b;return Fb(this,function(d){switch(d.label){case 0:return[4,Promise.resolve(this.callback(this.options,a))];case 1:return b=d.sent(),"string"==typeof b&&a.fs.writeFileSync("/dev/stdout",(new TextEncoder).encode(b+"\n")),[2]}})})};return b}(Bf),wh=function(){function a(a,d,e,f,g,h,k,l,m){var b=this;this.stdinPrompt="";this.commandOptions=a;this.wasmFs=new gh;this.wasmFs.fromJSON(d);this.originalWasmFsJson= d;this.ioDevices=new hh(this.wasmFs);this.ioDeviceWindow=h;this.ioDevices.setWindowSizeCallback(function(){var a=b.ioDevices.getWindowSize();b.ioDeviceWindow.resize(a[0],a[1])});this.ioDevices.setBufferIndexDisplayCallback(function(){var a=b.ioDevices.getFrameBuffer();b.ioDeviceWindow.drawRgbaArrayToFrameBuffer(a)});this.ioDevices.setInputCallback(function(){if(b.sharedIoDeviceInput){b.ioDeviceWindow.getInputBuffer();Atomics.wait(b.sharedIoDeviceInput,0,-1);var a=b.sharedIoDeviceInput[0];b.sharedIoDeviceInput[0]= -1;if(0<~]))/g,""):"";return a.length};a.prototype.stdinRead=function(a,d,e,f){if(0!==this.readStdinCounter%2)return this.readStdinCounter++,0;if(this.pipedStdin)d=this.pipedStdin,this.pipedStdin= "",this.readStdinCounter++;else if(this.sharedStdin&&this.startStdinReadCallback){this.startStdinReadCallback();Atomics.wait(this.sharedStdin,0,-1);d=this.sharedStdin[0];this.sharedStdin[0]=-1;e=new Uint8Array(d);for(f=0;f