@nice-move/cli 0.11.14 → 0.11.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/145.mjs +1 -1
- package/dist/216.mjs +1 -1
- package/dist/340.mjs +1 -0
- package/dist/441.mjs +1 -1
- package/dist/564.mjs +1 -0
- package/dist/782.mjs +1 -1
- package/dist/799.mjs +1 -0
- package/dist/849.mjs +1 -0
- package/dist/cli.mjs +1 -1
- package/dist/cmd/git.mjs +1 -1
- package/dist/cmd/lint.mjs +1 -1
- package/package.json +6 -6
- package/dist/151.mjs +0 -1
- package/dist/176.mjs +0 -1
- package/dist/762.mjs +0 -1
- package/dist/992.mjs +0 -1
package/dist/145.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const id=145;export const ids=[145];export const modules={5145:(e,t,r)=>{r.d(t,{default:()=>d});var n=r(3490);const o=/^[\uD800-\uDBFF][\uDC00-\uDFFF]$/,i=["\x1b","\x9b"],s=e=>`${i[0]}[${e}m`,
|
|
1
|
+
export const id=145;export const ids=[145];export const modules={5145:(e,t,r)=>{r.d(t,{default:()=>d});var n=r(3490);const o=/^[\uD800-\uDBFF][\uDC00-\uDFFF]$/,i=["\x1b","\x9b"],s=e=>`${i[0]}[${e}m`,c=(e,t,r)=>{let o=[];e=[...e];for(let r of e){const i=r;r.includes(";")&&(r=r.split(";")[0][0]+"0");const c=n.Ay.codes.get(Number.parseInt(r,10));if(c){const r=e.indexOf(c.toString());-1===r?o.push(s(t?c:i)):e.splice(r,1)}else{if(t){o.push(s(0));break}o.push(s(i))}}if(t&&(o=o.filter(((e,t)=>o.indexOf(e)===t)),void 0!==r)){const e=s(n.Ay.codes.get(Number.parseInt(r,10)));o=o.reduce(((t,r)=>r===e?[r,...t]:[...t,r]),[])}return o.join("")};function u(e,t,r){const n=[...e],s=[];let u,f="number"==typeof r?r:n.length,p=!1,d=0,l="";for(const[m,h]of n.entries()){let n=!1;if(i.includes(h)){const t=/\d[^m]*/.exec(e.slice(m,m+18));u=t&&t.length>0?t[0]:void 0,d<f&&(p=!0,void 0!==u&&s.push(u))}else p&&"m"===h&&(p=!1,n=!0);if(p||n||d++,!o.test(h)&&(a=h.codePointAt(),Number.isInteger(a)&&a>=4352&&(a<=4447||9001===a||9002===a||11904<=a&&a<=12871&&12351!==a||12880<=a&&a<=19903||19968<=a&&a<=42182||43360<=a&&a<=43388||44032<=a&&a<=55203||63744<=a&&a<=64255||65040<=a&&a<=65049||65072<=a&&a<=65131||65281<=a&&a<=65376||65504<=a&&a<=65510||110592<=a&&a<=110593||127488<=a&&a<=127569||131072<=a&&a<=262141))&&(d++,"number"!=typeof r&&f++),d>t&&d<=f)l+=h;else if(d!==t||p||void 0===u){if(d>=f){l+=c(s,!0,u);break}}else l=c(s)}var a;return l}var f=r(326);function p(e,t,r){if(" "===e.charAt(t))return t;const n=r?1:-1;for(let r=0;r<=3;r++){const o=t+r*n;if(" "===e.charAt(o))return o}return t}function d(e,t,r={}){const{position:n="end",space:o=!1,preferTruncationOnSpace:i=!1}=r;let{truncationCharacter:s="\u2026"}=r;if("string"!=typeof e)throw new TypeError("Expected `input` to be a string, got "+typeof e);if("number"!=typeof t)throw new TypeError("Expected `columns` to be a number, got "+typeof t);if(t<1)return"";if(1===t)return s;const c=(0,f.A)(e);if(c<=t)return e;if("start"===n)return i?s+u(e,p(e,c-t+1,!0),c).trim():(!0===o&&(s+=" "),s+u(e,c-t+(0,f.A)(s),c));if("middle"===n){!0===o&&(s=` ${s} `);const r=Math.floor(t/2);if(i){const n=p(e,r),o=p(e,c-(t-r)+1,!0);return u(e,0,n)+s+u(e,o,c).trim()}return u(e,0,r)+s+u(e,c-(t-r)+(0,f.A)(s),c)}if("end"===n)return i?u(e,0,p(e,t-1))+s:(!0===o&&(s=` ${s}`),u(e,0,t-(0,f.A)(s))+s);throw new Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${n}`)}}};
|
package/dist/216.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const id=216;export const ids=[216];export const modules={2216:(e,o,t)=>{t.d(o,{createLogUpdate:()=>
|
|
1
|
+
export const id=216;export const ids=[216];export const modules={2216:(e,o,t)=>{t.d(o,{createLogUpdate:()=>Y});var n=t(1708);const r=void 0!==globalThis.window?.document,i=(globalThis.process,globalThis.process,globalThis.Deno,globalThis.process,globalThis.navigator?.userAgent?.includes("jsdom"),"undefined"!=typeof WorkerGlobalScope&&(globalThis,WorkerGlobalScope),"undefined"!=typeof DedicatedWorkerGlobalScope&&(globalThis,DedicatedWorkerGlobalScope),"undefined"!=typeof SharedWorkerGlobalScope&&(globalThis,SharedWorkerGlobalScope),"undefined"!=typeof ServiceWorkerGlobalScope&&(globalThis,ServiceWorkerGlobalScope),globalThis.navigator?.userAgentData?.platform),l=("macOS"===i||"MacIntel"===globalThis.navigator?.platform||!0===globalThis.navigator?.userAgent?.includes(" Mac ")||globalThis.process,"Windows"===i||"Win32"===globalThis.navigator?.platform||globalThis.process,"Linux"===i||!0===globalThis.navigator?.platform?.startsWith("Linux")||!0===globalThis.navigator?.userAgent?.includes(" Linux ")||globalThis.process,"iOS"===i||"MacIntel"===globalThis.navigator?.platform&&globalThis.navigator?.maxTouchPoints>1||/iPad|iPhone|iPod/.test(globalThis.navigator?.platform),"Android"===i||"Android"===globalThis.navigator?.platform||!0===globalThis.navigator?.userAgent?.includes(" Android ")||globalThis.process,"\x1b["),a=(!r&&n.env.TERM_PROGRAM,!r&&n.platform,r||n.cwd,(e=1)=>l+e+"A"),s=e=>{let o="";for(let t=0;t<e;t++)o+=c+(t<e-1?a():"");return e&&(o+="\x1b[G"),o},c="\x1b[2K",d=(e,o,t,n)=>{if("length"===t||"prototype"===t)return;if("arguments"===t||"caller"===t)return;const r=Object.getOwnPropertyDescriptor(e,t),i=Object.getOwnPropertyDescriptor(o,t);!u(r,i)&&n||Object.defineProperty(e,t,i)},u=function(e,o){return void 0===e||e.configurable||e.writable===o.writable&&e.enumerable===o.enumerable&&e.configurable===o.configurable&&(e.writable||e.value===o.value)},g=(e,o)=>`/* Wrapped ${e}*/\n${o}`,p=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),f=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");const h=new WeakMap,b=(e,o={})=>{if("function"!=typeof e)throw new TypeError("Expected a function");let t,n=0;const r=e.displayName||e.name||"<anonymous>",i=function(...l){if(h.set(i,++n),1===n)t=e.apply(this,l),e=void 0;else if(!0===o.throw)throw new Error(`Function \`${r}\` can only be called once`);return t};return function(e,o,{ignoreNonConfigurable:t=!1}={}){const{name:n}=e;for(const n of Reflect.ownKeys(o))d(e,o,n,t);((e,o)=>{const t=Object.getPrototypeOf(o);t!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,t)})(e,o),((e,o,t)=>{const n=""===t?"":`with ${t.trim()}() `,r=g.bind(null,n,o.toString());Object.defineProperty(r,"name",f);const{writable:i,enumerable:l,configurable:a}=p;Object.defineProperty(e,"toString",{value:r,writable:i,enumerable:l,configurable:a})})(e,o,n)}(i,e),h.set(i,n),i};b.callCount=e=>{if(!h.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return h.get(e)};const w=b;var T=t(7017);const m=n.stderr.isTTY?n.stderr:n.stdout.isTTY?n.stdout:void 0,y=m?w((()=>{(0,T.cf)((()=>{m.write("\x1b[?25h")}),{alwaysLast:!0})})):()=>{};let v=!1;const A={show:(e=n.stderr)=>{e.isTTY&&(v=!1,e.write("\x1b[?25h"))},hide:(e=n.stderr)=>{e.isTTY&&(y(),v=!0,e.write("\x1b[?25l"))},toggle:(e,o)=>{void 0!==e&&(v=e),v?A.show(o):A.hide(o)}},O=A;var S=t(782),P=t(3490),W=t(3860);function j(e){return!!Number.isInteger(e)&&2===(0,W.Q1)(e)}const k=new Set([27,155]),x="0".codePointAt(0),G="9".codePointAt(0),C=new Set,I=new Map;for(const[e,o]of P.Ay.codes)C.add(P.Ay.color.ansi(o)),I.set(P.Ay.color.ansi(e),P.Ay.color.ansi(o));function D(e){if(C.has(e))return e;if(I.has(e))return I.get(e);(e=e.slice(2)).includes(";")&&(e=e[0]+"0");const o=P.Ay.codes.get(Number.parseInt(e,10));return o?P.Ay.color.ansi(o):P.Ay.reset.open}function M(e,o){const t=function(e){for(let o=0;o<e.length;o++){const t=e.codePointAt(o);if(t>=x&&t<=G)return o}return-1}(e=e.slice(o,o+19));if(-1!==t){let o=e.indexOf("m",t);return-1===o&&(o=e.length),e.slice(0,o+1)}}function N(e){let o=[];for(const t of e)t.code===P.Ay.reset.open?o=[]:C.has(t.code)?o=o.filter((e=>e.endCode!==t.code)):(o=o.filter((e=>e.endCode!==t.endCode)),o.push(t));return o}var E=t(3969);const F=({columns:e=80})=>e,L=(e,o)=>{const t=e.rows??24,n=o.split("\n"),r=Math.max(0,n.length-t);return r?function(e,o,t){const n=function(e,o=Number.POSITIVE_INFINITY){const t=[];let n=0,r=0;for(;n<e.length;){const i=e.codePointAt(n);if(k.has(i)){const o=M(e,n);if(o){t.push({type:"ansi",code:o,endCode:D(o)}),n+=o.length;continue}}const l=j(i),a=String.fromCodePoint(i);if(t.push({type:"character",value:a,isFullWidth:l}),n+=a.length,r+=l?2:a.length,r>=o)break}return t}(e,t);let r=[],i=0,l="",a=!1;for(const e of n){if(void 0!==t&&i>=t)break;"ansi"===e.type?(r.push(e),a&&(l+=e.code)):(!a&&i>=o&&(a=!0,r=N(r),l=r.map((({code:e})=>e)).join("")),a&&(l+=e.value),i+=e.isFullWidth?2:e.value.length)}return l+=N(r).map((({endCode:e})=>e)).reverse().join(""),l}(o,(0,E.A)(n.slice(0,r).join("\n")).length+1):o};function Y(e,{showCursor:o=!1}={}){let t=0,n=F(e),r="";const i=()=>{r="",n=F(e),t=0},l=(...i)=>{o||O.hide();let l=L(e,i.join(" ")+"\n");const a=F(e);l===r&&n===a||(r=l,n=a,l=(0,S.default)(l,a,{trim:!1,hard:!0,wordWrap:!1}),e.write(s(t)+l),t=l.split("\n").length)};return l.clear=()=>{e.write(s(t)),i()},l.done=()=>{i(),o||O.show()},l}Y(n.stdout),Y(n.stderr)}};
|
package/dist/340.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const id=340;export const ids=[340];export const modules={4078:(e,t,r)=>{const s=r(303),n=r(5111),i=r(9288),o=r(3585),a=(e,t={})=>{let r=[];if(Array.isArray(e))for(const s of e){const e=a.create(s,t);Array.isArray(e)?r.push(...e):r.push(e)}else r=[].concat(a.create(e,t));return t&&!0===t.expand&&!0===t.nodupes&&(r=[...new Set(r)]),r};a.parse=(e,t={})=>o(e,t),a.stringify=(e,t={})=>s("string"==typeof e?a.parse(e,t):e,t),a.compile=(e,t={})=>("string"==typeof e&&(e=a.parse(e,t)),n(e,t)),a.expand=(e,t={})=>{"string"==typeof e&&(e=a.parse(e,t));let r=i(e,t);return!0===t.noempty&&(r=r.filter(Boolean)),!0===t.nodupes&&(r=[...new Set(r)]),r},a.create=(e,t={})=>""===e||e.length<3?[e]:!0!==t.expand?a.compile(e,t):a.expand(e,t),e.exports=a},5111:(e,t,r)=>{const s=r(2411),n=r(1811);e.exports=(e,t={})=>{const r=(e,i={})=>{const o=n.isInvalidBrace(i),a=!0===e.invalid&&!0===t.escapeInvalid,c=!0===o||!0===a,l=!0===t.escapeInvalid?"\\":"";let u="";if(!0===e.isOpen)return l+e.value;if(!0===e.isClose)return console.log("node.isClose",l,e.value),l+e.value;if("open"===e.type)return c?l+e.value:"(";if("close"===e.type)return c?l+e.value:")";if("comma"===e.type)return"comma"===e.prev.type?"":c?e.value:"|";if(e.value)return e.value;if(e.nodes&&e.ranges>0){const r=n.reduce(e.nodes),i=s(...r,{...t,wrap:!1,toRegex:!0,strictZeros:!0});if(0!==i.length)return r.length>1&&i.length>1?`(${i})`:i}if(e.nodes)for(const t of e.nodes)u+=r(t,e);return u};return r(e)}},803:e=>{e.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:"\xa0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"}},9288:(e,t,r)=>{const s=r(2411),n=r(303),i=r(1811),o=(e="",t="",r=!1)=>{const s=[];if(e=[].concat(e),!(t=[].concat(t)).length)return e;if(!e.length)return r?i.flatten(t).map((e=>`{${e}}`)):t;for(const n of e)if(Array.isArray(n))for(const e of n)s.push(o(e,t,r));else for(let e of t)!0===r&&"string"==typeof e&&(e=`{${e}}`),s.push(Array.isArray(e)?o(n,e,r):n+e);return i.flatten(s)};e.exports=(e,t={})=>{const r=void 0===t.rangeLimit?1e3:t.rangeLimit,a=(e,c={})=>{e.queue=[];let l=c,u=c.queue;for(;"brace"!==l.type&&"root"!==l.type&&l.parent;)l=l.parent,u=l.queue;if(e.invalid||e.dollar)return void u.push(o(u.pop(),n(e,t)));if("brace"===e.type&&!0!==e.invalid&&2===e.nodes.length)return void u.push(o(u.pop(),["{}"]));if(e.nodes&&e.ranges>0){const a=i.reduce(e.nodes);if(i.exceedsLimit(...a,t.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let c=s(...a,t);return 0===c.length&&(c=n(e,t)),u.push(o(u.pop(),c)),void(e.nodes=[])}const p=i.encloseBrace(e);let d=e.queue,h=e;for(;"brace"!==h.type&&"root"!==h.type&&h.parent;)h=h.parent,d=h.queue;for(let t=0;t<e.nodes.length;t++){const r=e.nodes[t];"comma"!==r.type||"brace"!==e.type?"close"!==r.type?r.value&&"open"!==r.type?d.push(o(d.pop(),r.value)):r.nodes&&a(r,e):u.push(o(u.pop(),d,p)):(1===t&&d.push(""),d.push(""))}return d};return i.flatten(a(e))}},3585:(e,t,r)=>{const s=r(303),{MAX_LENGTH:n,CHAR_BACKSLASH:i,CHAR_BACKTICK:o,CHAR_COMMA:a,CHAR_DOT:c,CHAR_LEFT_PARENTHESES:l,CHAR_RIGHT_PARENTHESES:u,CHAR_LEFT_CURLY_BRACE:p,CHAR_RIGHT_CURLY_BRACE:d,CHAR_LEFT_SQUARE_BRACKET:h,CHAR_RIGHT_SQUARE_BRACKET:f,CHAR_DOUBLE_QUOTE:g,CHAR_SINGLE_QUOTE:m,CHAR_NO_BREAK_SPACE:y,CHAR_ZERO_WIDTH_NOBREAK_SPACE:b}=r(803);e.exports=(e,t={})=>{if("string"!=typeof e)throw new TypeError("Expected a string");const r=t||{},E="number"==typeof r.maxLength?Math.min(n,r.maxLength):n;if(e.length>E)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${E})`);const w={type:"root",input:e,nodes:[]},A=[w];let S=w,R=w,C=0;const v=e.length;let T,O=0,x=0;const k=()=>e[O++],_=e=>{if("text"===e.type&&"dot"===R.type&&(R.type="text"),!R||"text"!==R.type||"text"!==e.type)return S.nodes.push(e),e.parent=S,e.prev=R,R=e,e;R.value+=e.value};for(_({type:"bos"});O<v;)if(S=A[A.length-1],T=k(),T!==b&&T!==y)if(T!==i)if(T!==f)if(T!==h)if(T!==l)if(T!==u)if(T!==g&&T!==m&&T!==o)if(T!==p)if(T!==d)if(T===a&&x>0){if(S.ranges>0){S.ranges=0;const e=S.nodes.shift();S.nodes=[e,{type:"text",value:s(S)}]}_({type:"comma",value:T}),S.commas++}else if(T===c&&x>0&&0===S.commas){const e=S.nodes;if(0===x||0===e.length){_({type:"text",value:T});continue}if("dot"===R.type){if(S.range=[],R.value+=T,R.type="range",3!==S.nodes.length&&5!==S.nodes.length){S.invalid=!0,S.ranges=0,R.type="text";continue}S.ranges++,S.args=[];continue}if("range"===R.type){e.pop();const t=e[e.length-1];t.value+=R.value+T,R=t,S.ranges--;continue}_({type:"dot",value:T})}else _({type:"text",value:T});else{if("brace"!==S.type){_({type:"text",value:T});continue}const e="close";S=A.pop(),S.close=!0,_({type:e,value:T}),x--,S=A[A.length-1]}else{x++;const e=R.value&&"$"===R.value.slice(-1)||!0===S.dollar;S=_({type:"brace",open:!0,close:!1,dollar:e,depth:x,commas:0,ranges:0,nodes:[]}),A.push(S),_({type:"open",value:T})}else{const e=T;let r;for(!0!==t.keepQuotes&&(T="");O<v&&(r=k());)if(r!==i){if(r===e){!0===t.keepQuotes&&(T+=r);break}T+=r}else T+=r+k();_({type:"text",value:T})}else{if("paren"!==S.type){_({type:"text",value:T});continue}S=A.pop(),_({type:"text",value:T}),S=A[A.length-1]}else S=_({type:"paren",nodes:[]}),A.push(S),_({type:"text",value:T});else{let e;for(C++;O<v&&(e=k());)if(T+=e,e!==h)if(e!==i){if(e===f&&(C--,0===C))break}else T+=k();else C++;_({type:"text",value:T})}else _({type:"text",value:"\\"+T});else _({type:"text",value:(t.keepEscaping?T:"")+k()});do{if(S=A.pop(),"root"!==S.type){S.nodes.forEach((e=>{e.nodes||("open"===e.type&&(e.isOpen=!0),"close"===e.type&&(e.isClose=!0),e.nodes||(e.type="text"),e.invalid=!0)}));const e=A[A.length-1],t=e.nodes.indexOf(S);e.nodes.splice(t,1,...S.nodes)}}while(A.length>0);return _({type:"eos"}),w}},303:(e,t,r)=>{const s=r(1811);e.exports=(e,t={})=>{const r=(e,n={})=>{const i=t.escapeInvalid&&s.isInvalidBrace(n),o=!0===e.invalid&&!0===t.escapeInvalid;let a="";if(e.value)return(i||o)&&s.isOpenOrClose(e)?"\\"+e.value:e.value;if(e.value)return e.value;if(e.nodes)for(const t of e.nodes)a+=r(t);return a};return r(e)}},1811:(e,t)=>{t.isInteger=e=>"number"==typeof e?Number.isInteger(e):"string"==typeof e&&""!==e.trim()&&Number.isInteger(Number(e)),t.find=(e,t)=>e.nodes.find((e=>e.type===t)),t.exceedsLimit=(e,r,s=1,n)=>!1!==n&&!(!t.isInteger(e)||!t.isInteger(r))&&(Number(r)-Number(e))/Number(s)>=n,t.escapeNode=(e,t=0,r)=>{const s=e.nodes[t];s&&(r&&s.type===r||"open"===s.type||"close"===s.type)&&!0!==s.escaped&&(s.value="\\"+s.value,s.escaped=!0)},t.encloseBrace=e=>!("brace"!==e.type||e.commas>>0+e.ranges||(e.invalid=!0,0)),t.isInvalidBrace=e=>!("brace"!==e.type||!0!==e.invalid&&!e.dollar&&(e.commas>>0+e.ranges&&!0===e.open&&!0===e.close||(e.invalid=!0,0))),t.isOpenOrClose=e=>"open"===e.type||"close"===e.type||!0===e.open||!0===e.close,t.reduce=e=>e.reduce(((e,t)=>("text"===t.type&&e.push(t.value),"range"===t.type&&(t.type="text"),e)),[]),t.flatten=(...e)=>{const t=[],r=e=>{for(let s=0;s<e.length;s++){const n=e[s];Array.isArray(n)?r(n):void 0!==n&&t.push(n)}return t};return r(e),t}},526:(e,t,r)=>{const s=r(5317),n=r(4705),i=r(2369);function o(e,t,r){const o=n(e,t,r),a=s.spawn(o.command,o.args,o.options);return i.hookChildProcess(a,o),a}e.exports=o,e.exports.spawn=o,e.exports.sync=function(e,t,r){const o=n(e,t,r),a=s.spawnSync(o.command,o.args,o.options);return a.error=a.error||i.verifyENOENTSync(a.status,o),a},e.exports._parse=n,e.exports._enoent=i},2369:e=>{const t="win32"===process.platform;function r(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function s(e,s){return t&&1===e&&!s.file?r(s.original,"spawn"):null}e.exports={hookChildProcess:function(e,r){if(!t)return;const n=e.emit;e.emit=function(t,i){if("exit"===t){const t=s(i,r);if(t)return n.call(e,"error",t)}return n.apply(e,arguments)}},verifyENOENT:s,verifyENOENTSync:function(e,s){return t&&1===e&&!s.file?r(s.original,"spawnSync"):null},notFoundError:r}},4705:(e,t,r)=>{const s=r(6928),n=r(6694),i=r(1192),o=r(3179),a="win32"===process.platform,c=/\.(?:com|exe)$/i,l=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;e.exports=function(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null);const u={command:e,args:t=t?t.slice(0):[],options:r=Object.assign({},r),file:void 0,original:{command:e,args:t}};return r.shell?u:function(e){if(!a)return e;const t=function(e){e.file=n(e);const t=e.file&&o(e.file);return t?(e.args.unshift(e.file),e.command=t,n(e)):e.file}(e),r=!c.test(t);if(e.options.forceShell||r){const r=l.test(t);e.command=s.normalize(e.command),e.command=i.command(e.command),e.args=e.args.map((e=>i.argument(e,r)));const n=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${n}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}(u)}},1192:e=>{const t=/([()\][%!^"`<>&|;, *?])/g;e.exports.command=function(e){return e.replace(t,"^$1")},e.exports.argument=function(e,r){return e=(e=`"${e=(e=(e=`${e}`).replace(/(\\*)"/g,'$1$1\\"')).replace(/(\\*)$/,"$1$1")}"`).replace(t,"^$1"),r&&(e=e.replace(t,"^$1")),e}},3179:(e,t,r)=>{const s=r(9896),n=r(600);e.exports=function(e){const t=Buffer.alloc(150);let r;try{r=s.openSync(e,"r"),s.readSync(r,t,0,150,0),s.closeSync(r)}catch(e){}return n(t.toString())}},6694:(e,t,r)=>{const s=r(6928),n=r(1905),i=r(9695);function o(e,t){const r=e.options.env||process.env,o=process.cwd(),a=null!=e.options.cwd,c=a&&void 0!==process.chdir&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch(e){}let l;try{l=n.sync(e.command,{path:r[i({env:r})],pathExt:t?s.delimiter:void 0})}catch(e){}finally{c&&process.chdir(o)}return l&&(l=s.resolve(a?e.options.cwd:"",l)),l}e.exports=function(e){return o(e)||o(e,!0)}},7214:(e,t,r)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let s=0,n=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(s++,"%c"===e&&(n=s))})),t.splice(n,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=r(1)(t);const{formatters:s}=e.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},1:(e,t,r)=>{e.exports=function(e){function t(e){let r,n,i,o=null;function a(...e){if(!a.enabled)return;const s=a,n=Number(new Date),i=n-(r||n);s.diff=i,s.prev=r,s.curr=n,r=n,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let o=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,n)=>{if("%%"===r)return"%";o++;const i=t.formatters[n];if("function"==typeof i){const t=e[o];r=i.call(s,t),e.splice(o,1),o--}return r})),t.formatArgs.call(s,e),(s.log||t.log).apply(s,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=s,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(n!==t.namespaces&&(n=t.namespaces,i=t.enabled(e)),i),set:e=>{o=e}}),"function"==typeof t.init&&t.init(a),a}function s(e,r){const s=t(this.namespace+(void 0===r?":":r)+e);return s.log=this.log,s}function n(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(n),...t.skips.map(n).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const s=("string"==typeof e?e:"").split(/[\s,]+/),n=s.length;for(r=0;r<n;r++)s[r]&&("-"===(e=s[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,s;for(r=0,s=t.skips.length;r<s;r++)if(t.skips[r].test(e))return!1;for(r=0,s=t.names.length;r<s;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(3866),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}},8894:(e,t,r)=>{"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?e.exports=r(7214):e.exports=r(6804)},6804:(e,t,r)=>{const s=r(2018),n=r(9023);t.init=function(e){e.inspectOpts={};const r=Object.keys(t.inspectOpts);for(let s=0;s<r.length;s++)e.inspectOpts[r[s]]=t.inspectOpts[r[s]]},t.log=function(...e){return process.stderr.write(n.formatWithOptions(t.inspectOpts,...e)+"\n")},t.formatArgs=function(r){const{namespace:s,useColors:n}=this;if(n){const t=this.color,n="\x1b[3"+(t<8?t:"8;5;"+t),i=` ${n};1m${s} \x1b[0m`;r[0]=i+r[0].split("\n").join("\n"+i),r.push(n+"m+"+e.exports.humanize(this.diff)+"\x1b[0m")}else r[0]=(t.inspectOpts.hideDate?"":(new Date).toISOString()+" ")+s+" "+r[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):s.isatty(process.stderr.fd)},t.destroy=n.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=r(1754);e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const r=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let s=process.env[t];return s=!!/^(yes|on|true|enabled)$/i.test(s)||!/^(no|off|false|disabled)$/i.test(s)&&("null"===s?null:Number(s)),e[r]=s,e}),{}),e.exports=r(1)(t);const{formatters:i}=e.exports;i.o=function(e){return this.inspectOpts.colors=this.useColors,n.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},i.O=function(e){return this.inspectOpts.colors=this.useColors,n.inspect(e,this.inspectOpts)}},6296:e=>{var t=Object.prototype.hasOwnProperty,r="~";function s(){}function n(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function i(e,t,s,i,o){if("function"!=typeof s)throw new TypeError("The listener must be a function");var a=new n(s,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new s:delete e._events[t]}function a(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(r=!1)),a.prototype.eventNames=function(){var e,s,n=[];if(0===this._eventsCount)return n;for(s in e=this._events)t.call(e,s)&&n.push(r?s.slice(1):s);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},a.prototype.listeners=function(e){var t=r?r+e:e,s=this._events[t];if(!s)return[];if(s.fn)return[s.fn];for(var n=0,i=s.length,o=new Array(i);n<i;n++)o[n]=s[n].fn;return o},a.prototype.listenerCount=function(e){var t=r?r+e:e,s=this._events[t];return s?s.fn?1:s.length:0},a.prototype.emit=function(e,t,s,n,i,o){var a=r?r+e:e;if(!this._events[a])return!1;var c,l,u=this._events[a],p=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),p){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,s),!0;case 4:return u.fn.call(u.context,t,s,n),!0;case 5:return u.fn.call(u.context,t,s,n,i),!0;case 6:return u.fn.call(u.context,t,s,n,i,o),!0}for(l=1,c=new Array(p-1);l<p;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var d,h=u.length;for(l=0;l<h;l++)switch(u[l].once&&this.removeListener(e,u[l].fn,void 0,!0),p){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,t);break;case 3:u[l].fn.call(u[l].context,t,s);break;case 4:u[l].fn.call(u[l].context,t,s,n);break;default:if(!c)for(d=1,c=new Array(p-1);d<p;d++)c[d-1]=arguments[d];u[l].fn.apply(u[l].context,c)}}return!0},a.prototype.on=function(e,t,r){return i(this,e,t,r,!1)},a.prototype.once=function(e,t,r){return i(this,e,t,r,!0)},a.prototype.removeListener=function(e,t,s,n){var i=r?r+e:e;if(!this._events[i])return this;if(!t)return o(this,i),this;var a=this._events[i];if(a.fn)a.fn!==t||n&&!a.once||s&&a.context!==s||o(this,i);else{for(var c=0,l=[],u=a.length;c<u;c++)(a[c].fn!==t||n&&!a[c].once||s&&a[c].context!==s)&&l.push(a[c]);l.length?this._events[i]=1===l.length?l[0]:l:o(this,i)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&o(this,t)):(this._events=new s,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,e.exports=a},2411:(e,t,r)=>{const s=r(9023),n=r(4710),i=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),o=e=>"number"==typeof e||"string"==typeof e&&""!==e,a=e=>Number.isInteger(+e),c=e=>{let t=`${e}`,r=-1;if("-"===t[0]&&(t=t.slice(1)),"0"===t)return!1;for(;"0"===t[++r];);return r>0},l=(e,t,r)=>{if(t>0){let r="-"===e[0]?"-":"";r&&(e=e.slice(1)),e=r+e.padStart(r?t-1:t,"0")}return!1===r?String(e):e},u=(e,t)=>{let r="-"===e[0]?"-":"";for(r&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return r?"-"+e:e},p=(e,t,r,s)=>{if(r)return n(e,t,{wrap:!1,...s});let i=String.fromCharCode(e);return e===t?i:`[${i}-${String.fromCharCode(t)}]`},d=(e,t,r)=>{if(Array.isArray(e)){let t=!0===r.wrap,s=r.capture?"":"?:";return t?`(${s}${e.join("|")})`:e.join("|")}return n(e,t,r)},h=(...e)=>new RangeError("Invalid range arguments: "+s.inspect(...e)),f=(e,t,r)=>{if(!0===r.strictRanges)throw h([e,t]);return[]},g=(e,t,r,s={})=>{if(null==t&&o(e))return[e];if(!o(e)||!o(t))return f(e,t,s);if("function"==typeof r)return g(e,t,1,{transform:r});if(i(r))return g(e,t,0,r);let n={...s};return!0===n.capture&&(n.wrap=!0),r=r||n.step||1,a(r)?a(e)&&a(t)?((e,t,r=1,s={})=>{let n=Number(e),i=Number(t);if(!Number.isInteger(n)||!Number.isInteger(i)){if(!0===s.strictRanges)throw h([e,t]);return[]}0===n&&(n=0),0===i&&(i=0);let o=n>i,a=String(e),f=String(t),g=String(r);r=Math.max(Math.abs(r),1);let m=c(a)||c(f)||c(g),y=m?Math.max(a.length,f.length,g.length):0,b=!1===m&&!1===((e,t,r)=>"string"==typeof e||"string"==typeof t||!0===r.stringify)(e,t,s),E=s.transform||(e=>t=>!0===e?Number(t):String(t))(b);if(s.toRegex&&1===r)return p(u(e,y),u(t,y),!0,s);let w={negatives:[],positives:[]},A=[],S=0;for(;o?n>=i:n<=i;)!0===s.toRegex&&r>1?w[(R=n)<0?"negatives":"positives"].push(Math.abs(R)):A.push(l(E(n,S),y,b)),n=o?n-r:n+r,S++;var R;return!0===s.toRegex?r>1?((e,t,r)=>{e.negatives.sort(((e,t)=>e<t?-1:e>t?1:0)),e.positives.sort(((e,t)=>e<t?-1:e>t?1:0));let s,n=t.capture?"":"?:",i="",o="";return e.positives.length&&(i=e.positives.map((e=>u(String(e),r))).join("|")),e.negatives.length&&(o=`-(${n}${e.negatives.map((e=>u(String(e),r))).join("|")})`),s=i&&o?`${i}|${o}`:i||o,t.wrap?`(${n}${s})`:s})(w,s,y):d(A,null,{wrap:!1,...s}):A})(e,t,r,n):((e,t,r=1,s={})=>{if(!a(e)&&e.length>1||!a(t)&&t.length>1)return f(e,t,s);let n=s.transform||(e=>String.fromCharCode(e)),i=`${e}`.charCodeAt(0),o=`${t}`.charCodeAt(0),c=i>o,l=Math.min(i,o),u=Math.max(i,o);if(s.toRegex&&1===r)return p(l,u,!1,s);let h=[],g=0;for(;c?i>=o:i<=o;)h.push(n(i,g)),i=c?i-r:i+r,g++;return!0===s.toRegex?d(h,null,{wrap:!1,options:s}):h})(e,t,Math.max(Math.abs(r),1),n):null==r||i(r)?g(e,t,1,r):((e,t)=>{if(!0===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return[]})(r,n)};e.exports=g},4891:e=>{e.exports=(e,t)=>{t=t||process.argv;const r=e.startsWith("-")?"":1===e.length?"-":"--",s=t.indexOf(r+e),n=t.indexOf("--");return-1!==s&&(-1===n||s<n)}},9789:e=>{e.exports=function(e){return"number"==typeof e?e-e==0:"string"==typeof e&&""!==e.trim()&&(Number.isFinite?Number.isFinite(+e):isFinite(+e))}},9344:(e,t,r)=>{var s;function n(e,t,r){if("function"==typeof t&&(r=t,t={}),!r){if("function"!=typeof Promise)throw new TypeError("callback not provided");return new Promise((function(r,s){n(e,t||{},(function(e,t){e?s(e):r(t)}))}))}s(e,t||{},(function(e,s){e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,s=!1),r(e,s)}))}r(9896),s="win32"===process.platform||global.TESTING_WINDOWS?r(8541):r(709),e.exports=n,n.sync=function(e,t){try{return s.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||"EACCES"===e.code)return!1;throw e}}},709:(e,t,r)=>{e.exports=n,n.sync=function(e,t){return i(s.statSync(e),t)};var s=r(9896);function n(e,t,r){s.stat(e,(function(e,s){r(e,!e&&i(s,t))}))}function i(e,t){return e.isFile()&&function(e,t){var r=e.mode,s=e.uid,n=e.gid,i=void 0!==t.uid?t.uid:process.getuid&&process.getuid(),o=void 0!==t.gid?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8);return r&parseInt("001",8)||r&c&&n===o||r&a&&s===i||r&(a|c)&&0===i}(e,t)}},8541:(e,t,r)=>{e.exports=i,i.sync=function(e,t){return n(s.statSync(e),e,t)};var s=r(9896);function n(e,t,r){return!(!e.isSymbolicLink()&&!e.isFile())&&function(e,t){var r=void 0!==t.pathExt?t.pathExt:process.env.PATHEXT;if(!r)return!0;if(-1!==(r=r.split(";")).indexOf(""))return!0;for(var s=0;s<r.length;s++){var n=r[s].toLowerCase();if(n&&e.substr(-n.length).toLowerCase()===n)return!0}return!1}(t,r)}function i(e,t,r){s.stat(e,(function(s,i){r(s,!s&&n(i,e,t))}))}},1404:(e,t,r)=>{const{PassThrough:s}=r(2203);e.exports=function(){var e=[],t=new s({objectMode:!0});return t.setMaxListeners(0),t.add=r,t.isEmpty=function(){return 0==e.length},t.on("unpipe",n),Array.prototype.slice.call(arguments).forEach(r),t;function r(s){return Array.isArray(s)?(s.forEach(r),this):(e.push(s),s.once("end",n.bind(null,s)),s.once("error",t.emit.bind(t,"error")),s.pipe(t,{end:!1}),this)}function n(r){!(e=e.filter((function(e){return e!==r}))).length&&t.readable&&t.end()}}},7498:(e,t,r)=>{const s=r(9023),n=r(4078),i=r(5562),o=r(6927),a=e=>""===e||"./"===e,c=e=>{const t=e.indexOf("{");return t>-1&&e.indexOf("}",t)>-1},l=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let s=new Set,n=new Set,o=new Set,a=0,c=e=>{o.add(e.output),r&&r.onResult&&r.onResult(e)};for(let o=0;o<t.length;o++){let l=i(String(t[o]),{...r,onResult:c},!0),u=l.state.negated||l.state.negatedExtglob;u&&a++;for(let t of e){let e=l(t,!0);(u?!e.isMatch:e.isMatch)&&(u?s.add(e.output):(s.delete(e.output),n.add(e.output)))}}let l=(a===t.length?[...o]:[...n]).filter((e=>!s.has(e)));if(r&&0===l.length){if(!0===r.failglob)throw new Error(`No matches found for "${t.join(", ")}"`);if(!0===r.nonull||!0===r.nullglob)return r.unescape?t.map((e=>e.replace(/\\/g,""))):t}return l};l.match=l,l.matcher=(e,t)=>i(e,t),l.any=l.isMatch=(e,t,r)=>i(t,r)(e),l.not=(e,t,r={})=>{t=[].concat(t).map(String);let s=new Set,n=[],i=new Set(l(e,t,{...r,onResult:e=>{r.onResult&&r.onResult(e),n.push(e.output)}}));for(let e of n)i.has(e)||s.add(e);return[...s]},l.contains=(e,t,r)=>{if("string"!=typeof e)throw new TypeError(`Expected a string: "${s.inspect(e)}"`);if(Array.isArray(t))return t.some((t=>l.contains(e,t,r)));if("string"==typeof t){if(a(e)||a(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return l.isMatch(e,t,{...r,contains:!0})},l.matchKeys=(e,t,r)=>{if(!o.isObject(e))throw new TypeError("Expected the first argument to be an object");let s=l(Object.keys(e),t,r),n={};for(let t of s)n[t]=e[t];return n},l.some=(e,t,r)=>{let s=[].concat(e);for(let e of[].concat(t)){let t=i(String(e),r);if(s.some((e=>t(e))))return!0}return!1},l.every=(e,t,r)=>{let s=[].concat(e);for(let e of[].concat(t)){let t=i(String(e),r);if(!s.every((e=>t(e))))return!1}return!0},l.all=(e,t,r)=>{if("string"!=typeof e)throw new TypeError(`Expected a string: "${s.inspect(e)}"`);return[].concat(t).every((t=>i(t,r)(e)))},l.capture=(e,t,r)=>{let s=o.isWindows(r),n=i.makeRe(String(e),{...r,capture:!0}).exec(s?o.toPosixSlashes(t):t);if(n)return n.slice(1).map((e=>void 0===e?"":e))},l.makeRe=(...e)=>i.makeRe(...e),l.scan=(...e)=>i.scan(...e),l.parse=(e,t)=>{let r=[];for(let s of[].concat(e||[]))for(let e of n(String(s),t))r.push(i.parse(e,t));return r},l.braces=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return t&&!0===t.nobrace||!c(e)?[e]:n(e,t)},l.braceExpand=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return l.braces(e,{...t,expand:!0})},l.hasBraces=c,e.exports=l},3866:e=>{var t=1e3,r=60*t,s=60*r,n=24*s,i=7*n;function o(e,t,r,s){var n=t>=1.5*r;return Math.round(e/r)+" "+s+(n?"s":"")}e.exports=function(e,a){a=a||{};var c,l,u=typeof e;if("string"===u&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(o){var a=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return a*i;case"days":case"day":case"d":return a*n;case"hours":case"hour":case"hrs":case"hr":case"h":return a*s;case"minutes":case"minute":case"mins":case"min":case"m":return a*r;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}(e);if("number"===u&&isFinite(e))return a.long?(c=e,(l=Math.abs(c))>=n?o(c,l,n,"day"):l>=s?o(c,l,s,"hour"):l>=r?o(c,l,r,"minute"):l>=t?o(c,l,t,"second"):c+" ms"):function(e){var i=Math.abs(e);return i>=n?Math.round(e/n)+"d":i>=s?Math.round(e/s)+"h":i>=r?Math.round(e/r)+"m":i>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},9695:e=>{const t=(e={})=>{const t=e.env||process.env;return"win32"!==(e.platform||process.platform)?"PATH":Object.keys(t).reverse().find((e=>"PATH"===e.toUpperCase()))||"Path"};e.exports=t,e.exports.default=t},5562:(e,t,r)=>{e.exports=r(8996)},4751:(e,t,r)=>{const s=r(6928),n="\\\\/",i=`[^${n}]`,o="\\.",a="\\/",c="[^/]",l=`(?:${a}|$)`,u=`(?:^|${a})`,p=`${o}{1,2}${l}`,d={DOT_LITERAL:o,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:a,ONE_CHAR:"(?=.)",QMARK:c,END_ANCHOR:l,DOTS_SLASH:p,NO_DOT:`(?!${o})`,NO_DOTS:`(?!${u}${p})`,NO_DOT_SLASH:`(?!${o}{0,1}${l})`,NO_DOTS_SLASH:`(?!${p})`,QMARK_NO_DOT:`[^.${a}]`,STAR:`${c}*?`,START_ANCHOR:u},h={...d,SLASH_LITERAL:`[${n}]`,QMARK:i,STAR:`${i}*?`,DOTS_SLASH:`${o}{1,2}(?:[${n}]|$)`,NO_DOT:`(?!${o})`,NO_DOTS:`(?!(?:^|[${n}])${o}{1,2}(?:[${n}]|$))`,NO_DOT_SLASH:`(?!${o}{0,1}(?:[${n}]|$))`,NO_DOTS_SLASH:`(?!${o}{1,2}(?:[${n}]|$))`,QMARK_NO_DOT:`[^.${n}]`,START_ANCHOR:`(?:^|[${n}])`,END_ANCHOR:`(?:[${n}]|$)`};e.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:s.sep,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?h:d}},5453:(e,t,r)=>{const s=r(4751),n=r(6927),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:o,REGEX_NON_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_BACKREF:c,REPLACEMENTS:l}=s,u=(e,t)=>{if("function"==typeof t.expandRange)return t.expandRange(...e,t);e.sort();const r=`[${e.join("-")}]`;try{new RegExp(r)}catch(t){return e.map((e=>n.escapeRegex(e))).join("..")}return r},p=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,d=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");e=l[e]||e;const r={...t},h="number"==typeof r.maxLength?Math.min(i,r.maxLength):i;let f=e.length;if(f>h)throw new SyntaxError(`Input length: ${f}, exceeds maximum allowed length: ${h}`);const g={type:"bos",value:"",output:r.prepend||""},m=[g],y=r.capture?"":"?:",b=n.isWindows(t),E=s.globChars(b),w=s.extglobChars(E),{DOT_LITERAL:A,PLUS_LITERAL:S,SLASH_LITERAL:R,ONE_CHAR:C,DOTS_SLASH:v,NO_DOT:T,NO_DOT_SLASH:O,NO_DOTS_SLASH:x,QMARK:k,QMARK_NO_DOT:_,STAR:L,START_ANCHOR:P}=E,I=e=>`(${y}(?:(?!${P}${e.dot?v:A}).)*?)`,$=r.dot?"":T,B=r.dot?k:_;let F=!0===r.bash?I(r):L;r.capture&&(F=`(${F})`),"boolean"==typeof r.noext&&(r.noextglob=r.noext);const D={input:e,index:-1,start:0,dot:!0===r.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:m};e=n.removePrefix(e,D),f=e.length;const H=[],M=[],N=[];let G,U=g;const j=()=>D.index===f-1,K=D.peek=(t=1)=>e[D.index+t],W=D.advance=()=>e[++D.index]||"",z=()=>e.slice(D.index+1),Y=(e="",t=0)=>{D.consumed+=e,D.index+=t},q=e=>{D.output+=null!=e.output?e.output:e.value,Y(e.value)},V=()=>{let e=1;for(;"!"===K()&&("("!==K(2)||"?"===K(3));)W(),D.start++,e++;return e%2!=0&&(D.negated=!0,D.start++,!0)},X=e=>{D[e]++,N.push(e)},Q=e=>{D[e]--,N.pop()},Z=e=>{if("globstar"===U.type){const t=D.braces>0&&("comma"===e.type||"brace"===e.type),r=!0===e.extglob||H.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||r||(D.output=D.output.slice(0,-U.output.length),U.type="star",U.value="*",U.output=F,D.output+=U.output)}if(H.length&&"paren"!==e.type&&(H[H.length-1].inner+=e.value),(e.value||e.output)&&q(e),U&&"text"===U.type&&"text"===e.type)return U.value+=e.value,void(U.output=(U.output||"")+e.value);e.prev=U,m.push(e),U=e},J=(e,t)=>{const s={...w[t],conditions:1,inner:""};s.prev=U,s.parens=D.parens,s.output=D.output;const n=(r.capture?"(":"")+s.open;X("parens"),Z({type:e,value:t,output:D.output?"":C}),Z({type:"paren",extglob:!0,value:W(),output:n}),H.push(s)},ee=e=>{let s,n=e.close+(r.capture?")":"");if("negate"===e.type){let i=F;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(i=I(r)),(i!==F||j()||/^\)+$/.test(z()))&&(n=e.close=`)$))${i}`),e.inner.includes("*")&&(s=z())&&/^\.[^\\/.]+$/.test(s)){const r=d(s,{...t,fastpaths:!1}).output;n=e.close=`)${r})${i})`}"bos"===e.prev.type&&(D.negatedExtglob=!0)}Z({type:"paren",extglob:!0,value:G,output:n}),Q("parens")};if(!1!==r.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(e)){let s=!1,i=e.replace(c,((e,t,r,n,i,o)=>"\\"===n?(s=!0,e):"?"===n?t?t+n+(i?k.repeat(i.length):""):0===o?B+(i?k.repeat(i.length):""):k.repeat(r.length):"."===n?A.repeat(r.length):"*"===n?t?t+n+(i?F:""):F:t?e:`\\${e}`));return!0===s&&(i=!0===r.unescape?i.replace(/\\/g,""):i.replace(/\\+/g,(e=>e.length%2==0?"\\\\":e?"\\":""))),i===e&&!0===r.contains?(D.output=e,D):(D.output=n.wrapOutput(i,D,t),D)}for(;!j();){if(G=W(),"\0"===G)continue;if("\\"===G){const e=K();if("/"===e&&!0!==r.bash)continue;if("."===e||";"===e)continue;if(!e){G+="\\",Z({type:"text",value:G});continue}const t=/^\\+/.exec(z());let s=0;if(t&&t[0].length>2&&(s=t[0].length,D.index+=s,s%2!=0&&(G+="\\")),!0===r.unescape?G=W():G+=W(),0===D.brackets){Z({type:"text",value:G});continue}}if(D.brackets>0&&("]"!==G||"["===U.value||"[^"===U.value)){if(!1!==r.posix&&":"===G){const e=U.value.slice(1);if(e.includes("[")&&(U.posix=!0,e.includes(":"))){const e=U.value.lastIndexOf("["),t=U.value.slice(0,e),r=U.value.slice(e+2),s=o[r];if(s){U.value=t+s,D.backtrack=!0,W(),g.output||1!==m.indexOf(U)||(g.output=C);continue}}}("["===G&&":"!==K()||"-"===G&&"]"===K())&&(G=`\\${G}`),"]"!==G||"["!==U.value&&"[^"!==U.value||(G=`\\${G}`),!0===r.posix&&"!"===G&&"["===U.value&&(G="^"),U.value+=G,q({value:G});continue}if(1===D.quotes&&'"'!==G){G=n.escapeRegex(G),U.value+=G,q({value:G});continue}if('"'===G){D.quotes=1===D.quotes?0:1,!0===r.keepQuotes&&Z({type:"text",value:G});continue}if("("===G){X("parens"),Z({type:"paren",value:G});continue}if(")"===G){if(0===D.parens&&!0===r.strictBrackets)throw new SyntaxError(p("opening","("));const e=H[H.length-1];if(e&&D.parens===e.parens+1){ee(H.pop());continue}Z({type:"paren",value:G,output:D.parens?")":"\\)"}),Q("parens");continue}if("["===G){if(!0!==r.nobracket&&z().includes("]"))X("brackets");else{if(!0!==r.nobracket&&!0===r.strictBrackets)throw new SyntaxError(p("closing","]"));G=`\\${G}`}Z({type:"bracket",value:G});continue}if("]"===G){if(!0===r.nobracket||U&&"bracket"===U.type&&1===U.value.length){Z({type:"text",value:G,output:`\\${G}`});continue}if(0===D.brackets){if(!0===r.strictBrackets)throw new SyntaxError(p("opening","["));Z({type:"text",value:G,output:`\\${G}`});continue}Q("brackets");const e=U.value.slice(1);if(!0===U.posix||"^"!==e[0]||e.includes("/")||(G=`/${G}`),U.value+=G,q({value:G}),!1===r.literalBrackets||n.hasRegexChars(e))continue;const t=n.escapeRegex(U.value);if(D.output=D.output.slice(0,-U.value.length),!0===r.literalBrackets){D.output+=t,U.value=t;continue}U.value=`(${y}${t}|${U.value})`,D.output+=U.value;continue}if("{"===G&&!0!==r.nobrace){X("braces");const e={type:"brace",value:G,output:"(",outputIndex:D.output.length,tokensIndex:D.tokens.length};M.push(e),Z(e);continue}if("}"===G){const e=M[M.length-1];if(!0===r.nobrace||!e){Z({type:"text",value:G,output:G});continue}let t=")";if(!0===e.dots){const e=m.slice(),s=[];for(let t=e.length-1;t>=0&&(m.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&s.unshift(e[t].value);t=u(s,r),D.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const r=D.output.slice(0,e.outputIndex),s=D.tokens.slice(e.tokensIndex);e.value=e.output="\\{",G=t="\\}",D.output=r;for(const e of s)D.output+=e.output||e.value}Z({type:"brace",value:G,output:t}),Q("braces"),M.pop();continue}if("|"===G){H.length>0&&H[H.length-1].conditions++,Z({type:"text",value:G});continue}if(","===G){let e=G;const t=M[M.length-1];t&&"braces"===N[N.length-1]&&(t.comma=!0,e="|"),Z({type:"comma",value:G,output:e});continue}if("/"===G){if("dot"===U.type&&D.index===D.start+1){D.start=D.index+1,D.consumed="",D.output="",m.pop(),U=g;continue}Z({type:"slash",value:G,output:R});continue}if("."===G){if(D.braces>0&&"dot"===U.type){"."===U.value&&(U.output=A);const e=M[M.length-1];U.type="dots",U.output+=G,U.value+=G,e.dots=!0;continue}if(D.braces+D.parens===0&&"bos"!==U.type&&"slash"!==U.type){Z({type:"text",value:G,output:A});continue}Z({type:"dot",value:G,output:A});continue}if("?"===G){if((!U||"("!==U.value)&&!0!==r.noextglob&&"("===K()&&"?"!==K(2)){J("qmark",G);continue}if(U&&"paren"===U.type){const e=K();let t=G;if("<"===e&&!n.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===U.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(z()))&&(t=`\\${G}`),Z({type:"text",value:G,output:t});continue}if(!0!==r.dot&&("slash"===U.type||"bos"===U.type)){Z({type:"qmark",value:G,output:_});continue}Z({type:"qmark",value:G,output:k});continue}if("!"===G){if(!0!==r.noextglob&&"("===K()&&("?"!==K(2)||!/[!=<:]/.test(K(3)))){J("negate",G);continue}if(!0!==r.nonegate&&0===D.index){V();continue}}if("+"===G){if(!0!==r.noextglob&&"("===K()&&"?"!==K(2)){J("plus",G);continue}if(U&&"("===U.value||!1===r.regex){Z({type:"plus",value:G,output:S});continue}if(U&&("bracket"===U.type||"paren"===U.type||"brace"===U.type)||D.parens>0){Z({type:"plus",value:G});continue}Z({type:"plus",value:S});continue}if("@"===G){if(!0!==r.noextglob&&"("===K()&&"?"!==K(2)){Z({type:"at",extglob:!0,value:G,output:""});continue}Z({type:"text",value:G});continue}if("*"!==G){"$"!==G&&"^"!==G||(G=`\\${G}`);const e=a.exec(z());e&&(G+=e[0],D.index+=e[0].length),Z({type:"text",value:G});continue}if(U&&("globstar"===U.type||!0===U.star)){U.type="star",U.star=!0,U.value+=G,U.output=F,D.backtrack=!0,D.globstar=!0,Y(G);continue}let t=z();if(!0!==r.noextglob&&/^\([^?]/.test(t)){J("star",G);continue}if("star"===U.type){if(!0===r.noglobstar){Y(G);continue}const s=U.prev,n=s.prev,i="slash"===s.type||"bos"===s.type,o=n&&("star"===n.type||"globstar"===n.type);if(!0===r.bash&&(!i||t[0]&&"/"!==t[0])){Z({type:"star",value:G,output:""});continue}const a=D.braces>0&&("comma"===s.type||"brace"===s.type),c=H.length&&("pipe"===s.type||"paren"===s.type);if(!i&&"paren"!==s.type&&!a&&!c){Z({type:"star",value:G,output:""});continue}for(;"/**"===t.slice(0,3);){const r=e[D.index+4];if(r&&"/"!==r)break;t=t.slice(3),Y("/**",3)}if("bos"===s.type&&j()){U.type="globstar",U.value+=G,U.output=I(r),D.output=U.output,D.globstar=!0,Y(G);continue}if("slash"===s.type&&"bos"!==s.prev.type&&!o&&j()){D.output=D.output.slice(0,-(s.output+U.output).length),s.output=`(?:${s.output}`,U.type="globstar",U.output=I(r)+(r.strictSlashes?")":"|$)"),U.value+=G,D.globstar=!0,D.output+=s.output+U.output,Y(G);continue}if("slash"===s.type&&"bos"!==s.prev.type&&"/"===t[0]){const e=void 0!==t[1]?"|$":"";D.output=D.output.slice(0,-(s.output+U.output).length),s.output=`(?:${s.output}`,U.type="globstar",U.output=`${I(r)}${R}|${R}${e})`,U.value+=G,D.output+=s.output+U.output,D.globstar=!0,Y(G+W()),Z({type:"slash",value:"/",output:""});continue}if("bos"===s.type&&"/"===t[0]){U.type="globstar",U.value+=G,U.output=`(?:^|${R}|${I(r)}${R})`,D.output=U.output,D.globstar=!0,Y(G+W()),Z({type:"slash",value:"/",output:""});continue}D.output=D.output.slice(0,-U.output.length),U.type="globstar",U.output=I(r),U.value+=G,D.output+=U.output,D.globstar=!0,Y(G);continue}const s={type:"star",value:G,output:F};!0!==r.bash?!U||"bracket"!==U.type&&"paren"!==U.type||!0!==r.regex?(D.index!==D.start&&"slash"!==U.type&&"dot"!==U.type||("dot"===U.type?(D.output+=O,U.output+=O):!0===r.dot?(D.output+=x,U.output+=x):(D.output+=$,U.output+=$),"*"!==K()&&(D.output+=C,U.output+=C)),Z(s)):(s.output=G,Z(s)):(s.output=".*?","bos"!==U.type&&"slash"!==U.type||(s.output=$+s.output),Z(s))}for(;D.brackets>0;){if(!0===r.strictBrackets)throw new SyntaxError(p("closing","]"));D.output=n.escapeLast(D.output,"["),Q("brackets")}for(;D.parens>0;){if(!0===r.strictBrackets)throw new SyntaxError(p("closing",")"));D.output=n.escapeLast(D.output,"("),Q("parens")}for(;D.braces>0;){if(!0===r.strictBrackets)throw new SyntaxError(p("closing","}"));D.output=n.escapeLast(D.output,"{"),Q("braces")}if(!0===r.strictSlashes||"star"!==U.type&&"bracket"!==U.type||Z({type:"maybe_slash",value:"",output:`${R}?`}),!0===D.backtrack){D.output="";for(const e of D.tokens)D.output+=null!=e.output?e.output:e.value,e.suffix&&(D.output+=e.suffix)}return D};d.fastpaths=(e,t)=>{const r={...t},o="number"==typeof r.maxLength?Math.min(i,r.maxLength):i,a=e.length;if(a>o)throw new SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${o}`);e=l[e]||e;const c=n.isWindows(t),{DOT_LITERAL:u,SLASH_LITERAL:p,ONE_CHAR:d,DOTS_SLASH:h,NO_DOT:f,NO_DOTS:g,NO_DOTS_SLASH:m,STAR:y,START_ANCHOR:b}=s.globChars(c),E=r.dot?g:f,w=r.dot?m:f,A=r.capture?"":"?:";let S=!0===r.bash?".*?":y;r.capture&&(S=`(${S})`);const R=e=>!0===e.noglobstar?S:`(${A}(?:(?!${b}${e.dot?h:u}).)*?)`,C=e=>{switch(e){case"*":return`${E}${d}${S}`;case".*":return`${u}${d}${S}`;case"*.*":return`${E}${S}${u}${d}${S}`;case"*/*":return`${E}${S}${p}${d}${w}${S}`;case"**":return E+R(r);case"**/*":return`(?:${E}${R(r)}${p})?${w}${d}${S}`;case"**/*.*":return`(?:${E}${R(r)}${p})?${w}${S}${u}${d}${S}`;case"**/.*":return`(?:${E}${R(r)}${p})?${u}${d}${S}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const r=C(t[1]);if(!r)return;return r+u+t[2]}}},v=n.removePrefix(e,{negated:!1,prefix:""});let T=C(v);return T&&!0!==r.strictSlashes&&(T+=`${p}?`),T},e.exports=d},8996:(e,t,r)=>{const s=r(6928),n=r(3297),i=r(5453),o=r(6927),a=r(4751),c=(e,t,r=!1)=>{if(Array.isArray(e)){const s=e.map((e=>c(e,t,r))),n=e=>{for(const t of s){const r=t(e);if(r)return r}return!1};return n}const s=(n=e)&&"object"==typeof n&&!Array.isArray(n)&&e.tokens&&e.input;var n;if(""===e||"string"!=typeof e&&!s)throw new TypeError("Expected pattern to be a non-empty string");const i=t||{},a=o.isWindows(t),l=s?c.compileRe(e,t):c.makeRe(e,t,!1,!0),u=l.state;delete l.state;let p=()=>!1;if(i.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};p=c(i.ignore,e,r)}const d=(r,s=!1)=>{const{isMatch:n,match:o,output:d}=c.test(r,l,t,{glob:e,posix:a}),h={glob:e,state:u,regex:l,posix:a,input:r,output:d,match:o,isMatch:n};return"function"==typeof i.onResult&&i.onResult(h),!1===n?(h.isMatch=!1,!!s&&h):p(r)?("function"==typeof i.onIgnore&&i.onIgnore(h),h.isMatch=!1,!!s&&h):("function"==typeof i.onMatch&&i.onMatch(h),!s||h)};return r&&(d.state=u),d};c.test=(e,t,r,{glob:s,posix:n}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const i=r||{},a=i.format||(n?o.toPosixSlashes:null);let l=e===s,u=l&&a?a(e):e;return!1===l&&(u=a?a(e):e,l=u===s),!1!==l&&!0!==i.capture||(l=!0===i.matchBase||!0===i.basename?c.matchBase(e,t,r,n):t.exec(u)),{isMatch:Boolean(l),match:l,output:u}},c.matchBase=(e,t,r,n=o.isWindows(r))=>(t instanceof RegExp?t:c.makeRe(t,r)).test(s.basename(e)),c.isMatch=(e,t,r)=>c(t,r)(e),c.parse=(e,t)=>Array.isArray(e)?e.map((e=>c.parse(e,t))):i(e,{...t,fastpaths:!1}),c.scan=(e,t)=>n(e,t),c.compileRe=(e,t,r=!1,s=!1)=>{if(!0===r)return e.output;const n=t||{},i=n.contains?"":"^",o=n.contains?"":"$";let a=`${i}(?:${e.output})${o}`;e&&!0===e.negated&&(a=`^(?!${a}).*$`);const l=c.toRegex(a,t);return!0===s&&(l.state=e),l},c.makeRe=(e,t={},r=!1,s=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let n={negated:!1,fastpaths:!0};return!1===t.fastpaths||"."!==e[0]&&"*"!==e[0]||(n.output=i.fastpaths(e,t)),n.output||(n=i(e,t)),c.compileRe(n,t,r,s)},c.toRegex=(e,t)=>{try{const r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},c.constants=a,e.exports=c},3297:(e,t,r)=>{const s=r(6927),{CHAR_ASTERISK:n,CHAR_AT:i,CHAR_BACKWARD_SLASH:o,CHAR_COMMA:a,CHAR_DOT:c,CHAR_EXCLAMATION_MARK:l,CHAR_FORWARD_SLASH:u,CHAR_LEFT_CURLY_BRACE:p,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:h,CHAR_PLUS:f,CHAR_QUESTION_MARK:g,CHAR_RIGHT_CURLY_BRACE:m,CHAR_RIGHT_PARENTHESES:y,CHAR_RIGHT_SQUARE_BRACKET:b}=r(4751),E=e=>e===u||e===o,w=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};e.exports=(e,t)=>{const r=t||{},A=e.length-1,S=!0===r.parts||!0===r.scanToEnd,R=[],C=[],v=[];let T,O,x=e,k=-1,_=0,L=0,P=!1,I=!1,$=!1,B=!1,F=!1,D=!1,H=!1,M=!1,N=!1,G=!1,U=0,j={value:"",depth:0,isGlob:!1};const K=()=>k>=A,W=()=>(T=O,x.charCodeAt(++k));for(;k<A;){let e;if(O=W(),O!==o){if(!0===D||O===p){for(U++;!0!==K()&&(O=W());)if(O!==o)if(O!==p){if(!0!==D&&O===c&&(O=W())===c){if(P=j.isBrace=!0,$=j.isGlob=!0,G=!0,!0===S)continue;break}if(!0!==D&&O===a){if(P=j.isBrace=!0,$=j.isGlob=!0,G=!0,!0===S)continue;break}if(O===m&&(U--,0===U)){D=!1,P=j.isBrace=!0,G=!0;break}}else U++;else H=j.backslashes=!0,W();if(!0===S)continue;break}if(O!==u){if(!0!==r.noext&&!0==(O===f||O===i||O===n||O===g||O===l)&&x.charCodeAt(k+1)===d){if($=j.isGlob=!0,B=j.isExtglob=!0,G=!0,O===l&&k===_&&(N=!0),!0===S){for(;!0!==K()&&(O=W());)if(O!==o){if(O===y){$=j.isGlob=!0,G=!0;break}}else H=j.backslashes=!0,O=W();continue}break}if(O===n){if(T===n&&(F=j.isGlobstar=!0),$=j.isGlob=!0,G=!0,!0===S)continue;break}if(O===g){if($=j.isGlob=!0,G=!0,!0===S)continue;break}if(O===h){for(;!0!==K()&&(e=W());)if(e!==o){if(e===b){I=j.isBracket=!0,$=j.isGlob=!0,G=!0;break}}else H=j.backslashes=!0,W();if(!0===S)continue;break}if(!0===r.nonegate||O!==l||k!==_){if(!0!==r.noparen&&O===d){if($=j.isGlob=!0,!0===S){for(;!0!==K()&&(O=W());)if(O!==d){if(O===y){G=!0;break}}else H=j.backslashes=!0,O=W();continue}break}if(!0===$){if(G=!0,!0===S)continue;break}}else M=j.negated=!0,_++}else{if(R.push(k),C.push(j),j={value:"",depth:0,isGlob:!1},!0===G)continue;if(T===c&&k===_+1){_+=2;continue}L=k+1}}else H=j.backslashes=!0,O=W(),O===p&&(D=!0)}!0===r.noext&&(B=!1,$=!1);let z=x,Y="",q="";_>0&&(Y=x.slice(0,_),x=x.slice(_),L-=_),z&&!0===$&&L>0?(z=x.slice(0,L),q=x.slice(L)):!0===$?(z="",q=x):z=x,z&&""!==z&&"/"!==z&&z!==x&&E(z.charCodeAt(z.length-1))&&(z=z.slice(0,-1)),!0===r.unescape&&(q&&(q=s.removeBackslashes(q)),z&&!0===H&&(z=s.removeBackslashes(z)));const V={prefix:Y,input:e,start:_,base:z,glob:q,isBrace:P,isBracket:I,isGlob:$,isExtglob:B,isGlobstar:F,negated:M,negatedExtglob:N};if(!0===r.tokens&&(V.maxDepth=0,E(O)||C.push(j),V.tokens=C),!0===r.parts||!0===r.tokens){let t;for(let s=0;s<R.length;s++){const n=t?t+1:_,i=R[s],o=e.slice(n,i);r.tokens&&(0===s&&0!==_?(C[s].isPrefix=!0,C[s].value=Y):C[s].value=o,w(C[s]),V.maxDepth+=C[s].depth),0===s&&""===o||v.push(o),t=i}if(t&&t+1<e.length){const s=e.slice(t+1);v.push(s),r.tokens&&(C[C.length-1].value=s,w(C[C.length-1]),V.maxDepth+=C[C.length-1].depth)}V.slashes=R,V.parts=v}return V}},6927:(e,t,r)=>{const s=r(6928),n="win32"===process.platform,{REGEX_BACKSLASH:i,REGEX_REMOVE_BACKSLASH:o,REGEX_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_GLOBAL:c}=r(4751);t.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),t.hasRegexChars=e=>a.test(e),t.isRegexChar=e=>1===e.length&&t.hasRegexChars(e),t.escapeRegex=e=>e.replace(c,"\\$1"),t.toPosixSlashes=e=>e.replace(i,"/"),t.removeBackslashes=e=>e.replace(o,(e=>"\\"===e?"":e)),t.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);return 3===e.length&&e[0]>=9||8===e[0]&&e[1]>=10},t.isWindows=e=>e&&"boolean"==typeof e.windows?e.windows:!0===n||"\\"===s.sep,t.escapeLast=(e,r,s)=>{const n=e.lastIndexOf(r,s);return-1===n?e:"\\"===e[n-1]?t.escapeLast(e,r,n-1):`${e.slice(0,n)}\\${e.slice(n)}`},t.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r},t.wrapOutput=(e,t={},r={})=>{let s=`${r.contains?"":"^"}(?:${e})${r.contains?"":"$"}`;return!0===t.negated&&(s=`(?:^(?!${s}).*$)`),s}},6454:(e,t,r)=>{String.prototype.startsWith||(String.prototype.startsWith=function(e){return this.substring(0,e.length)===e});var s=r(6179);e.exports=function(e,t,r){var n,i,o;if("function"==typeof t&&(r=t,t=void 0),"function"!=typeof r)return n=s,i=e,o=t,new Promise((function(e,t){n(i,o,(function(r,s){if(r)return t(r);e(s)}))}));s(e,t,r)}},2775:(e,t,r)=>{var s=r(5317).spawn;e.exports=function(e,t,r,n){"function"==typeof r&&(n=r,r=void 0);var i=!1,o=s(e,t,r),a="",c="";o.stdout.on("data",(function(e){a+=e.toString()})),o.stderr.on("data",(function(e){c+=e.toString()})),o.on("error",(function(e){i||(i=!0,n(new Error(e)))})),o.on("close",(function(e){if(!i){if(i=!0,c=function(e){if(e)return(e=(e=e.trim()).replace(/your \d+x\d+ screen size is bogus\. expect trouble/gi,"")).trim()}(c))return n(new Error(c));n(null,a,e)}}))}},4182:(e,t,r)=>{var s=r(857),n={ps:()=>r(433),wmic:()=>r(7868)},i=s.platform();i.startsWith("win")&&(i="win");var o={darwin:"ps",sunos:"ps",freebsd:"ps",netbsd:"ps",win:"wmic",linux:"ps",aix:"ps"}[i];e.exports=function(e){void 0===o&&e(new Error(s.platform()+" is not supported yet, please open an issue (https://github.com/simonepri/pidtree)")),n[o]()(e)}},6179:(e,t,r)=>{var s=r(4182);e.exports=function(e,t,r){"function"==typeof t&&(r=t,t={}),"object"!=typeof t&&(t={}),e=parseInt(e,10),isNaN(e)||e<-1?r(new TypeError("The pid provided is invalid")):s((function(s,n){if(s)r(s);else if(-1!==e){for(var i,o=0;o<n.length;o++){if(n[o][1]===e){i=t.advanced?{ppid:n[o][0],pid:e}:e;break}n[o][0]===e&&(i=t.advanced?{pid:e}:e)}if(i){for(var a={};n.length>0;){var c=n.pop();a[c[0]]?a[c[0]].push(c[1]):a[c[0]]=[c[1]]}for(var l=0,u=[i];l<u.length;){var p=t.advanced?u[l++].pid:u[l++];if(a[p]){for(var d=a[p].length,h=0;h<d;h++)u.push(t.advanced?{ppid:p,pid:a[p][h]}:a[p][h]);delete a[p]}}t.root||u.shift(),r(null,u)}else r(new Error("No matching pid found"))}else{for(var f=0;f<n.length;f++)n[f]=t.advanced?{ppid:n[f][0],pid:n[f][1]}:n[f]=n[f][1];r(null,n)}}))}},433:(e,t,r)=>{var s=r(857),n=r(2775);e.exports=function(e){n("ps",["-A","-o","ppid,pid"],(function(t,r,n){if(t)return e(t);if(0!==n)return e(new Error("pidtree ps command exited with code "+n));try{r=r.split(s.EOL);for(var i=[],o=1;o<r.length;o++)r[o]=r[o].trim(),r[o]&&(r[o]=r[o].split(/\s+/),r[o][0]=parseInt(r[o][0],10),r[o][1]=parseInt(r[o][1],10),i.push(r[o]));e(null,i)}catch(t){e(t)}}))}},7868:(e,t,r)=>{var s=r(857),n=r(2775);e.exports=function(e){n("wmic",["PROCESS","get","ParentProcessId,ProcessId"],{windowsHide:!0,windowsVerbatimArguments:!0},(function(t,r,n){if(t)e(t);else if(0===n)try{r=r.split(s.EOL);for(var i=[],o=1;o<r.length;o++)r[o]=r[o].trim(),r[o]&&(r[o]=r[o].split(/\s+/),r[o][0]=parseInt(r[o][0],10),r[o][1]=parseInt(r[o][1],10),i.push(r[o]));e(null,i)}catch(t){e(t)}else e(new Error("pidtree wmic command exited with code "+n))}))}},9018:e=>{function t(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}e.exports=function(e){if((e=e||{}).circles)return function(e){const r=[],s=[],n=new Map;if(n.set(Date,(e=>new Date(e))),n.set(Map,((e,t)=>new Map(o(Array.from(e),t)))),n.set(Set,((e,t)=>new Set(o(Array.from(e),t)))),e.constructorHandlers)for(const t of e.constructorHandlers)n.set(t[0],t[1]);let i=null;return e.proto?function e(a){if("object"!=typeof a||null===a)return a;if(Array.isArray(a))return o(a,e);if(a.constructor!==Object&&(i=n.get(a.constructor)))return i(a,e);const c={};r.push(a),s.push(c);for(const o in a){const l=a[o];if("object"!=typeof l||null===l)c[o]=l;else if(l.constructor!==Object&&(i=n.get(l.constructor)))c[o]=i(l,e);else if(ArrayBuffer.isView(l))c[o]=t(l);else{const t=r.indexOf(l);c[o]=-1!==t?s[t]:e(l)}}return r.pop(),s.pop(),c}:function e(a){if("object"!=typeof a||null===a)return a;if(Array.isArray(a))return o(a,e);if(a.constructor!==Object&&(i=n.get(a.constructor)))return i(a,e);const c={};r.push(a),s.push(c);for(const o in a){if(!1===Object.hasOwnProperty.call(a,o))continue;const l=a[o];if("object"!=typeof l||null===l)c[o]=l;else if(l.constructor!==Object&&(i=n.get(l.constructor)))c[o]=i(l,e);else if(ArrayBuffer.isView(l))c[o]=t(l);else{const t=r.indexOf(l);c[o]=-1!==t?s[t]:e(l)}}return r.pop(),s.pop(),c};function o(e,o){const a=Object.keys(e),c=new Array(a.length);for(let l=0;l<a.length;l++){const u=a[l],p=e[u];if("object"!=typeof p||null===p)c[u]=p;else if(p.constructor!==Object&&(i=n.get(p.constructor)))c[u]=i(p,o);else if(ArrayBuffer.isView(p))c[u]=t(p);else{const e=r.indexOf(p);c[u]=-1!==e?s[e]:o(p)}}return c}}(e);const r=new Map;if(r.set(Date,(e=>new Date(e))),r.set(Map,((e,t)=>new Map(n(Array.from(e),t)))),r.set(Set,((e,t)=>new Set(n(Array.from(e),t)))),e.constructorHandlers)for(const t of e.constructorHandlers)r.set(t[0],t[1]);let s=null;return e.proto?function e(i){if("object"!=typeof i||null===i)return i;if(Array.isArray(i))return n(i,e);if(i.constructor!==Object&&(s=r.get(i.constructor)))return s(i,e);const o={};for(const n in i){const a=i[n];"object"!=typeof a||null===a?o[n]=a:a.constructor!==Object&&(s=r.get(a.constructor))?o[n]=s(a,e):ArrayBuffer.isView(a)?o[n]=t(a):o[n]=e(a)}return o}:function e(i){if("object"!=typeof i||null===i)return i;if(Array.isArray(i))return n(i,e);if(i.constructor!==Object&&(s=r.get(i.constructor)))return s(i,e);const o={};for(const n in i){if(!1===Object.hasOwnProperty.call(i,n))continue;const a=i[n];"object"!=typeof a||null===a?o[n]=a:a.constructor!==Object&&(s=r.get(a.constructor))?o[n]=s(a,e):ArrayBuffer.isView(a)?o[n]=t(a):o[n]=e(a)}return o};function n(e,n){const i=Object.keys(e),o=new Array(i.length);for(let a=0;a<i.length;a++){const c=i[a],l=e[c];"object"!=typeof l||null===l?o[c]=l:l.constructor!==Object&&(s=r.get(l.constructor))?o[c]=s(l,n):ArrayBuffer.isView(l)?o[c]=t(l):o[c]=n(l)}return o}}},600:(e,t,r)=>{const s=r(7257);e.exports=(e="")=>{const t=e.match(s);if(!t)return null;const[r,n]=t[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return"env"===i?n:n?`${i} ${n}`:i}},7257:e=>{e.exports=/^#!(.*)/},1754:(e,t,r)=>{const s=r(857),n=r(4891),i=process.env;let o;function a(e){const t=function(e){if(!1===o)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(e&&!e.isTTY&&!0!==o)return 0;const t=o?1:0;if("win32"===process.platform){const e=s.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in i)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in i))||"codeship"===i.CI_NAME?1:t;if("TEAMCITY_VERSION"in i)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(i.TEAMCITY_VERSION)?1:0;if("truecolor"===i.COLORTERM)return 3;if("TERM_PROGRAM"in i){const e=parseInt((i.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(i.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(i.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(i.TERM)||"COLORTERM"in i?1:(i.TERM,t)}(e);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(t)}n("no-color")||n("no-colors")||n("color=false")?o=!1:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(o=!0),"FORCE_COLOR"in i&&(o=0===i.FORCE_COLOR.length||0!==parseInt(i.FORCE_COLOR,10)),e.exports={supportsColor:a,stdout:a(process.stdout),stderr:a(process.stderr)}},4710:(e,t,r)=>{const s=r(9789),n=(e,t,r)=>{if(!1===s(e))throw new TypeError("toRegexRange: expected the first argument to be a number");if(void 0===t||e===t)return String(e);if(!1===s(t))throw new TypeError("toRegexRange: expected the second argument to be a number.");let i={relaxZeros:!0,...r};"boolean"==typeof i.strictZeros&&(i.relaxZeros=!1===i.strictZeros);let c=e+":"+t+"="+String(i.relaxZeros)+String(i.shorthand)+String(i.capture)+String(i.wrap);if(n.cache.hasOwnProperty(c))return n.cache[c].result;let l=Math.min(e,t),u=Math.max(e,t);if(1===Math.abs(l-u)){let r=e+"|"+t;return i.capture?`(${r})`:!1===i.wrap?r:`(?:${r})`}let p=h(e)||h(t),d={min:e,max:t,a:l,b:u},f=[],g=[];return p&&(d.isPadded=p,d.maxLen=String(d.max).length),l<0&&(g=o(u<0?Math.abs(u):1,Math.abs(l),d,i),l=d.a=0),u>=0&&(f=o(l,u,d,i)),d.negatives=g,d.positives=f,d.result=function(e,t){let r=a(e,t,"-",!1)||[],s=a(t,e,"",!1)||[],n=a(e,t,"-?",!0)||[];return r.concat(n).concat(s).join("|")}(g,f),!0===i.capture?d.result=`(${d.result})`:!1!==i.wrap&&f.length+g.length>1&&(d.result=`(?:${d.result})`),n.cache[c]=d,d.result};function i(e,t,r){if(e===t)return{pattern:e,count:[],digits:0};let s=function(e,t){let r=[];for(let s=0;s<e.length;s++)r.push([e[s],t[s]]);return r}(e,t),n=s.length,i="",o=0;for(let e=0;e<n;e++){let[t,r]=s[e];t===r?i+=t:"0"!==t||"9"!==r?i+=`[${a=t}${(c=r)-a==1?"":"-"}${c}]`:o++}var a,c;return o&&(i+=!0===r.shorthand?"\\d":"[0-9]"),{pattern:i,count:[o],digits:n}}function o(e,t,r,s){let n,o=function(e,t){let r=1,s=1,n=u(e,r),i=new Set([t]);for(;e<=n&&n<=t;)i.add(n),r+=1,n=u(e,r);for(n=p(t+1,s)-1;e<n&&n<=t;)i.add(n),s+=1,n=p(t+1,s)-1;return i=[...i],i.sort(c),i}(e,t),a=[],l=e;for(let e=0;e<o.length;e++){let t=o[e],c=i(String(l),String(t),s),u="";r.isPadded||!n||n.pattern!==c.pattern?(r.isPadded&&(u=f(t,r,s)),c.string=u+c.pattern+d(c.count),a.push(c),l=t+1,n=c):(n.count.length>1&&n.count.pop(),n.count.push(c.count[0]),n.string=n.pattern+d(n.count),l=t+1)}return a}function a(e,t,r,s,n){let i=[];for(let n of e){let{string:e}=n;s||l(t,"string",e)||i.push(r+e),s&&l(t,"string",e)&&i.push(r+e)}return i}function c(e,t){return e>t?1:t>e?-1:0}function l(e,t,r){return e.some((e=>e[t]===r))}function u(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function p(e,t){return e-e%Math.pow(10,t)}function d(e){let[t=0,r=""]=e;return r||t>1?`{${t+(r?","+r:"")}}`:""}function h(e){return/^-?(0+)\d/.test(e)}function f(e,t,r){if(!t.isPadded)return e;let s=Math.abs(t.maxLen-String(e).length),n=!1!==r.relaxZeros;switch(s){case 0:return"";case 1:return n?"0?":"0";case 2:return n?"0{0,2}":"00";default:return n?`0{0,${s}}`:`0{${s}}`}}n.cache={},n.clearCache=()=>n.cache={},e.exports=n},1905:(e,t,r)=>{const s="win32"===process.platform||"cygwin"===process.env.OSTYPE||"msys"===process.env.OSTYPE,n=r(6928),i=s?";":":",o=r(9344),a=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),c=(e,t)=>{const r=t.colon||i,n=e.match(/\//)||s&&e.match(/\\/)?[""]:[...s?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],o=s?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",a=s?o.split(r):[""];return s&&-1!==e.indexOf(".")&&""!==a[0]&&a.unshift(""),{pathEnv:n,pathExt:a,pathExtExe:o}},l=(e,t,r)=>{"function"==typeof t&&(r=t,t={}),t||(t={});const{pathEnv:s,pathExt:i,pathExtExe:l}=c(e,t),u=[],p=r=>new Promise(((i,o)=>{if(r===s.length)return t.all&&u.length?i(u):o(a(e));const c=s[r],l=/^".*"$/.test(c)?c.slice(1,-1):c,p=n.join(l,e),h=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+p:p;i(d(h,r,0))})),d=(e,r,s)=>new Promise(((n,a)=>{if(s===i.length)return n(p(r+1));const c=i[s];o(e+c,{pathExt:l},((i,o)=>{if(!i&&o){if(!t.all)return n(e+c);u.push(e+c)}return n(d(e,r,s+1))}))}));return r?p(0).then((e=>r(null,e)),r):p(0)};e.exports=l,l.sync=(e,t)=>{t=t||{};const{pathEnv:r,pathExt:s,pathExtExe:i}=c(e,t),l=[];for(let a=0;a<r.length;a++){const c=r[a],u=/^".*"$/.test(c)?c.slice(1,-1):c,p=n.join(u,e),d=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+p:p;for(let e=0;e<s.length;e++){const r=d+s[e];try{if(o.sync(r,{pathExt:i})){if(!t.all)return r;l.push(r)}}catch(e){}}}if(t.all&&l.length)return l;if(t.nothrow)return null;throw a(e)}},9340:(e,t,r)=>{r.d(t,{default:()=>Dn});var s=r(8894),n=r(4573),i=r(6760),o=r(1421),a=r(1708),c=r(526),l=r(3136),u=r(7235);const p=({env:e=a.env,...t}={})=>{e={...e};const r=(0,u.A)({env:e});return t.path=e[r],e[r]=(({cwd:e=a.cwd(),path:t=a.env[(0,u.A)()],preferLocal:r=!0,execPath:s=a.execPath,addExecPath:n=!0}={})=>{const o=e instanceof URL?(0,l.fileURLToPath)(e):e,c=i.resolve(o),p=[];return r&&((e,t)=>{let r;for(;r!==t;)e.push(i.join(t,"node_modules/.bin")),r=t,t=i.resolve(t,"..")})(p,c),n&&((e,t,r)=>{const s=t instanceof URL?(0,l.fileURLToPath)(t):t;e.push(i.resolve(r,s,".."))})(p,s,c),[...p,t].join(i.delimiter)})(t),e},d=(e,t,r,s)=>{if("length"===r||"prototype"===r)return;if("arguments"===r||"caller"===r)return;const n=Object.getOwnPropertyDescriptor(e,r),i=Object.getOwnPropertyDescriptor(t,r);!h(n,i)&&s||Object.defineProperty(e,r,i)},h=function(e,t){return void 0===e||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},f=(e,t)=>`/* Wrapped ${e}*/\n${t}`,g=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),m=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");const y=new WeakMap,b=(e,t={})=>{if("function"!=typeof e)throw new TypeError("Expected a function");let r,s=0;const n=e.displayName||e.name||"<anonymous>",i=function(...o){if(y.set(i,++s),1===s)r=e.apply(this,o),e=null;else if(!0===t.throw)throw new Error(`Function \`${n}\` can only be called once`);return r};return function(e,t,{ignoreNonConfigurable:r=!1}={}){const{name:s}=e;for(const s of Reflect.ownKeys(t))d(e,t,s,r);((e,t)=>{const r=Object.getPrototypeOf(t);r!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,r)})(e,t),((e,t,r)=>{const s=""===r?"":`with ${r.trim()}() `,n=f.bind(null,s,t.toString());Object.defineProperty(n,"name",m),Object.defineProperty(e,"toString",{...g,value:n})})(e,t,s)}(i,e),y.set(i,s),i};b.callCount=e=>{if(!y.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return y.get(e)};const E=b;var w=r(8161);const A=(e,t)=>({name:`SIGRT${t+1}`,number:S+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),S=34,R=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}],C=()=>{const e=(()=>{const e=64-S+1;return Array.from({length:e},A)})();return[...R,...e].map(v)},v=({name:e,number:t,description:r,action:s,forced:n=!1,standard:i})=>{const{signals:{[e]:o}}=w.constants,a=void 0!==o;return{name:e,number:a?o:t,description:r,supported:a,action:s,forced:n,standard:i}},T=({name:e,number:t,description:r,supported:s,action:n,forced:i,standard:o})=>[e,{name:e,number:t,description:r,supported:s,action:n,forced:i,standard:o}],O=(()=>{const e=C();return Object.fromEntries(e.map(T))})(),x=(e,t)=>{const r=t.find((({name:t})=>w.constants.signals[t]===e));return void 0!==r?r:t.find((t=>t.number===e))},k=((()=>{const e=C(),t=Array.from({length:65},((t,r)=>((e,t)=>{const r=x(e,t);if(void 0===r)return{};const{name:s,description:n,supported:i,action:o,forced:a,standard:c}=r;return{[e]:{name:s,number:e,description:n,supported:i,action:o,forced:a,standard:c}}})(r,e)));Object.assign({},...t)})(),({stdout:e,stderr:t,all:r,error:s,signal:n,exitCode:i,command:o,escapedCommand:c,timedOut:l,isCanceled:u,killed:p,parsed:{options:{timeout:d,cwd:h=a.cwd()}}})=>{i=null===i?void 0:i;const f=void 0===(n=null===n?void 0:n)?void 0:O[n].description,g=(({timedOut:e,timeout:t,errorCode:r,signal:s,signalDescription:n,exitCode:i,isCanceled:o})=>e?`timed out after ${t} milliseconds`:o?"was canceled":void 0!==r?`failed with ${r}`:void 0!==s?`was killed with ${s} (${n})`:void 0!==i?`failed with exit code ${i}`:"failed")({timedOut:l,timeout:d,errorCode:s&&s.code,signal:n,signalDescription:f,exitCode:i,isCanceled:u}),m=`Command ${g}: ${o}`,y="[object Error]"===Object.prototype.toString.call(s),b=y?`${m}\n${s.message}`:m,E=[b,t,e].filter(Boolean).join("\n");return y?(s.originalMessage=s.message,s.message=E):s=new Error(E),s.shortMessage=b,s.command=o,s.escapedCommand=c,s.exitCode=i,s.signal=n,s.signalDescription=f,s.stdout=e,s.stderr=t,s.cwd=h,void 0!==r&&(s.all=r),"bufferedData"in s&&delete s.bufferedData,s.failed=!0,s.timedOut=Boolean(l),s.isCanceled=u,s.killed=p&&!l,s}),_=["stdin","stdout","stderr"];var L=r(7017);const P=(e,t="SIGTERM",r={})=>{const s=e(t);return I(e,t,r,s),s},I=(e,t,r,s)=>{if(!$(t,r,s))return;const n=F(r),i=setTimeout((()=>{e("SIGKILL")}),n);i.unref&&i.unref()},$=(e,{forceKillAfterTimeout:t},r)=>B(e)&&!1!==t&&r,B=e=>e===w.constants.signals.SIGTERM||"string"==typeof e&&"SIGTERM"===e.toUpperCase(),F=({forceKillAfterTimeout:e=!0})=>{if(!0===e)return 5e3;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},D=(e,t)=>{e.kill()&&(t.isCanceled=!0)};var H=r(3024);function M(e){return null!==e&&"object"==typeof e&&"function"==typeof e.pipe}function N(e){return M(e)&&!1!==e.writable&&"function"==typeof e._write&&"object"==typeof e._writableState}const G=(e,t,r)=>{if("string"==typeof r)return e[t].pipe((0,H.createWriteStream)(r)),e;if(N(r))return e[t].pipe(r),e;if(!(e=>e instanceof o.ChildProcess&&"function"==typeof e.then)(r))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!N(r.stdin))throw new TypeError("The target child process's stdin must be available.");return e[t].pipe(r.stdin),r};var U=r(8500);const j=async(e,{init:t,convertChunk:r,getSize:s,truncateChunk:n,addChunk:i,getFinalChunk:o,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{if(!Y(e))throw new Error("The first argument must be a Readable, a ReadableStream, or an async iterable.");const l=t();l.length=0;try{for await(const t of e){const e=r[q(t)](t,l);W({convertedChunk:e,state:l,getSize:s,truncateChunk:n,addChunk:i,maxBuffer:c})}return K({state:l,convertChunk:r,getSize:s,truncateChunk:n,addChunk:i,getFinalChunk:o,maxBuffer:c}),a(l)}catch(e){throw e.bufferedData=a(l),e}},K=({state:e,getSize:t,truncateChunk:r,addChunk:s,getFinalChunk:n,maxBuffer:i})=>{const o=n(e);void 0!==o&&W({convertedChunk:o,state:e,getSize:t,truncateChunk:r,addChunk:s,maxBuffer:i})},W=({convertedChunk:e,state:t,getSize:r,truncateChunk:s,addChunk:n,maxBuffer:i})=>{const o=r(e),a=t.length+o;if(a<=i)return void z(e,t,n,a);const c=s(e,i-t.length);throw void 0!==c&&z(c,t,n,i),new X},z=(e,t,r,s)=>{t.contents=r(e,t,s),t.length=s},Y=e=>"object"==typeof e&&null!==e&&"function"==typeof e[Symbol.asyncIterator],q=e=>{const t=typeof e;if("string"===t)return"string";if("object"!==t||null===e)return"others";if(globalThis.Buffer?.isBuffer(e))return"buffer";const r=V.call(e);return"[object ArrayBuffer]"===r?"arrayBuffer":"[object DataView]"===r?"dataView":Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&"[object ArrayBuffer]"===V.call(e.buffer)?"typedArray":"others"},{toString:V}=Object.prototype;class X extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}const Q=e=>{throw new Error(`Streams in object mode are not supported: ${String(e)}`)},Z=e=>e.length,J=new TextEncoder,ee=e=>new Uint8Array(e),te=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),re=e=>se**Math.ceil(Math.log(e)/Math.log(se)),se=2,ne=()=>"resize"in ArrayBuffer.prototype,ie={init:()=>({contents:new ArrayBuffer(0)}),convertChunk:{string:e=>J.encode(e),buffer:ee,arrayBuffer:ee,dataView:te,typedArray:te,others:Q},getSize:Z,truncateChunk:(e,t)=>e.slice(0,t),addChunk:(e,{contents:t,length:r},s)=>{const n=ne()?((e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;const r=new ArrayBuffer(t,{maxByteLength:re(t)});return new Uint8Array(r).set(new Uint8Array(e),0),r})(t,s):((e,t)=>{if(t<=e.byteLength)return e;const r=new ArrayBuffer(re(t));return new Uint8Array(r).set(new Uint8Array(e),0),r})(t,s);return new Uint8Array(n).set(e,r),n},getFinalChunk:()=>{},finalize:({contents:e,length:t})=>ne()?e:e.slice(0,t)};async function oe(e,t){if(!("Buffer"in globalThis))throw new Error("getStreamAsBuffer() is only supported in Node.js");try{return ae(await async function(e,t){return j(e,ie,t)}(e,t))}catch(e){throw void 0!==e.bufferedData&&(e.bufferedData=ae(e.bufferedData)),e}}const ae=e=>globalThis.Buffer.from(e),ce=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),le={init:()=>({contents:"",textDecoder:new TextDecoder}),convertChunk:{string:e=>e,buffer:ce,arrayBuffer:ce,dataView:ce,typedArray:ce,others:Q},getSize:Z,truncateChunk:(e,t)=>e.slice(0,t),addChunk:(e,{contents:t})=>t+e,getFinalChunk:({textDecoder:e})=>{const t=e.decode();return""===t?void 0:t},finalize:({contents:e})=>e};var ue=r(1404);const pe=e=>{if(void 0!==e)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},de=async(e,t)=>{if(e&&void 0!==t){await(0,U.setTimeout)(0),e.destroy();try{return await t}catch(e){return e.bufferedData}}},he=(e,{encoding:t,buffer:r,maxBuffer:s})=>{if(e&&r)return"utf8"===t||"utf-8"===t?async function(e,t){return j(e,le,t)}(e,{maxBuffer:s}):null===t||"buffer"===t?oe(e,{maxBuffer:s}):fe(e,s,t)},fe=async(e,t,r)=>(await oe(e,{maxBuffer:t})).toString(r),ge=(async()=>{})().constructor.prototype,me=["then","catch","finally"].map((e=>[e,Reflect.getOwnPropertyDescriptor(ge,e)])),ye=(e,t)=>{for(const[r,s]of me){const n="function"==typeof t?(...e)=>Reflect.apply(s.value,t(),e):s.value.bind(t);Reflect.defineProperty(e,r,{...s,value:n})}},be=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],Ee=/^[\w.-]+$/,we=(e,t)=>be(e,t).join(" "),Ae=(e,t)=>be(e,t).map((e=>(e=>"string"!=typeof e||Ee.test(e)?e:`"${e.replaceAll('"','\\"')}"`)(e))).join(" "),Se=/ +/g,Re=e=>{const t=typeof e;if("string"===t)return e;if("number"===t)return String(e);if("object"===t&&null!==e&&!(e instanceof o.ChildProcess)&&"stdout"in e){const t=typeof e.stdout;if("string"===t)return e.stdout;if(n.Buffer.isBuffer(e.stdout))return e.stdout.toString();throw new TypeError(`Unexpected "${t}" stdout in template expression`)}throw new TypeError(`Unexpected "${t}" in template expression`)},Ce=(e,t,r)=>r||0===e.length||0===t.length?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],ve=({templates:e,expressions:t,tokens:r,index:s,template:n})=>{const i=n??e.raw[s],o=i.split(Se).filter(Boolean),a=Ce(r,o,i.startsWith(" "));if(s===t.length)return a;const c=t[s],l=Array.isArray(c)?c.map((e=>Re(e))):[Re(c)];return Ce(a,l,i.endsWith(" "))},Te=(e,t)=>{let r=[];for(const[s,n]of e.entries())r=ve({templates:e,expressions:t,tokens:r,index:s,template:n});return r};var Oe=r(7975);const xe=(0,Oe.debuglog)("execa").enabled,ke=(e,t)=>String(e).padStart(t,"0"),_e=(e,{verbose:t})=>{t&&a.stderr.write(`[${(()=>{const e=new Date;return`${ke(e.getHours(),2)}:${ke(e.getMinutes(),2)}:${ke(e.getSeconds(),2)}.${ke(e.getMilliseconds(),3)}`})()}] ${e}\n`)},Le=(e,t,r={})=>{const s=c._parse(e,t,r);return e=s.command,t=s.args,(r={maxBuffer:1e8,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:(r=s.options).cwd||a.cwd(),execPath:a.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:xe,...r}).env=(({env:e,extendEnv:t,preferLocal:r,localDir:s,execPath:n})=>{const i=t?{...a.env,...e}:e;return r?p({env:i,cwd:s,execPath:n}):i})(r),r.stdio=(e=>{if(!e)return;const{stdio:t}=e;if(void 0===t)return _.map((t=>e[t]));if((e=>_.some((t=>void 0!==e[t])))(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${_.map((e=>`\`${e}\``)).join(", ")}`);if("string"==typeof t)return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);const r=Math.max(t.length,_.length);return Array.from({length:r},((e,r)=>t[r]))})(r),"win32"===a.platform&&"cmd"===i.basename(e,".exe")&&t.unshift("/q"),{file:e,args:t,options:r,parsed:s}},Pe=(e,t,r)=>"string"==typeof t||n.Buffer.isBuffer(t)?e.stripFinalNewline?function(e){const t="string"==typeof e?"\n":"\n".charCodeAt(),r="string"==typeof e?"\r":"\r".charCodeAt();return e[e.length-1]===t&&(e=e.slice(0,-1)),e[e.length-1]===r&&(e=e.slice(0,-1)),e}(t):t:void 0===r?void 0:"";function Ie(e,t,r){const s=Le(e,t,r),n=we(e,t),i=Ae(e,t);let a;_e(i,s.options),(({timeout:e})=>{if(void 0!==e&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)})(s.options);try{a=o.spawn(s.file,s.args,s.options)}catch(e){const t=new o.ChildProcess,r=Promise.reject(k({error:e,stdout:"",stderr:"",all:"",command:n,escapedCommand:i,parsed:s,timedOut:!1,isCanceled:!1,killed:!1}));return ye(t,r),t}const c=(e=>new Promise(((t,r)=>{e.on("exit",((e,r)=>{t({exitCode:e,signal:r})})),e.on("error",(e=>{r(e)})),e.stdin&&e.stdin.on("error",(e=>{r(e)}))})))(a),l=((e,{timeout:t,killSignal:r="SIGTERM"},s)=>{if(0===t||void 0===t)return s;let n;const i=new Promise(((s,i)=>{n=setTimeout((()=>{((e,t,r)=>{e.kill(t),r(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))})(e,r,i)}),t)})),o=s.finally((()=>{clearTimeout(n)}));return Promise.race([i,o])})(a,s.options,c),u=(async(e,{cleanup:t,detached:r},s)=>{if(!t||r)return s;const n=(0,L.cf)((()=>{e.kill()}));return s.finally((()=>{n()}))})(a,s.options,l),p={isCanceled:!1};a.kill=P.bind(null,a.kill.bind(a)),a.cancel=D.bind(null,a,p);const d=E((async()=>{const[{error:e,exitCode:t,signal:r,timedOut:o},c,l,d]=await(async({stdout:e,stderr:t,all:r},{encoding:s,buffer:n,maxBuffer:i},o)=>{const a=he(e,{encoding:s,buffer:n,maxBuffer:i}),c=he(t,{encoding:s,buffer:n,maxBuffer:i}),l=he(r,{encoding:s,buffer:n,maxBuffer:2*i});try{return await Promise.all([o,a,c,l])}catch(s){return Promise.all([{error:s,signal:s.signal,timedOut:s.timedOut},de(e,a),de(t,c),de(r,l)])}})(a,s.options,u),h=Pe(s.options,c),f=Pe(s.options,l),g=Pe(s.options,d);if(e||0!==t||null!==r){const c=k({error:e,exitCode:t,signal:r,stdout:h,stderr:f,all:g,command:n,escapedCommand:i,parsed:s,timedOut:o,isCanceled:p.isCanceled||!!s.options.signal&&s.options.signal.aborted,killed:a.killed});if(!s.options.reject)return c;throw c}return{command:n,escapedCommand:i,exitCode:0,stdout:h,stderr:f,all:g,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}));return((e,t)=>{const r=(({input:e,inputFile:t})=>"string"!=typeof t?e:(pe(e),(0,H.createReadStream)(t)))(t);void 0!==r&&(M(r)?r.pipe(e.stdin):e.stdin.end(r))})(a,s.options),a.all=((e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;const r=ue();return e.stdout&&r.add(e.stdout),e.stderr&&r.add(e.stderr),r})(a,s.options),(e=>{null!==e.stdout&&(e.pipeStdout=G.bind(void 0,e,"stdout")),null!==e.stderr&&(e.pipeStderr=G.bind(void 0,e,"stderr")),void 0!==e.all&&(e.pipeAll=G.bind(void 0,e,"all"))})(a),ye(a,d),a}function $e(e,t,r){const s=Le(e,t,r),n=we(e,t),i=Ae(e,t);_e(i,s.options);const a=(e=>{const t=(({input:e,inputFile:t})=>"string"!=typeof t?e:(pe(e),(0,H.readFileSync)(t)))(e);if(M(t))throw new TypeError("The `input` option cannot be a stream in sync mode");return t})(s.options);let c;try{c=o.spawnSync(s.file,s.args,{...s.options,input:a})}catch(e){throw k({error:e,stdout:"",stderr:"",all:"",command:n,escapedCommand:i,parsed:s,timedOut:!1,isCanceled:!1,killed:!1})}const l=Pe(s.options,c.stdout,c.error),u=Pe(s.options,c.stderr,c.error);if(c.error||0!==c.status||null!==c.signal){const e=k({stdout:l,stderr:u,error:c.error,signal:c.signal,exitCode:c.status,command:n,escapedCommand:i,parsed:s,timedOut:c.error&&"ETIMEDOUT"===c.error.code,isCanceled:!1,killed:null!==c.signal});if(!s.options.reject)return e;throw e}return{command:n,escapedCommand:i,exitCode:0,stdout:l,stderr:u,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}const Be=({input:e,inputFile:t,stdio:r})=>void 0===e&&void 0===t&&void 0===r?{stdin:"inherit"}:{},Fe=(e={})=>({preferLocal:!0,...Be(e),...e});!function e(t){function r(r,...s){if(!Array.isArray(r))return e({...t,...r});const[n,...i]=Te(r,s);return Ie(n,i,Fe(t))}return r.sync=(e,...r)=>{if(!Array.isArray(e))throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");const[s,...n]=Te(e,r);return $e(s,n,Fe(t))},r}();const De=s("lint-staged:execGit"),He=["-c","submodule.recurse=false"],Me=async(e,t={})=>{De("Running git command",e);try{const{stdout:r}=await Ie("git",He.concat(e),{...t,all:!0,cwd:t.cwd||process.cwd(),stdin:"ignore"});return r}catch({all:e}){throw new Error(e)}};var Ne=r(5441);const Ge=r(6296);var Ue=r(2018),je=r.t(Ue,2);const{env:Ke={},argv:We=[],platform:ze=""}="undefined"==typeof process?{}:process,Ye="NO_COLOR"in Ke||We.includes("--no-color"),qe="FORCE_COLOR"in Ke||We.includes("--color"),Ve="win32"===ze,Xe="dumb"===Ke.TERM,Qe=je&&Ue.isatty&&Ue.isatty(1)&&Ke.TERM&&!Xe,Ze=!Ye&&(qe||Ve&&!Xe||Qe||"CI"in Ke&&("GITHUB_ACTIONS"in Ke||"GITLAB_CI"in Ke||"CIRCLECI"in Ke)),Je=(e,t,r,s,n=t.substring(0,e)+s,i=t.substring(e+r.length),o=i.indexOf(r))=>n+(o<0?i:Je(o,i,r,s)),et=(e,t,r)=>((e,t,r=e,s=e.length+1)=>n=>n||""!==n&&void 0!==n?((e,t,r,s,n)=>e<0?r+t+s:r+Je(e,t,s,n)+s)((""+n).indexOf(t,s),n,e,t,r):"")(`\x1b[${e}m`,`\x1b[${t}m`,r),tt={reset:et(0,0),bold:et(1,22,"\x1b[22m\x1b[1m"),dim:et(2,22,"\x1b[22m\x1b[2m"),italic:et(3,23),underline:et(4,24),inverse:et(7,27),hidden:et(8,28),strikethrough:et(9,29),black:et(30,39),red:et(31,39),green:et(32,39),yellow:et(33,39),blue:et(34,39),magenta:et(35,39),cyan:et(36,39),white:et(37,39),gray:et(90,39),bgBlack:et(40,49),bgRed:et(41,49),bgGreen:et(42,49),bgYellow:et(43,49),bgBlue:et(44,49),bgMagenta:et(45,49),bgCyan:et(46,49),bgWhite:et(47,49),blackBright:et(90,39),redBright:et(91,39),greenBright:et(92,39),yellowBright:et(93,39),blueBright:et(94,39),magentaBright:et(95,39),cyanBright:et(96,39),whiteBright:et(97,39),bgBlackBright:et(100,49),bgRedBright:et(101,49),bgGreenBright:et(102,49),bgYellowBright:et(103,49),bgBlueBright:et(104,49),bgMagentaBright:et(105,49),bgCyanBright:et(106,49),bgWhiteBright:et(107,49)},rt=({useColor:e=Ze}={})=>e?tt:Object.keys(tt).reduce(((e,t)=>({...e,[t]:String})),{}),{reset:st,bold:nt,dim:it,italic:ot,underline:at,inverse:ct,hidden:lt,strikethrough:ut,black:pt,red:dt,green:ht,yellow:ft,blue:gt,magenta:mt,cyan:yt,white:bt,gray:Et,bgBlack:wt,bgRed:At,bgGreen:St,bgYellow:Rt,bgBlue:Ct,bgMagenta:vt,bgCyan:Tt,bgWhite:Ot,blackBright:xt,redBright:kt,greenBright:_t,yellowBright:Lt,blueBright:Pt,magentaBright:It,cyanBright:$t,whiteBright:Bt,bgBlackBright:Ft,bgRedBright:Dt,bgGreenBright:Ht,bgYellowBright:Mt,bgBlueBright:Nt,bgMagentaBright:Gt,bgCyanBright:Ut,bgWhiteBright:jt}=rt();var Kt=r(9023),Wt=r(857),zt=r(3193),Yt=r(2203),qt=r(9018),Vt=r(6982),Xt=Object.defineProperty,Qt=(e,t)=>Xt(e,"name",{value:t,configurable:!0}),Zt="\x1b[?25l",Jt="\x1b[?25h",er=(e=>(e.WAITING="WAITING",e.STARTED="STARTED",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e.SKIPPED="SKIPPED",e.ROLLING_BACK="ROLLING_BACK",e.ROLLED_BACK="ROLLED_BACK",e.RETRY="RETRY",e.PAUSED="PAUSED",e.PROMPT="PROMPT",e.PROMPT_COMPLETED="PROMPT_COMPLETED",e.PROMPT_FAILED="PROMPT_FAILED",e))(er||{}),tr=class{static{Qt(this,"EventManager")}emitter=new Ge;emit(e,t){this.emitter.emit(e,t)}on(e,t){this.emitter.addListener(e,t)}once(e,t){this.emitter.once(e,t)}off(e,t){this.emitter.off(e,t)}complete(){this.emitter.removeAllListeners()}};function rr(e){return!!e&&"object"==typeof e&&"function"==typeof e.lift&&"function"==typeof e.subscribe}function sr(e){return!!e&&"object"==typeof e&&!0===e.readable&&"function"==typeof e.read&&"function"==typeof e.on}function nr(){return!!process.env.LISTR_FORCE_UNICODE||"win32"!==process.platform||!!process.env.CI||!!process.env.WT_SESSION||"vscode"===process.env.TERM_PROGRAM||"xterm-256color"===process.env.TERM||"alacritty"===process.env.TERM}(class{static{Qt(this,"BaseEventMap")}}),Qt(rr,"isObservable"),Qt(sr,"isReadable"),Qt(nr,"isUnicodeSupported");var ir=/\u0007/;function or(e){return String(e).replace(new RegExp("(?:\\u001b|\\u009b)\\[[\\=><~/#&.:=?%@~_-]*[0-9]*[\\a-ln-tqyz=><~/#&.:=?%@~_-]+","gmi"),"").replace(new RegExp(ir,"gmi"),"").trim()}Qt(or,"cleanseAnsi");var ar=rt();function cr(e,t){return e.replace(/^(?!\s*$)/gm," ".repeat(t))}Qt(cr,"indent");var lr={warning:"\u26a0",cross:"\u2716",arrowDown:"\u2193",tick:"\u2714",arrowRight:"\u2192",pointer:"\u276f",checkboxOn:"\u2612",arrowLeft:"\u2190",squareSmallFilled:"\u25fc",pointerSmall:"\u203a"},ur={...lr,warning:"\u203c",cross:"\xd7",tick:"\u221a",pointer:">",checkboxOn:"[\xd7]",squareSmallFilled:"\u25a0"},pr=nr()?lr:ur;function dr(e,...t){return(0,Kt.format)(String(e),...t)}Qt(dr,"splat");var hr={STARTED:pr.pointer,FAILED:pr.cross,SKIPPED:pr.arrowDown,COMPLETED:pr.tick,OUTPUT:pr.pointerSmall,TITLE:pr.arrowRight,RETRY:pr.warning,ROLLBACK:pr.arrowLeft,PAUSED:pr.squareSmallFilled},fr={STARTED:ar.yellow,FAILED:ar.red,SKIPPED:ar.yellow,COMPLETED:ar.green,RETRY:ar.yellowBright,ROLLBACK:ar.redBright,PAUSED:ar.yellowBright},gr=["RETRY","ROLLBACK","FAILED"],mr=class{constructor(e){this.options=e,this.options={useIcons:!0,toStderr:[],...e??{}},this.options.fields??={},this.options.fields.prefix??=[],this.options.fields.suffix??=[],this.process=this.options.processOutput??new Er}static{Qt(this,"ListrLogger")}process;log(e,t,r){const s=this.format(e,t,r);this.options.toStderr.includes(e)?this.process.toStderr(s):this.process.toStdout(s)}toStdout(e,t,r=!0){this.process.toStdout(this.format(null,e,t),r)}toStderr(e,t,r=!0){this.process.toStderr(this.format(null,e,t),r)}wrap(e,t){return e?this.applyFormat(`[${e}]`,t):e}splat(...e){const t=e.shift()??"";return 0===e.length?t:dr(t,e)}suffix(e,...t){return t.filter(Boolean).forEach((t=>{if(e+=this.spacing(e),"string"==typeof t)e+=this.wrap(t);else if("object"==typeof t){if(t.args??=[],"function"==typeof t.condition?!t.condition(...t.args):!(t.condition??1))return e;e+=this.wrap("function"==typeof t.field?t.field(...t.args):t.field,{format:t?.format(...t.args)})}})),e}prefix(e,...t){return t.filter(Boolean).forEach((t=>{if(e=this.spacing(e)+e,"string"==typeof t)e=this.wrap(t)+e;else if("object"==typeof t){if(t.args??=[],"function"==typeof t.condition?!t.condition(...t.args):!(t.condition??1))return e;e=this.wrap("function"==typeof t.field?t.field(...t.args):t.field,{format:t?.format()})+e}})),e}fields(e,t){return this.options?.fields?.prefix&&(e=this.prefix(e,...this.options.fields.prefix)),t?.prefix&&(e=this.prefix(e,...t.prefix)),t?.suffix&&(e=this.suffix(e,...t.suffix)),this.options?.fields?.suffix&&(e=this.suffix(e,...this.options.fields.suffix)),e}icon(e,t){if(!e)return null;t||=this.options.icon?.[e];const r=this.options.color?.[e];return t&&r&&(t=r(t)),t}format(e,t,r){return Array.isArray(t)||(t=[t]),this.splat(t.shift(),...t).toString().split(Wt.EOL).filter((e=>!e||""!==e.trim())).map((t=>this.style(e,this.fields(t,{prefix:Array.isArray(r?.prefix)?r.prefix:[r?.prefix],suffix:Array.isArray(r?.suffix)?r.suffix:[r?.suffix]})))).join(Wt.EOL)}style(e,t){if(!e||!t)return t;const r=this.icon(e,!this.options.useIcons&&this.wrap(e));return r&&(t=r+" "+t),t}applyFormat(e,t){return t?.format?t.format(e):e}spacing(e){return void 0===e||""===e.trim()?"":" "}},yr=class{constructor(e){this.options=e}static{Qt(this,"ProcessOutputBuffer")}buffer=[];decoder=new zt.StringDecoder;get all(){return this.buffer}get last(){return this.buffer.at(-1)}get length(){return this.buffer.length}write(e,...t){const r=t[t.length-1];return this.buffer.push({time:Date.now(),stream:this.options?.stream,entry:this.decoder.write("string"==typeof e?Buffer.from(e,"string"==typeof t[0]?t[0]:void 0):Buffer.from(e))}),this.options?.limit&&(this.buffer=this.buffer.slice(-this.options.limit)),"function"==typeof r&&r(),!0}reset(){this.buffer=[]}},br=class{constructor(e){this.stream=e,this.method=e.write,this.buffer=new yr({stream:e})}static{Qt(this,"ProcessOutputStream")}method;buffer;get out(){return Object.assign({},this.stream,{write:this.write.bind(this)})}hijack(){this.stream.write=this.buffer.write.bind(this.buffer)}release(){this.stream.write=this.method;const e=[...this.buffer.all];return this.buffer.reset(),e}write(...e){return this.method.apply(this.stream,e)}},Er=class{constructor(e,t,r){this.options=r,this.stream={stdout:new br(e??process.stdout),stderr:new br(t??process.stderr)},this.options={dump:["stdout","stderr"],leaveEmptyLine:!0,...r}}static{Qt(this,"ProcessOutput")}stream;active;get stdout(){return this.stream.stdout.out}get stderr(){return this.stream.stderr.out}hijack(){if(this.active)throw new Error("ProcessOutput has been already hijacked!");this.stream.stdout.write(Zt),Object.values(this.stream).forEach((e=>e.hijack())),this.active=!0}release(){const e=Object.entries(this.stream).map((([e,t])=>({name:e,buffer:t.release()}))).filter((e=>this.options.dump.includes(e.name))).flatMap((e=>e.buffer)).sort(((e,t)=>e.time-t.time)).map((e=>({...e,entry:or(e.entry)}))).filter((e=>e.entry));e.length>0&&(this.options.leaveEmptyLine&&this.stdout.write(Wt.EOL),e.forEach((e=>{(e.stream??this.stdout).write(e.entry+Wt.EOL)}))),this.stream.stdout.write(Jt),this.active=!1}toStdout(e,t=!0){return t&&(e+=Wt.EOL),this.stream.stdout.write(e)}toStderr(e,t=!0){return t&&(e+=Wt.EOL),this.stream.stderr.write(e)}};function wr(e){const t=new Yt.Writable;return t.rows=1/0,t.columns=1/0,t.write=t=>(e(t.toString()),!0),t}Qt(wr,"createWritable"),class{constructor(e,t){this.task=e,this.wrapper=t}static{Qt(this,"ListrPromptAdapter")}state;reportStarted(){if(this.state=this.task.state,this.task.prompt)throw new Ur("There is already an active prompt attached to this task which may not be cleaned up properly.");this.task.prompt=this,this.task.state$="PROMPT"}reportFailed(){this.task.state$="PROMPT_FAILED",this.restoreState()}reportCompleted(){this.task.state$="PROMPT_COMPLETED",this.restoreState()}restoreState(){this.task.prompt=void 0,this.state&&(this.task.state=this.state)}};var Ar=class{static{Qt(this,"Spinner")}spinner=nr()?["\u280b","\u2819","\u2839","\u2838","\u283c","\u2834","\u2826","\u2827","\u2807","\u280f"]:["-","\\","|","/"];id;spinnerPosition=0;spin(){this.spinnerPosition=++this.spinnerPosition%this.spinner.length}fetch(){return this.spinner[this.spinnerPosition]}isRunning(){return!!this.id}start(e,t=100){this.id=setInterval((()=>{this.spin(),e&&e()}),t)}stop(){clearInterval(this.id)}},Sr={SKIPPED_WITH_COLLAPSE:pr.arrowDown,SKIPPED_WITHOUT_COLLAPSE:pr.warning,OUTPUT:pr.pointerSmall,OUTPUT_WITH_BOTTOMBAR:pr.pointerSmall,PENDING:pr.pointer,COMPLETED:pr.tick,COMPLETED_WITH_FAILED_SUBTASKS:pr.warning,COMPLETED_WITH_SISTER_TASKS_FAILED:pr.squareSmallFilled,RETRY:pr.warning,ROLLING_BACK:pr.warning,ROLLED_BACK:pr.arrowLeft,FAILED:pr.cross,FAILED_WITH_SUBTASKS:pr.pointer,WAITING:pr.squareSmallFilled,PAUSED:pr.squareSmallFilled},Rr={SKIPPED_WITH_COLLAPSE:ar.yellow,SKIPPED_WITHOUT_COLLAPSE:ar.yellow,PENDING:ar.yellow,COMPLETED:ar.green,COMPLETED_WITH_FAILED_SUBTASKS:ar.yellow,COMPLETED_WITH_SISTER_TASKS_FAILED:ar.red,RETRY:ar.yellowBright,ROLLING_BACK:ar.redBright,ROLLED_BACK:ar.redBright,FAILED:ar.red,FAILED_WITH_SUBTASKS:ar.red,WAITING:ar.dim,PAUSED:ar.yellowBright};function Cr(e){const t=Math.floor(e/1e3),r=Math.floor(t/60);let s;return 0===t&&0===r&&(s=`0.${Math.floor(e/100)}s`),t>0&&(s=t%60+"s"),r>0&&(s=`${r}m${s}`),s}Qt(Cr,"parseTimer");var vr={condition:!0,field:Cr,format:Qt((()=>ar.dim),"format")};Qt((function(){const e=new Date;return String(e.getHours()).padStart(2,"0")+":"+String(e.getMinutes()).padStart(2,"0")+":"+String(e.getSeconds()).padStart(2,"0")}),"parseTimestamp");var Tr=class e{constructor(t,r,s){this.tasks=t,this.options=r,this.events=s,this.options={...e.rendererOptions,...this.options,icon:{...Sr,...r?.icon??{}},color:{...Rr,...r?.color??{}}},this.spinner=this.options.spinner??new Ar,this.logger=this.options.logger??new mr({useIcons:!0,toStderr:[]}),this.logger.options.icon=this.options.icon,this.logger.options.color=this.options.color}static{Qt(this,"DefaultRenderer")}static nonTTY=!1;static rendererOptions={indentation:2,clearOutput:!1,showSubtasks:!0,collapseSubtasks:!0,collapseSkips:!0,showSkipMessage:!0,suffixSkips:!1,collapseErrors:!0,showErrorMessage:!0,suffixRetries:!0,lazy:!1,removeEmptyLines:!0,formatOutput:"wrap",pausedTimer:{...vr,format:Qt((()=>ar.yellowBright),"format")}};static rendererTaskOptions={outputBar:!0};prompt;activePrompt;spinner;logger;updater;truncate;wrap;buffer={output:new Map,bottom:new Map};cache={render:new Map,rendererOptions:new Map,rendererTaskOptions:new Map};async render(){const{createLogUpdate:e}=await Promise.all([r.e(799),r.e(782),r.e(216)]).then(r.bind(r,2216)),{default:t}=await Promise.all([r.e(799),r.e(145)]).then(r.bind(r,5145)),{default:s}=await Promise.all([r.e(799),r.e(782)]).then(r.bind(r,782));this.updater=e(this.logger.process.stdout),this.truncate=t,this.wrap=s,this.logger.process.hijack(),this.options?.lazy||this.spinner.start((()=>{this.update()})),this.events.on("SHOUD_REFRESH_RENDER",(()=>{this.update()}))}update(){this.updater(this.create())}end(){this.spinner.stop(),this.updater.clear(),this.updater.done(),this.options.clearOutput||this.logger.process.toStdout(this.create({prompt:!1})),this.logger.process.release()}create(e){e={tasks:!0,bottomBar:!0,prompt:!0,...e};const t=[],r=this.renderer(this.tasks),s=this.renderBottomBar(),n=this.renderPrompt();return e.tasks&&r.length>0&&t.push(...r),e.bottomBar&&s.length>0&&(t.length>0&&t.push(""),t.push(...s)),e.prompt&&n.length>0&&(t.length>0&&t.push(""),t.push(...n)),t.join(Wt.EOL)}style(e,t=!1){const r=this.cache.rendererOptions.get(e.id);if(e.isSkipped()){if(t||r.collapseSkips)return this.logger.icon("SKIPPED_WITH_COLLAPSE");if(!1===r.collapseSkips)return this.logger.icon("SKIPPED_WITHOUT_COLLAPSE")}if(t)return this.shouldOutputToBottomBar(e)?this.logger.icon("OUTPUT_WITH_BOTTOMBAR"):this.logger.icon("OUTPUT");if(e.hasSubtasks()){if(e.isStarted()||e.isPrompt()&&!1!==r.showSubtasks&&!e.subtasks.every((e=>!e.hasTitle())))return this.logger.icon("PENDING");if(e.isCompleted()&&e.subtasks.some((e=>e.hasFailed())))return this.logger.icon("COMPLETED_WITH_FAILED_SUBTASKS");if(e.hasFailed())return this.logger.icon("FAILED_WITH_SUBTASKS")}return e.isStarted()||e.isPrompt()?this.logger.icon("PENDING",!this.options?.lazy&&this.spinner.fetch()):e.isCompleted()?this.logger.icon("COMPLETED"):e.isRetrying()?this.logger.icon("RETRY",!this.options?.lazy&&this.spinner.fetch()):e.isRollingBack()?this.logger.icon("ROLLING_BACK",!this.options?.lazy&&this.spinner.fetch()):e.hasRolledBack()?this.logger.icon("ROLLED_BACK"):e.hasFailed()?this.logger.icon("FAILED"):e.isPaused()?this.logger.icon("PAUSED"):this.logger.icon("WAITING")}format(e,t,r){if(""===e.trim())return[];let s;t&&(e=t+" "+e);const n=(process.stdout.columns??80)-r*this.options.indentation-2;switch(this.options.formatOutput){case"truncate":s=e.split(Wt.EOL).map(((e,t)=>this.truncate(this.indent(e,t),n)));break;case"wrap":s=this.wrap(e,n,{hard:!0}).split(Wt.EOL).map(((e,t)=>this.indent(e,t)));break;default:throw new Gr("Format option for the renderer is wrong.")}return this.options.removeEmptyLines&&(s=s.filter(Boolean)),s.map((e=>cr(e,r*this.options.indentation)))}shouldOutputToOutputBar(e){const t=this.cache.rendererTaskOptions.get(e.id).outputBar;return"number"==typeof t&&0!==t||"boolean"==typeof t&&!1!==t}shouldOutputToBottomBar(e){const t=this.cache.rendererTaskOptions.get(e.id).bottomBar;return"number"==typeof t&&0!==t||"boolean"==typeof t&&!1!==t||!e.hasTitle()}renderer(e,t=0){return e.flatMap((r=>{if(!r.isEnabled())return[];if(this.cache.render.has(r.id))return this.cache.render.get(r.id);this.calculate(r),this.setupBuffer(r);const s=this.cache.rendererOptions.get(r.id),n=this.cache.rendererTaskOptions.get(r.id),i=[];if(r.isPrompt()){if(this.activePrompt&&this.activePrompt!==r.id)throw new Gr("Only one prompt can be active at the given time, please re-evaluate your task design.");this.activePrompt||(r.on("PROMPT",(e=>{const t=or(e);t&&(this.prompt=t)})),r.on("STATE",(e=>{("PROMPT_COMPLETED"===e||r.hasFinalized()||r.hasReset())&&(this.prompt=null,this.activePrompt=null,r.off("PROMPT"))})),this.activePrompt=r.id)}if(r.hasTitle()&&(!e.some((e=>e.hasFailed()))||r.hasFailed()||!1===r.options.exitOnError||r.isCompleted()||r.isSkipped()?r.hasFailed()&&s.collapseErrors?i.push(...this.format(!r.hasSubtasks()&&r.message.error&&s.showErrorMessage?r.message.error:r.title,this.style(r),t)):r.isSkipped()&&s.collapseSkips?i.push(...this.format(this.logger.suffix(r.message.skip&&s.showSkipMessage?r.message.skip:r.title,{field:"SKIPPED",condition:s.suffixSkips,format:Qt((()=>ar.dim),"format")}),this.style(r),t)):r.isRetrying()?i.push(...this.format(this.logger.suffix(r.title,{field:`RETRY:${r.message.retry.count}`,format:Qt((()=>ar.yellow),"format"),condition:s.suffixRetries}),this.style(r),t)):r.isCompleted()&&r.hasTitle()&&Br(n.timer?.condition,r.message.duration)?i.push(...this.format(this.logger.suffix(r?.title,{...n.timer,args:[r.message.duration]}),this.style(r),t)):r.isPaused()?i.push(...this.format(this.logger.suffix(r.title,{...s.pausedTimer,args:[r.message.paused-Date.now()]}),this.style(r),t)):i.push(...this.format(r.title,this.style(r),t)):i.push(...this.format(r.title,this.logger.icon("COMPLETED_WITH_SISTER_TASKS_FAILED"),t))),r.hasSubtasks()&&s.showSubtasks||(!r.hasFailed()||!1!==s.collapseErrors||!s.showErrorMessage&&s.showSubtasks?!r.isSkipped()||!1!==s.collapseSkips||!s.showSkipMessage&&s.showSubtasks||i.push(...this.dump(r,t,"SKIPPED")):i.push(...this.dump(r,t,"FAILED"))),(r.isPending()||n.persistentOutput)&&i.push(...this.renderOutputBar(r,t)),!1!==s.showSubtasks&&r.hasSubtasks()&&(r.isPending()||r.hasFinalized()&&!r.hasTitle()||r.isCompleted()&&!1===s.collapseSubtasks&&!r.subtasks.some((e=>!0===this.cache.rendererOptions.get(e.id)?.collapseSubtasks))||r.subtasks.some((e=>!1===this.cache.rendererOptions.get(e.id)?.collapseSubtasks))||r.subtasks.some((e=>e.hasFailed()))||r.subtasks.some((e=>e.hasRolledBack())))){const e=r.hasTitle()?t+1:t,s=this.renderer(r.subtasks,e);i.push(...s)}return r.hasFinalized()&&(n.persistentOutput||(this.buffer.bottom.delete(r.id),this.buffer.output.delete(r.id))),r.isClosed()&&(this.cache.render.set(r.id,i),this.reset(r)),i}))}renderOutputBar(e,t){const r=this.buffer.output.get(e.id);return r?r.all.flatMap((r=>this.dump(e,t,"OUTPUT",r.entry))):[]}renderBottomBar(){return 0===this.buffer.bottom.size?[]:Array.from(this.buffer.bottom.values()).flatMap((e=>e.all)).sort(((e,t)=>e.time-t.time)).map((e=>e.entry))}renderPrompt(){return this.prompt?[this.prompt]:[]}calculate(t){if(this.cache.rendererOptions.has(t.id)&&this.cache.rendererTaskOptions.has(t.id))return;const r={...this.options,...t.rendererOptions};this.cache.rendererOptions.set(t.id,r),this.cache.rendererTaskOptions.set(t.id,{...e.rendererTaskOptions,timer:r.timer,...t.rendererTaskOptions})}setupBuffer(e){if(this.buffer.bottom.has(e.id)||this.buffer.output.has(e.id))return;const t=this.cache.rendererTaskOptions.get(e.id);this.shouldOutputToBottomBar(e)&&!this.buffer.bottom.has(e.id)?(this.buffer.bottom.set(e.id,new yr({limit:"number"==typeof t.bottomBar?t.bottomBar:1})),e.on("OUTPUT",(t=>{const r=this.dump(e,-1,"OUTPUT",t);this.buffer.bottom.get(e.id).write(r.join(Wt.EOL))})),e.on("STATE",(t=>{"RETRY"===t&&this.buffer.bottom.delete(e.id)}))):this.shouldOutputToOutputBar(e)&&!this.buffer.output.has(e.id)&&(this.buffer.output.set(e.id,new yr({limit:"number"==typeof t.outputBar?t.outputBar:1})),e.on("OUTPUT",(t=>{this.buffer.output.get(e.id).write(t)})),e.on("STATE",(t=>{"RETRY"===t&&this.buffer.output.delete(e.id)})))}reset(e){this.cache.rendererOptions.delete(e.id),this.cache.rendererTaskOptions.delete(e.id),this.buffer.output.delete(e.id)}dump(e,t,r="OUTPUT",s){if(!s)switch(r){case"OUTPUT":s=e.output;break;case"SKIPPED":s=e.message.skip;break;case"FAILED":s=e.message.error}return e.hasTitle()&&"FAILED"===r&&s===e.title||"string"!=typeof s?[]:("OUTPUT"===r&&(s=or(s)),this.format(s,this.style(e,!0),t+1))}indent(e,t){return t>0?cr(e.trim(),this.options.indentation):e.trim()}},Or=class{constructor(e,t){this.tasks=e,this.options=t}static{Qt(this,"SilentRenderer")}static nonTTY=!0;static rendererOptions;static rendererTaskOptions;render(){}end(){}},xr=class e{constructor(t,r){this.tasks=t,this.options=r,this.options={...e.rendererOptions,...r,icon:{...hr,...r?.icon??{}},color:{...fr,...r?.color??{}}},this.logger=this.options.logger??new mr({useIcons:!0,toStderr:gr}),this.logger.options.icon=this.options.icon,this.logger.options.color=this.options.color,this.options.timestamp&&this.logger.options.fields.prefix.unshift(this.options.timestamp)}static{Qt(this,"SimpleRenderer")}static nonTTY=!0;static rendererOptions={pausedTimer:{...vr,field:Qt((e=>`PAUSED:${e}`),"field"),format:Qt((()=>ar.yellowBright),"format")}};static rendererTaskOptions={};logger;cache={rendererOptions:new Map,rendererTaskOptions:new Map};end(){}render(){this.renderer(this.tasks)}renderer(e){e.forEach((e=>{this.calculate(e),e.once("CLOSED",(()=>{this.reset(e)}));const t=this.cache.rendererOptions.get(e.id),r=this.cache.rendererTaskOptions.get(e.id);e.on("SUBTASK",(e=>{this.renderer(e)})),e.on("STATE",(t=>{if(e.hasTitle())if("STARTED"===t)this.logger.log("STARTED",e.title);else if("COMPLETED"===t){const t=r?.timer;this.logger.log("COMPLETED",e.title,t&&{suffix:{...t,condition:!!e.message?.duration&&t.condition,args:[e.message.duration]}})}else"PROMPT"===t?(this.logger.process.hijack(),e.on("PROMPT",(e=>{this.logger.process.toStderr(e,!1)}))):"PROMPT_COMPLETED"===t&&(e.off("PROMPT"),this.logger.process.release())})),e.on("OUTPUT",(e=>{this.logger.log("OUTPUT",e)})),e.on("MESSAGE",(r=>{if(r.error)this.logger.log("FAILED",e.title,{suffix:{field:`FAILED: ${r.error}`,format:Qt((()=>ar.red),"format")}});else if(r.skip)this.logger.log("SKIPPED",e.title,{suffix:{field:`SKIPPED: ${r.skip}`,format:Qt((()=>ar.yellow),"format")}});else if(r.rollback)this.logger.log("ROLLBACK",e.title,{suffix:{field:`ROLLBACK: ${r.rollback}`,format:Qt((()=>ar.red),"format")}});else if(r.retry)this.logger.log("RETRY",e.title,{suffix:{field:`RETRY:${r.retry.count}`,format:Qt((()=>ar.red),"format")}});else if(r.paused){const s=t?.pausedTimer;this.logger.log("PAUSED",e.title,s&&{suffix:{...s,condition:!!r?.paused&&s.condition,args:[r.paused-Date.now()]}})}}))}))}calculate(t){if(this.cache.rendererOptions.has(t.id)&&this.cache.rendererTaskOptions.has(t.id))return;const r={...this.options,...t.rendererOptions};this.cache.rendererOptions.set(t.id,r),this.cache.rendererTaskOptions.set(t.id,{...e.rendererTaskOptions,timer:r.timer,...t.rendererTaskOptions})}reset(e){this.cache.rendererOptions.delete(e.id),this.cache.rendererTaskOptions.delete(e.id)}},kr=class{constructor(e){this.options=e}static{Qt(this,"TestRendererSerializer")}serialize(e,t,r){return JSON.stringify(this.generate(e,t,r))}generate(e,t,r){const s={event:e,data:t};if("boolean"!=typeof this.options?.task){const e=Object.fromEntries(this.options.task.map((e=>{const t=r[e];return"function"==typeof t?[e,t.call(r)]:[e,t]})));Object.keys(r).length>0&&(s.task=e)}return s}},_r=class e{constructor(t,r){this.tasks=t,this.options=r,this.options={...e.rendererOptions,...this.options},this.logger=this.options.logger??new mr({useIcons:!1}),this.serializer=new kr(this.options)}static{Qt(this,"TestRenderer")}static nonTTY=!0;static rendererOptions={subtasks:!0,state:Object.values(er),output:!0,prompt:!0,title:!0,messages:["skip","error","retry","rollback","paused"],messagesToStderr:["error","rollback","retry"],task:["hasRolledBack","isRollingBack","isCompleted","isSkipped","hasFinalized","hasSubtasks","title","hasReset","hasTitle","isPrompt","isPaused","isPending","isSkipped","isStarted","hasFailed","isEnabled","isRetrying","path"]};static rendererTaskOptions;logger;serializer;render(){this.renderer(this.tasks)}end(){}renderer(e){e.forEach((e=>{this.options.subtasks&&e.on("SUBTASK",(e=>{this.renderer(e)})),this.options.state&&e.on("STATE",(t=>{this.logger.toStdout(this.serializer.serialize("STATE",t,e))})),this.options.output&&e.on("OUTPUT",(t=>{this.logger.toStdout(this.serializer.serialize("OUTPUT",t,e))})),this.options.prompt&&e.on("PROMPT",(t=>{this.logger.toStdout(this.serializer.serialize("PROMPT",t,e))})),this.options.title&&e.on("TITLE",(t=>{this.logger.toStdout(this.serializer.serialize("TITLE",t,e))})),e.on("MESSAGE",(t=>{const r=Object.fromEntries(Object.entries(t).map((([e,t])=>{if(this.options.messages.includes(e))return[e,t]})).filter(Boolean));if(Object.keys(r).length>0){const t=this.serializer.serialize("MESSAGE",r,e);this.options.messagesToStderr.some((e=>Object.keys(r).includes(e)))?this.logger.toStderr(t):this.logger.toStdout(t)}}))}))}},Lr={default:Tr,simple:xr,verbose:class e{constructor(t,r){this.tasks=t,this.options=r,this.options={...e.rendererOptions,...this.options,icon:{...hr,...r?.icon??{}},color:{...fr,...r?.color??{}}},this.logger=this.options.logger??new mr({useIcons:!1,toStderr:gr}),this.logger.options.icon=this.options.icon,this.logger.options.color=this.options.color,this.options.timestamp&&this.logger.options.fields.prefix.unshift(this.options.timestamp)}static{Qt(this,"VerboseRenderer")}static nonTTY=!0;static rendererOptions={logTitleChange:!1,pausedTimer:{...vr,format:Qt((()=>ar.yellowBright),"format")}};static rendererTaskOptions;logger;cache={rendererOptions:new Map,rendererTaskOptions:new Map};render(){this.renderer(this.tasks)}end(){}renderer(e){e.forEach((e=>{this.calculate(e),e.once("CLOSED",(()=>{this.reset(e)}));const t=this.cache.rendererOptions.get(e.id),r=this.cache.rendererTaskOptions.get(e.id);e.on("SUBTASK",(e=>{this.renderer(e)})),e.on("STATE",(t=>{if(e.hasTitle())if("STARTED"===t)this.logger.log("STARTED",e.title);else if("COMPLETED"===t){const t=r.timer;this.logger.log("COMPLETED",e.title,t&&{suffix:{...t,condition:!!e.message?.duration&&t.condition,args:[e.message.duration]}})}})),e.on("OUTPUT",(e=>{this.logger.log("OUTPUT",e)})),e.on("PROMPT",(e=>{const t=or(e);t&&this.logger.log("PROMPT",t)})),!1!==this.options?.logTitleChange&&e.on("TITLE",(e=>{this.logger.log("TITLE",e)})),e.on("MESSAGE",(r=>{if(r?.error)this.logger.log("FAILED",r.error);else if(r?.skip)this.logger.log("SKIPPED",r.skip);else if(r?.rollback)this.logger.log("ROLLBACK",r.rollback);else if(r?.retry)this.logger.log("RETRY",e.title,{suffix:r.retry.count.toString()});else if(r?.paused){const s=t?.pausedTimer;this.logger.log("PAUSED",e.title,s&&{suffix:{...s,condition:!!r?.paused&&s.condition,args:[r.paused-Date.now()]}})}}))}))}calculate(t){if(this.cache.rendererOptions.has(t.id)&&this.cache.rendererTaskOptions.has(t.id))return;const r={...this.options,...t.rendererOptions};this.cache.rendererOptions.set(t.id,r),this.cache.rendererTaskOptions.set(t.id,{...e.rendererTaskOptions,timer:r.timer,...t.rendererTaskOptions})}reset(e){this.cache.rendererOptions.delete(e.id),this.cache.rendererTaskOptions.delete(e.id)}},test:_r,silent:Or};function Pr(e){return!0===process.stdout.isTTY||!0===e.nonTTY}function Ir(e){return"string"==typeof e?Lr[e]??Lr.default:"function"==typeof e?e:Lr.default}function $r(e){if(Br(e?.silentRendererCondition))return{renderer:Ir("silent"),selection:"SILENT"};const t={renderer:Ir(e.renderer),options:e.rendererOptions,selection:"PRIMARY"};return!Pr(t.renderer)||Br(e?.fallbackRendererCondition)?{renderer:Ir(e.fallbackRenderer),options:e.fallbackRendererOptions,selection:"SECONDARY"}:t}function Br(e,...t){return"function"==typeof e?e(...t):e}Qt(Pr,"isRendererSupported"),Qt(Ir,"getRendererClass"),Qt($r,"getRenderer"),Qt(Br,"assertFunctionOrSelf");var Fr=qt({circles:!0});function Dr(e){return Fr(e)}Qt(Dr,"cloneObject");var Hr=class{static{Qt(this,"Concurrency")}concurrency;count;queue;constructor(e){this.concurrency=e.concurrency,this.count=0,this.queue=new Set}add(e){return this.count<this.concurrency?this.run(e):new Promise((t=>{const r=Qt((()=>t(this.run(e))),"callback");this.queue.add(r)}))}flush(){for(const e of this.queue){if(this.count>=this.concurrency)break;this.queue.delete(e),e()}}run(e){this.count++;const t=e(),r=Qt((()=>{this.count--,this.flush()}),"cleanup");return t.then(r,(()=>{this.queue.clear()})),t}};function Mr(e){return new Promise((t=>{setTimeout(t,e)}))}Qt(Mr,"delay");var Nr=class extends Error{constructor(e,t,r){super(e.message),this.error=e,this.type=t,this.task=r,this.name="ListrError",this.path=r.path,"full"===r?.options.collectErrors&&(this.task=Dr(r),this.ctx=Dr(r.listr.ctx)),this.stack=e?.stack}static{Qt(this,"ListrError")}path;ctx},Gr=class extends Error{static{Qt(this,"ListrRendererError")}},Ur=class extends Error{static{Qt(this,"PromptError")}},jr=class{constructor(e){this.task=e}static{Qt(this,"TaskWrapper")}get title(){return this.task.title}set title(e){e=Array.isArray(e)?e:[e],this.task.title$=dr(e.shift(),...e)}get output(){return this.task.output}set output(e){e=Array.isArray(e)?e:[e],this.task.output$=dr(e.shift(),...e)}set promptOutput(e){this.task.promptOutput$=e}newListr(e,t){let r;return r="function"==typeof e?e(this):e,new Yr(r,t,this.task)}report(e,t){!1!==this.task.options.collectErrors&&this.task.listr.errors.push(new Nr(e,t,this.task)),this.task.message$={error:e.message??this.task?.title}}skip(e,...t){this.task.state$="SKIPPED",e&&(this.task.message$={skip:e?dr(e,...t):this.task?.title})}isRetrying(){return this.task.isRetrying()?this.task.retry:{count:0}}prompt(e){return this.task.prompt?this.task.prompt:new e(this.task,this)}stdout(e){return wr((t=>{"PROMPT"===e?this.promptOutput=t:this.output=t}))}run(e){return this.task.run(e,this)}},Kr=class extends tr{static{Qt(this,"ListrTaskEventManager")}},Wr=class extends Kr{constructor(e,t,r,s,n){if(super(),this.listr=e,this.task=t,this.options=r,this.rendererOptions=s,this.rendererTaskOptions=n,t.title){const e=Array.isArray(t?.title)?t.title:[t.title];this.title=dr(e.shift(),...e),this.initialTitle=this.title}this.taskFn=t.task,this.parent=e.parentTask}static{Qt(this,"Task")}id=(0,Vt.randomUUID)();state="WAITING";subtasks;title;initialTitle;output;retry;message={};prompt;parent;enabled;taskFn;closed;set state$(e){if(this.state=e,this.emit("STATE",e),this.hasSubtasks()&&this.hasFailed())for(const e of this.subtasks)"STARTED"===e.state&&(e.state$="FAILED");this.listr.events.emit("SHOUD_REFRESH_RENDER")}set output$(e){this.output=e,this.emit("OUTPUT",e),this.listr.events.emit("SHOUD_REFRESH_RENDER")}set promptOutput$(e){this.emit("PROMPT",e),or(e)&&this.listr.events.emit("SHOUD_REFRESH_RENDER")}set message$(e){this.message={...this.message,...e},this.emit("MESSAGE",e),this.listr.events.emit("SHOUD_REFRESH_RENDER")}set title$(e){this.title=e,this.emit("TITLE",e),this.listr.events.emit("SHOUD_REFRESH_RENDER")}get path(){return[...this.listr.path,this.initialTitle]}async check(e){return"WAITING"===this.state&&(this.enabled=await Br(this.task?.enabled??!0,e),this.emit("ENABLED",this.enabled),this.listr.events.emit("SHOUD_REFRESH_RENDER")),this.enabled}hasSubtasks(){return this.subtasks?.length>0}hasFinalized(){return this.isCompleted()||this.hasFailed()||this.isSkipped()||this.hasRolledBack()}isPending(){return this.isStarted()||this.isPrompt()||this.hasReset()}isStarted(){return"STARTED"===this.state}isSkipped(){return"SKIPPED"===this.state}isCompleted(){return"COMPLETED"===this.state}hasFailed(){return"FAILED"===this.state}isRollingBack(){return"ROLLING_BACK"===this.state}hasRolledBack(){return"ROLLED_BACK"===this.state}isRetrying(){return"RETRY"===this.state}hasReset(){return"RETRY"===this.state||"ROLLING_BACK"===this.state}isEnabled(){return this.enabled}hasTitle(){return"string"==typeof this?.title}isPrompt(){return"PROMPT"===this.state||"PROMPT_COMPLETED"===this.state}isPaused(){return"PAUSED"===this.state}isClosed(){return this.closed}async pause(e){const t=this.state;this.state$="PAUSED",this.message$={paused:Date.now()+e},await Mr(e),this.state$=t,this.message$={paused:null}}async run(e,t){const r=Qt((t=>(t instanceof Yr?(t.options={...this.options,...t.options},t.rendererClass=Ir("silent"),this.subtasks=t.tasks,t.errors=this.listr.errors,this.emit("SUBTASK",this.subtasks),t=t.run(e)):t instanceof Promise?t=t.then(r):sr(t)?t=new Promise(((e,r)=>{t.on("data",(e=>{this.output$=e.toString()})),t.on("error",(e=>r(e))),t.on("end",(()=>e(null)))})):rr(t)&&(t=new Promise(((e,r)=>{t.subscribe({next:Qt((e=>{this.output$=e}),"next"),error:r,complete:e})}))),t)),"handleResult"),s=Date.now();this.state$="STARTED";const n=await Br(this.task?.skip??!1,e);if(n)return"string"==typeof n?this.message$={skip:n}:this.hasTitle()?this.message$={skip:this.title}:this.message$={skip:"Skipped task without a title."},void(this.state$="SKIPPED");try{const n="number"==typeof this.task?.retry&&this.task.retry>0?this.task.retry+1:"object"==typeof this.task?.retry&&this.task.retry.tries>0?this.task.retry.tries+1:1,i="object"==typeof this.task.retry&&this.task.retry.delay;for(let s=1;s<=n;s++)try{await r(this.taskFn(e,t));break}catch(e){if(s===n)throw e;this.retry={count:s,error:e},this.message$={retry:this.retry},this.title$=this.initialTitle,this.output=void 0,t.report(e,"WILL_RETRY"),this.state$="RETRY",i&&await this.pause(i)}(this.isStarted()||this.isRetrying())&&(this.message$={duration:Date.now()-s},this.state$="COMPLETED")}catch(r){if(this.prompt instanceof Ur&&(r=this.prompt),this.task?.rollback){t.report(r,"WILL_ROLLBACK");try{this.state$="ROLLING_BACK",await this.task.rollback(e,t),this.message$={rollback:this.title},this.state$="ROLLED_BACK"}catch(e){throw this.state$="FAILED",t.report(e,"HAS_FAILED_TO_ROLLBACK"),this.close(),e}if(!1!==this.listr.options?.exitAfterRollback)throw this.close(),r}else{if(this.state$="FAILED",!1!==this.listr.options.exitOnError&&!1!==await Br(this.task?.exitOnError,e))throw t.report(r,"HAS_FAILED"),this.close(),r;this.hasSubtasks()||t.report(r,"HAS_FAILED_WITHOUT_ERROR")}}finally{this.close()}}close(){this.emit("CLOSED"),this.listr.events.emit("SHOUD_REFRESH_RENDER"),this.complete()}},zr=class extends tr{static{Qt(this,"ListrEventManager")}},Yr=class{constructor(e,t,r){this.task=e,this.options=t,this.parentTask=r,this.options={concurrent:!1,renderer:"default",fallbackRenderer:"simple",exitOnError:!0,exitAfterRollback:!0,collectErrors:!1,registerSignalListeners:!0,...this.parentTask?.options??{},...t},!0===this.options.concurrent?this.options.concurrent=1/0:"number"!=typeof this.options.concurrent&&(this.options.concurrent=1),this.concurrency=new Hr({concurrency:this.options.concurrent}),r&&(this.path=[...r.listr.path,r.title],this.errors=r.listr.errors),this.parentTask?.listr.events instanceof zr?this.events=this.parentTask.listr.events:this.events=new zr;const s=$r({renderer:this.options.renderer,rendererOptions:this.options.rendererOptions,fallbackRenderer:this.options.fallbackRenderer,fallbackRendererOptions:this.options.fallbackRendererOptions,fallbackRendererCondition:this.options?.fallbackRendererCondition,silentRendererCondition:this.options?.silentRendererCondition});this.rendererClass=s.renderer,this.rendererClassOptions=s.options,this.rendererSelection=s.selection,this.add(e??[]),this.options.registerSignalListeners&&(this.boundSignalHandler=this.signalHandler.bind(this),process.once("SIGINT",this.boundSignalHandler).setMaxListeners(0)),(this.options?.forceTTY||process.env.LISTR_FORCE_TTY)&&(process.stdout.isTTY=!0,process.stderr.isTTY=!0),this.options?.forceUnicode&&(process.env.LISTR_FORCE_UNICODE="1")}static{Qt(this,"Listr")}tasks=[];errors=[];ctx;events;path=[];rendererClass;rendererClassOptions;rendererSelection;boundSignalHandler;concurrency;renderer;isRoot(){return!this.parentTask}isSubtask(){return!!this.parentTask}add(e){this.tasks.push(...this.generate(e))}async run(e){this.renderer||(this.renderer=new this.rendererClass(this.tasks,this.rendererClassOptions,this.events)),await this.renderer.render(),this.ctx=this.options?.ctx??e??{},await Promise.all(this.tasks.map((e=>e.check(this.ctx))));try{await Promise.all(this.tasks.map((e=>this.concurrency.add((()=>this.runTask(e)))))),this.renderer.end(),this.removeSignalHandler()}catch(e){if(!1!==this.options.exitOnError)throw this.renderer.end(e),this.removeSignalHandler(),e}return this.ctx}generate(e){return(e=Array.isArray(e)?e:[e]).map((e=>{let t;return"PRIMARY"===this.rendererSelection?t=e.rendererOptions:"SECONDARY"===this.rendererSelection&&(t=e.fallbackRendererOptions),new Wr(this,e,this.options,this.rendererClassOptions,t)}))}async runTask(e){if(await e.check(this.ctx))return new jr(e).run(this.ctx)}signalHandler(){this.tasks?.forEach((async e=>{e.isPending()&&(e.state$="FAILED")})),this.isRoot()&&(this.renderer.end(new Error("Interrupted.")),process.exit(127))}removeSignalHandler(){this.boundSignalHandler&&process.removeListener("SIGINT",this.boundSignalHandler)}};const qr=Ne.Ay.blue(pr.arrowRight),Vr=Ne.Ay.redBright(pr.cross),Xr=Ne.Ay.yellow(pr.warning),Qr=(e,t,r)=>`${Ne.Ay.redBright(`${Vr} Validation Error:`)}\n\n Invalid value for '${Ne.Ay.bold(e)}': ${Ne.Ay.bold((0,Oe.inspect)(r))}\n\n ${t}`,Zr=Ne.Ay.redBright(`${Vr} Current directory is not a git directory!`),Jr=Ne.Ay.redBright(`${Vr} Failed to get staged files!`),es=`${Vr} No valid configuration found.`,ts=`${qr} No staged files found.`,rs=`${qr} No staged files match any configured task.`,ss=Ne.Ay.yellow(`${Xr} Some of your tasks use \`git add\` command. Please remove it from the config since all modifications made by tasks will be automatically added to the git commit index.\n`),ns="Skipped because of errors from tasks.",is=`\n ${Ne.Ay.redBright(`${Vr} lint-staged failed due to a git error.`)}`,os=(e,t,r)=>`${Ne.Ay.redBright(`${Vr} Validation Error:`)}\n\n Invalid value for option '${Ne.Ay.bold(e)}': ${Ne.Ay.bold(t)}\n\n ${r}\n\nSee https://github.com/okonet/lint-staged#command-line-flags`,as=`\n ${Ne.Ay.yellow(`${Xr} lint-staged prevented an empty git commit.\n Use the --allow-empty option to continue, or check your task configuration`)}\n`,cs=(Ne.Ay.redBright(`${Vr} Failed to read config from stdin.`),(e,t)=>`${Ne.Ay.redBright(`${t} Failed to parse config from file "${e}".`)}\n\n${t}\n\nSee https://github.com/okonet/lint-staged#configuration.`),ls=(e={},t)=>{if(!Array.isArray(e.output))return;const r=e.errors?.size>0?t.error:t.log;for(const t of e.output)r(t)},us=e=>{if(e===i.posix.sep||e===i.win32.sep)return i.posix.sep;let t=e.split(/[/\\]+/).join(i.posix.sep);return(e.startsWith("\\\\?\\")||e.startsWith("\\\\.\\"))&&(t=t.replace(/^\/(\.|\?)/,"//$1")),t.endsWith(i.posix.sep)&&(t=t.slice(0,-1)),t},ps=s("lint-staged:chunkFiles"),ds=({files:e,baseDir:t,maxArgLength:r=null,relative:s=!1})=>{const n=e.map((e=>us(s||!t?e:i.resolve(t,e))));if(!r)return ps("Skip chunking files because of undefined maxArgLength"),[n];const o=n.join(" ").length;ps(`Resolved an argument string length of ${o} characters from ${n.length} files`);const a=Math.min(Math.ceil(o/r),n.length);return ps(`Creating ${a} chunks for maxArgLength of ${r}`),((e,t)=>{if(1===t)return[e];const r=[];let s=0;for(let n=0;n<t;n++){const i=Math.ceil((e.length-s)/(t-n));r.push([]),r[n]=e.slice(s,i+s),s+=i}return r})(n,a)};var hs=r(7498);const fs=s("lint-staged:generateTasks"),gs=({config:e,cwd:t=process.cwd(),files:r,relative:s=!1})=>{fs("Generating linter tasks");const n=r.map((e=>us(i.relative(t,e))));return Object.entries(e).map((([e,r])=>{const o=e.startsWith("../"),a=n.filter((e=>!!o||!e.startsWith("..")&&!i.isAbsolute(e))),c=hs(a,e,{cwd:t,dot:!0,matchBase:!e.includes("/"),posixSlashes:!0,strictBrackets:!0}),l={pattern:e,commands:r,fileList:c.map((e=>us(s?e:i.resolve(t,e))))};return fs("Generated task: \n%O",l),l}))};var ms=r(7075);const ys=new RegExp(w.EOL+"$"),bs=e=>new ms.Writable({write:function(t,r,s){e(t.toString().replace(ys,"")),s()}}),Es=({renderer:e},{FORCE_COLOR:t})=>"silent"===e||"test"===e||Number(t)>0?e:"verbose",ws=(e,t,r=process.env)=>{const s=(({debug:e,quiet:t},r,s)=>t?{renderer:"silent"}:"test"===s.NODE_ENV?{renderer:"test",rendererOptions:{logger:new mr({processOutput:new Er(bs(r.log),bs(r.error))})}}:e||"dumb"===s.TERM?{renderer:"verbose"}:{renderer:"update",rendererOptions:{formatOutput:"truncate"}})(e,t,r);return{...s,fallbackRenderer:Es(s,r)}};function As(e,t){return["diff","--name-only","-z",`--diff-filter=${void 0!==t?t.trim():"ACMR"}`,...void 0!==e?e.trim().split(" "):["--staged"]]}const Ss=e=>e?e.replace(/\u0000$/,"").split("\0"):[];var Rs=r(1455);const Cs=s("lint-staged:file"),vs=async(e,t=!0)=>{Cs("Reading file `%s`",e);try{return await Rs.readFile(e)}catch(r){if(t&&"ENOENT"===r.code)return Cs("File `%s` doesn't exist, ignoring...",e),null;throw r}},Ts=async(e,t=!0)=>{Cs("Removing file `%s`",e);try{await Rs.unlink(e)}catch(r){if(!t||"ENOENT"!==r.code)throw r;Cs("File `%s` doesn't exist, ignoring...",e)}},Os=async(e,t)=>{Cs("Writing file `%s`",e),await Rs.writeFile(e,t)},xs=Symbol("ApplyEmptyCommitError"),ks=new Error("Configuration could not be found"),_s=new Error("Configuration should be an object or a function"),Ls=new Error("Configuration should not be empty"),Ps=Symbol("GetBackupStashError"),Is=Symbol("GetStagedFilesError"),$s=Symbol("GitError"),Bs=Symbol("GitRepoError"),Fs=Symbol("HideUnstagedChangesError"),Ds=new Error("Invalid Options"),Hs=Symbol("RestoreMergeStatusError"),Ms=Symbol("RestoreOriginalStateError"),Ns=Symbol("RestoreUnstagedChangesError"),Gs=Symbol("TaskError"),Us=s("lint-staged:GitWorkflow"),js=/\x00/,Ks=(e,t=!0)=>e.reduce(((e,r)=>{if(js.test(r)){const[s,n]=r.split(js);t&&e.push(n),e.push(s)}else e.push(r);return e}),[]),Ws="lint-staged automatic backup",zs="lint-staged_unstaged.patch",Ys=["--binary","--unified=0","--no-color","--no-ext-diff","--src-prefix=a/","--dst-prefix=b/","--patch","--submodule=short"],qs=["-v","--whitespace=nowarn","--recount","--unidiff-zero"],Vs=(e,t,r)=>{throw t.errors.add($s),r&&t.errors.add(r),e};class Xs{constructor({allowEmpty:e,gitConfigDir:t,topLevelDir:r,matchedFileChunks:s,diff:n,diffFilter:o}){this.execGit=(e,t={})=>Me(e,{...t,cwd:r}),this.deletedFiles=[],this.gitConfigDir=t,this.topLevelDir=r,this.diff=n,this.diffFilter=o,this.allowEmpty=e,this.matchedFileChunks=s,this.mergeHeadFilename=i.resolve(t,"MERGE_HEAD"),this.mergeModeFilename=i.resolve(t,"MERGE_MODE"),this.mergeMsgFilename=i.resolve(t,"MERGE_MSG")}getHiddenFilepath(e){return i.resolve(this.gitConfigDir,`./${e}`)}async getBackupStash(e){const t=(await this.execGit(["stash","list"])).split("\n").findIndex((e=>e.includes(Ws)));if(-1===t)throw e.errors.add(Ps),new Error("lint-staged automatic backup is missing!");return String(t)}async getDeletedFiles(){Us("Getting deleted files...");const e=(await this.execGit(["ls-files","--deleted"])).split("\n").filter(Boolean).map((e=>i.resolve(this.topLevelDir,e)));return Us("Found deleted files:",e),e}async backupMergeStatus(){Us("Backing up merge state..."),await Promise.all([vs(this.mergeHeadFilename).then((e=>this.mergeHeadBuffer=e)),vs(this.mergeModeFilename).then((e=>this.mergeModeBuffer=e)),vs(this.mergeMsgFilename).then((e=>this.mergeMsgBuffer=e))]),Us("Done backing up merge state!")}async restoreMergeStatus(e){Us("Restoring merge state...");try{await Promise.all([this.mergeHeadBuffer&&Os(this.mergeHeadFilename,this.mergeHeadBuffer),this.mergeModeBuffer&&Os(this.mergeModeFilename,this.mergeModeBuffer),this.mergeMsgBuffer&&Os(this.mergeMsgFilename,this.mergeMsgBuffer)]),Us("Done restoring merge state!")}catch(t){Us("Failed restoring merge state with error:"),Us(t),Vs(new Error("Merge state could not be restored due to an error!"),e,Hs)}}async getPartiallyStagedFiles(){Us("Getting partially staged files...");const e=(await this.execGit(["status","-z"])).split(/\x00(?=[ AMDRCU?!]{2} |$)/).filter((e=>{const[t,r]=e;return" "!==t&&" "!==r&&"?"!==t&&"?"!==r})).map((e=>e.substr(3))).filter(Boolean);return Us("Found partially staged files:",e),e.length?e:null}async prepare(e){try{if(Us("Backing up original state..."),this.partiallyStagedFiles=await this.getPartiallyStagedFiles(),this.partiallyStagedFiles){e.hasPartiallyStagedFiles=!0;const t=this.getHiddenFilepath(zs),r=Ks(this.partiallyStagedFiles);await this.execGit(["diff",...Ys,"--output",t,"--",...r])}else e.hasPartiallyStagedFiles=!1;if(!e.shouldBackup)return;await this.backupMergeStatus(),this.deletedFiles=await this.getDeletedFiles();const t=await this.execGit(["stash","create"]);await this.execGit(["stash","store","--quiet","--message",Ws,t]),Us("Done backing up original state!")}catch(t){Vs(t,e)}}async hideUnstagedChanges(e){try{const e=Ks(this.partiallyStagedFiles,!1);await this.execGit(["checkout","--force","--",...e])}catch(t){Vs(t,e,Fs)}}async applyModifications(e){Us("Adding task modifications to index...");for(const e of this.matchedFileChunks)await this.execGit(["add","--",...e]);Us("Done adding task modifications to index!"),await this.execGit(As(this.diff,this.diffFilter))||this.allowEmpty||Vs(new Error("Prevented an empty git commit!"),e,xs)}async restoreUnstagedChanges(e){Us("Restoring unstaged changes...");const t=this.getHiddenFilepath(zs);try{await this.execGit(["apply",...qs,t])}catch(r){Us("Error while restoring changes:"),Us(r),Us("Retrying with 3-way merge");try{await this.execGit(["apply",...qs,"--3way",t])}catch(t){Us("Error while restoring unstaged changes using 3-way merge:"),Us(t),Vs(new Error("Unstaged changes could not be restored due to a merge conflict!"),e,Ns)}}}async restoreOriginalState(e){try{Us("Restoring original state..."),await this.execGit(["reset","--hard","HEAD"]),await this.execGit(["stash","apply","--quiet","--index",await this.getBackupStash(e)]),await this.restoreMergeStatus(e),await Promise.all(this.deletedFiles.map((e=>Ts(e)))),await Ts(this.getHiddenFilepath(zs)),Us("Done restoring original state!")}catch(t){Vs(t,e,Ms)}}async cleanup(e){try{Us("Dropping backup stash..."),await this.execGit(["stash","drop","--quiet",await this.getBackupStash(e)]),Us("Done dropping backup stash!")}catch(t){Vs(t,e)}}}const Qs=s("lint-staged:groupFilesByConfig");var Zs=r(6454);function Js(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=0;r<e.length;r++){var s=e[r];if("string"==typeof s)return s}}var en=r(4434);const tn=({quiet:e=!1}={})=>({hasPartiallyStagedFiles:null,shouldBackup:null,shouldHidePartiallyStaged:!0,errors:new Set([]),events:new en,output:[],quiet:e}),rn=e=>e.hasPartiallyStagedFiles&&e.shouldHidePartiallyStaged,sn=e=>!!e.shouldBackup&&(e.errors.has($s)?is:e.errors.has(Gs)?ns:void 0),nn=e=>e.errors.has($s)?is:e.errors.has(Gs)?ns:void 0,on=e=>e.shouldBackup&&(e.errors.has(Gs)||e.errors.has(xs)||e.errors.has(Ns)),an=e=>{if(e.errors.has($s)&&!e.errors.has(xs)&&!e.errors.has(Ns))return is},cn=e=>e.shouldBackup,ln=e=>!e.errors.has($s)||e.errors.has(xs)||e.errors.has(Ns)?e.errors.has(Ms)?is:void 0:is,un="lint-staged:taskError",pn=s("lint-staged:resolveTaskFn"),dn=({code:e,killed:t,signal:r})=>(t?"KILLED":r)||e||"FAILED",hn=(e,t,r,s=!1)=>{const{stderr:n,stdout:i}=t;if(n||i){const t=s?Ne.Ay.redBright(`${Vr} ${e}:`):`${qr} ${e}:`,o=[].concat(r.quiet?[]:["",t]).concat(n||[]).concat(i||[]);r.output.push(o.join("\n"))}else if(s){const s=dn(t),n=Ne.Ay.redBright(`\n${Vr} ${e} failed without output (${s}).`);r.quiet||r.output.push(n)}},fn=({command:e,cwd:t=process.cwd(),files:r,topLevelDir:s,isFn:n,shell:i=!1,verbose:o=!1})=>{const[a,...c]=function(e){var t,r=/([^\s'"]([^\s'"]*(['"])([^\3]*?)\3)+[^\s'"]*)|[^\s'"]+|(['"])([^\5]*?)\5/gi,s=e,n=[];do{null!==(t=r.exec(s))&&n.push(Js(t[1],t[6],t[0]))}while(null!==t);return n}(e);pn("cmd:",a),pn("args:",c);const l={cwd:/^git(\.exe)?/i.test(a)?s:t,preferLocal:!0,reject:!1,shell:i,stdin:"ignore"};return pn("execaOptions:",l),async(t=tn())=>{const s=i?function(e,t){const[r,...s]=(e=>{const t=[];for(const r of e.trim().split(Se)){const e=t.at(-1);e&&e.endsWith("\\")?t[t.length-1]=`${e.slice(0,-1)} ${r}`:t.push(r)}return t})(e);return Ie(r,s,t)}(n?e:`${e} ${r.join(" ")}`,l):Ie(a,n?c:c.concat(r),l),u=((e,t)=>{let r;const s=async()=>{r=(async e=>{try{const t=await Zs(e.pid);for(const e of t)try{process.kill(e)}catch(t){pn('Failed to kill process with pid "%d": %o',e,t)}}catch(t){pn('Failed to kill process with pid "%d": %o',e.pid,t)}e.kill()})(t),await r};return e.events.on(un,s,{once:!0}),async()=>{e.events.off(un,s),await r}})(t,s),p=await s;if(await u(),p.failed||p.killed||null!=p.signal)throw((e,t,r)=>{r.errors.add(Gs),r.events.emit(un,Gs),hn(e,t,r,!0);const s=dn(t);return new Error(`${Ne.Ay.redBright(e)} ${Ne.Ay.dim(`[${s}]`)}`)})(e,p,t);o&&hn(e,p,t)}},gn=s("lint-staged:makeCmdTasks"),mn=async({commands:e,cwd:t,files:r,topLevelDir:s,shell:n,verbose:i})=>{gn("Creating listr tasks for commands %o",e);const o=Array.isArray(e)?e:[e],a=[];for(const e of o){const o="function"==typeof e,c=o?await e([...r]):e,l=Array.isArray(c)?c:[c];for(const e of l){if(o&&"string"!=typeof e)throw new Error(Qr("[Function]","Function task should return a string or an array of strings",c));const l=fn({command:e,cwd:t,files:r,topLevelDir:s,isFn:o,shell:n,verbose:i});a.push({title:e,command:e,task:l})}}return a},yn=s("lint-staged:resolveGitRepo"),bn=["package.json","package.yaml","package.yml",".lintstagedrc",".lintstagedrc.json",".lintstagedrc.yaml",".lintstagedrc.yml",".lintstagedrc.mjs",".lintstagedrc.js",".lintstagedrc.cjs","lint-staged.config.mjs","lint-staged.config.js","lint-staged.config.cjs"],En=async()=>{},wn=/(?<![\\$])({)(?:(?!(?<!\\),|\.\.|\{|\}).)*?(?<!\\)(})/g,An=/{{[^}{]*}}/,Sn=s("lint-staged:validateConfig"),Rn=e=>e&&"object"==typeof e&&!Array.isArray(e),Cn=new Map([["concurrent",e=>"boolean"==typeof e],["chunkSize",e=>"number"==typeof e],["globOptions",Rn],["linters",Rn],["ignore",e=>Array.isArray(e)],["subTaskConcurrency",e=>"number"==typeof e],["renderer",e=>"string"==typeof e],["relative",e=>"boolean"==typeof e]]),vn=(e,t,r)=>{try{return((e,t,r)=>{if(Sn("Validating config from `%s`...",t),!e||"object"!=typeof e&&"function"!=typeof e)throw _s;if("function"==typeof e)return{"*":e};if(0===Object.entries(e).length)throw Ls;const s=[],n=Object.entries(e).reduce(((e,[t,n])=>{if(Cn.has(t))return Cn.get(t)(n)&&s.push(Qr(t,"Advanced configuration has been deprecated.",n)),e;Array.isArray(n)&&!n.some((e=>"string"!=typeof e&&"function"!=typeof e))||"string"==typeof n||"function"==typeof n||s.push(Qr(t,"Should be a string, a function, or an array of strings and functions.",n));const i=((e,t)=>{const r=(e=>{let t=`${e}`;const r=An.exec(e)?.[0];if(r){const e=r.replace("{{","{").replace("}}","}");t=t.replace(r,e)}return t})((e=>{let t=`${e}`,r=null;for(;r=wn.exec(e);){const e=r[0],s=e.replace(/{/,"").replace(/}/,"");t=t.replace(e,s)}return t})(e));var s,n;return r!==e&&t.warn((s=e,n=r,Ne.Ay.yellow(`${Xr} Detected incorrect braces with only single value: \`${s}\`. Reformatted as: \`${n}\`\n`))),r})(t,r);return{...e,[i]:n}}),{});if(s.length){const e=s.join("\n\n");throw r.error(cs(t,e)),new Error(e)}return Sn("Validated config from `%s`:",t),Sn((0,Oe.inspect)(e,{compact:!1})),n})(e,t,r)}catch(e){throw r.error(cs(t,e)),e}},Tn=s("lint-staged:searchConfigs"),On=["ls-files","-z","--full-name","-t"],xn=e=>bn.includes(i.basename(e)),kn=e=>e.split("/").length,_n=(e,t)=>kn(e)>kn(t)?-1:1,Ln=s("lint-staged:runAll"),Pn=e=>Object.assign(new Error("lint-staged failed"),{ctx:e}),In=async({allowEmpty:e=!1,concurrent:t=!0,configObject:r,configPath:s,cwd:n,debug:o=!1,diff:a,diffFilter:c,maxArgLength:l,quiet:u=!1,relative:p=!1,shell:d=!1,stash:h=void 0===a,hidePartiallyStaged:f=h,verbose:g=!1},m=console)=>{Ln("Running all linter scripts...");const y=!!n;n=y?i.resolve(n):process.cwd(),Ln("Using working directory `%s`",n);const b=tn({quiet:u}),{topLevelDir:E,gitConfigDir:w}=await(async(e=process.cwd())=>{try{yn("Resolving git repo from `%s`",e),yn("Unset GIT_DIR (was `%s`)",process.env.GIT_DIR),delete process.env.GIT_DIR,yn("Unset GIT_WORK_TREE (was `%s`)",process.env.GIT_WORK_TREE),delete process.env.GIT_WORK_TREE;const t=await Me(["rev-parse","--show-cdup"],{cwd:e}),r=us(i.join(e,t));yn("Resolved git repository top-level directory to be `%s`",r);const s=await(async e=>{const t=Me(["rev-parse","--show-toplevel"],{cwd:e}),r=Me(["rev-parse","--absolute-git-dir"],{cwd:e}),[s,n]=await Promise.all([t,r]);return i.relative(s,n)})(e),n=us(i.join(r,s));return yn("Resolved git config directory to be `%s`",n),{topLevelDir:r,gitConfigDir:n}}catch(e){return yn("Failed to resolve git repo with error:",e),{error:e,topLevelDir:null,gitConfigDir:null}}})(n);if(!E)throw u||b.output.push(Zr),b.errors.add(Bs),Pn(b);const A=await Me(["log","-1"],{cwd:E}).then((()=>!0)).catch((()=>!1));b.shouldBackup=A&&h,b.shouldBackup||u||m.warn(((e,t)=>{const r=void 0!==t?"`--diff` was used":e?"`--no-stash` was used":"there\u2019s no initial commit yet";return Ne.Ay.yellow(`${Xr} Skipping backup because ${r}.\n`)})(A,a)),b.shouldHidePartiallyStaged=f,b.shouldHidePartiallyStaged||u||m.warn(((e,t)=>{const r=void 0!==t?"`--diff` was used":e?"`--no-hide-partially-staged` was used":"`--no-stash` was used";return Ne.Ay.yellow(`${Xr} Skipping hiding unstaged changes from partially staged files because ${r}.\n`)})(A&&h,a));const S=await(async({cwd:e=process.cwd(),diff:t,diffFilter:r}={})=>{try{const s=await Me(As(t,r),{cwd:e});return s?Ss(s).map((t=>us(i.resolve(e,t)))):[]}catch{return null}})({cwd:E,diff:a,diffFilter:c});if(!S)throw u||b.output.push(Jr),b.errors.add(Is),Pn(b);if(Ln("Loaded list of staged files in git:\n%O",S),0===S.length)return u||b.output.push(ts),b;const R=await(async({configObject:e,configPath:t,cwd:r=process.cwd(),topLevelDir:s=r},n)=>{if(Tn("Searching for configuration files..."),e)return Tn("Using single direct configuration object..."),{"":vn(e,"config object",n)};if(t){Tn("Using single configuration path...");const{config:e,filepath:r}=await En();return e?{[t]:vn(e,r,n)}:{}}const[o,a]=await Promise.all([Me(On,{cwd:s}).then(Ss),Me([...On,"--others","--exclude-standard"],{cwd:s}).then(Ss)]),c=[...o,...a].flatMap((e=>e.startsWith("S ")?[]:[e.replace(/^[HSMRCK?U] /,"")])).filter(xn).map((e=>us(i.join(s,e)))).filter((l=r,e=>e.startsWith(us(l)))).sort(_n);var l;Tn("Found possible config files:",c);const u=c.reduce(((e,t)=>Object.assign(e,{[t]:null})),{});await Promise.all(Object.keys(u).map((e=>En().then((({config:t,filepath:r})=>{t&&(e!==r&&Tn('Config file "%s" resolved to "%s"',e,r),u[e]=vn(t,r,n))})))));const p=Object.entries(u).filter((([,e])=>!!e)).reduce(((e,[t,r])=>({...e,[t]:r})),{});if(!Object.keys(p).length){Tn('Could not find config files inside "%s"',r);const{config:e,filepath:t}=await En();e?(Tn('Found parent configuration file from "%s"',t),p[t]=vn(e,t,n)):Tn('Could not find parent configuration files from "%s"',r)}return Tn("Found %d config files",Object.keys(p).length),p})({configObject:r,configPath:s,cwd:n,topLevelDir:E},m),C=Object.keys(R).length;if(0===C)throw b.errors.add(ks),Pn(b);const v=await(async({configs:e,files:t,singleConfigMode:r})=>{Qs("Grouping %d files by %d configurations",t.length,Object.keys(e).length);const s=new Set(t),n={};for(const[o,a]of Object.entries(e)){if(r){n[o]={config:a,files:t};break}const e=i.normalize(i.dirname(o)),c=t=>{const r=i.relative(e,t);return r&&!r.startsWith("..")&&!i.isAbsolute(r)},l=Object.keys(a).some((e=>e.startsWith(".."))),u=new Set(l?s:void 0);l||s.forEach((e=>{c(e)&&u.add(e)})),u.forEach((e=>{s.delete(e)})),n[o]={config:a,files:Array.from(u)}}return n})({configs:R,files:S,singleConfigMode:r||void 0!==s}),T=C>1;let O=!1;const x={ctx:b,exitOnError:!1,registerSignalListeners:!1,...ws({debug:o,quiet:u},m)};let k=0;const _=[],L=new Set;for(const[e,{config:r,files:s}]of Object.entries(v)){const o=e?us(i.relative(n,e)):"Config object",a=ds({baseDir:E,files:s,maxArgLength:l,relative:p}),c=T&&!y?i.dirname(e):n,u=a.length;u>1&&Ln("Chunked staged files from `%s` into %d part",e,u);for(const[e,s]of a.entries()){const n=await Promise.all(gs({config:r,cwd:c,files:s,relative:p}).map((e=>mn({commands:e.commands,cwd:c,files:e.fileList,topLevelDir:E,shell:d,verbose:g}).then((t=>{e.fileList.forEach((e=>{const t=i.isAbsolute(e)?e:us(i.join(c,e));L.add(t)})),O=O||t.some((e=>"git add"===e.command));const r=e.fileList.length;return{title:`${e.pattern}${Ne.Ay.dim(` \u2014 ${r} ${1===r?"file":"files"}`)}`,task:async(e,r)=>r.newListr(t,{concurrent:!1,exitOnError:!0}),skip:()=>0===r&&`${e.pattern}${Ne.Ay.dim(" \u2014 no files")}`}})))));k+=n.length,_.push({title:`${o}${Ne.Ay.dim(` \u2014 ${s.length} ${s.length>1?"files":"file"}`)}`+(u>1?Ne.Ay.dim(` (chunk ${e+1}/${u})...`):""),task:(e,r)=>r.newListr(n,{concurrent:t,exitOnError:!0}),skip:()=>b.errors.has($s)?"Skipped because of previous git error.":!!n.every((e=>e.skip()))&&`${o}${Ne.Ay.dim(" \u2014 no tasks to run")}`})}}if(O&&!u&&m.warn(ss),_.every((e=>e.skip())))return u||b.output.push(rs),b;const P=ds({baseDir:n,files:Array.from(L),maxArgLength:l,relative:!1}),I=new Xs({allowEmpty:e,gitConfigDir:w,topLevelDir:E,matchedFileChunks:P,diff:a,diffFilter:c}),$=new Yr([{title:"Preparing lint-staged...",task:e=>I.prepare(e)},{title:"Hiding unstaged changes to partially staged files...",task:e=>I.hideUnstagedChanges(e),enabled:rn},{title:`Running tasks for ${a?"changed":"staged"} files...`,task:(e,r)=>r.newListr(_,{concurrent:t}),skip:()=>_.every((e=>e.skip()))},{title:"Applying modifications from tasks...",task:e=>I.applyModifications(e),skip:sn},{title:"Restoring unstaged changes to partially staged files...",task:e=>I.restoreUnstagedChanges(e),enabled:rn,skip:nn},{title:"Reverting to original state because of errors...",task:e=>I.restoreOriginalState(e),enabled:on,skip:an},{title:"Cleaning up temporary files...",task:e=>I.cleanup(e),enabled:cn,skip:ln}],x);if(Ln("Set max event listeners to the number of tasks: %i",k),b.events.setMaxListeners(k),await $.run(),b.errors.size>0)throw Pn(b);return b},$n=s("lint-staged:validateOptions"),Bn=s("lint-staged"),Fn=()=>{switch(process.platform){case"darwin":return 262144;case"win32":return 8191;default:return 131072}},Dn=async({allowEmpty:e=!1,concurrent:t=!0,config:r,configPath:s,cwd:n,debug:o=!1,diff:a,diffFilter:c,maxArgLength:l=Fn()/2,quiet:u=!1,relative:p=!1,shell:d=!1,stash:h=void 0===a,hidePartiallyStaged:f=h,verbose:g=!1}={},m=console)=>{const y=await Me(["version","--build-options"],{cwd:n});Bn("%s",y);const b={allowEmpty:e,concurrent:t,configObject:r,configPath:s,cwd:n,debug:o,diff:a,diffFilter:c,maxArgLength:l,quiet:u,relative:p,shell:d,stash:h,hidePartiallyStaged:f,verbose:g};await(async(e={},t)=>{if($n("Validating options..."),"string"==typeof e.cwd)try{const t=i.resolve(e.cwd);await Rs.access(t,H.constants.F_OK)}catch(r){throw $n("Failed to validate options: %o",e),t.error(os("cwd",e.cwd,r.message)),Ds}if("string"==typeof e.shell)try{await Rs.access(e.shell,H.constants.X_OK)}catch(r){throw $n("Failed to validate options: %o",e),t.error(os("shell",e.shell,r.message)),Ds}$n("Validated options: %o",e)})(b,m),Bn("Unset GIT_LITERAL_PATHSPECS (was `%s`)",process.env.GIT_LITERAL_PATHSPECS),delete process.env.GIT_LITERAL_PATHSPECS;try{const e=await In(b,m);return Bn("Tasks were executed successfully!"),ls(e,m),!0}catch(e){if(e?.ctx?.errors){const{ctx:t}=e;return t.errors.has(ks)?m.error(es):t.errors.has(xs)?m.warn(as):t.errors.has($s)&&!t.errors.has(Ps)&&(m.error(is),t.shouldBackup&&m.error(" Any lost modifications can be restored from a git stash:\n\n > git stash list\n stash@{0}: automatic lint-staged backup\n > git stash apply --index stash@{0}\n")),ls(t,m),!1}throw e}}},7235:(e,t,r)=>{function s(e={}){const{env:t=process.env,platform:r=process.platform}=e;return"win32"!==r?"PATH":Object.keys(t).reverse().find((e=>"PATH"===e.toUpperCase()))||"Path"}r.d(t,{A:()=>s})},7017:(e,t,r)=>{r.d(t,{cf:()=>p});const s=[];s.push("SIGHUP","SIGINT","SIGTERM"),"win32"!==process.platform&&s.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&s.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const n=e=>!!e&&"object"==typeof e&&"function"==typeof e.removeListener&&"function"==typeof e.emit&&"function"==typeof e.reallyExit&&"function"==typeof e.listeners&&"function"==typeof e.kill&&"number"==typeof e.pid&&"function"==typeof e.on,i=Symbol.for("signal-exit emitter"),o=globalThis,a=Object.defineProperty.bind(Object);class c{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(o[i])return o[i];a(o,i,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){const r=this.listeners[e],s=r.indexOf(t);-1!==s&&(0===s&&1===r.length?r.length=0:r.splice(s,1))}emit(e,t,r){if(this.emitted[e])return!1;this.emitted[e]=!0;let s=!1;for(const n of this.listeners[e])s=!0===n(t,r)||s;return"exit"===e&&(s=this.emit("afterExit",t,r)||s),s}}class l{}const u=globalThis.process,{onExit:p,load:d,unload:h}=(f=n(u)?new class extends l{#e="win32"===u.platform?"SIGINT":"SIGHUP";#t=new c;#r;#s;#n;#i={};#o=!1;constructor(e){super(),this.#r=e,this.#i={};for(const t of s)this.#i[t]=()=>{const r=this.#r.listeners(t);let{count:s}=this.#t;const n=e;if("object"==typeof n.__signal_exit_emitter__&&"number"==typeof n.__signal_exit_emitter__.count&&(s+=n.__signal_exit_emitter__.count),r.length===s){this.unload();const r=this.#t.emit("exit",null,t),s="SIGHUP"===t?this.#e:t;r||e.kill(e.pid,s)}};this.#n=e.reallyExit,this.#s=e.emit}onExit(e,t){if(!n(this.#r))return()=>{};!1===this.#o&&this.load();const r=t?.alwaysLast?"afterExit":"exit";return this.#t.on(r,e),()=>{this.#t.removeListener(r,e),0===this.#t.listeners.exit.length&&0===this.#t.listeners.afterExit.length&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#t.count+=1;for(const e of s)try{const t=this.#i[e];t&&this.#r.on(e,t)}catch(e){}this.#r.emit=(e,...t)=>this.#a(e,...t),this.#r.reallyExit=e=>this.#c(e)}}unload(){this.#o&&(this.#o=!1,s.forEach((e=>{const t=this.#i[e];if(!t)throw new Error("Listener not defined for signal: "+e);try{this.#r.removeListener(e,t)}catch(e){}})),this.#r.emit=this.#s,this.#r.reallyExit=this.#n,this.#t.count-=1)}#c(e){return n(this.#r)?(this.#r.exitCode=e||0,this.#t.emit("exit",this.#r.exitCode,null),this.#n.call(this.#r,this.#r.exitCode)):0}#a(e,...t){const r=this.#s;if("exit"===e&&n(this.#r)){"number"==typeof t[0]&&(this.#r.exitCode=t[0]);const s=r.call(this.#r,e,...t);return this.#t.emit("exit",this.#r.exitCode,null),s}return r.call(this.#r,e,...t)}}(u):new class extends l{onExit(){return()=>{}}load(){}unload(){}},{onExit:(e,t)=>f.onExit(e,t),load:()=>f.load(),unload:()=>f.unload()});var f}};
|
package/dist/441.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const id=441;export const ids=[441];export const modules={5441:(e,t,r)=>{r.d(t,{Ay:()=>
|
|
1
|
+
export const id=441;export const ids=[441];export const modules={5441:(e,t,r)=>{r.d(t,{Ay:()=>N});const n=(e=0)=>t=>`\x1b[${t+e}m`,o=(e=0)=>t=>`\x1b[${38+e};5;${t}m`,i=(e=0)=>(t,r,n)=>`\x1b[${38+e};2;${t};${r};${n}m`,l={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(l.modifier),Object.keys(l.color),Object.keys(l.bgColor);const s=function(){const e=new Map;for(const[t,r]of Object.entries(l)){for(const[t,n]of Object.entries(r))l[t]={open:`\x1b[${n[0]}m`,close:`\x1b[${n[1]}m`},r[t]=l[t],e.set(n[0],n[1]);Object.defineProperty(l,t,{value:r,enumerable:!1})}return Object.defineProperty(l,"codes",{value:e,enumerable:!1}),l.color.close="\x1b[39m",l.bgColor.close="\x1b[49m",l.color.ansi=n(),l.color.ansi256=o(),l.color.ansi16m=i(),l.bgColor.ansi=n(10),l.bgColor.ansi256=o(10),l.bgColor.ansi16m=i(10),Object.defineProperties(l,{rgbToAnsi256:{value:(e,t,r)=>e===t&&t===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value(e){const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[r]=t;3===r.length&&(r=[...r].map((e=>e+e)).join(""));const n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},enumerable:!1},hexToAnsi256:{value:e=>l.rgbToAnsi256(...l.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return e-8+90;let t,r,n;if(e>=232)t=(10*(e-232)+8)/255,r=t,n=t;else{const o=(e-=16)%36;t=Math.floor(e/36)/5,r=Math.floor(o/6)/5,n=o%6/5}const o=2*Math.max(t,r,n);if(0===o)return 30;let i=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(t));return 2===o&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(e,t,r)=>l.ansi256ToAnsi(l.rgbToAnsi256(e,t,r)),enumerable:!1},hexToAnsi:{value:e=>l.ansi256ToAnsi(l.hexToAnsi256(e)),enumerable:!1}}),l}();var c=r(1708),a=r(8161),u=r(7066);function b(e,t=(globalThis.Deno?globalThis.Deno.args:c.argv)){const r=e.startsWith("-")?"":1===e.length?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return-1!==n&&(-1===o||n<o)}const{env:g}=c;let h;function f(e,t={}){return 0!==(r=function(e,{streamIsTTY:t,sniffFlags:r=!0}={}){const n=function(){if("FORCE_COLOR"in g)return"true"===g.FORCE_COLOR?1:"false"===g.FORCE_COLOR?0:0===g.FORCE_COLOR.length?1:Math.min(Number.parseInt(g.FORCE_COLOR,10),3)}();void 0!==n&&(h=n);const o=r?h:n;if(0===o)return 0;if(r){if(b("color=16m")||b("color=full")||b("color=truecolor"))return 3;if(b("color=256"))return 2}if("TF_BUILD"in g&&"AGENT_NAME"in g)return 1;if(e&&!t&&void 0===o)return 0;const i=o||0;if("dumb"===g.TERM)return i;if("win32"===c.platform){const e=a.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in g)return"GITHUB_ACTIONS"in g||"GITEA_ACTIONS"in g?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((e=>e in g))||"codeship"===g.CI_NAME?1:i;if("TEAMCITY_VERSION"in g)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(g.TEAMCITY_VERSION)?1:0;if("truecolor"===g.COLORTERM)return 3;if("xterm-kitty"===g.TERM)return 3;if("TERM_PROGRAM"in g){const e=Number.parseInt((g.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(g.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(g.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(g.TERM)||"COLORTERM"in g?1:i}(e,{streamIsTTY:e&&e.isTTY,...t}))&&{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3};var r}b("no-color")||b("no-colors")||b("color=false")||b("color=never")?h=0:(b("color")||b("colors")||b("color=true")||b("color=always"))&&(h=1);const d={stdout:f({isTTY:u.isatty(1)}),stderr:f({isTTY:u.isatty(2)})};function O(e,t,r){let n=e.indexOf(t);if(-1===n)return e;const o=t.length;let i=0,l="";do{l+=e.slice(i,n)+t+r,i=n+o,n=e.indexOf(t,i)}while(-1!==n);return l+=e.slice(i),l}const{stdout:T,stderr:m}=d,p=Symbol("GENERATOR"),v=Symbol("STYLER"),R=Symbol("IS_EMPTY"),A=["ansi","ansi","ansi256","ansi16m"],y=Object.create(null);function C(e){return(e=>{const t=(...e)=>e.join(" ");return((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const r=T?T.level:0;e.level=void 0===t.level?r:t.level})(t,e),Object.setPrototypeOf(t,C.prototype),t})(e)}Object.setPrototypeOf(C.prototype,Function.prototype);for(const[e,t]of Object.entries(s))y[e]={get(){const r=x(this,B(t.open,t.close,this[v]),this[R]);return Object.defineProperty(this,e,{value:r}),r}};y.visible={get(){const e=x(this,this[v],!0);return Object.defineProperty(this,"visible",{value:e}),e}};const E=(e,t,r,...n)=>"rgb"===e?"ansi16m"===t?s[r].ansi16m(...n):"ansi256"===t?s[r].ansi256(s.rgbToAnsi256(...n)):s[r].ansi(s.rgbToAnsi(...n)):"hex"===e?E("rgb",t,r,...s.hexToRgb(...n)):s[r][e](...n),M=["rgb","hex","ansi256"];for(const e of M)y[e]={get(){const{level:t}=this;return function(...r){const n=B(E(e,A[t],"color",...r),s.color.close,this[v]);return x(this,n,this[R])}}},y["bg"+e[0].toUpperCase()+e.slice(1)]={get(){const{level:t}=this;return function(...r){const n=B(E(e,A[t],"bgColor",...r),s.bgColor.close,this[v]);return x(this,n,this[R])}}};const I=Object.defineProperties((()=>{}),{...y,level:{enumerable:!0,get(){return this[p].level},set(e){this[p].level=e}}}),B=(e,t,r)=>{let n,o;return void 0===r?(n=e,o=t):(n=r.openAll+e,o=t+r.closeAll),{open:e,close:t,openAll:n,closeAll:o,parent:r}},x=(e,t,r)=>{const n=(...e)=>j(n,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(n,I),n[p]=e,n[v]=t,n[R]=r,n},j=(e,t)=>{if(e.level<=0||!t)return e[R]?"":t;let r=e[v];if(void 0===r)return t;const{openAll:n,closeAll:o}=r;if(t.includes("\x1b"))for(;void 0!==r;)t=O(t,r.close,r.open),r=r.parent;const i=t.indexOf("\n");return-1!==i&&(t=function(e,t,r,n){let o=0,i="";do{const l="\r"===e[n-1];i+=e.slice(o,l?n-1:n)+t+(l?"\r\n":"\n")+r,o=n+1,n=e.indexOf("\n",o)}while(-1!==n);return i+=e.slice(o),i}(t,o,n,i)),n+t+o};Object.defineProperties(C.prototype,y);const _=C(),N=(C({level:m?m.level:0}),_)}};
|