391 lines
188 KiB
JavaScript
391 lines
188 KiB
JavaScript
|
/*
|
||
|
*****************************************************************************
|
||
|
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=0<h.length&&h[h.length-1])&&(6===b[0]||2===b[0])){e=0;continue}if(3===b[0]&&(!h||b[1]>h[0]&&b[1]<h[3]))e.label=b[1];else if(6===b[0]&&e.label<h[1])e.label=h[1],h=b;else if(h&&e.label<h[2])e.label=h[2],e.ops.push(b);else{h[2]&&e.ops.pop();e.trys.pop();
|
||
|
continue}}b=a.call(c,e)}catch(q){b=[6,q],g=0}finally{f=h=0}if(b[0]&5)throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}var e={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},trys:[],ops:[]},f,g,h,k;return k={next:b(0),"throw":b(1),"return":b(2)},"function"===typeof Symbol&&(k[Symbol.iterator]=function(){return this}),k}function Gf(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 Hf(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=0<h.length&&h[h.length-1])&&(6===b[0]||2===b[0])){e=0;continue}if(3===b[0]&&(!h||b[1]>h[0]&&b[1]<h[3]))e.label=b[1];else if(6===b[0]&&e.label<h[1])e.label=h[1],h=b;else if(h&&e.label<h[2])e.label=h[2],e.ops.push(b);else{h[2]&&e.ops.pop();e.trys.pop();continue}}b=a.call(c,e)}catch(q){b=[6,q],g=0}finally{f=h=0}if(b[0]&5)throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}var e={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},
|
||
|
trys:[],ops:[]},f,g,h,k;return k={next:b(0),"throw":b(1),"return":b(2)},"function"===typeof Symbol&&(k[Symbol.iterator]=function(){return this}),k}function rc(c){var a="function"===typeof Symbol&&c[Symbol.iterator],b=0;return a?a.call(c):{next:function(){c&&b>=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||0<a--)&&!(d=c.next()).done;)e.push(d.value)}catch(g){var f=
|
||
|
{error:g}}finally{try{d&&!d.done&&(b=c["return"])&&b.call(c)}finally{if(f)throw f.error;}}return e}function Jf(){for(var c=[],a=0;a<arguments.length;a++)c=c.concat(If(arguments[a]));return c}function Q(c){return c&&c.__esModule&&Object.prototype.hasOwnProperty.call(c,"default")?c["default"]:c}function K(c,a){return a={exports:{}},c(a,a.exports),a.exports}function Ad(){sc=!0;for(var c=0;64>c;++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<b;e+=3)a=(c[e]<<16)+(c[e+1]<<8)+c[e+2],d.push(R[a>>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;f<g;f+=16383)e.push(Kf(c,f,f+16383>g?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<<f)-1,h=g>>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;b=256*b+c[a+e],e+=t,k-=8);f=b&(1<<-k)-1;b>>=-k;for(k+=d;0<k;f=256*f+c[a+e],e+=t,k-=8);if(0===b)b=1-h;else{if(b===g)return f?NaN:Infinity*(q?-1:1);f+=Math.pow(2,d);b-=h}return(q?-1:1)*f*Math.pow(2,b-d)}function Hb(c,a,b,d,e,f){var g,h=8*f-e-1,k=(1<<h)-1,t=k>>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<<e|a;for(h+=e;0<h;c[b+f]=d&255,f+=A,d/=256,h-=8);c[b+f-A]|=128*r}function ja(c,a){if((l.TYPED_ARRAY_SUPPORT?2147483647:1073741823)<a)throw new RangeError("Invalid typed array length");l.TYPED_ARRAY_SUPPORT?(c=new Uint8Array(a),c.__proto__=l.prototype):(null===c&&(c=
|
||
|
new l(a)),c.length=a);return c}function l(c,a,b){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(c,a,b);if("number"===typeof c){if("string"===typeof a)throw Error("If encoding is specified then the first argument must be a string");return tc(this,c)}return Cd(this,c,a,b)}function Cd(c,a,b,d){if("number"===typeof a)throw new TypeError('"value" argument must not be a number');if("undefined"!==typeof ArrayBuffer&&a instanceof ArrayBuffer){a.byteLength;if(0>b||a.byteLength<b)throw new RangeError("'offset' is out of bounds");
|
||
|
if(a.byteLength<b+(d||0))throw new RangeError("'length' is out of bounds");a=void 0===b&&void 0===d?new Uint8Array(a):void 0===d?new Uint8Array(a,b):new Uint8Array(a,b,d);l.TYPED_ARRAY_SUPPORT?(c=a,c.__proto__=l.prototype):c=uc(c,a);return c}if("string"===typeof a){d=c;c=b;if("string"!==typeof c||""===c)c="utf8";if(!l.isEncoding(c))throw new TypeError('"encoding" must be a valid string encoding');b=Dd(a,c)|0;d=ja(d,b);a=d.write(a,c);a!==b&&(d=d.slice(0,a));return d}return Lf(c,a)}function Ed(c){if("number"!==
|
||
|
typeof c)throw new TypeError('"size" argument must be a number');if(0>c)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;b<a;++b)c[b]=0;return c}function uc(c,a){var b=0>a.length?0:vc(a.length)|0;c=ja(c,b);for(var d=0;d<b;d+=1)c[d]=a[d]&255;return c}function Lf(c,a){if(W(a)){var b=vc(a.length)|0;c=ja(c,b);if(0===c.length)return c;a.copy(c,0,0,b);return c}if(a){if("undefined"!==typeof ArrayBuffer&&a.buffer instanceof
|
||
|
ArrayBuffer||"length"in a)return(b="number"!==typeof a.length)||(b=a.length,b=b!==b),b?ja(c,0):uc(c,a);if("Buffer"===a.type&&Fd(a.data))return uc(c,a.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.");}function vc(c){if(c>=(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;b<a;++b)c=d,d=this[b],d=16>d?"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);a<b;++a)c+=String.fromCharCode(this[a]&127);return c;case "latin1":case "binary":c="";for(b=Math.min(this.length,b);a<b;++a)c+=String.fromCharCode(this[a]);return c;case "base64":return a=0===a&&b===this.length?Bd(this):Bd(this.slice(a,b)),a;case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":a=this.slice(a,b);b="";for(c=0;c<a.length;c+=2)b+=String.fromCharCode(a[c]+256*a[c+1]);return b;default:if(d)throw new TypeError("Unknown encoding: "+c);c=(c+"").toLowerCase();d=!0}}function Ga(c,a,b){var d=
|
||
|
c[a];c[a]=c[b];c[b]=d}function Id(c,a,b,d,e){if(0===c.length)return-1;"string"===typeof b?(d=b,b=0):2147483647<b?b=2147483647:-2147483648>b&&(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;b<h;b++)if(f(c,b)===f(a,-1===d?0:b-d)){if(-1===d&&(d=b),b-d+1===k)return d*g}else-1!==d&&(b-=b-d),d=
|
||
|
-1;else for(b+k>h&&(b=h-k);0<=b;b--){h=!0;for(d=0;d<k;d++)if(f(c,b+d)!==f(a,d)){h=!1;break}if(h)return b}return-1}function Hd(c,a,b){b=Math.min(c.length,b);for(var d=[];a<b;){var e=c[a],f=null,g=239<e?4:223<e?3:191<e?2:1;if(a+g<=b)switch(g){case 1:128>e&&(f=e);break;case 2:var h=c[a+1];128===(h&192)&&(e=(e&31)<<6|h&63,127<e&&(f=e));break;case 3:h=c[a+1];var k=c[a+2];128===(h&192)&&128===(k&192)&&(e=(e&15)<<12|(h&63)<<6|k&63,2047<e&&(55296>e||57343<e)&&(f=e));break;case 4:h=c[a+1];k=c[a+2];var t=c[a+
|
||
|
3];128===(h&192)&&128===(k&192)&&128===(t&192)&&(e=(e&15)<<18|(h&63)<<12|(k&63)<<6|t&63,65535<e&&1114112>e&&(f=e))}null===f?(f=65533,g=1):65535<f&&(f-=65536,d.push(f>>>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;a<c;)b+=String.fromCharCode.apply(String,d.slice(a,a+=Kd));d=b}return d}function D(c,a,b){if(0!==c%1||0>c)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||a<f)throw new RangeError('"value" argument is out of bounds');if(b+d>c.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<f;++e)c[b+e]=(a&255<<8*(d?e:1-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<f;++e)c[b+e]=a>>>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;g<d;++g){b=c.charCodeAt(g);if(55295<b&&57344>b){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 Ld(c){for(var a=[],b=0;b<c.length;++b)a.push(c.charCodeAt(b)&255);return a}function Gd(c){c=(c.trim?c.trim():c.replace(/^\s+|\s+$/g,"")).replace(Nf,"");if(2>c.length)c="";else for(;0!==c.length%4;)c+="=";sc||Ad();
|
||
|
var a=c.length;if(0<a%4)throw Error("Invalid string. Length must be a multiple of 4");var b="="===c[a-2]?2:"="===c[a-1]?1:0,d=new Of(3*a/4-b),e=0<b?a-4:a,f=0;for(a=0;a<e;a+=4){var g=H[c.charCodeAt(a)]<<18|H[c.charCodeAt(a+1)]<<12|H[c.charCodeAt(a+2)]<<6|H[c.charCodeAt(a+3)];d[f++]=g>>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<d&&!(e+b>=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<a;)Ha&&Ha[Mb].run();Mb=-1;a=ka.length}Ha=null;Ua=!1;Pf(c)}}function X(c){var a=Array(arguments.length-1);if(1<arguments.length)for(var b=1;b<arguments.length;b++)a[b-1]=arguments[b];ka.push(new Rd(c,a));1!==ka.length||Ua||Pd(Qd)}function Rd(c,a){this.fun=c;this.array=a}function Ia(){}function wc(c){if(!Ja(c)){for(var a=[],b=0;b<arguments.length;b++)a.push(aa(arguments[b]));return a.join(" ")}b=1;var d=arguments,e=d.length;a=String(c).replace(Rf,function(a){if("%%"===
|
||
|
a)return"%";if(b>=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];b<e;f=d[++b])a=null!==f&&wa(f)?a+(" "+aa(f)):a+(" "+f);return a}function xc(c,a){if(la(Ka.process))return function(){return xc(c,a).apply(this,arguments)};if(!0===Va.noDeprecation)return c;var b=!1;return function(){if(!b){if(Va.throwDeprecation)throw Error(a);Va.traceDeprecation?console.trace(a):
|
||
|
console.error(a);b=!0}return c.apply(this,arguments)}}function Sd(c){la(yc)&&(yc=Va.env.NODE_DEBUG||"");c=c.toUpperCase();Nb[c]||((new RegExp("\\b"+c+"\\b","i")).test(yc)?Nb[c]=function(){var a=wc.apply(null,arguments);console.error("%s %d: %s",c,0,a)}:Nb[c]=function(){});return Nb[c]}function aa(c,a){var b={seen:[],stylize:Sf};3<=arguments.length&&(b.depth=arguments[2]);4<=arguments.length&&(b.colors=arguments[3]);zc(a)?b.showHidden=a:a&&Td(b,a);la(b.showHidden)&&(b.showHidden=!1);la(b.depth)&&(b.depth=
|
||
|
2);la(b.colors)&&(b.colors=!1);la(b.customInspect)&&(b.customInspect=!0);b.colors&&(b.stylize=Tf);return Ob(b,c,b.depth)}function Tf(c,a){return(a=aa.styles[a])?"\u001b["+aa.colors[a][0]+"m"+c+"\u001b["+aa.colors[a][1]+"m":c}function Sf(c){return c}function Uf(c){var a={};c.forEach(function(c){a[c]=!0});return a}function Ob(c,a,b){if(c.customInspect&&a&&Wa(a.inspect)&&a.inspect!==aa&&(!a.constructor||a.constructor.prototype!==a)){var d=a.inspect(b,c);Ja(d)||(d=Ob(c,d,b));return d}if(d=Vf(c,a))return d;
|
||
|
var e=Object.keys(a),f=Uf(e);c.showHidden&&(e=Object.getOwnPropertyNames(a));if(ob(a)&&(0<=e.indexOf("message")||0<=e.indexOf("description")))return Ac(a);if(0===e.length){if(Wa(a))return c.stylize("[Function"+(a.name?": "+a.name:"")+"]","special");if(Xa(a))return c.stylize(RegExp.prototype.toString.call(a),"regexp");if(pb(a))return c.stylize(Date.prototype.toString.call(a),"date");if(ob(a))return Ac(a)}d="";var g=!1,h=["{","}"];Ud(a)&&(g=!0,h=["[","]"]);Wa(a)&&(d=" [Function"+(a.name?": "+a.name:
|
||
|
"")+"]");Xa(a)&&(d=" "+RegExp.prototype.toString.call(a));pb(a)&&(d=" "+Date.prototype.toUTCString.call(a));ob(a)&&(d=" "+Ac(a));if(0===e.length&&(!g||0==a.length))return h[0]+d+h[1];if(0>b)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;g<h;++g)Object.prototype.hasOwnProperty.call(a,String(g))?f.push(Bc(c,a,b,d,String(g),!0)):f.push("");e.forEach(function(e){e.match(/^\d+$/)||f.push(Bc(c,a,b,d,e,!0))});return f}function Bc(c,
|
||
|
a,b,d,e,f){var g,h;a=Object.getOwnPropertyDescriptor(a,e)||{value:a[e]};a.get?h=a.set?c.stylize("[Getter/Setter]","special"):c.stylize("[Getter]","special"):a.set&&(h=c.stylize("[Setter]","special"));Object.prototype.hasOwnProperty.call(d,e)||(g="["+e+"]");h||(0>c.seen.indexOf(a.value)?(h=null===b?Ob(c,a.value,null):Ob(c,a.value,b-1),-1<h.indexOf("\n")&&(h=f?h.split("\n").map(function(a){return" "+a}).join("\n").substr(2):"\n"+h.split("\n").map(function(a){return" "+a}).join("\n"))):h=c.stylize("[Circular]",
|
||
|
"special"));if(la(g)){if(f&&e.match(/^\d+$/))return h;g=JSON.stringify(""+e);g.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(g=g.substr(1,g.length-2),g=c.stylize(g,"name")):(g=g.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),g=c.stylize(g,"string"))}return g+": "+h}function Xf(c,a,b){return 60<c.reduce(function(a,c){c.indexOf("\n");return a+c.replace(/\u001b\[\d\d?m/g,"").length+1},0)?b[0]+(""===a?"":a+"\n ")+" "+c.join(",\n ")+" "+b[1]:b[0]+a+" "+c.join(", ")+" "+b[1]}function Ud(c){return Array.isArray(c)}
|
||
|
function zc(c){return"boolean"===typeof c}function Vd(c){return"number"===typeof c}function Ja(c){return"string"===typeof c}function la(c){return void 0===c}function Xa(c){return wa(c)&&"[object RegExp]"===Object.prototype.toString.call(c)}function wa(c){return"object"===typeof c&&null!==c}function pb(c){return wa(c)&&"[object Date]"===Object.prototype.toString.call(c)}function ob(c){return wa(c)&&("[object Error]"===Object.prototype.toString.call(c)||c instanceof Error)}function Wa(c){return"function"===
|
||
|
typeof c}function Cc(c){return null===c||"boolean"===typeof c||"number"===typeof c||"string"===typeof c||"symbol"===typeof c||"undefined"===typeof c}function Dc(c){return 10>c?"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);e<f;++e)if(c[e]!==a[e]){b=c[e];d=a[e];break}return b<d?-1:d<b?1:0}function Xd(){return"undefined"!==typeof Ec?Ec:Ec=function(){return"foo"===function(){}.name}()}function Yd(c){return pa(c)||"function"!==typeof Ka.ArrayBuffer?!1:"function"===typeof ArrayBuffer.isView?ArrayBuffer.isView(c):c?c instanceof DataView||c.buffer&&c.buffer instanceof ArrayBuffer?!0:!1:!1}function E(c,a){c||S(c,!0,a,"==",Fc)}function Zd(c){if(Wa(c))return Xd()?c.name:(c=c.toString().match($f))&&
|
||
|
c[1]}function Gc(c){this.name="AssertionError";this.actual=c.actual;this.expected=c.expected;this.operator=c.operator;c.message?(this.message=c.message,this.generatedMessage=!1):(this.message=$d(ae(this.actual),128)+" "+this.operator+" "+$d(ae(this.expected),128),this.generatedMessage=!0);var a=c.stackStartFunction||S;Error.captureStackTrace?Error.captureStackTrace(this,a):(c=Error(),c.stack&&(c=c.stack,a=Zd(a),a=c.indexOf("\n"+a),0<=a&&(a=c.indexOf("\n",a+1),c=c.substring(a+1)),this.stack=c))}function $d(c,
|
||
|
a){return"string"===typeof c?c.length<a?c:c.slice(0,a):c}function ae(c){if(Xd()||!Wa(c))return aa(c);c=Zd(c);return"[Function"+(c?": "+c:"")+"]"}function S(c,a,b,d,e){throw new Gc({message:b,actual:c,expected:a,operator:d,stackStartFunction:e});}function Fc(c,a){c||S(c,!0,a,"==",Fc)}function be(c,a,b){c!=a&&S(c,a,b,"==",be)}function ce(c,a,b){c==a&&S(c,a,b,"!=",ce)}function de(c,a,b){Ya(c,a,!1)||S(c,a,b,"deepEqual",de)}function ee(c,a,b){Ya(c,a,!0)||S(c,a,b,"deepStrictEqual",ee)}function Ya(c,a,b,
|
||
|
d){if(c===a)return!0;if(pa(c)&&pa(a))return 0===Wd(c,a);if(pb(c)&&pb(a))return c.getTime()===a.getTime();if(Xa(c)&&Xa(a))return c.source===a.source&&c.global===a.global&&c.multiline===a.multiline&&c.lastIndex===a.lastIndex&&c.ignoreCase===a.ignoreCase;if(null!==c&&"object"===typeof c||null!==a&&"object"===typeof a){if(!Yd(c)||!Yd(a)||Object.prototype.toString.call(c)!==Object.prototype.toString.call(a)||c instanceof Float32Array||c instanceof Float64Array){if(pa(c)!==pa(a))return!1;d=d||{actual:[],
|
||
|
expected:[]};var e=d.actual.indexOf(c);if(-1!==e&&e===d.expected.indexOf(a))return!0;d.actual.push(c);d.expected.push(a);return ag(c,a,b,d)}return 0===Wd(new Uint8Array(c.buffer),new Uint8Array(a.buffer))}return b?c===a:c==a}function ag(c,a,b,d){if(null===c||void 0===c||null===a||void 0===a)return!1;if(Cc(c)||Cc(a))return c===a;if(b&&Object.getPrototypeOf(c)!==Object.getPrototypeOf(a))return!1;var e="[object Arguments]"==Object.prototype.toString.call(c),f="[object Arguments]"==Object.prototype.toString.call(a);
|
||
|
if(e&&!f||!e&&f)return!1;if(e)return c=fe.call(c),a=fe.call(a),Ya(c,a,b);e=ge(c);var g=ge(a);if(e.length!==g.length)return!1;e.sort();g.sort();for(f=e.length-1;0<=f;f--)if(e[f]!==g[f])return!1;for(f=e.length-1;0<=f;f--)if(g=e[f],!Ya(c[g],a[g],b,d))return!1;return!0}function he(c,a,b){Ya(c,a,!1)&&S(c,a,b,"notDeepEqual",he)}function ie(c,a,b){Ya(c,a,!0)&&S(c,a,b,"notDeepStrictEqual",ie)}function je(c,a,b){c!==a&&S(c,a,b,"===",je)}function ke(c,a,b){c===a&&S(c,a,b,"!==",ke)}function le(c,a){if(!c||!a)return!1;
|
||
|
if("[object RegExp]"==Object.prototype.toString.call(a))return a.test(c);try{if(c instanceof a)return!0}catch(b){}return Error.isPrototypeOf(a)?!1:!0===a.call({},c)}function me(c,a,b,d){if("function"!==typeof a)throw new TypeError('"block" argument must be a function');"string"===typeof b&&(d=b,b=null);try{a()}catch(h){var e=h}a=e;d=(b&&b.name?" ("+b.name+").":".")+(d?" "+d:".");c&&!a&&S(a,b,"Missing expected exception"+d);e="string"===typeof d;var f=!c&&ob(a),g=!c&&a&&!b;(f&&e&&le(a,b)||g)&&S(a,
|
||
|
b,"Got unwanted exception"+d);if(c&&a&&b&&!le(a,b)||!c&&a)throw a;}function bg(c,a){for(var b=0,d=c.length-1;0<=d;d--){var e=c[d];"."===e?c.splice(d,1):".."===e?(c.splice(d,1),b++):b&&(c.splice(d,1),b--)}if(a)for(;b--;b)c.unshift("..");return c}function Hc(){for(var c="",a=!1,b=arguments.length-1;-1<=b&&!a;b--){var d=0<=b?arguments[b]:"/";if("string"!==typeof d)throw new TypeError("Arguments to path.resolve must be strings");d&&(c=d+"/"+c,a="/"===d.charAt(0))}c=bg(cg(c.split("/"),function(a){return!!a}),
|
||
|
!a).join("/");return(a?"/":"")+c||"."}function Pb(c,a){function b(a){for(var c=0;c<a.length&&""===a[c];c++);for(var b=a.length-1;0<=b&&""===a[b];b--);return c>b?[]: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;f<d;f++)if(c[f]!==a[f]){e=f;break}d=[];for(f=e;f<c.length;f++)d.push("..");d=d.concat(a.slice(e));return d.join("/")}function cg(c,a){if(c.filter)return c.filter(a);for(var b=[],d=0;d<c.length;d++)a(c[d],
|
||
|
d,c)&&b.push(c[d]);return b}function qa(){}function x(){x.init.call(this)}function ne(c,a,b,d){var e;if("function"!==typeof b)throw new TypeError('"listener" argument must be a function');if(e=c._events){e.newListener&&(c.emit("newListener",a,b.listener?b.listener:b),e=c._events);var f=e[a]}else e=c._events=new qa,c._eventsCount=0;f?("function"===typeof f?f=e[a]=d?[b,f]:[f,b]:d?f.unshift(b):f.push(b),f.warned||(b=void 0===c._maxListeners?x.defaultMaxListeners:c._maxListeners)&&0<b&&f.length>b&&(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<b.length)if(a.ended&&!e)c.emit("error",Error("stream.push() after EOF"));else if(a.endEmitted&&e)c.emit("error",Error("stream.unshift() after end event"));else{if(a.decoder&&!e&&!d){b=a.decoder.write(b);var h=!a.objectMode&&0===b.length}e||(a.reading=!1);h||(a.flowing&&0===a.length&&!a.sync?(c.emit("data",b),c.read(0)):(a.length+=a.objectMode?1:b.length,
|
||
|
e?a.buffer.unshift(b):a.buffer.push(b),a.needReadable&&Qb(c)));a.readingMore||(a.readingMore=!0,X(ig,c,a))}else e||(a.reading=!1);return!a.ended&&(a.needReadable||a.length<a.highWaterMark||0===a.length)}function se(c,a){if(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.highWaterMark&&(z("maybeReadMore read 0"),c.read(0),b!==a.length);)b=a.length;a.readingMore=!1}function jg(c){return function(){var a=c._readableState;z("pipeOnDrain",a.awaitDrain);
|
||
|
a.awaitDrain&&a.awaitDrain--;0===a.awaitDrain&&c.listeners("data").length&&(a.flowing=!0,Ic(c))}}function kg(c){z("readable nexttick read 0");c.read(0)}function lg(c,a){a.reading||(z("resume read 0"),c.read(0));a.resumeScheduled=!1;a.awaitDrain=0;c.emit("resume");Ic(c);a.flowing&&!a.reading&&c.read(0)}function Ic(c){var a=c._readableState;for(z("flow",a.flowing);a.flowing&&null!==c.read(););}function ue(c,a){if(0===a.length)return null;if(a.objectMode)var b=a.buffer.shift();else if(!c||c>=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(c<b.head.data.length)a=b.head.data.slice(0,c),b.head.data=b.head.data.slice(c);else{if(c===b.head.data.length)b=b.shift();else if(a){a=b.head;var d=1,e=a.data;for(c-=e.length;a=a.next;){var f=a.data,g=c>f.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(0<a.length)throw Error('"endReadable()" called on non-empty stream');a.endEmitted||(a.ended=!0,X(mg,a,c))}function mg(c,a){c.endEmitted||0!==c.length||(c.endEmitted=!0,a.readable=
|
||
|
!1,a.emit("end"))}function ng(c,a){for(var b=0,d=c.length;b<d;b++)a(c[b],b)}function ve(c,a){for(var b=0,d=c.length;b<d;b++)if(c[b]===a)return b;return-1}function og(){}function pg(c,a,b){this.chunk=c;this.encoding=a;this.callback=b;this.next=null}function Kc(c,a){Object.defineProperty(this,"buffer",{get:xc(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")});c=c||{};this.objectMode=!!c.objectMode;a instanceof U&&(this.objectMode=this.objectMode||
|
||
|
!!c.writableObjectMode);var b=c.highWaterMark,d=this.objectMode?16:16384;this.highWaterMark=b||0===b?b:d;this.highWaterMark=~~this.highWaterMark;this.finished=this.ended=this.ending=this.needDrain=!1;this.decodeStrings=!1!==c.decodeStrings;this.defaultEncoding=c.defaultEncoding||"utf8";this.length=0;this.writing=!1;this.corked=0;this.sync=!0;this.bufferProcessing=!1;this.onwrite=function(c){var b=a._writableState,d=b.sync,e=b.writecb;b.writing=!1;b.writecb=null;b.length-=b.writelen;b.writelen=0;c?
|
||
|
(--b.pendingcb,d?X(e,c):e(c),a._writableState.errorEmitted=!0,a.emit("error",c)):((c=we(b))||b.corked||b.bufferProcessing||!b.bufferedRequest||xe(a,b),d?X(ye,a,b,c,e):ye(a,b,c,e))};this.writecb=null;this.writelen=0;this.lastBufferedRequest=this.bufferedRequest=null;this.pendingcb=0;this.errorEmitted=this.prefinished=!1;this.bufferedRequestCount=0;this.corkedRequestsFree=new ze(this)}function L(c){if(!(this instanceof L||this instanceof U))return new L(c);this._writableState=new Kc(c,this);this.writable=
|
||
|
!0;c&&("function"===typeof c.write&&(this._write=c.write),"function"===typeof c.writev&&(this._writev=c.writev));x.call(this)}function Lc(c,a,b,d,e,f,g){a.writelen=d;a.writecb=g;a.writing=!0;a.sync=!0;b?c._writev(e,a.onwrite):c._write(e,f,a.onwrite);a.sync=!1}function ye(c,a,b,d){!b&&0===a.length&&a.needDrain&&(a.needDrain=!1,c.emit("drain"));a.pendingcb--;d();Ae(c,a)}function xe(c,a){a.bufferProcessing=!0;var b=a.bufferedRequest;if(c._writev&&b&&b.next){var d=Array(a.bufferedRequestCount),e=a.corkedRequestsFree;
|
||
|
e.entry=b;for(var f=0;b;)d[f]=b,b=b.next,f+=1;Lc(c,a,!0,a.length,d,"",e.finish);a.pendingcb++;a.lastBufferedRequest=null;e.next?(a.corkedRequestsFree=e.next,e.next=null):a.corkedRequestsFree=new ze(a)}else{for(;b&&(d=b.chunk,Lc(c,a,!1,a.objectMode?1:d.length,d,b.encoding,b.callback),b=b.next,!a.writing););null===b&&(a.lastBufferedRequest=null)}a.bufferedRequestCount=0;a.bufferedRequest=b;a.bufferProcessing=!1}function we(c){return c.ending&&0===c.length&&null===c.bufferedRequest&&!c.finished&&!c.writing}
|
||
|
function Ae(c,a){var b=we(a);b&&(0===a.pendingcb?(a.prefinished||(a.prefinished=!0,c.emit("prefinish")),a.finished=!0,c.emit("finish")):a.prefinished||(a.prefinished=!0,c.emit("prefinish")));return b}function ze(c){var a=this;this.entry=this.next=null;this.finish=function(b){var d=a.entry;for(a.entry=null;d;){var e=d.callback;c.pendingcb--;e(b);d=d.next}c.corkedRequestsFree?c.corkedRequestsFree.next=a:c.corkedRequestsFree=a}}function U(c){if(!(this instanceof U))return new U(c);y.call(this,c);L.call(this,
|
||
|
c);c&&!1===c.readable&&(this.readable=!1);c&&!1===c.writable&&(this.writable=!1);this.allowHalfOpen=!0;c&&!1===c.allowHalfOpen&&(this.allowHalfOpen=!1);this.once("end",qg)}function qg(){this.allowHalfOpen||this._writableState.ended||X(rg,this)}function rg(c){c.end()}function sg(c){this.afterTransform=function(a,b){var d=c._transformState;d.transforming=!1;var e=d.writecb;e?(d.writechunk=null,d.writecb=null,null!==b&&void 0!==b&&c.push(b),e(a),a=c._readableState,a.reading=!1,(a.needReadable||a.length<
|
||
|
a.highWaterMark)&&c._read(a.highWaterMark),a=void 0):a=c.emit("error",Error("no writecb in Transform class"));return a};this.transforming=this.needTransform=!1;this.writeencoding=this.writechunk=this.writecb=null}function ba(c){if(!(this instanceof ba))return new ba(c);U.call(this,c);this._transformState=new sg(this);var a=this;this._readableState.needReadable=!0;this._readableState.sync=!1;c&&("function"===typeof c.transform&&(this._transform=c.transform),"function"===typeof c.flush&&(this._flush=
|
||
|
c.flush));this.once("prefinish",function(){"function"===typeof this._flush?this._flush(function(c){Be(a,c)}):Be(a)})}function Be(c,a){if(a)return c.emit("error",a);a=c._transformState;if(c._writableState.length)throw Error("Calling transform done when ws.length != 0");if(a.transforming)throw Error("Calling transform done when still transforming");return c.push(null)}function sb(c){if(!(this instanceof sb))return new sb(c);ba.call(this,c)}function ca(){x.call(this)}function tg(c,a){var b=c.split("@"),
|
||
|
d="";1<b.length&&(d=b[0]+"@",c=b[1]);c=c.replace(ug,".");c=c.split(".");b=c.length;for(var e=[];b--;)e[b]=a(c[b]);a=e.join(".");return d+a}function Ce(c,a){return c+22+75*(26>c)-((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<c;){var g=a.charCodeAt(f++);if(55296<=g&&56319>=g&&f<c){var h=a.charCodeAt(f++);56320==(h&64512)?e.push(((g&1023)<<10)+(h&1023)+65536):(e.push(g),f--)}else e.push(g)}a=e;h=a.length;e=128;var k=0,t=72;for(g=0;g<h;++g){var q=
|
||
|
a[g];128>q&&d.push(Mc(q))}for((f=c=d.length)&&d.push("-");f<h;){var A=2147483647;for(g=0;g<h;++g)q=a[g],q>=e&&q<A&&(A=q);var r=f+1;if(A-e>Za((2147483647-k)/r))throw new RangeError(De.overflow);k+=(A-e)*r;e=A;for(g=0;g<h;++g){q=a[g];if(q<e&&2147483647<++k)throw new RangeError(De.overflow);if(q==e){var P=k;for(A=36;;A+=36){q=A<=t?1:A>=t+26?26:A-t;if(P<q)break;var p=P-q;P=36-q;d.push(Mc(Ce(q+p%P,0)));P=Za(p/P)}d.push(Mc(Ce(P,0)));t=r;A=0;k=f==c?Za(k/700):k>>1;for(k+=Za(k/t);455<k;A+=36)k=Za(k/35);t=
|
||
|
Za(A+36*k/(k+38));k=0;++f}}++k;++e}d="xn--"+d.join("")}else d=a;return d})}function tb(c){switch(typeof c){case "string":return c;case "boolean":return c?"true":"false";case "number":return isFinite(c)?c:"";default:return""}}function xg(c,a,b,d){a=a||"&";b=b||"=";null===c&&(c=void 0);return"object"===typeof c?Ee(yg(c),function(d){var e=encodeURIComponent(tb(d))+b;return Fe(c[d])?Ee(c[d],function(a){return e+encodeURIComponent(tb(a))}).join(a):e+encodeURIComponent(tb(c[d]))}).join(a):d?encodeURIComponent(tb(d))+
|
||
|
b+encodeURIComponent(tb(c)):""}function Ee(c,a){if(c.map)return c.map(a);for(var b=[],d=0;d<c.length;d++)b.push(a(c[d],d));return b}function Ge(c,a,b,d){b=b||"=";var e={};if("string"!==typeof c||0===c.length)return e;var f=/\+/g;c=c.split(a||"&");a=1E3;d&&"number"===typeof d.maxKeys&&(a=d.maxKeys);d=c.length;0<a&&d>a&&(d=a);for(a=0;a<d;++a){var g=c[a].replace(f,"%20"),h=g.indexOf(b);if(0<=h){var k=g.substr(0,h);g=g.substr(h+1)}else k=g,g="";k=decodeURIComponent(k);g=decodeURIComponent(g);Object.prototype.hasOwnProperty.call(e,
|
||
|
k)?Fe(e[k])?e[k].push(g):e[k]=[e[k],g]:e[k]=g}return e}function da(){this.href=this.path=this.pathname=this.query=this.search=this.hash=this.hostname=this.port=this.host=this.auth=this.slashes=this.protocol=null}function Rb(c,a,b){if(c&&wa(c)&&c instanceof da)return c;var d=new da;d.parse(c,a,b);return d}function He(c,a,b,d){if(!Ja(a))throw new TypeError("Parameter 'url' must be a string, not "+typeof a);var e=a.indexOf("?");e=-1!==e&&e<a.indexOf("#")?"?":"#";a=a.split(e);a[0]=a[0].replace(/\\/g,
|
||
|
"/");a=a.join(e);e=a.trim();if(!d&&1===a.split("#").length&&(a=zg.exec(e)))return c.path=e,c.href=e,c.pathname=a[1],a[2]?(c.search=a[2],c.query=b?Ge(c.search.substr(1)):c.search.substr(1)):b&&(c.search="",c.query={}),c;if(a=Ag.exec(e)){a=a[0];var f=a.toLowerCase();c.protocol=f;e=e.substr(a.length)}if(d||a||e.match(/^\/\/[^@\/]+@[^@\/]+/)){var g="//"===e.substr(0,2);!g||a&&Nc[a]||(e=e.substr(2),c.slashes=!0)}if(!Nc[a]&&(g||a&&!$a[a])){a=-1;for(d=0;d<Ie.length;d++)g=e.indexOf(Ie[d]),-1!==g&&(-1===a||
|
||
|
g<a)&&(a=g);g=-1===a?e.lastIndexOf("@"):e.lastIndexOf("@",a);-1!==g&&(d=e.slice(0,g),e=e.slice(g+1),c.auth=decodeURIComponent(d));a=-1;for(d=0;d<Je.length;d++)g=e.indexOf(Je[d]),-1!==g&&(-1===a||g<a)&&(a=g);-1===a&&(a=e.length);c.host=e.slice(0,a);e=e.slice(a);Ke(c);c.hostname=c.hostname||"";g="["===c.hostname[0]&&"]"===c.hostname[c.hostname.length-1];if(!g){var h=c.hostname.split(/\./);d=0;for(a=h.length;d<a;d++){var k=h[d];if(k&&!k.match(Le)){for(var t="",q=0,A=k.length;q<A;q++)t=127<k.charCodeAt(q)?
|
||
|
t+"x":t+k[q];if(!t.match(Le)){a=h.slice(0,d);d=h.slice(d+1);if(k=k.match(Bg))a.push(k[1]),d.unshift(k[2]);d.length&&(e="/"+d.join(".")+e);c.hostname=a.join(".");break}}}}c.hostname=c.hostname.length>Cg?"":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<a;d++)g=Oc[d],-1!==e.indexOf(g)&&(k=encodeURIComponent(g),k===g&&
|
||
|
(k=escape(g)),e=e.split(g).join(k));d=e.indexOf("#");-1!==d&&(c.hash=e.substr(d),e=e.slice(0,d));d=e.indexOf("?");-1!==d?(c.search=e.substr(d),c.query=e.substr(d+1),b&&(c.query=Ge(c.query)),e=e.slice(0,d)):b&&(c.search="",c.query={});e&&(c.pathname=e);$a[f]&&c.hostname&&!c.pathname&&(c.pathname="/");if(c.pathname||c.search)d=c.pathname||"",c.path=d+(c.search||"");c.href=Pc(c);return c}function Pc(c){var a=c.auth||"";a&&(a=encodeURIComponent(a),a=a.replace(/%3A/i,":"),a+="@");var b=c.protocol||"",
|
||
|
d=c.pathname||"",e=c.hash||"",f=!1,g="";c.host?f=a+c.host:c.hostname&&(f=a+(-1===c.hostname.indexOf(":")?c.hostname:"["+this.hostname+"]"),c.port&&(f+=":"+c.port));c.query&&wa(c.query)&&Object.keys(c.query).length&&(g=xg(c.query));a=c.search||g&&"?"+g||"";b&&":"!==b.substr(-1)&&(b+=":");c.slashes||(!b||$a[b])&&!1!==f?(f="//"+(f||""),d&&"/"!==d.charAt(0)&&(d="/"+d)):f||(f="");e&&"#"!==e.charAt(0)&&(e="#"+e);a&&"?"!==a.charAt(0)&&(a="?"+a);d=d.replace(/[?#]/g,function(a){return encodeURIComponent(a)});
|
||
|
a=a.replace("#","%23");return b+f+d+a+e}function Ke(c){var a=c.host,b=Eg.exec(a);b&&(b=b[0],":"!==b&&(c.port=b.substr(1)),a=a.substr(0,a.length-b.length));a&&(c.hostname=a)}function Qc(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)}function Rc(c,a){function b(){this.constructor=c}Qc(c,a);c.prototype=null===a?Object.create(a):(b.prototype=a.prototype,new b)}function Sb(c){var a=
|
||
|
"function"===typeof Symbol&&c[Symbol.iterator],b=0;return a?a.call(c):{next:function(){c&&b>=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||0<a--)&&!(d=c.next()).done;)e.push(d.value)}catch(g){var f={error:g}}finally{try{d&&!d.done&&(b=c["return"])&&b.call(c)}finally{if(f)throw f.error;}}return e}function Ub(){for(var c=[],a=0;a<arguments.length;a++)c=c.concat(Tb(arguments[a]));
|
||
|
return c}function Me(){Sc=!0;for(var c=0;64>c;++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<b;e+=3)a=(c[e]<<16)+(c[e+1]<<8)+c[e+2],d.push(ea[a>>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;f<g;f+=16383)e.push(Fg(c,f,f+16383>g?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<<f)-1,h=g>>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;b=256*b+c[a+e],e+=t,k-=8);f=b&(1<<-k)-1;b>>=-k;for(k+=d;0<k;f=256*f+c[a+e],e+=t,k-=8);if(0===b)b=1-h;else{if(b===g)return f?NaN:Infinity*(q?-1:1);f+=Math.pow(2,d);b-=h}return(q?-1:1)*f*Math.pow(2,b-d)}function Wb(c,
|
||
|
a,b,d,e,f){var g,h=8*f-e-1,k=(1<<h)-1,t=k>>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<<e|a;for(h+=e;0<h;c[b+f]=d&255,f+=A,d/=256,
|
||
|
h-=8);c[b+f-A]|=128*r}function ma(c,a){if((m.TYPED_ARRAY_SUPPORT?2147483647:1073741823)<a)throw new RangeError("Invalid typed array length");m.TYPED_ARRAY_SUPPORT?(c=new Uint8Array(a),c.__proto__=m.prototype):(null===c&&(c=new m(a)),c.length=a);return c}function m(c,a,b){if(!(m.TYPED_ARRAY_SUPPORT||this instanceof m))return new m(c,a,b);if("number"===typeof c){if("string"===typeof a)throw Error("If encoding is specified then the first argument must be a string");return Tc(this,c)}return Oe(this,c,
|
||
|
a,b)}function Oe(c,a,b,d){if("number"===typeof a)throw new TypeError('"value" argument must not be a number');if("undefined"!==typeof ArrayBuffer&&a instanceof ArrayBuffer){a.byteLength;if(0>b||a.byteLength<b)throw new RangeError("'offset' is out of bounds");if(a.byteLength<b+(d||0))throw new RangeError("'length' is out of bounds");a=void 0===b&&void 0===d?new Uint8Array(a):void 0===d?new Uint8Array(a,b):new Uint8Array(a,b,d);m.TYPED_ARRAY_SUPPORT?(c=a,c.__proto__=m.prototype):c=Uc(c,a);return c}if("string"===
|
||
|
typeof a){d=c;c=b;if("string"!==typeof c||""===c)c="utf8";if(!m.isEncoding(c))throw new TypeError('"encoding" must be a valid string encoding');b=Pe(a,c)|0;d=ma(d,b);a=d.write(a,c);a!==b&&(d=d.slice(0,a));return d}return Gg(c,a)}function Qe(c){if("number"!==typeof c)throw new TypeError('"size" argument must be a number');if(0>c)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;b<a;++b)c[b]=0;return c}function Uc(c,
|
||
|
a){var b=0>a.length?0:Vc(a.length)|0;c=ma(c,b);for(var d=0;d<b;d+=1)c[d]=a[d]&255;return c}function Gg(c,a){if(fa(a)){var b=Vc(a.length)|0;c=ma(c,b);if(0===c.length)return c;a.copy(c,0,0,b);return c}if(a){if("undefined"!==typeof ArrayBuffer&&a.buffer instanceof ArrayBuffer||"length"in a)return(b="number"!==typeof a.length)||(b=a.length,b=b!==b),b?ma(c,0):Uc(c,a);if("Buffer"===a.type&&Re(a.data))return Uc(c,a.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.");
|
||
|
}function Vc(c){if(c>=(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;b<a;++b)c=d,d=this[b],d=16>d?"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);a<b;++a)c+=String.fromCharCode(this[a]&127);return c;case "latin1":case "binary":c="";for(b=Math.min(this.length,b);a<b;++a)c+=String.fromCharCode(this[a]);return c;case "base64":return a=0===a&&b===this.length?Ne(this):
|
||
|
Ne(this.slice(a,b)),a;case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":a=this.slice(a,b);b="";for(c=0;c<a.length;c+=2)b+=String.fromCharCode(a[c]+256*a[c+1]);return b;default:if(d)throw new TypeError("Unknown encoding: "+c);c=(c+"").toLowerCase();d=!0}}function Ma(c,a,b){var d=c[a];c[a]=c[b];c[b]=d}function Ue(c,a,b,d,e){if(0===c.length)return-1;"string"===typeof b?(d=b,b=0):2147483647<b?b=2147483647:-2147483648>b&&(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;b<h;b++)if(f(c,b)===f(a,-1===d?0:b-d)){if(-1===d&&(d=b),b-d+1===k)return d*g}else-1!==d&&(b-=b-d),d=-1;else for(b+k>h&&(b=h-k);0<=b;b--){h=!0;for(d=0;d<k;d++)if(f(c,b+d)!==f(a,d)){h=!1;break}if(h)return b}return-1}function Te(c,a,b){b=Math.min(c.length,b);for(var d=[];a<b;){var e=c[a],f=null,g=239<e?
|
||
|
4:223<e?3:191<e?2:1;if(a+g<=b)switch(g){case 1:128>e&&(f=e);break;case 2:var h=c[a+1];128===(h&192)&&(e=(e&31)<<6|h&63,127<e&&(f=e));break;case 3:h=c[a+1];var k=c[a+2];128===(h&192)&&128===(k&192)&&(e=(e&15)<<12|(h&63)<<6|k&63,2047<e&&(55296>e||57343<e)&&(f=e));break;case 4:h=c[a+1];k=c[a+2];var t=c[a+3];128===(h&192)&&128===(k&192)&&128===(t&192)&&(e=(e&15)<<18|(h&63)<<12|(k&63)<<6|t&63,65535<e&&1114112>e&&(f=e))}null===f?(f=65533,g=1):65535<f&&(f-=65536,d.push(f>>>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;a<c;)b+=String.fromCharCode.apply(String,d.slice(a,a+=We));d=b}return d}function I(c,a,b){if(0!==c%1||0>c)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||a<f)throw new RangeError('"value" argument is out of bounds');if(b+d>c.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<f;++e)c[b+e]=(a&255<<8*(d?e:1-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<f;++e)c[b+e]=a>>>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;g<d;++g){b=c.charCodeAt(g);if(55295<b&&57344>b){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;b<c.length;++b)a.push(c.charCodeAt(b)&255);return a}function Se(c){c=(c.trim?c.trim():c.replace(/^\s+|\s+$/g,"")).replace(Ig,"");if(2>c.length)c="";else for(;0!==c.length%4;)c+="=";Sc||Me();var a=c.length;if(0<a%4)throw Error("Invalid string. Length must be a multiple of 4");var b="="===c[a-2]?2:"="===c[a-1]?1:0,d=new Jg(3*a/4-b),e=0<b?a-4:a,f=0;for(a=0;a<e;a+=4){var g=M[c.charCodeAt(a)]<<18|M[c.charCodeAt(a+1)]<<12|M[c.charCodeAt(a+2)]<<6|M[c.charCodeAt(a+
|
||
|
3)];d[f++]=g>>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<d&&!(e+b>=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=[];++ac<a;)Na&&Na[ac].run();ac=-1;a=sa.length}Na=null;ab=!1;Kg(c)}}function df(c){var a=Array(arguments.length-1);if(1<arguments.length)for(var b=1;b<arguments.length;b++)a[b-1]=arguments[b];
|
||
|
sa.push(new ef(c,a));1!==sa.length||ab||bf(cf)}function ef(c,a){this.fun=c;this.array=a}function Oa(){}function ha(c){if("string"!==typeof c)throw new TypeError("Path must be a string. Received "+JSON.stringify(c));}function ff(c,a){for(var b="",d=0,e=-1,f=0,g,h=0;h<=c.length;++h){if(h<c.length)g=c.charCodeAt(h);else if(47===g)break;else g=47;if(47===g){if(e!==h-1&&1!==f)if(e!==h-1&&2===f){if(2>b.length||2!==d||46!==b.charCodeAt(b.length-1)||46!==b.charCodeAt(b.length-2))if(2<b.length){if(e=b.lastIndexOf("/"),
|
||
|
e!==b.length-1){-1===e?(b="",d=0):(b=b.slice(0,e),d=b.length-1-b.lastIndexOf("/"));e=h;f=0;continue}}else if(2===b.length||1===b.length){b="";d=0;e=h;f=0;continue}a&&(b=0<b.length?b+"/..":"..",d=2)}else b=0<b.length?b+("/"+c.slice(e+1,h)):c.slice(e+1,h),d=h-e-1;e=h;f=0}else 46===g&&-1!==f?++f:f=-1}return b}function Pa(c){var a=Math.trunc(c);c=n(Math.round(1E6*(c-a)));return n(a)*n(1E6)+c}function bb(c){"number"===typeof c&&(c=Math.trunc(c));c=n(c);return Number(c/n(1E6))}function B(c){return function(){for(var a=
|
||
|
[],b=0;b<arguments.length;b++)a[b]=arguments[b];try{return c.apply(void 0,Ub(a))}catch(d){if(d&&d.code&&"string"===typeof d.code)return Mg[d.code]||28;if(d instanceof Xc)return d.errno;throw d;}}}function gf(c,a){var b=c.FD_MAP.get(a);if(!b)throw new Xc(8);if(void 0===b.filetype){var d=c.bindings.fs.fstatSync(b.real);c=hf(c,a,d);a=c.rightsBase;d=c.rightsInheriting;b.filetype=c.filetype;b.rights||(b.rights={base:a,inheriting:d})}return b}function hf(c,a,b){switch(!0){case b.isBlockDevice():return{filetype:1,
|
||
|
rightsBase:cb,rightsInheriting:cb};case b.isCharacterDevice():return void 0!==a&&c.bindings.isTTY(a)?{filetype:2,rightsBase:Ng,rightsInheriting:Og}:{filetype:2,rightsBase:cb,rightsInheriting:cb};case b.isDirectory():return{filetype:3,rightsBase:Yc,rightsInheriting:jf};case b.isFIFO():return{filetype:6,rightsBase:kf,rightsInheriting:cb};case b.isFile():return{filetype:4,rightsBase:lf,rightsInheriting:Pg};case b.isSocket():return{filetype:6,rightsBase:kf,rightsInheriting:cb};case b.isSymbolicLink():return{filetype:7,
|
||
|
rightsBase:n(0),rightsInheriting:n(0)};default:return{filetype:0,rightsBase:n(0),rightsInheriting:n(0)}}}let vd=Symbol("Comlink.proxy"),Ef=Symbol("Comlink.endpoint"),Df=Symbol("Comlink.releaseProxy"),nc=new WeakSet,yd=new Map([["proxy",{canHandle:c=>c&&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<d;b++){a=arguments[b];for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&(c[e]=a[e])}return c};return db.apply(this,
|
||
|
arguments)},na="undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{},N="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof na?na:"undefined"!==typeof self?self:{},u=K(function(c,a){Object.defineProperty(a,"__esModule",{value:!0});a.constants={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:64,O_EXCL:128,
|
||
|
O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_DIRECTORY:65536,O_NOATIME:262144,O_NOFOLLOW:131072,O_SYNC:1052672,O_DIRECT:16384,O_NONBLOCK:2048,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_FS_SYMLINK_DIR:1,UV_FS_SYMLINK_JUNCTION:2,UV_FS_COPYFILE_EXCL:1,UV_FS_COPYFILE_FICLONE:2,UV_FS_COPYFILE_FICLONE_FORCE:4,COPYFILE_EXCL:1,COPYFILE_FICLONE:2,COPYFILE_FICLONE_FORCE:4}});Q(u);var Qg=K(function(c,
|
||
|
a){a.default="function"===typeof BigInt?BigInt:function(){throw Error("BigInt is not supported in this environment.");}}),eb=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(){}a.build=function(c,b){void 0===b&&(b=!1);var d=new a,e=c.gid,f=c.atime,h=c.mtime,g=c.ctime;b=b?Qg.default:
|
||
|
function(a){return a};d.uid=b(c.uid);d.gid=b(e);d.rdev=b(0);d.blksize=b(4096);d.ino=b(c.ino);d.size=b(c.getSize());d.blocks=b(1);d.atime=f;d.mtime=h;d.ctime=g;d.birthtime=g;d.atimeMs=b(f.getTime());d.mtimeMs=b(h.getTime());e=b(g.getTime());d.ctimeMs=e;d.birthtimeMs=e;d.dev=b(0);d.mode=b(c.mode);d.nlink=b(c.nlink);return d};a.prototype._checkModeProperty=function(a){return(Number(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.Stats=c;a.default=c});Q(eb);var Ka="undefined"!==typeof na?na:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{},R=[],
|
||
|
H=[],Of="undefined"!==typeof Uint8Array?Uint8Array:Array,sc=!1,Rg={}.toString,Fd=Array.isArray||function(c){return"[object Array]"==Rg.call(c)};l.TYPED_ARRAY_SUPPORT=void 0!==Ka.TYPED_ARRAY_SUPPORT?Ka.TYPED_ARRAY_SUPPORT:!0;var Sg=l.TYPED_ARRAY_SUPPORT?2147483647:1073741823;l.poolSize=8192;l._augment=function(c){c.__proto__=l.prototype;return c};l.from=function(c,a,b){return Cd(null,c,a,b)};l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array);l.alloc=function(c,
|
||
|
a,b){Ed(c);return c=0>=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<f;++e)if(c[e]!==a[e]){b=c[e];d=a[e];break}return b<d?-1:d<b?1:0};l.isEncoding=function(c){switch(String(c).toLowerCase()){case "hex":case "utf8":case "utf-8":case "ascii":case "latin1":case "binary":case "base64":case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return!0;
|
||
|
default:return!1}};l.concat=function(c,a){if(!Fd(c))throw new TypeError('"list" argument must be an Array of Buffers');if(0===c.length)return l.alloc(0);var b;if(void 0===a)for(b=a=0;b<c.length;++b)a+=c[b].length;a=l.allocUnsafe(a);var d=0;for(b=0;b<c.length;++b){var e=c[b];if(!W(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(a,d);d+=e.length}return a};l.byteLength=Dd;l.prototype._isBuffer=!0;l.prototype.swap16=function(){var c=this.length;if(0!==c%2)throw new RangeError("Buffer size must be a multiple of 16-bits");
|
||
|
for(var a=0;a<c;a+=2)Ga(this,a,a+1);return this};l.prototype.swap32=function(){var c=this.length;if(0!==c%4)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var a=0;a<c;a+=4)Ga(this,a,a+3),Ga(this,a+1,a+2);return this};l.prototype.swap64=function(){var c=this.length;if(0!==c%8)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var a=0;a<c;a+=8)Ga(this,a,a+7),Ga(this,a+1,a+6),Ga(this,a+2,a+5),Ga(this,a+3,a+4);return this};l.prototype.toString=function(){var c=
|
||
|
this.length|0;return 0===c?"":0===arguments.length?Hd(this,0,c):Mf.apply(this,arguments)};l.prototype.equals=function(c){if(!W(c))throw new TypeError("Argument must be a Buffer");return this===c?!0:0===l.compare(this,c)};l.prototype.inspect=function(){var c="";0<this.length&&(c=this.toString("hex",0,50).match(/.{2}/g).join(" "),50<this.length&&(c+=" ... "));return"<Buffer "+c+">"};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;a<h;++a)if(d[a]!==c[a]){f=d[a];g=c[a];break}return f<g?-1:g<f?1:0};l.prototype.includes=function(c,a,b){return-1!==this.indexOf(c,a,b)};l.prototype.indexOf=function(c,a,b){return Id(this,
|
||
|
c,a,b,!0)};l.prototype.lastIndexOf=function(c,a,b){return Id(this,c,a,b,!1)};l.prototype.write=function(c,a,b,d){if(void 0===a)d="utf8",b=this.length,a=0;else if(void 0===b&&"string"===typeof a)d=a,b=this.length,a=0;else if(isFinite(a))a|=0,isFinite(b)?(b|=0,void 0===d&&(d="utf8")):(d=b,b=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var e=this.length-a;if(void 0===b||b>e)b=e;if(0<c.length&&(0>b||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<b;++d){e=parseInt(c.substr(2*d,2),16);if(isNaN(e)){c=d;break a}this[a+d]=e}c=d}return c;case "utf8":case "utf-8":return nb(Ib(c,this.length-a),this,a,b);case "ascii":return nb(Ld(c),this,a,b);case "latin1":case "binary":return nb(Ld(c),this,a,b);case "base64":return nb(Gd(c),this,a,b);case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":d=
|
||
|
c;e=this.length-a;for(var f=[],g=0;g<d.length&&!(0>(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<c&&(a=c);if(l.TYPED_ARRAY_SUPPORT)a=
|
||
|
this.subarray(c,a),a.__proto__=l.prototype;else{b=a-c;a=new l(b,void 0);for(var d=0;d<b;++d)a[d]=this[d+c]}return a};l.prototype.readUIntLE=function(c,a,b){c|=0;a|=0;b||D(c,a,this.length);b=this[c];for(var d=1,e=0;++e<a&&(d*=256);)b+=this[c+e]*d;return b};l.prototype.readUIntBE=function(c,a,b){c|=0;a|=0;b||D(c,a,this.length);b=this[c+--a];for(var d=1;0<a&&(d*=256);)b+=this[c+--a]*d;return b};l.prototype.readUInt8=function(c,a){a||D(c,1,this.length);return this[c]};l.prototype.readUInt16LE=function(c,
|
||
|
a){a||D(c,2,this.length);return this[c]|this[c+1]<<8};l.prototype.readUInt16BE=function(c,a){a||D(c,2,this.length);return this[c]<<8|this[c+1]};l.prototype.readUInt32LE=function(c,a){a||D(c,4,this.length);return(this[c]|this[c+1]<<8|this[c+2]<<16)+16777216*this[c+3]};l.prototype.readUInt32BE=function(c,a){a||D(c,4,this.length);return 16777216*this[c]+(this[c+1]<<16|this[c+2]<<8|this[c+3])};l.prototype.readIntLE=function(c,a,b){c|=0;a|=0;b||D(c,a,this.length);b=this[c];for(var d=1,e=0;++e<a&&(d*=256);)b+=
|
||
|
this[c+e]*d;b>=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<b&&(d*=256);)e+=this[c+--b]*d;e>=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<b&&(d*=256);)this[a+e]=c/d&255;return a+b};l.prototype.writeUIntBE=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=b-1;var e=1;for(this[a+d]=c&255;0<=--d&&(e*=256);)this[a+d]=c/e&255;return a+b};l.prototype.writeUInt8=
|
||
|
function(c,a,b){c=+c;a|=0;b||T(this,c,a,1,255,0);l.TYPED_ARRAY_SUPPORT||(c=Math.floor(c));this[a]=c&255;return a+1};l.prototype.writeUInt16LE=function(c,a,b){c=+c;a|=0;b||T(this,c,a,2,65535,0);l.TYPED_ARRAY_SUPPORT?(this[a]=c&255,this[a+1]=c>>>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;++d<b&&(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.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);0<d&&d<b&&(d=b);if(d===b||0===c.length||0===this.length)return 0;if(0>a)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-a<d-b&&(d=c.length-a+b);var e=d-b;if(this===c&&b<a&&
|
||
|
a<d)for(d=e-1;0<=d;--d)c[d+a]=this[d+b];else if(1E3>e||!l.TYPED_ARRAY_SUPPORT)for(d=0;d<e;++d)c[d+a]=this[d+b];else Uint8Array.prototype.set.call(c,this.subarray(b,b+e),a);return e};l.prototype.fill=function(c,a,b,d){if("string"===typeof c){"string"===typeof a?(d=a,a=0,b=this.length):"string"===typeof b&&(d=b,b=this.length);if(1===c.length){var e=c.charCodeAt(0);256>e&&(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<a||this.length<b)throw new RangeError("Out of range index");if(b<=a)return this;a>>>=0;b=void 0===b?this.length:b>>>0;c||(c=0);if("number"===typeof c)for(d=a;d<b;++d)this[d]=c;else for(c=W(c)?c:Ib((new l(c,d)).toString()),e=c.length,d=0;d<b-a;++d)this[d+a]=c[d%e];return this};var Nf=/[^+\/0-9A-Za-z-_]/g,vb=Object.freeze({__proto__:null,INSPECT_MAX_BYTES:50,kMaxLength:Sg,Buffer:l,SlowBuffer:function(c){+c!=c&&(c=0);return l.alloc(+c)},isBuffer:pa}),
|
||
|
J=K(function(c,a){function b(a){for(var c=[],b=1;b<arguments.length;b++)c[b-1]=arguments[b];return new (vb.Buffer.bind.apply(vb.Buffer,d([void 0,a],c)))}var d=N&&N.__spreadArrays||function(){for(var a=0,c=0,b=arguments.length;c<b;c++)a+=arguments[c].length;a=Array(a);var d=0;for(c=0;c<b;c++)for(var k=arguments[c],t=0,q=k.length;t<q;t++,d++)a[d]=k[t];return a};Object.defineProperty(a,"__esModule",{value:!0});a.Buffer=vb.Buffer;a.bufferAllocUnsafe=vb.Buffer.allocUnsafe||b;a.bufferFrom=vb.Buffer.from||
|
||
|
b});Q(J);var ua=Nd,va=Od;"function"===typeof Ka.setTimeout&&(ua=setTimeout);"function"===typeof Ka.clearTimeout&&(va=clearTimeout);var ka=[],Ua=!1,Ha,Mb=-1;Rd.prototype.run=function(){this.fun.apply(null,this.array)};var fb=Ka.performance||{},Tg=fb.now||fb.mozNow||fb.msNow||fb.oNow||fb.webkitNow||function(){return(new Date).getTime()},Ug=new Date,Va={nextTick:X,title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:Ia,addListener:Ia,once:Ia,off:Ia,removeListener:Ia,removeAllListeners:Ia,
|
||
|
emit:Ia,binding:function(){throw Error("process.binding is not supported");},cwd:function(){return"/"},chdir:function(){throw Error("process.chdir is not supported");},umask:function(){return 0},hrtime:function(c){var a=.001*Tg.call(fb),b=Math.floor(a);a=Math.floor(a%1*1E9);c&&(b-=c[0],a-=c[1],0>a&&(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<arguments.length;e++)b[e-1]=arguments[e];b=a.call(this,d(c,b))||this;b.code=c;b[h]=c;b.name=a.prototype.name+" ["+b[h]+"]";return b}g(c,a);return c}(a)}function d(a,c){E.strictEqual(typeof a,"string");var b=k[a];E(b,"An invalid error message key was used: "+a+".");if("function"===typeof b)a=b;else{a=wb.format;if(void 0===c||0===c.length)return b;c.unshift(b)}return String(a.apply(null,c))}function e(a,c){k[a]=
|
||
|
"function"===typeof c?c:String(c)}function f(a,c){E(a,"expected is required");E("string"===typeof c,"thing is required");if(Array.isArray(a)){var b=a.length;E(0<b,"At least one expected value needs to be specified");a=a.map(function(a){return String(a)});return 2<b?"one of "+c+" "+a.slice(0,b-1).join(", ")+", or "+a[b-1]:2===b?"one of "+c+" "+a[0]+" or "+a[1]:"of "+c+" "+a[0]}return"of "+c+" "+String(a)}var g=N&&N.__extends||function(){function a(c,b){a=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 a(c,b)}return function(c,b){function d(){this.constructor=c}a(c,b);c.prototype=null===b?Object.create(b):(d.prototype=b.prototype,new d)}}();Object.defineProperty(a,"__esModule",{value:!0});var h="undefined"===typeof Symbol?"_kCode":Symbol("code"),k={};c=function(c){function b(b){if("object"!==typeof b||null===b)throw new a.TypeError("ERR_INVALID_ARG_TYPE","options","object");var d=b.message?
|
||
|
c.call(this,b.message)||this:c.call(this,wb.inspect(b.actual).slice(0,128)+" "+(b.operator+" "+wb.inspect(b.expected).slice(0,128)))||this;d.generatedMessage=!b.message;d.name="AssertionError [ERR_ASSERTION]";d.code="ERR_ASSERTION";d.actual=b.actual;d.expected=b.expected;d.operator=b.operator;a.Error.captureStackTrace(d,b.stackStartFunction);return d}g(b,c);return b}(N.Error);a.AssertionError=c;a.message=d;a.E=e;a.Error=b(N.Error);a.TypeError=b(N.TypeError);a.RangeError=b(N.RangeError);e("ERR_ARG_NOT_ITERABLE",
|
||
|
"%s must be iterable");e("ERR_ASSERTION","%s");e("ERR_BUFFER_OUT_OF_BOUNDS",function(a,c){return c?"Attempt to write outside buffer bounds":'"'+a+'" is outside of buffer bounds'});e("ERR_CHILD_CLOSED_BEFORE_REPLY","Child closed before reply received");e("ERR_CONSOLE_WRITABLE_STREAM","Console expects a writable stream instance for %s");e("ERR_CPU_USAGE","Unable to obtain cpu usage %s");e("ERR_DNS_SET_SERVERS_FAILED",function(a,c){return'c-ares failed to set servers: "'+a+'" ['+c+"]"});e("ERR_FALSY_VALUE_REJECTION",
|
||
|
"Promise was rejected with falsy value");e("ERR_ENCODING_NOT_SUPPORTED",function(a){return'The "'+a+'" encoding is not supported'});e("ERR_ENCODING_INVALID_ENCODED_DATA",function(a){return"The encoded data was not valid for encoding "+a});e("ERR_HTTP_HEADERS_SENT","Cannot render headers after they are sent to the client");e("ERR_HTTP_INVALID_STATUS_CODE","Invalid status code: %s");e("ERR_HTTP_TRAILER_INVALID","Trailers are invalid with this transfer encoding");e("ERR_INDEX_OUT_OF_RANGE","Index out of range");
|
||
|
e("ERR_INVALID_ARG_TYPE",function(a,c,b){E(a,"name is required");if(c.includes("not ")){var d="must not be";c=c.split("not ")[1]}else d="must be";if(Array.isArray(a))d="The "+a.map(function(a){return'"'+a+'"'}).join(", ")+" arguments "+d+" "+f(c,"type");else if(a.includes(" argument"))d="The "+a+" "+d+" "+f(c,"type");else{var e=a.includes(".")?"property":"argument";d='The "'+a+'" '+e+" "+d+" "+f(c,"type")}3<=arguments.length&&(d+=". Received type "+(null!==b?typeof b:"null"));return d});e("ERR_INVALID_ARRAY_LENGTH",
|
||
|
function(a,c,b){E.strictEqual(typeof b,"number");return'The array "'+a+'" (length '+b+") must be of length "+c+"."});e("ERR_INVALID_BUFFER_SIZE","Buffer size must be a multiple of %s");e("ERR_INVALID_CALLBACK","Callback must be a function");e("ERR_INVALID_CHAR","Invalid character in %s");e("ERR_INVALID_CURSOR_POS","Cannot set cursor row without setting its column");e("ERR_INVALID_FD",'"fd" must be a positive integer: %s');e("ERR_INVALID_FILE_URL_HOST",'File URL host must be "localhost" or empty on %s');
|
||
|
e("ERR_INVALID_FILE_URL_PATH","File URL path %s");e("ERR_INVALID_HANDLE_TYPE","This handle type cannot be sent");e("ERR_INVALID_IP_ADDRESS","Invalid IP address: %s");e("ERR_INVALID_OPT_VALUE",function(a,c){return'The value "'+String(c)+'" is invalid for option "'+a+'"'});e("ERR_INVALID_OPT_VALUE_ENCODING",function(a){return'The value "'+String(a)+'" is invalid for option "encoding"'});e("ERR_INVALID_REPL_EVAL_CONFIG",'Cannot specify both "breakEvalOnSigint" and "eval" for REPL');e("ERR_INVALID_SYNC_FORK_INPUT",
|
||
|
"Asynchronous forks do not support Buffer, Uint8Array or string input: %s");e("ERR_INVALID_THIS",'Value of "this" must be of type %s');e("ERR_INVALID_TUPLE","%s must be an iterable %s tuple");e("ERR_INVALID_URL","Invalid URL: %s");e("ERR_INVALID_URL_SCHEME",function(a){return"The URL must be "+f(a,"scheme")});e("ERR_IPC_CHANNEL_CLOSED","Channel closed");e("ERR_IPC_DISCONNECTED","IPC channel is already disconnected");e("ERR_IPC_ONE_PIPE","Child process can have only one IPC pipe");e("ERR_IPC_SYNC_FORK",
|
||
|
"IPC cannot be used with synchronous forks");e("ERR_MISSING_ARGS",function(){for(var a=[],c=0;c<arguments.length;c++)a[c]=arguments[c];E(0<a.length,"At least one arg needs to be specified");c="The ";var b=a.length;a=a.map(function(a){return'"'+a+'"'});switch(b){case 1:c+=a[0]+" argument";break;case 2:c+=a[0]+" and "+a[1]+" arguments";break;default:c+=a.slice(0,b-1).join(", "),c+=", and "+a[b-1]+" arguments"}return c+" must be specified"});e("ERR_MULTIPLE_CALLBACK","Callback called multiple times");
|
||
|
e("ERR_NAPI_CONS_FUNCTION","Constructor must be a function");e("ERR_NAPI_CONS_PROTOTYPE_OBJECT","Constructor.prototype must be an object");e("ERR_NO_CRYPTO","Node.js is not compiled with OpenSSL crypto support");e("ERR_NO_LONGER_SUPPORTED","%s is no longer supported");e("ERR_PARSE_HISTORY_DATA","Could not parse history data in %s");e("ERR_SOCKET_ALREADY_BOUND","Socket is already bound");e("ERR_SOCKET_BAD_PORT","Port should be > 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;d<a;++d)e[d].call(this);break;case 2:d=arguments[1];if(a)e.call(this,d);else for(a=e.length,e=qb(e,a),f=0;f<a;++f)e[f].call(this,d);break;case 3:d=arguments[1];f=arguments[2];
|
||
|
if(a)e.call(this,d,f);else for(a=e.length,e=qb(e,a),b=0;b<a;++b)e[b].call(this,d,f);break;case 4:d=arguments[1];f=arguments[2];b=arguments[3];if(a)e.call(this,d,f,b);else{a=e.length;e=qb(e,a);for(var g=0;g<a;++g)e[g].call(this,d,f,b)}break;default:d=Array(f-1);for(b=1;b<f;b++)d[b-1]=arguments[b];if(a)e.apply(this,d);else for(a=e.length,e=qb(e,a),f=0;f<a;++f)e[f].apply(this,d)}return!0};x.prototype.addListener=function(c,a){return ne(this,c,a,!1)};x.prototype.on=x.prototype.addListener;x.prototype.prependListener=
|
||
|
function(c,a){return ne(this,c,a,!0)};x.prototype.once=function(c,a){if("function"!==typeof a)throw new TypeError('"listener" argument must be a function');this.on(c,oe(this,c,a));return this};x.prototype.prependOnceListener=function(c,a){if("function"!==typeof a)throw new TypeError('"listener" argument must be a function');this.prependListener(c,oe(this,c,a));return this};x.prototype.removeListener=function(c,a){var b;if("function"!==typeof a)throw new TypeError('"listener" argument must be a function');
|
||
|
var d=this._events;if(!d)return this;var e=d[c];if(!e)return this;if(e===a||e.listener&&e.listener===a)0===--this._eventsCount?this._events=new qa:(delete d[c],d.removeListener&&this.emit("removeListener",c,e.listener||a));else if("function"!==typeof e){var f=-1;for(b=e.length;0<b--;)if(e[b]===a||e[b].listener&&e[b].listener===a){var g=e[b].listener;f=b;break}if(0>f)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;b<h;f+=1,b+=1)e[f]=e[b];e.pop()}d.removeListener&&this.emit("removeListener",c,g||a)}return this};x.prototype.removeAllListeners=function(c){var a=this._events;if(!a)return this;if(!a.removeListener)return 0===arguments.length?(this._events=new qa,this._eventsCount=0):a[c]&&(0===--this._eventsCount?this._events=new qa:delete a[c]),this;if(0===arguments.length){a=Object.keys(a);for(var b=0,d;b<a.length;++b)d=a[b],"removeListener"!==d&&this.removeAllListeners(d);this.removeAllListeners("removeListener");
|
||
|
this._events=new qa;this._eventsCount=0;return this}a=a[c];if("function"===typeof a)this.removeListener(c,a);else if(a){do this.removeListener(c,a[a.length-1]);while(a[0])}return this};x.prototype.listeners=function(c){var a=this._events;if(a)if(c=a[c])if("function"===typeof c)c=[c.listener||c];else{a=Array(c.length);for(var b=0;b<a.length;++b)a[b]=c[b].listener||c[b];c=a}else c=[];else c=[];return c};x.listenerCount=function(c,a){return"function"===typeof c.listenerCount?c.listenerCount(a):pe.call(c,
|
||
|
a)};x.prototype.listenerCount=pe;x.prototype.eventNames=function(){return 0<this._eventsCount?Reflect.ownKeys(this._events):[]};var yb=K(function(c,a){var b=N&&N.__extends||function(){function a(c,b){a=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 a(c,b)}return function(c,b){function d(){this.constructor=c}a(c,b);c.prototype=null===b?Object.create(b):(d.prototype=b.prototype,new d)}}();Object.defineProperty(a,
|
||
|
"__esModule",{value:!0});var d=u.constants.S_IFMT,e=u.constants.S_IFDIR,f=u.constants.S_IFREG,g=u.constants.S_IFLNK,h=u.constants.O_APPEND;a.SEP="/";c=function(a){function c(c,b){void 0===b&&(b=438);var d=a.call(this)||this;d.uid=Y.default.getuid();d.gid=Y.default.getgid();d.atime=new Date;d.mtime=new Date;d.ctime=new Date;d.perm=438;d.mode=f;d.nlink=1;d.perm=b;d.mode|=b;d.ino=c;return d}b(c,a);c.prototype.getString=function(a){void 0===a&&(a="utf8");return this.getBuffer().toString(a)};c.prototype.setString=
|
||
|
function(a){this.buf=J.bufferFrom(a,"utf8");this.touch()};c.prototype.getBuffer=function(){this.buf||this.setBuffer(J.bufferAllocUnsafe(0));return J.bufferFrom(this.buf)};c.prototype.setBuffer=function(a){this.buf=J.bufferFrom(a);this.touch()};c.prototype.getSize=function(){return this.buf?this.buf.length:0};c.prototype.setModeProperty=function(a){this.mode=this.mode&~d|a};c.prototype.setIsFile=function(){this.setModeProperty(f)};c.prototype.setIsDirectory=function(){this.setModeProperty(e)};c.prototype.setIsSymlink=
|
||
|
function(){this.setModeProperty(g)};c.prototype.isFile=function(){return(this.mode&d)===f};c.prototype.isDirectory=function(){return(this.mode&d)===e};c.prototype.isSymlink=function(){return(this.mode&d)===g};c.prototype.makeSymlink=function(a){this.symlink=a;this.setIsSymlink()};c.prototype.write=function(a,c,b,d){void 0===c&&(c=0);void 0===b&&(b=a.length);void 0===d&&(d=0);this.buf||(this.buf=J.bufferAllocUnsafe(0));if(d+b>this.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<this.length?this.tail.next=c:this.head=c;this.tail=c;++this.length};La.prototype.unshift=function(c){c={data:c,next:this.head};0===this.length&&(this.tail=c);this.head=c;++this.length};La.prototype.shift=function(){if(0!==this.length){var c=this.head.data;this.head=1===this.length?this.tail=null:this.head.next;--this.length;return c}};La.prototype.clear=function(){this.head=this.tail=null;this.length=0};La.prototype.join=function(c){if(0===
|
||
|
this.length)return"";for(var a=this.head,b=""+a.data;a=a.next;)b+=c+a.data;return b};La.prototype.concat=function(c){if(0===this.length)return l.alloc(0);if(1===this.length)return this.head.data;c=l.allocUnsafe(c>>>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<this.charLength)return"";c=c.slice(a,c.length);a=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var b=a.charCodeAt(a.length-1);if(55296<=b&&56319>=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-c<a.highWaterMark)d=!0,z("length less than watermark",d);a.ended||a.reading?z("reading or ended",!1):d&&(z("do read"),a.reading=!0,a.sync=!0,0===a.length&&(a.needReadable=!0),this._read(a.highWaterMark),a.sync=!1,a.reading||(c=se(b,a)));d=0<c?ue(c,a):null;null===d?(a.needReadable=
|
||
|
!0,c=0):a.length-=c;0===a.length&&(a.ended||(a.needReadable=!0),b!==c&&a.ended&&Jc(this));null!==d&&this.emit("data",d);return d};y.prototype._read=function(){this.emit("error",Error("not implemented"))};y.prototype.pipe=function(c,a){function b(a){z("onunpipe");a===q&&e()}function d(){z("onend");c.end()}function e(){z("cleanup");c.removeListener("close",h);c.removeListener("finish",k);c.removeListener("drain",r);c.removeListener("error",g);c.removeListener("unpipe",b);q.removeListener("end",d);q.removeListener("end",
|
||
|
e);q.removeListener("data",f);m=!0;!l.awaitDrain||c._writableState&&!c._writableState.needDrain||r()}function f(a){z("ondata");p=!1;!1!==c.write(a)||p||((1===l.pipesCount&&l.pipes===c||1<l.pipesCount&&-1!==ve(l.pipes,c))&&!m&&(z("false write response, pause",q._readableState.awaitDrain),q._readableState.awaitDrain++,p=!0),q.pause())}function g(a){z("onerror",a);t();c.removeListener("error",g);0===c.listeners("error").length&&c.emit("error",a)}function h(){c.removeListener("finish",k);t()}function k(){z("onfinish");
|
||
|
c.removeListener("close",h);t()}function t(){z("unpipe");q.unpipe(c)}var q=this,l=this._readableState;switch(l.pipesCount){case 0:l.pipes=c;break;case 1:l.pipes=[l.pipes,c];break;default:l.pipes.push(c)}l.pipesCount+=1;z("pipe count=%d opts=%j",l.pipesCount,a);a=a&&!1===a.end?e:d;if(l.endEmitted)X(a);else q.once("end",a);c.on("unpipe",b);var r=jg(q);c.on("drain",r);var m=!1,p=!1;q.on("data",f);hg(c,"error",g);c.once("close",h);c.once("finish",k);c.emit("pipe",q);l.flowing||(z("pipe resume"),q.resume());
|
||
|
return c};y.prototype.unpipe=function(c){var a=this._readableState;if(0===a.pipesCount)return this;if(1===a.pipesCount){if(c&&c!==a.pipes)return this;c||(c=a.pipes);a.pipes=null;a.pipesCount=0;a.flowing=!1;c&&c.emit("unpipe",this);return this}if(!c){c=a.pipes;var b=a.pipesCount;a.pipes=null;a.pipesCount=0;a.flowing=!1;for(a=0;a<b;a++)c[a].emit("unpipe",this);return this}b=ve(a.pipes,c);if(-1===b)return this;a.pipes.splice(b,1);--a.pipesCount;1===a.pipesCount&&(a.pipes=a.pipes[0]);c.emit("unpipe",
|
||
|
this);return this};y.prototype.on=function(c,a){a=x.prototype.on.call(this,c,a);"data"===c?!1!==this._readableState.flowing&&this.resume():"readable"===c&&(c=this._readableState,c.endEmitted||c.readableListening||(c.readableListening=c.needReadable=!0,c.emittedReadable=!1,c.reading?c.length&&Qb(this):X(kg,this)));return a};y.prototype.addListener=y.prototype.on;y.prototype.resume=function(){var c=this._readableState;c.flowing||(z("resume"),c.flowing=!0,c.resumeScheduled||(c.resumeScheduled=!0,X(lg,
|
||
|
this,c)));return this};y.prototype.pause=function(){z("call pause flowing=%j",this._readableState.flowing);!1!==this._readableState.flowing&&(z("pause"),this._readableState.flowing=!1,this.emit("pause"));return this};y.prototype.wrap=function(c){var a=this._readableState,b=!1,d=this;c.on("end",function(){z("wrapped end");if(a.decoder&&!a.ended){var c=a.decoder.end();c&&c.length&&d.push(c)}d.push(null)});c.on("data",function(e){z("wrapped data");a.decoder&&(e=a.decoder.write(e));a.objectMode&&(null===
|
||
|
e||void 0===e)||!(a.objectMode||e&&e.length)||d.push(e)||(b=!0,c.pause())});for(var e in c)void 0===this[e]&&"function"===typeof c[e]&&(this[e]=function(a){return function(){return c[a].apply(c,arguments)}}(e));ng(["error","close","destroy","pause","resume"],function(a){c.on(a,d.emit.bind(d,a))});d._read=function(a){z("wrapped _read",a);b&&(b=!1,c.resume())};return d};y._fromList=ue;L.WritableState=Kc;za(L,x);Kc.prototype.getBuffer=function(){for(var c=this.bufferedRequest,a=[];c;)a.push(c),c=c.next;
|
||
|
return a};L.prototype.pipe=function(){this.emit("error",Error("Cannot pipe, not readable"))};L.prototype.write=function(c,a,b){var d=this._writableState,e=!1;"function"===typeof a&&(b=a,a=null);l.isBuffer(c)?a="buffer":a||(a=d.defaultEncoding);"function"!==typeof b&&(b=og);if(d.ended)d=b,c=Error("write after end"),this.emit("error",c),X(d,c);else{var f=b,g=!0,h=!1;null===c?h=new TypeError("May not write null values to stream"):l.isBuffer(c)||"string"===typeof c||void 0===c||d.objectMode||(h=new TypeError("Invalid non-string/buffer chunk"));
|
||
|
h&&(this.emit("error",h),X(f,h),g=!1);g&&(d.pendingcb++,e=a,d.objectMode||!1===d.decodeStrings||"string"!==typeof c||(c=l.from(c,e)),l.isBuffer(c)&&(e="buffer"),f=d.objectMode?1:c.length,d.length+=f,a=d.length<d.highWaterMark,a||(d.needDrain=!0),d.writing||d.corked?(f=d.lastBufferedRequest,d.lastBufferedRequest=new pg(c,e,b),f?f.next=d.lastBufferedRequest:d.bufferedRequest=d.lastBufferedRequest,d.bufferedRequestCount+=1):Lc(this,d,!1,f,c,e,b),e=a)}return e};L.prototype.cork=function(){this._writableState.corked++};
|
||
|
L.prototype.uncork=function(){var c=this._writableState;c.corked&&(c.corked--,c.writing||c.corked||c.finished||c.bufferProcessing||!c.bufferedRequest||xe(this,c))};L.prototype.setDefaultEncoding=function(c){"string"===typeof c&&(c=c.toLowerCase());if(!(-1<"hex utf8 utf-8 ascii binary base64 ucs2 ucs-2 utf16le utf-16le raw".split(" ").indexOf((c+"").toLowerCase())))throw new TypeError("Unknown encoding: "+c);this._writableState.defaultEncoding=c;return this};L.prototype._write=function(c,a,b){b(Error("not implemented"))};
|
||
|
L.prototype._writev=null;L.prototype.end=function(c,a,b){var d=this._writableState;"function"===typeof c?(b=c,a=c=null):"function"===typeof a&&(b=a,a=null);null!==c&&void 0!==c&&this.write(c,a);d.corked&&(d.corked=1,this.uncork());if(!d.ending&&!d.finished){c=b;d.ending=!0;Ae(this,d);if(c)if(d.finished)X(c);else this.once("finish",c);d.ended=!0;this.writable=!1}};za(U,y);for(var nf=Object.keys(L.prototype),ad=0;ad<nf.length;ad++){var bd=nf[ad];U.prototype[bd]||(U.prototype[bd]=L.prototype[bd])}za(ba,
|
||
|
U);ba.prototype.push=function(c,a){this._transformState.needTransform=!1;return U.prototype.push.call(this,c,a)};ba.prototype._transform=function(){throw Error("Not implemented");};ba.prototype._write=function(c,a,b){var d=this._transformState;d.writecb=b;d.writechunk=c;d.writeencoding=a;d.transforming||(c=this._readableState,(d.needTransform||c.needReadable||c.length<c.highWaterMark)&&this._read(c.highWaterMark))};ba.prototype._read=function(){var c=this._transformState;null!==c.writechunk&&c.writecb&&
|
||
|
!c.transforming?(c.transforming=!0,this._transform(c.writechunk,c.writeencoding,c.afterTransform)):c.needTransform=!0};za(sb,ba);sb.prototype._transform=function(c,a,b){b(null,c)};za(ca,x);ca.Readable=y;ca.Writable=L;ca.Duplex=U;ca.Transform=ba;ca.PassThrough=sb;ca.Stream=ca;ca.prototype.pipe=function(c,a){function b(a){c.writable&&!1===c.write(a)&&k.pause&&k.pause()}function d(){k.readable&&k.resume&&k.resume()}function e(){t||(t=!0,c.end())}function f(){t||(t=!0,"function"===typeof c.destroy&&c.destroy())}
|
||
|
function g(a){h();if(0===x.listenerCount(this,"error"))throw a;}function h(){k.removeListener("data",b);c.removeListener("drain",d);k.removeListener("end",e);k.removeListener("close",f);k.removeListener("error",g);c.removeListener("error",g);k.removeListener("end",h);k.removeListener("close",h);c.removeListener("close",h)}var k=this;k.on("data",b);c.on("drain",d);c._isStdio||a&&!1===a.end||(k.on("end",e),k.on("close",f));var t=!1;k.on("error",g);c.on("error",g);k.on("end",h);k.on("close",h);c.on("close",
|
||
|
h);c.emit("pipe",k);return c};var Xg=Array.prototype.slice,Yg=function d(a,b){for(var e in b)a[e]=b[e];return 3>arguments.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<arguments.length;h++)f[h]=arguments[h];return new Promise(function(h,g){a[b].bind(a).apply(void 0,e(f,[function(a,b){return a?g(a):h(d(b))}]))})}}var e=N&&N.__spreadArrays||function(){for(var a=0,b=0,d=arguments.length;b<
|
||
|
d;b++)a+=arguments[b].length;a=Array(a);var e=0;for(b=0;b<d;b++)for(var f=arguments[b],l=0,r=f.length;l<r;l++,e++)a[e]=f[l];return a};Object.defineProperty(b,"__esModule",{value:!0});var f=function(){function a(a,b){this.vol=a;this.fd=b}a.prototype.appendFile=function(a,b){return d(this.vol,"appendFile")(this.fd,a,b)};a.prototype.chmod=function(a){return d(this.vol,"fchmod")(this.fd,a)};a.prototype.chown=function(a,b){return d(this.vol,"fchown")(this.fd,a,b)};a.prototype.close=function(){return d(this.vol,
|
||
|
"close")(this.fd)};a.prototype.datasync=function(){return d(this.vol,"fdatasync")(this.fd)};a.prototype.read=function(a,b,e,f){return d(this.vol,"read",function(b){return{bytesRead:b,buffer:a}})(this.fd,a,b,e,f)};a.prototype.readFile=function(a){return d(this.vol,"readFile")(this.fd,a)};a.prototype.stat=function(a){return d(this.vol,"fstat")(this.fd,a)};a.prototype.sync=function(){return d(this.vol,"fsync")(this.fd)};a.prototype.truncate=function(a){return d(this.vol,"ftruncate")(this.fd,a)};a.prototype.utimes=
|
||
|
function(a,b){return d(this.vol,"futimes")(this.fd,a,b)};a.prototype.write=function(a,b,e,f){return d(this.vol,"write",function(b){return{bytesWritten:b,buffer:a}})(this.fd,a,b,e,f)};a.prototype.writeFile=function(a,b){return d(this.vol,"writeFile")(this.fd,a,b)};return a}();b.FileHandle=f;b.default=function(a){return"undefined"===typeof Promise?null:{FileHandle:f,access:function(b,e){return d(a,"access")(b,e)},appendFile:function(b,e,g){return d(a,"appendFile")(b instanceof f?b.fd:b,e,g)},chmod:function(b,
|
||
|
e){return d(a,"chmod")(b,e)},chown:function(b,e,f){return d(a,"chown")(b,e,f)},copyFile:function(b,e,f){return d(a,"copyFile")(b,e,f)},lchmod:function(b,e){return d(a,"lchmod")(b,e)},lchown:function(b,e,f){return d(a,"lchown")(b,e,f)},link:function(b,e){return d(a,"link")(b,e)},lstat:function(b,e){return d(a,"lstat")(b,e)},mkdir:function(b,e){return d(a,"mkdir")(b,e)},mkdtemp:function(b,e){return d(a,"mkdtemp")(b,e)},open:function(b,e,g){return d(a,"open",function(b){return new f(a,b)})(b,e,g)},readdir:function(b,
|
||
|
e){return d(a,"readdir")(b,e)},readFile:function(b,e){return d(a,"readFile")(b instanceof f?b.fd:b,e)},readlink:function(b,e){return d(a,"readlink")(b,e)},realpath:function(b,e){return d(a,"realpath")(b,e)},rename:function(b,e){return d(a,"rename")(b,e)},rmdir:function(b){return d(a,"rmdir")(b)},stat:function(b,e){return d(a,"stat")(b,e)},symlink:function(b,e,f){return d(a,"symlink")(b,e,f)},truncate:function(b,e){return d(a,"truncate")(b,e)},unlink:function(b){return d(a,"unlink")(b)},utimes:function(b,
|
||
|
e,f){return d(a,"utimes")(b,e,f)},writeFile:function(b,e,g){return d(a,"writeFile")(b instanceof f?b.fd:b,e,g)}}}});Q(of);var wg=/[^\x20-\x7E]/,ug=/[\x2E\u3002\uFF0E\uFF61]/g,De={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 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;e<d.length;e++){var f=d[e];b[f]=
|
||
|
this[f]}b.hash=a.hash;if(""===a.href)return b.href=b.format(),b;if(a.slashes&&!a.protocol){d=Object.keys(a);for(e=0;e<d.length;e++)f=d[e],"protocol"!==f&&(b[f]=a[f]);$a[b.protocol]&&b.hostname&&!b.pathname&&(b.path=b.pathname="/");b.href=b.format();return b}var g;if(a.protocol&&a.protocol!==b.protocol){if(!$a[a.protocol]){d=Object.keys(a);for(e=0;e<d.length;e++)f=d[e],b[f]=a[f];b.href=b.format();return b}b.protocol=a.protocol;if(a.host||Nc[a.protocol])b.pathname=a.pathname;else{for(g=(a.pathname||
|
||
|
"").split("/");g.length&&!(a.host=g.shift()););a.host||(a.host="");a.hostname||(a.hostname="");""!==g[0]&&g.unshift("");2>g.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&&0<b.host.indexOf("@")?b.host.split("@"):!1)&&(b.auth=f.shift(),b.host=b.hostname=f.shift());b.search=a.search;b.query=a.query;if(null!==b.pathname||null!==b.search)b.path=(b.pathname?b.pathname:"")+(b.search?b.search:"");b.href=b.format();return b}if(!e.length)return b.pathname=null,b.path=b.search?"/"+b.search:null,b.href=b.format(),b;h=e.slice(-1)[0];g=(b.host||a.host||
|
||
|
1<e.length)&&("."===h||".."===h)||""===h;for(var l=0,q=e.length;0<=q;q--)h=e[q],"."===h?e.splice(q,1):".."===h?(e.splice(q,1),l++):l&&(e.splice(q,1),l--);if(!d&&!k)for(;l--;l)e.unshift("..");!d||""===e[0]||e[0]&&"/"===e[0].charAt(0)||e.unshift("");g&&"/"!==e.join("/").substr(-1)&&e.push("");k=""===e[0]||e[0]&&"/"===e[0].charAt(0);f&&(b.hostname=b.host=k?"":e.length?e.shift():"",f=b.host&&0<b.host.indexOf("@")?b.host.split("@"):!1)&&(b.auth=f.shift(),b.host=b.hostname=f.shift());(d||b.host&&e.length)&&
|
||
|
!k&&e.unshift("");e.length?b.pathname=e.join("/"):(b.pathname=null,b.path=null);if(null!==b.pathname||null!==b.search)b.path=(b.pathname?b.pathname:"")+(b.search?b.search:"");b.auth=a.auth||b.auth;b.slashes=b.slashes||a.slashes;b.href=b.format();return b};da.prototype.parseHost=function(){return Ke(this)};var pf=K(function(a,b){function d(a,b){a=a[b];return 0<b&&("/"===a||f&&"\\"===a)}function e(a){var b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:!0;if(f){var e=a;if("string"!==typeof e)throw new TypeError("expected a string");
|
||
|
e=e.replace(/[\\\/]+/g,"/");if(!1!==b)if(b=e,e=b.length-1,2>e)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<a.length;b++)if("%"===a[b]){var d=a.codePointAt(b+2)|32;if("2"===a[b+1]&&102===d)throw new xb.TypeError("ERR_INVALID_FILE_URL_PATH","must not include encoded / characters");}a=decodeURIComponent(a)}a=String(a);E(a);return a}function n(a,b){return(a=d(a,b).substr(1))?a.split(H):[]}function B(a){return n(p(a))}function z(a,b){void 0===b&&(b=oa.ENCODING_UTF8);return J.Buffer.isBuffer(a)?a:a instanceof Uint8Array?J.bufferFrom(a):J.bufferFrom(String(a),b)}
|
||
|
function C(a,b){return b&&"buffer"!==b?a.toString(b):a}function E(a,b){if(-1!==(""+a).indexOf("\x00")){a=Error("Path must be a string without null bytes");a.code="ENOENT";if("function"!==typeof b)throw a;Y.default.nextTick(b,a);return!1}return!0}function y(a,b){a="number"===typeof a?a:"string"===typeof a?parseInt(a,8):b?y(b):void 0;if("number"!==typeof a||isNaN(a))throw new TypeError(M.MODE_INT);return a}function G(a){if(a>>>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<d;b++)a+=arguments[b].length;a=Array(a);var e=0;for(b=0;b<d;b++)for(var f=arguments[b],h=0,g=f.length;h<g;h++,e++)a[e]=f[h];return a};Object.defineProperty(b,"__esModule",{value:!0});var xa=Yg,ah=Hc,cc=u.constants.O_RDONLY,ib=u.constants.O_WRONLY,Aa=u.constants.O_RDWR,
|
||
|
O=u.constants.O_CREAT,I=u.constants.O_EXCL,K=u.constants.O_TRUNC,L=u.constants.O_APPEND,Q=u.constants.O_SYNC,T=u.constants.O_DIRECTORY,S=u.constants.F_OK,V=u.constants.COPYFILE_EXCL,X=u.constants.COPYFILE_FICLONE_FORCE,H="/",U="win32"===Y.default.platform,M={PATH_STR:"path must be a string or Buffer",FD:"fd must be a file descriptor",MODE_INT:"mode must be an int",CB:"callback must be a function",UID:"uid must be an unsigned int",GID:"gid must be an unsigned int",LEN:"len must be an integer",ATIME:"atime must be an integer",
|
||
|
MTIME:"mtime must be an integer",PREFIX:"filename prefix is required",BUFFER:"buffer must be an instance of Buffer or StaticBuffer",OFFSET:"offset must be an integer",LENGTH:"length must be an integer",POSITION:"position must be an integer"},R;(function(a){a[a.r=cc]="r";a[a["r+"]=Aa]="r+";a[a.rs=cc|Q]="rs";a[a.sr=a.rs]="sr";a[a["rs+"]=Aa|Q]="rs+";a[a["sr+"]=a["rs+"]]="sr+";a[a.w=ib|O|K]="w";a[a.wx=ib|O|K|I]="wx";a[a.xw=a.wx]="xw";a[a["w+"]=Aa|O|K]="w+";a[a["wx+"]=Aa|O|K|I]="wx+";a[a["xw+"]=a["wx+"]]=
|
||
|
"xw+";a[a.a=ib|L|O]="a";a[a.ax=ib|L|O|I]="ax";a[a.xa=a.ax]="xa";a[a["a+"]=Aa|L|O]="a+";a[a["ax+"]=Aa|L|O|I]="ax+";a[a["xa+"]=a["ax+"]]="xa+"})(R=b.FLAGS||(b.FLAGS={}));b.flagsToNumber=l;a={encoding:"utf8"};var W=m(a),aa=P(W),ba=m({flag:"r"}),da={encoding:"utf8",mode:438,flag:R[R.w]},ea=m(da),fa={encoding:"utf8",mode:438,flag:R[R.a]},ha=m(fa),na=P(ha),ja=m(a),pa=P(ja),ka={mode:511,recursive:!1},la={recursive:!1},ma=m({encoding:"utf8",withFileTypes:!1}),sa=P(ma),ua={bigint:!1};b.pathToFilename=p;if(U){var va=
|
||
|
d,wa=pf.unixify;d=function(a,b){return wa(va(a,b))}}b.filenameToSteps=n;b.pathToSteps=B;b.dataToStr=function(a,b){void 0===b&&(b=oa.ENCODING_UTF8);return J.Buffer.isBuffer(a)?a.toString(b):a instanceof Uint8Array?J.bufferFrom(a).toString(b):String(a)};b.dataToBuffer=z;b.bufferToEncoding=C;b.toUnixTimestamp=D;a=function(){function a(a){void 0===a&&(a={});this.ino=0;this.inodes={};this.releasedInos=[];this.fds={};this.releasedFds=[];this.maxFiles=1E4;this.openFiles=0;this.promisesApi=of.default(this);
|
||
|
this.statWatchers={};this.props=xa({Node:yb.Node,Link:yb.Link,File:yb.File},a);a=this.createLink();a.setNode(this.createNode(!0));var b=this;this.StatWatcher=function(a){function d(){return a.call(this,b)||this}hb(d,a);return d}(qa);this.ReadStream=function(a){function d(){for(var d=[],e=0;e<arguments.length;e++)d[e]=arguments[e];return a.apply(this,fd([b],d))||this}hb(d,a);return d}(ta);this.WriteStream=function(a){function d(){for(var d=[],e=0;e<arguments.length;e++)d[e]=arguments[e];return a.apply(this,
|
||
|
fd([b],d))||this}hb(d,a);return d}(Z);this.FSWatcher=function(a){function d(){return a.call(this,b)||this}hb(d,a);return d}(ra);this.root=a}a.fromJSON=function(b,d){var e=new a;e.fromJSON(b,d);return e};Object.defineProperty(a.prototype,"promises",{get:function(){if(null===this.promisesApi)throw Error("Promise is not supported in this environment.");return this.promisesApi},enumerable:!0,configurable:!0});a.prototype.createLink=function(a,b,d,e){void 0===d&&(d=!1);if(!a)return new this.props.Link(this,
|
||
|
null,"");if(!b)throw Error("createLink: name cannot be empty");return a.createChild(b,this.createNode(d,e))};a.prototype.deleteLink=function(a){var b=a.parent;return b?(b.deleteChild(a),!0):!1};a.prototype.newInoNumber=function(){var a=this.releasedInos.pop();return a?a:this.ino=(this.ino+1)%4294967295};a.prototype.newFdNumber=function(){var b=this.releasedFds.pop();return"number"===typeof b?b:a.fd--};a.prototype.createNode=function(a,b){void 0===a&&(a=!1);b=new this.props.Node(this.newInoNumber(),
|
||
|
b);a&&b.setIsDirectory();return this.inodes[b.ino]=b};a.prototype.getNode=function(a){return this.inodes[a]};a.prototype.deleteNode=function(a){a.del();delete this.inodes[a.ino];this.releasedInos.push(a.ino)};a.prototype.genRndStr=function(){var a=(Math.random()+1).toString(36).substr(2,6);return 6===a.length?a:this.genRndStr()};a.prototype.getLink=function(a){return this.root.walk(a)};a.prototype.getLinkOrThrow=function(a,b){var d=n(a);d=this.getLink(d);if(!d)throw k("ENOENT",b,a);return d};a.prototype.getResolvedLink=
|
||
|
function(a){a="string"===typeof a?n(a):a;for(var b=this.root,d=0;d<a.length;){b=b.getChild(a[d]);if(!b)return null;var e=b.getNode();e.isSymlink()?(a=e.symlink.concat(a.slice(d+1)),b=this.root,d=0):d++}return b};a.prototype.getResolvedLinkOrThrow=function(a,b){var d=this.getResolvedLink(a);if(!d)throw k("ENOENT",b,a);return d};a.prototype.resolveSymlinks=function(a){return this.getResolvedLink(a.steps.slice(1))};a.prototype.getLinkAsDirOrThrow=function(a,b){var d=this.getLinkOrThrow(a,b);if(!d.getNode().isDirectory())throw k("ENOTDIR",
|
||
|
b,a);return d};a.prototype.getLinkParent=function(a){return this.root.walk(a,a.length-1)};a.prototype.getLinkParentAsDirOrThrow=function(a,b){a=a instanceof Array?a:n(a);var d=this.getLinkParent(a);if(!d)throw k("ENOENT",b,H+a.join(H));if(!d.getNode().isDirectory())throw k("ENOTDIR",b,H+a.join(H));return d};a.prototype.getFileByFd=function(a){return this.fds[String(a)]};a.prototype.getFileByFdOrThrow=function(a,b){if(a>>>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<a.length;f++){var v=p(a[f]);(v=this.getResolvedLink(v))&&e.push(v)}}else e.push(this.root);if(!e.length)return b;for(f=0;f<e.length;f++)v=e[f],this._toJSON(v,b,d?v.getPath():"");return b};a.prototype.fromJSON=function(a,b){void 0===b&&(b=Y.default.cwd());for(var e in a){var f=a[e];if("string"===typeof f){e=d(e,b);var v=n(e);1<v.length&&(v=H+v.slice(0,v.length-1).join(H),this.mkdirpBase(v,511));this.writeFileSync(e,f)}else this.mkdirpBase(e,511)}};a.prototype.reset=function(){this.ino=
|
||
|
0;this.inodes={};this.releasedInos=[];this.fds={};this.releasedFds=[];this.openFiles=0;this.root=this.createLink();this.root.setNode(this.createNode(!0))};a.prototype.mountSync=function(a,b){this.fromJSON(b,a)};a.prototype.openLink=function(a,b,d){void 0===d&&(d=!0);if(this.openFiles>=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<h;){var g=this.writeSync(a,b,e,h,d);e+=g;h-=g;void 0!==d&&(d+=g)}}finally{f||this.closeSync(a)}};a.prototype.writeFileSync=function(a,b,d){var e=ea(d);d=l(e.flag);var f=y(e.mode);b=z(b,e.encoding);this.writeFileBase(a,
|
||
|
b,d,f)};a.prototype.writeFile=function(a,b,d,e){var f=d;"function"===typeof d&&(f=da,e=d);d=r(e);var h=ea(f);f=l(h.flag);e=y(h.mode);b=z(b,h.encoding);this.wrapAsync(this.writeFileBase,[a,b,f,e],d)};a.prototype.linkBase=function(a,b){var d=n(a),e=this.getLink(d);if(!e)throw k("ENOENT","link",a,b);var f=n(b);d=this.getLinkParent(f);if(!d)throw k("ENOENT","link",a,b);f=f[f.length-1];if(d.getChild(f))throw k("EEXIST","link",a,b);a=e.getNode();a.nlink++;d.createChild(f,a)};a.prototype.copyFileBase=function(a,
|
||
|
b,d){var e=this.readFileSync(a);if(d&V&&this.existsSync(b))throw k("EEXIST","copyFile",a,b);if(d&X)throw k("ENOSYS","copyFile",a,b);this.writeFileBase(b,e,R.w,438)};a.prototype.copyFileSync=function(a,b,d){a=p(a);b=p(b);return this.copyFileBase(a,b,(d||0)|0)};a.prototype.copyFile=function(a,b,d,e){a=p(a);b=p(b);if("function"===typeof d)var f=0;else f=d,d=e;r(d);this.wrapAsync(this.copyFileBase,[a,b,f],d)};a.prototype.linkSync=function(a,b){a=p(a);b=p(b);this.linkBase(a,b)};a.prototype.link=function(a,
|
||
|
b,d){a=p(a);b=p(b);this.wrapAsync(this.linkBase,[a,b],d)};a.prototype.unlinkBase=function(a){var b=n(a);b=this.getLink(b);if(!b)throw k("ENOENT","unlink",a);if(b.length)throw Error("Dir not empty...");this.deleteLink(b);a=b.getNode();a.nlink--;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.name<b.name?-1:a.name>b.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;e<a.length;e++){var f=a[e];if(!d.getNode().isDirectory())throw k("ENOTDIR",
|
||
|
"mkdir",d.getPath());var h=d.getChild(f);if(h)if(h.getNode().isDirectory())d=h;else throw k("ENOTDIR","mkdir",h.getPath());else d=d.createChild(f,this.createNode(!0,b))}};a.prototype.mkdirSync=function(a,b){b=g(b);var d=y(b.mode,511);a=p(a);b.recursive?this.mkdirpBase(a,d):this.mkdirBase(a,d)};a.prototype.mkdir=function(a,b,d){var e=g(b);b=r("function"===typeof b?b:d);d=y(e.mode,511);a=p(a);e.recursive?this.wrapAsync(this.mkdirpBase,[a,d],b):this.wrapAsync(this.mkdirBase,[a,d],b)};a.prototype.mkdirpSync=
|
||
|
function(a,b){this.mkdirSync(a,{mode:b,recursive:!0})};a.prototype.mkdirp=function(a,b,d){var e="function"===typeof b?void 0:b;b=r("function"===typeof b?b:d);this.mkdir(a,{mode:e,recursive:!0},b)};a.prototype.mkdtempBase=function(a,b,d){void 0===d&&(d=5);var e=a+this.genRndStr();try{return this.mkdirBase(e,511),oa.strToEncoding(e,b)}catch(Ab){if("EEXIST"===Ab.code){if(1<d)return this.mkdtempBase(a,b,d-1);throw Error("Could not create temp dir.");}throw Ab;}};a.prototype.mkdtempSync=function(a,b){b=
|
||
|
W(b).encoding;if(!a||"string"!==typeof a)throw new TypeError("filename prefix is required");E(a);return this.mkdtempBase(a,b)};a.prototype.mkdtemp=function(a,b,d){d=aa(b,d);b=d[0].encoding;d=d[1];if(!a||"string"!==typeof a)throw new TypeError("filename prefix is required");E(a)&&this.wrapAsync(this.mkdtempBase,[a,b],d)};a.prototype.rmdirBase=function(a,b){b=xa({},la,b);var d=this.getLinkAsDirOrThrow(a,"rmdir");if(d.length&&!b.recursive)throw k("ENOTEMPTY","rmdir",a);this.deleteLink(d)};a.prototype.rmdirSync=
|
||
|
function(a,b){this.rmdirBase(p(a),b)};a.prototype.rmdir=function(a,b,d){var e=xa({},la,b);b=r("function"===typeof b?b:d);this.wrapAsync(this.rmdirBase,[p(a),e],b)};a.prototype.fchmodBase=function(a,b){this.getFileByFdOrThrow(a,"fchmod").chmod(b)};a.prototype.fchmodSync=function(a,b){this.fchmodBase(a,y(b))};a.prototype.fchmod=function(a,b,d){this.wrapAsync(this.fchmodBase,[a,y(b)],d)};a.prototype.chmodBase=function(a,b){a=this.openSync(a,"r+");try{this.fchmodBase(a,b)}finally{this.closeSync(a)}};
|
||
|
a.prototype.chmodSync=function(a,b){b=y(b);a=p(a);this.chmodBase(a,b)};a.prototype.chmod=function(a,b,d){b=y(b);a=p(a);this.wrapAsync(this.chmodBase,[a,b],d)};a.prototype.lchmodBase=function(a,b){a=this.openBase(a,Aa,0,!1);try{this.fchmodBase(a,b)}finally{this.closeSync(a)}};a.prototype.lchmodSync=function(a,b){b=y(b);a=p(a);this.lchmodBase(a,b)};a.prototype.lchmod=function(a,b,d){b=y(b);a=p(a);this.wrapAsync(this.lchmodBase,[a,b],d)};a.prototype.fchownBase=function(a,b,d){this.getFileByFdOrThrow(a,
|
||
|
"fchown").chown(b,d)};a.prototype.fchownSync=function(a,b,d){w(b);F(d);this.fchownBase(a,b,d)};a.prototype.fchown=function(a,b,d,e){w(b);F(d);this.wrapAsync(this.fchownBase,[a,b,d],e)};a.prototype.chownBase=function(a,b,d){this.getResolvedLinkOrThrow(a,"chown").getNode().chown(b,d)};a.prototype.chownSync=function(a,b,d){w(b);F(d);this.chownBase(p(a),b,d)};a.prototype.chown=function(a,b,d,e){w(b);F(d);this.wrapAsync(this.chownBase,[p(a),b,d],e)};a.prototype.lchownBase=function(a,b,d){this.getLinkOrThrow(a,
|
||
|
"lchown").getNode().chown(b,d)};a.prototype.lchownSync=function(a,b,d){w(b);F(d);this.lchownBase(p(a),b,d)};a.prototype.lchown=function(a,b,d,e){w(b);F(d);this.wrapAsync(this.lchownBase,[p(a),b,d],e)};a.prototype.watchFile=function(a,b,d){a=p(a);var e=b;"function"===typeof e&&(d=b,e=null);if("function"!==typeof d)throw Error('"watchFile()" requires a listener function');b=5007;var f=!0;e&&"object"===typeof e&&("number"===typeof e.interval&&(b=e.interval),"boolean"===typeof e.persistent&&(f=e.persistent));
|
||
|
(e=this.statWatchers[a])||(e=new this.StatWatcher,e.start(a,f,b),this.statWatchers[a]=e);e.addListener("change",d);return e};a.prototype.unwatchFile=function(a,b){a=p(a);var d=this.statWatchers[a];d&&("function"===typeof b?d.removeListener("change",b):d.removeAllListeners("change"),0===d.listenerCount("change")&&(d.stop(),delete this.statWatchers[a]))};a.prototype.createReadStream=function(a,b){return new this.ReadStream(a,b)};a.prototype.createWriteStream=function(a,b){return new this.WriteStream(a,
|
||
|
b)};a.prototype.watch=function(a,b,d){a=p(a);var e=b;"function"===typeof b&&(d=b,e=null);var f=W(e);b=f.persistent;e=f.recursive;f=f.encoding;void 0===b&&(b=!0);void 0===e&&(e=!1);var h=new this.FSWatcher;h.start(a,b,e,f);d&&h.addListener("change",d);return h};a.fd=2147483647;return a}();b.Volume=a;var qa=function(a){function b(b){var d=a.call(this)||this;d.onInterval=function(){try{var a=d.vol.statSync(d.filename);d.hasChanged(a)&&(d.emit("change",a,d.prev),d.prev=a)}finally{d.loop()}};d.vol=b;return d}
|
||
|
hb(b,a);b.prototype.loop=function(){this.timeoutRef=this.setTimeout(this.onInterval,this.interval)};b.prototype.hasChanged=function(a){return a.mtimeMs>this.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<d&&(f.bytesRead+=d,a=b.slice(e,e+d)),f.push(a))});void 0!==this.pos&&(this.pos+=d);ia.used+=d}};ta.prototype._destroy=function(a,b){this.close(function(d){b(a||d)})};ta.prototype.close=function(a){var b=this;if(a)this.once("close",a);if(this.closed||
|
||
|
"number"!==typeof this.fd){if("number"!==typeof this.fd){this.once("open",bh);return}return Y.default.nextTick(function(){return b.emit("close")})}this.closed=!0;this._vol.close(this.fd,function(a){a?b.emit("error",a):b.emit("close")});this.fd=null};wb.inherits(Z,ca.Writable);b.WriteStream=Z;Z.prototype.open=function(){this._vol.open(this.path,this.flags,this.mode,function(a,b){a?(this.autoClose&&this.destroy&&this.destroy(),this.emit("error",a)):(this.fd=b,this.emit("open",b))}.bind(this))};Z.prototype._write=
|
||
|
function(a,b,d){if(!(a instanceof J.Buffer))return this.emit("error",Error("Invalid data"));if("number"!==typeof this.fd)return this.once("open",function(){this._write(a,b,d)});var e=this;this._vol.write(this.fd,a,0,a.length,this.pos,function(a,b){if(a)return e.autoClose&&e.destroy&&e.destroy(),d(a);e.bytesWritten+=b;d()});void 0!==this.pos&&(this.pos+=a.length)};Z.prototype._writev=function(a,b){if("number"!==typeof this.fd)return this.once("open",function(){this._writev(a,b)});for(var d=this,e=
|
||
|
a.length,f=Array(e),h=0,g=0;g<e;g++){var k=a[g].chunk;f[g]=k;h+=k.length}e=J.Buffer.concat(f);this._vol.write(this.fd,e,0,e.length,this.pos,function(a,e){if(a)return d.destroy&&d.destroy(),b(a);d.bytesWritten+=e;b()});void 0!==this.pos&&(this.pos+=h)};Z.prototype._destroy=ta.prototype._destroy;Z.prototype.close=ta.prototype.close;Z.prototype.destroySoon=Z.prototype.end;var ra=function(a){function b(b){var d=a.call(this)||this;d._filename="";d._filenameEncoded="";d._recursive=!1;d._encoding=oa.ENCODING_UTF8;
|
||
|
d._onNodeChange=function(){d._emit("change")};d._onParentChild=function(a){a.getName()===d._getName()&&d._emit("rename")};d._emit=function(a){d.emit("change",a,d._filenameEncoded)};d._persist=function(){d._timer=setTimeout(d._persist,1E6)};d._vol=b;return d}hb(b,a);b.prototype._getName=function(){return this._steps[this._steps.length-1]};b.prototype.start=function(a,b,d,e){void 0===b&&(b=!0);void 0===d&&(d=!1);void 0===e&&(e=oa.ENCODING_UTF8);this._filename=p(a);this._steps=n(this._filename);this._filenameEncoded=
|
||
|
oa.strToEncoding(this._filename);this._recursive=d;this._encoding=e;try{this._link=this._vol.getLinkOrThrow(this._filename,"FSWatcher")}catch(ed){throw b=Error("watch "+this._filename+" "+ed.code),b.code=ed.code,b.errno=ed.code,b;}this._link.getNode().on("change",this._onNodeChange);this._link.on("child:add",this._onNodeChange);this._link.on("child:delete",this._onNodeChange);if(a=this._link.parent)a.setMaxListeners(a.getMaxListeners()+1),a.on("child:delete",this._onParentChild);b&&this._persist()};
|
||
|
b.prototype.close=function(){clearTimeout(this._timer);this._link.getNode().removeListener("change",this._onNodeChange);var a=this._link.parent;a&&a.removeListener("child:delete",this._onParentChild)};return b}(x.EventEmitter);b.FSWatcher=ra});Q(Qa);var eh=Qa.pathToFilename,fh=Qa.filenameToSteps,qf=Qa.Volume,gd=K(function(a,b){Object.defineProperty(b,"__esModule",{value:!0});b.fsProps="constants F_OK R_OK W_OK X_OK Stats".split(" ");b.fsSyncMethods="renameSync ftruncateSync truncateSync chownSync fchownSync lchownSync chmodSync fchmodSync lchmodSync statSync lstatSync fstatSync linkSync symlinkSync readlinkSync realpathSync unlinkSync rmdirSync mkdirSync mkdirpSync readdirSync closeSync openSync utimesSync futimesSync fsyncSync writeSync readSync readFileSync writeFileSync appendFileSync existsSync accessSync fdatasyncSync mkdtempSync copyFileSync createReadStream createWriteStream".split(" ");
|
||
|
b.fsAsyncMethods="rename ftruncate truncate chown fchown lchown chmod fchmod lchmod stat lstat fstat link symlink readlink realpath unlink rmdir mkdir mkdirp readdir close open utimes futimes fsync write read readFile writeFile appendFile exists access fdatasync mkdtemp copyFile watchFile unwatchFile watch".split(" ")});Q(gd);var rf=K(function(a,b){function d(a){for(var b={F_OK:h,R_OK:k,W_OK:l,X_OK:m,constants:u.constants,Stats:eb.default,Dirent:$c.default},d=0,e=f;d<e.length;d++){var q=e[d];"function"===
|
||
|
typeof a[q]&&(b[q]=a[q].bind(a))}d=0;for(e=g;d<e.length;d++)q=e[d],"function"===typeof a[q]&&(b[q]=a[q].bind(a));b.StatWatcher=a.StatWatcher;b.FSWatcher=a.FSWatcher;b.WriteStream=a.WriteStream;b.ReadStream=a.ReadStream;b.promises=a.promises;b._toUnixTimestamp=Qa.toUnixTimestamp;return b}var e=N&&N.__assign||function(){e=Object.assign||function(a){for(var b,d=1,e=arguments.length;d<e;d++){b=arguments[d];for(var f in b)Object.prototype.hasOwnProperty.call(b,f)&&(a[f]=b[f])}return a};return e.apply(this,
|
||
|
arguments)};Object.defineProperty(b,"__esModule",{value:!0});var f=gd.fsSyncMethods,g=gd.fsAsyncMethods,h=u.constants.F_OK,k=u.constants.R_OK,l=u.constants.W_OK,m=u.constants.X_OK;b.Volume=Qa.Volume;b.vol=new Qa.Volume;b.createFsFromVolume=d;b.fs=d(b.vol);a.exports=e(e({},a.exports),b.fs);a.exports.semantic=!0});Q(rf);var sf=rf.createFsFromVolume;Wg.prototype.emit=function(a){for(var b,d,e=[],f=1;f<arguments.length;f++)e[f-1]=arguments[f];f=this.listeners(a);try{for(var g=rc(f),h=g.next();!h.done;h=
|
||
|
g.next()){var k=h.value;try{k.apply(void 0,Jf(e))}catch(t){console.error(t)}}}catch(t){b={error:t}}finally{try{h&&!h.done&&(d=g.return)&&d.call(g)}finally{if(b)throw b.error;}}return 0<f.length};var gh=function(){function a(){this.volume=new qf;this.fs=sf(this.volume);this.fromJSON({"/dev/stdin":"","/dev/stdout":"","/dev/stderr":""})}a.prototype._toJSON=function(a,d,e){void 0===d&&(d={});var b=!0,g;for(g in a.children){b=!1;var h=a.getChild(g);if(h){var k=h.getNode();k&&k.isFile()?(h=h.getPath(),
|
||
|
e&&(h=Pb(e,h)),d[h]=k.getBuffer()):k&&k.isDirectory()&&this._toJSON(h,d,e)}}a=a.getPath();e&&(a=Pb(e,a));a&&b&&(d[a]=null);return d};a.prototype.toJSON=function(a,d,e){var b,g;void 0===d&&(d={});void 0===e&&(e=!1);var h=[];if(a){a instanceof Array||(a=[a]);try{for(var k=rc(a),l=k.next();!l.done;l=k.next()){var q=eh(l.value),m=this.volume.getResolvedLink(q);m&&h.push(m)}}catch(Zc){var n={error:Zc}}finally{try{l&&!l.done&&(b=k.return)&&b.call(k)}finally{if(n)throw n.error;}}}else h.push(this.volume.root);
|
||
|
if(!h.length)return d;try{for(var P=rc(h),p=P.next();!p.done;p=P.next())m=p.value,this._toJSON(m,d,e?m.getPath():"")}catch(Zc){var u={error:Zc}}finally{try{p&&!p.done&&(g=P.return)&&g.call(P)}finally{if(u)throw u.error;}}return d};a.prototype.fromJSONFixed=function(a,d){for(var b in d){var f=d[b];if(f?null!==Object.getPrototypeOf(f):null!==f){var g=fh(b);1<g.length&&(g="/"+g.slice(0,g.length-1).join("/"),a.mkdirpBase(g,511));a.writeFileSync(b,f||"")}else a.mkdirpBase(b,511)}};a.prototype.fromJSON=
|
||
|
function(a){this.volume=new qf;this.fromJSONFixed(this.volume,a);this.fs=sf(this.volume);this.volume.releasedFds=[0,1,2];a=this.volume.openSync("/dev/stderr","w");var b=this.volume.openSync("/dev/stdout","w"),e=this.volume.openSync("/dev/stdin","r");if(2!==a)throw Error("invalid handle for stderr: "+a);if(1!==b)throw Error("invalid handle for stdout: "+b);if(0!==e)throw Error("invalid handle for stdin: "+e);};a.prototype.getStdOut=function(){return Gf(this,void 0,void 0,function(){var a,d=this;return Hf(this,
|
||
|
function(){a=new Promise(function(a){a(d.fs.readFileSync("/dev/stdout","utf8"))});return[2,a]})})};return a}(),dc=void 0;"object"===typeof window?dc=window.TextDecoder:"object"===typeof self?dc=self.TextDecoder:"function"===typeof require&&(dc=require("util").TextDecoder);var hh=function(){function a(a){this.wasmFs=a;this.wasmFs.volume.mkdirSync("/_wasmer/dev/fb0",{recursive:!0});this.wasmFs.volume.writeFileSync("/_wasmer/dev/fb0/fb","");this.wasmFs.volume.writeFileSync("/_wasmer/dev/fb0/virtual_size",
|
||
|
"");this.wasmFs.volume.writeFileSync("/_wasmer/dev/fb0/draw","");this.wasmFs.volume.writeFileSync("/_wasmer/dev/fb0/input","");this.windowSizeCallback=function(){};this.bufferIndexDisplayCallback=function(){};this.inputCallback=function(){return new Uint8Array};this.fdFrameBuffer=this.wasmFs.volume.openSync("/_wasmer/dev/fb0/fb","w+");this.fdBufferIndexDisplay=this.wasmFs.volume.openSync("/_wasmer/dev/fb0/draw","w+");this.fdWindowSize=this.wasmFs.fs.openSync("/_wasmer/dev/fb0/virtual_size","w+");
|
||
|
this.fdInput=this.wasmFs.volume.openSync("/_wasmer/dev/fb0/input","w+");var b=this,e=this.wasmFs.volume.fds[this.fdInput].node.read;this.wasmFs.volume.fds[this.fdInput].node.read=function(){var a=b.inputCallback();b.wasmFs.volume.writeFileSync("/_wasmer/dev/fb0/input",a);a=Array.prototype.slice.call(arguments);return e.apply(b.wasmFs.volume.fds[b.fdInput].node,a)};var f=this.wasmFs.volume.fds[this.fdWindowSize].node.write;this.wasmFs.volume.fds[this.fdWindowSize].node.write=function(){var a=Array.prototype.slice.call(arguments);
|
||
|
a=f.apply(b.wasmFs.volume.fds[b.fdWindowSize].node,a);b.windowSizeCallback();return a};var g=this.wasmFs.volume.fds[this.fdBufferIndexDisplay].node.write;this.wasmFs.volume.fds[this.fdBufferIndexDisplay].node.write=function(){var a=Array.prototype.slice.call(arguments);a=g.apply(b.wasmFs.volume.fds[b.fdBufferIndexDisplay].node,a);b.bufferIndexDisplayCallback();return a}}a.prototype.getFrameBuffer=function(){return this.wasmFs.fs.readFileSync("/_wasmer/dev/fb0/fb")};a.prototype.getWindowSize=function(){var a=
|
||
|
this.wasmFs.fs.readFileSync("/_wasmer/dev/fb0/virtual_size");return 0<a.length?(a=(new dc("utf-8")).decode(a).split("x"),[parseInt(a[0],10),parseInt(a[1],10)]):[0,0]};a.prototype.setWindowSizeCallback=function(a){this.windowSizeCallback=a};a.prototype.setBufferIndexDisplayCallback=function(a){this.bufferIndexDisplayCallback=a};a.prototype.setInputCallback=function(a){this.inputCallback=a};return a}(),ih="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof na?na:{},n="undefined"!==typeof BigInt?
|
||
|
BigInt:ih.BigInt||Number,ec=DataView;ec.prototype.setBigUint64||(ec.prototype.setBigUint64=function(a,b,d){if(b<Math.pow(2,32)){b=Number(b);var e=0}else{e=b.toString(2);b="";for(var f=0;f<64-e.length;f++)b+="0";b+=e;e=parseInt(b.substring(0,32),2);b=parseInt(b.substring(32),2)}this.setUint32(a+(d?0:4),b,d);this.setUint32(a+(d?4:0),e,d)},ec.prototype.getBigUint64=function(a,b){var d=this.getUint32(a+(b?0:4),b);a=this.getUint32(a+(b?4:0),b);d=d.toString(2);a=a.toString(2);b="";for(var e=0;e<32-d.length;e++)b+=
|
||
|
"0";return n("0b"+a+(b+d))});var Bb="undefined"!==typeof na?na:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{},ea=[],M=[],Jg="undefined"!==typeof Uint8Array?Uint8Array:Array,Sc=!1,jh={}.toString,Re=Array.isArray||function(a){return"[object Array]"==jh.call(a)};m.TYPED_ARRAY_SUPPORT=void 0!==Bb.TYPED_ARRAY_SUPPORT?Bb.TYPED_ARRAY_SUPPORT:!0;var kh=m.TYPED_ARRAY_SUPPORT?2147483647:1073741823;m.poolSize=8192;m._augment=function(a){a.__proto__=m.prototype;return a};m.from=function(a,
|
||
|
b,d){return Oe(null,a,b,d)};m.TYPED_ARRAY_SUPPORT&&(m.prototype.__proto__=Uint8Array.prototype,m.__proto__=Uint8Array);m.alloc=function(a,b,d){Qe(a);return a=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<g;++f)if(a[f]!==b[f]){d=a[f];e=b[f];break}return d<e?-1:e<d?1:0};m.isEncoding=function(a){switch(String(a).toLowerCase()){case "hex":case "utf8":case "utf-8":case "ascii":case "latin1":case "binary":case "base64":case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return!0;default:return!1}};m.concat=function(a,b){if(!Re(a))throw new TypeError('"list" argument must be an Array of Buffers');if(0===a.length)return m.alloc(0);var d;if(void 0===b)for(d=b=0;d<a.length;++d)b+=
|
||
|
a[d].length;b=m.allocUnsafe(b);var e=0;for(d=0;d<a.length;++d){var f=a[d];if(!fa(f))throw new TypeError('"list" argument must be an Array of Buffers');f.copy(b,e);e+=f.length}return b};m.byteLength=Pe;m.prototype._isBuffer=!0;m.prototype.swap16=function(){var a=this.length;if(0!==a%2)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var b=0;b<a;b+=2)Ma(this,b,b+1);return this};m.prototype.swap32=function(){var a=this.length;if(0!==a%4)throw new RangeError("Buffer size must be a multiple of 32-bits");
|
||
|
for(var b=0;b<a;b+=4)Ma(this,b,b+3),Ma(this,b+1,b+2);return this};m.prototype.swap64=function(){var a=this.length;if(0!==a%8)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var b=0;b<a;b+=8)Ma(this,b,b+7),Ma(this,b+1,b+6),Ma(this,b+2,b+5),Ma(this,b+3,b+4);return this};m.prototype.toString=function(){var a=this.length|0;return 0===a?"":0===arguments.length?Te(this,0,a):Hg.apply(this,arguments)};m.prototype.equals=function(a){if(!fa(a))throw new TypeError("Argument must be a Buffer");
|
||
|
return this===a?!0:0===m.compare(this,a)};m.prototype.inspect=function(){var a="";0<this.length&&(a=this.toString("hex",0,50).match(/.{2}/g).join(" "),50<this.length&&(a+=" ... "));return"<Buffer "+a+">"};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;b<k;++b)if(e[b]!==a[b]){g=e[b];h=a[b];break}return g<h?-1:h<g?1:0};m.prototype.includes=function(a,b,d){return-1!==this.indexOf(a,b,d)};m.prototype.indexOf=function(a,b,d){return Ue(this,a,b,d,!0)};m.prototype.lastIndexOf=function(a,b,d){return Ue(this,a,b,d,!1)};m.prototype.write=function(a,b,d,e){if(void 0===b)e="utf8",d=this.length,b=0;else if(void 0===
|
||
|
d&&"string"===typeof b)e=b,d=this.length,b=0;else if(isFinite(b))b|=0,isFinite(d)?(d|=0,void 0===e&&(e="utf8")):(e=d,d=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var f=this.length-b;if(void 0===d||d>f)d=f;if(0<a.length&&(0>d||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<d;++e){f=parseInt(a.substr(2*e,2),16);if(isNaN(f)){a=e;break a}this[b+e]=f}a=e}return a;case "utf8":case "utf-8":return ub(Xb(a,this.length-b),this,b,d);case "ascii":return ub(Xe(a),this,b,d);case "latin1":case "binary":return ub(Xe(a),this,b,d);case "base64":return ub(Se(a),this,b,d);case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":e=a;f=this.length-b;for(var g=[],h=0;h<e.length&&!(0>(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<a&&(b=a);if(m.TYPED_ARRAY_SUPPORT)b=this.subarray(a,b),b.__proto__=m.prototype;else{d=b-a;b=new m(d,void 0);for(var e=0;e<d;++e)b[e]=this[e+a]}return b};
|
||
|
m.prototype.readUIntLE=function(a,b,d){a|=0;b|=0;d||I(a,b,this.length);d=this[a];for(var e=1,f=0;++f<b&&(e*=256);)d+=this[a+f]*e;return d};m.prototype.readUIntBE=function(a,b,d){a|=0;b|=0;d||I(a,b,this.length);d=this[a+--b];for(var e=1;0<b&&(e*=256);)d+=this[a+--b]*e;return d};m.prototype.readUInt8=function(a,b){b||I(a,1,this.length);return this[a]};m.prototype.readUInt16LE=function(a,b){b||I(a,2,this.length);return this[a]|this[a+1]<<8};m.prototype.readUInt16BE=function(a,b){b||I(a,2,this.length);
|
||
|
return this[a]<<8|this[a+1]};m.prototype.readUInt32LE=function(a,b){b||I(a,4,this.length);return(this[a]|this[a+1]<<8|this[a+2]<<16)+16777216*this[a+3]};m.prototype.readUInt32BE=function(a,b){b||I(a,4,this.length);return 16777216*this[a]+(this[a+1]<<16|this[a+2]<<8|this[a+3])};m.prototype.readIntLE=function(a,b,d){a|=0;b|=0;d||I(a,b,this.length);d=this[a];for(var e=1,f=0;++f<b&&(e*=256);)d+=this[a+f]*e;d>=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<d&&(e*=256);)f+=this[a+--d]*e;f>=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<d&&(e*=256);)this[b+f]=a/e&255;return b+d};m.prototype.writeUIntBE=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=d-1;var f=1;for(this[b+e]=a&255;0<=--e&&(f*=256);)this[b+e]=a/f&255;return b+d};m.prototype.writeUInt8=function(a,b,d){a=+a;b|=0;d||V(this,a,b,1,255,0);m.TYPED_ARRAY_SUPPORT||(a=Math.floor(a));this[b]=a&255;return b+1};m.prototype.writeUInt16LE=
|
||
|
function(a,b,d){a=+a;b|=0;d||V(this,a,b,2,65535,0);m.TYPED_ARRAY_SUPPORT?(this[b]=a&255,this[b+1]=a>>>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;++e<d&&(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.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);0<e&&e<d&&(e=d);if(e===d||0===a.length||0===this.length)return 0;if(0>b)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-b<e-d&&(e=a.length-b+d);var f=e-d;if(this===a&&d<b&&b<e)for(e=f-1;0<=e;--e)a[e+b]=this[e+d];else if(1E3>f||!m.TYPED_ARRAY_SUPPORT)for(e=0;e<f;++e)a[e+b]=this[e+d];else Uint8Array.prototype.set.call(a,this.subarray(d,
|
||
|
d+f),b);return f};m.prototype.fill=function(a,b,d,e){if("string"===typeof a){"string"===typeof b?(e=b,b=0,d=this.length):"string"===typeof d&&(e=d,d=this.length);if(1===a.length){var f=a.charCodeAt(0);256>f&&(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<b||this.length<d)throw new RangeError("Out of range index");if(d<=
|
||
|
b)return this;b>>>=0;d=void 0===d?this.length:d>>>0;a||(a=0);if("number"===typeof a)for(e=b;e<d;++e)this[e]=a;else for(a=fa(a)?a:Xb((new m(a,e)).toString()),f=a.length,e=0;e<d-b;++e)this[e+b]=a[e%f];return this};var Ig=/[^+\/0-9A-Za-z-_]/g,fc=Object.freeze({__proto__:null,INSPECT_MAX_BYTES:50,kMaxLength:kh,Buffer:m,SlowBuffer:function(a){+a!=a&&(a=0);return m.alloc(+a)},isBuffer:Ye}),G=m,gc="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof na?na:"undefined"!==
|
||
|
typeof self?self:{},ra=$e,ya=af;"function"===typeof Bb.setTimeout&&(ra=setTimeout);"function"===typeof Bb.clearTimeout&&(ya=clearTimeout);var sa=[],ab=!1,Na,ac=-1;ef.prototype.run=function(){this.fun.apply(null,this.array)};var jb=Bb.performance||{},lh=jb.now||jb.mozNow||jb.msNow||jb.oNow||jb.webkitNow||function(){return(new Date).getTime()},mh=new Date,nh={nextTick:df,title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:Oa,addListener:Oa,once:Oa,off:Oa,removeListener:Oa,removeAllListeners:Oa,
|
||
|
emit:Oa,binding:function(){throw Error("process.binding is not supported");},cwd:function(){return"/"},chdir:function(){throw Error("process.chdir is not supported");},umask:function(){return 0},hrtime:function(a){var b=.001*lh.call(jb),d=Math.floor(b);b=Math.floor(b%1*1E9);a&&(d-=a[0],b-=a[1],0>b&&(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?0<a.length?"/"+a:"/":0<a.length?a:"."},normalize:function(a){ha(a);if(0===a.length)return".";var b=47===a.charCodeAt(0),d=47===
|
||
|
a.charCodeAt(a.length-1);a=ff(a,!b);0!==a.length||b||(a=".");0<a.length&&d&&(a+="/");return b?"/"+a:a},isAbsolute:function(a){ha(a);return 0<a.length&&47===a.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var a,b=0;b<arguments.length;++b){var d=arguments[b];ha(d);0<d.length&&(a=void 0===a?d:a+("/"+d))}return void 0===a?".":Cb.normalize(a)},relative:function(a,b){ha(a);ha(b);if(a===b)return"";a=Cb.resolve(a);b=Cb.resolve(b);if(a===b)return"";for(var d=1;d<a.length&&47===a.charCodeAt(d);++d);
|
||
|
for(var e=a.length,f=e-d,g=1;g<b.length&&47===b.charCodeAt(g);++g);for(var h=b.length-g,k=f<h?f:h,l=-1,m=0;m<=k;++m){if(m===k){if(h>k){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.length)return f+b.slice(g+l);g+=l;47===b.charCodeAt(g)&&++g;
|
||
|
return b.slice(g)},_makeLong:function(a){return a},dirname:function(a){ha(a);if(0===a.length)return".";for(var b=a.charCodeAt(0),d=47===b,e=-1,f=!0,g=a.length-1;1<=g;--g)if(b=a.charCodeAt(g),47===b){if(!f){e=g;break}}else f=!1;return-1===e?d?"/":".":d&&1===e?"//":a.slice(0,e)},basename:function(a,b){if(void 0!==b&&"string"!==typeof b)throw new TypeError('"ext" argument must be a string');ha(a);var d=0,e=-1,f=!0,g;if(void 0!==b&&0<b.length&&b.length<=a.length){if(b.length===a.length&&b===a)return"";
|
||
|
var h=b.length-1,k=-1;for(g=a.length-1;0<=g;--g){var l=a.charCodeAt(g);if(47===l){if(!f){d=g+1;break}}else-1===k&&(f=!1,k=g+1),0<=h&&(l===b.charCodeAt(h)?-1===--h&&(e=g):(h=-1,e=k))}d===e?e=k:-1===e&&(e=a.length);return a.slice(d,e)}for(g=a.length-1;0<=g;--g)if(47===a.charCodeAt(g)){if(!f){d=g+1;break}}else-1===e&&(f=!1,e=g+1);return-1===e?"":a.slice(d,e)},extname:function(a){ha(a);for(var b=-1,d=0,e=-1,f=!0,g=0,h=a.length-1;0<=h;--h){var k=a.charCodeAt(h);if(47===k){if(!f){d=h+1;break}}else-1===
|
||
|
e&&(f=!1,e=h+1),46===k?-1===b?b=h:1!==g&&(g=1):-1!==b&&(g=-1)}return-1===b||-1===e||0===g||1===g&&b===e-1&&b===d+1?"":a.slice(b,e)},format:function(a){if(null===a||"object"!==typeof a)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof a);var b=a.dir||a.root,d=a.base||(a.name||"")+(a.ext||"");return a=b?b===a.root?b+d:b+"/"+d:d},parse:function(a){ha(a);var b={root:"",dir:"",base:"",ext:"",name:""};if(0===a.length)return b;var d=a.charCodeAt(0),e=47===d;if(e){b.root=
|
||
|
"/";var f=1}else f=0;for(var g=-1,h=0,k=-1,l=!0,m=a.length-1,n=0;m>=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));0<h?b.dir=a.slice(0,h-1):e&&(b.dir="/");return b},sep:"/",delimiter:":",win32:null,
|
||
|
posix:null},uf=Cb.posix=Cb,rh=Object.freeze({__proto__:null,"default":uf,__moduleExports:uf}),wf={hrtime:function(a){return function(b){b=a(b);return 1E9*b[0]+b[1]}}(function(a){var b=.001*performance.now(),d=Math.floor(b)+qh;b=Math.floor(b%1*1E9);a&&(d-=a[0],b-=a[1],0>b&&(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;b<a.byteLength;)b+=r.writeSync(l.real,a,b,a.byteLength-b,Number(g)+m+b);m+=b});h.view.setUint32(k,m,!0);return 0}),fd_write:B(function(a,b,d,g){var k=e(a,Da),l=0;f(b,d).forEach(function(a){for(var b=0;b<a.byteLength;){var d=r.writeSync(k.real,a,b,a.byteLength-b,k.offset?Number(k.offset):null);k.offset&&(k.offset+=n(d));b+=d}l+=b});h.view.setUint32(g,l,!0);return 0}),fd_pread:B(function(a,b,d,g,k){var l;a=e(a,Ba|kb);var m=0;try{var w=Sb(f(b,d)),n=w.next();a:for(;!n.done;n=w.next()){var F=n.value;
|
||
|
for(b=0;b<F.byteLength;){var q=F.byteLength-b,p=r.readSync(a.real,F,b,F.byteLength-b,Number(g)+m+b);b+=p;m+=p;if(0===p||p<q)break a}m+=b}}catch(O){var t={error:O}}finally{try{n&&!n.done&&(l=w.return)&&l.call(w)}finally{if(t)throw t.error;}}h.view.setUint32(k,m,!0);return 0}),fd_read:B(function(a,b,d,g){var k;a=e(a,Ba);var l=0===a.real,m=0;try{var w=Sb(f(b,d)),F=w.next();a:for(;!F.done;F=w.next()){var p=F.value;for(b=0;b<p.byteLength;){var q=p.byteLength-b,t=r.readSync(a.real,p,b,q,l||void 0===a.offset?
|
||
|
null:Number(a.offset));l||(a.offset=(a.offset?a.offset:n(0))+n(t));b+=t;m+=t;if(0===t||t<q)break a}}}catch(O){var bc={error:O}}finally{try{F&&!F.done&&(k=w.return)&&k.call(w)}finally{if(bc)throw bc.error;}}h.view.setUint32(g,m,!0);return 0}),fd_readdir:B(function(a,b,d,f,g){a=e(a,jc);h.refreshMemory();var k=r.readdirSync(a.path,{withFileTypes:!0}),l=b;for(f=Number(f);f<k.length;f+=1){var m=k[f],w=G.byteLength(m.name);if(b-l>d)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;l<e;l+=1){var m=h.view.getBigUint64(a,!0);a+=8;var p=h.view.getUint8(a);a+=1;switch(p){case 0:a+=7;h.view.getBigUint64(a,!0);a+=8;var q=h.view.getUint32(a,!0);a+=4;a+=4;p=h.view.getBigUint64(a,!0);a+=8;h.view.getBigUint64(a,!0);a+=8;var r=h.view.getUint16(a,!0);a+=2;a+=6;var t=1===r;r=0;q=n(b(q));null===q?r=28:(p=t?p:q+p,k=
|
||
|
p>k?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()<k;);return 0},proc_exit:function(a){A.exit(a);return 0},proc_raise:function(a){if(!(a in yf))return 28;A.kill(yf[a]);return 0},random_get:function(a,b){h.refreshMemory();A.randomFillSync(new Uint8Array(h.memory.buffer),
|
||
|
a,b);return 0},sched_yield:function(){return 0},sock_recv:function(){return 52},sock_send:function(){return 52},sock_shutdown:function(){return 52}};a.traceSyscalls&&Object.keys(this.wasiImport).forEach(function(a){var b=h.wasiImport[a];h.wasiImport[a]=function(){for(var d=[],e=0;e<arguments.length;e++)d[e]=arguments[e];console.log("WASI: wasiImport called: "+a+" ("+d+")");try{var f=b.apply(void 0,Ub(d));console.log("WASI: => "+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<a){for(var d=new Uint8Array(a),e=0;e<a;e++)d[e]=b.sharedIoDeviceInput[e+1];return d}return new Uint8Array}return b.ioDeviceWindow.getInputBuffer()});this.dataCallback=e;this.endCallback=f;this.errorCallback=g;d=void 0;k&&(d=new Int32Array(k));this.sharedIoDeviceInput=d;k=void 0;l&&(k=new Int32Array(l));this.command=a.module?new uh(a):new vh(a);this.wasmFs.volume.fds[0].node.read=this.stdinRead.bind(this);this.wasmFs.volume.fds[1].node.write=this.stdoutWrite.bind(this);this.wasmFs.volume.fds[2].node.write=
|
||
|
this.stdoutWrite.bind(this);a=this.wasmFs.volume.openSync("/dev/tty","w+");this.wasmFs.volume.fds[a].node.read=this.stdinRead.bind(this);this.wasmFs.volume.fds[a].node.write=this.stdoutWrite.bind(this);this.sharedStdin=k;this.startStdinReadCallback=m;this.readStdinCounter=0;this.pipedStdin=""}a.prototype.start=function(a){return Eb(this,void 0,void 0,function(){var b,e,f,g=this;return Fb(this,function(d){switch(d.label){case 0:b=function(){g.ioDeviceWindow.resize(0,0);setTimeout(function(){g.endCallback(g.wasmFs.toJSON())},
|
||
|
50)},d.label=1;case 1:return d.trys.push([1,3,,4]),a&&(this.pipedStdin=(new TextDecoder("utf-8")).decode(a)),[4,this.command.run(this.wasmFs)];case 2:return d.sent(),b(),[3,4];case 3:e=d.sent();if(e instanceof vf)return b(),[2];f="Unknown Error";if(void 0!==e.code)f="exited with code: "+e.code;else if(void 0!==e.signal)f="killed with signal: "+e.signal;else if(void 0!==e.user)return b(),[2];console.error(e);this.errorCallback(f,this.wasmFs.toJSON(),void 0!==e.user);return[3,4];case 4:return[2]}})})};
|
||
|
a.prototype.stdoutWrite=function(a,d,e,f){this.dataCallback&&this.dataCallback(a);d=(new TextDecoder("utf-8")).decode(a).split("\n");this.stdinPrompt=0<d.length?d[d.length-1].replace(/[\u001B\u009B][[\]()#;?]*(?:(?:(?:[a-zA-Z\d]*(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)|(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-ntqry=><~]))/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<d;f++)e[f]=this.sharedStdin[1+f];d=(new TextDecoder("utf-8")).decode(e)}else{d=prompt("Please enter text for stdin:\n"+this.stdinPrompt);if(null===d)throw this.dataCallback&&this.dataCallback((new TextEncoder).encode("\n")),a=Error("Process killed by user"),a.user=!0,a;d+="\n";
|
||
|
this.dataCallback&&this.dataCallback((new TextEncoder).encode(d))}if(!d)return 0;d=(new TextEncoder).encode(d);for(e=0;e<d.length;++e)a[e]=d[e];return d.length};return a}();mc(wh)})()
|