@nice-move/cli 0.11.26 → 0.11.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-K9suQA8w.mjs +1 -0
- package/dist/cli-truncate-C4mnTArR.mjs +1 -0
- package/dist/cli.mjs +1 -1
- package/dist/cmd/git.mjs +1 -1
- package/dist/cmd/lint.mjs +1 -1
- package/dist/git-hooks-CM3vzMX9.mjs +35 -0
- package/dist/{lib-DYR86uKu.mjs → lib-CV3GNWIq.mjs} +2 -2
- package/dist/lib-Co7AUZZ4.mjs +39 -0
- package/dist/lint-B_6wPTR7.mjs +1 -0
- package/dist/lint-d0uGpI_d.mjs +6 -0
- package/dist/log-update-CbwACYto.mjs +5 -0
- package/dist/mjs-Cl59bDdr.mjs +1 -0
- package/dist/path-key-DxEsgIFz.mjs +1 -0
- package/dist/source-CW9jQ_O2.mjs +5 -0
- package/dist/string-width-C0SXopGZ.mjs +1 -0
- package/dist/wrap-ansi--xQZdqGK.mjs +8 -0
- package/package.json +6 -7
- package/dist/chunk-CYNyJ7h0.mjs +0 -1
- package/dist/cli-truncate-hj9TMKuW.mjs +0 -1
- package/dist/git-hooks-DAgct2kR.mjs +0 -34
- package/dist/lib-Dzjqv24Q.mjs +0 -39
- package/dist/lint-BoG2Et94.mjs +0 -1
- package/dist/lint-Cidlfm-v.mjs +0 -6
- package/dist/log-update-D1TopJsV.mjs +0 -5
- package/dist/mjs-D7OvYRUm.mjs +0 -1
- package/dist/path-key-DNlqev5T.mjs +0 -1
- package/dist/source-DtPIOlG2.mjs +0 -5
- package/dist/string-width-B0yJp9KT.mjs +0 -1
- package/dist/wrap-ansi-BuNLU9x3.mjs +0 -8
- package/dist/wrap-ansi-CY1LiFIZ.mjs +0 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import e from"node:process";import t from"node:tty";import n from"node:os";const r=(e=0)=>t=>`\u001B[${t+e}m`,i=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,a=(e=0)=>(t,n,r)=>`\u001B[${38+e};2;${t};${n};${r}m`,o={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(o.modifier);const s=Object.keys(o.color),c=Object.keys(o.bgColor);[...s,...c];function l(){let e=new Map;for(let[t,n]of Object.entries(o)){for(let[t,r]of Object.entries(n))o[t]={open:`\u001B[${r[0]}m`,close:`\u001B[${r[1]}m`},n[t]=o[t],e.set(r[0],r[1]);Object.defineProperty(o,t,{value:n,enumerable:!1})}return Object.defineProperty(o,`codes`,{value:e,enumerable:!1}),o.color.close=`\x1B[39m`,o.bgColor.close=`\x1B[49m`,o.color.ansi=r(),o.color.ansi256=i(),o.color.ansi16m=a(),o.bgColor.ansi=r(10),o.bgColor.ansi256=i(10),o.bgColor.ansi16m=a(10),Object.defineProperties(o,{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=>o.rgbToAnsi256(...o.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)=>o.ansi256ToAnsi(o.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>o.ansi256ToAnsi(o.hexToAnsi256(e)),enumerable:!1}}),o}var u=l();function d(t,n=globalThis.Deno?globalThis.Deno.args:e.argv){let r=t.startsWith(`-`)?``:t.length===1?`-`:`--`,i=n.indexOf(r+t),a=n.indexOf(`--`);return i!==-1&&(a===-1||i<a)}const{env:f}=e;let p;d(`no-color`)||d(`no-colors`)||d(`color=false`)||d(`color=never`)?p=0:(d(`color`)||d(`colors`)||d(`color=true`)||d(`color=always`))&&(p=1);function m(){if(`FORCE_COLOR`in f)return f.FORCE_COLOR===`true`?1:f.FORCE_COLOR===`false`?0:f.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(f.FORCE_COLOR,10),3)}function h(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function g(t,{streamIsTTY:r,sniffFlags:i=!0}={}){let a=m();a!==void 0&&(p=a);let o=i?p:a;if(o===0)return 0;if(i){if(d(`color=16m`)||d(`color=full`)||d(`color=truecolor`))return 3;if(d(`color=256`))return 2}if(`TF_BUILD`in f&&`AGENT_NAME`in f)return 1;if(t&&!r&&o===void 0)return 0;let s=o||0;if(f.TERM===`dumb`)return s;if(e.platform===`win32`){let e=n.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in f)return[`GITHUB_ACTIONS`,`GITEA_ACTIONS`,`CIRCLECI`].some(e=>e in f)?3:[`TRAVIS`,`APPVEYOR`,`GITLAB_CI`,`BUILDKITE`,`DRONE`].some(e=>e in f)||f.CI_NAME===`codeship`?1:s;if(`TEAMCITY_VERSION`in f)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(f.TEAMCITY_VERSION)?1:0;if(f.COLORTERM===`truecolor`||f.TERM===`xterm-kitty`||f.TERM===`xterm-ghostty`||f.TERM===`wezterm`)return 3;if(`TERM_PROGRAM`in f){let e=Number.parseInt((f.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(f.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(f.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(f.TERM)||`COLORTERM`in f?1:s}function _(e,t={}){return h(g(e,{streamIsTTY:e&&e.isTTY,...t}))}var v={stdout:_({isTTY:t.isatty(1)}),stderr:_({isTTY:t.isatty(2)})};function y(e,t,n){let r=e.indexOf(t);if(r===-1)return e;let i=t.length,a=0,o=``;do o+=e.slice(a,r)+t+n,a=r+i,r=e.indexOf(t,a);while(r!==-1);return o+=e.slice(a),o}function b(e,t,n,r){let i=0,a=``;do{let o=e[r-1]===`\r`;a+=e.slice(i,o?r-1:r)+t+(o?`\r
|
|
2
|
+
`:`
|
|
3
|
+
`)+n,i=r+1,r=e.indexOf(`
|
|
4
|
+
`,i)}while(r!==-1);return a+=e.slice(i),a}const{stdout:x,stderr:S}=v,C=Symbol(`GENERATOR`),w=Symbol(`STYLER`),T=Symbol(`IS_EMPTY`),E=[`ansi`,`ansi`,`ansi256`,`ansi16m`],D=Object.create(null),O=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let n=x?x.level:0;e.level=t.level===void 0?n:t.level},k=e=>{let t=(...e)=>e.join(` `);return O(t,e),Object.setPrototypeOf(t,A.prototype),t};function A(e){return k(e)}Object.setPrototypeOf(A.prototype,Function.prototype);for(let[e,t]of Object.entries(u))D[e]={get(){let n=P(this,N(t.open,t.close,this[w]),this[T]);return Object.defineProperty(this,e,{value:n}),n}};D.visible={get(){let e=P(this,this[w],!0);return Object.defineProperty(this,`visible`,{value:e}),e}};const j=(e,t,n,...r)=>e===`rgb`?t===`ansi16m`?u[n].ansi16m(...r):t===`ansi256`?u[n].ansi256(u.rgbToAnsi256(...r)):u[n].ansi(u.rgbToAnsi(...r)):e===`hex`?j(`rgb`,t,n,...u.hexToRgb(...r)):u[n][e](...r);for(let e of[`rgb`,`hex`,`ansi256`]){D[e]={get(){let{level:t}=this;return function(...n){let r=N(j(e,E[t],`color`,...n),u.color.close,this[w]);return P(this,r,this[T])}}};let t=`bg`+e[0].toUpperCase()+e.slice(1);D[t]={get(){let{level:t}=this;return function(...n){let r=N(j(e,E[t],`bgColor`,...n),u.bgColor.close,this[w]);return P(this,r,this[T])}}}}const M=Object.defineProperties(()=>{},{...D,level:{enumerable:!0,get(){return this[C].level},set(e){this[C].level=e}}}),N=(e,t,n)=>{let r,i;return n===void 0?(r=e,i=t):(r=n.openAll+e,i=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:i,parent:n}},P=(e,t,n)=>{let r=(...e)=>F(r,e.length===1?``+e[0]:e.join(` `));return Object.setPrototypeOf(r,M),r[C]=e,r[w]=t,r[T]=n,r},F=(e,t)=>{if(e.level<=0||!t)return e[T]?``:t;let n=e[w];if(n===void 0)return t;let{openAll:r,closeAll:i}=n;if(t.includes(`\x1B`))for(;n!==void 0;)t=y(t,n.close,n.open),n=n.parent;let a=t.indexOf(`
|
|
5
|
+
`);return a!==-1&&(t=b(t,i,r,a)),r+t+i};Object.defineProperties(A.prototype,D);const I=A();A({level:S?S.level:0});var L=I;export{L as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,t}from"./chunk-K9suQA8w.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=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}var 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.replace(d,``)}function p(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}function m(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function h(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e>=94192&&e<=94198||e>=94208&&e<=101589||e>=101631&&e<=101662||e>=101760&&e<=101874||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128728||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129674||e>=129678&&e<=129734||e===129736||e>=129741&&e<=129756||e>=129759&&e<=129770||e>=129775&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function g(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function _(e,{ambiguousAsWide:t=!1}={}){return g(e),m(e)||h(e)||t&&p(e)?2:1}var v=e(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 y=new Intl.Segmenter,b=/^\p{Default_Ignorable_Code_Point}$/u;function x(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 y.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)&&!b.test(t)){if((0,v.default)().test(t)){i+=2;continue}i+=_(e,a)}}return i}export{l as a,f as i,m as n,h as r,x as t};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{a as e,i as t,t as n}from"./string-width-C0SXopGZ.mjs";const r=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,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nice-move/cli",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.28",
|
|
4
4
|
"description": "Frontend develop helper for frontend development",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
7
|
-
"name": "Eric Chen"
|
|
8
|
-
"email": "airkro@qq.com"
|
|
7
|
+
"name": "Eric Chen"
|
|
9
8
|
},
|
|
10
9
|
"keywords": [
|
|
11
10
|
"eslint",
|
|
@@ -41,14 +40,14 @@
|
|
|
41
40
|
"cheetor": "^0.13.0"
|
|
42
41
|
},
|
|
43
42
|
"devDependencies": {
|
|
44
|
-
"@commitlint/format": "^
|
|
45
|
-
"@commitlint/lint": "^
|
|
46
|
-
"execa": "^9.6.
|
|
43
|
+
"@commitlint/format": "^20.2.0",
|
|
44
|
+
"@commitlint/lint": "^20.2.0",
|
|
45
|
+
"execa": "^9.6.1",
|
|
47
46
|
"lint-staged": "^15.5.2",
|
|
48
47
|
"settingz": "^0.2.0"
|
|
49
48
|
},
|
|
50
49
|
"engines": {
|
|
51
|
-
"node": "
|
|
50
|
+
"node": ">=24.0.0 || ^22.18.0"
|
|
52
51
|
},
|
|
53
52
|
"publishConfig": {
|
|
54
53
|
"access": "public",
|
package/dist/chunk-CYNyJ7h0.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
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),t.exports),c=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},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{s as __commonJSMin,c as __export,d as __require,u as __toESM};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ansi_styles_default as e,stringWidth as t}from"./string-width-B0yJp9KT.mjs";function n(e){return Number.isInteger(e)?e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141):!1}const r=/^[\uD800-\uDBFF][\uDC00-\uDFFF]$/,i=[`\x1B`,``],a=e=>`${i[0]}[${e}m`,o=(t,n,r)=>{let i=[];t=[...t];for(let r of t){let o=r;r.includes(`;`)&&(r=r.split(`;`)[0][0]+`0`);let s=e.codes.get(Number.parseInt(r,10));if(s){let e=t.indexOf(s.toString());e===-1?i.push(a(n?s:o)):t.splice(e,1)}else if(n){i.push(a(0));break}else i.push(a(o))}if(n&&(i=i.filter((e,t)=>i.indexOf(e)===t),r!==void 0)){let t=a(e.codes.get(Number.parseInt(r,10)));i=i.reduce((e,n)=>n===t?[n,...e]:[...e,n],[])}return i.join(``)};function s(e,t,a){let s=[...e],c=[],l=typeof a==`number`?a:s.length,u=!1,d,f=0,p=``;for(let[m,h]of s.entries()){let s=!1;if(i.includes(h)){let t=/\d[^m]*/.exec(e.slice(m,m+18));d=t&&t.length>0?t[0]:void 0,f<l&&(u=!0,d!==void 0&&c.push(d))}else u&&h===`m`&&(u=!1,s=!0);if(!u&&!s&&f++,!r.test(h)&&n(h.codePointAt())&&(f++,typeof a!=`number`&&l++),f>t&&f<=l)p+=h;else if(f===t&&!u&&d!==void 0)p=o(c);else if(f>=l){p+=o(c,!0,d);break}}return p}function c(e,t,n){if(e.charAt(t)===` `)return t;let r=n?1:-1;for(let n=0;n<=3;n++){let i=t+n*r;if(e.charAt(i)===` `)return i}return t}function l(e,n,r={}){let{position:i=`end`,space:a=!1,preferTruncationOnSpace:o=!1}=r,{truncationCharacter:l=`…`}=r;if(typeof e!=`string`)throw TypeError(`Expected \`input\` to be a string, got ${typeof e}`);if(typeof n!=`number`)throw TypeError(`Expected \`columns\` to be a number, got ${typeof n}`);if(n<1)return``;if(n===1)return l;let u=t(e);if(u<=n)return e;if(i===`start`){if(o){let t=c(e,u-n+1,!0);return l+s(e,t,u).trim()}return a===!0&&(l+=` `),l+s(e,u-n+t(l),u)}if(i===`middle`){a===!0&&(l=` ${l} `);let r=Math.floor(n/2);if(o){let t=c(e,r),i=c(e,u-(n-r)+1,!0);return s(e,0,t)+l+s(e,i,u).trim()}return s(e,0,r)+l+s(e,u-(n-r)+t(l),u)}if(i===`end`){if(o){let t=c(e,n-1);return s(e,0,t)+l}return a===!0&&(l=` ${l}`),s(e,0,n-t(l))+l}throw Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${i}`)}export{l as default};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import{__export as e,__toESM as t}from"./chunk-CYNyJ7h0.mjs";import{pathKey as n,require_cross_spawn as r}from"./path-key-DNlqev5T.mjs";import{onExit as i}from"./mjs-D7OvYRUm.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)=>{let n=je(e,t);return n.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],u=Array.isArray(l)?l.map(e=>Ue(e)):[Ue(l)];return He(c,u,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 e===void 0?TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):TypeError(`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 ot)t[n]=Je(e,n);return t},Je=(e,t)=>{let n=Array.from({length:Ye(e)+1}),r=Xe(e[t],n,t);return rt(r,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?at[t]:e),it=p(`execa`).enabled?`full`:`none`,at={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:it,stripFinalNewline:!0},ot=[`lines`,`buffer`,`maxBuffer`,`verbose`,`stripFinalNewline`],P=(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):P(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],r=n.join(` `),i=n.map(e=>St(gt(e))).join(` `);return{command:r,escapedCommand:i}},ht=e=>g(e).split(`
|
|
6
|
-
`).map(e=>gt(e)).join(`
|
|
7
|
-
`),gt=e=>e.replaceAll(yt,e=>_t(e)),_t=e=>{let t=bt[e];if(t!==void 0)return t;let n=e.codePointAt(0),r=n.toString(16);return n<=xt?`\\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=vt(),bt={" ":` `,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`},xt=65535,St=e=>Ct.test(e)?e:x===`win32`?`"${e.replaceAll(`"`,`""`)}"`:`'${e.replaceAll(`'`,`'\\''`)}'`,Ct=/^[\w./-]+$/;function wt(){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 Tt={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:`╱`},Et={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:`⅒`},Dt={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`},Ot={...Tt,...Et},kt={...Tt,...Dt},At=wt(),jt=At?Ot:kt;var Mt=jt;const Nt=Object.entries(Et),Pt=S?.WriteStream?.prototype?.hasColors?.()??!1,F=(e,t)=>{if(!Pt)return e=>e;let n=`\u001B[${e}m`,r=`\u001B[${t}m`;return e=>{let t=e+``,i=t.indexOf(r);if(i===-1)return n+t+r;let a=n,o=0;for(;i!==-1;)a+=t.slice(o,i)+n,o=i+r.length,i=t.indexOf(r,o);return a+=t.slice(o)+r,a}},Ft=F(0,0),It=F(1,22),Lt=F(2,22),Rt=F(3,23),zt=F(4,24),Bt=F(53,55),Vt=F(7,27),Ht=F(8,28),Ut=F(9,29),Wt=F(30,39),Gt=F(31,39),Kt=F(32,39),qt=F(33,39),Jt=F(34,39),Yt=F(35,39),Xt=F(36,39),Zt=F(37,39),Qt=F(90,39),$t=F(40,49),en=F(41,49),tn=F(42,49),nn=F(43,49),rn=F(44,49),an=F(45,49),on=F(46,49),sn=F(47,49),cn=F(100,49),ln=F(91,39),un=F(92,39),dn=F(93,39),fn=F(94,39),pn=F(95,39),mn=F(96,39),hn=F(97,39),gn=F(101,49),_n=F(102,49),vn=F(103,49),yn=F(104,49),bn=F(105,49),xn=F(106,49),Sn=F(107,49),Cn=({type:e,message:t,timestamp:n,piped:r,commandId:i,result:{failed:a=!1}={},options:{reject:o=!0}})=>{let s=wn(n),c=Dn[e]({failed:a,reject:o,piped:r}),l=kn[e]({reject:o});return`${Qt(`[${s}]`)} ${Qt(`[${i}]`)} ${l(c)} ${l(t)}`},wn=e=>`${Tn(e.getHours(),2)}:${Tn(e.getMinutes(),2)}:${Tn(e.getSeconds(),2)}.${Tn(e.getMilliseconds(),3)}`,Tn=(e,t)=>String(e).padStart(t,`0`),En=({failed:e,reject:t})=>e?t?Mt.cross:Mt.warning:Mt.tick,Dn={command:({piped:e})=>e?`|`:`$`,output:()=>` `,ipc:()=>`*`,error:En,duration:En},On=e=>e,kn={command:()=>It,output:()=>On,ipc:()=>On,error:({reject:e})=>e?ln:dn,duration:()=>Qt},An=(e,t,n)=>{let r=lt(t,n);return e.map(({verboseLine:e,verboseObject:t})=>jn(e,t,r)).filter(e=>e!==void 0).map(e=>Mn(e)).join(``)},jn=(e,t,n)=>{if(n===void 0)return e;let r=n(e,t);if(typeof r==`string`)return r},Mn=e=>e.endsWith(`
|
|
8
|
-
`)?e:`${e}\n`,Nn=({type:e,verboseMessage:t,fdNumber:n,verboseInfo:r,result:i})=>{let a=Pn({type:e,result:i,verboseInfo:r}),o=Fn(t,a),s=An(o,r,n);s!==``&&console.warn(s.slice(0,-1))},Pn=({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}),Fn=(e,t)=>e.split(`
|
|
9
|
-
`).map(e=>In({...t,message:e})),In=e=>{let t=Cn(e);return{verboseLine:t,verboseObject:e}},Ln=e=>{let t=typeof e==`string`?e:m(e),n=ht(t);return n.replaceAll(` `,` `.repeat(Rn))},Rn=2,zn=(e,t)=>{st(t)&&Nn({type:`command`,verboseMessage:e,verboseInfo:t})},Bn=(e,t,n)=>{Un(e);let r=Vn(e);return{verbose:e,escapedCommand:t,commandId:r,rawOptions:n}},Vn=e=>st({verbose:e})?Hn++:void 0;let Hn=0n;const Un=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.`)}}},Wn=()=>b.bigint(),Gn=e=>Number(b.bigint()-e)/1e6,Kn=(e,t,n)=>{let r=Wn(),{command:i,escapedCommand:a}=mt(e,t),o=Je(n,`verbose`),s=Bn(o,a,{...n});return zn(a,s),{command:i,escapedCommand:a,startTime:r,verboseInfo:s}},qn=h(s);function Jn(e){return e instanceof URL?a(e):e}function Yn(e){return{*[Symbol.iterator](){let t=C.resolve(Jn(e)),n;for(;n!==t;)yield t,n=t,t=C.resolve(t,`..`)}}}const Xn=10*1024*1024,Zn=({cwd:e=_.cwd(),path:t=_.env[n()],preferLocal:r=!0,execPath:i=_.execPath,addExecPath:a=!0}={})=>{let o=C.resolve(Jn(e)),s=[],c=t.split(C.delimiter);return r&&Qn(s,c,o),a&&$n(s,c,i,o),t===``||t===C.delimiter?`${s.join(C.delimiter)}${t}`:[...s,t].join(C.delimiter)},Qn=(e,t,n)=>{for(let r of Yn(n)){let n=C.join(r,`node_modules/.bin`);t.includes(n)||e.push(n)}},$n=(e,t,n,r)=>{let i=C.resolve(r,Jn(n),`..`);t.includes(i)||e.push(i)},er=({env:e=_.env,...t}={})=>{e={...e};let r=n({env:e});return t.path=e[r],e[r]=Zn(t),e},tr=(e,t,n)=>{let r=n?sr:or,i=e instanceof I?{}:{cause:e};return new r(t,i)};var I=class extends Error{};const nr=(e,t)=>{Object.defineProperty(e.prototype,`name`,{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,ir,{value:!0,writable:!1,enumerable:!1,configurable:!1})},rr=e=>ar(e)&&ir in e,ir=Symbol(`isExecaError`),ar=e=>Object.prototype.toString.call(e)===`[object Error]`;var or=class extends Error{};nr(or,or.name);var sr=class extends Error{};nr(sr,sr.name);const cr=()=>{let e=dr-ur+1;return Array.from({length:e},lr)},lr=(e,t)=>({name:`SIGRT${t+1}`,number:ur+t,action:`terminate`,description:`Application-specific signal (realtime)`,standard:`posix`}),ur=34,dr=64,fr=[{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`}],pr=()=>{let e=cr(),t=[...fr,...e].map(mr);return t},mr=({name:e,number:t,description:n,action:r,forced:i=!1,standard:a})=>{let{signals:{[e]:o}}=T,s=o!==void 0,c=s?o:t;return{name:e,number:c,description:n,supported:s,action:r,forced:i,standard:a}},hr=()=>{let e=pr();return Object.fromEntries(e.map(gr))},gr=({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}],_r=hr(),vr=()=>{let e=pr(),t=dr+1,n=Array.from({length:t},(t,n)=>yr(n,e));return Object.assign({},...n)},yr=(e,t)=>{let n=br(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}}},br=(e,t)=>{let n=t.find(({name:t})=>T.signals[t]===e);return n===void 0?t.find(t=>t.number===e):n},xr=vr(),Sr=e=>{let t="option `killSignal`";if(e===0)throw TypeError(`Invalid ${t}: 0 cannot be used.`);return wr(e,t)},Cr=e=>e===0?e:wr(e,"`subprocess.kill()`'s argument"),wr=(e,t)=>{if(Number.isInteger(e))return Tr(e,t);if(typeof e==`string`)return Or(e,t);throw TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.\n${kr()}`)},Tr=(e,t)=>{if(Dr.has(e))return Dr.get(e);throw TypeError(`Invalid ${t} ${e}: this signal integer does not exist.\n${kr()}`)},Er=()=>new Map(Object.entries(T.signals).reverse().map(([e,t])=>[t,e])),Dr=Er(),Or=(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${kr()}`)},kr=()=>`Available signal names: ${Ar()}.
|
|
10
|
-
Available signal numbers: ${jr()}.`,Ar=()=>Object.keys(T.signals).sort().map(e=>`'${e}'`).join(`, `),jr=()=>[...new Set(Object.values(T.signals).sort((e,t)=>e-t))].join(`, `),Mr=e=>_r[e].description,Nr=e=>{if(e===!1)return e;if(e===!0)return Pr;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Pr=1e3*5,Fr=({kill:e,options:{forceKillAfterDelay:t,killSignal:n},onInternalError:r,context:i,controller:a},o,s)=>{let{signal:c,error:l}=Ir(o,s,n);Lr(l,r);let u=e(c);return Rr({kill:e,signal:c,forceKillAfterDelay:t,killSignal:n,killResult:u,context:i,controller:a}),u},Ir=(e,t,n)=>{let[r=n,i]=ar(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&&!ar(i))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:Cr(r),error:i}},Lr=(e,t)=>{e!==void 0&&t.reject(e)},Rr=async({kill:e,signal:t,forceKillAfterDelay:n,killSignal:r,killResult:i,context:a,controller:o})=>{t===r&&i&&zr({kill:e,forceKillAfterDelay:n,context:a,controllerSignal:o.signal})},zr=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{}},Br=async(e,t)=>{e.aborted||await E(e,`abort`,{signal:t})},Vr=({cancelSignal:e})=>{if(e!==void 0&&Object.prototype.toString.call(e)!==`[object AbortSignal]`)throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)},Hr=({subprocess:e,cancelSignal:t,gracefulCancel:n,context:r,controller:i})=>t===void 0||n?[]:[Ur(e,t,r,i)],Ur=async(e,t,n,{signal:r})=>{throw await Br(t,r),n.terminationReason??=`cancel`,e.kill(),t.reason},Wr=({methodName:e,isSubprocess:t,ipc:n,isConnected:r})=>{Gr(e,t,n),Kr(e,t,r)},Gr=(e,t,n)=>{if(!n)throw Error(`${L(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},Kr=(e,t,n)=>{if(!n)throw Error(`${L(e,t)} cannot be used: the ${R(t)} has already exited or disconnected.`)},qr=e=>{throw Error(`${L(`getOneMessage`,e)} could not complete: the ${R(e)} exited or disconnected.`)},Jr=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
|
-
]);`)},Yr=(e,t)=>Error(`${L(`sendMessage`,t)} failed when sending an acknowledgment response to the ${R(t)}.`,{cause:e}),Xr=e=>{throw Error(`${L(`sendMessage`,e)} failed: the ${R(e)} is not listening to incoming messages.`)},Zr=e=>{throw Error(`${L(`sendMessage`,e)} failed: the ${R(e)} exited without listening to incoming messages.`)},Qr=()=>Error(`\`cancelSignal\` aborted: the ${R(!0)} disconnected.`),$r=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},ei=({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})},ti=({error:e,methodName:t,isSubprocess:n,message:r})=>{if(ni(e))throw Error(`${L(t,n)}'s argument type is invalid: the message cannot be serialized: ${String(r)}.`,{cause:e})},ni=({code:e,message:t})=>ri.has(e)||ii.some(e=>t.includes(e)),ri=new Set([`ERR_MISSING_ARGS`,`ERR_INVALID_ARG_TYPE`]),ii=[`could not be cloned`,`circular structure`,`call stack size exceeded`],L=(e,t,n=``)=>e===`cancelSignal`?"`cancelSignal`'s `controller.abort()`":`${ai(t)}${e}(${n})`,ai=e=>e?``:`subprocess.`,R=e=>e?`parent process`:`subprocess`,oi=e=>{e.connected&&e.disconnect()},z=()=>{let e={},t=new Promise((t,n)=>{Object.assign(e,{resolve:t,reject:n})});return Object.assign(t,e)},si=(e,t=`stdin`)=>{let n=!0,{options:r,fileDescriptors:i}=B.get(e),a=li(i,t,n),o=e.stdio[a];if(o===null)throw TypeError(fi(a,t,r,n));return o},ci=(e,t=`stdout`)=>{let n=!1,{options:r,fileDescriptors:i}=B.get(e),a=li(i,t,n),o=a===`all`?e.all:e.stdio[a];if(o==null)throw TypeError(fi(a,t,r,n));return o},B=new WeakMap,li=(e,t,n)=>{let r=ui(t,n);return di(r,t,n,e),r},ui=(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(`"${hi(t)}" must not be "${e}".
|
|
17
|
-
It must be ${r} or "fd3", "fd4" (and so on).
|
|
18
|
-
It is optional and defaults to "${i}".`)},di=(e,t,n,r)=>{let i=r[mi(e)];if(i===void 0)throw TypeError(`"${hi(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(`"${hi(n)}" must not be ${t}. It must be a readable stream, not writable.`);if(i.direction!==`input`&&n)throw TypeError(`"${hi(n)}" must not be ${t}. It must be a writable stream, not readable.`)},fi=(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}=pi(e,n);return`The "${i}: ${gi(a)}" option is incompatible with using "${hi(r)}: ${gi(t)}".
|
|
20
|
-
Please set this option with "pipe" instead.`},pi=(e,{stdin:t,stdout:n,stderr:r,stdio:i})=>{let a=mi(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]}},mi=e=>e===`all`?1:e,hi=e=>e?`to`:`from`,gi=e=>typeof e==`string`?`'${e}'`:typeof e==`number`?`${e}`:`Stream`,_i=(e,t,n)=>{let r=e.getMaxListeners();r===0||r===1/0||(e.setMaxListeners(r+t),re(n,()=>{e.setMaxListeners(e.getMaxListeners()-t)}))},vi=(e,t)=>{t&&yi(e)},yi=e=>{e.refCounted()},bi=(e,t)=>{t&&xi(e)},xi=e=>{e.unrefCounted()},Si=(e,t)=>{t&&(xi(e),xi(e))},Ci=(e,t)=>{t&&(yi(e),yi(e))},wi=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r},i)=>{if(Fi(i)||ta(i))return;Ei.has(e)||Ei.set(e,[]);let a=Ei.get(e);if(a.push(i),!(a.length>1))for(;a.length>0;){await Ui(e,r,i),await w.yield();let o=await Pi({wrappedMessage:a[0],anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r});a.shift(),r.emit(`message`,o),r.emit(`message:done`)}},Ti=async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r,boundOnMessage:i})=>{ra();let a=Ei.get(e);for(;a?.length>0;)await E(r,`message:done`);e.removeListener(`message`,i),Ci(t,n),r.connected=!1,r.emit(`disconnect`)},Ei=new WeakMap,Di=(e,t,n)=>{if(Oi.has(e))return Oi.get(e);let r=new ne;return r.connected=!0,Oi.set(e,r),ki({ipcEmitter:r,anyProcess:e,channel:t,isSubprocess:n}),r},Oi=new WeakMap,ki=({ipcEmitter:e,anyProcess:t,channel:n,isSubprocess:r})=>{let i=wi.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e});t.on(`message`,i),t.once(`disconnect`,Ti.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e,boundOnMessage:i})),Si(n,r)},Ai=e=>{let t=Oi.get(e);return t===void 0?e.channel!==null:t.connected},ji=({anyProcess:e,channel:t,isSubprocess:n,message:r,strict:i})=>{if(!i)return r;let a=Di(e,t,n),o=Wi(e,a);return{id:Mi++,type:zi,message:r,hasListeners:o}};let Mi=0n;const Ni=(e,t)=>{if(!(t?.type!==zi||t.hasListeners))for(let{id:t}of e)t!==void 0&&Li[t].resolve({isDeadlock:!0,hasListeners:!1})},Pi=async({wrappedMessage:e,anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:i})=>{if(e?.type!==zi||!t.connected)return e;let{id:a,message:o}=e,s={id:a,type:Bi,message:Wi(t,i)};try{await Ki({anyProcess:t,channel:n,isSubprocess:r,ipc:!0},s)}catch(e){i.emit(`strict:error`,e)}return o},Fi=e=>{if(e?.type!==Bi)return!1;let{id:t,message:n}=e;return Li[t]?.resolve({isDeadlock:!1,hasListeners:n}),!0},Ii=async(e,t,n)=>{if(e?.type!==zi)return;let r=z();Li[e.id]=r;let i=new AbortController;try{let{isDeadlock:e,hasListeners:a}=await Promise.race([r,Ri(t,n,i)]);e&&Jr(n),a||Xr(n)}finally{i.abort(),delete Li[e.id]}},Li={},Ri=async(e,t,{signal:n})=>{_i(e,1,n),await E(e,`disconnect`,{signal:n}),Zr(t)},zi=`execa:ipc:request`,Bi=`execa:ipc:response`,Vi=(e,t,n)=>{V.has(e)||V.set(e,new Set);let r=V.get(e),i=z(),a=n?t.id:void 0,o={onMessageSent:i,id:a};return r.add(o),{outgoingMessages:r,outgoingMessage:o}},Hi=({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()},Ui=async(e,t,n)=>{for(;!Wi(e,t)&&V.get(e)?.size>0;){let t=[...V.get(e)];Ni(t,n),await Promise.all(t.map(({onMessageSent:e})=>e))}},V=new WeakMap,Wi=(e,t)=>t.listenerCount(`message`)>Gi(e),Gi=e=>B.has(e)&&!P(B.get(e).options.buffer,`ipc`)?1:0,Ki=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},i,{strict:a=!1}={})=>{let o=`sendMessage`;return Wr({methodName:o,isSubprocess:n,ipc:r,isConnected:e.connected}),qi({anyProcess:e,channel:t,methodName:o,isSubprocess:n,message:i,strict:a})},qi=async({anyProcess:e,channel:t,methodName:n,isSubprocess:r,message:i,strict:a})=>{let o=ji({anyProcess:e,channel:t,isSubprocess:r,message:i,strict:a}),s=Vi(e,o,a);try{await Ji({anyProcess:e,methodName:n,isSubprocess:r,wrappedMessage:o,message:i})}catch(t){throw oi(e),t}finally{Hi(s)}},Ji=async({anyProcess:e,methodName:t,isSubprocess:n,wrappedMessage:r,message:i})=>{let a=Yi(e);try{await Promise.all([Ii(r,e,n),a(r)])}catch(e){throw ei({error:e,methodName:t,isSubprocess:n}),ti({error:e,methodName:t,isSubprocess:n,message:i}),e}},Yi=e=>{if(Xi.has(e))return Xi.get(e);let t=h(e.send.bind(e));return Xi.set(e,t),t},Xi=new WeakMap,Zi=(e,t)=>{let n=`cancelSignal`;return Kr(n,!1,e.connected),Ji({anyProcess:e,methodName:n,isSubprocess:!1,wrappedMessage:{type:na,message:t},message:t})},Qi=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>(await $i({anyProcess:e,channel:t,isSubprocess:n,ipc:r}),ia.signal),$i=async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>{if(!ea){if(ea=!0,!r){$r();return}if(t===null){ra();return}Di(e,t,n),await w.yield()}};let ea=!1;const ta=e=>e?.type===na?(ia.abort(e.message),!0):!1,na=`execa:ipc:cancel`,ra=()=>{ia.abort(Qr())},ia=new AbortController,aa=({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.")}},oa=({subprocess:e,cancelSignal:t,gracefulCancel:n,forceKillAfterDelay:r,context:i,controller:a})=>n?[sa({subprocess:e,cancelSignal:t,forceKillAfterDelay:r,context:i,controller:a})]:[],sa=async({subprocess:e,cancelSignal:t,forceKillAfterDelay:n,context:r,controller:{signal:i}})=>{await Br(t,i);let a=ca(t);throw await Zi(e,a),zr({kill:e.kill,forceKillAfterDelay:n,context:r,controllerSignal:i}),r.terminationReason??=`gracefulCancel`,t.reason},ca=({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},la=({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})`)},ua=(e,t,n,r)=>t===0||t===void 0?[]:[da(e,t,n,r)],da=async(e,t,n,{signal:r})=>{throw await te(t,void 0,{signal:r}),n.terminationReason??=`timeout`,e.kill(),new I},fa=({options:e})=>{if(e.node===!1)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}},pa=(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}]},ma=({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`.");_a[n](e)}},ha=e=>{try{oe(e)}catch(e){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},ga=e=>{try{JSON.stringify(e)}catch(e){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},_a={advanced:ha,json:ga},va=async(e,t)=>{t!==void 0&&await e.sendMessage(t)},ya=({encoding:e})=>{if(xa.has(e))return;let t=Sa(e);if(t!==void 0)throw TypeError(`Invalid option \`encoding: ${wa(e)}\`.
|
|
21
|
-
Please rename it to ${wa(t)}.`);let n=[...xa].map(e=>wa(e)).join(`, `);throw TypeError(`Invalid option \`encoding: ${wa(e)}\`.
|
|
22
|
-
Please rename it to one of: ${n}.`)},ba=new Set([`utf8`,`utf16le`]),H=new Set([`buffer`,`hex`,`base64`,`base64url`,`latin1`,`ascii`]),xa=new Set([...ba,...H]),Sa=e=>{if(e===null)return`buffer`;if(typeof e!=`string`)return;let t=e.toLowerCase();if(t in Ca)return Ca[t];if(xa.has(t))return t},Ca={"utf-8":`utf8`,"utf-16le":`utf16le`,"ucs-2":`utf16le`,ucs2:`utf16le`,binary:`latin1`},wa=e=>typeof e==`string`?`"${e}"`:String(e),Ta=(e=Ea())=>{let t=ye(e,`The "cwd" option`);return C.resolve(t)},Ea=()=>{try{return _.cwd()}catch(e){throw e.message=`The current directory does not exist.\n${e.message}`,e}},Da=(e,t)=>{if(t===Ea())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}`};var Oa=t(r(),1);const ka=(e,t,n)=>{n.cwd=Ta(n.cwd);let[r,i,a]=pa(e,t,n),{command:o,args:s,options:c}=Oa.default._parse(r,i,a),l=qe(c),u=Aa(l);return la(u),ya(u),ma(u),Vr(u),aa(u),u.shell=Se(u.shell),u.env=ja(u),u.killSignal=Sr(u.killSignal),u.forceKillAfterDelay=Nr(u.forceKillAfterDelay),u.lines=u.lines.map((e,t)=>e&&!H.has(u.encoding)&&u.buffer[t]),_.platform===`win32`&&C.basename(o,`.exe`)===`cmd`&&s.unshift(`/q`),{file:o,commandArguments:s,options:u}},Aa=({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}),ja=({env:e,extendEnv:t,preferLocal:n,node:r,localDirectory:i,nodePath:a})=>{let o=t?{..._.env,...e}:e;return n||r?er({env:o,cwd:i,execPath:a,preferLocal:n,addExecPath:r}):o},Ma=(e,t,n)=>n.shell&&t.length>0?[[e,...t].join(` `),[],n]:[e,t,n];function Na(e){if(typeof e==`string`)return Pa(e);if(!(ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1))throw Error(`Input must be a string or a Uint8Array`);return Fa(e)}const Pa=e=>e.at(-1)===Ia?e.slice(0,e.at(-2)===Ra?-2:-1):e,Fa=e=>e.at(-1)===La?e.subarray(0,e.at(-2)===za?-2:-1):e,Ia=`
|
|
23
|
-
`,La=Ia.codePointAt(0),Ra=`\r`,za=Ra.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 Ba(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 Va(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 Ha(e,t){return Ba(e,t)&&Va(e,t)}const Ua=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);var Wa=class{#t;#n;#r=!1;#e=void 0;constructor(e,t){this.#t=e,this.#n=t}next(){let e=()=>this.#s();return this.#e=this.#e?this.#e.then(e,e):e(),this.#e}return(e){let t=()=>this.#i(e);return this.#e?this.#e.then(t,t):t()}async#s(){if(this.#r)return{done:!0,value:void 0};let e;try{e=await this.#t.read()}catch(e){throw this.#e=void 0,this.#r=!0,this.#t.releaseLock(),e}return e.done&&(this.#e=void 0,this.#r=!0,this.#t.releaseLock()),e}async#i(e){if(this.#r)return{done:!0,value:e};if(this.#r=!0,!this.#n){let t=this.#t.cancel(e);return this.#t.releaseLock(),await t,{done:!0,value:e}}return this.#t.releaseLock(),{done:!0,value:e}}};const Ga=Symbol();function Ka(){return this[Ga].next()}Object.defineProperty(Ka,`name`,{value:`next`});function qa(e){return this[Ga].return(e)}Object.defineProperty(qa,`name`,{value:`return`});const Ja=Object.create(Ua,{next:{enumerable:!0,configurable:!0,writable:!0,value:Ka},return:{enumerable:!0,configurable:!0,writable:!0,value:qa}});function Ya({preventCancel:e=!1}={}){let t=this.getReader(),n=new Wa(t,e),r=Object.create(Ja);return r[Ga]=n,r}const Xa=e=>{if(Va(e,{checkOpen:!1})&&eo.on!==void 0)return Qa(e);if(typeof e?.[Symbol.asyncIterator]==`function`)return e;if(Za.call(e)===`[object ReadableStream]`)return Ya.call(e);throw TypeError(`The first argument must be a Readable, a ReadableStream, or an async iterable.`)},{toString:Za}=Object.prototype,Qa=async function*(e){let t=new AbortController,n={};$a(e,t,n);try{for await(let[n]of eo.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()}},$a=async(e,t,n)=>{try{await eo.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(e){n.error=e}finally{t.abort()}},eo={},to=async(e,{init:t,convertChunk:n,getSize:r,truncateChunk:i,addChunk:a,getFinalChunk:o,finalize:s},{maxBuffer:c=1/0}={})=>{let l=Xa(e),u=t();u.length=0;try{for await(let e of l){let t=ao(e),o=n[t](e,u);ro({convertedChunk:o,state:u,getSize:r,truncateChunk:i,addChunk:a,maxBuffer:c})}return no({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}},no=({state:e,getSize:t,truncateChunk:n,addChunk:r,getFinalChunk:i,maxBuffer:a})=>{let o=i(e);o!==void 0&&ro({convertedChunk:o,state:e,getSize:t,truncateChunk:n,addChunk:r,maxBuffer:a})},ro=({convertedChunk:e,state:t,getSize:n,truncateChunk:r,addChunk:i,maxBuffer:a})=>{let o=n(e),s=t.length+o;if(s<=a){io(e,t,i,s);return}let c=r(e,a-t.length);throw c!==void 0&&io(c,t,i,a),new so},io=(e,t,n,r)=>{t.contents=n(e,t,r),t.length=r},ao=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=oo.call(e);return n===`[object ArrayBuffer]`?`arrayBuffer`:n===`[object DataView]`?`dataView`:Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&oo.call(e.buffer)===`[object ArrayBuffer]`?`typedArray`:`others`},{toString:oo}=Object.prototype;var so=class extends Error{name=`MaxBufferError`;constructor(){super(`maxBuffer exceeded`)}};const W=e=>e,co=()=>void 0,lo=({contents:e})=>e,uo=e=>{throw Error(`Streams in object mode are not supported: ${String(e)}`)},fo=e=>e.length;async function po(e,t){return to(e,_o,t)}const mo=()=>({contents:[]}),ho=()=>1,go=(e,{contents:t})=>(t.push(e),t),_o={init:mo,convertChunk:{string:W,buffer:W,arrayBuffer:W,dataView:W,typedArray:W,others:W},getSize:ho,truncateChunk:co,addChunk:go,getFinalChunk:co,finalize:lo};async function vo(e,t){return to(e,Mo,t)}const yo=()=>({contents:new ArrayBuffer(0)}),bo=e=>xo.encode(e),xo=new TextEncoder,So=e=>new Uint8Array(e),Co=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),wo=(e,t)=>e.slice(0,t),To=(e,{contents:t,length:n},r)=>{let i=jo()?Do(t,r):Eo(t,r);return new Uint8Array(i).set(e,n),i},Eo=(e,t)=>{if(t<=e.byteLength)return e;let n=new ArrayBuffer(Oo(t));return new Uint8Array(n).set(new Uint8Array(e),0),n},Do=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let n=new ArrayBuffer(t,{maxByteLength:Oo(t)});return new Uint8Array(n).set(new Uint8Array(e),0),n},Oo=e=>ko**Math.ceil(Math.log(e)/Math.log(ko)),ko=2,Ao=({contents:e,length:t})=>jo()?e:e.slice(0,t),jo=()=>`resize`in ArrayBuffer.prototype,Mo={init:yo,convertChunk:{string:bo,buffer:So,arrayBuffer:So,dataView:Co,typedArray:Co,others:uo},getSize:fo,truncateChunk:wo,addChunk:To,getFinalChunk:co,finalize:Ao};async function No(e,t){return to(e,zo,t)}const Po=()=>({contents:``,textDecoder:new TextDecoder}),Fo=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),Io=(e,{contents:t})=>t+e,Lo=(e,t)=>e.slice(0,t),Ro=({textDecoder:e})=>{let t=e.decode();return t===``?void 0:t},zo={init:Po,convertChunk:{string:W,buffer:Fo,arrayBuffer:Fo,dataView:Fo,typedArray:Fo,others:uo},getSize:fo,truncateChunk:Lo,addChunk:Io,getFinalChunk:Ro,finalize:lo},Bo=({error:e,stream:t,readableObjectMode:n,lines:r,encoding:i,fdNumber:a})=>{if(!(e instanceof so))throw e;if(a===`all`)return e;let o=Vo(n,r,i);throw e.maxBufferInfo={fdNumber:a,unit:o},t.destroy(),e},Vo=(e,t,n)=>e?`objects`:t?`lines`:n===`buffer`?`bytes`:`characters`,Ho=(e,t,n)=>{if(t.length!==n)return;let r=new so;throw r.maxBufferInfo={fdNumber:`ipc`},r},Uo=(e,t)=>{let{streamName:n,threshold:r,unit:i}=Wo(e,t);return`Command's ${n} was larger than ${r} ${i}`},Wo=(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=P(t,n);return n===`ipc`?{streamName:`IPC output`,threshold:i,unit:`messages`}:{streamName:Ke(n),threshold:i,unit:r}},Go=(e,t,n)=>e?.code===`ENOBUFS`&&t!==null&&t.some(e=>e!==null&&e.length>qo(n)),Ko=(e,t,n)=>{if(!t)return e;let r=qo(n);return e.length>r?e.slice(0,r):e},qo=([,e])=>e,Jo=({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=Yo({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=Zo(r,_),x=b===void 0?``:`\n${b}`,S=`${y}: ${s}${x}`,C=t===void 0?[e[2],e[1]]:[t],w=[S,...C,...e.slice(3),n.map(e=>Qo(e)).join(`
|
|
24
|
-
`)].map(e=>ht(Na($o(e)))).filter(Boolean).join(`
|
|
25
|
-
|
|
26
|
-
`);return{originalMessage:b,shortMessage:S,message:w}},Yo=({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=Xo(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?`${Uo(e,i)}${m}`:a===void 0?d?`Command was killed with ${p} (${Mr(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}`},Xo=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:``,Zo=(e,t)=>{if(e instanceof I)return;let n=rr(e)?e.originalMessage:String(e?.message??e),r=ht(Da(n,t));return r===``?void 0:r},Qo=e=>typeof e==`string`?e:m(e),$o=e=>Array.isArray(e)?e.map(e=>Na(es(e))).filter(Boolean).join(`
|
|
27
|
-
`):es(e),es=e=>typeof e==`string`?e:A(e)?ke(e):``,ts=({command:e,escapedCommand:t,stdio:n,all:r,ipcOutput:i,options:{cwd:a},startTime:o})=>ss({command:e,escapedCommand:t,cwd:a,durationMs:Gn(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:[]}),ns=({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,isSync:o})=>rs({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}),rs=({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}=cs(l,u),{originalMessage:w,shortMessage:ee,message:te}=Jo({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=tr(e,te,b);return Object.assign(T,os({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},os=({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:_})=>ss({shortMessage:_,originalMessage:g,command:t,escapedCommand:n,cwd:h,durationMs:Gn(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:[]}),ss=e=>Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0)),cs=(e,t)=>{let n=e===null?void 0:e,r=t===null?void 0:t,i=r===void 0?void 0:Mr(t);return{exitCode:n,signal:r,signalDescription:i}},ls=e=>Number.isFinite(e)?e:0;function us(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(ls(e*1e3)%1e3),nanoseconds:Math.trunc(ls(e*1e6)%1e3)}}function ds(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 fs(e){switch(typeof e){case`number`:if(Number.isFinite(e))return us(e);break;case`bigint`:return ds(e)}throw TypeError(`Expected a finite number or bigint`)}const ps=e=>e===0||e===0n,ms=(e,t)=>t===1||t===1n?e:`${e}s`,hs=1e-7,gs=24n*60n*60n*1000n;function _s(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+hs),r=Math.round(n)/10**t;return r.toFixed(t)},o=(e,n,r,a)=>{if(!((i.length===0||!t.colonNotation)&&ps(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?` `+ms(n,e):r;i.push(a)}},s=fs(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){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=e>=1?Math.round(e):Math.ceil(e),c=a?e.toFixed(a):s;o(Number.parseFloat(c),`millisecond`,`ms`,c)}}else{let r=(n?Number(e%gs):e)/1e3%60,i=typeof t.secondsDecimalDigits==`number`?t.secondsDecimalDigits:1,s=a(r,i),c=t.keepDecimalsOnWholeSeconds?s:s.replace(/\.0+$/,``);o(Number.parseFloat(c),`second`,`s`,c)}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 vs=(e,t)=>{e.failed&&Nn({type:`error`,verboseMessage:e.shortMessage,verboseInfo:t,result:e})},ys=(e,t)=>{st(t)&&(vs(e,t),bs(e,t))},bs=(e,t)=>{let n=`(done in ${_s(e.durationMs)})`;Nn({type:`duration`,verboseMessage:n,verboseInfo:t,result:e})},xs=(e,t,{reject:n})=>{if(ys(e,t),e.failed&&n)throw e;return e},Ss=(e,t)=>G(e)?`asyncGenerator`:js(e)?`generator`:Ns(e)?`fileUrl`:Fs(e)?`filePath`:Hs(e)?`webStream`:U(e,{checkOpen:!1})?`native`:A(e)?`uint8Array`:Ws(e)?`asyncIterable`:Gs(e)?`iterable`:Us(e)?Ts({transform:e},t):Ms(e)?Cs(e,t):`native`,Cs=(e,t)=>Ha(e.transform,{checkOpen:!1})?ws(e,t):Us(e.transform)?Ts(e,t):Os(e,t),ws=(e,t)=>(Es(e,t,`Duplex stream`),`duplex`),Ts=(e,t)=>(Es(e,t,`web TransformStream`),`webTransform`),Es=({final:e,binary:t,objectMode:n},r,i)=>{Ds(e,`${r}.final`,i),Ds(t,`${r}.binary`,i),ks(n,`${r}.objectMode`)},Ds=(e,t,n)=>{if(e!==void 0)throw TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${n}.`)},Os=({transform:e,final:t,binary:n,objectMode:r},i)=>{if(e!==void 0&&!As(e))throw TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(Ha(t,{checkOpen:!1}))throw TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(Us(t))throw TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(t!==void 0&&!As(t))throw TypeError(`The \`${i}.final\` option must be a generator.`);return ks(n,`${i}.binary`),ks(r,`${i}.objectMode`),G(e)||G(t)?`asyncGenerator`:`generator`},ks=(e,t)=>{if(e!==void 0&&typeof e!=`boolean`)throw TypeError(`The \`${t}\` option must use a boolean.`)},As=e=>G(e)||js(e),G=e=>Object.prototype.toString.call(e)===`[object AsyncGeneratorFunction]`,js=e=>Object.prototype.toString.call(e)===`[object GeneratorFunction]`,Ms=e=>k(e)&&(e.transform!==void 0||e.final!==void 0),Ns=e=>Object.prototype.toString.call(e)===`[object URL]`,Ps=e=>Ns(e)&&e.protocol!==`file:`,Fs=e=>k(e)&&Object.keys(e).length>0&&Object.keys(e).every(e=>Is.has(e))&&Ls(e.file),Is=new Set([`file`,`append`]),Ls=e=>typeof e==`string`,Rs=(e,t)=>e===`native`&&typeof t==`string`&&!zs.has(t),zs=new Set([`ipc`,`ignore`,`inherit`,`overlapped`,`pipe`]),Bs=e=>Object.prototype.toString.call(e)===`[object ReadableStream]`,Vs=e=>Object.prototype.toString.call(e)===`[object WritableStream]`,Hs=e=>Bs(e)||Vs(e),Us=e=>Bs(e?.readable)&&Vs(e?.writable),Ws=e=>Ks(e)&&typeof e[Symbol.asyncIterator]==`function`,Gs=e=>Ks(e)&&typeof e[Symbol.iterator]==`function`,Ks=e=>typeof e==`object`&&!!e,K=new Set([`generator`,`asyncGenerator`,`duplex`,`webTransform`]),qs=new Set([`fileUrl`,`filePath`,`fileNumber`]),Js=new Set([`fileUrl`,`filePath`]),Ys=new Set([...Js,`webStream`,`nodeStream`]),Xs=new Set([`webTransform`,`duplex`]),Zs={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`},Qs=(e,t,n,r)=>r===`output`?$s(e,t,n):ec(e,t,n),$s=(e,t,n)=>{let r=t!==0&&n[t-1].value.readableObjectMode,i=e??r;return{writableObjectMode:r,readableObjectMode:i}},ec=(e,t,n)=>{let r=t===0?e===!0:n[t-1].value.readableObjectMode,i=t!==n.length-1&&(e??r);return{writableObjectMode:r,readableObjectMode:i}},tc=(e,t)=>{let n=e.findLast(({type:e})=>K.has(e));return n===void 0?!1:t===`input`?n.value.writableObjectMode:n.value.readableObjectMode},nc=(e,t,n,r)=>[...e.filter(({type:e})=>!K.has(e)),...rc(e,t,n,r)],rc=(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]=ic({stdioItem:o,index:Number(e),newTransforms:a,optionName:t,direction:n,encoding:r});return cc(a,n)},ic=({stdioItem:e,stdioItem:{type:t},index:n,newTransforms:r,optionName:i,direction:a,encoding:o})=>t===`duplex`?ac({stdioItem:e,optionName:i}):t===`webTransform`?oc({stdioItem:e,index:n,newTransforms:r,direction:a}):sc({stdioItem:e,index:n,newTransforms:r,direction:a,encoding:o}),ac=({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}}},oc=({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}=Qs(o,n,r,i);return{...e,value:{transform:a,writableObjectMode:s,readableObjectMode:c}}},sc=({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}=Qs(u,n,r,i);return{...e,value:{transform:o,final:s,binary:d,preserveNewlines:l,writableObjectMode:f,readableObjectMode:p}}},cc=(e,t)=>t===`input`?e.reverse():e,lc=(e,t,n)=>{let r=e.map(e=>uc(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)??hc},uc=({type:e,value:t},n)=>dc[n]??pc[e](t),dc=[`input`,`output`,`output`],q=()=>void 0,fc=()=>`input`,pc={generator:q,asyncGenerator:q,fileUrl:q,filePath:q,iterable:fc,asyncIterable:fc,uint8Array:fc,webStream:e=>Vs(e)?`output`:`input`,nodeStream(e){return Va(e,{checkOpen:!1})?Ba(e,{checkOpen:!1})?void 0:`input`:`output`},webTransform:q,duplex:q,native(e){let t=mc(e);if(t!==void 0)return t;if(U(e,{checkOpen:!1}))return pc.nodeStream(e)}},mc=e=>{if([0,_.stdin].includes(e))return`input`;if([1,2,_.stdout,_.stderr].includes(e))return`output`},hc=`output`,gc=(e,t)=>t&&!e.includes(`ipc`)?[...e,`ipc`]:e,_c=({stdio:e,ipc:t,buffer:n,...r},i,a)=>{let o=vc(e,r).map((e,t)=>bc(e,t));return a?xc(o,n,i):gc(o,t)},vc=(e,t)=>{if(e===void 0)return N.map(e=>t[e]);if(yc(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])},yc=e=>N.some(t=>e[t]!==void 0),bc=(e,t)=>Array.isArray(e)?e.map(e=>bc(e,t)):e==null?t>=N.length?`ignore`:`pipe`:e,xc=(e,t,n)=>e.map((e,r)=>!t[r]&&r!==0&&!ct(n,r)&&Sc(e)?`ignore`:e),Sc=e=>e===`pipe`||Array.isArray(e)&&e.every(e=>e===`pipe`),Cc=({stdioItem:e,stdioItem:{type:t},isStdioArray:n,fdNumber:r,direction:i,isSync:a})=>!n||t!==`native`?e:a?wc({stdioItem:e,fdNumber:r,direction:i}):Dc({stdioItem:e,fdNumber:r}),wc=({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r,direction:i})=>{let a=Tc({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},Tc=({value:e,optionName:t,fdNumber:n,direction:r})=>{let i=Ec(e,n);if(i!==void 0){if(r===`output`)return{type:`fileNumber`,value:i,optionName:t};if(S.isatty(i))throw TypeError(`The \`${t}: ${gi(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:`uint8Array`,value:j(ue(i)),optionName:t}}},Ec=(e,t)=>{if(e===`inherit`)return t;if(typeof e==`number`)return e;let n=Ge.indexOf(e);if(n!==-1)return n},Dc=({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r})=>t===`inherit`?{type:`nodeStream`,value:Oc(r,t,n),optionName:n}:typeof t==`number`?{type:`nodeStream`,value:Oc(t,t,n),optionName:n}:U(t,{checkOpen:!1})?{type:`nodeStream`,value:t,optionName:n}:e,Oc=(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},kc=({input:e,inputFile:t},n)=>n===0?[...Ac(e),...Mc(t)]:[],Ac=e=>e===void 0?[]:[{type:jc(e),value:e,optionName:`input`}],jc=e=>{if(Va(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.")},Mc=e=>e===void 0?[]:[{...Nc(e),optionName:`inputFile`}],Nc=e=>{if(Ns(e))return{type:`fileUrl`,value:e};if(Ls(e))return{type:`filePath`,value:{file:e}};throw Error("The `inputFile` option must be a file path string or a file URL.")},Pc=e=>e.filter((t,n)=>e.every((e,r)=>t.value!==e.value||n>=r||t.type===`generator`||t.type===`asyncGenerator`)),Fc=({stdioItem:{type:e,value:t,optionName:n},direction:r,fileDescriptors:i,isSync:a})=>{let o=Ic(i,e);if(o.length!==0){if(a){Lc({otherStdioItems:o,type:e,value:t,optionName:n,direction:r});return}if(Ys.has(e))return Rc({otherStdioItems:o,type:e,value:t,optionName:n,direction:r});Xs.has(e)&&Bc({otherStdioItems:o,type:e,value:t,optionName:n})}},Ic=(e,t)=>e.flatMap(({direction:e,stdioItems:n})=>n.filter(e=>e.type===t).map(t=>({...t,direction:e}))),Lc=({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{Js.has(t)&&Rc({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})},Rc=({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{let a=e.filter(e=>zc(e,n));if(a.length===0)return;let o=a.find(e=>e.direction!==i);return Vc(o,r,t),i===`output`?a[0].stream:void 0},zc=({type:e,value:t},n)=>e===`filePath`?t.file===n.file:e===`fileUrl`?t.href===n.href:t===n,Bc=({otherStdioItems:e,type:t,value:n,optionName:r})=>{let i=e.find(({value:{transform:e}})=>e===n.transform);Vc(i,r,t)},Vc=(e,t,n)=>{if(e!==void 0)throw TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${Zs[n]} that is the same.`)},Hc=(e,t,n,r)=>{let i=_c(t,n,r),a=i.map((e,n)=>Uc({stdioOption:e,fdNumber:n,options:t,isSync:r})),o=Zc({initialFileDescriptors:a,addProperties:e,options:t,isSync:r});return t.stdio=o.map(({stdioItems:e})=>tl(e)),o},Uc=({stdioOption:e,fdNumber:t,options:n,isSync:r})=>{let i=Ke(t),{stdioItems:a,isStdioArray:o}=Wc({stdioOption:e,fdNumber:t,options:n,optionName:i}),s=lc(a,t,i),c=a.map(e=>Cc({stdioItem:e,isStdioArray:o,fdNumber:t,direction:s,isSync:r})),l=nc(c,i,s,n),u=tc(l,s);return Xc(l,u),{direction:s,objectMode:u,stdioItems:l}},Wc=({stdioOption:e,fdNumber:t,options:n,optionName:r})=>{let i=Array.isArray(e)?e:[e],a=[...i.map(e=>Gc(e,r)),...kc(n,t)],o=Pc(a),s=o.length>1;return Kc(o,s,r),Jc(o),{stdioItems:o,isStdioArray:s}},Gc=(e,t)=>({type:Ss(e,t),value:e,optionName:t}),Kc=(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(qc.has(t))throw Error(`The \`${n}\` option must not include \`${t}\`.`)}},qc=new Set([`ignore`,`ipc`]),Jc=e=>{for(let t of e)Yc(t)},Yc=({type:e,value:t,optionName:n})=>{if(Ps(t))throw TypeError(`The \`${n}: URL\` option must use the \`file:\` scheme.
|
|
28
|
-
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(Rs(e,t))throw TypeError(`The \`${n}: { file: '...' }\` option must be used instead of \`${n}: '...'\`.`)},Xc=(e,t)=>{if(!t)return;let n=e.find(({type:e})=>qs.has(e));if(n!==void 0)throw TypeError(`The \`${n.optionName}\` option cannot use both files and transforms in objectMode.`)},Zc=({initialFileDescriptors:e,addProperties:t,options:n,isSync:r})=>{let i=[];try{for(let a of e)i.push(Qc({fileDescriptor:a,fileDescriptors:i,addProperties:t,options:n,isSync:r}));return i}catch(e){throw el(i),e}},Qc=({fileDescriptor:{direction:e,objectMode:t,stdioItems:n},fileDescriptors:r,addProperties:i,options:a,isSync:o})=>{let s=n.map(t=>$c({stdioItem:t,addProperties:i,direction:e,options:a,fileDescriptors:r,isSync:o}));return{direction:e,objectMode:t,stdioItems:s}},$c=({stdioItem:e,addProperties:t,direction:n,options:r,fileDescriptors:i,isSync:a})=>{let o=Fc({stdioItem:e,direction:n,fileDescriptors:i,isSync:a});return o===void 0?{...e,...t[n][e.type](e,r)}:{...e,stream:o}},el=e=>{for(let{stdioItems:t}of e)for(let{stream:e}of t)e!==void 0&&!M(e)&&e.destroy()},tl=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`},nl=(e,t)=>Hc(ol,e,t,!0),J=({type:e,optionName:t})=>{il(t,Zs[e])},rl=({optionName:e,value:t})=>((t===`ipc`||t===`overlapped`)&&il(e,`"${t}"`),{}),il=(e,t)=>{throw TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},al={generator(){},asyncGenerator:J,webStream:J,nodeStream:J,webTransform:J,duplex:J,asyncIterable:J,native:rl},ol={input:{...al,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:{...al,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)=>sl(t,n)&&e!==void 0&&!Array.isArray(e)?Na(e):e,sl=(e,t)=>t===`all`?e[1]||e[2]:e[t],cl=(e,t,n,r)=>e||n?void 0:dl(t,r),ll=(e,t,n)=>n?e.flatMap(e=>ul(e,t)):ul(e,t),ul=(e,t)=>{let{transform:n,final:r}=dl(t,{});return[...n(e),...r()]},dl=(e,t)=>(t.previousChunks=``,{transform:fl.bind(void 0,t,e),final:ml.bind(void 0,t)}),fl=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]===`
|
|
29
|
-
`){let o=pl(n,a,t,e),s=n.slice(i+1,a+1-o);r.length>0&&(s=_l(r,s),r=``),yield s,i=a}i!==n.length-1&&(r=_l(r,n.slice(i+1))),e.previousChunks=r},pl=(e,t,n,r)=>n?0:(r.isWindowsNewline=t!==0&&e[t-1]===`\r`,r.isWindowsNewline?2:1),ml=function*({previousChunks:e}){e.length>0&&(yield e)},hl=({binary:e,preserveNewlines:t,readableObjectMode:n,state:r})=>e||t||n?void 0:{transform:gl.bind(void 0,r)},gl=function*({isWindowsNewline:e=!1},t){let{unixNewline:n,windowsNewline:r,LF:i,concatBytes:a}=typeof t==`string`?vl:bl;if(t.at(-1)===i){yield t;return}let o=e?r:n;yield a(t,o)},_l=(e,t)=>`${e}${t}`,vl={windowsNewline:`\r
|
|
30
|
-
`,unixNewline:`
|
|
31
|
-
`,LF:`
|
|
32
|
-
`,concatBytes:_l},yl=(e,t)=>{let n=new Uint8Array(e.length+t.length);return n.set(e,0),n.set(t,e.length),n},bl={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:yl},xl=(e,t)=>e?void 0:Sl.bind(void 0,t),Sl=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},Cl=(e,t)=>e?wl.bind(void 0,t):Tl.bind(void 0,t),wl=function*(e,t){El(e,t),yield t},Tl=function*(e,t){if(El(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},El=(e,t)=>{if(t==null)throw TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.
|
|
33
|
-
Instead, \`yield\` should either be called with a value, or not be called at all. For example:
|
|
34
|
-
if (condition) { yield value; }`)},Dl=(e,t,n)=>{if(n)return;if(e)return{transform:Ol.bind(void 0,new TextEncoder)};let r=new u(t);return{transform:kl.bind(void 0,r),final:Al.bind(void 0,r)}},Ol=function*(e,t){ve.isBuffer(t)?yield j(t):typeof t==`string`?yield e.encode(t):yield t},kl=function*(e,t){yield A(t)?e.write(t):t},Al=function*(e){let t=e.end();t!==``&&(yield t)},jl=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}}),Ml=async function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=Il}=t[n];for await(let i of r(e))yield*Ml(i,t,n+1)},Nl=async function*(e){for(let[t,{final:n}]of Object.entries(e))yield*Pl(n,Number(t),e)},Pl=async function*(e,t,n){if(e!==void 0)for await(let r of e())yield*Ml(r,n,t+1)},Fl=f(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),Il=function*(e){yield e},Ll=(e,t,n,r)=>{try{for(let r of e(...t))n.push(r);r()}catch(e){r(e)}},Rl=(e,t)=>[...t.flatMap(t=>[...X(t,e,0)]),...zl(e)],X=function*(e,t,n){if(n===t.length){yield e;return}let{transform:r=Vl}=t[n];for(let i of r(e))yield*X(i,t,n+1)},zl=function*(e){for(let[t,{final:n}]of Object.entries(e))yield*Bl(n,Number(t),e)},Bl=function*(e,t,n){if(e!==void 0)for(let r of e())yield*X(r,n,t+1)},Vl=function*(e){yield e},Hl=({value:e,value:{transform:t,final:n,writableObjectMode:r,readableObjectMode:i},optionName:a},{encoding:o})=>{let s={},c=Wl(e,o,a),l=G(t),u=G(n),d=l?jl.bind(void 0,Ml,s):Ll.bind(void 0,X),f=l||u?jl.bind(void 0,Nl,s):Ll.bind(void 0,zl),p=l||u?Fl.bind(void 0,s):void 0,m=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});return{stream:m}},Ul=(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){let i=Wl(t,n,r);e=Rl(i,e)}return e},Wl=({transform:e,final:t,binary:n,writableObjectMode:r,readableObjectMode:i,preserveNewlines:a},o,s)=>{let c={};return[{transform:xl(r,s)},Dl(n,o,r),cl(n,a,r,c),{transform:e,final:t},{transform:Cl(i,s)},hl({binary:n,preserveNewlines:a,readableObjectMode:i,state:c})].filter(Boolean)},Gl=(e,t)=>{for(let n of Kl(e))ql(e,n,t)},Kl=e=>new Set(Object.entries(e).filter(([,{direction:e}])=>e===`input`).map(([e])=>Number(e))),ql=(e,t,n)=>{let{stdioItems:r}=e[t],i=r.filter(({contents:e})=>e!==void 0);if(i.length===0)return;if(t!==0){let[{type:e,optionName:t}]=i;throw TypeError(`Only the \`stdin\` option, not \`${t}\`, can be ${Zs[e]} with synchronous methods.`)}let a=i.map(({contents:e})=>e),o=a.map(e=>Jl(e,r));n.input=Me(o)},Jl=(e,t)=>{let n=Ul(e,t,`utf8`,!0);return Yl(n),Me(n)},Yl=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}.`)},Xl=({stdioItems:e,encoding:t,verboseInfo:n,fdNumber:r})=>r!==`all`&&ct(n,r)&&!H.has(t)&&Zl(r)&&(e.some(({type:e,value:t})=>e===`native`&&Ql.has(t))||e.every(({type:e})=>K.has(e))),Zl=e=>e===1||e===2,Ql=new Set([`pipe`,`overlapped`]),$l=async(e,t,n,r)=>{for await(let i of e)tu(t)||nu(i,n,r)},eu=(e,t,n)=>{for(let r of e)nu(r,t,n)},tu=e=>e._readableState.pipes.length>0,nu=(e,t,n)=>{let r=Ln(e);Nn({type:`output`,verboseMessage:r,fdNumber:t,verboseInfo:n})},ru=({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([]),s=t.map((t,s)=>iu({result:t,fileDescriptors:e,fdNumber:s,state:a,outputFiles:o,isMaxBuffer:r,verboseInfo:i},n));return{output:s,...a}},iu=({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=Ko(e,a,d),p=j(f),{stdioItems:m,objectMode:h}=t[n],g=au([p],m,c,r),{serializedResult:_,finalResult:v=_}=ou({chunks:g,objectMode:h,encoding:c,lines:l,stripFinalNewline:u,fdNumber:n});su({serializedResult:_,fdNumber:n,state:r,verboseInfo:o,encoding:c,stdioItems:m,objectMode:h});let y=s[n]?v:void 0;try{return r.error===void 0&&cu(_,m,i),y}catch(e){return r.error=e,y}},au=(e,t,n,r)=>{try{return Ul(e,t,n,!1)}catch(t){return r.error=t,e}},ou=({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:ll(o,!i[a],t)}:{serializedResult:o}},su=({serializedResult:e,fdNumber:t,state:n,verboseInfo:r,encoding:i,stdioItems:a,objectMode:o})=>{if(!Xl({stdioItems:a,encoding:i,verboseInfo:r,fdNumber:t}))return;let s=ll(e,!1,o);try{eu(s,t,r)}catch(e){n.error??=e}},cu=(e,t,n)=>{for(let{path:r,append:i}of t.filter(({type:e})=>qs.has(e))){let t=typeof r==`string`?r:r.toString();i||n.has(t)?se(r,e):(n.add(t),fe(r,e))}},lu=([,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}`},uu=async(e,t)=>{let[n,r]=await du(e);return t.isForcefullyTerminated??=!1,[n,r]},du=async e=>{let[t,n]=await Promise.allSettled([E(e,`spawn`),E(e,`exit`)]);return t.status===`rejected`?[]:n.status===`rejected`?fu(e):n.value},fu=async e=>{try{return await E(e,`exit`)}catch{return fu(e)}},pu=async e=>{let[t,n]=await e;if(!mu(t,n)&&hu(t,n))throw new I;return[t,n]},mu=(e,t)=>e===void 0&&t===void 0,hu=(e,t)=>e!==0||t!==null,gu=({error:e,status:t,signal:n,output:r},{maxBuffer:i})=>{let a=_u(e,t,n),o=a?.code===`ETIMEDOUT`,s=Go(a,r,i);return{resultError:a,exitCode:t,signal:n,timedOut:o,isMaxBuffer:s}},_u=(e,t,n)=>e===void 0?hu(t,n)?new I:void 0:e,vu=(e,t,n)=>{let{file:r,commandArguments:i,command:a,escapedCommand:o,startTime:s,verboseInfo:c,options:l,fileDescriptors:u}=yu(e,t,n),d=Cu({file:r,commandArguments:i,options:l,command:a,escapedCommand:o,verboseInfo:c,fileDescriptors:u,startTime:s});return xs(d,c,l)},yu=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=Kn(e,t,n),s=bu(n),{file:c,commandArguments:l,options:u}=ka(e,t,s);xu(u);let d=nl(u,o);return{file:c,commandArguments:l,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:u,fileDescriptors:d}},bu=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,xu=({ipc:e,ipcInput:t,detached:n,cancelSignal:r})=>{t&&Su(`ipcInput`),e&&Su(`ipc: true`),n&&Su(`detached: true`),r&&Su(`cancelSignal`)},Su=e=>{throw TypeError(`The "${e}" option cannot be used with synchronous methods.`)},Cu=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,verboseInfo:a,fileDescriptors:o,startTime:s})=>{let c=wu({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}=gu(c,n),{output:m,error:h=l}=ru({fileDescriptors:o,syncResult:c,options:n,isMaxBuffer:p,verboseInfo:a}),g=m.map((e,t)=>Y(e,n,t)),_=Y(lu(m,n),n,`all`);return Eu({error:h,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:g,all:_,options:n,command:r,escapedCommand:i,startTime:s})},wu=({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:a,startTime:o})=>{try{Gl(a,n);let r=Tu(n);return l(...Ma(e,t,r))}catch(e){return ns({error:e,command:r,escapedCommand:i,fileDescriptors:a,options:n,startTime:o,isSync:!0})}},Tu=({encoding:e,maxBuffer:t,...n})=>({...n,encoding:`buffer`,maxBuffer:qo(t)}),Eu=({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?ts({command:c,escapedCommand:l,stdio:a,all:o,ipcOutput:[],options:s,startTime:u}):rs({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}),Du=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0,filter:a}={})=>(Wr({methodName:`getOneMessage`,isSubprocess:n,ipc:r,isConnected:Ai(e)}),Ou({anyProcess:e,channel:t,isSubprocess:n,filter:a,reference:i})),Ou=async({anyProcess:e,channel:t,isSubprocess:n,filter:r,reference:i})=>{vi(t,i);let a=Di(e,t,n),o=new AbortController;try{return await Promise.race([ku(a,r,o),Au(a,n,o),ju(a,n,o)])}catch(t){throw oi(e),t}finally{o.abort(),bi(t,i)}},ku=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},Au=async(e,t,{signal:n})=>{await E(e,`disconnect`,{signal:n}),qr(t)},ju=async(e,t,{signal:n})=>{let[r]=await E(e,`strict:error`,{signal:n});throw Yr(r,t)},Mu=({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0}={})=>Nu({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:!n,reference:i}),Nu=({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:i,reference:a})=>{Wr({methodName:`getEachMessage`,isSubprocess:n,ipc:r,isConnected:Ai(e)}),vi(t,a);let o=Di(e,t,n),s=new AbortController,c={};return Pu(e,o,s),Fu({ipcEmitter:o,isSubprocess:n,controller:s,state:c}),Iu({anyProcess:e,channel:t,ipcEmitter:o,isSubprocess:n,shouldAwait:i,controller:s,state:c,reference:a})},Pu=async(e,t,n)=>{try{await E(t,`disconnect`,{signal:n.signal}),n.abort()}catch{}},Fu=async({ipcEmitter:e,isSubprocess:t,controller:n,state:r})=>{try{let[i]=await E(e,`strict:error`,{signal:n.signal});r.error=Yr(i,t),n.abort()}catch{}},Iu=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}))Lu(o),yield e}catch{Lu(o)}finally{a.abort(),bi(t,s),r||oi(e),i&&await e}},Lu=({error:e})=>{if(e)throw e},Ru=(e,{ipc:t})=>{Object.assign(e,Bu(e,!1,t))},zu=()=>{let e=_,t=!0,n=_.channel!==void 0;return{...Bu(e,t,n),getCancelSignal:Qi.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})}},Bu=(e,t,n)=>({sendMessage:Ki.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getOneMessage:Du.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getEachMessage:Mu.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})}),Vu=({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,verboseInfo:s})=>{el(r);let c=new o;Hu(c,r),Object.assign(c,{readable:Uu,writable:Wu,duplex:Gu});let l=ns({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:a,isSync:!1}),u=Ku(l,s,i);return{subprocess:c,promise:u}},Hu=(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},Uu=()=>new O({read(){}}),Wu=()=>new ge({write(){}}),Gu=()=>new pe({read(){},write(){}}),Ku=async(e,t,n)=>xs(e,t,n),qu=(e,t)=>Hc(Yu,e,t,!1),Q=({type:e,optionName:t})=>{throw TypeError(`The \`${t}\` option cannot be ${Zs[e]}.`)},Ju={fileNumber:Q,generator:Hl,asyncGenerator:Hl,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:n}}){let r=t||n,i=pe.fromWeb(e,{objectMode:r});return{stream:i}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},Yu={input:{...Ju,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:{...Ju,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 Xu(e){if(!Array.isArray(e))throw TypeError(`Expected an array, got \`${typeof e}\`.`);for(let t of e)nd(t);let t=e.some(({readableObjectMode:e})=>e),n=Zu(e,t),r=new Qu({objectMode:t,writableHighWaterMark:n,readableHighWaterMark:n});for(let t of e)r.add(t);return r}const Zu=(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 Qu=class extends me{#streams=new Set([]);#ended=new Set([]);#aborted=new Set([]);#onFinished;#unpipeEvent=Symbol(`unpipe`);#streamPromises=new WeakMap;add(e){if(nd(e),this.#streams.has(e))return;this.#streams.add(e),this.#onFinished??=$u(this,this.#streams,this.#unpipeEvent);let t=rd({passThroughStream:this,stream:e,streams:this.#streams,ended:this.#ended,aborted:this.#aborted,onFinished:this.#onFinished,unpipeEvent:this.#unpipeEvent});this.#streamPromises.set(e,t),e.pipe(this,{end:!1})}async remove(e){if(nd(e),!this.#streams.has(e))return!1;let t=this.#streamPromises.get(e);return t===void 0?!1:(this.#streamPromises.delete(e),e.unpipe(this),await t,!0)}};const $u=async(e,t,n)=>{pd(e,md);let r=new AbortController;try{await Promise.race([ed(e,r),td(e,t,n,r)])}finally{r.abort(),pd(e,-md)}},ed=async(e,{signal:t})=>{try{await D(e,{signal:t,cleanup:!0})}catch(t){throw cd(e,t),t}},td=async(e,t,n,{signal:r})=>{for await(let[i]of ie(e,`unpipe`,{signal:r}))t.has(i)&&i.emit(n)},nd=e=>{if(typeof e?.pipe!=`function`)throw TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},rd=async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,onFinished:a,unpipeEvent:o})=>{pd(e,hd);let s=new AbortController;try{await Promise.race([id(a,t,s),ad({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:s}),od({stream:t,streams:n,ended:r,aborted:i,unpipeEvent:o,controller:s})])}finally{s.abort(),pd(e,-hd)}n.size>0&&n.size===r.size+i.size&&(r.size===0&&i.size>0?ud(e):sd(e))},id=async(e,t,{signal:n})=>{try{await e,n.aborted||ud(t)}catch(e){n.aborted||cd(t,e)}},ad=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;ld(r)?i.add(t):dd(e,r)}},od=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)},sd=e=>{e.writable&&e.end()},cd=(e,t)=>{ld(t)?ud(e):dd(e,t)},ld=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,ud=e=>{(e.readable||e.writable)&&e.destroy()},dd=(e,t)=>{e.destroyed||(e.once(`error`,fd),e.destroy(t))},fd=()=>{},pd=(e,t)=>{let n=e.getMaxListeners();n!==0&&n!==1/0&&e.setMaxListeners(n+t)},md=2,hd=1,gd=(e,t)=>{e.pipe(t),_d(e,t),yd(e,t)},_d=async(e,t)=>{if(!(M(e)||M(t))){try{await D(e,{cleanup:!0,readable:!0,writable:!1})}catch{}vd(t)}},vd=e=>{e.writable&&e.end()},yd=async(e,t)=>{if(!(M(e)||M(t))){try{await D(t,{cleanup:!0,readable:!1,writable:!0})}catch{}bd(e)}},bd=e=>{e.readable&&e.destroy()},xd=(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)))Sd(e,t,o,i);for(let{stream:t}of a.filter(({type:e})=>!K.has(e)))wd({subprocess:e,stream:t,direction:o,fdNumber:i,pipeGroups:r,controller:n})}for(let[e,t]of r.entries()){let n=t.length===1?t[0]:Xu(t);gd(n,e)}},Sd=(e,t,n,r)=>{n===`output`?gd(e.stdio[r],t):gd(t,e.stdio[r]);let i=Cd[r];i!==void 0&&(e[i]=t),e.stdio[r]=t},Cd=[`stdin`,`stdout`,`stderr`],wd=({subprocess:e,stream:t,direction:n,fdNumber:r,pipeGroups:i,controller:a})=>{if(t===void 0)return;Td(t,a);let[o,s]=n===`output`?[t,e.stdio[r]]:[e.stdio[r],t],c=i.get(o)??[];i.set(o,[...c,s])},Td=(e,{signal:t})=>{M(e)&&_i(e,Ed,t)},Ed=2,Dd=(e,{cleanup:t,detached:n},{signal:r})=>{if(!t||n)return;let a=i(()=>{e.kill()});re(r,()=>{a()})},Od=({source:e,sourcePromise:t,boundOptions:n,createNested:r},...i)=>{let a=Wn(),{destination:o,destinationStream:s,destinationError:c,from:l,unpipeSignal:u}=kd(n,r,i),{sourceStream:d,sourceError:f}=Md(e,l),{options:p,fileDescriptors:m}=B.get(e);return{sourcePromise:t,sourceStream:d,sourceOptions:p,sourceError:f,destination:o,destinationStream:s,destinationError:c,unpipeSignal:u,fileDescriptors:m,startTime:a}},kd=(e,t,n)=>{try{let{destination:r,pipeOptions:{from:i,to:a,unpipeSignal:o}={}}=Ad(e,t,...n),s=si(r,a);return{destination:r,destinationStream:s,from:i,unpipeSignal:o}}catch(e){return{destinationError:e}}},Ad=(e,t,n,...r)=>{if(Array.isArray(n)){let i=t(jd,e)(n,...r);return{destination:i,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),s=t(jd)(i,a,o);return{destination:s,pipeOptions:o}}if(B.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}`)},jd=({options:e})=>({options:{...e,stdin:`pipe`,piped:!0}}),Md=(e,t)=>{try{let n=ci(e,t);return{sourceStream:n}}catch(e){return{sourceError:e}}},Nd=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r,fileDescriptors:i,sourceOptions:a,startTime:o})=>{let s=Pd({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r});if(s!==void 0)throw Fd({error:s,fileDescriptors:i,sourceOptions:a,startTime:o})},Pd=({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r})=>{if(t!==void 0&&r!==void 0)return r;if(r!==void 0)return bd(e),r;if(t!==void 0)return vd(n),t},Fd=({error:e,fileDescriptors:t,sourceOptions:n,startTime:r})=>ns({error:e,command:Id,escapedCommand:Id,fileDescriptors:t,options:n,startTime:r,isSync:!1}),Id=`source.pipe(destination)`,Ld=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},Rd=(e,t,n)=>{let r=Hd.has(t)?Bd(e,t):zd(e,t);return _i(e,Ud,n.signal),_i(t,Wd,n.signal),Vd(t),r},zd=(e,t)=>{let n=Xu([e]);return gd(n,t),Hd.set(t,n),n},Bd=(e,t)=>{let n=Hd.get(t);return n.add(e),n},Vd=async e=>{try{await D(e,{cleanup:!0,readable:!1,writable:!0})}catch{}Hd.delete(e)},Hd=new WeakMap,Ud=2,Wd=1,Gd=(e,t)=>e===void 0?[]:[Kd(e,t)],Kd=async(e,{sourceStream:t,mergedStream:n,fileDescriptors:r,sourceOptions:i,startTime:a})=>{await d(e,t),await n.remove(t);let o=Error("Pipe canceled by `unpipeSignal` option.");throw Fd({error:o,fileDescriptors:r,sourceOptions:i,startTime:a})},qd=(e,...t)=>{if(k(t[0]))return qd.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:n,...r}=Od(e,...t),i=Jd({...r,destination:n});return i.pipe=qd.bind(void 0,{...e,source:n,sourcePromise:i,boundOptions:{}}),i},Jd=async({sourcePromise:e,sourceStream:t,sourceOptions:n,sourceError:r,destination:i,destinationStream:a,destinationError:o,unpipeSignal:s,fileDescriptors:c,startTime:l})=>{let u=Yd(e,i);Nd({sourceStream:t,sourceError:r,destinationStream:a,destinationError:o,fileDescriptors:c,sourceOptions:n,startTime:l});let d=new AbortController;try{let e=Rd(t,a,d);return await Promise.race([Ld(u),...Gd(s,{sourceStream:t,mergedStream:e,sourceOptions:n,fileDescriptors:c,startTime:l})])}finally{d.abort()}},Yd=(e,t)=>Promise.allSettled([e,t]),Xd=({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:r,encoding:i,preserveNewlines:a})=>{let o=new AbortController;return Zd(t,o),ef({stream:e,controller:o,binary:n,shouldEncode:!e.readableObjectMode&&r,encoding:i,shouldSplit:!e.readableObjectMode,preserveNewlines:a})},Zd=async(e,t)=>{try{await e}catch{}finally{t.abort()}},Qd=({stream:e,onStreamEnd:t,lines:n,encoding:r,stripFinalNewline:i,allMixed:a})=>{let o=new AbortController;$d(t,o,e);let s=e.readableObjectMode&&!a;return ef({stream:e,controller:o,binary:r===`buffer`,shouldEncode:!s,encoding:r,shouldSplit:!s&&n,preserveNewlines:!i})},$d=async(e,t,n)=>{try{await e}catch{n.destroy()}finally{t.abort()}},ef=({stream:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o})=>{let s=ie(e,`data`,{signal:t.signal,highWaterMark:nf,highWatermark:nf});return rf({onStdoutChunk:s,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o})},tf=_e(!0),nf=tf,rf=async function*({onStdoutChunk:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:a,preserveNewlines:o}){let s=af({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*zl(s)}},af=({binary:e,shouldEncode:t,encoding:n,shouldSplit:r,preserveNewlines:i})=>[Dl(e,n,!t),cl(e,i,!r,{})].filter(Boolean),sf=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=cf({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:s,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([lf(e),d]);return}let f=sl(c,n),p=Qd({stream:e,onStreamEnd:t,lines:o,encoding:r,stripFinalNewline:f,allMixed:s}),[m]=await Promise.all([uf({stream:e,iterable:p,fdNumber:n,encoding:r,maxBuffer:a,lines:o}),d]);return m},cf=async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:i,verboseInfo:a,streamInfo:{fileDescriptors:o}})=>{if(!Xl({stdioItems:o[n]?.stdioItems,encoding:r,verboseInfo:a,fdNumber:n}))return;let s=Qd({stream:e,onStreamEnd:t,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:i});await $l(s,e,n,a)},lf=async e=>{await ee(),e.readableFlowing===null&&e.resume()},uf=async({stream:e,stream:{readableObjectMode:t},iterable:n,fdNumber:r,encoding:i,maxBuffer:a,lines:o})=>{try{return t||o?await po(n,{maxBuffer:a}):i===`buffer`?new Uint8Array(await vo(n,{maxBuffer:a})):await No(n,{maxBuffer:a})}catch(n){return ff(Bo({error:n,stream:e,readableObjectMode:t,lines:o,encoding:i,fdNumber:r}))}},df=async e=>{try{return await e}catch(e){return ff(e)}},ff=({bufferedData:e})=>Te(e)?new Uint8Array(e):e,pf=async(e,t,n,{isSameDirection:r,stopOnExit:i=!1}={})=>{let a=mf(e,n),o=new AbortController;try{await Promise.race([...i?[n.exitPromise]:[],D(e,{cleanup:!0,signal:o.signal})])}catch(e){a.stdinCleanedUp||_f(e,t,n,r)}finally{o.abort()}},mf=(e,{originalStreams:[t],subprocess:n})=>{let r={stdinCleanedUp:!1};return e===t&&hf(e,n,r),r},hf=(e,t,n)=>{let{_destroy:r}=e;e._destroy=(...i)=>{gf(t,n),r.call(e,...i)}},gf=({exitCode:e,signalCode:t},n)=>{(e!==null||t!==null)&&(n.stdinCleanedUp=!0)},_f=(e,t,n,r)=>{if(!vf(e,t,n,r))throw e},vf=(e,t,n,r=!0)=>n.propagating?xf(e)||bf(e):(n.propagating=!0,yf(n,t)===r?xf(e):bf(e)),yf=({fileDescriptors:e},t)=>t!==`all`&&e[t].direction===`input`,bf=e=>e?.code===`ERR_STREAM_PREMATURE_CLOSE`,xf=e=>e?.code===`EPIPE`,Sf=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:a,verboseInfo:o,streamInfo:s})=>e.stdio.map((e,c)=>Cf({stream:e,fdNumber:c,encoding:t,buffer:n[c],maxBuffer:r[c],lines:i[c],allMixed:!1,stripFinalNewline:a,verboseInfo:o,streamInfo:s})),Cf=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=pf(e,t,l);if(yf(l,t)){await u;return}let[d]=await Promise.all([sf({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},wf=({stdout:e,stderr:t},{all:n})=>n&&(e||t)?Xu([e,t].filter(Boolean)):void 0,Tf=({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:a,verboseInfo:o,streamInfo:s})=>Cf({...Ef(e,n),fdNumber:`all`,encoding:t,maxBuffer:r[1]+r[2],lines:i[1]||i[2],allMixed:Df(e),stripFinalNewline:a,verboseInfo:o,streamInfo:s}),Ef=({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}},Df=({all:e,stdout:t,stderr:n})=>e&&t&&n&&t.readableObjectMode!==n.readableObjectMode,Of=e=>ct(e,`ipc`),kf=(e,t)=>{let n=Ln(e);Nn({type:`ipc`,verboseMessage:n,fdNumber:`ipc`,verboseInfo:t})},Af=async({subprocess:e,buffer:t,maxBuffer:n,ipc:r,ipcOutput:i,verboseInfo:a})=>{if(!r)return i;let o=Of(a),s=P(t,`ipc`),c=P(n,`ipc`);for await(let t of Nu({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))s&&(Ho(e,i,c),i.push(t)),o&&kf(t,a);return i},jf=async(e,t)=>(await Promise.allSettled([e]),t),Mf=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=uu(e,f),y={originalStreams:h,fileDescriptors:m,subprocess:e,exitPromise:v,propagating:!1},b=Sf({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:y}),x=Tf({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:y}),S=[],C=Af({subprocess:e,buffer:n,maxBuffer:r,ipc:u,ipcOutput:S,verboseInfo:p}),w=Nf(h,e,y),ee=Pf(m,y);try{return await Promise.race([Promise.all([{},pu(v),Promise.all(b),x,C,va(e,d),...w,...ee]),g,Ff(e,_),...ua(e,a,f,_),...Hr({subprocess:e,cancelSignal:o,gracefulCancel:s,context:f,controller:_}),...oa({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=>df(e))),df(x),jf(C,S),Promise.allSettled(w),Promise.allSettled(ee)])}},Nf=(e,t,n)=>e.map((e,r)=>e===t.stdio[r]?void 0:pf(e,r,n)),Pf=(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})=>pf(i,n,t,{isSameDirection:K.has(e),stopOnExit:e===`native`}))),Ff=async(e,{signal:t})=>{let[n]=await E(e,`error`,{signal:t});throw n},If=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),Lf=(e,t,n)=>{let r=e[n];r.has(t)||r.set(t,[]);let i=r.get(t),a=z();i.push(a);let o=a.resolve.bind(a);return{resolve:o,promises:i}},Rf=async({resolve:e,promises:t},n)=>{e();let[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...t])]);return!r},zf=async e=>{if(e!==void 0)try{await Vf(e)}catch{}},Bf=async e=>{if(e!==void 0)try{await Hf(e)}catch{}},Vf=async e=>{await D(e,{cleanup:!0,readable:!1,writable:!0})},Hf=async e=>{await D(e,{cleanup:!0,readable:!0,writable:!1})},Uf=async(e,t)=>{if(await e,t)throw t},Wf=(e,t,n)=>{n&&!bf(n)?e.destroy(n):t&&e.destroy()},Gf=({subprocess:e,concurrentStreams:t,encoding:n},{from:r,binary:i=!0,preserveNewlines:a=!0}={})=>{let o=i||H.has(n),{subprocessStdout:s,waitReadableDestroy:c}=Kf(e,r,t),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=qf(s,o),{read:p,onStdoutDataDone:m}=Jf({subprocessStdout:s,subprocess:e,binary:o,encoding:n,preserveNewlines:a}),h=new O({read:p,destroy:f(Zf.bind(void 0,{subprocessStdout:s,subprocess:e,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return Xf({subprocessStdout:s,onStdoutDataDone:m,readable:h,subprocess:e}),h},Kf=(e,t,n)=>{let r=ci(e,t),i=Lf(n,r,`readableDestroy`);return{subprocessStdout:r,waitReadableDestroy:i}},qf=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n},r)=>r?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:tf},Jf=({subprocessStdout:e,subprocess:t,binary:n,encoding:r,preserveNewlines:i})=>{let a=z(),o=Xd({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:i});return{read(){Yf(this,o,a)},onStdoutDataDone:a}},Yf=async(e,t,n)=>{try{let{value:r,done:i}=await t.next();i?n.resolve():e.push(r)}catch{}},Xf=async({subprocessStdout:e,onStdoutDataDone:t,readable:n,subprocess:r,subprocessStdin:i})=>{try{await Hf(e),await r,await zf(i),await t,n.readable&&n.push(null)}catch(e){await zf(i),Qf(n,e)}},Zf=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:n},r)=>{await Rf(n,t)&&(Qf(e,r),await Uf(t,r))},Qf=(e,t)=>{Wf(e,e.readable,t)},$f=({subprocess:e,concurrentStreams:t},{to:n}={})=>{let{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:a}=ep(e,n,t),o=new ge({...tp(r,e,i),destroy:f(ap.bind(void 0,{subprocessStdin:r,subprocess:e,waitWritableFinal:i,waitWritableDestroy:a})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return ip(r,o),o},ep=(e,t,n)=>{let r=si(e,t),i=Lf(n,r,`writableFinal`),a=Lf(n,r,`writableDestroy`);return{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:a}},tp=(e,t,n)=>({write:np.bind(void 0,e),final:f(rp.bind(void 0,e,t,n))}),np=(e,t,n,r)=>{e.write(t,n)?r():e.once(`drain`,r)},rp=async(e,t,n)=>{await Rf(n,t)&&(e.writable&&e.end(),await t)},ip=async(e,t,n)=>{try{await Vf(e),t.writable&&t.end()}catch(e){await Bf(n),op(t,e)}},ap=async({subprocessStdin:e,subprocess:t,waitWritableFinal:n,waitWritableDestroy:r},i)=>{await Rf(n,t),await Rf(r,t)&&(op(e,i),await Uf(t,i))},op=(e,t)=>{Wf(e,e.writable,t)},sp=({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}=Kf(e,r,t),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:p}=ep(e,i,t),{readableEncoding:m,readableObjectMode:h,readableHighWaterMark:g}=qf(c,s),{read:_,onStdoutDataDone:v}=Jf({subprocessStdout:c,subprocess:e,binary:s,encoding:n,preserveNewlines:o}),y=new pe({read:_,...tp(u,e,d),destroy:f(cp.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 Xf({subprocessStdout:c,onStdoutDataDone:v,readable:y,subprocess:e,subprocessStdin:u}),ip(u,y,c),y},cp=async({subprocessStdout:e,subprocessStdin:t,subprocess:n,waitReadableDestroy:r,waitWritableFinal:i,waitWritableDestroy:a},o)=>{await Promise.all([Zf({subprocessStdout:e,subprocess:n,waitReadableDestroy:r},o),ap({subprocessStdin:t,subprocess:n,waitWritableFinal:i,waitWritableDestroy:a},o)])},lp=(e,t,{from:n,binary:r=!1,preserveNewlines:i=!1}={})=>{let a=r||H.has(t),o=ci(e,n),s=Xd({subprocessStdout:o,subprocess:e,binary:a,shouldEncode:!0,encoding:t,preserveNewlines:i});return up(s,o,e)},up=async function*(e,t,n){try{yield*e}finally{t.readable&&t.destroy(),await n}},dp=(e,{encoding:t})=>{let n=If();e.readable=Gf.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.writable=$f.bind(void 0,{subprocess:e,concurrentStreams:n}),e.duplex=sp.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.iterable=lp.bind(void 0,e,t),e[Symbol.asyncIterator]=lp.bind(void 0,e,t,{})},fp=(e,t)=>{for(let[n,r]of mp){let i=r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}},pp=(async()=>{})().constructor.prototype,mp=[`then`,`catch`,`finally`].map(e=>[e,Reflect.getOwnPropertyDescriptor(pp,e)]),hp=(e,t,n,r)=>{let{file:i,commandArguments:a,command:o,escapedCommand:s,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=gp(e,t,n),{subprocess:f,promise:p}=vp({file:i,commandArguments:a,options:u,startTime:c,verboseInfo:l,command:o,escapedCommand:s,fileDescriptors:d});return f.pipe=qd.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:r}),fp(f,p),B.set(f,{options:u,fileDescriptors:d}),f},gp=(e,t,n)=>{let{command:r,escapedCommand:i,startTime:a,verboseInfo:o}=Kn(e,t,n),{file:s,commandArguments:c,options:l}=ka(e,t,n),u=_p(l),d=qu(u,o);return{file:s,commandArguments:c,command:r,escapedCommand:i,startTime:a,verboseInfo:o,options:u,fileDescriptors:d}},_p=({timeout:e,signal:t,...n})=>{if(t!==void 0)throw TypeError(`The "signal" option has been renamed to "cancelSignal" instead.`);return{...n,timeoutDuration:e}},vp=({file:e,commandArguments:t,options:n,startTime:r,verboseInfo:i,command:a,escapedCommand:o,fileDescriptors:s})=>{let l;try{l=c(...Ma(e,t,n))}catch(e){return Vu({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];xd(l,s,u),Dd(l,n,u);let f={},p=z();l.kill=Fr.bind(void 0,{kill:l.kill.bind(l),options:n,onInternalError:p,context:f,controller:u}),l.all=wf(l,n),dp(l,n),Ru(l,n);let m=yp({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}},yp=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 Mf({subprocess:e,options:t,context:c,verboseInfo:r,fileDescriptors:i,originalStreams:a,onInternalError:l,controller:u});u.abort(),l.resolve();let _=m.map((e,n)=>Y(e,t,n)),v=Y(h,t,`all`),y=bp({errorInfo:d,exitCode:f,signal:p,stdio:_,all:v,ipcOutput:g,context:c,options:t,command:o,escapedCommand:s,startTime:n});return xs(y,r,t)},bp=({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?rs({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 so,isForcefullyTerminated:o.isForcefullyTerminated,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:a,options:s,startTime:u,isSync:!1}):ts({command:c,escapedCommand:l,stdio:r,all:i,ipcOutput:a,options:s,startTime:u}),xp=(e,t)=>{let n=Object.fromEntries(Object.entries(t).map(([t,n])=>[t,Sp(t,e[t],n)]));return{...e,...n}},Sp=(e,t,n)=>Cp.has(e)&&k(t)&&k(n)?{...t,...n}:n,Cp=new Set([`env`,...ot]),$=(e,t,n,r)=>{let i=(e,t,r)=>$(e,t,n,r),a=(...a)=>wp({mapArguments:e,deepOptions:n,boundOptions:t,setBoundExeca:r,createNested:i},...a);return r!==void 0&&r(a,i,t),a},wp=({mapArguments:e,deepOptions:t={},boundOptions:n={},setBoundExeca:r,createNested:i},a,...o)=>{if(k(a))return i(e,xp(n,a),r);let{file:s,commandArguments:c,options:l,isSync:u}=Tp({mapArguments:e,firstArgument:a,nextArguments:o,deepOptions:t,boundOptions:n});return u?vu(s,c,l):hp(s,c,l,i)},Tp=({mapArguments:e,firstArgument:t,nextArguments:n,deepOptions:r,boundOptions:i})=>{let a=Ie(t)?Le(t,n):[t,...n],[o,s,c]=Ce(...a),l=xp(xp(r,i),c),{file:u=o,commandArguments:d=s,options:f=l,isSync:p=!1}=e({file:o,commandArguments:s,options:l});return{file:u,commandArguments:d,options:f,isSync:p}},Ep=({file:e,commandArguments:t})=>Op(e,t),Dp=({file:e,commandArguments:t})=>({...Op(e,t),isSync:!0}),Op=(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]=kp(e);return{file:n,commandArguments:r}},kp=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(Ap)){let t=n.at(-1);t&&t.endsWith(`\\`)?n[n.length-1]=`${t.slice(0,-1)} ${e}`:n.push(e)}return n},Ap=/ +/g,jp=(e,t,n)=>{e.sync=t(Np,n),e.s=e.sync},Mp=({options:e})=>Pp(e),Np=({options:e})=>({...Pp(e),isSync:!0}),Pp=e=>({options:{...Fp(e),...e}}),Fp=({input:e,inputFile:t,stdio:n})=>e===void 0&&t===void 0&&n===void 0?{stdin:`inherit`}:{},Ip={preferLocal:!0},Lp=$(()=>({})),Rp=$(()=>({isSync:!0})),zp=$(Ep),Bp=$(Dp),Vp=$(fa),Hp=$(Mp,{},Ip,jp),{sendMessage:Up,getOneMessage:Wp,getEachMessage:Gp,getCancelSignal:Kp}=zu();var qp={};e(qp,{builder:()=>tm,command:()=>Jp,description:()=>Yp});const Jp=`git`,Yp=``,Xp=process.cwd();function Zp(){try{return!!Rp(`git`,[`--version`],{cwd:Xp}).stdout}catch{throw Error(`git is not installed`)}}function Qp(){try{return Rp(`git`,[`rev-parse`,`--is-inside-work-tree`],{cwd:Xp}).stdout===`true`}catch{throw Error(`not a git repository`)}}function $p(){return Lp(`git`,[`config`,`core.hooksPath`,`.githooks`],{cwd:Xp})}function em(){try{return Zp()&&Qp()}catch(e){return console.error(`Fail:`,e.message),!1}}function tm(e){e.command(`hooks`,`Set .githooks as git.hooksPath`,{},()=>{em()&&$p().then(()=>{console.log(`Done: set .githooks`)}).catch(()=>{console.error(`Fail:`,`setting hooks failed`),process.exitCode=1})}),e.demandCommand(1,"Typing `hooks`")}export{tm as builder,Jp as command,Yp as description,Lp as execa,qp as git_hooks_exports};
|