@visulima/vis 1.0.0-alpha.29 → 1.0.0-alpha.30
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 +12 -0
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/packem_chunks/bin.js +368 -367
- package/dist/packem_chunks/bloom-status.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/config.js +15 -15
- package/dist/packem_chunks/doctor-probe.js +1 -1
- package/dist/packem_chunks/fix.js +1 -1
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +1 -1
- package/dist/packem_chunks/handler11.js +4 -4
- package/dist/packem_chunks/handler12.js +1 -1
- package/dist/packem_chunks/handler13.js +2 -2
- package/dist/packem_chunks/handler14.js +1 -1
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler16.js +1 -1
- package/dist/packem_chunks/handler17.js +1 -1
- package/dist/packem_chunks/handler18.js +1 -1
- package/dist/packem_chunks/handler19.js +1 -1
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +1 -1
- package/dist/packem_chunks/handler21.js +2 -2
- package/dist/packem_chunks/handler22.js +2 -2
- package/dist/packem_chunks/handler23.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 +1 -1
- package/dist/packem_chunks/handler28.js +1 -1
- package/dist/packem_chunks/handler29.js +1 -1
- package/dist/packem_chunks/handler30.js +7 -7
- package/dist/packem_chunks/handler32.js +1 -1
- package/dist/packem_chunks/handler33.js +1 -1
- package/dist/packem_chunks/handler34.js +4 -4
- package/dist/packem_chunks/handler35.js +1 -1
- package/dist/packem_chunks/handler36.js +1 -1
- package/dist/packem_chunks/handler37.js +5 -5
- package/dist/packem_chunks/handler38.js +4 -4
- package/dist/packem_chunks/handler39.js +1 -1
- package/dist/packem_chunks/handler4.js +1 -1
- package/dist/packem_chunks/handler40.js +2 -2
- package/dist/packem_chunks/handler41.js +6 -6
- package/dist/packem_chunks/handler42.js +13 -13
- package/dist/packem_chunks/handler43.js +5 -5
- package/dist/packem_chunks/handler44.js +5 -5
- package/dist/packem_chunks/handler45.js +1 -1
- package/dist/packem_chunks/handler46.js +12 -12
- package/dist/packem_chunks/handler47.js +40 -40
- package/dist/packem_chunks/handler48.js +15 -15
- package/dist/packem_chunks/handler49.js +3 -3
- package/dist/packem_chunks/handler5.js +1 -1
- package/dist/packem_chunks/handler50.js +9 -9
- package/dist/packem_chunks/handler51.js +1 -1
- package/dist/packem_chunks/handler52.js +1 -1
- package/dist/packem_chunks/handler6.js +1 -1
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/handler9.js +1 -1
- package/dist/packem_chunks/heal-accept.js +1 -1
- package/dist/packem_chunks/heal.js +1 -1
- package/dist/packem_chunks/help-command.js +7 -7
- package/dist/packem_chunks/index.js +6 -6
- package/dist/packem_chunks/keys-refresh.js +1 -1
- package/dist/packem_chunks/list.js +2 -2
- package/dist/packem_chunks/loader.js +1 -1
- package/dist/packem_chunks/loader2.js +1 -1
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/run.js +1 -1
- package/dist/packem_chunks/status.js +1 -1
- package/dist/packem_chunks/sync.js +1 -1
- package/dist/packem_chunks/sync2.js +1 -1
- package/dist/packem_chunks/tripwire.js +2 -2
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_shared/Table-DoSoazT6-DwnyTUsA.js +12 -0
- package/dist/packem_shared/{advisories-DpgSuWDH.js → advisories-BxXiKFbL.js} +1 -1
- package/dist/packem_shared/{affected-shas-BkXXecyi.js → affected-shas-BdnlfiV1.js} +1 -1
- package/dist/packem_shared/{ai-fix-CfFWatGY.js → ai-fix-BkPUHA0z.js} +1 -1
- package/dist/packem_shared/{applyDefaults-DLvOqXGX.js → applyDefaults-BogleaFi.js} +1 -1
- package/dist/packem_shared/build-scripts-DE6U8jVq.js +1 -0
- package/dist/packem_shared/{cyclonedx-B04lIvwu.js → cyclonedx-BpGVHqSW.js} +1 -1
- package/dist/packem_shared/{dependency-scan-B9wTcLxf.js → dependency-scan-BUbOcMwX.js} +1 -1
- package/dist/packem_shared/{docker-DxA80dRx.js → docker-CTE3s4LW.js} +1 -1
- package/dist/packem_shared/{failure-log-n3j_-w8s.js → failure-log-34Wl3npC.js} +1 -1
- package/dist/packem_shared/glob-D_7bct6p-D8itOHsr.js +1 -0
- package/dist/packem_shared/{index-BfG9_znI.js → index-D1xC1Y_R.js} +1 -1
- package/dist/packem_shared/index-hoWfZmNo.js +30 -0
- package/dist/packem_shared/{lifecycle-NHIKDiCh.js → lifecycle-CXaqPGAQ.js} +2 -2
- package/dist/packem_shared/lockfile-CrT86D6d.js +1 -0
- package/dist/packem_shared/{lockfile-DAuTDwow.js → lockfile-Cu2BH6bl.js} +1 -1
- package/dist/packem_shared/{manifests-B7wUR3Rk.js → manifests-BzWpKW8F.js} +1 -1
- package/dist/packem_shared/{min-release-age-YyNI7gqV.js → min-release-age-BPVXwPUg.js} +2 -2
- package/dist/packem_shared/{native-config-sync-CgRIIRZV.js → native-config-sync-BRZZetn3.js} +8 -8
- package/dist/packem_shared/{osv-bloom-BQSIHt5h.js → osv-bloom-DSZcHLsM.js} +1 -1
- package/dist/packem_shared/{pm-runner-Ta_yz2uP.js → pm-runner-DmKT2FqF.js} +1 -1
- package/dist/packem_shared/{provenance-DoEp2uOo.js → provenance-DkCA8BrN.js} +1 -1
- package/dist/packem_shared/readFileSync-DseCu8sg-DEq4Fn3a.js +1 -0
- package/dist/packem_shared/{registry-keys-CD1xHavV.js → registry-keys-Mixm4eAY.js} +1 -1
- package/dist/packem_shared/{resolve-explicit-DpSc7RN2.js → resolve-explicit-D5E72FfN.js} +1 -1
- package/dist/packem_shared/runtime-check-CilFOqUU.js +1 -0
- package/dist/packem_shared/{s1ngularity-CIX7UcT5.js → s1ngularity-Qxc6tRRI.js} +1 -1
- package/dist/packem_shared/{scan-progress-CTVVf9WW.js → scan-progress-DVtCtI2z.js} +1 -1
- package/dist/packem_shared/{selectors-BU8aTRQm.js → selectors-DkgYFzdq.js} +1 -1
- package/dist/packem_shared/{signatures-BHM7cnqB.js → signatures-byuFrtAH.js} +1 -1
- package/dist/packem_shared/{toolchain-juKl-WgV.js → toolchain-DoG6b_G_.js} +2 -2
- package/dist/packem_shared/{typosquats-DRKU6d2S.js → typosquats-BiDxQj7R.js} +1 -1
- package/dist/packem_shared/{verify-DA80ja1b.js → verify-cLcZwKqe.js} +1 -1
- package/dist/packem_shared/{watch-DdR-pFzX.js → watch-DEL0yol9.js} +1 -1
- package/dist/packem_shared/{watch-loop-C8csFvRU.js → watch-loop-C31Ar7BX.js} +3 -3
- package/index.d.ts +201 -201
- package/index.js +26 -26
- package/package.json +10 -10
- package/dist/packem_shared/Table-3pFgIUZ2-DABgc6rj.js +0 -12
- package/dist/packem_shared/build-scripts-D-ysm_bS.js +0 -1
- package/dist/packem_shared/glob-MHJQjR39-CQ2GC0b_.js +0 -1
- package/dist/packem_shared/index-BDF8gawl.js +0 -29
- package/dist/packem_shared/lockfile-CoeFxWAv.js +0 -1
- package/dist/packem_shared/readFileSync-4c_c6Qey-6SWMDNdw.js +0 -1
- package/dist/packem_shared/runtime-check-Cbtb_Utb.js +0 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
var Xe=Object.defineProperty;var O=(t,e)=>Xe(t,"name",{value:e,configurable:!0});import{createRequire as Qe}from"node:module";const ti=Qe(import.meta.url),at=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ei=O(t=>{if(typeof at<"u"&&at.versions&&at.versions.node){const[e,i]=at.versions.node.split(".").map(Number);if(e>22||e===22&&i>=3||e===20&&i>=16)return at.getBuiltinModule(t)}return ti(t)},"__cjs_getBuiltinModule"),{createRequire:ii}=ei("node:module"),wt=0,G=1,ct=2,V=3;var ri=Object.defineProperty,oi=O((t,e)=>ri(t,"name",{value:e,configurable:!0}),"p$2"),ni=Object.defineProperty,si=oi((t,e)=>ni(t,"name",{value:e,configurable:!0}),"_"),hi=Object.defineProperty,jt=si((t,e)=>hi(t,"name",{value:e,configurable:!0}),"u");const ai=/^-{1,2}(no-color|no-colors|color=false|color=never)$/,ci=/^-{1,2}(color=256)$/,li=/^-{1,2}(color=16m|color=full|color=truecolor)$/,di=/^-{1,2}(color|colors|color=true|color=always)$/,ui=/-mono|dumb/i,fi=/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/,mi=/-256(color)?$/i,gi=/^screen|^tmux|^xterm|^vt[1-5]\d\d|^ansi|color|mintty|rxvt|cygwin|linux/i,je=jt(t=>{const e=globalThis,i=e.Deno!=null,r=e.process??e.Deno??{},a=r.argv??r.args??[],s=jt(g=>{const w=a.indexOf("--"),f=a.findIndex(v=>g.test(v));return f!==-1&&(w===-1||f<w)},"oneOfFlags");let o={};try{o=i?r.env.toObject():r.env??{}}catch{}const h="FORCE_COLOR",n=h in o,c=o[h]??void 0,d=Object.prototype.toString.call(c).slice(8,-1)==="String",l=typeof c=="number";let u;if(c==="true")u=G;else if(c==="false")u=wt;else if(d&&c.length===0)u=G;else if(d&&c.length>0){const g=Number.parseInt(c,10);u=Number.isNaN(g)?void 0:Math.min(g,3)}else l&&(u=Number.isNaN(c)?void 0:Math.min(c,3));if(c!=="true"&&c!=="false"&&u!==void 0&&u<4)return u;if("NO_COLOR"in o||n&&u===0||s(ai))return wt;if(s(ci))return ct;if(s(li))return V;if(s(di))return G;const p=u??wt;if("TF_BUILD"in o&&"AGENT_NAME"in o)return G;if(o.TERM&&ui.test(o.TERM))return p;if((i?e.Deno.build.os:r.platform)==="win32")try{const g=(i?e.Deno.osRelease():r.os.release()).split(".");return Number(g[0])>=10&&Number(g[2])>=10586?Number(g[2])>=14931?V:ct:G}catch{}if("CI"in o)return["GITEA_ACTIONS","CIRCLECI","GITHUB_WORKFLOW","GITHUB_ACTIONS"].some(g=>g in o)?V:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(g=>g in o)||o.CI_NAME==="codeship"?G:p;if(o.TERMINAL_EMULATOR?.includes("JediTerm"))return V;if("TEAMCITY_VERSION"in o)return fi.test(o.TEAMCITY_VERSION)?G:wt;if(o.COLORTERM==="truecolor"||o.TERM==="xterm-kitty"||o.TERM==="xterm-ghostty"||o.TERM==="wezterm")return V;if("TERM_PROGRAM"in o){const g=Number.parseInt((o.TERM_PROGRAM_VERSION??"").split(".")[0],10);if(o.TERM_PROGRAM==="iTerm.app")return g>=3?V:ct;if(o.TERM_PROGRAM==="Apple_Terminal")return ct}if(mi.test(o.TERM))return ct;let m;return i?m=t==="out"?e.Deno.stdout.isTerminal():e.Deno.stderr.isTerminal():"PM2_HOME"in o&&"pm_id"in o?m=!0:m=!!r[`std${t}`]?.isTTY,m&&gi.test(o.TERM)||"COLORTERM"in o?G:p},"isColorSupportedFactory"),pi=jt(()=>je("out"),"isStdoutColorSupported");jt(()=>je("err"),"isStderrColorSupported");var wi=Object.defineProperty,Ce=O((t,e)=>wi(t,"name",{value:e,configurable:!0}),"B$1"),bi=Object.defineProperty,q=Ce((t,e)=>bi(t,"name",{value:e,configurable:!0}),"u"),yi=Object.defineProperty,xi=q((t,e)=>yi(t,"name",{value:e,configurable:!0}),"e$1");function Ot({onlyFirst:t=!1}={}){const e="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(e,t?void 0:"g")}O(Ot,"x");Ce(Ot,"N");q(Ot,"t$1");xi(Ot,"ansiRegex");var vi=Object.defineProperty,Bi=q((t,e)=>vi(t,"name",{value:e,configurable:!0}),"n$1");const z=Bi((t,e,i)=>e>t?e:Math.min(t,i),"clamp");var Ri=Object.defineProperty,Wi=q((t,e)=>Ri(t,"name",{value:e,configurable:!0}),"a$1");const Si=/^#?([a-f\d]{3}|[a-f\d]{6})$/i,Ii=Wi(t=>{let[,e]=Si.exec(t)??[];const i=e?e.length:0;if(i===3){const a=e.charAt(0),s=e.charAt(1),o=e.charAt(2);e=a+a+s+s+o+o}else if(i!==6)return[0,0,0];const r=Number.parseInt(e,16);return[r>>16&255,r>>8&255,r&255]},"convertHexToRgb");var Mi=Object.defineProperty,te=q((t,e)=>Mi(t,"name",{value:e,configurable:!0}),"e");const $e=te((t,e,i)=>t===e&&e===i?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/51)+6*Math.round(e/51)+Math.round(i/51),"rgbToAnsi256"),zt=te(t=>{let e,i,r;if(t<8)return 30+t;if(t<16)return 90+(t-8);if(t>=232)e=i=r=((t-232)*10+8)/255;else{t-=16;const o=t%36;e=Math.floor(t/36)/5,i=Math.floor(o/6)/5,r=o%6/5}const a=Math.max(e,i,r)*2;if(a===0)return 30;const s=30+(Math.round(r)<<2|Math.round(i)<<1|Math.round(e));return a===2?s+60:s},"ansi256To16"),he=te((t,e,i)=>zt($e(t,e,i)),"rgbToAnsi16");var Ai=Object.defineProperty,N=q((t,e)=>Ai(t,"name",{value:e,configurable:!0}),"b");const j=39,C=49,ae=10,Dt=pi(),Ee={close:"",open:""},y=Dt>0?(t,e)=>({close:`\x1B[${String(e)}m`,open:`\x1B[${String(t)}m`}):()=>Ee,ce=N(t=>(e,i,r)=>t($e(Number(e),Number(i),Number(r))),"createRgbFunction"),le=N(t=>e=>{const[i,r,a]=Ii(e);return t(i,r,a)},"createHexFunction");let Yt=N(t=>y(`38;5;${String(t)}`,j),"createAnsi256"),qt=N(t=>y(`48;5;${String(t)}`,C),"createBgAnsi256"),Ct=N((t,e,i)=>y(`38;2;${String(t)};${String(e)};${String(i)}`,j),"createRgb"),$t=N((t,e,i)=>y(`48;2;${String(t)};${String(e)};${String(i)}`,C),"createBgRgb");Dt===1?(Yt=N(t=>y(zt(Number(t)),j),"createAnsi256"),qt=N(t=>y(zt(Number(t))+ae,C),"createBgAnsi256"),Ct=N((t,e,i)=>y(he(Number(t),Number(e),Number(i)),j),"createRgb"),$t=N((t,e,i)=>y(he(Number(t),Number(e),Number(i))+ae,C),"createBgRgb")):Dt===2&&(Ct=ce(Yt),$t=ce(qt));const de={bold:y(1,22),dim:y(2,22),hidden:y(8,28),inverse:y(7,27),italic:y(3,23),overline:y(53,55),reset:y(0,0),strike:y(9,29),strikethrough:y(9,29),underline:y(4,24),visible:Ee},ue={bgBlack:y(40,C),bgBlackBright:y(100,C),bgBlue:y(44,C),bgBlueBright:y(104,C),bgCyan:y(46,C),bgCyanBright:y(106,C),bgGray:y(100,C),bgGreen:y(42,C),bgGreenBright:y(102,C),bgGrey:y(100,C),bgMagenta:y(45,C),bgMagentaBright:y(105,C),bgRed:y(41,C),bgRedBright:y(101,C),bgWhite:y(47,C),bgWhiteBright:y(107,C),bgYellow:y(43,C),bgYellowBright:y(103,C),black:y(30,j),blackBright:y(90,j),blue:y(34,j),blueBright:y(94,j),cyan:y(36,j),cyanBright:y(96,j),gray:y(90,j),green:y(32,j),greenBright:y(92,j),grey:y(90,j),magenta:y(35,j),magentaBright:y(95,j),red:y(31,j),redBright:y(91,j),white:y(37,j),whiteBright:y(97,j),yellow:y(33,j),yellowBright:y(93,j)},fe={bg:N(t=>qt(z(t,0,255)),"bg"),bgHex:le($t),bgRgb:N((t,e,i)=>$t(z(t,0,255),z(e,0,255),z(i,0,255)),"bgRgb"),fg:N(t=>Yt(z(t,0,255)),"fg"),hex:le(Ct),rgb:N((t,e,i)=>Ct(z(t,0,255),z(e,0,255),z(i,0,255)),"rgb")};var ji=Object.defineProperty,Ci=q((t,e)=>ji(t,"name",{value:e,configurable:!0}),"s");const $i=Ci((t,e,i)=>{if(e==="")return t;let r=t.indexOf(e);if(r<0)return t;const a=e.length;let s=0,o="";for(;~r;)o+=t.slice(s,r)+i,s=r+a,r=t.indexOf(e,s);return o+t.slice(s)},"stringReplaceAll");var Ei=Object.defineProperty,ut=q((t,e)=>Ei(t,"name",{value:e,configurable:!0}),"a");const Y={};let Ut=null;const Oi=ut((t,e,i)=>{if(!t)return"";let r;if(t.raw===void 0?r=String(t):r=String.raw(t,...e),r.includes("\x1B"))for(let a=i;a;a=a.props)r=$i(r,a.close,a.open);return r.includes(`
|
|
2
|
+
`)&&(r=r.replace(/(\r*\n)/g,`${i.closeStack}$1${i.openStack}`)),i.openStack+r+i.closeStack},"wrapText"),Kt=ut(({props:t},{close:e,open:i})=>{const r=(t?.openStack??"")+i,a=e+(t?.closeStack??""),s=ut((o,...h)=>Oi(o,h,s.props),"style");return Object.setPrototypeOf(s,Ut),s.props={close:e,closeStack:a,open:i,openStack:r,props:t},s.open=r,s.close=a,s},"createStyle"),Ni=ut(function(){const t=ut(e=>String(e),"self");t.strip=e=>e.replaceAll(Ot(),"");for(const e in ue)Y[e]={get(){const i=Kt(this,ue[e]);return Object.defineProperty(this,e,{value:i}),i}};for(const e in de)Y[e]={get(){const i=Kt(this,de[e]);return Object.defineProperty(this,e,{value:i}),i}};return Ut=Object.defineProperties({},Y),Object.setPrototypeOf(t,Ut),t},"Colorize");for(const t in fe)Y[t]={get(){return(...e)=>Kt(this,fe[t](...e))}};Y.ansi256=Y.fg;Y.bgAnsi256=Y.bg;const U=new Ni,mo=U.bold,go=U.cyan,po=U.dim,wo=U.green,bo=U.inverse,yo=U.magenta,xo=U.red,vo=U.yellow;var Ti=Object.defineProperty,J=O((t,e)=>Ti(t,"name",{value:e,configurable:!0}),"F"),ki=Object.defineProperty,S=J((t,e)=>ki(t,"name",{value:e,configurable:!0}),"W");const Li=ii(import.meta.url),ot=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ee=S(t=>{if(typeof ot<"u"&&ot.versions&&ot.versions.node){const[e,i]=ot.versions.node.split(".").map(Number);if(e>22||e===22&&i>=3||e===20&&i>=16)return ot.getBuiltinModule(t)}return Li(t)},"__cjs_getBuiltinModule"),Q=ot,{execFileSync:Fi}=ee("node:child_process"),dt=ee("node:fs"),Pi=ee("node:tty");var _i=Object.defineProperty,K=S((t,e)=>_i(t,"name",{value:e,configurable:!0}),"e$4");const Ji=[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],Hi=12288,Gi=65510,Vi=[12288,12288,65281,65376,65504,65510],zi=8361,Di=65518,Yi=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],qi=32,Ui=10630,Ki=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],Zi=4352,Xi=262141,Oe=[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],mt=K((t,e)=>{let i=0,r=Math.floor(t.length/2)-1;for(;i<=r;){const a=Math.floor((i+r)/2),s=a*2;if(e<t[s])r=a-1;else if(e>t[s+1])i=a+1;else return!0}return!1},"s"),me=19968,[Qi,tr]=Nt(Oe);function Nt(t){let e=t[0],i=t[1];for(let r=0;r<t.length;r+=2){const a=t[r],s=t[r+1];if(me>=a&&me<=s)return[a,s];s-a>i-e&&(e=a,i=s)}return[e,i]}O(Nt,"Et");J(Nt,"zt");S(Nt,"W$3");K(Nt,"W");const Ne=K(t=>t<161||t>1114109?!1:mt(Ji,t),"j"),Te=K(t=>t<Hi||t>Gi?!1:mt(Vi,t),"k"),er=K(t=>t<zi||t>Di?!1:mt(Yi,t),"p"),ir=K(t=>t<qi||t>Ui?!1:mt(Ki,t),"y"),ke=K(t=>t>=Qi&&t<=tr?!0:t<Zi||t>Xi?!1:mt(Oe,t),"A");function Tt(t){return Ne(t)?"ambiguous":Te(t)?"fullwidth":er(t)?"halfwidth":ir(t)?"narrow":ke(t)?"wide":"neutral"}O(Tt,"Ct");J(Tt,"Kt");S(Tt,"z$1");K(Tt,"E");var rr=Object.defineProperty,ie=S((t,e)=>rr(t,"name",{value:e,configurable:!0}),"i$3");function gt(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}O(gt,"ft");J(gt,"$t");S(gt,"r$3");ie(gt,"t");function pt(t){return gt(t),Tt(t)}O(pt,"mt");J(pt,"It");S(pt,"d$4");ie(pt,"u");function re(t,{ambiguousAsWide:e=!1}={}){return gt(t),Te(t)||ke(t)||e&&Ne(t)?2:1}O(re,"Zt");J(re,"Ne");S(re,"f$3");ie(re,"d");var or=Object.defineProperty,Le=S((t,e)=>or(t,"name",{value:e,configurable:!0}),"a$3");const Fe=String.raw,ge=Fe`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,nr=Le(()=>new RegExp(Fe`\p{RI}{2}|(?)${ge}(?:\u200D${ge})*`,"gu"),"a"),st=new Set(["\x1B",""]),kt="\x07",Pe="[",oe="m",ft="]8;;",sr=39,hr=/[\u200B\uFEFF\u2060-\u2064]/g,ar=new RegExp(`(?:\\${Pe}(?<code>\\d+)m|\\${ft}(?<uri>.*)${kt})`),cr=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]])),X=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,pe=/\u001B\[(\d+(?:;\d+)*)?m[^\u001B]*(?:\u001B\[(?:\d+(?:;\d+)*)?m|$)/g,we=/\u001B\]8;[^\u0007\u001B]*(?:\u0007|\u001B\\)(.*?)\u001B\]8;;(?:\u0007|\u001B\\)/g,bt=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,It=nr();Le(t=>t.replace(It,""),"X");var lr=Object.defineProperty,Lt=S((t,e)=>lr(t,"name",{value:e,configurable:!0}),"m$2");const be=new Map,yt=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,Mt=Lt(t=>t>=32&&t<=126?"latin":t===8203||t===8204||t===8205||t===8288?"zero":t<=31||t>=127&&t<=159?"control":t>=160&&t<=255||t>=9472&&t<=9599?"latin":t>=4352&&t<=4607||t>=11904&&t<=40959||t>=44032&&t<=55215||t>=63744&&t<=64255||t>=65280&&t<=65519&&!(t>=65377&&t<=65439)||t>=12352&&t<=12543?"wide":t===8230?"latin":"other","I"),dr=Lt((t,e)=>{const i=Math.floor(t/65536),r=t%65536;let a=be.get(i);if(a||(a=new Map,be.set(i,a)),a.has(r))return a.get(r);let s;if(Mt(t)==="latin")s=e.width.regular;else if(Mt(t)==="control")s=e.width.control;else if(Mt(t)==="wide")s=e.width.wide;else switch(pt(t)){case"ambiguous":{s=e.width.ambiguousIsNarrow?e.width.regular:e.width.wide;break}case"fullwidth":{s=e.width.fullWidth;break}case"wide":{s=e.width.wide;break}default:s=e.width.regular}return a.set(r,s),s},"_"),ur=Lt(t=>t>=768&&t<=879||t>=6832&&t<=6911||t>=7616&&t<=7679||t>=8400&&t<=8447||t>=65056&&t<=65071||t>=917760&&t<=917999||t>=65024&&t<=65039||t>=3633&&t<=3642||t>=3655&&t<=3662||t>=3761&&t<=3769||t>=3771&&t<=3772||t>=3784&&t<=3789||t>=2304&&t<=2307||t>=2362&&t<=2383||t>=2385&&t<=2391||t>=2402&&t<=2403||t>=2433&&t<=2435||t>=2492&&t<=2500||t>=2509&&t<=2509||t>=2561&&t<=2563||t>=2620&&t<=2637||t>=1611&&t<=1631||t>=1648&&t<=1648||t>=1750&&t<=1773||t>=2276&&t<=2302||t>=1425&&t<=1469||t>=1471&&t<=1471||t>=1473&&t<=1474||t>=1476&&t<=1477||t>=1479&&t<=1479||t>=3893&&t<=3893||t>=3895&&t<=3895||t>=3897&&t<=3897||t>=3953&&t<=3966||t>=3968&&t<=3972||t>=3974&&t<=3975?!0:t>=768&&t<=777||t>=803&&t<=803,"B"),nt=Lt((t,e={})=>{if(!t||t.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const i={truncation:{countAnsiEscapeCodes:e.countAnsiEscapeCodes??!1,ellipsis:e.ellipsis??"",ellipsisWidth:e.ellipsisWidth??(e.ellipsis?nt(e.ellipsis,{...e,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:e.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:e.ambiguousIsNarrow??!1,ansi:e.ansiWidth??0,control:e.controlWidth??0,emoji:e.emojiWidth??2,fullWidth:e.fullWidth??2,halfWidth:e.halfWidth??1,regular:e.regularWidth??1,tab:e.tabWidth??8,wide:e.wideWidth??2}},r=Math.max(0,i.truncation.limit-i.truncation.ellipsisWidth),{length:a}=t,s=a>1e4;let o=0,h=0,n=a,c=!1;const d=t.includes("\x1B")||t.includes("");for(;o<a;){if(d&&(t[o]==="\x1B"||t[o]==="")){if(t.startsWith("\x1B]8;;",o)){const w="\x1B]8;;\x07",f=w.length,v=t.indexOf("\x07",o+5);if(v!==-1){const b=t.indexOf(w,v+1);if(b!==-1){const x=b+f,B=t.slice(v+1,b).replace(X,""),R=nt(B,{ambiguousIsNarrow:i.width.ambiguousIsNarrow,ansiWidth:i.width.ansi,controlWidth:i.width.control,countAnsiEscapeCodes:!1,ellipsis:i.truncation.ellipsis,ellipsisWidth:i.truncation.ellipsisWidth,emojiWidth:i.width.emoji,fullWidth:i.width.fullWidth,halfWidth:i.width.halfWidth,limit:Math.max(0,r-h),regularWidth:i.width.regular,tabWidth:i.width.tab,wideWidth:i.width.wide}),I=R.width;if(R.truncated)c=!0,n=Math.min(n,o);else if(h+I>r&&(n=Math.min(n,o),c=!0,h+I>i.truncation.limit))break;if(h+=I,o=x,c&&h>=i.truncation.limit)break;continue}}}if(X.lastIndex=o,X.test(t)){const w=X.lastIndex-o,f=i.truncation.countAnsiEscapeCodes?w:i.width.ansi;if(h+f>r&&(n=Math.min(n,o),h+f>i.truncation.limit)){c=!0;break}h+=f,o=X.lastIndex;continue}}const p=t.codePointAt(o);if(p===8203||p===65279||p>=8288&&p<=8292){o+=1;continue}if(p===9){if(h+i.width.tab>r&&(n=Math.min(n,o),h+i.width.tab>i.truncation.limit)){c=!0;break}h+=i.width.tab,o+=1;continue}if(yt.lastIndex=o,yt.test(t)){const w=(yt.lastIndex-o)*i.width.regular;if(h+w>r){const f=Math.floor((r-h)/i.width.regular);if(n=Math.min(n,o+f),h+w>i.truncation.limit){c=!0;break}}h+=w,o=yt.lastIndex;continue}if((p<=31||p>=127&&p<=159)&&(bt.lastIndex=o,bt.test(t))){const w=(bt.lastIndex-o)*i.width.control;if(h+w>r&&(n=Math.min(n,o+Math.floor((r-h)/i.width.control)),h+w>i.truncation.limit)){c=!0;break}h+=w,o=bt.lastIndex;continue}if(It.lastIndex=o,It.test(t)){if(h+i.width.emoji>r&&(n=Math.min(n,o),h+i.width.emoji>i.truncation.limit)){c=!0;break}h+=i.width.emoji,o=It.lastIndex;continue}const m=t.codePointAt(o)??0;if(ur(m)){o+=m>65535?2:1;continue}let g;if(s)g=dr(m,i);else switch(Mt(m)){case"control":{g=i.width.control;break}case"latin":{g=i.width.regular;break}case"wide":{g=i.width.wide;break}case"zero":{g=0;break}default:switch(pt(m)){case"ambiguous":{g=i.width.ambiguousIsNarrow?i.width.regular:i.width.wide;break}case"fullwidth":{g=i.width.fullWidth;break}case"wide":{g=i.width.wide;break}default:g=i.width.regular}}if(h+g>r&&(n=Math.min(n,o),h+g>i.truncation.limit)){c=!0;break}h+=g,o+=m>65535?2:1}let l=h,u=!1;return c&&i.truncation.limit>=i.truncation.ellipsisWidth&&(l=i.truncation.limit,u=!0),{ellipsed:u,index:c?n:a,truncated:c,width:l}},"O");var fr=Object.defineProperty,mr=S((t,e)=>fr(t,"name",{value:e,configurable:!0}),"e$1");const $=mr((t,e={})=>nt(t,{...e,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"d");var gr=Object.defineProperty,pr=S((t,e)=>gr(t,"name",{value:e,configurable:!0}),"s");let wr=class{static{O(this,"Ke")}static{J(this,"Ye")}static{S(this,"i")}static{pr(this,"s")}capacity;cache;constructor(t){this.capacity=t,this.cache=new Map}get(t){if(!this.cache.has(t))return;const e=this.cache.get(t);return this.cache.delete(t),this.cache.set(t,e),e}has(t){return this.cache.has(t)}set(t,e){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.capacity){const i=this.cache.keys().next().value;i!==void 0&&this.cache.delete(i)}this.cache.set(t,e)}delete(t){this.cache.delete(t)}clear(){this.cache.clear()}size(){return this.cache.size}};var br=Object.defineProperty,ht=S((t,e)=>br(t,"name",{value:e,configurable:!0}),"b$3");const ye=new wr(100),yr=new Intl.Segmenter("en",{granularity:"grapheme"}),xr=/^[\u0000-\u007F]*$/,vr=new Set(["0","22","23","24","27","28","29","39","49"]),Br=new Set(["1","3","4","7","8","9"]),xe=new Map([["22","1"],["23","3"],["24","4"],["27","7"],["28","8"],["29","9"]]),xt=ht(t=>t>="30"&&t<="37"||t>="90"&&t<="97"||t.startsWith("38;"),"b"),vt=ht(t=>t>="40"&&t<="47"||t>="100"&&t<="107"||t.startsWith("48;"),"S"),Rr=[{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"}],ve=ht((t,e)=>{let i=-1;for(const r of e){const a=t.indexOf(r);a!==-1&&(i===-1||a<i)&&(i=a)}return i},"R"),Wr=ht((t,e)=>{if(!t.includes("\x1B"))return[{after:"",before:"",content:t,visibleLength:$(t,e.width)}];const i=ye.get(t);if(i)return i;const r=[],a=[];let s=0,o;for(X.lastIndex=0;(o=X.exec(t))!==null;){const d=o[0];r.push(t.slice(s,o.index)),a.push(d),s=o.index+d.length}s<t.length&&r.push(t.slice(s));const h=[];for(const d of a){if(d==="\x1B[0m"||d==="\x1B]8;;\x07"){h.push(d);continue}if(d.startsWith("\x1B[")&&d.endsWith("m")){const l=d.slice(2,-1);if(vr.has(l)){h.push(d);continue}}}const n=new Set,c=[];for(const[d,l]of r.entries()){if(d>0&&a[d-1]){const m=a[d-1];if(m==="\x1B[0m")n.clear();else if(m==="\x1B]8;;\x07"){for(const g of n)if(g.startsWith("\x1B]8;;")&&!g.endsWith("\x1B]8;;\x07")){n.delete(g);break}}else if(m.startsWith("\x1B[")&&m.endsWith("m")){const g=m.slice(2,-1);if(g==="39"){for(const w of n)if(w.startsWith("\x1B[")&&w.endsWith("m")){const f=w.slice(2,-1);if(xt(f)){n.delete(w);break}}}else if(g==="49"){for(const w of n)if(w.startsWith("\x1B[")&&w.endsWith("m")){const f=w.slice(2,-1);if(vt(f)){n.delete(w);break}}}else if(xe.has(g)){const w=xe.get(g);for(const f of n)if(f===`\x1B[${w}m`){n.delete(f);break}}else{if(xt(g)){for(const w of n)if(w.startsWith("\x1B[")&&w.endsWith("m")){const f=w.slice(2,-1);if(xt(f)){n.delete(w);break}}}else if(vt(g)){for(const w of n)if(w.startsWith("\x1B[")&&w.endsWith("m")){const f=w.slice(2,-1);if(vt(f)){n.delete(w);break}}}else if(Br.has(g)){const w=`\x1B[${g}m`;n.has(w)&&n.delete(w)}n.add(m)}}else if(m.startsWith("\x1B]8;;")&&!m.endsWith("\x1B]8;;\x07")){for(const g of n)if(g.startsWith("\x1B]8;;")&&!g.endsWith("\x1B]8;;\x07")){n.delete(g);break}n.add(m)}}if(l==="")continue;let u="";if(n.size>0)if(h.includes("\x1B[0m"))u="\x1B[0m";else{const m=[];let g=!1;for(const b of n)if(b.startsWith("\x1B]8;;")&&!b.endsWith("\x1B]8;;\x07")){g=!0;break}g&&h.includes("\x1B]8;;\x07")&&m.push("\x1B]8;;\x07");let w=!1,f=!1;for(const b of n)if(b.startsWith("\x1B[")&&b.endsWith("m")){const x=b.slice(2,-1);xt(x)?w=!0:vt(x)&&(f=!0)}if(w&&f){const b=ve(t,["\x1B[3","\x1B[9","\x1B[38;"]),x=ve(t,["\x1B[4","\x1B[10","\x1B[48;"]);b>=0&&x>=0?b>x?m.push("\x1B[39m","\x1B[49m"):m.push("\x1B[49m","\x1B[39m"):m.push("\x1B[39m","\x1B[49m")}else w&&m.push("\x1B[39m"),f&&m.push("\x1B[49m");w&&f&&t.includes("\x1B[39m")&&t.includes("\x1B[49m")&&(t.indexOf("\x1B[39m")<t.indexOf("\x1B[49m")?(m.length-=2,m.push("\x1B[39m","\x1B[49m")):t.indexOf("\x1B[49m")<t.indexOf("\x1B[39m")&&(m.length-=2,m.push("\x1B[49m","\x1B[39m")));const v=Rr.filter(b=>n.has(b.open)).map(b=>({position:t.indexOf(b.open),style:b})).filter(b=>b.position>=0).toSorted((b,x)=>x.position-b.position);for(const b of v){const x=b;h.includes(x.style.close)&&m.push(x.style.close)}u=m.join("")}const p=[...n].join("");c.push({after:u,before:p,content:l,visibleLength:$(l,{fullWidth:1,wideWidth:1})})}return ye.set(t,c),c},"F"),Sr=ht((t,e,i,r)=>{const a=[...r.segmenter.segment(t)],s=[];let o=0,h=!1;for(const n of a){const c=$(n.segment,r.width),d=o,l=o+c;if(!h)if(d<e){o=l;continue}else h=!0;if(d>=i||l>i)break;s.push(n.segment),o=l}return s.join("")},"P"),D=ht((t,e=0,i=Number.MAX_SAFE_INTEGER,r={})=>{const a={segmenter:yr,...r};if(e>=i||t==="")return"";const s=$(t,a.width);if(e===0&&i>=s)return t;if(e<0||i<0)throw new RangeError("Negative indices aren't supported");if(!t.includes("\x1B"))return xr.test(t)?t.slice(e,i):Sr(t,e,i,a);if(pe.lastIndex=0,we.lastIndex=0,!pe.test(t)&&!we.test(t))return t;const o=Wr(t,a);if(o.length===0)return"";let h=0;const n=[];for(const[l,u]of o.entries()){const p=h,m=h+u.visibleLength;if(m>e&&p<i){const g=Math.max(0,e-p),w=Math.min(u.visibleLength,i-p);n.push({end:w,index:l,segment:u,start:g})}h=m}if(n.length===0)return"";const c=[],d=n[0].segment;c.push(d.before);for(let l=0;l<n.length;l++){const{end:u,segment:p,start:m}=n[l];if(m===0&&u===p.visibleLength)c.push(p.content);else{const g=[...a.segmenter.segment(p.content)];c.push(g.slice(m,u).map(w=>w.segment).join(""))}if(l<n.length-1){const g=n[l+1].segment,w=p.after,f=g.before;w!==f&&(w||f)&&c.push(w,f)}}return c.push(n.at(-1).segment.after),c.join("")},"T");var Ir=Object.defineProperty,Ft=S((t,e)=>Ir(t,"name",{value:e,configurable:!0}),"m$1");const Be="…",Mr=3,Bt=Ft((t,e,i=!1)=>{if(t.charAt(e)===" ")return e;const r=i?1:-1,a=Math.min(Mr,i?t.length-e:e);for(let s=1;s<=a;s++){const o=e+s*r;if(t.charAt(o)===" ")return o}return e},"u"),Rt=Ft((t,e,i)=>nt(t,{...i,ellipsis:"",ellipsisWidth:0,limit:e}).index,"f"),Wt=Ft((t,e,i)=>$(t.slice(0,e),i),"m"),Re=Ft((t,e,i={})=>{if(typeof t!="string")throw new TypeError(`Expected \`input\` to be a string, got ${typeof t}`);if(typeof e!="number")throw new TypeError(`Expected \`limit\` to be a number, got ${typeof e}`);if(t===""||e<=0)return"";const r=t.normalize("NFC"),{ellipsis:a=Be,position:s="end",preferTruncationOnSpace:o=!1}=i;let h=i.ellipsisWidth??(a===Be?1:void 0);h??=nt(a,{...i.width,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width;const{width:n}=nt(r,{...i.width,ellipsis:a,ellipsisWidth:h});if(n<=e)return r;switch(s){case"end":{if(o){const c=e-h,d=Rt(r,c,i.width),l=Bt(r,d),u=Wt(r,l,i.width);return D(r,0,u,{width:i.width})+a}return D(r,0,e-h,{width:i.width})+a}case"middle":{const c=Math.floor(e/2),d=Math.max(0,e-h),l=Math.min(c,d),u=Math.max(0,d-l);if(o){const p=Rt(r,l,i.width),m=Bt(r,p),g=Wt(r,m,i.width),w=n-u,f=Rt(r,w,i.width),v=Bt(r,f,!0),b=Wt(r,v,i.width);return D(r,0,g,{width:i.width})+a+D(r,b,n,{width:i.width}).trim()}return D(r,0,l,{width:i.width})+a+D(r,n-u,n,{width:i.width})}case"start":{if(o){const c=n-e+h,d=Rt(r,c,i.width),l=Bt(r,d,!0),u=Wt(r,l,i.width);return a+D(r,u,n,{width:i.width}).trim()}return a+D(r,n-e+h,n,{width:i.width})}default:throw new Error(`Invalid position: expected 'start', 'middle' or 'end', got '${s}'`)}},"v");var Ar=Object.defineProperty,T=S((t,e)=>Ar(t,"name",{value:e,configurable:!0}),"p$2");const jr=/\x1B\[(\d+)m/;class _e{static{O(this,"ie")}static{J(this,"Qt")}static{S(this,"w")}static{T(this,"I")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(e){const i=jr.exec(e);if(!i)return;const r=Number.parseInt(i[1],10);switch(r){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(r>=30&&r<=37||r>=90&&r<=97)this.activeForeground=e;else if(r>=40&&r<=47||r>=100&&r<=107)this.activeBackground=e;else if([1,2,3,4,7,8,9].includes(r))this.activeFormatting.push(e);else if([22,23,24,27,28,29].includes(r)){const a={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[r];a&&(this.activeFormatting=this.activeFormatting.filter(s=>!s.includes(a)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const e=[];if(this.activeFormatting.length>0){const i={"\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(r=>{const a=i[r];a&&e.push(a)})}return this.activeForeground&&e.push("\x1B[39m"),this.activeBackground&&e.push("\x1B[49m"),e.join("")}}const Cr=T((t,e)=>{if(!st.has(t[e]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const i=!0,r=t.slice(e+1,e+1+ft.length).join("")===ft;return{isInsideEscape:i,isInsideLinkEscape:r}},"O"),$r=T((t,e={})=>{const i=new _e;let r="",a=!1,s="",o="",h=!1;const n=[...t];for(let c=0;c<n.length;c++){const d=n[c];if(d&&st.has(d)){if(r){const g=e.getWidth?.(r)??0,w={isEscapeSequence:!1,isGrapheme:!0,text:r,width:g};if(h&&(w.isHyperlink=!0,w.hyperlinkUrl=o),e.onSegment?.(w,i)===!1)return;r=""}a=!0,s=d;const p=Cr(n,c),{isInsideLinkEscape:m}=p;if(m){let g=c+1;for(o="";g<n.length;){const f=n[g];if(f===kt)break;o+=f,g+=1}o=o.slice(4);const w={hyperlinkUrl:o,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(e.onSegment?.(w,i)===!1)return;c=g,h=!0,a=!1,s="";continue}if(c+1<n.length&&n[c+1]==="\\"&&h){const g={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(e.onSegment?.(g,i)===!1)return;h=!1,o="",c+=1,a=!1,s="";continue}}if(a){if(s!==d&&(s+=d),d===oe){a=!1,i.processEscape(s);const p={isEscapeSequence:!0,isGrapheme:!1,text:s,width:0};if(e.onSegment?.(p,i)===!1)return;s=""}continue}r+=d;const l=e.getWidth?.(r)??0,u={isEscapeSequence:!1,isGrapheme:!0,text:r,width:l};if(h&&(u.isHyperlink=!0,u.hyperlinkUrl=o),e.onSegment?.(u,i)===!1)return;r=""}if(r){const c=e.getWidth?.(r)??0,d={isEscapeSequence:!1,isGrapheme:!0,text:r,width:c};h&&(d.isHyperlink=!0,d.hyperlinkUrl=o),e.onSegment?.(d,i)}if(s){const c={isEscapeSequence:!0,isGrapheme:!1,text:s,width:0};e.onSegment?.(c,i)}},"P"),We=T(t=>`${st.values().next().value}${Pe}${String(t)}${oe}`,"k"),Se=T(t=>`${st.values().next().value}${ft}${t}${kt}`,"F"),Er=T(t=>{if(t.length===0)return"";if(t.length===1)return t[0];let e="",i,r;const a=t.join(`
|
|
3
|
+
`),s=[...a];let o=0;for(const[h,n]of s.entries()){if(e+=n,st.has(n)){const d=ar.exec(a.slice(o))?.groups??{};if(d.code!==void 0){const l=Number.parseFloat(d.code);i=l===sr?void 0:l}else d.uri!==void 0&&(r=d.uri.length===0?void 0:d.uri)}const c=cr.get(Number(i));s[h+1]===`
|
|
4
|
+
`?(r&&(e+=Se("")),i&&c&&(e+=We(c))):n===`
|
|
5
|
+
`&&(i&&c&&(e+=We(i)),r&&(e+=Se(r))),o+=n.length}return e},"q"),Je=/(?=\s)|(?<=\s)/,He=/^\s+$/,Gt=T(t=>{if(!t.includes("\x1B"))return t;let e=t;return t.includes("\x1B[30m")&&(e+="\x1B[39m"),t.includes("\x1B[42m")&&(e+="\x1B[49m"),e},"B"),tt=T(t=>{const e=t.split(" ");let i=e.length;for(;i>0&&$(e[i-1])===0;)i--;return i===e.length?t:e.slice(0,i).join(" ")+e.slice(i).join("")},"m"),Ge=T((t,e,i)=>{if(t.length===0)return[""];if(e<=0)return[t];const r=[],a=new _e;let s="",o=0,h=!1,n=!1,c="",d=0;for(;d<t.length;){const l=t[d];if(st.has(l)){h=!0,c=l,s+=l,n=t.startsWith(ft,d+1),d+=1;continue}if(h){c+=l,s+=l,n?l===kt&&(h=n=!1):l===oe&&(h=!1,a.processEscape(c)),d+=1;continue}const u=$(l),p=l===" ";if(u===0){s+=l,d+=1;continue}if(o+u>e&&(s&&r.push(s+a.getEndEscapesForAllActiveAttributes()),s=a.getStartEscapesForAllActiveAttributes(),o=$(s),p&&i)){for(;d<t.length&&t[d]===" ";)d+=1;continue}if(s+=l,o+=u,o===e&&d<t.length-1&&(r.push(s+a.getEndEscapesForAllActiveAttributes()),s=a.getStartEscapesForAllActiveAttributes(),o=$(s),d+1<t.length&&t[d+1]===" "&&i)){for(d+=1;d<t.length&&t[d]===" ";)d+=1;continue}d+=1}return s&&r.push(s+a.getEndEscapesForAllActiveAttributes()),i?r.map(l=>tt(l)):r},"b"),Or=T((t,e,i)=>{if(t.length===0)return[];const r=i?t.trim():t;if(r.length===0)return[];const a=[];let s="",o=0;return $r(r,{getWidth:$,onSegment:T((h,n)=>{const c=h.text??"";if(h.isEscapeSequence)s+=c;else{const d=c===" ";if(h.width===0)return s+=c,!0;if(o+h.width>e&&(s&&a.push(s),s=n.getStartEscapesForAllActiveAttributes(),o=0,d))return i||a.push(n.getStartEscapesForAllActiveAttributes()+c),!0;s+=c,o+=h.width}return!0},"onSegment")}),s&&a.push(s),i?a.map(h=>tt(h)):a},"G"),Nr=T((t,e,i)=>{if(t.length===0)return[];const r=i?t.trim():t;if(r.length===0)return[];const a=r.split(Je),s=[];let o="",h=0,n=0;for(;n<a.length;){const c=a[n],d=He.test(c),l=$(c);if(c.length===0){n+=1;continue}if(i&&d&&h===0){n+=1;continue}if(h+l>e&&h>0){i?s.push(tt(o)):s.push(o),o="",h=0;continue}o+=c,h+=l,n+=1}return o&&(i?s.push(tt(o)):s.push(o)),s},"j"),Tr=T((t,e,i)=>{if(t.length===0)return[];const r=i?t.trim():t;if(r.length===0)return[];const a=r.split(Je),s=[];let o="",h=0,n=0;for(;n<a.length;){const c=a[n],d=He.test(c),l=$(c);if(c.length===0){n+=1;continue}if(i&&d&&h===0){n+=1;continue}if(l>e){o&&s.push(Gt(i?tt(o):o));const u=Ge(c,e,i);if(u.length>0){for(let p=0;p<u.length-1;p+=1)s.push(u[p]);o=u.at(-1),h=$(o)}else o="",h=0;n+=1;continue}if(h+l>e&&h>0&&(s.push(Gt(i?tt(o):o)),o="",h=0,i&&d)){n+=1;continue}o+=c,h+=l,n+=1}return o&&s.push(Gt(i?tt(o):o)),s},"K"),St={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},kr=T((t,e={})=>{const{removeZeroWidthCharacters:i=!0,trim:r=!0,width:a=80,wrapMode:s=St.PRESERVE_WORDS}=e;if(r&&t.trim()==="")return"";let o=t.normalize("NFC").replaceAll(`\r
|
|
6
|
+
`,`
|
|
7
|
+
`);return i&&(o=o.replaceAll(hr,"")),o.split(`
|
|
8
|
+
`).map(h=>{if(r&&h.trim()==="")return"";let n;switch(s){case St.BREAK_AT_CHARACTERS:{n=Or(h,a,r);break}case St.BREAK_WORDS:{n=Tr(h,a,r);break}case St.STRICT_WIDTH:{n=Ge(h,a,r);break}default:n=Nr(h,a,r)}return Er(n)}).join(`
|
|
9
|
+
`)},"V");var Lr=Object.defineProperty,Z=S((t,e)=>Lr(t,"name",{value:e,configurable:!0}),"n$3");const Ve=80,ze=24,Zt=Z((t,e,{shell:i,env:r}={})=>Fi(t,e,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:i,env:r}).trim(),"exec"),At=Z((t,e)=>({columns:Number.parseInt(t,10),rows:Number.parseInt(e,10)}),"create"),De=Z((t,e)=>{const{columns:i,rows:r}=At(t,e);if(!(Number.isNaN(i)||Number.isNaN(r))&&!(i===Ve&&r===ze))return{columns:i,rows:r}},"createIfNotDefault"),Fr=Z(()=>{if(Q.platform!=="linux")return!0;try{const t=dt.readFileSync("/proc/self/stat","utf8"),e=t.lastIndexOf(") ");if(e===-1)return!1;const i=t.slice(e+2).trim().split(/\s+/),r=Number.parseInt(i[2],10),a=Number.parseInt(i[5],10);return Number.isNaN(r)||Number.isNaN(a)||a<=0?!1:r===a}catch{return!1}},"isForegroundProcess");function Pt(){const{env:t,stdout:e,stderr:i}=Q;if(e?.columns&&e?.rows)return At(e.columns,e.rows);if(i?.columns&&i?.rows)return At(i.columns,i.rows);if(t.COLUMNS&&t.LINES)return At(t.COLUMNS,t.LINES);const r={columns:Ve,rows:ze};return Q.platform==="win32"?Vt()??r:Q.platform==="darwin"?Ie()??Vt()??r:Ie()??Vt()??Pr()??r}O(Pt,"At");J(Pt,"se");S(Pt,"O");Z(Pt,"terminalSize");const Ie=Z(()=>{try{const t=Q.platform==="darwin"?dt.constants.O_EVTONLY|dt.constants.O_NONBLOCK:dt.constants.O_NONBLOCK,{columns:e,rows:i}=Pi.WriteStream(dt.openSync("/dev/tty",t));return{columns:e,rows:i}}catch{}},"devTty"),Vt=Z(()=>{try{const t=Zt("tput",["cols"],{env:{TERM:"dumb",...Q.env}}),e=Zt("tput",["lines"],{env:{TERM:"dumb",...Q.env}});if(t&&e)return De(t,e)}catch{}},"tput"),Pr=Z(()=>{try{if(!Fr())return;const t=Zt("resize",["-u"]).match(/\d+/g);if(t.length===2)return De(t[0],t[1])}catch{}},"resize");var _r=Object.defineProperty,Ye=S((t,e)=>_r(t,"name",{value:e,configurable:!0}),"e");const it=Ye((t,e)=>{switch(e){case"bottom":return{body:t.bottomBody,join:t.bottomJoin,left:t.bottomLeft,right:t.bottomRight};case"middle":return{body:t.joinBody,join:t.joinJoin,left:t.joinLeft,right:t.joinRight};case"top":return{body:t.topBody,join:t.topJoin,left:t.topLeft,right:t.topRight};default:throw new Error(`Invalid borderType: ${String(e)}`)}},"getHorizontalBorderChars"),Jr=Ye(t=>({join:t.bodyJoin,left:t.bodyLeft,right:t.bodyRight}),"getVerticalBorderChars");var Hr=Object.defineProperty,Gr=S((t,e)=>Hr(t,"name",{value:e,configurable:!0}),"n$1");const Et=Gr((t,e,i)=>{let r=0;for(let a=0;a<i;a+=1)r+=t[e+a]??0;return i>1&&(r+=i-1),r},"calculateCellTotalWidth");var Vr=Object.defineProperty,zr=S((t,e)=>Vr(t,"name",{value:e,configurable:!0}),"a");const Xt=zr((t,e,i,r)=>{let a=e;for(;a>0&&t[a-1]?.[i]===r;)a-=1;let s=e;for(;s<t.length-1&&t[s+1]?.[i]===r;)s+=1;let o;const h=s-a+1;if(h===1)o=!0;else switch(r.vAlign){case"bottom":{o=e===s;break}case"middle":{const n=a+Math.floor(h/2);o=e===n;break}case"top":{o=e===a;break}default:o=e===a}return{firstRow:a,lastRow:s,showContent:o}},"determineCellVerticalPosition");var Dr=Object.defineProperty,Yr=S((t,e)=>Dr(t,"name",{value:e,configurable:!0}),"F");const qr=Yr((t,e,i,r,a)=>{if(t.length===0)return[];let s=t.length-1;for(let n=0;n<t.length;n+=1){const c=t[n];if(c){for(const[d,l]of c.entries())if(l&&a(t,n,d,l)===n){const u=Xt(t,n,d,l);s=Math.max(s,u.lastRow)}}}const o=Array.from({length:s+1}).fill(1);for(let n=0;n<t.length;n+=1){const c=t[n];if(c)for(let d=0;d<i.columns;d+=1){const l=c[d];if(l&&a(t,n,d,l)===n&&(l.rowSpan??1)===1){const u=l.colSpan??1,p=Et(e,d,u),m=r(l,p).length;o[n]=Math.max(o[n]??1,m)}}}const h=Array.from({length:o.length}).fill(!1);if(i.fixedRowHeights)for(let n=0;n<o.length;n+=1){let c;i.fixedRowHeights[n]!==void 0?c=i.fixedRowHeights[n]:i.fixedRowHeights.length===1&&i.fixedRowHeights[0]!==void 0&&(c=i.fixedRowHeights[0]),c!==void 0&&(o[n]=Math.max(1,c),h[n]=!0)}for(let n=0;n<t.length;n+=1){const c=t[n];if(c)for(let d=0;d<i.columns;d+=1){const l=c[d];if(l&&a(t,n,d,l)===n&&(l.rowSpan??1)>1){const u=l.colSpan??1,p=Et(e,d,u),m=r(l,p).length-1,g=Xt(t,n,d,l),{firstRow:w,lastRow:f}=g;let v=0,b=0;for(let B=w;B<=f&&B<o.length;B+=1)v+=o[B]??1,h[B]||(b+=1);const x=m-v;if(x>0)if(b>0){const B=Math.ceil(x/b);let R=0;for(let I=w;I<=f&&I<o.length;I+=1)if(!h[I]){const M=Math.min(B,x-R);if(o[I]=(o[I]??1)+M,R+=M,R>=x)break}}else console.warn(`[calculateRowHeights] Content of spanning cell exceeds fixed height allocated. Cell: ${JSON.stringify(l.content)}, Required: ${String(m)}, Allocated: ${String(v)} (fixed).`)}}}return o},"calculateRowHeights");var Ur=Object.defineProperty,Kr=S((t,e)=>Ur(t,"name",{value:e,configurable:!0}),"i");const rt=Kr((t,e,i,r)=>{let a=e;for(;a>0&&t[a-1]?.[i]===r;)a-=1;return a},"findFirstOccurrenceRow");var Zr=Object.defineProperty,Xr=S((t,e)=>Zr(t,"name",{value:e,configurable:!0}),"n");const Qt="__EMPTY__",Me=Xr(t=>{if(typeof t=="string")return{content:t};if(typeof t=="number"||typeof t=="bigint"||typeof t=="boolean")return{content:String(t)};if(t==null)return{content:Qt};if(typeof t=="object"&&"content"in t){let{content:e}=t;if(typeof e=="number"||typeof e=="bigint"||typeof e=="boolean")e=String(e);else if(e==null)e=Qt;else if(typeof e!="string")throw new TypeError(`Invalid item type in grid cell: expected string, number, null, undefined, or GridItem object, but received ${JSON.stringify(t)} (type: ${typeof t})`);return{...t,content:e}}throw new TypeError(`Invalid item type in grid cell: expected string, number, null, undefined, or GridItem object, but received ${JSON.stringify(t)} (type: ${typeof t})`)},"normalizeGridCell");var Qr=Object.defineProperty,to=S((t,e)=>Qr(t,"name",{value:e,configurable:!0}),"p");const eo=to((t,e,i,r,a)=>{const s=$(t),o=" ".repeat(Math.max(0,r)),h=" ".repeat(Math.max(0,a));if(s===0)return o+" ".repeat(Math.max(0,e))+h;const n=Math.max(0,e-s);switch(i){case"center":{const c=Math.floor(n/2),d=n-c;return o+" ".repeat(c)+t+" ".repeat(d)+h}case"right":return o+" ".repeat(n)+t+h;default:return o+t+" ".repeat(n)+h}},"padAndAlignContent");var io=Object.defineProperty,ne=S((t,e)=>io(t,"name",{value:e,configurable:!0}),"H");const lt=/\r?\n/,Ae=/\s+/,W=ne((t,e)=>!t||!e?t:typeof e=="function"?e(t):e.open+t+e.close,"applyColor");class _t{static{O(this,"bt")}static{J(this,"Mt")}static{S(this,"Grid")}static{ne(this,"Grid")}#t;#o=[];#e;#n=new WeakMap;#i=new WeakMap;static createGridLayout(){return[]}constructor(e){const i={autoColumns:1,autoFlow:"row",autoRows:1,balancedWidths:!1,gap:0,paddingLeft:1,paddingRight:1,rows:0,showBorders:e.border!==void 0,truncate:!1,truncateOverflow:!0,wordWrap:!1};let r;Array.isArray(e.fixedRowHeights)?r=e.fixedRowHeights:typeof e.fixedRowHeights=="number"&&(r=[e.fixedRowHeights]),this.#t={...i,...e,columns:e.columns,fixedRowHeights:r,showBorders:e.border!==void 0||(e.showBorders??!1)};let{terminalWidth:a}=this.#t;if(a===void 0){const{columns:s}=Pt();a=s}this.#e=a,this.#t.maxWidth&&(this.#t.maxWidth=Math.min(this.#t.maxWidth,this.#e))}addItem(e){return this.#o.push(Me(e)),this}addItems(e){return this.#o.push(...e.map(i=>Me(i))),this}setColumns(e){return this.#t.columns=e,this}setRows(e){return this.#t.rows=e,this}setBorder(e){return this.#t.border=e,this}setShowBorders(e){return this.#t.showBorders=e,this}setMaxWidth(e){return this.#t.maxWidth=e,this}toString(){const e=_t.createGridLayout();if(this.#n=new WeakMap,this.#i=new WeakMap,this.placeItems(e),e.length===0||e[0]?.length===0)return"";let i=this.calculateColumnWidths(e);const r=this.calculateTotalGridWidth(i),a=typeof this.#t.maxWidth=="number"&&this.#t.maxWidth>0?Math.min(this.#t.maxWidth,this.#e):this.#e;return r>a&&(i=this.adjustColumnWidthsForTerminal(i,r)),this.renderGrid(e,i)}placeItems(e){let i=0,r=0;const a=this.#t.rows>0?this.#t.rows:Number.POSITIVE_INFINITY;for(let s=0;s<this.#o.length;s+=1){const o=this.#o[s];if(o.content===Qt&&!(o.rowSpan&&o.rowSpan>1)&&!(o.colSpan&&o.colSpan>1)){if(this.#t.autoFlow==="row")r+=1,r>=this.#t.columns&&(r=0,i+=1);else{i+=1;const m=e.length>0?e.length:a;i>=m&&m!==Number.POSITIVE_INFINITY?(i=0,r+=1):e.length===0&&m===Number.POSITIVE_INFINITY&&(r+=1)}continue}const h=o.colSpan??1,n=o.rowSpan??1;let c=!1,d=i,l=r,u=0;const p=(e.length+n+5)*this.#t.columns;for(;!c&&d<a&&u<p;){for(u+=1;d+n>e.length;)e.push(Array.from({length:this.#t.columns}).fill(void 0));if(this.canPlaceItem(e,d,l,h,n))if(this.placeItem(e,d,l,o),c=!0,this.#t.autoFlow==="row")r=l+h,i=d,r>=this.#t.columns&&(r=0,i+=1);else{i=d+n,r=l;const m=e.length>0?e.length:a;i>=m&&(i=0,r+=1)}else if(this.#t.autoFlow==="row")l+=1,l>=this.#t.columns&&(l=0,d+=1);else{for(d+=1;d+n>e.length;)e.push(Array.from({length:this.#t.columns}).fill(void 0));const m=e.length>0?e.length:a;if(d>=m&&(d=0,l+=1,l>=this.#t.columns))break}}if(!c)if(console.warn(`@visulima/tabular: Could not find position for item: ${JSON.stringify(o)} after ${String(u)} attempts. Grid might be too small or layout impossible.`),this.#t.autoFlow==="row")r+=1,r>=this.#t.columns&&(r=0,i+=1);else{i+=1;const m=e.length>0?e.length:a;i>=m&&(i=0,r+=1)}if(u>=p)break}if(this.#t.rows===0)for(;e.length>0&&e.at(-1)?.every(s=>s===void 0);)e.pop()}canPlaceItem(e,i,r,a,s,o=!1){if(r+a>this.#t.columns)return!1;for(let h=i;h<i+s;h+=1)if(h<e.length){if(!e[h])return console.warn(`Grid layout unexpectedly missing row ${String(h)} during canPlaceItem check.`),!1;for(let n=r;n<r+a;n+=1)if(e[h]?.[n]!==void 0)return!1}else if(!o)return!1;return!0}computeWrappedContentWidth(e,i,r,a){let s=e;if(a){if(s>20){let o=0;for(const h of i){const n=h.split(Ae);for(const c of n)o=Math.max(o,Math.min($(c),r))}s=Math.min(s,Math.max(o+4,12))}}else{let o=0;for(const h of i){const n=h.split(Ae);for(const c of n)o=Math.max(o,Math.min($(c),r))}s=Math.min(s,Math.max(o+12,20))}return s}placeItem(e,i,r,a){const s=a.rowSpan??1,o=a.colSpan??1;for(let h=i;h<i+s;h+=1){for(;h>=e.length;)e.push(Array.from({length:this.#t.columns}).fill(void 0));for(let n=r;n<r+o;n+=1)n<this.#t.columns&&(e[h]||(console.error(`Logic error: Row ${String(h)} not found in placeItem despite check.`),e[h]=Array.from({length:this.#t.columns}).fill(void 0)),e[h][n]=a)}}calculateTotalGridWidth(e){let i=0;const r=this.#t.showBorders?this.#t.border:void 0;r&&(i+=r.bodyLeft.width,i+=r.bodyRight.width);const a=e.length,s=this.#t.showBorders?r?.bodyJoin.width??0:0,o=this.#t.gap;for(let h=0;h<a;h+=1)i+=e[h]??0,h<a-1&&(i+=o,i+=s);return i}adjustColumnWidthsForTerminal(e,i){const r=typeof this.#t.maxWidth=="number"&&this.#t.maxWidth>0?Math.min(this.#t.maxWidth??0,this.#e):this.#e;if(i<=r)return e;let a=0;const s=e.length,o=this.#t.showBorders?this.#t.border:void 0;if(o&&(a+=o.bodyLeft.width,a+=o.bodyRight.width),s>1){a+=(s-1)*this.#t.gap;const u=o?.bodyJoin.width??0;a+=(s-1)*u}if(a>=r)return Array.from({length:s}).fill(1);const h=r-a,n=e.reduce((u,p)=>u+p,0);if(n===0){const u=Math.floor(h/s);return Array.from({length:s}).fill(u)}const c=e.map(u=>{const p=u/n;return Math.max(1,Math.floor(h*p))});let d=c.reduce((u,p)=>u+p,0)-h;for(;d>0;){let u=-1;for(let p=0;p<c.length;p+=1)(c[p]??0)>1&&(u===-1||(c[p]??0)>(c[u]??0))&&(u=p);if(u===-1)break;c[u]-=1,d-=1}let l=h-c.reduce((u,p)=>u+p,0);if(l>0){const u=c.map((p,m)=>{const g=n>0?(e[m]??0)/n:1/s;return{index:m,remainder:h*g%1}}).toSorted((p,m)=>m.remainder-p.remainder);for(const p of u){if(l<=0)break;const{index:m}=p;c[m]!==void 0&&(c[m]+=1,l-=1)}}return c}calculateBalancedColumnWidths(e){const i=this.calculateMinimumColumnWidthsWithGrowableInfo(e),r=i.widths,{growableColumns:a}=i,s=typeof this.#t.maxWidth=="number"&&this.#t.maxWidth>0?Math.min(this.#t.maxWidth,this.#e):this.#e,o=this.#t.showBorders?this.#t.border:void 0;let h=0;if(o&&(h+=o.bodyLeft.width,h+=o.bodyRight.width),this.#t.columns>1){h+=(this.#t.columns-1)*this.#t.gap;const d=o?.bodyJoin.width??0;h+=(this.#t.columns-1)*d}const n=Math.max(0,s-h);if(r.reduce((d,l)=>d+l,0)>0){const d=Math.floor(n/this.#t.columns),l=Array.from({length:this.#t.columns}).fill(d),u=d*this.#t.columns;let p=n-u;for(let f=0;f<l.length&&p>0;f+=1)l[f]=(l[f]??0)+1,p-=1;const m=[];let g=0;for(let f=0;f<this.#t.columns;f+=1){const v=l[f]??0,b=r[f]??0,x=Math.max(v,b);m.push(x),g+=x}if(g>n){const f=n/g,v=m.map(B=>Math.max(3,Math.floor(B*f))),b=v.reduce((B,R)=>B+R,0);let x=n-b;for(let B=0;B<v.length&&x>0;B+=1)v[B]=(v[B]??0)+1,x-=1;return v}let w=n-g;if(w>0){const f=a.length>0?a:m.map((v,b)=>b);for(;w>0&&f.length>0;)for(const v of f){if(w<=0)break;m[v]=(m[v]??0)+1,w-=1}}return m}const c=Math.floor(n/this.#t.columns);return Array.from({length:this.#t.columns}).fill(c)}calculateMinimumColumnWidthsWithGrowableInfo(e){const i=Array.from({length:this.#t.columns}).fill(0),r=[],a=this.#t.paddingLeft+this.#t.paddingRight,s=this.#t.gap+(this.#t.showBorders?this.#t.border?.bodyJoin.width??0:0);for(let o=0;o<this.#t.columns;o+=1)for(let h=0;h<e.length;h+=1){const n=e[h]?.[o];if(!n||rt(e,h,o,n)!==h||o>0&&e[h]?.[o-1]===n)continue;const c=n.colSpan??1,d=n.maxWidth??Number.POSITIVE_INFINITY,l=String(n.content??"").split(lt),u=this.#t.wordWrap&&n.wordWrap!==!1;let p=0;for(const m of l)p=Math.max(p,Math.min($(m),d));p=this.computeWrappedContentWidth(p,l,d,u),c===1&&(i[o]=Math.max(i[o]??0,p+a),u&&!r.includes(o)&&r.push(o))}for(let o=0;o<e.length;o+=1)for(let h=0;h<this.#t.columns;h+=1){const n=e[o]?.[h];if(!n||rt(e,o,h,n)!==o||h>0&&e[o]?.[h-1]===n)continue;const c=n.colSpan??1;if(c>1){const d=n.maxWidth??Number.POSITIVE_INFINITY,l=String(n.content??"").split(lt),u=this.#t.wordWrap&&n.wordWrap!==!1;let p=0;for(const f of l)p=Math.max(p,Math.min($(f),d));p=this.computeWrappedContentWidth(p,l,d,u);const m=(c-1)*s,g=p+a+m;let w=0;for(let f=h;f<h+c;f+=1)w+=i[f]??0;if(g>w){const f=g-w,v=Math.ceil(f/c);for(let b=0;b<c&&h+b<this.#t.columns;b+=1)i[h+b]=Math.max(i[h+b]??0,v)}}}return{growableColumns:r,widths:i}}calculateColumnWidths(e){if(this.#t.fixedColumnWidths&&this.#t.fixedColumnWidths.length===this.#t.columns){const s=this.#t.fixedColumnWidths;if(!s.some(o=>o===void 0||!Number.isFinite(o)))return[...s];if(this.#t.balancedWidths){const o=Array.from({length:s.length}).fill(0),h=typeof this.#t.maxWidth=="number"&&this.#t.maxWidth>0?Math.min(this.#t.maxWidth,this.#e):this.#e,n=this.calculateTotalGridWidth(Array.from({length:o.length}).fill(0)),c=Math.max(0,h-n);let d=0;const l=[];for(const[m,g]of s.entries())typeof g=="number"&&Number.isFinite(g)?(o[m]=g,d+=g):l.push(m);let u=Math.max(0,c-d);const p=l.length>0?Math.floor(u/l.length):0;for(const m of l)o[m]=p;u-=p*l.length;for(const m of l){if(u<=0)break;o[m]+=1,u-=1}return o}}if(this.#t.balancedWidths)return this.calculateBalancedColumnWidths(e);const i=Array.from({length:this.#t.columns}).fill(0),r=this.#t.paddingLeft+this.#t.paddingRight,a=this.#t.gap+(this.#t.showBorders?this.#t.border?.bodyJoin.width??0:0);for(let s=0;s<this.#t.columns;s+=1)for(let o=0;o<e.length;o+=1){const h=e[o]?.[s];if(!h||rt(e,o,s,h)!==o||s>0&&e[o]?.[s-1]===h)continue;const n=h.colSpan??1,c=h.maxWidth??Number.POSITIVE_INFINITY,d=String(h.content??"").split(lt);let l=0;for(const u of d)l=Math.max(l,Math.min($(u),c));n===1&&(i[s]=Math.max(i[s]??0,l+r))}for(let s=0;s<e.length;s+=1)for(let o=0;o<this.#t.columns;o+=1){const h=e[s]?.[o];if(!h||rt(e,s,o,h)!==s||o>0&&e[s]?.[o-1]===h)continue;const n=h.colSpan??1;if(n>1){const c=h.maxWidth??Number.POSITIVE_INFINITY,d=String(h.content??"").split(lt),l=this.#t.wordWrap&&h.wordWrap!==!1;let u=0;for(const f of d)u=Math.max(u,Math.min($(f),c));u=this.computeWrappedContentWidth(u,d,c,l);let p=0;for(let f=o;f<o+n;f+=1)p+=i[f]??0;const m=n>1?(n-1)*a:0,g=u+r+m,w=p+m;if(g>w){const f=g-w,v=Math.floor(f/n);let b=0;for(let x=0;x<n&&o+x<this.#t.columns;x+=1){const B=Math.min(v,f-b);if(i[o+x]=(i[o+x]??0)+B,b+=B,b>=f)break}}}}if(this.#t.maxWidth){const s=this.calculateTotalGridWidth(i);if(s>this.#t.maxWidth)return this.adjustColumnWidthsForTerminal(i,s)}return i}renderVisualRowContent(e,i,r,a,s){const o=e[i];if(!o)return"";const h=this.#t.borderColor??this.#t.foregroundColor??void 0,n=[],c=this.#t.showBorders&&this.#t.border?Jr(this.#t.border):void 0,d=c&&c.left.width>0?c.left.char:"",l=c&&c.right.width>0?c.right.char:"",u=c&&c.join.width>0?c.join.char:"",p=" ".repeat(this.#t.gap);d&&n.push(W(W(d,h),this.#t.backgroundColor));let m=0;for(;m<this.#t.columns;){const g=o[m]??void 0;let w=1,f;if(g){const v=g.colSpan??1;w=v;const b=rt(e,i,m,g),x=Et(a,m,v),B=this.alignCellContent(g,x),R=B.length,I=this.getCachedCellVerticalPosition(e,i,m,g);I.firstRow!==b&&console.warn(`Mismatch between findFirstOccurrenceRow (${String(b)}) and determineCellVerticalPosition (${String(I.firstRow)})`);const M=s.slice(b,I.lastRow+1).reduce((A,F)=>A+F,0),E=I.lastRow-I.firstRow+1;let k=r,L=0;for(let A=b;A<i;A+=1)A<s.length&&(k+=s[A]??1),A<I.lastRow&&(L+=1);k+=L;const H=g.vAlign??"top";let _;switch(H){case"bottom":{let A=r;for(let P=b;P<i;P+=1)A+=s[P]??1;const F=M-R;_=A>=F?A-F:-1;break}case"middle":{const A=Math.round((M-R)/2);let F=r;for(let P=b;P<i;P+=1)F+=s[P]??1;_=F>=A&&F<A+R?F-A:-1;break}case"top":{_=k;break}default:_=k}const Jt=_>=0&&_<R;if(f=" ".repeat(Math.max(0,x)),Jt){let A=!1;H==="middle"&&E%2===0&&_===0&&(A=!0),A||(f=B[_]??f)}g.colSpan&&g.colSpan>1&&(f+=p.repeat(g.colSpan)),g.foregroundColor?f=W(f,g.foregroundColor):this.#t.foregroundColor&&(f=W(f,this.#t.foregroundColor)),g.backgroundColor?f=W(f,g.backgroundColor):this.#t.backgroundColor&&(f=W(f,this.#t.backgroundColor))}else{const v=this.#t.paddingLeft+this.#t.paddingRight,b=Math.max(0,(a[m]??0)-v),x=" ".repeat(this.#t.paddingLeft+b+this.#t.paddingRight);f=W(W(r===0?x:" ".repeat(x.length),this.#t.foregroundColor),this.#t.backgroundColor)}n.push(f),m+w<this.#t.columns&&(n.push(p),this.#t.showBorders&&u&&n.push(W(W(u,h),this.#t.backgroundColor)),this.#t.gap>0&&n.push(p)),m+=w}return l&&n.push(W(W(l,h),this.#t.backgroundColor)),n.join("")}alignCellContent(e,i){const r=this.#n.get(e);if(r?.has(i))return r.get(i);const{paddingLeft:a,paddingRight:s}=this.#t,o=a+s,h=i-o;if(h<=0){const l=[" ".repeat(o+this.#t.gap)];return r?r.set(i,l):this.#n.set(e,new Map([[i,l]])),l}let n;const c=String(e.content??"");if(n=c.includes(`
|
|
10
|
+
`)||c.includes("\r")?c.split(lt):[c],this.#t.wordWrap&&e.wordWrap!==!1){const l=typeof this.#t.wordWrap=="object"?this.#t.wordWrap:{},u=typeof e.wordWrap=="object"?e.wordWrap:l;n=kr(c,{...u,width:h}).split(`
|
|
11
|
+
`)}if(this.#t.truncate&&e.truncate!==!1){const l=typeof this.#t.truncate=="object"?this.#t.truncate:{},u=typeof e.truncate=="object"?e.truncate:l;n=n.map(p=>Re(p,h,u))}else this.#t.truncateOverflow&&(n=n.map(l=>$(l)>h?Re(l,h,{}):l));const d=n.map(l=>eo(l,h,e.hAlign??"left",a,s));return r?r.set(i,d):this.#n.set(e,new Map([[i,d]])),d}renderHorizontalBorder(e,i,r,a,s,o=-1){if(!this.#t.showBorders||!this.#t.border)return"";const h=this.#t.border,n=it(h,s),c=n.body.char,d=n.body.width,l=h.bodyJoin.char;if(s!=="middle"&&d===0)return"";let u=n.left.char,p=n.right.char;if(s==="middle"&&o!==-1){const f=e[r]?.[0]??void 0,v=e[o]?.[0]??void 0;f&&v&&f===v&&(u=l);const b=this.#t.columns-1,x=e[r]?.[b]??void 0,B=e[o]?.[b]??void 0;x&&B&&x===B&&(p=l)}const m=[],g=" ".repeat(this.#t.gap);u&&m.push(W(W(u,this.#t.borderColor),this.#t.backgroundColor));let w;for(let f=0;f<this.#t.columns;f+=1){const v=e[r]?.[f]??void 0,b=s==="middle"&&o!==-1?e[o]?.[f]??void 0:void 0;let x,B=!1;if(v&&(f===0||e[r]?.[f-1]!==v)&&(x=v,B=!0),v&&!B)continue;if(!v){const M=a[f]??0;if(w=d>0?c.repeat(M):" ".repeat(M),m.push(W(W(w,this.#t.borderColor),this.#t.backgroundColor)),f<this.#t.columns-1){const E=this.determineJoinChar(s,e,r,o,f,f+1);m.push(g),E.width>0&&m.push(W(W(E.char,this.#t.borderColor),this.#t.backgroundColor))}continue}const R=x?.colSpan??1;if(s==="middle"&&s==="middle"&&b&&v===b&&x){const M=x.vAlign==="middle",{firstRow:E,lastRow:k}=this.getCachedCellVerticalPosition(e,r,f,x),L=k-E+1,H=L%2===0,_=E+Math.ceil(L/2)-1,Jt=Et(a,f,R),A=this.alignCellContent(x,Jt),F=A.length;if(M&&H&&r===_)w=W(A[0]??"",this.#t.borderColor);else{let P=0;for(let et=E;et<=r;et+=1)P+=i[et]??1,et<r&&(P+=1);const Ht=P;if(Ht>=0&&Ht<F)w=W(A[Ht]??"",this.#t.foregroundColor);else{const et=a.slice(f,f+R).reduce((Ke,Ze)=>Ke+Ze,0)+(R-1)*(this.#t.gap+this.#t.border.bodyJoin.width);w=W(" ".repeat(et),this.#t.borderColor)}}m.push(W(w,this.#t.backgroundColor))}else{const M=[];for(let E=f;E<f+R;E+=1){const k=a[E]??0,L=d>0?c:" ";if(M.push(L.repeat(k+this.#t.gap)),E<f+R-1){const H=this.determineJoinChar(s,e,r,o,E,E+1);H.width>0&&M.push(H.char)}}w=M.join(""),m.push(W(W(w,this.#t.borderColor),this.#t.backgroundColor))}const I=f+R-1;if(I<this.#t.columns-1){const M=this.determineJoinChar(s,e,r,o,I,I+1);M.width>0&&m.push(W(W(M.char,this.#t.borderColor),this.#t.backgroundColor))}f+=R-1}return p&&m.push(W(W(p,this.#t.borderColor),this.#t.backgroundColor)),m.join("")}determineJoinChar(e,i,r,a,s,o=-1){if(!this.#t.showBorders||!this.#t.border)return{char:" ",width:this.#t.gap};const h=this.#t.border;if(e!=="middle"){const B=it(h,e),R=i[r]?.[s]??void 0,I=o===-1?s+1:o,M=i[r]?.[I]??void 0,E=R!==void 0&&M!==void 0&&R===M?B.body:B.join,{char:k,width:L}=E;return{char:k,width:L>0?L:this.#t.gap}}if(a===-1||o===-1)return{char:" ",width:this.#t.gap};const n=h.bodyJoin,c=i[r]?.[s]??void 0,d=i[a]?.[s]??void 0,l=i[r]?.[o]??void 0,u=i[a]?.[o]??void 0,p=c!==void 0&&d!==void 0&&c===d,m=l!==void 0&&u!==void 0&&l===u,g=c!==void 0&&l!==void 0&&c===l,w=d!==void 0&&u!==void 0&&d===u;let f;const v=it(h,"middle");p&&m?f=g?{char:" ",width:n.width}:n:p?f=h.joinLeft:m?f=h.joinRight:g&&w?f=v.body:g?f=h.topJoin:w?f=h.bottomJoin:f=h.joinJoin;const{char:b,width:x}=f;return{char:b,width:x>0?x:this.#t.gap}}renderGrid(e,i){if(e.length===0)return"";const r=[],a=qr(e,i,this.#t,this.alignCellContent.bind(this),rt),s=this.#t.showBorders&&this.#t.border?it(this.#t.border,"top"):void 0;s&&s.body.width>0&&r.push(this.renderHorizontalBorder(e,a,0,i,"top"));for(let h=0;h<e.length;h+=1){const n=a[h]??1;for(let d=0;d<n;d+=1)r.push(this.renderVisualRowContent(e,h,d,i,a));const c=this.#t.showBorders&&this.#t.border?it(this.#t.border,"middle"):void 0;if(h<e.length-1&&c&&c.body.width>0){const d=e[h],l=e[h+1];let u=!1;if(d&&l)for(let p=0;p<this.#t.columns;p+=1){const m=d[p],g=l[p];if(m!==g){u=!0;break}}u&&r.push(this.renderHorizontalBorder(e,a,h,i,"middle",h+1))}}const o=this.#t.showBorders&&this.#t.border?it(this.#t.border,"bottom"):void 0;return o&&o.body.width>0&&r.push(this.renderHorizontalBorder(e,a,e.length-1,i,"bottom")),r.join(`
|
|
12
|
+
`)}getCachedCellVerticalPosition(e,i,r,a){const s=this.#i.get(a);if(s)return s;const o=Xt(e,i,r,a);return this.#i.set(a,o),o}}ne(t=>new _t(t),"createGrid");const ro={bodyJoin:{char:"│",width:1},bodyLeft:{char:"│",width:1},bodyRight:{char:"│",width:1},bottomBody:{char:"─",width:1},bottomJoin:{char:"┴",width:1},bottomLeft:{char:"└",width:1},bottomRight:{char:"┘",width:1},joinBody:{char:"─",width:1},joinJoin:{char:"┼",width:1},joinLeft:{char:"├",width:1},joinRight:{char:"┤",width:1},topBody:{char:"─",width:1},topJoin:{char:"┬",width:1},topLeft:{char:"┌",width:1},topRight:{char:"┐",width:1}},Bo={bodyJoin:{char:" ",width:1},bodyLeft:{char:" ",width:1},bodyRight:{char:" ",width:1},bottomBody:{char:"-",width:1},bottomJoin:{char:"-",width:1},bottomLeft:{char:"-",width:1},bottomRight:{char:"-",width:1},joinBody:{char:"-",width:1},joinJoin:{char:"-",width:1},joinLeft:{char:"-",width:1},joinRight:{char:"-",width:1},topBody:{char:"-",width:1},topJoin:{char:"-",width:1},topLeft:{char:"-",width:1},topRight:{char:"-",width:1}},Ro={bodyJoin:{char:"║",width:1},bodyLeft:{char:"║",width:1},bodyRight:{char:"║",width:1},bottomBody:{char:"═",width:1},bottomJoin:{char:"╩",width:1},bottomLeft:{char:"╚",width:1},bottomRight:{char:"╝",width:1},joinBody:{char:"═",width:1},joinJoin:{char:"╬",width:1},joinLeft:{char:"╠",width:1},joinRight:{char:"╣",width:1},topBody:{char:"═",width:1},topJoin:{char:"╦",width:1},topLeft:{char:"╔",width:1},topRight:{char:"╗",width:1}},Wo={bodyJoin:{char:"│",width:1},bodyLeft:{char:"│",width:1},bodyRight:{char:"│",width:1},bottomBody:{char:"─",width:1},bottomJoin:{char:"┴",width:1},bottomLeft:{char:"╰",width:1},bottomRight:{char:"╯",width:1},joinBody:{char:"─",width:1},joinJoin:{char:"┼",width:1},joinLeft:{char:"├",width:1},joinRight:{char:"┤",width:1},topBody:{char:"─",width:1},topJoin:{char:"┬",width:1},topLeft:{char:"╭",width:1},topRight:{char:"╮",width:1}},So={bodyJoin:{char:"┊",width:1},bodyLeft:{char:"┊",width:1},bodyRight:{char:"┊",width:1},bottomBody:{char:"┈",width:1},bottomJoin:{char:"┴",width:1},bottomLeft:{char:"└",width:1},bottomRight:{char:"┘",width:1},joinBody:{char:"┈",width:1},joinJoin:{char:"┼",width:1},joinLeft:{char:"├",width:1},joinRight:{char:"┤",width:1},topBody:{char:"┈",width:1},topJoin:{char:"┬",width:1},topLeft:{char:"┌",width:1},topRight:{char:"┐",width:1}},Io={bodyJoin:{char:"|",width:1},bodyLeft:{char:"|",width:1},bodyRight:{char:"|",width:1},bottomBody:{char:"-",width:1},bottomJoin:{char:"|",width:1},bottomLeft:{char:"|",width:1},bottomRight:{char:"|",width:1},joinBody:{char:"-",width:1},joinJoin:{char:"|",width:1},joinLeft:{char:"|",width:1},joinRight:{char:"|",width:1},topBody:{char:"-",width:1},topJoin:{char:"|",width:1},topLeft:{char:"|",width:1},topRight:{char:"|",width:1}},Mo={bodyJoin:{char:"|",width:1},bodyLeft:{char:"|",width:1},bodyRight:{char:"|",width:1},bottomBody:{char:"-",width:1},bottomJoin:{char:"+",width:1},bottomLeft:{char:"+",width:1},bottomRight:{char:"+",width:1},joinBody:{char:"-",width:1},joinJoin:{char:"+",width:1},joinLeft:{char:"+",width:1},joinRight:{char:"+",width:1},topBody:{char:"-",width:1},topJoin:{char:"+",width:1},topLeft:{char:"+",width:1},topRight:{char:"+",width:1}},Ao={bodyJoin:{char:"",width:0},bodyLeft:{char:"",width:0},bodyRight:{char:"",width:0},bottomBody:{char:"",width:0},bottomJoin:{char:"",width:0},bottomLeft:{char:"",width:0},bottomRight:{char:"",width:0},joinBody:{char:"",width:0},joinJoin:{char:"",width:0},joinLeft:{char:"",width:0},joinRight:{char:"",width:0},topBody:{char:"",width:0},topJoin:{char:"",width:0},topLeft:{char:"",width:0},topRight:{char:"",width:0}},jo={bodyJoin:{char:"█",width:1},bodyLeft:{char:"█",width:1},bodyRight:{char:"█",width:1},bottomBody:{char:"█",width:1},bottomJoin:{char:"█",width:1},bottomLeft:{char:"█",width:1},bottomRight:{char:"█",width:1},joinBody:{char:"█",width:1},joinJoin:{char:"█",width:1},joinLeft:{char:"█",width:1},joinRight:{char:"█",width:1},topBody:{char:"█",width:1},topJoin:{char:"█",width:1},topLeft:{char:"█",width:1},topRight:{char:"█",width:1}},Co={bodyJoin:{char:"┃",width:1},bodyLeft:{char:"┃",width:1},bodyRight:{char:"┃",width:1},bottomBody:{char:"━",width:1},bottomJoin:{char:"┻",width:1},bottomLeft:{char:"┗",width:1},bottomRight:{char:"┛",width:1},joinBody:{char:"━",width:1},joinJoin:{char:"╋",width:1},joinLeft:{char:"┣",width:1},joinRight:{char:"┫",width:1},topBody:{char:"━",width:1},topJoin:{char:"┳",width:1},topLeft:{char:"┏",width:1},topRight:{char:"┓",width:1}};var oo=Object.defineProperty,qe=O((t,e)=>oo(t,"name",{value:e,configurable:!0}),"p"),no=Object.defineProperty,se=qe((t,e)=>no(t,"name",{value:e,configurable:!0}),"y"),so=Object.defineProperty,ho=se((t,e)=>so(t,"name",{value:e,configurable:!0}),"t");const ao=ho(t=>t.reduce((e,i)=>{if(i===null)return e+1;if(typeof i=="object"&&!Array.isArray(i)){const r=typeof i.colSpan=="number"?i.colSpan:1;return e+(r<=0?1:r)}return e+1},0),"computeRowLogicalWidth");var co=Object.defineProperty,Ue=se((t,e)=>co(t,"name",{value:e,configurable:!0}),"b");class lo{static{O(this,"H")}static{qe(this,"D")}static{se(this,"Table")}static{Ue(this,"Table")}#t;#o=[];#e=[];#n=[];#i=!0;#r=void 0;constructor(e={}){this.#t={...e,showFooter:e.showFooter??!0,showHeader:e.showHeader??!0,style:{border:ro,paddingLeft:1,paddingRight:1,...e.style}}}setHeaders(e){return e.length>0&&!Array.isArray(e[0])?this.#e=[e]:this.#e=e.map(i=>Array.isArray(i)?i:[i]),this.#i=!0,this.#r=void 0,this}setFooter(e){return e.length>0&&!Array.isArray(e[0])?this.#n=[e]:this.#n=e.map(i=>Array.isArray(i)?i:[i]),this.#i=!0,this.#r=void 0,this}addRow(e){if(!Array.isArray(e))throw new TypeError("Row must be an array");return this.#o.push(e),this.#i=!0,this.#r=void 0,this}addRows(...e){for(const i of e)this.addRow(i);return this.#i=!0,this.#r=void 0,this}toString(){if(!this.#i&&this.#r!==void 0)return this.#r;const e=this.#t.showHeader?this.#e:[],i=this.#t.showFooter?this.#n:[],r=[...e,...this.#o,...i];if(r.length===0)return this.#r="",this.#i=!1,"";let a=0;for(const l of r){const u=l;Array.isArray(u)?a=Math.max(a,ao(u)):console.error("Unexpected non-array element found while calculating columns:",u)}if(a===0)return this.#r="",this.#i=!1,"";let s;Array.isArray(this.#t.columnWidths)?s=this.#t.columnWidths.length>=a?this.#t.columnWidths.slice(0,a):[...this.#t.columnWidths,...Array.from({length:a-this.#t.columnWidths.length}).fill(void 0)]:typeof this.#t.columnWidths=="number"&&(s=Array.from({length:a}).fill(this.#t.columnWidths));let o;const h=r.length;if(Array.isArray(this.#t.rowHeights)?o=this.#t.rowHeights:typeof this.#t.rowHeights=="number"&&(o=Array.from({length:h}).fill(this.#t.rowHeights)),s&&Array.isArray(s)){const l=[...s];for(const u of r){const p=u;for(const[m,g]of p.entries()){let w={};if(typeof g=="object"&&g!==null&&!Array.isArray(g)){const{content:f,href:v,...b}=g;w=b}w.width!==void 0?l[m]=w.width:w.maxWidth!==void 0&&l[m]!==void 0&&(l[m]=Math.min(l[m],w.maxWidth))}}s=l}const n={autoFlow:"row",backgroundColor:this.#t.style?.backgroundColor,balancedWidths:this.#t.balancedWidths??!1,border:this.#t.style?.border,borderColor:this.#t.style?.borderColor,columns:a,fixedColumnWidths:s,fixedRowHeights:o,foregroundColor:this.#t.style?.foregroundColor,gap:this.#t.gap??0,maxWidth:this.#t.maxWidth,paddingLeft:this.#t.style?.paddingLeft,paddingRight:this.#t.style?.paddingRight,terminalWidth:this.#t.terminalWidth,truncate:this.#t.truncate??(s?.every(l=>typeof l=="number")||this.#t.maxWidth!==void 0&&!this.#t.balancedWidths),truncateOverflow:this.#t.truncateOverflow??!0,wordWrap:this.#t.wordWrap??!1},c=new _t(n),d=[];for(const[l,u]of r.entries()){const p=u;if(!Array.isArray(p)){console.error("Skipping non-array row while creating GridItems:",p);continue}const m=this.#t.showHeader?this.#e.length:0,g=this.#o.length,w=this.#t.showHeader&&l<m,f=this.#t.showFooter&&l>=m+g,v=w&&p.length===1&&a>1,b=f&&p.length===1&&a>1;for(const x of p){let B=x,R={};if(typeof B=="object"&&B!==null&&!Array.isArray(B)){const{content:k,href:L,...H}=B;B=L?`\x1B]8;;${L}\x1B\\${String(k)}\x1B]8;;\x1B\\`:k,R=H}v&&(R.colSpan=a),b&&(R.colSpan=a);const I=this.#t.transformTabToSpace&&typeof B=="string"?B.replaceAll(" "," ".repeat(this.#t.transformTabToSpace)):B,{maxWidth:M,width:E}=R;d.push({backgroundColor:R.backgroundColor,colSpan:R.colSpan,content:I,foregroundColor:R.foregroundColor,hAlign:R.hAlign,maxWidth:M,rowSpan:R.rowSpan,truncate:R.truncate??(M===void 0?void 0:!0),vAlign:R.vAlign,width:E,wordWrap:R.wordWrap})}}return c.addItems(d),this.#r=c.toString(),this.#i=!1,this.#r}}const $o=Ue(t=>new lo(t),"createTable");export{pi as B,po as E,lo as H,wo as I,$o as M,bo as N,yo as P,Co as R,xo as T,Io as a,Mo as c,So as d,vo as e,U as g,Bo as h,Ro as i,mo as j,Wo as o,go as q,Ao as r,ro as t,jo as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var I=Object.defineProperty;var d=(s,e)=>I(s,"name",{value:e,configurable:!0});import{createRequire as $}from"node:module";import{
|
|
1
|
+
var I=Object.defineProperty;var d=(s,e)=>I(s,"name",{value:e,configurable:!0});import{createRequire as $}from"node:module";import{b as j}from"../packem_chunks/config.js";import{advisoriesStatus as E,NATIVE_BINDING_VERSION as A,advisoriesIngest as q,advisoriesQuery as B}from"#native";const T=$(import.meta.url),v=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,l=d(s=>{if(typeof v<"u"&&v.versions&&v.versions.node){const[e,t]=v.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return v.getBuiltinModule(s)}return T(s)},"__cjs_getBuiltinModule"),{randomUUID:O}=l("node:crypto"),{createWriteStream:P,existsSync:k}=l("node:fs"),{mkdir:U,unlink:x,stat:C}=l("node:fs/promises"),{join:w,dirname:L}=l("node:path"),{Readable:M}=l("node:stream"),{pipeline:W}=l("node:stream/promises");var F=Object.defineProperty,r=d((s,e)=>F(s,"name",{value:e,configurable:!0}),"s");const b=5;if(A!==b)throw new Error(`vis native binding ABI mismatch in advisories: expected ${b}, got ${A}. Rebuild via \`pnpm --filter @visulima/vis run build:native\` or reinstall the platform binding package.`);const es="https://osv-vulnerabilities.storage.googleapis.com",V=new Set(["osv-vulnerabilities.storage.googleapis.com"]);class H extends Error{static{d(this,"AdvisoryDbNotFoundError")}static{r(this,"AdvisoryDbNotFoundError")}cause="DB_NOT_FOUND";constructor(e){super(`No local advisory DB at ${e}. Run 'vis advisories sync' first.`),this.name="AdvisoryDbNotFoundError"}}class p extends Error{static{d(this,"AdvisorySourceNotAllowedError")}static{r(this,"AdvisorySourceNotAllowedError")}cause="SOURCE_NOT_ALLOWED";constructor(e){super(`Advisory source host '${e}' is not in the built-in allowlist. Add it to \`security.audit.advisories.allowedHosts\` if intentional.`),this.name="AdvisorySourceNotAllowedError"}}class N extends Error{static{d(this,"AdvisorySyncNetworkError")}static{r(this,"AdvisorySyncNetworkError")}cause="SYNC_NETWORK";constructor(e,t){super(`Advisory sync failed for ${e}: ${t}. Check connectivity, proxy env vars, or --source.`),this.name="AdvisorySyncNetworkError"}}const g=r(s=>{const e=j("vis",{create:!0,cwd:s})??w(s,"node_modules",".cache","vis");return w(e,"advisories","db.sqlite")},"resolveAdvisoryDbPath"),z=r((s,e)=>{let t;try{t=new URL(s)}catch{throw new p(s)}if(t.protocol!=="https:")throw new p(`${t.protocol}//${t.host}`);if(!new Set([...V,...e??[]]).has(t.host))throw new p(t.host);return t},"validateAdvisorySource"),ts=r(async s=>{const e=s.dbPath??g(s.workspaceRoot);await U(L(e),{recursive:!0});const t=z(s.source,s.allowedHosts),u=new URL(`${s.ecosystem}/all.zip`,Q(t.toString())),y=await G(e,s.ecosystem);let i=null;if(!s.force){const n=await S(u,{method:"HEAD"});if(n.ok&&(i=n.headers.get("etag"),i&&y&&i===y))return{advisoriesIngested:0,dbPath:e,durationMs:0,upToDate:!0}}const a=`${e}.${s.ecosystem}.${process.pid}.${O()}.zip.tmp`,o=await S(u,{method:"GET"});if(!o.ok||!o.body)throw new N(u.toString(),o.status);i||(i=o.headers.get("etag"));const m=o.headers.get("content-length"),c=m?Number.parseInt(m,10):null;let h=0;const _=P(a),f=M.fromWeb(o.body);s.onProgress&&c&&f.on("data",n=>{h+=n.byteLength,s.onProgress?.(h,c,"download")}),await W(f,_);try{const n=await q({dbPath:e,ecosystem:s.ecosystem,manifestEtag:i??void 0,zipPath:a},(D,R)=>s.onProgress?.(D,R,"ingest"));return{advisoriesIngested:n.advisoriesIngested,dbPath:e,durationMs:n.durationMs,upToDate:!1}}finally{await x(a).catch(()=>{})}},"syncAdvisories"),rs=r((s,e)=>{if(s.length===0)return new Map;const t=e.dbPath??g(e.workspaceRoot),u=e.ecosystem??"npm";if(!k(t))throw new H(t);const y=s.map(o=>({ecosystem:u,name:o.name,version:o.version})),i=B(t,y),a=new Map;for(const[o,m]of s.entries()){const c=i[o];!c||c.vulnerabilities.length===0||a.set(m.name,c.vulnerabilities.map(h=>K(h)))}return a},"queryAdvisories"),os=r(async(s,e)=>{const t=e??g(s);return E(t)},"getAdvisoryStatus"),G=r(async(s,e)=>{try{await C(s)}catch{return null}return E(s).ecosystems.find(t=>t.name===e)?.manifestEtag??null},"readStoredEtag"),K=r(s=>({aliases:s.aliases.length>0?s.aliases:void 0,cvssScore:s.cvssScore??void 0,fixedVersions:s.fixedVersions,id:s.id,severity:Y(s.severity),summary:s.summary}),"toSecurityVulnerability"),Y=r(s=>{const e=s.toUpperCase();return e==="CRITICAL"||e==="HIGH"||e==="MODERATE"||e==="LOW"?e:"UNKNOWN"},"normalizeSeverity"),Q=r(s=>s.endsWith("/")?s:`${s}/`,"ensureTrailingSlash"),S=r(async(s,e)=>{try{return await fetch(s,e)}catch(t){throw new N(s.toString(),t instanceof Error?t.message:String(t))}},"safeFetch");export{H as A,es as D,os as g,rs as q,g as r,ts as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var E=Object.defineProperty;var c=(e,t)=>E(e,"name",{value:t,configurable:!0});import{createRequire as p}from"node:module";import{
|
|
1
|
+
var E=Object.defineProperty;var c=(e,t)=>E(e,"name",{value:t,configurable:!0});import{createRequire as p}from"node:module";import{l as f,B as A}from"./readFileSync-DseCu8sg-DEq4Fn3a.js";const g=p(import.meta.url),l=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=c(e=>{if(typeof l<"u"&&l.versions&&l.versions.node){const[t,r]=l.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return l.getBuiltinModule(e)}return g(e)},"__cjs_getBuiltinModule"),{spawnSync:b}=h("node:child_process");var v=Object.defineProperty,i=c((e,t)=>v(e,"name",{value:t,configurable:!0}),"o");const I="0000000000000000000000000000000000000000",R=i(e=>{if(f(e))try{const t=A(e);return JSON.parse(t)}catch{return}},"defaultReadEventPayload"),C=i((e,t)=>{const r=b("git",e,{cwd:t,encoding:"utf8"});if(!(r.error||typeof r.status!="number"||r.status!==0))return typeof r.stdout=="string"?r.stdout.trim():void 0},"defaultRunGit"),d=i(e=>typeof e=="string"&&e.length>0&&e!==I,"isNonEmptySha");i((e,...t)=>{let r=e;for(const o of t){if(r===null||typeof r!="object")return;r=r[o]}return r},"getNested");const B=i((e,t,r)=>{const o=[],s=e.GITHUB_BASE_REF,n=e.GITHUB_SHA??"HEAD";if(s&&s.length>0)return o.push(`pull_request: $GITHUB_BASE_REF=${s}`),{base:`origin/${s}`,head:n,notes:o,provider:"github"};const u=e.GITHUB_EVENT_PATH,a=u?r(u):void 0;if(a){const _=typeof a.before=="string"?a.before:void 0;if(d(_))return o.push(`push: event.before=${_}`),{base:_,head:n,notes:o,provider:"github"}}return o.push(`fallback: origin/${t}`),{base:`origin/${t}`,head:n,notes:o,provider:"github"}},"resolveGithub"),T=i((e,t)=>{const r=[],o=e.CI_COMMIT_SHA??"HEAD";if(e.CI_PIPELINE_SOURCE==="merge_request_event"){const u=e.CI_MERGE_REQUEST_DIFF_BASE_SHA;if(d(u))return r.push(`merge_request: $CI_MERGE_REQUEST_DIFF_BASE_SHA=${u}`),{base:u,head:o,notes:r,provider:"gitlab"};const a=e.CI_MERGE_REQUEST_TARGET_BRANCH_NAME;if(a&&a.length>0)return r.push(`merge_request: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME=${a}`),{base:`origin/${a}`,head:o,notes:r,provider:"gitlab"}}const s=e.CI_COMMIT_BEFORE_SHA;if(d(s))return r.push(`push: $CI_COMMIT_BEFORE_SHA=${s}`),{base:s,head:o,notes:r,provider:"gitlab"};const n=e.CI_DEFAULT_BRANCH??t;return r.push(`fallback: origin/${n}`),{base:`origin/${n}`,head:o,notes:r,provider:"gitlab"}},"resolveGitlab"),$=i((e,t)=>{const r=[],o=e.BUILDKITE_COMMIT??"HEAD",s=e.BUILDKITE_PULL_REQUEST_BASE_BRANCH;return s&&s.length>0?(r.push(`pull_request: $BUILDKITE_PULL_REQUEST_BASE_BRANCH=${s}`),{base:`origin/${s}`,head:o,notes:r,provider:"buildkite"}):(r.push(`fallback: origin/${t} (buildkite has no canonical previous-build SHA env)`),{base:`origin/${t}`,head:o,notes:r,provider:"buildkite"})},"resolveBuildkite"),H=i((e,t)=>{const r=[],o=e.CIRCLE_SHA1??"HEAD",s=e.CIRCLE_PR_BASE_BRANCH;return s&&s.length>0?(r.push(`pull_request: $CIRCLE_PR_BASE_BRANCH=${s}`),{base:`origin/${s}`,head:o,notes:r,provider:"circleci"}):(r.push(`fallback: origin/${t} (circleci has no canonical previous-build SHA env)`),{base:`origin/${t}`,head:o,notes:r,provider:"circleci"})},"resolveCircleCI"),S=i((e,t,r)=>{const o=[],s=t(["merge-base","HEAD",`origin/${e}`],r);return s&&s.length>0?(o.push(`local: git merge-base HEAD origin/${e}=${s}`),{base:s,head:"HEAD",notes:o,provider:"local"}):(o.push(`local fallback: origin/${e} (no merge-base available)`),{base:`origin/${e}`,head:"HEAD",notes:o,provider:"local"})},"resolveLocal"),L=i(e=>{const t=e?.env??process.env,r=e?.defaultBase??"main",o=e?.readEventPayload??R,s=e?.runGit??C,n=e?.workspaceRoot??process.cwd();return t.GITHUB_ACTIONS==="true"?B(t,r,o):t.GITLAB_CI==="true"?T(t,r):t.BUILDKITE==="true"?$(t,r):t.CIRCLECI==="true"?H(t,r):S(r,s,n)},"resolveAffectedShas");export{L as r};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var F=Object.defineProperty;var f=(e,t)=>F(e,"name",{value:t,configurable:!0});import{createRequire as O}from"node:module";import{readLastRunSummary as T}from"@visulima/task-runner";import{a as k}from"./failure-log-
|
|
1
|
+
var F=Object.defineProperty;var f=(e,t)=>F(e,"name",{value:t,configurable:!0});import{createRequire as O}from"node:module";import{readLastRunSummary as T}from"@visulima/task-runner";import{a as k}from"./failure-log-34Wl3npC.js";import{E as j,F as D,a9 as y,aa as _,ab as N,ac as R,ad as A,ae as E}from"../packem_chunks/bin.js";import{a as $,C as b,M as H,z as W}from"./readFileSync-DseCu8sg-DEq4Fn3a.js";import{w as q,b as L,r as Y}from"./ai-analysis-KP8b5lc0.js";const C=O(import.meta.url),l=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,I=f(e=>{if(typeof l<"u"&&l.versions&&l.versions.node){const[t,a]=l.versions.node.split(".").map(Number);if(t>22||t===22&&a>=3||t===20&&a>=16)return l.getBuiltinModule(e)}return C(e)},"__cjs_getBuiltinModule"),{readFile:B,writeFile:M}=I("node:fs/promises");var z=Object.defineProperty,m=f((e,t)=>z(e,"name",{value:t,configurable:!0}),"u");const J=32*1024,K=m((e,t)=>{if(e.length<=t)return e;const a=e.slice(-t),o=e.length-a.length;return`[…${String(o)} bytes truncated from head…]
|
|
2
2
|
${a}`},"truncateHead"),U=m(async(e,t)=>t===void 0?T(e,{dataDirectory:j(e)}):D(e,t),"loadSummary"),ge=m(async(e,t,a={})=>{const o=a.terminalOutputLimit??J,[r,n]=await Promise.all([k(e,t),U(e,a.runId)]),i=n?y(n,t):void 0;if(!r&&!i)return;let s,c;if(n&&i){const d=await _(e,n.id),g=d?y(d,t):void 0;s=N(i.hashDetails,g?.hashDetails),c=d?.id}const h=r?.terminalOutput??"";return{command:r?.command??void 0,cwd:r?.cwd??void 0,dependencies:i?.dependencies??[],duration:i?.duration,exitCode:r?.exitCode??i?.exitCode,hash:i?.hash??r?.hash,hashDetails:i?.hashDetails,hashDiff:s,previousRunId:c,project:i?.target.project,runId:n?.id??r?.runId,status:r?.status??(i?G(i):void 0),target:i?.target.target,taskId:t,terminalOutput:K(h,o),terminalOutputCaptured:!!r,timestamp:r?.timestamp??i?.endTime??i?.startTime}},"aggregateFailureContext"),G=m(e=>{if(e.exitCode!==void 0&&e.exitCode!==0)return"failure";switch(e.cacheStatus){case"HIT":return"local-cache";case"REMOTE_HIT":return"remote-cache";case"SKIPPED":return"skipped";default:return e.exitCode===0?"success":void 0}},"mapCacheStatusToTaskStatus");var V=Object.defineProperty,u=f((e,t)=>V(e,"name",{value:t,configurable:!0}),"a");const Q=3600*1e3,S=80,X=new Set(["high","low","medium"]),Z=u(()=>`You are an expert software engineer helping fix a failing build/test/lint task.
|
|
3
3
|
|
|
4
4
|
You will be given:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as e}from"node:module";import{h as _,H as p,l as d,V as u,m as c,c as g,a as m,j as T,G as E,e as C,r as F}from"../packem_chunks/config.js";import"./readFileSync-
|
|
1
|
+
import{createRequire as e}from"node:module";import{h as _,H as p,l as d,V as u,m as c,c as g,a as m,j as T,G as E,e as C,r as F}from"../packem_chunks/config.js";import"./readFileSync-DseCu8sg-DEq4Fn3a.js";import"jiti";import{otelPlugin as S}from"./otelPlugin-CJR2T_lk.js";import{definePlugin as A}from"./definePlugin-CWm4Dv_t.js";const n=e(import.meta.url),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process;export{_ as CONFIG_FILES,p as DEFAULT_MIN_RELEASE_AGE_MINUTES,d as SECURITY_DEFAULTS,u as TASK_CONFIG_FILES,c as applyDefaults,g as defineConfig,A as definePlugin,m as defineTaskConfig,T as findVisConfigFile,E as findVisTaskConfigFile,C as loadVisConfig,F as loadVisTaskConfig,S as otelPlugin};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var $=Object.defineProperty;var b=(e,t)=>$(e,"name",{value:t,configurable:!0});import{createRequire as k}from"node:module";import{M as h,l as _}from"./readFileSync-DseCu8sg-DEq4Fn3a.js";import{s as w}from"../packem_chunks/config.js";const M=k(import.meta.url),y=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,B=b(e=>{if(typeof y<"u"&&y.versions&&y.versions.node){const[t,s]=y.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return y.getBuiltinModule(e)}return M(e)},"__cjs_getBuiltinModule"),{readdirSync:j,statSync:O}=B("node:fs");var x=Object.defineProperty,v=b((e,t)=>x(e,"name",{value:t,configurable:!0}),"g");const P=["preinstall","install","postinstall","prepare"],q=v(e=>{const t=h(e,"node_modules");if(!_(t))return[];const s=new Map,o=v((p,f="")=>{let u;try{u=j(p)}catch{return}for(const r of u){const i=h(p,r);if(r.startsWith("@")){o(i,`${r}/`);continue}if(r===".pnpm"&&f===""){let l;try{l=j(i)}catch{continue}for(const a of l){const c=h(i,a,"node_modules");_(c)&&o(c)}continue}if(r.startsWith("."))continue;const m=f+r,n=h(i,"package.json");try{if(!O(i).isDirectory()||!_(n))continue;const l=w(n),a=l.scripts??{},c=P.filter(g=>a[g]);!a.preinstall&&!a.install&&!a.postinstall&&_(h(i,"binding.gyp"))&&c.push("install (binding.gyp)"),c.length>0&&!s.has(m)&&s.set(m,{directory:i,hooks:c,name:m,version:typeof l.version=="string"?l.version:void 0});const d=h(i,"node_modules");_(d)&&o(d)}catch{}}},"scanDir");return o(t),[...s.values()]},"collectBuildScriptPackages"),W=v(e=>{const t=e.startsWith("@"),s=e.indexOf("@",t?1:0);return s===-1?{name:e}:{name:e.slice(0,s),version:e.slice(s+1)}},"splitAllowKey"),D=v((e,t,s)=>{for(const[o,p]of Object.entries(t)){if(!p)continue;if(o.endsWith("@*")){if(o.slice(0,-2)===e.name)return!0;continue}if(o.endsWith("*")){if(e.name.startsWith(o.slice(0,-1)))return!0;continue}const{name:f,version:u}=W(o);if(f===e.name&&(!s||u===void 0||e.version===u))return!0}return!1},"isPatternAllowed"),T=v((e,t,s={})=>{const o=s.pinVersions===!0,p=q(e),f=[],u=[],r=new Map(p.map(n=>[n.name,n]));for(const n of p)D(n,t,o)?u.push(n):f.push(n);const i=[],m=[];for(const[n,l]of Object.entries(t)){if(!l)continue;if(n.endsWith("@*")){const g=n.slice(0,-2);r.has(g)||i.push(n);continue}if(n.endsWith("*")){const g=n.slice(0,-1);[...r.keys()].some(S=>S.startsWith(g))||i.push(n);continue}const{name:a,version:c}=W(n),d=r.get(a);if(!d){i.push(n);continue}o&&c!==void 0&&c!=="*"&&d.version&&d.version!==c&&m.push({from:n,to:`${a}@${d.version}`})}return{excess:i,installed:u,unapproved:f,versionDrift:m}},"scanBuildScriptStatus"),N=v((e,t)=>T(e,t).unapproved.map(s=>`${s.name} (${s.hooks.join(", ")})`),"scanUnapprovedBuildScripts");export{N as O,T as x};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var de=Object.defineProperty;var w=(e,n)=>de(e,"name",{value:n,configurable:!0});import{createRequire as he}from"node:module";import{
|
|
1
|
+
var de=Object.defineProperty;var w=(e,n)=>de(e,"name",{value:n,configurable:!0});import{createRequire as he}from"node:module";import{s as ie}from"../packem_chunks/config.js";import{M as B,B as _e}from"./readFileSync-DseCu8sg-DEq4Fn3a.js";import{r as be}from"./docker-CTE3s4LW.js";import{e as $e}from"./license-zZU7aavK.js";import{S as Oe}from"./lockfile-CrT86D6d.js";import{x as ke}from"./pm-runner-DmKT2FqF.js";const ge=he(import.meta.url),W=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ae=w(e=>{if(typeof W<"u"&&W.versions&&W.versions.node){const[n,t]=W.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return W.getBuiltinModule(e)}return ge(e)},"__cjs_getBuiltinModule"),{randomUUID:ye}=ae("node:crypto"),{readdirSync:ve}=ae("node:fs");var je=Object.defineProperty,pe=w((e,n)=>je(e,"name",{value:n,configurable:!0}),"r$1");const z=pe(e=>e.replaceAll(/[^\w.~-]/g,n=>`%${(n.codePointAt(0)??0).toString(16).toUpperCase().padStart(2,"0")}`),"encodeSegment"),M=pe((e,n)=>{const t=e.toLowerCase();if(t.startsWith("@")){const o=t.indexOf("/");if(o>0){const r=t.slice(0,o),p=t.slice(o+1);return`pkg:npm/${z(r)}/${z(p)}@${z(n)}`}}return`pkg:npm/${z(t)}@${z(n)}`},"toNpmPurl");var Se=Object.defineProperty,j=w((e,n)=>Se(e,"name",{value:n,configurable:!0}),"a");const m={ARRAY:"array",BOOLEAN:"boolean",DATE:"date",FUNCTION:"function",JSTOXML_OBJECT:"jstoxml-object",NULL:"null",NUMBER:"number",OBJECT:"object",STRING:"string"},Te=[m.STRING,m.NUMBER,m.BOOLEAN],Ae='<?xml version="1.0" encoding="UTF-8"?>',se=["_selfCloseTag","_attrs"],xe=j((e="",n=0)=>e.repeat(n),"getIndentStr"),Q=j(e=>Array.isArray(e)&&m.ARRAY||typeof e===m.OBJECT&&e!==null&&e._name&&m.JSTOXML_OBJECT||e instanceof Date&&m.DATE||e===null&&m.NULL||typeof e,"getType"),le=j(e=>e.startsWith("<![CDATA["),"isCDATA"),ue=j((e="",n={},t)=>{let o=e;if(typeof e===m.STRING){if(le(e))return e;const r=new RegExp(`(${Object.keys(n).join("|")})(?!(\\w|#)*;)`,"g");o=String(e).replace(r,(p,g)=>n[g]||"")}return typeof t=="function"?t(o):o},"mapStr"),Ce=j((e={},n,t,o)=>(Array.isArray(e)?e:Object.entries(e).map(([r,p])=>({[r]:p}))).reduce((r,p)=>{const g=Object.keys(p)[0],y=p[g];if(typeof t===m.FUNCTION&&t(g,y))return r;const b=n?ue(y,n):y,$=!o&&b===!0?"":`="${b}"`;return r.push(`${g}${$}`),r},[]),"getAttributeKeyVals"),Ne=j((e={},n,t,o)=>{const r=Ce(e,n,t,o);return r.length===0?"":` ${r.join(" ")}`},"formatAttributes"),Re=j((e={})=>Object.keys(e).map(n=>({_name:n,_content:e[n]})),"objToArray"),we=j(e=>Te.includes(Q(e)),"isPrimitive"),Pe=j(e=>!e.match("<"),"isSimpleXML"),De=j(({header:e,isOutputStart:n})=>e&&n?typeof e===m.BOOLEAN?Ae:e:"","getHeaderString"),re={"<":"<",">":">","&":"&",'"':"""},X=j((e={},n={})=>{const{depth:t=0,indent:o,_isFirstItem:r,_isOutputStart:p=!0,header:g,attributeReplacements:y={},attributeFilter:b,attributeExplicitTrue:$=!1,contentReplacements:q={},contentMap:L,selfCloseTags:I=!0}=n,H=typeof y=="boolean"&&!y?{}:{...re,...y},Y=typeof q=="boolean"&&!q?{}:{...re,...q},P=typeof o=="string",T=xe(o,t),G=Q(e),U=De({header:g,indent:o,depth:t,isOutputStart:p}),D=p&&!U&&r&&t===0,E=P&&!D?`
|
|
2
2
|
`:"";let v="";switch(G){case m.JSTOXML_OBJECT:{const{_name:f,_content:l}=e;if(l===null&&typeof L!="function"){v=`${E}${T}${f}`;break}if(Array.isArray(l)&&l.every(we))return l.map(S=>X({_name:f,_content:S},{...n,depth:t,_isOutputStart:!1})).join("");if(se.includes(f))break;const _=X(l,{...n,depth:t+1,_isOutputStart:D}),N=Q(_),O=Pe(_),k=le(_),R=`${E}${T}`;if(f==="_comment"){v+=`${R}<!-- ${l} -->`;break}const K=N==="undefined"||_==="",c=I,s=e._selfCloseTag,i=typeof s===m.BOOLEAN?K&&s:K&&c,a=i?"/":"",u=Ne(e._attrs,H,b,$),d=`<${f}${u}${a}>`,A=P&&!O&&!k?`
|
|
3
3
|
${T}`:"",x=i?"":`${_}${A}</${f}>`;v+=`${R}${d}${x}`;break}case m.OBJECT:{const f=Object.keys(e);v=f.map((l,_)=>{const N={...n,_isFirstItem:_===0,_isLastItem:_+1===f.length,_isOutputStart:D},O={_name:l};if(Q(e[l])===m.OBJECT&&(se.forEach(k=>{const R=e[l][k];typeof R<"u"&&(O[k]=R,delete e[l][k])}),typeof e[l]._content<"u"&&Object.keys(e[l]).length>1)){const k=Object.assign({},e[l]);delete k._content,O._content=[...Re(k),e[l]._content]}return typeof O._content>"u"&&(O._content=e[l]),X(O,N)},n).join("");break}case m.FUNCTION:{const f=e(n);v=X(f,n);break}case m.ARRAY:{v=e.map((f,l)=>{const _={...n,_isFirstItem:l===0,_isLastItem:l+1===e.length,_isOutputStart:D};return X(f,_)}).join("");break}default:{v=ue(e,Y,L);break}}return`${U}${v}`},"toXML");var Ee=Object.defineProperty,F=w((e,n)=>Ee(e,"name",{value:n,configurable:!0}),"r");const te=F(e=>{try{return ie(e)}catch{return}},"readJsonSafe"),Me=F(e=>{if(e.length===0||e.includes("..")||e.startsWith(".")||e.includes("\0")||e.includes("\\"))return!1;if(e.startsWith("@")){const n=e.indexOf("/");return n>1&&!e.includes("/",n+1)}return!e.includes("/")},"isSafePackageName"),Be=F(e=>e.length>0&&!e.includes("/")&&!e.includes("\\")&&!e.includes("..")&&!e.includes("\0"),"isSafeVersion"),Le=F((e,n,t)=>{const o=`${n.replaceAll("/","+")}@${t}`,r=B(e,"node_modules",".pnpm"),p=te(B(r,o,"node_modules",n,"package.json"));if(p)return p;let g;try{g=ve(r)}catch{return}const y=`${o}_`;for(const b of g){if(!b.startsWith(y))continue;const $=te(B(r,b,"node_modules",n,"package.json"));if($)return $}},"readPnpmVirtualStore"),Ie=F((e,n,t)=>{const o=te(B(e,"node_modules",n,"package.json"));return o?.version===t?o:void 0},"readHoistedCopy"),Ue=F((e,n,t)=>{if(!(!Me(n)||!Be(t)))return Le(e,n,t)??Ie(e,n,t)},"readInstalledPackageMetadata");var Je=Object.defineProperty,me=w((e,n)=>Je(e,"name",{value:n,configurable:!0}),"t");const Xe={sha256:"SHA-256",sha384:"SHA-384",sha512:"SHA-512"},Fe={sha256:64,sha384:96,sha512:128},qe=me(e=>{const n={name:e.name,version:e.version},{integrity:t}=e;return t&&t.hex.length===Fe[t.algorithm]&&(n.hash={alg:Xe[t.algorithm],content:t.hex}),e.dependencies&&(n.dependencies=e.dependencies),e.peerDependencies&&(n.peerDependencies=e.peerDependencies),e.optionalDependencies&&(n.optionalDependencies=e.optionalDependencies),n},"toResolvedPackage"),He=[{file:"pnpm-lock.yaml",type:"pnpm"},{file:"npm-shrinkwrap.json",type:"npm"},{file:"package-lock.json",type:"npm"},{file:"yarn.lock",type:"yarn"},{file:"bun.lock",type:"bun"}],Ve=me(e=>{for(const{file:n,type:t}of He){let o;try{o=_e(B(e,n))}catch{continue}const r=new Map;for(const p of Oe(o,t))r.set(`${p.name}@${p.version}`,qe(p));return{packages:r,type:t}}},"readLockfilePackages");var We=Object.defineProperty,fe=w((e,n)=>We(e,"name",{value:n,configurable:!0}),"s");const ze=fe(e=>{const n=e.indexOf(":");return n<=0?e:e.slice(0,n)==="npm"?e.slice(n+1):e},"stripProtocolPrefix"),ee=fe((e,n,t)=>{const o=t.get(e);if(!o||o.size===0)return;if(o.has(n))return n;const r=ze(n);if(r!==n&&o.has(r))return r;const p=[...o];return ke.maxSatisfying(p,r,{includePrerelease:!0})||p[0]},"resolveSpecifier");var Ye=Object.defineProperty,h=w((e,n)=>Ye(e,"name",{value:n,configurable:!0}),"p");const Ge="1.7",Ke="CycloneDX",Qe="http://cyclonedx.org/schema/bom-1.7.schema.json",Ze="@visulima/vis",ce=h(e=>{try{return ie(e)}catch{return}},"readPackageJson"),en=h(e=>{if(e){if(typeof e=="string")return e;if(typeof e=="object"&&e.name)return e.email?`${e.name} <${e.email}>`:e.name}},"toAuthorString"),nn=h(e=>{if(e)return typeof e=="string"?e:e.url},"toRepositoryUrl"),tn=h(e=>{if(e)return typeof e=="string"?e:e.url},"toBugsUrl"),on=h(e=>{const n=[];e.homepage&&n.push({type:"website",url:e.homepage});const t=nn(e.repository);t&&n.push({type:"vcs",url:t});const o=tn(e.bugs);return o&&n.push({type:"issue-tracker",url:o}),n.length>0?n:void 0},"buildExternalReferences"),sn=h(e=>e==="application"||e==="service"||e==="tool"?"application":"library","toCycloneDxComponentType"),ne=h((e,n)=>{if(!n)return;n.description&&(e.description=n.description);const t=en(n.author);t&&(e.author=t);const o=$e(n);o&&(e.licenses=o);const r=on(n);r&&(e.externalReferences=r)},"decoratePackageComponent"),yn=h(e=>{const{focus:n,generatorVersion:t,includeDev:o=!1,now:r=new Date,projectGraph:p,serialNumber:g,workspace:y,workspaceRoot:b}=e,$=n&&n.length>0?[...be(n,p)].sort():Object.keys(y.projects).sort(),q=new Set($),L=new Map;for(const c of $){const s=y.projects[c];s&&L.set(c,ce(B(b,s.root,"package.json")))}const I=[],H=new Map;for(const c of $){const s=y.projects[c];if(!s)continue;const i=L.get(c),a=i?.version??"0.0.0",u=M(c,a);H.set(c,u);const d={"bom-ref":u,name:c,purl:u,type:sn(s.projectType),version:a};ne(d,i),I.push(d)}const Y=Ve(b),P=new Map,T=new Map;if(Y)for(const c of Y.packages.values()){P.set(`${c.name}@${c.version}`,c);let s=T.get(c.name);s||(s=new Set,T.set(c.name,s)),s.add(c.version)}const G=[],U=[],D=new Map;for(const c of $){const s=L.get(c);if(!s)continue;const i=[s.dependencies,s.peerDependencies];o&&i.push(s.devDependencies);const a=new Set,u=h((d,A)=>{if(A)for(const[x,S]of Object.entries(A)){if(q.has(x)){const J=H.get(x);J&&a.add(J);continue}const C=ee(x,S,T);C&&(a.add(M(x,C)),d.push(`${x}@${C}`))}},"seedRef");for(const d of i)u(G,d);u(U,s.optionalDependencies),D.set(c,a)}const E=new Map,v=new Map,f=h((c,s)=>{const i=[...c];for(;i.length>0;){const a=i.pop(),u=E.get(a);if(u==="required"||u==="optional"&&s==="optional")continue;E.set(a,s);const d=P.get(a);if(!d)continue;const A=v.get(a)??new Set,x=[d.dependencies,d.peerDependencies];for(const S of x)if(S)for(const[C,J]of Object.entries(S))for(const V of J){const Z=ee(C,V,T);Z&&(A.add(M(C,Z)),i.push(`${C}@${Z}`))}if(d.optionalDependencies)for(const[S,C]of Object.entries(d.optionalDependencies))for(const J of C){const V=ee(S,J,T);V&&(A.add(M(S,V)),U.push(`${S}@${V}`))}A.size>0&&v.set(a,A)}},"walk");f(G,"required"),f(U,"optional");const l=[],_=[...E.keys()].sort();for(const c of _){const s=P.get(c);if(!s)continue;const i=M(s.name,s.version),a={"bom-ref":i,name:s.name,purl:i,scope:E.get(c)??"required",type:"library",version:s.version};s.hash&&(a.hashes=[s.hash]),ne(a,Ue(b,s.name,s.version)),l.push(a)}const N=[];for(const[c,s]of D){const i=H.get(c);if(!i)continue;const a=[...s].sort();N.push(a.length>0?{dependsOn:a,ref:i}:{ref:i})}for(const c of _){const s=P.get(c);if(!s)continue;const i=M(s.name,s.version),a=v.get(c),u=a?[...a].sort():[];N.push(u.length>0?{dependsOn:u,ref:i}:{ref:i})}N.sort((c,s)=>c.ref.localeCompare(s.ref));const O=ce(B(b,"package.json")),k=(()=>{if(n?.length===1){const u=I.find(d=>d.name===n[0]);if(u)return{"bom-ref":u["bom-ref"],name:u.name,purl:u.purl,type:u.type,version:u.version}}const c=O?.name??"workspace",s=O?.version??"0.0.0",i=M(c,s),a={"bom-ref":i,name:c,purl:i,type:"application",version:s};return ne(a,O),a})(),R=k["bom-ref"],K=R?I.filter(c=>c["bom-ref"]!==R):I;return{$schema:Qe,bomFormat:Ke,components:[...K,...l],dependencies:N,metadata:{component:k,lifecycles:[{phase:"build"}],timestamp:r.toISOString(),tools:{components:[{name:Ze,type:"application",...t?{version:t}:{}}]}},serialNumber:g??`urn:uuid:${ye()}`,specVersion:Ge,version:1}},"buildCycloneDxBom"),_n=h(e=>{const n={version:e.version??1,xmlns:"http://cyclonedx.org/schema/bom/1.7"};e.serialNumber&&(n.serialNumber=e.serialNumber);const t=[];return e.metadata&&t.push(rn(e.metadata)),e.components&&e.components.length>0&&t.push({_content:e.components.map(o=>oe(o)),_name:"components"}),e.dependencies&&e.dependencies.length>0&&t.push({_content:e.dependencies.map(o=>an(o)),_name:"dependencies"}),`${X({_attrs:n,_content:t,_name:"bom"},{header:!0,indent:" ",selfCloseTags:!0})}
|
|
4
4
|
`},"serializeBomToXml"),rn=h(e=>{const n=[];return e.timestamp&&n.push({timestamp:e.timestamp}),e.lifecycles&&e.lifecycles.length>0&&n.push({_content:e.lifecycles.map(t=>{const o=[];return t.phase&&o.push({phase:t.phase}),t.name&&o.push({name:t.name}),t.description&&o.push({description:t.description}),{_content:o,_name:"lifecycle"}}),_name:"lifecycles"}),e.tools?.components&&n.push({_content:[{_content:e.tools.components.map(t=>oe(t)),_name:"components"}],_name:"tools"}),e.component&&n.push(oe(e.component)),{_content:n,_name:"metadata"}},"metadataToXmlElement"),oe=h(e=>{const n={type:e.type};e["bom-ref"]&&(n["bom-ref"]=e["bom-ref"]);const t=[];e.group&&t.push({group:e.group}),t.push({name:e.name}),e.version&&t.push({version:e.version}),e.description&&t.push({description:e.description}),e.author&&t.push({author:e.author}),e.hashes&&e.hashes.length>0&&t.push({_content:e.hashes.map(r=>({_attrs:{alg:r.alg},_content:r.content,_name:"hash"})),_name:"hashes"});const o=cn(e.licenses);return o&&t.push(o),e.purl&&t.push({purl:e.purl}),e.scope&&t.push({scope:e.scope}),e.externalReferences&&e.externalReferences.length>0&&t.push({_content:e.externalReferences.map(r=>({_attrs:{type:r.type},_content:[{url:r.url}],_name:"reference"})),_name:"externalReferences"}),{_attrs:n,_content:t,_name:"component"}},"componentToXmlElement"),cn=h(e=>{if(!e||e.length===0)return;const n=[];for(const t of e){if("expression"in t){n.push({expression:t.expression});continue}const o=[];"id"in t.license&&t.license.id?o.push({id:t.license.id}):"name"in t.license&&t.license.name&&o.push({name:t.license.name}),n.push({_content:o,_name:"license"})}return{_content:n,_name:"licenses"}},"licensesToXmlElement"),an=h(e=>e.dependsOn&&e.dependsOn.length>0?{_attrs:{ref:e.ref},_content:e.dependsOn.map(n=>({_attrs:{ref:n},_name:"dependency"})),_name:"dependency"}:{_attrs:{ref:e.ref},_name:"dependency"},"dependencyToXmlElement");export{yn as b,_n as s,M as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var D=Object.defineProperty;var y=(o,t)=>D(o,"name",{value:t,configurable:!0});import{
|
|
1
|
+
var D=Object.defineProperty;var y=(o,t)=>D(o,"name",{value:t,configurable:!0});import{l as w,M as u,B as d}from"./readFileSync-DseCu8sg-DEq4Fn3a.js";import{S as h}from"./lockfile-CrT86D6d.js";import{V as S,t as b}from"../packem_chunks/bin.js";var j=Object.defineProperty,l=y((o,t)=>j(o,"name",{value:t,configurable:!0}),"f");const L={bun:{file:"bun.lock",type:"bun"},npm:{aliases:["npm-shrinkwrap.json"],file:"package-lock.json",type:"npm"},pnpm:{file:"pnpm-lock.yaml",type:"pnpm"},yarn:{file:"yarn.lock",type:"yarn"}},O=l(o=>{const t=L[o];return t?[...t.aliases??[],t.file].map(e=>({file:e,type:t.type})):[]},"lockfileCandidates"),m=l((o,t)=>{const e=O(t);if(e.length!==0)return e.find(r=>w(u(o,r.file)))??e[e.length-1]},"resolveLockfile"),g=l(o=>{try{return JSON.parse(d(o))}catch{return}},"readPackageJsonShape"),v=l(o=>{const t=[],e=g(u(o,"package.json"));e&&t.push(e);const r=S(o);let c;if(r?c=r:e?.workspaces&&(Array.isArray(e.workspaces)?c=e.workspaces:e.workspaces.packages&&(c=e.workspaces.packages)),!c)return t;const a=b(o,c);for(const s of a){const n=g(u(o,s,"package.json"));n&&t.push(n)}return t},"collectWorkspacePackageJsons"),P=l((o,t)=>{const e=new Set,r=[],c=new Map;for(const s of t){const n=c.get(s.name);n?n.push(s):c.set(s.name,[s])}const a=l(s=>{if(s)for(const n of Object.keys(s))e.has(n)||(e.add(n),r.push(n))},"enqueueRoots");for(const s of v(o))a(s.dependencies),a(s.peerDependencies),a(s.optionalDependencies);for(;r.length>0;){const s=r.shift(),n=c.get(s);if(n){for(const i of n)for(const p of[i.dependencies,i.peerDependencies,i.optionalDependencies])if(p)for(const f of Object.keys(p))e.has(f)||(e.add(f),r.push(f))}}return e},"computeProdReachable"),C=l((o,t,e={})=>{const r=m(o,t);if(!r)return[];let c;try{c=d(u(o,r.file))}catch{return[]}const a=h(c,r.type);if(a.length===0)return[];const s=e.includeDev??!0?void 0:P(o,a),n=new Set,i=[];for(const p of a){if(s&&!s.has(p.name))continue;const f=`${p.name}@${p.version}`;n.has(f)||(n.add(f),i.push({isDev:!1,name:p.name,version:p.version}))}return i},"lockedPackages"),E=l((o,t)=>{const e=m(o,t);if(!e)return[];let r;try{r=d(u(o,e.file))}catch{return[]}const c=h(r,e.type);if(c.length===0)return[];const a=new Map;for(const n of c)a.has(n.name)||a.set(n.name,new Set),a.get(n.name).add(n.version);const s=[];for(const[n,i]of a)i.size<=1||s.push({name:n,versions:[...i]});return s.sort((n,i)=>n.name.localeCompare(i.name))},"findDuplicateDependencies"),G=l((o,t)=>{const e=m(o,t);if(!e)return;let r;try{r=d(u(o,e.file))}catch{return}const c=h(r,e.type);if(c.length===0)return;const a=[],s=new Set;for(const n of v(o))for(const i of[n.dependencies,n.devDependencies,n.peerDependencies,n.optionalDependencies])if(i)for(const[p,f]of Object.entries(i)){const k=`${p}@${f}`;s.has(k)||(s.add(k),a.push({name:p,version:f}))}return{entries:c,roots:a}},"loadLockfileGraph");export{L,G as a,E as f,C as l,m as r};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var pa=Object.defineProperty;var c=(h,n)=>pa(h,"name",{value:n,configurable:!0});import{createRequire as da}from"node:module";import{
|
|
1
|
+
var pa=Object.defineProperty;var c=(h,n)=>pa(h,"name",{value:n,configurable:!0});import{createRequire as da}from"node:module";import{d as va,s as Do,E as Ji}from"../packem_chunks/config.js";import{K as ci,M as Be,l as Aa,z as ba}from"./readFileSync-DseCu8sg-DEq4Fn3a.js";import{c2 as Ca,c3 as $a}from"../packem_chunks/bin.js";import"./_commonjsHelpers-CLblCigl.js";const ha=da(import.meta.url),vr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ga=c(h=>{if(typeof vr<"u"&&vr.versions&&vr.versions.node){const[n,m]=vr.versions.node.split(".").map(Number);if(n>22||n===22&&m>=3||n===20&&m>=16)return vr.getBuiltinModule(h)}return ha(h)},"__cjs_getBuiltinModule"),{cpSync:No,lstatSync:ma,readdirSync:ya,existsSync:Mo,rmSync:si,readFileSync:Vi}=ga("node:fs");var Sa=Object.defineProperty,Ea=c((h,n)=>Sa(h,"name",{value:n,configurable:!0}),"t");class ft extends Error{static{c(this,"LockfilePruneError")}static{Ea(this,"LockfilePruneError")}constructor(n){super(n),this.name="LockfilePruneError"}}var wa=Object.defineProperty,Bt=c((h,n)=>wa(h,"name",{value:n,configurable:!0}),"p$2");const qo=Bt(h=>{let n=h.startsWith("/")?h.slice(1):h;const m=n.indexOf("(");return m!==-1&&(n=n.slice(0,m)),n},"canonicalKey"),ka=Bt((h,n)=>{if(!(n.startsWith("link:")||n.startsWith("file:")||n.startsWith("workspace:")))return`${h}@${n}`},"resolveDepKey"),xa=Bt(h=>{const n=[];for(const m of[h.dependencies,h.devDependencies,h.optionalDependencies])if(m)for(const[v,$]of Object.entries(m))$?.version&&n.push({name:v,version:$.version});return n},"collectImporterDeps"),Ki=Bt(h=>{const n=[];for(const m of[h.dependencies,h.optionalDependencies])if(m)for(const[v,$]of Object.entries(m))typeof $=="string"&&n.push({name:v,version:$});return n},"collectPackageDeps"),Gi=Bt(h=>{const n=new Map;if(!h)return n;for(const m of Object.keys(h)){const v=qo(m),$=n.get(v);$?$.push(m):n.set(v,[m])}return n},"buildKeyIndex"),Yo=Bt(h=>{const n=h.displayName??"pnpm-lock.yaml",m=typeof h.lockfileContent=="string"?h.lockfileContent:h.lockfileContent.toString("utf8");let v;try{v=Ca(m)}catch(oe){throw new ft(`${n}: parse failed — ${oe.message}`)}const $=Bt(oe=>oe.packages?Object.keys(oe.packages).length:0,"packageCount");let a;for(const oe of v){const[T]=oe.errors;if(T)throw new ft(`${n}: parse failed — ${T.message}`);const ne=oe.toJS();if(!ne||typeof ne!="object")continue;const me=ne;(a===void 0||$(me)>$(a))&&(a=me)}if(a===void 0)throw new ft(`${n}: top-level value is not an object`);const g=a.importers??{},e=Gi(a.packages),C=Gi(a.snapshots),k=new Set(["."]);for(const oe of h.closure)k.add(oe.relativeRoot===""?".":oe.relativeRoot);const b={};for(const[oe,T]of Object.entries(g))k.has(oe)&&(b[oe]=T);const S=new Set,O=new Set,H=[];for(const oe of Object.values(b))for(const T of xa(oe))H.push(T);for(;H.length>0;){const{name:oe,version:T}=H.shift(),ne=ka(oe,T);if(!ne)continue;const me=qo(ne),U=C.get(me)??C.get(ne)??[];for(const be of U){if(O.has(be))continue;O.add(be);const ye=a.snapshots?.[be];if(ye)for(const je of Ki(ye))H.push(je)}const ue=e.get(me)??e.get(ne)??[];for(const be of ue){if(S.has(be))continue;S.add(be);const ye=a.packages?.[be];if(ye&&!a.snapshots)for(const je of Ki(ye))H.push(je)}}const A={lockfileVersion:a.lockfileVersion};for(const oe of["settings","overrides","patchedDependencies","catalogs"])a[oe]!==void 0&&(A[oe]=a[oe]);if(A.importers=b,a.packages){const oe={};for(const T of Object.keys(a.packages))S.has(T)&&(oe[T]=a.packages[T]);A.packages=oe}if(a.snapshots){const oe={};for(const T of Object.keys(a.snapshots))O.has(T)&&(oe[T]=a.snapshots[T]);A.snapshots=oe}const y=Object.keys(a.packages??{}).length,E=Object.keys(A.packages??{}).length,X=y-E,fe=Object.keys(g).length-Object.keys(b).length;return{content:$a(A,{lineWidth:0}),message:`${n}: kept ${E}/${y} packages and ${Object.keys(b).length} importers (dropped ${X} packages, ${fe} importers)`,status:"pruned"}},"prunePnpmLockfile");var Oa=Object.defineProperty,ja=c((h,n)=>Oa(h,"name",{value:n,configurable:!0}),"p$1");const _a=ja(h=>Yo({...h,displayName:h.displayName??"aube-lock.yaml"}),"pruneAubeLockfile");var Ta=Object.defineProperty,Sr=c((h,n)=>Ta(h,"name",{value:n,configurable:!0}),"p");const Ra=Sr(h=>{let n="",m=!1,v=!1,$=!1;for(let a=0;a<h.length;a+=1){const g=h[a],e=h[a+1];if(v){g===`
|
|
2
2
|
`&&(v=!1,n+=g);continue}if($){g==="*"&&e==="/"&&($=!1,a+=1);continue}if(m){if(g==="\\"){n+=g,e!==void 0&&(n+=e,a+=1);continue}g==='"'&&(m=!1),n+=g;continue}if(g==='"'){m=!0,n+=g;continue}if(g==="/"&&e==="/"){v=!0,a+=1;continue}if(g==="/"&&e==="*"){$=!0,a+=1;continue}n+=g}return n},"stripJsonComments"),La=Sr(h=>{const n=[];for(const m of[h.dependencies,h.devDependencies,h.optionalDependencies,h.peerDependencies])if(m)for(const[v,$]of Object.entries(m))typeof $=="string"&&n.push({name:v,spec:$});return n},"collectWorkspaceDeps"),Fa=Sr(h=>{for(const n of h)if(typeof n=="object"&&!Array.isArray(n))return n},"extractMetadata"),Pa=Sr(h=>{if(!h)return[];const n=[];for(const m of["dependencies","optionalDependencies","peerDependencies"]){const v=h[m];v!==null&&typeof v=="object"&&!Array.isArray(v)&&n.push(...Object.keys(v))}return n},"collectMetadataDeps"),Ia=Sr(h=>{if(Buffer.isBuffer(h.lockfileContent))return{message:"bun.lockb is binary; run `bun install --save-text-lockfile` to regenerate as bun.lock, then rerun `vis docker scaffold`.",status:"skipped"};const n=Ra(h.lockfileContent);let m;try{m=JSON.parse(n)}catch(y){throw new ft(`bun.lock: parse failed — ${y.message}`)}if(!m||typeof m!="object")throw new ft("bun.lock: top-level value is not an object");const v=m.workspaces??{},$=m.packages??{},a=new Set([""]);for(const y of h.closure)a.add(y.relativeRoot===""?"":y.relativeRoot);const g={},e=[];for(const[y,E]of Object.entries(v))a.has(y)&&(g[y]=E,e.push(...La(E)));const C=new Set;for(const{name:y}of e)C.add(y);const k=[...C];for(;k.length>0;){const y=k.shift();for(const E of Object.keys($)){if(E.split("/")[0]!==y&&E!==y)continue;const X=Fa($[E]);for(const fe of Pa(X))C.has(fe)||(C.add(fe),k.push(fe))}}const b={};for(const[y,E]of Object.entries($)){const X=y.split("/")[0];(C.has(X)||C.has(y))&&(b[y]=E)}const S={...m,packages:b,workspaces:g},O=Object.keys($).length,H=Object.keys(b).length,A=O-H;return{content:`${JSON.stringify(S,null,2)}
|
|
3
3
|
`,message:`bun.lock: kept ${H}/${O} packages (dropped ${A})`,status:"pruned"}},"pruneBunLockfile");var Na=Object.defineProperty,li=c((h,n)=>Na(h,"name",{value:n,configurable:!0}),"k");const _n="node_modules/",Ma=li((h,n,m)=>{let v=n;for(;;){const $=v===""?`${_n}${m}`:`${v}/${_n}${m}`;if(h[$]!==void 0)return $;if(v==="")return;const a=v.lastIndexOf(`/${_n.slice(0,-1)}/`);v=a===-1?"":v.slice(0,a)}},"resolveDep"),Da=li(h=>{const n=[];for(const m of[h.dependencies,h.devDependencies,h.optionalDependencies,h.peerDependencies])if(m)for(const v of Object.keys(m))n.push(v);return n},"collectDepNames"),qa=li(h=>{const n=h.displayName??"package-lock.json",m=typeof h.lockfileContent=="string"?h.lockfileContent:h.lockfileContent.toString("utf8");let v;try{v=JSON.parse(m)}catch(A){throw new ft(`${n}: parse failed — ${A.message}`)}if(!v||typeof v!="object")throw new ft(`${n}: top-level value is not an object`);const $=v.packages??{},a=new Set([""]);for(const A of h.closure)A.relativeRoot!==""&&a.add(A.relativeRoot);const g=new Set,e=[];for(const A of Object.keys($))a.has(A)&&(g.add(A),e.push(A));for(const[A,y]of Object.entries($))y.link===!0&&typeof y.resolved=="string"&&a.has(y.resolved)&&g.add(A);for(;e.length>0;){const A=e.shift(),y=$[A];if(y)for(const E of Da(y)){const X=Ma($,A,E);if(!X||g.has(X))continue;g.add(X);const fe=$[X];fe.link===!0&&typeof fe.resolved=="string"&&$[fe.resolved]!==void 0&&!g.has(fe.resolved)?(g.add(fe.resolved),e.push(fe.resolved)):e.push(X)}}const C={};for(const A of Object.keys($))g.has(A)&&(C[A]=$[A]);const k=C[""];k&&Array.isArray(k.workspaces)&&(k.workspaces=k.workspaces.filter(A=>{if(typeof A!="string")return!1;const y=A.replace(/\/?\*+$/,"").replace(/\/$/,"");if(y===""||y==="*")return!0;for(const E of a)if(E===A||E===y||E.startsWith(`${y}/`))return!0;return!1}));const b={...v,packages:C};delete b.dependencies;const S=Object.keys($).length,O=Object.keys(C).length,H=S-O;return{content:`${JSON.stringify(b,null,2)}
|
|
4
4
|
`,message:`${n}: kept ${O}/${S} entries (dropped ${H})`,status:"pruned"}},"pruneNpmLockfile");var Tn={},Fe={},Rn,Qi;function Ya(){if(Qi)return Rn;Qi=1;var h=Object.defineProperty,n=c((a,g)=>h(a,"name",{value:g,configurable:!0}),"a");function m(a,g){function e(){this.constructor=a}c(e,"s"),n(e,"ctor"),e.prototype=g.prototype,a.prototype=new e}c(m,"peg$subclass"),n(m,"peg$subclass");function v(a,g,e,C){this.message=a,this.expected=g,this.found=e,this.location=C,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,v)}c(v,"peg$SyntaxError"),n(v,"peg$SyntaxError"),m(v,Error),v.buildMessage=function(a,g){var e={literal:n(function(A){return'"'+k(A.text)+'"'},"literal"),class:n(function(A){var y="",E;for(E=0;E<A.parts.length;E++)y+=A.parts[E]instanceof Array?b(A.parts[E][0])+"-"+b(A.parts[E][1]):b(A.parts[E]);return"["+(A.inverted?"^":"")+y+"]"},"class"),any:n(function(A){return"any character"},"any"),end:n(function(A){return"end of input"},"end"),other:n(function(A){return A.description},"other")};function C(A){return A.charCodeAt(0).toString(16).toUpperCase()}c(C,"T"),n(C,"hex");function k(A){return A.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(y){return"\\x0"+C(y)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(y){return"\\x"+C(y)})}c(k,"q"),n(k,"literalEscape");function b(A){return A.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(y){return"\\x0"+C(y)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(y){return"\\x"+C(y)})}c(b,"_"),n(b,"classEscape");function S(A){return e[A.type](A)}c(S,"re"),n(S,"describeExpectation");function O(A){var y=new Array(A.length),E,X;for(E=0;E<A.length;E++)y[E]=S(A[E]);if(y.sort(),y.length>0){for(E=1,X=1;E<y.length;E++)y[E-1]!==y[E]&&(y[X]=y[E],X++);y.length=X}switch(y.length){case 1:return y[0];case 2:return y[0]+" or "+y[1];default:return y.slice(0,-1).join(", ")+", or "+y[y.length-1]}}c(O,"le"),n(O,"describeExpected");function H(A){return A?'"'+k(A)+'"':"end of input"}return c(H,"te"),n(H,"describeFound"),"Expected "+O(a)+" but "+H(g)+" found."};function $(a,g){g=g!==void 0?g:{};var e={},C={Start:pn},k=pn,b=n(function(t){return t||[]},"peg$c0"),S=n(function(t,o,u){return[{command:t,type:o}].concat(u||[])},"peg$c1"),O=n(function(t,o){return[{command:t,type:o||";"}]},"peg$c2"),H=n(function(t){return t},"peg$c3"),A=";",y=ce(";",!1),E="&",X=ce("&",!1),fe=n(function(t,o){return o?{chain:t,then:o}:{chain:t}},"peg$c8"),oe=n(function(t,o){return{type:t,line:o}},"peg$c9"),T="&&",ne=ce("&&",!1),me="||",U=ce("||",!1),ue=n(function(t,o){return o?{...t,then:o}:t},"peg$c14"),be=n(function(t,o){return{type:t,chain:o}},"peg$c15"),ye="|&",je=ce("|&",!1),Me="|",De=ce("|",!1),qe="=",rt=ce("=",!1),Ee=n(function(t,o){return{name:t,args:[o]}},"peg$c22"),He=n(function(t){return{name:t,args:[]}},"peg$c23"),Ge="(",Qe=ce("(",!1),re=")",Pe=ce(")",!1),We=n(function(t,o){return{type:"subshell",subshell:t,args:o}},"peg$c28"),ke="{",xe=ce("{",!1),$e="}",Le=ce("}",!1),Ae=n(function(t,o){return{type:"group",group:t,args:o}},"peg$c33"),Ye=n(function(t,o){return{type:"command",args:o,envs:t}},"peg$c34"),Ue=n(function(t){return{type:"envs",envs:t}},"peg$c35"),Ve=n(function(t){return t},"peg$c36"),Je=n(function(t){return t},"peg$c37"),q=/^[0-9]/,W=Ze([["0","9"]],!1,!1),se=n(function(t,o,u){return{type:"redirection",subtype:o,fd:t!==null?parseInt(t):null,args:[u]}},"peg$c40"),Ce=">>",nt=ce(">>",!1),at=">&",st=ce(">&",!1),At=">",Ke=ce(">",!1),pt="<<<",et=ce("<<<",!1),ze="<&",dt=ce("<&",!1),bt="<",ht=ce("<",!1),r=n(function(t){return{type:"argument",segments:[].concat(...t)}},"peg$c53"),_=n(function(t){return t},"peg$c54"),R="$'",z=ce("$'",!1),Y="'",l=ce("'",!1),w=n(function(t){return[{type:"text",text:t}]},"peg$c59"),L='""',F=ce('""',!1),D=n(function(){return{type:"text",text:""}},"peg$c62"),V='"',P=ce('"',!1),Z=n(function(t){return t},"peg$c65"),J=n(function(t){return{type:"arithmetic",arithmetic:t,quoted:!0}},"peg$c66"),ie=n(function(t){return{type:"shell",shell:t,quoted:!0}},"peg$c67"),ve=n(function(t){return{type:"variable",...t,quoted:!0}},"peg$c68"),pe=n(function(t){return{type:"text",text:t}},"peg$c69"),_e=n(function(t){return{type:"arithmetic",arithmetic:t,quoted:!1}},"peg$c70"),Qr=n(function(t){return{type:"shell",shell:t,quoted:!1}},"peg$c71"),zr=n(function(t){return{type:"variable",...t,quoted:!1}},"peg$c72"),wr=n(function(t){return{type:"glob",pattern:t}},"peg$c73"),Ut=/^[^']/,Wt=Ze(["'"],!0,!1),wt=n(function(t){return t.join("")},"peg$c76"),kr=/^[^$"]/,xr=Ze(["$",'"'],!0,!1),tr=`\\
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var m=Object.defineProperty;var a=(t,e)=>m(t,"name",{value:e,configurable:!0});import{createRequire as p}from"node:module";import{M as v}from"./readFileSync-
|
|
1
|
+
var m=Object.defineProperty;var a=(t,e)=>m(t,"name",{value:e,configurable:!0});import{createRequire as p}from"node:module";import{M as v}from"./readFileSync-DseCu8sg-DEq4Fn3a.js";import{o as j}from"../packem_chunks/bin.js";const h=p(import.meta.url),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=a(t=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[e,r]=s.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return s.getBuiltinModule(t)}return h(t)},"__cjs_getBuiltinModule"),{mkdirSync:y,writeFileSync:F,readdirSync:L}=u("node:fs"),{readFile:_}=u("node:fs/promises");var S=Object.defineProperty,i=a((t,e)=>S(t,"name",{value:e,configurable:!0}),"i");const c=i(t=>j(t),"getFailureLogDirectory"),l=i((t,e)=>v(c(t),`${encodeURIComponent(e)}.json`),"getFailureLogPath");class R{static{a(this,"FailureLogLifeCycle")}static{i(this,"FailureLogLifeCycle")}#e;#t;constructor(e,r){this.#e=e,this.#t=r}printTaskTerminalOutput(e,r,o){if(r!=="failure")return;const n=c(this.#e);try{y(n,{recursive:!0})}catch{return}const d=e.overrides.command,f=e.projectRoot,g={command:d,cwd:f,exitCode:void 0,hash:e.hash,runId:this.#t,status:r,taskId:e.id,terminalOutput:o,timestamp:new Date().toISOString()};try{F(l(this.#e,e.id),`${JSON.stringify(g,void 0,2)}
|
|
2
2
|
`,"utf8")}catch{}}}const T=i(async(t,e)=>{const r=l(t,e);try{const o=await _(r,"utf8");return JSON.parse(o)}catch{return}},"loadFailureLog"),w=i(t=>{const e=c(t);let r;try{r=L(e)}catch{return[]}const o=[];for(const n of r)if(n.endsWith(".json"))try{o.push(decodeURIComponent(n.slice(0,-5)))}catch{}return o},"listFailureLogs");export{R as F,T as a,w as l};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var Me=Object.defineProperty;var _=(t,e)=>Me(t,"name",{value:e,configurable:!0});import{createRequire as Fe}from"node:module";const Ge=Fe(import.meta.url),bt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ue=_(t=>{if(typeof bt<"u"&&bt.versions&&bt.versions.node){const[e,n]=bt.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return bt.getBuiltinModule(t)}return Ge(t)},"__cjs_getBuiltinModule"),{createRequire:qe}=Ue("node:module");var Xe=Object.defineProperty,Ke=_((t,e)=>Xe(t,"name",{value:e,configurable:!0}),"o");function ee(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}_(ee,"l");Ke(ee,"o");var We=Object.defineProperty,$=_((t,e)=>We(t,"name",{value:e,configurable:!0}),"E$1"),Kt={},Ot,Wt;function Et(){if(Wt)return Ot;Wt=1;const t="[^\\\\/]",e=Symbol("unignore"),n="\\.",l="\\+",c="\\?",o="\\/",r="(?=.)",h="[^/]",y=`(?:${o}|$)`,k=`(?:^|${o})`,S=`${n}{1,2}${y}`,H=`(?!${n})`,N=`(?!${k}${S})`,E=`(?!${n}{0,1}${y})`,L=`(?!${S})`,I=`[^.${o}]`,O=`${h}*?`,Q="/",p={DOT_LITERAL:n,PLUS_LITERAL:l,QMARK_LITERAL:c,SLASH_LITERAL:o,ONE_CHAR:r,QMARK:h,END_ANCHOR:y,DOTS_SLASH:S,NO_DOT:H,NO_DOTS:N,NO_DOT_SLASH:E,NO_DOTS_SLASH:L,QMARK_NO_DOT:I,STAR:O,START_ANCHOR:k,SEP:Q},A={...p,SLASH_LITERAL:"[\\\\/]",QMARK:t,STAR:`${t}*?`,DOTS_SLASH:`${n}{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!${n})`,NO_DOTS:`(?!(?:^|[\\\\/])${n}{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!${n}{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!${n}{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},s={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return Ot={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:s,UNIGNORE:e,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(b){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${b.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(b){return b===!0?A:p}},Ot}_(Et,"Et$1");$(Et,"ht");var jt;function vt(){return jt||(jt=1,(function(t){const{REGEX_BACKSLASH:e,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:l,REGEX_SPECIAL_CHARS_GLOBAL:c}=Et();t.isObject=o=>o!==null&&typeof o=="object"&&!Array.isArray(o),t.hasRegexChars=o=>l.test(o),t.isRegexChar=o=>o.length===1&&t.hasRegexChars(o),t.escapeRegex=o=>o.replace(c,"\\$1"),t.toPosixSlashes=o=>o.replace(e,"/"),t.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){const o=navigator.platform.toLowerCase();return o==="win32"||o==="windows"}return process.platform?process.platform==="win32":!1},t.removeBackslashes=o=>o.replace(n,r=>r==="\\"?"":r),t.escapeLast=(o,r,h)=>{const y=o.lastIndexOf(r,h);return y===-1?o:o[y-1]==="\\"?t.escapeLast(o,r,y-1):`${o.slice(0,y)}\\${o.slice(y)}`},t.removePrefix=(o,r={})=>{let h=o;return h.startsWith("./")&&(h=h.slice(2),r.prefix="./"),h},t.wrapOutput=(o,r={},h={})=>{const y=h.contains?"":"^",k=h.contains?"":"$";let S=`${y}(?:${o})${k}`;return r.negated===!0&&(S=`(?:^(?!${S}).*$)`),S},t.basename=(o,{windows:r}={})=>{const h=o.split(r?/[\\/]/:"/"),y=h[h.length-1];return y===""?h[h.length-2]:y}})(Kt)),Kt}_(vt,"ht$1");$(vt,"gt");var wt,Qt;function ne(){if(Qt)return wt;Qt=1;const t=vt(),{CHAR_ASTERISK:e,CHAR_AT:n,CHAR_BACKWARD_SLASH:l,CHAR_COMMA:c,CHAR_DOT:o,CHAR_EXCLAMATION_MARK:r,CHAR_FORWARD_SLASH:h,CHAR_LEFT_CURLY_BRACE:y,CHAR_LEFT_PARENTHESES:k,CHAR_LEFT_SQUARE_BRACKET:S,CHAR_PLUS:H,CHAR_QUESTION_MARK:N,CHAR_RIGHT_CURLY_BRACE:E,CHAR_RIGHT_PARENTHESES:L,CHAR_RIGHT_SQUARE_BRACKET:I}=Et(),O=$(p=>p===h||p===l,"j"),Q=$(p=>{p.isPrefix!==!0&&(p.depth=p.isGlobstar?1/0:1)},"q");return wt=$((p,A)=>{const s=A||{},b=p.length-1,v=s.parts===!0||s.scanToEnd===!0,x=[],R=[],m=[];let G=p,B=-1,q=0,st=0,V=!1,ot=!1,X=!1,ct=!1,gt=!1,ut=!1,F=!1,it=!1,dt=!1,J=!1,Z=0,et,C,P={value:"",depth:0,isGlob:!1};const a=$(()=>B>=b,"M"),tt=$(()=>G.charCodeAt(B+1),"et"),z=$(()=>(et=C,G.charCodeAt(++B)),"W");for(;B<b;){C=z();let D;if(C===l){F=P.backslashes=!0,C=z(),C===y&&(ut=!0);continue}if(ut===!0||C===y){for(Z++;a()!==!0&&(C=z());){if(C===l){F=P.backslashes=!0,z();continue}if(C===y){Z++;continue}if(ut!==!0&&C===o&&(C=z())===o){if(V=P.isBrace=!0,X=P.isGlob=!0,J=!0,v===!0)continue;break}if(ut!==!0&&C===c){if(V=P.isBrace=!0,X=P.isGlob=!0,J=!0,v===!0)continue;break}if(C===E&&(Z--,Z===0)){ut=!1,V=P.isBrace=!0,J=!0;break}}if(v===!0)continue;break}if(C===h){if(x.push(B),R.push(P),P={value:"",depth:0,isGlob:!1},J===!0)continue;if(et===o&&B===q+1){q+=2;continue}st=B+1;continue}if(s.noext!==!0&&(C===H||C===n||C===e||C===N||C===r)&&tt()===k){if(X=P.isGlob=!0,ct=P.isExtglob=!0,J=!0,C===r&&B===q&&(dt=!0),v===!0){for(;a()!==!0&&(C=z());){if(C===l){F=P.backslashes=!0,C=z();continue}if(C===L){X=P.isGlob=!0,J=!0;break}}continue}break}if(C===e){if(et===e&&(gt=P.isGlobstar=!0),X=P.isGlob=!0,J=!0,v===!0)continue;break}if(C===N){if(X=P.isGlob=!0,J=!0,v===!0)continue;break}if(C===S){for(;a()!==!0&&(D=z());){if(D===l){F=P.backslashes=!0,z();continue}if(D===I){ot=P.isBracket=!0,X=P.isGlob=!0,J=!0;break}}if(v===!0)continue;break}if(s.nonegate!==!0&&C===r&&B===q){it=P.negated=!0,q++;continue}if(s.noparen!==!0&&C===k){if(X=P.isGlob=!0,v===!0){for(;a()!==!0&&(C=z());){if(C===k){F=P.backslashes=!0,C=z();continue}if(C===L){J=!0;break}}continue}break}if(X===!0){if(J=!0,v===!0)continue;break}}s.noext===!0&&(ct=!1,X=!1);let j=G,u="",i="";q>0&&(u=G.slice(0,q),G=G.slice(q),st-=q),j&&X===!0&&st>0?(j=G.slice(0,st),i=G.slice(st)):X===!0?(j="",i=G):j=G,j&&j!==""&&j!=="/"&&j!==G&&O(j.charCodeAt(j.length-1))&&(j=j.slice(0,-1)),s.unescape===!0&&(i&&(i=t.removeBackslashes(i)),j&&F===!0&&(j=t.removeBackslashes(j)));const rt={prefix:u,input:p,start:q,base:j,glob:i,isBrace:V,isBracket:ot,isGlob:X,isExtglob:ct,isGlobstar:gt,negated:it,negatedExtglob:dt};if(s.tokens===!0&&(rt.maxDepth=0,O(C)||R.push(P),rt.tokens=R),s.parts===!0||s.tokens===!0){let D;for(let K=0;K<x.length;K++){const pt=D?D+1:q,nt=x[K],ht=p.slice(pt,nt);s.tokens&&(K===0&&q!==0?(R[K].isPrefix=!0,R[K].value=u):R[K].value=ht,Q(R[K]),rt.maxDepth+=R[K].depth),(K!==0||ht!=="")&&m.push(ht),D=nt}if(D&&D+1<p.length){const K=p.slice(D+1);m.push(K),s.tokens&&(R[R.length-1].value=K,Q(R[R.length-1]),rt.maxDepth+=R[R.length-1].depth)}rt.slashes=x,rt.parts=m}return rt},"yt"),wt}_(ne,"It$1");$(ne,"kt");var Ht,zt;function re(){if(zt)return Ht;zt=1;const t=Et(),e=vt(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:l,REGEX_NON_SPECIAL_CHARS:c,REGEX_SPECIAL_CHARS_BACKREF:o,REPLACEMENTS:r}=t,h=$((p,A)=>typeof A.expandRange=="function"?A.expandRange(...p,A):(p.sort(),`[${p.join("-")}]`),"c"),y=$((p,A)=>`Missing ${p}: "${A}" - use "\\\\${A}" to match literal characters`,"f"),k=$(p=>{const A=[];let s=0,b=0,v=0,x="",R=!1;for(const m of p){if(R===!0){x+=m,R=!1;continue}if(m==="\\"){x+=m,R=!0;continue}if(m==='"'){v=v===1?0:1,x+=m;continue}if(v===0){if(m==="[")s++;else if(m==="]"&&s>0)s--;else if(s===0){if(m==="(")b++;else if(m===")"&&b>0)b--;else if(m==="|"&&b===0){A.push(x),x="";continue}}}x+=m}return A.push(x),A},"m"),S=$(p=>{let A=!1;for(const s of p){if(A===!0){A=!1;continue}if(s==="\\"){A=!0;continue}if(/[?*+@!()[\]{}]/.test(s))return!1}return!0},"y"),H=$(p=>{let A=p.trim(),s=!0;for(;s===!0;)s=!1,/^@\([^\\()[\]{}|]+\)$/.test(A)&&(A=A.slice(2,-1),s=!0);if(S(A))return A.replace(/\\(.)/g,"$1")},"X"),N=$(p=>{const A=p.map(H).filter(Boolean);for(let s=0;s<A.length;s++)for(let b=s+1;b<A.length;b++){const v=A[s],x=A[b],R=v[0];if(!(!R||v!==R.repeat(v.length)||x!==R.repeat(x.length))&&(v===x||v.startsWith(x)||x.startsWith(v)))return!0}return!1},"B"),E=$((p,A=!0)=>{if(p[0]!=="+"&&p[0]!=="*"||p[1]!=="(")return;let s=0,b=0,v=0,x=!1;for(let R=1;R<p.length;R++){const m=p[R];if(x===!0){x=!1;continue}if(m==="\\"){x=!0;continue}if(m==='"'){v=v===1?0:1;continue}if(v!==1){if(m==="["){s++;continue}if(m==="]"&&s>0){s--;continue}if(!(s>0)){if(m==="("){b++;continue}if(m===")"&&(b--,b===0))return A===!0&&R!==p.length-1?void 0:{type:p[0],body:p.slice(2,R),end:R}}}}},"T"),L=$(p=>{let A=0;const s=[];for(;A<p.length;){const b=E(p.slice(A),!1);if(!b||b.type!=="*")return;const v=k(b.body).map(R=>R.trim());if(v.length!==1)return;const x=H(v[0]);if(!x||x.length!==1)return;s.push(x),A+=b.end+1}return s.length<1?void 0:`${s.length===1?e.escapeRegex(s[0]):`[${s.map(b=>e.escapeRegex(b)).join("")}]`}*`},"G"),I=$(p=>{let A=0,s=p.trim(),b=E(s);for(;b;)A++,s=b.body.trim(),b=E(s);return A},"ot"),O=$((p,A)=>{if(A.maxExtglobRecursion===!1)return{risky:!1};const s=typeof A.maxExtglobRecursion=="number"?A.maxExtglobRecursion:t.DEFAULT_MAX_EXTGLOB_RECURSION,b=k(p).map(v=>v.trim());if(b.length>1&&(b.some(v=>v==="")||b.some(v=>/^[*?]+$/.test(v))||N(b)))return{risky:!0};for(const v of b){const x=L(v);if(x)return{risky:!0,safeOutput:x};if(I(v)>s)return{risky:!0}}return{risky:!1}},"j"),Q=$((p,A)=>{if(typeof p!="string")throw new TypeError("Expected a string");p=r[p]||p;const s={...A},b=typeof s.maxLength=="number"?Math.min(n,s.maxLength):n;let v=p.length;if(v>b)throw new SyntaxError(`Input length: ${v}, exceeds maximum allowed length: ${b}`);const x={type:"bos",value:"",output:s.prepend||""},R=[x],m=s.capture?"":"?:",G=t.globChars(s.windows),B=t.extglobChars(G),{DOT_LITERAL:q,PLUS_LITERAL:st,SLASH_LITERAL:V,ONE_CHAR:ot,DOTS_SLASH:X,NO_DOT:ct,NO_DOT_SLASH:gt,NO_DOTS_SLASH:ut,QMARK:F,QMARK_NO_DOT:it,STAR:dt,START_ANCHOR:J}=G,Z=$(g=>`(${m}(?:(?!${J}${g.dot?X:q}).)*?)`,"H"),et=s.dot?"":ct,C=s.dot?F:it;let P=s.bash===!0?Z(s):dt;s.capture&&(P=`(${P})`),typeof s.noext=="boolean"&&(s.noextglob=s.noext);const a={input:p,index:-1,start:0,dot:s.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:R};p=e.removePrefix(p,a),v=p.length;const tt=[],z=[],j=[];let u=x,i;const rt=$(()=>a.index===v-1,"tt"),D=a.peek=(g=1)=>p[a.index+g],K=a.advance=()=>p[++a.index]||"",pt=$(()=>p.slice(a.index+1),"k"),nt=$((g="",U=0)=>{a.consumed+=g,a.index+=U},"J"),ht=$(g=>{a.output+=g.output!=null?g.output:g.value,nt(g.value)},"ct"),De=$(()=>{let g=1;for(;D()==="!"&&(D(2)!=="("||D(3)==="?");)K(),a.start++,g++;return g%2===0?!1:(a.negated=!0,a.start++,!0)},"Rt"),mt=$(g=>{a[g]++,j.push(g)},"At"),ft=$(g=>{a[g]--,j.pop()},"it"),w=$(g=>{if(u.type==="globstar"){const U=a.braces>0&&(g.type==="comma"||g.type==="brace"),f=g.extglob===!0||tt.length&&(g.type==="pipe"||g.type==="paren");g.type!=="slash"&&g.type!=="paren"&&!U&&!f&&(a.output=a.output.slice(0,-u.output.length),u.type="star",u.value="*",u.output=P,a.output+=u.output)}if(tt.length&&g.type!=="paren"&&(tt[tt.length-1].inner+=g.value),(g.value||g.output)&&ht(g),u&&u.type==="text"&&g.type==="text"){u.output=(u.output||u.value)+g.value,u.value+=g.value;return}g.prev=u,R.push(g),u=g},"g"),$t=$((g,U)=>{const f={...B[U],conditions:1,inner:""};f.prev=u,f.parens=a.parens,f.output=a.output,f.startIndex=a.index,f.tokensIndex=R.length;const T=(s.capture?"(":"")+f.open;mt("parens"),w({type:g,value:U,output:a.output?"":ot}),w({type:"paren",extglob:!0,value:K(),output:T}),tt.push(f)},"_t"),Be=$(g=>{const U=p.slice(g.startIndex,a.index+1),f=p.slice(g.startIndex+2,a.index),T=O(f,s);if((g.type==="plus"||g.type==="star")&&T.risky){const M=T.safeOutput?(g.output?"":ot)+(s.capture?`(${T.safeOutput})`:T.safeOutput):void 0,at=R[g.tokensIndex];at.type="text",at.value=U,at.output=M||e.escapeRegex(U);for(let lt=g.tokensIndex+1;lt<R.length;lt++)R[lt].value="",R[lt].output="",delete R[lt].suffix;a.output=g.output+at.output,a.backtrack=!0,w({type:"paren",extglob:!0,value:i,output:""}),ft("parens");return}let W=g.close+(s.capture?")":""),Y;if(g.type==="negate"){let M=P;if(g.inner&&g.inner.length>1&&g.inner.includes("/")&&(M=Z(s)),(M!==P||rt()||/^\)+$/.test(pt()))&&(W=g.close=`)$))${M}`),g.inner.includes("*")&&(Y=pt())&&/^\.[^\\/.]+$/.test(Y)){const at=Q(Y,{...A,fastpaths:!1}).output;W=g.close=`)${at})${M})`}g.prev.type==="bos"&&(a.negatedExtglob=!0)}w({type:"paren",extglob:!0,value:i,output:W}),ft("parens")},"Lt");if(s.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(p)){let g=!1,U=p.replace(o,(f,T,W,Y,M,at)=>Y==="\\"?(g=!0,f):Y==="?"?T?T+Y+(M?F.repeat(M.length):""):at===0?C+(M?F.repeat(M.length):""):F.repeat(W.length):Y==="."?q.repeat(W.length):Y==="*"?T?T+Y+(M?P:""):P:T?f:`\\${f}`);return g===!0&&(s.unescape===!0?U=U.replace(/\\/g,""):U=U.replace(/\\+/g,f=>f.length%2===0?"\\\\":f?"\\":"")),U===p&&s.contains===!0?(a.output=p,a):(a.output=e.wrapOutput(U,a,A),a)}for(;!rt();){if(i=K(),i==="\0")continue;if(i==="\\"){const f=D();if(f==="/"&&s.bash!==!0||f==="."||f===";")continue;if(!f){i+="\\",w({type:"text",value:i});continue}const T=/^\\+/.exec(pt());let W=0;if(T&&T[0].length>2&&(W=T[0].length,a.index+=W,W%2!==0&&(i+="\\")),s.unescape===!0?i=K():i+=K(),a.brackets===0){w({type:"text",value:i});continue}}if(a.brackets>0&&(i!=="]"||u.value==="["||u.value==="[^")){if(s.posix!==!1&&i===":"){const f=u.value.slice(1);if(f.includes("[")&&(u.posix=!0,f.includes(":"))){const T=u.value.lastIndexOf("["),W=u.value.slice(0,T),Y=u.value.slice(T+2),M=l[Y];if(M){u.value=W+M,a.backtrack=!0,K(),!x.output&&R.indexOf(u)===1&&(x.output=ot);continue}}}(i==="["&&D()!==":"||i==="-"&&D()==="]")&&(i=`\\${i}`),i==="]"&&(u.value==="["||u.value==="[^")&&(i=`\\${i}`),s.posix===!0&&i==="!"&&u.value==="["&&(i="^"),u.value+=i,ht({value:i});continue}if(a.quotes===1&&i!=='"'){i=e.escapeRegex(i),u.value+=i,ht({value:i});continue}if(i==='"'){a.quotes=a.quotes===1?0:1,s.keepQuotes===!0&&w({type:"text",value:i});continue}if(i==="("){mt("parens"),w({type:"paren",value:i});continue}if(i===")"){if(a.parens===0&&s.strictBrackets===!0)throw new SyntaxError(y("opening","("));const f=tt[tt.length-1];if(f&&a.parens===f.parens+1){Be(tt.pop());continue}w({type:"paren",value:i,output:a.parens?")":"\\)"}),ft("parens");continue}if(i==="["){if(s.nobracket===!0||!pt().includes("]")){if(s.nobracket!==!0&&s.strictBrackets===!0)throw new SyntaxError(y("closing","]"));i=`\\${i}`}else mt("brackets");w({type:"bracket",value:i});continue}if(i==="]"){if(s.nobracket===!0||u&&u.type==="bracket"&&u.value.length===1){w({type:"text",value:i,output:`\\${i}`});continue}if(a.brackets===0){if(s.strictBrackets===!0)throw new SyntaxError(y("opening","["));w({type:"text",value:i,output:`\\${i}`});continue}ft("brackets");const f=u.value.slice(1);if(u.posix!==!0&&f[0]==="^"&&!f.includes("/")&&(i=`/${i}`),u.value+=i,ht({value:i}),s.literalBrackets===!1||e.hasRegexChars(f))continue;const T=e.escapeRegex(u.value);if(a.output=a.output.slice(0,-u.value.length),s.literalBrackets===!0){a.output+=T,u.value=T;continue}u.value=`(${m}${T}|${u.value})`,a.output+=u.value;continue}if(i==="{"&&s.nobrace!==!0){mt("braces");const f={type:"brace",value:i,output:"(",outputIndex:a.output.length,tokensIndex:a.tokens.length};z.push(f),w(f);continue}if(i==="}"){const f=z[z.length-1];if(s.nobrace===!0||!f){w({type:"text",value:i,output:i});continue}let T=")";if(f.dots===!0){const W=R.slice(),Y=[];for(let M=W.length-1;M>=0&&(R.pop(),W[M].type!=="brace");M--)W[M].type!=="dots"&&Y.unshift(W[M].value);T=h(Y,s),a.backtrack=!0}if(f.comma!==!0&&f.dots!==!0){const W=a.output.slice(0,f.outputIndex),Y=a.tokens.slice(f.tokensIndex);f.value=f.output="\\{",i=T="\\}",a.output=W;for(const M of Y)a.output+=M.output||M.value}w({type:"brace",value:i,output:T}),ft("braces"),z.pop();continue}if(i==="|"){tt.length>0&&tt[tt.length-1].conditions++,w({type:"text",value:i});continue}if(i===","){let f=i;const T=z[z.length-1];T&&j[j.length-1]==="braces"&&(T.comma=!0,f="|"),w({type:"comma",value:i,output:f});continue}if(i==="/"){if(u.type==="dot"&&a.index===a.start+1){a.start=a.index+1,a.consumed="",a.output="",R.pop(),u=x;continue}w({type:"slash",value:i,output:V});continue}if(i==="."){if(a.braces>0&&u.type==="dot"){u.value==="."&&(u.output=q);const f=z[z.length-1];u.type="dots",u.output+=i,u.value+=i,f.dots=!0;continue}if(a.braces+a.parens===0&&u.type!=="bos"&&u.type!=="slash"){w({type:"text",value:i,output:q});continue}w({type:"dot",value:i,output:q});continue}if(i==="?"){if(!(u&&u.value==="(")&&s.noextglob!==!0&&D()==="("&&D(2)!=="?"){$t("qmark",i);continue}if(u&&u.type==="paren"){const f=D();let T=i;(u.value==="("&&!/[!=<:]/.test(f)||f==="<"&&!/<([!=]|\w+>)/.test(pt()))&&(T=`\\${i}`),w({type:"text",value:i,output:T});continue}if(s.dot!==!0&&(u.type==="slash"||u.type==="bos")){w({type:"qmark",value:i,output:it});continue}w({type:"qmark",value:i,output:F});continue}if(i==="!"){if(s.noextglob!==!0&&D()==="("&&(D(2)!=="?"||!/[!=<:]/.test(D(3)))){$t("negate",i);continue}if(s.nonegate!==!0&&a.index===0){De();continue}}if(i==="+"){if(s.noextglob!==!0&&D()==="("&&D(2)!=="?"){$t("plus",i);continue}if(u&&u.value==="("||s.regex===!1){w({type:"plus",value:i,output:st});continue}if(u&&(u.type==="bracket"||u.type==="paren"||u.type==="brace")||a.parens>0){w({type:"plus",value:i});continue}w({type:"plus",value:st});continue}if(i==="@"){if(s.noextglob!==!0&&D()==="("&&D(2)!=="?"){w({type:"at",extglob:!0,value:i,output:""});continue}w({type:"text",value:i});continue}if(i!=="*"){(i==="$"||i==="^")&&(i=`\\${i}`);const f=c.exec(pt());f&&(i+=f[0],a.index+=f[0].length),w({type:"text",value:i});continue}if(u&&(u.type==="globstar"||u.star===!0)){u.type="star",u.star=!0,u.value+=i,u.output=P,a.backtrack=!0,a.globstar=!0,nt(i);continue}let g=pt();if(s.noextglob!==!0&&/^\([^?]/.test(g)){$t("star",i);continue}if(u.type==="star"){if(s.noglobstar===!0){nt(i);continue}const f=u.prev,T=f.prev,W=f.type==="slash"||f.type==="bos",Y=T&&(T.type==="star"||T.type==="globstar");if(s.bash===!0&&(!W||g[0]&&g[0]!=="/")){w({type:"star",value:i,output:""});continue}const M=a.braces>0&&(f.type==="comma"||f.type==="brace"),at=tt.length&&(f.type==="pipe"||f.type==="paren");if(!W&&f.type!=="paren"&&!M&&!at){w({type:"star",value:i,output:""});continue}for(;g.slice(0,3)==="/**";){const lt=p[a.index+4];if(lt&<!=="/")break;g=g.slice(3),nt("/**",3)}if(f.type==="bos"&&rt()){u.type="globstar",u.value+=i,u.output=Z(s),a.output=u.output,a.globstar=!0,nt(i);continue}if(f.type==="slash"&&f.prev.type!=="bos"&&!Y&&rt()){a.output=a.output.slice(0,-(f.output+u.output).length),f.output=`(?:${f.output}`,u.type="globstar",u.output=Z(s)+(s.strictSlashes?")":"|$)"),u.value+=i,a.globstar=!0,a.output+=f.output+u.output,nt(i);continue}if(f.type==="slash"&&f.prev.type!=="bos"&&g[0]==="/"){const lt=g[1]!==void 0?"|$":"";a.output=a.output.slice(0,-(f.output+u.output).length),f.output=`(?:${f.output}`,u.type="globstar",u.output=`${Z(s)}${V}|${V}${lt})`,u.value+=i,a.output+=f.output+u.output,a.globstar=!0,nt(i+K()),w({type:"slash",value:"/",output:""});continue}if(f.type==="bos"&&g[0]==="/"){u.type="globstar",u.value+=i,u.output=`(?:^|${V}|${Z(s)}${V})`,a.output=u.output,a.globstar=!0,nt(i+K()),w({type:"slash",value:"/",output:""});continue}if(M&&g[0]==="/"){u.type="globstar",u.value+=i,u.output=`(?:^|${V}|${Z(s)}${V})`,a.output+=u.output,a.globstar=!0,nt(i+K()),w({type:"slash",value:"/",output:""});continue}a.output=a.output.slice(0,-u.output.length),u.type="globstar",u.output=Z(s),u.value+=i,a.output+=u.output,a.globstar=!0,nt(i);continue}const U={type:"star",value:i,output:P};if(s.bash===!0){U.output=".*?",(u.type==="bos"||u.type==="slash")&&(U.output=et+U.output),w(U);continue}if(u&&(u.type==="bracket"||u.type==="paren")&&s.regex===!0){U.output=i,w(U);continue}(a.index===a.start||u.type==="slash"||u.type==="dot")&&(u.type==="dot"?(a.output+=gt,u.output+=gt):s.dot===!0?(a.output+=ut,u.output+=ut):(a.output+=et,u.output+=et),D()!=="*"&&(a.output+=ot,u.output+=ot)),w(U)}for(;a.brackets>0;){if(s.strictBrackets===!0)throw new SyntaxError(y("closing","]"));a.output=e.escapeLast(a.output,"["),ft("brackets")}for(;a.parens>0;){if(s.strictBrackets===!0)throw new SyntaxError(y("closing",")"));a.output=e.escapeLast(a.output,"("),ft("parens")}for(;a.braces>0;){if(s.strictBrackets===!0)throw new SyntaxError(y("closing","}"));a.output=e.escapeLast(a.output,"{"),ft("braces")}if(s.strictSlashes!==!0&&(u.type==="star"||u.type==="bracket")&&w({type:"maybe_slash",value:"",output:`${V}?`}),a.backtrack===!0){a.output="";for(const g of a.tokens)a.output+=g.output!=null?g.output:g.value,g.suffix&&(a.output+=g.suffix)}return a},"q");return Q.fastpaths=(p,A)=>{const s={...A},b=typeof s.maxLength=="number"?Math.min(n,s.maxLength):n,v=p.length;if(v>b)throw new SyntaxError(`Input length: ${v}, exceeds maximum allowed length: ${b}`);p=r[p]||p;const{DOT_LITERAL:x,SLASH_LITERAL:R,ONE_CHAR:m,DOTS_SLASH:G,NO_DOT:B,NO_DOTS:q,NO_DOTS_SLASH:st,STAR:V,START_ANCHOR:ot}=t.globChars(s.windows),X=s.dot?q:B,ct=s.dot?st:B,gt=s.capture?"":"?:",ut={negated:!1,prefix:""};let F=s.bash===!0?".*?":V;s.capture&&(F=`(${F})`);const it=$(et=>et.noglobstar===!0?F:`(${gt}(?:(?!${ot}${et.dot?G:x}).)*?)`,"z"),dt=$(et=>{switch(et){case"*":return`${X}${m}${F}`;case".*":return`${x}${m}${F}`;case"*.*":return`${X}${F}${x}${m}${F}`;case"*/*":return`${X}${F}${R}${m}${ct}${F}`;case"**":return X+it(s);case"**/*":return`(?:${X}${it(s)}${R})?${ct}${m}${F}`;case"**/*.*":return`(?:${X}${it(s)}${R})?${ct}${F}${x}${m}${F}`;case"**/.*":return`(?:${X}${it(s)}${R})?${x}${m}${F}`;default:{const C=/^(.*?)\.(\w+)$/.exec(et);if(!C)return;const P=dt(C[1]);return P?P+x+C[2]:void 0}}},"lt"),J=e.removePrefix(p,ut);let Z=dt(J);return Z&&s.strictSlashes!==!0&&(Z+=`${R}?`),Z},Ht=Q,Ht}_(re,"wt$1");$(re,"Nt");var Tt,Yt;function se(){if(Yt)return Tt;Yt=1;const t=ne(),e=re(),n=vt(),l=Et(),c=$(r=>r&&typeof r=="object"&&!Array.isArray(r),"K"),o=$((r,h,y=!1)=>{if(Array.isArray(r)){const O=r.map(Q=>o(Q,h,y));return Q=>{for(const p of O){const A=p(Q);if(A)return A}return!1}}const k=c(r)&&r.tokens&&r.input;if(r===""||typeof r!="string"&&!k)throw new TypeError("Expected pattern to be a non-empty string");const S=h||{},H=S.windows,N=k?o.compileRe(r,h):o.makeRe(r,h,!1,!0),E=N.state;delete N.state;let L=$(()=>!1,"G");if(S.ignore){const O={...h,ignore:null,onMatch:null,onResult:null};L=o(S.ignore,O,y)}const I=$((O,Q=!1)=>{const{isMatch:p,match:A,output:s}=o.test(O,N,h,{glob:r,posix:H}),b={glob:r,state:E,regex:N,posix:H,input:O,output:s,match:A,isMatch:p};if(typeof S.onResult=="function"&&S.onResult(b),p===!1)return b.isMatch=!1,Q?b:!1;t:if(L(O)){if(typeof S.onIgnore=="function"&&S.onIgnore(b)===l.UNIGNORE){b.isMatch=!0;break t}return b.isMatch=!1,Q?b:!1}return typeof S.onMatch=="function"&&S.onMatch(b),Q?b:!0},"ot");return y&&(I.state=E),I},"s");return o.test=(r,h,y,{glob:k,posix:S}={})=>{if(typeof r!="string")throw new TypeError("Expected input to be a string");if(r==="")return{isMatch:!1,output:""};const H=y||{},N=H.format||(S?n.toPosixSlashes:null);let E=r===k,L=E&&N?N(r):r;return E===!1&&(L=N?N(r):r,E=L===k),(E===!1||H.capture===!0)&&(H.matchBase===!0||H.basename===!0?E=o.matchBase(r,h,y,S):E=h.exec(L)),{isMatch:!!E,match:E,output:L}},o.matchBase=(r,h,y)=>(h instanceof RegExp?h:o.makeRe(h,y)).test(n.basename(r)),o.isMatch=(r,h,y)=>o(h,y)(r),o.parse=(r,h)=>Array.isArray(r)?r.map(y=>o.parse(y,h)):e(r,{...h,fastpaths:!1}),o.scan=(r,h)=>t(r,h),o.compileRe=(r,h,y=!1,k=!1)=>{if(y===!0)return r.output;const S=h||{},H=S.contains?"":"^",N=S.contains?"":"$";let E=`${H}(?:${r.output})${N}`;r&&r.negated===!0&&(E=`^(?!${E}).*$`);const L=o.toRegex(E,h);return k===!0&&(L.state=r),L},o.makeRe=(r,h={},y=!1,k=!1)=>{if(!r||typeof r!="string")throw new TypeError("Expected a non-empty string");let S={negated:!1,fastpaths:!0};return h.fastpaths!==!1&&(r[0]==="."||r[0]==="*")&&(S.output=e.fastpaths(r,h)),S.output||(S=e(r,h)),o.compileRe(S,h,y,k)},o.toRegex=(r,h)=>{try{const y=h||{};return new RegExp(r,y.flags||(y.nocase?"i":""))}catch(y){if(h&&h.debug===!0)throw y;return/$^/}},o.constants=l,Tt=o,Tt}_(se,"Bt$1");$(se,"It");var Lt,Zt;function oe(){if(Zt)return Lt;Zt=1;const t=se(),e=vt();function n(l,c,o=!1){return c&&(c.windows===null||c.windows===void 0)&&(c={...c,windows:e.isWindows()}),t(l,c,o)}return _(n,"T"),$(n,"$"),Object.assign(n,t),Lt=n,Lt}_(oe,"Gt$1");$(oe,"wt");var je=oe();const yt=ee(je);var Qe=Object.defineProperty,d=_((t,e)=>Qe(t,"name",{value:e,configurable:!0}),"i");const ze=qe(import.meta.url),Rt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,St=d(t=>{if(typeof Rt<"u"&&Rt.versions&&Rt.versions.node){const[e,n]=Rt.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return Rt.getBuiltinModule(t)}return ze(t)},"D"),Vt=St("fs"),Ye={...Vt,default:Vt},{statSync:Ze,stat:Ve,realpathSync:Je,realpath:tn,readdirSync:en,readdir:nn}=St("fs"),{sep:ue,basename:rn,dirname:Pt,resolve:ie,normalize:sn,relative:on,posix:At,isAbsolute:un}=St("path"),{fileURLToPath:an}=St("url"),{createRequire:ln}=St("module");var Jt=ln(import.meta.url);function ae(t){let e=sn(t);return e.length>1&&e[e.length-1]===ue&&(e=e.substring(0,e.length-1)),e}_(ae,"St");d(ae,"bt");const cn=/[\\/]/g;function Dt(t,e){return t.replace(cn,e)}_(Dt,"N");d(Dt,"N");const pn=/^[a-z]:[\\/]$/i;function le(t){return t==="/"||pn.test(t)}_(le,"xt");d(le,"$t");function Ct(t,e){const{resolvePaths:n,normalizePath:l,pathSeparator:c}=e,o=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(n&&(t=ie(t)),(l||o)&&(t=ae(t)),t===".")return"";const r=t[t.length-1]!==c;return Dt(r?t+c:t,c)}_(Ct,"W");d(Ct,"R");function Bt(t,e){return e+t}_(Bt,"Q");d(Bt,"U");function ce(t,e){return function(n,l){return l.startsWith(t)?l.slice(t.length)+n:Dt(on(t,l),e.pathSeparator)+e.pathSeparator+n}}_(ce,"Dt");d(ce,"kt");function pe(t){return t}_(pe,"Ft");d(pe,"Pt");function he(t,e,n){return e+t+n}_(he,"Et");d(he,"xt");function fe(t,e){const{relativePaths:n,includeBasePath:l}=e;return n&&t?ce(t,e):l?Bt:pe}_(fe,"qt");d(fe,"Dt");function ge(t){return function(e,n){n.push(e.substring(t.length)||".")}}_(ge,"$t");d(ge,"Ft");function de(t){return function(e,n,l){const c=e.substring(t.length)||".";l.every(o=>o(c,!0))&&n.push(c)}}_(de,"Ot");d(de,"_t");const hn=d((t,e)=>{e.push(t||".")},"qt"),fn=d((t,e,n)=>{const l=t||".";n.every(c=>c(l,!0))&&e.push(l)},"Et"),gn=d(()=>{},"jt");function ye(t,e){const{includeDirs:n,filters:l,relativePaths:c}=e;return n?c?l&&l.length?de(t):ge(t):l&&l.length?fn:hn:gn}_(ye,"Ct");d(ye,"Rt");const dn=d((t,e,n,l)=>{l.every(c=>c(t,!1))&&n.files++},"Wt"),yn=d((t,e,n,l)=>{l.every(c=>c(t,!1))&&e.push(t)},"At"),An=d((t,e,n,l)=>{n.files++},"Bt"),_n=d((t,e)=>{e.push(t)},"Ot"),bn=d(()=>{},"Ct");function Ae(t){const{excludeFiles:e,filters:n,onlyCounts:l}=t;return e?bn:n&&n.length?l?dn:yn:l?An:_n}_(Ae,"Lt");d(Ae,"Mt");const Rn=d(t=>t,"Lt"),En=d(()=>[""].slice(0,0),"It");function _e(t){return t.group?En:Rn}_(_e,"Gt");d(_e,"Tt");const vn=d((t,e,n)=>{t.push({directory:e,files:n,dir:e})},"Gt"),Sn=d(()=>{},"zt");function be(t){return t.group?vn:Sn}_(be,"Ut");d(be,"Nt");const xn=d(function(t,e,n){const{queue:l,fs:c,options:{suppressErrors:o}}=e;l.enqueue(),c.realpath(t,(r,h)=>{if(r)return l.dequeue(o?null:r,e);c.stat(h,(y,k)=>{if(y)return l.dequeue(o?null:y,e);if(k.isDirectory()&&Mt(t,h,e))return l.dequeue(null,e);n(k,h),l.dequeue(null,e)})})},"Ut"),mn=d(function(t,e,n){const{queue:l,fs:c,options:{suppressErrors:o}}=e;l.enqueue();try{const r=c.realpathSync(t),h=c.statSync(r);if(h.isDirectory()&&Mt(t,r,e))return;n(h,r)}catch(r){if(!o)throw r}},"Qt");function Re(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?mn:xn}_(Re,"Ht");d(Re,"Yt");function Mt(t,e,n){if(n.options.useRealPaths)return Ee(e,n);let l=Pt(t),c=1;for(;l!==n.root&&c<2;){const o=n.symlinks.get(l);o&&(o===e||o.startsWith(e)||e.startsWith(o))?c++:l=Pt(l)}return n.symlinks.set(t,e),c>1}_(Mt,"U");d(Mt,"Q");function Ee(t,e){return e.visited.includes(t+e.options.pathSeparator)}_(Ee,"Jt");d(Ee,"Zt");const $n=d(t=>t.counts,"Ht"),Cn=d(t=>t.groups,"Jt"),kn=d(t=>t.paths,"Kt"),On=d(t=>t.paths.slice(0,t.options.maxFiles),"Vt"),wn=d((t,e,n)=>(xt(e,n,t.counts,t.options.suppressErrors),null),"Xt"),Hn=d((t,e,n)=>(xt(e,n,t.paths,t.options.suppressErrors),null),"te"),Tn=d((t,e,n)=>(xt(e,n,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),"ee"),Ln=d((t,e,n)=>(xt(e,n,t.groups,t.options.suppressErrors),null),"se");function xt(t,e,n,l){e(t&&!l?t:null,n)}_(xt,"q");d(xt,"F");function ve(t,e){const{onlyCounts:n,group:l,maxFiles:c}=t;return n?e?$n:wn:l?e?Cn:Ln:c?e?On:Tn:e?kn:Hn}_(ve,"is");d(ve,"re");const Se={withFileTypes:!0},Pn=d((t,e,n,l,c)=>{if(t.queue.enqueue(),l<0)return t.queue.dequeue(null,t);const{fs:o}=t;t.visited.push(e),t.counts.directories++,o.readdir(e||".",Se,(r,h=[])=>{c(h,n,l),t.queue.dequeue(t.options.suppressErrors?null:r,t)})},"ne"),Nn=d((t,e,n,l,c)=>{const{fs:o}=t;if(l<0)return;t.visited.push(e),t.counts.directories++;let r=[];try{r=o.readdirSync(e||".",Se)}catch(h){if(!t.options.suppressErrors)throw h}c(r,n,l)},"oe");function xe(t){return t?Nn:Pn}_(xe,"us");d(xe,"ie");var In=class{static{_(this,"hs")}static{d(this,"ue")}count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},Dn=class{static{_(this,"cs")}static{d(this,"le")}_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},Bn=class{static{_(this,"as")}static{d(this,"ce")}aborted=!1;abort(){this.aborted=!0}},me=class{static{_(this,"Z")}static{d(this,"Z")}root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,n){this.isSynchronous=!n,this.callbackInvoker=ve(e,this.isSynchronous),this.root=Ct(t,e),this.state={root:le(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new Dn,options:e,queue:new In((l,c)=>this.callbackInvoker(c,l,n)),symlinks:new Map,visited:[""].slice(0,0),controller:new Bn,fs:e.fs||Ye},this.joinPath=fe(this.root,e),this.pushDirectory=ye(this.root,e),this.pushFile=Ae(e),this.getArray=_e(e),this.groupFiles=be(e),this.resolveSymlink=Re(e,this.isSynchronous),this.walkDirectory=xe(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=d((t,e,n)=>{const{paths:l,options:{filters:c,resolveSymlinks:o,excludeSymlinks:r,exclude:h,maxFiles:y,signal:k,useRealPaths:S,pathSeparator:H},controller:N}=this.state;if(N.aborted||k&&k.aborted||y&&l.length>y)return;const E=this.getArray(this.state.paths);for(let L=0;L<t.length;++L){const I=t[L];if(I.isFile()||I.isSymbolicLink()&&!o&&!r){const O=this.joinPath(I.name,e);this.pushFile(O,E,this.state.counts,c)}else if(I.isDirectory()){let O=he(I.name,e,this.state.options.pathSeparator);if(h&&h(I.name,O))continue;this.pushDirectory(O,l,c),this.walkDirectory(this.state,O,O,n-1,this.walk)}else if(this.resolveSymlink&&I.isSymbolicLink()){let O=Bt(I.name,e);this.resolveSymlink(O,this.state,(Q,p)=>{if(Q.isDirectory()){if(p=Ct(p,this.state.options),h&&h(I.name,S?p:O+H))return;this.walkDirectory(this.state,p,S?p:O+H,n-1,this.walk)}else{p=S?p:O;const A=rn(p),s=Ct(Pt(p),this.state.options);p=this.joinPath(A,s),this.pushFile(p,E,this.state.counts,c)}})}}this.groupFiles(this.state.groups,e,E)},"walk")};function $e(t,e){return new Promise((n,l)=>{Ft(t,e,(c,o)=>{if(c)return l(c);n(o)})})}_($e,"ps");d($e,"ae");function Ft(t,e,n){new me(t,e,n).start()}_(Ft,"H");d(Ft,"H");function Ce(t,e){return new me(t,e).start()}_(Ce,"fs");d(Ce,"he");var te=class{static{_(this,"I")}static{d(this,"L")}constructor(t,e){this.root=t,this.options=e}withPromise(){return $e(this.root,this.options)}withCallback(t){Ft(this.root,this.options,t)}sync(){return Ce(this.root,this.options)}};let ke=null;try{Jt.resolve("picomatch"),ke=Jt("picomatch")}catch{}var Mn=class{static{_(this,"gs")}static{d(this,"pe")}globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:ue,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new te(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new te(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){const n=this.globFunction||ke;if(!n)throw new Error("Please specify a glob function to use glob matching.");var l=this.globCache[t.join("\0")];return l||(l=n(t,...e),this.globCache[t.join("\0")]=l),this.options.filters.push(c=>l(c)),this}};const Fn=Array.isArray,Oe=/\\/g,we=process.platform==="win32",Gn=/^(\/?\.\.)+$/;function Nt(t,e={}){const n=t.length,l=Array(n),c=Array(n);let o,r;for(o=0;o<n;o++){const h=Gt(t[o]);l[o]=h;const y=h.length,k=Array(y);for(r=0;r<y;r++)k[r]=yt(h[r],e);c[o]=k}return h=>{const y=h.split("/");if(y[0]===".."&&Gn.test(h))return!0;for(o=0;o<n;o++){const k=l[o],S=c[o],H=y.length,N=Math.min(H,k.length);for(r=0;r<N;){const E=k[r];if(E.includes("/"))return!0;if(!S[r](y[r]))break;if(!e.noglobstar&&E==="**")return!0;r++}if(r===H)return!0}return!1}}_(Nt,"L");d(Nt,"I");const Un=/^[A-Z]:\/$/i,qn=we?t=>Un.test(t):t=>t==="/";function It(t,e,n){if(t===e||e.startsWith(`${t}/`)){if(n){const c=t.length+ +!qn(t);return(o,r)=>o.slice(c,r?-1:void 0)||"."}const l=e.slice(t.length+1);return l?(c,o)=>{if(c===".")return l;const r=`${l}/${c}`;return o?r.slice(0,-1):r}:(c,o)=>o&&c!=="."?c.slice(0,-1):c}return n?l=>At.relative(t,l)||".":l=>At.relative(t,`${e}/${l}`)||"."}_(It,"T");d(It,"T");function He(t,e){if(e.startsWith(`${t}/`)){const n=e.slice(t.length+1);return l=>`${n}/${l}`}return n=>{const l=At.relative(t,`${e}/${n}`);return n[n.length-1]==="/"&&l!==""?`${l}/`:l||"."}}_(He,"bs");d(He,"me");const Xn={parts:!0};function Gt(t){var e;const n=yt.scan(t,Xn);return!((e=n.parts)===null||e===void 0)&&e.length?n.parts:[t]}_(Gt,"X");d(Gt,"X");const Kn=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,Wn=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,jn=d(t=>t.replace(Kn,"\\$&"),"Se"),Qn=d(t=>t.replace(Wn,"\\$&"),"$e"),zn=we?Qn:jn;function Te(t,e){const n=yt.scan(t);return n.isGlob||n.negated}_(Te,"Fs");d(Te,"Pe");function _t(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}_(_t,"F");d(_t,"x");function Ut(t){return typeof t=="string"?[t]:t??[]}_(Ut,"tt");d(Ut,"tt");const Yn=/^(\/?\.\.)+/,Zn=/\\(?=[()[\]{}!*+?@|])/g;function kt(t,e,n,l){var c;const o=e.cwd;let r=t;t[t.length-1]==="/"&&(r=t.slice(0,-1));const h=r.lastIndexOf("/"),y=(h===-1?r:r.slice(h+1)).startsWith("!(");r[r.length-1]!=="*"&&!y&&e.expandDirectories&&(r+="/**");const k=zn(o);r=un(r.replace(Zn,""))?At.relative(k,r):At.normalize(r);const S=(c=Yn.exec(r))===null||c===void 0?void 0:c[0],H=Gt(r);if(S){const E=(S.length+1)/3;let L=0;const I=k.split("/");for(;L<E&&H[L+E]===I[I.length+L-E];)r=r.slice(0,(E-L-1)*3)+r.slice((E-L)*3+H[L+E].length+1)||".",L++;const O=At.join(o,S.slice(L*3));O[0]!=="."&&n.root.length>O.length&&(n.root=O,n.depthOffset=-E+L)}if(!l&&n.depthOffset>=0){var N;(N=n.commonPath)!==null&&N!==void 0||(n.commonPath=H);const E=[],L=Math.min(n.commonPath.length,H.length);for(let I=0;I<L;I++){const O=H[I];if(O==="**"&&!H[I+1]){E.pop();break}if(I===H.length-1||O!==n.commonPath[I]||Te(O))break;E.push(O)}n.depthOffset=E.length,n.commonPath=E,n.root=E.length>0?At.join(o,...E):o}return r}_(kt,"B");d(kt,"W");function Le(t,e,n){const l=[],c=[],o=[];for(const r of t.ignore)r&&(r[0]!=="!"||r[1]==="("?c.push(kt(r,t,n,!0)):o.push(r.slice(1)));for(const r of e)r&&(r[0]!=="!"||r[1]==="("?l.push(kt(r,t,n,!1)):(r[1]!=="!"||r[2]==="(")&&c.push(kt(r.slice(1),t,n,!0)));return{match:l,ignore:c,unignore:o}}_(Le,"$s");d(Le,"Fe");function Pe(t,e){const n=t.cwd,l={root:n,depthOffset:0},c=Le(t,e,l);t.debug&&_t("internal processing patterns:",c);const{absolute:o,caseSensitiveMatch:r,debug:h,dot:y,followSymbolicLinks:k,onlyDirectories:S}=t,H=l.root.replace(Oe,""),N={dot:y,nobrace:t.braceExpansion===!1,nocase:!r,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},E=c.unignore.length>0,L=E?yt(c.unignore,N):void 0,I=E?Nt(c.unignore,N):void 0,O=yt(c.match,{...N,ignore:c.ignore,onIgnore:L?m=>L(m.output)&&yt.constants.UNIGNORE:void 0}),Q=yt(c.ignore,N),p=Nt(c.match,N),A=It(n,H,o),s=o?A:It(n,H,!0),b=c.match.length>0&&c.match.every(m=>m==="**"||m==="**/*"),v=c.ignore.length>0||E||!b?(m,G)=>{const B=s(G,!0);return B==="."||I&&I(B)?!1:!p(B)||Q(B)}:void 0;let x;t.deep!==void 0&&(x=Math.round(t.deep-l.depthOffset));const R=new Mn({filters:[h?(m,G)=>{const B=A(m,G),q=O(B);return q&&_t(`matched ${B}`),q}:(m,G)=>{const B=A(m,G);return O(B)}],exclude:h&&v?(m,G)=>{const B=v(m,G);return _t(`${B?"skipped":"crawling"} ${G}`),B}:v,fs:t.fs,pathSeparator:"/",relativePaths:!o,resolvePaths:o,includeBasePath:o,resolveSymlinks:k,excludeSymlinks:!k,excludeFiles:S,includeDirs:S||!t.onlyFiles,maxDepth:x,signal:t.signal}).crawl(H);return t.debug&&_t("internal properties:",{...l,root:H}),[R,n!==H&&!o&&He(n,H)]}_(Pe,"Os");d(Pe,"_e");function qt(t,e){if(e)for(let n=t.length-1;n>=0;n--)t[n]=e(t[n]);return t}_(qt,"st");d(qt,"et");const Vn={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function Ne(t){const e={...Vn,...t};return e.cwd=(e.cwd instanceof URL?an(e.cwd):ie(e.cwd)).replace(Oe,"/"),e.ignore=Ut(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||nn,readdirSync:e.fs.readdirSync||en,realpath:e.fs.realpath||tn,realpathSync:e.fs.realpathSync||Je,stat:e.fs.stat||Ve,statSync:e.fs.statSync||Ze}),e.debug&&_t("globbing with options:",e),e}_(Ne,"Ws");d(Ne,"Ee");function Xt(t,e={}){var n;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");const l=Fn(t)||typeof t=="string",c=Ut((n=l?t:t.patterns)!==null&&n!==void 0?n:"**/*"),o=Ne(l?e:t);return c.length>0?Pe(o,c):[]}_(Xt,"et");d(Xt,"st");async function Ie(t,e){const[n,l]=Xt(t,e);return n?qt(await n.withPromise(),l):[]}_(Ie,"Bs");d(Ie,"Be");function Jn(t,e){const[n,l]=Xt(t,e);return n?qt(n.sync(),l):[]}_(Jn,"Cs");d(Jn,"Oe");var tr=Object.defineProperty,er=_((t,e)=>tr(t,"name",{value:e,configurable:!0}),"t");const sr=er(async(t,e)=>await Ie(t,e),"i");export{sr as r};
|