@visulima/vis 1.0.0-alpha.27 → 1.0.0-alpha.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.
Files changed (110) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE.md +3228 -110
  3. package/dist/bin.js +1 -1
  4. package/dist/binx.js +1 -1
  5. package/dist/packem_chunks/bin.js +468 -364
  6. package/dist/packem_chunks/bloom-status.js +1 -1
  7. package/dist/packem_chunks/bloom-sync.js +1 -1
  8. package/dist/packem_chunks/config.js +15 -15
  9. package/dist/packem_chunks/devtools.js +82 -0
  10. package/dist/packem_chunks/doctor-probe.js +1 -1
  11. package/dist/packem_chunks/fix.js +1 -1
  12. package/dist/packem_chunks/handler10.js +1 -1
  13. package/dist/packem_chunks/handler11.js +1 -1
  14. package/dist/packem_chunks/handler12.js +1 -1
  15. package/dist/packem_chunks/handler13.js +1 -1
  16. package/dist/packem_chunks/handler14.js +1 -1
  17. package/dist/packem_chunks/handler15.js +1 -1
  18. package/dist/packem_chunks/handler16.js +1 -1
  19. package/dist/packem_chunks/handler17.js +1 -1
  20. package/dist/packem_chunks/handler18.js +1 -1
  21. package/dist/packem_chunks/handler19.js +1 -1
  22. package/dist/packem_chunks/handler20.js +1 -1
  23. package/dist/packem_chunks/handler21.js +3 -3
  24. package/dist/packem_chunks/handler22.js +1 -1
  25. package/dist/packem_chunks/handler23.js +2 -2
  26. package/dist/packem_chunks/handler24.js +1 -1
  27. package/dist/packem_chunks/handler26.js +1 -1
  28. package/dist/packem_chunks/handler27.js +1 -1
  29. package/dist/packem_chunks/handler28.js +1 -1
  30. package/dist/packem_chunks/handler29.js +1 -1
  31. package/dist/packem_chunks/handler3.js +1 -1
  32. package/dist/packem_chunks/handler30.js +6 -6
  33. package/dist/packem_chunks/handler31.js +2 -2
  34. package/dist/packem_chunks/handler33.js +1 -1
  35. package/dist/packem_chunks/handler34.js +4 -4
  36. package/dist/packem_chunks/handler35.js +2 -2
  37. package/dist/packem_chunks/handler36.js +1 -1
  38. package/dist/packem_chunks/handler37.js +4 -4
  39. package/dist/packem_chunks/handler38.js +2 -2
  40. package/dist/packem_chunks/handler39.js +5 -5
  41. package/dist/packem_chunks/handler4.js +5 -5
  42. package/dist/packem_chunks/handler40.js +18 -18
  43. package/dist/packem_chunks/handler41.js +1 -1
  44. package/dist/packem_chunks/handler42.js +25 -10
  45. package/dist/packem_chunks/handler43.js +10 -25
  46. package/dist/packem_chunks/handler44.js +11 -11
  47. package/dist/packem_chunks/handler45.js +15 -15
  48. package/dist/packem_chunks/handler46.js +19 -19
  49. package/dist/packem_chunks/handler47.js +16 -16
  50. package/dist/packem_chunks/handler48.js +3 -3
  51. package/dist/packem_chunks/handler49.js +12 -12
  52. package/dist/packem_chunks/handler5.js +7 -7
  53. package/dist/packem_chunks/handler50.js +70 -71
  54. package/dist/packem_chunks/handler51.js +23 -23
  55. package/dist/packem_chunks/handler8.js +1 -1
  56. package/dist/packem_chunks/handler9.js +1 -1
  57. package/dist/packem_chunks/heal-accept.js +1 -1
  58. package/dist/packem_chunks/heal.js +1 -1
  59. package/dist/packem_chunks/help-command.js +7 -17
  60. package/dist/packem_chunks/index.js +3 -3
  61. package/dist/packem_chunks/keys-refresh.js +1 -1
  62. package/dist/packem_chunks/list.js +2 -2
  63. package/dist/packem_chunks/loader.js +1 -1
  64. package/dist/packem_chunks/prune.js +1 -1
  65. package/dist/packem_chunks/run.js +1 -1
  66. package/dist/packem_chunks/status.js +1 -1
  67. package/dist/packem_chunks/sync.js +1 -1
  68. package/dist/packem_chunks/sync2.js +1 -1
  69. package/dist/packem_chunks/tripwire.js +1 -1
  70. package/dist/packem_chunks/verify-lockfile.js +1 -1
  71. package/dist/packem_shared/Table-CwC2kW07-EjFLNV0q.js +12 -0
  72. package/dist/packem_shared/_commonjsHelpers-CLblCigl.js +1 -0
  73. package/dist/packem_shared/{advisories-xIOdLbAI.js → advisories-BxXiKFbL.js} +1 -1
  74. package/dist/packem_shared/{ai-analysis-Csn82p17.js → ai-analysis-BnmDFqc8.js} +5 -5
  75. package/dist/packem_shared/{ai-fix-BlYyz5bI.js → ai-fix-BGbnrWCz.js} +7 -7
  76. package/dist/packem_shared/{cyclonedx-B3ILsY74.js → cyclonedx-C2k2HmvI.js} +1 -1
  77. package/dist/packem_shared/{dependency-scan-s2MD0vi-.js → dependency-scan-Bki15Yi-.js} +1 -1
  78. package/dist/packem_shared/{docker-BynKrOLe.js → docker-k-Sl8b-w.js} +1 -1
  79. package/dist/packem_shared/{failure-log-B0Uh-65U.js → failure-log-C3bG1bCA.js} +1 -1
  80. package/dist/packem_shared/index-2r730kXY.js +29 -0
  81. package/dist/packem_shared/{index-B_KtN1MB.js → index-DBq4TVu5.js} +1 -1
  82. package/dist/packem_shared/{lifecycle-CJRNbN3x.js → lifecycle-B91p_ra8.js} +2 -2
  83. package/dist/packem_shared/{lockfile-BG1HvBzH.js → lockfile-DmDfgKaT.js} +1 -1
  84. package/dist/packem_shared/{min-release-age-aEn0x8Vy.js → min-release-age-B1Jm1_JY.js} +1 -1
  85. package/dist/packem_shared/{native-config-sync-DdhTLlKL.js → native-config-sync-Cnpj2xcn.js} +6 -6
  86. package/dist/packem_shared/{osv-bloom-BJhlc_I2.js → osv-bloom-ep8GlDGT.js} +2 -2
  87. package/dist/packem_shared/pm-runner-COoPLGKi.js +1 -0
  88. package/dist/packem_shared/{provenance-BuiEsWbI.js → provenance-DbkJRDqt.js} +1 -1
  89. package/dist/packem_shared/{registry-keys-pemEkRM9.js → registry-keys-SylX07bs.js} +1 -1
  90. package/dist/packem_shared/{resolve-explicit-RgRrUDZv.js → resolve-explicit-CJ_5wYSu.js} +1 -1
  91. package/dist/packem_shared/s1ngularity-DlS-4a6K.js +1 -0
  92. package/dist/packem_shared/scan-progress-CU4ttEHQ.js +2 -0
  93. package/dist/packem_shared/{signatures-LYMy8OR5.js → signatures-B-1u4t-c.js} +1 -1
  94. package/dist/packem_shared/spinner-B9ZPv1iT.js +1 -0
  95. package/dist/packem_shared/spinners-f91Rbo99-Bjf3NcO0.js +1 -0
  96. package/dist/packem_shared/tabs-C-qFIoUv.js +1 -0
  97. package/dist/packem_shared/typosquats-BxCOUvTJ.js +1 -0
  98. package/dist/packem_shared/use-measured-height-kIDCuc76.js +1 -0
  99. package/dist/packem_shared/vis-update-app-COYmjGKv.js +1 -0
  100. package/dist/packem_shared/{watch-loop-DLlMLg_J.js → watch-loop-CP318TfG.js} +2 -2
  101. package/index.js +26 -26
  102. package/package.json +9 -9
  103. package/dist/packem_shared/index-efSniSRN.js +0 -29
  104. package/dist/packem_shared/index.server-B7ETiT4C.js +0 -2
  105. package/dist/packem_shared/pm-runner-BwX5AL3W.js +0 -1
  106. package/dist/packem_shared/s1ngularity-Bs9fUf3q.js +0 -1
  107. package/dist/packem_shared/scan-progress-DjPT66jy.js +0 -2
  108. package/dist/packem_shared/typosquats-znskIR5j.js +0 -1
  109. package/dist/packem_shared/use-measured-height-DjYgUOKk.js +0 -1
  110. package/dist/packem_shared/vis-update-app-qhQPV97i.js +0 -1
