@visulima/packem 2.0.0-alpha.82 → 2.0.0-alpha.84
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 +26 -0
- package/dist/builder/typedoc/index.d.ts +1 -1
- package/dist/builder/typedoc/index.js +1 -1
- package/dist/cli/index.js +42 -42
- package/dist/config/index.d.ts +1 -1
- package/dist/config/preset/preact.d.ts +1 -1
- package/dist/config/preset/react.d.ts +1 -1
- package/dist/config/preset/solid.d.ts +1 -1
- package/dist/config/preset/svelte.d.ts +1 -1
- package/dist/config/preset/vue.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +38 -34
- package/dist/packem_shared/create-or-update-key-storage-Cp_qI2Lt.js +28 -0
- package/dist/packem_shared/default-Dbrx9zI9.js +1 -0
- package/dist/packem_shared/index-C1JIQmoZ.js +244 -0
- package/dist/packem_shared/oxcTransformPlugin-Dwvbw2jE-CIiF8y3S.js +185 -0
- package/dist/packem_shared/{types.d-Cm6dnCyD.d.ts → types.d-DOt53hsx.d.ts} +0 -4
- package/dist/rollup/plugins/oxc/oxc-transformer.js +1 -1
- package/package.json +4 -4
- package/dist/packem_shared/create-or-update-key-storage-DUTe5Prf.js +0 -13
- package/dist/packem_shared/default-Dj-WgmWM.js +0 -1
- package/dist/packem_shared/index-DFZJP0ed.js +0 -255
- package/dist/packem_shared/oxcResolvePlugin-DeIohkWk-rspLVIoy.js +0 -170
- package/dist/packem_shared/oxcTransformPlugin-Dwvbw2jE-Bbz81VnA.js +0 -4
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
var Wg=Object.defineProperty;var g=(e,t)=>Wg(e,"name",{value:t,configurable:!0});import{createRequire as Ze,builtinModules as Bg}from"node:module";import{g as uo,o as Dg,a as Ku,$ as Ga,M as Fg,B as fo,k as Wt,O as Bt,b as mo,n as Va,E as Yu,w as Lg,d as Xu,c as Gr,i as jt,u as Zu,q as pe,F as rt,j as We,I as Ka,P as _i,e as Ar,f as wa,h as Qu,l as zg,T as $r,H as Mi,p as ed,K as qg,r as Hg,s as Jg,m as Ug}from"./create-or-update-key-storage-Cp_qI2Lt.js";import Nt,{env as Gg,versions as Gi,platform as Dr}from"node:process";import{V as ne,R as Be,P as Mn,_ as G,H as Fr,L as re,A as Vg,X as Et,B as td,a as Kg,M as Ya,c as rd}from"./utils-nmTpa3um.js";import{installPackage as nd,detectPackageManager as Yg}from"@antfu/install-pkg";import{C as Vi,A as id,l as Xg,B as od,i as Zg,$ as sd,a as Qg,b as ev,c as nr,r as De,d as Kn,e as ho,f as Xa,g as ad,h as ld,j as tv,k as cd,m as rv,N as nv,n as iv,o as Pr,w as xa,p as ov,q as sv,t as Yn,I as av}from"./oxcTransformPlugin-Dwvbw2jE-CIiF8y3S.js";import{browserslistToEsbuild as uc,alias as pd,purePlugin as lv,pureNewExpressionPlugin as cv,importTrace as ud,replace as dd,polyfillNode as pv,chunkSplitter as uv,wasm as dv,preserveDirectivesPlugin as fv,dynamicImportVars as mv,commonjs as hv,jsxRemoveAttributes as gv,visualizer as vv,patchErrorWithTrace as bv}from"@visulima/packem-rollup";import{ENDING_REGEX as yv,svgToCssDataUri as $v,svgToTinyDataUri as wv,memoizeByKey as Za,arrayify as xv,enhanceRollupError as fd,FileCache as jv}from"@visulima/packem-share";import{RUNTIME_EXPORT_CONVENTIONS as md,SPECIAL_EXPORT_CONVENTIONS as hd,PRODUCTION_ENV as Rn,DEVELOPMENT_ENV as dc,DEFAULT_EXTENSIONS as go,ENDING_REGEX as Qa,EXCLUDE_REGEXP as Zt,ALLOWED_TRANSFORM_EXTENSIONS_REGEX as Yt,VALID_EXPORT_EXTENSIONS as kv}from"@visulima/packem-share/constants";import{getCacheHash as mt,memoize as Ev,arrayify as ja,isFromNodeModules as cs,isBareSpecifier as xn,parseSpecifier as ka,isOutsideProject as Sv,getPackageName as Ov,replaceContentWithinMarker as Av,svgEncoder as Pv,getChunkFilename as Tn,getEntryFileNames as Cv,getOutputExtension as Ye,sortUserPlugins as gd,getDtsExtension as gt,warn as Q}from"@visulima/packem-share/utils";import Rv from"browserslist";import{createHooks as Tv}from"hookable";import{createJiti as Nv}from"jiti";import{x as Ki,exec as _v}from"tinyexec";import Te from"magic-string";import{fileURLToPath as vd}from"node:url";import Mv,{existsSync as el,createReadStream as tl,createWriteStream as Iv,watch as fc}from"node:fs";import{cpus as Wv,tmpdir as bd,homedir as Bv}from"node:os";import{join as yd,dirname as Ea,resolve as Dv,isAbsolute as Fv}from"node:path";import{createFilter as $t,normalizePath as In}from"@rollup/pluginutils";import Lv from"workerpool";import{transformAsync as zv}from"@babel/core";import $d,{stat as Xn,readFile as Yi,copyFile as qv,chmod as wd,rm as vo,readdir as Hv,mkdtemp as xd,rename as Jv,mkdir as jd,writeFile as kd}from"node:fs/promises";import*as Uv from"rs-module-lexer";import{findStaticImports as bo,isNodeBuiltin as hi,parseNodeModulePath as mc,findExports as Gv,parseStaticImport as Vv,resolvePath as Ed,fileURLToPath as Kv,resolveModuleExportNames as Yv,pathToFileURL as Xv}from"mlly";import Zv from"rollup-plugin-license";import Pt from"typescript";import Qv from"clean-css";import{minify as eb}from"html-minifier-next";import{init as Sd,parse as tb}from"cjs-module-lexer";import{parseSync as yo}from"oxc-parser";import rb from"node:crypto";import{cjsInteropPlugin as Od}from"@visulima/packem-rollup/plugin/cjs-interop";import{JsonPlugin as nb}from"@visulima/packem-rollup/plugin/json";import{confirm as ib,isCancel as ob,spinner as sb}from"@clack/prompts";import hc from"node:path/posix";import{readTsConfig as ab,findTsConfig as lb}from"@visulima/tsconfig";import{createDefu as cb}from"defu";import pb from"child_process";import ub from"node:child_process";import{promisify as db,debuglog as fb}from"node:util";import{distance as mb}from"fastest-levenshtein";import{createBrotliCompress as hb,constants as gb,createGzip as vb}from"node:zlib";import{Buffer as bb}from"node:buffer";import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
|
|
2
|
+
const __filename = import.meta.filename; // -- packem CommonJS __filename shim --
|
|
3
|
+
const __dirname = import.meta.dirname; // -- packem CommonJS __dirname shim --
|
|
4
|
+
const require = __cjs_mod__.createRequire(import.meta.url);
|
|
5
|
+
var yb=Object.defineProperty,wt=g((e,t)=>yb(e,"name",{value:t,configurable:!0}),"S$d"),$b=Object.defineProperty,ue=wt((e,t)=>$b(e,"name",{value:t,configurable:!0}),"b");const wb=Ze(import.meta.url),wr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,$o=ue(e=>{if(typeof wr<"u"&&wr.versions&&wr.versions.node){const[t,r]=wr.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return wr.getBuiltinModule(e)}return wb(e)},"__cjs_getBuiltinModule"),{createRequire:xb}=$o("node:module"),Qt=wr,{execFileSync:jb}=$o("node:child_process"),jn=$o("node:fs"),kb=$o("node:tty"),C4={alert:7,critical:6,debug:1,emergency:8,error:5,informational:2,notice:3,trace:2,warning:4},Eb={alert:{color:"red",label:"alert",logLevel:"alert"},await:{color:"blue",label:"awaiting",logLevel:"informational"},complete:{color:"cyan",label:"complete",logLevel:"informational"},critical:{color:"redBright",label:"critical",logLevel:"critical"},debug:{color:"gray",label:"debug",logLevel:"debug"},emergency:{color:"redBright",label:"emergency",logLevel:"emergency"},error:{color:"red",label:"error",logLevel:"error"},info:{color:"blueBright",label:"info",logLevel:"informational"},log:{label:"",logLevel:"informational"},notice:{color:"magentaBright",label:"notice",logLevel:"notice"},pending:{color:"magenta",label:"pending",logLevel:"informational"},start:{color:"greenBright",label:"start",logLevel:"informational"},stop:{color:"red",label:"stop",logLevel:"informational"},success:{color:"green",label:"success",logLevel:"informational"},trace:{color:"cyanBright",label:"trace",logLevel:"trace"},wait:{color:"blue",label:"waiting",logLevel:"informational"},warn:{color:"yellow",label:"warning",logLevel:"warning"},warning:{color:"yellow",label:"warning",logLevel:"warning"},watch:{color:"yellowBright",label:"watching",logLevel:"informational"}},Sb=Symbol("EMPTY");var Ob=Object.defineProperty,Ab=ue((e,t)=>Ob(e,"name",{value:t,configurable:!0}),"g$6");const Pb=Ab(e=>{const t=Object.keys(e).map(r=>e[r].label??"");return t.length===0?"":t.reduce((r,n)=>r.length>n.length?r:n,"")},"getLongestLabel");var Cb=Object.defineProperty,Ad=ue((e,t)=>Cb(e,"name",{value:t,configurable:!0}),"T$5"),Rb=Object.defineProperty,me=Ad((e,t)=>Rb(e,"name",{value:t,configurable:!0}),"l"),Tb=Object.defineProperty,Nb=me((e,t)=>Tb(e,"name",{value:t,configurable:!0}),"L");const it=Nb((e,t,r,n,i,o=", ")=>{const s=e.length;if(s===0)return"";let a=n;i!==void 0&&(a=i);const l=r.truncate;let c="",p="",u="";for(let d=0;d<s;d+=1){const f=d+1===e.length,m=d+2===e.length;u=`…(${String(e.length-d)})`;let h=e[d];r.truncate=l-c.length-(f?0:o.length);const v=p||a(h,t,r,n)+(f?"":o),b=c.length+v.length,w=b+u.length;if(f&&b>l&&c.length+u.length<=l||!f&&!m&&w>l)break;h=e[d+1];const k=m?"":o;if(f?p="":p=a(h,t,r,n)+k,!f&&m&&w>l&&b+p.length>l)break;if(c+=v,!f&&!m&&b+p.length>=l){u=`…(${String(e.length-d-1)})`;break}u=""}return`${c}${u}`},"inspectList");var _b=Object.defineProperty,wo=me((e,t)=>_b(e,"name",{value:t,configurable:!0}),"s$6");const Mb=wo(([e,t],r,n)=>(n.truncate-=3,t?`${n.stylize(String(e),"yellow")}=${n.stylize(`"${t}"`,"string")}`:n.stylize(String(e),"yellow")),"inspectAttribute"),Ib=wo((e,t,r)=>{switch(e.nodeType){case 1:return Pd(e,e,r,t);case 3:return t(e.data,t,r);default:return t(e,t,r)}},"inspectNode"),Sa=wo((e,t,r,n)=>it(e,e,t,r,Ib,`
|
|
6
|
+
`),"inspectNodeCollection"),Pd=wo((e,t,r,n)=>{const i=e.getAttributeNames(),o=e.tagName.toLowerCase(),s=r.stylize(`<${o}`,"special"),a=r.stylize(">","special"),l=r.stylize(`</${o}>`,"special");r.truncate-=o.length*2+5;let c="";i.length>0&&(c+=" ",c+=it(i.map(d=>[d,e.getAttribute(d)]),t,r,n,Mb," ")),r.truncate-=c.length;const{truncate:p}=r;let u=Sa(e.children,r,n,void 0);return u&&u.length>p&&(u=`…(${String(e.children.length)})`),`${s}${c}${a}${u}${l}`},"inspectHTMLElement");var Wb=Object.defineProperty,Bb=me((e,t)=>Wb(e,"name",{value:t,configurable:!0}),"n$4");const Db=Bb((e,t,r)=>e.length===0?"Arguments []":(t.truncate-=13,`Arguments [ ${it(e,e,t,r)} ]`),"inspectArguments");var Fb=Object.defineProperty,Cd=me((e,t)=>Fb(e,"name",{value:t,configurable:!0}),"r$3");const Lb=Cd((e,t)=>{let r;if(e===" ")r=" ";else if(typeof e=="number"&&e>0)r=Array.from({length:e+1}).join(" ");else return;return{base:r,prev:`
|
|
7
|
+
${Array.from({length:t+1}).join(r)}`}},"getIndent"),xo=Cd((e,t)=>{if(e.length===0)return"";const r=t.prev+t.base;return r+e.split(", ").join(`,${r}`)+t.prev},"indentedJoin");var zb=Object.defineProperty,Rd=me((e,t)=>zb(e,"name",{value:t,configurable:!0}),"i$5");const qb=/^[a-z_]\w*$/i,Hb=/^"|"$/g,Jb=Rd((e,t)=>{if(qb.test(e))return e;const r=JSON.stringify(e);return t.quoteStyle==="double"?r.replaceAll('"',String.raw`\"`):r.replaceAll("'",String.raw`\'`).replaceAll(String.raw`\"`,'"').replaceAll(Hb,"'")},"quoteComplexKey"),Wn=Rd(([e,t],r,n,i)=>{n.truncate-=2;let o;typeof e=="string"?o=Jb(e,n):typeof e=="number"?o=String(e):o=`[${i(e,r,n)}]`,n.truncate-=o.length;const s=i(t,r,n);return`${o}: ${s}`},"inspectProperty");var Ub=Object.defineProperty,Td=me((e,t)=>Ub(e,"name",{value:t,configurable:!0}),"p$4");const Gb=Td(e=>{for(const t of e)if(Array.isArray(t)||typeof t=="object"&&t!==null)return!0;return!1},"multiLineValues"),Vb=Td((e,t,r,n)=>{const i=Object.keys(e).slice(e.length);if(e.length===0&&i.length===0)return"[]";t.truncate-=4;let o=it(e,e,t,r);t.truncate-=o.length;let s="";i.length>0&&(s=it(i.map(l=>[l,e[l]]),e,t,r,Wn));const a=n&&Gb(e);return a&&(o=xo(o,n)),`[${a?"":" "}${o}${s?`, ${s}`:""}${a?"":" "}]`},"inspectArray");var Kb=Object.defineProperty,Yb=me((e,t)=>Kb(e,"name",{value:t,configurable:!0}),"o$7");const gc=/\d(?=(?:\d{3})+(?!\d))/g,Xb=/\d{3}/g,Zb=/_$/,Nd=Yb((e,t)=>{if(e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY||t.includes("e"))return t;if(typeof e=="number"){const r=e<0?-Math.floor(-e):Math.floor(e);if(r!==e){const n=String(r),i=t.slice(n.length+1);return`${n.replace(gc,"$&_")}.${i.replace(Xb,"$&_").replace(Zb,"")}`}}return t.replace(gc,"$&_")},"addNumericSeparator");var Qb=Object.defineProperty,_d=me((e,t)=>Qb(e,"name",{value:t,configurable:!0}),"i$4");const ey=_d(e=>e>="\uD800"&&e<="\uDBFF","isHighSurrogate"),zt=_d((e,t,r="…")=>{e=String(e);const n=r.length,i=e.length;if(n>t&&i>n)return r;if(i>t&&i>n){let o=t-n;return o>0&&ey(e[o-1])&&(o-=1),`${e.slice(0,o)}${r}`}return e},"truncate");var ty=Object.defineProperty,ry=me((e,t)=>ty(e,"name",{value:t,configurable:!0}),"e$4");const vc=ry((e,t)=>{let r=zt(e.toString(),t.truncate-1);return r!=="…"&&(r+="n"),t.stylize(t.numericSeparator?Nd(e,r):r,"bigint")},"inspectBigInt");var ny=Object.defineProperty,iy=me((e,t)=>ny(e,"name",{value:t,configurable:!0}),"y");const oy=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:void 0),Ii=iy((e,t,r,n)=>{if("window"in globalThis&&e===globalThis)return"{ [object Window] }";if(e===globalThis||"global"in globalThis&&e===globalThis)return"{ [object globalThis] }";const i=Object.getOwnPropertyNames(e),o=Object.getOwnPropertySymbols(e),s=oy(e)===Object.prototype||e.constructor===Object,a=e instanceof Object?"":"null prototype";let l;!s&&Symbol.toStringTag in e?l=e[Symbol.toStringTag]:l=a?"Object":"";const c=l||a?`[${[l,a].filter(Boolean).join(": ")}] `:"";if(i.length===0&&o.length===0)return`${c}{}`;t.truncate-=4;const p=it(i.map(f=>[f,e[f]]),e,t,r,Wn),u=it(o.map(f=>[f,e[f]]),e,t,r,Wn);let d="";return p&&u&&(d=", "),n?`${c}{${xo(p+d+u,n)}}`:`${c}{ ${p}${d}${u} }`},"inspectObject");var sy=Object.defineProperty,ay=me((e,t)=>sy(e,"name",{value:t,configurable:!0}),"s$3");const ly=ay((e,t,r,n)=>{let i="";return i=i||e.constructor.name,(!i||i==="_class")&&(i="<Anonymous Class>"),t.truncate-=i.length,`${i} ${Ii(e,t,r,n)}`},"inspectClass");var cy=Object.defineProperty,py=me((e,t)=>cy(e,"name",{value:t,configurable:!0}),"i$3");const uy=py((e,t)=>{const r=e.toJSON();if(r===null)return"Invalid Date";const n=r.split("T"),i=n[0];return t.stylize(`${i}T${zt(n[1],t.truncate-i.length-1)}`,"date")},"inspectDate");var dy=Object.defineProperty,fy=me((e,t)=>dy(e,"name",{value:t,configurable:!0}),"c$4");const my=new Set(["column","columnNumber","description","fileName","line","lineNumber","message","name","number","stack"]),hy=fy((e,t,r)=>{const n=Object.getOwnPropertyNames(e).filter(a=>!my.has(a)),{name:i}=e;t.truncate-=i.length;let o="";typeof e.message=="string"?o=zt(e.message,t.truncate):n.unshift("message"),o=o?`: ${o}`:"",t.truncate-=o.length+5;const s=it(n.map(a=>[a,e[a]]),e,t,r,Wn);return`${i}${o}${s?` { ${s} }`:""}`},"inspectObject");var gy=Object.defineProperty,vy=me((e,t)=>gy(e,"name",{value:t,configurable:!0}),"c$3");const bc=vy((e,t)=>{const r=e[Symbol.toStringTag]||"Function",n=e.toString();if(n.length<t.truncate-12)return t.stylize(`[${r}: ${n}]`,"special");const{name:i}=e;return i?t.stylize(`[${r} ${zt(i,t.truncate-11)}]`,"special"):t.stylize(`[${r}]`,"special")},"inspectFunction");var by=Object.defineProperty,Md=me((e,t)=>by(e,"name",{value:t,configurable:!0}),"p$3");const yy=Md(([e,t],r,n,i)=>(n.truncate-=4,e=i(e,r,n),n.truncate-=e.length,`${e} => ${i(t,r,n)}`),"inspectMapEntry"),$y=Md((e,t,r,n)=>{if(e.size<=0)return"Map (0) {}";t.truncate-=7;let i=it([...e.entries()],e,t,r,yy);return n&&(i=xo(i,n)),`Map (${String(e.size)}) {${n?"":" "}${i}${n?"":" "}}`},"inspectMap");var wy=Object.defineProperty,xy=me((e,t)=>wy(e,"name",{value:t,configurable:!0}),"e$3");function ir(e,t){return Number.isNaN(e)?t.stylize("NaN","number"):e===Number.POSITIVE_INFINITY?t.stylize("Infinity","number"):e===Number.NEGATIVE_INFINITY?t.stylize("-Infinity","number"):e===0?t.stylize(1/e===Number.POSITIVE_INFINITY?"+0":"-0","number"):t.stylize(zt(t.numericSeparator?Nd(e,e.toString()):e.toString(),t.truncate),"number")}g(ir,"R$f");wt(ir,"Y");ue(ir,"j$5");Ad(ir,"P");me(ir,"u$3");xy(ir,"inspectNumber");var jy=Object.defineProperty,ky=me((e,t)=>jy(e,"name",{value:t,configurable:!0}),"e$2");const Ey=ky(()=>"Promise{…}","getPromiseValue");var Sy=Object.defineProperty,Oy=me((e,t)=>Sy(e,"name",{value:t,configurable:!0}),"p$1");const Ay=Oy((e,t)=>{const r=t.truncate-(2+e.flags.length);return t.stylize(`/${zt(e.source,r)}/${e.flags}`,"regexp")},"inspectRegExp");var Py=Object.defineProperty,Cy=me((e,t)=>Py(e,"name",{value:t,configurable:!0}),"i$1");const Ry=Cy((e,t,r,n)=>{if(e.size===0)return"Set (0) {}";t.truncate-=7;let i=it([...e],e,t,r);return n&&(i=xo(i,n)),`Set (${String(e.size)}) {${n?"":" "}${i}${n?"":" "}}`},"inspectSet");var Ty=Object.defineProperty,Ny=me((e,t)=>Ty(e,"name",{value:t,configurable:!0}),"l");const _y=Ny((e,t)=>{const r=t.quoteStyle==="double"?'"':"'";return t.quoteStyle==="double"&&(e=e.replaceAll('"','"')),r+e+r},"wrapQuotes");var My=Object.defineProperty,Id=me((e,t)=>My(e,"name",{value:t,configurable:!0}),"e$1");const yc=new RegExp(String.raw`['\0-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5`+String.raw`\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]`,"g"),Iy={" ":String.raw`\t`,"\n":String.raw`\n`,"\f":String.raw`\f`,"\r":String.raw`\r`,"\b":String.raw`\b`,"'":String.raw`\'`,"\\":"\\\\"},Wy=16,By=Id(e=>Iy[e]||String.raw`\u${`0000${e.codePointAt(0).toString(Wy)}`.slice(-4)}`,"escape"),$c=Id((e,t)=>(yc.test(e)&&(e=e.replaceAll(yc,By)),t.stylize(_y(zt(e,t.truncate-2),t),"string")),"inspectString");var Dy=Object.defineProperty,Fy=me((e,t)=>Dy(e,"name",{value:t,configurable:!0}),"o");const wc=Fy(e=>"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString(),"inspectSymbol");var Ly=Object.defineProperty,Wd=me((e,t)=>Ly(e,"name",{value:t,configurable:!0}),"f");const zy=Wd(e=>typeof Buffer=="function"&&e instanceof Buffer?"Buffer":e[Symbol.toStringTag],"getArrayName"),xt=Wd((e,t,r)=>{const n=zy(e);t.truncate-=n.length+4;const i=Object.keys(e).slice(e.length);if(e.length===0&&i.length===0)return`${n}[]`;let o="";for(let a=0;a<e.length;a++){const l=`${t.stylize(zt(e[a],t.truncate),"number")}${a===e.length-1?"":", "}`;if(t.truncate-=l.length,e[a]!==e.length&&t.truncate<=3){o+=`…(${String(e.length-e[a]+1)})`;break}o+=l}let s="";return i.length>0&&(s=it(i.map(a=>[a,e[a]]),e,t,r,Wn)),`${n}[ ${o}${s?`, ${s}`:""} ]`},"inspectTypedArray");var qy=Object.defineProperty,Re=me((e,t)=>qy(e,"name",{value:t,configurable:!0}),"r");const Xi=new WeakMap,Oa={},Hy={Arguments:Db,Array:Vb,ArrayBuffer:Re(()=>"","ArrayBuffer"),BigInt:vc,bigint:vc,Boolean:Re((e,t)=>t.stylize(String(e),"boolean"),"Boolean"),boolean:Re((e,t)=>t.stylize(String(e),"boolean"),"boolean"),DataView:Re(()=>"","DataView"),Date:uy,Error:hy,Float32Array:xt,Float64Array:xt,Function:bc,function:bc,Generator:Re(()=>"","Generator"),HTMLCollection:Sa,Int8Array:xt,Int16Array:xt,Int32Array:xt,Map:$y,NodeList:Sa,null:Re((e,t)=>t.stylize("null","null"),"null"),Number:ir,number:ir,Promise:Ey,RegExp:Ay,Set:Ry,String:$c,string:$c,Symbol:wc,symbol:wc,Uint8Array:xt,Uint8ClampedArray:xt,Uint16Array:xt,Uint32Array:xt,undefined:Re((e,t)=>t.stylize("undefined","undefined"),"undefined"),WeakMap:Re((e,t)=>t.stylize("WeakMap{…}","special"),"WeakMap"),WeakSet:Re((e,t)=>t.stylize("WeakSet{…}","special"),"WeakSet")},xc=Symbol.for("nodejs.util.inspect.custom"),Jy=Re((e,t,r,n)=>{if(!("window"in globalThis)&&typeof e[xc]=="function")return e[xc](n,t);if("inspect"in e&&typeof e.inspect=="function")return e.inspect(n,t);if("constructor"in e&&Xi.has(e.constructor))return Xi.get(e.constructor)?.(e,t)??"unknown";const i=Oa[r];return i?i(e,t):""},"inspectCustom"),Bd=Re((e,t,r,n)=>{if(n.includes(e))return"[Circular]";if(r>=t.depth&&t.depth>0&&typeof e=="object")return Array.isArray(e)?"[Array]":"[Object]";const i=Re((c,p,u)=>(p&&(n=[...n,p]),Bd(c,u,r+1,n)),"inspect"),o=t.indent?Lb(t.indent,r):void 0;let s=e===null?"null":typeof e;s==="object"&&(s=Object.prototype.toString.call(e).slice(8,-1));const a=Hy[s];if(a!==void 0)return a(e,t,i,o);if(t.customInspect&&e){const c=Jy(e,t,s,t.depth-r);if(c)return typeof c=="string"?c:i(c,e,t)}const l=e?Object.getPrototypeOf(e):!1;return l===Object.prototype||l===null?Ii(e,t,i,o):e&&typeof HTMLElement=="function"&&e instanceof HTMLElement?Pd(e,e,t,i):"constructor"in e?e.constructor!==Object?ly(e,t,i,o):Ii(e,t,i,o):e===Object(e)?Ii(e,t,i,o):t.stylize(String(e),s)},"internalInspect"),jc=Re((e,t={})=>{const r={breakLength:Number.POSITIVE_INFINITY,customInspect:!0,depth:5,indent:void 0,maxArrayLength:Number.POSITIVE_INFINITY,numericSeparator:!0,quoteStyle:"single",showHidden:!1,showProxy:!1,stylize:Re(n=>n,"stylize"),truncate:Number.POSITIVE_INFINITY,...t};if(r.indent!==void 0&&r.indent!==" "&&!(Number.parseInt(r.indent,10)===r.indent&&r.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `undefined`');return Bd(e,r,0,[])},"inspect");Re((e,t)=>Xi.has(e)?!1:(Xi.set(e,t),!0),"registerConstructor");Re((e,t)=>e in Oa?!1:(Oa[e]=t,!0),"registerStringTag");var Uy=Object.defineProperty,Gy=ue((e,t)=>Uy(e,"name",{value:t,configurable:!0}),"r$6");const Vy=Gy((e,t)=>(t.__write??t.write.bind(t)).call(t,e),"writeStream");var Ky=Object.defineProperty,Yy=ue((e,t)=>Ky(e,"name",{value:t,configurable:!0}),"A$4"),Xy=Object.defineProperty,rl=Yy((e,t)=>Xy(e,"name",{value:t,configurable:!0}),"$"),Zy=Object.defineProperty,Qy=rl((e,t)=>Zy(e,"name",{value:t,configurable:!0}),"r$1");const e$=Qy(e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
|
|
8
|
+
`),"normalizeLF"),t$=globalThis.process??Object.create(null),kc={versions:{}},Ec=new Proxy(t$,{get(e,t){if(t in e)return e[t];if(t in kc)return kc[t]}});var r$=Object.defineProperty,n$=rl((e,t)=>r$(e,"name",{value:t,configurable:!0}),"b");const i$=n$((e,t,r,n)=>{const i={column:0,line:-1,...e.start},o={...i,...e.end},s=i.line,a=i.column,l=o.line,c=o.column;let p=Math.max(s-(r+1),0),u=Math.min(t.length,l+n);s===-1&&(p=0),l===-1&&(u=t.length);const d=l-s,f={};if(d)for(let m=0;m<=d;m++){const h=m+s;if(!a)f[h]=!0;else if(m===0){const v=t[h-1]?.length;f[h]=[a,(v??0)-a+1]}else if(m===d)f[h]=[0,c];else{const v=t[h-m]?.length;f[h]=[0,v]}}else a===c?f[s]=a?[a,0]:!0:f[s]=[a,(c??0)-(a??0)];return{end:u,markerLines:f,start:p}},"getMarkerLines");var o$=Object.defineProperty,gi=rl((e,t)=>o$(e,"name",{value:t,configurable:!0}),"t");const s$=Ec.platform==="win32"&&!Ec.env?.WT_SESSION?">":"❯",a$=gi((e,t,r)=>{const n={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...r,color:{gutter:gi(m=>m,"gutter"),marker:gi(m=>m,"marker"),message:gi(m=>m,"message"),...r?.color}},i=typeof t.start.column=="number";let o=e$(e).split(`
|
|
9
|
+
`);typeof n.tabWidth=="number"&&(o=o.map(m=>m.replaceAll(" "," ".repeat(n.tabWidth))));const{end:s,markerLines:a,start:l}=i$(t,o,n.linesAbove,n.linesBelow),c=String(s).length,{gutter:p,marker:u,message:d}=n.color;let f=o.slice(l,s).map((m,h)=>{const v=l+1+h,b=a[v],w=` ${String(v)}`.slice(-c),k=!a[v+1],y=` ${w}${n.showGutter?" |":""}`;if(b){let x="";if(Array.isArray(b)){const $=m.replaceAll(/[^\t]/g," ").slice(0,Math.max(b[0]-1,0)),E=b[1]||1;x=[`
|
|
10
|
+
`,n.prefix+p(y.replaceAll(/\d/g," "))," ",$,u("^").repeat(E)].join(""),k&&n.message&&(x+=` ${d(n.message)}`)}return[n.prefix+u(s$),p(y),m.length>0?` ${m}`:"",x].join("")}return`${n.prefix} ${p(y)}${m.length>0?` ${m}`:""}`}).join(`
|
|
11
|
+
`);return n.message&&!i&&(f=`${n.prefix+" ".repeat(c+1)+n.message}
|
|
12
|
+
${f}`),f},"codeFrame");var l$=Object.defineProperty,c$=ue((e,t)=>l$(e,"name",{value:t,configurable:!0}),"x$3"),p$=Object.defineProperty,u$=c$((e,t)=>p$(e,"name",{value:t,configurable:!0}),"x"),d$=Object.defineProperty,St=u$((e,t)=>d$(e,"name",{value:t,configurable:!0}),"u");const or=St((e,...t)=>{process.env.DEBUG&&process.env.DEBUG==="true"&&console.debug(`error:parse-stacktrace: ${e}`,...t)},"debugLog"),sr="<unknown>",f$=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,m$=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,h$=/(.*?):(\d+):(\d+)(?:\s<-\s.+:\d+:\d+)?/,g$=/eval\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*<anonymous>?:(\d+)?:(\d+)/,v$=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,b$=/in\s(.*)\s\(at\s(.+)\)\sat/,y$=/^(?:.*@)?(.*):(\d+):(\d+)$/,$$=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,w$=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,x$=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,Sc=/\(error: (.*)\)/,j$=/at\s/,k$=/^(\S+):(\d+):(\d+)$|^(\S+):(\d+)$/,E$=/^\s+|\s+$/g,S$=/\S*(?:Error: |AggregateError:)/,Dd=/^Anonymous function$/,O$=/^\s*in\s.*/,A$=/^.*?\s*at\s.*/,P$=/^.*?\s*@.*|\[native code\]/,Fd=St((e,t)=>{const r=e.includes("safari-extension"),n=e.includes("safari-web-extension");return r||n?[e.includes("@")?e.split("@")[0]:sr,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},"extractSafariExtensionDetails"),Ld=St((e,t)=>{const r=h$.exec(t);r&&(e.file=r[1],e.line=+r[2],e.column=+r[3])},"parseMapped"),C$=St(e=>{const t=b$.exec(e);if(t){or(`parse nested node error stack line: "${e}"`,`found: ${JSON.stringify(t)}`);const n=t[2].split(":");return{column:n[2]?+n[2]:void 0,file:n[0],line:n[1]?+n[1]:void 0,methodName:t[1]??sr,raw:e,type:void 0}}const r=v$.exec(e);if(r){or(`parse node error stack line: "${e}"`,`found: ${JSON.stringify(r)}`);const n={column:r[4]?+r[4]:void 0,file:r[2]?r[2].replace(j$,""):void 0,line:r[3]?+r[3]:void 0,methodName:r[1]??sr,raw:e,type:e.startsWith("internal")?"internal":void 0};return Ld(n,`${r[2]}:${r[3]}:${r[4]}`),n}},"parseNode"),R$=St(e=>{const t=f$.exec(e);if(t){or(`parse chrome error stack line: "${e}"`,`found: ${JSON.stringify(t)}`);const r=t[2]?.startsWith("native"),n=t[2]?.startsWith("eval")||t[1]?.startsWith("eval");let i,o;if(n){const c=m$.exec(e);if(c){const p=k$.exec(c[1]);p?(t[2]=p[4]??p[1],t[3]=p[5]??p[2],t[4]=p[3]):c[2]&&(t[2]=c[1]),c[2]&&(i={column:c[4]?+c[4]:void 0,file:c[2],line:c[3]?+c[3]:void 0,methodName:"eval",raw:e,type:"eval"})}else{const p=g$.exec(e);p&&(o={column:p[4]?+p[4]:void 0,file:p[2],line:p[3]?+p[3]:void 0},i={column:p[6]?+p[6]:void 0,file:p[1],line:p[5]?+p[5]:void 0,methodName:"eval",raw:p[0],type:"eval"})}}const[s,a]=Fd(t[1]?t[1].replace(Dd,"<anonymous>"):sr,t[2]),l={column:t[4]?+t[4]:void 0,evalOrigin:i,file:a,line:t[3]?+t[3]:void 0,methodName:s,raw:e,type:n?"eval":r?"native":void 0};return o?(l.column=o.column,l.file=o.file,l.line=o.line):Ld(l,`${a}:${t[3]}:${t[4]}`),l}},"parseChromium"),T$=St((e,t)=>{const r=$$.exec(e);if(r){or(`parse gecko error stack line: "${e}"`,`found: ${JSON.stringify(r)}`);const n=r[3]?.includes(" > eval"),i=n&&r[3]&&w$.exec(r[3]);let o;n&&i&&(r[3]=i[1],o={column:r[5]?+r[5]:void 0,file:r[3],line:r[4]?+r[4]:void 0,methodName:"eval",raw:e,type:"eval"},r[4]=i[2]);const[s,a]=Fd(r[1]?r[1].replace(Dd,"<anonymous>"):sr,r[3]);let l;(t?.type==="safari"||!n&&t?.type==="firefox")&&t.column?l=t.column:!n&&r[5]&&(l=+r[5]);let c;return(t?.type==="safari"||!n&&t?.type==="firefox")&&t.line?c=t.line:r[4]&&(c=+r[4]),{column:l,evalOrigin:o,file:a,line:c,methodName:s,raw:e,type:n?"eval":a.includes("[native code]")?"native":void 0}}},"parseGecko"),N$=St((e,t)=>{const r=x$.exec(e);if(!(r&&r[2].includes(" > eval"))&&r)return or(`parse firefox error stack line: "${e}"`,`found: ${JSON.stringify(r)}`),{column:r[4]?+r[4]:t?.column??void 0,file:r[2],line:r[3]?+r[3]:t?.line??void 0,methodName:r[1]||sr,raw:e,type:void 0}},"parseFirefox"),_$=St(e=>{const t=y$.exec(e);if(t)return or(`parse react android native error stack line: "${e}"`,`found: ${JSON.stringify(t)}`),{column:t[3]?+t[3]:void 0,file:t[1],line:t[2]?+t[2]:void 0,methodName:sr,raw:e,type:void 0}},"parseReactAndroidNative"),zd=St((e,{filter:t,frameLimit:r=50}={})=>{const n=e;let i=(typeof n.stacktrace=="string"?n.stacktrace:e.stack??"").split(`
|
|
13
|
+
`).map(o=>(Sc.test(o)?o.replace(Sc,"$1"):o).replaceAll(E$,"")).filter(o=>!S$.test(o)&&o!=="eval code");return t&&(i=i.filter(o=>t(o))),i=i.slice(0,r),i.reduce((o,s,a)=>{if(!s||s.length>1024)return o;let l;if(O$.test(s))l=C$(s);else if(A$.test(s))l=R$(s);else if(P$.test(s)){let c;if(a===0){const p=e,u=p.columnNumber,d=p.lineNumber,f=p.line,m=p.column;u||d?c={column:u,line:d,type:"firefox"}:(f||m)&&(c={column:m,line:f,type:"safari"})}l=N$(s,c)??T$(s,c)}else l=_$(s);return l?o.push(l):or(`parse error stack line: "${s}"`,"not parser found"),o},[])},"parseStacktrace");var M$=Object.defineProperty,I$=ue((e,t)=>M$(e,"name",{value:t,configurable:!0}),"p$6"),W$=Object.defineProperty,qd=I$((e,t)=>W$(e,"name",{value:t,configurable:!0}),"m");const B$=xb(import.meta.url),xr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,nl=qd(e=>{if(typeof xr<"u"&&xr.versions&&xr.versions.node){const[t,r]=xr.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return xr.getBuiltinModule(e)}return B$(e)},"__cjs_getBuiltinModule"),{existsSync:D$,readFileSync:F$}=nl("node:fs"),{relative:L$}=nl("node:path"),{cwd:z$}=xr,{fileURLToPath:q$}=nl("node:url");var H$=Object.defineProperty,je=qd((e,t)=>H$(e,"name",{value:t,configurable:!0}),"o");const Vr=je((e,t,r)=>r===0?e:t===" "?e+" ".repeat(r):e+" ".repeat(t*r),"getPrefix"),J$=je((e,t)=>{const r=e.replace("async file:","file:");return L$(t,r.startsWith("file:")?q$(r):r)},"getRelativePath"),U$=je((e,t,r)=>{if(t)return r.title(e.message);const n=e.message?`: ${e.message}`:"";return r.title(e.name+n)},"getTitleText"),Hd=je((e,{color:t,hideErrorTitle:r,indentation:n,prefix:i},o)=>`${Vr(i,n,o)}${U$(e,r,t)}
|
|
14
|
+
`,"getMessage"),Jd=je((e,{color:t,indentation:r,prefix:n},i)=>{if(e.hint===void 0)return;const o=Vr(n,r,i);let s="";if(Array.isArray(e.hint))for(const a of e.hint)s+=`${o+a}
|
|
15
|
+
`;else s+=o+e.hint;return t.hint(s)},"getHint"),il=je((e,{color:t,cwd:r,displayShortPath:n,indentation:i,prefix:o},s=0)=>{const a=n?J$(e.file,r):e.file,{fileLine:l,method:c}=t;return`${Vr(o,i,s)}at ${e.methodName?`${c(e.methodName)} `:""}${l(a)}:${l(e.line?.toString()??"")}`},"getMainFrame"),Ud=je((e,{color:t,indentation:r,linesAbove:n,linesBelow:i,prefix:o,showGutter:s,showLineNumbers:a,tabWidth:l},c)=>{if(e.file===void 0)return;const p=e.file.replace("file://","");if(!D$(p))return;const u=F$(p,"utf8");return a$(u,{start:{column:e.column,line:e.line}},{color:t,linesAbove:n,linesBelow:i,prefix:Vr(o,r,c),showGutter:s,showLineNumbers:a,tabWidth:l})},"getCode"),Gd=je((e,t,r)=>{if(e.errors.length===0)return;let n=`${Vr(t.prefix,t.indentation,r)}Errors:
|
|
16
|
+
|
|
17
|
+
`,i=!0;for(const o of e.errors)i?i=!1:n+=`
|
|
18
|
+
|
|
19
|
+
`,n+=Kd(o,{...t,framesMaxLimit:1,hideErrorCodeView:t.hideErrorErrorsCodeView},r+1);return`
|
|
20
|
+
${n}`},"getErrors"),Vd=je((e,t,r)=>{let n=`${Vr(t.prefix,t.indentation,r)}Caused by:
|
|
21
|
+
|
|
22
|
+
`;const i=e.cause;n+=Hd(i,t,r);const o=zd(i).shift(),s=Jd(i,t,r);if(s&&(n+=`${s}
|
|
23
|
+
`),o&&(n+=il(o,t,r),!t.hideErrorCauseCodeView)){const a=Ud(o,t,r);a!==void 0&&(n+=`
|
|
24
|
+
${a}`)}if(i.cause)n+=`
|
|
25
|
+
${Vd(i,t,r+1)}`;else if(i instanceof AggregateError){const a=Gd(i,t,r);a!==void 0&&(n+=`
|
|
26
|
+
${a}`)}return`
|
|
27
|
+
${n}`},"getCause"),G$=je((e,t)=>(e.length>0?`
|
|
28
|
+
`:"")+e.map(r=>il(r,t)).join(`
|
|
29
|
+
`),"getStacktrace"),Kd=je((e,t,r)=>{const n={cwd:z$(),displayShortPath:!1,filterStacktrace:void 0,framesMaxLimit:Number.POSITIVE_INFINITY,hideErrorCauseCodeView:!1,hideErrorCodeView:!1,hideErrorErrorsCodeView:!1,hideErrorTitle:!1,hideMessage:!1,indentation:4,linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,showLineNumbers:!0,tabWidth:4,...t,color:{fileLine:je(s=>s,"fileLine"),gutter:je(s=>s,"gutter"),hint:je(s=>s,"hint"),marker:je(s=>s,"marker"),message:je(s=>s,"message"),method:je(s=>s,"method"),title:je(s=>s,"title"),...t.color}},i=zd(e,{filter:t.filterStacktrace,frameLimit:n.framesMaxLimit}),o=i.shift();return[t.hideMessage?void 0:Hd(e,n,r),Jd(e,n,r),o?il(o,n,r):void 0,o&&!n.hideErrorCodeView?Ud(o,n,r):void 0,e instanceof AggregateError?Gd(e,n,r):void 0,e.cause===void 0?void 0:Vd(e,n,r),i.length>0?G$(i,n):void 0].filter(Boolean).join(`
|
|
30
|
+
`).replaceAll("\\","/")},"internalRenderError"),ps=je((e,t={})=>{if(t.framesMaxLimit!==void 0&&t.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return Kd(e,t,0)},"renderError");var V$=Object.defineProperty,ol=ue((e,t)=>V$(e,"name",{value:t,configurable:!0}),"s$3"),K$=Object.defineProperty,jo=ol((e,t)=>K$(e,"name",{value:t,configurable:!0}),"l");const sl=[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],al=[12288,12288,65281,65376,65504,65510],ll=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],cl=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],ko=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var Y$=Object.defineProperty,X$=jo((e,t)=>Y$(e,"name",{value:t,configurable:!0}),"r$1");const Zn=X$((e,t)=>{let r=0,n=Math.floor(e.length/2)-1;for(;r<=n;){const i=Math.floor((r+n)/2),o=i*2;if(t<e[o])n=i-1;else if(t>e[o+1])r=i+1;else return!0}return!1},"isInRange");var Z$=Object.defineProperty,lr=jo((e,t)=>Z$(e,"name",{value:t,configurable:!0}),"r");const Q$=sl[0],e0=sl.at(-1),t0=al[0],r0=al.at(-1),n0=ll[0],i0=ll.at(-1),o0=cl[0],s0=cl.at(-1),a0=ko[0],l0=ko.at(-1),Oc=19968,[c0,p0]=Kr(ko);function Kr(e){let t=e[0],r=e[1];for(let n=0;n<e.length;n+=2){const i=e[n],o=e[n+1];if(Oc>=i&&Oc<=o)return[i,o];o-i>r-t&&(t=i,r=o)}return[t,r]}g(Kr,"X$d");wt(Kr,"ge");ue(Kr,"b$2");ol(Kr,"b");jo(Kr,"N");lr(Kr,"findWideFastPathRange");const Yd=lr(e=>e<Q$||e>e0?!1:Zn(sl,e),"isAmbiguous"),Xd=lr(e=>e<t0||e>r0?!1:Zn(al,e),"isFullWidth"),u0=lr(e=>e<n0||e>i0?!1:Zn(ll,e),"isHalfWidth"),d0=lr(e=>e<o0||e>s0?!1:Zn(cl,e),"isNarrow"),Zd=lr(e=>e>=c0&&e<=p0?!0:e<a0||e>l0?!1:Zn(ko,e),"isWide");function Yr(e){return Yd(e)?"ambiguous":Xd(e)?"fullwidth":u0(e)?"halfwidth":d0(e)?"narrow":Zd(e)?"wide":"neutral"}g(Yr,"ee$b");wt(Yr,"pe");ue(Yr,"v$2");ol(Yr,"q");jo(Yr,"getCategory");lr(Yr,"getCategory");var f0=Object.defineProperty,Eo=ue((e,t)=>f0(e,"name",{value:t,configurable:!0}),"i$3"),m0=Object.defineProperty,So=Eo((e,t)=>m0(e,"name",{value:t,configurable:!0}),"a"),h0=Object.defineProperty,pl=So((e,t)=>h0(e,"name",{value:t,configurable:!0}),"e");function cr(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}g(cr,"V$c");wt(cr,"J");ue(cr,"s$2");Eo(cr,"s");So(cr,"r");pl(cr,"validate");function pr(e){return cr(e),Yr(e)}g(pr,"H$d");wt(pr,"K");ue(pr,"r$5");Eo(pr,"p");So(pr,"eastAsianWidthType");pl(pr,"eastAsianWidthType");function Qn(e,{ambiguousAsWide:t=!1}={}){return cr(e),Xd(e)||Zd(e)||t&&Yd(e)?2:1}g(Qn,"ve$4");wt(Qn,"Fe");ue(Qn,"o$5");Eo(Qn,"W");So(Qn,"eastAsianWidth");pl(Qn,"eastAsianWidth");var g0=Object.defineProperty,v0=ue((e,t)=>g0(e,"name",{value:t,configurable:!0}),"p$3"),b0=Object.defineProperty,Qd=v0((e,t)=>b0(e,"name",{value:t,configurable:!0}),"e"),y0=Object.defineProperty,$0=Qd((e,t)=>y0(e,"name",{value:t,configurable:!0}),"E");const ef=String.raw,Ac=ef`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,w0=$0(()=>new RegExp(ef`\p{RI}{2}|(?)${Ac}(?:\u200D${Ac})*`,"gu"),"default");var x0=Object.defineProperty,j0=Qd((e,t)=>x0(e,"name",{value:t,configurable:!0}),"p");const Xr=new Set(["\x1B",""]),Oo="\x07",tf="[",ul="m",Zi="]8;;",k0=39,E0=/[\u200B\uFEFF\u2060-\u2064]/g,S0=new RegExp(`(?:\\${tf}(?<code>\\d+)m|\\${Zi}(?<uri>.*)${Oo})`),O0=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]])),sn=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,vi=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Wi=w0();j0(e=>e.replace(Wi,""),"stripEmoji");var A0=Object.defineProperty,P0=ue((e,t)=>A0(e,"name",{value:t,configurable:!0}),"E"),C0=Object.defineProperty,R0=P0((e,t)=>C0(e,"name",{value:t,configurable:!0}),"A"),T0=Object.defineProperty,Ao=R0((e,t)=>T0(e,"name",{value:t,configurable:!0}),"d");const Pc=new Map,bi=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,Bi=Ao(e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other","getCharType"),N0=Ao((e,t)=>{const r=Math.floor(e/65536),n=e%65536;let i=Pc.get(r);if(i||(i=new Map,Pc.set(r,i)),i.has(n))return i.get(n);let o;if(Bi(e)==="latin")o=t.width.regular;else if(Bi(e)==="control")o=t.width.control;else if(Bi(e)==="wide")o=t.width.wide;else switch(pr(e)){case"ambiguous":{o=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{o=t.width.fullWidth;break}case"wide":{o=t.width.wide;break}default:o=t.width.regular}return i.set(n,o),o},"getCachedCharWidth"),_0=Ao(e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,"isCombiningCharacter"),Aa=Ao((e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const r={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?Aa(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},n=Math.max(0,r.truncation.limit-r.truncation.ellipsisWidth),{length:i}=e,o=i>1e4;let s=0,a=0,l=i,c=!1;const p=e.includes("\x1B")||e.includes("");for(;s<i;){if(p&&(e[s]==="\x1B"||e[s]==="")){if(e.startsWith("\x1B]8;;",s)){const v="\x1B]8;;\x07",b=v.length,w=e.indexOf("\x07",s+5);if(w!==-1){const k=e.indexOf(v,w+1);if(k!==-1){const y=k+b,x=e.slice(w+1,k).replace(sn,""),$=Aa(x,{ambiguousIsNarrow:r.width.ambiguousIsNarrow,ansiWidth:r.width.ansi,controlWidth:r.width.control,countAnsiEscapeCodes:!1,ellipsis:r.truncation.ellipsis,ellipsisWidth:r.truncation.ellipsisWidth,emojiWidth:r.width.emoji,fullWidth:r.width.fullWidth,halfWidth:r.width.halfWidth,limit:Math.max(0,n-a),regularWidth:r.width.regular,tabWidth:r.width.tab,wideWidth:r.width.wide}),E=$.width;if($.truncated)c=!0,l=Math.min(l,s);else if(a+E>n&&(l=Math.min(l,s),c=!0,a+E>r.truncation.limit))break;if(a+=E,s=y,c&&a>=r.truncation.limit)break;continue}}}if(sn.lastIndex=s,sn.test(e)){const v=sn.lastIndex-s,b=r.truncation.countAnsiEscapeCodes?v:r.width.ansi;if(a+b>n&&(l=Math.min(l,s),a+b>r.truncation.limit)){c=!0;break}a+=b,s=sn.lastIndex;continue}}const f=e.codePointAt(s);if(f===8203||f===65279||f>=8288&&f<=8292){s+=1;continue}if(f===9){if(a+r.width.tab>n&&(l=Math.min(l,s),a+r.width.tab>r.truncation.limit)){c=!0;break}a+=r.width.tab,s+=1;continue}if(bi.lastIndex=s,bi.test(e)){const v=(bi.lastIndex-s)*r.width.regular;if(a+v>n){const b=Math.floor((n-a)/r.width.regular);if(l=Math.min(l,s+b),a+v>r.truncation.limit){c=!0;break}}a+=v,s=bi.lastIndex;continue}if((f<=31||f>=127&&f<=159)&&(vi.lastIndex=s,vi.test(e))){const v=(vi.lastIndex-s)*r.width.control;if(a+v>n&&(l=Math.min(l,s+Math.floor((n-a)/r.width.control)),a+v>r.truncation.limit)){c=!0;break}a+=v,s=vi.lastIndex;continue}if(Wi.lastIndex=s,Wi.test(e)){if(a+r.width.emoji>n&&(l=Math.min(l,s),a+r.width.emoji>r.truncation.limit)){c=!0;break}a+=r.width.emoji,s=Wi.lastIndex;continue}const m=e.codePointAt(s)??0;if(_0(m)){s+=m>65535?2:1;continue}let h;if(o)h=N0(m,r);else switch(Bi(m)){case"control":{h=r.width.control;break}case"latin":{h=r.width.regular;break}case"wide":{h=r.width.wide;break}case"zero":{h=0;break}default:switch(pr(m)){case"ambiguous":{h=r.width.ambiguousIsNarrow?r.width.regular:r.width.wide;break}case"fullwidth":{h=r.width.fullWidth;break}case"wide":{h=r.width.wide;break}default:h=r.width.regular}}if(a+h>n&&(l=Math.min(l,s),a+h>r.truncation.limit)){c=!0;break}a+=h,s+=m>65535?2:1}let u=a,d=!1;return c&&r.truncation.limit>=r.truncation.ellipsisWidth&&(u=r.truncation.limit,d=!0),{ellipsed:d,index:c?l:i,truncated:c,width:u}},"getStringTruncatedWidth");var M0=Object.defineProperty,I0=ue((e,t)=>M0(e,"name",{value:t,configurable:!0}),"i$1"),W0=Object.defineProperty,B0=I0((e,t)=>W0(e,"name",{value:t,configurable:!0}),"e"),D0=Object.defineProperty,F0=B0((e,t)=>D0(e,"name",{value:t,configurable:!0}),"r");const Ke=F0((e,t={})=>Aa(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var L0=Object.defineProperty,rf=ue((e,t)=>L0(e,"name",{value:t,configurable:!0}),"b"),z0=Object.defineProperty,ur=rf((e,t)=>z0(e,"name",{value:t,configurable:!0}),"d"),q0=Object.defineProperty,H0=ur((e,t)=>q0(e,"name",{value:t,configurable:!0}),"a");const J0=/\x1B\[(\d+)m/;let nf=class{static{g(this,"Wt")}static{wt(this,"Pt")}static{ue(this,"T")}static{rf(this,"T")}static{ur(this,"d")}static{H0(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const r=J0.exec(t);if(!r)return;const n=Number.parseInt(r[1],10);switch(n){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(n>=30&&n<=37||n>=90&&n<=97)this.activeForeground=t;else if(n>=40&&n<=47||n>=100&&n<=107)this.activeBackground=t;else if([1,2,3,4,7,8,9].includes(n))this.activeFormatting.push(t);else if([22,23,24,27,28,29].includes(n)){const i={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[n];i&&(this.activeFormatting=this.activeFormatting.filter(o=>!o.includes(i)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const t=[];if(this.activeFormatting.length>0){const r={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].toReversed().forEach(n=>{const i=r[n];i&&t.push(i)})}return this.activeForeground&&t.push("\x1B[39m"),this.activeBackground&&t.push("\x1B[49m"),t.join("")}};var U0=Object.defineProperty,of=ur((e,t)=>U0(e,"name",{value:t,configurable:!0}),"o");const sf=of((e,t)=>{if(!Xr.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const r=!0,n=e.slice(t+1,t+1+Zi.length).join("")===Zi;return{isInsideEscape:r,isInsideLinkEscape:n}},"checkEscapeSequence"),G0=of((e,t={})=>{const r=new nf;let n="",i=!1,o="",s="",a=!1;const l=[...e];for(let c=0;c<l.length;c++){const p=l[c];if(p&&Xr.has(p)){if(n){const h=t.getWidth?.(n)??0,v={isEscapeSequence:!1,isGrapheme:!0,text:n,width:h};if(a&&(v.isHyperlink=!0,v.hyperlinkUrl=s),t.onSegment?.(v,r)===!1)return;n=""}i=!0,o=p;const f=sf(l,c),{isInsideLinkEscape:m}=f;if(m){let h=c+1;for(s="";h<l.length;){const b=l[h];if(b===Oo)break;s+=b,h+=1}s=s.slice(4);const v={hyperlinkUrl:s,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(v,r)===!1)return;c=h,a=!0,i=!1,o="";continue}if(c+1<l.length&&l[c+1]==="\\"&&a){const h={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.(h,r)===!1)return;a=!1,s="",c+=1,i=!1,o="";continue}}if(i){if(o!==p&&(o+=p),p===ul){i=!1,r.processEscape(o);const f={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};if(t.onSegment?.(f,r)===!1)return;o=""}continue}n+=p;const u=t.getWidth?.(n)??0,d={isEscapeSequence:!1,isGrapheme:!0,text:n,width:u};if(a&&(d.isHyperlink=!0,d.hyperlinkUrl=s),t.onSegment?.(d,r)===!1)return;n=""}if(n){const c=t.getWidth?.(n)??0,p={isEscapeSequence:!1,isGrapheme:!0,text:n,width:c};a&&(p.isHyperlink=!0,p.hyperlinkUrl=s),t.onSegment?.(p,r)}if(o){const c={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};t.onSegment?.(c,r)}},"processAnsiString");var V0=Object.defineProperty,K0=ur((e,t)=>V0(e,"name",{value:t,configurable:!0}),"t$1");const Cc=K0(e=>`${Xr.values().next().value}${tf}${String(e)}${ul}`,"wrapAnsiCode");var Y0=Object.defineProperty,X0=ur((e,t)=>Y0(e,"name",{value:t,configurable:!0}),"s");const Rc=X0(e=>`${Xr.values().next().value}${Zi}${e}${Oo}`,"wrapAnsiHyperlink");var Z0=Object.defineProperty,Q0=ur((e,t)=>Z0(e,"name",{value:t,configurable:!0}),"l");const ew=Q0(e=>{if(e.length===0)return"";if(e.length===1)return e[0];let t="",r,n;const i=e.join(`
|
|
31
|
+
`),o=[...i];let s=0;for(const[a,l]of o.entries()){if(t+=l,Xr.has(l)){const p=S0.exec(i.slice(s))?.groups??{};if(p.code!==void 0){const u=Number.parseFloat(p.code);r=u===k0?void 0:u}else p.uri!==void 0&&(n=p.uri.length===0?void 0:p.uri)}const c=O0.get(Number(r));o[a+1]===`
|
|
32
|
+
`?(n&&(t+=Rc("")),r&&c&&(t+=Cc(c))):l===`
|
|
33
|
+
`&&(r&&c&&(t+=Cc(r)),n&&(t+=Rc(n))),s+=l.length}return t},"preserveAnsi");var tw=Object.defineProperty,Dt=ur((e,t)=>tw(e,"name",{value:t,configurable:!0}),"f");const af=/(?=\s)|(?<=\s)/,lf=/^\s+$/,us=Dt(e=>{if(!e.includes("\x1B"))return e;let t=e;return e.includes("\x1B[30m")&&(t+="\x1B[39m"),e.includes("\x1B[42m")&&(t+="\x1B[49m"),t},"resetAnsiAtLineBreak"),er=Dt(e=>{const t=e.split(" ");let r=t.length;for(;r>0&&Ke(t[r-1])===0;)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},"stringVisibleTrimSpacesRight"),cf=Dt((e,t,r)=>{if(e.length===0)return[""];if(t<=0)return[e];const n=[],i=new nf;let o="",s=0,a=!1,l=!1,c="",p=0;for(;p<e.length;){const u=e[p];if(Xr.has(u)){a=!0,c=u,o+=u,l=sf([...e],p).isInsideLinkEscape,p+=1;continue}if(a){c+=u,o+=u,l?u===Oo&&(a=l=!1):u===ul&&(a=!1,i.processEscape(c)),p+=1;continue}const d=Ke(u),f=u===" ";if(d===0){o+=u,p+=1;continue}if(s+d>t&&(o&&n.push(o+i.getEndEscapesForAllActiveAttributes()),o=i.getStartEscapesForAllActiveAttributes(),s=Ke(o),f&&r)){for(;p<e.length&&e[p]===" ";)p+=1;continue}if(o+=u,s+=d,s===t&&p<e.length-1&&(n.push(o+i.getEndEscapesForAllActiveAttributes()),o=i.getStartEscapesForAllActiveAttributes(),s=Ke(o),p+1<e.length&&e[p+1]===" "&&r)){for(p+=1;p<e.length&&e[p]===" ";)p+=1;continue}p+=1}return o&&n.push(o+i.getEndEscapesForAllActiveAttributes()),r?n.map(u=>er(u)):n},"wrapWithBreakAtWidth"),rw=Dt((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=[];let o="",s=0;return G0(n,{getWidth:Ke,onSegment:Dt((a,l)=>{const c=a.text??"";if(a.isEscapeSequence)o+=c;else{const p=c===" ";if(a.width===0)return o+=c,!0;if(s+a.width>t&&(o&&i.push(o),o=l.getStartEscapesForAllActiveAttributes(),s=0,p))return r||i.push(l.getStartEscapesForAllActiveAttributes()+c),!0;o+=c,s+=a.width}return!0},"onSegment")}),o&&i.push(o),r?i.map(a=>er(a)):i},"wrapCharByChar"),nw=Dt((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(af),o=[];let s="",a=0,l=0;for(;l<i.length;){const c=i[l],p=lf.test(c),u=Ke(c);if(c.length===0){l+=1;continue}if(r&&p&&a===0){l+=1;continue}if(a+u>t&&a>0){r?o.push(er(s)):o.push(s),s="",a=0;continue}s+=c,a+=u,l+=1}return s&&(r?o.push(er(s)):o.push(s)),o},"wrapWithWordBoundaries"),iw=Dt((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(af),o=[];let s="",a=0,l=0;for(;l<i.length;){const c=i[l],p=lf.test(c),u=Ke(c);if(c.length===0){l+=1;continue}if(r&&p&&a===0){l+=1;continue}if(u>t){s&&o.push(us(r?er(s):s));const d=cf(c,t,r);if(d.length>0){for(let f=0;f<d.length-1;f+=1)o.push(d[f]);s=d.at(-1),a=Ke(s)}else s="",a=0;l+=1;continue}if(a+u>t&&a>0&&(o.push(us(r?er(s):s)),s="",a=0,r&&p)){l+=1;continue}s+=c,a+=u,l+=1}return s&&o.push(us(r?er(s):s)),o},"wrapAndBreakWords"),kn={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},ow=Dt((e,t={})=>{const{removeZeroWidthCharacters:r=!0,trim:n=!0,width:i=80,wrapMode:o=kn.PRESERVE_WORDS}=t;if(n&&e.trim()==="")return"";let s=e.normalize("NFC").replaceAll(`\r
|
|
34
|
+
`,`
|
|
35
|
+
`);return r&&(s=s.replaceAll(E0,"")),s.split(`
|
|
36
|
+
`).map(a=>{if(n&&a.trim()==="")return"";let l;switch(o){case kn.BREAK_AT_CHARACTERS:{l=rw(a,i,n);break}case kn.BREAK_WORDS:{l=iw(a,i,n);break}case kn.STRICT_WIDTH:{l=cf(a,i,n);break}default:l=nw(a,i,n)}return ew(l)}).join(`
|
|
37
|
+
`)},"wordWrap");var sw=Object.defineProperty,qt=ue((e,t)=>sw(e,"name",{value:t,configurable:!0}),"n$2");const pf=80,uf=24,Pa=qt((e,t,{shell:r,env:n}={})=>jb(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:r,env:n}).trim(),"exec"),Di=qt((e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),"create"),df=qt((e,t)=>{const{columns:r,rows:n}=Di(e,t);if(!(Number.isNaN(r)||Number.isNaN(n))&&!(r===pf&&n===uf))return{columns:r,rows:n}},"createIfNotDefault"),aw=qt(()=>{if(Qt.platform!=="linux")return!0;try{const e=jn.readFileSync("/proc/self/stat","utf8"),t=e.lastIndexOf(") ");if(t===-1)return!1;const r=e.slice(t+2).trim().split(/\s+/),n=Number.parseInt(r[2],10),i=Number.parseInt(r[5],10);return Number.isNaN(n)||Number.isNaN(i)||i<=0?!1:n===i}catch{return!1}},"isForegroundProcess");function Po(){const{env:e,stdout:t,stderr:r}=Qt;if(t?.columns&&t?.rows)return Di(t.columns,t.rows);if(r?.columns&&r?.rows)return Di(r.columns,r.rows);if(e.COLUMNS&&e.LINES)return Di(e.COLUMNS,e.LINES);const n={columns:pf,rows:uf};return Qt.platform==="win32"?ds()??n:Qt.platform==="darwin"?Tc()??ds()??n:Tc()??ds()??lw()??n}g(Po,"_e$4");wt(Po,"ja");ue(Po,"O");qt(Po,"terminalSize");const Tc=qt(()=>{try{const e=Qt.platform==="darwin"?jn.constants.O_EVTONLY|jn.constants.O_NONBLOCK:jn.constants.O_NONBLOCK,{columns:t,rows:r}=kb.WriteStream(jn.openSync("/dev/tty",e));return{columns:t,rows:r}}catch{}},"devTty"),ds=qt(()=>{try{const e=Pa("tput",["cols"],{env:{TERM:"dumb",...Qt.env}}),t=Pa("tput",["lines"],{env:{TERM:"dumb",...Qt.env}});if(e&&t)return df(e,t)}catch{}},"tput"),lw=qt(()=>{try{if(!aw())return;const e=Pa("resize",["-u"]).match(/\d+/g);if(e.length===2)return df(e[0],e[1])}catch{}},"resize");var cw=Object.defineProperty,pw=ue((e,t)=>cw(e,"name",{value:t,configurable:!0}),"r$2");const uw=pw(e=>{const t=Object.keys(e).map(r=>e[r].badge??"");return t.length===0?"":t.reduce((r,n)=>r.length>n.length?r:n,"")},"getLongestBadge");var dw=Object.defineProperty,fw=ue((e,t)=>dw(e,"name",{value:t,configurable:!0}),"r$1");const{bold:mw,cyan:hw,green:Nc,grey:gw,magenta:vw,red:bw,yellow:fs}=uo,yw={indent:2,quoteStyle:"single",stylize:fw((e,t)=>{const r={bigint:fs,boolean:fs,date:vw,null:mw,number:fs,regexp:bw,special:hw,string:Nc,symbol:Nc,undefined:gw};return Object.hasOwn(r,t)?r[t](e):e},"stylize")};var $w=Object.defineProperty,ww=ue((e,t)=>$w(e,"name",{value:t,configurable:!0}),"o$1");const{bold:xw,underline:jw}=uo,kw=ww((e,t)=>{let r=t.uppercase.label?e.toUpperCase():e;return r=t.underline.label?jw(r):r,t.bold.label&&(r=xw(r)),r},"formatLabel");var Ew=Object.defineProperty,ff=ue((e,t)=>Ew(e,"name",{value:t,configurable:!0}),"o");const Sw=ff(e=>[e.getHours(),e.getMinutes(),e.getSeconds()].map(t=>String(t).padStart(2,"0")).join(":"),"dateFormatter");class Ow{static{g(this,"to")}static{wt(this,"ro")}static{ue(this,"AbstractPrettyReporter")}static{ff(this,"AbstractPrettyReporter")}styles;loggerTypes;constructor(t){this.styles={bold:{label:!1},dateFormatter:Sw,underline:{label:!1,message:!1,prefix:!1,suffix:!1},uppercase:{label:!1},...t},this.loggerTypes=Eb}setLoggerTypes(t){this.loggerTypes=t}}var Aw=Object.defineProperty,mf=g((e,t)=>Aw(e,"name",{value:t,configurable:!0}),"x$n"),Pw=Object.defineProperty,hf=mf((e,t)=>Pw(e,"name",{value:t,configurable:!0}),"x");Ze(import.meta.url);const Cw=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{stdout:Rw,stderr:Tw}=Cw;var Nw=Object.defineProperty,gf=hf((e,t)=>Nw(e,"name",{value:t,configurable:!0}),"b");const{bgGrey:_w,bold:_c,cyan:Mw,green:Iw,greenBright:Ww,grey:Ut,red:ms,underline:Mc,white:Bw}=uo,Dw=/[\\/]pail[\\/]dist/,hs=gf(e=>!Dw.test(e),"pailFileFilter");let T4=class extends Ow{static{g(this,"he")}static{mf(this,"ue")}static{hf(this,"SimpleReporter")}static{gf(this,"SimpleReporter")}#e;#i;#t;#o=!1;#r;#n;constructor(t={}){const{error:r,inspect:n,...i}=t;super({uppercase:{label:!0,...i.uppercase},...i}),this.#r={...yw,indent:void 0,...n},this.#n={...r,color:{fileLine:Iw,hint:Mw,marker:ms,message:ms,method:Ww,title:ms}},this.#e=Rw,this.#i=Tw}setStdout(t){this.#e=t}setStderr(t){this.#i=t}setInteractiveManager(t){this.#t=t}setIsInteractive(t){this.#o=t}log(t){const r=this.formatMessage(t),n=t.type.level,i=["error","trace","warn"].includes(n)?"stderr":"stdout",o=i==="stderr"?this.#i:this.#e;this.#o&&this.#t!==void 0&&o.isTTY?this.#t.update(i,r.split(`
|
|
38
|
+
`),0):Vy(`${r}
|
|
39
|
+
`,o)}formatMessage(t){const{columns:r}=Po();let n=r;typeof this.styles.messageLength=="number"&&(n=this.styles.messageLength);const{badge:i,context:o,date:s,error:a,file:l,groups:c,label:p,message:u,prefix:d,repeated:f,scope:m,suffix:h,traceError:v,type:b}=t,{color:w}=this.loggerTypes[b.name],k=w?uo[w]:Bw,y=c.map(()=>" ").join(""),x=[];if(c.length>0&&x.push(`${y+Ut(`[${c.at(-1)??""}]`)} `),s&&x.push(`${Ut(this.styles.dateFormatter(typeof s=="string"?new Date(s):s))} `),i)x.push(_c(k(i)));else{const S=uw(this.loggerTypes);S.length>0&&x.push(Ut(" ".repeat(S.length)))}const $=Pb(this.loggerTypes),E=Ke($);if(p){const S=Ke(p),j=Math.max(0,E-S);x.push(`${_c(k(kw(p,this.styles)))} `," ".repeat(j))}else x.push(" ".repeat(E+1));f&&x.push(`${_w.white(`[${String(f)}x]`)} `),Array.isArray(m)&&m.length>0&&x.push(`${Ut(`[${m.join(" > ")}]`)} `),d&&x.push(`${Ut(`[${this.styles.underline.prefix?Mc(d):d}]`)} `);const O=Ke(x.join(""));if(u!==Sb){const S=typeof u=="string"?u:jc(u,this.#r);x.push(y+ow(S,{trim:!1,width:n-3,wrapMode:kn.STRICT_WIDTH}))}if(o){let S=!1;x.push(...o.map(j=>{if(j instanceof Error)return S=!0,`
|
|
40
|
+
|
|
41
|
+
${ps(j,{...this.#n,filterStacktrace:hs,prefix:y})}`;if(typeof j=="object")return` ${jc(j,this.#r)}`;const A=(S?`
|
|
42
|
+
|
|
43
|
+
`:" ")+String(j);return S=!1,A}))}if(a&&x.push(ps(a,{...this.#n,filterStacktrace:hs,prefix:y})),v&&x.push(`
|
|
44
|
+
|
|
45
|
+
${ps(v,{...this.#n,filterStacktrace:hs,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:y})}`),h&&x.push(` ${y}${Ut(this.styles.underline.suffix?Mc(h):h)}`),l){const S=(l.name??"")+(l.line?`:${String(l.line)}`:""),j=Math.max(0,O-Ke("Caller: "));x.push(`
|
|
46
|
+
`,Ut("Caller: ")," ".repeat(j),S,`
|
|
47
|
+
`)}return x.join("")}};var _4="@visulima/packem",vf="2.0.0-alpha.83";const M4={version:vf};var Fw=Object.defineProperty,bf=g((e,t)=>Fw(e,"name",{value:t,configurable:!0}),"t$e"),Lw=Object.defineProperty,yf=bf((e,t)=>Lw(e,"name",{value:t,configurable:!0}),"o"),zw=Object.defineProperty,qw=yf((e,t)=>zw(e,"name",{value:t,configurable:!0}),"o");let I4=class extends Error{static{g(this,"s")}static{bf(this,"i")}static{yf(this,"n")}static{qw(this,"DirectoryError")}constructor(t){super(`EISDIR: Illegal operation on a directory, ${t}`)}get code(){return"EISDIR"}set code(t){throw new Error("Cannot overwrite code EISDIR")}get name(){return"DirectoryError"}set name(t){throw new Error("Cannot overwrite name of DirectoryError")}};var Hw=Object.defineProperty,$f=g((e,t)=>Hw(e,"name",{value:t,configurable:!0}),"t$d"),Jw=Object.defineProperty,wf=$f((e,t)=>Jw(e,"name",{value:t,configurable:!0}),"t"),Uw=Object.defineProperty,Gw=wf((e,t)=>Uw(e,"name",{value:t,configurable:!0}),"t");let B4=class extends Error{static{g(this,"s")}static{$f(this,"c")}static{wf(this,"n")}static{Gw(this,"NotEmptyError")}constructor(t){super(`ENOTEMPTY: Directory not empty, ${t}`)}get code(){return"ENOTEMPTY"}set code(t){throw new Error("Cannot overwrite code ENOTEMPTY")}get name(){return"NotEmptyError"}set name(t){throw new Error("Cannot overwrite name of NotEmptyError")}};var Vw=Object.defineProperty,xf=g((e,t)=>Vw(e,"name",{value:t,configurable:!0}),"o$h"),Kw=Object.defineProperty,jf=xf((e,t)=>Kw(e,"name",{value:t,configurable:!0}),"o"),Yw=Object.defineProperty,Xw=jf((e,t)=>Yw(e,"name",{value:t,configurable:!0}),"o");let ar=class extends Error{static{g(this,"s")}static{xf(this,"u")}static{jf(this,"n")}static{Xw(this,"NotFoundError")}constructor(t){super(`ENOENT: ${t}`)}get code(){return"ENOENT"}set code(t){throw new Error("Cannot overwrite code ENOENT")}get name(){return"NotFoundError"}set name(t){throw new Error("Cannot overwrite name of NotFoundError")}};var Zw=Object.defineProperty,Qw=g((e,t)=>Zw(e,"name",{value:t,configurable:!0}),"a$m"),ex=Object.defineProperty,tx=Qw((e,t)=>ex(e,"name",{value:t,configurable:!0}),"r"),rx=Object.defineProperty,nx=tx((e,t)=>rx(e,"name",{value:t,configurable:!0}),"n");nx((e,{whitespace:t=!0}={})=>e.replace(Dg,r=>r.startsWith('"')||r[1]==="*"&&!r.endsWith("*/")?r:t?r.replaceAll(/\S/g," "):""),"stripJsonComments");var ix=Object.defineProperty,kf=g((e,t)=>ix(e,"name",{value:t,configurable:!0}),"a$l"),ox=Object.defineProperty,Ef=kf((e,t)=>ox(e,"name",{value:t,configurable:!0}),"o"),sx=Object.defineProperty,ax=Ef((e,t)=>sx(e,"name",{value:t,configurable:!0}),"r");async function ei(e,t,r){const{buffer:n,compression:i,encoding:o="utf8",flag:s,...a}=r??{},l=await Ku(e,{buffer:n,compression:i,encoding:o,flag:s});return typeof t=="function"?Vi(l,t,a):Vi(l,a)}g(ei,"n$k");kf(ei,"g");Ef(ei,"l");ax(ei,"readYaml");var lx=Object.defineProperty,Sf=g((e,t)=>lx(e,"name",{value:t,configurable:!0}),"n$j"),cx=Object.defineProperty,Of=Sf((e,t)=>cx(e,"name",{value:t,configurable:!0}),"o"),px=Object.defineProperty,ux=Of((e,t)=>px(e,"name",{value:t,configurable:!0}),"t");function ti(e,t,r){const{buffer:n,compression:i,encoding:o="utf8",flag:s,...a}=r??{},l=Ga(e,{buffer:n,compression:i,encoding:o,flag:s});return typeof t=="function"?Vi(l,t,a):Vi(l,a)}g(ti,"o$f");Sf(ti,"g");Of(ti,"l");ux(ti,"readYamlSync");var dx=Object.defineProperty,Af=g((e,t)=>dx(e,"name",{value:t,configurable:!0}),"f$m"),fx=Object.defineProperty,Pf=Af((e,t)=>fx(e,"name",{value:t,configurable:!0}),"n"),mx=Object.defineProperty,hx=Pf((e,t)=>mx(e,"name",{value:t,configurable:!0}),"a");async function dl(e,t,r,n){let i,o,s;typeof r=="object"&&r!==null&&!Array.isArray(r)&&typeof r!="function"?(i=r,o=i.replacer,s=i.space):typeof n=="object"?(i=n,o=r,s=i.space):(o=r,s=n);const a=id(t,o,s??i);await Fg(e,a,i)}g(dl,"p$p");Af(dl,"u");Pf(dl,"c");hx(dl,"writeYaml");var gx=Object.defineProperty,Cf=g((e,t)=>gx(e,"name",{value:t,configurable:!0}),"i$g"),vx=Object.defineProperty,Rf=Cf((e,t)=>vx(e,"name",{value:t,configurable:!0}),"t"),bx=Object.defineProperty,yx=Rf((e,t)=>bx(e,"name",{value:t,configurable:!0}),"a");function fl(e,t,r,n){let i,o,s;typeof r=="object"&&r!==null&&!Array.isArray(r)&&typeof r!="function"?(i=r,o=i.replacer,s=i.space):typeof n=="object"?(i=n,o=r,s=i.space):(o=r,s=n);const a=id(t,o,s??i);fo(e,a,i)}g(fl,"n$i");Cf(fl,"b");Rf(fl,"c");yx(fl,"writeYamlSync");var $x=Object.defineProperty,wx=g((e,t)=>$x(e,"name",{value:t,configurable:!0}),"d$t"),xx=Object.defineProperty,jx=wx((e,t)=>xx(e,"name",{value:t,configurable:!0}),"f"),kx=Object.defineProperty,Zr=jx((e,t)=>kx(e,"name",{value:t,configurable:!0}),"c");const Tf=Zr((e,t,r)=>{const n=ne(e),i=ne(t),o=i===n?".":Be(n,i);return r.some(s=>{const a=s.startsWith("./")?s.slice(2):s,l=o.startsWith("./")?o.slice(2):o;if(a==="."&&l===".")return!0;if(a.endsWith("/**")){const c=a.slice(0,-3);return l===c||l.startsWith(`${c}/`)}if(a.endsWith("/*")){const c=a.slice(0,-2);return c===""?l!=="."&&!l.includes("/"):l.startsWith(`${c}/`)||l===c}return l===a||l.startsWith(`${a}/`)})},"isPackageInWorkspace"),Nf=Zr(async e=>{const t=await Wt("pnpm-workspace.yaml",{cwd:ne(e),type:"file"});if(!t)return;const r=await ei(t),n=Array.isArray(r.packages)?r.packages:[];if(!Tf(t,e,n))return;const i={};return r.catalog&&typeof r.catalog=="object"&&(i.catalog=r.catalog),r.catalogs&&typeof r.catalogs=="object"&&(i.catalogs=r.catalogs),Object.keys(i).length>0?i:void 0},"readPnpmCatalogs"),_f=Zr(e=>{const t=Bt("pnpm-workspace.yaml",{cwd:ne(e),type:"file"});if(!t)return;const r=ti(t),n=Array.isArray(r.packages)?r.packages:[];if(!Tf(t,e,n))return;const i={};return r.catalog&&typeof r.catalog=="object"&&(i.catalog=r.catalog),r.catalogs&&typeof r.catalogs=="object"&&(i.catalogs=r.catalogs),Object.keys(i).length>0?i:void 0},"readPnpmCatalogsSync"),Ex=Zr((e,t,r)=>{if(t==="catalog:")return r.catalog?.[e];if(t.startsWith("catalog:")){const n=t.slice(8);return r.catalogs?.[n]?.[e]}},"resolveCatalogReference"),Sx=Zr((e,t)=>{for(const[r,n]of Object.entries(e)){if(typeof n!="string")continue;const i=Ex(r,n,t);i&&(e[r]=i)}},"resolveDependenciesCatalogReferences"),Co=Zr((e,t)=>{const r=["dependencies","devDependencies","peerDependencies","optionalDependencies"];for(const n of r){if(!e[n]||typeof e[n]!="object")continue;const i=e[n];Sx(i,t)}},"resolveCatalogReferences");var Ox=Object.defineProperty,Ne=g((e,t)=>Ox(e,"name",{value:t,configurable:!0}),"l$t"),Ax=Object.defineProperty,ke=Ne((e,t)=>Ax(e,"name",{value:t,configurable:!0}),"f");const Px=Ze(import.meta.url),an=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ml=ke(e=>{if(typeof an<"u"&&an.versions&&an.versions.node){const[t,r]=an.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return an.getBuiltinModule(e)}return Px(e)},"__cjs_getBuiltinModule"),{existsSync:Mf}=ml("node:fs"),{createInterface:Cx}=ml("node:readline"),{styleText:Ge}=ml("node:util");var Rx=Object.defineProperty,Ae=ke((e,t)=>Rx(e,"name",{value:t,configurable:!0}),"f");const bt=Ae(e=>{const t=typeof e;return e!==null&&(t==="object"||t==="function")},"isObject"),Tx=Ae(e=>{if(!bt(e))return!1;for(const t in e)if(Object.hasOwn(e,t))return!1;return!0},"isEmptyObject"),If=new Set(["__proto__","prototype","constructor"]),Wf=1e6,Nx=Ae(e=>e>="0"&&e<="9","isDigit");function dr(e){if(e==="0")return!0;if(/^[1-9]\d*$/.test(e)){const t=Number.parseInt(e,10);return t<=Number.MAX_SAFE_INTEGER&&t<=Wf}return!1}g(dr,"w$i");Ne(dr,"b");ke(dr,"p$1");Ae(dr,"shouldCoerceToNumber");function Rr(e,t){return If.has(e)?!1:(e&&dr(e)?t.push(Number.parseInt(e,10)):t.push(e),!0)}g(Rr,"P$j");Ne(Rr,"P");ke(Rr,"y");Ae(Rr,"processSegment");function Ro(e){if(typeof e!="string")throw new TypeError(`Expected a string, got ${typeof e}`);const t=[];let r="",n="start",i=!1,o=0;for(const s of e){if(o++,i){r+=s,i=!1;continue}if(s==="\\"){if(n==="index")throw new Error(`Invalid character '${s}' in an index at position ${o}`);if(n==="indexEnd")throw new Error(`Invalid character '${s}' after an index at position ${o}`);i=!0,n=n==="start"?"property":n;continue}switch(s){case".":{if(n==="index")throw new Error(`Invalid character '${s}' in an index at position ${o}`);if(n==="indexEnd"){n="property";break}if(!Rr(r,t))return[];r="",n="property";break}case"[":{if(n==="index")throw new Error(`Invalid character '${s}' in an index at position ${o}`);if(n==="indexEnd"){n="index";break}if(n==="property"||n==="start"){if((r||n==="property")&&!Rr(r,t))return[];r=""}n="index";break}case"]":{if(n==="index"){if(r==="")r=(t.pop()||"")+"[]",n="property";else{const a=Number.parseInt(r,10);!Number.isNaN(a)&&Number.isFinite(a)&&a>=0&&a<=Number.MAX_SAFE_INTEGER&&a<=Wf&&r===String(a)?t.push(a):t.push(r),r="",n="indexEnd"}break}if(n==="indexEnd")throw new Error(`Invalid character '${s}' after an index at position ${o}`);r+=s;break}default:{if(n==="index"&&!Nx(s))throw new Error(`Invalid character '${s}' in an index at position ${o}`);if(n==="indexEnd")throw new Error(`Invalid character '${s}' after an index at position ${o}`);n==="start"&&(n="property"),r+=s}}}switch(i&&(r+="\\"),n){case"property":{if(!Rr(r,t))return[];break}case"index":throw new Error("Index was not closed");case"start":{t.push("");break}}return t}g(Ro,"N$h");Ne(Ro,"B");ke(Ro,"parsePath");Ae(Ro,"parsePath");function fr(e){if(typeof e=="string")return Ro(e);if(Array.isArray(e)){const t=[];for(const[r,n]of e.entries()){if(typeof n!="string"&&typeof n!="number")throw new TypeError(`Expected a string or number for path segment at index ${r}, got ${typeof n}`);if(typeof n=="number"&&!Number.isFinite(n))throw new TypeError(`Path segment at index ${r} must be a finite number, got ${n}`);if(If.has(n))return[];typeof n=="string"&&dr(n)?t.push(Number.parseInt(n,10)):t.push(n)}return t}return[]}g(fr,"b$p");Ne(fr,"k");ke(fr,"d");Ae(fr,"normalizePath");function vt(e,t,r){if(!bt(e)||typeof t!="string"&&!Array.isArray(t))return r===void 0?e:r;const n=fr(t);if(n.length===0)return r;for(let i=0;i<n.length;i++){const o=n[i];if(e=e[o],e==null){if(i!==n.length-1)return r;break}}return e===void 0?r:e}g(vt,"d$s");Ne(vt,"h");ke(vt,"getProperty");Ae(vt,"getProperty");function To(e,t,r){if(!bt(e)||typeof t!="string"&&!Array.isArray(t))return e;const n=e,i=fr(t);if(i.length===0)return e;for(let o=0;o<i.length;o++){const s=i[o];if(o===i.length-1)e[s]=r;else if(!bt(e[s])){const a=typeof i[o+1]=="number";e[s]=a?[]:{}}e=e[s]}return n}g(To,"T$i");Ne(To,"M");ke(To,"setProperty");Ae(To,"setProperty");function hl(e,t){if(!bt(e)||typeof t!="string"&&!Array.isArray(t))return!1;const r=fr(t);if(r.length===0)return!1;for(let n=0;n<r.length;n++){const i=r[n];if(n===r.length-1)return Object.hasOwn(e,i)?(delete e[i],!0):!1;if(e=e[i],!bt(e))return!1}}g(hl,"q$f");Ne(hl,"ue");ke(hl,"deleteProperty");Ae(hl,"deleteProperty");function Mt(e,t){if(!bt(e)||typeof t!="string"&&!Array.isArray(t))return!1;const r=fr(t);if(r.length===0)return!1;for(const n of r){if(!bt(e)||!(n in e))return!1;e=e[n]}return!0}g(Mt,"m$p");Ne(Mt,"y");ke(Mt,"hasProperty");Ae(Mt,"hasProperty");function Bn(e){if(typeof e!="string")throw new TypeError(`Expected a string, got ${typeof e}`);return e.replaceAll(/[\\.[]/g,String.raw`\$&`)}g(Bn,"E$f");Ne(Bn,"x");ke(Bn,"escapePath");Ae(Bn,"escapePath");function No(e){const t=Object.entries(e);return Array.isArray(e)?t.map(([r,n])=>[dr(r)?Number.parseInt(r,10):r,n]):t}g(No,"D$i");Ne(No,"R");ke(No,"m$2");Ae(No,"normalizeEntries");function _o(e,t={}){if(!Array.isArray(e))throw new TypeError(`Expected an array, got ${typeof e}`);const{preferDotForIndices:r=!1}=t,n=[];for(const[i,o]of e.entries()){if(typeof o!="string"&&typeof o!="number")throw new TypeError(`Expected a string or number for path segment at index ${i}, got ${typeof o}`);if(typeof o=="number")if(!Number.isInteger(o)||o<0){const s=Bn(String(o));n.push(i===0?s:`.${s}`)}else r&&i>0?n.push(`.${o}`):n.push(`[${o}]`);else if(typeof o=="string")if(o==="")i===0||n.push(".");else if(dr(o)){const s=Number.parseInt(o,10);r&&i>0?n.push(`.${s}`):n.push(`[${s}]`)}else{const s=Bn(o);n.push(i===0?s:`.${s}`)}}return n.join("")}g(_o,"F$e");Ne(_o,"Y");ke(_o,"stringifyPath");Ae(_o,"stringifyPath");function*ri(e,t=[],r=new Set){if(!bt(e)||Tx(e)){t.length>0&&(yield _o(t));return}if(!r.has(e)){r.add(e);for(const[n,i]of No(e))t.push(n),yield*ri(i,t,r),t.pop();r.delete(e)}}g(ri,"j$k");Ne(ri,"S");ke(ri,"x");Ae(ri,"deepKeysIterator");function gl(e){return[...ri(e)]}g(gl,"G$g");Ne(gl,"ge");ke(gl,"deepKeys");Ae(gl,"deepKeys");function vl(e){const t={};if(!bt(e))return t;for(const[r,n]of Object.entries(e))To(t,r,n);return t}g(vl,"K$b");Ne(vl,"de");ke(vl,"unflatten");Ae(vl,"unflatten");var _x=Object.defineProperty,gs=ke((e,t)=>_x(e,"name",{value:t,configurable:!0}),"i");const Mx=gs(async e=>{const{default:t=!1,message:r,transformer:n}=e,i=gs(s=>{const a=Ge(["cyan","bold"],"?"),l=Ge(["bold"],s),c=t?`${Ge(["greenBright"],"Y")}${Ge(["gray"],"/n")}`:`y/${Ge(["yellowBright"],"N")}`;return`${a} ${l} ${Ge(["gray"],`(${c})`)}`},"formatMessage"),o=gs(s=>n?n(s):s?Ge(["greenBright"],"Yes"):Ge(["yellowBright"],"No"),"formatAnswer");return new Promise(s=>{const a=Cx({input:process.stdin,output:process.stdout}),l=i(r);a.question(l,c=>{a.close();const p=c.trim().toLowerCase();if(p===""){s(t);return}if(p==="y"||p==="yes"){console.log(`${Ge(["greenBright"],"✓")} ${o(!0)}`),s(!0);return}if(p==="n"||p==="no"){console.log(`${Ge(["yellowBright"],"✗")} ${o(!1)}`),s(!1);return}console.log(`${Ge(["gray"],"→")} ${o(t)}`),s(t)}),a.on("SIGINT",()=>{a.close(),console.log(`
|
|
48
|
+
${Ge(["gray"],"→")} ${o(t)}`),s(t)})})},"confirm"),Ix=typeof process.stdout<"u"&&!process.versions.deno&&!globalThis.window;var Wx=Object.defineProperty,Se=ke((e,t)=>Wx(e,"name",{value:t,configurable:!0}),"l");const Bf=/, ([^,]*)$/,Qi=new Map,Df=new Map;let Bx=class extends Error{static{g(this,"ke")}static{Ne(this,"be")}static{ke(this,"M")}static{Se(this,"PackageJsonValidationError")}constructor(t){super(`The following warnings were encountered while normalizing package data:
|
|
49
|
+
- ${t.join(`
|
|
50
|
+
- `)}`),this.name="PackageJsonValidationError"}};const Mo=Se((e,t,r=[])=>{const n=[];if(Xg(e,i=>{n.push(i)},t),t&&n.length>0){const i=n.filter(o=>!r.some(s=>s instanceof RegExp?s.test(o):s===o));if(i.length>0)throw new Bx(i)}return e},"normalizeInput"),Dx=Se(async e=>await ei(e),"parseYamlFile"),Fx=Se(e=>ti(e),"parseYamlFileSync"),Lx=Se(async e=>{const t=await Ku(e);return od.parse(t)},"parseJson5File"),zx=Se(e=>{const t=Ga(e);return od.parse(t)},"parseJson5FileSync"),Ff=Se(async(e,t)=>t?.yaml!==!1&&(e.endsWith(".yaml")||e.endsWith(".yml"))?Dx(e):t?.json5!==!1&&e.endsWith(".json5")?Lx(e):mo(e),"parsePackageFile"),Lf=Se((e,t)=>t?.yaml!==!1&&(e.endsWith(".yaml")||e.endsWith(".yml"))?Fx(e):t?.json5!==!1&&e.endsWith(".json5")?zx(e):Va(e),"parsePackageFileSync");Se(async(e,t={})=>{const r={type:"file"};e&&(r.cwd=e);const n=["package.json"];t.yaml!==!1&&n.push("package.yaml","package.yml"),t.json5!==!1&&n.push("package.json5");let i;for(const l of n)if(i=await Wt(l,r),i)break;if(!i)throw new ar(`No such file or directory, for ${n.join(", ").replace(Bf," or $1")} found.`);const o=t.cache&&typeof t.cache!="boolean"?t.cache:Df;if(t.cache&&o.has(i))return o.get(i);const s=await Ff(i,t);if(t.resolveCatalogs){const l=await Nf(i);l&&Co(s,l)}Mo(s,t.strict??!1,t.ignoreWarnings);const a={packageJson:s,path:i};return t.cache&&o.set(i,a),a},"findPackageJson");Se((e,t={})=>{const r={type:"file"};e&&(r.cwd=e);const n=["package.json"];t.yaml!==!1&&n.push("package.yaml","package.yml"),t.json5!==!1&&n.push("package.json5");let i;for(const l of n)if(i=Bt(l,r),i)break;if(!i)throw new ar(`No such file or directory, for ${n.join(", ").replace(Bf," or $1")} found.`);const o=t.cache&&typeof t.cache!="boolean"?t.cache:Df;if(t.cache&&o.has(i))return o.get(i);const s=Lf(i,t);if(t.resolveCatalogs){const l=_f(i);l&&Co(s,l)}Mo(s,t.strict??!1,t.ignoreWarnings);const a={packageJson:s,path:i};return t.cache&&o.set(i,a),a},"findPackageJsonSync");Se(async(e,t={})=>{const{cwd:r,...n}=t,i=Mn(r??process.cwd());await Yu(G(i,"package.json"),e,n)},"writePackageJson");Se((e,t={})=>{const{cwd:r,...n}=t,i=Mn(r??process.cwd());Lg(G(i,"package.json"),e,n)},"writePackageJsonSync");const bl=Se((e,t)=>{const r=typeof e=="object"&&!Array.isArray(e);if(!r&&typeof e!="string")throw new TypeError("`packageFile` should be either an `object` or a `string`.");let n,i=!1,o;if(r)n=structuredClone(e);else if(Mf(e)){o=e;const a=t?.cache&&typeof t.cache!="boolean"?t.cache:Qi;if(t?.cache&&a.has(o))return a.get(o);n=Lf(o,t),i=!0}else n=Xu(e);if(t?.resolveCatalogs)if(i){const a=_f(e);a&&Co(n,a)}else throw new Error("The 'resolveCatalogs' option can only be used on a file path.");Mo(n,t?.strict??!1,t?.ignoreWarnings);const s=n;return i&&t?.cache&&(typeof t.cache=="boolean"?Qi:t.cache).set(o,s),s},"parsePackageJsonSync"),z4=Se(async(e,t)=>{const r=typeof e=="object"&&!Array.isArray(e);if(!r&&typeof e!="string")throw new TypeError("`packageFile` should be either an `object` or a `string`.");let n,i=!1,o;if(r)n=structuredClone(e);else if(Mf(e)){o=e;const a=t?.cache&&typeof t.cache!="boolean"?t.cache:Qi;if(t?.cache&&a.has(o))return a.get(o);n=await Ff(o,t),i=!0}else n=Xu(e);if(t?.resolveCatalogs)if(i){const a=await Nf(e);a&&Co(n,a)}else throw new Error("The 'resolveCatalogs' option can only be used on a file path.");Mo(n,t?.strict??!1,t?.ignoreWarnings);const s=n;return i&&t?.cache&&(typeof t.cache=="boolean"?Qi:t.cache).set(o,s),s},"parsePackageJson");Se((e,t,r)=>vt(e,t,r),"getPackageJsonProperty");Se((e,t)=>Mt(e,t),"hasPackageJsonProperty");const zf=Se((e,t,r)=>{const n=vt(e,"dependencies",{}),i=vt(e,"devDependencies",{}),o=vt(e,"peerDependencies",{}),s={...n,...i,...r?.peerDeps===!1?{}:o};for(const a of t)if(Mt(s,a))return!0;return!1},"hasPackageJsonAnyDependency"),qx=Se(async(e,t,r="dependencies",n={})=>{const i=vt(e,"dependencies",{}),o=vt(e,"devDependencies",{}),s=vt(e,"peerDependencies",{}),a=[],l={deps:!0,devDeps:!0,peerDeps:!1,...n};for(const c of t)l.deps&&Mt(i,c)||l.devDeps&&Mt(o,c)||l.peerDeps&&Mt(s,c)||a.push(c);if(a.length!==0){if(process.env.CI||Ix&&!process.stdout.isTTY){const c=`Skipping package installation for [${t.join(", ")}] because the process is not interactive.`;if(n.throwOnWarn)throw new Error(c);n.logger?.warn?n.logger.warn(c):console.warn(c);return}if(typeof l.confirm?.message=="function"&&(l.confirm.message=l.confirm.message(a)),l.confirm?.message===void 0){const c=`${a.length===1?"Package is":"Packages are"} required for this config: ${a.join(", ")}. Do you want to install them?`;l.confirm===void 0?l.confirm={message:c}:l.confirm.message=c}await Mx(l.confirm)&&await nd(a,{...l.installPackage,cwd:l.cwd?Mn(l.cwd):void 0,dev:r==="devDependencies"})}},"ensurePackages");var Hx=Object.defineProperty,qf=g((e,t)=>Hx(e,"name",{value:t,configurable:!0}),"o$e");const yl=["packem.config.js","packem.config.mjs","packem.config.cjs","packem.config.ts","packem.config.cts","packem.config.mts"],Jx=/\.(?:js|mjs|cjs|ts|cts|mts)$/,q4=qf(async(e,t="")=>{let r=t;if(!r){for(const n of yl)if(await Gr(G(e,n))){r=`./${n}`;break}}if(!Jx.test(r))throw new Error("Invalid packem config file extension. Only .js, .mjs, .cjs, .ts, .cts and .mts extensions are allowed.");return r},"findPackemFile"),H4=qf(async e=>{for(const t of yl)if(await Gr(G(e,t)))return!0;return!1},"hasPackemConfig");var Ux=Object.defineProperty,Gx=g((e,t)=>Ux(e,"name",{value:t,configurable:!0}),"e$6");const Vx={esbuild:"esbuild",oxc:"oxc-transform",sucrase:"sucrase",swc:"@swc/core"},Ic=Gx(async(e,t)=>{const r=Array.isArray(e)?e:[e],n=await Yg(t).catch(()=>{});let i;return n==="yarn"||n==="bun"?i=`${n} add -D`:n==="pnpm"?i="pnpm add -D":i="npm install -D",`${i} ${r.join(" ")}`},"buildInstallHint");var Kx=Object.defineProperty,Hf=g((e,t)=>Kx(e,"name",{value:t,configurable:!0}),"s$n");const eo=Hf(e=>{if(e.endsWith(".mjs")||e.endsWith(".d.mts"))return"esm";if(e.endsWith(".cjs")||e.endsWith(".d.cts"))return"cjs"},"inferExportTypeFromFileName"),Ca=Hf((e,t,r,n)=>{if(e==="module-sync")return"esm";if(n){const s=eo(n);if(s)return s}if(e==="module"||e==="import")return"esm";if(e==="require")return"cjs";if(t.length===0)return r;const[i,...o]=t;return Ca(i,o,r,n)},"inferExportType");var Yx=Object.defineProperty,Xx=g((e,t)=>Yx(e,"name",{value:t,configurable:!0}),"x$m");const Zx=new Set(["browser","bun","default","deno","electron","import","module-sync","node","node-addons","require","types","workerd",...md,...hd]),$l=Xx((e,t,r,n,i)=>{if(!e)return[];if(typeof e=="string"){const o=eo(e);if(o&&o!==t)throw new Error(`Exported file "${e}" has an extension that does not match the package.json type "${t==="esm"?"module":"commonjs"}".`);return[{file:e,key:"exports",type:o??t}]}if(typeof e=="object"){const o=Object.entries(e).filter(([a])=>!a.endsWith(".json"));let s=[];for(const[a,l]of o){const c=a.replace("./",""),p=i.some(u=>c===u||c.startsWith(`${u}/`));if(typeof l=="string"){let u;Number.isInteger(+a)?u={exportKey:"*"}:a.startsWith("./")?u={exportKey:a.replace("./","")}:u={exportKey:a==="."?".":"*",subKey:a},s.push({...u,file:l,key:"exports",type:Ca(a,n,t,l),...p&&{ignored:!0}})}else if(typeof l=="object"&&l!==null)for(const[u,d]of Object.entries(l)){if(r===!1&&u==="types")continue;const f=Number.isInteger(+a)?u:a;if(typeof d=="string")s.push({exportKey:f.replace("./",""),file:d,key:"exports",...Zx.has(u)?{subKey:u}:{},type:Ca(u,n,t,d),...p&&{ignored:!0}});else{const m=f.replace("./",""),h=p||i.some(b=>m===b||m.startsWith(`${b}/`)),v=$l({[f]:d},t,r,[...n,u],i);h&&v.forEach(b=>{b.ignored=!0}),s=[...s,...v]}}}return s}return[]},"extractExportFilenames");var Qx=Object.defineProperty,qe=g((e,t)=>Qx(e,"name",{value:t,configurable:!0}),"v$r");const Ra=new Map,Lr=/\.[^./]+$/,He=/\.d\.[mc]?ts$/,Ta=/\.d\.mts$/,Na=/\.d\.cts$/,Wc=/\.d\.[mc]ts$/,e1=/^\.\/dist\//,_a=/^dist\//,t1=/^\//,En=/^\.\//,r1=/\/$/,Bc=/\.\w+$/,Dc=/\*.*$/,n1=/\.(?:tsx?|cts|mts)$/,i1=/\.[cm]?tsx?$/,o1=/^(.+?)\.[^.]*$/,s1=/(?:\*[^/\\]|\.d\.[mc]?ts|\.\w+)$/,Le=qe(e=>e===void 0||e==="node16","allowsCompatibleDeclarationUpgrade"),Jf=qe((e,t)=>{const r=He.exec(e);if(r!==null)return r[0];if(t)for(const n of Object.values(t)){const i=n.startsWith(".")?n:`.${n}`;if(e.endsWith(i))return i}return Fr(e)},"getFullExtension"),a1=qe(async e=>{try{return await $d.readdir(e,{withFileTypes:!0})}catch(t){const{code:r}=t;if(r==="ENOENT")return[];throw t}},"safeReaddir"),Uf=qe(async(e,t)=>{const r=await a1(e);return(await Promise.all(r.map(async n=>{const i=hc.join(e,n.name);return n.isDirectory()?Uf(i,t):n.isFile()?hc.relative(t,i):[]}))).flat()},"getDirectoryFilesRecursive"),l1=qe(async e=>{let t=Ra.get(e);return t||(t=Uf(e,e),Ra.set(e,t)),t},"getDirectoryFiles"),Fc=qe((e,t,r)=>{const n=e.replace(Lr,"");if(t==="*"){const s=n.split("/").filter(Boolean);return s.length===0?void 0:r&&r>1?s:[s[0]]}const i=t.replaceAll(/[.+?^${}()|[\]\\]/g,String.raw`\$&`).replaceAll("*","(.*)"),o=new RegExp(`^${i}$`).exec(n);return o?o.slice(1):void 0},"matchWildcardPattern"),Gt=qe((e,t)=>{let r=e;for(const n of t)r=r.replace("*",n);return r},"substituteWildcards"),c1=qe(e=>e.endsWith(".d.mts")?"d.mts":e.endsWith(".d.cts")?"d.cts":"d.ts","resolveDeclarationExtension"),p1=qe((e,t)=>e.key==="exports"&&e.subKey===Rn?Rn:e.key==="exports"&&e.subKey===dc?dc:t,"getEnvironment"),u1=qe(e=>{const t=e.replace(e1,"").replace(_a,"").replace(Lr,"").split("/"),r=t.at(-1)??"",n=[".browser",".server",".development",".production",".node",".workerd"];for(const o of n)if(r.includes(o)){const s=r.replace(o,""),a=t.length>1?t.slice(0,-1).join("/"):"";return{baseName:a?`${a}/${s}`:s,pattern:o}}const i=r.split(".");if(i.length>2){const o=i.slice(0,-2).join("."),s=`.${i[i.length-2]}`,a=t.length>1?t.slice(0,-1).join("/"):"";return{baseName:a?`${a}/${o}`:o,pattern:s}}},"detectFilePattern"),d1=qe((e,t,r,n)=>{const i=`${t.replace(new RegExp(`^${n}/?`),"")}${r}`,o=i.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`),s=new RegExp(String.raw`${o}\.([cm]?[tj]sx?|ts|js)$`),a=e.find(c=>{const p=c.replace(n,"").replace(t1,"");return s.test(p)});if(a)return a;const l=`${n}/${i}`;return e.find(c=>{const p=c.replace(Lr,"");return p===l||p.endsWith(`/${i}`)})??void 0},"tryFindPatternFile"),Ct=qe((e,t,r,n,i,o,s,a)=>{const l=p1(i,o.environment);let{runtime:c}=o.options;const p=i.subKey==="browser"||typeof i.subKey=="string"&&i.subKey.includes("browser"),u=i.file.includes(".browser");if(p||u)c="browser";else{for(const y of md)if(i.file.includes(`.${y}.`)||i.subKey===y){c=y;break}(i.subKey==="node"||i.subKey==="workerd"||i.file.includes(".node")||i.file.includes(".workerd")||i.file.includes(".server"))&&(c="node")}const d=Jf(i.file,o.options.outputExtensionMap),f=i.file.replace(d,""),m=o.options.outDir.replace(En,""),h=f.replace(new RegExp(`^(./)?${m}/`),""),v=t.replace(Lr,"").split("/").pop()??"",b=h.split("/").pop()??"",w=!t.includes(h)&&v!==b;let k=e.find(y=>y.input===t&&y.environment===l&&y.runtime===c&&y.fileAlias===(w?h:void 0));if(k===void 0?k=e[e.push({environment:l,exportKey:new Set([i.exportKey].filter(Boolean)),fileAlias:w?h:void 0,input:t,runtime:c})-1]:k.exportKey&&i.exportKey&&k.exportKey.add(i.exportKey),s&&(k.isGlob=!0),r&&(k.outDir=n),i.isExecutable)k.executable=!0,k.declaration=!1,i.type==="cjs"?k.cjs=!0:i.type==="esm"&&(k.esm=!0);else{const y=He.test(i.file),x=a.filter(E=>E.exportKey===i.exportKey),$=x.length>0&&x.every(E=>He.test(E.file));if(y&&o.options.declaration!==!1){k.declaration=o.options.declaration;const E=c1(i.file);k.declarationExtensions??=new Set,k.declarationExtensions.add(E)}if(y||$){$&&o.options.declaration!==!1&&(k.declaration=o.options.declaration);const E=x.some(S=>Ta.test(S.file)),O=x.some(S=>Na.test(S.file));if(E&&O?(Le(o.options.declaration)&&(o.options.declaration="compatible"),o.options.emitCJS=!0,o.options.emitESM=!0):O?(o.options.emitCJS=!0,Le(o.options.declaration)&&(o.options.declaration="compatible")):E&&(o.options.emitESM=!0,Le(o.options.declaration)&&(o.options.declaration="compatible")),$){const S=a.filter(N=>He.test(N.file)),j=S.some(N=>Ta.test(N.file)),A=S.some(N=>Na.test(N.file));x.every(N=>!N.subKey||N.subKey==="types")?(A&&(k.cjs=!0),j&&(k.esm=!0)):(A&&(k.declarationCjs=!0),j&&(k.declarationEsm=!0))}}else i.type==="cjs"?k.cjs=!0:i.type==="esm"&&(k.esm=!0)}w&&!k.fileAlias&&(k.fileAlias=h)},"createOrUpdateEntry");let Lc=!1;const zc=qe(e=>{if(e.pkg.dependencies?.typescript===void 0&&e.pkg.devDependencies?.typescript===void 0)throw new Error("You tried to use a `.ts`, `.cts` or `.mts` file but `typescript` was not found in your package.json.")},"validateIfTypescriptIsInstalled"),f1=qe(async(e,t,r)=>{const n=e.types||e.typings;Ra.clear();const i=[];t.sort((f,m)=>f.split("/").length-m.split("/").length);const o=e.type==="module"?"esm":"cjs",s=r.options.declaration??"node16",a=$l(e.exports,o,s,[],r.options.ignoreExportKeys??[]).filter(f=>!f.ignored),l=new Set;for(const f of a){const m=a.filter(h=>h.exportKey===f.exportKey);if(m.length>0&&m.every(h=>He.test(h.file))&&!l.has(f.exportKey)){l.add(f.exportKey);const h=m.some(b=>b.file.endsWith(".d.mts")),v=m.some(b=>b.file.endsWith(".d.cts"));h&&v?(Le(r.options.declaration)&&(r.options.declaration="compatible"),r.options.emitCJS=!0,r.options.emitESM=!0):v?(Le(r.options.declaration)&&(r.options.declaration="compatible"),r.options.emitCJS=!0):h&&(Le(r.options.declaration)&&(r.options.declaration="compatible"),r.options.emitESM=!0)}}r.options.declaration??="node16";const c=a.some(f=>f.type==="esm"&&!Ta.test(f.file)),p=a.some(f=>f.type==="cjs"&&!Na.test(f.file));c&&p?(r.options.emitESM=!0,r.options.emitCJS=!0):c?r.options.emitESM=!0:p?r.options.emitCJS=!0:o==="esm"?r.options.emitESM=!0:r.options.emitCJS=!0;const u=r.options.emitCJS&&r.options.emitESM;if(r.options.declaration==="node16"&&u&&(r.options.declaration="compatible"),e.bin){const f=(typeof e.bin=="string"?[e.bin]:Object.values(e.bin)).filter(Boolean);for(const m of f){const h=eo(m);if(h&&h!==o)throw new Error(`Exported file "${m}" has an extension that does not match the package.json type "${e.type??"commonjs"}".`);a.push({file:m,isExecutable:!0,key:"bin",type:h??o})}}e.main&&a.push({file:e.main,key:"main",type:eo(e.main)??o}),e.module&&a.push({file:e.module,key:"module",type:"esm"}),n&&(zc(r),Le(r.options.declaration)&&u&&(r.options.declaration="compatible"),a.push({file:n,key:"types"}));const d=[];if(!r.options.outputExtensionMap){const f=a.some(v=>!v.isExecutable&&!He.test(v.file)&&v.file.endsWith(".mjs")),m=a.some(v=>!v.isExecutable&&!He.test(v.file)&&v.file.endsWith(".cjs")),h=a.some(v=>!v.isExecutable&&!He.test(v.file)&&v.file.endsWith(".js"));f&&!m&&!h?r.options.outputExtensionMap={esm:"mjs"}:m&&!f&&!h&&(r.options.outputExtensionMap={cjs:"cjs"})}for(const f of a){const m=He.test(f.file),h=Jf(f.file,r.options.outputExtensionMap),v=[...go];if(r.options.outputExtensionMap)for(const j of Object.values(r.options.outputExtensionMap)){const A=j.startsWith(".")?j:`.${j}`;v.includes(A)||v.push(A)}if(!m&&h!==""&&!v.includes(h)||!m&&n1.test(f.file))continue;let b=f.type;if(!b&&m){if(f.file.endsWith(".d.mts"))b="esm";else if(f.file.endsWith(".d.cts"))b="cjs";else if(f.file.endsWith(".d.ts")){const j=a.some(N=>N.subKey==="import"&&N.file.endsWith(".d.mts")),A=a.some(N=>N.subKey==="require"&&N.file.endsWith(".d.cts"));j&&A?b=void 0:b=r.pkg.type==="module"?"esm":"cjs"}}if(He.test(f.file)||(r.options.emitCJS===void 0&&(b==="cjs"||f.type==="cjs")&&(r.options.emitCJS=!0),r.options.emitESM===void 0&&(b==="esm"||f.type==="esm")&&(r.options.emitESM=!0)),Le(r.options.declaration)){const j=r.options.emitCJS&&r.options.emitESM;r.options.declaration=j?"compatible":"node16"}let w=f.file;if(r.options.outputExtensionMap)for(const j of Object.values(r.options.outputExtensionMap)){const A=j.startsWith(".")?j:`.${j}`;if(f.file.endsWith(A)){w=f.file.slice(0,-A.length);break}}w===f.file&&(w=f.file.replace(s1,""));const k=w.endsWith("/");if(k&&["./","/"].includes(w))continue;const y=w.replace(new RegExp(`(./)?${r.options.outDir}`),r.options.sourceDir).replace("./",""),x=k?"":String.raw`(\.d\.[cm]?ts|(\.[cm]?[tj]sx?))$`,$="(?:^|/)";if((f.file.includes("/*")||w.includes("*"))&&f.key==="exports"){Lc||(r.logger.debug("Private subfolders are not supported, if you need this feature please open an issue on GitHub."),Lc=!0);let j;f.exportKey?j=f.exportKey.startsWith("./")?f.exportKey.slice(2):f.exportKey:j=(f.file.startsWith("./")?f.file.slice(2):f.file).replace(_a,"");const A=f.file,N=Bc.exec(A);if(A.includes("*")&&!N&&f.exportKey&&!f.subKey){const B=A.replace(Dc,"").replace(En,""),I=j.replace(Dc,"").replace(En,"");if(B!==I){const _=`package.json#exports["${f.exportKey==="."?".":`./${f.exportKey}`}"]`;i.push(`Wildcard pattern must include a file extension: ${A} at ${_}`);continue}}const q=r.options.sourceDir.replace(En,""),J=re(r.options.rootDir,q),U=[],ee=await l1(J),X=A.split("*").length-1,W=j.split("*").length-1;for(const B of ee){const I=Fc(B,j,X);if(I){if(X>W&&X>1){if(I.length>=X){const H=I[0];if(I.every(z=>z===H)){const z=Gt(A,I.slice(0,X));z.includes("*")||U.push({input:re(J,B),output:z})}continue}const M=B.replace(Lr,"").split("/").filter(Boolean);if(M.length>=X){const H=Math.floor(M.length/X),z=[];for(let Y=0;Y<X;Y+=1){const Z=Y*H,V=Y===X-1?M.length:(Y+1)*H;z.push(M.slice(Z,V).join("/"))}const F=z[0];if(z.every(Y=>Y===F)){const Y=Gt(A,z);Y.includes("*")||U.push({input:re(J,B),output:Y})}}else if(M.length>0){const H=M[0];if(M.every(z=>z===H)){const z=Array.from({length:X}).fill(H),F=Gt(A,z);F.includes("*")||U.push({input:re(J,B),output:F})}}continue}if(I.length<X)continue;if(W>0&&W<X&&X>1&&I.length>1){const M=I[0];if(!I.every(H=>H===M))continue}const _=Gt(A,I);if(_.includes("*"))continue;U.push({input:re(J,B),output:_})}}if(U.length===0&&A.includes("*")){let B=(f.file.startsWith("./")?f.file.slice(2):f.file).replace(_a,"");B=B.replace(Bc,"");for(const I of ee){const _=Fc(I,B,X);if(_){if(X>1&&W<X){if(_.length>=X){const z=_[0];if(_.every(F=>F===z)){const F=Gt(A,_);F.includes("*")||U.push({input:re(J,I),output:F});continue}}const M=I.replace(Lr,""),H=B.split("*");if(H.length>=2){const z=H.map(Z=>Z.replaceAll(/[.+?^${}()|[\]\\]/g,String.raw`\$&`));let F=`${z[0]}(.+)`;for(let Z=1;Z<z.length;Z+=1)F+=z[Z],Z<z.length-1&&(F+=String.raw`\1`);const Y=new RegExp(`^${F}$`).exec(M);if(Y){const Z=Y[1],V=Gt(A,Array.from({length:X}).fill(Z));V.includes("*")||U.push({input:re(J,I),output:V})}}continue}if(_.length>=X){if(W>0&&W<X&&X>1&&_.length>1){const H=_[0];if(!_.every(z=>z===H))continue}const M=Gt(A,_);M.includes("*")||U.push({input:re(J,I),output:M})}}}}if(U.length===0){a.length>1||i.push(`Could not find entrypoints matching pattern \`${j}\` for output \`${A}\``);continue}const R=a.filter(B=>B.exportKey===f.exportKey);if(R.length>0&&R.every(B=>He.test(B.file))){const B=R.some(z=>z.file.endsWith(".d.ts")),I=R.some(z=>z.file.endsWith(".d.mts")),_=R.some(z=>z.file.endsWith(".d.cts"));I&&_?(Le(r.options.declaration)&&(r.options.declaration="compatible"),r.options.emitCJS=!0,r.options.emitESM=!0):_?(Le(r.options.declaration)&&(r.options.declaration="compatible"),r.options.emitCJS=!0):I&&(Le(r.options.declaration)&&(r.options.declaration="compatible"),r.options.emitESM=!0);const M=R.find(z=>z.file.endsWith(".d.ts")),H=M??R.find(z=>z.file.endsWith(".d.mts"))??R.find(z=>z.file.endsWith(".d.cts"))??f;if(!(H===f||M!==void 0&&f===M||M===void 0&&H===f))continue;for(const{input:z,output:F}of U){let Y=F;if(F.endsWith(".d.mts")||F.endsWith(".d.cts"))Y=F.replace(Wc,".d.ts");else if(!F.endsWith(".d.ts")){const V=F.replace(Wc,".d.ts");B&&(Y=V)}const Z={...H,file:Y,subKey:"types",type:void 0};Ct(d,z,!1,w,Z,r,!0,a)}}else for(const{input:B,output:I}of U){const _=He.test(I);let M=f.type;_||(I.endsWith(".mjs")?M="esm":I.endsWith(".cjs")?M="cjs":I.endsWith(".js")&&!M&&(M=r.pkg.type==="module"?"esm":"cjs"));const H={...f,file:I,...!_&&M&&{type:M}};Ct(d,B,!1,w,H,r,!0,a)}continue}const E=new RegExp($+y.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)+x);let O=t.find(j=>E.test(j));if(O===void 0){const j=r.options.sourceDir.replace(En,""),A=re(r.options.rootDir,j),N=u1(f.file);if(N){const q=d1(t,N.baseName,N.pattern,A);if(q)O=q;else{const J=N.baseName,U=new RegExp($+J.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)+x);O=t.find(ee=>U.test(ee))}}else{const q=y.replace(o1,"$1").replace(r1,"");if(hd.has(f.subKey)){const J=new RegExp($+q.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)+x);O=t.find(U=>J.test(U))}}}if(O===void 0){jt(re(r.options.rootDir,f.file))||i.push(`Could not find entrypoint for \`${f.file}\``);continue}jt(O)&&i1.test(O)&&zc(r);const S=a.filter(j=>j.exportKey===f.exportKey);if(S.length>0&&S.every(j=>He.test(j.file))){const j=S.some(q=>q.file.endsWith(".d.mts")),A=S.some(q=>q.file.endsWith(".d.cts"));j&&A?(Le(r.options.declaration)&&(r.options.declaration="compatible"),r.options.emitCJS=!0,r.options.emitESM=!0):A?(Le(r.options.declaration)&&(r.options.declaration="compatible"),r.options.emitCJS=!0):j&&(Le(r.options.declaration)&&(r.options.declaration="compatible"),r.options.emitESM=!0);const N={...f,subKey:"types",type:void 0};Ct(d,O,k,w,N,r,!1,a)}else{const j=Vg(O.replace(Qa,"")),A=`${j}.cts`,N=`${j}.mts`,q=jt(A),J=jt(N),U=f.file.endsWith(".d.mts")||f.file.endsWith(".mjs"),ee=f.file.endsWith(".d.cts")||f.file.endsWith(".cjs");U&&J?Ct(d,N,k,w,{...f,type:"esm"},r,!1,a):ee&&q?Ct(d,A,k,w,{...f,type:"cjs"},r,!1,a):q&&J?(Ct(d,A,k,w,{...f,type:"cjs"},r,!1,a),Ct(d,N,k,w,{...f,type:"esm"},r,!1,a)):Ct(d,O,k,w,f,r,!1,a)}}return{entries:d,warnings:i}},"inferEntries");var m1=Object.defineProperty,Gf=g((e,t)=>m1(e,"name",{value:t,configurable:!0}),"n$g");const ln=Gf(e=>typeof e=="string"&&e!=="","isNonEmptyString"),h1=Gf((e,t)=>{const{publishConfig:r}=e;return r&&(r.bin&&(typeof r.bin=="object"||typeof r.bin=="string")&&(e.bin=r.bin),ln(r.type)&&(e.type=r.type),ln(r.main)&&(e.main=r.main),ln(r.module)&&(e.module=r.module),t===void 0&&ln(r.types)?e.types=r.types:t===void 0&&ln(r.typings)&&(e.typings=r.typings),r.exports&&typeof r.exports=="object"&&(e.exports=r.exports)),e},"overwriteWithPublishConfig");var g1=Object.defineProperty,zr=g((e,t)=>g1(e,"name",{value:t,configurable:!0}),"a$j");const Vf=/.*\/dist\/.*/,qc=/\/$/,v1=/\.mjs$/,b1=/\.cjs$/,y1=/\.d\.[mc]?ts$/,$1=/(?<!\.d)\.js$/,w1=zr(e=>{const t=[],r=new Set,n=zr(i=>{if(typeof i=="string"){t.push(i);return}if(Array.isArray(i)){for(const o of i)n(o);return}if(i&&typeof i=="object")for(const[o,s]of Object.entries(i))o.startsWith(".")||r.add(o),n(s)},"walk");e.exports&&n(e.exports);for(const i of[e.main,e.module,e.types])typeof i=="string"&&t.push(i);return{conditions:r,files:t}},"collectPackageOutputs"),x1=zr((e,t,r)=>{if(e.options.emitESM!==void 0||e.options.emitCJS!==void 0)return;const n=e.pkg.type==="module"?"esm":"cjs",i=r.some(a=>$1.test(a));let o=r.some(a=>v1.test(a))||t.has("import")||t.has("module"),s=r.some(a=>b1.test(a))||t.has("require");(i||!o&&!s)&&n==="esm"?o=!0:(i||!o&&!s)&&(s=!0),e.options.emitESM=o,e.options.emitCJS=s},"resolveUnbundleEmitFormats"),j1=zr((e,t,r)=>{if(e.options.declaration!==void 0)return;const n=!!e.pkg.types||t.has("types")||r.some(i=>y1.test(i));e.options.declaration=n?"node16":!1},"resolveUnbundleDeclaration"),k1=zr(e=>{e.options.entries.length=0;const t=G(e.options.rootDir,e.options.sourceDir);if(!jt(t))throw new Error("No 'src' directory found. Please provide entries manually.");const r=Zu(t,{extensions:[],includeDirs:!1,includeSymlinks:!1,skip:[Zt,Vf]}).filter(c=>Yt.test(c)&&!c.endsWith(".d.ts")),{conditions:n,files:i}=w1(e.pkg);x1(e,n,i),j1(e,n,i);const o=e.options.emitESM??!1,s=e.options.emitCJS??!1;for(const c of r){const p=c.replace(`${t}/`,"").replace(Yt,"").replaceAll("/","/");e.options.entries.push({cjs:s,declaration:e.options.declaration,esm:o,input:c,name:p})}const a=[];o&&a.push("[esm]"),s&&a.push("[cjs]"),e.options.declaration&&a.push("[dts]");const l=e.options.entries.length;e.logger.info("Unbundle mode: preserving source structure for",pe(`${String(l)} ${l===1?"entry":"entries"}`),rt(a.join(" ")))},"prepareUnbundleEntries"),E1={hooks:{"build:prepare":zr(async function(e){if(e.options.unbundle){k1(e);return}if(e.options.entries.length>0)return;const t=G(e.options.rootDir,e.options.sourceDir);if(!jt(t))throw new Error("No 'src' directory found. Please provide entries manually.");const r=Zu(t,{extensions:[],includeDirs:!1,includeSymlinks:!1,skip:[Zt,Vf]});if(r.length===0)throw new Error("No source files found in 'src' directory. Please provide entries manually.");const n=e.logger;let i={...e.pkg};i.publishConfig&&(n.info(`Using publishConfig found in package.json, to override the default key-value pairs of "${Object.keys(i.publishConfig).join(", ")}".`),n.debug(i.publishConfig),i=h1(i,e.options.declaration));const o=await f1(i,r,e);for(const s of o.warnings)n.warn(s);if(e.options.entries.push(...o.entries),e.options.entries.length===0)throw new Error("No entries detected. Please provide entries manually.");n.info("Automatically detected entries:",pe(e.options.entries.map(s=>s.fileAlias?`${We(s.fileAlias)} => ${We(s.input.replace(`${e.options.rootDir}/`,"").replace(qc,"/*"))}`:We(s.input.replace(`${e.options.rootDir}/`,"").replace(qc,"/*"))).join(", ")),rt([e.options.emitESM&&"esm",e.options.emitCJS&&"cjs",e.options.declaration&&"dts"].filter(Boolean).map(s=>`[${s}]`).join(" ")))},"build:prepare")}};var S1=Object.defineProperty,se=g((e,t)=>S1(e,"name",{value:t,configurable:!0}),"r$6");const O1=Ze(import.meta.url),jr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,wl=se(e=>{if(typeof jr<"u"&&jr.versions&&jr.versions.node){const[t,r]=jr.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return jr.getBuiltinModule(e)}return O1(e)},"__cjs_getBuiltinModule"),{existsSync:Tr}=wl("node:fs"),{env:Nr,cwd:Kf}=jr,{createRequire:ni}=wl("node:module"),Yf=0,_r=2,Xf=Symbol("findUpStop"),xl=se(e=>{if(!e||!(e instanceof URL)&&typeof e!="string")throw new TypeError("Path must be a non-empty string or URL.")},"assertValidFileOrDirectoryPath"),Hc=se(e=>{if(e.isFile())return"file";if(e.isDirectory())return"dir";if(e.isSymbolicLink())return"symlink"},"getFileInfoType"),A1=ni(import.meta.url),cn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,P1=se(e=>{if(typeof cn<"u"&&cn.versions&&cn.versions.node){const[t,r]=cn.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return cn.getBuiltinModule(e)}return A1(e)},"__cjs_getBuiltinModule$5"),{lstatSync:Jc,mkdirSync:C1}=P1("node:fs"),R1=se(e=>{xl(e);try{const t=Jc(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(Hc(t))}'`);return}catch(t){if(t.code!=="ENOENT")throw t}try{C1(e,{recursive:!0})}catch(t){if(t.code!=="EEXIST")throw t;const r=Jc(e);if(!r.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(Hc(r))}'`,{cause:t})}},"ensureDirSync"),T1=/^[A-Z]:\//i,ii=se((e="")=>e&&e.replaceAll("\\","/").replace(T1,t=>t.toUpperCase()),"normalizeWindowsPath$1"),N1=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,_1=/^[A-Z]:$/i,M1=/.(\.[^./]+)$/,I1=/^[/\\]|^[a-z]:[/\\]/i,W1=/\/$/,B1=se(()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd"),D1=se((e,t)=>{let r="",n=0,i=-1,o=0,s;for(let a=0;a<=e.length;++a){if(a<e.length)s=e[a];else{if(s==="/")break;s="/"}if(s==="/"){if(!(i===a-1||o===1))if(o===2){if(r.length<2||n!==2||!r.endsWith(".")||r.at(-2)!=="."){if(r.length>2){const l=r.lastIndexOf("/");l===-1?(r="",n=0):(r=r.slice(0,l),n=r.length-1-r.lastIndexOf("/")),i=a,o=0;continue}else if(r.length>0){r="",n=0,i=a,o=0;continue}}t&&(r+=r.length>0?"/..":"..",n=2)}else r.length>0?r+=`/${e.slice(i+1,a)}`:r=e.slice(i+1,a),n=a-i-1;i=a,o=0}else s==="."&&o!==-1?++o:o=-1}return r},"normalizeString$1"),Dn=se(e=>N1.test(e),"isAbsolute$1"),Mr=se(function(...e){e=e.map(n=>ii(n));let t="",r=!1;for(let n=e.length-1;n>=-1&&!r;n--){const i=n>=0?e[n]:B1();!i||i.length===0||(t=`${i}/${t}`,r=Dn(i))}return t=D1(t,!r),r&&!Dn(t)?`/${t}`:t.length>0?t:"."},"resolve"),F1=se(function(e){return M1.exec(ii(e))?.[1]??""},"extname"),jl=se(e=>{const t=ii(e).replace(W1,"").split("/").slice(0,-1);return t.length===1&&_1.test(t[0])&&(t[0]=`${t[0]}/`),t.join("/")||(Dn(e)?"/":".")},"dirname$1"),L1=se((e,t)=>{const r=ii(e).split("/").pop();return t&&r.endsWith(t)?r.slice(0,-t.length):r},"basename"),Zf=se(function(e){const t=I1.exec(e)?.[0]?.replaceAll("\\","/")??"",r=L1(e),n=F1(r);return{base:r,dir:jl(e),ext:n,name:r.slice(0,r.length-n.length),root:t}},"parse"),z1=ni(import.meta.url),pn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,q1=se(e=>{if(typeof pn<"u"&&pn.versions&&pn.versions.node){const[t,r]=pn.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return pn.getBuiltinModule(e)}return z1(e)},"__cjs_getBuiltinModule$4"),{fileURLToPath:H1}=q1("node:url");function Qf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}g(Qf,"_e$2");se(Qf,"getDefaultExportFromCjs");var Uc,Gc;function em(){return Gc||(Gc=1,Uc=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cr3","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),Uc}g(em,"ye$2");se(em,"requireBinaryExtensions");var J1=em();const U1=Qf(J1);new Set(U1);const qr=se(e=>ii(e instanceof URL?H1(e):e),"toPath"),G1=ni(import.meta.url),un=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,tm=se(e=>{if(typeof un<"u"&&un.versions&&un.versions.node){const[t,r]=un.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return un.getBuiltinModule(e)}return G1(e)},"__cjs_getBuiltinModule$3"),{stat:V1,lstat:K1}=tm("node:fs/promises"),{fileURLToPath:Y1}=tm("node:url"),X1=se(async(e,t={})=>{const r=t.cwd?qr(t.cwd):process.cwd();let n=Mr(r);const{root:i}=Zf(n),o=qr(t.stopAt??i),s=Mr(n,o),a=t.type??"file",l=se(async function(p){return[e]},"getMatchers");t.allowSymlinks??=!0;const c=t.allowSymlinks?V1:K1;for(;n&&n!==s&&n!==i;){const p=await l();for(let u of p){if(u===Xf)return;if(u===void 0)continue;Buffer.isBuffer(u)?u=u.toString():u instanceof URL&&(u=Y1(u));const d=Dn(u)?u:Mr(n,u);try{const f=await c(d);if(a==="file"&&f.isFile()||a==="directory"&&f.isDirectory())return d}catch{}}n=jl(n)}},"findUp"),Z1=ni(import.meta.url),dn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,rm=se(e=>{if(typeof dn<"u"&&dn.versions&&dn.versions.node){const[t,r]=dn.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return dn.getBuiltinModule(e)}return Z1(e)},"__cjs_getBuiltinModule$2"),{statSync:Q1,lstatSync:e2}=rm("node:fs"),{fileURLToPath:t2}=rm("node:url"),r2=se((e,t={})=>{const r=t.cwd?qr(t.cwd):process.cwd();let n=Mr(r);const{root:i}=Zf(n),o=qr(t.stopAt??i),s=Mr(n,o),a=t.type??"file",l=se(function(p){return[e]},"getMatchers");t.allowSymlinks??=!0;const c=t.allowSymlinks?Q1:e2;for(;n&&n!==s&&n!==i;){for(let p of l()){if(p===Xf)return;if(p===void 0)continue;Buffer.isBuffer(p)?p=p.toString():p instanceof URL&&(p=t2(p));const u=Dn(p)?p:Mr(n,p);try{const d=c(u);if(a==="file"&&d.isFile()||a==="directory"&&d.isDirectory())return u}catch{}}n=jl(n)}},"findUpSync"),n2=ni(import.meta.url),fn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,i2=se(e=>{if(typeof fn<"u"&&fn.versions&&fn.versions.node){const[t,r]=fn.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return fn.getBuiltinModule(e)}return n2(e)},"__cjs_getBuiltinModule$1"),{access:o2}=i2("node:fs/promises");async function Fi(e,t=Yf){xl(e),e=qr(e);try{return await o2(e,t),!0}catch{return!1}}g(Fi,"N$f");se(Fi,"isAccessible");const{accessSync:s2}=wl("node:fs");function Li(e,t=Yf){xl(e),e=qr(e);try{return s2(e,t),!0}catch{return!1}}g(Li,"z$d");se(Li,"isAccessibleSync");let nm=class extends Error{static{g(this,"V")}static{se(this,"NotFoundError")}constructor(t){super(`ENOENT: ${t}`)}get code(){return"ENOENT"}set code(t){throw new Error("Cannot overwrite code ENOENT")}get name(){return"NotFoundError"}set name(t){throw new Error("Cannot overwrite name of NotFoundError")}};const a2=/^[A-Z]:\//i,im=se((e="")=>e&&e.replaceAll("\\","/").replace(a2,t=>t.toUpperCase()),"normalizeWindowsPath"),l2=/^[/\\]{2}/,c2=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,om=/^[A-Z]:$/i,p2=/\/$/,u2=se((e,t)=>{let r="",n=0,i=-1,o=0,s;for(let a=0;a<=e.length;++a){if(a<e.length)s=e[a];else{if(s==="/")break;s="/"}if(s==="/"){if(!(i===a-1||o===1))if(o===2){if(r.length<2||n!==2||!r.endsWith(".")||r.at(-2)!=="."){if(r.length>2){const l=r.lastIndexOf("/");l===-1?(r="",n=0):(r=r.slice(0,l),n=r.length-1-r.lastIndexOf("/")),i=a,o=0;continue}else if(r.length>0){r="",n=0,i=a,o=0;continue}}t&&(r+=r.length>0?"/..":"..",n=2)}else r.length>0?r+=`/${e.slice(i+1,a)}`:r=e.slice(i+1,a),n=a-i-1;i=a,o=0}else s==="."&&o!==-1?++o:o=-1}return r},"normalizeString"),Ma=se(e=>c2.test(e),"isAbsolute"),d2=se(function(e){if(e.length===0)return".";e=im(e);const t=l2.exec(e),r=Ma(e),n=e.at(-1)==="/";return e=u2(e,!r),e.length===0?r?"/":n?"./":".":(n&&(e+="/"),om.test(e)&&(e+="/"),t?r?`//${e}`:`//./${e}`:r&&!Ma(e)?`/${e}`:e)},"normalize"),_t=se((...e)=>{let t="";for(const r of e)if(r)if(t.length>0){const n=t.at(-1)==="/",i=r[0]==="/";n&&i?t+=r.slice(1):t+=n||i?r:`/${r}`}else t+=r;return d2(t)},"join"),sm=se(e=>{const t=im(e).replace(p2,"").split("/").slice(0,-1);return t.length===1&&om.test(t[0])&&(t[0]=`${t[0]}/`),t.join("/")||(Ma(e)?"/":".")},"dirname"),to=se((e,t)=>(t?.create&&R1(e),e),"useDirectory");se(async(e,t)=>{if(Nr.CACHE_DIR&&!["0","1","false","true"].includes(Nr.CACHE_DIR))return to(_t(Nr.CACHE_DIR,e),t);const r=await X1("package.json",{cwd:t?.cwd??Kf(),type:"file"});if(!r){if(t?.throwError)throw new nm("No such file or directory found.");return}const n=_t(sm(r),"node_modules"),i=_t(n,".cache"),o=_t(i,e);if(!(Tr(o)&&!await Fi(o,_r))&&!(Tr(i)&&!await Fi(i,_r))&&!(Tr(n)&&!await Fi(n,_r)))return to(o,t)},"findCacheDirectory");const f2=se((e,t)=>{if(Nr.CACHE_DIR&&!["0","1","false","true"].includes(Nr.CACHE_DIR))return to(_t(Nr.CACHE_DIR,e),t);const r=r2("package.json",{cwd:t?.cwd??Kf(),type:"file"});if(!r){if(t?.throwError)throw new nm("No such file or directory found.");return}const n=_t(sm(r),"node_modules"),i=_t(n,".cache"),o=_t(i,e);if(!(Tr(o)&&!Li(o,_r))&&!(Tr(i)&&!Li(i,_r))&&!(Tr(n)&&!Li(n,_r)))return to(o,t)},"findCacheDirectorySync"),m2=f2;var h2=Object.defineProperty,Io=g((e,t)=>h2(e,"name",{value:t,configurable:!0}),"l$r");const g2=/^(?<value>-?\d+(?:[.,]\d+)*) *(?<type>[a-z]+)?$/i,v2=/^KIBI/,b2=/^MIBI/,y2=/^GIBI/,$2=/^TEBI/,w2=/^PEBI/,x2=/^EXBI/,j2=/^ZEBI/,k2=/^YIBI/,E2=/^(.)IB$/,am={iec:[{long:"Bytes",short:"B"},{long:"Kibibytes",short:"KiB"},{long:"Mebibytes",short:"MiB"},{long:"Gibibytes",short:"GiB"},{long:"Tebibytes",short:"TiB"},{long:"Pebibytes",short:"PiB"},{long:"Exbibytes",short:"EiB"},{long:"Zebibytes",short:"ZiB"},{long:"Yobibytes",short:"YiB"}],iec_octet:[{long:"Octets",short:"o"},{long:"Kibioctets",short:"Kio"},{long:"Mebioctets",short:"Mio"},{long:"Gibioctets",short:"Gio"},{long:"Tebioctets",short:"Tio"},{long:"Pebioctets",short:"Pio"},{long:"Exbioctets",short:"Eio"},{long:"Zebioctets",short:"Zio"},{long:"Yobioctets",short:"Yio"}],metric:[{long:"Bytes",short:"Bytes"},{long:"Kilobytes",short:"KB"},{long:"Megabytes",short:"MB"},{long:"Gigabytes",short:"GB"},{long:"Terabytes",short:"TB"},{long:"Petabytes",short:"PB"},{long:"Exabytes",short:"EB"},{long:"Zettabytes",short:"ZB"},{long:"Yottabytes",short:"YB"}],metric_octet:[{long:"Octets",short:"o"},{long:"Kilo-octets",short:"ko"},{long:"Mega-octets",short:"Mo"},{long:"Giga-octets",short:"Go"},{long:"Tera-octets",short:"To"},{long:"Peta-octets",short:"Po"},{long:"Exa-octets",short:"Eo"},{long:"Zetta-octets",short:"Zo"},{long:"Yotta-octets",short:"Yo"}]},S2=Io((e,t)=>{const r=new Intl.NumberFormat(t).format(11111).replaceAll(new RegExp("\\p{Number}","gu"),""),n=new Intl.NumberFormat(t).format(1.1).replaceAll(new RegExp("\\p{Number}","gu"),"");return Number.parseFloat(e.replaceAll(new RegExp(`\\${r}`,"g"),"").replace(new RegExp(`\\${n}`),"."))},"parseLocalizedNumber"),lm=Io(e=>{switch(e){case 2:return 1024;case 10:return 1e3;default:throw new Error("Unsupported base.")}},"fromBase"),O2=Io((e,t)=>{const r={base:2,locale:"en-US",units:"metric",...t};if(typeof e!="string"||e.length===0)throw new TypeError("Value is not a string or is empty.");if(e.length>100)throw new TypeError("Value exceeds the maximum length of 100 characters.");const n=g2.exec(e)?.groups;if(!n)return Number.NaN;const i=S2(n.value,r.locale),o=(n.type??"Bytes").toUpperCase().replace(v2,"KILO").replace(b2,"MEGA").replace(y2,"GIGA").replace($2,"TERA").replace(w2,"PETA").replace(x2,"EXA").replace(j2,"ZETTA").replace(k2,"YOTTA").replace(E2,"$1B"),s=am[r.units].findIndex(l=>l.short[0].toUpperCase()===o[0]),a=lm(r.base);return i*a**s},"parseBytes"),Ie=Io((e,t)=>{if(typeof e!="number"||!Number.isFinite(e))throw new TypeError("Bytesize is not a number.");const{base:r,decimals:n,locale:i,long:o,unit:s,units:a,...l}={base:2,decimals:0,locale:"en-US",long:!1,units:"metric",...t},c=lm(r),p=Math.abs(e),u=t?.space??!0?" ":"",d=am[a],f=d.findIndex(w=>w.short===s);if(e===0){const w=Math.min(0,Math.max(f,d.length-1));return"0"+u+d[w][o?"long":"short"]}const m=f===-1?Math.min(Math.floor(Math.log(p)/Math.log(c)),d.length-1):f,h=d[m][o?"long":"short"],v=e/c**m,b=n<0?void 0:n;return new Intl.NumberFormat(i,{maximumFractionDigits:b,minimumFractionDigits:b,...l}).format(v)+u+h},"formatBytes");var A2=Object.defineProperty,P2=g((e,t)=>A2(e,"name",{value:t,configurable:!0}),"n$f");const C2=P2((e,t,r,n,i,o,s,a,l,c,p,u,d,f)=>{const m={d:n,h:i,m:o,mo:t,ms:a,s,w:r,y:e};return l!==void 0&&(m.future=l),c!==void 0&&(m.past=c),p!==void 0&&(m.decimal=p),u!==void 0&&(m.unitMap=u),d!==void 0&&(m.groupSeparator=d),f!==void 0&&(m.placeholderSeparator=f),m},"createDurationLanguage"),cm={d:"d",day:"d",days:"d",h:"h",hour:"h",hours:"h",hr:"h",hrs:"h",m:"m",millisecond:"ms",milliseconds:"ms",min:"m",mins:"m",minute:"m",minutes:"m",mo:"mo",month:"mo",months:"mo",ms:"ms",s:"s",sec:"s",second:"s",seconds:"s",secs:"s",w:"w",week:"w",weeks:"w",y:"y",year:"y",years:"y",yr:"y",yrs:"y"},pm=C2(e=>`year${e===1?"":"s"}`,e=>`month${e===1?"":"s"}`,e=>`week${e===1?"":"s"}`,e=>`day${e===1?"":"s"}`,e=>`hour${e===1?"":"s"}`,e=>`minute${e===1?"":"s"}`,e=>`second${e===1?"":"s"}`,e=>`millisecond${e===1?"":"s"}`,"in %s","%s ago",".",cm,",","_");var R2=Object.defineProperty,T2=g((e,t)=>R2(e,"name",{value:t,configurable:!0}),"o$b");const um=T2(e=>{const t=["y","mo","w","d","h","m","s","ms","future","past"];for(const n of t)if(!Object.hasOwn(e,n))throw new TypeError(`Missing required property: ${n}`);if(typeof e.future!="string"||typeof e.past!="string")throw new TypeError("Properties future and past must be of type string");const r=["y","mo","w","d","h","m","s","ms"];for(const n of r)if(typeof e[n]!="string"&&typeof e[n]!="function")throw new TypeError(`Property ${n} must be of type string or function`);if(e.decimal&&typeof e.decimal!="string")throw new TypeError("Property decimal must be of type string");if(e.delimiter&&typeof e.delimiter!="string")throw new TypeError("Property delimiter must be of type string");if(e._digitReplacements&&!Array.isArray(e._digitReplacements))throw new TypeError("Property _digitReplacements must be an array");if(e._numberFirst&&typeof e._numberFirst!="boolean")throw new TypeError("Property _numberFirst must be of type boolean");if(e.unitMap&&typeof e.unitMap!="object")throw new TypeError("Property unitMap must be an object");if(e.unitMap&&Object.values(e.unitMap).some(n=>typeof n!="string"))throw new TypeError("All values in unitMap must be of type string")},"validateDurationLanguage");var N2=Object.defineProperty,oi=g((e,t)=>N2(e,"name",{value:t,configurable:!0}),"g$l");const dm=oi((e,t)=>{t=t||-1;const r=new RegExp(String.raw`^-?\d+(?:.\d{0,${String(t)}})?`).exec(e.toString());return r===null?e:Number.parseFloat(r[0])},"toFixed"),Vc=oi(({unitCount:e,unitName:t},r,n)=>{let{spacer:i}=n;const{maxDecimalPoints:o}=n;let s=".";n.decimal!==void 0?s=n.decimal:r.decimal!==void 0&&(s=r.decimal);let a;"digitReplacements"in n?a=n.digitReplacements:"_digitReplacements"in r&&(a=r._digitReplacements);let l,c=e;o!==void 0&&(c=dm(e,o));const p=c.toString();if(!r._hideCountIf2||e!==2)if(a){l="";for(const f of p)l+=f==="."?s:a[f]}else l=p.replace(".",s);else l="";const u=r[t];let d=u;return typeof u=="function"&&(d=u(e)),r._hideCountIf2&&e===2&&(i=""),r._numberFirst?d+i+l:l+i+d},"renderPiece"),_2=oi((e,t)=>{const{units:r}=t;if(r.length===0)return[];const{unitMeasures:n}=t,i=t.largest??Number.POSITIVE_INFINITY,o={};let s,a,l,c=e;for(a=0;a<r.length;a++){s=r[a];const u=n[s];l=a===r.length-1?c/u:Math.floor(c/u),o[s]=l,c-=l*u}if(t.round){let u=i;for(a=0;a<r.length;a++)if(s=r[a],l=o[s],l!==0&&(u--,u===0)){for(let d=a+1;d<r.length;d++){const f=r[d],m=o[f];o[s]=(o[s]??0)+m*n[f]/n[s],o[f]=0}break}for(a=r.length-1;a>=0;a--){if(s=r[a],l=o[s],l===0)continue;const d=Math.round(l);if(o[s]=d,a===0)break;const f=r[a-1],m=n[f],h=Math.floor(d*n[s]/m);if(h)o[f]=(o[f]??0)+h,o[s]=0;else break}}const p=[];for(a=0;a<r.length&&p.length<i;a++){if(s=r[a],l=o[s],l&&!t.round&&p.length===i-1){let u,d=0;for(u=a+1,r.length;u<r.length;u++){const f=r[u];d+=o[f]*(t.unitMeasures[f]/t.unitMeasures[s])}l+=d,t.maxDecimalPoints!==void 0&&(l=dm(l,t.maxDecimalPoints))}l&&p.push({unitCount:l,unitName:s})}return p},"getPieces"),M2=oi((e,t,r)=>{const{language:n,units:i}=t;if(e.length===0){const u=i.at(-1);return Vc({unitCount:0,unitName:u},n,t)}const{conjunction:o,serialComma:s}=t;let a=", ";t.delimiter!==void 0?a=t.delimiter:n.delimiter!==void 0&&(a=n.delimiter);let l="";t.timeAdverb&&r!==0&&(l=n.future??"",r<0&&(l=n.past??""));const c=e.map(u=>Vc(u,n,t));let p;return!o||e.length===1?p=c.join(a):e.length===2?p=c.join(o):p=c.slice(0,-1).join(a)+(s?",":"")+o+(c.at(-1)??""),l&&(p=l.replace("%s",p)),p},"formatPieces"),Kc=oi((e,t)=>{if(Number.isNaN(e))throw new TypeError("Expected a valid number");if(typeof e!="number")throw new TypeError("Expected a number for milliseconds input");const r={conjunction:"",language:pm,round:!1,serialComma:!0,spacer:" ",timeAdverb:!1,unitMeasures:{d:864e5,h:36e5,m:6e4,mo:2629746e3,ms:1,s:1e3,w:6048e5,y:31556952e3},units:["w","d","h","m","s"],...t};um(r.language);const n=Math.abs(e),i=_2(n,r);return M2(i,r,e)},"duration");var I2=Object.defineProperty,W2=g((e,t)=>I2(e,"name",{value:t,configurable:!0}),"I$9");const Yc={d:864e5,h:36e5,m:6e4,mo:2629746e3,ms:1,s:1e3,w:6048e5,y:31556952e3},yi=/[-/\\^$*+?.()|[\]{}]/g,B2=/^PT(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?$/i,D2=/^(?:(\d+):)?(?:(\d+):)?(\d+)$/,F2=/^[+-]?\d+(?:\.\d+)?$/,L2=/^[-+]/;W2((e,t)=>{if(typeof e!="string"||e.length===0)return;const{defaultUnit:r="ms",language:n=pm}=t??{};um(n);const i=n.decimal??".",o=n.groupSeparator??",",s=n.placeholderSeparator??"_",a=i.replaceAll(yi,String.raw`\$&`),l=o.replaceAll(yi,String.raw`\$&`),c=s.replaceAll(yi,String.raw`\$&`),p=n.unitMap??cm;let u=e.replaceAll(new RegExp(String.raw`(\d)[${c}${l}](\d)`,"g"),"$1$2");if(i!=="."&&(u=u.replace(a,".")),F2.test(e)){const E=Number.parseFloat(u.trim());if(!Number.isNaN(E)){const O=p[r];if(O!==void 0)return E*Yc[O]}return}const d=B2.exec(e);if(d){const E=Number.parseInt(d[1]??"0",10),O=Number.parseInt(d[2]??"0",10),S=Number.parseInt(d[3]??"0",10);return E*36e5+O*6e4+S*1e3}const f=D2.exec(e);if(f){let E=0,O=0;f[2]!==void 0?(E=Number.parseInt(f[1]??"0",10),O=Number.parseInt(f[2],10)):f[1]!==void 0&&(O=Number.parseInt(f[1],10));const S=Number.parseInt(f[3]??"0",10);return E*36e5+O*6e4+S*1e3}const m=Object.keys(p).toSorted((E,O)=>O.length-E.length).map(E=>E.replaceAll(yi,String.raw`\$&`)).join("|"),h=new RegExp(String.raw`(-?\d*\.?\d+)\s*(${m})`,"gi");let v=0,b,w=!1,k=-1,y=0;for(h.lastIndex=0;(b=h.exec(u))!==null;){w||(k=b.index),w=!0;const E=b[1],O=b[2];if(!E||!O)continue;const S=E.trim(),j=S.startsWith("-")?-1:1,A=S.replace(L2,""),N=Number.parseFloat(A),q=p[O.toLowerCase()];if(q===void 0)continue;const J=Yc[q];if(Number.isNaN(N))return;v+=j*N*J,y=h.lastIndex}const x=u.slice(0,k).trim(),$=u.slice(y).trim();if(!(w&&(x.length>0||$.length>0))&&w)return v},"parseDuration");var z2=Object.defineProperty,q2=g((e,t)=>z2(e,"name",{value:t,configurable:!0}),"d$p"),H2=Object.defineProperty,fm=q2((e,t)=>H2(e,"name",{value:t,configurable:!0}),"g");const J2=Ze(import.meta.url),mn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,mm=fm(e=>{if(typeof mn<"u"&&mn.versions&&mn.versions.node){const[t,r]=mn.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return mn.getBuiltinModule(e)}return J2(e)},"__cjs_getBuiltinModule"),{execSync:U2}=mm("node:child_process"),{existsSync:Xc,readFileSync:G2}=mm("node:fs");var V2=Object.defineProperty,yt=fm((e,t)=>V2(e,"name",{value:t,configurable:!0}),"r");const kl=["yarn.lock","package-lock.json","pnpm-lock.yaml","npm-shrinkwrap.json","bun.lockb"],hm=yt(e=>{let t;if(kl.forEach(n=>{!t&&Xc(G(e,n))&&(t=G(e,n))}),t)return t;const r=G(e,"package.json");if(Xc(r)&&bl(G2(r,"utf8")).packageManager!==void 0)return r},"packageMangerFindUpMatcher"),gm=yt(e=>{if(!e)throw new ar("Could not find a package manager");if(e.endsWith("package.json")){const t=bl(e);if(t.packageManager){const r=["npm","yarn","pnpm","bun"].find(n=>t.packageManager.startsWith(n));if(r)return{packageManager:r,path:ne(e)}}}if(e.endsWith("yarn.lock"))return{packageManager:"yarn",path:ne(e)};if(e.endsWith("package-lock.json")||e.endsWith("npm-shrinkwrap.json"))return{packageManager:"npm",path:ne(e)};if(e.endsWith("pnpm-lock.yaml"))return{packageManager:"pnpm",path:ne(e)};if(e.endsWith("bun.lockb"))return{packageManager:"bun",path:ne(e)};throw new ar("Could not find a package manager")},"resolvePackageManagerFromFile"),K2=yt(async e=>{const t=await Wt(kl,{type:"file",...e&&{cwd:e}});if(!t)throw new Error("Could not find lock file");return t},"findLockFile"),Y2=yt(e=>{const t=Bt(kl,{type:"file",...e&&{cwd:e}});if(!t)throw new Error("Could not find lock file");return t},"findLockFileSync"),X2=yt(async e=>{const t=await Wt(hm,{...e&&{cwd:e}});return gm(t)},"findPackageManager"),vm=yt(e=>{const t=Bt(hm,{...e&&{cwd:e}});return gm(t)},"findPackageManagerSync");yt(e=>U2(`${e} --version`).toString("utf8").trim(),"getPackageManagerVersion");yt(()=>{if(!process.env.npm_config_user_agent)return;const e=process.env.npm_config_user_agent.split(" ")[0],t=e.lastIndexOf("/"),r=e.slice(0,Math.max(0,t));return{name:r==="npminstall"?"cnpm":r,version:e.slice(Math.max(0,t+1))}},"identifyInitiatingPackageManager");yt((e,t,r)=>{const n=t.length===1?"":"s";if(r.packageManagers??=["npm","pnpm","yarn"],r.packageManagers.length===0)throw new Error("No package managers provided, please provide at least one package manager");if(t.length===0)throw new Error("No missing packages provided, please provide at least one missing package");let i=`
|
|
51
|
+
${r.preMessage??""}
|
|
52
|
+
${e} could not find the following package${n}
|
|
53
|
+
|
|
54
|
+
${t.join(`
|
|
55
|
+
`)}
|
|
56
|
+
|
|
57
|
+
To install the missing package${n}, please run the following command:
|
|
58
|
+
`;const o=yt(a=>a.split("@").includes("@")?a:`${a}@latest`,"atLatest"),s=r.packageManagers.map(a=>{const l=t.map(c=>o(c)).join(" ");switch(a){case"bun":return` bun add ${l} -D`;case"npm":return` npm install ${l} --save-dev`;case"pnpm":return` pnpm add ${l} -D`;case"yarn":return` yarn add ${l} --dev`;default:throw new Error("Unknown package manager")}});return i+=s.join(`
|
|
59
|
+
|
|
60
|
+
or
|
|
61
|
+
|
|
62
|
+
`),r.postMessage&&(i+=r.postMessage),i},"generateMissingPackagesInstallMessage");var Z2=Object.defineProperty,bm=g((e,t)=>Z2(e,"name",{value:t,configurable:!0}),"n$e"),Q2=Object.defineProperty,ym=bm((e,t)=>Q2(e,"name",{value:t,configurable:!0}),"a"),ej=Object.defineProperty,tj=ym((e,t)=>ej(e,"name",{value:t,configurable:!0}),"t");let U4=class extends Error{static{g(this,"u")}static{bm(this,"g")}static{ym(this,"s")}static{tj(this,"PackageNotFoundError")}constructor(t,r){if(typeof t=="string"&&(t=[t]),t.length===0){super("Package was not found.");return}if(r===void 0)try{r=vm().packageManager}catch{}r??="npm",super(`Package '${t.join(" ")}' was not found. Please install it using '${r} install ${t.join(" ")}'`)}get code(){return"PACKAGE_NOT_FOUND"}set code(t){throw new Error("Cannot overwrite code PACKAGE_NOT_FOUND")}get name(){return"PackageNotFoundError"}set name(t){throw new Error("Cannot overwrite name of PackageNotFoundError")}};var rj=Object.defineProperty,nj=g((e,t)=>rj(e,"name",{value:t,configurable:!0}),"L$9"),ij=Object.defineProperty,$m=nj((e,t)=>ij(e,"name",{value:t,configurable:!0}),"F");const oj=Ze(import.meta.url),hn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,wm=$m(e=>{if(typeof hn<"u"&&hn.versions&&hn.versions.node){const[t,r]=hn.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return hn.getBuiltinModule(e)}return oj(e)},"__cjs_getBuiltinModule"),{readFileSync:sj}=wm("node:fs"),{readFile:aj}=wm("node:fs/promises");var lj=Object.defineProperty,Pe=$m((e,t)=>lj(e,"name",{value:t,configurable:!0}),"g");const cj={sha256:"sha256",sha384:"sha384",sha512:"sha512"},pj=1024,uj=/^[A-Z0-9+/]+={0,2}$/i,dj=/.*node_modules\/((?:@[^/]+\/)?[^/]+)$/,Fn=/^['"]/,Ln=/['"]$/,fj=/^[a-z][a-zA-Z0-9]*:\s*$/m,mj=/resolution:\s*\{[^}]*integrity:\s*([^,}\s]+)/,hj=/^["']?((?:@[^/@"']+\/)?[^@"'\n]+)@[^"'\n]+["']?:?[\t\v\f\r \u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*\n((?:[\t ][^\n]*\n?)+)/gm,gj=/^\s+version:?\s+"?([^"\n]+)"?/m,vj=/^\s+integrity[\s:]+"?([^"\s]+)"?/m,Wo=Pe(e=>{if(e.length>pj)return;const t=e.indexOf("-");if(t<=0)return;const r=cj[e.slice(0,t).toLowerCase()];if(!r)return;const n=e.slice(t+1);if(uj.test(n))try{const i=Buffer.from(n,"base64");return i.length===0?void 0:{algorithm:r,hex:i.toString("hex")}}catch{return}},"decodeSriIntegrity"),Bo=Pe((e,t,r)=>{const n=`${r.name}@${r.version}`;t.has(n)||(t.add(n),e.push(r))},"pushUniqueEntry"),Xe=Pe((e,t,r)=>{r&&Object.keys(r).length>0&&(e[t]={...r})},"copyDepMap"),Ir=Pe(e=>{if(!e)return;const t={};for(const[r,n]of Object.entries(e))t[r]=[n];return Object.keys(t).length>0?t:void 0},"liftDepMap"),bj=Pe(e=>{const t=[],r=new Set;let n;try{n=JSON.parse(e)}catch{return t}if(!n.packages)return t;for(const[i,o]of Object.entries(n.packages)){if(!i||!o.version)continue;const s=dj.exec(i);if(!s?.[1])continue;const a=o.name??s[1];if(a.startsWith("."))continue;const l={name:a,version:o.version};if(o.integrity){const c=Wo(o.integrity);c&&(l.integrity=c)}Xe(l,"dependencies",Ir(o.dependencies)),Xe(l,"peerDependencies",Ir(o.peerDependencies)),Xe(l,"optionalDependencies",Ir(o.optionalDependencies)),Bo(t,r,l)}return t},"parseNpmLockFile"),xm=Pe(e=>{let t=e.trim();t.startsWith("/")&&(t=t.slice(1)),t=t.replace(Fn,"").replace(Ln,"");const r=t.indexOf("(");r>0&&(t=t.slice(0,r));const n=t.lastIndexOf("@");if(n<=0)return;const i=t.slice(0,n),o=t.slice(n+1);if(!(!i||!o||o.startsWith("link:")||o.startsWith("workspace:")||o.startsWith("file:")))return{name:i,version:o}},"splitPnpmPackageKey"),jm=Pe((e,t)=>{const r=new RegExp(String.raw`^${t}:\s*$`,"m").exec(e);if(!r)return;const n=r.index+r[0].length,i=fj.exec(e.slice(n));return e.slice(n,i?n+i.index:e.length)},"sliceTopLevelSection"),yj=Pe(e=>{const t=new Map,r=jm(e,"snapshots");if(!r)return t;const n=/^ {2}(['"]?[^\s:][^:\n]*?['"]?):\s*\n((?: {4}[^\n]*\n?)+)/gm;let i;for(;(i=n.exec(r)??void 0)!==void 0;){const o=xm(i[1]);if(!o)continue;const s=`${o.name}@${o.version}`,a=i[2],l=t.get(s)??{};for(const c of["dependencies","peerDependencies","optionalDependencies"]){const p=zi(a,c);if(!p)continue;const u=l[c]??{};for(const[d,f]of Object.entries(p)){const m=u[d]??[];for(const h of f)m.includes(h)||m.push(h);u[d]=m}l[c]=u}t.set(s,l)}return t},"parsePnpmSnapshotEdges"),$j=Pe(e=>{const t=[],r=new Set,n=jm(e,"packages");if(!n)return t;const i=yj(e),o=/^ {2}(['"]?[^\s:][^:\n]*?['"]?):\s*\n((?: {4}[^\n]*\n?)+)/gm;let s;for(;(s=o.exec(n)??void 0)!==void 0;){const a=xm(s[1]);if(!a)continue;const l=s[2],c=mj.exec(l),p={name:a.name,version:a.version};if(c?.[1]){const d=Wo(c[1]);d&&(p.integrity=d)}const u=i.get(`${a.name}@${a.version}`);Xe(p,"dependencies",u?.dependencies??zi(l,"dependencies")),Xe(p,"peerDependencies",u?.peerDependencies??zi(l,"peerDependencies")),Xe(p,"optionalDependencies",u?.optionalDependencies??zi(l,"optionalDependencies")),Bo(t,r,p)}return t},"parsePnpmLockFile"),zi=Pe((e,t)=>{const r=new RegExp(String.raw`^ {4}${t}:\s*\n((?: {6,}[^\n]*\n?)+)`,"m").exec(e);if(!r?.[1])return;const n={},i=/^ {6}([^\s:]+):\s*([^\n]+)/gm;let o;for(;(o=i.exec(r[1])??void 0)!==void 0;){const s=o[1].replace(Fn,"").replace(Ln,"");let a=o[2].trim();a=a.replace(Fn,"").replace(Ln,"");const l=a.indexOf("(");if(l>0&&(a=a.slice(0,l).trim()),!s||!a)continue;const c=n[s]??[];c.includes(a)||c.push(a),n[s]=c}return Object.keys(n).length>0?n:void 0},"extractPnpmDependencyMap"),wj=Pe(e=>{const t=[],r=new Set,n=hj;n.lastIndex=0;let i;for(;(i=n.exec(e)??void 0)!==void 0;){const o=i[1].replace(Fn,"").replace(Ln,"");if(!o)continue;const s=i[2],a=gj.exec(s);if(!a?.[1])continue;const l={name:o,version:a[1].trim()},c=vj.exec(s);if(c?.[1]){const p=Wo(c[1]);p&&(l.integrity=p)}Xe(l,"dependencies",vs(s,"dependencies")),Xe(l,"peerDependencies",vs(s,"peerDependencies")),Xe(l,"optionalDependencies",vs(s,"optionalDependencies")),Bo(t,r,l)}return t},"parseYarnLockFile"),vs=Pe((e,t)=>{const r=new RegExp(String.raw`^ {2}${t}:\s*\n((?: {4,}[^\n]*\n?)+)`,"m").exec(e);if(!r?.[1])return;const n={},i=/^ {4}(['"]?[^\s:'"]+['"]?)\s*(?::\s*)?['"]([^'"\n]+)['"]/gm;let o;for(;(o=i.exec(r[1])??void 0)!==void 0;){const s=o[1].replace(Fn,"").replace(Ln,""),a=o[2];if(s&&a){const l=n[s]??[];l.includes(a)||l.push(a),n[s]=l}}return Object.keys(n).length>0?n:void 0},"extractYarnDependencyMap"),xj=/,(?=\s*[}\]])/g,jj=Pe(e=>{const t=[],r=new Set;let n;try{n=JSON.parse(e.replaceAll(xj,""))}catch{return t}if(!n.packages)return t;for(const i of Object.values(n.packages)){const o=i[0];if(typeof o!="string")continue;const s=o.indexOf("@",1);if(s<=0)continue;const a=o.slice(0,s),l=o.slice(s+1);if(!a||!l||l.startsWith("workspace:")||l.startsWith("link:")||l.startsWith("file:"))continue;const c={name:a,version:l},p=i[3];if(typeof p=="string"&&p.length>0){const d=Wo(p);d&&(c.integrity=d)}const u=i[2];if(u&&typeof u=="object"&&!Array.isArray(u)){const d=u;Xe(c,"dependencies",Ir(d.dependencies)),Xe(c,"peerDependencies",Ir(d.peerDependencies)),Xe(c,"optionalDependencies",Ir(d.optionalDependencies))}Bo(t,r,c)}return t},"parseBunLockFile"),km=Pe(e=>{if(e.endsWith("pnpm-lock.yaml"))return"pnpm";if(e.endsWith("package-lock.json"))return"npm";if(e.endsWith("yarn.lock"))return"yarn";if(e.endsWith("bun.lock"))return"bun"},"inferLockFileType"),Em=Pe((e,t)=>{switch(t){case"bun":return jj(e);case"npm":return bj(e);case"pnpm":return $j(e);case"yarn":return wj(e);default:return[]}},"parseLockFileContent"),Sm=["pnpm-lock.yaml","package-lock.json","yarn.lock","bun.lock"];Pe(async e=>{const t=await Wt(Sm,{type:"file",...e&&{cwd:e}});if(!t)throw new Error("Could not find a supported lock file (pnpm-lock.yaml, package-lock.json, yarn.lock, bun.lock)");const r=km(t);if(!r)throw new Error(`Unsupported lock file: ${t}`);const n=await aj(t,"utf8");return{entries:Em(n,r),path:t,type:r}},"parseLockFile");Pe(e=>{const t=Bt(Sm,{type:"file",...e&&{cwd:e}});if(!t)throw new Error("Could not find a supported lock file (pnpm-lock.yaml, package-lock.json, yarn.lock, bun.lock)");const r=km(t);if(!r)throw new Error(`Unsupported lock file: ${t}`);return{entries:Em(sj(t,"utf8"),r),path:t,type:r}},"parseLockFileSync");var kj=Object.defineProperty,Ej=g((e,t)=>kj(e,"name",{value:t,configurable:!0}),"c$o"),Sj=Object.defineProperty,Om=Ej((e,t)=>Sj(e,"name",{value:t,configurable:!0}),"p");const Oj=Ze(import.meta.url),gn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Aj=Om(e=>{if(typeof gn<"u"&&gn.versions&&gn.versions.node){const[t,r]=gn.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return gn.getBuiltinModule(e)}return Oj(e)},"__cjs_getBuiltinModule"),{existsSync:ro,readFileSync:Am}=Aj("node:fs");var Pj=Object.defineProperty,Pm=Om((e,t)=>Pj(e,"name",{value:t,configurable:!0}),"i");Pm(async e=>{const t=await Wt(["lerna.json","turbo.json"],{type:"file",...e&&{cwd:e}});if(t?.endsWith("lerna.json")){const n=await mo(t);if(n&&typeof n=="object"&&!Array.isArray(n)){const i=n;if(i.useWorkspaces||i.packages)return{path:ne(t),strategy:"lerna"}}}const r=t?.endsWith("turbo.json");try{const{packageManager:n,path:i}=await X2(e);if(["npm","yarn"].includes(n)){const o=G(i,"package.json");if(ro(o)&&Am(G(i,"package.json"),"utf8").includes("workspaces"))return{path:i,strategy:r?"turbo":n}}else if(n==="pnpm"){const o=G(i,"pnpm-workspace.yaml");if(ro(o))return{path:i,strategy:r?"turbo":"pnpm"}}}catch(n){if(!(n instanceof ar))throw n}throw new Error(`No monorepo root could be found upwards from the directory ${e} using lerna, yarn, pnpm, or npm as indicators.`)},"findMonorepoRoot");Pm(e=>{const t=Bt(["lerna.json","turbo.json"],{type:"file",...e&&{cwd:e}});if(t?.endsWith("lerna.json")){const n=Va(t);if(n.useWorkspaces||n.packages)return{path:ne(t),strategy:"lerna"}}const r=t?.endsWith("turbo.json");try{const{packageManager:n,path:i}=vm(e);if(["npm","yarn"].includes(n)){const o=G(i,"package.json");if(ro(o)&&Am(G(i,"package.json"),"utf8").includes("workspaces"))return{path:i,strategy:r?"turbo":n}}else if(n==="pnpm"){const o=G(i,"pnpm-workspace.yaml");if(ro(o))return{path:i,strategy:r?"turbo":"pnpm"}}}catch(n){if(!(n instanceof ar))throw n}throw new Error(`No monorepo root could be found upwards from the directory ${e} using lerna, yarn, pnpm, or npm as indicators.`)},"findMonorepoRootSync");var Cj=Object.defineProperty,Rj=g((e,t)=>Cj(e,"name",{value:t,configurable:!0}),"c$n"),Tj=Object.defineProperty,Cm=Rj((e,t)=>Tj(e,"name",{value:t,configurable:!0}),"c");const Nj=Ze(import.meta.url),vn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_j=Cm(e=>{if(typeof vn<"u"&&vn.versions&&vn.versions.node){const[t,r]=vn.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return vn.getBuiltinModule(e)}return Nj(e)},"__cjs_getBuiltinModule"),{existsSync:Mj}=_j("node:fs");var Ij=Object.defineProperty,El=Cm((e,t)=>Ij(e,"name",{value:t,configurable:!0}),"r");const Rm=El(e=>{if(Mj(G(e,"package.json"))){const t=Va(G(e,"package.json"));if(t.name&&t.private!==!0)return"package.json"}},"packageJsonMatcher");El(async e=>{try{const n=await K2(e);return ne(n)}catch{}const t=await Wt(".git/config",{...e&&{cwd:e},type:"file"});if(t)return ne(ne(t));const r=await Wt(Rm,{...e&&{cwd:e},type:"file"});if(r)return ne(r);throw new Error("Could not find root directory")},"findPackageRoot");El(e=>{try{const n=Y2(e);return ne(n)}catch{}const t=Bt(".git/config",{...e&&{cwd:e},type:"file"});if(t)return ne(ne(t));const r=Bt(Rm,{...e&&{cwd:e},type:"file"});if(r)return ne(r);throw new Error("Could not find root directory")},"findPackageRootSync");var Wj=Object.defineProperty,Tm=g((e,t)=>Wj(e,"name",{value:t,configurable:!0}),"l$m");const Zc=Tm(async e=>{try{const t=await e();return typeof t.rolldown=="function"?t.rolldown:void 0}catch{return}},"tryImport"),Nm=Tm(async()=>{const e=await Zc(()=>import("@rolldown/node"));if(e)return e;const t=await Zc(()=>import("rolldown"));if(t)return t;throw new Error("Rolldown is not installed. Please install '@rolldown/node' or 'rolldown' to use bundler: 'rolldown'.")},"getRolldownBuild");var Bj=Object.defineProperty,Dj=g((e,t)=>Bj(e,"name",{value:t,configurable:!0}),"_$a"),Fj=Object.defineProperty,Lj=Dj((e,t)=>Fj(e,"name",{value:t,configurable:!0}),"j"),zj=Object.defineProperty,mr=Lj((e,t)=>zj(e,"name",{value:t,configurable:!0}),"u");const _m="__packem_cache_wrapped",Ia="__packem_watch_files",Rt=mr(e=>typeof e=="function"?e:e.handler,"getHandler"),bs=mr(e=>{if(e&&typeof e=="object"&&"filter"in e)return e.filter},"getHookFilter"),Qc=new Map,qj=mr(e=>{const t=JSON.stringify(e);let r=Qc.get(t);return r===void 0&&(r=mt(t),Qc.set(t,r)),r},"hashResolveOptions"),Hj=mr(e=>e!==null&&typeof e=="object"&&e[_m]===!0,"isWrappedCacheValue"),Jj=mr(e=>e!==null&&typeof e=="object"&&Array.isArray(e[Ia]),"isWatchFilesCacheValue"),$i=mr(e=>Hj(e)?e.data:e,"unwrapCachedValue"),Me=mr((e,t,r="")=>{if(!t.isEnabled)return e;const n=G(r,e.name),i={...e,async buildEnd(l){e.buildEnd&&await Rt(e.buildEnd).call(this,l)},async buildStart(l){e.buildStart&&await Rt(e.buildStart).call(this,l)},async load(l){if(!e.load)return;const c=l.includes("?")?l.split("?")[0]:l;let p="";try{if(c&&Zg(c)){const h=sd(c);p=mt(h)}}catch{}const u=G("load",mt(l),p),d=await t.get(u,n);if(d!==void 0)return $i(d);const f=await Rt(e.load).call(this,l);if(f==null)return f;const m=typeof f=="object"&&"code"in f?f:{data:f,[_m]:!0};return t.set(u,m,n),f},name:`cached(${e.name})`,async resolveId(l,c,p){if(!e.resolveId)return;const u=G("resolveId",mt(l),c?mt(c):"",qj(p)),d=await t.get(u,n);if(d!==void 0)return $i(d);const f=await Rt(e.resolveId).call(this,l,c,p);return t.set(u,f,n),f},async transform(l,c){if(!e.transform)return;const p=G("transform",mt(c),mt(l)),u=await t.get(p,n);if(u!==void 0){const h=$i(u);if(Jj(h)){for(const v of h[Ia])this.addWatchFile(v);return $i(h.result)}return h}const d=[],f=Object.create(this);f.addWatchFile=h=>{d.push(h),this.addWatchFile(h)};const m=await Rt(e.transform).call(f,l,c);return d.length>0?t.set(p,{[Ia]:d,result:m},n):t.set(p,m,n),m}},o=bs(e.load),s=bs(e.resolveId),a=bs(e.transform);return o&&i.load&&(i.load={filter:o,handler:Rt(i.load)}),s&&i.resolveId&&(i.resolveId={filter:s,handler:Rt(i.resolveId)}),a&&i.transform&&(i.transform={filter:a,handler:Rt(i.transform)}),i},"cachePlugin");var Uj=Object.defineProperty,Gj=g((e,t)=>Uj(e,"name",{value:t,configurable:!0}),"f$i"),Vj=Object.defineProperty,Kj=Gj((e,t)=>Vj(e,"name",{value:t,configurable:!0}),"c"),Yj=Object.defineProperty,Xj=Kj((e,t)=>Yj(e,"name",{value:t,configurable:!0}),"c");const Zj=Xj(()=>({name:"packem:fix-dynamic-import-extension",renderChunk(e,t,r){if(r.format==="es"||r.format==="cjs"){const n=new Te(e),i=r.format==="es"?"mjs":"cjs",o=/(import\(.*?)(?<!\.d)(\.ts)(?=['´"`]\))/g;let s=!1,a;for(;(a=o.exec(e))!==null;){const[,l,c]=a;if(l&&c){const p=a.index+l.length,u=p+c.length;n.overwrite(p,u,`.${i}`),s=!0}}if(s)return{code:n.toString(),map:r.sourcemap?n.generateMap({hires:!0}):void 0}}}}),"fixDynamicImportExtension");var Qj=Object.defineProperty,ek=g((e,t)=>Qj(e,"name",{value:t,configurable:!0}),"n$d"),tk=Object.defineProperty,rk=ek((e,t)=>tk(e,"name",{value:t,configurable:!0}),"s"),nk=Object.defineProperty,ik=rk((e,t)=>nk(e,"name",{value:t,configurable:!0}),"i");const ok=ik(()=>({generateBundle(e,t){const r=[];for(const i of this.getModuleIds()){const o=this.getModuleInfo(i);if(o!==null&&!o.isExternal)for(const s of o.importedIds)r.push({source:i,target:s})}if(Array.isArray(r)&&r.length===0)return;const n=Object.keys(t);this.emitFile({fileName:`metafile-${n[0].replace(yv,"")}-${e.format??"unknown"}.json`,source:JSON.stringify(r,void 0,2),type:"asset"})},name:"packem:metafile"}),"metafilePlugin");var sk=Object.defineProperty,ak=g((e,t)=>sk(e,"name",{value:t,configurable:!0}),"a$h"),lk=Object.defineProperty,ck=ak((e,t)=>lk(e,"name",{value:t,configurable:!0}),"l"),pk=Object.defineProperty,uk=ck((e,t)=>pk(e,"name",{value:t,configurable:!0}),"r");const dk=/^file:\/\//,Mm=uk(()=>({name:"packem:resolve-file-url",resolveId:{filter:{id:dk},handler(e){if(e.startsWith("file://"))return vd(e)}}}),"resolveFileUrl");var fk=Object.defineProperty,mk=g((e,t)=>fk(e,"name",{value:t,configurable:!0}),"a$g"),hk=Object.defineProperty,gk=mk((e,t)=>hk(e,"name",{value:t,configurable:!0}),"n"),vk=Object.defineProperty,bk=gk((e,t)=>vk(e,"name",{value:t,configurable:!0}),"s");const yk=/^(\w+)-runtime$/,$k=bk(e=>{const t=Et(e).split(".");if(t.length>=2){const[r,n]=t.slice(-2),i=t[0]??"",o=yk.exec(r)?.[1];if(go.includes(n)&&o&&o.length>0)return`${i}-${o}`}},"getCustomModuleLayer");var wk=Object.defineProperty,xk=g((e,t)=>wk(e,"name",{value:t,configurable:!0}),"a$f"),jk=Object.defineProperty,kk=xk((e,t)=>jk(e,"name",{value:t,configurable:!0}),"t"),Ek=Object.defineProperty,Sk=kk((e,t)=>Ek(e,"name",{value:t,configurable:!0}),"t");const Ok=/^use /,Nn=Sk(e=>(e.preserveDirectives??{directives:[]}).directives.map(t=>t.replace(Ok,"")).find(t=>t!=="strict"),"getModuleLayer");var Ak=Object.defineProperty,Pk=g((e,t)=>Ak(e,"name",{value:t,configurable:!0}),"w$d"),Ck=Object.defineProperty,Rk=Pk((e,t)=>Ck(e,"name",{value:t,configurable:!0}),"I"),Tk=Object.defineProperty,no=Rk((e,t)=>Tk(e,"name",{value:t,configurable:!0}),"p");const Nk=/[\\/]node_modules[\\/]@swc[\\/]helper/,ys=Ev(e=>{let t=0;for(let r=0;r<e.length;r+=1)t=(t<<5)-t+e.codePointAt(r);return(t>>>0).toString(36).slice(0,3)}),Im=no((e,t,r,n=new Set)=>{if(r.has(e))return r.get(e);if(n.has(e))return;n.add(e);const i=t(e);if(!i){r.set(e,void 0);return}const o=Nn(i.meta);if(o)return r.set(e,o),o;let s;for(const a of i.importers){const l=Im(a,t,r,n);if(l){s=l;break}}return r.set(e,s),s},"getEffectiveModuleLayer"),_k=no((e,t,r)=>{const n=t(e);if(!n)return new Set;const i=new Set;for(const o of n.importers){const s=t(o);if(!s)continue;const a=Nn(s.meta);if(a)i.add(a);else{const l=Im(o,t,r,new Set([e]));l&&i.add(l)}}return i},"getImporterLayers"),Mk=no((e,t,r=!0)=>{const n=new Map,i=new Map;return no(function(o,s){if(Nk.test(o))return"cc";const a=s.getModuleInfo(o);if(!a)return;const{isEntry:l}=a,c=a.meta;let p=Nn(c);if(p&&(p=ys(p)),!l){const u=n.get(o);if(u)return u;const d=$k(o);if(d)return n.set(o,d),d}if(l&&p){const u=typeof s.getModuleIds=="function"?s.getModuleIds():(()=>{const d=new Set,f=[o];for(;f.length>0;){const m=f.pop();if(d.has(m))continue;d.add(m);const h=s.getModuleInfo(m);if(h)for(const v of h.importedIds)d.has(v)||f.push(v)}return d})();for(const d of u){const f=s.getModuleInfo(d);f&&Nn(f.meta)===p&&(e.has(d)||e.set(d,new Set),e.get(d).add([o,p]))}}if(r&&!p&&!l){const u=_k(o,s.getModuleInfo,i);if(u.size>1){if(n.has(o))return n.get(o);const d=Et(o,Fr(o)),f=[...u].toSorted((h,v)=>h.localeCompare(v)).join("-"),m=`${d}-${ys(f)}`;return n.set(o,m),m}}if(p&&!l&&e.has(o)){const u=[...e.get(o)];if(u.some(([h])=>{if(t.some(v=>v.path===h)){const v=s.getModuleInfo(h);return Nn(v?v.meta:{})===p}return!1}))return;if(u.every(([,h])=>h===p))return n.has(o)?n.get(o):void 0;const d=Et(o,Fr(o)),f=ys(p),m=`${d}-${f}`;return n.set(o,m),m}},"splitChunks")},"createSplitChunks");var Ik=Object.defineProperty,Wk=g((e,t)=>Ik(e,"name",{value:t,configurable:!0}),"i$a"),Bk=Object.defineProperty,Dk=Wk((e,t)=>Bk(e,"name",{value:t,configurable:!0}),"i"),Fk=Object.defineProperty,Lk=Dk((e,t)=>Fk(e,"name",{value:t,configurable:!0}),"i");const Do=Lk((e,t)=>{let r={};return e.name&&(r[e.name]=t.rootDir),r={...r,...t.alias},t.rollup.alias&&t.rollup.alias.entries&&(Array.isArray(t.rollup.alias.entries)?Object.assign(r,Object.fromEntries(t.rollup.alias.entries.map(n=>[n.find,n.replacement]))):Object.assign(r,t.rollup.alias.entries)),r},"resolveAliases");var zk=Object.defineProperty,qk=g((e,t)=>zk(e,"name",{value:t,configurable:!0}),"u$j"),Hk=Object.defineProperty,Jk=qk((e,t)=>Hk(e,"name",{value:t,configurable:!0}),"u"),Uk=Object.defineProperty,Sl=Jk((e,t)=>Uk(e,"name",{value:t,configurable:!0}),"a");const Gk=/\.tsx?$/,Vk=/['"]use memo['"]/,Kk=Sl(e=>e.find(t=>t==="babel-plugin-react-compiler"||Array.isArray(t)&&t[0]==="babel-plugin-react-compiler"),"getReactCompilerPlugin"),Yk=Sl((e,t)=>{if(e.length===0)return;const r=Kk(e);if(!(!r||!Array.isArray(r))&&r[1]?.compilationMode==="annotation"&&!Vk.test(t)){const n=e.indexOf(r);n!==-1&&e.splice(n,1)}},"filterReactCompilerByAnnotation"),Xk=Sl(async(e,t,{filename:r,generatorOpts:n,sourceFileName:i,...o})=>{let s=[];o.plugins&&Array.isArray(o.plugins)&&(s=[...o.plugins]),s.length>0&&Yk(s,e);const a=[];(t.endsWith(".jsx")||t.endsWith(".tsx"))&&a.push("jsx"),Gk.test(t)&&a.push("typescript");const l=o.parserOpts?.plugins;l&&Array.isArray(l)&&a.unshift(...l);const c=[...new Set(a)],p=await zv(e,{...o,filename:r??t,generatorOpts:{...n,decoratorsBeforeExport:!0,importAttributesKeyword:"with"},parserOpts:{...o.parserOpts,allowAwaitOutsideFunction:!0,plugins:c.length>0?c:[],sourceType:"module"},plugins:s.length>0?s:[],sourceFileName:i??t});if(p?.code)return{code:p.code,map:p.map??void 0}},"transformCode");var Zk=Object.defineProperty,Qk=g((e,t)=>Zk(e,"name",{value:t,configurable:!0}),"b$h"),eE=Object.defineProperty,tE=Qk((e,t)=>eE(e,"name",{value:t,configurable:!0}),"b"),rE=Object.defineProperty,zn=tE((e,t)=>rE(e,"name",{value:t,configurable:!0}),"i");const nE=20,iE=4,oE=yd("babel-runtime","plugins","babel","worker.js"),sE=zn(e=>{const t=zn(r=>{if(r===null)return!0;if(Array.isArray(r))return r.every(n=>t(n));switch(typeof r){case"boolean":case"number":case"string":case"undefined":return!0;case"object":return Object.values(r).every(n=>t(n));default:return!1}},"isSerializable");for(const r of Object.keys(e))if(!t(e[r]))return r},"findNonSerializableOption"),aE=zn(()=>{let e;try{e=Ea(vd(import.meta.url))}catch{return}for(let t=0;t<6;t+=1){const r=yd(e,oE);if(el(r))return r;const n=Ea(e);if(n===e)break;e=n}},"resolveWorkerScript"),lE=zn(({exclude:e,filename:t,generatorOpts:r,include:n,parallel:i=!0,parallelThreshold:o=nE,sourceFileName:s,...a})=>{const l=$t(n,e??Zt),c={...a,filename:t,generatorOpts:r,sourceFileName:s};let p=0,u,d=i===!1;const f=zn(()=>{if(d)return;if(u)return u;if(p<o)return;if(sE(c)!==void 0){d=!0;return}const m=aE();if(!m){d=!0;return}const h=typeof i=="number"?i:Math.min(Wv().length,iE);return u=Lv.pool(m,{maxWorkers:h,workerType:"thread"}),u},"ensurePool");return{async closeBundle(){this.meta.watchMode||(await u?.terminate(),u=void 0)},async closeWatcher(){await u?.terminate(),u=void 0},name:"packem:babel",async transform(m,h){if(!l(h))return;p+=1;const v=f();if(v)return v.exec("transform",[m,h,c]);const b=await Xk(m,h,c);if(b)return{code:b.code,map:b.map??void 0}}}},"babelTransformPlugin");var cE=Object.defineProperty,pE=g((e,t)=>cE(e,"name",{value:t,configurable:!0}),"l$h"),uE=Object.defineProperty,dE=pE((e,t)=>uE(e,"name",{value:t,configurable:!0}),"l"),fE=Object.defineProperty,mE=dE((e,t)=>fE(e,"name",{value:t,configurable:!0}),"u");const hE=mE((e,t)=>{const r=new Map,n={copyOnce:!0,exactFileNames:!0,flatten:!1,...e};let{targets:i}=n;return Array.isArray(i)?i=i.map(o=>{if(typeof o=="string")return{src:o};if(typeof o=="object"&&"src"in o)return o}).filter(Boolean):typeof i=="string"&&(i=[{src:i}]),{async buildStart(){const o=await Promise.all(i.flatMap(s=>Array.isArray(s.src)?s.src.map(a=>({...s,src:a})):[s]).map(async s=>await Qg(ja(s.src),{ignore:ja(s.exclude).filter(Boolean)}).then(a=>({dest:s.dest??"",parent:ev(s.src),src:a}))));for(const s of o)for(const a of s.src){let l;r.has(a)?l=r.get(a):(l={copied:[],dest:[],timestamp:0},r.set(a,l));const c=n.flatten?td(s.dest):G(s.dest,Be(s.parent,ne(a)));l.dest.includes(c)||l.dest.push(c),this.addWatchFile(a)}t.info({message:"Copying files...",prefix:"plugin:copy"}),await Promise.all(Array.from(r,async([s,a])=>{let l;try{const c=await Xn(s);if(!c.isFile())return;const p=c.mtime.getTime();p>a.timestamp&&(a.timestamp=p,a.copied=[]),l=await nr(s,{buffer:!0})}catch(c){t.error({context:[c],message:`error reading file ${s}`,prefix:"plugin:copy"});return}for(const c of a.dest){if(n.copyOnce&&a.copied.includes(c))continue;const p=Et(s),u=G(c,p);try{this.emitFile({[n.exactFileNames?"fileName":"name"]:u,source:l,type:"asset"}),t.debug({message:`copied ${s} → ${u}`,prefix:"plugin:copy"}),a.copied.push(c)}catch(d){t.error({context:[d],message:`error copying file ${s} → ${u}`,prefix:"plugin:copy"})}}}))},name:"packem:copy"}},"copyPlugin");var gE=Object.defineProperty,Wm=g((e,t)=>gE(e,"name",{value:t,configurable:!0}),"s$f"),vE=Object.defineProperty,Ol=Wm((e,t)=>vE(e,"name",{value:t,configurable:!0}),"m");const Bm={"application/prs.cww":["cww"],"application/prs.xsf+xml":["xsf"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["*xfdf"],"application/vnd.age":["age"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.autodesk.fbx":["fbx"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dcmp+xml":["dcmp"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["*fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.slides":["ggs"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.drawing":["gdraw"],"application/vnd.google-apps.form":["gform"],"application/vnd.google-apps.jam":["gjam"],"application/vnd.google-apps.map":["gmap"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.script":["gscript"],"application/vnd.google-apps.site":["gsite"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.gov.sk.xmldatacontainer+xml":["xdcf"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mapbox-vector-tile":["mvt"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["*mpp","mpt"],"application/vnd.ms-visio.viewer":["vdx"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.nato.bindingdataobject+xml":["bdo"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.procrate.brushset":["brushset"],"application/vnd.procreate.brush":["brush"],"application/vnd.procreate.dream":["drm"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.pwg-xhtml-print+xml":["xhtm"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml","uo"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw","vsdx","vtx"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blender":["blend"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-compressed":["*rar"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-ipynb+json":["ipynb"],"application/x-iso9660-image":["*iso"],"application/x-iwork-keynote-sffkey":["*key"],"application/x-iwork-numbers-sffnumbers":["*numbers"],"application/x-iwork-pages-sffpages":["*pages"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["*prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["*sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zip-compressed":["*zip"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["*aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif","btf"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.blockfact.facti":["facti"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-adobe-dng":["dng"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.bary":["bary"],"model/vnd.cld":["cld"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["*mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.pytha.pyox":["pyo","pyox"],"model/vnd.sap.vds":["vds"],"model/vnd.usda":["usda"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.familysearch.gedcom":["ged"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]};Object.freeze(Bm);const Dm={"application/andrew-inset":["ez"],"application/appinstaller":["appinstaller"],"application/applixware":["aw"],"application/appx":["appx"],"application/appxbundle":["appxbundle"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/automationml-aml+xml":["aml"],"application/automationml-amlx+zip":["amlx"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cpl+xml":["cpl"],"application/cu-seeme":["cu"],"application/cwl":["cwl"],"application/dash+xml":["mpd"],"application/dash-patch+xml":["mpp"],"application/davmount+xml":["davmount"],"application/dicom":["dcm"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdf":["fdf"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["*js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/media-policy-dataset+xml":["mpf"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["*mp4","*mpg4","mp4s","m4p"],"application/msix":["msix"],"application/msixbundle":["msixbundle"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg","one","onea"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-keys":["asc"],"application/pgp-signature":["sig","*asc"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/sql":["sql"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/watcherinfo+xml":["wif"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xfdf":["xfdf"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"application/zip+dotlottie":["lottie"],"audio/3gpp":["*3gpp"],"audio/aac":["adts","aac"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a","m4b"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avci":["avci"],"image/avcs":["avcs"],"image/avif":["avif"],"image/bmp":["bmp","dib"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/dpx":["dpx"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/ief":["ief"],"image/jaii":["jaii"],"image/jais":["jais"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpg","jpeg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm","jpgm"],"image/jpx":["jpx","jpf"],"image/jxl":["jxl"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/pjpeg":["jfif"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime","mht","mhtml"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/jt":["jt"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/prc":["prc"],"model/step":["step","stp","stpnc","p21","210"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/u3d":["u3d"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/javascript":["js","mjs"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["md","markdown"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/wgsl":["wgsl"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","*jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts","m2t","m2ts","mts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};Object.freeze(Dm);var bE=Object.defineProperty,yE=Ol((e,t)=>bE(e,"name",{value:t,configurable:!0}),"g"),Ve=Ol(function(e,t,r,n){if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},"n"),kr,Sn,Vt;let $E=class{static{g(this,"j")}static{Wm(this,"w")}static{Ol(this,"p")}static{yE(this,"Mime")}constructor(...t){kr.set(this,new Map),Sn.set(this,new Map),Vt.set(this,new Map);for(const r of t)this.define(r)}define(t,r=!1){for(let[n,i]of Object.entries(t)){n=n.toLowerCase(),i=i.map(a=>a.toLowerCase()),Ve(this,Vt,"f").has(n)||Ve(this,Vt,"f").set(n,new Set);const o=Ve(this,Vt,"f").get(n);let s=!0;for(let a of i){const l=a.startsWith("*");if(a=l?a.slice(1):a,o?.add(a),s&&Ve(this,Sn,"f").set(n,a),s=!1,l)continue;const c=Ve(this,kr,"f").get(a);if(c&&c!=n&&!r)throw new Error(`"${n} -> ${a}" conflicts with "${c} -> ${a}". Pass \`force=true\` to override this definition.`);Ve(this,kr,"f").set(a,n)}}return this}getType(t){if(typeof t!="string")return null;const r=t.replace(/^.*[/\\]/s,"").toLowerCase(),n=r.replace(/^.*\./s,"").toLowerCase(),i=r.length<t.length;return!(n.length<r.length-1)&&i?null:Ve(this,kr,"f").get(n)??null}getExtension(t){return typeof t!="string"?null:(t=t?.split?.(";")[0],(t&&Ve(this,Sn,"f").get(t.trim().toLowerCase()))??null)}getAllExtensions(t){return typeof t!="string"?null:Ve(this,Vt,"f").get(t.toLowerCase())??null}_freeze(){this.define=()=>{throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances")},Object.freeze(this);for(const t of Ve(this,Vt,"f").values())Object.freeze(t);return this}_getTestState(){return{types:Ve(this,kr,"f"),extensions:Ve(this,Sn,"f")}}};kr=new WeakMap,Sn=new WeakMap,Vt=new WeakMap;const Fm=new $E(Dm,Bm)._freeze();var wE=Object.defineProperty,xE=g((e,t)=>wE(e,"name",{value:t,configurable:!0}),"c$j"),jE=Object.defineProperty,kE=xE((e,t)=>jE(e,"name",{value:t,configurable:!0}),"c"),EE=Object.defineProperty,SE=kE((e,t)=>EE(e,"name",{value:t,configurable:!0}),"l");const OE=/\?data-uri/,AE=SE((e={})=>{const t=$t(e.include??[OE],e.exclude);return{async load(r){if(!t(r)||!r.includes("?data-uri"))return;const n=new URL(r,"file://"),i=n.pathname,o=n.searchParams.get("encoding")??"tiny",s=n.searchParams.has("srcset")||e.srcset;this.addWatchFile(i);const a=Fm.getType(i)??"application/octet-stream";if(a==="image/svg+xml"){const p=await nr(i,{buffer:!1}),u=o==="css"?$v(p):wv(p);return`export default "${s?u.replaceAll(" ","%20"):u}"`}const l=await nr(i,{buffer:!0}),c=Buffer.from(l).toString("base64");return`export default "${`${a.startsWith("text/")?`data:${a};charset=utf-8;base64,`:`data:${a};base64,`}${c}`}"`},name:"packem:data-uri"}},"dataUriPlugin");var PE=Object.defineProperty,CE=g((e,t)=>PE(e,"name",{value:t,configurable:!0}),"v$h"),RE=Object.defineProperty,TE=CE((e,t)=>RE(e,"name",{value:t,configurable:!0}),"v"),NE=Object.defineProperty,Ee=TE((e,t)=>NE(e,"name",{value:t,configurable:!0}),"u");const _E=/\.[mc]?tsx?(?:\?.*)?$/,ME=/(?:\.[tj]sx?|\/index\.[tj]sx?)(?:\?.*)?$/,IE=/^\s*export/,WE=/^(?:import|export)\s+([\w$]+)/,BE=/([\w$]+)\s*,\s*\{|\}\s*,\s*([\w$]+)/,$s=/[{,]\s*(type\s+)?([\w$]+)(?:\s+as\s+([\w$]+))?/gi,DE=/default\s+([a-zA-Z_$][\w$]*)(?:[;\n]|$)/,FE=/([\w$]+)\s*as\s*$/,LE=/^export\s+\*(?!\s+as)/,zE=/\bas\b/,qE={exports:[],facade:!1,imports:[]},Lm=Ee(e=>_E.test(e),"isSourceFile"),zm=Ee(e=>e.includes("/build/cache/vite/")||e.includes("/node_modules/"),"isIgnoredModule"),HE=Ee((e,t)=>zm(e)?!1:ME.test(e)?!0:t.possibleBarrelFiles?t.possibleBarrelFiles.some(r=>typeof r=="string"?e.includes(r):r.test(e)):!1,"isPossibleBarrelSpecifier"),qm=Ee(e=>IE.test(e)?"export":"import","getDeclarationKind"),{parseAsync:JE}=Uv,Hm=Ee(async(e,t,r)=>{try{const{output:n}=await JE({input:[{code:t,filename:e}]});return n[0]}catch(n){return r.debug({message:`Failed to parse ${e}:
|
|
63
|
+
${n instanceof Error?n.message:String(n)}`,prefix:"plugin:debarrel"}),qE}},"safeParse"),UE=Ee(async(e,t,r,n)=>{const i=e.parseCache.get(t);if(i!==void 0)return i;const o=await Hm(t,r,n);return e.parseCache.set(t,o),o},"parsePotentialBarrelFile"),Jm=Ee((e,t)=>{const r=e.fileCache.get(t);if(r!==void 0)return r;const n=$d.readFile(t,"utf8");return e.fileCache.set(t,n),n},"readFileCached"),Um=Ee(e=>{$s.lastIndex=0;const t=[];if(e.includes("*"))return t;if(!e.includes("{")){const i=WE.exec(e);return i&&t.push({imported:"default",local:i[1]}),t}const r=BE.exec(e);r&&t.push({imported:"default",local:r[1]??r[2]});let n=$s.exec(e);for(;n!==null;)!n[1]&&n[2]&&t.push({imported:n[2],local:n[3]}),n=$s.exec(e);return t},"getImportNames"),GE=Ee((e,t,r)=>{let n=e.ln,i=t.find(o=>o.ss<e.s&&o.se>e.e&&o.d===-1);if(!i?.n){const o=n??DE.exec(r.slice(e.s))?.[1];o&&(i=t.find(s=>{const a=Um(r.slice(s.ss,s.s)).find(l=>l.local===o);return a&&(n=a.imported),a}))}if(i&&!n){const o=r.slice(i.ss,e.s);if(!o.includes("*")){const s=FE.exec(o)?.[1];s&&(n=s)}}return{imp:i,localExportName:n}},"findMatchingImport"),VE=Ee((e,t)=>qm(e)!=="import"||!zE.test(e)?void 0:new RegExp(String.raw`(\w+)\s+as\s+${t}(?!\w)`).exec(e)?.[0],"findAliasedImportName");let qn;const KE=Ee(async(e,t,r,n,i,o,s,a)=>{const{resolve:l}=e,c=GE(n,i,r),{imp:p,localExportName:u}=c;if(!p?.n)return{exportName:o,id:t,resolved:!0};if(p.d>-1)return{exportName:o,id:t,resolved:!0};const d=r.slice(p.ss,n.s),f=VE(d,o),m=(await l(p.n,t))?.id;return m?HE(m,s)?qn(e,m,u??n.n,s,a):{aliasedImportName:f,exportName:u??o,id:m,resolved:!1}:{aliasedImportName:f,exportName:u,id:t,resolved:!1}},"resolveExportThroughBarrel"),YE=Ee(async(e,t,r,n,i,o,s)=>{const a=n.filter(l=>LE.test(r.slice(l.ss,l.s)));if(a.length===1){const l=a[0]?.n,c=(l?await e.resolve(l,t):void 0)?.id;if(!c)return;const p=await qn(e,c,i,o,s);if(p.resolved)return p}else if(a.length>1){const l=(await Promise.all(a.map(async c=>{const p=c.n;if(!p)return;const u=(await e.resolve(p,t))?.id;if(u)return qn(e,u,i,o,s)}))).find(c=>c?.resolved);if(l)return l}},"resolveWildcardReExports");qn=Ee(async(e,t,r,n,i)=>{const o=await Jm(e,t),{exports:s,imports:a}=await UE(e,t,o,i);for(const l of s)if(l.n===r)return await KE(e,t,o,l,a,r,n,i);return await YE(e,t,o,a,r,n,i)||{exportName:r,id:t,resolved:!1}},"resolveThroughBarrel");const XE=Ee((e,t,r)=>{const{aliasedImportName:n,exportName:i}=e,o=t.local??t.imported;if(n)return`{${n}}`;if(i==="default"&&r!=="export")return o;const s=i??o;return`{${s!==o?`${s} as ${o}`:s}}`},"getDeclarationClause"),ZE=Ee(async(e,t,r,n,i)=>{const o=[],s=await Jm(e,t),{imports:a}=await Hm(t,s,i);return await Promise.all(a.map(async l=>{if(!l.n||l.d!==-1)return;const c=s.slice(l.ss,l.s),p=Um(c);if(p.length===0)return;const u=(await e.resolve(l.n,t))?.id;if(!u||!Lm(u)||zm(u))return;const d=qm(c);try{const f=await Promise.all(p.map(async m=>{const h=await qn(e,u,m.imported,n,i),v=XE(h,m,d),b=JSON.stringify(h.id);return`${d} ${v} from ${b}`}));o.push([l.ss,l.se,f.join(";")])}catch(f){i.warn({context:{error:f},message:String(f),prefix:"plugin:debarrel"})}})),o},"getDebarrelModifications"),QE=Ee((e,t,r,n)=>{if(r.length===0)return;const i=new Te(t,{filename:e});for(const[o,s,a]of r)i.update(o,s,a);return{code:i.toString(),map:n?i.generateMap({file:e}):void 0}},"applyModifications"),eS=Ee((e,t)=>{const r=new Map,n=new Map,i=Ee(()=>{r.clear(),n.clear()},"purgeCaches"),o=e.include?$t(e.include,[]):void 0;let s=!0;return{buildEnd:i,buildStart:i,async load(a){const l=r.get(a);if(l)return await l},name:"packem:debarrel",options(a){const{output:l}=a;let c;Array.isArray(l)?c=l[0]?.sourcemap:l&&(c=l.sourcemap),c===!1&&(s=!1)},async transform(a,l){if(l.includes("\0")||l.includes("?")||!Lm(l)||o&&!o(l))return;const c={fileCache:r,parseCache:n,resolve:this.resolve.bind(this)},p=await ZE(c,l,a,e,t);return QE(l,a,p,s)},watchChange(a){r.delete(a),n.delete(a)}}},"debarrelPlugin");var ws,ep;function tS(){if(ep)return ws;ep=1;var e=Object.defineProperty,t=g((i,o)=>e(i,"name",{value:o,configurable:!0}),"u");const r=De();return ws=t((i,o,s,a,l)=>{typeof s=="string"&&(l=a,a=s,s=void 0);try{return new r(i instanceof r?i.version:i,s).inc(o,a,l).version}catch{return null}},"inc"),ws}g(tS,"requireInc");var xs,tp;function rS(){if(tp)return xs;tp=1;var e=Object.defineProperty,t=g((i,o)=>e(i,"name",{value:o,configurable:!0}),"u");const r=Kn();return xs=t((i,o)=>{const s=r(i,null,!0),a=r(o,null,!0),l=s.compare(a);if(l===0)return null;const c=l>0,p=c?s:a,u=c?a:s,d=!!p.prerelease.length;if(u.prerelease.length&&!d){if(!u.patch&&!u.minor)return"major";if(u.compareMain(p)===0)return u.minor&&!u.patch?"minor":"patch"}const f=d?"pre":"";return s.major!==a.major?f+"major":s.minor!==a.minor?f+"minor":s.patch!==a.patch?f+"patch":"prerelease"},"diff"),xs}g(rS,"requireDiff");var js,rp;function nS(){if(rp)return js;rp=1;var e=Object.defineProperty,t=g((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=De();return js=t((i,o)=>new r(i,o).major,"major"),js}g(nS,"requireMajor");var ks,np;function iS(){if(np)return ks;np=1;var e=Object.defineProperty,t=g((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=De();return ks=t((i,o)=>new r(i,o).minor,"minor"),ks}g(iS,"requireMinor");var Es,ip;function oS(){if(ip)return Es;ip=1;var e=Object.defineProperty,t=g((i,o)=>e(i,"name",{value:o,configurable:!0}),"t");const r=De();return Es=t((i,o)=>new r(i,o).patch,"patch"),Es}g(oS,"requirePatch");var Ss,op;function sS(){if(op)return Ss;op=1;var e=Object.defineProperty,t=g((i,o)=>e(i,"name",{value:o,configurable:!0}),"t");const r=Kn();return Ss=t((i,o)=>{const s=r(i,o);return s&&s.prerelease.length?s.prerelease:null},"prerelease"),Ss}g(sS,"requirePrerelease");var Os,sp;function at(){if(sp)return Os;sp=1;var e=Object.defineProperty,t=g((i,o)=>e(i,"name",{value:o,configurable:!0}),"c");const r=De();return Os=t((i,o,s)=>new r(i,s).compare(new r(o,s)),"compare"),Os}g(at,"requireCompare");var As,ap;function aS(){if(ap)return As;ap=1;var e=Object.defineProperty,t=g((i,o)=>e(i,"name",{value:o,configurable:!0}),"o");const r=at();return As=t((i,o,s)=>r(o,i,s),"rcompare"),As}g(aS,"requireRcompare");var Ps,lp;function lS(){if(lp)return Ps;lp=1;var e=Object.defineProperty,t=g((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=at();return Ps=t((i,o)=>r(i,o,!0),"compareLoose"),Ps}g(lS,"requireCompareLoose");var Cs,cp;function Al(){if(cp)return Cs;cp=1;var e=Object.defineProperty,t=g((i,o)=>e(i,"name",{value:o,configurable:!0}),"o");const r=De();return Cs=t((i,o,s)=>{const a=new r(i,s),l=new r(o,s);return a.compare(l)||a.compareBuild(l)},"compareBuild"),Cs}g(Al,"requireCompareBuild");var Rs,pp;function cS(){if(pp)return Rs;pp=1;var e=Object.defineProperty,t=g((i,o)=>e(i,"name",{value:o,configurable:!0}),"e");const r=Al();return Rs=t((i,o)=>i.sort((s,a)=>r(s,a,o)),"sort"),Rs}g(cS,"requireSort");var Ts,up;function pS(){if(up)return Ts;up=1;var e=Object.defineProperty,t=g((i,o)=>e(i,"name",{value:o,configurable:!0}),"e");const r=Al();return Ts=t((i,o)=>i.sort((s,a)=>r(a,s,o)),"rsort"),Ts}g(pS,"requireRsort");var Ns,dp;function Fo(){if(dp)return Ns;dp=1;var e=Object.defineProperty,t=g((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=at();return Ns=t((i,o,s)=>r(i,o,s)>0,"gt"),Ns}g(Fo,"requireGt");var _s,fp;function Pl(){if(fp)return _s;fp=1;var e=Object.defineProperty,t=g((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=at();return _s=t((i,o,s)=>r(i,o,s)<0,"lt"),_s}g(Pl,"requireLt");var Ms,mp;function Gm(){if(mp)return Ms;mp=1;var e=Object.defineProperty,t=g((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=at();return Ms=t((i,o,s)=>r(i,o,s)===0,"eq"),Ms}g(Gm,"requireEq");var Is,hp;function Vm(){if(hp)return Is;hp=1;var e=Object.defineProperty,t=g((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=at();return Is=t((i,o,s)=>r(i,o,s)!==0,"neq"),Is}g(Vm,"requireNeq");var Ws,gp;function Cl(){if(gp)return Ws;gp=1;var e=Object.defineProperty,t=g((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=at();return Ws=t((i,o,s)=>r(i,o,s)>=0,"gte"),Ws}g(Cl,"requireGte");var Bs,vp;function Rl(){if(vp)return Bs;vp=1;var e=Object.defineProperty,t=g((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=at();return Bs=t((i,o,s)=>r(i,o,s)<=0,"lte"),Bs}g(Rl,"requireLte");var Ds,bp;function Km(){if(bp)return Ds;bp=1;var e=Object.defineProperty,t=g((c,p)=>e(c,"name",{value:p,configurable:!0}),"n");const r=Gm(),n=Vm(),i=Fo(),o=Cl(),s=Pl(),a=Rl();return Ds=t((c,p,u,d)=>{switch(p){case"===":return typeof c=="object"&&(c=c.version),typeof u=="object"&&(u=u.version),c===u;case"!==":return typeof c=="object"&&(c=c.version),typeof u=="object"&&(u=u.version),c!==u;case"":case"=":case"==":return r(c,u,d);case"!=":return n(c,u,d);case">":return i(c,u,d);case">=":return o(c,u,d);case"<":return s(c,u,d);case"<=":return a(c,u,d);default:throw new TypeError(`Invalid operator: ${p}`)}},"cmp"),Ds}g(Km,"requireCmp");var Fs,yp;function uS(){if(yp)return Fs;yp=1;var e=Object.defineProperty,t=g((a,l)=>e(a,"name",{value:l,configurable:!0}),"u");const r=De(),n=Kn(),{safeRe:i,t:o}=ho();return Fs=t((a,l)=>{if(a instanceof r)return a;if(typeof a=="number"&&(a=String(a)),typeof a!="string")return null;l=l||{};let c=null;if(!l.rtl)c=a.match(l.includePrerelease?i[o.COERCEFULL]:i[o.COERCE]);else{const h=l.includePrerelease?i[o.COERCERTLFULL]:i[o.COERCERTL];let v;for(;(v=h.exec(a))&&(!c||c.index+c[0].length!==a.length);)(!c||v.index+v[0].length!==c.index+c[0].length)&&(c=v),h.lastIndex=v.index+v[1].length+v[2].length;h.lastIndex=-1}if(c===null)return null;const p=c[2],u=c[3]||"0",d=c[4]||"0",f=l.includePrerelease&&c[5]?`-${c[5]}`:"",m=l.includePrerelease&&c[6]?`+${c[6]}`:"";return n(`${p}.${u}.${d}${f}${m}`,l)},"coerce"),Fs}g(uS,"requireCoerce");var Ls,$p;function dS(){if($p)return Ls;$p=1;var e=Object.defineProperty,t=g((c,p)=>e(c,"name",{value:p,configurable:!0}),"t");const r=Kn(),n=Xa(),i=De(),o=t((c,p,u)=>{if(!n.RELEASE_TYPES.includes(p))return null;const d=s(c,u);return d&&a(d,p)},"truncate"),s=t((c,p)=>{const u=c instanceof i?c.version:c;return r(u,p)},"cloneInputVersion"),a=t((c,p)=>{if(l(p))return c.version;switch(c.prerelease=[],p){case"major":c.minor=0,c.patch=0;break;case"minor":c.patch=0;break}return c.format()},"doTruncation"),l=t(c=>c.startsWith("pre"),"isPrerelease");return Ls=o,Ls}g(dS,"requireTruncate");var zs,wp;function fS(){if(wp)return zs;wp=1;var e=Object.defineProperty,t=g((n,i)=>e(n,"name",{value:i,configurable:!0}),"i");class r{static{g(this,"LRUCache")}static{t(this,"LRUCache")}constructor(){this.max=1e3,this.map=new Map}get(i){const o=this.map.get(i);if(o!==void 0)return this.map.delete(i),this.map.set(i,o),o}delete(i){return this.map.delete(i)}set(i,o){if(!this.delete(i)&&o!==void 0){if(this.map.size>=this.max){const s=this.map.keys().next().value;this.delete(s)}this.map.set(i,o)}return this}}return zs=r,zs}g(fS,"requireLrucache");var qs,xp;function lt(){if(xp)return qs;xp=1;var e=Object.defineProperty,t=g((W,R)=>e(W,"name",{value:R,configurable:!0}),"o");const r=/\s+/g;class n{static{g(this,"Range")}static{t(this,"Range")}constructor(R,B){if(B=s(B),R instanceof n)return R.loose===!!B.loose&&R.includePrerelease===!!B.includePrerelease?R:new n(R.raw,B);if(R instanceof a)return this.raw=R.value,this.set=[[R]],this.formatted=void 0,this;if(this.options=B,this.loose=!!B.loose,this.includePrerelease=!!B.includePrerelease,this.raw=R.trim().replace(r," "),this.set=this.raw.split("||").map(I=>this.parseRange(I.trim())).filter(I=>I.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const I=this.set[0];if(this.set=this.set.filter(_=>!k(_[0])),this.set.length===0)this.set=[I];else if(this.set.length>1){for(const _ of this.set)if(_.length===1&&y(_[0])){this.set=[_];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let R=0;R<this.set.length;R++){R>0&&(this.formatted+="||");const B=this.set[R];for(let I=0;I<B.length;I++)I>0&&(this.formatted+=" "),this.formatted+=B[I].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(R){R=R.replace(w,"");const B=((this.options.includePrerelease&&v)|(this.options.loose&&b))+":"+R,I=o.get(B);if(I)return I;const _=this.options.loose,M=_?p[d.HYPHENRANGELOOSE]:p[d.HYPHENRANGE];R=R.replace(M,ee(this.options.includePrerelease)),l("hyphen replace",R),R=R.replace(p[d.COMPARATORTRIM],f),l("comparator trim",R),R=R.replace(p[d.TILDETRIM],m),l("tilde trim",R),R=R.replace(p[d.CARETTRIM],h),l("caret trim",R);let H=R.split(" ").map(Z=>$(Z,this.options)).join(" ").split(/\s+/).map(Z=>U(Z,this.options));_&&(H=H.filter(Z=>(l("loose invalid filter",Z,this.options),!!Z.match(p[d.COMPARATORLOOSE])))),l("range list",H);const z=new Map,F=H.map(Z=>new a(Z,this.options));for(const Z of F){if(k(Z))return[Z];z.set(Z.value,Z)}z.size>1&&z.has("")&&z.delete("");const Y=[...z.values()];return o.set(B,Y),Y}intersects(R,B){if(!(R instanceof n))throw new TypeError("a Range is required");return this.set.some(I=>x(I,B)&&R.set.some(_=>x(_,B)&&I.every(M=>_.every(H=>M.intersects(H,B)))))}test(R){if(!R)return!1;if(typeof R=="string")try{R=new c(R,this.options)}catch{return!1}for(let B=0;B<this.set.length;B++)if(X(this.set[B],R,this.options))return!0;return!1}}qs=n;const i=fS(),o=new i,s=ad(),a=Lo(),l=ld(),c=De(),{safeRe:p,src:u,t:d,comparatorTrimReplace:f,tildeTrimReplace:m,caretTrimReplace:h}=ho(),{FLAG_INCLUDE_PRERELEASE:v,FLAG_LOOSE:b}=Xa(),w=new RegExp(u[d.BUILD],"g"),k=t(W=>W.value==="<0.0.0-0","isNullSet"),y=t(W=>W.value==="","isAny"),x=t((W,R)=>{let B=!0;const I=W.slice();let _=I.pop();for(;B&&I.length;)B=I.every(M=>_.intersects(M,R)),_=I.pop();return B},"isSatisfiable"),$=t((W,R)=>(W=W.replace(p[d.BUILD],""),l("comp",W,R),W=j(W,R),l("caret",W),W=O(W,R),l("tildes",W),W=N(W,R),l("xrange",W),W=J(W,R),l("stars",W),W),"parseComparator"),E=t(W=>!W||W.toLowerCase()==="x"||W==="*","isX"),O=t((W,R)=>W.trim().split(/\s+/).map(B=>S(B,R)).join(" "),"replaceTildes"),S=t((W,R)=>{const B=R.loose?p[d.TILDELOOSE]:p[d.TILDE];return W.replace(B,(I,_,M,H,z)=>{l("tilde",W,I,_,M,H,z);let F;return E(_)?F="":E(M)?F=`>=${_}.0.0 <${+_+1}.0.0-0`:E(H)?F=`>=${_}.${M}.0 <${_}.${+M+1}.0-0`:z?(l("replaceTilde pr",z),F=`>=${_}.${M}.${H}-${z} <${_}.${+M+1}.0-0`):F=`>=${_}.${M}.${H} <${_}.${+M+1}.0-0`,l("tilde return",F),F})},"replaceTilde"),j=t((W,R)=>W.trim().split(/\s+/).map(B=>A(B,R)).join(" "),"replaceCarets"),A=t((W,R)=>{l("caret",W,R);const B=R.loose?p[d.CARETLOOSE]:p[d.CARET],I=R.includePrerelease?"-0":"";return W.replace(B,(_,M,H,z,F)=>{l("caret",W,_,M,H,z,F);let Y;return E(M)?Y="":E(H)?Y=`>=${M}.0.0${I} <${+M+1}.0.0-0`:E(z)?M==="0"?Y=`>=${M}.${H}.0${I} <${M}.${+H+1}.0-0`:Y=`>=${M}.${H}.0${I} <${+M+1}.0.0-0`:F?(l("replaceCaret pr",F),M==="0"?H==="0"?Y=`>=${M}.${H}.${z}-${F} <${M}.${H}.${+z+1}-0`:Y=`>=${M}.${H}.${z}-${F} <${M}.${+H+1}.0-0`:Y=`>=${M}.${H}.${z}-${F} <${+M+1}.0.0-0`):(l("no pr"),M==="0"?H==="0"?Y=`>=${M}.${H}.${z}${I} <${M}.${H}.${+z+1}-0`:Y=`>=${M}.${H}.${z}${I} <${M}.${+H+1}.0-0`:Y=`>=${M}.${H}.${z} <${+M+1}.0.0-0`),l("caret return",Y),Y})},"replaceCaret"),N=t((W,R)=>(l("replaceXRanges",W,R),W.split(/\s+/).map(B=>q(B,R)).join(" ")),"replaceXRanges"),q=t((W,R)=>{W=W.trim();const B=R.loose?p[d.XRANGELOOSE]:p[d.XRANGE];return W.replace(B,(I,_,M,H,z,F)=>{l("xRange",W,I,_,M,H,z,F);const Y=E(M),Z=Y||E(H),V=Z||E(z),P=V;return _==="="&&P&&(_=""),F=R.includePrerelease?"-0":"",Y?_===">"||_==="<"?I="<0.0.0-0":I="*":_&&P?(Z&&(H=0),z=0,_===">"?(_=">=",Z?(M=+M+1,H=0,z=0):(H=+H+1,z=0)):_==="<="&&(_="<",Z?M=+M+1:H=+H+1),_==="<"&&(F="-0"),I=`${_+M}.${H}.${z}${F}`):Z?I=`>=${M}.0.0${F} <${+M+1}.0.0-0`:V&&(I=`>=${M}.${H}.0${F} <${M}.${+H+1}.0-0`),l("xRange return",I),I})},"replaceXRange"),J=t((W,R)=>(l("replaceStars",W,R),W.trim().replace(p[d.STAR],"")),"replaceStars"),U=t((W,R)=>(l("replaceGTE0",W,R),W.trim().replace(p[R.includePrerelease?d.GTE0PRE:d.GTE0],"")),"replaceGTE0"),ee=t(W=>(R,B,I,_,M,H,z,F,Y,Z,V,P)=>(E(I)?B="":E(_)?B=`>=${I}.0.0${W?"-0":""}`:E(M)?B=`>=${I}.${_}.0${W?"-0":""}`:H?B=`>=${B}`:B=`>=${B}${W?"-0":""}`,E(Y)?F="":E(Z)?F=`<${+Y+1}.0.0-0`:E(V)?F=`<${Y}.${+Z+1}.0-0`:P?F=`<=${Y}.${Z}.${V}-${P}`:W?F=`<${Y}.${Z}.${+V+1}-0`:F=`<=${F}`,`${B} ${F}`.trim()),"hyphenReplace"),X=t((W,R,B)=>{for(let I=0;I<W.length;I++)if(!W[I].test(R))return!1;if(R.prerelease.length&&!B.includePrerelease){for(let I=0;I<W.length;I++)if(l(W[I].semver),W[I].semver!==a.ANY&&W[I].semver.prerelease.length>0){const _=W[I].semver;if(_.major===R.major&&_.minor===R.minor&&_.patch===R.patch)return!0}return!1}return!0},"testSet");return qs}g(lt,"requireRange");var Hs,jp;function Lo(){if(jp)return Hs;jp=1;var e=Object.defineProperty,t=g((u,d)=>e(u,"name",{value:d,configurable:!0}),"i");const r=Symbol("SemVer ANY");class n{static{g(this,"Comparator")}static{t(this,"Comparator")}static get ANY(){return r}constructor(d,f){if(f=i(f),d instanceof n){if(d.loose===!!f.loose)return d;d=d.value}d=d.trim().split(/\s+/).join(" "),l("comparator",d,f),this.options=f,this.loose=!!f.loose,this.parse(d),this.semver===r?this.value="":this.value=this.operator+this.semver.version,l("comp",this)}parse(d){const f=this.options.loose?o[s.COMPARATORLOOSE]:o[s.COMPARATOR],m=d.match(f);if(!m)throw new TypeError(`Invalid comparator: ${d}`);this.operator=m[1]!==void 0?m[1]:"",this.operator==="="&&(this.operator=""),m[2]?this.semver=new c(m[2],this.options.loose):this.semver=r}toString(){return this.value}test(d){if(l("Comparator.test",d,this.options.loose),this.semver===r||d===r)return!0;if(typeof d=="string")try{d=new c(d,this.options)}catch{return!1}return a(d,this.operator,this.semver,this.options)}intersects(d,f){if(!(d instanceof n))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new p(d.value,f).test(this.value):d.operator===""?d.value===""?!0:new p(this.value,f).test(d.semver):(f=i(f),f.includePrerelease&&(this.value==="<0.0.0-0"||d.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||d.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&d.operator.startsWith(">")||this.operator.startsWith("<")&&d.operator.startsWith("<")||this.semver.version===d.semver.version&&this.operator.includes("=")&&d.operator.includes("=")||a(this.semver,"<",d.semver,f)&&this.operator.startsWith(">")&&d.operator.startsWith("<")||a(this.semver,">",d.semver,f)&&this.operator.startsWith("<")&&d.operator.startsWith(">")))}}Hs=n;const i=ad(),{safeRe:o,t:s}=ho(),a=Km(),l=ld(),c=De(),p=lt();return Hs}g(Lo,"requireComparator");var Js,kp;function si(){if(kp)return Js;kp=1;var e=Object.defineProperty,t=g((i,o)=>e(i,"name",{value:o,configurable:!0}),"t");const r=lt();return Js=t((i,o,s)=>{try{o=new r(o,s)}catch{return!1}return o.test(i)},"satisfies"),Js}g(si,"requireSatisfies");var Us,Ep;function mS(){if(Ep)return Us;Ep=1;var e=Object.defineProperty,t=g((i,o)=>e(i,"name",{value:o,configurable:!0}),"t");const r=lt();return Us=t((i,o)=>new r(i,o).set.map(s=>s.map(a=>a.value).join(" ").trim().split(" ")),"toComparators"),Us}g(mS,"requireToComparators");var Gs,Sp;function hS(){if(Sp)return Gs;Sp=1;var e=Object.defineProperty,t=g((o,s)=>e(o,"name",{value:s,configurable:!0}),"c");const r=De(),n=lt();return Gs=t((o,s,a)=>{let l=null,c=null,p=null;try{p=new n(s,a)}catch{return null}return o.forEach(u=>{p.test(u)&&(!l||c.compare(u)===-1)&&(l=u,c=new r(l,a))}),l},"maxSatisfying"),Gs}g(hS,"requireMaxSatisfying");var Vs,Op;function gS(){if(Op)return Vs;Op=1;var e=Object.defineProperty,t=g((o,s)=>e(o,"name",{value:s,configurable:!0}),"u");const r=De(),n=lt();return Vs=t((o,s,a)=>{let l=null,c=null,p=null;try{p=new n(s,a)}catch{return null}return o.forEach(u=>{p.test(u)&&(!l||c.compare(u)===1)&&(l=u,c=new r(l,a))}),l},"minSatisfying"),Vs}g(gS,"requireMinSatisfying");var Ks,Ap;function vS(){if(Ap)return Ks;Ap=1;var e=Object.defineProperty,t=g((s,a)=>e(s,"name",{value:a,configurable:!0}),"i");const r=De(),n=lt(),i=Fo();return Ks=t((s,a)=>{s=new n(s,a);let l=new r("0.0.0");if(s.test(l)||(l=new r("0.0.0-0"),s.test(l)))return l;l=null;for(let c=0;c<s.set.length;++c){const p=s.set[c];let u=null;p.forEach(d=>{const f=new r(d.semver.version);switch(d.operator){case">":f.prerelease.length===0?f.patch++:f.prerelease.push(0),f.raw=f.format();case"":case">=":(!u||i(f,u))&&(u=f);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${d.operator}`)}}),u&&(!l||i(l,u))&&(l=u)}return l&&s.test(l)?l:null},"minVersion"),Ks}g(vS,"requireMinVersion");var Ys,Pp;function bS(){if(Pp)return Ys;Pp=1;var e=Object.defineProperty,t=g((i,o)=>e(i,"name",{value:o,configurable:!0}),"n");const r=lt();return Ys=t((i,o)=>{try{return new r(i,o).range||"*"}catch{return null}},"validRange"),Ys}g(bS,"requireValid");var Xs,Cp;function Tl(){if(Cp)return Xs;Cp=1;var e=Object.defineProperty,t=g((d,f)=>e(d,"name",{value:f,configurable:!0}),"m");const r=De(),n=Lo(),{ANY:i}=n,o=lt(),s=si(),a=Fo(),l=Pl(),c=Rl(),p=Cl();return Xs=t((d,f,m,h)=>{d=new r(d,h),f=new o(f,h);let v,b,w,k,y;switch(m){case">":v=a,b=c,w=l,k=">",y=">=";break;case"<":v=l,b=p,w=a,k="<",y="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(s(d,f,h))return!1;for(let x=0;x<f.set.length;++x){const $=f.set[x];let E=null,O=null;if($.forEach(S=>{S.semver===i&&(S=new n(">=0.0.0")),E=E||S,O=O||S,v(S.semver,E.semver,h)?E=S:w(S.semver,O.semver,h)&&(O=S)}),E.operator===k||E.operator===y||(!O.operator||O.operator===k)&&b(d,O.semver)||O.operator===y&&w(d,O.semver))return!1}return!0},"outside"),Xs}g(Tl,"requireOutside");var Zs,Rp;function yS(){if(Rp)return Zs;Rp=1;var e=Object.defineProperty,t=g((i,o)=>e(i,"name",{value:o,configurable:!0}),"s");const r=Tl();return Zs=t((i,o,s)=>r(i,o,">",s),"gtr"),Zs}g(yS,"requireGtr");var Qs,Tp;function $S(){if(Tp)return Qs;Tp=1;var e=Object.defineProperty,t=g((i,o)=>e(i,"name",{value:o,configurable:!0}),"s");const r=Tl();return Qs=t((i,o,s)=>r(i,o,"<",s),"ltr"),Qs}g($S,"requireLtr");var ea,Np;function wS(){if(Np)return ea;Np=1;var e=Object.defineProperty,t=g((i,o)=>e(i,"name",{value:o,configurable:!0}),"n");const r=lt();return ea=t((i,o,s)=>(i=new r(i,s),o=new r(o,s),i.intersects(o,s)),"intersects"),ea}g(wS,"requireIntersects");var ta,_p;function xS(){if(_p)return ta;_p=1;const e=si(),t=at();return ta=g((r,n,i)=>{const o=[];let s=null,a=null;const l=r.sort((d,f)=>t(d,f,i));for(const d of l)e(d,n,i)?(a=d,s||(s=d)):(a&&o.push([s,a]),a=null,s=null);s&&o.push([s,null]);const c=[];for(const[d,f]of o)d===f?c.push(d):!f&&d===l[0]?c.push("*"):f?d===l[0]?c.push(`<=${f}`):c.push(`${d} - ${f}`):c.push(`>=${d}`);const p=c.join(" || "),u=typeof n.raw=="string"?n.raw:String(n);return p.length<u.length?p:n},"simplify"),ta}g(xS,"requireSimplify");var ra,Mp;function jS(){if(Mp)return ra;Mp=1;var e=Object.defineProperty,t=g((f,m)=>e(f,"name",{value:m,configurable:!0}),"u");const r=lt(),n=Lo(),{ANY:i}=n,o=si(),s=at(),a=t((f,m,h={})=>{if(f===m)return!0;f=new r(f,h),m=new r(m,h);let v=!1;e:for(const b of f.set){for(const w of m.set){const k=p(b,w,h);if(v=v||k!==null,k)continue e}if(v)return!1}return!0},"subset"),l=[new n(">=0.0.0-0")],c=[new n(">=0.0.0")],p=t((f,m,h)=>{if(f===m)return!0;if(f.length===1&&f[0].semver===i){if(m.length===1&&m[0].semver===i)return!0;h.includePrerelease?f=l:f=c}if(m.length===1&&m[0].semver===i){if(h.includePrerelease)return!0;m=c}const v=new Set;let b,w;for(const j of f)j.operator===">"||j.operator===">="?b=u(b,j,h):j.operator==="<"||j.operator==="<="?w=d(w,j,h):v.add(j.semver);if(v.size>1)return null;let k;if(b&&w&&(k=s(b.semver,w.semver,h),k>0||k===0&&(b.operator!==">="||w.operator!=="<=")))return null;for(const j of v){if(b&&!o(j,String(b),h)||w&&!o(j,String(w),h))return null;for(const A of m)if(!o(j,String(A),h))return!1;return!0}let y,x,$,E,O=w&&!h.includePrerelease&&w.semver.prerelease.length?w.semver:!1,S=b&&!h.includePrerelease&&b.semver.prerelease.length?b.semver:!1;O&&O.prerelease.length===1&&w.operator==="<"&&O.prerelease[0]===0&&(O=!1);for(const j of m){if(E=E||j.operator===">"||j.operator===">=",$=$||j.operator==="<"||j.operator==="<=",b){if(S&&j.semver.prerelease&&j.semver.prerelease.length&&j.semver.major===S.major&&j.semver.minor===S.minor&&j.semver.patch===S.patch&&(S=!1),j.operator===">"||j.operator===">="){if(y=u(b,j,h),y===j&&y!==b)return!1}else if(b.operator===">="&&!j.test(b.semver))return!1}if(w){if(O&&j.semver.prerelease&&j.semver.prerelease.length&&j.semver.major===O.major&&j.semver.minor===O.minor&&j.semver.patch===O.patch&&(O=!1),j.operator==="<"||j.operator==="<="){if(x=d(w,j,h),x===j&&x!==w)return!1}else if(w.operator==="<="&&!j.test(w.semver))return!1}if(!j.operator&&(w||b)&&k!==0)return!1}return!(b&&$&&!w&&k!==0||w&&E&&!b&&k!==0||S||O)},"simpleSubset"),u=t((f,m,h)=>{if(!f)return m;const v=s(f.semver,m.semver,h);return v>0?f:v<0||m.operator===">"&&f.operator===">="?m:f},"higherGT"),d=t((f,m,h)=>{if(!f)return m;const v=s(f.semver,m.semver,h);return v<0?f:v>0||m.operator==="<"&&f.operator==="<="?m:f},"lowerLT");return ra=a,ra}g(jS,"requireSubset");var na,Ip;function kS(){if(Ip)return na;Ip=1;const e=ho(),t=Xa(),r=De(),n=tv(),i=Kn(),o=cd(),s=rv(),a=tS(),l=rS(),c=nS(),p=iS(),u=oS(),d=sS(),f=at(),m=aS(),h=lS(),v=Al(),b=cS(),w=pS(),k=Fo(),y=Pl(),x=Gm(),$=Vm(),E=Cl(),O=Rl(),S=Km(),j=uS(),A=dS(),N=Lo(),q=lt(),J=si(),U=mS(),ee=hS(),X=gS(),W=vS(),R=bS(),B=Tl(),I=yS(),_=$S(),M=wS(),H=xS(),z=jS();return na={parse:i,valid:o,clean:s,inc:a,diff:l,major:c,minor:p,patch:u,prerelease:d,compare:f,rcompare:m,compareLoose:h,compareBuild:v,sort:b,rsort:w,gt:k,lt:y,eq:x,neq:$,gte:E,lte:O,cmp:S,coerce:j,truncate:A,Comparator:N,Range:q,satisfies:J,toComparators:U,maxSatisfying:ee,minSatisfying:X,minVersion:W,validRange:R,outside:B,gtr:I,ltr:_,intersects:M,simplifyRange:H,subset:z,SemVer:r,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},na}g(kS,"requireSemver");var nt=kS(),ES=Object.defineProperty,SS=g((e,t)=>ES(e,"name",{value:t,configurable:!0}),"P$9"),OS=Object.defineProperty,Ym=SS((e,t)=>OS(e,"name",{value:t,configurable:!0}),"$"),AS=Object.defineProperty,Xm=Ym((e,t)=>AS(e,"name",{value:t,configurable:!0}),"r");const io=/.*\/node_modules\/(?:@[^/]+\/)?[^/]+/,Wa=Za(async e=>{const t=G(e,"package.json");try{const r=await nv(t);return{directory:ne(t),name:r.name,version:r.version}}catch{return}})(),Zm=Xm(async e=>{const t=In(e),r=io.exec(t);if(!r)return;const n=await Wa(r[0]);if(n)return n;const i=t.lastIndexOf("node_modules");if(i<=0)return;const o=io.exec(t.slice(0,i-1));if(o)return Wa(o[0])},"getPackageInfo"),PS=Xm(()=>{Wa.destroy()},"destroyPackageInfoCache");var CS=Object.defineProperty,Ft=Ym((e,t)=>CS(e,"name",{value:t,configurable:!0}),"d");const Wp=Za(async(e,t)=>{const r=In(e);if(io.test(r)){const n=await Zm(r);if(n)return`${n.name}@${n.version}`}return r.replace(`${In(t)}/`,"")})(),RS=Ft(e=>new Set([...e].toSorted((t,r)=>t.localeCompare(r))),"sortImporters"),TS=Ft(e=>new Map([...e.entries()].toSorted((t,r)=>t[0].localeCompare(r[0])).map(([t,r])=>[t,RS(r)])),"sortDirectoryMap"),NS=Ft(e=>new Map([...e.entries()].toSorted((t,r)=>nt.compare(t[0],r[0])).map(([t,r])=>[t,TS(r)])),"sortVersionMap"),_S=Ft(e=>new Map([...e.entries()].toSorted((t,r)=>t[0].localeCompare(r[0])).map(([t,r])=>[t,NS(r)])),"sortPackagesInfo"),MS=Ft((e,t,r,n,i)=>{let o=e.get(t);o||(o=new Map,e.set(t,o));let s=o.get(r);s||(s=new Map,o.set(r,s));let a=s.get(n);a||(a=new Set,s.set(n,a)),a.add(i)},"addImporter"),IS=Ft((e,t,r,n)=>{const i=Math.max(0,...t.map(a=>a.length)),o=Ft((a,l)=>a.filter(c=>c!==`${e}@${l}`).map(c=>Ka(c)).join(", "),"colorizeImporters"),s=[`
|
|
64
|
+
${_i(e)}:`];for(const a of t){const l=r.get(e)?.get(a);if(!l)continue;const c=We(Ar(a.padEnd(i," ")));if(l.size===1){const[p]=[...l.values()],u=p?[...p]:[];s.push(` - ${c} imported by ${o(u,a)}`);continue}s.push(` - ${c}`);for(const[p,u]of l){const d=We(pe(p.replace(In(n),".")));s.push(` - ${d} imported by ${o([...u],a)}`)}}return s},"formatDuplicatedPackage"),WS=Ft((e,t,{customErrorMessage:r,deep:n=!0,ignore:i={},throwErrorWhenDuplicated:o=!1}={})=>({async buildEnd(){const s=new Map;await Promise.all([...this.getModuleIds()].map(async d=>{const f=this.getModuleInfo(d);if(f===null||f.isExternal||f.isIncluded===!1)return;const m=await Zm(d);if(!m)return;const{directory:h,name:v,version:b}=m;for(const w of[...f.importers,...f.dynamicImporters]){const k=In(w);!n&&io.test(k)||MS(s,v,b,h,await Wp(k,t))}})),PS(),Wp.destroy();const a=_S(s),l={},c=new Map;for(const[d,f]of a.entries()){const m=[...f.values()];if(m.length>1||m.length===1&&(m[0]?.size??0)>1){l[d]=[...f.keys()];for(const h of f.keys()){const v=i[d];if(!(v!==void 0&&(v.includes("*")||v.includes(h)))){const b=c.get(d)??[];b.push(h),c.set(d,b)}}}}if(c.size===0)return;const p=[`packages ${[...c.keys()].map(d=>_i(d)).join(", ")} is bundled multiple times!`];for(const[d,f]of c)p.push(...IS(d,f,a,t));const u=r?r(a):p.join(`
|
|
65
|
+
`);o&&(e.error(u),e.info(`Fix this error by eliminating the duplicated dependencies or adjusting the ${_i("ignore")} option.`),e.info(`You can copy the following duplicated dependencies as the value of the ${_i("ignore")} option:`),e.info(`
|
|
66
|
+
${JSON.stringify(l,void 0,4)}
|
|
67
|
+
`),this.error("Duplicated dependencies detected.")),e.warn(u)},name:"packem:detect-duplicated"}),"detectDuplicatedPlugin");var BS=Object.defineProperty,DS=g((e,t)=>BS(e,"name",{value:t,configurable:!0}),"s$e"),FS=Object.defineProperty,LS=DS((e,t)=>FS(e,"name",{value:t,configurable:!0}),"s"),zS=Object.defineProperty,zo=LS((e,t)=>zS(e,"name",{value:t,configurable:!0}),"t");const qS=/(?:^|[^.\w'"`])require(\.resolve)?\(\s*([\w'"`])/,HS=zo((e,t)=>{if(Gg.INTERNAL_PACKEM_BUILD!=="1"&&(e.includes("// -- packem CommonJS __filename shim")||e.includes("// -- packem CommonJS __dirname shim")||e.includes("// -- packem CommonJS require shim")))return;let r=!1,n=!1,i=!1;if(e.includes("__filename")&&(r=!0),e.includes("__dirname")&&(n=!0),qS.test(e)&&(i=!0),!r&&!n&&!i)return;const o=bo(e).pop(),s=o?o.end:0,a=new Te(e);return a.appendRight(s,t(r,n,i)),{code:a.toString(),map:a.generateMap()}},"CJSToESM"),JS=zo((e,t,r)=>{let n="";return(e||t)&&(n+=`import __cjs_url__ from "node:url"; // -- packem CommonJS __filename shim --
|
|
68
|
+
`),t&&(n+=`import __cjs_path__ from "node:path"; // -- packem CommonJS __dirname shim --
|
|
69
|
+
`),r&&(n+=`import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
|
|
70
|
+
`),(e||t)&&(n+=`const __filename = __cjs_url__.fileURLToPath(import.meta.url);
|
|
71
|
+
`),t&&(n+=`const __dirname = __cjs_path__.dirname(__filename);
|
|
72
|
+
`),r&&(n+=`const require = __cjs_mod__.createRequire(import.meta.url);
|
|
73
|
+
`),n},"generateCJSShim"),US=zo((e,t,r)=>{let n="";return r&&(n+=`import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
|
|
74
|
+
`),e&&(n+=`const __filename = import.meta.filename; // -- packem CommonJS __filename shim --
|
|
75
|
+
`),t&&(n+=`const __dirname = import.meta.dirname; // -- packem CommonJS __dirname shim --
|
|
76
|
+
`),r&&(n+=`const require = __cjs_mod__.createRequire(import.meta.url);
|
|
77
|
+
`),n},"generateCJSShimNode20_11"),GS=zo((e,t)=>{const r=$t(t.include,t.exclude);return{name:"packem:esm-shim-cjs-syntax",renderChunk(n,i,o){if(o.format==="es"&&r(i.fileName)){let s=JS;if(e.engines?.node){const a=nt.minVersion(e.engines.node);a&&a.major>=20&&a.minor>=11&&(s=US)}return HS(n,s)}}}},"esmShimCjsSyntaxPlugin");var VS=Object.defineProperty,KS=g((e,t)=>VS(e,"name",{value:t,configurable:!0}),"A$8"),YS=Object.defineProperty,XS=KS((e,t)=>YS(e,"name",{value:t,configurable:!0}),"M"),ZS=Object.defineProperty,tt=XS((e,t)=>ZS(e,"name",{value:t,configurable:!0}),"f");const Ba=/[.*+?^${}()|[\]\\]/g,QS=/.*/,eO=/^(?:\0|\.{1,2}\/)/,tO=/^node:/,rO=/^@visulima\/css-style-inject(?:\/.+)?$/,Bp=tt((e,t,r)=>e.reduce((n,i,o)=>(i instanceof RegExp?n.push(i):typeof i=="string"&&i.length>0?n.push(new RegExp(`^${i.replaceAll(Ba,String.raw`\$&`)}$`)):r.warn(`Ignoring wrong entry type #${String(o)} in '${t}' option: ${JSON.stringify(i)}`),n),[]),"getRegExps"),Dp=new Map,nO=tt((e,t)=>{Dp.has(e)||t.info({message:`Inlined implicit external "${pe(e)}". If this is incorrect, add it to the "externals" option.`,prefix:"plugin:packem:externals"}),Dp.set(e,!0)},"logExternalMessage"),Fp=new Set(["node:sqlite","node:test"]),iO=/[\\:]/,oO=tt(e=>e.length>0&&!iO.test(e),"isValidPackageName"),Nl="@types/",Lp=tt(e=>{if(e.startsWith("@")){const[t,r]=e.split("/");return`${t??""}/types/${r??""}`}return`${Nl}${e}`},"getAtTypesPackageName"),sO=tt(e=>{if(e.startsWith("@")){const t=e.split("/");if(t[1]==="types")return`@${t[0]??""}/${t.slice(2).join("/")}`}return e.replace(Nl,"")},"getOriginalPackageName"),aO=["peerDependencies","dependencies","optionalDependencies"],Qm=tt((e,t)=>{const r=Mv.realpathSync.native(process.cwd()),{pkg:n}=e,i=new Set;for(const y of aO){const x=n[y];if(x)for(const $ of Object.keys(x))$.startsWith(Nl)?i.add(sO($)):i.add($)}const o=new Set(Object.keys(n.devDependencies??{})),s=e.options.rollup.resolveExternals??{},a=new Set(Bp([...e.options.externals??[]],"include",e.logger)),l=new Set(Bp([...s.exclude??[]],"exclude",e.logger));if(t?.dtsResolve)if(t.dtsResolve===!0)l.add(QS);else for(const y of t.dtsResolve)typeof y=="string"?l.add(new RegExp(`^${y.replaceAll(Ba,String.raw`\$&`)}(?:/.+)?$`)):l.add(y);const c=tt(y=>{const{dtsResolve:x}=t??{};return x?typeof x=="boolean"?x:x.some($=>typeof $=="string"?y===$:$.test(y)):!1},"shouldResolveForDts"),p={...s.deps?n.dependencies??{}:void 0,...s.devDeps?n.devDependencies??{}:void 0,...s.peerDeps?n.peerDependencies??{}:void 0,...s.optDeps?n.optionalDependencies??{}:void 0},u=Object.keys(p);if(u.length>0&&a.add(new RegExp(`^(?:${u.join("|")})(?:/.+)?$`)),a.add(rO),n.peerDependenciesMeta)for(const[y,x]of Object.entries(n.peerDependenciesMeta))x&&typeof x=="object"&&"optional"in x&&a.add(new RegExp(`^${y}(?:/.+)?$`));const d=tt(y=>[...a].some(x=>x.test(y)),"isIncluded"),f=tt(y=>[...l].some(x=>x.test(y)),"isExcluded");let m=[];e.tsconfig&&(m=Object.entries(e.tsconfig.config.compilerOptions?.paths??{}).map(([y])=>y.endsWith("*")?new RegExp(`^${y.replace("*","(.*)")}$`):new RegExp(`^${y}$`)));const h=Do(n,e.options),v=e.options.sourceDir?new RegExp(String.raw`(?:^|/)${e.options.sourceDir.replaceAll(Ba,String.raw`\$&`)}/`):void 0,b=new Set,w=new Set,k=new Map;return{name:"packem:externals",options:tt(y=>{y.external=(x,$)=>{if(k.has(x))return k.get(x);const E=Mn(x),O=$?Mn($):void 0;let S;if(Object.keys(h).length>0){const N=Kg(E,h);N!==E&&(S=N)}let j="";S&&xn(S)&&(j=mc(S).name??""),!j&&xn(E)&&(j=mc(E).name??Ov(E));const A=j&&xn(j)&&oO(j)?j:"";if(A&&!hi(A)){e.usedDependencies.add(A);const N=!O||!cs(O,e.options.rootDir),q=Object.keys(n.dependencies??{}).includes(A)||Object.keys(n.devDependencies??{}).includes(A)||Object.keys(n.peerDependencies??{}).includes(A)||Object.keys(n.optionalDependencies??{}).includes(A);N&&!q&&e.options.validation&&e.options.validation.dependencies&&e.options.validation.dependencies.hoisted!==!1&&!e.options.validation.dependencies.hoisted?.exclude.includes(A)&&e.hoistedDependencies.add(A)}for(const N of[E,S].filter(Boolean)){const q=n.name?N===n.name||N.startsWith(`${n.name}/`):!1;if(eO.test(N)||Ya(N)||(v?.test(N)??!1)||q)return k.set(x,!1),!1;if(hi(N)||Fp.has(N)){let J=s.builtins;return J===void 0&&O&&(J=d(O)&&!f(O)),k.set(x,J),J}if(N[0]==="#"&&!N.startsWith("#/"))return k.set(x,!1),!1;if(d(N)&&!f(N))return k.set(x,!0),!0;if(m.some(J=>J.test(N))||A&&c(A))return k.set(x,!1),!1}return e.implicitDependencies.add(E),nO(E,e.logger),k.set(x,!1),!1}},"options"),resolveId:{filter:{id:tt(y=>!y.startsWith("\0"),"id")},async handler(y,x,$){if($.isEntry)return;if(y[0]==="#"&&!y.startsWith("#/")&&n.imports)return x&&!cs(x,e.options.rootDir)?{external:!0,id:y}:void 0;if(Fp.has(y))return{external:!0,id:y,moduleSideEffects:!1};if(hi(y)){const O=y.replace(tO,"");let S=O;return(s.builtinsPrefix==="add"||!hi(O))&&(S=`node:${O}`),{external:(s.builtins??d(y))&&!f(y),id:s.builtinsPrefix==="ignore"?y:S,moduleSideEffects:!1}}if(!xn(y)||y.includes("?")||y.includes(" "))return;const[E]=ka(y);if(o.has(E)&&!i.has(E)){if(d(y)&&!f(y))return;if(t?.forTypes)return t.dtsResolve&&c(E)?void 0:{external:!0,id:y,moduleSideEffects:!1};const O=await this.resolve(y,x,{skipSelf:!0,...$});if(!O)throw new Error(`Could not resolve "${y}" even though it's declared in package.json. Try re-installing node_modules.`);if(t?.forTypes){const S=Lp(E);i.has(S)&&!b.has(S)&&(b.add(S),e.logger.warn(`Recommendation: "${S}" is externalized but "${E}" is bundled (devDependencies). This may cause type mismatches for consumers. Consider moving "${E}" to dependencies or "${S}" to devDependencies.`))}return O}if(i.has(E)){if(t?.forTypes){const O=Lp(E);o.has(O)&&!b.has(O)&&(b.add(O),e.logger.warn(`Recommendation: "${O}" is bundled (devDependencies) but "${E}" is externalized. Place "${O}" in dependencies/peerDependencies as well so users don't have missing types.`))}return}if(!o.has(E)&&x&&!cs(x,r)&&!t?.skipUnlistedWarnings&&!w.has(E)&&(w.add(E),e.logger.warn(`"${E}" imported by "${x}" but not declared in package.json. Will be bundled to prevent failure at runtime.`)),t?.forTypes&&x&&Sv(x,r))return{external:!0,id:y,moduleSideEffects:!1}},order:"pre"}}},"externalsPlugin");var lO=Object.defineProperty,cO=g((e,t)=>lO(e,"name",{value:t,configurable:!0}),"d$h"),pO=Object.defineProperty,uO=cO((e,t)=>pO(e,"name",{value:t,configurable:!0}),"d"),dO=Object.defineProperty,zp=uO((e,t)=>dO(e,"name",{value:t,configurable:!0}),"p");const ia="\0packem-import-attribute/",fO=/(import[\s\S]+?from\s*["'])([^"']+)(["'])\s*with\s*\{\s*type\s*:\s*["'](text|bytes)["']\s*\}/g,mO=/(\bimport\s*\(\s*["'])([^"']+)["']\s*,\s*\{\s*with\s*:\s*\{\s*type\s*:\s*["'](text|bytes)["']\s*\}\s*\}\s*\)/g,hO=/\.[mc]?[jt]sx?$/,gO=zp(()=>{const e=new Map;let t=0;const r=zp(n=>{const i=`${ia}${String(t)}`;return t+=1,e.set(i,n),i},"allocateId");return{buildStart(){e.clear(),t=0},async load(n){const i=e.get(n);if(!i)return null;const{importer:o,source:s,type:a}=i;if(!s.startsWith("./")&&!s.startsWith("../")&&!s.startsWith("/"))return null;const l=s.startsWith("/")?s:Dv(Ea(o),s);if(this.addWatchFile(l),a==="text"){const c=await Yi(l,"utf8");return`export default ${JSON.stringify(c)}`}return`export default new Uint8Array([${(await Yi(l)).join(",")}])`},name:"packem:import-attributes",resolveId(n,i){return n.startsWith(ia)&&e.has(n)?n:null},transform(n,i){const o=i.split("?")[0]??i;if(o.startsWith(ia)||!hO.test(o)||!n.includes("with")||!n.includes("text")&&!n.includes("bytes"))return null;const s=n.replaceAll(fO,(a,l,c,p,u)=>{const d=r({importer:i,source:c,type:u});return`${l}${d}${p}`}).replaceAll(mO,(a,l,c,p)=>{const u=r({importer:i,source:c,type:p});return`${l}${u}")`});return s===n?null:{code:s,map:null}}}},"importAttributesPlugin");var vO=Object.defineProperty,eh=g((e,t)=>vO(e,"name",{value:t,configurable:!0}),"u$h"),bO=Object.defineProperty,th=eh((e,t)=>bO(e,"name",{value:t,configurable:!0}),"d"),yO=Object.defineProperty,Hr=th((e,t)=>yO(e,"name",{value:t,configurable:!0}),"a");const $O=Hr(e=>{const t=[],r=[];e.forEach(i=>{i.startsWith("(")?t.push(i):r.push(i)});const n=Hr((i,o)=>i.localeCompare(o),"byLocale");return[...r.toSorted(n),...t.toSorted(n)]},"sortLicenses"),wO=Hr((e,t,r)=>{const n=new Set;for(const i of[e,...t,...r]){const o=typeof i=="string"?i:i?.name;o&&n.add(o)}return[...n]},"collectAuthorNames");function qo(e){return e?`> ${e}`:">"}g(qo,"d$g");eh(qo,"h");th(qo,"P");Hr(qo,"prefixQuoteMarker");const xO=Hr((e,t,r)=>e.trim().replaceAll(/\r\n|\r/g,`
|
|
78
|
+
`).replaceAll(`<!-- ${t} -->`,"").replaceAll(r?`<!-- ${r} -->`:"","").replaceAll(`<!-- /${t} -->`,"").replaceAll(r?`<!-- /${r} -->`:"","").trim().split(`
|
|
79
|
+
`).map(n=>qo(n)).join(`
|
|
80
|
+
`),"formatLicenseBody"),rh=Hr(({dtsMarker:e,licenseFilePath:t,licenseTemplate:r,logger:n,marker:i,mode:o,packageName:s})=>Zv({thirdParty(a){const l=new Set,c=a.toSorted(({name:u},{name:d})=>{const f=u??"",m=d??"";return f.localeCompare(m)}).map(({author:u,contributors:d,license:f,licenseText:m,maintainers:h,name:v,repository:b})=>{let w=`## ${v??""}
|
|
81
|
+
`;f&&(w+=`License: ${f}
|
|
82
|
+
`);const k=wO(u,h,d);return k.length>0&&(w+=`By: ${k.join(", ")}
|
|
83
|
+
`),b&&(w+=`Repository: ${typeof b=="string"?b:b.url}
|
|
84
|
+
`),m&&(w+=`
|
|
85
|
+
${xO(m,i,e)}
|
|
86
|
+
`),f&&l.add(f),w}).join(`
|
|
87
|
+
---------------------------------------
|
|
88
|
+
|
|
89
|
+
`);if(c===""){n.info({message:"No dependencies license information found.",prefix:`plugin:license:${o}`});return}const p=r($O(l),c,s);try{const u=sd(t),d=Av(u,i,p);if(!d){n.error({message:`Could not find the license marker: <!-- ${i} --><!-- /${i} --> in ${t}`,prefix:`plugin:license:${o}`});return}u!==d&&(iv(t,d),n.info({message:`${t} updated.`,prefix:`plugin:license:${o}`}))}catch(u){n.error(u)}}}),"licensePlugin");var jO=Object.defineProperty,nh=g((e,t)=>jO(e,"name",{value:t,configurable:!0}),"C$8"),kO=Object.defineProperty,ai=nh((e,t)=>kO(e,"name",{value:t,configurable:!0}),"g");let gr;const Er={getHeadTemplatePart(e){const t=e.getFullText(gr),r=t.indexOf("`")+1,n=Pt.isTemplateHead(e)?-2:-1;return{end:e.end+n,start:e.pos+r,text:t.slice(r,t.length+n)}},getMiddleTailTemplatePart(e){const t=e.getText(gr),r=Pt.isTemplateMiddle(e)?2:1;return{end:e.end-r,start:e.getStart(gr)+1,text:t.slice(1,t.length-r)}},getRootNode(e,t=""){return Pt.createSourceFile(t,e,Pt.ScriptTarget.ESNext)},getTaggedTemplateTemplate(e){return e.template},getTagText(e){return e.tag.getText(gr)},getTemplateParts(e){return Pt.isNoSubstitutionTemplateLiteral(e)?[Er.getHeadTemplatePart(e)]:[Er.getHeadTemplatePart(e.head),...e.templateSpans.map(t=>Er.getMiddleTailTemplatePart(t.literal))]},isTaggedTemplate:Pt.isTaggedTemplateExpression,isTemplate:Pt.isTemplateLiteral,walkChildNodes(e,t){t(e),Pt.forEachChild(e,r=>{Er.walkChildNodes(r,t)})},walkNodes(e,t){gr=e,Er.walkChildNodes(e,t),gr=void 0}};var EO=Object.defineProperty,SO=ai((e,t)=>EO(e,"name",{value:t,configurable:!0}),"i");const OO=SO((e,t={})=>{const r={...Er,...t.strategy},n=[],i=[];return r.walkNodes(r.getRootNode(e,t.fileName),o=>{if(r.isTaggedTemplate(o)){const s=r.getTaggedTemplateTemplate(o);i.push(s),n.push({parts:r.getTemplateParts(s),tag:r.getTagText(o)})}else r.isTemplate(o)&&!i.includes(o)&&n.push({parts:r.getTemplateParts(o)})}),n},"parseLiterals");var AO=Object.defineProperty,_l=ai((e,t)=>AO(e,"name",{value:t,configurable:!0}),"c");const Wr={One:"1",Two:"2",Zero:"0"},PO=_l(e=>{const t={[Wr.One]:{tidySelectors:!1,transform:void 0},[Wr.Two]:{tidySelectors:!1,transform:void 0},[Wr.Zero]:{}};if(e===void 0)return t;if(typeof e=="number"){const r=e.toString();return{...t,[r]:{...t[r]}}}return e},"optimizationLevelFrom"),CO=/(:[^()\s]+\(([^()]*)\))\s*\{/g,RO=/\s/g,TO=/\s/,qp=_l((e,t)=>{let r=t;const n=[...e.matchAll(CO)];for(const i of n){const o=i[1],s=i[2];if(!o||!s||!TO.test(s))continue;const a=s.replaceAll(RO,""),l=o.replace(s,a),c=r.indexOf(l);if(c===-1)continue;const p=c+l.length;r=r.slice(0,Math.max(0,c))+o+r.slice(Math.max(0,p))}return r},"fixCleanCssTidySelectors"),NO={},_O={caseSensitive:!0,collapseWhitespace:!0,decodeEntities:!0,minifyCSS:NO,minifyJS:!0,removeAttributeQuotes:!1,removeComments:!0,removeEmptyAttributes:!0,removeScriptTypeAttributes:!0,removeStyleLinkTypeAttributes:!0,useShortDoctype:!0},Hp=_l((e={})=>{const t=PO(e.level),r=typeof e.level=="object"&&typeof e.level[1]?.transform=="function"?e.level[1].transform:!1;return t[Wr.One].transform=(n,i)=>i.startsWith("@TEMPLATE_EXPRESSION")&&!i.endsWith(";")?`${i};`:r?r(n,i):i,{...e,level:t}},"adjustMinifyCSSOptions"),MO={combineHTMLStrings(e,t){return e.map(r=>r.text).join(t)},getPlaceholder(e){let t="@TEMPLATE_EXPRESSION";for(;e.some(r=>r.text.includes(t+"();"));)t+="_";return t+"();"},minifyCSS(e,t={}){const r=Hp(t),n=new Qv(r).minify(e);if(n.errors.length>0)throw new Error(n.errors.join(`
|
|
90
|
+
|
|
91
|
+
`));return r.level?.[Wr.One]?.tidySelectors&&(n.styles=qp(e,n.styles)),n.styles},async minifyHTML(e,t={}){let r;t.minifyCSS?r=t.minifyCSS!==!0&&typeof t.minifyCSS!="function"?{...t.minifyCSS}:{}:r=!1;let n=!1;r&&(n=Hp(r));let i=await eb(e,{...t,minifyCSS:n});if(t.collapseWhitespace){const o=[...i.matchAll(/<svg/g)].toReversed();for(const s of o){const a=s.index,l=i.indexOf("</svg",a);if(l===-1)continue;const c=i.slice(0,Math.max(0,a));let p=i.slice(a,l);const u=i.slice(Math.max(0,l));p=p.replaceAll(/\r?\n/g,""),i=c+p+u}}return(n?n.level:void 0)?.[Wr.One]?.tidySelectors&&(i=qp(e,i)),i},splitHTMLByPlaceholder(e,t){const r=e.split(t);if(t.endsWith(";")){const n=t.slice(0,Math.max(0,t.length-1));for(let i=r.length-1;i>=0;i-=1){const o=r[i];o!==void 0&&r.splice(i,1,...o.split(n))}}return r}};var IO=Object.defineProperty,Ho=ai((e,t)=>IO(e,"name",{value:t,configurable:!0}),"f");const WO=Ho((e,t)=>e.generateMap({file:`${t}.map`,hires:!0,source:t}),"defaultGenerateSourceMap"),BO=Ho(e=>{const t=e.tag?.toLowerCase();return!!t&&(t.includes("html")||t.includes("svg"))},"defaultShouldMinify"),DO=Ho(e=>!!e.tag&&e.tag.toLowerCase().includes("css"),"defaultShouldMinifyCSS"),FO={ensureHTMLPartsValid(e,t){if(e.length!==t.length)throw new Error("splitHTMLByPlaceholder() must return same number of strings as template parts")},ensurePlaceholderValid(e){if(typeof e!="string"||e.length===0)throw new Error("getPlaceholder() must return a non-empty string")}};async function Jo(e,t={}){t.minifyOptions={..._O,...t.minifyOptions},t.MagicString??=Te,t.parseLiterals??=OO,t.shouldMinify??=BO,t.shouldMinifyCSS??=DO,t.parseLiteralsOptions={fileName:t.fileName,...t.parseLiteralsOptions};const r=t.parseLiterals(e,t.parseLiteralsOptions),n=t.strategy??MO,{shouldMinify:i,shouldMinifyCSS:o}=t;let s;t.validate!==!1&&(s=t.validate??FO);const a=new t.MagicString(e);for(const p of r){const u=i(p),d=!!n.minifyCSS&&o(p);if(u||d){const f=n.getPlaceholder(p.parts);s&&s.ensurePlaceholderValid(f);const m=n.combineHTMLStrings(p.parts,f);let h;if(d){const b=t.minifyOptions?.minifyCSS;if(typeof b=="function"){const w=b(m);h=typeof w=="string"?w:await w}else if(b===!1)h=m;else{const w=typeof b=="object"&&b!==null?b:void 0,k=n.minifyCSS;if(!k)throw new Error("Strategy does not implement minifyCSS but minifyCSS was requested");const y=k(m,w);h=typeof y=="string"?y:await y}}else{const b=n.minifyHTML(m,t.minifyOptions);h=typeof b=="string"?b:await b}const v=n.splitHTMLByPlaceholder(h,f);s&&s.ensureHTMLPartsValid(p.parts,v),p.parts.forEach((b,w)=>{b.start<b.end&&v[w]!==void 0&&a.overwrite(b.start,b.end,v[w])})}}const l=a.toString();if(e===l)return;let c;return t.generateSourceMap!==!1&&(c=(t.generateSourceMap??WO)(a,t.fileName??"")),{code:l,map:c}}g(Jo,"O$a");nh(Jo,"H");ai(Jo,"minifyHTMLLiterals");Ho(Jo,"minifyHTMLLiterals");var LO=Object.defineProperty,zO=ai((e,t)=>LO(e,"name",{value:t,configurable:!0}),"o");const qO=zO(({exclude:e,failOnError:t=!1,include:r,logger:n,minifyHTMLLiterals:i,options:o})=>{i??=Jo;const s=$t(r,e),a=o??{};return{name:"packem:minify-html-literals",async transform(l,c){if(s(c))try{return await i(l,{...a,fileName:c})}catch(p){const u=p instanceof Error?p.message:p;t?this.error(u):n.warn({message:u,prefix:"plugin:minify-html-literals"})}}}},"minifyHTMLLiteralsPlugin");var HO=Object.defineProperty,JO=g((e,t)=>HO(e,"name",{value:t,configurable:!0}),"h$a"),UO=Object.defineProperty,GO=JO((e,t)=>UO(e,"name",{value:t,configurable:!0}),"h"),VO=Object.defineProperty,Jp=GO((e,t)=>VO(e,"name",{value:t,configurable:!0}),"f");const KO=/\.node$/,oa="\0packem-natives/",YO=Jp((e={})=>{const{nativesDirectory:t="natives"}=e,r=new Map;let n=0,i;return{buildStart(){r.clear(),n=0},generateBundle:Jp(async o=>{if(r.size===0)return;let s;if(o.dir?s=o.dir:o.file&&(s=ne(o.file)),!s)throw new Error("Output directory not detected. Please ensure Rollup output options are configured.");const a=G(s,t);await xa(a);const l=new Set,c=[];for(const{outputName:p,sourcePath:u}of r.values())l.has(u)||(l.add(u),c.push(qv(u,G(a,p))));await Promise.all(c)},"generateBundle"),load(o){const s=r.get(o);if(!s)return;const{outputName:a}=s;if(!i){if(this.meta?.rollupVersion)return`export default require("./${t}/${a}");`;this.error("Output directory not detected. Please ensure Rollup output options are configured.")}return`export default require("${`./${t}/${a}`.replaceAll("\\","/")}");`},name:"native-modules",options(o){const s=o;if(s.output){const a=Array.isArray(s.output)?s.output[0]:s.output;a?.dir?i=a.dir:a?.file&&(i=ne(a.file))}return o},resolveId:{filter:{id:KO},async handler(o,s){if(o.startsWith(oa))return;if(s?.startsWith(oa))return{external:!0,id:o};const a=s?re(ne(s),o):re(o);if(!await Pr(a)){this.warn(`Native module not found: ${a}`);return}for(const[f,m]of r)if(m.sourcePath===a)return f;const l=Et(a);let c=l,p=1;const u=new Set(Array.from(r.values(),f=>f.outputName));for(;u.has(c);){const f=Fr(l);c=`${Et(l,f)}_${String(p)}${f}`,p+=1}const d=`${oa}${String(n)}`;return n+=1,r.set(d,{outputName:c,sourcePath:a}),d}}}},"nativeModulesPlugin");var XO=Object.defineProperty,ZO=g((e,t)=>XO(e,"name",{value:t,configurable:!0}),"n$9"),QO=Object.defineProperty,e9=ZO((e,t)=>QO(e,"name",{value:t,configurable:!0}),"n"),t9=Object.defineProperty,r9=e9((e,t)=>t9(e,"name",{value:t,configurable:!0}),"a");const n9=r9(e=>{const t=$t(e.include,e.exclude);return{async load(r){if(r.includes("?raw")){const n=r.split("?")[0];try{const i=await nr(n);return process.platform==="win32"?i.replaceAll(`\r
|
|
92
|
+
`,`
|
|
93
|
+
`):i}catch{this.error(`Failed to read file: ${n}`)}}return null},name:"packem:raw",transform(r,n){const i=n.includes("?raw"),o=i?n.split("?")[0]:n;if(t(o)||i){const s=process.platform==="win32"?r.replaceAll(`\r
|
|
94
|
+
`,`
|
|
95
|
+
`):r;return{code:`const data = ${JSON.stringify(s)};
|
|
96
|
+
export default data;`,map:null}}return null}}},"rawPlugin");var i9=Object.defineProperty,o9=g((e,t)=>i9(e,"name",{value:t,configurable:!0}),"N$8"),s9=Object.defineProperty,ih=o9((e,t)=>s9(e,"name",{value:t,configurable:!0}),"w"),a9=Object.defineProperty,l9=ih((e,t)=>a9(e,"name",{value:t,configurable:!0}),"s");let Up=!1;const c9=l9(async(e,t,r)=>{if(Up||(await Sd(),Up=!0),e.startsWith("node:"))return!1;if(e.endsWith(".cjs"))return!0;if(e.endsWith(".js")||!e.includes("/")&&!e.startsWith(".")){let n;if(r)try{n=(await r(e,t))?.id}catch{}if(!n&&t&&!t.includes("!~{"))try{n=Ze(t).resolve(e)}catch{}if(n){try{const{packageJson:i}=await ov(n);if(i.type==="module")return!1;if(i.type==="commonjs")return!0}catch{}try{const i=await nr(n,{encoding:"utf8"});try{return tb(i,n),!0}catch{}}catch{}}}return!1},"isPureCJS");var p9=Object.defineProperty,Qr=ih((e,t)=>p9(e,"name",{value:t,configurable:!0}),"d");const Ml="__cjs_require",u9='import { createRequire as __cjs_createRequire } from "node:module";',d9=`const ${Ml} = __cjs_createRequire(import.meta.url);`,f9='const __cjs_getProcess = typeof globalThis !== "undefined" && typeof globalThis.process !== "undefined" ? globalThis.process : process;',m9=`const __cjs_getBuiltinModule = (module) => {
|
|
97
|
+
// Check if we're in Node.js and version supports getBuiltinModule
|
|
98
|
+
if (typeof __cjs_getProcess !== "undefined" && __cjs_getProcess.versions && __cjs_getProcess.versions.node) {
|
|
99
|
+
const [major, minor] = __cjs_getProcess.versions.node.split(".").map(Number);
|
|
100
|
+
// Node.js 20.16.0+ and 22.3.0+
|
|
101
|
+
if (major > 22 || (major === 22 && minor >= 3) || (major === 20 && minor >= 16)) {
|
|
102
|
+
return __cjs_getProcess.getBuiltinModule(module);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
// Fallback to createRequire
|
|
106
|
+
return ${Ml}(module);
|
|
107
|
+
};`,wi={builtin:/const\s+__cjs_getBuiltinModule\s*=\s*\(module\)\s*=>\s*\{[\s\S]*?\};\s*/g,import:/import\s*\{\s*createRequire(?:\s+as\s+__cjs_createRequire)?\s*\}\s*from\s*["']node:module["'];?\s*/g,process:/const\s+__cjs_getProcess\s*=\s*typeof\s+globalThis[^;]*;\s*/g,require:/const\s+__cjs_require\s*=\s*(?:__cjs_)?createRequire\s*\([^)]*\);\s*/g},h9=[/node_modules/,/\.d\.[cm]?ts$/],g9=[/\.[cm]?[jt]sx?$/];let Gp=!1;const v9=Qr((e,t)=>t&&(Bg.includes(e)||e.startsWith("node:")),"isBuiltinModule"),b9=Qr(async(e,t,r,n,i)=>t?!0:await r?.(e,n,i)??await c9(e,n,i),"shouldTransformImport"),y9=Qr((e,t)=>t?e==="process"||e==="node:process"?{code:"__cjs_getProcess",needsBuiltin:!1,needsProcess:!0,needsRequire:!0}:{code:`__cjs_getBuiltinModule(${JSON.stringify(e)})`,needsBuiltin:!0,needsProcess:!0,needsRequire:!0}:{code:`${Ml}(${JSON.stringify(e)})`,needsBuiltin:!1,needsProcess:!1,needsRequire:!0},"generateRequireCode"),$9=Qr(e=>{const t=new Te(e),r={builtin:[...e.matchAll(wi.builtin)],import:[...e.matchAll(wi.import)],process:[...e.matchAll(wi.process)],require:[...e.matchAll(wi.require)]};return Object.values(r).forEach(n=>{if(n.length>1)for(let i=n.length-1;i>0;i-=1){const o=n[i];o&&t.remove(o.index,o.index+o[0].length)}}),t.toString()},"removeDuplicates"),w9=Qr(e=>{if(Array.isArray(e.shouldTransform)){const{shouldTransform:t}=e;e.shouldTransform=r=>t.includes(r)}return{builtinNodeModules:!!e.builtinNodeModules,cwd:e.cwd??Nt.cwd(),exclude:e.exclude??h9,include:e.include??g9,order:"order"in e?e.order:"pre",shouldTransform:e.shouldTransform}},"resolveOptions"),x9=Qr((e,t)=>{if(Nt.env.INTERNAL_PACKEM_BUILD)return{name:"require-cjs-transformer"};const{builtinNodeModules:r,cwd:n,exclude:i,include:o,order:s,shouldTransform:a}=w9(e),l=$t(o,i);return{async buildStart(){Gp||(await Sd(),Gp=!0)},name:"packem:plugin-require-cjs",renderChunk:{async handler(c,p,u){if(u.format!=="es"||!l(p.fileName))return;const d=yo(p.fileName,c,{astType:"js",lang:"js",sourceType:"module"}),f=new Te(c);let m=!1,h=!1,v=!1;for(const w of d.program.body){if(w.type!=="ImportDeclaration"||w.importKind==="type")continue;const k=w.source.value,y=v9(k,r),x=this.resolve;if(!await b9(k,y,a,n,x))continue;const{code:$,needsBuiltin:E,needsProcess:O,needsRequire:S}=y9(k,y);if(m||=S,h||=O,v||=E,w.specifiers.length===0){y?f.remove(w.start,w.end):f.overwrite(w.start,w.end,`${$};`);continue}const j=[];let A,N;for(const J of w.specifiers)if(J.type==="ImportNamespaceSpecifier")A=J.local.name;else if(J.type==="ImportSpecifier"&&J.importKind!=="type"){const U=c.slice(J.imported.start,J.imported.end);j.push([U,J.local.name])}else J.type==="ImportDefaultSpecifier"&&(N=J.local.name);const q=[];if(A&&(N??=`_cjs_${A}_default`),N&&q.push(`const ${N} = ${$};`),A&&q.push(`const ${A} = { ...${N??""}, default: ${N??""} };`),j.length>0){const J=`const {
|
|
108
|
+
${j.map(([U,ee])=>` ${U===ee?ee:`${U}: ${ee}`}`).join(`,
|
|
109
|
+
`)}
|
|
110
|
+
} = ${N??$};`;q.push(J)}f.overwrite(w.start,w.end,q.join(`
|
|
111
|
+
`))}if(m||h||v){const w=[];m&&w.push(u9,d9),h&&w.push(f9),v&&w.push(m9);const k=`${w.join(`
|
|
112
|
+
|
|
113
|
+
`)}
|
|
114
|
+
|
|
115
|
+
`,y=f.toString();if(y[0]==="#"){const x=y.indexOf(`
|
|
116
|
+
`)+1;f.appendLeft(x,k)}else f.prepend(k)}const b=new Te($9(f.toString()));return{code:b.toString(),map:b.generateMap()}},order:s}}},"requireCJSTransformerPlugin");var j9=Object.defineProperty,k9=g((e,t)=>j9(e,"name",{value:t,configurable:!0}),"I$6"),E9=Object.defineProperty,S9=k9((e,t)=>E9(e,"name",{value:t,configurable:!0}),"S"),O9=Object.defineProperty,oo=S9((e,t)=>O9(e,"name",{value:t,configurable:!0}),"f");const A9=oo(async e=>{try{const n=await Xn(e);if(n.isFile())return e;if(n.isDirectory()){const i=G(e,"index.js");if(await Pr(i))return i;const o=G(e,"index.json");if(await Pr(o))return o}}catch{}const t=`${e}.js`;if(await Pr(t))return t;const r=`${e}.json`;if(await Pr(r))return r},"tryResolveImplicit"),P9=oo(async(e,t)=>{let r=e;const n=re("/");for(;r!==n&&r!==ne(r);){const i=G(r,"node_modules",t,"package.json");if(await Pr(i))return i;r=ne(r)}},"findPackageJson"),oh=oo(e=>{const t=new Map,r=new Map,n=new Set;e.pkg.dependencies&&Object.keys(e.pkg.dependencies).forEach(o=>n.add(o)),e.pkg.peerDependencies&&Object.keys(e.pkg.peerDependencies).forEach(o=>n.add(o)),e.pkg.optionalDependencies&&Object.keys(e.pkg.optionalDependencies).forEach(o=>n.add(o));const i=oo(o=>n.has(o),"isExternalPackage");return{name:"packem:resolve-implicit-externals",async transform(o,s){if(s.includes("/node_modules/")||s.startsWith("\0"))return;const a=/\bfrom\s+['"`]([^'"`]+)['"`]/g,l=[];let c;for(;(c=a.exec(o))!==null;){const f=c[1];if(!f||!xn(f))continue;const[m,h]=ka(f);if(h&&m&&i(m)){const v=c.index+c[0].indexOf(f);l.push({importId:f,quoteEnd:v+f.length,quoteStart:v})}}if(l.length===0)return;const p=ne(s),u=(await Promise.all(l.map(async f=>{const[m,h]=ka(f.importId);if(!h)return;const v=`${m}:${h}:${p}`,b=r.get(v);if(b!==void 0)return b?{...f,resolvedId:b}:void 0;const w=await P9(p,m);if(!w){r.set(v,void 0);return}let k=t.get(w);if(k===void 0)try{k=sv(w,{resolveCatalogs:!0}),t.set(w,k)}catch{t.set(w,void 0),r.set(v,void 0);return}if(k.exports){r.set(v,void 0);return}const y=ne(w),x=G(y,h),$=await A9(x);if(!$){r.set(v,void 0);return}const E=Be(y,$),O=`${m}/${E}`;return r.set(v,O),{...f,resolvedId:O}}))).filter(f=>f!==void 0);if(u.length===0)return;const d=new Te(o);for(const{quoteEnd:f,quoteStart:m,resolvedId:h}of u)d.overwrite(m,f,h),this.debug(`[resolve-implicit-externals] Rewriting ${o.slice(m,f)} -> ${h} in ${s}`);return{code:d.toString(),map:d.generateMap({hires:!0})}}}},"resolveImplicitExternalsPlugin");var C9=Object.defineProperty,R9=g((e,t)=>C9(e,"name",{value:t,configurable:!0}),"m$b"),T9=Object.defineProperty,N9=R9((e,t)=>T9(e,"name",{value:t,configurable:!0}),"u"),_9=Object.defineProperty,Uo=N9((e,t)=>_9(e,"name",{value:t,configurable:!0}),"o");const so=/^#![^\n]*/,Da=Uo(async e=>{await wd(e,493).catch(()=>{})},"makeExecutable"),M9=Uo((e,t)=>({name:"packem:shebang",renderChunk:{handler(r,n,i){if(!n.isEntry||!n.facadeModuleId)return;const o=r.startsWith("#")&&r[1]==="!";if(o&&t.replace)return{code:r.replace(so,`${t.shebang}
|
|
117
|
+
`),map:void 0};if(!o&&e.includes(n.name)){const s=new Te(r);return s.prepend(`${t.shebang}
|
|
118
|
+
`),{code:s.toString(),map:i.sourcemap?s.generateMap({hires:!0}):void 0}}},order:"post"},async writeBundle(r,n){for(const[i,o]of Object.entries(n))if(o.type==="chunk"&&so.test(o.code)&&r.dir){const s=re(r.dir,i);await Da(s)}}}),"shebangPlugin"),I9=Uo(()=>({name:"packem:remove-shebang",renderChunk(e){return e.replace(so,"")}}),"removeShebangPlugin"),W9=Uo((e,t=`
|
|
119
|
+
`)=>{const r=so.exec(e);return r?`${r[0]}${t}`:""},"getShebang");var B9=Object.defineProperty,_e=g((e,t)=>B9(e,"name",{value:t,configurable:!0}),"C$7"),Jr=44,sh=59,Vp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ah=new Uint8Array(64),lh=new Uint8Array(128);for(let e=0;e<Vp.length;e++){const t=Vp.charCodeAt(e);ah[e]=t,lh[t]=e}function ge(e,t){let r=0,n=0,i=0;do{const s=e.next();i=lh[s],r|=(i&31)<<n,n+=5}while(i&32);const o=r&1;return r>>>=1,o&&(r=-2147483648|-r),t+r}g(ge,"h$9");_e(ge,"decodeInteger");function ce(e,t,r){let n=t-r;n=n<0?-n<<1|1:n<<1;do{let i=n&31;n>>>=5,n>0&&(i|=32),e.write(ah[i])}while(n>0);return t}g(ce,"i$8");_e(ce,"encodeInteger");function kt(e,t){return e.pos>=t?!1:e.peek()!==Jr}g(kt,"S$6");_e(kt,"hasMoreVlq");var Kp=1024*16,Yp=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode(e){return Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString()}}:{decode(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t}},Il=class{static{g(this,"T")}static{_e(this,"StringWriter")}constructor(){this.pos=0,this.out="",this.buffer=new Uint8Array(Kp)}write(t){const{buffer:r}=this;r[this.pos++]=t,this.pos===Kp&&(this.out+=Yp.decode(r),this.pos=0)}flush(){const{buffer:t,out:r,pos:n}=this;return n>0?r+Yp.decode(t.subarray(0,n)):r}},Wl=class{static{g(this,"w")}static{_e(this,"StringReader")}constructor(t){this.pos=0,this.buffer=t}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(t){const{buffer:r,pos:n}=this,i=r.indexOf(t,n);return i===-1?r.length:i}},ch=[];function D9(e){const{length:t}=e,r=new Wl(e),n=[],i=[];let o=0;for(;r.pos<t;r.pos++){o=ge(r,o);const s=ge(r,0);if(!kt(r,t)){const p=i.pop();p[2]=o,p[3]=s;continue}const a=ge(r,0),l=ge(r,0)&1?[o,s,0,0,a,ge(r,0)]:[o,s,0,0,a];let c=ch;if(kt(r,t)){c=[];do{const p=ge(r,0);c.push(p)}while(kt(r,t))}l.vars=c,n.push(l),i.push(l)}return n}g(D9,"z$4");_e(D9,"decodeOriginalScopes");function F9(e){const t=new Il;for(let r=0;r<e.length;)r=Bl(e,r,t,[0]);return t.flush()}g(F9,"F$7");_e(F9,"encodeOriginalScopes");function Bl(e,t,r,n){const i=e[t],{0:o,1:s,2:a,3:l,4:c,vars:p}=i;t>0&&r.write(Jr),n[0]=ce(r,o,n[0]),ce(r,s,0),ce(r,c,0);const u=i.length===6?1:0;ce(r,u,0),i.length===6&&ce(r,i[5],0);for(const d of p)ce(r,d,0);for(t++;t<e.length;){const d=e[t],{0:f,1:m}=d;if(f>a||f===a&&m>=l)break;t=Bl(e,t,r,n)}return r.write(Jr),n[0]=ce(r,a,n[0]),ce(r,l,0),t}g(Bl,"P$6");_e(Bl,"_encodeOriginalScopes");function L9(e){const{length:t}=e,r=new Wl(e),n=[],i=[];let o=0,s=0,a=0,l=0,c=0,p=0,u=0,d=0;do{const f=r.indexOf(";");let m=0;for(;r.pos<f;r.pos++){if(m=ge(r,m),!kt(r,f)){const $=i.pop();$[2]=o,$[3]=m;continue}const h=ge(r,0),v=h&1,b=h&2,w=h&4;let k=null,y=ch,x;if(v){const $=ge(r,s);a=ge(r,s===$?a:0),s=$,x=[o,m,0,0,$,a]}else x=[o,m,0,0];if(x.isScope=!!w,b){const $=l,E=c;l=ge(r,l);const O=$===l;c=ge(r,O?c:0),p=ge(r,O&&E===c?p:0),k=[l,c,p]}if(x.callsite=k,kt(r,f)){y=[];do{u=o,d=m;const $=ge(r,0);let E;if($<-1){E=[[ge(r,0)]];for(let O=-1;O>$;O--){const S=u;u=ge(r,u),d=ge(r,u===S?d:0);const j=ge(r,0);E.push([j,u,d])}}else E=[[$]];y.push(E)}while(kt(r,f))}x.bindings=y,n.push(x),i.push(x)}o++,r.pos=f+1}while(r.pos<t);return n}g(L9,"H$5");_e(L9,"decodeGeneratedRanges");function z9(e){if(e.length===0)return"";const t=new Il;for(let r=0;r<e.length;)r=Dl(e,r,t,[0,0,0,0,0,0,0]);return t.flush()}g(z9,"J$3");_e(z9,"encodeGeneratedRanges");function Dl(e,t,r,n){const i=e[t],{0:o,1:s,2:a,3:l,isScope:c,callsite:p,bindings:u}=i;n[0]<o?(Fa(r,n[0],o),n[0]=o,n[1]=0):t>0&&r.write(Jr),n[1]=ce(r,i[1],n[1]);const d=(i.length===6?1:0)|(p?2:0)|(c?4:0);if(ce(r,d,0),i.length===6){const{4:f,5:m}=i;f!==n[2]&&(n[3]=0),n[2]=ce(r,f,n[2]),n[3]=ce(r,m,n[3])}if(p){const{0:f,1:m,2:h}=i.callsite;f!==n[4]?(n[5]=0,n[6]=0):m!==n[5]&&(n[6]=0),n[4]=ce(r,f,n[4]),n[5]=ce(r,m,n[5]),n[6]=ce(r,h,n[6])}if(u)for(const f of u){f.length>1&&ce(r,-f.length,0);const m=f[0][0];ce(r,m,0);let h=o,v=s;for(let b=1;b<f.length;b++){const w=f[b];h=ce(r,w[1],h),v=ce(r,w[2],v),ce(r,w[0],0)}}for(t++;t<e.length;){const f=e[t],{0:m,1:h}=f;if(m>a||m===a&&h>=l)break;t=Dl(e,t,r,n)}return n[0]<a?(Fa(r,n[0],a),n[0]=a,n[1]=0):r.write(Jr),n[1]=ce(r,l,n[1]),t}g(Dl,"V$4");_e(Dl,"_encodeGeneratedRanges");function Fa(e,t,r){do e.write(sh);while(++t<r)}g(Fa,"U$4");_e(Fa,"catchupLine");function ph(e){const{length:t}=e,r=new Wl(e),n=[];let i=0,o=0,s=0,a=0,l=0;do{const c=r.indexOf(";"),p=[];let u=!0,d=0;for(i=0;r.pos<c;){let f;i=ge(r,i),i<d&&(u=!1),d=i,kt(r,c)?(o=ge(r,o),s=ge(r,s),a=ge(r,a),kt(r,c)?(l=ge(r,l),f=[i,o,s,a,l]):f=[i,o,s,a]):f=[i],p.push(f),r.pos++}u||uh(p),n.push(p),r.pos=c+1}while(r.pos<=t);return n}g(ph,"K$4");_e(ph,"decode");function uh(e){e.sort(dh)}g(uh,"Q$4");_e(uh,"sort");function dh(e,t){return e[0]-t[0]}g(dh,"X$5");_e(dh,"sortComparator");function fh(e){const t=new Il;let r=0,n=0,i=0,o=0;for(let s=0;s<e.length;s++){const a=e[s];if(s>0&&t.write(sh),a.length===0)continue;let l=0;for(let c=0;c<a.length;c++){const p=a[c];c>0&&t.write(Jr),l=ce(t,p[0],l),p.length!==1&&(r=ce(t,p[1],r),n=ce(t,p[2],n),i=ce(t,p[3],i),p.length!==4&&(o=ce(t,p[4],o)))}}return t.flush()}g(fh,"Z$4");_e(fh,"encode");var qi={exports:{}},q9=qi.exports,Xp;function H9(){return Xp||(Xp=1,(function(e,t){var r=Object.defineProperty,n=g((i,o)=>r(i,"name",{value:o,configurable:!0}),"i");(function(i,o){e.exports=o()})(q9,(function(){const i=/^[\w+.-]+:\/\//,o=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,s=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function a(y){return i.test(y)}g(a,"g"),n(a,"isAbsoluteUrl");function l(y){return y.startsWith("//")}g(l,"R"),n(l,"isSchemeRelativeUrl");function c(y){return y.startsWith("/")}g(c,"m"),n(c,"isAbsolutePath");function p(y){return y.startsWith("file:")}g(p,"v"),n(p,"isFileUrl");function u(y){return/^[.?#]/.test(y)}g(u,"d"),n(u,"isRelative");function d(y){const x=o.exec(y);return m(x[1],x[2]||"",x[3],x[4]||"",x[5]||"/",x[6]||"",x[7]||"")}g(d,"p"),n(d,"parseAbsoluteUrl");function f(y){const x=s.exec(y),$=x[2];return m("file:","",x[1]||"","",c($)?$:"/"+$,x[3]||"",x[4]||"")}g(f,"T"),n(f,"parseFileUrl");function m(y,x,$,E,O,S,j){return{scheme:y,user:x,host:$,port:E,path:O,query:S,hash:j,type:7}}g(m,"y"),n(m,"makeUrl");function h(y){if(l(y)){const $=d("http:"+y);return $.scheme="",$.type=6,$}if(c(y)){const $=d("http://foo.com"+y);return $.scheme="",$.host="",$.type=5,$}if(p(y))return f(y);if(a(y))return d(y);const x=d("http://foo.com/"+y);return x.scheme="",x.host="",x.type=y?y.startsWith("?")?3:y.startsWith("#")?2:4:1,x}g(h,"x"),n(h,"parseUrl");function v(y){if(y.endsWith("/.."))return y;const x=y.lastIndexOf("/");return y.slice(0,x+1)}g(v,"q"),n(v,"stripPathFilename");function b(y,x){w(x,x.type),y.path==="/"?y.path=x.path:y.path=v(x.path)+y.path}g(b,"w"),n(b,"mergePaths");function w(y,x){const $=x<=4,E=y.path.split("/");let O=1,S=0,j=!1;for(let N=1;N<E.length;N++){const q=E[N];if(!q){j=!0;continue}if(j=!1,q!=="."){if(q===".."){S?(j=!0,S--,O--):$&&(E[O++]=q);continue}E[O++]=q,S++}}let A="";for(let N=1;N<O;N++)A+="/"+E[N];(!A||j&&!A.endsWith("/.."))&&(A+="/"),y.path=A}g(w,"U"),n(w,"normalizePath");function k(y,x){if(!y&&!x)return"";const $=h(y);let E=$.type;if(x&&E!==7){const S=h(x),j=S.type;switch(E){case 1:$.hash=S.hash;case 2:$.query=S.query;case 3:case 4:b($,S);case 5:$.user=S.user,$.host=S.host,$.port=S.port;case 6:$.scheme=S.scheme}j>E&&(E=j)}w($,E);const O=$.query+$.hash;switch(E){case 2:case 3:return O;case 4:{const S=$.path.slice(1);return S?u(x||y)&&!u(S)?"./"+S+O:S+O:O||"."}case 5:return $.path+O;default:return $.scheme+"//"+$.user+$.host+$.port+$.path+O}}return g(k,"P"),n(k,"resolve"),k}))})(qi)),qi.exports}g(H9,"requireResolveUri_umd");var J9=H9();const U9=Yn(J9);var G9=Object.defineProperty,te=g((e,t)=>G9(e,"name",{value:t,configurable:!0}),"i$7");function mh(e){if(!e)return"";const t=e.lastIndexOf("/");return e.slice(0,t+1)}g(mh,"ae$4");te(mh,"stripFilename");function hh(e,t){const r=mh(e),n=t?t+"/":"";return i=>U9(n+(i||""),r)}g(hh,"ge$3");te(hh,"resolver");var ot=0,Fl=1,Ll=2,zl=3,gh=4,vh=1,bh=2;function yh(e,t){const r=La(e,0);if(r===e.length)return e;t||(e=e.slice());for(let n=r;n<e.length;n=La(e,n+1))e[n]=wh(e[n],t);return e}g(yh,"he$1");te(yh,"maybeSort");function La(e,t){for(let r=t;r<e.length;r++)if(!$h(e[r]))return r;return e.length}g(La,"X$4");te(La,"nextUnsortedSegmentLine");function $h(e){for(let t=1;t<e.length;t++)if(e[t][ot]<e[t-1][ot])return!1;return!0}g($h,"_e$1");te($h,"isSorted");function wh(e,t){return t||(e=e.slice()),e.sort(ql)}g(wh,"ve$1");te(wh,"sortSegments");function ql(e,t){return e[ot]-t[ot]}g(ql,"$$8");te(ql,"sortComparator");function xh(e,t){const r=t.map(()=>[]);for(let n=0;n<e.length;n++){const i=e[n];for(let o=0;o<i.length;o++){const s=i[o];if(s.length===1)continue;const a=s[Fl],l=s[Ll],c=s[zl],p=r[a];(p[l]||(p[l]=[])).push([c,n,s[ot]])}}for(let n=0;n<r.length;n++){const i=r[n];for(let o=0;o<i.length;o++){const s=i[o];s&&s.sort(ql)}}return r}g(xh,"Se$1");te(xh,"buildBySources");var tr=!1;function jh(e,t,r,n){for(;r<=n;){const i=r+(n-r>>1),o=e[i][ot]-t;if(o===0)return tr=!0,i;o<0?r=i+1:n=i-1}return tr=!1,r-1}g(jh,"Ee$1");te(jh,"binarySearch");function Hl(e,t,r){for(let n=r+1;n<e.length&&e[n][ot]===t;r=n++);return r}g(Hl,"H$4");te(Hl,"upperBound");function Jl(e,t,r){for(let n=r-1;n>=0&&e[n][ot]===t;r=n--);return r}g(Jl,"Y$3");te(Jl,"lowerBound");function Ul(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}g(Ul,"k$7");te(Ul,"memoizedState");function kh(e,t,r,n){const{lastKey:i,lastNeedle:o,lastIndex:s}=r;let a=0,l=e.length-1;if(n===i){if(t===o)return tr=s!==-1&&e[s][ot]===t,s;t>=o?a=s===-1?0:s:l=s}return r.lastKey=n,r.lastNeedle=t,r.lastIndex=jh(e,t,a,l)}g(kh,"Me$2");te(kh,"memoizedBinarySearch");function Go(e){return typeof e=="string"?JSON.parse(e):e}g(Go,"j$8");te(Go,"parse");var V9=te(function(e,t){const r=Go(e);if(!("sections"in r))return new Vl(r,t);const n=[],i=[],o=[],s=[],a=[];Gl(r,t,n,i,o,s,a,0,0,1/0,1/0);const l={version:3,file:r.file,names:s,sources:i,sourcesContent:o,mappings:n,ignoreList:a};return Ch(l)},"FlattenMap");function Gl(e,t,r,n,i,o,s,a,l,c,p){const{sections:u}=e;for(let d=0;d<u.length;d++){const{map:f,offset:m}=u[d];let h=c,v=p;if(d+1<u.length){const b=u[d+1].offset;h=Math.min(c,a+b.line),h===c?v=Math.min(p,l+b.column):h<c&&(v=l+b.column)}Eh(f,t,r,n,i,o,s,a+m.line,l+m.column,h,v)}}g(Gl,"ee$3");te(Gl,"recurse");function Eh(e,t,r,n,i,o,s,a,l,c,p){const u=Go(e);if("sections"in u)return Gl(...arguments);const d=new Vl(u,t),f=n.length,m=o.length,h=hr(d),{resolvedSources:v,sourcesContent:b,ignoreList:w}=d;if(Hi(n,v),Hi(o,d.names),b)Hi(i,b);else for(let k=0;k<v.length;k++)i.push(null);if(w)for(let k=0;k<w.length;k++)s.push(w[k]+f);for(let k=0;k<h.length;k++){const y=a+k;if(y>c)return;const x=Sh(r,y),$=k===0?l:0,E=h[k];for(let O=0;O<E.length;O++){const S=E[O],j=$+S[ot];if(y===c&&j>=p)return;if(S.length===1){x.push([j]);continue}const A=f+S[Fl],N=S[Ll],q=S[zl];x.push(S.length===4?[j,A,N,q]:[j,A,N,q,m+S[gh]])}}}g(Eh,"me$3");te(Eh,"addSection");function Hi(e,t){for(let r=0;r<t.length;r++)e.push(t[r])}g(Hi,"G$7");te(Hi,"append");function Sh(e,t){for(let r=e.length;r<=t;r++)e[r]=[];return e[t]}g(Sh,"xe$1");te(Sh,"getLine");var Oh="`line` must be greater than 0 (lines start at line 1)",Ah="`column` must be greater than or equal to 0 (columns start at column 0)",ao=-1,Vo=1,Vl=class{static{g(this,"R")}static{te(this,"TraceMap")}constructor(t,r){const n=typeof t=="string";if(!n&&t._decodedMemo)return t;const i=Go(t),{version:o,file:s,names:a,sourceRoot:l,sources:c,sourcesContent:p}=i;this.version=o,this.file=s,this.names=a||[],this.sourceRoot=l,this.sources=c,this.sourcesContent=p,this.ignoreList=i.ignoreList||i.x_google_ignoreList||void 0;const u=hh(r,l);this.resolvedSources=c.map(u);const{mappings:d}=i;if(typeof d=="string")this._encoded=d,this._decoded=void 0;else if(Array.isArray(d))this._encoded=void 0,this._decoded=yh(d,n);else throw i.sections?new Error("TraceMap passed sectioned source map, please use FlattenMap export instead"):new Error(`invalid source map: ${JSON.stringify(i)}`);this._decodedMemo=Ul(),this._bySources=void 0,this._bySourceMemos=void 0}};function Ph(e){var t,r;return(r=(t=e)._encoded)!=null?r:t._encoded=fh(e._decoded)}g(Ph,"oe$4");te(Ph,"encodedMappings");function hr(e){var t;return(t=e)._decoded||(t._decoded=ph(e._encoded))}g(hr,"O$9");te(hr,"decodedMappings");function K9(e,t,r){const n=hr(e);if(t>=n.length)return null;const i=n[t],o=li(i,e._decodedMemo,t,r,Vo);return o===-1?null:i[o]}g(K9,"Oe$2");te(K9,"traceSegment");function Y9(e,t){let{line:r,column:n,bias:i}=t;if(r--,r<0)throw new Error(Oh);if(n<0)throw new Error(Ah);const o=hr(e);if(r>=o.length)return On(null,null,null,null);const s=o[r],a=li(s,e._decodedMemo,r,n,i||Vo);if(a===-1)return On(null,null,null,null);const l=s[a];if(l.length===1)return On(null,null,null,null);const{names:c,resolvedSources:p}=e;return On(p[l[Fl]],l[Ll]+1,l[zl],l.length===5?c[l[gh]]:null)}g(Y9,"Le$1");te(Y9,"originalPositionFor");function X9(e,t){const{source:r,line:n,column:i,bias:o}=t;return Yl(e,r,n,i,o||Vo,!1)}g(X9,"ye$1");te(X9,"generatedPositionFor");function Z9(e,t){const{source:r,line:n,column:i,bias:o}=t;return Yl(e,r,n,i,o||ao,!0)}g(Z9,"Ce$2");te(Z9,"allGeneratedPositionsFor");function Q9(e,t){const r=hr(e),{names:n,resolvedSources:i}=e;for(let o=0;o<r.length;o++){const s=r[o];for(let a=0;a<s.length;a++){const l=s[a],c=o+1,p=l[0];let u=null,d=null,f=null,m=null;l.length!==1&&(u=i[l[1]],d=l[2]+1,f=l[3]),l.length===5&&(m=n[l[4]]),t({generatedLine:c,generatedColumn:p,source:u,originalLine:d,originalColumn:f,name:m})}}}g(Q9,"Ie$2");te(Q9,"eachMapping");function Kl(e,t){const{sources:r,resolvedSources:n}=e;let i=r.indexOf(t);return i===-1&&(i=n.indexOf(t)),i}g(Kl,"re$4");te(Kl,"sourceIndex");function e8(e,t){const{sourcesContent:r}=e;if(r==null)return null;const n=Kl(e,t);return n===-1?null:r[n]}g(e8,"Ne$1");te(e8,"sourceContentFor");function t8(e,t){const{ignoreList:r}=e;if(r==null)return!1;const n=Kl(e,t);return n===-1?!1:r.includes(n)}g(t8,"be$1");te(t8,"isIgnored");function Ch(e,t){const r=new Vl(Ko(e,[]),t);return r._decoded=e.mappings,r}g(Ch,"se$4");te(Ch,"presortedDecodedMap");function r8(e){return Ko(e,hr(e))}g(r8,"Re$1");te(r8,"decodedMap");function n8(e){return Ko(e,Ph(e))}g(n8,"we$1");te(n8,"encodedMap");function Ko(e,t){return{version:e.version,file:e.file,names:e.names,sourceRoot:e.sourceRoot,sources:e.sources,sourcesContent:e.sourcesContent,mappings:t,ignoreList:e.ignoreList||e.x_google_ignoreList}}g(Ko,"B$7");te(Ko,"clone");function On(e,t,r,n){return{source:e,line:t,column:r,name:n}}g(On,"b$9");te(On,"OMapping");function Cr(e,t){return{line:e,column:t}}g(Cr,"y$9");te(Cr,"GMapping");function li(e,t,r,n,i){let o=kh(e,n,t,r);return tr?o=(i===ao?Hl:Jl)(e,n,o):i===ao&&o++,o===-1||o===e.length?-1:o}g(li,"w$6");te(li,"traceSegmentInternal");function Rh(e,t,r,n,i){let o=li(e,t,r,n,Vo);if(!tr&&i===ao&&o++,o===-1||o===e.length)return[];const s=tr?n:e[o][ot];tr||(o=Jl(e,s,o));const a=Hl(e,s,o),l=[];for(;o<=a;o++){const c=e[o];l.push(Cr(c[vh]+1,c[bh]))}return l}g(Rh,"Ue$1");te(Rh,"sliceGeneratedPositions");function Yl(e,t,r,n,i,o){var s,a;if(r--,r<0)throw new Error(Oh);if(n<0)throw new Error(Ah);const{sources:l,resolvedSources:c}=e;let p=l.indexOf(t);if(p===-1&&(p=c.indexOf(t)),p===-1)return o?[]:Cr(null,null);const u=(s=e)._bySourceMemos||(s._bySourceMemos=l.map(Ul)),d=((a=e)._bySources||(a._bySources=xh(hr(e),u)))[p][r];if(d==null)return o?[]:Cr(null,null);const f=u[p];if(o)return Rh(d,f,r,n,i);const m=li(d,f,r,n,i);if(m===-1)return Cr(null,null);const h=d[m];return Cr(h[vh]+1,h[bh])}g(Yl,"ie$3");te(Yl,"generatedPosition");var i8=Object.defineProperty,o8=g((e,t)=>i8(e,"name",{value:t,configurable:!0}),"p$b"),s8=Object.defineProperty,Th=o8((e,t)=>s8(e,"name",{value:t,configurable:!0}),"c");const a8=Ze(import.meta.url),bn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Nh=Th(e=>{if(typeof bn<"u"&&bn.versions&&bn.versions.node){const[t,r]=bn.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return bn.getBuiltinModule(e)}return a8(e)},"__cjs_getBuiltinModule"),{readFileSync:Zp}=Nh("node:fs"),{resolve:l8,toNamespacedPath:sa,dirname:c8}=Nh("node:path");var p8=Object.defineProperty,ci=Th((e,t)=>p8(e,"name",{value:t,configurable:!0}),"s");const u8=/^data:application\/json[^,]+base64,/,d8=/\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+)[ \t]*$|\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*\*\/[ \t]*$/,f8=/\r?\n/,_h=ci(e=>u8.test(e),"isInlineMap"),aa=ci((e,t)=>{const r=e instanceof Error?e.message:String(e),n=`${t}:
|
|
120
|
+
${r}`;throw new Error(n)},"enhanceError"),m8=ci((e,t)=>{const r=e.split(f8);let n;for(let o=r.length-1;o>=0&&!n;o--)n=d8.exec(r[o])??void 0;if(!n)return;const i=n[1]??n[2];if(i)return _h(i)?i:l8(t,i)},"resolveSourceMapUrl"),h8=ci(e=>{const t=e.slice(e.indexOf(",")+1);return Buffer.from(t,"base64").toString()},"decodeInlineMap"),g8=ci(e=>{let t;try{t=Zp(e,{encoding:"utf8"})}catch(i){aa(i,`Error reading sourcemap for file "${sa(e)}"`)}const r=m8(t,c8(e));if(!r)return;let n;if(_h(r))n=h8(r);else try{n=Zp(r,{encoding:"utf8"})}catch(i){aa(i,`Error reading sourcemap for file "${sa(e)}"`)}try{return new V9(n,r)}catch(i){aa(i,`Error parsing sourcemap for file "${sa(e)}"`)}},"loadSourceMap");var v8=Object.defineProperty,b8=g((e,t)=>v8(e,"name",{value:t,configurable:!0}),"o$6"),y8=Object.defineProperty,$8=b8((e,t)=>y8(e,"name",{value:t,configurable:!0}),"o"),w8=Object.defineProperty,x8=$8((e,t)=>w8(e,"name",{value:t,configurable:!0}),"o");const j8=/\?[^?]*$/,k8=x8(({exclude:e,include:t}={})=>{const r=$t(t,e);return{async load(n){if(!r(n))return;let i;try{i=await nr(n,{buffer:!1}),this.addWatchFile(n)}catch{try{const s=n.replace(j8,"");i=await nr(s,{buffer:!1}),this.addWatchFile(s)}catch{this.warn("Failed reading file");return}}let o;try{const s=g8(n);if(s===void 0)return i;o=s}catch{return this.warn("Failed resolving source map"),{code:i}}return{code:i,map:o}},name:"packem:sourcemaps"}},"sourcemapsPlugin");var E8=Object.defineProperty,S8=g((e,t)=>E8(e,"name",{value:t,configurable:!0}),"b$8"),O8=Object.defineProperty,A8=S8((e,t)=>O8(e,"name",{value:t,configurable:!0}),"v"),P8=Object.defineProperty,Mh=A8((e,t)=>P8(e,"name",{value:t,configurable:!0}),"g");const C8=Mh(async(e,t)=>{await new Promise((r,n)=>{const i=tl(e);i.on("error",n);const o=Iv(t);o.on("error",n),o.on("finish",()=>{r(void 0)}),i.pipe(o)})},"copy"),R8=Mh(({destDir:e,emitFiles:t,exclude:r,fileName:n,include:i,limit:o,publicPath:s,sourceDir:a})=>{const l=$t(i,r),c={};return{async generateBundle(p){if(!t)return;const u=e??p.dir??ne(p.file??"");await xa(u),await Promise.all(Object.keys(c).map(async d=>{const f=c[d],m=G(u,ne(f));await xa(m),await C8(d,G(u,f))}))},async load(p){if(!l(p))return;this.addWatchFile(p);const[u,d]=await Promise.all([Xn(p),Yi(p)]);let f;if(o&&u.size>o||o===0){const m=rb.createHash("sha1").update(d).digest("hex").slice(0,16),h=Fr(p),v=Et(p,h),b=a?Be(a,ne(p)):Et(ne(p)),w=n.replaceAll("[hash]",m).replaceAll("[extname]",h).replaceAll("[dirname]",b===""?"":`${b}/`).replaceAll("[name]",v);f=G(s??"",w),c[p]=w}else{const m=Fm.getType(p);if(m===null)throw new Error(`Could not determine mimetype for ${p}`);f=m==="image/svg+xml"?Pv(d):d.toString("base64"),f=`data:${m};base64,${f}`}return`export default "${f}"`},name:"packem:url"}},"urlPlugin");var T8=Object.defineProperty,ct=g((e,t)=>T8(e,"name",{value:t,configurable:!0}),"u$c"),N8=Object.defineProperty,Fe=ct((e,t)=>N8(e,"name",{value:t,configurable:!0}),"u"),_8=Object.defineProperty,xi=Fe((e,t)=>_8(e,"name",{value:t,configurable:!0}),"i");let Ih=class{static{g(this,"A")}static{ct(this,"b")}static{Fe(this,"WalkerBase")}static{xi(this,"WalkerBase")}constructor(){this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:xi(()=>this.should_skip=!0,"skip"),remove:xi(()=>this.should_remove=!0,"remove"),replace:xi(t=>this.replacement=t,"replace")}}replace(t,r,n,i){t&&r&&(n!=null?t[r][n]=i:t[r]=i)}remove(t,r,n){t&&r&&(n!=null?t[r].splice(n,1):delete t[r])}};var M8=Object.defineProperty,An=Fe((e,t)=>M8(e,"name",{value:t,configurable:!0}),"c$1");let I8=class extends Ih{static{g(this,"E")}static{ct(this,"I")}static{Fe(this,"SyncWalker")}static{An(this,"SyncWalker")}constructor(t,r){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:An(()=>this.should_skip=!0,"skip"),remove:An(()=>this.should_remove=!0,"remove"),replace:An(n=>this.replacement=n,"replace")},this.enter=t,this.leave=r}visit(t,r,n,i){if(t){if(this.enter){const s=this.should_skip,a=this.should_remove,l=this.replacement;this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.enter.call(this.context,t,r,n,i),this.replacement&&(t=this.replacement,this.replace(r,n,i,t)),this.should_remove&&this.remove(r,n,i);const c=this.should_skip,p=this.should_remove;if(this.should_skip=s,this.should_remove=a,this.replacement=l,c)return t;if(p)return null}let o;for(o in t){const s=t[o];if(s&&typeof s=="object")if(Array.isArray(s)){const a=s;for(let l=0;l<a.length;l+=1){const c=a[l];Hn(c)&&(this.visit(c,t,o,l)||l--)}}else Hn(s)&&this.visit(s,t,o,null)}if(this.leave){const s=this.replacement,a=this.should_remove;this.replacement=null,this.should_remove=!1,this.leave.call(this.context,t,r,n,i),this.replacement&&(t=this.replacement,this.replace(r,n,i,t)),this.should_remove&&this.remove(r,n,i);const l=this.should_remove;if(this.replacement=s,this.should_remove=a,l)return null}}return t}};function Hn(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"}g(Hn,"_$4");ct(Hn,"k");Fe(Hn,"n");An(Hn,"isNode");var W8=Object.defineProperty,Pn=Fe((e,t)=>W8(e,"name",{value:t,configurable:!0}),"c");let B8=class extends Ih{static{g(this,"L")}static{ct(this,"E")}static{Fe(this,"AsyncWalker")}static{Pn(this,"AsyncWalker")}constructor(t,r){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:Pn(()=>this.should_skip=!0,"skip"),remove:Pn(()=>this.should_remove=!0,"remove"),replace:Pn(n=>this.replacement=n,"replace")},this.enter=t,this.leave=r}async visit(t,r,n,i){if(t){if(this.enter){const s=this.should_skip,a=this.should_remove,l=this.replacement;this.should_skip=!1,this.should_remove=!1,this.replacement=null,await this.enter.call(this.context,t,r,n,i),this.replacement&&(t=this.replacement,this.replace(r,n,i,t)),this.should_remove&&this.remove(r,n,i);const c=this.should_skip,p=this.should_remove;if(this.should_skip=s,this.should_remove=a,this.replacement=l,c)return t;if(p)return null}let o;for(o in t){const s=t[o];if(s&&typeof s=="object")if(Array.isArray(s)){const a=s;for(let l=0;l<a.length;l+=1){const c=a[l];Jn(c)&&(await this.visit(c,t,o,l)||l--)}}else Jn(s)&&await this.visit(s,t,o,null)}if(this.leave){const s=this.replacement,a=this.should_remove;this.replacement=null,this.should_remove=!1,await this.leave.call(this.context,t,r,n,i),this.replacement&&(t=this.replacement,this.replace(r,n,i,t)),this.should_remove&&this.remove(r,n,i);const l=this.should_remove;if(this.replacement=s,this.should_remove=a,l)return null}}return t}};function Jn(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"}g(Jn,"g$3");ct(Jn,"_");Fe(Jn,"a$1");Pn(Jn,"isNode");var D8=Object.defineProperty,Wh=Fe((e,t)=>D8(e,"name",{value:t,configurable:!0}),"a");function Yo(e,{enter:t,leave:r}){return new I8(t,r).visit(e,null)}g(Yo,"b$7");ct(Yo,"$");Fe(Yo,"walk");Wh(Yo,"walk");async function Xl(e,{enter:t,leave:r}){return await new B8(t,r).visit(e,null)}g(Xl,"T$4");ct(Xl,"M");Fe(Xl,"asyncWalk");Wh(Xl,"asyncWalk");var F8=Object.defineProperty,Ht=Fe((e,t)=>F8(e,"name",{value:t,configurable:!0}),"l");const L8=/\s/,z8=/\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\//g,q8=/MIT License|MIT license|BSD license/,H8=/\n{2,}/g,J8=/\b(\w+)\$\d+\b/g,U8=/[-/\\^$*+?.()|[\]{}]/g,G8=Ht(e=>e.replaceAll(U8,String.raw`\$&`),"escapeRegex"),V8=Ht(e=>[...new Set(e)],"unique"),K8=/\.[^/.]+$/;function Xo(e){return q8.test(e)?"":e}g(Xo,"w$4");ct(Xo,"x");Fe(Xo,"k");Ht(Xo,"stripLicenseComment");const Y8=Ht(e=>e.replaceAll(z8,Xo).replaceAll(H8,`
|
|
121
|
+
|
|
122
|
+
`),"cleanUnnecessaryComments"),Qp=new Map;function Zo(e,t,{identifierReplacements:r},n){const i=bo(e);let o=e;for(const a of Object.keys(r??{})){const l=i.find(p=>p.specifier===a&&p.imports.includes("{"));if(!l){this.warn(`${t.fileName} does not import "${a}" for replacement`),process.exitCode=1;continue}const c=r?.[a]??{};for(const p of Object.keys(c)){if(!l.imports.includes(p))throw new Error(`${t.fileName} does not import "${p}" from "${a}" for replacement`);const u=c[p],d=G8(p);u.includes(".")&&(o=o.replace(new RegExp(String.raw`\b\w+\b as ${d},?\s?`),"")),o=o.replaceAll(new RegExp(String.raw`\b${d}\b`,"g"),u)}}const s=V8(Array.from(o.matchAll(J8),a=>a[0]));if(s.length>0){const a=s.map(c=>`
|
|
123
|
+
- ${c}`).join(""),l=t.fileName.replace(K8,"");Qp.has(l)||n.warn({message:`${t.fileName} contains confusing identifier names${a}
|
|
124
|
+
|
|
125
|
+
To replace these, add them to the "rollup -> patchTypes -> identifierReplacements" option in your packem config.`,prefix:"plugin:patch-types"}),Qp.set(l,!0)}return o}g(Zo,"x$3");ct(Zo,"S");Fe(Zo,"O");Ht(Zo,"replaceConfusingTypeNames");function Qo(e,t){if(!e.includes("@internal"))return e;const r=new Te(e),n=yo(t.fileName,e,{lang:"dts",sourceType:"module"}),i=Ht(a=>{let l=a,c=!0;for(;c;){for(c=!1;l<e.length&&L8.test(e[l]);)l+=1;for(const p of n.comments)if(p.start===l){l=p.end,c=!0;break}}return l},"skipPastCommentsAndWhitespace"),o=[];for(const a of n.comments)a.type!=="Block"||!a.value.includes("@internal")||o.push({commentStart:a.start,nextStart:i(a.end)});o.length>0&&Yo(n.program,{enter(a){if(a.type==="Program")return;const{end:l,start:c}=a;if(typeof c!="number"||typeof l!="number")return;const p=o.findIndex(f=>f.nextStart===c);if(p===-1)return;const[{commentStart:u}]=o.splice(p,1),d=e[l]===","?l+1:l;r.remove(u,d),this.skip()}});const s=r.toString();if(s.includes("@internal"))throw new Error(`${t.fileName} has unhandled @internal declarations`);return s}g(Qo,"$$6");ct(Qo,"A");Fe(Qo,"v");Ht(Qo,"stripInternalTypes");const X8=Ht((e,t)=>({name:"packem:patch-types",renderChunk(r,n){return r=Zo.call(this,r,n,e,t),r=Qo.call(this,r,n),r=Y8(r),r}}),"patchTypescriptTypes");var Z8=Object.defineProperty,Q8=g((e,t)=>Z8(e,"name",{value:t,configurable:!0}),"d$b"),e3=Object.defineProperty,t3=Q8((e,t)=>e3(e,"name",{value:t,configurable:!0}),"d"),r3=Object.defineProperty,Ot=t3((e,t)=>r3(e,"name",{value:t,configurable:!0}),"o");const n3=/^\./,i3=/\0/,o3=42,s3=Ot(e=>{let t=!1;for(let r=0;r<e.length;r++)if(e.codePointAt(r)===o3){if(t)return!1;t=!0}return!0},"hasZeroOrOneAsteriskCharacter"),a3=Ot(e=>{const t=e.indexOf("*");return t===-1?void 0:{prefix:e.slice(0,t),suffix:e.slice(t+1)}},"tryParsePattern"),l3=Ot(({prefix:e,suffix:t},r)=>r.length>=e.length+t.length&&r.startsWith(e)&&r.endsWith(t),"isPatternMatch"),c3=Ot((e,t,r)=>{let n,i=-1;for(const o of e){const s=t(o);l3(s,r)&&s.prefix.length>i&&(i=s.prefix.length,n=o)}return n},"findBestPatternMatch"),p3=Ot((e,t)=>{const r=[];for(const n of e){if(!s3(n))continue;const i=a3(n);if(i)r.push(i);else if(n===t)return n}return c3(r,n=>n,t)},"matchPatternOrExact"),u3=Ot((e,t)=>t.substring(e.prefix.length,t.length-e.suffix.length),"matchedText"),d3=Ot(({prefix:e,suffix:t})=>`${e}*${t}`,"patternText"),f3=Ot((e,t,r)=>{let n=ne(t.path);t.config.compilerOptions?.baseUrl&&(n=re(e,t.config.compilerOptions.baseUrl)),r?.debug({message:`Resolved baseUrl to ${n}`,prefix:"plugin:resolve-tsconfig-paths"});const i=t.config.compilerOptions?.paths??{};return Object.keys(i).length===0&&r?.debug({message:"No paths found in tsconfig.json",prefix:"plugin:resolve-tsconfig-paths"}),{paths:i,resolvedBaseUrl:n}},"getTsconfigPaths"),Bh=Ot((e,t,r,n)=>{const{paths:i,resolvedBaseUrl:o}=f3(e,t,r),s=Object.keys(i);return{name:"plugin:resolve-tsconfig-paths",resolveId:{filter:{id:{exclude:[n3,i3]}},async handler(a,l,c){if(s.length===0)return;if(a.includes("\0")){r.debug({message:`Skipping resolution of ${a} as it is a virtual module`,prefix:"plugin:resolve-tsconfig-paths"});return}if(a.includes("node_modules")){r.debug({message:`Skipping request as it is inside node_modules ${a}`,prefix:"plugin:resolve-tsconfig-paths"});return}if(!n.resolveAbsolutePath&&Ya(a)){r.debug({message:`Skipping request as it is an absolute path ${a}`,prefix:"plugin:resolve-tsconfig-paths"});return}if(rd(a)){r.debug({message:`Skipping request as it is a relative path ${a}`,prefix:"plugin:resolve-tsconfig-paths"});return}const p=p3(s,a);if(!p){r.debug({message:`moduleName did not match any paths pattern ${a}`,prefix:"plugin:resolve-tsconfig-paths"});return}const u=typeof p=="string"?void 0:u3(p,a),d=typeof p=="string"?p:d3(p);for(const f of i[d]){const m=u?f.replace("*",u):f;if(m.endsWith(".d.ts")||m.endsWith(".d.cts")||m.endsWith(".d.mts"))continue;const h=G(o,m);try{const v=await this.resolve(h,l,{skipSelf:!0,...c});if(v)return v}catch(v){r.debug({context:[v],message:`Failed to resolve ${h} from ${a}`,prefix:"plugin:resolve-tsconfig-paths"})}}}}}},"resolveTsconfigPathsPlugin");var m3=Object.defineProperty,h3=g((e,t)=>m3(e,"name",{value:t,configurable:!0}),"f$9"),g3=Object.defineProperty,v3=h3((e,t)=>g3(e,"name",{value:t,configurable:!0}),"a"),b3=Object.defineProperty,Dh=v3((e,t)=>b3(e,"name",{value:t,configurable:!0}),"u");const y3=/^\./,$3=Dh((e,t)=>{if(!t)return;const{config:r,path:n}=t;if(!r.compilerOptions)return;const{rootDirs:i}=r.compilerOptions;if(!i)return;const o=[];for(const s of i){if(s.startsWith("."))throw new Error(`Invalid rootDir value '.' in ${n}.`);if(s.startsWith(".."))throw new Error(`Invalid rootDir value '..' in ${n}.`);o.push(re(e,s))}return o},"getRootDirectories"),Fh=Dh((e,t,r)=>{const n=$3(e,r);return{name:"packem:resolve-tsconfig-root-dirs",resolveId:{filter:{id:y3},async handler(i,o,s){if(!(n===void 0||n.length===0)&&i.startsWith("."))for(const a of n){const l=G(a,i),c=await this.resolve(l,o,{skipSelf:!0,...s});if(c)return t.debug({message:`Resolved ${i} to ${c.id} using rootDirs from tsconfig.json.`,prefix:"plugin:resolve-tsconfig-root-dirs"}),c.id}}}}},"resolveTsconfigRootDirectories");var w3=Object.defineProperty,x3=g((e,t)=>w3(e,"name",{value:t,configurable:!0}),"l$c"),j3=Object.defineProperty,k3=x3((e,t)=>j3(e,"name",{value:t,configurable:!0}),"l"),E3=Object.defineProperty,Zl=k3((e,t)=>E3(e,"name",{value:t,configurable:!0}),"l");const S3={".cjs":[".cts"],".js":[".ts",".tsx"],".jsx":[".tsx",".ts"],".mjs":[".mts"]},eu=/\.(?:[mc]?js|jsx)$/,O3=Zl(e=>{const t=e[0];return!(t==="."||t==="/"||t==="#"||Fv(e))},"isBareSpecifier"),tu=Zl(async(e,t,r,n,i,o)=>{for(const s of t)try{const a=await e.resolve(r+s,n,i);if(a)return a}catch(a){if(!o)throw a}},"tryRewrites"),Lh=Zl(()=>({name:"packem:resolve-typescript-mjs-cjs",resolveId:{filter:{id:eu},async handler(e,t,r){if(!t)return;const n=eu.exec(e);if(!n)return;const i=n[0],o=S3[i];if(!o)return;const s=e.slice(0,-i.length),a={...r,skipSelf:!0};return!O3(e)&&!t.includes("/node_modules/")&&!e.includes("/node_modules/")?tu(this,o,s,t,a,!1):await this.resolve(e,t,a)||tu(this,o,s,t,a,!0)}}}),"resolveTypescriptMjsCts");var A3=Object.defineProperty,P3=g((e,t)=>A3(e,"name",{value:t,configurable:!0}),"b$4"),C3=Object.defineProperty,zh=P3((e,t)=>C3(e,"name",{value:t,configurable:!0}),"S"),R3=Object.defineProperty,Lt=zh((e,t)=>R3(e,"name",{value:t,configurable:!0}),"h");const T3=/^export\s+default\s+(\w+);/m,N3=/export\s*\{([^}]*)\}/,_3=/\s*as\s+default\s*/,M3=/\s+\}$/,ji=/;$/,I3=/(?:\r?\n\s*){2,}/g,la=/^type\s+/,ru=/\bas\s+default\b/,W3=Lt((e,t,r)=>{const n=Gv(e).find(l=>l.names.includes("default")),i=T3.exec(e);if(i?.[1])return{defaultAlias:i[1],defaultExport:{code:i[0],end:i.index+i[0].length,names:["default"],specifier:void 0,start:i.index,type:"default"},exports:[]};if(!n)return;const o=N3.exec(n.code);if(!o?.length){r.warn?.(`A default export was indicated in ${t.fileName}, but its structure could not be parsed.`);return}let s;const a=[];for(const l of o[1].split(",").map(c=>c.trim())){if(l==="default"){s=l;continue}const c=_3.exec(l);c?s=l.replace(c[0],""):a.push(l)}if(!s){r.warn?.(`A default export was indicated in ${t.fileName}, but its alias could not be determined from the export statement.`);return}return{defaultAlias:s,defaultExport:n,exports:a}},"extractExports"),B3=Lt((e,t,r)=>{if("declarations"in t&&t.declarations.length>0){const n=t.declarations[0];if(n?.id.type==="Identifier"){e.set(n.id.name,{declare:t.declare===!0,end:t.end,isVariable:!0,start:t.start});return}}if("id"in t&&t.id?.type==="Identifier"){const{name:n}=t.id;e.set(n,{declare:t.declare===!0,end:t.end,isClass:t.type==="ClassDeclaration",start:t.start});return}e.set(r(),{declare:t.declare===!0,end:t.end,start:t.start})},"prepareDeclaration"),Un=Lt((e,t,r,n)=>{const i=yo(r.fileName,e,{astType:"ts",lang:"ts",sourceType:"module"});let o,s=0;const a=Lt(()=>(s+=1,`__unnamed_${String(s)}$$`),"generateUnnamed"),l=new Map,c=new Map,{program:p}=i;for(const m of p.body)if(m.type==="ExportNamedDeclaration")for(const h of m.specifiers)h.exported.type==="Identifier"&&(h.exported.name==="default"?h.local.type==="Identifier"&&(o={end:h.end,local:h.local.name,start:h.start}):c.set(h.exported.name,{type:h.exportKind==="type"}));else{if(m.type==="ImportDeclaration")continue;switch(m.type){case"ClassDeclaration":case"FunctionDeclaration":case"TSDeclareFunction":case"TSEnumDeclaration":case"TSInterfaceDeclaration":case"TSTypeAliasDeclaration":case"VariableDeclaration":{B3(l,m,a);break}case"TSImportEqualsDeclaration":case"TSModuleDeclaration":{l.set(a(),{declare:!1,end:m.end,start:m.start});break}}}const u=[];if(o)for(const[m,h]of c.entries())m!==o.local&&h.type&&u.push(m);if(!o){const m=[...c.values()].every(h=>h.type);return t.startsWith("export type")&&c.size>0&&m||n.warn?.(`Cannot infer default export from the file: ${r.fileName}`),t}if(!l.get(o.local))return n.warn?.(`Cannot infer default export from the file: ${r.fileName}. Declaration for '${o.local}' not found.`),t;const d=t,f=new Te(`${d}
|
|
126
|
+
declare namespace ${o.local} {
|
|
127
|
+
`);for(const[m,h]of l.entries()){if(u.includes(m)&&m!==o.local)continue;const v=e.slice(h.start,h.end).replace(M3," }");f.append(" "),h.declare?f.append(v.replace("declare","export").replaceAll(" "," ")):f.append(`export ${v}`.replaceAll(" "," ")),f.append(`
|
|
128
|
+
`)}return f.append(` import _default = ${o.local};
|
|
129
|
+
export { _default as default };
|
|
130
|
+
`),f.append(`}
|
|
131
|
+
export = ${o.local};
|
|
132
|
+
`),f.toString()},"createCjsNamespace"),ca=Lt((e,t,r)=>{const{defaultExport:n,exports:i}=t;if(r){const u=i.length===0?`export = ${r.defaultImport??""};`:`// @ts-ignore
|
|
133
|
+
export = ${r.defaultImport??""};
|
|
134
|
+
export { ${i.join(", ")} } from '${n.specifier??""}'`,d=e.replace(n.code.replace(ji,""),u.replace(ji,""));return d.endsWith(";")?d:`${d};`}const o=`import _default from '${n.specifier??""}';`,s=new Te(e),a=bo(e),l=a.length>0?a.at(-1):void 0;l?.end!==void 0&&l.end>0?s.appendRight(l.end,`
|
|
135
|
+
${o}
|
|
136
|
+
`):s.prepend(`${o}
|
|
137
|
+
`);let c=s.toString();c=c.replaceAll(I3,`
|
|
138
|
+
`);let p;if(i.length===0)p=c.replace(n.code.replace(ji,""),"export = _default");else{const u=`// @ts-ignore
|
|
139
|
+
export = _default;
|
|
140
|
+
export { ${i.join(", ")} } from '${n.specifier??""}';`;p=c.replace(n.code.replace(ji,""),u)}return p.replaceAll(";;",";")},"handleDefaultCJSExportAsDefault"),D3=Lt((e,t,r,n,i,o)=>{const{defaultAlias:s,defaultExport:a,exports:l}=r;if(o){if(o.namedImports?.[s]===s){if(l.length===0)return e.replace(a.code,`export = ${s}`);const f=`export { ${l.join(", ")} } from '${a.specifier??""}'`,m=new Te(e).replace(a.code,f).toString();return Un(e,m,t,i)}i.warn?.(`Cannot parse "${s}" named export from ${o.specifier} import at ${t.fileName}!.`);return}const c=`import { ${s} } from '${a.specifier??""}';
|
|
141
|
+
`;let p=e;const u=n.length>0?n.at(-1)?.end??0:0,d=new Te(p);if(u>0?d.appendRight(u,`
|
|
142
|
+
${c}`):d.prepend(c),p=d.toString(),l.length>0){const f=`export { ${l.join(", ")} } from '${a.specifier??""}'`,m=new Te(p).replace(a.code,f).toString();return Un(e,m,t,i)}return new Te(p).replace(a.code,`export = ${s}`).toString()},"handleDefaultNamedCJSExport"),nu=Lt((e,t,{defaultAlias:r,defaultExport:n,exports:i},o)=>{const s=i.filter(l=>la.test(l)),a=i.filter(l=>!la.test(l));if(s.length>0){let l="";return r&&(l+=`// @ts-ignore
|
|
143
|
+
${r};
|
|
144
|
+
`),l+=`export type { ${s.map(c=>c.replace(la,"").trim()).join(", ")} };
|
|
145
|
+
`,a.length>0&&(l+=`export { ${a.join(", ")} };
|
|
146
|
+
`),Un(e,l.trim(),t,o)}if(r&&a.length>0&&s.length===0){let l=`// @ts-ignore
|
|
147
|
+
${r};
|
|
148
|
+
`;return l+=`export { ${a.join(", ")} };
|
|
149
|
+
`,Un(e,l.trim(),t,o)}if(r&&a.length===0&&s.length===0){const l=new RegExp(String.raw`^export\\s+default\\s+${r};`,"m").exec(e);return l?`${e.slice(0,Math.max(0,l.index))}export = ${r};`:e.replace(n.code,`export = ${r};`).replace(";;",";")}},"handleNoSpecifierDefaultCJSExport"),F3=/^export\s+default\s+from\s+['"]([^'"]+)['"];?$/m,L3=Lt((e,t,r)=>{const n=F3.exec(e);if(n)return{code:`import _default from '${n[1]??""}';
|
|
150
|
+
export = _default;`,map:void 0};const i=W3(e,t,r);if(i){let l;if(i.defaultExport.specifier){const{specifier:c}=i.defaultExport,p=bo(e),u=p.filter(b=>b.imports).map(b=>Vv(b)),d=u.find(b=>b.specifier===c),{defaultAlias:f,defaultExport:m,exports:h}=i,v=m.exports;if(f==="default"&&m.specifier&&h.length>0)l=ca(e,i,d);else if(f==="default"&&m.specifier&&h.length===0&&v&&ru.test(v))u.find(b=>b.specifier===m.specifier)?.defaultImport?l=ca(e,i,d):(r.warn?.(`Cannot parse default export name from ${m.specifier} import at ${t.fileName}!. The module might not have a default export, or it's aliased as 'default'.`),l=void 0);else if(f==="default"&&m.specifier&&h.length===0)l=ca(e,i,d);else if(m.specifier&&f!=="default"){l=D3(e,t,i,p,r,d);const b=d&&i.defaultExport.specifier&&f!=="default"&&d.namedImports?.[f]!==f;if(!(l===void 0&&b)&&l===void 0&&!(f==="default"&&h.length===0&&v&&ru.test(v))){const w=nu(e,t,i,r);w&&(l=w)}}}else l=nu(e,t,i,r);return l?{code:l,map:void 0}:void 0}const o=yo(t.fileName,e,{astType:"ts",lang:"ts",sourceType:"module"});let s=[],a=!1;if(o.program.body.length>0){const l=o.program.body.at(-1);l?.type==="ExportNamedDeclaration"&&!l.declaration&&l.specifiers.length>0&&l.specifiers.every(c=>c.exportKind==="type")&&(a=!0,s=l.specifiers.map(c=>c.local.type==="Identifier"?c.local.name:"").filter(Boolean))}if(a&&s.length>0){const l=`export type { ${s.join(", ")} };`,c=Un(e,l,t,r);return c?{code:c,map:void 0}:void 0}},"fixDtsDefaultCJSExports");var z3=Object.defineProperty,iu=zh((e,t)=>z3(e,"name",{value:t,configurable:!0}),"s");const q3=/\.d\.c?ts$/,H3=iu((e={})=>{const{matcher:t=iu(r=>r.exports.length>0&&q3.test(r.fileName)&&r.isEntry,"matcher")}=e;return{name:"packem:fix-dts-default-cjs-exports-plugin",renderChunk(r,n){return t(n)?L3(r,{fileName:n.fileName,imports:n.imports},{warn:this.warn}):void 0}}},"fixDtsDefaultCjsExportsPlugin");var J3=Object.defineProperty,U3=g((e,t)=>J3(e,"name",{value:t,configurable:!0}),"r$4");const es=U3((e,t={},r={})=>({...t,...e,values:e.values?{...e.values}:{...r}}),"cloneReplaceOptions");var G3=Object.defineProperty,V3=g((e,t)=>G3(e,"name",{value:t,configurable:!0}),"n$8");const Gn=V3(e=>!!e?.endsWith(".d"),"isDeclarationOnlyName");var K3=Object.defineProperty,ae=g((e,t)=>K3(e,"name",{value:t,configurable:!0}),"i$6");const ve=ae(e=>e.logger,"getLogger"),Y3=/Circular dependency:[\s\S]*node_modules/,X3=/\.mts$/,Z3=/\.(?:m|c)?(?:j|t)sx?$/,Q3=/^['|"](use (\w+))['|"]$/,eA=/\.(?:[cm]?jsx?|[cm]?tsx?|json)$/,tA=ae(e=>e instanceof RegExp?e.source:e,"regExpOrStringToString"),rA=ae(e=>{if(typeof e=="boolean")return String(e);const t=[];for(const r of e)t.push(tA(r));return t.toSorted((r,n)=>r.localeCompare(n)).join(",")},"computeDtsResolveKey"),ou=ae((e,t)=>t?r=>{if(!Gn(r.name))return`${r.name}.${e()}`}:r=>{if(!Gn(r.name))return Tn(r,e())},"createChunkFileNames"),su=ae((e,t)=>t?r=>{const{name:n}=r;if(!Gn(n))return`${n??"[name]"}.${e(r)}`}:r=>{const{name:n}=r;if(!Gn(n))return Cv(r,e(r))},"createEntryFileNames"),qh=ae(e=>{const t=`node${Gi.node.split(".")[0]}`;if(!e.pkg.engines?.node)return t;const r=nt.minVersion(e.pkg.engines.node);return r?`node${String(r.major)}`:t},"resolveNodeTarget"),Hh=ae((e,t,r)=>{if(t){const n=xv(t);return e.options.runtime==="node"?[...new Set([r,...n])]:e.options.runtime==="browser"?[...new Set([...uc(e.options.browserTargets??[]),...n])]:n}return e.options.runtime==="node"?[r]:uc(e.options.browserTargets??[])},"resolveTransformerTarget"),nA=ae((e,t)=>{if(!e.options.rollup.esbuild)throw new Error("No esbuild options found in your configuration.");return e.tsconfig?.config.compilerOptions?.target?.toLowerCase()==="es3"&&(ve(e).warn(["ES3 target is not supported by esbuild, so ES5 will be used instead..","Please set 'target' option in tsconfig to at least ES5 to disable this error"].join(" ")),e.tsconfig.config.compilerOptions.target="es5",e.options.rollup.esbuild.target="es5"),e.options.rollup.esbuild.target=Hh(e,e.options.rollup.esbuild.target,t),e.options.minify||(e.options.rollup.esbuild.keepNames=!1,ve(e).debug("Disabling keepNames because minify is disabled")),e.tsconfig?.config.compilerOptions?.target==="es5"&&(e.options.rollup.esbuild.keepNames=!1,ve(e).debug("Disabling keepNames because target is set to es5")),{logger:ve(e),minify:e.options.minify,minifyWhitespace:e.options.minify,sourceMap:e.options.sourcemap,...e.options.rollup.esbuild}},"getEsbuildTransformerConfig"),iA=ae(e=>{if(!e.options.rollup.swc)throw new Error("No swc options found in your configuration.");return{minify:e.options.minify,...e.options.rollup.swc,jsc:{minify:{compress:{directives:!1,passes:2},format:{comments:"some"},mangle:{topLevel:!0},sourceMap:e.options.sourcemap,toplevel:e.options.emitCJS??e.options.emitESM},...e.options.rollup.swc.jsc},sourceMaps:e.options.sourcemap}},"getSwcTransformerConfig"),Jh=ae((e,t)=>{if(!e.options.rollup.oxc)throw new Error("No oxc options found in your configuration.");const{jsx:r}=e.options.rollup.oxc;let n;return typeof r=="string"?n=r:r?n={...r,refresh:!1}:n=void 0,e.options.rollup.oxc={...e.options.rollup.oxc,cwd:e.options.rootDir,jsx:n,sourcemap:e.options.sourcemap,typescript:e.tsconfig?.config?{allowDeclareFields:!0,allowNamespaces:!0,declaration:void 0,jsxPragma:e.tsconfig.config.compilerOptions?.jsxFactory,jsxPragmaFrag:e.tsconfig.config.compilerOptions?.jsxFragmentFactory,onlyRemoveTypeImports:!0,rewriteImportExtensions:!1}:void 0},e.options.rollup.oxc.target=Hh(e,e.options.rollup.oxc.target,t),e.options.rollup.oxc},"getOxcTransformerConfig"),oA=ae((e,t,r)=>{if(r)return"js";if(t.facadeModuleId?.endsWith(".mts")){const n=t.facadeModuleId.replace(X3,".cts");if(el(n))return"mjs"}return!e.options.emitCJS&&e.options.emitESM&&e.pkg.main?.endsWith(".cjs")?"mjs":Ye(e,"esm")},"resolveEsmEntryExtension"),sA=ae((e,t)=>{const r=qh(t);if(e==="esbuild")return nA(t,r);if(e==="swc")return iA(t);if(e==="sucrase"){if(!t.options.rollup.sucrase)throw new Error("No sucrase options found in your configuration.");return t.options.rollup.sucrase}if(e==="oxc")return Jh(t,r);throw new Error("A Unknown transformer was provided")},"getTransformerConfig"),aA=ae(e=>{const{browser:t,exportConditions:r}=e,n={...e};delete n.allowExportsFolderMapping,delete n.browser,delete n.exportConditions,delete n.preferBuiltins,delete n.unresolvedImportBehavior;const i=new Set(Array.isArray(n.conditionNames)?n.conditionNames:[]);return Array.isArray(r)&&(n.conditionNames=[...new Set([...r,...i])]),t&&(n.conditionNames=[...new Set(["browser",...n.conditionNames??[]])],n.aliasFields=[["browser"],...n.aliasFields??[]]),n},"mergeNodeResolveIntoOxc"),Uh=ae(e=>{const{resolve:t}=e.options.rollup;if(t)return av(aA(t),e.options.rootDir,ve(e),e.tsconfig?.path)},"createNodeResolver"),Gh=ae((e,t)=>{if(e.code==="CIRCULAR_DEPENDENCY"&&Y3.test(e.message))return!0;if(e.code==="UNRESOLVED_IMPORT"){const{resolve:r}=t.options.rollup;if(r&&r.unresolvedImportBehavior==="warn")return!1;const n=new Error(`Failed to resolve the module "${e.exporter??""}" imported by "${pe(Be(re(),e.id??""))}"
|
|
151
|
+
Is the module installed? Note:
|
|
152
|
+
↳ to inline a module into your bundle, install it to "devDependencies".
|
|
153
|
+
↳ to depend on a module via import/require, install it to "dependencies".`);throw n.id=e.id,n}return e.code==="MODULE_LEVEL_DIRECTIVE"?!0:e.code==="MIXED_EXPORTS"&&(t.options.cjsInterop??!1)},"sharedOnWarn"),lA=ae(e=>{const t={};for(const r of e.options.entries){if(r.name===void 0)continue;const{name:n}=r,i=re(e.options.rootDir,r.input);if(t[n]!==void 0&&t[n]!==i)throw new Error(`Duplicate rollup input name "${n}" — one maps to "${t[n]}", another to "${i}". Each entry must have a unique name.`);t[n]=i}return t},"buildInputMap"),cA=ae(e=>e.stack?`${e.message}
|
|
154
|
+
${e.stack}`:e.message,"formatRollupLog"),pA=ae((e,t,r,n)=>{if(t==="dts"&&n.code==="EMPTY_BUNDLE")return;const i=cA(n),o=t+(n.plugin?`:plugin:${n.plugin}`:"");switch(r){case"info":{ve(e).info({message:i,prefix:o});return}case"warn":{ve(e).warn({message:i,prefix:o});return}case"debug":ve(e).debug({message:i,prefix:o})}},"handleRollupLog"),Vh=ae((e,t)=>({input:lA(e),logLevel:e.options.debug?"debug":"info",onLog:ae((r,n)=>{pA(e,t,r,n)},"onLog"),onwarn(r,n){Gh(r,e)||r.code||n(r)},preserveEntrySignatures:"strict",treeshake:{moduleSideEffects:!0,preset:"smallest"},watch:e.mode==="watch"?e.options.rollup.watch:!1}),"baseRollupOptions"),uA=ae((e,t,r,n)=>{const i={...e.options.rollup.alias,entries:t};return!r&&n&&(i.customResolver=n),pd(i)},"buildAliasPlugin"),dA=ae(e=>{if(!e.options.rollup.pure)return{pureNewExpressionPluginInstance:void 0,purePluginInstance:void 0};const t=lv({...e.options.rollup.pure,functions:["Object.defineProperty","Object.assign","Object.create","Object.freeze","Object.seal","Object.setPrototypeOf","Object.getOwnPropertyDescriptor","Object.getOwnPropertyDescriptors","Object.getPrototypeOf","Object.hasOwnProperty","Object.isExtensible","Object.isFrozen","Object.isSealed","Symbol","Symbol.for","Symbol.keyFor","Symbol.iterator","Symbol.asyncIterator","Symbol.hasInstance","Symbol.isConcatSpreadable","Symbol.species","Symbol.toPrimitive","Symbol.toStringTag","Proxy","Reflect.apply","Reflect.construct","Reflect.defineProperty","Reflect.deleteProperty","Reflect.get","Reflect.getOwnPropertyDescriptor","Reflect.getPrototypeOf","Reflect.has","Reflect.isExtensible","Reflect.ownKeys","Reflect.preventExtensions","Reflect.set","Reflect.setPrototypeOf","WeakMap","WeakSet","WeakRef","Array.from","Array.of","Array.isArray","Number.isFinite","Number.isInteger","Number.isNaN","Number.isSafeInteger","Number.parseFloat","Number.parseInt","String.fromCharCode","String.fromCodePoint","String.raw","Date.now","Date.parse","Date.UTC","Math.abs","Math.acos","Math.acosh","Math.asin","Math.asinh","Math.atan","Math.atan2","Math.atanh","Math.cbrt","Math.ceil","Math.clz32","Math.cos","Math.cosh","Math.exp","Math.expm1","Math.floor","Math.fround","Math.hypot","Math.imul","Math.log","Math.log10","Math.log1p","Math.log2","Math.max","Math.min","Math.pow","Math.random","Math.round","Math.sign","Math.sin","Math.sinh","Math.sqrt","Math.tan","Math.tanh","Math.trunc","JSON.parse","JSON.stringify","require.resolve","Buffer.from","Buffer.alloc","Buffer.allocUnsafe","Buffer.isBuffer",...e.options.rollup.pure.functions??[]],sourcemap:e.options.sourcemap});return t.transform.order="pre",{pureNewExpressionPluginInstance:cv({constructors:["Proxy","WeakMap","WeakSet","WeakRef",...e.options.rollup.pure.functions?.filter(r=>typeof r=="string"&&!r.includes("."))??[]],sourcemap:e.options.sourcemap}),purePluginInstance:t}},"buildPurePlugins"),fA=ae((e,t,r)=>{if(e.pkg.peerDependenciesMeta)for(const[n,i]of Object.entries(e.pkg.peerDependenciesMeta))i&&typeof i=="object"&&"optional"in i&&i.optional&&n in t&&r.push(n)},"collectOptionalPeerDeps"),mA=ae((e,t,r)=>{if(!e.options.rollup.resolveExternals?.devDeps)for(const n of Object.keys(e.pkg.devDependencies??{}))e.usedDependencies.has(n)&&!(n in t)&&r.push(n)},"collectBundledDevDeps"),hA=ae(e=>{const t=new Set,r=[];for(const n of e)typeof n=="string"?t.has(n)||(t.add(n),r.push(n)):r.push(n);return r},"dedupeResolvePatterns"),gA=ae(e=>{const t=e.options.rollup.dts?.resolve;if(t===!1)return!1;if(t===!0)return!0;const r=Object.keys(e.pkg.optionalDependencies??{}),n=e.pkg.peerDependencies??{};return fA(e,n,r),mA(e,n,r),r.length===0&&!t?!1:hA([...r,...t??[]])},"computeDtsResolve"),vA=ae(async(e,t)=>{const{dts:r}=await import("@visulima/rollup-plugin-dts"),n=e.options.rollup.dts??{};return r({...n,compilerOptions:{...n.compilerOptions,incremental:void 0,inlineSources:void 0,lib:void 0,sourceMap:void 0,tsBuildInfoFile:void 0},emitDtsOnly:!0,resolve:t,tsconfig:e.tsconfig?.path})},"createDtsPlugin"),bA=Za(vA),Kh=ae(async(e,t)=>{const r=Do(e.pkg,e.options),n=gA(e),i=Uh(e),o=rA(n),s=e.options.entries.map(u=>u.name??"").filter(u=>u!=="").toSorted((u,d)=>u.localeCompare(d)).join(","),a=`dts-plugin:${String(process.pid)}${e.tsconfig?.path??""}:${o}:${s}`,[l,c,p]=gd(e.options.rollup.plugins,"dts");return{...Vh(e,"dts"),onwarn(u,d){Gh(u,e)||u.code!=="EMPTY_BUNDLE"&&u.code!=="CIRCULAR_DEPENDENCY"&&d(u)},output:[e.options.emitCJS&&{chunkFileNames:ae(u=>Tn(u,gt(e,"cjs")),"chunkFileNames"),compact:e.options.minify,dir:re(e.options.rootDir,e.options.outDir),entryFileNames:`[name].${gt(e,"cjs")}`,format:"cjs",sourcemap:e.options.sourcemap,...e.options.rollup.output},e.options.emitESM&&{chunkFileNames:ae(u=>Tn(u,gt(e,"esm")),"chunkFileNames"),compact:e.options.minify,dir:re(e.options.rootDir,e.options.outDir),entryFileNames:`[name].${gt(e,"esm")}`,format:"esm",sourcemap:e.options.sourcemap,...e.options.rollup.output},e.options.declaration==="compatible"&&{chunkFileNames:ae(u=>Tn(u,"d.mjs"),"chunkFileNames"),compact:e.options.minify,dir:re(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.ts",format:"cjs",sourcemap:e.options.sourcemap,...e.options.rollup.output}].filter(Boolean),plugins:[ud(),Me(Mm(),t),Me(Lh(),t),Qm(e,{dtsResolve:n,forTypes:!0,skipUnlistedWarnings:!0}),{load(u){if(!eA.test(u))return""},name:"packem:ignore-files"},e.tsconfig&&Me(Fh(e.options.rootDir,ve(e),e.tsconfig),t),e.tsconfig&&e.options.rollup.tsconfigPaths&&Me(Bh(e.options.rootDir,e.tsconfig,ve(e),e.options.rollup.tsconfigPaths),t),oh(e),e.options.rollup.replace&&dd(es(e.options.rollup.replace,{sourcemap:e.options.sourcemap})),e.options.rollup.alias&&pd({customResolver:i,...e.options.rollup.alias,entries:r}),...l,i,...c,...await bA(a)(e,n),e.options.emitCJS&&H3(),e.options.cjsInterop&&e.options.emitCJS&&Od({...e.options.rollup.cjsInterop,logger:ve(e)}),e.options.rollup.patchTypes&&Me(X8(e.options.rollup.patchTypes,ve(e)),t),I9(),...p,e.options.rollup.license!==!1&&e.options.rollup.license?.path&&typeof e.options.rollup.license.dtsTemplate=="function"&&rh({licenseFilePath:e.options.rollup.license.path,licenseTemplate:e.options.rollup.license.dtsTemplate,logger:ve(e),marker:e.options.rollup.license.dtsMarker??"TYPE_DEPENDENCIES",mode:"types",packageName:e.pkg.name})].filter(Boolean)}},"getRollupDtsOptions");var yA=Object.defineProperty,Yh=g((e,t)=>yA(e,"name",{value:t,configurable:!0}),"n$7");const Xh=Yh(async(e,t,r)=>{const n=Do(e.pkg,e.options),i=r==="rolldown",o=i?void 0:Uh(e),s=e.options.rollup.css&&e.options.rollup.css.loaders&&e.options.rollup.css.loaders.length>0?await import("@visulima/rollup-plugin-css"):void 0,a=!!(e.options.unbundle||e.options.rollup.output?.preserveModules),l=a?{preserveModules:!0,preserveModulesRoot:e.options.rollup.output?.preserveModulesRoot??e.options.sourceDir}:{manualChunks:Mk(e.dependencyGraphMap,e.buildEntries,!i&&!!e.options.rollup.preserveDirectives),preserveModules:!1},[c,p,u]=gd(e.options.rollup.plugins,"build"),d=e.tsconfig?.config.compilerOptions?.esModuleInterop,{pureNewExpressionPluginInstance:f,purePluginInstance:m}=dA(e);return{...Vh(e,"build"),output:[e.options.emitCJS&&{assetFileNames:"[name]-[hash][extname]",chunkFileNames:ou(()=>Ye(e,"cjs"),a),compact:e.options.minify,dir:re(e.options.rootDir,e.options.outDir),entryFileNames:su(h=>Ye(e,"cjs"),a),esModule:d??"if-default-prop",exports:"auto",extend:!0,externalLiveBindings:!1,format:"cjs",freeze:!1,generatedCode:{arrowFunctions:!0,constBindings:!0,objectShorthand:!0,preset:e.tsconfig?.config.compilerOptions?.target==="es5"?"es5":"es2015",reservedNamesAsProps:!0,symbols:!0},hoistTransitiveImports:!1,interop:"compat",sourcemap:e.options.sourcemap,validate:!0,...e.options.rollup.output,...l},e.options.emitESM&&{assetFileNames:"[name]-[hash][extname]",chunkFileNames:ou(()=>Ye(e,"esm"),a),compact:e.options.minify,dir:re(e.options.rootDir,e.options.outDir),entryFileNames:su(h=>oA(e,h,a),a),esModule:d??"if-default-prop",exports:"auto",extend:!0,externalLiveBindings:!1,format:"esm",freeze:!1,generatedCode:{arrowFunctions:!0,constBindings:!0,objectShorthand:!0,preset:e.tsconfig?.config.compilerOptions?.target==="es5"?"es5":"es2015",reservedNamesAsProps:!0,symbols:!0},hoistTransitiveImports:!1,sourcemap:e.options.sourcemap,validate:!0,...e.options.rollup.output,...l}].filter(Boolean),plugins:[!i&&ud(),gO(),Me(Mm(),t),Qm(e),Lh(),e.tsconfig&&Me(Fh(e.options.rootDir,ve(e),e.tsconfig),t),e.tsconfig&&e.options.rollup.tsconfigPaths&&Me(Bh(e.options.rootDir,e.tsconfig,ve(e),e.options.rollup.tsconfigPaths),t),oh(e),e.options.rollup.replace&&dd(es(e.options.rollup.replace,{sourcemap:e.options.sourcemap})),e.options.rollup.alias&&uA(e,n,i,o),...c,o,e.options.rollup.nativeModules&&YO(e.options.rollup.nativeModules),e.options.rollup.dataUri&&AE({...e.options.rollup.dataUri}),e.options.rollup.polyfillNode&&pv({sourceMap:e.options.sourcemap,...e.options.rollup.polyfillNode}),!i&&e.options.rollup.json&&nb({...e.options.rollup.json}),e.options.rollup.debarrel&&eS(e.options.rollup.debarrel,ve(e)),!i&&uv(),e.options.rollup.wasm&&dv(e.options.rollup.wasm),e.options.rollup.url&&R8(e.options.rollup.url),s&&Me(s.rollupCssPlugin({dts:!!e.options.declaration,sourceMap:e.options.sourcemap,...e.options.rollup.css},e.options.browserTargets??[],e.options.rootDir,e.options.sourceDir,e.environment,e.options.sourcemap,e.options.debug,e.options.minify??!1,n),t),e.options.rollup.css&&e.options.rollup.css.loaders&&e.options.rollup.css.loaders.length>0&&(e.options.declaration||e.options.rollup.css.dts)&&s?.cssModulesTypesPlugin(e.options.rollup.css,e.options.rootDir),e.options.rollup.raw&&Me(n9(e.options.rollup.raw),t),e.options.sourcemap&&k8(e.options.rollup.sourcemap),...p,e.options.rollup.minifyHTMLLiterals&&e.options.minify&&qO({...e.options.rollup.minifyHTMLLiterals,logger:ve(e)}),e.options.rollup.requireCJS&&e.options.emitESM&&Me(x9({...e.options.rollup.requireCJS,cwd:e.options.rootDir},ve(e)),t),e.options.rollup.babel&&Me(lE({include:e.options.rollup.babel.include??Z3,...e.options.rollup.babel,root:e.options.rootDir,sourceMaps:e.options.rollup.babel.sourceMaps??e.options.sourcemap}),t),!i&&f,!i&&m,e.options.rollup.detectDuplicated!==!1&&WS(ve(e),e.options.rootDir,e.options.rollup.detectDuplicated),!i&&e.options.transformer&&Me(e.options.transformer(sA(e.options.transformerName,e)),t),!i&&e.options.rollup.preserveDirectives&&fv({directiveRegex:Q3,...e.options.rollup.preserveDirectives,logger:ve(e)}),e.options.rollup.shebang&&M9(e.options.entries.filter(h=>h.executable).map(h=>h.name).filter(Boolean),e.options.rollup.shebang),!i&&e.options.cjsInterop&&e.options.emitCJS&&Od({...e.options.rollup.cjsInterop,logger:ve(e)}),e.options.rollup.dynamicVars&&Zj(),!i&&e.options.rollup.dynamicVars&&mv(e.options.rollup.dynamicVars),!i&&e.options.rollup.commonjs&&Me(hv({sourceMap:e.options.sourcemap,...e.options.rollup.commonjs}),t),e.options.rollup.preserveDynamicImports&&{name:"packem:preserve-dynamic-imports",renderDynamicImport(){return{left:"import(",right:")"}}},e.options.cjsInterop&&e.options.rollup.shim&&GS(e.pkg,e.options.rollup.shim),!i&&e.options.rollup.jsxRemoveAttributes&&Me(gv({attributes:e.options.rollup.jsxRemoveAttributes.attributes,logger:ve(e)}),t),...u,e.options.rollup.metafile&&ok(),e.options.rollup.copy&&hE(e.options.rollup.copy,ve(e)),e.options.rollup.license!==!1&&e.options.rollup.license?.path&&typeof e.options.rollup.license.dependenciesTemplate=="function"&&rh({dtsMarker:e.options.rollup.license.dtsMarker??"TYPE_DEPENDENCIES",licenseFilePath:e.options.rollup.license.path,licenseTemplate:e.options.rollup.license.dependenciesTemplate,logger:ve(e),marker:e.options.rollup.license.dependenciesMarker??"DEPENDENCIES",mode:"dependencies",packageName:e.pkg.name}),e.options.analyze&&e.options.rollup.visualizer!==!1&&vv({brotliSize:!0,gzipSize:!0,projectRoot:e.options.rootDir,sourcemap:e.options.sourcemap,...e.options.rollup.visualizer,filename:"packem-bundle-analyze.html",title:"Packem Visualizer"})].filter(Boolean),preserveEntrySignatures:"strict"}},"createJsBuildOptions"),Zh=Yh((e,t)=>Xh(e,t,"rollup"),"getRollupOptions");var $A=Object.defineProperty,Qh=g((e,t)=>$A(e,"name",{value:t,configurable:!0}),"i$5");const wA=Qh(e=>{if(!e.options.rollup.oxc)return{};const t=Jh(e,qh(e));return{jsx:t.jsx,target:t.target,typescript:t.typescript}},"getRolldownTransformOptions"),xA=Qh(async(e,t)=>{const r=await Xh(e,t,"rolldown");return r.transform=wA(e),e.options.minify&&Array.isArray(r.output)&&(r.output=r.output.map(n=>({...n,minify:!0}))),r},"getRolldownOptions");var jA=Object.defineProperty,kA=g((e,t)=>jA(e,"name",{value:t,configurable:!0}),"u$9");const eg=kA((e,t,r)=>{const n=e.filter(i=>i.type==="chunk"&&i.isEntry);for(const i of n)t.buildEntries.push({chunks:(i.imports??[]).filter(o=>n.some(s=>s.fileName===o)),dynamicImports:i.dynamicImports??[],exports:i.exports??[],modules:Object.entries(i.modules??{}).map(([o,s])=>({bytes:s.renderedLength,id:o})),path:i.fileName,size:{bytes:Buffer.byteLength(i.code??"","utf8")},type:"entry"});for(const i of e.filter(o=>o.type==="asset")){if(r.has(i.fileName))continue;const o=i.source??"",s=typeof o=="string"?Buffer.byteLength(o,"utf8"):o.byteLength;r.set(i.fileName,{path:i.fileName,size:{bytes:s},type:"asset"})}},"collectBuildEntries");var EA=Object.defineProperty,ts=g((e,t)=>EA(e,"name",{value:t,configurable:!0}),"l$9");const Ql=ts(async(e,t)=>{try{return t(await e())}catch{return}},"tryImport"),tg="Rollup is not installed. Please install 'rollup' to use bundler: 'rollup' or DTS generation with the rollup driver.",ec=ts(async()=>{const e=await Ql(()=>import("rollup"),t=>t.rollup);if(!e)throw new Error(tg);return e},"getRollupBuild"),SA=ts(async()=>{const e=await Ql(()=>import("rollup"),t=>t.watch);if(!e)throw new Error(tg);return e},"getRollupWatch");ts(async()=>Ql(()=>import("rollup"),e=>e.VERSION),"getRollupVersion");var OA=Object.defineProperty,rs=g((e,t)=>OA(e,"name",{value:t,configurable:!0}),"p$6");const au="rollup-build.json",Br="dependencies-cache.json",rg=rs(e=>e??"rollup","resolveBundlerName"),AA={".css":"js",".less":"js",".pcss":"js",".sass":"js",".scss":"js",".styl":"js",".stylus":"js"},PA=rs(async(e,t,r,n)=>{const i=e.options.validation&&e.options.validation.dependencies!==!1&&!!t.get(Br,r),o=!e.options.validation||e.options.validation.dependencies===!1||i;let s=n;if(o&&(s={...n,cache:t.get(au,r)},i)){const l=t.get(Br,r);l&&(l.used?.forEach(c=>e.usedDependencies.add(c)),l.hoisted?.forEach(c=>e.hoistedDependencies.add(c)))}const a=await(await ec())(s);try{o&&t.set(au,a.cache,r),e.options.validation&&e.options.validation.dependencies!==!1&&t.set(Br,{hoisted:[...e.hoistedDependencies],used:[...e.usedDependencies]},r),await e.hooks.callHook("rollup:build",e,a);const l=new Map;for(const c of n.output){const{output:p}=await a.write(c);eg(p,e,l)}e.buildEntries.push(...l.values())}finally{await a.close()}},"buildWithRollup"),CA=rs(async(e,t,r,n)=>{if(e.options.validation&&e.options.validation.dependencies!==!1&&t.get(Br,r)){const a=t.get(Br,r);a&&(a.used?.forEach(l=>e.usedDependencies.add(l)),a.hoisted?.forEach(l=>e.hoistedDependencies.add(l)))}const i=await Nm(),o={...n,moduleTypes:{...AA,...n.moduleTypes}},s=await i(o);try{e.options.validation&&e.options.validation.dependencies!==!1&&t.set(Br,{hoisted:[...e.hoistedDependencies],used:[...e.usedDependencies]},r),await e.hooks.callHook("rollup:build",e,s);const a=new Map;for(const l of n.output){const{output:c}=await s.write(l);eg(c,e,a)}e.buildEntries.push(...a.values())}finally{await s.close?.()}},"buildWithRolldown"),RA=rs(async(e,t,r,n)=>{const i=n==="rolldown",o=i?await xA(e,t):await Zh(e,t);await e.hooks.callHook("rollup:options",e,o),Object.keys(o.input??{}).length!==0&&(await(i?CA(e,t,r,o):PA(e,t,r,o)),await t.flush())},"build");var TA=Object.defineProperty,pi=g((e,t)=>TA(e,"name",{value:t,configurable:!0}),"i$4");const lu=pi(async e=>{try{return await(e==="rolldown"?Nm():ec()),!0}catch{return!1}},"isBundlerAvailable"),cu=pi((e,t)=>{const r=[G(t,"noop.js"),import.meta.url];for(const n of r)try{return Ze(n).resolve(e),!0}catch{}return!1},"isModuleAvailable"),ng=pi(async(e,t,r,n,i)=>{if(!(process.stdout.isTTY&&!process.env.CI)){const a=await Ic(e,r);throw new Error(`${e} is required but is not installed. Run: ${a}`)}const o=await ib({initialValue:!0,message:t});if(ob(o)||!o){const a=await Ic(e,r);throw new Error(`Cannot continue without ${e}. Run: ${a}`)}const s=sb();s.start(`Installing ${e}`);try{await nd([e],{cwd:r,dev:!0,silent:!0}),s.stop(`Installed ${e}`)}catch(a){throw s.stop(`Failed to install ${e}`),a}if(!await i())throw n.error(`Installed ${e} but it still cannot be loaded. Try restarting packem.`),new Error(`${e} was installed but is not loadable in the current process. Re-run packem to pick it up.`)},"promptAndInstall"),pu=pi(async(e,t,r)=>{await lu(e)||await ng(e,`${e} is required as the bundler but is not installed. Install it now?`,t,r,()=>lu(e))},"ensureBundlerInstalled"),NA=pi(async(e,t,r)=>{const n=Vx[e];cu(n,t)||await ng(n,`${n} is required for transformer: "${e}" but is not installed. Install it now?`,t,r,()=>Promise.resolve(cu(n,t)))},"ensureTransformerInstalled");var _A=Object.defineProperty,MA=g((e,t)=>_A(e,"name",{value:t,configurable:!0}),"e$2");const ns=MA(e=>{const t=G(e,"package.json");if(!jt(t))throw new Error(`package.json not found at ${t}`);const r=bl(t,{resolveCatalogs:!0});return r.publishConfig&&Object.assign(r,r.publishConfig),{packageJson:r,packageJsonPath:t}},"loadPackageJson");var IA=Object.defineProperty,WA=g((e,t)=>IA(e,"name",{value:t,configurable:!0}),"f$6");const BA=WA(async(e,t,r,n)=>{let i;if(n){const o=G(e,n);if(!await Gr(o))throw new Error(`tsconfig.json not found at ${o}`);i={config:ab(o),path:o},r.info("Using tsconfig settings at",o)}else if(zf(t,["typescript"]))try{i=await lb(e),r.debug("Using tsconfig settings found at",i.path)}catch{r.info("No tsconfig.json or jsconfig.json found.")}return i},"loadTsconfig");var DA=Object.defineProperty,pt=g((e,t)=>DA(e,"name",{value:t,configurable:!0}),"s$9");const FA=/^\.\.?\//,LA=pt((e,t)=>{if(e.executable&&(e.cjs===void 0||e.esm===void 0)){t.pkg.type==="commonjs"&&e.cjs===void 0&&t.options.emitCJS!==void 0?(e.cjs=t.options.emitCJS,e.esm=!1):t.pkg.type==="module"&&e.esm===void 0&&t.options.emitESM!==void 0&&(e.esm=t.options.emitESM,e.cjs=!1);return}e.cjs!==void 0||e.esm!==void 0||e.declaration||(t.options.emitCJS!==void 0&&(e.cjs=t.options.emitCJS),t.options.emitESM!==void 0&&(e.esm=t.options.emitESM))},"applyFormatFlags"),uu=pt((e,t)=>{if(typeof e.name!="string"){let r=Ya(e.input)?Be(t.options.rootDir,e.input):td(e.input);r.startsWith("./")&&(r=r.slice(2)),e.name=r.replace(new RegExp(`^${t.options.sourceDir}/`),"").replace(Qa,"")}if(!e.input)throw new Error(`Missing entry input: ${JSON.stringify(e)}`);rd(e.input)&&(e.input=re(t.options.rootDir,e.input)),t.options.declaration&&e.declaration===void 0&&(e.declaration=t.options.declaration),LA(e,t),e.outDir=re(t.options.rootDir,e.outDir??t.options.outDir)},"extendEntry"),zA=pt(e=>{e.options.entries=e.options.entries.map(t=>typeof t=="string"?{input:t,isGlob:wa(t)}:{...t,exportKey:t.exportKey??new Set,isGlob:wa(t.input)})},"normalizeEntries"),qA=pt(e=>{const t=["**/.git/**","**/node_modules/**","**/test-results/**"],{watch:r}=e.options.rollup;if(r){if(typeof r.exclude=="string")t.push(r.exclude);else if(Array.isArray(r.exclude))for(const n of r.exclude)typeof n=="string"&&t.push(n)}return t},"collectGlobIgnorePatterns"),HA=pt(e=>{for(const t of e.options.entries.filter(r=>r.isGlob)){const r={...t};delete r.isGlob;const n=Qu([r.input],{cwd:e.options.rootDir,dot:!1,ignore:qA(e),onlyFiles:!0});if(n.length===0)throw new ar(`No files found in the glob pattern: ${pe(G(e.options.rootDir,r.input))}`);for(const i of n)e.options.entries.push({...r,input:re(e.options.rootDir,i)});e.options.entries.splice(e.options.entries.indexOf(t),1)}},"expandGlobEntries"),JA=pt(e=>{for(const t of e)if(t==="node"||t==="workerd"||t.includes("node")||t.includes("workerd"))return!0;return!1},"hasNodeLikeExportKey"),UA=pt(e=>e.includes(".server")||e.includes(".node")||e.includes(".workerd"),"fileAliasIndicatesNode"),GA=pt(e=>{const t=e.exportKey&&[...e.exportKey].some(n=>n.includes("browser")||n==="browser"),r=e.fileAlias?.includes(".browser")??!1;if(t||r)return"browser";if(e.exportKey&&JA(e.exportKey)||e.fileAlias&&UA(e.fileAlias))return"node"},"resolveEntryRuntime"),VA=pt(e=>{for(const t of e.options.entries){if(t.runtime)continue;const r=GA(t);r&&(t.runtime=r)}},"detectEntryRuntimes"),KA=pt(e=>{for(const t of e.options.entries)if(t.fileAlias){let r=t.fileAlias;for(;r.startsWith("./")||r.startsWith("../");)r=r.replace(FA,"");t.name=r}},"applyFileAliasNames"),ig=pt(e=>{zA(e),HA(e),VA(e),KA(e);for(const t of e.options.entries.filter(r=>!r.fileAlias))uu(t,e);for(const t of e.options.entries.filter(r=>r.fileAlias))uu(t,e),t.fileAlias=void 0},"prepareEntries");var YA=Object.defineProperty,en=g((e,t)=>YA(e,"name",{value:t,configurable:!0}),"d$7");const XA=/^[_$a-z\u00A0-\uFFFF][\w$\u00A0-\uFFFF]*$/iu,ZA=en((e,t)=>{const r=e.options.jiti.transformOptions?.babel?.plugins;return JSON.stringify({...e.options.jiti,alias:{...Do(e.pkg,e.options),...e.options.jiti.alias},transformOptions:{...e.options.jiti.transformOptions,babel:{...e.options.jiti.transformOptions?.babel,plugins:"__$BABEL_PLUGINS"}}},void 0,2).replace('"__$BABEL_PLUGINS"',Array.isArray(r)?`[${r.map((n,i)=>{if(Array.isArray(n)){const[o,...s]=n;return t.push(o),`[${[`plugin${String(i)}`,...s.map(a=>JSON.stringify(a))].join(", ")}]`}return t.push(n),`plugin${String(i)}`}).join(",")}]`:"[]")},"serializeJitiOptions"),QA=en(e=>e.filter(t=>t!=="default").map((t,r)=>{if(XA.test(t))return`export const ${t} = _module.${t};`;const n=`__packem_export_${String(r)}`,i=t.startsWith("'")&&t.endsWith("'")?`_module[${t}]`:`_module[${JSON.stringify(t)}]`;return`const ${n} = ${i};
|
|
155
|
+
export { ${n} as ${JSON.stringify(t)} };`}),"buildNamedExportLines"),og=en((e,t,r)=>{fo(e,`export * from "${t}";
|
|
156
|
+
${r?`export { default } from "${t}";`:""}`)},"writeDtsStub"),eP=en(async(e,t,r,n,i,o,s,a,l,c)=>{const p=t(ne(r),await Ed("jiti",{conditions:["node","import"],url:import.meta.url})),u=gt(e,"esm"),d=`${i}.${u}`;fo(`${r}.${Ye(e,"esm")}`,o+[`import { createJiti } from "${p}";`,...a.map((f,m)=>`import plugin${String(m)} from "${f}";`),"",`const jiti = createJiti(import.meta.url, ${s});`,"",`/** @type {import("${d}")} */`,`const _module = await jiti.import("${n}");`,...c?["export default _module?.default ?? _module;"]:[],...QA(l)].join(`
|
|
157
|
+
`)),e.options.declaration&&og(`${r}.${u}`,d,c)},"buildEsmStub"),tP=en(async(e,t,r,n,i,o,s,a,l)=>{const c=t(ne(r),await Ed("jiti",{conditions:["node","require"],url:import.meta.url})),p=gt(e,"cjs"),u=`${i}.${p}`;fo(`${r}.${Ye(e,"cjs")}`,o+[`const { createJiti } = require("${c}");`,...a.map((d,f)=>`const plugin${String(f)} = require(${JSON.stringify(d)})`),"",`const jiti = createJiti(__filename, ${s});`,"",`/** @type {import("${u}")} */`,`module.exports = jiti("${n}")`].join(`
|
|
158
|
+
`)),e.options.declaration&&og(`${r}.${p}`,u,l)},"buildCjsStub"),rP=en(async e=>{const t=[],r=ZA(e,t);for(const n of e.options.entries){const i=re(e.options.rootDir,e.options.outDir,n.name),o=Kv(e.jiti.esmResolve(n.input,{try:!0})??n.input),s=o.replace(Qa,""),a=Ga(o),l=W9(a);let c;try{c=await Yv(o,{extensions:go})}catch(d){Q(e,`Cannot analyze ${o} for exports: ${String(d)}`);return}const p=c.includes("default")||c.length===0,u=e.options.jiti.absoluteJitiPath?(...d)=>Xv(re(...d)):Be;e.options.emitESM&&await eP(e,u,i,o,s,l,r,t,c,p),e.options.emitCJS&&await tP(e,u,i,o,s,l,r,t,p),l&&(await Da(`${i}.${Ye(e,"cjs")}`),await Da(`${i}.${Ye(e,"esm")}`))}await e.hooks.callHook("rollup:done",e)},"createStub");var nP=Object.defineProperty,ht=g((e,t)=>nP(e,"name",{value:t,configurable:!0}),"a$9");const tc=ht(e=>e.logger,"getLogger"),lo="rollup-watch.json",du=ht(({context:e,doOnSuccessCleanup:t,fileCache:r,mode:n,runBuilder:i,runOnsuccess:o,useCache:s,watcher:a})=>{const l=`watcher:${n}`,c=tc(e);a.on("change",async(p,{event:u})=>{await t?.(),c.info({message:`${pe(Be(".",p))} was ${u}d`,prefix:l})}),a.on("restart",()=>{c.info({message:"Rebuilding ...",prefix:l})}),a.on("event",async p=>{switch(p.code){case"BUNDLE_END":{await p.result.close(),s&&r.set(n==="bundle"?lo:`dts-${lo}`,p.result.cache),c.raw(`
|
|
159
|
+
⚡️ Build run in ${String(p.duration)}ms
|
|
160
|
+
|
|
161
|
+
`),await i?.(!0);break}case"BUNDLE_START":{c.info({message:pe("build started..."),prefix:l});break}case"END":{c.success({message:"Rebuild finished",prefix:l}),await o?.();break}case"ERROR":{fd(p.error),c.error({context:[p.error],message:`Rebuild failed: ${p.error.message}`,prefix:l});break}}})},"watchHandler"),iP=ht((e,t)=>{const r=[];Array.isArray(t.input)?r.push(...t.input):typeof t.input=="string"?r.push(t.input):r.push(...Object.keys(t.input??{}));let n="Starting watcher for entries:";for(const i of r)n+=rt(`
|
|
162
|
+
└─ ${Be(process.cwd(),i)}`);tc(e).info(n)},"logInputs"),oP=ht((e,t,r)=>{const n=[G(e.options.sourceDir,"**","*"),"package.json","packem.config.*","tsconfig.json","tsconfig.*.json"],{include:i}=r;Array.isArray(i)?n.push(...i):i!==void 0&&n.push(i);const o=t.chokidar??{},s=["**/.git/**","**/node_modules/**","**/test-results/**",...o.ignored??[]];return{...t,...r,chokidar:{cwd:e.options.rootDir,...o,ignored:s},include:n}},"buildMergedWatchOptions"),sP=ht((e,t)=>{const r=e.options.rollup.watch;return!r||typeof t!="object"||t.include!==void 0?t:oP(e,t,r)},"configureWatchOptions"),aP=ht(async(e,t,r,n,i)=>{let o=!0;e.options.rollup.css&&(o=!1);let s=[];const a=ht(async()=>{await Promise.all(s.map(m=>m.close())),s=[]},"closeWatchers"),l=ht(async()=>{const m=await SA(),h=await Zh(e,t);if(await e.hooks.callHook("rollup:options",e,h),Object.keys(h.input??{}).length===0)return;o&&(h.cache=t.get(lo)),h.watch=sP(e,h.watch);const v=m(h);if(await e.hooks.callHook("rollup:watch",e,v),iP(e,h),du({context:e,doOnSuccessCleanup:i,fileCache:t,mode:"bundle",runBuilder:r,runOnsuccess:n,useCache:o,watcher:v}),s.push(v),e.options.declaration){const b=await Kh(e,t);o&&(b.cache=t.get(`dts-${lo}`)),await e.hooks.callHook("rollup:dts:options",e,b);const w=m(b);await e.hooks.callHook("rollup:watch",e,w),du({context:e,fileCache:t,mode:"types",useCache:o,watcher:w}),s.push(w)}},"startWatchers");await l();const c=G(e.options.rootDir,"package.json"),p=yl.map(m=>G(e.options.rootDir,m));let u;const d=ht(async m=>{const h=tc(e);h.info(`${Be(".",m)} changed, restarting watchers...`);try{await a();const{packageJson:v}=ns(e.options.rootDir);e.pkg=v,e.options.entries.length=0,e.buildEntries.length=0,await e.hooks.callHook("build:prepare",e),ig(e),await l()}catch(v){h.error({message:`Failed to restart watchers: ${v.message}`,prefix:"watcher"})}},"runRestart"),f=ht(m=>{clearTimeout(u),u=setTimeout(()=>{d(m).catch(()=>{})},100)},"restart");fc(c,()=>{f(c)});for(const m of p)if(jt(m)){fc(m,()=>{f(m)});break}},"watch");var lP=Object.defineProperty,cP=g((e,t)=>lP(e,"name",{value:t,configurable:!0}),"s$8");const pP=cP(async e=>{if(e.options.clean){const t=e.logger,r=[];for(const n of new Set(e.options.entries.map(i=>i.outDir).filter(Boolean).toSorted((i,o)=>i.localeCompare(o))))n===e.options.rootDir||n===e.options.sourceDir||e.options.rootDir.startsWith(n.endsWith("/")?n:`${n}/`)||r.some(i=>n.startsWith(i))||(r.push(n),t.info(`Cleaning dist directory: \`./${Be(e.options.rootDir,n)}\``),await zg(n))}},"cleanDistributionDirectories");var uP=Object.defineProperty,dP=g((e,t)=>uP(e,"name",{value:t,configurable:!0}),"o$4");const fP=dP(()=>cb((e,t,r)=>{if(t==="hooks"&&typeof r=="object"&&r!==null&&!Array.isArray(r)){const n=typeof e[t]=="object"&&e[t]!==null&&!Array.isArray(e[t])?e[t]:{};return e[t]={...n,...r},!0}return!1}),"createDefuWithHooksMerger");var mP=Object.defineProperty,ki=g((e,t)=>mP(e,"name",{value:t,configurable:!0}),"n$4");const hP=$t,gP=ki((e,t)=>{const{sideEffects:r}=t;let n;if(typeof r=="boolean")n=ki(()=>r,"hasSideEffects");else if(Array.isArray(r))if(r.length<=0)n=ki(()=>!1,"hasSideEffects");else{const i=r.map(o=>o.includes("/")?o:`**/${o}`);n=hP(i,void 0,{resolve:e})}else n=ki(()=>{},"hasSideEffects");return n},"getPackageSideEffect");var pa,fu;function vP(){if(fu)return pa;fu=1;var e=Object.defineProperty,t=g((l,c)=>e(l,"name",{value:c,configurable:!0}),"s"),r=pb,n=r.spawn,i=r.exec;pa=g(function(l,c,p){if(typeof c=="function"&&p===void 0&&(p=c,c=void 0),l=parseInt(l),Number.isNaN(l)){if(p)return p(new Error("pid must be a number"));throw new Error("pid must be a number")}var u={},d={};switch(u[l]=[],d[l]=1,process.platform){case"win32":i("taskkill /pid "+l+" /T /F",p);break;case"darwin":a(l,u,d,function(f){return n("pgrep",["-P",f])},function(){o(u,c,p)});break;default:a(l,u,d,function(f){return n("ps",["-o","pid","--no-headers","--ppid",f])},function(){o(u,c,p)});break}},"treeKill");function o(l,c,p){var u={};try{Object.keys(l).forEach(function(d){l[d].forEach(function(f){u[f]||(s(f,c),u[f]=1)}),u[d]||(s(d,c),u[d]=1)})}catch(d){if(p)return p(d);throw d}if(p)return p()}g(o,"killAll"),t(o,"killAll");function s(l,c){try{process.kill(parseInt(l,10),c)}catch(p){if(p.code!=="ESRCH")throw p}}g(s,"killPid"),t(s,"killPid");function a(l,c,p,u,d){var f=u(l),m="";f.stdout.on("data",function(b){var b=b.toString("ascii");m+=b});var h=t(function(v){if(delete p[l],v!=0){Object.keys(p).length==0&&d();return}m.match(/\d+/g).forEach(function(b){b=parseInt(b,10),c[l].push(b),c[b]=[],p[b]=1,a(b,c,p,u,d)})},"onClose");f.on("close",h)}return g(a,"buildProcessTree"),t(a,"buildProcessTree"),pa}g(vP,"requireTreeKill");var bP=vP();const yP=Yn(bP);var $P=Object.defineProperty,sg=g((e,t)=>$P(e,"name",{value:t,configurable:!0}),"l$6");const wP=sg(e=>process.platform==="win32"&&"cmd"in e&&"code"in e&&typeof e.cmd=="string"&&e.cmd.startsWith("taskkill")&&e.code===128,"isTaskKillCmdProcessNotFoundError"),xP=sg(async({pid:e,signal:t})=>{await new Promise((r,n)=>{if(!Number.isInteger(e)||e<=0){n(new Error("Invalid process ID"));return}yP(e,t,i=>{if(i&&!wP(i)){n(i);return}r()})})},"killProcess");var jP=Object.defineProperty,kP=g((e,t)=>jP(e,"name",{value:t,configurable:!0}),"o$2");const mu=kP((e,t)=>{if(e.warnings.size>0){const r=e.logger;if(t&&r.raw(`
|
|
163
|
+
`),r.warn(`Build is done with some warnings:
|
|
164
|
+
|
|
165
|
+
${Array.from(e.warnings,n=>`- ${n}`).join(`
|
|
166
|
+
`)}`),e.options.failOnWarn)throw new Error("Exiting with code (1). You can change this behavior by setting `failOnWarn: false`.")}},"logBuildErrors");var EP=Object.defineProperty,ag=g((e,t)=>EP(e,"name",{value:t,configurable:!0}),"t$2");const SP=ag(async(e,t,r,n)=>{try{await vo(G(e,t),{force:!0,recursive:!0})}catch(i){return r.error({message:`Failed to remove cache directory ${t}: ${i instanceof Error?i.message:String(i)}`,prefix:"file-cache"}),n}return n&&r.raw(`
|
|
167
|
+
`),r.info({message:`Removing ${t} file cache, the cache key is not used anymore.`,prefix:"file-cache"}),!1},"removeStaleCacheDirectory"),OP=ag(async(e,t,r)=>{if(!e)return;const n=G(e,"keystore.json");if(!await Gr(n))return;const i=await mo(n),o=(await Hv(e,{withFileTypes:!0})).filter(a=>a.isDirectory());let s=r;for(const a of o)i[a.name]||(s=await SP(e,a.name,t,s))},"removeOldCacheFolders");var AP=Object.defineProperty,lg=g((e,t)=>AP(e,"name",{value:t,configurable:!0}),"s$5");const hu=lg((e,t)=>{for(const r of ja(e??[]))if(typeof r=="string"&&r.startsWith("node")){const n=nt.coerce(r.slice(4));n&&t.push(n.version)}},"collectNodeTargets"),PP=lg(e=>{if(e.options.runtime!=="node"||!e.options.emitCJS)return;const t=[],r=e.pkg.engines?.node,n=r?nt.minVersion(r):void 0;n&&t.push(n.version);const i=e.options.rollup;if(hu(i.esbuild?.target,t),hu(i.oxc?.target,t),t.length===0){const o=nt.coerce(Gi.node);o&&t.push(o.version)}t.some(o=>nt.satisfies(o,">=23.0.0 || >=22.12.0"))&&e.logger.warn(["We recommend using the ESM format instead of CommonJS.","The ESM format is compatible with modern platforms and runtimes, and most new libraries are now distributed only in ESM format.","Learn more at https://nodejs.org/en/learn/modules/publishing-a-package#how-did-we-get-here"].join(`
|
|
168
|
+
`))},"warnLegacyCJS");var CP=Object.defineProperty,K=g((e,t)=>CP(e,"name",{value:t,configurable:!0}),"b$2");const RP=Ze(import.meta.url),Sr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:It,rc=K(e=>{if(typeof Sr<"u"&&Sr.versions&&Sr.versions.node){const[t,r]=Sr.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Sr.getBuiltinModule(e)}return RP(e)},"__cjs_getBuiltinModule"),It=Sr,{execFileSync:TP}=rc("node:child_process"),Cn=rc("node:fs"),NP=rc("node:tty"),nc=[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],ic=[12288,12288,65281,65376,65504,65510],oc=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],sc=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],is=[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],ui=K((e,t)=>{let r=0,n=Math.floor(e.length/2)-1;for(;r<=n;){const i=Math.floor((r+n)/2),o=i*2;if(t<e[o])n=i-1;else if(t>e[o+1])r=i+1;else return!0}return!1},"isInRange"),_P=nc[0],MP=nc.at(-1),IP=ic[0],WP=ic.at(-1),BP=oc[0],DP=oc.at(-1),FP=sc[0],LP=sc.at(-1),zP=is[0],qP=is.at(-1),gu=19968,[HP,JP]=cg(is);function cg(e){let t=e[0],r=e[1];for(let n=0;n<e.length;n+=2){const i=e[n],o=e[n+1];if(gu>=i&&gu<=o)return[i,o];o-i>r-t&&(t=i,r=o)}return[t,r]}g(cg,"ge$1");K(cg,"findWideFastPathRange");const UP=K(e=>e<_P||e>MP?!1:ui(nc,e),"isAmbiguous"),GP=K(e=>e<IP||e>WP?!1:ui(ic,e),"isFullWidth"),VP=K(e=>e<BP||e>DP?!1:ui(oc,e),"isHalfWidth"),KP=K(e=>e<FP||e>LP?!1:ui(sc,e),"isNarrow"),YP=K(e=>e>=HP&&e<=JP?!0:e<zP||e>qP?!1:ui(is,e),"isWide");function pg(e){return UP(e)?"ambiguous":GP(e)?"fullwidth":VP(e)?"halfwidth":KP(e)?"narrow":YP(e)?"wide":"neutral"}g(pg,"Se");K(pg,"getCategory");function ug(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}g(ug,"Be");K(ug,"validate");function ac(e){return ug(e),pg(e)}g(ac,"Vt");K(ac,"eastAsianWidthType");const dg=String.raw,vu=dg`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,XP=K(()=>new RegExp(dg`\p{RI}{2}|(?)${vu}(?:\u200D${vu})*`,"gu"),"emojiRegex"),tn=new Set(["\x1B",""]),os="\x07",fg="[",lc="m",co="]8;;",ZP=39,QP=/[\u200B\uFEFF\u2060-\u2064]/g,eC=new RegExp(`(?:\\${fg}(?<code>\\d+)m|\\${co}(?<uri>.*)${os})`),tC=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]])),Xt=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,bu=/\u001B\[(\d+(?:;\d+)*)?m[^\u001B]*(?:\u001B\[(?:\d+(?:;\d+)*)?m|$)/g,yu=/\u001B\]8;[^\u0007\u001B]*(?:\u0007|\u001B\\)(.*?)\u001B\]8;;(?:\u0007|\u001B\\)/g,Ei=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,ua=XP(),$u=new Map,Si=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,Ji=K(e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other","getCharType"),rC=K((e,t)=>{const r=Math.floor(e/65536),n=e%65536;let i=$u.get(r);if(i||(i=new Map,$u.set(r,i)),i.has(n))return i.get(n);let o;if(Ji(e)==="latin")o=t.width.regular;else if(Ji(e)==="control")o=t.width.control;else if(Ji(e)==="wide")o=t.width.wide;else switch(ac(e)){case"ambiguous":{o=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{o=t.width.fullWidth;break}case"wide":{o=t.width.wide;break}default:o=t.width.regular}return i.set(n,o),o},"getCachedCharWidth"),nC=K(e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,"isCombiningCharacter"),Ur=K((e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const r={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?Ur(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},n=Math.max(0,r.truncation.limit-r.truncation.ellipsisWidth),{length:i}=e,o=i>1e4;let s=0,a=0,l=i,c=!1;const p=e.includes("\x1B")||e.includes("");for(;s<i;){if(p&&(e[s]==="\x1B"||e[s]==="")){if(e.startsWith("\x1B]8;;",s)){const v="\x1B]8;;\x07",b=v.length,w=e.indexOf("\x07",s+5);if(w!==-1){const k=e.indexOf(v,w+1);if(k!==-1){const y=k+b,x=e.slice(w+1,k).replace(Xt,""),$=Ur(x,{ambiguousIsNarrow:r.width.ambiguousIsNarrow,ansiWidth:r.width.ansi,controlWidth:r.width.control,countAnsiEscapeCodes:!1,ellipsis:r.truncation.ellipsis,ellipsisWidth:r.truncation.ellipsisWidth,emojiWidth:r.width.emoji,fullWidth:r.width.fullWidth,halfWidth:r.width.halfWidth,limit:Math.max(0,n-a),regularWidth:r.width.regular,tabWidth:r.width.tab,wideWidth:r.width.wide}),E=$.width;if($.truncated)c=!0,l=Math.min(l,s);else if(a+E>n&&(l=Math.min(l,s),c=!0,a+E>r.truncation.limit))break;if(a+=E,s=y,c&&a>=r.truncation.limit)break;continue}}}if(Xt.lastIndex=s,Xt.test(e)){const v=Xt.lastIndex-s,b=r.truncation.countAnsiEscapeCodes?v:r.width.ansi;if(a+b>n&&(l=Math.min(l,s),a+b>r.truncation.limit)){c=!0;break}a+=b,s=Xt.lastIndex;continue}}const f=e.codePointAt(s);if(f===8203||f===65279||f>=8288&&f<=8292){s+=1;continue}if(f===9){if(a+r.width.tab>n&&(l=Math.min(l,s),a+r.width.tab>r.truncation.limit)){c=!0;break}a+=r.width.tab,s+=1;continue}if(Si.lastIndex=s,Si.test(e)){const v=(Si.lastIndex-s)*r.width.regular;if(a+v>n){const b=Math.floor((n-a)/r.width.regular);if(l=Math.min(l,s+b),a+v>r.truncation.limit){c=!0;break}}a+=v,s=Si.lastIndex;continue}if((f<=31||f>=127&&f<=159)&&(Ei.lastIndex=s,Ei.test(e))){const v=(Ei.lastIndex-s)*r.width.control;if(a+v>n&&(l=Math.min(l,s+Math.floor((n-a)/r.width.control)),a+v>r.truncation.limit)){c=!0;break}a+=v,s=Ei.lastIndex;continue}if(ua.lastIndex=s,ua.test(e)){if(a+r.width.emoji>n&&(l=Math.min(l,s),a+r.width.emoji>r.truncation.limit)){c=!0;break}a+=r.width.emoji,s=ua.lastIndex;continue}const m=e.codePointAt(s)??0;if(nC(m)){s+=m>65535?2:1;continue}let h;if(o)h=rC(m,r);else switch(Ji(m)){case"control":{h=r.width.control;break}case"latin":{h=r.width.regular;break}case"wide":{h=r.width.wide;break}case"zero":{h=0;break}default:switch(ac(m)){case"ambiguous":{h=r.width.ambiguousIsNarrow?r.width.regular:r.width.wide;break}case"fullwidth":{h=r.width.fullWidth;break}case"wide":{h=r.width.wide;break}default:h=r.width.regular}}if(a+h>n&&(l=Math.min(l,s),a+h>r.truncation.limit)){c=!0;break}a+=h,s+=m>65535?2:1}let u=a,d=!1;return c&&r.truncation.limit>=r.truncation.ellipsisWidth&&(u=r.truncation.limit,d=!0),{ellipsed:d,index:c?l:i,truncated:c,width:u}},"getStringTruncatedWidth"),$e=K((e,t={})=>Ur(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");let iC=class{static{g(this,"Te")}static{K(this,"LRUCache")}capacity;cache;keyOrder;constructor(t){this.capacity=t,this.cache=new Map,this.keyOrder=[]}get(t){if(this.cache.has(t))return this.keyOrder=this.keyOrder.filter(r=>r!==t),this.keyOrder.push(t),this.cache.get(t)}has(t){return this.cache.has(t)}set(t,r){if(this.cache.has(t))this.keyOrder=this.keyOrder.filter(n=>n!==t);else if(this.cache.size>=this.capacity){const n=this.keyOrder.shift();n!==void 0&&this.cache.delete(n)}this.cache.set(t,r),this.keyOrder.push(t)}delete(t){this.cache.delete(t),this.keyOrder=this.keyOrder.filter(r=>r!==t)}clear(){this.cache.clear(),this.keyOrder=[]}size(){return this.cache.size}};const wu=new iC(100),oC=new Intl.Segmenter("en",{granularity:"grapheme"}),sC=/^[\u0000-\u007F]*$/,aC=new Set(["0","22","23","24","27","28","29","39","49"]),lC=new Set(["1","3","4","7","8","9"]),xu=new Map([["22","1"],["23","3"],["24","4"],["27","7"],["28","8"],["29","9"]]),Oi=K(e=>e>="30"&&e<="37"||e>="90"&&e<="97"||e.startsWith("38;"),"isForegroundColor"),Ai=K(e=>e>="40"&&e<="47"||e>="100"&&e<="107"||e.startsWith("48;"),"isBackgroundColor"),cC=[{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"}],ju=K((e,t)=>{let r=-1;for(const n of t){const i=e.indexOf(n);i!==-1&&(r===-1||i<r)&&(r=i)}return r},"findFirstPositionOfAny"),pC=K((e,t)=>{if(!e.includes("\x1B"))return[{after:"",before:"",content:e,visibleLength:$e(e,t.width)}];const r=wu.get(e);if(r)return r;const n=[],i=[];let o=0,s;for(Xt.lastIndex=0;(s=Xt.exec(e))!==null;){const p=s[0];n.push(e.slice(o,s.index)),i.push(p),o=s.index+p.length}o<e.length&&n.push(e.slice(o));const a=[];for(const p of i){if(p==="\x1B[0m"||p==="\x1B]8;;\x07"){a.push(p);continue}if(p.startsWith("\x1B[")&&p.endsWith("m")){const u=p.slice(2,-1);if(aC.has(u)){a.push(p);continue}}}const l=new Set,c=[];for(const[p,u]of n.entries()){if(p>0&&i[p-1]){const m=i[p-1];if(m==="\x1B[0m")l.clear();else if(m==="\x1B]8;;\x07"){for(const h of l)if(h.startsWith("\x1B]8;;")&&!h.endsWith("\x1B]8;;\x07")){l.delete(h);break}}else if(m.startsWith("\x1B[")&&m.endsWith("m")){const h=m.slice(2,-1);if(h==="39"){for(const v of l)if(v.startsWith("\x1B[")&&v.endsWith("m")){const b=v.slice(2,-1);if(Oi(b)){l.delete(v);break}}}else if(h==="49"){for(const v of l)if(v.startsWith("\x1B[")&&v.endsWith("m")){const b=v.slice(2,-1);if(Ai(b)){l.delete(v);break}}}else if(xu.has(h)){const v=xu.get(h);for(const b of l)if(b===`\x1B[${v}m`){l.delete(b);break}}else{if(Oi(h)){for(const v of l)if(v.startsWith("\x1B[")&&v.endsWith("m")){const b=v.slice(2,-1);if(Oi(b)){l.delete(v);break}}}else if(Ai(h)){for(const v of l)if(v.startsWith("\x1B[")&&v.endsWith("m")){const b=v.slice(2,-1);if(Ai(b)){l.delete(v);break}}}else if(lC.has(h)){const v=`\x1B[${h}m`;l.has(v)&&l.delete(v)}l.add(m)}}else if(m.startsWith("\x1B]8;;")&&!m.endsWith("\x1B]8;;\x07")){for(const h of l)if(h.startsWith("\x1B]8;;")&&!h.endsWith("\x1B]8;;\x07")){l.delete(h);break}l.add(m)}}if(u==="")continue;let d="";if(l.size>0)if(a.includes("\x1B[0m"))d="\x1B[0m";else{const m=[];let h=!1;for(const k of l)if(k.startsWith("\x1B]8;;")&&!k.endsWith("\x1B]8;;\x07")){h=!0;break}h&&a.includes("\x1B]8;;\x07")&&m.push("\x1B]8;;\x07");let v=!1,b=!1;for(const k of l)if(k.startsWith("\x1B[")&&k.endsWith("m")){const y=k.slice(2,-1);Oi(y)?v=!0:Ai(y)&&(b=!0)}if(v&&b){const k=ju(e,["\x1B[3","\x1B[9","\x1B[38;"]),y=ju(e,["\x1B[4","\x1B[10","\x1B[48;"]);k>=0&&y>=0?k>y?m.push("\x1B[39m","\x1B[49m"):m.push("\x1B[49m","\x1B[39m"):m.push("\x1B[39m","\x1B[49m")}else v&&m.push("\x1B[39m"),b&&m.push("\x1B[49m");v&&b&&e.includes("\x1B[39m")&&e.includes("\x1B[49m")&&(e.indexOf("\x1B[39m")<e.indexOf("\x1B[49m")?(m.length-=2,m.push("\x1B[39m","\x1B[49m")):e.indexOf("\x1B[49m")<e.indexOf("\x1B[39m")&&(m.length-=2,m.push("\x1B[49m","\x1B[39m")));const w=cC.filter(k=>l.has(k.open)).map(k=>({position:e.indexOf(k.open),style:k})).filter(k=>k.position>=0).toSorted((k,y)=>y.position-k.position);for(const k of w){const y=k;a.includes(y.style.close)&&m.push(y.style.close)}d=m.join("")}const f=[...l].join("");c.push({after:d,before:f,content:u,visibleLength:$e(u,{fullWidth:1,wideWidth:1})})}return wu.set(e,c),c},"processIntoStyledSegments"),uC=K((e,t,r,n)=>{const i=[...n.segmenter.segment(e)],o=[];let s=0,a=!1;for(const l of i){const c=$e(l.segment,n.width),p=s,u=s+c;if(!a)if(p<t){s=u;continue}else a=!0;if(p>=r||u>r)break;o.push(l.segment),s=u}return o.join("")},"fastSlice"),Tt=K((e,t=0,r=Number.MAX_SAFE_INTEGER,n={})=>{const i={segmenter:oC,...n};if(t>=r||e==="")return"";const o=$e(e,i.width);if(t===0&&r>=o)return e;if(t<0||r<0)throw new RangeError("Negative indices aren't supported");if(!e.includes("\x1B"))return sC.test(e)?e.slice(t,r):uC(e,t,r,i);if(bu.lastIndex=0,yu.lastIndex=0,!bu.test(e)&&!yu.test(e))return e;const s=pC(e,i);if(s.length===0)return"";let a=0;const l=[];for(const[u,d]of s.entries()){const f=a,m=a+d.visibleLength;if(m>t&&f<r){const h=Math.max(0,t-f),v=Math.min(d.visibleLength,r-f);l.push({end:v,index:u,segment:d,start:h})}a=m}if(l.length===0)return"";const c=[],p=l[0].segment;c.push(p.before);for(let u=0;u<l.length;u++){const{end:d,segment:f,start:m}=l[u];if(m===0&&d===f.visibleLength)c.push(f.content);else{const h=[...i.segmenter.segment(f.content)];c.push(h.slice(m,d).map(v=>v.segment).join(""))}if(u<l.length-1){const h=l[u+1].segment,v=f.after,b=h.before;v!==b&&(v||b)&&c.push(v,b)}}return c.push(l.at(-1).segment.after),c.join("")},"slice"),ku="…",dC=3,Pi=K((e,t,r=!1)=>{if(e.charAt(t)===" ")return t;const n=r?1:-1,i=Math.min(dC,r?e.length-t:t);for(let o=1;o<=i;o++){const s=t+o*n;if(e.charAt(s)===" ")return s}return t},"findNearestSpace"),Ci=K((e,t,r)=>Ur(e,{...r,ellipsis:"",ellipsisWidth:0,limit:t}).index,"widthToIndex"),Ri=K((e,t,r)=>$e(e.slice(0,t),r),"indexToWidth"),Eu=K((e,t,r={})=>{if(typeof e!="string")throw new TypeError(`Expected \`input\` to be a string, got ${typeof e}`);if(typeof t!="number")throw new TypeError(`Expected \`limit\` to be a number, got ${typeof t}`);if(e===""||t<=0)return"";const n=e.normalize("NFC"),{ellipsis:i=ku,position:o="end",preferTruncationOnSpace:s=!1}=r;let a=r.ellipsisWidth??i===ku?1:void 0;a??=Ur(i,{...r.width,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width;const{width:l}=Ur(n,{...r.width,ellipsis:i,ellipsisWidth:a});if(l<=t)return n;switch(o){case"end":{if(s){const c=t-a,p=Ci(n,c,r.width),u=Pi(n,p),d=Ri(n,u,r.width);return Tt(n,0,d,{width:r.width})+i}return Tt(n,0,t-a,{width:r.width})+i}case"middle":{const c=Math.floor(t/2),p=Math.max(0,t-a),u=Math.min(c,p),d=Math.max(0,p-u);if(s){const f=Ci(n,u,r.width),m=Pi(n,f),h=Ri(n,m,r.width),v=l-d,b=Ci(n,v,r.width),w=Pi(n,b,!0),k=Ri(n,w,r.width);return Tt(n,0,h,{width:r.width})+i+Tt(n,k,l,{width:r.width}).trim()}return Tt(n,0,u,{width:r.width})+i+Tt(n,l-d,l,{width:r.width})}case"start":{if(s){const c=l-t+a,p=Ci(n,c,r.width),u=Pi(n,p,!0),d=Ri(n,u,r.width);return i+Tt(n,d,l,{width:r.width}).trim()}return i+Tt(n,l-t+a,l,{width:r.width})}default:throw new Error(`Invalid position: expected 'start', 'middle' or 'end', got '${o}'`)}},"truncate"),fC=/\x1B\[(\d+)m/;class mg{static{g(this,"Jt")}static{K(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const r=fC.exec(t);if(!r)return;const n=Number.parseInt(r[1],10);switch(n){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(n>=30&&n<=37||n>=90&&n<=97)this.activeForeground=t;else if(n>=40&&n<=47||n>=100&&n<=107)this.activeBackground=t;else if([1,2,3,4,7,8,9].includes(n))this.activeFormatting.push(t);else if([22,23,24,27,28,29].includes(n)){const i={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[n];i&&(this.activeFormatting=this.activeFormatting.filter(o=>!o.includes(i)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const t=[];if(this.activeFormatting.length>0){const r={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].toReversed().forEach(n=>{const i=r[n];i&&t.push(i)})}return this.activeForeground&&t.push("\x1B[39m"),this.activeBackground&&t.push("\x1B[49m"),t.join("")}}const hg=K((e,t)=>{if(!tn.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const r=!0,n=e.slice(t+1,t+1+co.length).join("")===co;return{isInsideEscape:r,isInsideLinkEscape:n}},"checkEscapeSequence"),mC=K((e,t={})=>{const r=new mg;let n="",i=!1,o="",s="",a=!1;const l=[...e];for(let c=0;c<l.length;c++){const p=l[c];if(p&&tn.has(p)){if(n){const h=t.getWidth?.(n)??0,v={isEscapeSequence:!1,isGrapheme:!0,text:n,width:h};if(a&&(v.isHyperlink=!0,v.hyperlinkUrl=s),t.onSegment?.(v,r)===!1)return;n=""}i=!0,o=p;const f=hg(l,c),{isInsideLinkEscape:m}=f;if(m){let h=c+1;for(s="";h<l.length;){const b=l[h];if(b===os)break;s+=b,h+=1}s=s.slice(4);const v={hyperlinkUrl:s,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(v,r)===!1)return;c=h,a=!0,i=!1,o="";continue}if(c+1<l.length&&l[c+1]==="\\"&&a){const h={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.(h,r)===!1)return;a=!1,s="",c+=1,i=!1,o="";continue}}if(i){if(o!==p&&(o+=p),p===lc){i=!1,r.processEscape(o);const f={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};if(t.onSegment?.(f,r)===!1)return;o=""}continue}n+=p;const u=t.getWidth?.(n)??0,d={isEscapeSequence:!1,isGrapheme:!0,text:n,width:u};if(a&&(d.isHyperlink=!0,d.hyperlinkUrl=s),t.onSegment?.(d,r)===!1)return;n=""}if(n){const c=t.getWidth?.(n)??0,p={isEscapeSequence:!1,isGrapheme:!0,text:n,width:c};a&&(p.isHyperlink=!0,p.hyperlinkUrl=s),t.onSegment?.(p,r)}if(o){const c={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};t.onSegment?.(c,r)}},"processAnsiString"),Su=K(e=>`${tn.values().next().value}${fg}${String(e)}${lc}`,"wrapAnsiCode"),Ou=K(e=>`${tn.values().next().value}${co}${e}${os}`,"wrapAnsiHyperlink"),hC=K(e=>{if(e.length===0)return"";if(e.length===1)return e[0];let t="",r,n;const i=e.join(`
|
|
169
|
+
`),o=[...i];let s=0;for(const[a,l]of o.entries()){if(t+=l,tn.has(l)){const p=eC.exec(i.slice(s))?.groups??{};if(p.code!==void 0){const u=Number.parseFloat(p.code);r=u===ZP?void 0:u}else p.uri!==void 0&&(n=p.uri.length===0?void 0:p.uri)}const c=tC.get(Number(r));o[a+1]===`
|
|
170
|
+
`?(n&&(t+=Ou("")),r&&c&&(t+=Su(c))):l===`
|
|
171
|
+
`&&(r&&c&&(t+=Su(r)),n&&(t+=Ou(n))),s+=l.length}return t},"preserveAnsi"),gg=/(?=\s)|(?<=\s)/,vg=/^\s+$/,da=K(e=>{if(!e.includes("\x1B"))return e;let t=e;return e.includes("\x1B[30m")&&(t+="\x1B[39m"),e.includes("\x1B[42m")&&(t+="\x1B[49m"),t},"resetAnsiAtLineBreak"),rr=K(e=>{const t=e.split(" ");let r=t.length;for(;r>0&&$e(t[r-1])===0;)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},"stringVisibleTrimSpacesRight"),bg=K((e,t,r)=>{if(e.length===0)return[""];if(t<=0)return[e];const n=[],i=new mg;let o="",s=0,a=!1,l=!1,c="",p=0;for(;p<e.length;){const u=e[p];if(tn.has(u)){a=!0,c=u,o+=u,l=hg([...e],p).isInsideLinkEscape,p+=1;continue}if(a){c+=u,o+=u,l?u===os&&(a=l=!1):u===lc&&(a=!1,i.processEscape(c)),p+=1;continue}const d=$e(u),f=u===" ";if(d===0){o+=u,p+=1;continue}if(s+d>t&&(o&&n.push(o+i.getEndEscapesForAllActiveAttributes()),o=i.getStartEscapesForAllActiveAttributes(),s=$e(o),f&&r)){for(;p<e.length&&e[p]===" ";)p+=1;continue}if(o+=u,s+=d,s===t&&p<e.length-1&&(n.push(o+i.getEndEscapesForAllActiveAttributes()),o=i.getStartEscapesForAllActiveAttributes(),s=$e(o),p+1<e.length&&e[p+1]===" "&&r)){for(p+=1;p<e.length&&e[p]===" ";)p+=1;continue}p+=1}return o&&n.push(o+i.getEndEscapesForAllActiveAttributes()),r?n.map(u=>rr(u)):n},"wrapWithBreakAtWidth"),gC=K((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=[];let o="",s=0;return mC(n,{getWidth:$e,onSegment:K((a,l)=>{const c=a.text??"";if(a.isEscapeSequence)o+=c;else{const p=c===" ";if(a.width===0)return o+=c,!0;if(s+a.width>t&&(o&&i.push(o),o=l.getStartEscapesForAllActiveAttributes(),s=0,p))return r||i.push(l.getStartEscapesForAllActiveAttributes()+c),!0;o+=c,s+=a.width}return!0},"onSegment")}),o&&i.push(o),r?i.map(a=>rr(a)):i},"wrapCharByChar"),vC=K((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(gg),o=[];let s="",a=0,l=0;for(;l<i.length;){const c=i[l],p=vg.test(c),u=$e(c);if(c.length===0){l+=1;continue}if(r&&p&&a===0){l+=1;continue}if(a+u>t&&a>0){r?o.push(rr(s)):o.push(s),s="",a=0;continue}s+=c,a+=u,l+=1}return s&&(r?o.push(rr(s)):o.push(s)),o},"wrapWithWordBoundaries"),bC=K((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(gg),o=[];let s="",a=0,l=0;for(;l<i.length;){const c=i[l],p=vg.test(c),u=$e(c);if(c.length===0){l+=1;continue}if(r&&p&&a===0){l+=1;continue}if(u>t){s&&o.push(da(r?rr(s):s));const d=bg(c,t,r);if(d.length>0){for(let f=0;f<d.length-1;f+=1)o.push(d[f]);s=d.at(-1),a=$e(s)}else s="",a=0;l+=1;continue}if(a+u>t&&a>0&&(o.push(da(r?rr(s):s)),s="",a=0,r&&p)){l+=1;continue}s+=c,a+=u,l+=1}return s&&o.push(da(r?rr(s):s)),o},"wrapAndBreakWords"),Ti={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},yC=K((e,t={})=>{const{removeZeroWidthCharacters:r=!0,trim:n=!0,width:i=80,wrapMode:o=Ti.PRESERVE_WORDS}=t;if(n&&e.trim()==="")return"";let s=e.normalize("NFC").replaceAll(`\r
|
|
172
|
+
`,`
|
|
173
|
+
`);return r&&(s=s.replaceAll(QP,"")),s.split(`
|
|
174
|
+
`).map(a=>{if(n&&a.trim()==="")return"";let l;switch(o){case Ti.BREAK_AT_CHARACTERS:{l=gC(a,i,n);break}case Ti.BREAK_WORDS:{l=bC(a,i,n);break}case Ti.STRICT_WIDTH:{l=bg(a,i,n);break}default:l=vC(a,i,n)}return hC(l)}).join(`
|
|
175
|
+
`)},"wordWrap"),yg=80,$g=24,za=K((e,t,{shell:r,env:n}={})=>TP(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:r,env:n}).trim(),"exec"),Ui=K((e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),"create"),wg=K((e,t)=>{const{columns:r,rows:n}=Ui(e,t);if(!(Number.isNaN(r)||Number.isNaN(n))&&!(r===yg&&n===$g))return{columns:r,rows:n}},"createIfNotDefault"),$C=K(()=>{if(It.platform!=="linux")return!0;try{const e=Cn.readFileSync("/proc/self/stat","utf8"),t=e.lastIndexOf(") ");if(t===-1)return!1;const r=e.slice(t+2).trim().split(/\s+/),n=Number.parseInt(r[2],10),i=Number.parseInt(r[5],10);return Number.isNaN(n)||Number.isNaN(i)||i<=0?!1:n===i}catch{return!1}},"isForegroundProcess");function xg(){const{env:e,stdout:t,stderr:r}=It;if(t?.columns&&t?.rows)return Ui(t.columns,t.rows);if(r?.columns&&r?.rows)return Ui(r.columns,r.rows);if(e.COLUMNS&&e.LINES)return Ui(e.COLUMNS,e.LINES);const n={columns:yg,rows:$g};return It.platform==="win32"?fa()??n:It.platform==="darwin"?Au()??fa()??n:Au()??fa()??wC()??n}g(xg,"Le");K(xg,"terminalSize");const Au=K(()=>{try{const e=It.platform==="darwin"?Cn.constants.O_EVTONLY|Cn.constants.O_NONBLOCK:Cn.constants.O_NONBLOCK,{columns:t,rows:r}=NP.WriteStream(Cn.openSync("/dev/tty",e));return{columns:t,rows:r}}catch{}},"devTty"),fa=K(()=>{try{const e=za("tput",["cols"],{env:{TERM:"dumb",...It.env}}),t=za("tput",["lines"],{env:{TERM:"dumb",...It.env}});if(e&&t)return wg(e,t)}catch{}},"tput"),wC=K(()=>{try{if(!$C())return;const e=za("resize",["-u"]).match(/\d+/g);if(e.length===2)return wg(e[0],e[1])}catch{}},"resize"),vr=K((e,t)=>{switch(t){case"bottom":return{body:e.bottomBody,join:e.bottomJoin,left:e.bottomLeft,right:e.bottomRight};case"middle":return{body:e.joinBody,join:e.joinJoin,left:e.joinLeft,right:e.joinRight};case"top":return{body:e.topBody,join:e.topJoin,left:e.topLeft,right:e.topRight};default:throw new Error(`Invalid borderType: ${String(t)}`)}},"getHorizontalBorderChars"),xC=K(e=>({join:e.bodyJoin,left:e.bodyLeft,right:e.bodyRight}),"getVerticalBorderChars"),po=K((e,t,r)=>{let n=0;for(let i=0;i<r;i+=1)n+=e[t+i]??0;return r>1&&(n+=r-1),n},"calculateCellTotalWidth"),qa=K((e,t,r,n)=>{let i=t;for(;i>0&&e[i-1]?.[r]===n;)i-=1;let o=t;for(;o<e.length-1&&e[o+1]?.[r]===n;)o+=1;let s;const a=o-i+1;if(a===1)s=!0;else switch(n.vAlign){case"bottom":{s=t===o;break}case"middle":{const l=i+Math.floor(a/2);s=t===l;break}case"top":{s=t===i;break}default:s=t===i}return{firstRow:i,lastRow:o,showContent:s}},"determineCellVerticalPosition"),jC=K((e,t,r,n,i)=>{if(e.length===0)return[];let o=e.length-1;for(let l=0;l<e.length;l+=1){const c=e[l];if(c){for(const[p,u]of c.entries())if(u&&i(e,l,p,u)===l){const d=qa(e,l,p,u);o=Math.max(o,d.lastRow)}}}const s=Array.from({length:o+1}).fill(1);for(let l=0;l<e.length;l+=1){const c=e[l];if(c)for(let p=0;p<r.columns;p+=1){const u=c[p];if(u&&i(e,l,p,u)===l&&(u.rowSpan??1)===1){const d=u.colSpan??1,f=po(t,p,d),m=n(u,f).length;s[l]=Math.max(s[l]??1,m)}}}const a=Array.from({length:s.length}).fill(!1);if(r.fixedRowHeights)for(let l=0;l<s.length;l+=1){let c;r.fixedRowHeights[l]!==void 0?c=r.fixedRowHeights[l]:r.fixedRowHeights.length===1&&r.fixedRowHeights[0]!==void 0&&(c=r.fixedRowHeights[0]),c!==void 0&&(s[l]=Math.max(1,c),a[l]=!0)}for(let l=0;l<e.length;l+=1){const c=e[l];if(c)for(let p=0;p<r.columns;p+=1){const u=c[p];if(u&&i(e,l,p,u)===l&&(u.rowSpan??1)>1){const d=u.colSpan??1,f=po(t,p,d),m=n(u,f).length-1,h=qa(e,l,p,u),{firstRow:v,lastRow:b}=h;let w=0,k=0;for(let x=v;x<=b&&x<s.length;x+=1)w+=s[x]??1,a[x]||(k+=1);const y=m-w;if(y>0)if(k>0){const x=Math.ceil(y/k);let $=0;for(let E=v;E<=b&&E<s.length;E+=1)if(!a[E]){const O=Math.min(x,y-$);if(s[E]=(s[E]??1)+O,$+=O,$>=y)break}}else console.warn(`[calculateRowHeights] Content of spanning cell exceeds fixed height allocated. Cell: ${JSON.stringify(u.content)}, Required: ${String(m)}, Allocated: ${String(w)} (fixed).`)}}}return s},"calculateRowHeights"),br=K((e,t,r,n)=>{let i=t;for(;i>0&&e[i-1]?.[r]===n;)i-=1;return i},"findFirstOccurrenceRow"),Ha="__EMPTY__",Pu=K(e=>{if(typeof e=="string")return{content:e};if(typeof e=="number"||typeof e=="bigint"||typeof e=="boolean")return{content:String(e)};if(e==null)return{content:Ha};if(typeof e=="object"&&"content"in e){let{content:t}=e;if(typeof t=="number"||typeof t=="bigint"||typeof t=="boolean")t=String(t);else if(t==null)t=Ha;else if(typeof t!="string")throw new TypeError(`Invalid item type in grid cell: expected string, number, null, undefined, or GridItem object, but received ${JSON.stringify(e)} (type: ${typeof e})`);return{...e,content:t}}throw new TypeError(`Invalid item type in grid cell: expected string, number, null, undefined, or GridItem object, but received ${JSON.stringify(e)} (type: ${typeof e})`)},"normalizeGridCell"),kC=K((e,t,r,n,i)=>{const o=$e(e),s=" ".repeat(Math.max(0,n)),a=" ".repeat(Math.max(0,i));if(o===0)return s+" ".repeat(Math.max(0,t))+a;const l=Math.max(0,t-o);switch(r){case"center":{const c=Math.floor(l/2),p=l-c;return s+" ".repeat(c)+e+" ".repeat(p)+a}case"right":return s+" ".repeat(l)+e+a;default:return s+e+" ".repeat(l)+a}},"padAndAlignContent"),yn=/\r?\n/,Cu=/\s+/,le=K((e,t)=>!e||!t?e:typeof t=="function"?t(e):t.open+e+t.close,"applyColor");class ss{static{g(this,"ht")}static{K(this,"Grid")}#e;#i=[];#t;#o=new WeakMap;#r=new WeakMap;static createGridLayout(){return[]}constructor(t){const r={autoColumns:1,autoFlow:"row",autoRows:1,balancedWidths:!1,gap:0,paddingLeft:1,paddingRight:1,rows:0,showBorders:t.border!==void 0,truncate:!1,truncateOverflow:!0,wordWrap:!1};let n;Array.isArray(t.fixedRowHeights)?n=t.fixedRowHeights:typeof t.fixedRowHeights=="number"&&(n=[t.fixedRowHeights]),this.#e={...r,...t,columns:t.columns,fixedRowHeights:n,showBorders:t.border!==void 0||(t.showBorders??!1)};let{terminalWidth:i}=this.#e;if(i===void 0){const{columns:o}=xg();i=o}this.#t=i,this.#e.maxWidth&&(this.#e.maxWidth=Math.min(this.#e.maxWidth,this.#t))}addItem(t){return this.#i.push(Pu(t)),this}addItems(t){return this.#i.push(...t.map(r=>Pu(r))),this}setColumns(t){return this.#e.columns=t,this}setRows(t){return this.#e.rows=t,this}setBorder(t){return this.#e.border=t,this}setShowBorders(t){return this.#e.showBorders=t,this}setMaxWidth(t){return this.#e.maxWidth=t,this}toString(){const t=ss.createGridLayout();if(this.placeItems(t),t.length===0||t[0]?.length===0)return"";let r=this.calculateColumnWidths(t);const n=this.calculateTotalGridWidth(r),i=typeof this.#e.maxWidth=="number"&&this.#e.maxWidth>0?Math.min(this.#e.maxWidth,this.#t):this.#t;return n>i&&(r=this.adjustColumnWidthsForTerminal(r,n)),this.renderGrid(t,r)}placeItems(t){let r=0,n=0;const i=this.#e.rows>0?this.#e.rows:Number.POSITIVE_INFINITY;for(let o=0;o<this.#i.length;o+=1){const s=this.#i[o];if(s.content===Ha&&!(s.rowSpan&&s.rowSpan>1)&&!(s.colSpan&&s.colSpan>1)){if(this.#e.autoFlow==="row")n+=1,n>=this.#e.columns&&(n=0,r+=1);else{r+=1;const m=t.length>0?t.length:i;r>=m&&m!==Number.POSITIVE_INFINITY?(r=0,n+=1):t.length===0&&m===Number.POSITIVE_INFINITY&&(n+=1)}continue}const a=s.colSpan??1,l=s.rowSpan??1;let c=!1,p=r,u=n,d=0;const f=(t.length+l+5)*this.#e.columns;for(;!c&&p<i&&d<f;){for(d+=1;p+l>t.length;)t.push(Array.from({length:this.#e.columns}).fill(void 0));if(this.canPlaceItem(t,p,u,a,l))if(this.placeItem(t,p,u,s),c=!0,this.#e.autoFlow==="row")n=u+a,r=p,n>=this.#e.columns&&(n=0,r+=1);else{r=p+l,n=u;const m=t.length>0?t.length:i;r>=m&&(r=0,n+=1)}else if(this.#e.autoFlow==="row")u+=1,u>=this.#e.columns&&(u=0,p+=1);else{for(p+=1;p+l>t.length;)t.push(Array.from({length:this.#e.columns}).fill(void 0));const m=t.length>0?t.length:i;if(p>=m&&(p=0,u+=1,u>=this.#e.columns))break}}if(!c)if(console.warn(`@visulima/tabular: Could not find position for item: ${JSON.stringify(s)} after ${String(d)} attempts. Grid might be too small or layout impossible.`),this.#e.autoFlow==="row")n+=1,n>=this.#e.columns&&(n=0,r+=1);else{r+=1;const m=t.length>0?t.length:i;r>=m&&(r=0,n+=1)}if(d>=f)break}if(this.#e.rows===0)for(;t.length>0&&t.at(-1)?.every(o=>o===void 0);)t.pop()}canPlaceItem(t,r,n,i,o,s=!1){if(n+i>this.#e.columns)return!1;for(let a=r;a<r+o;a+=1)if(a<t.length){if(!t[a])return console.warn(`Grid layout unexpectedly missing row ${String(a)} during canPlaceItem check.`),!1;for(let l=n;l<n+i;l+=1)if(t[a]?.[l]!==void 0)return!1}else if(!s)return!1;return!0}computeWrappedContentWidth(t,r,n,i){let o=t;if(i){if(o>20){let s=0;for(const a of r){const l=a.split(Cu);for(const c of l)s=Math.max(s,Math.min($e(c),n))}o=Math.min(o,Math.max(s+4,12))}}else{let s=0;for(const a of r){const l=a.split(Cu);for(const c of l)s=Math.max(s,Math.min($e(c),n))}o=Math.min(o,Math.max(s+12,20))}return o}placeItem(t,r,n,i){const o=i.rowSpan??1,s=i.colSpan??1;for(let a=r;a<r+o;a+=1){for(;a>=t.length;)t.push(Array.from({length:this.#e.columns}).fill(void 0));for(let l=n;l<n+s;l+=1)l<this.#e.columns&&(t[a]||(console.error(`Logic error: Row ${String(a)} not found in placeItem despite check.`),t[a]=Array.from({length:this.#e.columns}).fill(void 0)),t[a][l]=i)}}calculateTotalGridWidth(t){let r=0;const n=this.#e.showBorders?this.#e.border:void 0;n&&(r+=n.bodyLeft.width,r+=n.bodyRight.width);const i=t.length,o=this.#e.showBorders?n?.bodyJoin.width??0:0,s=this.#e.gap;for(let a=0;a<i;a+=1)r+=t[a]??0,a<i-1&&(r+=s,r+=o);return r}adjustColumnWidthsForTerminal(t,r){const n=typeof this.#e.maxWidth=="number"&&this.#e.maxWidth>0?Math.min(this.#e.maxWidth??0,this.#t):this.#t;if(r<=n)return t;let i=0;const o=t.length,s=this.#e.showBorders?this.#e.border:void 0;if(s&&(i+=s.bodyLeft.width,i+=s.bodyRight.width),o>1){i+=(o-1)*this.#e.gap;const u=s?.bodyJoin.width??0;i+=(o-1)*u}if(i>=n)return Array.from({length:o}).fill(1);const a=n-i,l=t.reduce((u,d)=>u+d,0);if(l===0){const u=Math.floor(a/o);return Array.from({length:o}).fill(u)}const c=t.map(u=>{const d=u/l;return Math.max(1,Math.floor(a*d))});let p=a-c.reduce((u,d)=>u+d,0);if(p>0){const u=c.map((d,f)=>{const m=l>0?(t[f]??0)/l:1/o;return{index:f,remainder:a*m%1}}).toSorted((d,f)=>f.remainder-d.remainder);for(const d of u){if(p<=0)break;const{index:f}=d;c[f]!==void 0&&(c[f]+=1,p-=1)}}return c}calculateBalancedColumnWidths(t){const r=this.calculateMinimumColumnWidthsWithGrowableInfo(t),n=r.widths,{growableColumns:i}=r,o=typeof this.#e.maxWidth=="number"&&this.#e.maxWidth>0?Math.min(this.#e.maxWidth,this.#t):this.#t,s=this.#e.showBorders?this.#e.border:void 0;let a=0;if(s&&(a+=s.bodyLeft.width,a+=s.bodyRight.width),this.#e.columns>1){a+=(this.#e.columns-1)*this.#e.gap;const p=s?.bodyJoin.width??0;a+=(this.#e.columns-1)*p}const l=Math.max(0,o-a);if(n.reduce((p,u)=>p+u,0)>0){const p=Math.floor(l/this.#e.columns),u=Array.from({length:this.#e.columns}).fill(p),d=p*this.#e.columns;let f=l-d;for(let b=0;b<u.length&&f>0;b+=1)u[b]=(u[b]??0)+1,f-=1;const m=[];let h=0;for(let b=0;b<this.#e.columns;b+=1){const w=u[b]??0,k=n[b]??0,y=Math.max(w,k);m.push(y),h+=y}if(h>l){const b=l/h,w=m.map(x=>Math.max(3,Math.floor(x*b))),k=w.reduce((x,$)=>x+$,0);let y=l-k;for(let x=0;x<w.length&&y>0;x+=1)w[x]=(w[x]??0)+1,y-=1;return w}let v=l-h;if(v>0){const b=i.length>0?i:m.map((w,k)=>k);for(;v>0&&b.length>0;)for(const w of b){if(v<=0)break;m[w]=(m[w]??0)+1,v-=1}}return m}const c=Math.floor(l/this.#e.columns);return Array.from({length:this.#e.columns}).fill(c)}calculateMinimumColumnWidthsWithGrowableInfo(t){const r=Array.from({length:this.#e.columns}).fill(0),n=[],i=this.#e.paddingLeft+this.#e.paddingRight,o=this.#e.gap+(this.#e.showBorders?this.#e.border?.bodyJoin.width??0:0);for(let s=0;s<this.#e.columns;s+=1)for(let a=0;a<t.length;a+=1){const l=t[a]?.[s];if(!l||br(t,a,s,l)!==a||s>0&&t[a]?.[s-1]===l)continue;const c=l.colSpan??1,p=l.maxWidth??Number.POSITIVE_INFINITY,u=String(l.content??"").split(yn),d=this.#e.wordWrap&&l.wordWrap!==!1;let f=0;for(const m of u)f=Math.max(f,Math.min($e(m),p));f=this.computeWrappedContentWidth(f,u,p,d),c===1&&(r[s]=Math.max(r[s]??0,f+i),d&&!n.includes(s)&&n.push(s))}for(let s=0;s<t.length;s+=1)for(let a=0;a<this.#e.columns;a+=1){const l=t[s]?.[a];if(!l||br(t,s,a,l)!==s||a>0&&t[s]?.[a-1]===l)continue;const c=l.colSpan??1;if(c>1){const p=l.maxWidth??Number.POSITIVE_INFINITY,u=String(l.content??"").split(yn),d=this.#e.wordWrap&&l.wordWrap!==!1;let f=0;for(const b of u)f=Math.max(f,Math.min($e(b),p));f=this.computeWrappedContentWidth(f,u,p,d);const m=(c-1)*o,h=f+i+m;let v=0;for(let b=a;b<a+c;b+=1)v+=r[b]??0;if(h>v){const b=h-v,w=Math.ceil(b/c);for(let k=0;k<c&&a+k<this.#e.columns;k+=1)r[a+k]=Math.max(r[a+k]??0,w)}}}return{growableColumns:n,widths:r}}calculateColumnWidths(t){if(this.#e.fixedColumnWidths&&this.#e.fixedColumnWidths.length===this.#e.columns){const o=this.#e.fixedColumnWidths;if(!o.some(s=>s===void 0||!Number.isFinite(s)))return[...o];if(this.#e.balancedWidths){const s=Array.from({length:o.length}).fill(0),a=typeof this.#e.maxWidth=="number"&&this.#e.maxWidth>0?Math.min(this.#e.maxWidth,this.#t):this.#t,l=this.calculateTotalGridWidth(Array.from({length:s.length}).fill(0)),c=Math.max(0,a-l);let p=0;const u=[];for(const[m,h]of o.entries())typeof h=="number"&&Number.isFinite(h)?(s[m]=h,p+=h):u.push(m);let d=Math.max(0,c-p);const f=u.length>0?Math.floor(d/u.length):0;for(const m of u)s[m]=f;d-=f*u.length;for(const m of u){if(d<=0)break;s[m]+=1,d-=1}return s}}if(this.#e.balancedWidths)return this.calculateBalancedColumnWidths(t);const r=Array.from({length:this.#e.columns}).fill(0),n=this.#e.paddingLeft+this.#e.paddingRight,i=this.#e.gap+(this.#e.showBorders?this.#e.border?.bodyJoin.width??0:0);for(let o=0;o<this.#e.columns;o+=1)for(let s=0;s<t.length;s+=1){const a=t[s]?.[o];if(!a||br(t,s,o,a)!==s||o>0&&t[s]?.[o-1]===a)continue;const l=a.colSpan??1,c=a.maxWidth??Number.POSITIVE_INFINITY,p=String(a.content??"").split(yn);let u=0;for(const d of p)u=Math.max(u,Math.min($e(d),c));l===1&&(r[o]=Math.max(r[o]??0,u+n))}for(let o=0;o<t.length;o+=1)for(let s=0;s<this.#e.columns;s+=1){const a=t[o]?.[s];if(!a||br(t,o,s,a)!==o||s>0&&t[o]?.[s-1]===a)continue;const l=a.colSpan??1;if(l>1){const c=a.maxWidth??Number.POSITIVE_INFINITY,p=String(a.content??"").split(yn),u=this.#e.wordWrap&&a.wordWrap!==!1;let d=0;for(const b of p)d=Math.max(d,Math.min($e(b),c));d=this.computeWrappedContentWidth(d,p,c,u);let f=0;for(let b=s;b<s+l;b+=1)f+=r[b]??0;const m=l>1?(l-1)*i:0,h=d+n+m,v=f+m;if(h>v){const b=h-v,w=Math.floor(b/l);let k=0;for(let y=0;y<l&&s+y<this.#e.columns;y+=1){const x=Math.min(w,b-k);if(r[s+y]=(r[s+y]??0)+x,k+=x,k>=b)break}}}}if(this.#e.maxWidth){const o=this.calculateTotalGridWidth(r);if(o>this.#e.maxWidth)return this.adjustColumnWidthsForTerminal(r,o)}return r}renderVisualRowContent(t,r,n,i,o){const s=t[r];if(!s)return"";const a=this.#e.borderColor??this.#e.foregroundColor??void 0,l=[],c=this.#e.showBorders&&this.#e.border?xC(this.#e.border):void 0,p=c&&c.left.width>0?c.left.char:"",u=c&&c.right.width>0?c.right.char:"",d=c&&c.join.width>0?c.join.char:"",f=" ".repeat(this.#e.gap);p&&l.push(le(le(p,a),this.#e.backgroundColor));let m=0;for(;m<this.#e.columns;){const h=s[m]??void 0;let v=1,b;if(h){const w=h.colSpan??1;v=w;const k=br(t,r,m,h),y=po(i,m,w),x=this.alignCellContent(h,y),$=x.length,E=this.getCachedCellVerticalPosition(t,r,m,h);E.firstRow!==k&&console.warn(`Mismatch between findFirstOccurrenceRow (${String(k)}) and determineCellVerticalPosition (${String(E.firstRow)})`);const O=o.slice(k,E.lastRow+1).reduce((U,ee)=>U+ee,0),S=E.lastRow-E.firstRow+1;let j=n,A=0;for(let U=k;U<r;U+=1)U<o.length&&(j+=o[U]??1),U<E.lastRow&&(A+=1);j+=A;const N=h.vAlign??"top";let q;switch(N){case"bottom":{let U=n;for(let X=k;X<r;X+=1)U+=o[X]??1;const ee=O-$;q=U>=ee?U-ee:-1;break}case"middle":{const U=Math.round((O-$)/2);let ee=n;for(let X=k;X<r;X+=1)ee+=o[X]??1;q=ee>=U&&ee<U+$?ee-U:-1;break}case"top":{q=j;break}default:q=j}const J=q>=0&&q<$;if(b=" ".repeat(Math.max(0,y)),J){let U=!1;N==="middle"&&S%2===0&&q===0&&(U=!0),U||(b=x[q]??b)}h.colSpan&&h.colSpan>1&&(b+=f.repeat(h.colSpan)),h.foregroundColor?b=le(b,h.foregroundColor):this.#e.foregroundColor&&(b=le(b,this.#e.foregroundColor)),h.backgroundColor?b=le(b,h.backgroundColor):this.#e.backgroundColor&&(b=le(b,this.#e.backgroundColor))}else{const w=this.#e.paddingLeft+this.#e.paddingRight,k=Math.max(0,(i[m]??0)-w),y=" ".repeat(this.#e.paddingLeft+k+this.#e.paddingRight);b=le(le(n===0?y:" ".repeat(y.length),this.#e.foregroundColor),this.#e.backgroundColor)}l.push(b),m+v<this.#e.columns&&(l.push(f),this.#e.showBorders&&d&&l.push(le(le(d,a),this.#e.backgroundColor)),this.#e.gap>0&&l.push(f)),m+=v}return u&&l.push(le(le(u,a),this.#e.backgroundColor)),l.join("")}alignCellContent(t,r){const n=this.#o.get(t);if(n?.has(r))return n.get(r);const{paddingLeft:i,paddingRight:o}=this.#e,s=i+o,a=r-s;if(a<=0){const u=[" ".repeat(s+this.#e.gap)];return n?n.set(r,u):this.#o.set(t,new Map([[r,u]])),u}let l;const c=String(t.content??"");if(l=c.includes(`
|
|
176
|
+
`)||c.includes("\r")?c.split(yn):[c],this.#e.wordWrap&&t.wordWrap!==!1){const u=typeof this.#e.wordWrap=="object"?this.#e.wordWrap:{},d=typeof t.wordWrap=="object"?t.wordWrap:u;l=yC(c,{...d,width:a}).split(`
|
|
177
|
+
`)}if(this.#e.truncate&&t.truncate!==!1){const u=typeof this.#e.truncate=="object"?this.#e.truncate:{},d=typeof t.truncate=="object"?t.truncate:u;l=l.map(f=>Eu(f,a,d))}else this.#e.truncateOverflow&&(l=l.map(u=>$e(u)>a?Eu(u,a,{}):u));const p=l.map(u=>kC(u,a,t.hAlign??"left",i,o));return n?n.set(r,p):this.#o.set(t,new Map([[r,p]])),p}renderHorizontalBorder(t,r,n,i,o,s=-1){if(!this.#e.showBorders||!this.#e.border)return"";const a=this.#e.border,l=vr(a,o),c=l.body.char,p=l.body.width,u=a.bodyJoin.char;if(o!=="middle"&&p===0)return"";let d=l.left.char,f=l.right.char;if(o==="middle"&&s!==-1){const b=t[n]?.[0]??void 0,w=t[s]?.[0]??void 0;b&&w&&b===w&&(d=u);const k=this.#e.columns-1,y=t[n]?.[k]??void 0,x=t[s]?.[k]??void 0;y&&x&&y===x&&(f=u)}const m=[],h=" ".repeat(this.#e.gap);d&&m.push(le(le(d,this.#e.borderColor),this.#e.backgroundColor));let v;for(let b=0;b<this.#e.columns;b+=1){const w=t[n]?.[b]??void 0,k=o==="middle"&&s!==-1?t[s]?.[b]??void 0:void 0;let y,x=!1;if(w&&(b===0||t[n]?.[b-1]!==w)&&(y=w,x=!0),w&&!x)continue;if(!w){const O=i[b]??0;if(v=p>0?c.repeat(O):" ".repeat(O),m.push(le(le(v,this.#e.borderColor),this.#e.backgroundColor)),b<this.#e.columns-1){const S=this.determineJoinChar(o,t,n,s,b,b+1);m.push(h),S.width>0&&m.push(le(le(S.char,this.#e.borderColor),this.#e.backgroundColor))}continue}const $=y?.colSpan??1;if(o==="middle"&&o==="middle"&&k&&w===k&&y){const O=y.vAlign==="middle",{firstRow:S,lastRow:j}=this.getCachedCellVerticalPosition(t,n,b,y),A=j-S+1,N=A%2===0,q=S+Math.ceil(A/2)-1,J=po(i,b,$),U=this.alignCellContent(y,J),ee=U.length;if(O&&N&&n===q)v=le(U[0]??"",this.#e.borderColor);else{let X=0;for(let R=S;R<=n;R+=1)X+=r[R]??1,R<n&&(X+=1);const W=X;if(W>=0&&W<ee)v=le(U[W]??"",this.#e.foregroundColor);else{const R=i.slice(b,b+$).reduce((B,I)=>B+I,0)+($-1)*(this.#e.gap+this.#e.border.bodyJoin.width);v=le(" ".repeat(R),this.#e.borderColor)}}m.push(le(v,this.#e.backgroundColor))}else{const O=[];for(let S=b;S<b+$;S+=1){const j=i[S]??0,A=p>0?c:" ";if(O.push(A.repeat(j+this.#e.gap)),S<b+$-1){const N=this.determineJoinChar(o,t,n,s,S,S+1);N.width>0&&O.push(N.char)}}v=O.join(""),m.push(le(le(v,this.#e.borderColor),this.#e.backgroundColor))}const E=b+$-1;if(E<this.#e.columns-1){const O=this.determineJoinChar(o,t,n,s,E,E+1);O.width>0&&m.push(le(le(O.char,this.#e.borderColor),this.#e.backgroundColor))}b+=$-1}return f&&m.push(le(le(f,this.#e.borderColor),this.#e.backgroundColor)),m.join("")}determineJoinChar(t,r,n,i,o,s=-1){if(!this.#e.showBorders||!this.#e.border)return{char:" ",width:this.#e.gap};const a=this.#e.border;if(t!=="middle"){const x=vr(a,t),$=r[n]?.[o]??void 0,E=s===-1?o+1:s,O=r[n]?.[E]??void 0,S=$!==void 0&&O!==void 0&&$===O?x.body:x.join,{char:j,width:A}=S;return{char:j,width:A>0?A:this.#e.gap}}if(i===-1||s===-1)return{char:" ",width:this.#e.gap};const l=a.bodyJoin,c=r[n]?.[o]??void 0,p=r[i]?.[o]??void 0,u=r[n]?.[s]??void 0,d=r[i]?.[s]??void 0,f=c!==void 0&&p!==void 0&&c===p,m=u!==void 0&&d!==void 0&&u===d,h=c!==void 0&&u!==void 0&&c===u,v=p!==void 0&&d!==void 0&&p===d;let b;const w=vr(a,"middle");f&&m?b=h?{char:" ",width:l.width}:l:f?b=a.joinLeft:m?b=a.joinRight:h&&v?b=w.body:h?b=a.topJoin:v?b=a.bottomJoin:b=a.joinJoin;const{char:k,width:y}=b;return{char:k,width:y>0?y:this.#e.gap}}renderGrid(t,r){if(t.length===0)return"";const n=[],i=jC(t,r,this.#e,this.alignCellContent.bind(this),br),o=this.#e.showBorders&&this.#e.border?vr(this.#e.border,"top"):void 0;o&&o.body.width>0&&n.push(this.renderHorizontalBorder(t,i,0,r,"top"));for(let a=0;a<t.length;a+=1){const l=i[a]??1;for(let p=0;p<l;p+=1)n.push(this.renderVisualRowContent(t,a,p,r,i));const c=this.#e.showBorders&&this.#e.border?vr(this.#e.border,"middle"):void 0;if(a<t.length-1&&c&&c.body.width>0){const p=t[a],u=t[a+1];let d=!1;if(p&&u)for(let f=0;f<this.#e.columns;f+=1){const m=p[f],h=u[f];if(m!==h){d=!0;break}}d&&n.push(this.renderHorizontalBorder(t,i,a,r,"middle",a+1))}}const s=this.#e.showBorders&&this.#e.border?vr(this.#e.border,"bottom"):void 0;return s&&s.body.width>0&&n.push(this.renderHorizontalBorder(t,i,t.length-1,r,"bottom")),n.join(`
|
|
178
|
+
`)}getCachedCellVerticalPosition(t,r,n,i){const o=this.#r.get(i);if(o)return o;const s=qa(t,r,n,i);return this.#r.set(i,s),s}}K(e=>new ss(e),"createGrid");const EC={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}},SC={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 OC=Object.defineProperty,cc=g((e,t)=>OC(e,"name",{value:t,configurable:!0}),"y$2");const AC=cc(e=>e.reduce((t,r)=>r===null?t+1:typeof r=="object"&&!Array.isArray(r)?(r.colSpan??=1,r.colSpan<=0?t+1:t+r.colSpan):t+1,0),"computeRowLogicalWidth");let PC=class{static{g(this,"v")}static{cc(this,"Table")}#e;#i=[];#t=[];#o=[];#r=!0;#n=void 0;constructor(t={}){this.#e={...t,showFooter:t.showFooter??!0,showHeader:t.showHeader??!0,style:{border:EC,paddingLeft:1,paddingRight:1,...t.style}}}setHeaders(t){return t.length>0&&!Array.isArray(t[0])?this.#t=[t]:this.#t=t.map(r=>Array.isArray(r)?r:[r]),this.#r=!0,this.#n=void 0,this}setFooter(t){return t.length>0&&!Array.isArray(t[0])?this.#o=[t]:this.#o=t.map(r=>Array.isArray(r)?r:[r]),this.#r=!0,this.#n=void 0,this}addRow(t){if(!Array.isArray(t))throw new TypeError("Row must be an array");return this.#i.push(t),this.#r=!0,this.#n=void 0,this}addRows(...t){for(const r of t)this.addRow(r);return this.#r=!0,this.#n=void 0,this}toString(){if(!this.#r&&this.#n!==void 0)return this.#n;const t=this.#e.showHeader?this.#t:[],r=this.#e.showFooter?this.#o:[],n=[...t,...this.#i,...r];if(n.length===0)return this.#n="",this.#r=!1,"";let i=0;for(const u of n){const d=u;Array.isArray(d)?i=Math.max(i,AC(d)):console.error("Unexpected non-array element found while calculating columns:",d)}if(i===0)return this.#n="",this.#r=!1,"";let o;Array.isArray(this.#e.columnWidths)?o=this.#e.columnWidths.length>=i?this.#e.columnWidths.slice(0,i):[...this.#e.columnWidths,...Array.from({length:i-this.#e.columnWidths.length}).fill(void 0)]:typeof this.#e.columnWidths=="number"&&(o=Array.from({length:i}).fill(this.#e.columnWidths));let s;const a=n.length;if(Array.isArray(this.#e.rowHeights)?s=this.#e.rowHeights:typeof this.#e.rowHeights=="number"&&(s=Array.from({length:a}).fill(this.#e.rowHeights)),o&&Array.isArray(o)){const u=[...o];for(const d of n){const f=d;for(const[m,h]of f.entries()){let v={};if(typeof h=="object"&&h!==null&&!Array.isArray(h)){const{content:b,href:w,...k}=h;v=k}v.width!==void 0?u[m]=v.width:v.maxWidth!==void 0&&u[m]!==void 0&&(u[m]=Math.min(u[m],v.maxWidth))}}o=u}const l={autoFlow:"row",backgroundColor:this.#e.style?.backgroundColor,balancedWidths:this.#e.balancedWidths??!1,border:this.#e.style?.border,borderColor:this.#e.style?.borderColor,columns:i,fixedColumnWidths:o,fixedRowHeights:s,foregroundColor:this.#e.style?.foregroundColor,gap:this.#e.gap??0,maxWidth:this.#e.maxWidth,paddingLeft:this.#e.style?.paddingLeft,paddingRight:this.#e.style?.paddingRight,terminalWidth:this.#e.terminalWidth,truncate:this.#e.truncate??(o?.every(u=>typeof u=="number")||this.#e.maxWidth!==void 0&&!this.#e.balancedWidths),truncateOverflow:this.#e.truncateOverflow??!0,wordWrap:this.#e.wordWrap??!1},c=new ss(l),p=[];for(const[u,d]of n.entries()){const f=d;if(!Array.isArray(f)){console.error("Skipping non-array row while creating GridItems:",f);continue}const m=this.#e.showHeader?this.#t.length:0,h=this.#i.length,v=this.#e.showHeader&&u<m,b=this.#e.showFooter&&u>=m+h,w=v&&f.length===1&&i>1,k=b&&f.length===1&&i>1;for(const y of f){let x=y,$={};if(typeof x=="object"&&x!==null&&!Array.isArray(x)){const{content:j,href:A,...N}=x;x=A?`\x1B]8;;${A}\x1B\\${String(j)}\x1B]8;;\x1B\\`:j,$=N}w&&($.colSpan=i),k&&($.colSpan=i);const E=this.#e.transformTabToSpace&&typeof x=="string"?x.replaceAll(" "," ".repeat(this.#e.transformTabToSpace)):x,{maxWidth:O,width:S}=$;p.push({backgroundColor:$.backgroundColor,colSpan:$.colSpan,content:E,foregroundColor:$.foregroundColor,hAlign:$.hAlign,maxWidth:O,rowSpan:$.rowSpan,truncate:$.truncate??(O===void 0?void 0:!0),vAlign:$.vAlign,width:S,wordWrap:$.wordWrap})}}return c.addItems(p),this.#n=c.toString(),this.#r=!1,this.#n}};const CC=cc(e=>new PC(e),"createTable");var RC=Object.defineProperty,st=g((e,t)=>RC(e,"name",{value:t,configurable:!0}),"c$a");const TC=st(e=>e.logger,"getLogger"),NC=/\{\s*"name"/,_C=db(ub.exec);let jg=class extends Error{static{g(this,"D")}static{st(this,"AttwReportedError")}};function kg(e){const t=new Map;return(...r)=>{const n=r.toString();if(t.has(n))return t.get(n);const i=e(...r);return t.set(n,i),i}}g(kg,"te$1");st(kg,"memo");const MC={bundler:"bundler",node10:"node10","node16-cjs":"node16 (from CJS)","node16-esm":"node16 (from ESM)"},IC={"":"",1:"(CJS)",99:"(ESM)"},Ru={CJSOnlyExportsDefault:Mi,CJSResolvesToESM:Ar,FallbackCondition:Ar,FalseCJS:$r,FalseESM:$r,FalseExportDefault:Mi,InternalResolutionError:$r,MissingExportEquals:Mi,NamedExports:Ar,NoResolution:$r,UnexpectedModuleSyntax:$r,UntypedResolution:Ar},WC={esmOnly:["node10","node16-cjs"],node16:["node10"],strict:[]},BC=st(e=>{if(e.startsWith("{"))return e;const t=NC.exec(e)?.index;if(t!==void 0)return e.slice(t);const r=e.indexOf("{");return r!==-1?e.slice(r):e},"fixPnpmStdout"),DC=st(e=>{const t=e.split(`
|
|
179
|
+
`);let r="[";for(const n of t)n&&(r+=`${n},`);return r.at(-1)===","&&(r=r.slice(0,-1)),r+="]",r},"fixYarnStdout"),FC=st(async(e,t)=>{switch(e){case"auto":{const{detect:r}=await import("package-manager-detector/detect"),n=await r({cwd:t});if(!n)return;if(n.name==="bun")throw new Error("Bun does not support --json on the pack command");return n.name}case"bun":throw new Error("Bun does not support --json on the pack command");case"pnpm":return"pnpm";case"yarn":return"yarn";default:return"npm"}},"resolvePackageManager"),LC=st((e,t,r)=>{const{allResolutionKinds:n,filterProblems:i,getResolutionOption:o,groupProblemsByKind:s,problemAffectsEntrypoint:a,problemAffectsResolutionKind:l,problemKindInfo:c}=r,p=n.filter(y=>!t.includes(y)),u=n.filter(y=>t.includes(y)),d=[...p,...u],f=Object.keys(e.entrypoints),m=f.map(y=>`"${y==="."?e.packageName:`${e.packageName}/${y.slice(2)}`}"`),h=f.map((y,x)=>{const $=e.problems.some(E=>a(E,y,e))?"redBright":"greenBright";return We[$](m[x])}),v=kg((y,x)=>{const $=t.includes(x)?"(ignored) ":"",E=s(i(e.problems,e,{entrypoint:y,resolutionKind:x})),O=e.entrypoints[y].resolutions[x],{resolution:S}=O,j=Object.keys(E);if(j.length>0)return j.map(J=>$+Ru[J](c[J].shortDescription)).join(`
|
|
180
|
+
`);const A="OK (JSON)",N=e.programInfo[o(x)].moduleKinds?.[S?.fileName??""]?.detectedKind??"",q=O.isWildcard?"(wildcard)":`OK ${IC[N]}`;return $+(S?.isJson?A:q)}),b=CC({style:{border:SC}});b.setHeaders(["",...d.map(y=>MC[y])]),h.forEach((y,x)=>{const[$,E,O,S]=d.map(j=>f.map(A=>v(A,j)));b.addRow([y,$[x]??null,E[x]??null,O[x]??null,S[x]??null])});const w=s(e.problems),k=Object.entries(w).map(([y,x])=>{const $=c[y],E=x.some(S=>p.some(j=>l(S,j,e))),O=`${`${$.description}${$.details?` Use \`-f json\` to see ${$.details}.`:""}`} ${$.docsUrl}`;return`${E?"":"(ignored per resolution) "}${Ru[y](O)}`});return`Are the types wrong problems found:
|
|
181
|
+
|
|
182
|
+
${b.toString()}
|
|
183
|
+
|
|
184
|
+
${k.join(`
|
|
185
|
+
|
|
186
|
+
`)}`},"buildProblemMessage"),zC=st(async(e,t,r)=>{let n=`--pack-destination ${t}`;e==="yarn"?n=`--out "${G(t,"package.tgz")}"`:e==="bun"&&(n=` --destination "${t}"`);let i=" --ignore-scripts";e==="yarn"?i="":e==="pnpm"&&(i=" --config.ignore-scripts=true");let o=(await _C(`${e} pack --json ${n}${i}`,{cwd:r,encoding:"utf8"})).stdout.trim();e==="pnpm"?o=BC(o):e==="yarn"&&(o=DC(o));const s=JSON.parse(o);if(!s?.filename)throw new Error(`Invalid npm pack output format: ${o}`);return s.filename},"packPackage"),qC=st((e,t,r,n,i,o)=>{if(t.types!==!1&&t.problems.length>0){const s=LC(t,r,o);if(n==="error")throw e.error({message:s,prefix:"attw"}),new jg("attw reported types problems; see the log above.");e.warn({message:s,prefix:"attw"});return}e.success({message:Ka(`No Are the types wrong problems found ${ed`(${Math.round(performance.now()-i).toString()}ms)`}`),prefix:"attw"})},"reportAnalysis"),HC=st(async(e,t)=>{if(!e.options?.validation)return;const{validation:r}=e.options;if(!r.attw)return;const n=TC(e),{packageJson:i}=ns(e.options.rootDir);e.pkg=i,t&&n.raw(`
|
|
187
|
+
`),await qx(e.pkg,["@arethetypeswrong/core","package-manager-detector"],"devDependencies",{logger:{warn:st(y=>{n.warn({message:y,prefix:"attw"})},"warn")}});let{level:o="warn",pm:s="auto",profile:a="strict",...l}=r.attw===!0?{}:r.attw;const c=performance.now();n.debug({message:"Running attw check",prefix:"attw"});const p=await xd(G(bd(),"packem-attw-"));let u;try{u=await import("@arethetypeswrong/core")}catch{n.error({message:`ATTW check requires ${Mi`@arethetypeswrong/core`} to be installed.`,prefix:"attw"});return}const d=await FC(s,e.options.rootDir);if(d===void 0)throw new Error("Could not detect a package manager to run the attw check.");const{allResolutionKinds:f,getResolutionOption:m,groupProblemsByKind:h}=await import("@arethetypeswrong/core/utils"),{filterProblems:v,problemAffectsEntrypoint:b,problemAffectsResolutionKind:w,problemKindInfo:k}=await import("@arethetypeswrong/core/problems");try{const y=await zC(d,p,e.options.rootDir),x=await Yi(y),$=u.createPackageFromTarballData(new Uint8Array(x)),E=await u.checkPackage($,l),O=WC[a];qC(n,E,O,o,c,{allResolutionKinds:f,filterProblems:v,getResolutionOption:m,groupProblemsByKind:h,problemAffectsEntrypoint:b,problemAffectsResolutionKind:w,problemKindInfo:k})}catch(y){throw y instanceof jg||n.error({message:`ATTW check failed: ${y instanceof Error?y.message:String(y)}`,prefix:"attw"}),y}finally{await vo(p,{force:!0,recursive:!0}).catch(()=>{})}},"attw");var JC=Object.defineProperty,Eg=g((e,t)=>JC(e,"name",{value:t,configurable:!0}),"d$5");const Tu=Eg(e=>Array.from(e,t=>Ar(t)).join(", "),"joinWarnings"),UC=Eg(e=>{if(e.hoistedDependencies.size>0){const o=`These dependencies are shamefully hoisted: ${Tu(e.hoistedDependencies)}`;Q(e,o)}let t=Object.keys(e.pkg.dependencies??{}).filter(o=>!e.usedDependencies.has(o));const{validation:r}=e.options,n=r===!1||r===void 0?!1:r.dependencies,i=n===!1?!1:n.unused;if(i!==!1&&(t=t.filter(o=>!i.exclude.includes(o))),t.length>0){const o=`These dependencies are listed in package.json but not used: ${Tu(t)}`;Q(e,o)}},"validateDependencies");var GC=Object.defineProperty,VC=g((e,t)=>GC(e,"name",{value:t,configurable:!0}),"o$1");const Nu=">=18.0.0",KC=VC(e=>{const t=e.options.validation,{pkg:r}=e;if(t.packageJson?.engines===!1)return;const n=process.version,i=r.engines?.node;if(!i){Q(e,`The 'engines.node' field is missing in your package.json. Consider adding "engines": { "node": "${Nu}" } to specify Node.js version requirements.`);return}if(!nt.validRange(i)){Q(e,`Invalid Node.js version range "${i}" in engines.node field. Please use a valid semver range like "${Nu}".`);return}if(!nt.satisfies(n,i))throw new Error(`Node.js version mismatch: Current version ${n} does not satisfy the required range "${i}" specified in package.json engines.node field.`)},"validateEngines");var YC=Object.defineProperty,Sg=g((e,t)=>YC(e,"name",{value:t,configurable:!0}),"i$2");const XC=Sg((e,t)=>mb(e,t)<=e.length/3||t.includes(e),"isSimilar"),ZC=Sg((e,t)=>{const r=e.toLowerCase();return t.filter(n=>XC(n.toLowerCase(),r))},"findAlternatives");var QC=Object.defineProperty,Vn=g((e,t)=>QC(e,"name",{value:t,configurable:!0}),"r$2");const e7=/\/[^*/]*\*[^\n\r/\u2028\u2029]*(?:[\n\r\u2028\u2029][^*/]*\*[^\n\r/\u2028\u2029]*)*(?:\/.*)?$/,t7=Vn((e,t)=>{const{options:r}=e;return $l(e.pkg.exports,t,r.declaration,[],r.ignoreExportKeys??[]).filter(n=>!n.ignored).map(n=>r.dtsOnly?n.subKey==="types"?n.file:void 0:n.file)},"collectExportFilenames"),r7=Vn((e,t)=>e.options.dtsOnly||!t?[""]:typeof e.pkg.bin=="string"?[e.pkg.bin]:typeof e.pkg.bin=="object"?Object.values(e.pkg.bin):[],"resolveBinEntries"),n7=Vn((e,t)=>{let r="Potential missing or wrong package.json files:";for(const n of e){const i=ZC(n,t);r+=`
|
|
188
|
+
- ${pe(n)}${i.length>0?qg` (did you mean ${i.map(o=>`"${o}"`).join(", ")}?)`:""}`}return r},"buildMissingOutputsMessage"),i7=Vn(e=>{const{options:t}=e,r=t.validation,{packageJson:n}=r;if(!n?.exports)return;const i=r7(e,!!n.bin),o=e.pkg.type==="module"?"esm":"cjs",s=new Set([t.declaration&&n.types?e.pkg.types:"",t.declaration&&n.types?e.pkg.typings:"",...i,t.dtsOnly&&!n.main?"":e.pkg.main,t.dtsOnly&&!n.module?"":e.pkg.module,...t7(e,o)].filter(Boolean).map(p=>p&&re(t.rootDir,p.replace(e7,"")))),a=[];for(const p of s)p&&!p.includes("*")&&!el(p)&&a.push(p.replace(`${t.rootDir}/`,""));const l=Vn(p=>Be(t.rootDir,re(t.outDir,p)),"rPath"),c=e.buildEntries.filter(p=>!p.chunk).map(p=>l(p.path));if(a.length>0){const p=n7(a,c);Q(e,p)}},"validatePackageEntries");var o7=Object.defineProperty,Je=g((e,t)=>o7(e,"name",{value:t,configurable:!0}),"u$1");const s7=Je((e,t)=>{const r=e.options.validation;if(r.packageJson?.exports===!1)return;const n=new Set(["default","import","module-sync","node","node-addons","require"]),i=new Set(["browser","bun","deno","development","edge-light","electron","production","react-native","react-server","types","workerd"]),o=r.packageJson?.extraConditions??[],s=new Set(o),a=new Set([...i,...s,...n]),l=Je((d,f)=>{if(d!==null){if(typeof d=="string"){if(!d.startsWith("./")){Q(e,`Invalid exports path "${d}" at ${f}. Export paths must start with "./"`);return}if(d.includes("../")){Q(e,`Invalid exports path "${d}" at ${f}. Export paths should not contain "../" for security reasons`);return}const m=r.packageJson?.allowedExportExtensions??[],h=[...kv,...m];if(wa(d)){try{const v=d.startsWith("./")?re(e.options.rootDir,d.slice(2)):re(e.options.rootDir,d),b=Qu([v],{cwd:e.options.rootDir,dot:!1,ignore:["**/node_modules/**","**/.git/**","**/dist/**"]});if(b.length===0)return;const w=b.filter(k=>!h.some(y=>k.endsWith(y)));w.length>0&&Q(e,`Export path "${d}" at ${f} matches files with invalid extensions: ${w.join(", ")}. Valid extensions are: ${h.join(", ")}`)}catch(v){Q(e,`Could not validate glob pattern "${d}" at ${f}: ${v instanceof Error?v.message:"Unknown error"}`)}return}h.some(v=>d.endsWith(v))||Q(e,`Export path "${d}" at ${f} should have a valid file extension (${h.join(", ")})`);return}if(Array.isArray(d)){if(d.length===0){Q(e,`Empty fallback array at ${f}. Fallback arrays should contain at least one entry`);return}d.forEach((m,h)=>{l(m,`${f}[${String(h)}]`)});return}if(typeof d=="object"){const m=Object.keys(d);if(m.length===0){Q(e,`Empty conditions object at ${f}. Conditional exports should define at least one condition`);return}const h=m.filter(b=>!a.has(b));if(h.length>0){const b=o.length>0,w=[...n].join(", ");b?Q(e,`Unknown export conditions [${h.join(", ")}] at ${f}. Consider using standard conditions (${w}) or add custom conditions to 'validation.packageJson.extraConditions' in your packem config.`):Q(e,`Unknown export conditions [${h.join(", ")}] at ${f}. Consider using standard conditions (${w}) or add custom conditions using the 'extraConditions' option in your validation config.`)}const v=m.filter(b=>n.has(b));if(v.length>1){const b=["node-addons","node","import","require","module-sync","default"],w=v,k=b.filter(y=>w.includes(y));JSON.stringify(w)!==JSON.stringify(k)&&Q(e,`Incorrect condition order at ${f}. Standard conditions should be ordered: ${k.join(" > ")}`)}m.forEach(b=>{l(d[b],`${f}.${b}`)});return}Q(e,`Invalid exports value type at ${f}. Expected string, array, object, or null`)}},"validateExportsValue"),c=Je((d,f)=>{d.startsWith(".")&&!d.startsWith("./")&&d!=="."&&Q(e,`Invalid subpath "${d}". Subpaths should start with "./" or be exactly "."`),d.includes("*")&&(d.match(/\*/g)??[]).length>1&&Q(e,`Invalid subpath pattern "${d}". Only one "*" wildcard is allowed per subpath`),l(f[d],`exports["${d}"]`)},"validateSubpathKey"),p=Je((d,f,m)=>{const h=d.filter(b=>b!=="."),v=e.pkg.bin!==void 0&&h.length<=1&&h.every(b=>b==="./package.json");!f.includes(".")&&!v&&Q(e,'Missing main export ".". Subpaths exports should include a main export entry');for(const b of f)c(b,m)},"validateSubpaths"),u=Je(d=>{const f=Object.keys(d);if(f.length===0){Q(e,"Empty exports object. Define at least one export entry");return}const m=f.filter(v=>v.startsWith(".")),h=f.filter(v=>!v.startsWith("."));if(m.length>0&&h.length>0){Q(e,'Mixed subpaths and conditions in exports object. Use either subpaths (keys starting with ".") or conditions, not both');return}m.length>0?p(m,f,d):l(d,"exports")},"validateExportsRecord");Je(d=>{if(typeof d=="string"){l(d,"exports");return}if(Array.isArray(d)){d.forEach((f,m)=>{l(f,`exports[${String(m)}]`)});return}if(typeof d=="object"&&d!==null){u(d);return}Q(e,"Invalid exports field type. Expected string, array, or object")},"validateExportsObject")(t)},"validateExports"),a7=Je(({context:e,pkg:t,validation:r})=>{t.name===void 0&&r.packageJson?.name!==!1&&Q(e,"The 'name' field is missing in your package.json. Please provide a valid package name."),r.packageJson?.files!==!1&&Array.isArray(t.files)&&!t.files.includes("*")&&(t.files.length===0?Q(e,"The 'files' field in your package.json is empty. Please specify the files to be included in the package."):t.files.some(n=>n.includes(e.options.outDir))||Q(e,`The 'files' field in your package.json is missing the '${e.options.outDir}' directory. Ensure the output directory is included.`))},"validateNameAndFiles"),l7=Je(({cjsJSExtension:e,context:t,esmJSExtension:r,pkg:n,validation:i})=>{i.packageJson?.main!==!1&&(n.main===void 0&&Q(t,"The 'main' field is missing in your package.json. This field should point to your main entry file."),n.main?.endsWith(`.${r}`)&&Q(t,`The 'main' field in your package.json should not use a '.${r}' extension for CommonJS modules.`)),i.packageJson?.module!==!1&&(n.module===void 0&&t.options.emitESM&&Q(t,"The 'module' field is missing in your package.json, but you are emitting ES modules."),n.module&&n.main&&n.module===n.main&&Q(t,`Conflict detected: The 'module' and 'main' fields both point to '${n.module}'. Please ensure they refer to different module types.`),t.options.emitESM&&n.module?.endsWith(`.${e}`)&&Q(t,`The 'module' field in your package.json should not use a '.${e}' extension for ES modules.`))},"validateCjsModuleFields"),c7=Je(({cjsJSExtension:e,context:t,pkg:r,validation:n})=>{n.packageJson?.main!==!1&&r.main===void 0&&Q(t,"The 'main' field is missing in your package.json. This field is needed when emitting CommonJS modules."),n.packageJson?.module!==!1&&(r.module===void 0&&Q(t,"The 'module' field is missing in your package.json. This field is necessary when emitting ES modules."),r.module?.endsWith(`.${e}`)&&Q(t,`The 'module' field should not use a '.${e}' extension for ES modules.`),r.module&&r.main&&r.module===r.main&&Q(t,`Conflict detected: The 'module' and 'main' fields both point to '${r.module}'. Please ensure they refer to different module types.`)),n.packageJson?.exports!==!1&&r.exports===void 0&&Q(t,"The 'exports' field is missing in your package.json. This field is required for defining explicit exports.")},"validateEsmCjsEmitFields"),p7=Je(e=>{const{context:t,pkg:r,validation:n}=e;r.exports===void 0&&!t.options.emitCJS?n.packageJson?.exports!==!1&&Q(t,"The 'exports' field is missing in your package.json. Define module exports explicitly."):t.options.emitCJS&&c7(e)},"validateEsmModuleFields"),u7=Je(({cjsJSExtension:e,context:t,esmJSExtension:r,pkg:n,validation:i},o)=>{if(i.packageJson?.bin===!1)return;const s=o?r:e;if(e===r)return;const a=o?"CommonJS":"ES modules";if(typeof n.bin=="string"&&n.bin.endsWith(`.${s}`))Q(t,`The 'bin' field in your package.json should not use a .${s} extension for ${a} binaries.`);else if(typeof n.bin=="object")for(const[l,c]of Object.entries(n.bin))c?.endsWith(`.${s}`)&&Q(t,`The 'bin.${l}' field in your package.json should not use a .${s} extension for ${a} binaries.`)},"validateBinExtensionFields"),d7=Je(({cjsJSExtension:e,context:t,pkg:r,validation:n})=>{if(!t.options.declaration)return;let i=!0;r.type==="module"&&(i=!!r.main?.endsWith(`.${e}`));const o=r.types!==void 0||r.typings!==void 0;!o&&i&&n.packageJson?.types!==!1&&Q(t,"The 'types' field is missing in your package.json. This field should point to your type definitions file.");const s=r.type==="module"&&r.main!==void 0&&o;(t.options.declaration===!0||t.options.declaration==="compatible")&&i&&!s&&n.packageJson?.typesVersions!==!1&&(()=>{const a=r.typesVersions;return a===void 0||Object.keys(a).length===0})()&&Q(t,"No 'typesVersions' field found in your package.json. Consider adding this field, or change the declaration option to 'node16' or 'false'.")},"validateDeclarationFields"),f7=Je(e=>{const t=e.options.validation,{pkg:r}=e,n=Ye(e,"cjs"),i=Ye(e,"esm"),o={cjsJSExtension:n,context:e,esmJSExtension:i,pkg:r,validation:t};a7(o);const s=r.type==="commonjs"||r.type===void 0,a=r.type==="module";s?l7(o):a&&p7(o),r.exports!==void 0&&s7(e,r.exports),u7(o,s),d7(o),t.packageJson?.sideEffects!==!1&&r.sideEffects===void 0&&Q(e,"The 'sideEffects' field is missing in your package.json. Consider adding this field to your package.json.")},"validatePackageFields");var m7=Object.defineProperty,h7=g((e,t)=>m7(e,"name",{value:t,configurable:!0}),"o");const g7=h7(e=>{const{packageJson:t}=ns(e.options.rootDir);e.pkg=t,UC(e),KC(e),f7(e),i7(e)},"validator");var v7=Object.defineProperty,Og=g((e,t)=>v7(e,"name",{value:t,configurable:!0}),"n$3");const b7=/^[^a-z_@#~]|[^\w/@#~-]|@\/|#\/|~\//i,y7=new Set(["abstract","await","boolean","break","byte","case","catch","char","class","const","continue","debugger","default","delete","do","double","else","enum","export","extends","false","final","finally","float","for","function","goto","if","implements","import","in","instanceof","int","interface","let","long","native","new","null","package","private","protected","public","return","short","static","super","switch","synchronized","this","throw","throws","transient","true","try","typeof","undefined","var","void","volatile","while","with","yield"]),$7=Og((e,t)=>{if(e.trim()==="")throw new Error(`Alias name "${e}" is invalid. Alias names should be non-empty strings.`);if(b7.test(e))throw new Error(`Alias name "${e}" is invalid. Alias names should start with a letter or underscore and only contain letters, numbers, underscores, and dashes.`);if(y7.has(e))throw new Error(`Alias name "${e}" is a reserved keyword and cannot be used.`);const r=re(t);if(!jt(r))throw new Error(`Target path "${r}" for alias "${e}" does not exist.`)},"validateAliasEntry"),_u=Og(e=>{if(Array.isArray(e))return;const t=e;for(const[r,n]of Object.entries(t))$7(r,n)},"validateAliasEntries");var ma={},ha,Mu;function as(){if(Mu)return ha;Mu=1;const e="[^\\\\/]",t="(?=.)",r="[^/]",n="(?:\\/|$)",i="(?:^|\\/)",o=`\\.{1,2}${n}`,s="(?!\\.)",a=`(?!${i}${o})`,l=`(?!\\.{0,1}${n})`,c=`(?!${o})`,p="[^.\\/]",u=`${r}*?`,d="/",f={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:t,QMARK:r,END_ANCHOR:n,DOTS_SLASH:o,NO_DOT:s,NO_DOTS:a,NO_DOT_SLASH:l,NO_DOTS_SLASH:c,QMARK_NO_DOT:p,STAR:u,START_ANCHOR:i,SEP:d},m={...f,SLASH_LITERAL:"[\\\\/]",QMARK:e,STAR:`${e}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},h={__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 ha={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:h,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(v){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${v.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(v){return v===!0?m:f}},ha}g(as,"requireConstants");var Iu;function ls(){return Iu||(Iu=1,(function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:r,REGEX_SPECIAL_CHARS:n,REGEX_SPECIAL_CHARS_GLOBAL:i}=as();e.isObject=o=>o!==null&&typeof o=="object"&&!Array.isArray(o),e.hasRegexChars=o=>n.test(o),e.isRegexChar=o=>o.length===1&&e.hasRegexChars(o),e.escapeRegex=o=>o.replace(i,"\\$1"),e.toPosixSlashes=o=>o.replace(t,"/"),e.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){const o=navigator.platform.toLowerCase();return o==="win32"||o==="windows"}return process.platform?process.platform==="win32":!1},e.removeBackslashes=o=>o.replace(r,s=>s==="\\"?"":s),e.escapeLast=(o,s,a)=>{const l=o.lastIndexOf(s,a);return l===-1?o:o[l-1]==="\\"?e.escapeLast(o,s,l-1):`${o.slice(0,l)}\\${o.slice(l)}`},e.removePrefix=(o,s={})=>{let a=o;return a.startsWith("./")&&(a=a.slice(2),s.prefix="./"),a},e.wrapOutput=(o,s={},a={})=>{const l=a.contains?"":"^",c=a.contains?"":"$";let p=`${l}(?:${o})${c}`;return s.negated===!0&&(p=`(?:^(?!${p}).*$)`),p},e.basename=(o,{windows:s}={})=>{const a=o.split(s?/[\\/]/:"/"),l=a[a.length-1];return l===""?a[a.length-2]:l}})(ma)),ma}g(ls,"requireUtils");var ga,Wu;function w7(){if(Wu)return ga;Wu=1;var e=Object.defineProperty,t=g((x,$)=>e(x,"name",{value:$,configurable:!0}),"k");const r=ls(),{CHAR_ASTERISK:n,CHAR_AT:i,CHAR_BACKWARD_SLASH:o,CHAR_COMMA:s,CHAR_DOT:a,CHAR_EXCLAMATION_MARK:l,CHAR_FORWARD_SLASH:c,CHAR_LEFT_CURLY_BRACE:p,CHAR_LEFT_PARENTHESES:u,CHAR_LEFT_SQUARE_BRACKET:d,CHAR_PLUS:f,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:v,CHAR_RIGHT_SQUARE_BRACKET:b}=as(),w=t(x=>x===c||x===o,"isPathSeparator"),k=t(x=>{x.isPrefix!==!0&&(x.depth=x.isGlobstar?1/0:1)},"depth");return ga=t((x,$)=>{const E=$||{},O=x.length-1,S=E.parts===!0||E.scanToEnd===!0,j=[],A=[],N=[];let q=x,J=-1,U=0,ee=0,X=!1,W=!1,R=!1,B=!1,I=!1,_=!1,M=!1,H=!1,z=!1,F=!1,Y=0,Z,V,P={value:"",depth:0,isGlob:!1};const Oe=t(()=>J>=O,"eos"),ut=t(()=>q.charCodeAt(J+1),"peek"),Ce=t(()=>(Z=V,q.charCodeAt(++J)),"advance");for(;J<O;){V=Ce();let we;if(V===o){M=P.backslashes=!0,V=Ce(),V===p&&(_=!0);continue}if(_===!0||V===p){for(Y++;Oe()!==!0&&(V=Ce());){if(V===o){M=P.backslashes=!0,Ce();continue}if(V===p){Y++;continue}if(_!==!0&&V===a&&(V=Ce())===a){if(X=P.isBrace=!0,R=P.isGlob=!0,F=!0,S===!0)continue;break}if(_!==!0&&V===s){if(X=P.isBrace=!0,R=P.isGlob=!0,F=!0,S===!0)continue;break}if(V===h&&(Y--,Y===0)){_=!1,X=P.isBrace=!0,F=!0;break}}if(S===!0)continue;break}if(V===c){if(j.push(J),A.push(P),P={value:"",depth:0,isGlob:!1},F===!0)continue;if(Z===a&&J===U+1){U+=2;continue}ee=J+1;continue}if(E.noext!==!0&&(V===f||V===i||V===n||V===m||V===l)&&ut()===u){if(R=P.isGlob=!0,B=P.isExtglob=!0,F=!0,V===l&&J===U&&(z=!0),S===!0){for(;Oe()!==!0&&(V=Ce());){if(V===o){M=P.backslashes=!0,V=Ce();continue}if(V===v){R=P.isGlob=!0,F=!0;break}}continue}break}if(V===n){if(Z===n&&(I=P.isGlobstar=!0),R=P.isGlob=!0,F=!0,S===!0)continue;break}if(V===m){if(R=P.isGlob=!0,F=!0,S===!0)continue;break}if(V===d){for(;Oe()!==!0&&(we=Ce());){if(we===o){M=P.backslashes=!0,Ce();continue}if(we===b){W=P.isBracket=!0,R=P.isGlob=!0,F=!0;break}}if(S===!0)continue;break}if(E.nonegate!==!0&&V===l&&J===U){H=P.negated=!0,U++;continue}if(E.noparen!==!0&&V===u){if(R=P.isGlob=!0,S===!0){for(;Oe()!==!0&&(V=Ce());){if(V===u){M=P.backslashes=!0,V=Ce();continue}if(V===v){F=!0;break}}continue}break}if(R===!0){if(F=!0,S===!0)continue;break}}E.noext===!0&&(B=!1,R=!1);let C=q,T="",Qe="";U>0&&(T=q.slice(0,U),q=q.slice(U),ee-=U),C&&R===!0&&ee>0?(C=q.slice(0,ee),Qe=q.slice(ee)):R===!0?(C="",Qe=q):C=q,C&&C!==""&&C!=="/"&&C!==q&&w(C.charCodeAt(C.length-1))&&(C=C.slice(0,-1)),E.unescape===!0&&(Qe&&(Qe=r.removeBackslashes(Qe)),C&&M===!0&&(C=r.removeBackslashes(C)));const fe={prefix:T,input:x,start:U,base:C,glob:Qe,isBrace:X,isBracket:W,isGlob:R,isExtglob:B,isGlobstar:I,negated:H,negatedExtglob:z};if(E.tokens===!0&&(fe.maxDepth=0,w(V)||A.push(P),fe.tokens=A),E.parts===!0||E.tokens===!0){let we;for(let ye=0;ye<j.length;ye++){const et=we?we+1:U,Jt=j[ye],on=x.slice(et,Jt);E.tokens&&(ye===0&&U!==0?(A[ye].isPrefix=!0,A[ye].value=T):A[ye].value=on,k(A[ye]),fe.maxDepth+=A[ye].depth),(ye!==0||on!=="")&&N.push(on),we=Jt}if(we&&we+1<x.length){const ye=x.slice(we+1);N.push(ye),E.tokens&&(A[A.length-1].value=ye,k(A[A.length-1]),fe.maxDepth+=A[A.length-1].depth)}fe.slashes=j,fe.parts=N}return fe},"scan"),ga}g(w7,"requireScan");var va,Bu;function x7(){if(Bu)return va;Bu=1;var e=Object.defineProperty,t=g((y,x)=>e(y,"name",{value:x,configurable:!0}),"y");const r=as(),n=ls(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:o,REGEX_NON_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_BACKREF:a,REPLACEMENTS:l}=r,c=t((y,x)=>typeof x.expandRange=="function"?x.expandRange(...y,x):(y.sort(),`[${y.join("-")}]`),"expandRange"),p=t((y,x)=>`Missing ${y}: "${x}" - use "\\\\${x}" to match literal characters`,"syntaxError"),u=t(y=>{const x=[];let $=0,E=0,O=0,S="",j=!1;for(const A of y){if(j===!0){S+=A,j=!1;continue}if(A==="\\"){S+=A,j=!0;continue}if(A==='"'){O=O===1?0:1,S+=A;continue}if(O===0){if(A==="[")$++;else if(A==="]"&&$>0)$--;else if($===0){if(A==="(")E++;else if(A===")"&&E>0)E--;else if(A==="|"&&E===0){x.push(S),S="";continue}}}S+=A}return x.push(S),x},"splitTopLevel"),d=t(y=>{let x=!1;for(const $ of y){if(x===!0){x=!1;continue}if($==="\\"){x=!0;continue}if(/[?*+@!()[\]{}]/.test($))return!1}return!0},"isPlainBranch"),f=t(y=>{let x=y.trim(),$=!0;for(;$===!0;)$=!1,/^@\([^\\()[\]{}|]+\)$/.test(x)&&(x=x.slice(2,-1),$=!0);if(d(x))return x.replace(/\\(.)/g,"$1")},"normalizeSimpleBranch"),m=t(y=>{const x=y.map(f).filter(Boolean);for(let $=0;$<x.length;$++)for(let E=$+1;E<x.length;E++){const O=x[$],S=x[E],j=O[0];if(!(!j||O!==j.repeat(O.length)||S!==j.repeat(S.length))&&(O===S||O.startsWith(S)||S.startsWith(O)))return!0}return!1},"hasRepeatedCharPrefixOverlap"),h=t((y,x=!0)=>{if(y[0]!=="+"&&y[0]!=="*"||y[1]!=="(")return;let $=0,E=0,O=0,S=!1;for(let j=1;j<y.length;j++){const A=y[j];if(S===!0){S=!1;continue}if(A==="\\"){S=!0;continue}if(A==='"'){O=O===1?0:1;continue}if(O!==1){if(A==="["){$++;continue}if(A==="]"&&$>0){$--;continue}if(!($>0)){if(A==="("){E++;continue}if(A===")"&&(E--,E===0))return x===!0&&j!==y.length-1?void 0:{type:y[0],body:y.slice(2,j),end:j}}}}},"parseRepeatedExtglob"),v=t(y=>{let x=0;const $=[];for(;x<y.length;){const E=h(y.slice(x),!1);if(!E||E.type!=="*")return;const O=u(E.body).map(j=>j.trim());if(O.length!==1)return;const S=f(O[0]);if(!S||S.length!==1)return;$.push(S),x+=E.end+1}return $.length<1?void 0:`${$.length===1?n.escapeRegex($[0]):`[${$.map(E=>n.escapeRegex(E)).join("")}]`}*`},"getStarExtglobSequenceOutput"),b=t(y=>{let x=0,$=y.trim(),E=h($);for(;E;)x++,$=E.body.trim(),E=h($);return x},"repeatedExtglobRecursion"),w=t((y,x)=>{if(x.maxExtglobRecursion===!1)return{risky:!1};const $=typeof x.maxExtglobRecursion=="number"?x.maxExtglobRecursion:r.DEFAULT_MAX_EXTGLOB_RECURSION,E=u(y).map(O=>O.trim());if(E.length>1&&(E.some(O=>O==="")||E.some(O=>/^[*?]+$/.test(O))||m(E)))return{risky:!0};for(const O of E){const S=v(O);if(S)return{risky:!0,safeOutput:S};if(b(O)>$)return{risky:!0}}return{risky:!1}},"analyzeRepeatedExtglob"),k=t((y,x)=>{if(typeof y!="string")throw new TypeError("Expected a string");y=l[y]||y;const $={...x},E=typeof $.maxLength=="number"?Math.min(i,$.maxLength):i;let O=y.length;if(O>E)throw new SyntaxError(`Input length: ${O}, exceeds maximum allowed length: ${E}`);const S={type:"bos",value:"",output:$.prepend||""},j=[S],A=$.capture?"":"?:",N=r.globChars($.windows),q=r.extglobChars(N),{DOT_LITERAL:J,PLUS_LITERAL:U,SLASH_LITERAL:ee,ONE_CHAR:X,DOTS_SLASH:W,NO_DOT:R,NO_DOT_SLASH:B,NO_DOTS_SLASH:I,QMARK:_,QMARK_NO_DOT:M,STAR:H,START_ANCHOR:z}=N,F=t(L=>`(${A}(?:(?!${z}${L.dot?W:J}).)*?)`,"globstar"),Y=$.dot?"":R,Z=$.dot?_:M;let V=$.bash===!0?F($):H;$.capture&&(V=`(${V})`),typeof $.noext=="boolean"&&($.noextglob=$.noext);const P={input:y,index:-1,start:0,dot:$.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:j};y=n.removePrefix(y,P),O=y.length;const Oe=[],ut=[],Ce=[];let C=S,T;const Qe=t(()=>P.index===O-1,"eos"),fe=P.peek=(L=1)=>y[P.index+L],we=P.advance=()=>y[++P.index]||"",ye=t(()=>y.slice(P.index+1),"remaining"),et=t((L="",he=0)=>{P.consumed+=L,P.index+=he},"consume"),Jt=t(L=>{P.output+=L.output!=null?L.output:L.value,et(L.value)},"append"),on=t(()=>{let L=1;for(;fe()==="!"&&(fe(2)!=="("||fe(3)==="?");)we(),P.start++,L++;return L%2===0?!1:(P.negated=!0,P.start++,!0)},"negate"),fi=t(L=>{P[L]++,Ce.push(L)},"increment"),At=t(L=>{P[L]--,Ce.pop()},"decrement"),ie=t(L=>{if(C.type==="globstar"){const he=P.braces>0&&(L.type==="comma"||L.type==="brace"),D=L.extglob===!0||Oe.length&&(L.type==="pipe"||L.type==="paren");L.type!=="slash"&&L.type!=="paren"&&!he&&!D&&(P.output=P.output.slice(0,-C.output.length),C.type="star",C.value="*",C.output=V,P.output+=C.output)}if(Oe.length&&L.type!=="paren"&&(Oe[Oe.length-1].inner+=L.value),(L.value||L.output)&&Jt(L),C&&C.type==="text"&&L.type==="text"){C.output=(C.output||C.value)+L.value,C.value+=L.value;return}L.prev=C,j.push(L),C=L},"push"),mi=t((L,he)=>{const D={...q[he],conditions:1,inner:""};D.prev=C,D.parens=P.parens,D.output=P.output,D.startIndex=P.index,D.tokensIndex=j.length;const oe=($.capture?"(":"")+D.open;fi("parens"),ie({type:L,value:he,output:P.output?"":X}),ie({type:"paren",extglob:!0,value:we(),output:oe}),Oe.push(D)},"extglobOpen"),Ig=t(L=>{const he=y.slice(L.startIndex,P.index+1),D=y.slice(L.startIndex+2,P.index),oe=w(D,$);if((L.type==="plus"||L.type==="star")&&oe.risky){const de=oe.safeOutput?(L.output?"":X)+($.capture?`(${oe.safeOutput})`:oe.safeOutput):void 0,dt=j[L.tokensIndex];dt.type="text",dt.value=he,dt.output=de||n.escapeRegex(he);for(let ft=L.tokensIndex+1;ft<j.length;ft++)j[ft].value="",j[ft].output="",delete j[ft].suffix;P.output=L.output+dt.output,P.backtrack=!0,ie({type:"paren",extglob:!0,value:T,output:""}),At("parens");return}let be=L.close+($.capture?")":""),xe;if(L.type==="negate"){let de=V;if(L.inner&&L.inner.length>1&&L.inner.includes("/")&&(de=F($)),(de!==V||Qe()||/^\)+$/.test(ye()))&&(be=L.close=`)$))${de}`),L.inner.includes("*")&&(xe=ye())&&/^\.[^\\/.]+$/.test(xe)){const dt=k(xe,{...x,fastpaths:!1}).output;be=L.close=`)${dt})${de})`}L.prev.type==="bos"&&(P.negatedExtglob=!0)}ie({type:"paren",extglob:!0,value:T,output:be}),At("parens")},"extglobClose");if($.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(y)){let L=!1,he=y.replace(a,(D,oe,be,xe,de,dt)=>xe==="\\"?(L=!0,D):xe==="?"?oe?oe+xe+(de?_.repeat(de.length):""):dt===0?Z+(de?_.repeat(de.length):""):_.repeat(be.length):xe==="."?J.repeat(be.length):xe==="*"?oe?oe+xe+(de?V:""):V:oe?D:`\\${D}`);return L===!0&&($.unescape===!0?he=he.replace(/\\/g,""):he=he.replace(/\\+/g,D=>D.length%2===0?"\\\\":D?"\\":"")),he===y&&$.contains===!0?(P.output=y,P):(P.output=n.wrapOutput(he,P,x),P)}for(;!Qe();){if(T=we(),T==="\0")continue;if(T==="\\"){const D=fe();if(D==="/"&&$.bash!==!0||D==="."||D===";")continue;if(!D){T+="\\",ie({type:"text",value:T});continue}const oe=/^\\+/.exec(ye());let be=0;if(oe&&oe[0].length>2&&(be=oe[0].length,P.index+=be,be%2!==0&&(T+="\\")),$.unescape===!0?T=we():T+=we(),P.brackets===0){ie({type:"text",value:T});continue}}if(P.brackets>0&&(T!=="]"||C.value==="["||C.value==="[^")){if($.posix!==!1&&T===":"){const D=C.value.slice(1);if(D.includes("[")&&(C.posix=!0,D.includes(":"))){const oe=C.value.lastIndexOf("["),be=C.value.slice(0,oe),xe=C.value.slice(oe+2),de=o[xe];if(de){C.value=be+de,P.backtrack=!0,we(),!S.output&&j.indexOf(C)===1&&(S.output=X);continue}}}(T==="["&&fe()!==":"||T==="-"&&fe()==="]")&&(T=`\\${T}`),T==="]"&&(C.value==="["||C.value==="[^")&&(T=`\\${T}`),$.posix===!0&&T==="!"&&C.value==="["&&(T="^"),C.value+=T,Jt({value:T});continue}if(P.quotes===1&&T!=='"'){T=n.escapeRegex(T),C.value+=T,Jt({value:T});continue}if(T==='"'){P.quotes=P.quotes===1?0:1,$.keepQuotes===!0&&ie({type:"text",value:T});continue}if(T==="("){fi("parens"),ie({type:"paren",value:T});continue}if(T===")"){if(P.parens===0&&$.strictBrackets===!0)throw new SyntaxError(p("opening","("));const D=Oe[Oe.length-1];if(D&&P.parens===D.parens+1){Ig(Oe.pop());continue}ie({type:"paren",value:T,output:P.parens?")":"\\)"}),At("parens");continue}if(T==="["){if($.nobracket===!0||!ye().includes("]")){if($.nobracket!==!0&&$.strictBrackets===!0)throw new SyntaxError(p("closing","]"));T=`\\${T}`}else fi("brackets");ie({type:"bracket",value:T});continue}if(T==="]"){if($.nobracket===!0||C&&C.type==="bracket"&&C.value.length===1){ie({type:"text",value:T,output:`\\${T}`});continue}if(P.brackets===0){if($.strictBrackets===!0)throw new SyntaxError(p("opening","["));ie({type:"text",value:T,output:`\\${T}`});continue}At("brackets");const D=C.value.slice(1);if(C.posix!==!0&&D[0]==="^"&&!D.includes("/")&&(T=`/${T}`),C.value+=T,Jt({value:T}),$.literalBrackets===!1||n.hasRegexChars(D))continue;const oe=n.escapeRegex(C.value);if(P.output=P.output.slice(0,-C.value.length),$.literalBrackets===!0){P.output+=oe,C.value=oe;continue}C.value=`(${A}${oe}|${C.value})`,P.output+=C.value;continue}if(T==="{"&&$.nobrace!==!0){fi("braces");const D={type:"brace",value:T,output:"(",outputIndex:P.output.length,tokensIndex:P.tokens.length};ut.push(D),ie(D);continue}if(T==="}"){const D=ut[ut.length-1];if($.nobrace===!0||!D){ie({type:"text",value:T,output:T});continue}let oe=")";if(D.dots===!0){const be=j.slice(),xe=[];for(let de=be.length-1;de>=0&&(j.pop(),be[de].type!=="brace");de--)be[de].type!=="dots"&&xe.unshift(be[de].value);oe=c(xe,$),P.backtrack=!0}if(D.comma!==!0&&D.dots!==!0){const be=P.output.slice(0,D.outputIndex),xe=P.tokens.slice(D.tokensIndex);D.value=D.output="\\{",T=oe="\\}",P.output=be;for(const de of xe)P.output+=de.output||de.value}ie({type:"brace",value:T,output:oe}),At("braces"),ut.pop();continue}if(T==="|"){Oe.length>0&&Oe[Oe.length-1].conditions++,ie({type:"text",value:T});continue}if(T===","){let D=T;const oe=ut[ut.length-1];oe&&Ce[Ce.length-1]==="braces"&&(oe.comma=!0,D="|"),ie({type:"comma",value:T,output:D});continue}if(T==="/"){if(C.type==="dot"&&P.index===P.start+1){P.start=P.index+1,P.consumed="",P.output="",j.pop(),C=S;continue}ie({type:"slash",value:T,output:ee});continue}if(T==="."){if(P.braces>0&&C.type==="dot"){C.value==="."&&(C.output=J);const D=ut[ut.length-1];C.type="dots",C.output+=T,C.value+=T,D.dots=!0;continue}if(P.braces+P.parens===0&&C.type!=="bos"&&C.type!=="slash"){ie({type:"text",value:T,output:J});continue}ie({type:"dot",value:T,output:J});continue}if(T==="?"){if(!(C&&C.value==="(")&&$.noextglob!==!0&&fe()==="("&&fe(2)!=="?"){mi("qmark",T);continue}if(C&&C.type==="paren"){const D=fe();let oe=T;(C.value==="("&&!/[!=<:]/.test(D)||D==="<"&&!/<([!=]|\w+>)/.test(ye()))&&(oe=`\\${T}`),ie({type:"text",value:T,output:oe});continue}if($.dot!==!0&&(C.type==="slash"||C.type==="bos")){ie({type:"qmark",value:T,output:M});continue}ie({type:"qmark",value:T,output:_});continue}if(T==="!"){if($.noextglob!==!0&&fe()==="("&&(fe(2)!=="?"||!/[!=<:]/.test(fe(3)))){mi("negate",T);continue}if($.nonegate!==!0&&P.index===0){on();continue}}if(T==="+"){if($.noextglob!==!0&&fe()==="("&&fe(2)!=="?"){mi("plus",T);continue}if(C&&C.value==="("||$.regex===!1){ie({type:"plus",value:T,output:U});continue}if(C&&(C.type==="bracket"||C.type==="paren"||C.type==="brace")||P.parens>0){ie({type:"plus",value:T});continue}ie({type:"plus",value:U});continue}if(T==="@"){if($.noextglob!==!0&&fe()==="("&&fe(2)!=="?"){ie({type:"at",extglob:!0,value:T,output:""});continue}ie({type:"text",value:T});continue}if(T!=="*"){(T==="$"||T==="^")&&(T=`\\${T}`);const D=s.exec(ye());D&&(T+=D[0],P.index+=D[0].length),ie({type:"text",value:T});continue}if(C&&(C.type==="globstar"||C.star===!0)){C.type="star",C.star=!0,C.value+=T,C.output=V,P.backtrack=!0,P.globstar=!0,et(T);continue}let L=ye();if($.noextglob!==!0&&/^\([^?]/.test(L)){mi("star",T);continue}if(C.type==="star"){if($.noglobstar===!0){et(T);continue}const D=C.prev,oe=D.prev,be=D.type==="slash"||D.type==="bos",xe=oe&&(oe.type==="star"||oe.type==="globstar");if($.bash===!0&&(!be||L[0]&&L[0]!=="/")){ie({type:"star",value:T,output:""});continue}const de=P.braces>0&&(D.type==="comma"||D.type==="brace"),dt=Oe.length&&(D.type==="pipe"||D.type==="paren");if(!be&&D.type!=="paren"&&!de&&!dt){ie({type:"star",value:T,output:""});continue}for(;L.slice(0,3)==="/**";){const ft=y[P.index+4];if(ft&&ft!=="/")break;L=L.slice(3),et("/**",3)}if(D.type==="bos"&&Qe()){C.type="globstar",C.value+=T,C.output=F($),P.output=C.output,P.globstar=!0,et(T);continue}if(D.type==="slash"&&D.prev.type!=="bos"&&!xe&&Qe()){P.output=P.output.slice(0,-(D.output+C.output).length),D.output=`(?:${D.output}`,C.type="globstar",C.output=F($)+($.strictSlashes?")":"|$)"),C.value+=T,P.globstar=!0,P.output+=D.output+C.output,et(T);continue}if(D.type==="slash"&&D.prev.type!=="bos"&&L[0]==="/"){const ft=L[1]!==void 0?"|$":"";P.output=P.output.slice(0,-(D.output+C.output).length),D.output=`(?:${D.output}`,C.type="globstar",C.output=`${F($)}${ee}|${ee}${ft})`,C.value+=T,P.output+=D.output+C.output,P.globstar=!0,et(T+we()),ie({type:"slash",value:"/",output:""});continue}if(D.type==="bos"&&L[0]==="/"){C.type="globstar",C.value+=T,C.output=`(?:^|${ee}|${F($)}${ee})`,P.output=C.output,P.globstar=!0,et(T+we()),ie({type:"slash",value:"/",output:""});continue}P.output=P.output.slice(0,-C.output.length),C.type="globstar",C.output=F($),C.value+=T,P.output+=C.output,P.globstar=!0,et(T);continue}const he={type:"star",value:T,output:V};if($.bash===!0){he.output=".*?",(C.type==="bos"||C.type==="slash")&&(he.output=Y+he.output),ie(he);continue}if(C&&(C.type==="bracket"||C.type==="paren")&&$.regex===!0){he.output=T,ie(he);continue}(P.index===P.start||C.type==="slash"||C.type==="dot")&&(C.type==="dot"?(P.output+=B,C.output+=B):$.dot===!0?(P.output+=I,C.output+=I):(P.output+=Y,C.output+=Y),fe()!=="*"&&(P.output+=X,C.output+=X)),ie(he)}for(;P.brackets>0;){if($.strictBrackets===!0)throw new SyntaxError(p("closing","]"));P.output=n.escapeLast(P.output,"["),At("brackets")}for(;P.parens>0;){if($.strictBrackets===!0)throw new SyntaxError(p("closing",")"));P.output=n.escapeLast(P.output,"("),At("parens")}for(;P.braces>0;){if($.strictBrackets===!0)throw new SyntaxError(p("closing","}"));P.output=n.escapeLast(P.output,"{"),At("braces")}if($.strictSlashes!==!0&&(C.type==="star"||C.type==="bracket")&&ie({type:"maybe_slash",value:"",output:`${ee}?`}),P.backtrack===!0){P.output="";for(const L of P.tokens)P.output+=L.output!=null?L.output:L.value,L.suffix&&(P.output+=L.suffix)}return P},"parse");return k.fastpaths=(y,x)=>{const $={...x},E=typeof $.maxLength=="number"?Math.min(i,$.maxLength):i,O=y.length;if(O>E)throw new SyntaxError(`Input length: ${O}, exceeds maximum allowed length: ${E}`);y=l[y]||y;const{DOT_LITERAL:S,SLASH_LITERAL:j,ONE_CHAR:A,DOTS_SLASH:N,NO_DOT:q,NO_DOTS:J,NO_DOTS_SLASH:U,STAR:ee,START_ANCHOR:X}=r.globChars($.windows),W=$.dot?J:q,R=$.dot?U:q,B=$.capture?"":"?:",I={negated:!1,prefix:""};let _=$.bash===!0?".*?":ee;$.capture&&(_=`(${_})`);const M=t(Y=>Y.noglobstar===!0?_:`(${B}(?:(?!${X}${Y.dot?N:S}).)*?)`,"globstar"),H=t(Y=>{switch(Y){case"*":return`${W}${A}${_}`;case".*":return`${S}${A}${_}`;case"*.*":return`${W}${_}${S}${A}${_}`;case"*/*":return`${W}${_}${j}${A}${R}${_}`;case"**":return W+M($);case"**/*":return`(?:${W}${M($)}${j})?${R}${A}${_}`;case"**/*.*":return`(?:${W}${M($)}${j})?${R}${_}${S}${A}${_}`;case"**/.*":return`(?:${W}${M($)}${j})?${S}${A}${_}`;default:{const Z=/^(.*?)\.(\w+)$/.exec(Y);if(!Z)return;const V=H(Z[1]);return V?V+S+Z[2]:void 0}}},"create"),z=n.removePrefix(y,I);let F=H(z);return F&&$.strictSlashes!==!0&&(F+=`${j}?`),F},va=k,va}g(x7,"requireParse");var ba,Du;function j7(){if(Du)return ba;Du=1;var e=Object.defineProperty,t=g((l,c)=>e(l,"name",{value:c,configurable:!0}),"h");const r=w7(),n=x7(),i=ls(),o=as(),s=t(l=>l&&typeof l=="object"&&!Array.isArray(l),"isObject"),a=t((l,c,p=!1)=>{if(Array.isArray(l)){const w=l.map(k=>a(k,c,p));return t(k=>{for(const y of w){const x=y(k);if(x)return x}return!1},"arrayMatcher")}const u=s(l)&&l.tokens&&l.input;if(l===""||typeof l!="string"&&!u)throw new TypeError("Expected pattern to be a non-empty string");const d=c||{},f=d.windows,m=u?a.compileRe(l,c):a.makeRe(l,c,!1,!0),h=m.state;delete m.state;let v=t(()=>!1,"isIgnored");if(d.ignore){const w={...c,ignore:null,onMatch:null,onResult:null};v=a(d.ignore,w,p)}const b=t((w,k=!1)=>{const{isMatch:y,match:x,output:$}=a.test(w,m,c,{glob:l,posix:f}),E={glob:l,state:h,regex:m,posix:f,input:w,output:$,match:x,isMatch:y};return typeof d.onResult=="function"&&d.onResult(E),y===!1?(E.isMatch=!1,k?E:!1):v(w)?(typeof d.onIgnore=="function"&&d.onIgnore(E),E.isMatch=!1,k?E:!1):(typeof d.onMatch=="function"&&d.onMatch(E),k?E:!0)},"matcher");return p&&(b.state=h),b},"picomatch");return a.test=(l,c,p,{glob:u,posix:d}={})=>{if(typeof l!="string")throw new TypeError("Expected input to be a string");if(l==="")return{isMatch:!1,output:""};const f=p||{},m=f.format||(d?i.toPosixSlashes:null);let h=l===u,v=h&&m?m(l):l;return h===!1&&(v=m?m(l):l,h=v===u),(h===!1||f.capture===!0)&&(f.matchBase===!0||f.basename===!0?h=a.matchBase(l,c,p,d):h=c.exec(v)),{isMatch:!!h,match:h,output:v}},a.matchBase=(l,c,p)=>(c instanceof RegExp?c:a.makeRe(c,p)).test(i.basename(l)),a.isMatch=(l,c,p)=>a(c,p)(l),a.parse=(l,c)=>Array.isArray(l)?l.map(p=>a.parse(p,c)):n(l,{...c,fastpaths:!1}),a.scan=(l,c)=>r(l,c),a.compileRe=(l,c,p=!1,u=!1)=>{if(p===!0)return l.output;const d=c||{},f=d.contains?"":"^",m=d.contains?"":"$";let h=`${f}(?:${l.output})${m}`;l&&l.negated===!0&&(h=`^(?!${h}).*$`);const v=a.toRegex(h,c);return u===!0&&(v.state=l),v},a.makeRe=(l,c={},p=!1,u=!1)=>{if(!l||typeof l!="string")throw new TypeError("Expected a non-empty string");let d={negated:!1,fastpaths:!0};return c.fastpaths!==!1&&(l[0]==="."||l[0]==="*")&&(d.output=n.fastpaths(l,c)),d.output||(d=n(l,c)),a.compileRe(d,c,p,u)},a.toRegex=(l,c)=>{try{const p=c||{};return new RegExp(l,p.flags||(p.nocase?"i":""))}catch(p){if(c&&c.debug===!0)throw p;return/$^/}},a.constants=o,ba=a,ba}g(j7,"requirePicomatch$1");var ya,Fu;function k7(){if(Fu)return ya;Fu=1;var e=Object.defineProperty,t=g((o,s)=>e(o,"name",{value:s,configurable:!0}),"c");const r=j7(),n=ls();function i(o,s,a=!1){return s&&(s.windows===null||s.windows===void 0)&&(s={...s,windows:n.isWindows()}),r(o,s,a)}return g(i,"picomatch"),t(i,"picomatch"),Object.assign(i,r),ya=i,ya}g(k7,"requirePicomatch");var E7=k7();const S7=Yn(E7);var O7=Object.defineProperty,rn=g((e,t)=>O7(e,"name",{value:t,configurable:!0}),"m$2");const A7=rn(e=>e.logger,"getLogger"),Ja="Validation: File Size",Ag=rn(e=>typeof e=="string"?O2(e):e,"resolveLimit"),Pg=rn((e,t,r,n,i)=>{if(r){i&&e.raw(`
|
|
189
|
+
`),e.warn({message:t,prefix:"validation:file-size"});return}Q(n,t)},"emitMessage"),P7=rn((e,t,r,n,i)=>{for(const[o,s]of Object.entries(r)){const a=Ag(s);if(!Number.isFinite(a)||a<=0){t.debug({message:`Invalid limit for ${o}: ${String(s)}`,prefix:Ja});continue}const l=e.buildEntries.find(c=>{const p=o.replace(new RegExp(`^.?/?${e.options.outDir}/?`),"");return c.path.endsWith(p)||S7(o)(c.path)});if(!l?.size?.bytes){t.debug({message:l?`Entry file has no size information: ${o}.`:`Entry file not found: ${o}, please check your configuration.`,prefix:Ja});continue}if(l.size.bytes>a){const c=`File size exceeds the limit: ${G(e.options.outDir,l.path)} (${Ie(l.size.bytes)} / ${Ie(a,{decimals:2})})`;Pg(t,c,n,e,i)}}},"checkPerFileLimits"),C7=rn((e,t,r,n,i)=>{const o=e.buildEntries.reduce((a,l)=>{const c=l.size?.bytes;return a+(typeof c=="number"?c:0)},0),s=Ag(r);if(!Number.isFinite(s)||s<=0){t.debug({message:`Invalid total limit: ${String(r)}`,prefix:Ja});return}if(o>s){const a=`Total file size exceeds the limit: ${Ie(o)} / ${Ie(s,{decimals:2})}`;Pg(t,a,n,e,i)}},"checkTotalLimit"),R7=rn((e,t)=>{const r=e.options.validation,{allowFail:n=!1,limit:i,limits:o={}}=r.bundleLimit??{},s=A7(e);P7(e,s,o,n,t),i&&C7(e,s,i,n,t&&Object.keys(o).length===0)},"validateBundleSize");var T7=Object.defineProperty,_n=g((e,t)=>T7(e,"name",{value:t,configurable:!0}),"r$1");const Lu="rollup-dts.json",N7=_n(e=>e.logger,"getLogger"),zu="__packem_skip__/",qu=_n((e,t)=>{const r=new Set;if(t.options.emitCJS&&r.add(gt(t,"cjs")),t.options.emitESM&&r.add(gt(t,"esm")),(t.options.declaration===!0||t.options.declaration==="compatible")&&r.add("d.ts"),e.declarationExtensions)for(const n of e.declarationExtensions)r.add(n);return r},"resolveEntryExtensions"),_7=_n(async(e,t,r)=>{const n=await Kh(e,t);if(await e.hooks.callHook("rollup:dts:options",e,n),Object.keys(n.input??{}).length===0)return;const i=`${r}/${mt(e.options.entries.map(s=>s.name??"").filter(Boolean).toSorted((s,a)=>s.localeCompare(a)).join(","))}`;n.cache=t.get(Lu,i);const o=await(await ec())(n);try{t.set(Lu,o.cache,i),await e.hooks.callHook("rollup:dts:build",e,o),N7(e).info({message:"Building declaration files...",prefix:"dts"});const s=new Map;for(const p of e.options.entries)p.name&&s.set(p.name,p);const a=new Set;for(const p of e.options.entries)for(const u of qu(p,e))a.add(u);const l=re(e.options.rootDir,e.options.outDir),c={generateBundle(p,u){for(const d of Object.keys(u))d.startsWith(zu)&&delete u[d]},name:"packem:filter-skip-chunks"};for(const p of a)await o.write({chunkFileNames:_n(u=>Tn(u,p),"chunkFileNames"),dir:l,entryFileNames:_n(u=>{const d=u.name.endsWith(".d")?u.name.slice(0,-2):u.name,f=d?s.get(d):void 0;return f&&!qu(f,e).has(p)?`${zu}[name].${p}`:`[name].${p}`},"entryFileNames"),plugins:[c]});await e.hooks.callHook("rollup:dts:done",e)}finally{await o.close(),await t.flush()}},"buildTypes");var M7=si();const Cg=Yn(M7);var I7=Object.defineProperty,Ua=g((e,t)=>I7(e,"name",{value:t,configurable:!0}),"n$2");const W7=fb("packem:exe"),B7=/(?:^|,)packem:exe(?:,|$)/,D7=Ua(()=>{const e=process.env.NODE_DEBUG;return e?B7.test(e):!1},"isEnabled"),Rg=Ua(()=>{const e=Ua(((t,...r)=>{W7(t,...r)}),"debug");return Object.defineProperty(e,"enabled",{get:D7}),e},"createDebug");var F7=Object.defineProperty,Tg=g((e,t)=>F7(e,"name",{value:t,configurable:!0}),"c$5");const L7=Tg(()=>{const e=Bv();if(Dr==="darwin")return G(e,"Library/Caches/packem");if(Dr==="win32"){const r=process.env.LOCALAPPDATA;return r?G(r,"packem/Caches"):G(e,"AppData/Local/packem/Caches")}const t=process.env.XDG_CACHE_HOME;return t?G(t,"packem"):G(e,".cache/packem")},"getCacheDirectory"),z7=Tg(e=>{const t=L7(),r=e.platform==="win"?"node.exe":"node";return G(t,"node",`v${e.nodeVersion}`,`${e.platform}-${e.arch}`,r)},"getCachedBinaryPath");var q7=cd();const H7=Yn(q7);var J7=Object.defineProperty,di=g((e,t)=>J7(e,"name",{value:t,configurable:!0}),"s$1");const Ng=di(e=>e==="win"?"zip":e==="linux"?"tar.xz":"tar.gz","getArchiveExtension"),U7=di(e=>{const{arch:t,nodeVersion:r,platform:n}=e,i=Ng(n);return`https://nodejs.org/dist/v${r}/node-v${r}-${n}-${t}.${i}`},"getDownloadUrl"),G7=di(e=>{const{arch:t,nodeVersion:r,platform:n}=e,i=`node-v${r}-${n}-${t}`;return n==="win"?`${i}/node.exe`:`${i}/bin/node`},"getBinaryPathInArchive"),Hu="https://nodejs.org/dist/index.json",V7=/^v/,K7=di(async e=>{let t=e;if(t==="latest"||t==="latest-lts"){const n=await fetch(Hu);if(!n.ok)throw new Error(`Failed to fetch Node.js releases: HTTP ${String(n.status)} from ${Hu}`);const i=await n.json(),o=t==="latest";let s="";for(const a of i)if(o||a.lts!==!1){s=a.version;break}if(s==="")throw new Error(`No matching Node.js release found for "${t}".`);t=s.replace(V7,"")}const r=H7(t);if(!r)throw new Error(`Invalid Node.js version: ${t}. Please provide a valid version string (e.g., "25.7.0").`);if(!Cg(r,">=25.7.0"))throw new Error(`Node.js ${r} does not support SEA (Single Executable Applications). Required minimum version is 25.7.0. Please update the nodeVersion in your target configuration.`);return r},"resolveNodeVersion"),Y7=di(e=>`-${e.platform}-${e.arch}`,"getTargetSuffix");var X7=Object.defineProperty,_g=g((e,t)=>X7(e,"name",{value:t,configurable:!0}),"d$1");const Kt=Rg(),Z7=_g(async(e,t,r)=>{const n=G7(r),i=ne(t);if(Kt("Extracting %s from archive to %s",n,i),r.platform==="win")await Ki("tar",["-xf",e,"-C",i,"--strip-components=1",n],{nodeOptions:{stdio:"inherit"},throwOnError:!0});else{const a=e.endsWith(".tar.xz")?"J":"z";await Ki("tar",[`-x${a}f`,e,"-C",i,"--strip-components=2",n],{nodeOptions:{stdio:"inherit"},throwOnError:!0})}const o=r.platform==="win"?"node.exe":"node",s=G(i,o);s!==t&&await Jv(s,t)},"extractBinary"),Q7=_g(async(e,t)=>{Kt("Resolving Node.js binary for target: %O",e);const r={...e,nodeVersion:await K7(e.nodeVersion)},n=z7(r);if(Kt("Cache path: %s",n),await Gr(n))return Kt("Cache hit: %s",n),t.info(`Using cached Node.js ${r.nodeVersion} for ${r.platform}-${r.arch}`),n;const i=U7(r);Kt("Cache miss, downloading from: %s",i),t.info(`Downloading Node.js ${r.nodeVersion} for ${r.platform}-${r.arch}...`),t.info(` ${i}`),await jd(ne(n),{recursive:!0});const o=await fetch(i);if(!o.ok)throw new Error(`Failed to download Node.js binary: HTTP ${String(o.status)} from ${i}`);const s=Ng(r.platform),a=`${n}.download.${s}`,l=bb.from(await o.arrayBuffer());Kt("Downloaded %d bytes, writing to: %s",l.length,a),await kd(a,l);try{await Z7(a,n,r),r.platform!=="win"&&await wd(n,493),Kt("Binary cached at: %s",n),t.info(`Cached Node.js binary at: ${n}`)}finally{await vo(a,{force:!0})}return n},"resolveNodeBinary");var eR=Object.defineProperty,nn=g((e,t)=>eR(e,"name",{value:t,configurable:!0}),"l");const Or=Rg(),tR=/\.d\.[mc]?ts$/,rR=nn(e=>({buildEntries:e.buildEntries,logger:e.logger,options:e.options,packageType:e.pkg.type}),"toExeBuildInput"),nR=nn(e=>{const{logger:t,options:r}=e;if(Gi.bun||Gi.deno)throw new Error("The `exe` option is not supported in Bun and Deno environments.");if(!Cg(process.version,">=25.7.0"))throw new Error(`Node.js ${process.version} does not support \`exe\` option. Please upgrade to Node.js 25.7.0 or later.`);if(r.entries.length>1){const n=r.entries.map(i=>`- ${i.input}`).join(`
|
|
190
|
+
`);throw new Error(`The \`exe\` feature only supports a single entry point. Found ${String(r.entries.length)} entries:
|
|
191
|
+
${n}`)}r.declaration&&t.warn("Generating .d.ts files with the `exe` option is not recommended since they won't be included in the executable. Consider separating your library and executable targets if you need type declarations."),t.info("`exe` option is experimental and may change in future releases.")},"validateSea"),iR=nn((e,t)=>e.endsWith(".cjs")?"commonjs":e.endsWith(".mjs")||t==="module"?"module":"commonjs","pickMainFormat"),Ju=Dr==="win32"?"win":Dr,Uu=nn((e,t,r,n,i)=>{let o;return e.fileName?o=typeof e.fileName=="function"?e.fileName(t):e.fileName:o=Et(r,Fr(r)),i&&(o+=i),n==="win"&&(o+=".exe"),o},"resolveOutputFileName"),Gu=nn(async(e,t,r,n,i,o,s)=>{const{logger:a,options:l,packageType:c}=e,p=re(l.rootDir,t.outDir??"build");await jd(p,{recursive:!0});const u=G(p,i);Or("Building SEA executable: %s -> %s",n,u);const d=performance.now(),f=await xd(G(bd(),"packem-sea-"));try{const h={disableExperimentalSEAWarning:!0,...t.seaConfig,main:n,mainFormat:iR(r.path,c),output:u};s&&(h.executable=s);const v=G(f,"sea-config.json");await kd(v,JSON.stringify(h)),Or("Wrote sea-config.json: %O -> %s",h,v),Or("Running: %s --build-sea %s",process.execPath,v),await Ki(process.execPath,["--build-sea",v],{nodeOptions:{stdio:["ignore","ignore","inherit"]},throwOnError:!0})}finally{Or.enabled?Or("Preserving temp directory for debugging: %s",f):await vo(f,{force:!0,recursive:!0})}if(o==="darwin")try{await Ki("codesign",["--sign","-",u],{nodeOptions:{stdio:"inherit"},throwOnError:!0})}catch{const h=Dr==="darwin"?`You can sign it manually using:
|
|
192
|
+
codesign --sign - "${u}"`:`Automatic code signing is not supported on ${Dr}.`;a.warn(`Failed to code-sign the executable. ${h}`)}if(await Gr(u)){const h=await Xn(u),v=Ie(h.size,{decimals:2});a.info(`${We(Be(l.rootDir,u))} ${ed(v)}`)}const m=Math.round(performance.now()-d);a.success(`Built executable: ${$r(Be(l.rootDir,u))} ${rt(`(${String(m)}ms)`)}`)},"buildSingleExe"),oR=nn(async e=>{const t=rR(e),{buildEntries:r,logger:n,options:i}=t,o=i.exe;if(!o)return;const s=typeof o=="object"?o:{};nR(t);const a=r.filter(u=>u.type==="entry"&&!tR.test(u.path));if(a.length===0)throw new Error("The `exe` feature requires a built entry, but no entry chunks were found.");if(a.length>1){const u=a.map(d=>`- ${d.path}`).join(`
|
|
193
|
+
`);throw new Error(`The \`exe\` feature only supports single-chunk outputs. Found ${String(a.length)} chunks:
|
|
194
|
+
${u}`)}const l=a[0],c=G(i.rootDir,i.outDir,l.path);Or("Building executable with SEA for chunk: %s",l.path);const{targets:p}=s;if(p!==void 0&&p.length>0){s.seaConfig?.executable&&n.warn("`seaConfig.executable` is ignored when `targets` is specified.");for(const u of p){const d=await Q7(u,n),f=Y7(u),m=Uu(s,l,c,u.platform,f);await Gu(t,s,l,c,m,u.platform,d)}}else{const u=Uu(s,l,c,Ju);await Gu(t,s,l,c,u,Ju)}},"buildExe");var sR=Object.defineProperty,Vu=g((e,t)=>sR(e,"name",{value:t,configurable:!0}),"t");const aR=Vu(async(e,t)=>{if(e.length===0)return[];const r=t<=0||!Number.isFinite(t)?1/0:t,n=Array.from({length:e.length});let i=0;const o=Vu(async()=>{for(;i<e.length;){const a=i;i+=1;const l=e[a];l&&(n[a]=await l())}},"runNext"),s=Array.from({length:Math.min(r,e.length)},()=>o());return await Promise.all(s),n},"runWithConcurrency");var lR=Object.defineProperty,cR=g((e,t)=>lR(e,"name",{value:t,configurable:!0}),"a");const pR=cR(async e=>await new Promise((t,r)=>{let n=0;const i=tl(e).pipe(hb({params:{[gb.BROTLI_PARAM_QUALITY]:4}}));i.on("error",r),i.on("data",o=>{n+=o.length}),i.on("end",()=>{t(n)})}),"brotliSize");var uR=Object.defineProperty,pc=g((e,t)=>uR(e,"name",{value:t,configurable:!0}),"d");const $n=pc(e=>e==null?"undefined":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"||typeof e=="symbol"?e.toString():JSON.stringify(e),"toGroupKey"),wn=pc((e,t,r)=>{let n=e.get(t);return n===void 0&&(n=r(),e.set(t,n)),n},"getOrCreate"),dR=pc((e,t,r,n)=>{if(n!==void 0){const s=new Map;for(const l of e){const c=wn(s,$n(l[t]),()=>new Map),p=wn(c,$n(l[r]),()=>new Map);wn(p,$n(l[n]),()=>[]).push(l)}const a={};for(const[l,c]of s){const p={};for(const[u,d]of c)p[u]=Object.fromEntries(d);a[l]=p}return a}const i=new Map;for(const s of e){const a=wn(i,$n(s[t]),()=>new Map);wn(a,$n(s[r]),()=>[]).push(s)}const o={};for(const[s,a]of i)o[s]=Object.fromEntries(a);return o},"groupByKeys");var fR=Object.defineProperty,mR=g((e,t)=>fR(e,"name",{value:t,configurable:!0}),"i");const hR=mR(async e=>await new Promise((t,r)=>{let n=0;const i=tl(e).pipe(vb({level:9}));i.on("error",r),i.on("data",o=>{n+=o.length}),i.on("end",()=>{t(n)})}),"gzipSize");var gR=Object.defineProperty,Ue=g((e,t)=>gR(e,"name",{value:t,configurable:!0}),"c$1");const vR=2,bR=/\.js$/,yR=/\.d\.[m|c]ts$/,$R=Ue((e,t,r)=>[`total size: ${pe(Ie(t,{decimals:2}))}`,e.size?.brotli&&`brotli size: ${pe(Ie(e.size.brotli,{decimals:2}))}`,e.size?.gzip&&`gzip size: ${pe(Ie(e.size.gzip,{decimals:2}))}`,r!==0&&`chunk size: ${pe(Ie(r,{decimals:2}))}`].filter(Boolean).join(", "),"buildSizeSummary"),wR=Ue((e,t,r,n)=>{const i=Ye(t,"cjs"),o=Ye(t,"esm"),s=gt(t,"cjs"),a=gt(t,"esm");let l=e.path.replace(bR,".d.ts"),c="commonjs";e.path.endsWith(`.${i}`)?l=e.path.replace(new RegExp(String.raw`\.${i}$`),`.${s}`):e.path.endsWith(`.${o}`)&&(c="module",l=e.path.replace(new RegExp(String.raw`\.${o}$`),`.${a}`));const p=t.buildEntries.find(d=>d.path.endsWith(l));if(!p)return"";n.push(p.path);let u;return l.includes(".d.ts")||(l=l.replace(yR,".d.ts"),u=t.buildEntries.find(d=>d.path.endsWith(l))),u?(n.push(u.path),c==="commonjs"?`
|
|
195
|
+
types:
|
|
196
|
+
${[p,u].map(d=>`${rt(" └─ ")+We(r(d.path))} (total size: ${pe(Ie(d.size?.bytes??0,{decimals:2}))})`).join(`
|
|
197
|
+
`)}`:`
|
|
198
|
+
types: ${We(r(p.path))} (total size: ${pe(Ie(p.size?.bytes??0,{decimals:2}))})`):""},"buildDeclarationTypesLine"),xR=Ue((e,t,r,n)=>{let i=e.size?.bytes??0,o=0;for(const a of e.chunks??[]){const l=t.buildEntries.find(c=>c.path.endsWith(a))?.size?.bytes??0;i+=l,o+=l}let s=` ${We(r(e.path))} (${$R(e,i,o)})`;if(s+=e.exports?.length?`
|
|
199
|
+
exports: ${rt(e.exports.join(", "))}`:"",e.chunks?.length&&(s+=`
|
|
200
|
+
${e.chunks.map(a=>{const l=t.buildEntries.find(c=>c.path===a)?.bytes;return rt(` └─ ${r(a)}${We(l?` (${Ie(l,{decimals:2})})`:"")}`)}).join(`
|
|
201
|
+
`)}`),e.dynamicImports&&e.dynamicImports.length>0&&(s+=`
|
|
202
|
+
dynamic imports:`,s+=`
|
|
203
|
+
${e.dynamicImports.map(a=>rt(` └─ ${r(a)}`)).join(`
|
|
204
|
+
`)}`),e.modules&&e.modules.length>0){const a=e.modules.filter(l=>l.id.includes("node_modules")).toSorted((l,c)=>(c.bytes||0)-(l.bytes||0)).map(l=>rt(` 📦 ${r(l.id)}${We(l.bytes?` (${Ie(l.bytes,{decimals:2})})`:"")}`)).join(`
|
|
205
|
+
`);s+=a.length>0?`
|
|
206
|
+
inlined modules:
|
|
207
|
+
${a}`:""}return t.options.declaration&&(s+=wR(e,t,r,n)),s+=`
|
|
208
|
+
|
|
209
|
+
`,e.chunk?rt(s):s},"buildEntryLine"),jR=Ue((e,t)=>{const r=Ue(s=>Be(t.options.rootDir,re(t.options.outDir,s)),"rPath");let n=!1;const i=[],o=t.buildEntries.filter(s=>s.type==="entry");if(o.length>0){e.raw(`Entries:
|
|
210
|
+
`);for(const s of o){const a=xR(s,t,r,i);n=!0,e.raw(a)}}if(t.buildEntries.filter(s=>s.type==="asset").length>0){let s="Assets:";for(const a of t.buildEntries.filter(l=>l.type==="asset"&&!i.includes(l.path)))s+=`${rt(`
|
|
211
|
+
└─ `)+We(r(a.path))} (total size: ${pe(Ie(a.size?.bytes??0,{decimals:2}))})`;s+=`
|
|
212
|
+
|
|
213
|
+
`,e.raw(s)}return n&&e.raw("Σ Total dist size (byte size):",pe(Ie(t.buildEntries.reduce((s,a)=>s+(a.size?.bytes??0),0),{decimals:2})),`
|
|
214
|
+
`),n},"showSizeInformation"),kR=/\.d\.[mc]?ts$/,$a=Ue(e=>e.filter(t=>!kR.test(t.input)),"filterDtsEntries"),ER=Ue((e,t)=>{const r=[];return e!=="undefined"&&r.push(`${pe(e)} environment`),t!=="undefined"&&r.push(`${pe(t)} runtime`),r.length>0?`Preparing build for ${r.join(" with ")}`:""},"createBuildLogMessage"),SR=Ue((e,t)=>{const r={};return e!=="undefined"&&(r[["process","env","NODE_ENV"].join(".")]=JSON.stringify(e)),r[["process","env","EdgeRuntime"].join(".")]=JSON.stringify(t==="edge-light"),Object.freeze(r)},"createReplaceValues"),OR=Ue((e,t)=>{const r=[];return e!=="undefined"&&r.push(e),t!=="undefined"&&r.push(t),r.length>0?`${r.join("/")}/`:""},"createSubDirectory"),Ni=Ue((e,t,r,n,i,o)=>({...e,options:{...e.options,emitCJS:t,emitESM:r,entries:n,minify:i,rollup:{...e.options.rollup,replace:e.options.rollup.replace?es(e.options.rollup.replace,{},o):!1}}}),"createAdjustedContext"),AR=Ue(async(e,t)=>{const r=e.logger,n=Ue(l=>{const c=l.name??l.fileAlias;if(!c)return"default";const p=[".browser",".server",".development",".node",".workerd"];for(const u of p)if(c.includes(u))return u.slice(1);return"default"},"getEntryType"),i=e.options.entries.map(l=>({...l,environment:l.environment??"undefined",runtime:l.runtime??"undefined",type:n(l)})),o=dR(i,"environment","runtime","type"),s=new Set,a=new Set;for(const[l,c]of Object.entries(o))for(const[p,u]of Object.entries(c))for(const[,d]of Object.entries(u)){const f={...e,environment:l==="undefined"?void 0:l,options:{...e.options,rollup:{...e.options.rollup,replace:e.options.rollup.replace?{...e.options.rollup.replace,values:{}}:e.options.rollup.replace}}};if(!e.options.dtsOnly&&(l!=="undefined"||p!=="undefined")){const j=ER(l,p);j&&r.info(j)}const m=p==="undefined"?void 0:p;f.options.runtime=m;try{await e.hooks.callHook("rollup:options",f,{})}catch(j){throw r.error(`Error calling rollup:options hook: ${String(j)}`),j}const h=f.options.rollup.replace,v=e.options.rollup.replace,b=h?SR(l,p):{};if(h){h.values??={};const j=v?es(v).values:{};Object.assign(h.values,b,j)}else r.warn("'replace' plugin is disabled. You should enable it to replace 'process.env.*' environments.");const w=h?h.values??b:b,k=OR(l,p);let y=f.options.minify??!1;l==="development"?y=!1:l==="production"&&(y=!0);const x=d.map(j=>{const{environment:A,runtime:N,...q}=j;return{...q,environment:A==="undefined"?void 0:A,runtime:N==="undefined"?void 0:N}}),$=[],E=[],O=[],S=[];for(const j of x){if(Gn(j.name)){j.declaration&&S.push(j);continue}j.cjs&&j.esm?$.push(j):j.cjs?O.push(j):j.esm?E.push(j):j.declaration&&S.push(j)}if($.length>0){const j=Ni(f,!0,!0,$a($),y,w);if(e.options.dtsOnly||s.add({context:j,fileCache:t,subDirectory:k}),e.options.declaration){const A=$.filter(N=>N.declaration);A.length>0&&a.add({context:{...j,options:{...j.options,entries:A}},fileCache:t,subDirectory:k})}}if(E.length>0){const j=Ni(f,!1,!0,$a(E),y,w);if(e.options.dtsOnly||s.add({context:j,fileCache:t,subDirectory:k}),e.options.declaration){const A=E.filter(N=>N.declaration);A.length>0&&a.add({context:{...j,options:{...j.options,entries:A}},fileCache:t,subDirectory:k})}}if(O.length>0){const j=Ni(f,!0,!1,$a(O),y,w);if(e.options.dtsOnly||s.add({context:j,fileCache:t,subDirectory:k}),e.options.declaration){const A=O.filter(N=>N.declaration);A.length>0&&a.add({context:{...j,options:{...j.options,entries:A}},fileCache:t,subDirectory:k})}}if(f.options.declaration&&S.length>0){const j=S.some(J=>J.declarationCjs),A=S.some(J=>J.declarationEsm),N=S.some(J=>J.declaration&&!J.declarationCjs&&!J.declarationEsm),q=Ni(f,j||N,A,S,y,w);a.add({context:q,fileCache:t,subDirectory:k})}}return{builders:s,typeBuilders:a}},"prepareRollupConfig"),PR=Ue(async(e,t)=>{const r=e.logger;await e.hooks.callHook("build:before",e);const{builders:n,typeBuilders:i}=await AR(e,t);if(n.size>0&&await Promise.all(Array.from(n,async({context:a,fileCache:l,subDirectory:c})=>RA(a,l,c,rg(a.options.bundler)))),i.size>0){const a=e.options.dtsConcurrency??vR;await aR(Array.from(i,({context:l,fileCache:c,subDirectory:p})=>()=>_7(l,c,p)),a)}r.success(Ka(e.options.name?`Build succeeded for ${e.options.name}`:"Build succeeded")),e.buildEntries=e.buildEntries.filter((a,l,c)=>c.findIndex(p=>p.path===a.path)===l);const o=G(e.options.rootDir,e.options.outDir),s=[];for await(const a of Hg(o,{includeDirs:!1,includeFiles:!0})){let l=e.buildEntries.find(u=>G(o,u.path)===a.path);l||(l={chunk:!0,path:a.path},e.buildEntries.push(l)),l.size??={};const c=re(o,a.path),p=l.size;s.push((async()=>{if(!p.bytes){const f=await Xn(c);p.bytes=f.size}const[u,d]=await Promise.all([p.brotli??pR(c),p.gzip??hR(c)]);p.brotli=u,p.gzip=d})())}return await Promise.all(s),e.options.exe&&await oR(e),await e.hooks.callHook("build:done",e),jR(r,e)},"build");var CR=Object.defineProperty,Mg=g((e,t)=>CR(e,"name",{value:t,configurable:!0}),"c");const RR=Mg(e=>Object.fromEntries(Object.entries(e).map(([t,r])=>{if(!r)return[t,{}];const n=Object.fromEntries(Object.entries(r).map(([i,o])=>Array.isArray(o)?[i,[...new Set(o)]]:[i,[]]));return[t,n]})),"uniqueNestedValues"),TR=Mg(async(e,t,r,n,i,o)=>{const s=e;if(o!=="*"&&nt.valid(nt.coerce(o))===null)throw new Error("Invalid typeScriptVersion option. It must be a valid semver range.");s.info({message:"Declaration node10 compatibility mode is enabled.",prefix:"plugin:packem:node10-compatibility"});const a={};for(const p of t){if(p.exportKey===void 0||p.name===void 0)continue;const{name:u}=p;for(const d of p.exportKey)a[d]=d.includes("/*")?[`./${G(r,ne(u),"*.d.ts")}`]:[...a[d]??[],`./${G(r,`${u}.d.ts`)}`]}const l=G(n,"package.json"),c=await mo(l);i==="file"&&Object.keys(a).length>0?(await Yu(l,{...c,typesVersions:RR({...c.typesVersions,[o]:a})},{detectIndent:!0}),s.info({message:'Your package.json "typesVersions" field has been updated.',prefix:"plugin:packem:node10-compatibility"})):Object.keys(a).length>0&&s.info({message:`Please add the following field into your package.json to enable node 10 compatibility:
|
|
215
|
+
|
|
216
|
+
${JSON.stringify({typesVersions:{"*":a}},void 0,4)}
|
|
217
|
+
`,prefix:"plugin:packem:node10-compatibility"})},"node10Compatibility");var NR=Object.defineProperty,ze=g((e,t)=>NR(e,"name",{value:t,configurable:!0}),"p");const yr=ze(e=>e??{},"extras"),_R=/\.(md|txt|htm|html|data)$/,MR=/^@swc\/helpers(?:\/.*)?$/,IR=ze(e=>{switch(e){case"preserve":case"react-native":return"preserve";case"react":return"transform";case"react-jsx":case"react-jsxdev":return"automatic";default:return}},"resolveTsconfigJsxToJsxRuntime"),WR=ze((e,t,r,n,i,o,s,a)=>{const l=IR(s?.config.compilerOptions?.jsx),c=a.split("."),p=fP()(E1,i,{alias:{},browserTargets:Rv(),cjsInterop:!1,clean:!0,debug:n,declaration:void 0,emitCJS:void 0,emitESM:void 0,entries:[],externals:[],failOnWarn:!0,fileCache:!0,jiti:{alias:{},debug:n,interopDefault:!0},minify:r===Rn,name:(o.name??"").split("/").pop()??"default",outDir:s?.config.compilerOptions?.outDir??"dist",rollup:{alias:{},cjsInterop:{addDefaultProperty:!1},commonjs:{extensions:[".mjs",".js",".json",".node",".cjs"],ignoreTryCatch:!0,preserveSymlinks:!0,transformMixedEsModules:!0},css:{autoModules:!0,extensions:[".css",".pcss",".postcss",".sss"],namedExports:!0},dataUri:{srcset:!0},debarrel:{},detectDuplicated:{},dts:{compilerOptions:{baseUrl:s?.config.compilerOptions?.baseUrl??".",checkJs:!1,composite:!1,declaration:!0,declarationMap:!1,emitDeclarationOnly:!0,incremental:!1,moduleResolution:100,noEmit:!1,noEmitOnError:!0,preserveSymlinks:!1,skipLibCheck:!0,target:99}},dynamicVars:{errorWhenNoFilesFound:!0,exclude:Zt,include:Yt},esbuild:{charset:"utf8",jsx:l,jsxDev:s?.config.compilerOptions?.jsx==="react-jsxdev",jsxFactory:s?.config.compilerOptions?.jsxFactory,jsxFragment:yr(s?.config.compilerOptions).jsxFragmentFactory,jsxImportSource:yr(s?.config.compilerOptions).jsxImportSource,jsxSideEffects:!0,keepNames:!0,sourcesContent:!1,supported:{"import-attributes":!0},target:s?.config.compilerOptions?.target,treeShaking:!0,tsconfigRaw:s?.config},json:{preferConst:!1},license:{dependenciesTemplate:ze((f,m,h)=>`
|
|
218
|
+
# Licenses of bundled dependencies
|
|
219
|
+
The published ${h} artifact additionally contains code with the following licenses:
|
|
220
|
+
${f.length>0?`${f.join(", ")}
|
|
221
|
+
|
|
222
|
+
`:`
|
|
223
|
+
`}# Bundled dependencies:
|
|
224
|
+
${m}`,"dependenciesTemplate"),dtsTemplate:ze((f,m,h)=>`
|
|
225
|
+
# Licenses of bundled types
|
|
226
|
+
The published ${h} artifact additionally contains code with the following licenses:
|
|
227
|
+
${f.length>0?`${f.join(", ")}
|
|
228
|
+
|
|
229
|
+
`:`
|
|
230
|
+
`}# Bundled types:
|
|
231
|
+
${m}`,"dtsTemplate")},nativeModules:{},node10Compatibility:!1,output:{importAttributesKey:Number(c[0])>=22?"with":"assert"},oxc:{jsx:l==="preserve"?"preserve":{development:r!=="production",pragma:s?.config.compilerOptions?.jsxFactory,pragmaFrag:yr(s?.config.compilerOptions).jsxFragmentFactory,pure:!0,runtime:l==="transform"||l==="automatic"?"automatic":"classic",useBuiltIns:!0,useSpread:!0}},patchTypes:{},polyfillNode:{},preserveDirectives:{include:Yt},preserveDynamicImports:!0,pure:{},raw:{exclude:Zt,include:[_R]},replace:{objectGuards:!0,preventAssignment:!0},resolve:{aliasFields:[],builtinModules:!1,conditionNames:[r??"production","module-sync","import","require","default"],extensions:go,mainFields:["module","main"]},resolveExternals:{builtins:!0,builtinsPrefix:"add",deps:!0,devDeps:!1,exclude:[],optDeps:!0,peerDeps:!0},shebang:{replace:!1,shebang:"#!/usr/bin/env node"},shim:{exclude:Zt,include:Yt},sourcemap:{},sucrase:{disableESTransforms:!0,enableLegacyBabel5ModuleInterop:!1,enableLegacyTypeScriptModuleInterop:!s?.config.compilerOptions?.esModuleInterop,include:Yt,injectCreateRequireForImportRequire:!1,preserveDynamicImport:!0,production:r===Rn,...s?.config.compilerOptions?.jsx&&["react","react-jsx","react-jsxdev"].includes(s.config.compilerOptions.jsx)?{jsxFragmentPragma:yr(s.config.compilerOptions).jsxFragmentFactory,jsxImportSource:yr(s.config.compilerOptions).jsxImportSource,jsxPragma:s.config.compilerOptions.jsxFactory,jsxRuntime:l,transforms:["typescript","jsx"]}:{transforms:["typescript"]}},swc:{include:Yt,inlineSourcesContent:!1,inputSourceMap:!1,isModule:!0,jsc:{experimental:{keepImportAttributes:!0},externalHelpers:!0,keepClassNames:!0,loose:!0,parser:{decorators:s?.config.compilerOptions?.experimentalDecorators,syntax:s?"typescript":"ecmascript",[s?"tsx":"jsx"]:!0},target:s?.config.compilerOptions?.target?.toLowerCase(),transform:{decoratorMetadata:s?.config.compilerOptions?.emitDecoratorMetadata,decoratorVersion:"2022-03",legacyDecorator:s?.config.compilerOptions?.experimentalDecorators,react:{development:r!==Rn,pragma:s?.config.compilerOptions?.jsxFactory,pragmaFrag:yr(s?.config.compilerOptions).jsxFragmentFactory,runtime:l,throwIfNamespace:!0},treatConstEnumAsEnum:s?.config.compilerOptions?.preserveConstEnums,useDefineForClassFields:s?.config.compilerOptions?.useDefineForClassFields}},module:{ignoreDynamic:!0,importInterop:"none",preserveImportMeta:!0,strict:!1,strictMode:!1,type:"es6"}},treeshake:{moduleSideEffects:gP(t,o),preset:"recommended",propertyReadSideEffects:!0},tsconfigPaths:{resolveAbsolutePath:!1},url:{emitFiles:!0,fileName:"[hash][extname]",include:["**/*.svg","**/*.png","**/*.jp(e)?g","**/*.gif","**/*.webp"],limit:14*1024},visualizer:{},watch:{chokidar:{ignoreInitial:!0,ignorePermissionErrors:!0},clearScreen:!0,exclude:Zt}},rootDir:t,sourceDir:"src",sourcemap:!1,transformerName:void 0,typedoc:{excludePrivate:!0,format:"inline",githubPages:!1,groupOrder:["Classes","Constructors","Accessors","Methods","Functions","Namespaces","Variables","Enumerations","Interfaces","Type Aliases","*"],kindSortOrder:["Project","Module","Class","Interface","Function","Namespace","Variable","Enum","EnumMember","TypeAlias","Reference","Constructor","Property","Accessor","Method","Parameter","TypeParameter","TypeLiteral","CallSignature","ConstructorSignature","IndexSignature","GetSignature","SetSignature"],marker:"TYPEDOC",name:o.name??"unknown",pretty:!0,readme:"none",showConfig:n,tsconfig:s?.path},validation:{dependencies:{hoisted:{exclude:[]},unused:{exclude:[]}},packageJson:{bin:!0,dependencies:!0,exports:!0,files:!0,main:!0,module:!0,name:!0,types:!0,typesVersions:!0}}});p.runtime===void 0&&(e.warn("No runtime specified, defaulting to 'node'. This will change in packem v2 to 'browser', please add 'runtime: node' to your packem config or command call"),p.runtime="node");const u=new Map([...Object.entries(o.dependencies??{}),...Object.entries(o.devDependencies??{})]),d=p.bundler==="rolldown";if(d&&i.transformer!==void 0)throw new Error('The `transformer` option is not supported when `bundler: "rolldown"`. Rolldown uses its own oxc-based transform — remove `transformer` from your packem config.');if(!d){if(p.transformer?.NAME===void 0)throw new Error("Unknown transformer, check your transformer options or install one of the supported transformers: esbuild, swc, sucrase");p.transformerName=p.transformer.NAME,p.transformerName==="swc"&&(p.externals=[...p.externals,MR])}if(e.info({message:`Using ${pe("node ")}${a}`,prefix:"system"}),e.info({message:d?`Using ${pe("rolldown")} with ${pe(p.runtime)} build runtime`:`Using ${pe("rollup")} with ${pe(p.runtime)} build runtime`,prefix:"bundler"}),!d&&p.transformerName){let f=p.transformerName;p.transformerName==="oxc"?f="oxc-transform":p.transformerName==="swc"&&(f="@swc/core");const m=u.get(f)??"0.0.0";e.info({message:`Using ${pe(p.transformerName)} ${m}`,prefix:"transformer"})}if(p.rollup.resolve&&(p.rollup.resolve.preferBuiltins=p.runtime==="node",p.rollup.resolve.preferBuiltins&&(p.rollup.polyfillNode=!1,e.debug("Disabling polyfillNode because preferBuiltins is set to true"))),p.runtime==="node"&&(p.browserTargets=[]),p.runtime==="browser"&&(p.rollup.resolve&&p.rollup.resolve.browser===void 0&&(p.rollup.resolve.browser=!0),p.browserTargets&&p.browserTargets.length>0&&e.debug(`Using browser targets: ${p.browserTargets.join(", ")}`)),_u(p.alias),p.rollup.alias!==!1&&p.rollup.alias?.entries&&_u(p.rollup.alias.entries),p.outputExtensionMap){let f;for(const[m,h]of Object.entries(p.outputExtensionMap)){if(!["cjs","esm"].includes(m))throw new Error(`Invalid output extension map: ${m} must be "cjs" or "esm"`);if(typeof h!="string")throw new TypeError(`Invalid output extension map: ${m} must be a string`);if(h.startsWith("."))throw new Error(`Invalid output extension map: ${m} must not start with a dot. Example: "cjs": "c.js", "esm": "m.js"`);if(f===void 0)f=h;else if(f===h)throw new Error(`Invalid output extension map: ${m} must be different from the other key`)}}return s?.config.compilerOptions?.declarationMap&&(p.sourcemap=!0,e.info("Enabling sourcemap because declarationMap is enabled in tsconfig.json")),p},"generateOptions"),BR=ze(async(e,t,r,n,i,o,s,a,l)=>{const c=o.hooks,p=WR(e,t,n,i,o,s,a,l);Jg(G(p.rootDir,p.outDir));const u={buildEntries:[],dependencyGraphMap:new Map,environment:n,hoistedDependencies:new Set,hooks:Tv(),implicitDependencies:new Set,jiti:Nv(p.rootDir,p.jiti),logger:e,mode:r,options:p,pkg:s,tsconfig:a,usedDependencies:new Set,warnings:new Set};c&&u.hooks.addHooks(c),await u.hooks.callHook("build:prepare",u),u.options.emitESM===void 0&&e.info("Emitting of ESM bundles, is disabled."),u.options.emitCJS===void 0&&e.info("Emitting of CJS bundles, is disabled."),u.options.minify&&e.info("Minification is enabled, the output will be minified"),PP(u);const d=zf(s,["typescript"]);if(u.options.declaration&&u.tsconfig===void 0&&d)throw new Error("Cannot build declaration files without a tsconfig.json");return d?u.options.declaration===!1&&e.info({message:"Generation of declaration files are disabled.",prefix:"dts"}):(u.options.declaration=!1,e.info({message:"Typescript is not installed. Generation of declaration files are disabled.",prefix:"dts"})),u.options.declaration&&e.info(`Using typescript version: ${pe(s.devDependencies?.typescript??s.dependencies?.typescript??"unknown")}`),u.options.declaration&&(s.dependencies?.typescript||s.devDependencies?.typescript)&&!u.tsconfig?.config.compilerOptions?.isolatedModules&&e.warn(`'compilerOptions.isolatedModules' is not enabled in tsconfig.
|
|
232
|
+
Because none of the third-party transpiler, packem uses under the hood is type-aware, some techniques or features often used in TypeScript are not properly checked and can cause mis-compilation or even runtime errors.
|
|
233
|
+
To mitigate this, you should set the isolatedModules option to true in tsconfig and let your IDE warn you when such incompatible constructs are used.`),ig(u),u},"createContext"),DR=ze(e=>{switch(e){case"build":return"Building";case"jit":return"Stubbing";case"watch":return"Watching";default:throw new Error(`Unknown mode: ${String(e)}`)}},"getMode"),iT=ze(async(e,t,r,n,i,o,s)=>{const a=Nt.version.slice(1);n.wrapAll(),e=re(Nt.cwd(),e),n.debug("Root directory:",e);const{packageJson:l,packageJsonPath:c}=ns(e);n.debug("Using package.json found at",c);const p=await BA(e,l,n,s),u=m2("@visulima/packem",{cwd:e});let d=!1,f,m,h;const v=mt(JSON.stringify({packemVersion:vf,version:l.version,...l.dependencies,...l.devDependencies,...l.peerDependencies,...l.peerDependenciesMeta,browser:l.browser,eNode:l.engines?.node,exports:l.exports,main:l.main,module:l.module,nodeVersion:a,type:l.type,types:l.types}))+mt(JSON.stringify(o));u&&Ug(v,u,n);const b=new jv(e,u,v,n);try{const w=await BR(n,e,t,r,i,o,l,p,a);b.isEnabled=w.options.fileCache??!0;const k=rg(w.options.bundler);await pu(k,e,n),k==="rolldown"&&w.options.declaration&&await pu("rollup",e,n),w.options.transformerName&&await NA(w.options.transformerName,e,n),n.info(pe(`${DR(t)} ${w.options.name}`)),n.debug({context:w.options.entries,message:`${We("Root dir:")} ${w.options.rootDir}
|
|
234
|
+
${We("Entries:")}`});const y=ze(async S=>{for(const[j,A]of Object.entries(w.options.builder??{})){n.raw(`
|
|
235
|
+
`),await w.hooks.callHook("builder:before",j,w);const N=Date.now(),q=ze(()=>Kc(Math.floor(Date.now()-N)),"getBuilderDuration");await A(w,u,b,d),await w.hooks.callHook("builder:done",j,w),n.raw(`
|
|
236
|
+
⚡️ ${j} run in ${q()}`),S&&n.raw(`
|
|
237
|
+
|
|
238
|
+
`)}},"runBuilder"),x=ze(async()=>{if(f?.pid!==void 0)await xP({pid:f.pid,signal:o.killSignal??"SIGTERM"});else if(m!==void 0)try{typeof m=="function"&&await m()}catch(S){throw new Error(`onSuccess function cleanup failed: ${S instanceof Error?S.message:String(S)}`,{cause:S})}f=void 0,m=void 0},"doOnSuccessCleanup"),$=ze(async()=>{if(typeof w.options.onSuccess=="function")try{m=await w.options.onSuccess()}catch(S){throw new Error(`onSuccess function failed: ${S instanceof Error?S.message:String(S)}`,{cause:S})}else if(typeof w.options.onSuccess=="string"){const S=w.options.onSuccessTimeout??3e4,j=f=_v(w.options.onSuccess,[],{nodeOptions:{shell:!0,stdio:"inherit",timeout:S}});await j;const{exitCode:A}=j;if(typeof A=="number"&&A!==0)throw new Error(`onSuccess script failed with exit code ${String(A)}. Check the output above for details.`)}},"runOnsuccess"),E=Date.now(),O=ze(()=>Kc(Math.floor(Date.now()-E)),"getDuration");if(t==="watch"){if(w.options.rollup.watch===!1)throw new Error("Rollup watch is disabled. You should check your packem config.");w.options.bundler==="rolldown"&&n.warn({message:"Watch mode falls back to rollup; rolldown watch isn't supported yet.",prefix:"bundler"}),await aP(w,b,y,$,x),mu(w,!1);return}if(await pP(w),t==="jit")await rP(w),await w.hooks.callHook("build:done",w);else{if(d=await PR(w,b),w.options.emitCJS&&w.options.declaration==="compatible"){d&&n.raw(`
|
|
239
|
+
`);let S="console",j="*";w.options.node10Compatibility&&(S=w.options.node10Compatibility.writeToPackageJson?"file":"console",j=w.options.node10Compatibility.typeScriptVersion??"*"),await TR(n,w.options.entries,w.options.outDir,w.options.rootDir,S,j)}await w.hooks.callHook("validate:before",w),typeof w.options.validation=="object"&&(w.options.validation.packageJson&&g7(w),w.options.validation.attw&&await HC(w,d),w.options.validation.bundleLimit&&R7(w,d)),await w.hooks.callHook("validate:done",w),mu(w,d)}n.raw(`
|
|
240
|
+
⚡️ Build run in ${O()}
|
|
241
|
+
`),h=ze(()=>{x().catch(S=>{n.raw(`
|
|
242
|
+
onSuccess cleanup failed: ${S instanceof Error?S.message:String(S)}
|
|
243
|
+
`)})},"signalHandler"),Nt.once("SIGINT",h),Nt.once("SIGTERM",h),await y(),await $()}catch(w){throw n.raw(`
|
|
244
|
+
`),bv(w),fd(w),w}finally{h&&(Nt.off("SIGINT",h),Nt.off("SIGTERM",h)),n.restoreAll(),await OP(u,n,d)}},"packem");export{Vy as $,uw as C,iT as I,C4 as K,z4 as N,Sb as Q,Vx as T,yw as U,ow as W,kw as Z,Po as _,kn as a,ps as b,Ic as c,fP as d,Pb as e,E1 as f,M4 as g,T4 as h,vf as i,Ke as j,H4 as l,q4 as m,_4 as n,Eb as r,Ow as t,jc as v};
|