@visulima/vis 1.0.0-alpha.15 → 1.0.0-alpha.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/LICENSE.md +44 -233
  3. package/dist/bin.js +1 -1
  4. package/dist/config/index.d.ts +121 -94
  5. package/dist/config/index.js +1 -1
  6. package/dist/packem_chunks/bin.js +271 -271
  7. package/dist/packem_chunks/config.js +18 -0
  8. package/dist/packem_chunks/fix.js +1 -1
  9. package/dist/packem_chunks/handler.js +1 -1
  10. package/dist/packem_chunks/handler10.js +1 -1
  11. package/dist/packem_chunks/handler11.js +1 -1
  12. package/dist/packem_chunks/handler12.js +1 -1
  13. package/dist/packem_chunks/handler13.js +1 -1
  14. package/dist/packem_chunks/handler14.js +4 -4
  15. package/dist/packem_chunks/handler15.js +1 -1
  16. package/dist/packem_chunks/handler16.js +1 -1
  17. package/dist/packem_chunks/handler17.js +1 -1
  18. package/dist/packem_chunks/handler18.js +1 -1
  19. package/dist/packem_chunks/handler19.js +5 -5
  20. package/dist/packem_chunks/handler2.js +1 -1
  21. package/dist/packem_chunks/handler20.js +2 -1
  22. package/dist/packem_chunks/handler21.js +18 -1
  23. package/dist/packem_chunks/handler22.js +1 -5
  24. package/dist/packem_chunks/handler23.js +1 -1
  25. package/dist/packem_chunks/handler24.js +5 -3
  26. package/dist/packem_chunks/handler25.js +1 -1
  27. package/dist/packem_chunks/handler26.js +3 -1
  28. package/dist/packem_chunks/handler27.js +1 -7
  29. package/dist/packem_chunks/handler28.js +1 -23
  30. package/dist/packem_chunks/handler29.js +7 -3
  31. package/dist/packem_chunks/handler3.js +1 -1
  32. package/dist/packem_chunks/handler30.js +23 -18
  33. package/dist/packem_chunks/handler31.js +3 -1
  34. package/dist/packem_chunks/handler32.js +1 -2
  35. package/dist/packem_chunks/handler33.js +2 -25
  36. package/dist/packem_chunks/handler34.js +25 -2
  37. package/dist/packem_chunks/handler35.js +2 -2
  38. package/dist/packem_chunks/handler36.js +8 -8
  39. package/dist/packem_chunks/handler37.js +3 -3
  40. package/dist/packem_chunks/handler38.js +4 -4
  41. package/dist/packem_chunks/handler39.js +6 -6
  42. package/dist/packem_chunks/handler40.js +5 -5
  43. package/dist/packem_chunks/handler41.js +9 -9
  44. package/dist/packem_chunks/handler42.js +10 -10
  45. package/dist/packem_chunks/handler43.js +1 -1
  46. package/dist/packem_chunks/handler44.js +5 -5
  47. package/dist/packem_chunks/handler45.js +3 -3
  48. package/dist/packem_chunks/handler46.js +9 -9
  49. package/dist/packem_chunks/handler47.js +161 -36
  50. package/dist/packem_chunks/handler48.js +1 -1
  51. package/dist/packem_chunks/handler5.js +5 -5
  52. package/dist/packem_chunks/handler6.js +1 -1
  53. package/dist/packem_chunks/handler7.js +1 -1
  54. package/dist/packem_chunks/handler8.js +1 -1
  55. package/dist/packem_chunks/handler9.js +1 -1
  56. package/dist/packem_chunks/heal-accept.js +2 -2
  57. package/dist/packem_chunks/heal.js +1 -1
  58. package/dist/packem_chunks/help-command.js +16 -16
  59. package/dist/packem_chunks/index.js +1 -1
  60. package/dist/packem_chunks/loader.js +1 -1
  61. package/dist/packem_shared/{ai-analysis-CGVjqwdc.js → ai-analysis-C_GpXikx.js} +3 -3
  62. package/dist/packem_shared/ai-cache-DrCLD4gc.js +1 -0
  63. package/dist/packem_shared/ai-fix-CWOz12Om.js +43 -0
  64. package/dist/packem_shared/applyDefaults-DLY94gWA.js +1 -0
  65. package/dist/packem_shared/cache-directory-C_U1qsIw.js +1 -0
  66. package/dist/packem_shared/definePlugin-CWm4Dv_t.js +1 -0
  67. package/dist/packem_shared/dependency-scan-YdgNVvoz.js +2 -0
  68. package/dist/packem_shared/docker-Dl0AoVTZ.js +60 -0
  69. package/dist/packem_shared/failure-log-CSC6KfcO.js +2 -0
  70. package/dist/packem_shared/flakiness-Dzz-I3dB.js +1 -0
  71. package/dist/packem_shared/lifecycle-BC6Nst6i.js +2 -0
  72. package/dist/packem_shared/{lockfile-B7JJzxnL.js → lockfile-i-qvq_k8.js} +1 -1
  73. package/dist/packem_shared/otelPlugin-CJR2T_lk.js +1 -0
  74. package/dist/packem_shared/{readTomlSync-1fKo0R52-DAKNI1Me.js → readTomlSync-1fKo0R52-DtxWULlF.js} +1 -1
  75. package/dist/packem_shared/run-summary-utils-CJv75pla.js +1 -0
  76. package/dist/packem_shared/runtime-check-CBU6W8qG.js +1 -0
  77. package/dist/packem_shared/{selectors-Sem2CTYA.js → selectors-B2ISH581.js} +1 -1
  78. package/dist/packem_shared/toolchain-B7dckBQ1.js +5 -0
  79. package/dist/packem_shared/typosquats-B3A38-qx.js +1 -0
  80. package/dist/packem_shared/verify-WDStBFvK.js +1 -0
  81. package/dist/packem_shared/vis-update-app-D0uL3eO5.js +1 -0
  82. package/package.json +13 -13
  83. package/schemas/project.schema.json +12 -2
  84. package/schemas/vis-config.schema.json +248 -3
  85. package/dist/packem_chunks/applyDefaults.js +0 -2
  86. package/dist/packem_shared/ai-cache-BdPgSfg2.js +0 -1
  87. package/dist/packem_shared/ai-fix-iHtGLkJS.js +0 -43
  88. package/dist/packem_shared/cache-directory-DTfMSzT9.js +0 -1
  89. package/dist/packem_shared/dependency-scan-SQeRzrpJ.js +0 -2
  90. package/dist/packem_shared/docker-D5p9mRPU.js +0 -2
  91. package/dist/packem_shared/failure-log-CElcbnb9.js +0 -2
  92. package/dist/packem_shared/flakiness-C4t4_NoA.js +0 -1
  93. package/dist/packem_shared/otel-CO8UEfTa.js +0 -17
  94. package/dist/packem_shared/otelPlugin-DTynZDWh.js +0 -1
  95. package/dist/packem_shared/registry-D04iOQ5H.js +0 -2
  96. package/dist/packem_shared/run-summary-utils-BPraMTcm.js +0 -1
  97. package/dist/packem_shared/runtime-check-l4qFpo08.js +0 -1
  98. package/dist/packem_shared/toolchain-BhZNts--.js +0 -5
  99. package/dist/packem_shared/typosquats-Dr7VIL2B.js +0 -1
  100. package/dist/packem_shared/verify-C6NNOhTA.js +0 -1
  101. package/dist/packem_shared/vis-update-app-DGiMc5kb.js +0 -1