@@ -1,29 +0,0 @@
1
- var Fn=Object.defineProperty;var N=(t,e)=>Fn(t,"name",{value:e,configurable:!0});import{createRequire as zn}from"node:module";import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
2
- const require = __cjs_mod__.createRequire(import.meta.url);
3
- const Wn=zn(import.meta.url),fe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,qn=N(t=>{if(typeof fe<"u"&&fe.versions&&fe.versions.node){const[e,n]=fe.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return fe.getBuiltinModule(t)}return Wn(t)},"__cjs_getBuiltinModule"),{createRequire:Je}=qn("node:module"),Gn=16,tt=32,Hn=64,re=128,xe="positionals";var Kn=Object.defineProperty,Lt=N((t,e)=>Kn(t,"name",{value:e,configurable:!0}),"i$6"),Jn=Object.defineProperty,St=Lt((t,e)=>Jn(t,"name",{value:e,configurable:!0}),"s"),Zn=Object.defineProperty,Tt=St((t,e)=>Zn(t,"name",{value:e,configurable:!0}),"s"),Yn=Object.defineProperty,It=Tt((t,e)=>Yn(t,"name",{value:e,configurable:!0}),"i"),Qn=Object.defineProperty,Mt=It((t,e)=>Qn(t,"name",{value:e,configurable:!0}),"t");Mt(t=>t instanceof Error&&t.type==="VisulimaError","isVisulimaError");let Xn=class extends Error{static{N(this,"V")}static{Lt(this,"g")}static{St(this,"p")}static{Tt(this,"V")}static{It(this,"VisulimaError")}static{Mt(this,"VisulimaError")}loc;title;hint;type="VisulimaError";constructor({cause:e,hint:n,location:i,message:r,name:o,stack:l,title:s}){super(r,{cause:e}),this.title=s,this.name=o,this.stack=l??this.stack,this.loc=i,this.hint=n}setLocation(e){this.loc=e}setName(e){this.name=e}setMessage(e){this.message=e}setHint(e){this.hint=e}};var ei=Object.defineProperty,Vt=N((t,e)=>ei(t,"name",{value:e,configurable:!0}),"t$4"),ti=Object.defineProperty,Dt=Vt((t,e)=>ti(t,"name",{value:e,configurable:!0}),"t"),ni=Object.defineProperty,ii=Dt((t,e)=>ni(t,"name",{value:e,configurable:!0}),"e");let A=class extends Xn{static{N(this,"m")}static{Vt(this,"u")}static{Dt(this,"c")}static{ii(this,"CerebroError")}code;context;constructor(e,n,i){super({message:e,name:"CerebroError"}),this.code=n,this.context=i}};var oi=Object.defineProperty,ri=N((t,e)=>oi(t,"name",{value:e,configurable:!0}),"a$2"),ai=Object.defineProperty,si=ri((t,e)=>ai(t,"name",{value:e,configurable:!0}),"l"),li=Object.defineProperty,T=si((t,e)=>li(t,"name",{value:e,configurable:!0}),"r");const U=T(t=>"Deno"in t,"hasDeno"),B=T(t=>"Bun"in t,"hasBun"),Pe=T(()=>{if(U(globalThis)){const t=globalThis.Deno,e=t.execPath();let n=e;try{const{importMeta:i}=globalThis;i?.url&&(n=i.url)}catch{}return[e,n,...t.args]}return B(globalThis)?globalThis.Bun.process.argv:process.argv},"getArgv"),ci=T(()=>U(globalThis)?globalThis.Deno.cwd():B(globalThis)?globalThis.Bun.process.cwd():process.cwd(),"getCwd"),H=T(()=>{if(U(globalThis)){const t=globalThis.Deno;return new Proxy(t.env.toObject(),{get:T((e,n)=>typeof n=="string"?t.env.get(n):e[n],"get"),has:T((e,n)=>typeof n=="string"?t.env.has(n):n in e,"has"),set:T((e,n,i)=>typeof n=="string"?(i===void 0||t.env.set(n,i),!0):!1,"set")})}return B(globalThis)?globalThis.Bun.process.env:process.env},"getEnv"),Ut=T(()=>U(globalThis)?[]:B(globalThis)?globalThis.Bun.process.execArgv:process.execArgv,"getExecArgv"),Bt=T(()=>U(globalThis)?globalThis.Deno.execPath():B(globalThis)?globalThis.Bun.process.execPath:process.execPath,"getExecPath"),ui=T(()=>{if(U(globalThis)){const t=globalThis.Deno.build?.os??"unknown";return t==="windows"?"win32":t}return B(globalThis)?globalThis.Bun.platform??"unknown":process.platform},"getPlatform"),pi=T(()=>{if(U(globalThis)){const t=globalThis.Deno.build?.arch??"unknown";return t==="x86_64"?"x64":t==="aarch64"?"arm64":t}return B(globalThis)?globalThis.Bun.process.arch:process.arch},"getArch");T(()=>{if(U(globalThis)){const t=globalThis.Deno,e={};return t.version?.deno&&(e.deno=t.version.deno),t.version?.v8&&(e.v8=t.version.v8),t.version?.typescript&&(e.typescript=t.version.typescript),e}if(B(globalThis)){const t=globalThis.Bun,e={...t.process.versions};return t.version&&(e.bun=t.version),e}return process.versions},"getVersions");const W=T((t=0)=>{if(U(globalThis))throw globalThis.Deno.exit(t),new Error("Deno exit failed");if(B(globalThis))throw globalThis.Bun.process.exit(t),new Error("Bun exit failed");process.exit(t)},"exitProcess"),nt=T((t,e)=>{if(U(globalThis))return()=>{};if(B(globalThis)){try{const i=globalThis.Bun;if(i.process?.on)return i.process.on(t,e),()=>{i.process?.removeListener&&i.process.removeListener(t,e)}}catch{}return()=>{}}const n=process;return n.on(t,e),()=>{n.removeListener(t,e)}},"onProcessEvent");var fi=Object.defineProperty,Ne=N((t,e)=>fi(t,"name",{value:e,configurable:!0}),"k$2");const z=new Uint32Array(65536),di=Ne((t,e)=>{const n=t.length,i=e.length,r=1<<n-1;let o=-1,l=0,s=n,p=n;for(;p--;)z[t.charCodeAt(p)]|=1<<p;for(p=0;p<i;p++){let a=z[e.charCodeAt(p)];const c=a|l;a|=(a&o)+o^o,l|=~(a|o),o&=a,l&r&&s++,o&r&&s--,l=l<<1|1,o=o<<1|~(c|l),l&=c}for(p=n;p--;)z[t.charCodeAt(p)]=0;return s},"myers_32"),hi=Ne((t,e)=>{const n=e.length,i=t.length,r=[],o=[],l=Math.ceil(n/32),s=Math.ceil(i/32);for(let u=0;u<l;u++)o[u]=-1,r[u]=0;let p=0;for(;p<s-1;p++){let u=0,v=-1;const w=p*32,y=Math.min(32,i)+w;for(let O=w;O<y;O++)z[t.charCodeAt(O)]|=1<<O;for(let O=0;O<n;O++){const E=z[e.charCodeAt(O)],h=o[O/32|0]>>>O&1,m=r[O/32|0]>>>O&1,b=E|u,$=((E|m)&v)+v^v|E|m;let P=u|~($|v),k=v&$;P>>>31^h&&(o[O/32|0]^=1<<O),k>>>31^m&&(r[O/32|0]^=1<<O),P=P<<1|h,k=k<<1|m,v=k|~(b|P),u=P&b}for(let O=w;O<y;O++)z[t.charCodeAt(O)]=0}let a=0,c=-1;const d=p*32,f=Math.min(32,i-d)+d;for(let u=d;u<f;u++)z[t.charCodeAt(u)]|=1<<u;let g=i;for(let u=0;u<n;u++){const v=z[e.charCodeAt(u)],w=o[u/32|0]>>>u&1,y=r[u/32|0]>>>u&1,O=v|a,E=((v|y)&c)+c^c|v|y;let h=a|~(E|c),m=c&E;g+=h>>>i-1&1,g-=m>>>i-1&1,h>>>31^w&&(o[u/32|0]^=1<<u),m>>>31^y&&(r[u/32|0]^=1<<u),h=h<<1|w,m=m<<1|y,c=m|~(O|h),a=h&O}for(let u=d;u<f;u++)z[t.charCodeAt(u)]=0;return g},"myers_x"),Rt=Ne((t,e)=>{if(t.length<e.length){const n=e;e=t,t=n}return e.length===0?t.length:t.length<=32?di(t,e):hi(t,e)},"distance");Ne((t,e)=>{let n=1/0,i=0;for(let r=0;r<e.length;r++){const o=Rt(t,e[r]);o<n&&(n=o,i=r)}return e[i]},"closest");var mi=Object.defineProperty,gi=N((t,e)=>mi(t,"name",{value:e,configurable:!0}),"a$1"),vi=Object.defineProperty,bi=gi((t,e)=>vi(t,"name",{value:e,configurable:!0}),"a"),yi=Object.defineProperty,wi=bi((t,e)=>yi(t,"name",{value:e,configurable:!0}),"p"),$i=Object.defineProperty,Ft=wi((t,e)=>$i(t,"name",{value:e,configurable:!0}),"e"),Oi=Object.defineProperty,xi=Ft((t,e)=>Oi(t,"name",{value:e,configurable:!0}),"E");const zt=String.raw,it=zt`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Pi=xi(()=>new RegExp(zt`\p{RI}{2}|(?![#*\d](?!\uFE0F?\u20E3))${it}(?:\u200D${it})*`,"gu"),"default");var Ei=Object.defineProperty,Ai=Ft((t,e)=>Ei(t,"name",{value:e,configurable:!0}),"p");Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]]));const Rc=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,Fc=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,se=Pi(),Ni=/[-_./\s]+/g,ve=/(\u001B\[[0-9;]*[a-z])/i,ot=new RegExp("\\p{Script=Arabic}","u"),Ci=new RegExp("\\p{Script=Bengali}","u"),ie=new RegExp("\\p{Script=Cyrillic}","u"),ji=new RegExp("\\p{Script=Devanagari}","u"),ki=new RegExp("\\p{Script=Ethiopic}","u"),Ue=new RegExp("\\p{Script=Greek}","u"),rt=new RegExp("\\p{Script=Greek}+|\\p{Script=Latin}+|[^\\p{Script=Greek}\\p{Script=Latin}]+","gu"),_i=new RegExp("\\p{Script=Gujarati}","u"),Li=new RegExp("\\p{Script=Gurmukhi}","u"),at=new RegExp("\\p{Script=Hangul}","u"),st=new RegExp("\\p{Script=Hebrew}","u"),Si=new RegExp("\\p{Script=Hiragana}","u"),lt=new RegExp("\\p{Script=Han}","u"),Ti=new RegExp("\\p{Script=Kannada}","u"),Ii=new RegExp("\\p{Script=Katakana}","u"),Mi=new RegExp("\\p{Script=Khmer}","u"),Vi=new RegExp("\\p{Script=Lao}","u"),I=new RegExp("\\p{Script=Latin}","u"),Di=new RegExp("\\p{Script=Malayalam}","u"),Ui=new RegExp("\\p{Script=Myanmar}","u"),Bi=new RegExp("\\p{Script=Oriya}","u"),Ri=new RegExp("\\p{Script=Sinhala}","u"),Fi=new RegExp("\\p{Script=Tamil}","u"),zi=new RegExp("\\p{Script=Telugu}","u"),Wi=new RegExp("\\p{Script=Thai}","u"),qi=new RegExp("\\p{Script=Tibetan}","u"),ct=/[\u02BB\u02BC\u0027]/u,Gi=Ai(t=>t.replace(se,""),"stripEmoji");var Hi=Object.defineProperty,S=N((t,e)=>Hi(t,"name",{value:e,configurable:!0}),"x$2"),Ki=Object.defineProperty,x=S((t,e)=>Ki(t,"name",{value:e,configurable:!0}),"O");const Ji=Je(import.meta.url),de=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Wt=x(t=>{if(typeof de<"u"&&de.versions&&de.versions.node){const[e,n]=de.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return de.getBuiltinModule(t)}return Ji(t)},"__cjs_getBuiltinModule"),{writeFile:Zi,stat:Yi,rm:Qi,readFile:ut,readdir:Xi,mkdir:eo,access:to}=Wt("node:fs/promises"),{createRequire:no}=Wt("node:module"),we=[{description:"Turn on verbose output",group:"global",name:"verbose",type:Boolean},{description:"Turn on debugging output",group:"global",name:"debug",type:Boolean},{alias:"h",description:"Print out helpful usage information",group:"global",name:"help",type:Boolean},{alias:"q",description:"Silence output",group:"global",name:"quiet",type:Boolean},{alias:"V",description:"Print version info",group:"global",name:"version",type:Boolean},{description:"Turn off colored output",group:"global",name:"no-color",type:Boolean},{description:"Force colored output",group:"global",name:"color",type:Boolean}];var io=Object.defineProperty,oo=x((t,e)=>io(t,"name",{value:e,configurable:!0}),"t$9");let K=class extends A{static{N(this,"D")}static{S(this,"S")}static{x(this,"a")}static{oo(this,"CommandNotFoundError")}commandName;constructor(e,n=[]){const i=`Command "${e}" not found${n.length>0?`. Did you mean: ${n.join(", ")}?`:""}`;super(i,"COMMAND_NOT_FOUND",{commandName:e,suggestions:n}),this.name="CommandNotFoundError",this.commandName=e,n.length>0&&(this.hint=`Try one of these commands: ${n.join(", ")}`)}};var ro=Object.defineProperty,ao=x((t,e)=>ro(t,"name",{value:e,configurable:!0}),"e$7");let qt=class extends A{static{N(this,"at")}static{S(this,"at")}static{x(this,"o")}static{ao(this,"ConflictingOptionsError")}option1;option2;constructor(t,e){super(`Options "${t}" and "${e}" cannot be used together`,"CONFLICTING_OPTIONS",{option1:t,option2:e}),this.name="ConflictingOptionsError",this.option1=t,this.option2=e,this.hint=`Remove either --${t} or --${e}`}};var so=Object.defineProperty,lo=x((t,e)=>so(t,"name",{value:e,configurable:!0}),"e$6");let co=class extends A{static{N(this,"jn")}static{S(this,"jn")}static{x(this,"o")}static{lo(this,"PluginError")}pluginName;constructor(t,e,n){super(`Plugin "${t}" error: ${e}`,"PLUGIN_ERROR",{originalError:n,pluginName:t}),this.name="PluginError",this.pluginName=t,n&&(this.cause=n)}};var uo=Object.defineProperty,pt=x((t,e)=>uo(t,"name",{value:e,configurable:!0}),"d$7");let po=class{static{N(this,"Mn")}static{S(this,"Un")}static{x(this,"p")}static{pt(this,"PluginManager")}logger;plugins=new Map;initialized=!1;cachedDependencyOrder=void 0;constructor(t){this.logger=t}hasPlugins(){return this.plugins.size>0}register(t){if(this.initialized)throw new Error(`Cannot register plugin "${t.name}" after initialization`);if(this.plugins.has(t.name))throw new Error(`Plugin "${t.name}" is already registered`);H().CEREBRO_OUTPUT_LEVEL===String(re)&&this.logger.debug(`registering plugin: ${t.name}`),this.plugins.set(t.name,t),this.cachedDependencyOrder=void 0}async init(t){if(this.initialized)throw new Error("PluginManager already initialized");if(this.plugins.size===0){this.logger.debug("no plugins registered, skipping initialization"),this.initialized=!0;return}this.validateDependencies();const e=this.getDependencyOrder();this.logger.debug(`initializing ${String(e.length)} plugin(s)...`);for(const n of e)if(typeof n.init=="function"){this.logger.debug(`initializing plugin: ${n.name}`);try{await n.init(t)}catch(i){const r=new co(n.name,`Failed to initialize: ${i instanceof Error?i.message:String(i)}`,i instanceof Error?i:void 0);throw this.logger.error(r.message),r}}this.initialized=!0}async executeLifecycle(t,e,n){if(!this.initialized)throw new Error("PluginManager not initialized");if(this.plugins.size===0)return;const i=this.getDependencyOrder();for(const r of i){const o=r[t];if(typeof o=="function"){this.logger.debug(`executing ${t} hook for plugin: ${r.name}`);try{await(t==="afterCommand"?o(e,n):o(e))}catch(l){throw this.logger.error(`Error in ${t} hook for plugin "${r.name}":`,l),l}}}}async executeErrorHandlers(t,e){if(!this.initialized||this.plugins.size===0)return;const n=this.getDependencyOrder();for(const i of n)if(typeof i.onError=="function"){this.logger.debug(`executing error handler for plugin: ${i.name}`);try{await i.onError(t,e)}catch(r){this.logger.error(`Error in error handler for plugin "${i.name}":`,r)}}}getDependencyOrder(){if(this.cachedDependencyOrder!==void 0)return this.cachedDependencyOrder;const t=[],e=new Set,n=new Set,i=pt(r=>{if(e.has(r))return;if(n.has(r))throw new Error(`Circular dependency detected involving plugin "${r}"`);const o=this.plugins.get(r);if(!o)throw new Error(`Plugin "${r}" not found`);if(n.add(r),o.dependencies)for(const l of o.dependencies)i(l);n.delete(r),e.add(r),t.push(o)},"visit");for(const r of this.plugins.keys())i(r);return this.cachedDependencyOrder=t,t}validateDependencies(){for(const t of this.plugins.values())if(t.dependencies){for(const e of t.dependencies)if(!this.plugins.has(e))throw new Error(`Plugin "${t.name}" depends on "${e}" which is not registered`)}}};var fo=Object.defineProperty,ho=x((t,e)=>fo(t,"name",{value:e,configurable:!0}),"n$a");const be=ho(t=>t.type?.name==="Boolean","optionIsBoolean");var mo=Object.defineProperty,Gt=x((t,e)=>mo(t,"name",{value:e,configurable:!0}),"p$9");const go=Gt(t=>{let e=t.type?t.type.name.toLowerCase():"string";const n=t.multiple??t.lazyMultiple?"[]":"";return e&&(e=e==="boolean"?"":`{underline ${e}${n}}`),e},"getTypeLabel"),ft=Gt(t=>(be(t)||(t.typeLabel=t.typeLabel??go(t),t.defaultOption&&(t.typeLabel=`${t.typeLabel} (D)`),t.required&&(t.typeLabel=`${t.typeLabel} (R)`)),t),"mapOptionTypeLabel");var vo=Object.defineProperty,Ht=x((t,e)=>vo(t,"name",{value:e,configurable:!0}),"e$4");const bo=new RegExp(/^-([^\d-])$/),yo=new RegExp(/^--(\S+)/),wo=new RegExp(/^-([^\d-]{2,})$/),$o=Ht(t=>bo.test(t)||yo.test(t)||wo.test(t),"isOption"),Oo=Ht((t,e)=>{const n=e[0]&&$o(e[0])||e.length===0?null:e.shift()??null;if(!t.includes(n)){const i=new Error(`Command not recognised: ${String(n)}`);throw i.command=n,i.name="INVALID_COMMAND",i}return{argv:e,command:n}},"commandLineCommands");var xo=Object.defineProperty,Kt=x((t,e)=>xo(t,"name",{value:e,configurable:!0}),"i$b"),Po=Object.defineProperty,Jt=Kt((t,e)=>Po(t,"name",{value:e,configurable:!0}),"i"),Eo=Object.defineProperty,Zt=Jt((t,e)=>Eo(t,"name",{value:e,configurable:!0}),"s"),Ao=Object.defineProperty,Yt=Zt((t,e)=>Ao(t,"name",{value:e,configurable:!0}),"i"),No=Object.defineProperty,Qt=Yt((t,e)=>No(t,"name",{value:e,configurable:!0}),"t");Qt(t=>t instanceof Error&&t.type==="VisulimaError","isVisulimaError");let Ce=class extends Error{static{N(this,"ue")}static{S(this,"ce")}static{x(this,"v")}static{Kt(this,"g")}static{Jt(this,"p")}static{Zt(this,"V")}static{Yt(this,"VisulimaError")}static{Qt(this,"VisulimaError")}loc;title;hint;type="VisulimaError";constructor({cause:e,hint:n,location:i,message:r,name:o,stack:l,title:s}){super(r,{cause:e}),this.title=s,this.name=o,this.stack=l??this.stack,this.loc=i,this.hint=n}setLocation(e){this.loc=e}setName(e){this.name=e}setMessage(e){this.message=e}setHint(e){this.hint=e}};var Co=Object.defineProperty,Xt=x((t,e)=>Co(t,"name",{value:e,configurable:!0}),"o$b"),jo=Object.defineProperty,en=Xt((t,e)=>jo(t,"name",{value:e,configurable:!0}),"o"),ko=Object.defineProperty,_o=en((t,e)=>ko(t,"name",{value:e,configurable:!0}),"i");let Lo=class tn extends Ce{static{N(this,"mt")}static{S(this,"ht")}static{x(this,"a")}static{Xt(this,"a")}static{en(this,"t")}static{_o(this,"AlreadySetError")}optionName;constructor(e){super({cause:void 0,hint:`Remove the duplicate option '${e}' from your command line arguments.`,location:void 0,message:`Option '${e}' is already set`,name:"ALREADY_SET",stack:void 0,title:"Option Already Set"}),this.optionName=e,Object.setPrototypeOf(this,tn.prototype)}};var So=Object.defineProperty,nn=x((t,e)=>So(t,"name",{value:e,configurable:!0}),"t$7"),To=Object.defineProperty,on=nn((t,e)=>To(t,"name",{value:e,configurable:!0}),"e"),Io=Object.defineProperty,Mo=on((t,e)=>Io(t,"name",{value:e,configurable:!0}),"e");let dt=class rn extends Ce{static{N(this,"yt")}static{S(this,"vt")}static{x(this,"n")}static{nn(this,"n")}static{on(this,"o")}static{Mo(this,"UnknownOptionError")}optionName;constructor(e){super({cause:void 0,hint:`Check your option definitions or remove the unknown option '${e}' from your command line arguments.`,location:void 0,message:`Unknown option: --${e}`,name:"UNKNOWN_OPTION",stack:void 0,title:"Unknown Option"}),this.optionName=`--${e}`,Object.setPrototypeOf(this,rn.prototype)}};var Vo=Object.defineProperty,an=x((t,e)=>Vo(t,"name",{value:e,configurable:!0}),"a$9"),Do=Object.defineProperty,sn=an((t,e)=>Do(t,"name",{value:e,configurable:!0}),"a"),Uo=Object.defineProperty,Bo=sn((t,e)=>Uo(t,"name",{value:e,configurable:!0}),"o");let Ro=class ln extends Ce{static{N(this,"Ot")}static{S(this,"bt")}static{x(this,"n")}static{an(this,"o")}static{sn(this,"e")}static{Bo(this,"UnknownValueError")}value;constructor(e){super({hint:"Use a defined option or add a defaultOption to capture this value.",message:`Unknown value: ${e}`,name:"UNKNOWN_VALUE",title:"Unknown Value"}),this.value=e,Object.setPrototypeOf(this,ln.prototype)}};var Fo=Object.defineProperty,cn=x((t,e)=>Fo(t,"name",{value:e,configurable:!0}),"i$8"),zo=Object.defineProperty,un=cn((t,e)=>zo(t,"name",{value:e,configurable:!0}),"i"),Wo=Object.defineProperty,qo=un((t,e)=>Wo(t,"name",{value:e,configurable:!0}),"i");let M=class pn extends Ce{static{N(this,"Nt")}static{S(this,"Pt")}static{x(this,"a")}static{cn(this,"o")}static{un(this,"e")}static{qo(this,"InvalidDefinitionsError")}constructor(e,n){super({cause:void 0,hint:n,location:void 0,message:e,name:"INVALID_DEFINITIONS",stack:void 0,title:"Invalid Option Definition"}),Object.setPrototypeOf(this,pn.prototype)}};var Go=Object.defineProperty,Ho=x((t,e)=>Go(t,"name",{value:e,configurable:!0}),"z"),Ko=Object.defineProperty,ce=Ho((t,e)=>Ko(t,"name",{value:e,configurable:!0}),"S"),Jo=Object.defineProperty,je=ce((t,e)=>Jo(t,"name",{value:e,configurable:!0}),"o");const ht=je(t=>t===Boolean||typeof t=="function"&&t.name.startsWith("Boolean"),"isBooleanType"),mt=je(t=>t===Number||typeof t=="function"&&t.name==="Number","isNumberType"),gt=je(t=>t===String||typeof t=="function"&&t.name==="String","isStringType"),Zo=je((t,e)=>Array.isArray(t)?ht(e)?t.map(Boolean):mt(e)?t.map(Number):gt(e)?t.map(String):t.map(n=>e(String(n))):t===null?null:ht(e)?!!t:mt(e)?Number(t):gt(e)?typeof t=="string"?t:String(t):e(typeof t=="string"?t:String(t)),"convertValue");var Yo=Object.defineProperty,Qo=ce((t,e)=>Yo(t,"name",{value:e,configurable:!0}),"e");const L=Qo((t,e,n,...i)=>{t&&console.debug(`[command-line-args:${n}] ${e}`,...i)},"debug");var Xo=Object.defineProperty,te=ce((t,e)=>Xo(t,"name",{value:e,configurable:!0}),"h$1");const er=/-([a-z])/g,tr=/^\d+$/,Be=te(t=>t===Boolean||typeof t=="function"&&t.name.startsWith("Boolean"),"isBooleanType"),nr=te(t=>t.codePointAt(0)===95,"isSpecialKey"),vt=te((t,e)=>Array.isArray(t)?[...t,...e]:[t,...e],"appendToArrayMultiple"),bt=te(t=>t==="__proto__"||t==="constructor"||t==="prototype","isUnsafeKey"),yt=te((t,e,n,i=!1)=>{t[e]===void 0?t[e]=i?[n]:n:i&&Array.isArray(t[e])?t[e].push(n):t[e]=[t[e],n]},"createOrAppendArray"),ir=te((t,e,n,i,r)=>{let o=e.get(t)??n.get(t);if(!o&&i){const l=t.toLowerCase();o=i.get(l)??r?.get(l)}return o},"getDefinition"),or=te((t,e,n,i)=>{const r=n.debug??!1;L(r,"resolveArgs called with options:","resolver",{partial:n.partial,stopAtFirstUnknown:n.stopAtFirstUnknown}),L(r,"Starting argument resolution","resolver"),L(r,"Tokens:","resolver",t),L(r,"Definitions:","resolver",e),L(r,"Processing tokens...","resolver");const o=new Map,l=new Map,s=n.caseInsensitive?new Map:void 0,p=n.caseInsensitive?new Map:void 0,a=n.camelCase?new Map:void 0,c=n.camelCase?new Map:void 0;for(const h of e)if(o.set(h.name,h),h.alias&&l.set(h.alias,h),n.caseInsensitive&&s&&(s.set(h.name.toLowerCase(),h),h.alias&&p&&p.set(h.alias.toLowerCase(),h)),n.camelCase&&a&&c){const m=h.name.replaceAll(er,(b,$)=>$.toUpperCase());a.set(h.name,m),c.set(m,h.name)}const d={},f={},g=[],u=new Set;let v=!1;const w=e.find(h=>h.defaultOption),y=e.some(h=>h.group),O=e.some(h=>h.type===Number);for(let h=0;h<t.length;h++){const m=t[h];if(m.kind==="option-terminator"){d._unknown=i.slice(m.index),v=!0;break}if(m.kind==="option"&&m.name){let b=ir(m.name,o,l,s,p);if(!b&&m.value===void 0&&O&&tr.test(m.name)){const C=e.find(R=>R.type===Number);C&&(b=C,m.value=m.name,m.name=C.name)}const $=b?b.name:m.name,P=b?.multiple,k=b?.lazyMultiple;if(f[$]!==void 0&&!P&&!k&&!n.partial)throw new Lo($);if(!b&&n.partial){const C=m.rawName??`--${m.name}${m.value!==void 0&&m.inlineValue?`=${m.value}`:""}`;g.push({index:m.index,value:C});continue}if(!b&&n.stopAtFirstUnknown){d._unknown=i.slice(m.index);break}if(!b&&!n.partial)throw new dt(m.name);if(m.value===void 0){const C=t[h+1],R=C?.kind==="option"&&!("name"in C)&&C.value!==void 0,V=C&&b&&!(b.type&&Be(b.type))&&(C.kind==="positional"||R),Rn=b&&b.defaultOption&&!b.multiple&&!b.lazyMultiple;if(V&&(!b?.defaultOption||Rn))if(P){let F=h+1;const De=[];for(;F<t.length&&(t[F].kind==="positional"||t[F].kind==="option"&&!("name"in t[F])&&t[F].value!==void 0);)De.push(t[F].value),u.add(t[F].index),F++;f[$]=f[$]===void 0?De:vt(f[$],De),h=F-1}else k?(yt(f,$,C.value,!0),u.add(C.index),h++):(f[$]=C.value,u.add(C.index),h++);else b?.type&&Be(b.type)?yt(f,$,!0,P):f[$]=P?[]:null}else{let{value:C}=m;if(b?.type&&Be(b.type))switch(C){case"":{if(n.partial)f._unknown??=[],f._unknown.push(`${m.rawName??`--${m.name}`}${m.value?`=${m.value}`:""}`),C=!0;else throw new dt(m.name);break}case"false":{C=!1;break}case"true":{C=!0;break}default:C=!0}const R=[C];if(P){let V=h+1;for(;V<t.length&&t[V].kind==="positional";)R.push(t[V].value),u.add(t[V].index),V++;h=V-1}f[$]===void 0?f[$]=P||k?R:C:P||k?f[$]=vt(f[$],R):f[$]=C}}else if(m.kind==="positional"&&n.stopAtFirstUnknown&&!u.has(m.index)&&!w){L(r,`Found unconsumed positional token at index ${String(m.index)}, stopping processing`,"resolver"),d._unknown=i.slice(m.index);break}}for(const[h,m]of Object.entries(f)){const b=o.get(h);b&&(b.multiple||b.lazyMultiple)&&!Array.isArray(m)&&(f[h]=[m])}let E=Number.POSITIVE_INFINITY;if(n.stopAtFirstUnknown&&!v){for(const h of t)if(h.kind==="option"&&!o.has(h.name??"")&&!l.has(h.name??"")&&(!n.caseInsensitive||!s?.has(h.name?.toLowerCase()??"")&&!p?.has(h.name?.toLowerCase()??""))){E=h.index;break}}if(w){const h=[],m=[];for(const b of t)b.kind==="positional"&&!u.has(b.index)&&b.index<E&&(h.push(b.value),m.push(b));if(h.length>0){const b=f[w.name],$=w.multiple??w.lazyMultiple;b===void 0?$?(m.forEach(P=>u.add(P.index)),f[w.name]=h):(u.add(m[0].index),f[w.name]=h[0]):$&&(m.forEach(P=>u.add(P.index)),f[w.name]=Array.isArray(b)?[...h,...b]:[...h,b])}}if(!n.partial){for(const h of t)if(h.kind==="positional"&&!u.has(h.index))throw new Ro(i[h.index])}if(n.partial&&!n.stopAtFirstUnknown){const h=[...g];if(f._unknown){const m=new Map;for(const[b,$]of i.entries())m.set($,b);for(const b of f._unknown){const $=m.get(b);$!==void 0&&h.push({index:$,value:b})}}for(const m of t)m.kind==="positional"&&!u.has(m.index)&&h.push({index:m.index,value:i[m.index]});h.length>0&&(h.sort((m,b)=>m.index-b.index),d._unknown=h.map(m=>m.value))}if(n.stopAtFirstUnknown&&!v){const h=t.findIndex($=>$.kind==="option"&&!o.has($.name??"")&&!l.has($.name??"")&&(!n.caseInsensitive||!s?.has($.name?.toLowerCase()??"")&&!p?.has($.name?.toLowerCase()??""))),m=t.findIndex($=>$.kind==="positional"&&!u.has($.index));let b=-1;if(h!==-1&&m!==-1?b=Math.min(h,m):h!==-1?b=h:m!==-1&&(b=m),b>=0){const $=t[b].index;d._unknown=i.slice($)}}else g.length>0&&!n.partial&&(d._unknown=g.map(h=>h.value));for(const[h,m]of Object.entries(f)){const b=n.camelCase?a?.get(h)??h:h,$=o.get(h);d[b]=$?.type?Zo(m,$.type):m===void 0?null:m}for(const h of e){const m=n.camelCase?a?.get(h.name)??h.name:h.name;!(m in d)&&h.defaultValue!==void 0&&(h.multiple??h.lazyMultiple?d[m]=Array.isArray(h.defaultValue)?[...h.defaultValue]:[h.defaultValue]:d[m]=h.defaultValue)}if(y){const h={},m={},b={};for(const P of e)if(P.group){const k=Array.isArray(P.group)?P.group:[P.group];for(const C of k)bt(C)||(h[C]??={})}for(const P of Object.keys(d))if(!nr(P)){m[P]=d[P];let k=P;n.camelCase&&(k=c?.get(P)??P);const C=o.get(k);if(C?.group){const R=Array.isArray(C.group)?C.group:[C.group];for(const V of R)bt(V)||h[V]&&(h[V][P]=d[P])}else b[P]=d[P]}const $={_all:m};for(const[P,k]of Object.entries(h))$[P]=k;Object.keys(b).length>0&&($._none=b),d._unknown&&($._unknown=d._unknown),Object.keys(d).forEach(P=>delete d[P]),Object.assign(d,$)}return L(r,"Final parsed result:","resolver",d),d},"resolveArgs");var rr=Object.defineProperty,ne=ce((t,e)=>rr(t,"name",{value:e,configurable:!0}),"l");const Q="-".codePointAt(0),Y="=",ar=Y.codePointAt(0),sr="--",lr="-",cr="--",fn=ne(t=>t.length>2&&t.startsWith(cr),"hasLongOptionPrefix"),ur=ne(t=>fn(t)&&!t.includes(Y,3),"isLongOption"),pr=ne(t=>fn(t)&&t.includes(Y,3),"isLongOptionAndValue"),fr=ne(t=>t!==void 0&&t.length>0&&t.codePointAt(0)!==Q,"hasOptionValue"),dr=ne(t=>{if(t.length!==2||t.codePointAt(0)!==Q||t.codePointAt(1)===Q)return!1;const e=t.codePointAt(1);return e!==void 0&&(e<48||e>57)},"isShortOption"),hr=ne(t=>!(t.length<=2||t.codePointAt(0)!==Q||t.codePointAt(1)===Q),"isShortOptionGroup"),mr=ne(t=>{const e=[],n=[...t];let i=-1,r=0;for(;n.length>0;){const o=n.shift();if(o===void 0)break;const l=n[0];if(r>0?r--:i++,o===sr){e.push({index:i,kind:"option-terminator"});const s=n.map((p,a)=>({index:i+a+1,kind:"positional",value:p}));e.push(...s),i+=n.length;break}if(dr(o)){const s=o.charAt(1);let p;r?(e.push({index:i,kind:"option",name:s,rawName:o,value:p}),r===1&&fr(l)&&(p=n.shift(),e.push({index:i,kind:"option",value:p}))):e.push({index:i,kind:"option",name:s,rawName:o,value:p}),p!==void 0&&++i;continue}if(hr(o)&&!o.includes(Y)){const s=[];let p="",a=!1;for(let c=1;c<o.length;c++){const d=o.charAt(c);a?p+=d:d.codePointAt(0)===ar?a=!0:s.push(`${lr}${d}`)}if(a)if(s.length>0){const c=s.pop();s.push(`${c}=${p}`)}else s.push(p);n.unshift(...s),r=s.length;continue}if(ur(o)){const s=o.slice(2);e.push({index:i,kind:"option",name:s,rawName:o});continue}if(pr(o)){const s=o.indexOf(Y),p=o.slice(2,s),a=o.slice(s+1);e.push({index:i,inlineValue:!0,kind:"option",name:p,rawName:o,value:a});continue}if(o.length>2&&o.codePointAt(0)===Q&&o.codePointAt(1)!==Q&&o.includes(Y)){const s=o.indexOf(Y),p=o.charAt(1),a=o.slice(s+1);e.push({index:i,inlineValue:!0,kind:"option",name:p,rawName:o,value:a});continue}e.push({index:i,kind:"positional",value:o})}return e},"parseArgsTokens");var gr=Object.defineProperty,Ze=ce((t,e)=>gr(t,"name",{value:e,configurable:!0}),"d");const vr=/\d/,br=Ze(t=>t!=null&&(t===Boolean||typeof t=="function"&&t.name.startsWith("Boolean")),"isBooleanType"),yr=Ze(t=>typeof t=="function","isValidCustomTypeFunction"),wr=Ze((t,e,n)=>{const i=n?.debug??!1;L(i,"Validating definitions:","validation",t,"caseInsensitive:",e);const r=new Set,o=new Set,l=new Set,s=new Set;let p=0;for(const a of t){if(L(i,"Checking definition:","validation",a),!a.name)throw L(i,"Validation failed: name is required","validation"),new M("Invalid option definition: name is required");if(typeof a.name!="string")throw new M("Invalid option definition: name must be a string");if(a.name.trim()==="")throw new M("Invalid option definition: name cannot be empty");const c=e?a.name.toLowerCase():"";if(r.has(a.name)||e&&l.has(c))throw new M(`Invalid option definition: duplicate name '${a.name}'`);if(o.has(a.name)||e&&s.has(c))throw new M(`Invalid option definition: name '${a.name}' conflicts with an existing alias`);if(r.add(a.name),e&&l.add(c),a.alias!==void 0){if(typeof a.alias!="string")throw new M("Invalid option definition: alias must be a string");if(a.alias.length!==1)throw new M("Invalid option definition: alias must be a single character");if(vr.test(a.alias))throw new M("Invalid option definition: alias cannot be numeric");if(a.alias==="-")throw new M('Invalid option definition: alias cannot be "-"');const d=e?a.alias.toLowerCase():"";if(o.has(a.alias)||e&&s.has(d))throw new M(`Invalid option definition: duplicate alias '${a.alias}'`);if(r.has(a.alias)||e&&l.has(d))throw new M(`Invalid option definition: alias '${a.alias}' conflicts with an existing option name`);o.add(a.alias),e&&s.add(d)}if(a.defaultOption&&(p++,a.type!==void 0&&br(a.type)))throw new M("Invalid option definition: defaultOption cannot be Boolean type");if(a.type!==void 0&&!(a.type===Boolean||a.type===Number||a.type===String||typeof a.type=="function"&&yr(a.type)))throw new M("Invalid option definition: invalid type")}if(p>1)throw L(i,"Validation failed: multiple defaultOptions not allowed","validation"),new M("Invalid option definition: multiple defaultOptions not allowed");L(i,"Validation completed successfully","validation")},"validateDefinitions");var $r=Object.defineProperty,Or=ce((t,e)=>$r(t,"name",{value:e,configurable:!0}),"O");const xr=Or((t,e={})=>{const n=e.debug??!1;L(n,"Starting command-line-args parsing","index"),L(n,"Options:","index",e);const i={...e};i.stopAtFirstUnknown&&(i.partial=!0);const r=Array.isArray(t)?t:[t];L(n,"Normalized definitions:","index",r),wr(r,i.caseInsensitive,n?i:void 0);let{argv:o}=i;if(!o&&(o=process.argv.slice(2),process.execArgv.length>0)){const a=new Set(process.execArgv);o=o.filter(c=>!a.has(c))}L(n,"Using argv:","index",o);let l=o;i.caseInsensitive&&(l=o.map(a=>{if(a.startsWith("--")){const c=a.indexOf("="),d=(c===-1?a.slice(2):a.slice(2,c)).toLowerCase();return c===-1?`--${d}`:`--${d}${a.slice(c)}`}if(a.startsWith("-")&&!a.startsWith("--")&&a.length>1){const c=a.slice(1).split("=",2),d=c[0],f=c[1];if(!d)return a;const g=d.toLowerCase();return f===void 0?`-${g}`:`-${g}=${f}`}return a}));const s=mr(l.map(String));L(n,"Tokenized arguments:","index",s);const p=or(s,r,i,o);return L(n,"Command-line-args parsing completed","index"),p},"commandLineArgs");var Pr=Object.defineProperty,Er=x((t,e)=>Pr(t,"name",{value:e,configurable:!0}),"b$2");let Ar=class{static{N(this,"Yi")}static{S(this,"Ki")}static{x(this,"m")}static{Er(this,"EmptyToolbox")}result;argv;options;argument;command;commandName;env;logger;console;fs;process;runtime;rawUnknown;constructor(t,e){this.commandName=t,this.command=e}};var Nr=Object.defineProperty,Cr=x((t,e)=>Nr(t,"name",{value:e,configurable:!0}),"n$6");let Re=class extends A{static{N(this,"Oe")}static{S(this,"be")}static{x(this,"i")}static{Cr(this,"CommandLoaderError")}commandName;constructor(e,n,i){super(`Failed to load command "${e}": ${n}`,"COMMAND_LOADER_ERROR",{commandName:e,reason:n}),this.name="CommandLoaderError",this.commandName=e,this.hint="Ensure the loader resolves to a module with a default export that is the command handler function.",i!==void 0&&(this.cause=i)}};var jr=Object.defineProperty,kr=x((t,e)=>jr(t,"name",{value:e,configurable:!0}),"f$5");const _r=/^-{1,2}(\w+)(=(.+))?$/,dn=kr((t,e,n,i)=>{const r=_r.exec(t);if(r===null)return{};const o=r[1];if(!o)return{};const l=n&&i?n.get(o)??i.get(o):e.find(s=>s.name===o||s.alias===o);return l!==void 0?{argName:l.name,argValue:r[3],option:l}:{}},"getParameterOption");var Lr=Object.defineProperty,Ke=x((t,e)=>Lr(t,"name",{value:e,configurable:!0}),"e$3");const wt=Ke((t,e)=>{if(e.type===void 0)return t;if(e.type.name==="Boolean"){if(t==="true"||t==="1")return e.type(!0);if(t==="false"||t==="0")return e.type(!1)}return e.type(t)},"convertType"),Sr=new Set(["0","1","false","true"]),Tr=Ke((t,e,n,i)=>{if(e.length===0||t.length===0)return{};const r=Ke((o,l)=>{const{argName:s,argValue:p,option:a}=dn(l,e,n,i),{lastOption:c}=o;return a&&be(a)&&p&&s?o.partial[s]=wt(p,a):o.lastName&&c&&be(c)&&Sr.has(l)&&(o.partial[o.lastName]=wt(l,c)),{lastName:s,lastOption:a,partial:o.partial}},"getBooleanValue");return t.reduce(r,{partial:{}}).partial},"getBooleanValues");var Ir=Object.defineProperty,$t=x((t,e)=>Ir(t,"name",{value:e,configurable:!0}),"s$8");const Mr=new Set(["0","1","false","true"]),Vr=$t((t,e,n,i)=>{if(e.length===0||t.length===0)return t;const r=$t((o,l)=>{const{argValue:s,option:p}=dn(l,e,n,i),{lastOption:a}=o;if(a&&be(a)&&Mr.has(l)){const{args:c}=o;return{args:c.slice(0,-1)}}return p&&be(p)&&s?{args:o.args}:{args:[...o.args,l],lastOption:p}},"removeBooleanArguments");return t.reduce(r,{args:[]}).args},"removeBooleanValues");var Dr=Object.defineProperty,Ur=x((t,e)=>Dr(t,"name",{value:e,configurable:!0}),"o$8");const Br=Ur(t=>{const e=new Map;for(const n of t){const i=e.get(n.name);i?e.set(n.name,{...i,...n}):e.set(n.name,n)}return[...e.values()]},"mergeArguments");var Rr=Object.defineProperty,ke=x((t,e)=>Rr(t,"name",{value:e,configurable:!0}),"o$7");const Fr=ke(t=>{if(t===void 0)return;const e=t.toLowerCase().trim();return e==="true"||e==="1"||e==="yes"||e==="on"},"transformBooleanEnv"),zr=ke((t,e)=>{if(!t.type)return e;if(e!==void 0){if(t.type===Boolean||typeof t.type=="function"&&t.type.name==="Boolean")return Fr(e);if(t.type===Number||typeof t.type=="function"&&t.type.name==="Number"){const n=Number.parseFloat(e);return Number.isNaN(n)?void 0:n}return t.type===String||typeof t.type=="function"&&t.type.name==="String"?e:t.type(e)}},"transformEnvValue"),Wr=/_./g,qr=/^[A-Z]/,Gr=ke(t=>t.toLowerCase().replaceAll(Wr,e=>e[1]?.toUpperCase()??e).replace(qr,e=>e.toLowerCase()),"toCamelCase"),Hr=ke(t=>{if(!t||t.length===0)return{};const e={},n=H();for(const i of t){const r=n[i.name],o=zr(i,r),l=o===void 0?i.defaultValue:o,s=Gr(i.name);e[s]=l}return e},"processEnvVariables");var Kr=Object.defineProperty,ye=x((t,e)=>Kr(t,"name",{value:e,configurable:!0}),"a$5");const Jr=ye(t=>{const e=new Map,n=new Map;for(const i of t)if(e.set(i.name,i),i.alias){const r=Array.isArray(i.alias)?i.alias:[i.alias];for(const o of r)n.set(o,i)}return{optionMapByAlias:n,optionMapByName:e}},"buildOptionMaps"),hn=ye(async t=>{if(typeof t.__resolvedExecute__=="function")return t.__resolvedExecute__;if(typeof t.loader!="function")throw new Re(t.name,"no execute or loader defined");let e;try{e=await t.loader()}catch(i){throw new Re(t.name,i instanceof Error?i.message:String(i),i)}const n=e.default;if(typeof n!="function")throw new Re(t.name,"loader did not return a module with a default-exported handler function");return t.__resolvedExecute__=n,n},"loadLazyHandler"),Zr=ye((t,e,n,i)=>{const r=new Ar(t.name,t),{_all:o,_unknown:l,positionals:s}=e,p=Object.keys(n).length>0?{...o,...n}:o;xe in p&&delete p[xe],r.argument=s?.[xe]??[],r.rawUnknown=[...l??[]];const a=Object.keys(i).length>0;return r.options=a?{...p,...i}:p,r.env=Hr(t.env),r},"prepareToolbox"),Yr=ye((t,e,n)=>{const i=t.options??[],r=i.length>0;let o=Br(r?[...i,...n]:n);if(o.length>0){for(const a of o)if(a.multiple&&a.lazyMultiple)throw new Error(`Argument "${a.name}" cannot have both multiple and lazyMultiple options, please choose one.`)}t.argument&&(o=[{defaultOption:!0,description:t.argument.description,group:"positionals",multiple:!0,name:xe,type:t.argument.type,typeLabel:t.argument.typeLabel},...o]);let l,s;if(r){const{optionMapByAlias:a,optionMapByName:c}=Jr(i);l=Vr(e,i,c,a),s=Tr(e,i,c,a)}else l=e,s={};const p=xr(o,{argv:l,camelCase:!0,partial:!0,stopAtFirstUnknown:!0});return{arguments_:o,booleanValues:s,parsedArgs:p}},"processCommandArgs"),oe=ye(async(t,e,n)=>typeof t.execute=="function"?t.execute(e):(await hn(t))(e),"executeCommand");var Qr=Object.defineProperty,Xr=x((t,e)=>Qr(t,"name",{value:e,configurable:!0}),"n$5");let ea=class extends A{static{N(this,"No")}static{S(this,"$a")}static{x(this,"s")}static{Xr(this,"CommandValidationError")}commandName;missingOptions;constructor(t,e){super(`Command "${t}" is missing required options: ${e.join(", ")}`,"COMMAND_VALIDATION_ERROR",{commandName:t,missingOptions:e}),this.name="CommandValidationError",this.commandName=t,this.missingOptions=e,this.hint=`Provide the following required options: ${e.join(", ")}`}};var ta=Object.defineProperty,na=x((t,e)=>ta(t,"name",{value:e,configurable:!0}),"t$5");const Ot=na((t,e,n=!1)=>{const i=[];for(const r of t)if(!(!n&&!r.required)&&e[r.name]===void 0){if(r.type?.name==="Boolean"){e[r.name]=!1;continue}i.push(r)}return i},"listMissingArguments");var ia=Object.defineProperty,mn=x((t,e)=>ia(t,"name",{value:e,configurable:!0}),"n$4");const oa=mn((t,e)=>e.includes(t)?!0:Math.abs(t.length-e.length)>t.length/2?!1:Rt(t,e)<=t.length/3,"isSimilar"),Z=mn((t,e)=>{const n=t.toLowerCase();return e.filter(i=>oa(i.toLowerCase(),n))},"findAlternatives");var ra=Object.defineProperty,_e=x((t,e)=>ra(t,"name",{value:e,configurable:!0}),"a$4");const aa=_e((t,e)=>{const n=[];if(t._unknown&&t._unknown.forEach(i=>{const r=i.startsWith("--");let o=`Found unknown ${r?"option":"argument"} "${i}"`;if(r){const l=Z(i.replace("--",""),(e.options??[]).map(s=>s.name));if(l.length>0){const[s,...p]=l.map(a=>`--${a}`);o+=p.length>0?`, did you mean ${s??""} or ${p.join(", ")}?`:`, did you mean ${s??""}?`}}n.push(o)}),n.length>0)throw new Error(n.join(`
4
- `))},"validateUnknownOptions"),sa=_e((t,e,n)=>{const i=n.__requiredOptions__,r=i?Ot(i,e,!0):Ot(t,e,!1);if(r.length>0)throw new ea(n.name,r.map(o=>o.name));e._unknown&&e._unknown.length>0&&!n.argument&&aa(e,n)},"validateRequiredOptions"),la=_e((t,e,n)=>{const i=n.__conflictingOptions__??t.filter(r=>r.conflicts!==void 0);if(i.length>0){const r=i.find(o=>Array.isArray(o.conflicts)?o.conflicts.some(l=>e[l]!==void 0)&&e[o.name]!==void 0:e[o.conflicts]!==void 0&&e[o.name]!==void 0);if(r)throw new qt(r.name,typeof r.conflicts=="string"?r.conflicts:r.conflicts?.[0]??"unknown")}},"validateConflictingOptions"),ca=_e(t=>{if(!Array.isArray(t.options))return;const e=new Map,n=new Map;for(const r of t.options){if(r.name){const o=e.get(r.name)??[];o.push(r),e.set(r.name,o)}if(typeof r.alias=="string"&&r.alias.length>0){const o=n.get(r.alias)??[];o.push(r),n.set(r.alias,o)}else if(Array.isArray(r.alias)){for(const o of r.alias)if(o.length>0){const l=n.get(o)??[];l.push(r),n.set(o,l)}}}const i=[];for(const[r,o]of e)o.length>1&&i.push(`Duplicate option name "${r}" in command "${t.name}": ${JSON.stringify(o)}`);for(const[r,o]of n)o.length>1&&i.push(`Duplicate option alias "-${r}" used by options ${o.map(l=>`"${l.name}"`).join(", ")} in command "${t.name}"`);if(i.length>0)throw new Error(i.join(`
5
- `))},"validateDuplicateOptions");var ua=Object.defineProperty,Ye=x((t,e)=>ua(t,"name",{value:e,configurable:!0}),"s$4");const pa=Ye((t,e)=>{if(e.length===0)return{argv:[],commandPath:void 0};const n=[];let i;for(let r=1;r<=e.length;r+=1){const o=e[r-1];if(o===void 0||o.startsWith("-"))break;n.push(o);const l=n.join(" ");t.has(l)&&(i={commandPath:[...n],depth:r})}return i?{argv:e.slice(i.depth),commandPath:i.commandPath}:{argv:e,commandPath:void 0}},"parseNestedCommand"),J=Ye(t=>t.join(" "),"getCommandPathKey"),xt=Ye((t,e)=>e&&e.length>0?[...e,t]:[t],"getFullCommandPath");var fa=Object.defineProperty,gn=x((t,e)=>fa(t,"name",{value:e,configurable:!0}),"i$5"),da=Object.defineProperty,vn=gn((t,e)=>da(t,"name",{value:e,configurable:!0}),"r"),ha=Object.defineProperty,ma=vn((t,e)=>ha(t,"name",{value:e,configurable:!0}),"c");let bn=class{static{N(this,"xt")}static{S(this,"xt")}static{x(this,"l")}static{gn(this,"y")}static{vn(this,"s")}static{ma(this,"LRUCache")}capacity;cache;keyOrder;constructor(t){this.capacity=t,this.cache=new Map,this.keyOrder=[]}get(t){if(this.cache.has(t))return this.keyOrder=this.keyOrder.filter(e=>e!==t),this.keyOrder.push(t),this.cache.get(t)}has(t){return this.cache.has(t)}set(t,e){if(this.cache.has(t))this.keyOrder=this.keyOrder.filter(n=>n!==t);else if(this.cache.size>=this.capacity){const n=this.keyOrder.shift();n!==void 0&&this.cache.delete(n)}this.cache.set(t,e),this.keyOrder.push(t)}delete(t){this.cache.delete(t),this.keyOrder=this.keyOrder.filter(e=>e!==t)}clear(){this.cache.clear(),this.keyOrder=[]}size(){return this.cache.size}};var ga=Object.defineProperty,va=x((t,e)=>ga(t,"name",{value:e,configurable:!0}),"r$5"),ba=Object.defineProperty,ya=va((t,e)=>ba(t,"name",{value:e,configurable:!0}),"a"),wa=Object.defineProperty,$a=ya((t,e)=>wa(t,"name",{value:e,configurable:!0}),"s");const Oa=$a((t,e)=>typeof t!="string"||t===""?"":(e?.locale?t[0].toLocaleLowerCase(e.locale):t[0].toLowerCase())+t.slice(1),"lowerFirst");var xa=Object.defineProperty,Pa=x((t,e)=>xa(t,"name",{value:e,configurable:!0}),"I"),Ea=Object.defineProperty,Le=Pa((t,e)=>Ea(t,"name",{value:e,configurable:!0}),"W");const Aa=no(import.meta.url),he=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Na=Le(t=>{if(typeof he<"u"&&he.versions&&he.versions.node){const[e,n]=he.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return he.getBuiltinModule(t)}return Aa(t)},"__cjs_getBuiltinModule"),{stripVTControlCharacters:Ca}=Na("node:util");var ja=Object.defineProperty,ka=Le((t,e)=>ja(t,"name",{value:e,configurable:!0}),"g");const Fe=new bn(1e3),_a=/[.*+?^${}()|[\]\\]/g,La=ka(t=>{const e=t.join("");if(Fe.has(e))return Fe.get(e);const n=t.map(r=>r.replaceAll(_a,String.raw`\$&`)).join("|"),i=new RegExp(n,"g");return Fe.set(e,i),i},"getSeparatorsRegex");var Sa=Object.defineProperty,Ta=Le((t,e)=>Sa(t,"name",{value:e,configurable:!0}),"t");const Ia=Ta(t=>{const e=[];let n=0,i;for(se.lastIndex=0;(i=se.exec(t))!==null;)i.index>n&&e.push(t.slice(n,i.index)),e.push(i[0]),n=se.lastIndex;return n<t.length&&e.push(t.slice(n)),e.filter(Boolean)},"splitByEmoji");var Ma=Object.defineProperty,j=Le((t,e)=>Ma(t,"name",{value:e,configurable:!0}),"u");const Va=/[ČŠŽĐ]/i,yn=new Uint8Array(128),wn=new Uint8Array(128),$n=new Uint8Array(128);for(let t=0;t<128;t++)yn[t]=t>=65&&t<=90?1:0,wn[t]=t>=97&&t<=122?1:0,$n[t]=t>=48&&t<=57?1:0;const ze=j(t=>yn[t],"isUpper"),Pt=j(t=>wn[t],"isLower"),We=j(t=>$n[t],"isDigit"),G=j((t,e,n,i,r)=>{if(t.length===0)return[];let o=!1;const l=Object.values(e);for(const g of l)if(g(t[0])){o=!0;break}if(!o&&!n)return[t];const s=[...t],p=[];let a=s[0],c="other";const d=Object.entries(e);for(const g of d){const[u,v]=g;if(v(s[0])){c=u;break}}let f=n&&i?s[0]===s[0].toLocaleUpperCase(i):!1;for(let g=1;g<s.length;g++){const u=s[g];let v="other";for(const O of d){const[E,h]=O;if(h(u)){v=E;break}}const w=n&&i?u===u.toLocaleUpperCase(i):!1;let y=!1;r?y=r(c,v,f,w,u,g,s):(c!==v&&c!=="other"&&v!=="other"&&(y=!0),n&&v!=="other"&&!f&&w&&(y=!0)),y?(p.push(a),a=u):a+=u,c=v,n&&(f=w)}return a&&a.length>0&&p.push(a),p.length>0?p:[t]},"handleScriptTransitions"),Da=j((t,e,n,i)=>{if(n.size===0)return e;for(const r of n)if(t.startsWith(r,e))return i.push(r),e+r.length;return e},"detectAndProcessAcronym"),On=j((t,e=new Set)=>{if(t.length===0)return[];if(t.toUpperCase()===t)return[t];let n=0;const i=[],r=t.length;for(let o=1;o<r;o++){const l=Da(t,n,e,i);if(l!==n){n=l,o=n-1;continue}const s=t.codePointAt(o-1),p=t.codePointAt(o),a=s&&s<128&&ze(s),c=p&&p<128&&ze(p),d=s&&s<128&&Pt(s),f=s&&s<128&&We(s),g=p&&p<128&&We(p);if(d&&c){i.push(t.slice(n,o)),n=o;continue}if(f&&!g||!f&&g){i.push(t.slice(n,o)),n=o;continue}if(g&&!f){let u=!1,v=!1;if(o+1<r){const w=t.codePointAt(o+1);u=w&&w<128&&ze(w),v=w&&w<128&&We(w)}if(!v&&u){i.push(t.slice(n,o),t.slice(o,o+1)),n=o+1;continue}}if(o+1<r){const u=t.codePointAt(o+1),v=u&&u<128&&Pt(u);if(a&&c&&v){const w=t.slice(n,o+1);e.has(w)||(i.push(t.slice(n,o)),n=o)}}}return n<r&&i.push(t.slice(n)),i.filter(o=>o!=="")},"splitCamelCaseFast"),xn=j((t,e,n)=>{if(t.length===0)return[];const i=t===t.toLocaleUpperCase(e);if(e.startsWith("de")){if(!i&&t.replaceAll("ß","SS")===t.toLocaleUpperCase(e))return[t];const a=[...t],c=a.length,d=[];let f=a[0],g=a[0]===a[0].toLocaleUpperCase(e),u=g,v=g?0:-1;for(let w=1;w<c;w++){const y=a[w],O=y===y.toLocaleUpperCase(e);if(O===g)f+=y;else if(O)f&&f.length>0&&(d.push(f),f=y),u=!0,v=w;else{if(u&&w-v>1){const E=a[w-1],h=f.slice(0,-1);h&&h.length>0&&d.push(h),f=E+y}else f+=y;u=!1,v=-1}g=O}return f&&f.length>0&&d.push(f),d}if(e.startsWith("uk")||e.startsWith("ru")||e.startsWith("bg")||e.startsWith("sr")||e.startsWith("mk")||e.startsWith("be")){if(!ie.test(t)&&!I.test(t))return[t];const a=[...t],c=a.length,d=[];let f=a[0];const g=a[0];let u;ie.test(g)?u=1:I.test(g)?u=2:u=0;let v=g===g.toLocaleUpperCase(e);for(let y=1;y<c;y++){const O=a[y];let E;ie.test(O)?E=1:I.test(O)?E=2:E=0;const h=O===O.toLocaleUpperCase(e);u!==E&&(u===1||u===2)&&(E===1||E===2)||E===u&&!v&&h?(d.push(f),f=O):f+=O,u=E,v=h}f&&f.length>0&&d.push(f);const w=[];for(let y=0;y<d.length;y++)y<d.length-1&&d[y].length===1&&I.test(d[y])&&ie.test(d[y+1][0])?(w.push(d[y]+d[y+1]),y+=1):w.push(d[y]);return w}if(e.startsWith("el")){if(!Ue.test(t)&&!I.test(t))return[t];const a=[];rt.lastIndex=0;let c;for(;(c=rt.exec(t))!==null;)a.push(c[0]);a.length===0&&a.push(t);const d=[];if(a.length===1){const f=a[0];if(!f||!Ue.test(f[0])||f.length===1)return[f??t]}for(const f of a){if(!f)continue;if(!Ue.test(f[0])||f.length===1){d.push(f);continue}const g=f.length;let u=f[0],v=f[0]===f[0].toLocaleUpperCase(e);for(let w=1;w<g;w++){const y=f[w],O=y===y.toLocaleUpperCase(e);!v&&O?(d.push(u),u=y):u+=y,v=O}u&&d.push(u)}return d}if(e.startsWith("ja")||e.startsWith("ko")){const a=e.startsWith("ja"),c=a?{hiragana:j(f=>Si.test(f),"hiragana"),kanji:j(f=>lt.test(f),"kanji"),katakana:j(f=>Ii.test(f),"katakana"),latin:j(f=>I.test(f),"latin")}:{hangul:j(f=>at.test(f),"hangul"),latin:j(f=>I.test(f),"latin")},d=new Set(["が","で","と","に","の","は","へ","も","や","を"]);if(a){const f=G(t,c,!1,e,(u,v)=>u==="hiragana"&&v==="katakana"||u==="katakana"&&v==="hiragana"||u==="hiragana"&&v==="latin"||u==="katakana"&&v==="latin"||u==="kanji"&&v==="latin"||u==="latin"&&(v==="hiragana"||v==="katakana"||v==="kanji")),g=[];for(const u of f){const v=u;v.length===1&&d.has(v)&&g.length>0?g[g.length-1]=g.at(-1)+v:g.push(v)}return g.length>0?g:[t]}return G(t,c,!1,e,(f,g)=>f==="hangul"&&g==="latin"||f==="latin"&&g==="hangul")}if(e.startsWith("sl")){const a=[...t],c=a.length,d=[];let f=a[0],g=a[0]===a[0].toLocaleUpperCase(e);for(let u=1;u<c;u++){const v=a[u],w=v===v.toLocaleUpperCase(e),y=Va.test(v),O=u<c-1&&a[u+1]===a[u+1].toLocaleUpperCase(e);!g&&w||y&&O?(d.push(f),f=v,y&&O&&(d.push(f),f="")):f+=v,g=w}return f&&f.length>0&&d.push(f),d}if(e.startsWith("zh"))return G(t,{han:j(a=>lt.test(a),"han"),latin:j(a=>I.test(a),"latin")},!1,e);if(["ar","fa","he","ur"].includes(e.split("-")[0])){const a=j(c=>st.test(c)||ot.test(c),"isRtlChar");return G(t,{latin:j(c=>I.test(c),"latin"),rtl:j(c=>a(c),"rtl")},!1,e)}if(["am","bn","gu","hi","km","kn","lo","ml","mr","ne","or","pa","si","ta","te","th"].includes(e.split("-")[0])){const a=j(c=>ji.test(c)||Ci.test(c)||_i.test(c)||Li.test(c)||Ti.test(c)||Fi.test(c)||zi.test(c)||Di.test(c)||Ri.test(c)||Wi.test(c)||Vi.test(c)||qi.test(c)||Ui.test(c)||ki.test(c)||Mi.test(c)||Bi.test(c),"isIndicChar");return G(t,{indic:j(c=>a(c),"indic"),latin:j(c=>I.test(c),"latin")},!1,e)}if(["be","bg","ru","sr","uk"].includes(e))return G(t,{cyrillic:j(a=>ie.test(a),"cyrillic"),latin:j(a=>I.test(a),"latin")},!0,e);if(["ar","fa","he"].includes(e))return G(t,{latin:j(a=>I.test(a),"latin"),rtl:j(a=>st.test(a)||ot.test(a),"rtl")},!1,e);if(e.startsWith("ko"))return G(t,{hangul:j(a=>at.test(a),"hangul"),latin:j(a=>I.test(a),"latin")},!1,e);if(e.startsWith("uz")){if(!ie.test(t)&&!I.test(t))return[t];const a=[...t],c=a.length,d=[];let f=a[0],g=a[0]===a[0].toLocaleUpperCase(e);for(let u=1;u<c;u++){const v=a[u],w=v===v.toLocaleUpperCase(e);if(ct.test(v)||ct.test(a[u-1])){f+=v;continue}!g&&w?(d.push(f),f=v):f+=v,g=w}return f&&f.length>0&&d.push(f),d}const r=[...t],o=r.length,l=[];let s=r[0],p=r[0]===r[0].toLocaleUpperCase(e);for(const a of n)if(t.startsWith(a)){l.push(a),s=r[a.length],p=s===s.toLocaleUpperCase(e);break}for(let a=1;a<o;a++){const c=r[a],d=c===c.toLocaleUpperCase(e);let f=0;for(const g of n)if(t.startsWith(g,a)){l.push(s,g),f=g.length,s="";const u=g.at(-1);u&&(p=u===u.toLocaleUpperCase(e));break}if(f>0){a+=f-1;continue}!p&&d?(l.push(s),s=c):s+=c,p=d}return s&&l.push(s),l},"splitCamelCaseLocale"),Ua=j((t,e,n)=>{const i=[],r=ve.test(t)?t.split(ve).filter(Boolean):[t];for(const o of r){const l=o;if(ve.test(l))i.push(l);else{const s=se.test(l)?Ia(l).filter(Boolean):[l];for(const p of s)if(se.test(p))i.push(p);else if(e){const a=e.toLowerCase().split("-")[0];i.push(...xn(p,a,n))}else i.push(...On(p,n))}}return i},"processTextWithAnsiEmoji"),Ba=j((t,e={})=>{if(!t||typeof t!="string")return[];const{handleAnsi:n=!1,handleEmoji:i=!1,knownAcronyms:r=[],locale:o,normalize:l=!1,separators:s,stripAnsi:p=!1,stripEmoji:a=!1}=e,c=new Set([...r].toSorted((y,O)=>O.length-y.length));let d=t;p&&(d=Ca(d)),a&&(d=Gi(d));let f;Array.isArray(s)?f=La(s):s instanceof RegExp?f=s:f=Ni;const g=[];let u=d;const v=f.flags.includes("g")?f:new RegExp(f.source,`${f.flags}g`);for(;u.length>0;){const y=v.exec(u);if(!y){u===".."?g.push(".."):u==="."?g.push("."):u.length>0&&g.push(u);break}const O=y.index,E=y[0],h=E.length,m=u.slice(0,O),b=u.slice(O+h);if(E.startsWith("../"))g.push(".."),u=u.slice(O+3);else if(E.startsWith("./"))g.push("."),u=u.slice(O+2);else if(O===0&&E==="..")g.push(".."),u=u.slice(2);else if(O===0&&E===".")g.push("."),u=u.slice(1);else{m.length>0&&g.push(m);let $=0;for(;($=E.indexOf("../",$))!==-1;)g.push(".."),$+=3;for($=0;($=E.indexOf("./",$))!==-1;)($===0||E[$-1]!==".")&&g.push("."),$+=2;let P=b;for(;P.startsWith("../");)g.push(".."),P=P.slice(3);for(;P.startsWith("./");)g.push("."),P=P.slice(2);if(P===".."){g.push("..");break}else if(P==="."){g.push(".");break}else u=P}v.lastIndex=0}if(g.length===0){const y=d.split(f).filter(Boolean);g.push(...y)}let w=[];for(const y of g)n||i?w.push(...Ua(y,o,c)):o?w.push(...xn(y,o,c)):w.push(...On(y,c));return l&&(w=w.map(y=>c.has(y)?y:o&&y===y.toLocaleUpperCase(o)?y[0]+y.slice(1).toLocaleLowerCase(o):y.toUpperCase()===y&&!c.has(y)?y.slice(0,1)+y.slice(1).toLowerCase():y)),w},"splitByCase");var Ra=Object.defineProperty,Fa=x((t,e)=>Ra(t,"name",{value:e,configurable:!0}),"r$4"),za=Object.defineProperty,Wa=Fa((t,e)=>za(t,"name",{value:e,configurable:!0}),"o"),qa=Object.defineProperty,Ga=Wa((t,e)=>qa(t,"name",{value:e,configurable:!0}),"s");const Ha=Ga((t,e)=>typeof t!="string"||t===""?"":(e?.locale?t[0].toLocaleUpperCase(e.locale):t[0].toUpperCase())+t.slice(1),"upperFirst");var Ka=Object.defineProperty,Ja=x((t,e)=>Ka(t,"name",{value:e,configurable:!0}),"r$3"),Za=Object.defineProperty,Ya=Ja((t,e)=>Za(t,"name",{value:e,configurable:!0}),"r"),Qa=Object.defineProperty,Xa=Ya((t,e)=>Qa(t,"name",{value:e,configurable:!0}),"n");const es=Xa((t,e)=>`${t}::${e?.joiner??""}::${e?.locale??""}::${e?.knownAcronyms?.join(",")??""}::${e?.normalize?"true":"false"}`,"generateCacheKey");var ts=Object.defineProperty,ns=x((t,e)=>ts(t,"name",{value:e,configurable:!0}),"i$3"),is=Object.defineProperty,os=ns((t,e)=>is(t,"name",{value:e,configurable:!0}),"f"),rs=Object.defineProperty,as=os((t,e)=>rs(t,"name",{value:e,configurable:!0}),"l");const ss=as((t,e)=>{const{length:n}=t;if(n===0)return"";if(n===1)return t[0];const i=[];let r="",o="";for(let l=0;l<n;l++){const s=t[l];if(ve.test(s)){r?(i.push(r+o+s),r="",o=""):(i.length>0&&i.push(e),r=s);continue}r?(o&&(o+=e),o+=s):(i.length>0&&i.push(e),i.push(s))}return i.join("")},"joinSegments");var ls=Object.defineProperty,cs=x((t,e)=>ls(t,"name",{value:e,configurable:!0}),"r$2"),us=Object.defineProperty,ps=cs((t,e)=>us(t,"name",{value:e,configurable:!0}),"a"),fs=Object.defineProperty,ds=ps((t,e)=>fs(t,"name",{value:e,configurable:!0}),"e");const hs=/(?<![a-zß])SS(?![a-z])/g,ms=ds(t=>t.replaceAll(hs,"ß"),"normalizeGermanEszett");var gs=Object.defineProperty,vs=x((t,e)=>gs(t,"name",{value:e,configurable:!0}),"c$2"),bs=Object.defineProperty,ys=vs((t,e)=>bs(t,"name",{value:e,configurable:!0}),"c"),ws=Object.defineProperty,$s=ys((t,e)=>ws(t,"name",{value:e,configurable:!0}),"o");const Os=new bn(1e3),Pn=$s((t,e)=>{if(typeof t!="string"||!t)return"";const n=e?.cache??!1,i=e?.cacheStore??Os;let r;if(n&&(r=es(t,e)),n&&r&&i.has(r))return i.get(r);let o=!0;const l=ss(Ba(t,{handleAnsi:e?.handleAnsi,handleEmoji:e?.handleEmoji,knownAcronyms:e?.knownAcronyms,locale:e?.locale,normalize:e?.normalize,separators:void 0,stripAnsi:e?.stripAnsi,stripEmoji:e?.stripEmoji}).map(s=>{if(e?.handleAnsi&&ve.test(s))return s;const p=e?.locale?.startsWith("de")?ms(s):s,a=e?.locale?p.toLocaleLowerCase(e.locale):p.toLowerCase();return o?(o=!1,Oa(a,e)):Ha(a,e)}),"");return n&&r&&i.set(r,l),l},"camelCase");var xs=Object.defineProperty,Se=x((t,e)=>xs(t,"name",{value:e,configurable:!0}),"a$2");const Ps=Se(t=>{t.options?.forEach(e=>{e.__camelCaseName__=Pn(e.name)})},"processOptionNames"),Es=Se(t=>{if(!Array.isArray(t.options)||t.options.length===0)return;const e=new Set;for(const i of t.options)e.add(i.name);const n=[];for(const i of t.options)if(i.name.startsWith("no-")){const r=i.name.replace("no-","");if(!e.has(r)){if(i.type!==Boolean)throw new Error(`Cannot add negated option "${i.name}" to command "${t.name}" because it is not a boolean.`);const o={...i,defaultValue:i.defaultValue===void 0?!0:!i.defaultValue,name:r};n.push(o),e.add(r)}}n.length>0&&t.options.push(...n)},"addNegatableOptions"),As=Se((t,e)=>{if(!e.options||e.options.length===0)return;const{options:n}=t,i=new Map;for(const o of e.options)if(o.name.startsWith("no-")){const l=Pn(o.name);i.set(l,o)}const r=Object.keys(n).filter(o=>i.has(o));if(r.length!==0)for(const o of r){const l=o.charAt(2);if(!l)continue;const s=l.toLowerCase()+o.slice(3),p=i.get(o);p&&(p.__negated__=!0),n[s]=!n[o],Reflect.deleteProperty(n,o)}},"mapNegatableOptions"),Ns=Se((t,e)=>{if(!e.options||e.options.length===0)return;const n=new Map;for(const r of e.options)r.__camelCaseName__&&r.__negated__===void 0&&r.implies!==void 0&&n.set(r.__camelCaseName__,r);if(n.size===0)return;const{options:i}=t;for(const r of Object.keys(i)){const o=n.get(r);if(o?.implies){const{implies:l}=o;for(const[s,p]of Object.entries(l))i[s]===void 0&&(i[s]=p)}}},"mapImpliedOptions");var Cs=Object.defineProperty,Te=x((t,e)=>Cs(t,"name",{value:e,configurable:!0}),"e$2");const js=Te(()=>!!process.versions.electron,"isElectronApp"),ks=Te(()=>js()&&!process.defaultApp,"isBundledElectronApp"),_s=Te(()=>ks()?0:1,"getProcessArgvBinIndex"),Ls=Te(t=>t.slice(_s()+1),"hideBin");var Ss=Object.defineProperty,En=x((t,e)=>Ss(t,"name",{value:e,configurable:!0}),"e$1");const Ts=" ",Is=En((t,e)=>t===e?!0:t.length!==e.length?!1:t.every((n,i)=>n===e[i]),"equals"),Ms=En(t=>{if(typeof t=="string")return t.split(Ts);const e=Pe();return Is(t,e)?Ls(t):t},"parseRawCommand");var Vs=Object.defineProperty,qe=x((t,e)=>Vs(t,"name",{value:e,configurable:!0}),"r");const Ds=qe(t=>{const e=qe(o=>{t.error(`Uncaught exception: ${o.message||o}`),o.stack&&t.error(o.stack),W(1)},"uncaughtExceptionHandler"),n=qe((o,l)=>{if(o instanceof Error)t.error(`Promise rejection: ${o.message||o}`),o.stack&&t.error(o.stack);else{let s;if(typeof o=="string")s=o;else try{s=JSON.stringify(o)}catch{s=String(o)}t.error(`Promise rejection: ${s}`)}W(1)},"unhandledRejectionHandler"),i=nt("uncaughtException",e),r=nt("unhandledRejection",n);return()=>{i(),r()}},"registerExceptionHandler");var Us=Object.defineProperty,ue=x((t,e)=>Us(t,"name",{value:e,configurable:!0}),"e");const Ee=100,An=/^[a-z][\w-]*$/i,Ae=ue((t,e)=>{if(typeof t!="string"||t.trim().length===0)throw new A(`${e} must be a non-empty string`,"INVALID_INPUT",{fieldName:e,value:t});return t.trim()},"validateNonEmptyString"),Et=ue((t,e)=>{if(!Array.isArray(t)||!t.every(n=>typeof n=="string"))throw new A(`${e} must be an array of strings`,"INVALID_INPUT",{fieldName:e,value:t});return t},"validateStringArray");ue((t,e)=>{if(typeof t!="function")throw new A(`${e} must be a function`,"INVALID_INPUT",{fieldName:e,value:t});return t},"validateFunction");const Ge=ue((t,e)=>{if(typeof t!="object"||t===null)throw new A(`${e} must be an object`,"INVALID_INPUT",{fieldName:e,value:t});return t},"validateObject"),$e=ue(t=>{const e=Ae(t,"Command name");if(e.length>Ee)throw new A(`Command name is too long (maximum ${String(Ee)} characters)`,"INVALID_COMMAND_NAME",{commandName:e,length:e.length});if(e.includes("..")||e.includes("/")||e.includes("\\")||e.includes(";")||e.includes("|")||e.includes("&"))throw new A(`Command name "${e}" contains invalid characters`,"INVALID_COMMAND_NAME",{commandName:e});if(!An.test(e))throw new A(`Command name "${e}" must start with a letter and contain only letters, numbers, hyphens, and underscores`,"INVALID_COMMAND_NAME",{commandName:e});return e},"validateCommandName");ue(t=>{const e=Ae(t,"Plugin name");if(e.length>Ee)throw new A(`Plugin name is too long (maximum ${String(Ee)} characters)`,"INVALID_PLUGIN_NAME",{length:e.length,pluginName:e});if(e.includes("..")||e.includes("/")||e.includes("\\")||e.includes(";")||e.includes("|")||e.includes("&"))throw new A(`Plugin name "${e}" contains invalid characters`,"INVALID_PLUGIN_NAME",{pluginName:e});if(!An.test(e))throw new A(`Plugin name "${e}" must start with a letter and contain only letters, numbers, hyphens, and underscores`,"INVALID_PLUGIN_NAME",{pluginName:e});return e},"validatePluginName");var Bs=Object.defineProperty,Ie=x((t,e)=>Bs(t,"name",{value:e,configurable:!0}),"s");const Rs=new Set([`
6
- `,"\r"," ","\0",'"',"$","&","'","(",")",";","<",">","[","\\","]","`","{","|","}"]),Fs=/^[A-Z]:/i,zs=Ie(t=>{if(typeof t!="string")throw new TypeError("Argument must be a string");if(t.length>1e4)throw new Error(`Argument is too long (maximum ${String(1e4)} characters)`);for(const e of t)if(Rs.has(e))throw new Error(`Argument contains dangerous character: ${e}`);return t.trim()},"sanitizeArgument"),At=Ie(t=>{if(!Array.isArray(t))throw new TypeError("Arguments must be an array");if(t.length>100)throw new Error(`Too many arguments (maximum ${String(100)})`);return t.map(e=>zs(e))},"sanitizeArguments");Ie(t=>{if(typeof t!="string")throw new TypeError("Path must be a string");const e=t.trim();if(e.includes("..")||e.includes("../")||e.includes("..\\"))throw new Error("Path contains directory traversal sequences");if(e.startsWith("/")||Fs.test(e))throw new Error("Absolute paths are not allowed");if(e.length>1e3)throw new Error("Path is too long");return e},"validateSafePath");class Gc{static{N(this,"$s")}static{S(this,"Ir")}static{x(this,"RateLimiter")}static{Ie(this,"RateLimiter")}attempts=new Map;maxAttempts;windowMs;constructor(e=5,n=6e4){if(e<=0||n<=0)throw new Error("maxAttempts and windowMs must be positive numbers");this.maxAttempts=e,this.windowMs=n}checkLimit(e){const n=Date.now(),i=this.attempts.get(e);return!i||n>i.resetTime?(this.attempts.set(e,{count:1,resetTime:n+this.windowMs}),this.cleanup(n),!0):i.count>=this.maxAttempts?!1:(i.count+=1,!0)}reset(e){this.attempts.delete(e)}cleanup(e){for(const[n,i]of this.attempts.entries())e>i.resetTime&&this.attempts.delete(n)}}var Ws=Object.defineProperty,D=x((t,e)=>Ws(t,"name",{value:e,configurable:!0}),"b");const qs=/^-([^\d-])$/,Gs=/^--(\S+)/,Hs=/^-([^\d-]{2,})$/,He=D(t=>qs.test(t)||Gs.test(t)||Hs.test(t),"isOption"),Ks={access:D((t,e)=>to(t,e),"access"),mkdir:D((t,e)=>eo(t,e),"mkdir"),readdir:D(t=>Xi(t),"readdir"),readFile:D((async(t,e)=>e===void 0?ut(t):ut(t,e)),"readFile"),rm:D((t,e)=>Qi(t,e),"rm"),stat:D(t=>Yi(t),"stat"),writeFile:D((t,e,n)=>Zi(t,e,n),"writeFile")};let Js=class Nn{static{N(this,"Ie")}static{S(this,"Dt")}static{x(this,"Cli")}static{D(this,"Cli")}#t;#e;#c;#u;#f;#d;#y;#w;#$;#O;#x;#p;#n;#i;#o;#r;#a;#h=!1;#P;#E=!1;#m;#g;#v;#l=[];#k(){return this.#m===void 0&&(this.#m=[...this.#i.keys()]),this.#m}#A(){return this.#g===void 0&&(this.#g=[...this.#n.keys()]),this.#g}#s(){return this.#v===void 0&&(this.#v=[...this.#k(),...this.#A()]),this.#v}#N(){return this.#l.length===0?we:[...we,...this.#l]}#C(){this.#m=void 0,this.#g=void 0,this.#v=void 0}#b(){if(this.#c===void 0){const e=Ms(this.#e.argv);this.#c=At(e),this.#_()}return this.#c}#_(){if(!this.#c)return;const e=H();let n=!1;for(const i of this.#c){if(i==="--quiet"||i==="-q"){e.CEREBRO_OUTPUT_LEVEL=String(Gn),n=!0;break}if(i==="--verbose"||i==="-v"){e.CEREBRO_OUTPUT_LEVEL=String(Hn),n=!0;break}if(i==="--debug"||i==="-vvv"){e.CEREBRO_OUTPUT_LEVEL=String(re),n=!0;break}}n||(e.CEREBRO_OUTPUT_LEVEL=Object.hasOwn(e,"DEBUG")?String(re):String(tt))}#L(){this.#E||(this.#P=Ds(this.#t),this.#E=!0)}#S(){return{arch:pi(),argv:this.#b(),cwd:this.#u,env:this.#O??H(),exit:this.#$??(e=>W(e??0)),platform:ui(),stdin:this.#x}}#j(e,n,i,r){this.#t.debug(`command '${r}' found, parsing command args: ${n.join(", ")}`);const{arguments_:o,booleanValues:l,parsedArgs:s}=Yr(e,n,this.#N()),p=Object.keys(l).length>0;let a=s;p&&(a={...s,_all:{...s._all,...l}}),sa(o,a,e);const c=Zr(e,s,l,i);c.runtime=this,c.argv=this.#b(),c.fs=this.#w??Ks,c.process=this.#S(),c.console=this.#t;const d=e.options&&e.options.length>0;if(d&&e.options){const f=e.options.filter(g=>g.name.startsWith("no-"));for(const g of f){const u=g.name.replace("no-",""),v=`--${g.name}`,w=`--${u}`,y=n.includes(v),O=n.includes(w);if(y&&O)throw new qt(u,g.name)}}return d&&(As(c,e),Ns(c,e)),la(o,c.options,e),H().CEREBRO_OUTPUT_LEVEL===String(re)&&(this.#t.debug("command options parsed from options:"),this.#t.debug(JSON.stringify(c.options,null,2)),this.#t.debug("command argument parsed from argument:"),this.#t.debug(JSON.stringify(c.argument,null,2))),{arguments_:o,booleanValues:l,commandArgs:a,parsedArgs:s,toolbox:c}}constructor(e,n={}){if(typeof e!="string"||e.trim().length===0)throw new A("CLI name must be a non-empty string","INVALID_INPUT",{cliName:e});this.#f=e.trim();const i=n.argv??Pe(),r=n.cwd??ci();if(this.#e={...n,argv:i,cwd:r},this.#e.argv&&!Array.isArray(this.#e.argv))throw new A("CLI argv option must be an array of strings","INVALID_INPUT",{argv:this.#e.argv});if(this.#e.cwd&&typeof this.#e.cwd!="string")throw new A("CLI cwd option must be a string","INVALID_INPUT",{cwd:this.#e.cwd});if(this.#e.packageName&&typeof this.#e.packageName!="string")throw new A("CLI packageName option must be a string","INVALID_INPUT",{packageName:this.#e.packageName});if(this.#e.packageVersion&&typeof this.#e.packageVersion!="string")throw new A("CLI packageVersion option must be a string","INVALID_INPUT",{packageVersion:this.#e.packageVersion});const o=H();if(o.CEREBRO_OUTPUT_LEVEL=String(tt),typeof this.#e.logger=="object"){const c=["debug","error","info","log","warn"],d=[],f=this.#e.logger;for(const g of c)typeof f[g]!="function"&&d.push(g);if(d.length>0)throw new A(`Logger object is missing required methods: ${d.join(", ")}`,"INVALID_INPUT",{logger:this.#e.logger,missingMethods:d});this.#t=this.#e.logger}else this.#t={...console,debug:D((...c)=>{o.CEREBRO_OUTPUT_LEVEL===String(re)&&console.debug(...c)},"debug")};this.#d=this.#e.packageVersion,this.#y=this.#e.packageName,this.#u=this.#e.cwd,this.#r="help",this.#a={};const l=n.fs;if(l!==void 0&&(typeof l!="object"||l===null))throw new A("CLI fs option must be an object implementing the CerebroFs interface","INVALID_INPUT",{fs:n.fs});const s=n.exit;if(s!==void 0&&typeof s!="function")throw new A("CLI exit option must be a function","INVALID_INPUT",{exit:n.exit});const p=n.env;if(p!==void 0&&(typeof p!="object"||p===null))throw new A("CLI env option must be a record of string keys","INVALID_INPUT",{env:n.env});const a=n.stdin;if(a!==void 0&&typeof a!="string")throw new A("CLI stdin option must be a string","INVALID_INPUT",{stdin:n.stdin});this.#w=n.fs,this.#$=n.exit,this.#O=n.env,this.#x=n.stdin??"",this.#n=new Map,this.#i=new Map,this.#o=new Map}setCommandSection(e){return this.#a=e,this}getCommandSection(){return this.#a.header||(this.#a.header=`${this.#f}${this.#d?` v${this.#d}`:""}`),this.#a}setDefaultCommand(e){return this.#r=e,this}get defaultCommand(){return this.#r}addCommand(e){Ge(e,"Command"),$e(e.name);const n=typeof e.execute=="function",i=typeof e.loader=="function";if(n&&i)throw new A(`Command "${e.name}" cannot define both "execute" and "loader" — choose one`,"INVALID_COMMAND",{commandName:e.name});if(!n&&!i)throw new A(`Command "${e.name}" must define either "execute" or "loader"`,"INVALID_COMMAND",{commandName:e.name});e.alias&&(typeof e.alias=="string"?$e(e.alias):Et(e.alias,"Command alias").forEach(a=>$e(a))),e.argument&&Ge(e.argument,"Command argument"),e.options&&Ge(e.options,"Command options"),e.commandPath&&(Et(e.commandPath,"Command commandPath"),e.commandPath.forEach(a=>{$e(a)}));const r=xt(e.name,e.commandPath),o=J(r);if(this.#i.has(o))throw new A(`Command with path "${o}" already exists`,"DUPLICATE_COMMAND",{commandName:e.name,commandPath:e.commandPath});const l=Array.isArray(e.commandPath)&&e.commandPath.length>0,s=this.#n.get(e.name),p=s!==void 0&&(s.commandPath===void 0||s.commandPath.length===0);if(!l&&p)throw new A(`Command with name "${e.name}" already exists`,"DUPLICATE_COMMAND",{commandName:e.name});if(e.options)for(const a of e.options)ft(a);if(ca(e),Es(e),Ps(e),e.options&&(e.__conflictingOptions__=e.options.filter(a=>a.conflicts!==void 0),e.__requiredOptions__=e.options.filter(a=>a.required===!0)),l&&s!==void 0)this.#n.set(o,e);else{if(!l&&s!==void 0&&!p){const a=xt(s.name,s.commandPath);this.#n.set(J(a),s)}this.#n.set(e.name,e)}if(this.#i.set(o,r),this.#o.set(o,e),this.#C(),e.alias!==void 0){const a=typeof e.alias=="string"?[e.alias]:e.alias;for(const c of a){if(H().CEREBRO_OUTPUT_LEVEL===String(re)&&this.#t.debug("adding alias",c),this.#n.has(c))throw new A(`Command alias "${c}" conflicts with existing command`,"DUPLICATE_COMMAND",{alias:c,commandName:e.name});this.#n.set(c,e)}}return this}addGlobalOption(e){const n=e,i=new Set(we.map(o=>o.name)),r=new Set(we.map(o=>o.alias).filter(Boolean));if(i.has(n.name))throw new A(`Cannot add global option "--${n.name}": it conflicts with a built-in global option`,"DUPLICATE_OPTION",{optionName:n.name});if(n.alias&&r.has(n.alias))throw new A(`Cannot add global option with alias "-${n.alias}": it conflicts with a built-in global option alias`,"DUPLICATE_OPTION",{alias:n.alias,optionName:n.name});if(new Set(this.#l.map(o=>o.name)).has(n.name))throw new A(`Global option "--${n.name}" has already been added`,"DUPLICATE_OPTION",{optionName:n.name});return n.group="global",ft(n),this.#l.push(n),this}getGlobalOptions(){return this.#N()}addPlugin(e){return this.getPluginManager().register(e),this}getPluginManager(){return this.#p?this.#p:(this.#p=new po(this.#t),this.#p.register({description:"Attaches the logger to the toolbox",execute:D(e=>{e.logger=this.#t,e.console=e.logger},"execute"),name:"logger"}),this.#p)}getCliName(){return this.#f}getPackageVersion(){return this.#d}getPackageName(){return this.#y}getCommands(){return this.#n}getCwd(){return this.#u}dispose(){this.#P?.()}async run(e={}){const{autoDispose:n=!0,shouldExitProcess:i=!0,...r}=e;if(!this.#n.has("help")){const{default:m}=await import("../packem_chunks/help-command.js");this.addCommand(new m(this.#n))}const o=this.#A(),l=this.#i;this.#L();const s=this.#b();let p,a=[...s];const c=Bt(),d=Ut(),f=Pe();this.#t.debug(`process.execPath: ${c}`),this.#t.debug(`process.execArgv: ${d.join(" ")}`),this.#t.debug(`process.argv: ${f.join(" ")}`);const g=pa(l,[...s]);if(g.commandPath)p=g.commandPath,a=g.argv;else{if(s.length>1&&s[0]&&s[1]&&!He(s[0])&&!He(s[1])){const b=[];let $=0;for(;$<s.length;){const k=s[$];if(!k||He(k))break;b.push(k),$+=1}const P=J(b);if(b[0]&&!o.includes(b[0])){const k=this.#s(),C=Z(P,k);throw new K(P,C)}}let m;try{m=Oo([null,...o],[...s])}catch(b){if(b instanceof Error&&b.name==="INVALID_COMMAND"&&"command"in b){const $=b.command,P=this.#s(),k=Z($,P);throw new K($,k)}throw b}m.command&&(p=[m.command],a=m.argv)}if(!p)if(this.#r)p=[this.#r];else{const m=this.#s();throw new K("",m)}const u=J(p),v=this.#i.get(u);let w;if(v){if(w=this.#o.get(u),!w||J(v)!==u){const m=this.#s(),b=Z(u,m);throw new K(u,b)}}else{const m=p.at(-1);if(w=m?this.#n.get(m):void 0,!w){const b=this.#s(),$=Z(u,b);throw new K(u,$)}}if(typeof w.execute!="function"&&typeof w.loader!="function")return this.#t.error(`Command "${w.name}" has no function to execute.`),i?W(1):void 0;const y=a;let O,E;try{({commandArgs:O,toolbox:E}=this.#j(w,y,r,u))}catch(m){if(this.#t.error(m),i)return W(1);throw m}const h=this.getPluginManager();try{!this.#h&&h.hasPlugins()&&(await h.init({cli:this,cwd:this.#u,logger:this.#t}),this.#h=!0),await h.executeLifecycle("execute",E),await h.executeLifecycle("beforeCommand",E);let m;const b=O.global;if(b?.help){const $=this.#n.get("help");if(!$)throw new A("Help command not found","COMMAND_NOT_FOUND");m=await oe($,E,O)}else if(b?.version??b?.V){const $=this.#n.get("version");if(!$)throw new A("Version command not found","COMMAND_NOT_FOUND");m=await oe($,E,O)}else m=await oe(w,E,O);return await h.executeLifecycle("afterCommand",E,m),i?W(0):void 0}catch(m){throw await h.executeErrorHandlers(m,E),m}finally{n&&this.dispose()}}async runCommand(e,n={}){const{argv:i=[],...r}=n;Ae(e,"Command name");const o=e.split(" ").filter(Boolean),l=J(o),s=this.#i.get(l)?this.#o.get(l):this.#n.get(e);if(!s){const f=this.#s(),g=Z(l||e,f);throw new K(e,g)}if(typeof s.execute!="function"&&typeof s.loader!="function")throw new A(`Command "${s.name}" has no function to execute`,"INVALID_COMMAND",{commandName:s.name});const p=[...At(i)];this.#t.debug(`running command '${e}' programmatically with args: ${p.join(", ")}`);const{commandArgs:a,toolbox:c}=this.#j(s,p,r,l||e),d=this.getPluginManager();try{!this.#h&&d.hasPlugins()&&(await d.init({cli:this,cwd:this.#u,logger:this.#t}),this.#h=!0),await d.executeLifecycle("execute",c),await d.executeLifecycle("beforeCommand",c);let f;const g=a.global;if(g?.help){const u=this.#n.get("help");if(!u)throw new A("Help command not found","COMMAND_NOT_FOUND");f=await oe(u,c,a)}else if(g?.version??g?.V){const u=this.#n.get("version");if(!u)throw new A("Version command not found","COMMAND_NOT_FOUND");f=await oe(u,c,a)}else f=await oe(s,c,a);return await d.executeLifecycle("afterCommand",c,f),f}catch(f){throw await d.executeErrorHandlers(f,c),f}}clone(e){const n={...this.#e,...e},i=new Nn(this.#f,n);for(const[r,o]of this.#n)i.#n.set(r,o);for(const[r,o]of this.#i)i.#i.set(r,[...o]);for(const[r,o]of this.#o)i.#o.set(r,o);for(const r of this.#l)i.#l.push(r);return i.#r=this.#r,i.#a={...this.#a},i.#C(),i}async getAction(e){Ae(e,"Command name");const n=e.split(" ").filter(Boolean),i=J(n),r=this.#i.get(i)?this.#o.get(i):this.#n.get(e);if(!r){const o=this.#s(),l=Z(i||e,o);throw new K(e,l)}if(typeof r.execute=="function")return r.execute;if(typeof r.loader=="function")return hn(r);throw new A(`Command "${r.name}" has no execute or loader defined`,"INVALID_COMMAND",{commandName:r.name})}};var Zs=Object.defineProperty,Ys=N((t,e)=>Zs(t,"name",{value:e,configurable:!0}),"e$1"),Qs=Object.defineProperty,Xs=Ys((t,e)=>Qs(t,"name",{value:e,configurable:!0}),"o"),el=Object.defineProperty,tl=Xs((t,e)=>el(t,"name",{value:e,configurable:!0}),"t");const Hc=tl((t,e)=>new Js(t,e),"createCerebro");var nl=Object.defineProperty,le=N((t,e)=>nl(t,"name",{value:e,configurable:!0}),"t$1");function il(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}N(il,"getDefaultExportFromCjs");le(il,"getDefaultExportFromCjs");function ol(t){return t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}N(ol,"getDefaultExportFromNamespaceIfPresent");le(ol,"getDefaultExportFromNamespaceIfPresent");function rl(t){return t&&Object.prototype.hasOwnProperty.call(t,"default")&&Object.keys(t).length===1?t.default:t}N(rl,"getDefaultExportFromNamespaceIfNotNamed");le(rl,"getDefaultExportFromNamespaceIfNotNamed");function al(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=le(N(function i(){var r=!1;try{r=this instanceof i}catch{}return r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)},"a"),"a");n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(n,i,r.get?r:{enumerable:!0,get:le(function(){return t[i]},"get")})}),n}N(al,"getAugmentedNamespace");le(al,"getAugmentedNamespace");var sl=Object.defineProperty,ll=N((t,e)=>sl(t,"name",{value:e,configurable:!0}),"r$1"),cl=Object.defineProperty,ul=ll((t,e)=>cl(t,"name",{value:e,configurable:!0}),"r"),pl=Object.defineProperty,fl=ul((t,e)=>pl(t,"name",{value:e,configurable:!0}),"o");const Kc=fl(()=>{try{const t=require("node:module");if(typeof t.enableCompileCache=="function"){t.enableCompileCache();return}}catch{}try{require("v8-compile-cache")}catch{}},"enableCompileCache");var dl=Object.defineProperty,hl=N((t,e)=>dl(t,"name",{value:e,configurable:!0}),"u$2"),ml=Object.defineProperty,Cn=hl((t,e)=>ml(t,"name",{value:e,configurable:!0}),"p");const gl=Je(import.meta.url),me=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,jn=Cn(t=>{if(typeof me<"u"&&me.versions&&me.versions.node){const[e,n]=me.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return me.getBuiltinModule(t)}return gl(t)},"__cjs_getBuiltinModule"),{execFileSync:vl}=jn("node:child_process"),{totalmem:bl}=jn("node:os");var yl=Object.defineProperty,Me=Cn((t,e)=>yl(t,"name",{value:e,configurable:!0}),"r");const wl=/--max-old-space-size=(\d+)/,$l=/--max-semi-space-size=(\d+)/,Ol=Me(t=>Math.floor(bl()/1024/1024*t),"getDefaultMaxOldSpaceSize"),xl=Me(t=>t<=512?4:t<=1024?8:t<=2048?16:t<=4096?32:t<=8192?64:Math.floor(Math.log2(t))*8,"getSemiSpaceSize"),Nt=Me((t,e)=>{for(const n of e){const i=t.exec(n);if(i)return Number.parseInt(i[1],10)}},"extractFlag"),Jc=Me(t=>{const e=t?.maxOldSpacePercent??.75,n=[...Ut()],i=[...Pe()],r=Nt(wl,n),o=Nt($l,n);if(r!==void 0&&o!==void 0)return;const l=r??Ol(e),s=o??xl(l),p=[];if(r===void 0&&p.push(`--max-old-space-size=${String(l)}`),o===void 0&&p.push(`--max-semi-space-size=${String(s)}`),p.length!==0)try{vl(Bt(),[...p,...n,...i.slice(1)],{env:H(),stdio:"inherit"}),W(0)}catch(a){const c=a.status;W(typeof c=="number"?c:1)}},"applyHeapTuning");var Pl=Object.defineProperty,El=N((t,e)=>Pl(t,"name",{value:e,configurable:!0}),"T"),Al=Object.defineProperty,Ve=El((t,e)=>Al(t,"name",{value:e,configurable:!0}),"N");const Nl=Je(import.meta.url),ge=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Cl=Ve(t=>{if(typeof ge<"u"&&ge.versions&&ge.versions.node){const[e,n]=ge.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return ge.getBuiltinModule(t)}return Nl(t)},"__cjs_getBuiltinModule"),{createRequire:jl}=Cl("node:module");var kl=Object.defineProperty,_l=Ve((t,e)=>kl(t,"name",{value:e,configurable:!0}),"A$2"),Ll=Object.defineProperty,Qe=_l((t,e)=>Ll(t,"name",{value:e,configurable:!0}),"$"),Sl=Object.defineProperty,Tl=Qe((t,e)=>Sl(t,"name",{value:e,configurable:!0}),"r$1");const Il=Tl(t=>t.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
7
- `),"normalizeLF"),Ml=globalThis.process??Object.create(null),Ct={versions:{}},jt=new Proxy(Ml,{get(t,e){if(e in t)return t[e];if(e in Ct)return Ct[e]}});var Vl=Object.defineProperty,Dl=Qe((t,e)=>Vl(t,"name",{value:e,configurable:!0}),"b");const Ul=Dl((t,e,n,i)=>{const r={column:0,line:-1,...t.start},o={...r,...t.end},l=r.line,s=r.column,p=o.line,a=o.column;let c=Math.max(l-(n+1),0),d=Math.min(e.length,p+i);l===-1&&(c=0),p===-1&&(d=e.length);const f=p-l,g={};if(f)for(let u=0;u<=f;u++){const v=u+l;if(!s)g[v]=!0;else if(u===0){const w=e[v-1]?.length;g[v]=[s,(w??0)-s+1]}else if(u===f)g[v]=[0,a];else{const w=e[v-u]?.length;g[v]=[0,w]}}else s===a?g[l]=s?[s,0]:!0:g[l]=[s,(a??0)-(s??0)];return{end:d,markerLines:g,start:c}},"getMarkerLines");var Bl=Object.defineProperty,Oe=Qe((t,e)=>Bl(t,"name",{value:e,configurable:!0}),"t");const Rl=jt.platform==="win32"&&!jt.env?.WT_SESSION?">":"❯",Fl=Oe((t,e,n)=>{const i={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...n,color:{gutter:Oe(u=>u,"gutter"),marker:Oe(u=>u,"marker"),message:Oe(u=>u,"message"),...n?.color}},r=typeof e.start.column=="number";let o=Il(t).split(`
8
- `);typeof i.tabWidth=="number"&&(o=o.map(u=>u.replaceAll(" "," ".repeat(i.tabWidth))));const{end:l,markerLines:s,start:p}=Ul(e,o,i.linesAbove,i.linesBelow),a=String(l).length,{gutter:c,marker:d,message:f}=i.color;let g=o.slice(p,l).map((u,v)=>{const w=p+1+v,y=s[w],O=` ${String(w)}`.slice(-a),E=!s[w+1],h=` ${O}${i.showGutter?" |":""}`;if(y){let m="";if(Array.isArray(y)){const b=u.replaceAll(/[^\t]/g," ").slice(0,Math.max(y[0]-1,0)),$=y[1]||1;m=[`
9
- `,i.prefix+c(h.replaceAll(/\d/g," "))," ",b,d("^").repeat($)].join(""),E&&i.message&&(m+=` ${f(i.message)}`)}return[i.prefix+d(Rl),c(h),u.length>0?` ${u}`:"",m].join("")}return`${i.prefix} ${c(h)}${u.length>0?` ${u}`:""}`}).join(`
10
- `);return i.message&&!r&&(g=`${i.prefix+" ".repeat(a+1)+i.message}
11
- ${g}`),g},"codeFrame");var zl=Object.defineProperty,Wl=Ve((t,e)=>zl(t,"name",{value:e,configurable:!0}),"x$1"),ql=Object.defineProperty,Gl=Wl((t,e)=>ql(t,"name",{value:e,configurable:!0}),"x"),Hl=Object.defineProperty,q=Gl((t,e)=>Hl(t,"name",{value:e,configurable:!0}),"u");const X=q((t,...e)=>{process.env.DEBUG&&process.env.DEBUG==="true"&&console.debug(`error:parse-stacktrace: ${t}`,...e)},"debugLog"),ee="<unknown>",Kl=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Jl=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,Zl=/(.*?):(\d+):(\d+)(?:\s<-\s.+:\d+:\d+)?/,Yl=/eval\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*<anonymous>?:(\d+)?:(\d+)/,Ql=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,Xl=/in\s(.*)\s\(at\s(.+)\)\sat/,ec=/^(?:.*@)?(.*):(\d+):(\d+)$/,tc=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,nc=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,ic=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,kt=/\(error: (.*)\)/,oc=/at\s/,rc=/^(\S+):(\d+):(\d+)$|^(\S+):(\d+)$/,ac=/\S*(?:Error: |AggregateError:)/,kn=/^Anonymous function$/,sc=/^\s*in\s.*/,lc=/^.*?\s*at\s.*/,cc=/^.*?\s*@.*|\[native code\]/,_n=q((t,e)=>{const n=t.includes("safari-extension"),i=t.includes("safari-web-extension");return n||i?[t.includes("@")?t.split("@")[0]:ee,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},"extractSafariExtensionDetails"),Ln=q((t,e)=>{const n=Zl.exec(e);n&&(t.file=n[1],t.line=+n[2],t.column=+n[3])},"parseMapped"),uc=q(t=>{const e=Xl.exec(t);if(e){X(`parse nested node error stack line: "${t}"`,`found: ${JSON.stringify(e)}`);const i=e[2].split(":");return{column:i[2]?+i[2]:void 0,file:i[0],line:i[1]?+i[1]:void 0,methodName:e[1]??ee,raw:t,type:void 0}}const n=Ql.exec(t);if(n){X(`parse node error stack line: "${t}"`,`found: ${JSON.stringify(n)}`);const i={column:n[4]?+n[4]:void 0,file:n[2]?n[2].replace(oc,""):void 0,line:n[3]?+n[3]:void 0,methodName:n[1]??ee,raw:t,type:t.startsWith("internal")?"internal":void 0};return Ln(i,`${n[2]}:${n[3]}:${n[4]}`),i}},"parseNode"),pc=q(t=>{const e=Kl.exec(t);if(e){X(`parse chrome error stack line: "${t}"`,`found: ${JSON.stringify(e)}`);const n=e[2]?.startsWith("native"),i=e[2]?.startsWith("eval")||e[1]?.startsWith("eval");let r,o;if(i){const a=Jl.exec(t);if(a){const c=rc.exec(a[1]);c?(e[2]=c[4]??c[1],e[3]=c[5]??c[2],e[4]=c[3]):a[2]&&(e[2]=a[1]),a[2]&&(r={column:a[4]?+a[4]:void 0,file:a[2],line:a[3]?+a[3]:void 0,methodName:"eval",raw:t,type:"eval"})}else{const c=Yl.exec(t);c&&(o={column:c[4]?+c[4]:void 0,file:c[2],line:c[3]?+c[3]:void 0},r={column:c[6]?+c[6]:void 0,file:c[1],line:c[5]?+c[5]:void 0,methodName:"eval",raw:c[0],type:"eval"})}}const[l,s]=_n(e[1]?e[1].replace(kn,"<anonymous>"):ee,e[2]),p={column:e[4]?+e[4]:void 0,evalOrigin:r,file:s,line:e[3]?+e[3]:void 0,methodName:l,raw:t,type:i?"eval":n?"native":void 0};return o?(p.column=o.column,p.file=o.file,p.line=o.line):Ln(p,`${s}:${e[3]}:${e[4]}`),p}},"parseChromium"),fc=q((t,e)=>{const n=tc.exec(t);if(n){X(`parse gecko error stack line: "${t}"`,`found: ${JSON.stringify(n)}`);const i=n[3]?.includes(" > eval"),r=i&&n[3]&&nc.exec(n[3]);let o;i&&r&&(n[3]=r[1],o={column:n[5]?+n[5]:void 0,file:n[3],line:n[4]?+n[4]:void 0,methodName:"eval",raw:t,type:"eval"},n[4]=r[2]);const[l,s]=_n(n[1]?n[1].replace(kn,"<anonymous>"):ee,n[3]);let p;(e?.type==="safari"||!i&&e?.type==="firefox")&&e.column?p=e.column:!i&&n[5]&&(p=+n[5]);let a;return(e?.type==="safari"||!i&&e?.type==="firefox")&&e.line?a=e.line:n[4]&&(a=+n[4]),{column:p,evalOrigin:o,file:s,line:a,methodName:l,raw:t,type:i?"eval":s.includes("[native code]")?"native":void 0}}},"parseGecko"),dc=q((t,e)=>{const n=ic.exec(t);if(!(n&&n[2].includes(" > eval"))&&n)return X(`parse firefox error stack line: "${t}"`,`found: ${JSON.stringify(n)}`),{column:n[4]?+n[4]:e?.column??void 0,file:n[2],line:n[3]?+n[3]:e?.line??void 0,methodName:n[1]||ee,raw:t,type:void 0}},"parseFirefox"),hc=q(t=>{const e=ec.exec(t);if(e)return X(`parse react android native error stack line: "${t}"`,`found: ${JSON.stringify(e)}`),{column:e[3]?+e[3]:void 0,file:e[1],line:e[2]?+e[2]:void 0,methodName:ee,raw:t,type:void 0}},"parseReactAndroidNative"),Sn=q((t,{filter:e,frameLimit:n=50}={})=>{const i=t;let r=(typeof i.stacktrace=="string"?i.stacktrace:t.stack??"").split(`
12
- `).map(o=>(kt.test(o)?o.replace(kt,"$1"):o).trim()).filter(o=>!ac.test(o)&&o!=="eval code");return e&&(r=r.filter(o=>e(o))),r=r.slice(0,n),r.reduce((o,l,s)=>{if(!l||l.length>1024)return o;let p;if(sc.test(l))p=uc(l);else if(lc.test(l))p=pc(l);else if(cc.test(l)){let a;if(s===0){const c=t,d=c.columnNumber,f=c.lineNumber,g=c.line,u=c.column;d||f?a={column:d,line:f,type:"firefox"}:(g||u)&&(a={column:u,line:g,type:"safari"})}p=dc(l,a)??fc(l,a)}else p=hc(l);return p?o.push(p):X(`parse error stack line: "${l}"`,"not parser found"),o},[])},"parseStacktrace");var mc=Object.defineProperty,gc=Ve((t,e)=>mc(t,"name",{value:e,configurable:!0}),"p"),vc=Object.defineProperty,Tn=gc((t,e)=>vc(t,"name",{value:e,configurable:!0}),"m");const bc=jl(import.meta.url),ae=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Xe=Tn(t=>{if(typeof ae<"u"&&ae.versions&&ae.versions.node){const[e,n]=ae.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return ae.getBuiltinModule(t)}return bc(t)},"__cjs_getBuiltinModule"),{existsSync:yc,readFileSync:wc}=Xe("node:fs"),{relative:$c}=Xe("node:path"),{cwd:Oc}=ae,{fileURLToPath:xc}=Xe("node:url");var Pc=Object.defineProperty,_=Tn((t,e)=>Pc(t,"name",{value:e,configurable:!0}),"o");const pe=_((t,e,n)=>n===0?t:e===" "?t+" ".repeat(n):t+" ".repeat(e*n),"getPrefix"),Ec=_((t,e)=>{const n=t.replace("async file:","file:");return $c(e,n.startsWith("file:")?xc(n):n)},"getRelativePath"),Ac=_((t,e,n)=>{if(e)return n.title(t.message);const i=t.message?`: ${t.message}`:"";return n.title(t.name+i)},"getTitleText"),In=_((t,{color:e,hideErrorTitle:n,indentation:i,prefix:r},o)=>`${pe(r,i,o)}${Ac(t,n,e)}
13
- `,"getMessage"),Mn=_((t,{color:e,indentation:n,prefix:i},r)=>{if(t.hint===void 0)return;const o=pe(i,n,r);let l="";if(Array.isArray(t.hint))for(const s of t.hint)l+=`${o+s}
14
- `;else l+=o+t.hint;return e.hint(l)},"getHint"),et=_((t,{color:e,cwd:n,displayShortPath:i,indentation:r,prefix:o},l=0)=>{const s=i?Ec(t.file,n):t.file,{fileLine:p,method:a}=e;return`${pe(o,r,l)}at ${t.methodName?`${a(t.methodName)} `:""}${p(s)}:${p(t.line?.toString()??"")}`},"getMainFrame"),Vn=_((t,{color:e,indentation:n,linesAbove:i,linesBelow:r,prefix:o,showGutter:l,showLineNumbers:s,tabWidth:p},a)=>{if(t.file===void 0)return;const c=t.file.replace("file://","");if(!yc(c))return;const d=wc(c,"utf8");return Fl(d,{start:{column:t.column,line:t.line}},{color:e,linesAbove:i,linesBelow:r,prefix:pe(o,n,a),showGutter:l,showLineNumbers:s,tabWidth:p})},"getCode"),Dn=_((t,e,n)=>{if(t.errors.length===0)return;let i=`${pe(e.prefix,e.indentation,n)}Errors:
15
-
16
- `,r=!0;for(const o of t.errors)r?r=!1:i+=`
17
-
18
- `,i+=Bn(o,{...e,framesMaxLimit:1,hideErrorCodeView:e.hideErrorErrorsCodeView},n+1);return`
19
- ${i}`},"getErrors"),Un=_((t,e,n)=>{let i=`${pe(e.prefix,e.indentation,n)}Caused by:
20
-
21
- `;const r=t.cause;i+=In(r,e,n);const o=Sn(r).shift(),l=Mn(r,e,n);if(l&&(i+=`${l}
22
- `),o&&(i+=et(o,e,n),!e.hideErrorCauseCodeView)){const s=Vn(o,e,n);s!==void 0&&(i+=`
23
- ${s}`)}if(r.cause)i+=`
24
- ${Un(r,e,n+1)}`;else if(r instanceof AggregateError){const s=Dn(r,e,n);s!==void 0&&(i+=`
25
- ${s}`)}return`
26
- ${i}`},"getCause"),Nc=_((t,e)=>(t.length>0?`
27
- `:"")+t.map(n=>et(n,e)).join(`
28
- `),"getStacktrace"),Bn=_((t,e,n)=>{const i={cwd:Oc(),displayShortPath:!1,filterStacktrace:void 0,framesMaxLimit:Number.POSITIVE_INFINITY,hideErrorCauseCodeView:!1,hideErrorCodeView:!1,hideErrorErrorsCodeView:!1,hideErrorTitle:!1,hideMessage:!1,indentation:4,linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,showLineNumbers:!0,tabWidth:4,...e,color:{fileLine:_(l=>l,"fileLine"),gutter:_(l=>l,"gutter"),hint:_(l=>l,"hint"),marker:_(l=>l,"marker"),message:_(l=>l,"message"),method:_(l=>l,"method"),title:_(l=>l,"title"),...e.color}},r=Sn(t,{filter:e.filterStacktrace,frameLimit:i.framesMaxLimit}),o=r.shift();return[e.hideMessage?void 0:In(t,i,n),Mn(t,i,n),o?et(o,i,n):void 0,o&&!i.hideErrorCodeView?Vn(o,i,n):void 0,t instanceof AggregateError?Dn(t,i,n):void 0,t.cause===void 0?void 0:Un(t,i,n),r.length>0?Nc(r,i):void 0].filter(Boolean).join(`
29
- `).replaceAll("\\","/")},"internalRenderError"),Cc=_((t,e={})=>{if(e.framesMaxLimit!==void 0&&e.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return Bn(t,e,0)},"renderError");var jc=Object.defineProperty,kc=N((t,e)=>jc(t,"name",{value:e,configurable:!0}),"i$1"),_c=Object.defineProperty,Lc=kc((t,e)=>_c(t,"name",{value:e,configurable:!0}),"n"),Sc=Object.defineProperty,_t=Lc((t,e)=>Sc(t,"name",{value:e,configurable:!0}),"n");const Zc=_t((t={})=>({description:"Enhanced error handling and reporting with beautiful code frames",name:"error-handler",onError:_t((e,n)=>{const{logger:i,runtime:r}=n,{detailed:o=!1,exitOnError:l=!0,formatter:s,logErrors:p=!0,renderOptions:a={}}=t;if(p)if(s)i.error(s(e));else if(o){const c=r.getCwd(),d=Cc(e,{cwd:c,hideErrorCodeView:!1,hideErrorTitle:!1,hideMessage:!1,linesAbove:2,linesBelow:3,...a});i.error(d)}else i.error(e);l&&W(1)},"handleError"),version:"1.0.0"}),"errorHandlerPlugin");var Tc="1.0.0-alpha.26";const Yc={version:Tc};var Ic=Object.defineProperty,Mc=N((t,e)=>Ic(t,"name",{value:e,configurable:!0}),"e");const Qc={argument:{description:"Package to execute (optionally with @version)",name:"package",type:String},description:"Execute a remote package without permanent installation",examples:[["vis dlx create-vite my-app","Scaffold a new project"],["vis dlx typescript@5.5.4 tsc --version","Run specific version"],["vis dlx -p cowsay -p lolcatjs -c 'echo hi | cowsay | lolcatjs'","Multiple packages with shell"],["vis install && vis dlx --offline typescript tsc --version","Hardened: pre-install + offline (no registry fetch on dlx)"]],group:"Run & Execute",loader:Mc(()=>import("../packem_chunks/handler9.js"),"loader"),name:"dlx",options:[{alias:"p",description:"Additional packages to install (repeatable)",multiple:!0,name:"package",type:String},{alias:"c",defaultValue:!1,description:"Execute within shell environment",name:"shell-mode",type:Boolean},{alias:"s",defaultValue:!1,description:"Suppress output except command results",name:"silent",type:Boolean},{defaultValue:!1,description:"Resolve from local store only — fail rather than fetch from the registry. Pair with `vis install` for hardened npx-style workflows.",name:"offline",type:Boolean}]};export{Jc as N,Hc as T,Qc as a,H as b,Rc as c,A as d,al as e,Fc as f,il as g,Kc as i,Yc as m,se as n,Zc as w};
@@ -1,2 +0,0 @@
1
- var Z=Object.defineProperty;var T=(e,r)=>Z(e,"name",{value:r,configurable:!0});var Q=Object.defineProperty,X=T((e,r)=>Q(e,"name",{value:r,configurable:!0}),"p$1"),ee=Object.defineProperty,re=X((e,r)=>ee(e,"name",{value:r,configurable:!0}),"C"),te=Object.defineProperty,v=re((e,r)=>te(e,"name",{value:r,configurable:!0}),"u");const ne=/^-{1,2}(no-color|no-colors|color=false|color=never)$/,oe=/^-{1,2}(color=256)$/,ie=/^-{1,2}(color=16m|color=full|color=truecolor)$/,ce=/^-{1,2}(color|colors|color=true|color=always)$/,ae=/-mono|dumb/i,ue=/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/,le=/-256(color)?$/i,se=/^screen|^tmux|^xterm|^vt[1-5]\d\d|^ansi|color|mintty|rxvt|cygwin|linux/i,Y=v(e=>{const r=globalThis,n=r.Deno!=null,o=r.process??r.Deno??{},l=o.argv??o.args??[],c=v(g=>{const j=l.indexOf("--"),w=l.findIndex(J=>g.test(J));return w!==-1&&(j===-1||w<j)},"oneOfFlags");let i={};try{i=n?o.env.toObject():o.env??{}}catch{}const O="FORCE_COLOR",z=O in i,b=i[O]??void 0,x=Object.prototype.toString.call(b).slice(8,-1)==="String",K=typeof b=="number";let f;if(b==="true"?f=1:b==="false"?f=0:x&&b.length===0?f=1:x&&b.length>0?f=Math.min(Number.parseInt(b,10),3):K&&(f=Math.min(b,3)),b!=="true"&&b!=="false"&&f!==void 0&&f<4)return f;if("NO_COLOR"in i||z&&f===0||c(ne))return 0;if(c(oe))return 2;if(c(ie))return 3;if(c(ce))return 1;const B=f??0;if("TF_BUILD"in i&&"AGENT_NAME"in i)return 1;if(i.TERM&&ae.test(i.TERM))return B;if((n?r.Deno.build.os:o.platform)==="win32")try{const g=(n?r.Deno.osRelease():o.os.release()).split(".");return Number(g[0])>=10&&Number(g[2])>=10586?Number(g[2])>=14931?3:2:1}catch{}if("CI"in i)return["GITEA_ACTIONS","CIRCLECI","GITHUB_WORKFLOW","GITHUB_ACTIONS"].some(g=>g in i)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(g=>g in i)||i.CI_NAME==="codeship"?1:B;if(i.TERMINAL_EMULATOR?.includes("JediTerm"))return 3;if("TEAMCITY_VERSION"in i)return ue.test(i.TEAMCITY_VERSION)?1:0;if(i.COLORTERM==="truecolor"||i.TERM==="xterm-kitty"||i.TERM==="xterm-ghostty"||i.TERM==="wezterm")return 3;if("TERM_PROGRAM"in i){const g=Number.parseInt((i.TERM_PROGRAM_VERSION??"").split(".")[0],10);if(i.TERM_PROGRAM==="iTerm.app")return g>=3?3:2;if(i.TERM_PROGRAM==="Apple_Terminal")return 2}if(le.test(i.TERM))return 2;let R;return n?R=e==="out"?r.Deno.stdout.isTerminal():r.Deno.stderr.isTerminal():"PM2_HOME"in i&&"pm_id"in i?R=!0:R=o[`std${e}`]&&"isTTY"in o[`std${e}`],R&&se.test(i.TERM)||"COLORTERM"in i?1:B},"isColorSupportedFactory"),ge=v(()=>Y("out"),"isStdoutColorSupported");v(()=>Y("err"),"isStderrColorSupported");var be=Object.defineProperty,V=T((e,r)=>be(e,"name",{value:r,configurable:!0}),"B"),fe=Object.defineProperty,p=V((e,r)=>fe(e,"name",{value:r,configurable:!0}),"u"),$e=Object.defineProperty,de=p((e,r)=>$e(e,"name",{value:r,configurable:!0}),"e$1");function M({onlyFirst:e=!1}={}){const r="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(r,e?void 0:"g")}T(M,"x");V(M,"N");p(M,"t$1");de(M,"ansiRegex");var pe=Object.defineProperty,me=p((e,r)=>pe(e,"name",{value:r,configurable:!0}),"n$1");const $=me((e,r,n)=>r>e?r:Math.min(e,n),"clamp");var he=Object.defineProperty,Oe=p((e,r)=>he(e,"name",{value:r,configurable:!0}),"a$1");const Re=/([a-f\d]{3,6})/i,Te=Oe(e=>{let[,r]=Re.exec(e)??[];const n=r?r.length:0;if(n===3){const l=r.charAt(0),c=r.charAt(1),i=r.charAt(2);r=l+l+c+c+i+i}else if(n!==6)return[0,0,0];const o=Number.parseInt(r,16);return[o>>16&255,o>>8&255,o&255]},"convertHexToRgb");var ve=Object.defineProperty,P=p((e,r)=>ve(e,"name",{value:r,configurable:!0}),"e");const W=P((e,r,n)=>e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/51)+6*Math.round(r/51)+Math.round(n/51),"rgbToAnsi256"),C=P(e=>{let r,n,o;if(e<8)return 30+e;if(e<16)return 90+(e-8);if(e>=232)r=n=o=((e-232)*10+8)/255;else{e-=16;const i=e%36;r=Math.floor(e/36)/5,n=Math.floor(i/6)/5,o=i%6/5}const l=Math.max(r,n,o)*2;if(l===0)return 30;const c=30+(Math.round(o)<<2|Math.round(n)<<1|Math.round(r));return l===2?c+60:c},"ansi256To16"),k=P((e,r,n)=>C(W(e,r,n)),"rgbToAnsi16");var ye=Object.defineProperty,s=p((e,r)=>ye(e,"name",{value:r,configurable:!0}),"b");const a=39,u=49,G=10,E=ge(),q={close:"",open:""},t=E>0?(e,r)=>({close:`\x1B[${String(r)}m`,open:`\x1B[${String(e)}m`}):()=>q,L=s(e=>(r,n,o)=>e(W(Number(r),Number(n),Number(o))),"createRgbFunction"),D=s(e=>r=>{const[n,o,l]=Te(r);return e(n,o,l)},"createHexFunction");let A=s(e=>t(`38;5;${String(e)}`,a),"createAnsi256"),N=s(e=>t(`48;5;${String(e)}`,u),"createBgAnsi256"),y=s((e,r,n)=>t(`38;2;${String(e)};${String(r)};${String(n)}`,a),"createRgb"),S=s((e,r,n)=>t(`48;2;${String(e)};${String(r)};${String(n)}`,u),"createBgRgb");E===1?(A=s(e=>t(C(Number(e)),a),"createAnsi256"),N=s(e=>t(C(Number(e))+G,u),"createBgAnsi256"),y=s((e,r,n)=>t(k(Number(e),Number(r),Number(n)),a),"createRgb"),S=s((e,r,n)=>t(k(Number(e),Number(r),Number(n))+G,u),"createBgRgb")):E===2&&(y=L(A),S=L(N));const F={bold:t(1,22),dim:t(2,22),hidden:t(8,28),inverse:t(7,27),italic:t(3,23),overline:t(53,55),reset:t(0,0),strike:t(9,29),strikethrough:t(9,29),underline:t(4,24),visible:q},H={bgBlack:t(40,u),bgBlackBright:t(100,u),bgBlue:t(44,u),bgBlueBright:t(104,u),bgCyan:t(46,u),bgCyanBright:t(106,u),bgGray:t(100,u),bgGreen:t(42,u),bgGreenBright:t(102,u),bgGrey:t(100,u),bgMagenta:t(45,u),bgMagentaBright:t(105,u),bgRed:t(41,u),bgRedBright:t(101,u),bgWhite:t(47,u),bgWhiteBright:t(107,u),bgYellow:t(43,u),bgYellowBright:t(103,u),black:t(30,a),blackBright:t(90,a),blue:t(34,a),blueBright:t(94,a),cyan:t(36,a),cyanBright:t(96,a),gray:t(90,a),green:t(32,a),greenBright:t(92,a),grey:t(90,a),magenta:t(35,a),magentaBright:t(95,a),red:t(31,a),redBright:t(91,a),white:t(37,a),whiteBright:t(97,a),yellow:t(33,a),yellowBright:t(93,a)},U={bg:s(e=>N($(e,0,255)),"bg"),bgHex:D(S),bgRgb:s((e,r,n)=>S($(e,0,255),$(r,0,255),$(n,0,255)),"bgRgb"),fg:s(e=>A($(e,0,255)),"fg"),hex:D(y),rgb:s((e,r,n)=>y($(e,0,255),$(r,0,255),$(n,0,255)),"rgb")};var Se=Object.defineProperty,Me=p((e,r)=>Se(e,"name",{value:r,configurable:!0}),"s");const Be=Me((e,r,n)=>{if(r==="")return e;let o=e.indexOf(r);if(o<0)return e;const l=r.length;let c=0,i="";for(;~o;)i+=e.slice(c,o)+n,c=o+l,o=e.indexOf(r,c);return i+e.slice(c)},"stringReplaceAll");var Ce=Object.defineProperty,h=p((e,r)=>Ce(e,"name",{value:r,configurable:!0}),"a");const d={};let _=null;const Ee=h((e,r,n)=>{if(!e)return"";let o;if(e.raw===void 0?o=String(e):o=String.raw(e,...r),o.includes("\x1B"))for(let l=n;l;l=l.props)o=Be(o,l.close,l.open);return o.includes(`
2
- `)&&(o=o.replace(/(\r*\n)/g,`${n.closeStack}$1${n.openStack}`)),n.openStack+o+n.closeStack},"wrapText"),I=h(({props:e},{close:r,open:n})=>{const o=(e?.openStack??"")+n,l=r+(e?.closeStack??""),c=h((i,...O)=>Ee(i,O,c.props),"style");return Object.setPrototypeOf(c,_),c.props={close:r,closeStack:l,open:n,openStack:o,props:e},c.open=o,c.close=l,c},"createStyle"),Ae=h(function(){const e=h(r=>String(r),"self");e.strip=r=>r.replaceAll(M(),"");for(const r in H)d[r]={get(){const n=I(this,H[r]);return Object.defineProperty(this,r,{value:n}),n}};for(const r in F)d[r]={get(){const n=I(this,F[r]);return Object.defineProperty(this,r,{value:n}),n}};return _=Object.defineProperties({},d),Object.setPrototypeOf(e,_),e},"Colorize");for(const e in U)d[e]={get(){return(...r)=>I(this,U[e](...r))}};d.ansi256=d.fg;d.bgAnsi256=d.bg;const m=new Ae,_e=m.bold,Ie=m.cyan,Pe=m.dim,xe=m.green,je=m.inverse,we=m.magenta,ke=m.red,Ge=m.yellow;export{ge as B,Pe as E,xe as I,je as N,we as P,ke as T,Ge as e,m as g,_e as j,Ie as q};
@@ -1 +0,0 @@
1
- var wt=Object.defineProperty;var h=(e,r)=>wt(e,"name",{value:r,configurable:!0});import{createRequire as $t}from"node:module";import{i as ur,M as se,K as lr,O as cr,$ as Lt}from"./readFileSync-CGmzMUF2-D6rUjGDn.js";import{g as St}from"./index-efSniSRN.js";import{whichBin as Nt,detectPackageManager as At,execPmCommandInteractive as Pt,resolveInstall as Tt,resolveAdd as jt,resolveRemove as Ct,resolveDedupe as qt,resolveWhy as Dt,resolveOutdated as Mt,resolveLink as _t,resolveUnlink as Gt,resolveDlx as Ft,resolveExec as Ut,resolvePmCommand as xt}from"#native";const Ot=$t(import.meta.url),K=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,It=h(e=>{if(typeof K<"u"&&K.versions&&K.versions.node){const[r,t]=K.versions.node.split(".").map(Number);if(r>22||r===22&&t>=3||r===20&&t>=16)return K.getBuiltinModule(e)}return Ot(e)},"__cjs_getBuiltinModule"),{spawn:yt,spawnSync:kt}=It("node:child_process");var me,br;function ie(){return br||(br=1,me=process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{}),me}h(ie,"requireDebug");var de,Rr;function re(){return Rr||(Rr=1,de={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}),de}h(re,"requireConstants");var ae={exports:{}},wr;function te(){return wr||(wr=1,(function(e,r){var t=Object.defineProperty,i=h((k,A)=>t(k,"name",{value:A,configurable:!0}),"O");const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:a,MAX_LENGTH:o}=re(),m=ie();r=e.exports={};const p=r.re=[],f=r.safeRe=[],u=r.src=[],l=r.safeSrc=[],s=r.t={};let c=0;const g="[a-zA-Z0-9-]",w=[["\\s",1],["\\d",o],[g,a]],N=i(k=>{for(const[A,M]of w)k=k.split(`${A}*`).join(`${A}{0,${M}}`).split(`${A}+`).join(`${A}{1,${M}}`);return k},"makeSafeRegex"),v=i((k,A,M)=>{const T=N(A),_=c++;m(k,_,A),s[k]=_,u[_]=A,l[_]=T,p[_]=new RegExp(A,M?"g":void 0),f[_]=new RegExp(T,M?"g":void 0)},"createToken");v("NUMERICIDENTIFIER","0|[1-9]\\d*"),v("NUMERICIDENTIFIERLOOSE","\\d+"),v("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${g}*`),v("MAINVERSION",`(${u[s.NUMERICIDENTIFIER]})\\.(${u[s.NUMERICIDENTIFIER]})\\.(${u[s.NUMERICIDENTIFIER]})`),v("MAINVERSIONLOOSE",`(${u[s.NUMERICIDENTIFIERLOOSE]})\\.(${u[s.NUMERICIDENTIFIERLOOSE]})\\.(${u[s.NUMERICIDENTIFIERLOOSE]})`),v("PRERELEASEIDENTIFIER",`(?:${u[s.NONNUMERICIDENTIFIER]}|${u[s.NUMERICIDENTIFIER]})`),v("PRERELEASEIDENTIFIERLOOSE",`(?:${u[s.NONNUMERICIDENTIFIER]}|${u[s.NUMERICIDENTIFIERLOOSE]})`),v("PRERELEASE",`(?:-(${u[s.PRERELEASEIDENTIFIER]}(?:\\.${u[s.PRERELEASEIDENTIFIER]})*))`),v("PRERELEASELOOSE",`(?:-?(${u[s.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[s.PRERELEASEIDENTIFIERLOOSE]})*))`),v("BUILDIDENTIFIER",`${g}+`),v("BUILD",`(?:\\+(${u[s.BUILDIDENTIFIER]}(?:\\.${u[s.BUILDIDENTIFIER]})*))`),v("FULLPLAIN",`v?${u[s.MAINVERSION]}${u[s.PRERELEASE]}?${u[s.BUILD]}?`),v("FULL",`^${u[s.FULLPLAIN]}$`),v("LOOSEPLAIN",`[v=\\s]*${u[s.MAINVERSIONLOOSE]}${u[s.PRERELEASELOOSE]}?${u[s.BUILD]}?`),v("LOOSE",`^${u[s.LOOSEPLAIN]}$`),v("GTLT","((?:<|>)?=?)"),v("XRANGEIDENTIFIERLOOSE",`${u[s.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),v("XRANGEIDENTIFIER",`${u[s.NUMERICIDENTIFIER]}|x|X|\\*`),v("XRANGEPLAIN",`[v=\\s]*(${u[s.XRANGEIDENTIFIER]})(?:\\.(${u[s.XRANGEIDENTIFIER]})(?:\\.(${u[s.XRANGEIDENTIFIER]})(?:${u[s.PRERELEASE]})?${u[s.BUILD]}?)?)?`),v("XRANGEPLAINLOOSE",`[v=\\s]*(${u[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[s.XRANGEIDENTIFIERLOOSE]})(?:${u[s.PRERELEASELOOSE]})?${u[s.BUILD]}?)?)?`),v("XRANGE",`^${u[s.GTLT]}\\s*${u[s.XRANGEPLAIN]}$`),v("XRANGELOOSE",`^${u[s.GTLT]}\\s*${u[s.XRANGEPLAINLOOSE]}$`),v("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),v("COERCE",`${u[s.COERCEPLAIN]}(?:$|[^\\d])`),v("COERCEFULL",u[s.COERCEPLAIN]+`(?:${u[s.PRERELEASE]})?(?:${u[s.BUILD]})?(?:$|[^\\d])`),v("COERCERTL",u[s.COERCE],!0),v("COERCERTLFULL",u[s.COERCEFULL],!0),v("LONETILDE","(?:~>?)"),v("TILDETRIM",`(\\s*)${u[s.LONETILDE]}\\s+`,!0),r.tildeTrimReplace="$1~",v("TILDE",`^${u[s.LONETILDE]}${u[s.XRANGEPLAIN]}$`),v("TILDELOOSE",`^${u[s.LONETILDE]}${u[s.XRANGEPLAINLOOSE]}$`),v("LONECARET","(?:\\^)"),v("CARETTRIM",`(\\s*)${u[s.LONECARET]}\\s+`,!0),r.caretTrimReplace="$1^",v("CARET",`^${u[s.LONECARET]}${u[s.XRANGEPLAIN]}$`),v("CARETLOOSE",`^${u[s.LONECARET]}${u[s.XRANGEPLAINLOOSE]}$`),v("COMPARATORLOOSE",`^${u[s.GTLT]}\\s*(${u[s.LOOSEPLAIN]})$|^$`),v("COMPARATOR",`^${u[s.GTLT]}\\s*(${u[s.FULLPLAIN]})$|^$`),v("COMPARATORTRIM",`(\\s*)${u[s.GTLT]}\\s*(${u[s.LOOSEPLAIN]}|${u[s.XRANGEPLAIN]})`,!0),r.comparatorTrimReplace="$1$2$3",v("HYPHENRANGE",`^\\s*(${u[s.XRANGEPLAIN]})\\s+-\\s+(${u[s.XRANGEPLAIN]})\\s*$`),v("HYPHENRANGELOOSE",`^\\s*(${u[s.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[s.XRANGEPLAINLOOSE]})\\s*$`),v("STAR","(<|>)?=?\\s*\\*"),v("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),v("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(ae,ae.exports)),ae.exports}h(te,"requireRe");var ve,$r;function pr(){if($r)return ve;$r=1;var e=Object.defineProperty,r=h((a,o)=>e(a,"name",{value:o,configurable:!0}),"t");const t=Object.freeze({loose:!0}),i=Object.freeze({});return ve=r(a=>a?typeof a!="object"?t:a:i,"parseOptions"),ve}h(pr,"requireParseOptions");var ge,Or;function ht(){if(Or)return ge;Or=1;var e=Object.defineProperty,r=h((a,o)=>e(a,"name",{value:o,configurable:!0}),"s");const t=/^[0-9]+$/,i=r((a,o)=>{if(typeof a=="number"&&typeof o=="number")return a===o?0:a<o?-1:1;const m=t.test(a),p=t.test(o);return m&&p&&(a=+a,o=+o),a===o?0:m&&!p?-1:p&&!m?1:a<o?-1:1},"compareIdentifiers"),n=r((a,o)=>i(o,a),"rcompareIdentifiers");return ge={compareIdentifiers:i,rcompareIdentifiers:n},ge}h(ht,"requireIdentifiers");var Ee,Ir;function G(){if(Ir)return Ee;Ir=1;var e=Object.defineProperty,r=h((u,l)=>e(u,"name",{value:l,configurable:!0}),"a");const t=ie(),{MAX_LENGTH:i,MAX_SAFE_INTEGER:n}=re(),{safeRe:a,t:o}=te(),m=pr(),{compareIdentifiers:p}=ht();class f{static{h(this,"SemVer")}static{r(this,"SemVer")}constructor(l,s){if(s=m(s),l instanceof f){if(l.loose===!!s.loose&&l.includePrerelease===!!s.includePrerelease)return l;l=l.version}else if(typeof l!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof l}".`);if(l.length>i)throw new TypeError(`version is longer than ${i} characters`);t("SemVer",l,s),this.options=s,this.loose=!!s.loose,this.includePrerelease=!!s.includePrerelease;const c=l.trim().match(s.loose?a[o.LOOSE]:a[o.FULL]);if(!c)throw new TypeError(`Invalid Version: ${l}`);if(this.raw=l,this.major=+c[1],this.minor=+c[2],this.patch=+c[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");c[4]?this.prerelease=c[4].split(".").map(g=>{if(/^[0-9]+$/.test(g)){const w=+g;if(w>=0&&w<n)return w}return g}):this.prerelease=[],this.build=c[5]?c[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(l){if(t("SemVer.compare",this.version,this.options,l),!(l instanceof f)){if(typeof l=="string"&&l===this.version)return 0;l=new f(l,this.options)}return l.version===this.version?0:this.compareMain(l)||this.comparePre(l)}compareMain(l){return l instanceof f||(l=new f(l,this.options)),this.major<l.major?-1:this.major>l.major?1:this.minor<l.minor?-1:this.minor>l.minor?1:this.patch<l.patch?-1:this.patch>l.patch?1:0}comparePre(l){if(l instanceof f||(l=new f(l,this.options)),this.prerelease.length&&!l.prerelease.length)return-1;if(!this.prerelease.length&&l.prerelease.length)return 1;if(!this.prerelease.length&&!l.prerelease.length)return 0;let s=0;do{const c=this.prerelease[s],g=l.prerelease[s];if(t("prerelease compare",s,c,g),c===void 0&&g===void 0)return 0;if(g===void 0)return 1;if(c===void 0)return-1;if(c!==g)return p(c,g)}while(++s)}compareBuild(l){l instanceof f||(l=new f(l,this.options));let s=0;do{const c=this.build[s],g=l.build[s];if(t("build compare",s,c,g),c===void 0&&g===void 0)return 0;if(g===void 0)return 1;if(c===void 0)return-1;if(c!==g)return p(c,g)}while(++s)}inc(l,s,c){if(l.startsWith("pre")){if(!s&&c===!1)throw new Error("invalid increment argument: identifier is empty");if(s){const g=`-${s}`.match(this.options.loose?a[o.PRERELEASELOOSE]:a[o.PRERELEASE]);if(!g||g[1]!==s)throw new Error(`invalid identifier: ${s}`)}}switch(l){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",s,c);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",s,c);break;case"prepatch":this.prerelease.length=0,this.inc("patch",s,c),this.inc("pre",s,c);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",s,c),this.inc("pre",s,c);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const g=Number(c)?1:0;if(this.prerelease.length===0)this.prerelease=[g];else{let w=this.prerelease.length;for(;--w>=0;)typeof this.prerelease[w]=="number"&&(this.prerelease[w]++,w=-2);if(w===-1){if(s===this.prerelease.join(".")&&c===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(g)}}if(s){let w=[s,g];c===!1&&(w=[s]),p(this.prerelease[0],s)===0?isNaN(this.prerelease[1])&&(this.prerelease=w):this.prerelease=w}break}default:throw new Error(`invalid increment argument: ${l}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Ee=f,Ee}h(G,"requireSemver$1");var be,yr;function W(){if(yr)return be;yr=1;var e=Object.defineProperty,r=h((n,a)=>e(n,"name",{value:a,configurable:!0}),"t");const t=G();return be=r((n,a,o=!1)=>{if(n instanceof t)return n;try{return new t(n,a)}catch(m){if(!o)return null;throw m}},"parse"),be}h(W,"requireParse");var Re,kr;function Xt(){if(kr)return Re;kr=1;var e=Object.defineProperty,r=h((n,a)=>e(n,"name",{value:a,configurable:!0}),"t");const t=W();return Re=r((n,a)=>{const o=t(n,a);return o?o.version:null},"valid"),Re}h(Xt,"requireValid$1");var we,Lr;function Vt(){if(Lr)return we;Lr=1;var e=Object.defineProperty,r=h((n,a)=>e(n,"name",{value:a,configurable:!0}),"t");const t=W();return we=r((n,a)=>{const o=t(n.trim().replace(/^[=v]+/,""),a);return o?o.version:null},"clean"),we}h(Vt,"requireClean");var $e,Sr;function Bt(){if(Sr)return $e;Sr=1;var e=Object.defineProperty,r=h((n,a)=>e(n,"name",{value:a,configurable:!0}),"u");const t=G();return $e=r((n,a,o,m,p)=>{typeof o=="string"&&(p=m,m=o,o=void 0);try{return new t(n instanceof t?n.version:n,o).inc(a,m,p).version}catch{return null}},"inc"),$e}h(Bt,"requireInc");var Oe,Nr;function Wt(){if(Nr)return Oe;Nr=1;var e=Object.defineProperty,r=h((n,a)=>e(n,"name",{value:a,configurable:!0}),"u");const t=W();return Oe=r((n,a)=>{const o=t(n,null,!0),m=t(a,null,!0),p=o.compare(m);if(p===0)return null;const f=p>0,u=f?o:m,l=f?m:o,s=!!u.prerelease.length;if(l.prerelease.length&&!s){if(!l.patch&&!l.minor)return"major";if(l.compareMain(u)===0)return l.minor&&!l.patch?"minor":"patch"}const c=s?"pre":"";return o.major!==m.major?c+"major":o.minor!==m.minor?c+"minor":o.patch!==m.patch?c+"patch":"prerelease"},"diff"),Oe}h(Wt,"requireDiff");var Ie,Ar;function Ht(){if(Ar)return Ie;Ar=1;var e=Object.defineProperty,r=h((n,a)=>e(n,"name",{value:a,configurable:!0}),"r");const t=G();return Ie=r((n,a)=>new t(n,a).major,"major"),Ie}h(Ht,"requireMajor");var ye,Pr;function Yt(){if(Pr)return ye;Pr=1;var e=Object.defineProperty,r=h((n,a)=>e(n,"name",{value:a,configurable:!0}),"r");const t=G();return ye=r((n,a)=>new t(n,a).minor,"minor"),ye}h(Yt,"requireMinor");var ke,Tr;function zt(){if(Tr)return ke;Tr=1;var e=Object.defineProperty,r=h((n,a)=>e(n,"name",{value:a,configurable:!0}),"t");const t=G();return ke=r((n,a)=>new t(n,a).patch,"patch"),ke}h(zt,"requirePatch");var Le,jr;function Jt(){if(jr)return Le;jr=1;var e=Object.defineProperty,r=h((n,a)=>e(n,"name",{value:a,configurable:!0}),"t");const t=W();return Le=r((n,a)=>{const o=t(n,a);return o&&o.prerelease.length?o.prerelease:null},"prerelease"),Le}h(Jt,"requirePrerelease");var Se,Cr;function X(){if(Cr)return Se;Cr=1;var e=Object.defineProperty,r=h((n,a)=>e(n,"name",{value:a,configurable:!0}),"c");const t=G();return Se=r((n,a,o)=>new t(n,o).compare(new t(a,o)),"compare"),Se}h(X,"requireCompare");var Ne,qr;function Zt(){if(qr)return Ne;qr=1;var e=Object.defineProperty,r=h((n,a)=>e(n,"name",{value:a,configurable:!0}),"o");const t=X();return Ne=r((n,a,o)=>t(a,n,o),"rcompare"),Ne}h(Zt,"requireRcompare");var Ae,Dr;function Kt(){if(Dr)return Ae;Dr=1;var e=Object.defineProperty,r=h((n,a)=>e(n,"name",{value:a,configurable:!0}),"r");const t=X();return Ae=r((n,a)=>t(n,a,!0),"compareLoose"),Ae}h(Kt,"requireCompareLoose");var Pe,Mr;function fr(){if(Mr)return Pe;Mr=1;var e=Object.defineProperty,r=h((n,a)=>e(n,"name",{value:a,configurable:!0}),"o");const t=G();return Pe=r((n,a,o)=>{const m=new t(n,o),p=new t(a,o);return m.compare(p)||m.compareBuild(p)},"compareBuild"),Pe}h(fr,"requireCompareBuild");var Te,_r;function Qt(){if(_r)return Te;_r=1;var e=Object.defineProperty,r=h((n,a)=>e(n,"name",{value:a,configurable:!0}),"e");const t=fr();return Te=r((n,a)=>n.sort((o,m)=>t(o,m,a)),"sort"),Te}h(Qt,"requireSort");var je,Gr;function en(){if(Gr)return je;Gr=1;var e=Object.defineProperty,r=h((n,a)=>e(n,"name",{value:a,configurable:!0}),"e");const t=fr();return je=r((n,a)=>n.sort((o,m)=>t(m,o,a)),"rsort"),je}h(en,"requireRsort");var Ce,Fr;function oe(){if(Fr)return Ce;Fr=1;var e=Object.defineProperty,r=h((n,a)=>e(n,"name",{value:a,configurable:!0}),"r");const t=X();return Ce=r((n,a,o)=>t(n,a,o)>0,"gt"),Ce}h(oe,"requireGt");var qe,Ur;function hr(){if(Ur)return qe;Ur=1;var e=Object.defineProperty,r=h((n,a)=>e(n,"name",{value:a,configurable:!0}),"r");const t=X();return qe=r((n,a,o)=>t(n,a,o)<0,"lt"),qe}h(hr,"requireLt");var De,xr;function mt(){if(xr)return De;xr=1;var e=Object.defineProperty,r=h((n,a)=>e(n,"name",{value:a,configurable:!0}),"r");const t=X();return De=r((n,a,o)=>t(n,a,o)===0,"eq"),De}h(mt,"requireEq");var Me,Xr;function dt(){if(Xr)return Me;Xr=1;var e=Object.defineProperty,r=h((n,a)=>e(n,"name",{value:a,configurable:!0}),"r");const t=X();return Me=r((n,a,o)=>t(n,a,o)!==0,"neq"),Me}h(dt,"requireNeq");var _e,Vr;function mr(){if(Vr)return _e;Vr=1;var e=Object.defineProperty,r=h((n,a)=>e(n,"name",{value:a,configurable:!0}),"r");const t=X();return _e=r((n,a,o)=>t(n,a,o)>=0,"gte"),_e}h(mr,"requireGte");var Ge,Br;function dr(){if(Br)return Ge;Br=1;var e=Object.defineProperty,r=h((n,a)=>e(n,"name",{value:a,configurable:!0}),"r");const t=X();return Ge=r((n,a,o)=>t(n,a,o)<=0,"lte"),Ge}h(dr,"requireLte");var Fe,Wr;function vt(){if(Wr)return Fe;Wr=1;var e=Object.defineProperty,r=h((f,u)=>e(f,"name",{value:u,configurable:!0}),"n");const t=mt(),i=dt(),n=oe(),a=mr(),o=hr(),m=dr();return Fe=r((f,u,l,s)=>{switch(u){case"===":return typeof f=="object"&&(f=f.version),typeof l=="object"&&(l=l.version),f===l;case"!==":return typeof f=="object"&&(f=f.version),typeof l=="object"&&(l=l.version),f!==l;case"":case"=":case"==":return t(f,l,s);case"!=":return i(f,l,s);case">":return n(f,l,s);case">=":return a(f,l,s);case"<":return o(f,l,s);case"<=":return m(f,l,s);default:throw new TypeError(`Invalid operator: ${u}`)}},"cmp"),Fe}h(vt,"requireCmp");var Ue,Hr;function rn(){if(Hr)return Ue;Hr=1;var e=Object.defineProperty,r=h((m,p)=>e(m,"name",{value:p,configurable:!0}),"u");const t=G(),i=W(),{safeRe:n,t:a}=te();return Ue=r((m,p)=>{if(m instanceof t)return m;if(typeof m=="number"&&(m=String(m)),typeof m!="string")return null;p=p||{};let f=null;if(!p.rtl)f=m.match(p.includePrerelease?n[a.COERCEFULL]:n[a.COERCE]);else{const w=p.includePrerelease?n[a.COERCERTLFULL]:n[a.COERCERTL];let N;for(;(N=w.exec(m))&&(!f||f.index+f[0].length!==m.length);)(!f||N.index+N[0].length!==f.index+f[0].length)&&(f=N),w.lastIndex=N.index+N[1].length+N[2].length;w.lastIndex=-1}if(f===null)return null;const u=f[2],l=f[3]||"0",s=f[4]||"0",c=p.includePrerelease&&f[5]?`-${f[5]}`:"",g=p.includePrerelease&&f[6]?`+${f[6]}`:"";return i(`${u}.${l}.${s}${c}${g}`,p)},"coerce"),Ue}h(rn,"requireCoerce");var xe,Yr;function tn(){if(Yr)return xe;Yr=1;var e=Object.defineProperty,r=h((f,u)=>e(f,"name",{value:u,configurable:!0}),"t");const t=W(),i=re(),n=G(),a=r((f,u,l)=>{if(!i.RELEASE_TYPES.includes(u))return null;const s=o(f,l);return s&&m(s,u)},"truncate"),o=r((f,u)=>{const l=f instanceof n?f.version:f;return t(l,u)},"cloneInputVersion"),m=r((f,u)=>{if(p(u))return f.version;switch(f.prerelease=[],u){case"major":f.minor=0,f.patch=0;break;case"minor":f.patch=0;break}return f.format()},"doTruncation"),p=r(f=>f.startsWith("pre"),"isPrerelease");return xe=a,xe}h(tn,"requireTruncate");var Xe,zr;function nn(){if(zr)return Xe;zr=1;var e=Object.defineProperty,r=h((i,n)=>e(i,"name",{value:n,configurable:!0}),"i");class t{static{h(this,"LRUCache")}static{r(this,"LRUCache")}constructor(){this.max=1e3,this.map=new Map}get(n){const a=this.map.get(n);if(a!==void 0)return this.map.delete(n),this.map.set(n,a),a}delete(n){return this.map.delete(n)}set(n,a){if(!this.delete(n)&&a!==void 0){if(this.map.size>=this.max){const o=this.map.keys().next().value;this.delete(o)}this.map.set(n,a)}return this}}return Xe=t,Xe}h(nn,"requireLrucache");var Ve,Jr;function V(){if(Jr)return Ve;Jr=1;var e=Object.defineProperty,r=h((E,d)=>e(E,"name",{value:d,configurable:!0}),"o");const t=/\s+/g;class i{static{h(this,"Range")}static{r(this,"Range")}constructor(d,$){if($=o($),d instanceof i)return d.loose===!!$.loose&&d.includePrerelease===!!$.includePrerelease?d:new i(d.raw,$);if(d instanceof m)return this.raw=d.value,this.set=[[d]],this.formatted=void 0,this;if(this.options=$,this.loose=!!$.loose,this.includePrerelease=!!$.includePrerelease,this.raw=d.trim().replace(t," "),this.set=this.raw.split("||").map(b=>this.parseRange(b.trim())).filter(b=>b.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const b=this.set[0];if(this.set=this.set.filter(O=>!v(O[0])),this.set.length===0)this.set=[b];else if(this.set.length>1){for(const O of this.set)if(O.length===1&&k(O[0])){this.set=[O];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let d=0;d<this.set.length;d++){d>0&&(this.formatted+="||");const $=this.set[d];for(let b=0;b<$.length;b++)b>0&&(this.formatted+=" "),this.formatted+=$[b].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(d){const $=((this.options.includePrerelease&&w)|(this.options.loose&&N))+":"+d,b=a.get($);if(b)return b;const O=this.options.loose,R=O?u[l.HYPHENRANGELOOSE]:u[l.HYPHENRANGE];d=d.replace(R,fe(this.options.includePrerelease)),p("hyphen replace",d),d=d.replace(u[l.COMPARATORTRIM],s),p("comparator trim",d),d=d.replace(u[l.TILDETRIM],c),p("tilde trim",d),d=d.replace(u[l.CARETTRIM],g),p("caret trim",d);let I=d.split(" ").map(q=>M(q,this.options)).join(" ").split(/\s+/).map(q=>pe(q,this.options));O&&(I=I.filter(q=>(p("loose invalid filter",q,this.options),!!q.match(u[l.COMPARATORLOOSE])))),p("range list",I);const P=new Map,S=I.map(q=>new m(q,this.options));for(const q of S){if(v(q))return[q];P.set(q.value,q)}P.size>1&&P.has("")&&P.delete("");const j=[...P.values()];return a.set($,j),j}intersects(d,$){if(!(d instanceof i))throw new TypeError("a Range is required");return this.set.some(b=>A(b,$)&&d.set.some(O=>A(O,$)&&b.every(R=>O.every(I=>R.intersects(I,$)))))}test(d){if(!d)return!1;if(typeof d=="string")try{d=new f(d,this.options)}catch{return!1}for(let $=0;$<this.set.length;$++)if(he(this.set[$],d,this.options))return!0;return!1}}Ve=i;const n=nn(),a=new n,o=pr(),m=ue(),p=ie(),f=G(),{safeRe:u,t:l,comparatorTrimReplace:s,tildeTrimReplace:c,caretTrimReplace:g}=te(),{FLAG_INCLUDE_PRERELEASE:w,FLAG_LOOSE:N}=re(),v=r(E=>E.value==="<0.0.0-0","isNullSet"),k=r(E=>E.value==="","isAny"),A=r((E,d)=>{let $=!0;const b=E.slice();let O=b.pop();for(;$&&b.length;)$=b.every(R=>O.intersects(R,d)),O=b.pop();return $},"isSatisfiable"),M=r((E,d)=>(E=E.replace(u[l.BUILD],""),p("comp",E,d),E=C(E,d),p("caret",E),E=_(E,d),p("tildes",E),E=y(E,d),p("xrange",E),E=ce(E,d),p("stars",E),E),"parseComparator"),T=r(E=>!E||E.toLowerCase()==="x"||E==="*","isX"),_=r((E,d)=>E.trim().split(/\s+/).map($=>F($,d)).join(" "),"replaceTildes"),F=r((E,d)=>{const $=d.loose?u[l.TILDELOOSE]:u[l.TILDE];return E.replace($,(b,O,R,I,P)=>{p("tilde",E,b,O,R,I,P);let S;return T(O)?S="":T(R)?S=`>=${O}.0.0 <${+O+1}.0.0-0`:T(I)?S=`>=${O}.${R}.0 <${O}.${+R+1}.0-0`:P?(p("replaceTilde pr",P),S=`>=${O}.${R}.${I}-${P} <${O}.${+R+1}.0-0`):S=`>=${O}.${R}.${I} <${O}.${+R+1}.0-0`,p("tilde return",S),S})},"replaceTilde"),C=r((E,d)=>E.trim().split(/\s+/).map($=>D($,d)).join(" "),"replaceCarets"),D=r((E,d)=>{p("caret",E,d);const $=d.loose?u[l.CARETLOOSE]:u[l.CARET],b=d.includePrerelease?"-0":"";return E.replace($,(O,R,I,P,S)=>{p("caret",E,O,R,I,P,S);let j;return T(R)?j="":T(I)?j=`>=${R}.0.0${b} <${+R+1}.0.0-0`:T(P)?R==="0"?j=`>=${R}.${I}.0${b} <${R}.${+I+1}.0-0`:j=`>=${R}.${I}.0${b} <${+R+1}.0.0-0`:S?(p("replaceCaret pr",S),R==="0"?I==="0"?j=`>=${R}.${I}.${P}-${S} <${R}.${I}.${+P+1}-0`:j=`>=${R}.${I}.${P}-${S} <${R}.${+I+1}.0-0`:j=`>=${R}.${I}.${P}-${S} <${+R+1}.0.0-0`):(p("no pr"),R==="0"?I==="0"?j=`>=${R}.${I}.${P}${b} <${R}.${I}.${+P+1}-0`:j=`>=${R}.${I}.${P}${b} <${R}.${+I+1}.0-0`:j=`>=${R}.${I}.${P} <${+R+1}.0.0-0`),p("caret return",j),j})},"replaceCaret"),y=r((E,d)=>(p("replaceXRanges",E,d),E.split(/\s+/).map($=>J($,d)).join(" ")),"replaceXRanges"),J=r((E,d)=>{E=E.trim();const $=d.loose?u[l.XRANGELOOSE]:u[l.XRANGE];return E.replace($,(b,O,R,I,P,S)=>{p("xRange",E,b,O,R,I,P,S);const j=T(R),q=j||T(I),z=q||T(P),Z=z;return O==="="&&Z&&(O=""),S=d.includePrerelease?"-0":"",j?O===">"||O==="<"?b="<0.0.0-0":b="*":O&&Z?(q&&(I=0),P=0,O===">"?(O=">=",q?(R=+R+1,I=0,P=0):(I=+I+1,P=0)):O==="<="&&(O="<",q?R=+R+1:I=+I+1),O==="<"&&(S="-0"),b=`${O+R}.${I}.${P}${S}`):q?b=`>=${R}.0.0${S} <${+R+1}.0.0-0`:z&&(b=`>=${R}.${I}.0${S} <${R}.${+I+1}.0-0`),p("xRange return",b),b})},"replaceXRange"),ce=r((E,d)=>(p("replaceStars",E,d),E.trim().replace(u[l.STAR],"")),"replaceStars"),pe=r((E,d)=>(p("replaceGTE0",E,d),E.trim().replace(u[d.includePrerelease?l.GTE0PRE:l.GTE0],"")),"replaceGTE0"),fe=r(E=>(d,$,b,O,R,I,P,S,j,q,z,Z)=>(T(b)?$="":T(O)?$=`>=${b}.0.0${E?"-0":""}`:T(R)?$=`>=${b}.${O}.0${E?"-0":""}`:I?$=`>=${$}`:$=`>=${$}${E?"-0":""}`,T(j)?S="":T(q)?S=`<${+j+1}.0.0-0`:T(z)?S=`<${j}.${+q+1}.0-0`:Z?S=`<=${j}.${q}.${z}-${Z}`:E?S=`<${j}.${q}.${+z+1}-0`:S=`<=${S}`,`${$} ${S}`.trim()),"hyphenReplace"),he=r((E,d,$)=>{for(let b=0;b<E.length;b++)if(!E[b].test(d))return!1;if(d.prerelease.length&&!$.includePrerelease){for(let b=0;b<E.length;b++)if(p(E[b].semver),E[b].semver!==m.ANY&&E[b].semver.prerelease.length>0){const O=E[b].semver;if(O.major===d.major&&O.minor===d.minor&&O.patch===d.patch)return!0}return!1}return!0},"testSet");return Ve}h(V,"requireRange");var Be,Zr;function ue(){if(Zr)return Be;Zr=1;var e=Object.defineProperty,r=h((l,s)=>e(l,"name",{value:s,configurable:!0}),"i");const t=Symbol("SemVer ANY");class i{static{h(this,"Comparator")}static{r(this,"Comparator")}static get ANY(){return t}constructor(s,c){if(c=n(c),s instanceof i){if(s.loose===!!c.loose)return s;s=s.value}s=s.trim().split(/\s+/).join(" "),p("comparator",s,c),this.options=c,this.loose=!!c.loose,this.parse(s),this.semver===t?this.value="":this.value=this.operator+this.semver.version,p("comp",this)}parse(s){const c=this.options.loose?a[o.COMPARATORLOOSE]:a[o.COMPARATOR],g=s.match(c);if(!g)throw new TypeError(`Invalid comparator: ${s}`);this.operator=g[1]!==void 0?g[1]:"",this.operator==="="&&(this.operator=""),g[2]?this.semver=new f(g[2],this.options.loose):this.semver=t}toString(){return this.value}test(s){if(p("Comparator.test",s,this.options.loose),this.semver===t||s===t)return!0;if(typeof s=="string")try{s=new f(s,this.options)}catch{return!1}return m(s,this.operator,this.semver,this.options)}intersects(s,c){if(!(s instanceof i))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(s.value,c).test(this.value):s.operator===""?s.value===""?!0:new u(this.value,c).test(s.semver):(c=n(c),c.includePrerelease&&(this.value==="<0.0.0-0"||s.value==="<0.0.0-0")||!c.includePrerelease&&(this.value.startsWith("<0.0.0")||s.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&s.operator.startsWith(">")||this.operator.startsWith("<")&&s.operator.startsWith("<")||this.semver.version===s.semver.version&&this.operator.includes("=")&&s.operator.includes("=")||m(this.semver,"<",s.semver,c)&&this.operator.startsWith(">")&&s.operator.startsWith("<")||m(this.semver,">",s.semver,c)&&this.operator.startsWith("<")&&s.operator.startsWith(">")))}}Be=i;const n=pr(),{safeRe:a,t:o}=te(),m=vt(),p=ie(),f=G(),u=V();return Be}h(ue,"requireComparator");var We,Kr;function le(){if(Kr)return We;Kr=1;var e=Object.defineProperty,r=h((n,a)=>e(n,"name",{value:a,configurable:!0}),"t");const t=V();return We=r((n,a,o)=>{try{a=new t(a,o)}catch{return!1}return a.test(n)},"satisfies"),We}h(le,"requireSatisfies");var He,Qr;function an(){if(Qr)return He;Qr=1;var e=Object.defineProperty,r=h((n,a)=>e(n,"name",{value:a,configurable:!0}),"t");const t=V();return He=r((n,a)=>new t(n,a).set.map(o=>o.map(m=>m.value).join(" ").trim().split(" ")),"toComparators"),He}h(an,"requireToComparators");var Ye,et;function sn(){if(et)return Ye;et=1;var e=Object.defineProperty,r=h((a,o)=>e(a,"name",{value:o,configurable:!0}),"c");const t=G(),i=V();return Ye=r((a,o,m)=>{let p=null,f=null,u=null;try{u=new i(o,m)}catch{return null}return a.forEach(l=>{u.test(l)&&(!p||f.compare(l)===-1)&&(p=l,f=new t(p,m))}),p},"maxSatisfying"),Ye}h(sn,"requireMaxSatisfying");var ze,rt;function on(){if(rt)return ze;rt=1;var e=Object.defineProperty,r=h((a,o)=>e(a,"name",{value:o,configurable:!0}),"u");const t=G(),i=V();return ze=r((a,o,m)=>{let p=null,f=null,u=null;try{u=new i(o,m)}catch{return null}return a.forEach(l=>{u.test(l)&&(!p||f.compare(l)===1)&&(p=l,f=new t(p,m))}),p},"minSatisfying"),ze}h(on,"requireMinSatisfying");var Je,tt;function un(){if(tt)return Je;tt=1;var e=Object.defineProperty,r=h((o,m)=>e(o,"name",{value:m,configurable:!0}),"i");const t=G(),i=V(),n=oe();return Je=r((o,m)=>{o=new i(o,m);let p=new t("0.0.0");if(o.test(p)||(p=new t("0.0.0-0"),o.test(p)))return p;p=null;for(let f=0;f<o.set.length;++f){const u=o.set[f];let l=null;u.forEach(s=>{const c=new t(s.semver.version);switch(s.operator){case">":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!l||n(c,l))&&(l=c);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),l&&(!p||n(p,l))&&(p=l)}return p&&o.test(p)?p:null},"minVersion"),Je}h(un,"requireMinVersion");var Ze,nt;function ln(){if(nt)return Ze;nt=1;var e=Object.defineProperty,r=h((n,a)=>e(n,"name",{value:a,configurable:!0}),"n");const t=V();return Ze=r((n,a)=>{try{return new t(n,a).range||"*"}catch{return null}},"validRange"),Ze}h(ln,"requireValid");var Ke,at;function vr(){if(at)return Ke;at=1;var e=Object.defineProperty,r=h((s,c)=>e(s,"name",{value:c,configurable:!0}),"m");const t=G(),i=ue(),{ANY:n}=i,a=V(),o=le(),m=oe(),p=hr(),f=dr(),u=mr();return Ke=r((s,c,g,w)=>{s=new t(s,w),c=new a(c,w);let N,v,k,A,M;switch(g){case">":N=m,v=f,k=p,A=">",M=">=";break;case"<":N=p,v=u,k=m,A="<",M="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(o(s,c,w))return!1;for(let T=0;T<c.set.length;++T){const _=c.set[T];let F=null,C=null;if(_.forEach(D=>{D.semver===n&&(D=new i(">=0.0.0")),F=F||D,C=C||D,N(D.semver,F.semver,w)?F=D:k(D.semver,C.semver,w)&&(C=D)}),F.operator===A||F.operator===M||(!C.operator||C.operator===A)&&v(s,C.semver)||C.operator===M&&k(s,C.semver))return!1}return!0},"outside"),Ke}h(vr,"requireOutside");var Qe,st;function cn(){if(st)return Qe;st=1;var e=Object.defineProperty,r=h((n,a)=>e(n,"name",{value:a,configurable:!0}),"s");const t=vr();return Qe=r((n,a,o)=>t(n,a,">",o),"gtr"),Qe}h(cn,"requireGtr");var er,it;function pn(){if(it)return er;it=1;var e=Object.defineProperty,r=h((n,a)=>e(n,"name",{value:a,configurable:!0}),"s");const t=vr();return er=r((n,a,o)=>t(n,a,"<",o),"ltr"),er}h(pn,"requireLtr");var rr,ot;function fn(){if(ot)return rr;ot=1;var e=Object.defineProperty,r=h((n,a)=>e(n,"name",{value:a,configurable:!0}),"n");const t=V();return rr=r((n,a,o)=>(n=new t(n,o),a=new t(a,o),n.intersects(a,o)),"intersects"),rr}h(fn,"requireIntersects");var tr,ut;function hn(){if(ut)return tr;ut=1;const e=le(),r=X();return tr=h((t,i,n)=>{const a=[];let o=null,m=null;const p=t.sort((s,c)=>r(s,c,n));for(const s of p)e(s,i,n)?(m=s,o||(o=s)):(m&&a.push([o,m]),m=null,o=null);o&&a.push([o,null]);const f=[];for(const[s,c]of a)s===c?f.push(s):!c&&s===p[0]?f.push("*"):c?s===p[0]?f.push(`<=${c}`):f.push(`${s} - ${c}`):f.push(`>=${s}`);const u=f.join(" || "),l=typeof i.raw=="string"?i.raw:String(i);return u.length<l.length?u:i},"simplify"),tr}h(hn,"requireSimplify");var nr,lt;function mn(){if(lt)return nr;lt=1;var e=Object.defineProperty,r=h((c,g)=>e(c,"name",{value:g,configurable:!0}),"u");const t=V(),i=ue(),{ANY:n}=i,a=le(),o=X(),m=r((c,g,w={})=>{if(c===g)return!0;c=new t(c,w),g=new t(g,w);let N=!1;e:for(const v of c.set){for(const k of g.set){const A=u(v,k,w);if(N=N||A!==null,A)continue e}if(N)return!1}return!0},"subset"),p=[new i(">=0.0.0-0")],f=[new i(">=0.0.0")],u=r((c,g,w)=>{if(c===g)return!0;if(c.length===1&&c[0].semver===n){if(g.length===1&&g[0].semver===n)return!0;w.includePrerelease?c=p:c=f}if(g.length===1&&g[0].semver===n){if(w.includePrerelease)return!0;g=f}const N=new Set;let v,k;for(const y of c)y.operator===">"||y.operator===">="?v=l(v,y,w):y.operator==="<"||y.operator==="<="?k=s(k,y,w):N.add(y.semver);if(N.size>1)return null;let A;if(v&&k&&(A=o(v.semver,k.semver,w),A>0||A===0&&(v.operator!==">="||k.operator!=="<=")))return null;for(const y of N){if(v&&!a(y,String(v),w)||k&&!a(y,String(k),w))return null;for(const J of g)if(!a(y,String(J),w))return!1;return!0}let M,T,_,F,C=k&&!w.includePrerelease&&k.semver.prerelease.length?k.semver:!1,D=v&&!w.includePrerelease&&v.semver.prerelease.length?v.semver:!1;C&&C.prerelease.length===1&&k.operator==="<"&&C.prerelease[0]===0&&(C=!1);for(const y of g){if(F=F||y.operator===">"||y.operator===">=",_=_||y.operator==="<"||y.operator==="<=",v){if(D&&y.semver.prerelease&&y.semver.prerelease.length&&y.semver.major===D.major&&y.semver.minor===D.minor&&y.semver.patch===D.patch&&(D=!1),y.operator===">"||y.operator===">="){if(M=l(v,y,w),M===y&&M!==v)return!1}else if(v.operator===">="&&!a(v.semver,String(y),w))return!1}if(k){if(C&&y.semver.prerelease&&y.semver.prerelease.length&&y.semver.major===C.major&&y.semver.minor===C.minor&&y.semver.patch===C.patch&&(C=!1),y.operator==="<"||y.operator==="<="){if(T=s(k,y,w),T===y&&T!==k)return!1}else if(k.operator==="<="&&!a(k.semver,String(y),w))return!1}if(!y.operator&&(k||v)&&A!==0)return!1}return!(v&&_&&!k&&A!==0||k&&F&&!v&&A!==0||D||C)},"simpleSubset"),l=r((c,g,w)=>{if(!c)return g;const N=o(c.semver,g.semver,w);return N>0?c:N<0||g.operator===">"&&c.operator===">="?g:c},"higherGT"),s=r((c,g,w)=>{if(!c)return g;const N=o(c.semver,g.semver,w);return N<0?c:N>0||g.operator==="<"&&c.operator==="<="?g:c},"lowerLT");return nr=m,nr}h(mn,"requireSubset");var ar,ct;function dn(){if(ct)return ar;ct=1;const e=te(),r=re(),t=G(),i=ht(),n=W(),a=Xt(),o=Vt(),m=Bt(),p=Wt(),f=Ht(),u=Yt(),l=zt(),s=Jt(),c=X(),g=Zt(),w=Kt(),N=fr(),v=Qt(),k=en(),A=oe(),M=hr(),T=mt(),_=dt(),F=mr(),C=dr(),D=vt(),y=rn(),J=tn(),ce=ue(),pe=V(),fe=le(),he=an(),E=sn(),d=on(),$=un(),b=ln(),O=vr(),R=cn(),I=pn(),P=fn(),S=hn(),j=mn();return ar={parse:n,valid:a,clean:o,inc:m,diff:p,major:f,minor:u,patch:l,prerelease:s,compare:c,rcompare:g,compareLoose:w,compareBuild:N,sort:v,rsort:k,gt:A,lt:M,eq:T,neq:_,gte:F,lte:C,cmp:D,coerce:y,truncate:J,Comparator:ce,Range:pe,satisfies:fe,toComparators:he,maxSatisfying:E,minSatisfying:d,minVersion:$,validRange:b,outside:O,gtr:R,ltr:I,intersects:P,simplifyRange:S,subset:j,SemVer:t,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:i.compareIdentifiers,rcompareIdentifiers:i.rcompareIdentifiers},ar}h(dn,"requireSemver");var ee=dn();const na=St(ee);var vn=Object.defineProperty,x=h((e,r)=>vn(e,"name",{value:r,configurable:!0}),"n");const H=x((e,r,t,i)=>{for(const n of r)e.push("--filter",n);t&&e.push("--recursive"),i&&e.push("--workspace-root")},"pushFilterGlobals"),gn=x(e=>{const r=[],t=[];return H(r,e.filter,e.recursive,e.workspaceRoot),e.silent&&r.push("--silent"),e.frozenLockfile&&r.push("--frozen-lockfile"),r.push("install"),e.dev&&r.push("--dev"),e.prod&&r.push("--prod"),e.force&&r.push("--force"),e.ignoreScripts&&r.push("--ignore-scripts"),e.lockfileOnly&&r.push("--lockfile-only"),e.noOptional&&r.push("--no-optional"),e.offline&&r.push("--offline"),{args:r,bin:"aube",warnings:t}},"resolveAubeInstall"),En=x(e=>{const r=[],t=[];return H(r,e.filter,!1,!1),r.push("add"),e.saveDev&&r.push("--save-dev"),e.exact&&r.push("--save-exact"),e.global&&r.push("--global"),e.optional&&r.push("--save-optional"),e.peer&&r.push("--save-peer"),e.workspace&&t.push("aube has no flag for the `workspace:` protocol; it auto-detects local workspace members during add. Ignoring --workspace."),e.workspaceRoot&&r.push("--workspace"),r.push(...e.packages),{args:r,bin:"aube",warnings:t}},"resolveAubeAdd"),bn=x(e=>{const r=[];return H(r,e.filter,e.recursive,!1),r.push("remove"),e.saveDev&&r.push("--save-dev"),e.global&&r.push("--global"),e.workspaceRoot&&r.push("--workspace"),r.push(...e.packages),{args:r,bin:"aube",warnings:[]}},"resolveAubeRemove"),Rn=x(e=>{const r=["dedupe"];return e&&r.push("--check"),{args:r,bin:"aube",warnings:[]}},"resolveAubeDedupe"),wn=x(e=>{const r=[],t=[];H(r,e.filter,e.recursive,!1),r.push("why"),e.dev&&r.push("--dev"),e.prod&&r.push("--prod"),e.json&&r.push("--json"),e.long&&r.push("--long"),e.parseable&&r.push("--parseable"),e.depth!==void 0&&t.push("aube why does not accept --depth; ignoring."),e.noOptional&&t.push("aube why does not accept --no-optional; ignoring."),e.global&&t.push("aube why does not accept --global; ignoring.");const[i,...n]=e.packages;return i===void 0?t.push("aube why requires a package name; none provided."):(n.length>0&&t.push("aube why takes a single package; using the first."),r.push(i)),{args:r,bin:"aube",warnings:t}},"resolveAubeWhy"),$n=x(e=>{const r=[],t=[];e.workspaceRoot&&t.push("aube outdated has no `--include-workspace-root` equivalent. Run `vis outdated` separately at the workspace root if you need its outdated list."),H(r,e.filter,e.recursive,!1),r.push("outdated"),e.dev&&r.push("--dev"),e.prod&&r.push("--prod"),e.long&&r.push("--long"),e.format==="json"?r.push("--json"):e.format&&e.format!=="table"&&t.push(`aube outdated does not support format "${e.format}"; falling back to default table output.`),e.compatible&&t.push("aube outdated does not accept --compatible; ignoring."),e.noOptional&&t.push("aube outdated does not accept --no-optional; ignoring."),e.global&&t.push("aube outdated does not accept --global; ignoring.");const[i,...n]=e.packages;return i!==void 0&&(n.length>0&&t.push("aube outdated takes a single pattern argument; using the first."),r.push(i)),{args:r,bin:"aube",warnings:t}},"resolveAubeOutdated"),On=x(e=>{const r=[];e.silent&&r.push("--silent"),r.push("dlx");for(const t of e.additionalPackages)r.push("--package",t);return e.shellMode&&r.push("--shell-mode"),r.push(e.package),r.push(...e.args),{args:r,bin:"aube",warnings:[]}},"resolveAubeDlx"),In=x(e=>{const r=[];return H(r,e.filter,e.recursive,e.workspaceRoot),r.push("exec"),e.parallel&&r.push("--parallel"),e.reverse&&r.push("--reverse"),e.shellMode&&r.push("--shell-mode"),r.push(e.command),r.push(...e.args),{args:r,bin:"aube",warnings:[]}},"resolveAubeExec"),yn=x(e=>{const r=["link"];return e!==null&&r.push(e),{args:r,bin:"aube",warnings:[]}},"resolveAubeLink"),kn=x((e,r)=>{const t=[],i=[];return r&&t.push("--recursive"),t.push("unlink"),e.length>1&&i.push("aube unlink takes a single package; using the first."),e.length>0&&t.push(e[0]),{args:t,bin:"aube",warnings:i}},"resolveAubeUnlink"),Ln=x(e=>{const r=["view","--",e.package],t=[],[i,...n]=e.fields;return i!==void 0?(n.length>0&&t.push("aube view only supports a single field; using the first."),e.json&&t.push("aube view does not support --json with a field selector; printing the field without --json."),r.push(i)):e.json&&r.push("--json"),{args:r,bin:"aube",warnings:t}},"resolveAubeInfo"),aa=x(e=>{const r=[],t=[];return H(r,e.filters,e.recursive,e.workspaceRoot),r.push("update"),e.dev&&r.push("--dev"),e.prod&&r.push("--prod"),e.global&&r.push("--global"),e.interactive&&r.push("--interactive"),e.latest&&r.push("--latest"),e.noOptional&&r.push("--no-optional"),e.noSave&&r.push("--no-save"),r.push(...e.packages),{args:r,bin:"aube",warnings:t}},"resolveAubeUpdate"),Sn=new Set(["fund","ping","search","token"]),Nn=x((e,r)=>Sn.has(e)?{args:[e,...r],bin:"npm",warnings:[`'${e}' is not natively supported by aube. Delegating to npm.`]}:{args:[e,...r],bin:"aube",warnings:[]},"resolveAubePmCommand");var An=Object.defineProperty,ir=h((e,r)=>An(e,"name",{value:r,configurable:!0}),"r");const pt=256*1024,Pn=ir(e=>{const r=e?{...process.env,...e}:{...process.env};return process.stderr.isTTY&&r.FORCE_COLOR===void 0&&r.NO_COLOR===void 0&&(r.FORCE_COLOR="1"),r},"buildChildEnv"),Tn=ir(async(e,r,t)=>new Promise((i,n)=>{const a=yt(e,[...r],{cwd:t.cwd,env:Pn(t.env),shell:process.platform==="win32",stdio:["inherit","pipe","pipe"],windowsHide:!0});let o="";const m=ir(p=>{const f=p.toString("utf8");if(o.length+f.length<=pt){o+=f;return}const u=o+f;o=u.slice(u.length-pt)},"append");a.stdout?.on("data",p=>{process.stdout.write(p),m(p)}),a.stderr?.on("data",p=>{process.stderr.write(p),m(p)}),a.on("error",n),a.on("close",p=>{i({code:p??1,output:o})})}),"spawnTee");var jn=Object.defineProperty,ne=h((e,r)=>jn(e,"name",{value:r,configurable:!0}),"a");const Q=ne(e=>{const r=ee.coerce(e);return r?ee.gte(r,"11.0.0"):!1},"isPnpm11Plus"),B=ne(e=>e.name==="yarn"&&!e.version.startsWith("1."),"isYarnBerry"),sr=ne(e=>e.name==="yarn"&&e.version.startsWith("1."),"isYarn1"),Cn=ne(e=>e[0]==="rm"?["remove",...e.slice(1)]:e,"rewriteRmToRemove"),qn=ne((e,r,t)=>{switch(r){case"audit":return B(e)?{args:["npm","audit",...t],bin:"yarn",kind:"rewrite"}:{kind:"passthrough"};case"config":{if(B(e)){const[i,...n]=t;return i==="delete"?{args:["config","unset",...n],bin:"yarn",kind:"rewrite",warning:"yarn berry uses `config unset`, not `config delete`."}:{kind:"passthrough"}}return e.name==="bun"?{kind:"skip",warning:"bun has no `config` CLI. Edit bunfig.toml or .npmrc directly."}:e.name==="deno"?{kind:"skip",warning:"deno has no registry-config CLI. Edit deno.json directly."}:{kind:"passthrough"}}case"dist-tag":return sr(e)?{args:["tag",...t],bin:"yarn",kind:"rewrite",warning:"yarn 1 has no `dist-tag`; using `yarn tag`."}:B(e)?{args:["npm","tag",...Cn(t)],bin:"yarn",kind:"rewrite"}:e.name==="bun"||e.name==="deno"?{kind:"skip",warning:`${e.name} has no \`dist-tag\`. Use \`npm dist-tag\` instead.`}:{kind:"passthrough"};case"login":case"logout":return B(e)?{args:["npm",r,...t],bin:"yarn",kind:"rewrite"}:e.name==="bun"?{args:[r,...t],bin:"npm",kind:"rewrite",warning:`bun has no \`${r}\`; falling back to \`npm ${r}\` (writes ~/.npmrc, which bun reads).`}:e.name==="deno"?{kind:"skip",warning:`deno has no \`${r}\`. JSR uses browser OAuth via \`deno publish\`.`}:{kind:"passthrough"};case"owner":return e.name==="pnpm"&&Q(e.version)?{args:["owner",...t],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `owner`; falling back to `npm owner`."}:B(e)?{args:["owner",...t],bin:"npm",kind:"rewrite",warning:"yarn berry has no `owner` (not in `yarn npm`); falling back to `npm owner`."}:e.name==="bun"?{args:["owner",...t],bin:"npm",kind:"rewrite",warning:"bun has no `owner`; falling back to `npm owner`."}:e.name==="deno"?{kind:"skip",warning:"deno has no `owner`. JSR uses scope-member roles via the web UI."}:{kind:"passthrough"};case"ping":return e.name==="pnpm"&&Q(e.version)?{args:["ping",...t],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `ping`; falling back to `npm ping`."}:{kind:"passthrough"};case"plugin":return B(e)?{kind:"passthrough"}:{kind:"skip",warning:`${e.name} does not support yarn-style plugins. Skipping (no-op).`};case"prune":return sr(e)?{kind:"skip",warning:"yarn 1 has no `prune`. Use `yarn install --production` for a prod-only tree."}:B(e)?{kind:"skip",warning:"yarn berry has no `prune`. Use `yarn workspaces focus --production` instead."}:e.name==="bun"||e.name==="deno"?{kind:"skip",warning:`${e.name} has no \`prune\`. Pruning happens automatically on install.`}:{kind:"passthrough"};case"publish":return B(e)?{args:["npm","publish",...t],bin:"yarn",kind:"rewrite"}:{kind:"passthrough"};case"rebuild":return sr(e)?{kind:"skip",warning:"yarn 1 has no `rebuild`. Re-install instead."}:e.name==="bun"?{kind:"skip",warning:"bun has no `rebuild`. Use `bun install --force` instead."}:e.name==="deno"?{kind:"skip",warning:"deno has no `rebuild`."}:{kind:"passthrough"};case"search":return e.name==="pnpm"&&Q(e.version)?{args:["search",...t],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `search`; falling back to `npm search`."}:{kind:"passthrough"};case"token":return e.name==="pnpm"&&Q(e.version)?{args:["token",...t],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `token`; falling back to `npm token`."}:{kind:"passthrough"};case"whoami":return e.name==="pnpm"&&Q(e.version)?{args:["whoami",...t],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `whoami`; falling back to `npm whoami`."}:B(e)?{args:["npm","whoami",...t],bin:"yarn",kind:"rewrite"}:e.name==="bun"?{args:["pm","whoami",...t],bin:"bun",kind:"rewrite"}:e.name==="deno"?{kind:"skip",warning:"deno has no `whoami`. JSR uses browser auth."}:{kind:"passthrough"};default:return{kind:"passthrough"}}},"dispatchSubcommand");var Dn=Object.defineProperty,L=h((e,r)=>Dn(e,"name",{value:r,configurable:!0}),"o");const or=L(e=>Nt(e)!==null,"hasBinaryOnPath"),Mn=L(e=>{const r=[["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["package-lock.json","npm"],["npm-shrinkwrap.json","npm"],["bun.lock","bun"],["bun.lockb","bun"],["deno.lock","deno"]];let t=e;for(;;){for(const[n,a]of r)if(ur(se(t,n)))return a;const i=lr(t);if(i===t||cr(t).root===t)return;t=i}},"findNonAubeLockfile"),sa=L((e,r)=>{if(r.name!=="aube")return;const t=Mn(e);if(t!==void 0)return`Resolved installer is aube but the workspace has a ${t} lockfile. Aube reads and writes ${t}'s lockfile format in place, but its byte output may differ subtly — expect a one-time churn diff on the first install, and ongoing drift if your team mixes tools on the same lockfile. To pin the choice across the team, set \`install.backend\` in vis.config; to bypass aube for this run, pass --no-aube.`},"detectLockfileDrift"),gr=L(e=>{if(ur(e))try{return JSON.parse(Lt(e,{buffer:!1}))}catch{return}},"readJson"),_n=L(e=>{let r=e;for(;;){const t=se(r,"package.json"),i=gr(t);if(i&&typeof i.packageManager=="string"&&i.packageManager.length>0)return i.packageManager;const n=lr(r);if(n===r||cr(r).root===r)return;r=n}},"readPackageManagerField"),gt=new Set(["npm","pnpm","yarn"]),ft=L((e,r,t)=>t===!1||!gt.has(r)||!or("corepack")?!1:t===!0?!0:_n(e)!==void 0,"shouldUseCorepack"),ia=L((e,r)=>{const t=r.backend,i=process.env.VIS_INSTALLER,n=t??i??r.configBackend,a=r.configCorepack??"auto";if(n&&n!=="auto"){if(n==="aube"&&!or("aube"))throw new Error('install.backend is set to "aube" but the `aube` binary is not on PATH. Install it via `npm i -g @endevco/aube`, `mise use -g aube`, or `brew install endevco/tap/aube`.');return{name:n,useCorepack:ft(e,n,a),version:"latest"}}if(or("aube"))return{name:"aube",useCorepack:!1,version:"latest"};const o=Gn(e);return{...o,useCorepack:ft(e,o.name,a)}},"resolveInstaller"),Gn=L(e=>{if(!ur(e))throw new Error(`Could not detect package manager in ${e}. Directory does not exist.`);const r=At(e);return{name:r.name,version:r.version||"latest"}},"detectPm"),Et=L((e,r)=>r.useCorepack!==!0||!gt.has(r.name)||e.bin==="corepack"||e.bin!==r.name?e:{...e,args:[r.name,...e.args],bin:"corepack"},"applyCorepack"),Fn=L((e,r,t)=>{if(t===void 0)return Pt(e.bin,e.args,r);const i=kt(e.bin,e.args,{cwd:r,env:{...process.env,...t},stdio:"inherit"});if(i.error)throw i.error;return i.status??1},"spawnResolved"),U=L((e,r,t,i,n={})=>{const a=Et(r,e);for(const o of a.warnings)i.warn(`warning: ${o}`);return n.dry?(i.log(`[dry-run] ${a.bin} ${a.args.join(" ")}`),0):Fn(a,t,n.env)},"runResolved"),Y=L((e,r,t,i,n={})=>U(e,r(),t,i,n),"resolveAndRun"),Un=L((e,r)=>r==="aube"||r==="deno"?e:{...e,args:[...e.args,"--prefer-offline"]},"applyPreferOffline"),xn=L((e,r,t)=>r!=="yarn"||t.startsWith("1.")||!e.args.includes("--immutable")||e.args.includes("--immutable-cache")?e:{...e,args:[...e.args,"--immutable-cache"]},"applyImmutableCache"),bt=L((e,r,t)=>{let i=e.name==="aube"?gn(r):Tt(e.name,e.version,{...r,silent:r.silent||t.silent===!0});return t.preferOffline&&(i=Un(i,e.name)),t.ciMode&&(i=xn(i,e.name,e.version)),i},"resolveInstallCommand"),oa=L((e,r,t,i,n={})=>{const a=bt(e,r,n);return Er(e,a,t,i,{dry:n.dry,env:n.env})},"runInstall"),ua=L(async(e,r,t,i,n={})=>{const a=Et(bt(e,r,n),e);for(const o of a.warnings)i.warn(`warning: ${o}`);return n.dry?(i.log(`[dry-run] ${a.bin} ${a.args.join(" ")}`),{code:0,output:""}):Tn(a.bin,a.args,{cwd:t,env:n.env?{...process.env,...n.env}:process.env})},"runInstallCaptured"),Rt=L((e,r)=>{const t=r==="deno"?"--quiet":"--silent";return{...e,args:[...e.args,t]}},"applySilent"),Xn=L((e,r)=>r==="yarn"||r==="aube"?null:{...e,args:[...e.args,"--dry-run"]},"applyDryRun"),Er=L((e,r,t,i,n)=>{if(n.dry!==!0)return U(e,r,t,i,n);const a=Xn(r,e.name);return a===null?U(e,r,t,i,n):U(e,a,t,i,{env:n.env})},"runWithNativeDryRun"),Vn=L((e,r)=>r==="aube"?{...e,args:[...e.args,"--ignore-scripts"]}:r==="deno"?e:{...e,args:[...e.args,"--ignore-scripts"]},"applyIgnoreScripts"),Bn=L((e,r,t,i,n={})=>{let a=e.name==="aube"?En(r):jt(e.name,e.version,r);n.ignoreScripts&&(a=Vn(a,e.name)),n.silent&&(a=Rt(a,e.name));const o=Er(e,a,t,i,{dry:n.dry,env:n.env});return o===0&&n.autoInstallPeers&&zn(e,r,t,i,n),o},"runAdd"),Wn=L(e=>{if(e.startsWith("@")){const t=e.indexOf("/");if(t===-1)return e;const i=e.indexOf("@",t);return i===-1?e:e.slice(0,i)}const r=e.indexOf("@");return r===-1?e:e.slice(0,r)},"stripVersionRange"),Hn=L((e,r)=>{let t=e;for(;;){const i=se(t,"node_modules",r,"package.json"),n=gr(i);if(n)return n;const a=lr(t);if(a===t||cr(t).root===t)return;t=a}},"findInstalledManifest"),Yn=L(e=>{const r=gr(se(e,"package.json")),t=new Set;if(!r)return t;for(const i of["dependencies","devDependencies","peerDependencies","optionalDependencies"]){const n=r[i];if(n)for(const a of Object.keys(n))t.add(a)}return t},"collectExistingDeps"),zn=L((e,r,t,i,n)=>{if(e.name==="deno")return;const a=Yn(t),o=new Map;for(const f of r.packages){const u=Wn(f),l=Hn(t,u);if(!l?.peerDependencies)continue;const s=l.peerDependenciesMeta??{};for(const[c,g]of Object.entries(l.peerDependencies))s[c]?.optional||a.has(c)||o.has(c)||o.set(c,g)}if(o.size===0)return;const m=[...o.entries()].map(([f,u])=>`${f}@${u}`);i.log(`auto-installing peer dependencies: ${m.join(", ")}`);const p={exact:!1,filter:r.filter,global:!1,optional:!1,packages:m,peer:!1,saveDev:r.saveDev,workspace:!1,workspaceRoot:r.workspaceRoot};Bn(e,p,t,i,{ignoreScripts:n.ignoreScripts})},"installMissingPeers"),la=L((e,r,t,i,n={})=>{let a=e.name==="aube"?bn(r):Ct(e.name,e.version,r);return n.silent&&(a=Rt(a,e.name)),Er(e,a,t,i,{dry:n.dry,env:n.env})},"runRemove"),ca=L((e,r,t,i,n={})=>e.name==="aube"?U(e,Rn(r),t,i,n):Y(e,()=>qt(e.name,e.version,r),t,i,n),"runDedupe"),pa=L((e,r,t,i,n={})=>e.name==="aube"?U(e,wn(r),t,i,n):Y(e,()=>Dt(e.name,e.version,r),t,i,n),"runWhy");L((e,r,t,i,n={})=>e.name==="aube"?U(e,$n(r),t,i,n):Y(e,()=>Mt(e.name,e.version,r),t,i,n),"runOutdated");const Jn=L((e,r)=>{if(e.name==="aube")return Ln(r);const t=[],i=[],n=e.name;switch(e.name){case"bun":{const a=ee.coerce(e.version);a&&ee.lt(a,"1.3.0")&&i.push(`bun ${e.version} does not support \`bun pm view\` (added in bun 1.3). Upgrade bun, or run \`npm view ${r.package}\` instead.`),t.push("pm","view","--",r.package,...r.fields),r.json&&t.push("--json");break}case"deno":{const a=r.package.startsWith("npm:")||r.package.startsWith("jsr:")||r.package.startsWith("https://")||r.package.startsWith("http://")||r.package.startsWith("file:")?r.package:`npm:${r.package}`;t.push("info","--",a),r.json&&t.push("--json"),r.fields.length>0&&i.push("deno info does not accept field selectors; ignoring.");break}case"npm":case"pnpm":{t.push("view","--",r.package,...r.fields),r.json&&t.push("--json");break}case"yarn":{if(e.version.startsWith("1.")){t.push("info","--",r.package);const[a,...o]=r.fields;a!==void 0&&(o.length>0&&i.push("yarn v1 only supports querying one field at a time; using the first."),t.push(a)),r.json&&t.push("--json")}else t.push("npm","info","--",r.package),r.fields.length>0&&i.push("yarn berry does not support field arguments to 'npm info'; ignoring."),r.json&&t.push("--json");break}default:{const a=e.name;throw new Error(`Unsupported package manager: ${a}`)}}return{args:t,bin:n,warnings:i}},"resolveInfo"),fa=L((e,r,t,i,n={})=>U(e,Jn(e,r),t,i,n),"runInfo"),ha=L((e,r,t,i,n={})=>e.name==="aube"?U(e,yn(r),t,i,n):Y(e,()=>_t(e.name,e.version,r),t,i,n),"runLink"),ma=L((e,r,t,i,n,a={})=>e.name==="aube"?U(e,kn(r,t),i,n,a):Y(e,()=>Gt(e.name,e.version,r,t),i,n,a),"runUnlink"),Zn=L((e,r,t)=>{if(e.args.includes("--offline")||e.args.includes("--cached-only"))return e;const i=L((n,a)=>{const o=[...e.args];return o.splice(a,0,n),{...e,args:o}},"insertAt");switch(r){case"aube":case"pnpm":return i("--offline",1);case"bun":return{...e,warnings:[...e.warnings,"bun x does not support --offline. Pre-install the package via `vis install` so bun x resolves from the local cache."]};case"deno":return i("--cached-only",1);case"npm":return i("--offline",1);case"yarn":return t.startsWith("1.")?i("--offline",0):{...e,warnings:[...e.warnings,"yarn berry has no --offline flag for dlx. Configure `enableNetwork: false` in .yarnrc.yml or set `enableMirror: true` for offline-first behavior."]};default:{const n=r;return{...e,warnings:[...e.warnings,`applyDlxOffline: unsupported pm ${String(n)}`]}}}},"applyDlxOffline"),da=L((e,r,t,i,n={})=>{let a=e.name==="aube"?On(r):Ft(e.name,e.version,r);return n.offline&&(a=Zn(a,e.name,e.version)),U(e,a,t,i,{dry:n.dry,env:n.env})},"runDlx"),va=L((e,r,t,i,n={})=>e.name==="aube"?U(e,In(r),t,i,n):Y(e,()=>Ut(e.name,e.version,r),t,i,n),"runExec"),ga=L((e,r,t,i,n,a={})=>{if(e.name==="aube")return U(e,Nn(r,t),i,n,a);const o=qn(e,r,t);return o.kind==="skip"?(n.warn(`warning: ${o.warning}`),0):o.kind==="rewrite"?U(e,{args:o.args,bin:o.bin,warnings:o.warning?[o.warning]:[]},i,n,a):Y(e,()=>xt(e.name,e.version,r,t),i,n,a)},"runPmSubcommand");export{ha as $,Gn as A,da as B,ua as C,la as E,sa as I,ga as L,ca as M,va as N,Bn as P,ia as R,fa as S,ma as W,pa as a,Tn as b,Vt as c,aa as k,Xt as r,ee as s,na as x,oa as y};
@@ -1 +0,0 @@
1
- var ie=Object.defineProperty;var p=(r,e)=>ie(r,"name",{value:e,configurable:!0});import{createRequire as oe}from"node:module";import{T as Q,e as j}from"./index.server-B7ETiT4C.js";import{n as V,b as W}from"../packem_chunks/config.js";import{M as k,i as N}from"./readFileSync-CGmzMUF2-D6rUjGDn.js";import{g as B,i as b}from"../packem_chunks/bin.js";import{m as D,D as M,g as S}from"./provenance-BuiEsWbI.js";import{s as g}from"./pm-runner-BwX5AL3W.js";const ae=oe(import.meta.url),E=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,F=p(r=>{if(typeof E<"u"&&E.versions&&E.versions.node){const[e,t]=E.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return E.getBuiltinModule(r)}return ae(r)},"__cjs_getBuiltinModule"),{rmSync:y,writeFileSync:L,readdirSync:U}=F("node:fs"),{createHash:ce}=F("node:crypto"),{Resolver:de}=F("node:dns/promises");var le=Object.defineProperty,I=p((r,e)=>le(r,"name",{value:e,configurable:!0}),"t$2");class mr{static{p(this,"MarshallFindings")}static{I(this,"MarshallFindings")}entries=[];add(e){this.entries.push(e)}addMany(e){for(const t of e)this.entries.push(t)}all(){return this.entries}errors(){return this.entries.filter(e=>e.severity==="error")}warnings(){return this.entries.filter(e=>e.severity==="warning")}hasErrors(){return this.entries.some(e=>e.severity==="error")}hasWarnings(){return this.entries.some(e=>e.severity==="warning")}isEmpty(){return this.entries.length===0}size(){return this.entries.length}}const pr=I(r=>{if(r.length===0)return[];const e=[],t=r.filter(s=>s.severity==="error"),n=r.filter(s=>s.severity==="warning");if(t.length>0){e.push(Q(`${String(t.length)} error${t.length===1?"":"s"}:`));for(const s of t)e.push(` ${Q("✗")} [${s.marshall}] ${s.packageName}: ${s.message}`),s.suggestedAction!==void 0&&e.push(` ${j("→")} ${s.suggestedAction}`)}if(n.length>0){t.length>0&&e.push(""),e.push(j(`${String(n.length)} warning${n.length===1?"":"s"}:`));for(const s of n)e.push(` ${j("⚠")} [${s.marshall}] ${s.packageName}: ${s.message}`),s.suggestedAction!==void 0&&e.push(` ${j("→")} ${s.suggestedAction}`)}return e},"formatMarshallFindingsAsTable"),gr=I(r=>({errors:r.filter(e=>e.severity==="error"),findings:[...r],summary:{errorCount:r.filter(e=>e.severity==="error").length,warningCount:r.filter(e=>e.severity==="warning").length},warnings:r.filter(e=>e.severity==="warning")}),"formatMarshallFindingsAsJson");var ue=Object.defineProperty,w=p((r,e)=>ue(r,"name",{value:e,configurable:!0}),"o$1");const he=1440*60*1e3,fe=15e3,ve="https://api.github.com/repos",H=w(()=>k(B(),"archived-repo"),"getArchivedRepoCacheDir"),te=w((r,e)=>k(H(),`${encodeURIComponent(r)}__${encodeURIComponent(e)}.json`),"cacheFilePath"),me=w((r,e)=>{const t=te(r,e);if(N(t))try{const n=V(t);if(Date.now()-n.createdAt>n.ttlMs){y(t,{force:!0});return}return n}catch{y(t,{force:!0});return}},"readCachedRepo"),Z=w((r,e,t,n)=>{W(H());const s={createdAt:Date.now(),ttlMs:n,...t};L(te(r,e),JSON.stringify(s),"utf8")},"writeCachedRepo"),pe=w(r=>{if(typeof r!="string"||r.trim()==="")return;const e=r.trim().replace(/^git\+/,""),t=/^git@github\.com:([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(e);if(t)return{owner:t[1],repo:t[2]};const n=/^ssh:\/\/git@github\.com\/([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(e);if(n)return{owner:n[1],repo:n[2]};const s=/^https?:\/\/(?:www\.)?github\.com\/([^/]+)\/([^/?#]+?)(?:\.git)?\/?$/i.exec(e);if(s)return{owner:s[1],repo:s[2]}},"parseGitHubUrl"),ge=w(async(r,e,t,n)=>{const s=`${ve}/${encodeURIComponent(r)}/${encodeURIComponent(e)}`,c=new AbortController,o=setTimeout(()=>{c.abort()},fe),i=w(()=>{c.abort()},"abortListener");n?.addEventListener("abort",i,{once:!0});const a={Accept:"application/vnd.github+json","User-Agent":"visulima-vis-marshall"};t!==void 0&&t!==""&&(a.Authorization=`Bearer ${t}`);try{const d=await fetch(s,{headers:a,signal:c.signal});if(d.status===404)return{kind:"missing"};if(!d.ok)return{kind:"transient-error"};const l=await d.json(),u=l.archived===!0,h=typeof l.archived_at=="string"?l.archived_at:void 0;return{archived:u,archivedAt:h,kind:"ok"}}catch{return{kind:"transient-error"}}finally{clearTimeout(o),n?.removeEventListener("abort",i)}},"fetchGitHubRepo"),we=w((r,e)=>e!==void 0&&r.includes(e)?e:r.at(-1),"resolveLatestVersion"),wr=w(async(r,e={})=>{if(b("archivedRepo"))return[];const t=new Set(e.allowlist),n=e.cacheTtlMs??he,s=e.githubToken??process.env.GITHUB_TOKEN,c=e.concurrency??M,o=new Map,i=w(async(a,d)=>{const l=`${a}/${d}`;let u=o.get(l);return u===void 0&&(u=(async()=>{const h=me(a,d);if(h!==void 0)return h.missing===!0?{archived:!1,kind:"missing"}:{archived:h.archived,archivedAt:h.archivedAt,kind:"ok"};const f=await ge(a,d,s,e.signal);return f.kind==="missing"?Z(a,d,{archived:!1,missing:!0},n):f.kind==="ok"&&Z(a,d,{archived:f.archived===!0,archivedAt:f.archivedAt},n),f})(),o.set(l,u)),u},"fetchRepoOnce");return(await D(r,c,async({name:a,version:d})=>{if(t.has(a))return;const l=await S(a,{workspaceRoot:e.workspaceRoot});if(l===void 0)return;const u=l.versions[d]??l.versions[we(Object.keys(l.versions),l["dist-tags"]?.latest)??""];if(u===void 0)return;const h=pe(u.repository?.url);if(h===void 0)return;const f=await i(h.owner,h.repo);if(f.kind!=="transient-error"){if(f.kind==="missing")return{kind:"missing-repo",owner:h.owner,packageName:a,repo:h.repo};if(f.archived===!0)return{...f.archivedAt===void 0?{}:{archivedAt:f.archivedAt},kind:"archived",owner:h.owner,packageName:a,repo:h.repo}}})).filter(a=>a!==void 0)},"runArchivedRepoMarshall");w(()=>{const r=H();if(!N(r))return 0;let e=0;for(const t of U(r))t.endsWith(".json")&&(y(k(r,t),{force:!0}),e+=1);return e},"clearArchivedRepoCache");var ye=Object.defineProperty,O=p((r,e)=>ye(r,"name",{value:e,configurable:!0}),"h$1");const ke={dormantErrorDays:274,dormantWarnDays:183,newPublisherWindowDays:21,recentVersionErrorDays:7,recentVersionWarnDays:30},$e=1440*60*1e3,J=O((r,e)=>(r-e)/$e,"daysBetween"),C=O(r=>{if(r!==void 0)return r.email??r.name},"userIdentity"),be=O((r,e,t,n,s)=>{const c=r.time?.[t];if(c===void 0)return;const o=new Date(c).getTime();if(!Number.isFinite(o))return;const i=J(n,o);if(i<s.recentVersionErrorDays)return{kind:"recent-version",message:`published ${i.toFixed(1)} days ago (error threshold: ${String(s.recentVersionErrorDays)})`,packageName:e,severity:"error",version:t};if(i<s.recentVersionWarnDays)return{kind:"recent-version",message:`published ${i.toFixed(1)} days ago (warn threshold: ${String(s.recentVersionWarnDays)})`,packageName:e,severity:"warning",version:t}},"checkRecentVersion"),De=O((r,e,t,n,s)=>{const c=r.versions[t],o=C(c?._npmUser);if(o===void 0)return;const i=Object.keys(r.versions).filter(u=>g.valid(u)!==null).filter(u=>g.lt(u,t));if(i.length===0||i.some(u=>C(r.versions[u]?._npmUser)===o))return;const a=r.time?.[i[0]??""];if(a===void 0)return;const d=new Date(a).getTime();if(!Number.isFinite(d))return;const l=J(n,d);if(!(l<=s.newPublisherWindowDays))return{kind:"new-publisher",message:`first publish by ${o} on a ${l.toFixed(0)}-day-old package`,packageName:e,severity:"error",version:t}},"checkNewPublisher"),Me=O((r,e,t,n,s)=>{const c=r.versions[t],o=C(c?._npmUser);if(o===void 0)return;const i=[];for(const[l,u]of Object.entries(r.versions)){if(l===t||C(u._npmUser)!==o)continue;const h=r.time?.[l];if(h===void 0)continue;const f=new Date(h).getTime();Number.isFinite(f)&&i.push(f)}if(i.length===0)return;const a=Math.max(...i),d=J(n,a);if(d>=s.dormantErrorDays)return{kind:"dormant-maintainer",message:`previous release by ${o} was ${d.toFixed(0)} days ago (error threshold: ${String(s.dormantErrorDays)})`,packageName:e,severity:"error",version:t};if(d>=s.dormantWarnDays)return{kind:"dormant-maintainer",message:`previous release by ${o} was ${d.toFixed(0)} days ago (warn threshold: ${String(s.dormantWarnDays)})`,packageName:e,severity:"warning",version:t}},"checkDormantMaintainer"),yr=O(async(r,e={})=>{if(b("author"))return[];const t=new Set(e.allowlist),n={...ke,...e.thresholds},s=e.now??(()=>Date.now()),c=e.concurrency??M;return(await D(r,c,async({name:o,version:i})=>{if(t.has(o))return[];const a=await S(o,{cacheTtlMs:e.cacheTtlMs,signal:e.signal,workspaceRoot:e.workspaceRoot});if(a===void 0)return[];const d=s(),l=[],u=be(a,o,i,d,n);u!==void 0&&l.push(u);const h=De(a,o,i,d,n);h!==void 0&&l.push(h);const f=Me(a,o,i,d,n);return f!==void 0&&l.push(f),l})).flat()},"runAuthorMarshall");var Re=Object.defineProperty,$=p((r,e)=>Re(r,"name",{value:e,configurable:!0}),"t$1");const Ae=1440*60*1e3,Ne=15e3,Se=20,Oe=1e4,Ee="https://api.npmjs.org/downloads/point/last-month",z=$(()=>k(B(),"downloads"),"getDownloadsCacheDir"),ne=$(r=>k(z(),`${encodeURIComponent(r)}.json`),"cacheFilePath"),Te=$(r=>{const e=ne(r);if(N(e))try{const t=V(e);if(Date.now()-t.createdAt>t.ttlMs){y(e,{force:!0});return}return t.downloads}catch{y(e,{force:!0});return}},"readCachedDownloads"),je=$((r,e,t)=>{W(z());const n={createdAt:Date.now(),downloads:e,observedAt:new Date().toISOString(),ttlMs:t};L(ne(r),JSON.stringify(n),"utf8")},"writeCachedDownloads"),Ce=$(async(r,e)=>{const t=`${Ee}/${encodeURIComponent(r)}`,n=new AbortController,s=setTimeout(()=>{n.abort()},Ne),c=$(()=>{n.abort()},"abortListener");e?.addEventListener("abort",c,{once:!0});try{const o=await fetch(t,{signal:n.signal});if(o.status===404)return{kind:"no-data"};if(!o.ok)return{kind:"error"};const i=await o.json();return typeof i.downloads=="number"?{downloads:i.downloads,kind:"ok"}:{kind:"no-data"}}catch{return{kind:"error"}}finally{clearTimeout(s),e?.removeEventListener("abort",c)}},"fetchDownloads"),kr=$(async(r,e={})=>{if(b("downloads"))return[];const t=new Set(e.allowlist),n=e.errorThreshold??Se,s=e.warnThreshold??Oe,c=e.cacheTtlMs??Ae,o=e.concurrency??M;return(await D(r,o,async i=>{if(t.has(i))return;let a=Te(i);if(a===void 0){const d=await Ce(i,e.signal);if(d.kind==="no-data"||d.kind==="error")return{downloadsLastMonth:void 0,kind:"no-data",packageName:i,severity:"warning"};a=d.downloads??0,je(i,a,c)}if(a<n)return{downloadsLastMonth:a,kind:"below-error",packageName:i,severity:"error"};if(a<s)return{downloadsLastMonth:a,kind:"below-warning",packageName:i,severity:"warning"}})).filter(i=>i!==void 0)},"runDownloadsMarshall");$(()=>{const r=z();if(!N(r))return 0;let e=0;for(const t of U(r))t.endsWith(".json")&&(y(k(r,t),{force:!0}),e+=1);return e},"clearDownloadsCache");var xe=Object.defineProperty,m=p((r,e)=>xe(r,"name",{value:e,configurable:!0}),"t");const Pe=1440*60*1e3,_e=4e3,Fe=["1.1.1.1","8.8.8.8"],q=m(()=>k(B(),"expired-domains"),"getExpiredDomainsCacheDir"),se=m(r=>{const e=ce("sha256").update(r).digest("hex").slice(0,12);return k(q(),`${e}.json`)},"cacheFilePath"),Le=m(r=>{const e=se(r);if(N(e))try{const t=V(e);if(Date.now()-t.createdAt>t.ttlMs){y(e,{force:!0});return}return t}catch{y(e,{force:!0});return}},"readCachedDomain"),Ue=m((r,e,t)=>{W(q());const n={createdAt:Date.now(),outcome:e,ttlMs:t};L(se(r),JSON.stringify(n),"utf8")},"writeCachedDomain"),Ve=m(r=>{if(typeof r!="string")return;const e=r.lastIndexOf("@");if(e===-1||e===r.length-1)return;const t=r.slice(e+1).trim().toLowerCase();return t===""?void 0:t},"extractDomain"),We=m((r,e)=>{const t=[];e!==void 0&&t.push(e);for(const n of r??[])t.push(n);return t},"collectMaintainers"),Be=m(async(r,e)=>{let t;try{return await Promise.race([r,new Promise((n,s)=>{t=setTimeout(()=>{s(new Error("ETIMEDOUT"))},e)})])}finally{t!==void 0&&clearTimeout(t)}},"withTimeout"),Ie=m(r=>{if(r===null||typeof r!="object")return!1;const{code:e}=r;return e==="ENOTFOUND"||e==="ENODATA"||e==="NXDOMAIN"},"isExpiredError"),He=m(async(r,e,t)=>{try{const n=await Be(r.resolveNs(e),t);return Array.isArray(n)&&n.length>0?{kind:"ok"}:{kind:"expired"}}catch(n){return Ie(n)?{kind:"expired"}:{kind:"transient-error"}}},"resolveDomain"),Je=m((r,e)=>e!==void 0&&r.includes(e)?e:r.at(-1),"resolveLatestVersion"),$r=m(async(r,e={})=>{if(b("expiredDomains"))return[];const t=new Set(e.allowlist),n=new Set((e.allowDomains??[]).map(u=>u.toLowerCase())),s=e.cacheTtlMs??Pe,c=e.perDomainTimeoutMs??_e,o=e.dnsServers??Fe,i=e.concurrency??M,a=e.createResolver===void 0?new de:e.createResolver();typeof a.setServers=="function"&&a.setServers(o);const d=new Map,l=m(async u=>{let h=d.get(u);return h===void 0&&(h=(async()=>{const f=Le(u);if(f!==void 0)return{kind:f.outcome==="ok"?"ok":"expired"};const v=await He(a,u,c);return v.kind!=="transient-error"&&Ue(u,v.kind,s),v})(),d.set(u,h)),h},"resolveDomainOnce");return(await D(r,i,async({name:u,version:h})=>{if(t.has(u))return[];const f=await S(u,{workspaceRoot:e.workspaceRoot});if(f===void 0)return[];const v=f.versions[h]??f.versions[Je(Object.keys(f.versions),f["dist-tags"]?.latest)??""];if(v===void 0)return[];const P=We(v.maintainers,v._npmUser),K=new Set,_=[];for(const T of P){const A=Ve(T.email);if(A===void 0||n.has(A))continue;const X=`${A}:${T.email??""}`;if(K.has(X))continue;K.add(X);const Y=await l(A);Y.kind==="expired"?_.push({domain:A,kind:"expired",maintainer:T.email??"",packageName:u,severity:"error"}):Y.kind==="transient-error"&&_.push({domain:A,kind:"unresolved",maintainer:T.email??"",packageName:u,severity:"warning"})}return _})).flat()},"runExpiredDomainsMarshall");m(()=>{const r=q();if(!N(r))return 0;let e=0;for(const t of U(r))t.endsWith(".json")&&(y(k(r,t),{force:!0}),e+=1);return e},"clearExpiredDomainsCache");var ze=Object.defineProperty,R=p((r,e)=>ze(r,"name",{value:e,configurable:!0}),"s");const qe=["readme","license","repo"],Ge=["ERROR: No README data found!","# Security holding package"],Ke=R(r=>{const e=r.trim();return e===""?!0:Ge.some(t=>e.startsWith(t))},"isPlaceholderReadme"),Xe=R((r,e)=>{if(typeof e.readme=="string")return e.readme;if(typeof r.readme=="string")return r.readme},"getReadme"),Ye=R((r,e)=>{const t=Xe(r,e);if(t===void 0)return"missing-readme";if(Ke(t))return"placeholder-readme"},"checkReadme"),Qe=R(r=>{const{license:e}=r;return e===void 0?"missing-license":typeof e=="string"?e.trim()===""?"missing-license":void 0:typeof e.type=="string"&&e.type.trim()!==""?void 0:"missing-license"},"checkLicense"),Ze=R(r=>{const{repository:e}=r;if(e===void 0)return"missing-repo";const t=typeof e.url=="string"?e.url.trim():"";if(t==="")return"missing-repo";let n=t.replace(/^git\+/,"");const s=/^git@([^:]+):(.+?)(?:\.git)?$/.exec(n);return s&&(n=`https://${s[1]}/${s[2]}`),URL.canParse(n)?void 0:"invalid-repo-url"},"checkRepository"),er=R(r=>{const e=r["dist-tags"]?.latest;return e!==void 0&&Object.hasOwn(r.versions,e)?e:Object.keys(r.versions).at(-1)},"resolveLatestVersion"),br=R(async(r,e={})=>{if(b("metadata"))return[];const t=new Set(e.allowlist),n=new Set(e.checks??qe),s=e.concurrency??M;return(await D(r,s,async({name:c,version:o})=>{if(t.has(c))return;const i=await S(c,{workspaceRoot:e.workspaceRoot});if(i===void 0)return;const a=i.versions[o]??i.versions[er(i)??""];if(a===void 0||a.private===!0)return;const d=[];if(n.has("readme")){const l=Ye(i,a);l!==void 0&&d.push(l)}if(n.has("license")){const l=Qe(a);l!==void 0&&d.push(l)}if(n.has("repo")){const l=Ze(a);l!==void 0&&d.push(l)}if(d.length!==0)return{issues:d,packageName:c,version:o}})).filter(c=>c!==void 0)},"runMetadataMarshall");var rr=Object.defineProperty,G=p((r,e)=>rr(r,"name",{value:e,configurable:!0}),"o");const ee=G((r,e)=>r===void 0?{}:typeof r=="string"?{[e.startsWith("@")?e.split("/").at(1)??e:e]:r}:{...r},"normalizeBin"),tr=G((r,e)=>g.valid(e)?Object.keys(r.versions).filter(t=>g.valid(t)!==null&&g.lt(t,e)).sort((t,n)=>g.lt(t,n)?1:-1)[0]:void 0,"findImmediatelyPriorVersion"),Dr=G(async(r,e={})=>{if(b("newBin"))return[];const t=new Set(e.allowlist),n=new Set(e.allowBins),s=e.concurrency??M;return(await D(r,s,async({name:c,version:o})=>{if(t.has(c))return;const i=await S(c,{workspaceRoot:e.workspaceRoot});if(i===void 0)return;const a=i.versions[o];if(a===void 0)return;const d=tr(i,o);if(d===void 0)return;const l=i.versions[d];if(l===void 0)return;const u=ee(a.bin,c),h=ee(l.bin,c),f=Object.entries(u).filter(([v])=>!(v in h)).filter(([v])=>!n.has(v)).map(([v,P])=>({command:P,name:v}));if(f.length!==0)return{fromVersion:d,newBins:f,packageName:c,toVersion:o}})).filter(c=>c!==void 0)},"runNewBinMarshall");var nr=Object.defineProperty,x=p((r,e)=>nr(r,"name",{value:e,configurable:!0}),"a");const sr=["preinstall","install","postinstall"],re=x((r,e)=>r.versions[e]?.dist?.attestations?.provenance!==void 0,"hasProvenance"),ir=x((r,e)=>{if(g.valid(e)!==null)return Object.keys(r.versions).filter(t=>g.valid(t)!==null&&g.prerelease(t)===null&&g.lt(t,e)).sort((t,n)=>g.lt(t,n)?1:-1)[0]},"findNewestPriorStable"),or=x((r,e)=>{const t=r??{},n=e??{},s=[];for(const c of sr){const o=t[c];if(o===void 0||o==="")continue;const i=n[c];i===void 0||i===""?s.push({command:o,hook:c,kind:"introduced"}):i!==o&&s.push({command:o,hook:c,kind:"changed"})}return s},"installHookChanges"),Mr=x(async(r,e={})=>{if(b("s1ngularity"))return[];const t=new Set(e.allowlist),n=e.concurrency??M;return(await D(r,n,async({name:s,version:c})=>{if(t.has(s))return;const o=await S(s,{workspaceRoot:e.workspaceRoot});if(o?.versions[c]===void 0)return;const i=ir(o,c);if(i===void 0||!re(o,i)||re(o,c))return;const a=or(o.versions[c]?.scripts,o.versions[i]?.scripts);if(a.length!==0)return{hookChanges:a,packageName:s,priorVersion:i,trustSignal:"provenance-dropped",version:c}})).filter(s=>s!==void 0)},"runS1ngularityMarshall");export{mr as M,Mr as a,Dr as b,br as c,kr as d,$r as e,wr as f,gr as g,pr as h,yr as r};
@@ -1,2 +0,0 @@
1
- var x=Object.defineProperty;var g=(t,e)=>x(t,"name",{value:e,configurable:!0});import{e as C,E as b,I as E,T as P}from"./index.server-B7ETiT4C.js";import{render as R}from"@visulima/tui";import{Z as m,s as $}from"../packem_chunks/bin.js";import S from"react";import{jsx as o,jsxs as y}from"react/jsx-runtime";import{Box as d}from"@visulima/tui/components/box";import{Spinner as j}from"@visulima/tui/components/spinner";import{Text as l}from"@visulima/tui/components/text";import{D as T,W as O,T as A,C as D}from"./symbols-CQmER5MT.js";var I=Object.defineProperty,Y=g((t,e)=>I(t,"name",{value:e,configurable:!0}),"l");const v=Y(({rows:t})=>o(d,{flexDirection:"column",children:t.map(e=>{let s;switch(e.status){case"error":{s=o(l,{color:"red",children:D});break}case"ok":{s=o(l,{color:"green",children:A});break}case"running":{s=o(l,{color:"white",children:o(j,{type:"dots"})});break}case"warn":{s=o(l,{color:"yellow",children:O});break}default:{s=o(l,{dimColor:!0,children:T});break}}return y(d,{children:[o(d,{width:3,children:s}),o(d,{flexGrow:1,children:o(l,{children:e.label})}),e.summary?o(d,{children:y(l,{dimColor:!0,children:[T," ",e.summary]})}):null]},e.id)})}),"ScanProgressApp");var B=Object.defineProperty,i=g((t,e)=>B(t,"name",{value:e,configurable:!0}),"e");const G={error:P(m.failure),ok:E(m.success),pending:b(m.dash),skip:b(m.dash),warn:C(m.warning)},M=i((t,e,s)=>{const p=s?`${t} ${b(`— ${s}`)}`:t;return` ${G[e]} ${p}
2
- `},"formatStaticRow"),Q=i((t,e={})=>{const s=e.stream??process.stderr,p=typeof s.isTTY=="boolean"&&s.isTTY&&!$,k=e.live??p,n=new Map;for(const r of t)n.set(r.id,{id:r.id,label:r.label,status:"pending"});if(!k||t.length===0)return{finish:i((r,a,f)=>{const c=n.get(r);c&&(n.set(r,{...c,status:a,summary:f}),s.write(M(c.label,a,f)))},"finish"),start:i(r=>{const a=n.get(r);a&&n.set(r,{...a,status:"running"})},"start"),stop:i(()=>{},"stop")};const w=i(()=>t.map(r=>n.get(r.id)),"buildRows");let u=R(S.createElement(v,{rows:w()}),{interactive:!0,patchConsole:!1});const h=i(()=>{u?.rerender(S.createElement(v,{rows:w()}))},"rerender");return{finish:i((r,a,f)=>{const c=n.get(r);c&&(n.set(r,{...c,status:a,summary:f}),h())},"finish"),start:i(r=>{const a=n.get(r);a&&(n.set(r,{...a,status:"running"}),h())},"start"),stop:i(()=>{u&&(h(),u.unmount(),u=void 0)},"stop")}},"startScanProgress");export{Q as s};
@@ -1 +0,0 @@
1
- var $=Object.defineProperty;var l=(e,s)=>$(e,"name",{value:s,configurable:!0});import{createRequire as z}from"node:module";import{T as b,e as k}from"./index.server-B7ETiT4C.js";import{M as C,i as D}from"./readFileSync-CGmzMUF2-D6rUjGDn.js";import{n as A}from"../packem_chunks/config.js";import{g as O}from"./index-efSniSRN.js";import{i as f,p as i}from"../packem_chunks/bin.js";const _=z(import.meta.url),m=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,T=l(e=>{if(typeof m<"u"&&m.versions&&m.versions.node){const[s,r]=m.versions.node.split(".").map(Number);if(s>22||s===22&&r>=3||s===20&&r>=16)return m.getBuiltinModule(e)}return _(e)},"__cjs_getBuiltinModule"),{createInterface:M}=T("node:readline");var F=["aj","aju","av","avj","ejv","jav","jv"],N=["angula","angular-node","angularjs"],P=["auto-prefixer"],B=["aaxios","aios","axio","axioos","axios-node","axioss","axis","axiso","axois","axos","axxios"],R=["abel","babbel","babe","babel-js","babel-node","babl","bable","bbael","bebel"],S=["bcrpyt","bcrypt-node","brcypt","crypt","dcrypt"],W=["bcryptjs-node","dcryptjs"],L=["bunan","bunya","bunyan-node","buynan"],E=["cai","cha","chaijs","chal","chi","chia","hai"],U=["cahlk","calk","cchalk","ch4lk","cha1k","chaalk","chaik","chak","chakl","chalk-node","chalkk","challk","chhalk","chlak","chlk","halk","hcalk"],V=["cheero","cherio"],I=["c0lor","ccolor","clor","colo","coloor","color-js","colorjs","colorr","colr","coolor","coolr"],J=["ccolors","colors-node","colorss","colorz","colrs","coolors"],Y=["c0mmander","ccommander","cmmander","cmomander","co-mmander","comamnder","comander","comm4nder","commaander","commader","commadner","commamder","command3r","commandder","commande","commandeer","commander-js","commanderr","commandr","commandre","commanedr","commaner","commannder","commender","commmander","commnader","commnder","coommander","ocmmander","ommander"],G=["cor","corss","cos","cosr","cros","crs","ors"],H=["days"],K=["d3bug","dbeug","dbug","ddebug","debbug","debg","debgu","debu","debu9","debug-js","debug-node","debugg","debugjs","debuug","deebug","deubg","deug","ebug","edbug"],Q=["dot-env","dotenv-node","dotenvjs","dotevn"],X=["3lectron","eectron","eelctron","eelectron","el3ctron","elcetron","elctron","elecctron","elecron","elecrton","electon","electorn","electr0n","electrn","electrno","electro","electrom","electron-node","electronn","electroon","electrron","electtron","eleectron","eletcron","eletron","ellectron","lectron","leectron"],Z=["asbuild","ebuild","esbuild-node","esbuildjs","ezbuild","sbuild"],ee=["aslint","elint","eslint-js","eslint-node","eslit","ezlint","slint"],oe=["eexpress","epress","epxress","experss","expess","exppress","expreess","expres","express-node","expressjs","expresss","exprress","exprses","exprss","exress","exrpess","exxpress","xepress","xpress"],se=["astify"],re=["firebasejs"],ae=["form1dable"],te=["glb","glo","glob-js","globjs","gob","golb","lob"],ne=["go","goot","gotjs","gott","gt","gto","ogt","ot","qot"],ce=["helmetjs","helnet"],ie=["homo","hon","hoo","hoon","ohno","ono"],de=["inquire","inquirer-js","nquirer"],me=["iredis"],le=["ejst","est","jast","jes","jestjs","jestt","jet","jets","jst"],pe=["imp","jim","jip","jmp"],ue=["ji","jio","jo","joii","jol","oi","oji"],ve=["jdom","jsdm","jsdo","jsdom-js","jsdon","jsom","sdom"],he=["jsonwebtoken-js","jsonwebtoken-node"],je=["ka","kao","ko","koaa","koajs","koe","oa","oka"],be=["1odash","iodash","l0dash","ldash","ldoash","llodash","lo-dash","loadsh","loash","lobash","lod4sh","lodaash","lodah","lodahs","lodas","lodash-node","lodashh","lodassh","loddash","lodesh","lodsah","lodsh","loodash","odash","oldash"],ke=["luca","luci","lucie"],ge=["luon","luxo","luxon-js"],fe=["imcromatch","mciromatch","micormatch","micrmoatch","micro-match","microamtch","micromacth","micromathc","micromtach","mircomatch"],ye=["minimath"],xe=["mcha","mmocha","moca","moch","mocha-js","moha","nocha","ocha"],we=["m0ment","mment","mmoent","mmoment","moemnt","moent","mom3nt","momeent","momemt","momen","momen7","momennt","moment-js","momentjs","momentt","momet","mometn","momment","momnet","momnt","monent","mooment","oment","omment"],qe=["mognoose","mogoose","mongoos","mongose","monqoose","moongoose"],$e=["moran","organ"],ze=["muler","multer-js","muter"],_e=["mysql"],Te=["ext","mext","n3xt","naxt","net","netx","nex","next-js","next-node","nextjs","nxt"],Me=["node-mailer","nodemailer-js"],Ce=["nodemo","nodemonjs","nodmeon"],De=["oar","or","ora-node","ore","ra","roa"],Ae=["arcel","parce","parceljs"],Oe=["passport-js"],Fe=["phase","phaser-node"],Ne=["ino","pimo","pin","pino-node","pinojs","pio","pion"],Pe=["playright","playwright-js"],Be=["postcss-js","postcss-node","potscss"],Re=["pettier","pprettier","pretier","prettierjs","prettierr","prtetier"],Se=["prima","prism","prisma-js","prismajs","prizma"],We=["pupeteer"],Le=["rada","rama","ramd","randa"],Ee=["eact","eract","r3act","raact","ract","raect","re4ct","reaact","reac","reac7","reacct","react-node","reactjs","reactt","reat","reatc","recat","rect","reeact","reect","rreact"],Ue=["erdis","radis","rdis","redi","redis-js","redis-node","rediss","rediz","reds","reis","rredis"],Ve=["resen","rsend"],Ie=["ollup","rollup-js","rollup-node"],Je=["ass","asss","sas","sass-node","sess","ssas","sss"],Ye=["emver","seemver","semver-node","semvre","senver","sever"],Ge=["sequelize-js","sequelize-node"],He=["harp","shap","shar","sharp-js","sharpjs"],Ke=["stipe","strip","stripe-node","tripe"],Qe=["supabase-js"],Xe=["suelte","svelt3","svelte-js","sveltejs","velte"],Ze=["tailwindcss-js"],eo=["auri","taui"],oo=["hree","htree","thee","there","three-js","three-node","tree"],so=["stx","sx","ts","tsxx","ttsx","tx","txs","tzx"],ro=["ttypescript","typecript","typescipt","typescript-node","typescriptjs","typescrit","typescritp"],ao=["udnerscore","undercore","underscoer","underscore-node","underscroe","undersocre","undesrcore"],to=["uid","uud","uudi","uui","uuid-js","uuid-node","uuidjs","vuid"],no=["ite","vie","vit","vita","vite-node","vitee","vlte","vte"],co=["itest","uitest","vitestjs","vitezt","vittest","vtest"],io=["ue","uue","uve","ve","veu","vu","vu3","vua","vue-node","vuee","vuejs","vuue","vve","vvue"],mo=["web-pack","weback","webpac","webpack-node","webpackjs","webpak","weebpack","wepack","wepback"],lo=["winson","winston-js","winstoon"],po=["up","uyp","yp","yu","yupjs","yupp"],uo=["od","zd","zdo","zo","zob","zod-js","zodjs"];const vo={ajv:F,angular:N,autoprefixer:P,"aws-sdk":["awssdk","ews-sdk"],axios:B,babel:R,bcrypt:S,bcryptjs:W,"body-parser":["body-paresr","body-parse","body-parser-js","body_parser"],bunyan:L,chai:E,chalk:U,cheerio:V,color:I,colors:J,commander:Y,"cookie-parser":["cookie-parse","cookieparser"],cors:G,"cross-env":["crossenv"],"date-fns":["data-fns","date-fn"],dayjs:H,debug:K,dotenv:Q,electron:X,esbuild:Z,eslint:ee,express:oe,fastify:se,firebase:re,formidable:ae,glob:te,got:ne,helmet:ce,hono:ie,inquirer:de,ioredis:me,jest:le,jimp:pe,joi:ue,jsdom:ve,jsonwebtoken:he,koa:je,lodash:be,lucia:ke,luxon:ge,micromatch:fe,minimatch:ye,mocha:xe,moment:we,mongoose:qe,morgan:$e,multer:ze,mysql2:_e,next:Te,"node-fetch":["node-fecth","node-fethc","node.fetch"],nodemailer:Me,nodemon:Ce,ora:De,parcel:Ae,passport:Oe,phaser:Fe,pino:Ne,playwright:Pe,postcss:Be,prettier:Re,prisma:Se,puppeteer:We,ramda:Le,react:Ee,"react-dom":["eact-dom","eract-dom","r3act-dom","ract-dom","raect-dom","re4ct-dom","reaact-dom","reac-dom","reac7-dom","reacct-dom","react-bom","react-d0m","react-ddom","react-dm","react-dmo","react-do","react-domm","react-don","react-doom","react-odm","react-om","react.dom","reactdom","reactt-dom","reat-dom","reatc-dom","recat-dom","rect-dom","reeact-dom","rreact-dom"],redis:Ue,resend:Ve,rollup:Ie,sass:Je,semver:Ye,sequelize:Ge,sharp:He,"socket.io":["ocket.io","oscket.io","scket.io","scoket.io","soccket.io","socekt.io","socet.io","sock3t.io","socke.io","socke7.io","sockeet.io","socket.1o","socket.i","socket.iio","socket.ioo","socket.lo","socket.o","socket.oi","sockett.io","sockket.io","sockt.io","sockte.io","sokcet.io","soket.io","soocket.io","ssocket.io"],stripe:Ke,supabase:Qe,svelte:Xe,tailwindcss:Ze,tauri:eo,three:oo,"ts-node":["tts-node"],tsx:so,typescript:ro,underscore:ao,uuid:to,vite:no,vitest:co,vue:io,webpack:mo,winston:lo,yup:po,zod:uo};var v,g;function ho(){return g||(g=1,v={"@tanstack/start":["start-tanstack-app","tanstack","tanstack-app","tanstack-start"]}),v}l(ho,"requireTyposquatsManual");var jo=ho();const bo=O(jo);var ko=Object.defineProperty,n=l((e,s)=>ko(e,"name",{value:s,configurable:!0}),"c");const go={a:["4","e"],b:["d"],d:["b"],e:["3","a"],g:["9","q"],i:["1","l"],l:["1","i"],m:["n"],n:["m"],o:["0"],s:["5","z"],t:["7"],u:["v"],v:["u"]},fo=["app","cli","core","kit","lib","pkg","sdk"],yo=n(e=>{const s=new Set;if(e.length<3)return s;for(let o=0;o<e.length;o++){const a=e[o],t=a==="-"||a==="."||a==="_";if(t||s.add(e.slice(0,o)+e.slice(o+1)),t||s.add(e.slice(0,o)+a+e.slice(o)),o<e.length-1&&e[o]!==e[o+1]){const u=e[o+1]==="-"||e[o+1]==="."||e[o+1]==="_";if(!t&&!u){const d=[...e];[d[o],d[o+1]]=[d[o+1],d[o]],s.add(d.join(""))}}const c=e[o].toLowerCase(),j=go[c];if(j)for(const u of j)s.add(e.slice(0,o)+u+e.slice(o+1))}const r=/[-._]/g;if(r.test(e))s.add(e.replaceAll(r,"")),s.add(e.replaceAll(r,"-")),s.add(e.replaceAll(r,".")),s.add(e.replaceAll(r,"_"));else if(e.length>5)for(let o=2;o<e.length-2;o++)s.add(`${e.slice(0,o)}-${e.slice(o)}`),s.add(`${e.slice(0,o)}.${e.slice(o)}`),s.add(`${e.slice(0,o)}_${e.slice(o)}`);if(e.startsWith("@")||(s.add(`${e}-js`),s.add(`${e}js`),s.add(`${e}-node`)),e.startsWith("@")){const o=e.indexOf("/");if(o>1&&o<e.length-1){const a=e.slice(1,o),t=e.slice(o+1);a.length>=3&&s.add(a);for(const c of["","-",".","_"])s.add(`${a}${c}${t}`),s.add(`${t}${c}${a}`);for(const c of fo)s.add(`${a}-${c}`),s.add(`${t}-${a}-${c}`),s.add(`${c}-${a}-${t}`)}}return s.delete(e),s},"generateVariants");let h,p;const y=n(()=>{if(!h){const e={};for(const s of[vo,bo])for(const[r,o]of Object.entries(s)){const a=e[r]??(e[r]=[]);for(const t of o)a.includes(t)||a.push(t)}h=e}return h},"loadBlocklist"),xo=n(()=>{if(!p){p=new Map;for(const[e,s]of Object.entries(y()))for(const r of s)p.set(r,e)}return p},"getReverseLookup"),wo=n(e=>e.startsWith("@")?e.split("/")[1]??e:e,"bareName"),qo=n(e=>{const s=wo(e),r=xo().get(s);if(r)return{input:e,legitimate:r,method:"blocklist"};for(const o of Object.keys(y()))if(yo(o).has(s))return{input:e,legitimate:o,method:"heuristic"}},"checkTyposquat"),x=n((e,s)=>{const r=s?new Set(s):void 0,o=[];for(const a of e){if(r?.has(a))continue;const t=qo(a);t&&o.push(t)}return o},"checkTyposquats"),w=n((e,s)=>{i.warn(""),i.warn(b(`Possible typosquat${e.length===1?"":"s"} ${s}:`));for(const r of e){const o=r.method==="blocklist"?"known typosquat":"similar name";i.warn(` ${k("⚠")} ${b(r.input)} — did you mean ${k(r.legitimate)}? (${o})`)}i.warn("")},"printTyposquatWarnings"),q=n(async e=>{if(!process.stdin.isTTY){i.warn("Aborting: potential typosquat detected in non-interactive mode. Use --no-typosquat-check to skip.");return}const s=M({input:process.stdin,output:process.stdout}),r=await new Promise(o=>{s.question(e,a=>{o(a.trim().toLowerCase())})});return s.close(),r},"askConfirmation"),No=n(async(e,s)=>{if(f("typosquats"))return{ok:!0,packages:e};const r=x(e,s);if(r.length===0)return{ok:!0,packages:e};w(r,"detected");const o=await q(`Use suggested package${r.length===1?"":"s"} instead? [S]uggested / [y]es, keep original / [N]o, abort (default: N) `);if(o===void 0)return{ok:!1,packages:e};if(o==="s"||o==="suggested"){const a=new Map(r.map(t=>[t.input,t.legitimate]));return{ok:!0,packages:e.map(t=>a.get(t)??t)}}return o==="y"||o==="yes"?{ok:!0,packages:e}:{ok:!1,packages:e}},"runTyposquatCheck"),$o=/^(?:npm|pnpm|yarn):(.+?)(?:@.*)?$/,zo=n(e=>$o.exec(e)?.[1],"parseAliasTarget"),_o=n(e=>{if(!D(e))return[];const s=A(e),r={...s.dependencies,...s.devDependencies,...s.optionalDependencies,...s.peerDependencies},o=new Set;for(const[a,t]of Object.entries(r)){o.add(a);const c=zo(t);c&&o.add(c)}return[...o]},"readDepsFromPackageJson"),Po=n(async(e,s)=>{if(f("typosquats"))return!0;const r=C(e,"package.json"),o=_o(r);if(o.length===0)return!0;const a=x(o,s);if(a.length===0)return!0;w(a,"in package.json dependencies"),i.warn("Fix the package name in package.json before proceeding.");const t=await q("Continue anyway? [y/N] ");return t==="y"||t==="yes"},"scanDepsForTyposquats");export{No as r,Po as s};
@@ -1 +0,0 @@
1
- var o=Object.defineProperty;var n=(e,r)=>o(e,"name",{value:r,configurable:!0});import{measureElement as i}from"@visulima/tui";import{useRef as f,useState as m,useLayoutEffect as c}from"react";var g=Object.defineProperty,h=n((e,r)=>g(e,"name",{value:r,configurable:!0}),"i");const v=h((e,r)=>{const u=f(null),[s,a]=m(e);return c(()=>{if(!u.current)return;const{height:t}=i(u.current);t>0&&t!==s&&(a(t),r?.(t))}),{measuredHeight:s,ref:u}},"useMeasuredHeight");export{v as u};