@visulima/vis 1.0.0-alpha.42 → 1.0.0-alpha.44
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 +54 -0
- package/LICENSE.md +256 -0
- package/bin/resolve-binary.mjs +85 -0
- package/bin/vis.mjs +76 -0
- package/dist/bin.d.ts +1 -0
- package/dist/bin.js +1 -2
- package/dist/binx.js +1 -1
- package/dist/config/index.js +1 -1
- package/dist/packem_chunks/CONFIG_FILES.js +8 -0
- package/dist/packem_chunks/bloom-status.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/catalog.js +113 -0
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +297 -434
- package/dist/packem_chunks/detect.js +3 -3
- package/dist/packem_chunks/dispatch.js +1 -1
- package/dist/packem_chunks/fix.js +1 -1
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +5 -1
- package/dist/packem_chunks/handler11.js +1 -5
- package/dist/packem_chunks/handler12.js +27 -1
- package/dist/packem_chunks/handler13.js +5 -27
- package/dist/packem_chunks/handler14.js +1 -5
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler16.js +1 -1
- package/dist/packem_chunks/handler17.js +1 -1
- package/dist/packem_chunks/handler18.js +1 -1
- package/dist/packem_chunks/handler19.js +5 -1
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +2 -5
- package/dist/packem_chunks/handler21.js +2 -2
- package/dist/packem_chunks/handler22.js +14 -2
- package/dist/packem_chunks/handler23.js +1 -5
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler25.js +1 -1
- package/dist/packem_chunks/handler26.js +5 -1
- package/dist/packem_chunks/handler27.js +1 -5
- package/dist/packem_chunks/handler28.js +3 -1
- package/dist/packem_chunks/handler29.js +1 -3
- package/dist/packem_chunks/handler3.js +4 -1
- package/dist/packem_chunks/handler30.js +1 -1
- package/dist/packem_chunks/handler31.js +2 -1
- package/dist/packem_chunks/handler32.js +2 -2
- package/dist/packem_chunks/handler33.js +2 -2
- package/dist/packem_chunks/handler34.js +3 -2
- package/dist/packem_chunks/handler35.js +6 -3
- package/dist/packem_chunks/handler36.js +1 -6
- package/dist/packem_chunks/handler37.js +42 -1
- package/dist/packem_chunks/handler38.js +8 -42
- package/dist/packem_chunks/handler39.js +9 -8
- package/dist/packem_chunks/handler4.js +4 -4
- package/dist/packem_chunks/handler40.js +75 -9
- package/dist/packem_chunks/handler41.js +5 -75
- package/dist/packem_chunks/handler42.js +4 -5
- package/dist/packem_chunks/handler43.js +3 -4
- package/dist/packem_chunks/handler44.js +2 -3
- package/dist/packem_chunks/handler45.js +1 -2
- package/dist/packem_chunks/handler46.js +1 -1
- package/dist/packem_chunks/handler47.js +1 -1
- package/dist/packem_chunks/handler48.js +3 -1
- package/dist/packem_chunks/handler49.js +1 -3
- package/dist/packem_chunks/handler5.js +6 -4
- package/dist/packem_chunks/handler50.js +7 -1
- package/dist/packem_chunks/handler51.js +32 -6
- package/dist/packem_chunks/handler52.js +3 -33
- package/dist/packem_chunks/handler53.js +8 -3
- package/dist/packem_chunks/handler54.js +2 -6
- package/dist/packem_chunks/handler55.js +1 -4
- package/dist/packem_chunks/handler56.js +12 -1
- package/dist/packem_chunks/handler57.js +5 -12
- package/dist/packem_chunks/handler58.js +11 -5
- package/dist/packem_chunks/handler59.js +3 -11
- package/dist/packem_chunks/handler6.js +8 -6
- package/dist/packem_chunks/handler60.js +22 -3
- package/dist/packem_chunks/handler61.js +60 -21
- package/dist/packem_chunks/handler62.js +3 -61
- package/dist/packem_chunks/handler63.js +6 -3
- package/dist/packem_chunks/handler64.js +9 -6
- package/dist/packem_chunks/handler65.js +2 -9
- package/dist/packem_chunks/handler66.js +13 -13
- package/dist/packem_chunks/handler67.js +5 -5
- package/dist/packem_chunks/handler68.js +1 -1
- package/dist/packem_chunks/handler69.js +4 -4
- package/dist/packem_chunks/handler7.js +1 -8
- package/dist/packem_chunks/handler70.js +16 -17
- package/dist/packem_chunks/handler71.js +12 -12
- package/dist/packem_chunks/handler72.js +5 -5
- package/dist/packem_chunks/handler73.js +7 -7
- package/dist/packem_chunks/handler74.js +3 -3
- package/dist/packem_chunks/handler75.js +3 -3
- package/dist/packem_chunks/handler76.js +63 -63
- package/dist/packem_chunks/handler77.js +1 -1
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/handler9.js +1 -1
- package/dist/packem_chunks/heal-accept.js +1 -1
- package/dist/packem_chunks/heal.js +1 -1
- package/dist/packem_chunks/help-command.js +1 -1
- package/dist/packem_chunks/index2.js +2 -2
- package/dist/packem_chunks/keys-refresh.js +1 -1
- package/dist/packem_chunks/lean.js +3 -3
- package/dist/packem_chunks/list.js +1 -1
- package/dist/packem_chunks/loader.js +1 -1
- package/dist/packem_chunks/loader2.js +1 -1
- package/dist/packem_chunks/orchestrator.js +19 -19
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/run.js +1 -1
- package/dist/packem_chunks/status.js +1 -1
- package/dist/packem_chunks/sync.js +1 -1
- package/dist/packem_chunks/sync2.js +1 -1
- package/dist/packem_chunks/tripwire.js +1 -1
- package/dist/packem_chunks/ts-loader.js +22 -2
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_chunks/version-resolver.js +1 -1
- package/dist/packem_shared/{advisories-aiDtubZQ.js → advisories-CefYKEPe.js} +1 -1
- package/dist/packem_shared/{affected-shas-C1XuRlvo.js → affected-shas-CwRY5aoc.js} +1 -1
- package/dist/packem_shared/{ai-analysis-CubpCxZJ.js → ai-analysis-CO6S0afy.js} +7 -7
- package/dist/packem_shared/{ai-fix-Btd5AnSr.js → ai-fix-CI0Vvqld.js} +9 -9
- package/dist/packem_shared/augment-DaSS2Lgs.js +4 -0
- package/dist/packem_shared/bin-P6Q5tKrP.js +1 -0
- package/dist/packem_shared/{build-scripts-Doxce2VM.js → build-scripts-MTSK6TNr.js} +1 -1
- package/dist/packem_shared/{command-runtime-RiCMa2C8.js → command-runtime-BE-vKsGH.js} +1 -1
- package/dist/packem_shared/{cyclonedx-NUJ9R2GQ.js → cyclonedx-BeUmPgfO.js} +1 -1
- package/dist/packem_shared/dependency-scan-DpOFiZuI.js +1 -0
- package/dist/packem_shared/{docker-DKlF-gk3.js → docker-CViFYtmM.js} +1 -1
- package/dist/packem_shared/env-C2ZCnfP_.js +27 -0
- package/dist/packem_shared/failure-log-jFfZRJK9.js +2 -0
- package/dist/packem_shared/glob-fqg4KepW-1S3z30c8.js +1 -0
- package/dist/packem_shared/index-B0EsgdzO.js +1 -0
- package/dist/packem_shared/index-CE6MsgcV.js +22 -0
- package/dist/packem_shared/index-CQjzW7m8.js +1 -0
- package/dist/packem_shared/{index-Cb4x6lWY.js → index-Cg0IHaFI.js} +1 -1
- package/dist/packem_shared/{index-CPhv-r4c.js → index-D7EZ612R.js} +13 -13
- package/dist/packem_shared/{lifecycle-D5roTh0a.js → lifecycle-Dyb47wbD.js} +1 -1
- package/dist/packem_shared/{lockfile-DIGyLfmF.js → lockfile-C1qCKGH6.js} +1 -1
- package/dist/packem_shared/{manifests-pLwnVmCN.js → manifests-WBnsV_Eb.js} +1 -1
- package/dist/packem_shared/{min-release-age-pUAqTiv3.js → min-release-age-C71MO72F.js} +1 -1
- package/dist/packem_shared/missing-package-json-CTF71tE5.js +1 -0
- package/dist/packem_shared/{native-config-sync-4K9wWTj5.js → native-config-sync-BFDVK9LH.js} +4 -4
- package/dist/packem_shared/{osv-bloom-OuTfu_LE.js → osv-bloom-BsQ-aFiM.js} +1 -1
- package/dist/packem_shared/packument-DquNPIq9.js +1 -0
- package/dist/packem_shared/{pm-runner-Dws_Bw1y.js → pm-runner-D4jM58Oz.js} +1 -1
- package/dist/packem_shared/prompt-DjXHVgYU.js +1 -0
- package/dist/packem_shared/provenance-DIq8KyBV.js +1 -0
- package/dist/packem_shared/readJsonSync-CvkZyKmL-ihoybKvs.js +1 -0
- package/dist/packem_shared/registry-keys-C8K11ets.js +1 -0
- package/dist/packem_shared/resolve-explicit-Dr4kIybR.js +5 -0
- package/dist/packem_shared/{resolve-runtime-CJSWV-K8.js → resolve-runtime-Tx0bvg0h.js} +1 -1
- package/dist/packem_shared/run-file-DD7Ne23Z.js +1 -0
- package/dist/packem_shared/{runtime-check-0lUJvgKt.js → runtime-check-BXehSP06.js} +1 -1
- package/dist/packem_shared/s1ngularity-CtMmtXJo.js +1 -0
- package/dist/packem_shared/scan-progress-D4yywI6P.js +2 -0
- package/dist/packem_shared/{selectors-UmnAuc26.js → selectors-D4iCvITE.js} +1 -1
- package/dist/packem_shared/{signatures-BOUhghTv.js → signatures-CE8OAK-i.js} +2 -2
- package/dist/packem_shared/spinner-DuJJvFTl.js +1 -0
- package/dist/packem_shared/tabs-CgxCvjCY.js +1 -0
- package/dist/packem_shared/target-merge-DOm6h6tW.js +11 -0
- package/dist/packem_shared/target-options-CR0OuYJr.js +1 -0
- package/dist/packem_shared/toolchain-C44mPKPu.js +5 -0
- package/dist/packem_shared/{typosquats-DBOvXwph.js → typosquats-CQz-1Y6K.js} +1 -1
- package/dist/packem_shared/use-measured-height-XK9YSwtv.js +1 -0
- package/dist/packem_shared/utils-CRueU43T.js +1 -0
- package/dist/packem_shared/verify-DStfg3nb.js +1 -0
- package/dist/packem_shared/vis-update-app-Cpme_3Du.js +1 -0
- package/dist/packem_shared/{watch-Bkp_AAbc.js → watch-BXNI7dC6.js} +1 -1
- package/dist/packem_shared/watch-loop-JfGKIgKB.js +11 -0
- package/dist/packem_shared/window-ops-DDePlWLV.js +2 -0
- package/dist/runtime/preload.js +1 -1
- package/index.js +52 -52
- package/package.json +17 -13
- package/dist/packem_chunks/config.js +0 -18
- package/dist/packem_shared/CONFIG_FILES-MsOntfYT.js +0 -1
- package/dist/packem_shared/augment-8fIWWGSc.js +0 -3
- package/dist/packem_shared/bin-CnDBuLh3.js +0 -2
- package/dist/packem_shared/dependency-scan-B0HV_qeB.js +0 -1
- package/dist/packem_shared/failure-log-C7r6UZLP.js +0 -2
- package/dist/packem_shared/glob-fqg4KepW-7Bs2kZuM.js +0 -1
- package/dist/packem_shared/index-BKFEWXU_.js +0 -1
- package/dist/packem_shared/index-OQZQyN5R.js +0 -19
- package/dist/packem_shared/missing-package-json-DhYzuKhD.js +0 -1
- package/dist/packem_shared/provenance-C0P-UYOM.js +0 -1
- package/dist/packem_shared/readJsonSync-CvkZyKmL-CY7PZob_.js +0 -4
- package/dist/packem_shared/registry-keys-D4chF-Wj.js +0 -1
- package/dist/packem_shared/resolve-explicit-Cgheka3B.js +0 -5
- package/dist/packem_shared/run-file-B4TqKa0X.js +0 -1
- package/dist/packem_shared/s1ngularity-Du1NnSFP.js +0 -1
- package/dist/packem_shared/scan-progress-CN9ONR0y.js +0 -2
- package/dist/packem_shared/spinner-lhXugSx3.js +0 -1
- package/dist/packem_shared/tabs-DTiU3usb.js +0 -1
- package/dist/packem_shared/target-options-ChWcK60i.js +0 -1
- package/dist/packem_shared/toolchain-DyCKnGch.js +0 -5
- package/dist/packem_shared/use-measured-height-CK2Co3XI.js +0 -1
- package/dist/packem_shared/utils-Cxree603.js +0 -1
- package/dist/packem_shared/verify-CVPYlUrF.js +0 -1
- package/dist/packem_shared/vis-update-app-DtHkwBca.js +0 -1
- package/dist/packem_shared/watch-loop-D9zbXzRd.js +0 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as m}from"node:module";import{w as d,M as _}from"../packem_shared/pm-runner-
|
|
1
|
+
import{createRequire as m}from"node:module";import{w as d,M as _}from"../packem_shared/pm-runner-D4jM58Oz.js";const w=m(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,g=e=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[t,r]=o.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return o.getBuiltinModule(e)}return w(e)},{createInterface:y}=g("node:readline"),s="sigstore",$=()=>!!process.stdout.isTTY&&process.env.CI!=="true",v=e=>new Promise(t=>{const r=y({input:process.stdin,output:process.stderr});r.question(`${e} (Y/n) `,i=>{r.close();const n=i.trim().toLowerCase();t(n===""||n==="y"||n==="yes")})}),h=e=>{const t=d(e),r=_(t,{exact:!1,filter:[],global:!1,optional:!1,packages:[s],peer:!1,saveDev:!0,workspace:!1,workspaceRoot:!1},e,console);return Promise.resolve({exitCode:r})},R=()=>{try{return import.meta.resolve(s),!0}catch{return!1}},I=e=>{let t="pnpm";try{t=d(e).name}catch{}switch(t){case"bun":return`bun add -d ${s}`;case"npm":return`npm install -D ${s}`;case"yarn":return`yarn add -D ${s}`;default:return`pnpm add -D ${s}`}},D=()=>import("sigstore"),T=async(e={})=>{const t=e.interactive??$(),r=e.prompt??v,i=e.runInstall??h,n=e.importImpl??D,l=e.workspaceRoot??process.cwd(),a=I(l);try{return await n()}catch(p){const{code:u,message:f}=p;if(!(u==="ERR_MODULE_NOT_FOUND"||u==="MODULE_NOT_FOUND")||!f.includes(s))throw p}if(!t)throw new Error(`${s} is not installed. \`vis attest\` needs it for keyless signing/verification. Install it in your repo first:
|
|
2
2
|
${a}`);if(!await r(`${s} isn't installed. Install it now?`))throw new Error(`${s} install declined. Re-run \`vis attest\` after installing manually:
|
|
3
3
|
${a}`);const c=await i(l);if(c.exitCode!==0)throw new Error(`Install of ${s} failed (exit ${String(c.exitCode)}). Install manually and retry:
|
|
4
4
|
${a}`);return await n()};export{I as installCommandFor,R as isSigstoreInstalled,T as loadOptionalSigstore};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{i as r}from"./ts-loader.js";const n=(t,o)=>{if(!o||typeof o!="object")throw new TypeError(`${t}: default export must be an object (got ${o===null?"null":typeof o}). Use createTemplate({ ... }).`);const e=o;if(typeof e.about!="object"||e.about===null)throw new TypeError(`${t}: default export missing required "about" object`);if(typeof e.produce!="function")throw new TypeError(`${t}: default export missing required "produce" function`);return o},a=async t=>{const o=(await r(t)).default??null;return n(t,o)};export{a as loadNativeTemplate};
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import{createRequire as
|
|
2
|
-
`).trim();return{meta:Object.keys(t).length>0?t:void 0,remainder:s}},
|
|
3
|
-
`):"{}"}else{const n=[`${
|
|
1
|
+
import{createRequire as Se}from"node:module";import{u as x}from"../packem_shared/index-Cg0IHaFI.js";import{DEFAULT_CHANGES_DIR as X,DEFAULT_DEPENDENCY_BUMP_RULES as Le,DEFAULT_CONFIG as Be}from"./DEFAULT_CLEAN_KEEP.js";import{VisReleaseError as R}from"../packem_shared/VisReleaseError-DMGRBTNO.js";import{e as Te,p as xe,c as Ge}from"./registry.js";import{E as He}from"../packem_shared/public-api-WqUCiyIe.js";import{BUMP_LEVELS as le,maxBump as oe,bumpRank as K,normaliseGroup as ge}from"../release/types.js";import Q from"./index.js";import{d as We,c as Ye}from"./detect.js";import{escapeMarkdown as Je,assertValidPackageName as ze}from"./security.js";import{createShellRunner as z}from"./shell-runner.js";const Ve=Se(import.meta.url),W=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,pe=e=>{if(typeof W<"u"&&W.versions&&W.versions.node){const[a,t]=W.versions.node.split(".").map(Number);if(a>22||a===22&&t>=3||a===20&&t>=16)return W.getBuiltinModule(e)}return Ve(e)},{readdir:Ee,readFile:Fe,writeFile:_e,unlink:Oe}=pe("node:fs/promises"),{resolve:re,sep:Y,join:Ue}=pe("node:path"),{realpathSync:me}=pe("node:fs"),qe=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/,Xe=e=>{const a=qe.exec(e);return a?{body:(a[2]??"").trim(),frontmatter:a[1]??""}:null},Ke=/^(?:@[a-z0-9-]+\/)?[\w.-]+$/i,Qe=214,Ze=e=>e.length===0||e.length>Qe||e.startsWith(".")||e.startsWith("_")||e.startsWith("-")?!1:Ke.test(e),ie=e=>typeof e=="string"&&le.includes(e),ea=/^\s*(pr|commit|author)\s*:\s*(.+?)\s*$/i,aa=e=>{const a=e.split(/\r?\n/),t={};let n=0;for(const c of a){if(c.trim()===""){n+=1;continue}const d=ea.exec(c);if(!d)break;const[,l="",o=""]=d;switch(l.toLowerCase()){case"author":{t.author=o.startsWith("@")?o:`@${o}`;break}case"commit":{t.commit=o;break}case"pr":{const r=Number.parseInt(o,10);!Number.isNaN(r)&&r>0&&(t.pr=r);break}}n+=1}const s=a.slice(n).join(`
|
|
2
|
+
`).trim();return{meta:Object.keys(t).length>0?t:void 0,remainder:s}},ue=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&"bump"in e,ta=(e,a,t)=>{if(!ie(a.bump))throw new R({code:"BUMP_FILE_INVALID",file:t,message:`Invalid bump level for "${e}": ${JSON.stringify(a.bump)}. Expected one of: ${le.join(", ")}`,packageName:e});const n={bump:a.bump,package:e};if(a.releaseAs!==void 0){if(typeof a.releaseAs!="string"||!/^\d+\.\d+\.\d+(?:[-+].*)?$/.test(a.releaseAs))throw new R({code:"BUMP_FILE_INVALID",file:t,message:`Invalid releaseAs for "${e}": ${JSON.stringify(a.releaseAs)}. Expected a semver string like "2.0.0" or "2.0.0-rc.1".`,packageName:e});n.releaseAs=a.releaseAs}if(a.cascade!==void 0){if(typeof a.cascade!="object"||a.cascade===null||Array.isArray(a.cascade))throw new R({code:"BUMP_FILE_INVALID",file:t,message:`Cascade block for "${e}" must be an object mapping package globs to bump levels.`,packageName:e});const s={};for(const[c,d]of Object.entries(a.cascade)){if(!ie(d))throw new R({code:"BUMP_FILE_INVALID",file:t,message:`Invalid cascade bump level for "${c}": ${JSON.stringify(d)}.`,packageName:e});s[c]=d}n.cascade=s}return n},te=e=>e.replaceAll(/^.*[/\\]/g,"").replace(/\.md$/i,""),na=(e,a)=>{const t=Xe(e);if(!t)throw new R({code:"BUMP_FILE_INVALID",file:a,message:"Change file is missing YAML frontmatter (expected `---` delimiters)."});let n;try{n=He(t.frontmatter,{schema:"core",strict:!0})}catch(o){throw new R({cause:o,code:"BUMP_FILE_INVALID",file:a,message:`YAML parse failed: ${o.message}`})}if(n==null)return{body:t.body.trim(),id:te(a),path:a,payload:{bumps:{}}};if(typeof n!="object"||Array.isArray(n))throw new R({code:"BUMP_FILE_INVALID",file:a,message:"Frontmatter must be a YAML object mapping package names to bump levels."});const s=Object.entries(n);if(s.length===0)return{body:t.body.trim(),id:te(a),path:a,payload:{bumps:{}}};for(const[o]of s)if(!Ze(o))throw new R({code:"BUMP_FILE_INVALID",file:a,message:`Invalid package name: ${JSON.stringify(o)}.`,packageName:o});let c;if(s.length===1&&ue(s[0][1])){const[o,r]=s[0];c=ta(o,r,a)}else{const o={};for(const[r,m]of s){if(ue(m))throw new R({code:"BUMP_FILE_INVALID",file:a,message:`Mixed simple + nested entries are not allowed. Package "${r}" uses the nested shape but the file has multiple top-level entries.`,packageName:r});if(!ie(m))throw new R({code:"BUMP_FILE_INVALID",file:a,message:`Invalid bump level for "${r}": ${JSON.stringify(m)}. Expected one of: ${le.join(", ")}`,packageName:r});o[r]=m}c={bumps:o}}const{meta:d,remainder:l}=aa(t.body);return{body:l,id:te(a),meta:d,path:a,payload:c}},Ya=(e,a)=>{let t;if("bumps"in e){const n=Object.entries(e.bumps).map(([s,c])=>`${ne(s)}: ${c}`);t=n.length>0?n.join(`
|
|
3
|
+
`):"{}"}else{const n=[`${ne(e.package)}:`,` bump: ${e.bump}`];if(e.releaseAs&&n.push(` releaseAs: ${e.releaseAs}`),e.cascade){n.push(" cascade:");for(const[s,c]of Object.entries(e.cascade))n.push(` ${ne(s)}: ${c}`)}t=n.join(`
|
|
4
4
|
`)}return`---
|
|
5
5
|
${t}
|
|
6
6
|
---
|
|
7
7
|
${a.trim()===""?"":`${a.trim()}
|
|
8
|
-
`}`},
|
|
9
|
-
`)},ee=e=>{const{current:a,prerelease:t}=e;let{bump:n}=e;if(!x.valid(a))throw new R({code:"CONFIG_INVALID",message:`Invalid current version: ${JSON.stringify(a)}`});const s=x.parse(a),c=s.prerelease[0],d=s.prerelease.length>0;if(s.major===0&&e.bumpMinorPreMajor&&(n==="major"&&(n="minor"),n==="minor"&&e.bumpPatchForMinorPreMajor&&(n="patch")),n==="none")return(c??void 0)===(t??void 0)?a:!d&&t?`${s.major}.${s.minor}.${s.patch}-${t}.0`:d&&!t?`${s.major}.${s.minor}.${s.patch}`:d&&t?`${s.major}.${s.minor}.${s.patch}-${t}.0`:a;if(d&&t&&c===t){const i=ha(s);if(we[n]<=we[i]){const o=x.inc(a,"prerelease",t);if(!o)throw new R({code:"CONFIG_INVALID",message:`semver.inc returned null for prerelease bump on ${a}`});return o}const r=`${s.major}.${s.minor}.${s.patch}`,m=x.inc(r,n);if(!m)throw new R({code:"CONFIG_INVALID",message:`semver.inc returned null for ${n} bump on ${r}`});return`${m}-${t}.0`}if(t){const i=`${s.major}.${s.minor}.${s.patch}`,r=x.inc(i,n);if(!r)throw new R({code:"CONFIG_INVALID",message:`semver.inc returned null for ${n} bump on ${i}`});return`${r}-${t}.0`}if(d){const i=`${s.major}.${s.minor}.${s.patch}`,r=x.inc(i,n);if(!r)throw new R({code:"CONFIG_INVALID",message:`semver.inc returned null for ${n} bump on ${i}`});return r}const l=x.inc(a,n);if(!l)throw new R({code:"CONFIG_INVALID",message:`semver.inc returned null for ${n} bump on ${a}`});return l},we={major:3,minor:2,patch:1},ha=e=>e.minor===0&&e.patch===0?"major":e.patch===0?"minor":"patch",wa=(e,a)=>{const t=ke(a);return t?x.satisfies(e,t,{includePrerelease:!0}):!0},ke=e=>{if(!e||e.startsWith("catalog:")||e==="*"||e==="workspace:*"||e==="workspace:^"||e==="workspace:~")return null;if(e.startsWith("workspace:")){const a=e.slice(10);return a==="*"||a==="^"||a==="~"?null:a}if(e.startsWith("npm:")){const a=e.lastIndexOf("@");return a>4?e.slice(a+1):null}return e},re=100,G=(e,a,t,n,{isCascadeBump:s=!1,isDependencyBump:c=!1,isGroupBump:d=!1,source:l}={})=>{const i=e.get(a);if(i){const r=i.type;return i.type=oe(i.type,t),i.reasons.add(n),c&&(i.isDependencyBump=!0),d&&(i.isGroupBump=!0),s&&(i.isCascadeBump=!0),l&&i.sources.set(l.name,{bumpType:l.bumpType,newVersion:l.newVersion}),i.type!==r}return e.set(a,{isCascadeBump:s,isDependencyBump:c,isGroupBump:d,name:a,proactiveSeen:!1,reasons:new Set([n]),sources:l?new Map([[l.name,{bumpType:l.bumpType,newVersion:l.newVersion}]]):new Map,type:t}),!0},ya=(e,a,t,n)=>{const s=t?.get(e)?.dependencyBumpRules?.[a];if(s!==void 0)return s;const c=n.dependencyBumpRules?.[a];return c!==void 0?c:Oe[a]??!1},ye=(e,a)=>Q(e)>=Q(a),be=(e,a)=>a==="match"?e:a,ba=(e,a)=>a===!0?!0:Array.isArray(a)?a.includes(e):!1,$a=10,va=(e,a,t,n,s,c,d)=>{let l=!1;for(const i of e.values()){const r=a.getPackage(i.name);if(!r)continue;const m=n.currentVersions?.get(i.name)??r.version,o=t.get(i.name)??ee({bump:i.type,bumpMinorPreMajor:n.bumpMinorPreMajor,bumpPatchForMinorPreMajor:n.bumpPatchForMinorPreMajor,current:m,prerelease:n.prerelease});t.set(i.name,o);for(const p of a.getDependents(i.name)){if(p.kind==="devDependencies"){if(!ba(i.name,c.bumpDevDependencies))continue;if(G(e,p.name,"patch","DEVDEPENDENCY_BUMPED",{isDependencyBump:!0,source:{bumpType:i.type,name:i.name,newVersion:o}})&&(l=!0,t.delete(p.name)),c.bumpDevDependencies===!0){let w=d.get(i.name);w||(w=new Set,d.set(i.name,w)),w.add(p.name)}continue}const h=ke(p.range);if(h===null||wa(o,h))continue;let u,k="DEPENDENCY_OUT_OF_RANGE";p.kind==="peerDependencies"?(u=i.type==="none"?"patch":i.type,k="PEER_DEP_MATCH",h.startsWith("^0.")&&u!=="patch"&&s.push(`^0.x peer dep "${i.name}" → "${p.name}" produced a ${u} bump. Consider widening the range manually.`)):u="patch",G(e,p.name,u,k,{isDependencyBump:!0,source:{bumpType:i.type,name:i.name,newVersion:o}})&&(l=!0,t.delete(p.name))}}return l},ka=(e,a,t)=>{let n=!1;for(const s of t.fixed??[]){const c=ge(s),d=ae(c.packages,a),l=d.filter(r=>e.has(r));if(l.length===0)continue;let i="none";for(const r of l)i=oe(i,e.get(r).type);for(const r of d)a.isInternal(r)&&G(e,r,i,"FIXED_GROUP",{isGroupBump:!0})&&(n=!0)}for(const s of t.linked??[]){const c=ge(s),d=ae(c.packages,a).filter(i=>e.has(i));if(d.length===0)continue;let l="none";for(const i of d)l=oe(l,e.get(i).type);for(const i of d)G(e,i,l,"LINKED_GROUP",{isGroupBump:!0})&&(n=!0)}return n},$e=new WeakMap,Pa=/[!()*+?@[\]{|}]/,ae=(e,a)=>{let t=$e.get(a);t||(t={allNames:a.allPackages().map(s=>s.name),matched:new Map},$e.set(a,t));const n=new Set;for(const s of e){if(!Pa.test(s)){n.add(s);continue}let c=t.matched.get(s);c||(c=t.allNames.filter(d=>Z(s,d)),t.matched.set(s,c));for(const d of c)n.add(d)}return[...n]},Ca=(e,a,t,n,s,c)=>{let d=!1;const l=n.updateInternalDependencies??"out-of-range",i=r=>{const m=c.get(r.name);if(m!==void 0)return m;const o=ee({bump:r.type,bumpMinorPreMajor:s.bumpMinorPreMajor,bumpPatchForMinorPreMajor:s.bumpPatchForMinorPreMajor,current:s.currentVersions?.get(r.name)??t.getPackage(r.name).version,prerelease:s.prerelease});return c.set(r.name,o),o};for(const r of a){if("bumps"in r.payload||!r.payload.cascade)continue;const m=e.get(r.payload.package);if(!m)continue;const o=c.get(m.name)??ee({bump:m.type,bumpMinorPreMajor:s.bumpMinorPreMajor,bumpPatchForMinorPreMajor:s.bumpPatchForMinorPreMajor,current:s.currentVersions?.get(m.name)??t.getPackage(m.name).version,prerelease:s.prerelease});c.set(m.name,o);for(const[p,h]of Object.entries(r.payload.cascade))for(const u of ae([p],t))t.isInternal(u)&&G(e,u,h,"CASCADE",{isCascadeBump:!0,source:{bumpType:m.type,name:m.name,newVersion:o}})&&(d=!0)}for(const r of e.values()){const m=s.perPackageConfig?.get(r.name)?.cascadeTo;if(m)for(const[o,p]of Object.entries(m)){if(!ye(r.type,p.trigger))continue;const h=be(r.type,p.bumpAs),u=i(r);for(const k of ae([o],t))t.isInternal(k)&&G(e,k,h,"CASCADE_TO",{isCascadeBump:!0,source:{bumpType:r.type,name:r.name,newVersion:u}})&&(d=!0)}}if(l==="out-of-range")return d;for(const r of e.values())if(!r.proactiveSeen&&!(l==="minor"&&Q(r.type)<Q("minor"))){for(const m of t.getDependents(r.name)){const o=ya(m.name,m.kind,s.perPackageConfig,n);if(o===!1||!ye(r.type,o.trigger))continue;const p=be(r.type,o.bumpAs);if(p==="none")continue;const h=i(r);G(e,m.name,p,"DEPENDENCY_BUMPED",{isDependencyBump:!0,source:{bumpType:r.type,name:r.name,newVersion:h}})&&(d=!0)}r.proactiveSeen=!0}return d},Na=(e,a,t,n={})=>{const s=new Map,c=[],d=new Map;for(const[o,p]of sa(e).entries()){if(!a.isInternal(o)){c.push(`Change file references non-workspace package "${o}" — ignored.`);continue}p!=="none"&&G(s,o,p,"EXPLICIT")}for(const o of n.catalogConsumers??[]){if(!a.isInternal(o.packageName))continue;const p=`catalog:${o.catalog}/${o.dep}`;G(s,o.packageName,"patch","CATALOG_CHANGED",{isDependencyBump:!0,source:{bumpType:"patch",name:p,newVersion:o.newVersion??""}})}const l=new Map,i=o=>{const p=ue(o,e).map(u=>"releaseAs"in u.payload?{file:u.path,version:u.payload.releaseAs}:void 0).filter(u=>u!==void 0&&typeof u.version=="string"),h=new Set(p.map(u=>u.version));if(h.size>1)throw new R({code:"BUMP_FILE_INVALID",message:`Conflicting releaseAs values for ${o}: ${[...h].join(", ")}. Found in: ${p.map(u=>u.file).join(", ")}. Consolidate the change files to a single override.`,packageName:o});return p[0]?.version},r=new Map;for(const o of s.values()){if(o.type==="none")continue;const p=i(o.name);p&&(r.set(o.name,p),d.set(o.name,p))}for(let o=0;o<re;o+=1){const p=va(s,a,d,n,c,t,l),h=ka(s,a,t),u=Ca(s,e,a,t,n,d);if(!p&&!h&&!u)break;o===re-1&&c.push(`Release plan did not converge after ${re} iterations — releasing the current best plan. This usually indicates a config bug (cyclic cascade?).`)}for(const[o,p]of l){const h=p.size;h>$a&&c.push(`bumpDevDependencies: true triggered ${h} patch-cascades to distinct dependents from a single devdep bump (${o}). Consider scoping with the array form ['only', 'these', 'sources'].`)}const m=[];for(const o of s.values()){if(o.type==="none")continue;const p=a.getPackage(o.name);if(!p)continue;const h=ue(o.name,e),u=r.get(o.name),k=n.currentVersions?.get(o.name)??p.version,w=u??d.get(o.name)??ee({bump:o.type,bumpMinorPreMajor:n.bumpMinorPreMajor,bumpPatchForMinorPreMajor:n.bumpPatchForMinorPreMajor,current:k,prerelease:n.prerelease});m.push({changeFiles:h,isCascadeBump:o.isCascadeBump,isDependencyBump:o.isDependencyBump,isGroupBump:o.isGroupBump,name:o.name,newVersion:w,oldVersion:k,reasons:[...o.reasons],sources:[...o.sources.entries()].map(([$,b])=>({name:$,...b})),type:o.type})}return m.sort((o,p)=>o.name.localeCompare(p.name)),{consumedChangeFiles:e,releases:m,warnings:c}},Pe=async(e,a,t={})=>{const n=await e.listPackages(),s=[],c=new Map,d=new Map,l=o=>{try{return ze(X(o))}catch{return X(o)}},i=t.cwd===void 0?void 0:l(t.cwd),r=o=>o.replaceAll("\\","/"),m=[];for(const{manifest:o,manifestPath:p}of n){const h=ce(typeof o.name=="string"?o.name:"",o,a);if(o.napi!==void 0||h.versionActions==="native-addon"){const u=r(p.replace(/[/\\]package\.json$/i,""));m.push(`${u}/npm/`)}}for(const{manifest:o,manifestPath:p}of n){if(typeof o.name!="string"||o.name==="")continue;const h=r(p.replace(/[/\\]package\.json$/i,""));if(m.some(w=>h.startsWith(w)))continue;if(Je(o.name),d.has(o.name))throw new R({code:"DUPLICATE_PACKAGE_NAME",message:`Duplicate package name "${o.name}" — at ${d.get(o.name)} and ${p}.`,packageName:o.name});if(d.set(o.name,p),i!==void 0){const w=l(p),$=i.endsWith(K)?i:`${i}${K}`;if(w!==i&&!w.startsWith($))throw new R({code:"CONFIG_INVALID",message:`Package manifest is outside the workspace: ${p} (workspace: ${i}).`,packageName:o.name})}const u=ce(o.name,o,a);if(!Ce(o.name,o,u,a))continue;const k=p.replace(/[/\\]package\.json$/i,"");s.push({dir:k,manifest:o,manifestPath:p,name:o.name,private:o.private===!0,version:typeof o.version=="string"?o.version:"0.0.0"}),c.set(o.name,u)}return{packages:s,perPackageConfig:c}},ce=(e,a,t)=>{const n=t.packages?.[e]??{},s=a["vis-release"]??{};return{...n,...s}},Ce=(e,a,t,n)=>t.managed===!1?!1:t.managed===!0?!0:ve(e,n.ignore??[])?!1:ve(e,n.include??[])?!0:a.private===!0&&!(n.privatePackages?.version??!1)?!1:n.defaultManaged??!1,ve=(e,a)=>a.some(t=>Z(t,e)),Ne=(e,a)=>a.versionActions!==void 0?a.versionActions:e.manifest.napi!==void 0?"native-addon":e.private?"private":"npm",Ja=Object.defineProperty({__proto__:null,discoverPackages:Pe,isPackageManaged:Ce,mergePerPackageConfig:ce,resolveVersionActionsId:Ne},Symbol.toStringTag,{value:"Module"}),za=async(e={})=>{const a=e.cwd??process.cwd(),t=J(),n=await He(a),s=We(n,t),c=await s.detectVersion(a);if(c&&!Ia(c,s.minVersion))throw new R({code:"PM_VERSION_TOO_LOW",hint:`pnpm install -g ${s.id}@latest (or your equivalent)`,message:`${s.id} version ${c} is below the required minimum ${s.minVersion}. Upgrade ${s.id} to enable release operations.`});let d={};try{const{loadVisConfig:A}=await import("../packem_shared/CONFIG_FILES-MsOntfYT.js"),C=await A(a);C.release&&(d=C.release)}catch(A){const{code:C}=A,g=A.message??"";if(!(C==="ENOENT"||C==="MODULE_NOT_FOUND"||/cannot find module/i.test(g)))throw A}const l=Aa(d,e.config??{});!l.acknowledgeUnstable&&process.env.VIS_RELEASE_SUPPRESS_UNSTABLE!=="1"&&process.stderr.write("[vis release] ⚠ This subsystem is flagged unstable. Set `release.acknowledgeUnstable: true` in vis.config.ts to suppress this warning. (RFC §21.2)\n");const i=e.channel??await la(a,t),r=i?ia(i,l.channels):void 0,m=await import("node:fs/promises"),o={listPackages:async()=>{const A=await s.listWorkspacePackages(a);return(await Promise.all(A.map(async C=>{const g=`${C.path}/package.json`;try{const y=await m.readFile(g,"utf8");return{manifest:JSON.parse(y),manifestPath:g}}catch{return}}))).filter(C=>C!==void 0)}},{packages:p,perPackageConfig:h}=await Pe(o,l,{cwd:a}),u=new ga(p),{files:k}=await oa({changesDir:l.changesDir,cwd:a}),{readPreMode:w}=await import("./pre-mode.js"),$=await w(a,l.changesDir??".vis/release");let b;$?.mode==="pre"?b=$.tag:$?.mode==="exit-pending"?b=void 0:b=r?.prerelease;const P=e.firstRelease===!0,{resolveCurrentVersionsForWorkspace:v}=await import("./version-resolver.js"),{versions:L,warnings:V}=await v(p,u,l,h,{cwd:a,firstRelease:P,pm:s,runner:t,skipRegistryLookup:e.skipRegistryLookup===!0}),T=[],N=[];if(l.detectCatalogChanges===!0)try{const{detectCatalogChanges:A,findCatalogConsumers:C,parseCatalogs:g}=await import("./catalog-detector.js"),y=await s.readCatalogYaml(a),j=g(y);let B;try{const _=await t.run("git",["show","HEAD~1:pnpm-workspace.yaml"],{cwd:a,silent:!0});_.exitCode===0&&(B=_.stdout)}catch{}const S=g(B),D=A(S,j).filter(_=>_.oldVersion!==void 0&&_.newVersion!==void 0);if(D.length>0){const _=C(p,j);for(const M of D){const I=_.get(M.catalog)?.get(M.dep)??[];for(const f of I)T.push({catalog:M.catalog,dep:M.dep,newVersion:M.newVersion,oldVersion:M.oldVersion,packageName:f.packageName})}T.length>0&&N.push(`Catalog change-detection: ${D.length} catalog dep(s) moved; ${T.length} consumer-package patch bump(s) tagged CATALOG_CHANGED.`)}}catch(A){N.push(`Catalog change-detection skipped: ${A.message}.`)}const E=Na(k,u,l,{bumpMinorPreMajor:l.bumpMinorPreMajor,bumpPatchForMinorPreMajor:l.bumpPatchForMinorPreMajor,catalogConsumers:T,currentVersions:L,perPackageConfig:h,prerelease:b});if(N.length>0&&E.warnings.push(...N),V.length>0&&E.warnings.push(...V),P&&E.warnings.push('First-release mode: currentVersionResolver forced to "disk", remote tag-collision checks skipped. Drop --first-release after the initial wave lands.'),$?.mode==="pre"&&E.warnings.push(`Pre-mode is ACTIVE (tag "${$.tag}"); every version produces a prerelease. Exit with \`vis release pre exit\` when ready to ship stable.`),$?.mode==="exit-pending"&&E.warnings.push(`Pre-mode is EXIT-PENDING (was "${$.tag}"); the next \`vis release version\` will consolidate the prerelease and delete pre.json.`),r?.overlapping&&r.overlapping.length>0&&E.warnings.push(`Branch "${i}" matches multiple channel patterns: "${r.branch}" (active) plus ${r.overlapping.map(A=>`"${A}"`).join(", ")}. Reorder channels in vis.config.ts if this is unintentional.`),e.projects&&e.projects.length>0){const{default:A}=await import("./index.js"),C=e.projects;E.releases=E.releases.filter(g=>C.some(y=>g.name===y||A(y,g.name)))}return{branch:i,channel:r?{mode:r.mode,prerelease:r.prerelease,tag:r.tag}:void 0,config:l,cwd:a,depGraph:u,firstRelease:P,packages:p,perPackageConfig:h,plan:E,pm:s,preMode:$}},Aa=(...e)=>{let a={...Be};for(const t of e)a={...a,...t};return a},Ia=(e,a)=>{const t=x.coerce(e)?.version??e;try{return x.gte(t,a)}catch{return!0}},Y=async(e,a,t)=>{if(!a||a.trim()==="")return;const n=J(),s=process.platform==="win32",c=s?"cmd":"sh",d=s?["/c",a]:["-c",a],l=await n.run(c,d,{cwd:e,silent:!1});if(l.exitCode!==0)throw new Error(`${t} failed (exit ${l.exitCode}): ${a}`)},Ae=async(e,a,t,n={})=>{const{findConflictingPendingStages:s,readStagedRegistry:c,removePendingStages:d,writeStagedRegistry:l}=await import("./staged-registry.js"),i=e.config.changesDir??q;let r=t??await c(e.cwd,i);if(r.pending.length===0)return;const m=new Map(e.plan.releases.map(w=>[w.name,w.newVersion])),o=[...m.keys()];let p=s(r,o).filter(w=>m.get(w.name)!==w.version);if(p.length===0)return;let h=[];if(!n.skipSelfHeal){const w=n.runner??J();h=(await Promise.all(p.map(async $=>{const b=await w.run("npm",["view",`${$.name}@${$.version}`,"dist.tarball","--silent"],{cwd:e.cwd,silent:!0});return b.exitCode===0&&b.stdout.trim().length>0?$.id:void 0}))).filter($=>$!==void 0)}if(h.length>0){if(r=d(r,h),n.persistSelfHeal!==!1)try{await l(e.cwd,i,r)}catch{}if(p=s(r,o).filter(w=>m.get(w.name)!==w.version),p.length===0)return}const u=p.map(w=>` • ${w.name}@${w.version} — stage ${w.id} (${w.reason}, recorded ${w.stagedAt})`).join(`
|
|
10
|
-
`),
|
|
11
|
-
${u}`})},qa=async(e,a={})=>{if(e.plan.releases.length===0)return{changedFiles:[],deletedFiles:[],plan:e.plan};if(await
|
|
8
|
+
`}`},ne=e=>/^[a-z0-9-]/.test(e)?e:`"${e}"`,sa=e=>{const a=new Map,t=s=>s==="major"?3:s==="minor"?2:s==="patch"?1:0,n=(s,c)=>{const d=a.get(s);(d===void 0||t(c)>t(d))&&a.set(s,c)};for(const s of e)if("bumps"in s.payload)for(const[c,d]of Object.entries(s.payload.bumps))n(c,d);else n(s.payload.package,s.payload.bump);return a},fe=(e,a)=>a.filter(t=>"bumps"in t.payload?Object.hasOwn(t.payload.bumps,e):t.payload.package===e),ra=new Set(["README.md","readme.md"]),oa=async e=>{const a=e.changesDir??X,t=re(e.cwd),n=re(e.cwd,a),s=n,c=t.endsWith(Y)?t:`${t}${Y}`;if(n!==t&&!n.startsWith(c))throw new R({code:"CONFIG_INVALID",message:`changesDir resolves outside the workspace: ${n} (workspace: ${t}). Set release.changesDir to a path inside the repo.`});const d=[];let l;try{l=await Ee(s)}catch(r){if(r.code==="ENOENT")return{files:[],warnings:[]};throw new R({cause:r,code:"CONFIG_INVALID",message:`Cannot read change-files directory ${s}: ${r.message}`})}const o=l.filter(r=>!ra.has(r)&&r.endsWith(".md"));return{files:await Promise.all(o.map(async r=>{const m=Ue(s,r),i=await Fe(m,"utf8");return na(i,m)})),warnings:d}},ia=(e,a)=>{if(!a)return;if(Object.hasOwn(a,e)){const n=Object.keys(a).filter(s=>s!==e&&we(s)&&Q(s,e));return he(e,a[e],n)}const t=[];for(const[n]of Object.entries(a))we(n)&&Q(n,e)&&t.push(n);if(t.length>0){const[n,...s]=t;return he(e,a[n],s)}},he=(e,a,t=[])=>{let{tag:n}=a;return n==="branch-name"&&(n=ca(e)),{branch:e,mode:a.mode??"auto-publish",...t.length>0?{overlapping:t}:{},prerelease:a.prerelease,range:a.range,tag:n}},ca=e=>e.toLowerCase().replaceAll(/[^a-z0-9.-]/g,"-").replaceAll(/^-+|-+$/g,"")||"branch",pa=/[!()*+?@[\]{|}]/,we=e=>pa.test(e),la=async(e,a)=>{try{const t=await a.run("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:e,silent:!0});if(t.exitCode!==0)return;const n=t.stdout.trim();return n==="HEAD"||n===""?void 0:n}catch{return}},da=["dependencies","devDependencies","peerDependencies","optionalDependencies"];class ga{dependents;dependenciesByPackage;packagesByName;constructor(a){this.dependents=new Map,this.dependenciesByPackage=new Map,this.packagesByName=new Map;for(const t of a){if(this.packagesByName.has(t.name))throw new R({code:"DUPLICATE_PACKAGE_NAME",message:`Duplicate package name "${t.name}" — found at ${this.packagesByName.get(t.name).dir} and ${t.dir}.`,packageName:t.name});this.packagesByName.set(t.name,t),this.dependents.set(t.name,[]),this.dependenciesByPackage.set(t.name,[])}for(const t of a)for(const n of da){const s=t.manifest[n];if(!(!s||typeof s!="object"))for(const[c,d]of Object.entries(s))this.packagesByName.has(c)&&(this.dependents.get(c).push({kind:n,name:t.name,range:d}),this.dependenciesByPackage.get(t.name).push({kind:n,name:c,range:d}))}}getPackage(a){return this.packagesByName.get(a)}allPackages(){return[...this.packagesByName.values()]}isInternal(a){return this.packagesByName.has(a)}getDependents(a){return this.dependents.get(a)??[]}getDependencies(a){return this.dependenciesByPackage.get(a)??[]}topologicalSort(a){const t=a?new Set(a):new Set(this.packagesByName.keys()),n=new Set,s=new Set,c=[],d=(l,o)=>{if(!n.has(l)){if(s.has(l)){const r=o.indexOf(l),m=r===-1?[...o,l]:[...o.slice(r),l];throw new R({code:"CYCLIC_DEPENDENCY",message:`Cyclic dependency detected: ${m.join(" → ")}`})}s.add(l);for(const r of this.getDependencies(l))t.has(r.name)&&r.kind!=="devDependencies"&&d(r.name,[...o,l]);s.delete(l),n.add(l),c.push(l)}};for(const l of t)d(l,[]);return c}get size(){return this.packagesByName.size}}const ma=/\{(name|version|previousVersion|date|repo|contributors)\}/g,ua=(e,a)=>e.replaceAll(ma,(t,n)=>a[n]??""),fa=(e,a={})=>{const t=new Set;for(const c of a.internalAuthors??[]){const d=c.trim().toLowerCase().replace(/^@/,"");d.length>0&&t.add(d)}const n=new Set,s=[];for(const c of e){const d=c.meta?.author;if(d)for(const l of d.split(",")){const o=l.trim();if(!o)continue;const r=o.replace(/^@/,"");if(r.length===0)continue;const m=r.toLowerCase();n.has(m)||t.has(m)||(n.add(m),s.push(Je(o)))}}return s.length===0?"":s.map(c=>`- ${c}`).join(`
|
|
9
|
+
`)},Z=e=>{const{current:a,prerelease:t}=e;let{bump:n}=e;if(!x.valid(a))throw new R({code:"CONFIG_INVALID",message:`Invalid current version: ${JSON.stringify(a)}`});const s=x.parse(a),c=s.prerelease[0],d=s.prerelease.length>0;if(s.major===0&&e.bumpMinorPreMajor&&(n==="major"&&(n="minor"),n==="minor"&&e.bumpPatchForMinorPreMajor&&(n="patch")),n==="none")return(c??void 0)===(t??void 0)?a:!d&&t?`${s.major}.${s.minor}.${s.patch}-${t}.0`:d&&!t?`${s.major}.${s.minor}.${s.patch}`:d&&t?`${s.major}.${s.minor}.${s.patch}-${t}.0`:a;if(d&&t&&c===t){const o=ha(s);if(ye[n]<=ye[o]){const i=x.inc(a,"prerelease",t);if(!i)throw new R({code:"CONFIG_INVALID",message:`semver.inc returned null for prerelease bump on ${a}`});return i}const r=`${s.major}.${s.minor}.${s.patch}`,m=x.inc(r,n);if(!m)throw new R({code:"CONFIG_INVALID",message:`semver.inc returned null for ${n} bump on ${r}`});return`${m}-${t}.0`}if(t){const o=`${s.major}.${s.minor}.${s.patch}`,r=x.inc(o,n);if(!r)throw new R({code:"CONFIG_INVALID",message:`semver.inc returned null for ${n} bump on ${o}`});return`${r}-${t}.0`}if(d){const o=`${s.major}.${s.minor}.${s.patch}`,r=x.inc(o,n);if(!r)throw new R({code:"CONFIG_INVALID",message:`semver.inc returned null for ${n} bump on ${o}`});return r}const l=x.inc(a,n);if(!l)throw new R({code:"CONFIG_INVALID",message:`semver.inc returned null for ${n} bump on ${a}`});return l},ye={major:3,minor:2,patch:1},ha=e=>e.minor===0&&e.patch===0?"major":e.patch===0?"minor":"patch",wa=(e,a)=>{const t=Pe(a);return t?x.satisfies(e,t,{includePrerelease:!0}):!0},Pe=e=>{if(!e||e.startsWith("catalog:")||e==="*"||e==="workspace:*"||e==="workspace:^"||e==="workspace:~")return null;if(e.startsWith("workspace:")){const a=e.slice(10);return a==="*"||a==="^"||a==="~"?null:a}if(e.startsWith("npm:")){const a=e.lastIndexOf("@");return a>4?e.slice(a+1):null}return e},se=100,G=(e,a,t,n,{isCascadeBump:s=!1,isDependencyBump:c=!1,isGroupBump:d=!1,source:l}={})=>{const o=e.get(a);if(o){const r=o.type;return o.type=oe(o.type,t),o.reasons.add(n),c&&(o.isDependencyBump=!0),d&&(o.isGroupBump=!0),s&&(o.isCascadeBump=!0),l&&o.sources.set(l.name,{bumpType:l.bumpType,newVersion:l.newVersion}),o.type!==r}return e.set(a,{isCascadeBump:s,isDependencyBump:c,isGroupBump:d,name:a,proactiveSeen:!1,reasons:new Set([n]),sources:l?new Map([[l.name,{bumpType:l.bumpType,newVersion:l.newVersion}]]):new Map,type:t}),!0},ya=(e,a,t,n)=>{const s=t?.get(e)?.dependencyBumpRules?.[a];if(s!==void 0)return s;const c=n.dependencyBumpRules?.[a];return c!==void 0?c:Le[a]??!1},be=(e,a)=>K(e)>=K(a),ve=(e,a)=>a==="match"?e:a,ba=(e,a)=>a===!0?!0:Array.isArray(a)?a.includes(e):!1,va=10,$a=(e,a,t,n,s,c,d)=>{let l=!1;for(const o of e.values()){const r=a.getPackage(o.name);if(!r)continue;const m=n.currentVersions?.get(o.name)??r.version,i=t.get(o.name)??Z({bump:o.type,bumpMinorPreMajor:n.bumpMinorPreMajor,bumpPatchForMinorPreMajor:n.bumpPatchForMinorPreMajor,current:m,prerelease:n.prerelease});t.set(o.name,i);for(const p of a.getDependents(o.name)){if(p.kind==="devDependencies"){if(!ba(o.name,c.bumpDevDependencies))continue;if(G(e,p.name,"patch","DEVDEPENDENCY_BUMPED",{isDependencyBump:!0,source:{bumpType:o.type,name:o.name,newVersion:i}})&&(l=!0,t.delete(p.name)),c.bumpDevDependencies===!0){let w=d.get(o.name);w||(w=new Set,d.set(o.name,w)),w.add(p.name)}continue}const h=Pe(p.range);if(h===null||wa(i,h))continue;let u,P="DEPENDENCY_OUT_OF_RANGE";p.kind==="peerDependencies"?(u=o.type==="none"?"patch":o.type,P="PEER_DEP_MATCH",h.startsWith("^0.")&&u!=="patch"&&s.push(`^0.x peer dep "${o.name}" → "${p.name}" produced a ${u} bump. Consider widening the range manually.`)):u="patch",G(e,p.name,u,P,{isDependencyBump:!0,source:{bumpType:o.type,name:o.name,newVersion:i}})&&(l=!0,t.delete(p.name))}}return l},ka=(e,a,t)=>{let n=!1;for(const s of t.fixed??[]){const c=ge(s),d=ee(c.packages,a),l=d.filter(r=>e.has(r));if(l.length===0)continue;let o="none";for(const r of l)o=oe(o,e.get(r).type);for(const r of d)a.isInternal(r)&&G(e,r,o,"FIXED_GROUP",{isGroupBump:!0})&&(n=!0)}for(const s of t.linked??[]){const c=ge(s),d=ee(c.packages,a).filter(o=>e.has(o));if(d.length===0)continue;let l="none";for(const o of d)l=oe(l,e.get(o).type);for(const o of d)G(e,o,l,"LINKED_GROUP",{isGroupBump:!0})&&(n=!0)}return n},$e=new WeakMap,Pa=/[!()*+?@[\]{|}]/,ee=(e,a)=>{let t=$e.get(a);t||(t={allNames:a.allPackages().map(s=>s.name),matched:new Map},$e.set(a,t));const n=new Set;for(const s of e){if(!Pa.test(s)){n.add(s);continue}let c=t.matched.get(s);c||(c=t.allNames.filter(d=>Q(s,d)),t.matched.set(s,c));for(const d of c)n.add(d)}return[...n]},Ca=(e,a,t,n,s,c)=>{let d=!1;const l=n.updateInternalDependencies??"out-of-range",o=r=>{const m=c.get(r.name);if(m!==void 0)return m;const i=Z({bump:r.type,bumpMinorPreMajor:s.bumpMinorPreMajor,bumpPatchForMinorPreMajor:s.bumpPatchForMinorPreMajor,current:s.currentVersions?.get(r.name)??t.getPackage(r.name).version,prerelease:s.prerelease});return c.set(r.name,i),i};for(const r of a){if("bumps"in r.payload||!r.payload.cascade)continue;const m=e.get(r.payload.package);if(!m)continue;const i=c.get(m.name)??Z({bump:m.type,bumpMinorPreMajor:s.bumpMinorPreMajor,bumpPatchForMinorPreMajor:s.bumpPatchForMinorPreMajor,current:s.currentVersions?.get(m.name)??t.getPackage(m.name).version,prerelease:s.prerelease});c.set(m.name,i);for(const[p,h]of Object.entries(r.payload.cascade))for(const u of ee([p],t))t.isInternal(u)&&G(e,u,h,"CASCADE",{isCascadeBump:!0,source:{bumpType:m.type,name:m.name,newVersion:i}})&&(d=!0)}for(const r of e.values()){const m=s.perPackageConfig?.get(r.name)?.cascadeTo;if(m)for(const[i,p]of Object.entries(m)){if(!be(r.type,p.trigger))continue;const h=ve(r.type,p.bumpAs),u=o(r);for(const P of ee([i],t))t.isInternal(P)&&G(e,P,h,"CASCADE_TO",{isCascadeBump:!0,source:{bumpType:r.type,name:r.name,newVersion:u}})&&(d=!0)}}if(l==="out-of-range")return d;for(const r of e.values())if(!r.proactiveSeen&&!(l==="minor"&&K(r.type)<K("minor"))){for(const m of t.getDependents(r.name)){const i=ya(m.name,m.kind,s.perPackageConfig,n);if(i===!1||!be(r.type,i.trigger))continue;const p=ve(r.type,i.bumpAs);if(p==="none")continue;const h=o(r);G(e,m.name,p,"DEPENDENCY_BUMPED",{isDependencyBump:!0,source:{bumpType:r.type,name:r.name,newVersion:h}})&&(d=!0)}r.proactiveSeen=!0}return d},Na=(e,a,t,n={})=>{const s=new Map,c=[],d=new Map;for(const[i,p]of sa(e).entries()){if(!a.isInternal(i)){c.push(`Change file references non-workspace package "${i}" — ignored.`);continue}p!=="none"&&G(s,i,p,"EXPLICIT")}for(const i of n.catalogConsumers??[]){if(!a.isInternal(i.packageName))continue;const p=`catalog:${i.catalog}/${i.dep}`;G(s,i.packageName,"patch","CATALOG_CHANGED",{isDependencyBump:!0,source:{bumpType:"patch",name:p,newVersion:i.newVersion??""}})}const l=new Map,o=i=>{const p=fe(i,e).map(u=>"releaseAs"in u.payload?{file:u.path,version:u.payload.releaseAs}:void 0).filter(u=>u!==void 0&&typeof u.version=="string"),h=new Set(p.map(u=>u.version));if(h.size>1)throw new R({code:"BUMP_FILE_INVALID",message:`Conflicting releaseAs values for ${i}: ${[...h].join(", ")}. Found in: ${p.map(u=>u.file).join(", ")}. Consolidate the change files to a single override.`,packageName:i});return p[0]?.version},r=new Map;for(const i of s.values()){if(i.type==="none")continue;const p=o(i.name);p&&(r.set(i.name,p),d.set(i.name,p))}for(let i=0;i<se;i+=1){const p=$a(s,a,d,n,c,t,l),h=ka(s,a,t),u=Ca(s,e,a,t,n,d);if(!p&&!h&&!u)break;i===se-1&&c.push(`Release plan did not converge after ${se} iterations — releasing the current best plan. This usually indicates a config bug (cyclic cascade?).`)}for(const[i,p]of l){const h=p.size;h>va&&c.push(`bumpDevDependencies: true triggered ${h} patch-cascades to distinct dependents from a single devdep bump (${i}). Consider scoping with the array form ['only', 'these', 'sources'].`)}const m=[];for(const i of s.values()){if(i.type==="none")continue;const p=a.getPackage(i.name);if(!p)continue;const h=fe(i.name,e),u=r.get(i.name),P=n.currentVersions?.get(i.name)??p.version,w=u??d.get(i.name)??Z({bump:i.type,bumpMinorPreMajor:n.bumpMinorPreMajor,bumpPatchForMinorPreMajor:n.bumpPatchForMinorPreMajor,current:P,prerelease:n.prerelease});m.push({changeFiles:h,isCascadeBump:i.isCascadeBump,isDependencyBump:i.isDependencyBump,isGroupBump:i.isGroupBump,name:i.name,newVersion:w,oldVersion:P,reasons:[...i.reasons],sources:[...i.sources.entries()].map(([$,y])=>({name:$,...y})),type:i.type})}return m.sort((i,p)=>i.name.localeCompare(p.name)),{consumedChangeFiles:e,releases:m,warnings:c}},Ce=async(e,a,t={})=>{const n=await e.listPackages(),s=[],c=new Map,d=new Map,l=i=>{const p=re(i);try{return me.native(p)}catch{try{return me(p)}catch{return p}}},o=t.cwd===void 0?void 0:l(t.cwd),r=i=>i.replaceAll("\\","/"),m=[];for(const{manifest:i,manifestPath:p}of n){const h=ce(typeof i.name=="string"?i.name:"",i,a);if(i.napi!==void 0||h.versionActions==="native-addon"){const u=r(p.replace(/[/\\]package\.json$/i,""));m.push(`${u}/npm/`)}}for(const{manifest:i,manifestPath:p}of n){if(typeof i.name!="string"||i.name==="")continue;const h=r(p.replace(/[/\\]package\.json$/i,""));if(m.some(w=>h.startsWith(w)))continue;if(ze(i.name),d.has(i.name))throw new R({code:"DUPLICATE_PACKAGE_NAME",message:`Duplicate package name "${i.name}" — at ${d.get(i.name)} and ${p}.`,packageName:i.name});if(d.set(i.name,p),o!==void 0){const w=l(p),$=o.endsWith(Y)?o:`${o}${Y}`,y=b=>Y==="\\"?b.toLowerCase():b,k=y(w);if(k!==y(o)&&!k.startsWith(y($)))throw new R({code:"CONFIG_INVALID",message:`Package manifest is outside the workspace: ${p} (workspace: ${o}).`,packageName:i.name})}const u=ce(i.name,i,a);if(!Ne(i.name,i,u,a))continue;const P=p.replace(/[/\\]package\.json$/i,"");s.push({dir:P,manifest:i,manifestPath:p,name:i.name,private:i.private===!0,version:typeof i.version=="string"?i.version:"0.0.0"}),c.set(i.name,u)}return{packages:s,perPackageConfig:c}},ce=(e,a,t)=>{const n=t.packages?.[e]??{},s=a["vis-release"]??{};return{...n,...s}},Ne=(e,a,t,n)=>t.managed===!1?!1:t.managed===!0?!0:ke(e,n.ignore??[])?!1:ke(e,n.include??[])?!0:a.private===!0&&!(n.privatePackages?.version??!1)?!1:n.defaultManaged??!1,ke=(e,a)=>a.some(t=>Q(t,e)),Ae=(e,a)=>a.versionActions!==void 0?a.versionActions:e.manifest.napi!==void 0?"native-addon":e.private?"private":"npm",Ja=Object.defineProperty({__proto__:null,discoverPackages:Ce,isPackageManaged:Ne,mergePerPackageConfig:ce,resolveVersionActionsId:Ae},Symbol.toStringTag,{value:"Module"}),za=async(e={})=>{const a=e.cwd??process.cwd(),t=z(),n=await We(a),s=Ye(n,t),c=await s.detectVersion(a);if(c&&!Ia(c,s.minVersion))throw new R({code:"PM_VERSION_TOO_LOW",hint:`pnpm install -g ${s.id}@latest (or your equivalent)`,message:`${s.id} version ${c} is below the required minimum ${s.minVersion}. Upgrade ${s.id} to enable release operations.`});let d={};try{const{loadVisConfig:A}=await import("./CONFIG_FILES.js"),C=await A(a);C.release&&(d=C.release)}catch(A){const{code:C}=A,g=A.message??"";if(!(C==="ENOENT"||C==="MODULE_NOT_FOUND"||/cannot find module/i.test(g)))throw A}const l=Aa(d,e.config??{});!l.acknowledgeUnstable&&process.env.VIS_RELEASE_SUPPRESS_UNSTABLE!=="1"&&process.stderr.write("[vis release] ⚠ This subsystem is flagged unstable. Set `release.acknowledgeUnstable: true` in vis.config.ts to suppress this warning. (RFC §21.2)\n");const o=e.channel??await la(a,t),r=o?ia(o,l.channels):void 0,m=await import("node:fs/promises"),i={listPackages:async()=>{const A=await s.listWorkspacePackages(a);return(await Promise.all(A.map(async C=>{const g=`${C.path}/package.json`;try{const v=await m.readFile(g,"utf8");return{manifest:JSON.parse(v),manifestPath:g}}catch{return}}))).filter(C=>C!==void 0)}},{packages:p,perPackageConfig:h}=await Ce(i,l,{cwd:a}),u=new ga(p),{files:P}=await oa({changesDir:l.changesDir,cwd:a}),{readPreMode:w}=await import("./pre-mode.js"),$=await w(a,l.changesDir??".vis/release");let y;$?.mode==="pre"?y=$.tag:$?.mode==="exit-pending"?y=void 0:y=r?.prerelease;const k=e.firstRelease===!0,{resolveCurrentVersionsForWorkspace:b}=await import("./version-resolver.js"),{versions:B,warnings:V}=await b(p,u,l,h,{cwd:a,firstRelease:k,pm:s,runner:t,skipRegistryLookup:e.skipRegistryLookup===!0}),T=[],N=[];if(l.detectCatalogChanges===!0)try{const{detectCatalogChanges:A,findCatalogConsumers:C,parseCatalogs:g}=await import("./catalog-detector.js"),v=await s.readCatalogYaml(a),j=g(v);let L;try{const _=await t.run("git",["show","HEAD~1:pnpm-workspace.yaml"],{cwd:a,silent:!0});_.exitCode===0&&(L=_.stdout)}catch{}const S=g(L),D=A(S,j).filter(_=>_.oldVersion!==void 0&&_.newVersion!==void 0);if(D.length>0){const _=C(p,j);for(const M of D){const I=_.get(M.catalog)?.get(M.dep)??[];for(const f of I)T.push({catalog:M.catalog,dep:M.dep,newVersion:M.newVersion,oldVersion:M.oldVersion,packageName:f.packageName})}T.length>0&&N.push(`Catalog change-detection: ${D.length} catalog dep(s) moved; ${T.length} consumer-package patch bump(s) tagged CATALOG_CHANGED.`)}}catch(A){N.push(`Catalog change-detection skipped: ${A.message}.`)}const E=Na(P,u,l,{bumpMinorPreMajor:l.bumpMinorPreMajor,bumpPatchForMinorPreMajor:l.bumpPatchForMinorPreMajor,catalogConsumers:T,currentVersions:B,perPackageConfig:h,prerelease:y});if(N.length>0&&E.warnings.push(...N),V.length>0&&E.warnings.push(...V),k&&E.warnings.push('First-release mode: currentVersionResolver forced to "disk", remote tag-collision checks skipped. Drop --first-release after the initial wave lands.'),$?.mode==="pre"&&E.warnings.push(`Pre-mode is ACTIVE (tag "${$.tag}"); every version produces a prerelease. Exit with \`vis release pre exit\` when ready to ship stable.`),$?.mode==="exit-pending"&&E.warnings.push(`Pre-mode is EXIT-PENDING (was "${$.tag}"); the next \`vis release version\` will consolidate the prerelease and delete pre.json.`),r?.overlapping&&r.overlapping.length>0&&E.warnings.push(`Branch "${o}" matches multiple channel patterns: "${r.branch}" (active) plus ${r.overlapping.map(A=>`"${A}"`).join(", ")}. Reorder channels in vis.config.ts if this is unintentional.`),e.projects&&e.projects.length>0){const{default:A}=await import("./index.js"),C=e.projects;E.releases=E.releases.filter(g=>C.some(v=>g.name===v||A(v,g.name)))}return{branch:o,channel:r?{mode:r.mode,prerelease:r.prerelease,tag:r.tag}:void 0,config:l,cwd:a,depGraph:u,firstRelease:k,packages:p,perPackageConfig:h,plan:E,pm:s,preMode:$}},Aa=(...e)=>{let a={...Be};for(const t of e)a={...a,...t};return a},Ia=(e,a)=>{const t=x.coerce(e)?.version??e;try{return x.gte(t,a)}catch{return!0}},J=async(e,a,t)=>{if(!a||a.trim()==="")return;const n=z(),s=process.platform==="win32",c=s?"cmd":"sh",d=s?["/c",a]:["-c",a],l=await n.run(c,d,{cwd:e,silent:!1});if(l.exitCode!==0)throw new Error(`${t} failed (exit ${l.exitCode}): ${a}`)},Ie=async(e,a,t,n={})=>{const{findConflictingPendingStages:s,readStagedRegistry:c,removePendingStages:d,writeStagedRegistry:l}=await import("./staged-registry.js"),o=e.config.changesDir??X;let r=t??await c(e.cwd,o);if(r.pending.length===0)return;const m=new Map(e.plan.releases.map(w=>[w.name,w.newVersion])),i=[...m.keys()];let p=s(r,i).filter(w=>m.get(w.name)!==w.version);if(p.length===0)return;let h=[];if(!n.skipSelfHeal){const w=n.runner??z();h=(await Promise.all(p.map(async $=>{const y=await w.run("npm",["view",`${$.name}@${$.version}`,"dist.tarball","--silent"],{cwd:e.cwd,silent:!0});return y.exitCode===0&&y.stdout.trim().length>0?$.id:void 0}))).filter($=>$!==void 0)}if(h.length>0){if(r=d(r,h),n.persistSelfHeal!==!1)try{await l(e.cwd,o,r)}catch{}if(p=s(r,i).filter(w=>m.get(w.name)!==w.version),p.length===0)return}const u=p.map(w=>` • ${w.name}@${w.version} — stage ${w.id} (${w.reason}, recorded ${w.stagedAt})`).join(`
|
|
10
|
+
`),P=a==="version"?"version":"publish";throw new R({code:"STAGE_PENDING",hint:"Resolve via `vis release stage approve <id>` / `--all` or `vis release stage reject <id>`, commit the updated staged.json, then retry.",message:`Refusing to ${P} — ${p.length} package(s) have a pending stage from a prior wave:
|
|
11
|
+
${u}`})},qa=async(e,a={})=>{if(e.plan.releases.length===0)return{changedFiles:[],deletedFiles:[],plan:e.plan};if(await Ie(e,"version",void 0,{persistSelfHeal:!1}),!a.dryRun&&e.config.preVersionCommand&&await J(e.cwd,e.config.preVersionCommand,"preVersionCommand"),!a.dryRun&&e.config.groupPreVersionCommands){const{normaliseGroup:p}=await import("../release/types.js"),h=[...e.config.fixed??[],...e.config.linked??[]].map(P=>p(P)),{default:u}=await import("./index.js");for(const[P,w]of Object.entries(e.config.groupPreVersionCommands)){const $=Number.parseInt(P.replace(/^group-/,""),10),y=h[$];!y||!e.plan.releases.some(k=>y.packages.some(b=>k.name===b||u(b,k.name)))||await J(e.cwd,w,`groupPreVersionCommand[${P}]`)}}const t=await import("node:fs/promises"),{readFileSync:n}=await import("node:fs"),{resolveFormatter:s}=await import("./resolveFormatter.js"),{resolveGroupChangelogRouting:c}=await import("./workspace.js"),d=await s(e.config.changelog,e.cwd),l=new Date().toISOString().slice(0,10),o=c(e.config,e.packages,e.cwd),r=await Te(e.plan,e.depGraph,{changelogPath:p=>o.get(p.name)??`${p.dir}/CHANGELOG.md`,readChangelog:p=>{try{return n(p,"utf8")}catch{return}},readManifest:p=>{try{return n(p,"utf8")}catch{return}},renderChangelogEntry:p=>d({changeFiles:p.changeFiles,date:l,release:p,target:"changelog"})}),m=[];{const{applyExtraFilesForRelease:p}=await import("./extra-files.js"),h=await Promise.all(e.plan.releases.map(async u=>{const P=e.depGraph.getPackage(u.name);if(!P)return{warnings:[],writes:[]};const w=e.perPackageConfig.get(u.name)?.extraFiles??[],$=e.config.publish?.extraFiles??[];return w.length===0&&$.length===0?{warnings:[],writes:[]}:p(e.cwd,P.dir,u.newVersion,u.name,$,w)}));for(const u of h){for(const P of u.writes)r.writes.push({content:P.content,path:P.path});m.push(...u.warnings)}m.length>0&&e.plan.warnings.push(...m)}if(a.dryRun)return{changedFiles:r.writes.map(p=>p.path),deletedFiles:r.deletions,plan:e.plan};await Promise.all([...r.writes.map(p=>_e(p.path,p.content)),...r.deletions.map(async p=>{try{await Oe(p)}catch{}})]);try{await e.pm.installLockfileOnly({cwd:e.cwd,silent:!0})}catch{}!a.dryRun&&e.config.formatChangedFiles&&await Ra(r.writes.map(p=>p.path),e.cwd);let i;if(a.commit){const{stageAndCommit:p}=await import("./git.js"),h=z(),u=["pnpm-lock.yaml","package-lock.json","yarn.lock","bun.lock","bun.lockb"],P=await import("node:path"),w=[];for(const y of u)try{await t.access(P.join(e.cwd,y)),w.push(P.join(e.cwd,y))}catch{}const $=e.config.aggregateRelease===!0||typeof e.config.aggregateRelease=="object"&&e.config.aggregateRelease.enabled;if(e.config.oneCommitPerPackage===!0&&!$&&e.plan.releases.length>0){const y=e.channel?.tag??e.branch??"main",k=r.writes.map(V=>V.path),b=new Set,{releases:B}=e.plan;for(let V=0;V<B.length;V+=1){const T=B[V],N=e.depGraph.getPackage(T.name),E=N?`${N.dir}${P.sep}`:void 0,A=E?k.filter(v=>v.startsWith(E)):[];for(const v of A)b.add(v);const C=V===B.length-1?[...k.filter(v=>!b.has(v)),...r.deletions,...w]:[],g=[...A,...C];g.length!==0&&(i=await p({cwd:e.cwd,runner:h},g,`release(${y}): ${T.name}@${T.newVersion} [skip ci]`,{author:e.config.gitUser}))}}else{const y=a.commitMessage??ja(e),k=[...r.writes.map(b=>b.path),...r.deletions,...w];i=await p({cwd:e.cwd,runner:h},k,y,{author:e.config.gitUser})}}if(!a.dryRun&&e.config.postVersionCommand&&await J(e.cwd,e.config.postVersionCommand,"postVersionCommand"),!a.dryRun&&e.preMode?.mode==="exit-pending"){const{deletePreMode:p,preModeFilePath:h}=await import("./pre-mode.js"),u=e.config.changesDir??".vis/release";await p(e.cwd,u)&&e.plan.warnings.push(`Pre-mode exited: \`${h(e.cwd,u)}\` was deleted. Commit the deletion so the registry stays consistent across CI runs.`)}return{changedFiles:r.writes.map(p=>p.path),commitSha:i,deletedFiles:r.deletions,plan:e.plan}},Ra=async(e,a)=>{if(e.length===0)return;const{join:t}=await import("node:path");let n;try{const{createRequire:c}=await import("node:module"),{pathToFileURL:d}=await import("node:url"),l=c(t(a,"package.json"));n=await import(d(l.resolve("prettier")).href)}catch{return}const s=await import("node:fs/promises");for(const c of e)try{const d=await n.getFileInfo(c);if(d.ignored||!d.inferredParser)continue;const l=await s.readFile(c,"utf8"),o=await n.resolveConfig(c),r=await n.format(l,{...o,filepath:c});r!==l&&await s.writeFile(c,r)}catch{}},ja=e=>{const a=e.channel?.tag??e.branch??"main",{releases:t}=e.plan,n=t.length<=3?t.map(c=>`${c.name}@${c.newVersion}`).join(", "):`version ${t.length} packages`,s=t.map(c=>`- ${c.name}: ${c.oldVersion} → ${c.newVersion}`).join(`
|
|
12
12
|
`);return`release(${a}): ${n} [skip ci]
|
|
13
13
|
|
|
14
|
-
${s}`},Xa=async(e,a={})=>{const t={failed:[],published:[],skipped:[],tags:[],tagsPushed:!1},n=
|
|
15
|
-
`)}}}if(!a.dryRun&&t.published.length>0&&e.config.workspaceChangelog!==!1){const g=e.config.workspaceChangelog,
|
|
16
|
-
`)}}catch(
|
|
17
|
-
`)}}if(!a.dryRun&&t.published.length>0&&t.tagsPushed){e.config.publish?.noRelease!==!0&&await Va(e,t,n);try{const{walkSuccessfulRelease:g}=await import("./success-walk.js"),{createRemoteClient:
|
|
14
|
+
${s}`},Xa=async(e,a={})=>{const t={failed:[],published:[],skipped:[],tags:[],tagsPushed:!1},n=z();if(e.plan.releases.length===0)return t;if(!a.dryRun&&e.channel?.mode==="version-pr"){const{createRemoteClient:o,detectRemoteProvider:r}=await import("./detect2.js"),m=await r(e.cwd,n,e.config.provider),i=await o(m,{githubHost:e.config.githubHost,gitlabHost:e.config.gitlabHost,httpProxy:e.config.httpProxy}).detectRepoSlug(e.cwd,n),p=e.config.versionPr?.branch??"vis-release/version-packages";if(i)try{const h=await n.run("gh",["pr","list","--head",p,"--state","open","--json","number"],{cwd:e.cwd,silent:!0});if(h.exitCode===0&&h.stdout.trim()&&h.stdout.trim()!=="[]"){const u=JSON.parse(h.stdout);if(u[0])return t.failed.push({name:"_preflight",reason:`Open release PR #${u[0].number} exists. Merge or close it before publishing locally. (Override: --no-push then \`git push --tags\` manually.)`}),t}}catch{}}if(!a.dryRun&&e.config.prePublishCommand)try{await J(e.cwd,e.config.prePublishCommand,"prePublishCommand")}catch(o){return t.failed.push({name:"_prePublishCommand",reason:o.message}),t}const s=e.config.changesDir??X,{acquireLock:c,releaseLock:d}=await import("./state.js");let l=!1;if(!a.dryRun)try{await c(e.cwd,s),l=!0}catch(o){return t.failed.push({name:"_lock",reason:o.message}),t}try{const{clearState:o,filterPlanByState:r,newState:m,readState:i,writeState:p}=await import("./state.js"),{readStagedRegistry:h,removePendingStages:u,upsertPendingStages:P,writeStagedRegistry:w}=await import("./staged-registry.js"),$=e.config.changesDir??X;let y=a.resume?await i(e.cwd,$):void 0,k=await h(e.cwd,$);await Ie(e,"publish",k,{runner:n}),k=await h(e.cwd,$);const b={pending:[...k.pending]};let{releases:B}=e.plan;y?B=r(B,y):(y=m(e.channel?.tag,e.plan.releases),a.dryRun||await p(e.cwd,$,y));const V=await e.pm.readCatalogYaml(e.cwd),T=xe(V),N=e.depGraph.topologicalSort(B.map(g=>g.name)),E=new Map(B.map(g=>[g.name,g])),A=new Set,C=new Map;for(const g of e.plan.releases){const v=e.depGraph.getPackage(g.name);v&&C.set(g.name,{...v.manifest,version:g.newVersion})}for(const g of N){const v=E.get(g);if(!v){t.skipped.push({name:g,reason:"topo-sort returned a name not in the release plan (internal bug)"});continue}const j=e.depGraph.getPackage(g);if(!j)continue;const L=[...new Set(e.depGraph.getDependencies(g).filter(f=>f.kind!=="devDependencies"&&A.has(f.name)).map(f=>f.name))];if(L.length>0){t.skipped.push({name:g,reason:`dependency-failed: not published because ${L.join(", ")} failed to publish (publishing would orphan this package's dependency range)`}),A.add(g);continue}const S=e.perPackageConfig.get(g)??{},D=Ae(j,S),_=a.publishActionsOverride??Ge(D),M=a.tag??e.channel?.tag,I=k.pending.find(f=>f.name===g&&f.version===v.newVersion);try{const f=await _.publish({catalogs:T,cleanPackageJsonConfig:e.config.publish?.cleanPackageJson,dryRun:a.dryRun,otp:a.otp,perPackageConfig:S,pkg:j,pm:e.pm,provenance:Ea(e),registry:S.registry,release:v,resumeStageId:I?.id,tag:M,versionedManifestByName:C,workspaceConfig:e.config});if(f.published||f.alreadyPublished){const O=k.pending.filter(F=>F.name===g&&F.version===v.newVersion).map(F=>F.id);O.length>0&&(k=u(k,O))}if(f.published)t.published.push({name:g,stageId:f.stageId,tarball:f.tarball,version:v.newVersion}),y.published.push(`${g}@${v.newVersion}`);else if(f.alreadyPublished)t.skipped.push({name:g,reason:"already-published"}),y.published.push(`${g}@${v.newVersion}`);else if(t.skipped.push({name:g,reason:f.output??"skipped"}),f.stageId){const O=(f.output??"").startsWith("stage-rejected")?"rejected":"timeout";k=P(k,[{id:f.stageId,name:g,reason:O,stagedAt:new Date().toISOString(),tag:M??"latest",version:v.newVersion}])}a.dryRun||await p(e.cwd,$,y)}catch(f){t.failed.push({name:g,reason:f.message}),A.add(g)}}if(!a.dryRun&&!a.noTag&&t.published.length>0){const{createOrUpdateFloatingTag:g,createTag:v,defaultTagFor:j,pushTags:L,renderTagPattern:S}=await import("./git.js"),D=e.config.releaseTagPattern,_=e.channel?.tag,M=e.config.floatingMajorTag===!0,I=!!e.channel?.prerelease||!!e.preMode;for(const{name:f,version:O}of t.published){const F=e.perPackageConfig.get(f)?.releaseTagPattern??D,U=F?S(F,{channel:_,name:f,version:O}):j(f,O);try{await v({cwd:e.cwd,runner:n},U,`Release ${f}@${O}`,{signing:e.config.signing,skipRemoteCheck:e.firstRelease}),t.tags.push(U)}catch(H){e.firstRelease&&H instanceof R&&H.code==="TAG_COLLISION"?t.skipped.push({name:U,reason:"tag-creation: tag already exists (first-release — skipped)"}):t.skipped.push({name:U,reason:`tag-creation: ${H.message}`})}const q=e.depGraph.getPackage(f),Re=e.perPackageConfig.get(f),je=q?.manifest?.private===!0,Me=Re?.skipNpmPublish===!0;if(M&&!I&&!F?.includes("{major}")&&!je&&!Me){const H=O.split(/[-+]/,1)[0].split(".")[0];if(H!==void 0&&H!==""){const de=f.replace(/^@/,"").replaceAll("/","-");if(de!==""){const ae=`${de}-v${H}`;try{await g({cwd:e.cwd,runner:n},ae,{push:!a.noPush,signing:e.config.signing}),t.tags.push(ae)}catch(De){t.skipped.push({name:ae,reason:`floating-major-tag: ${De.message}`})}}}}}if(!a.noPush&&t.tags.length>0)try{await L({cwd:e.cwd,runner:n}),t.tagsPushed=!0}catch(f){t.tagsPushed=!1,t.failed.push({name:"_pushTags",reason:`git push --tags failed: ${f.message}. Retry with: git push --tags`})}y.tagged=[...t.tags],y.pushed=t.tagsPushed,a.dryRun||await p(e.cwd,$,y),t.failed.length===0&&t.published.length>0&&!a.dryRun&&await o(e.cwd,$)}if(!a.dryRun){const g=b.pending.length,v=k.pending.length,j=await w(e.cwd,$,k);if(j.changed){const{stageAndCommitFile:L}=await import("./git.js");let S;if(j.removed)S="chore(release): clear pending stage registry [skip ci]";else if(v>g){const D=v-g;S=`chore(release): record ${D} new pending stage${D===1?"":"s"} [skip ci]`}else if(v<g){const D=g-v;S=`chore(release): drain ${D} resolved stage${D===1?"":"s"} [skip ci]`}else S=`chore(release): update pending stage registry (${v} pending) [skip ci]`;try{await L({cwd:e.cwd,runner:n},j.path,S,{author:e.config.gitUser,push:!a.noPush,sign:e.config.gitSignCommits===!0})}catch(D){process.stderr.write(`[vis release] Warning: could not commit ${j.path}: ${D.message}
|
|
15
|
+
`)}}}if(!a.dryRun&&t.published.length>0&&e.config.workspaceChangelog!==!1){const g=e.config.workspaceChangelog,v=typeof g=="object"?g:void 0,j=typeof e.config.aggregateRelease=="object"?e.config.aggregateRelease.enabled:e.config.aggregateRelease===!0;if(v!==void 0||j)try{const{writeWorkspaceChangelogWave:L}=await import("./workspace.js"),S=new Set(t.published.map(M=>M.name)),D=e.plan.releases.filter(M=>S.has(M.name)),_=await L({changelogConfig:e.config.changelog,cwd:e.cwd,workspaceChangelog:e.config.workspaceChangelog},D);if(_)try{const{stageAndCommitFile:M}=await import("./git.js");await M({cwd:e.cwd,runner:n},_,"chore(release): record wave [skip ci]",{author:e.config.gitUser,push:!a.noPush,sign:e.config.gitSignCommits===!0})}catch(M){process.stderr.write(`[vis release] Warning: could not commit workspace CHANGELOG.md: ${M.message}
|
|
16
|
+
`)}}catch(L){process.stderr.write(`[vis release] Warning: could not write workspace CHANGELOG.md wave entry: ${L.message}
|
|
17
|
+
`)}}if(!a.dryRun&&t.published.length>0&&t.tagsPushed){e.config.publish?.noRelease!==!0&&await Va(e,t,n);try{const{walkSuccessfulRelease:g}=await import("./success-walk.js"),{createRemoteClient:v,detectRemoteProvider:j}=await import("./detect2.js"),{resolveFormatter:L}=await import("./resolveFormatter.js"),S=await j(e.cwd,n,e.config.provider),D=v(S,{githubHost:e.config.githubHost,gitlabHost:e.config.gitlabHost,httpProxy:e.config.httpProxy}),_=await D.detectRepoSlug(e.cwd,n),M=await L(e.config.changelog,e.cwd),{recordRecentlyWalked:I}=await import("./staged-registry.js"),f=new Set([...y.walked??[],...(k.recentlyWalked??[]).map(F=>F.key)]),O={...t,published:t.published.filter(F=>!f.has(`${F.name}@${F.version}`))};if(O.published.length>0){const F=await g(e,O,n,{client:D,formatter:M,repo:_}),U=O.published.map(q=>`${q.name}@${q.version}`);y.walked=[...y.walked??[],...U],await p(e.cwd,$,y),k=I(k,U),F.warnings.length>0&&e.plan.warnings.push(...F.warnings)}}catch(g){e.plan.warnings.push(`successWalk: could not run post-release walk: ${g.message}`)}if(e.config.notifications)try{const{dispatchNotifications:g}=await import("./interface.js"),{createRemoteClient:v,detectRemoteProvider:j}=await import("./detect2.js"),L=await j(e.cwd,n,e.config.provider),S=await v(L,{githubHost:e.config.githubHost,gitlabHost:e.config.gitlabHost,httpProxy:e.config.httpProxy}).detectRepoSlug(e.cwd,n);let D;try{const I=`${e.cwd}/package.json`,f=await import("node:fs/promises");D=JSON.parse(await f.readFile(I,"utf8")).name}catch{}const _=new Set([...y.notified??[],...(k.recentlyNotified??[]).map(I=>I.key)]),M=t.published.filter(I=>!_.has(`${I.name}@${I.version}`));if(M.length>0){const I=await g(e.config.notifications,{channel:e.channel?.tag,completedAt:new Date().toISOString(),...D===void 0?{}:{monorepoName:D},published:M.map(f=>({name:f.name,tag:e.channel?.tag,...f.url===void 0?{}:{url:f.url},version:f.version})),...S===void 0?{}:{repo:S},skipped:t.skipped.map(f=>({name:f.name,reason:f.reason}))},{warn:f=>e.plan.warnings.push(f)});if(I.succeeded.length>0){const f=M.map(F=>`${F.name}@${F.version}`);y.notified=[...y.notified??[],...f],await p(e.cwd,$,y);const{recordRecentlyNotified:O}=await import("./staged-registry.js");k=O(k,f)}if(I.failed.length>0||I.succeeded.length>0){const f=I.succeeded.length+I.failed.length;if(I.failed.length>0){e.plan.warnings.push(`[notifications] dispatched ${I.succeeded.length}/${f} channels${I.succeeded.length>0?` (succeeded: ${I.succeeded.join(", ")})`:""}; ${I.failed.length} failed.`);for(const O of I.failed)e.plan.warnings.push(`[notifications:${O.id}] ${O.error}`)}}}}catch(g){e.plan.warnings.push(`notifications: dispatch failed: ${g.message}`)}if(!a.dryRun)try{const g=await w(e.cwd,$,k);if(g.changed){const{stageAndCommitFile:v}=await import("./git.js");try{await v({cwd:e.cwd,runner:n},g.path,"chore(release): record cross-runner notify/walk dedupe [skip ci]",{author:e.config.gitUser,push:!a.noPush,sign:e.config.gitSignCommits===!0})}catch(j){process.stderr.write(`[vis release] Warning: could not commit ${g.path} (notify/walk dedupe): ${j.message}
|
|
18
18
|
`)}}}catch(g){process.stderr.write(`[vis release] Warning: could not update cross-runner dedupe registry: ${g.message}
|
|
19
|
-
`)}}if(!a.dryRun&&e.config.postPublishCommand)try{await
|
|
19
|
+
`)}}if(!a.dryRun&&e.config.postPublishCommand)try{await J(e.cwd,e.config.postPublishCommand,"postPublishCommand")}catch(g){t.failed.push({name:"_postPublishCommand",reason:g.message})}return t}finally{l&&await d(e.cwd,s)}},Ma=e=>e.length===0?"":`## Related releases
|
|
20
20
|
|
|
21
21
|
${e.map(a=>`- [${a.name}](${a.url})`).join(`
|
|
22
22
|
`)}`,Da=(e,a,t)=>{if(!a||!a.header&&!a.footer)return e;const n=c=>ua(c,{contributors:t.contributors??"",date:t.date,name:t.name,previousVersion:t.previousVersion,repo:t.repo,version:t.version}).replaceAll(/\n{3,}/g,`
|
|
23
23
|
|
|
24
24
|
`).replace(/\s+$/,""),s=[];if(a.header){const c=n(a.header);c.length>0&&s.push(c)}if(s.push(e),a.footer){const c=n(a.footer);c.length>0&&s.push(c)}return s.join(`
|
|
25
25
|
|
|
26
|
-
`)},Sa=e=>{if(!Array.isArray(e))return;const[a,t]=e;if(a!=="github"||typeof t!="object"||t===null)return;const{internalAuthors:n}=t;if(Array.isArray(n))return n.filter(s=>typeof s=="string")},Va=async(e,a,t)=>{const{createRemoteClient:n,detectRemoteProvider:s}=await import("./detect2.js"),c=await s(e.cwd,t,e.config.provider),d=n(c,{githubHost:e.config.githubHost,gitlabHost:e.config.gitlabHost,httpProxy:e.config.httpProxy}),l=await d.detectRepoSlug(e.cwd,t);if(!l)return;const
|
|
27
|
-
`);try{const N=await d.createRelease(t,{body:T,cwd:e.cwd,discussionCategory:m,draft:r,repo:l,tag:V,title:
|
|
26
|
+
`)},Sa=e=>{if(!Array.isArray(e))return;const[a,t]=e;if(a!=="github"||typeof t!="object"||t===null)return;const{internalAuthors:n}=t;if(Array.isArray(n))return n.filter(s=>typeof s=="string")},Va=async(e,a,t)=>{const{createRemoteClient:n,detectRemoteProvider:s}=await import("./detect2.js"),c=await s(e.cwd,t,e.config.provider),d=n(c,{githubHost:e.config.githubHost,gitlabHost:e.config.gitlabHost,httpProxy:e.config.httpProxy}),l=await d.detectRepoSlug(e.cwd,t);if(!l)return;const o=typeof e.config.aggregateRelease=="object"?e.config.aggregateRelease:{enabled:e.config.aggregateRelease===!0},r=e.config.publish?.draftRelease===!0,m=e.config.publish?.discussionCategory,i=e.config.publish?.addReleases;if(o.enabled){const b=new Date().toISOString().slice(0,10),B=(o.title??"Release {date}").replaceAll("{date}",b),V=`release-${b}`,T=a.published.map(N=>`- \`${N.name}\` → ${N.version}`).join(`
|
|
27
|
+
`);try{const N=await d.createRelease(t,{body:T,cwd:e.cwd,discussionCategory:m,draft:r,repo:l,tag:V,title:B});if(N?.url)for(const E of a.published)E.url=N.url}catch{}return}const{defaultTagFor:p,renderTagPattern:h}=await import("./git.js"),u=e.config.releaseTagPattern,P=e.channel?.tag,w=e.config.publish?.releaseAssets??{},$=new Date().toISOString().slice(0,10),y=Sa(e.config.changelog),k=fa(e.plan.consumedChangeFiles??[],{internalAuthors:y});for(const b of a.published){const B=e.perPackageConfig.get(b.name)?.releaseTagPattern??u,V=B?h(B,{channel:P,name:b.name,version:b.version}):p(b.name,b.version),T=b.version.includes("-");let N=`Release of ${b.name}@${b.version}.`;if(b.stageId&&(N=`${N}
|
|
28
28
|
|
|
29
|
-
> ⏳ **Staged — not yet installable.** Approve via \`vis release stage approve ${
|
|
29
|
+
> ⏳ **Staged — not yet installable.** Approve via \`vis release stage approve ${b.stageId}\` or the npmjs.com web UI.`),w.stampHashes&&b.tarball&&(N=`${N}
|
|
30
30
|
|
|
31
31
|
### Tarball integrity
|
|
32
32
|
|
|
33
|
-
- size: \`${
|
|
34
|
-
- sha256: \`${
|
|
35
|
-
- sha512: \`${
|
|
33
|
+
- size: \`${b.tarball.size}\` bytes
|
|
34
|
+
- sha256: \`${b.tarball.sha256}\`
|
|
35
|
+
- sha512: \`${b.tarball.sha512}\``),i!==void 0&&i!==!1)try{const C=V.lastIndexOf("@"),g=C>0?V.slice(0,C+1):"",v=await d.listRecentReleases(t,{cwd:e.cwd,excludeTag:V,limit:5,repo:l,tagPrefix:g}),j=Ma(v);j&&(N=i==="top"?`${j}
|
|
36
36
|
|
|
37
37
|
${N}`:`${N}
|
|
38
38
|
|
|
39
|
-
${j}`)}catch{}const{releaseNoteTemplate:E}=e.config;if(E){const C=e.plan.releases.find(g=>g.name===
|
|
39
|
+
${j}`)}catch{}const{releaseNoteTemplate:E}=e.config;if(E){const C=e.plan.releases.find(g=>g.name===b.name)?.oldVersion??"";N=Da(N,E,{contributors:k,date:$,name:b.name,previousVersion:C,repo:l,version:b.version})}const A=[];w.uploadTarball&&b.tarball&&A.push(b.tarball.path);try{const C=await d.createRelease(t,{assets:A.length>0?A:void 0,body:N,cwd:e.cwd,discussionCategory:m,draft:r,prerelease:T,repo:l,tag:V,title:`${b.name} v${b.version}`});C?.url&&(b.url=C.url)}catch(C){console.warn(`createRelease failed for ${b.name}@${b.version} (tag ${V}): ${C.message}`)}}},Ea=e=>(e.config.publish?.publishArgs??[]).includes("--provenance")&&e.pm.id!=="bun";export{qa as a,za as b,oa as c,sa as d,Ya as f,Xa as p,Ae as r,Ja as w};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{p as o}from"./cli-main.js";import{r as d}from"../packem_shared/advisories-
|
|
1
|
+
import{p as o}from"./cli-main.js";import{r as d}from"../packem_shared/advisories-CefYKEPe.js";const f=async({fs:c,logger:u,options:e,workspaceRoot:s})=>{if(!s)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const r=e.db??d(s),t=e.format==="json";if(!e.force){o.warn(`Prune is destructive. Will remove: ${r}`),o.info("Re-run with --force to proceed."),t&&process.stdout.write(`${JSON.stringify({dbPath:r,reason:"needs --force",removed:!1})}
|
|
2
2
|
`);return}const a=[r,`${r}-wal`,`${r}-shm`,`${r}-journal`],i=[];for(const n of a)try{await c.rm(n,{force:!0}),i.push(n)}catch{}if(t){process.stdout.write(`${JSON.stringify({dbPath:r,files:i,removed:!0})}
|
|
3
3
|
`);return}o.success(`Removed ${r}.`)},w=f;export{w as advisoriesPruneExecute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as
|
|
1
|
+
import{p as n,A as a,R as p}from"./cli-main.js";const w=({options:o,visConfig:l,workspaceRoot:r})=>{const i=r??process.cwd(),e=l?.security?.policies?.installScripts?.allow??{},s=Object.entries(e).filter(([,t])=>t).map(([t])=>t);s.length===0&&!o.rootOnly&&(n.warn("No approved packages in security.policies.installScripts.allow — nothing to run."),!o.withRoot)||(o.rootOnly||a(i,s),(o.withRoot||o.rootOnly)&&p(i))};export{w as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s as d,E as i,I as y}from"../packem_shared/index.server-J83sowC4.js";import{p as a}from"./cli-main.js";import{r as l,g as h}from"../packem_shared/advisories-
|
|
1
|
+
import{s as d,E as i,I as y}from"../packem_shared/index.server-J83sowC4.js";import{p as a}from"./cli-main.js";import{r as l,g as h}from"../packem_shared/advisories-CefYKEPe.js";const p=r=>{if(r===0)return"0 B";const n=["B","KB","MB","GB"],t=Math.min(Math.floor(Math.log(r)/Math.log(1024)),n.length-1),o=r/1024**t;return`${o.toFixed(o<10&&t>0?1:0)} ${n[t]}`},v=r=>{if(!r)return"never";const n=Date.parse(r);if(Number.isNaN(n))return r;const t=Date.now()-n;if(t<0)return r;const o=Math.floor(t/6e4);if(o<1)return"just now";if(o<60)return`${o}m ago`;const s=Math.floor(o/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`},g=async({logger:r,options:n,workspaceRoot:t})=>{if(!t)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const o=n.db??l(t),s=await h(t,o);if(n.format==="json"){process.stdout.write(`${JSON.stringify({dbPath:o,ecosystems:s.ecosystems.map(e=>({advisoryCount:e.advisoryCount,lastSyncIso:e.lastSyncIso,manifestEtag:e.manifestEtag??null,name:e.name})),exists:s.exists,schemaVersion:s.schemaVersion,sizeBytes:s.sizeBytes},void 0,2)}
|
|
2
2
|
`);return}if(a.info(`DB: ${o}`),!s.exists){a.warn(`No advisory DB yet. Run ${d("vis advisories sync")} to populate.`);return}if(a.info(`Schema: v${s.schemaVersion} Size: ${p(s.sizeBytes)}`),s.ecosystems.length===0){a.warn("DB exists but contains no ecosystems. Run `vis advisories sync`.");return}a.info(""),a.info("Ecosystem Advisories Last sync ETag"),a.info(i("────────── ────────── ───────────────── ──────"));for(const e of s.ecosystems){const c=e.name.padEnd(10),f=e.advisoryCount.toLocaleString().padStart(10),m=`${e.lastSyncIso||"never"} (${v(e.lastSyncIso)})`.padEnd(19),u=e.manifestEtag??i("—");a.info(`${y(c)} ${f} ${m} ${u}`)}},S=g;export{S as advisoriesStatusExecute};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{E as g}from"../packem_shared/index.server-J83sowC4.js";import{p as c}from"./cli-main.js";import{s as $}from"../packem_shared/scan-progress-
|
|
1
|
+
import{E as g}from"../packem_shared/index.server-J83sowC4.js";import{p as c}from"./cli-main.js";import{s as $}from"../packem_shared/scan-progress-D4yywI6P.js";import{s as w,D as v}from"../packem_shared/advisories-CefYKEPe.js";const S=t=>t?.security?.audit?.advisories??{},D=t=>t?t.split(",").map(r=>r.trim()).filter(r=>r.length>0):["npm"],b=async({logger:t,options:r,visConfig:h,workspaceRoot:d})=>{if(!d)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const l=r.format==="json",u=S(h),m=r.source??u.source??v,p=D(r.ecosystem),y=p.map(s=>({id:s,label:`Sync ${s} advisories`})),n=$(y,{live:!l}),i=[];try{for(const s of p){n.start(s);const o=Date.now();try{const e=await w({allowedHosts:u.allowedHosts,dbPath:r.db,ecosystem:s,force:!!r.force,source:m,workspaceRoot:d});i.push({ecosystem:s,result:e}),e.upToDate?n.finish(s,"ok",`up to date · ${f(Date.now()-o)}`):n.finish(s,"ok",`${e.advisoriesIngested.toLocaleString()} advisories · ${f(e.durationMs)}`)}catch(e){const a=e instanceof Error?e.message:String(e);i.push({ecosystem:s,error:a}),n.finish(s,"error",a)}}}finally{n.stop()}if(l){const s={ecosystems:i.map(o=>({advisoriesIngested:o.result?.advisoriesIngested??0,dbPath:o.result?.dbPath??null,durationMs:o.result?.durationMs??0,ecosystem:o.ecosystem,error:o.error??null,upToDate:o.result?.upToDate??!1})),source:m};process.stdout.write(`${JSON.stringify(s,void 0,2)}
|
|
2
2
|
`)}else{const s=i.filter(a=>a.error),o=i.filter(a=>a.result),e=o[0];e?.result?.dbPath&&c.info(g(`DB: ${e.result.dbPath}`)),s.length===0?c.success(`Synced ${o.length} ecosystem${o.length===1?"":"s"}.`):c.error(`${s.length} ecosystem${s.length===1?"":"s"} failed to sync.`)}i.some(s=>s.error)&&(process.exitCode=1)},f=t=>t>=1e3?`${(t/1e3).toFixed(1)}s`:`${Math.round(t)}ms`,R=b;export{R as advisoriesSyncExecute};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e}from"./cli-main.js";import{w as u}from"../packem_shared/pm-runner-
|
|
1
|
+
import{p as e}from"./cli-main.js";import{w as u}from"../packem_shared/pm-runner-D4jM58Oz.js";import{O as g}from"../packem_shared/native-config-sync-BFDVK9LH.js";import{S as l}from"../packem_shared/min-release-age-C71MO72F.js";const y=new Set(["bun","npm","pnpm","yarn"]),k=({options:r,visConfig:c,workspaceRoot:f})=>{const s=f??process.cwd(),n=u(s);if(!y.has(n.name)){e.warn(`Package manager '${n.name}' has no native security config to sync.`);return}if(!c?.security){e.warn("vis.config has no `security` block — nothing to sync.");return}const t=c.security.policies??{},a=Object.fromEntries(Object.entries(t.installScripts?.allow??{}).filter(([,o])=>o)),m=t.firstSeen?.minutes,p=t.firstSeen?.exclude??[],i=[];if(Object.keys(a).length>0&&!r.skipAllowBuilds&&i.push(...g(n.name,s,a)),r.skipMinReleaseAge||i.push(...l(n.name,s,m,p)),i.length===0){e.success("Nothing to sync — vis.config and native PM config are aligned.");return}e.info(`Syncing vis.config security settings to ${n.name} native config…
|
|
2
2
|
`);for(const o of i)e.success(` ${o}`)};export{k as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as m}from"node:module";import{m as d,f as p,T as v}from"../packem_shared/index-
|
|
1
|
+
import{createRequire as m}from"node:module";import{m as d,f as p,T as v}from"../packem_shared/index-CE6MsgcV.js";import{p as e}from"./cli-main.js";import{w as $}from"../packem_shared/pm-runner-D4jM58Oz.js";import{a as u}from"../packem_shared/readJsonSync-CvkZyKmL-ihoybKvs.js";const g=m(import.meta.url),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,w=o=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[t,s]=c.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return c.getBuiltinModule(o)}return g(o)},{spawnSync:y}=w("node:child_process"),n="@lavamoat/preinstall-always-fail",l=o=>{const t=d(o,"package.json");if(!p(t))return"no-package-json";try{const s=u(t);if(s.devDependencies?.[n]||s.dependencies?.[n])return"installed"}catch{}return"missing"},h=o=>{const t=d(o,"package.json");if(!p(t))return!1;try{const s=u(t);let i=!1;const a=r=>!r||!(n in r)?r:(i=!0,Object.fromEntries(Object.entries(r).filter(([f])=>f!==n)));return s.devDependencies=a(s.devDependencies),s.dependencies=a(s.dependencies),i&&v(t,`${JSON.stringify(s,null,2)}
|
|
2
2
|
`),i}catch{return!1}},D=({options:o,workspaceRoot:t})=>{const s=t??process.cwd();if(o.status){switch(l(s)){case"installed":{e.success(`Preinstall tripwire is installed (${n}).`),e.info("Removing 'ignore-scripts=true' will cause future installs to fail loudly.");break}case"missing":{e.warn("Preinstall tripwire is not installed."),e.info(`Run 'vis security tripwire' to add ${n} as a devDependency.`);break}default:e.error("No package.json found at the workspace root."),process.exitCode=1}return}if(o.remove){h(s)?e.success(`Removed ${n} from package.json. Run your PM's install to clean node_modules.`):e.info(`${n} was not present in package.json.`);return}if(l(s)==="installed"){e.info(`${n} is already installed.`);return}const i=$(s),a={bun:["add","-d",n],npm:["install","--save-dev",n],pnpm:["add","-D","-w",n],yarn:["add","-D",n]}[i.name];if(!a){e.error(`Cannot install tripwire — unsupported package manager '${i.name}'.`),process.exitCode=1;return}e.info(`Installing ${n} via ${i.name}…`);const r=y(i.name,a,{cwd:s,stdio:"inherit"});if(r.error){e.error(`Failed to install tripwire: ${r.error.message}`),process.exitCode=1;return}if(r.signal!==null){e.error(`${i.name} was terminated by signal ${r.signal}`),process.exitCode=1;return}if(r.status!==0){e.error(`${i.name} exited with code ${String(r.status)}`),process.exitCode=r.status??1;return}e.success(`Installed ${n} as a devDependency.`),e.notice(""),e.notice("How the tripwire works:"),e.notice(` ${n} declares a preinstall script that always fails.`),e.notice(" When 'ignore-scripts=true' is set (.npmrc / bunfig.toml / .yarnrc.yml),"),e.notice(" the script is skipped and installs succeed normally. If someone deletes"),e.notice(" that setting, the next install fails — loudly — instead of silently"),e.notice(" running every dependency's lifecycle scripts.")};export{D as default};
|
|
@@ -1,2 +1,22 @@
|
|
|
1
|
-
import{createRequire as $}from"node:module";import{m as U,H as W}from"../packem_shared/index-OQZQyN5R.js";import{transformTs as g}from"#native";const T=$(import.meta.url),n=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,l=t=>{if(typeof n<"u"&&n.versions&&n.versions.node){const[r,s]=n.versions.node.split(".").map(Number);if(r>22||r===22&&s>=3||r===20&&s>=16)return n.getBuiltinModule(t)}return T(t)},{readFileSync:y,statSync:j,writeFileSync:S,unlinkSync:w}=l("node:fs"),R=l("node:module"),{fileURLToPath:a,pathToFileURL:f}=l("node:url"),b=/\.[cm]?tsx?$/;let d=!1,u=0,p=!1,m=!1;const H=()=>{m||(m=!0,process.setSourceMapsEnabled?.(!0))},L=t=>{const r=t.indexOf("?");return r===-1?t:t.slice(0,r)},x=t=>t.endsWith(".cts")?"commonjs":"module",h=[".ts",".tsx",".mts",".cts",".js",".mjs",".cjs",".json"],c=t=>{try{return j(t).isFile()}catch{return!1}},k=t=>{try{return j(t).isDirectory()}catch{return!1}},F=t=>{if(t.endsWith(".js"))return`${t.slice(0,-3)}.ts`;if(t.endsWith(".mjs"))return`${t.slice(0,-4)}.mts`;if(t.endsWith(".cjs"))return`${t.slice(0,-4)}.cts`},q=t=>{if(c(t))return t;const r=F(t);if(r!==void 0&&c(r))return r;for(const s of h)if(c(t+s))return t+s;if(k(t))for(const s of h){const o=`${t}/index${s}`;if(c(o))return o}},v=()=>{H();const{registerHooks:t}=R;return typeof t!="function"?!1:(d||(t({load(r,s,o){const e=L(r);if(e.startsWith("file:")&&b.test(e)){const i=a(e),{code:_}=g(i,y(i,"utf8"));return{format:x(i),shortCircuit:!0,source:_}}return o(r,s)},resolve(r,s,o){if((r.startsWith(".")||r.startsWith("/"))&&s.parentURL!==void 0){let e;try{e=new URL(r,s.parentURL)}catch{e=void 0}if(e?.protocol==="file:"){const i=q(a(e));if(i!==void 0)return{shortCircuit:!0,url:f(i).href}}}return o(r,s)}}),d=!0),!0)},C=()=>v(),P=async t=>{if(u+=1,v())return await import(`${f(t).href}?v=${String(u)}`);p||(p=!0,process.stderr.write(`vis: Node < 22.15 has no module.registerHooks — only the entry file is transpiled; local TypeScript imports won't load. Upgrade to Node >= 22.15 for full support.
|
|
2
|
-
|
|
1
|
+
import{createRequire as ge}from"node:module";import{v as z,z as ve,s as we,U as ke,L as xe,B as R,H as K,y as Cu,e as se,m as I,A as Mu,g as Bu,w as $e,h as Te,f as _,F as hu}from"../packem_shared/index-CE6MsgcV.js";import{parse as Se}from"./index4.js";import{E as Ku}from"../packem_shared/public-api-WqUCiyIe.js";import{transformTs as ne}from"#native";const ye=ge(import.meta.url),uu=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Wu=u=>{if(typeof uu<"u"&&uu.versions&&uu.versions.node){const[e,o]=uu.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return uu.getBuiltinModule(u)}return ye(u)},{readFileSync:Vu,statSync:ie,writeFileSync:be,unlinkSync:Oe}=Wu("node:fs"),Pu=Wu("node:module"),{createRequire:Z}=Pu,{fileURLToPath:fu,pathToFileURL:mu}=Wu("node:url");var Ne=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,Ie=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,Pe=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,vu={Space_Separator:Ne,ID_Start:Ie,ID_Continue:Pe},T={isSpaceSeparator(u){return typeof u=="string"&&vu.Space_Separator.test(u)},isIdStartChar(u){return typeof u=="string"&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u==="$"||u==="_"||vu.ID_Start.test(u))},isIdContinueChar(u){return typeof u=="string"&&(u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||u==="$"||u==="_"||u===""||u===""||vu.ID_Continue.test(u))},isDigit(u){return typeof u=="string"&&/[0-9]/.test(u)},isHexDigit(u){return typeof u=="string"&&/[0-9A-Fa-f]/.test(u)}};let ju,P,V,gu,J,U,N,Ju,au;var je=function(u,e){ju=String(u),P="start",V=[],gu=0,J=1,U=0,N=void 0,Ju=void 0,au=void 0;do N=Le(),Ue[P]();while(N.type!=="eof");return typeof e=="function"?Lu({"":au},"",e):au};function Lu(u,e,o){const t=u[e];if(t!=null&&typeof t=="object")if(Array.isArray(t))for(let r=0;r<t.length;r++){const D=String(r),i=Lu(t,D,o);i===void 0?delete t[D]:Object.defineProperty(t,D,{value:i,writable:!0,enumerable:!0,configurable:!0})}else for(const r in t){const D=Lu(t,r,o);D===void 0?delete t[r]:Object.defineProperty(t,r,{value:D,writable:!0,enumerable:!0,configurable:!0})}return o.call(u,e,t)}let h,m,cu,W,b;function Le(){for(h="default",m="",cu=!1,W=1;;){b=M();const u=De[h]();if(u)return u}}function M(){if(ju[gu])return String.fromCodePoint(ju.codePointAt(gu))}function s(){const u=M();return u===`
|
|
2
|
+
`?(J++,U=0):u?U+=u.length:U++,u&&(gu+=u.length),u}const De={default(){switch(b){case" ":case"\v":case"\f":case" ":case" ":case"\uFEFF":case`
|
|
3
|
+
`:case"\r":case"\u2028":case"\u2029":s();return;case"/":s(),h="comment";return;case void 0:return s(),k("eof")}if(T.isSpaceSeparator(b)){s();return}return De[P]()},comment(){switch(b){case"*":s(),h="multiLineComment";return;case"/":s(),h="singleLineComment";return}throw x(s())},multiLineComment(){switch(b){case"*":s(),h="multiLineCommentAsterisk";return;case void 0:throw x(s())}s()},multiLineCommentAsterisk(){switch(b){case"*":s();return;case"/":s(),h="default";return;case void 0:throw x(s())}s(),h="multiLineComment"},singleLineComment(){switch(b){case`
|
|
4
|
+
`:case"\r":case"\u2028":case"\u2029":s(),h="default";return;case void 0:return s(),k("eof")}s()},value(){switch(b){case"{":case"[":return k("punctuator",s());case"n":return s(),q("ull"),k("null",null);case"t":return s(),q("rue"),k("boolean",!0);case"f":return s(),q("alse"),k("boolean",!1);case"-":case"+":s()==="-"&&(W=-1),h="sign";return;case".":m=s(),h="decimalPointLeading";return;case"0":m=s(),h="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":m=s(),h="decimalInteger";return;case"I":return s(),q("nfinity"),k("numeric",1/0);case"N":return s(),q("aN"),k("numeric",NaN);case'"':case"'":cu=s()==='"',m="",h="string";return}throw x(s())},identifierNameStartEscape(){if(b!=="u")throw x(s());s();const u=_u();switch(u){case"$":case"_":break;default:if(!T.isIdStartChar(u))throw zu();break}m+=u,h="identifierName"},identifierName(){switch(b){case"$":case"_":case"":case"":m+=s();return;case"\\":s(),h="identifierNameEscape";return}if(T.isIdContinueChar(b)){m+=s();return}return k("identifier",m)},identifierNameEscape(){if(b!=="u")throw x(s());s();const u=_u();switch(u){case"$":case"_":case"":case"":break;default:if(!T.isIdContinueChar(u))throw zu();break}m+=u,h="identifierName"},sign(){switch(b){case".":m=s(),h="decimalPointLeading";return;case"0":m=s(),h="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":m=s(),h="decimalInteger";return;case"I":return s(),q("nfinity"),k("numeric",W*(1/0));case"N":return s(),q("aN"),k("numeric",NaN)}throw x(s())},zero(){switch(b){case".":m+=s(),h="decimalPoint";return;case"e":case"E":m+=s(),h="decimalExponent";return;case"x":case"X":m+=s(),h="hexadecimal";return}return k("numeric",W*0)},decimalInteger(){switch(b){case".":m+=s(),h="decimalPoint";return;case"e":case"E":m+=s(),h="decimalExponent";return}if(T.isDigit(b)){m+=s();return}return k("numeric",W*Number(m))},decimalPointLeading(){if(T.isDigit(b)){m+=s(),h="decimalFraction";return}throw x(s())},decimalPoint(){switch(b){case"e":case"E":m+=s(),h="decimalExponent";return}if(T.isDigit(b)){m+=s(),h="decimalFraction";return}return k("numeric",W*Number(m))},decimalFraction(){switch(b){case"e":case"E":m+=s(),h="decimalExponent";return}if(T.isDigit(b)){m+=s();return}return k("numeric",W*Number(m))},decimalExponent(){switch(b){case"+":case"-":m+=s(),h="decimalExponentSign";return}if(T.isDigit(b)){m+=s(),h="decimalExponentInteger";return}throw x(s())},decimalExponentSign(){if(T.isDigit(b)){m+=s(),h="decimalExponentInteger";return}throw x(s())},decimalExponentInteger(){if(T.isDigit(b)){m+=s();return}return k("numeric",W*Number(m))},hexadecimal(){if(T.isHexDigit(b)){m+=s(),h="hexadecimalInteger";return}throw x(s())},hexadecimalInteger(){if(T.isHexDigit(b)){m+=s();return}return k("numeric",W*Number(m))},string(){switch(b){case"\\":s(),m+=_e();return;case'"':if(cu)return s(),k("string",m);m+=s();return;case"'":if(!cu)return s(),k("string",m);m+=s();return;case`
|
|
5
|
+
`:case"\r":throw x(s());case"\u2028":case"\u2029":We(b);break;case void 0:throw x(s())}m+=s()},start(){switch(b){case"{":case"[":return k("punctuator",s())}h="value"},beforePropertyName(){switch(b){case"$":case"_":m=s(),h="identifierName";return;case"\\":s(),h="identifierNameStartEscape";return;case"}":return k("punctuator",s());case'"':case"'":cu=s()==='"',h="string";return}if(T.isIdStartChar(b)){m+=s(),h="identifierName";return}throw x(s())},afterPropertyName(){if(b===":")return k("punctuator",s());throw x(s())},beforePropertyValue(){h="value"},afterPropertyValue(){switch(b){case",":case"}":return k("punctuator",s())}throw x(s())},beforeArrayValue(){if(b==="]")return k("punctuator",s());h="value"},afterArrayValue(){switch(b){case",":case"]":return k("punctuator",s())}throw x(s())},end(){throw x(s())}};function k(u,e){return{type:u,value:e,line:J,column:U}}function q(u){for(const e of u){if(M()!==e)throw x(s());s()}}function _e(){switch(M()){case"b":return s(),"\b";case"f":return s(),"\f";case"n":return s(),`
|
|
6
|
+
`;case"r":return s(),"\r";case"t":return s()," ";case"v":return s(),"\v";case"0":if(s(),T.isDigit(M()))throw x(s());return"\0";case"x":return s(),Re();case"u":return s(),_u();case`
|
|
7
|
+
`:case"\u2028":case"\u2029":return s(),"";case"\r":return s(),M()===`
|
|
8
|
+
`&&s(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw x(s());case void 0:throw x(s())}return s()}function Re(){let u="",e=M();if(!T.isHexDigit(e)||(u+=s(),e=M(),!T.isHexDigit(e)))throw x(s());return u+=s(),String.fromCodePoint(parseInt(u,16))}function _u(){let u="",e=4;for(;e-- >0;){const o=M();if(!T.isHexDigit(o))throw x(s());u+=s()}return String.fromCodePoint(parseInt(u,16))}const Ue={start(){if(N.type==="eof")throw H();wu()},beforePropertyName(){switch(N.type){case"identifier":case"string":Ju=N.value,P="afterPropertyName";return;case"punctuator":Au();return;case"eof":throw H()}},afterPropertyName(){if(N.type==="eof")throw H();P="beforePropertyValue"},beforePropertyValue(){if(N.type==="eof")throw H();wu()},beforeArrayValue(){if(N.type==="eof")throw H();if(N.type==="punctuator"&&N.value==="]"){Au();return}wu()},afterPropertyValue(){if(N.type==="eof")throw H();switch(N.value){case",":P="beforePropertyName";return;case"}":Au()}},afterArrayValue(){if(N.type==="eof")throw H();switch(N.value){case",":P="beforeArrayValue";return;case"]":Au()}},end(){}};function wu(){let u;switch(N.type){case"punctuator":switch(N.value){case"{":u={};break;case"[":u=[];break}break;case"null":case"boolean":case"numeric":case"string":u=N.value;break}if(au===void 0)au=u;else{const e=V[V.length-1];Array.isArray(e)?e.push(u):Object.defineProperty(e,Ju,{value:u,writable:!0,enumerable:!0,configurable:!0})}if(u!==null&&typeof u=="object")V.push(u),Array.isArray(u)?P="beforeArrayValue":P="beforePropertyName";else{const e=V[V.length-1];e==null?P="end":Array.isArray(e)?P="afterArrayValue":P="afterPropertyValue"}}function Au(){V.pop();const u=V[V.length-1];u==null?P="end":Array.isArray(u)?P="afterArrayValue":P="afterPropertyValue"}function x(u){return qu(u===void 0?`JSON5: invalid end of input at ${J}:${U}`:`JSON5: invalid character '${ce(u)}' at ${J}:${U}`)}function H(){return qu(`JSON5: invalid end of input at ${J}:${U}`)}function zu(){return U-=5,qu(`JSON5: invalid identifier character at ${J}:${U}`)}function We(u){console.warn(`JSON5: '${ce(u)}' in strings is not valid ECMAScript; consider escaping`)}function ce(u){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[u])return e[u];if(u<" "){const o=u.charCodeAt(0).toString(16);return"\\x"+("00"+o).substring(o.length)}return u}function qu(u){const e=new SyntaxError(u);return e.lineNumber=J,e.columnNumber=U,e}var Ve=function(u,e,o){const t=[];let r="",D,i,c="",a;if(e!=null&&typeof e=="object"&&!Array.isArray(e)&&(o=e.space,a=e.quote,e=e.replacer),typeof e=="function")i=e;else if(Array.isArray(e)){D=[];for(const C of e){let y;typeof C=="string"?y=C:(typeof C=="number"||C instanceof String||C instanceof Number)&&(y=String(C)),y!==void 0&&D.indexOf(y)<0&&D.push(y)}}return o instanceof Number?o=Number(o):o instanceof String&&(o=String(o)),typeof o=="number"?o>0&&(o=Math.min(10,Math.floor(o)),c=" ".substr(0,o)):typeof o=="string"&&(c=o.substr(0,10)),l("",{"":u});function l(C,y){let A=y[C];switch(A!=null&&(typeof A.toJSON5=="function"?A=A.toJSON5(C):typeof A.toJSON=="function"&&(A=A.toJSON(C))),i&&(A=i.call(y,C,A)),A instanceof Number?A=Number(A):A instanceof String?A=String(A):A instanceof Boolean&&(A=A.valueOf()),A){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof A=="string")return f(A);if(typeof A=="number")return String(A);if(typeof A=="object")return Array.isArray(A)?O(A):E(A)}function f(C){const y={"'":.1,'"':.2},A={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let w="";for(let n=0;n<C.length;n++){const d=C[n];switch(d){case"'":case'"':y[d]++,w+=d;continue;case"\0":if(T.isDigit(C[n+1])){w+="\\x00";continue}}if(A[d]){w+=A[d];continue}if(d<" "){let g=d.charCodeAt(0).toString(16);w+="\\x"+("00"+g).substring(g.length);continue}w+=d}const F=a||Object.keys(y).reduce((n,d)=>y[n]<y[d]?n:d);return w=w.replace(new RegExp(F,"g"),A[F]),F+w+F}function E(C){if(t.indexOf(C)>=0)throw TypeError("Converting circular structure to JSON5");t.push(C);let y=r;r=r+c;let A=D||Object.keys(C),w=[];for(const n of A){const d=l(n,C);if(d!==void 0){let g=$(n)+":";c!==""&&(g+=" "),g+=d,w.push(g)}}let F;if(w.length===0)F="{}";else{let n;if(c==="")n=w.join(","),F="{"+n+"}";else{let d=`,
|
|
9
|
+
`+r;n=w.join(d),F=`{
|
|
10
|
+
`+r+n+`,
|
|
11
|
+
`+y+"}"}}return t.pop(),r=y,F}function $(C){if(C.length===0)return f(C);const y=String.fromCodePoint(C.codePointAt(0));if(!T.isIdStartChar(y))return f(C);for(let A=y.length;A<C.length;A++)if(!T.isIdContinueChar(String.fromCodePoint(C.codePointAt(A))))return f(C);return C}function O(C){if(t.indexOf(C)>=0)throw TypeError("Converting circular structure to JSON5");t.push(C);let y=r;r=r+c;let A=[];for(let F=0;F<C.length;F++){const n=l(String(F),C);A.push(n!==void 0?n:"null")}let w;if(A.length===0)w="[]";else if(c==="")w="["+A.join(",")+"]";else{let F=`,
|
|
12
|
+
`+r,n=A.join(F);w=`[
|
|
13
|
+
`+r+n+`,
|
|
14
|
+
`+y+"]"}return t.pop(),r=y,w}};const Me={parse:je,stringify:Ve};var Je=Me;function qe(u,e,o){const{beforeParse:t,buffer:r,compression:D,encoding:i="utf8",flag:c}={},a=z(u,{buffer:r,compression:D,encoding:i,flag:c}),l=typeof t=="function"?t(a):a;return Je.parse(l,e)}const He=Z(import.meta.url),eu=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ke=u=>{if(typeof eu<"u"&&eu.versions&&eu.versions.node){const[e,o]=eu.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return eu.getBuiltinModule(u)}return He(u)};Ke("node:fs/promises");const ze=Z(import.meta.url),tu=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ge=u=>{if(typeof tu<"u"&&tu.versions&&tu.versions.node){const[e,o]=tu.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return tu.getBuiltinModule(u)}return ze(u)};Ge("node:fs");function Qe(u,e=!1){const o=u.length;let t=0,r="",D=0,i=16,c=0,a=0,l=0,f=0,E=0;function $(n,d){let g=0,B=0;for(;g<n;){let p=u.charCodeAt(t);if(p>=48&&p<=57)B=B*16+p-48;else if(p>=65&&p<=70)B=B*16+p-65+10;else if(p>=97&&p<=102)B=B*16+p-97+10;else break;t++,g++}return g<n&&(B=-1),B}function O(n){t=n,r="",D=0,i=16,E=0}function C(){let n=t;if(u.charCodeAt(t)===48)t++;else for(t++;t<u.length&&G(u.charCodeAt(t));)t++;if(t<u.length&&u.charCodeAt(t)===46)if(t++,t<u.length&&G(u.charCodeAt(t)))for(t++;t<u.length&&G(u.charCodeAt(t));)t++;else return E=3,u.substring(n,t);let d=t;if(t<u.length&&(u.charCodeAt(t)===69||u.charCodeAt(t)===101))if(t++,(t<u.length&&u.charCodeAt(t)===43||u.charCodeAt(t)===45)&&t++,t<u.length&&G(u.charCodeAt(t))){for(t++;t<u.length&&G(u.charCodeAt(t));)t++;d=t}else E=3;return u.substring(n,d)}function y(){let n="",d=t;for(;;){if(t>=o){n+=u.substring(d,t),E=2;break}const g=u.charCodeAt(t);if(g===34){n+=u.substring(d,t),t++;break}if(g===92){if(n+=u.substring(d,t),t++,t>=o){E=2;break}switch(u.charCodeAt(t++)){case 34:n+='"';break;case 92:n+="\\";break;case 47:n+="/";break;case 98:n+="\b";break;case 102:n+="\f";break;case 110:n+=`
|
|
15
|
+
`;break;case 114:n+="\r";break;case 116:n+=" ";break;case 117:const B=$(4);B>=0?n+=String.fromCharCode(B):E=4;break;default:E=5}d=t;continue}if(g>=0&&g<=31)if(ru(g)){n+=u.substring(d,t),E=2;break}else E=6;t++}return n}function A(){if(r="",E=0,D=t,a=c,f=l,t>=o)return D=o,i=17;let n=u.charCodeAt(t);if(ku(n)){do t++,r+=String.fromCharCode(n),n=u.charCodeAt(t);while(ku(n));return i=15}if(ru(n))return t++,r+=String.fromCharCode(n),n===13&&u.charCodeAt(t)===10&&(t++,r+=`
|
|
16
|
+
`),c++,l=t,i=14;switch(n){case 123:return t++,i=1;case 125:return t++,i=2;case 91:return t++,i=3;case 93:return t++,i=4;case 58:return t++,i=6;case 44:return t++,i=5;case 34:return t++,r=y(),i=10;case 47:const d=t-1;if(u.charCodeAt(t+1)===47){for(t+=2;t<o&&!ru(u.charCodeAt(t));)t++;return r=u.substring(d,t),i=12}if(u.charCodeAt(t+1)===42){t+=2;const g=o-1;let B=!1;for(;t<g;){const p=u.charCodeAt(t);if(p===42&&u.charCodeAt(t+1)===47){t+=2,B=!0;break}t++,ru(p)&&(p===13&&u.charCodeAt(t)===10&&t++,c++,l=t)}return B||(t++,E=1),r=u.substring(d,t),i=13}return r+=String.fromCharCode(n),t++,i=16;case 45:if(r+=String.fromCharCode(n),t++,t===o||!G(u.charCodeAt(t)))return i=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return r+=C(),i=11;default:for(;t<o&&w(n);)t++,n=u.charCodeAt(t);if(D!==t){switch(r=u.substring(D,t),r){case"true":return i=8;case"false":return i=9;case"null":return i=7}return i=16}return r+=String.fromCharCode(n),t++,i=16}}function w(n){if(ku(n)||ru(n))return!1;switch(n){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function F(){let n;do n=A();while(n>=12&&n<=15);return n}return{setPosition:O,getPosition:()=>t,scan:e?F:A,getToken:()=>i,getTokenValue:()=>r,getTokenOffset:()=>D,getTokenLength:()=>t-D,getTokenStartLine:()=>a,getTokenStartCharacter:()=>D-f,getTokenError:()=>E}}function ku(u){return u===32||u===9}function ru(u){return u===10||u===13}function G(u){return u>=48&&u<=57}var Gu;(function(u){u[u.lineFeed=10]="lineFeed",u[u.carriageReturn=13]="carriageReturn",u[u.space=32]="space",u[u._0=48]="_0",u[u._1=49]="_1",u[u._2=50]="_2",u[u._3=51]="_3",u[u._4=52]="_4",u[u._5=53]="_5",u[u._6=54]="_6",u[u._7=55]="_7",u[u._8=56]="_8",u[u._9=57]="_9",u[u.a=97]="a",u[u.b=98]="b",u[u.c=99]="c",u[u.d=100]="d",u[u.e=101]="e",u[u.f=102]="f",u[u.g=103]="g",u[u.h=104]="h",u[u.i=105]="i",u[u.j=106]="j",u[u.k=107]="k",u[u.l=108]="l",u[u.m=109]="m",u[u.n=110]="n",u[u.o=111]="o",u[u.p=112]="p",u[u.q=113]="q",u[u.r=114]="r",u[u.s=115]="s",u[u.t=116]="t",u[u.u=117]="u",u[u.v=118]="v",u[u.w=119]="w",u[u.x=120]="x",u[u.y=121]="y",u[u.z=122]="z",u[u.A=65]="A",u[u.B=66]="B",u[u.C=67]="C",u[u.D=68]="D",u[u.E=69]="E",u[u.F=70]="F",u[u.G=71]="G",u[u.H=72]="H",u[u.I=73]="I",u[u.J=74]="J",u[u.K=75]="K",u[u.L=76]="L",u[u.M=77]="M",u[u.N=78]="N",u[u.O=79]="O",u[u.P=80]="P",u[u.Q=81]="Q",u[u.R=82]="R",u[u.S=83]="S",u[u.T=84]="T",u[u.U=85]="U",u[u.V=86]="V",u[u.W=87]="W",u[u.X=88]="X",u[u.Y=89]="Y",u[u.Z=90]="Z",u[u.asterisk=42]="asterisk",u[u.backslash=92]="backslash",u[u.closeBrace=125]="closeBrace",u[u.closeBracket=93]="closeBracket",u[u.colon=58]="colon",u[u.comma=44]="comma",u[u.dot=46]="dot",u[u.doubleQuote=34]="doubleQuote",u[u.minus=45]="minus",u[u.openBrace=123]="openBrace",u[u.openBracket=91]="openBracket",u[u.plus=43]="plus",u[u.slash=47]="slash",u[u.formFeed=12]="formFeed",u[u.tab=9]="tab"})(Gu||(Gu={}));new Array(20).fill(0).map((u,e)=>" ".repeat(e));const Q=200;new Array(Q).fill(0).map((u,e)=>`
|
|
17
|
+
`+" ".repeat(e)),new Array(Q).fill(0).map((u,e)=>"\r"+" ".repeat(e)),new Array(Q).fill(0).map((u,e)=>`\r
|
|
18
|
+
`+" ".repeat(e)),new Array(Q).fill(0).map((u,e)=>`
|
|
19
|
+
`+" ".repeat(e)),new Array(Q).fill(0).map((u,e)=>"\r"+" ".repeat(e)),new Array(Q).fill(0).map((u,e)=>`\r
|
|
20
|
+
`+" ".repeat(e));var yu;(function(u){u.DEFAULT={allowTrailingComma:!1}})(yu||(yu={}));function Ye(u,e=[],o=yu.DEFAULT){let t=null,r=[];const D=[];function i(c){Array.isArray(r)?r.push(c):t!==null&&(r[t]=c)}return Ze(u,{onObjectBegin:()=>{const c={};i(c),D.push(r),r=c,t=null},onObjectProperty:c=>{t=c},onObjectEnd:()=>{r=D.pop()},onArrayBegin:()=>{const c=[];i(c),D.push(r),r=c,t=null},onArrayEnd:()=>{r=D.pop()},onLiteralValue:i,onError:(c,a,l)=>{e.push({error:c,offset:a,length:l})}},o),r[0]}function Ze(u,e,o=yu.DEFAULT){const t=Qe(u,!1),r=[];let D=0;function i(v){return v?()=>D===0&&v(t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter()):()=>!0}function c(v){return v?S=>D===0&&v(S,t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter()):()=>!0}function a(v){return v?S=>D===0&&v(S,t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter(),()=>r.slice()):()=>!0}function l(v){return v?()=>{D>0?D++:v(t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter(),()=>r.slice())===!1&&(D=1)}:()=>!0}function f(v){return v?()=>{D>0&&D--,D===0&&v(t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter())}:()=>!0}const E=l(e.onObjectBegin),$=a(e.onObjectProperty),O=f(e.onObjectEnd),C=l(e.onArrayBegin),y=f(e.onArrayEnd),A=a(e.onLiteralValue),w=c(e.onSeparator),F=i(e.onComment),n=c(e.onError),d=o&&o.disallowComments,g=o&&o.allowTrailingComma;function B(){for(;;){const v=t.scan();switch(t.getTokenError()){case 4:p(14);break;case 5:p(15);break;case 3:p(13);break;case 1:d||p(11);break;case 2:p(12);break;case 6:p(16);break}switch(v){case 12:case 13:d?p(10):F();break;case 16:p(1);break;case 15:case 14:break;default:return v}}}function p(v,S=[],Hu=[]){if(n(v),S.length+Hu.length>0){let pu=t.getToken();for(;pu!==17;){if(S.indexOf(pu)!==-1){B();break}else if(Hu.indexOf(pu)!==-1)break;pu=B()}}}function L(v){const S=t.getTokenValue();return v?A(S):($(S),r.push(S)),B(),!0}function X(){switch(t.getToken()){case 11:const v=t.getTokenValue();let S=Number(v);isNaN(S)&&(p(2),S=0),A(S);break;case 7:A(null);break;case 8:A(!0);break;case 9:A(!1);break;default:return!1}return B(),!0}function Fu(){return t.getToken()!==10?(p(3,[],[2,5]),!1):(L(!1),t.getToken()===6?(w(":"),B(),Ou()||p(4,[],[2,5])):p(5,[],[2,5]),r.pop(),!0)}function Be(){E(),B();let v=!1;for(;t.getToken()!==2&&t.getToken()!==17;){if(t.getToken()===5){if(v||p(4,[],[]),w(","),B(),t.getToken()===2&&g)break}else v&&p(6,[],[]);Fu()||p(4,[],[2,5]),v=!0}return O(),t.getToken()!==2?p(7,[2],[]):B(),!0}function he(){C(),B();let v=!0,S=!1;for(;t.getToken()!==4&&t.getToken()!==17;){if(t.getToken()===5){if(S||p(4,[],[]),w(","),B(),t.getToken()===4&&g)break}else S&&p(6,[],[]);v?(r.push(0),v=!1):r[r.length-1]++,Ou()||p(4,[],[4,5]),S=!0}return y(),v||r.pop(),t.getToken()!==4?p(8,[4],[]):B(),!0}function Ou(){switch(t.getToken()){case 3:return he();case 1:return Be();case 10:return L(!0);default:return X()}}return B(),t.getToken()===17?o.allowEmptyContent?!0:(p(4,[],[]),!1):Ou()?(t.getToken()!==17&&p(9,[],[]),!0):(p(4,[],[]),!1)}var Qu;(function(u){u[u.None=0]="None",u[u.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",u[u.UnexpectedEndOfString=2]="UnexpectedEndOfString",u[u.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",u[u.InvalidUnicode=4]="InvalidUnicode",u[u.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",u[u.InvalidCharacter=6]="InvalidCharacter"})(Qu||(Qu={}));var Yu;(function(u){u[u.OpenBraceToken=1]="OpenBraceToken",u[u.CloseBraceToken=2]="CloseBraceToken",u[u.OpenBracketToken=3]="OpenBracketToken",u[u.CloseBracketToken=4]="CloseBracketToken",u[u.CommaToken=5]="CommaToken",u[u.ColonToken=6]="ColonToken",u[u.NullKeyword=7]="NullKeyword",u[u.TrueKeyword=8]="TrueKeyword",u[u.FalseKeyword=9]="FalseKeyword",u[u.StringLiteral=10]="StringLiteral",u[u.NumericLiteral=11]="NumericLiteral",u[u.LineCommentTrivia=12]="LineCommentTrivia",u[u.BlockCommentTrivia=13]="BlockCommentTrivia",u[u.LineBreakTrivia=14]="LineBreakTrivia",u[u.Trivia=15]="Trivia",u[u.Unknown=16]="Unknown",u[u.EOF=17]="EOF"})(Yu||(Yu={}));const bu=Ye;var Zu;(function(u){u[u.InvalidSymbol=1]="InvalidSymbol",u[u.InvalidNumberFormat=2]="InvalidNumberFormat",u[u.PropertyNameExpected=3]="PropertyNameExpected",u[u.ValueExpected=4]="ValueExpected",u[u.ColonExpected=5]="ColonExpected",u[u.CommaExpected=6]="CommaExpected",u[u.CloseBraceExpected=7]="CloseBraceExpected",u[u.CloseBracketExpected=8]="CloseBracketExpected",u[u.EndOfFileExpected=9]="EndOfFileExpected",u[u.InvalidCommentToken=10]="InvalidCommentToken",u[u.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",u[u.UnexpectedEndOfString=12]="UnexpectedEndOfString",u[u.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",u[u.InvalidUnicode=14]="InvalidUnicode",u[u.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",u[u.InvalidCharacter=16]="InvalidCharacter"})(Zu||(Zu={}));function Xe(u){switch(u){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"}const ut=(u,e,o,t)=>{if(u.length===0)return;const r=u[0],D=ve(e,r.offset),i=new we(`${Xe(r.error)} at offset ${r.offset}`);throw i.fileName=o,i.codeFrame=ke(e,{start:D},{tabWidth:!1,...t}),i},et=(u,e)=>{const{allowEmptyContent:o,allowTrailingComma:t=!0,beforeParse:r,buffer:D,color:i,compression:c,disallowComments:a,encoding:l="utf8",flag:f}=e??{},E=z(u,{buffer:D,compression:c,encoding:l,flag:f}),$=typeof r=="function"?r(E):E,O=[],C=bu($,O,{allowEmptyContent:o,allowTrailingComma:t,disallowComments:a});return ut(O,$,xe(u),{color:i}),C},tt=Z(import.meta.url),ou=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,rt=u=>{if(typeof ou<"u"&&ou.versions&&ou.versions.node){const[e,o]=ou.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return ou.getBuiltinModule(u)}return tt(u)};rt("node:fs/promises");const ot=Z(import.meta.url),iu=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,it=u=>{if(typeof iu<"u"&&iu.versions&&iu.versions.node){const[e,o]=iu.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return iu.getBuiltinModule(u)}return ot(u)};it("node:fs");const st=(u,e)=>{const o=z(u,{encoding:"utf8",...e});return Se(o)};function nt(u,e,o){const{buffer:t,compression:r,encoding:D="utf8",flag:i,...c}={},a=z(u,{buffer:t,compression:r,encoding:D,flag:i});return typeof e=="function"?Ku(a,e,c):Ku(a,c)}var su={},Xu;function Dt(){if(Xu)return su;Xu=1,Object.defineProperty(su,"__esModule",{value:!0});const u=F=>F!==null&&typeof F=="object",e=(F,n)=>Object.assign(new Error(`[${F}]: ${n}`),{code:F}),o="ERR_INVALID_PACKAGE_CONFIG",t="ERR_INVALID_PACKAGE_TARGET",r="ERR_PACKAGE_PATH_NOT_EXPORTED",D="ERR_PACKAGE_IMPORT_NOT_DEFINED",i=/^\d+$/,c=/^(\.{1,2}|node_modules)$/i,a=/\/|\\/;var l=(F=>(F.Export="exports",F.Import="imports",F))(l||{});const f=(F,n,d,g,B)=>{if(n==null)return[];if(typeof n=="string"){const[p,...L]=n.split(a);if(p===".."||L.some(X=>c.test(X)))throw e(t,`Invalid "${F}" target "${n}" defined in the package config`);return[B?n.replace(/\*/g,B):n]}if(Array.isArray(n))return n.flatMap(p=>f(F,p,d,g,B));if(u(n)){for(const p of Object.keys(n)){if(i.test(p))throw e(o,"Cannot contain numeric property keys");if(p==="default"||g.includes(p))return f(F,n[p],d,g,B)}return[]}throw e(t,`Invalid "${F}" target "${n}"`)},E="*",$=(F,n)=>{const d=F.indexOf(E),g=n.indexOf(E);return d===g?n.length>F.length:g>d};function O(F,n){if(!n.includes(E)&&F.hasOwnProperty(n))return[n];let d,g;for(const B of Object.keys(F))if(B.includes(E)){const[p,L,X]=B.split(E);if(X===void 0&&n.startsWith(p)&&n.endsWith(L)){const Fu=n.slice(p.length,-L.length||void 0);Fu&&(!d||$(d,B))&&(d=B,g=Fu)}}return[d,g]}const C=F=>Object.keys(F).reduce((n,d)=>{const g=d===""||d[0]!==".";if(n===void 0||n===g)return g;throw e(o,'"exports" cannot contain some keys starting with "." and some not')},void 0),y=/^\w+:/,A=(F,n,d)=>{if(!F)throw new Error('"exports" is required');n=n===""?".":`./${n}`,(typeof F=="string"||Array.isArray(F)||u(F)&&C(F))&&(F={".":F});const[g,B]=O(F,n),p=f(l.Export,F[g],n,d,B);if(p.length===0)throw e(r,n==="."?'No "exports" main defined':`Package subpath '${n}' is not defined by "exports"`);for(const L of p)if(!L.startsWith("./")&&!y.test(L))throw e(t,`Invalid "exports" target "${L}" defined in the package config`);return p},w=(F,n,d)=>{if(!F)throw new Error('"imports" is required');const[g,B]=O(F,n),p=f(l.Import,F[g],n,d,B);if(p.length===0)throw e(D,`Package import specifier "${n}" is not defined in package`);return p};return su.resolveExports=A,su.resolveImports=w,su}var ct=Dt();const at=Z(import.meta.url),nu=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ae=u=>{if(typeof nu<"u"&&nu.versions&&nu.versions.node){const[e,o]=nu.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return nu.getBuiltinModule(u)}return at(u)},{statSync:Eu}=ae("node:fs"),lt=ae("node:module"),le=(u=process.cwd())=>{const{findPnpApi:e}=lt;return e?e(u):void 0},Ct=u=>bu(z(u,{buffer:!1})),xu=(u,e,o,t)=>{const r=`resolveFromPackageJsonPath:${u}:${e}:${o?"yes":"no"}`;if(t?.has(r))return t.get(r);const D=Ct(u);if(!D)return;let i=e||"tsconfig.json";if(!o&&D.exports)try{const[c]=ct.resolveExports(D.exports,e,["require","types"]);i=c}catch{return!1}else!e&&D.tsconfig&&(i=D.tsconfig);return i=I(u,"..",i),t?.set(r,i),i},$u="package.json",Tu="tsconfig.json",Ft=(u,e,o)=>{let t=u;if(u===".."&&(t=I(t,Tu)),u.startsWith(".")&&(t=R(e,t)),Mu(t)){if(_(t)){if(Eu(t).isFile())return t}else if(!t.endsWith(".json")){const O=`${t}.json`;if(_(O))return O}return}const[r="",...D]=u.split("/"),i=r.startsWith("@")?`${r}/${String(D.shift())}`:r,c=D.join("/"),a=le(e);if(a){const{resolveRequest:O}=a;try{if(i===u){const C=O(I(i,$u),e);if(C){const y=xu(C,c,!1,o);if(y&&_(y))return y}}else{let C;try{C=O(u,e,{extensions:[".json"]})}catch{C=O(I(u,Tu),e)}if(C)return C}}catch{}}const l=hu(O=>{const C=I(R(O),"node_modules",i);if(_(C))return I("node_modules",i)},{cwd:e,type:"directory"});if(!l||!Eu(l).isDirectory())return;const f=I(l,$u);if(_(f)){const O=xu(f,c,!1,o);if(O===!1)return;if(O&&_(O)&&Eu(O).isFile())return O}const E=I(l,c),$=E.endsWith(".json");if(!$){const O=`${E}.json`;if(_(O))return O}if(_(E)){if(Eu(E).isDirectory()){const O=I(E,$u);if(_(O)){const y=xu(O,"",!0,o);if(y&&_(y))return y}const C=I(E,Tu);if(_(C))return C}else if($)return E}},pt=u=>{const e=R(u);let o;const t=le(e);if(t)try{o=t.resolveRequest("typescript/package.json",e)??void 0}catch{}if(o??=hu(r=>I(r,"node_modules","typescript","package.json"),{cwd:e,type:"file"}),!!o)try{const r=bu(z(o,{buffer:!1}));if(typeof r?.version=="string")return r.version}catch{}},ft=new Set(["node16","node18","node20","nodenext"]),Ce=u=>u!==void 0&&ft.has(u),At=(u,e)=>{!e.has("target")&&!Ce(u.module)&&(u.target="es3")},Et=(u,e)=>{!e.has("target")&&!Ce(u.module)&&(u.target="es5")},dt=(u,e)=>{e.has("strict")||(u.strict=!0),e.has("target")||(u.target="es2025"),e.has("module")||(u.module="es2022"),e.has("moduleResolution")||(u.moduleResolution="bundler"),e.has("rootDir")||(u.rootDir="."),e.has("types")||(u.types=[]),e.has("noUncheckedSideEffectImports")||(u.noUncheckedSideEffectImports=!0),e.has("libReplacement")||(u.libReplacement=!1),e.has("alwaysStrict")||(u.alwaysStrict=!0)},mt=[[4,At],[5,Et],[6,dt]],Bt=/^v?(\d+)/,ht=u=>{const e=Bt.exec(u);return e?Number(e[1]):void 0},gt=(u,e)=>{const o=ht(e);if(o===void 0)return;const t=new Set(Object.keys(u));for(const[r,D]of mt)r<=o&&D(u,t)},yt=u=>bu(z(u,{buffer:!1})),bt=u=>u.replaceAll("\\","/"),lu=u=>{const e=$e(u);return Te(e)?e:`./${e}`},Ru=["files","include","exclude"],ue=(u,e,o)=>{const t=I(e,o),r=Cu(u,t);return Bu(r)||"./"},Ot=(u,e,o)=>{const t=Cu(u,e);if(!t)return o;const r=o.startsWith("./")?o.slice(2):o;return`${t}/${r}`},vt=(u,e,o,t,r)=>{if(o.has(u))throw new Error(`Circularity detected while resolving configuration: ${u}`);o.add(u);const D=K(u),i=Fe(u,t,o,r);delete i.references;const{compilerOptions:c}=i;if(c){const{baseUrl:a}=c;a&&!a.startsWith(j)&&(c.baseUrl=ue(e,D,a));const{outDir:l}=c;l&&!l.startsWith(j)&&(c.outDir=ue(e,D,l))}for(const a of Ru){const l=i[a];l&&(i[a]=l.map(f=>f.startsWith(j)||Mu(f)?f:Ot(e,D,f)))}return i},Fe=(u,e,o=new Set,t=new Map)=>{let r;try{r=yt(u)??{}}catch(i){throw new Error(`Cannot resolve tsconfig at path: ${u}`,{cause:i})}if(typeof r!="object")throw new SyntaxError(`Failed to parse tsconfig at: ${u}`);const D=K(u);if(r.compilerOptions){const{compilerOptions:i}=r;i.paths&&!i.baseUrl&&(i[pe]=D)}if(r.extends){const i=Array.isArray(r.extends)?r.extends:[r.extends];delete r.extends;const c=i.toReversed();for(let a=0;a<c.length;a++){const l=c[a],f=Ft(l,D,t);if(!f)throw new se(`No such file or directory, for '${l}' found.`);const E=vt(f,D,new Set(o),e,t);E.compilerOptions?.rootDir!==void 0&&!E.compilerOptions.rootDir.startsWith(j)&&(E.compilerOptions.rootDir=I(K(f),E.compilerOptions.rootDir));const $={...E,...r,compilerOptions:{...E.compilerOptions,...r.compilerOptions}};E.watchOptions&&($.watchOptions={...E.watchOptions,...r.watchOptions}),r=$}}if(r.compilerOptions){const{compilerOptions:i}=r;for(const c of["baseUrl","rootDir"]){const a=i[c];if(a&&!a.startsWith(j)){const l=R(D,a);i[c]=lu(Cu(D,l))}}for(const c of["outDir","declarationDir"]){let a=i[c];a&&(Array.isArray(r.exclude)||(r.exclude=["outDir","declarationDir"].map(l=>{const f=i[l];if(f)return f.startsWith(j)||Mu(f)?f:I(D,f)}).filter(Boolean)),a.startsWith(j)||(a=lu(a)),i[c]=a)}}else r.compilerOptions={};if(r.include&&(r.include=r.include.map(i=>bt(i))),r.files&&(r.files=r.files.map(i=>i.startsWith(j)?i:lu(i))),r.watchOptions){const{watchOptions:i}=r;i.excludeDirectories&&(i.excludeDirectories=i.excludeDirectories.map(c=>Bu(R(D,c)))),i.excludeFiles&&(i.excludeFiles=i.excludeFiles.map(c=>Bu(R(D,c)))),i.watchFile&&(i.watchFile=i.watchFile.toLowerCase()),i.watchDirectory&&(i.watchDirectory=i.watchDirectory.toLowerCase()),i.fallbackPolling&&(i.fallbackPolling=i.fallbackPolling.toLowerCase())}if(r.compilerOptions.lib&&(r.compilerOptions.lib=r.compilerOptions.lib.map(i=>i.toLowerCase())),r.compilerOptions.module){let i=r.compilerOptions.module.toLowerCase();i==="es2015"&&(i="es6"),r.compilerOptions.module=i}if(r.compilerOptions.target){let i=r.compilerOptions.target.toLowerCase();i==="es2015"&&(i="es6"),r.compilerOptions.target=i}if(r.compilerOptions.moduleResolution){let i=r.compilerOptions.moduleResolution.toLowerCase();i==="node"&&(i="node10"),r.compilerOptions.moduleResolution=i}return r.compilerOptions.jsx&&(r.compilerOptions.jsx=r.compilerOptions.jsx.toLowerCase()),r.compilerOptions.moduleDetection&&(r.compilerOptions.moduleDetection=r.compilerOptions.moduleDetection.toLowerCase()),r.compilerOptions.importsNotUsedAsValues&&(r.compilerOptions.importsNotUsedAsValues=r.compilerOptions.importsNotUsedAsValues.toLowerCase()),r.compilerOptions.newLine&&(r.compilerOptions.newLine=r.compilerOptions.newLine.toLowerCase()),r},du=(u,e)=>{if(u.startsWith(j))return Bu(I(e,u.slice(j.length)))},wt=["outDir","declarationDir","outFile","rootDir","baseUrl","tsBuildInfoFile"],Su=u=>u==="es2022"||u==="es2023"||u==="es2024"||u==="es2025"||u==="esnext",kt=(u,e)=>{if(u.compilerOptions===void 0)return u;if(u.compilerOptions.rewriteRelativeImportExtensions&&(u.compilerOptions.allowImportingTsExtensions??=!0),u.compilerOptions.composite&&(u.compilerOptions.declaration??=!0,u.compilerOptions.incremental??=!0),u.compilerOptions.checkJs&&(u.compilerOptions.allowJs??=!0),u.compilerOptions.verbatimModuleSyntax&&(u.compilerOptions.isolatedModules??=!0,u.compilerOptions.preserveConstEnums??=!0),["5.4","5.5","5.6","5.7","5.8","5.9","true"].includes(String(e?.tscCompatible))){if(u.compilerOptions.esModuleInterop===void 0&&(u.compilerOptions.module==="node16"||u.compilerOptions.module==="node18"||u.compilerOptions.module==="node20"||u.compilerOptions.module==="nodenext"||u.compilerOptions.module==="preserve")&&(u.compilerOptions.esModuleInterop=!0),u.compilerOptions.moduleDetection===void 0&&u.compilerOptions.module&&["node16","node18","node20","nodenext"].includes(u.compilerOptions.module)&&(u.compilerOptions.moduleDetection="force"),u.compilerOptions.moduleResolution===void 0){let o="classic";if(u.compilerOptions.module!==void 0)switch(u.compilerOptions.module.toLocaleLowerCase()){case"commonjs":{o="node10";break}case"node16":case"node18":{o="node16";break}case"node20":{o="node16";break}case"nodenext":{o="nodenext";break}case"preserve":{o="bundler";break}}o!=="classic"&&(u.compilerOptions.moduleResolution=o)}if(u.compilerOptions.moduleResolution==="bundler"&&(u.compilerOptions.resolveJsonModule??=!0),u.compilerOptions.module&&["node20","nodenext"].includes(u.compilerOptions.module)&&(u.compilerOptions.resolveJsonModule??=!0),(u.compilerOptions.esModuleInterop||u.compilerOptions.module==="system"||u.compilerOptions.moduleResolution==="bundler")&&u.compilerOptions.allowSyntheticDefaultImports===void 0&&(u.compilerOptions.allowSyntheticDefaultImports=!0),["5.7","5.8","5.9","true"].includes(String(e?.tscCompatible))&&u.compilerOptions.moduleResolution){let o=!1;["bundler","node16","nodenext"].includes(u.compilerOptions.moduleResolution.toLocaleLowerCase())&&(o=!0),u.compilerOptions.resolvePackageJsonExports===void 0&&o&&(u.compilerOptions.resolvePackageJsonExports=!0),u.compilerOptions.resolvePackageJsonImports===void 0&&o&&(u.compilerOptions.resolvePackageJsonImports=!0)}if(u.compilerOptions.target===void 0){let o="es5";switch(u.compilerOptions.module){case"node16":case"node18":{o="es2022";break}case"node20":{o="es2023";break}case"nodenext":{o="esnext";break}}o!=="es5"&&(u.compilerOptions.target=o)}u.compilerOptions.useDefineForClassFields===void 0&&u.compilerOptions.target&&Su(u.compilerOptions.target)&&(u.compilerOptions.useDefineForClassFields=!0)}if(["5.6","5.7","5.8","5.9","true"].includes(String(e?.tscCompatible))&&u.compilerOptions.strict&&u.compilerOptions.strictBuiltinIteratorReturn===void 0&&(u.compilerOptions.strictBuiltinIteratorReturn=!0),["5.4","5.5","5.6","5.7","5.8","5.9","true"].includes(String(e?.tscCompatible))&&(u.compilerOptions.strict&&(u.compilerOptions.noImplicitAny=u.compilerOptions.noImplicitAny??!0,u.compilerOptions.noImplicitThis=u.compilerOptions.noImplicitThis??!0,u.compilerOptions.strictNullChecks=u.compilerOptions.strictNullChecks??!0,u.compilerOptions.strictFunctionTypes=u.compilerOptions.strictFunctionTypes??!0,u.compilerOptions.strictBindCallApply=u.compilerOptions.strictBindCallApply??!0,u.compilerOptions.strictPropertyInitialization=u.compilerOptions.strictPropertyInitialization??!0,u.compilerOptions.alwaysStrict=u.compilerOptions.alwaysStrict??!0),u.compilerOptions.useDefineForClassFields===void 0&&u.compilerOptions.target&&Su(u.compilerOptions.target)&&(u.compilerOptions.useDefineForClassFields=!0),u.compilerOptions.strict&&u.compilerOptions.useUnknownInCatchVariables===void 0&&(u.compilerOptions.useUnknownInCatchVariables=!0),u.compilerOptions.isolatedModules&&(u.compilerOptions.preserveConstEnums=u.compilerOptions.preserveConstEnums??!0)),String(e?.tscCompatible)==="6.0"){if(u.compilerOptions.moduleDetection===void 0&&u.compilerOptions.module&&["node16","node18","node20","nodenext"].includes(u.compilerOptions.module)&&(u.compilerOptions.moduleDetection="force"),u.compilerOptions.moduleResolution===void 0&&u.compilerOptions.module){const o=u.compilerOptions.module.toLocaleLowerCase();o==="node16"||o==="node18"||o==="node20"?u.compilerOptions.moduleResolution="node16":o==="nodenext"&&(u.compilerOptions.moduleResolution="nodenext")}if(u.compilerOptions.useDefineForClassFields===void 0&&u.compilerOptions.module&&["node16","node18","node20","nodenext"].includes(u.compilerOptions.module)&&u.compilerOptions.target&&!Su(u.compilerOptions.target)&&(u.compilerOptions.useDefineForClassFields=!1),u.compilerOptions.isolatedModules&&u.compilerOptions.preserveConstEnums===void 0&&(u.compilerOptions.preserveConstEnums=!0),u.compilerOptions.resolveJsonModule===void 0){const o=u.compilerOptions.module,t=u.compilerOptions.moduleResolution?.toLocaleLowerCase();!(o!==void 0&&["node20","nodenext"].includes(o)||t==="bundler")&&t&&(u.compilerOptions.resolveJsonModule=!1)}if(u.compilerOptions.moduleResolution){const o=u.compilerOptions.moduleResolution.toLocaleLowerCase();["bundler","node16","nodenext"].includes(o)||(u.compilerOptions.resolvePackageJsonExports??=!1,u.compilerOptions.resolvePackageJsonImports??=!1)}}return u.compileOnSave===!1&&delete u.compileOnSave,u},xt=(u,e)=>{const o=u?.typescriptVersion;if(!(o===!1||o===void 0))return o==="auto"?pt(e):o},j="${configDir}",pe=Symbol("implicitBaseUrl"),$t=(u,e)=>{const o=R(u),t=Fe(o,e),r=K(o),D=xt(e,r);D&&t.compilerOptions&>(t.compilerOptions,D);const{compilerOptions:i}=t;if(i){for(const a of wt){const l=i[a];if(l){const f=du(l,r);i[a]=f?lu(Cu(r,f)):l}}for(const a of["rootDirs","typeRoots"]){const l=i[a];l&&(i[a]=l.map(f=>{const E=du(f,r);return E?lu(Cu(r,E)):f}))}const{paths:c}=i;if(c){const a=Object.keys(c);for(let l=0;l<a.length;l++){const f=a[l];c[f]=c[f].map(E=>du(E,r)??E)}}}for(let c=0;c<Ru.length;c++){const a=Ru[c],l=t[a];l&&(t[a]=l.map(f=>du(f,r)??f))}return kt(t,e)},Tt=Z(import.meta.url),Du=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,St=u=>{if(typeof Du<"u"&&Du.versions&&Du.versions.node){const[e,o]=Du.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return Du.getBuiltinModule(u)}return Tt(u)},{statSync:Nt}=St("node:fs"),It=new Map,Pt="tsconfig.json",jt=(u,e)=>{let o=0;try{o=Nt(u).mtimeMs}catch{}return`${u}::${String(e.tscCompatible)}::${String(e.typescriptVersion)}::${String(o)}`},Lt=(u,e={})=>{const o=e.configFileName??Pt,t=e.configFileName===void 0;let r=hu(o,{...u&&{cwd:u},type:"file"});if(!r&&t&&(r=hu("jsconfig.json",{...u&&{cwd:u},type:"file"})),!r)throw new se(t?`No such file or directory, for '${o}' or 'jsconfig.json' found.`:`No such file or directory, for '${o}' found.`);const D=e.cache&&typeof e.cache!="boolean"?e.cache:It,i=jt(r,e);if(e.cache&&D.has(i))return D.get(i);const c={config:$t(r,{tscCompatible:e.tscCompatible,typescriptVersion:e.typescriptVersion}),path:r};return e.cache&&D.set(i,c),c},_t=/\.[cm]?tsx?$/,Rt=[".yaml",".yml",".toml",".jsonc",".json5",".txt"],fe=/\.(?:ya?ml|toml|jsonc|json5|txt)$/,Ut=u=>u.endsWith(".yaml")||u.endsWith(".yml")?nt(u):u.endsWith(".toml")?st(u):u.endsWith(".jsonc")?et(u,{allowTrailingComma:!0}):u.endsWith(".json5")?qe(u):Vu(u,"utf8"),Uu=u=>u===void 0?"undefined":u===null?"null":typeof u=="number"?Number.isNaN(u)?"NaN":u===Number.POSITIVE_INFINITY?"Infinity":u===Number.NEGATIVE_INFINITY?"-Infinity":String(u):typeof u=="bigint"?`${u}n`:typeof u=="boolean"?String(u):typeof u=="string"?JSON.stringify(u):u instanceof Date?`new Date(${JSON.stringify(u.toISOString())})`:Array.isArray(u)?`[${u.map(e=>Uu(e)).join(",")}]`:typeof u=="object"?`{${Object.entries(u).map(([e,o])=>`${JSON.stringify(e)}:${Uu(o)}`).join(",")}}`:"null",Nu=new Map,Wt=(u,e)=>u.startsWith(j)?I(e,u.slice(j.length)):u,Vt=u=>{if(Nu.has(u))return Nu.get(u);let e;try{const{config:o,path:t}=Lt(u,{cache:!1}),r=K(t),D=o.compilerOptions,i=D?.paths??{};if(D!==void 0){const{baseUrl:c}=D;let a,l=!1;if(c===void 0){const f=D[pe];a=typeof f=="string"?f:r}else l=!0,a=R(r,Wt(c,r));e={hasBaseUrl:l,paths:i,pathsBase:a}}}catch{e=void 0}return Nu.set(u,e),e},Ae=(u,e)=>{const o=Vt(e);if(o===void 0)return;const{hasBaseUrl:t,pathsBase:r}=o,D=i=>Ee(i)??de(i);for(const[i,c]of Object.entries(o.paths)){const a=i.indexOf("*");if(a===-1){if(i===u)for(const E of c){const $=D(R(r,E));if($!==void 0)return $}continue}const l=i.slice(0,a),f=i.slice(a+1);if(u.startsWith(l)&&u.endsWith(f)&&u.length>=l.length+f.length){const E=u.slice(l.length,u.length-f.length);for(const $ of c){const O=$.replace("*",E),C=D(R(r,O));if(C!==void 0)return C}}}if(t){const i=D(R(r,u));if(i!==void 0)return i}};let ee=!1,Iu=0,te=!1,re=!1;const Mt=()=>{re||(re=!0,process.setSourceMapsEnabled?.(!0))},Jt=u=>{const e=u.indexOf("?");return e===-1?u:u.slice(0,e)},qt=u=>u.endsWith(".cts")?"commonjs":"module",oe=[".ts",".tsx",".mts",".cts",".js",".mjs",".cjs",".json"],Y=u=>{try{return ie(u).isFile()}catch{return!1}},Ht=u=>{try{return ie(u).isDirectory()}catch{return!1}},Kt=u=>{if(u.endsWith(".js"))return`${u.slice(0,-3)}.ts`;if(u.endsWith(".mjs"))return`${u.slice(0,-4)}.mts`;if(u.endsWith(".cjs"))return`${u.slice(0,-4)}.cts`},Ee=u=>{if(Y(u))return u;const e=Kt(u);if(e!==void 0&&Y(e))return e;for(const o of oe)if(Y(u+o))return u+o;if(Ht(u))for(const o of oe){const t=`${u}/index${o}`;if(Y(t))return t}},de=u=>{if(Y(u)&&fe.test(u))return u;for(const e of Rt)if(Y(u+e))return u+e},me=()=>{Mt();const{registerHooks:u}=Pu;return typeof u!="function"?!1:(ee||(u({load(e,o,t){const r=Jt(e);if(r.startsWith("file:")&&_t.test(r)){const D=fu(r),{code:i}=ne(D,Vu(D,"utf8"));return{format:qt(D),shortCircuit:!0,source:i}}if(r.startsWith("file:")&&fe.test(r)){const D=fu(r),i=Ut(D);return{format:"module",shortCircuit:!0,source:`export default ${Uu(i)};
|
|
21
|
+
`}}return t(e,o)},resolve(e,o,t){if((e.startsWith(".")||e.startsWith("/"))&&o.parentURL!==void 0){let r;try{r=new URL(e,o.parentURL)}catch{r=void 0}if(r?.protocol==="file:"){const D=fu(r),i=Ee(D)??de(D);if(i!==void 0)return{shortCircuit:!0,url:mu(i).href}}}if(o.parentURL!==void 0&&!e.startsWith(".")&&!e.startsWith("/")&&!e.startsWith("#")&&!e.startsWith("node:")&&!Pu.isBuiltin?.(e)){let r;try{r=K(fu(o.parentURL))}catch{r=void 0}if(r!==void 0){const D=Ae(e,r);if(D!==void 0)return{shortCircuit:!0,url:mu(D).href}}}return t(e,o)}}),ee=!0),!0)},zt=()=>me(),Gt=async u=>{if(Iu+=1,me())return await import(`${mu(u).href}?v=${String(Iu)}`);te||(te=!0,process.stderr.write(`vis: Node < 22.15 has no module.registerHooks — only the entry file is transpiled; local TypeScript imports won't load. Upgrade to Node >= 22.15 for full support.
|
|
22
|
+
`));const{code:e}=ne(u,Vu(u,"utf8")),o=I(K(u),`.vis-ts-${String(Iu)}-${String(process.pid)}.mjs`);be(o,e);try{return await import(mu(o).href)}finally{try{Oe(o)}catch{}}},er=Object.defineProperty({__proto__:null,importTs:Gt,registerTsHooks:zt,resolveTsConfigPaths:Ae},Symbol.toStringTag,{value:"Module"});export{Gt as i,st as m,zt as r,er as t,nt as u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{D as b,p}from"./cli-main.js";import{w}from"../packem_shared/pm-runner-
|
|
1
|
+
import{D as b,p}from"./cli-main.js";import{w}from"../packem_shared/pm-runner-D4jM58Oz.js";import{r as y,l as $,L as v}from"../packem_shared/dependency-scan-DpOFiZuI.js";import{v as C,m,f as S}from"../packem_shared/index-CE6MsgcV.js";import"../packem_shared/public-api-WqUCiyIe.js";import{e as x}from"../packem_shared/index-CQjzW7m8.js";const M=e=>{const s=e.trim();return s===""?!1:/^(?:git\+|git:\/\/|git@|ssh:\/\/)/i.test(s)||/^(?:github|gitlab|bitbucket|gist):/i.test(s)||/^[\w.-]+\/[\w.-]+(?:#.+)?$/.test(s)&&!s.includes("@")?!0:/^https?:\/\//i.test(s)},L=(e,s)=>{for(const t of s)if(t===e||t.endsWith("*")&&e.startsWith(t.slice(0,-1)))return!0;return!1},D=(e,s,t={})=>{const o=y(e,s);if(!o)return[];let i;try{i=C(m(e,o.file))}catch{return[]}const n=b(i,o.type);if(n.length===0)return[];const c=t.allow??[],l=[],f=new Set;for(const r of n){const a=`${r.name}@${r.version}`;for(const d of[r.dependencies,r.optionalDependencies])if(d){for(const[u,h]of Object.entries(d))if(!L(u,c))for(const k of h){if(!M(k))continue;const g=`${a}->${u}@${k}`;f.has(g)||(f.add(g),l.push({declaredBy:a,packageName:u,source:k}))}}}return l.sort((r,a)=>r.packageName.localeCompare(a.packageName)||r.declaredBy.localeCompare(a.declaredBy))},E=new Set(["firstSeen","publisherChange"]),N=e=>e.severity==="block"&&e.acceptedRisk===void 0,R=e=>{const s=e.security?.policies?.firstSeen?.minutes,t=typeof s=="number"&&s>0,o=e.security?.policies?.publisherChange?.mode==="no-downgrade",i=e.security?.blockExoticSubdeps===!0;return t||o||i},V=async e=>{const{offline:s=!1,packageManager:t,visConfig:o,workspaceRoot:i}=e,n=Date.now();if(!R(o))return{decisions:[],durationMs:Date.now()-n,entryCount:0,exoticViolations:[],lockfileMissing:!1,status:"skipped"};const c=y(i,t);if(!c||!S(m(i,c.file)))return{decisions:[],durationMs:Date.now()-n,entryCount:0,exoticViolations:[],lockfileMissing:!0,status:"fail"};const l=$(i,t,{includeDev:!0}),f=l.length,r=await x({offline:s,packageManager:t,packages:l,workspaceRoot:i},"install",{enabledPolicies:new Set(E),visConfig:o}),a=o.security?.blockExoticSubdeps===!0?D(i,t,{allow:o.security.exoticSubdepsAllow}):[],d=r.some(u=>N(u))||a.length>0;return{decisions:r,durationMs:Date.now()-n,entryCount:f,exoticViolations:a,lockfileMissing:!1,status:d?"fail":"pass"}},B=e=>e<1e3?`${String(e)}ms`:`${(e/1e3).toFixed(1)}s`,P=e=>{if(e.status==="skipped")return["– Lockfile supply-chain verification skipped (no firstSeen / publisherChange / blockExoticSubdeps policy configured)"];if(e.lockfileMissing)return["✗ Lockfile supply-chain verification failed — no lockfile found, the resolved closure cannot be attested"];const s=`(${String(e.entryCount)} ${e.entryCount===1?"entry":"entries"}, ${B(e.durationMs)})`;if(e.status==="pass")return[`✓ Lockfile passes supply-chain policies ${s}`];const t=[`✗ Lockfile failed supply-chain policy check ${s}`];for(const o of e.decisions)o.severity==="block"&&o.acceptedRisk===void 0&&t.push(` [${o.policy}] ${o.reason}`);for(const o of e.exoticViolations)t.push(` [blockExoticSubdeps] ${o.packageName} pulled from exotic source by ${o.declaredBy}: ${o.source}`);return t},J=async({options:e,visConfig:s,workspaceRoot:t})=>{const o=t??process.cwd(),i=w(o);if(!v[i.name]){p.warn(`Package manager '${i.name}' has no lockfile vis can verify.`);return}const n=await V({offline:!!e.offline,packageManager:i.name,visConfig:s??{},workspaceRoot:o});if(e.json){process.stdout.write(`${JSON.stringify(n,void 0,2)}
|
|
2
2
|
`),n.status==="fail"&&(process.exitCode=1);return}const[c,...l]=P(n);if(n.status==="skipped"){p.info(c);return}if(n.status==="pass"){p.success(c);return}p.error(c);for(const f of l)p.error(f);process.exitCode=1};export{J as default};
|