@nice-move/cli 0.11.32 → 0.11.34

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.
@@ -0,0 +1,5 @@
1
+ import{t as e}from"./mjs-C5yiOROY.mjs";import{a as t,i as n,n as r,r as i}from"./string-width-CZYiOUJm.mjs";import a from"./wrap-ansi-B8_-Mypk.mjs";import o from"node:process";import s from"node:os";const c=globalThis.window?.document!==void 0;globalThis.process?.versions?.node,globalThis.process?.versions?.bun,globalThis.Deno?.version?.deno,globalThis.process?.versions?.electron,globalThis.navigator?.userAgent?.includes(`jsdom`),typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope,typeof DedicatedWorkerGlobalScope<`u`&&globalThis instanceof DedicatedWorkerGlobalScope,typeof SharedWorkerGlobalScope<`u`&&globalThis instanceof SharedWorkerGlobalScope,typeof ServiceWorkerGlobalScope<`u`&&globalThis instanceof ServiceWorkerGlobalScope;const l=globalThis.navigator?.userAgentData?.platform;l===`macOS`||globalThis.navigator?.platform===`MacIntel`||globalThis.navigator?.userAgent?.includes(` Mac `)===!0||globalThis.process?.platform,l===`Windows`||globalThis.navigator?.platform===`Win32`||globalThis.process?.platform,l===`Linux`||globalThis.navigator?.platform?.startsWith(`Linux`)===!0||globalThis.navigator?.userAgent?.includes(` Linux `)===!0||globalThis.process?.platform,l===`iOS`||globalThis.navigator?.platform===`MacIntel`&&globalThis.navigator?.maxTouchPoints>1||/iPad|iPhone|iPod/.test(globalThis.navigator?.platform),l===`Android`||globalThis.navigator?.platform===`Android`||globalThis.navigator?.userAgent?.includes(` Android `)===!0||globalThis.process?.platform,!c&&o.env.TERM_PROGRAM;const u=!c&&o.platform===`win32`;!c&&(o.env.TERM?.startsWith(`screen`)||o.env.TERM?.startsWith(`tmux`)||o.env.TMUX),c||o.cwd;const d=(e=1)=>`\x1B[`+e+`A`,f=e=>{let t=``;for(let n=0;n<e;n++)t+=p+(n<e-1?d():``);return e&&(t+=`\x1B[G`),t},p=`\x1B[2K`;(()=>{if(c||!u)return!1;let e=s.release().split(`.`),t=Number(e[0]),n=Number(e[2]??0);return t<10||t===10&&n<10586})();const m=(e,t,n,r)=>{if(n===`length`||n===`prototype`||n===`arguments`||n===`caller`)return;let i=Object.getOwnPropertyDescriptor(e,n),a=Object.getOwnPropertyDescriptor(t,n);(h(i,a)||!r)&&Object.defineProperty(e,n,a)},h=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},g=(e,t)=>{let n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},_=(e,t)=>`/* Wrapped ${e}*/\n${t}`,v=Object.getOwnPropertyDescriptor(Function.prototype,`toString`),y=Object.getOwnPropertyDescriptor(Function.prototype.toString,`name`),b=(e,t,n)=>{let r=n===``?``:`with ${n.trim()}() `,i=_.bind(null,r,t.toString());Object.defineProperty(i,"name",y);let{writable:a,enumerable:o,configurable:s}=v;Object.defineProperty(e,"toString",{value:i,writable:a,enumerable:o,configurable:s})};function x(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let r of Reflect.ownKeys(t))m(e,t,r,n);return g(e,t),b(e,t,r),e}const S=/* @__PURE__ */ new WeakMap,C=(e,t={})=>{if(typeof e!=`function`)throw TypeError(`Expected a function`);let n,r=0,i=e.displayName||e.name||`<anonymous>`,a=function(...o){if(S.set(a,++r),r===1)n=e.apply(this,o),e=void 0;else if(t.throw===!0)throw Error(`Function \`${i}\` can only be called once`);return n};return x(a,e),S.set(a,r),a};C.callCount=e=>{if(!S.has(e))throw Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return S.get(e)};const w=o.stderr.isTTY?o.stderr:o.stdout.isTTY?o.stdout:void 0,T=w?C(()=>{e(()=>{w.write(`\x1B[?25h`)},{alwaysLast:!0})}):()=>{};let E=!1;const D={};D.show=(e=o.stderr)=>{e.isTTY&&(E=!1,e.write(`\x1B[?25h`))},D.hide=(e=o.stderr)=>{e.isTTY&&(T(),E=!0,e.write(`\x1B[?25l`))},D.toggle=(e,t)=>{e!==void 0&&(E=e),E?D.show(t):D.hide(t)};function O(e){return Number.isInteger(e)?r(e)||i(e):!1}const k=/* @__PURE__ */ new Set([27,155]),A=`0`.codePointAt(0),j=`9`.codePointAt(0),M=/* @__PURE__ */ new Set,N=/* @__PURE__ */ new Map;for(let[e,n]of t.codes)M.add(t.color.ansi(n)),N.set(t.color.ansi(e),t.color.ansi(n));function P(e){if(M.has(e))return e;if(N.has(e))return N.get(e);e=e.slice(2),e.includes(`;`)&&(e=e[0]+`0`);let n=t.codes.get(Number.parseInt(e,10));return n?t.color.ansi(n):t.reset.open}function F(e){for(let t=0;t<e.length;t++){let n=e.codePointAt(t);if(n>=A&&n<=j)return t}return-1}function I(e,t){e=e.slice(t,t+19);let n=F(e);if(n!==-1){let t=e.indexOf(`m`,n);return t===-1&&(t=e.length),e.slice(0,t+1)}}function L(e,t=1/0){let n=[],r=0,i=0;for(;r<e.length;){let a=e.codePointAt(r);if(k.has(a)){let t=I(e,r);if(t){n.push({type:`ansi`,code:t,endCode:P(t)}),r+=t.length;continue}}let o=O(a),s=String.fromCodePoint(a);if(n.push({type:`character`,value:s,isFullWidth:o}),r+=s.length,i+=o?2:s.length,i>=t)break}return n}function R(e){let n=[];for(let r of e)r.code===t.reset.open?n=[]:M.has(r.code)?n=n.filter(e=>e.endCode!==r.code):(n=n.filter(e=>e.endCode!==r.endCode),n.push(r));return n}function z(e){return R(e).map(({endCode:e})=>e).reverse().join(``)}function B(e,t,n){let r=L(e,n),i=[],a=0,o=``,s=!1;for(let e of r){if(n!==void 0&&a>=n)break;e.type===`ansi`?(i.push(e),s&&(o+=e.code)):(!s&&a>=t&&(s=!0,i=R(i),o=i.map(({code:e})=>e).join(``)),s&&(o+=e.value),a+=e.isFullWidth?2:e.value.length)}return o+=z(i),o}const V=({columns:e=80})=>e,H=(e,t)=>{let r=e.rows??24,i=t.split(`
2
+ `),a=Math.max(0,i.length-r);return a?B(t,n(i.slice(0,a).join(`
3
+ `)).length+1):t};function U(e,{showCursor:t=!1}={}){let n=0,r=V(e),i=``,o=()=>{i=``,r=V(e),n=0},s=(...o)=>{t||D.hide();let s=H(e,o.join(` `)+`
4
+ `),c=V(e);(s!==i||r!==c)&&(i=s,r=c,s=a(s,c,{trim:!1,hard:!0,wordWrap:!1}),e.write(f(n)+s),n=s.split(`
5
+ `).length)};return s.clear=()=>{e.write(f(n)),o()},s.done=()=>{o(),t||D.show()},s}U(o.stdout),U(o.stderr);export{U as createLogUpdate};
@@ -0,0 +1,23 @@
1
+ function e(e={}){let{env:t=process.env,platform:n=process.platform}=e;return n===`win32`?Object.keys(t).reverse().find(e=>e.toUpperCase()===`PATH`)||`Path`:`PATH`}const t=[];t.push(`SIGHUP`,`SIGINT`,`SIGTERM`),process.platform!==`win32`&&t.push(`SIGALRM`,`SIGABRT`,`SIGVTALRM`,`SIGXCPU`,`SIGXFSZ`,`SIGUSR2`,`SIGTRAP`,`SIGSYS`,`SIGQUIT`,`SIGIOT`),process.platform===`linux`&&t.push(`SIGIO`,`SIGPOLL`,`SIGPWR`,`SIGSTKFLT`);const n=e=>!!e&&typeof e==`object`&&typeof e.removeListener==`function`&&typeof e.emit==`function`&&typeof e.reallyExit==`function`&&typeof e.listeners==`function`&&typeof e.kill==`function`&&typeof e.pid==`number`&&typeof e.on==`function`,r=Symbol.for(`signal-exit emitter`),i=globalThis,a=Object.defineProperty.bind(Object);var o=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(i[r])return i[r];a(i,r,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let n=this.listeners[e],r=n.indexOf(t);r!==-1&&
2
+ /* c8 ignore stop */
3
+ (r===0&&n.length===1?n.length=0:n.splice(r,1))}emit(e,t,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let r=!1;for(let i of this.listeners[e])r=i(t,n)===!0||r;return e===`exit`&&(r=this.emit(`afterExit`,t,n)||r),r}},s=class{};const c=e=>({onExit(t,n){return e.onExit(t,n)},load(){return e.load()},unload(){return e.unload()}});var l=class extends s{onExit(){return()=>{}}load(){}unload(){}},u=class extends s{
4
+ /* c8 ignore start */
5
+ #e=d.platform===`win32`?`SIGINT`:`SIGHUP`;
6
+ /* c8 ignore stop */
7
+ #t=new o;#n;#r;#i;#a={};#o=!1;constructor(e){super(),this.#n=e,this.#a={};for(let n of t)this.#a[n]=()=>{let t=this.#n.listeners(n),{count:r}=this.#t,i=e;
8
+ /* c8 ignore stop */
9
+ if(typeof i.__signal_exit_emitter__==`object`&&typeof i.__signal_exit_emitter__.count==`number`&&(r+=i.__signal_exit_emitter__.count),t.length===r){this.unload();let t=this.#t.emit(`exit`,null,n),r=n===`SIGHUP`?this.#e:n;t||e.kill(e.pid,r)}};this.#i=e.reallyExit,this.#r=e.emit}onExit(e,t){
10
+ /* c8 ignore start */
11
+ if(!n(this.#n))return()=>{};
12
+ /* c8 ignore stop */
13
+ this.#o===!1&&this.load();let r=t?.alwaysLast?`afterExit`:`exit`;return this.#t.on(r,e),()=>{this.#t.removeListener(r,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#t.count+=1;for(let e of t)try{let t=this.#a[e];t&&this.#n.on(e,t)}catch{}this.#n.emit=(e,...t)=>this.#c(e,...t),this.#n.reallyExit=e=>this.#s(e)}}unload(){this.#o&&(this.#o=!1,t.forEach(e=>{let t=this.#a[e];
14
+ /* c8 ignore start */
15
+ if(!t)throw Error(`Listener not defined for signal: `+e);
16
+ /* c8 ignore stop */
17
+ try{this.#n.removeListener(e,t)}catch{}
18
+ /* c8 ignore stop */
19
+ }),this.#n.emit=this.#r,this.#n.reallyExit=this.#i,--this.#t.count)}#s(e){return n(this.#n)?(this.#n.exitCode=e||0,this.#t.emit(`exit`,this.#n.exitCode,null),this.#i.call(this.#n,this.#n.exitCode)):0}#c(e,...t){let r=this.#r;if(e===`exit`&&n(this.#n)){typeof t[0]==`number`&&(this.#n.exitCode=t[0]);
20
+ /* c8 ignore start */
21
+ let n=r.call(this.#n,e,...t);
22
+ /* c8 ignore stop */
23
+ return this.#t.emit(`exit`,this.#n.exitCode,null),n}return r.call(this.#n,e,...t)}};const d=globalThis.process,{onExit:f,load:p,unload:m}=c(n(d)?new u(d):new l);export{e as n,f as t};
@@ -1 +1 @@
1
- import{createRequire as e}from"node:module";var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,t)=>{let r={};for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t||n(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},u=(e,r,i)=>(i=e==null?{}:t(a(e)),l(r||!e||!e.__esModule?n(i,`default`,{value:e,enumerable:!0}):i,e)),d=e(import.meta.url);export{u as i,c as n,d as r,s as t};
1
+ import{createRequire as e}from"node:module";var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,t)=>{let r={};for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t||n(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},u=(e,r,i)=>(i=e==null?{}:t(a(e)),l(r||!e||!e.__esModule||!o.call(e,`default`)?n(i,`default`,{value:e,enumerable:!0}):i,e)),d=/* @__PURE__ */ e(import.meta.url);export{u as i,c as n,d as r,s as t};
@@ -0,0 +1 @@
1
+ import{i as e,t}from"./rolldown-runtime-CwYF3Rm8.mjs";const n=(e=0)=>t=>`\u001B[${t+e}m`,r=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,i=(e=0)=>(t,n,r)=>`\u001B[${38+e};2;${t};${n};${r}m`,a={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(a.modifier);const o=Object.keys(a.color),s=Object.keys(a.bgColor);[...o,...s];function c(){let e=/* @__PURE__ */ new Map;for(let[t,n]of Object.entries(a)){for(let[t,r]of Object.entries(n))a[t]={open:`\u001B[${r[0]}m`,close:`\u001B[${r[1]}m`},n[t]=a[t],e.set(r[0],r[1]);Object.defineProperty(a,t,{value:n,enumerable:!1})}return Object.defineProperty(a,"codes",{value:e,enumerable:!1}),a.color.close=`\x1B[39m`,a.bgColor.close=`\x1B[49m`,a.color.ansi=n(),a.color.ansi256=r(),a.color.ansi16m=i(),a.bgColor.ansi=n(10),a.bgColor.ansi256=r(10),a.bgColor.ansi16m=i(10),Object.defineProperties(a,{rgbToAnsi256:{value(e,t,n){return e===t&&t===n?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(n/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>a.rgbToAnsi256(...a.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,r;if(e>=232)t=((e-232)*10+8)/255,n=t,r=t;else{e-=16;let i=e%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}let i=Math.max(t,n,r)*2;if(i===0)return 30;let a=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>a.ansi256ToAnsi(a.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>a.ansi256ToAnsi(a.hexToAnsi256(e)),enumerable:!1}}),a}const l=c();function u({onlyFirst:e=!1}={}){return RegExp(`(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]`,e?void 0:`g`)}const d=u();function f(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes(`\x1B`)&&!e.includes(`›`)?e:e.replace(d,``)}const p=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],m=[12288,12288,65281,65376,65504,65510],h=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],g=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),a=i*2;if(t<e[a])r=i-1;else if(t>e[a+1])n=i+1;else return!0}return!1},_=19968,[v,y]=/* #__PURE__ */ b(h);function b(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];if(_>=i&&_<=a)return[i,a];a-i>n-t&&(t=i,n=a)}return[t,n]}const x=e=>e<161||e>1114109?!1:g(p,e),S=e=>e<12288||e>65510?!1:g(m,e),C=e=>e>=v&&e<=y?!0:e<4352||e>262141?!1:g(h,e);function w(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function T(e,{ambiguousAsWide:t=!1}={}){return w(e),S(e)||C(e)||t&&x(e)?2:1}var E=/* @__PURE__ */ e((/* @__PURE__ */ t(((e,t)=>{t.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g})))(),1);const D=new Intl.Segmenter,O=/^\p{Default_Ignorable_Code_Point}$/u;function k(e,t={}){if(typeof e!=`string`||e.length===0)return 0;let{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t;if(r||(e=f(e)),e.length===0)return 0;let i=0,a={ambiguousAsWide:!n};for(let{segment:t}of D.segment(e)){let e=t.codePointAt(0);if(!(e<=31||e>=127&&e<=159)&&!(e>=8203&&e<=8207||e===65279)&&!(e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071)&&!(e>=55296&&e<=57343)&&!(e>=65024&&e<=65039)&&!O.test(t)){if((0,E.default)().test(t)){i+=2;continue}i+=T(e,a)}}return i}export{l as a,f as i,S as n,C as r,k as t};
@@ -0,0 +1,8 @@
1
+ import{a as e,i as t,t as n}from"./string-width-CZYiOUJm.mjs";const r=/* @__PURE__ */ new Set([`\x1B`,`›`]),i=`]8;;`,a=e=>`${r.values().next().value}[${e}m`,o=e=>`${r.values().next().value}${i}${e}`,s=e=>e.split(` `).map(e=>n(e)),c=(e,a,o)=>{let s=[...a],c=!1,l=!1,u=n(t(e.at(-1)));for(let[t,a]of s.entries()){let d=n(a);if(u+d<=o?e[e.length-1]+=a:(e.push(a),u=0),r.has(a)&&(c=!0,l=s.slice(t+1,t+1+4).join(``)===i),c){l?a===`\x07`&&(c=!1,l=!1):a===`m`&&(c=!1);continue}u+=d,u===o&&t<s.length-1&&(e.push(``),u=0)}!u&&e.at(-1).length>0&&e.length>1&&(e[e.length-2]+=e.pop())},l=e=>{let t=e.split(` `),r=t.length;for(;r>0&&!(n(t[r-1])>0);)r--;return r===t.length?e:t.slice(0,r).join(` `)+t.slice(r).join(``)},u=(t,u,d={})=>{if(d.trim!==!1&&t.trim()===``)return``;let f=``,p,m,h=s(t),g=[``];for(let[e,r]of t.split(` `).entries()){d.trim!==!1&&(g[g.length-1]=g.at(-1).trimStart());let t=n(g.at(-1));if(e!==0&&(t>=u&&(d.wordWrap===!1||d.trim===!1)&&(g.push(``),t=0),(t>0||d.trim===!1)&&(g[g.length-1]+=` `,t++)),d.hard&&h[e]>u){let n=u-t,i=1+Math.floor((h[e]-n-1)/u);Math.floor((h[e]-1)/u)<i&&g.push(``),c(g,r,u);continue}if(t+h[e]>u&&t>0&&h[e]>0){if(d.wordWrap===!1&&t<u){c(g,r,u);continue}g.push(``)}if(t+h[e]>u&&d.wordWrap===!1){c(g,r,u);continue}g[g.length-1]+=r}d.trim!==!1&&(g=g.map(e=>l(e)));let _=g.join(`
2
+ `),v=[..._],y=0;for(let[t,n]of v.entries()){if(f+=n,r.has(n)){let{groups:e}=RegExp(`(?:\\[(?<code>\\d+)m|\\${i}(?<uri>.*))`).exec(_.slice(y))||{groups:{}};if(e.code!==void 0){let t=Number.parseFloat(e.code);p=t===39?void 0:t}else e.uri!==void 0&&(m=e.uri.length===0?void 0:e.uri)}let s=e.codes.get(Number(p));v[t+1]===`
3
+ `?(m&&(f+=o(``)),p&&s&&(f+=a(s))):n===`
4
+ `&&(p&&s&&(f+=a(p)),m&&(f+=o(m))),y+=n.length}return f};function d(e,t,n){return String(e).normalize().replaceAll(`\r
5
+ `,`
6
+ `).split(`
7
+ `).map(e=>u(e,t,n)).join(`
8
+ `)}export{d as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nice-move/cli",
3
- "version": "0.11.32",
3
+ "version": "0.11.34",
4
4
  "description": "Frontend develop helper for frontend development",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -40,14 +40,14 @@
40
40
  "cheetor": "^0.13.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@commitlint/format": "^20.5.0",
44
- "@commitlint/lint": "^20.5.3",
45
- "execa": "^9.6.1",
43
+ "@commitlint/format": "^21.2.3",
44
+ "@commitlint/lint": "^21.2.3",
45
+ "execa": "^10.0.1",
46
46
  "lint-staged": "^15.5.2",
47
47
  "settingz": "^0.2.0"
48
48
  },
49
49
  "engines": {
50
- "node": ">=24.0.0 || ^22.18.0"
50
+ "node": "^24.0.0"
51
51
  },
52
52
  "publishConfig": {
53
53
  "access": "public",
@@ -1,35 +0,0 @@
1
- import{i as e,n as t}from"./chunk-BD7HfmW0.mjs";import{n,t as r}from"./path-key-_mkIRVBk.mjs";import{t as i}from"./mjs-CsQ9gy60.mjs";import{fileURLToPath as a}from"node:url";import{ChildProcess as o,execFile as s,spawn as c,spawnSync as l}from"node:child_process";import{StringDecoder as u}from"node:string_decoder";import{aborted as d,callbackify as f,debuglog as p,inspect as m,promisify as h,stripVTControlCharacters as g}from"node:util";import _,{execArgv as v,execPath as y,hrtime as b,platform as x}from"node:process";import S from"node:tty";import C from"node:path";import{scheduler as w,setImmediate as ee,setTimeout as te}from"node:timers/promises";import{constants as T}from"node:os";import{EventEmitter as ne,addAbortListener as re,on as ie,once as E,setMaxListeners as ae}from"node:events";import{serialize as oe}from"node:v8";import{appendFileSync as se,createReadStream as ce,createWriteStream as le,readFileSync as ue,statSync as de,writeFileSync as fe}from"node:fs";import{finished as D}from"node:stream/promises";import{Duplex as pe,PassThrough as me,Readable as O,Transform as he,Writable as ge,getDefaultHighWaterMark as _e}from"node:stream";import{Buffer as ve}from"node:buffer";function k(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}const ye=(e,t)=>{let n=Se(be(e));if(typeof n!=`string`)throw TypeError(`${t} must be a string or a file URL: ${n}.`);return n},be=e=>xe(e)?e.toString():e,xe=e=>typeof e!=`string`&&e&&Object.getPrototypeOf(e)===String.prototype,Se=e=>e instanceof URL?a(e):e,Ce=(e,t=[],n={})=>{let r=ye(e,`First argument`),[i,a]=k(t)?[[],t]:[t,n];if(!Array.isArray(i))throw TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(e=>typeof e==`object`&&!!e))throw TypeError(`Second argument must be an array of strings: ${i}`);let o=i.map(String),s=o.find(e=>e.includes(`\0`));if(s!==void 0)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${s}`);if(!k(a))throw TypeError(`Last argument must be an options object: ${a}`);return[r,o,a]},{toString:we}=Object.prototype,Te=e=>we.call(e)===`[object ArrayBuffer]`,A=e=>we.call(e)===`[object Uint8Array]`,j=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Ee=new TextEncoder,De=e=>Ee.encode(e),Oe=new TextDecoder,ke=e=>Oe.decode(e),Ae=(e,t)=>je(e,t).join(``),je=(e,t)=>{if(t===`utf8`&&e.every(e=>typeof e==`string`))return e;let n=new u(t),r=e.map(e=>typeof e==`string`?De(e):e).map(e=>n.write(e)),i=n.end();return i===``?r:[...r,i]},Me=e=>e.length===1&&A(e[0])?e[0]:Pe(Ne(e)),Ne=e=>e.map(e=>typeof e==`string`?De(e):e),Pe=e=>{let t=new Uint8Array(Fe(e)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t},Fe=e=>{let t=0;for(let n of e)t+=n.length;return t},Ie=e=>Array.isArray(e)&&Array.isArray(e.raw),Le=(e,t)=>{let n=[];for(let[r,i]of e.entries())n=Re({templates:e,expressions:t,tokens:n,index:r,template:i});if(n.length===0)throw TypeError(`Template script must not be empty`);let[r,...i]=n;return[r,i,{}]},Re=({templates:e,expressions:t,tokens:n,index:r,template:i})=>{if(i===void 0)throw TypeError(`Invalid backslash sequence: ${e.raw[r]}`);let{nextTokens:a,leadingWhitespaces:o,trailingWhitespaces:s}=ze(i,e.raw[r]),c=He(n,a,o);if(r===t.length)return c;let l=t[r];return He(c,Array.isArray(l)?l.map(e=>Ue(e)):[Ue(l)],s)},ze=(e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let n=[],r=0,i=Be.has(t[0]);for(let i=0,a=0;i<e.length;i+=1,a+=1){let o=t[a];if(Be.has(o))r!==i&&n.push(e.slice(r,i)),r=i+1;else if(o===`\\`){let e=t[a+1];e===`
2
- `?(--i,a+=1):e===`u`&&t[a+2]===`{`?a=t.indexOf(`}`,a+3):a+=Ve[e]??1}}let a=r===e.length;return a||n.push(e.slice(r)),{nextTokens:n,leadingWhitespaces:i,trailingWhitespaces:a}},Be=new Set([` `,` `,`\r`,`
3
- `]),Ve={x:3,u:5},He=(e,t,n)=>n||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],Ue=e=>{let t=typeof e;if(t===`string`)return e;if(t===`number`)return String(e);if(k(e)&&(`stdout`in e||`isMaxBuffer`in e))return We(e);throw e instanceof o||Object.prototype.toString.call(e)===`[object Promise]`?TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):TypeError(`Unexpected "${t}" in template expression`)},We=({stdout:e})=>{if(typeof e==`string`)return e;if(A(e))return ke(e);throw TypeError(e===void 0?`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`:`Unexpected "${typeof e}" stdout in template expression`)},M=e=>Ge.includes(e),Ge=[_.stdin,_.stdout,_.stderr],N=[`stdin`,`stdout`,`stderr`],Ke=e=>N[e]??`stdio[${e}]`,qe=e=>{let t={...e};for(let n of at)t[n]=Je(e,n);return t},Je=(e,t)=>{let n=Array.from({length:Ye(e)+1});return rt(Xe(e[t],n,t),t)},Ye=({stdio:e})=>Array.isArray(e)?Math.max(e.length,N.length):N.length,Xe=(e,t,n)=>k(e)?Ze(e,t,n):t.fill(e),Ze=(e,t,n)=>{for(let r of Object.keys(e).sort(Qe))for(let i of et(r,n,t))t[i]=e[r];return t},Qe=(e,t)=>$e(e)<$e(t)?1:-1,$e=e=>e===`stdout`||e===`stderr`?0:e===`all`?2:1,et=(e,t,n)=>{if(e===`ipc`)return[n.length-1];let r=tt(e);if(r===void 0||r===0)throw TypeError(`"${t}.${e}" is invalid.
4
- It must be "${t}.stdout", "${t}.stderr", "${t}.all", "${t}.ipc", or "${t}.fd3", "${t}.fd4" (and so on).`);if(r>=n.length)throw TypeError(`"${t}.${e}" is invalid: that file descriptor does not exist.
5
- Please set the "stdio" option to ensure that file descriptor exists.`);return r===`all`?[1,2]:[r]},tt=e=>{if(e===`all`)return e;if(N.includes(e))return N.indexOf(e);let t=nt.exec(e);if(t!==null)return Number(t[1])},nt=/^fd(\d+)$/,rt=(e,t)=>e.map(e=>e===void 0?it[t]:e),it={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:p(`execa`).enabled?`full`:`none`,stripFinalNewline:!0},at=[`lines`,`buffer`,`maxBuffer`,`verbose`,`stripFinalNewline`],ot=(e,t)=>t===`ipc`?e.at(-1):e[t],st=({verbose:e},t)=>ut(e,t)!==`none`,ct=({verbose:e},t)=>![`none`,`short`].includes(ut(e,t)),lt=({verbose:e},t)=>{let n=ut(e,t);return ft(n)?n:void 0},ut=(e,t)=>t===void 0?dt(e):ot(e,t),dt=e=>e.find(e=>ft(e))??pt.findLast(t=>e.includes(t)),ft=e=>typeof e==`function`,pt=[`none`,`short`,`full`],mt=(e,t)=>{let n=[e,...t];return{command:n.join(` `),escapedCommand:n.map(e=>xt(gt(e))).join(` `)}},ht=e=>g(e).split(`
6
- `).map(e=>gt(e)).join(`
7
- `),gt=e=>e.replaceAll(vt,e=>_t(e)),_t=e=>{let t=yt[e];if(t!==void 0)return t;let n=e.codePointAt(0),r=n.toString(16);return n<=bt?`\\u${r.padStart(4,`0`)}`:`\\U${r}`},vt=(()=>{try{return RegExp(`\\p{Separator}|\\p{Other}`,`gu`)}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}})(),yt={" ":` `,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`},bt=65535,xt=e=>St.test(e)?e:x===`win32`?`"${e.replaceAll(`"`,`""`)}"`:`'${e.replaceAll(`'`,`'\\''`)}'`,St=/^[\w./-]+$/;function Ct(){let{env:e}=_,{TERM:t,TERM_PROGRAM:n}=e;return _.platform===`win32`?!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask===`{cmd::Cmder}`||n===`Terminus-Sublime`||n===`vscode`||t===`xterm-256color`||t===`alacritty`||t===`rxvt-unicode`||t===`rxvt-unicode-256color`||e.TERMINAL_EMULATOR===`JetBrains-JediTerm`:t!==`linux`}const wt={circleQuestionMark:`(?)`,questionMarkPrefix:`(?)`,square:`█`,squareDarkShade:`▓`,squareMediumShade:`▒`,squareLightShade:`░`,squareTop:`▀`,squareBottom:`▄`,squareLeft:`▌`,squareRight:`▐`,squareCenter:`■`,bullet:`●`,dot:`․`,ellipsis:`…`,pointerSmall:`›`,triangleUp:`▲`,triangleUpSmall:`▴`,triangleDown:`▼`,triangleDownSmall:`▾`,triangleLeftSmall:`◂`,triangleRightSmall:`▸`,home:`⌂`,heart:`♥`,musicNote:`♪`,musicNoteBeamed:`♫`,arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,arrowLeftRight:`↔`,arrowUpDown:`↕`,almostEqual:`≈`,notEqual:`≠`,lessOrEqual:`≤`,greaterOrEqual:`≥`,identical:`≡`,infinity:`∞`,subscriptZero:`₀`,subscriptOne:`₁`,subscriptTwo:`₂`,subscriptThree:`₃`,subscriptFour:`₄`,subscriptFive:`₅`,subscriptSix:`₆`,subscriptSeven:`₇`,subscriptEight:`₈`,subscriptNine:`₉`,oneHalf:`½`,oneThird:`⅓`,oneQuarter:`¼`,oneFifth:`⅕`,oneSixth:`⅙`,oneEighth:`⅛`,twoThirds:`⅔`,twoFifths:`⅖`,threeQuarters:`¾`,threeFifths:`⅗`,threeEighths:`⅜`,fourFifths:`⅘`,fiveSixths:`⅚`,fiveEighths:`⅝`,sevenEighths:`⅞`,line:`─`,lineBold:`━`,lineDouble:`═`,lineDashed0:`┄`,lineDashed1:`┅`,lineDashed2:`┈`,lineDashed3:`┉`,lineDashed4:`╌`,lineDashed5:`╍`,lineDashed6:`╴`,lineDashed7:`╶`,lineDashed8:`╸`,lineDashed9:`╺`,lineDashed10:`╼`,lineDashed11:`╾`,lineDashed12:`−`,lineDashed13:`–`,lineDashed14:`‐`,lineDashed15:`⁃`,lineVertical:`│`,lineVerticalBold:`┃`,lineVerticalDouble:`║`,lineVerticalDashed0:`┆`,lineVerticalDashed1:`┇`,lineVerticalDashed2:`┊`,lineVerticalDashed3:`┋`,lineVerticalDashed4:`╎`,lineVerticalDashed5:`╏`,lineVerticalDashed6:`╵`,lineVerticalDashed7:`╷`,lineVerticalDashed8:`╹`,lineVerticalDashed9:`╻`,lineVerticalDashed10:`╽`,lineVerticalDashed11:`╿`,lineDownLeft:`┐`,lineDownLeftArc:`╮`,lineDownBoldLeftBold:`┓`,lineDownBoldLeft:`┒`,lineDownLeftBold:`┑`,lineDownDoubleLeftDouble:`╗`,lineDownDoubleLeft:`╖`,lineDownLeftDouble:`╕`,lineDownRight:`┌`,lineDownRightArc:`╭`,lineDownBoldRightBold:`┏`,lineDownBoldRight:`┎`,lineDownRightBold:`┍`,lineDownDoubleRightDouble:`╔`,lineDownDoubleRight:`╓`,lineDownRightDouble:`╒`,lineUpLeft:`┘`,lineUpLeftArc:`╯`,lineUpBoldLeftBold:`┛`,lineUpBoldLeft:`┚`,lineUpLeftBold:`┙`,lineUpDoubleLeftDouble:`╝`,lineUpDoubleLeft:`╜`,lineUpLeftDouble:`╛`,lineUpRight:`└`,lineUpRightArc:`╰`,lineUpBoldRightBold:`┗`,lineUpBoldRight:`┖`,lineUpRightBold:`┕`,lineUpDoubleRightDouble:`╚`,lineUpDoubleRight:`╙`,lineUpRightDouble:`╘`,lineUpDownLeft:`┤`,lineUpBoldDownBoldLeftBold:`┫`,lineUpBoldDownBoldLeft:`┨`,lineUpDownLeftBold:`┥`,lineUpBoldDownLeftBold:`┩`,lineUpDownBoldLeftBold:`┪`,lineUpDownBoldLeft:`┧`,lineUpBoldDownLeft:`┦`,lineUpDoubleDownDoubleLeftDouble:`╣`,lineUpDoubleDownDoubleLeft:`╢`,lineUpDownLeftDouble:`╡`,lineUpDownRight:`├`,lineUpBoldDownBoldRightBold:`┣`,lineUpBoldDownBoldRight:`┠`,lineUpDownRightBold:`┝`,lineUpBoldDownRightBold:`┡`,lineUpDownBoldRightBold:`┢`,lineUpDownBoldRight:`┟`,lineUpBoldDownRight:`┞`,lineUpDoubleDownDoubleRightDouble:`╠`,lineUpDoubleDownDoubleRight:`╟`,lineUpDownRightDouble:`╞`,lineDownLeftRight:`┬`,lineDownBoldLeftBoldRightBold:`┳`,lineDownLeftBoldRightBold:`┯`,lineDownBoldLeftRight:`┰`,lineDownBoldLeftBoldRight:`┱`,lineDownBoldLeftRightBold:`┲`,lineDownLeftRightBold:`┮`,lineDownLeftBoldRight:`┭`,lineDownDoubleLeftDoubleRightDouble:`╦`,lineDownDoubleLeftRight:`╥`,lineDownLeftDoubleRightDouble:`╤`,lineUpLeftRight:`┴`,lineUpBoldLeftBoldRightBold:`┻`,lineUpLeftBoldRightBold:`┷`,lineUpBoldLeftRight:`┸`,lineUpBoldLeftBoldRight:`┹`,lineUpBoldLeftRightBold:`┺`,lineUpLeftRightBold:`┶`,lineUpLeftBoldRight:`┵`,lineUpDoubleLeftDoubleRightDouble:`╩`,lineUpDoubleLeftRight:`╨`,lineUpLeftDoubleRightDouble:`╧`,lineUpDownLeftRight:`┼`,lineUpBoldDownBoldLeftBoldRightBold:`╋`,lineUpDownBoldLeftBoldRightBold:`╈`,lineUpBoldDownLeftBoldRightBold:`╇`,lineUpBoldDownBoldLeftRightBold:`╊`,lineUpBoldDownBoldLeftBoldRight:`╉`,lineUpBoldDownLeftRight:`╀`,lineUpDownBoldLeftRight:`╁`,lineUpDownLeftBoldRight:`┽`,lineUpDownLeftRightBold:`┾`,lineUpBoldDownBoldLeftRight:`╂`,lineUpDownLeftBoldRightBold:`┿`,lineUpBoldDownLeftBoldRight:`╃`,lineUpBoldDownLeftRightBold:`╄`,lineUpDownBoldLeftBoldRight:`╅`,lineUpDownBoldLeftRightBold:`╆`,lineUpDoubleDownDoubleLeftDoubleRightDouble:`╬`,lineUpDoubleDownDoubleLeftRight:`╫`,lineUpDownLeftDoubleRightDouble:`╪`,lineCross:`╳`,lineBackslash:`╲`,lineSlash:`╱`},Tt={tick:`✔`,info:`ℹ`,warning:`⚠`,cross:`✘`,squareSmall:`◻`,squareSmallFilled:`◼`,circle:`◯`,circleFilled:`◉`,circleDotted:`◌`,circleDouble:`◎`,circleCircle:`ⓞ`,circleCross:`ⓧ`,circlePipe:`Ⓘ`,radioOn:`◉`,radioOff:`◯`,checkboxOn:`☒`,checkboxOff:`☐`,checkboxCircleOn:`ⓧ`,checkboxCircleOff:`Ⓘ`,pointer:`❯`,triangleUpOutline:`△`,triangleLeft:`◀`,triangleRight:`▶`,lozenge:`◆`,lozengeOutline:`◇`,hamburger:`☰`,smiley:`㋡`,mustache:`෴`,star:`★`,play:`▶`,nodejs:`⬢`,oneSeventh:`⅐`,oneNinth:`⅑`,oneTenth:`⅒`},Et={tick:`√`,info:`i`,warning:`‼`,cross:`×`,squareSmall:`□`,squareSmallFilled:`■`,circle:`( )`,circleFilled:`(*)`,circleDotted:`( )`,circleDouble:`( )`,circleCircle:`(○)`,circleCross:`(×)`,circlePipe:`(│)`,radioOn:`(*)`,radioOff:`( )`,checkboxOn:`[×]`,checkboxOff:`[ ]`,checkboxCircleOn:`(×)`,checkboxCircleOff:`( )`,pointer:`>`,triangleUpOutline:`∆`,triangleLeft:`◄`,triangleRight:`►`,lozenge:`♦`,lozengeOutline:`◊`,hamburger:`≡`,smiley:`☺`,mustache:`┌─┐`,star:`✶`,play:`►`,nodejs:`♦`,oneSeventh:`1/7`,oneNinth:`1/9`,oneTenth:`1/10`},Dt={...wt,...Tt},Ot={...wt,...Et},kt=Ct()?Dt:Ot;Object.entries(Tt);const At=S?.WriteStream?.prototype?.hasColors?.()??!1,P=(e,t)=>{if(!At)return e=>e;let n=`\u001B[${e}m`,r=`\u001B[${t}m`;return e=>{let i=e+``,a=i.indexOf(r);if(a===-1)return n+i+r;let o=n,s=0,c=(t===22?r:``)+n;for(;a!==-1;)o+=i.slice(s,a)+c,s=a+r.length,a=i.indexOf(r,s);return o+=i.slice(s)+r,o}};P(0,0);const jt=P(1,22);P(2,22),P(3,23),P(4,24),P(53,55),P(7,27),P(8,28),P(9,29),P(30,39),P(31,39),P(32,39),P(33,39),P(34,39),P(35,39),P(36,39),P(37,39);const Mt=P(90,39);P(40,49),P(41,49),P(42,49),P(43,49),P(44,49),P(45,49),P(46,49),P(47,49),P(100,49);const Nt=P(91,39);P(92,39);const Pt=P(93,39);P(94,39),P(95,39),P(96,39),P(97,39),P(101,49),P(102,49),P(103,49),P(104,49),P(105,49),P(106,49),P(107,49);const Ft=({type:e,message:t,timestamp:n,piped:r,commandId:i,result:{failed:a=!1}={},options:{reject:o=!0}})=>{let s=It(n),c=zt[e]({failed:a,reject:o,piped:r}),l=Vt[e]({reject:o});return`${Mt(`[${s}]`)} ${Mt(`[${i}]`)} ${l(c)} ${l(t)}`},It=e=>`${Lt(e.getHours(),2)}:${Lt(e.getMinutes(),2)}:${Lt(e.getSeconds(),2)}.${Lt(e.getMilliseconds(),3)}`,Lt=(e,t)=>String(e).padStart(t,`0`),Rt=({failed:e,reject:t})=>e?t?kt.cross:kt.warning:kt.tick,zt={command:({piped:e})=>e?`|`:`$`,output:()=>` `,ipc:()=>`*`,error:Rt,duration:Rt},Bt=e=>e,Vt={command:()=>jt,output:()=>Bt,ipc:()=>Bt,error:({reject:e})=>e?Nt:Pt,duration:()=>Mt},Ht=(e,t,n)=>{let r=lt(t,n);return e.map(({verboseLine:e,verboseObject:t})=>Ut(e,t,r)).filter(e=>e!==void 0).map(e=>Wt(e)).join(``)},Ut=(e,t,n)=>{if(n===void 0)return e;let r=n(e,t);if(typeof r==`string`)return r},Wt=e=>e.endsWith(`
8
- `)?e:`${e}\n`,F=({type:e,verboseMessage:t,fdNumber:n,verboseInfo:r,result:i})=>{let a=Ht(Kt(t,Gt({type:e,result:i,verboseInfo:r})),r,n);a!==``&&console.warn(a.slice(0,-1))},Gt=({type:e,result:t,verboseInfo:{escapedCommand:n,commandId:r,rawOptions:{piped:i=!1,...a}}})=>({type:e,escapedCommand:n,commandId:`${r}`,timestamp:new Date,piped:i,result:t,options:a}),Kt=(e,t)=>e.split(`
9
- `).map(e=>qt({...t,message:e})),qt=e=>({verboseLine:Ft(e),verboseObject:e}),Jt=e=>ht(typeof e==`string`?e:m(e)).replaceAll(` `,` `.repeat(Yt)),Yt=2,Xt=(e,t)=>{st(t)&&F({type:`command`,verboseMessage:e,verboseInfo:t})},Zt=(e,t,n)=>(en(e),{verbose:e,escapedCommand:t,commandId:Qt(e),rawOptions:n}),Qt=e=>st({verbose:e})?$t++:void 0;let $t=0n;const en=e=>{for(let t of e){if(t===!1)throw TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(t===!0)throw TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!pt.includes(t)&&!ft(t)){let e=pt.map(e=>`'${e}'`).join(`, `);throw TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${e} or a function.`)}}},tn=()=>b.bigint(),nn=e=>Number(b.bigint()-e)/1e6,rn=(e,t,n)=>{let r=tn(),{command:i,escapedCommand:a}=mt(e,t),o=Zt(Je(n,`verbose`),a,{...n});return Xt(a,o),{command:i,escapedCommand:a,startTime:r,verboseInfo:o}};var an=e(n(),1);h(s);function on(e){return e instanceof URL?a(e):e}function sn(e){return{*[Symbol.iterator](){let t=C.resolve(on(e)),n;for(;n!==t;)yield t,n=t,t=C.resolve(t,`..`)}}}const cn=({cwd:e=_.cwd(),path:t=_.env[r()],preferLocal:n=!0,execPath:i=_.execPath,addExecPath:a=!0}={})=>{let o=C.resolve(on(e)),s=[],c=t.split(C.delimiter);return n&&ln(s,c,o),a&&un(s,c,i,o),t===``||t===C.delimiter?`${s.join(C.delimiter)}${t}`:[...s,t].join(C.delimiter)},ln=(e,t,n)=>{for(let r of sn(n)){let n=C.join(r,`node_modules/.bin`);t.includes(n)||e.push(n)}},un=(e,t,n,r)=>{let i=C.resolve(r,on(n),`..`);t.includes(i)||e.push(i)},dn=({env:e=_.env,...t}={})=>{e={...e};let n=r({env:e});return t.path=e[n],e[n]=cn(t),e},fn=(e,t,n)=>new(n?vn:_n)(t,e instanceof I?{}:{cause:e});var I=class extends Error{};const pn=(e,t)=>{Object.defineProperty(e.prototype,`name`,{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,hn,{value:!0,writable:!1,enumerable:!1,configurable:!1})},mn=e=>gn(e)&&hn in e,hn=Symbol(`isExecaError`),gn=e=>Object.prototype.toString.call(e)===`[object Error]`;var _n=class extends Error{};pn(_n,_n.name);var vn=class extends Error{};pn(vn,vn.name);const yn=()=>{let e=64-xn+1;return Array.from({length:e},bn)},bn=(e,t)=>({name:`SIGRT${t+1}`,number:xn+t,action:`terminate`,description:`Application-specific signal (realtime)`,standard:`posix`}),xn=34,Sn=[{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`}],Cn=()=>{let e=yn();return[...Sn,...e].map(wn)},wn=({name:e,number:t,description:n,action:r,forced:i=!1,standard:a})=>{let{signals:{[e]:o}}=T,s=o!==void 0;return{name:e,number:s?o:t,description:n,supported:s,action:r,forced:i,standard:a}},Tn=()=>{let e=Cn();return Object.fromEntries(e.map(En))},En=({name:e,number:t,description:n,supported:r,action:i,forced:a,standard:o})=>[e,{name:e,number:t,description:n,supported:r,action:i,forced:a,standard:o}],Dn=Tn(),On=()=>{let e=Cn(),t=Array.from({length:65},(t,n)=>kn(n,e));return Object.assign({},...t)},kn=(e,t)=>{let n=An(e,t);if(n===void 0)return{};let{name:r,description:i,supported:a,action:o,forced:s,standard:c}=n;return{[e]:{name:r,number:e,description:i,supported:a,action:o,forced:s,standard:c}}},An=(e,t)=>{let n=t.find(({name:t})=>T.signals[t]===e);return n===void 0?t.find(t=>t.number===e):n};On();const jn=e=>{let t="option `killSignal`";if(e===0)throw TypeError(`Invalid ${t}: 0 cannot be used.`);return Nn(e,t)},Mn=e=>e===0?e:Nn(e,"`subprocess.kill()`'s argument"),Nn=(e,t)=>{if(Number.isInteger(e))return Pn(e,t);if(typeof e==`string`)return In(e,t);throw TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.\n${Ln()}`)},Pn=(e,t)=>{if(Fn.has(e))return Fn.get(e);throw TypeError(`Invalid ${t} ${e}: this signal integer does not exist.\n${Ln()}`)},Fn=new Map(Object.entries(T.signals).reverse().map(([e,t])=>[t,e])),In=(e,t)=>{if(e in T.signals)return e;throw e.toUpperCase()in T.signals?TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`):TypeError(`Invalid ${t} '${e}': this signal name does not exist.\n${Ln()}`)},Ln=()=>`Available signal names: ${Rn()}.
10
- Available signal numbers: ${zn()}.`,Rn=()=>Object.keys(T.signals).sort().map(e=>`'${e}'`).join(`, `),zn=()=>[...new Set(Object.values(T.signals).sort((e,t)=>e-t))].join(`, `),Bn=e=>Dn[e].description,Vn=e=>{if(e===!1)return e;if(e===!0)return Hn;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Hn=1e3*5,Un=({kill:e,options:{forceKillAfterDelay:t,killSignal:n},onInternalError:r,context:i,controller:a},o,s)=>{let{signal:c,error:l}=Wn(o,s,n);Gn(l,r);let u=e(c);return Kn({kill:e,signal:c,forceKillAfterDelay:t,killSignal:n,killResult:u,context:i,controller:a}),u},Wn=(e,t,n)=>{let[r=n,i]=gn(e)?[void 0,e]:[e,t];if(typeof r!=`string`&&!Number.isInteger(r))throw TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(r)}`);if(i!==void 0&&!gn(i))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:Mn(r),error:i}},Gn=(e,t)=>{e!==void 0&&t.reject(e)},Kn=async({kill:e,signal:t,forceKillAfterDelay:n,killSignal:r,killResult:i,context:a,controller:o})=>{t===r&&i&&qn({kill:e,forceKillAfterDelay:n,context:a,controllerSignal:o.signal})},qn=async({kill:e,forceKillAfterDelay:t,context:n,controllerSignal:r})=>{if(t!==!1)try{await te(t,void 0,{signal:r}),e(`SIGKILL`)&&(n.isForcefullyTerminated??=!0)}catch{}},Jn=async(e,t)=>{e.aborted||await E(e,`abort`,{signal:t})},Yn=({cancelSignal:e})=>{if(e!==void 0&&Object.prototype.toString.call(e)!==`[object AbortSignal]`)throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)},Xn=({subprocess:e,cancelSignal:t,gracefulCancel:n,context:r,controller:i})=>t===void 0||n?[]:[Zn(e,t,r,i)],Zn=async(e,t,n,{signal:r})=>{throw await Jn(t,r),n.terminationReason??=`cancel`,e.kill(),t.reason},Qn=({methodName:e,isSubprocess:t,ipc:n,isConnected:r})=>{$n(e,t,n),er(e,t,r)},$n=(e,t,n)=>{if(!n)throw Error(`${L(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},er=(e,t,n)=>{if(!n)throw Error(`${L(e,t)} cannot be used: the ${R(t)} has already exited or disconnected.`)},tr=e=>{throw Error(`${L(`getOneMessage`,e)} could not complete: the ${R(e)} exited or disconnected.`)},nr=e=>{throw Error(`${L(`sendMessage`,e)} failed: the ${R(e)} is sending a message too, instead of listening to incoming messages.
11
- This can be fixed by both sending a message and listening to incoming messages at the same time:
12
-
13
- const [receivedMessage] = await Promise.all([
14
- ${L(`getOneMessage`,e)},
15
- ${L(`sendMessage`,e,`message, {strict: true}`)},
16
- ]);`)},rr=(e,t)=>Error(`${L(`sendMessage`,t)} failed when sending an acknowledgment response to the ${R(t)}.`,{cause:e}),ir=e=>{throw Error(`${L(`sendMessage`,e)} failed: the ${R(e)} is not listening to incoming messages.`)},ar=e=>{throw Error(`${L(`sendMessage`,e)} failed: the ${R(e)} exited without listening to incoming messages.`)},or=()=>Error(`\`cancelSignal\` aborted: the ${R(!0)} disconnected.`),sr=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},cr=({error:e,methodName:t,isSubprocess:n})=>{if(e.code===`EPIPE`)throw Error(`${L(t,n)} cannot be used: the ${R(n)} is disconnecting.`,{cause:e})},lr=({error:e,methodName:t,isSubprocess:n,message:r})=>{if(ur(e))throw Error(`${L(t,n)}'s argument type is invalid: the message cannot be serialized: ${String(r)}.`,{cause:e})},ur=({code:e,message:t})=>dr.has(e)||fr.some(e=>t.includes(e)),dr=new Set([`ERR_MISSING_ARGS`,`ERR_INVALID_ARG_TYPE`]),fr=[`could not be cloned`,`circular structure`,`call stack size exceeded`],L=(e,t,n=``)=>e===`cancelSignal`?"`cancelSignal`'s `controller.abort()`":`${pr(t)}${e}(${n})`,pr=e=>e?``:`subprocess.`,R=e=>e?`parent process`:`subprocess`,mr=e=>{e.connected&&e.disconnect()},hr=()=>{let e={},t=new Promise((t,n)=>{Object.assign(e,{resolve:t,reject:n})});return Object.assign(t,e)},gr=(e,t=`stdin`)=>{let{options:n,fileDescriptors:r}=z.get(e),i=vr(r,t,!0),a=e.stdio[i];if(a===null)throw TypeError(xr(i,t,n,!0));return a},_r=(e,t=`stdout`)=>{let{options:n,fileDescriptors:r}=z.get(e),i=vr(r,t,!1),a=i===`all`?e.all:e.stdio[i];if(a==null)throw TypeError(xr(i,t,n,!1));return a},z=new WeakMap,vr=(e,t,n)=>{let r=yr(t,n);return br(r,t,n,e),r},yr=(e,t)=>{let n=tt(e);if(n!==void 0)return n;let{validOptions:r,defaultValue:i}=t?{validOptions:`"stdin"`,defaultValue:`stdin`}:{validOptions:`"stdout", "stderr", "all"`,defaultValue:`stdout`};throw TypeError(`"${B(t)}" must not be "${e}".
17
- It must be ${r} or "fd3", "fd4" (and so on).
18
- It is optional and defaults to "${i}".`)},br=(e,t,n,r)=>{let i=r[Cr(e)];if(i===void 0)throw TypeError(`"${B(n)}" must not be ${t}. That file descriptor does not exist.
19
- Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction===`input`&&!n)throw TypeError(`"${B(n)}" must not be ${t}. It must be a readable stream, not writable.`);if(i.direction!==`input`&&n)throw TypeError(`"${B(n)}" must not be ${t}. It must be a writable stream, not readable.`)},xr=(e,t,n,r)=>{if(e===`all`&&!n.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:i,optionValue:a}=Sr(e,n);return`The "${i}: ${wr(a)}" option is incompatible with using "${B(r)}: ${wr(t)}".
20
- Please set this option with "pipe" instead.`},Sr=(e,{stdin:t,stdout:n,stderr:r,stdio:i})=>{let a=Cr(e);return a===0&&t!==void 0?{optionName:`stdin`,optionValue:t}:a===1&&n!==void 0?{optionName:`stdout`,optionValue:n}:a===2&&r!==void 0?{optionName:`stderr`,optionValue:r}:{optionName:`stdio[${a}]`,optionValue:i[a]}},Cr=e=>e===`all`?1:e,B=e=>e?`to`:`from`,wr=e=>typeof e==`string`?`'${e}'`:typeof e==`number`?`${e}`:`Stream`,Tr=(e,t,n)=>{let r=e.getMaxListeners();r===0||r===1/0||(e.setMaxListeners(r+t),re(n,()=>{e.setMaxListeners(e.getMaxListeners()-t)}))},Er=(e,t)=>{t&&Dr(e)},Dr=e=>{e.refCounted()},Or=(e,t)=>{t&&kr(e)},kr=e=>{e.unrefCounted()},Ar=(e,t)=>{t&&(kr(e),kr(e))},jr=(e,t)=>{t&&(Dr(e),Dr(e))},Mr=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r},i)=>{if(Ur(i)||li(i))return;Pr.has(e)||Pr.set(e,[]);let a=Pr.get(e);if(a.push(i),!(a.length>1))for(;a.length>0;){await Zr(e,r,i),await w.yield();let o=await Hr({wrappedMessage:a[0],anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r});a.shift(),r.emit(`message`,o),r.emit(`message:done`)}},Nr=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r,boundOnMessage:i})=>{di();let a=Pr.get(e);for(;a?.length>0;)await E(r,`message:done`);e.removeListener(`message`,i),jr(t,n),r.connected=!1,r.emit(`disconnect`)},Pr=new WeakMap,Fr=(e,t,n)=>{if(Ir.has(e))return Ir.get(e);let r=new ne;return r.connected=!0,Ir.set(e,r),Lr({ipcEmitter:r,anyProcess:e,channel:t,isSubprocess:n}),r},Ir=new WeakMap,Lr=({ipcEmitter:e,anyProcess:t,channel:n,isSubprocess:r})=>{let i=Mr.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e});t.on(`message`,i),t.once(`disconnect`,Nr.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e,boundOnMessage:i})),Ar(n,r)},Rr=e=>{let t=Ir.get(e);return t===void 0?e.channel!==null:t.connected},zr=({anyProcess:e,channel:t,isSubprocess:n,message:r,strict:i})=>{if(!i)return r;let a=Qr(e,Fr(e,t,n));return{id:Br++,type:qr,message:r,hasListeners:a}};let Br=0n;const Vr=(e,t)=>{if(!(t?.type!==qr||t.hasListeners))for(let{id:t}of e)t!==void 0&&Gr[t].resolve({isDeadlock:!0,hasListeners:!1})},Hr=async({wrappedMessage:e,anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:i})=>{if(e?.type!==qr||!t.connected)return e;let{id:a,message:o}=e,s={id:a,type:Jr,message:Qr(t,i)};try{await ei({anyProcess:t,channel:n,isSubprocess:r,ipc:!0},s)}catch(e){i.emit(`strict:error`,e)}return o},Ur=e=>{if(e?.type!==Jr)return!1;let{id:t,message:n}=e;return Gr[t]?.resolve({isDeadlock:!1,hasListeners:n}),!0},Wr=async(e,t,n)=>{if(e?.type!==qr)return;let r=hr();Gr[e.id]=r;let i=new AbortController;try{let{isDeadlock:e,hasListeners:a}=await Promise.race([r,Kr(t,n,i)]);e&&nr(n),a||ir(n)}finally{i.abort(),delete Gr[e.id]}},Gr={},Kr=async(e,t,{signal:n})=>{Tr(e,1,n),await E(e,`disconnect`,{signal:n}),ar(t)},qr=`execa:ipc:request`,Jr=`execa:ipc:response`,Yr=(e,t,n)=>{V.has(e)||V.set(e,new Set);let r=V.get(e),i={onMessageSent:hr(),id:n?t.id:void 0};return r.add(i),{outgoingMessages:r,outgoingMessage:i}},Xr=({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()},Zr=async(e,t,n)=>{for(;!Qr(e,t)&&V.get(e)?.size>0;){let t=[...V.get(e)];Vr(t,n),await Promise.all(t.map(({onMessageSent:e})=>e))}},V=new WeakMap,Qr=(e,t)=>t.listenerCount(`message`)>$r(e),$r=e=>z.has(e)&&!ot(z.get(e).options.buffer,`ipc`)?1:0,ei=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},i,{strict:a=!1}={})=>{let o=`sendMessage`;return Qn({methodName:o,isSubprocess:n,ipc:r,isConnected:e.connected}),ti({anyProcess:e,channel:t,methodName:o,isSubprocess:n,message:i,strict:a})},ti=async({anyProcess:e,channel:t,methodName:n,isSubprocess:r,message:i,strict:a})=>{let o=zr({anyProcess:e,channel:t,isSubprocess:r,message:i,strict:a}),s=Yr(e,o,a);try{await ni({anyProcess:e,methodName:n,isSubprocess:r,wrappedMessage:o,message:i})}catch(t){throw mr(e),t}finally{Xr(s)}},ni=async({anyProcess:e,methodName:t,isSubprocess:n,wrappedMessage:r,message:i})=>{let a=ri(e);try{await Promise.all([Wr(r,e,n),a(r)])}catch(e){throw cr({error:e,methodName:t,isSubprocess:n}),lr({error:e,methodName:t,isSubprocess:n,message:i}),e}},ri=e=>{if(ii.has(e))return ii.get(e);let t=h(e.send.bind(e));return ii.set(e,t),t},ii=new WeakMap,ai=(e,t)=>{let n=`cancelSignal`;return er(n,!1,e.connected),ni({anyProcess:e,methodName:n,isSubprocess:!1,wrappedMessage:{type:ui,message:t},message:t})},oi=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>(await si({anyProcess:e,channel:t,isSubprocess:n,ipc:r}),fi.signal),si=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>{if(!ci){if(ci=!0,!r){sr();return}if(t===null){di();return}Fr(e,t,n),await w.yield()}};let ci=!1;const li=e=>e?.type===ui?(fi.abort(e.message),!0):!1,ui=`execa:ipc:cancel`,di=()=>{fi.abort(or())},fi=new AbortController,pi=({gracefulCancel:e,cancelSignal:t,ipc:n,serialization:r})=>{if(e){if(t===void 0)throw Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!n)throw Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(r===`json`)throw Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},mi=({subprocess:e,cancelSignal:t,gracefulCancel:n,forceKillAfterDelay:r,context:i,controller:a})=>n?[hi({subprocess:e,cancelSignal:t,forceKillAfterDelay:r,context:i,controller:a})]:[],hi=async({subprocess:e,cancelSignal:t,forceKillAfterDelay:n,context:r,controller:{signal:i}})=>{throw await Jn(t,i),await ai(e,gi(t)),qn({kill:e.kill,forceKillAfterDelay:n,context:r,controllerSignal:i}),r.terminationReason??=`gracefulCancel`,t.reason},gi=({reason:e})=>{if(!(e instanceof DOMException))return e;let t=Error(e.message);return Object.defineProperty(t,`stack`,{value:e.stack,enumerable:!1,configurable:!0,writable:!0}),t},_i=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},vi=(e,t,n,r)=>t===0||t===void 0?[]:[yi(e,t,n,r)],yi=async(e,t,n,{signal:r})=>{throw await te(t,void 0,{signal:r}),n.terminationReason??=`timeout`,e.kill(),new I},bi=({options:e})=>{if(e.node===!1)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}},xi=(e,t,{node:n=!1,nodePath:r=y,nodeOptions:i=v.filter(e=>!e.startsWith(`--inspect`)),cwd:a,execPath:o,...s})=>{if(o!==void 0)throw TypeError(`The "execPath" option has been removed. Please use the "nodePath" option instead.`);let c=ye(r,`The "nodePath" option`),l=C.resolve(a,c),u={...s,nodePath:l,node:n,cwd:a};if(!n)return[e,t,u];if(C.basename(e,`.exe`)===`node`)throw TypeError(`When the "node" option is true, the first argument does not need to be "node".`);return[l,[...i,e,...t],{ipc:!0,...u,shell:!1}]},Si=({ipcInput:e,ipc:t,serialization:n})=>{if(e!==void 0){if(!t)throw Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");Ci[n](e)}},Ci={advanced:e=>{try{oe(e)}catch(e){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},json:e=>{try{JSON.stringify(e)}catch(e){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}}},wi=async(e,t)=>{t!==void 0&&await e.sendMessage(t)},Ti=({encoding:e})=>{if(Di.has(e))return;let t=Oi(e);if(t!==void 0)throw TypeError(`Invalid option \`encoding: ${Ai(e)}\`.
21
- Please rename it to ${Ai(t)}.`);let n=[...Di].map(e=>Ai(e)).join(`, `);throw TypeError(`Invalid option \`encoding: ${Ai(e)}\`.
22
- Please rename it to one of: ${n}.`)},Ei=new Set([`utf8`,`utf16le`]),H=new Set([`buffer`,`hex`,`base64`,`base64url`,`latin1`,`ascii`]),Di=new Set([...Ei,...H]),Oi=e=>{if(e===null)return`buffer`;if(typeof e!=`string`)return;let t=e.toLowerCase();if(t in ki)return ki[t];if(Di.has(t))return t},ki={"utf-8":`utf8`,"utf-16le":`utf16le`,"ucs-2":`utf16le`,ucs2:`utf16le`,binary:`latin1`},Ai=e=>typeof e==`string`?`"${e}"`:String(e),ji=(e=Mi())=>{let t=ye(e,`The "cwd" option`);return C.resolve(t)},Mi=()=>{try{return _.cwd()}catch(e){throw e.message=`The current directory does not exist.\n${e.message}`,e}},Ni=(e,t)=>{if(t===Mi())return e;let n;try{n=de(t)}catch(n){return`The "cwd" option is invalid: ${t}.\n${n.message}\n${e}`}return n.isDirectory()?e:`The "cwd" option is not a directory: ${t}.\n${e}`},Pi=(e,t,n)=>{n.cwd=ji(n.cwd);let[r,i,a]=xi(e,t,n),{command:o,args:s,options:c}=an.default._parse(r,i,a),l=Fi(qe(c));return _i(l),Ti(l),Si(l),Yn(l),pi(l),l.shell=Se(l.shell),l.env=Ii(l),l.killSignal=jn(l.killSignal),l.forceKillAfterDelay=Vn(l.forceKillAfterDelay),l.lines=l.lines.map((e,t)=>e&&!H.has(l.encoding)&&l.buffer[t]),_.platform===`win32`&&C.basename(o,`.exe`)===`cmd`&&s.unshift(`/q`),{file:o,commandArguments:s,options:l}},Fi=({extendEnv:e=!0,preferLocal:t=!1,cwd:n,localDir:r=n,encoding:i=`utf8`,reject:a=!0,cleanup:o=!0,all:s=!1,windowsHide:c=!0,killSignal:l=`SIGTERM`,forceKillAfterDelay:u=!0,gracefulCancel:d=!1,ipcInput:f,ipc:p=f!==void 0||d,serialization:m=`advanced`,...h})=>({...h,extendEnv:e,preferLocal:t,cwd:n,localDirectory:r,encoding:i,reject:a,cleanup:o,all:s,windowsHide:c,killSignal:l,forceKillAfterDelay:u,gracefulCancel:d,ipcInput:f,ipc:p,serialization:m}),Ii=({env:e,extendEnv:t,preferLocal:n,node:r,localDirectory:i,nodePath:a})=>{let o=t?{..._.env,...e}:e;return n||r?dn({env:o,cwd:i,execPath:a,preferLocal:n,addExecPath:r}):o},Li=(e,t,n)=>n.shell&&t.length>0?[[e,...t].join(` `),[],n]:[e,t,n];function Ri(e){if(typeof e==`string`)return zi(e);if(!(ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1))throw Error(`Input must be a string or a Uint8Array`);return Bi(e)}const zi=e=>e.at(-1)===Vi?e.slice(0,e.at(-2)===Ui?-2:-1):e,Bi=e=>e.at(-1)===Hi?e.subarray(0,e.at(-2)===Wi?-2:-1):e,Vi=`
23
- `,Hi=`
24
- `.codePointAt(0),Ui=`\r`,Wi=`\r`.codePointAt(0);function U(e,{checkOpen:t=!0}={}){return typeof e==`object`&&!!e&&(e.writable||e.readable||!t||e.writable===void 0&&e.readable===void 0)&&typeof e.pipe==`function`}function Gi(e,{checkOpen:t=!0}={}){return U(e,{checkOpen:t})&&(e.writable||!t)&&typeof e.write==`function`&&typeof e.end==`function`&&typeof e.writable==`boolean`&&typeof e.writableObjectMode==`boolean`&&typeof e.destroy==`function`&&typeof e.destroyed==`boolean`}function Ki(e,{checkOpen:t=!0}={}){return U(e,{checkOpen:t})&&(e.readable||!t)&&typeof e.read==`function`&&typeof e.readable==`boolean`&&typeof e.readableObjectMode==`boolean`&&typeof e.destroy==`function`&&typeof e.destroyed==`boolean`}function qi(e,t){return Gi(e,t)&&Ki(e,t)}const Ji=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);var Yi=class{#e;#t;#n=!1;#r=void 0;constructor(e,t){this.#e=e,this.#t=t}next(){let e=()=>this.#i();return this.#r=this.#r?this.#r.then(e,e):e(),this.#r}return(e){let t=()=>this.#a(e);return this.#r?this.#r.then(t,t):t()}async#i(){if(this.#n)return{done:!0,value:void 0};let e;try{e=await this.#e.read()}catch(e){throw this.#r=void 0,this.#n=!0,this.#e.releaseLock(),e}return e.done&&(this.#r=void 0,this.#n=!0,this.#e.releaseLock()),e}async#a(e){if(this.#n)return{done:!0,value:e};if(this.#n=!0,!this.#t){let t=this.#e.cancel(e);return this.#e.releaseLock(),await t,{done:!0,value:e}}return this.#e.releaseLock(),{done:!0,value:e}}};const Xi=Symbol();function Zi(){return this[Xi].next()}Object.defineProperty(Zi,`name`,{value:`next`});function Qi(e){return this[Xi].return(e)}Object.defineProperty(Qi,`name`,{value:`return`});const $i=Object.create(Ji,{next:{enumerable:!0,configurable:!0,writable:!0,value:Zi},return:{enumerable:!0,configurable:!0,writable:!0,value:Qi}});function ea({preventCancel:e=!1}={}){let t=new Yi(this.getReader(),e),n=Object.create($i);return n[Xi]=t,n}const ta=e=>{if(Ki(e,{checkOpen:!1})&&aa.on!==void 0)return ra(e);if(typeof e?.[Symbol.asyncIterator]==`function`)return e;if(na.call(e)===`[object ReadableStream]`)return ea.call(e);throw TypeError(`The first argument must be a Readable, a ReadableStream, or an async iterable.`)},{toString:na}=Object.prototype,ra=async function*(e){let t=new AbortController,n={};ia(e,t,n);try{for await(let[n]of aa.on(e,`data`,{signal:t.signal}))yield n}catch(e){if(n.error!==void 0)throw n.error;if(!t.signal.aborted)throw e}finally{e.destroy()}},ia=async(e,t,n)=>{try{await aa.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(e){n.error=e}finally{t.abort()}},aa={},oa=async(e,{init:t,convertChunk:n,getSize:r,truncateChunk:i,addChunk:a,getFinalChunk:o,finalize:s},{maxBuffer:c=1/0}={})=>{let l=ta(e),u=t();u.length=0;try{for await(let e of l)ca({convertedChunk:n[ua(e)](e,u),state:u,getSize:r,truncateChunk:i,addChunk:a,maxBuffer:c});return sa({state:u,convertChunk:n,getSize:r,truncateChunk:i,addChunk:a,getFinalChunk:o,maxBuffer:c}),s(u)}catch(e){let t=typeof e==`object`&&e?e:Error(e);throw t.bufferedData=s(u),t}},sa=({state:e,getSize:t,truncateChunk:n,addChunk:r,getFinalChunk:i,maxBuffer:a})=>{let o=i(e);o!==void 0&&ca({convertedChunk:o,state:e,getSize:t,truncateChunk:n,addChunk:r,maxBuffer:a})},ca=({convertedChunk:e,state:t,getSize:n,truncateChunk:r,addChunk:i,maxBuffer:a})=>{let o=n(e),s=t.length+o;if(s<=a){la(e,t,i,s);return}let c=r(e,a-t.length);throw c!==void 0&&la(c,t,i,a),new fa},la=(e,t,n,r)=>{t.contents=n(e,t,r),t.length=r},ua=e=>{let t=typeof e;if(t===`string`)return`string`;if(t!==`object`||e===null)return`others`;if(globalThis.Buffer?.isBuffer(e))return`buffer`;let n=da.call(e);return n===`[object ArrayBuffer]`?`arrayBuffer`:n===`[object DataView]`?`dataView`:Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&da.call(e.buffer)===`[object ArrayBuffer]`?`typedArray`:`others`},{toString:da}=Object.prototype;var fa=class extends Error{name=`MaxBufferError`;constructor(){super(`maxBuffer exceeded`)}};const W=e=>e,pa=()=>void 0,ma=({contents:e})=>e,ha=e=>{throw Error(`Streams in object mode are not supported: ${String(e)}`)},ga=e=>e.length;async function _a(e,t){return oa(e,va,t)}const va={init:()=>({contents:[]}),convertChunk:{string:W,buffer:W,arrayBuffer:W,dataView:W,typedArray:W,others:W},getSize:()=>1,truncateChunk:pa,addChunk:(e,{contents:t})=>(t.push(e),t),getFinalChunk:pa,finalize:ma};async function ya(e,t){return oa(e,Na,t)}const ba=()=>({contents:new ArrayBuffer(0)}),xa=e=>Sa.encode(e),Sa=new TextEncoder,Ca=e=>new Uint8Array(e),wa=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Ta=(e,t)=>e.slice(0,t),Ea=(e,{contents:t,length:n},r)=>{let i=Ma()?Oa(t,r):Da(t,r);return new Uint8Array(i).set(e,n),i},Da=(e,t)=>{if(t<=e.byteLength)return e;let n=new ArrayBuffer(ka(t));return new Uint8Array(n).set(new Uint8Array(e),0),n},Oa=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let n=new ArrayBuffer(t,{maxByteLength:ka(t)});return new Uint8Array(n).set(new Uint8Array(e),0),n},ka=e=>Aa**Math.ceil(Math.log(e)/Math.log(Aa)),Aa=2,ja=({contents:e,length:t})=>Ma()?e:e.slice(0,t),Ma=()=>`resize`in ArrayBuffer.prototype,Na={init:ba,convertChunk:{string:xa,buffer:Ca,arrayBuffer:Ca,dataView:wa,typedArray:wa,others:ha},getSize:ga,truncateChunk:Ta,addChunk:Ea,getFinalChunk:pa,finalize:ja};async function Pa(e,t){return oa(e,La,t)}const Fa=()=>({contents:``,textDecoder:new TextDecoder}),Ia=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),La={init:Fa,convertChunk:{string:W,buffer:Ia,arrayBuffer:Ia,dataView:Ia,typedArray:Ia,others:ha},getSize:ga,truncateChunk:(e,t)=>e.slice(0,t),addChunk:(e,{contents:t})=>t+e,getFinalChunk:({textDecoder:e})=>{let t=e.decode();return t===``?void 0:t},finalize:ma},Ra=({error:e,stream:t,readableObjectMode:n,lines:r,encoding:i,fdNumber:a})=>{if(!(e instanceof fa))throw e;if(a===`all`)return e;throw e.maxBufferInfo={fdNumber:a,unit:za(n,r,i)},t.destroy(),e},za=(e,t,n)=>e?`objects`:t?`lines`:n===`buffer`?`bytes`:`characters`,Ba=(e,t,n)=>{if(t.length!==n)return;let r=new fa;throw r.maxBufferInfo={fdNumber:`ipc`},r},Va=(e,t)=>{let{streamName:n,threshold:r,unit:i}=Ha(e,t);return`Command's ${n} was larger than ${r} ${i}`},Ha=(e,t)=>{if(e?.maxBufferInfo===void 0)return{streamName:`output`,threshold:t[1],unit:`bytes`};let{maxBufferInfo:{fdNumber:n,unit:r}}=e;delete e.maxBufferInfo;let i=ot(t,n);return n===`ipc`?{streamName:`IPC output`,threshold:i,unit:`messages`}:{streamName:Ke(n),threshold:i,unit:r}},Ua=(e,t,n)=>e?.code===`ENOBUFS`&&t!==null&&t.some(e=>e!==null&&e.length>Ga(n)),Wa=(e,t,n)=>{if(!t)return e;let r=Ga(n);return e.length>r?e.slice(0,r):e},Ga=([,e])=>e,Ka=({stdio:e,all:t,ipcOutput:n,originalError:r,signal:i,signalDescription:a,exitCode:o,escapedCommand:s,timedOut:c,isCanceled:l,isGracefullyCanceled:u,isMaxBuffer:d,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m,maxBuffer:h,timeout:g,cwd:_})=>{let v=r?.code,y=qa({originalError:r,timedOut:c,timeout:g,isMaxBuffer:d,maxBuffer:h,errorCode:v,signal:i,signalDescription:a,exitCode:o,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m}),b=Ya(r,_),x=`${y}: ${s}${b===void 0?``:`\n${b}`}`;return{originalMessage:b,shortMessage:x,message:[x,...t===void 0?[e[2],e[1]]:[t],...e.slice(3),n.map(e=>Xa(e)).join(`
25
- `)].map(e=>ht(Ri(Za(e)))).filter(Boolean).join(`
26
-
27
- `)}},qa=({originalError:e,timedOut:t,timeout:n,isMaxBuffer:r,maxBuffer:i,errorCode:a,signal:o,signalDescription:s,exitCode:c,isCanceled:l,isGracefullyCanceled:u,isForcefullyTerminated:d,forceKillAfterDelay:f,killSignal:p})=>{let m=Ja(d,f);return t?`Command timed out after ${n} milliseconds${m}`:u?o===void 0?`Command was gracefully canceled with exit code ${c}`:d?`Command was gracefully canceled${m}`:`Command was gracefully canceled with ${o} (${s})`:l?`Command was canceled${m}`:r?`${Va(e,i)}${m}`:a===void 0?d?`Command was killed with ${p} (${Bn(p)})${m}`:o===void 0?c===void 0?`Command failed`:`Command failed with exit code ${c}`:`Command was killed with ${o} (${s})`:`Command failed with ${a}${m}`},Ja=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:``,Ya=(e,t)=>{if(e instanceof I)return;let n=ht(Ni(mn(e)?e.originalMessage:String(e?.message??e),t));return n===``?void 0:n},Xa=e=>typeof e==`string`?e:m(e),Za=e=>Array.isArray(e)?e.map(e=>Ri(Qa(e))).filter(Boolean).join(`
28
- `):Qa(e),Qa=e=>typeof e==`string`?e:A(e)?ke(e):``,$a=({command:e,escapedCommand:t,stdio:n,all:r,ipcOutput:i,options:{cwd:a},startTime:o})=>ro({command:e,escapedCommand:t,cwd:a,durationMs:nn(o),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:n[1],stderr:n[2],all:r,stdio:n,ipcOutput:i,pipedFrom:[]}),eo=({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,isSync:o})=>to({error:e,command:t,escapedCommand:n,startTime:a,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:r.length}),ipcOutput:[],options:i,isSync:o}),to=({error:e,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,exitCode:l,signal:u,stdio:d,all:f,ipcOutput:p,options:{timeoutDuration:m,timeout:h=m,forceKillAfterDelay:g,killSignal:_,cwd:v,maxBuffer:y},isSync:b})=>{let{exitCode:x,signal:S,signalDescription:C}=io(l,u),{originalMessage:w,shortMessage:ee,message:te}=Ka({stdio:d,all:f,ipcOutput:p,originalError:e,signal:S,signalDescription:C,exitCode:x,escapedCommand:n,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,forceKillAfterDelay:g,killSignal:_,maxBuffer:y,timeout:h,cwd:v}),T=fn(e,te,b);return Object.assign(T,no({error:T,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,exitCode:x,signal:S,signalDescription:C,stdio:d,all:f,ipcOutput:p,cwd:v,originalMessage:w,shortMessage:ee})),T},no=({error:e,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isMaxBuffer:s,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,stdio:f,all:p,ipcOutput:m,cwd:h,originalMessage:g,shortMessage:_})=>ro({shortMessage:_,originalMessage:g,command:t,escapedCommand:n,cwd:h,durationMs:nn(r),failed:!0,timedOut:i,isCanceled:a,isGracefullyCanceled:o,isTerminated:u!==void 0,isMaxBuffer:s,isForcefullyTerminated:c,exitCode:l,signal:u,signalDescription:d,code:e.cause?.code,stdout:f[1],stderr:f[2],all:p,stdio:f,ipcOutput:m,pipedFrom:[]}),ro=e=>Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0)),io=(e,t)=>{let n=e===null?void 0:e,r=t===null?void 0:t;return{exitCode:n,signal:r,signalDescription:r===void 0?void 0:Bn(t)}},ao=e=>Number.isFinite(e)?e:0;function oo(e){return{days:Math.trunc(e/864e5),hours:Math.trunc(e/36e5%24),minutes:Math.trunc(e/6e4%60),seconds:Math.trunc(e/1e3%60),milliseconds:Math.trunc(e%1e3),microseconds:Math.trunc(ao(e*1e3)%1e3),nanoseconds:Math.trunc(ao(e*1e6)%1e3)}}function so(e){return{days:e/86400000n,hours:e/3600000n%24n,minutes:e/60000n%60n,seconds:e/1000n%60n,milliseconds:e%1000n,microseconds:0n,nanoseconds:0n}}function co(e){switch(typeof e){case`number`:if(Number.isFinite(e))return oo(e);break;case`bigint`:return so(e)}throw TypeError(`Expected a finite number or bigint`)}const lo=e=>e===0||e===0n,uo=(e,t)=>t===1||t===1n?e:`${e}s`,fo=24n*60n*60n*1000n;function po(e,t){let n=typeof e==`bigint`;if(!n&&!Number.isFinite(e))throw TypeError(`Expected a finite number or bigint`);t={...t};let r=e<0?`-`:``;e=e<0?-e:e,t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.unitCount=1,t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);let i=[],a=(e,t)=>{let n=Math.floor(e*10**t+1e-7);return(Math.round(n)/10**t).toFixed(t)},o=(e,n,r,a)=>{if(!((i.length===0||!t.colonNotation)&&lo(e)&&!(t.colonNotation&&r===`m`))){if(a??=String(e),t.colonNotation){let e=a.includes(`.`)?a.split(`.`)[0].length:a.length,t=i.length>0?2:1;a=`0`.repeat(Math.max(0,t-e))+a}else a+=t.verbose?` `+uo(n,e):r;i.push(a)}},s=co(e),c=BigInt(s.days);if(t.hideYearAndDays?o(BigInt(c)*24n+BigInt(s.hours),`hour`,`h`):(t.hideYear?o(c,`day`,`d`):(o(c/365n,`year`,`y`),o(c%365n,`day`,`d`)),o(Number(s.hours),`hour`,`h`)),o(Number(s.minutes),`minute`,`m`),!t.hideSeconds)if(t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3&&!t.subSecondsAsDecimals){let e=Number(s.seconds),n=Number(s.milliseconds),r=Number(s.microseconds),i=Number(s.nanoseconds);if(o(e,`second`,`s`),t.formatSubMilliseconds)o(n,`millisecond`,`ms`),o(r,`microsecond`,`µs`),o(i,`nanosecond`,`ns`);else{let e=n+r/1e3+i/1e6,a=typeof t.millisecondsDecimalDigits==`number`?t.millisecondsDecimalDigits:0,s=a?e.toFixed(a):e>=1?Math.round(e):Math.ceil(e);o(Number.parseFloat(s),`millisecond`,`ms`,s)}}else{let r=a((n?Number(e%fo):e)/1e3%60,typeof t.secondsDecimalDigits==`number`?t.secondsDecimalDigits:1),i=t.keepDecimalsOnWholeSeconds?r:r.replace(/\.0+$/,``);o(Number.parseFloat(i),`second`,`s`,i)}if(i.length===0)return r+`0`+(t.verbose?` milliseconds`:`ms`);let l=t.colonNotation?`:`:` `;return typeof t.unitCount==`number`&&(i=i.slice(0,Math.max(t.unitCount,1))),r+i.join(l)}const mo=(e,t)=>{e.failed&&F({type:`error`,verboseMessage:e.shortMessage,verboseInfo:t,result:e})},ho=(e,t)=>{st(t)&&(mo(e,t),go(e,t))},go=(e,t)=>{F({type:`duration`,verboseMessage:`(done in ${po(e.durationMs)})`,verboseInfo:t,result:e})},_o=(e,t,{reject:n})=>{if(ho(e,t),e.failed&&n)throw e;return e},vo=(e,t)=>G(e)?`asyncGenerator`:Do(e)?`generator`:ko(e)?`fileUrl`:jo(e)?`filePath`:Ro(e)?`webStream`:U(e,{checkOpen:!1})?`native`:A(e)?`uint8Array`:Bo(e)?`asyncIterable`:Vo(e)?`iterable`:zo(e)?xo({transform:e},t):Oo(e)?yo(e,t):`native`,yo=(e,t)=>qi(e.transform,{checkOpen:!1})?bo(e,t):zo(e.transform)?xo(e,t):wo(e,t),bo=(e,t)=>(So(e,t,`Duplex stream`),`duplex`),xo=(e,t)=>(So(e,t,`web TransformStream`),`webTransform`),So=({final:e,binary:t,objectMode:n},r,i)=>{Co(e,`${r}.final`,i),Co(t,`${r}.binary`,i),To(n,`${r}.objectMode`)},Co=(e,t,n)=>{if(e!==void 0)throw TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${n}.`)},wo=({transform:e,final:t,binary:n,objectMode:r},i)=>{if(e!==void 0&&!Eo(e))throw TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(qi(t,{checkOpen:!1}))throw TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(zo(t))throw TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(t!==void 0&&!Eo(t))throw TypeError(`The \`${i}.final\` option must be a generator.`);return To(n,`${i}.binary`),To(r,`${i}.objectMode`),G(e)||G(t)?`asyncGenerator`:`generator`},To=(e,t)=>{if(e!==void 0&&typeof e!=`boolean`)throw TypeError(`The \`${t}\` option must use a boolean.`)},Eo=e=>G(e)||Do(e),G=e=>Object.prototype.toString.call(e)===`[object AsyncGeneratorFunction]`,Do=e=>Object.prototype.toString.call(e)===`[object GeneratorFunction]`,Oo=e=>k(e)&&(e.transform!==void 0||e.final!==void 0),ko=e=>Object.prototype.toString.call(e)===`[object URL]`,Ao=e=>ko(e)&&e.protocol!==`file:`,jo=e=>k(e)&&Object.keys(e).length>0&&Object.keys(e).every(e=>Mo.has(e))&&No(e.file),Mo=new Set([`file`,`append`]),No=e=>typeof e==`string`,Po=(e,t)=>e===`native`&&typeof t==`string`&&!Fo.has(t),Fo=new Set([`ipc`,`ignore`,`inherit`,`overlapped`,`pipe`]),Io=e=>Object.prototype.toString.call(e)===`[object ReadableStream]`,Lo=e=>Object.prototype.toString.call(e)===`[object WritableStream]`,Ro=e=>Io(e)||Lo(e),zo=e=>Io(e?.readable)&&Lo(e?.writable),Bo=e=>Ho(e)&&typeof e[Symbol.asyncIterator]==`function`,Vo=e=>Ho(e)&&typeof e[Symbol.iterator]==`function`,Ho=e=>typeof e==`object`&&!!e,K=new Set([`generator`,`asyncGenerator`,`duplex`,`webTransform`]),Uo=new Set([`fileUrl`,`filePath`,`fileNumber`]),Wo=new Set([`fileUrl`,`filePath`]),Go=new Set([...Wo,`webStream`,`nodeStream`]),Ko=new Set([`webTransform`,`duplex`]),qo={generator:`a generator`,asyncGenerator:`an async generator`,fileUrl:`a file URL`,filePath:`a file path string`,fileNumber:`a file descriptor number`,webStream:`a web stream`,nodeStream:`a Node.js stream`,webTransform:`a web TransformStream`,duplex:`a Duplex stream`,native:`any value`,iterable:`an iterable`,asyncIterable:`an async iterable`,string:`a string`,uint8Array:`a Uint8Array`},Jo=(e,t,n,r)=>r===`output`?Yo(e,t,n):Xo(e,t,n),Yo=(e,t,n)=>{let r=t!==0&&n[t-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:e??r}},Xo=(e,t,n)=>{let r=t===0?e===!0:n[t-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:t!==n.length-1&&(e??r)}},Zo=(e,t)=>{let n=e.findLast(({type:e})=>K.has(e));return n===void 0?!1:t===`input`?n.value.writableObjectMode:n.value.readableObjectMode},Qo=(e,t,n,r)=>[...e.filter(({type:e})=>!K.has(e)),...$o(e,t,n,r)],$o=(e,t,n,{encoding:r})=>{let i=e.filter(({type:e})=>K.has(e)),a=Array.from({length:i.length});for(let[e,o]of Object.entries(i))a[e]=es({stdioItem:o,index:Number(e),newTransforms:a,optionName:t,direction:n,encoding:r});return is(a,n)},es=({stdioItem:e,stdioItem:{type:t},index:n,newTransforms:r,optionName:i,direction:a,encoding:o})=>t===`duplex`?ts({stdioItem:e,optionName:i}):t===`webTransform`?ns({stdioItem:e,index:n,newTransforms:r,direction:a}):rs({stdioItem:e,index:n,newTransforms:r,direction:a,encoding:o}),ts=({stdioItem:e,stdioItem:{value:{transform:t,transform:{writableObjectMode:n,readableObjectMode:r},objectMode:i=r}},optionName:a})=>{if(i&&!r)throw TypeError(`The \`${a}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&r)throw TypeError(`The \`${a}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...e,value:{transform:t,writableObjectMode:n,readableObjectMode:r}}},ns=({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:i})=>{let{transform:a,objectMode:o}=k(t)?t:{transform:t},{writableObjectMode:s,readableObjectMode:c}=Jo(o,n,r,i);return{...e,value:{transform:a,writableObjectMode:s,readableObjectMode:c}}},rs=({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:i,encoding:a})=>{let{transform:o,final:s,binary:c=!1,preserveNewlines:l=!1,objectMode:u}=k(t)?t:{transform:t},d=c||H.has(a),{writableObjectMode:f,readableObjectMode:p}=Jo(u,n,r,i);return{...e,value:{transform:o,final:s,binary:d,preserveNewlines:l,writableObjectMode:f,readableObjectMode:p}}},is=(e,t)=>t===`input`?e.reverse():e,as=(e,t,n)=>{let r=e.map(e=>os(e,t));if(r.includes(`input`)&&r.includes(`output`))throw TypeError(`The \`${n}\` option must not be an array of both readable and writable values.`);return r.find(Boolean)??ds},os=({type:e,value:t},n)=>ss[n]??ls[e](t),ss=[`input`,`output`,`output`],q=()=>void 0,cs=()=>`input`,ls={generator:q,asyncGenerator:q,fileUrl:q,filePath:q,iterable:cs,asyncIterable:cs,uint8Array:cs,webStream:e=>Lo(e)?`output`:`input`,nodeStream(e){return Ki(e,{checkOpen:!1})?Gi(e,{checkOpen:!1})?void 0:`input`:`output`},webTransform:q,duplex:q,native(e){let t=us(e);if(t!==void 0)return t;if(U(e,{checkOpen:!1}))return ls.nodeStream(e)}},us=e=>{if([0,_.stdin].includes(e))return`input`;if([1,2,_.stdout,_.stderr].includes(e))return`output`},ds=`output`,fs=(e,t)=>t&&!e.includes(`ipc`)?[...e,`ipc`]:e,ps=({stdio:e,ipc:t,buffer:n,...r},i,a)=>{let o=ms(e,r).map((e,t)=>gs(e,t));return a?_s(o,n,i):fs(o,t)},ms=(e,t)=>{if(e===void 0)return N.map(e=>t[e]);if(hs(t))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${N.map(e=>`\`${e}\``).join(`, `)}`);if(typeof e==`string`)return[e,e,e];if(!Array.isArray(e))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);let n=Math.max(e.length,N.length);return Array.from({length:n},(t,n)=>e[n])},hs=e=>N.some(t=>e[t]!==void 0),gs=(e,t)=>Array.isArray(e)?e.map(e=>gs(e,t)):e??(t>=N.length?`ignore`:`pipe`),_s=(e,t,n)=>e.map((e,r)=>!t[r]&&r!==0&&!ct(n,r)&&vs(e)?`ignore`:e),vs=e=>e===`pipe`||Array.isArray(e)&&e.every(e=>e===`pipe`),ys=({stdioItem:e,stdioItem:{type:t},isStdioArray:n,fdNumber:r,direction:i,isSync:a})=>!n||t!==`native`?e:a?bs({stdioItem:e,fdNumber:r,direction:i}):Cs({stdioItem:e,fdNumber:r}),bs=({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r,direction:i})=>{let a=xs({value:t,optionName:n,fdNumber:r,direction:i});if(a!==void 0)return a;if(U(t,{checkOpen:!1}))throw TypeError(`The \`${n}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e},xs=({value:e,optionName:t,fdNumber:n,direction:r})=>{let i=Ss(e,n);if(i!==void 0){if(r===`output`)return{type:`fileNumber`,value:i,optionName:t};if(S.isatty(i))throw TypeError(`The \`${t}: ${wr(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:`uint8Array`,value:j(ue(i)),optionName:t}}},Ss=(e,t)=>{if(e===`inherit`)return t;if(typeof e==`number`)return e;let n=Ge.indexOf(e);if(n!==-1)return n},Cs=({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r})=>t===`inherit`?{type:`nodeStream`,value:ws(r,t,n),optionName:n}:typeof t==`number`?{type:`nodeStream`,value:ws(t,t,n),optionName:n}:U(t,{checkOpen:!1})?{type:`nodeStream`,value:t,optionName:n}:e,ws=(e,t,n)=>{let r=Ge[e];if(r===void 0)throw TypeError(`The \`${n}: ${t}\` option is invalid: no such standard stream.`);return r},Ts=({input:e,inputFile:t},n)=>n===0?[...Es(e),...Os(t)]:[],Es=e=>e===void 0?[]:[{type:Ds(e),value:e,optionName:`input`}],Ds=e=>{if(Ki(e,{checkOpen:!1}))return`nodeStream`;if(typeof e==`string`)return`string`;if(A(e))return`uint8Array`;throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},Os=e=>e===void 0?[]:[{...ks(e),optionName:`inputFile`}],ks=e=>{if(ko(e))return{type:`fileUrl`,value:e};if(No(e))return{type:`filePath`,value:{file:e}};throw Error("The `inputFile` option must be a file path string or a file URL.")},As=e=>e.filter((t,n)=>e.every((e,r)=>t.value!==e.value||n>=r||t.type===`generator`||t.type===`asyncGenerator`)),js=({stdioItem:{type:e,value:t,optionName:n},direction:r,fileDescriptors:i,isSync:a})=>{let o=Ms(i,e);if(o.length!==0){if(a){Ns({otherStdioItems:o,type:e,value:t,optionName:n,direction:r});return}if(Go.has(e))return Ps({otherStdioItems:o,type:e,value:t,optionName:n,direction:r});Ko.has(e)&&Is({otherStdioItems:o,type:e,value:t,optionName:n})}},Ms=(e,t)=>e.flatMap(({direction:e,stdioItems:n})=>n.filter(e=>e.type===t).map((t=>({...t,direction:e})))),Ns=({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{Wo.has(t)&&Ps({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})},Ps=({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{let a=e.filter(e=>Fs(e,n));if(a.length!==0)return Ls(a.find(e=>e.direction!==i),r,t),i===`output`?a[0].stream:void 0},Fs=({type:e,value:t},n)=>e===`filePath`?t.file===n.file:e===`fileUrl`?t.href===n.href:t===n,Is=({otherStdioItems:e,type:t,value:n,optionName:r})=>{Ls(e.find(({value:{transform:e}})=>e===n.transform),r,t)},Ls=(e,t,n)=>{if(e!==void 0)throw TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${qo[n]} that is the same.`)},Rs=(e,t,n,r)=>{let i=qs({initialFileDescriptors:ps(t,n,r).map((e,n)=>zs({stdioOption:e,fdNumber:n,options:t,isSync:r})),addProperties:e,options:t,isSync:r});return t.stdio=i.map(({stdioItems:e})=>Zs(e)),i},zs=({stdioOption:e,fdNumber:t,options:n,isSync:r})=>{let i=Ke(t),{stdioItems:a,isStdioArray:o}=Bs({stdioOption:e,fdNumber:t,options:n,optionName:i}),s=as(a,t,i),c=Qo(a.map(e=>ys({stdioItem:e,isStdioArray:o,fdNumber:t,direction:s,isSync:r})),i,s,n),l=Zo(c,s);return Ks(c,l),{direction:s,objectMode:l,stdioItems:c}},Bs=({stdioOption:e,fdNumber:t,options:n,optionName:r})=>{let i=As([...(Array.isArray(e)?e:[e]).map(e=>Vs(e,r)),...Ts(n,t)]),a=i.length>1;return Hs(i,a,r),Ws(i),{stdioItems:i,isStdioArray:a}},Vs=(e,t)=>({type:vo(e,t),value:e,optionName:t}),Hs=(e,t,n)=>{if(e.length===0)throw TypeError(`The \`${n}\` option must not be an empty array.`);if(t){for(let{value:t,optionName:n}of e)if(Us.has(t))throw Error(`The \`${n}\` option must not include \`${t}\`.`)}},Us=new Set([`ignore`,`ipc`]),Ws=e=>{for(let t of e)Gs(t)},Gs=({type:e,value:t,optionName:n})=>{if(Ao(t))throw TypeError(`The \`${n}: URL\` option must use the \`file:\` scheme.
29
- For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(Po(e,t))throw TypeError(`The \`${n}: { file: '...' }\` option must be used instead of \`${n}: '...'\`.`)},Ks=(e,t)=>{if(!t)return;let n=e.find(({type:e})=>Uo.has(e));if(n!==void 0)throw TypeError(`The \`${n.optionName}\` option cannot use both files and transforms in objectMode.`)},qs=({initialFileDescriptors:e,addProperties:t,options:n,isSync:r})=>{let i=[];try{for(let a of e)i.push(Js({fileDescriptor:a,fileDescriptors:i,addProperties:t,options:n,isSync:r}));return i}catch(e){throw Xs(i),e}},Js=({fileDescriptor:{direction:e,objectMode:t,stdioItems:n},fileDescriptors:r,addProperties:i,options:a,isSync:o})=>({direction:e,objectMode:t,stdioItems:n.map(t=>Ys({stdioItem:t,addProperties:i,direction:e,options:a,fileDescriptors:r,isSync:o}))}),Ys=({stdioItem:e,addProperties:t,direction:n,options:r,fileDescriptors:i,isSync:a})=>{let o=js({stdioItem:e,direction:n,fileDescriptors:i,isSync:a});return o===void 0?{...e,...t[n][e.type](e,r)}:{...e,stream:o}},Xs=e=>{for(let{stdioItems:t}of e)for(let{stream:e}of t)e!==void 0&&!M(e)&&e.destroy()},Zs=e=>{if(e.length>1)return e.some(({value:e})=>e===`overlapped`)?`overlapped`:`pipe`;let[{type:t,value:n}]=e;return t===`native`?n:`pipe`},Qs=(e,t)=>Rs(nc,e,t,!0),J=({type:e,optionName:t})=>{ec(t,qo[e])},$s=({optionName:e,value:t})=>((t===`ipc`||t===`overlapped`)&&ec(e,`"${t}"`),{}),ec=(e,t)=>{throw TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},tc={generator(){},asyncGenerator:J,webStream:J,nodeStream:J,webTransform:J,duplex:J,asyncIterable:J,native:$s},nc={input:{...tc,fileUrl:({value:e})=>({contents:[j(ue(e))]}),filePath:({value:{file:e}})=>({contents:[j(ue(e))]}),fileNumber:J,iterable:({value:e})=>({contents:[...e]}),string:({value:e})=>({contents:[e]}),uint8Array:({value:e})=>({contents:[e]})},output:{...tc,fileUrl:({value:e})=>({path:e}),filePath:({value:{file:e,append:t}})=>({path:e,append:t}),fileNumber:({value:e})=>({path:e}),iterable:J,string:J,uint8Array:J}},Y=(e,{stripFinalNewline:t},n)=>rc(t,n)&&e!==void 0&&!Array.isArray(e)?Ri(e):e,rc=(e,t)=>t===`all`?e[1]||e[2]:e[t],ic=(e,t,n,r)=>e||n?void 0:sc(t,r),ac=(e,t,n)=>n?e.flatMap(e=>oc(e,t)):oc(e,t),oc=(e,t)=>{let{transform:n,final:r}=sc(t,{});return[...n(e),...r()]},sc=(e,t)=>(t.previousChunks=``,{transform:cc.bind(void 0,t,e),final:uc.bind(void 0,t)}),cc=function*(e,t,n){if(typeof n!=`string`){yield n;return}let{previousChunks:r}=e,i=-1;for(let a=0;a<n.length;a+=1)if(n[a]===`
30
- `){let o=lc(n,a,t,e),s=n.slice(i+1,a+1-o);r.length>0&&(s=pc(r,s),r=``),yield s,i=a}i!==n.length-1&&(r=pc(r,n.slice(i+1))),e.previousChunks=r},lc=(e,t,n,r)=>n?0:(r.isWindowsNewline=t!==0&&e[t-1]===`\r`,r.isWindowsNewline?2:1),uc=function*({previousChunks:e}){e.length>0&&(yield e)},dc=({binary:e,preserveNewlines:t,readableObjectMode:n,state:r})=>e||t||n?void 0:{transform:fc.bind(void 0,r)},fc=function*({isWindowsNewline:e=!1},t){let{unixNewline:n,windowsNewline:r,LF:i,concatBytes:a}=typeof t==`string`?mc:hc;if(t.at(-1)===i){yield t;return}yield a(t,e?r:n)},pc=(e,t)=>`${e}${t}`,mc={windowsNewline:`\r
31
- `,unixNewline:`
32
- `,LF:`
33
- `,concatBytes:pc},hc={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:(e,t)=>{let n=new Uint8Array(e.length+t.length);return n.set(e,0),n.set(t,e.length),n}},gc=(e,t)=>e?void 0:_c.bind(void 0,t),_c=function*(e,t){if(typeof t!=`string`&&!A(t)&&!ve.isBuffer(t))throw TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},vc=(e,t)=>e?yc.bind(void 0,t):bc.bind(void 0,t),yc=function*(e,t){xc(e,t),yield t},bc=function*(e,t){if(xc(e,t),typeof t!=`string`&&!A(t))throw TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},xc=(e,t)=>{if(t==null)throw TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.
34
- Instead, \`yield\` should either be called with a value, or not be called at all. For example:
35
- if (condition) { yield value; }`)},Sc=(e,t,n)=>{if(n)return;if(e)return{transform:Cc.bind(void 0,new TextEncoder)};let r=new u(t);return{transform:wc.bind(void 0,r),final:Tc.bind(void 0,r)}},Cc=function*(e,t){ve.isBuffer(t)?yield j(t):typeof t==`string`?yield e.encode(t):yield t},wc=function*(e,t){yield A(t)?e.write(t):t},Tc=function*(e){let t=e.end();t!==``&&(yield t)},Ec=f(async(e,t,n,r)=>{t.currentIterable=e(...n);try{for await(let e of t.currentIterable)r.push(e)}finally{delete t.currentIterable}}),Dc=async function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=jc}=t[n];for await(let i of r(e))yield*Dc(i,t,n+1)},Oc=async function*(e){for(let[t,{final:n}]of Object.entries(e))yield*kc(n,Number(t),e)},kc=async function*(e,t,n){if(e!==void 0)for await(let r of e())yield*Dc(r,n,t+1)},Ac=f(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),jc=function*(e){yield e},Mc=(e,t,n,r)=>{try{for(let r of e(...t))n.push(r);r()}catch(e){r(e)}},Nc=(e,t)=>[...t.flatMap(t=>[...X(t,e,0)]),...Pc(e)],X=function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=Ic}=t[n];for(let i of r(e))yield*X(i,t,n+1)},Pc=function*(e){for(let[t,{final:n}]of Object.entries(e))yield*Fc(n,Number(t),e)},Fc=function*(e,t,n){if(e!==void 0)for(let r of e())yield*X(r,n,t+1)},Ic=function*(e){yield e},Lc=({value:e,value:{transform:t,final:n,writableObjectMode:r,readableObjectMode:i},optionName:a},{encoding:o})=>{let s={},c=zc(e,o,a),l=G(t),u=G(n),d=l?Ec.bind(void 0,Dc,s):Mc.bind(void 0,X),f=l||u?Ec.bind(void 0,Oc,s):Mc.bind(void 0,Pc),p=l||u?Ac.bind(void 0,s):void 0;return{stream:new he({writableObjectMode:r,writableHighWaterMark:_e(r),readableObjectMode:i,readableHighWaterMark:_e(i),transform(e,t,n){d([e,c,0],this,n)},flush(e){f([c],this,e)},destroy:p})}},Rc=(e,t,n,r)=>{let i=t.filter(({type:e})=>e===`generator`),a=r?i.reverse():i;for(let{value:t,optionName:r}of a)e=Nc(zc(t,n,r),e);return e},zc=({transform:e,final:t,binary:n,writableObjectMode:r,readableObjectMode:i,preserveNewlines:a},o,s)=>{let c={};return[{transform:gc(r,s)},Sc(n,o,r),ic(n,a,r,c),{transform:e,final:t},{transform:vc(i,s)},dc({binary:n,preserveNewlines:a,readableObjectMode:i,state:c})].filter(Boolean)},Bc=(e,t)=>{for(let n of Vc(e))Hc(e,n,t)},Vc=e=>new Set(Object.entries(e).filter(([,{direction:e}])=>e===`input`).map(([e])=>Number(e))),Hc=(e,t,n)=>{let{stdioItems:r}=e[t],i=r.filter(({contents:e})=>e!==void 0);if(i.length!==0){if(t!==0){let[{type:e,optionName:t}]=i;throw TypeError(`Only the \`stdin\` option, not \`${t}\`, can be ${qo[e]} with synchronous methods.`)}n.input=Me(i.map(({contents:e})=>e).map(e=>Uc(e,r)))}},Uc=(e,t)=>{let n=Rc(e,t,`utf8`,!0);return Wc(n),Me(n)},Wc=e=>{let t=e.find(e=>typeof e!=`string`&&!A(e));if(t!==void 0)throw TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)},Gc=({stdioItems:e,encoding:t,verboseInfo:n,fdNumber:r})=>r!==`all`&&ct(n,r)&&!H.has(t)&&Kc(r)&&(e.some(({type:e,value:t})=>e===`native`&&qc.has(t))||e.every(({type:e})=>K.has(e))),Kc=e=>e===1||e===2,qc=new Set([`pipe`,`overlapped`]),Jc=async(e,t,n,r)=>{for await(let i of e)Xc(t)||Zc(i,n,r)},Yc=(e,t,n)=>{for(let r of e)Zc(r,t,n)},Xc=e=>e._readableState.pipes.length>0,Zc=(e,t,n)=>{F({type:`output`,verboseMessage:Jt(e),fdNumber:t,verboseInfo:n})},Qc=({fileDescriptors:e,syncResult:{output:t},options:n,isMaxBuffer:r,verboseInfo:i})=>{if(t===null)return{output:Array.from({length:3})};let a={},o=new Set([]);return{output:t.map((t,s)=>$c({result:t,fileDescriptors:e,fdNumber:s,state:a,outputFiles:o,isMaxBuffer:r,verboseInfo:i},n)),...a}},$c=({result:e,fileDescriptors:t,fdNumber:n,state:r,outputFiles:i,isMaxBuffer:a,verboseInfo:o},{buffer:s,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(e===null)return;let f=j(Wa(e,a,d)),{stdioItems:p,objectMode:m}=t[n],{serializedResult:h,finalResult:g=h}=tl({chunks:el([f],p,c,r),objectMode:m,encoding:c,lines:l,stripFinalNewline:u,fdNumber:n});nl({serializedResult:h,fdNumber:n,state:r,verboseInfo:o,encoding:c,stdioItems:p,objectMode:m});let _=s[n]?g:void 0;try{return r.error===void 0&&rl(h,p,i),_}catch(e){return r.error=e,_}},el=(e,t,n,r)=>{try{return Rc(e,t,n,!1)}catch(t){return r.error=t,e}},tl=({chunks:e,objectMode:t,encoding:n,lines:r,stripFinalNewline:i,fdNumber:a})=>{if(t)return{serializedResult:e};if(n===`buffer`)return{serializedResult:Me(e)};let o=Ae(e,n);return r[a]?{serializedResult:o,finalResult:ac(o,!i[a],t)}:{serializedResult:o}},nl=({serializedResult:e,fdNumber:t,state:n,verboseInfo:r,encoding:i,stdioItems:a,objectMode:o})=>{if(!Gc({stdioItems:a,encoding:i,verboseInfo:r,fdNumber:t}))return;let s=ac(e,!1,o);try{Yc(s,t,r)}catch(e){n.error??=e}},rl=(e,t,n)=>{for(let{path:r,append:i}of t.filter(({type:e})=>Uo.has(e))){let t=typeof r==`string`?r:r.toString();i||n.has(t)?se(r,e):(n.add(t),fe(r,e))}},il=([,e,t],n)=>{if(n.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,Y(t,n,`all`)]:Array.isArray(t)?[Y(e,n,`all`),...t]:A(e)&&A(t)?Pe([e,t]):`${e}${t}`},al=async(e,t)=>{let[n,r]=await ol(e);return t.isForcefullyTerminated??=!1,[n,r]},ol=async e=>{let[t,n]=await Promise.allSettled([E(e,`spawn`),E(e,`exit`)]);return t.status===`rejected`?[]:n.status===`rejected`?sl(e):n.value},sl=async e=>{try{return await E(e,`exit`)}catch{return sl(e)}},cl=async e=>{let[t,n]=await e;if(!ll(t,n)&&ul(t,n))throw new I;return[t,n]},ll=(e,t)=>e===void 0&&t===void 0,ul=(e,t)=>e!==0||t!==null,dl=({error:e,status:t,signal:n,output:r},{maxBuffer:i})=>{let a=fl(e,t,n);return{resultError:a,exitCode:t,signal:n,timedOut:a?.code===`ETIMEDOUT`,isMaxBuffer:Ua(a,r,i)}},fl=(e,t,n)=>e===void 0?ul(t,n)?new I:void 0:e,pl=(e,t,n)=>{let{file:r,commandArguments:i,command:a,escapedCommand:o,startTime:s,verboseInfo:c,options:l,fileDescriptors:u}=ml(e,t,n);return _o(vl({file:r,commandArguments:i,options:l,command:a,escapedCommand:o,verboseInfo:c,fileDescriptors:u,startTime:s}),c,l)},ml=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=rn(e,t,n),{file:s,commandArguments:c,options:l}=Pi(e,t,hl(n));return gl(l),{file:s,commandArguments:c,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:l,fileDescriptors:Qs(l,o)}},hl=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,gl=({ipc:e,ipcInput:t,detached:n,cancelSignal:r})=>{t&&_l(`ipcInput`),e&&_l(`ipc: true`),n&&_l(`detached: true`),r&&_l(`cancelSignal`)},_l=e=>{throw TypeError(`The "${e}" option cannot be used with synchronous methods.`)},vl=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,verboseInfo:a,fileDescriptors:o,startTime:s})=>{let c=yl({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:o,startTime:s});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=dl(c,n),{output:m,error:h=l}=Qc({fileDescriptors:o,syncResult:c,options:n,isMaxBuffer:p,verboseInfo:a});return xl({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:m.map((e,t)=>Y(e,n,t)),all:Y(il(m,n),n,`all`),options:n,command:r,escapedCommand:i,startTime:s})},yl=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:a,startTime:o})=>{try{return Bc(a,n),l(...Li(e,t,bl(n)))}catch(e){return eo({error:e,command:r,escapedCommand:i,fileDescriptors:a,options:n,startTime:o,isSync:!0})}},bl=({encoding:e,maxBuffer:t,...n})=>({...n,encoding:`buffer`,maxBuffer:Ga(t)}),xl=({error:e,exitCode:t,signal:n,timedOut:r,isMaxBuffer:i,stdio:a,all:o,options:s,command:c,escapedCommand:l,startTime:u})=>e===void 0?$a({command:c,escapedCommand:l,stdio:a,all:o,ipcOutput:[],options:s,startTime:u}):to({error:e,command:c,escapedCommand:l,timedOut:r,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:t,signal:n,stdio:a,all:o,ipcOutput:[],options:s,startTime:u,isSync:!0}),Sl=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0,filter:a}={})=>(Qn({methodName:`getOneMessage`,isSubprocess:n,ipc:r,isConnected:Rr(e)}),Cl({anyProcess:e,channel:t,isSubprocess:n,filter:a,reference:i})),Cl=async({anyProcess:e,channel:t,isSubprocess:n,filter:r,reference:i})=>{Er(t,i);let a=Fr(e,t,n),o=new AbortController;try{return await Promise.race([wl(a,r,o),Tl(a,n,o),El(a,n,o)])}catch(t){throw mr(e),t}finally{o.abort(),Or(t,i)}},wl=async(e,t,{signal:n})=>{if(t===void 0){let[t]=await E(e,`message`,{signal:n});return t}for await(let[r]of ie(e,`message`,{signal:n}))if(t(r))return r},Tl=async(e,t,{signal:n})=>{await E(e,`disconnect`,{signal:n}),tr(t)},El=async(e,t,{signal:n})=>{let[r]=await E(e,`strict:error`,{signal:n});throw rr(r,t)},Dl=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0}={})=>Ol({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:!n,reference:i}),Ol=({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:i,reference:a})=>{Qn({methodName:`getEachMessage`,isSubprocess:n,ipc:r,isConnected:Rr(e)}),Er(t,a);let o=Fr(e,t,n),s=new AbortController,c={};return kl(e,o,s),Al({ipcEmitter:o,isSubprocess:n,controller:s,state:c}),jl({anyProcess:e,channel:t,ipcEmitter:o,isSubprocess:n,shouldAwait:i,controller:s,state:c,reference:a})},kl=async(e,t,n)=>{try{await E(t,`disconnect`,{signal:n.signal}),n.abort()}catch{}},Al=async({ipcEmitter:e,isSubprocess:t,controller:n,state:r})=>{try{let[i]=await E(e,`strict:error`,{signal:n.signal});r.error=rr(i,t),n.abort()}catch{}},jl=async function*({anyProcess:e,channel:t,ipcEmitter:n,isSubprocess:r,shouldAwait:i,controller:a,state:o,reference:s}){try{for await(let[e]of ie(n,`message`,{signal:a.signal}))Ml(o),yield e}catch{Ml(o)}finally{a.abort(),Or(t,s),r||mr(e),i&&await e}},Ml=({error:e})=>{if(e)throw e},Nl=(e,{ipc:t})=>{Object.assign(e,Fl(e,!1,t))},Pl=()=>{let e=_,t=_.channel!==void 0;return{...Fl(e,!0,t),getCancelSignal:oi.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:!0,ipc:t})}},Fl=(e,t,n)=>({sendMessage:ei.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getOneMessage:Sl.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getEachMessage:Dl.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})}),Il=({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,verboseInfo:s})=>{Xs(r);let c=new o;return Ll(c,r),Object.assign(c,{readable:Rl,writable:zl,duplex:Bl}),{subprocess:c,promise:Vl(eo({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,isSync:!1}),s,i)}},Ll=(e,t)=>{let n=Z(),r=Z(),i=Z(),a=Array.from({length:t.length-3},Z),o=Z(),s=[n,r,i,...a];Object.assign(e,{stdin:n,stdout:r,stderr:i,all:o,stdio:s})},Z=()=>{let e=new me;return e.end(),e},Rl=()=>new O({read(){}}),zl=()=>new ge({write(){}}),Bl=()=>new pe({read(){},write(){}}),Vl=async(e,t,n)=>_o(e,t,n),Hl=(e,t)=>Rs(Wl,e,t,!1),Q=({type:e,optionName:t})=>{throw TypeError(`The \`${t}\` option cannot be ${qo[e]}.`)},Ul={fileNumber:Q,generator:Lc,asyncGenerator:Lc,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:n}}){let r=t||n;return{stream:pe.fromWeb(e,{objectMode:r})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},Wl={input:{...Ul,fileUrl:({value:e})=>({stream:ce(e)}),filePath:({value:{file:e}})=>({stream:ce(e)}),webStream:({value:e})=>({stream:O.fromWeb(e)}),iterable:({value:e})=>({stream:O.from(e)}),asyncIterable:({value:e})=>({stream:O.from(e)}),string:({value:e})=>({stream:O.from(e)}),uint8Array:({value:e})=>({stream:O.from(ve.from(e))})},output:{...Ul,fileUrl:({value:e})=>({stream:le(e)}),filePath:({value:{file:e,append:t}})=>({stream:le(e,t?{flags:`a`}:{})}),webStream:({value:e})=>({stream:ge.fromWeb(e)}),iterable:Q,asyncIterable:Q,string:Q,uint8Array:Q}};function Gl(e){if(!Array.isArray(e))throw TypeError(`Expected an array, got \`${typeof e}\`.`);for(let t of e)Zl(t);let t=e.some(({readableObjectMode:e})=>e),n=Kl(e,t),r=new ql({objectMode:t,writableHighWaterMark:n,readableHighWaterMark:n});for(let t of e)r.add(t);return r}const Kl=(e,t)=>{if(e.length===0)return _e(t);let n=e.filter(({readableObjectMode:e})=>e===t).map(({readableHighWaterMark:e})=>e);return Math.max(...n)};var ql=class extends me{#e=new Set([]);#t=new Set([]);#n=new Set([]);#r;#i=Symbol(`unpipe`);#a=new WeakMap;add(e){if(Zl(e),this.#e.has(e))return;this.#e.add(e),this.#r??=Jl(this,this.#e,this.#i);let t=Ql({passThroughStream:this,stream:e,streams:this.#e,ended:this.#t,aborted:this.#n,onFinished:this.#r,unpipeEvent:this.#i});this.#a.set(e,t),e.pipe(this,{end:!1})}async remove(e){if(Zl(e),!this.#e.has(e))return!1;let t=this.#a.get(e);return t===void 0?!1:(this.#a.delete(e),e.unpipe(this),await t,!0)}};const Jl=async(e,t,n)=>{cu(e,lu);let r=new AbortController;try{await Promise.race([Yl(e,r),Xl(e,t,n,r)])}finally{r.abort(),cu(e,-lu)}},Yl=async(e,{signal:t})=>{try{await D(e,{signal:t,cleanup:!0})}catch(t){throw ru(e,t),t}},Xl=async(e,t,n,{signal:r})=>{for await(let[i]of ie(e,`unpipe`,{signal:r}))t.has(i)&&i.emit(n)},Zl=e=>{if(typeof e?.pipe!=`function`)throw TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},Ql=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,onFinished:a,unpipeEvent:o})=>{cu(e,uu);let s=new AbortController;try{await Promise.race([$l(a,t,s),eu({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:s}),tu({stream:t,streams:n,ended:r,aborted:i,unpipeEvent:o,controller:s})])}finally{s.abort(),cu(e,-uu)}n.size>0&&n.size===r.size+i.size&&(r.size===0&&i.size>0?au(e):nu(e))},$l=async(e,t,{signal:n})=>{try{await e,n.aborted||au(t)}catch(e){n.aborted||ru(t,e)}},eu=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:{signal:a}})=>{try{await D(t,{signal:a,cleanup:!0,readable:!0,writable:!1}),n.has(t)&&r.add(t)}catch(r){if(a.aborted||!n.has(t))return;iu(r)?i.add(t):ou(e,r)}},tu=async({stream:e,streams:t,ended:n,aborted:r,unpipeEvent:i,controller:{signal:a}})=>{if(await E(e,i,{signal:a}),!e.readable)return E(a,`abort`,{signal:a});t.delete(e),n.delete(e),r.delete(e)},nu=e=>{e.writable&&e.end()},ru=(e,t)=>{iu(t)?au(e):ou(e,t)},iu=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,au=e=>{(e.readable||e.writable)&&e.destroy()},ou=(e,t)=>{e.destroyed||(e.once(`error`,su),e.destroy(t))},su=()=>{},cu=(e,t)=>{let n=e.getMaxListeners();n!==0&&n!==1/0&&e.setMaxListeners(n+t)},lu=2,uu=1,du=(e,t)=>{e.pipe(t),fu(e,t),mu(e,t)},fu=async(e,t)=>{if(!(M(e)||M(t))){try{await D(e,{cleanup:!0,readable:!0,writable:!1})}catch{}pu(t)}},pu=e=>{e.writable&&e.end()},mu=async(e,t)=>{if(!(M(e)||M(t))){try{await D(t,{cleanup:!0,readable:!1,writable:!0})}catch{}hu(e)}},hu=e=>{e.readable&&e.destroy()},gu=(e,t,n)=>{let r=new Map;for(let[i,{stdioItems:a,direction:o}]of Object.entries(t)){for(let{stream:t}of a.filter(({type:e})=>K.has(e)))_u(e,t,o,i);for(let{stream:t}of a.filter(({type:e})=>!K.has(e)))yu({subprocess:e,stream:t,direction:o,fdNumber:i,pipeGroups:r,controller:n})}for(let[e,t]of r.entries())du(t.length===1?t[0]:Gl(t),e)},_u=(e,t,n,r)=>{n===`output`?du(e.stdio[r],t):du(t,e.stdio[r]);let i=vu[r];i!==void 0&&(e[i]=t),e.stdio[r]=t},vu=[`stdin`,`stdout`,`stderr`],yu=({subprocess:e,stream:t,direction:n,fdNumber:r,pipeGroups:i,controller:a})=>{if(t===void 0)return;bu(t,a);let[o,s]=n===`output`?[t,e.stdio[r]]:[e.stdio[r],t],c=i.get(o)??[];i.set(o,[...c,s])},bu=(e,{signal:t})=>{M(e)&&Tr(e,xu,t)},xu=2,Su=(e,{cleanup:t,detached:n},{signal:r})=>{if(!t||n)return;let a=i(()=>{e.kill()});re(r,()=>{a()})},Cu=({source:e,sourcePromise:t,boundOptions:n,createNested:r},...i)=>{let a=tn(),{destination:o,destinationStream:s,destinationError:c,from:l,unpipeSignal:u}=wu(n,r,i),{sourceStream:d,sourceError:f}=Du(e,l),{options:p,fileDescriptors:m}=z.get(e);return{sourcePromise:t,sourceStream:d,sourceOptions:p,sourceError:f,destination:o,destinationStream:s,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:a}},wu=(e,t,n)=>{try{let{destination:r,pipeOptions:{from:i,to:a,unpipeSignal:o}={}}=Tu(e,t,...n);return{destination:r,destinationStream:gr(r,a),from:i,unpipeSignal:o}}catch(e){return{destinationError:e}}},Tu=(e,t,n,...r)=>{if(Array.isArray(n))return{destination:t(Eu,e)(n,...r),pipeOptions:e};if(typeof n==`string`||n instanceof URL||xe(n)){if(Object.keys(e).length>0)throw TypeError(`Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).`);let[i,a,o]=Ce(n,...r);return{destination:t(Eu)(i,a,o),pipeOptions:o}}if(z.has(n)){if(Object.keys(e).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:n,pipeOptions:r[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${n}`)},Eu=({options:e})=>({options:{...e,stdin:`pipe`,piped:!0}}),Du=(e,t)=>{try{return{sourceStream:_r(e,t)}}catch(e){return{sourceError:e}}},Ou=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r,fileDescriptors:i,sourceOptions:a,startTime:o})=>{let s=ku({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r});if(s!==void 0)throw Au({error:s,fileDescriptors:i,sourceOptions:a,startTime:o})},ku=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r})=>{if(t!==void 0&&r!==void 0)return r;if(r!==void 0)return hu(e),r;if(t!==void 0)return pu(n),t},Au=({error:e,fileDescriptors:t,sourceOptions:n,startTime:r})=>eo({error:e,command:ju,escapedCommand:ju,fileDescriptors:t,options:n,startTime:r,isSync:!1}),ju=`source.pipe(destination)`,Mu=async e=>{let[{status:t,reason:n,value:r=n},{status:i,reason:a,value:o=a}]=await e;if(o.pipedFrom.includes(r)||o.pipedFrom.push(r),i===`rejected`)throw o;if(t===`rejected`)throw r;return o},Nu=(e,t,n)=>{let r=Lu.has(t)?Fu(e,t):Pu(e,t);return Tr(e,Ru,n.signal),Tr(t,zu,n.signal),Iu(t),r},Pu=(e,t)=>{let n=Gl([e]);return du(n,t),Lu.set(t,n),n},Fu=(e,t)=>{let n=Lu.get(t);return n.add(e),n},Iu=async e=>{try{await D(e,{cleanup:!0,readable:!1,writable:!0})}catch{}Lu.delete(e)},Lu=new WeakMap,Ru=2,zu=1,Bu=(e,t)=>e===void 0?[]:[Vu(e,t)],Vu=async(e,{sourceStream:t,mergedStream:n,fileDescriptors:r,sourceOptions:i,startTime:a})=>{throw await d(e,t),await n.remove(t),Au({error:Error("Pipe canceled by `unpipeSignal` option."),fileDescriptors:r,sourceOptions:i,startTime:a})},Hu=(e,...t)=>{if(k(t[0]))return Hu.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:n,...r}=Cu(e,...t),i=Uu({...r,destination:n});return i.pipe=Hu.bind(void 0,{...e,source:n,sourcePromise:i,boundOptions:{}}),i},Uu=async({sourcePromise:e,sourceStream:t,sourceOptions:n,sourceError:r,destination:i,destinationStream:a,destinationError:o,unpipeSignal:s,fileDescriptors:c,startTime:l})=>{let u=Wu(e,i);Ou({sourceStream:t,sourceError:r,destinationStream:a,destinationError:o,fileDescriptors:c,sourceOptions:n,startTime:l});let d=new AbortController;try{let e=Nu(t,a,d);return await Promise.race([Mu(u),...Bu(s,{sourceStream:t,mergedStream:e,sourceOptions:n,fileDescriptors:c,startTime:l})])}finally{d.abort()}},Wu=(e,t)=>Promise.allSettled([e,t]),Gu=({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:r,encoding:i,preserveNewlines:a})=>{let o=new AbortController;return Ku(t,o),Yu({stream:e,controller:o,binary:n,shouldEncode:!e.readableObjectMode&&r,encoding:i,shouldSplit:!e.readableObjectMode,preserveNewlines:a})},Ku=async(e,t)=>{try{await e}catch{}finally{t.abort()}},qu=({stream:e,onStreamEnd:t,lines:n,encoding:r,stripFinalNewline:i,allMixed:a})=>{let o=new AbortController;Ju(t,o,e);let s=e.readableObjectMode&&!a;return Yu({stream:e,controller:o,binary:r===`buffer`,shouldEncode:!s,encoding:r,shouldSplit:!s&&n,preserveNewlines:!i})},Ju=async(e,t,n)=>{try{await e}catch{n.destroy()}finally{t.abort()}},Yu=({stream:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o})=>Qu({onStdoutChunk:ie(e,`data`,{signal:t.signal,highWaterMark:Zu,highWatermark:Zu}),controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o}),Xu=_e(!0),Zu=Xu,Qu=async function*({onStdoutChunk:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o}){let s=$u({binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o});try{for await(let[t]of e)yield*X(t,s,0)}catch(e){if(!t.signal.aborted)throw e}finally{yield*Pc(s)}},$u=({binary:e,shouldEncode:t,encoding:n,shouldSplit:r,preserveNewlines:i})=>[Sc(e,n,!t),ic(e,i,!r,{})].filter(Boolean),ed=async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,buffer:i,maxBuffer:a,lines:o,allMixed:s,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=td({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:s,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([nd(e),d]);return}let f=qu({stream:e,onStreamEnd:t,lines:o,encoding:r,stripFinalNewline:rc(c,n),allMixed:s}),[p]=await Promise.all([rd({stream:e,iterable:f,fdNumber:n,encoding:r,maxBuffer:a,lines:o}),d]);return p},td=async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:i,verboseInfo:a,streamInfo:{fileDescriptors:o}})=>{Gc({stdioItems:o[n]?.stdioItems,encoding:r,verboseInfo:a,fdNumber:n})&&await Jc(qu({stream:e,onStreamEnd:t,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:i}),e,n,a)},nd=async e=>{await ee(),e.readableFlowing===null&&e.resume()},rd=async({stream:e,stream:{readableObjectMode:t},iterable:n,fdNumber:r,encoding:i,maxBuffer:a,lines:o})=>{try{return t||o?await _a(n,{maxBuffer:a}):i===`buffer`?new Uint8Array(await ya(n,{maxBuffer:a})):await Pa(n,{maxBuffer:a})}catch(n){return ad(Ra({error:n,stream:e,readableObjectMode:t,lines:o,encoding:i,fdNumber:r}))}},id=async e=>{try{return await e}catch(e){return ad(e)}},ad=({bufferedData:e})=>Te(e)?new Uint8Array(e):e,od=async(e,t,n,{isSameDirection:r,stopOnExit:i=!1}={})=>{let a=sd(e,n),o=new AbortController;try{await Promise.race([...i?[n.exitPromise]:[],D(e,{cleanup:!0,signal:o.signal})])}catch(e){a.stdinCleanedUp||ud(e,t,n,r)}finally{o.abort()}},sd=(e,{originalStreams:[t],subprocess:n})=>{let r={stdinCleanedUp:!1};return e===t&&cd(e,n,r),r},cd=(e,t,n)=>{let{_destroy:r}=e;e._destroy=(...i)=>{ld(t,n),r.call(e,...i)}},ld=({exitCode:e,signalCode:t},n)=>{(e!==null||t!==null)&&(n.stdinCleanedUp=!0)},ud=(e,t,n,r)=>{if(!dd(e,t,n,r))throw e},dd=(e,t,n,r=!0)=>n.propagating?md(e)||pd(e):(n.propagating=!0,fd(n,t)===r?md(e):pd(e)),fd=({fileDescriptors:e},t)=>t!==`all`&&e[t].direction===`input`,pd=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,md=e=>e?.code===`EPIPE`,hd=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:a,verboseInfo:o,streamInfo:s})=>e.stdio.map((e,c)=>gd({stream:e,fdNumber:c,encoding:t,buffer:n[c],maxBuffer:r[c],lines:i[c],allMixed:!1,stripFinalNewline:a,verboseInfo:o,streamInfo:s})),gd=async({stream:e,fdNumber:t,encoding:n,buffer:r,maxBuffer:i,lines:a,allMixed:o,stripFinalNewline:s,verboseInfo:c,streamInfo:l})=>{if(!e)return;let u=od(e,t,l);if(fd(l,t)){await u;return}let[d]=await Promise.all([ed({stream:e,onStreamEnd:u,fdNumber:t,encoding:n,buffer:r,maxBuffer:i,lines:a,allMixed:o,stripFinalNewline:s,verboseInfo:c,streamInfo:l}),u]);return d},_d=({stdout:e,stderr:t},{all:n})=>n&&(e||t)?Gl([e,t].filter(Boolean)):void 0,vd=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:a,verboseInfo:o,streamInfo:s})=>gd({...yd(e,n),fdNumber:`all`,encoding:t,maxBuffer:r[1]+r[2],lines:i[1]||i[2],allMixed:bd(e),stripFinalNewline:a,verboseInfo:o,streamInfo:s}),yd=({stdout:e,stderr:t,all:n},[,r,i])=>{let a=r||i;return a?r?i?{stream:n,buffer:a}:{stream:e,buffer:a}:{stream:t,buffer:a}:{stream:n,buffer:a}},bd=({all:e,stdout:t,stderr:n})=>e&&t&&n&&t.readableObjectMode!==n.readableObjectMode,xd=e=>ct(e,`ipc`),Sd=(e,t)=>{F({type:`ipc`,verboseMessage:Jt(e),fdNumber:`ipc`,verboseInfo:t})},Cd=async({subprocess:e,buffer:t,maxBuffer:n,ipc:r,ipcOutput:i,verboseInfo:a})=>{if(!r)return i;let o=xd(a),s=ot(t,`ipc`),c=ot(n,`ipc`);for await(let t of Ol({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))s&&(Ba(e,i,c),i.push(t)),o&&Sd(t,a);return i},wd=async(e,t)=>(await Promise.allSettled([e]),t),Td=async({subprocess:e,options:{encoding:t,buffer:n,maxBuffer:r,lines:i,timeoutDuration:a,cancelSignal:o,gracefulCancel:s,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:m,originalStreams:h,onInternalError:g,controller:_})=>{let v=al(e,f),y={originalStreams:h,fileDescriptors:m,subprocess:e,exitPromise:v,propagating:!1},b=hd({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:y}),x=vd({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:y}),S=[],C=Cd({subprocess:e,buffer:n,maxBuffer:r,ipc:u,ipcOutput:S,verboseInfo:p}),w=Ed(h,e,y),ee=Dd(m,y);try{return await Promise.race([Promise.all([{},cl(v),Promise.all(b),x,C,wi(e,d),...w,...ee]),g,Od(e,_),...vi(e,a,f,_),...Xn({subprocess:e,cancelSignal:o,gracefulCancel:s,context:f,controller:_}),...mi({subprocess:e,cancelSignal:o,gracefulCancel:s,forceKillAfterDelay:c,context:f,controller:_})])}catch(e){return f.terminationReason??=`other`,Promise.all([{error:e},v,Promise.all(b.map(e=>id(e))),id(x),wd(C,S),Promise.allSettled(w),Promise.allSettled(ee)])}},Ed=(e,t,n)=>e.map((e,r)=>e===t.stdio[r]?void 0:od(e,r,n)),Dd=(e,t)=>e.flatMap(({stdioItems:e},n)=>e.filter(({value:e,stream:t=e})=>U(t,{checkOpen:!1})&&!M(t)).map(({type:e,value:r,stream:i=r})=>od(i,n,t,{isSameDirection:K.has(e),stopOnExit:e===`native`}))),Od=async(e,{signal:t})=>{let[n]=await E(e,`error`,{signal:t});throw n},kd=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),Ad=(e,t,n)=>{let r=e[n];r.has(t)||r.set(t,[]);let i=r.get(t),a=hr();return i.push(a),{resolve:a.resolve.bind(a),promises:i}},jd=async({resolve:e,promises:t},n)=>{e();let[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...t])]);return!r},Md=async e=>{if(e!==void 0)try{await Pd(e)}catch{}},Nd=async e=>{if(e!==void 0)try{await Fd(e)}catch{}},Pd=async e=>{await D(e,{cleanup:!0,readable:!1,writable:!0})},Fd=async e=>{await D(e,{cleanup:!0,readable:!0,writable:!1})},Id=async(e,t)=>{if(await e,t)throw t},Ld=(e,t,n)=>{n&&!pd(n)?e.destroy(n):t&&e.destroy()},Rd=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,binary:i=!0,preserveNewlines:a=!0}={})=>{let o=i||H.has(n),{subprocessStdout:s,waitReadableDestroy:c}=zd(e,r,t),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=Bd(s,o),{read:p,onStdoutDataDone:m}=Vd({subprocessStdout:s,subprocess:e,binary:o,encoding:n,preserveNewlines:a}),h=new O({read:p,destroy:f(Wd.bind(void 0,{subprocessStdout:s,subprocess:e,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return Ud({subprocessStdout:s,onStdoutDataDone:m,readable:h,subprocess:e}),h},zd=(e,t,n)=>{let r=_r(e,t);return{subprocessStdout:r,waitReadableDestroy:Ad(n,r,`readableDestroy`)}},Bd=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n},r)=>r?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:Xu},Vd=({subprocessStdout:e,subprocess:t,binary:n,encoding:r,preserveNewlines:i})=>{let a=hr(),o=Gu({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:i});return{read(){Hd(this,o,a)},onStdoutDataDone:a}},Hd=async(e,t,n)=>{try{let{value:r,done:i}=await t.next();i?n.resolve():e.push(r)}catch{}},Ud=async({subprocessStdout:e,onStdoutDataDone:t,readable:n,subprocess:r,subprocessStdin:i})=>{try{await Fd(e),await r,await Md(i),await t,n.readable&&n.push(null)}catch(e){await Md(i),Gd(n,e)}},Wd=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:n},r)=>{await jd(n,t)&&(Gd(e,r),await Id(t,r))},Gd=(e,t)=>{Ld(e,e.readable,t)},Kd=({subprocess:e,concurrentStreams:t},{to:n}={})=>{let{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:a}=qd(e,n,t),o=new ge({...Jd(r,e,i),destroy:f(Qd.bind(void 0,{subprocessStdin:r,subprocess:e,waitWritableFinal:i,waitWritableDestroy:a})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return Zd(r,o),o},qd=(e,t,n)=>{let r=gr(e,t);return{subprocessStdin:r,waitWritableFinal:Ad(n,r,`writableFinal`),waitWritableDestroy:Ad(n,r,`writableDestroy`)}},Jd=(e,t,n)=>({write:Yd.bind(void 0,e),final:f(Xd.bind(void 0,e,t,n))}),Yd=(e,t,n,r)=>{e.write(t,n)?r():e.once(`drain`,r)},Xd=async(e,t,n)=>{await jd(n,t)&&(e.writable&&e.end(),await t)},Zd=async(e,t,n)=>{try{await Pd(e),t.writable&&t.end()}catch(e){await Nd(n),$d(t,e)}},Qd=async({subprocessStdin:e,subprocess:t,waitWritableFinal:n,waitWritableDestroy:r},i)=>{await jd(n,t),await jd(r,t)&&($d(e,i),await Id(t,i))},$d=(e,t)=>{Ld(e,e.writable,t)},ef=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,to:i,binary:a=!0,preserveNewlines:o=!0}={})=>{let s=a||H.has(n),{subprocessStdout:c,waitReadableDestroy:l}=zd(e,r,t),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:p}=qd(e,i,t),{readableEncoding:m,readableObjectMode:h,readableHighWaterMark:g}=Bd(c,s),{read:_,onStdoutDataDone:v}=Vd({subprocessStdout:c,subprocess:e,binary:s,encoding:n,preserveNewlines:o}),y=new pe({read:_,...Jd(u,e,d),destroy:f(tf.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:e,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:p})),readableHighWaterMark:g,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:h,writableObjectMode:u.writableObjectMode,encoding:m});return Ud({subprocessStdout:c,onStdoutDataDone:v,readable:y,subprocess:e,subprocessStdin:u}),Zd(u,y,c),y},tf=async({subprocessStdout:e,subprocessStdin:t,subprocess:n,waitReadableDestroy:r,waitWritableFinal:i,waitWritableDestroy:a},o)=>{await Promise.all([Wd({subprocessStdout:e,subprocess:n,waitReadableDestroy:r},o),Qd({subprocessStdin:t,subprocess:n,waitWritableFinal:i,waitWritableDestroy:a},o)])},nf=(e,t,{from:n,binary:r=!1,preserveNewlines:i=!1}={})=>{let a=r||H.has(t),o=_r(e,n);return rf(Gu({subprocessStdout:o,subprocess:e,binary:a,shouldEncode:!0,encoding:t,preserveNewlines:i}),o,e)},rf=async function*(e,t,n){try{yield*e}finally{t.readable&&t.destroy(),await n}},af=(e,{encoding:t})=>{let n=kd();e.readable=Rd.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.writable=Kd.bind(void 0,{subprocess:e,concurrentStreams:n}),e.duplex=ef.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.iterable=nf.bind(void 0,e,t),e[Symbol.asyncIterator]=nf.bind(void 0,e,t,{})},of=(e,t)=>{for(let[n,r]of cf){let i=r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}},sf=(async()=>{})().constructor.prototype,cf=[`then`,`catch`,`finally`].map(e=>[e,Reflect.getOwnPropertyDescriptor(sf,e)]),lf=(e,t,n,r)=>{let{file:i,commandArguments:a,command:o,escapedCommand:s,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=uf(e,t,n),{subprocess:f,promise:p}=ff({file:i,commandArguments:a,options:u,startTime:c,verboseInfo:l,command:o,escapedCommand:s,fileDescriptors:d});return f.pipe=Hu.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:r}),of(f,p),z.set(f,{options:u,fileDescriptors:d}),f},uf=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=rn(e,t,n),{file:s,commandArguments:c,options:l}=Pi(e,t,n),u=df(l);return{file:s,commandArguments:c,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:u,fileDescriptors:Hl(u,o)}},df=({timeout:e,signal:t,...n})=>{if(t!==void 0)throw TypeError(`The "signal" option has been renamed to "cancelSignal" instead.`);return{...n,timeoutDuration:e}},ff=({file:e,commandArguments:t,options:n,startTime:r,verboseInfo:i,command:a,escapedCommand:o,fileDescriptors:s})=>{let l;try{l=c(...Li(e,t,n))}catch(e){return Il({error:e,command:a,escapedCommand:o,fileDescriptors:s,options:n,startTime:r,verboseInfo:i})}let u=new AbortController;ae(1/0,u.signal);let d=[...l.stdio];gu(l,s,u),Su(l,n,u);let f={},p=hr();l.kill=Un.bind(void 0,{kill:l.kill.bind(l),options:n,onInternalError:p,context:f,controller:u}),l.all=_d(l,n),af(l,n),Nl(l,n);let m=pf({subprocess:l,options:n,startTime:r,verboseInfo:i,fileDescriptors:s,originalStreams:d,command:a,escapedCommand:o,context:f,onInternalError:p,controller:u});return{subprocess:l,promise:m}},pf=async({subprocess:e,options:t,startTime:n,verboseInfo:r,fileDescriptors:i,originalStreams:a,command:o,escapedCommand:s,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],m,h,g]=await Td({subprocess:e,options:t,context:c,verboseInfo:r,fileDescriptors:i,originalStreams:a,onInternalError:l,controller:u});return u.abort(),l.resolve(),_o(mf({errorInfo:d,exitCode:f,signal:p,stdio:m.map((e,n)=>Y(e,t,n)),all:Y(h,t,`all`),ipcOutput:g,context:c,options:t,command:o,escapedCommand:s,startTime:n}),r,t)},mf=({errorInfo:e,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:a,context:o,options:s,command:c,escapedCommand:l,startTime:u})=>`error`in e?to({error:e.error,command:c,escapedCommand:l,timedOut:o.terminationReason===`timeout`,isCanceled:o.terminationReason===`cancel`||o.terminationReason===`gracefulCancel`,isGracefullyCanceled:o.terminationReason===`gracefulCancel`,isMaxBuffer:e.error instanceof fa,isForcefullyTerminated:o.isForcefullyTerminated,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:a,options:s,startTime:u,isSync:!1}):$a({command:c,escapedCommand:l,stdio:r,all:i,ipcOutput:a,options:s,startTime:u}),hf=(e,t)=>{let n=Object.fromEntries(Object.entries(t).map(([t,n])=>[t,gf(t,e[t],n)]));return{...e,...n}},gf=(e,t,n)=>_f.has(e)&&k(t)&&k(n)?{...t,...n}:n,_f=new Set([`env`,...at]),$=(e,t,n,r)=>{let i=(e,t,r)=>$(e,t,n,r),a=(...a)=>vf({mapArguments:e,deepOptions:n,boundOptions:t,setBoundExeca:r,createNested:i},...a);return r!==void 0&&r(a,i,t),a},vf=({mapArguments:e,deepOptions:t={},boundOptions:n={},setBoundExeca:r,createNested:i},a,...o)=>{if(k(a))return i(e,hf(n,a),r);let{file:s,commandArguments:c,options:l,isSync:u}=yf({mapArguments:e,firstArgument:a,nextArguments:o,deepOptions:t,boundOptions:n});return u?pl(s,c,l):lf(s,c,l,i)},yf=({mapArguments:e,firstArgument:t,nextArguments:n,deepOptions:r,boundOptions:i})=>{let[a,o,s]=Ce(...Ie(t)?Le(t,n):[t,...n]),c=hf(hf(r,i),s),{file:l=a,commandArguments:u=o,options:d=c,isSync:f=!1}=e({file:a,commandArguments:o,options:c});return{file:l,commandArguments:u,options:d,isSync:f}},bf=({file:e,commandArguments:t})=>Sf(e,t),xf=({file:e,commandArguments:t})=>({...Sf(e,t),isSync:!0}),Sf=(e,t)=>{if(t.length>0)throw TypeError(`The command and its arguments must be passed as a single string: ${e} ${t}.`);let[n,...r]=Cf(e);return{file:n,commandArguments:r}},Cf=e=>{if(typeof e!=`string`)throw TypeError(`The command must be a string: ${String(e)}.`);let t=e.trim();if(t===``)return[];let n=[];for(let e of t.split(wf)){let t=n.at(-1);t&&t.endsWith(`\\`)?n[n.length-1]=`${t.slice(0,-1)} ${e}`:n.push(e)}return n},wf=/ +/g,Tf=(e,t,n)=>{e.sync=t(Df,n),e.s=e.sync},Ef=({options:e})=>Of(e),Df=({options:e})=>({...Of(e),isSync:!0}),Of=e=>({options:{...kf(e),...e}}),kf=({input:e,inputFile:t,stdio:n})=>e===void 0&&t===void 0&&n===void 0?{stdin:`inherit`}:{},Af={preferLocal:!0},jf=$(()=>({})),Mf=$(()=>({isSync:!0}));$(bf),$(xf),$(bi),$(Ef,{},Af,Tf);const{sendMessage:Nf,getOneMessage:Pf,getEachMessage:Ff,getCancelSignal:If}=Pl();var Lf=t({builder:()=>Gf,command:()=>`git`,description:()=>``});const Rf=`git`,zf=``,Bf=process.cwd();function Vf(){try{return!!Mf(`git`,[`--version`],{cwd:Bf}).stdout}catch{throw Error(`git is not installed`)}}function Hf(){try{return Mf(`git`,[`rev-parse`,`--is-inside-work-tree`],{cwd:Bf}).stdout===`true`}catch{throw Error(`not a git repository`)}}function Uf(){return jf(`git`,[`config`,`core.hooksPath`,`.githooks`],{cwd:Bf})}function Wf(){try{return Vf()&&Hf()}catch(e){return console.error(`Fail:`,e.message),!1}}function Gf(e){e.command(`hooks`,`Set .githooks as git.hooksPath`,{},()=>{Wf()&&Uf().then(()=>{console.log(`Done: set .githooks`)}).catch(()=>{console.error(`Fail:`,`setting hooks failed`),process.exitCode=1})}),e.demandCommand(1,"Typing `hooks`")}export{jf as a,Lf as i,Rf as n,zf as r,Gf as t};