@visulima/vis 1.0.0-alpha.14 → 1.0.0-alpha.15
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 +17 -0
- package/LICENSE.md +936 -1
- package/dist/bin.js +1 -1
- package/dist/config/index.js +1 -1
- package/dist/packem_chunks/applyDefaults.js +2 -2
- package/dist/packem_chunks/bin.js +314 -311
- package/dist/packem_chunks/fix.js +1 -1
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +1 -1
- package/dist/packem_chunks/handler12.js +5 -5
- package/dist/packem_chunks/handler14.js +3 -3
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler18.js +1 -1
- package/dist/packem_chunks/handler19.js +1 -1
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +1 -1
- package/dist/packem_chunks/handler22.js +1 -1
- package/dist/packem_chunks/handler23.js +1 -1
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler25.js +1 -1
- package/dist/packem_chunks/handler26.js +1 -1
- package/dist/packem_chunks/handler27.js +2 -2
- package/dist/packem_chunks/handler28.js +7 -7
- package/dist/packem_chunks/handler3.js +1 -1
- package/dist/packem_chunks/handler30.js +10 -10
- package/dist/packem_chunks/handler31.js +1 -1
- package/dist/packem_chunks/handler32.js +1 -1
- package/dist/packem_chunks/handler33.js +21 -21
- package/dist/packem_chunks/handler34.js +2 -2
- package/dist/packem_chunks/handler35.js +3 -3
- package/dist/packem_chunks/handler36.js +20 -20
- package/dist/packem_chunks/handler37.js +1 -1
- package/dist/packem_chunks/handler38.js +2 -2
- package/dist/packem_chunks/handler39.js +10 -10
- package/dist/packem_chunks/handler40.js +5 -5
- package/dist/packem_chunks/handler41.js +10 -24
- package/dist/packem_chunks/handler42.js +24 -10
- package/dist/packem_chunks/handler43.js +5 -5
- package/dist/packem_chunks/handler44.js +5 -5
- package/dist/packem_chunks/handler45.js +3 -3
- package/dist/packem_chunks/handler46.js +11 -11
- package/dist/packem_chunks/handler47.js +15 -15
- package/dist/packem_chunks/handler48.js +6 -6
- package/dist/packem_chunks/handler5.js +1 -1
- package/dist/packem_chunks/handler6.js +1 -1
- package/dist/packem_chunks/handler7.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/index.js +2 -2
- package/dist/packem_chunks/loader.js +1 -1
- package/dist/packem_chunks/tar.js +1 -1
- package/dist/packem_shared/{ai-analysis-Dzs_nUwM.js → ai-analysis-CGVjqwdc.js} +1 -1
- package/dist/packem_shared/ai-cache-BdPgSfg2.js +1 -0
- package/dist/packem_shared/{ai-fix-BmLM72GS.js → ai-fix-iHtGLkJS.js} +1 -1
- package/dist/packem_shared/cache-directory-DTfMSzT9.js +1 -0
- package/dist/packem_shared/dependency-scan-SQeRzrpJ.js +2 -0
- package/dist/packem_shared/docker-D5p9mRPU.js +2 -0
- package/dist/packem_shared/failure-log-CElcbnb9.js +2 -0
- package/dist/packem_shared/flakiness-C4t4_NoA.js +1 -0
- package/dist/packem_shared/{giget-BX2ixMoa.js → giget-CcEy_Elm.js} +2 -2
- package/dist/packem_shared/lockfile-B7JJzxnL.js +1 -0
- package/dist/packem_shared/otel-CO8UEfTa.js +17 -0
- package/dist/packem_shared/otelPlugin-DTynZDWh.js +1 -0
- package/dist/packem_shared/readTomlSync-1fKo0R52-DAKNI1Me.js +109 -0
- package/dist/packem_shared/registry-D04iOQ5H.js +2 -0
- package/dist/packem_shared/run-summary-utils-BPraMTcm.js +1 -0
- package/dist/packem_shared/{runtime-check-BaKni2y1.js → runtime-check-l4qFpo08.js} +1 -1
- package/dist/packem_shared/{selectors-BvtUXWGY.js → selectors-Sem2CTYA.js} +1 -1
- package/dist/packem_shared/{toolchain-B7sIiJxK.js → toolchain-BhZNts--.js} +3 -3
- package/dist/packem_shared/typosquats-Dr7VIL2B.js +1 -0
- package/dist/packem_shared/verify-C6NNOhTA.js +1 -0
- package/dist/packem_shared/{vis-update-app-DR8c4OfG.js → vis-update-app-DGiMc5kb.js} +1 -1
- package/package.json +10 -12
- package/dist/packem_shared/ai-cache-Dtvmbsru.js +0 -1
- package/dist/packem_shared/cache-directory-xASJia6M.js +0 -1
- package/dist/packem_shared/dependency-scan-DmwPKwLy.js +0 -2
- package/dist/packem_shared/docker-CA-scYu0.js +0 -2
- package/dist/packem_shared/failure-log-fD4DiFb1.js +0 -2
- package/dist/packem_shared/flakiness-BIg1rwvp.js +0 -1
- package/dist/packem_shared/index-OlP7U_t5.js +0 -6
- package/dist/packem_shared/lockfile-BXylopgH.js +0 -1
- package/dist/packem_shared/otelPlugin-y5hoCw4b.js +0 -1
- package/dist/packem_shared/registry-BHqKXiLb.js +0 -2
- package/dist/packem_shared/run-summary-utils-D39XBHWW.js +0 -1
- package/dist/packem_shared/typosquats-XkC1CnOa.js +0 -1
- package/dist/packem_shared/verify-BVTcVfoW.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Y=Object.defineProperty;var b=(c,o)=>Y(c,"name",{value:o,configurable:!0});import{A as D,O as G,W as J,p as f,U as V,f as W,R as Z,F as m,J as q,V as K,B as Q,H as j,g as X,G as _,s as ee}from"./bin.js";import{render as T,renderToString as te,Text as y}from"@visulima/tui";import a from"react";import{H as oe,e as re,Z as ne}from"../packem_shared/ai-analysis-
|
|
1
|
+
var Y=Object.defineProperty;var b=(c,o)=>Y(c,"name",{value:o,configurable:!0});import{A as D,O as G,W as J,p as f,U as V,f as W,R as Z,F as m,J as q,V as K,B as Q,H as j,g as X,G as _,s as ee}from"./bin.js";import{render as T,renderToString as te,Text as y}from"@visulima/tui";import a from"react";import{H as oe,e as re,Z as ne}from"../packem_shared/ai-analysis-CGVjqwdc.js";import{U as se,B as ie,T as U}from"../packem_shared/vis-update-app-DGiMc5kb.js";var ae=Object.defineProperty,ce=b((c,o)=>ae(c,"name",{value:o,configurable:!0}),"$");const ge=ce(async({argument:c,logger:o,options:e,visConfig:i,workspaceRoot:x})=>{if(!x)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");const d=x;if(e.securityConfig){const t=D(d);if(G(i??{},t.name),e.sync&&t.name==="pnpm"){const r=J(i??{});if(r.length>0){f.info(`
|
|
2
2
|
Settings that would sync to pnpm-workspace.yaml:`);for(const R of r)f.success(` ${R}`)}else f.info("No security settings to sync.")}else e.sync&&t.name!=="pnpm"&&(f.info(`--sync is only available for pnpm projects. Your project uses ${t.name}.`),f.info("vis enforces security settings at the vis layer for non-pnpm projects."));if(!e.security&&!c?.length)return}const{packageManager:N}=V(d),O=W(d),l=i?.update??{},w=Z(d,N,{dev:e.dev,includeInternal:e["include-internal"],peer:e.peer,prod:e.prod});if(w.size===0){o.info("No catalogs found.");return}const h=e.target??l.target??"latest";if(!["latest","minor","patch"].includes(h))throw new Error(`Invalid target "${h}". Use: latest, minor, or patch.`);const B={exclude:[...m(e.exclude),...m(l.exclude)],ignore:m(l.ignore),include:[...m(e.include),...m(l.include),...c],includeLocked:!!e.includeLocked,includePrerelease:e.prerelease||l.prerelease||!1,security:e.security!==!1,target:h};let C=0;for(const t of w.values())C+=t.size;const v=!!process.stdout.isTTY&&!ee;let u;const F=v?(t,r)=>{u?u.rerender(a.createElement(U,{current:t,total:r})):u=T(a.createElement(U,{current:t,total:r}),{interactive:!0,patchConsole:!1})}:(t,r)=>{o.info(`Checking ${String(t)}/${String(r)} dependencies...`)};v||o.info(`Checking ${String(C)} catalog dependencies against npm registry...
|
|
3
3
|
`);const z=q(i?.security?.socket),{failed:$,outdated:s}=await K(w,B,O,F,d,z,i?.security?.socket?.acceptedRisks);if(u&&(u.clear(),u.unmount()),$.length>0&&o.warn(`Failed to fetch: ${$.join(", ")}`),s.length===0){o.info("All catalog dependencies are up to date.");return}const k=e.format??l.format??"table",A=oe(e.aiType??"impact"),p=e.ai?await re(s,o,i?.ai,A):void 0;if(v&&k==="table"){const t=new se(s,p??null),r=i?.tui?.autoExit??!1,R=r===!0?3:typeof r=="number"?r:0;await T(a.createElement(ie,{autoExitSeconds:R,isDryRun:!0,store:t}),{alternateScreen:!0,exitOnCtrlC:!1,interactive:!0,patchConsole:!0}).waitUntilExit();const H=process.stdout.columns||80;process.stdout.write(`
|
|
4
4
|
`);for(const n of s){const I=n.vulnerabilities?.length||n.socketReport&&n.socketReport.alerts.length>0,E=!!n.acceptedRisk,L=I?E?"✓":"⚠":"✓",M=E?"gray":n.updateType==="major"?"red":n.updateType==="minor"?"yellow":"green",g=n.socketReport?.score.overall,P=g===void 0?"":` [${String(Math.round(g*100))}%]`,S=g===void 0?void 0:Q(g);process.stdout.write(`${te(a.createElement(y,null," ",a.createElement(y,{color:M},L),` ${n.packageName} ${n.currentRange} → ${n.newRange}`,a.createElement(y,{dimColor:!0},` ${n.updateType}`),S?a.createElement(y,{color:S},P):null),{columns:H})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var h=Object.defineProperty;var g=(r,n)=>h(r,"name",{value:n,configurable:!0});import{r as m}from"../packem_shared/toolchain-
|
|
1
|
+
var h=Object.defineProperty;var g=(r,n)=>h(r,"name",{value:n,configurable:!0});import{r as m}from"../packem_shared/toolchain-BhZNts--.js";var C=Object.defineProperty,a=g((r,n)=>C(r,"name",{value:n,configurable:!0}),"a");const u=a(()=>process.env.GITHUB_BASE_REF?{base:`origin/${process.env.GITHUB_BASE_REF}`,head:process.env.GITHUB_SHA??"HEAD"}:process.env.CI_MERGE_REQUEST_TARGET_BRANCH_NAME?{base:`origin/${process.env.CI_MERGE_REQUEST_TARGET_BRANCH_NAME}`,head:process.env.CI_COMMIT_SHA??"HEAD"}:process.env.BUILDKITE_PULL_REQUEST_BASE_BRANCH?{base:`origin/${process.env.BUILDKITE_PULL_REQUEST_BASE_BRANCH}`,head:process.env.BUILDKITE_COMMIT??"HEAD"}:process.env.CIRCLE_BRANCH&&process.env.CIRCLE_SHA1?{base:"origin/main",head:process.env.CIRCLE_SHA1}:{base:"origin/main",head:"HEAD"},"detectCiRefs"),A=a(async({argument:r,logger:n,options:e,runtime:s,visConfig:f,workspaceRoot:t})=>{const p=r[0];if(!p)throw new Error("Missing targets. Usage: vis ci <target>[,<target>…]");const l=p.split(",").map(o=>o.trim()).filter(Boolean);if(l.length===0)throw new Error("Missing targets. Usage: vis ci <target>[,<target>…]");if(!t)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");const{base:_,head:d}=u(),c=e.base??_,E=e.head??d;e.skipToolchain||n.info("▸ Toolchain pre-flight"),await m(t,f?.toolchain,{error:a(o=>{n.error(o)},"error"),info:a(o=>{n.info(o)},"info"),warn:a(o=>{n.warn(o)},"warn")},!!e.skipToolchain),e.install===!1?n.info("▸ Skipping install (--no-install)"):(n.info("▸ Installing dependencies"),await s.runCommand("install",{argv:["--frozen-lockfile"]}));for(const o of l){n.info(`▸ Running affected ${o} (base=${c}, head=${E})`);const i=[o,`--base=${c}`,`--head=${E}`,`--upstream=${String(e.upstream??"none")}`,`--downstream=${String(e.downstream??"deep")}`];e.parallel!==void 0&&i.push(`--parallel=${String(e.parallel)}`),e.partition&&i.push(`--partition=${String(e.partition)}`),e.query&&i.push(`--query=${String(e.query)}`),await s.runCommand("affected",{argv:i})}n.info("▸ CI pipeline complete")},"execute");export{A as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var m=Object.defineProperty;var d=(s,o)=>m(s,"name",{value:o,configurable:!0});import{createRequire as p}from"node:module";import{
|
|
1
|
+
var m=Object.defineProperty;var d=(s,o)=>m(s,"name",{value:o,configurable:!0});import{createRequire as p}from"node:module";import{M as a,i as k}from"../packem_shared/otel-CO8UEfTa.js";import{cleanWorkspace as b}from"#native";import{p as c}from"./bin.js";import{f as $}from"../packem_shared/utils-DrNg0XTR.js";const g=p(import.meta.url),f=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=d(s=>{if(typeof f<"u"&&f.versions&&f.versions.node){const[o,n]=f.versions.node.split(".").map(Number);if(o>22||o===22&&n>=3||o===20&&n>=16)return f.getBuiltinModule(s)}return g(s)},"__cjs_getBuiltinModule"),{readdirSync:v,lstatSync:y,unlinkSync:_}=h("node:fs");var R=Object.defineProperty,u=d((s,o)=>R(s,"name",{value:o,configurable:!0}),"f");const j=u(s=>{const o=[],n=[s];for(;n.length>0;){const t=n.pop();let i;try{i=v(t)}catch{continue}for(const r of i){const e=a(t,r);try{const l=y(e);if(l.isSymbolicLink()||!l.isDirectory())continue}catch{continue}r==="node_modules"?o.push(e):r!==".git"&&r!==".hg"&&n.push(e)}}return o},"findNodeModulesDirectories"),M=["pnpm-lock.yaml","package-lock.json","npm-shrinkwrap.json","yarn.lock","bun.lock","bun.lockb"],x=u((s,o,n)=>{let t=0,i=!1;for(const r of M){const e=a(s,r);if(k(e)){if(o){n.info(` ${e}`),t++;continue}try{_(e),c.success(`Removed ${e}`),t++}catch(l){c.error(`${e}: ${$(l)}`),i=!0}}}return{hadError:i,removed:t}},"removeLockfiles"),C=u(async({logger:s,options:o,workspaceRoot:n})=>{const t=n??process.cwd(),i=o.lockfile||!1;if(o.dryRun){const e=j(t);if(e.length>0){c.info("Would remove:");for(const l of e)s.info(` ${l}`)}else c.info("No node_modules directories found.");i&&x(t,!0,s);return}const r=b(t,i);for(const e of r.removed)c.success(`Removed ${e}`);for(const e of r.lockfilesRemoved)c.success(`Removed ${e}`);for(const e of r.errors)c.error(e);r.removed.length===0&&r.lockfilesRemoved.length===0?c.info("No node_modules directories found."):c.info(`Cleaned ${r.removed.length} node_modules director${r.removed.length===1?"y":"ies"}`),r.errors.length>0&&(process.exitCode=1)},"execute");export{C as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var H=Object.defineProperty;var I=(e,t)=>H(e,"name",{value:t,configurable:!0});import{createRequire as U}from"node:module";import{C as O,z as F}from"../packem_shared/
|
|
1
|
+
var H=Object.defineProperty;var I=(e,t)=>H(e,"name",{value:t,configurable:!0});import{createRequire as U}from"node:module";import{C as O,z as F}from"../packem_shared/otel-CO8UEfTa.js";import{d as D,P as K,R as S,w as j,p as V}from"./heal.js";import{A as q,a3 as Y,p as a}from"./bin.js";const P=U(import.meta.url),T=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,A=I(e=>{if(typeof T<"u"&&T.versions&&T.versions.node){const[t,o]=T.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return T.getBuiltinModule(e)}return P(e)},"__cjs_getBuiltinModule"),{readFile:B}=A("node:fs/promises"),{createInterface:M}=A("node:readline");var J=Object.defineProperty,k=I((e,t)=>J(e,"name",{value:t,configurable:!0}),"o");const z=k(()=>!!process.stdout.isTTY&&process.env.CI!=="true","isInteractive"),W=k(e=>new Promise(t=>{const o=M({input:process.stdin,output:process.stderr});o.question(`${e} (Y/n) `,i=>{o.close();const s=i.trim().toLowerCase();t(s===""||s==="y"||s==="yes")})}),"defaultPrompt"),X=k((e,t)=>{const o=q(t),i=Y(o,{exact:!1,filter:[],global:!1,optional:!1,packages:[e],peer:!1,saveDev:!1,workspace:!1,workspaceRoot:!1},t,console);return Promise.resolve({exitCode:i})},"defaultRunInstall"),y=k(e=>`pnpm add ${e}`,"installCommandFor"),Q=k(e=>e==="@gitbeaker/rest"?import("@gitbeaker/rest"):import("@octokit/rest"),"defaultImport"),L=k(async(e,t={})=>{const o=t.interactive??z(),i=t.prompt??W,s=t.runInstall??X,l=t.importImpl??Q,d=t.workspaceRoot??process.cwd();try{return await l(e)}catch(n){const{code:u}=n;if(u!=="ERR_MODULE_NOT_FOUND"&&u!=="MODULE_NOT_FOUND")throw n}if(!o)throw new Error(`${e} is not installed. \`vis ai heal accept\` needs it to talk to the host. Install it in your repo first:
|
|
2
2
|
${y(e)}`);if(!await i(`${e} isn't installed. Install it now?`))throw new Error(`${e} install declined. Re-run \`vis ai heal accept\` after installing manually:
|
|
3
3
|
${y(e)}`);const r=await s(e,d);if(r.exitCode!==0)throw new Error(`Install of ${e} failed (exit ${String(r.exitCode)}). Install manually and retry:
|
|
4
4
|
${y(e)}`);return await l(e)},"loadOptionalSdk");var Z=Object.defineProperty,_=I((e,t)=>Z(e,"name",{value:t,configurable:!0}),"s");const ee=_(e=>{const t=e.indexOf("/");if(t<=0||t===e.length-1)throw new Error(`Expected GITHUB_REPOSITORY in "owner/repo" form, got: ${e}`);return{owner:e.slice(0,t),repo:e.slice(t+1)}},"splitGithubRepo"),te=_(async(e,t)=>{if(t.githubClient)return t.githubClient;const o=(await(t.loadSdk??L)("@octokit/rest")).Octokit;if(!o)throw new TypeError("Loaded `@octokit/rest` but no `Octokit` export was found. Reinstall the package or pin to a supported major.");return new o({auth:e})},"loadGithubClient"),oe=_(async(e,t,o)=>{if(o.gitlabClient)return o.gitlabClient;const i=(await(o.loadSdk??L)("@gitbeaker/rest")).Gitlab;if(!i)throw new TypeError("Loaded `@gitbeaker/rest` but no `Gitlab` export was found. Reinstall the package or pin to a supported major.");return new i({host:t,token:e})},"loadGitlabClient"),re=_(e=>e.replace(/\/api\/v\d+\/?$/,""),"apiBaseToHost"),ie=_(async e=>{const{branch:t,ciContext:o,files:i,message:s,workspaceRoot:l}=e,d=e.readFile??(w=>B(w,"utf8"));if(!o.repo)throw new Error("Cannot commit on GitHub: GITHUB_REPOSITORY (owner/repo) is not set.");if(!o.token)throw new Error("Cannot commit on GitHub: GITHUB_TOKEN is not set. Grant the workflow `contents: write` and pass the token through.");const{owner:r,repo:n}=ee(o.repo),u=await te(o.token,e),p=(await u.rest.git.getRef({owner:r,ref:`heads/${t}`,repo:n})).data.object.sha,h=(await u.rest.git.getCommit({commit_sha:p,owner:r,repo:n})).data.tree.sha,m=await Promise.all(i.map(async w=>{const v=O(l,w),E=await d(v),C=await u.rest.git.createBlob({content:Buffer.from(E,"utf8").toString("base64"),encoding:"base64",owner:r,repo:n});return{mode:"100644",path:w,sha:C.data.sha,type:"blob"}})),f=await u.rest.git.createTree({base_tree:h,owner:r,repo:n,tree:m}),b=await u.rest.git.createCommit({message:s,owner:r,parents:[p],repo:n,tree:f.data.sha});return await u.rest.git.updateRef({owner:r,ref:`heads/${t}`,repo:n,sha:b.data.sha}),{sha:b.data.sha,url:b.data.html_url}},"commitToGithub"),ae=_(async e=>{const{branch:t,ciContext:o,files:i,message:s,workspaceRoot:l}=e,d=e.readFile??(m=>B(m,"utf8"));if(!o.repo)throw new Error("Cannot commit on GitLab: CI_PROJECT_ID / CI_PROJECT_PATH is not set.");if(!o.token)throw new Error("Cannot commit on GitLab: no token. CI_JOB_TOKEN cannot push commits — set GITLAB_TOKEN to a PAT/project-token with `api` scope.");if(!o.apiBaseUrl)throw new Error("Cannot commit on GitLab: CI_API_V4_URL is not set.");const r=re(o.apiBaseUrl),n=await oe(o.token,r,e),u=await Promise.all(i.map(async m=>{const f=O(l,m);return{action:"update",content:await d(f),filePath:m}})),p=await n.Commits.create(o.repo,t,s,u),h=p.id??p.sha;if(!h)throw new Error("GitLab Commits.create returned no commit ID — cannot reference the new commit.");return{sha:h,url:p.web_url??p.webUrl}},"commitToGitlab"),ne=_(async e=>{if(e.files.length===0)throw new Error("Cannot commit: no files to include.");if(e.ciContext.provider==="github-actions")return await ie(e);if(e.ciContext.provider==="gitlab-ci")return await ae(e);throw new Error(`Cannot commit: unsupported CI provider \`${e.ciContext.provider}\`. Run \`vis ai heal accept\` from a recognised CI environment.`)},"commitFiles");var se=Object.defineProperty,g=I((e,t)=>se(e,"name",{value:t,configurable:!0}),"u");const G="/vis heal accept",ce=g(async e=>{if(!e)return;let t;try{t=await B(e,"utf8")}catch{return}const o=JSON.parse(t),i=o.comment?.body??"",s=o.comment?.user?.login??"",l=o.pull_request?.head?.repo?.full_name,d=o.pull_request?.base?.repo?.full_name??o.repository?.full_name,r=l!==void 0&&d!==void 0&&l!==d;return{actor:s,body:i,headRef:o.pull_request?.head?.ref,isFork:r}},"loadGithubTrigger"),le=g(e=>{const t=e.VIS_HEAL_TRIGGER_BODY,o=e.VIS_HEAL_TRIGGER_ACTOR;if(!(!t||!o))return{actor:o,body:t,headRef:e.VIS_HEAL_HEAD_REF,isFork:!1}},"loadGitlabTrigger"),de=g(e=>{const t=e.BUILDKITE_UNBLOCKER_EMAIL??e.BUILDKITE_UNBLOCKER;if(t)return{actor:t,body:G,headRef:e.BUILDKITE_BRANCH,isFork:!1}},"loadBuildkiteTrigger"),ue=g(async(e,t)=>{if(e.provider==="github-actions")return await ce(t.GITHUB_EVENT_PATH);if(e.provider==="gitlab-ci")return le(t);if(e.provider==="buildkite")return de(t)},"loadTrigger"),pe=g((e,t)=>{const o=t.BUILDKITE_REPO;if(!o)return;const i=/(?:^|@|\/\/)github\.com[:/]([^/]+)\/([^/]+?)(?:\.git)?\/?$/i.exec(o);if(i&&t.GITHUB_TOKEN)return{apiBaseUrl:void 0,buildId:void 0,buildNumber:void 0,prNumber:e.prNumber,provider:"github-actions",repo:`${i[1]}/${i[2]}`,sha:e.sha,token:t.GITHUB_TOKEN};const s=/\/\/([^/]*gitlab[^/]*)\/([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(o),l=s?null:/@([^/:]*gitlab[^/:]*):([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(o),d=s??l;if(d&&t.GITLAB_TOKEN){const r=d[1];return{apiBaseUrl:t.CI_API_V4_URL??`https://${r}/api/v4`,buildId:void 0,buildNumber:void 0,prNumber:e.prNumber,provider:"gitlab-ci",repo:`${d[2]}/${d[3]}`,sha:e.sha,token:t.GITLAB_TOKEN}}},"deriveBuildkiteCommitContext"),me=g(async e=>{const t=e.fetchImpl??globalThis.fetch,o=`${(e.apiBaseUrl??"https://api.github.com").replace(/\/+$/,"")}/repos/${e.repo}/pulls/${String(e.prNumber)}`;try{const i=await t(o,{headers:{Accept:"application/vnd.github+json",Authorization:`Bearer ${e.token}`,"X-GitHub-Api-Version":"2022-11-28"}});return i.ok?(await i.json()).head?.ref:void 0}catch{return}},"fetchGithubHeadRef"),fe=g((e,t,o,i)=>{const s=t.map(l=>`- \`${l}\``).join(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var U=Object.defineProperty;var I=(t,e)=>U(t,"name",{value:e,configurable:!0});import{createRequire as A}from"node:module";import{j as O,E as v,d as G,c as j,p as u,e as F}from"./bin.js";import{z as D}from"../packem_shared/
|
|
1
|
+
var U=Object.defineProperty;var I=(t,e)=>U(t,"name",{value:e,configurable:!0});import{createRequire as A}from"node:module";import{j as O,E as v,d as G,c as j,p as u,e as F}from"./bin.js";import{z as D}from"../packem_shared/otel-CO8UEfTa.js";import{readLastRunSummary as K}from"@visulima/task-runner";import{r as H,a as M,b as V,c as z}from"../packem_shared/ai-fix-iHtGLkJS.js";import{r as q}from"../packem_shared/run-summary-utils-BPraMTcm.js";const L=A(import.meta.url),b=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,T=I(t=>{if(typeof b<"u"&&b.versions&&b.versions.node){const[e,o]=b.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return b.getBuiltinModule(t)}return L(t)},"__cjs_getBuiltinModule"),{spawn:k}=T("node:child_process"),{readFile:J}=T("node:fs/promises");var Q=Object.defineProperty,g=I((t,e)=>Q(t,"name",{value:e,configurable:!0}),"i");const W=g(t=>{if(!t)return;const e=/^refs\/pull\/(\d+)\//.exec(t);return e?Number.parseInt(e[1],10):void 0},"parsePrNumberFromGithubRef"),Y=g(async t=>{if(!t)return{prNumber:void 0,sha:void 0};try{const e=await J(t,"utf8"),o=JSON.parse(e),r=o.pull_request?.number??o.issue?.number??o.number,i=o.pull_request?.head?.sha;return{prNumber:r,sha:i}}catch{return{prNumber:void 0,sha:void 0}}},"readPrNumberFromGithubEvent"),Z=g(async t=>{const e=W(t.GITHUB_REF),{prNumber:o,sha:r}=e===void 0?await Y(t.GITHUB_EVENT_PATH):{prNumber:e,sha:void 0};return{apiBaseUrl:void 0,buildId:void 0,buildNumber:void 0,prNumber:e??o,provider:"github-actions",repo:t.GITHUB_REPOSITORY,sha:r??t.GITHUB_SHA,token:t.GITHUB_TOKEN}},"detectGithubActions"),X=g(t=>{const e=t.CI_MERGE_REQUEST_IID,o=e!==void 0&&e!==""?Number.parseInt(e,10):void 0,r=t.CI_API_V4_URL,i=t.GITLAB_TOKEN??t.CI_TOKEN;return{apiBaseUrl:r,buildId:void 0,buildNumber:void 0,prNumber:Number.isFinite(o)?o:void 0,provider:"gitlab-ci",repo:t.CI_PROJECT_ID??t.CI_PROJECT_PATH,sha:t.CI_COMMIT_SHA,token:i}},"detectGitlabCi"),ee=g(t=>{const e=t.BUILDKITE_PULL_REQUEST,o=e!==void 0&&e!==""&&e!=="false"?Number.parseInt(e,10):void 0,r=t.BUILDKITE_BUILD_NUMBER,i=r!==void 0&&r!==""?Number.parseInt(r,10):void 0,n=t.BUILDKITE_ORGANIZATION_SLUG,a=t.BUILDKITE_PIPELINE_SLUG,s=n!==void 0&&n!==""&&a!==void 0&&a!==""?`${n}/${a}`:void 0;return{apiBaseUrl:(t.BUILDKITE_API_BASE_URL??"https://api.buildkite.com").replace(/\/+$/,""),buildId:t.BUILDKITE_BUILD_ID,buildNumber:Number.isFinite(i)?i:void 0,prNumber:Number.isFinite(o)?o:void 0,provider:"buildkite",repo:s,sha:t.BUILDKITE_COMMIT,token:t.BUILDKITE_API_TOKEN}},"detectBuildkite"),te=g(async(t=process.env)=>t.GITHUB_ACTIONS==="true"?await Z(t):t.GITLAB_CI==="true"?X(t):t.BUILDKITE==="true"?ee(t):{apiBaseUrl:void 0,buildId:void 0,buildNumber:void 0,prNumber:void 0,provider:"unknown",repo:void 0,sha:void 0,token:void 0},"detectCiContext");var oe=Object.defineProperty,h=I((t,e)=>oe(t,"name",{value:e,configurable:!0}),"p");const re=h((t,e,o,r)=>new Promise(i=>{const n=["pr","comment",String(e),"--body-file","-"];r&&n.push("--repo",r);const a=k(t,n,{stdio:["pipe","ignore","pipe"]});let s="";a.stderr?.setEncoding("utf8"),a.stderr?.on("data",d=>{s+=d}),a.once("error",()=>{i({exitCode:127,stderr:s})}),a.once("close",d=>{i({exitCode:d??-1,stderr:s})}),a.stdin?.on("error",()=>{}),a.stdin?.end(o)}),"runGhComment"),ie=h(async(t,e,o,r,i)=>{const n=`https://api.github.com/repos/${e}/issues/${String(o)}/comments`;try{const a=await t(n,{body:JSON.stringify({body:r}),headers:{Accept:"application/vnd.github+json",Authorization:`Bearer ${i}`,"Content-Type":"application/json","X-GitHub-Api-Version":"2022-11-28"},method:"POST"});if(!a.ok){const s=await a.text().catch(()=>"");return{error:`GitHub REST returned ${String(a.status)}: ${s.slice(0,500)}`,ok:!1}}return{ok:!0}}catch(a){return{error:a instanceof Error?a.message:String(a),ok:!1}}},"postViaGithubRest"),ne=h(async(t,e,o,r,i,n)=>{const a=encodeURIComponent(o),s=`${e.replace(/\/+$/,"")}/projects/${a}/merge_requests/${String(r)}/notes`;try{const d=await t(s,{body:JSON.stringify({body:i}),headers:{"Content-Type":"application/json","PRIVATE-TOKEN":n},method:"POST"});if(!d.ok){const p=await d.text().catch(()=>"");return{error:`GitLab REST returned ${String(d.status)}: ${p.slice(0,500)}`,ok:!1}}return{ok:!0}}catch(d){return{error:d instanceof Error?d.message:String(d),ok:!1}}},"postViaGitlabRest"),ae=h((t,e,o,r)=>new Promise(i=>{const n=k(t,["annotate","--style",o,"--context",r],{stdio:["pipe","ignore","pipe"]});let a="";n.stderr?.setEncoding("utf8"),n.stderr?.on("data",s=>{a+=s}),n.once("error",()=>{i({exitCode:127,stderr:a})}),n.once("close",s=>{i({exitCode:s??-1,stderr:a})}),n.stdin?.on("error",()=>{}),n.stdin?.end(e)}),"runBuildkiteAnnotate"),se=h(async(t,e,o,r,i,n,a,s)=>{const[d,p]=o.split("/",2);if(!d||!p)return{error:`Buildkite repo identifier \`${o}\` is not in {org}/{pipeline} form.`,ok:!1};const m=`${e}/v2/organizations/${encodeURIComponent(d)}/pipelines/${encodeURIComponent(p)}/builds/${String(r)}/annotations`;try{const c=await t(m,{body:JSON.stringify({body:i,context:a,style:n}),headers:{Authorization:`Bearer ${s}`,"Content-Type":"application/json"},method:"POST"});if(!c.ok){const l=await c.text().catch(()=>"");return{error:`Buildkite REST returned ${String(c.status)}: ${l.slice(0,500)}`,ok:!1}}return{ok:!0}}catch(c){return{error:c instanceof Error?c.message:String(c),ok:!1}}},"postViaBuildkiteRest"),de=h(async(t,e,o,r)=>{const i=e.buildId?`vis-ai-heal-${e.buildId}`:"vis-ai-heal",n="info",a=await ae(o,t,n,i);if(a.exitCode===0)return{method:"buildkite-cli",posted:!0};if(!e.apiBaseUrl||!e.repo||e.buildNumber===void 0||!e.token){const d=[];return e.repo||d.push("BUILDKITE_ORGANIZATION_SLUG / BUILDKITE_PIPELINE_SLUG"),e.buildNumber===void 0&&d.push("BUILDKITE_BUILD_NUMBER"),e.token||d.push("BUILDKITE_API_TOKEN (with `write_build_annotations` scope)"),{error:`buildkite-agent annotate exited ${String(a.exitCode)} (${a.stderr.trim().slice(0,200)}); cannot fall back to REST without ${d.join(", ")}`,method:"buildkite-cli",posted:!1}}const s=await se(r,e.apiBaseUrl,e.repo,e.buildNumber,t,n,i,e.token);return s.ok?{method:"rest",posted:!0}:{error:`buildkite-agent annotate exited ${String(a.exitCode)}; REST fallback also failed: ${s.error??"unknown"}`,method:"rest",posted:!1}},"postBuildkiteAnnotation"),pe=h(async(t,e,o,r)=>{if(e.prNumber===void 0)return{method:"skipped",posted:!1};const i=await re(o,e.prNumber,t,e.repo);if(i.exitCode===0)return{method:"gh-cli",posted:!0};if(!e.repo||!e.token)return{error:`gh exited ${String(i.exitCode)} (${i.stderr.trim().slice(0,200)}); cannot fall back to REST without GITHUB_REPOSITORY + GITHUB_TOKEN`,method:"gh-cli",posted:!1};const n=await ie(r,e.repo,e.prNumber,t,e.token);return n.ok?{method:"rest",posted:!0}:{error:`gh exited ${String(i.exitCode)}; REST fallback also failed: ${n.error??"unknown"}`,method:"rest",posted:!1}},"postGithubComment"),ce=h(async(t,e,o)=>{if(e.prNumber===void 0)return{method:"skipped",posted:!1};if(!e.apiBaseUrl||!e.repo)return{error:"GitLab CI context is missing CI_API_V4_URL or CI_PROJECT_ID; cannot post note.",method:"rest",posted:!1};if(!e.token)return{error:"GitLab CI context has no token. CI_JOB_TOKEN cannot post MR notes — set GITLAB_TOKEN to a personal/project access token with `api` scope.",method:"rest",posted:!1};const r=await ne(o,e.apiBaseUrl,e.repo,e.prNumber,t,e.token);return r.ok?{method:"rest",posted:!0}:{error:r.error,method:"rest",posted:!1}},"postGitlabComment"),ue=h(async t=>{const{body:e,buildkiteAgentBin:o="buildkite-agent",context:r,fetchImpl:i=globalThis.fetch,ghBin:n="gh"}=t;return r.provider==="github-actions"?await pe(e,r,n,i):r.provider==="gitlab-ci"?await ce(e,r,i):r.provider==="buildkite"?await de(e,r,o,i):{method:"skipped",posted:!1}},"postPrComment");var le=Object.defineProperty,f=I((t,e)=>le(t,"name",{value:e,configurable:!0}),"l");const C=f(t=>{let e=0,o=0;for(const r of t)r.status==="applied"?e+=1:o+=1;return{applied:e,failed:o}},"summarizeApply"),_=f((t,e,o)=>{const r=H(t,e,o),i=D(t,r);return i===""||i.startsWith("..")?r:i},"formatDisplayPath"),fe=f((t,e,o,r)=>new Promise(i=>{const n=process.argv[1];if(!n){i({exitCode:-1,stderr:"Cannot locate vis bin (process.argv[1] missing).",stdout:""});return}const a=[n,"run",o,"--projects",e,"--no-cache","--summarize","--fail-fast"],s=k(process.execPath,a,{cwd:t,env:{...process.env,NO_COLOR:"1"},stdio:["ignore","pipe","pipe"]});let d="",p="";const m=setTimeout(()=>{s.kill("SIGTERM"),setTimeout(()=>s.kill("SIGKILL"),2e3).unref()},r);s.stdout?.setEncoding("utf8"),s.stdout?.on("data",c=>{d+=c}),s.stderr?.setEncoding("utf8"),s.stderr?.on("data",c=>{p+=c}),s.once("error",c=>{clearTimeout(m),i({exitCode:-1,stderr:c.message,stdout:d})}),s.once("close",c=>{clearTimeout(m),i({exitCode:c??-1,stderr:p,stdout:d})})}),"validateFixByRerun"),me=6e4,y=f(t=>{let e=0;const o=t.match(/`{3,}/g);if(o)for(const r of o)e=Math.max(e,r.length);return"`".repeat(Math.max(3,e+1))},"pickFence"),$=f((t,e,o)=>{if(t.patches.length===0)return"_No patches proposed._";const r=[];for(const[i,n]of t.patches.entries()){const a=_(e,o,n.file),s=[`**[${String(i+1)}] \`${a}\`**`];n.reason&&s.push(`_${n.reason}_`);const d=y(`${n.oldString}
|
|
2
2
|
${n.newString}`);s.push(`${d}diff`);for(const p of n.oldString.split(`
|
|
3
3
|
`))s.push(`- ${p}`);for(const p of n.newString.split(`
|
|
4
4
|
`))s.push(`+ ${p}`);s.push(d),r.push(s.join(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Nr=Object.defineProperty;var A=(e,t)=>Nr(e,"name",{value:t,configurable:!0});import{createRequire as Pr}from"node:module";import{aU as Fr,j as Lr,aV as _r,c as G,aW as P,q as ce,e as Fe}from"./bin.js";const Mr=Pr(import.meta.url),ge=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Tr=A(e=>{if(typeof ge<"u"&&ge.versions&&ge.versions.node){const[t,r]=ge.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return ge.getBuiltinModule(e)}return Mr(e)},"__cjs_getBuiltinModule"),{createRequire:tr}=Tr("node:module");var Hr=Object.defineProperty,J=A((e,t)=>Hr(e,"name",{value:t,configurable:!0}),"j$3"),Gr=Object.defineProperty,S=J((e,t)=>Gr(e,"name",{value:t,configurable:!0}),"$");const Jr=tr(import.meta.url),le=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,gt=S(e=>{if(typeof le<"u"&&le.versions&&le.versions.node){const[t,r]=le.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return le.getBuiltinModule(e)}return Jr(e)},"__cjs_getBuiltinModule"),X=le,{execFileSync:Vr}=gt("node:child_process"),ve=gt("node:fs"),qr=gt("node:tty");var zr=Object.defineProperty,bt=S((e,t)=>zr(e,"name",{value:t,configurable:!0}),"s$2"),Dr=Object.defineProperty,Je=bt((e,t)=>Dr(e,"name",{value:t,configurable:!0}),"l");const wt=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],yt=[12288,12288,65281,65376,65504,65510],vt=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],xt=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],Ve=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var Ur=Object.defineProperty,Yr=Je((e,t)=>Ur(e,"name",{value:t,configurable:!0}),"r$1");const $e=Yr((e,t)=>{let r=0,i=Math.floor(e.length/2)-1;for(;r<=i;){const n=Math.floor((r+i)/2),s=n*2;if(t<e[s])i=n-1;else if(t>e[s+1])r=n+1;else return!0}return!1},"isInRange");var Kr=Object.defineProperty,te=Je((e,t)=>Kr(e,"name",{value:t,configurable:!0}),"r");const Zr=wt[0],Xr=wt.at(-1),Qr=yt[0],ei=yt.at(-1),ti=vt[0],ri=vt.at(-1),ii=xt[0],ni=xt.at(-1),oi=Ve[0],si=Ve.at(-1),jt=19968,[ai,li]=de(Ve);function de(e){let t=e[0],r=e[1];for(let i=0;i<e.length;i+=2){const n=e[i],s=e[i+1];if(jt>=n&&jt<=s)return[n,s];s-n>r-t&&(t=n,r=s)}return[t,r]}A(de,"rt");J(de,"be");S(de,"b$5");bt(de,"b");Je(de,"N");te(de,"findWideFastPathRange");const rr=te(e=>e<Zr||e>Xr?!1:$e(wt,e),"isAmbiguous"),ir=te(e=>e<Qr||e>ei?!1:$e(yt,e),"isFullWidth"),ci=te(e=>e<ti||e>ri?!1:$e(vt,e),"isHalfWidth"),hi=te(e=>e<ii||e>ni?!1:$e(xt,e),"isNarrow"),nr=te(e=>e>=ai&&e<=li?!0:e<oi||e>si?!1:$e(Ve,e),"isWide");function ue(e){return rr(e)?"ambiguous":ir(e)?"fullwidth":ci(e)?"halfwidth":hi(e)?"narrow":nr(e)?"wide":"neutral"}A(ue,"nt");J(ue,"we");S(ue,"v$2");bt(ue,"q");Je(ue,"getCategory");te(ue,"getCategory");var di=Object.defineProperty,qe=S((e,t)=>di(e,"name",{value:t,configurable:!0}),"i$4"),ui=Object.defineProperty,ze=qe((e,t)=>ui(e,"name",{value:t,configurable:!0}),"a"),fi=Object.defineProperty,$t=ze((e,t)=>fi(e,"name",{value:t,configurable:!0}),"e");function re(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}A(re,"U$2");J(re,"ee");S(re,"s$1");qe(re,"s");ze(re,"r");$t(re,"validate");function ie(e){return re(e),ue(e)}A(ie,"Z$1");J(ie,"te");S(ie,"r$3");qe(ie,"p");ze(ie,"eastAsianWidthType");$t(ie,"eastAsianWidthType");function Be(e,{ambiguousAsWide:t=!1}={}){return re(e),ir(e)||nr(e)||t&&rr(e)?2:1}A(Be,"Wt");J(Be,"Fe");S(Be,"o$2");qe(Be,"W");ze(Be,"eastAsianWidth");$t(Be,"eastAsianWidth");var pi=Object.defineProperty,mi=S((e,t)=>pi(e,"name",{value:t,configurable:!0}),"p$3"),gi=Object.defineProperty,or=mi((e,t)=>gi(e,"name",{value:t,configurable:!0}),"e"),bi=Object.defineProperty,wi=or((e,t)=>bi(e,"name",{value:t,configurable:!0}),"E");const sr=String.raw,Ct=sr`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,yi=wi(()=>new RegExp(sr`\p{RI}{2}|(?)${Ct}(?:\u200D${Ct})*`,"gu"),"default");var vi=Object.defineProperty,xi=or((e,t)=>vi(e,"name",{value:t,configurable:!0}),"p");const fe=new Set(["\x1B",""]),De="\x07",ar="[",Bt="m",Le="]8;;",$i=39,Bi=/[\u200B\uFEFF\u2060-\u2064]/g,Wi=new RegExp(`(?:\\${ar}(?<code>\\d+)m|\\${Le}(?<uri>.*)${De})`),Si=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),Z=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,Et=/\u001B\[(\d+(?:;\d+)*)?m[^\u001B]*(?:\u001B\[(?:\d+(?:;\d+)*)?m|$)/g,Rt=/\u001B\]8;[^\u0007\u001B]*(?:\u0007|\u001B\\)(.*?)\u001B\]8;;(?:\u0007|\u001B\\)/g,We=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Ie=yi();xi(e=>e.replace(Ie,""),"stripEmoji");var Oi=Object.defineProperty,Ai=S((e,t)=>Oi(e,"name",{value:t,configurable:!0}),"E$1"),ji=Object.defineProperty,Ci=Ai((e,t)=>ji(e,"name",{value:t,configurable:!0}),"A"),Ei=Object.defineProperty,Ue=Ci((e,t)=>Ei(e,"name",{value:t,configurable:!0}),"d");const It=new Map,Se=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,ke=Ue(e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other","getCharType"),Ri=Ue((e,t)=>{const r=Math.floor(e/65536),i=e%65536;let n=It.get(r);if(n||(n=new Map,It.set(r,n)),n.has(i))return n.get(i);let s;if(ke(e)==="latin")s=t.width.regular;else if(ke(e)==="control")s=t.width.control;else if(ke(e)==="wide")s=t.width.wide;else switch(ie(e)){case"ambiguous":{s=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{s=t.width.fullWidth;break}case"wide":{s=t.width.wide;break}default:s=t.width.regular}return n.set(i,s),s},"getCachedCharWidth"),Ii=Ue(e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,"isCombiningCharacter"),he=Ue((e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const r={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?he(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},i=Math.max(0,r.truncation.limit-r.truncation.ellipsisWidth),{length:n}=e,s=n>1e4;let o=0,a=0,l=n,c=!1;const h=e.includes("\x1B")||e.includes("");for(;o<n;){if(h&&(e[o]==="\x1B"||e[o]==="")){if(e.startsWith("\x1B]8;;",o)){const m="\x1B]8;;\x07",u=m.length,x=e.indexOf("\x07",o+5);if(x!==-1){const w=e.indexOf(m,x+1);if(w!==-1){const v=w+u,$=e.slice(x+1,w).replace(Z,""),B=he($,{ambiguousIsNarrow:r.width.ambiguousIsNarrow,ansiWidth:r.width.ansi,controlWidth:r.width.control,countAnsiEscapeCodes:!1,ellipsis:r.truncation.ellipsis,ellipsisWidth:r.truncation.ellipsisWidth,emojiWidth:r.width.emoji,fullWidth:r.width.fullWidth,halfWidth:r.width.halfWidth,limit:Math.max(0,i-a),regularWidth:r.width.regular,tabWidth:r.width.tab,wideWidth:r.width.wide}),O=B.width;if(B.truncated)c=!0,l=Math.min(l,o);else if(a+O>i&&(l=Math.min(l,o),c=!0,a+O>r.truncation.limit))break;if(a+=O,o=v,c&&a>=r.truncation.limit)break;continue}}}if(Z.lastIndex=o,Z.test(e)){const m=Z.lastIndex-o,u=r.truncation.countAnsiEscapeCodes?m:r.width.ansi;if(a+u>i&&(l=Math.min(l,o),a+u>r.truncation.limit)){c=!0;break}a+=u,o=Z.lastIndex;continue}}const b=e.codePointAt(o);if(b===8203||b===65279||b>=8288&&b<=8292){o+=1;continue}if(b===9){if(a+r.width.tab>i&&(l=Math.min(l,o),a+r.width.tab>r.truncation.limit)){c=!0;break}a+=r.width.tab,o+=1;continue}if(Se.lastIndex=o,Se.test(e)){const m=(Se.lastIndex-o)*r.width.regular;if(a+m>i){const u=Math.floor((i-a)/r.width.regular);if(l=Math.min(l,o+u),a+m>r.truncation.limit){c=!0;break}}a+=m,o=Se.lastIndex;continue}if((b<=31||b>=127&&b<=159)&&(We.lastIndex=o,We.test(e))){const m=(We.lastIndex-o)*r.width.control;if(a+m>i&&(l=Math.min(l,o+Math.floor((i-a)/r.width.control)),a+m>r.truncation.limit)){c=!0;break}a+=m,o=We.lastIndex;continue}if(Ie.lastIndex=o,Ie.test(e)){if(a+r.width.emoji>i&&(l=Math.min(l,o),a+r.width.emoji>r.truncation.limit)){c=!0;break}a+=r.width.emoji,o=Ie.lastIndex;continue}const f=e.codePointAt(o)??0;if(Ii(f)){o+=f>65535?2:1;continue}let g;if(s)g=Ri(f,r);else switch(ke(f)){case"control":{g=r.width.control;break}case"latin":{g=r.width.regular;break}case"wide":{g=r.width.wide;break}case"zero":{g=0;break}default:switch(ie(f)){case"ambiguous":{g=r.width.ambiguousIsNarrow?r.width.regular:r.width.wide;break}case"fullwidth":{g=r.width.fullWidth;break}case"wide":{g=r.width.wide;break}default:g=r.width.regular}}if(a+g>i&&(l=Math.min(l,o),a+g>r.truncation.limit)){c=!0;break}a+=g,o+=f>65535?2:1}let d=a,p=!1;return c&&r.truncation.limit>=r.truncation.ellipsisWidth&&(d=r.truncation.limit,p=!0),{ellipsed:p,index:c?l:n,truncated:c,width:d}},"getStringTruncatedWidth");var ki=Object.defineProperty,Ni=S((e,t)=>ki(e,"name",{value:t,configurable:!0}),"i$2"),Pi=Object.defineProperty,Mi=Ni((e,t)=>Pi(e,"name",{value:t,configurable:!0}),"e"),Ti=Object.defineProperty,Fi=Mi((e,t)=>Ti(e,"name",{value:t,configurable:!0}),"r");const I=Fi((e,t={})=>he(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var Li=Object.defineProperty,lr=S((e,t)=>Li(e,"name",{value:t,configurable:!0}),"i$1"),_i=Object.defineProperty,cr=lr((e,t)=>_i(e,"name",{value:t,configurable:!0}),"r"),Hi=Object.defineProperty,Gi=cr((e,t)=>Hi(e,"name",{value:t,configurable:!0}),"c");let Ji=class{static{A(this,"Oi")}static{J(this,"Ii")}static{S(this,"l")}static{lr(this,"y")}static{cr(this,"s")}static{Gi(this,"LRUCache")}capacity;cache;keyOrder;constructor(e){this.capacity=e,this.cache=new Map,this.keyOrder=[]}get(e){if(this.cache.has(e))return this.keyOrder=this.keyOrder.filter(t=>t!==e),this.keyOrder.push(e),this.cache.get(e)}has(e){return this.cache.has(e)}set(e,t){if(this.cache.has(e))this.keyOrder=this.keyOrder.filter(r=>r!==e);else if(this.cache.size>=this.capacity){const r=this.keyOrder.shift();r!==void 0&&this.cache.delete(r)}this.cache.set(e,t),this.keyOrder.push(e)}delete(e){this.cache.delete(e),this.keyOrder=this.keyOrder.filter(t=>t!==e)}clear(){this.cache.clear(),this.keyOrder=[]}size(){return this.cache.size}};var Vi=Object.defineProperty,qi=S((e,t)=>Vi(e,"name",{value:t,configurable:!0}),"S$1"),zi=Object.defineProperty,Di=qi((e,t)=>zi(e,"name",{value:t,configurable:!0}),"w"),Ui=Object.defineProperty,pe=Di((e,t)=>Ui(e,"name",{value:t,configurable:!0}),"y");const kt=new Ji(100),Yi=new Intl.Segmenter("en",{granularity:"grapheme"}),Ki=/^[\u0000-\u007F]*$/,Zi=new Set(["0","22","23","24","27","28","29","39","49"]),Xi=new Set(["1","3","4","7","8","9"]),Nt=new Map([["22","1"],["23","3"],["24","4"],["27","7"],["28","8"],["29","9"]]),Oe=pe(e=>e>="30"&&e<="37"||e>="90"&&e<="97"||e.startsWith("38;"),"isForegroundColor"),Ae=pe(e=>e>="40"&&e<="47"||e>="100"&&e<="107"||e.startsWith("48;"),"isBackgroundColor"),Qi=[{close:"\x1B[22m",open:"\x1B[1m"},{close:"\x1B[23m",open:"\x1B[3m"},{close:"\x1B[24m",open:"\x1B[4m"},{close:"\x1B[27m",open:"\x1B[7m"},{close:"\x1B[28m",open:"\x1B[8m"},{close:"\x1B[29m",open:"\x1B[9m"}],Pt=pe((e,t)=>{let r=-1;for(const i of t){const n=e.indexOf(i);n!==-1&&(r===-1||n<r)&&(r=n)}return r},"findFirstPositionOfAny"),en=pe((e,t)=>{if(!e.includes("\x1B"))return[{after:"",before:"",content:e,visibleLength:I(e,t.width)}];const r=kt.get(e);if(r)return r;const i=[],n=[];let s=0,o;for(Z.lastIndex=0;(o=Z.exec(e))!==null;){const h=o[0];i.push(e.slice(s,o.index)),n.push(h),s=o.index+h.length}s<e.length&&i.push(e.slice(s));const a=[];for(const h of n){if(h==="\x1B[0m"||h==="\x1B]8;;\x07"){a.push(h);continue}if(h.startsWith("\x1B[")&&h.endsWith("m")){const d=h.slice(2,-1);if(Zi.has(d)){a.push(h);continue}}}const l=new Set,c=[];for(const[h,d]of i.entries()){if(h>0&&n[h-1]){const f=n[h-1];if(f==="\x1B[0m")l.clear();else if(f==="\x1B]8;;\x07"){for(const g of l)if(g.startsWith("\x1B]8;;")&&!g.endsWith("\x1B]8;;\x07")){l.delete(g);break}}else if(f.startsWith("\x1B[")&&f.endsWith("m")){const g=f.slice(2,-1);if(g==="39"){for(const m of l)if(m.startsWith("\x1B[")&&m.endsWith("m")){const u=m.slice(2,-1);if(Oe(u)){l.delete(m);break}}}else if(g==="49"){for(const m of l)if(m.startsWith("\x1B[")&&m.endsWith("m")){const u=m.slice(2,-1);if(Ae(u)){l.delete(m);break}}}else if(Nt.has(g)){const m=Nt.get(g);for(const u of l)if(u===`\x1B[${m}m`){l.delete(u);break}}else{if(Oe(g)){for(const m of l)if(m.startsWith("\x1B[")&&m.endsWith("m")){const u=m.slice(2,-1);if(Oe(u)){l.delete(m);break}}}else if(Ae(g)){for(const m of l)if(m.startsWith("\x1B[")&&m.endsWith("m")){const u=m.slice(2,-1);if(Ae(u)){l.delete(m);break}}}else if(Xi.has(g)){const m=`\x1B[${g}m`;l.has(m)&&l.delete(m)}l.add(f)}}else if(f.startsWith("\x1B]8;;")&&!f.endsWith("\x1B]8;;\x07")){for(const g of l)if(g.startsWith("\x1B]8;;")&&!g.endsWith("\x1B]8;;\x07")){l.delete(g);break}l.add(f)}}if(d==="")continue;let p="";if(l.size>0)if(a.includes("\x1B[0m"))p="\x1B[0m";else{const f=[];let g=!1;for(const w of l)if(w.startsWith("\x1B]8;;")&&!w.endsWith("\x1B]8;;\x07")){g=!0;break}g&&a.includes("\x1B]8;;\x07")&&f.push("\x1B]8;;\x07");let m=!1,u=!1;for(const w of l)if(w.startsWith("\x1B[")&&w.endsWith("m")){const v=w.slice(2,-1);Oe(v)?m=!0:Ae(v)&&(u=!0)}if(m&&u){const w=Pt(e,["\x1B[3","\x1B[9","\x1B[38;"]),v=Pt(e,["\x1B[4","\x1B[10","\x1B[48;"]);w>=0&&v>=0?w>v?f.push("\x1B[39m","\x1B[49m"):f.push("\x1B[49m","\x1B[39m"):f.push("\x1B[39m","\x1B[49m")}else m&&f.push("\x1B[39m"),u&&f.push("\x1B[49m");m&&u&&e.includes("\x1B[39m")&&e.includes("\x1B[49m")&&(e.indexOf("\x1B[39m")<e.indexOf("\x1B[49m")?(f.length-=2,f.push("\x1B[39m","\x1B[49m")):e.indexOf("\x1B[49m")<e.indexOf("\x1B[39m")&&(f.length-=2,f.push("\x1B[49m","\x1B[39m")));const x=Qi.filter(w=>l.has(w.open)).map(w=>({position:e.indexOf(w.open),style:w})).filter(w=>w.position>=0).toSorted((w,v)=>v.position-w.position);for(const w of x){const v=w;a.includes(v.style.close)&&f.push(v.style.close)}p=f.join("")}const b=[...l].join("");c.push({after:p,before:b,content:d,visibleLength:I(d,{fullWidth:1,wideWidth:1})})}return kt.set(e,c),c},"processIntoStyledSegments"),tn=pe((e,t,r,i)=>{const n=[...i.segmenter.segment(e)],s=[];let o=0,a=!1;for(const l of n){const c=I(l.segment,i.width),h=o,d=o+c;if(!a)if(h<t){o=d;continue}else a=!0;if(h>=r||d>r)break;s.push(l.segment),o=d}return s.join("")},"fastSlice"),z=pe((e,t=0,r=Number.MAX_SAFE_INTEGER,i={})=>{const n={segmenter:Yi,...i};if(t>=r||e==="")return"";const s=I(e,n.width);if(t===0&&r>=s)return e;if(t<0||r<0)throw new RangeError("Negative indices aren't supported");if(!e.includes("\x1B"))return Ki.test(e)?e.slice(t,r):tn(e,t,r,n);if(Et.lastIndex=0,Rt.lastIndex=0,!Et.test(e)&&!Rt.test(e))return e;const o=en(e,n);if(o.length===0)return"";let a=0;const l=[];for(const[d,p]of o.entries()){const b=a,f=a+p.visibleLength;if(f>t&&b<r){const g=Math.max(0,t-b),m=Math.min(p.visibleLength,r-b);l.push({end:m,index:d,segment:p,start:g})}a=f}if(l.length===0)return"";const c=[],h=l[0].segment;c.push(h.before);for(let d=0;d<l.length;d++){const{end:p,segment:b,start:f}=l[d];if(f===0&&p===b.visibleLength)c.push(b.content);else{const g=[...n.segmenter.segment(b.content)];c.push(g.slice(f,p).map(m=>m.segment).join(""))}if(d<l.length-1){const g=l[d+1].segment,m=b.after,u=g.before;m!==u&&(m||u)&&c.push(m,u)}}return c.push(l.at(-1).segment.after),c.join("")},"slice");var rn=Object.defineProperty,nn=S((e,t)=>rn(e,"name",{value:t,configurable:!0}),"x"),on=Object.defineProperty,sn=nn((e,t)=>on(e,"name",{value:t,configurable:!0}),"T"),an=Object.defineProperty,Ye=sn((e,t)=>an(e,"name",{value:t,configurable:!0}),"f");const Mt="…",ln=3,je=Ye((e,t,r=!1)=>{if(e.charAt(t)===" ")return t;const i=r?1:-1,n=Math.min(ln,r?e.length-t:t);for(let s=1;s<=n;s++){const o=t+s*i;if(e.charAt(o)===" ")return o}return t},"findNearestSpace"),Ce=Ye((e,t,r)=>he(e,{...r,ellipsis:"",ellipsisWidth:0,limit:t}).index,"widthToIndex"),Ee=Ye((e,t,r)=>I(e.slice(0,t),r),"indexToWidth"),Tt=Ye((e,t,r={})=>{if(typeof e!="string")throw new TypeError(`Expected \`input\` to be a string, got ${typeof e}`);if(typeof t!="number")throw new TypeError(`Expected \`limit\` to be a number, got ${typeof t}`);if(e===""||t<=0)return"";const i=e.normalize("NFC"),{ellipsis:n=Mt,position:s="end",preferTruncationOnSpace:o=!1}=r;let a=r.ellipsisWidth??n===Mt?1:void 0;a??=he(n,{...r.width,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width;const{width:l}=he(i,{...r.width,ellipsis:n,ellipsisWidth:a});if(l<=t)return i;switch(s){case"end":{if(o){const c=t-a,h=Ce(i,c,r.width),d=je(i,h),p=Ee(i,d,r.width);return z(i,0,p,{width:r.width})+n}return z(i,0,t-a,{width:r.width})+n}case"middle":{const c=Math.floor(t/2),h=Math.max(0,t-a),d=Math.min(c,h),p=Math.max(0,h-d);if(o){const b=Ce(i,d,r.width),f=je(i,b),g=Ee(i,f,r.width),m=l-p,u=Ce(i,m,r.width),x=je(i,u,!0),w=Ee(i,x,r.width);return z(i,0,g,{width:r.width})+n+z(i,w,l,{width:r.width}).trim()}return z(i,0,d,{width:r.width})+n+z(i,l-p,l,{width:r.width})}case"start":{if(o){const c=l-t+a,h=Ce(i,c,r.width),d=je(i,h,!0),p=Ee(i,d,r.width);return n+z(i,p,l,{width:r.width}).trim()}return n+z(i,l-t+a,l,{width:r.width})}default:throw new Error(`Invalid position: expected 'start', 'middle' or 'end', got '${s}'`)}},"truncate");var cn=Object.defineProperty,hr=S((e,t)=>cn(e,"name",{value:t,configurable:!0}),"b$2"),hn=Object.defineProperty,ne=hr((e,t)=>hn(e,"name",{value:t,configurable:!0}),"d"),dn=Object.defineProperty,un=ne((e,t)=>dn(e,"name",{value:t,configurable:!0}),"a");const fn=/\x1B\[(\d+)m/;class dr{static{A(this,"me")}static{J(this,"dt")}static{S(this,"T")}static{hr(this,"T")}static{ne(this,"d")}static{un(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const r=fn.exec(t);if(!r)return;const i=Number.parseInt(r[1],10);switch(i){case 0:{this.activeForeground=void 0,this.activeBackground=void 0,this.activeFormatting=[];break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}default:if(i>=30&&i<=37||i>=90&&i<=97)this.activeForeground=t;else if(i>=40&&i<=47||i>=100&&i<=107)this.activeBackground=t;else if([1,2,3,4,7,8,9].includes(i))this.activeFormatting.push(t);else if([22,23,24,27,28,29].includes(i)){const n={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[i];n&&(this.activeFormatting=this.activeFormatting.filter(s=>!s.includes(n)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const t=[];if(this.activeFormatting.length>0){const r={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].toReversed().forEach(i=>{const n=r[i];n&&t.push(n)})}return this.activeForeground&&t.push("\x1B[39m"),this.activeBackground&&t.push("\x1B[49m"),t.join("")}}var pn=Object.defineProperty,ur=ne((e,t)=>pn(e,"name",{value:t,configurable:!0}),"o");const fr=ur((e,t)=>{if(!fe.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const r=!0,i=e.slice(t+1,t+1+Le.length).join("")===Le;return{isInsideEscape:r,isInsideLinkEscape:i}},"checkEscapeSequence"),mn=ur((e,t={})=>{const r=new dr;let i="",n=!1,s="",o="",a=!1;const l=[...e];for(let c=0;c<l.length;c++){const h=l[c];if(h&&fe.has(h)){if(i){const g=t.getWidth?.(i)??0,m={isEscapeSequence:!1,isGrapheme:!0,text:i,width:g};if(a&&(m.isHyperlink=!0,m.hyperlinkUrl=o),t.onSegment?.(m,r)===!1)return;i=""}n=!0,s=h;const b=fr(l,c),{isInsideLinkEscape:f}=b;if(f){let g=c+1;for(o="";g<l.length;){const u=l[g];if(u===De)break;o+=u,g+=1}o=o.slice(4);const m={hyperlinkUrl:o,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(m,r)===!1)return;c=g,a=!0,n=!1,s="";continue}if(c+1<l.length&&l[c+1]==="\\"&&a){const g={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.(g,r)===!1)return;a=!1,o="",c+=1,n=!1,s="";continue}}if(n){if(s!==h&&(s+=h),h===Bt){n=!1,r.processEscape(s);const b={isEscapeSequence:!0,isGrapheme:!1,text:s,width:0};if(t.onSegment?.(b,r)===!1)return;s=""}continue}i+=h;const d=t.getWidth?.(i)??0,p={isEscapeSequence:!1,isGrapheme:!0,text:i,width:d};if(a&&(p.isHyperlink=!0,p.hyperlinkUrl=o),t.onSegment?.(p,r)===!1)return;i=""}if(i){const c=t.getWidth?.(i)??0,h={isEscapeSequence:!1,isGrapheme:!0,text:i,width:c};a&&(h.isHyperlink=!0,h.hyperlinkUrl=o),t.onSegment?.(h,r)}if(s){const c={isEscapeSequence:!0,isGrapheme:!1,text:s,width:0};t.onSegment?.(c,r)}},"processAnsiString");var gn=Object.defineProperty,bn=ne((e,t)=>gn(e,"name",{value:t,configurable:!0}),"t$1");const Ft=bn(e=>`${fe.values().next().value}${ar}${String(e)}${Bt}`,"wrapAnsiCode");var wn=Object.defineProperty,yn=ne((e,t)=>wn(e,"name",{value:t,configurable:!0}),"s");const Lt=yn(e=>`${fe.values().next().value}${Le}${e}${De}`,"wrapAnsiHyperlink");var vn=Object.defineProperty,xn=ne((e,t)=>vn(e,"name",{value:t,configurable:!0}),"l");const $n=xn(e=>{if(e.length===0)return"";if(e.length===1)return e[0];let t="",r,i;const n=e.join(`
|
|
1
|
+
var Nr=Object.defineProperty;var A=(e,t)=>Nr(e,"name",{value:t,configurable:!0});import{createRequire as Pr}from"node:module";import{a_ as Fr,j as Lr,a$ as _r,c as G,b0 as P,q as ce,e as Fe}from"./bin.js";const Mr=Pr(import.meta.url),ge=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Tr=A(e=>{if(typeof ge<"u"&&ge.versions&&ge.versions.node){const[t,r]=ge.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return ge.getBuiltinModule(e)}return Mr(e)},"__cjs_getBuiltinModule"),{createRequire:tr}=Tr("node:module");var Hr=Object.defineProperty,J=A((e,t)=>Hr(e,"name",{value:t,configurable:!0}),"j$3"),Gr=Object.defineProperty,S=J((e,t)=>Gr(e,"name",{value:t,configurable:!0}),"$");const Jr=tr(import.meta.url),le=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,gt=S(e=>{if(typeof le<"u"&&le.versions&&le.versions.node){const[t,r]=le.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return le.getBuiltinModule(e)}return Jr(e)},"__cjs_getBuiltinModule"),X=le,{execFileSync:Vr}=gt("node:child_process"),ve=gt("node:fs"),qr=gt("node:tty");var zr=Object.defineProperty,bt=S((e,t)=>zr(e,"name",{value:t,configurable:!0}),"s$2"),Dr=Object.defineProperty,Je=bt((e,t)=>Dr(e,"name",{value:t,configurable:!0}),"l");const wt=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],yt=[12288,12288,65281,65376,65504,65510],vt=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],xt=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],Ve=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var Ur=Object.defineProperty,Yr=Je((e,t)=>Ur(e,"name",{value:t,configurable:!0}),"r$1");const $e=Yr((e,t)=>{let r=0,i=Math.floor(e.length/2)-1;for(;r<=i;){const n=Math.floor((r+i)/2),s=n*2;if(t<e[s])i=n-1;else if(t>e[s+1])r=n+1;else return!0}return!1},"isInRange");var Kr=Object.defineProperty,te=Je((e,t)=>Kr(e,"name",{value:t,configurable:!0}),"r");const Zr=wt[0],Xr=wt.at(-1),Qr=yt[0],ei=yt.at(-1),ti=vt[0],ri=vt.at(-1),ii=xt[0],ni=xt.at(-1),oi=Ve[0],si=Ve.at(-1),jt=19968,[ai,li]=de(Ve);function de(e){let t=e[0],r=e[1];for(let i=0;i<e.length;i+=2){const n=e[i],s=e[i+1];if(jt>=n&&jt<=s)return[n,s];s-n>r-t&&(t=n,r=s)}return[t,r]}A(de,"rt");J(de,"be");S(de,"b$5");bt(de,"b");Je(de,"N");te(de,"findWideFastPathRange");const rr=te(e=>e<Zr||e>Xr?!1:$e(wt,e),"isAmbiguous"),ir=te(e=>e<Qr||e>ei?!1:$e(yt,e),"isFullWidth"),ci=te(e=>e<ti||e>ri?!1:$e(vt,e),"isHalfWidth"),hi=te(e=>e<ii||e>ni?!1:$e(xt,e),"isNarrow"),nr=te(e=>e>=ai&&e<=li?!0:e<oi||e>si?!1:$e(Ve,e),"isWide");function ue(e){return rr(e)?"ambiguous":ir(e)?"fullwidth":ci(e)?"halfwidth":hi(e)?"narrow":nr(e)?"wide":"neutral"}A(ue,"nt");J(ue,"we");S(ue,"v$2");bt(ue,"q");Je(ue,"getCategory");te(ue,"getCategory");var di=Object.defineProperty,qe=S((e,t)=>di(e,"name",{value:t,configurable:!0}),"i$4"),ui=Object.defineProperty,ze=qe((e,t)=>ui(e,"name",{value:t,configurable:!0}),"a"),fi=Object.defineProperty,$t=ze((e,t)=>fi(e,"name",{value:t,configurable:!0}),"e");function re(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}A(re,"U$2");J(re,"ee");S(re,"s$1");qe(re,"s");ze(re,"r");$t(re,"validate");function ie(e){return re(e),ue(e)}A(ie,"Z$1");J(ie,"te");S(ie,"r$3");qe(ie,"p");ze(ie,"eastAsianWidthType");$t(ie,"eastAsianWidthType");function Be(e,{ambiguousAsWide:t=!1}={}){return re(e),ir(e)||nr(e)||t&&rr(e)?2:1}A(Be,"Wt");J(Be,"Fe");S(Be,"o$2");qe(Be,"W");ze(Be,"eastAsianWidth");$t(Be,"eastAsianWidth");var pi=Object.defineProperty,mi=S((e,t)=>pi(e,"name",{value:t,configurable:!0}),"p$3"),gi=Object.defineProperty,or=mi((e,t)=>gi(e,"name",{value:t,configurable:!0}),"e"),bi=Object.defineProperty,wi=or((e,t)=>bi(e,"name",{value:t,configurable:!0}),"E");const sr=String.raw,Ct=sr`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,yi=wi(()=>new RegExp(sr`\p{RI}{2}|(?)${Ct}(?:\u200D${Ct})*`,"gu"),"default");var vi=Object.defineProperty,xi=or((e,t)=>vi(e,"name",{value:t,configurable:!0}),"p");const fe=new Set(["\x1B",""]),De="\x07",ar="[",Bt="m",Le="]8;;",$i=39,Bi=/[\u200B\uFEFF\u2060-\u2064]/g,Wi=new RegExp(`(?:\\${ar}(?<code>\\d+)m|\\${Le}(?<uri>.*)${De})`),Si=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),Z=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,Et=/\u001B\[(\d+(?:;\d+)*)?m[^\u001B]*(?:\u001B\[(?:\d+(?:;\d+)*)?m|$)/g,Rt=/\u001B\]8;[^\u0007\u001B]*(?:\u0007|\u001B\\)(.*?)\u001B\]8;;(?:\u0007|\u001B\\)/g,We=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Ie=yi();xi(e=>e.replace(Ie,""),"stripEmoji");var Oi=Object.defineProperty,Ai=S((e,t)=>Oi(e,"name",{value:t,configurable:!0}),"E$1"),ji=Object.defineProperty,Ci=Ai((e,t)=>ji(e,"name",{value:t,configurable:!0}),"A"),Ei=Object.defineProperty,Ue=Ci((e,t)=>Ei(e,"name",{value:t,configurable:!0}),"d");const It=new Map,Se=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,ke=Ue(e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other","getCharType"),Ri=Ue((e,t)=>{const r=Math.floor(e/65536),i=e%65536;let n=It.get(r);if(n||(n=new Map,It.set(r,n)),n.has(i))return n.get(i);let s;if(ke(e)==="latin")s=t.width.regular;else if(ke(e)==="control")s=t.width.control;else if(ke(e)==="wide")s=t.width.wide;else switch(ie(e)){case"ambiguous":{s=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{s=t.width.fullWidth;break}case"wide":{s=t.width.wide;break}default:s=t.width.regular}return n.set(i,s),s},"getCachedCharWidth"),Ii=Ue(e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,"isCombiningCharacter"),he=Ue((e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const r={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?he(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},i=Math.max(0,r.truncation.limit-r.truncation.ellipsisWidth),{length:n}=e,s=n>1e4;let o=0,a=0,l=n,c=!1;const h=e.includes("\x1B")||e.includes("");for(;o<n;){if(h&&(e[o]==="\x1B"||e[o]==="")){if(e.startsWith("\x1B]8;;",o)){const m="\x1B]8;;\x07",u=m.length,x=e.indexOf("\x07",o+5);if(x!==-1){const w=e.indexOf(m,x+1);if(w!==-1){const v=w+u,$=e.slice(x+1,w).replace(Z,""),B=he($,{ambiguousIsNarrow:r.width.ambiguousIsNarrow,ansiWidth:r.width.ansi,controlWidth:r.width.control,countAnsiEscapeCodes:!1,ellipsis:r.truncation.ellipsis,ellipsisWidth:r.truncation.ellipsisWidth,emojiWidth:r.width.emoji,fullWidth:r.width.fullWidth,halfWidth:r.width.halfWidth,limit:Math.max(0,i-a),regularWidth:r.width.regular,tabWidth:r.width.tab,wideWidth:r.width.wide}),O=B.width;if(B.truncated)c=!0,l=Math.min(l,o);else if(a+O>i&&(l=Math.min(l,o),c=!0,a+O>r.truncation.limit))break;if(a+=O,o=v,c&&a>=r.truncation.limit)break;continue}}}if(Z.lastIndex=o,Z.test(e)){const m=Z.lastIndex-o,u=r.truncation.countAnsiEscapeCodes?m:r.width.ansi;if(a+u>i&&(l=Math.min(l,o),a+u>r.truncation.limit)){c=!0;break}a+=u,o=Z.lastIndex;continue}}const b=e.codePointAt(o);if(b===8203||b===65279||b>=8288&&b<=8292){o+=1;continue}if(b===9){if(a+r.width.tab>i&&(l=Math.min(l,o),a+r.width.tab>r.truncation.limit)){c=!0;break}a+=r.width.tab,o+=1;continue}if(Se.lastIndex=o,Se.test(e)){const m=(Se.lastIndex-o)*r.width.regular;if(a+m>i){const u=Math.floor((i-a)/r.width.regular);if(l=Math.min(l,o+u),a+m>r.truncation.limit){c=!0;break}}a+=m,o=Se.lastIndex;continue}if((b<=31||b>=127&&b<=159)&&(We.lastIndex=o,We.test(e))){const m=(We.lastIndex-o)*r.width.control;if(a+m>i&&(l=Math.min(l,o+Math.floor((i-a)/r.width.control)),a+m>r.truncation.limit)){c=!0;break}a+=m,o=We.lastIndex;continue}if(Ie.lastIndex=o,Ie.test(e)){if(a+r.width.emoji>i&&(l=Math.min(l,o),a+r.width.emoji>r.truncation.limit)){c=!0;break}a+=r.width.emoji,o=Ie.lastIndex;continue}const f=e.codePointAt(o)??0;if(Ii(f)){o+=f>65535?2:1;continue}let g;if(s)g=Ri(f,r);else switch(ke(f)){case"control":{g=r.width.control;break}case"latin":{g=r.width.regular;break}case"wide":{g=r.width.wide;break}case"zero":{g=0;break}default:switch(ie(f)){case"ambiguous":{g=r.width.ambiguousIsNarrow?r.width.regular:r.width.wide;break}case"fullwidth":{g=r.width.fullWidth;break}case"wide":{g=r.width.wide;break}default:g=r.width.regular}}if(a+g>i&&(l=Math.min(l,o),a+g>r.truncation.limit)){c=!0;break}a+=g,o+=f>65535?2:1}let d=a,p=!1;return c&&r.truncation.limit>=r.truncation.ellipsisWidth&&(d=r.truncation.limit,p=!0),{ellipsed:p,index:c?l:n,truncated:c,width:d}},"getStringTruncatedWidth");var ki=Object.defineProperty,Ni=S((e,t)=>ki(e,"name",{value:t,configurable:!0}),"i$2"),Pi=Object.defineProperty,Mi=Ni((e,t)=>Pi(e,"name",{value:t,configurable:!0}),"e"),Ti=Object.defineProperty,Fi=Mi((e,t)=>Ti(e,"name",{value:t,configurable:!0}),"r");const I=Fi((e,t={})=>he(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var Li=Object.defineProperty,lr=S((e,t)=>Li(e,"name",{value:t,configurable:!0}),"i$1"),_i=Object.defineProperty,cr=lr((e,t)=>_i(e,"name",{value:t,configurable:!0}),"r"),Hi=Object.defineProperty,Gi=cr((e,t)=>Hi(e,"name",{value:t,configurable:!0}),"c");let Ji=class{static{A(this,"Oi")}static{J(this,"Ii")}static{S(this,"l")}static{lr(this,"y")}static{cr(this,"s")}static{Gi(this,"LRUCache")}capacity;cache;keyOrder;constructor(e){this.capacity=e,this.cache=new Map,this.keyOrder=[]}get(e){if(this.cache.has(e))return this.keyOrder=this.keyOrder.filter(t=>t!==e),this.keyOrder.push(e),this.cache.get(e)}has(e){return this.cache.has(e)}set(e,t){if(this.cache.has(e))this.keyOrder=this.keyOrder.filter(r=>r!==e);else if(this.cache.size>=this.capacity){const r=this.keyOrder.shift();r!==void 0&&this.cache.delete(r)}this.cache.set(e,t),this.keyOrder.push(e)}delete(e){this.cache.delete(e),this.keyOrder=this.keyOrder.filter(t=>t!==e)}clear(){this.cache.clear(),this.keyOrder=[]}size(){return this.cache.size}};var Vi=Object.defineProperty,qi=S((e,t)=>Vi(e,"name",{value:t,configurable:!0}),"S$1"),zi=Object.defineProperty,Di=qi((e,t)=>zi(e,"name",{value:t,configurable:!0}),"w"),Ui=Object.defineProperty,pe=Di((e,t)=>Ui(e,"name",{value:t,configurable:!0}),"y");const kt=new Ji(100),Yi=new Intl.Segmenter("en",{granularity:"grapheme"}),Ki=/^[\u0000-\u007F]*$/,Zi=new Set(["0","22","23","24","27","28","29","39","49"]),Xi=new Set(["1","3","4","7","8","9"]),Nt=new Map([["22","1"],["23","3"],["24","4"],["27","7"],["28","8"],["29","9"]]),Oe=pe(e=>e>="30"&&e<="37"||e>="90"&&e<="97"||e.startsWith("38;"),"isForegroundColor"),Ae=pe(e=>e>="40"&&e<="47"||e>="100"&&e<="107"||e.startsWith("48;"),"isBackgroundColor"),Qi=[{close:"\x1B[22m",open:"\x1B[1m"},{close:"\x1B[23m",open:"\x1B[3m"},{close:"\x1B[24m",open:"\x1B[4m"},{close:"\x1B[27m",open:"\x1B[7m"},{close:"\x1B[28m",open:"\x1B[8m"},{close:"\x1B[29m",open:"\x1B[9m"}],Pt=pe((e,t)=>{let r=-1;for(const i of t){const n=e.indexOf(i);n!==-1&&(r===-1||n<r)&&(r=n)}return r},"findFirstPositionOfAny"),en=pe((e,t)=>{if(!e.includes("\x1B"))return[{after:"",before:"",content:e,visibleLength:I(e,t.width)}];const r=kt.get(e);if(r)return r;const i=[],n=[];let s=0,o;for(Z.lastIndex=0;(o=Z.exec(e))!==null;){const h=o[0];i.push(e.slice(s,o.index)),n.push(h),s=o.index+h.length}s<e.length&&i.push(e.slice(s));const a=[];for(const h of n){if(h==="\x1B[0m"||h==="\x1B]8;;\x07"){a.push(h);continue}if(h.startsWith("\x1B[")&&h.endsWith("m")){const d=h.slice(2,-1);if(Zi.has(d)){a.push(h);continue}}}const l=new Set,c=[];for(const[h,d]of i.entries()){if(h>0&&n[h-1]){const f=n[h-1];if(f==="\x1B[0m")l.clear();else if(f==="\x1B]8;;\x07"){for(const g of l)if(g.startsWith("\x1B]8;;")&&!g.endsWith("\x1B]8;;\x07")){l.delete(g);break}}else if(f.startsWith("\x1B[")&&f.endsWith("m")){const g=f.slice(2,-1);if(g==="39"){for(const m of l)if(m.startsWith("\x1B[")&&m.endsWith("m")){const u=m.slice(2,-1);if(Oe(u)){l.delete(m);break}}}else if(g==="49"){for(const m of l)if(m.startsWith("\x1B[")&&m.endsWith("m")){const u=m.slice(2,-1);if(Ae(u)){l.delete(m);break}}}else if(Nt.has(g)){const m=Nt.get(g);for(const u of l)if(u===`\x1B[${m}m`){l.delete(u);break}}else{if(Oe(g)){for(const m of l)if(m.startsWith("\x1B[")&&m.endsWith("m")){const u=m.slice(2,-1);if(Oe(u)){l.delete(m);break}}}else if(Ae(g)){for(const m of l)if(m.startsWith("\x1B[")&&m.endsWith("m")){const u=m.slice(2,-1);if(Ae(u)){l.delete(m);break}}}else if(Xi.has(g)){const m=`\x1B[${g}m`;l.has(m)&&l.delete(m)}l.add(f)}}else if(f.startsWith("\x1B]8;;")&&!f.endsWith("\x1B]8;;\x07")){for(const g of l)if(g.startsWith("\x1B]8;;")&&!g.endsWith("\x1B]8;;\x07")){l.delete(g);break}l.add(f)}}if(d==="")continue;let p="";if(l.size>0)if(a.includes("\x1B[0m"))p="\x1B[0m";else{const f=[];let g=!1;for(const w of l)if(w.startsWith("\x1B]8;;")&&!w.endsWith("\x1B]8;;\x07")){g=!0;break}g&&a.includes("\x1B]8;;\x07")&&f.push("\x1B]8;;\x07");let m=!1,u=!1;for(const w of l)if(w.startsWith("\x1B[")&&w.endsWith("m")){const v=w.slice(2,-1);Oe(v)?m=!0:Ae(v)&&(u=!0)}if(m&&u){const w=Pt(e,["\x1B[3","\x1B[9","\x1B[38;"]),v=Pt(e,["\x1B[4","\x1B[10","\x1B[48;"]);w>=0&&v>=0?w>v?f.push("\x1B[39m","\x1B[49m"):f.push("\x1B[49m","\x1B[39m"):f.push("\x1B[39m","\x1B[49m")}else m&&f.push("\x1B[39m"),u&&f.push("\x1B[49m");m&&u&&e.includes("\x1B[39m")&&e.includes("\x1B[49m")&&(e.indexOf("\x1B[39m")<e.indexOf("\x1B[49m")?(f.length-=2,f.push("\x1B[39m","\x1B[49m")):e.indexOf("\x1B[49m")<e.indexOf("\x1B[39m")&&(f.length-=2,f.push("\x1B[49m","\x1B[39m")));const x=Qi.filter(w=>l.has(w.open)).map(w=>({position:e.indexOf(w.open),style:w})).filter(w=>w.position>=0).toSorted((w,v)=>v.position-w.position);for(const w of x){const v=w;a.includes(v.style.close)&&f.push(v.style.close)}p=f.join("")}const b=[...l].join("");c.push({after:p,before:b,content:d,visibleLength:I(d,{fullWidth:1,wideWidth:1})})}return kt.set(e,c),c},"processIntoStyledSegments"),tn=pe((e,t,r,i)=>{const n=[...i.segmenter.segment(e)],s=[];let o=0,a=!1;for(const l of n){const c=I(l.segment,i.width),h=o,d=o+c;if(!a)if(h<t){o=d;continue}else a=!0;if(h>=r||d>r)break;s.push(l.segment),o=d}return s.join("")},"fastSlice"),z=pe((e,t=0,r=Number.MAX_SAFE_INTEGER,i={})=>{const n={segmenter:Yi,...i};if(t>=r||e==="")return"";const s=I(e,n.width);if(t===0&&r>=s)return e;if(t<0||r<0)throw new RangeError("Negative indices aren't supported");if(!e.includes("\x1B"))return Ki.test(e)?e.slice(t,r):tn(e,t,r,n);if(Et.lastIndex=0,Rt.lastIndex=0,!Et.test(e)&&!Rt.test(e))return e;const o=en(e,n);if(o.length===0)return"";let a=0;const l=[];for(const[d,p]of o.entries()){const b=a,f=a+p.visibleLength;if(f>t&&b<r){const g=Math.max(0,t-b),m=Math.min(p.visibleLength,r-b);l.push({end:m,index:d,segment:p,start:g})}a=f}if(l.length===0)return"";const c=[],h=l[0].segment;c.push(h.before);for(let d=0;d<l.length;d++){const{end:p,segment:b,start:f}=l[d];if(f===0&&p===b.visibleLength)c.push(b.content);else{const g=[...n.segmenter.segment(b.content)];c.push(g.slice(f,p).map(m=>m.segment).join(""))}if(d<l.length-1){const g=l[d+1].segment,m=b.after,u=g.before;m!==u&&(m||u)&&c.push(m,u)}}return c.push(l.at(-1).segment.after),c.join("")},"slice");var rn=Object.defineProperty,nn=S((e,t)=>rn(e,"name",{value:t,configurable:!0}),"x"),on=Object.defineProperty,sn=nn((e,t)=>on(e,"name",{value:t,configurable:!0}),"T"),an=Object.defineProperty,Ye=sn((e,t)=>an(e,"name",{value:t,configurable:!0}),"f");const Mt="…",ln=3,je=Ye((e,t,r=!1)=>{if(e.charAt(t)===" ")return t;const i=r?1:-1,n=Math.min(ln,r?e.length-t:t);for(let s=1;s<=n;s++){const o=t+s*i;if(e.charAt(o)===" ")return o}return t},"findNearestSpace"),Ce=Ye((e,t,r)=>he(e,{...r,ellipsis:"",ellipsisWidth:0,limit:t}).index,"widthToIndex"),Ee=Ye((e,t,r)=>I(e.slice(0,t),r),"indexToWidth"),Tt=Ye((e,t,r={})=>{if(typeof e!="string")throw new TypeError(`Expected \`input\` to be a string, got ${typeof e}`);if(typeof t!="number")throw new TypeError(`Expected \`limit\` to be a number, got ${typeof t}`);if(e===""||t<=0)return"";const i=e.normalize("NFC"),{ellipsis:n=Mt,position:s="end",preferTruncationOnSpace:o=!1}=r;let a=r.ellipsisWidth??n===Mt?1:void 0;a??=he(n,{...r.width,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width;const{width:l}=he(i,{...r.width,ellipsis:n,ellipsisWidth:a});if(l<=t)return i;switch(s){case"end":{if(o){const c=t-a,h=Ce(i,c,r.width),d=je(i,h),p=Ee(i,d,r.width);return z(i,0,p,{width:r.width})+n}return z(i,0,t-a,{width:r.width})+n}case"middle":{const c=Math.floor(t/2),h=Math.max(0,t-a),d=Math.min(c,h),p=Math.max(0,h-d);if(o){const b=Ce(i,d,r.width),f=je(i,b),g=Ee(i,f,r.width),m=l-p,u=Ce(i,m,r.width),x=je(i,u,!0),w=Ee(i,x,r.width);return z(i,0,g,{width:r.width})+n+z(i,w,l,{width:r.width}).trim()}return z(i,0,d,{width:r.width})+n+z(i,l-p,l,{width:r.width})}case"start":{if(o){const c=l-t+a,h=Ce(i,c,r.width),d=je(i,h,!0),p=Ee(i,d,r.width);return n+z(i,p,l,{width:r.width}).trim()}return n+z(i,l-t+a,l,{width:r.width})}default:throw new Error(`Invalid position: expected 'start', 'middle' or 'end', got '${s}'`)}},"truncate");var cn=Object.defineProperty,hr=S((e,t)=>cn(e,"name",{value:t,configurable:!0}),"b$2"),hn=Object.defineProperty,ne=hr((e,t)=>hn(e,"name",{value:t,configurable:!0}),"d"),dn=Object.defineProperty,un=ne((e,t)=>dn(e,"name",{value:t,configurable:!0}),"a");const fn=/\x1B\[(\d+)m/;class dr{static{A(this,"me")}static{J(this,"dt")}static{S(this,"T")}static{hr(this,"T")}static{ne(this,"d")}static{un(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const r=fn.exec(t);if(!r)return;const i=Number.parseInt(r[1],10);switch(i){case 0:{this.activeForeground=void 0,this.activeBackground=void 0,this.activeFormatting=[];break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}default:if(i>=30&&i<=37||i>=90&&i<=97)this.activeForeground=t;else if(i>=40&&i<=47||i>=100&&i<=107)this.activeBackground=t;else if([1,2,3,4,7,8,9].includes(i))this.activeFormatting.push(t);else if([22,23,24,27,28,29].includes(i)){const n={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[i];n&&(this.activeFormatting=this.activeFormatting.filter(s=>!s.includes(n)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const t=[];if(this.activeFormatting.length>0){const r={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].toReversed().forEach(i=>{const n=r[i];n&&t.push(n)})}return this.activeForeground&&t.push("\x1B[39m"),this.activeBackground&&t.push("\x1B[49m"),t.join("")}}var pn=Object.defineProperty,ur=ne((e,t)=>pn(e,"name",{value:t,configurable:!0}),"o");const fr=ur((e,t)=>{if(!fe.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const r=!0,i=e.slice(t+1,t+1+Le.length).join("")===Le;return{isInsideEscape:r,isInsideLinkEscape:i}},"checkEscapeSequence"),mn=ur((e,t={})=>{const r=new dr;let i="",n=!1,s="",o="",a=!1;const l=[...e];for(let c=0;c<l.length;c++){const h=l[c];if(h&&fe.has(h)){if(i){const g=t.getWidth?.(i)??0,m={isEscapeSequence:!1,isGrapheme:!0,text:i,width:g};if(a&&(m.isHyperlink=!0,m.hyperlinkUrl=o),t.onSegment?.(m,r)===!1)return;i=""}n=!0,s=h;const b=fr(l,c),{isInsideLinkEscape:f}=b;if(f){let g=c+1;for(o="";g<l.length;){const u=l[g];if(u===De)break;o+=u,g+=1}o=o.slice(4);const m={hyperlinkUrl:o,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(m,r)===!1)return;c=g,a=!0,n=!1,s="";continue}if(c+1<l.length&&l[c+1]==="\\"&&a){const g={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.(g,r)===!1)return;a=!1,o="",c+=1,n=!1,s="";continue}}if(n){if(s!==h&&(s+=h),h===Bt){n=!1,r.processEscape(s);const b={isEscapeSequence:!0,isGrapheme:!1,text:s,width:0};if(t.onSegment?.(b,r)===!1)return;s=""}continue}i+=h;const d=t.getWidth?.(i)??0,p={isEscapeSequence:!1,isGrapheme:!0,text:i,width:d};if(a&&(p.isHyperlink=!0,p.hyperlinkUrl=o),t.onSegment?.(p,r)===!1)return;i=""}if(i){const c=t.getWidth?.(i)??0,h={isEscapeSequence:!1,isGrapheme:!0,text:i,width:c};a&&(h.isHyperlink=!0,h.hyperlinkUrl=o),t.onSegment?.(h,r)}if(s){const c={isEscapeSequence:!0,isGrapheme:!1,text:s,width:0};t.onSegment?.(c,r)}},"processAnsiString");var gn=Object.defineProperty,bn=ne((e,t)=>gn(e,"name",{value:t,configurable:!0}),"t$1");const Ft=bn(e=>`${fe.values().next().value}${ar}${String(e)}${Bt}`,"wrapAnsiCode");var wn=Object.defineProperty,yn=ne((e,t)=>wn(e,"name",{value:t,configurable:!0}),"s");const Lt=yn(e=>`${fe.values().next().value}${Le}${e}${De}`,"wrapAnsiHyperlink");var vn=Object.defineProperty,xn=ne((e,t)=>vn(e,"name",{value:t,configurable:!0}),"l");const $n=xn(e=>{if(e.length===0)return"";if(e.length===1)return e[0];let t="",r,i;const n=e.join(`
|
|
2
2
|
`),s=[...n];let o=0;for(const[a,l]of s.entries()){if(t+=l,fe.has(l)){const h=Wi.exec(n.slice(o))?.groups??{};if(h.code!==void 0){const d=Number.parseFloat(h.code);r=d===$i?void 0:d}else h.uri!==void 0&&(i=h.uri.length===0?void 0:h.uri)}const c=Si.get(Number(r));s[a+1]===`
|
|
3
3
|
`?(i&&(t+=Lt("")),r&&c&&(t+=Ft(c))):l===`
|
|
4
4
|
`&&(r&&c&&(t+=Ft(r)),i&&(t+=Lt(i))),o+=l.length}return t},"preserveAnsi");var Bn=Object.defineProperty,Y=ne((e,t)=>Bn(e,"name",{value:t,configurable:!0}),"f");const pr=/(?=\s)|(?<=\s)/,mr=/^\s+$/,nt=Y(e=>{if(!e.includes("\x1B"))return e;let t=e;return e.includes("\x1B[30m")&&(t+="\x1B[39m"),e.includes("\x1B[42m")&&(t+="\x1B[49m"),t},"resetAnsiAtLineBreak"),Q=Y(e=>{const t=e.split(" ");let r=t.length;for(;r>0&&I(t[r-1])===0;)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},"stringVisibleTrimSpacesRight"),gr=Y((e,t,r)=>{if(e.length===0)return[""];if(t<=0)return[e];const i=[],n=new dr;let s="",o=0,a=!1,l=!1,c="",h=0;for(;h<e.length;){const d=e[h];if(fe.has(d)){a=!0,c=d,s+=d,l=fr([...e],h).isInsideLinkEscape,h+=1;continue}if(a){c+=d,s+=d,l?d===De&&(a=l=!1):d===Bt&&(a=!1,n.processEscape(c)),h+=1;continue}const p=I(d),b=d===" ";if(p===0){s+=d,h+=1;continue}if(o+p>t&&(s&&i.push(s+n.getEndEscapesForAllActiveAttributes()),s=n.getStartEscapesForAllActiveAttributes(),o=I(s),b&&r)){for(;h<e.length&&e[h]===" ";)h+=1;continue}if(s+=d,o+=p,o===t&&h<e.length-1&&(i.push(s+n.getEndEscapesForAllActiveAttributes()),s=n.getStartEscapesForAllActiveAttributes(),o=I(s),h+1<e.length&&e[h+1]===" "&&r)){for(h+=1;h<e.length&&e[h]===" ";)h+=1;continue}h+=1}return s&&i.push(s+n.getEndEscapesForAllActiveAttributes()),r?i.map(d=>Q(d)):i},"wrapWithBreakAtWidth"),Wn=Y((e,t,r)=>{if(e.length===0)return[];const i=r?e.trim():e;if(i.length===0)return[];const n=[];let s="",o=0;return mn(i,{getWidth:I,onSegment:Y((a,l)=>{const c=a.text??"";if(a.isEscapeSequence)s+=c;else{const h=c===" ";if(a.width===0)return s+=c,!0;if(o+a.width>t&&(s&&n.push(s),s=l.getStartEscapesForAllActiveAttributes(),o=0,h))return r||n.push(l.getStartEscapesForAllActiveAttributes()+c),!0;s+=c,o+=a.width}return!0},"onSegment")}),s&&n.push(s),r?n.map(a=>Q(a)):n},"wrapCharByChar"),Sn=Y((e,t,r)=>{if(e.length===0)return[];const i=r?e.trim():e;if(i.length===0)return[];const n=i.split(pr),s=[];let o="",a=0,l=0;for(;l<n.length;){const c=n[l],h=mr.test(c),d=I(c);if(c.length===0){l+=1;continue}if(r&&h&&a===0){l+=1;continue}if(a+d>t&&a>0){r?s.push(Q(o)):s.push(o),o="",a=0;continue}o+=c,a+=d,l+=1}return o&&(r?s.push(Q(o)):s.push(o)),s},"wrapWithWordBoundaries"),On=Y((e,t,r)=>{if(e.length===0)return[];const i=r?e.trim():e;if(i.length===0)return[];const n=i.split(pr),s=[];let o="",a=0,l=0;for(;l<n.length;){const c=n[l],h=mr.test(c),d=I(c);if(c.length===0){l+=1;continue}if(r&&h&&a===0){l+=1;continue}if(d>t){o&&s.push(nt(r?Q(o):o));const p=gr(c,t,r);if(p.length>0){for(let b=0;b<p.length-1;b+=1)s.push(p[b]);o=p.at(-1),a=I(o)}else o="",a=0;l+=1;continue}if(a+d>t&&a>0&&(s.push(nt(r?Q(o):o)),o="",a=0,r&&h)){l+=1;continue}o+=c,a+=d,l+=1}return o&&s.push(nt(r?Q(o):o)),s},"wrapAndBreakWords"),Re={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},An=Y((e,t={})=>{const{removeZeroWidthCharacters:r=!0,trim:i=!0,width:n=80,wrapMode:s=Re.PRESERVE_WORDS}=t;if(i&&e.trim()==="")return"";let o=e.normalize("NFC").replaceAll(`\r
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var Te=Object.defineProperty;var w=(e,t)=>Te(e,"name",{value:t,configurable:!0});import{createRequire as ze}from"node:module";import{walkSync as Be,readFileSync as I}from"@visulima/fs";import{readYamlSync as Ie}from"@visulima/fs/yaml";import{z as he,M as me}from"../packem_shared/index-OlP7U_t5.js";import{p as Ne,aN as qe}from"./bin.js";const Me=ze(import.meta.url),z=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Fe=w(e=>{if(typeof z<"u"&&z.versions&&z.versions.node){const[t,r]=z.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return z.getBuiltinModule(e)}return Me(e)},"__cjs_getBuiltinModule"),{createRequire:Ge}=Fe("node:module");var De=Object.defineProperty,Ke=w((e,t)=>De(e,"name",{value:t,configurable:!0}),"p$6"),Qe=Object.defineProperty,de=Ke((e,t)=>Qe(e,"name",{value:t,configurable:!0}),"e"),Ve=Object.defineProperty,He=de((e,t)=>Ve(e,"name",{value:t,configurable:!0}),"E");const ge=String.raw,re=ge`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Je=He(()=>new RegExp(ge`\p{RI}{2}|(?)${re}(?:\u200D${re})*`,"gu"),"default");var Ye=Object.defineProperty,Xe=de((e,t)=>Ye(e,"name",{value:t,configurable:!0}),"p");Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]]));const T=Je(),Ze=/[-_./\s]+/g,L=/(\u001B\[[0-9;]*[a-z])/i,ne=new RegExp("\\p{Script=Arabic}","u"),et=new RegExp("\\p{Script=Bengali}","u"),_=new RegExp("\\p{Script=Cyrillic}","u"),tt=new RegExp("\\p{Script=Devanagari}","u"),rt=new RegExp("\\p{Script=Ethiopic}","u"),Q=new RegExp("\\p{Script=Greek}","u"),ae=new RegExp("\\p{Script=Greek}+|\\p{Script=Latin}+|[^\\p{Script=Greek}\\p{Script=Latin}]+","gu"),nt=new RegExp("\\p{Script=Gujarati}","u"),at=new RegExp("\\p{Script=Gurmukhi}","u"),ie=new RegExp("\\p{Script=Hangul}","u"),se=new RegExp("\\p{Script=Hebrew}","u"),it=new RegExp("\\p{Script=Hiragana}","u"),oe=new RegExp("\\p{Script=Han}","u"),st=new RegExp("\\p{Script=Kannada}","u"),ot=new RegExp("\\p{Script=Katakana}","u"),lt=new RegExp("\\p{Script=Khmer}","u"),ct=new RegExp("\\p{Script=Lao}","u"),O=new RegExp("\\p{Script=Latin}","u"),ut=new RegExp("\\p{Script=Malayalam}","u"),pt=new RegExp("\\p{Script=Myanmar}","u"),ft=new RegExp("\\p{Script=Oriya}","u"),ht=new RegExp("\\p{Script=Sinhala}","u"),mt=new RegExp("\\p{Script=Tamil}","u"),dt=new RegExp("\\p{Script=Telugu}","u"),gt=new RegExp("\\p{Script=Thai}","u"),yt=new RegExp("\\p{Script=Tibetan}","u"),le=/[\u02BB\u02BC\u0027]/u,bt=Xe(e=>e.replace(T,""),"stripEmoji");var $t=Object.defineProperty,ye=w((e,t)=>$t(e,"name",{value:t,configurable:!0}),"i$5"),vt=Object.defineProperty,be=ye((e,t)=>vt(e,"name",{value:t,configurable:!0}),"r"),wt=Object.defineProperty,jt=be((e,t)=>wt(e,"name",{value:t,configurable:!0}),"c");let W=class{static{w(this,"l")}static{ye(this,"y")}static{be(this,"s")}static{jt(this,"LRUCache")}capacity;cache;keyOrder;constructor(t){this.capacity=t,this.cache=new Map,this.keyOrder=[]}get(t){if(this.cache.has(t))return this.keyOrder=this.keyOrder.filter(r=>r!==t),this.keyOrder.push(t),this.cache.get(t)}has(t){return this.cache.has(t)}set(t,r){if(this.cache.has(t))this.keyOrder=this.keyOrder.filter(n=>n!==t);else if(this.cache.size>=this.capacity){const n=this.keyOrder.shift();n!==void 0&&this.cache.delete(n)}this.cache.set(t,r),this.keyOrder.push(t)}delete(t){this.cache.delete(t),this.keyOrder=this.keyOrder.filter(r=>r!==t)}clear(){this.cache.clear(),this.keyOrder=[]}size(){return this.cache.size}};var Et=Object.defineProperty,Ot=w((e,t)=>Et(e,"name",{value:t,configurable:!0}),"r$6"),kt=Object.defineProperty,xt=Ot((e,t)=>kt(e,"name",{value:t,configurable:!0}),"a"),Ct=Object.defineProperty,St=xt((e,t)=>Ct(e,"name",{value:t,configurable:!0}),"s");const Pt=St((e,t)=>typeof e!="string"||e===""?"":(t?.locale?e[0].toLocaleLowerCase(t.locale):e[0].toLowerCase())+e.slice(1),"lowerFirst");var At=Object.defineProperty,Lt=w((e,t)=>At(e,"name",{value:t,configurable:!0}),"I"),Wt=Object.defineProperty,q=Lt((e,t)=>Wt(e,"name",{value:t,configurable:!0}),"W");const Rt=Ge(import.meta.url),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_t=q(e=>{if(typeof M<"u"&&M.versions&&M.versions.node){const[t,r]=M.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return M.getBuiltinModule(e)}return Rt(e)},"__cjs_getBuiltinModule"),{stripVTControlCharacters:Ut}=_t("node:util");var Tt=Object.defineProperty,zt=q((e,t)=>Tt(e,"name",{value:t,configurable:!0}),"g");const V=new W(1e3),Mt=/[.*+?^${}()|[\]\\]/g,Ft=zt(e=>{const t=e.join("");if(V.has(t))return V.get(t);const r=e.map(a=>a.replaceAll(Mt,String.raw`\$&`)).join("|"),n=new RegExp(r,"g");return V.set(t,n),n},"getSeparatorsRegex");var Bt=Object.defineProperty,It=q((e,t)=>Bt(e,"name",{value:t,configurable:!0}),"t");const Nt=It(e=>{const t=[];let r=0,n;for(T.lastIndex=0;(n=T.exec(e))!==null;)n.index>r&&t.push(e.slice(r,n.index)),t.push(n[0]),r=T.lastIndex;return r<e.length&&t.push(e.slice(r)),t.filter(Boolean)},"splitByEmoji");var qt=Object.defineProperty,$=q((e,t)=>qt(e,"name",{value:t,configurable:!0}),"u");const Gt=/[ČŠŽĐ]/i,$e=new Uint8Array(128),ve=new Uint8Array(128),we=new Uint8Array(128);for(let e=0;e<128;e++)$e[e]=e>=65&&e<=90?1:0,ve[e]=e>=97&&e<=122?1:0,we[e]=e>=48&&e<=57?1:0;const H=$(e=>$e[e],"isUpper"),ce=$(e=>ve[e],"isLower"),J=$(e=>we[e],"isDigit"),A=$((e,t,r,n,a)=>{if(e.length===0)return[];let i=!1;const l=Object.values(t);for(const u of l)if(u(e[0])){i=!0;break}if(!i&&!r)return[e];const o=[...e],h=[];let s=o[0],f="other";const m=Object.entries(t);for(const u of m){const[p,g]=u;if(g(o[0])){f=p;break}}let c=r&&n?o[0]===o[0].toLocaleUpperCase(n):!1;for(let u=1;u<o.length;u++){const p=o[u];let g="other";for(const b of m){const[v,E]=b;if(E(p)){g=v;break}}const y=r&&n?p===p.toLocaleUpperCase(n):!1;let d=!1;a?d=a(f,g,c,y,p,u,o):(f!==g&&f!=="other"&&g!=="other"&&(d=!0),r&&g!=="other"&&!c&&y&&(d=!0)),d?(h.push(s),s=p):s+=p,f=g,r&&(c=y)}return s&&s.length>0&&h.push(s),h.length>0?h:[e]},"handleScriptTransitions"),Dt=$((e,t,r,n)=>{if(r.size===0)return t;for(const a of r)if(e.startsWith(a,t))return n.push(a),t+a.length;return t},"detectAndProcessAcronym"),je=$((e,t=new Set)=>{if(e.length===0)return[];if(e.toUpperCase()===e)return[e];let r=0;const n=[],a=e.length;for(let i=1;i<a;i++){const l=Dt(e,r,t,n);if(l!==r){r=l,i=r-1;continue}const o=e.codePointAt(i-1),h=e.codePointAt(i),s=o&&o<128&&H(o),f=h&&h<128&&H(h),m=o&&o<128&&ce(o),c=o&&o<128&&J(o),u=h&&h<128&&J(h);if(m&&f){n.push(e.slice(r,i)),r=i;continue}if(c&&!u||!c&&u){n.push(e.slice(r,i)),r=i;continue}if(u&&!c){let p=!1,g=!1;if(i+1<a){const y=e.codePointAt(i+1);p=y&&y<128&&H(y),g=y&&y<128&&J(y)}if(!g&&p){n.push(e.slice(r,i),e.slice(i,i+1)),r=i+1;continue}}if(i+1<a){const p=e.codePointAt(i+1),g=p&&p<128&&ce(p);if(s&&f&&g){const y=e.slice(r,i+1);t.has(y)||(n.push(e.slice(r,i)),r=i)}}}return r<a&&n.push(e.slice(r)),n.filter(i=>i!=="")},"splitCamelCaseFast"),Ee=$((e,t,r)=>{if(e.length===0)return[];const n=e===e.toLocaleUpperCase(t);if(t.startsWith("de")){if(!n&&e.replaceAll("ß","SS")===e.toLocaleUpperCase(t))return[e];const s=[...e],f=s.length,m=[];let c=s[0],u=s[0]===s[0].toLocaleUpperCase(t),p=u,g=u?0:-1;for(let y=1;y<f;y++){const d=s[y],b=d===d.toLocaleUpperCase(t);if(b===u)c+=d;else if(b)c&&c.length>0&&(m.push(c),c=d),p=!0,g=y;else{if(p&&y-g>1){const v=s[y-1],E=c.slice(0,-1);E&&E.length>0&&m.push(E),c=v+d}else c+=d;p=!1,g=-1}u=b}return c&&c.length>0&&m.push(c),m}if(t.startsWith("uk")||t.startsWith("ru")||t.startsWith("bg")||t.startsWith("sr")||t.startsWith("mk")||t.startsWith("be")){if(!_.test(e)&&!O.test(e))return[e];const s=[...e],f=s.length,m=[];let c=s[0];const u=s[0];let p;_.test(u)?p=1:O.test(u)?p=2:p=0;let g=u===u.toLocaleUpperCase(t);for(let d=1;d<f;d++){const b=s[d];let v;_.test(b)?v=1:O.test(b)?v=2:v=0;const E=b===b.toLocaleUpperCase(t);p!==v&&(p===1||p===2)&&(v===1||v===2)||v===p&&!g&&E?(m.push(c),c=b):c+=b,p=v,g=E}c&&c.length>0&&m.push(c);const y=[];for(let d=0;d<m.length;d++)d<m.length-1&&m[d].length===1&&O.test(m[d])&&_.test(m[d+1][0])?(y.push(m[d]+m[d+1]),d+=1):y.push(m[d]);return y}if(t.startsWith("el")){if(!Q.test(e)&&!O.test(e))return[e];const s=[];ae.lastIndex=0;let f;for(;(f=ae.exec(e))!==null;)s.push(f[0]);s.length===0&&s.push(e);const m=[];if(s.length===1){const c=s[0];if(!c||!Q.test(c[0])||c.length===1)return[c??e]}for(const c of s){if(!c)continue;if(!Q.test(c[0])||c.length===1){m.push(c);continue}const u=c.length;let p=c[0],g=c[0]===c[0].toLocaleUpperCase(t);for(let y=1;y<u;y++){const d=c[y],b=d===d.toLocaleUpperCase(t);!g&&b?(m.push(p),p=d):p+=d,g=b}p&&m.push(p)}return m}if(t.startsWith("ja")||t.startsWith("ko")){const s=t.startsWith("ja"),f=s?{hiragana:$(c=>it.test(c),"hiragana"),kanji:$(c=>oe.test(c),"kanji"),katakana:$(c=>ot.test(c),"katakana"),latin:$(c=>O.test(c),"latin")}:{hangul:$(c=>ie.test(c),"hangul"),latin:$(c=>O.test(c),"latin")},m=new Set(["が","で","と","に","の","は","へ","も","や","を"]);if(s){const c=A(e,f,!1,t,(p,g)=>p==="hiragana"&&g==="katakana"||p==="katakana"&&g==="hiragana"||p==="hiragana"&&g==="latin"||p==="katakana"&&g==="latin"||p==="kanji"&&g==="latin"||p==="latin"&&(g==="hiragana"||g==="katakana"||g==="kanji")),u=[];for(const p of c){const g=p;g.length===1&&m.has(g)&&u.length>0?u[u.length-1]=u.at(-1)+g:u.push(g)}return u.length>0?u:[e]}return A(e,f,!1,t,(c,u)=>c==="hangul"&&u==="latin"||c==="latin"&&u==="hangul")}if(t.startsWith("sl")){const s=[...e],f=s.length,m=[];let c=s[0],u=s[0]===s[0].toLocaleUpperCase(t);for(let p=1;p<f;p++){const g=s[p],y=g===g.toLocaleUpperCase(t),d=Gt.test(g),b=p<f-1&&s[p+1]===s[p+1].toLocaleUpperCase(t);!u&&y||d&&b?(m.push(c),c=g,d&&b&&(m.push(c),c="")):c+=g,u=y}return c&&c.length>0&&m.push(c),m}if(t.startsWith("zh"))return A(e,{han:$(s=>oe.test(s),"han"),latin:$(s=>O.test(s),"latin")},!1,t);if(["ar","fa","he","ur"].includes(t.split("-")[0])){const s=$(f=>se.test(f)||ne.test(f),"isRtlChar");return A(e,{latin:$(f=>O.test(f),"latin"),rtl:$(f=>s(f),"rtl")},!1,t)}if(["am","bn","gu","hi","km","kn","lo","ml","mr","ne","or","pa","si","ta","te","th"].includes(t.split("-")[0])){const s=$(f=>tt.test(f)||et.test(f)||nt.test(f)||at.test(f)||st.test(f)||mt.test(f)||dt.test(f)||ut.test(f)||ht.test(f)||gt.test(f)||ct.test(f)||yt.test(f)||pt.test(f)||rt.test(f)||lt.test(f)||ft.test(f),"isIndicChar");return A(e,{indic:$(f=>s(f),"indic"),latin:$(f=>O.test(f),"latin")},!1,t)}if(["be","bg","ru","sr","uk"].includes(t))return A(e,{cyrillic:$(s=>_.test(s),"cyrillic"),latin:$(s=>O.test(s),"latin")},!0,t);if(["ar","fa","he"].includes(t))return A(e,{latin:$(s=>O.test(s),"latin"),rtl:$(s=>se.test(s)||ne.test(s),"rtl")},!1,t);if(t.startsWith("ko"))return A(e,{hangul:$(s=>ie.test(s),"hangul"),latin:$(s=>O.test(s),"latin")},!1,t);if(t.startsWith("uz")){if(!_.test(e)&&!O.test(e))return[e];const s=[...e],f=s.length,m=[];let c=s[0],u=s[0]===s[0].toLocaleUpperCase(t);for(let p=1;p<f;p++){const g=s[p],y=g===g.toLocaleUpperCase(t);if(le.test(g)||le.test(s[p-1])){c+=g;continue}!u&&y?(m.push(c),c=g):c+=g,u=y}return c&&c.length>0&&m.push(c),m}const a=[...e],i=a.length,l=[];let o=a[0],h=a[0]===a[0].toLocaleUpperCase(t);for(const s of r)if(e.startsWith(s)){l.push(s),o=a[s.length],h=o===o.toLocaleUpperCase(t);break}for(let s=1;s<i;s++){const f=a[s],m=f===f.toLocaleUpperCase(t);let c=0;for(const u of r)if(e.startsWith(u,s)){l.push(o,u),c=u.length,o="";const p=u.at(-1);p&&(h=p===p.toLocaleUpperCase(t));break}if(c>0){s+=c-1;continue}!h&&m?(l.push(o),o=f):o+=f,h=m}return o&&l.push(o),l},"splitCamelCaseLocale"),Kt=$((e,t,r)=>{const n=[],a=L.test(e)?e.split(L).filter(Boolean):[e];for(const i of a){const l=i;if(L.test(l))n.push(l);else{const o=T.test(l)?Nt(l).filter(Boolean):[l];for(const h of o)if(T.test(h))n.push(h);else if(t){const s=t.toLowerCase().split("-")[0];n.push(...Ee(h,s,r))}else n.push(...je(h,r))}}return n},"processTextWithAnsiEmoji"),G=$((e,t={})=>{if(!e||typeof e!="string")return[];const{handleAnsi:r=!1,handleEmoji:n=!1,knownAcronyms:a=[],locale:i,normalize:l=!1,separators:o,stripAnsi:h=!1,stripEmoji:s=!1}=t,f=new Set([...a].toSorted((d,b)=>b.length-d.length));let m=e;h&&(m=Ut(m)),s&&(m=bt(m));let c;Array.isArray(o)?c=Ft(o):o instanceof RegExp?c=o:c=Ze;const u=[];let p=m;const g=c.flags.includes("g")?c:new RegExp(c.source,`${c.flags}g`);for(;p.length>0;){const d=g.exec(p);if(!d){p===".."?u.push(".."):p==="."?u.push("."):p.length>0&&u.push(p);break}const b=d.index,v=d[0],E=v.length,B=p.slice(0,b),Ue=p.slice(b+E);if(v.startsWith("../"))u.push(".."),p=p.slice(b+3);else if(v.startsWith("./"))u.push("."),p=p.slice(b+2);else if(b===0&&v==="..")u.push(".."),p=p.slice(2);else if(b===0&&v===".")u.push("."),p=p.slice(1);else{B.length>0&&u.push(B);let S=0;for(;(S=v.indexOf("../",S))!==-1;)u.push(".."),S+=3;for(S=0;(S=v.indexOf("./",S))!==-1;)(S===0||v[S-1]!==".")&&u.push("."),S+=2;let P=Ue;for(;P.startsWith("../");)u.push(".."),P=P.slice(3);for(;P.startsWith("./");)u.push("."),P=P.slice(2);if(P===".."){u.push("..");break}else if(P==="."){u.push(".");break}else p=P}g.lastIndex=0}if(u.length===0){const d=m.split(c).filter(Boolean);u.push(...d)}let y=[];for(const d of u)r||n?y.push(...Kt(d,i,f)):i?y.push(...Ee(d,i,f)):y.push(...je(d,f));return l&&(y=y.map(d=>f.has(d)?d:i&&d===d.toLocaleUpperCase(i)?d[0]+d.slice(1).toLocaleLowerCase(i):d.toUpperCase()===d&&!f.has(d)?d.slice(0,1)+d.slice(1).toLowerCase():d)),y},"splitByCase");var Qt=Object.defineProperty,Vt=w((e,t)=>Qt(e,"name",{value:t,configurable:!0}),"r$5"),Ht=Object.defineProperty,Jt=Vt((e,t)=>Ht(e,"name",{value:t,configurable:!0}),"o"),Yt=Object.defineProperty,Xt=Jt((e,t)=>Yt(e,"name",{value:t,configurable:!0}),"s");const Z=Xt((e,t)=>typeof e!="string"||e===""?"":(t?.locale?e[0].toLocaleUpperCase(t.locale):e[0].toUpperCase())+e.slice(1),"upperFirst");var Zt=Object.defineProperty,er=w((e,t)=>Zt(e,"name",{value:t,configurable:!0}),"r$4"),tr=Object.defineProperty,rr=er((e,t)=>tr(e,"name",{value:t,configurable:!0}),"r"),nr=Object.defineProperty,ar=rr((e,t)=>nr(e,"name",{value:t,configurable:!0}),"n");const D=ar((e,t)=>`${e}::${t?.joiner??""}::${t?.locale??""}::${t?.knownAcronyms?.join(",")??""}::${t?.normalize?"true":"false"}`,"generateCacheKey");var ir=Object.defineProperty,sr=w((e,t)=>ir(e,"name",{value:t,configurable:!0}),"i$3"),or=Object.defineProperty,lr=sr((e,t)=>or(e,"name",{value:t,configurable:!0}),"f"),cr=Object.defineProperty,ur=lr((e,t)=>cr(e,"name",{value:t,configurable:!0}),"l");const K=ur((e,t)=>{const{length:r}=e;if(r===0)return"";if(r===1)return e[0];const n=[];let a="",i="";for(let l=0;l<r;l++){const o=e[l];if(L.test(o)){a?(n.push(a+i+o),a="",i=""):(n.length>0&&n.push(t),a=o);continue}a?(i&&(i+=t),i+=o):(n.length>0&&n.push(t),n.push(o))}return n.join("")},"joinSegments");var pr=Object.defineProperty,fr=w((e,t)=>pr(e,"name",{value:t,configurable:!0}),"r$3"),hr=Object.defineProperty,mr=fr((e,t)=>hr(e,"name",{value:t,configurable:!0}),"a"),dr=Object.defineProperty,gr=mr((e,t)=>dr(e,"name",{value:t,configurable:!0}),"e");const yr=/(?<![a-zß])SS(?![a-z])/g,ee=gr(e=>e.replaceAll(yr,"ß"),"normalizeGermanEszett");var br=Object.defineProperty,$r=w((e,t)=>br(e,"name",{value:t,configurable:!0}),"c$3"),vr=Object.defineProperty,wr=$r((e,t)=>vr(e,"name",{value:t,configurable:!0}),"c"),jr=Object.defineProperty,Er=wr((e,t)=>jr(e,"name",{value:t,configurable:!0}),"o");const Or=new W(1e3),kr=Er((e,t)=>{if(typeof e!="string"||!e)return"";const r=t?.cache??!1,n=t?.cacheStore??Or;let a;if(r&&(a=D(e,t)),r&&a&&n.has(a))return n.get(a);let i=!0;const l=K(G(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(o=>{if(t?.handleAnsi&&L.test(o))return o;const h=t?.locale?.startsWith("de")?ee(o):o,s=t?.locale?h.toLocaleLowerCase(t.locale):h.toLowerCase();return i?(i=!1,Pt(s,t)):Z(s,t)}),"");return r&&a&&n.set(a,l),l},"camelCase");var xr=Object.defineProperty,Cr=w((e,t)=>xr(e,"name",{value:t,configurable:!0}),"l$3"),Sr=Object.defineProperty,Pr=Cr((e,t)=>Sr(e,"name",{value:t,configurable:!0}),"l"),Ar=Object.defineProperty,Lr=Pr((e,t)=>Ar(e,"name",{value:t,configurable:!0}),"o");const Wr=new W(1e3),te=Lr((e,t)=>{if(typeof e!="string")return"";const r=t?.cache??!1,n=t?.cacheStore??Wr;let a;if(r&&(a=D(e,t)),r&&a&&n.has(a))return n.get(a);const i=G(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(o=>{if(t?.handleAnsi&&L.test(o))return o;if(t?.toUpperCase)return t.locale?o.toLocaleUpperCase(t.locale):o.toUpperCase();const h=t?.locale?.startsWith("de")?ee(o):o;return t?.locale?h.toLocaleLowerCase(t.locale):h.toLowerCase()}),l=K(i,t?.joiner??"-");return r&&a&&n.set(a,l),l},"kebabCase");var Rr=Object.defineProperty,_r=w((e,t)=>Rr(e,"name",{value:t,configurable:!0}),"r$2"),Ur=Object.defineProperty,Tr=_r((e,t)=>Ur(e,"name",{value:t,configurable:!0}),"a"),zr=Object.defineProperty,Mr=Tr((e,t)=>zr(e,"name",{value:t,configurable:!0}),"s");const Fr=new W(1e3),Br=Mr((e,t)=>te(e,{cacheStore:Fr,...t,joiner:"_",toUpperCase:!0}),"constantCase");var Ir=Object.defineProperty,Nr=w((e,t)=>Ir(e,"name",{value:t,configurable:!0}),"l$2"),qr=Object.defineProperty,Gr=Nr((e,t)=>qr(e,"name",{value:t,configurable:!0}),"l"),Dr=Object.defineProperty,Kr=Gr((e,t)=>Dr(e,"name",{value:t,configurable:!0}),"i");const Qr=new W(1e3),Vr=Kr((e,t)=>{if(typeof e!="string"||!e)return"";const r=t?.cache??!1,n=t?.cacheStore??Qr;let a;if(r&&(a=D(e,t)),r&&a&&n.has(a))return n.get(a);const i=K(G(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(l=>{if(t?.handleAnsi&&L.test(l))return l;const o=t?.locale?.startsWith("de")?ee(l):l;return Z(t?.locale?o.toLocaleLowerCase(t.locale):o.toLowerCase(),{locale:t?.locale})}),"");return r&&a&&n.set(a,i),i},"pascalCase");var Hr=Object.defineProperty,Jr=w((e,t)=>Hr(e,"name",{value:t,configurable:!0}),"r$1"),Yr=Object.defineProperty,Xr=Jr((e,t)=>Yr(e,"name",{value:t,configurable:!0}),"a"),Zr=Object.defineProperty,en=Xr((e,t)=>Zr(e,"name",{value:t,configurable:!0}),"s");const tn=new W(1e3),rn=en((e,t)=>te(e,{cacheStore:tn,...t,joiner:"_"}),"snakeCase");var nn=Object.defineProperty,an=w((e,t)=>nn(e,"name",{value:t,configurable:!0}),"r"),sn=Object.defineProperty,on=an((e,t)=>sn(e,"name",{value:t,configurable:!0}),"e"),ln=Object.defineProperty,cn=on((e,t)=>ln(e,"name",{value:t,configurable:!0}),"i");const un=new W(1e3),pn=cn((e,t)=>{if(typeof e!="string")return"";const r=t?.cache??!1,n=t?.cacheStore??un;let a;if(r&&(a=D(e,t)),r&&a&&n.has(a))return n.get(a);const i=K(G(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(l=>Z(l,{locale:t?.locale})),"-");return r&&a&&n.set(a,i),i},"trainCase");var fn=Object.defineProperty,k=w((e,t)=>fn(e,"name",{value:t,configurable:!0}),"e");const x=k(e=>e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"?String(e):JSON.stringify(e),"stringify"),Y={camel_case:k(e=>kr(x(e)),"camel_case"),kebab_case:k(e=>te(x(e)),"kebab_case"),lower_case:k(e=>x(e).toLowerCase(),"lower_case"),pascal_case:k(e=>Vr(x(e)),"pascal_case"),path_join:k((e,...t)=>{const r=[x(e),...t.map(n=>x(n))];return me(...r)},"path_join"),path_relative:k((e,t)=>he(x(t),x(e)),"path_relative"),snake_case:k(e=>rn(x(e)),"snake_case"),upper_case:k(e=>x(e).toUpperCase(),"upper_case"),upper_kebab_case:k(e=>pn(x(e)),"upper_kebab_case"),upper_snake_case:k(e=>Br(x(e)),"upper_snake_case")};k(e=>Object.hasOwn(Y,e),"isKnownFilter");const Oe=k((e,t,r=[])=>{const n=Y[e];if(!n)throw new Error(`Unknown filter "${e}". Known filters: ${Object.keys(Y).sort().join(", ")}.`);return n(t,...r)},"applyFilter");var hn=Object.defineProperty,ke=w((e,t)=>hn(e,"name",{value:t,configurable:!0}),"d$1");const xe=ke(e=>{const t=[];let r=0,n=0,a,i=-1;for(const l of e){if(i+=1,a){l===a&&(a=void 0);continue}if(l==='"'||l==="'"){a=l;continue}l==="("?r+=1:l===")"?r-=1:l===","&&r===0&&(t.push(e.slice(n,i)),n=i+1)}return t.push(e.slice(n)),t},"splitCommaOutsideQuotes"),mn=ke(e=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1)},"stripQuotes");var dn=Object.defineProperty,R=w((e,t)=>dn(e,"name",{value:t,configurable:!0}),"s$1");const gn=/\[([^\]]+)\]/g,yn=R(e=>{const t=e.trim(),r=t.indexOf("(");if(r===-1)return{args:[],name:t};if(!t.endsWith(")"))throw new Error(`Filter call "${e}" missing closing ")"`);const n=t.slice(0,r).trim(),a=t.slice(r+1,-1).trim();return a===""?{args:[],name:n}:{args:xe(a).map(i=>{const l=i.trim();return mn(l)??l}),name:n}},"parseFilterCall"),bn=R(e=>{const t=e.split("|").map(n=>n.trim()),r=t[0]??"";if(!r)throw new Error(`Empty variable name in expression "${e}"`);return{filters:t.slice(1).map(n=>yn(n)),name:r}},"parsePipe"),$n=R(e=>e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"?String(e):JSON.stringify(e),"stringify"),vn=R((e,t)=>{const r=e.replaceAll(gn,(n,a)=>{const{filters:i,name:l}=bn(a);if(!Object.hasOwn(t,l))throw new Error(`Variable "${l}" used in filename "${e}" but not defined`);let o=t[l];for(const h of i)o=Oe(h.name,o,h.args);return $n(o)});return Ce(r)},"interpolateFilename"),Ce=R(e=>e.split("/").map(t=>t.endsWith(".tera")||t.endsWith(".twig")?t.slice(0,-5):t).join("/"),"stripTeraSuffix"),wn=R(e=>e.endsWith(".raw")?e.slice(0,-4):e,"stripRawSuffix"),jn=R(e=>{const t=e.split("/");return(t.at(-1)??"").startsWith("_")?!0:t.slice(0,-1).includes("partials")},"isPartialPath");var En=Object.defineProperty,On=w((e,t)=>En(e,"name",{value:t,configurable:!0}),"i");const kn=On((e,t)=>{if(!e.startsWith(`---
|
|
1
|
+
var Te=Object.defineProperty;var w=(e,t)=>Te(e,"name",{value:t,configurable:!0});import{createRequire as ze}from"node:module";import{t as Be,aF as Ie,p as Ne,aT as qe}from"./bin.js";import{z as he,M as me,$ as I}from"../packem_shared/otel-CO8UEfTa.js";const Me=ze(import.meta.url),z=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Fe=w(e=>{if(typeof z<"u"&&z.versions&&z.versions.node){const[t,r]=z.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return z.getBuiltinModule(e)}return Me(e)},"__cjs_getBuiltinModule"),{createRequire:Ge}=Fe("node:module");var De=Object.defineProperty,Ke=w((e,t)=>De(e,"name",{value:t,configurable:!0}),"p$6"),Qe=Object.defineProperty,de=Ke((e,t)=>Qe(e,"name",{value:t,configurable:!0}),"e"),Ve=Object.defineProperty,He=de((e,t)=>Ve(e,"name",{value:t,configurable:!0}),"E");const ge=String.raw,re=ge`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Je=He(()=>new RegExp(ge`\p{RI}{2}|(?)${re}(?:\u200D${re})*`,"gu"),"default");var Ye=Object.defineProperty,Xe=de((e,t)=>Ye(e,"name",{value:t,configurable:!0}),"p");Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]]));const T=Je(),Ze=/[-_./\s]+/g,L=/(\u001B\[[0-9;]*[a-z])/i,ne=new RegExp("\\p{Script=Arabic}","u"),et=new RegExp("\\p{Script=Bengali}","u"),_=new RegExp("\\p{Script=Cyrillic}","u"),tt=new RegExp("\\p{Script=Devanagari}","u"),rt=new RegExp("\\p{Script=Ethiopic}","u"),Q=new RegExp("\\p{Script=Greek}","u"),ae=new RegExp("\\p{Script=Greek}+|\\p{Script=Latin}+|[^\\p{Script=Greek}\\p{Script=Latin}]+","gu"),nt=new RegExp("\\p{Script=Gujarati}","u"),at=new RegExp("\\p{Script=Gurmukhi}","u"),ie=new RegExp("\\p{Script=Hangul}","u"),se=new RegExp("\\p{Script=Hebrew}","u"),it=new RegExp("\\p{Script=Hiragana}","u"),oe=new RegExp("\\p{Script=Han}","u"),st=new RegExp("\\p{Script=Kannada}","u"),ot=new RegExp("\\p{Script=Katakana}","u"),lt=new RegExp("\\p{Script=Khmer}","u"),ct=new RegExp("\\p{Script=Lao}","u"),O=new RegExp("\\p{Script=Latin}","u"),ut=new RegExp("\\p{Script=Malayalam}","u"),pt=new RegExp("\\p{Script=Myanmar}","u"),ft=new RegExp("\\p{Script=Oriya}","u"),ht=new RegExp("\\p{Script=Sinhala}","u"),mt=new RegExp("\\p{Script=Tamil}","u"),dt=new RegExp("\\p{Script=Telugu}","u"),gt=new RegExp("\\p{Script=Thai}","u"),yt=new RegExp("\\p{Script=Tibetan}","u"),le=/[\u02BB\u02BC\u0027]/u,bt=Xe(e=>e.replace(T,""),"stripEmoji");var $t=Object.defineProperty,ye=w((e,t)=>$t(e,"name",{value:t,configurable:!0}),"i$5"),vt=Object.defineProperty,be=ye((e,t)=>vt(e,"name",{value:t,configurable:!0}),"r"),wt=Object.defineProperty,jt=be((e,t)=>wt(e,"name",{value:t,configurable:!0}),"c");let W=class{static{w(this,"l")}static{ye(this,"y")}static{be(this,"s")}static{jt(this,"LRUCache")}capacity;cache;keyOrder;constructor(t){this.capacity=t,this.cache=new Map,this.keyOrder=[]}get(t){if(this.cache.has(t))return this.keyOrder=this.keyOrder.filter(r=>r!==t),this.keyOrder.push(t),this.cache.get(t)}has(t){return this.cache.has(t)}set(t,r){if(this.cache.has(t))this.keyOrder=this.keyOrder.filter(n=>n!==t);else if(this.cache.size>=this.capacity){const n=this.keyOrder.shift();n!==void 0&&this.cache.delete(n)}this.cache.set(t,r),this.keyOrder.push(t)}delete(t){this.cache.delete(t),this.keyOrder=this.keyOrder.filter(r=>r!==t)}clear(){this.cache.clear(),this.keyOrder=[]}size(){return this.cache.size}};var Et=Object.defineProperty,Ot=w((e,t)=>Et(e,"name",{value:t,configurable:!0}),"r$6"),kt=Object.defineProperty,xt=Ot((e,t)=>kt(e,"name",{value:t,configurable:!0}),"a"),Ct=Object.defineProperty,St=xt((e,t)=>Ct(e,"name",{value:t,configurable:!0}),"s");const Pt=St((e,t)=>typeof e!="string"||e===""?"":(t?.locale?e[0].toLocaleLowerCase(t.locale):e[0].toLowerCase())+e.slice(1),"lowerFirst");var At=Object.defineProperty,Lt=w((e,t)=>At(e,"name",{value:t,configurable:!0}),"I"),Wt=Object.defineProperty,q=Lt((e,t)=>Wt(e,"name",{value:t,configurable:!0}),"W");const Rt=Ge(import.meta.url),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_t=q(e=>{if(typeof M<"u"&&M.versions&&M.versions.node){const[t,r]=M.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return M.getBuiltinModule(e)}return Rt(e)},"__cjs_getBuiltinModule"),{stripVTControlCharacters:Ut}=_t("node:util");var Tt=Object.defineProperty,zt=q((e,t)=>Tt(e,"name",{value:t,configurable:!0}),"g");const V=new W(1e3),Mt=/[.*+?^${}()|[\]\\]/g,Ft=zt(e=>{const t=e.join("");if(V.has(t))return V.get(t);const r=e.map(a=>a.replaceAll(Mt,String.raw`\$&`)).join("|"),n=new RegExp(r,"g");return V.set(t,n),n},"getSeparatorsRegex");var Bt=Object.defineProperty,It=q((e,t)=>Bt(e,"name",{value:t,configurable:!0}),"t");const Nt=It(e=>{const t=[];let r=0,n;for(T.lastIndex=0;(n=T.exec(e))!==null;)n.index>r&&t.push(e.slice(r,n.index)),t.push(n[0]),r=T.lastIndex;return r<e.length&&t.push(e.slice(r)),t.filter(Boolean)},"splitByEmoji");var qt=Object.defineProperty,$=q((e,t)=>qt(e,"name",{value:t,configurable:!0}),"u");const Gt=/[ČŠŽĐ]/i,$e=new Uint8Array(128),ve=new Uint8Array(128),we=new Uint8Array(128);for(let e=0;e<128;e++)$e[e]=e>=65&&e<=90?1:0,ve[e]=e>=97&&e<=122?1:0,we[e]=e>=48&&e<=57?1:0;const H=$(e=>$e[e],"isUpper"),ce=$(e=>ve[e],"isLower"),J=$(e=>we[e],"isDigit"),A=$((e,t,r,n,a)=>{if(e.length===0)return[];let i=!1;const l=Object.values(t);for(const u of l)if(u(e[0])){i=!0;break}if(!i&&!r)return[e];const o=[...e],h=[];let s=o[0],f="other";const m=Object.entries(t);for(const u of m){const[p,g]=u;if(g(o[0])){f=p;break}}let c=r&&n?o[0]===o[0].toLocaleUpperCase(n):!1;for(let u=1;u<o.length;u++){const p=o[u];let g="other";for(const b of m){const[v,E]=b;if(E(p)){g=v;break}}const y=r&&n?p===p.toLocaleUpperCase(n):!1;let d=!1;a?d=a(f,g,c,y,p,u,o):(f!==g&&f!=="other"&&g!=="other"&&(d=!0),r&&g!=="other"&&!c&&y&&(d=!0)),d?(h.push(s),s=p):s+=p,f=g,r&&(c=y)}return s&&s.length>0&&h.push(s),h.length>0?h:[e]},"handleScriptTransitions"),Dt=$((e,t,r,n)=>{if(r.size===0)return t;for(const a of r)if(e.startsWith(a,t))return n.push(a),t+a.length;return t},"detectAndProcessAcronym"),je=$((e,t=new Set)=>{if(e.length===0)return[];if(e.toUpperCase()===e)return[e];let r=0;const n=[],a=e.length;for(let i=1;i<a;i++){const l=Dt(e,r,t,n);if(l!==r){r=l,i=r-1;continue}const o=e.codePointAt(i-1),h=e.codePointAt(i),s=o&&o<128&&H(o),f=h&&h<128&&H(h),m=o&&o<128&&ce(o),c=o&&o<128&&J(o),u=h&&h<128&&J(h);if(m&&f){n.push(e.slice(r,i)),r=i;continue}if(c&&!u||!c&&u){n.push(e.slice(r,i)),r=i;continue}if(u&&!c){let p=!1,g=!1;if(i+1<a){const y=e.codePointAt(i+1);p=y&&y<128&&H(y),g=y&&y<128&&J(y)}if(!g&&p){n.push(e.slice(r,i),e.slice(i,i+1)),r=i+1;continue}}if(i+1<a){const p=e.codePointAt(i+1),g=p&&p<128&&ce(p);if(s&&f&&g){const y=e.slice(r,i+1);t.has(y)||(n.push(e.slice(r,i)),r=i)}}}return r<a&&n.push(e.slice(r)),n.filter(i=>i!=="")},"splitCamelCaseFast"),Ee=$((e,t,r)=>{if(e.length===0)return[];const n=e===e.toLocaleUpperCase(t);if(t.startsWith("de")){if(!n&&e.replaceAll("ß","SS")===e.toLocaleUpperCase(t))return[e];const s=[...e],f=s.length,m=[];let c=s[0],u=s[0]===s[0].toLocaleUpperCase(t),p=u,g=u?0:-1;for(let y=1;y<f;y++){const d=s[y],b=d===d.toLocaleUpperCase(t);if(b===u)c+=d;else if(b)c&&c.length>0&&(m.push(c),c=d),p=!0,g=y;else{if(p&&y-g>1){const v=s[y-1],E=c.slice(0,-1);E&&E.length>0&&m.push(E),c=v+d}else c+=d;p=!1,g=-1}u=b}return c&&c.length>0&&m.push(c),m}if(t.startsWith("uk")||t.startsWith("ru")||t.startsWith("bg")||t.startsWith("sr")||t.startsWith("mk")||t.startsWith("be")){if(!_.test(e)&&!O.test(e))return[e];const s=[...e],f=s.length,m=[];let c=s[0];const u=s[0];let p;_.test(u)?p=1:O.test(u)?p=2:p=0;let g=u===u.toLocaleUpperCase(t);for(let d=1;d<f;d++){const b=s[d];let v;_.test(b)?v=1:O.test(b)?v=2:v=0;const E=b===b.toLocaleUpperCase(t);p!==v&&(p===1||p===2)&&(v===1||v===2)||v===p&&!g&&E?(m.push(c),c=b):c+=b,p=v,g=E}c&&c.length>0&&m.push(c);const y=[];for(let d=0;d<m.length;d++)d<m.length-1&&m[d].length===1&&O.test(m[d])&&_.test(m[d+1][0])?(y.push(m[d]+m[d+1]),d+=1):y.push(m[d]);return y}if(t.startsWith("el")){if(!Q.test(e)&&!O.test(e))return[e];const s=[];ae.lastIndex=0;let f;for(;(f=ae.exec(e))!==null;)s.push(f[0]);s.length===0&&s.push(e);const m=[];if(s.length===1){const c=s[0];if(!c||!Q.test(c[0])||c.length===1)return[c??e]}for(const c of s){if(!c)continue;if(!Q.test(c[0])||c.length===1){m.push(c);continue}const u=c.length;let p=c[0],g=c[0]===c[0].toLocaleUpperCase(t);for(let y=1;y<u;y++){const d=c[y],b=d===d.toLocaleUpperCase(t);!g&&b?(m.push(p),p=d):p+=d,g=b}p&&m.push(p)}return m}if(t.startsWith("ja")||t.startsWith("ko")){const s=t.startsWith("ja"),f=s?{hiragana:$(c=>it.test(c),"hiragana"),kanji:$(c=>oe.test(c),"kanji"),katakana:$(c=>ot.test(c),"katakana"),latin:$(c=>O.test(c),"latin")}:{hangul:$(c=>ie.test(c),"hangul"),latin:$(c=>O.test(c),"latin")},m=new Set(["が","で","と","に","の","は","へ","も","や","を"]);if(s){const c=A(e,f,!1,t,(p,g)=>p==="hiragana"&&g==="katakana"||p==="katakana"&&g==="hiragana"||p==="hiragana"&&g==="latin"||p==="katakana"&&g==="latin"||p==="kanji"&&g==="latin"||p==="latin"&&(g==="hiragana"||g==="katakana"||g==="kanji")),u=[];for(const p of c){const g=p;g.length===1&&m.has(g)&&u.length>0?u[u.length-1]=u.at(-1)+g:u.push(g)}return u.length>0?u:[e]}return A(e,f,!1,t,(c,u)=>c==="hangul"&&u==="latin"||c==="latin"&&u==="hangul")}if(t.startsWith("sl")){const s=[...e],f=s.length,m=[];let c=s[0],u=s[0]===s[0].toLocaleUpperCase(t);for(let p=1;p<f;p++){const g=s[p],y=g===g.toLocaleUpperCase(t),d=Gt.test(g),b=p<f-1&&s[p+1]===s[p+1].toLocaleUpperCase(t);!u&&y||d&&b?(m.push(c),c=g,d&&b&&(m.push(c),c="")):c+=g,u=y}return c&&c.length>0&&m.push(c),m}if(t.startsWith("zh"))return A(e,{han:$(s=>oe.test(s),"han"),latin:$(s=>O.test(s),"latin")},!1,t);if(["ar","fa","he","ur"].includes(t.split("-")[0])){const s=$(f=>se.test(f)||ne.test(f),"isRtlChar");return A(e,{latin:$(f=>O.test(f),"latin"),rtl:$(f=>s(f),"rtl")},!1,t)}if(["am","bn","gu","hi","km","kn","lo","ml","mr","ne","or","pa","si","ta","te","th"].includes(t.split("-")[0])){const s=$(f=>tt.test(f)||et.test(f)||nt.test(f)||at.test(f)||st.test(f)||mt.test(f)||dt.test(f)||ut.test(f)||ht.test(f)||gt.test(f)||ct.test(f)||yt.test(f)||pt.test(f)||rt.test(f)||lt.test(f)||ft.test(f),"isIndicChar");return A(e,{indic:$(f=>s(f),"indic"),latin:$(f=>O.test(f),"latin")},!1,t)}if(["be","bg","ru","sr","uk"].includes(t))return A(e,{cyrillic:$(s=>_.test(s),"cyrillic"),latin:$(s=>O.test(s),"latin")},!0,t);if(["ar","fa","he"].includes(t))return A(e,{latin:$(s=>O.test(s),"latin"),rtl:$(s=>se.test(s)||ne.test(s),"rtl")},!1,t);if(t.startsWith("ko"))return A(e,{hangul:$(s=>ie.test(s),"hangul"),latin:$(s=>O.test(s),"latin")},!1,t);if(t.startsWith("uz")){if(!_.test(e)&&!O.test(e))return[e];const s=[...e],f=s.length,m=[];let c=s[0],u=s[0]===s[0].toLocaleUpperCase(t);for(let p=1;p<f;p++){const g=s[p],y=g===g.toLocaleUpperCase(t);if(le.test(g)||le.test(s[p-1])){c+=g;continue}!u&&y?(m.push(c),c=g):c+=g,u=y}return c&&c.length>0&&m.push(c),m}const a=[...e],i=a.length,l=[];let o=a[0],h=a[0]===a[0].toLocaleUpperCase(t);for(const s of r)if(e.startsWith(s)){l.push(s),o=a[s.length],h=o===o.toLocaleUpperCase(t);break}for(let s=1;s<i;s++){const f=a[s],m=f===f.toLocaleUpperCase(t);let c=0;for(const u of r)if(e.startsWith(u,s)){l.push(o,u),c=u.length,o="";const p=u.at(-1);p&&(h=p===p.toLocaleUpperCase(t));break}if(c>0){s+=c-1;continue}!h&&m?(l.push(o),o=f):o+=f,h=m}return o&&l.push(o),l},"splitCamelCaseLocale"),Kt=$((e,t,r)=>{const n=[],a=L.test(e)?e.split(L).filter(Boolean):[e];for(const i of a){const l=i;if(L.test(l))n.push(l);else{const o=T.test(l)?Nt(l).filter(Boolean):[l];for(const h of o)if(T.test(h))n.push(h);else if(t){const s=t.toLowerCase().split("-")[0];n.push(...Ee(h,s,r))}else n.push(...je(h,r))}}return n},"processTextWithAnsiEmoji"),G=$((e,t={})=>{if(!e||typeof e!="string")return[];const{handleAnsi:r=!1,handleEmoji:n=!1,knownAcronyms:a=[],locale:i,normalize:l=!1,separators:o,stripAnsi:h=!1,stripEmoji:s=!1}=t,f=new Set([...a].toSorted((d,b)=>b.length-d.length));let m=e;h&&(m=Ut(m)),s&&(m=bt(m));let c;Array.isArray(o)?c=Ft(o):o instanceof RegExp?c=o:c=Ze;const u=[];let p=m;const g=c.flags.includes("g")?c:new RegExp(c.source,`${c.flags}g`);for(;p.length>0;){const d=g.exec(p);if(!d){p===".."?u.push(".."):p==="."?u.push("."):p.length>0&&u.push(p);break}const b=d.index,v=d[0],E=v.length,B=p.slice(0,b),Ue=p.slice(b+E);if(v.startsWith("../"))u.push(".."),p=p.slice(b+3);else if(v.startsWith("./"))u.push("."),p=p.slice(b+2);else if(b===0&&v==="..")u.push(".."),p=p.slice(2);else if(b===0&&v===".")u.push("."),p=p.slice(1);else{B.length>0&&u.push(B);let S=0;for(;(S=v.indexOf("../",S))!==-1;)u.push(".."),S+=3;for(S=0;(S=v.indexOf("./",S))!==-1;)(S===0||v[S-1]!==".")&&u.push("."),S+=2;let P=Ue;for(;P.startsWith("../");)u.push(".."),P=P.slice(3);for(;P.startsWith("./");)u.push("."),P=P.slice(2);if(P===".."){u.push("..");break}else if(P==="."){u.push(".");break}else p=P}g.lastIndex=0}if(u.length===0){const d=m.split(c).filter(Boolean);u.push(...d)}let y=[];for(const d of u)r||n?y.push(...Kt(d,i,f)):i?y.push(...Ee(d,i,f)):y.push(...je(d,f));return l&&(y=y.map(d=>f.has(d)?d:i&&d===d.toLocaleUpperCase(i)?d[0]+d.slice(1).toLocaleLowerCase(i):d.toUpperCase()===d&&!f.has(d)?d.slice(0,1)+d.slice(1).toLowerCase():d)),y},"splitByCase");var Qt=Object.defineProperty,Vt=w((e,t)=>Qt(e,"name",{value:t,configurable:!0}),"r$5"),Ht=Object.defineProperty,Jt=Vt((e,t)=>Ht(e,"name",{value:t,configurable:!0}),"o"),Yt=Object.defineProperty,Xt=Jt((e,t)=>Yt(e,"name",{value:t,configurable:!0}),"s");const Z=Xt((e,t)=>typeof e!="string"||e===""?"":(t?.locale?e[0].toLocaleUpperCase(t.locale):e[0].toUpperCase())+e.slice(1),"upperFirst");var Zt=Object.defineProperty,er=w((e,t)=>Zt(e,"name",{value:t,configurable:!0}),"r$4"),tr=Object.defineProperty,rr=er((e,t)=>tr(e,"name",{value:t,configurable:!0}),"r"),nr=Object.defineProperty,ar=rr((e,t)=>nr(e,"name",{value:t,configurable:!0}),"n");const D=ar((e,t)=>`${e}::${t?.joiner??""}::${t?.locale??""}::${t?.knownAcronyms?.join(",")??""}::${t?.normalize?"true":"false"}`,"generateCacheKey");var ir=Object.defineProperty,sr=w((e,t)=>ir(e,"name",{value:t,configurable:!0}),"i$3"),or=Object.defineProperty,lr=sr((e,t)=>or(e,"name",{value:t,configurable:!0}),"f"),cr=Object.defineProperty,ur=lr((e,t)=>cr(e,"name",{value:t,configurable:!0}),"l");const K=ur((e,t)=>{const{length:r}=e;if(r===0)return"";if(r===1)return e[0];const n=[];let a="",i="";for(let l=0;l<r;l++){const o=e[l];if(L.test(o)){a?(n.push(a+i+o),a="",i=""):(n.length>0&&n.push(t),a=o);continue}a?(i&&(i+=t),i+=o):(n.length>0&&n.push(t),n.push(o))}return n.join("")},"joinSegments");var pr=Object.defineProperty,fr=w((e,t)=>pr(e,"name",{value:t,configurable:!0}),"r$3"),hr=Object.defineProperty,mr=fr((e,t)=>hr(e,"name",{value:t,configurable:!0}),"a"),dr=Object.defineProperty,gr=mr((e,t)=>dr(e,"name",{value:t,configurable:!0}),"e");const yr=/(?<![a-zß])SS(?![a-z])/g,ee=gr(e=>e.replaceAll(yr,"ß"),"normalizeGermanEszett");var br=Object.defineProperty,$r=w((e,t)=>br(e,"name",{value:t,configurable:!0}),"c$3"),vr=Object.defineProperty,wr=$r((e,t)=>vr(e,"name",{value:t,configurable:!0}),"c"),jr=Object.defineProperty,Er=wr((e,t)=>jr(e,"name",{value:t,configurable:!0}),"o");const Or=new W(1e3),kr=Er((e,t)=>{if(typeof e!="string"||!e)return"";const r=t?.cache??!1,n=t?.cacheStore??Or;let a;if(r&&(a=D(e,t)),r&&a&&n.has(a))return n.get(a);let i=!0;const l=K(G(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(o=>{if(t?.handleAnsi&&L.test(o))return o;const h=t?.locale?.startsWith("de")?ee(o):o,s=t?.locale?h.toLocaleLowerCase(t.locale):h.toLowerCase();return i?(i=!1,Pt(s,t)):Z(s,t)}),"");return r&&a&&n.set(a,l),l},"camelCase");var xr=Object.defineProperty,Cr=w((e,t)=>xr(e,"name",{value:t,configurable:!0}),"l$3"),Sr=Object.defineProperty,Pr=Cr((e,t)=>Sr(e,"name",{value:t,configurable:!0}),"l"),Ar=Object.defineProperty,Lr=Pr((e,t)=>Ar(e,"name",{value:t,configurable:!0}),"o");const Wr=new W(1e3),te=Lr((e,t)=>{if(typeof e!="string")return"";const r=t?.cache??!1,n=t?.cacheStore??Wr;let a;if(r&&(a=D(e,t)),r&&a&&n.has(a))return n.get(a);const i=G(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(o=>{if(t?.handleAnsi&&L.test(o))return o;if(t?.toUpperCase)return t.locale?o.toLocaleUpperCase(t.locale):o.toUpperCase();const h=t?.locale?.startsWith("de")?ee(o):o;return t?.locale?h.toLocaleLowerCase(t.locale):h.toLowerCase()}),l=K(i,t?.joiner??"-");return r&&a&&n.set(a,l),l},"kebabCase");var Rr=Object.defineProperty,_r=w((e,t)=>Rr(e,"name",{value:t,configurable:!0}),"r$2"),Ur=Object.defineProperty,Tr=_r((e,t)=>Ur(e,"name",{value:t,configurable:!0}),"a"),zr=Object.defineProperty,Mr=Tr((e,t)=>zr(e,"name",{value:t,configurable:!0}),"s");const Fr=new W(1e3),Br=Mr((e,t)=>te(e,{cacheStore:Fr,...t,joiner:"_",toUpperCase:!0}),"constantCase");var Ir=Object.defineProperty,Nr=w((e,t)=>Ir(e,"name",{value:t,configurable:!0}),"l$2"),qr=Object.defineProperty,Gr=Nr((e,t)=>qr(e,"name",{value:t,configurable:!0}),"l"),Dr=Object.defineProperty,Kr=Gr((e,t)=>Dr(e,"name",{value:t,configurable:!0}),"i");const Qr=new W(1e3),Vr=Kr((e,t)=>{if(typeof e!="string"||!e)return"";const r=t?.cache??!1,n=t?.cacheStore??Qr;let a;if(r&&(a=D(e,t)),r&&a&&n.has(a))return n.get(a);const i=K(G(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(l=>{if(t?.handleAnsi&&L.test(l))return l;const o=t?.locale?.startsWith("de")?ee(l):l;return Z(t?.locale?o.toLocaleLowerCase(t.locale):o.toLowerCase(),{locale:t?.locale})}),"");return r&&a&&n.set(a,i),i},"pascalCase");var Hr=Object.defineProperty,Jr=w((e,t)=>Hr(e,"name",{value:t,configurable:!0}),"r$1"),Yr=Object.defineProperty,Xr=Jr((e,t)=>Yr(e,"name",{value:t,configurable:!0}),"a"),Zr=Object.defineProperty,en=Xr((e,t)=>Zr(e,"name",{value:t,configurable:!0}),"s");const tn=new W(1e3),rn=en((e,t)=>te(e,{cacheStore:tn,...t,joiner:"_"}),"snakeCase");var nn=Object.defineProperty,an=w((e,t)=>nn(e,"name",{value:t,configurable:!0}),"r"),sn=Object.defineProperty,on=an((e,t)=>sn(e,"name",{value:t,configurable:!0}),"e"),ln=Object.defineProperty,cn=on((e,t)=>ln(e,"name",{value:t,configurable:!0}),"i");const un=new W(1e3),pn=cn((e,t)=>{if(typeof e!="string")return"";const r=t?.cache??!1,n=t?.cacheStore??un;let a;if(r&&(a=D(e,t)),r&&a&&n.has(a))return n.get(a);const i=K(G(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(l=>Z(l,{locale:t?.locale})),"-");return r&&a&&n.set(a,i),i},"trainCase");var fn=Object.defineProperty,k=w((e,t)=>fn(e,"name",{value:t,configurable:!0}),"e");const x=k(e=>e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"?String(e):JSON.stringify(e),"stringify"),Y={camel_case:k(e=>kr(x(e)),"camel_case"),kebab_case:k(e=>te(x(e)),"kebab_case"),lower_case:k(e=>x(e).toLowerCase(),"lower_case"),pascal_case:k(e=>Vr(x(e)),"pascal_case"),path_join:k((e,...t)=>{const r=[x(e),...t.map(n=>x(n))];return me(...r)},"path_join"),path_relative:k((e,t)=>he(x(t),x(e)),"path_relative"),snake_case:k(e=>rn(x(e)),"snake_case"),upper_case:k(e=>x(e).toUpperCase(),"upper_case"),upper_kebab_case:k(e=>pn(x(e)),"upper_kebab_case"),upper_snake_case:k(e=>Br(x(e)),"upper_snake_case")};k(e=>Object.hasOwn(Y,e),"isKnownFilter");const Oe=k((e,t,r=[])=>{const n=Y[e];if(!n)throw new Error(`Unknown filter "${e}". Known filters: ${Object.keys(Y).sort().join(", ")}.`);return n(t,...r)},"applyFilter");var hn=Object.defineProperty,ke=w((e,t)=>hn(e,"name",{value:t,configurable:!0}),"d$1");const xe=ke(e=>{const t=[];let r=0,n=0,a,i=-1;for(const l of e){if(i+=1,a){l===a&&(a=void 0);continue}if(l==='"'||l==="'"){a=l;continue}l==="("?r+=1:l===")"?r-=1:l===","&&r===0&&(t.push(e.slice(n,i)),n=i+1)}return t.push(e.slice(n)),t},"splitCommaOutsideQuotes"),mn=ke(e=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1)},"stripQuotes");var dn=Object.defineProperty,R=w((e,t)=>dn(e,"name",{value:t,configurable:!0}),"s$1");const gn=/\[([^\]]+)\]/g,yn=R(e=>{const t=e.trim(),r=t.indexOf("(");if(r===-1)return{args:[],name:t};if(!t.endsWith(")"))throw new Error(`Filter call "${e}" missing closing ")"`);const n=t.slice(0,r).trim(),a=t.slice(r+1,-1).trim();return a===""?{args:[],name:n}:{args:xe(a).map(i=>{const l=i.trim();return mn(l)??l}),name:n}},"parseFilterCall"),bn=R(e=>{const t=e.split("|").map(n=>n.trim()),r=t[0]??"";if(!r)throw new Error(`Empty variable name in expression "${e}"`);return{filters:t.slice(1).map(n=>yn(n)),name:r}},"parsePipe"),$n=R(e=>e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"?String(e):JSON.stringify(e),"stringify"),vn=R((e,t)=>{const r=e.replaceAll(gn,(n,a)=>{const{filters:i,name:l}=bn(a);if(!Object.hasOwn(t,l))throw new Error(`Variable "${l}" used in filename "${e}" but not defined`);let o=t[l];for(const h of i)o=Oe(h.name,o,h.args);return $n(o)});return Ce(r)},"interpolateFilename"),Ce=R(e=>e.split("/").map(t=>t.endsWith(".tera")||t.endsWith(".twig")?t.slice(0,-5):t).join("/"),"stripTeraSuffix"),wn=R(e=>e.endsWith(".raw")?e.slice(0,-4):e,"stripRawSuffix"),jn=R(e=>{const t=e.split("/");return(t.at(-1)??"").startsWith("_")?!0:t.slice(0,-1).includes("partials")},"isPartialPath");var En=Object.defineProperty,On=w((e,t)=>En(e,"name",{value:t,configurable:!0}),"i");const kn=On((e,t)=>{if(!e.startsWith(`---
|
|
2
2
|
`)&&!e.startsWith(`---\r
|
|
3
3
|
`))return{body:e};const r=e.indexOf(`
|
|
4
4
|
---`,3);if(r===-1)return{body:e};let n=r+1+3;e[n]==="\r"&&(n+=1),e[n]===`
|
|
5
5
|
`&&(n+=1);const a=e.startsWith(`---\r
|
|
6
6
|
`)?5:4,i=e.slice(a,r).replaceAll("\r","");let l;try{l=t(i)}catch(o){const h=o instanceof Error?o.message:String(o);throw new Error(`Failed to parse frontmatter YAML: ${h}`,{cause:o})}if(l==null)return{body:e.slice(n)};if(typeof l!="object"||Array.isArray(l))throw new TypeError(`Frontmatter must be a YAML mapping, got ${Array.isArray(l)?"array":typeof l}`);return{body:e.slice(n),frontmatter:l}},"splitFrontmatter");var xn=Object.defineProperty,j=w((e,t)=>xn(e,"name",{value:t,configurable:!0}),"c");const Cn=/\{\{-?(.+?)-?\}\}|\{%-?(.+?)-?%\}/gs,Se=j(e=>{const t=[];let r=0,n=1;const a=j(i=>{for(const l of i)l===`
|
|
7
|
-
`&&(n+=1)},"advanceLine");for(const i of e.matchAll(Cn)){const l=i.index??0;if(l>r){const s=e.slice(r,l);t.push({line:n,type:"text",value:s}),a(s)}const o=n,h=i[0];h.startsWith("{{")?t.push({line:o,type:"expr",value:(i[1]??"").trim()}):t.push({line:o,type:"stmt",value:(i[2]??"").trim()}),a(h),r=l+h.length}if(r<e.length){const i=e.slice(r);t.push({line:n,type:"text",value:i})}return t},"tokenize"),Sn=new Set(["block","endblock","endfilter","endmacro","extends","filter","import","macro","set"]),Pe=j((e,t)=>{let r=0;const n=j((i,l)=>{throw new Error(`${t}:${i}: ${l}`)},"error"),a=j(i=>{const l=[];for(;r<e.length;){const o=e[r];if(o.type==="text"){l.push({type:"text",value:o.value}),r+=1;continue}if(o.type==="expr"){l.push({expression:o.value,line:o.line,type:"expr"}),r+=1;continue}const h=o.value.split(/\s+/)[0]??"";if(i.includes(h))return l;if(Sn.has(h)&&n(o.line,`Tera feature "{% ${h} %}" is not supported. Supported: if/else/endif, for/endfor, include. Rewrite the template to avoid macros, set, extends, block, and import.`),h==="if"){r+=1;const s=o.value.slice(2).trim(),f=a(["else","endif"]);let m;r<e.length&&e[r].type==="stmt"&&e[r].value.split(/\s+/)[0]==="else"&&(r+=1,m=a(["endif"])),(r>=e.length||e[r].type!=="stmt"||e[r].value.split(/\s+/)[0]!=="endif")&&n(o.line,"Unterminated {% if %} — missing {% endif %}"),r+=1,l.push({alternate:m,condition:s,consequent:f,line:o.line,type:"if"});continue}if(h==="for"){r+=1;const s=o.value.slice(3).trim(),f=s.indexOf(" in ");f===-1&&n(o.line,"Malformed {% for %} — expected `for <name> in <collection>`");const m=s.slice(0,f).trim(),c=s.slice(f+4).trim();(!m||!c)&&n(o.line,"Malformed {% for %} — missing binding or collection");const u=a(["endfor"]);(r>=e.length||e[r].type!=="stmt"||e[r].value.split(/\s+/)[0]!=="endfor")&&n(o.line,"Unterminated {% for %} — missing {% endfor %}"),r+=1,l.push({binding:m,body:u,collection:c,line:o.line,type:"for"});continue}if(h==="include"){r+=1;const s=o.value.slice(7).trim(),f=Ae(s);f===void 0&&n(o.line,"Malformed {% include %} — expected a quoted partial name"),l.push({line:o.line,name:f,type:"include"});continue}n(o.line,`Unknown tag "{% ${h} %}". Supported: if, for, include.`)}return l},"parseBlock");return a([])},"parse"),Ae=j(e=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1)},"stripQuotes"),Pn=j(e=>e==null?"":typeof e=="boolean"||typeof e=="number"?String(e):typeof e=="string"?e:JSON.stringify(e),"stringify"),An=j(e=>e==null||e===!1||e===0||e===""?!1:Array.isArray(e)?e.length>0:!0,"isTruthy"),Le=j((e,t,r,n,a=!0)=>{const i=e.split(".");if(a&&i.length>0&&!Object.hasOwn(t,i[0]))throw new Error(`${n}:${r}: Variable "${e}" is not defined`);let l=t;for(const o of i){if(l==null)return;if(typeof l!="object")throw new TypeError(`${n}:${r}: Cannot read "${o}" on non-object value`);l=l[o]}return l},"lookupVariable"),Ln=j(e=>{const t=[];let r=0,n=0,a;for(let i=0;i<e.length;i+=1){const l=e[i];if(a){l===a&&(a=void 0);continue}if(l==='"'||l==="'"){a=l;continue}l==="("?r+=1:l===")"?r-=1:l==="|"&&r===0&&(t.push(e.slice(n,i)),n=i+1)}return t.push(e.slice(n)),t},"splitFilterPipe"),Wn=j(e=>{const t=e.trim(),r=t.indexOf("(");if(r===-1)return{args:[],name:t};if(!t.endsWith(")"))throw new Error(`Filter call "${e}" missing closing ")"`);const n=t.slice(0,r).trim(),a=t.slice(r+1,-1).trim();return a?{args:xe(a).map(i=>i.trim()),name:n}:{args:[],name:n}},"parseFilterCall"),N=j((e,t,r,n,a=!0)=>{const i=e.trim();if(i==="true")return!0;if(i==="false")return!1;if(i==="null"||i==="none")return null;const l=Ae(i);return l!==void 0?l:/^-?\d+(?:\.\d+)?$/.test(i)?Number(i):Le(i,t,r,n,a)},"evaluatePrimary"),We=j((e,t,r,n,a=!0)=>{const i=Ln(e),l=i[0].trim();let o=N(l,t,r,n,a);for(let h=1;h<i.length;h+=1){const s=i[h].trim(),{args:f,name:m}=Wn(s),c=f.map(u=>N(u,t,r,n,a));try{o=Oe(m,o,c)}catch(u){const p=u instanceof Error?u.message:String(u);throw new Error(`${n}:${r}: ${p}`,{cause:u})}}return o},"evaluateExpression"),Re=j((e,t)=>{let r,n=0;for(let a=0;a<=e.length-t.length;a+=1){const i=e[a];if(r){i===r&&(r=void 0);continue}if(i==='"'||i==="'"){r=i;continue}if(i==="("){n+=1;continue}if(i===")"){n-=1;continue}if(n===0&&e.slice(a,a+t.length)===t)return a}return-1},"findOperatorOutsideQuotes"),ue=j((e,t)=>{const r=[];let n=0,a=0;for(;a<=e.length-t.length;){const i=Re(e.slice(a),t);if(i===-1)break;r.push(e.slice(n,a+i)),a+=i+t.length,n=a}return r.push(e.slice(n)),r},"splitLogical"),U=j((e,t,r,n)=>{const a=e.trim();if(a==="")return!1;if(a.startsWith("(")&&a.endsWith(")")&&Rn(a)===a.length-1)return U(a.slice(1,-1),t,r,n);const i=ue(a," or ");if(i.length>1)return i.some(o=>U(o,t,r,n));const l=ue(a," and ");if(l.length>1)return l.every(o=>U(o,t,r,n));if(a.startsWith("not "))return!U(a.slice(4),t,r,n);for(const o of["==","!="]){const h=Re(a,o);if(h!==-1){const s=N(a.slice(0,h),t,n,r,!1),f=N(a.slice(h+o.length),t,n,r,!1),m=s===f;return o==="=="?m:!m}}return An(We(a,t,n,r,!1))},"evaluateConditionExpression"),Rn=j(e=>{if(e[0]!=="(")return-1;let t=0,r,n=-1;for(const a of e){if(n+=1,r){a===r&&(r=void 0);continue}if(a==='"'||a==="'"){r=a;continue}if(a==="(")t+=1;else if(a===")"&&(t-=1,t===0))return n}return-1},"matchingParen"),F=j((e,t)=>{let r="";for(const n of e){if(n.type==="text"){r+=n.value;continue}if(n.type==="expr"){r+=Pn(We(n.expression,t.scope,n.line,t.filename));continue}if(n.type==="if"){const a=U(n.condition,t.scope,t.filename,n.line)?n.consequent:n.alternate??[];r+=F(a,t);continue}if(n.type==="for"){const a=Le(n.collection,t.scope,n.line,t.filename,!1);if(a==null)continue;if(!Array.isArray(a))throw new TypeError(`${t.filename}:${n.line}: {% for %} expected an array, got ${typeof a}`);for(const i of a){const l={...t.scope,[n.binding]:i};r+=F(n.body,{...t,scope:l})}continue}if(n.type==="include"){const a=t.partials?.get(n.name);if(!a)throw new Error(`${t.filename}:${n.line}: Partial "${n.name}" not found. Available: ${[...t.partials?.keys()??[]].join(", ")||"(none)"}`);const i=t.includeStack??new Set;if(i.has(n.name)){const l=[...i,n.name].join(" → ");throw new Error(`${t.filename}:${n.line}: Circular partial include detected: ${l}`)}i.add(n.name);try{r+=F(a,{...t,filename:`<partial:${n.name}>`,includeStack:i})}finally{i.delete(n.name)}}}return r},"renderNodes"),_n=j((e,t)=>Pe(Se(e),t),"parseTemplate");j((e,t)=>F(e,t),"renderAst");const X=j((e,t)=>F(Pe(Se(e),t.filename),t),"renderTemplate");var Un=Object.defineProperty,C=w((e,t)=>Un(e,"name",{value:t,configurable:!0}),"s");const pe="template.yml",Tn=".raw",zn=new Set([".cjs",".css",".env",".gitattributes",".gitignore",".graphql",".html",".ini",".js",".json",".json5",".jsonc",".jsx",".lock",".md",".mdx",".mjs",".prettierrc",".raw",".rs",".scss",".sh",".sql",".svg",".tera",".toml",".ts",".tsx",".twig",".txt",".vue",".xml",".yaml",".yml"]),Mn=new Set(["Brewfile","CHANGELOG","CODEOWNERS","CONTRIBUTING","COPYING","Dockerfile","Gemfile","LICENCE","LICENSE","Makefile","NOTICE","Procfile","Rakefile","README","VERSION"]),Fn=C(e=>{const t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\")),r=t===-1?e:e.slice(t+1),n=r.lastIndexOf(".");return n===-1||n===0?"":r.slice(n).toLowerCase()},"lastDot"),_e=C(e=>{const t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t===-1?e:e.slice(t+1)},"basename"),Bn=C(e=>{const t=Fn(e);if(t!=="")return zn.has(t);const r=_e(e);return Mn.has(r)},"isLikelyText"),In=C(e=>{const t={default:e.default,internal:e.internal,order:e.order,prompt:e.prompt,required:e.required};switch(e.type){case"array":return{...t,type:"array"};case"boolean":return{...t,default:typeof t.default=="boolean"?t.default:void 0,type:"boolean"};case"enum":return{...t,multiple:e.multiple,type:"enum",values:e.values??[]};case"number":return{...t,type:"number"};case"string":return{...t,type:"string"};default:throw new Error(`Unsupported variable type "${String(e.type)}"`)}},"yamlVariableToVariable"),Nn=C(e=>e.replaceAll("\\","/").replace(/^\.\//,"").replaceAll(/\/+/g,"/"),"normalizeDestinationPath"),qn=C((e,t,r)=>{const n=t.split("/").filter(Boolean);if(n.length===0)throw new Error("Empty destination path for value");let a=e;for(let i=0;i<n.length-1;i+=1){const l=n[i],o=a[l];if(o===void 0){const h={};a[l]=h,a=h}else if(typeof o=="object"&&!Buffer.isBuffer(o))a=o;else throw new TypeError(`Path conflict: "${n.slice(0,i+1).join("/")}" is both a file and a directory`)}a[n.at(-1)]=r},"flattenFiles"),fe=C((e,t,r)=>{if(typeof e!="string")return Gn(e);const n=e.includes("{{")||e.includes("{%")?X(e,{filename:`${r}#frontmatter`,scope:t}):e;return U(n,t,`${r}#frontmatter`,1)},"evaluateGate"),Gn=C(e=>e==null||e===!1||e===0||e===""?!1:Array.isArray(e)?e.length>0:typeof e=="string"?e!=="false"&&e!=="0":!0,"truthyValue"),Zn=C((e,t)=>{const r=me(e,pe),n=Ie(r);if(!n||typeof n!="object")throw new Error(`${r}: must contain a YAML mapping`);const a={};if(n.variables)for(const[h,s]of Object.entries(n.variables))a[h]=In(s);const i=new Map,l=[];for(const h of Be(e,{includeDirs:!1,includeSymlinks:!1})){if(h.path===r)continue;const s=he(e,h.path).replaceAll("\\","/");if(s===pe)continue;if(jn(s)){const m=I(h.path),c=_n(m,s);for(const u of Dn(s))i.has(u)&&i.get(u)!==c&&Ne.warn(`partial name "${u}" is declared by multiple files — last one wins. Use distinct names or fully-qualified includes.`),i.set(u,c);continue}if(s.endsWith(Tn)){const m=I(h.path);l.push({binary:null,isRaw:!0,rawText:m,relativePath:s});continue}if(Bn(s)){const m=I(h.path);l.push({binary:null,isRaw:!1,rawText:m,relativePath:s});continue}const f=I(h.path,{buffer:!0});l.push({binary:f,isRaw:!1,rawText:null,relativePath:s})}const o=C(h=>{const s={...h.builtins,...h.options},f={},m={};for(const u of l){const p=u.relativePath;let g,y,d=!1;if(u.binary)g=u.binary;else if(u.isRaw)g=u.rawText??"";else{const v=u.rawText??"",E=kn(v,B=>qe(B));if(E.frontmatter){if(E.frontmatter.skip!==void 0&&fe(E.frontmatter.skip,s,p)||E.frontmatter.if!==void 0&&!fe(E.frontmatter.if,s,p))continue;typeof E.frontmatter.to=="string"&&(y=X(E.frontmatter.to,{filename:`${p}#frontmatter.to`,partials:i,scope:s})),E.frontmatter.force===!0&&(d=!0)}g=X(E.body,{filename:p,partials:i,scope:s})}const b=Nn(y??vn(wn(p),s));qn(f,b,g),d&&(m[b]={force:!0})}const c={files:f};return Object.keys(m).length>0&&(c.filesMeta=m),c},"produce");return{about:{description:n.description??`Moon-format template at ${e}`,name:n.title??t},destination:n.destination,options:a,produce:o}},"loadMoonTemplate"),Dn=C(e=>{const t=Ce(e),r=_e(t),n=new Set([r,t]);if(r.startsWith("_")){n.add(r.replace(/^_+/,""));const a=t.slice(0,t.length-r.length);n.add(`${a}${r.replace(/^_+/,"")}`)}return[...n]},"partialKeys");export{Zn as loadMoonTemplate};
|
|
7
|
+
`&&(n+=1)},"advanceLine");for(const i of e.matchAll(Cn)){const l=i.index??0;if(l>r){const s=e.slice(r,l);t.push({line:n,type:"text",value:s}),a(s)}const o=n,h=i[0];h.startsWith("{{")?t.push({line:o,type:"expr",value:(i[1]??"").trim()}):t.push({line:o,type:"stmt",value:(i[2]??"").trim()}),a(h),r=l+h.length}if(r<e.length){const i=e.slice(r);t.push({line:n,type:"text",value:i})}return t},"tokenize"),Sn=new Set(["block","endblock","endfilter","endmacro","extends","filter","import","macro","set"]),Pe=j((e,t)=>{let r=0;const n=j((i,l)=>{throw new Error(`${t}:${i}: ${l}`)},"error"),a=j(i=>{const l=[];for(;r<e.length;){const o=e[r];if(o.type==="text"){l.push({type:"text",value:o.value}),r+=1;continue}if(o.type==="expr"){l.push({expression:o.value,line:o.line,type:"expr"}),r+=1;continue}const h=o.value.split(/\s+/)[0]??"";if(i.includes(h))return l;if(Sn.has(h)&&n(o.line,`Tera feature "{% ${h} %}" is not supported. Supported: if/else/endif, for/endfor, include. Rewrite the template to avoid macros, set, extends, block, and import.`),h==="if"){r+=1;const s=o.value.slice(2).trim(),f=a(["else","endif"]);let m;r<e.length&&e[r].type==="stmt"&&e[r].value.split(/\s+/)[0]==="else"&&(r+=1,m=a(["endif"])),(r>=e.length||e[r].type!=="stmt"||e[r].value.split(/\s+/)[0]!=="endif")&&n(o.line,"Unterminated {% if %} — missing {% endif %}"),r+=1,l.push({alternate:m,condition:s,consequent:f,line:o.line,type:"if"});continue}if(h==="for"){r+=1;const s=o.value.slice(3).trim(),f=s.indexOf(" in ");f===-1&&n(o.line,"Malformed {% for %} — expected `for <name> in <collection>`");const m=s.slice(0,f).trim(),c=s.slice(f+4).trim();(!m||!c)&&n(o.line,"Malformed {% for %} — missing binding or collection");const u=a(["endfor"]);(r>=e.length||e[r].type!=="stmt"||e[r].value.split(/\s+/)[0]!=="endfor")&&n(o.line,"Unterminated {% for %} — missing {% endfor %}"),r+=1,l.push({binding:m,body:u,collection:c,line:o.line,type:"for"});continue}if(h==="include"){r+=1;const s=o.value.slice(7).trim(),f=Ae(s);f===void 0&&n(o.line,"Malformed {% include %} — expected a quoted partial name"),l.push({line:o.line,name:f,type:"include"});continue}n(o.line,`Unknown tag "{% ${h} %}". Supported: if, for, include.`)}return l},"parseBlock");return a([])},"parse"),Ae=j(e=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1)},"stripQuotes"),Pn=j(e=>e==null?"":typeof e=="boolean"||typeof e=="number"?String(e):typeof e=="string"?e:JSON.stringify(e),"stringify"),An=j(e=>e==null||e===!1||e===0||e===""?!1:Array.isArray(e)?e.length>0:!0,"isTruthy"),Le=j((e,t,r,n,a=!0)=>{const i=e.split(".");if(a&&i.length>0&&!Object.hasOwn(t,i[0]))throw new Error(`${n}:${r}: Variable "${e}" is not defined`);let l=t;for(const o of i){if(l==null)return;if(typeof l!="object")throw new TypeError(`${n}:${r}: Cannot read "${o}" on non-object value`);l=l[o]}return l},"lookupVariable"),Ln=j(e=>{const t=[];let r=0,n=0,a;for(let i=0;i<e.length;i+=1){const l=e[i];if(a){l===a&&(a=void 0);continue}if(l==='"'||l==="'"){a=l;continue}l==="("?r+=1:l===")"?r-=1:l==="|"&&r===0&&(t.push(e.slice(n,i)),n=i+1)}return t.push(e.slice(n)),t},"splitFilterPipe"),Wn=j(e=>{const t=e.trim(),r=t.indexOf("(");if(r===-1)return{args:[],name:t};if(!t.endsWith(")"))throw new Error(`Filter call "${e}" missing closing ")"`);const n=t.slice(0,r).trim(),a=t.slice(r+1,-1).trim();return a?{args:xe(a).map(i=>i.trim()),name:n}:{args:[],name:n}},"parseFilterCall"),N=j((e,t,r,n,a=!0)=>{const i=e.trim();if(i==="true")return!0;if(i==="false")return!1;if(i==="null"||i==="none")return null;const l=Ae(i);return l!==void 0?l:/^-?\d+(?:\.\d+)?$/.test(i)?Number(i):Le(i,t,r,n,a)},"evaluatePrimary"),We=j((e,t,r,n,a=!0)=>{const i=Ln(e),l=i[0].trim();let o=N(l,t,r,n,a);for(let h=1;h<i.length;h+=1){const s=i[h].trim(),{args:f,name:m}=Wn(s),c=f.map(u=>N(u,t,r,n,a));try{o=Oe(m,o,c)}catch(u){const p=u instanceof Error?u.message:String(u);throw new Error(`${n}:${r}: ${p}`,{cause:u})}}return o},"evaluateExpression"),Re=j((e,t)=>{let r,n=0;for(let a=0;a<=e.length-t.length;a+=1){const i=e[a];if(r){i===r&&(r=void 0);continue}if(i==='"'||i==="'"){r=i;continue}if(i==="("){n+=1;continue}if(i===")"){n-=1;continue}if(n===0&&e.slice(a,a+t.length)===t)return a}return-1},"findOperatorOutsideQuotes"),ue=j((e,t)=>{const r=[];let n=0,a=0;for(;a<=e.length-t.length;){const i=Re(e.slice(a),t);if(i===-1)break;r.push(e.slice(n,a+i)),a+=i+t.length,n=a}return r.push(e.slice(n)),r},"splitLogical"),U=j((e,t,r,n)=>{const a=e.trim();if(a==="")return!1;if(a.startsWith("(")&&a.endsWith(")")&&Rn(a)===a.length-1)return U(a.slice(1,-1),t,r,n);const i=ue(a," or ");if(i.length>1)return i.some(o=>U(o,t,r,n));const l=ue(a," and ");if(l.length>1)return l.every(o=>U(o,t,r,n));if(a.startsWith("not "))return!U(a.slice(4),t,r,n);for(const o of["==","!="]){const h=Re(a,o);if(h!==-1){const s=N(a.slice(0,h),t,n,r,!1),f=N(a.slice(h+o.length),t,n,r,!1),m=s===f;return o==="=="?m:!m}}return An(We(a,t,n,r,!1))},"evaluateConditionExpression"),Rn=j(e=>{if(e[0]!=="(")return-1;let t=0,r,n=-1;for(const a of e){if(n+=1,r){a===r&&(r=void 0);continue}if(a==='"'||a==="'"){r=a;continue}if(a==="(")t+=1;else if(a===")"&&(t-=1,t===0))return n}return-1},"matchingParen"),F=j((e,t)=>{let r="";for(const n of e){if(n.type==="text"){r+=n.value;continue}if(n.type==="expr"){r+=Pn(We(n.expression,t.scope,n.line,t.filename));continue}if(n.type==="if"){const a=U(n.condition,t.scope,t.filename,n.line)?n.consequent:n.alternate??[];r+=F(a,t);continue}if(n.type==="for"){const a=Le(n.collection,t.scope,n.line,t.filename,!1);if(a==null)continue;if(!Array.isArray(a))throw new TypeError(`${t.filename}:${n.line}: {% for %} expected an array, got ${typeof a}`);for(const i of a){const l={...t.scope,[n.binding]:i};r+=F(n.body,{...t,scope:l})}continue}if(n.type==="include"){const a=t.partials?.get(n.name);if(!a)throw new Error(`${t.filename}:${n.line}: Partial "${n.name}" not found. Available: ${[...t.partials?.keys()??[]].join(", ")||"(none)"}`);const i=t.includeStack??new Set;if(i.has(n.name)){const l=[...i,n.name].join(" → ");throw new Error(`${t.filename}:${n.line}: Circular partial include detected: ${l}`)}i.add(n.name);try{r+=F(a,{...t,filename:`<partial:${n.name}>`,includeStack:i})}finally{i.delete(n.name)}}}return r},"renderNodes"),_n=j((e,t)=>Pe(Se(e),t),"parseTemplate");j((e,t)=>F(e,t),"renderAst");const X=j((e,t)=>F(Pe(Se(e),t.filename),t),"renderTemplate");var Un=Object.defineProperty,C=w((e,t)=>Un(e,"name",{value:t,configurable:!0}),"s");const pe="template.yml",Tn=".raw",zn=new Set([".cjs",".css",".env",".gitattributes",".gitignore",".graphql",".html",".ini",".js",".json",".json5",".jsonc",".jsx",".lock",".md",".mdx",".mjs",".prettierrc",".raw",".rs",".scss",".sh",".sql",".svg",".tera",".toml",".ts",".tsx",".twig",".txt",".vue",".xml",".yaml",".yml"]),Mn=new Set(["Brewfile","CHANGELOG","CODEOWNERS","CONTRIBUTING","COPYING","Dockerfile","Gemfile","LICENCE","LICENSE","Makefile","NOTICE","Procfile","Rakefile","README","VERSION"]),Fn=C(e=>{const t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\")),r=t===-1?e:e.slice(t+1),n=r.lastIndexOf(".");return n===-1||n===0?"":r.slice(n).toLowerCase()},"lastDot"),_e=C(e=>{const t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t===-1?e:e.slice(t+1)},"basename"),Bn=C(e=>{const t=Fn(e);if(t!=="")return zn.has(t);const r=_e(e);return Mn.has(r)},"isLikelyText"),In=C(e=>{const t={default:e.default,internal:e.internal,order:e.order,prompt:e.prompt,required:e.required};switch(e.type){case"array":return{...t,type:"array"};case"boolean":return{...t,default:typeof t.default=="boolean"?t.default:void 0,type:"boolean"};case"enum":return{...t,multiple:e.multiple,type:"enum",values:e.values??[]};case"number":return{...t,type:"number"};case"string":return{...t,type:"string"};default:throw new Error(`Unsupported variable type "${String(e.type)}"`)}},"yamlVariableToVariable"),Nn=C(e=>e.replaceAll("\\","/").replace(/^\.\//,"").replaceAll(/\/+/g,"/"),"normalizeDestinationPath"),qn=C((e,t,r)=>{const n=t.split("/").filter(Boolean);if(n.length===0)throw new Error("Empty destination path for value");let a=e;for(let i=0;i<n.length-1;i+=1){const l=n[i],o=a[l];if(o===void 0){const h={};a[l]=h,a=h}else if(typeof o=="object"&&!Buffer.isBuffer(o))a=o;else throw new TypeError(`Path conflict: "${n.slice(0,i+1).join("/")}" is both a file and a directory`)}a[n.at(-1)]=r},"flattenFiles"),fe=C((e,t,r)=>{if(typeof e!="string")return Gn(e);const n=e.includes("{{")||e.includes("{%")?X(e,{filename:`${r}#frontmatter`,scope:t}):e;return U(n,t,`${r}#frontmatter`,1)},"evaluateGate"),Gn=C(e=>e==null||e===!1||e===0||e===""?!1:Array.isArray(e)?e.length>0:typeof e=="string"?e!=="false"&&e!=="0":!0,"truthyValue"),Yn=C((e,t)=>{const r=me(e,pe),n=Be(r);if(!n||typeof n!="object")throw new Error(`${r}: must contain a YAML mapping`);const a={};if(n.variables)for(const[h,s]of Object.entries(n.variables))a[h]=In(s);const i=new Map,l=[];for(const h of Ie(e,{includeDirs:!1,includeSymlinks:!1})){if(h.path===r)continue;const s=he(e,h.path).replaceAll("\\","/");if(s===pe)continue;if(jn(s)){const m=I(h.path),c=_n(m,s);for(const u of Dn(s))i.has(u)&&i.get(u)!==c&&Ne.warn(`partial name "${u}" is declared by multiple files — last one wins. Use distinct names or fully-qualified includes.`),i.set(u,c);continue}if(s.endsWith(Tn)){const m=I(h.path);l.push({binary:null,isRaw:!0,rawText:m,relativePath:s});continue}if(Bn(s)){const m=I(h.path);l.push({binary:null,isRaw:!1,rawText:m,relativePath:s});continue}const f=I(h.path,{buffer:!0});l.push({binary:f,isRaw:!1,rawText:null,relativePath:s})}const o=C(h=>{const s={...h.builtins,...h.options},f={},m={};for(const u of l){const p=u.relativePath;let g,y,d=!1;if(u.binary)g=u.binary;else if(u.isRaw)g=u.rawText??"";else{const v=u.rawText??"",E=kn(v,B=>qe(B));if(E.frontmatter){if(E.frontmatter.skip!==void 0&&fe(E.frontmatter.skip,s,p)||E.frontmatter.if!==void 0&&!fe(E.frontmatter.if,s,p))continue;typeof E.frontmatter.to=="string"&&(y=X(E.frontmatter.to,{filename:`${p}#frontmatter.to`,partials:i,scope:s})),E.frontmatter.force===!0&&(d=!0)}g=X(E.body,{filename:p,partials:i,scope:s})}const b=Nn(y??vn(wn(p),s));qn(f,b,g),d&&(m[b]={force:!0})}const c={files:f};return Object.keys(m).length>0&&(c.filesMeta=m),c},"produce");return{about:{description:n.description??`Moon-format template at ${e}`,name:n.title??t},destination:n.destination,options:a,produce:o}},"loadMoonTemplate"),Dn=C(e=>{const t=Ce(e),r=_e(t),n=new Set([r,t]);if(r.startsWith("_")){n.add(r.replace(/^_+/,""));const a=t.slice(0,t.length-r.length);n.add(`${a}${r.replace(/^_+/,"")}`)}return[...n]},"partialKeys");export{Yn as loadMoonTemplate};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var u=Object.defineProperty;var o=(t,e)=>u(t,"name",{value:e,configurable:!0});import{
|
|
1
|
+
var u=Object.defineProperty;var o=(t,e)=>u(t,"name",{value:e,configurable:!0});import{a as n}from"../packem_shared/otel-CO8UEfTa.js";import{createJiti as l}from"jiti";var p=Object.defineProperty,a=o((t,e)=>p(t,"name",{value:e,configurable:!0}),"r");const i=a((t,e)=>{if(!e||typeof e!="object")throw new TypeError(`${t}: default export must be an object (got ${e===null?"null":typeof e}). Use createTemplate({ ... }).`);const r=e;if(typeof r.about!="object"||r.about===null)throw new TypeError(`${t}: default export missing required "about" object`);if(typeof r.produce!="function")throw new TypeError(`${t}: default export missing required "produce" function`);return e},"validateTemplateExport"),m=a(async t=>{const e=await l(n(t),{fsCache:!1,moduleCache:!1}).import(t,{default:!0,try:!0})??null;return i(t,e)},"loadNativeTemplate");export{m as loadNativeTemplate};
|