55 lines
118 KiB
JavaScript
55 lines
118 KiB
JavaScript
|
"use strict";var $s=Object.defineProperty;var a=(t,e)=>$s(t,"name",{value:e,configurable:!0});var Et=require("node:os"),Ts=require("tty"),xs=require("esbuild"),Os=require("./package-DdlSEfAh.cjs"),he=require("./get-pipe-path-BoR10qr8.cjs"),Ru=require("node:url"),Ns=require("child_process"),z=require("path"),De=require("fs"),je=require("./node-features-roYmp9jK.cjs"),Hs=require("node:path"),Ls=require("events"),Ae=require("util"),Is=require("stream"),bu=require("os"),Ps=require("node:net"),pt=require("node:fs"),ks=require("./temporary-directory-B83uKxJF.cjs");require("module");const Ms="known-flag",Gs="unknown-flag",Ws="argument",{stringify:ye}=JSON,js=/\B([A-Z])/g,Us=a(t=>t.replace(js,"-$1").toLowerCase(),"v$1"),{hasOwnProperty:Ks}=Object.prototype,we=a((t,e)=>Ks.call(t,e),"w$2"),Vs=a(t=>Array.isArray(t),"L$2"),vu=a(t=>typeof t=="function"?[t,!1]:Vs(t)?[t[0],!0]:vu(t.type),"b$2"),zs=a((t,e)=>t===Boolean?e!=="false":e,"d$2"),Ys=a((t,e)=>typeof e=="boolean"?e:t===Number&&e===""?Number.NaN:t(e),"m$1"),qs=/[\s.:=]/,Xs=a(t=>{const e=`Flag name ${ye(t)}`;if(t.length===0)throw new Error(`${e} cannot be empty`);if(t.length===1)throw new Error(`${e} must be longer than a character`);const u=t.match(qs);if(u)throw new Error(`${e} cannot contain ${ye(u?.[0])}`)},"B"),Qs=a(t=>{const e={},u=a((r,s)=>{if(we(e,r))throw new Error(`Duplicate flags named ${ye(r)}`);e[r]=s},"r");for(const r in t){if(!we(t,r))continue;Xs(r);const s=t[r],n=[[],...vu(s),s];u(r,n);const i=Us(r);if(r!==i&&u(i,n),"alias"in s&&typeof s.alias=="string"){const{alias:D}=s,o=`Flag alias ${ye(D)} for flag ${ye(r)}`;if(D.length===0)throw new Error(`${o} cannot be empty`);if(D.length>1)throw new Error(`${o} must be a single character`);u(D,n)}}return e},"K$1"),Zs=a((t,e)=>{const u={};for(const r in t){if(!we(t,r))continue;const[s,,n,i]=e[r];if(s.length===0&&"default"in i){let{default:D}=i;typeof D=="function"&&(D=D()),u[r]=D}else u[r]=n?s:s.pop()}return u},"_$2"),Ue="--",Js=/[.:=]/,en=/^-{1,2}\w/,tn=a(t=>{if(!en.test(t))return;const e=!t.startsWith(Ue);let u=t.slice(e?1:2),r;const s=u.match(Js);if(s){const{index:n}=s;r=u.slice(n+1),u=u.slice(0,n)}return[u,r,e]},"N"),un=a((t,{onFlag:e,onArgument:u})=>{let r;const s=a((n,i)=>{if(typeof r!="function")return!0;r(n,i),r=void 0},"o");for(let n=0;n<t.length;n+=1){const i=t[n];if(i===Ue){s();const o=t.slice(n+1);u?.(o,[n],!0);break}const D=tn(i);if(D){if(s(),!e)continue;const[o,c,f]=D;if(f)for(let h=0;h<o.length;h+=1){s();const l=h===o.length-1;r=e(o[h],l?c:void 0,[n,h+1,l])}else r=e(o,c,[n])}else s(i,[n])&&u?.([i],[n])}s()},"$$1"),rn=a((t,e)=>{for(const[u,r,s]of e.reverse()){if(r){const n=t[u];let i=n.slice(0,r);if(s||(i+=n.slice(r+1)),i!=="-"){t[u]=i;continue}}t.splice(u,1)}},"E"),Su=a((t,e=process.argv.slice(2),{ignore:u}={})=>{const r=[],s=Qs(t),n={},i=[];return i[Ue]=[],un(e,{onFlag(D,o,c){const f=we(s,D);if(!u?.(f?Ms:Gs,D,o)){if(f){const[h,l]=s[D],p=zs(l,o),C=a((g,y)=>{r.push(c),y&&r.push(y),h.push(Ys(l,g||""))},"p");return p===void 0?C:C(p)}we(n,D)||(n[D]=[]),n[D].push(o===void 0?!0:o),r.push(c)}},onArgument(D,o,c){u?.(Ws,e[o[0]])||(i.push(...D),c?(i[Ue]=D,e.splice(o[0])):r.push(o))}}),rn(e,r),{flags:Zs(t,s),unknownFlags:n,_:i}},"U$2");var sn=Object.create,Ke=Object.defineProperty,nn=Object.defineProperties,Dn=Object.getOwnPropertyDescriptor,on=Object.getOwnPropertyDescriptors,an=Object.getOwnPropertyNames,Bu=Object.getOwnPropertySymbols,ln=Object.getPrototypeOf,$u=Object.prototype.hasOwnProperty,cn=Object.prototype.propertyIsEnumerable,Tu=a((t,e,u)=>e in t?Ke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:u}):t[e]=u,"W$1"),Ve=a((t,e)=>{for(var u in e||(e={}))$u.call(e,u)&&Tu(t,u,e[u]);if(Bu)for(var u of Bu(e))cn.call(e,u)&&Tu(t,u,e[u]);return t},"p"),Ct=a((t,e)=>nn(t,on(e)),"c"),fn=a(t=>Ke(t,"__esModule",{value:!0}),"nD"),hn=a((t,e)=>()=>(t&&(e=t(t=0)),e),"rD"),dn=a((t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),"iD"),En=a((t,e,u,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of an(e))!$u.call(t,s)&&s!=="default"&&Ke(t,s,{get:a(()=>e[s],"get"),enumerable:!(r=Dn(e,s))||r.enumerable});return
|
||
|
`).map(oe)),"b$1"),An=a(t=>{let e=[];for(let u of t){let{length:r}=u,s=r-e.length;for(let n=0;n<s;n+=1)e.push(0);for(let n=0;n<r;n+=1){let i=Ou(u[n]);i>e[n]&&(e[n]=i)}}return e},"k$1");K();var Nu=/^\d+%$/,Hu={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},yn=a((t,e)=>{var u;let r=[];for(let s=0;s<t.length;s+=1){let n=(u=e[s])!=null?u:"auto";if(typeof n=="number"||n==="auto"||n==="content-width"||typeof n=="string"&&Nu.test(n)){r.push(Ct(Ve({},Hu),{width:n,contentWidth:t[s]}));continue}if(n&&typeof n=="object"){let i=Ct(Ve(Ve({},Hu),n),{contentWidth:t[s]});i.horizontalPadding=i.paddingLeft+i.paddingRight,r.push(i);continue}throw new Error(`Invalid column width: ${JSON.stringify(n)}`)}return r},"sD");function wn(t,e){for(let u of t){let{width:r}=u;if(r==="content-width"&&(u.width=u.contentWidth),r==="auto"){let o=Math.min(20,u.contentWidth);u.width=o,u.autoOverflow=u.contentWidth-o}if(typeof r=="string"&&Nu.test(r)){let o=Number.parseFloat(r.slice(0,-1))/100;u.width=Math.floor(e*o)-(u.paddingLeft+u.paddingRight)}let{horizontalPadding:s}=u,n=1,i=n+s;if(i>=e){let o=i-e,c=Math.ceil(u.paddingLeft/s*o),f=o-c;u.paddingLeft-=c,u.paddingRight-=f,u.horizontalPadding=u.paddingLeft+u.paddingRight}u.paddingLeftString=u.paddingLeft?" ".repeat(u.paddingLeft):"",u.paddingRightString=u.paddingRight?" ".repeat(u.paddingRight):"";let D=e-u.horizontalPadding;u.width=Math.max(Math.min(u.width,D),n)}}a(wn,"aD");var Lu=a(()=>Object.assign([],{columns:0}),"G$1");function Rn(t,e){let u=[Lu()],[r]=u;for(let s of t){let n=s.width+s.horizontalPadding;r.columns+n>e&&(r=Lu(),u.push(r)),r.push(s),r.columns+=n}for(let s of u){let n=s.reduce((l,p)=>l+p.width+p.horizontalPadding,0),i=e-n;if(i===0)continue;let D=s.filter(l=>"autoOverflow"in l),o=D.filter(l=>l.autoOverflow>0),c=o.reduce((l,p)=>l+p.autoOverflow,0),f=Math.min(c,i);for(let l of o){let p=Math.floor(l.autoOverflow/c*f);l.width+=p,i-=p}let h=Math.floor(i/D.length);for(let l=0;l<D.length;l+=1){let p=D[l];l===D.length-1?p.width+=i:p.width+=h,i-=h}}return u}a(Rn,"lD");function bn(t,e,u){let r=yn(u,e);return wn(r,t),Rn(r,t)}a(bn,"Z$1"),K(),K(),K();var Ft=10,Iu=a((t=0)=>e=>`\x1B[${e+t}m`,"U$1"),Pu=a((t=0)=>e=>`\x1B[${38+t};5;${e}m`,"V$1"),ku=a((t=0)=>(e,u,r)=>`\x1B[${38+t};2;${e};${u};${r}m`,"Y");function vn(){let t=new Map,e={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],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],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[u,r]of Object.entries(e)){for(let[s,n]of Object.entries(r))e[s]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},r[s]=e[s],t.set(n[0],n[1]);Object.defineProperty(e,u,{value:r,enumerable:!1})}return Object.defineProperty(e,"codes",{value:t,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",e.color.ansi=Iu(),e.color.ansi256=Pu(),e.color.ansi16m=ku(),e.bgColor.ansi=Iu(Ft),e.bgColor.ansi256=Pu(Ft),e.bgColor.ansi16m=ku(Ft),Object.defineProperties(e,{rgbToAnsi256:{value:a((u,r,s)=>u===r&&r===s?u<8?16:u>248?231:Math.round((u-8)/247*24)+232:16+36*Math.round(u/255*5)+6*Math.round(r/255*5)+Math.round(s/255*5),"value"),enumerable:!1},hexToRgb:{value:a(u=>{let r=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(u.toString(16));if(!r)return[0,0,0];let{colorString:s}=r.groups;s.length===
|
||
|
`)];for(let[c,f]of o.entries()){if(r+=f,ze.has(f)){let{groups:l}=new RegExp(`(?:\\${Mu}(?<code>\\d+)m|\\${mt}(?<uri>.*)${gt})`).exec(o.slice(c).join(""))||{groups:{}};if(l.code!==void 0){let p=Number.parseFloat(l.code);s=p===$n?void 0:p}else l.uri!==void 0&&(n=l.uri.length===0?void 0:l.uri)}let h=Bn.codes.get(Number(s));o[c+1]===`
|
||
|
`?(n&&(r+=ju("")),s&&h&&(r+=Wu(h))):f===`
|
||
|
`&&(s&&h&&(r+=Wu(s)),n&&(r+=ju(n)))}return r},"dD");function Hn(t,e,u){return String(t).normalize().replace(/\r\n/g,`
|
||
|
`).split(`
|
||
|
`).map(r=>Nn(r,e,u)).join(`
|
||
|
`)}a(Hn,"T$1");var Uu=a(t=>Array.from({length:t}).fill(""),"X");function Ln(t,e){let u=[],r=0;for(let s of t){let n=0,i=s.map(o=>{var c;let f=(c=e[r])!=null?c:"";r+=1,o.preprocess&&(f=o.preprocess(f)),Ou(f)>o.width&&(f=Hn(f,o.width,{hard:!0}));let h=f.split(`
|
||
|
`);if(o.postprocess){let{postprocess:l}=o;h=h.map((p,C)=>l.call(o,p,C))}return o.paddingTop&&h.unshift(...Uu(o.paddingTop)),o.paddingBottom&&h.push(...Uu(o.paddingBottom)),h.length>n&&(n=h.length),Ct(Ve({},o),{lines:h})}),D=[];for(let o=0;o<n;o+=1){let c=i.map(f=>{var h;let l=(h=f.lines[o])!=null?h:"",p=Number.isFinite(f.width)?" ".repeat(f.width-oe(l)):"",C=f.paddingLeftString;return f.align==="right"&&(C+=p),C+=l,f.align==="left"&&(C+=p),C+f.paddingRightString}).join("");D.push(c)}u.push(D.join(`
|
||
|
`))}return u.join(`
|
||
|
`)}a(Ln,"P");function In(t,e){if(!t||t.length===0)return"";let u=An(t),r=u.length;if(r===0)return"";let{stdoutColumns:s,columns:n}=Fn(e);if(n.length>r)throw new Error(`${n.length} columns defined, but only ${r} columns found`);let i=bn(s,n,u);return t.map(D=>Ln(i,D)).join(`
|
||
|
`)}a(In,"mD"),K();var Pn=["<",">","=",">=","<="];function kn(t){if(!Pn.includes(t))throw new TypeError(`Invalid breakpoint operator: ${t}`)}a(kn,"xD");function Mn(t){let e=Object.keys(t).map(u=>{let[r,s]=u.split(" ");kn(r);let n=Number.parseInt(s,10);if(Number.isNaN(n))throw new TypeError(`Invalid breakpoint value: ${s}`);let i=t[u];return{operator:r,breakpoint:n,value:i}}).sort((u,r)=>r.breakpoint-u.breakpoint);return u=>{var r;return(r=e.find(({operator:s,breakpoint:n})=>s==="="&&u===n||s===">"&&u>n||s==="<"&&u<n||s===">="&&u>=n||s==="<="&&u<=n))==null?void 0:r.value}}a(Mn,"wD");const Gn=a(t=>t.replace(/[\W_]([a-z\d])?/gi,(e,u)=>u?u.toUpperCase():""),"S"),Wn=a(t=>t.replace(/\B([A-Z])/g,"-$1").toLowerCase(),"q"),jn={"> 80":[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"auto"}],"> 40":[{width:"auto",paddingLeft:2,paddingRight:8,preprocess:a(t=>t.trim(),"preprocess")},{width:"100%",paddingLeft:2,paddingBottom:1}],"> 0":{stdoutColumns:1e3,columns:[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"content-width"}]}};function Un(t){let e=!1;return{type:"table",data:{tableData:Object.keys(t).sort((u,r)=>u.localeCompare(r)).map(u=>{const r=t[u],s="alias"in r;return s&&(e=!0),{name:u,flag:r,flagFormatted:`--${Wn(u)}`,aliasesEnabled:e,aliasFormatted:s?`-${r.alias}`:void 0}}).map(u=>(u.aliasesEnabled=e,[{type:"flagName",data:u},{type:"flagDescription",data:u}])),tableBreakpoints:jn}}}a(Un,"D");const Ku=a(t=>!t||(t.version??(t.help?t.help.version:void 0)),"A"),Vu=a(t=>{const e="parent"in t&&t.parent?.name;return(e?`${e} `:"")+t.name},"C");function Kn(t){const e=[];t.name&&e.push(Vu(t));const u=Ku(t)??("parent"in t&&Ku(t.parent));if(u&&e.push(`v${u}`),e.length!==0)return{id:"name",type:"text",data:`${e.join(" ")}
|
||
|
`}}a(Kn,"R");function Vn(t){const{help:e}=t;if(!(!e||!e.description))return{id:"description",type:"text",data:`${e.description}
|
||
|
`}}a(Vn,"L");function zn(t){const e=t.help||{};if("usage"in e)return e.usage?{id:"usage",type:"section",data:{title:"Usage:",body:Array.isArray(e.usage)?e.usage.join(`
|
||
|
`):e.usage}}:void 0;if(t.name){const u=[],r=[Vu(t)];if(t.flags&&Object.keys(t.flags).length>0&&r.push("[flags...]"),t.parameters&&t.parameters.length>0){const{parameters:s}=t,n=s.indexOf("--"),i=n>-1&&s.slice(n+1).some(D=>D.startsWith("<"));r.push(s.map(D=>D!=="--"?D:i?"--":"[--]").join(" "))}if(r.length>1&&u.push(r.join(" ")),"commands"in t&&t.commands?.length&&u.push(`${t.name} <command>`),u.length>0)return{id:"usage",type:"section",data:{title:"Usage:",body:u.join(`
|
||
|
`)}}}}a(zn,"T");function Yn(t){return!("commands"in t)||!t.commands?.length?void 0:{id:"commands",type:"section",data:{title:"Commands:",body:{type:"table",data:{tableData:t.commands.map(e=>[e.options.name,e.options.help?e.options.help.description:""]),tableOptions:[{width:"content-width",paddingLeft:2,paddingRight:8}]}},indentBody:0}}}a(Yn,"_");function qn(t){if(!(!t.flags||Object.keys(t.flags).length===0))return{id:"flags",type:"section",data:{title:"Flags:",body:Un(t.flags),indentBody:0}}}a(qn,"k");function Xn(t){const{help:e}=t;if(!e||!e.examples||e.examples.length===0)return;let{examples:u}=e;if(Array.isArray(u)&&(u=u.join(`
|
||
|
`)),u)return{id:"examples",type:"section",data:{title:"Examples:",body:u}}}a(Xn,"F");function Qn(t){if(!("alias"in t)||!t.alias)return;const{alias:e}=t;return{id:"aliases",type:"section",data:{title:"Aliases:",body:Array.isArray(e)?e.join(", "):e}}}a(Qn,"H");const Zn=a(t=>[Kn,Vn,zn,Yn,qn,Xn,Qn].map(e=>e(t)).filter(Boolean),"U"),Jn=Ts.WriteStream.prototype.hasColors();class ei{static{a(this,"M")}text(e){return e}bold(e){return Jn?`\x1B[1m${e}\x1B[22m`:e.toLocaleUpperCase()}indentText({text:e,spaces:u}){return e.replace(/^/gm," ".repeat(u))}heading(e){return this.bold(e)}section({title:e,body:u,indentBody:r=2}){return`${(e?`${this.heading(e)}
|
||
|
`:"")+(u?this.indentText({text:this.render(u),spaces:r}):"")}
|
||
|
`}table({tableData:e,tableOptions:u,tableBreakpoints:r}){return In(e.map(s=>s.map(n=>this.render(n))),r?Mn(r):u)}flagParameter(e){return e===Boolean?"":e===String?"<string>":e===Number?"<number>":Array.isArray(e)?this.flagParameter(e[0]):"<value>"}flagOperator(e){return" "}flagName(e){const{flag:u,flagFormatted:r,aliasesEnabled:s,aliasFormatted:n}=e;let i="";if(n?i+=`${n}, `:s&&(i+=" "),i+=r,"placeholder"in u&&typeof u.placeholder=="string")i+=`${this.flagOperator(e)}${u.placeholder}`;else{const D=this.flagParameter("type"in u?u.type:u);D&&(i+=`${this.flagOperator(e)}${D}`)}return i}flagDefault(e){return JSON.stringify(e)}flagDescription({flag:e}){let u="description"in e?e.description??"":"";if("default"in e){let{default:r}=e;typeof r=="function"&&(r=r()),r&&(u+=` (default: ${this.flagDefault(r)})`)}return u}render(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(u=>this.render(u)).join(`
|
||
|
`);if("type"in e&&this[e.type]){const u=this[e.type];if(typeof u=="function")return u.call(this,e.data)}throw new Error(`Invalid node type: ${JSON.stringify(e)}`)}}const At=/^[\w.-]+$/,{stringify:ee}=JSON,ti=/[|\\{}()[\]^$+*?.]/;function yt(t){const e=[];let u,r;for(const s of t){if(r)throw new Error(`Invalid parameter: Spread parameter ${ee(r)} must be last`);const n=s[0],i=s[s.length-1];let D;if(n==="<"&&i===">"&&(D=!0,u))throw new Error(`Invalid parameter: Required parameter ${ee(s)} cannot come after optional parameter ${ee(u)}`);if(n==="["&&i==="]"&&(D=!1,u=s),D===void 0)throw new Error(`Invalid parameter: ${ee(s)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let o=s.slice(1,-1);const c=o.slice(-3)==="...";c&&(r=s,o=o.slice(0,-3));const f=o.match(ti);if(f)throw new Error(`Invalid parameter: ${ee(s)}. Invalid character found ${ee(f[0])}`);e.push({name:o,required:D,spread:c})}return e}a(yt,"w");function wt(t,e,u,r){for(let s=0;s<e.length;s+=1){const{name:n,required:i,spread:D}=e[s],o=Gn(n);if(o in t)throw new Error(`Invalid parameter: ${ee(n)} is used more than once.`);const c=D?u.slice(s):u[s];if(D&&(s=e.length),i&&(!c||D&&c.length===0))return console.error(`Error: Missing required parameter ${ee(n)}
|
||
|
`),r(),process.exit(1);t[o]=c}}a(wt,"b");function ui(t){return t===void 0||t!==!1}a(ui,"W");function zu(t,e,u,r){const s={...e.flags},n=e.version;n&&(s.version={type:Boolean,description:"Show version"});const{help:i}=e,D=ui(i);D&&!("help"in s)&&(s.help={type:Boolean,alias:"h",description:"Show help"});const o=Su(s,r,{ignore:e.ignoreArgv}),c=a(()=>{console.log(e.version)},"f");if(n&&o.flags.version===!0)return c(),process.exit(0);const f=new ei,h=D&&i?.render?i.render:C=>f.render(C),l=a(C=>{const g=Zn({...e,...C?{help:C}:{},flags:s});console.log(h(g,f))},"u");if(D&&o.flags.help===!0)return l(),process.exit(0);if(e.parameters){let{parameters:C}=e,g=o._;const y=C.indexOf("--"),B=C.slice(y+1),H=Object.create(null);if(y>-1&&B.length>0){C=C.slice(0,y);const $=o._["--"];g=g.slice(0,-$.length||void 0),wt(H,yt(C),g,l),wt(H,yt(B),$,l)}else wt(H,yt(C),g,l);Object.assign(o._,H)}const p={...o,showVersion:c,showHelp:l};return typeof u=="function"&&u(p),{command:t,...p}}a(zu,"x");function ri(t,e){const u=new Map;for(const r of e){const s=[r.options.name],{alias:n}=r.options;n&&(Array.isArray(n)?s.push(...n):s.push(n));for(const i of s){if(u.has(i))throw new Error(`Duplicate command name found: ${ee(i)}`);u.set(i,r)}}return u.get(t)}a(ri,"z");function Yu(t,e,u=process.argv.slice(2)){if(!t)throw new Error("Options is required");if("name"in t&&(!t.name||!At.test(t.name)))throw new Error(`Invalid script name: ${ee(t.name)}`);const r=u[0];if(t.commands&&At.test(r)){const s=ri(r,t.commands);if(s)return zu(s.options.name,{...s.options,parent:t},s.callback,u.slice(1))}return zu(void 0,t,e,u)}a(Yu,"Z");function si(t,e){if(!t)throw new Error("Command options are required");const{name:u}=t;if(t.name===void 0)throw new Error("Command name is required");if(!At.test(u))throw new Error(`Invalid command name ${JSON.stringify(u)}. Command names must be one word.`);return{options:t,callback:e}}a(si,"G");var ni=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ii(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}a(ii,"getDefaultExportFromCjs");var de={exports:{}},Rt,qu;function Di(){if(qu)return Rt;qu=1,Rt=r,r.sync=s;var t=De;function e(n,i){var D=i.pathExt!==void 0?i.pathExt:process.env.PATHEXT;if(!D||(D=D.split(";"),D.indexOf("")!==-1))return!0;for(var o=0;o<D.length;o++){var c=D[o].toLowerCase();if(c&&n.substr(-c.length).toLowerCase()===c)return!0}return!1}a(e,"checkPathExt");function u(n,i,D){return!n.isSymbolicLink()&&!n.isFile()?!1:e(i,D)}a(u,"checkStat");function r(n,i,D){t.stat(n,function(o,c){D(o,o?!1:u(c,n,i))})}a(r,"isexe");function s(n,i){return u(t.statSync(n),n,i)}return a(s,"sync"),Rt}a(Di,"requireWindows");var bt,Xu;function oi(){if(Xu)return bt;Xu=1,bt=e,e.sync=u;var t=De;function e(n,i,D){t.stat(n,function(o,c){D(o,o?!1:r(c,i))})}a(e,"isexe");function u(n,i){return r(t.statSync(n),i)}a(u,"sync");function r(n,i){return n.isFile()&&s(n,i)}a(r,"checkStat");function s(n,i){var D=n.mode,o=n.uid,c=n.gid,f=i.uid!==void 0?i.uid:process.getuid&&process.getuid(),h=i.gid!==void 0?i.gid:process.getgid&&process.getgid(),l=parseInt("100",8),p=parseInt("010",8),C=parseInt("001",8),g=l|p,y=D&C||D&p&&c===h||D&l&&o===f||D&g&&f===0;return y}return a(s,"checkMode"),bt}a(oi,"requireMode");var Ye;process.platform==="win32"||ni.TESTING_WINDOWS?Ye=Di():Ye=oi();var ai=vt;vt.sync=li;function vt(t,e,u){if(typeof e=="function"&&(u=e,e={}),!u){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,s){vt(t,e||{},function(n,i){n?s(n):r(i)})})}Ye(t,e||{},function(r,s){r&&(r.code==="EACCES"||e&&e.ignoreErrors)&&(r=null,s=!1),u(r,s)})}a(vt,"isexe$1");function li(t,e){try{return Ye.sync(t,e||{})}catch(u){if(e&&e.ignoreErrors||u.code==="EACCES")return!1;throw u}}a(li,"sync");const Ee=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Qu=z,ci=Ee?";":":",Zu=ai,Ju=a(t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),"getNotFoundError"),er=a((t,e)=>{const u=e.colon||ci,r=t.ma
|
||
|
* normalize-path <https://github.com/jonschlinkert/normalize-path>
|
||
|
*
|
||
|
* Copyright (c) 2014-2018, Jon Schlinkert.
|
||
|
* Released under the MIT License.
|
||
|
*/var Br=a(function(t,e){if(typeof t!="string")throw new TypeError("expected path to be a string");if(t==="\\"||t==="/")return"/";var u=t.length;if(u<=1)return t;var r="";if(u>4&&t[3]==="\\"){var s=t[2];(s==="?"||s===".")&&t.slice(0,2)==="\\\\"&&(t=t.slice(2),r="//")}var n=t.split(/[/\\]+/);return e!==!1&&n[n.length-1]===""&&n.pop(),r+n.join("/")},"normalizePath$2"),BD=Yt.exports;Object.defineProperty(BD,"__esModule",{value:!0});const $r=Ar,$D=Br,Tr="!",TD={returnIndex:!1},xD=a(t=>Array.isArray(t)?t:[t],"arrify$1"),OD=a((t,e)=>{if(typeof t=="function")return t;if(typeof t=="string"){const u=$r(t,e);return r=>t===r||u(r)}return t instanceof RegExp?u=>t.test(u):u=>!1},"createPattern"),xr=a((t,e,u,r)=>{const s=Array.isArray(u),n=s?u[0]:u;if(!s&&typeof n!="string")throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(n));const i=$D(n,!1);for(let o=0;o<e.length;o++){const c=e[o];if(c(i))return r?-1:!1}const D=s&&[i].concat(u.slice(1));for(let o=0;o<t.length;o++){const c=t[o];if(s?c(...D):c(i))return r?o:!0}return r?-1:!1},"matchPatterns"),qt=a((t,e,u=TD)=>{if(t==null)throw new TypeError("anymatch: specify first argument");const r=typeof u=="boolean"?{returnIndex:u}:u,s=r.returnIndex||!1,n=xD(t),i=n.filter(o=>typeof o=="string"&&o.charAt(0)===Tr).map(o=>o.slice(1)).map(o=>$r(o,r)),D=n.filter(o=>typeof o!="string"||typeof o=="string"&&o.charAt(0)!==Tr).map(o=>OD(o,r));return e==null?(o,c=!1)=>xr(D,i,o,typeof c=="boolean"?c:!1):xr(D,i,e,s)},"anymatch$1");qt.default=qt,Yt.exports=qt;var ND=Yt.exports;/*!
|
||
|
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
||
|
*
|
||
|
* Copyright (c) 2014-2016, Jon Schlinkert.
|
||
|
* Licensed under the MIT License.
|
||
|
*/var HD=a(function(e){if(typeof e!="string"||e==="")return!1;for(var u;u=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(u[2])return!0;e=e.slice(u.index+u[0].length)}return!1},"isExtglob");/*!
|
||
|
* is-glob <https://github.com/jonschlinkert/is-glob>
|
||
|
*
|
||
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
||
|
* Released under the MIT License.
|
||
|
*/var LD=HD,Or={"{":"}","(":")","[":"]"},ID=a(function(t){if(t[0]==="!")return!0;for(var e=0,u=-2,r=-2,s=-2,n=-2,i=-2;e<t.length;){if(t[e]==="*"||t[e+1]==="?"&&/[\].+)]/.test(t[e])||r!==-1&&t[e]==="["&&t[e+1]!=="]"&&(r<e&&(r=t.indexOf("]",e)),r>e&&(i===-1||i>r||(i=t.indexOf("\\",e),i===-1||i>r)))||s!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(s=t.indexOf("}",e),s>e&&(i=t.indexOf("\\",e),i===-1||i>s))||n!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(n=t.indexOf(")",e),n>e&&(i=t.indexOf("\\",e),i===-1||i>n))||u!==-1&&t[e]==="("&&t[e+1]!=="|"&&(u<e&&(u=t.indexOf("|",e)),u!==-1&&t[u+1]!==")"&&(n=t.indexOf(")",u),n>u&&(i=t.indexOf("\\",u),i===-1||i>n))))return!0;if(t[e]==="\\"){var D=t[e+1];e+=2;var o=Or[D];if(o){var c=t.indexOf(o,e);c!==-1&&(e=c+1)}if(t[e]==="!")return!0}else e++}return!1},"strictCheck"),PD=a(function(t){if(t[0]==="!")return!0;for(var e=0;e<t.length;){if(/[*?{}()[\]]/.test(t[e]))return!0;if(t[e]==="\\"){var u=t[e+1];e+=2;var r=Or[u];if(r){var s=t.indexOf(r,e);s!==-1&&(e=s+1)}if(t[e]==="!")return!0}else e++}return!1},"relaxedCheck"),Nr=a(function(e,u){if(typeof e!="string"||e==="")return!1;if(LD(e))return!0;var r=ID;return u&&u.strict===!1&&(r=PD),r(e)},"isGlob"),kD=Nr,MD=z.posix.dirname,GD=bu.platform()==="win32",Xt="/",WD=/\\/g,jD=/[\{\[].*[\}\]]$/,UD=/(^|[^\\])([\{\[]|\([^\)]+$)/,KD=/\\([\!\*\?\|\[\]\(\)\{\}])/g,VD=a(function(e,u){var r=Object.assign({flipBackslashes:!0},u);r.flipBackslashes&&GD&&e.indexOf(Xt)<0&&(e=e.replace(WD,Xt)),jD.test(e)&&(e+=Xt),e+="a";do e=MD(e);while(kD(e)||UD.test(e));return e.replace(KD,"$1")},"globParent"),rt={};(function(t){t.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1,t.find=(e,u)=>e.nodes.find(r=>r.type===u),t.exceedsLimit=(e,u,r=1,s)=>s===!1||!t.isInteger(e)||!t.isInteger(u)?!1:(Number(u)-Number(e))/Number(r)>=s,t.escapeNode=(e,u=0,r)=>{let s=e.nodes[u];s&&(r&&s.type===r||s.type==="open"||s.type==="close")&&s.escaped!==!0&&(s.value="\\"+s.value,s.escaped=!0)},t.encloseBrace=e=>e.type!=="brace"||e.commas>>0+e.ranges>>0?!1:(e.invalid=!0,!0),t.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:!(e.commas>>0+e.ranges>>0)||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1,t.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0,t.reduce=e=>e.reduce((u,r)=>(r.type==="text"&&u.push(r.value),r.type==="range"&&(r.type="text"),u),[]),t.flatten=(...e)=>{const u=[],r=a(s=>{for(let n=0;n<s.length;n++){let i=s[n];Array.isArray(i)?r(i):i!==void 0&&u.push(i)}return u},"flat");return r(e),u}})(rt);const Hr=rt;var Qt=a((t,e={})=>{let u=a((r,s={})=>{let n=e.escapeInvalid&&Hr.isInvalidBrace(s),i=r.invalid===!0&&e.escapeInvalid===!0,D="";if(r.value)return(n||i)&&Hr.isOpenOrClose(r)?"\\"+r.value:r.value;if(r.value)return r.value;if(r.nodes)for(let o of r.nodes)D+=u(o);return D},"stringify");return u(t)},"stringify$4");/*!
|
||
|
* is-number <https://github.com/jonschlinkert/is-number>
|
||
|
*
|
||
|
* Copyright (c) 2014-present, Jon Schlinkert.
|
||
|
* Released under the MIT License.
|
||
|
*/var zD=a(function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1},"isNumber$2");/*!
|
||
|
* to-regex-range <https://github.com/micromatch/to-regex-range>
|
||
|
*
|
||
|
* Copyright (c) 2015-present, Jon Schlinkert.
|
||
|
* Released under the MIT License.
|
||
|
*/const Lr=zD,ae=a((t,e,u)=>{if(Lr(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(Lr(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let r={relaxZeros:!0,...u};typeof r.strictZeros=="boolean"&&(r.relaxZeros=r.strictZeros===!1);let s=String(r.relaxZeros),n=String(r.shorthand),i=String(r.capture),D=String(r.wrap),o=t+":"+e+"="+s+n+i+D;if(ae.cache.hasOwnProperty(o))return ae.cache[o].result;let c=Math.min(t,e),f=Math.max(t,e);if(Math.abs(c-f)===1){let g=t+"|"+e;return r.capture?`(${g})`:r.wrap===!1?g:`(?:${g})`}let h=Wr(t)||Wr(e),l={min:t,max:e,a:c,b:f},p=[],C=[];if(h&&(l.isPadded=h,l.maxLen=String(l.max).length),c<0){let g=f<0?Math.abs(f):1;C=Ir(g,Math.abs(c),l,r),c=l.a=0}return f>=0&&(p=Ir(c,f,l,r)),l.negatives=C,l.positives=p,l.result=YD(C,p),r.capture===!0?l.result=`(${l.result})`:r.wrap!==!1&&p.length+C.length>1&&(l.result=`(?:${l.result})`),ae.cache[o]=l,l.result},"toRegexRange$1");function YD(t,e,u){let r=Zt(t,e,"-",!1)||[],s=Zt(e,t,"",!1)||[],n=Zt(t,e,"-?",!0)||[];return r.concat(n).concat(s).join("|")}a(YD,"collatePatterns");function qD(t,e){let u=1,r=1,s=kr(t,u),n=new Set([e]);for(;t<=s&&s<=e;)n.add(s),u+=1,s=kr(t,u);for(s=Mr(e+1,r)-1;t<s&&s<=e;)n.add(s),r+=1,s=Mr(e+1,r)-1;return n=[...n],n.sort(ZD),n}a(qD,"splitToRanges");function XD(t,e,u){if(t===e)return{pattern:t,count:[],digits:0};let r=QD(t,e),s=r.length,n="",i=0;for(let D=0;D<s;D++){let[o,c]=r[D];o===c?n+=o:o!=="0"||c!=="9"?n+=JD(o,c):i++}return i&&(n+=u.shorthand===!0?"\\d":"[0-9]"),{pattern:n,count:[i],digits:s}}a(XD,"rangeToPattern");function Ir(t,e,u,r){let s=qD(t,e),n=[],i=t,D;for(let o=0;o<s.length;o++){let c=s[o],f=XD(String(i),String(c),r),h="";if(!u.isPadded&&D&&D.pattern===f.pattern){D.count.length>1&&D.count.pop(),D.count.push(f.count[0]),D.string=D.pattern+Gr(D.count),i=c+1;continue}u.isPadded&&(h=eo(c,u,r)),f.string=h+f.pattern+Gr(f.count),n.push(f),i=c+1,D=f}return n}a(Ir,"splitToPatterns");function Zt(t,e,u,r,s){let n=[];for(let i of t){let{string:D}=i;!r&&!Pr(e,"string",D)&&n.push(u+D),r&&Pr(e,"string",D)&&n.push(u+D)}return n}a(Zt,"filterPatterns");function QD(t,e){let u=[];for(let r=0;r<t.length;r++)u.push([t[r],e[r]]);return u}a(QD,"zip");function ZD(t,e){return t>e?1:e>t?-1:0}a(ZD,"compare");function Pr(t,e,u){return t.some(r=>r[e]===u)}a(Pr,"contains");function kr(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}a(kr,"countNines");function Mr(t,e){return t-t%Math.pow(10,e)}a(Mr,"countZeros");function Gr(t){let[e=0,u=""]=t;return u||e>1?`{${e+(u?","+u:"")}}`:""}a(Gr,"toQuantifier");function JD(t,e,u){return`[${t}${e-t===1?"":"-"}${e}]`}a(JD,"toCharacterClass");function Wr(t){return/^-?(0+)\d/.test(t)}a(Wr,"hasPadding");function eo(t,e,u){if(!e.isPadded)return t;let r=Math.abs(e.maxLen-String(t).length),s=u.relaxZeros!==!1;switch(r){case 0:return"";case 1:return s?"0?":"0";case 2:return s?"0{0,2}":"00";default:return s?`0{0,${r}}`:`0{${r}}`}}a(eo,"padZeros"),ae.cache={},ae.clearCache=()=>ae.cache={};var to=ae;/*!
|
||
|
* fill-range <https://github.com/jonschlinkert/fill-range>
|
||
|
*
|
||
|
* Copyright (c) 2014-present, Jon Schlinkert.
|
||
|
* Licensed under the MIT License.
|
||
|
*/const uo=Ae,jr=to,Ur=a(t=>t!==null&&typeof t=="object"&&!Array.isArray(t),"isObject"),ro=a(t=>e=>t===!0?Number(e):String(e),"transform"),Jt=a(t=>typeof t=="number"||typeof t=="string"&&t!=="","isValidValue"),Se=a(t=>Number.isInteger(+t),"isNumber"),eu=a(t=>{let e=`${t}`,u=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++u]==="0";);return u>0},"zeros"),so=a((t,e,u)=>typeof t=="string"||typeof e=="string"?!0:u.stringify===!0,"stringify$3"),no=a((t,e,u)=>{if(e>0){let r=t[0]==="-"?"-":"";r&&(t=t.slice(1)),t=r+t.padStart(r?e-1:e,"0")}return u===!1?String(t):t},"pad"),Kr=a((t,e)=>{let u=t[0]==="-"?"-":"";for(u&&(t=t.slice(1),e--);t.length<e;)t="0"+t;return u?"-"+t:t},"toMaxLen"),io=a((t,e)=>{t.negatives.sort((i,D)=>i<D?-1:i>D?1:0),t.positives.sort((i,D)=>i<D?-1:i>D?1:0);let u=e.capture?"":"?:",r="",s="",n;return t.positives.length&&(r=t.positives.join("|")),t.negatives.length&&(s=`-(${u}${t.negatives.join("|")})`),r&&s?n=`${r}|${s}`:n=r||s,e.wrap?`(${u}${n})`:n},"toSequence"),Vr=a((t,e,u,r)=>{if(u)return jr(t,e,{wrap:!1,...r});let s=String.fromCharCode(t);if(t===e)return s;let n=String.fromCharCode(e);return`[${s}-${n}]`},"toRange"),zr=a((t,e,u)=>{if(Array.isArray(t)){let r=u.wrap===!0,s=u.capture?"":"?:";return r?`(${s}${t.join("|")})`:t.join("|")}return jr(t,e,u)},"toRegex"),Yr=a((...t)=>new RangeError("Invalid range arguments: "+uo.inspect(...t)),"rangeError"),qr=a((t,e,u)=>{if(u.strictRanges===!0)throw Yr([t,e]);return[]},"invalidRange"),Do=a((t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return[]},"invalidStep"),oo=a((t,e,u=1,r={})=>{let s=Number(t),n=Number(e);if(!Number.isInteger(s)||!Number.isInteger(n)){if(r.strictRanges===!0)throw Yr([t,e]);return[]}s===0&&(s=0),n===0&&(n=0);let i=s>n,D=String(t),o=String(e),c=String(u);u=Math.max(Math.abs(u),1);let f=eu(D)||eu(o)||eu(c),h=f?Math.max(D.length,o.length,c.length):0,l=f===!1&&so(t,e,r)===!1,p=r.transform||ro(l);if(r.toRegex&&u===1)return Vr(Kr(t,h),Kr(e,h),!0,r);let C={negatives:[],positives:[]},g=a(H=>C[H<0?"negatives":"positives"].push(Math.abs(H)),"push"),y=[],B=0;for(;i?s>=n:s<=n;)r.toRegex===!0&&u>1?g(s):y.push(no(p(s,B),h,l)),s=i?s-u:s+u,B++;return r.toRegex===!0?u>1?io(C,r):zr(y,null,{wrap:!1,...r}):y},"fillNumbers"),ao=a((t,e,u=1,r={})=>{if(!Se(t)&&t.length>1||!Se(e)&&e.length>1)return qr(t,e,r);let s=r.transform||(l=>String.fromCharCode(l)),n=`${t}`.charCodeAt(0),i=`${e}`.charCodeAt(0),D=n>i,o=Math.min(n,i),c=Math.max(n,i);if(r.toRegex&&u===1)return Vr(o,c,!1,r);let f=[],h=0;for(;D?n>=i:n<=i;)f.push(s(n,h)),n=D?n-u:n+u,h++;return r.toRegex===!0?zr(f,null,{wrap:!1,options:r}):f},"fillLetters"),st=a((t,e,u,r={})=>{if(e==null&&Jt(t))return[t];if(!Jt(t)||!Jt(e))return qr(t,e,r);if(typeof u=="function")return st(t,e,1,{transform:u});if(Ur(u))return st(t,e,0,u);let s={...r};return s.capture===!0&&(s.wrap=!0),u=u||s.step||1,Se(u)?Se(t)&&Se(e)?oo(t,e,u,s):ao(t,e,Math.max(Math.abs(u),1),s):u!=null&&!Ur(u)?Do(u,s):st(t,e,1,u)},"fill$2");var Xr=st;const lo=Xr,Qr=rt,co=a((t,e={})=>{let u=a((r,s={})=>{let n=Qr.isInvalidBrace(s),i=r.invalid===!0&&e.escapeInvalid===!0,D=n===!0||i===!0,o=e.escapeInvalid===!0?"\\":"",c="";if(r.isOpen===!0||r.isClose===!0)return o+r.value;if(r.type==="open")return D?o+r.value:"(";if(r.type==="close")return D?o+r.value:")";if(r.type==="comma")return r.prev.type==="comma"?"":D?r.value:"|";if(r.value)return r.value;if(r.nodes&&r.ranges>0){let f=Qr.reduce(r.nodes),h=lo(...f,{...e,wrap:!1,toRegex:!0});if(h.length!==0)return f.length>1&&h.length>1?`(${h})`:h}if(r.nodes)for(let f of r.nodes)c+=u(f,r);return c},"walk");return u(t)},"compile$1");var fo=co;const ho=Xr,Zr=Qt,Fe=rt,le=a((t="",e="",u=!1)=>{let r=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return u?Fe.flatten(e).map(s=>`{${s}}`):e;for(let s of t)if(Array.isArray(s))for(let n of s)r.push(le(n,e,u));else for(let n of e)u===!0&&typeof n=="string"&&(n=`{${n}}`),r.push(Array.isArray(n)?le(s,n,u):s+n);return Fe.flatten(r)},"append"),Eo=a((t,e={})=>{let u=e.rangeLimit===void 0?1e3:e.rangeLimit,r=a((s,n={})=>{s.queue=[];
|
||
|
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"};const Fo=Qt,{MAX_LENGTH:Jr,CHAR_BACKSLASH:tu,CHAR_BACKTICK:go,CHAR_COMMA:mo,CHAR_DOT:_o,CHAR_LEFT_PARENTHESES:Ao,CHAR_RIGHT_PARENTHESES:yo,CHAR_LEFT_CURLY_BRACE:wo,CHAR_RIGHT_CURLY_BRACE:Ro,CHAR_LEFT_SQUARE_BRACKET:es,CHAR_RIGHT_SQUARE_BRACKET:ts,CHAR_DOUBLE_QUOTE:bo,CHAR_SINGLE_QUOTE:vo,CHAR_NO_BREAK_SPACE:So,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Bo}=Co,$o=a((t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let u=e||{},r=typeof u.maxLength=="number"?Math.min(Jr,u.maxLength):Jr;if(t.length>r)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${r})`);let s={type:"root",input:t,nodes:[]},n=[s],i=s,D=s,o=0,c=t.length,f=0,h=0,l;const p=a(()=>t[f++],"advance"),C=a(g=>{if(g.type==="text"&&D.type==="dot"&&(D.type="text"),D&&D.type==="text"&&g.type==="text"){D.value+=g.value;return}return i.nodes.push(g),g.parent=i,g.prev=D,D=g,g},"push");for(C({type:"bos"});f<c;)if(i=n[n.length-1],l=p(),!(l===Bo||l===So)){if(l===tu){C({type:"text",value:(e.keepEscaping?l:"")+p()});continue}if(l===ts){C({type:"text",value:"\\"+l});continue}if(l===es){o++;let g;for(;f<c&&(g=p());){if(l+=g,g===es){o++;continue}if(g===tu){l+=p();continue}if(g===ts&&(o--,o===0))break}C({type:"text",value:l});continue}if(l===Ao){i=C({type:"paren",nodes:[]}),n.push(i),C({type:"text",value:l});continue}if(l===yo){if(i.type!=="paren"){C({type:"text",value:l});continue}i=n.pop(),C({type:"text",value:l}),i=n[n.length-1];continue}if(l===bo||l===vo||l===go){let g=l,y;for(e.keepQuotes!==!0&&(l="");f<c&&(y=p());){if(y===tu){l+=y+p();continue}if(y===g){e.keepQuotes===!0&&(l+=y);break}l+=y}C({type:"text",value:l});continue}if(l===wo){h++;let y={type:"brace",open:!0,close:!1,dollar:D.value&&D.value.slice(-1)==="$"||i.dollar===!0,depth:h,commas:0,ranges:0,nodes:[]};i=C(y),n.push(i),C({type:"open",value:l});continue}if(l===Ro){if(i.type!=="brace"){C({type:"text",value:l});continue}let g="close";i=n.pop(),i.close=!0,C({type:g,value:l}),h--,i=n[n.length-1];continue}if(l===mo&&h>0){if(i.ranges>0){i.ranges=0;let g=i.nodes.shift();i.nodes=[g,{type:"text",value:Fo(i)}]}C({type:"comma",value:l}),i.commas++;continue}if(l===_o&&h>0&&i.commas===0){let g=i.nodes;if(h===0||g.length===0){C({type:"text",value:l});continue}if(D.type==="dot"){if(i.range=[],D.value+=l,D.type="range",i.nodes.length!==3&&i.nodes.length!==5){i.invalid=!0,i.ranges=0,D.type="text";continue}i.ranges++,i.args=[];continue}if(D.type==="range"){g.pop();let y=g[g.length-1];y.value+=D.value+l,D=y,i.ranges--;continue}C({type:"dot",value:l});continue}C({type:"text",value:l})}do if(i=n.pop(),i.type!=="root"){i.nodes.forEach(B=>{B.nodes||(B.type==="open"&&(B.isOpen=!0),B.type==="close"&&(B.isClose=!0),B.nodes||(B.type="text"),B.invalid=!0)});let g=n[n.length-1],y=g.nodes.indexOf(i);g.nodes.splice(y,1,...i.nodes)}while(n.length>0);return C({type:"eos"}),s},"parse$1");var To=$o;const us=Qt,xo=fo,Oo=po,No=To,q=a((t,e={})=>{let u=[];if(Array.isArray(t))for(let r of t){let s=q.create(r,e);Array.isArray(s)?u.push(...s):u.push(s)}else u=[].concat(q.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(u=[...new Set(u)]),u},"braces$1");q.parse=(t,e={})=>No(t,e),q.stringify=(t,e={})=>us(typeof t=="string"?q.parse(t,e):t,e),q.compile=(t,e={})=>(typeof t=="string"&&(t=q.parse(t,e)),xo(t,e)),q.expand=(t,e={})=>{typeof t=="string"&&(t=q.parse(t,e));let u=Oo(t,e);return e.noempty===!0&&(u=u.filter(Boolean)),e.nodupes===!0&&(u=[...new Set(u)]),u},q.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?q.compile(t,e):q.expand(t,e);var Ho=q,Lo=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2",
|
||
|
node `):t.flags.help&&(t.showHelp({description:"Node.js runtime enhanced with esbuild for loading TypeScript & ESM"}),console.log(`${"-".repeat(45)}
|
||
|
`));const e={eval:{type:String,alias:"e"},print:{type:String,alias:"p"}},{_:u,flags:r}=Yu({flags:{...e,inputType:String,test:Boolean},help:!1,ignoreArgv:ft(!1)}),s=ws({...vs,...e}),i=["print","eval"].find(c=>!!r[c]);if(i){const{inputType:c}=r,f=r[i],h=xs.transformSync(f,{loader:"default",sourcefile:"/eval.ts",format:c==="module"?"esm":"cjs"});s.unshift(`--${i}`,h.code)}je.isFeatureSupported(je.testRunnerGlob)&&r.test&&u.length===0&&s.push("**/{test,test/**/*,test-*,*[.-_]test}.?(c|m)@(t|j)s");const D=await Rs(),o=lr(s,{noCache:!!t.flags.noCache,tsconfigPath:t.flags.tsconfig});wl(o,D),process.send&&o.on("message",c=>{process.send(c)}),o.send&&process.on("message",c=>{o.send(c)}),o.on("close",c=>{c===null&&(c=Et.constants.signals[o.signalCode]+128),process.exit(c)})});
|