UNPKG

stormflow

Version:

StormFlow is a versatile Node.js data management library designed for efficient data management.

1 lines 347 kB
"use strict";const t=require("fs"),e=require("events"),r=require("path"),n=require("constants"),i=require("stream"),s=require("util"),o=require("assert"),a=require("buffer"),l=require("node:url"),h=require("node:path"),u=require("node:fs"),c=require("node:fs/promises"),f=require("node:events"),d=require("node:stream"),p=require("node:string_decoder"),g=require("zlib"),y=require("fs/promises");var b,m,w,v,S,E,x,k,T,R,A="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function O(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function L(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if("function"==typeof e){var r=function t(){var r=!1;try{r=this instanceof t}catch{}return r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(e){var n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,n.get?n:{enumerable:!0,get:function(){return t[e]}})}),r}function M(){if(m)return b;m=1;const t="object"==typeof process&&process&&"win32"===process.platform;return b=t?{sep:"\\"}:{sep:"/"}}function P(){if(E)return S;E=1;var t=function(){if(v)return w;function t(t,n,i){t instanceof RegExp&&(t=e(t,i)),n instanceof RegExp&&(n=e(n,i));var s=r(t,n,i);return s&&{start:s[0],end:s[1],pre:i.slice(0,s[0]),body:i.slice(s[0]+t.length,s[1]),post:i.slice(s[1]+n.length)}}function e(t,e){var r=e.match(t);return r?r[0]:null}function r(t,e,r){var n,i,s,o,a,l=r.indexOf(t),h=r.indexOf(e,l+1),u=l;if(l>=0&&h>0){if(t===e)return[l,h];for(n=[],s=r.length;u>=0&&!a;)u==l?(n.push(u),l=r.indexOf(t,u+1)):1==n.length?a=[n.pop(),h]:((i=n.pop())<s&&(s=i,o=h),h=r.indexOf(e,u+1)),u=l<h&&l>=0?l:h;n.length&&(a=[s,o])}return a}return v=1,w=t,t.range=r,w}();S=function(t){if(!t)return[];"{}"===t.substr(0,2)&&(t="\\{\\}"+t.substr(2));return d(function(t){return t.split("\\\\").join(e).split("\\{").join(r).split("\\}").join(n).split("\\,").join(i).split("\\.").join(s)}(t),!0).map(a)};var e="\0SLASH"+Math.random()+"\0",r="\0OPEN"+Math.random()+"\0",n="\0CLOSE"+Math.random()+"\0",i="\0COMMA"+Math.random()+"\0",s="\0PERIOD"+Math.random()+"\0";function o(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function a(t){return t.split(e).join("\\").split(r).join("{").split(n).join("}").split(i).join(",").split(s).join(".")}function l(e){if(!e)return[""];var r=[],n=t("{","}",e);if(!n)return e.split(",");var i=n.pre,s=n.body,o=n.post,a=i.split(",");a[a.length-1]+="{"+s+"}";var h=l(o);return o.length&&(a[a.length-1]+=h.shift(),a.push.apply(a,h)),r.push.apply(r,a),r}function h(t){return"{"+t+"}"}function u(t){return/^-?0\d/.test(t)}function c(t,e){return t<=e}function f(t,e){return t>=e}function d(e,r){var i=[],s=t("{","}",e);if(!s)return[e];var a=s.pre,p=s.post.length?d(s.post,!1):[""];if(/\$$/.test(s.pre))for(var g=0;g<p.length;g++){var y=a+"{"+s.body+"}"+p[g];i.push(y)}else{var b,m,w=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),_=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),v=w||_,S=s.body.indexOf(",")>=0;if(!v&&!S)return s.post.match(/,(?!,).*\}/)?d(e=s.pre+"{"+s.body+n+s.post):[e];if(v)b=s.body.split(/\.\./);else if(1===(b=l(s.body)).length&&1===(b=d(b[0],!1).map(h)).length)return p.map(function(t){return s.pre+b[0]+t});if(v){var E=o(b[0]),x=o(b[1]),k=Math.max(b[0].length,b[1].length),T=3==b.length?Math.abs(o(b[2])):1,R=c;x<E&&(T*=-1,R=f);var A=b.some(u);m=[];for(var O=E;R(O,x);O+=T){var L;if(_)"\\"===(L=String.fromCharCode(O))&&(L="");else if(L=String(O),A){var M=k-L.length;if(M>0){var P=new Array(M+1).join("0");L=O<0?"-"+P+L.slice(1):P+L}}m.push(L)}}else{m=[];for(var I=0;I<b.length;I++)m.push.apply(m,d(b[I],!1))}for(I=0;I<m.length;I++)for(g=0;g<p.length;g++){y=a+m[I]+p[g];(!r||v||y)&&i.push(y)}}return i}return S}function I(){if(k)return x;k=1;const t=x=(t,e,r={})=>(d(e),!(!r.nocomment&&"#"===e.charAt(0))&&new b(e,r).match(t));x=t;const e=M();t.sep=e.sep;const r=Symbol("globstar **");t.GLOBSTAR=r;const n=P(),i={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},s="[^/]",o=s+"*?",a=t=>t.split("").reduce((t,e)=>(t[e]=!0,t),{}),l=a("().*{}+?[]^$\\!"),h=a("[.("),u=/\/+/;t.filter=(e,r={})=>(n,i,s)=>t(n,e,r);const c=(t,e={})=>{const r={};return Object.keys(t).forEach(e=>r[e]=t[e]),Object.keys(e).forEach(t=>r[t]=e[t]),r};t.defaults=e=>{if(!e||"object"!=typeof e||!Object.keys(e).length)return t;const r=t,n=(t,n,i)=>r(t,n,c(e,i));return n.Minimatch=class extends r.Minimatch{constructor(t,r){super(t,c(e,r))}},n.Minimatch.defaults=t=>r.defaults(c(e,t)).Minimatch,n.filter=(t,n)=>r.filter(t,c(e,n)),n.defaults=t=>r.defaults(c(e,t)),n.makeRe=(t,n)=>r.makeRe(t,c(e,n)),n.braceExpand=(t,n)=>r.braceExpand(t,c(e,n)),n.match=(t,n,i)=>r.match(t,n,c(e,i)),n},t.braceExpand=(t,e)=>f(t,e);const f=(t,e={})=>(d(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:n(t)),d=t=>{if("string"!=typeof t)throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")},p=Symbol("subparse");t.makeRe=(t,e)=>new b(t,e||{}).makeRe(),t.match=(t,e,r={})=>{const n=new b(e,r);return t=t.filter(t=>n.match(t)),n.options.nonull&&!t.length&&t.push(e),t};const g=t=>t.replace(/\\([^-\]])/g,"$1"),y=t=>t.replace(/[[\]\\]/g,"\\$&");class b{constructor(t,e){d(t),e||(e={}),this.options=e,this.set=[],this.pattern=t,this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||!1===e.allowWindowsEscape,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.make()}debug(){}make(){const t=this.pattern,e=this.options;if(!e.nocomment&&"#"===t.charAt(0))return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate();let r=this.globSet=this.braceExpand();e.debug&&(this.debug=(...t)=>console.error(...t)),this.debug(this.pattern,r),r=this.globParts=r.map(t=>t.split(u)),this.debug(this.pattern,r),r=r.map((t,e,r)=>t.map(this.parse,this)),this.debug(this.pattern,r),r=r.filter(t=>-1===t.indexOf(!1)),this.debug(this.pattern,r),this.set=r}parseNegate(){if(this.options.nonegate)return;const t=this.pattern;let e=!1,r=0;for(let n=0;n<t.length&&"!"===t.charAt(n);n++)e=!e,r++;r&&(this.pattern=t.slice(r)),this.negate=e}matchOne(t,e,n){var i=this.options;this.debug("matchOne",{this:this,file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var s=0,o=0,a=t.length,l=e.length;s<a&&o<l;s++,o++){this.debug("matchOne loop");var h,u=e[o],c=t[s];if(this.debug(e,u,c),!1===u)return!1;if(u===r){this.debug("GLOBSTAR",[e,u,c]);var f=s,d=o+1;if(d===l){for(this.debug("** at the end");s<a;s++)if("."===t[s]||".."===t[s]||!i.dot&&"."===t[s].charAt(0))return!1;return!0}for(;f<a;){var p=t[f];if(this.debug("\nglobstar while",t,f,e,d,p),this.matchOne(t.slice(f),e.slice(d),n))return this.debug("globstar found match!",f,a,p),!0;if("."===p||".."===p||!i.dot&&"."===p.charAt(0)){this.debug("dot detected!",t,f,e,d);break}this.debug("globstar swallow a segment, and continue"),f++}return!(!n||(this.debug("\n>>> no match, partial?",t,f,e,d),f!==a))}if("string"==typeof u?(h=c===u,this.debug("string match",u,c,h)):(h=c.match(u),this.debug("pattern match",u,c,h)),!h)return!1}if(s===a&&o===l)return!0;if(s===a)return n;if(o===l)return s===a-1&&""===t[s];throw new Error("wtf?")}braceExpand(){return f(this.pattern,this.options)}parse(t,e){d(t);const n=this.options;if("**"===t){if(!n.noglobstar)return r;t="*"}if(""===t)return"";let a="",u=!1,c=!1;const f=[],b=[];let m,w,_,v,S=!1,E=-1,x=-1,k="."===t.charAt(0),T=n.dot||k;const R=t=>"."===t.charAt(0)?"":n.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",A=()=>{if(m){switch(m){case"*":a+=o,u=!0;break;case"?":a+=s,u=!0;break;default:a+="\\"+m}this.debug("clearStateChar %j %j",m,a),m=!1}};for(let e,r=0;r<t.length&&(e=t.charAt(r));r++)if(this.debug("%s\t%s %s %j",t,r,a,e),c){if("/"===e)return!1;l[e]&&(a+="\\"),a+=e,c=!1}else switch(e){case"/":return!1;case"\\":if(S&&"-"===t.charAt(r+1)){a+=e;continue}A(),c=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s\t%s %s %j <-- stateChar",t,r,a,e),S){this.debug(" in class"),"!"===e&&r===x+1&&(e="^"),a+=e;continue}this.debug("call clearStateChar %j",m),A(),m=e,n.noext&&A();continue;case"(":{if(S){a+="(";continue}if(!m){a+="\\(";continue}const e={type:m,start:r-1,reStart:a.length,open:i[m].open,close:i[m].close};this.debug(this.pattern,"\t",e),f.push(e),a+=e.open,0===e.start&&"!"!==e.type&&(k=!0,a+=R(t.slice(r+1))),this.debug("plType %j %j",m,a),m=!1;continue}case")":{const t=f[f.length-1];if(S||!t){a+="\\)";continue}f.pop(),A(),u=!0,_=t,a+=_.close,"!"===_.type&&b.push(Object.assign(_,{reEnd:a.length}));continue}case"|":{const e=f[f.length-1];if(S||!e){a+="\\|";continue}A(),a+="|",0===e.start&&"!"!==e.type&&(k=!0,a+=R(t.slice(r+1)));continue}case"[":if(A(),S){a+="\\"+e;continue}S=!0,x=r,E=a.length,a+=e;continue;case"]":if(r===x+1||!S){a+="\\"+e;continue}w=t.substring(x+1,r);try{RegExp("["+y(g(w))+"]"),a+=e}catch(t){a=a.substring(0,E)+"(?:$.)"}u=!0,S=!1;continue;default:A(),!l[e]||"^"===e&&S||(a+="\\"),a+=e}for(S&&(w=t.slice(x+1),v=this.parse(w,p),a=a.substring(0,E)+"\\["+v[0],u=u||v[1]),_=f.pop();_;_=f.pop()){let t;t=a.slice(_.reStart+_.open.length),this.debug("setting tail",a,_),t=t.replace(/((?:\\{2}){0,64})(\\?)\|/g,(t,e,r)=>(r||(r="\\"),e+e+r+"|")),this.debug("tail=%j\n %s",t,t,_,a);const e="*"===_.type?o:"?"===_.type?s:"\\"+_.type;u=!0,a=a.slice(0,_.reStart)+e+"\\("+t}A(),c&&(a+="\\\\");const O=h[a.charAt(0)];for(let t=b.length-1;t>-1;t--){const r=b[t],n=a.slice(0,r.reStart),i=a.slice(r.reStart,r.reEnd-8);let s=a.slice(r.reEnd);const o=a.slice(r.reEnd-8,r.reEnd)+s,l=n.split(")").length,h=n.split("(").length-l;let u=s;for(let t=0;t<h;t++)u=u.replace(/\)[+*?]?/,"");s=u;a=n+i+s+(""===s&&e!==p?"(?:$|\\/)":"")+o}if(""!==a&&u&&(a="(?=.)"+a),O&&(a=(k?"":T?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)")+a),e===p)return[a,u];if(n.nocase&&!u&&(u=t.toUpperCase()!==t.toLowerCase()),!u)return t.replace(/\\(.)/g,"$1");const L=n.nocase?"i":"";try{return Object.assign(new RegExp("^"+a+"$",L),{_glob:t,_src:a})}catch(t){return new RegExp("$.")}}makeRe(){if(this.regexp||!1===this.regexp)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const e=this.options,n=e.noglobstar?o:e.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",i=e.nocase?"i":"";let s=t.map(t=>(t=t.map(t=>"string"==typeof t?t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):t===r?r:t._src).reduce((t,e)=>(t[t.length-1]===r&&e===r||t.push(e),t),[]),t.forEach((e,i)=>{e===r&&t[i-1]!==r&&(0===i?t.length>1?t[i+1]="(?:\\/|"+n+"\\/)?"+t[i+1]:t[i]=n:i===t.length-1?t[i-1]+="(?:\\/|"+n+")?":(t[i-1]+="(?:\\/|\\/"+n+"\\/)"+t[i+1],t[i+1]=r))}),t.filter(t=>t!==r).join("/"))).join("|");s="^(?:"+s+")$",this.negate&&(s="^(?!"+s+").*$");try{this.regexp=new RegExp(s,i)}catch(t){this.regexp=!1}return this.regexp}match(t,r=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return""===t;if("/"===t&&r)return!0;const n=this.options;"/"!==e.sep&&(t=t.split(e.sep).join("/")),t=t.split(u),this.debug(this.pattern,"split",t);const i=this.set;let s;this.debug(this.pattern,"set",i);for(let e=t.length-1;e>=0&&(s=t[e],!s);e--);for(let e=0;e<i.length;e++){const o=i[e];let a=t;n.matchBase&&1===o.length&&(a=[s]);if(this.matchOne(a,o,r))return!!n.flipNegate||!this.negate}return!n.flipNegate&&this.negate}static defaults(e){return t.defaults(e).Minimatch}}return t.Minimatch=b,x}function D(){if(R)return T;R=1,T=u;const n=t,{EventEmitter:i}=e,{Minimatch:s}=I(),{resolve:o}=r;function a(t,e){return new Promise((r,i)=>{(e?n.stat:n.lstat)(t,(n,i)=>{if(n)if("ENOENT"===n.code)r(e?a(t,!1):null);else r(null);else r(i)})})}async function*l(t,e,r,i,s,o){let h=await function(t,e){return new Promise((r,i)=>{n.readdir(t,{withFileTypes:!0},(t,n)=>{if(t)switch(t.code){case"ENOTDIR":e?i(t):r([]);break;case"ENOTSUP":case"ENOENT":case"ENAMETOOLONG":case"UNKNOWN":r([]);break;default:i(t)}else r(n)})})}(e+t,o);for(const n of h){let o=n.name;void 0===o&&(o=n,i=!0);const h=t+"/"+o,u=h.slice(1),c=e+"/"+u;let f=null;(i||r)&&(f=await a(c,r)),f||void 0===n.name||(f=n),null===f&&(f={isDirectory:()=>!1}),f.isDirectory()?s(u)||(yield{relative:u,absolute:c,stats:f},yield*l(h,e,r,i,s,!1)):yield{relative:u,absolute:c,stats:f}}}class h extends i{constructor(t,e,r){if(super(),"function"==typeof e&&(r=e,e=null),this.options=function(t){return{pattern:t.pattern,dot:!!t.dot,noglobstar:!!t.noglobstar,matchBase:!!t.matchBase,nocase:!!t.nocase,ignore:t.ignore,skip:t.skip,follow:!!t.follow,stat:!!t.stat,nodir:!!t.nodir,mark:!!t.mark,silent:!!t.silent,absolute:!!t.absolute}}(e||{}),this.matchers=[],this.options.pattern){const t=Array.isArray(this.options.pattern)?this.options.pattern:[this.options.pattern];this.matchers=t.map(t=>new s(t,{dot:this.options.dot,noglobstar:this.options.noglobstar,matchBase:this.options.matchBase,nocase:this.options.nocase}))}if(this.ignoreMatchers=[],this.options.ignore){const t=Array.isArray(this.options.ignore)?this.options.ignore:[this.options.ignore];this.ignoreMatchers=t.map(t=>new s(t,{dot:!0}))}if(this.skipMatchers=[],this.options.skip){const t=Array.isArray(this.options.skip)?this.options.skip:[this.options.skip];this.skipMatchers=t.map(t=>new s(t,{dot:!0}))}this.iterator=async function*(t,e,r,n){yield*l("",t,e,r,n,!0)}(o(t||"."),this.options.follow,this.options.stat,this._shouldSkipDirectory.bind(this)),this.paused=!1,this.inactive=!1,this.aborted=!1,r&&(this._matches=[],this.on("match",t=>this._matches.push(this.options.absolute?t.absolute:t.relative)),this.on("error",t=>r(t)),this.on("end",()=>r(null,this._matches))),setTimeout(()=>this._next(),0)}_shouldSkipDirectory(t){return this.skipMatchers.some(e=>e.match(t))}_fileMatches(t,e){const r=t+(e?"/":"");return(0===this.matchers.length||this.matchers.some(t=>t.match(r)))&&!this.ignoreMatchers.some(t=>t.match(r))&&(!this.options.nodir||!e)}_next(){this.paused||this.aborted?this.inactive=!0:this.iterator.next().then(t=>{if(t.done)this.emit("end");else{const e=t.value.stats.isDirectory();if(this._fileMatches(t.value.relative,e)){let r=t.value.relative,n=t.value.absolute;this.options.mark&&e&&(r+="/",n+="/"),this.options.stat?this.emit("match",{relative:r,absolute:n,stat:t.value.stats}):this.emit("match",{relative:r,absolute:n})}this._next(this.iterator)}}).catch(t=>{this.abort(),this.emit("error",t),t.code||this.options.silent||console.error(t)})}abort(){this.aborted=!0}pause(){this.paused=!0}resume(){this.paused=!1,this.inactive&&(this.inactive=!1,this._next())}}function u(t,e,r){return new h(t,e,r)}return u.ReaddirGlob=h,T}function N(t,...e){return(...r)=>t(...e,...r)}function j(t){return function(...e){var r=e.pop();return t.call(this,e,r)}}var C="function"==typeof queueMicrotask&&queueMicrotask,F="function"==typeof setImmediate&&setImmediate,B="object"==typeof process&&"function"==typeof process.nextTick;function z(t){setTimeout(t,0)}function W(t){return(e,...r)=>t(()=>e(...r))}var U=W(C?queueMicrotask:F?setImmediate:B?process.nextTick:z);function G(t){return q(t)?function(...e){const r=e.pop();return $(t.apply(this,e),r)}:j(function(e,r){var n;try{n=t.apply(this,e)}catch(t){return r(t)}if(n&&"function"==typeof n.then)return $(n,r);r(null,n)})}function $(t,e){return t.then(t=>{H(e,null,t)},t=>{H(e,t&&(t instanceof Error||t.message)?t:new Error(t))})}function H(t,e,r){try{t(e,r)}catch(t){U(t=>{throw t},t)}}function q(t){return"AsyncFunction"===t[Symbol.toStringTag]}function V(t){if("function"!=typeof t)throw new Error("expected a function");return q(t)?G(t):t}function Z(t,e){if(e||(e=t.length),!e)throw new Error("arity is undefined");return function(...r){return"function"==typeof r[e-1]?t.apply(this,r):new Promise((n,i)=>{r[e-1]=(t,...e)=>{if(t)return i(t);n(e.length>1?e:e[0])},t.apply(this,r)})}}function Y(t){return function(e,...r){return Z(function(n){var i=this;return t(e,(t,e)=>{V(t).apply(i,r.concat(e))},n)})}}function K(t,e,r,n){e=e||[];var i=[],s=0,o=V(r);return t(e,(t,e,r)=>{var n=s++;o(t,(t,e)=>{i[n]=e,r(t)})},t=>{n(t,i)})}function Q(t){return t&&"number"==typeof t.length&&t.length>=0&&t.length%1==0}const X={};function J(t){function e(...e){if(null!==t){var r=t;t=null,r.apply(this,e)}}return Object.assign(e,t),e}function tt(t){if(Q(t))return function(t){var e=-1,r=t.length;return function(){return++e<r?{value:t[e],key:e}:null}}(t);var e,r,n,i,s=function(t){return t[Symbol.iterator]&&t[Symbol.iterator]()}(t);return s?function(t){var e=-1;return function(){var r=t.next();return r.done?null:(e++,{value:r.value,key:e})}}(s):(r=(e=t)?Object.keys(e):[],n=-1,i=r.length,function t(){var s=r[++n];return"__proto__"===s?t():n<i?{value:e[s],key:s}:null})}function et(t){return function(...e){if(null===t)throw new Error("Callback was already called.");var r=t;t=null,r.apply(this,e)}}function rt(t,e,r,n){let i=!1,s=!1,o=!1,a=0,l=0;function h(){a>=e||o||i||(o=!0,t.next().then(({value:t,done:e})=>{if(!s&&!i){if(o=!1,e)return i=!0,void(a<=0&&n(null));a++,r(t,l,u),l++,h()}}).catch(c))}function u(t,e){if(a-=1,!s)return t?c(t):!1===t?(i=!0,void(s=!0)):e===X||i&&a<=0?(i=!0,n(null)):void h()}function c(t){s||(o=!1,i=!0,n(t))}h()}var nt=t=>(e,r,n)=>{if(n=J(n),t<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!e)return n(null);if("AsyncGenerator"===e[Symbol.toStringTag])return rt(e,t,r,n);if(function(t){return"function"==typeof t[Symbol.asyncIterator]}(e))return rt(e[Symbol.asyncIterator](),t,r,n);var i=tt(e),s=!1,o=!1,a=0,l=!1;function h(t,e){if(!o)if(a-=1,t)s=!0,n(t);else if(!1===t)s=!0,o=!0;else{if(e===X||s&&a<=0)return s=!0,n(null);l||u()}}function u(){for(l=!0;a<t&&!s;){var e=i();if(null===e)return s=!0,void(a<=0&&n(null));a+=1,r(e.value,e.key,et(h))}l=!1}u()};var it=Z(function(t,e,r,n){return nt(e)(t,V(r),n)},4);function st(t,e,r){r=J(r);var n=0,i=0,{length:s}=t,o=!1;function a(t,e){!1===t&&(o=!0),!0!==o&&(t?r(t):++i!==s&&e!==X||r(null))}for(0===s&&r(null);n<s;n++)e(t[n],n,et(a))}function ot(t,e,r){return it(t,1/0,e,r)}var at=Z(function(t,e,r){return(Q(t)?st:ot)(t,V(e),r)},3);var lt=Z(function(t,e,r){return K(at,t,e,r)},3),ht=Y(lt);var ut=Z(function(t,e,r){return it(t,1,e,r)},3);var ct=Z(function(t,e,r){return K(ut,t,e,r)},3),ft=Y(ct);const dt=Symbol("promiseCallback");function pt(){let t,e;function r(r,...n){if(r)return e(r);t(n.length>1?n:n[0])}return r[dt]=new Promise((r,n)=>{t=r,e=n}),r}function gt(t,e,r){"number"!=typeof e&&(r=e,e=null),r=J(r||pt());var n=Object.keys(t).length;if(!n)return r(null);e||(e=n);var i={},s=0,o=!1,a=!1,l=Object.create(null),h=[],u=[],c={};function f(t,e){h.push(()=>function(t,e){if(a)return;var n=et((e,...n)=>{if(s--,!1!==e)if(n.length<2&&([n]=n),e){var h={};if(Object.keys(i).forEach(t=>{h[t]=i[t]}),h[t]=n,a=!0,l=Object.create(null),o)return;r(e,h)}else i[t]=n,(l[t]||[]).forEach(t=>t()),d();else o=!0});s++;var h=V(e[e.length-1]);e.length>1?h(i,n):h(n)}(t,e))}function d(){if(!o){if(0===h.length&&0===s)return r(null,i);for(;h.length&&s<e;){h.shift()()}}}function p(e){var r=[];return Object.keys(t).forEach(n=>{const i=t[n];Array.isArray(i)&&i.indexOf(e)>=0&&r.push(n)}),r}return Object.keys(t).forEach(e=>{var r=t[e];if(!Array.isArray(r))return f(e,[r]),void u.push(e);var n=r.slice(0,r.length-1),i=n.length;if(0===i)return f(e,r),void u.push(e);c[e]=i,n.forEach(s=>{if(!t[s])throw new Error("async.auto task `"+e+"` has a non-existent dependency `"+s+"` in "+n.join(", "));!function(t,e){var r=l[t];r||(r=l[t]=[]);r.push(e)}(s,()=>{0===--i&&f(e,r)})})}),function(){var t=0;for(;u.length;)t++,p(u.pop()).forEach(t=>{0===--c[t]&&u.push(t)});if(t!==n)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}(),d(),r[dt]}var yt=/^(?:async\s)?(?:function)?\s*(?:\w+\s*)?\(([^)]+)\)(?:\s*{)/,bt=/^(?:async\s)?\s*(?:\(\s*)?((?:[^)=\s]\s*)*)(?:\)\s*)?=>/,mt=/,/,wt=/(=.+)?(\s*)$/;function _t(t,e){var r={};return Object.keys(t).forEach(e=>{var n,i=t[e],s=q(i),o=!s&&1===i.length||s&&0===i.length;if(Array.isArray(i))n=[...i],i=n.pop(),r[e]=n.concat(n.length>0?a:i);else if(o)r[e]=i;else{if(n=function(t){const e=function(t){let e="",r=0,n=t.indexOf("*/");for(;r<t.length;)if("/"===t[r]&&"/"===t[r+1]){let e=t.indexOf("\n",r);r=-1===e?t.length:e}else if(-1!==n&&"/"===t[r]&&"*"===t[r+1]){let i=t.indexOf("*/",r);-1!==i?(r=i+2,n=t.indexOf("*/",r)):(e+=t[r],r++)}else e+=t[r],r++;return e}(t.toString());let r=e.match(yt);if(r||(r=e.match(bt)),!r)throw new Error("could not parse args in autoInject\nSource:\n"+e);let[,n]=r;return n.replace(/\s/g,"").split(mt).map(t=>t.replace(wt,"").trim())}(i),0===i.length&&!s&&0===n.length)throw new Error("autoInject task functions require explicit parameters.");s||n.pop(),r[e]=n.concat(a)}function a(t,e){var r=n.map(e=>t[e]);r.push(e),V(i)(...r)}}),gt(r,e)}class vt{constructor(){this.head=this.tail=null,this.length=0}removeLink(t){return t.prev?t.prev.next=t.next:this.head=t.next,t.next?t.next.prev=t.prev:this.tail=t.prev,t.prev=t.next=null,this.length-=1,t}empty(){for(;this.head;)this.shift();return this}insertAfter(t,e){e.prev=t,e.next=t.next,t.next?t.next.prev=e:this.tail=e,t.next=e,this.length+=1}insertBefore(t,e){e.prev=t.prev,e.next=t,t.prev?t.prev.next=e:this.head=e,t.prev=e,this.length+=1}unshift(t){this.head?this.insertBefore(this.head,t):St(this,t)}push(t){this.tail?this.insertAfter(this.tail,t):St(this,t)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){for(var t=this.head;t;)yield t.data,t=t.next}remove(t){for(var e=this.head;e;){var{next:r}=e;t(e)&&this.removeLink(e),e=r}return this}}function St(t,e){t.length=1,t.head=t.tail=e}function Et(t,e,r){if(null==e)e=1;else if(0===e)throw new RangeError("Concurrency must not be zero");var n=V(t),i=0,s=[];const o={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function a(t,e){return t?e?void(o[t]=o[t].filter(t=>t!==e)):o[t]=[]:Object.keys(o).forEach(t=>o[t]=[])}function l(t,...e){o[t].forEach(t=>t(...e))}var h=!1;function u(t,e,r,n){if(null!=n&&"function"!=typeof n)throw new Error("task callback must be a function");var i,s;function o(t,...e){return t?r?s(t):i():e.length<=1?i(e[0]):void i(e)}g.started=!0;var a=g._createTaskItem(t,r?o:n||o);if(e?g._tasks.unshift(a):g._tasks.push(a),h||(h=!0,U(()=>{h=!1,g.process()})),r||!n)return new Promise((t,e)=>{i=t,s=e})}function c(t){return function(e,...r){i-=1;for(var n=0,o=t.length;n<o;n++){var a=t[n],h=s.indexOf(a);0===h?s.shift():h>0&&s.splice(h,1),a.callback(e,...r),null!=e&&l("error",e,a.data)}i<=g.concurrency-g.buffer&&l("unsaturated"),g.idle()&&l("drain"),g.process()}}function f(t){return!(0!==t.length||!g.idle())&&(U(()=>l("drain")),!0)}const d=t=>e=>{if(!e)return new Promise((e,r)=>{!function(t,e){const r=(...n)=>{a(t,r),e(...n)};o[t].push(r)}(t,(t,n)=>{if(t)return r(t);e(n)})});a(t),function(t,e){o[t].push(e)}(t,e)};var p=!1,g={_tasks:new vt,_createTaskItem:(t,e)=>({data:t,callback:e}),*[Symbol.iterator](){yield*g._tasks[Symbol.iterator]()},concurrency:e,payload:r,buffer:e/4,started:!1,paused:!1,push(t,e){if(Array.isArray(t)){if(f(t))return;return t.map(t=>u(t,!1,!1,e))}return u(t,!1,!1,e)},pushAsync(t,e){if(Array.isArray(t)){if(f(t))return;return t.map(t=>u(t,!1,!0,e))}return u(t,!1,!0,e)},kill(){a(),g._tasks.empty()},unshift(t,e){if(Array.isArray(t)){if(f(t))return;return t.map(t=>u(t,!0,!1,e))}return u(t,!0,!1,e)},unshiftAsync(t,e){if(Array.isArray(t)){if(f(t))return;return t.map(t=>u(t,!0,!0,e))}return u(t,!0,!0,e)},remove(t){g._tasks.remove(t)},process(){if(!p){for(p=!0;!g.paused&&i<g.concurrency&&g._tasks.length;){var t=[],e=[],r=g._tasks.length;g.payload&&(r=Math.min(r,g.payload));for(var o=0;o<r;o++){var a=g._tasks.shift();t.push(a),s.push(a),e.push(a.data)}i+=1,0===g._tasks.length&&l("empty"),i===g.concurrency&&l("saturated");var h=et(c(t));n(e,h)}p=!1}},length:()=>g._tasks.length,running:()=>i,workersList:()=>s,idle:()=>g._tasks.length+i===0,pause(){g.paused=!0},resume(){!1!==g.paused&&(g.paused=!1,U(g.process))}};return Object.defineProperties(g,{saturated:{writable:!1,value:d("saturated")},unsaturated:{writable:!1,value:d("unsaturated")},empty:{writable:!1,value:d("empty")},drain:{writable:!1,value:d("drain")},error:{writable:!1,value:d("error")}}),g}function xt(t,e){return Et(t,1,e)}function kt(t,e,r){return Et(t,e,r)}var Tt=Z(function(t,e,r,n){n=J(n);var i=V(r);return ut(t,(t,r,n)=>{i(e,t,(t,r)=>{e=r,n(t)})},t=>n(t,e))},4);function Rt(...t){var e=t.map(V);return function(...t){var r=this,n=t[t.length-1];return"function"==typeof n?t.pop():n=pt(),Tt(e,t,(t,e,n)=>{e.apply(r,t.concat((t,...e)=>{n(t,e)}))},(t,e)=>n(t,...e)),n[dt]}}function At(...t){return Rt(...t.reverse())}var Ot=Z(function(t,e,r,n){return K(nt(e),t,r,n)},4);var Lt=Z(function(t,e,r,n){var i=V(r);return Ot(t,e,(t,e)=>{i(t,(t,...r)=>t?e(t):e(t,r))},(t,e)=>{for(var r=[],i=0;i<e.length;i++)e[i]&&(r=r.concat(...e[i]));return n(t,r)})},4);var Mt=Z(function(t,e,r){return Lt(t,1/0,e,r)},3);var Pt=Z(function(t,e,r){return Lt(t,1,e,r)},3);function It(...t){return function(...e){return e.pop()(null,...t)}}function Dt(t,e){return(r,n,i,s)=>{var o,a=!1;const l=V(i);r(n,(r,n,i)=>{l(r,(n,s)=>n||!1===n?i(n):t(s)&&!o?(a=!0,o=e(!0,r),i(null,X)):void i())},t=>{if(t)return s(t);s(null,a?o:e(!1))})}}var Nt=Z(function(t,e,r){return Dt(t=>t,(t,e)=>e)(at,t,e,r)},3);var jt=Z(function(t,e,r,n){return Dt(t=>t,(t,e)=>e)(nt(e),t,r,n)},4);var Ct=Z(function(t,e,r){return Dt(t=>t,(t,e)=>e)(nt(1),t,e,r)},3);function Ft(t){return(e,...r)=>V(e)(...r,(e,...r)=>{"object"==typeof console&&(e?console.error&&console.error(e):console[t]&&r.forEach(e=>console[t](e)))})}var Bt=Ft("dir");var zt=Z(function(t,e,r){r=et(r);var n,i=V(t),s=V(e);function o(t,...e){if(t)return r(t);!1!==t&&(n=e,s(...e,a))}function a(t,e){return t?r(t):!1!==t?e?void i(o):r(null,...n):void 0}return a(null,!0)},3);function Wt(t,e,r){const n=V(e);return zt(t,(...t)=>{const e=t.pop();n(...t,(t,r)=>e(t,!r))},r)}function Ut(t){return(e,r,n)=>t(e,n)}var Gt=Z(function(t,e,r){return at(t,Ut(V(e)),r)},3);var $t=Z(function(t,e,r,n){return nt(e)(t,Ut(V(r)),n)},4);var Ht=Z(function(t,e,r){return $t(t,1,e,r)},3);function qt(t){return q(t)?t:function(...e){var r=e.pop(),n=!0;e.push((...t)=>{n?U(()=>r(...t)):r(...t)}),t.apply(this,e),n=!1}}var Vt=Z(function(t,e,r){return Dt(t=>!t,t=>!t)(at,t,e,r)},3);var Zt=Z(function(t,e,r,n){return Dt(t=>!t,t=>!t)(nt(e),t,r,n)},4);var Yt=Z(function(t,e,r){return Dt(t=>!t,t=>!t)(ut,t,e,r)},3);function Kt(t,e,r,n){var i=new Array(e.length);t(e,(t,e,n)=>{r(t,(t,r)=>{i[e]=!!r,n(t)})},t=>{if(t)return n(t);for(var r=[],s=0;s<e.length;s++)i[s]&&r.push(e[s]);n(null,r)})}function Qt(t,e,r,n){var i=[];t(e,(t,e,n)=>{r(t,(r,s)=>{if(r)return n(r);s&&i.push({index:e,value:t}),n(r)})},t=>{if(t)return n(t);n(null,i.sort((t,e)=>t.index-e.index).map(t=>t.value))})}function Xt(t,e,r,n){return(Q(e)?Kt:Qt)(t,e,V(r),n)}var Jt=Z(function(t,e,r){return Xt(at,t,e,r)},3);var te=Z(function(t,e,r,n){return Xt(nt(e),t,r,n)},4);var ee=Z(function(t,e,r){return Xt(ut,t,e,r)},3);var re=Z(function(t,e){var r=et(e),n=V(qt(t));return function t(e){if(e)return r(e);!1!==e&&n(t)}()},2);var ne=Z(function(t,e,r,n){var i=V(r);return Ot(t,e,(t,e)=>{i(t,(r,n)=>r?e(r):e(r,{key:n,val:t}))},(t,e)=>{for(var r={},{hasOwnProperty:i}=Object.prototype,s=0;s<e.length;s++)if(e[s]){var{key:o}=e[s],{val:a}=e[s];i.call(r,o)?r[o].push(a):r[o]=[a]}return n(t,r)})},4);function ie(t,e,r){return ne(t,1/0,e,r)}function se(t,e,r){return ne(t,1,e,r)}var oe=Ft("log");var ae=Z(function(t,e,r,n){n=J(n);var i={},s=V(r);return nt(e)(t,(t,e,r)=>{s(t,e,(t,n)=>{if(t)return r(t);i[e]=n,r(t)})},t=>n(t,i))},4);function le(t,e,r){return ae(t,1/0,e,r)}function he(t,e,r){return ae(t,1,e,r)}function ue(t,e=t=>t){var r=Object.create(null),n=Object.create(null),i=V(t),s=j((t,s)=>{var o=e(...t);o in r?U(()=>s(null,...r[o])):o in n?n[o].push(s):(n[o]=[s],i(...t,(t,...e)=>{t||(r[o]=e);var i=n[o];delete n[o];for(var s=0,a=i.length;s<a;s++)i[s](t,...e)}))});return s.memo=r,s.unmemoized=t,s}var ce=W(B?process.nextTick:F?setImmediate:z),fe=Z((t,e,r)=>{var n=Q(e)?[]:{};t(e,(t,e,r)=>{V(t)((t,...i)=>{i.length<2&&([i]=i),n[e]=i,r(t)})},t=>r(t,n))},3);function de(t,e){return fe(at,t,e)}function pe(t,e,r){return fe(nt(e),t,r)}function ge(t,e){var r=V(t);return Et((t,e)=>{r(t[0],e)},e,1)}class ye{constructor(){this.heap=[],this.pushCount=Number.MIN_SAFE_INTEGER}get length(){return this.heap.length}empty(){return this.heap=[],this}percUp(t){let e;for(;t>0&&we(this.heap[t],this.heap[e=me(t)]);){let r=this.heap[t];this.heap[t]=this.heap[e],this.heap[e]=r,t=e}}percDown(t){let e;for(;(e=be(t))<this.heap.length&&(e+1<this.heap.length&&we(this.heap[e+1],this.heap[e])&&(e+=1),!we(this.heap[t],this.heap[e]));){let r=this.heap[t];this.heap[t]=this.heap[e],this.heap[e]=r,t=e}}push(t){t.pushCount=++this.pushCount,this.heap.push(t),this.percUp(this.heap.length-1)}unshift(t){return this.heap.push(t)}shift(){let[t]=this.heap;return this.heap[0]=this.heap[this.heap.length-1],this.heap.pop(),this.percDown(0),t}toArray(){return[...this]}*[Symbol.iterator](){for(let t=0;t<this.heap.length;t++)yield this.heap[t].data}remove(t){let e=0;for(let r=0;r<this.heap.length;r++)t(this.heap[r])||(this.heap[e]=this.heap[r],e++);this.heap.splice(e);for(let t=me(this.heap.length-1);t>=0;t--)this.percDown(t);return this}}function be(t){return 1+(t<<1)}function me(t){return(t+1>>1)-1}function we(t,e){return t.priority!==e.priority?t.priority<e.priority:t.pushCount<e.pushCount}function _e(t,e){var r=ge(t,e),{push:n,pushAsync:i}=r;function s(t,e){return Array.isArray(t)?t.map(t=>({data:t,priority:e})):{data:t,priority:e}}return r._tasks=new ye,r._createTaskItem=({data:t,priority:e},r)=>({data:t,priority:e,callback:r}),r.push=function(t,e=0,r){return n(s(t,e),r)},r.pushAsync=function(t,e=0,r){return i(s(t,e),r)},delete r.unshift,delete r.unshiftAsync,r}var ve=Z(function(t,e){if(e=J(e),!Array.isArray(t))return e(new TypeError("First argument to race must be an array of functions"));if(!t.length)return e();for(var r=0,n=t.length;r<n;r++)V(t[r])(e)},2);function Se(t,e,r,n){var i=[...t].reverse();return Tt(i,e,r,n)}function Ee(t){var e=V(t);return j(function(t,r){return t.push((t,...e)=>{let n={};if(t&&(n.error=t),e.length>0){var i=e;e.length<=1&&([i]=e),n.value=i}r(null,n)}),e.apply(this,t)})}function xe(t){var e;return Array.isArray(t)?e=t.map(Ee):(e={},Object.keys(t).forEach(r=>{e[r]=Ee.call(this,t[r])})),e}function ke(t,e,r,n){const i=V(r);return Xt(t,e,(t,e)=>{i(t,(t,r)=>{e(t,!r)})},n)}var Te=Z(function(t,e,r){return ke(at,t,e,r)},3);var Re=Z(function(t,e,r,n){return ke(nt(e),t,r,n)},4);var Ae=Z(function(t,e,r){return ke(ut,t,e,r)},3);function Oe(t){return function(){return t}}function Le(t,e,r){var n={times:5,intervalFunc:Oe(0)};if(arguments.length<3&&"function"==typeof t?(r=e||pt(),e=t):(!function(t,e){if("object"==typeof e)t.times=+e.times||5,t.intervalFunc="function"==typeof e.interval?e.interval:Oe(+e.interval||0),t.errorFilter=e.errorFilter;else{if("number"!=typeof e&&"string"!=typeof e)throw new Error("Invalid arguments for async.retry");t.times=+e||5}}(n,t),r=r||pt()),"function"!=typeof e)throw new Error("Invalid arguments for async.retry");var i=V(e),s=1;return function t(){i((e,...i)=>{!1!==e&&(e&&s++<n.times&&("function"!=typeof n.errorFilter||n.errorFilter(e))?setTimeout(t,n.intervalFunc(s-1)):r(e,...i))})}(),r[dt]}function Me(t,e){e||(e=t,t=null);let r=t&&t.arity||e.length;q(e)&&(r+=1);var n=V(e);return j((e,i)=>{function s(t){n(...e,t)}return(e.length<r-1||null==i)&&(e.push(i),i=pt()),t?Le(t,s,i):Le(s,i),i[dt]})}function Pe(t,e){return fe(ut,t,e)}var Ie=Z(function(t,e,r){return Dt(Boolean,t=>t)(at,t,e,r)},3);var De=Z(function(t,e,r,n){return Dt(Boolean,t=>t)(nt(e),t,r,n)},4);var Ne=Z(function(t,e,r){return Dt(Boolean,t=>t)(ut,t,e,r)},3);var je=Z(function(t,e,r){var n=V(e);return lt(t,(t,e)=>{n(t,(r,n)=>{if(r)return e(r);e(r,{value:t,criteria:n})})},(t,e)=>{if(t)return r(t);r(null,e.sort(i).map(t=>t.value))});function i(t,e){var r=t.criteria,n=e.criteria;return r<n?-1:r>n?1:0}},3);function Ce(t,e,r){var n=V(t);return j((i,s)=>{var o,a=!1;i.push((...t)=>{a||(s(...t),clearTimeout(o))}),o=setTimeout(function(){var e=t.name||"anonymous",n=new Error('Callback function "'+e+'" timed out.');n.code="ETIMEDOUT",r&&(n.info=r),a=!0,s(n)},e),n(...i)})}function Fe(t,e,r,n){var i=V(r);return Ot(function(t){for(var e=Array(t);t--;)e[t]=t;return e}(t),e,i,n)}function Be(t,e,r){return Fe(t,1/0,e,r)}function ze(t,e,r){return Fe(t,1,e,r)}function We(t,e,r,n){arguments.length<=3&&"function"==typeof e&&(n=r,r=e,e=Array.isArray(t)?[]:{}),n=J(n||pt());var i=V(r);return at(t,(t,r,n)=>{i(e,t,r,n)},t=>n(t,e)),n[dt]}var Ue=Z(function(t,e){var r,n=null;return Ht(t,(t,e)=>{V(t)((t,...i)=>{if(!1===t)return e(t);i.length<2?[r]=i:r=i,n=t,e(t?null:{})})},()=>e(n,r))});function Ge(t){return(...e)=>(t.unmemoized||t)(...e)}var $e=Z(function(t,e,r){r=et(r);var n=V(e),i=V(t),s=[];function o(t,...e){if(t)return r(t);s=e,!1!==t&&i(a)}function a(t,e){return t?r(t):!1!==t?e?void n(o):r(null,...s):void 0}return i(a)},3);function He(t,e,r){const n=V(t);return $e(t=>n((e,r)=>t(e,!r)),e,r)}var qe=Z(function(t,e){if(e=J(e),!Array.isArray(t))return e(new Error("First argument to waterfall must be an array of functions"));if(!t.length)return e();var r=0;function n(e){V(t[r++])(...e,et(i))}function i(i,...s){if(!1!==i)return i||r===t.length?e(i,...s):void n(s)}n([])}),Ve={apply:N,applyEach:ht,applyEachSeries:ft,asyncify:G,auto:gt,autoInject:_t,cargo:xt,cargoQueue:kt,compose:At,concat:Mt,concatLimit:Lt,concatSeries:Pt,constant:It,detect:Nt,detectLimit:jt,detectSeries:Ct,dir:Bt,doUntil:Wt,doWhilst:zt,each:Gt,eachLimit:$t,eachOf:at,eachOfLimit:it,eachOfSeries:ut,eachSeries:Ht,ensureAsync:qt,every:Vt,everyLimit:Zt,everySeries:Yt,filter:Jt,filterLimit:te,filterSeries:ee,forever:re,groupBy:ie,groupByLimit:ne,groupBySeries:se,log:oe,map:lt,mapLimit:Ot,mapSeries:ct,mapValues:le,mapValuesLimit:ae,mapValuesSeries:he,memoize:ue,nextTick:ce,parallel:de,parallelLimit:pe,priorityQueue:_e,queue:ge,race:ve,reduce:Tt,reduceRight:Se,reflect:Ee,reflectAll:xe,reject:Te,rejectLimit:Re,rejectSeries:Ae,retry:Le,retryable:Me,seq:Rt,series:Pe,setImmediate:U,some:Ie,someLimit:De,someSeries:Ne,sortBy:je,timeout:Ce,times:Be,timesLimit:Fe,timesSeries:ze,transform:We,tryEach:Ue,unmemoize:Ge,until:He,waterfall:qe,whilst:$e,all:Vt,allLimit:Zt,allSeries:Yt,any:Ie,anyLimit:De,anySeries:Ne,find:Nt,findLimit:jt,findSeries:Ct,flatMap:Mt,flatMapLimit:Lt,flatMapSeries:Pt,forEach:Gt,forEachSeries:Ht,forEachLimit:$t,forEachOf:at,forEachOfSeries:ut,forEachOfLimit:it,inject:Tt,foldl:Tt,foldr:Se,select:Jt,selectLimit:te,selectSeries:ee,wrapSync:G,during:$e,doDuring:zt};const Ze=L(Object.freeze(Object.defineProperty({__proto__:null,all:Vt,allLimit:Zt,allSeries:Yt,any:Ie,anyLimit:De,anySeries:Ne,apply:N,applyEach:ht,applyEachSeries:ft,asyncify:G,auto:gt,autoInject:_t,cargo:xt,cargoQueue:kt,compose:At,concat:Mt,concatLimit:Lt,concatSeries:Pt,constant:It,default:Ve,detect:Nt,detectLimit:jt,detectSeries:Ct,dir:Bt,doDuring:zt,doUntil:Wt,doWhilst:zt,during:$e,each:Gt,eachLimit:$t,eachOf:at,eachOfLimit:it,eachOfSeries:ut,eachSeries:Ht,ensureAsync:qt,every:Vt,everyLimit:Zt,everySeries:Yt,filter:Jt,filterLimit:te,filterSeries:ee,find:Nt,findLimit:jt,findSeries:Ct,flatMap:Mt,flatMapLimit:Lt,flatMapSeries:Pt,foldl:Tt,foldr:Se,forEach:Gt,forEachLimit:$t,forEachOf:at,forEachOfLimit:it,forEachOfSeries:ut,forEachSeries:Ht,forever:re,groupBy:ie,groupByLimit:ne,groupBySeries:se,inject:Tt,log:oe,map:lt,mapLimit:Ot,mapSeries:ct,mapValues:le,mapValuesLimit:ae,mapValuesSeries:he,memoize:ue,nextTick:ce,parallel:de,parallelLimit:pe,priorityQueue:_e,queue:ge,race:ve,reduce:Tt,reduceRight:Se,reflect:Ee,reflectAll:xe,reject:Te,rejectLimit:Re,rejectSeries:Ae,retry:Le,retryable:Me,select:Jt,selectLimit:te,selectSeries:ee,seq:Rt,series:Pe,setImmediate:U,some:Ie,someLimit:De,someSeries:Ne,sortBy:je,timeout:Ce,times:Be,timesLimit:Fe,timesSeries:ze,transform:We,tryEach:Ue,unmemoize:Ge,until:He,waterfall:qe,whilst:$e,wrapSync:G},Symbol.toStringTag,{value:"Module"})));var Ye,Ke,Qe,Xe,Je,tr,er,rr,nr,ir,sr={exports:{}};function or(){if(Ke)return Ye;Ke=1;var t=n,e=process.cwd,r=null,i=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return r||(r=e.call(process)),r};try{process.cwd()}catch(t){}if("function"==typeof process.chdir){var s=process.chdir;process.chdir=function(t){r=null,s.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,s)}return Ye=function(e){t.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(r,n,i){e.open(r,t.O_WRONLY|t.O_SYMLINK,n,function(t,r){t?i&&i(t):e.fchmod(r,n,function(t){e.close(r,function(e){i&&i(t||e)})})})},e.lchmodSync=function(r,n){var i,s=e.openSync(r,t.O_WRONLY|t.O_SYMLINK,n),o=!0;try{i=e.fchmodSync(s,n),o=!1}finally{if(o)try{e.closeSync(s)}catch(t){}else e.closeSync(s)}return i}}(e);e.lutimes||function(e){t.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(r,n,i,s){e.open(r,t.O_SYMLINK,function(t,r){t?s&&s(t):e.futimes(r,n,i,function(t){e.close(r,function(e){s&&s(t||e)})})})},e.lutimesSync=function(r,n,i){var s,o=e.openSync(r,t.O_SYMLINK),a=!0;try{s=e.futimesSync(o,n,i),a=!1}finally{if(a)try{e.closeSync(o)}catch(t){}else e.closeSync(o)}return s}):e.futimes&&(e.lutimes=function(t,e,r,n){n&&process.nextTick(n)},e.lutimesSync=function(){})}(e);e.chown=s(e.chown),e.fchown=s(e.fchown),e.lchown=s(e.lchown),e.chmod=r(e.chmod),e.fchmod=r(e.fchmod),e.lchmod=r(e.lchmod),e.chownSync=o(e.chownSync),e.fchownSync=o(e.fchownSync),e.lchownSync=o(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=a(e.stat),e.fstat=a(e.fstat),e.lstat=a(e.lstat),e.statSync=l(e.statSync),e.fstatSync=l(e.fstatSync),e.lstatSync=l(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(t,e,r){r&&process.nextTick(r)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(t,e,r,n){n&&process.nextTick(n)},e.lchownSync=function(){});"win32"===i&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function r(r,n,i){var s=Date.now(),o=0;t(r,n,function a(l){if(l&&("EACCES"===l.code||"EPERM"===l.code||"EBUSY"===l.code)&&Date.now()-s<6e4)return setTimeout(function(){e.stat(n,function(e,s){e&&"ENOENT"===e.code?t(r,n,a):i(l)})},o),void(o<100&&(o+=10));i&&i(l)})}return Object.setPrototypeOf&&Object.setPrototypeOf(r,t),r}(e.rename));function r(t){return t?function(r,n,i){return t.call(e,r,n,function(t){h(t)&&(t=null),i&&i.apply(this,arguments)})}:t}function n(t){return t?function(r,n){try{return t.call(e,r,n)}catch(t){if(!h(t))throw t}}:t}function s(t){return t?function(r,n,i,s){return t.call(e,r,n,i,function(t){h(t)&&(t=null),s&&s.apply(this,arguments)})}:t}function o(t){return t?function(r,n,i){try{return t.call(e,r,n,i)}catch(t){if(!h(t))throw t}}:t}function a(t){return t?function(r,n,i){function s(t,e){e&&(e.uid<0&&(e.uid+=4294967296),e.gid<0&&(e.gid+=4294967296)),i&&i.apply(this,arguments)}return"function"==typeof n&&(i=n,n=null),n?t.call(e,r,n,s):t.call(e,r,s)}:t}function l(t){return t?function(r,n){var i=n?t.call(e,r,n):t.call(e,r);return i&&(i.uid<0&&(i.uid+=4294967296),i.gid<0&&(i.gid+=4294967296)),i}:t}function h(t){return!t||("ENOSYS"===t.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==t.code&&"EPERM"!==t.code))}e.read="function"!=typeof e.read?e.read:function(t){function r(r,n,i,s,o,a){var l;if(a&&"function"==typeof a){var h=0;l=function(u,c,f){if(u&&"EAGAIN"===u.code&&h<10)return h++,t.call(e,r,n,i,s,o,l);a.apply(this,arguments)}}return t.call(e,r,n,i,s,o,l)}return Object.setPrototypeOf&&Object.setPrototypeOf(r,t),r}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(u=e.readSync,function(t,r,n,i,s){for(var o=0;;)try{return u.call(e,t,r,n,i,s)}catch(t){if("EAGAIN"===t.code&&o<10){o++;continue}throw t}});var u},Ye}function ar(){if(rr)return er;rr=1;var e,r,n=t,a=or(),l=function(){if(Xe)return Qe;Xe=1;var t=i.Stream;return Qe=function(e){return{ReadStream:function r(n,i){if(!(this instanceof r))return new r(n,i);t.call(this);var s=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,i=i||{};for(var o=Object.keys(i),a=0,l=o.length;a<l;a++){var h=o[a];this[h]=i[h]}if(this.encoding&&this.setEncoding(this.encoding),void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}null===this.fd?e.open(this.path,this.flags,this.mode,function(t,e){if(t)return s.emit("error",t),void(s.readable=!1);s.fd=e,s.emit("open",e),s._read()}):process.nextTick(function(){s._read()})},WriteStream:function r(n,i){if(!(this instanceof r))return new r(n,i);t.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var s=Object.keys(i),o=0,a=s.length;o<a;o++){var l=s[o];this[l]=i[l]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}},Qe}(),h=function(){if(tr)return Je;tr=1,Je=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var r={__proto__:t(e)};else r=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))}),r};var t=Object.getPrototypeOf||function(t){return t.__proto__};return Je}(),u=s;function c(t,r){Object.defineProperty(t,e,{get:function(){return r}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(e=Symbol.for("graceful-fs.queue"),r=Symbol.for("graceful-fs.previous")):(e="___graceful-fs.queue",r="___graceful-fs.previous");var f,d=function(){};if(u.debuglog?d=u.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(d=function(){var t=u.format.apply(u,arguments);t="GFS4: "+t.split(/\n/).join("\nGFS4: "),console.error(t)}),!n[e]){var p=A[e]||[];c(n,p),n.close=function(t){function e(e,r){return t.call(n,e,function(t){t||b(),"function"==typeof r&&r.apply(this,arguments)})}return Object.defineProperty(e,r,{value:t}),e}(n.close),n.closeSync=function(t){function e(e){t.apply(n,arguments),b()}return Object.defineProperty(e,r,{value:t}),e}(n.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){d(n[e]),o.equal(n[e].length,0)})}function g(t){a(t),t.gracefulify=g,t.createReadStream=function(e,r){return new t.ReadStream(e,r)},t.createWriteStream=function(e,r){return new t.WriteStream(e,r)};var e=t.readFile;t.readFile=function(t,r,n){"function"==typeof r&&(n=r,r=null);return function t(r,n,i,s){return e(r,n,function(e){!e||"EMFILE"!==e.code&&"ENFILE"!==e.code?"function"==typeof i&&i.apply(this,arguments):y([t,[r,n,i],e,s||Date.now(),Date.now()])})}(t,r,n)};var r=t.writeFile;t.writeFile=function(t,e,n,i){"function"==typeof n&&(i=n,n=null);return function t(e,n,i,s,o){return r(e,n,i,function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof s&&s.apply(this,arguments):y([t,[e,n,i,s],r,o||Date.now(),Date.now()])})}(t,e,n,i)};var n=t.appendFile;n&&(t.appendFile=function(t,e,r,i){"function"==typeof r&&(i=r,r=null);return function t(e,r,i,s,o){return n(e,r,i,function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof s&&s.apply(this,arguments):y([t,[e,r,i,s],n,o||Date.now(),Date.now()])})}(t,e,r,i)});var i=t.copyFile;i&&(t.copyFile=function(t,e,r,n){"function"==typeof r&&(n=r,r=0);return function t(e,r,n,s,o){return i(e,r,n,function(i){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof s&&s.apply(this,arguments):y([t,[e,r,n,s],i,o||Date.now(),Date.now()])})}(t,e,r,n)});var s=t.readdir;t.readdir=function(t,e,r){"function"==typeof e&&(r=e,e=null);var n=o.test(process.version)?function(t,e,r,n){return s(t,i(t,e,r,n))}:function(t,e,r,n){return s(t,e,i(t,e,r,n))};return n(t,e,r);function i(t,e,r,i){return function(s,o){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?(o&&o.sort&&o.sort(),"function"==typeof r&&r.call(this,s,o)):y([n,[t,e,r],s,i||Date.now(),Date.now()])}}};var o=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var h=l(t);p=h.ReadStream,b=h.WriteStream}var u=t.ReadStream;u&&(p.prototype=Object.create(u.prototype),p.prototype.open=function(){var t=this;w(t.path,t.flags,t.mode,function(e,r){e?(t.autoClose&&t.destroy(),t.emit("error",e)):(t.fd=r,t.emit("open",r),t.read())})});var c=t.WriteStream;c&&(b.prototype=Object.create(c.prototype),b.prototype.open=function(){var t=this;w(t.path,t.flags,t.mode,function(e,r){e?(t.destroy(),t.emit("error",e)):(t.fd=r,t.emit("open",r))})}),Object.defineProperty(t,"ReadStream",{get:function(){return p},set:function(t){p=t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return b},set:function(t){b=t},enumerable:!0,configurable:!0});var f=p;Object.defineProperty(t,"FileReadStream",{get:function(){return f},set:function(t){f=t},enumerable:!0,configurable:!0});var d=b;function p(t,e){return this instanceof p?(u.apply(this,arguments),this):p.apply(Object.create(p.prototype),arguments)}function b(t,e){return this instanceof b?(c.apply(this,arguments),this):b.apply(Object.create(b.prototype),arguments)}Object.defineProperty(t,"FileWriteStream",{get:function(){return d},set:function(t){d=t},enumerable:!0,configurable:!0});var m=t.open;function w(t,e,r,n){return"function"==typeof r&&(n=r,r=null),function t(e,r,n,i,s){return m(e,r,n,function(o,a){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?"function"==typeof i&&i.apply(this,arguments):y([t,[e,r,n,i],o,s||Date.now(),Date.now()])})}(t,e,r,n)}return t.open=w,t}function y(t){d("ENQUEUE",t[0].name,t[1]),n[e].push(t),m()}function b(){for(var t=Date.now(),r=0;r<n[e].length;++r)n[e][r].length>2&&(n[e][r][3]=t,n[e][r][4]=t);m()}function m(){if(clearTimeout(f),f=void 0,0!==n[e].length){var t=n[e].shift(),r=t[0],i=t[1],s=t[2],o=t[3],a=t[4];if(void 0===o)d("RETRY",r.name,i),r.apply(null,i);else if(Date.now()-o>=6e4){d("TIMEOUT",r.name,i);var l=i.pop();"function"==typeof l&&l.call(null,s)}else{var h=Date.now()-a,u=Math.max(a-o,1);h>=Math.min(1.2*u,100)?(d("RETRY",r.name,i),r.apply(null,i.concat([o]))):n[e].push(t)}void 0===f&&(f=setTimeout(m,0))}}return A[e]||c(A,n[e]),er=g(h(n)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!n.__patched&&(er=g(n),n.__patched=!0),er}function lr(){if(ir)return nr;ir=1;const t=t=>null!==t&&"object"==typeof t&&"function"==typeof t.pipe;return t.writable=e=>t(e)&&!1!==e.writable&&"function"==typeof e._write&&"object"==typeof e._writableState,t.readable=e=>t(e)&&!1!==e.readable&&"function"==typeof e._read&&"object"==typeof e._readableState,t.duplex=e=>t.writable(e)&&t.readable(e),t.transform=e=>t.duplex(e)&&"function"==typeof e._transform,nr=t}var hr,ur,cr,fr,dr,pr={exports:{}},gr={exports:{}};function yr(){if(hr)return gr.exports;return hr=1,"undefined"==typeof process||!process.version||0===process.version.indexOf("v0.")||0===process.version.indexOf("v1.")&&0!==process.version.indexOf("v1.8.")?gr.exports={nextTick:function(t,e,r,n){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var i,s,o=arguments.length;switch(o){case 0:case 1:return process.nextTick(t);case 2:return process.nextTick(function(){t.call(null,e)});case 3:return process.nextTick(function(){t.call(null,e,r)});case 4:return process.nextTick(function(){t.call(null,e,r,n)});default:for(i=new Array(o-1),s=0;s<i.length;)i[s++]=arguments[s];return process.nextTick(function(){t.apply(null,i)})}}}:gr.exports=process,gr.exports}function br(){return dr?fr:(dr=1,fr=i)}var mr,wr={exports:{}};function _r(){return mr||(mr=1,function(t,e){var r=a,n=r.Buffer;function i(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=s),i(n,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}}(wr,wr.exports)),wr.exports}var vr,Sr={};function Er(){if(vr)return Sr;function t(t){return Object.prototype.toString.call(t)}return vr=1,Sr.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===t(e)},Sr.isBoolean=function(t){return"boolean"==typeof t},Sr.isNull=function(t){return null===t},Sr.isNullOrUndefined=function(t){return null==t},Sr.isNumber=function(t){return"number"==typeof t},Sr.isString=function(t){return"string"==typeof t},Sr.isSymbol=function(t){return"symbol"==typeof t},Sr.isUndefined=function(t){return void 0===t},Sr.isRegExp=function(e){return"[object RegExp]"===t(e)},Sr.isObject=function(t){return"object"==typeof t&&null!==t},Sr.isDate=function(e){return"[object Date]"===t(e)},Sr.isError=function(e){return"[object Error]"===t(e)||e instanceof Error},Sr.isFunction=function(t){return"function"==typeof t},Sr.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},Sr.isBuffer=a.Buffer.isBuffer,Sr}var xr,kr,Tr={exports:{}},Rr={exports:{}};function Ar(){if(kr)return Tr.exports;kr=1;try{var t=