@@ -1,17 +0,0 @@
1
- var Io=Object.defineProperty;var x=(e,t)=>Io(e,"name",{value:t,configurable:!0});import{createRequire as Fo}from"node:module";import{definePlugin as Do}from"../packem_chunks/applyDefaults.js";const Wo=Fo(import.meta.url),dr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Lo=x(e=>{if(typeof dr<"u"&&dr.versions&&dr.versions.node){const[t,s]=dr.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return dr.getBuiltinModule(e)}return Wo(e)},"__cjs_getBuiltinModule"),{createRequire:Ce}=Lo("node:module");var Uo=Object.defineProperty,Ge=x((e,t)=>Uo(e,"name",{value:t,configurable:!0}),"K$2"),qo=Object.defineProperty,W=Ge((e,t)=>qo(e,"name",{value:t,configurable:!0}),"E");const Zo=Ce(import.meta.url),De=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ln=W(e=>{if(typeof De<"u"&&De.versions&&De.versions.node){const[t,s]=De.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return De.getBuiltinModule(e)}return Zo(e)},"__cjs_getBuiltinModule"),{existsSync:Ue}=Ln("node:fs"),{env:qe,cwd:Dn}=De,{createRequire:He}=Ln("node:module"),Un=0,Ze=2,qn=Symbol("findUpStop");var Vo=Object.defineProperty,Jo=W((e,t)=>Vo(e,"name",{value:t,configurable:!0}),"t$4"),Go=Object.defineProperty,Ho=Jo((e,t)=>Go(e,"name",{value:t,configurable:!0}),"t"),Ko=Object.defineProperty,Xo=Ho((e,t)=>Ko(e,"name",{value:t,configurable:!0}),"n");const Qr=Xo(e=>{if(!e||!(e instanceof URL)&&typeof e!="string")throw new TypeError("Path must be a non-empty string or URL.")},"assertValidFileOrDirectoryPath");var Yo=Object.defineProperty,Qo=W((e,t)=>Yo(e,"name",{value:t,configurable:!0}),"i$4"),es=Object.defineProperty,ts=Qo((e,t)=>es(e,"name",{value:t,configurable:!0}),"r"),rs=Object.defineProperty,ns=ts((e,t)=>rs(e,"name",{value:t,configurable:!0}),"i");const bn=ns(e=>{if(e.isFile())return"file";if(e.isDirectory())return"dir";if(e.isSymbolicLink())return"symlink"},"getFileInfoType");var os=Object.defineProperty,ss=W((e,t)=>os(e,"name",{value:t,configurable:!0}),"i$3"),is=Object.defineProperty,Zn=ss((e,t)=>is(e,"name",{value:t,configurable:!0}),"s");const as=He(import.meta.url),gr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ls=Zn(e=>{if(typeof gr<"u"&&gr.versions&&gr.versions.node){const[t,s]=gr.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return gr.getBuiltinModule(e)}return as(e)},"__cjs_getBuiltinModule"),{lstatSync:yn,mkdirSync:cs}=ls("node:fs");var us=Object.defineProperty,fs=Zn((e,t)=>us(e,"name",{value:t,configurable:!0}),"o");const ps=fs(e=>{Qr(e);try{const t=yn(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(bn(t))}'`);return}catch(t){if(t.code!=="ENOENT")throw t}try{cs(e,{recursive:!0})}catch(t){if(t.code!=="EEXIST")throw t;const s=yn(e);if(!s.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(bn(s))}'`,{cause:t})}},"ensureDirSync");var ds=Object.defineProperty,b=W((e,t)=>ds(e,"name",{value:t,configurable:!0}),"s$6");let $n=b(()=>{var e=(()=>{var t=Object.defineProperty,s=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyNames,u=Object.prototype.hasOwnProperty,d=b((r,n)=>{for(var o in n)t(r,o,{get:n[o],enumerable:!0})},"ne"),h=b((r,n,o,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of l(n))!u.call(r,i)&&i!==o&&t(r,i,{get:b(()=>n[i],"get"),enumerable:!(a=s(n,i))||a.enumerable});return r},"ae"),m=b(r=>h(t({},"__esModule",{value:!0}),r),"oe"),j={};d(j,{zeptomatch:b(()=>Pe,"zeptomatch")});var A=b(r=>{const n=new Set,o=[r];for(let a=0;a<o.length;a++){const i=o[a];if(n.has(i))continue;n.add(i);const{children:c}=i;if(c?.length)for(let f=0,g=c.length;f<g;f++)o.push(c[f])}return Array.from(n)},"M"),P=b(r=>{let n="";const o=A(r);for(let a=0,i=o.length;a<i;a++){const c=o[a];if(!c.regex)continue;const f=c.regex.flags;if(n||(n=f),n!==f)throw new Error(`Inconsistent RegExp flags used: "${n}" and "${f}"`)}return n},"se"),O=b((r,n,o)=>{const a=o.get(r);if(a!==void 0)return a;const i=r.partial??n;let c="";if(r.regex&&(c+=i?"(?:$|":"",c+=r.regex.source),r.children?.length){const f=T(r.children.map(g=>O(g,n,o)).filter(Boolean));if(f?.length){const g=r.children.some(D=>!D.regex||!(D.partial??n)),w=f.length>1||i&&(!c.length||g);c+=w?i?"(?:$|":"(?:":"",c+=f.join("|"),c+=w?")":""}}return r.regex&&(c+=i?")":""),o.set(r,c),c},"O"),N=b((r,n)=>{const o=new Map,a=A(r);for(let i=a.length-1;i>=0;i--){const c=O(a[i],n,o);if(!(i>0))return c}return""},"ie"),T=b(r=>Array.from(new Set(r)),"ue"),E=b((r,n,o)=>E.compile(r,o).test(n),"R");E.compile=(r,n)=>{const o=n?.partial??!1,a=N(r,o),i=P(r);return new RegExp(`^(?:${a})$`,i)};var q=E,G=b((r,n)=>{const o=q.compile(r,n),a=`${o.source.slice(0,-1)}[\\\\/]?$`,i=o.flags;return new RegExp(a,i)},"le"),re=G,Me=b(r=>{const n=r.map(a=>a.source).join("|")||"$^",o=r[0]?.flags;return new RegExp(n,o)},"ve"),_e=Me,K=b(r=>Array.isArray(r),"j"),B=b(r=>typeof r=="function","_"),Te=b(r=>r.length===0,"he"),Re=(()=>{const{toString:r}=Function.prototype,n=/(?:^\(\s*(?:[^,.()]|\.(?!\.\.))*\s*\)\s*=>|^\s*[a-zA-Z$_][a-zA-Z0-9$_]*\s*=>)/;return o=>(o.length===0||o.length===1)&&n.test(r.call(o))})(),Ke=b(r=>typeof r=="number","de"),Xe=b(r=>typeof r=="object"&&r!==null,"xe"),Ye=b(r=>r instanceof RegExp,"me"),Qe=(()=>{const r=/\\\(|\((?!\?(?::|=|!|<=|<!))/;return n=>r.test(n.source)})(),et=(()=>{const r=/^[a-zA-Z0-9_-]+$/;return n=>r.test(n.source)&&!n.flags.includes("i")})(),ce=b(r=>typeof r=="string","A"),z=b(r=>r===void 0,"f"),tt=b(r=>{const n=new Map;return o=>{const a=n.get(o);if(a!==void 0)return a;const i=r(o);return n.set(o,i),i}},"ye"),ue=b((r,n,o={})=>{const a={cache:{},input:r,index:0,indexBacktrackMax:0,options:o,output:[]},i=M(n)(a),c=Math.max(a.index,a.indexBacktrackMax);if(i&&a.index===r.length)return a.output;throw new Error(`Failed to parse at index ${c}`)},"I"),p=b((r,n)=>K(r)?rt(r,n):ce(r)?fe(r,n):nt(r,n),"i"),rt=b((r,n)=>{const o={};for(const a of r){if(a.length!==1)throw new Error(`Invalid character: "${a}"`);const i=a.charCodeAt(0);o[i]=!0}return a=>{const i=a.input;let c=a.index,f=c;for(;f<i.length&&i.charCodeAt(f)in o;)f+=1;if(f>c){if(!z(n)&&!a.options.silent){const g=i.slice(c,f),w=B(n)?n(g,i,`${c}`):n;z(w)||a.output.push(w)}a.index=f}return!0}},"we"),nt=b((r,n)=>{if(et(r))return fe(r.source,n);{const o=r.source,a=r.flags.replace(/y|$/,"y"),i=new RegExp(o,a);return Qe(r)&&B(n)&&!Re(n)?ot(i,n):st(i,n)}},"$e"),ot=b((r,n)=>o=>{const a=o.index,i=o.input;r.lastIndex=a;const c=r.exec(i);if(c){const f=r.lastIndex;if(!o.options.silent){const g=n(...c,i,`${a}`);z(g)||o.output.push(g)}return o.index=f,!0}else return!1},"Ee"),st=b((r,n)=>o=>{const a=o.index,i=o.input;if(r.lastIndex=a,r.test(i)){const c=r.lastIndex;if(!z(n)&&!o.options.silent){const f=B(n)?n(i.slice(a,c),i,`${a}`):n;z(f)||o.output.push(f)}return o.index=c,!0}else return!1},"Ce"),fe=b((r,n)=>o=>{const a=o.index,i=o.input;if(i.startsWith(r,a)){if(!z(n)&&!o.options.silent){const c=B(n)?n(r,i,`${a}`):n;z(c)||o.output.push(c)}return o.index+=r.length,!0}else return!1},"F"),X=b((r,n,o,a)=>{const i=M(r),c=n>1;return Q(Y(de(f=>{let g=0;for(;g<o;){const w=f.index;if(!i(f)||(g+=1,f.index===w))break}return g>=n},c),a))},"k"),pe=b((r,n)=>X(r,0,1,n),"L"),Z=b((r,n)=>X(r,0,1/0,n),"$"),it=b((r,n)=>X(r,1,1/0,n),"Re"),C=b((r,n)=>{const o=r.map(M);return Q(Y(de(a=>{for(let i=0,c=o.length;i<c;i++)if(!o[i](a))return!1;return!0}),n))},"x"),k=b((r,n)=>{const o=r.map(M);return Q(Y(a=>{for(let i=0,c=o.length;i<c;i++)if(o[i](a))return!0;return!1},n))},"p"),de=b((r,n=!0,o=!1)=>{const a=M(r);return n?i=>{const c=i.index,f=i.output.length,g=a(i);return!g&&!o&&(i.indexBacktrackMax=Math.max(i.indexBacktrackMax,i.index)),(!g||o)&&(i.index=c,i.output.length!==f&&(i.output.length=f)),g}:a},"q"),Y=b((r,n)=>{const o=M(r);return n?a=>{if(a.options.silent)return o(a);const i=a.output.length;if(o(a)){const c=a.output.splice(i,1/0),f=n(c);return z(f)||a.output.push(f),!0}else return!1}:o},"B"),Q=(()=>{let r=0;return n=>{const o=M(n),a=r+=1;return i=>{var c;if(i.options.memoization===!1)return o(i);const f=i.index,g=(c=i.cache)[a]||(c[a]={indexMax:-1,queue:[]}),w=g.queue;if(f<=g.indexMax){const U=g.store||(g.store=new Map);if(w.length){for(let F=0,ur=w.length;F<ur;F+=2){const fr=w[F*2],pr=w[F*2+1];U.set(fr,pr)}w.length=0}const S=U.get(f);if(S===!1)return!1;if(Ke(S))return i.index=S,!0;if(S)return i.index=S.index,S.output?.length&&i.output.push(...S.output),!0}const D=i.output.length,cr=o(i);if(g.indexMax=Math.max(g.indexMax,f),cr){const U=i.index,S=i.output.length;if(S>D){const F=i.output.slice(D,S);w.push(f,{index:U,output:F})}else w.push(f,U);return!0}else return w.push(f,!1),!1}}})(),ge=b(r=>{let n;return o=>(n||(n=M(r())),n(o))},"G"),M=tt(r=>{if(B(r))return Te(r)?ge(r):r;if(ce(r)||Ye(r))return p(r);if(K(r))return C(r);if(Xe(r))return k(Object.values(r));throw new Error("Invalid rule")}),R=b(r=>r,"d"),at=b(r=>typeof r=="string","ke"),lt=b(r=>{const n=new WeakMap,o=new WeakMap;return(a,i)=>{const c=i?.partial?o:n,f=c.get(a);if(f!==void 0)return f;const g=r(a,i);return c.set(a,g),g}},"Be"),ct=b(r=>{const n={},o={};return(a,i)=>{const c=i?.partial?o:n;return c[a]??(c[a]=r(a,i))}},"Pe"),ut=p(/\\./,R),ft=p(/./,R),pt=p(/\*\*\*+/,"*"),dt=p(/([^/{[(!])\*\*/,(r,n)=>`${n}*`),gt=p(/(^|.)\*\*(?=[^*/)\]}])/,(r,n)=>`${n}*`),mt=Z(k([ut,pt,dt,gt,ft])),ht=mt,bt=b(r=>ue(r,ht,{memoization:!1}).join(""),"Ie"),yt=bt,me="abcdefghijklmnopqrstuvwxyz",$t=b(r=>{let n="";for(;r>0;){const o=(r-1)%26;n=me[o]+n,r=Math.floor((r-1)/26)}return n},"Le"),he=b(r=>{let n=0;for(let o=0,a=r.length;o<a;o++)n=n*26+me.indexOf(r[o])+1;return n},"V"),ee=b((r,n)=>{if(n<r)return ee(n,r);const o=[];for(;r<=n;)o.push(r++);return o},"b"),vt=b((r,n,o)=>ee(r,n).map(a=>String(a).padStart(o,"0")),"qe"),be=b((r,n)=>ee(he(r),he(n)).map($t),"W"),y=b(r=>({partial:!1,regex:new RegExp(r,"s"),children:[]}),"c"),L=b(r=>({children:r}),"y"),I=(()=>{const r=b((n,o,a)=>{if(a.has(n))return;a.add(n);const{children:i}=n;if(!i.length)i.push(o);else for(let c=0,f=i.length;c<f;c++)r(i[c],o,a)},"e");return n=>{if(!n.length)return L([]);for(let o=n.length-1;o>=1;o--){const a=new Set,i=n[o-1],c=n[o];r(i,c,a)}return n[0]}})(),_=b(()=>({regex:new RegExp("[\\\\/]","s"),children:[]}),"g"),xt=p(/\\./,y),wt=p(/[$.*+?^(){}[\]\|]/,r=>y(`\\${r}`)),jt=p(/[\\\/]/,_),Ot=p(/[^$.*+?^(){}[\]\|\\\/]+/,y),Pt=p(/^(?:!!)*!(.*)$/,(r,n)=>y(`(?!^${Pe.compile(n).source}$).*?`)),Et=p(/^(!!)+/),kt=k([Pt,Et]),St=p(/\/(\*\*\/)+/,()=>L([I([_(),y(".+?"),_()]),_()])),At=p(/^(\*\*\/)+/,()=>L([y("^"),I([y(".*?"),_()])])),zt=p(/\/(\*\*)$/,()=>L([I([_(),y(".*?")]),y("$")])),Mt=p(/\*\*/,()=>y(".*?")),ye=k([St,At,zt,Mt]),_t=p(/\*\/(?!\*\*\/|\*$)/,()=>I([y("[^\\\\/]*?"),_()])),Tt=p(/\*/,()=>y("[^\\\\/]*")),$e=k([_t,Tt]),ve=p("?",()=>y("[^\\\\/]")),Rt=p("[",R),Nt=p("]",R),Bt=p(/[!^]/,"^\\\\/"),Ct=p(/[a-z]-[a-z]|[0-9]-[0-9]/i,R),It=p(/\\./,R),Ft=p(/[$.*+?^(){}[\|]/,r=>`\\${r}`),Wt=p(/[\\\/]/,"\\\\/"),Lt=p(/[^$.*+?^(){}[\]\|\\\/]+/,R),Dt=k([It,Ft,Wt,Ct,Lt]),xe=C([Rt,pe(Bt),Z(Dt),Nt],r=>y(r.join(""))),Ut=p("{","(?:"),qt=p("}",")"),Zt=p(/(\d+)\.\.(\d+)/,(r,n,o)=>vt(+n,+o,Math.min(n.length,o.length)).join("|")),Vt=p(/([a-z]+)\.\.([a-z]+)/,(r,n,o)=>be(n,o).join("|")),Jt=p(/([A-Z]+)\.\.([A-Z]+)/,(r,n,o)=>be(n.toLowerCase(),o.toLowerCase()).join("|").toUpperCase()),Gt=k([Zt,Vt,Jt]),we=C([Ut,Gt,qt],r=>y(r.join(""))),Ht=p("{"),Kt=p("}"),Xt=p(","),Yt=p(/\\./,y),Qt=p(/[$.*+?^(){[\]\|]/,r=>y(`\\${r}`)),er=p(/[\\\/]/,_),tr=p(/[^$.*+?^(){}[\]\|\\\/,]+/,y),rr=ge(()=>Oe),nr=p("",()=>y("(?:)")),or=it(k([ye,$e,ve,xe,we,rr,Yt,Qt,er,tr]),I),je=k([or,nr]),Oe=C([Ht,pe(C([je,Z(C([Xt,je]))])),Kt],L),sr=Z(k([kt,ye,$e,ve,xe,we,Oe,xt,wt,jt,Ot]),I),ir=sr,ar=b(r=>ue(r,ir,{memoization:!1})[0],"kr"),lr=ar,te=b((r,n,o)=>te.compile(r,o).test(n),"N");te.compile=(()=>{const r=ct((o,a)=>re(lr(yt(o)),a)),n=lt((o,a)=>_e(o.map(i=>r(i,a))));return(o,a)=>at(o)?r(o,a):n(o,a)})();var Pe=te;return m(j)})();return e.default||e},"_lazyMatch"),Jr;const gs=b((e,t)=>(Jr||(Jr=$n(),$n=null),Jr(e,t)),"zeptomatch"),ms=/^[A-Z]:\//i,ne=b((e="")=>e&&e.replaceAll("\\","/").replace(ms,t=>t.toUpperCase()),"normalizeWindowsPath"),hs=/^[/\\]{2}/,bs=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,Vn=/^[A-Z]:$/i,vn=/^\/([A-Z]:)?$/i,ys=/.(\.[^./]+)$/,$s=/^[/\\]|^[a-z]:[/\\]/i,vs=/\/$/,xs=b(()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd"),Jn=b((e,t)=>{let s="",l=0,u=-1,d=0,h;for(let m=0;m<=e.length;++m){if(m<e.length)h=e[m];else{if(h==="/")break;h="/"}if(h==="/"){if(!(u===m-1||d===1))if(d===2){if(s.length<2||l!==2||!s.endsWith(".")||s.at(-2)!=="."){if(s.length>2){const j=s.lastIndexOf("/");j===-1?(s="",l=0):(s=s.slice(0,j),l=s.length-1-s.lastIndexOf("/")),u=m,d=0;continue}else if(s.length>0){s="",l=0,u=m,d=0;continue}}t&&(s+=s.length>0?"/..":"..",l=2)}else s.length>0?s+=`/${e.slice(u+1,m)}`:s=e.slice(u+1,m),l=m-u-1;u=m,d=0}else h==="."&&d!==-1?++d:d=-1}return s},"normalizeString"),Be=b(e=>bs.test(e),"isAbsolute"),Gn=b(function(e){if(e.length===0)return".";e=ne(e);const t=hs.exec(e),s=Be(e),l=e.at(-1)==="/";return e=Jn(e,!s),e.length===0?s?"/":l?"./":".":(l&&(e+="/"),Vn.test(e)&&(e+="/"),t?s?`//${e}`:`//./${e}`:s&&!Be(e)?`/${e}`:e)},"normalize"),Hn=b((...e)=>{let t="";for(const s of e)if(s)if(t.length>0){const l=t.at(-1)==="/",u=s[0]==="/";l&&u?t+=s.slice(1):t+=l||u?s:`/${s}`}else t+=s;return Gn(t)},"join"),ie=b(function(...e){e=e.map(l=>ne(l));let t="",s=!1;for(let l=e.length-1;l>=-1&&!s;l--){const u=l>=0?e[l]:xs();!u||u.length===0||(t=`${u}/${t}`,s=Be(u))}return t=Jn(t,!s),s&&!Be(t)?`/${t}`:t.length>0?t:"."},"resolve");b(function(e){return ne(e)},"toNamespacedPath");const Kn=b(function(e){return ys.exec(ne(e))?.[1]??""},"extname");b(function(e,t){const s=ie(e).replace(vn,"$1").split("/"),l=ie(t).replace(vn,"$1").split("/");if(l[0][1]===":"&&s[0][1]===":"&&s[0]!==l[0])return l.join("/");const u=[...s];for(const d of u){if(l[0]!==d)break;s.shift(),l.shift()}return[...s.map(()=>".."),...l].join("/")},"relative");const en=b(e=>{const t=ne(e).replace(vs,"").split("/").slice(0,-1);return t.length===1&&Vn.test(t[0])&&(t[0]=`${t[0]}/`),t.join("/")||(Be(e)?"/":".")},"dirname");b(function(e){const t=[e.root,e.dir,e.base??e.name+e.ext].filter(Boolean);return ne(e.root?ie(...t):t.join("/"))},"format");const ws=b((e,t)=>{const s=ne(e).split("/").pop();return t&&s.endsWith(t)?s.slice(0,-t.length):s},"basename"),Xn=b(function(e){const t=$s.exec(e)?.[0]?.replaceAll("\\","/")??"",s=ws(e),l=Kn(s);return{base:s,dir:en(e),ext:l,name:s.slice(0,s.length-l.length),root:t}},"parse");b((e,t)=>gs(t,Gn(e)),"matchesGlob");var js=Object.defineProperty,H=W((e,t)=>js(e,"name",{value:t,configurable:!0}),"i$2");const Os=He(import.meta.url),mr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ps=H(e=>{if(typeof mr<"u"&&mr.versions&&mr.versions.node){const[t,s]=mr.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return mr.getBuiltinModule(e)}return Os(e)},"__cjs_getBuiltinModule"),{fileURLToPath:Es}=Ps("node:url");function Br(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}x(Br,"dn$1");Ge(Br,"Nr");W(Br,"w$1");H(Br,"getDefaultExportFromCjs");var xn,wn;function Cr(){return wn||(wn=1,xn=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cr3","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),xn}x(Cr,"gn$1");Ge(Cr,"Dr");W(Cr,"y$2");H(Cr,"requireBinaryExtensions");var ks=Cr();const Ss=Br(ks),As=new Set(Ss),zs=new Set(["/","\\",void 0]),jn=Symbol.for("pathe:normalizedAlias"),Ms=/(^|[/\\])([^/\\]+?)(?=(?:\.[^.]+)?$)/,_s=H((e,t)=>t.split("/").length-e.split("/").length,"compareAliases"),Tr=H((e="/")=>{const t=e.at(-1);return t==="/"||t==="\\"},"hasTrailingSlash"),Yn=H(e=>{if(e[jn])return e;const t=Object.fromEntries(Object.entries(e).toSorted(([s],[l])=>_s(s,l)));for(const s in t)for(const l in t)l===s||s.startsWith(l)||t[s].startsWith(l)&&zs.has(t[s][l.length])&&(t[s]=t[l]+t[s].slice(l.length));return Object.defineProperty(t,jn,{enumerable:!1,value:!0}),t},"normalizeAliases");H((e,t)=>{e=ne(e),t=Yn(t);for(const[s,l]of Object.entries(t)){if(!e.startsWith(s))continue;const u=Tr(s)?s.slice(0,-1):s;if(Tr(e[u.length]))return Hn(l,e.slice(s.length))}return e},"resolveAlias");H(e=>Ms.exec(e)?.[2],"filename");H((e,t)=>{e=ne(e),t=Yn(t);for(const[s,l]of Object.entries(t).toReversed()){if(!e.startsWith(l))continue;const u=Tr(l)?l.slice(0,-1):l;if(Tr(e[u.length]))return Hn(s,e.slice(l.length))}return e},"reverseResolveAlias");const Ts=/^(?:\.?\.[/\\]|\.\.\B)/,Rs=/^(?:msys|cygwin)$/;H(e=>Ts.test(e)||e==="..","isRelative");H(e=>As.has(Kn(e).slice(1).toLowerCase()),"isBinaryPath");const Ve=H(e=>ne(e instanceof URL?Es(e):e),"toPath");H(()=>{if(!globalThis.process)return!1;if(globalThis.process.platform==="win32"||globalThis.process.platform==="cygwin")return!0;const e=globalThis.process.env.OSTYPE;return typeof e!="string"?!1:Rs.test(e)},"isWindows");var Ns=Object.defineProperty,Bs=W((e,t)=>Ns(e,"name",{value:t,configurable:!0}),"p"),Cs=Object.defineProperty,Qn=Bs((e,t)=>Cs(e,"name",{value:t,configurable:!0}),"a");const Is=He(import.meta.url),hr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,eo=Qn(e=>{if(typeof hr<"u"&&hr.versions&&hr.versions.node){const[t,s]=hr.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return hr.getBuiltinModule(e)}return Is(e)},"__cjs_getBuiltinModule"),{stat:Fs,lstat:Ws}=eo("node:fs/promises"),{fileURLToPath:Ls}=eo("node:url");var Ds=Object.defineProperty,On=Qn((e,t)=>Ds(e,"name",{value:t,configurable:!0}),"n");const Us=On(async(e,t={})=>{if(typeof e!="string"&&!Array.isArray(e)&&typeof e!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const s=t.cwd?Ve(t.cwd):process.cwd();let l=ie(s);const{root:u}=Xn(l),d=Ve(t.stopAt??u),h=ie(l,d),m=t.type??"file",j=On(async function(P){return typeof e=="function"?[await e(P)]:typeof e=="string"?[e]:Array.isArray(e)?e:[e]},"getMatchers");t.allowSymlinks??=!0;const A=t.allowSymlinks?Fs:Ws;for(;l&&l!==h&&l!==u;){const P=await j(l);for(let O of P){if(O===qn)return;if(O===void 0)continue;Buffer.isBuffer(O)?O=O.toString():O instanceof URL&&(O=Ls(O));const N=Be(O)?O:ie(l,O);try{const T=await A(N);if(m==="file"&&T.isFile()||m==="directory"&&T.isDirectory())return N}catch{}}l=en(l)}},"findUp");var qs=Object.defineProperty,Zs=W((e,t)=>qs(e,"name",{value:t,configurable:!0}),"u$3"),Vs=Object.defineProperty,to=Zs((e,t)=>Vs(e,"name",{value:t,configurable:!0}),"i");const Js=He(import.meta.url),br=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ro=to(e=>{if(typeof br<"u"&&br.versions&&br.versions.node){const[t,s]=br.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return br.getBuiltinModule(e)}return Js(e)},"__cjs_getBuiltinModule"),{statSync:Gs,lstatSync:Hs}=ro("node:fs"),{fileURLToPath:Ks}=ro("node:url");var Xs=Object.defineProperty,Pn=to((e,t)=>Xs(e,"name",{value:t,configurable:!0}),"o");const Ys=Pn((e,t={})=>{if(typeof e!="string"&&!Array.isArray(e)&&typeof e!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const s=t.cwd?Ve(t.cwd):process.cwd();let l=ie(s);const{root:u}=Xn(l),d=Ve(t.stopAt??u),h=ie(l,d),m=t.type??"file",j=Pn(function(P){return typeof e=="function"?[e(P)]:typeof e=="string"?[e]:Array.isArray(e)?e:[e]},"getMatchers");t.allowSymlinks??=!0;const A=t.allowSymlinks?Gs:Hs;for(;l&&l!==h&&l!==u;){for(let P of j(l)){if(P===qn)return;if(P===void 0)continue;Buffer.isBuffer(P)?P=P.toString():P instanceof URL&&(P=Ks(P));const O=Be(P)?P:ie(l,P);try{const N=A(O);if(m==="file"&&N.isFile()||m==="directory"&&N.isDirectory())return O}catch{}}l=en(l)}},"findUpSync");var Qs=Object.defineProperty,no=W((e,t)=>Qs(e,"name",{value:t,configurable:!0}),"t$2"),ei=Object.defineProperty,tn=no((e,t)=>ei(e,"name",{value:t,configurable:!0}),"s");const ti=He(import.meta.url),yr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ri=tn(e=>{if(typeof yr<"u"&&yr.versions&&yr.versions.node){const[t,s]=yr.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return yr.getBuiltinModule(e)}return ti(e)},"__cjs_getBuiltinModule"),{access:ni}=ri("node:fs/promises");var oi=Object.defineProperty,si=tn((e,t)=>oi(e,"name",{value:t,configurable:!0}),"o");async function ke(e,t=Un){Qr(e),e=Ve(e);try{return await ni(e,t),!0}catch{return!1}}x(ke,"Q$2");Ge(ke,"se");W(ke,"i$1");no(ke,"d");tn(ke,"m");si(ke,"isAccessible");var ii=Object.defineProperty,oo=W((e,t)=>ii(e,"name",{value:t,configurable:!0}),"t$1"),ai=Object.defineProperty,rn=oo((e,t)=>ai(e,"name",{value:t,configurable:!0}),"t");const li=He(import.meta.url),$r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ci=rn(e=>{if(typeof $r<"u"&&$r.versions&&$r.versions.node){const[t,s]=$r.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return $r.getBuiltinModule(e)}return li(e)},"__cjs_getBuiltinModule"),{accessSync:ui}=ci("node:fs");var fi=Object.defineProperty,pi=rn((e,t)=>fi(e,"name",{value:t,configurable:!0}),"o");function Se(e,t=Un){Qr(e),e=Ve(e);try{return ui(e,t),!0}catch{return!1}}x(Se,"ee$1");Ge(Se,"ie");W(Se,"i");oo(Se,"d");rn(Se,"m");pi(Se,"isAccessibleSync");var di=Object.defineProperty,so=W((e,t)=>di(e,"name",{value:t,configurable:!0}),"o"),gi=Object.defineProperty,io=so((e,t)=>gi(e,"name",{value:t,configurable:!0}),"o"),mi=Object.defineProperty,hi=io((e,t)=>mi(e,"name",{value:t,configurable:!0}),"o");let ao=class extends Error{static{x(this,"Jn")}static{Ge(this,"Xr")}static{W(this,"s")}static{so(this,"u")}static{io(this,"n")}static{hi(this,"NotFoundError")}constructor(e){super(`ENOENT: ${e}`)}get code(){return"ENOENT"}set code(e){throw new Error("Cannot overwrite code ENOENT")}get name(){return"NotFoundError"}set name(e){throw new Error("Cannot overwrite name of NotFoundError")}};var bi=Object.defineProperty,yi=W((e,t)=>bi(e,"name",{value:t,configurable:!0}),"$e"),$i=Object.defineProperty,nn=yi((e,t)=>$i(e,"name",{value:t,configurable:!0}),"W"),vi=Object.defineProperty,$=nn((e,t)=>vi(e,"name",{value:t,configurable:!0}),"u$1");let En=$(()=>{var e=(()=>{var t=Object.defineProperty,s=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyNames,u=Object.prototype.hasOwnProperty,d=$((r,n)=>{for(var o in n)t(r,o,{get:n[o],enumerable:!0})},"ne"),h=$((r,n,o,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of l(n))!u.call(r,i)&&i!==o&&t(r,i,{get:$(()=>n[i],"get"),enumerable:!(a=s(n,i))||a.enumerable});return r},"ae"),m=$(r=>h(t({},"__esModule",{value:!0}),r),"oe"),j={};d(j,{zeptomatch:$(()=>Pe,"zeptomatch")});var A=$(r=>{const n=new Set,o=[r];for(let a=0;a<o.length;a++){const i=o[a];if(n.has(i))continue;n.add(i);const{children:c}=i;if(c?.length)for(let f=0,g=c.length;f<g;f++)o.push(c[f])}return Array.from(n)},"M"),P=$(r=>{let n="";const o=A(r);for(let a=0,i=o.length;a<i;a++){const c=o[a];if(!c.regex)continue;const f=c.regex.flags;if(n||(n=f),n!==f)throw new Error(`Inconsistent RegExp flags used: "${n}" and "${f}"`)}return n},"se"),O=$((r,n,o)=>{const a=o.get(r);if(a!==void 0)return a;const i=r.partial??n;let c="";if(r.regex&&(c+=i?"(?:$|":"",c+=r.regex.source),r.children?.length){const f=T(r.children.map(g=>O(g,n,o)).filter(Boolean));if(f?.length){const g=r.children.some(D=>!D.regex||!(D.partial??n)),w=f.length>1||i&&(!c.length||g);c+=w?i?"(?:$|":"(?:":"",c+=f.join("|"),c+=w?")":""}}return r.regex&&(c+=i?")":""),o.set(r,c),c},"O"),N=$((r,n)=>{const o=new Map,a=A(r);for(let i=a.length-1;i>=0;i--){const c=O(a[i],n,o);if(!(i>0))return c}return""},"ie"),T=$(r=>Array.from(new Set(r)),"ue"),E=$((r,n,o)=>E.compile(r,o).test(n),"R");E.compile=(r,n)=>{const o=n?.partial??!1,a=N(r,o),i=P(r);return new RegExp(`^(?:${a})$`,i)};var q=E,G=$((r,n)=>{const o=q.compile(r,n),a=`${o.source.slice(0,-1)}[\\\\/]?$`,i=o.flags;return new RegExp(a,i)},"le"),re=G,Me=$(r=>{const n=r.map(a=>a.source).join("|")||"$^",o=r[0]?.flags;return new RegExp(n,o)},"ve"),_e=Me,K=$(r=>Array.isArray(r),"j"),B=$(r=>typeof r=="function","_"),Te=$(r=>r.length===0,"he"),Re=(()=>{const{toString:r}=Function.prototype,n=/(?:^\(\s*(?:[^,.()]|\.(?!\.\.))*\s*\)\s*=>|^\s*[a-zA-Z$_][a-zA-Z0-9$_]*\s*=>)/;return o=>(o.length===0||o.length===1)&&n.test(r.call(o))})(),Ke=$(r=>typeof r=="number","de"),Xe=$(r=>typeof r=="object"&&r!==null,"xe"),Ye=$(r=>r instanceof RegExp,"me"),Qe=(()=>{const r=/\\\(|\((?!\?(?::|=|!|<=|<!))/;return n=>r.test(n.source)})(),et=(()=>{const r=/^[a-zA-Z0-9_-]+$/;return n=>r.test(n.source)&&!n.flags.includes("i")})(),ce=$(r=>typeof r=="string","A"),z=$(r=>r===void 0,"f"),tt=$(r=>{const n=new Map;return o=>{const a=n.get(o);if(a!==void 0)return a;const i=r(o);return n.set(o,i),i}},"ye"),ue=$((r,n,o={})=>{const a={cache:{},input:r,index:0,indexBacktrackMax:0,options:o,output:[]},i=M(n)(a),c=Math.max(a.index,a.indexBacktrackMax);if(i&&a.index===r.length)return a.output;throw new Error(`Failed to parse at index ${c}`)},"I"),p=$((r,n)=>K(r)?rt(r,n):ce(r)?fe(r,n):nt(r,n),"i"),rt=$((r,n)=>{const o={};for(const a of r){if(a.length!==1)throw new Error(`Invalid character: "${a}"`);const i=a.charCodeAt(0);o[i]=!0}return a=>{const i=a.input;let c=a.index,f=c;for(;f<i.length&&i.charCodeAt(f)in o;)f+=1;if(f>c){if(!z(n)&&!a.options.silent){const g=i.slice(c,f),w=B(n)?n(g,i,`${c}`):n;z(w)||a.output.push(w)}a.index=f}return!0}},"we"),nt=$((r,n)=>{if(et(r))return fe(r.source,n);{const o=r.source,a=r.flags.replace(/y|$/,"y"),i=new RegExp(o,a);return Qe(r)&&B(n)&&!Re(n)?ot(i,n):st(i,n)}},"$e"),ot=$((r,n)=>o=>{const a=o.index,i=o.input;r.lastIndex=a;const c=r.exec(i);if(c){const f=r.lastIndex;if(!o.options.silent){const g=n(...c,i,`${a}`);z(g)||o.output.push(g)}return o.index=f,!0}else return!1},"Ee"),st=$((r,n)=>o=>{const a=o.index,i=o.input;if(r.lastIndex=a,r.test(i)){const c=r.lastIndex;if(!z(n)&&!o.options.silent){const f=B(n)?n(i.slice(a,c),i,`${a}`):n;z(f)||o.output.push(f)}return o.index=c,!0}else return!1},"Ce"),fe=$((r,n)=>o=>{const a=o.index,i=o.input;if(i.startsWith(r,a)){if(!z(n)&&!o.options.silent){const c=B(n)?n(r,i,`${a}`):n;z(c)||o.output.push(c)}return o.index+=r.length,!0}else return!1},"F"),X=$((r,n,o,a)=>{const i=M(r),c=n>1;return Q(Y(de(f=>{let g=0;for(;g<o;){const w=f.index;if(!i(f)||(g+=1,f.index===w))break}return g>=n},c),a))},"k"),pe=$((r,n)=>X(r,0,1,n),"L"),Z=$((r,n)=>X(r,0,1/0,n),"$"),it=$((r,n)=>X(r,1,1/0,n),"Re"),C=$((r,n)=>{const o=r.map(M);return Q(Y(de(a=>{for(let i=0,c=o.length;i<c;i++)if(!o[i](a))return!1;return!0}),n))},"x"),k=$((r,n)=>{const o=r.map(M);return Q(Y(a=>{for(let i=0,c=o.length;i<c;i++)if(o[i](a))return!0;return!1},n))},"p"),de=$((r,n=!0,o=!1)=>{const a=M(r);return n?i=>{const c=i.index,f=i.output.length,g=a(i);return!g&&!o&&(i.indexBacktrackMax=Math.max(i.indexBacktrackMax,i.index)),(!g||o)&&(i.index=c,i.output.length!==f&&(i.output.length=f)),g}:a},"q"),Y=$((r,n)=>{const o=M(r);return n?a=>{if(a.options.silent)return o(a);const i=a.output.length;if(o(a)){const c=a.output.splice(i,1/0),f=n(c);return z(f)||a.output.push(f),!0}else return!1}:o},"B"),Q=(()=>{let r=0;return n=>{const o=M(n),a=r+=1;return i=>{var c;if(i.options.memoization===!1)return o(i);const f=i.index,g=(c=i.cache)[a]||(c[a]={indexMax:-1,queue:[]}),w=g.queue;if(f<=g.indexMax){const U=g.store||(g.store=new Map);if(w.length){for(let F=0,ur=w.length;F<ur;F+=2){const fr=w[F*2],pr=w[F*2+1];U.set(fr,pr)}w.length=0}const S=U.get(f);if(S===!1)return!1;if(Ke(S))return i.index=S,!0;if(S)return i.index=S.index,S.output?.length&&i.output.push(...S.output),!0}const D=i.output.length,cr=o(i);if(g.indexMax=Math.max(g.indexMax,f),cr){const U=i.index,S=i.output.length;if(S>D){const F=i.output.slice(D,S);w.push(f,{index:U,output:F})}else w.push(f,U);return!0}else return w.push(f,!1),!1}}})(),ge=$(r=>{let n;return o=>(n||(n=M(r())),n(o))},"G"),M=tt(r=>{if(B(r))return Te(r)?ge(r):r;if(ce(r)||Ye(r))return p(r);if(K(r))return C(r);if(Xe(r))return k(Object.values(r));throw new Error("Invalid rule")}),R=$(r=>r,"d"),at=$(r=>typeof r=="string","ke"),lt=$(r=>{const n=new WeakMap,o=new WeakMap;return(a,i)=>{const c=i?.partial?o:n,f=c.get(a);if(f!==void 0)return f;const g=r(a,i);return c.set(a,g),g}},"Be"),ct=$(r=>{const n={},o={};return(a,i)=>{const c=i?.partial?o:n;return c[a]??(c[a]=r(a,i))}},"Pe"),ut=p(/\\./,R),ft=p(/./,R),pt=p(/\*\*\*+/,"*"),dt=p(/([^/{[(!])\*\*/,(r,n)=>`${n}*`),gt=p(/(^|.)\*\*(?=[^*/)\]}])/,(r,n)=>`${n}*`),mt=Z(k([ut,pt,dt,gt,ft])),ht=mt,bt=$(r=>ue(r,ht,{memoization:!1}).join(""),"Ie"),yt=bt,me="abcdefghijklmnopqrstuvwxyz",$t=$(r=>{let n="";for(;r>0;){const o=(r-1)%26;n=me[o]+n,r=Math.floor((r-1)/26)}return n},"Le"),he=$(r=>{let n=0;for(let o=0,a=r.length;o<a;o++)n=n*26+me.indexOf(r[o])+1;return n},"V"),ee=$((r,n)=>{if(n<r)return ee(n,r);const o=[];for(;r<=n;)o.push(r++);return o},"b"),vt=$((r,n,o)=>ee(r,n).map(a=>String(a).padStart(o,"0")),"qe"),be=$((r,n)=>ee(he(r),he(n)).map($t),"W"),y=$(r=>({partial:!1,regex:new RegExp(r,"s"),children:[]}),"c"),L=$(r=>({children:r}),"y"),I=(()=>{const r=$((n,o,a)=>{if(a.has(n))return;a.add(n);const{children:i}=n;if(!i.length)i.push(o);else for(let c=0,f=i.length;c<f;c++)r(i[c],o,a)},"e");return n=>{if(!n.length)return L([]);for(let o=n.length-1;o>=1;o--){const a=new Set,i=n[o-1],c=n[o];r(i,c,a)}return n[0]}})(),_=$(()=>({regex:new RegExp("[\\\\/]","s"),children:[]}),"g"),xt=p(/\\./,y),wt=p(/[$.*+?^(){}[\]\|]/,r=>y(`\\${r}`)),jt=p(/[\\\/]/,_),Ot=p(/[^$.*+?^(){}[\]\|\\\/]+/,y),Pt=p(/^(?:!!)*!(.*)$/,(r,n)=>y(`(?!^${Pe.compile(n).source}$).*?`)),Et=p(/^(!!)+/),kt=k([Pt,Et]),St=p(/\/(\*\*\/)+/,()=>L([I([_(),y(".+?"),_()]),_()])),At=p(/^(\*\*\/)+/,()=>L([y("^"),I([y(".*?"),_()])])),zt=p(/\/(\*\*)$/,()=>L([I([_(),y(".*?")]),y("$")])),Mt=p(/\*\*/,()=>y(".*?")),ye=k([St,At,zt,Mt]),_t=p(/\*\/(?!\*\*\/|\*$)/,()=>I([y("[^\\\\/]*?"),_()])),Tt=p(/\*/,()=>y("[^\\\\/]*")),$e=k([_t,Tt]),ve=p("?",()=>y("[^\\\\/]")),Rt=p("[",R),Nt=p("]",R),Bt=p(/[!^]/,"^\\\\/"),Ct=p(/[a-z]-[a-z]|[0-9]-[0-9]/i,R),It=p(/\\./,R),Ft=p(/[$.*+?^(){}[\|]/,r=>`\\${r}`),Wt=p(/[\\\/]/,"\\\\/"),Lt=p(/[^$.*+?^(){}[\]\|\\\/]+/,R),Dt=k([It,Ft,Wt,Ct,Lt]),xe=C([Rt,pe(Bt),Z(Dt),Nt],r=>y(r.join(""))),Ut=p("{","(?:"),qt=p("}",")"),Zt=p(/(\d+)\.\.(\d+)/,(r,n,o)=>vt(+n,+o,Math.min(n.length,o.length)).join("|")),Vt=p(/([a-z]+)\.\.([a-z]+)/,(r,n,o)=>be(n,o).join("|")),Jt=p(/([A-Z]+)\.\.([A-Z]+)/,(r,n,o)=>be(n.toLowerCase(),o.toLowerCase()).join("|").toUpperCase()),Gt=k([Zt,Vt,Jt]),we=C([Ut,Gt,qt],r=>y(r.join(""))),Ht=p("{"),Kt=p("}"),Xt=p(","),Yt=p(/\\./,y),Qt=p(/[$.*+?^(){[\]\|]/,r=>y(`\\${r}`)),er=p(/[\\\/]/,_),tr=p(/[^$.*+?^(){}[\]\|\\\/,]+/,y),rr=ge(()=>Oe),nr=p("",()=>y("(?:)")),or=it(k([ye,$e,ve,xe,we,rr,Yt,Qt,er,tr]),I),je=k([or,nr]),Oe=C([Ht,pe(C([je,Z(C([Xt,je]))])),Kt],L),sr=Z(k([kt,ye,$e,ve,xe,we,Oe,xt,wt,jt,Ot]),I),ir=sr,ar=$(r=>ue(r,ir,{memoization:!1})[0],"kr"),lr=ar,te=$((r,n,o)=>te.compile(r,o).test(n),"N");te.compile=(()=>{const r=ct((o,a)=>re(lr(yt(o)),a)),n=lt((o,a)=>_e(o.map(i=>r(i,a))));return(o,a)=>at(o)?r(o,a):n(o,a)})();var Pe=te;return m(j)})();return e.default||e},"_lazyMatch"),Gr;const xi=$((e,t)=>(Gr||(Gr=En(),En=null),Gr(e,t)),"default");var wi=Object.defineProperty,ji=nn((e,t)=>wi(e,"name",{value:t,configurable:!0}),"t$1");const Oi=/^[A-Z]:\//i,Ie=ji((e="")=>e&&e.replaceAll("\\","/").replace(Oi,t=>t.toUpperCase()),"normalizeWindowsPath");var Pi=Object.defineProperty,V=nn((e,t)=>Pi(e,"name",{value:t,configurable:!0}),"r");const Ei=/^[/\\]{2}/,ki=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,lo=/^[A-Z]:$/i,kn=/^\/([A-Z]:)?$/i,Si=/.(\.[^./]+)$/,Ai=/^[/\\]|^[a-z]:[/\\]/i,zi=/\/$/,Mi=V(()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd"),co=V((e,t)=>{let s="",l=0,u=-1,d=0,h;for(let m=0;m<=e.length;++m){if(m<e.length)h=e[m];else{if(h==="/")break;h="/"}if(h==="/"){if(!(u===m-1||d===1))if(d===2){if(s.length<2||l!==2||!s.endsWith(".")||s.at(-2)!=="."){if(s.length>2){const j=s.lastIndexOf("/");j===-1?(s="",l=0):(s=s.slice(0,j),l=s.length-1-s.lastIndexOf("/")),u=m,d=0;continue}else if(s.length>0){s="",l=0,u=m,d=0;continue}}t&&(s+=s.length>0?"/..":"..",l=2)}else s.length>0?s+=`/${e.slice(u+1,m)}`:s=e.slice(u+1,m),l=m-u-1;u=m,d=0}else h==="."&&d!==-1?++d:d=-1}return s},"normalizeString"),Er=V(e=>ki.test(e),"isAbsolute"),uo=V(function(e){if(e.length===0)return".";e=Ie(e);const t=Ei.exec(e),s=Er(e),l=e.at(-1)==="/";return e=co(e,!s),e.length===0?s?"/":l?"./":".":(l&&(e+="/"),lo.test(e)&&(e+="/"),t?s?`//${e}`:`//./${e}`:s&&!Er(e)?`/${e}`:e)},"normalize"),Ee=V((...e)=>{let t="";for(const s of e)if(s)if(t.length>0){const l=t.at(-1)==="/",u=s[0]==="/";l&&u?t+=s.slice(1):t+=l||u?s:`/${s}`}else t+=s;return uo(t)},"join"),Kr=V(function(...e){e=e.map(l=>Ie(l));let t="",s=!1;for(let l=e.length-1;l>=-1&&!s;l--){const u=l>=0?e[l]:Mi();!u||u.length===0||(t=`${u}/${t}`,s=Er(u))}return t=co(t,!s),s&&!Er(t)?`/${t}`:t.length>0?t:"."},"resolve");V(function(e){return Ie(e)},"toNamespacedPath");const _i=V(function(e){return Si.exec(Ie(e))?.[1]??""},"extname");V(function(e,t){const s=Kr(e).replace(kn,"$1").split("/"),l=Kr(t).replace(kn,"$1").split("/");if(l[0][1]===":"&&s[0][1]===":"&&s[0]!==l[0])return l.join("/");const u=[...s];for(const d of u){if(l[0]!==d)break;s.shift(),l.shift()}return[...s.map(()=>".."),...l].join("/")},"relative");const on=V(e=>{const t=Ie(e).replace(zi,"").split("/").slice(0,-1);return t.length===1&&lo.test(t[0])&&(t[0]=`${t[0]}/`),t.join("/")||(Er(e)?"/":".")},"dirname");V(function(e){const t=[e.root,e.dir,e.base??e.name+e.ext].filter(Boolean);return Ie(e.root?Kr(...t):t.join("/"))},"format");const Ti=V((e,t)=>{const s=Ie(e).split("/").pop();return t&&s.endsWith(t)?s.slice(0,-t.length):s},"basename");V(function(e){const t=Ai.exec(e)?.[0]?.replaceAll("\\","/")??"",s=Ti(e),l=_i(s);return{base:s,dir:on(e),ext:l,name:s.slice(0,s.length-l.length),root:t}},"parse");V((e,t)=>xi(t,uo(e)),"matchesGlob");var Ri=Object.defineProperty,sn=W((e,t)=>Ri(e,"name",{value:t,configurable:!0}),"u");const Rr=sn((e,t)=>(t?.create&&ps(e),e),"useDirectory");sn(async(e,t)=>{if(qe.CACHE_DIR&&!["0","1","false","true"].includes(qe.CACHE_DIR))return Rr(Ee(qe.CACHE_DIR,e),t);const s=await Us("package.json",{cwd:t?.cwd??Dn(),type:"file"});if(!s){if(t?.throwError)throw new ao("No such file or directory found.");return}const l=Ee(on(s),"node_modules"),u=Ee(l,".cache"),d=Ee(u,e);if(!(Ue(d)&&!await ke(d,Ze))&&!(Ue(u)&&!await ke(u,Ze))&&!(Ue(l)&&!await ke(l,Ze)))return Rr(d,t)},"findCacheDirectory");const Ni=sn((e,t)=>{if(qe.CACHE_DIR&&!["0","1","false","true"].includes(qe.CACHE_DIR))return Rr(Ee(qe.CACHE_DIR,e),t);const s=Ys("package.json",{cwd:t?.cwd??Dn(),type:"file"});if(!s){if(t?.throwError)throw new ao("No such file or directory found.");return}const l=Ee(on(s),"node_modules"),u=Ee(l,".cache"),d=Ee(u,e);if(!(Ue(d)&&!Se(d,Ze))&&!(Ue(u)&&!Se(u,Ze))&&!(Ue(l)&&!Se(l,Ze)))return Rr(d,t)},"findCacheDirectorySync"),Zc=Ni,Xr=0,fo=4,Vc=Symbol("findUpStop"),Jc=/"(?:[^"\\]|\\.)*"|\/\/[^\r\n]*|\/\*[\s\S]*?\*\//g;var Bi=Object.defineProperty,Ci=x((e,t)=>Bi(e,"name",{value:t,configurable:!0}),"t$a"),Ii=Object.defineProperty,Fi=Ci((e,t)=>Ii(e,"name",{value:t,configurable:!0}),"t"),Wi=Object.defineProperty,Li=Fi((e,t)=>Wi(e,"name",{value:t,configurable:!0}),"n");const Ir=Li(e=>{if(!e||!(e instanceof URL)&&typeof e!="string")throw new TypeError("Path must be a non-empty string or URL.")},"assertValidFileOrDirectoryPath");var Di=Object.defineProperty,Ui=x((e,t)=>Di(e,"name",{value:t,configurable:!0}),"i$a"),qi=Object.defineProperty,Zi=Ui((e,t)=>qi(e,"name",{value:t,configurable:!0}),"r"),Vi=Object.defineProperty,Ji=Zi((e,t)=>Vi(e,"name",{value:t,configurable:!0}),"i");const Sn=Ji(e=>{if(e.isFile())return"file";if(e.isDirectory())return"dir";if(e.isSymbolicLink())return"symlink"},"getFileInfoType");var Gi=Object.defineProperty,Hi=x((e,t)=>Gi(e,"name",{value:t,configurable:!0}),"i$9"),Ki=Object.defineProperty,po=Hi((e,t)=>Ki(e,"name",{value:t,configurable:!0}),"s");const Xi=Ce(import.meta.url),vr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Yi=po(e=>{if(typeof vr<"u"&&vr.versions&&vr.versions.node){const[t,s]=vr.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return vr.getBuiltinModule(e)}return Xi(e)},"__cjs_getBuiltinModule"),{lstatSync:An,mkdirSync:Qi}=Yi("node:fs");var ea=Object.defineProperty,ta=po((e,t)=>ea(e,"name",{value:t,configurable:!0}),"o");const Gc=ta(e=>{Ir(e);try{const t=An(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(Sn(t))}'`);return}catch(t){if(t.code!=="ENOENT")throw t}try{Qi(e,{recursive:!0})}catch(t){if(t.code!=="EEXIST")throw t;const s=An(e);if(!s.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(Sn(s))}'`,{cause:t})}},"ensureDirSync");var ra=Object.defineProperty,na=x((e,t)=>ra(e,"name",{value:t,configurable:!0}),"$e"),oa=Object.defineProperty,an=na((e,t)=>oa(e,"name",{value:t,configurable:!0}),"W"),sa=Object.defineProperty,v=an((e,t)=>sa(e,"name",{value:t,configurable:!0}),"u$1");let zn=v(()=>{var e=(()=>{var t=Object.defineProperty,s=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyNames,u=Object.prototype.hasOwnProperty,d=v((r,n)=>{for(var o in n)t(r,o,{get:n[o],enumerable:!0})},"ne"),h=v((r,n,o,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of l(n))!u.call(r,i)&&i!==o&&t(r,i,{get:v(()=>n[i],"get"),enumerable:!(a=s(n,i))||a.enumerable});return r},"ae"),m=v(r=>h(t({},"__esModule",{value:!0}),r),"oe"),j={};d(j,{zeptomatch:v(()=>Pe,"zeptomatch")});var A=v(r=>{const n=new Set,o=[r];for(let a=0;a<o.length;a++){const i=o[a];if(n.has(i))continue;n.add(i);const{children:c}=i;if(c?.length)for(let f=0,g=c.length;f<g;f++)o.push(c[f])}return Array.from(n)},"M"),P=v(r=>{let n="";const o=A(r);for(let a=0,i=o.length;a<i;a++){const c=o[a];if(!c.regex)continue;const f=c.regex.flags;if(n||(n=f),n!==f)throw new Error(`Inconsistent RegExp flags used: "${n}" and "${f}"`)}return n},"se"),O=v((r,n,o)=>{const a=o.get(r);if(a!==void 0)return a;const i=r.partial??n;let c="";if(r.regex&&(c+=i?"(?:$|":"",c+=r.regex.source),r.children?.length){const f=T(r.children.map(g=>O(g,n,o)).filter(Boolean));if(f?.length){const g=r.children.some(D=>!D.regex||!(D.partial??n)),w=f.length>1||i&&(!c.length||g);c+=w?i?"(?:$|":"(?:":"",c+=f.join("|"),c+=w?")":""}}return r.regex&&(c+=i?")":""),o.set(r,c),c},"O"),N=v((r,n)=>{const o=new Map,a=A(r);for(let i=a.length-1;i>=0;i--){const c=O(a[i],n,o);if(!(i>0))return c}return""},"ie"),T=v(r=>Array.from(new Set(r)),"ue"),E=v((r,n,o)=>E.compile(r,o).test(n),"R");E.compile=(r,n)=>{const o=n?.partial??!1,a=N(r,o),i=P(r);return new RegExp(`^(?:${a})$`,i)};var q=E,G=v((r,n)=>{const o=q.compile(r,n),a=`${o.source.slice(0,-1)}[\\\\/]?$`,i=o.flags;return new RegExp(a,i)},"le"),re=G,Me=v(r=>{const n=r.map(a=>a.source).join("|")||"$^",o=r[0]?.flags;return new RegExp(n,o)},"ve"),_e=Me,K=v(r=>Array.isArray(r),"j"),B=v(r=>typeof r=="function","_"),Te=v(r=>r.length===0,"he"),Re=(()=>{const{toString:r}=Function.prototype,n=/(?:^\(\s*(?:[^,.()]|\.(?!\.\.))*\s*\)\s*=>|^\s*[a-zA-Z$_][a-zA-Z0-9$_]*\s*=>)/;return o=>(o.length===0||o.length===1)&&n.test(r.call(o))})(),Ke=v(r=>typeof r=="number","de"),Xe=v(r=>typeof r=="object"&&r!==null,"xe"),Ye=v(r=>r instanceof RegExp,"me"),Qe=(()=>{const r=/\\\(|\((?!\?(?::|=|!|<=|<!))/;return n=>r.test(n.source)})(),et=(()=>{const r=/^[a-zA-Z0-9_-]+$/;return n=>r.test(n.source)&&!n.flags.includes("i")})(),ce=v(r=>typeof r=="string","A"),z=v(r=>r===void 0,"f"),tt=v(r=>{const n=new Map;return o=>{const a=n.get(o);if(a!==void 0)return a;const i=r(o);return n.set(o,i),i}},"ye"),ue=v((r,n,o={})=>{const a={cache:{},input:r,index:0,indexBacktrackMax:0,options:o,output:[]},i=M(n)(a),c=Math.max(a.index,a.indexBacktrackMax);if(i&&a.index===r.length)return a.output;throw new Error(`Failed to parse at index ${c}`)},"I"),p=v((r,n)=>K(r)?rt(r,n):ce(r)?fe(r,n):nt(r,n),"i"),rt=v((r,n)=>{const o={};for(const a of r){if(a.length!==1)throw new Error(`Invalid character: "${a}"`);const i=a.charCodeAt(0);o[i]=!0}return a=>{const i=a.input;let c=a.index,f=c;for(;f<i.length&&i.charCodeAt(f)in o;)f+=1;if(f>c){if(!z(n)&&!a.options.silent){const g=i.slice(c,f),w=B(n)?n(g,i,`${c}`):n;z(w)||a.output.push(w)}a.index=f}return!0}},"we"),nt=v((r,n)=>{if(et(r))return fe(r.source,n);{const o=r.source,a=r.flags.replace(/y|$/,"y"),i=new RegExp(o,a);return Qe(r)&&B(n)&&!Re(n)?ot(i,n):st(i,n)}},"$e"),ot=v((r,n)=>o=>{const a=o.index,i=o.input;r.lastIndex=a;const c=r.exec(i);if(c){const f=r.lastIndex;if(!o.options.silent){const g=n(...c,i,`${a}`);z(g)||o.output.push(g)}return o.index=f,!0}else return!1},"Ee"),st=v((r,n)=>o=>{const a=o.index,i=o.input;if(r.lastIndex=a,r.test(i)){const c=r.lastIndex;if(!z(n)&&!o.options.silent){const f=B(n)?n(i.slice(a,c),i,`${a}`):n;z(f)||o.output.push(f)}return o.index=c,!0}else return!1},"Ce"),fe=v((r,n)=>o=>{const a=o.index,i=o.input;if(i.startsWith(r,a)){if(!z(n)&&!o.options.silent){const c=B(n)?n(r,i,`${a}`):n;z(c)||o.output.push(c)}return o.index+=r.length,!0}else return!1},"F"),X=v((r,n,o,a)=>{const i=M(r),c=n>1;return Q(Y(de(f=>{let g=0;for(;g<o;){const w=f.index;if(!i(f)||(g+=1,f.index===w))break}return g>=n},c),a))},"k"),pe=v((r,n)=>X(r,0,1,n),"L"),Z=v((r,n)=>X(r,0,1/0,n),"$"),it=v((r,n)=>X(r,1,1/0,n),"Re"),C=v((r,n)=>{const o=r.map(M);return Q(Y(de(a=>{for(let i=0,c=o.length;i<c;i++)if(!o[i](a))return!1;return!0}),n))},"x"),k=v((r,n)=>{const o=r.map(M);return Q(Y(a=>{for(let i=0,c=o.length;i<c;i++)if(o[i](a))return!0;return!1},n))},"p"),de=v((r,n=!0,o=!1)=>{const a=M(r);return n?i=>{const c=i.index,f=i.output.length,g=a(i);return!g&&!o&&(i.indexBacktrackMax=Math.max(i.indexBacktrackMax,i.index)),(!g||o)&&(i.index=c,i.output.length!==f&&(i.output.length=f)),g}:a},"q"),Y=v((r,n)=>{const o=M(r);return n?a=>{if(a.options.silent)return o(a);const i=a.output.length;if(o(a)){const c=a.output.splice(i,1/0),f=n(c);return z(f)||a.output.push(f),!0}else return!1}:o},"B"),Q=(()=>{let r=0;return n=>{const o=M(n),a=r+=1;return i=>{var c;if(i.options.memoization===!1)return o(i);const f=i.index,g=(c=i.cache)[a]||(c[a]={indexMax:-1,queue:[]}),w=g.queue;if(f<=g.indexMax){const U=g.store||(g.store=new Map);if(w.length){for(let F=0,ur=w.length;F<ur;F+=2){const fr=w[F*2],pr=w[F*2+1];U.set(fr,pr)}w.length=0}const S=U.get(f);if(S===!1)return!1;if(Ke(S))return i.index=S,!0;if(S)return i.index=S.index,S.output?.length&&i.output.push(...S.output),!0}const D=i.output.length,cr=o(i);if(g.indexMax=Math.max(g.indexMax,f),cr){const U=i.index,S=i.output.length;if(S>D){const F=i.output.slice(D,S);w.push(f,{index:U,output:F})}else w.push(f,U);return!0}else return w.push(f,!1),!1}}})(),ge=v(r=>{let n;return o=>(n||(n=M(r())),n(o))},"G"),M=tt(r=>{if(B(r))return Te(r)?ge(r):r;if(ce(r)||Ye(r))return p(r);if(K(r))return C(r);if(Xe(r))return k(Object.values(r));throw new Error("Invalid rule")}),R=v(r=>r,"d"),at=v(r=>typeof r=="string","ke"),lt=v(r=>{const n=new WeakMap,o=new WeakMap;return(a,i)=>{const c=i?.partial?o:n,f=c.get(a);if(f!==void 0)return f;const g=r(a,i);return c.set(a,g),g}},"Be"),ct=v(r=>{const n={},o={};return(a,i)=>{const c=i?.partial?o:n;return c[a]??(c[a]=r(a,i))}},"Pe"),ut=p(/\\./,R),ft=p(/./,R),pt=p(/\*\*\*+/,"*"),dt=p(/([^/{[(!])\*\*/,(r,n)=>`${n}*`),gt=p(/(^|.)\*\*(?=[^*/)\]}])/,(r,n)=>`${n}*`),mt=Z(k([ut,pt,dt,gt,ft])),ht=mt,bt=v(r=>ue(r,ht,{memoization:!1}).join(""),"Ie"),yt=bt,me="abcdefghijklmnopqrstuvwxyz",$t=v(r=>{let n="";for(;r>0;){const o=(r-1)%26;n=me[o]+n,r=Math.floor((r-1)/26)}return n},"Le"),he=v(r=>{let n=0;for(let o=0,a=r.length;o<a;o++)n=n*26+me.indexOf(r[o])+1;return n},"V"),ee=v((r,n)=>{if(n<r)return ee(n,r);const o=[];for(;r<=n;)o.push(r++);return o},"b"),vt=v((r,n,o)=>ee(r,n).map(a=>String(a).padStart(o,"0")),"qe"),be=v((r,n)=>ee(he(r),he(n)).map($t),"W"),y=v(r=>({partial:!1,regex:new RegExp(r,"s"),children:[]}),"c"),L=v(r=>({children:r}),"y"),I=(()=>{const r=v((n,o,a)=>{if(a.has(n))return;a.add(n);const{children:i}=n;if(!i.length)i.push(o);else for(let c=0,f=i.length;c<f;c++)r(i[c],o,a)},"e");return n=>{if(!n.length)return L([]);for(let o=n.length-1;o>=1;o--){const a=new Set,i=n[o-1],c=n[o];r(i,c,a)}return n[0]}})(),_=v(()=>({regex:new RegExp("[\\\\/]","s"),children:[]}),"g"),xt=p(/\\./,y),wt=p(/[$.*+?^(){}[\]\|]/,r=>y(`\\${r}`)),jt=p(/[\\\/]/,_),Ot=p(/[^$.*+?^(){}[\]\|\\\/]+/,y),Pt=p(/^(?:!!)*!(.*)$/,(r,n)=>y(`(?!^${Pe.compile(n).source}$).*?`)),Et=p(/^(!!)+/),kt=k([Pt,Et]),St=p(/\/(\*\*\/)+/,()=>L([I([_(),y(".+?"),_()]),_()])),At=p(/^(\*\*\/)+/,()=>L([y("^"),I([y(".*?"),_()])])),zt=p(/\/(\*\*)$/,()=>L([I([_(),y(".*?")]),y("$")])),Mt=p(/\*\*/,()=>y(".*?")),ye=k([St,At,zt,Mt]),_t=p(/\*\/(?!\*\*\/|\*$)/,()=>I([y("[^\\\\/]*?"),_()])),Tt=p(/\*/,()=>y("[^\\\\/]*")),$e=k([_t,Tt]),ve=p("?",()=>y("[^\\\\/]")),Rt=p("[",R),Nt=p("]",R),Bt=p(/[!^]/,"^\\\\/"),Ct=p(/[a-z]-[a-z]|[0-9]-[0-9]/i,R),It=p(/\\./,R),Ft=p(/[$.*+?^(){}[\|]/,r=>`\\${r}`),Wt=p(/[\\\/]/,"\\\\/"),Lt=p(/[^$.*+?^(){}[\]\|\\\/]+/,R),Dt=k([It,Ft,Wt,Ct,Lt]),xe=C([Rt,pe(Bt),Z(Dt),Nt],r=>y(r.join(""))),Ut=p("{","(?:"),qt=p("}",")"),Zt=p(/(\d+)\.\.(\d+)/,(r,n,o)=>vt(+n,+o,Math.min(n.length,o.length)).join("|")),Vt=p(/([a-z]+)\.\.([a-z]+)/,(r,n,o)=>be(n,o).join("|")),Jt=p(/([A-Z]+)\.\.([A-Z]+)/,(r,n,o)=>be(n.toLowerCase(),o.toLowerCase()).join("|").toUpperCase()),Gt=k([Zt,Vt,Jt]),we=C([Ut,Gt,qt],r=>y(r.join(""))),Ht=p("{"),Kt=p("}"),Xt=p(","),Yt=p(/\\./,y),Qt=p(/[$.*+?^(){[\]\|]/,r=>y(`\\${r}`)),er=p(/[\\\/]/,_),tr=p(/[^$.*+?^(){}[\]\|\\\/,]+/,y),rr=ge(()=>Oe),nr=p("",()=>y("(?:)")),or=it(k([ye,$e,ve,xe,we,rr,Yt,Qt,er,tr]),I),je=k([or,nr]),Oe=C([Ht,pe(C([je,Z(C([Xt,je]))])),Kt],L),sr=Z(k([kt,ye,$e,ve,xe,we,Oe,xt,wt,jt,Ot]),I),ir=sr,ar=v(r=>ue(r,ir,{memoization:!1})[0],"kr"),lr=ar,te=v((r,n,o)=>te.compile(r,o).test(n),"N");te.compile=(()=>{const r=ct((o,a)=>re(lr(yt(o)),a)),n=lt((o,a)=>_e(o.map(i=>r(i,a))));return(o,a)=>at(o)?r(o,a):n(o,a)})();var Pe=te;return m(j)})();return e.default||e},"_lazyMatch"),Hr;const ia=v((e,t)=>(Hr||(Hr=zn(),zn=null),Hr(e,t)),"default");var aa=Object.defineProperty,la=an((e,t)=>aa(e,"name",{value:t,configurable:!0}),"t$1");const ca=/^[A-Z]:\//i,oe=la((e="")=>e&&e.replaceAll("\\","/").replace(ca,t=>t.toUpperCase()),"normalizeWindowsPath");var ua=Object.defineProperty,J=an((e,t)=>ua(e,"name",{value:t,configurable:!0}),"r");const fa=/^[/\\]{2}/,pa=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,go=/^[A-Z]:$/i,Mn=/^\/([A-Z]:)?$/i,da=/.(\.[^./]+)$/,ga=/^[/\\]|^[a-z]:[/\\]/i,ma=/\/$/,ha=/^win/i,ba=J(()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd"),Hc="/",Kc=ha.test(globalThis.process?.platform??"")?";":":",mo=J((e,t)=>{let s="",l=0,u=-1,d=0,h;for(let m=0;m<=e.length;++m){if(m<e.length)h=e[m];else{if(h==="/")break;h="/"}if(h==="/"){if(!(u===m-1||d===1))if(d===2){if(s.length<2||l!==2||!s.endsWith(".")||s.at(-2)!=="."){if(s.length>2){const j=s.lastIndexOf("/");j===-1?(s="",l=0):(s=s.slice(0,j),l=s.length-1-s.lastIndexOf("/")),u=m,d=0;continue}else if(s.length>0){s="",l=0,u=m,d=0;continue}}t&&(s+=s.length>0?"/..":"..",l=2)}else s.length>0?s+=`/${e.slice(u+1,m)}`:s=e.slice(u+1,m),l=m-u-1;u=m,d=0}else h==="."&&d!==-1?++d:d=-1}return s},"normalizeString"),kr=J(e=>pa.test(e),"isAbsolute"),ho=J(function(e){if(e.length===0)return".";e=oe(e);const t=fa.exec(e),s=kr(e),l=e.at(-1)==="/";return e=mo(e,!s),e.length===0?s?"/":l?"./":".":(l&&(e+="/"),go.test(e)&&(e+="/"),t?s?`//${e}`:`//./${e}`:s&&!kr(e)?`/${e}`:e)},"normalize"),bo=J((...e)=>{let t="";for(const s of e)if(s)if(t.length>0){const l=t.at(-1)==="/",u=s[0]==="/";l&&u?t+=s.slice(1):t+=l||u?s:`/${s}`}else t+=s;return ho(t)},"join"),Yr=J(function(...e){e=e.map(l=>oe(l));let t="",s=!1;for(let l=e.length-1;l>=-1&&!s;l--){const u=l>=0?e[l]:ba();!u||u.length===0||(t=`${u}/${t}`,s=kr(u))}return t=mo(t,!s),s&&!kr(t)?`/${t}`:t.length>0?t:"."},"resolve");J(function(e){return oe(e)},"toNamespacedPath");const yo=J(function(e){return da.exec(oe(e))?.[1]??""},"extname"),Xc=J(function(e,t){const s=Yr(e).replace(Mn,"$1").split("/"),l=Yr(t).replace(Mn,"$1").split("/");if(l[0][1]===":"&&s[0][1]===":"&&s[0]!==l[0])return l.join("/");const u=[...s];for(const d of u){if(l[0]!==d)break;s.shift(),l.shift()}return[...s.map(()=>".."),...l].join("/")},"relative"),$o=J(e=>{const t=oe(e).replace(ma,"").split("/").slice(0,-1);return t.length===1&&go.test(t[0])&&(t[0]=`${t[0]}/`),t.join("/")||(kr(e)?"/":".")},"dirname");J(function(e){const t=[e.root,e.dir,e.base??e.name+e.ext].filter(Boolean);return oe(e.root?Yr(...t):t.join("/"))},"format");const ya=J((e,t)=>{const s=oe(e).split("/").pop();return t&&s.endsWith(t)?s.slice(0,-t.length):s},"basename"),Yc=J(function(e){const t=ga.exec(e)?.[0]?.replaceAll("\\","/")??"",s=ya(e),l=yo(s);return{base:s,dir:$o(e),ext:l,name:s.slice(0,s.length-l.length),root:t}},"parse");J((e,t)=>ia(t,ho(e)),"matchesGlob");var $a=Object.defineProperty,Fe=x((e,t)=>$a(e,"name",{value:t,configurable:!0}),"n$5"),va=Object.defineProperty,le=Fe((e,t)=>va(e,"name",{value:t,configurable:!0}),"a");const xa=Ce(import.meta.url),xr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,wa=le(e=>{if(typeof xr<"u"&&xr.versions&&xr.versions.node){const[t,s]=xr.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return xr.getBuiltinModule(e)}return xa(e)},"__cjs_getBuiltinModule"),{fileURLToPath:ja}=wa("node:url");var Oa=Object.defineProperty,Je=le((e,t)=>Oa(e,"name",{value:t,configurable:!0}),"t$1");function Fr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}x(Fr,"m$4");Fe(Fr,"d");le(Fr,"getDefaultExportFromCjs");Je(Fr,"getDefaultExportFromCjs");function ln(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}x(ln,"h$2");Fe(ln,"O");le(ln,"getDefaultExportFromNamespaceIfPresent");Je(ln,"getDefaultExportFromNamespaceIfPresent");function cn(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")&&Object.keys(e).length===1?e.default:e}x(cn,"x$3");Fe(cn,"P");le(cn,"getDefaultExportFromNamespaceIfNotNamed");Je(cn,"getDefaultExportFromNamespaceIfNotNamed");function un(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var s=Je(le(Fe(x(function l(){var u=!1;try{u=this instanceof l}catch{}return u?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)},"a"),"s"),"a"),"a");s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(e).forEach(function(l){var u=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(s,l,u.get?u:{enumerable:!0,get:Je(function(){return e[l]},"get")})}),s}x(un,"y$3");Fe(un,"_");le(un,"getAugmentedNamespace");Je(un,"getAugmentedNamespace");var _n,Tn;function fn(){return Tn||(Tn=1,_n=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cr3","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),_n}x(fn,"w$2");Fe(fn,"k");le(fn,"requireBinaryExtensions");var Pa=fn();const Ea=Fr(Pa);var ka=Object.defineProperty,se=le((e,t)=>ka(e,"name",{value:t,configurable:!0}),"r");const Sa=new Set(Ea),Aa=new Set(["/","\\",void 0]),Rn=Symbol.for("pathe:normalizedAlias"),za=/(^|[/\\])([^/\\]+?)(?=(?:\.[^.]+)?$)/,Ma=se((e,t)=>t.split("/").length-e.split("/").length,"compareAliases"),Nr=se((e="/")=>{const t=e.at(-1);return t==="/"||t==="\\"},"hasTrailingSlash"),vo=se(e=>{if(e[Rn])return e;const t=Object.fromEntries(Object.entries(e).toSorted(([s],[l])=>Ma(s,l)));for(const s in t)for(const l in t)l===s||s.startsWith(l)||t[s].startsWith(l)&&Aa.has(t[s][l.length])&&(t[s]=t[l]+t[s].slice(l.length));return Object.defineProperty(t,Rn,{enumerable:!1,value:!0}),t},"normalizeAliases");se((e,t)=>{e=oe(e),t=vo(t);for(const[s,l]of Object.entries(t)){if(!e.startsWith(s))continue;const u=Nr(s)?s.slice(0,-1):s;if(Nr(e[u.length]))return bo(l,e.slice(s.length))}return e},"resolveAlias");se(e=>za.exec(e)?.[2],"filename");se((e,t)=>{e=oe(e),t=vo(t);for(const[s,l]of Object.entries(t).toReversed()){if(!e.startsWith(l))continue;const u=Nr(l)?l.slice(0,-1):l;if(Nr(e[u.length]))return bo(s,e.slice(l.length))}return e},"reverseResolveAlias");const _a=/^(?:\.?\.[/\\]|\.\.\B)/,Ta=/^(?:msys|cygwin)$/;se(e=>_a.test(e)||e==="..","isRelative");se(e=>Sa.has(yo(e).slice(1).toLowerCase()),"isBinaryPath");const Wr=se(e=>oe(e instanceof URL?ja(e):e),"toPath");se(()=>{if(!globalThis.process)return!1;if(globalThis.process.platform==="win32"||globalThis.process.platform==="cygwin")return!0;const e=globalThis.process.env.OSTYPE;return typeof e!="string"?!1:Ta.test(e)},"isWindows");var Ra=Object.defineProperty,xo=x((e,t)=>Ra(e,"name",{value:t,configurable:!0}),"t$8"),Na=Object.defineProperty,pn=xo((e,t)=>Na(e,"name",{value:t,configurable:!0}),"t");const Ba=Ce(import.meta.url),wr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ca=pn(e=>{if(typeof wr<"u"&&wr.versions&&wr.versions.node){const[t,s]=wr.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return wr.getBuiltinModule(e)}return Ba(e)},"__cjs_getBuiltinModule"),{accessSync:Ia}=Ca("node:fs");var Fa=Object.defineProperty,Wa=pn((e,t)=>Fa(e,"name",{value:t,configurable:!0}),"o");function ae(e,t=Xr){Ir(e),e=Wr(e);try{return Ia(e,t),!0}catch{return!1}}x(ae,"i$7");xo(ae,"d");pn(ae,"m");Wa(ae,"isAccessibleSync");var La=Object.defineProperty,wo=x((e,t)=>La(e,"name",{value:t,configurable:!0}),"t$7"),Da=Object.defineProperty,jo=wo((e,t)=>Da(e,"name",{value:t,configurable:!0}),"t"),Ua=Object.defineProperty,qa=jo((e,t)=>Ua(e,"name",{value:t,configurable:!0}),"o");let Nn=class extends Error{static{x(this,"c")}static{wo(this,"i")}static{jo(this,"n")}static{qa(this,"PermissionError")}constructor(t){super(`EPERM: Operation not permitted, ${t}`)}get code(){return"EPERM"}set code(t){throw new Error("Cannot overwrite code EPERM")}get name(){return"PermissionError"}set name(t){throw new Error("Cannot overwrite name of PermissionError")}};var Za=Object.defineProperty,Va=x((e,t)=>Za(e,"name",{value:t,configurable:!0}),"a$5"),Ja=Object.defineProperty,Oo=Va((e,t)=>Ja(e,"name",{value:t,configurable:!0}),"i");const Ga=Ce(import.meta.url),jr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Po=Oo(e=>{if(typeof jr<"u"&&jr.versions&&jr.versions.node){const[t,s]=jr.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return jr.getBuiltinModule(e)}return Ga(e)},"__cjs_getBuiltinModule"),{readFileSync:Ha}=Po("node:fs"),{unzipSync:Ka,brotliDecompressSync:Xa}=Po("node:zlib");var Ya=Object.defineProperty,Eo=Oo((e,t)=>Ya(e,"name",{value:t,configurable:!0}),"r");const Qa={brotli:Xa,gzip:Ka,none:Eo(e=>e,"none")},el=Eo((e,t)=>{if(Ir(e),e=Wr(e),!ae(e))throw new Nn(`unable to read the non-accessible file: ${e}`);if(!ae(e,fo))throw new Nn(`invalid access to read file at: ${e}`);const{buffer:s,compression:l,encoding:u,flag:d}=t??{},h=Ha(e,d?{encoding:u,flag:d}:{encoding:u}),m=Qa[l??"none"],j=m(h);return s?j:j.toString()},"readFileSync");var tl=Object.defineProperty,rl=x((e,t)=>tl(e,"name",{value:t,configurable:!0}),"x$2"),nl=Object.defineProperty,ko=rl((e,t)=>nl(e,"name",{value:t,configurable:!0}),"$"),ol=Object.defineProperty,sl=ko((e,t)=>ol(e,"name",{value:t,configurable:!0}),"A"),il=Object.defineProperty,dn=sl((e,t)=>il(e,"name",{value:t,configurable:!0}),"$"),al=Object.defineProperty,ll=dn((e,t)=>al(e,"name",{value:t,configurable:!0}),"r$1");const cl=ll(e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
2
- `),"normalizeLF"),ul=globalThis.process??Object.create(null),Bn={versions:{}},Cn=new Proxy(ul,{get(e,t){if(t in e)return e[t];if(t in Bn)return Bn[t]}});var fl=Object.defineProperty,pl=dn((e,t)=>fl(e,"name",{value:t,configurable:!0}),"b");const dl=pl((e,t,s,l)=>{const u={column:0,line:-1,...e.start},d={...u,...e.end},h=u.line,m=u.column,j=d.line,A=d.column;let P=Math.max(h-(s+1),0),O=Math.min(t.length,j+l);h===-1&&(P=0),j===-1&&(O=t.length);const N=j-h,T={};if(N)for(let E=0;E<=N;E++){const q=E+h;if(!m)T[q]=!0;else if(E===0){const G=t[q-1]?.length;T[q]=[m,(G??0)-m+1]}else if(E===N)T[q]=[0,A];else{const G=t[q-E]?.length;T[q]=[0,G]}}else m===A?T[h]=m?[m,0]:!0:T[h]=[m,(A??0)-(m??0)];return{end:O,markerLines:T,start:P}},"getMarkerLines");var gl=Object.defineProperty,_r=dn((e,t)=>gl(e,"name",{value:t,configurable:!0}),"t");const ml=Cn.platform==="win32"&&!Cn.env?.WT_SESSION?">":"❯",hl=_r((e,t,s)=>{const l={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...s,color:{gutter:_r(E=>E,"gutter"),marker:_r(E=>E,"marker"),message:_r(E=>E,"message"),...s?.color}},u=typeof t.start.column=="number";let d=cl(e).split(`
3
- `);typeof l.tabWidth=="number"&&(d=d.map(E=>E.replaceAll(" "," ".repeat(l.tabWidth))));const{end:h,markerLines:m,start:j}=dl(t,d,l.linesAbove,l.linesBelow),A=String(h).length,{gutter:P,marker:O,message:N}=l.color;let T=d.slice(j,h).map((E,q)=>{const G=j+1+q,re=m[G],Me=` ${String(G)}`.slice(-A),_e=!m[G+1],K=` ${Me}${l.showGutter?" |":""}`;if(re){let B="";if(Array.isArray(re)){const Te=E.replaceAll(/[^\t]/g," ").slice(0,Math.max(re[0]-1,0)),Re=re[1]||1;B=[`
4
- `,l.prefix+P(K.replaceAll(/\d/g," "))," ",Te,O("^").repeat(Re)].join(""),_e&&l.message&&(B+=` ${N(l.message)}`)}return[l.prefix+O(ml),P(K),E.length>0?` ${E}`:"",B].join("")}return`${l.prefix} ${P(K)}${E.length>0?` ${E}`:""}`}).join(`
5
- `);return l.message&&!u&&(T=`${l.prefix+" ".repeat(A+1)+l.message}
6
- ${T}`),T},"codeFrame");var bl=Object.defineProperty,yl=ko((e,t)=>bl(e,"name",{value:t,configurable:!0}),"s"),$l=Object.defineProperty,vl=yl((e,t)=>$l(e,"name",{value:t,configurable:!0}),"o"),xl=Object.defineProperty,gn=vl((e,t)=>xl(e,"name",{value:t,configurable:!0}),"l");const In=gn((e,t)=>{let s=0,l=t.length-2;for(;s<l;){const u=s+(l-s>>1);if(e<t[u])l=u-1;else if(e>=t[u+1])s=u+1;else{s=u;break}}return s},"binarySearch"),wl=/\n|\r(?!\n)/,jl=gn(e=>e.split(wl).reduce((t,s)=>(t.push(t.at(-1)+s.length+1),t),[0]),"getLineStartIndexes"),Ol=gn((e,t,s)=>{const l=s?.skipChecks??!1;if(!l&&(!Array.isArray(e)&&typeof e!="string"||(typeof e=="string"||Array.isArray(e))&&e.length===0))return{column:0,line:0};if(!l&&(typeof t!="number"||typeof e=="string"&&t>=e.length||Array.isArray(e)&&t+1>=e.at(-1)))return{column:0,line:0};if(typeof e=="string"){const d=jl(e),h=In(t,d);return{column:t-d[h]+1,line:h+1}}const u=In(t,e);return{column:t-e[u]+1,line:u+1}},"indexToLineColumn");var Pl=Object.defineProperty,So=x((e,t)=>Pl(e,"name",{value:t,configurable:!0}),"t$6"),El=Object.defineProperty,Ao=So((e,t)=>El(e,"name",{value:t,configurable:!0}),"t"),kl=Object.defineProperty,Sl=Ao((e,t)=>kl(e,"name",{value:t,configurable:!0}),"i");let Al=class extends Error{static{x(this,"m")}static{So(this,"m")}static{Ao(this,"t")}static{Sl(this,"JSONError")}fileName;codeFrame;name="JSONError";#e;constructor(t){super(),this.#e=t}get message(){return`${this.#e}${this.fileName?` in ${this.fileName}`:""}${this.codeFrame?`
7
-
8
- ${this.codeFrame}
9
- `:""}`}set message(t){this.#e=t}};var zl=Object.defineProperty,zo=x((e,t)=>zl(e,"name",{value:t,configurable:!0}),"u$3"),Ml=Object.defineProperty,Mo=zo((e,t)=>Ml(e,"name",{value:t,configurable:!0}),"s"),_l=Object.defineProperty,zr=Mo((e,t)=>_l(e,"name",{value:t,configurable:!0}),"a");const Tl=zr(e=>String.raw`\u{${e.codePointAt(0).toString(16)}}`,"getCodePoint"),Rl=zr((e,t,s)=>hl(e,{start:t},{tabWidth:!1,...s}),"generateCodeFrame"),Nl=/in JSON at position (\d+)(?: \(line (\d+) column (\d+)\))?$/,Bl=zr((e,t)=>{const s=Nl.exec(t);if(!s)return;const[,l,u,d]=s;if(u&&d)return{column:Number(d),line:Number(u)};let h=Number(l);return h===e.length&&(h=e.length-1),Ol(e,h)},"getErrorLocation"),Cl=/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,Il=zr(e=>e.replace(Cl,(t,s,l)=>`"${l}"(${Tl(l)})`),"addCodePointToUnexpectedToken");function Lr(e,t,s,l){typeof t=="string"&&(typeof s=="object"&&(l=s),s=t,t=void 0);let u;try{return JSON.parse(e,t)}catch(m){u=m.message}let d;e?(d=Bl(e,u),u=Il(u)):u+=" while parsing empty string";const h=new Al(u);throw h.fileName=s,d&&(h.codeFrame=Rl(e,d,l)),h}x(Lr,"d$3");zo(Lr,"w");Mo(Lr,"E");zr(Lr,"parseJson");var Fl=Object.defineProperty,_o=x((e,t)=>Fl(e,"name",{value:t,configurable:!0}),"t$5"),Wl=Object.defineProperty,To=_o((e,t)=>Wl(e,"name",{value:t,configurable:!0}),"t"),Ll=Object.defineProperty,Dl=To((e,t)=>Ll(e,"name",{value:t,configurable:!0}),"r");function mn(e,t,s){typeof t=="object"&&(s=t,t=void 0);const l=el(e,{buffer:!0,encoding:void 0});let u=new TextDecoder().decode(l);const{beforeParse:d,color:h}=s??{};return typeof d=="function"&&(u=d(u)),Lr(u,t,Wr(e),{color:h})}x(mn,"n$3");_o(mn,"s");To(mn,"J");Dl(mn,"readJsonSync");var Ul=Object.defineProperty,ql=x((e,t)=>Ul(e,"name",{value:t,configurable:!0}),"a$3"),Zl=Object.defineProperty,Vl=ql((e,t)=>Zl(e,"name",{value:t,configurable:!0}),"t"),Jl=Object.defineProperty,Gl=Vl((e,t)=>Jl(e,"name",{value:t,configurable:!0}),"e");const Hl=Gl(e=>{if(typeof e!="string"&&!(e instanceof ArrayBuffer)&&!ArrayBuffer.isView(e))throw new TypeError("File contents must be a string, ArrayBuffer, or ArrayBuffer view.")},"assertValidFileContents");var Kl=Object.defineProperty,Xl=x((e,t)=>Kl(e,"name",{value:t,configurable:!0}),"t$3"),Yl=Object.defineProperty,Ql=Xl((e,t)=>Yl(e,"name",{value:t,configurable:!0}),"r"),ec=Object.defineProperty,tc=Ql((e,t)=>ec(e,"name",{value:t,configurable:!0}),"f");const rc=new TextEncoder,nc=tc(e=>{if(e instanceof Uint8Array)return e;if(typeof e=="string")return rc.encode(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e)){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(t)}throw new TypeError("Invalid contents type. Expected string or ArrayBuffer.")},"toUint8Array");var oc=Object.defineProperty,sc=x((e,t)=>oc(e,"name",{value:t,configurable:!0}),"m"),ic=Object.defineProperty,Ro=sc((e,t)=>ic(e,"name",{value:t,configurable:!0}),"s");const ac=Ce(import.meta.url),Or=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,lc=Ro(e=>{if(typeof Or<"u"&&Or.versions&&Or.versions.node){const[t,s]=Or.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return Or.getBuiltinModule(e)}return ac(e)},"__cjs_getBuiltinModule"),{mkdirSync:cc,writeFileSync:uc,statSync:fc,renameSync:Fn,chownSync:pc,chmodSync:dc,unlinkSync:gc}=lc("node:fs");var mc=Object.defineProperty,hc=Ro((e,t)=>mc(e,"name",{value:t,configurable:!0}),"f");const bc=hc((e,t,s)=>{s={encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...s},Ir(e),Hl(t),e=Wr(e);const l=`${e}.tmp`;try{const u=ae(e,Xr);if(!u&&s.recursive){const h=$o(e);ae(h,Xr)||cc(h,{recursive:!0})}let d;if(uc(l,nc(t),{encoding:s.encoding,flag:s.flag}),u&&!s.overwrite&&(d=fc(e),s.chown??={gid:d.gid,uid:d.uid},Fn(e,`${e}.bak`)),s.chown)try{pc(l,s.chown.uid,s.chown.gid)}catch{}dc(l,d&&!s.mode?d.mode:s.mode??438),Fn(l,e)}catch(u){throw new Error(`Failed to write file at: ${e} - ${u.message}`,{cause:u})}finally{ae(l)&&gc(`${e}.tmp`)}},"writeFileSync");var yc=Object.defineProperty,Ae=x((e,t)=>yc(e,"name",{value:t,configurable:!0}),"i$2"),$c=Object.defineProperty,ze=Ae((e,t)=>$c(e,"name",{value:t,configurable:!0}),"s"),vc=Object.defineProperty,We=ze((e,t)=>vc(e,"name",{value:t,configurable:!0}),"i");const xc=/^(?:( )+|\t+)/,Mr="space";function Sr(e,t,s){return e&&t===Mr&&s===1}x(Sr,"d$1");Ae(Sr,"g");ze(Sr,"I");We(Sr,"shouldIgnoreSingleSpace");function Ar(e,t){const s=new Map;let l=0,u,d;for(const h of e.split(/\n/g)){if(!h)continue;const m=h.match(xc);if(m===null)l=0,u="";else{const j=m[0].length,A=m[1]?Mr:"tab";if(Sr(t,A,j))continue;A!==u&&(l=0),u=A;let P=1,O=0;const N=j-l;if(l=j,N===0)P=0,O=1;else{const E=Math.abs(N);if(Sr(t,A,E))continue;d=Dr(A,E)}const T=s.get(d);s.set(d,T===void 0?[1,0]:[T[0]+P,T[1]+O])}}return s}x(Ar,"p$1");Ae(Ar,"y");ze(Ar,"h");We(Ar,"makeIndentsMap");function Dr(e,t){return(e===Mr?"s":"t")+String(t)}x(Dr,"b$1");Ae(Dr,"v");ze(Dr,"m");We(Dr,"encodeIndentsKey");function Ur(e){const t=e[0]==="s"?Mr:"tab",s=Number(e.slice(1));return{type:t,amount:s}}x(Ur,"v");Ae(Ur,"M");ze(Ur,"_");We(Ur,"decodeIndentsKey");function qr(e){let t,s=0,l=0;for(const[u,[d,h]]of e)(d>s||d===s&&h>l)&&(s=d,l=h,t=u);return t}x(qr,"I");Ae(qr,"S");ze(qr,"k");We(qr,"getMostUsedKey");function Zr(e,t){return(e===Mr?" ":" ").repeat(t)}x(Zr,"h");Ae(Zr,"k");ze(Zr,"D");We(Zr,"makeIndentString");function Vr(e){if(typeof e!="string")throw new TypeError("Expected a string");let t=Ar(e,!0);t.size===0&&(t=Ar(e,!1));const s=qr(t);let l,u=0,d="";return s!==void 0&&({type:l,amount:u}=Ur(s),d=Zr(l,u)),{amount:u,type:l,indent:d}}x(Vr,"M");Ae(Vr,"x");ze(Vr,"C");We(Vr,"detectIndent");var wc=Object.defineProperty,jc=x((e,t)=>wc(e,"name",{value:t,configurable:!0}),"a$1"),Oc=Object.defineProperty,No=jc((e,t)=>Oc(e,"name",{value:t,configurable:!0}),"i");const Pc=Ce(import.meta.url),Pr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ec=No(e=>{if(typeof Pr<"u"&&Pr.versions&&Pr.versions.node){const[t,s]=Pr.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return Pr.getBuiltinModule(e)}return Pc(e)},"__cjs_getBuiltinModule"),{readFileSync:kc}=Ec("node:fs");var Sc=Object.defineProperty,Ac=No((e,t)=>Sc(e,"name",{value:t,configurable:!0}),"r");const tu=Ac((e,t,s={})=>{const{detectIndent:l,indent:u,replacer:d,stringify:h=JSON.stringify,...m}={indent:" ",...s};let j=u,A=`
10
- `;if(ae(e,fo))try{const O=kc(e,"utf8");if(l){const{indent:N}=Vr(O);j=N}A=O.endsWith(`
11
- `)?`
12
- `:""}catch(O){if(O.code!=="ENOENT")throw O}const P=h(t,d,j);bc(e,`${P}${A}`,m)},"writeJsonSync");var zc=Object.defineProperty,Mc=x((e,t)=>zc(e,"name",{value:t,configurable:!0}),"s");class hn extends Error{static{x(this,"VisConfigError")}static{Mc(this,"VisConfigError")}chain;constructor(t,s,l){super(t,l),this.name=this.constructor.name,this.chain=s}}var _c=Object.defineProperty,Tc=x((e,t)=>_c(e,"name",{value:t,configurable:!0}),"e");class ru extends hn{static{x(this,"VisConfigCycleError")}static{Tc(this,"VisConfigCycleError")}constructor(t,s){const l=[...s,`${t} (re-enters)`].join(" → ");super(`Config cycle: ${l}`,s)}}var Rc=Object.defineProperty,Nc=x((e,t)=>Rc(e,"name",{value:t,configurable:!0}),"t$1");class nu extends hn{static{x(this,"VisConfigLoadError")}static{Nc(this,"VisConfigLoadError")}constructor(t,s,l){const u=l instanceof Error?l.message:String(l),d=s.length>0?`
13
- Chain: ${s.join(" → ")}`:"";super(`Failed to load ${t}: ${u}${d}`,s,{cause:l})}}var Bc=Object.defineProperty,Bo=x((e,t)=>Bc(e,"name",{value:t,configurable:!0}),"t");const Cc=Bo(e=>e.join(" → "),"formatChain");class ou extends hn{static{x(this,"VisConfigNotFoundError")}static{Bo(this,"VisConfigNotFoundError")}constructor(t,s,l){const u=s.length>0?s[s.length-1]:"<unknown>",d=l.length>0?`
14
- Tried:
15
- ${l.join(`
16
- `)}`:"";super(`Cannot resolve "${t}" extended from ${u}.${d}
17
- Chain: ${Cc(s)}`,s)}}var Ic=Object.defineProperty,Co=x((e,t)=>Ic(e,"name",{value:t,configurable:!0}),"i$1");const Wn="@inherit",Fc=["aliases","dependsOn","inputs","outputs"],Wc=Co((e,t)=>{if(t===void 0)return e===void 0?void 0:[...e];if(!t.includes(Wn))return[...t];const s=[];for(const l of t){if(l===Wn){e!==void 0&&s.push(...e);continue}s.push(l)}return s},"mergeArrayWithInherit"),su=Co((e,t)=>{const s={...e,...t};for(const l of Fc){const u=e?.[l],d=t?.[l],h=Wc(u,d);h===void 0?delete s[l]:s[l]=h}return s},"mergeTargetWithInherit");var Ne;(function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"})(Ne||(Ne={}));var Lc=Object.defineProperty,Le=x((e,t)=>Lc(e,"name",{value:t,configurable:!0}),"i");const iu=Le(e=>{const{renameSpan:t,tracer:s}=e;let l;const u=new Map;return Do({hooks:{"run:after":Le(d=>{if(!l)return;const h=[...d.values()].filter(m=>m.status==="failure").length;l.setAttribute("vis.run.tasks_total",d.size),l.setAttribute("vis.run.tasks_failed",h),h>0?l.setStatus({code:Ne.ERROR,message:`${String(h)} task(s) failed`}):l.setStatus({code:Ne.OK}),l.end(),l=void 0;for(const m of u.values())m.end();u.clear()},"run:after"),"run:before":Le(d=>{l&&(l.setStatus({code:Ne.ERROR,message:"run:before fired while previous run was still active"}),l.end());for(const h of u.values())h.end();u.clear(),l=s.startSpan("vis.run",{attributes:{"vis.run.task_count":d.tasks.length,"vis.workspace_root":d.workspaceRoot}})},"run:before"),"task:after":Le((d,h)=>{const m=u.get(d.id);m&&(m.setAttribute("vis.task.exit_code",h.code??0),m.setAttribute("vis.task.cache_status",h.status),m.end(),u.delete(d.id))},"task:after"),"task:before":Le(d=>{const h=u.get(d.id);h&&(h.setStatus({code:Ne.ERROR,message:"retried — superseded by new attempt"}),h.end());const m=s.startSpan(t?t(d):d.id,{attributes:{"vis.task.id":d.id,"vis.task.project":d.target.project,"vis.task.target":d.target.target}});u.set(d.id,m)},"task:before"),"task:failure":Le((d,h)=>{const m=u.get(d.id);m&&m.setStatus({code:Ne.ERROR,message:`Task failed with exit code ${String(h.code??-1)}`})},"task:failure")},name:"otel"})},"otelPlugin");export{el as $,bc as B,Yr as C,Zc as K,ho as L,bo as M,kr as O,ya as Q,Wr as U,ru as V,Xr as _,$o as a,nu as b,ou as c,Yc as d,Jc as e,Ir as f,Vc as g,Gc as h,ae as i,Kc as j,Nn as k,Sn as l,su as m,mn as n,iu as o,Lr as p,Hl as q,nc as r,fo as s,Vr as t,tu as w,Hc as y,Xc as z};
@@ -1 +0,0 @@
1
- import"../packem_chunks/applyDefaults.js";import{o as e}from"./otel-CO8UEfTa.js";export{e as otelPlugin};
@@ -1,2 +0,0 @@
1
- var R=Object.defineProperty;var n=(t,e)=>R(t,"name",{value:e,configurable:!0});import{createRequire as M}from"node:module";import{f as q,l as m,M as d}from"./otel-CO8UEfTa.js";import{ax as B,ay as C,az as E}from"../packem_chunks/bin.js";const j=M(import.meta.url),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,w=n(t=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[e,r]=u.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return u.getBuiltinModule(t)}return j(t)},"__cjs_getBuiltinModule"),{Socket:k}=w("node:net"),{randomBytes:P}=w("node:crypto"),{readdir:x,writeFile:O,rename:F,rm:f,open:N,readFile:A,stat:L,unlink:h}=w("node:fs/promises"),{createRequire:I}=w("node:module");var W=Object.defineProperty,X=n((t,e)=>W(t,"name",{value:e,configurable:!0}),"i"),z=Object.defineProperty,b=X((t,e)=>z(t,"name",{value:e,configurable:!0}),"s");const G=I(import.meta.url),l=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,J=b(t=>{if(typeof l<"u"&&l.versions&&l.versions.node){const[e,r]=l.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return l.getBuiltinModule(t)}return G(t)},"__cjs_getBuiltinModule"),{lstat:v,mkdir:V}=J("node:fs/promises");var Y=Object.defineProperty,H=b((t,e)=>Y(t,"name",{value:e,configurable:!0}),"o");const K=H(async t=>{q(t);try{const e=await v(t);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(m(e))}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{await V(t,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const r=await v(t);if(!r.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(m(r))}'`,{cause:e})}},"ensureDir");var Q=Object.defineProperty,c=n((t,e)=>Q(t,"name",{value:e,configurable:!0}),"s");const U=3e4,$=100;class Z extends Error{static{n(this,"ServiceReadinessError")}constructor(e,r){super(e),this.elapsedMs=r,this.name="ServiceReadinessError"}elapsedMs;static{c(this,"ServiceReadinessError")}}const ee=c(async t=>{const e=t.host??"127.0.0.1",{port:r}=t,o=t.timeoutMs??U,i=Date.now();for(;Date.now()-i<o;){if(await te(e,r))return;await re($)}throw new Z(`Timed out waiting for ${e}:${String(r)} to accept TCP connections (${String(o)}ms)`,Date.now()-i)},"waitForTcp"),te=c((t,e)=>new Promise(r=>{const o=new k,i=c(a=>{o.removeAllListeners(),o.destroy(),r(a)},"onDone");o.once("connect",()=>{i(!0)}),o.once("error",()=>{i(!1)}),o.setTimeout($,()=>{i(!1)});try{o.connect(e,t)}catch{i(!1)}}),"tryConnect"),re=c(t=>new Promise(e=>{setTimeout(e,t)}),"delay"),he=c(async(t,e)=>{const r=t.readiness??(t.port===void 0?void 0:{tcp:{port:t.port}});r&&await ee({host:r.tcp.host,port:r.tcp.port,timeoutMs:e?.timeoutMs??r.tcp.timeoutMs})},"runReadiness");var ie=Object.defineProperty,s=n((t,e)=>ie(t,"name",{value:e,configurable:!0}),"o");const _=384,g=5e3,oe=50,se=3e4,p=s(async t=>{const e=d(B(t),"services");try{await K(e)}catch(r){throw r.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:r}):r}return e},"getRegistryDir"),S=s(t=>t.replaceAll("/","_").replaceAll(":","__"),"slugify"),y=s((t,e)=>d(t,`${S(e)}.json`),"entryPath"),ae=s((t,e)=>d(t,`${S(e)}.lock`),"lockPath"),T=s(async(t,e)=>{const r=await p(t),o=y(r,e);if(await C(o))try{return await E(o)}catch{return}},"readEntry"),ne=s(async t=>{const e=await p(t);let r;try{r=await x(e)}catch{return[]}const o=[];for(const i of r)if(i.endsWith(".json"))try{const a=await E(d(e,i));o.push(a)}catch{}return o},"readAllEntries"),me=s(async(t,e)=>{const r=await p(t),o=y(r,e.id),i=d(r,`.${P(8).toString("hex")}.tmp`);await O(i,`${JSON.stringify(e,void 0,2)}
2
- `,{mode:_});try{await F(i,o)}catch(a){throw await f(i,{force:!0}).catch(()=>{}),a}},"writeEntry"),ce=s(async(t,e,r)=>{const o=await p(t),i=r??await T(t,e);await f(y(o,e),{force:!0}),i&&await f(i.logFile,{force:!0}).catch(()=>{})},"deleteEntry"),D=s(t=>{try{return process.kill(t,0),!0}catch{return!1}},"isAlive"),ve=s(async t=>{const e=await ne(t),r=[],o=[];for(const i of e){if(D(i.pid)){o.push(i);continue}const a=await T(t,i.id);if(a&&a.pid!==i.pid){o.push(a);continue}await ce(t,i.id,i).catch(()=>{}),r.push(i.id)}return{pruned:r,surviving:o}},"pruneDead"),ue=s(t=>new Promise(e=>{setTimeout(e,t)}),"sleep"),le=s(async t=>{try{const e=await N(t,"wx",_);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"),de=s(async t=>{let e;try{const r=await A(t,"utf8"),o=Number.parseInt(r.trim(),10);e=Number.isFinite(o)?o:void 0}catch{return!0}if(e!==void 0&&!D(e))return!0;try{const r=await L(t);return Date.now()-r.mtimeMs>se}catch{return!0}},"isLockStale"),ge=s(async(t,e,r)=>{const o=await p(t),i=ae(o,e),a=Date.now();for(;!await le(i);){if(await de(i)){await h(i).catch(()=>{});continue}if(Date.now()-a>=g)throw new Error(`Could not acquire service lock for ${e} within ${String(g)}ms — another \`vis service\` invocation appears to be holding it.`);await ue(oe)}try{return await r()}finally{await h(i).catch(()=>{})}},"withServiceLock");export{_ as R,Z as S,me as a,he as b,ne as c,ce as d,p as g,D as i,ve as p,T as r,S as s,ge as w};
@@ -1 +0,0 @@
1
- var y=Object.defineProperty;var d=(e,s)=>y(e,"name",{value:s,configurable:!0});import{createRequire as j}from"node:module";import{M as m}from"./otel-CO8UEfTa.js";const M=j(import.meta.url),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_=d(e=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[s,t]=u.versions.node.split(".").map(Number);if(s>22||s===22&&t>=3||s===20&&t>=16)return u.getBuiltinModule(e)}return M(e)},"__cjs_getBuiltinModule"),{readdir:p,stat:l,readFile:h}=_("node:fs/promises");var k=Object.defineProperty,c=d((e,s)=>k(e,"name",{value:s,configurable:!0}),"m");const b=c((e,s)=>e.tasks.find(t=>t.taskId===s),"findTaskInSummary"),f=c((e,s)=>{const t=e??{},i=s??{},n=[],r=[],a=[];for(const o of Object.keys(t))o in i?t[o]!==i[o]&&a.push(o):n.push(o);for(const o of Object.keys(i))o in t||r.push(o);return n.sort(),r.sort(),a.sort(),{added:n,changed:a,removed:r}},"diffHashBuckets"),R=c((e,s)=>({commandChanged:(e?.command??"")!==(s?.command??""),implicitDeps:f(e?.implicitDeps,s?.implicitDeps),nodes:f(e?.nodes,s?.nodes),runtime:f(e?.runtime,s?.runtime)}),"diffHashDetails"),w=c(async(e,s)=>{const t=m(e,".task-runner","runs",`${s}.json`);try{const i=await h(t,"utf8");return JSON.parse(i)}catch{return}},"readRunSummaryById"),B=c(async(e,s)=>{const t=m(e,".task-runner","runs");let i;try{i=await p(t)}catch{return}const n=[];for(const r of i){if(!r.endsWith(".json")||s!==void 0&&r===`${s}.json`)continue;const a=m(t,r);try{const o=await l(a);o.isFile()&&n.push({mtimeMs:o.mtimeMs,path:a})}catch{}}if(n.length!==0){n.sort((r,a)=>a.mtimeMs-r.mtimeMs);try{const r=await h(n[0].path,"utf8");return JSON.parse(r)}catch{return}}},"readPreviousRunSummary"),D=c(async e=>{const s=m(e,".task-runner","runs");let t;try{t=await p(s)}catch{return[]}const i=[];for(const n of t){if(!n.endsWith(".json"))continue;const r=m(s,n);try{const a=await l(r);a.isFile()&&i.push({id:n.slice(0,-5),mtimeMs:a.mtimeMs,path:r})}catch{}}return i.sort((n,r)=>r.mtimeMs-n.mtimeMs),i},"listRunSummaries");export{B as a,R as d,b as f,D as l,w as r};
@@ -1 +0,0 @@
1
- var d=Object.defineProperty;var f=(t,s)=>d(t,"name",{value:s,configurable:!0});import{M as m,i as h,$ as k,n as v}from"./otel-CO8UEfTa.js";var $=Object.defineProperty,g=f((t,s)=>$(t,"name",{value:s,configurable:!0}),"p");const M=g(t=>{for(const s of[".nvmrc",".node-version"]){const i=m(t,s);if(h(i))try{return k(i).trim().replace(/^v/,"")}catch{}}},"readNodeVersionFile"),l=g((t,s)=>{const i=t.split(/[.\-+]/).map(r=>Number.parseInt(r,10)||0),c=s.split(/[.\-+]/).map(r=>Number.parseInt(r,10)||0),e=Math.max(i.length,c.length);for(let r=0;r<e;r++){const n=i[r]??0,a=c[r]??0;if(n!==a)return n-a}return 0},"compareVersions"),b=g((t,s)=>{const i=s.trim();if(i===""||i==="*")return!0;const c=i.split(/\s+/).filter(Boolean);for(const e of c)if(e.startsWith(">=")){if(l(t,e.slice(2).trim())<0)return!1}else if(e.startsWith("<=")){if(l(t,e.slice(2).trim())>0)return!1}else if(e.startsWith(">")){if(l(t,e.slice(1).trim())<=0)return!1}else if(e.startsWith("<")){if(l(t,e.slice(1).trim())>=0)return!1}else if(/^\d/.test(e)){const r=t.split("."),n=e.split(".");for(const[a,o]of n.entries())if(o!==r[a])return!1}return!0},"satisfiesRange"),x=g(t=>{const s=[],i=m(t,"package.json");let c;try{c=v(i)}catch{return s}const e=process.versions.node;if(c.engines?.node){const n=c.engines.node;b(e,n)||s.push({actual:e,expected:n,kind:"node",message:`package.json engines.node requires ${n}, but the current Node.js is ${e}.`,severity:"error"})}const r=M(t);if(r){const[n,a]=r.split("."),[o,p]=e.split(".");(n!==o||a!==void 0&&a!==p)&&s.push({actual:e,expected:r,kind:"node",message:`.nvmrc pins Node ${r} but the current Node.js is ${e}. Run \`nvm use\` or switch runtimes.`,severity:"warning"})}if(c.packageManager){const[n,a]=c.packageManager.split("@"),o=(process.env.npm_config_user_agent??"").split(" ")[0]??"",[p,u]=o.split("/");p&&n&&p!==n?s.push({actual:p,expected:n,kind:"packageManager",message:`package.json packageManager pins ${c.packageManager} but the current invocation is ${o}. Install the correct package manager.`,severity:"error"}):u&&a&&u!==a&&s.push({actual:u,expected:a,kind:"packageManager",message:`package.json packageManager pins ${n}@${a} but the current invocation uses ${n}@${u}.`,severity:"warning"})}return s},"checkRuntimeVersions");export{x as c};
@@ -1,5 +0,0 @@
1
- var N=Object.defineProperty;var x=(o,e)=>N(o,"name",{value:e,configurable:!0});import{createRequire as I}from"node:module";import{M as d,i as g,$ as k,n as O,j as J,y as R}from"./otel-CO8UEfTa.js";const B=I(import.meta.url),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,j=x(o=>{if(typeof M<"u"&&M.versions&&M.versions.node){const[e,n]=M.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return M.getBuiltinModule(o)}return B(o)},"__cjs_getBuiltinModule"),{execFileSync:w}=j("node:child_process"),{randomBytes:D}=j("node:crypto"),{writeFileSync:U,renameSync:q,unlinkSync:H}=j("node:fs");var z=Object.defineProperty,f=x((o,e)=>z(o,"name",{value:e,configurable:!0}),"f");const V=["proto","mise","fnm","volta","asdf","nvm","corepack"],Z={asdf:["bun","deno","go","node","npm","pnpm","python","ruby","rust","yarn"],corepack:["npm","pnpm","yarn"],fnm:["node"],mise:["bun","deno","go","node","npm","pnpm","python","ruby","rust","yarn"],nvm:["node"],proto:["bun","deno","go","node","npm","pnpm","python","ruby","rust","yarn"],volta:["node","npm","pnpm","yarn"]},X=["proto","mise","fnm","volta","asdf","nvm","corepack"],W={asdf:[".tool-versions"],corepack:[],fnm:[".nvmrc",".node-version"],mise:[".mise.toml",".config/mise.toml","mise.toml"],nvm:[".nvmrc"],proto:[".prototools"],volta:[]},b=new Map,y=f(o=>{const e=b.get(o);if(e!==void 0||b.has(o))return e;const n=process.env.PATH;if(!n){b.set(o,void 0);return}const t=process.platform==="win32"?["",...(process.env.PATHEXT??".COM;.EXE;.BAT;.CMD").split(";")]:[""];for(const r of n.split(J)){const i=r.replaceAll(/^["']|["']$/g,"").trim();if(i!=="")for(const l of t){const s=`${i}${R}${o}${l}`;if(g(s))return b.set(o,s),s}}b.set(o,void 0)},"isOnPath"),_=f((o,e=["--version"])=>{try{const n=w(o,e,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:2e3}),t=/\d+\.\d+(?:\.\d+)?/.exec(n);return t?t[0]:n.trim()||void 0}catch{return}},"queryManagerVersion"),A=f((o,e)=>{const n=d(o,"package.json");if(!g(n))return[];try{const t=O(n)[e];if(e==="volta"&&typeof t=="object"&&t!==null&&Object.keys(t).length>0)return["package.json"];if(e==="packageManager"&&typeof t=="string"&&t.length>0)return["package.json"]}catch{}return[]},"pkgFieldConfigFiles"),G=f((o,e)=>o==="volta"?A(e,"volta"):o==="corepack"?A(e,"packageManager"):W[o].filter(n=>g(d(e,n))),"configFilesFor"),P=new Map,K=f(()=>{P.clear(),b.clear()},"clearToolchainCache"),S=f((o,e)=>{if(!e?.refresh){const i=P.get(o);if(i)return i}const n=[],t=!!y("pnpm")||!!y("yarn");for(const i of X){const l=i==="nvm"?void 0:y(i),s=i==="nvm"&&!!process.env.NVM_DIR,c=G(i,o),a=!!l||s;i==="corepack"&&!a&&(!(c.length>0)||t)||!a&&c.length===0||n.push({binPath:l,configFiles:c,installed:a,name:i,version:l?_(l):void 0})}const r=Object.freeze(n);return P.set(o,r),r},"findInstalledManagers"),ye=f((o,e,n)=>{const t=n??S(o);return e?.preferredManager&&e.preferredManager!=="none"?t.find(r=>r.name===e.preferredManager)??{configFiles:[],installed:!1,name:e.preferredManager}:t.find(r=>r.installed&&r.configFiles.length>0)??t.find(r=>r.installed)??t.find(r=>r.configFiles.length>0)??{configFiles:[],installed:!1,name:"none"}},"pickPrimaryManager"),L=f((o,e)=>{for(const n of e){const t=d(o,n);if(g(t))try{const r=k(t).trim();if(r!=="")return{name:n,value:r.replace(/^v/,"")}}catch{}}},"readVersionFile"),Q=/^([a-z][\w-]*)\s*=\s*"?([^"\n#]+?)"?\s*(?:#.*)?$/i,Y=f(o=>{const e=d(o,".prototools");if(!g(e))return[];const n=k(e),t=[];let r=!1;for(const i of n.split(/\r?\n/)){const l=i.trim();if(l===""||l.startsWith("#"))continue;if(l.startsWith("[")){r=!0;continue}if(r)continue;const s=Q.exec(l);if(!s)continue;const[,c,a]=s,u=h(c);u&&t.push({source:".prototools",tool:u,version:a.trim()})}return t},"parsePrototools"),ee=/^\[tools\]\s*$/i,oe=/^([a-z][\w-]*)\s*=\s*"?([^"\n#]+?)"?\s*(?:#.*)?$/i,ne=f(o=>{for(const e of W.mise){const n=d(o,e);if(!g(n))continue;const t=[],r=k(n);let i=!1;for(const l of r.split(/\r?\n/)){const s=l.trim();if(s===""||s.startsWith("#"))continue;if(s.startsWith("[")){i=ee.test(s);continue}if(!i)continue;const c=oe.exec(s);if(!c)continue;const[,a,u]=c,m=h(a);m&&t.push({source:".mise.toml",tool:m,version:u.trim()})}if(t.length>0)return t}return[]},"parseMiseToml"),te=f(o=>{const e=d(o,".tool-versions");if(!g(e))return[];const n=k(e),t=[];for(const r of n.split(/\r?\n/)){const i=r.trim();if(i===""||i.startsWith("#"))continue;const l=i.split(/\s+/);if(l.length<2)continue;const[s,...c]=l,a=h(s);a&&c[0]&&t.push({source:".tool-versions",tool:a,version:c[0]})}return t},"parseToolVersions"),h=f(o=>{switch(o.toLowerCase()){case"bun":return"bun";case"deno":return"deno";case"go":case"golang":return"go";case"node":case"nodejs":return"node";case"npm":return"npm";case"pnpm":return"pnpm";case"python":case"python3":return"python";case"ruby":return"ruby";case"rust":case"rustc":return"rust";case"yarn":return"yarn";default:return}},"normalizeToolName"),re=f(o=>{const[e]=o.split("+",1),n=/^(pnpm|yarn|npm|bun)@(.+)$/.exec(e??"");if(!n)return;const t=h(n[1]);if(t)return{source:"packageManager",tool:t,version:n[2]}},"parsePackageManagerField"),se=f((o,e)=>{const n=new Map,t=f(s=>{n.set(s.tool,s)},"add"),r=d(o,"package.json");let i={};try{g(r)&&(i=O(r))}catch{}if(i.engines)for(const[s,c]of Object.entries(i.engines)){const a=h(s);a&&typeof c=="string"&&t({source:"engines",tool:a,version:c})}if(i.packageManager){const s=re(i.packageManager);s&&t(s)}if(i.volta)for(const[s,c]of Object.entries(i.volta)){const a=h(s);a&&typeof c=="string"&&t({source:"volta",tool:a,version:c})}const l=L(o,[".nvmrc",".node-version"]);l&&t({source:l.name===".nvmrc"?".nvmrc":".node-version",tool:"node",version:l.value});for(const s of te(o))t(s);for(const s of ne(o))t(s);for(const s of Y(o))t(s);if(e?.tools)for(const[s,c]of Object.entries(e.tools)){const a=h(s);a&&typeof c=="string"&&t({source:"vis.config.ts",tool:a,version:c})}return[...n.values()]},"parseExpectedTools"),F={bun:{args:["--version"],binaries:["bun"]},deno:{args:["--version"],binaries:["deno"]},go:{args:["version"],binaries:["go"]},node:{args:["--version"],binaries:["node"]},npm:{args:["--version"],binaries:["npm"]},pnpm:{args:["--version"],binaries:["pnpm"]},python:{args:["--version"],binaries:["python","python3"]},ruby:{args:["--version"],binaries:["ruby"]},rust:{args:["--version"],binaries:["rustc"]},yarn:{args:["--version"],binaries:["yarn"]}},ie=f(o=>{const e=F[o];for(const n of e.binaries){const t=y(n);if(t)return _(t,e.args)}if(o==="node")return process.versions.node},"queryToolVersion"),ae=f((o,e)=>{const n=e.trim();if(n===""||n==="*"||n==="latest")return!0;if(/^\d[\d.]*$/.test(n))return o===n||o.startsWith(`${n}.`);const t=f(s=>s.split(/[.\-+]/).map(c=>Number.parseInt(c,10)||0),"parse"),r=f((s,c)=>{const a=t(s),u=t(c),m=Math.max(a.length,u.length);for(let p=0;p<m;p++){const $=a[p]??0,v=u[p]??0;if($!==v)return $-v}return 0},"compare"),i=f(s=>{for(const c of s)if(c.startsWith(">=")){if(r(o,c.slice(2).trim())<0)return!1}else if(c.startsWith("<=")){if(r(o,c.slice(2).trim())>0)return!1}else if(c.startsWith(">")){if(r(o,c.slice(1).trim())<=0)return!1}else if(c.startsWith("<")){if(r(o,c.slice(1).trim())>=0)return!1}else if(c.startsWith("^")||c.startsWith("~")){const a=c.slice(1).trim(),[u,m]=t(a),[p,$]=t(o);if(p!==u||c.startsWith("~")&&$!==m||r(o,a)<0)return!1}return!0},"matchesAll"),l=n.split("||").map(s=>s.trim().split(/\s+/).filter(Boolean)).filter(s=>s.length>0);return l.length===0?!0:l.some(s=>i(s))},"satisfies"),ce=f((o,e)=>{switch(o){case".mise.toml":return["mise"];case".node-version":case".nvmrc":return["fnm","nvm","volta","proto","mise","asdf"];case".prototools":return["proto"];case".tool-versions":return["asdf","mise"];case"packageManager":return e==="pnpm"||e==="yarn"?["self-activate","volta","proto","mise","corepack"]:e==="npm"?["volta","proto","mise","asdf","corepack"]:e==="bun"?["proto","mise","asdf"]:["volta","proto","mise"];case"volta":return["volta"];default:return["proto","mise","fnm","volta","asdf","nvm","corepack"]}},"preferenceFor"),le=f((o,e,n)=>{if(n?.preferredManager&&n.preferredManager!=="none"&&T(n.preferredManager,o.tool)){const r=e.find(i=>i.name===n.preferredManager);return r?{installed:r.installed,name:r.name}:{installed:!1,name:n.preferredManager,note:`${n.preferredManager} is the preferred manager but isn't on PATH`}}const t=ce(o.source,o.tool);for(const r of t){if(r==="self-activate"){if((o.tool==="pnpm"||o.tool==="yarn")&&y(o.tool))return{installed:!0,name:"self-activate",note:`${o.tool} will activate ${o.version} from the packageManager field on next invocation`};continue}if(T(r,o.tool)&&e.find(i=>i.name===r)?.installed)return{installed:!0,name:r}}for(const r of t)if(!(r==="self-activate"||!T(r,o.tool)))return{installed:!1,name:r,note:`${r} can install ${o.tool} — run \`vis toolchain install\` after adding it to PATH`};return{installed:!1,name:"none",note:"No manager knows how to install this tool"}},"resolveManagerFor"),T=f((o,e)=>o==="none"?!1:o==="self-activate"?e==="pnpm"||e==="yarn":Z[o].includes(e),"canHandle"),fe=f((o,e)=>{const n=S(o),t=se(o,e).map(r=>{const i=ie(r.tool),l=i!==void 0&&ae(i,r.version),s=le(r,n,e);return{actual:i,expected:r,manager:s,matches:l}});return{detected:n,tools:t}},"getToolchainStatus"),pe=f((o,e)=>{switch(o){case"asdf":return e?{args:["install",e.tool,e.version],bin:"asdf"}:void 0;case"corepack":return e?{args:["prepare",`${e.tool}@${e.version}`,"--activate"],bin:"corepack"}:{args:["prepare","--activate"],bin:"corepack",hint:"reads the packageManager field in package.json"};case"fnm":return e?.tool!=="node"?void 0:{args:["install",e.version],bin:"fnm"};case"mise":return e?{args:["install",`${e.tool}@${e.version}`],bin:"mise"}:void 0;case"none":return;case"nvm":return{args:[],bin:"nvm",hint:"nvm is a shell function — run `nvm install` / `nvm use` from your shell"};case"proto":return e?{args:["install",e.tool,e.version],bin:"proto"}:void 0;case"self-activate":return{args:[],bin:e?.tool??"pnpm",hint:`${e?.tool??"pnpm"} will self-activate on next invocation — no install needed`};case"volta":return e?{args:["install",`${e.tool}@${e.version}`],bin:"volta"}:{args:["install","node@lts"],bin:"volta",hint:"volta pins per-tool; specify <tool>@<version>"};default:{const n=o;throw new Error(`Unknown manager: ${n}`)}}},"buildInstallInvocation"),$e=f((o,e)=>{switch(o){case"asdf":return{args:["local",e.tool,e.version],bin:"asdf",configChange:{file:".tool-versions",hint:`Pins ${e.tool} ${e.version}`}};case"corepack":return e.tool!=="npm"&&e.tool!=="pnpm"&&e.tool!=="yarn"?void 0:{args:["use",`${e.tool}@${e.version}`],bin:"corepack",configChange:{file:"package.json",hint:`Writes packageManager: "${e.tool}@${e.version}"`}};case"fnm":return e.tool==="node"?{args:["use",e.version],bin:"fnm"}:void 0;case"mise":return{args:["use","--",`${e.tool}@${e.version}`],bin:"mise",configChange:{file:".mise.toml",hint:`Pins ${e.tool} ${e.version}`}};case"none":return;case"nvm":return e.tool==="node"?{args:[],bin:"nvm",configChange:{file:".nvmrc",hint:"Write version to .nvmrc manually (nvm doesn't persist)."}}:void 0;case"proto":return{args:["pin",e.tool,e.version],bin:"proto",configChange:{file:".prototools",hint:`Pins ${e.tool} ${e.version}`}};case"self-activate":return{args:[],bin:e.tool,configChange:{file:"package.json",hint:`Set packageManager: "${e.tool}@${e.version}" — ${e.tool} will self-activate on next invocation`}};case"volta":return{args:["pin",`${e.tool}@${e.version}`],bin:"volta",configChange:{file:"package.json",hint:`Writes volta.${e.tool}`}};default:{const n=o;throw new Error(`Unknown manager: ${n}`)}}},"buildUseInvocation"),be=f(o=>{for(const e of F[o].binaries){const n=y(e);if(n)return n}},"findOnPathByAlias"),ke=f((o,e)=>{const n=F[e].binaries;if(o.installed&&o.binPath&&(o.name==="proto"||o.name==="mise"||o.name==="asdf"||o.name==="volta"||o.name==="fnm"))for(const t of n)try{const r=w(o.binPath,["which",t],{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:2e3}).trim();if(r)return r}catch{}for(const t of n){const r=y(t);if(r)return r}},"resolveToolBinary"),E=f((o,e)=>{const n=`${o}.${process.pid}.${D(6).toString("hex")}.tmp`;U(n,e);try{q(n,o)}catch(t){try{H(n)}catch{}throw t}},"atomicWrite"),ue=f((o,e)=>{if("packageManager"in o)return o.packageManager=e,o;const n={};let t=!1;for(const[r,i]of Object.entries(o))!t&&(r==="dependencies"||r==="devDependencies"||r==="peerDependencies"||r==="optionalDependencies")&&(n.packageManager=e,t=!0),n[r]=i;return t||(n.packageManager=e),n},"insertPackageManagerKey"),Me=f((o,e)=>{if(e.tool!=="pnpm"&&e.tool!=="yarn"&&e.tool!=="npm"&&e.tool!=="bun")return;const n=d(o,"package.json");if(!g(n))throw new Error(`Cannot pin ${e.tool}: ${n} does not exist.`);const t=k(n),r=/\n([ \t]+)/.exec(t)?.[1]??" ";let i;try{i=JSON.parse(t)}catch(a){throw new Error(`${n} is not valid JSON — fix it before running \`vis toolchain use\`. Underlying error: ${a.message}`,{cause:a})}const l=`${e.tool}@${e.version}`,s=ue(i,l),c=t.endsWith(`
2
- `)?`
3
- `:"";return E(n,`${JSON.stringify(s,void 0,r)}${c}`),l},"writePackageManagerField"),we=f((o,e)=>{const n=d(o,"package.json");if(!g(n))return;const t=k(n);let r;try{r=JSON.parse(t)}catch(s){throw new Error(`${n} is not valid JSON — fix it before running \`vis toolchain use\`. Underlying error: ${s.message}`,{cause:s})}if(r.engines?.[e.tool]===void 0||r.engines[e.tool]===e.version)return;r.engines[e.tool]=e.version;const i=/\n([ \t]+)/.exec(t)?.[1]??" ",l=t.endsWith(`
4
- `)?`
5
- `:"";return E(n,`${JSON.stringify(r,void 0,i)}${l}`),e.version},"updateEnginesField"),xe=f(o=>{const e=/^([a-z][\w-]*)@(.+)$/i.exec(o.trim());if(!e)return;const n=h(e[1]);if(n)return{source:"vis.config.ts",tool:n,version:e[2]}},"parseUseArgument"),ge=f(async(o,e,n)=>{const t=fe(o,e),r=t.tools.filter(a=>!a.matches);if(r.length===0)return{attempted:[],failed:[],upToDate:!0};const i=t.detected.some(a=>a.installed);if(!(e?.autoInstall??i))return{attempted:[],failed:[],upToDate:!1};const l=[],s=[],c=new Map;for(const a of r){const u=c.get(a.manager.name);u?u.push(a):c.set(a.manager.name,[a])}for(const[a,u]of c){if(a==="self-activate"){for(const{expected:p}of u)n.info(`toolchain: ${p.tool} ${p.version} will self-activate on next ${p.tool} invocation`),l.push(p);continue}if(a==="none"){for(const{expected:p}of u)s.push({error:`no manager can install ${p.tool} — install one of ${V.join(", ")}`,spec:p});continue}if(!t.detected.find(p=>p.name===a)?.installed){for(const{expected:p}of u)s.push({error:`${a} is not on PATH`,spec:p});continue}const m=u.map(p=>({invocation:pe(a,p.expected),tool:p})).filter(p=>p.invocation!==void 0);for(const{invocation:p,tool:$}of m){const{expected:v}=$;if(p.bin==="nvm"&&p.args.length===0){n.warn(`toolchain: nvm requires a shell-side activation for ${v.tool} ${v.version}. Run \`nvm install\` / \`nvm use\` manually.`),s.push({error:"nvm requires shell-side activation",spec:v});continue}n.info(`toolchain: $ ${p.bin} ${p.args.join(" ")}`);try{w(p.bin,p.args,{cwd:o,stdio:"inherit"}),l.push(v),a==="fnm"&&de(p.bin,n)}catch(C){s.push({error:C.message,spec:v});break}}}return K(),{attempted:l,failed:s,upToDate:!1}},"ensureToolchain"),Te=f(async(o,e,n,t=!1)=>{if(t)return;const r=await ge(o,e,n);for(const i of r.failed)n.warn(`toolchain: ${i.spec.tool} ${i.spec.version} — ${i.error}`)},"runToolchainPreflight"),de=f((o,e)=>{const n=process.platform==="win32"?"powershell":"bash";try{const t=w(o,["env","--shell",n],{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:2e3});for(const r of t.split(/\r?\n/)){const i=r.trim();if(i==="")continue;const l=/^\$env:([A-Z_]\w*)\s*=\s*(.+)$/i.exec(i);if(l){const[,a,u]=l;process.env[a]=u.replaceAll(/^["']|["']$/g,"");continue}const s=/^set\s+"?([A-Z_]\w*)=(.*?)"?$/i.exec(i);if(s){const[,a,u]=s;process.env[a]=u;continue}const c=/^(?:export\s+)?([A-Z_]\w*)=(.+)$/i.exec(i);if(c){const[,a,u]=c;process.env[a]=u.replaceAll(/^["']|["']$/g,"")}}}catch(t){e.warn(`toolchain: could not activate fnm env (${t.message}). Subsequent tasks may use the previous Node version.`)}},"activateFnmEnv");export{V as S,le as a,pe as b,$e as c,ke as d,be as e,S as f,fe as g,ye as h,xe as p,Te as r,we as u,Me as w};
@@ -1 +0,0 @@
1
- var q=Object.defineProperty;var l=(e,s)=>q(e,"name",{value:s,configurable:!0});import{createRequire as $}from"node:module";import{aE as M,p as i,d as b,e as k}from"../packem_chunks/bin.js";import{M as C,i as D,n as A}from"./otel-CO8UEfTa.js";const z=$(import.meta.url),m=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_=l(e=>{if(typeof m<"u"&&m.versions&&m.versions.node){const[s,r]=m.versions.node.split(".").map(Number);if(s>22||s===22&&r>=3||s===20&&r>=16)return m.getBuiltinModule(e)}return z(e)},"__cjs_getBuiltinModule"),{createInterface:T}=_("node:readline");var O=["aj","aju","av","avj","ejv","jav","jv"],F=["angula","angular-node","angularjs"],N=["auto-prefixer"],P=["aaxios","aios","axio","axioos","axios-node","axioss","axis","axiso","axois","axos","axxios"],B=["abel","babbel","babe","babel-js","babel-node","babl","bable","bbael","bebel"],R=["bcrpyt","bcrypt-node","brcypt","crypt","dcrypt"],S=["bcryptjs-node","dcryptjs"],W=["bunan","bunya","bunyan-node","buynan"],E=["cai","cha","chaijs","chal","chi","chia","hai"],L=["cahlk","calk","cchalk","ch4lk","cha1k","chaalk","chaik","chak","chakl","chalk-node","chalkk","challk","chhalk","chlak","chlk","halk","hcalk"],U=["cheero","cherio"],V=["c0lor","ccolor","clor","colo","coloor","color-js","colorjs","colorr","colr","coolor","coolr"],I=["ccolors","colors-node","colorss","colorz","colrs","coolors"],J=["c0mmander","ccommander","cmmander","cmomander","co-mmander","comamnder","comander","comm4nder","commaander","commader","commadner","commamder","command3r","commandder","commande","commandeer","commander-js","commanderr","commandr","commandre","commanedr","commaner","commannder","commender","commmander","commnader","commnder","coommander","ocmmander","ommander"],Y=["cor","corss","cos","cosr","cros","crs","ors"],G=["days"],H=["d3bug","dbeug","dbug","ddebug","debbug","debg","debgu","debu","debu9","debug-js","debug-node","debugg","debugjs","debuug","deebug","deubg","deug","ebug","edbug"],K=["dot-env","dotenv-node","dotenvjs","dotevn"],Q=["3lectron","eectron","eelctron","eelectron","el3ctron","elcetron","elctron","elecctron","elecron","elecrton","electon","electorn","electr0n","electrn","electrno","electro","electrom","electron-node","electronn","electroon","electrron","electtron","eleectron","eletcron","eletron","ellectron","lectron","leectron"],X=["asbuild","ebuild","esbuild-node","esbuildjs","ezbuild","sbuild"],Z=["aslint","elint","eslint-js","eslint-node","eslit","ezlint","slint"],ee=["eexpress","epress","epxress","experss","expess","exppress","expreess","expres","express-node","expressjs","expresss","exprress","exprses","exprss","exress","exrpess","exxpress","xepress","xpress"],oe=["astify"],se=["firebasejs"],re=["form1dable"],ae=["glb","glo","glob-js","globjs","gob","golb","lob"],te=["go","goot","gotjs","gott","gt","gto","ogt","ot","qot"],ne=["helmetjs","helnet"],ce=["homo","hon","hoo","hoon","ohno","ono"],ie=["inquire","inquirer-js","nquirer"],de=["iredis"],me=["ejst","est","jast","jes","jestjs","jestt","jet","jets","jst"],le=["imp","jim","jip","jmp"],pe=["ji","jio","jo","joii","jol","oi","oji"],ue=["jdom","jsdm","jsdo","jsdom-js","jsdon","jsom","sdom"],ve=["jsonwebtoken-js","jsonwebtoken-node"],he=["ka","kao","ko","koaa","koajs","koe","oa","oka"],je=["1odash","iodash","l0dash","ldash","ldoash","llodash","lo-dash","loadsh","loash","lobash","lod4sh","lodaash","lodah","lodahs","lodas","lodash-node","lodashh","lodassh","loddash","lodesh","lodsah","lodsh","loodash","odash","oldash"],be=["luca","luci","lucie"],ke=["luon","luxo","luxon-js"],ge=["imcromatch","mciromatch","micormatch","micrmoatch","micro-match","microamtch","micromacth","micromathc","micromtach","mircomatch"],fe=["minimath"],ye=["mcha","mmocha","moca","moch","mocha-js","moha","nocha","ocha"],xe=["m0ment","mment","mmoent","mmoment","moemnt","moent","mom3nt","momeent","momemt","momen","momen7","momennt","moment-js","momentjs","momentt","momet","mometn","momment","momnet","momnt","monent","mooment","oment","omment"],we=["mognoose","mogoose","mongoos","mongose","monqoose","moongoose"],qe=["moran","organ"],$e=["muler","multer-js","muter"],ze=["mysql"],_e=["ext","mext","n3xt","naxt","net","netx","nex","next-js","next-node","nextjs","nxt"],Te=["node-mailer","nodemailer-js"],Me=["nodemo","nodemonjs","nodmeon"],Ce=["oar","or","ora-node","ore","ra","roa"],De=["arcel","parce","parceljs"],Ae=["passport-js"],Oe=["phase","phaser-node"],Fe=["ino","pimo","pin","pino-node","pinojs","pio","pion"],Ne=["playright","playwright-js"],Pe=["postcss-js","postcss-node","potscss"],Be=["pettier","pprettier","pretier","prettierjs","prettierr","prtetier"],Re=["prima","prism","prisma-js","prismajs","prizma"],Se=["pupeteer"],We=["rada","rama","ramd","randa"],Ee=["eact","eract","r3act","raact","ract","raect","re4ct","reaact","reac","reac7","reacct","react-node","reactjs","reactt","reat","reatc","recat","rect","reeact","reect","rreact"],Le=["erdis","radis","rdis","redi","redis-js","redis-node","rediss","rediz","reds","reis","rredis"],Ue=["resen","rsend"],Ve=["ollup","rollup-js","rollup-node"],Ie=["ass","asss","sas","sass-node","sess","ssas","sss"],Je=["emver","seemver","semver-node","semvre","senver","sever"],Ye=["sequelize-js","sequelize-node"],Ge=["harp","shap","shar","sharp-js","sharpjs"],He=["stipe","strip","stripe-node","tripe"],Ke=["supabase-js"],Qe=["suelte","svelt3","svelte-js","sveltejs","velte"],Xe=["tailwindcss-js"],Ze=["auri","taui"],eo=["hree","htree","thee","there","three-js","three-node","tree"],oo=["stx","sx","ts","tsxx","ttsx","tx","txs","tzx"],so=["ttypescript","typecript","typescipt","typescript-node","typescriptjs","typescrit","typescritp"],ro=["udnerscore","undercore","underscoer","underscore-node","underscroe","undersocre","undesrcore"],ao=["uid","uud","uudi","uui","uuid-js","uuid-node","uuidjs","vuid"],to=["ite","vie","vit","vita","vite-node","vitee","vlte","vte"],no=["itest","uitest","vitestjs","vitezt","vittest","vtest"],co=["ue","uue","uve","ve","veu","vu","vu3","vua","vue-node","vuee","vuejs","vuue","vve","vvue"],io=["web-pack","weback","webpac","webpack-node","webpackjs","webpak","weebpack","wepack","wepback"],mo=["winson","winston-js","winstoon"],lo=["up","uyp","yp","yu","yupjs","yupp"],po=["od","zd","zdo","zo","zob","zod-js","zodjs"];const uo={ajv:O,angular:F,autoprefixer:N,"aws-sdk":["awssdk","ews-sdk"],axios:P,babel:B,bcrypt:R,bcryptjs:S,"body-parser":["body-paresr","body-parse","body-parser-js","body_parser"],bunyan:W,chai:E,chalk:L,cheerio:U,color:V,colors:I,commander:J,"cookie-parser":["cookie-parse","cookieparser"],cors:Y,"cross-env":["crossenv"],"date-fns":["data-fns","date-fn"],dayjs:G,debug:H,dotenv:K,electron:Q,esbuild:X,eslint:Z,express:ee,fastify:oe,firebase:se,formidable:re,glob:ae,got:te,helmet:ne,hono:ce,inquirer:ie,ioredis:de,jest:me,jimp:le,joi:pe,jsdom:ue,jsonwebtoken:ve,koa:he,lodash:je,lucia:be,luxon:ke,micromatch:ge,minimatch:fe,mocha:ye,moment:xe,mongoose:we,morgan:qe,multer:$e,mysql2:ze,next:_e,"node-fetch":["node-fecth","node-fethc","node.fetch"],nodemailer:Te,nodemon:Me,ora:Ce,parcel:De,passport:Ae,phaser:Oe,pino:Fe,playwright:Ne,postcss:Pe,prettier:Be,prisma:Re,puppeteer:Se,ramda:We,react:Ee,"react-dom":["eact-dom","eract-dom","r3act-dom","ract-dom","raect-dom","re4ct-dom","reaact-dom","reac-dom","reac7-dom","reacct-dom","react-bom","react-d0m","react-ddom","react-dm","react-dmo","react-do","react-domm","react-don","react-doom","react-odm","react-om","react.dom","reactdom","reactt-dom","reat-dom","reatc-dom","recat-dom","rect-dom","reeact-dom","rreact-dom"],redis:Le,resend:Ue,rollup:Ve,sass:Ie,semver:Je,sequelize:Ye,sharp:Ge,"socket.io":["ocket.io","oscket.io","scket.io","scoket.io","soccket.io","socekt.io","socet.io","sock3t.io","socke.io","socke7.io","sockeet.io","socket.1o","socket.i","socket.iio","socket.ioo","socket.lo","socket.o","socket.oi","sockett.io","sockket.io","sockt.io","sockte.io","sokcet.io","soket.io","soocket.io","ssocket.io"],stripe:He,supabase:Ke,svelte:Qe,tailwindcss:Xe,tauri:Ze,three:eo,"ts-node":["tts-node"],tsx:oo,typescript:so,underscore:ro,uuid:ao,vite:to,vitest:no,vue:co,webpack:io,winston:mo,yup:lo,zod:po};var v,g;function vo(){return g||(g=1,v={"@tanstack/start":["start-tanstack-app","tanstack","tanstack-app","tanstack-start"]}),v}l(vo,"requireTyposquatsManual");var ho=vo();const jo=M(ho);var bo=Object.defineProperty,n=l((e,s)=>bo(e,"name",{value:s,configurable:!0}),"c");const ko={a:["4","e"],b:["d"],d:["b"],e:["3","a"],g:["9","q"],i:["1","l"],l:["1","i"],m:["n"],n:["m"],o:["0"],s:["5","z"],t:["7"],u:["v"],v:["u"]},go=["app","cli","core","kit","lib","pkg","sdk"],fo=n(e=>{const s=new Set;if(e.length<3)return s;for(let o=0;o<e.length;o++){const a=e[o],t=a==="-"||a==="."||a==="_";if(t||s.add(e.slice(0,o)+e.slice(o+1)),t||s.add(e.slice(0,o)+a+e.slice(o)),o<e.length-1&&e[o]!==e[o+1]){const u=e[o+1]==="-"||e[o+1]==="."||e[o+1]==="_";if(!t&&!u){const d=[...e];[d[o],d[o+1]]=[d[o+1],d[o]],s.add(d.join(""))}}const c=e[o].toLowerCase(),j=ko[c];if(j)for(const u of j)s.add(e.slice(0,o)+u+e.slice(o+1))}const r=/[-._]/g;if(r.test(e))s.add(e.replaceAll(r,"")),s.add(e.replaceAll(r,"-")),s.add(e.replaceAll(r,".")),s.add(e.replaceAll(r,"_"));else if(e.length>5)for(let o=2;o<e.length-2;o++)s.add(`${e.slice(0,o)}-${e.slice(o)}`),s.add(`${e.slice(0,o)}.${e.slice(o)}`),s.add(`${e.slice(0,o)}_${e.slice(o)}`);if(e.startsWith("@")||(s.add(`${e}-js`),s.add(`${e}js`),s.add(`${e}-node`)),e.startsWith("@")){const o=e.indexOf("/");if(o>1&&o<e.length-1){const a=e.slice(1,o),t=e.slice(o+1);a.length>=3&&s.add(a);for(const c of["","-",".","_"])s.add(`${a}${c}${t}`),s.add(`${t}${c}${a}`);for(const c of go)s.add(`${a}-${c}`),s.add(`${t}-${a}-${c}`),s.add(`${c}-${a}-${t}`)}}return s.delete(e),s},"generateVariants");let h,p;const f=n(()=>{if(!h){const e={};for(const s of[uo,jo])for(const[r,o]of Object.entries(s)){const a=e[r]??(e[r]=[]);for(const t of o)a.includes(t)||a.push(t)}h=e}return h},"loadBlocklist"),yo=n(()=>{if(!p){p=new Map;for(const[e,s]of Object.entries(f()))for(const r of s)p.set(r,e)}return p},"getReverseLookup"),xo=n(e=>e.startsWith("@")?e.split("/")[1]??e:e,"bareName"),wo=n(e=>{const s=xo(e),r=yo().get(s);if(r)return{input:e,legitimate:r,method:"blocklist"};for(const o of Object.keys(f()))if(fo(o).has(s))return{input:e,legitimate:o,method:"heuristic"}},"checkTyposquat"),y=n((e,s)=>{const r=s?new Set(s):void 0,o=[];for(const a of e){if(r?.has(a))continue;const t=wo(a);t&&o.push(t)}return o},"checkTyposquats"),x=n((e,s)=>{i.warn(""),i.warn(b(`Possible typosquat${e.length===1?"":"s"} ${s}:`));for(const r of e){const o=r.method==="blocklist"?"known typosquat":"similar name";i.warn(` ${k("⚠")} ${b(r.input)} — did you mean ${k(r.legitimate)}? (${o})`)}i.warn("")},"printTyposquatWarnings"),w=n(async e=>{if(!process.stdin.isTTY){i.warn("Aborting: potential typosquat detected in non-interactive mode. Use --no-typosquat-check to skip.");return}const s=T({input:process.stdin,output:process.stdout}),r=await new Promise(o=>{s.question(e,a=>{o(a.trim().toLowerCase())})});return s.close(),r},"askConfirmation"),Do=n(async(e,s)=>{const r=y(e,s);if(r.length===0)return{ok:!0,packages:e};x(r,"detected");const o=await w(`Use suggested package${r.length===1?"":"s"} instead? [S]uggested / [y]es, keep original / [N]o, abort (default: N) `);if(o===void 0)return{ok:!1,packages:e};if(o==="s"||o==="suggested"){const a=new Map(r.map(t=>[t.input,t.legitimate]));return{ok:!0,packages:e.map(t=>a.get(t)??t)}}return o==="y"||o==="yes"?{ok:!0,packages:e}:{ok:!1,packages:e}},"runTyposquatCheck"),qo=/^(?:npm|pnpm|yarn):(.+?)(?:@.*)?$/,$o=n(e=>qo.exec(e)?.[1],"parseAliasTarget"),zo=n(e=>{if(!D(e))return[];const s=A(e),r={...s.dependencies,...s.devDependencies,...s.optionalDependencies,...s.peerDependencies},o=new Set;for(const[a,t]of Object.entries(r)){o.add(a);const c=$o(t);c&&o.add(c)}return[...o]},"readDepsFromPackageJson"),Ao=n(async(e,s)=>{const r=C(e,"package.json"),o=zo(r);if(o.length===0)return!0;const a=y(o,s);if(a.length===0)return!0;x(a,"in package.json dependencies"),i.warn("Fix the package name in package.json before proceeding.");const t=await w("Continue anyway? [y/N] ");return t==="y"||t==="yes"},"scanDepsForTyposquats");export{Do as r,Ao as s};
@@ -1 +0,0 @@
1
- var u=Object.defineProperty;var g=(n,s)=>u(n,"name",{value:s,configurable:!0});import{createRequire as m}from"node:module";import{M as i,i as a,$ as f}from"./otel-CO8UEfTa.js";import{t as $}from"../packem_chunks/bin.js";const j=m(import.meta.url),k=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,b=g(n=>{if(typeof k<"u"&&k.versions&&k.versions.node){const[s,o]=k.versions.node.split(".").map(Number);if(s>22||s===22&&o>=3||s===20&&o>=16)return k.getBuiltinModule(n)}return j(n)},"__cjs_getBuiltinModule"),{readdirSync:v}=b("node:fs");var w=Object.defineProperty,l=g((n,s)=>w(n,"name",{value:s,configurable:!0}),"o");const _=[".husky/pre-commit",".vis-hooks/pre-commit",".git/hooks/pre-commit"],D=[".secretlintrc",".secretlintrc.json",".secretlintrc.js",".secretlintrc.mjs",".secretlintrc.cjs",".secretlintrc.yml",".secretlintrc.yaml"],S=[".syncpackrc",".syncpackrc.json",".syncpackrc.yaml",".syncpackrc.yml",".syncpackrc.cjs",".syncpackrc.js",".syncpackrc.mjs",".syncpackrc.ts","syncpack.config.cjs","syncpack.config.js","syncpack.config.mjs","syncpack.config.ts"],M=l(n=>{const s=i(n,"package.json");if(!a(s))return[];let o;try{o=JSON.parse(f(s))}catch{return[]}const e=[];if(o.scripts)for(const[t,c]of Object.entries(o.scripts))typeof c=="string"&&(/\bgitleaks\b/.test(c)&&e.push({detail:`Script "${t}" still invokes gitleaks: ${c}`,kind:"script",location:"package.json",tool:"gitleaks"}),/\bsecretlint\b/.test(c)&&e.push({detail:`Script "${t}" still invokes secretlint: ${c}`,kind:"script",location:"package.json",tool:"secretlint"}),/\bsyncpack\b/.test(c)&&e.push({detail:`Script "${t}" still invokes syncpack: ${c}`,kind:"script",location:"package.json",tool:"syncpack"}),/\bsherif\b/.test(c)&&e.push({detail:`Script "${t}" still invokes sherif: ${c}`,kind:"script",location:"package.json",tool:"sherif"}));if(o.devDependencies)for(const t of Object.keys(o.devDependencies))(t==="gitleaks"||t==="@gitleaks/cli")&&e.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"gitleaks"}),(t==="secretlint"||t.startsWith("@secretlint/"))&&e.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"secretlint"}),t==="syncpack"&&e.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"syncpack"}),t==="sherif"&&e.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"sherif"});return o.sherif&&e.push({detail:"`sherif` config block still present in package.json",kind:"config",location:"package.json",tool:"sherif"}),e},"scanPackageJson"),O=l(n=>{const s=[];for(const o of _){const e=i(n,o);if(!a(e))continue;const t=f(e);/\bgitleaks\b/.test(t)&&s.push({detail:"gitleaks invocation still present in hook",kind:"hook",location:o,tool:"gitleaks"}),/\bsecretlint\b/.test(t)&&s.push({detail:"secretlint invocation still present in hook",kind:"hook",location:o,tool:"secretlint"}),/\bsyncpack\b/.test(t)&&s.push({detail:"syncpack invocation still present in hook",kind:"hook",location:o,tool:"syncpack"}),/\bsherif\b/.test(t)&&s.push({detail:"sherif invocation still present in hook",kind:"hook",location:o,tool:"sherif"})}return s},"scanHooks"),C=l(n=>{const s=[];for(const o of D)a(i(n,o))&&s.push({detail:"secretlint config should be removed after migration",kind:"config",location:o,tool:"secretlint"});for(const o of S)a(i(n,o))&&s.push({detail:"syncpack config should be removed after migration",kind:"config",location:o,tool:"syncpack"});return s},"scanConfigs"),N=[".github/workflows",".gitlab-ci.yml",".circleci/config.yml",".woodpecker.yml",".drone.yml"],q=l(n=>{const s=[],o=l(e=>{const t=i(n,e);if(!a(t))return;const c=f(t);/\bsyncpack\b/.test(c)&&s.push({detail:"syncpack invocation still present in CI",kind:"ci",location:e,tool:"syncpack"}),/\bsherif\b/.test(c)&&s.push({detail:"sherif invocation still present in CI",kind:"ci",location:e,tool:"sherif"})},"scanFile");for(const e of N){const t=i(n,e);if(a(t)){if(e===".github/workflows"){try{for(const c of v(t))(c.endsWith(".yml")||c.endsWith(".yaml"))&&o(`.github/workflows/${c}`)}catch{}continue}o(e)}}return s},"scanCi"),I=l(n=>{const s=[],o=i(n,"pnpm-workspace.yaml");if(a(o)){let t;try{t=$(o)}catch{t=void 0}if(t&&typeof t=="object"){const c=t.catalog;c&&typeof c.syncpack=="string"&&s.push({detail:"`syncpack` still listed in pnpm-workspace.yaml#catalog",kind:"catalog",location:"pnpm-workspace.yaml",tool:"syncpack"});const r=t.catalogs;if(r&&typeof r=="object")for(const[d,p]of Object.entries(r))p&&typeof p.syncpack=="string"&&s.push({detail:`\`syncpack\` still listed in pnpm-workspace.yaml#catalogs.${d}`,kind:"catalog",location:"pnpm-workspace.yaml",tool:"syncpack"})}}const e=i(n,"package.json");if(a(e)){let t;try{t=JSON.parse(f(e))}catch{return s}const c=t.workspaces;if(c&&typeof c=="object"&&!Array.isArray(c)){const d=c.catalog;d&&typeof d.syncpack=="string"&&s.push({detail:"`syncpack` still listed in package.json#workspaces.catalog",kind:"catalog",location:"package.json",tool:"syncpack"});const p=c.catalogs;if(p&&typeof p=="object")for(const[h,y]of Object.entries(p))y&&typeof y.syncpack=="string"&&s.push({detail:`\`syncpack\` still listed in package.json#workspaces.catalogs.${h}`,kind:"catalog",location:"package.json",tool:"syncpack"})}const r=t.catalog;r&&typeof r.syncpack=="string"&&s.push({detail:"`syncpack` still listed in package.json#catalog",kind:"catalog",location:"package.json",tool:"syncpack"})}return s},"scanCatalogs"),J=l(n=>[...M(n),...O(n),...C(n),...q(n),...I(n)],"scanMigrationLeftovers"),B=l((n,s)=>{const o=J(n);if(o.length===0)return s.info("✓ No unmigrated gitleaks/secretlint/sherif/syncpack references found."),[];s.warn(`Found ${String(o.length)} unmigrated reference(s):`);for(const e of o)s.warn(` [${e.kind}] ${e.location} — ${e.detail}`);return o},"verifyMigration");export{J as s,B as v};
@@ -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{useWindowSize as ae,Box as i,Spinner as me,Text as e,ScrollView as we,Tabs as ye,Tab as be,ScrollBar as Ce,useApp as ke,useInput as xe,Dialog as ee}from"@visulima/tui";import{useSyncExternalStore as Te,useState as L,useRef as W,useMemo as Se,useCallback as de,useEffect as ve}from"react";import{B as se,aG as he}from"../packem_chunks/bin.js";import{u as Ae}from"./use-measured-height-DjYgUOKk.js";var Re=Object.defineProperty,Ee=T((s,l)=>Re(s,"name",{value:l,configurable:!0}),"d$2");const tr=Ee(({current:s,total:l})=>{const{columns:h}=ae(),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),f=Math.round(b*p),m=b-f;return t(i,{flexDirection:"column",paddingX:1,children:[t(i,{children:[r(me,{type:"dots"}),r(e,{children:" Checking catalog dependencies "}),r(e,{dimColor:!0,children:y})]}),t(i,{children:[r(e,{color:"cyan",children:"━".repeat(f)}),r(e,{dimColor:!0,children:"─".repeat(m)}),t(e,{dimColor:!0,children:[" ",a]})]})]})},"CheckProgressApp");var Ie=Object.defineProperty,G=T((s,l)=>Ie(s,"name",{value:l,configurable:!0}),"r");const Q=G(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"),_=G((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 lr{static{T(this,"UpdateStore")}static{G(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:Q(l),phase:"browsing",selectedIndex:0}}getSnapshot=G(()=>this.#e,"getSnapshot");subscribe=G(l=>(this.#l.add(l),()=>{this.#l.delete(l)}),"subscribe");getFilteredEntries(){return _(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=_(this.#t,l,this.#e.filterText);this.#r({...this.#e,entries:h,filterType:l,groupedByCatalog:Q(h),selectedIndex:0})}}setFilter(l){const h=_(this.#t,this.#e.filterType,l);this.#r({...this.#e,entries:h,filterText:l,groupedByCatalog:Q(h),selectedIndex:0})}setFilterActive(l){if(l!==this.#e.filterActive)if(l)this.#r({...this.#e,filterActive:!0});else{const h=_(this.#t,this.#e.filterType,"");this.#r({...this.#e,entries:h,filterActive:!1,filterText:"",groupedByCatalog:Q(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 De=Object.defineProperty,Be=T((s,l)=>De(s,"name",{value:l,configurable:!0}),"d");const Ne={major:"red",minor:"yellow",patch:"green"},Pe={CRITICAL:"red",HIGH:"red",LOW:"gray",MODERATE:"yellow",UNKNOWN:"gray"},Le={critical:"red",high:"red",low:"gray",medium:"yellow"},Me={critical:"red",high:"red",low:"green",medium:"yellow"},je={defer:"gray",review:"yellow",skip:"red",update:"green"},Fe=Be(({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=Ne[l.updateType]??"white",b=l.vulnerabilities&&l.vulnerabilities.length>0,f=l.socketReport?.score.overall??0,m=l.socketReport?se(f):"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(we,{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:Pe[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:m,children:[String(Math.round(f*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:Le[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:je[c.action]??"white",children:c.action})]}),t(i,{children:[r(e,{dimColor:!0,children:"Risk: "}),r(e,{bold:!0,color:Me[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 $e=Object.defineProperty,re=T((s,l)=>$e(s,"name",{value:l,configurable:!0}),"f");const Oe={major:"red",minor:"yellow",patch:"green"},Ue=[{id:"all",label:"All"},{id:"major",label:"Major"},{id:"minor",label:"Minor"},{id:"patch",label:"Patch"},{id:"security",label:"Security"}],Ge=re(({checked:s,entry:l,isSelected:h})=>{const c=Oe[l.updateType]??"white",p=l.vulnerabilities&&l.vulnerabilities.length>0,a=l.socketReport&&l.socketReport.alerts.length>0,y=!!l.acceptedRisk,b=s?"☑":"☐",f=l.socketReport?`${String(Math.round(l.socketReport.score.overall*100))}%`:"",m=l.socketReport?se(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]":""]})}),f&&t(e,{color:m,children:[" ",f]}),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"),He=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"),Ve=re(({checkedEntries:s,entries:l,filterActive:h,filteredOutCount:c,filterText:p,filterType:a,focused:y,groupedByCatalog:b,isDryRun:f,onViewportHeightChange:m,scrollOffset:o,selectedIndex:I,totalCatalogEntries:D,totalChecked:v,totalEntries:H,viewportHeight:M})=>{const j=y?"white":"gray",{measuredHeight:w,ref:A}=Ae(M,m);let F=0,S=0,B=0,R=0;for(const g of l)g.updateType==="major"?F++:g.updateType==="minor"?S++:B++,(g.vulnerabilities&&g.vulnerabilities.length>0||g.socketReport&&g.socketReport.alerts.length>0)&&R++;const k=[];F>0&&k.push(`${F} 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 V=0;for(const[g,E]of b){C.push(r(He,{count:E.length,name:g},`hdr-${g}`));for(const O of E){const P=V;C.push(r(Ge,{checked:s.has(O.packageName),entry:O,isSelected:P===I},O.packageName)),V++}}let $=0;for(const[,g]of b)$+=2+g.length;const q=$>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:[H,v>0?`/${v}`:""," ","outdated",N,D>v?` · ${D-v} dupes`:""]}),!f&&x>0&&t(e,{dimColor:!0,children:[" ","—",x," ","selected"]})]}),r(i,{flexShrink:0,paddingX:1,paddingY:1,children:r(ye,{isFocused:y,keyMap:{next:[],previous:[],useNumbers:!1,useTab:!1},onChange:T(()=>{},"onChange"),showIndex:!1,value:a,children:Ue.map(({id:g,label:E})=>r(be,{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})}),q&&r(i,{flexShrink:0,marginLeft:1,marginRight:1,children:r(Ce,{contentHeight:$,placement:"inset",scrollOffset:o,style:"block",viewportHeight:w})})]},`list-${a}-${p}`)]})},"PackageListPanel");var qe=Object.defineProperty,Ke=T((s,l)=>qe(s,"name",{value:l,configurable:!0}),"K");const Xe=100,Ye=40,ze=10,We=[],ir=Ke(({autoExitSeconds:s=0,changelogUrls:l,checkedCount:h=0,filteredOutEntries:c=We,isDryRun:p,store:a,totalCatalogEntries:y=0})=>{const{exit:b}=ke(),{columns:f,rows:m}=ae(),o=Te(a.subscribe,a.getSnapshot),[I,D]=L(!1),[v,H]=L(!1),M=W(null),j=W(null),w=W(null),A=W(null),[F,S]=L(0),[B,R]=L(!1),[k,N]=L(!1),x=Se(()=>a.getFilteredEntries(),[o.entries,o.filterType,o.filterText]),C=x[o.selectedIndex]??null,V=C?a.getRecommendation(C.packageName):void 0,$=C&&l?l.get(C.packageName):void 0,q=de(n=>{let d=0,u=0;for(const[,Y]of o.groupedByCatalog){d+=2;for(let z=0;z<Y.length;z++){if(u===n)return d;d+=1,u++}}return d},[o.groupedByCatalog]),g=Math.max(1,m-8-(o.filterActive?1:0)),[E,O]=L(g),P=E>0?E:g,U=de(n=>{const d=q(n);S(u=>d>u+P-2?Math.max(0,d-P+2):d<u+1?Math.max(0,d-1):u)},[q,P]);if(ve(()=>{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"?H(!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=["all","major","minor","patch","security"],Y=u.indexOf(o.filterType),z=d.rightArrow?(Y+1)%u.length:(Y-1+u.length)%u.length;S(0),w.current?.scrollToTop(),a.setFilterType(u[z]);return}if(n==="f"&&c.length>0){H(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}),f<Ye||m<ze)return r(i,{alignItems:"center",height:m,justifyContent:"center",width:f,children:t(e,{color:"yellow",children:["Terminal too small (",f,"x",m,")"]})});const ue=f>=Xe,K=[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&&K.push(t(i,{gap:1,children:[r(e,{bold:!0,color:"green",children:"u"}),r(e,{dimColor:!0,children:"APPLY"})]},"u")),c.length>0&&K.push(t(i,{gap:1,children:[r(e,{bold:!0,color:"yellow",children:"f"}),t(e,{dimColor:!0,children:["FILTERED (",c.length,")"]})]},"fo")),K.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:K})}),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"})]})]})]}),X=a.getCheckedEntries(),J=X.filter(n=>n.updateType==="major").length,pe=t(i,{alignItems:"center",flexDirection:"column",children:[J>0&&r(i,{marginBottom:1,marginTop:1,children:t(e,{color:"yellow",children:["⚠"," ",J," ","major update",J===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:pe,scrollRef:A,title:`Apply ${X.length} update${X.length===1?"":"s"}?`,visible:B,width:70,children:X.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(Ve,{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:F,selectedIndex:o.selectedIndex,totalCatalogEntries:y,totalChecked:h,totalEntries:x.length,viewportHeight:P}),ce=r(Fe,{changelogUrl:$,entry:C,focused:o.focusedPanel==="detail",recommendation:V,scrollRef:w});if(ue){const n=Math.floor(f*.35);return t(i,{flexDirection:"column",height:m,width:f,children:[t(i,{flexDirection:"row",flexGrow:1,children:[r(i,{flexGrow:1,children:ne}),r(i,{width:n,children:ce})]}),te,ie,oe,r(he,{autoExitSeconds:s||3,onCancel:T(()=>{N(!1)},"onCancel"),visible:k}),le]})}const ge=Math.floor(m*.55);return t(i,{flexDirection:"column",height:m,width:f,children:[r(i,{height:ge,children:ne}),r(i,{flexGrow:1,children:ce}),te,ie,oe,r(he,{autoExitSeconds:s||3,onCancel:T(()=>{N(!1)},"onCancel"),visible:k}),le]})},"VisUpdateApp");export{ir as B,tr as T,lr as U};