@visulima/vis 1.0.0-alpha.24 → 1.0.0-alpha.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +78 -0
- package/LICENSE.md +1154 -179
- package/README.md +5 -3
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/config/index.d.ts +19 -0
- package/dist/packem_chunks/bin.js +299 -290
- package/dist/packem_chunks/bloom-status.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/config.js +15 -15
- package/dist/packem_chunks/fix.js +1 -1
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +2 -2
- package/dist/packem_chunks/handler11.js +1 -1
- package/dist/packem_chunks/handler12.js +1 -1
- package/dist/packem_chunks/handler13.js +1 -1
- package/dist/packem_chunks/handler14.js +10 -10
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler16.js +1 -1
- package/dist/packem_chunks/handler17.js +1 -1
- package/dist/packem_chunks/handler18.js +1 -1
- package/dist/packem_chunks/handler19.js +1 -1
- package/dist/packem_chunks/handler2.js +2 -2
- package/dist/packem_chunks/handler20.js +1 -1
- package/dist/packem_chunks/handler21.js +5 -5
- package/dist/packem_chunks/handler22.js +2 -2
- package/dist/packem_chunks/handler23.js +2 -2
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler25.js +1 -1
- package/dist/packem_chunks/handler27.js +1 -1
- package/dist/packem_chunks/handler28.js +1 -1
- package/dist/packem_chunks/handler29.js +1 -1
- package/dist/packem_chunks/handler3.js +1 -1
- package/dist/packem_chunks/handler30.js +1 -1
- package/dist/packem_chunks/handler31.js +1 -1
- package/dist/packem_chunks/handler32.js +3 -3
- package/dist/packem_chunks/handler34.js +5 -28
- package/dist/packem_chunks/handler35.js +22 -5
- package/dist/packem_chunks/handler36.js +60 -21
- package/dist/packem_chunks/handler37.js +6 -61
- package/dist/packem_chunks/handler38.js +24 -6
- package/dist/packem_chunks/handler39.js +152 -707
- package/dist/packem_chunks/handler4.js +1 -1
- package/dist/packem_chunks/handler40.js +10 -24
- package/dist/packem_chunks/handler41.js +25 -286
- package/dist/packem_chunks/handler42.js +707 -152
- package/dist/packem_chunks/handler43.js +24 -10
- package/dist/packem_chunks/handler44.js +322 -25
- package/dist/packem_chunks/handler45.js +46 -24
- package/dist/packem_chunks/handler46.js +1 -1
- package/dist/packem_chunks/handler47.js +7 -7
- package/dist/packem_chunks/handler48.js +66 -58
- package/dist/packem_chunks/handler5.js +3 -3
- package/dist/packem_chunks/handler6.js +1 -1
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/handler9.js +1 -1
- package/dist/packem_chunks/heal-accept.js +1 -1
- package/dist/packem_chunks/heal.js +1 -1
- package/dist/packem_chunks/help-command.js +16 -16
- package/dist/packem_chunks/index.js +6 -6
- package/dist/packem_chunks/list.js +1 -1
- package/dist/packem_chunks/loader.js +1 -1
- package/dist/packem_chunks/prune.js +3 -3
- package/dist/packem_chunks/run.js +1 -1
- package/dist/packem_chunks/status.js +1 -1
- package/dist/packem_chunks/sync.js +1 -1
- package/dist/packem_chunks/sync2.js +1 -1
- package/dist/packem_chunks/tripwire.js +1 -1
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_shared/{advisories-U1QKY_tg.js → advisories-DS8JEB_g.js} +1 -1
- package/dist/packem_shared/affected-shas-Dm7eqcI8.js +1 -0
- package/dist/packem_shared/{ai-analysis-B8pDCOuT.js → ai-analysis-Csn82p17.js} +1 -1
- package/dist/packem_shared/{ai-fix-DiGSrGKv.js → ai-fix-BlYyz5bI.js} +3 -3
- package/dist/packem_shared/{cyclonedx-DPEW0nwS.js → cyclonedx-ja1cbU69.js} +1 -1
- package/dist/packem_shared/dependency-scan-s2MD0vi-.js +1 -0
- package/dist/packem_shared/{docker-_pBC9Loj.js → docker-Bw9gKo69.js} +1 -1
- package/dist/packem_shared/{index-D_tAc2nS.js → index-88UK-tt_.js} +1 -1
- package/dist/packem_shared/index-CS6a2wFB.js +29 -0
- package/dist/packem_shared/lifecycle-ChCFTm5Q.js +2 -0
- package/dist/packem_shared/{lockfile-CQLFNyVa.js → lockfile-BG1HvBzH.js} +1 -1
- package/dist/packem_shared/{min-release-age-Cz6HbF-I.js → min-release-age-heJgeP7o.js} +1 -1
- package/dist/packem_shared/{osv-bloom-CyCDpXBl.js → osv-bloom-QSAn2Dcw.js} +2 -2
- package/dist/packem_shared/{pm-runner-Dnj9J3KF.js → pm-runner-BzGZmzYs.js} +1 -1
- package/dist/packem_shared/{provenance-yESbF7Vs.js → provenance-BsBn1f5S.js} +1 -1
- package/dist/packem_shared/{resolve-explicit-BpxcFRuk.js → resolve-explicit-CBPr617N.js} +1 -1
- package/dist/packem_shared/{s1ngularity-B_xjP4lC.js → s1ngularity-j_ArCZAs.js} +1 -1
- package/dist/packem_shared/{signatures-DBwSnMBB.js → signatures-CaXzNuEn.js} +1 -1
- package/dist/packem_shared/{typosquats-Citu7BRY.js → typosquats-C1e6RNjF.js} +1 -1
- package/dist/packem_shared/vis-update-app-qhQPV97i.js +1 -0
- package/index.d.ts +201 -201
- package/index.js +52 -52
- package/package.json +14 -25
- package/schemas/project.schema.json +4 -0
- package/schemas/vis-config.schema.json +5 -0
- package/dist/packem_shared/dependency-scan-BbtivycX.js +0 -1
- package/dist/packem_shared/index-B8Ko8mwG.js +0 -29
- package/dist/packem_shared/lifecycle-DJDsjoic.js +0 -2
- package/dist/packem_shared/vis-update-app-BWA1kA1q.js +0 -1
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
var Vn=Object.defineProperty;var E=(t,e)=>Vn(t,"name",{value:e,configurable:!0});import{createRequire as Un}from"node:module";import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
|
|
2
|
-
const require = __cjs_mod__.createRequire(import.meta.url);
|
|
3
|
-
const Dn=Un(import.meta.url),pe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Bn=E(t=>{if(typeof pe<"u"&&pe.versions&&pe.versions.node){const[e,n]=pe.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return pe.getBuiltinModule(t)}return Dn(t)},"__cjs_getBuiltinModule"),{createRequire:He}=Bn("node:module"),Rn=16,et=32,zn=64,ie=128,$e="positionals";var Wn=Object.defineProperty,kt=E((t,e)=>Wn(t,"name",{value:e,configurable:!0}),"i$9"),Fn=Object.defineProperty,_t=kt((t,e)=>Fn(t,"name",{value:e,configurable:!0}),"s"),qn=Object.defineProperty,Lt=_t((t,e)=>qn(t,"name",{value:e,configurable:!0}),"s"),Gn=Object.defineProperty,St=Lt((t,e)=>Gn(t,"name",{value:e,configurable:!0}),"i"),Hn=Object.defineProperty,Tt=St((t,e)=>Hn(t,"name",{value:e,configurable:!0}),"t");Tt(t=>t instanceof Error&&t.type==="VisulimaError","isVisulimaError");let Jn=class extends Error{static{E(this,"V")}static{kt(this,"g")}static{_t(this,"p")}static{Lt(this,"V")}static{St(this,"VisulimaError")}static{Tt(this,"VisulimaError")}loc;title;hint;type="VisulimaError";constructor({cause:e,hint:n,location:i,message:o,name:r,stack:l,title:s}){super(o,{cause:e}),this.title=s,this.name=r,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 Kn=Object.defineProperty,It=E((t,e)=>Kn(t,"name",{value:e,configurable:!0}),"t$7"),Yn=Object.defineProperty,Mt=It((t,e)=>Yn(t,"name",{value:e,configurable:!0}),"t"),Zn=Object.defineProperty,Xn=Mt((t,e)=>Zn(t,"name",{value:e,configurable:!0}),"e");let j=class extends Jn{static{E(this,"m")}static{It(this,"u")}static{Mt(this,"c")}static{Xn(this,"CerebroError")}code;context;constructor(e,n,i){super({message:e,name:"CerebroError"}),this.code=n,this.context=i}};var Qn=Object.defineProperty,ei=E((t,e)=>Qn(t,"name",{value:e,configurable:!0}),"a$2"),ti=Object.defineProperty,ni=ei((t,e)=>ti(t,"name",{value:e,configurable:!0}),"l"),ii=Object.defineProperty,S=ni((t,e)=>ii(t,"name",{value:e,configurable:!0}),"r");const U=S(t=>"Deno"in t,"hasDeno"),D=S(t=>"Bun"in t,"hasBun"),Pe=S(()=>{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 D(globalThis)?globalThis.Bun.process.argv:process.argv},"getArgv"),ri=S(()=>U(globalThis)?globalThis.Deno.cwd():D(globalThis)?globalThis.Bun.process.cwd():process.cwd(),"getCwd"),G=S(()=>{if(U(globalThis)){const t=globalThis.Deno;return new Proxy(t.env.toObject(),{get:S((e,n)=>typeof n=="string"?t.env.get(n):e[n],"get"),has:S((e,n)=>typeof n=="string"?t.env.has(n):n in e,"has"),set:S((e,n,i)=>typeof n=="string"?(i===void 0||t.env.set(n,i),!0):!1,"set")})}return D(globalThis)?globalThis.Bun.process.env:process.env},"getEnv"),Vt=S(()=>U(globalThis)?[]:D(globalThis)?globalThis.Bun.process.execArgv:process.execArgv,"getExecArgv"),Ut=S(()=>U(globalThis)?globalThis.Deno.execPath():D(globalThis)?globalThis.Bun.process.execPath:process.execPath,"getExecPath");S(()=>{if(U(globalThis)){const t=globalThis.Deno.build?.os??"unknown";return t==="windows"?"win32":t}return D(globalThis)?globalThis.Bun.platform??"unknown":process.platform},"getPlatform");S(()=>{if(U(globalThis)){const t=globalThis.Deno.build?.arch??"unknown";return t==="x86_64"?"x64":t==="aarch64"?"arm64":t}return D(globalThis)?globalThis.Bun.process.arch:process.arch},"getArch");S(()=>{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(D(globalThis)){const t=globalThis.Bun,e={...t.process.versions};return t.version&&(e.bun=t.version),e}return process.versions},"getVersions");const q=S((t=0)=>{if(U(globalThis))throw globalThis.Deno.exit(t),new Error("Deno exit failed");if(D(globalThis))throw globalThis.Bun.process.exit(t),new Error("Bun exit failed");process.exit(t)},"exitProcess"),tt=S((t,e)=>{if(U(globalThis))return()=>{};if(D(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 oi=Object.defineProperty,Ee=E((t,e)=>oi(t,"name",{value:e,configurable:!0}),"k$1");const z=new Uint32Array(65536),ai=Ee((t,e)=>{const n=t.length,i=e.length,o=1<<n-1;let r=-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&r)+r^r,l|=~(a|r),r&=a,l&o&&s++,r&o&&s--,l=l<<1|1,r=r<<1|~(c|l),l&=c}for(p=n;p--;)z[t.charCodeAt(p)]=0;return s},"myers_32"),si=Ee((t,e)=>{const n=e.length,i=t.length,o=[],r=[],l=Math.ceil(n/32),s=Math.ceil(i/32);for(let u=0;u<l;u++)r[u]=-1,o[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 A=z[e.charCodeAt(O)],d=r[O/32|0]>>>O&1,m=o[O/32|0]>>>O&1,b=A|u,$=((A|m)&v)+v^v|A|m;let P=u|~($|v),k=v&$;P>>>31^d&&(r[O/32|0]^=1<<O),k>>>31^m&&(o[O/32|0]^=1<<O),P=P<<1|d,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 h=p*32,f=Math.min(32,i-h)+h;for(let u=h;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=r[u/32|0]>>>u&1,y=o[u/32|0]>>>u&1,O=v|a,A=((v|y)&c)+c^c|v|y;let d=a|~(A|c),m=c&A;g+=d>>>i-1&1,g-=m>>>i-1&1,d>>>31^w&&(r[u/32|0]^=1<<u),m>>>31^y&&(o[u/32|0]^=1<<u),d=d<<1|w,m=m<<1|y,c=m|~(O|d),a=d&O}for(let u=h;u<f;u++)z[t.charCodeAt(u)]=0;return g},"myers_x"),Dt=Ee((t,e)=>{if(t.length<e.length){const n=e;e=t,t=n}return e.length===0?t.length:t.length<=32?ai(t,e):si(t,e)},"distance");Ee((t,e)=>{let n=1/0,i=0;for(let o=0;o<e.length;o++){const r=Dt(t,e[o]);r<n&&(n=r,i=o)}return e[i]},"closest");var li=Object.defineProperty,ci=E((t,e)=>li(t,"name",{value:e,configurable:!0}),"p$4"),ui=Object.defineProperty,Bt=ci((t,e)=>ui(t,"name",{value:e,configurable:!0}),"e"),pi=Object.defineProperty,fi=Bt((t,e)=>pi(t,"name",{value:e,configurable:!0}),"E");const Rt=String.raw,nt=Rt`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,di=fi(()=>new RegExp(Rt`\p{RI}{2}|(?)${nt}(?:\u200D${nt})*`,"gu"),"default");var hi=Object.defineProperty,mi=Bt((t,e)=>hi(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 Oc=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,Pc=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,ae=di(),gi=/[-_./\s]+/g,me=/(\u001B\[[0-9;]*[a-z])/i,it=new RegExp("\\p{Script=Arabic}","u"),vi=new RegExp("\\p{Script=Bengali}","u"),Q=new RegExp("\\p{Script=Cyrillic}","u"),bi=new RegExp("\\p{Script=Devanagari}","u"),yi=new RegExp("\\p{Script=Ethiopic}","u"),Ve=new RegExp("\\p{Script=Greek}","u"),rt=new RegExp("\\p{Script=Greek}+|\\p{Script=Latin}+|[^\\p{Script=Greek}\\p{Script=Latin}]+","gu"),wi=new RegExp("\\p{Script=Gujarati}","u"),$i=new RegExp("\\p{Script=Gurmukhi}","u"),ot=new RegExp("\\p{Script=Hangul}","u"),at=new RegExp("\\p{Script=Hebrew}","u"),Oi=new RegExp("\\p{Script=Hiragana}","u"),st=new RegExp("\\p{Script=Han}","u"),Pi=new RegExp("\\p{Script=Kannada}","u"),xi=new RegExp("\\p{Script=Katakana}","u"),Ei=new RegExp("\\p{Script=Khmer}","u"),Ai=new RegExp("\\p{Script=Lao}","u"),I=new RegExp("\\p{Script=Latin}","u"),Ni=new RegExp("\\p{Script=Malayalam}","u"),ji=new RegExp("\\p{Script=Myanmar}","u"),Ci=new RegExp("\\p{Script=Oriya}","u"),ki=new RegExp("\\p{Script=Sinhala}","u"),_i=new RegExp("\\p{Script=Tamil}","u"),Li=new RegExp("\\p{Script=Telugu}","u"),Si=new RegExp("\\p{Script=Thai}","u"),Ti=new RegExp("\\p{Script=Tibetan}","u"),lt=/[\u02BB\u02BC\u0027]/u,Ii=mi(t=>t.replace(ae,""),"stripEmoji");var Mi=Object.defineProperty,zt=E((t,e)=>Mi(t,"name",{value:e,configurable:!0}),"i$6"),Vi=Object.defineProperty,Wt=zt((t,e)=>Vi(t,"name",{value:e,configurable:!0}),"r"),Ui=Object.defineProperty,Di=Wt((t,e)=>Ui(t,"name",{value:e,configurable:!0}),"c");let Ft=class{static{E(this,"l")}static{zt(this,"y")}static{Wt(this,"s")}static{Di(this,"LRUCache")}capacity;cache;keyOrder;constructor(e){this.capacity=e,this.cache=new Map,this.keyOrder=[]}get(e){if(this.cache.has(e))return this.keyOrder=this.keyOrder.filter(n=>n!==e),this.keyOrder.push(e),this.cache.get(e)}has(e){return this.cache.has(e)}set(e,n){if(this.cache.has(e))this.keyOrder=this.keyOrder.filter(i=>i!==e);else if(this.cache.size>=this.capacity){const i=this.keyOrder.shift();i!==void 0&&this.cache.delete(i)}this.cache.set(e,n),this.keyOrder.push(e)}delete(e){this.cache.delete(e),this.keyOrder=this.keyOrder.filter(n=>n!==e)}clear(){this.cache.clear(),this.keyOrder=[]}size(){return this.cache.size}};var Bi=Object.defineProperty,Ri=E((t,e)=>Bi(t,"name",{value:e,configurable:!0}),"r$5"),zi=Object.defineProperty,Wi=Ri((t,e)=>zi(t,"name",{value:e,configurable:!0}),"a"),Fi=Object.defineProperty,qi=Wi((t,e)=>Fi(t,"name",{value:e,configurable:!0}),"s");const Gi=qi((t,e)=>typeof t!="string"||t===""?"":(e?.locale?t[0].toLocaleLowerCase(e.locale):t[0].toLowerCase())+t.slice(1),"lowerFirst");var Hi=Object.defineProperty,Ji=E((t,e)=>Hi(t,"name",{value:e,configurable:!0}),"I$2"),Ki=Object.defineProperty,Ae=Ji((t,e)=>Ki(t,"name",{value:e,configurable:!0}),"W");const Yi=He(import.meta.url),fe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Zi=Ae(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 Yi(t)},"__cjs_getBuiltinModule"),{stripVTControlCharacters:Xi}=Zi("node:util");var Qi=Object.defineProperty,er=Ae((t,e)=>Qi(t,"name",{value:e,configurable:!0}),"g");const Ue=new Ft(1e3),tr=/[.*+?^${}()|[\]\\]/g,nr=er(t=>{const e=t.join("");if(Ue.has(e))return Ue.get(e);const n=t.map(o=>o.replaceAll(tr,String.raw`\$&`)).join("|"),i=new RegExp(n,"g");return Ue.set(e,i),i},"getSeparatorsRegex");var ir=Object.defineProperty,rr=Ae((t,e)=>ir(t,"name",{value:e,configurable:!0}),"t");const or=rr(t=>{const e=[];let n=0,i;for(ae.lastIndex=0;(i=ae.exec(t))!==null;)i.index>n&&e.push(t.slice(n,i.index)),e.push(i[0]),n=ae.lastIndex;return n<t.length&&e.push(t.slice(n)),e.filter(Boolean)},"splitByEmoji");var ar=Object.defineProperty,C=Ae((t,e)=>ar(t,"name",{value:e,configurable:!0}),"u");const sr=/[ČŠŽĐ]/i,qt=new Uint8Array(128),Gt=new Uint8Array(128),Ht=new Uint8Array(128);for(let t=0;t<128;t++)qt[t]=t>=65&&t<=90?1:0,Gt[t]=t>=97&&t<=122?1:0,Ht[t]=t>=48&&t<=57?1:0;const De=C(t=>qt[t],"isUpper"),ct=C(t=>Gt[t],"isLower"),Be=C(t=>Ht[t],"isDigit"),F=C((t,e,n,i,o)=>{if(t.length===0)return[];let r=!1;const l=Object.values(e);for(const g of l)if(g(t[0])){r=!0;break}if(!r&&!n)return[t];const s=[...t],p=[];let a=s[0],c="other";const h=Object.entries(e);for(const g of h){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 h){const[A,d]=O;if(d(u)){v=A;break}}const w=n&&i?u===u.toLocaleUpperCase(i):!1;let y=!1;o?y=o(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"),lr=C((t,e,n,i)=>{if(n.size===0)return e;for(const o of n)if(t.startsWith(o,e))return i.push(o),e+o.length;return e},"detectAndProcessAcronym"),Jt=C((t,e=new Set)=>{if(t.length===0)return[];if(t.toUpperCase()===t)return[t];let n=0;const i=[],o=t.length;for(let r=1;r<o;r++){const l=lr(t,n,e,i);if(l!==n){n=l,r=n-1;continue}const s=t.codePointAt(r-1),p=t.codePointAt(r),a=s&&s<128&&De(s),c=p&&p<128&&De(p),h=s&&s<128&&ct(s),f=s&&s<128&&Be(s),g=p&&p<128&&Be(p);if(h&&c){i.push(t.slice(n,r)),n=r;continue}if(f&&!g||!f&&g){i.push(t.slice(n,r)),n=r;continue}if(g&&!f){let u=!1,v=!1;if(r+1<o){const w=t.codePointAt(r+1);u=w&&w<128&&De(w),v=w&&w<128&&Be(w)}if(!v&&u){i.push(t.slice(n,r),t.slice(r,r+1)),n=r+1;continue}}if(r+1<o){const u=t.codePointAt(r+1),v=u&&u<128&&ct(u);if(a&&c&&v){const w=t.slice(n,r+1);e.has(w)||(i.push(t.slice(n,r)),n=r)}}}return n<o&&i.push(t.slice(n)),i.filter(r=>r!=="")},"splitCamelCaseFast"),Kt=C((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,h=[];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&&(h.push(f),f=y),u=!0,v=w;else{if(u&&w-v>1){const A=a[w-1],d=f.slice(0,-1);d&&d.length>0&&h.push(d),f=A+y}else f+=y;u=!1,v=-1}g=O}return f&&f.length>0&&h.push(f),h}if(e.startsWith("uk")||e.startsWith("ru")||e.startsWith("bg")||e.startsWith("sr")||e.startsWith("mk")||e.startsWith("be")){if(!Q.test(t)&&!I.test(t))return[t];const a=[...t],c=a.length,h=[];let f=a[0];const g=a[0];let u;Q.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 A;Q.test(O)?A=1:I.test(O)?A=2:A=0;const d=O===O.toLocaleUpperCase(e);u!==A&&(u===1||u===2)&&(A===1||A===2)||A===u&&!v&&d?(h.push(f),f=O):f+=O,u=A,v=d}f&&f.length>0&&h.push(f);const w=[];for(let y=0;y<h.length;y++)y<h.length-1&&h[y].length===1&&I.test(h[y])&&Q.test(h[y+1][0])?(w.push(h[y]+h[y+1]),y+=1):w.push(h[y]);return w}if(e.startsWith("el")){if(!Ve.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 h=[];if(a.length===1){const f=a[0];if(!f||!Ve.test(f[0])||f.length===1)return[f??t]}for(const f of a){if(!f)continue;if(!Ve.test(f[0])||f.length===1){h.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?(h.push(u),u=y):u+=y,v=O}u&&h.push(u)}return h}if(e.startsWith("ja")||e.startsWith("ko")){const a=e.startsWith("ja"),c=a?{hiragana:C(f=>Oi.test(f),"hiragana"),kanji:C(f=>st.test(f),"kanji"),katakana:C(f=>xi.test(f),"katakana"),latin:C(f=>I.test(f),"latin")}:{hangul:C(f=>ot.test(f),"hangul"),latin:C(f=>I.test(f),"latin")},h=new Set(["が","で","と","に","の","は","へ","も","や","を"]);if(a){const f=F(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&&h.has(v)&&g.length>0?g[g.length-1]=g.at(-1)+v:g.push(v)}return g.length>0?g:[t]}return F(t,c,!1,e,(f,g)=>f==="hangul"&&g==="latin"||f==="latin"&&g==="hangul")}if(e.startsWith("sl")){const a=[...t],c=a.length,h=[];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=sr.test(v),O=u<c-1&&a[u+1]===a[u+1].toLocaleUpperCase(e);!g&&w||y&&O?(h.push(f),f=v,y&&O&&(h.push(f),f="")):f+=v,g=w}return f&&f.length>0&&h.push(f),h}if(e.startsWith("zh"))return F(t,{han:C(a=>st.test(a),"han"),latin:C(a=>I.test(a),"latin")},!1,e);if(["ar","fa","he","ur"].includes(e.split("-")[0])){const a=C(c=>at.test(c)||it.test(c),"isRtlChar");return F(t,{latin:C(c=>I.test(c),"latin"),rtl:C(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=C(c=>bi.test(c)||vi.test(c)||wi.test(c)||$i.test(c)||Pi.test(c)||_i.test(c)||Li.test(c)||Ni.test(c)||ki.test(c)||Si.test(c)||Ai.test(c)||Ti.test(c)||ji.test(c)||yi.test(c)||Ei.test(c)||Ci.test(c),"isIndicChar");return F(t,{indic:C(c=>a(c),"indic"),latin:C(c=>I.test(c),"latin")},!1,e)}if(["be","bg","ru","sr","uk"].includes(e))return F(t,{cyrillic:C(a=>Q.test(a),"cyrillic"),latin:C(a=>I.test(a),"latin")},!0,e);if(["ar","fa","he"].includes(e))return F(t,{latin:C(a=>I.test(a),"latin"),rtl:C(a=>at.test(a)||it.test(a),"rtl")},!1,e);if(e.startsWith("ko"))return F(t,{hangul:C(a=>ot.test(a),"hangul"),latin:C(a=>I.test(a),"latin")},!1,e);if(e.startsWith("uz")){if(!Q.test(t)&&!I.test(t))return[t];const a=[...t],c=a.length,h=[];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(lt.test(v)||lt.test(a[u-1])){f+=v;continue}!g&&w?(h.push(f),f=v):f+=v,g=w}return f&&f.length>0&&h.push(f),h}const o=[...t],r=o.length,l=[];let s=o[0],p=o[0]===o[0].toLocaleUpperCase(e);for(const a of n)if(t.startsWith(a)){l.push(a),s=o[a.length],p=s===s.toLocaleUpperCase(e);break}for(let a=1;a<r;a++){const c=o[a],h=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&&h?(l.push(s),s=c):s+=c,p=h}return s&&l.push(s),l},"splitCamelCaseLocale"),cr=C((t,e,n)=>{const i=[],o=me.test(t)?t.split(me).filter(Boolean):[t];for(const r of o){const l=r;if(me.test(l))i.push(l);else{const s=ae.test(l)?or(l).filter(Boolean):[l];for(const p of s)if(ae.test(p))i.push(p);else if(e){const a=e.toLowerCase().split("-")[0];i.push(...Kt(p,a,n))}else i.push(...Jt(p,n))}}return i},"processTextWithAnsiEmoji"),ur=C((t,e={})=>{if(!t||typeof t!="string")return[];const{handleAnsi:n=!1,handleEmoji:i=!1,knownAcronyms:o=[],locale:r,normalize:l=!1,separators:s,stripAnsi:p=!1,stripEmoji:a=!1}=e,c=new Set([...o].toSorted((y,O)=>O.length-y.length));let h=t;p&&(h=Xi(h)),a&&(h=Ii(h));let f;Array.isArray(s)?f=nr(s):s instanceof RegExp?f=s:f=gi;const g=[];let u=h;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,A=y[0],d=A.length,m=u.slice(0,O),b=u.slice(O+d);if(A.startsWith("../"))g.push(".."),u=u.slice(O+3);else if(A.startsWith("./"))g.push("."),u=u.slice(O+2);else if(O===0&&A==="..")g.push(".."),u=u.slice(2);else if(O===0&&A===".")g.push("."),u=u.slice(1);else{m.length>0&&g.push(m);let $=0;for(;($=A.indexOf("../",$))!==-1;)g.push(".."),$+=3;for($=0;($=A.indexOf("./",$))!==-1;)($===0||A[$-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=h.split(f).filter(Boolean);g.push(...y)}let w=[];for(const y of g)n||i?w.push(...cr(y,r,c)):r?w.push(...Kt(y,r,c)):w.push(...Jt(y,c));return l&&(w=w.map(y=>c.has(y)?y:r&&y===y.toLocaleUpperCase(r)?y[0]+y.slice(1).toLocaleLowerCase(r):y.toUpperCase()===y&&!c.has(y)?y.slice(0,1)+y.slice(1).toLowerCase():y)),w},"splitByCase");var pr=Object.defineProperty,fr=E((t,e)=>pr(t,"name",{value:e,configurable:!0}),"r$4"),dr=Object.defineProperty,hr=fr((t,e)=>dr(t,"name",{value:e,configurable:!0}),"o"),mr=Object.defineProperty,gr=hr((t,e)=>mr(t,"name",{value:e,configurable:!0}),"s");const vr=gr((t,e)=>typeof t!="string"||t===""?"":(e?.locale?t[0].toLocaleUpperCase(e.locale):t[0].toUpperCase())+t.slice(1),"upperFirst");var br=Object.defineProperty,yr=E((t,e)=>br(t,"name",{value:e,configurable:!0}),"r$3"),wr=Object.defineProperty,$r=yr((t,e)=>wr(t,"name",{value:e,configurable:!0}),"r"),Or=Object.defineProperty,Pr=$r((t,e)=>Or(t,"name",{value:e,configurable:!0}),"n");const xr=Pr((t,e)=>`${t}::${e?.joiner??""}::${e?.locale??""}::${e?.knownAcronyms?.join(",")??""}::${e?.normalize?"true":"false"}`,"generateCacheKey");var Er=Object.defineProperty,Ar=E((t,e)=>Er(t,"name",{value:e,configurable:!0}),"i$4"),Nr=Object.defineProperty,jr=Ar((t,e)=>Nr(t,"name",{value:e,configurable:!0}),"f"),Cr=Object.defineProperty,kr=jr((t,e)=>Cr(t,"name",{value:e,configurable:!0}),"l");const _r=kr((t,e)=>{const{length:n}=t;if(n===0)return"";if(n===1)return t[0];const i=[];let o="",r="";for(let l=0;l<n;l++){const s=t[l];if(me.test(s)){o?(i.push(o+r+s),o="",r=""):(i.length>0&&i.push(e),o=s);continue}o?(r&&(r+=e),r+=s):(i.length>0&&i.push(e),i.push(s))}return i.join("")},"joinSegments");var Lr=Object.defineProperty,Sr=E((t,e)=>Lr(t,"name",{value:e,configurable:!0}),"r$2"),Tr=Object.defineProperty,Ir=Sr((t,e)=>Tr(t,"name",{value:e,configurable:!0}),"a"),Mr=Object.defineProperty,Vr=Ir((t,e)=>Mr(t,"name",{value:e,configurable:!0}),"e");const Ur=/(?<![a-zß])SS(?![a-z])/g,Dr=Vr(t=>t.replaceAll(Ur,"ß"),"normalizeGermanEszett");var Br=Object.defineProperty,Rr=E((t,e)=>Br(t,"name",{value:e,configurable:!0}),"c$1"),zr=Object.defineProperty,Wr=Rr((t,e)=>zr(t,"name",{value:e,configurable:!0}),"c"),Fr=Object.defineProperty,qr=Wr((t,e)=>Fr(t,"name",{value:e,configurable:!0}),"o");const Gr=new Ft(1e3),Yt=qr((t,e)=>{if(typeof t!="string"||!t)return"";const n=e?.cache??!1,i=e?.cacheStore??Gr;let o;if(n&&(o=xr(t,e)),n&&o&&i.has(o))return i.get(o);let r=!0;const l=_r(ur(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&&me.test(s))return s;const p=e?.locale?.startsWith("de")?Dr(s):s,a=e?.locale?p.toLocaleLowerCase(e.locale):p.toLowerCase();return r?(r=!1,Gi(a,e)):vr(a,e)}),"");return n&&o&&i.set(o,l),l},"camelCase");var Hr=Object.defineProperty,T=E((t,e)=>Hr(t,"name",{value:e,configurable:!0}),"_$2"),Jr=Object.defineProperty,x=T((t,e)=>Jr(t,"name",{value:e,configurable:!0}),"h");const be=[{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 Kr=Object.defineProperty,Yr=x((t,e)=>Kr(t,"name",{value:e,configurable:!0}),"t$5");let ee=class extends j{static{E(this,"S")}static{T(this,"T")}static{x(this,"a")}static{Yr(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 Zr=Object.defineProperty,Xr=x((t,e)=>Zr(t,"name",{value:e,configurable:!0}),"e$7");let Zt=class extends j{static{E(this,"De")}static{T(this,"Te")}static{x(this,"o")}static{Xr(this,"ConflictingOptionsError")}option1;option2;constructor(e,n){super(`Options "${e}" and "${n}" cannot be used together`,"CONFLICTING_OPTIONS",{option1:e,option2:n}),this.name="ConflictingOptionsError",this.option1=e,this.option2=n,this.hint=`Remove either --${e} or --${n}`}};var Qr=Object.defineProperty,eo=x((t,e)=>Qr(t,"name",{value:e,configurable:!0}),"e$6");let to=class extends j{static{E(this,"At")}static{T(this,"Ot")}static{x(this,"o")}static{eo(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 no=Object.defineProperty,ut=x((t,e)=>no(t,"name",{value:e,configurable:!0}),"d$4");let io=class{static{E(this,"$t")}static{T(this,"At")}static{x(this,"p")}static{ut(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`);G().CEREBRO_OUTPUT_LEVEL===String(ie)&&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 o=new to(n.name,`Failed to initialize: ${i instanceof Error?i.message:String(i)}`,i instanceof Error?i:void 0);throw this.logger.error(o.message),o}}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 o of i){const r=o[t];if(typeof r=="function"){this.logger.debug(`executing ${t} hook for plugin: ${o.name}`);try{await(t==="afterCommand"?r(e,n):r(e))}catch(l){throw this.logger.error(`Error in ${t} hook for plugin "${o.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(o){this.logger.error(`Error in error handler for plugin "${i.name}":`,o)}}}getDependencyOrder(){if(this.cachedDependencyOrder!==void 0)return this.cachedDependencyOrder;const t=[],e=new Set,n=new Set,i=ut(o=>{if(e.has(o))return;if(n.has(o))throw new Error(`Circular dependency detected involving plugin "${o}"`);const r=this.plugins.get(o);if(!r)throw new Error(`Plugin "${o}" not found`);if(n.add(o),r.dependencies)for(const l of r.dependencies)i(l);n.delete(o),e.add(o),t.push(r)},"visit");for(const o of this.plugins.keys())i(o);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 ro=Object.defineProperty,oo=x((t,e)=>ro(t,"name",{value:e,configurable:!0}),"n$8");const ge=oo(t=>t.type?.name==="Boolean","optionIsBoolean");var ao=Object.defineProperty,Xt=x((t,e)=>ao(t,"name",{value:e,configurable:!0}),"p$6");const so=Xt(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"),pt=Xt(t=>(ge(t)||(t.typeLabel=t.typeLabel??so(t),t.defaultOption&&(t.typeLabel=`${t.typeLabel} (D)`),t.required&&(t.typeLabel=`${t.typeLabel} (R)`)),t),"mapOptionTypeLabel");var lo=Object.defineProperty,Qt=x((t,e)=>lo(t,"name",{value:e,configurable:!0}),"e$4");const co=new RegExp(/^-([^\d-])$/),uo=new RegExp(/^--(\S+)/),po=new RegExp(/^-([^\d-]{2,})$/),fo=Qt(t=>co.test(t)||uo.test(t)||po.test(t),"isOption"),ho=Qt((t,e)=>{const n=e[0]&&fo(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 mo=Object.defineProperty,en=x((t,e)=>mo(t,"name",{value:e,configurable:!0}),"i$7"),go=Object.defineProperty,tn=en((t,e)=>go(t,"name",{value:e,configurable:!0}),"i"),vo=Object.defineProperty,nn=tn((t,e)=>vo(t,"name",{value:e,configurable:!0}),"s"),bo=Object.defineProperty,rn=nn((t,e)=>bo(t,"name",{value:e,configurable:!0}),"i"),yo=Object.defineProperty,on=rn((t,e)=>yo(t,"name",{value:e,configurable:!0}),"t");on(t=>t instanceof Error&&t.type==="VisulimaError","isVisulimaError");class Ne extends Error{static{E(this,"te")}static{T(this,"ee")}static{x(this,"v")}static{en(this,"g")}static{tn(this,"p")}static{nn(this,"V")}static{rn(this,"VisulimaError")}static{on(this,"VisulimaError")}loc;title;hint;type="VisulimaError";constructor({cause:e,hint:n,location:i,message:o,name:r,stack:l,title:s}){super(o,{cause:e}),this.title=s,this.name=r,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 wo=Object.defineProperty,an=x((t,e)=>wo(t,"name",{value:e,configurable:!0}),"o$7"),$o=Object.defineProperty,sn=an((t,e)=>$o(t,"name",{value:e,configurable:!0}),"o"),Oo=Object.defineProperty,Po=sn((t,e)=>Oo(t,"name",{value:e,configurable:!0}),"i");let xo=class ln extends Ne{static{E(this,"He")}static{T(this,"He")}static{x(this,"a")}static{an(this,"a")}static{sn(this,"t")}static{Po(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,ln.prototype)}};var Eo=Object.defineProperty,cn=x((t,e)=>Eo(t,"name",{value:e,configurable:!0}),"t$3"),Ao=Object.defineProperty,un=cn((t,e)=>Ao(t,"name",{value:e,configurable:!0}),"e"),No=Object.defineProperty,jo=un((t,e)=>No(t,"name",{value:e,configurable:!0}),"e");let ft=class pn extends Ne{static{E(this,"Je")}static{T(this,"Je")}static{x(this,"n")}static{cn(this,"n")}static{un(this,"o")}static{jo(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,pn.prototype)}};var Co=Object.defineProperty,fn=x((t,e)=>Co(t,"name",{value:e,configurable:!0}),"a$9"),ko=Object.defineProperty,dn=fn((t,e)=>ko(t,"name",{value:e,configurable:!0}),"a"),_o=Object.defineProperty,Lo=dn((t,e)=>_o(t,"name",{value:e,configurable:!0}),"o");let So=class hn extends Ne{static{E(this,"Xe")}static{T(this,"Xe")}static{x(this,"n")}static{fn(this,"o")}static{dn(this,"e")}static{Lo(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,hn.prototype)}};var To=Object.defineProperty,mn=x((t,e)=>To(t,"name",{value:e,configurable:!0}),"i$4"),Io=Object.defineProperty,gn=mn((t,e)=>Io(t,"name",{value:e,configurable:!0}),"i"),Mo=Object.defineProperty,Vo=gn((t,e)=>Mo(t,"name",{value:e,configurable:!0}),"i");let M=class vn extends Ne{static{E(this,"nt")}static{T(this,"nt")}static{x(this,"a")}static{mn(this,"o")}static{gn(this,"e")}static{Vo(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,vn.prototype)}};var Uo=Object.defineProperty,Do=x((t,e)=>Uo(t,"name",{value:e,configurable:!0}),"z"),Bo=Object.defineProperty,le=Do((t,e)=>Bo(t,"name",{value:e,configurable:!0}),"S"),Ro=Object.defineProperty,je=le((t,e)=>Ro(t,"name",{value:e,configurable:!0}),"o");const dt=je(t=>t===Boolean||typeof t=="function"&&t.name.startsWith("Boolean"),"isBooleanType"),ht=je(t=>t===Number||typeof t=="function"&&t.name==="Number","isNumberType"),mt=je(t=>t===String||typeof t=="function"&&t.name==="String","isStringType"),zo=je((t,e)=>Array.isArray(t)?dt(e)?t.map(Boolean):ht(e)?t.map(Number):mt(e)?t.map(String):t.map(n=>e(String(n))):t===null?null:dt(e)?!!t:ht(e)?Number(t):mt(e)?typeof t=="string"?t:String(t):e(typeof t=="string"?t:String(t)),"convertValue");var Wo=Object.defineProperty,Fo=le((t,e)=>Wo(t,"name",{value:e,configurable:!0}),"e");const L=Fo((t,e,n,...i)=>{t&&console.debug(`[command-line-args:${n}] ${e}`,...i)},"debug");var qo=Object.defineProperty,Z=le((t,e)=>qo(t,"name",{value:e,configurable:!0}),"h$1");const Go=/-([a-z])/g,Ho=/^\d+$/,Re=Z(t=>t===Boolean||typeof t=="function"&&t.name.startsWith("Boolean"),"isBooleanType"),Jo=Z(t=>t.codePointAt(0)===95,"isSpecialKey"),gt=Z((t,e)=>Array.isArray(t)?[...t,...e]:[t,...e],"appendToArrayMultiple"),vt=Z(t=>t==="__proto__"||t==="constructor"||t==="prototype","isUnsafeKey"),bt=Z((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"),Ko=Z((t,e,n,i,o)=>{let r=e.get(t)??n.get(t);if(!r&&i){const l=t.toLowerCase();r=i.get(l)??o?.get(l)}return r},"getDefinition"),Yo=Z((t,e,n,i)=>{const o=n.debug??!1;L(o,"resolveArgs called with options:","resolver",{partial:n.partial,stopAtFirstUnknown:n.stopAtFirstUnknown}),L(o,"Starting argument resolution","resolver"),L(o,"Tokens:","resolver",t),L(o,"Definitions:","resolver",e),L(o,"Processing tokens...","resolver");const r=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 d of e)if(r.set(d.name,d),d.alias&&l.set(d.alias,d),n.caseInsensitive&&s&&(s.set(d.name.toLowerCase(),d),d.alias&&p&&p.set(d.alias.toLowerCase(),d)),n.camelCase&&a&&c){const m=d.name.replaceAll(Go,(b,$)=>$.toUpperCase());a.set(d.name,m),c.set(m,d.name)}const h={},f={},g=[],u=new Set;let v=!1;const w=e.find(d=>d.defaultOption),y=e.some(d=>d.group),O=e.some(d=>d.type===Number);for(let d=0;d<t.length;d++){const m=t[d];if(m.kind==="option-terminator"){h._unknown=i.slice(m.index),v=!0;break}if(m.kind==="option"&&m.name){let b=Ko(m.name,r,l,s,p);if(!b&&m.value===void 0&&O&&Ho.test(m.name)){const N=e.find(B=>B.type===Number);N&&(b=N,m.value=m.name,m.name=N.name)}const $=b?b.name:m.name,P=b?.multiple,k=b?.lazyMultiple;if(f[$]!==void 0&&!P&&!k&&!n.partial)throw new xo($);if(!b&&n.partial){const N=m.rawName??`--${m.name}${m.value!==void 0&&m.inlineValue?`=${m.value}`:""}`;g.push({index:m.index,value:N});continue}if(!b&&n.stopAtFirstUnknown){h._unknown=i.slice(m.index);break}if(!b&&!n.partial)throw new ft(m.name);if(m.value===void 0){const N=t[d+1],B=N?.kind==="option"&&!("name"in N)&&N.value!==void 0,V=N&&b&&!(b.type&&Re(b.type))&&(N.kind==="positional"||B),Mn=b&&b.defaultOption&&!b.multiple&&!b.lazyMultiple;if(V&&(!b?.defaultOption||Mn))if(P){let R=d+1;const Me=[];for(;R<t.length&&(t[R].kind==="positional"||t[R].kind==="option"&&!("name"in t[R])&&t[R].value!==void 0);)Me.push(t[R].value),u.add(t[R].index),R++;f[$]=f[$]===void 0?Me:gt(f[$],Me),d=R-1}else k?(bt(f,$,N.value,!0),u.add(N.index),d++):(f[$]=N.value,u.add(N.index),d++);else b?.type&&Re(b.type)?bt(f,$,!0,P):f[$]=P?[]:null}else{let{value:N}=m;if(b?.type&&Re(b.type))switch(N){case"":{if(n.partial)f._unknown??=[],f._unknown.push(`${m.rawName??`--${m.name}`}${m.value?`=${m.value}`:""}`),N=!0;else throw new ft(m.name);break}case"false":{N=!1;break}case"true":{N=!0;break}default:N=!0}const B=[N];if(P){let V=d+1;for(;V<t.length&&t[V].kind==="positional";)B.push(t[V].value),u.add(t[V].index),V++;d=V-1}f[$]===void 0?f[$]=P||k?B:N:P||k?f[$]=gt(f[$],B):f[$]=N}}else if(m.kind==="positional"&&n.stopAtFirstUnknown&&!u.has(m.index)&&!w){L(o,`Found unconsumed positional token at index ${String(m.index)}, stopping processing`,"resolver"),h._unknown=i.slice(m.index);break}}for(const[d,m]of Object.entries(f)){const b=r.get(d);b&&(b.multiple||b.lazyMultiple)&&!Array.isArray(m)&&(f[d]=[m])}let A=Number.POSITIVE_INFINITY;if(n.stopAtFirstUnknown&&!v){for(const d of t)if(d.kind==="option"&&!r.has(d.name??"")&&!l.has(d.name??"")&&(!n.caseInsensitive||!s?.has(d.name?.toLowerCase()??"")&&!p?.has(d.name?.toLowerCase()??""))){A=d.index;break}}if(w){const d=[],m=[];for(const b of t)b.kind==="positional"&&!u.has(b.index)&&b.index<A&&(d.push(b.value),m.push(b));if(d.length>0){const b=f[w.name],$=w.multiple??w.lazyMultiple;b===void 0?$?(m.forEach(P=>u.add(P.index)),f[w.name]=d):(u.add(m[0].index),f[w.name]=d[0]):$&&(m.forEach(P=>u.add(P.index)),f[w.name]=Array.isArray(b)?[...d,...b]:[...d,b])}}if(!n.partial){for(const d of t)if(d.kind==="positional"&&!u.has(d.index))throw new So(i[d.index])}if(n.partial&&!n.stopAtFirstUnknown){const d=[...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&&d.push({index:$,value:b})}}for(const m of t)m.kind==="positional"&&!u.has(m.index)&&d.push({index:m.index,value:i[m.index]});d.length>0&&(d.sort((m,b)=>m.index-b.index),h._unknown=d.map(m=>m.value))}if(n.stopAtFirstUnknown&&!v){const d=t.findIndex($=>$.kind==="option"&&!r.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(d!==-1&&m!==-1?b=Math.min(d,m):d!==-1?b=d:m!==-1&&(b=m),b>=0){const $=t[b].index;h._unknown=i.slice($)}}else g.length>0&&!n.partial&&(h._unknown=g.map(d=>d.value));for(const[d,m]of Object.entries(f)){const b=n.camelCase?a?.get(d)??d:d,$=r.get(d);h[b]=$?.type?zo(m,$.type):m===void 0?null:m}for(const d of e){const m=n.camelCase?a?.get(d.name)??d.name:d.name;!(m in h)&&d.defaultValue!==void 0&&(d.multiple??d.lazyMultiple?h[m]=Array.isArray(d.defaultValue)?[...d.defaultValue]:[d.defaultValue]:h[m]=d.defaultValue)}if(y){const d={},m={},b={};for(const P of e)if(P.group){const k=Array.isArray(P.group)?P.group:[P.group];for(const N of k)vt(N)||(d[N]??={})}for(const P of Object.keys(h))if(!Jo(P)){m[P]=h[P];let k=P;n.camelCase&&(k=c?.get(P)??P);const N=r.get(k);if(N?.group){const B=Array.isArray(N.group)?N.group:[N.group];for(const V of B)vt(V)||d[V]&&(d[V][P]=h[P])}else b[P]=h[P]}const $={_all:m};for(const[P,k]of Object.entries(d))$[P]=k;Object.keys(b).length>0&&($._none=b),h._unknown&&($._unknown=h._unknown),Object.keys(h).forEach(P=>delete h[P]),Object.assign(h,$)}return L(o,"Final parsed result:","resolver",h),h},"resolveArgs");var Zo=Object.defineProperty,X=le((t,e)=>Zo(t,"name",{value:e,configurable:!0}),"l");const J="-".codePointAt(0),H="=",Xo=H.codePointAt(0),Qo="--",ea="-",ta="--",bn=X(t=>t.length>2&&t.startsWith(ta),"hasLongOptionPrefix"),na=X(t=>bn(t)&&!t.includes(H,3),"isLongOption"),ia=X(t=>bn(t)&&t.includes(H,3),"isLongOptionAndValue"),ra=X(t=>t!==void 0&&t.length>0&&t.codePointAt(0)!==J,"hasOptionValue"),oa=X(t=>{if(t.length!==2||t.codePointAt(0)!==J||t.codePointAt(1)===J)return!1;const e=t.codePointAt(1);return e!==void 0&&(e<48||e>57)},"isShortOption"),aa=X(t=>!(t.length<=2||t.codePointAt(0)!==J||t.codePointAt(1)===J),"isShortOptionGroup"),sa=X(t=>{const e=[],n=[...t];let i=-1,o=0;for(;n.length>0;){const r=n.shift();if(r===void 0)break;const l=n[0];if(o>0?o--:i++,r===Qo){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(oa(r)){const s=r.charAt(1);let p;o?(e.push({index:i,kind:"option",name:s,rawName:r,value:p}),o===1&&ra(l)&&(p=n.shift(),e.push({index:i,kind:"option",value:p}))):e.push({index:i,kind:"option",name:s,rawName:r,value:p}),p!==void 0&&++i;continue}if(aa(r)&&!r.includes(H)){const s=[];let p="",a=!1;for(let c=1;c<r.length;c++){const h=r.charAt(c);a?p+=h:h.codePointAt(0)===Xo?a=!0:s.push(`${ea}${h}`)}if(a)if(s.length>0){const c=s.pop();s.push(`${c}=${p}`)}else s.push(p);n.unshift(...s),o=s.length;continue}if(na(r)){const s=r.slice(2);e.push({index:i,kind:"option",name:s,rawName:r});continue}if(ia(r)){const s=r.indexOf(H),p=r.slice(2,s),a=r.slice(s+1);e.push({index:i,inlineValue:!0,kind:"option",name:p,rawName:r,value:a});continue}if(r.length>2&&r.codePointAt(0)===J&&r.codePointAt(1)!==J&&r.includes(H)){const s=r.indexOf(H),p=r.charAt(1),a=r.slice(s+1);e.push({index:i,inlineValue:!0,kind:"option",name:p,rawName:r,value:a});continue}e.push({index:i,kind:"positional",value:r})}return e},"parseArgsTokens");var la=Object.defineProperty,Je=le((t,e)=>la(t,"name",{value:e,configurable:!0}),"d");const ca=/\d/,ua=Je(t=>t!=null&&(t===Boolean||typeof t=="function"&&t.name.startsWith("Boolean")),"isBooleanType"),pa=Je(t=>typeof t=="function","isValidCustomTypeFunction"),fa=Je((t,e,n)=>{const i=n?.debug??!1;L(i,"Validating definitions:","validation",t,"caseInsensitive:",e);const o=new Set,r=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(o.has(a.name)||e&&l.has(c))throw new M(`Invalid option definition: duplicate name '${a.name}'`);if(r.has(a.name)||e&&s.has(c))throw new M(`Invalid option definition: name '${a.name}' conflicts with an existing alias`);if(o.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(ca.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 h=e?a.alias.toLowerCase():"";if(r.has(a.alias)||e&&s.has(h))throw new M(`Invalid option definition: duplicate alias '${a.alias}'`);if(o.has(a.alias)||e&&l.has(h))throw new M(`Invalid option definition: alias '${a.alias}' conflicts with an existing option name`);r.add(a.alias),e&&s.add(h)}if(a.defaultOption&&(p++,a.type!==void 0&&ua(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"&&pa(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 da=Object.defineProperty,ha=le((t,e)=>da(t,"name",{value:e,configurable:!0}),"O");const ma=ha((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 o=Array.isArray(t)?t:[t];L(n,"Normalized definitions:","index",o),fa(o,i.caseInsensitive,n?i:void 0);let{argv:r}=i;if(!r&&(r=process.argv.slice(2),process.execArgv.length>0)){const a=new Set(process.execArgv);r=r.filter(c=>!a.has(c))}L(n,"Using argv:","index",r);let l=r;i.caseInsensitive&&(l=r.map(a=>{if(a.startsWith("--")){const c=a.indexOf("="),h=(c===-1?a.slice(2):a.slice(2,c)).toLowerCase();return c===-1?`--${h}`:`--${h}${a.slice(c)}`}if(a.startsWith("-")&&!a.startsWith("--")&&a.length>1){const c=a.slice(1).split("=",2),h=c[0],f=c[1];if(!h)return a;const g=h.toLowerCase();return f===void 0?`-${g}`:`-${g}=${f}`}return a}));const s=sa(l.map(String));L(n,"Tokenized arguments:","index",s);const p=Yo(s,o,i,r);return L(n,"Command-line-args parsing completed","index"),p},"commandLineArgs");var ga=Object.defineProperty,va=x((t,e)=>ga(t,"name",{value:e,configurable:!0}),"n$4");let ba=class{static{E(this,"Bn")}static{T(this,"Un")}static{x(this,"a")}static{va(this,"EmptyToolbox")}result;argv;options;argument;command;commandName;env;logger;runtime;rawUnknown;constructor(t,e){this.commandName=t,this.command=e}};var ya=Object.defineProperty,wa=x((t,e)=>ya(t,"name",{value:e,configurable:!0}),"n$3");let ze=class extends j{static{E(this,"ue")}static{T(this,"ce")}static{x(this,"i")}static{wa(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 $a=Object.defineProperty,Oa=x((t,e)=>$a(t,"name",{value:e,configurable:!0}),"f$3");const Pa=/^-{1,2}(\w+)(=(.+))?$/,yn=Oa((t,e,n,i)=>{const o=Pa.exec(t);if(o===null)return{};const r=o[1];if(!r)return{};const l=n&&i?n.get(r)??i.get(r):e.find(s=>s.name===r||s.alias===r);return l!==void 0?{argName:l.name,argValue:o[3],option:l}:{}},"getParameterOption");var xa=Object.defineProperty,Ge=x((t,e)=>xa(t,"name",{value:e,configurable:!0}),"e$3");const yt=Ge((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"),Ea=new Set(["0","1","false","true"]),Aa=Ge((t,e,n,i)=>{if(e.length===0||t.length===0)return{};const o=Ge((r,l)=>{const{argName:s,argValue:p,option:a}=yn(l,e,n,i),{lastOption:c}=r;return a&&ge(a)&&p&&s?r.partial[s]=yt(p,a):r.lastName&&c&&ge(c)&&Ea.has(l)&&(r.partial[r.lastName]=yt(l,c)),{lastName:s,lastOption:a,partial:r.partial}},"getBooleanValue");return t.reduce(o,{partial:{}}).partial},"getBooleanValues");var Na=Object.defineProperty,wt=x((t,e)=>Na(t,"name",{value:e,configurable:!0}),"s$6");const ja=new Set(["0","1","false","true"]),Ca=wt((t,e,n,i)=>{if(e.length===0||t.length===0)return t;const o=wt((r,l)=>{const{argValue:s,option:p}=yn(l,e,n,i),{lastOption:a}=r;if(a&&ge(a)&&ja.has(l)){const{args:c}=r;return{args:c.slice(0,-1)}}return p&&ge(p)&&s?{args:r.args}:{args:[...r.args,l],lastOption:p}},"removeBooleanArguments");return t.reduce(o,{args:[]}).args},"removeBooleanValues");var ka=Object.defineProperty,_a=x((t,e)=>ka(t,"name",{value:e,configurable:!0}),"o$4");const La=_a(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 Sa=Object.defineProperty,Ce=x((t,e)=>Sa(t,"name",{value:e,configurable:!0}),"o$3");const Ta=Ce(t=>{if(t===void 0)return;const e=t.toLowerCase().trim();return e==="true"||e==="1"||e==="yes"||e==="on"},"transformBooleanEnv"),Ia=Ce((t,e)=>{if(!t.type)return e;if(e!==void 0){if(t.type===Boolean||typeof t.type=="function"&&t.type.name==="Boolean")return Ta(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"),Ma=/_./g,Va=/^[A-Z]/,Ua=Ce(t=>t.toLowerCase().replaceAll(Ma,e=>e[1]?.toUpperCase()??e).replace(Va,e=>e.toLowerCase()),"toCamelCase"),Da=Ce(t=>{if(!t||t.length===0)return{};const e={},n=G();for(const i of t){const o=n[i.name],r=Ia(i,o),l=r===void 0?i.defaultValue:r,s=Ua(i.name);e[s]=l}return e},"processEnvVariables");var Ba=Object.defineProperty,ve=x((t,e)=>Ba(t,"name",{value:e,configurable:!0}),"a$4");const Ra=ve(t=>{const e=new Map,n=new Map;for(const i of t)if(e.set(i.name,i),i.alias){const o=Array.isArray(i.alias)?i.alias:[i.alias];for(const r of o)n.set(r,i)}return{optionMapByAlias:n,optionMapByName:e}},"buildOptionMaps"),za=ve(async t=>{if(typeof t.__resolvedExecute__=="function")return t.__resolvedExecute__;if(typeof t.loader!="function")throw new ze(t.name,"no execute or loader defined");let e;try{e=await t.loader()}catch(i){throw new ze(t.name,i instanceof Error?i.message:String(i),i)}const n=e.default;if(typeof n!="function")throw new ze(t.name,"loader did not return a module with a default-exported handler function");return t.__resolvedExecute__=n,n},"loadLazyHandler"),Wa=ve((t,e,n,i)=>{const o=new ba(t.name,t),{_all:r,_unknown:l,positionals:s}=e,p=Object.keys(n).length>0?{...r,...n}:r;$e in p&&delete p[$e],o.argument=s?.[$e]??[],o.rawUnknown=[...l??[]];const a=Object.keys(i).length>0;return o.options=a?{...p,...i}:p,o.env=Da(t.env),o},"prepareToolbox"),Fa=ve((t,e,n)=>{const i=t.options??[],o=i.length>0;let r=La(o?[...i,...n]:n);if(r.length>0){for(const a of r)if(a.multiple&&a.lazyMultiple)throw new Error(`Argument "${a.name}" cannot have both multiple and lazyMultiple options, please choose one.`)}t.argument&&(r=[{defaultOption:!0,description:t.argument.description,group:"positionals",multiple:!0,name:$e,type:t.argument.type,typeLabel:t.argument.typeLabel},...r]);let l,s;if(o){const{optionMapByAlias:a,optionMapByName:c}=Ra(i);l=Ca(e,i,c,a),s=Aa(e,i,c,a)}else l=e,s={};const p=ma(r,{argv:l,camelCase:!0,partial:!0,stopAtFirstUnknown:!0});return{arguments_:r,booleanValues:s,parsedArgs:p}},"processCommandArgs"),te=ve(async(t,e,n)=>typeof t.execute=="function"?t.execute(e):(await za(t))(e),"executeCommand");var qa=Object.defineProperty,Ga=x((t,e)=>qa(t,"name",{value:e,configurable:!0}),"n$2");let Ha=class extends j{static{E(this,"fi")}static{T(this,"pi")}static{x(this,"s")}static{Ga(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 Ja=Object.defineProperty,Ka=x((t,e)=>Ja(t,"name",{value:e,configurable:!0}),"t$1");const $t=Ka((t,e,n=!1)=>{const i=[];for(const o of t)if(!(!n&&!o.required)&&e[o.name]===void 0){if(o.type?.name==="Boolean"){e[o.name]=!1;continue}i.push(o)}return i},"listMissingArguments");var Ya=Object.defineProperty,wn=x((t,e)=>Ya(t,"name",{value:e,configurable:!0}),"n$1");const Za=wn((t,e)=>e.includes(t)?!0:Math.abs(t.length-e.length)>t.length/2?!1:Dt(t,e)<=t.length/3,"isSimilar"),re=wn((t,e)=>{const n=t.toLowerCase();return e.filter(i=>Za(i.toLowerCase(),n))},"findAlternatives");var Xa=Object.defineProperty,ke=x((t,e)=>Xa(t,"name",{value:e,configurable:!0}),"a$3");const Qa=ke((t,e)=>{const n=[];if(t._unknown&&t._unknown.forEach(i=>{const o=i.startsWith("--");let r=`Found unknown ${o?"option":"argument"} "${i}"`;if(o){const l=re(i.replace("--",""),(e.options??[]).map(s=>s.name));if(l.length>0){const[s,...p]=l.map(a=>`--${a}`);r+=p.length>0?`, did you mean ${s??""} or ${p.join(", ")}?`:`, did you mean ${s??""}?`}}n.push(r)}),n.length>0)throw new Error(n.join(`
|
|
4
|
-
`))},"validateUnknownOptions"),es=ke((t,e,n)=>{const i=n.__requiredOptions__,o=i?$t(i,e,!0):$t(t,e,!1);if(o.length>0)throw new Ha(n.name,o.map(r=>r.name));e._unknown&&e._unknown.length>0&&!n.argument&&Qa(e,n)},"validateRequiredOptions"),ts=ke((t,e,n)=>{const i=n.__conflictingOptions__??t.filter(o=>o.conflicts!==void 0);if(i.length>0){const o=i.find(r=>Array.isArray(r.conflicts)?r.conflicts.some(l=>e[l]!==void 0)&&e[r.name]!==void 0:e[r.conflicts]!==void 0&&e[r.name]!==void 0);if(o)throw new Zt(o.name,typeof o.conflicts=="string"?o.conflicts:o.conflicts?.[0]??"unknown")}},"validateConflictingOptions"),ns=ke(t=>{if(!Array.isArray(t.options))return;const e=new Map,n=new Map;for(const o of t.options){if(o.name){const r=e.get(o.name)??[];r.push(o),e.set(o.name,r)}if(typeof o.alias=="string"&&o.alias.length>0){const r=n.get(o.alias)??[];r.push(o),n.set(o.alias,r)}else if(Array.isArray(o.alias)){for(const r of o.alias)if(r.length>0){const l=n.get(r)??[];l.push(o),n.set(r,l)}}}const i=[];for(const[o,r]of e)r.length>1&&i.push(`Duplicate option name "${o}" in command "${t.name}": ${JSON.stringify(r)}`);for(const[o,r]of n)r.length>1&&i.push(`Duplicate option alias "-${o}" used by options ${r.map(l=>`"${l.name}"`).join(", ")} in command "${t.name}"`);if(i.length>0)throw new Error(i.join(`
|
|
5
|
-
`))},"validateDuplicateOptions");var is=Object.defineProperty,Ke=x((t,e)=>is(t,"name",{value:e,configurable:!0}),"s$2");const rs=Ke((t,e)=>{if(e.length===0)return{argv:[],commandPath:void 0};const n=[];let i;for(let o=1;o<=e.length;o+=1){const r=e[o-1];if(r===void 0||r.startsWith("-"))break;n.push(r);const l=n.join(" ");t.has(l)&&(i={commandPath:[...n],depth:o})}return i?{argv:e.slice(i.depth),commandPath:i.commandPath}:{argv:e,commandPath:void 0}},"parseNestedCommand"),ne=Ke(t=>t.join(" "),"getCommandPathKey"),Ot=Ke((t,e)=>e&&e.length>0?[...e,t]:[t],"getFullCommandPath");var os=Object.defineProperty,_e=x((t,e)=>os(t,"name",{value:e,configurable:!0}),"a$2");const as=_e(t=>{t.options?.forEach(e=>{e.__camelCaseName__=Yt(e.name)})},"processOptionNames"),ss=_e(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 o=i.name.replace("no-","");if(!e.has(o)){if(i.type!==Boolean)throw new Error(`Cannot add negated option "${i.name}" to command "${t.name}" because it is not a boolean.`);const r={...i,defaultValue:i.defaultValue===void 0?!0:!i.defaultValue,name:o};n.push(r),e.add(o)}}n.length>0&&t.options.push(...n)},"addNegatableOptions"),ls=_e((t,e)=>{if(!e.options||e.options.length===0)return;const{options:n}=t,i=new Map;for(const r of e.options)if(r.name.startsWith("no-")){const l=Yt(r.name);i.set(l,r)}const o=Object.keys(n).filter(r=>i.has(r));if(o.length!==0)for(const r of o){const l=r.charAt(2);if(!l)continue;const s=l.toLowerCase()+r.slice(3),p=i.get(r);p&&(p.__negated__=!0),n[s]=!n[r],Reflect.deleteProperty(n,r)}},"mapNegatableOptions"),cs=_e((t,e)=>{if(!e.options||e.options.length===0)return;const n=new Map;for(const o of e.options)o.__camelCaseName__&&o.__negated__===void 0&&o.implies!==void 0&&n.set(o.__camelCaseName__,o);if(n.size===0)return;const{options:i}=t;for(const o of Object.keys(i)){const r=n.get(o);if(r?.implies){const{implies:l}=r;for(const[s,p]of Object.entries(l))i[s]===void 0&&(i[s]=p)}}},"mapImpliedOptions");var us=Object.defineProperty,Le=x((t,e)=>us(t,"name",{value:e,configurable:!0}),"e$2");const ps=Le(()=>!!process.versions.electron,"isElectronApp"),fs=Le(()=>ps()&&!process.defaultApp,"isBundledElectronApp"),ds=Le(()=>fs()?0:1,"getProcessArgvBinIndex"),hs=Le(t=>t.slice(ds()+1),"hideBin");var ms=Object.defineProperty,$n=x((t,e)=>ms(t,"name",{value:e,configurable:!0}),"e$1");const gs=" ",vs=$n((t,e)=>t===e?!0:t.length!==e.length?!1:t.every((n,i)=>n===e[i]),"equals"),bs=$n(t=>{if(typeof t=="string")return t.split(gs);const e=Pe();return vs(t,e)?hs(t):t},"parseRawCommand");var ys=Object.defineProperty,We=x((t,e)=>ys(t,"name",{value:e,configurable:!0}),"r");const ws=We(t=>{const e=We(r=>{t.error(`Uncaught exception: ${r.message||r}`),r.stack&&t.error(r.stack),q(1)},"uncaughtExceptionHandler"),n=We((r,l)=>{if(r instanceof Error)t.error(`Promise rejection: ${r.message||r}`),r.stack&&t.error(r.stack);else{let s;if(typeof r=="string")s=r;else try{s=JSON.stringify(r)}catch{s=String(r)}t.error(`Promise rejection: ${s}`)}q(1)},"unhandledRejectionHandler"),i=tt("uncaughtException",e),o=tt("unhandledRejection",n);return()=>{i(),o()}},"registerExceptionHandler");var $s=Object.defineProperty,ce=x((t,e)=>$s(t,"name",{value:e,configurable:!0}),"e");const xe=100,On=/^[a-z][\w-]*$/i,Ye=ce((t,e)=>{if(typeof t!="string"||t.trim().length===0)throw new j(`${e} must be a non-empty string`,"INVALID_INPUT",{fieldName:e,value:t});return t.trim()},"validateNonEmptyString"),Pt=ce((t,e)=>{if(!Array.isArray(t)||!t.every(n=>typeof n=="string"))throw new j(`${e} must be an array of strings`,"INVALID_INPUT",{fieldName:e,value:t});return t},"validateStringArray");ce((t,e)=>{if(typeof t!="function")throw new j(`${e} must be a function`,"INVALID_INPUT",{fieldName:e,value:t});return t},"validateFunction");const Fe=ce((t,e)=>{if(typeof t!="object"||t===null)throw new j(`${e} must be an object`,"INVALID_INPUT",{fieldName:e,value:t});return t},"validateObject"),ye=ce(t=>{const e=Ye(t,"Command name");if(e.length>xe)throw new j(`Command name is too long (maximum ${String(xe)} characters)`,"INVALID_COMMAND_NAME",{commandName:e,length:e.length});if(e.includes("..")||e.includes("/")||e.includes("\\")||e.includes(";")||e.includes("|")||e.includes("&"))throw new j(`Command name "${e}" contains invalid characters`,"INVALID_COMMAND_NAME",{commandName:e});if(!On.test(e))throw new j(`Command name "${e}" must start with a letter and contain only letters, numbers, hyphens, and underscores`,"INVALID_COMMAND_NAME",{commandName:e});return e},"validateCommandName");ce(t=>{const e=Ye(t,"Plugin name");if(e.length>xe)throw new j(`Plugin name is too long (maximum ${String(xe)} characters)`,"INVALID_PLUGIN_NAME",{length:e.length,pluginName:e});if(e.includes("..")||e.includes("/")||e.includes("\\")||e.includes(";")||e.includes("|")||e.includes("&"))throw new j(`Plugin name "${e}" contains invalid characters`,"INVALID_PLUGIN_NAME",{pluginName:e});if(!On.test(e))throw new j(`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 Os=Object.defineProperty,Se=x((t,e)=>Os(t,"name",{value:e,configurable:!0}),"s");const Ps=new Set([`
|
|
6
|
-
`,"\r"," ","\0",'"',"$","&","'","(",")",";","<",">","[","\\","]","`","{","|","}"]),xs=/^[A-Z]:/i,Es=Se(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(Ps.has(e))throw new Error(`Argument contains dangerous character: ${e}`);return t.trim()},"sanitizeArgument"),xt=Se(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=>Es(e))},"sanitizeArguments");Se(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("/")||xs.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 jc{static{E(this,"ao")}static{T(this,"co")}static{x(this,"RateLimiter")}static{Se(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 As=Object.defineProperty,Oe=x((t,e)=>As(t,"name",{value:e,configurable:!0}),"A");const Ns=/^-([^\d-])$/,js=/^--(\S+)/,Cs=/^-([^\d-]{2,})$/,qe=Oe(t=>Ns.test(t)||js.test(t)||Cs.test(t),"isOption");class ks{static{E(this,"Qi")}static{T(this,"uo")}static{x(this,"Cli")}static{Oe(this,"Cli")}#t;#e;#o;#c;#v;#u;#b;#a;#n;#i;#p;#s;#l;#f=!1;#y;#w=!1;#d;#h;#m;#g=[];#E(){return this.#d===void 0&&(this.#d=[...this.#i.keys()]),this.#d}#$(){return this.#h===void 0&&(this.#h=[...this.#n.keys()]),this.#h}#r(){return this.#m===void 0&&(this.#m=[...this.#E(),...this.#$()]),this.#m}#O(){return this.#g.length===0?be:[...be,...this.#g]}#A(){this.#d=void 0,this.#h=void 0,this.#m=void 0}#P(){if(this.#o===void 0){const e=bs(this.#e.argv);this.#o=xt(e),this.#N()}return this.#o}#N(){if(!this.#o)return;const e=G();let n=!1;for(const i of this.#o){if(i==="--quiet"||i==="-q"){e.CEREBRO_OUTPUT_LEVEL=String(Rn),n=!0;break}if(i==="--verbose"||i==="-v"){e.CEREBRO_OUTPUT_LEVEL=String(zn),n=!0;break}if(i==="--debug"||i==="-vvv"){e.CEREBRO_OUTPUT_LEVEL=String(ie),n=!0;break}}n||(e.CEREBRO_OUTPUT_LEVEL=Object.hasOwn(e,"DEBUG")?String(ie):String(et))}#j(){this.#w||(this.#y=ws(this.#t),this.#w=!0)}#x(e,n,i,o){this.#t.debug(`command '${o}' found, parsing command args: ${n.join(", ")}`);const{arguments_:r,booleanValues:l,parsedArgs:s}=Fa(e,n,this.#O()),p=Object.keys(l).length>0;let a=s;p&&(a={...s,_all:{...s._all,...l}}),es(r,a,e);const c=Wa(e,s,l,i);c.runtime=this,c.argv=this.#P();const h=e.options&&e.options.length>0;if(h&&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 Zt(u,g.name)}}return h&&(ls(c,e),cs(c,e)),ts(r,c.options,e),G().CEREBRO_OUTPUT_LEVEL===String(ie)&&(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_:r,booleanValues:l,commandArgs:a,parsedArgs:s,toolbox:c}}constructor(e,n={}){if(typeof e!="string"||e.trim().length===0)throw new j("CLI name must be a non-empty string","INVALID_INPUT",{cliName:e});this.#v=e.trim();const i=n.argv??Pe(),o=n.cwd??ri();if(this.#e={...n,argv:i,cwd:o},this.#e.argv&&!Array.isArray(this.#e.argv))throw new j("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 j("CLI cwd option must be a string","INVALID_INPUT",{cwd:this.#e.cwd});if(this.#e.packageName&&typeof this.#e.packageName!="string")throw new j("CLI packageName option must be a string","INVALID_INPUT",{packageName:this.#e.packageName});if(this.#e.packageVersion&&typeof this.#e.packageVersion!="string")throw new j("CLI packageVersion option must be a string","INVALID_INPUT",{packageVersion:this.#e.packageVersion});const r=G();if(r.CEREBRO_OUTPUT_LEVEL=String(et),typeof this.#e.logger=="object"){const l=["debug","error","info","log","warn"],s=[],p=this.#e.logger;for(const a of l)typeof p[a]!="function"&&s.push(a);if(s.length>0)throw new j(`Logger object is missing required methods: ${s.join(", ")}`,"INVALID_INPUT",{logger:this.#e.logger,missingMethods:s});this.#t=this.#e.logger}else this.#t={...console,debug:Oe((...l)=>{r.CEREBRO_OUTPUT_LEVEL===String(ie)&&console.debug(...l)},"debug")};this.#u=this.#e.packageVersion,this.#b=this.#e.packageName,this.#c=this.#e.cwd,this.#s="help",this.#l={},this.#n=new Map,this.#i=new Map,this.#p=new Map}setCommandSection(e){return this.#l=e,this}getCommandSection(){return this.#l.header||(this.#l.header=`${this.#v}${this.#u?` v${this.#u}`:""}`),this.#l}setDefaultCommand(e){return this.#s=e,this}get defaultCommand(){return this.#s}addCommand(e){Fe(e,"Command"),ye(e.name);const n=typeof e.execute=="function",i=typeof e.loader=="function";if(n&&i)throw new j(`Command "${e.name}" cannot define both "execute" and "loader" — choose one`,"INVALID_COMMAND",{commandName:e.name});if(!n&&!i)throw new j(`Command "${e.name}" must define either "execute" or "loader"`,"INVALID_COMMAND",{commandName:e.name});e.alias&&(typeof e.alias=="string"?ye(e.alias):Pt(e.alias,"Command alias").forEach(a=>ye(a))),e.argument&&Fe(e.argument,"Command argument"),e.options&&Fe(e.options,"Command options"),e.commandPath&&(Pt(e.commandPath,"Command commandPath"),e.commandPath.forEach(a=>{ye(a)}));const o=Ot(e.name,e.commandPath),r=ne(o);if(this.#i.has(r))throw new j(`Command with path "${r}" 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 j(`Command with name "${e.name}" already exists`,"DUPLICATE_COMMAND",{commandName:e.name});if(e.options)for(const a of e.options)pt(a);if(ns(e),ss(e),as(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(r,e);else{if(!l&&s!==void 0&&!p){const a=Ot(s.name,s.commandPath);this.#n.set(ne(a),s)}this.#n.set(e.name,e)}if(this.#i.set(r,o),this.#p.set(r,e),this.#A(),e.alias!==void 0){const a=typeof e.alias=="string"?[e.alias]:e.alias;for(const c of a){if(G().CEREBRO_OUTPUT_LEVEL===String(ie)&&this.#t.debug("adding alias",c),this.#n.has(c))throw new j(`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(be.map(r=>r.name)),o=new Set(be.map(r=>r.alias).filter(Boolean));if(i.has(n.name))throw new j(`Cannot add global option "--${n.name}": it conflicts with a built-in global option`,"DUPLICATE_OPTION",{optionName:n.name});if(n.alias&&o.has(n.alias))throw new j(`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.#g.map(r=>r.name)).has(n.name))throw new j(`Global option "--${n.name}" has already been added`,"DUPLICATE_OPTION",{optionName:n.name});return n.group="global",pt(n),this.#g.push(n),this}getGlobalOptions(){return this.#O()}addPlugin(e){return this.getPluginManager().register(e),this}getPluginManager(){return this.#a?this.#a:(this.#a=new io(this.#t),this.#a.register({description:"Attaches the logger to the toolbox",execute:Oe(e=>{e.logger=this.#t},"execute"),name:"logger"}),this.#a)}getCliName(){return this.#v}getPackageVersion(){return this.#u}getPackageName(){return this.#b}getCommands(){return this.#n}getCwd(){return this.#c}dispose(){this.#y?.()}async run(e={}){const{autoDispose:n=!0,shouldExitProcess:i=!0,...o}=e;if(!this.#n.has("help")){const{default:m}=await import("../packem_chunks/help-command.js");this.addCommand(new m(this.#n))}const r=this.#$(),l=this.#i;this.#j();const s=this.#P();let p,a=[...s];const c=Ut(),h=Vt(),f=Pe();this.#t.debug(`process.execPath: ${c}`),this.#t.debug(`process.execArgv: ${h.join(" ")}`),this.#t.debug(`process.argv: ${f.join(" ")}`);const g=rs(l,[...s]);if(g.commandPath)p=g.commandPath,a=g.argv;else{if(s.length>1&&s[0]&&s[1]&&!qe(s[0])&&!qe(s[1])){const b=[];let $=0;for(;$<s.length;){const k=s[$];if(!k||qe(k))break;b.push(k),$+=1}const P=ne(b);if(b[0]&&!r.includes(b[0])){const k=this.#r(),N=re(P,k);throw new ee(P,N)}}let m;try{m=ho([null,...r],[...s])}catch(b){if(b instanceof Error&&b.name==="INVALID_COMMAND"&&"command"in b){const $=b.command,P=this.#r(),k=re($,P);throw new ee($,k)}throw b}m.command&&(p=[m.command],a=m.argv)}if(!p)if(this.#s)p=[this.#s];else{const m=this.#r();throw new ee("",m)}const u=ne(p),v=this.#i.get(u);let w;if(v){if(w=this.#p.get(u),!w||ne(v)!==u){const m=this.#r(),b=re(u,m);throw new ee(u,b)}}else{const m=p.at(-1);if(w=m?this.#n.get(m):void 0,!w){const b=this.#r(),$=re(u,b);throw new ee(u,$)}}if(typeof w.execute!="function"&&typeof w.loader!="function")return this.#t.error(`Command "${w.name}" has no function to execute.`),i?q(1):void 0;const y=a;let O,A;try{({commandArgs:O,toolbox:A}=this.#x(w,y,o,u))}catch(m){if(this.#t.error(m),i)return q(1);throw m}const d=this.getPluginManager();try{!this.#f&&d.hasPlugins()&&(await d.init({cli:this,cwd:this.#c,logger:this.#t}),this.#f=!0),await d.executeLifecycle("execute",A),await d.executeLifecycle("beforeCommand",A);let m;const b=O.global;if(b?.help){const $=this.#n.get("help");if(!$)throw new j("Help command not found","COMMAND_NOT_FOUND");m=await te($,A,O)}else if(b?.version??b?.V){const $=this.#n.get("version");if(!$)throw new j("Version command not found","COMMAND_NOT_FOUND");m=await te($,A,O)}else m=await te(w,A,O);return await d.executeLifecycle("afterCommand",A,m),i?q(0):void 0}catch(m){throw await d.executeErrorHandlers(m,A),m}finally{n&&this.dispose()}}async runCommand(e,n={}){const{argv:i=[],...o}=n;Ye(e,"Command name");const r=e.split(" ").filter(Boolean),l=ne(r),s=this.#i.get(l)?this.#p.get(l):this.#n.get(e);if(!s){const f=this.#r(),g=re(l||e,f);throw new ee(e,g)}if(typeof s.execute!="function"&&typeof s.loader!="function")throw new j(`Command "${s.name}" has no function to execute`,"INVALID_COMMAND",{commandName:s.name});const p=[...xt(i)];this.#t.debug(`running command '${e}' programmatically with args: ${p.join(", ")}`);const{commandArgs:a,toolbox:c}=this.#x(s,p,o,l||e),h=this.getPluginManager();try{!this.#f&&h.hasPlugins()&&(await h.init({cli:this,cwd:this.#c,logger:this.#t}),this.#f=!0),await h.executeLifecycle("execute",c),await h.executeLifecycle("beforeCommand",c);let f;const g=a.global;if(g?.help){const u=this.#n.get("help");if(!u)throw new j("Help command not found","COMMAND_NOT_FOUND");f=await te(u,c,a)}else if(g?.version??g?.V){const u=this.#n.get("version");if(!u)throw new j("Version command not found","COMMAND_NOT_FOUND");f=await te(u,c,a)}else f=await te(s,c,a);return await h.executeLifecycle("afterCommand",c,f),f}catch(f){throw await h.executeErrorHandlers(f,c),f}}}var _s=Object.defineProperty,Ls=E((t,e)=>_s(t,"name",{value:e,configurable:!0}),"e$1"),Ss=Object.defineProperty,Ts=Ls((t,e)=>Ss(t,"name",{value:e,configurable:!0}),"o"),Is=Object.defineProperty,Ms=Ts((t,e)=>Is(t,"name",{value:e,configurable:!0}),"t");const Cc=Ms((t,e)=>new ks(t,e),"createCerebro");var Vs=Object.defineProperty,se=E((t,e)=>Vs(t,"name",{value:e,configurable:!0}),"t$1");function Us(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}E(Us,"getDefaultExportFromCjs");se(Us,"getDefaultExportFromCjs");function Ds(t){return t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}E(Ds,"getDefaultExportFromNamespaceIfPresent");se(Ds,"getDefaultExportFromNamespaceIfPresent");function Bs(t){return t&&Object.prototype.hasOwnProperty.call(t,"default")&&Object.keys(t).length===1?t.default:t}E(Bs,"getDefaultExportFromNamespaceIfNotNamed");se(Bs,"getDefaultExportFromNamespaceIfNotNamed");function Rs(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=se(E(function i(){var o=!1;try{o=this instanceof i}catch{}return o?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 o=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(n,i,o.get?o:{enumerable:!0,get:se(function(){return t[i]},"get")})}),n}E(Rs,"getAugmentedNamespace");se(Rs,"getAugmentedNamespace");var zs=Object.defineProperty,Ws=E((t,e)=>zs(t,"name",{value:e,configurable:!0}),"r$1"),Fs=Object.defineProperty,qs=Ws((t,e)=>Fs(t,"name",{value:e,configurable:!0}),"r"),Gs=Object.defineProperty,Hs=qs((t,e)=>Gs(t,"name",{value:e,configurable:!0}),"o");const kc=Hs(()=>{try{const t=require("node:module");if(typeof t.enableCompileCache=="function"){t.enableCompileCache();return}}catch{}try{require("v8-compile-cache")}catch{}},"enableCompileCache");var Js=Object.defineProperty,Ks=E((t,e)=>Js(t,"name",{value:e,configurable:!0}),"u$2"),Ys=Object.defineProperty,Pn=Ks((t,e)=>Ys(t,"name",{value:e,configurable:!0}),"p");const Zs=He(import.meta.url),de=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,xn=Pn(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 Zs(t)},"__cjs_getBuiltinModule"),{execFileSync:Xs}=xn("node:child_process"),{totalmem:Qs}=xn("node:os");var el=Object.defineProperty,Te=Pn((t,e)=>el(t,"name",{value:e,configurable:!0}),"r");const tl=/--max-old-space-size=(\d+)/,nl=/--max-semi-space-size=(\d+)/,il=Te(t=>Math.floor(Qs()/1024/1024*t),"getDefaultMaxOldSpaceSize"),rl=Te(t=>t<=512?4:t<=1024?8:t<=2048?16:t<=4096?32:t<=8192?64:Math.floor(Math.log2(t))*8,"getSemiSpaceSize"),Et=Te((t,e)=>{for(const n of e){const i=t.exec(n);if(i)return Number.parseInt(i[1],10)}},"extractFlag"),_c=Te(t=>{const e=t?.maxOldSpacePercent??.75,n=[...Vt()],i=[...Pe()],o=Et(tl,n),r=Et(nl,n);if(o!==void 0&&r!==void 0)return;const l=o??il(e),s=r??rl(l),p=[];if(o===void 0&&p.push(`--max-old-space-size=${String(l)}`),r===void 0&&p.push(`--max-semi-space-size=${String(s)}`),p.length!==0)try{Xs(Ut(),[...p,...n,...i.slice(1)],{env:G(),stdio:"inherit"}),q(0)}catch(a){const c=a.status;q(typeof c=="number"?c:1)}},"applyHeapTuning");var ol=Object.defineProperty,al=E((t,e)=>ol(t,"name",{value:e,configurable:!0}),"T"),sl=Object.defineProperty,Ie=al((t,e)=>sl(t,"name",{value:e,configurable:!0}),"N");const ll=He(import.meta.url),he=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,cl=Ie(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 ll(t)},"__cjs_getBuiltinModule"),{createRequire:ul}=cl("node:module");var pl=Object.defineProperty,fl=Ie((t,e)=>pl(t,"name",{value:e,configurable:!0}),"A$2"),dl=Object.defineProperty,Ze=fl((t,e)=>dl(t,"name",{value:e,configurable:!0}),"$"),hl=Object.defineProperty,ml=Ze((t,e)=>hl(t,"name",{value:e,configurable:!0}),"r$1");const gl=ml(t=>t.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
|
|
7
|
-
`),"normalizeLF"),vl=globalThis.process??Object.create(null),At={versions:{}},Nt=new Proxy(vl,{get(t,e){if(e in t)return t[e];if(e in At)return At[e]}});var bl=Object.defineProperty,yl=Ze((t,e)=>bl(t,"name",{value:e,configurable:!0}),"b");const wl=yl((t,e,n,i)=>{const o={column:0,line:-1,...t.start},r={...o,...t.end},l=o.line,s=o.column,p=r.line,a=r.column;let c=Math.max(l-(n+1),0),h=Math.min(e.length,p+i);l===-1&&(c=0),p===-1&&(h=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:h,markerLines:g,start:c}},"getMarkerLines");var $l=Object.defineProperty,we=Ze((t,e)=>$l(t,"name",{value:e,configurable:!0}),"t");const Ol=Nt.platform==="win32"&&!Nt.env?.WT_SESSION?">":"❯",Pl=we((t,e,n)=>{const i={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...n,color:{gutter:we(u=>u,"gutter"),marker:we(u=>u,"marker"),message:we(u=>u,"message"),...n?.color}},o=typeof e.start.column=="number";let r=gl(t).split(`
|
|
8
|
-
`);typeof i.tabWidth=="number"&&(r=r.map(u=>u.replaceAll(" "," ".repeat(i.tabWidth))));const{end:l,markerLines:s,start:p}=wl(e,r,i.linesAbove,i.linesBelow),a=String(l).length,{gutter:c,marker:h,message:f}=i.color;let g=r.slice(p,l).map((u,v)=>{const w=p+1+v,y=s[w],O=` ${String(w)}`.slice(-a),A=!s[w+1],d=` ${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(d.replaceAll(/\d/g," "))," ",b,h("^").repeat($)].join(""),A&&i.message&&(m+=` ${f(i.message)}`)}return[i.prefix+h(Ol),c(d),u.length>0?` ${u}`:"",m].join("")}return`${i.prefix} ${c(d)}${u.length>0?` ${u}`:""}`}).join(`
|
|
10
|
-
`);return i.message&&!o&&(g=`${i.prefix+" ".repeat(a+1)+i.message}
|
|
11
|
-
${g}`),g},"codeFrame");var xl=Object.defineProperty,El=Ie((t,e)=>xl(t,"name",{value:e,configurable:!0}),"x$1"),Al=Object.defineProperty,Nl=El((t,e)=>Al(t,"name",{value:e,configurable:!0}),"x"),jl=Object.defineProperty,W=Nl((t,e)=>jl(t,"name",{value:e,configurable:!0}),"u");const K=W((t,...e)=>{process.env.DEBUG&&process.env.DEBUG==="true"&&console.debug(`error:parse-stacktrace: ${t}`,...e)},"debugLog"),Y="<unknown>",Cl=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,kl=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,_l=/(.*?):(\d+):(\d+)(?:\s<-\s.+:\d+:\d+)?/,Ll=/eval\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*<anonymous>?:(\d+)?:(\d+)/,Sl=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,Tl=/in\s(.*)\s\(at\s(.+)\)\sat/,Il=/^(?:.*@)?(.*):(\d+):(\d+)$/,Ml=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Vl=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ul=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,jt=/\(error: (.*)\)/,Dl=/at\s/,Bl=/^(\S+):(\d+):(\d+)$|^(\S+):(\d+)$/,Rl=/\S*(?:Error: |AggregateError:)/,En=/^Anonymous function$/,zl=/^\s*in\s.*/,Wl=/^.*?\s*at\s.*/,Fl=/^.*?\s*@.*|\[native code\]/,An=W((t,e)=>{const n=t.includes("safari-extension"),i=t.includes("safari-web-extension");return n||i?[t.includes("@")?t.split("@")[0]:Y,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},"extractSafariExtensionDetails"),Nn=W((t,e)=>{const n=_l.exec(e);n&&(t.file=n[1],t.line=+n[2],t.column=+n[3])},"parseMapped"),ql=W(t=>{const e=Tl.exec(t);if(e){K(`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]??Y,raw:t,type:void 0}}const n=Sl.exec(t);if(n){K(`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(Dl,""):void 0,line:n[3]?+n[3]:void 0,methodName:n[1]??Y,raw:t,type:t.startsWith("internal")?"internal":void 0};return Nn(i,`${n[2]}:${n[3]}:${n[4]}`),i}},"parseNode"),Gl=W(t=>{const e=Cl.exec(t);if(e){K(`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 o,r;if(i){const a=kl.exec(t);if(a){const c=Bl.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]&&(o={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=Ll.exec(t);c&&(r={column:c[4]?+c[4]:void 0,file:c[2],line:c[3]?+c[3]:void 0},o={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]=An(e[1]?e[1].replace(En,"<anonymous>"):Y,e[2]),p={column:e[4]?+e[4]:void 0,evalOrigin:o,file:s,line:e[3]?+e[3]:void 0,methodName:l,raw:t,type:i?"eval":n?"native":void 0};return r?(p.column=r.column,p.file=r.file,p.line=r.line):Nn(p,`${s}:${e[3]}:${e[4]}`),p}},"parseChromium"),Hl=W((t,e)=>{const n=Ml.exec(t);if(n){K(`parse gecko error stack line: "${t}"`,`found: ${JSON.stringify(n)}`);const i=n[3]?.includes(" > eval"),o=i&&n[3]&&Vl.exec(n[3]);let r;i&&o&&(n[3]=o[1],r={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]=o[2]);const[l,s]=An(n[1]?n[1].replace(En,"<anonymous>"):Y,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:r,file:s,line:a,methodName:l,raw:t,type:i?"eval":s.includes("[native code]")?"native":void 0}}},"parseGecko"),Jl=W((t,e)=>{const n=Ul.exec(t);if(!(n&&n[2].includes(" > eval"))&&n)return K(`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]||Y,raw:t,type:void 0}},"parseFirefox"),Kl=W(t=>{const e=Il.exec(t);if(e)return K(`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:Y,raw:t,type:void 0}},"parseReactAndroidNative"),jn=W((t,{filter:e,frameLimit:n=50}={})=>{const i=t;let o=(typeof i.stacktrace=="string"?i.stacktrace:t.stack??"").split(`
|
|
12
|
-
`).map(r=>(jt.test(r)?r.replace(jt,"$1"):r).trim()).filter(r=>!Rl.test(r)&&r!=="eval code");return e&&(o=o.filter(r=>e(r))),o=o.slice(0,n),o.reduce((r,l,s)=>{if(!l||l.length>1024)return r;let p;if(zl.test(l))p=ql(l);else if(Wl.test(l))p=Gl(l);else if(Fl.test(l)){let a;if(s===0){const c=t,h=c.columnNumber,f=c.lineNumber,g=c.line,u=c.column;h||f?a={column:h,line:f,type:"firefox"}:(g||u)&&(a={column:u,line:g,type:"safari"})}p=Jl(l,a)??Hl(l,a)}else p=Kl(l);return p?r.push(p):K(`parse error stack line: "${l}"`,"not parser found"),r},[])},"parseStacktrace");var Yl=Object.defineProperty,Zl=Ie((t,e)=>Yl(t,"name",{value:e,configurable:!0}),"p"),Xl=Object.defineProperty,Cn=Zl((t,e)=>Xl(t,"name",{value:e,configurable:!0}),"m");const Ql=ul(import.meta.url),oe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Xe=Cn(t=>{if(typeof oe<"u"&&oe.versions&&oe.versions.node){const[e,n]=oe.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return oe.getBuiltinModule(t)}return Ql(t)},"__cjs_getBuiltinModule"),{existsSync:ec,readFileSync:tc}=Xe("node:fs"),{relative:nc}=Xe("node:path"),{cwd:ic}=oe,{fileURLToPath:rc}=Xe("node:url");var oc=Object.defineProperty,_=Cn((t,e)=>oc(t,"name",{value:e,configurable:!0}),"o");const ue=_((t,e,n)=>n===0?t:e===" "?t+" ".repeat(n):t+" ".repeat(e*n),"getPrefix"),ac=_((t,e)=>{const n=t.replace("async file:","file:");return nc(e,n.startsWith("file:")?rc(n):n)},"getRelativePath"),sc=_((t,e,n)=>{if(e)return n.title(t.message);const i=t.message?`: ${t.message}`:"";return n.title(t.name+i)},"getTitleText"),kn=_((t,{color:e,hideErrorTitle:n,indentation:i,prefix:o},r)=>`${ue(o,i,r)}${sc(t,n,e)}
|
|
13
|
-
`,"getMessage"),_n=_((t,{color:e,indentation:n,prefix:i},o)=>{if(t.hint===void 0)return;const r=ue(i,n,o);let l="";if(Array.isArray(t.hint))for(const s of t.hint)l+=`${r+s}
|
|
14
|
-
`;else l+=r+t.hint;return e.hint(l)},"getHint"),Qe=_((t,{color:e,cwd:n,displayShortPath:i,indentation:o,prefix:r},l=0)=>{const s=i?ac(t.file,n):t.file,{fileLine:p,method:a}=e;return`${ue(r,o,l)}at ${t.methodName?`${a(t.methodName)} `:""}${p(s)}:${p(t.line?.toString()??"")}`},"getMainFrame"),Ln=_((t,{color:e,indentation:n,linesAbove:i,linesBelow:o,prefix:r,showGutter:l,showLineNumbers:s,tabWidth:p},a)=>{if(t.file===void 0)return;const c=t.file.replace("file://","");if(!ec(c))return;const h=tc(c,"utf8");return Pl(h,{start:{column:t.column,line:t.line}},{color:e,linesAbove:i,linesBelow:o,prefix:ue(r,n,a),showGutter:l,showLineNumbers:s,tabWidth:p})},"getCode"),Sn=_((t,e,n)=>{if(t.errors.length===0)return;let i=`${ue(e.prefix,e.indentation,n)}Errors:
|
|
15
|
-
|
|
16
|
-
`,o=!0;for(const r of t.errors)o?o=!1:i+=`
|
|
17
|
-
|
|
18
|
-
`,i+=In(r,{...e,framesMaxLimit:1,hideErrorCodeView:e.hideErrorErrorsCodeView},n+1);return`
|
|
19
|
-
${i}`},"getErrors"),Tn=_((t,e,n)=>{let i=`${ue(e.prefix,e.indentation,n)}Caused by:
|
|
20
|
-
|
|
21
|
-
`;const o=t.cause;i+=kn(o,e,n);const r=jn(o).shift(),l=_n(o,e,n);if(l&&(i+=`${l}
|
|
22
|
-
`),r&&(i+=Qe(r,e,n),!e.hideErrorCauseCodeView)){const s=Ln(r,e,n);s!==void 0&&(i+=`
|
|
23
|
-
${s}`)}if(o.cause)i+=`
|
|
24
|
-
${Tn(o,e,n+1)}`;else if(o instanceof AggregateError){const s=Sn(o,e,n);s!==void 0&&(i+=`
|
|
25
|
-
${s}`)}return`
|
|
26
|
-
${i}`},"getCause"),lc=_((t,e)=>(t.length>0?`
|
|
27
|
-
`:"")+t.map(n=>Qe(n,e)).join(`
|
|
28
|
-
`),"getStacktrace"),In=_((t,e,n)=>{const i={cwd:ic(),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}},o=jn(t,{filter:e.filterStacktrace,frameLimit:i.framesMaxLimit}),r=o.shift();return[e.hideMessage?void 0:kn(t,i,n),_n(t,i,n),r?Qe(r,i,n):void 0,r&&!i.hideErrorCodeView?Ln(r,i,n):void 0,t instanceof AggregateError?Sn(t,i,n):void 0,t.cause===void 0?void 0:Tn(t,i,n),o.length>0?lc(o,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 In(t,e,0)},"renderError");var uc=Object.defineProperty,pc=E((t,e)=>uc(t,"name",{value:e,configurable:!0}),"i$1"),fc=Object.defineProperty,dc=pc((t,e)=>fc(t,"name",{value:e,configurable:!0}),"n"),hc=Object.defineProperty,Ct=dc((t,e)=>hc(t,"name",{value:e,configurable:!0}),"n");const Lc=Ct((t={})=>({description:"Enhanced error handling and reporting with beautiful code frames",name:"error-handler",onError:Ct((e,n)=>{const{logger:i,runtime:o}=n,{detailed:r=!1,exitOnError:l=!0,formatter:s,logErrors:p=!0,renderOptions:a={}}=t;if(p)if(s)i.error(s(e));else if(r){const c=o.getCwd(),h=cc(e,{cwd:c,hideErrorCodeView:!1,hideErrorTitle:!1,hideMessage:!1,linesAbove:2,linesBelow:3,...a});i.error(h)}else i.error(e);l&&q(1)},"handleError"),version:"1.0.0"}),"errorHandlerPlugin");var mc="1.0.0-alpha.23";const Sc={version:mc};var gc=Object.defineProperty,vc=E((t,e)=>gc(t,"name",{value:e,configurable:!0}),"e");const Tc={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:vc(()=>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{ae as E,Pc as H,Yt as L,me as M,_c as N,ur as O,Cc as T,Tc as a,xr as b,_r as c,G as d,j as e,Rs as f,Us as g,Oc as h,kc as i,Ft as l,Sc as m,vr as s,Dr as v,Lc as w};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var z=Object.defineProperty;var n=(t,e)=>z(t,"name",{value:e,configurable:!0});import{createRequire as Q}from"node:module";import{f as tt,M as w}from"./readFileSync-CGmzMUF2-D6rUjGDn.js";import{d as j}from"../packem_chunks/config.js";import{aL as dt,B as ht,aM as F}from"../packem_chunks/bin.js";const Z=Q(import.meta.url),m=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,p=n(t=>{if(typeof m<"u"&&m.versions&&m.versions.node){const[e,o]=m.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return m.getBuiltinModule(t)}return Z(t)},"__cjs_getBuiltinModule"),{Socket:et}=p("node:net"),{randomBytes:ot}=p("node:crypto"),{readdir:st,writeFile:rt,rm:M,rename:it,open:nt,readFile:at,stat:ct,unlink:O}=p("node:fs/promises"),{createRequire:lt}=p("node:module"),{spawn:ut}=p("node:child_process"),{openSync:ft,closeSync:pt}=p("node:fs");var wt=Object.defineProperty,kt=n((t,e)=>wt(t,"name",{value:e,configurable:!0}),"i"),mt=Object.defineProperty,W=kt((t,e)=>mt(t,"name",{value:e,configurable:!0}),"s");const vt=lt(import.meta.url),v=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,gt=W(t=>{if(typeof v<"u"&&v.versions&&v.versions.node){const[e,o]=v.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return v.getBuiltinModule(t)}return vt(t)},"__cjs_getBuiltinModule"),{lstat:x,mkdir:yt}=gt("node:fs/promises");var _t=Object.defineProperty,bt=W((t,e)=>_t(t,"name",{value:e,configurable:!0}),"o");const $t=bt(async t=>{tt(t);try{const e=await x(t);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(j(e))}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{await yt(t,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const o=await x(t);if(!o.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(j(o))}'`,{cause:e})}},"ensureDir");var Et=Object.defineProperty,u=n((t,e)=>Et(t,"name",{value:e,configurable:!0}),"s$1");const St=3e4,N=100;class Ht extends Error{static{n(this,"ServiceReadinessError")}constructor(e,o){super(e),this.elapsedMs=o,this.name="ServiceReadinessError"}elapsedMs;static{u(this,"ServiceReadinessError")}}const Pt=u(async t=>{const e=t.host??"127.0.0.1",{port:o}=t,s=t.timeoutMs??St,r=Date.now();for(;Date.now()-r<s;){if(await Mt(e,o))return;await Rt(N)}throw new Ht(`Timed out waiting for ${e}:${String(o)} to accept TCP connections (${String(s)}ms)`,Date.now()-r)},"waitForTcp"),Mt=u((t,e)=>new Promise(o=>{const s=new et,r=u(i=>{s.removeAllListeners(),s.destroy(),o(i)},"onDone");s.once("connect",()=>{r(!0)}),s.once("error",()=>{r(!1)}),s.setTimeout(N,()=>{r(!1)});try{s.connect(e,t)}catch{r(!1)}}),"tryConnect"),Rt=u(t=>new Promise(e=>{setTimeout(e,t)}),"delay"),Tt=u(async(t,e)=>{const o=t.readiness??(t.port===void 0?void 0:{tcp:{port:t.port}});o&&await Pt({host:o.tcp.host,port:o.tcp.port,timeoutMs:e?.timeoutMs??o.tcp.timeoutMs})},"runReadiness");var Dt=Object.defineProperty,d=n((t,e)=>Dt(t,"name",{value:e,configurable:!0}),"o");const R=384,C=5e3,Ot=50,jt=3e4,k=d(async t=>{const e=w(dt(t),"services");try{await $t(e)}catch(o){throw o.code==="ENOTDIR"?new Error(`Service registry path ${e} exists but is not a directory. Remove it or move the conflicting file before running \`vis service\`.`,{cause:o}):o}return e},"getRegistryDir"),T=d(t=>t.replaceAll("/","_").replaceAll(":","__"),"slugify"),D=d((t,e)=>w(t,`${T(e)}.json`),"entryPath"),xt=d((t,e)=>w(t,`${T(e)}.lock`),"lockPath"),b=d(async(t,e)=>{const o=await k(t),s=D(o,e);if(await ht(s))try{return await F(s)}catch{return}},"readEntry"),Ct=d(async t=>{const e=await k(t);let o;try{o=await st(e)}catch{return[]}const s=[];for(const r of o)if(r.endsWith(".json"))try{const i=await F(w(e,r));s.push(i)}catch{}return s},"readAllEntries"),At=d(async(t,e)=>{const o=await k(t),s=D(o,e.id),r=w(o,`.${ot(8).toString("hex")}.tmp`);await rt(r,`${JSON.stringify(e,void 0,2)}
|
|
2
|
-
`,{mode:R});try{await Wt(r,s)}catch(i){throw await M(r,{force:!0}).catch(()=>{}),i}},"writeEntry"),It=new Set(["EACCES","EBUSY","EPERM"]),Lt=8,Ft=20,Wt=d(async(t,e)=>{let o=0;for(;;)try{await it(t,e);return}catch(s){const{code:r}=s;if(!(r!==void 0&&It.has(r))||o>=Lt)throw s;const i=Ft*2**o;await new Promise(c=>{setTimeout(c,i)}),o+=1}},"renameWithRetry"),g=d(async(t,e,o)=>{const s=await k(t),r=o??await b(t,e);await M(D(s,e),{force:!0}),r&&await M(r.logFile,{force:!0}).catch(()=>{})},"deleteEntry"),f=d(t=>{try{return process.kill(t,0),!0}catch{return!1}},"isAlive"),ae=d(async t=>{const e=await Ct(t),o=[],s=[];for(const r of e){if(f(r.pid)){s.push(r);continue}const i=await b(t,r.id);if(i&&i.pid!==r.pid){s.push(i);continue}await g(t,r.id,r).catch(()=>{}),o.push(r.id)}return{pruned:o,surviving:s}},"pruneDead"),Nt=d(t=>new Promise(e=>{setTimeout(e,t)}),"sleep"),Bt=d(async t=>{try{const e=await nt(t,"wx",R);try{await e.writeFile(String(process.pid))}finally{await e.close().catch(()=>{})}return!0}catch(e){if(e.code==="EEXIST")return!1;throw e}},"tryClaimLock"),Gt=d(async t=>{let e;try{const o=await at(t,"utf8"),s=Number.parseInt(o.trim(),10);e=Number.isFinite(s)?s:void 0}catch{return!0}if(e!==void 0&&!f(e))return!0;try{const o=await ct(t);return Date.now()-o.mtimeMs>jt}catch{return!0}},"isLockStale"),B=d(async(t,e,o)=>{const s=await k(t),r=xt(s,e),i=Date.now();for(;!await Bt(r);){if(await Gt(r)){await O(r).catch(()=>{});continue}if(Date.now()-i>=C)throw new Error(`Could not acquire service lock for ${e} within ${String(C)}ms — another \`vis service\` invocation appears to be holding it.`);await Nt(Ot)}try{return await o()}finally{await O(r).catch(()=>{})}},"withServiceLock");var Vt=Object.defineProperty,l=n((t,e)=>Vt(t,"name",{value:e,configurable:!0}),"r");function y(t,e={},o){for(const s in t){const r=t[s],i=o?`${o}:${s}`:s;typeof r=="object"&&r!==null?y(r,e,i):typeof r=="function"&&(e[i]=r)}return e}n(y,"c");l(y,"flatHooks");function qt(...t){const e={};for(const o of t){const s=y(o);for(const r in s)e[r]?e[r].push(s[r]):e[r]=[s[r]]}for(const o in e)if(e[o].length>1){const s=e[o];e[o]=(...r)=>G(s,i=>i(...r))}else e[o]=e[o][0];return e}n(qt,"v");l(qt,"mergeHooks");function G(t,e){return t.reduce((o,s)=>o.then(()=>e(s)),Promise.resolve())}n(G,"d$1");l(G,"serial");const V=(()=>{if(console.createTask)return console.createTask;const t={run:l(e=>e(),"run")};return()=>t})();function $(t,e,o,s){for(let r=o;r<t.length;r+=1)try{const i=s?s.run(()=>t[r](...e)):t[r](...e);if(i&&typeof i.then=="function")return Promise.resolve(i).then(()=>$(t,e,r+1,s))}catch(i){return Promise.reject(i)}}n($,"k");l($,"callHooks");function q(t,e,o){if(t.length>0)return $(t,e,0,V(o))}n(q,"y");l(q,"serialTaskCaller");function X(t,e,o){if(t.length>0){const s=V(o);return Promise.all(t.map(r=>s.run(()=>r(...e))))}}n(X,"m");l(X,"parallelTaskCaller");function Xt(t,e){return t.reduce((o,s)=>o.then(()=>s(...e||[])),Promise.resolve())}n(Xt,"x");l(Xt,"serialCaller");function Yt(t,e){return Promise.all(t.map(o=>o(...e||[])))}n(Yt,"P");l(Yt,"parallelCaller");function _(t,e){for(const o of[...t])o(e)}n(_,"a");l(_,"callEachWith");var Jt=class{static{n(this,"p")}static{l(this,"Hookable")}_hooks;_before;_after;_deprecatedHooks;_deprecatedMessages;constructor(){this._hooks={},this._before=void 0,this._after=void 0,this._deprecatedMessages=void 0,this._deprecatedHooks={},this.hook=this.hook.bind(this),this.callHook=this.callHook.bind(this),this.callHookWith=this.callHookWith.bind(this)}hook(t,e,o={}){if(!t||typeof e!="function")return()=>{};const s=t;let r;for(;this._deprecatedHooks[t];)r=this._deprecatedHooks[t],t=r.to;if(r&&!o.allowDeprecated){let i=r.message;i||(i=`${s} hook has been deprecated`+(r.to?`, please use ${r.to}`:"")),this._deprecatedMessages||(this._deprecatedMessages=new Set),this._deprecatedMessages.has(i)||(console.warn(i),this._deprecatedMessages.add(i))}if(!e.name)try{Object.defineProperty(e,"name",{get:l(()=>"_"+t.replace(/\W+/g,"_")+"_hook_cb","get"),configurable:!0})}catch{}return this._hooks[t]=this._hooks[t]||[],this._hooks[t].push(e),()=>{e&&(this.removeHook(t,e),e=void 0)}}hookOnce(t,e){let o,s=l((...r)=>(typeof o=="function"&&o(),o=void 0,s=void 0,e(...r)),"_function");return o=this.hook(t,s),o}removeHook(t,e){const o=this._hooks[t];if(o){const s=o.indexOf(e);s!==-1&&o.splice(s,1),o.length===0&&(this._hooks[t]=void 0)}}clearHook(t){this._hooks[t]=void 0}deprecateHook(t,e){this._deprecatedHooks[t]=typeof e=="string"?{to:e}:e;const o=this._hooks[t]||[];this._hooks[t]=void 0;for(const s of o)this.hook(t,s)}deprecateHooks(t){for(const e in t)this.deprecateHook(e,t[e])}addHooks(t){const e=y(t),o=Object.keys(e).map(s=>this.hook(s,e[s]));return()=>{for(const s of o)s();o.length=0}}removeHooks(t){const e=y(t);for(const o in e)this.removeHook(o,e[o])}removeAllHooks(){this._hooks={}}callHook(t,...e){return this.callHookWith(q,t,e)}callHookParallel(t,...e){return this.callHookWith(X,t,e)}callHookWith(t,e,o){const s=this._before||this._after?{name:e,args:o,context:{}}:void 0;this._before&&_(this._before,s);const r=t(this._hooks[e]?[...this._hooks[e]]:[],o,e);return r instanceof Promise?r.finally(()=>{this._after&&s&&_(this._after,s)}):(this._after&&s&&_(this._after,s),r)}beforeEach(t){return this._before=this._before||[],this._before.push(t),()=>{if(this._before!==void 0){const e=this._before.indexOf(t);e!==-1&&this._before.splice(e,1)}}}afterEach(t){return this._after=this._after||[],this._after.push(t),()=>{if(this._after!==void 0){const e=this._after.indexOf(t);e!==-1&&this._after.splice(e,1)}}}};function Y(){return new Jt}n(Y,"w$1");l(Y,"createHooks");(class{static{l(this,"HookableCore")}_hooks;constructor(){this._hooks={}}hook(t,e){return!t||typeof e!="function"?()=>{}:(this._hooks[t]=this._hooks[t]||[],this._hooks[t].push(e),()=>{e&&(this.removeHook(t,e),e=void 0)})}removeHook(t,e){const o=this._hooks[t];if(o){const s=o.indexOf(e);s!==-1&&o.splice(s,1),o.length===0&&(this._hooks[t]=void 0)}}callHook(t,...e){const o=this._hooks[t];if(!(!o||o.length===0))return $(o,e,0)}});const A=typeof window<"u";function Kt(t,e={}){const o={inspect:A,group:A,filter:l(()=>!0,"filter"),...e},s=o.filter,r=typeof s=="string"?a=>a.startsWith(s):s,i=o.tag?`[${o.tag}] `:"",c=l(a=>i+a.name+"".padEnd(a._id,"\0"),"logPrefix"),h={},H=t.beforeEach(a=>{r!==void 0&&!r(a.name)||(h[a.name]=h[a.name]||0,a._id=h[a.name]++,console.time(c(a)))}),P=t.afterEach(a=>{r!==void 0&&!r(a.name)||(o.group&&console.groupCollapsed(a.name),o.inspect?console.timeLog(c(a),a.args):console.timeEnd(c(a)),o.group&&console.groupEnd(),h[a.name]--)});return{close:l(()=>{H(),P()},"close")}}n(Kt,"W");l(Kt,"createDebugger");var Ut=Object.defineProperty,E=n((t,e)=>Ut(t,"name",{value:e,configurable:!0}),"t$2");const ce=E(()=>Y(),"createVisHooks"),le=E(async(t,e)=>{if(!(!e||e.length===0))for(const o of e){if(o.hooks)for(const[s,r]of Object.entries(o.hooks)){const i=Array.isArray(r)?r:[r];for(const c of i)t.hook(s,c)}o.setup&&await o.setup(t)}},"registerPlugins");class de{static{n(this,"HookableLifeCycle")}static{E(this,"HookableLifeCycle")}#o;#e;#s=new Map;constructor(e,o){this.#o=e,this.#e=o}startTasks(e){for(const o of e)this.#s.set(o.id,o),this.#t("task:before",o)}endTasks(e){for(const o of e)this.#s.delete(o.task.id),this.#t("task:after",o.task,o),o.status==="failure"?this.#t("task:failure",o.task,o):zt(o.status)&&this.#t("task:cacheHit",o.task,o)}printCacheMiss(e,o){this.#t("task:cacheMiss",e,o)}onTaskStdout(e,o){this.#t("task:stdout",e,o)}onTaskStderr(e,o){this.#t("task:stderr",e,o)}#t(e,...o){Promise.resolve(this.#o.callHook(e,...o)).catch(s=>{if(this.#e)try{this.#e(e,s)}catch{}})}}const zt=E(t=>t==="local-cache"||t==="local-cache-kept-existing"||t==="remote-cache","isCacheStatus");var Qt=Object.defineProperty,Zt=n((t,e)=>Qt(t,"name",{value:e,configurable:!0}),"t$1");const I=process.platform==="win32",te=Zt(async t=>{const{command:e,cwd:o,env:s,logFile:r}=t,i=ft(r,"a",R);let c;const h=I?"cmd":"/bin/sh",H=I?["/d","/s","/c",e]:["-c",e];try{c=ut(h,H,{cwd:o,detached:!0,env:{...process.env,...s},stdio:["ignore",i,i],windowsHide:!0})}finally{pt(i)}if(c.pid===void 0&&await new Promise((P,a)=>{c.once("spawn",()=>{P()}),c.once("error",U=>{a(U)})}),c.pid===void 0)throw new Error(`Failed to spawn detached process for command: ${e}`);return c.unref(),{pid:c.pid}},"spawnDetached");var ee=Object.defineProperty,S=n((t,e)=>ee(t,"name",{value:e,configurable:!0}),"t");const J=5e3,he=S(async t=>B(t.workspaceRoot,t.id,async()=>{const e=await b(t.workspaceRoot,t.id);if(e&&f(e.pid))throw new Error(`Service ${t.id} is already running (pid ${String(e.pid)})`);e&&await g(t.workspaceRoot,t.id,e);const o=await k(t.workspaceRoot),s=T(t.id),r=w(o,`${s}.log`),{pid:i}=await te({command:t.command,cwd:t.cwd,env:t.env,logFile:r}),c={command:t.command,config:t.config,cwd:t.cwd,env:t.config.env??{},id:t.id,logFile:r,pid:i,slug:s,startedAt:new Date().toISOString(),visVersion:process.env.VIS_VERSION??"0.0.0"};if(await At(t.workspaceRoot,c),t.skipReadiness!==!0)try{await Tt(t.config,{timeoutMs:t.readinessTimeoutMs})}catch(h){throw await K(i,t.config.killGracePeriodMs??J).catch(()=>{}),await g(t.workspaceRoot,t.id,c).catch(()=>{}),h}return{entry:c}}),"startService"),ue=S(async t=>B(t.workspaceRoot,t.id,async()=>{const e=await b(t.workspaceRoot,t.id);if(!e)return{stopped:!1};if(!f(e.pid))return await g(t.workspaceRoot,t.id,e),{stopped:!1};const o=t.graceMs??e.config.killGracePeriodMs??J;return await K(e.pid,o),await g(t.workspaceRoot,t.id,e),{stopped:!0}}),"stopService"),K=S(async(t,e)=>{L(t,"SIGTERM");const o=Date.now();for(;Date.now()-o<e;){if(!f(t))return;await new Promise(s=>{setTimeout(s,100)})}f(t)&&L(t,"SIGKILL")},"stopServiceByPid"),L=S((t,e)=>{try{process.platform==="win32"?process.kill(t,e):process.kill(-t,e)}catch(o){if(o.code==="ESRCH")return;throw o}},"sendSignalToServiceGroup");export{de as H,Ht as S,b as a,ue as b,ce as c,Ct as d,Tt as e,g as f,f as i,ae as p,le as r,he as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var fe=Object.defineProperty;var T=(s,l)=>fe(s,"name",{value:l,configurable:!0});import{jsxs as t,jsx as r,Fragment as Z}from"react/jsx-runtime";import{Box as i}from"@visulima/tui/components/box";import{Spinner as we}from"@visulima/tui/components/spinner";import{Text as e}from"@visulima/tui/components/text";import{useWindowSize as se}from"@visulima/tui/hooks/use-window-size";import{useSyncExternalStore as ye,useState as L,useRef as z,useMemo as be,useCallback as he,useEffect as Ce}from"react";import{Dialog as ee}from"@visulima/tui/components/dialog";import{useApp as ke}from"@visulima/tui/hooks/use-app";import{useInput as xe}from"@visulima/tui/hooks/use-input";import{K as ue,aE as ae}from"../packem_chunks/bin.js";import{ScrollView as Te}from"@visulima/tui/components/scroll-view";import{ScrollBar as Se}from"@visulima/tui/components/scroll-bar";import{Tab as ve}from"@visulima/tui/components/tab";import{Tabs as Ae}from"@visulima/tui/components/tabs";import{u as Re}from"./use-measured-height-DjYgUOKk.js";var Ee=Object.defineProperty,Ie=T((s,l)=>Ee(s,"name",{value:l,configurable:!0}),"a$1");const pr=Ie(({current:s,total:l})=>{const{columns:h}=se(),c=h||80,p=l>0?Math.min(1,s/l):0,a=`${String(Math.round(p*100)).padStart(3)}%`,y=`${String(s)}/${String(l)}`,b=Math.max(10,c-2-a.length-1),m=Math.round(b*p),f=b-m;return t(i,{flexDirection:"column",paddingX:1,children:[t(i,{children:[r(we,{type:"dots"}),r(e,{children:" Checking catalog dependencies "}),r(e,{dimColor:!0,children:y})]}),t(i,{children:[r(e,{color:"cyan",children:"━".repeat(m)}),r(e,{dimColor:!0,children:"─".repeat(f)}),t(e,{dimColor:!0,children:[" ",a]})]})]})},"CheckProgressApp");var De=Object.defineProperty,H=T((s,l)=>De(s,"name",{value:l,configurable:!0}),"r");const W=H(s=>{const l=new Map;for(const h of s){const c=l.get(h.catalogName);c?c.push(h):l.set(h.catalogName,[h])}return l},"groupByCatalog"),Q=H((s,l,h)=>{let c=s;if(l!=="all"&&(c=l==="security"?c.filter(p=>p.vulnerabilities&&p.vulnerabilities.length>0||p.socketReport&&p.socketReport.alerts.length>0):c.filter(p=>p.updateType===l)),h){const p=h.toLowerCase();c=c.filter(a=>a.packageName.toLowerCase().includes(p))}return c},"filterEntries");class gr{static{T(this,"UpdateStore")}static{H(this,"UpdateStore")}#e;#l=new Set;#t;#i=null;constructor(l,h=null){this.#t=l,h&&(this.#i=new Map(h.recommendations.map(c=>[c.package,c]))),this.#e={aiResult:h,allChecked:!0,applyProgress:null,checkedEntries:new Set(l.map(c=>c.packageName)),entries:l,error:null,filterActive:!1,filterText:"",filterType:"all",focusedPanel:"list",groupedByCatalog:W(l),phase:"browsing",selectedIndex:0}}getSnapshot=H(()=>this.#e,"getSnapshot");subscribe=H(l=>(this.#l.add(l),()=>{this.#l.delete(l)}),"subscribe");getFilteredEntries(){return Q(this.#t,this.#e.filterType,this.#e.filterText)}getRecommendation(l){return this.#i?.get(l)}getCheckedEntries(){return this.#t.filter(l=>this.#e.checkedEntries.has(l.packageName))}setSelectedIndex(l){const h=this.getFilteredEntries(),c=Math.max(0,Math.min(l,h.length-1));c!==this.#e.selectedIndex&&this.#r({...this.#e,selectedIndex:c})}setFocusedPanel(l){l!==this.#e.focusedPanel&&this.#r({...this.#e,focusedPanel:l})}setFilterType(l){if(l!==this.#e.filterType){const h=Q(this.#t,l,this.#e.filterText);this.#r({...this.#e,entries:h,filterType:l,groupedByCatalog:W(h),selectedIndex:0})}}setFilter(l){const h=Q(this.#t,this.#e.filterType,l);this.#r({...this.#e,entries:h,filterText:l,groupedByCatalog:W(h),selectedIndex:0})}setFilterActive(l){if(l!==this.#e.filterActive)if(l)this.#r({...this.#e,filterActive:!0});else{const h=Q(this.#t,this.#e.filterType,"");this.#r({...this.#e,entries:h,filterActive:!1,filterText:"",groupedByCatalog:W(h),selectedIndex:0})}}toggleCheck(l){const h=new Set(this.#e.checkedEntries);h.has(l)?h.delete(l):h.add(l),this.#r({...this.#e,allChecked:h.size===this.#t.length,checkedEntries:h})}checkAll(){this.#r({...this.#e,allChecked:!0,checkedEntries:new Set(this.#t.map(l=>l.packageName))})}uncheckAll(){this.#r({...this.#e,allChecked:!1,checkedEntries:new Set})}toggleAll(){this.#e.allChecked?this.uncheckAll():this.checkAll()}startApply(){const l=this.getCheckedEntries();this.#r({...this.#e,applyProgress:{current:0,total:l.length},phase:"applying"})}updateApplyProgress(l){this.#e.applyProgress&&this.#r({...this.#e,applyProgress:{...this.#e.applyProgress,current:l}})}markDone(){this.#r({...this.#e,phase:"done"})}setError(l){this.#r({...this.#e,error:l,phase:"error"})}#r(l){this.#e=l;for(const h of this.#l)try{h()}catch{}}}var Be=Object.defineProperty,Ne=T((s,l)=>Be(s,"name",{value:l,configurable:!0}),"d");const Pe={major:"red",minor:"yellow",patch:"green"},Le={CRITICAL:"red",HIGH:"red",LOW:"gray",MODERATE:"yellow",UNKNOWN:"gray"},Me={critical:"red",high:"red",low:"gray",medium:"yellow"},je={critical:"red",high:"red",low:"green",medium:"yellow"},$e={defer:"gray",review:"yellow",skip:"red",update:"green"},Fe=Ne(({changelogUrl:s,entry:l,focused:h,recommendation:c,scrollRef:p})=>{const a=h?"white":"gray";if(!l)return r(i,{alignItems:"center",borderColor:"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,justifyContent:"center",children:r(e,{dimColor:!0,children:"No package selected"})});const y=Pe[l.updateType]??"white",b=l.vulnerabilities&&l.vulnerabilities.length>0,m=l.socketReport?.score.overall??0,f=l.socketReport?ue(m):"gray";return t(i,{borderColor:a,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[r(i,{flexShrink:0,paddingTop:1,paddingX:2,children:r(e,{bold:!0,color:"white",children:l.packageName})}),t(Te,{flexGrow:1,flexShrink:1,paddingX:2,ref:p,scrollbar:!0,scrollbarColor:"gray",scrollbarStyle:"block",children:[r(e,{}),t(i,{children:[r(i,{width:12,children:r(e,{dimColor:!0,children:"Current:"})}),r(e,{children:l.currentRange})]}),t(i,{children:[r(i,{width:12,children:r(e,{dimColor:!0,children:"Target:"})}),r(e,{children:l.newRange}),t(e,{bold:!0,color:y,children:[" ","(",l.updateType,")"]})]}),t(i,{children:[r(i,{width:12,children:r(e,{dimColor:!0,children:"Version:"})}),r(e,{children:l.targetVersion})]}),t(i,{children:[r(i,{width:12,children:r(e,{dimColor:!0,children:"Catalog:"})}),r(e,{children:l.catalogName})]}),l.acceptedRisk&&t(i,{flexDirection:"column",marginTop:1,children:[r(e,{color:"gray",children:"── "}),r(e,{bold:!0,color:"gray",children:"ACKNOWLEDGED RISK"}),t(i,{flexDirection:"column",paddingLeft:2,children:[t(i,{children:[r(e,{dimColor:!0,children:"Reason: "}),r(e,{children:l.acceptedRisk.reason})]}),t(i,{children:[r(e,{dimColor:!0,children:"Accepted: "}),r(e,{children:l.acceptedRisk.acceptedAt.slice(0,10)})]})]})]}),b&&t(i,{flexDirection:"column",marginTop:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"red",children:"SECURITY"}),r(e,{}),l.vulnerabilities.map(o=>t(i,{flexDirection:"column",marginBottom:1,children:[t(i,{gap:1,children:[t(e,{bold:!0,color:Le[o.severity]??"gray",children:["⚠"," ",o.severity]}),r(e,{bold:!0,children:o.id})]}),r(i,{paddingLeft:2,children:r(e,{children:o.summary})}),t(i,{gap:2,paddingLeft:2,children:[o.cvssScore!==void 0&&t(e,{dimColor:!0,children:["CVSS:",String(o.cvssScore)]}),o.fixedVersions.length>0&&t(e,{dimColor:!0,children:["Fixed in:",o.fixedVersions.join(", ")]})]})]},o.id))]}),l.socketReport&&t(i,{flexDirection:"column",marginTop:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"cyan",children:"SOCKET.DEV"}),r(e,{}),t(i,{gap:2,children:[t(i,{children:[r(e,{dimColor:!0,children:"Overall: "}),t(e,{bold:!0,color:f,children:[String(Math.round(m*100)),"%"]})]}),t(i,{children:[r(e,{dimColor:!0,children:"Supply Chain: "}),t(e,{children:[String(Math.round(l.socketReport.score.supplyChain*100)),"%"]})]}),t(i,{children:[r(e,{dimColor:!0,children:"Quality: "}),t(e,{children:[String(Math.round(l.socketReport.score.quality*100)),"%"]})]})]}),t(i,{gap:2,children:[t(i,{children:[r(e,{dimColor:!0,children:"Maintenance: "}),t(e,{children:[String(Math.round(l.socketReport.score.maintenance*100)),"%"]})]}),t(i,{children:[r(e,{dimColor:!0,children:"Vulnerability: "}),t(e,{children:[String(Math.round(l.socketReport.score.vulnerability*100)),"%"]})]}),t(i,{children:[r(e,{dimColor:!0,children:"License: "}),t(e,{children:[l.socketReport.license||"unknown"," ","(",String(Math.round(l.socketReport.score.license*100)),"%)"]})]})]}),l.socketReport.alerts.length>0&&t(i,{flexDirection:"column",marginTop:1,children:[t(e,{bold:!0,color:"yellow",children:["⚠"," ",String(l.socketReport.alerts.length)," ","alert",l.socketReport.alerts.length===1?"":"s",":"]}),l.socketReport.alerts.map(o=>t(i,{gap:1,paddingLeft:2,children:[t(e,{bold:!0,color:Me[o.severity]??"gray",children:["[",o.severity.toUpperCase(),"]"]}),r(e,{children:o.type}),t(e,{dimColor:!0,children:["(",o.category,")"]})]},o.key))]})]}),c&&t(i,{flexDirection:"column",marginTop:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"AI ANALYSIS"}),r(e,{}),t(i,{gap:2,children:[t(i,{children:[r(e,{dimColor:!0,children:"Action: "}),r(e,{bold:!0,color:$e[c.action]??"white",children:c.action})]}),t(i,{children:[r(e,{dimColor:!0,children:"Risk: "}),r(e,{bold:!0,color:je[c.riskLevel]??"white",children:c.riskLevel})]}),t(i,{children:[r(e,{dimColor:!0,children:"Effort: "}),r(e,{bold:!0,children:c.effort})]})]}),c.reason&&r(i,{marginTop:1,paddingLeft:2,children:r(e,{children:c.reason})}),c.breakingChanges.length>0&&t(i,{flexDirection:"column",marginTop:1,paddingLeft:2,children:[r(e,{bold:!0,color:"yellow",children:"Breaking changes:"}),c.breakingChanges.map((o,I)=>t(e,{children:[" ","•"," ",o]},String(I)))]})]}),s&&t(i,{flexDirection:"column",marginTop:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"CHANGELOG"}),r(i,{marginTop:1,paddingLeft:2,children:r(e,{color:"cyan",underline:!0,children:s})})]}),t(i,{flexDirection:"column",marginTop:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"LINKS"}),r(i,{flexDirection:"column",marginTop:1,paddingLeft:2,children:t(e,{color:"cyan",underline:!0,children:["https://npmx.dev/",l.packageName]})})]}),!c&&t(i,{flexDirection:"column",marginTop:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"GUIDANCE"}),t(i,{flexDirection:"column",marginTop:1,paddingLeft:2,children:[l.updateType==="major"&&t(Z,{children:[t(e,{color:"red",children:["⚠"," ","Major update — likely contains breaking changes."]}),r(e,{dimColor:!0,children:" Review the changelog before updating."}),r(e,{dimColor:!0,children:" Use --changelog to fetch release URLs."})]}),l.updateType==="minor"&&t(Z,{children:[t(e,{color:"yellow",children:["ℹ"," ","Minor update — new features, backward compatible."]}),r(e,{dimColor:!0,children:" Generally safe to update."})]}),l.updateType==="patch"&&t(Z,{children:[t(e,{color:"green",children:["✓"," ","Patch update — bug fixes only."]}),r(e,{dimColor:!0,children:" Safe to update."})]}),!c&&r(e,{dimColor:!0,children:" Use --ai to get AI-powered analysis."})]})]})]})]})},"PackageDetailPanel");var Oe=Object.defineProperty,re=T((s,l)=>Oe(s,"name",{value:l,configurable:!0}),"x");const Ue={major:"red",minor:"yellow",patch:"green"},Ge=[{id:"all",label:"All"},{id:"major",label:"Major"},{id:"minor",label:"Minor"},{id:"patch",label:"Patch"},{id:"security",label:"Security"}],He=re(({checked:s,entry:l,isSelected:h})=>{const c=Ue[l.updateType]??"white",p=l.vulnerabilities&&l.vulnerabilities.length>0,a=l.socketReport&&l.socketReport.alerts.length>0,y=!!l.acceptedRisk,b=s?"☑":"☐",m=l.socketReport?`${String(Math.round(l.socketReport.score.overall*100))}%`:"",f=l.socketReport?ue(l.socketReport.score.overall):"gray";return t(i,{flexShrink:0,height:1,children:[r(e,{children:h?">":" "}),t(e,{color:s?"white":"gray",children:[" ",b," "]}),p||a?r(e,{color:y?"gray":"red",children:y?"✓ ":"⚠ "}):r(e,{children:" "}),r(i,{flexGrow:1,children:t(e,{bold:h,inverse:h,wrap:"truncate",children:[l.packageName,y?" [ack]":""]})}),m&&t(e,{color:f,children:[" ",m]}),t(e,{dimColor:!0,children:[" ",l.currentRange]}),t(e,{dimColor:!0,children:[" ","→"," "]}),t(e,{children:[l.newRange," "]}),r(e,{bold:!0,color:c,children:l.updateType})]})},"PackageRow"),Ve=re(({count:s,name:l})=>t(i,{flexShrink:0,height:1,marginTop:1,children:[t(e,{dimColor:!0,children:["▼"," "]}),r(e,{bold:!0,color:"white",children:l.toUpperCase()}),t(e,{dimColor:!0,children:[" ","(",s,")"]})]}),"CatalogHeader"),qe=re(({checkedEntries:s,entries:l,filterActive:h,filteredOutCount:c,filterText:p,filterType:a,focused:y,groupedByCatalog:b,isDryRun:m,onViewportHeightChange:f,scrollOffset:o,selectedIndex:I,totalCatalogEntries:D,totalChecked:v,totalEntries:V,viewportHeight:M})=>{const j=y?"white":"gray",{measuredHeight:w,ref:A}=Re(M,f);let $=0,S=0,B=0,R=0;for(const g of l)g.updateType==="major"?$++:g.updateType==="minor"?S++:B++,(g.vulnerabilities&&g.vulnerabilities.length>0||g.socketReport&&g.socketReport.alerts.length>0)&&R++;const k=[];$>0&&k.push(`${$} major`),S>0&&k.push(`${S} minor`),B>0&&k.push(`${B} patch`),R>0&&k.push(`${R} vulnerable`);const N=k.length>0?` (${k.join(", ")})`:"";let x=0;for(const g of l)s.has(g.packageName)&&x++;const C=[];let q=0;for(const[g,E]of b){C.push(r(Ve,{count:E.length,name:g},`hdr-${g}`));for(const O of E){const P=q;C.push(r(He,{checked:s.has(O.packageName),entry:O,isSelected:P===I},O.packageName)),q++}}let F=0;for(const[,g]of b)F+=2+g.length;const K=F>w&&w>0;return t(i,{borderColor:j,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[t(i,{flexShrink:0,gap:1,paddingX:1,children:[r(e,{bold:!0,inverse:!0,children:" VIS "}),t(e,{wrap:"truncate",children:[V,v>0?`/${v}`:""," ","outdated",N,D>v?` · ${D-v} dupes`:""]}),!m&&x>0&&t(e,{dimColor:!0,children:[" ","—",x," ","selected"]})]}),r(i,{flexShrink:0,paddingX:1,paddingY:1,children:r(Ae,{isFocused:y,keyMap:{next:[],previous:[],useNumbers:!1,useTab:!1},onChange:T(()=>{},"onChange"),showIndex:!1,value:a,children:Ge.map(({id:g,label:E})=>r(ve,{name:g,children:E},g))})}),h&&t(i,{flexShrink:0,paddingX:1,children:[r(e,{bold:!0,color:"white",children:"/ "}),r(e,{children:p}),r(e,{inverse:!0,children:" "})]}),c>0&&r(i,{flexShrink:0,paddingX:1,children:t(e,{color:"yellow",children:["⚠"," ",c," ","package",c===1?"":"s"," ","filtered out by target constraint — press"," ",r(e,{bold:!0,color:"white",children:"f"})," ","to view"]})}),t(i,{flexDirection:"row",flexGrow:1,overflow:"hidden",ref:A,children:[r(i,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:r(i,{flexDirection:"column",marginTop:-o,children:C})}),K&&r(i,{flexShrink:0,marginLeft:1,marginRight:1,children:r(Se,{contentHeight:F,placement:"inset",scrollOffset:o,style:"block",viewportHeight:w})})]},`list-${a}-${p}`)]})},"PackageListPanel");var Ke=Object.defineProperty,Xe=T((s,l)=>Ke(s,"name",{value:l,configurable:!0}),"X");const Ye=100,ze=40,We=10,Qe=[],G=["all","major","minor","patch","security"],mr=Xe(({autoExitSeconds:s=0,changelogUrls:l,checkedCount:h=0,filteredOutEntries:c=Qe,isDryRun:p,store:a,totalCatalogEntries:y=0})=>{const{exit:b}=ke(),{columns:m,rows:f}=se(),o=ye(a.subscribe,a.getSnapshot),[I,D]=L(!1),[v,V]=L(!1),M=z(null),j=z(null),w=z(null),A=z(null),[$,S]=L(0),[B,R]=L(!1),[k,N]=L(!1),x=be(()=>a.getFilteredEntries(),[o.entries,o.filterType,o.filterText]),C=x[o.selectedIndex]??null,q=C?a.getRecommendation(C.packageName):void 0,F=C&&l?l.get(C.packageName):void 0,K=he(n=>{let d=0,u=0;for(const[,J]of o.groupedByCatalog){d+=2;for(let de=0;de<J.length;de++){if(u===n)return d;d+=1,u++}}return d},[o.groupedByCatalog]),g=Math.max(1,f-8-(o.filterActive?1:0)),[E,O]=L(g),P=E>0?E:g,U=he(n=>{const d=K(n);S(u=>d>u+P-2?Math.max(0,d-P+2):d<u+1?Math.max(0,d-1):u)},[K,P]);if(Ce(()=>{w.current?.scrollToTop()},[C?.packageName]),xe((n,d)=>{if(n==="c"&&d.ctrl){b();return}if(!k){if(v){d.escape||n==="f"||n==="q"?V(!1):d.downArrow||n==="j"?j.current?.scrollBy(1):(d.upArrow||n==="k")&&j.current?.scrollBy(-1);return}if(B){n==="u"||d.return?(R(!1),a.startApply(),b(a.getCheckedEntries())):d.escape||n==="q"?R(!1):d.downArrow||n==="j"?A.current?.scrollBy(1):d.upArrow||n==="k"?A.current?.scrollBy(-1):d.pageDown?A.current?.scrollBy(5):d.pageUp&&A.current?.scrollBy(-5);return}if(I){d.escape||n==="?"?D(!1):n==="q"?(D(!1),N(!0)):d.downArrow||n==="j"?M.current?.scrollBy(1):(d.upArrow||n==="k")&&M.current?.scrollBy(-1);return}if(n==="?"){D(!0);return}if(n==="q"){N(!0);return}if(d.tab){a.setFocusedPanel(o.focusedPanel==="list"?"detail":"list");return}if(o.focusedPanel==="list"&&(d.leftArrow||d.rightArrow)){const u=G.indexOf(o.filterType),J=d.rightArrow?(u+1)%G.length:(u-1+G.length)%G.length;S(0),w.current?.scrollToTop(),a.setFilterType(G[J]);return}if(n==="f"&&c.length>0){V(u=>!u);return}if(o.filterActive){if(d.escape){a.setFilterActive(!1);return}if(d.return){a.setFilterActive(!1);return}if(d.backspace){S(0),a.setFilter(o.filterText.slice(0,-1));return}if(n&&!d.ctrl&&!d.meta){S(0),a.setFilter(o.filterText+n);return}return}if(o.focusedPanel==="list"){if(d.downArrow||n==="j"){const u=Math.min(o.selectedIndex+1,x.length-1);a.setSelectedIndex(u),U(u);return}if(d.upArrow||n==="k"){const u=Math.max(o.selectedIndex-1,0);a.setSelectedIndex(u),U(u);return}if(d.pageDown){const u=Math.min(o.selectedIndex+10,x.length-1);a.setSelectedIndex(u),U(u);return}if(d.pageUp){const u=Math.max(o.selectedIndex-10,0);a.setSelectedIndex(u),U(u);return}if(d.home){a.setSelectedIndex(0),S(0);return}if(d.end){const u=x.length-1;a.setSelectedIndex(u),U(u);return}if(n===" "||d.return){C&&a.toggleCheck(C.packageName);return}if(n==="a"){a.toggleAll();return}if(n==="/"){a.setFilterActive(!0);return}if(n==="u"&&!p&&o.checkedEntries.size>0){R(!0);return}if(d.rightArrow){a.setFocusedPanel("detail");return}return}if(o.focusedPanel==="detail"){if(d.escape||d.leftArrow){a.setFocusedPanel("list");return}if(d.downArrow||n==="j"){w.current?.scrollBy(1);return}if(d.upArrow||n==="k"){w.current?.scrollBy(-1);return}if(d.pageDown){w.current?.scrollBy(10);return}if(d.pageUp){w.current?.scrollBy(-10);return}if(d.home){w.current?.scrollToTop();return}d.end&&w.current?.scrollToBottom()}}},{isActive:!0}),m<ze||f<We)return r(i,{alignItems:"center",height:f,justifyContent:"center",width:m,children:t(e,{color:"yellow",children:["Terminal too small (",m,"x",f,")"]})});const pe=m>=Ye,X=[t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"q"}),r(e,{dimColor:!0,children:"QUIT"})]},"q"),t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"?"}),r(e,{dimColor:!0,children:"HELP"})]},"?"),t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"↑↓"}),r(e,{dimColor:!0,children:"NAV"})]},"nav"),t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"Space"}),r(e,{dimColor:!0,children:"CHECK"})]},"sp"),t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"a"}),r(e,{dimColor:!0,children:"ALL"})]},"a")];!p&&o.checkedEntries.size>0&&X.push(t(i,{gap:1,children:[r(e,{bold:!0,color:"green",children:"u"}),r(e,{dimColor:!0,children:"APPLY"})]},"u")),c.length>0&&X.push(t(i,{gap:1,children:[r(e,{bold:!0,color:"yellow",children:"f"}),t(e,{dimColor:!0,children:["FILTERED (",c.length,")"]})]},"fo")),X.push(t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"←→"}),r(e,{dimColor:!0,children:"FILTER"})]},"lr"),t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"/"}),r(e,{dimColor:!0,children:"SEARCH"})]},"f"),t(i,{gap:1,children:[r(e,{bold:!0,color:"white",children:"Tab"}),r(e,{dimColor:!0,children:"PANEL"})]},"t"));const te=r(i,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",flexShrink:0,children:r(i,{flexWrap:"wrap",gap:2,paddingX:1,children:X})}),le=t(ee,{footer:t(e,{dimColor:!0,children:[r(e,{bold:!0,color:"white",children:"↑↓"})," ","scroll"," ",r(e,{bold:!0,color:"white",children:"?"}),"/",r(e,{bold:!0,color:"white",children:"Esc"})," ","close"]}),scrollRef:M,title:"KEYBOARD SHORTCUTS",visible:I,width:52,children:[t(i,{flexDirection:"column",marginBottom:1,children:[t(i,{marginBottom:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"NAVIGATION"})]}),t(i,{children:[r(i,{width:24,children:t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","↑","/k"]}),r(e,{dimColor:!0,children:" Move up"})]})}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","↓","/j"]}),r(e,{dimColor:!0,children:" Move down"})]})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","Tab"]}),r(e,{dimColor:!0,children:" Switch panel"})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","→","/","←"]}),r(e,{dimColor:!0,children:" Focus detail/list"})]})]}),t(i,{flexDirection:"column",marginBottom:1,children:[t(i,{marginBottom:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"SELECTION"})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","Space"]}),r(e,{dimColor:!0,children:" Toggle check on package"})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","a"]}),r(e,{dimColor:!0,children:" Toggle check all"})]})]}),t(i,{flexDirection:"column",marginBottom:1,children:[t(i,{marginBottom:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"FILTERS"})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","←→"]}),r(e,{dimColor:!0,children:" Switch filter tab"})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","/"]}),r(e,{dimColor:!0,children:" Text filter"})]}),c.length>0&&t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","f"]}),r(e,{dimColor:!0,children:" View filtered-out packages"})]})]}),t(i,{flexDirection:"column",children:[t(i,{marginBottom:1,children:[r(e,{dimColor:!0,children:"── "}),r(e,{bold:!0,color:"white",children:"ACTIONS"})]}),!p&&t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","u"]}),r(e,{dimColor:!0,children:" Apply selected updates"})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","q"]}),r(e,{dimColor:!0,children:" Quit"})]}),t(e,{children:[t(e,{bold:!0,color:"white",children:[" ","?"]}),r(e,{dimColor:!0,children:" Toggle help"})]})]})]}),Y=a.getCheckedEntries(),_=Y.filter(n=>n.updateType==="major").length,ge=t(i,{alignItems:"center",flexDirection:"column",children:[_>0&&r(i,{marginBottom:1,marginTop:1,children:t(e,{color:"yellow",children:["⚠"," ",_," ","major update",_===1?"":"s"," ","— review breaking changes"]})}),t(e,{dimColor:!0,children:["Press"," ",r(e,{bold:!0,color:"white",children:"u"})," ","or"," ",r(e,{bold:!0,color:"white",children:"Enter"})," ","to confirm,"," ",r(e,{bold:!0,color:"white",children:"Esc"})," ","to cancel"]})]}),ie=r(ee,{footer:ge,scrollRef:A,title:`Apply ${Y.length} update${Y.length===1?"":"s"}?`,visible:B,width:70,children:Y.map(n=>t(i,{gap:1,children:[t(e,{children:[" ",n.packageName]}),t(e,{dimColor:!0,children:[n.currentRange," ","→"," ",n.newRange]}),r(e,{bold:!0,color:n.updateType==="major"?"red":n.updateType==="minor"?"yellow":"green",children:n.updateType})]},n.packageName))}),oe=c.length>0?r(ee,{footer:t(e,{dimColor:!0,children:[r(e,{bold:!0,color:"white",children:"↑↓"})," ","scroll"," ",r(e,{bold:!0,color:"white",children:"f"}),"/",r(e,{bold:!0,color:"white",children:"Esc"})," ","close"]}),scrollRef:j,title:`${c.length} PACKAGE${c.length===1?"":"S"} FILTERED BY TARGET`,visible:v,width:70,children:t(i,{flexDirection:"column",children:[r(i,{marginBottom:1,children:t(e,{dimColor:!0,children:["These packages have newer versions available but are excluded by the current target constraint. Use"," ",r(e,{bold:!0,color:"white",children:"--target latest"})," ","to include them."]})}),c.map(n=>t(i,{gap:1,children:[t(e,{children:[" ",n.packageName]}),t(e,{dimColor:!0,children:[n.currentRange," ","→"," ",n.newRange]}),r(e,{bold:!0,color:n.updateType==="major"?"red":n.updateType==="minor"?"yellow":"green",children:n.updateType})]},n.packageName))]})}):null,ne=r(qe,{checkedEntries:o.checkedEntries,entries:x,filterActive:o.filterActive,filteredOutCount:c.length,filterText:o.filterText,filterType:o.filterType,focused:o.focusedPanel==="list",groupedByCatalog:o.groupedByCatalog,isDryRun:p,onViewportHeightChange:O,scrollOffset:$,selectedIndex:o.selectedIndex,totalCatalogEntries:y,totalChecked:h,totalEntries:x.length,viewportHeight:P}),ce=r(Fe,{changelogUrl:F,entry:C,focused:o.focusedPanel==="detail",recommendation:q,scrollRef:w});if(pe){const n=Math.floor(m*.35);return t(i,{flexDirection:"column",height:f,width:m,children:[t(i,{flexDirection:"row",flexGrow:1,children:[r(i,{flexGrow:1,children:ne}),r(i,{width:n,children:ce})]}),te,ie,oe,r(ae,{autoExitSeconds:s||3,onCancel:T(()=>{N(!1)},"onCancel"),visible:k}),le]})}const me=Math.floor(f*.55);return t(i,{flexDirection:"column",height:f,width:m,children:[r(i,{height:me,children:ne}),r(i,{flexGrow:1,children:ce}),te,ie,oe,r(ae,{autoExitSeconds:s||3,onCancel:T(()=>{N(!1)},"onCancel"),visible:k}),le]})},"VisUpdateApp");export{mr as C,gr as U,pr as a};
|