@visulima/vis 6.1.0 → 6.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +49 -0
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/config/index.d.ts +1226 -1216
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/cargo-lock.js +5 -0
- package/dist/packem_chunks/cargo-plan.js +3 -3
- package/dist/packem_chunks/catalog-detector.js +1 -1
- package/dist/packem_chunks/catalog.js +1 -94
- package/dist/packem_chunks/catalog2.js +11 -0
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +156 -174
- package/dist/packem_chunks/context.js +8 -0
- package/dist/packem_chunks/fix.js +1 -1
- package/dist/packem_chunks/handler10.js +1 -1
- package/dist/packem_chunks/handler12.js +1 -1
- package/dist/packem_chunks/handler13.js +1 -1
- package/dist/packem_chunks/handler14.js +1 -1
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler19.js +5 -5
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +1 -1
- package/dist/packem_chunks/handler21.js +1 -1
- package/dist/packem_chunks/handler23.js +1 -1
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler25.js +1 -1
- package/dist/packem_chunks/handler28.js +1 -1
- package/dist/packem_chunks/handler3.js +1 -1
- package/dist/packem_chunks/handler31.js +1 -1
- package/dist/packem_chunks/handler32.js +1 -1
- package/dist/packem_chunks/handler33.js +1 -1
- package/dist/packem_chunks/handler34.js +3 -3
- package/dist/packem_chunks/handler35.js +1 -1
- package/dist/packem_chunks/handler36.js +1 -1
- package/dist/packem_chunks/handler38.js +2 -2
- package/dist/packem_chunks/handler39.js +5 -5
- package/dist/packem_chunks/handler4.js +4 -4
- package/dist/packem_chunks/handler40.js +1 -1
- package/dist/packem_chunks/handler41.js +1 -1
- package/dist/packem_chunks/handler42.js +1 -1
- package/dist/packem_chunks/handler43.js +1 -1
- package/dist/packem_chunks/handler44.js +1 -1
- package/dist/packem_chunks/handler45.js +1 -1
- package/dist/packem_chunks/handler46.js +1 -1
- package/dist/packem_chunks/handler47.js +1 -1
- package/dist/packem_chunks/handler48.js +1 -1
- package/dist/packem_chunks/handler49.js +1 -1
- package/dist/packem_chunks/handler5.js +4 -4
- package/dist/packem_chunks/handler50.js +5 -5
- package/dist/packem_chunks/handler52.js +1 -1
- package/dist/packem_chunks/handler54.js +2 -2
- package/dist/packem_chunks/handler55.js +1 -1
- package/dist/packem_chunks/handler56.js +3 -3
- package/dist/packem_chunks/handler57.js +4 -4
- package/dist/packem_chunks/handler58.js +4 -4
- package/dist/packem_chunks/handler59.js +2 -2
- package/dist/packem_chunks/handler6.js +7 -7
- package/dist/packem_chunks/handler60.js +1 -1
- package/dist/packem_chunks/handler61.js +2 -2
- package/dist/packem_chunks/handler62.js +1 -1
- package/dist/packem_chunks/handler63.js +3 -3
- package/dist/packem_chunks/handler64.js +3 -3
- package/dist/packem_chunks/handler65.js +2 -2
- package/dist/packem_chunks/handler66.js +2 -2
- package/dist/packem_chunks/handler67.js +5 -5
- package/dist/packem_chunks/handler68.js +12 -25
- package/dist/packem_chunks/handler69.js +25 -22
- package/dist/packem_chunks/handler70.js +22 -10
- package/dist/packem_chunks/handler71.js +10 -133
- package/dist/packem_chunks/handler72.js +133 -23
- package/dist/packem_chunks/handler73.js +23 -323
- package/dist/packem_chunks/handler74.js +274 -659
- package/dist/packem_chunks/handler75.js +708 -48
- package/dist/packem_chunks/handler76.js +48 -27
- package/dist/packem_chunks/handler77.js +27 -3
- package/dist/packem_chunks/handler78.js +3 -191
- package/dist/packem_chunks/handler79.js +191 -0
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/heal.js +2 -2
- package/dist/packem_chunks/help-command.js +1 -1
- package/dist/packem_chunks/index2.js +3 -58
- package/dist/packem_chunks/index3.js +40 -3
- package/dist/packem_chunks/index6.js +135 -7
- package/dist/packem_chunks/index7.js +7 -135
- package/dist/packem_chunks/keys-refresh.js +1 -1
- package/dist/packem_chunks/list.js +2 -2
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/python-plan.js +3 -3
- package/dist/packem_chunks/python-projects.js +1 -1
- package/dist/packem_chunks/python.js +1 -0
- package/dist/packem_chunks/run.js +1 -1
- package/dist/packem_chunks/snapshot.js +2 -2
- package/dist/packem_chunks/state.js +2 -2
- package/dist/packem_chunks/status.js +1 -1
- package/dist/packem_chunks/sync.js +1 -1
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_chunks/version-resolver.js +1 -1
- package/dist/packem_chunks/workspace.js +2 -2
- package/dist/packem_shared/ReleaseClient-CWD9BC5w.js +1 -0
- package/dist/packem_shared/advisories-DO-P0V1_.js +1 -0
- package/dist/packem_shared/{affected-selection-DGb6Xu5K.js → affected-selection-CeeZo7Uy.js} +1 -1
- package/dist/packem_shared/{ai-analysis-pldoS_N4.js → ai-analysis-BCJ1kuDM.js} +3 -3
- package/dist/packem_shared/ai-cache-iSIyY3So.js +1 -0
- package/dist/packem_shared/{ai-fix-D9MxigBQ.js → ai-fix-DIMErSws.js} +6 -6
- package/dist/packem_shared/apply-DoeQAAGm.js +6 -0
- package/dist/packem_shared/apply-release-plan-BalHtK-g.js +15 -0
- package/dist/packem_shared/{bin-AZQv95jh.js → bin-BcLTer1k.js} +1 -1
- package/dist/packem_shared/clean-package-json-rutwkKl-.js +1 -0
- package/dist/packem_shared/createAdapter-DMK4bBET.js +1 -0
- package/dist/packem_shared/createVersionActions-DXo4z8VN.js +1 -0
- package/dist/packem_shared/dependency-scan-D_v3KM59.js +1 -0
- package/dist/packem_shared/{ecosystem-gate-DiqQj0LJ.js → ecosystem-gate-CwsTc7YW.js} +1 -1
- package/dist/packem_shared/env-BSXG3QKH.js +4 -0
- package/dist/packem_shared/failure-log-DIsKBKaI.js +2 -0
- package/dist/packem_shared/formatBytes-_HvjOy8a-iHCer6uX.js +1 -0
- package/dist/packem_shared/glob-Cyk1H9ZL-CL9optrn.js +1 -0
- package/dist/packem_shared/{index-JRb5wabN.js → index-9Ot7jTd4.js} +1 -1
- package/dist/packem_shared/index-BS6A9QR_.js +1 -0
- package/dist/packem_shared/lifecycle-CQjeMPY0.js +2 -0
- package/dist/packem_shared/missing-package-json-1BIoWQq0.js +1 -0
- package/dist/packem_shared/multi-eco-lockfiles-fgkpeHJv.js +1 -0
- package/dist/packem_shared/npmrc-CHsOyMvA.js +2 -0
- package/dist/packem_shared/osv-Do9PMOea.js +1 -0
- package/dist/packem_shared/{package-version-KLwH0Ivy.js → package-version-Bq6Cne_7.js} +1 -1
- package/dist/packem_shared/packument-CbTmbHU4.js +1 -0
- package/dist/packem_shared/{project-name-filter-B1ZCsbOW.js → project-name-filter-ZQaLgytG.js} +1 -1
- package/dist/packem_shared/{provenance-L1M2FPy_.js → provenance-SX1MxPUZ.js} +1 -1
- package/dist/packem_shared/publish-Dc0XGH3K.js +34 -0
- package/dist/packem_shared/registry-Dg9XI6RT.js +81 -0
- package/dist/packem_shared/registry-keys-z038Ecb4.js +1 -0
- package/dist/packem_shared/removeSync-g1D5kONg-LbjATA8v.js +1 -0
- package/dist/packem_shared/renderToString-DR0zDUjh-DXppT6AM.js +3 -0
- package/dist/packem_shared/{resolve-explicit-CQa37JSq.js → resolve-explicit-D9kdTNvl.js} +1 -1
- package/dist/packem_shared/{run-D-uVGHQ4.js → run-DLvd3RIZ.js} +1 -1
- package/dist/packem_shared/run-summary-utils-CMeURYtS.js +1 -0
- package/dist/packem_shared/s1ngularity-BuU9Cxpy.js +1 -0
- package/dist/packem_shared/{scaffold-files-DVyfB0yz.js → scaffold-files-DJlz36Mu.js} +1 -1
- package/dist/packem_shared/scan-progress-DymX71_5.js +2 -0
- package/dist/packem_shared/{signatures-DIqFUOfs.js → signatures-CeL0bOEo.js} +1 -1
- package/dist/packem_shared/spinner-CPoBymcv.js +1 -0
- package/dist/packem_shared/table-oA7p7-yP.js +1 -0
- package/dist/packem_shared/tabs-BiSifphV.js +1 -0
- package/dist/packem_shared/{task-env-DzR4RkOj.js → task-env-C2lmxvzA.js} +1 -1
- package/dist/packem_shared/typosquats-BFKus_aM.js +1 -0
- package/dist/packem_shared/use-measured-height-BHm-HiSF.js +1 -0
- package/dist/packem_shared/vis-update-app-6QOYxnNx.js +1 -0
- package/dist/packem_shared/{vis-user-error-CRmrBaD1.js → vis-user-error-3YS7sPYy.js} +1 -1
- package/dist/packem_shared/{watch-loop-D1_e-qIl.js → watch-loop-CGi66Fs0.js} +1 -1
- package/dist/packem_shared/xxh3-BLHlvhgT.js +1 -0
- package/dist/release/core/package-managers/index.js +1 -1
- package/dist/release/core/version-actions/index.js +1 -1
- package/dist/release/index.js +1 -1
- package/index.js +26 -26
- package/package.json +9 -9
- package/dist/packem_chunks/orchestrator.js +0 -46
- package/dist/packem_shared/ReleaseClient-DAvbxCdo.js +0 -1
- package/dist/packem_shared/createAdapter-F7GidOzU.js +0 -1
- package/dist/packem_shared/createVersionActions-ByaJ1Nbv.js +0 -1
- package/dist/packem_shared/dependency-scan-CawAKoU_.js +0 -1
- package/dist/packem_shared/failure-log-BP-gCUb5.js +0 -2
- package/dist/packem_shared/formatBytes-_HvjOy8a-B_qQr4Hw.js +0 -4
- package/dist/packem_shared/glob-Cyk1H9ZL-Dxlf9Swz.js +0 -1
- package/dist/packem_shared/index-CDHP1kby.js +0 -1
- package/dist/packem_shared/lifecycle-DvmDIRbb.js +0 -2
- package/dist/packem_shared/missing-package-json-Cu5YVAot.js +0 -1
- package/dist/packem_shared/multi-eco-lockfiles-B2X3yhyo.js +0 -1
- package/dist/packem_shared/packument-zb18Jnlw.js +0 -1
- package/dist/packem_shared/registry-keys-DxdqMzyp.js +0 -1
- package/dist/packem_shared/s1ngularity-CO5GkkqX.js +0 -1
- package/dist/packem_shared/scan-progress-RwCRxJdX.js +0 -2
- package/dist/packem_shared/spinner-BJjbNl1F.js +0 -1
- package/dist/packem_shared/tabs--uxJGL8N.js +0 -1
- package/dist/packem_shared/typosquats-D4DEHhFy.js +0 -1
- package/dist/packem_shared/use-measured-height-DUZyyias.js +0 -1
- package/dist/packem_shared/vis-update-app-9b2kSk9f.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as ze}from"node:module";import{e as M,z as Fe}from"./index-BzhrR_iC.js";import{r as qe}from"./docker-DXqV-07f.js";import{parse as We}from"../packem_chunks/index4.js";import Re from"../packem_chunks/index.js";import{b as fe,l as Ke,a as Ze,d as Qe,e as en,f as nn,g as tn}from"./multi-eco-lockfiles-
|
|
1
|
+
import{createRequire as ze}from"node:module";import{e as M,z as Fe}from"./index-BzhrR_iC.js";import{r as qe}from"./docker-DXqV-07f.js";import{parse as We}from"../packem_chunks/index4.js";import Re from"../packem_chunks/index.js";import{b as fe,l as Ke,a as Ze,d as Qe,e as en,f as nn,g as tn}from"./multi-eco-lockfiles-fgkpeHJv.js";import{p as ke,r as ue,c as sn}from"./composer-DR3D-Psb.js";import{p as Ie}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";import{e as on}from"./license-DvlYdo6T.js";import{S as rn}from"./lockfile-DhHAaHN5.js";import{a as cn}from"./index-B4AjSxHU.js";import{V as Le}from"./vis-user-error-3YS7sPYy.js";import{w as an,r as pn,Z as Ce}from"./zig-manifest-P7ydLEOa.js";let He;const Ve=e=>(He??=ze(import.meta.url))(e),ee=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,be=e=>{if(typeof ee<"u"&&ee.versions&&ee.versions.node){const[t,n]=ee.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return ee.getBuiltinModule(e)}return Ve(e)},{randomUUID:Be}=be("node:crypto"),{readFileSync:G,readdirSync:Pe,statSync:Xe,existsSync:Je}=be("node:fs"),{join:A,relative:$e,resolve:De,basename:Ye}=be("node:path"),ne=e=>e.replaceAll(/[^\w.~-]/g,t=>`%${(t.codePointAt(0)??0).toString(16).toUpperCase().padStart(2,"0")}`),j=(e,t)=>{const n=e.toLowerCase();if(n.startsWith("@")){const s=n.indexOf("/");if(s>0){const o=n.slice(0,s),r=n.slice(s+1);return`pkg:npm/${ne(o)}/${ne(r)}@${ne(t)}`}}return`pkg:npm/${ne(n)}@${ne(t)}`},_={ARRAY:"array",BOOLEAN:"boolean",DATE:"date",FUNCTION:"function",JSTOXML_OBJECT:"jstoxml-object",NULL:"null",NUMBER:"number",OBJECT:"object",STRING:"string"},ln=[_.STRING,_.NUMBER,_.BOOLEAN],un='<?xml version="1.0" encoding="UTF-8"?>',Ee=["_selfCloseTag","_attrs"],fn=(e="",t=0)=>e.repeat(t),pe=e=>Array.isArray(e)&&_.ARRAY||typeof e===_.OBJECT&&e!==null&&e._name&&_.JSTOXML_OBJECT||e instanceof Date&&_.DATE||e===null&&_.NULL||typeof e,Ue=e=>e.startsWith("<![CDATA["),je=(e="",t={},n)=>{let s=e;if(typeof e===_.STRING){if(Ue(e))return e;const o=new RegExp(`(${Object.keys(t).join("|")})(?!(\\w|#)*;)`,"g");s=String(e).replace(o,(r,l)=>t[l]||"")}return typeof n=="function"?n(s):s},dn=(e={},t,n,s)=>(Array.isArray(e)?e:Object.entries(e).map(([r,l])=>({[r]:l}))).reduce((r,l)=>{const c=Object.keys(l)[0],i=l[c];if(typeof n===_.FUNCTION&&n(c,i))return r;const a=t?je(i,t):i,f=!s&&a===!0?"":`="${a}"`;return r.push(`${c}${f}`),r},[]),mn=(e={},t,n,s)=>{const o=dn(e,t,n,s);return o.length===0?"":` ${o.join(" ")}`},hn=(e={})=>Object.keys(e).map(t=>({_name:t,_content:e[t]})),gn=e=>ln.includes(pe(e)),vn=e=>!e.match("<"),yn=({header:e,isOutputStart:t})=>e&&t?typeof e===_.BOOLEAN?un:e:"",Ae={"<":"<",">":">","&":"&",'"':"""},q=(e={},t={})=>{const{depth:n=0,indent:s,_isFirstItem:o,_isOutputStart:r=!0,header:l,attributeReplacements:c={},attributeFilter:i,attributeExplicitTrue:a=!1,contentReplacements:f={},contentMap:g,selfCloseTags:y=!0}=t,X=typeof c=="boolean"&&!c?{}:{...Ae,...c},z=typeof f=="boolean"&&!f?{}:{...Ae,...f},N=typeof s=="string",H=fn(s,n),J=pe(e),Y=yn({header:l,isOutputStart:r}),O=r&&!Y&&o&&n===0,V=N&&!O?`
|
|
2
2
|
`:"";let k="";switch(J){case _.JSTOXML_OBJECT:{const{_name:b,_content:S}=e;if(S===null&&typeof g!="function"){k=`${V}${H}${b}`;break}if(Array.isArray(S)&&S.every(gn))return S.map(ae=>q({_name:b,_content:ae},{...t,depth:n,_isOutputStart:!1})).join("");if(Ee.includes(b))break;const $=q(S,{...t,depth:n+1,_isOutputStart:O}),B=pe($),E=vn($),oe=Ue($),T=`${V}${H}`;if(b==="_comment"){k+=`${T}<!-- ${S} -->`;break}const R=B==="undefined"||$==="",D=y,W=e._selfCloseTag,K=typeof W===_.BOOLEAN?R&&W:R&&D,I=K?"/":"",re=mn(e._attrs,X,i,a),Z=`<${b}${re}${I}>`,ce=N&&!E&&!oe?`
|
|
3
3
|
${H}`:"",ie=K?"":`${$}${ce}</${b}>`;k+=`${T}${Z}${ie}`;break}case _.OBJECT:{const b=Object.keys(e);k=b.map((v,$)=>{const B={...t,_isFirstItem:$===0,_isLastItem:$+1===b.length,_isOutputStart:O},E={_name:v};if(pe(e[v])===_.OBJECT&&(Ee.forEach(R=>{const D=e[v][R];typeof D<"u"&&(E[R]=D,delete e[v][R])}),typeof e[v]._content<"u"&&Object.keys(e[v]).length>1)){const R=Object.assign({},e[v]);delete R._content,E._content=[...hn(R),e[v]._content]}return typeof E._content>"u"&&(E._content=e[v]),q(E,B)},t).join("");break}case _.FUNCTION:{const b=e(t);k=q(b,t);break}case _.ARRAY:{k=e.map((S,v)=>{const $={...t,_isFirstItem:v===0,_isLastItem:v+1===e.length,_isOutputStart:O};return q(S,$)}).join("");break}default:{k=je(e,z,g);break}}return`${Y}${k}`},_n=(e,t)=>`pkg:cargo/${encodeURIComponent(e)}@${encodeURIComponent(t)}`,se=e=>e,bn=e=>{const t=e.split(" ")[0];if(t===void 0||t==="")return;const n=/^\S+\s+(\d[^\s(]*)/.exec(e)?.[1],s=/\(([^)]+)\)/.exec(e)?.[1];return{kind:"main",name:t,source:s,version:n}},$n=e=>{const t=[];let n,s=!1;const o=()=>{n?.name!==void 0&&n.version!==void 0&&t.push({deps:n.deps,member:n.source===void 0,name:n.name,source:n.source,version:n.version})};for(const r of e.split(`
|
|
4
4
|
`)){const l=r.trim();if(l==="[[package]]"){o(),n={deps:[]},s=!1;continue}if(n===void 0)continue;if(s){const i=/^"([^"]+)",?$/.exec(l);if(i){const a=bn(i[1]);a!==void 0&&n.deps.push(a)}else l==="]"&&(s=!1);continue}if(l==="dependencies = ["){s=!0;continue}const c=/^(name|version|source)\s*=\s*"([^"]*)"$/.exec(l);if(c){const[,i="",a=""]=c;i==="name"?n.name=a:i==="version"?n.version=a:n.source=a}}return o(),t},Cn=(e,t)=>{const n=typeof t=="object"&&t!==null?t.package:void 0;return typeof n=="string"?n:e},Sn=(e,t)=>{const n=Array.isArray(t.workspace?.members)?t.workspace.members.filter(r=>typeof r=="string"):[],s=Array.isArray(t.workspace?.exclude)?t.workspace.exclude.filter(r=>typeof r=="string"):[],o=new Set;for(const r of n){let l=[e];for(const c of r.split("/").filter(i=>i!==""&&i!==".")){const i=[];for(const a of l){if(!/[*?[{]/.test(c)){i.push(A(a,c));continue}let f;try{f=Pe(a)}catch{f=[]}for(const g of f){const y=A(a,g);Re(c,g)&&Xe(y).isDirectory()&&i.push(y)}}l=i}for(const c of l){const i=c.slice(e.length+1).split("\\").join("/");s.some(a=>Re(a,i))||o.add(c)}}return[...o]},Rn=e=>{const t=new Map;let n;try{n=Oe(G(A(e,"Cargo.toml"),"utf8"))}catch{return t}const s=Sn(e,n);n.package?.name!==void 0&&s.push(e);for(const o of s){let r;try{r=Oe(G(A(o,"Cargo.toml"),"utf8"))}catch{continue}if(typeof r.package?.name!="string")continue;const l=new Set,c=i=>{for(const[a,f]of Object.entries(i??{}))l.add(se(Cn(a,f)))};c(r.dependencies),c(r["build-dependencies"]);for(const i of Object.values(r.target??{}))c(i.dependencies),c(i["build-dependencies"]);t.set(se(r.package.name),l)}return t},Oe=e=>We(e),kn=(e,t={})=>{let n;try{n=G(A(e,"Cargo.lock"),"utf8")}catch{return{components:[],dependencies:[]}}const s=Rn(e),o=$n(n).map(r=>{const l=r.member?s.get(se(r.name)):void 0;return l===void 0?r:{...r,deps:r.deps.map(c=>l.has(se(c.name))?c:{...c,kind:"dev"})}});return fe(o,{focusNames:t.focusNames,includeDev:t.includeDev,normalize:se,purl:_n})},En=(e,t)=>`pkg:composer/${e.split("/").map(n=>encodeURIComponent(n)).join("/")}@${encodeURIComponent(t)}`,te=e=>e.toLowerCase(),An=e=>{const t=[];for(const[n,s]of[["packages",!1],["packages-dev",!0]]){const o=e[n];if(Array.isArray(o))for(const r of o){if(typeof r.name!="string"||typeof r.version!="string")continue;const l=[...ue(r,"require").map(c=>({kind:s?"dev":"main",name:c})),...ue(r,"require-dev").map(c=>({kind:"dev",name:c}))];t.push({deps:l,member:!1,name:r.name,version:sn(r.version)})}}return t},On=(e,t={})=>{const n={components:[],dependencies:[]};let s,o;try{s=ke(G(A(e,"composer.lock"),"utf8")),o=ke(G(A(e,"composer.json"),"utf8"))}catch{return n}const r=typeof o.name=="string"?te(o.name):void 0;if(t.focusNames!==void 0&&!t.focusNames.some(i=>te(i)===r))return n;const l=new Set([...ue(o,"require"),...t.includeDev?ue(o,"require-dev"):[]].map(i=>te(i))),c=An(s).map(i=>({...i,member:l.has(te(i.name))}));return fe(c,{includeDev:t.includeDev,normalize:te,purl:En})},Te=e=>e.split("/").map(t=>encodeURIComponent(t)).join("/"),Tn={Go:(e,t)=>`pkg:golang/${Te(e)}@${encodeURIComponent(t)}`,Pub:(e,t)=>`pkg:pub/${encodeURIComponent(e)}@${encodeURIComponent(t)}`,SwiftURL:(e,t)=>`pkg:swift/${Te(e)}@${encodeURIComponent(t)}`},wn=(e,t)=>{const n=Ke(e,t).map(s=>{const o=Tn[t](s.name,s.version);return{"bom-ref":o,name:s.name,purl:o,type:"library",version:s.version}}).sort((s,o)=>(s["bom-ref"]??"").localeCompare(o["bom-ref"]??""));return{components:n,dependencies:n.map(s=>({ref:s["bom-ref"]??""}))}},xn=(e,t)=>`pkg:gem/${encodeURIComponent(e)}@${encodeURIComponent(t)}`,Nn=/^ {4}(\S+) \(([^()]+)\)\s*$/,Pn=/^ {6}(\S+)(?: \(.*\))?\s*$/,Dn=e=>{const t=new Map;let n,s,o;for(const r of e.split(/\r?\n/)){if(r.length>0&&!r.startsWith(" ")){n=r.trim(),s=void 0,o=void 0;continue}if(n!=="PATH"&&n!=="GEM"&&n!=="GIT")continue;const l=/^ {2}remote: (.+)$/.exec(r);if(l?.[1]!==void 0){s=l[1].trim();continue}const c=Nn.exec(r);if(c?.[1]!==void 0&&c[2]!==void 0){const a=c[1],f=c[2].split("-")[0]??c[2],g=n==="GIT"&&s!==void 0?`git:${s}`:void 0,y=`${a}\0${f}\0${g??""}`;o=t.get(y)??{deps:[],member:n==="PATH",name:a,source:g,version:f},t.set(y,o);continue}const i=Pn.exec(r);i?.[1]!==void 0&&o!==void 0&&o.deps.push({kind:"main",name:i[1]})}return[...t.values()]},In=(e,t={})=>{let n;try{n=G(A(e,"Gemfile.lock"),"utf8")}catch{return{components:[],dependencies:[]}}return fe(Dn(n),{focusNames:t.focusNames,includeDev:t.includeDev,normalize:s=>s,purl:xn})},ye=e=>{try{return Ie(e)}catch{return}},Ln=e=>{if(e.length===0||e.includes("..")||e.startsWith(".")||e.includes("\0")||e.includes("\\"))return!1;if(e.startsWith("@")){const t=e.indexOf("/");return t>1&&!e.includes("/",t+1)}return!e.includes("/")},Un=e=>e.length>0&&!e.includes("/")&&!e.includes("\\")&&!e.includes("..")&&!e.includes("\0"),jn=(e,t,n)=>{const o=`${t.replaceAll("/","+")}@${n}`,r=M(e,"node_modules",".pnpm"),l=ye(M(r,o,"node_modules",t,"package.json"));if(l)return l;let c;try{c=Pe(r)}catch{return}const i=`${o}_`;for(const a of c){if(!a.startsWith(i))continue;const f=ye(M(r,a,"node_modules",t,"package.json"));if(f)return f}},Mn=(e,t,n)=>{const s=ye(M(e,"node_modules",t,"package.json"));return s?.version===n?s:void 0},Gn=(e,t,n)=>{if(!(!Ln(t)||!Un(n)))return jn(e,t,n)??Mn(e,t,n)},zn={sha256:"SHA-256",sha384:"SHA-384",sha512:"SHA-512"},Hn={sha256:64,sha384:96,sha512:128},Vn=e=>{const t={name:e.name,version:e.version},{integrity:n}=e;return n&&n.hex.length===Hn[n.algorithm]&&(t.hash={alg:zn[n.algorithm],content:n.hex}),e.dependencies&&(t.dependencies=e.dependencies),e.peerDependencies&&(t.peerDependencies=e.peerDependencies),e.optionalDependencies&&(t.optionalDependencies=e.optionalDependencies),t},Bn=[{file:"pnpm-lock.yaml",type:"pnpm"},{file:"npm-shrinkwrap.json",type:"npm"},{file:"package-lock.json",type:"npm"},{file:"yarn.lock",type:"yarn"},{file:"bun.lock",type:"bun"}],Fn=e=>{for(const{file:t,type:n}of Bn){let s;try{s=Fe(M(e,t))}catch{continue}const o=new Map;for(const r of rn(s,n))o.set(`${r.name}@${r.version}`,Vn(r));return{packages:o,type:n}}},Me=e=>e.toLowerCase().replaceAll(/[-_.]+/g,"-"),qn=(e,t)=>`pkg:pypi/${encodeURIComponent(Me(e))}@${encodeURIComponent(t)}`,Xn=/^source\s*=\s*\{\s*(?:editable|virtual|directory)\s*=/,Jn=/\{\s*name\s*=\s*"([^"]+)"([^}]*)\}/,Yn=e=>{const t=[];let n,s="none",o=!1;const r=()=>{n?.name!==void 0&&n.version!==void 0&&t.push({deps:n.deps,member:n.member,name:n.name,source:n.source,version:n.version})};for(const l of e.split(`
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{createRequire as X}from"node:module";import{e as d}from"./index-BzhrR_iC.js";import{y as P}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{p as ae}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";import{h as ce}from"./writeFileSync-DJoHk3Ks-BPRoepNw.js";let Q;const ee=e=>(Q??=X(import.meta.url))(e),y=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,v=e=>{if(typeof y<"u"&&y.versions&&y.versions.node){const[n,t]=y.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return y.getBuiltinModule(e)}return ee(e)},{existsSync:te,readdirSync:O,statSync:ne,rmSync:L,writeFileSync:se}=v("node:fs"),{spawn:A}=v("node:child_process"),{createHash:ie}=v("node:crypto"),{homedir:oe,platform:re}=v("node:os"),ue=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],le=12288,de=65510,pe=[12288,12288,65281,65376,65504,65510],he=8361,fe=65518,we=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],me=32,ge=10630,Se=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],ye=4352,be=262141,z=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],b=(e,n)=>{let t=0,i=Math.floor(e.length/2)-1;for(;t<=i;){const a=Math.floor((t+i)/2),c=a*2;if(n<e[c])i=a-1;else if(n>e[c+1])t=a+1;else return!0}return!1},j=19968,[Ee,xe]=$e(z);function $e(e){let n=e[0],t=e[1];for(let i=0;i<e.length;i+=2){const a=e[i],c=e[i+1];if(j>=a&&j<=c)return[a,c];c-a>t-n&&(n=a,t=c)}return[n,t]}const ke=e=>e<161||e>1114109?!1:b(ue,e),ve=e=>e<le||e>de?!1:b(pe,e),Re=e=>e<he||e>fe?!1:b(we,e),Ie=e=>e<me||e>ge?!1:b(Se,e),We=e=>e>=Ee&&e<=xe?!0:e<ye||e>be?!1:b(z,e);function Me(e){return ke(e)?"ambiguous":ve(e)?"fullwidth":Re(e)?"halfwidth":Ie(e)?"narrow":We(e)?"wide":"neutral"}function _e(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function V(e){return _e(e),Me(e)}const H=String.raw,N=H`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Te=()=>new RegExp(H`\p{RI}{2}|(?)${N}(?:\u200D${N})*`,"gu"),st=new Set(["\x1B",""]),it="\x07",ot="]8;;",rt=/[\u200B\uFEFF\u2060-\u2064]/g,K=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\)|\][^\u0007\u001B]{0,1000}(?:\u0007|\u001B\\))/g,at=/\u001B\[[\d;]*m[^\u001B]*(?:\u001B\[[\d;]*m|$)/g,ct=/\u001B\]8;[^\u0007\u001B]*(?:\u0007|\u001B\\)[^\u001B]*\u001B\]8;;(?:\u0007|\u001B\\)/g,x=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,q=Te(),ut=/[-_./\s]+/g,lt=/(\u001B\[[0-9;]*[a-z])/i,dt=new RegExp("\\p{Script=Arabic}","u"),pt=new RegExp("\\p{Script=Bengali}","u"),ht=new RegExp("\\p{Script=Cyrillic}","u"),ft=new RegExp("\\p{Script=Devanagari}","u"),wt=new RegExp("\\p{Script=Ethiopic}","u"),mt=new RegExp("\\p{Script=Greek}","u"),gt=new RegExp("\\p{Script=Greek}+|\\p{Script=Latin}+|[^\\p{Script=Greek}\\p{Script=Latin}]+","gu"),St=new RegExp("\\p{Script=Gujarati}","u"),yt=new RegExp("\\p{Script=Gurmukhi}","u"),bt=new RegExp("\\p{Script=Hangul}","u"),Et=new RegExp("\\p{Script=Hebrew}","u"),xt=new RegExp("\\p{Script=Hiragana}","u"),$t=new RegExp("\\p{Script=Han}","u"),kt=new RegExp("\\p{Script=Kannada}","u"),vt=new RegExp("\\p{Script=Katakana}","u"),Rt=new RegExp("\\p{Script=Khmer}","u"),It=new RegExp("\\p{Script=Lao}","u"),Wt=new RegExp("\\p{Script=Latin}","u"),Mt=new RegExp("\\p{Script=Malayalam}","u"),_t=new RegExp("\\p{Script=Myanmar}","u"),Tt=new RegExp("\\p{Script=Oriya}","u"),Ct=new RegExp("\\p{Script=Sinhala}","u"),Bt=new RegExp("\\p{Script=Tamil}","u"),At=new RegExp("\\p{Script=Telugu}","u"),jt=new RegExp("\\p{Script=Thai}","u"),Nt=new RegExp("\\p{Script=Tibetan}","u"),Dt=/[\u02BB\u02BC\u0027]/u,Ft=e=>e.replace(q,""),D=new Map,Ce=e=>[e.ambiguousIsNarrow?1:0,e.control,e.fullWidth,e.regular,e.wide].join("|"),Be=e=>{const n=Ce(e.width);let t=D.get(n);return t||(t=new Map,D.set(n,t)),t},$=new RegExp(K.source,"y"),M=new RegExp(q.source,"uy"),k=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,U=e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other",Ae=(e,n)=>{const t=Be(n),i=Math.floor(e/65536),a=e%65536;let c=t.get(i);if(c||(c=new Map,t.set(i,c)),c.has(a))return c.get(a);let s;switch(U(e)){case"control":{s=n.width.control;break}case"latin":{s=n.width.regular;break}case"wide":{s=n.width.wide;break}case"zero":{s=0;break}default:switch(V(e)){case"ambiguous":{s=n.width.ambiguousIsNarrow?n.width.regular:n.width.wide;break}case"fullwidth":{s=n.width.fullWidth;break}case"wide":{s=n.width.wide;break}default:s=n.width.regular}}return c.set(a,s),s},je=e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,_=(e,n={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const t={truncation:{countAnsiEscapeCodes:n.countAnsiEscapeCodes??!1,ellipsis:n.ellipsis??"",ellipsisWidth:n.ellipsisWidth??(n.ellipsis?_(n.ellipsis,{...n,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:n.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:n.ambiguousIsNarrow??!1,ansi:n.ansiWidth??0,control:n.controlWidth??0,emoji:n.emojiWidth??2,fullWidth:n.fullWidth??2,halfWidth:n.halfWidth??1,regular:n.regularWidth??1,tab:n.tabWidth??8,wide:n.wideWidth??2}},i=Math.max(0,t.truncation.limit-t.truncation.ellipsisWidth),{length:a}=e,c=a>1e4;let s=0,o=0,r=a,u=!1;const f=e.includes("\x1B")||e.includes("");for(;s<a;){if(f&&(e[s]==="\x1B"||e[s]==="")){if(e.startsWith("\x1B]8;;",s)){const h="\x1B]8;;\x07",w=h.length,R=e.indexOf("\x07",s+5);if(R!==-1){const I=e.indexOf(h,R+1);if(I!==-1){const J=I+w,Z=e.slice(R+1,I).replace(K,""),B=_(Z,{ambiguousIsNarrow:t.width.ambiguousIsNarrow,ansiWidth:t.width.ansi,controlWidth:t.width.control,countAnsiEscapeCodes:!1,ellipsis:t.truncation.ellipsis,ellipsisWidth:t.truncation.ellipsisWidth,emojiWidth:t.width.emoji,fullWidth:t.width.fullWidth,halfWidth:t.width.halfWidth,limit:Math.max(0,i-o),regularWidth:t.width.regular,tabWidth:t.width.tab,wideWidth:t.width.wide}),W=B.width;if(B.truncated)u=!0,r=Math.min(r,s);else if(o+W>i&&(r=Math.min(r,s),u=!0,o+W>t.truncation.limit))break;if(o+=W,s=J,u&&o>=t.truncation.limit)break;continue}}}if($.lastIndex=s,$.test(e)){const h=$.lastIndex-s,w=t.truncation.countAnsiEscapeCodes?h:t.width.ansi;if(o+w>i&&(r=Math.min(r,s),o+w>t.truncation.limit)){u=!0;break}o+=w,s=$.lastIndex;continue}}const l=e.codePointAt(s);if(l===8203||l===65279||l>=8288&&l<=8292){s+=1;continue}if(l===9){if(o+t.width.tab>i&&(r=Math.min(r,s),o+t.width.tab>t.truncation.limit)){u=!0;break}o+=t.width.tab,s+=1;continue}if(k.lastIndex=s,k.test(e)){const h=(k.lastIndex-s)*t.width.regular;if(o+h>i){const w=t.width.regular>0?Math.floor((i-o)/t.width.regular):0;if(r=Math.min(r,s+w),o+h>t.truncation.limit){u=!0;break}}o+=h,s=k.lastIndex;continue}if((l<=31||l>=127&&l<=159)&&(x.lastIndex=s,x.test(e))){const h=(x.lastIndex-s)*t.width.control;if(o+h>i){const w=t.width.control>0?Math.floor((i-o)/t.width.control):0;if(r=Math.min(r,s+w),o+h>t.truncation.limit){u=!0;break}}o+=h,s=x.lastIndex;continue}if(M.lastIndex=s,M.test(e)){if(o+t.width.emoji>i&&(r=Math.min(r,s),o+t.width.emoji>t.truncation.limit)){u=!0;break}o+=t.width.emoji,s=M.lastIndex;continue}const g=e.codePointAt(s)??0;if(je(g)){s+=g>65535?2:1;continue}let p;if(c)p=Ae(g,t);else switch(U(g)){case"control":{p=t.width.control;break}case"latin":{p=t.width.regular;break}case"wide":{p=t.width.wide;break}case"zero":{p=0;break}default:switch(V(g)){case"ambiguous":{p=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{p=t.width.fullWidth;break}case"wide":{p=t.width.wide;break}default:p=t.width.regular}}if(o+p>i&&(r=Math.min(r,s),o+p>t.truncation.limit)){u=!0;break}o+=p,s+=g>65535?2:1}let m=o,S=!1;return u&&t.truncation.limit>=t.truncation.ellipsisWidth&&(m=t.truncation.limit,S=!0),{ellipsed:S,index:u?r:a,truncated:u,width:m}},Ot=(e,n={})=>_(e,{...n,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,T=()=>d(oe(),".vis"),Ne=()=>d(T(),"cache"),Lt=()=>d(T(),"state"),De=e=>ie("sha256").update(e).digest("hex").slice(0,12),Pt=e=>d(T(),"workspaces",De(e)),Fe=".vis",C=e=>d(e,Fe),zt="node_modules/.cache/vis",Vt=e=>d(C(e),"runs"),Ht=e=>d(C(e),"last-summary.json"),Kt=e=>d(C(e),"last-failures"),qt=e=>{const n=re()==="win32";for(const t of[".task-runner",".task-runner-cache"]){const i=d(e,t);if(te(i))try{const a=n?A("cmd.exe",["/c","rmdir","/s","/q",i],{detached:!0,stdio:"ignore"}):A("rm",["-rf",i],{detached:!0,stdio:"ignore"});a.on("error",()=>{}),a.unref()}catch{}}},Oe="https://api.socket.dev/v0/purl?alerts=true",E=()=>d(Ne(),"socket-security"),Le=3600*1e3,G=.4,F=100,Pe=e=>typeof e=="object"&&e!==null&&"id"in e&&"type"in e&&"name"in e&&"version"in e&&"alerts"in e&&"score"in e&&e.type==="npm",ze=()=>{ce(E())},Y=(e,n)=>`${encodeURIComponent(e)}@${encodeURIComponent(n)}`,Ve=(e,n)=>{const t=Y(e,n),i=d(E(),`${t}.json`);try{const a=ae(i);if(Date.now()-a.createdAt>a.ttlMs){L(i,{force:!0});return}return a.report}catch{return}},He=(e,n,t,i)=>{const a=Y(e,n),c={createdAt:Date.now(),report:t,ttlMs:i};se(d(E(),`${a}.json`),JSON.stringify(c),"utf8")},Ke=e=>{const n=[e.license,e.maintenance,e.quality,e.supplyChain,e.vulnerability];return Number((n.reduce((t,i)=>t+i,0)/n.length).toFixed(2))},qe=async(e,n={})=>{const{apiToken:t,cacheTtlMs:i=Le,timeoutMs:a=15e3}=n,c=new Map;if(e.length===0||!t)return c;const s=[];for(const u of e){const f=Ve(u.name,u.version);f?c.set(`${u.name}@${u.version}`,f):s.push(u)}if(s.length===0)return c;const o=`Basic ${Buffer.from(`${t}:`).toString("base64")}`;ze();const r=[];for(let u=0;u<s.length;u+=F)r.push(s.slice(u,u+F));for(const u of r){const f=u.map(l=>({purl:`pkg:npm/${l.name}@${l.version}`})),m=new AbortController,S=setTimeout(()=>{m.abort()},a);try{const l=await fetch(Oe,{body:JSON.stringify({components:f}),headers:{Authorization:o,"Content-Type":"application/json","User-Agent":"@visulima/vis"},method:"POST",signal:m.signal});if(!l.ok)continue;const g=await l.text();Ue(g,u,c,i)}catch{}finally{clearTimeout(S)}}return c},Ue=(e,n,t,i)=>{const a=new Map;for(const s of n)a.set(`${s.name}@${s.version}`,s);const c=e.split(`}
|
|
2
|
+
`);for(const s of c){const o=s.trim();if(o)try{const r=JSON.parse(o.endsWith("}")?o:`${o}}`),f=`${r.namespace?`${r.namespace}/`:""}${r.name}`,m=`${f}@${r.version}`;if(!a.has(m))continue;const S=r.score.overall??Ke(r.score),l={alerts:r.alerts,author:r.author,id:r.id,license:r.license,name:r.name,score:{...r.score,overall:S},size:r.size,type:"npm",version:r.version};r.namespace&&(l.namespace=r.namespace),Pe(l)&&(t.set(m,l),He(f,r.version,l,i))}catch{}}},Ge=e=>e.namespace?`${e.namespace}/${e.name}`:e.name,Ut=e=>e>=.8?"excellent":e>=.6?"good":e>=.4?"fair":e>=.2?"poor":"critical",Gt=e=>e>=.6?"green":e>=.4?"yellow":"red",Yt=e=>{const n=Ge(e),t=`score: ${String(Math.round(e.score.overall*100))}%`,i=e.alerts.length,a=i>0?`${String(i)} alert${i===1?"":"s"}`:"no alerts";return`${n}@${e.version} (${t}, ${a})`},Jt=(e,n=G)=>{if(e.size===0)return"";let t=0,i=0,a=0,c=0,s=0,o=0;for(const u of e.values()){for(const f of u.alerts)switch(t++,f.severity){case"critical":{i++;break}case"high":{a++;break}case"medium":{c++;break}default:s++}u.score.overall<n&&o++}const r=[`Socket.dev: scanned ${String(e.size)} package${e.size===1?"":"s"}`];if(t>0){const u=[];i>0&&u.push(`${String(i)} critical`),a>0&&u.push(`${String(a)} high`),c>0&&u.push(`${String(c)} medium`),s>0&&u.push(`${String(s)} low`),r.push(` Alerts: ${String(t)} total (${u.join(", ")})`)}else r.push(" No security alerts found.");if(o>0){const u=Math.round(n*100);r.push(` ${String(o)} package${o===1?"":"s"} with low security score (<${String(u)}%)`)}return r.join(`
|
|
3
|
+
`)},Ye=()=>{const e=E();if(!P(e))return 0;const n=O(e).filter(t=>t.endsWith(".json"));for(const t of n)L(d(e,t),{force:!0});return n.length},Je=()=>{const e=E();if(!P(e))return{entries:0,newestEntry:void 0,oldestEntry:void 0,totalSizeBytes:0};const n=O(e).filter(c=>c.endsWith(".json"));let t=0,i,a;for(const c of n){const s=ne(d(e,c));t+=s.size;const{mtimeMs:o}=s;(i===void 0||o<i)&&(i=o),(a===void 0||o>a)&&(a=o)}return{entries:n.length,newestEntry:a,oldestEntry:i,totalSizeBytes:t}},Ze=(e,n)=>e?.enabled?{apiToken:e.apiToken??process.env.VIS_SOCKET_TOKEN,cacheTtlMs:e.cacheTtlMs,minimumScore:n??G,timeoutMs:e.timeoutMs}:void 0,Zt=(e,n,t,i)=>{if(!t)return;const a=Date.now(),c=o=>{if(o.expiresAt){const r=Date.parse(o.expiresAt);if(!Number.isNaN(r)&&r<a)return!1}return!(i&&o.policies&&!o.policies.includes(i))},s=`${e}@${n}`;if(t[s]&&c(t[s]))return t[s];if(t[e]&&c(t[e]))return t[e];for(const[o,r]of Object.entries(t))if(o.endsWith("*")&&e.startsWith(o.slice(0,-1))&&c(r))return r},Xt=(e,n,t,i)=>[" // Add to security.acceptedRisks in vis.config.ts:",` ${`"${e}"`}: {`,` reason: "${i}",`,` acceptedAt: "${new Date().toISOString()}",`,` acceptedScore: ${String(t)},`,' policies: ["score"],'," },"].join(`
|
|
4
|
+
`),Qt=(e,n={})=>{const t=Ze(e,n.minimumScore);if(t)return{clearCache:Ye,displayName:"Socket.dev",fetchReports:i=>qe(i,t),getCacheStats:Je,id:"socket"}},en=e=>{if(e===void 0)return!1;const n=e.trim().toLowerCase();return n!==""&&n!=="0"&&n!=="false"&&n!=="no"};export{_t as $,At as A,ht as B,yt as C,G as D,Ct as E,bt as F,It as G,ft as H,wt as I,jt as J,gt as K,ut as L,St as M,Rt as N,mt as O,kt as P,Tt as Q,q as R,qt as S,lt as T,Wt as U,Nt as V,vt as W,at as X,Mt as Y,Dt as Z,ct as _,Vt as a,K as a0,_ as a1,ve as a2,We as a3,rt as a4,st as a5,ot as a6,it as a7,Qt as a8,Jt as a9,zt as aa,Ht as ab,Kt as b,T as c,C as d,Ge as e,Zt as f,Ne as g,Yt as h,Ut as i,Xt as j,en as k,Lt as l,Ke as m,qe as n,Ot as o,Ye as p,Je as q,Pt as r,Gt as s,Ft as t,$t as u,xt as v,Et as w,dt as x,pt as y,Bt as z};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as p}from"node:module";import{e as j}from"./index-BzhrR_iC.js";import{b as F}from"./env-BSXG3QKH.js";let h;const m=t=>(h??=p(import.meta.url))(t),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,c=t=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[e,r]=s.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return s.getBuiltinModule(t)}return m(t)},{mkdirSync:f,writeFileSync:y,readdirSync:g}=c("node:fs"),{readFile:_}=c("node:fs/promises"),i=t=>F(t),a=(t,e)=>j(i(t),`${encodeURIComponent(e)}.json`);class R{#e;#t;constructor(e,r){this.#e=e,this.#t=r}printTaskTerminalOutput(e,r,o){if(r!=="failure")return;const n=i(this.#e);try{f(n,{recursive:!0})}catch{return}const u=e.overrides.command,d=e.projectRoot,l={command:u,cwd:d,exitCode:void 0,hash:e.hash,runId:this.#t,status:r,taskId:e.id,terminalOutput:o,timestamp:new Date().toISOString()};try{y(a(this.#e,e.id),`${JSON.stringify(l,void 0,2)}
|
|
2
|
+
`,"utf8")}catch{}}}const S=async(t,e)=>{const r=a(t,e);try{const o=await _(r,"utf8");return JSON.parse(o)}catch{return}},b=t=>{const e=i(t);let r;try{r=g(e)}catch{return[]}const o=[];for(const n of r)if(n.endsWith(".json"))try{o.push(decodeURIComponent(n.slice(0,-5)))}catch{}return o};export{R as F,S as a,b as l};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const f={iec:[{long:"Bytes",short:"B"},{long:"Kibibytes",short:"KiB"},{long:"Mebibytes",short:"MiB"},{long:"Gibibytes",short:"GiB"},{long:"Tebibytes",short:"TiB"},{long:"Pebibytes",short:"PiB"},{long:"Exbibytes",short:"EiB"},{long:"Zebibytes",short:"ZiB"},{long:"Yobibytes",short:"YiB"}],iec_octet:[{long:"Octets",short:"o"},{long:"Kibioctets",short:"Kio"},{long:"Mebioctets",short:"Mio"},{long:"Gibioctets",short:"Gio"},{long:"Tebioctets",short:"Tio"},{long:"Pebioctets",short:"Pio"},{long:"Exbioctets",short:"Eio"},{long:"Zebioctets",short:"Zio"},{long:"Yobioctets",short:"Yio"}],metric:[{long:"Bytes",short:"Bytes"},{long:"Kilobytes",short:"KB"},{long:"Megabytes",short:"MB"},{long:"Gigabytes",short:"GB"},{long:"Terabytes",short:"TB"},{long:"Petabytes",short:"PB"},{long:"Exabytes",short:"EB"},{long:"Zettabytes",short:"ZB"},{long:"Yottabytes",short:"YB"}],metric_octet:[{long:"Octets",short:"o"},{long:"Kilo-octets",short:"ko"},{long:"Mega-octets",short:"Mo"},{long:"Giga-octets",short:"Go"},{long:"Tera-octets",short:"To"},{long:"Peta-octets",short:"Po"},{long:"Exa-octets",short:"Eo"},{long:"Zetta-octets",short:"Zo"},{long:"Yotta-octets",short:"Yo"}]},w=[{long:"bits",short:"bit"},{long:"Kilobits",short:"kbit"},{long:"Megabits",short:"Mbit"},{long:"Gigabits",short:"Gbit"},{long:"Terabits",short:"Tbit"},{long:"Petabits",short:"Pbit"},{long:"Exabits",short:"Ebit"},{long:"Zettabits",short:"Zbit"},{long:"Yottabits",short:"Ybit"}],u=new Map,M=(t,s)=>{const e=`${t}\0${JSON.stringify(s)}`;let o=u.get(e);return o===void 0&&(o=new Intl.NumberFormat(t,s),u.set(e,o)),o},K=t=>{switch(t){case 2:return 1024;case 10:return 1e3;default:throw new Error("Unsupported base.")}},F=(t,s,e)=>({maximumFractionDigits:t,minimumFractionDigits:t,...s,...e}),N=(t,s,e,o)=>{if(t===void 0)return-1;const n=s.findIndex(i=>i.short===t);return n===-1&&o?f[e].findIndex(i=>i.short===t):n},v=(t,s)=>{if(typeof t!="number"||!Number.isFinite(t))throw new TypeError("Bytesize is not a number.");const{base:e,bits:o,decimals:n,locale:i,long:h,signed:d,unit:E,units:b,...a}={base:2,bits:!1,decimals:0,locale:"en-US",long:!1,signed:!1,units:"metric",...s},c=K(e),g=o?t*8:t,x=Math.abs(g),y=s?.space??!0?" ":"",r=o?w:f[b],l=N(E,r,b,o),T=n<0?void 0:n,m=d?{signDisplay:"exceptZero"}:{};if(g===0){const Y=l===-1?0:Math.min(l,r.length-1),p=r[Y][h?"long":"short"];return M(i,{...m,...a}).format(0)+y+p}const Z=Math.max(0,Math.min(Math.floor(Math.log(x)/Math.log(c)),r.length-1)),B=l===-1?Z:l,G=r[B][h?"long":"short"],P=g/c**B;return M(i,F(T,m,a)).format(P)+y+G};export{v as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as t}from"./registry-Dg9XI6RT.js";const s=async(a,o)=>await t(a,o);export{s as l};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e}from"./vis-user-error-
|
|
1
|
+
import{b as e}from"./vis-user-error-3YS7sPYy.js";const o={filter:{alias:"F",description:"Filter packages by name pattern",multiple:!0,type:String},parallel:{defaultValue:!1,description:"Run concurrently without topological ordering",type:Boolean},recursive:{alias:"r",defaultValue:!1,description:"Run in every workspace package",type:Boolean},reverse:{defaultValue:!1,description:"Reverse topological execution order",type:Boolean},"shell-mode":{alias:"c",defaultValue:!1,description:"Execute within shell environment",type:Boolean},"workspace-root":{alias:"w",defaultValue:!1,description:"Run on workspace root only",type:Boolean}},l=e({argument:{description:"Command to execute followed by arguments",name:"command",type:String},description:"Execute a local node_modules/.bin command (no remote fallback)",examples:[["vis exec eslint .","Run local eslint"],["vis exec tsc --noEmit","Run local TypeScript check"],["vis exec -r -- eslint .","Run in all workspace packages"],["vis exec -c 'echo $PATH'","Shell mode"]],group:"Run & Execute",loader:()=>import("../packem_chunks/handler.js"),name:"exec",options:o});export{l as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{m as k,D as S,f as L}from"./provenance-SX1MxPUZ.js";import{g as $}from"./packument-CbTmbHU4.js";import{f}from"./env-BSXG3QKH.js";import{a as E}from"./build-scripts-CEDx_nJp.js";import{n as h}from"./license-DvlYdo6T.js";import{v as A,U as P,z as x}from"./index-BzhrR_iC.js";import{S as O}from"./lockfile-DhHAaHN5.js";import{L as b}from"./dependency-scan-D_v3KM59.js";import{a as M}from"./advisories-DO-P0V1_.js";const C=2,m=4,y={CRITICAL:0,HIGH:1,LOW:3,MODERATE:C,UNKNOWN:m},le=(e,s)=>{const n=y[(e.vulnerability.severity??"UNKNOWN").toUpperCase()]??m,t=y[(s.vulnerability.severity??"UNKNOWN").toUpperCase()]??m;return n-t||e.packageName.localeCompare(s.packageName)||e.packageVersion.localeCompare(s.packageVersion)},D=(e,s)=>{const n=y[s.toUpperCase()]??C;return(y[e.toUpperCase()]??m)<=n},R=["firstSeen","installScripts","license","malware","publisherChange","score","unexpectedDeps","vulnerability"],w=6e4,W=(e,s,n)=>{for(const t of n)if(t===e||t===`${e}@${s}`||t.endsWith("*")&&e.startsWith(t.slice(0,-1)))return!0;return!1},U=async(e,s)=>{const n=s.security?.policies?.firstSeen;if(n?.minutes===void 0||n.minutes<=0)return[];const{minutes:t}=n,r=n.exclude??[],c=s.security?.acceptedRisks,a=t*w,o=Date.now();return(await k(e.packages,S,async l=>{if(W(l.name,l.version,r))return;const p=await $(l.name,{workspaceRoot:e.workspaceRoot});if(p===void 0)return;const u=p.time?.[l.version];if(u===void 0)return;const d=Date.parse(u);if(Number.isNaN(d))return;const v=o-d;if(v>=a)return;const g=Math.max(0,Math.floor(v/w));return{acceptedRisk:f(l.name,l.version,c,"firstSeen"),data:{ageMinutes:g,minimumMinutes:t,publishedAt:u},packageName:l.name,policy:"firstSeen",reason:`${l.name}@${l.version} was published ${String(g)} min ago — below the ${String(t)} min firstSeen cooldown.`,severity:"block",version:l.version}})).filter(l=>l!==void 0)},_=(e,s)=>{const n=s.security?.policies?.installScripts;if(!n)return[];const t=n.allow??{},r=n.strict===!0;if(!r&&Object.keys(t).length===0)return[];const c=E(e.workspaceRoot,t,{pinVersions:s.security?.pinVersions===!0});if(c.unapproved.length===0)return[];const a=s.security?.acceptedRisks,o=r?"block":"warn";return c.unapproved.map(i=>({acceptedRisk:f(i.name,i.version??"*",a,"installScripts"),data:{hooks:i.hooks},packageName:i.name,policy:"installScripts",reason:`${i.name}${i.version?`@${i.version}`:""} declares unapproved build script(s): ${i.hooks.join(", ")}`,severity:o,version:i.version??"*"}))},I=new Set(["AND","OR"]),F=e=>{const s=e.replaceAll("("," ").replaceAll(")"," ").split(/\s+/).map(r=>r.trim()).filter(r=>r.length>0),n=[];let t=!1;for(const r of s){const c=r.toUpperCase();if(t){t=!1;continue}if(c==="WITH"){t=!0;continue}if(I.has(c))continue;const a=r.endsWith("+"),o=a?r.slice(0,-1):r,i=h(o)??o;n.push(i),a&&n.push(`${i}-or-later`)}return n},T=e=>{if(typeof e.license=="string"){const s=e.license.trim();return s.length>0?s:void 0}if(e.license&&typeof e.license=="object"&&typeof e.license.type=="string"){const s=e.license.type.trim();if(s.length>0)return s}if(Array.isArray(e.licenses)&&e.licenses.length>0){const s=e.licenses.map(n=>n&&typeof n.type=="string"?n.type.trim():"").filter(n=>n.length>0);if(s.length>0)return s.length===1?s[0]:`(${s.join(" OR ")})`}},V=(e,s)=>{if(s.length===0)return;const n=new Set(s.map(t=>h(t)??t).map(t=>t.toLowerCase()));for(const t of e)if(n.has(t.toLowerCase()))return t},K=(e,s)=>{if(s.length===0)return;const n=new Set(s.map(t=>h(t)??t).map(t=>t.toLowerCase()));for(const t of e)if(!n.has(t.toLowerCase()))return t},j=(e,s)=>{const n=s.security?.policies?.license;if(!n)return[];const t=n.allow??[],r=n.deny??[];if(t.length===0&&r.length===0)return[];const c=s.security?.acceptedRisks,a=[];for(const o of e.packages){const i=e.manifestData?.get(`${o.name}@${o.version}`),l=i?T(i):void 0;if(!l){t.length>0&&a.push({acceptedRisk:f(o.name,o.version,c,"license"),data:{declaredLicense:null},packageName:o.name,policy:"license",reason:`${o.name}@${o.version} declares no license; allow-list mode requires one of: ${t.join(", ")}`,severity:"block",version:o.version});continue}const p=F(l),u=V(p,r);if(u){a.push({acceptedRisk:f(o.name,o.version,c,"license"),data:{declaredLicense:l,deniedLicense:u},packageName:o.name,policy:"license",reason:`${o.name}@${o.version} uses denied license '${u}' (declared: ${l})`,severity:"block",version:o.version});continue}const d=K(p,t);d&&a.push({acceptedRisk:f(o.name,o.version,c,"license"),data:{allowList:t,declaredLicense:l,unallowedLicense:d},packageName:o.name,policy:"license",reason:`${o.name}@${o.version} uses license '${d}' which is not on the allow-list (declared: ${l})`,severity:"block",version:o.version})}return a},z=6e4,B=(e,s,n)=>{for(const t of n)if(t===e||t===`${e}@${s}`||t.endsWith("*")&&e.startsWith(t.slice(0,-1)))return!0;return!1},Y=async(e,s)=>{const n=s.security?.policies?.publisherChange;if(n?.mode!=="no-downgrade")return[];const t=n.exclude??[],r=typeof n.ignoreAfter=="number"?n.ignoreAfter*z:void 0,c=s.security?.acceptedRisks,a=Date.now();return(await k(e.packages,S,async i=>{if(B(i.name,i.version,t))return;const l=await $(i.name,{workspaceRoot:e.workspaceRoot});if(l===void 0)return;if(r!==void 0){const d=l.time?.[i.version],v=d===void 0?Number.NaN:Date.parse(d);if(!Number.isNaN(v)&&a-v>r)return}if(l.versions[i.version]?.dist?.attestations?.provenance!==void 0)return;const u=L(l,i.version);if(u!==void 0)return{acceptedRisk:f(i.name,i.version,c,"publisherChange"),data:{priorVersionWithProvenance:u},packageName:i.name,policy:"publisherChange",reason:`${i.name}@${i.version} dropped the provenance attestation that ${i.name}@${u} carried — publisher trust downgrade.`,severity:"block",version:i.version}})).filter(i=>i!==void 0)},H=e=>{for(const s of Object.values(b))for(const n of[s.file,...s.aliases??[]])if(e===n||e.endsWith(`/${n}`)||e.endsWith(`.${n}`))return s.type},q=(e,s,n)=>{const t=A(s)?s:P(e,s);let r;try{r=x(t)}catch{return}const c=H(t)??b[n]?.type;if(!c)return;const a=O(r,c);if(a.length===0)return;const o=new Set;for(const i of a)o.add(`${i.name}@${i.version}`);return o},G=(e,s)=>{for(const n of s)if(n===e||n.endsWith("*")&&e.startsWith(n.slice(0,-1)))return!0;return!1},X=(e,s)=>{const n=s.security?.policies?.unexpectedDeps;if(!n)return[];const t=n.allow??[],r=n.baselineLockfile;if(t.length===0&&!r)return[];const c=r?q(e.workspaceRoot,r,e.packageManager):void 0,a=s.security?.acceptedRisks,o=[];for(const i of e.packages){const l=t.length===0||G(i.name,t),p=c?c.has(`${i.name}@${i.version}`):!0;if(l&&p)continue;const u=[],d={};l||(u.push(`not on allow-list (${t.length} entr${t.length===1?"y":"ies"})`),d.allowList=t),!p&&c&&(u.push(`not present in baseline lockfile (${r})`),d.baselineLockfile=r),o.push({acceptedRisk:f(i.name,i.version,a,"unexpectedDeps"),data:d,packageName:i.name,policy:"unexpectedDeps",reason:`${i.name}@${i.version} is unexpected: ${u.join("; ")}`,severity:"block",version:i.version})}return o},J=(e,s)=>{if(!e.osvFindings||e.osvFindings.size===0)return[];const t=s.security?.policies?.vulnerability?.failOn,r=s.security?.acceptedRisks,c=[];for(const a of e.packages){const o=e.osvFindings.get(M(a.name,a.version))??e.osvFindings.get(a.name);if(!(!o||o.length===0))for(const i of o){const l=t?D(i.severity,t)?"block":"warn":"info";c.push({acceptedRisk:f(a.name,a.version,r,"vulnerability"),data:{advisoryId:i.id,aliases:i.aliases??[],cvssScore:i.cvssScore,fixedVersions:i.fixedVersions,severity:i.severity,summary:i.summary},packageName:a.name,policy:"vulnerability",reason:`${i.severity} ${i.id} affects ${a.name}@${a.version}: ${i.summary}`,severity:l,version:a.version})}}return c},N=[{evaluate:J,isConfigured:e=>e.security?.policies?.vulnerability!==void 0,name:"vulnerability",offlineSupported:!0,surfaces:["audit","doctor"]},{evaluate:j,isConfigured:e=>{const s=e.security?.policies?.license;return!!(s&&(s.allow&&s.allow.length>0||s.deny&&s.deny.length>0))},name:"license",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:_,isConfigured:e=>{const s=e.security?.policies?.installScripts;return!!(s&&(s.allow&&Object.keys(s.allow).length>0||s.strict===!0))},name:"installScripts",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:X,isConfigured:e=>{const s=e.security?.policies?.unexpectedDeps;return!!(s&&(s.allow&&s.allow.length>0||typeof s.baselineLockfile=="string"))},name:"unexpectedDeps",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:U,isConfigured:e=>{const s=e.security?.policies?.firstSeen?.minutes;return typeof s=="number"&&s>0},name:"firstSeen",offlineSupported:!1,surfaces:["audit","doctor","install"]},{evaluate:Y,isConfigured:e=>e.security?.policies?.publisherChange?.mode==="no-downgrade",name:"publisherChange",offlineSupported:!1,surfaces:["audit","doctor","install"]}],Q=(e,s,n)=>N.filter(t=>t.surfaces.includes(e)?n!==void 0?n.has(t.name):t.isConfigured(s):!1),ue=async(e,s,n)=>{const t=Q(s,n.visConfig,n.enabledPolicies),r=[];for(const c of t){if(e.offline&&!c.offlineSupported){r.push({packageName:"*",policy:c.name,reason:`policy.${c.name} skipped: requires network (--offline)`,severity:"info",version:"*"});continue}try{const a=await c.evaluate(e,n.visConfig);r.push(...a)}catch(a){const o=a instanceof Error?a.message:String(a);r.push({packageName:"*",policy:c.name,reason:`policy.${c.name} failed: ${o}`,severity:"info",version:"*"})}}return r},Z=(()=>{const e=new Map;for(const s of R)e.set(s.toLowerCase(),s);return e})(),de=()=>N.map(e=>e.name),pe=(e,s)=>{if(e===void 0)return;const n=e.trim().toLowerCase();if(n===""||n==="none")return new Set;if(n==="all")return new Set(R);const t=new Set;for(const r of e.split(",").map(c=>c.trim()).filter(c=>c.length>0)){const c=r.replace(/^_+/,"").replaceAll(/_+([a-z])/g,(o,i)=>i.toUpperCase()),a=Z.get(c.toLowerCase());a===void 0?s?.(r):t.add(a)}return t};export{le as c,ue as e,de as g,pe as p,D as s};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as K}from"node:module";import{n as E,o as z,C as S,d as X,e as h}from"./index-BzhrR_iC.js";import{r as rt}from"./env-BSXG3QKH.js";import{N as it}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";import{r as D}from"./writeFileSync-DJoHk3Ks-BPRoepNw.js";import{withEnhancedPath as lt}from"@visulima/task-runner";let V;const U=t=>(V??=K(import.meta.url))(t),f=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,l=t=>{if(typeof f<"u"&&f.versions&&f.versions.node){const[e,o]=f.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return f.getBuiltinModule(t)}return U(t)},{Socket:Y}=l("node:net"),{randomBytes:J}=l("node:crypto"),{readdir:Q,rm:b,unlink:$,open:Z,readFile:tt,stat:et,writeFile:ot,rename:st}=l("node:fs/promises"),{createRequire:M}=l("node:module"),{spawn:nt}=l("node:child_process"),{openSync:ct,closeSync:at}=l("node:fs");let ht;const dt=t=>(ht??=M(import.meta.url))(t),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ft=t=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[e,o]=u.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return u.getBuiltinModule(t)}return dt(t)},{lstat:A,mkdir:ut}=ft("node:fs/promises"),pt=async t=>{E(t);try{const e=await A(t);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(D(e))}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{await ut(t,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const o=await A(t);if(!o.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(D(o))}'`,{cause:e})}};let wt;const yt=t=>(wt??=M(import.meta.url))(t),p=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,kt=t=>{if(typeof p<"u"&&p.versions&&p.versions.node){const[e,o]=p.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return p.getBuiltinModule(t)}return yt(t)},{access:mt}=kt("node:fs/promises");async function _t(t,e=z){E(t),t=S(t);try{return await mt(t,e),!0}catch{return!1}}let gt;const vt=t=>(gt??=M(import.meta.url))(t),w=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,x=t=>{if(typeof w<"u"&&w.versions&&w.versions.node){const[e,o]=w.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return w.getBuiltinModule(t)}return vt(t)},{readFile:bt}=x("node:fs/promises"),{unzip:Tt,brotliDecompress:Et}=x("node:zlib"),St={brotli:Et,gzip:Tt,none:(t,e)=>{e(null,t)}},Mt=async(t,e)=>{E(t),t=S(t);const{buffer:o,compression:s,encoding:r,flag:i}=e??{};let n;try{n=await bt(t,i?{flag:i}:{})}catch(c){throw X(c,t)}return await new Promise((c,g)=>{St[s??"none"](n,(k,m)=>{k?g(k):c(o?m:m.toString(r??"utf8"))})})};async function C(t,e,o){const s=await Mt(t,{buffer:!0,encoding:void 0});let r=new TextDecoder().decode(s);const{beforeParse:i,color:n}={};return typeof i=="function"&&(r=i(r)),it(r,e,S(t),{color:n})}const H=384,L=5e3,Ht=50,Rt=3e4,d=async t=>{const e=h(rt(t),"services");try{await pt(e)}catch(o){throw o.code==="ENOTDIR"?new Error(`Service registry path ${e} exists but is not a directory. Remove it or move the conflicting file before running \`vis service\`.`,{cause:o}):o}return e},R=t=>t.replaceAll("/","_").replaceAll(":","__"),P=(t,e)=>h(t,`${R(e)}.json`),Pt=(t,e)=>h(t,`${R(e)}.lock`),_=async(t,e)=>{const o=await d(t),s=P(o,e);if(await _t(s))try{return await C(s)}catch{return}},$t=async t=>{const e=await d(t);let o;try{o=await Q(e)}catch{return[]}const s=[];for(const r of o)if(r.endsWith(".json"))try{const i=await C(h(e,r));s.push(i)}catch{}return s},Dt=async(t,e)=>{const o=await d(t),s=P(o,e.id),r=h(o,`.${J(8).toString("hex")}.tmp`);await ot(r,`${JSON.stringify(e,void 0,2)}
|
|
2
|
+
`,{mode:H});try{await It(r,s)}catch(i){throw await b(r,{force:!0}).catch(()=>{}),i}},At=new Set(["EACCES","EBUSY","EPERM"]),Lt=8,Ot=20,It=async(t,e)=>{let o=0;for(;;)try{await st(t,e);return}catch(s){const{code:r}=s;if(!(r!==void 0&&At.has(r))||o>=Lt)throw s;const n=Ot*2**o;await new Promise(c=>{setTimeout(c,n)}),o+=1}},y=async(t,e,o)=>{const s=await d(t),r=o??await _(t,e);await b(P(s,e),{force:!0}),r&&await b(r.logFile,{force:!0}).catch(()=>{})},a=t=>{try{return process.kill(t,0),!0}catch{return!1}},se=async t=>{const e=await $t(t),o=[],s=[];for(const r of e){if(a(r.pid)){s.push(r);continue}const i=await _(t,r.id);if(i&&i.pid!==r.pid){s.push(i);continue}await y(t,r.id,r).catch(()=>{}),o.push(r.id)}return{pruned:o,surviving:s}},xt=t=>new Promise(e=>{setTimeout(e,t)}),Ct=async t=>{try{const e=await Z(t,"wx",H);try{await e.writeFile(String(process.pid))}finally{await e.close().catch(()=>{})}return!0}catch(e){if(e.code==="EEXIST")return!1;throw e}},Nt=async t=>{let e;try{const o=await tt(t,"utf8"),s=Number.parseInt(o.trim(),10);e=Number.isFinite(s)?s:void 0}catch{return!0}if(e!==void 0&&!a(e))return!0;try{const o=await et(t);return Date.now()-o.mtimeMs>Rt}catch{return!0}},N=async(t,e,o)=>{const s=await d(t),r=Pt(s,e),i=Date.now();for(;!await Ct(r);){if(await Nt(r)){await $(r).catch(()=>{});continue}if(Date.now()-i>=L)throw new Error(`Could not acquire service lock for ${e} within ${String(L)}ms — another \`vis service\` invocation appears to be holding it.`);await xt(Ht)}try{return await o()}finally{await $(r).catch(()=>{})}};function T(t,e={},o){for(const s in t){const r=t[s],i=o?`${o}:${s}`:s;typeof r=="object"&&r!==null?T(r,e,i):typeof r=="function"&&(e[i]=r)}return e}const F=(()=>{if(console.createTask)return console.createTask;const t={run:e=>e()};return()=>t})();function j(t,e,o,s){for(let r=o;r<t.length;r+=1)try{const i=s?s.run(()=>t[r](...e)):t[r](...e);if(i&&typeof i.then=="function")return Promise.resolve(i).then(()=>j(t,e,r+1,s))}catch(i){return Promise.reject(i)}}function Ft(t,e,o){if(t.length>0)return j(t,e,0,F(o))}function jt(t,e,o){if(t.length>0){const s=F(o);return Promise.all(t.map(r=>s.run(()=>r(...e))))}}function v(t,e){for(const o of[...t])o(e)}var Wt=class{_hooks;_before;_after;_deprecatedHooks;_deprecatedMessages;constructor(){this._hooks={},this._before=void 0,this._after=void 0,this._deprecatedMessages=void 0,this._deprecatedHooks={},this.hook=this.hook.bind(this),this.callHook=this.callHook.bind(this),this.callHookWith=this.callHookWith.bind(this)}hook(t,e,o={}){if(!t||typeof e!="function")return()=>{};const s=t;let r;for(;this._deprecatedHooks[t];)r=this._deprecatedHooks[t],t=r.to;if(r&&!o.allowDeprecated){let i=r.message;i||(i=`${s} hook has been deprecated`+(r.to?`, please use ${r.to}`:"")),this._deprecatedMessages||(this._deprecatedMessages=new Set),this._deprecatedMessages.has(i)||(console.warn(i),this._deprecatedMessages.add(i))}if(!e.name)try{Object.defineProperty(e,"name",{get:()=>"_"+t.replace(/\W+/g,"_")+"_hook_cb",configurable:!0})}catch{}return this._hooks[t]=this._hooks[t]||[],this._hooks[t].push(e),()=>{e&&(this.removeHook(t,e),e=void 0)}}hookOnce(t,e){let o,s=(...r)=>(typeof o=="function"&&o(),o=void 0,s=void 0,e(...r));return o=this.hook(t,s),o}removeHook(t,e){const o=this._hooks[t];if(o){const s=o.indexOf(e);s!==-1&&o.splice(s,1),o.length===0&&(this._hooks[t]=void 0)}}clearHook(t){this._hooks[t]=void 0}deprecateHook(t,e){this._deprecatedHooks[t]=typeof e=="string"?{to:e}:e;const o=this._hooks[t]||[];this._hooks[t]=void 0;for(const s of o)this.hook(t,s)}deprecateHooks(t){for(const e in t)this.deprecateHook(e,t[e])}addHooks(t){const e=T(t),o=Object.keys(e).map(s=>this.hook(s,e[s]));return()=>{for(const s of o)s();o.length=0}}removeHooks(t){const e=T(t);for(const o in e)this.removeHook(o,e[o])}removeAllHooks(){this._hooks={}}callHook(t,...e){return this.callHookWith(Ft,t,e)}callHookParallel(t,...e){return this.callHookWith(jt,t,e)}callHookWith(t,e,o){const s=this._before||this._after?{name:e,args:o,context:{}}:void 0;this._before&&v(this._before,s);const r=t(this._hooks[e]?[...this._hooks[e]]:[],o,e);return r instanceof Promise?r.finally(()=>{this._after&&s&&v(this._after,s)}):(this._after&&s&&v(this._after,s),r)}beforeEach(t){return this._before=this._before||[],this._before.push(t),()=>{if(this._before!==void 0){const e=this._before.indexOf(t);e!==-1&&this._before.splice(e,1)}}}afterEach(t){return this._after=this._after||[],this._after.push(t),()=>{if(this._after!==void 0){const e=this._after.indexOf(t);e!==-1&&this._after.splice(e,1)}}}};function Bt(){return new Wt}const re=()=>Bt(),ie=async(t,e)=>{if(!(!e||e.length===0))for(const o of e){if(o.hooks)for(const[s,r]of Object.entries(o.hooks)){const i=Array.isArray(r)?r:[r];for(const n of i)t.hook(s,n)}o.setup&&await o.setup(t)}};class ne{#o;#e;#s=new Map;constructor(e,o){this.#o=e,this.#e=o}startTasks(e){for(const o of e)this.#s.set(o.id,o),this.#t("task:before",o)}endTasks(e){for(const o of e)this.#s.delete(o.task.id),this.#t("task:after",o.task,o),o.status==="failure"?this.#t("task:failure",o.task,o):Gt(o.status)&&this.#t("task:cacheHit",o.task,o)}printCacheMiss(e,o){this.#t("task:cacheMiss",e,o)}onTaskStdout(e,o){this.#t("task:stdout",e,o)}onTaskStderr(e,o){this.#t("task:stderr",e,o)}#t(e,...o){Promise.resolve(this.#o.callHook(e,...o)).catch(s=>{if(this.#e)try{this.#e(e,s)}catch{}})}}const Gt=t=>t==="local-cache"||t==="local-cache-kept-existing"||t==="remote-cache",qt=3e4,W=100;class Kt extends Error{constructor(e,o){super(e),this.elapsedMs=o,this.name="ServiceReadinessError"}elapsedMs}const Vt=async t=>{const e=t.host??"127.0.0.1",{port:o}=t,s=t.timeoutMs??qt,r=Date.now();for(;Date.now()-r<s;){if(await Ut(e,o))return;await zt(W)}throw new Kt(`Timed out waiting for ${e}:${String(o)} to accept TCP connections (${String(s)}ms)`,Date.now()-r)},Ut=(t,e)=>new Promise(o=>{const s=new Y,r=i=>{s.removeAllListeners(),s.destroy(),o(i)};s.once("connect",()=>{r(!0)}),s.once("error",()=>{r(!1)}),s.setTimeout(W,()=>{r(!1)});try{s.connect(e,t)}catch{r(!1)}}),zt=t=>new Promise(e=>{setTimeout(e,t)}),Xt=async(t,e)=>{const o=t.readiness??(t.port===void 0?void 0:{tcp:{port:t.port}});o&&await Vt({host:o.tcp.host,port:o.tcp.port,timeoutMs:e?.timeoutMs??o.tcp.timeoutMs})},O=process.platform==="win32",Yt=async t=>{const{command:e,cwd:o,env:s,logFile:r}=t,i=ct(r,"a",H);let n;const c=O?"cmd":"/bin/sh",g=O?["/d","/s","/c",e]:["-c",e];try{n=nt(c,g,{cwd:o,detached:!0,env:lt({...process.env,...s},o),stdio:["ignore",i,i],windowsHide:!0})}finally{at(i)}if(n.pid===void 0&&await new Promise((k,m)=>{n.once("spawn",()=>{k()}),n.once("error",q=>{m(q)})}),n.pid===void 0)throw new Error(`Failed to spawn detached process for command: ${e}`);return n.unref(),{pid:n.pid}},B=5e3,ce=async t=>N(t.workspaceRoot,t.id,async()=>{const e=await _(t.workspaceRoot,t.id);if(e&&a(e.pid))throw new Error(`Service ${t.id} is already running (pid ${String(e.pid)})`);e&&await y(t.workspaceRoot,t.id,e);const o=await d(t.workspaceRoot),s=R(t.id),r=h(o,`${s}.log`),{pid:i}=await Yt({command:t.command,cwd:t.cwd,env:t.env,logFile:r}),n={command:t.command,config:t.config,cwd:t.cwd,env:t.config.env??{},id:t.id,logFile:r,pid:i,slug:s,startedAt:new Date().toISOString(),visVersion:process.env.VIS_VERSION??"0.0.0"};if(await Dt(t.workspaceRoot,n),t.skipReadiness!==!0)try{await Xt(t.config,{timeoutMs:t.readinessTimeoutMs})}catch(c){throw await G(i,t.config.killGracePeriodMs??B).catch(()=>{}),await y(t.workspaceRoot,t.id,n).catch(()=>{}),c}return{entry:n}}),ae=async t=>N(t.workspaceRoot,t.id,async()=>{const e=await _(t.workspaceRoot,t.id);if(!e)return{stopped:!1};if(!a(e.pid))return await y(t.workspaceRoot,t.id,e),{stopped:!1};const o=t.graceMs??e.config.killGracePeriodMs??B;return await G(e.pid,o),await y(t.workspaceRoot,t.id,e),{stopped:!0}}),G=async(t,e)=>{I(t,"SIGTERM");const o=Date.now();for(;Date.now()-o<e;){if(!a(t))return;await new Promise(s=>{setTimeout(s,100)})}a(t)&&I(t,"SIGKILL")},I=(t,e)=>{try{process.platform==="win32"?process.kill(t,e):process.kill(-t,e)}catch(o){if(o.code==="ESRCH")return;throw o}};export{ne as H,Kt as S,ce as a,Xt as b,$t as c,re as d,ie as e,y as f,_t as g,a as i,se as p,_ as r,ae as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as h,U as u}from"./index-BzhrR_iC.js";import{h as m,l as E,m as D,L as o}from"./registry-Dg9XI6RT.js";import{y as l}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";const S=/\/+$/,f=/node_modules/,p=/\.git/,_=/[$()+.?[\\\]^{|}]/g,y=/\/\*\*$|\/\*\/\*$/,P=t=>{for(const r of o(t,{includeDirs:!1,includeSymlinks:!1,skip:[f,p]}))if(r.name==="package.json")return!0;return!1},d=(t,r,n)=>{for(const e of o(t,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[f,p]})){if(e.path===t||e.name.startsWith(".")||l(h(e.path,"package.json")))continue;const i=`${r}/${e.name}`;P(e.path)?d(e.path,i,n):n.push(i)}},g=(t,r)=>{const n=r.replace(S,"");if(n.startsWith("!"))return[];const e=[];if(n.endsWith("/*")&&!n.endsWith("/*/*")){const a=n.slice(0,-2),s=u(t,a);if(!l(s))return[];for(const c of o(s,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[f,p]}))c.path===s||c.name.startsWith(".")||e.push(h(a,c.name));return e}if(n.endsWith("/**")||n.endsWith("/*/*")){const a=n.replace(y,""),s=u(t,a);return l(s)&&d(s,a,e),e}if(!n.includes("/")&&n.includes("*")){const a=n.replaceAll(_,String.raw`\$&`).replaceAll("*",".*"),s=new RegExp(`^${a}$`);for(const c of o(t,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[f,p]}))c.path!==t&&s.test(c.name)&&e.push(c.name);return e}const i=u(t,n);return l(i)&&e.push(n),e},x=t=>{const n=m(t)??E(t)??[],e=new Set,i=[];for(const a of n)for(const s of g(t,a))s==="."||e.has(s)||(e.add(s),D(h(t,s))||i.push({packageDir:s}));return i};export{x as l};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as J}from"node:module";import{e as K}from"./index-BzhrR_iC.js";import{u as X}from"./registry-Dg9XI6RT.js";import{e as L,i as Z,s as Q}from"./maven-pom-B0KG9kJQ.js";import{c as ee}from"./composer-DR3D-Psb.js";let Y;const B=e=>(Y??=J(import.meta.url))(e),S=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,G=e=>{if(typeof S<"u"&&S.versions&&S.versions.node){const[n,t]=S.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return S.getBuiltinModule(e)}return B(e)},{existsSync:E,readFileSync:_}=G("node:fs"),{resolve:w,dirname:M,join:x}=G("node:path"),oe=8,ne=8,te="vis:maven:version-unresolved",N=(e,n,t)=>`pkg:maven/${encodeURIComponent(e)}/${encodeURIComponent(n)}${t===void 0?"":`@${encodeURIComponent(t)}`}`,A=e=>{if(E(e))try{return{path:e,scan:Q(_(e,"utf8"))}}catch{return}},D=e=>{const n=e.scan.parent;if(!n)return;const t=n.relativePath||"../pom.xml",o=t.endsWith(".xml")?w(M(e.path),t):w(M(e.path),t,"pom.xml"),s=A(o);return s&&s.scan.artifactId?.value===n.artifactId?.value&&L(s.scan)===n.groupId?.value?s:void 0},se=e=>{const n=[e];let t=D(e);for(;t&&n.length<oe;)n.push(t),t=D(t);return n},P=(e,n,t=0)=>{if(e===""||t>ne)return;let o=!1;const s=e.replaceAll(/\$\{([^}]+)\}/g,(c,r)=>{const i=n(r),a=i===void 0?void 0:P(i,n,t+1);return a===void 0?(o=!0,""):a});return o||s.includes("${")?void 0:s},C=(e,n)=>{if(e===void 0)return{unresolved:""};const t=P(e,n);return t===void 0||!Z(t)?{unresolved:e}:{version:t}},re=e=>{const n=[],t=new Set,o=s=>{const c=w(s),r=A(c);if(!(!r||t.has(c))){t.add(c),n.push(se(r));for(const i of r.scan.modules)o(i.endsWith(".xml")?w(M(c),i):w(M(c),i,"pom.xml"))}};return o(e),n},T=e=>{const n=[];for(const t of re(w(e,"pom.xml"))){const o=t[0].scan,s=new Map;for(const m of t)for(const[y,b]of m.scan.properties)s.has(y)||s.set(y,b.value);const c=L(o),r=o.artifactId?.value,i=o.version?.value??o.parent?.version?.value,a=o.parent?.version?.value,u=m=>{switch(m){case"artifactId":case"pom.artifactId":case"project.artifactId":return r;case"groupId":case"pom.groupId":case"project.groupId":return c;case"pom.version":case"project.version":case"version":return i;case"project.parent.version":return a;default:return s.get(m)}},l=c===void 0?void 0:P(c,u),g=r===void 0?void 0:P(r,u),h=C(i,u),v=new Map;for(const m of t)for(const y of m.scan.dependencies){const b=y.groupId?.value??"",d=y.artifactId?.value??"",p=`${b}:${d}`;if(v.has(p))continue;const f=P(b,u),k=P(d,u),j=f===void 0||k===void 0?{unresolved:y.version?.value??""}:C(y.version?.value,u);v.set(p,{artifact:k,group:f,scope:y.scope?.value??"compile",unresolved:f===void 0||k===void 0?p:j.unresolved,version:j.version})}n.push({artifact:g,dependencies:[...v.values()],group:l,path:t[0].path,unresolved:h.unresolved,version:h.version})}return n},O=e=>e==="test"||e==="provided",ce=(e,n)=>{const t=new Set(n),o=new Map;for(const r of e)r.group!==void 0&&r.artifact!==void 0&&o.set(`${r.group}:${r.artifact}`,r);const s=new Set(e.filter(r=>r.artifact!==void 0&&t.has(r.artifact))),c=[...s];for(;c.length>0;){const r=c.shift();for(const i of r.dependencies){const a=o.get(`${i.group}:${i.artifact}`);a!==void 0&&!s.has(a)&&(s.add(a),c.push(a))}}return e.filter(r=>s.has(r))},De=(e,n={})=>{const t=n.includeDev??!1,o=new Map,s=new Map,c=(a,u,l,g,h)=>{const v=N(a,u,l);if(!o.has(v)){const m={"bom-ref":v,group:a,name:u,purl:v,type:"library"};l!==void 0&&(m.version=l),g!==void 0&&(m.properties=[{name:te,value:g}]),h!==void 0&&(m.scope=h),o.set(v,m)}return v},r=T(e);for(const a of n.focusNames===void 0?r:ce(r,n.focusNames)){const u=a.group!==void 0&&a.artifact!==void 0?c(a.group,a.artifact,a.version,a.unresolved):void 0;for(const l of a.dependencies){if(O(l.scope)&&!t||l.group===void 0||l.artifact===void 0)continue;const g=c(l.group,l.artifact,l.version,l.unresolved,O(l.scope)?"optional":"required");u!==void 0&&s.set(u,(s.get(u)??new Set).add(g))}}const i=[...o.values()].sort((a,u)=>(a["bom-ref"]??"").localeCompare(u["bom-ref"]??""));return{components:i,dependencies:i.map(a=>{const u=a["bom-ref"]??"",l=[...s.get(u)??[]].sort();return l.length>0?{dependsOn:l,ref:u}:{ref:u}})}},ie=e=>{const n=[];for(const t of e.split(/\r?\n/)){const o=t.trim();if(o.length===0||o.startsWith("#"))continue;const s=o.indexOf("="),c=(s===-1?o:o.slice(0,s)).split(":");if(c.length<3||!c[0]||!c[1]||!c[2])continue;const r=s===-1?[]:o.slice(s+1).split(",").map(i=>i.trim()).filter(i=>i.length>0);n.push({artifact:c[1],configurations:r,group:c[0],version:c[2]})}return n},ae=e=>["",...X(e,[])].map(t=>x(e,t,"gradle.lockfile")).filter(t=>E(t)),U=e=>{const n=[];for(const t of ae(e))try{n.push(...ie(_(t,"utf8")))}catch{}return n},de=e=>e.configurations.length>0&&e.configurations.every(n=>/test/i.test(n)),Ce=(e,n={})=>{const t=n.includeDev??!1,o=new Map;for(const r of U(e)){const i=N(r.group,r.artifact,r.version),a=o.get(i),u=de(r);o.set(i,{dev:(a?.dev??!0)&&u,entry:r})}const s=[...o.keys()].filter(r=>t||!o.get(r).dev).sort();return{components:s.map(r=>{const{dev:i,entry:a}=o.get(r);return{"bom-ref":r,group:a.group,name:a.artifact,purl:r,scope:i?"optional":"required",type:"library",version:a.version}}),dependencies:s.map(r=>({ref:r}))}},V=(e,n)=>{const{focusNames:t,includeDev:o=!1,normalize:s,purl:c}=n,r=new Map;for(const d of e){const p=`${s(d.name)}@${d.version}`;r.set(p,(r.get(p)??0)+1)}const i=d=>{const p=(r.get(`${s(d.name)}@${d.version}`)??0)>1,f=c(d.name,d.version);return p&&d.source!==void 0?`${f}?source=${encodeURIComponent(d.source)}`:f},a=new Map;for(const d of e){const p=s(d.name);a.set(p,[...a.get(p)??[],d])}const u=d=>{const p=(a.get(s(d.name))??[]).filter(f=>(d.version===void 0||f.version===d.version)&&(d.source===void 0||f.source===d.source));return p.length===1?p[0]:void 0},l=t===void 0?void 0:new Set(t.map(d=>s(d))),g=e.filter(d=>d.member&&(l===void 0||l.has(s(d.name)))),h=new Set(g),v=[...g];for(;v.length>0;){const d=v.shift();for(const p of d.deps){if(p.kind==="dev"&&!o)continue;const f=u(p);f!==void 0&&!h.has(f)&&(h.add(f),v.push(f))}}const m=[...h],y=m.map(d=>{const p=i(d);return{"bom-ref":p,name:d.name,purl:p,type:"library",version:d.version}}).sort((d,p)=>(d["bom-ref"]??"").localeCompare(p["bom-ref"]??"")),b=m.map(d=>{const p=[...new Set(d.deps.filter(k=>o||k.kind!=="dev").map(k=>u(k)).filter(k=>k!==void 0&&h.has(k)).map(k=>i(k)))].sort(),f=i(d);return p.length>0?{dependsOn:p,ref:f}:{ref:f}}).sort((d,p)=>d.ref.localeCompare(p.ref));return{components:y,dependencies:b}},ue=(e,n)=>`pkg:hex/${encodeURIComponent(e)}@${encodeURIComponent(n)}`,le=/^\s*"[^"]+":\s*\{:hex,\s*:([a-z_]\w*),\s*"([^"]+)"/,q=e=>{const n=[];for(const t of e.split(/\r?\n/)){const o=le.exec(t);if(o?.[1]===void 0||o[2]===void 0)continue;const s=[];for(const c of t.matchAll(/\{:([a-z_]\w*),\s*"/g))s.push({kind:"main",name:c[1]});n.push({deps:s,member:!0,name:o[1],version:o[2]})}return n},Oe=(e,n={})=>{let t;try{t=_(x(e,"mix.lock"),"utf8")}catch{return{components:[],dependencies:[]}}return V(q(t),{includeDev:n.includeDev,normalize:o=>o,purl:ue})},pe=(e,n)=>`pkg:nuget/${encodeURIComponent(e)}@${encodeURIComponent(n)}`,$=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),I=e=>e.toLowerCase(),z=e=>{let n;try{n=JSON.parse(e)}catch{return[]}if(!$(n)||!$(n.dependencies))return[];const t=[];for(const i of Object.values(n.dependencies)){if(!$(i))continue;const a=new Map;for(const[u,l]of Object.entries(i))$(l)&&a.set(u,{depIds:$(l.dependencies)?Object.keys(l.dependencies):[],resolved:typeof l.resolved=="string"?l.resolved:void 0,type:typeof l.type=="string"?l.type:""});t.push(a)}const o=new Set;let s=!1;for(const i of t)for(const a of i.values())if(a.type==="Direct"&&(s=!0),a.type==="Project")for(const u of a.depIds)o.add(I(u));const c=new Map;for(const i of t)for(const[a,u]of i){if(u.type==="Project"||u.resolved===void 0)continue;const l=`${I(a)}\0${u.resolved}`,g=c.get(l)??{deps:[],member:!1,name:a,version:u.resolved};c.set(l,g),u.type==="Direct"&&(g.member=!0);for(const h of u.depIds){const v=i.get(h)?.resolved;v!==void 0&&g.deps.push({kind:"main",name:h,version:v})}}const r=!s&&o.size===0;return[...c.values()].map(i=>({...i,member:r||i.member||o.has(I(i.name))}))},Ge=e=>{let n;try{n=_(x(e,"packages.lock.json"),"utf8")}catch{return{components:[],dependencies:[]}}return V(z(n),{normalize:I,purl:pe})},F={"crates.io":["Cargo.lock"],Go:["go.sum"],Hex:["mix.lock"],Maven:["gradle.lockfile","pom.xml"],NuGet:["packages.lock.json"],Packagist:["composer.lock"],Pub:["pubspec.lock"],PyPI:["uv.lock","poetry.lock","Pipfile.lock"],RubyGems:["Gemfile.lock"],SwiftURL:["Package.resolved"]},fe={cargo:"crates.io",composer:"Packagist","crates.io":"crates.io",dart:"Pub",go:"Go",gradle:"Maven",hex:"Hex",maven:"Maven",npm:"npm",nuget:"NuGet",packagist:"Packagist",pub:"Pub",pypi:"PyPI",rubygems:"RubyGems",swift:"SwiftURL",swifturl:"SwiftURL"},R=e=>fe[e.toLowerCase()]??e,Le=e=>F[R(e)]??[],ve=(e,n)=>{const t=R(n),o=F[t]??[];for(const s of o){const c=K(e,s);if(E(c))return c}},H=e=>{const n=new Set,t=[];for(const o of e){const s=`${o.name}@${o.version}`;n.has(s)||(n.add(s),t.push(o))}return t},me=/\[\[package\]\]([\s\S]*?)(?=\[\[|$)/g,ge=/^\s*name\s*=\s*"([^"]+)"\s*$/m,he=/^\s*version\s*=\s*"([^"]+)"\s*$/m,ke=e=>{const n=[];for(const t of e.matchAll(me)){const o=t[1]??"",s=ge.exec(o)?.[1],c=he.exec(o)?.[1];s&&c&&n.push({isDev:!1,name:s,version:c})}return n},ye=e=>{let n;try{n=JSON.parse(e)}catch{return[]}if(typeof n!="object"||n===null)return[];const t=[];for(const o of["default","develop"]){const s=n[o];if(!(typeof s!="object"||s===null))for(const[c,r]of Object.entries(s)){if(typeof r!="object"||r===null)continue;const i=r.version;if(typeof i!="string")continue;const a=i.replace(/^==/,"").trim();a.length>0&&t.push({isDev:!1,name:c,version:a})}}return t},be=e=>{const n=[];let t;try{t=JSON.parse(e)}catch{return n}for(const[o,s]of[["packages",!1],["packages-dev",!0]]){const c=t[o];if(Array.isArray(c))for(const r of c)typeof r.name=="string"&&typeof r.version=="string"&&n.push({isDev:s,name:r.name,version:ee(r.version)})}return n},Pe=e=>{const n=[];for(const t of e.split(/\r?\n/)){const o=t.trim();if(o.length===0)continue;const s=o.split(/\s+/);if(s.length<3)continue;const[c,r]=s;if(!c||!r?.endsWith("/go.mod"))continue;const i=r.slice(0,-7);i.length!==0&&n.push({isDev:!1,name:c,version:i})}return n},we=/^ {4}([^ ()]+) \(([^()]+)\)\s*$/,Se=e=>{const n=[];let t=!1,o=!1;for(const s of e.split(/\r?\n/)){if(s.startsWith("GEM")){t=!0,o=!1;continue}if(t&&/^[A-Z]/.test(s)){t=!1,o=!1;continue}if(t&&s.trim()==="specs:"){o=!0;continue}if(o){const c=we.exec(s);if(c){const[,r,i]=c,a=i?.split("-")[0];r&&a&&n.push({isDev:!1,name:r,version:a})}}}return n},$e=e=>{const n=[];let t=!1;for(const o of e.split(/\r?\n/)){if(/^\S/.test(o)){t=o.trimEnd()==="packages:";continue}const s=n.at(-1),c=/^ {2}(\S+):\s*$/.exec(o);if(t&&c?.[1]!==void 0){n.push({name:c[1]});continue}const[,r,i]=/^ {4}(dependency|source|version): "?([^"]*)"?\s*$/.exec(o)??[];t&&s!==void 0&&r!==void 0&&i!==void 0&&(r==="source"?s.source=i:r==="version"?s.version=i:s.dependency=i)}return n.filter(o=>o.source==="hosted"&&o.version!==void 0&&o.version.length>0).map(o=>({isDev:o.dependency==="direct dev",name:o.name,version:o.version}))},_e=e=>e.trim().replace(/^[a-z+]+:\/\//i,"").replace(/^[^@/]+@([^:/]+):/,"$1/").replace(/\.git$/,"").replace(/\/+$/,""),Ie=e=>{let n;try{n=JSON.parse(e)}catch{return[]}const t=typeof n=="object"&&n!==null?n.pins:void 0;if(!Array.isArray(t))return[];const o=[];for(const s of t)typeof s.location=="string"&&typeof s.state?.version=="string"&&s.state.version.length>0&&o.push({isDev:!1,name:_e(s.location),version:s.state.version});return o},W=e=>{const n=[],t=[];for(const o of T(e))for(const s of o.dependencies){if(s.group===void 0||s.artifact===void 0||s.version===void 0){t.push(s.group!==void 0&&s.artifact!==void 0?`${s.group}:${s.artifact}`:s.unresolved??"");continue}n.push({isDev:!1,name:`${s.group}:${s.artifact}`,version:s.version})}for(const o of U(e))n.push({isDev:!1,name:`${o.group}:${o.artifact}`,version:o.version});return{packages:H(n),unresolved:[...new Set(t)]}},Ne=e=>W(e).unresolved,Ae=(e,n)=>{if(R(n)==="Maven")return W(e).packages;const t=ve(e,n);if(!t)return[];let o;try{o=_(t,"utf8")}catch{return[]}const s=t.split(/[/\\]/).pop()??"";let c;switch(s){case"Cargo.lock":case"poetry.lock":case"uv.lock":{c=ke(o);break}case"composer.lock":{c=be(o);break}case"Gemfile.lock":{c=Se(o);break}case"go.sum":{c=Pe(o);break}case"mix.lock":{c=q(o).map(r=>({isDev:!1,name:r.name,version:r.version}));break}case"Package.resolved":{c=Ie(o);break}case"packages.lock.json":{c=z(o).map(r=>({isDev:!1,name:r.name,version:r.version}));break}case"Pipfile.lock":{c=ye(o);break}case"pubspec.lock":{c=$e(o);break}default:return[]}return H(c)};export{Oe as a,V as b,R as c,De as d,Ce as e,Ge as f,ae as g,ve as h,Le as i,Ae as l,Ne as m};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{e as u,z as f}from"./index-BzhrR_iC.js";import{y as m}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";const d=/^(@[^:]+):registry$/,h=/^\/\/(.+)\/:_authToken$/,y=/^https?:\/\//,E=/\/$/,T=/\$\{([^}]+)\}/g,_=s=>{let e=!1;const r=s.replaceAll(T,(o,n)=>{const t=n.indexOf(":-"),c=(t===-1?n:n.slice(0,t)).trim(),i=t===-1?void 0:n.slice(t+2),a=process.env[c];return a!==void 0?a:i!==void 0?i:(e=!0,"")});return{hasUnresolved:e,value:r}},R=s=>{const e=new Map,r=new Map;let o="https://registry.npmjs.org";for(const n of s.split(`
|
|
2
|
+
`)){const t=n.trim();if(!t||t.startsWith("#")||t.startsWith(";"))continue;const c=t.indexOf("=");if(c===-1)continue;const i=t.slice(0,c).trim(),{hasUnresolved:a,value:l}=_(t.slice(c+1).trim()),p=d.exec(i);if(p?.[1]){e.set(p[1],l);continue}if(i==="registry"){o=l;continue}const g=h.exec(i);g?.[1]&&!a&&r.set(g[1],l)}return{authTokens:r,defaultRegistry:o,registries:e}},k=(s,e)=>({authTokens:new Map([...s.authTokens,...e.authTokens]),defaultRegistry:e.defaultRegistry==="https://registry.npmjs.org"?s.defaultRegistry:e.defaultRegistry,registries:new Map([...s.registries,...e.registries])}),O=s=>{const e={authTokens:new Map,defaultRegistry:"https://registry.npmjs.org",registries:new Map},r=process.env.HOME??process.env.USERPROFILE??"",o=u(r,".npmrc");let n=r&&m(o)?R(f(o)):e;const t=u(s,".npmrc");return m(t)&&(n=k(n,R(f(t)))),n},G=(s,e)=>{let r=e.defaultRegistry;if(s.startsWith("@")){const t=s.split("/")[0];if(t&&e.registries.has(t)){const c=e.registries.get(t);c&&(r=c)}}const o=r.replace(y,"").replace(E,"");return{token:e.authTokens.get(o),url:r}};export{E as T,G as g,O as l,R as p};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as u}from"./advisories-DO-P0V1_.js";const d=e=>{const s=e.database_specific?.severity?.toUpperCase();if(s==="CRITICAL"||s==="HIGH"||s==="MODERATE"||s==="LOW")return s;const r=e.severity?.find(t=>t.type==="CVSS_V3")?.score;if(r){const t=Number.parseFloat(r);return t>=9?"CRITICAL":t>=7?"HIGH":t>=4?"MODERATE":"LOW"}return"UNKNOWN"},v=e=>{const s=e.severity?.find(r=>r.type==="CVSS_V3")?.score;return s?Number.parseFloat(s):void 0},y=e=>{const s=[];for(const r of e.affected??[])for(const t of r.ranges??[])for(const o of t.events??[])o.fixed&&s.push(o.fixed);return s},l=e=>({aliases:e.aliases?.length?e.aliases:void 0,cvssScore:v(e),fixedVersions:y(e),id:e.id,severity:d(e),summary:e.summary??""}),O=async(e,s=1e4)=>{if(e.length===0)return new Map;const r=e.map(n=>({package:{ecosystem:"npm",name:n.name},version:n.version})),t=new AbortController,o=setTimeout(()=>{t.abort()},s);try{const n=await fetch("https://api.osv.dev/v1/querybatch",{body:JSON.stringify({queries:r}),headers:{"Content-Type":"application/json"},method:"POST",signal:t.signal});if(!n.ok)return new Map;const f=await n.json(),i=new Map;for(const[p,c]of e.entries()){const a=f.results[p]?.vulns;a&&a.length>0&&i.set(u(c.name,c.version),a.map(m=>l(m)))}return i}catch{return new Map}finally{clearTimeout(o)}};export{O as f};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import{createRequire as ct}from"node:module";import{k as be,m as ee,z as te,a as mt,g as Lt,f as gt}from"./index-BzhrR_iC.js";import{L as De}from"./index-BisalDCf.js";import{a as ie,g as St}from"./_commonjsHelpers-DTfxOvZk.js";import{r as vt,a as Ct}from"./clean-DRiLimTx.js";import{p as yt}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";let ht;const ut=u=>(ht??=ct(import.meta.url))(u),F=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,R=u=>{if(typeof F<"u"&&F.versions&&F.versions.node){const[e,t]=F.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return F.getBuiltinModule(u)}return ut(u)},{dirname:pt}=R("node:path"),Pe=R("node:url"),{fileURLToPath:ft}=Pe,ye=R("node:module"),{createRequire:dt}=ye,Pt=R("util"),Di=u=>"Bun"in u,Ai=()=>process.argv,wi=()=>process.cwd(),xi=()=>process.env,Ei=()=>process.execArgv,Oi=()=>process.execPath,Ni=()=>process.platform,Fi=()=>process.arch,Gi=(u=0)=>{process.exit(u)},$i=(u,e)=>{const t=process;return t.on(u,e),()=>{t.removeListener(u,e)}};var T,ne;function Ae(){return ne||(ne=1,T=["0BSD","3D-Slicer-1.0","AAL","ADSL","AFL-1.1","AFL-1.2","AFL-2.0","AFL-2.1","AFL-3.0","AGPL-1.0-only","AGPL-1.0-or-later","AGPL-3.0-only","AGPL-3.0-or-later","ALGLIB-Documentation","AMD-newlib","AMDPLPA","AML","AML-glslang","AMPAS","ANTLR-PD","ANTLR-PD-fallback","APAFML","APL-1.0","APSL-1.0","APSL-1.1","APSL-1.2","APSL-2.0","ASWF-Digital-Assets-1.0","ASWF-Digital-Assets-1.1","Abstyles","AdaCore-doc","Adobe-2006","Adobe-Display-PostScript","Adobe-Glyph","Adobe-Utopia","Advanced-Cryptics-Dictionary","Afmparse","Aladdin","Apache-1.0","Apache-1.1","Apache-2.0","App-s2p","Arphic-1999","Artistic-1.0","Artistic-1.0-Perl","Artistic-1.0-cl8","Artistic-2.0","Artistic-dist","Aspell-RU","BOLA-1.1","BSD-1-Clause","BSD-2-Clause","BSD-2-Clause-Darwin","BSD-2-Clause-Patent","BSD-2-Clause-Views","BSD-2-Clause-first-lines","BSD-2-Clause-pkgconf-disclaimer","BSD-3-Clause","BSD-3-Clause-Attribution","BSD-3-Clause-Clear","BSD-3-Clause-HP","BSD-3-Clause-LBNL","BSD-3-Clause-Modification","BSD-3-Clause-No-Military-License","BSD-3-Clause-No-Nuclear-License","BSD-3-Clause-No-Nuclear-License-2014","BSD-3-Clause-No-Nuclear-Warranty","BSD-3-Clause-Open-MPI","BSD-3-Clause-Sun","BSD-3-Clause-Tso","BSD-3-Clause-acpica","BSD-3-Clause-flex","BSD-4-Clause","BSD-4-Clause-Shortened","BSD-4-Clause-UC","BSD-4.3RENO","BSD-4.3TAHOE","BSD-Advertising-Acknowledgement","BSD-Attribution-HPND-disclaimer","BSD-Inferno-Nettverk","BSD-Mark-Modifications","BSD-Protection","BSD-Source-Code","BSD-Source-beginning-file","BSD-Systemics","BSD-Systemics-W3Works","BSL-1.0","BUSL-1.1","Baekmuk","Bahyph","Barr","Beerware","BitTorrent-1.0","BitTorrent-1.1","Bitstream-Charter","Bitstream-Vera","BlueOak-1.0.0","Boehm-GC","Boehm-GC-without-fee","Borceux","Brian-Gladman-2-Clause","Brian-Gladman-3-Clause","Buddy","C-UDA-1.0","CAL-1.0","CAL-1.0-Combined-Work-Exception","CAPEC-tou","CATOSL-1.1","CC-BY-1.0","CC-BY-2.0","CC-BY-2.5","CC-BY-2.5-AU","CC-BY-3.0","CC-BY-3.0-AT","CC-BY-3.0-AU","CC-BY-3.0-DE","CC-BY-3.0-IGO","CC-BY-3.0-NL","CC-BY-3.0-US","CC-BY-4.0","CC-BY-NC-1.0","CC-BY-NC-2.0","CC-BY-NC-2.5","CC-BY-NC-3.0","CC-BY-NC-3.0-DE","CC-BY-NC-4.0","CC-BY-NC-ND-1.0","CC-BY-NC-ND-2.0","CC-BY-NC-ND-2.5","CC-BY-NC-ND-3.0","CC-BY-NC-ND-3.0-DE","CC-BY-NC-ND-3.0-IGO","CC-BY-NC-ND-4.0","CC-BY-NC-SA-1.0","CC-BY-NC-SA-2.0","CC-BY-NC-SA-2.0-DE","CC-BY-NC-SA-2.0-FR","CC-BY-NC-SA-2.0-UK","CC-BY-NC-SA-2.5","CC-BY-NC-SA-3.0","CC-BY-NC-SA-3.0-DE","CC-BY-NC-SA-3.0-IGO","CC-BY-NC-SA-4.0","CC-BY-ND-1.0","CC-BY-ND-2.0","CC-BY-ND-2.5","CC-BY-ND-3.0","CC-BY-ND-3.0-DE","CC-BY-ND-4.0","CC-BY-SA-1.0","CC-BY-SA-2.0","CC-BY-SA-2.0-UK","CC-BY-SA-2.1-JP","CC-BY-SA-2.5","CC-BY-SA-3.0","CC-BY-SA-3.0-AT","CC-BY-SA-3.0-DE","CC-BY-SA-3.0-IGO","CC-BY-SA-4.0","CC-PDDC","CC-PDM-1.0","CC-SA-1.0","CC0-1.0","CDDL-1.0","CDDL-1.1","CDL-1.0","CDLA-Permissive-1.0","CDLA-Permissive-2.0","CDLA-Sharing-1.0","CECILL-1.0","CECILL-1.1","CECILL-2.0","CECILL-2.1","CECILL-B","CECILL-C","CERN-OHL-1.1","CERN-OHL-1.2","CERN-OHL-P-2.0","CERN-OHL-S-2.0","CERN-OHL-W-2.0","CFITSIO","CMU-Mach","CMU-Mach-nodoc","CNRI-Jython","CNRI-Python","CNRI-Python-GPL-Compatible","COIL-1.0","CPAL-1.0","CPL-1.0","CPOL-1.02","CUA-OPL-1.0","Caldera","Caldera-no-preamble","Catharon","ClArtistic","Clips","Community-Spec-1.0","Condor-1.1","Cornell-Lossless-JPEG","Cronyx","Crossword","CryptoSwift","CrystalStacker","Cube","D-FSL-1.0","DEC-3-Clause","DL-DE-BY-2.0","DL-DE-ZERO-2.0","DOC","DRL-1.0","DRL-1.1","DSDP","DocBook-DTD","DocBook-Schema","DocBook-Stylesheet","DocBook-XML","Dotseqn","ECL-1.0","ECL-2.0","EFL-1.0","EFL-2.0","EPICS","EPL-1.0","EPL-2.0","ESA-PL-permissive-2.4","ESA-PL-strong-copyleft-2.4","ESA-PL-weak-copyleft-2.4","EUDatagrid","EUPL-1.0","EUPL-1.1","EUPL-1.2","Elastic-2.0","Entessa","ErlPL-1.1","Eurosym","FBM","FDK-AAC","FSFAP","FSFAP-no-warranty-disclaimer","FSFUL","FSFULLR","FSFULLRSD","FSFULLRWD","FSL-1.1-ALv2","FSL-1.1-MIT","FTL","Fair","Ferguson-Twofish","Frameworx-1.0","FreeBSD-DOC","FreeImage","Furuseth","GCR-docs","GD","GFDL-1.1-invariants-only","GFDL-1.1-invariants-or-later","GFDL-1.1-no-invariants-only","GFDL-1.1-no-invariants-or-later","GFDL-1.1-only","GFDL-1.1-or-later","GFDL-1.2-invariants-only","GFDL-1.2-invariants-or-later","GFDL-1.2-no-invariants-only","GFDL-1.2-no-invariants-or-later","GFDL-1.2-only","GFDL-1.2-or-later","GFDL-1.3-invariants-only","GFDL-1.3-invariants-or-later","GFDL-1.3-no-invariants-only","GFDL-1.3-no-invariants-or-later","GFDL-1.3-only","GFDL-1.3-or-later","GL2PS","GLWTPL","GPL-1.0-only","GPL-1.0-or-later","GPL-2.0-only","GPL-2.0-or-later","GPL-3.0-only","GPL-3.0-or-later","Game-Programming-Gems","Giftware","Glide","Glulxe","Graphics-Gems","Gutmann","HDF5","HIDAPI","HP-1986","HP-1989","HPND","HPND-DEC","HPND-Fenneberg-Livingston","HPND-INRIA-IMAG","HPND-Intel","HPND-Kevlin-Henney","HPND-MIT-disclaimer","HPND-Markus-Kuhn","HPND-Netrek","HPND-Pbmplus","HPND-SMC","HPND-UC","HPND-UC-export-US","HPND-doc","HPND-doc-sell","HPND-export-US","HPND-export-US-acknowledgement","HPND-export-US-modify","HPND-export2-US","HPND-merchantability-variant","HPND-sell-MIT-disclaimer-xserver","HPND-sell-regexpr","HPND-sell-variant","HPND-sell-variant-MIT-disclaimer","HPND-sell-variant-MIT-disclaimer-rev","HPND-sell-variant-critical-systems","HTMLTIDY","HaskellReport","Hippocratic-2.1","IBM-pibs","ICU","IEC-Code-Components-EULA","IJG","IJG-short","IPA","IPL-1.0","ISC","ISC-Veillard","ISO-permission","ImageMagick","Imlib2","Info-ZIP","Inner-Net-2.0","InnoSetup","Intel","Intel-ACPI","Interbase-1.0","JPL-image","JPNIC","JSON","Jam","JasPer-2.0","Kastrup","Kazlib","Knuth-CTAN","LAL-1.2","LAL-1.3","LGPL-2.0-only","LGPL-2.0-or-later","LGPL-2.1-only","LGPL-2.1-or-later","LGPL-3.0-only","LGPL-3.0-or-later","LGPLLR","LOOP","LPD-document","LPL-1.0","LPL-1.02","LPPL-1.0","LPPL-1.1","LPPL-1.2","LPPL-1.3a","LPPL-1.3c","LZMA-SDK-9.11-to-9.20","LZMA-SDK-9.22","Latex2e","Latex2e-translated-notice","Leptonica","LiLiQ-P-1.1","LiLiQ-R-1.1","LiLiQ-Rplus-1.1","Libpng","Linux-OpenIB","Linux-man-pages-1-para","Linux-man-pages-copyleft","Linux-man-pages-copyleft-2-para","Linux-man-pages-copyleft-var","Lucida-Bitmap-Fonts","MIPS","MIT","MIT-0","MIT-CMU","MIT-Click","MIT-Festival","MIT-Khronos-old","MIT-Modern-Variant","MIT-STK","MIT-Wu","MIT-advertising","MIT-enna","MIT-feh","MIT-open-group","MIT-testregex","MITNFA","MMIXware","MMPL-1.0.1","MPEG-SSG","MPL-1.0","MPL-1.1","MPL-2.0","MPL-2.0-no-copyleft-exception","MS-LPL","MS-PL","MS-RL","MTLL","Mackerras-3-Clause","Mackerras-3-Clause-acknowledgment","MakeIndex","Martin-Birgmeier","McPhee-slideshow","Minpack","MirOS","Motosoto","MulanPSL-1.0","MulanPSL-2.0","Multics","Mup","NAIST-2003","NASA-1.3","NBPL-1.0","NCBI-PD","NCGL-UK-2.0","NCL","NCSA","NGPL","NICTA-1.0","NIST-PD","NIST-PD-TNT","NIST-PD-fallback","NIST-Software","NLOD-1.0","NLOD-2.0","NLPL","NOSL","NPL-1.0","NPL-1.1","NPOSL-3.0","NRL","NTIA-PD","NTP","NTP-0","Naumen","NetCDF","Newsletr","Nokia","Noweb","O-UDA-1.0","OAR","OCCT-PL","OCLC-2.0","ODC-By-1.0","ODbL-1.0","OFFIS","OFL-1.0","OFL-1.0-RFN","OFL-1.0-no-RFN","OFL-1.1","OFL-1.1-RFN","OFL-1.1-no-RFN","OGC-1.0","OGDL-Taiwan-1.0","OGL-Canada-2.0","OGL-UK-1.0","OGL-UK-2.0","OGL-UK-3.0","OGTSL","OLDAP-1.1","OLDAP-1.2","OLDAP-1.3","OLDAP-1.4","OLDAP-2.0","OLDAP-2.0.1","OLDAP-2.1","OLDAP-2.2","OLDAP-2.2.1","OLDAP-2.2.2","OLDAP-2.3","OLDAP-2.4","OLDAP-2.5","OLDAP-2.6","OLDAP-2.7","OLDAP-2.8","OLFL-1.3","OML","OPL-1.0","OPL-UK-3.0","OPUBL-1.0","OSC-1.0","OSET-PL-2.1","OSL-1.0","OSL-1.1","OSL-2.0","OSL-2.1","OSL-3.0","OSSP","OpenMDW-1.0","OpenPBS-2.3","OpenSSL","OpenSSL-standalone","OpenVision","PADL","PDDL-1.0","PHP-3.0","PHP-3.01","PPL","PSF-2.0","ParaType-Free-Font-1.3","Parity-6.0.0","Parity-7.0.0","Pixar","Plexus","PolyForm-Noncommercial-1.0.0","PolyForm-Small-Business-1.0.0","PostgreSQL","Python-2.0","Python-2.0.1","QPL-1.0","QPL-1.0-INRIA-2004","Qhull","RHeCos-1.1","RPL-1.1","RPL-1.5","RPSL-1.0","RSA-MD","RSCPL","Rdisc","Ruby","Ruby-pty","SAX-PD","SAX-PD-2.0","SCEA","SGI-B-1.0","SGI-B-1.1","SGI-B-2.0","SGI-OpenGL","SGMLUG-PM","SGP4","SHL-0.5","SHL-0.51","SISSL","SISSL-1.2","SL","SMAIL-GPL","SMLNJ","SMPPL","SNIA","SOFA","SPL-1.0","SSH-OpenSSH","SSH-short","SSLeay-standalone","SSPL-1.0","SUL-1.0","SWL","Saxpath","SchemeReport","Sendmail","Sendmail-8.23","Sendmail-Open-Source-1.1","SimPL-2.0","Sleepycat","Soundex","Spencer-86","Spencer-94","Spencer-99","SugarCRM-1.1.3","Sun-PPP","Sun-PPP-2000","SunPro","Symlinks","TAPR-OHL-1.0","TCL","TCP-wrappers","TGPPL-1.0","TMate","TORQUE-1.1","TOSL","TPDL","TPL-1.0","TTWL","TTYP0","TU-Berlin-1.0","TU-Berlin-2.0","TekHVC","TermReadKey","ThirdEye","TrustedQSL","UCAR","UCL-1.0","UMich-Merit","UPL-1.0","URT-RLE","Ubuntu-font-1.0","UnRAR","Unicode-3.0","Unicode-DFS-2015","Unicode-DFS-2016","Unicode-TOU","UnixCrypt","Unlicense","Unlicense-libtelnet","Unlicense-libwhirlpool","VOSTROM","VSL-1.0","Vim","Vixie-Cron","W3C","W3C-19980720","W3C-20150513","WTFNMFPL","WTFPL","Watcom-1.0","Widget-Workshop","WordNet","Wsuipa","X11","X11-distribute-modifications-variant","X11-no-permit-persons","X11-swapped","XFree86-1.1","XSkat","Xdebug-1.03","Xerox","Xfig","Xnet","YPL-1.0","YPL-1.1","ZPL-1.1","ZPL-2.0","ZPL-2.1","Zed","Zeeff","Zend-2.0","Zimbra-1.3","Zimbra-1.4","Zlib","any-OSI","any-OSI-perl-modules","bcrypt-Solar-Designer","blessing","bzip2-1.0.6","check-cvs","checkmk","copyleft-next-0.3.0","copyleft-next-0.3.1","curl","cve-tou","diffmark","dtoa","dvipdfm","eGenix","etalab-2.0","fwlw","gSOAP-1.3b","generic-xts","gnuplot","gtkbook","hdparm","hyphen-bulgarian","iMatix","jove","libpng-1.6.35","libpng-2.0","libselinux-1.0","libtiff","libutil-David-Nugent","lsof","magaz","mailprio","man2html","metamail","mpi-permissive","mpich2","mplus","ngrep","pkgconf","pnmstitch","psfrag","psutils","python-ldap","radvd","snprintf","softSurfer","ssh-keyscan","swrule","threeparttable","ulem","w3m","wwl","xinetd","xkeyboard-config-Zinoviev","xlock","xpp","xzoom","zlib-acknowledgement"]),T}var U,se;function bt(){return se||(se=1,U=["AGPL-1.0","AGPL-3.0","BSD-2-Clause-FreeBSD","BSD-2-Clause-NetBSD","GFDL-1.1","GFDL-1.2","GFDL-1.3","GPL-1.0","GPL-2.0","GPL-2.0-with-GCC-exception","GPL-2.0-with-autoconf-exception","GPL-2.0-with-bison-exception","GPL-2.0-with-classpath-exception","GPL-2.0-with-font-exception","GPL-3.0","GPL-3.0-with-GCC-exception","GPL-3.0-with-autoconf-exception","LGPL-2.0","LGPL-2.1","LGPL-3.0","Net-SNMP","Nunit","StandardML-NJ","bzip2-1.0.5","eCos-2.0","wxWindows"]),U}var M,oe;function Dt(){return oe||(oe=1,M=["389-exception","Asterisk-exception","Autoconf-exception-2.0","Autoconf-exception-3.0","Autoconf-exception-generic","Autoconf-exception-generic-3.0","Autoconf-exception-macro","Bison-exception-1.24","Bison-exception-2.2","Bootloader-exception","Classpath-exception-2.0","CLISP-exception-2.0","cryptsetup-OpenSSL-exception","DigiRule-FOSS-exception","eCos-exception-2.0","Fawkes-Runtime-exception","FLTK-exception","fmt-exception","Font-exception-2.0","freertos-exception-2.0","GCC-exception-2.0","GCC-exception-2.0-note","GCC-exception-3.1","Gmsh-exception","GNAT-exception","GNOME-examples-exception","GNU-compiler-exception","gnu-javamail-exception","GPL-3.0-interface-exception","GPL-3.0-linking-exception","GPL-3.0-linking-source-exception","GPL-CC-1.0","GStreamer-exception-2005","GStreamer-exception-2008","i2p-gpl-java-exception","KiCad-libraries-exception","LGPL-3.0-linking-exception","libpri-OpenH323-exception","Libtool-exception","Linux-syscall-note","LLGPL","LLVM-exception","LZMA-exception","mif-exception","OCaml-LGPL-linking-exception","OCCT-exception-1.0","OpenJDK-assembly-exception-1.0","openvpn-openssl-exception","PS-or-PDF-font-exception-20170817","QPL-1.0-INRIA-2004-exception","Qt-GPL-exception-1.0","Qt-LGPL-exception-1.1","Qwt-exception-1.0","SANE-exception","SHL-2.0","SHL-2.1","stunnel-exception","SWI-exception","Swift-exception","Texinfo-exception","u-boot-exception-2.0","UBDL-exception","Universal-FOSS-exception-1.0","vsftpd-openssl-exception","WxWindows-exception-3.1","x11vnc-openssl-exception"]),M}var k,ae;function At(){if(ae)return k;ae=1;var u=[].concat(Ae()).concat(bt()),e=Dt();return k=function(t){var n=0;function s(){return n<t.length}function r(g){if(g instanceof RegExp){var c=t.slice(n),L=c.match(g);if(L)return n+=L[0].length,L[0]}else if(t.indexOf(g,n)===n)return n+=g.length,g}function a(){r(/[ ]*/)}function l(){for(var g,c=["WITH","AND","OR","(",")",":","+"],L=0;L<c.length&&(g=r(c[L]),!g);L++);if(g==="+"&&n>1&&t[n-2]===" ")throw new Error("Space before `+`");return g&&{type:"OPERATOR",string:g}}function o(){return r(/[A-Za-z0-9-.]+/)}function h(){var g=o();if(!g)throw new Error("Expected idstring at offset "+n);return g}function f(){if(r("DocumentRef-")){var g=h();return{type:"DOCUMENTREF",string:g}}}function S(){if(r("LicenseRef-")){var g=h();return{type:"LICENSEREF",string:g}}}function b(){var g=n,c=o();if(u.indexOf(c)!==-1)return{type:"LICENSE",string:c};if(e.indexOf(c)!==-1)return{type:"EXCEPTION",string:c};n=g}function v(){return l()||f()||S()||b()}for(var C=[];s()&&(a(),!!s());){var m=v();if(!m)throw new Error("Unexpected `"+t[n]+"` at offset "+n);C.push(m)}return C},k}var _,le;function wt(){return le||(le=1,_=function(u){var e=0;function t(){return e<u.length}function n(){return t()?u[e]:null}function s(){if(!t())throw new Error;e++}function r(m){var g=n();if(g&&g.type==="OPERATOR"&&m===g.string)return s(),g.string}function a(){if(r("WITH")){var m=n();if(m&&m.type==="EXCEPTION")return s(),m.string;throw new Error("Expected exception after `WITH`")}}function l(){var m=e,g="",c=n();if(c.type==="DOCUMENTREF"&&(s(),g+="DocumentRef-"+c.string+":",!r(":")))throw new Error("Expected `:` after `DocumentRef-...`");if(c=n(),c.type==="LICENSEREF")return s(),g+="LicenseRef-"+c.string,{license:g};e=m}function o(){var m=n();if(m&&m.type==="LICENSE"){s();var g={license:m.string};r("+")&&(g.plus=!0);var c=a();return c&&(g.exception=c),g}}function h(){var m=r("(");if(m){var g=v();if(!r(")"))throw new Error("Expected `)`");return g}}function f(){return h()||l()||o()}function S(m,g){return function c(){var L=g();if(L){if(!r(m))return L;var y=c();if(!y)throw new Error("Expected expression");return{left:L,conjunction:m.toLowerCase(),right:y}}}}var b=S("AND",f),v=S("OR",b),C=v();if(!C||t())throw new Error("Syntax error");return C}),_}var W,ce;function we(){if(ce)return W;ce=1;var u=At(),e=wt();return W=function(t){return e(u(t))},W}var H,he;function xt(){if(he)return H;he=1;var u=we(),e=Ae();function t(c){try{return u(c),!0}catch{return!1}}function n(c,L){var y=L[0].length-c[0].length;return y!==0?y:c[0].toUpperCase().localeCompare(L[0].toUpperCase())}var s=[["APGL","AGPL"],["Gpl","GPL"],["GLP","GPL"],["APL","Apache"],["ISD","ISC"],["GLP","GPL"],["IST","ISC"],["Claude","Clause"],[" or later","+"],[" International",""],["GNU","GPL"],["GUN","GPL"],["+",""],["GNU GPL","GPL"],["GNU LGPL","LGPL"],["GNU/GPL","GPL"],["GNU GLP","GPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL"],["GNU Lesser General Public License","LGPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["GNU Lesser General Public License","LGPL-2.1"],["LESSER GENERAL PUBLIC LICENSE","LGPL"],["Lesser General Public License","LGPL"],["LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["Lesser General Public License","LGPL-2.1"],["GNU General Public License","GPL"],["Gnu public license","GPL"],["GNU Public License","GPL"],["GNU GENERAL PUBLIC LICENSE","GPL"],["MTI","MIT"],["Mozilla Public License","MPL"],["Universal Permissive License","UPL"],["WTH","WTF"],["WTFGPL","WTFPL"],["-License",""]].sort(n),r=0,a=1,l=[function(c){return c.toUpperCase()},function(c){return c.trim()},function(c){return c.replace(/\./g,"")},function(c){return c.replace(/\s+/g,"")},function(c){return c.replace(/\s+/g,"-")},function(c){return c.replace("v","-")},function(c){return c.replace(/,?\s*(\d)/,"-$1")},function(c){return c.replace(/,?\s*(\d)/,"-$1.0")},function(c){return c.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2")},function(c){return c.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2.0")},function(c){return c[0].toUpperCase()+c.slice(1)},function(c){return c.replace("/","-")},function(c){return c.replace(/\s*V\s*(\d)/,"-$1").replace(/(\d)$/,"$1.0")},function(c){return c.indexOf("3.0")!==-1?c+"-or-later":c+"-only"},function(c){return c+"only"},function(c){return c.replace(/(\d)$/,"-$1.0")},function(c){return c.replace(/(-| )?(\d)$/,"-$2-Clause")},function(c){return c.replace(/(-| )clause(-| )(\d)/,"-$3-Clause")},function(c){return c.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i,"BSD-3-Clause")},function(c){return c.replace(/\bSimplified(-| )?BSD((-| )License)?/i,"BSD-2-Clause")},function(c){return c.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i,"BSD-2-Clause-$1BSD")},function(c){return c.replace(/\bClear(-| )?BSD((-| )License)?/i,"BSD-3-Clause-Clear")},function(c){return c.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i,"BSD-4-Clause")},function(c){return"CC-"+c},function(c){return"CC-"+c+"-4.0"},function(c){return c.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")},function(c){return"CC-"+c.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")+"-4.0"}],o=e.map(function(c){var L=/^(.*)-\d+\.\d+$/.exec(c);return L?[L[0],L[1]]:[c,null]}).reduce(function(c,L){var y=L[1];return c[y]=c[y]||[],c[y].push(L[0]),c},{}),h=Object.keys(o).map(function(L){return[L,o[L]]}).filter(function(L){return L[1].length===1&&L[0]!==null&&L[0]!=="APL"}).map(function(L){return[L[0],L[1][0]]});o=void 0;var f=[["UNLI","Unlicense"],["WTF","WTFPL"],["2 CLAUSE","BSD-2-Clause"],["2-CLAUSE","BSD-2-Clause"],["3 CLAUSE","BSD-3-Clause"],["3-CLAUSE","BSD-3-Clause"],["AFFERO","AGPL-3.0-or-later"],["AGPL","AGPL-3.0-or-later"],["APACHE","Apache-2.0"],["ARTISTIC","Artistic-2.0"],["Affero","AGPL-3.0-or-later"],["BEER","Beerware"],["BOOST","BSL-1.0"],["BSD","BSD-2-Clause"],["CDDL","CDDL-1.1"],["ECLIPSE","EPL-1.0"],["FUCK","WTFPL"],["GNU","GPL-3.0-or-later"],["LGPL","LGPL-3.0-or-later"],["GPLV1","GPL-1.0-only"],["GPL-1","GPL-1.0-only"],["GPLV2","GPL-2.0-only"],["GPL-2","GPL-2.0-only"],["GPL","GPL-3.0-or-later"],["MIT +NO-FALSE-ATTRIBS","MITNFA"],["MIT","MIT"],["MPL","MPL-2.0"],["X11","X11"],["ZLIB","Zlib"]].concat(h).sort(n),S=0,b=1,v=function(c){for(var L=0;L<l.length;L++){var y=l[L](c).trim();if(y!==c&&t(y))return y}return null},C=function(c){for(var L=c.toUpperCase(),y=0;y<f.length;y++){var i=f[y];if(L.indexOf(i[S])>-1)return i[b]}return null},m=function(c,L){for(var y=0;y<s.length;y++){var i=s[y],p=i[r];if(c.indexOf(p)>-1){var d=c.replace(p,i[a]),P=L(d);if(P!==null)return P}}return null};H=function(c,L){L=L||{};var y=L.upgrade===void 0?!0:!!L.upgrade;function i(D){return y?g(D):D}var p=typeof c=="string"&&c.trim().length!==0;if(!p)throw Error("Invalid argument. Expected non-empty string.");if(c=c.trim(),t(c))return i(c);var d=c.replace(/\+$/,"").trim();if(t(d))return i(d);var P=v(c);return P!==null||(P=m(c,function(D){return t(D)?D:v(D)}),P!==null)||(P=C(c),P!==null)||(P=m(c,C),P!==null)?i(P):null};function g(c){return["GPL-1.0","LGPL-1.0","AGPL-1.0","GPL-2.0","LGPL-2.0","AGPL-2.0","LGPL-2.1"].indexOf(c)!==-1?c+"-only":["GPL-1.0+","GPL-2.0+","GPL-3.0+","LGPL-2.0+","LGPL-2.1+","LGPL-3.0+","AGPL-1.0+","AGPL-3.0+"].indexOf(c)!==-1?c.replace(/\+$/,"-or-later"):["GPL-3.0","LGPL-3.0","AGPL-3.0"].indexOf(c)!==-1?c+"-or-later":c}return H}var j,ue;function Et(){if(ue)return j;ue=1;var u=we(),e=xt(),t='license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"',n=/^SEE LICEN[CS]E IN (.+)$/;function s(a,l){return l.slice(0,a.length)===a}function r(a){if(a.hasOwnProperty("license")){var l=a.license;return s("LicenseRef",l)||s("DocumentRef",l)}else return r(a.left)||r(a.right)}return j=function(a){var l;try{l=u(a)}catch{var o;if(a==="UNLICENSED"||a==="UNLICENCED")return{validForOldPackages:!0,validForNewPackages:!0,unlicensed:!0};if(o=n.exec(a))return{validForOldPackages:!0,validForNewPackages:!0,inFile:o[1]};var h={validForOldPackages:!1,validForNewPackages:!1,warnings:[t]};if(a.trim().length!==0){var f=e(a);f&&h.warnings.push('license is similar to the valid expression "'+f+'"')}return h}return r(l)?{validForNewPackages:!1,validForOldPackages:!1,spdx:!0,warnings:[t]}:{validForNewPackages:!0,validForOldPackages:!0,spdx:!0}},j}var xe={hasSubscribers:!1},A=xe,N=xe;import("node:diagnostics_channel").then(u=>{A=u.channel("lru-cache:metrics"),N=u.tracingChannel("lru-cache")}).catch(()=>{});var Ot=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,z=()=>A.hasSubscribers||N.hasSubscribers,Ee=new Set,pe=process||{},Nt=(u,e,t,n)=>{typeof pe.emitWarning=="function"?pe.emitWarning(u,e,t,n):console.error(`[${t}] ${e}: ${u}`)},Ft=u=>!Ee.has(u),O=u=>!!u&&u===Math.floor(u)&&u>0&&isFinite(u),Oe=u=>O(u)?u<=Math.pow(2,8)?Uint8Array:u<=Math.pow(2,16)?Uint16Array:u<=Math.pow(2,32)?Uint32Array:u<=Number.MAX_SAFE_INTEGER?B:null:null,B=class extends Array{constructor(e){super(e),this.fill(0)}},Gt=class ${heap;length;static#n=!1;static create(e){let t=Oe(e);if(!t)return[];$.#n=!0;let n=new $(e,t);return $.#n=!1,n}constructor(e,t){if(!$.#n)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},$t=class Ne{#n;#c;#t;#O;#g;#R;#I;#S;get perf(){return this.#S}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#o;#v;#s;#r;#e;#u;#f;#h;#a;#C;#l;#P;#y;#d;#m;#b;#T;#p;#N;static unsafeExposeInternals(e){return{starts:e.#y,ttls:e.#d,autopurgeTimers:e.#m,sizes:e.#P,keyMap:e.#s,keyList:e.#r,valList:e.#e,next:e.#u,prev:e.#f,get head(){return e.#h},get tail(){return e.#a},free:e.#C,isBackgroundFetch:t=>e.#i(t),backgroundFetch:(t,n,s,r)=>e.#k(t,n,s,r),moveToTail:t=>e.#B(t),indexes:t=>e.#D(t),rindexes:t=>e.#A(t),isStale:t=>e.#L(t)}}get max(){return this.#n}get maxSize(){return this.#c}get calculatedSize(){return this.#v}get size(){return this.#o}get fetchMethod(){return this.#R}get memoMethod(){return this.#I}get dispose(){return this.#t}get onInsert(){return this.#O}get disposeAfter(){return this.#g}constructor(e){let{max:t=0,ttl:n,ttlResolution:s=1,ttlAutopurge:r,updateAgeOnGet:a,updateAgeOnHas:l,allowStale:o,dispose:h,onInsert:f,disposeAfter:S,noDisposeOnSet:b,noUpdateTTL:v,maxSize:C=0,maxEntrySize:m=0,sizeCalculation:g,fetchMethod:c,memoMethod:L,noDeleteOnFetchRejection:y,noDeleteOnStaleGet:i,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:d,ignoreFetchAbort:P,backgroundFetchSize:D=1,perf:w}=e;if(this.backgroundFetchSize=D,w!==void 0&&typeof w?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#S=w??Ot,t!==0&&!O(t))throw new TypeError("max option must be a nonnegative integer");let x=t?Oe(t):Array;if(!x)throw new Error("invalid max value: "+t);if(this.#n=t,this.#c=C,this.maxEntrySize=m||this.#c,this.sizeCalculation=g,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(L!==void 0&&typeof L!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#I=L,c!==void 0&&typeof c!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#R=c,this.#T=!!c,this.#s=new Map,this.#r=Array.from({length:t}).fill(void 0),this.#e=Array.from({length:t}).fill(void 0),this.#u=new x(t),this.#f=new x(t),this.#h=0,this.#a=0,this.#C=Gt.create(t),this.#o=0,this.#v=0,typeof h=="function"&&(this.#t=h),typeof f=="function"&&(this.#O=f),typeof S=="function"?(this.#g=S,this.#l=[]):(this.#g=void 0,this.#l=void 0),this.#b=!!this.#t,this.#N=!!this.#O,this.#p=!!this.#g,this.noDisposeOnSet=!!b,this.noUpdateTTL=!!v,this.noDeleteOnFetchRejection=!!y,this.allowStaleOnFetchRejection=!!p,this.allowStaleOnFetchAbort=!!d,this.ignoreFetchAbort=!!P,this.maxEntrySize!==0){if(this.#c!==0&&!O(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!O(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#V()}if(this.allowStale=!!o,this.noDeleteOnStaleGet=!!i,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!l,this.ttlResolution=O(s)||s===0?s:1,this.ttlAutopurge=!!r,this.ttl=n||0,this.ttl){if(!O(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#_()}if(this.#n===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#n&&!this.#c){let I="LRU_CACHE_UNBOUNDED";Ft(I)&&(Ee.add(I),Nt("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",I,Ne))}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#_(){let e=new B(this.#n),t=new B(this.#n);this.#d=e,this.#y=t;let n=this.ttlAutopurge?Array.from({length:this.#n}):void 0;this.#m=n,this.#W=(o,h,f=this.#S.now())=>{t[o]=h!==0?f:0,e[o]=h,s(o,h)},this.#F=o=>{t[o]=e[o]!==0?this.#S.now():0,s(o,e[o])};let s=this.ttlAutopurge?(o,h)=>{if(n?.[o]&&(clearTimeout(n[o]),n[o]=void 0),h&&h!==0&&n){let f=setTimeout(()=>{this.#L(o)?(this.#w(this.#r[o],"expire"),n[o]=void 0):s(o,l(o))},h+1);f.unref&&f.unref(),n[o]=f}}:()=>{};this.#x=(o,h)=>{if(e[h]){let f=e[h],S=t[h];if(!f||!S)return;o.ttl=f,o.start=S,o.now=r||a();let b=o.now-S;o.remainingTTL=f-b}};let r=0,a=()=>{let o=this.#S.now();if(this.ttlResolution>0){r=o;let h=setTimeout(()=>r=0,this.ttlResolution);h.unref&&h.unref()}return o};this.getRemainingTTL=o=>{let h=this.#s.get(o);return h===void 0?0:l(h)};let l=o=>{let h=e[o],f=t[o];if(!h||!f)return 1/0;let S=(r||a())-f;return h-S};this.#L=o=>{let h=t[o],f=e[o];return!!f&&!!h&&(r||a())-h>f}}#F=()=>{};#x=()=>{};#W=()=>{};#L=()=>!1;#V(){let e=new B(this.#n);this.#v=0,this.#P=e,this.#G=t=>{this.#v-=e[t],e[t]=0},this.#H=(t,n,s,r)=>{if(!O(s)){if(this.#i(n))return this.backgroundFetchSize;if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(s=r(n,t),!O(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return s},this.#U=(t,n,s)=>{if(e[t]=n,this.#c){let r=this.#c-e[t];for(;this.#v>r;)this.#M(!0)}this.#v+=e[t],s&&(s.entrySize=n,s.totalCalculatedSize=this.#v)}}#G=e=>{};#U=(e,t,n)=>{};#H=(e,t,n,s)=>{if(n||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#D({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#a;this.#j(t)&&((e||!this.#L(t))&&(yield t),t!==this.#h);)t=this.#f[t]}*#A({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#h;this.#j(t)&&((e||!this.#L(t))&&(yield t),t!==this.#a);)t=this.#u[t]}#j(e){return e!==void 0&&this.#s.get(this.#r[e])===e}*entries(){for(let e of this.#D())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#i(this.#e[e])&&(yield[this.#r[e],this.#e[e]])}*rentries(){for(let e of this.#A())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#i(this.#e[e])&&(yield[this.#r[e],this.#e[e]])}*keys(){for(let e of this.#D()){let t=this.#r[e];t!==void 0&&!this.#i(this.#e[e])&&(yield t)}}*rkeys(){for(let e of this.#A()){let t=this.#r[e];t!==void 0&&!this.#i(this.#e[e])&&(yield t)}}*values(){for(let e of this.#D())this.#e[e]!==void 0&&!this.#i(this.#e[e])&&(yield this.#e[e])}*rvalues(){for(let e of this.#A())this.#e[e]!==void 0&&!this.#i(this.#e[e])&&(yield this.#e[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let n of this.#D()){let s=this.#e[n],r=this.#i(s)?s.__staleWhileFetching:s;if(r!==void 0&&e(r,this.#r[n],this))return this.#$(this.#r[n],t)}}forEach(e,t=this){for(let n of this.#D()){let s=this.#e[n],r=this.#i(s)?s.__staleWhileFetching:s;r!==void 0&&e.call(t,r,this.#r[n],this)}}rforEach(e,t=this){for(let n of this.#A()){let s=this.#e[n],r=this.#i(s)?s.__staleWhileFetching:s;r!==void 0&&e.call(t,r,this.#r[n],this)}}purgeStale(){let e=!1;for(let t of this.#A({allowStale:!0}))this.#L(t)&&(this.#w(this.#r[t],"expire"),e=!0);return e}info(e){let t=this.#s.get(e);if(t===void 0)return;let n=this.#e[t],s=this.#i(n)?n.__staleWhileFetching:n;if(s===void 0)return;let r={value:s};if(this.#d&&this.#y){let a=this.#d[t],l=this.#y[t];if(a&&l){let o=a-(this.#S.now()-l);r.ttl=o,r.start=Date.now()}}return this.#P&&(r.size=this.#P[t]),r}dump(){let e=[];for(let t of this.#D({allowStale:!0})){let n=this.#r[t],s=this.#e[t],r=this.#i(s)?s.__staleWhileFetching:s;if(r===void 0||n===void 0)continue;let a={value:r};if(this.#d&&this.#y){a.ttl=this.#d[t];let l=this.#S.now()-this.#y[t];a.start=Math.floor(Date.now()-l)}this.#P&&(a.size=this.#P[t]),e.unshift([n,a])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let s=Date.now()-n.start;n.start=this.#S.now()-s}this.#E(t,n.value,n)}}set(e,t,n={}){let{status:s=A.hasSubscribers?{}:void 0}=n;n.status=s,s&&(s.op="set",s.key=e,t!==void 0&&(s.value=t),s.cache=this);let r=this.#E(e,t,n);return s&&A.hasSubscribers&&A.publish(s),r}#E(e,t,n,s){let{ttl:r=this.ttl,start:a,noDisposeOnSet:l=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:h}=n,f=this.#i(t);if(t===void 0)return h&&(h.set="deleted"),this.delete(e),this;let{noUpdateTTL:S=this.noUpdateTTL}=n;h&&!f&&(h.value=t);let b=this.#H(e,t,n.size||0,o,h);if(this.maxEntrySize&&b>this.maxEntrySize)return this.#w(e,"set"),h&&(h.set="miss",h.maxEntrySizeExceeded=!0),this;let v=this.#o===0?void 0:this.#s.get(e);if(v===void 0)v=this.#o===0?this.#a:this.#C.length!==0?this.#C.pop():this.#o===this.#n?this.#M(!1):this.#o,this.#r[v]=e,this.#e[v]=t,this.#s.set(e,v),this.#u[this.#a]=v,this.#f[v]=this.#a,this.#a=v,this.#o++,this.#U(v,b,h),h&&(h.set="add"),S=!1,this.#N&&!f&&this.#O?.(t,e,"add");else{this.#B(v);let C=this.#e[v];if(t!==C){if(!l)if(this.#i(C)){C!==s&&C.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=C;m!==void 0&&m!==t&&(this.#b&&this.#t?.(m,e,"set"),this.#p&&this.#l?.push([m,e,"set"]))}else this.#b&&this.#t?.(C,e,"set"),this.#p&&this.#l?.push([C,e,"set"]);if(this.#G(v),this.#U(v,b,h),this.#e[v]=t,!f){let m=C&&this.#i(C)?C.__staleWhileFetching:C,g=m===void 0?"add":t!==m?"replace":"update";h&&(h.set=g,m!==void 0&&(h.oldValue=m)),this.#N&&this.onInsert?.(t,e,g)}}else f||(h&&(h.set="update"),this.#N&&this.onInsert?.(t,e,"update"))}if(r!==0&&!this.#d&&this.#_(),this.#d&&(S||this.#W(v,r,a),h&&this.#x(h,v)),!l&&this.#p&&this.#l){let C=this.#l,m;for(;m=C?.shift();)this.#g?.(...m)}return this}pop(){try{for(;this.#o;){let e=this.#e[this.#h];if(this.#M(!0),this.#i(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#p&&this.#l){let e=this.#l,t;for(;t=e?.shift();)this.#g?.(...t)}}}#M(e){let t=this.#h,n=this.#r[t],s=this.#e[t],r=this.#i(s);r&&s.__abortController.abort(new Error("evicted"));let a=r?s.__staleWhileFetching:s;return(this.#b||this.#p)&&a!==void 0&&(this.#b&&this.#t?.(a,n,"evict"),this.#p&&this.#l?.push([a,n,"evict"])),this.#G(t),this.#m?.[t]&&(clearTimeout(this.#m[t]),this.#m[t]=void 0),e&&(this.#r[t]=void 0,this.#e[t]=void 0,this.#C.push(t)),this.#o===1?(this.#h=this.#a=0,this.#C.length=0):this.#h=this.#u[t],this.#s.delete(n),this.#o--,t}has(e,t={}){let{status:n=A.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op="has",n.key=e,n.cache=this);let s=this.#K(e,t);return A.hasSubscribers&&A.publish(n),s}#K(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:s}=t,r=this.#s.get(e);if(r!==void 0){let a=this.#e[r];if(this.#i(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#L(r))s&&(s.has="stale",this.#x(s,r));else return n&&this.#F(r),s&&(s.has="hit",this.#x(s,r)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{status:n=z()?{}:void 0}=t;n&&(n.op="peek",n.key=e,n.cache=this),t.status=n;let s=this.#X(e,t);return A.hasSubscribers&&A.publish(n),s}#X(e,t){let{status:n,allowStale:s=this.allowStale}=t,r=this.#s.get(e);if(r===void 0||!s&&this.#L(r)){n&&(n.peek=r===void 0?"miss":"stale");return}let a=this.#e[r],l=this.#i(a)?a.__staleWhileFetching:a;return n&&(l!==void 0?(n.peek="hit",n.value=l):n.peek="miss"),l}#k(e,t,n,s){let r=t===void 0?void 0:this.#e[t];if(this.#i(r))return r;let a=new AbortController,{signal:l}=n;l?.addEventListener("abort",()=>a.abort(l.reason),{signal:a.signal});let o={signal:a.signal,options:n,context:s},h=(m,g=!1)=>{let{aborted:c}=a.signal,L=n.ignoreFetchAbort&&m!==void 0,y=n.ignoreFetchAbort||!!(n.allowStaleOnFetchAbort&&m!==void 0);if(n.status&&(c&&!g?(n.status.fetchAborted=!0,n.status.fetchError=a.signal.reason,L&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),c&&!L&&!g)return S(a.signal.reason,y);let i=v,p=this.#e[t];return(p===v||p===void 0&&L&&g)&&(m===void 0?i.__staleWhileFetching!==void 0?this.#e[t]=i.__staleWhileFetching:this.#w(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.#E(e,m,o.options,i))),m},f=m=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=m),S(m,!1)),S=(m,g)=>{let{aborted:c}=a.signal,L=c&&n.allowStaleOnFetchAbort,y=L||n.allowStaleOnFetchRejection,i=y||n.noDeleteOnFetchRejection,p=v;if(this.#e[t]===v&&(!i||!g&&p.__staleWhileFetching===void 0?this.#w(e,"fetch"):L||(this.#e[t]=p.__staleWhileFetching)),y)return n.status&&p.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw m},b=(m,g)=>{let c=this.#R?.(e,r,o);a.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(m(void 0),n.allowStaleOnFetchAbort&&(m=L=>h(L,!0)))}),c&&c instanceof Promise?c.then(L=>m(L===void 0?void 0:L),g):c!==void 0&&m(c)};n.status&&(n.status.fetchDispatched=!0);let v=new Promise(b).then(h,f),C=Object.assign(v,{__abortController:a,__staleWhileFetching:r,__returned:void 0});return t===void 0?(this.#E(e,C,{...o.options,status:void 0}),t=this.#s.get(e)):this.#e[t]=C,C}#i(e){if(!this.#T)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof AbortController}fetch(e,t={}){let n=N.hasSubscribers,{status:s=z()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let r=this.#z(e,t);return s&&n&&(s.trace=!0,N.tracePromise(()=>r,s).catch(()=>{})),r}async#z(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:o=0,sizeCalculation:h=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:S=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:b=this.allowStaleOnFetchRejection,ignoreFetchAbort:v=this.ignoreFetchAbort,allowStaleOnFetchAbort:C=this.allowStaleOnFetchAbort,context:m,forceRefresh:g=!1,status:c,signal:L}=t;if(c&&(c.op="fetch",c.key=e,g&&(c.forceRefresh=!0),c.cache=this),!this.#T)return c&&(c.fetch="get"),this.#$(e,{allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:r,status:c});let y={allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:r,ttl:a,noDisposeOnSet:l,size:o,sizeCalculation:h,noUpdateTTL:f,noDeleteOnFetchRejection:S,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:C,ignoreFetchAbort:v,status:c,signal:L},i=this.#s.get(e);if(i===void 0){c&&(c.fetch="miss");let p=this.#k(e,i,y,m);return p.__returned=p}else{let p=this.#e[i];if(this.#i(p)){let w=n&&p.__staleWhileFetching!==void 0;return c&&(c.fetch="inflight",w&&(c.returnedStale=!0)),w?p.__staleWhileFetching:p.__returned=p}let d=this.#L(i);if(!g&&!d)return c&&(c.fetch="hit"),this.#B(i),s&&this.#F(i),c&&this.#x(c,i),p;let P=this.#k(e,i,y,m),D=P.__staleWhileFetching!==void 0&&n;return c&&(c.fetch=d?"stale":"refresh",D&&d&&(c.returnedStale=!0)),D?P.__staleWhileFetching:P.__returned=P}}forceFetch(e,t={}){let n=N.hasSubscribers,{status:s=z()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let r=this.#J(e,t);return s&&n&&(s.trace=!0,N.tracePromise(()=>r,s).catch(()=>{})),r}async#J(e,t={}){let n=await this.#z(e,t);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,t={}){let{status:n=A.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op="memo",n.key=e,t.context&&(n.context=t.context),n.cache=this);let s=this.#Z(e,t);return n&&(n.value=s),A.hasSubscribers&&A.publish(n),s}#Z(e,t={}){let n=this.#I;if(!n)throw new Error("no memoMethod provided to constructor");let{context:s,status:r,forceRefresh:a,...l}=t;r&&a&&(r.forceRefresh=!0);let o=this.#$(e,l),h=a||o===void 0;if(r&&(r.memo=h?"miss":"hit",h||(r.value=o)),!h)return o;let f=n(e,o,{options:l,context:s});return r&&(r.value=f),this.#E(e,f,l),f}get(e,t={}){let{status:n=A.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op="get",n.key=e,n.cache=this);let s=this.#$(e,t);return n&&(s!==void 0&&(n.value=s),A.hasSubscribers&&A.publish(n)),s}#$(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:a}=t,l=this.#s.get(e);if(l===void 0){a&&(a.get="miss");return}let o=this.#e[l],h=this.#i(o);return a&&this.#x(a,l),this.#L(l)?h?(a&&(a.get="stale-fetching"),n&&o.__staleWhileFetching!==void 0?(a&&(a.returnedStale=!0),o.__staleWhileFetching):void 0):(r||this.#w(e,"expire"),a&&(a.get="stale"),n?(a&&(a.returnedStale=!0),o):void 0):(a&&(a.get=h?"fetching":"hit"),this.#B(l),s&&this.#F(l),h?o.__staleWhileFetching:o)}#Y(e,t){this.#f[t]=e,this.#u[e]=t}#B(e){e!==this.#a&&(e===this.#h?this.#h=this.#u[e]:this.#Y(this.#f[e],this.#u[e]),this.#Y(this.#a,e),this.#a=e)}delete(e){return this.#w(e,"delete")}#w(e,t){A.hasSubscribers&&A.publish({op:"delete",delete:t,key:e,cache:this});let n=!1;if(this.#o!==0){let s=this.#s.get(e);if(s!==void 0)if(this.#m?.[s]&&(clearTimeout(this.#m[s]),this.#m[s]=void 0),n=!0,this.#o===1)this.#q(t);else{this.#G(s);let r=this.#e[s];if(this.#i(r)?r.__abortController.abort(new Error("deleted")):(this.#b||this.#p)&&(this.#b&&this.#t?.(r,e,t),this.#p&&this.#l?.push([r,e,t])),this.#s.delete(e),this.#r[s]=void 0,this.#e[s]=void 0,s===this.#a)this.#a=this.#f[s];else if(s===this.#h)this.#h=this.#u[s];else{let a=this.#f[s];this.#u[a]=this.#u[s];let l=this.#u[s];this.#f[l]=this.#f[s]}this.#o--,this.#C.push(s)}}if(this.#p&&this.#l?.length){let s=this.#l,r;for(;r=s?.shift();)this.#g?.(...r)}return n}clear(){return this.#q("delete")}#q(e){for(let t of this.#A({allowStale:!0})){let n=this.#e[t];if(this.#i(n))n.__abortController.abort(new Error("deleted"));else{let s=this.#r[t];this.#b&&this.#t?.(n,s,e),this.#p&&this.#l?.push([n,s,e])}}if(this.#s.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#d&&this.#y){this.#d.fill(0),this.#y.fill(0);for(let t of this.#m??[])t!==void 0&&clearTimeout(t);this.#m?.fill(void 0)}if(this.#P&&this.#P.fill(0),this.#h=0,this.#a=0,this.#C.length=0,this.#v=0,this.#o=0,this.#p&&this.#l){let t=this.#l,n;for(;n=t?.shift();)this.#g?.(...n)}}};const Bt=Object.defineProperty({__proto__:null,LRUCache:$t},Symbol.toStringTag,{value:"Module"}),Rt=ie(Bt);var Y,fe;function It(){if(fe)return Y;fe=1;const u=(...r)=>r.every(a=>a)?r.join(""):"",e=r=>r?encodeURIComponent(r):"",t=r=>r.toLowerCase().replace(/^\W+/g,"").replace(/(?<!\W)\W+$/,"").replace(/\//g,"").replace(/\W+/g,"-"),n={sshtemplate:({domain:r,user:a,project:l,committish:o})=>`git@${r}:${a}/${l}.git${u("#",o)}`,sshurltemplate:({domain:r,user:a,project:l,committish:o})=>`git+ssh://git@${r}/${a}/${l}.git${u("#",o)}`,edittemplate:({domain:r,user:a,project:l,committish:o,editpath:h,path:f})=>`https://${r}/${a}/${l}${u("/",h,"/",e(o||"HEAD"),"/",f)}`,browsetemplate:({domain:r,user:a,project:l,committish:o,treepath:h})=>`https://${r}/${a}/${l}${u("/",h,"/",e(o))}`,browsetreetemplate:({domain:r,user:a,project:l,committish:o,treepath:h,path:f,fragment:S,hashformat:b})=>`https://${r}/${a}/${l}/${h}/${e(o||"HEAD")}/${f}${u("#",b(S||""))}`,browseblobtemplate:({domain:r,user:a,project:l,committish:o,blobpath:h,path:f,fragment:S,hashformat:b})=>`https://${r}/${a}/${l}/${h}/${e(o||"HEAD")}/${f}${u("#",b(S||""))}`,docstemplate:({domain:r,user:a,project:l,treepath:o,committish:h})=>`https://${r}/${a}/${l}${u("/",o,"/",e(h))}#readme`,httpstemplate:({auth:r,domain:a,user:l,project:o,committish:h})=>`git+https://${u(r,"@")}${a}/${l}/${o}.git${u("#",h)}`,filetemplate:({domain:r,user:a,project:l,committish:o,path:h})=>`https://${r}/${a}/${l}/raw/${e(o||"HEAD")}/${h}`,shortcuttemplate:({type:r,user:a,project:l,committish:o})=>`${r}:${a}/${l}${u("#",o)}`,pathtemplate:({user:r,project:a,committish:l})=>`${r}/${a}${u("#",l)}`,bugstemplate:({domain:r,user:a,project:l})=>`https://${r}/${a}/${l}/issues`,hashformat:t},s={};s.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:({auth:r,user:a,project:l,committish:o,path:h})=>`https://${u(r,"@")}raw.githubusercontent.com/${a}/${l}/${e(o||"HEAD")}/${h}`,gittemplate:({auth:r,domain:a,user:l,project:o,committish:h})=>`git://${u(r,"@")}${a}/${l}/${o}.git${u("#",h)}`,tarballtemplate:({domain:r,user:a,project:l,committish:o})=>`https://codeload.${r}/${a}/${l}/tar.gz/${e(o||"HEAD")}`,extract:r=>{let[,a,l,o,h]=r.pathname.split("/",5);if(!(o&&o!=="tree")&&(o||(h=r.hash.slice(1)),l&&l.endsWith(".git")&&(l=l.slice(0,-4)),!(!a||!l)))return{user:a,project:l,committish:h}}},s.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:({domain:r,user:a,project:l,committish:o,treepath:h,path:f,editpath:S})=>`https://${r}/${a}/${l}${u("/",h,"/",e(o||"HEAD"),"/",f,S)}`,tarballtemplate:({domain:r,user:a,project:l,committish:o})=>`https://${r}/${a}/${l}/get/${e(o||"HEAD")}.tar.gz`,extract:r=>{let[,a,l,o]=r.pathname.split("/",4);if(!["get"].includes(o)&&(l&&l.endsWith(".git")&&(l=l.slice(0,-4)),!(!a||!l)))return{user:a,project:l,committish:r.hash.slice(1)}}},s.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",tarballtemplate:({domain:r,user:a,project:l,committish:o})=>`https://${r}/api/v4/projects/${e(a+"/"+l)}/repository/archive.tar.gz?sha=${e(o||"HEAD")}`,extract:r=>{const a=r.pathname.slice(1);if(a.includes("/-/")||a.includes("/archive.tar.gz"))return;const l=a.split("/");let o=l.pop();o.endsWith(".git")&&(o=o.slice(0,-4));const h=l.join("/");if(!(!h||!o))return{user:h,project:o,committish:r.hash.slice(1)}}},s.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:({domain:r,project:a,committish:l})=>`git@${r}:${a}.git${u("#",l)}`,sshurltemplate:({domain:r,project:a,committish:l})=>`git+ssh://git@${r}/${a}.git${u("#",l)}`,edittemplate:({domain:r,user:a,project:l,committish:o,editpath:h})=>`https://${r}/${a}/${l}${u("/",e(o))}/${h}`,browsetemplate:({domain:r,project:a,committish:l})=>`https://${r}/${a}${u("/",e(l))}`,browsetreetemplate:({domain:r,project:a,committish:l,path:o,hashformat:h})=>`https://${r}/${a}${u("/",e(l))}${u("#",h(o))}`,browseblobtemplate:({domain:r,project:a,committish:l,path:o,hashformat:h})=>`https://${r}/${a}${u("/",e(l))}${u("#",h(o))}`,docstemplate:({domain:r,project:a,committish:l})=>`https://${r}/${a}${u("/",e(l))}`,httpstemplate:({domain:r,project:a,committish:l})=>`git+https://${r}/${a}.git${u("#",l)}`,filetemplate:({user:r,project:a,committish:l,path:o})=>`https://gist.githubusercontent.com/${r}/${a}/raw${u("/",e(l))}/${o}`,shortcuttemplate:({type:r,project:a,committish:l})=>`${r}:${a}${u("#",l)}`,pathtemplate:({project:r,committish:a})=>`${r}${u("#",a)}`,bugstemplate:({domain:r,project:a})=>`https://${r}/${a}`,gittemplate:({domain:r,project:a,committish:l})=>`git://${r}/${a}.git${u("#",l)}`,tarballtemplate:({project:r,committish:a})=>`https://codeload.github.com/gist/${r}/tar.gz/${e(a||"HEAD")}`,extract:r=>{let[,a,l,o]=r.pathname.split("/",4);if(o!=="raw"){if(!l){if(!a)return;l=a,a=null}return l.endsWith(".git")&&(l=l.slice(0,-4)),{user:a,project:l,committish:r.hash.slice(1)}}},hashformat:function(r){return r&&"file-"+t(r)}},s.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:({domain:r,user:a,project:l,committish:o,path:h})=>`https://${r}/${a}/${l}/blob/${e(o)||"HEAD"}/${h}`,httpstemplate:({domain:r,user:a,project:l,committish:o})=>`https://${r}/${a}/${l}${u("#",o)}`,tarballtemplate:({domain:r,user:a,project:l,committish:o})=>`https://${r}/${a}/${l}/archive/${e(o)||"HEAD"}.tar.gz`,bugstemplate:()=>null,extract:r=>{let[,a,l,o]=r.pathname.split("/",4);if(!["archive"].includes(o)&&(l&&l.endsWith(".git")&&(l=l.slice(0,-4)),!(!a||!l)))return{user:a,project:l,committish:r.hash.slice(1)}}};for(const[r,a]of Object.entries(s))s[r]=Object.assign({},n,a);return Y=s,Y}var q,de;function Fe(){if(de)return q;de=1;const u=(s,r,a)=>{const l=s.indexOf(a);return s.lastIndexOf(r,l>-1?l:1/0)},e=s=>{try{return new URL(s)}catch{}},t=(s,r)=>{const a=s.indexOf(":"),l=s.slice(0,a+1);if(Object.prototype.hasOwnProperty.call(r,l)||s.substr(a,3)==="://")return s;const o=s.indexOf("@");return o>-1?o>a?`git+ssh://${s}`:s:`${s.slice(0,a+1)}//${s.slice(a+1)}`},n=s=>{const r=u(s,"@","#"),a=u(s,":","#");return a>r&&(s=s.slice(0,a)+"/"+s.slice(a+1)),u(s,":","#")===-1&&s.indexOf("//")===-1&&(s=`git+ssh://${s}`),s};return q=(s,r)=>{const a=r?t(s,r):s;return e(a)||e(n(a))},q}var V,me;function Tt(){if(me)return V;me=1;const u=Fe(),e=t=>{const n=t.indexOf("#"),s=t.indexOf("/"),r=t.indexOf("/",s+1),a=t.indexOf(":"),l=/\s/.exec(t),o=t.indexOf("@"),h=!l||n>-1&&l.index>n,f=o===-1||n>-1&&o>n,S=a===-1||n>-1&&a>n,b=r===-1||n>-1&&r>n,v=s>0,C=n>-1?t[n-1]!=="/":!t.endsWith("/"),m=!t.startsWith(".");return h&&v&&C&&m&&f&&S&&b};return V=(t,n,{gitHosts:s,protocols:r})=>{if(!t)return;const a=e(t)?`github:${t}`:t,l=u(a,r);if(!l)return;const o=s.byShortcut[l.protocol],h=s.byDomain[l.hostname.startsWith("www.")?l.hostname.slice(4):l.hostname],f=o||h;if(!f)return;const S=s[o||h];let b=null;r[l.protocol]?.auth&&(l.username||l.password)&&(b=`${l.username}${l.password?":"+l.password:""}`);let v=null,C=null,m=null,g=null;try{if(o){let c=l.pathname.startsWith("/")?l.pathname.slice(1):l.pathname;const L=c.indexOf("@");L>-1&&(c=c.slice(L+1));const y=c.lastIndexOf("/");y>-1?(C=decodeURIComponent(c.slice(0,y)),C||(C=null),m=decodeURIComponent(c.slice(y+1))):m=decodeURIComponent(c),m.endsWith(".git")&&(m=m.slice(0,-4)),l.hash&&(v=decodeURIComponent(l.hash.slice(1))),g="shortcut"}else{if(!S.protocols.includes(l.protocol))return;const c=S.extract(l);if(!c)return;C=c.user&&decodeURIComponent(c.user),m=decodeURIComponent(c.project),v=decodeURIComponent(c.committish),g=r[l.protocol]?.name||l.protocol.slice(0,-1)}}catch(c){if(c instanceof URIError)return;throw c}return[f,C,b,m,v,g,n]},V}var K,Le;function Ut(){if(Le)return K;Le=1;const{LRUCache:u}=Rt,e=It(),t=Tt(),n=Fe(),s=new u({max:1e3});function r(l){try{const{protocol:o,hostname:h,pathname:f}=new URL(l);if(!h)return null;const S=/(?:git\+)http:$/.test(o)?"http:":"https:",b=f.replace(/\.git$/,"");return`${S}//${h}${b}`}catch{return null}}class a{constructor(o,h,f,S,b,v,C={}){Object.assign(this,a.#n[o],{type:o,user:h,auth:f,project:S,committish:b,default:v,opts:C})}static#n={byShortcut:{},byDomain:{}};static#c={"git+ssh:":{name:"sshurl"},"ssh:":{name:"sshurl"},"git+https:":{name:"https",auth:!0},"git:":{auth:!0},"http:":{auth:!0},"https:":{auth:!0},"git+http:":{auth:!0}};static addHost(o,h){a.#n[o]=h,a.#n.byDomain[h.domain]=o,a.#n.byShortcut[`${o}:`]=o,a.#c[`${o}:`]={name:o}}static fromUrl(o,h){if(typeof o!="string")return;const f=o+JSON.stringify(h||{});if(!s.has(f)){const S=t(o,h,{gitHosts:a.#n,protocols:a.#c});s.set(f,S?new a(...S):void 0)}return s.get(f)}static fromManifest(o,h={}){if(!o||typeof o!="object")return;const f=o.repository,S=f&&(typeof f=="string"?f:typeof f=="object"&&typeof f.url=="string"?f.url:null);if(!S)throw new Error("no repository");const b=S&&a.fromUrl(S.replace(/^git\+/,""),h)||null;if(b)return b;const v=r(S);return a.fromUrl(v,h)||v}static parseUrl(o){return n(o)}#t(o,h){if(typeof o!="function")return null;const f={...this,...this.opts,...h};f.path||(f.path=""),f.path.startsWith("/")&&(f.path=f.path.slice(1)),f.noCommittish&&(f.committish=null);const S=o(f);return f.noGitPlus&&S.startsWith("git+")?S.slice(4):S}hash(){return this.committish?`#${this.committish}`:""}ssh(o){return this.#t(this.sshtemplate,o)}sshurl(o){return this.#t(this.sshurltemplate,o)}browse(o,...h){return typeof o!="string"?this.#t(this.browsetemplate,o):typeof h[0]!="string"?this.#t(this.browsetreetemplate,{...h[0],path:o}):this.#t(this.browsetreetemplate,{...h[1],fragment:h[0],path:o})}browseFile(o,...h){return typeof h[0]!="string"?this.#t(this.browseblobtemplate,{...h[0],path:o}):this.#t(this.browseblobtemplate,{...h[1],fragment:h[0],path:o})}docs(o){return this.#t(this.docstemplate,o)}bugs(o){return this.#t(this.bugstemplate,o)}https(o){return this.#t(this.httpstemplate,o)}git(o){return this.#t(this.gittemplate,o)}shortcut(o){return this.#t(this.shortcuttemplate,o)}path(o){return this.#t(this.pathtemplate,o)}tarball(o){return this.#t(this.tarballtemplate,{...o,noCommittish:!1})}file(o,h){return this.#t(this.filetemplate,{...h,path:o})}edit(o,h){return this.#t(this.edittemplate,{...h,path:o})}getDefaultRepresentation(){return this.default}toString(o){return this.default&&typeof this[this.default]=="function"?this[this.default](o):this.sshurl(o)}}for(const[l,o]of Object.entries(e))a.addHost(l,o);return K=a,K}var X,ge;function Mt(){if(ge)return X;ge=1,X=u;function u(e){if(!e||e==="ERROR: No README data found!")return;e=e.trim().split(`
|
|
2
2
|
`);let t=0;for(;e[t]&&e[t].trim().match(/^(#|$)/);)t++;const n=e.length;let s=t+1;for(;s<n&&e[s].trim();)s++;return e.slice(t,s).join(" ").trim()}return X}var Ge={dependancies:"dependencies",dependecies:"dependencies",depdenencies:"dependencies",devEependencies:"devDependencies",depends:"dependencies","dev-dependencies":"devDependencies",devDependences:"devDependencies",devDepenencies:"devDependencies",devdependencies:"devDependencies",repostitory:"repository",repo:"repository",prefereGlobal:"preferGlobal",hompage:"homepage",hampage:"homepage",autohr:"author",autor:"author",contributers:"contributors",publicationConfig:"publishConfig",script:"scripts"},$e={web:"url",name:"url"},Be={server:"start",tests:"test"};const kt={topLevel:Ge,bugs:$e,script:Be},_t=Object.defineProperty({__proto__:null,bugs:$e,default:kt,script:Be,topLevel:Ge},Symbol.toStringTag,{value:"Module"}),Wt=ie(_t);var J,Se;function Ht(){if(Se)return J;Se=1;var{URL:u}=Pe,e=vt(),t=Ct(),n=Et(),s=Ut(),{isBuiltin:r}=ye,a=["dependencies","devDependencies","optionalDependencies"],l=Mt(),o=Wt,h=i=>i.includes("@")&&i.indexOf("@")<i.lastIndexOf(".");J={warn:function(){},fixRepositoryField:function(i){if(i.repositories&&(this.warn("repositories"),i.repository=i.repositories[0]),!i.repository)return this.warn("missingRepository");typeof i.repository=="string"&&(i.repository={type:"git",url:i.repository});var p=i.repository.url||"";if(p){var d=s.fromUrl(p);d&&(p=i.repository.url=d.getDefaultRepresentation()==="shortcut"?d.https():d.toString())}p.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)&&this.warn("brokenGitUrl",p)},fixTypos:function(i){Object.keys(o.topLevel).forEach(function(p){Object.prototype.hasOwnProperty.call(i,p)&&this.warn("typo",p,o.topLevel[p])},this)},fixScriptsField:function(i){if(i.scripts){if(typeof i.scripts!="object"){this.warn("nonObjectScripts"),delete i.scripts;return}Object.keys(i.scripts).forEach(function(p){typeof i.scripts[p]!="string"?(this.warn("nonStringScript"),delete i.scripts[p]):o.script[p]&&!i.scripts[o.script[p]]&&this.warn("typo",p,o.script[p],"scripts")},this)}},fixFilesField:function(i){var p=i.files;p&&!Array.isArray(p)?(this.warn("nonArrayFiles"),delete i.files):i.files&&(i.files=i.files.filter(function(d){return!d||typeof d!="string"?(this.warn("invalidFilename",d),!1):!0},this))},fixBinField:function(i){if(i.bin&&typeof i.bin=="string"){var p={},d;(d=i.name.match(/^@[^/]+[/](.*)$/))?p[d[1]]=i.bin:p[i.name]=i.bin,i.bin=p}},fixManField:function(i){i.man&&typeof i.man=="string"&&(i.man=[i.man])},fixBundleDependenciesField:function(i){var p="bundledDependencies",d="bundleDependencies";i[p]&&!i[d]&&(i[d]=i[p],delete i[p]),i[d]&&!Array.isArray(i[d])?(this.warn("nonArrayBundleDependencies"),delete i[d]):i[d]&&(i[d]=i[d].filter(function(P){return!P||typeof P!="string"?(this.warn("nonStringBundleDependency",P),!1):(i.dependencies||(i.dependencies={}),Object.prototype.hasOwnProperty.call(i.dependencies,P)||(this.warn("nonDependencyBundleDependency",P),i.dependencies[P]="*"),!0)},this))},fixDependencies:function(i){L(i,this.warn),g(i,this.warn),this.fixBundleDependenciesField(i),["dependencies","devDependencies"].forEach(function(p){if(p in i){if(!i[p]||typeof i[p]!="object"){this.warn("nonObjectDependencies",p),delete i[p];return}Object.keys(i[p]).forEach(function(d){var P=i[p][d];typeof P!="string"&&(this.warn("nonStringDependency",d,JSON.stringify(P)),delete i[p][d]);var D=s.fromUrl(i[p][d]);D&&(i[p][d]=D.toString())},this)}},this)},fixModulesField:function(i){i.modules&&(this.warn("deprecatedModules"),delete i.modules)},fixKeywordsField:function(i){typeof i.keywords=="string"&&(i.keywords=i.keywords.split(/,\s+/)),i.keywords&&!Array.isArray(i.keywords)?(delete i.keywords,this.warn("nonArrayKeywords")):i.keywords&&(i.keywords=i.keywords.filter(function(p){return typeof p!="string"||!p?(this.warn("nonStringKeyword"),!1):!0},this))},fixVersionField:function(i,p){var d=!p;if(!i.version)return i.version="",!0;if(!e(i.version,d))throw new Error('Invalid version: "'+i.version+'"');return i.version=t(i.version,d),!0},fixPeople:function(i){v(i,C),v(i,m)},fixNameField:function(i,p){typeof p=="boolean"?p={strict:p}:typeof p>"u"&&(p={});var d=p.strict;if(!i.name&&!d){i.name="";return}if(typeof i.name!="string")throw new Error("name field must be a string.");d||(i.name=i.name.trim()),b(i.name,d,p.allowLegacyCase),r(i.name)&&this.warn("conflictingName",i.name)},fixDescriptionField:function(i){i.description&&typeof i.description!="string"&&(this.warn("nonStringDescription"),delete i.description),i.readme&&!i.description&&(i.description=l(i.readme)),i.description===void 0&&delete i.description,i.description||this.warn("missingDescription")},fixReadmeField:function(i){i.readme||(this.warn("missingReadme"),i.readme="ERROR: No README data found!")},fixBugsField:function(i){if(!i.bugs&&i.repository&&i.repository.url){var p=s.fromUrl(i.repository.url);p&&p.bugs()&&(i.bugs={url:p.bugs()})}else if(i.bugs){if(typeof i.bugs=="string")h(i.bugs)?i.bugs={email:i.bugs}:u.canParse(i.bugs)?i.bugs={url:i.bugs}:this.warn("nonEmailUrlBugsString");else{y(i.bugs,this.warn);var d=i.bugs;i.bugs={},d.url&&(u.canParse(d.url)?i.bugs.url=d.url:this.warn("nonUrlBugsUrlField")),d.email&&(typeof d.email=="string"&&h(d.email)?i.bugs.email=d.email:this.warn("nonEmailBugsEmailField"))}!i.bugs.email&&!i.bugs.url&&(delete i.bugs,this.warn("emptyNormalizedBugs"))}},fixHomepageField:function(i){if(!i.homepage&&i.repository&&i.repository.url){var p=s.fromUrl(i.repository.url);p&&p.docs()&&(i.homepage=p.docs())}if(i.homepage){if(typeof i.homepage!="string")return this.warn("nonUrlHomepage"),delete i.homepage;u.canParse(i.homepage)||(i.homepage="http://"+i.homepage)}},fixLicenseField:function(i){const p=i.license||i.licence;if(!p)return this.warn("missingLicense");if(typeof p!="string"||p.length<1||p.trim()==="")return this.warn("invalidLicense");if(!n(p).validForNewPackages)return this.warn("invalidLicense")}};function f(i){if(i.charAt(0)!=="@")return!1;var p=i.slice(1).split("/");return p.length!==2?!1:p[0]&&p[1]&&p[0]===encodeURIComponent(p[0])&&p[1]===encodeURIComponent(p[1])}function S(i){return!i.match(/[/@\s+%:]/)&&i===encodeURIComponent(i)}function b(i,p,d){if(i.charAt(0)==="."||!(f(i)||S(i))||p&&!d&&i!==i.toLowerCase()||i.toLowerCase()==="node_modules"||i.toLowerCase()==="favicon.ico")throw new Error("Invalid name: "+JSON.stringify(i))}function v(i,p){return i.author&&(i.author=p(i.author)),["maintainers","contributors"].forEach(function(d){Array.isArray(i[d])&&(i[d]=i[d].map(p))}),i}function C(i){if(typeof i=="string")return i;var p=i.name||"",d=i.url||i.web,P=d?" ("+d+")":"",D=i.email||i.mail,w=D?" <"+D+">":"";return p+w+P}function m(i){if(typeof i!="string")return i;var p=i.match(/^([^(<]+)/),d=i.match(/\(([^()]+)\)/),P=i.match(/<([^<>]+)>/),D={};return p&&p[0].trim()&&(D.name=p[0].trim()),P&&(D.email=P[1]),d&&(D.url=d[1]),D}function g(i){var p=i.optionalDependencies;if(p){var d=i.dependencies||{};Object.keys(p).forEach(function(P){d[P]=p[P]}),i.dependencies=d}}function c(i,p,d){if(!i)return{};if(typeof i=="string"&&(i=i.trim().split(/[\n\r\s\t ,]+/)),!Array.isArray(i))return i;d("deprecatedArrayDependencies",p);var P={};return i.filter(function(D){return typeof D=="string"}).forEach(function(D){D=D.trim().split(/(:?[@\s><=])/);var w=D.shift(),x=D.join("");x=x.trim(),x=x.replace(/^@/,""),P[w]=x}),P}function L(i,p){a.forEach(function(d){i[d]&&(i[d]=c(i[d],d,p))})}function y(i,p){i&&Object.keys(i).forEach(function(d){o.bugs[d]&&(p("typo",d,o.bugs[d],"bugs"),i[o.bugs[d]]=i[d],delete i[d])})}return J}var Re="'repositories' (plural) Not supported. Please pick one as the 'repository' field",Ie="No repository field.",Te="Probably broken git url: %s",Ue="scripts must be an object",Me="script values must be string commands",ke="Invalid 'files' member",_e="Invalid filename in 'files' list: %s",We="Invalid 'bundleDependencies' list. Must be array of package names",He="Invalid bundleDependencies member: %s",je="Non-dependency in bundleDependencies: %s",ze="%s field must be an object",Ye="Invalid dependency: %s %s",qe="specifying %s as array is deprecated",Ve="modules field is deprecated",Ke="keywords should be an array of strings",Xe="keywords should be an array of strings",Je="%s is also the name of a node core module.",Ze="'description' field should be a string",Qe="No description",et="No README data",tt="No license field.",it="Bug string field must be url, email, or {email,url}",rt="bugs.url field must be a string url. Deleted.",nt="bugs.email field must be a string email. Deleted.",st="Normalized value of bugs field is an empty object. Deleted.",ot="homepage field must be a string url. Deleted.",at="license should be a valid SPDX license expression",lt="%s should probably be %s.";const jt={repositories:Re,missingRepository:Ie,brokenGitUrl:Te,nonObjectScripts:Ue,nonStringScript:Me,nonArrayFiles:ke,invalidFilename:_e,nonArrayBundleDependencies:We,nonStringBundleDependency:He,nonDependencyBundleDependency:je,nonObjectDependencies:ze,nonStringDependency:Ye,deprecatedArrayDependencies:qe,deprecatedModules:Ve,nonArrayKeywords:Ke,nonStringKeyword:Xe,conflictingName:Je,nonStringDescription:Ze,missingDescription:Qe,missingReadme:et,missingLicense:tt,nonEmailUrlBugsString:it,nonUrlBugsUrlField:rt,nonEmailBugsEmailField:nt,emptyNormalizedBugs:st,nonUrlHomepage:ot,invalidLicense:at,typo:lt},zt=Object.defineProperty({__proto__:null,brokenGitUrl:Te,conflictingName:Je,default:jt,deprecatedArrayDependencies:qe,deprecatedModules:Ve,emptyNormalizedBugs:st,invalidFilename:_e,invalidLicense:at,missingDescription:Qe,missingLicense:tt,missingReadme:et,missingRepository:Ie,nonArrayBundleDependencies:We,nonArrayFiles:ke,nonArrayKeywords:Ke,nonDependencyBundleDependency:je,nonEmailBugsEmailField:nt,nonEmailUrlBugsString:it,nonObjectDependencies:ze,nonObjectScripts:Ue,nonStringBundleDependency:He,nonStringDependency:Ye,nonStringDescription:Ze,nonStringKeyword:Xe,nonStringScript:Me,nonUrlBugsUrlField:rt,nonUrlHomepage:ot,repositories:Re,typo:lt},Symbol.toStringTag,{value:"Module"}),Yt=ie(zt);var Z,ve;function qt(){if(ve)return Z;ve=1;var u=Pt,e=Yt;Z=function(){var n=Array.prototype.slice.call(arguments,0),s=n.shift();if(s==="typo")return t.apply(null,n);var r=e[s]?e[s]:s+": '%s'";return n.unshift(r),u.format.apply(null,n)};function t(n,s,r){return r&&(n=r+"['"+n+"']",s=r+"['"+s+"']"),u.format(e.typo,n,s)}return Z}var Q,Ce;function Vt(){if(Ce)return Q;Ce=1,Q=r;var u=Ht();r.fixer=u;var e=qt(),t=["name","version","description","repository","modules","scripts","files","bin","man","bugs","keywords","readme","homepage","license"],n=["dependencies","people","typos"],s=t.map(function(l){return a(l)+"Field"});s=s.concat(n);function r(l,o,h){o===!0&&(o=null,h=!0),h||(h=!1),(!o||l.private)&&(o=function(){}),l.scripts&&l.scripts.install==="node-gyp rebuild"&&!l.scripts.preinstall&&(l.gypfile=!0),u.warn=function(){o(e.apply(null,arguments))},s.forEach(function(f){u["fix"+a(f)](l,h)}),l._id=l.name+"@"+l.version}function a(l){return l.charAt(0).toUpperCase()+l.slice(1)}return Q}var Kt=Vt();const Xt=St(Kt),Jt=(u,e,t)=>{const n=ee(u),s=ee(e),r=s===n?".":mt(n,s);return t.some(a=>{const l=a.startsWith("./")?a.slice(2):a,o=r.startsWith("./")?r.slice(2):r;if(l==="."&&o===".")return!0;if(l.endsWith("/**")){const h=l.slice(0,-3);return o===h||o.startsWith(`${h}/`)}if(l.endsWith("/*")){const h=l.slice(0,-2);return h===""?o!=="."&&!o.includes("/"):o.startsWith(`${h}/`)||o===h}return o===l||o.startsWith(`${l}/`)})},Zt=u=>{const e=be("pnpm-workspace.yaml",{cwd:ee(u),type:"file"});if(!e)return;const t=De(te(e)),n=Array.isArray(t.packages)?t.packages:[];if(!Jt(e,u,n))return;const s={};return t.catalog&&typeof t.catalog=="object"&&(s.catalog=t.catalog),t.catalogs&&typeof t.catalogs=="object"&&(s.catalogs=t.catalogs),Object.keys(s).length>0?s:void 0},Qt=(u,e,t)=>{if(e==="catalog:")return t.catalog?.[u];if(e.startsWith("catalog:")){const n=e.slice(8);return t.catalogs?.[n]?.[u]}},ei=(u,e)=>{for(const[t,n]of Object.entries(u)){if(typeof n!="string")continue;const s=Qt(t,n,e);s&&(u[t]=s)}},ti=(u,e)=>{const t=["dependencies","devDependencies","peerDependencies","optionalDependencies"];for(const n of t){if(!u[n]||typeof u[n]!="object")continue;const s=u[n];ei(s,e)}};let ii;const ri=u=>(ii??=dt(import.meta.url))(u),G=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,re=u=>{if(typeof G<"u"&&G.versions&&G.versions.node){const[e,t]=G.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return G.getBuiltinModule(u)}return ri(u)},{existsSync:Ri}=re("node:fs"),{createInterface:Ii}=re("node:readline"),{styleText:Ti}=re("node:util"),ni=new Set(["__proto__","prototype","constructor"]);Math.max(...[...ni].map(u=>u.length));typeof process.stdout<"u"&&globalThis.window;const si=/, ([^,]*)$/,oi=new Map,ai=(u,e={})=>{const t=e.strict&&e.ignoreWarnings?e.ignoreWarnings.map(String).toSorted((n,s)=>n.localeCompare(s)).join(","):"";return`${u}|s${String(e.strict?1:0)}|c${String(e.resolveCatalogs?1:0)}|j${String(e.json5===!1?0:1)}|y${String(e.yaml===!1?0:1)}|w${t}`};class li extends Error{constructor(e){super(`The following warnings were encountered while normalizing package data:
|
|
3
3
|
- ${e.join(`
|
|
4
|
-
- `)}`),this.name="PackageJsonValidationError"}}const ci=(u,e,t=[])=>{const n=[];if(Xt(u,s=>{n.push(s)},e),e&&n.length>0){const s=n.filter(r=>!t.some(a=>a instanceof RegExp?a.test(r):a===r));if(s.length>0)throw new li(s)}return u},hi=u=>{const e=te(u);return De(e)},ui=u=>{const e=te(u);return gt.parse(e)},pi=(u,e)=>e?.yaml!==!1&&(u.endsWith(".yaml")||u.endsWith(".yml"))?hi(u):e?.json5!==!1&&u.endsWith(".json5")?ui(u):yt(u),fi=(u,e={})=>{const t={type:"file"};u&&(t.cwd=u);const n=["package.json"];e.yaml!==!1&&n.push("package.yaml","package.yml"),e.json5!==!1&&n.push("package.json5");const s=be(n,t);if(!s)throw new Lt(`No such file or directory, for ${n.join(", ").replace(si," or $1")} found.`);const r=e.cache&&typeof e.cache!="boolean"?e.cache:oi,a=ai(s,e);if(e.cache&&r.has(a))return r.get(a);const l=pi(s,e);if(e.resolveCatalogs){const h=Zt(s);h&&ti(l,h)}ci(l,e.strict??!1,e.ignoreWarnings);const o={packageJson:l,path:s};return e.cache&&r.set(a,o),o};var di="6.
|
|
4
|
+
- `)}`),this.name="PackageJsonValidationError"}}const ci=(u,e,t=[])=>{const n=[];if(Xt(u,s=>{n.push(s)},e),e&&n.length>0){const s=n.filter(r=>!t.some(a=>a instanceof RegExp?a.test(r):a===r));if(s.length>0)throw new li(s)}return u},hi=u=>{const e=te(u);return De(e)},ui=u=>{const e=te(u);return gt.parse(e)},pi=(u,e)=>e?.yaml!==!1&&(u.endsWith(".yaml")||u.endsWith(".yml"))?hi(u):e?.json5!==!1&&u.endsWith(".json5")?ui(u):yt(u),fi=(u,e={})=>{const t={type:"file"};u&&(t.cwd=u);const n=["package.json"];e.yaml!==!1&&n.push("package.yaml","package.yml"),e.json5!==!1&&n.push("package.json5");const s=be(n,t);if(!s)throw new Lt(`No such file or directory, for ${n.join(", ").replace(si," or $1")} found.`);const r=e.cache&&typeof e.cache!="boolean"?e.cache:oi,a=ai(s,e);if(e.cache&&r.has(a))return r.get(a);const l=pi(s,e);if(e.resolveCatalogs){const h=Zt(s);h&&ti(l,h)}ci(l,e.strict??!1,e.ignoreWarnings);const o={packageJson:l,path:s};return e.cache&&r.set(a,o),o};var di="6.1.1";const mi={version:di},Li=mi.version,gi="@visulima/vis";let E;const Ui=()=>{if(E!==void 0)return E;const u=process.env.VIS_VERSION;if(u)return E=u,E;try{const{packageJson:e}=fi(pt(ft(import.meta.url)),{json5:!1,yaml:!1});if(e.name===gi&&typeof e.version=="string")return E=e.version,E}catch{}return E=Li,E};export{$i as P,Ei as a,Ni as b,Ai as c,Ui as g,Oi as i,wi as n,Fi as p,Di as r,xi as t,Gi as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as b}from"node:module";import{e as p}from"./index-BzhrR_iC.js";import{s as j}from"./index-B4AjSxHU.js";import{g as S}from"./env-BSXG3QKH.js";import{y as U}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{p as E}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";import{h as R}from"./writeFileSync-DJoHk3Ks-BPRoepNw.js";let _;const T=t=>(_??=b(import.meta.url))(t),d=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k=t=>{if(typeof d<"u"&&d.versions&&d.versions.node){const[e,s]=d.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return d.getBuiltinModule(t)}return T(t)},{rmSync:u,writeFileSync:C}=k("node:fs"),g=3,F=1800*1e3,A=15e3,v=()=>p(S(),"packuments"),y=t=>p(v(),`${encodeURIComponent(t)}.json`),M=t=>{const e=y(t);if(U(e))try{const s=E(e);if(s.cacheVersion!==g){u(e,{force:!0});return}if(Date.now()-s.createdAt>s.ttlMs){u(e,{force:!0});return}return s.packument}catch{u(e,{force:!0});return}},w=(t,e,s)=>{R(v());const o={cacheVersion:g,createdAt:Date.now(),packument:e,ttlMs:s};C(y(t),JSON.stringify(o),"utf8")},P=t=>{const e={},s=t.versions??{};for(const[a,r]of Object.entries(s)){const i=r.dist,n={version:a};if(r._npmUser!==void 0&&(n._npmUser=r._npmUser),r.maintainers!==void 0&&(n.maintainers=r.maintainers),r.bin!==void 0&&(n.bin=r.bin),i!==void 0){const c={};i.signatures!==void 0&&(c.signatures=i.signatures),i.attestations!==void 0&&(c.attestations=i.attestations),typeof i.integrity=="string"&&(c.integrity=i.integrity),typeof i.tarball=="string"&&(c.tarball=i.tarball),typeof i.unpackedSize=="number"&&Number.isFinite(i.unpackedSize)&&i.unpackedSize>=0&&(c.unpackedSize=i.unpackedSize),typeof i.fileCount=="number"&&Number.isInteger(i.fileCount)&&i.fileCount>=0&&(c.fileCount=i.fileCount),n.dist=c}r.repository!==void 0&&(n.repository=r.repository),r.license!==void 0&&(n.license=r.license),typeof r.readme=="string"&&(n.readme=r.readme),typeof r.readmeFilename=="string"&&(n.readmeFilename=r.readmeFilename),typeof r.private=="boolean"&&(n.private=r.private),typeof r.deprecated=="string"&&(n.deprecated=r.deprecated),r.scripts!==void 0&&typeof r.scripts=="object"&&(n.scripts=r.scripts),e[a]=n}const o={name:typeof t.name=="string"?t.name:"",versions:e};return t["dist-tags"]!==void 0&&(o["dist-tags"]=t["dist-tags"]),t.time!==void 0&&(o.time=t.time),typeof t.readme=="string"&&(o.readme=t.readme),o},D=t=>{const e={Accept:"application/json"};return t!==void 0&&t!==""&&(e.Authorization=`Bearer ${t}`),e},N=async(t,e)=>{if(e.registryUrl!==void 0)return{authToken:e.authToken,url:e.registryUrl};if(e.workspaceRoot!==void 0){const{getRegistryForPackage:s,loadNpmrc:o}=await import("../packem_chunks/catalog2.js"),a=o(e.workspaceRoot),{token:r,url:i}=s(t,a);return{authToken:e.authToken??r,url:i}}return{authToken:e.authToken,url:"https://registry.npmjs.org"}},x=async(t,e={})=>{const s=e.cacheTtlMs??F,o=M(t);if(o!==void 0)return o;if(e.offline)return;const a=await N(t,e),i=`${a.url.endsWith("/")?a.url.slice(0,-1):a.url}/${t.replace("/","%2f")}`,n=new AbortController,c=setTimeout(()=>{n.abort()},A),l=()=>{n.abort()};e.signal?.addEventListener("abort",l,{once:!0});try{const f=await fetch(i,{headers:D(a.authToken),signal:n.signal});if(f.status===404)return;if(!f.ok)throw new Error(`Registry returned ${String(f.status)} for ${t}`);const h=await f.json(),m=P(h);return w(t,m,s),m}finally{clearTimeout(c),e.signal?.removeEventListener("abort",l)}},B=(t,e)=>{const s=Object.keys(t.versions);if(s.length===0)return;if(e===void 0||e===""||e==="latest")return t["dist-tags"]?.latest??s.at(-1);const o=t["dist-tags"]?.[e];return o!==void 0?o:Object.hasOwn(t.versions,e)?e:j.maxSatisfying(s,e)??void 0};export{x as g,B as r};
|
package/dist/packem_shared/{project-name-filter-B1ZCsbOW.js → project-name-filter-ZQaLgytG.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as p}from"node:module";import{V as l}from"./vis-user-error-
|
|
1
|
+
import{createRequire as p}from"node:module";import{V as l}from"./vis-user-error-3YS7sPYy.js";let g;const m=e=>(g??=p(import.meta.url))(e),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=e=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[s,n]=c.versions.node.split(".").map(Number);if(s>22||s===22&&n>=3||s===20&&n>=16)return c.getBuiltinModule(e)}return m(e)},{createInterface:j}=h("node:readline"),y=e=>{const s=new Set;for(const n of Object.values(e.projects))for(const t of Object.keys(n.targets??{}))s.add(t);return[...s].sort()},b=e=>{const s=new Map;for(const n of e.values())for(const[t,o]of Object.entries(n))for(const r of o.aliases??[])s.has(r)||s.set(r,t);return s},$=(e,s)=>s.get(e)??e,w=(e,s)=>{if(e.length===0)return s.length;if(s.length===0)return e.length;const n=[];for(let t=0;t<=s.length;t++)n[t]=[t];for(let t=0;t<=e.length;t++)n[0][t]=t;for(let t=1;t<=s.length;t++)for(let o=1;o<=e.length;o++){const r=s[t-1]===e[o-1]?0:1;n[t][o]=Math.min(n[t-1][o]+1,n[t][o-1]+1,n[t-1][o-1]+r)}return n[s.length][e.length]},v=(e,s,n=3)=>f(e,s,1,n)[0],f=(e,s,n=3,t=3)=>{const o=[];for(const r of s){const i=w(e.toLowerCase(),r.toLowerCase());i<=t&&o.push({distance:i,name:r})}return o.sort((r,i)=>r.distance-i.distance||r.name.localeCompare(i.name)),o.slice(0,n).map(r=>r.name)},M=e=>e.length===0?" (no targets found)":e.map(s=>` - ${s}`).join(`
|
|
2
2
|
`),S=async e=>{if(e.length===0||!process.stdin.isTTY||!process.stdout.isTTY)return;const s=j({input:process.stdin,output:process.stdout});try{process.stdout.write(`Available targets:
|
|
3
3
|
`);for(const[r,i]of e.entries())process.stdout.write(` ${String(r+1).padStart(2," ")}. ${i}
|
|
4
4
|
`);process.stdout.write(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as i}from"./index-B4AjSxHU.js";import{g as u}from"./packument-
|
|
1
|
+
import{s as i}from"./index-B4AjSxHU.js";import{g as u}from"./packument-CbTmbHU4.js";import{c as d}from"../packem_chunks/cli-main.js";const v=8,h=async(r,e,o)=>{if(r.length===0)return[];const t=Math.max(1,Math.min(e,r.length)),s=Array.from({length:r.length});let n=0;const c=async()=>{for(;n<r.length;){const a=n;n+=1;const l=r[a];s[a]=await o(l,a)}};return await Promise.all(Array.from({length:t},()=>c())),s},f=(r,e)=>r.versions[e]?.dist?.attestations?.provenance!==void 0,p=(r,e)=>i.valid(e)?Object.keys(r.versions).filter(t=>i.valid(t)!==null&&i.lt(t,e)).filter(t=>i.satisfies(t,"*",{includePrerelease:!1})).filter(t=>f(r,t)).sort((t,s)=>i.lt(t,s)?1:-1)[0]:void 0,m=async(r,e={})=>{if(d("provenance"))return[];const o=new Set(e.allowlist),t=e.concurrency??v;return(await h(r,t,async({name:n,version:c})=>{if(o.has(n))return;const a=await u(n,{workspaceRoot:e.workspaceRoot});if(a===void 0||f(a,c))return;const l=p(a,c);if(l!==void 0)return{packageName:n,priorVersionWithProvenance:l,version:c}})).filter(n=>n!==void 0)};export{v as D,p as f,h as m,m as r};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import{DEFAULT_CHANGES_DIR as V}from"../packem_chunks/DEFAULT_CLEAN_KEEP.js";import{createShellRunner as _}from"../packem_chunks/shell-runner.js";import{r as F,b as W}from"./apply-DoeQAAGm.js";import{parseCatalogs as D}from"../packem_chunks/catalog.js";import{c as E}from"../packem_chunks/index3.js";import{r as M}from"../packem_chunks/context.js";import{escapeMarkdown as L}from"../packem_chunks/security.js";import{VisReleaseError as O}from"./VisReleaseError-DZtgcKf8.js";const B=/\{(name|version|previousVersion|date|repo|contributors)\}/g,U=(e,s)=>e.replaceAll(B,(i,p)=>s[p]??""),K=(e,s={})=>{const i=new Set;for(const n of s.internalAuthors??[]){const u=n.trim().toLowerCase().replace(/^@/,"");u.length>0&&i.add(u)}const p=new Set,g=[];for(const n of e){const u=n.meta?.author;if(u)for(const t of u.split(",")){const o=t.trim();if(!o)continue;const h=o.replace(/^@/,"");if(h.length===0)continue;const r=h.toLowerCase();p.has(r)||i.has(r)||(p.add(r),g.push(L(o)))}}return g.length===0?"":g.map(n=>`- ${n}`).join(`
|
|
2
|
+
`)},J=e=>e.length===0?"":`## Related releases
|
|
3
|
+
|
|
4
|
+
${e.map(i=>`- [${i.name}](${i.url})`).join(`
|
|
5
|
+
`)}`,Y=(e,s,i)=>{if(!s||!s.header&&!s.footer)return e;const p=n=>U(n,{contributors:i.contributors??"",date:i.date,name:i.name,previousVersion:i.previousVersion,repo:i.repo,version:i.version}).replaceAll(/\n{3,}/g,`
|
|
6
|
+
|
|
7
|
+
`).replace(/\s+$/,""),g=[];if(s.header){const n=p(s.header);n.length>0&&g.push(n)}if(g.push(e),s.footer){const n=p(s.footer);n.length>0&&g.push(n)}return g.join(`
|
|
8
|
+
|
|
9
|
+
`)},z=e=>{if(!Array.isArray(e))return;const[s,i]=e;if(s!=="github"||typeof i!="object"||i===null)return;const{internalAuthors:p}=i;if(Array.isArray(p))return p.filter(g=>typeof g=="string")},q=e=>(e.config.publish?.publishArgs??[]).includes("--provenance")&&e.pm.id!=="bun",X=async(e,s)=>{const{options:i,persistState:p,releases:g,result:n,state:u}=s,{removePendingStages:t,upsertPendingStages:o}=await import("../packem_chunks/staged-registry.js"),h=await e.pm.readCatalogYaml(e.cwd),r=D(h),c=e.depGraph.topologicalSort(g.map(l=>l.name)),w=new Map(g.map(l=>[l.name,l])),y=new Set,C=new Map;for(const l of e.plan.releases){const m=e.depGraph.getPackage(l.name);m&&C.set(l.name,{...m.manifest,version:l.newVersion})}const P={config:e.config,cwd:e.cwd},R=e.config.plugins?.length?await import("../packem_chunks/defineReleasePlugin.js"):void 0;for(const l of c){const m=w.get(l);if(!m){n.skipped.push({name:l,reason:"topo-sort returned a name not in the release plan (internal bug)"});continue}const f=e.depGraph.getPackage(l);if(!f)continue;const b=[...new Set(e.depGraph.getDependencies(l).filter(d=>d.kind!=="devDependencies"&&y.has(d.name)).map(d=>d.name))];if(b.length>0){n.skipped.push({name:l,reason:`dependency-failed: not published because ${b.join(", ")} failed to publish (publishing would orphan this package's dependency range)`}),y.add(l);continue}const a=e.perPackageConfig.get(l)??{},v=M(f,a),$=i.publishActionsOverride??E(v),k=i.tag??e.channel?.tag;if(R){const d=await R.runWillPublishHooks(P,{dir:f.dir,name:l,oldVersion:m.oldVersion,version:m.newVersion});if(d.skip){n.skipped.push({name:l,reason:`plugin-skipped${d.by?` by "${d.by}"`:""}`}),y.add(l);continue}}const A=s.stagedRegistry.pending.find(d=>d.name===l&&d.version===m.newVersion);try{const d=await $.publish({catalogs:r,cleanPackageJsonConfig:e.config.publish?.cleanPackageJson,dryRun:i.dryRun,otp:i.otp,perPackageConfig:a,pkg:f,pm:e.pm,provenance:q(e),registry:a.registry,release:m,resumeStageId:A?.id,tag:k,versionedManifestByName:C,workspaceConfig:e.config});if(d.published||d.alreadyPublished){const T=s.stagedRegistry.pending.filter(H=>H.name===l&&H.version===m.newVersion).map(H=>H.id);T.length>0&&(s.stagedRegistry=t(s.stagedRegistry,T))}if(d.published)n.published.push({name:l,stageId:d.stageId,tarball:d.tarball,version:m.newVersion}),u.published.push(`${l}@${m.newVersion}`),R&&await R.runAfterPublishHooks(P,{dir:f.dir,name:l,oldVersion:m.oldVersion,version:m.newVersion});else if(d.alreadyPublished)n.skipped.push({name:l,reason:"already-published"}),u.published.push(`${l}@${m.newVersion}`);else if(n.skipped.push({name:l,reason:d.output??"skipped"}),d.stageId){const T=(d.output??"").startsWith("stage-rejected")?"rejected":"timeout";s.stagedRegistry=o(s.stagedRegistry,[{id:d.stageId,name:l,reason:T,stagedAt:new Date().toISOString(),tag:k??"latest",version:m.newVersion}])}await p()}catch(d){n.failed.push({name:l,reason:d.message}),y.add(l)}}R&&await R.runAfterPublishAllHooks(P,{failed:n.failed.map(l=>({name:l.name,reason:l.reason})),published:n.published.map(l=>({name:l.name,version:l.version})),skipped:n.skipped.map(l=>({name:l.name,reason:l.reason}))})},Q=async(e,s,i,p)=>{const{createRemoteClient:g,detectRemoteProvider:n}=await import("../packem_chunks/detect.js"),u=await n(e.cwd,i,e.config.provider),t=g(u,{githubHost:e.config.githubHost,gitlabHost:e.config.gitlabHost,httpProxy:e.config.httpProxy}),o=await t.detectRepoSlug(e.cwd,i);if(!o)return;const h=typeof e.config.aggregateRelease=="object"?e.config.aggregateRelease:{enabled:e.config.aggregateRelease===!0},r=e.config.publish?.draftRelease===!0,c=e.config.publish?.discussionCategory,w=e.config.publish?.addReleases;if(h.enabled){const a=new Date().toISOString().slice(0,10),$=(h.title??"Release {date}").replaceAll("{date}",a),k=`release-${a}`,A=s.published.map(d=>`- \`${d.name}\` → ${d.version}`).join(`
|
|
10
|
+
`);try{const d=await t.createRelease(i,{body:A,cwd:e.cwd,discussionCategory:c,draft:r,repo:o,tag:k,title:$});if(d?.url)for(const T of s.published)T.url=d.url}catch{}return}const{defaultTagFor:y,renderTagPattern:C}=await import("../packem_chunks/git.js"),P=e.config.releaseTagPattern,R=e.channel?.tag,l=e.config.publish?.releaseAssets??{},m=new Date().toISOString().slice(0,10),f=z(e.config.changelog),b=K(e.plan.consumedChangeFiles??[],{internalAuthors:f});for(const a of p.groups){const v=a.members.map($=>`- \`${$}\` → ${s.published.find(k=>k.name===$)?.version??a.version}`).join(`
|
|
11
|
+
`);try{const $=await t.createRelease(i,{body:v,cwd:e.cwd,discussionCategory:c,draft:r,prerelease:a.version.includes("-"),repo:o,tag:a.tag,title:`${a.name} ${a.version}`});if($?.url)for(const k of s.published)a.members.includes(k.name)&&(k.url=$.url)}catch($){console.warn(`createRelease failed for group ${a.name} (tag ${a.tag}): ${$.message}`)}}for(const a of s.published){if(p.grouped.has(a.name))continue;const $=e.perPackageConfig.get(a.name)?.releaseTagPattern??P,k=$?C($,{channel:R,name:a.name,version:a.version}):y(a.name,a.version),A=a.version.includes("-");let d=`Release of ${a.name}@${a.version}.`;if(a.stageId&&(d=`${d}
|
|
12
|
+
|
|
13
|
+
> ⏳ **Staged — not yet installable.** Approve via \`vis release stage approve ${a.stageId}\` or the npmjs.com web UI.`),l.stampHashes&&a.tarball&&(d=`${d}
|
|
14
|
+
|
|
15
|
+
### Tarball integrity
|
|
16
|
+
|
|
17
|
+
- size: \`${a.tarball.size}\` bytes
|
|
18
|
+
- sha256: \`${a.tarball.sha256}\`
|
|
19
|
+
- sha512: \`${a.tarball.sha512}\``),w!==void 0&&w!==!1)try{const N=k.lastIndexOf("@"),S=N>0?k.slice(0,N+1):"",j=await t.listRecentReleases(i,{cwd:e.cwd,excludeTag:k,limit:5,repo:o,tagPrefix:S}),I=J(j);I&&(d=w==="top"?`${I}
|
|
20
|
+
|
|
21
|
+
${d}`:`${d}
|
|
22
|
+
|
|
23
|
+
${I}`)}catch{}const{releaseNoteTemplate:T}=e.config;if(T){const S=e.plan.releases.find(j=>j.name===a.name)?.oldVersion??"";d=Y(d,T,{contributors:b,date:m,name:a.name,previousVersion:S,repo:o,version:a.version})}const H=[];l.uploadTarball&&a.tarball&&H.push(a.tarball.path);try{const N=await t.createRelease(i,{assets:H.length>0?H:void 0,body:d,cwd:e.cwd,discussionCategory:c,draft:r,prerelease:A,repo:o,tag:k,title:`${a.name} v${a.version}`});N?.url&&(a.url=N.url)}catch(N){console.warn(`createRelease failed for ${a.name}@${a.version} (tag ${k}): ${N.message}`)}}},Z=async(e,s,i)=>{const{changesDir:p,options:g,persistState:n,result:u,runner:t,state:o}=s,{writeStagedRegistry:h}=await import("../packem_chunks/staged-registry.js");if(!g.dryRun&&u.published.length>0&&u.tagsPushed){e.config.publish?.noRelease!==!0&&await Q(e,u,t,i);try{const{walkSuccessfulRelease:r}=await import("../packem_chunks/success-walk.js"),{createRemoteClient:c,detectRemoteProvider:w}=await import("../packem_chunks/detect.js"),{resolveFormatter:y}=await import("../packem_chunks/resolveFormatter.js"),C=await w(e.cwd,t,e.config.provider),P=c(C,{githubHost:e.config.githubHost,gitlabHost:e.config.gitlabHost,httpProxy:e.config.httpProxy}),R=await P.detectRepoSlug(e.cwd,t),l=await y(e.config.changelog,e.cwd),{recordRecentlyWalked:m}=await import("../packem_chunks/staged-registry.js"),f=new Set([...o.walked??[],...(s.stagedRegistry.recentlyWalked??[]).map(a=>a.key)]),b={...u,published:u.published.filter(a=>!f.has(`${a.name}@${a.version}`))};if(b.published.length>0){const a=await r(e,b,t,{client:P,formatter:l,repo:R}),v=b.published.map($=>`${$.name}@${$.version}`);o.walked=[...o.walked??[],...v],await n(),s.stagedRegistry=m(s.stagedRegistry,v),a.warnings.length>0&&e.plan.warnings.push(...a.warnings)}}catch(r){e.plan.warnings.push(`successWalk: could not run post-release walk: ${r.message}`)}if(e.config.notifications)try{const{dispatchNotifications:r}=await import("../packem_chunks/interface.js"),{createRemoteClient:c,detectRemoteProvider:w}=await import("../packem_chunks/detect.js"),y=await w(e.cwd,t,e.config.provider),P=await c(y,{githubHost:e.config.githubHost,gitlabHost:e.config.gitlabHost,httpProxy:e.config.httpProxy}).detectRepoSlug(e.cwd,t);let R;try{const f=`${e.cwd}/package.json`,b=await import("node:fs/promises");R=JSON.parse(await b.readFile(f,"utf8")).name}catch{}const l=new Set([...o.notified??[],...(s.stagedRegistry.recentlyNotified??[]).map(f=>f.key)]),m=u.published.filter(f=>!l.has(`${f.name}@${f.version}`));if(m.length>0){const f=await r(e.config.notifications,{channel:e.channel?.tag,completedAt:new Date().toISOString(),...R===void 0?{}:{monorepoName:R},published:m.map(b=>({name:b.name,tag:e.channel?.tag,...b.url===void 0?{}:{url:b.url},version:b.version})),...P===void 0?{}:{repo:P},skipped:u.skipped.map(b=>({name:b.name,reason:b.reason}))},{warn:b=>e.plan.warnings.push(b)});if(f.succeeded.length>0){const b=m.map(v=>`${v.name}@${v.version}`);o.notified=[...o.notified??[],...b],await n();const{recordRecentlyNotified:a}=await import("../packem_chunks/staged-registry.js");s.stagedRegistry=a(s.stagedRegistry,b)}if(f.failed.length>0||f.succeeded.length>0){const b=f.succeeded.length+f.failed.length;if(f.failed.length>0){e.plan.warnings.push(`[notifications] dispatched ${f.succeeded.length}/${b} channels${f.succeeded.length>0?` (succeeded: ${f.succeeded.join(", ")})`:""}; ${f.failed.length} failed.`);for(const a of f.failed)e.plan.warnings.push(`[notifications:${a.id}] ${a.error}`)}}}}catch(r){e.plan.warnings.push(`notifications: dispatch failed: ${r.message}`)}if(!g.dryRun)try{const r=await h(e.cwd,p,s.stagedRegistry);if(r.changed){const{stageAndCommitFile:c}=await import("../packem_chunks/git.js");try{await c({cwd:e.cwd,runner:t},r.path,"chore(release): record cross-runner notify/walk dedupe [skip ci]",{author:e.config.gitUser,push:!g.noPush,sign:e.config.gitSignCommits===!0})}catch(w){process.stderr.write(`[vis release] Warning: could not commit ${r.path} (notify/walk dedupe): ${w.message}
|
|
24
|
+
`)}}}catch(r){process.stderr.write(`[vis release] Warning: could not update cross-runner dedupe registry: ${r.message}
|
|
25
|
+
`)}}},x=async e=>{const{defaultTagFor:s,floatingMajorTagFor:i,renderTagPattern:p}=await import("../packem_chunks/git.js"),{resolveSyncTagGroups:g}=await import("../packem_chunks/group-tags.js"),n=e.plan.releases.filter(r=>e.depGraph.getPackage(r.name)?.manifest?.private!==!0).map(r=>({name:r.name,version:r.newVersion})),u=g(e.config,n),t=u.groups.map(r=>r.tag),o=[],h=!!e.channel?.prerelease||!!e.preMode;for(const{name:r,version:c}of n){if(u.grouped.has(r))continue;const w=e.perPackageConfig.get(r),y=w?.releaseTagPattern??e.config.releaseTagPattern;if(t.push(y?p(y,{channel:e.channel?.tag,name:r,version:c}):s(r,c)),e.config.floatingMajorTag===!0&&!h&&!y?.includes("{major}")&&w?.skipNpmPublish!==!0){const C=i(r,c);C!==void 0&&o.push(C)}}return{created:t,updated:o}},ee=async(e,s,i)=>{if((await s.run("git",["remote","get-url","--push","origin"],{cwd:e.cwd,silent:!0})).exitCode!==0)return;const{getCurrentBranch:g,resolvePushCredentials:n,verifyPushAccess:u}=await import("../packem_chunks/git.js"),t={cwd:e.cwd,runner:s},o=await u(t);if(o!==void 0)return`Cannot push to origin, nothing was published. Set VIS_GH_TOKEN (or GITHUB_TOKEN / GITLAB_TOKEN) with write access, or pass --no-push. git said: ${o}`;const{createRemoteClient:h,detectRemoteProvider:r}=await import("../packem_chunks/detect.js");let c;try{c=await r(e.cwd,s,e.config.provider)}catch{return}if(c!=="github")return;const y=await h(c,{githubHost:e.config.githubHost,httpProxy:e.config.httpProxy}).detectRepoSlug(e.cwd,s);if(!y)return;const C=await n(t),P={...process.env};C!==void 0&&(P.GH_TOKEN=C.token),e.config.githubHost&&(P.GH_HOST=e.config.githubHost),e.config.httpProxy&&(P.HTTPS_PROXY=e.config.httpProxy,P.HTTP_PROXY=e.config.httpProxy);const{checkGithubPushRules:R}=await import("../packem_chunks/github-push-rules.js"),l=i.noTag?{created:[],updated:[]}:await x(e),m=await R(s,{branch:await g(t),createdTags:l.created,cwd:e.cwd,env:P,repo:y,signedCommits:e.config.gitSignCommits===!0,updatedTags:l.updated});for(const f of m.warnings)process.stderr.write(`[vis release] Warning: ${f}
|
|
26
|
+
`);if(m.blocked.length>0)return`GitHub push rules would reject this release, nothing was published:
|
|
27
|
+
- ${m.blocked.join(`
|
|
28
|
+
- `)}
|
|
29
|
+
Grant the pushing token a bypass, adjust the ruleset, or pass --no-push / --no-tag.`},ae=async(e,s,i,p)=>{if(!i.dryRun&&e.channel?.mode==="version-pr"){const{createRemoteClient:g,detectRemoteProvider:n}=await import("../packem_chunks/detect.js"),u=await n(e.cwd,s,e.config.provider),o=await g(u,{githubHost:e.config.githubHost,gitlabHost:e.config.gitlabHost,httpProxy:e.config.httpProxy}).detectRepoSlug(e.cwd,s),h=e.config.versionPr?.branch??"vis-release/version-packages";if(o)try{const r=await s.run("gh",["pr","list","--head",h,"--state","open","--json","number"],{cwd:e.cwd,silent:!0});if(r.exitCode===0&&r.stdout.trim()&&r.stdout.trim()!=="[]"){const c=JSON.parse(r.stdout);if(c[0])return p.failed.push({name:"_preflight",reason:`Open release PR #${c[0].number} exists. Merge or close it before publishing locally. (Override: --no-push then \`git push --tags\` manually.)`}),!0}}catch{}}if(!i.dryRun&&e.config.prePublishCommand)try{await F(e.cwd,e.config.prePublishCommand,"prePublishCommand")}catch(g){return p.failed.push({name:"_prePublishCommand",reason:g.message}),!0}if(!i.dryRun&&!i.noPush){const g=await ee(e,s,{noTag:i.noTag===!0});if(g!==void 0)return p.failed.push({name:"_pushAccess",reason:g}),!0}return!1},se=async(e,s)=>{const{changesDir:i,options:p,runner:g}=s,{writeStagedRegistry:n}=await import("../packem_chunks/staged-registry.js");if(!p.dryRun){const u=s.priorRegistrySnapshot.pending.length,t=s.stagedRegistry.pending.length,o=await n(e.cwd,i,s.stagedRegistry);if(o.changed){const{stageAndCommitFile:h}=await import("../packem_chunks/git.js");let r;if(o.removed)r="chore(release): clear pending stage registry [skip ci]";else if(t>u){const c=t-u;r=`chore(release): record ${c} new pending stage${c===1?"":"s"} [skip ci]`}else if(t<u){const c=u-t;r=`chore(release): drain ${c} resolved stage${c===1?"":"s"} [skip ci]`}else r=`chore(release): update pending stage registry (${t} pending) [skip ci]`;try{await h({cwd:e.cwd,runner:g},o.path,r,{author:e.config.gitUser,push:!p.noPush,sign:e.config.gitSignCommits===!0})}catch(c){process.stderr.write(`[vis release] Warning: could not commit ${o.path}: ${c.message}
|
|
30
|
+
`)}}}},ie=async(e,s)=>{const{options:i,result:p,runner:g}=s;if(!i.dryRun&&p.published.length>0&&e.config.workspaceChangelog!==!1){const n=e.config.workspaceChangelog,u=typeof n=="object"?n:void 0,t=typeof e.config.aggregateRelease=="object"?e.config.aggregateRelease.enabled:e.config.aggregateRelease===!0;if(u!==void 0||t)try{const{writeWorkspaceChangelogWave:o}=await import("../packem_chunks/workspace.js"),h=new Set(p.published.map(w=>w.name)),r=e.plan.releases.filter(w=>h.has(w.name)),c=await o({changelogConfig:e.config.changelog,cwd:e.cwd,workspaceChangelog:e.config.workspaceChangelog},r);if(c)try{const{stageAndCommitFile:w}=await import("../packem_chunks/git.js");await w({cwd:e.cwd,runner:g},c,"chore(release): record wave [skip ci]",{author:e.config.gitUser,push:!i.noPush,sign:e.config.gitSignCommits===!0})}catch(w){process.stderr.write(`[vis release] Warning: could not commit workspace CHANGELOG.md: ${w.message}
|
|
31
|
+
`)}}catch(o){process.stderr.write(`[vis release] Warning: could not write workspace CHANGELOG.md wave entry: ${o.message}
|
|
32
|
+
`)}}},G=async(e,s,i,p,g)=>{const{stageAndCommitFile:n}=await import("../packem_chunks/git.js"),{stateFilePath:u}=await import("../packem_chunks/state.js");try{const t=await n({cwd:e.cwd,runner:s},u(e.cwd,i,!0),`chore(release): ${p} publish lock [skip ci]`,{author:e.config.gitUser,push:!g.noPush,sign:e.config.gitSignCommits===!0});!g.noPush&&t.committed&&!t.pushed&&process.stderr.write(`[vis release] Warning: publish lock (${p}) was committed locally but could not be pushed — cross-runner resume may use a stale lock.
|
|
33
|
+
`)}catch(t){process.stderr.write(`[vis release] Warning: could not commit publish lock (${p}): ${t.message}
|
|
34
|
+
`)}},re=async(e,s,i,p)=>{const{filterPlanByState:g,newState:n,readState:u,writeState:t}=await import("../packem_chunks/state.js"),{readStagedRegistry:o}=await import("../packem_chunks/staged-registry.js"),h=e.config.changesDir??V,r=e.config.publish?.lockInGit===!0;let c=i.resume||r?await u(e.cwd,h,r):void 0;c&&r&&(c.channel=e.channel?.tag);const w=async()=>{i.dryRun||!c||(await t(e.cwd,h,c,r),r&&await G(e,s,h,"progress",{noPush:i.noPush}))};let y=await o(e.cwd,h);await W(e,"publish",y,{runner:s}),y=await o(e.cwd,h);const C={...y,pending:[...y.pending]};let{releases:P}=e.plan;return c?P=g(P,c):(c=n(e.channel?.tag,e.plan.releases),i.dryRun||(await t(e.cwd,h,c,r),r&&await G(e,s,h,"open",{noPush:i.noPush}))),{changesDir:h,lockInGit:r,options:i,persistState:w,priorRegistrySnapshot:C,releases:P,result:p,runner:s,stagedRegistry:y,state:c}},te=async(e,s,i)=>{const{changesDir:p,lockInGit:g,options:n,persistState:u,result:t,runner:o,state:h}=s,{clearState:r}=await import("../packem_chunks/state.js");if(!n.dryRun&&!n.noTag&&t.published.length>0){const{createOrUpdateFloatingTag:c,createTag:w,defaultTagFor:y,floatingMajorTagFor:C,pushTags:P,renderTagPattern:R}=await import("../packem_chunks/git.js"),l=e.config.releaseTagPattern,m=e.channel?.tag,f=e.config.floatingMajorTag===!0,b=!!e.channel?.prerelease||!!e.preMode;for(const{name:a,version:v}of t.published){if(i.grouped.has(a))continue;const k=e.perPackageConfig.get(a)?.releaseTagPattern??l,A=k?R(k,{channel:m,name:a,version:v}):y(a,v);try{await w({cwd:e.cwd,runner:o},A,`Release ${a}@${v}`,{signing:e.config.signing,skipRemoteCheck:e.firstRelease}),t.tags.push(A)}catch(S){e.firstRelease&&S instanceof O&&S.code==="TAG_COLLISION"?t.skipped.push({name:A,reason:"tag-creation: tag already exists (first-release — skipped)"}):t.failed.push({name:A,reason:`tag-creation: ${S.message}`})}const d=e.depGraph.getPackage(a),T=e.perPackageConfig.get(a),H=d?.manifest?.private===!0,N=T?.skipNpmPublish===!0;if(f&&!b&&!k?.includes("{major}")&&!H&&!N){const S=C(a,v);if(S!==void 0)try{await c({cwd:e.cwd,runner:o},S,{push:!n.noPush,signing:e.config.signing}),t.tags.push(S)}catch(j){t.skipped.push({name:S,reason:`floating-major-tag: ${j.message}`})}}}for(const a of i.groups)try{await w({cwd:e.cwd,runner:o},a.tag,`Release ${a.name} ${a.version}`,{signing:e.config.signing,skipRemoteCheck:e.firstRelease}),t.tags.push(a.tag)}catch(v){e.firstRelease&&v instanceof O&&v.code==="TAG_COLLISION"?t.skipped.push({name:a.tag,reason:"tag-creation: tag already exists (first-release — skipped)"}):t.failed.push({name:a.tag,reason:`tag-creation: ${v.message}`})}if(!n.noPush&&t.tags.length>0)try{await P({cwd:e.cwd,runner:o}),t.tagsPushed=!0}catch(a){t.tagsPushed=!1,t.failed.push({name:"_pushTags",reason:`git push --tags failed: ${a.message}. Retry with: git push --tags`})}h.tagged=[...t.tags],h.pushed=t.tagsPushed,await u(),t.failed.length===0&&!n.dryRun&&(await r(e.cwd,p,g),g&&await G(e,o,p,"close",{noPush:n.noPush}))}},he=async(e,s={})=>{const i={failed:[],published:[],skipped:[],tags:[],tagsPushed:!1},p=_();if(e.plan.releases.length===0||await ae(e,p,s,i))return i;const g=e.config.changesDir??V,{acquireLock:n,releaseLock:u}=await import("../packem_chunks/state.js");let t=!1;if(!s.dryRun)try{await n(e.cwd,g),t=!0}catch(o){return i.failed.push({name:"_lock",reason:o.message}),i}try{const o=await re(e,p,s,i);await X(e,o);const{resolveSyncTagGroups:h}=await import("../packem_chunks/group-tags.js"),r=h(e.config,i.published);if(await te(e,o,r),await se(e,o),await ie(e,o),await Z(e,o,r),!s.dryRun&&e.config.postPublishCommand)try{await F(e.cwd,e.config.postPublishCommand,"postPublishCommand")}catch(c){i.failed.push({name:"_postPublishCommand",reason:c.message})}return i}finally{t&&await u(e.cwd,g)}};export{he as p};
|