@nice-move/cli
Version:
Frontend develop helper for frontend development
11 lines • 144 kB
JavaScript
import{i as e,r as t,t as n}from"./rolldown-runtime-DSjMdhoD.mjs";import{n as r,r as i,t as a}from"./mjs-CGdxUWY6.mjs";import{fileURLToPath as o}from"node:url";import s,{ChildProcess as c}from"node:child_process";import{debuglog as l,inspect as u}from"node:util";import d from"node:process";import f from"node:tty";import p from"node:path";import{setTimeout as m}from"node:timers/promises";import h,{EOL as g,constants as _}from"node:os";import{constants as v,createReadStream as y,createWriteStream as b,readFileSync as x}from"node:fs";import{Writable as S}from"node:stream";import{Buffer as C}from"node:buffer";import w from"node:fs/promises";import{Writable as T}from"stream";import*as E from"tty";import{format as D}from"util";import{EOL as O}from"os";import{StringDecoder as k}from"string_decoder";import{randomUUID as A}from"crypto";import ee from"events";var j=n(((e,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*7,s=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return c(e);if(n===`number`&&isFinite(e))return t.long?u(e):l(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function c(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var c=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return c*s;case`weeks`:case`week`:case`w`:return c*o;case`days`:case`day`:case`d`:return c*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return c*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return c*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return c*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return c;default:return}}}}function l(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+`d`:t>=i?Math.round(e/i)+`h`:t>=r?Math.round(e/r)+`m`:t>=n?Math.round(e/n)+`s`:e+`ms`}function u(e){var t=Math.abs(e);return t>=a?d(e,t,a,`day`):t>=i?d(e,t,i,`hour`):t>=r?d(e,t,r,`minute`):t>=n?d(e,t,n,`second`):e+` ms`}function d(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}})),te=n(((e,t)=>{function n(e){n.debug=n,n.default=n,n.coerce=c,n.disable=o,n.enable=i,n.enabled=s,n.humanize=j(),n.destroy=l,Object.keys(e).forEach(t=>{n[t]=e[t]}),n.names=[],n.skips=[],n.formatters={};function t(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[Math.abs(t)%n.colors.length]}n.selectColor=t;function n(e){let t,i=null,a,o;function s(...e){if(!s.enabled)return;let r=s,i=Number(new Date);r.diff=i-(t||i),r.prev=t,r.curr=i,t=i,e[0]=n.coerce(e[0]),typeof e[0]!=`string`&&e.unshift(`%O`);let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,i)=>{if(t===`%%`)return`%`;a++;let o=n.formatters[i];if(typeof o==`function`){let n=e[a];t=o.call(r,n),e.splice(a,1),a--}return t}),n.formatArgs.call(r,e),(r.log||n.log).apply(r,e)}return s.namespace=e,s.useColors=n.useColors(),s.color=n.selectColor(e),s.extend=r,s.destroy=n.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>i===null?(a!==n.namespaces&&(a=n.namespaces,o=n.enabled(e)),o):i,set:e=>{i=e}}),typeof n.init==`function`&&n.init(s),s}function r(e,t){let r=n(this.namespace+(t===void 0?`:`:t)+e);return r.log=this.log,r}function i(e){n.save(e),n.namespaces=e,n.names=[],n.skips=[];let t=(typeof e==`string`?e:``).trim().replace(/\s+/g,`,`).split(`,`).filter(Boolean);for(let e of t)e[0]===`-`?n.skips.push(e.slice(1)):n.names.push(e)}function a(e,t){let n=0,r=0,i=-1,a=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||t[r]===`*`))t[r]===`*`?(i=r,a=n,r++):(n++,r++);else if(i!==-1)r=i+1,a++,n=a;else return!1;for(;r<t.length&&t[r]===`*`;)r++;return r===t.length}function o(){let e=[...n.names,...n.skips.map(e=>`-`+e)].join(`,`);return n.enable(``),e}function s(e){for(let t of n.skips)if(a(e,t))return!1;for(let t of n.names)if(a(e,t))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}t.exports=n})),M=n(((e,t)=>{e.formatArgs=r,e.save=i,e.load=a,e.useColors=n,e.storage=o(),e.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=`#0000CC.#0000FF.#0033CC.#0033FF.#0066CC.#0066FF.#0099CC.#0099FF.#00CC00.#00CC33.#00CC66.#00CC99.#00CCCC.#00CCFF.#3300CC.#3300FF.#3333CC.#3333FF.#3366CC.#3366FF.#3399CC.#3399FF.#33CC00.#33CC33.#33CC66.#33CC99.#33CCCC.#33CCFF.#6600CC.#6600FF.#6633CC.#6633FF.#66CC00.#66CC33.#9900CC.#9900FF.#9933CC.#9933FF.#99CC00.#99CC33.#CC0000.#CC0033.#CC0066.#CC0099.#CC00CC.#CC00FF.#CC3300.#CC3333.#CC3366.#CC3399.#CC33CC.#CC33FF.#CC6600.#CC6633.#CC9900.#CC9933.#CCCC00.#CCCC33.#FF0000.#FF0033.#FF0066.#FF0099.#FF00CC.#FF00FF.#FF3300.#FF3333.#FF3366.#FF3399.#FF33CC.#FF33FF.#FF6600.#FF6633.#FF9900.#FF9933.#FFCC00.#FFCC33`.split(`.`);function n(){if(typeof window<`u`&&window.process&&(window.process.type===`renderer`||window.process.__nwjs))return!0;if(typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<`u`&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<`u`&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<`u`&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(e){if(e[0]=(this.useColors?`%c`:``)+this.namespace+(this.useColors?` %c`:` `)+e[0]+(this.useColors?`%c `:` `)+`+`+t.exports.humanize(this.diff),!this.useColors)return;let n=`color: `+this.color;e.splice(1,0,n,`color: inherit`);let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,e=>{e!==`%%`&&(r++,e===`%c`&&(i=r))}),e.splice(i,0,n)}e.log=console.debug||console.log||(()=>{});function i(t){try{t?e.storage.setItem(`debug`,t):e.storage.removeItem(`debug`)}catch{}}function a(){let t;try{t=e.storage.getItem(`debug`)||e.storage.getItem(`DEBUG`)}catch{}return!t&&typeof process<`u`&&`env`in process&&(t=process.env.DEBUG),t}function o(){try{return localStorage}catch{}}t.exports=te()(e);let{formatters:s}=t.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}}})),ne=n(((e,t)=>{t.exports=(e,t)=>{t||=process.argv;let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1?!0:r<i)}})),re=n(((e,n)=>{let r=t(`os`),i=ne(),a=process.env,o;i(`no-color`)||i(`no-colors`)||i(`color=false`)?o=!1:(i(`color`)||i(`colors`)||i(`color=true`)||i(`color=always`))&&(o=!0),`FORCE_COLOR`in a&&(o=a.FORCE_COLOR.length===0||parseInt(a.FORCE_COLOR,10)!==0);function s(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function c(e){if(o===!1)return 0;if(i(`color=16m`)||i(`color=full`)||i(`color=truecolor`))return 3;if(i(`color=256`))return 2;if(e&&!e.isTTY&&o!==!0)return 0;let t=+!!o;if(process.platform===`win32`){let e=r.release().split(`.`);return Number(process.versions.node.split(`.`)[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in a)return[`TRAVIS`,`CIRCLECI`,`APPVEYOR`,`GITLAB_CI`].some(e=>e in a)||a.CI_NAME===`codeship`?1:t;if(`TEAMCITY_VERSION`in a)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(a.TEAMCITY_VERSION);if(a.COLORTERM===`truecolor`)return 3;if(`TERM_PROGRAM`in a){let e=parseInt((a.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(a.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(a.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(a.TERM)||`COLORTERM`in a?1:(a.TERM,t)}function l(e){return s(c(e))}n.exports={supportsColor:l,stdout:l(process.stdout),stderr:l(process.stderr)}})),N=n(((e,n)=>{let r=t(`tty`),i=t(`util`);e.init=d,e.log=c,e.formatArgs=o,e.save=l,e.load=u,e.useColors=a,e.destroy=i.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),e.colors=[6,2,3,4,5,1];try{let t=re();t&&(t.stderr||t).level>=2&&(e.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}e.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase()),r=process.env[t];return r=/^(yes|on|true|enabled)$/i.test(r)?!0:/^(no|off|false|disabled)$/i.test(r)?!1:r===`null`?null:Number(r),e[n]=r,e},{});function a(){return`colors`in e.inspectOpts?!!e.inspectOpts.colors:r.isatty(process.stderr.fd)}function o(e){let{namespace:t,useColors:r}=this;if(r){let r=this.color,i=`\x1B[3`+(r<8?r:`8;5;`+r),a=` ${i};1m${t} \u001B[0m`;e[0]=a+e[0].split(`
`).join(`
`+a),e.push(i+`m+`+n.exports.humanize(this.diff)+`\x1B[0m`)}else e[0]=s()+t+` `+e[0]}function s(){return e.inspectOpts.hideDate?``:new Date().toISOString()+` `}function c(...t){return process.stderr.write(i.formatWithOptions(e.inspectOpts,...t)+`
`)}function l(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function u(){return process.env.DEBUG}function d(t){t.inspectOpts={};let n=Object.keys(e.inspectOpts);for(let r=0;r<n.length;r++)t.inspectOpts[n[r]]=e.inspectOpts[n[r]]}n.exports=te()(e);let{formatters:f}=n.exports;f.o=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts).split(`
`).map(e=>e.trim()).join(` `)},f.O=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts)}})),P=n(((e,t)=>{typeof process>`u`||process.type===`renderer`||process.browser===!0||process.__nwjs?t.exports=M():t.exports=N()})),F=e(i(),1),I=e(P(),1);function ie(e){let t=typeof e==`string`?`
`:10,n=typeof e==`string`?`\r`:13;return e[e.length-1]===t&&(e=e.slice(0,-1)),e[e.length-1]===n&&(e=e.slice(0,-1)),e}const L=({cwd:e=d.cwd(),path:t=d.env[r()],preferLocal:n=!0,execPath:i=d.execPath,addExecPath:a=!0}={})=>{let s=e instanceof URL?o(e):e,c=p.resolve(s),l=[];return n&&R(l,c),a&&ae(l,i,c),[...l,t].join(p.delimiter)},R=(e,t)=>{let n;for(;n!==t;)e.push(p.join(t,`node_modules/.bin`)),n=t,t=p.resolve(t,`..`)},ae=(e,t,n)=>{let r=t instanceof URL?o(t):t;e.push(p.resolve(n,r,`..`))},z=({env:e=d.env,...t}={})=>{e={...e};let n=r({env:e});return t.path=e[n],e[n]=L(t),e},B=(e,t,n,r)=>{if(n===`length`||n===`prototype`||n===`arguments`||n===`caller`)return;let i=Object.getOwnPropertyDescriptor(e,n),a=Object.getOwnPropertyDescriptor(t,n);!V(i,a)&&r||Object.defineProperty(e,n,a)},V=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},H=(e,t)=>{let n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},U=(e,t)=>`/* Wrapped ${e}*/\n${t}`,oe=Object.getOwnPropertyDescriptor(Function.prototype,`toString`),se=Object.getOwnPropertyDescriptor(Function.prototype.toString,`name`),ce=(e,t,n)=>{let r=n===``?``:`with ${n.trim()}() `,i=U.bind(null,r,t.toString());Object.defineProperty(i,"name",se),Object.defineProperty(e,"toString",{...oe,value:i})};function W(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let r of Reflect.ownKeys(t))B(e,t,r,n);return H(e,t),ce(e,t,r),e}const le=new WeakMap,ue=(e,t={})=>{if(typeof e!=`function`)throw TypeError(`Expected a function`);let n,r=0,i=e.displayName||e.name||`<anonymous>`,a=function(...o){if(le.set(a,++r),r===1)n=e.apply(this,o),e=null;else if(t.throw===!0)throw Error(`Function \`${i}\` can only be called once`);return n};return W(a,e),le.set(a,r),a};ue.callCount=e=>{if(!le.has(e))throw Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return le.get(e)};const de=()=>{let e=64-pe+1;return Array.from({length:e},fe)},fe=(e,t)=>({name:`SIGRT${t+1}`,number:pe+t,action:`terminate`,description:`Application-specific signal (realtime)`,standard:`posix`}),pe=34,me=[{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`}],he=()=>{let e=de();return[...me,...e].map(ge)},ge=({name:e,number:t,description:n,action:r,forced:i=!1,standard:a})=>{let{signals:{[e]:o}}=_,s=o!==void 0;return{name:e,number:s?o:t,description:n,supported:s,action:r,forced:i,standard:a}},_e=()=>{let e=he();return Object.fromEntries(e.map(ve))},ve=({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}],ye=_e(),be=()=>{let e=he(),t=Array.from({length:65},(t,n)=>xe(n,e));return Object.assign({},...t)},xe=(e,t)=>{let n=Se(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}}},Se=(e,t)=>{let n=t.find(({name:t})=>_.signals[t]===e);return n===void 0?t.find(t=>t.number===e):n};be();const Ce=({timedOut:e,timeout:t,errorCode:n,signal:r,signalDescription:i,exitCode:a,isCanceled:o})=>e?`timed out after ${t} milliseconds`:o?`was canceled`:n===void 0?r===void 0?a===void 0?`failed`:`failed with exit code ${a}`:`was killed with ${r} (${i})`:`failed with ${n}`,we=({stdout:e,stderr:t,all:n,error:r,signal:i,exitCode:a,command:o,escapedCommand:s,timedOut:c,isCanceled:l,killed:u,parsed:{options:{timeout:f,cwd:p=d.cwd()}}})=>{a=a===null?void 0:a,i=i===null?void 0:i;let m=i===void 0?void 0:ye[i].description,h=`Command ${Ce({timedOut:c,timeout:f,errorCode:r&&r.code,signal:i,signalDescription:m,exitCode:a,isCanceled:l})}: ${o}`,g=Object.prototype.toString.call(r)===`[object Error]`,_=g?`${h}\n${r.message}`:h,v=[_,t,e].filter(Boolean).join(`
`);return g?(r.originalMessage=r.message,r.message=v):r=Error(v),r.shortMessage=_,r.command=o,r.escapedCommand=s,r.exitCode=a,r.signal=i,r.signalDescription=m,r.stdout=e,r.stderr=t,r.cwd=p,n!==void 0&&(r.all=n),`bufferedData`in r&&delete r.bufferedData,r.failed=!0,r.timedOut=!!c,r.isCanceled=l,r.killed=u&&!c,r},Te=[`stdin`,`stdout`,`stderr`],Ee=e=>Te.some(t=>e[t]!==void 0),De=e=>{if(!e)return;let{stdio:t}=e;if(t===void 0)return Te.map(t=>e[t]);if(Ee(e))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${Te.map(e=>`\`${e}\``).join(`, `)}`);if(typeof t==`string`)return t;if(!Array.isArray(t))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let n=Math.max(t.length,Te.length);return Array.from({length:n},(e,n)=>t[n])},Oe=(e,t=`SIGTERM`,n={})=>{let r=e(t);return ke(e,t,n,r),r},ke=(e,t,n,r)=>{if(!Ae(t,n,r))return;let i=Me(n),a=setTimeout(()=>{e(`SIGKILL`)},i);a.unref&&a.unref()},Ae=(e,{forceKillAfterTimeout:t},n)=>je(e)&&t!==!1&&n,je=e=>e===h.constants.signals.SIGTERM||typeof e==`string`&&e.toUpperCase()===`SIGTERM`,Me=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return 5e3;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Ne=(e,t)=>{e.kill()&&(t.isCanceled=!0)},Pe=(e,t,n)=>{e.kill(t),n(Object.assign(Error(`Timed out`),{timedOut:!0,signal:t}))},Fe=(e,{timeout:t,killSignal:n=`SIGTERM`},r)=>{if(t===0||t===void 0)return r;let i,a=new Promise((r,a)=>{i=setTimeout(()=>{Pe(e,n,a)},t)}),o=r.finally(()=>{clearTimeout(i)});return Promise.race([a,o])},Ie=({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})`)},Le=async(e,{cleanup:t,detached:n},r)=>{if(!t||n)return r;let i=a(()=>{e.kill()});return r.finally(()=>{i()})};function Re(e){return typeof e==`object`&&!!e&&typeof e.pipe==`function`}function ze(e){return Re(e)&&e.writable!==!1&&typeof e._write==`function`&&typeof e._writableState==`object`}const Be=e=>e instanceof c&&typeof e.then==`function`,Ve=(e,t,n)=>{if(typeof n==`string`)return e[t].pipe(b(n)),e;if(ze(n))return e[t].pipe(n),e;if(!Be(n))throw TypeError(`The second argument must be a string, a stream or an Execa child process.`);if(!ze(n.stdin))throw TypeError(`The target child process's stdin must be available.`);return e[t].pipe(n.stdin),n},He=e=>{e.stdout!==null&&(e.pipeStdout=Ve.bind(void 0,e,`stdout`)),e.stderr!==null&&(e.pipeStderr=Ve.bind(void 0,e,`stderr`)),e.all!==void 0&&(e.pipeAll=Ve.bind(void 0,e,`all`))},Ue=async(e,{init:t,convertChunk:n,getSize:r,truncateChunk:i,addChunk:a,getFinalChunk:o,finalize:s},{maxBuffer:c=1/0}={})=>{if(!qe(e))throw Error(`The first argument must be a Readable, a ReadableStream, or an async iterable.`);let l=t();l.length=0;try{for await(let t of e)Ge({convertedChunk:n[Je(t)](t,l),state:l,getSize:r,truncateChunk:i,addChunk:a,maxBuffer:c});return We({state:l,convertChunk:n,getSize:r,truncateChunk:i,addChunk:a,getFinalChunk:o,maxBuffer:c}),s(l)}catch(e){throw e.bufferedData=s(l),e}},We=({state:e,getSize:t,truncateChunk:n,addChunk:r,getFinalChunk:i,maxBuffer:a})=>{let o=i(e);o!==void 0&&Ge({convertedChunk:o,state:e,getSize:t,truncateChunk:n,addChunk:r,maxBuffer:a})},Ge=({convertedChunk:e,state:t,getSize:n,truncateChunk:r,addChunk:i,maxBuffer:a})=>{let o=n(e),s=t.length+o;if(s<=a){Ke(e,t,i,s);return}let c=r(e,a-t.length);throw c!==void 0&&Ke(c,t,i,a),new Xe},Ke=(e,t,n,r)=>{t.contents=n(e,t,r),t.length=r},qe=e=>typeof e==`object`&&!!e&&typeof e[Symbol.asyncIterator]==`function`,Je=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=Ye.call(e);return n===`[object ArrayBuffer]`?`arrayBuffer`:n===`[object DataView]`?`dataView`:Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&Ye.call(e.buffer)===`[object ArrayBuffer]`?`typedArray`:`others`},{toString:Ye}=Object.prototype;var Xe=class extends Error{name=`MaxBufferError`;constructor(){super(`maxBuffer exceeded`)}};const Ze=e=>e,Qe=()=>void 0,$e=({contents:e})=>e,et=e=>{throw Error(`Streams in object mode are not supported: ${String(e)}`)},tt=e=>e.length;async function nt(e,t){return Ue(e,gt,t)}const rt=()=>({contents:new ArrayBuffer(0)}),it=e=>at.encode(e),at=new TextEncoder,ot=e=>new Uint8Array(e),st=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),ct=(e,t)=>e.slice(0,t),lt=(e,{contents:t,length:n},r)=>{let i=ht()?dt(t,r):ut(t,r);return new Uint8Array(i).set(e,n),i},ut=(e,t)=>{if(t<=e.byteLength)return e;let n=new ArrayBuffer(ft(t));return new Uint8Array(n).set(new Uint8Array(e),0),n},dt=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let n=new ArrayBuffer(t,{maxByteLength:ft(t)});return new Uint8Array(n).set(new Uint8Array(e),0),n},ft=e=>pt**Math.ceil(Math.log(e)/Math.log(pt)),pt=2,mt=({contents:e,length:t})=>ht()?e:e.slice(0,t),ht=()=>`resize`in ArrayBuffer.prototype,gt={init:rt,convertChunk:{string:it,buffer:ot,arrayBuffer:ot,dataView:st,typedArray:st,others:et},getSize:tt,truncateChunk:ct,addChunk:lt,getFinalChunk:Qe,finalize:mt};async function _t(e,t){if(!(`Buffer`in globalThis))throw Error(`getStreamAsBuffer() is only supported in Node.js`);try{return vt(await nt(e,t))}catch(e){throw e.bufferedData!==void 0&&(e.bufferedData=vt(e.bufferedData)),e}}const vt=e=>globalThis.Buffer.from(e);async function yt(e,t){return Ue(e,St,t)}const bt=()=>({contents:``,textDecoder:new TextDecoder}),xt=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),St={init:bt,convertChunk:{string:Ze,buffer:xt,arrayBuffer:xt,dataView:xt,typedArray:xt,others:et},getSize:tt,truncateChunk:(e,t)=>e.slice(0,t),addChunk:(e,{contents:t})=>t+e,getFinalChunk:({textDecoder:e})=>{let t=e.decode();return t===``?void 0:t},finalize:$e};var Ct=e(n(((e,n)=>{let{PassThrough:r}=t(`stream`);n.exports=function(){var e=[],t=new r({objectMode:!0});return t.setMaxListeners(0),t.add=n,t.isEmpty=i,t.on(`unpipe`,a),Array.prototype.slice.call(arguments).forEach(n),t;function n(r){return Array.isArray(r)?(r.forEach(n),this):(e.push(r),r.once(`end`,a.bind(null,r)),r.once(`error`,t.emit.bind(t,`error`)),r.pipe(t,{end:!1}),this)}function i(){return e.length==0}function a(n){e=e.filter(function(e){return e!==n}),!e.length&&t.readable&&t.end()}}}))(),1);const wt=e=>{if(e!==void 0)throw TypeError("The `input` and `inputFile` options cannot be both set.")},Tt=({input:e,inputFile:t})=>typeof t==`string`?(wt(e),x(t)):e,Et=e=>{let t=Tt(e);if(Re(t))throw TypeError("The `input` option cannot be a stream in sync mode");return t},Dt=({input:e,inputFile:t})=>typeof t==`string`?(wt(e),y(t)):e,Ot=(e,t)=>{let n=Dt(t);n!==void 0&&(Re(n)?n.pipe(e.stdin):e.stdin.end(n))},kt=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;let n=(0,Ct.default)();return e.stdout&&n.add(e.stdout),e.stderr&&n.add(e.stderr),n},At=async(e,t)=>{if(!(!e||t===void 0)){await m(0),e.destroy();try{return await t}catch(e){return e.bufferedData}}},jt=(e,{encoding:t,buffer:n,maxBuffer:r})=>{if(!(!e||!n))return t===`utf8`||t===`utf-8`?yt(e,{maxBuffer:r}):t===null||t===`buffer`?_t(e,{maxBuffer:r}):Mt(e,r,t)},Mt=async(e,t,n)=>(await _t(e,{maxBuffer:t})).toString(n),Nt=async({stdout:e,stderr:t,all:n},{encoding:r,buffer:i,maxBuffer:a},o)=>{let s=jt(e,{encoding:r,buffer:i,maxBuffer:a}),c=jt(t,{encoding:r,buffer:i,maxBuffer:a}),l=jt(n,{encoding:r,buffer:i,maxBuffer:a*2});try{return await Promise.all([o,s,c,l])}catch(r){return Promise.all([{error:r,signal:r.signal,timedOut:r.timedOut},At(e,s),At(t,c),At(n,l)])}},Pt=(async()=>{})().constructor.prototype,Ft=[`then`,`catch`,`finally`].map(e=>[e,Reflect.getOwnPropertyDescriptor(Pt,e)]),It=(e,t)=>{for(let[n,r]of Ft){let i=typeof t==`function`?(...e)=>Reflect.apply(r.value,t(),e):r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}},Lt=e=>new Promise((t,n)=>{e.on(`exit`,(e,n)=>{t({exitCode:e,signal:n})}),e.on(`error`,e=>{n(e)}),e.stdin&&e.stdin.on(`error`,e=>{n(e)})}),Rt=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],zt=/^[\w.-]+$/,Bt=e=>typeof e!=`string`||zt.test(e)?e:`"${e.replaceAll(`"`,`\\"`)}"`,Vt=(e,t)=>Rt(e,t).join(` `),Ht=(e,t)=>Rt(e,t).map(e=>Bt(e)).join(` `),Ut=/ +/g,Wt=e=>{let t=[];for(let n of e.trim().split(Ut)){let e=t.at(-1);e&&e.endsWith(`\\`)?t[t.length-1]=`${e.slice(0,-1)} ${n}`:t.push(n)}return t},Gt=e=>{let t=typeof e;if(t===`string`)return e;if(t===`number`)return String(e);if(t===`object`&&e!==null&&!(e instanceof c)&&`stdout`in e){let t=typeof e.stdout;if(t===`string`)return e.stdout;if(C.isBuffer(e.stdout))return e.stdout.toString();throw TypeError(`Unexpected "${t}" stdout in template expression`)}throw TypeError(`Unexpected "${t}" in template expression`)},Kt=(e,t,n)=>n||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],qt=({templates:e,expressions:t,tokens:n,index:r,template:i})=>{let a=i??e.raw[r],o=Kt(n,a.split(Ut).filter(Boolean),a.startsWith(` `));if(r===t.length)return o;let s=t[r];return Kt(o,Array.isArray(s)?s.map(e=>Gt(e)):[Gt(s)],a.endsWith(` `))},Jt=(e,t)=>{let n=[];for(let[r,i]of e.entries())n=qt({templates:e,expressions:t,tokens:n,index:r,template:i});return n},Yt=l(`execa`).enabled,Xt=(e,t)=>String(e).padStart(t,`0`),Zt=()=>{let e=new Date;return`${Xt(e.getHours(),2)}:${Xt(e.getMinutes(),2)}:${Xt(e.getSeconds(),2)}.${Xt(e.getMilliseconds(),3)}`},Qt=(e,{verbose:t})=>{t&&d.stderr.write(`[${Zt()}] ${e}\n`)},$t=({env:e,extendEnv:t,preferLocal:n,localDir:r,execPath:i})=>{let a=t?{...d.env,...e}:e;return n?z({env:a,cwd:r,execPath:i}):a},en=(e,t,n={})=>{let r=F.default._parse(e,t,n);return e=r.command,t=r.args,n=r.options,n={maxBuffer:1e8,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:n.cwd||d.cwd(),execPath:d.execPath,encoding:`utf8`,reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:Yt,...n},n.env=$t(n),n.stdio=De(n),d.platform===`win32`&&p.basename(e,`.exe`)===`cmd`&&t.unshift(`/q`),{file:e,args:t,options:n,parsed:r}},tn=(e,t,n)=>typeof t!=`string`&&!C.isBuffer(t)?n===void 0?void 0:``:e.stripFinalNewline?ie(t):t;function nn(e,t,n){let r=en(e,t,n),i=Vt(e,t),a=Ht(e,t);Qt(a,r.options),Ie(r.options);let o;try{o=s.spawn(r.file,r.args,r.options)}catch(e){let t=new s.ChildProcess;return It(t,Promise.reject(we({error:e,stdout:``,stderr:``,all:``,command:i,escapedCommand:a,parsed:r,timedOut:!1,isCanceled:!1,killed:!1}))),t}let c=Lt(o),l=Fe(o,r.options,c),u=Le(o,r.options,l),d={isCanceled:!1};o.kill=Oe.bind(null,o.kill.bind(o)),o.cancel=Ne.bind(null,o,d);let f=ue(async()=>{let[{error:e,exitCode:t,signal:n,timedOut:s},c,l,f]=await Nt(o,r.options,u),p=tn(r.options,c),m=tn(r.options,l),h=tn(r.options,f);if(e||t!==0||n!==null){let c=we({error:e,exitCode:t,signal:n,stdout:p,stderr:m,all:h,command:i,escapedCommand:a,parsed:r,timedOut:s,isCanceled:d.isCanceled||(r.options.signal?r.options.signal.aborted:!1),killed:o.killed});if(!r.options.reject)return c;throw c}return{command:i,escapedCommand:a,exitCode:0,stdout:p,stderr:m,all:h,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return Ot(o,r.options),o.all=kt(o,r.options),He(o),It(o,f),o}function rn(e,t,n){let r=en(e,t,n),i=Vt(e,t),a=Ht(e,t);Qt(a,r.options);let o=Et(r.options),c;try{c=s.spawnSync(r.file,r.args,{...r.options,input:o})}catch(e){throw we({error:e,stdout:``,stderr:``,all:``,command:i,escapedCommand:a,parsed:r,timedOut:!1,isCanceled:!1,killed:!1})}let l=tn(r.options,c.stdout,c.error),u=tn(r.options,c.stderr,c.error);if(c.error||c.status!==0||c.signal!==null){let e=we({stdout:l,stderr:u,error:c.error,signal:c.signal,exitCode:c.status,command:i,escapedCommand:a,parsed:r,timedOut:c.error&&c.error.code===`ETIMEDOUT`,isCanceled:!1,killed:c.signal!==null});if(!r.options.reject)return e;throw e}return{command:i,escapedCommand:a,exitCode:0,stdout:l,stderr:u,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}const an=({input:e,inputFile:t,stdio:n})=>e===void 0&&t===void 0&&n===void 0?{stdin:`inherit`}:{},on=(e={})=>({preferLocal:!0,...an(e),...e});function sn(e){function t(t,...n){if(!Array.isArray(t))return sn({...e,...t});let[r,...i]=Jt(t,n);return nn(r,i,on(e))}return t.sync=(t,...n)=>{if(!Array.isArray(t))throw TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");let[r,...i]=Jt(t,n);return rn(r,i,on(e))},t}sn();function cn(e,t){let[n,...r]=Wt(e);return nn(n,r,t)}const ln=(0,I.default)(`lint-staged:execGit`),un=[`-c`,`submodule.recurse=false`],dn=async(e,t={})=>{ln(`Running git command`,e);try{let{stdout:n}=await nn(`git`,un.concat(e),{...t,all:!0,cwd:t.cwd||process.cwd(),stdin:`ignore`});return n}catch({all:e}){throw Error(e)}},fn=(e=0)=>t=>`\u001B[${t+e}m`,pn=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,mn=(e=0)=>(t,n,r)=>`\u001B[${38+e};2;${t};${n};${r}m`,G={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(G.modifier);const hn=Object.keys(G.color),gn=Object.keys(G.bgColor);[...hn,...gn];function _n(){let e=new Map;for(let[t,n]of Object.entries(G)){for(let[t,r]of Object.entries(n))G[t]={open:`\u001B[${r[0]}m`,close:`\u001B[${r[1]}m`},n[t]=G[t],e.set(r[0],r[1]);Object.defineProperty(G,t,{value:n,enumerable:!1})}return Object.defineProperty(G,"codes",{value:e,enumerable:!1}),G.color.close=`\x1B[39m`,G.bgColor.close=`\x1B[49m`,G.color.ansi=fn(),G.color.ansi256=pn(),G.color.ansi16m=mn(),G.bgColor.ansi=fn(10),G.bgColor.ansi256=pn(10),G.bgColor.ansi16m=mn(10),Object.defineProperties(G,{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=>G.rgbToAnsi256(...G.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)=>G.ansi256ToAnsi(G.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>G.ansi256ToAnsi(G.hexToAnsi256(e)),enumerable:!1}}),G}const vn=_n();function K(e,t=globalThis.Deno?globalThis.Deno.args:d.argv){let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1||r<i)}const{env:q}=d;let yn;K(`no-color`)||K(`no-colors`)||K(`color=false`)||K(`color=never`)?yn=0:(K(`color`)||K(`colors`)||K(`color=true`)||K(`color=always`))&&(yn=1);function bn(){if(`FORCE_COLOR`in q)return q.FORCE_COLOR===`true`?1:q.FORCE_COLOR===`false`?0:q.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(q.FORCE_COLOR,10),3)}function xn(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Sn(e,{streamIsTTY:t,sniffFlags:n=!0}={}){let r=bn();r!==void 0&&(yn=r);let i=n?yn:r;if(i===0)return 0;if(n){if(K(`color=16m`)||K(`color=full`)||K(`color=truecolor`))return 3;if(K(`color=256`))return 2}if(`TF_BUILD`in q&&`AGENT_NAME`in q)return 1;if(e&&!t&&i===void 0)return 0;let a=i||0;if(q.TERM===`dumb`)return a;if(d.platform===`win32`){let e=h.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in q)return[`GITHUB_ACTIONS`,`GITEA_ACTIONS`,`CIRCLECI`].some(e=>e in q)?3:[`TRAVIS`,`APPVEYOR`,`GITLAB_CI`,`BUILDKITE`,`DRONE`].some(e=>e in q)||q.CI_NAME===`codeship`?1:a;if(`TEAMCITY_VERSION`in q)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(q.TEAMCITY_VERSION);if(q.COLORTERM===`truecolor`||q.TERM===`xterm-kitty`||q.TERM===`xterm-ghostty`||q.TERM===`wezterm`)return 3;if(`TERM_PROGRAM`in q){let e=Number.parseInt((q.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(q.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(q.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(q.TERM)||`COLORTERM`in q?1:a}function Cn(e,t={}){return xn(Sn(e,{streamIsTTY:e&&e.isTTY,...t}))}const wn={stdout:Cn({isTTY:f.isatty(1)}),stderr:Cn({isTTY:f.isatty(2)})};function Tn(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 En(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
`:`
`)+n,i=r+1,r=e.indexOf(`
`,i)}while(r!==-1);return a+=e.slice(i),a}const{stdout:Dn,stderr:On}=wn,kn=Symbol(`GENERATOR`),An=Symbol(`STYLER`),jn=Symbol(`IS_EMPTY`),Mn=[`ansi`,`ansi`,`ansi256`,`ansi16m`],Nn=Object.create(null),Pn=(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=Dn?Dn.level:0;e.level=t.level===void 0?n:t.level},Fn=e=>{let t=(...e)=>e.join(` `);return Pn(t,e),Object.setPrototypeOf(t,In.prototype),t};function In(e){return Fn(e)}Object.setPrototypeOf(In.prototype,Function.prototype);for(let[e,t]of Object.entries(vn))Nn[e]={get(){let n=Bn(this,zn(t.open,t.close,this[An]),this[jn]);return Object.defineProperty(this,e,{value:n}),n}};Nn.visible={get(){let e=Bn(this,this[An],!0);return Object.defineProperty(this,"visible",{value:e}),e}};const Ln=(e,t,n,...r)=>e===`rgb`?t===`ansi16m`?vn[n].ansi16m(...r):t===`ansi256`?vn[n].ansi256(vn.rgbToAnsi256(...r)):vn[n].ansi(vn.rgbToAnsi(...r)):e===`hex`?Ln(`rgb`,t,n,...vn.hexToRgb(...r)):vn[n][e](...r);for(let e of[`rgb`,`hex`,`ansi256`]){Nn[e]={get(){let{level:t}=this;return function(...n){let r=zn(Ln(e,Mn[t],`color`,...n),vn.color.close,this[An]);return Bn(this,r,this[jn])}}};let t=`bg`+e[0].toUpperCase()+e.slice(1);Nn[t]={get(){let{level:t}=this;return function(...n){let r=zn(Ln(e,Mn[t],`bgColor`,...n),vn.bgColor.close,this[An]);return Bn(this,r,this[jn])}}}}const Rn=Object.defineProperties(()=>{},{...Nn,level:{enumerable:!0,get(){return this[kn].level},set(e){this[kn].level=e}}}),zn=(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}},Bn=(e,t,n)=>{let r=(...e)=>Vn(r,e.length===1?``+e[0]:e.join(` `));return Object.setPrototypeOf(r,Rn),r[kn]=e,r[An]=t,r[jn]=n,r},Vn=(e,t)=>{if(e.level<=0||!t)return e[jn]?``:t;let n=e[An];if(n===void 0)return t;let{openAll:r,closeAll:i}=n;if(t.includes(`\x1B`))for(;n!==void 0;)t=Tn(t,n.close,n.open),n=n.parent;let a=t.indexOf(`
`);return a!==-1&&(t=En(t,i,r,a)),r+t+i};Object.defineProperties(In.prototype,Nn);const J=In();In({level:On?On.level:0});var Hn=e(n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)}))(),1).default;const{env:Un={},argv:Wn=[],platform:Gn=``}=typeof process>`u`?{}:process,Kn=`NO_COLOR`in Un||Wn.includes(`--no-color`),qn=`FORCE_COLOR`in Un||Wn.includes(`--color`),Jn=Gn===`win32`,Yn=Un.TERM===`dumb`,Xn=E&&E.isatty&&E.isatty(1)&&Un.TERM&&!Yn,Zn=`CI`in Un&&(`GITHUB_ACTIONS`in Un||`GITLAB_CI`in Un||`CIRCLECI`in Un),Qn=!Kn&&(qn||Jn&&!Yn||Xn||Zn),$n=(e,t,n,r,i=t.substring(0,e)+r,a=t.substring(e+n.length),o=a.indexOf(n))=>i+(o<0?a:$n(o,a,n,r)),er=(e,t,n,r,i)=>e<0?n+t+r:n+$n(e,t,r,i)+r,tr=(e,t,n=e,r=e.length+1)=>i=>i||!(i===``||i===void 0)?er((``+i).indexOf(t,r),i,e,t,n):``,Y=(e,t,n)=>tr(`\x1b[${e}m`,`\x1b[${t}m`,n),nr={reset:Y(0,0),bold:Y(1,22,`\x1B[22m\x1B[1m`),dim:Y(2,22,`\x1B[22m\x1B[2m`),italic:Y(3,23),underline:Y(4,24),inverse:Y(7,27),hidden:Y(8,28),strikethrough:Y(9,29),black:Y(30,39),red:Y(31,39),green:Y(32,39),yellow:Y(33,39),blue:Y(34,39),magenta:Y(35,39),cyan:Y(36,39),white:Y(37,39),gray:Y(90,39),bgBlack:Y(40,49),bgRed:Y(41,49),bgGreen:Y(42,49),bgYellow:Y(43,49),bgBlue:Y(44,49),bgMagenta:Y(45,49),bgCyan:Y(46,49),bgWhite:Y(47,49),blackBright:Y(90,39),redBright:Y(91,39),greenBright:Y(92,39),yellowBright:Y(93,39),blueBright:Y(94,39),magentaBright:Y(95,39),cyanBright:Y(96,39),whiteBright:Y(97,39),bgBlackBright:Y(100,49),bgRedBright:Y(101,49),bgGreenBright:Y(102,49),bgYellowBright:Y(103,49),bgBlueBright:Y(104,49),bgMagentaBright:Y(105,49),bgCyanBright:Y(106,49),bgWhiteBright:Y(107,49)},rr=({useColor:e=Qn}={})=>e?nr:Object.keys(nr).reduce((e,t)=>({...e,[t]:String}),{}),{reset:ir,bold:ar,dim:or,italic:sr,underline:cr,inverse:lr,hidden:ur,strikethrough:dr,black:fr,red:pr,green:mr,yellow:hr,blue:gr,magenta:_r,cyan:vr,white:yr,gray:br,bgBlack:xr,bgRed:Sr,bgGreen:Cr,bgYellow:wr,bgBlue:Tr,bgMagenta:Er,bgCyan:Dr,bgWhite:Or,blackBright:kr,redBright:Ar,greenBright:jr,yellowBright:Mr,blueBright:Nr,magentaBright:Pr,cyanBright:Fr,whiteBright:Ir,bgBlackBright:Lr,bgRedBright:Rr,bgGreenBright:zr,bgYellowBright:Br,bgBlueBright:Vr,bgMagentaBright:Hr,bgCyanBright:Ur,bgWhiteBright:Wr}=rr();var Gr=e(n(((e,t)=>{t.exports=r;function n(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}function r(e){if(e||={},e.circles)return i(e);let t=new Map;if(t.set(Date,e=>new Date(e)),t.set(Map,(e,t)=>new Map(a(Array.from(e),t))),t.set(Set,(e,t)=>new Set(a(Array.from(e),t))),e.constructorHandlers)for(let n of e.constructorHandlers)t.set(n[0],n[1]);let r=null;return e.proto?s:o;function a(e,i){let a=Object.keys(e),o=Array(a.length);for(let s=0;s<a.length;s++){let c=a[s],l=e[c];typeof l!=`object`||!l?o[c]=l:l.constructor!==Object&&(r=t.get(l.constructor))?o[c]=r(l,i):ArrayBuffer.isView(l)?o[c]=n(l):o[c]=i(l)}return o}function o(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return a(e,o);if(e.constructor!==Object&&(r=t.get(e.constructor)))return r(e,o);let i={};for(let a in e){if(Object.hasOwnProperty.call(e,a)===!1)continue;let s=e[a];typeof s!=`object`||!s?i[a]=s:s.constructor!==Object&&(r=t.get(s.constructor))?i[a]=r(s,o):ArrayBuffer.isView(s)?i[a]=n(s):i[a]=o(s)}return i}function s(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return a(e,s);if(e.constructor!==Object&&(r=t.get(e.constructor)))return r(e,s);let i={};for(let a in e){let o=e[a];typeof o!=`object`||!o?i[a]=o:o.constructor!==Object&&(r=t.get(o.constructor))?i[a]=r(o,s):ArrayBuffer.isView(o)?i[a]=n(o):i[a]=s(o)}return i}}function i(e){let t=[],r=[],i=new Map;if(i.set(Date,e=>new Date(e)),i.set(Map,(e,t)=>new Map(o(Array.from(e),t))),i.set(Set,(e,t)=>new Set(o(Array.from(e),t))),e.constructorHandlers)for(let t of e.constructorHandlers)i.set(t[0],t[1]);let a=null;return e.proto?c:s;function o(e,o){let s=Object.keys(e),c=Array(s.length);for(let l=0;l<s.length;l++){let u=s[l],d=e[u];if(typeof d!=`object`||!d)c[u]=d;else if(d.constructor!==Object&&(a=i.get(d.constructor)))c[u]=a(d,o);else if(ArrayBuffer.isView(d))c[u]=n(d);else{let e=t.indexOf(d);e===-1?c[u]=o(d):c[u]=r[e]}}return c}function s(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return o(e,s);if(e.constructor!==Object&&(a=i.get(e.constructor)))return a(e,s);let c={};t.push(e),r.push(c);for(let o in e){if(Object.hasOwnProperty.call(e,o)===!1)continue;let l=e[o];if(typeof l!=`object`||!l)c[o]=l;else if(l.constructor!==Object&&(a=i.get(l.constructor)))c[o]=a(l,s);else if(ArrayBuffer.isView(l))c[o]=n(l);else{let e=t.indexOf(l);e===-1?c[o]=s(l):c[o]=r[e]}}return t.pop(),r.pop(),c}function c(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return o(e,c);if(e.constructor!==Object&&(a=i.get(e.constructor)))return a(e,c);let s={};t.push(e),r.push(s);for(let o in e){let l=e[o];if(typeof l!=`object`||!l)s[o]=l;else if(l.constructor!==Object&&(a=i.get(l.constructor)))s[o]=a(l,c);else if(ArrayBuffer.isView(l))s[o]=n(l);else{let e=t.indexOf(l);e===-1?s[o]=c(l):s[o]=r[e]}}return t.pop(),r.pop(),s}}}))(),1),Kr=Object.defineProperty,X=(e,t)=>Kr(e,`name`,{value:t,configurable:!0}),qr={CURSOR_HIDE:`\x1B[?25l`,CURSOR_SHOW:`\x1B[?25h`},Jr=(e=>(e.WAITING=`WAITING`,e.STARTED=`STARTED`,e.COMPLETED=`COMPLETED`,e.FAILED=`FAILED`,e.SKIPPED=`SKIPPED`,e.ROLLING_BACK=`ROLLING_BACK`,e.ROLLED_BACK=`ROLLED_BACK`,e.RETRY=`RETRY`,e.PAUSED=`PAUSED`,e.PROMPT=`PROMPT`,e.PROMPT_COMPLETED=`PROMPT_COMPLETED`,e.PROMPT_FAILED=`PROMPT_FAILED`,e))(Jr||{}),Yr=class{static{X(this,`EventManager`)}emitter=new Hn;emit(e,t){this.emitter.emit(e,t)}on(e,t){this.emitter.addListener(e,t)}once(e,t){this.emitter.once(e,t)}off(e,t){this.emitter.off(e,t)}complete(){this.emitter.removeAllListeners()}};(class{static{X(this,`BaseEventMap`)}});function Xr(e){return!!e&&typeof e==`object`&&typeof e.subscribe==`function`}X(Xr,`isObservable`);function Zr(e){return!!e&&typeof e==`object`&&e.readable===!0&&typeof e.read==`function`&&typeof e.on==`function`}X(Zr,`isReadable`);function Qr(){return!!process.env.LISTR_FORCE_UNICODE||process.platform!==`win32`||!!process.env.CI||!!process.env.WT_SESSION||process.env.TERM_PROGRAM===`vscode`||process.env.TERM===`xterm-256color`||process.env.TERM===`alacritty`}X(Qr,`isUnicodeSupported`);var $r=`(?:\\u001b|\\u009b)\\[[\\=><~/#&.:=?%@~_-]*[0-9]*[\\a-ln-tqyz=><~/#&.:=?%@~_-]+`,ei=/\u0007/;function ti(e){return String(e).replace(new RegExp($r,`gmi`),``).replace(new RegExp(ei,`gmi`),``).trim()}X(ti,`cleanseAnsi`);var Z=rr();function ni(e,t){return e.replace(/^(?!\s*$)/gm,` `.repeat(t))}X(ni,`indent`);var ri={warning:`⚠`,cross:`✖`,arrowDown:`↓`,tick:`✔`,arrowRight:`→`,pointer:`❯`,checkboxOn:`☒`,arrowLeft:`←`,squareSmallFilled:`◼`,pointerSmall:`›`},ii={...ri,warning:`‼`,cross:`×`,tick:`√`,pointer:`>`,checkboxOn:`[×]`,squareSmallFilled:`■`},Q=Qr()?ri:ii;function ai(e,...t){return D(String(e),...t)}X(ai,`splat`);var oi={icon:{STARTED:Q.pointer,FAILED:Q.cross,SKIPPED:Q.arrowDown,COMPLETED:Q.tick,OUTPUT:Q.pointerSmall,TITLE:Q.arrowRight,RETRY:Q.warning,ROLLBACK:Q.arrowLeft,PAUSED:Q.squareSmallFilled},color:{STARTED:Z.yellow,FAILED:Z.red,SKIPPED:Z.yellow,COMPLETED:Z.green,RETRY:Z.yellowBright,ROLLBACK:Z.redBright,PAUSED:Z.yellowBright}},si=[`RETRY`,`ROLLBACK`,`FAILED`],ci=class{constructor(e){this.options=e,this.options={useIcons:!0,toStderr:[],...e??{}},this.options.fields??={},this.options.fields.prefix??=[],this.options.fields.suffix??=[],this.process=this.options.processOutput??new di}static{X(this,`ListrLogger`)}process;log(e,t,n){let r=this.format(e,t,n);if(this.options.toStderr.includes(e)){this.process.toStderr(r);return}this.process.toStdout(r)}toStdout(e,t,n=!0){this.process.toStdout(this.format(null,e,t),n)}toStderr(e,t,n=!0){this.process.toStderr(this.format(null,e,t),n)}wrap(e,t){return e&&this.applyFormat(`[${e}]`,t)}splat(...e){let t=e.shift()??``;return e.length===0?t:ai(t,e)}suffix(e,...t){return t.filter(Boolean).forEach(t=>{if(e+=this.spacing(e),typeof t==`string`)e+=this.wrap(t);else if(typeof t==`object`){if(t.args??=[],typeof t.condition==`function`?!t.condition(...t.args):!(t.condition??!0))return e;e+=this.wrap(typeof t.field==`function`?t.field(...t.args):t.field,{format:t?.format(...t.args)})}}),e}prefix(e,...t){return t.filter(Boolean).forEach(t=>{if(e=this.spacing(e)+e,typeof t==`string`)e=this.wrap(t)+e;else if(typeof t==`object`){if(t.args??=[],typeof t.condition==`function`?!t.condition(...t.args):!(t.condition??!0))return e;e=this.wrap(typeof t.field==`function`?t.field(...t.args):t.field,{format:t?.format()})+e}}),e}fields(e,t){return this.options?.fields?.prefix&&(e=this.prefix(e,...this.options.fields.prefix)),t?.prefix&&(e=this.prefix(e,...t.prefix)),t?.suffix&&(e=this.suffix(e,...t.suffix)),this.options?.fields?.suffix&&(e=this.suffix(e,...this.options.fields.suffix)),e}icon(e,t){if(!e)return null;if(!t){let n=this.options.icon?.[e];t=typeof n==`function`?n():n}let n=this.options.color?.[e];return t&&n&&(t=n(t)),t}format(e,t,n){return Array.isArray(t)||(t=[t]),t=this.splat(t.shift(),...t).toString().split(O).filter(e=>!e||e.trim()!==``).map(t=>this.style(e,this.fields(t,{prefix:Array.isArray(n?.prefix)?n.prefix:[n?.prefix],suffix:Array.isArray(n?.suffix)?n.suffix:[n?.suffix]}))).join(O),t}style(e,t){if(!e||!t)return t;let n=this.icon(e,!this.options.useIcons&&this.wrap(e));return n&&(t=n+` `+t),t}applyFormat(e,t){return t?.format?t.format(e):e}spacing(e){return e===void 0||e.trim()===``?``:` `}},li=class{constructor(e){this.options=e}static{X(this,`ProcessOutputBuffer`)}buffer=[];decoder=new k;get all(){return this.buffer}get last(){return this.buffer.at(-1)}get length(){return this.buffer.length}write(e,...t){let n=t[t.length-1];return this.buffer.push({time:Date.now(),stream:this.options?.stream,entry:this.decoder.write(typeof e==`string`?Buffer.from(e,typeof t[0]==`string`?t[0]:void 0):Buffer.from(e))}),this.options?.limit&&(this.buffer=this.buffer.slice(-this.options.limit)),typeof n==`function`&&n(),!0}reset(){this.buffer=[]}},ui=class{constructor(e){this.stream=e,this.method=e.write,this.buffer=new li({stream:e})}static{X(t