@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.
@@ -1,255 +0,0 @@
1
- var P$=Object.defineProperty;var v=(e,t)=>P$(e,"name",{value:t,configurable:!0});import{createRequire as De,builtinModules as C$}from"node:module";import{f as Rr,a as _h,_ as qc,c as T$,s as Ph,d as $u,b as N$,e as I$,M as M$,g as As,$ as xu,n as D$,w as B$,i as Ft,q as Pe,j as Ze,F as Pt,P as Xo,I as wu,h as Qr,B as Eu,T as zr,H as Yo,E as Ch,K as L$,m as W$}from"./create-or-update-key-storage-DUTe5Prf.js";import Vt,{env as F$,versions as as,platform as mn}from"node:process";import{installPackage as Th,detectPackageManager as H$}from"@antfu/install-pkg";import{L as ve,P as Je,_ as le,B as hn,X as xt,b as Nh,M as Gi,V as Ce,R as tt,H as gn,A as q$,a as z$,c as Ih}from"./utils-nmTpa3um.js";import{f as G$,C as ls,l as U$,B as Mh,i as K$,$ as Dh,a as kr,r as rt,b as Ui,c as Os,d as Su,e as Bh,g as Lh,h as J$,j as Wh,k as V$,N as X$,m as Y$,n as Zr,o as Q$,p as Z$,I as ex,q as Rs}from"./oxcResolvePlugin-DeIohkWk-rspLVIoy.js";import{browserslistToEsbuild as hf,nodeResolve as tx,alias as Fh,purePlugin as rx,pureNewExpressionPlugin as nx,importTrace as Hh,replace as qh,polyfillNode as ix,chunkSplitter as ox,wasm as sx,preserveDirectivesPlugin as ax,dynamicImportVars as lx,commonjs as cx,jsxRemoveAttributes as ux,visualizer as px,patchErrorWithTrace as fx}from"@visulima/packem-rollup";import{ENDING_REGEX as dx,svgToCssDataUri as mx,svgToTinyDataUri as hx,memoizeByKey as ku,arrayify as gx,enhanceRollupError as zh,FileCache as vx}from"@visulima/packem-share";import{RUNTIME_EXPORT_CONVENTIONS as Gh,SPECIAL_EXPORT_CONVENTIONS as Uh,PRODUCTION_ENV as ji,DEVELOPMENT_ENV as gf,DEFAULT_EXTENSIONS as _s,ENDING_REGEX as ju,EXCLUDE_REGEXP as gr,ALLOWED_TRANSFORM_EXTENSIONS_REGEX as mr,VALID_EXPORT_EXTENSIONS as bx}from"@visulima/packem-share/constants";import{getCacheHash as Wt,memoize as yx,arrayify as zc,isFromNodeModules as vl,isBareSpecifier as gi,parseSpecifier as Gc,isOutsideProject as $x,getPackageName as xx,replaceContentWithinMarker as wx,svgEncoder as Ex,getChunkFilename as Ai,getEntryFileNames as Sx,getOutputExtension as gt,sortUserPlugins as Kh,getDtsExtension as Tt,warn as be}from"@visulima/packem-share/utils";import kx from"browserslist";import{createHooks as jx}from"hookable";import{createJiti as Ax}from"jiti";import{x as cs,exec as Ox}from"tinyexec";import Ke from"magic-string";import{fileURLToPath as Jh}from"node:url";import Rx,{existsSync as Au,createReadStream as Ou,createWriteStream as _x,watch as vf}from"node:fs";import{cpus as Px,tmpdir as Vh,homedir as Cx}from"node:os";import{dirname as Uc,join as Xh,resolve as Tx,isAbsolute as Nx}from"node:path";import{createFilter as Mt,normalizePath as _i}from"@rollup/pluginutils";import Ix from"workerpool";import{transformAsync as Mx}from"@babel/core";import Yh,{stat as Ki,readFile as us,copyFile as Dx,chmod as Qh,rm as Ps,readdir as Bx,mkdtemp as Zh,rename as Lx,mkdir as eg,writeFile as tg}from"node:fs/promises";import*as Wx from"rs-module-lexer";import{findStaticImports as Cs,isNodeBuiltin as Co,parseNodeModulePath as bf,parseStaticImport as Fx,findExports as Hx,resolvePath as rg,fileURLToPath as qx,resolveModuleExportNames as zx,pathToFileURL as Gx}from"mlly";import Ux from"rollup-plugin-license";import Gt from"typescript";import Kx from"clean-css";import{minify as Jx}from"html-minifier-next";import{init as ng,parse as Vx}from"cjs-module-lexer";import{parseSync as Ts}from"oxc-parser";import Xx from"node:crypto";import{cjsInteropPlugin as ig}from"@visulima/packem-rollup/plugin/cjs-interop";import{JsonPlugin as Yx}from"@visulima/packem-rollup/plugin/json";import{confirm as Qx,isCancel as Zx,spinner as e0}from"@clack/prompts";import yf from"node:path/posix";import{readTsConfig as t0,findTsConfig as r0}from"@visulima/tsconfig";import{createDefu as n0}from"defu";import i0 from"child_process";import o0 from"node:child_process";import{promisify as s0,debuglog as a0}from"node:util";import{distance as l0}from"fastest-levenshtein";import{createBrotliCompress as c0,constants as u0,createGzip as p0}from"node:zlib";import{Buffer as f0}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 d0=Object.defineProperty,m0=v((e,t)=>d0(e,"name",{value:t,configurable:!0}),"i$s"),h0=Object.defineProperty,g0=m0((e,t)=>h0(e,"name",{value:t,configurable:!0}),"r"),v0=Object.defineProperty,b0=g0((e,t)=>v0(e,"name",{value:t,configurable:!0}),"i");const $f=b0(e=>{if(e.isFile())return"file";if(e.isDirectory())return"dir";if(e.isSymbolicLink())return"symlink"},"getFileInfoType");var y0=Object.defineProperty,$0=v((e,t)=>y0(e,"name",{value:t,configurable:!0}),"i$r"),x0=Object.defineProperty,og=$0((e,t)=>x0(e,"name",{value:t,configurable:!0}),"s");const w0=De(import.meta.url),zn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,E0=og(e=>{if(typeof zn<"u"&&zn.versions&&zn.versions.node){const[t,r]=zn.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return zn.getBuiltinModule(e)}return w0(e)},"__cjs_getBuiltinModule"),{lstat:xf,mkdir:S0}=E0("node:fs/promises");var k0=Object.defineProperty,j0=og((e,t)=>k0(e,"name",{value:t,configurable:!0}),"o");const Kc=j0(async e=>{G$(e);try{const t=await xf(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String($f(t))}'`);return}catch(t){if(t.code!=="ENOENT")throw t}try{await S0(e,{recursive:!0})}catch(t){if(t.code!=="EEXIST")throw t;const r=await xf(e);if(!r.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String($f(r))}'`,{cause:t})}},"ensureDir");var A0=Object.defineProperty,Sn=v((e,t)=>A0(e,"name",{value:t,configurable:!0}),"r$e"),O0=Object.defineProperty,kn=Sn((e,t)=>O0(e,"name",{value:t,configurable:!0}),"r"),R0=Object.defineProperty,vn=kn((e,t)=>R0(e,"name",{value:t,configurable:!0}),"t");function Ji(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}v(Ji,"p$x");Sn(Ji,"f");kn(Ji,"getDefaultExportFromCjs");vn(Ji,"getDefaultExportFromCjs");function Ru(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}v(Ru,"f$w");Sn(Ru,"l");kn(Ru,"getDefaultExportFromNamespaceIfPresent");vn(Ru,"getDefaultExportFromNamespaceIfPresent");function _u(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")&&Object.keys(e).length===1?e.default:e}v(_u,"l$D");Sn(_u,"s");kn(_u,"getDefaultExportFromNamespaceIfNotNamed");vn(_u,"getDefaultExportFromNamespaceIfNotNamed");function Pu(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=vn(kn(Sn(v(function n(){var i=!1;try{i=this instanceof n}catch{}return i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)},"u"),"n"),"a"),"a");r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:vn(function(){return e[n]},"get")})}),r}v(Pu,"s$D");Sn(Pu,"m");kn(Pu,"getAugmentedNamespace");vn(Pu,"getAugmentedNamespace");var _0=Object.defineProperty,or=v((e,t)=>_0(e,"name",{value:t,configurable:!0}),"lt$5"),P0=Object.defineProperty,wt=or((e,t)=>P0(e,"name",{value:t,configurable:!0}),"ut"),wf={},bl,Ef;function jn(){if(Ef)return bl;Ef=1;const e="[^\\\\/]",t=Symbol("unignore"),r="\\.",n="\\+",i="\\?",o="\\/",s="(?=.)",a="[^/]",l=`(?:${o}|$)`,c=`(?:^|${o})`,u=`${r}{1,2}${l}`,p=`(?!${r})`,f=`(?!${c}${u})`,d=`(?!${r}{0,1}${l})`,m=`(?!${u})`,g=`[^.${o}]`,y=`${a}*?`,x="/",j={DOT_LITERAL:r,PLUS_LITERAL:n,QMARK_LITERAL:i,SLASH_LITERAL:o,ONE_CHAR:s,QMARK:a,END_ANCHOR:l,DOTS_SLASH:u,NO_DOT:p,NO_DOTS:f,NO_DOT_SLASH:d,NO_DOTS_SLASH:m,QMARK_NO_DOT:g,STAR:y,START_ANCHOR:c,SEP:x},R={...j,SLASH_LITERAL:"[\\\\/]",QMARK:e,STAR:`${e}*?`,DOTS_SLASH:`${r}{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!${r})`,NO_DOTS:`(?!(?:^|[\\\\/])${r}{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!${r}{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!${r}{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},b={__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 bl={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:b,UNIGNORE:t,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(E){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${E.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(E){return E===!0?R:j}},bl}v(jn,"_t$5");or(jn,"bt");wt(jn,"requireConstants");var Sf;function An(){return Sf||(Sf=1,(function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:r,REGEX_SPECIAL_CHARS:n,REGEX_SPECIAL_CHARS_GLOBAL:i}=jn();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 u=`${l}(?:${o})${c}`;return s.negated===!0&&(u=`(?:^(?!${u}).*$)`),u},e.basename=(o,{windows:s}={})=>{const a=o.split(s?/[\\/]/:"/"),l=a[a.length-1];return l===""?a[a.length-2]:l}})(wf)),wf}v(An,"Et$5");or(An,"yt");wt(An,"requireUtils");var yl,kf;function Cu(){if(kf)return yl;kf=1;var e=Object.defineProperty,t=wt((b,E)=>e(b,"name",{value:E,configurable:!0}),"k");const r=An(),{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:u,CHAR_LEFT_PARENTHESES:p,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:d,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:g,CHAR_RIGHT_PARENTHESES:y,CHAR_RIGHT_SQUARE_BRACKET:x}=jn(),j=t(b=>b===c||b===o,"isPathSeparator"),R=t(b=>{b.isPrefix!==!0&&(b.depth=b.isGlobstar?1/0:1)},"depth");return yl=t((b,E)=>{const h=E||{},A=b.length-1,_=h.parts===!0||h.scanToEnd===!0,O=[],k=[],C=[];let B=b,J=-1,q=0,X=0,te=!1,re=!1,I=!1,M=!1,K=!1,F=!1,N=!1,W=!1,V=!1,U=!1,z=0,Y,L,D={value:"",depth:0,isGlob:!1};const $=t(()=>J>=A,"eos"),ge=t(()=>B.charCodeAt(J+1),"peek"),pe=t(()=>(Y=L,B.charCodeAt(++J)),"advance");for(;J<A;){L=pe();let Q;if(L===o){N=D.backslashes=!0,L=pe(),L===u&&(F=!0);continue}if(F===!0||L===u){for(z++;$()!==!0&&(L=pe());){if(L===o){N=D.backslashes=!0,pe();continue}if(L===u){z++;continue}if(F!==!0&&L===a&&(L=pe())===a){if(te=D.isBrace=!0,I=D.isGlob=!0,U=!0,_===!0)continue;break}if(F!==!0&&L===s){if(te=D.isBrace=!0,I=D.isGlob=!0,U=!0,_===!0)continue;break}if(L===g&&(z--,z===0)){F=!1,te=D.isBrace=!0,U=!0;break}}if(_===!0)continue;break}if(L===c){if(O.push(J),k.push(D),D={value:"",depth:0,isGlob:!1},U===!0)continue;if(Y===a&&J===q+1){q+=2;continue}X=J+1;continue}if(h.noext!==!0&&(L===d||L===i||L===n||L===m||L===l)&&ge()===p){if(I=D.isGlob=!0,M=D.isExtglob=!0,U=!0,L===l&&J===q&&(V=!0),_===!0){for(;$()!==!0&&(L=pe());){if(L===o){N=D.backslashes=!0,L=pe();continue}if(L===y){I=D.isGlob=!0,U=!0;break}}continue}break}if(L===n){if(Y===n&&(K=D.isGlobstar=!0),I=D.isGlob=!0,U=!0,_===!0)continue;break}if(L===m){if(I=D.isGlob=!0,U=!0,_===!0)continue;break}if(L===f){for(;$()!==!0&&(Q=pe());){if(Q===o){N=D.backslashes=!0,pe();continue}if(Q===x){re=D.isBracket=!0,I=D.isGlob=!0,U=!0;break}}if(_===!0)continue;break}if(h.nonegate!==!0&&L===l&&J===q){W=D.negated=!0,q++;continue}if(h.noparen!==!0&&L===p){if(I=D.isGlob=!0,_===!0){for(;$()!==!0&&(L=pe());){if(L===p){N=D.backslashes=!0,L=pe();continue}if(L===y){U=!0;break}}continue}break}if(I===!0){if(U=!0,_===!0)continue;break}}h.noext===!0&&(M=!1,I=!1);let se=B,w="",S="";q>0&&(w=B.slice(0,q),B=B.slice(q),X-=q),se&&I===!0&&X>0?(se=B.slice(0,X),S=B.slice(X)):I===!0?(se="",S=B):se=B,se&&se!==""&&se!=="/"&&se!==B&&j(se.charCodeAt(se.length-1))&&(se=se.slice(0,-1)),h.unescape===!0&&(S&&(S=r.removeBackslashes(S)),se&&N===!0&&(se=r.removeBackslashes(se)));const we={prefix:w,input:b,start:q,base:se,glob:S,isBrace:te,isBracket:re,isGlob:I,isExtglob:M,isGlobstar:K,negated:W,negatedExtglob:V};if(h.tokens===!0&&(we.maxDepth=0,j(L)||k.push(D),we.tokens=k),h.parts===!0||h.tokens===!0){let Q;for(let ie=0;ie<O.length;ie++){const ye=Q?Q+1:q,$e=O[ie],Te=b.slice(ye,$e);h.tokens&&(ie===0&&q!==0?(k[ie].isPrefix=!0,k[ie].value=w):k[ie].value=Te,R(k[ie]),we.maxDepth+=k[ie].depth),(ie!==0||Te!=="")&&C.push(Te),Q=$e}if(Q&&Q+1<b.length){const ie=b.slice(Q+1);C.push(ie),h.tokens&&(k[k.length-1].value=ie,R(k[k.length-1]),we.maxDepth+=k[k.length-1].depth)}we.slashes=O,we.parts=C}return we},"scan"),yl}v(Cu,"Nt$5");or(Cu,"wt");wt(Cu,"requireScan");var $l,jf;function Tu(){if(jf)return $l;jf=1;var e=Object.defineProperty,t=wt((b,E)=>e(b,"name",{value:E,configurable:!0}),"y");const r=jn(),n=An(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:o,REGEX_NON_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_BACKREF:a,REPLACEMENTS:l}=r,c=t((b,E)=>typeof E.expandRange=="function"?E.expandRange(...b,E):(b.sort(),`[${b.join("-")}]`),"expandRange"),u=t((b,E)=>`Missing ${b}: "${E}" - use "\\\\${E}" to match literal characters`,"syntaxError"),p=t(b=>{const E=[];let h=0,A=0,_=0,O="",k=!1;for(const C of b){if(k===!0){O+=C,k=!1;continue}if(C==="\\"){O+=C,k=!0;continue}if(C==='"'){_=_===1?0:1,O+=C;continue}if(_===0){if(C==="[")h++;else if(C==="]"&&h>0)h--;else if(h===0){if(C==="(")A++;else if(C===")"&&A>0)A--;else if(C==="|"&&A===0){E.push(O),O="";continue}}}O+=C}return E.push(O),E},"splitTopLevel"),f=t(b=>{let E=!1;for(const h of b){if(E===!0){E=!1;continue}if(h==="\\"){E=!0;continue}if(/[?*+@!()[\]{}]/.test(h))return!1}return!0},"isPlainBranch"),d=t(b=>{let E=b.trim(),h=!0;for(;h===!0;)h=!1,/^@\([^\\()[\]{}|]+\)$/.test(E)&&(E=E.slice(2,-1),h=!0);if(f(E))return E.replace(/\\(.)/g,"$1")},"normalizeSimpleBranch"),m=t(b=>{const E=b.map(d).filter(Boolean);for(let h=0;h<E.length;h++)for(let A=h+1;A<E.length;A++){const _=E[h],O=E[A],k=_[0];if(!(!k||_!==k.repeat(_.length)||O!==k.repeat(O.length))&&(_===O||_.startsWith(O)||O.startsWith(_)))return!0}return!1},"hasRepeatedCharPrefixOverlap"),g=t((b,E=!0)=>{if(b[0]!=="+"&&b[0]!=="*"||b[1]!=="(")return;let h=0,A=0,_=0,O=!1;for(let k=1;k<b.length;k++){const C=b[k];if(O===!0){O=!1;continue}if(C==="\\"){O=!0;continue}if(C==='"'){_=_===1?0:1;continue}if(_!==1){if(C==="["){h++;continue}if(C==="]"&&h>0){h--;continue}if(!(h>0)){if(C==="("){A++;continue}if(C===")"&&(A--,A===0))return E===!0&&k!==b.length-1?void 0:{type:b[0],body:b.slice(2,k),end:k}}}}},"parseRepeatedExtglob"),y=t(b=>{let E=0;const h=[];for(;E<b.length;){const A=g(b.slice(E),!1);if(!A||A.type!=="*")return;const _=p(A.body).map(k=>k.trim());if(_.length!==1)return;const O=d(_[0]);if(!O||O.length!==1)return;h.push(O),E+=A.end+1}return h.length<1?void 0:`${h.length===1?n.escapeRegex(h[0]):`[${h.map(A=>n.escapeRegex(A)).join("")}]`}*`},"getStarExtglobSequenceOutput"),x=t(b=>{let E=0,h=b.trim(),A=g(h);for(;A;)E++,h=A.body.trim(),A=g(h);return E},"repeatedExtglobRecursion"),j=t((b,E)=>{if(E.maxExtglobRecursion===!1)return{risky:!1};const h=typeof E.maxExtglobRecursion=="number"?E.maxExtglobRecursion:r.DEFAULT_MAX_EXTGLOB_RECURSION,A=p(b).map(_=>_.trim());if(A.length>1&&(A.some(_=>_==="")||A.some(_=>/^[*?]+$/.test(_))||m(A)))return{risky:!0};for(const _ of A){const O=y(_);if(O)return{risky:!0,safeOutput:O};if(x(_)>h)return{risky:!0}}return{risky:!1}},"analyzeRepeatedExtglob"),R=t((b,E)=>{if(typeof b!="string")throw new TypeError("Expected a string");b=l[b]||b;const h={...E},A=typeof h.maxLength=="number"?Math.min(i,h.maxLength):i;let _=b.length;if(_>A)throw new SyntaxError(`Input length: ${_}, exceeds maximum allowed length: ${A}`);const O={type:"bos",value:"",output:h.prepend||""},k=[O],C=h.capture?"":"?:",B=r.globChars(h.windows),J=r.extglobChars(B),{DOT_LITERAL:q,PLUS_LITERAL:X,SLASH_LITERAL:te,ONE_CHAR:re,DOTS_SLASH:I,NO_DOT:M,NO_DOT_SLASH:K,NO_DOTS_SLASH:F,QMARK:N,QMARK_NO_DOT:W,STAR:V,START_ANCHOR:U}=B,z=t(T=>`(${C}(?:(?!${U}${T.dot?I:q}).)*?)`,"globstar"),Y=h.dot?"":M,L=h.dot?N:W;let D=h.bash===!0?z(h):V;h.capture&&(D=`(${D})`),typeof h.noext=="boolean"&&(h.noextglob=h.noext);const $={input:b,index:-1,start:0,dot:h.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:k};b=n.removePrefix(b,$),_=b.length;const ge=[],pe=[],se=[];let w=O,S;const we=t(()=>$.index===_-1,"eos"),Q=$.peek=(T=1)=>b[$.index+T],ie=$.advance=()=>b[++$.index]||"",ye=t(()=>b.slice($.index+1),"remaining"),$e=t((T="",ee=0)=>{$.consumed+=T,$.index+=ee},"consume"),Te=t(T=>{$.output+=T.output!=null?T.output:T.value,$e(T.value)},"append"),Bt=t(()=>{let T=1;for(;Q()==="!"&&(Q(2)!=="("||Q(3)==="?");)ie(),$.start++,T++;return T%2===0?!1:($.negated=!0,$.start++,!0)},"negate"),it=t(T=>{$[T]++,se.push(T)},"increment"),_e=t(T=>{$[T]--,se.pop()},"decrement"),H=t(T=>{if(w.type==="globstar"){const ee=$.braces>0&&(T.type==="comma"||T.type==="brace"),P=T.extglob===!0||ge.length&&(T.type==="pipe"||T.type==="paren");T.type!=="slash"&&T.type!=="paren"&&!ee&&!P&&($.output=$.output.slice(0,-w.output.length),w.type="star",w.value="*",w.output=D,$.output+=w.output)}if(ge.length&&T.type!=="paren"&&(ge[ge.length-1].inner+=T.value),(T.value||T.output)&&Te(T),w&&w.type==="text"&&T.type==="text"){w.output=(w.output||w.value)+T.value,w.value+=T.value;return}T.prev=w,k.push(T),w=T},"push"),ot=t((T,ee)=>{const P={...J[ee],conditions:1,inner:""};P.prev=w,P.parens=$.parens,P.output=$.output,P.startIndex=$.index,P.tokensIndex=k.length;const G=(h.capture?"(":"")+P.open;it("parens"),H({type:T,value:ee,output:$.output?"":re}),H({type:"paren",extglob:!0,value:ie(),output:G}),ge.push(P)},"extglobOpen"),qn=t(T=>{const ee=b.slice(T.startIndex,$.index+1),P=b.slice(T.startIndex+2,$.index),G=j(P,h);if((T.type==="plus"||T.type==="star")&&G.risky){const Z=G.safeOutput?(T.output?"":re)+(h.capture?`(${G.safeOutput})`:G.safeOutput):void 0,Se=k[T.tokensIndex];Se.type="text",Se.value=ee,Se.output=Z||n.escapeRegex(ee);for(let ke=T.tokensIndex+1;ke<k.length;ke++)k[ke].value="",k[ke].output="",delete k[ke].suffix;$.output=T.output+Se.output,$.backtrack=!0,H({type:"paren",extglob:!0,value:S,output:""}),_e("parens");return}let ne=T.close+(h.capture?")":""),ae;if(T.type==="negate"){let Z=D;if(T.inner&&T.inner.length>1&&T.inner.includes("/")&&(Z=z(h)),(Z!==D||we()||/^\)+$/.test(ye()))&&(ne=T.close=`)$))${Z}`),T.inner.includes("*")&&(ae=ye())&&/^\.[^\\/.]+$/.test(ae)){const Se=R(ae,{...E,fastpaths:!1}).output;ne=T.close=`)${Se})${Z})`}T.prev.type==="bos"&&($.negatedExtglob=!0)}H({type:"paren",extglob:!0,value:S,output:ne}),_e("parens")},"extglobClose");if(h.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(b)){let T=!1,ee=b.replace(a,(P,G,ne,ae,Z,Se)=>ae==="\\"?(T=!0,P):ae==="?"?G?G+ae+(Z?N.repeat(Z.length):""):Se===0?L+(Z?N.repeat(Z.length):""):N.repeat(ne.length):ae==="."?q.repeat(ne.length):ae==="*"?G?G+ae+(Z?D:""):D:G?P:`\\${P}`);return T===!0&&(h.unescape===!0?ee=ee.replace(/\\/g,""):ee=ee.replace(/\\+/g,P=>P.length%2===0?"\\\\":P?"\\":"")),ee===b&&h.contains===!0?($.output=b,$):($.output=n.wrapOutput(ee,$,E),$)}for(;!we();){if(S=ie(),S==="\0")continue;if(S==="\\"){const P=Q();if(P==="/"&&h.bash!==!0||P==="."||P===";")continue;if(!P){S+="\\",H({type:"text",value:S});continue}const G=/^\\+/.exec(ye());let ne=0;if(G&&G[0].length>2&&(ne=G[0].length,$.index+=ne,ne%2!==0&&(S+="\\")),h.unescape===!0?S=ie():S+=ie(),$.brackets===0){H({type:"text",value:S});continue}}if($.brackets>0&&(S!=="]"||w.value==="["||w.value==="[^")){if(h.posix!==!1&&S===":"){const P=w.value.slice(1);if(P.includes("[")&&(w.posix=!0,P.includes(":"))){const G=w.value.lastIndexOf("["),ne=w.value.slice(0,G),ae=w.value.slice(G+2),Z=o[ae];if(Z){w.value=ne+Z,$.backtrack=!0,ie(),!O.output&&k.indexOf(w)===1&&(O.output=re);continue}}}(S==="["&&Q()!==":"||S==="-"&&Q()==="]")&&(S=`\\${S}`),S==="]"&&(w.value==="["||w.value==="[^")&&(S=`\\${S}`),h.posix===!0&&S==="!"&&w.value==="["&&(S="^"),w.value+=S,Te({value:S});continue}if($.quotes===1&&S!=='"'){S=n.escapeRegex(S),w.value+=S,Te({value:S});continue}if(S==='"'){$.quotes=$.quotes===1?0:1,h.keepQuotes===!0&&H({type:"text",value:S});continue}if(S==="("){it("parens"),H({type:"paren",value:S});continue}if(S===")"){if($.parens===0&&h.strictBrackets===!0)throw new SyntaxError(u("opening","("));const P=ge[ge.length-1];if(P&&$.parens===P.parens+1){qn(ge.pop());continue}H({type:"paren",value:S,output:$.parens?")":"\\)"}),_e("parens");continue}if(S==="["){if(h.nobracket===!0||!ye().includes("]")){if(h.nobracket!==!0&&h.strictBrackets===!0)throw new SyntaxError(u("closing","]"));S=`\\${S}`}else it("brackets");H({type:"bracket",value:S});continue}if(S==="]"){if(h.nobracket===!0||w&&w.type==="bracket"&&w.value.length===1){H({type:"text",value:S,output:`\\${S}`});continue}if($.brackets===0){if(h.strictBrackets===!0)throw new SyntaxError(u("opening","["));H({type:"text",value:S,output:`\\${S}`});continue}_e("brackets");const P=w.value.slice(1);if(w.posix!==!0&&P[0]==="^"&&!P.includes("/")&&(S=`/${S}`),w.value+=S,Te({value:S}),h.literalBrackets===!1||n.hasRegexChars(P))continue;const G=n.escapeRegex(w.value);if($.output=$.output.slice(0,-w.value.length),h.literalBrackets===!0){$.output+=G,w.value=G;continue}w.value=`(${C}${G}|${w.value})`,$.output+=w.value;continue}if(S==="{"&&h.nobrace!==!0){it("braces");const P={type:"brace",value:S,output:"(",outputIndex:$.output.length,tokensIndex:$.tokens.length};pe.push(P),H(P);continue}if(S==="}"){const P=pe[pe.length-1];if(h.nobrace===!0||!P){H({type:"text",value:S,output:S});continue}let G=")";if(P.dots===!0){const ne=k.slice(),ae=[];for(let Z=ne.length-1;Z>=0&&(k.pop(),ne[Z].type!=="brace");Z--)ne[Z].type!=="dots"&&ae.unshift(ne[Z].value);G=c(ae,h),$.backtrack=!0}if(P.comma!==!0&&P.dots!==!0){const ne=$.output.slice(0,P.outputIndex),ae=$.tokens.slice(P.tokensIndex);P.value=P.output="\\{",S=G="\\}",$.output=ne;for(const Z of ae)$.output+=Z.output||Z.value}H({type:"brace",value:S,output:G}),_e("braces"),pe.pop();continue}if(S==="|"){ge.length>0&&ge[ge.length-1].conditions++,H({type:"text",value:S});continue}if(S===","){let P=S;const G=pe[pe.length-1];G&&se[se.length-1]==="braces"&&(G.comma=!0,P="|"),H({type:"comma",value:S,output:P});continue}if(S==="/"){if(w.type==="dot"&&$.index===$.start+1){$.start=$.index+1,$.consumed="",$.output="",k.pop(),w=O;continue}H({type:"slash",value:S,output:te});continue}if(S==="."){if($.braces>0&&w.type==="dot"){w.value==="."&&(w.output=q);const P=pe[pe.length-1];w.type="dots",w.output+=S,w.value+=S,P.dots=!0;continue}if($.braces+$.parens===0&&w.type!=="bos"&&w.type!=="slash"){H({type:"text",value:S,output:q});continue}H({type:"dot",value:S,output:q});continue}if(S==="?"){if(!(w&&w.value==="(")&&h.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){ot("qmark",S);continue}if(w&&w.type==="paren"){const P=Q();let G=S;(w.value==="("&&!/[!=<:]/.test(P)||P==="<"&&!/<([!=]|\w+>)/.test(ye()))&&(G=`\\${S}`),H({type:"text",value:S,output:G});continue}if(h.dot!==!0&&(w.type==="slash"||w.type==="bos")){H({type:"qmark",value:S,output:W});continue}H({type:"qmark",value:S,output:N});continue}if(S==="!"){if(h.noextglob!==!0&&Q()==="("&&(Q(2)!=="?"||!/[!=<:]/.test(Q(3)))){ot("negate",S);continue}if(h.nonegate!==!0&&$.index===0){Bt();continue}}if(S==="+"){if(h.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){ot("plus",S);continue}if(w&&w.value==="("||h.regex===!1){H({type:"plus",value:S,output:X});continue}if(w&&(w.type==="bracket"||w.type==="paren"||w.type==="brace")||$.parens>0){H({type:"plus",value:S});continue}H({type:"plus",value:X});continue}if(S==="@"){if(h.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){H({type:"at",extglob:!0,value:S,output:""});continue}H({type:"text",value:S});continue}if(S!=="*"){(S==="$"||S==="^")&&(S=`\\${S}`);const P=s.exec(ye());P&&(S+=P[0],$.index+=P[0].length),H({type:"text",value:S});continue}if(w&&(w.type==="globstar"||w.star===!0)){w.type="star",w.star=!0,w.value+=S,w.output=D,$.backtrack=!0,$.globstar=!0,$e(S);continue}let T=ye();if(h.noextglob!==!0&&/^\([^?]/.test(T)){ot("star",S);continue}if(w.type==="star"){if(h.noglobstar===!0){$e(S);continue}const P=w.prev,G=P.prev,ne=P.type==="slash"||P.type==="bos",ae=G&&(G.type==="star"||G.type==="globstar");if(h.bash===!0&&(!ne||T[0]&&T[0]!=="/")){H({type:"star",value:S,output:""});continue}const Z=$.braces>0&&(P.type==="comma"||P.type==="brace"),Se=ge.length&&(P.type==="pipe"||P.type==="paren");if(!ne&&P.type!=="paren"&&!Z&&!Se){H({type:"star",value:S,output:""});continue}for(;T.slice(0,3)==="/**";){const ke=b[$.index+4];if(ke&&ke!=="/")break;T=T.slice(3),$e("/**",3)}if(P.type==="bos"&&we()){w.type="globstar",w.value+=S,w.output=z(h),$.output=w.output,$.globstar=!0,$e(S);continue}if(P.type==="slash"&&P.prev.type!=="bos"&&!ae&&we()){$.output=$.output.slice(0,-(P.output+w.output).length),P.output=`(?:${P.output}`,w.type="globstar",w.output=z(h)+(h.strictSlashes?")":"|$)"),w.value+=S,$.globstar=!0,$.output+=P.output+w.output,$e(S);continue}if(P.type==="slash"&&P.prev.type!=="bos"&&T[0]==="/"){const ke=T[1]!==void 0?"|$":"";$.output=$.output.slice(0,-(P.output+w.output).length),P.output=`(?:${P.output}`,w.type="globstar",w.output=`${z(h)}${te}|${te}${ke})`,w.value+=S,$.output+=P.output+w.output,$.globstar=!0,$e(S+ie()),H({type:"slash",value:"/",output:""});continue}if(P.type==="bos"&&T[0]==="/"){w.type="globstar",w.value+=S,w.output=`(?:^|${te}|${z(h)}${te})`,$.output=w.output,$.globstar=!0,$e(S+ie()),H({type:"slash",value:"/",output:""});continue}if(Z&&T[0]==="/"){w.type="globstar",w.value+=S,w.output=`(?:^|${te}|${z(h)}${te})`,$.output+=w.output,$.globstar=!0,$e(S+ie()),H({type:"slash",value:"/",output:""});continue}$.output=$.output.slice(0,-w.output.length),w.type="globstar",w.output=z(h),w.value+=S,$.output+=w.output,$.globstar=!0,$e(S);continue}const ee={type:"star",value:S,output:D};if(h.bash===!0){ee.output=".*?",(w.type==="bos"||w.type==="slash")&&(ee.output=Y+ee.output),H(ee);continue}if(w&&(w.type==="bracket"||w.type==="paren")&&h.regex===!0){ee.output=S,H(ee);continue}($.index===$.start||w.type==="slash"||w.type==="dot")&&(w.type==="dot"?($.output+=K,w.output+=K):h.dot===!0?($.output+=F,w.output+=F):($.output+=Y,w.output+=Y),Q()!=="*"&&($.output+=re,w.output+=re)),H(ee)}for(;$.brackets>0;){if(h.strictBrackets===!0)throw new SyntaxError(u("closing","]"));$.output=n.escapeLast($.output,"["),_e("brackets")}for(;$.parens>0;){if(h.strictBrackets===!0)throw new SyntaxError(u("closing",")"));$.output=n.escapeLast($.output,"("),_e("parens")}for(;$.braces>0;){if(h.strictBrackets===!0)throw new SyntaxError(u("closing","}"));$.output=n.escapeLast($.output,"{"),_e("braces")}if(h.strictSlashes!==!0&&(w.type==="star"||w.type==="bracket")&&H({type:"maybe_slash",value:"",output:`${te}?`}),$.backtrack===!0){$.output="";for(const T of $.tokens)$.output+=T.output!=null?T.output:T.value,T.suffix&&($.output+=T.suffix)}return $},"parse");return R.fastpaths=(b,E)=>{const h={...E},A=typeof h.maxLength=="number"?Math.min(i,h.maxLength):i,_=b.length;if(_>A)throw new SyntaxError(`Input length: ${_}, exceeds maximum allowed length: ${A}`);b=l[b]||b;const{DOT_LITERAL:O,SLASH_LITERAL:k,ONE_CHAR:C,DOTS_SLASH:B,NO_DOT:J,NO_DOTS:q,NO_DOTS_SLASH:X,STAR:te,START_ANCHOR:re}=r.globChars(h.windows),I=h.dot?q:J,M=h.dot?X:J,K=h.capture?"":"?:",F={negated:!1,prefix:""};let N=h.bash===!0?".*?":te;h.capture&&(N=`(${N})`);const W=t(Y=>Y.noglobstar===!0?N:`(${K}(?:(?!${re}${Y.dot?B:O}).)*?)`,"globstar"),V=t(Y=>{switch(Y){case"*":return`${I}${C}${N}`;case".*":return`${O}${C}${N}`;case"*.*":return`${I}${N}${O}${C}${N}`;case"*/*":return`${I}${N}${k}${C}${M}${N}`;case"**":return I+W(h);case"**/*":return`(?:${I}${W(h)}${k})?${M}${C}${N}`;case"**/*.*":return`(?:${I}${W(h)}${k})?${M}${N}${O}${C}${N}`;case"**/.*":return`(?:${I}${W(h)}${k})?${O}${C}${N}`;default:{const L=/^(.*?)\.(\w+)$/.exec(Y);if(!L)return;const D=V(L[1]);return D?D+O+L[2]:void 0}}},"create"),U=n.removePrefix(b,F);let z=V(U);return z&&h.strictSlashes!==!0&&(z+=`${k}?`),z},$l=R,$l}v(Tu,"It$5");or(Tu,"Bt");wt(Tu,"requireParse");var xl,Af;function Nu(){if(Af)return xl;Af=1;var e=Object.defineProperty,t=wt((l,c)=>e(l,"name",{value:c,configurable:!0}),"h");const r=Cu(),n=Tu(),i=An(),o=jn(),s=t(l=>l&&typeof l=="object"&&!Array.isArray(l),"isObject"),a=t((l,c,u=!1)=>{if(Array.isArray(l)){const j=l.map(R=>a(R,c,u));return t(R=>{for(const b of j){const E=b(R);if(E)return E}return!1},"arrayMatcher")}const p=s(l)&&l.tokens&&l.input;if(l===""||typeof l!="string"&&!p)throw new TypeError("Expected pattern to be a non-empty string");const f=c||{},d=f.windows,m=p?a.compileRe(l,c):a.makeRe(l,c,!1,!0),g=m.state;delete m.state;let y=t(()=>!1,"isIgnored");if(f.ignore){const j={...c,ignore:null,onMatch:null,onResult:null};y=a(f.ignore,j,u)}const x=t((j,R=!1)=>{const{isMatch:b,match:E,output:h}=a.test(j,m,c,{glob:l,posix:d}),A={glob:l,state:g,regex:m,posix:d,input:j,output:h,match:E,isMatch:b};if(typeof f.onResult=="function"&&f.onResult(A),b===!1)return A.isMatch=!1,R?A:!1;e:if(y(j)){if(typeof f.onIgnore=="function"&&f.onIgnore(A)===o.UNIGNORE){A.isMatch=!0;break e}return A.isMatch=!1,R?A:!1}return typeof f.onMatch=="function"&&f.onMatch(A),R?A:!0},"matcher");return u&&(x.state=g),x},"picomatch");return a.test=(l,c,u,{glob:p,posix:f}={})=>{if(typeof l!="string")throw new TypeError("Expected input to be a string");if(l==="")return{isMatch:!1,output:""};const d=u||{},m=d.format||(f?i.toPosixSlashes:null);let g=l===p,y=g&&m?m(l):l;return g===!1&&(y=m?m(l):l,g=y===p),(g===!1||d.capture===!0)&&(d.matchBase===!0||d.basename===!0?g=a.matchBase(l,c,u,f):g=c.exec(y)),{isMatch:!!g,match:g,output:y}},a.matchBase=(l,c,u)=>(c instanceof RegExp?c:a.makeRe(c,u)).test(i.basename(l)),a.isMatch=(l,c,u)=>a(c,u)(l),a.parse=(l,c)=>Array.isArray(l)?l.map(u=>a.parse(u,c)):n(l,{...c,fastpaths:!1}),a.scan=(l,c)=>r(l,c),a.compileRe=(l,c,u=!1,p=!1)=>{if(u===!0)return l.output;const f=c||{},d=f.contains?"":"^",m=f.contains?"":"$";let g=`${d}(?:${l.output})${m}`;l&&l.negated===!0&&(g=`^(?!${g}).*$`);const y=a.toRegex(g,c);return p===!0&&(y.state=l),y},a.makeRe=(l,c={},u=!1,p=!1)=>{if(!l||typeof l!="string")throw new TypeError("Expected a non-empty string");let f={negated:!1,fastpaths:!0};return c.fastpaths!==!1&&(l[0]==="."||l[0]==="*")&&(f.output=n.fastpaths(l,c)),f.output||(f=n(l,c)),a.compileRe(f,c,u,p)},a.toRegex=(l,c)=>{try{const u=c||{};return new RegExp(l,u.flags||(u.nocase?"i":""))}catch(u){if(c&&c.debug===!0)throw u;return/$^/}},a.constants=o,xl=a,xl}v(Nu,"wt$3");or(Nu,"Gt");wt(Nu,"requirePicomatch$1");var wl,Of;function Iu(){if(Of)return wl;Of=1;var e=Object.defineProperty,t=wt((o,s)=>e(o,"name",{value:s,configurable:!0}),"c");const r=Nu(),n=An();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 v(i,"D"),or(i,"D"),wt(i,"picomatch"),t(i,"picomatch"),Object.assign(i,r),wl=i,wl}v(Iu,"Pt$5");or(Iu,"Mt");wt(Iu,"requirePicomatch");var C0=Iu();const vr=Ji(C0);var T0=Object.defineProperty,me=v((e,t)=>T0(e,"name",{value:t,configurable:!0}),"u$C"),N0=Object.defineProperty,fe=me((e,t)=>N0(e,"name",{value:t,configurable:!0}),"l");const I0=De(import.meta.url),Gn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Vi=fe(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 I0(e)},"__cjs_getBuiltinModule"),Rf=Vi("fs"),M0={...Rf,default:Rf},{statSync:D0,stat:B0,realpathSync:L0,realpath:W0,readdirSync:F0,readdir:H0}=Vi("fs"),{sep:sg,basename:q0,dirname:Jc,resolve:ag,normalize:z0,relative:G0,posix:br,isAbsolute:U0}=Vi("path"),{fileURLToPath:K0}=Vi("url"),{createRequire:J0}=Vi("module");var V0=Object.defineProperty,ce=fe((e,t)=>V0(e,"name",{value:t,configurable:!0}),"r"),_f=J0(import.meta.url);function Ns(e){let t=z0(e);return t.length>1&&t[t.length-1]===sg&&(t=t.substring(0,t.length-1)),t}v(Ns,"H$e");me(Ns,"tt");fe(Ns,"M$1");ce(Ns,"cleanPath");const X0=/[\\/]/g;function Xi(e,t){return e.replace(X0,t)}v(Xi,"M$p");me(Xi,"T");fe(Xi,"D$1");ce(Xi,"convertSlashes");const Y0=/^[a-z]:[\\/]$/i;function Is(e){return e==="/"||Y0.test(e)}v(Is,"J$e");me(Is,"et");fe(Is,"T$1");ce(Is,"isRootDirectory");function tn(e,t){const{resolvePaths:r,normalizePath:n,pathSeparator:i}=t,o=process.platform==="win32"&&e.includes("/")||e.startsWith(".");if(r&&(e=ag(e)),(n||o)&&(e=Ns(e)),e===".")return"";const s=e[e.length-1]!==i;return Xi(s?e+i:e,i)}v(tn,"q$p");me(tn,"q");fe(tn,"w");ce(tn,"normalizePath");function Yi(e,t){return t+e}v(Yi,"B$m");me(Yi,"I");fe(Yi,"P");ce(Yi,"joinPathWithBasePath");function Ms(e,t){return function(r,n){return n.startsWith(e)?n.slice(e.length)+r:Xi(G0(e,n),t.pathSeparator)+t.pathSeparator+r}}v(Ms,"K$d");me(Ms,"st");fe(Ms,"X");ce(Ms,"joinPathWithRelativePath");function Ds(e){return e}v(Ds,"V$d");me(Ds,"rt");fe(Ds,"H");ce(Ds,"joinPath");function Bs(e,t,r){return t+e+r}v(Bs,"X$d");me(Bs,"nt");fe(Bs,"U$1");ce(Bs,"joinDirectoryPath");function Ls(e,t){const{relativePaths:r,includeBasePath:n}=t;return r&&e?Ms(e,t):n?Yi:Ds}v(Ls,"Z$d");me(Ls,"it");fe(Ls,"J");ce(Ls,"build$7");function Ws(e){return function(t,r){r.push(t.substring(e.length)||".")}}v(Ws,"tt$3");me(Ws,"ot");fe(Ws,"K$1");ce(Ws,"pushDirectoryWithRelativePath");function Fs(e){return function(t,r,n){const i=t.substring(e.length)||".";n.every(o=>o(i,!0))&&r.push(i)}}v(Fs,"et$3");me(Fs,"ut");fe(Fs,"V");ce(Fs,"pushDirectoryFilterWithRelativePath");const Q0=ce((e,t)=>{t.push(e||".")},"pushDirectory"),Z0=ce((e,t,r)=>{const n=e||".";r.every(i=>i(n,!0))&&t.push(n)},"pushDirectoryFilter"),ew=ce(()=>{},"empty$2");function Hs(e,t){const{includeDirs:r,filters:n,relativePaths:i}=t;return r?i?n&&n.length?Fs(e):Ws(e):n&&n.length?Z0:Q0:ew}v(Hs,"st$3");me(Hs,"lt");fe(Hs,"st$1");ce(Hs,"build$6");const tw=ce((e,t,r,n)=>{n.every(i=>i(e,!1))&&r.files++},"pushFileFilterAndCount"),rw=ce((e,t,r,n)=>{n.every(i=>i(e,!1))&&t.push(e)},"pushFileFilter"),nw=ce((e,t,r,n)=>{r.files++},"pushFileCount"),iw=ce((e,t)=>{t.push(e)},"pushFile"),ow=ce(()=>{},"empty$1");function qs(e){const{excludeFiles:t,filters:r,onlyCounts:n}=e;return t?ow:r&&r.length?n?tw:rw:n?nw:iw}v(qs,"it$3");me(qs,"at");fe(qs,"ut$1");ce(qs,"build$5");const sw=ce(e=>e,"getArray"),aw=ce(()=>[""].slice(0,0),"getArrayGroup");function zs(e){return e.group?aw:sw}v(zs,"nt$3");me(zs,"ct");fe(zs,"ct$1");ce(zs,"build$4");const lw=ce((e,t,r)=>{e.push({directory:t,files:r,dir:t})},"groupFiles"),cw=ce(()=>{},"empty");function Gs(e){return e.group?lw:cw}v(Gs,"rt$3");me(Gs,"ht");fe(Gs,"ft$1");ce(Gs,"build$3");const uw=ce(function(e,t,r){const{queue:n,fs:i,options:{suppressErrors:o}}=t;n.enqueue(),i.realpath(e,(s,a)=>{if(s)return n.dequeue(o?null:s,t);i.stat(a,(l,c)=>{if(l)return n.dequeue(o?null:l,t);if(c.isDirectory()&&Qi(e,a,t))return n.dequeue(null,t);r(c,a),n.dequeue(null,t)})})},"resolveSymlinksAsync"),pw=ce(function(e,t,r){const{queue:n,fs:i,options:{suppressErrors:o}}=t;n.enqueue();try{const s=i.realpathSync(e),a=i.statSync(s);if(a.isDirectory()&&Qi(e,s,t))return;r(a,s)}catch(s){if(!o)throw s}},"resolveSymlinks");function Us(e,t){return!e.resolveSymlinks||e.excludeSymlinks?null:t?pw:uw}v(Us,"ot$3");me(Us,"pt");fe(Us,"gt$1");ce(Us,"build$2");function Qi(e,t,r){if(r.options.useRealPaths)return Ks(t,r);let n=Jc(e),i=1;for(;n!==r.root&&i<2;){const o=r.symlinks.get(n);o&&(o===t||o.startsWith(t)||t.startsWith(o))?i++:n=Jc(n)}return r.symlinks.set(e,t),i>1}v(Qi,"_$l");me(Qi,"L");fe(Qi,"E$1");ce(Qi,"isRecursive");function Ks(e,t){return t.visited.includes(e+t.options.pathSeparator)}v(Ks,"lt$4");me(Ks,"ft");fe(Ks,"dt$1");ce(Ks,"isRecursiveUsingRealPaths");const fw=ce(e=>e.counts,"onlyCountsSync"),dw=ce(e=>e.groups,"groupsSync"),mw=ce(e=>e.paths,"defaultSync"),hw=ce(e=>e.paths.slice(0,e.options.maxFiles),"limitFilesSync"),gw=ce((e,t,r)=>(_r(t,r,e.counts,e.options.suppressErrors),null),"onlyCountsAsync"),vw=ce((e,t,r)=>(_r(t,r,e.paths,e.options.suppressErrors),null),"defaultAsync"),bw=ce((e,t,r)=>(_r(t,r,e.paths.slice(0,e.options.maxFiles),e.options.suppressErrors),null),"limitFilesAsync"),yw=ce((e,t,r)=>(_r(t,r,e.groups,e.options.suppressErrors),null),"groupsAsync");function _r(e,t,r,n){t(e&&!n?e:null,r)}v(_r,"A$k");me(_r,"j");fe(_r,"y");ce(_r,"report");function Js(e,t){const{onlyCounts:r,group:n,maxFiles:i}=e;return r?t?fw:gw:n?t?dw:yw:i?t?hw:bw:t?mw:vw}v(Js,"at$3");me(Js,"gt");fe(Js,"Et");ce(Js,"build$1");const lg={withFileTypes:!0},$w=ce((e,t,r,n,i)=>{if(e.queue.enqueue(),n<0)return e.queue.dequeue(null,e);const{fs:o}=e;e.visited.push(t),e.counts.directories++,o.readdir(t||".",lg,(s,a=[])=>{i(a,r,n),e.queue.dequeue(e.options.suppressErrors?null:s,e)})},"walkAsync"),xw=ce((e,t,r,n,i)=>{const{fs:o}=e;if(n<0)return;e.visited.push(t),e.counts.directories++;let s=[];try{s=o.readdirSync(t||".",lg)}catch(a){if(!e.options.suppressErrors)throw a}i(s,r,n)},"walkSync");function Vs(e){return e?xw:$w}v(Vs,"ut$3");me(Vs,"yt");fe(Vs,"xt$1");ce(Vs,"build");var ww=class{static{v(this,"De")}static{me(this,"we")}static{fe(this,"_t")}static{ce(this,"Queue")}count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,r){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,r),t&&(r.controller.abort(),this.onQueueEmpty=void 0))}},Ew=class{static{v(this,"Ae")}static{me(this,"$e")}static{fe(this,"At")}static{ce(this,"Counter")}_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},Sw=class{static{v(this,"Ee")}static{me(this,"Se")}static{fe(this,"Wt")}static{ce(this,"Aborter")}aborted=!1;abort(){this.aborted=!0}},cg=class{static{v(this,"Dt")}static{me(this,"mt")}static{fe(this,"q")}static{ce(this,"Walker")}root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,r,n){this.isSynchronous=!n,this.callbackInvoker=Js(r,this.isSynchronous),this.root=tn(t,r),this.state={root:Is(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new Ew,options:r,queue:new ww((i,o)=>this.callbackInvoker(o,i,n)),symlinks:new Map,visited:[""].slice(0,0),controller:new Sw,fs:r.fs||M0},this.joinPath=Ls(this.root,r),this.pushDirectory=Hs(this.root,r),this.pushFile=qs(r),this.getArray=zs(r),this.groupFiles=Gs(r),this.resolveSymlink=Us(r,this.isSynchronous),this.walkDirectory=Vs(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=ce((t,r,n)=>{const{paths:i,options:{filters:o,resolveSymlinks:s,excludeSymlinks:a,exclude:l,maxFiles:c,signal:u,useRealPaths:p,pathSeparator:f},controller:d}=this.state;if(d.aborted||u&&u.aborted||c&&i.length>c)return;const m=this.getArray(this.state.paths);for(let g=0;g<t.length;++g){const y=t[g];if(y.isFile()||y.isSymbolicLink()&&!s&&!a){const x=this.joinPath(y.name,r);this.pushFile(x,m,this.state.counts,o)}else if(y.isDirectory()){let x=Bs(y.name,r,this.state.options.pathSeparator);if(l&&l(y.name,x))continue;this.pushDirectory(x,i,o),this.walkDirectory(this.state,x,x,n-1,this.walk)}else if(this.resolveSymlink&&y.isSymbolicLink()){let x=Yi(y.name,r);this.resolveSymlink(x,this.state,(j,R)=>{if(j.isDirectory()){if(R=tn(R,this.state.options),l&&l(y.name,p?R:x+f))return;this.walkDirectory(this.state,R,p?R:x+f,n-1,this.walk)}else{R=p?R:x;const b=q0(R),E=tn(Jc(R),this.state.options);R=this.joinPath(b,E),this.pushFile(R,m,this.state.counts,o)}})}}this.groupFiles(this.state.groups,r,m)},"walk")};function Xs(e,t){return new Promise((r,n)=>{Zi(e,t,(i,o)=>{if(i)return n(i);r(o)})})}v(Xs,"ct$2");me(Xs,"bt");fe(Xs,"Ct");ce(Xs,"promise");function Zi(e,t,r){new cg(e,t,r).start()}v(Zi,"T$o");me(Zi,"G");fe(Zi,"x");ce(Zi,"callback");function Ys(e,t){return new cg(e,t).start()}v(Ys,"ht$3");me(Ys,"vt");fe(Ys,"jt");ce(Ys,"sync");var Pf=class{static{v(this,"kt")}static{me(this,"J")}static{fe(this,"F")}static{ce(this,"APIBuilder")}constructor(t,r){this.root=t,this.options=r}withPromise(){return Xs(this.root,this.options)}withCallback(t){Zi(this.root,this.options,t)}sync(){return Ys(this.root,this.options)}};let ug=null;try{_f.resolve("picomatch"),ug=_f("picomatch")}catch{}var kw=class{static{v(this,"We")}static{me(this,"ke")}static{fe(this,"$t")}static{ce(this,"Builder")}globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:sg,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new Pf(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,r){return this.options={...this.options,...r},new Pf(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...r){const n=this.globFunction||ug;if(!n)throw new Error("Please specify a glob function to use glob matching.");var i=this.globCache[t.join("\0")];return i||(i=n(t,...r),this.globCache[t.join("\0")]=i),this.options.filters.push(o=>i(o)),this}},jw=Object.defineProperty,We=fe((e,t)=>jw(e,"name",{value:t,configurable:!0}),"a");const Aw=Array.isArray,pg=/\\/g,fg=process.platform==="win32",Ow=/^(\/?\.\.)+$/;function Pi(e,t={}){const r=e.length,n=Array(r),i=Array(r);let o,s;for(o=0;o<r;o++){const a=eo(e[o]);n[o]=a;const l=a.length,c=Array(l);for(s=0;s<l;s++)c[s]=vr(a[s],t);i[o]=c}return a=>{const l=a.split("/");if(l[0]===".."&&Ow.test(a))return!0;for(o=0;o<r;o++){const c=n[o],u=i[o],p=l.length,f=Math.min(p,c.length);for(s=0;s<f;){const d=c[s];if(d.includes("/"))return!0;if(!u[s](l[s]))break;if(!t.noglobstar&&d==="**")return!0;s++}if(s===p)return!0}return!1}}v(Pi,"R$l");me(Pi,"B");fe(Pi,"D");We(Pi,"getPartialMatcher");const Rw=/^[A-Z]:\/$/i,_w=fg?e=>Rw.test(e):e=>e==="/";function Ci(e,t,r){if(e===t||t.startsWith(`${e}/`)){if(r){const i=e.length+ +!_w(e);return(o,s)=>o.slice(i,s?-1:void 0)||"."}const n=t.slice(e.length+1);return n?(i,o)=>{if(i===".")return n;const s=`${n}/${i}`;return o?s.slice(0,-1):s}:(i,o)=>o&&i!=="."?i.slice(0,-1):i}return r?n=>br.relative(e,n)||".":n=>br.relative(e,`${t}/${n}`)||"."}v(Ci,"O$s");me(Ci,"M");fe(Ci,"M");We(Ci,"buildFormat");function Qs(e,t){if(t.startsWith(`${e}/`)){const r=t.slice(e.length+1);return n=>`${r}/${n}`}return r=>{const n=br.relative(e,`${t}/${r}`);return r[r.length-1]==="/"&&n!==""?`${n}/`:n||"."}}v(Qs,"pt$3");me(Qs,"St");fe(Qs,"at");We(Qs,"buildRelative");const Pw={parts:!0};function eo(e){var t;const r=vr.scan(e,Pw);return!((t=r.parts)===null||t===void 0)&&t.length?r.parts:[e]}v(eo,"I$e");me(eo,"z");fe(eo,"N");We(eo,"splitPattern");const Cw=/\\(?![()[\]{}!+@])/g;function Mu(e){return dg(e)}v(Mu,"qt$2");me(Mu,"Ee");fe(Mu,"ut");We(Mu,"convertPosixPathToPattern");function Du(e){return mg(e).replace(Cw,"/")}v(Du,"jt$3");me(Du,"Re");fe(Du,"ft");We(Du,"convertWin32PathToPattern");const Tw=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,Nw=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,dg=We(e=>e.replace(Tw,"\\$&"),"escapePosixPath"),mg=We(e=>e.replace(Nw,"\\$&"),"escapeWin32Path"),Iw=fg?mg:dg;function Zs(e,t){if(t?.caseSensitiveMatch===!1)return!0;const r=vr.scan(e);return r.isGlob||r.negated}v(Zs,"ft$2");me(Zs,"Dt");fe(Zs,"k");We(Zs,"isDynamicPattern");function Xt(...e){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...e)}v(Xt,"D$l");me(Xt,"D");fe(Xt,"E");We(Xt,"log");function to(e){return typeof e=="string"?[e]:e??[]}v(to,"L$e");me(to,"U");fe(to,"W");We(to,"ensureStringArray");const Mw=/^(\/?\.\.)+/,Dw=/\\(?=[()[\]{}!*+?@|])/g;function rn(e,t,r,n){var i;const o=t.cwd;let s=e;e[e.length-1]==="/"&&(s=e.slice(0,-1));const a=s.lastIndexOf("/"),l=(a===-1?s:s.slice(a+1)).startsWith("!(");s[s.length-1]!=="*"&&!l&&t.expandDirectories&&(s+="/**");const c=Iw(o);s=U0(s.replace(Dw,""))?br.relative(c,s):br.normalize(s);const u=(i=Mw.exec(s))===null||i===void 0?void 0:i[0],p=eo(s);if(u){const d=(u.length+1)/3;let m=0;const g=c.split("/");for(;m<d&&p[m+d]===g[g.length+m-d];)s=s.slice(0,(d-m-1)*3)+s.slice((d-m)*3+p[m+d].length+1)||".",m++;const y=br.join(o,u.slice(m*3));y[0]!=="."&&r.root.length>y.length&&(r.root=y,r.depthOffset=-d+m)}if(!n&&r.depthOffset>=0){var f;(f=r.commonPath)!==null&&f!==void 0||(r.commonPath=p);const d=[],m=Math.min(r.commonPath.length,p.length);for(let g=0;g<m;g++){const y=p[g];if(y==="**"&&!p[g+1]){d.pop();break}if(g===p.length-1||y!==r.commonPath[g]||Zs(y))break;d.push(y)}r.depthOffset=d.length,r.commonPath=d,r.root=d.length>0?br.join(o,...d):o}return s}v(rn,"j$r");me(rn,"E");fe(rn,"$");We(rn,"normalizePattern");function ea(e,t,r){const n=[],i=[],o=[];for(const s of e.ignore)s&&(s[0]!=="!"||s[1]==="("?i.push(rn(s,e,r,!0)):o.push(s.slice(1)));for(const s of t)s&&(s[0]!=="!"||s[1]==="("?n.push(rn(s,e,r,!1)):(s[1]!=="!"||s[2]==="(")&&i.push(rn(s.slice(1),e,r,!0)));return{match:n,ignore:i,unignore:o}}v(ea,"gt$3");me(ea,"xt");fe(ea,"St");We(ea,"processPatterns");function ta(e,t){const r=e.cwd,n={root:r,depthOffset:0},i=ea(e,t,n);e.debug&&Xt("internal processing patterns:",i);const{absolute:o,caseSensitiveMatch:s,debug:a,dot:l,followSymbolicLinks:c,onlyDirectories:u}=e,p=n.root.replace(pg,""),f={dot:l,nobrace:e.braceExpansion===!1,nocase:!s,noextglob:e.extglob===!1,noglobstar:e.globstar===!1,posix:!0},d=i.unignore.length>0,m=d?vr(i.unignore,f):void 0,g=d?Pi(i.unignore,f):void 0,y=vr(i.match,{...f,ignore:i.ignore,onIgnore:m?O=>m(O.output)&&vr.constants.UNIGNORE:void 0}),x=vr(i.ignore,f),j=Pi(i.match,f),R=Ci(r,p,o),b=o?R:Ci(r,p,!0),E=i.match.length>0&&i.match.every(O=>O==="**"||O==="**/*"),h=i.ignore.length>0||d||!E?(O,k)=>{const C=b(k,!0);return C==="."||g&&g(C)?!1:!j(C)||x(C)}:void 0;let A;e.deep!==void 0&&(A=Math.round(e.deep-n.depthOffset));const _=new kw({filters:[a?(O,k)=>{const C=R(O,k),B=y(C);return B&&Xt(`matched ${C}`),B}:(O,k)=>{const C=R(O,k);return y(C)}],exclude:a&&h?(O,k)=>{const C=h(O,k);return Xt(`${C?"skipped":"crawling"} ${k}`),C}:h,fs:e.fs,pathSeparator:"/",relativePaths:!o,resolvePaths:o,includeBasePath:o,resolveSymlinks:c,excludeSymlinks:!c,excludeFiles:u,includeDirs:u||!e.onlyFiles,maxDepth:A,signal:e.signal}).crawl(p);return e.debug&&Xt("internal properties:",{...n,root:p}),[_,r!==p&&!o&&Qs(r,p)]}v(ta,"dt$3");me(ta,"At");fe(ta,"vt");We(ta,"buildCrawler");function ro(e,t){if(t)for(let r=e.length-1;r>=0;r--)e[r]=t(e[r]);return e}v(ro,"z$h");me(ro,"N");fe(ro,"U");We(ro,"formatPaths");const Bw={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function ra(e){const t={...Bw,...e};return t.cwd=(t.cwd instanceof URL?K0(t.cwd):ag(t.cwd)).replace(pg,"/"),t.ignore=to(t.ignore),t.fs&&(t.fs={readdir:t.fs.readdir||H0,readdirSync:t.fs.readdirSync||F0,realpath:t.fs.realpath||W0,realpathSync:t.fs.realpathSync||L0,stat:t.fs.stat||B0,statSync:t.fs.statSync||D0}),t.debug&&Xt("globbing with options:",t),t}v(ra,"yt$3");me(ra,"_t");fe(ra,"pt");We(ra,"getOptions");function no(e,t={}){var r;if(e&&t?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");const n=Aw(e)||typeof e=="string",i=to((r=n?e:e.patterns)!==null&&r!==void 0?r:"**/*"),o=ra(n?t:e);return i.length>0?ta(o,i):[]}v(no,"G$j");me(no,"Q");fe(no,"G");We(no,"getCrawler");async function na(e,t){const[r,n]=no(e,t);return r?ro(await r.withPromise(),n):[]}v(na,"mt$4");me(na,"Ie");fe(na,"bt");We(na,"glob");function Bu(e,t){const[r,n]=no(e,t);return r?ro(r.sync(),n):[]}v(Bu,"vt$4");me(Bu,"Le");fe(Bu,"xt");We(Bu,"globSync");var Lw=Object.defineProperty,Ww=v((e,t)=>Lw(e,"name",{value:t,configurable:!0}),"r$d"),Fw=Object.defineProperty,Hw=Ww((e,t)=>Fw(e,"name",{value:t,configurable:!0}),"r"),qw=Object.defineProperty,zw=Hw((e,t)=>qw(e,"name",{value:t,configurable:!0}),"r");const Gw=zw(async(e,t)=>await na(e,t),"glob");var Uw=Object.defineProperty,Lu=v((e,t)=>Uw(e,"name",{value:t,configurable:!0}),"o$r"),Kw=Object.defineProperty,ia=Lu((e,t)=>Kw(e,"name",{value:t,configurable:!0}),"c"),El,Cf;function Wu(){if(Cf)return El;Cf=1;var e=Object.defineProperty,t=ia((r,n)=>e(r,"name",{value:n,configurable:!0}),"l");/*!
6
- * is-extglob <https://github.com/jonschlinkert/is-extglob>
7
- *
8
- * Copyright (c) 2014-2016, Jon Schlinkert.
9
- * Licensed under the MIT License.
10
- */return El=t(function(r){if(typeof r!="string"||r==="")return!1;for(var n;n=/(\\).|([@?!+*]\(.*\))/g.exec(r);){if(n[2])return!0;r=r.slice(n.index+n[0].length)}return!1},"isExtglob"),El}v(Wu,"h$n");Lu(Wu,"q");ia(Wu,"requireIsExtglob");var Sl,Tf;function Fu(){if(Tf)return Sl;Tf=1;var e=Object.defineProperty,t=ia((s,a)=>e(s,"name",{value:a,configurable:!0}),"x");/*!
11
- * is-glob <https://github.com/jonschlinkert/is-glob>
12
- *
13
- * Copyright (c) 2014-2017, Jon Schlinkert.
14
- * Released under the MIT License.
15
- */var r=Wu(),n={"{":"}","(":")","[":"]"},i=t(function(s){if(s[0]==="!")return!0;for(var a=0,l=-2,c=-2,u=-2,p=-2,f=-2;a<s.length;){if(s[a]==="*"||s[a+1]==="?"&&/[\].+)]/.test(s[a])||c!==-1&&s[a]==="["&&s[a+1]!=="]"&&(c<a&&(c=s.indexOf("]",a)),c>a&&(f===-1||f>c||(f=s.indexOf("\\",a),f===-1||f>c)))||u!==-1&&s[a]==="{"&&s[a+1]!=="}"&&(u=s.indexOf("}",a),u>a&&(f=s.indexOf("\\",a),f===-1||f>u))||p!==-1&&s[a]==="("&&s[a+1]==="?"&&/[:!=]/.test(s[a+2])&&s[a+3]!==")"&&(p=s.indexOf(")",a),p>a&&(f=s.indexOf("\\",a),f===-1||f>p))||l!==-1&&s[a]==="("&&s[a+1]!=="|"&&(l<a&&(l=s.indexOf("|",a)),l!==-1&&s[l+1]!==")"&&(p=s.indexOf(")",l),p>l&&(f=s.indexOf("\\",l),f===-1||f>p))))return!0;if(s[a]==="\\"){var d=s[a+1];a+=2;var m=n[d];if(m){var g=s.indexOf(m,a);g!==-1&&(a=g+1)}if(s[a]==="!")return!0}else a++}return!1},"strictCheck"),o=t(function(s){if(s[0]==="!")return!0;for(var a=0;a<s.length;){if(/[*?{}()[\]]/.test(s[a]))return!0;if(s[a]==="\\"){var l=s[a+1];a+=2;var c=n[l];if(c){var u=s.indexOf(c,a);u!==-1&&(a=u+1)}if(s[a]==="!")return!0}else a++}return!1},"relaxedCheck");return Sl=t(function(s,a){if(typeof s!="string"||s==="")return!1;if(r(s))return!0;var l=i;return a&&a.strict===!1&&(l=o),l(s)},"isGlob"),Sl}v(Fu,"y$r");Lu(Fu,"G");ia(Fu,"requireIsGlob");var Jw=Object.defineProperty,ps=v((e,t)=>Jw(e,"name",{value:t,configurable:!0}),"s$B"),Vw=Object.defineProperty,nn=ps((e,t)=>Vw(e,"name",{value:t,configurable:!0}),"t");const Xw=De(import.meta.url),Un=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,hg=nn(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 Xw(e)},"__cjs_getBuiltinModule"),Yw=hg("path"),Qw=hg("os");var kl,Nf;function Hu(){if(Nf)return kl;Nf=1;var e=Object.defineProperty,t=nn((u,p)=>e(u,"name",{value:p,configurable:!0}),"n"),r=Fu(),n=Yw.posix.dirname,i=Qw.platform()==="win32",o="/",s=/\\/g,a=/\\([!*?|[\](){}])/g;kl=t(function(u,p){var f=Object.assign({flipBackslashes:!0},p);f.flipBackslashes&&i&&u.indexOf(o)<0&&(u=u.replace(s,o)),l(u)&&(u+=o),u+="a";do u=n(u);while(c(u));return u.replace(a,"$1")},"globParent");function l(u){var p=u.slice(-1),f;switch(p){case"}":f="{";break;case"]":f="[";break;default:return!1}var d=u.indexOf(f);return d<0?!1:u.slice(d+1,-1).includes(o)}v(l,"c"),ps(l,"c"),nn(l,"isEnclosure"),t(l,"isEnclosure");function c(u){return/\([^()]+$/.test(u)||u[0]==="{"||u[0]==="["||/[^\\][{[]/.test(u)?!0:r(u)}return v(c,"f"),ps(c,"f"),nn(c,"isGlobby"),t(c,"isGlobby"),kl}v(Hu,"d$E");ps(Hu,"$");nn(Hu,"requireGlobParent");var Zw=Hu();const e1=Ji(Zw);var t1=Object.defineProperty,r1=nn((e,t)=>t1(e,"name",{value:t,configurable:!0}),"e");const n1=r1((e,t)=>e1(e,t),"globParent");var i1=Object.defineProperty,o1=v((e,t)=>i1(e,"name",{value:t,configurable:!0}),"i$n"),s1=Object.defineProperty,a1=o1((e,t)=>s1(e,"name",{value:t,configurable:!0}),"r"),l1=Object.defineProperty,c1=a1((e,t)=>l1(e,"name",{value:t,configurable:!0}),"i");const If=c1(e=>{if(e.isFile())return"file";if(e.isDirectory())return"dir";if(e.isSymbolicLink())return"symlink"},"getFileInfoType");var u1=Object.defineProperty,p1=v((e,t)=>u1(e,"name",{value:t,configurable:!0}),"i$m"),f1=Object.defineProperty,gg=p1((e,t)=>f1(e,"name",{value:t,configurable:!0}),"s");const d1=De(import.meta.url),Kn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,m1=gg(e=>{if(typeof Kn<"u"&&Kn.versions&&Kn.versions.node){const[t,r]=Kn.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Kn.getBuiltinModule(e)}return d1(e)},"__cjs_getBuiltinModule"),{lstatSync:Mf,mkdirSync:h1}=m1("node:fs");var g1=Object.defineProperty,v1=gg((e,t)=>g1(e,"name",{value:t,configurable:!0}),"o");const b1=v1(e=>{Rr(e);try{const t=Mf(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(If(t))}'`);return}catch(t){if(t.code!=="ENOENT")throw t}try{h1(e,{recursive:!0})}catch(t){if(t.code!=="EEXIST")throw t;const r=Mf(e);if(!r.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(If(r))}'`,{cause:t})}},"ensureDirSync");var y1=Object.defineProperty,vg=v((e,t)=>y1(e,"name",{value:t,configurable:!0}),"t$j"),$1=Object.defineProperty,bg=vg((e,t)=>$1(e,"name",{value:t,configurable:!0}),"t"),x1=Object.defineProperty,w1=bg((e,t)=>x1(e,"name",{value:t,configurable:!0}),"t");let fs=class extends Error{static{v(this,"l")}static{vg(this,"c")}static{bg(this,"i")}static{w1(this,"WalkError")}root;constructor(t,r){super(`${t instanceof Error?t.message:String(t)} for path "${r}"`),this.cause=t,this.root=r}get name(){return"WalkError"}set name(t){throw new Error("Cannot overwrite name of WalkError")}};var E1=Object.defineProperty,S1=v((e,t)=>E1(e,"name",{value:t,configurable:!0}),"n$o"),k1=Object.defineProperty,yg=S1((e,t)=>k1(e,"name",{value:t,configurable:!0}),"t"),j1=Object.defineProperty,A1=yg((e,t)=>j1(e,"name",{value:t,configurable:!0}),"g");const ds=A1(e=>{const t=e.replace(/\.\*/g,".([^/]*)").replace(/\*\*/g,"(.*)").replace(/(?<!\.)\*(?!\*)/g,"([^/]*)").replace(/\?/g,"[^/]").replace(/\.(?!\*)/g,String.raw`\.`).replace(/\{/g,"(").replace(/\}/g,")").replace(/,/g,"|").replace(/\[!(.*?)\]/g,"[^$1]");return new RegExp(`^${t}$`)},"globToRegExp");var O1=Object.defineProperty,R1=yg((e,t)=>O1(e,"name",{value:t,configurable:!0}),"n");const Yt=R1((e,t,r,n)=>Array.isArray(t)&&t.length>0&&!t.some(i=>e.endsWith(i))||r&&!r.some(i=>i.test(e))?!1:!n?.some(i=>i.test(e)),"walkInclude");var _1=Object.defineProperty,$g=v((e,t)=>_1(e,"name",{value:t,configurable:!0}),"u$z"),P1=Object.defineProperty,qu=$g((e,t)=>P1(e,"name",{value:t,configurable:!0}),"y");const C1=De(import.meta.url),Jn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,T1=qu(e=>{if(typeof Jn<"u"&&Jn.versions&&Jn.versions.node){const[t,r]=Jn.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Jn.getBuiltinModule(e)}return C1(e)},"__cjs_getBuiltinModule"),{readdir:N1,realpath:I1,stat:M1}=T1("node:fs/promises");var D1=Object.defineProperty,vt=qu((e,t)=>D1(e,"name",{value:t,configurable:!0}),"r");const B1=vt(async e=>{const t=hn(e),r=xt(t),n=await M1(t);return{isDirectory:vt(()=>n.isDirectory(),"isDirectory"),isFile:vt(()=>n.isFile(),"isFile"),isSymbolicLink:vt(()=>n.isSymbolicLink(),"isSymbolicLink"),name:r,path:t}},"_createWalkEntry");async function*io(e,{extensions:t,followSymlinks:r=!1,includeDirs:n=!0,includeFiles:i=!0,includeSymlinks:o=!0,match:s,maxDepth:a=Number.POSITIVE_INFINITY,skip:l}={}){if(Rr(e),a<0)return;const c=s?s.map(p=>typeof p=="string"?ds(p):p):void 0,u=l?l.map(p=>typeof p=="string"?ds(p):p):void 0;if(e=ve(Je(e)),n&&Yt(e,t,c,u)&&(yield await B1(e)),!(a<1||!Yt(e,void 0,void 0,u)))try{const p=await N1(e,{withFileTypes:!0});for(const f of p){let d=le(e,f.name);if(f.isSymbolicLink())if(r)d=await I1(d);else if(o&&Yt(d,t,c,u)){yield{isDirectory:vt(()=>f.isDirectory(),"isDirectory"),isFile:vt(()=>f.isFile(),"isFile"),isSymbolicLink:vt(()=>f.isSymbolicLink(),"isSymbolicLink"),name:f.name,path:d};continue}else continue;f.isDirectory()?yield*io(d,{extensions:t,followSymlinks:r,includeDirs:n,includeFiles:i,includeSymlinks:o,match:c,maxDepth:a-1,skip:u}):f.isFile()&&i&&Yt(d,t,c,u)&&(yield{isDirectory:vt(()=>f.isDirectory(),"isDirectory"),isFile:vt(()=>f.isFile(),"isFile"),isSymbolicLink:vt(()=>f.isSymbolicLink(),"isSymbolicLink"),name:f.name,path:d})}}catch(p){throw p instanceof fs?p:new fs(p,e)}}v(io,"f$t");$g(io,"D");qu(io,"g");vt(io,"walk");var L1=Object.defineProperty,xg=v((e,t)=>L1(e,"name",{value:t,configurable:!0}),"p$t"),W1=Object.defineProperty,zu=xg((e,t)=>W1(e,"name",{value:t,configurable:!0}),"m");const F1=De(import.meta.url),Vn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,H1=zu(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 F1(e)},"__cjs_getBuiltinModule"),{readdirSync:q1,realpathSync:z1,statSync:G1}=H1("node:fs");var U1=Object.defineProperty,bt=zu((e,t)=>U1(e,"name",{value:t,configurable:!0}),"t");const K1=bt(e=>{const t=hn(e),r=G1(t);return{isDirectory:bt(()=>r.isDirectory(),"isDirectory"),isFile:bt(()=>r.isFile(),"isFile"),isSymbolicLink:bt(()=>r.isSymbolicLink(),"isSymbolicLink"),name:xt(t),path:t}},"_createWalkEntry");function*oo(e,{extensions:t,followSymlinks:r=!1,includeDirs:n=!0,includeFiles:i=!0,includeSymlinks:o=!0,match:s,maxDepth:a=Number.POSITIVE_INFINITY,skip:l}={}){if(Rr(e),a<0)return;const c=s?s.map(p=>typeof p=="string"?ds(p):p):void 0,u=l?l.map(p=>typeof p=="string"?ds(p):p):void 0;if(e=ve(Je(e)),n&&Yt(e,t,c,u)&&(yield K1(e)),!(a<1||!Yt(e,void 0,void 0,u)))try{const p=q1(e,{withFileTypes:!0});for(const f of p){let d=le(e,f.name);if(f.isSymbolicLink())if(r)d=z1(d);else if(o&&Yt(d,t,c,u)){yield{isDirectory:bt(()=>f.isDirectory(),"isDirectory"),isFile:bt(()=>f.isFile(),"isFile"),isSymbolicLink:bt(()=>f.isSymbolicLink(),"isSymbolicLink"),name:f.name,path:hn(d)};continue}else continue;f.isDirectory()?yield*oo(d,{extensions:t,followSymlinks:r,includeDirs:n,includeFiles:i,includeSymlinks:o,match:c,maxDepth:a-1,skip:u}):f.isFile()&&i&&Yt(d,t,c,u)&&(yield{isDirectory:bt(()=>f.isDirectory(),"isDirectory"),isFile:bt(()=>f.isFile(),"isFile"),isSymbolicLink:bt(()=>f.isSymbolicLink(),"isSymbolicLink"),name:f.name,path:hn(d)})}}catch(p){throw p instanceof fs?p:new fs(p,e)}}v(oo,"y$p");xg(oo,"F");zu(oo,"b");bt(oo,"walkSync");var J1=Object.defineProperty,V1=v((e,t)=>J1(e,"name",{value:t,configurable:!0}),"t$h"),X1=Object.defineProperty,Y1=V1((e,t)=>X1(e,"name",{value:t,configurable:!0}),"s"),Q1=Object.defineProperty,Z1=Y1((e,t)=>Q1(e,"name",{value:t,configurable:!0}),"n");const Df=Z1((e,t={})=>{Array.isArray(t.extensions)||(t.extensions=["js","mjs","cjs","ts"]);const r=[];for(const n of oo(e,t))r.push(n.path);return r},"collectSync");var eE=Object.defineProperty,tE=v((e,t)=>eE(e,"name",{value:t,configurable:!0}),"p$s"),rE=Object.defineProperty,wg=tE((e,t)=>rE(e,"name",{value:t,configurable:!0}),"a");const nE=De(import.meta.url),Xn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Eg=wg(e=>{if(typeof Xn<"u"&&Xn.versions&&Xn.versions.node){const[t,r]=Xn.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Xn.getBuiltinModule(e)}return nE(e)},"__cjs_getBuiltinModule"),{stat:iE,lstat:oE}=Eg("node:fs/promises"),{fileURLToPath:sE}=Eg("node:url");var aE=Object.defineProperty,Bf=wg((e,t)=>aE(e,"name",{value:t,configurable:!0}),"n");const Sg=Bf(async(e,t={})=>{if(typeof e!="string"&&!Array.isArray(e)&&typeof e!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const r=t.cwd?Je(t.cwd):process.cwd();let n=ve(r);const{root:i}=Nh(n),o=Je(t.stopAt??i),s=ve(n,o),a=t.type??"file",l=Bf(async function(u){return typeof e=="function"?[await e(u)]:typeof e=="string"?[e]:Array.isArray(e)?e:[e]},"getMatchers");t.allowSymlinks??=!0;const c=t.allowSymlinks?iE:oE;for(;n&&n!==s&&n!==i;){const u=await l(n);for(let p of u){if(p===_h)return;if(p===void 0)continue;Buffer.isBuffer(p)?p=p.toString():p instanceof URL&&(p=sE(p));const f=Gi(p)?p:ve(n,p);try{const d=await c(f);if(a==="file"&&d.isFile()||a==="directory"&&d.isDirectory())return f}catch{}}n=Ce(n)}},"findUp");var lE=Object.defineProperty,cE=v((e,t)=>lE(e,"name",{value:t,configurable:!0}),"u$x"),uE=Object.defineProperty,kg=cE((e,t)=>uE(e,"name",{value:t,configurable:!0}),"i");const pE=De(import.meta.url),Yn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,jg=kg(e=>{if(typeof Yn<"u"&&Yn.versions&&Yn.versions.node){const[t,r]=Yn.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Yn.getBuiltinModule(e)}return pE(e)},"__cjs_getBuiltinModule"),{statSync:fE,lstatSync:dE}=jg("node:fs"),{fileURLToPath:mE}=jg("node:url");var hE=Object.defineProperty,Lf=kg((e,t)=>hE(e,"name",{value:t,configurable:!0}),"o");const Ag=Lf((e,t={})=>{if(typeof e!="string"&&!Array.isArray(e)&&typeof e!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const r=t.cwd?Je(t.cwd):process.cwd();let n=ve(r);const{root:i}=Nh(n),o=Je(t.stopAt??i),s=ve(n,o),a=t.type??"file",l=Lf(function(u){return typeof e=="function"?[e(u)]:typeof e=="string"?[e]:Array.isArray(e)?e:[e]},"getMatchers");t.allowSymlinks??=!0;const c=t.allowSymlinks?fE:dE;for(;n&&n!==s&&n!==i;){for(let u of l(n)){if(u===_h)return;if(u===void 0)continue;Buffer.isBuffer(u)?u=u.toString():u instanceof URL&&(u=mE(u));const p=Gi(u)?u:ve(n,u);try{const f=c(p);if(a==="file"&&f.isFile()||a==="directory"&&f.isDirectory())return p}catch{}}n=Ce(n)}},"findUpSync");var gE=Object.defineProperty,On=v((e,t)=>gE(e,"name",{value:t,configurable:!0}),"r$a"),vE=Object.defineProperty,Rn=On((e,t)=>vE(e,"name",{value:t,configurable:!0}),"r"),bE=Object.defineProperty,bn=Rn((e,t)=>bE(e,"name",{value:t,configurable:!0}),"t");function so(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}v(so,"p$r");On(so,"f");Rn(so,"getDefaultExportFromCjs");bn(so,"getDefaultExportFromCjs");function Gu(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}v(Gu,"f$s");On(Gu,"l");Rn(Gu,"getDefaultExportFromNamespaceIfPresent");bn(Gu,"getDefaultExportFromNamespaceIfPresent");function Uu(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")&&Object.keys(e).length===1?e.default:e}v(Uu,"l$w");On(Uu,"s");Rn(Uu,"getDefaultExportFromNamespaceIfNotNamed");bn(Uu,"getDefaultExportFromNamespaceIfNotNamed");function Ku(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=bn(Rn(On(v(function n(){var i=!1;try{i=this instanceof n}catch{}return i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)},"u"),"n"),"a"),"a");r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:bn(function(){return e[n]},"get")})}),r}v(Ku,"s$v");On(Ku,"m");Rn(Ku,"getAugmentedNamespace");bn(Ku,"getAugmentedNamespace");var yE=Object.defineProperty,sr=v((e,t)=>yE(e,"name",{value:t,configurable:!0}),"lt$3"),$E=Object.defineProperty,Et=sr((e,t)=>$E(e,"name",{value:t,configurable:!0}),"ut"),Wf={},jl,Ff;function _n(){if(Ff)return jl;Ff=1;const e="[^\\\\/]",t=Symbol("unignore"),r="\\.",n="\\+",i="\\?",o="\\/",s="(?=.)",a="[^/]",l=`(?:${o}|$)`,c=`(?:^|${o})`,u=`${r}{1,2}${l}`,p=`(?!${r})`,f=`(?!${c}${u})`,d=`(?!${r}{0,1}${l})`,m=`(?!${u})`,g=`[^.${o}]`,y=`${a}*?`,x="/",j={DOT_LITERAL:r,PLUS_LITERAL:n,QMARK_LITERAL:i,SLASH_LITERAL:o,ONE_CHAR:s,QMARK:a,END_ANCHOR:l,DOTS_SLASH:u,NO_DOT:p,NO_DOTS:f,NO_DOT_SLASH:d,NO_DOTS_SLASH:m,QMARK_NO_DOT:g,STAR:y,START_ANCHOR:c,SEP:x},R={...j,SLASH_LITERAL:"[\\\\/]",QMARK:e,STAR:`${e}*?`,DOTS_SLASH:`${r}{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!${r})`,NO_DOTS:`(?!(?:^|[\\\\/])${r}{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!${r}{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!${r}{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},b={__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 jl={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:b,UNIGNORE:t,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(E){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${E.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(E){return E===!0?R:j}},jl}v(_n,"_t$3");sr(_n,"bt");Et(_n,"requireConstants");var Hf;function Pn(){return Hf||(Hf=1,(function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:r,REGEX_SPECIAL_CHARS:n,REGEX_SPECIAL_CHARS_GLOBAL:i}=_n();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 u=`${l}(?:${o})${c}`;return s.negated===!0&&(u=`(?:^(?!${u}).*$)`),u},e.basename=(o,{windows:s}={})=>{const a=o.split(s?/[\\/]/:"/"),l=a[a.length-1];return l===""?a[a.length-2]:l}})(Wf)),Wf}v(Pn,"Et$3");sr(Pn,"yt");Et(Pn,"requireUtils");var Al,qf;function Ju(){if(qf)return Al;qf=1;var e=Object.defineProperty,t=Et((b,E)=>e(b,"name",{value:E,configurable:!0}),"k");const r=Pn(),{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:u,CHAR_LEFT_PARENTHESES:p,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:d,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:g,CHAR_RIGHT_PARENTHESES:y,CHAR_RIGHT_SQUARE_BRACKET:x}=_n(),j=t(b=>b===c||b===o,"isPathSeparator"),R=t(b=>{b.isPrefix!==!0&&(b.depth=b.isGlobstar?1/0:1)},"depth");return Al=t((b,E)=>{const h=E||{},A=b.length-1,_=h.parts===!0||h.scanToEnd===!0,O=[],k=[],C=[];let B=b,J=-1,q=0,X=0,te=!1,re=!1,I=!1,M=!1,K=!1,F=!1,N=!1,W=!1,V=!1,U=!1,z=0,Y,L,D={value:"",depth:0,isGlob:!1};const $=t(()=>J>=A,"eos"),ge=t(()=>B.charCodeAt(J+1),"peek"),pe=t(()=>(Y=L,B.charCodeAt(++J)),"advance");for(;J<A;){L=pe();let Q;if(L===o){N=D.backslashes=!0,L=pe(),L===u&&(F=!0);continue}if(F===!0||L===u){for(z++;$()!==!0&&(L=pe());){if(L===o){N=D.backslashes=!0,pe();continue}if(L===u){z++;continue}if(F!==!0&&L===a&&(L=pe())===a){if(te=D.isBrace=!0,I=D.isGlob=!0,U=!0,_===!0)continue;break}if(F!==!0&&L===s){if(te=D.isBrace=!0,I=D.isGlob=!0,U=!0,_===!0)continue;break}if(L===g&&(z--,z===0)){F=!1,te=D.isBrace=!0,U=!0;break}}if(_===!0)continue;break}if(L===c){if(O.push(J),k.push(D),D={value:"",depth:0,isGlob:!1},U===!0)continue;if(Y===a&&J===q+1){q+=2;continue}X=J+1;continue}if(h.noext!==!0&&(L===d||L===i||L===n||L===m||L===l)&&ge()===p){if(I=D.isGlob=!0,M=D.isExtglob=!0,U=!0,L===l&&J===q&&(V=!0),_===!0){for(;$()!==!0&&(L=pe());){if(L===o){N=D.backslashes=!0,L=pe();continue}if(L===y){I=D.isGlob=!0,U=!0;break}}continue}break}if(L===n){if(Y===n&&(K=D.isGlobstar=!0),I=D.isGlob=!0,U=!0,_===!0)continue;break}if(L===m){if(I=D.isGlob=!0,U=!0,_===!0)continue;break}if(L===f){for(;$()!==!0&&(Q=pe());){if(Q===o){N=D.backslashes=!0,pe();continue}if(Q===x){re=D.isBracket=!0,I=D.isGlob=!0,U=!0;break}}if(_===!0)continue;break}if(h.nonegate!==!0&&L===l&&J===q){W=D.negated=!0,q++;continue}if(h.noparen!==!0&&L===p){if(I=D.isGlob=!0,_===!0){for(;$()!==!0&&(L=pe());){if(L===p){N=D.backslashes=!0,L=pe();continue}if(L===y){U=!0;break}}continue}break}if(I===!0){if(U=!0,_===!0)continue;break}}h.noext===!0&&(M=!1,I=!1);let se=B,w="",S="";q>0&&(w=B.slice(0,q),B=B.slice(q),X-=q),se&&I===!0&&X>0?(se=B.slice(0,X),S=B.slice(X)):I===!0?(se="",S=B):se=B,se&&se!==""&&se!=="/"&&se!==B&&j(se.charCodeAt(se.length-1))&&(se=se.slice(0,-1)),h.unescape===!0&&(S&&(S=r.removeBackslashes(S)),se&&N===!0&&(se=r.removeBackslashes(se)));const we={prefix:w,input:b,start:q,base:se,glob:S,isBrace:te,isBracket:re,isGlob:I,isExtglob:M,isGlobstar:K,negated:W,negatedExtglob:V};if(h.tokens===!0&&(we.maxDepth=0,j(L)||k.push(D),we.tokens=k),h.parts===!0||h.tokens===!0){let Q;for(let ie=0;ie<O.length;ie++){const ye=Q?Q+1:q,$e=O[ie],Te=b.slice(ye,$e);h.tokens&&(ie===0&&q!==0?(k[ie].isPrefix=!0,k[ie].value=w):k[ie].value=Te,R(k[ie]),we.maxDepth+=k[ie].depth),(ie!==0||Te!=="")&&C.push(Te),Q=$e}if(Q&&Q+1<b.length){const ie=b.slice(Q+1);C.push(ie),h.tokens&&(k[k.length-1].value=ie,R(k[k.length-1]),we.maxDepth+=k[k.length-1].depth)}we.slashes=O,we.parts=C}return we},"scan"),Al}v(Ju,"Nt$3");sr(Ju,"wt");Et(Ju,"requireScan");var Ol,zf;function Vu(){if(zf)return Ol;zf=1;var e=Object.defineProperty,t=Et((b,E)=>e(b,"name",{value:E,configurable:!0}),"y");const r=_n(),n=Pn(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:o,REGEX_NON_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_BACKREF:a,REPLACEMENTS:l}=r,c=t((b,E)=>typeof E.expandRange=="function"?E.expandRange(...b,E):(b.sort(),`[${b.join("-")}]`),"expandRange"),u=t((b,E)=>`Missing ${b}: "${E}" - use "\\\\${E}" to match literal characters`,"syntaxError"),p=t(b=>{const E=[];let h=0,A=0,_=0,O="",k=!1;for(const C of b){if(k===!0){O+=C,k=!1;continue}if(C==="\\"){O+=C,k=!0;continue}if(C==='"'){_=_===1?0:1,O+=C;continue}if(_===0){if(C==="[")h++;else if(C==="]"&&h>0)h--;else if(h===0){if(C==="(")A++;else if(C===")"&&A>0)A--;else if(C==="|"&&A===0){E.push(O),O="";continue}}}O+=C}return E.push(O),E},"splitTopLevel"),f=t(b=>{let E=!1;for(const h of b){if(E===!0){E=!1;continue}if(h==="\\"){E=!0;continue}if(/[?*+@!()[\]{}]/.test(h))return!1}return!0},"isPlainBranch"),d=t(b=>{let E=b.trim(),h=!0;for(;h===!0;)h=!1,/^@\([^\\()[\]{}|]+\)$/.test(E)&&(E=E.slice(2,-1),h=!0);if(f(E))return E.replace(/\\(.)/g,"$1")},"normalizeSimpleBranch"),m=t(b=>{const E=b.map(d).filter(Boolean);for(let h=0;h<E.length;h++)for(let A=h+1;A<E.length;A++){const _=E[h],O=E[A],k=_[0];if(!(!k||_!==k.repeat(_.length)||O!==k.repeat(O.length))&&(_===O||_.startsWith(O)||O.startsWith(_)))return!0}return!1},"hasRepeatedCharPrefixOverlap"),g=t((b,E=!0)=>{if(b[0]!=="+"&&b[0]!=="*"||b[1]!=="(")return;let h=0,A=0,_=0,O=!1;for(let k=1;k<b.length;k++){const C=b[k];if(O===!0){O=!1;continue}if(C==="\\"){O=!0;continue}if(C==='"'){_=_===1?0:1;continue}if(_!==1){if(C==="["){h++;continue}if(C==="]"&&h>0){h--;continue}if(!(h>0)){if(C==="("){A++;continue}if(C===")"&&(A--,A===0))return E===!0&&k!==b.length-1?void 0:{type:b[0],body:b.slice(2,k),end:k}}}}},"parseRepeatedExtglob"),y=t(b=>{let E=0;const h=[];for(;E<b.length;){const A=g(b.slice(E),!1);if(!A||A.type!=="*")return;const _=p(A.body).map(k=>k.trim());if(_.length!==1)return;const O=d(_[0]);if(!O||O.length!==1)return;h.push(O),E+=A.end+1}return h.length<1?void 0:`${h.length===1?n.escapeRegex(h[0]):`[${h.map(A=>n.escapeRegex(A)).join("")}]`}*`},"getStarExtglobSequenceOutput"),x=t(b=>{let E=0,h=b.trim(),A=g(h);for(;A;)E++,h=A.body.trim(),A=g(h);return E},"repeatedExtglobRecursion"),j=t((b,E)=>{if(E.maxExtglobRecursion===!1)return{risky:!1};const h=typeof E.maxExtglobRecursion=="number"?E.maxExtglobRecursion:r.DEFAULT_MAX_EXTGLOB_RECURSION,A=p(b).map(_=>_.trim());if(A.length>1&&(A.some(_=>_==="")||A.some(_=>/^[*?]+$/.test(_))||m(A)))return{risky:!0};for(const _ of A){const O=y(_);if(O)return{risky:!0,safeOutput:O};if(x(_)>h)return{risky:!0}}return{risky:!1}},"analyzeRepeatedExtglob"),R=t((b,E)=>{if(typeof b!="string")throw new TypeError("Expected a string");b=l[b]||b;const h={...E},A=typeof h.maxLength=="number"?Math.min(i,h.maxLength):i;let _=b.length;if(_>A)throw new SyntaxError(`Input length: ${_}, exceeds maximum allowed length: ${A}`);const O={type:"bos",value:"",output:h.prepend||""},k=[O],C=h.capture?"":"?:",B=r.globChars(h.windows),J=r.extglobChars(B),{DOT_LITERAL:q,PLUS_LITERAL:X,SLASH_LITERAL:te,ONE_CHAR:re,DOTS_SLASH:I,NO_DOT:M,NO_DOT_SLASH:K,NO_DOTS_SLASH:F,QMARK:N,QMARK_NO_DOT:W,STAR:V,START_ANCHOR:U}=B,z=t(T=>`(${C}(?:(?!${U}${T.dot?I:q}).)*?)`,"globstar"),Y=h.dot?"":M,L=h.dot?N:W;let D=h.bash===!0?z(h):V;h.capture&&(D=`(${D})`),typeof h.noext=="boolean"&&(h.noextglob=h.noext);const $={input:b,index:-1,start:0,dot:h.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:k};b=n.removePrefix(b,$),_=b.length;const ge=[],pe=[],se=[];let w=O,S;const we=t(()=>$.index===_-1,"eos"),Q=$.peek=(T=1)=>b[$.index+T],ie=$.advance=()=>b[++$.index]||"",ye=t(()=>b.slice($.index+1),"remaining"),$e=t((T="",ee=0)=>{$.consumed+=T,$.index+=ee},"consume"),Te=t(T=>{$.output+=T.output!=null?T.output:T.value,$e(T.value)},"append"),Bt=t(()=>{let T=1;for(;Q()==="!"&&(Q(2)!=="("||Q(3)==="?");)ie(),$.start++,T++;return T%2===0?!1:($.negated=!0,$.start++,!0)},"negate"),it=t(T=>{$[T]++,se.push(T)},"increment"),_e=t(T=>{$[T]--,se.pop()},"decrement"),H=t(T=>{if(w.type==="globstar"){const ee=$.braces>0&&(T.type==="comma"||T.type==="brace"),P=T.extglob===!0||ge.length&&(T.type==="pipe"||T.type==="paren");T.type!=="slash"&&T.type!=="paren"&&!ee&&!P&&($.output=$.output.slice(0,-w.output.length),w.type="star",w.value="*",w.output=D,$.output+=w.output)}if(ge.length&&T.type!=="paren"&&(ge[ge.length-1].inner+=T.value),(T.value||T.output)&&Te(T),w&&w.type==="text"&&T.type==="text"){w.output=(w.output||w.value)+T.value,w.value+=T.value;return}T.prev=w,k.push(T),w=T},"push"),ot=t((T,ee)=>{const P={...J[ee],conditions:1,inner:""};P.prev=w,P.parens=$.parens,P.output=$.output,P.startIndex=$.index,P.tokensIndex=k.length;const G=(h.capture?"(":"")+P.open;it("parens"),H({type:T,value:ee,output:$.output?"":re}),H({type:"paren",extglob:!0,value:ie(),output:G}),ge.push(P)},"extglobOpen"),qn=t(T=>{const ee=b.slice(T.startIndex,$.index+1),P=b.slice(T.startIndex+2,$.index),G=j(P,h);if((T.type==="plus"||T.type==="star")&&G.risky){const Z=G.safeOutput?(T.output?"":re)+(h.capture?`(${G.safeOutput})`:G.safeOutput):void 0,Se=k[T.tokensIndex];Se.type="text",Se.value=ee,Se.output=Z||n.escapeRegex(ee);for(let ke=T.tokensIndex+1;ke<k.length;ke++)k[ke].value="",k[ke].output="",delete k[ke].suffix;$.output=T.output+Se.output,$.backtrack=!0,H({type:"paren",extglob:!0,value:S,output:""}),_e("parens");return}let ne=T.close+(h.capture?")":""),ae;if(T.type==="negate"){let Z=D;if(T.inner&&T.inner.length>1&&T.inner.includes("/")&&(Z=z(h)),(Z!==D||we()||/^\)+$/.test(ye()))&&(ne=T.close=`)$))${Z}`),T.inner.includes("*")&&(ae=ye())&&/^\.[^\\/.]+$/.test(ae)){const Se=R(ae,{...E,fastpaths:!1}).output;ne=T.close=`)${Se})${Z})`}T.prev.type==="bos"&&($.negatedExtglob=!0)}H({type:"paren",extglob:!0,value:S,output:ne}),_e("parens")},"extglobClose");if(h.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(b)){let T=!1,ee=b.replace(a,(P,G,ne,ae,Z,Se)=>ae==="\\"?(T=!0,P):ae==="?"?G?G+ae+(Z?N.repeat(Z.length):""):Se===0?L+(Z?N.repeat(Z.length):""):N.repeat(ne.length):ae==="."?q.repeat(ne.length):ae==="*"?G?G+ae+(Z?D:""):D:G?P:`\\${P}`);return T===!0&&(h.unescape===!0?ee=ee.replace(/\\/g,""):ee=ee.replace(/\\+/g,P=>P.length%2===0?"\\\\":P?"\\":"")),ee===b&&h.contains===!0?($.output=b,$):($.output=n.wrapOutput(ee,$,E),$)}for(;!we();){if(S=ie(),S==="\0")continue;if(S==="\\"){const P=Q();if(P==="/"&&h.bash!==!0||P==="."||P===";")continue;if(!P){S+="\\",H({type:"text",value:S});continue}const G=/^\\+/.exec(ye());let ne=0;if(G&&G[0].length>2&&(ne=G[0].length,$.index+=ne,ne%2!==0&&(S+="\\")),h.unescape===!0?S=ie():S+=ie(),$.brackets===0){H({type:"text",value:S});continue}}if($.brackets>0&&(S!=="]"||w.value==="["||w.value==="[^")){if(h.posix!==!1&&S===":"){const P=w.value.slice(1);if(P.includes("[")&&(w.posix=!0,P.includes(":"))){const G=w.value.lastIndexOf("["),ne=w.value.slice(0,G),ae=w.value.slice(G+2),Z=o[ae];if(Z){w.value=ne+Z,$.backtrack=!0,ie(),!O.output&&k.indexOf(w)===1&&(O.output=re);continue}}}(S==="["&&Q()!==":"||S==="-"&&Q()==="]")&&(S=`\\${S}`),S==="]"&&(w.value==="["||w.value==="[^")&&(S=`\\${S}`),h.posix===!0&&S==="!"&&w.value==="["&&(S="^"),w.value+=S,Te({value:S});continue}if($.quotes===1&&S!=='"'){S=n.escapeRegex(S),w.value+=S,Te({value:S});continue}if(S==='"'){$.quotes=$.quotes===1?0:1,h.keepQuotes===!0&&H({type:"text",value:S});continue}if(S==="("){it("parens"),H({type:"paren",value:S});continue}if(S===")"){if($.parens===0&&h.strictBrackets===!0)throw new SyntaxError(u("opening","("));const P=ge[ge.length-1];if(P&&$.parens===P.parens+1){qn(ge.pop());continue}H({type:"paren",value:S,output:$.parens?")":"\\)"}),_e("parens");continue}if(S==="["){if(h.nobracket===!0||!ye().includes("]")){if(h.nobracket!==!0&&h.strictBrackets===!0)throw new SyntaxError(u("closing","]"));S=`\\${S}`}else it("brackets");H({type:"bracket",value:S});continue}if(S==="]"){if(h.nobracket===!0||w&&w.type==="bracket"&&w.value.length===1){H({type:"text",value:S,output:`\\${S}`});continue}if($.brackets===0){if(h.strictBrackets===!0)throw new SyntaxError(u("opening","["));H({type:"text",value:S,output:`\\${S}`});continue}_e("brackets");const P=w.value.slice(1);if(w.posix!==!0&&P[0]==="^"&&!P.includes("/")&&(S=`/${S}`),w.value+=S,Te({value:S}),h.literalBrackets===!1||n.hasRegexChars(P))continue;const G=n.escapeRegex(w.value);if($.output=$.output.slice(0,-w.value.length),h.literalBrackets===!0){$.output+=G,w.value=G;continue}w.value=`(${C}${G}|${w.value})`,$.output+=w.value;continue}if(S==="{"&&h.nobrace!==!0){it("braces");const P={type:"brace",value:S,output:"(",outputIndex:$.output.length,tokensIndex:$.tokens.length};pe.push(P),H(P);continue}if(S==="}"){const P=pe[pe.length-1];if(h.nobrace===!0||!P){H({type:"text",value:S,output:S});continue}let G=")";if(P.dots===!0){const ne=k.slice(),ae=[];for(let Z=ne.length-1;Z>=0&&(k.pop(),ne[Z].type!=="brace");Z--)ne[Z].type!=="dots"&&ae.unshift(ne[Z].value);G=c(ae,h),$.backtrack=!0}if(P.comma!==!0&&P.dots!==!0){const ne=$.output.slice(0,P.outputIndex),ae=$.tokens.slice(P.tokensIndex);P.value=P.output="\\{",S=G="\\}",$.output=ne;for(const Z of ae)$.output+=Z.output||Z.value}H({type:"brace",value:S,output:G}),_e("braces"),pe.pop();continue}if(S==="|"){ge.length>0&&ge[ge.length-1].conditions++,H({type:"text",value:S});continue}if(S===","){let P=S;const G=pe[pe.length-1];G&&se[se.length-1]==="braces"&&(G.comma=!0,P="|"),H({type:"comma",value:S,output:P});continue}if(S==="/"){if(w.type==="dot"&&$.index===$.start+1){$.start=$.index+1,$.consumed="",$.output="",k.pop(),w=O;continue}H({type:"slash",value:S,output:te});continue}if(S==="."){if($.braces>0&&w.type==="dot"){w.value==="."&&(w.output=q);const P=pe[pe.length-1];w.type="dots",w.output+=S,w.value+=S,P.dots=!0;continue}if($.braces+$.parens===0&&w.type!=="bos"&&w.type!=="slash"){H({type:"text",value:S,output:q});continue}H({type:"dot",value:S,output:q});continue}if(S==="?"){if(!(w&&w.value==="(")&&h.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){ot("qmark",S);continue}if(w&&w.type==="paren"){const P=Q();let G=S;(w.value==="("&&!/[!=<:]/.test(P)||P==="<"&&!/<([!=]|\w+>)/.test(ye()))&&(G=`\\${S}`),H({type:"text",value:S,output:G});continue}if(h.dot!==!0&&(w.type==="slash"||w.type==="bos")){H({type:"qmark",value:S,output:W});continue}H({type:"qmark",value:S,output:N});continue}if(S==="!"){if(h.noextglob!==!0&&Q()==="("&&(Q(2)!=="?"||!/[!=<:]/.test(Q(3)))){ot("negate",S);continue}if(h.nonegate!==!0&&$.index===0){Bt();continue}}if(S==="+"){if(h.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){ot("plus",S);continue}if(w&&w.value==="("||h.regex===!1){H({type:"plus",value:S,output:X});continue}if(w&&(w.type==="bracket"||w.type==="paren"||w.type==="brace")||$.parens>0){H({type:"plus",value:S});continue}H({type:"plus",value:X});continue}if(S==="@"){if(h.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){H({type:"at",extglob:!0,value:S,output:""});continue}H({type:"text",value:S});continue}if(S!=="*"){(S==="$"||S==="^")&&(S=`\\${S}`);const P=s.exec(ye());P&&(S+=P[0],$.index+=P[0].length),H({type:"text",value:S});continue}if(w&&(w.type==="globstar"||w.star===!0)){w.type="star",w.star=!0,w.value+=S,w.output=D,$.backtrack=!0,$.globstar=!0,$e(S);continue}let T=ye();if(h.noextglob!==!0&&/^\([^?]/.test(T)){ot("star",S);continue}if(w.type==="star"){if(h.noglobstar===!0){$e(S);continue}const P=w.prev,G=P.prev,ne=P.type==="slash"||P.type==="bos",ae=G&&(G.type==="star"||G.type==="globstar");if(h.bash===!0&&(!ne||T[0]&&T[0]!=="/")){H({type:"star",value:S,output:""});continue}const Z=$.braces>0&&(P.type==="comma"||P.type==="brace"),Se=ge.length&&(P.type==="pipe"||P.type==="paren");if(!ne&&P.type!=="paren"&&!Z&&!Se){H({type:"star",value:S,output:""});continue}for(;T.slice(0,3)==="/**";){const ke=b[$.index+4];if(ke&&ke!=="/")break;T=T.slice(3),$e("/**",3)}if(P.type==="bos"&&we()){w.type="globstar",w.value+=S,w.output=z(h),$.output=w.output,$.globstar=!0,$e(S);continue}if(P.type==="slash"&&P.prev.type!=="bos"&&!ae&&we()){$.output=$.output.slice(0,-(P.output+w.output).length),P.output=`(?:${P.output}`,w.type="globstar",w.output=z(h)+(h.strictSlashes?")":"|$)"),w.value+=S,$.globstar=!0,$.output+=P.output+w.output,$e(S);continue}if(P.type==="slash"&&P.prev.type!=="bos"&&T[0]==="/"){const ke=T[1]!==void 0?"|$":"";$.output=$.output.slice(0,-(P.output+w.output).length),P.output=`(?:${P.output}`,w.type="globstar",w.output=`${z(h)}${te}|${te}${ke})`,w.value+=S,$.output+=P.output+w.output,$.globstar=!0,$e(S+ie()),H({type:"slash",value:"/",output:""});continue}if(P.type==="bos"&&T[0]==="/"){w.type="globstar",w.value+=S,w.output=`(?:^|${te}|${z(h)}${te})`,$.output=w.output,$.globstar=!0,$e(S+ie()),H({type:"slash",value:"/",output:""});continue}if(Z&&T[0]==="/"){w.type="globstar",w.value+=S,w.output=`(?:^|${te}|${z(h)}${te})`,$.output+=w.output,$.globstar=!0,$e(S+ie()),H({type:"slash",value:"/",output:""});continue}$.output=$.output.slice(0,-w.output.length),w.type="globstar",w.output=z(h),w.value+=S,$.output+=w.output,$.globstar=!0,$e(S);continue}const ee={type:"star",value:S,output:D};if(h.bash===!0){ee.output=".*?",(w.type==="bos"||w.type==="slash")&&(ee.output=Y+ee.output),H(ee);continue}if(w&&(w.type==="bracket"||w.type==="paren")&&h.regex===!0){ee.output=S,H(ee);continue}($.index===$.start||w.type==="slash"||w.type==="dot")&&(w.type==="dot"?($.output+=K,w.output+=K):h.dot===!0?($.output+=F,w.output+=F):($.output+=Y,w.output+=Y),Q()!=="*"&&($.output+=re,w.output+=re)),H(ee)}for(;$.brackets>0;){if(h.strictBrackets===!0)throw new SyntaxError(u("closing","]"));$.output=n.escapeLast($.output,"["),_e("brackets")}for(;$.parens>0;){if(h.strictBrackets===!0)throw new SyntaxError(u("closing",")"));$.output=n.escapeLast($.output,"("),_e("parens")}for(;$.braces>0;){if(h.strictBrackets===!0)throw new SyntaxError(u("closing","}"));$.output=n.escapeLast($.output,"{"),_e("braces")}if(h.strictSlashes!==!0&&(w.type==="star"||w.type==="bracket")&&H({type:"maybe_slash",value:"",output:`${te}?`}),$.backtrack===!0){$.output="";for(const T of $.tokens)$.output+=T.output!=null?T.output:T.value,T.suffix&&($.output+=T.suffix)}return $},"parse");return R.fastpaths=(b,E)=>{const h={...E},A=typeof h.maxLength=="number"?Math.min(i,h.maxLength):i,_=b.length;if(_>A)throw new SyntaxError(`Input length: ${_}, exceeds maximum allowed length: ${A}`);b=l[b]||b;const{DOT_LITERAL:O,SLASH_LITERAL:k,ONE_CHAR:C,DOTS_SLASH:B,NO_DOT:J,NO_DOTS:q,NO_DOTS_SLASH:X,STAR:te,START_ANCHOR:re}=r.globChars(h.windows),I=h.dot?q:J,M=h.dot?X:J,K=h.capture?"":"?:",F={negated:!1,prefix:""};let N=h.bash===!0?".*?":te;h.capture&&(N=`(${N})`);const W=t(Y=>Y.noglobstar===!0?N:`(${K}(?:(?!${re}${Y.dot?B:O}).)*?)`,"globstar"),V=t(Y=>{switch(Y){case"*":return`${I}${C}${N}`;case".*":return`${O}${C}${N}`;case"*.*":return`${I}${N}${O}${C}${N}`;case"*/*":return`${I}${N}${k}${C}${M}${N}`;case"**":return I+W(h);case"**/*":return`(?:${I}${W(h)}${k})?${M}${C}${N}`;case"**/*.*":return`(?:${I}${W(h)}${k})?${M}${N}${O}${C}${N}`;case"**/.*":return`(?:${I}${W(h)}${k})?${O}${C}${N}`;default:{const L=/^(.*?)\.(\w+)$/.exec(Y);if(!L)return;const D=V(L[1]);return D?D+O+L[2]:void 0}}},"create"),U=n.removePrefix(b,F);let z=V(U);return z&&h.strictSlashes!==!0&&(z+=`${k}?`),z},Ol=R,Ol}v(Vu,"It$3");sr(Vu,"Bt");Et(Vu,"requireParse");var Rl,Gf;function Xu(){if(Gf)return Rl;Gf=1;var e=Object.defineProperty,t=Et((l,c)=>e(l,"name",{value:c,configurable:!0}),"h");const r=Ju(),n=Vu(),i=Pn(),o=_n(),s=t(l=>l&&typeof l=="object"&&!Array.isArray(l),"isObject"),a=t((l,c,u=!1)=>{if(Array.isArray(l)){const j=l.map(R=>a(R,c,u));return t(R=>{for(const b of j){const E=b(R);if(E)return E}return!1},"arrayMatcher")}const p=s(l)&&l.tokens&&l.input;if(l===""||typeof l!="string"&&!p)throw new TypeError("Expected pattern to be a non-empty string");const f=c||{},d=f.windows,m=p?a.compileRe(l,c):a.makeRe(l,c,!1,!0),g=m.state;delete m.state;let y=t(()=>!1,"isIgnored");if(f.ignore){const j={...c,ignore:null,onMatch:null,onResult:null};y=a(f.ignore,j,u)}const x=t((j,R=!1)=>{const{isMatch:b,match:E,output:h}=a.test(j,m,c,{glob:l,posix:d}),A={glob:l,state:g,regex:m,posix:d,input:j,output:h,match:E,isMatch:b};if(typeof f.onResult=="function"&&f.onResult(A),b===!1)return A.isMatch=!1,R?A:!1;e:if(y(j)){if(typeof f.onIgnore=="function"&&f.onIgnore(A)===o.UNIGNORE){A.isMatch=!0;break e}return A.isMatch=!1,R?A:!1}return typeof f.onMatch=="function"&&f.onMatch(A),R?A:!0},"matcher");return u&&(x.state=g),x},"picomatch");return a.test=(l,c,u,{glob:p,posix:f}={})=>{if(typeof l!="string")throw new TypeError("Expected input to be a string");if(l==="")return{isMatch:!1,output:""};const d=u||{},m=d.format||(f?i.toPosixSlashes:null);let g=l===p,y=g&&m?m(l):l;return g===!1&&(y=m?m(l):l,g=y===p),(g===!1||d.capture===!0)&&(d.matchBase===!0||d.basename===!0?g=a.matchBase(l,c,u,f):g=c.exec(y)),{isMatch:!!g,match:g,output:y}},a.matchBase=(l,c,u)=>(c instanceof RegExp?c:a.makeRe(c,u)).test(i.basename(l)),a.isMatch=(l,c,u)=>a(c,u)(l),a.parse=(l,c)=>Array.isArray(l)?l.map(u=>a.parse(u,c)):n(l,{...c,fastpaths:!1}),a.scan=(l,c)=>r(l,c),a.compileRe=(l,c,u=!1,p=!1)=>{if(u===!0)return l.output;const f=c||{},d=f.contains?"":"^",m=f.contains?"":"$";let g=`${d}(?:${l.output})${m}`;l&&l.negated===!0&&(g=`^(?!${g}).*$`);const y=a.toRegex(g,c);return p===!0&&(y.state=l),y},a.makeRe=(l,c={},u=!1,p=!1)=>{if(!l||typeof l!="string")throw new TypeError("Expected a non-empty string");let f={negated:!1,fastpaths:!0};return c.fastpaths!==!1&&(l[0]==="."||l[0]==="*")&&(f.output=n.fastpaths(l,c)),f.output||(f=n(l,c)),a.compileRe(f,c,u,p)},a.toRegex=(l,c)=>{try{const u=c||{};return new RegExp(l,u.flags||(u.nocase?"i":""))}catch(u){if(c&&c.debug===!0)throw u;return/$^/}},a.constants=o,Rl=a,Rl}v(Xu,"wt$2");sr(Xu,"Gt");Et(Xu,"requirePicomatch$1");var _l,Uf;function Yu(){if(Uf)return _l;Uf=1;var e=Object.defineProperty,t=Et((o,s)=>e(o,"name",{value:s,configurable:!0}),"c");const r=Xu(),n=Pn();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 v(i,"D"),sr(i,"D"),Et(i,"picomatch"),t(i,"picomatch"),Object.assign(i,r),_l=i,_l}v(Yu,"Pt$3");sr(Yu,"Mt");Et(Yu,"requirePicomatch");var xE=Yu();const yr=so(xE);var wE=Object.defineProperty,he=v((e,t)=>wE(e,"name",{value:t,configurable:!0}),"u$w"),EE=Object.defineProperty,de=he((e,t)=>EE(e,"name",{value:t,configurable:!0}),"l");const SE=De(import.meta.url),Qn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ao=de(e=>{if(typeof Qn<"u"&&Qn.versions&&Qn.versions.node){const[t,r]=Qn.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Qn.getBuiltinModule(e)}return SE(e)},"__cjs_getBuiltinModule"),Kf=ao("fs"),kE={...Kf,default:Kf},{statSync:jE,stat:AE,realpathSync:OE,realpath:RE,readdirSync:_E,readdir:PE}=ao("fs"),{sep:Og,basename:CE,dirname:Vc,resolve:Rg,normalize:TE,relative:NE,posix:$r,isAbsolute:IE}=ao("path"),{fileURLToPath:ME}=ao("url"),{createRequire:DE}=ao("module");var BE=Object.defineProperty,ue=de((e,t)=>BE(e,"name",{value:t,configurable:!0}),"r"),Jf=DE(import.meta.url);function oa(e){let t=TE(e);return t.length>1&&t[t.length-1]===Og&&(t=t.substring(0,t.length-1)),t}v(oa,"H$d");he(oa,"tt");de(oa,"M$1");ue(oa,"cleanPath");const LE=/[\\/]/g;function lo(e,t){return e.replace(LE,t)}v(lo,"M$j");he(lo,"T");de(lo,"D$1");ue(lo,"convertSlashes");const WE=/^[a-z]:[\\/]$/i;function sa(e){return e==="/"||WE.test(e)}v(sa,"J$d");he(sa,"et");de(sa,"T$1");ue(sa,"isRootDirectory");function on(e,t){const{resolvePaths:r,normalizePath:n,pathSeparator:i}=t,o=process.platform==="win32"&&e.includes("/")||e.startsWith(".");if(r&&(e=Rg(e)),(n||o)&&(e=oa(e)),e===".")return"";const s=e[e.length-1]!==i;return lo(s?e+i:e,i)}v(on,"q$k");he(on,"q");de(on,"w");ue(on,"normalizePath");function co(e,t){return t+e}v(co,"B$j");he(co,"I");de(co,"P");ue(co,"joinPathWithBasePath");function aa(e,t){return function(r,n){return n.startsWith(e)?n.slice(e.length)+r:lo(NE(e,n),t.pathSeparator)+t.pathSeparator+r}}v(aa,"K$c");he(aa,"st");de(aa,"X");ue(aa,"joinPathWithRelativePath");function la(e){return e}v(la,"V$c");he(la,"rt");de(la,"H");ue(la,"joinPath");function ca(e,t,r){return t+e+r}v(ca,"X$c");he(ca,"nt");de(ca,"U$1");ue(ca,"joinDirectoryPath");function ua(e,t){const{relativePaths:r,includeBasePath:n}=t;return r&&e?aa(e,t):n?co:la}v(ua,"Z$c");he(ua,"it");de(ua,"J");ue(ua,"build$7");function pa(e){return function(t,r){r.push(t.substring(e.length)||".")}}v(pa,"tt$2");he(pa,"ot");de(pa,"K$1");ue(pa,"pushDirectoryWithRelativePath");function fa(e){return function(t,r,n){const i=t.substring(e.length)||".";n.every(o=>o(i,!0))&&r.push(i)}}v(fa,"et$2");he(fa,"ut");de(fa,"V");ue(fa,"pushDirectoryFilterWithRelativePath");const FE=ue((e,t)=>{t.push(e||".")},"pushDirectory"),HE=ue((e,t,r)=>{const n=e||".";r.every(i=>i(n,!0))&&t.push(n)},"pushDirectoryFilter"),qE=ue(()=>{},"empty$2");function da(e,t){const{includeDirs:r,filters:n,relativePaths:i}=t;return r?i?n&&n.length?fa(e):pa(e):n&&n.length?HE:FE:qE}v(da,"st$2");he(da,"lt");de(da,"st$1");ue(da,"build$6");const zE=ue((e,t,r,n)=>{n.every(i=>i(e,!1))&&r.files++},"pushFileFilterAndCount"),GE=ue((e,t,r,n)=>{n.every(i=>i(e,!1))&&t.push(e)},"pushFileFilter"),UE=ue((e,t,r,n)=>{r.files++},"pushFileCount"),KE=ue((e,t)=>{t.push(e)},"pushFile"),JE=ue(()=>{},"empty$1");function ma(e){const{excludeFiles:t,filters:r,onlyCounts:n}=e;return t?JE:r&&r.length?n?zE:GE:n?UE:KE}v(ma,"it$2");he(ma,"at");de(ma,"ut$1");ue(ma,"build$5");const VE=ue(e=>e,"getArray"),XE=ue(()=>[""].slice(0,0),"getArrayGroup");function ha(e){return e.group?XE:VE}v(ha,"nt$1");he(ha,"ct");de(ha,"ct$1");ue(ha,"build$4");const YE=ue((e,t,r)=>{e.push({directory:t,files:r,dir:t})},"groupFiles"),QE=ue(()=>{},"empty");function ga(e){return e.group?YE:QE}v(ga,"rt$2");he(ga,"ht");de(ga,"ft$1");ue(ga,"build$3");const ZE=ue(function(e,t,r){const{queue:n,fs:i,options:{suppressErrors:o}}=t;n.enqueue(),i.realpath(e,(s,a)=>{if(s)return n.dequeue(o?null:s,t);i.stat(a,(l,c)=>{if(l)return n.dequeue(o?null:l,t);if(c.isDirectory()&&uo(e,a,t))return n.dequeue(null,t);r(c,a),n.dequeue(null,t)})})},"resolveSymlinksAsync"),eS=ue(function(e,t,r){const{queue:n,fs:i,options:{suppressErrors:o}}=t;n.enqueue();try{const s=i.realpathSync(e),a=i.statSync(s);if(a.isDirectory()&&uo(e,s,t))return;r(a,s)}catch(s){if(!o)throw s}},"resolveSymlinks");function va(e,t){return!e.resolveSymlinks||e.excludeSymlinks?null:t?eS:ZE}v(va,"ot$2");he(va,"pt");de(va,"gt$1");ue(va,"build$2");function uo(e,t,r){if(r.options.useRealPaths)return ba(t,r);let n=Vc(e),i=1;for(;n!==r.root&&i<2;){const o=r.symlinks.get(n);o&&(o===t||o.startsWith(t)||t.startsWith(o))?i++:n=Vc(n)}return r.symlinks.set(e,t),i>1}v(uo,"_$j");he(uo,"L");de(uo,"E$1");ue(uo,"isRecursive");function ba(e,t){return t.visited.includes(e+t.options.pathSeparator)}v(ba,"lt$2");he(ba,"ft");de(ba,"dt$1");ue(ba,"isRecursiveUsingRealPaths");const tS=ue(e=>e.counts,"onlyCountsSync"),rS=ue(e=>e.groups,"groupsSync"),nS=ue(e=>e.paths,"defaultSync"),iS=ue(e=>e.paths.slice(0,e.options.maxFiles),"limitFilesSync"),oS=ue((e,t,r)=>(Pr(t,r,e.counts,e.options.suppressErrors),null),"onlyCountsAsync"),sS=ue((e,t,r)=>(Pr(t,r,e.paths,e.options.suppressErrors),null),"defaultAsync"),aS=ue((e,t,r)=>(Pr(t,r,e.paths.slice(0,e.options.maxFiles),e.options.suppressErrors),null),"limitFilesAsync"),lS=ue((e,t,r)=>(Pr(t,r,e.groups,e.options.suppressErrors),null),"groupsAsync");function Pr(e,t,r,n){t(e&&!n?e:null,r)}v(Pr,"A$i");he(Pr,"j");de(Pr,"y");ue(Pr,"report");function ya(e,t){const{onlyCounts:r,group:n,maxFiles:i}=e;return r?t?tS:oS:n?t?rS:lS:i?t?iS:aS:t?nS:sS}v(ya,"at$2");he(ya,"gt");de(ya,"Et");ue(ya,"build$1");const _g={withFileTypes:!0},cS=ue((e,t,r,n,i)=>{if(e.queue.enqueue(),n<0)return e.queue.dequeue(null,e);const{fs:o}=e;e.visited.push(t),e.counts.directories++,o.readdir(t||".",_g,(s,a=[])=>{i(a,r,n),e.queue.dequeue(e.options.suppressErrors?null:s,e)})},"walkAsync"),uS=ue((e,t,r,n,i)=>{const{fs:o}=e;if(n<0)return;e.visited.push(t),e.counts.directories++;let s=[];try{s=o.readdirSync(t||".",_g)}catch(a){if(!e.options.suppressErrors)throw a}i(s,r,n)},"walkSync");function $a(e){return e?uS:cS}v($a,"ut$2");he($a,"yt");de($a,"xt$1");ue($a,"build");var pS=class{static{v(this,"De")}static{he(this,"we")}static{de(this,"_t")}static{ue(this,"Queue")}count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,r){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,r),t&&(r.controller.abort(),this.onQueueEmpty=void 0))}},fS=class{static{v(this,"Ae")}static{he(this,"$e")}static{de(this,"At")}static{ue(this,"Counter")}_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},dS=class{static{v(this,"Ee")}static{he(this,"Se")}static{de(this,"Wt")}static{ue(this,"Aborter")}aborted=!1;abort(){this.aborted=!0}},Pg=class{static{v(this,"Dt")}static{he(this,"mt")}static{de(this,"q")}static{ue(this,"Walker")}root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,r,n){this.isSynchronous=!n,this.callbackInvoker=ya(r,this.isSynchronous),this.root=on(t,r),this.state={root:sa(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new fS,options:r,queue:new pS((i,o)=>this.callbackInvoker(o,i,n)),symlinks:new Map,visited:[""].slice(0,0),controller:new dS,fs:r.fs||kE},this.joinPath=ua(this.root,r),this.pushDirectory=da(this.root,r),this.pushFile=ma(r),this.getArray=ha(r),this.groupFiles=ga(r),this.resolveSymlink=va(r,this.isSynchronous),this.walkDirectory=$a(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=ue((t,r,n)=>{const{paths:i,options:{filters:o,resolveSymlinks:s,excludeSymlinks:a,exclude:l,maxFiles:c,signal:u,useRealPaths:p,pathSeparator:f},controller:d}=this.state;if(d.aborted||u&&u.aborted||c&&i.length>c)return;const m=this.getArray(this.state.paths);for(let g=0;g<t.length;++g){const y=t[g];if(y.isFile()||y.isSymbolicLink()&&!s&&!a){const x=this.joinPath(y.name,r);this.pushFile(x,m,this.state.counts,o)}else if(y.isDirectory()){let x=ca(y.name,r,this.state.options.pathSeparator);if(l&&l(y.name,x))continue;this.pushDirectory(x,i,o),this.walkDirectory(this.state,x,x,n-1,this.walk)}else if(this.resolveSymlink&&y.isSymbolicLink()){let x=co(y.name,r);this.resolveSymlink(x,this.state,(j,R)=>{if(j.isDirectory()){if(R=on(R,this.state.options),l&&l(y.name,p?R:x+f))return;this.walkDirectory(this.state,R,p?R:x+f,n-1,this.walk)}else{R=p?R:x;const b=CE(R),E=on(Vc(R),this.state.options);R=this.joinPath(b,E),this.pushFile(R,m,this.state.counts,o)}})}}this.groupFiles(this.state.groups,r,m)},"walk")};function xa(e,t){return new Promise((r,n)=>{po(e,t,(i,o)=>{if(i)return n(i);r(o)})})}v(xa,"ct$1");he(xa,"bt");de(xa,"Ct");ue(xa,"promise");function po(e,t,r){new Pg(e,t,r).start()}v(po,"T$l");he(po,"G");de(po,"x");ue(po,"callback");function wa(e,t){return new Pg(e,t).start()}v(wa,"ht$2");he(wa,"vt");de(wa,"jt");ue(wa,"sync");var Vf=class{static{v(this,"kt")}static{he(this,"J")}static{de(this,"F")}static{ue(this,"APIBuilder")}constructor(t,r){this.root=t,this.options=r}withPromise(){return xa(this.root,this.options)}withCallback(t){po(this.root,this.options,t)}sync(){return wa(this.root,this.options)}};let Cg=null;try{Jf.resolve("picomatch"),Cg=Jf("picomatch")}catch{}var mS=class{static{v(this,"We")}static{he(this,"ke")}static{de(this,"$t")}static{ue(this,"Builder")}globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:Og,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new Vf(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,r){return this.options={...this.options,...r},new Vf(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...r){const n=this.globFunction||Cg;if(!n)throw new Error("Please specify a glob function to use glob matching.");var i=this.globCache[t.join("\0")];return i||(i=n(t,...r),this.globCache[t.join("\0")]=i),this.options.filters.push(o=>i(o)),this}},hS=Object.defineProperty,Fe=de((e,t)=>hS(e,"name",{value:t,configurable:!0}),"a");const gS=Array.isArray,Tg=/\\/g,Ng=process.platform==="win32",vS=/^(\/?\.\.)+$/;function Ti(e,t={}){const r=e.length,n=Array(r),i=Array(r);let o,s;for(o=0;o<r;o++){const a=fo(e[o]);n[o]=a;const l=a.length,c=Array(l);for(s=0;s<l;s++)c[s]=yr(a[s],t);i[o]=c}return a=>{const l=a.split("/");if(l[0]===".."&&vS.test(a))return!0;for(o=0;o<r;o++){const c=n[o],u=i[o],p=l.length,f=Math.min(p,c.length);for(s=0;s<f;){const d=c[s];if(d.includes("/"))return!0;if(!u[s](l[s]))break;if(!t.noglobstar&&d==="**")return!0;s++}if(s===p)return!0}return!1}}v(Ti,"R$i");he(Ti,"B");de(Ti,"D");Fe(Ti,"getPartialMatcher");const bS=/^[A-Z]:\/$/i,yS=Ng?e=>bS.test(e):e=>e==="/";function Ni(e,t,r){if(e===t||t.startsWith(`${e}/`)){if(r){const i=e.length+ +!yS(e);return(o,s)=>o.slice(i,s?-1:void 0)||"."}const n=t.slice(e.length+1);return n?(i,o)=>{if(i===".")return n;const s=`${n}/${i}`;return o?s.slice(0,-1):s}:(i,o)=>o&&i!=="."?i.slice(0,-1):i}return r?n=>$r.relative(e,n)||".":n=>$r.relative(e,`${t}/${n}`)||"."}v(Ni,"O$m");he(Ni,"M");de(Ni,"M");Fe(Ni,"buildFormat");function Ea(e,t){if(t.startsWith(`${e}/`)){const r=t.slice(e.length+1);return n=>`${r}/${n}`}return r=>{const n=$r.relative(e,`${t}/${r}`);return r[r.length-1]==="/"&&n!==""?`${n}/`:n||"."}}v(Ea,"pt$2");he(Ea,"St");de(Ea,"at");Fe(Ea,"buildRelative");const $S={parts:!0};function fo(e){var t;const r=yr.scan(e,$S);return!((t=r.parts)===null||t===void 0)&&t.length?r.parts:[e]}v(fo,"I$d");he(fo,"z");de(fo,"N");Fe(fo,"splitPattern");const xS=/\\(?![()[\]{}!+@])/g;function Qu(e){return Ig(e)}v(Qu,"qt$1");he(Qu,"Ee");de(Qu,"ut");Fe(Qu,"convertPosixPathToPattern");function Zu(e){return Mg(e).replace(xS,"/")}v(Zu,"jt$2");he(Zu,"Re");de(Zu,"ft");Fe(Zu,"convertWin32PathToPattern");const wS=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,ES=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,Ig=Fe(e=>e.replace(wS,"\\$&"),"escapePosixPath"),Mg=Fe(e=>e.replace(ES,"\\$&"),"escapeWin32Path"),SS=Ng?Mg:Ig;function Sa(e,t){if(t?.caseSensitiveMatch===!1)return!0;const r=yr.scan(e);return r.isGlob||r.negated}v(Sa,"ft$1");he(Sa,"Dt");de(Sa,"k");Fe(Sa,"isDynamicPattern");function Qt(...e){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...e)}v(Qt,"D$k");he(Qt,"D");de(Qt,"E");Fe(Qt,"log");function mo(e){return typeof e=="string"?[e]:e??[]}v(mo,"L$c");he(mo,"U");de(mo,"W");Fe(mo,"ensureStringArray");const kS=/^(\/?\.\.)+/,jS=/\\(?=[()[\]{}!*+?@|])/g;function sn(e,t,r,n){var i;const o=t.cwd;let s=e;e[e.length-1]==="/"&&(s=e.slice(0,-1));const a=s.lastIndexOf("/"),l=(a===-1?s:s.slice(a+1)).startsWith("!(");s[s.length-1]!=="*"&&!l&&t.expandDirectories&&(s+="/**");const c=SS(o);s=IE(s.replace(jS,""))?$r.relative(c,s):$r.normalize(s);const u=(i=kS.exec(s))===null||i===void 0?void 0:i[0],p=fo(s);if(u){const d=(u.length+1)/3;let m=0;const g=c.split("/");for(;m<d&&p[m+d]===g[g.length+m-d];)s=s.slice(0,(d-m-1)*3)+s.slice((d-m)*3+p[m+d].length+1)||".",m++;const y=$r.join(o,u.slice(m*3));y[0]!=="."&&r.root.length>y.length&&(r.root=y,r.depthOffset=-d+m)}if(!n&&r.depthOffset>=0){var f;(f=r.commonPath)!==null&&f!==void 0||(r.commonPath=p);const d=[],m=Math.min(r.commonPath.length,p.length);for(let g=0;g<m;g++){const y=p[g];if(y==="**"&&!p[g+1]){d.pop();break}if(g===p.length-1||y!==r.commonPath[g]||Sa(y))break;d.push(y)}r.depthOffset=d.length,r.commonPath=d,r.root=d.length>0?$r.join(o,...d):o}return s}v(sn,"j$n");he(sn,"E");de(sn,"$");Fe(sn,"normalizePattern");function ka(e,t,r){const n=[],i=[],o=[];for(const s of e.ignore)s&&(s[0]!=="!"||s[1]==="("?i.push(sn(s,e,r,!0)):o.push(s.slice(1)));for(const s of t)s&&(s[0]!=="!"||s[1]==="("?n.push(sn(s,e,r,!1)):(s[1]!=="!"||s[2]==="(")&&i.push(sn(s.slice(1),e,r,!0)));return{match:n,ignore:i,unignore:o}}v(ka,"gt$2");he(ka,"xt");de(ka,"St");Fe(ka,"processPatterns");function ja(e,t){const r=e.cwd,n={root:r,depthOffset:0},i=ka(e,t,n);e.debug&&Qt("internal processing patterns:",i);const{absolute:o,caseSensitiveMatch:s,debug:a,dot:l,followSymbolicLinks:c,onlyDirectories:u}=e,p=n.root.replace(Tg,""),f={dot:l,nobrace:e.braceExpansion===!1,nocase:!s,noextglob:e.extglob===!1,noglobstar:e.globstar===!1,posix:!0},d=i.unignore.length>0,m=d?yr(i.unignore,f):void 0,g=d?Ti(i.unignore,f):void 0,y=yr(i.match,{...f,ignore:i.ignore,onIgnore:m?O=>m(O.output)&&yr.constants.UNIGNORE:void 0}),x=yr(i.ignore,f),j=Ti(i.match,f),R=Ni(r,p,o),b=o?R:Ni(r,p,!0),E=i.match.length>0&&i.match.every(O=>O==="**"||O==="**/*"),h=i.ignore.length>0||d||!E?(O,k)=>{const C=b(k,!0);return C==="."||g&&g(C)?!1:!j(C)||x(C)}:void 0;let A;e.deep!==void 0&&(A=Math.round(e.deep-n.depthOffset));const _=new mS({filters:[a?(O,k)=>{const C=R(O,k),B=y(C);return B&&Qt(`matched ${C}`),B}:(O,k)=>{const C=R(O,k);return y(C)}],exclude:a&&h?(O,k)=>{const C=h(O,k);return Qt(`${C?"skipped":"crawling"} ${k}`),C}:h,fs:e.fs,pathSeparator:"/",relativePaths:!o,resolvePaths:o,includeBasePath:o,resolveSymlinks:c,excludeSymlinks:!c,excludeFiles:u,includeDirs:u||!e.onlyFiles,maxDepth:A,signal:e.signal}).crawl(p);return e.debug&&Qt("internal properties:",{...n,root:p}),[_,r!==p&&!o&&Ea(r,p)]}v(ja,"dt$1");he(ja,"At");de(ja,"vt");Fe(ja,"buildCrawler");function ho(e,t){if(t)for(let r=e.length-1;r>=0;r--)e[r]=t(e[r]);return e}v(ho,"z$g");he(ho,"N");de(ho,"U");Fe(ho,"formatPaths");const AS={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function Aa(e){const t={...AS,...e};return t.cwd=(t.cwd instanceof URL?ME(t.cwd):Rg(t.cwd)).replace(Tg,"/"),t.ignore=mo(t.ignore),t.fs&&(t.fs={readdir:t.fs.readdir||PE,readdirSync:t.fs.readdirSync||_E,realpath:t.fs.realpath||RE,realpathSync:t.fs.realpathSync||OE,stat:t.fs.stat||AE,statSync:t.fs.statSync||jE}),t.debug&&Qt("globbing with options:",t),t}v(Aa,"yt$2");he(Aa,"_t");de(Aa,"pt");Fe(Aa,"getOptions");function go(e,t={}){var r;if(e&&t?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");const n=gS(e)||typeof e=="string",i=mo((r=n?e:e.patterns)!==null&&r!==void 0?r:"**/*"),o=Aa(n?t:e);return i.length>0?ja(o,i):[]}v(go,"G$g");he(go,"Q");de(go,"G");Fe(go,"getCrawler");async function ep(e,t){const[r,n]=go(e,t);return r?ho(await r.withPromise(),n):[]}v(ep,"mt$2");he(ep,"Ie");de(ep,"bt");Fe(ep,"glob");function Oa(e,t){const[r,n]=go(e,t);return r?ho(r.sync(),n):[]}v(Oa,"vt$2");he(Oa,"Le");de(Oa,"xt");Fe(Oa,"globSync");var OS=Object.defineProperty,RS=v((e,t)=>OS(e,"name",{value:t,configurable:!0}),"r$9"),_S=Object.defineProperty,PS=RS((e,t)=>_S(e,"name",{value:t,configurable:!0}),"a"),CS=Object.defineProperty,TS=PS((e,t)=>CS(e,"name",{value:t,configurable:!0}),"n");const Dg=TS((e,t)=>Oa(e,t),"globSync");var NS=Object.defineProperty,tp=v((e,t)=>NS(e,"name",{value:t,configurable:!0}),"o$k"),IS=Object.defineProperty,Ra=tp((e,t)=>IS(e,"name",{value:t,configurable:!0}),"c"),Pl,Xf;function rp(){if(Xf)return Pl;Xf=1;var e=Object.defineProperty,t=Ra((r,n)=>e(r,"name",{value:n,configurable:!0}),"l");/*!
16
- * is-extglob <https://github.com/jonschlinkert/is-extglob>
17
- *
18
- * Copyright (c) 2014-2016, Jon Schlinkert.
19
- * Licensed under the MIT License.
20
- */return Pl=t(function(r){if(typeof r!="string"||r==="")return!1;for(var n;n=/(\\).|([@?!+*]\(.*\))/g.exec(r);){if(n[2])return!0;r=r.slice(n.index+n[0].length)}return!1},"isExtglob"),Pl}v(rp,"h$l");tp(rp,"q");Ra(rp,"requireIsExtglob");var Cl,Yf;function np(){if(Yf)return Cl;Yf=1;var e=Object.defineProperty,t=Ra((s,a)=>e(s,"name",{value:a,configurable:!0}),"x");/*!
21
- * is-glob <https://github.com/jonschlinkert/is-glob>
22
- *
23
- * Copyright (c) 2014-2017, Jon Schlinkert.
24
- * Released under the MIT License.
25
- */var r=rp(),n={"{":"}","(":")","[":"]"},i=t(function(s){if(s[0]==="!")return!0;for(var a=0,l=-2,c=-2,u=-2,p=-2,f=-2;a<s.length;){if(s[a]==="*"||s[a+1]==="?"&&/[\].+)]/.test(s[a])||c!==-1&&s[a]==="["&&s[a+1]!=="]"&&(c<a&&(c=s.indexOf("]",a)),c>a&&(f===-1||f>c||(f=s.indexOf("\\",a),f===-1||f>c)))||u!==-1&&s[a]==="{"&&s[a+1]!=="}"&&(u=s.indexOf("}",a),u>a&&(f=s.indexOf("\\",a),f===-1||f>u))||p!==-1&&s[a]==="("&&s[a+1]==="?"&&/[:!=]/.test(s[a+2])&&s[a+3]!==")"&&(p=s.indexOf(")",a),p>a&&(f=s.indexOf("\\",a),f===-1||f>p))||l!==-1&&s[a]==="("&&s[a+1]!=="|"&&(l<a&&(l=s.indexOf("|",a)),l!==-1&&s[l+1]!==")"&&(p=s.indexOf(")",l),p>l&&(f=s.indexOf("\\",l),f===-1||f>p))))return!0;if(s[a]==="\\"){var d=s[a+1];a+=2;var m=n[d];if(m){var g=s.indexOf(m,a);g!==-1&&(a=g+1)}if(s[a]==="!")return!0}else a++}return!1},"strictCheck"),o=t(function(s){if(s[0]==="!")return!0;for(var a=0;a<s.length;){if(/[*?{}()[\]]/.test(s[a]))return!0;if(s[a]==="\\"){var l=s[a+1];a+=2;var c=n[l];if(c){var u=s.indexOf(c,a);u!==-1&&(a=u+1)}if(s[a]==="!")return!0}else a++}return!1},"relaxedCheck");return Cl=t(function(s,a){if(typeof s!="string"||s==="")return!1;if(r(s))return!0;var l=i;return a&&a.strict===!1&&(l=o),l(s)},"isGlob"),Cl}v(np,"y$n");tp(np,"G");Ra(np,"requireIsGlob");var MS=Object.defineProperty,Bg=v((e,t)=>MS(e,"name",{value:t,configurable:!0}),"t$f"),DS=Object.defineProperty,ip=Bg((e,t)=>DS(e,"name",{value:t,configurable:!0}),"s");const BS=De(import.meta.url),Zn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,LS=ip(e=>{if(typeof Zn<"u"&&Zn.versions&&Zn.versions.node){const[t,r]=Zn.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Zn.getBuiltinModule(e)}return BS(e)},"__cjs_getBuiltinModule"),{access:WS}=LS("node:fs/promises");var FS=Object.defineProperty,HS=ip((e,t)=>FS(e,"name",{value:t,configurable:!0}),"o");async function et(e,t=qc){Rr(e),e=Je(e);try{return await WS(e,t),!0}catch{return!1}}v(et,"i$h");Bg(et,"d");ip(et,"m");HS(et,"isAccessible");var qS=Object.defineProperty,zS=v((e,t)=>qS(e,"name",{value:t,configurable:!0}),"a$p"),GS=Object.defineProperty,US=zS((e,t)=>GS(e,"name",{value:t,configurable:!0}),"e"),KS=np();const JS=so(KS);var VS=Object.defineProperty,XS=US((e,t)=>VS(e,"name",{value:t,configurable:!0}),"s");const Xc=XS((e,t)=>JS(e,t),"isGlob");var YS=Object.defineProperty,QS=v((e,t)=>YS(e,"name",{value:t,configurable:!0}),"f$p"),ZS=Object.defineProperty,Lg=QS((e,t)=>ZS(e,"name",{value:t,configurable:!0}),"i");const e2=De(import.meta.url),ei=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Wg=Lg(e=>{if(typeof ei<"u"&&ei.versions&&ei.versions.node){const[t,r]=ei.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return ei.getBuiltinModule(e)}return e2(e)},"__cjs_getBuiltinModule"),{readFile:t2}=Wg("node:fs/promises"),{unzip:r2,brotliDecompress:n2}=Wg("node:zlib");var i2=Object.defineProperty,Fg=Lg((e,t)=>i2(e,"name",{value:t,configurable:!0}),"n");const o2={brotli:n2,gzip:r2,none:Fg((e,t)=>{t(null,e)},"none")},op=Fg(async(e,t)=>{if(Rr(e),e=Je(e),!await et(e))throw new T$(`unable to read the non-accessible file: ${e}`);if(!await et(e,Ph))throw new Error(`Unable to read the non-readable file: ${e}`);const{buffer:r,compression:n,encoding:i,flag:o}=t??{};return await t2(e,o?{encoding:i,flag:o}:{encoding:i}).then(async s=>await new Promise((a,l)=>{o2[n??"none"](s,(c,u)=>{c?l(c):a(r?u:u.toString())})})).catch(s=>{throw s})},"readFile");var s2=Object.defineProperty,Hg=v((e,t)=>s2(e,"name",{value:t,configurable:!0}),"t$d"),a2=Object.defineProperty,qg=Hg((e,t)=>a2(e,"name",{value:t,configurable:!0}),"t"),l2=Object.defineProperty,c2=qg((e,t)=>l2(e,"name",{value:t,configurable:!0}),"i");async function Cn(e,t,r){typeof t=="object"&&(r=t,t=void 0);const n=await op(e,{buffer:!0,encoding:void 0});let i=new TextDecoder().decode(n);const{beforeParse:o,color:s}=r??{};return typeof o=="function"&&(i=o(i)),$u(i,t,Je(e),{color:s})}v(Cn,"a$o");Hg(Cn,"l");qg(Cn,"c");c2(Cn,"readJson");var u2=Object.defineProperty,p2=v((e,t)=>u2(e,"name",{value:t,configurable:!0}),"a$n"),f2=Object.defineProperty,d2=p2((e,t)=>f2(e,"name",{value:t,configurable:!0}),"t"),m2=Object.defineProperty,h2=d2((e,t)=>m2(e,"name",{value:t,configurable:!0}),"t");const g2=h2(e=>{const t={force:!0,recursive:!0};return e?.maxRetries!==void 0&&(t.maxRetries=e.maxRetries),e?.retryDelay!==void 0&&(t.retryDelay=e.retryDelay),t},"buildRmOptions");var v2=Object.defineProperty,b2=v((e,t)=>v2(e,"name",{value:t,configurable:!0}),"i$f"),y2=Object.defineProperty,zg=b2((e,t)=>y2(e,"name",{value:t,configurable:!0}),"i");const $2=De(import.meta.url),ti=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Gg=zg(e=>{if(typeof ti<"u"&&ti.versions&&ti.versions.node){const[t,r]=ti.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return ti.getBuiltinModule(e)}return $2(e)},"__cjs_getBuiltinModule"),{existsSync:x2}=Gg("node:fs"),{mkdir:w2,readdir:E2,rm:S2}=Gg("node:fs/promises");var k2=Object.defineProperty,j2=zg((e,t)=>k2(e,"name",{value:t,configurable:!0}),"o");const A2=j2(async(e,t)=>{if(Rr(e),!x2(e)){await w2(e,{recursive:!0});return}const r=await E2(e),n=g2(t);for(const i of r)await S2(le(Je(e),i),n)},"emptyDir");var O2=Object.defineProperty,R2=v((e,t)=>O2(e,"name",{value:t,configurable:!0}),"m$o"),_2=Object.defineProperty,Ug=R2((e,t)=>_2(e,"name",{value:t,configurable:!0}),"s");const P2=De(import.meta.url),ri=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,C2=Ug(e=>{if(typeof ri<"u"&&ri.versions&&ri.versions.node){const[t,r]=ri.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return ri.getBuiltinModule(e)}return P2(e)},"__cjs_getBuiltinModule"),{mkdir:T2,writeFile:N2,stat:I2,rename:Qf,chown:M2,chmod:D2,unlink:B2}=C2("node:fs/promises");var L2=Object.defineProperty,W2=Ug((e,t)=>L2(e,"name",{value:t,configurable:!0}),"d");const F2=W2(async(e,t,r)=>{r={encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...r},Rr(e),N$(t),e=Je(e);const n=`${e}.tmp`;try{const i=await et(e,qc);if(!i&&r.recursive){const s=Ce(e);await et(s,qc)||await T2(s,{recursive:!0})}let o;if(await N2(n,I$(t),{encoding:r.encoding,flag:r.flag}),i&&!r.overwrite&&(o=await I2(e),r.chown??={gid:o.gid,uid:o.uid},await Qf(e,`${e}.bak`)),r.chown)try{await M2(n,r.chown.uid,r.chown.gid)}catch{}await D2(n,o&&!r.mode?o.mode:r.mode??438),await Qf(n,e)}catch(i){throw new Error(`Failed to write file at: ${e} - ${i.message}`,{cause:i})}finally{await et(n)&&await B2(`${e}.tmp`)}},"writeFile");var H2=Object.defineProperty,q2=v((e,t)=>H2(e,"name",{value:t,configurable:!0}),"a$l"),z2=Object.defineProperty,Kg=q2((e,t)=>z2(e,"name",{value:t,configurable:!0}),"n");const G2=De(import.meta.url),ni=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,U2=Kg(e=>{if(typeof ni<"u"&&ni.versions&&ni.versions.node){const[t,r]=ni.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return ni.getBuiltinModule(e)}return G2(e)},"__cjs_getBuiltinModule"),{readFile:K2}=U2("node:fs/promises");var J2=Object.defineProperty,V2=Kg((e,t)=>J2(e,"name",{value:t,configurable:!0}),"r");const Jg=V2(async(e,t,r={})=>{const{detectIndent:n,indent:i,replacer:o,stringify:s=JSON.stringify,...a}={indent:" ",...r};let l=i,c=`
26
- `;if(await et(e,Ph))try{const p=await K2(e,"utf8");if(n){const{indent:f}=M$(p);l=f}c=p.endsWith(`
27
- `)?`
28
- `:""}catch(p){if(p.code!=="ENOENT")throw p}const u=s(t,o,l);await F2(e,`${u}${c}`,a)},"writeJson");var X2=Object.defineProperty,Dt=v((e,t)=>X2(e,"name",{value:t,configurable:!0}),"S$b"),Y2=Object.defineProperty,Re=Dt((e,t)=>Y2(e,"name",{value:t,configurable:!0}),"b");const Q2=De(import.meta.url),Gr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_a=Re(e=>{if(typeof Gr<"u"&&Gr.versions&&Gr.versions.node){const[t,r]=Gr.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Gr.getBuiltinModule(e)}return Q2(e)},"__cjs_getBuiltinModule"),{createRequire:Z2}=_a("node:module"),xr=Gr,{execFileSync:ek}=_a("node:child_process"),vi=_a("node:fs"),tk=_a("node:tty"),KB={alert:7,critical:6,debug:1,emergency:8,error:5,informational:2,notice:3,trace:2,warning:4},rk={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"}},nk=Symbol("EMPTY");var ik=Object.defineProperty,ok=Re((e,t)=>ik(e,"name",{value:t,configurable:!0}),"g$6");const sk=ok(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 ak=Object.defineProperty,Vg=Re((e,t)=>ak(e,"name",{value:t,configurable:!0}),"T$5"),lk=Object.defineProperty,Ne=Vg((e,t)=>lk(e,"name",{value:t,configurable:!0}),"l"),ck=Object.defineProperty,uk=Ne((e,t)=>ck(e,"name",{value:t,configurable:!0}),"L");const St=uk((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="",u="",p="";for(let f=0;f<s;f+=1){const d=f+1===e.length,m=f+2===e.length;p=`…(${String(e.length-f)})`;let g=e[f];r.truncate=l-c.length-(d?0:o.length);const y=u||a(g,t,r,n)+(d?"":o),x=c.length+y.length,j=x+p.length;if(d&&x>l&&c.length+p.length<=l||!d&&!m&&j>l)break;g=e[f+1];const R=m?"":o;if(d?u="":u=a(g,t,r,n)+R,!d&&m&&j>l&&x+u.length>l)break;if(c+=y,!d&&!m&&x+u.length>=l){p=`…(${String(e.length-f-1)})`;break}p=""}return`${c}${p}`},"inspectList");var pk=Object.defineProperty,Pa=Ne((e,t)=>pk(e,"name",{value:t,configurable:!0}),"s$6");const fk=Pa(([e,t],r,n)=>(n.truncate-=3,t?`${n.stylize(String(e),"yellow")}=${n.stylize(`"${t}"`,"string")}`:n.stylize(String(e),"yellow")),"inspectAttribute"),dk=Pa((e,t,r)=>{switch(e.nodeType){case 1:return Xg(e,e,r,t);case 3:return t(e.data,t,r);default:return t(e,t,r)}},"inspectNode"),Yc=Pa((e,t,r,n)=>St(e,e,t,r,dk,`
29
- `),"inspectNodeCollection"),Xg=Pa((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+=St(i.map(f=>[f,e.getAttribute(f)]),t,r,n,fk," ")),r.truncate-=c.length;const{truncate:u}=r;let p=Yc(e.children,r,n,void 0);return p&&p.length>u&&(p=`…(${String(e.children.length)})`),`${s}${c}${a}${p}${l}`},"inspectHTMLElement");var mk=Object.defineProperty,hk=Ne((e,t)=>mk(e,"name",{value:t,configurable:!0}),"n$4");const gk=hk((e,t,r)=>e.length===0?"Arguments []":(t.truncate-=13,`Arguments [ ${St(e,e,t,r)} ]`),"inspectArguments");var vk=Object.defineProperty,Yg=Ne((e,t)=>vk(e,"name",{value:t,configurable:!0}),"r$3");const bk=Yg((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:`
30
- ${Array.from({length:t+1}).join(r)}`}},"getIndent"),Ca=Yg((e,t)=>{if(e.length===0)return"";const r=t.prev+t.base;return r+e.split(", ").join(`,${r}`)+t.prev},"indentedJoin");var yk=Object.defineProperty,Qg=Ne((e,t)=>yk(e,"name",{value:t,configurable:!0}),"i$5");const $k=/^[a-z_]\w*$/i,xk=/^"|"$/g,wk=Qg((e,t)=>{if($k.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(xk,"'")},"quoteComplexKey"),Ii=Qg(([e,t],r,n,i)=>{n.truncate-=2;let o;typeof e=="string"?o=wk(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 Ek=Object.defineProperty,Zg=Ne((e,t)=>Ek(e,"name",{value:t,configurable:!0}),"p$4");const Sk=Zg(e=>{for(const t of e)if(Array.isArray(t)||typeof t=="object"&&t!==null)return!0;return!1},"multiLineValues"),kk=Zg((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=St(e,e,t,r);t.truncate-=o.length;let s="";i.length>0&&(s=St(i.map(l=>[l,e[l]]),e,t,r,Ii));const a=n&&Sk(e);return a&&(o=Ca(o,n)),`[${a?"":" "}${o}${s?`, ${s}`:""}${a?"":" "}]`},"inspectArray");var jk=Object.defineProperty,Ak=Ne((e,t)=>jk(e,"name",{value:t,configurable:!0}),"o$7");const Zf=/\d(?=(?:\d{3})+(?!\d))/g,Ok=/\d{3}/g,Rk=/_$/,ev=Ak((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(Zf,"$&_")}.${i.replace(Ok,"$&_").replace(Rk,"")}`}}return t.replace(Zf,"$&_")},"addNumericSeparator");var _k=Object.defineProperty,tv=Ne((e,t)=>_k(e,"name",{value:t,configurable:!0}),"i$4");const Pk=tv(e=>e>="\uD800"&&e<="\uDBFF","isHighSurrogate"),ar=tv((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&&Pk(e[o-1])&&(o-=1),`${e.slice(0,o)}${r}`}return e},"truncate");var Ck=Object.defineProperty,Tk=Ne((e,t)=>Ck(e,"name",{value:t,configurable:!0}),"e$4");const ed=Tk((e,t)=>{let r=ar(e.toString(),t.truncate-1);return r!=="…"&&(r+="n"),t.stylize(t.numericSeparator?ev(e,r):r,"bigint")},"inspectBigInt");var Nk=Object.defineProperty,Ik=Ne((e,t)=>Nk(e,"name",{value:t,configurable:!0}),"y");const Mk=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:void 0),Qo=Ik((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=Mk(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 u=St(i.map(d=>[d,e[d]]),e,t,r,Ii),p=St(o.map(d=>[d,e[d]]),e,t,r,Ii);let f="";return u&&p&&(f=", "),n?`${c}{${Ca(u+f+p,n)}}`:`${c}{ ${u}${f}${p} }`},"inspectObject");var Dk=Object.defineProperty,Bk=Ne((e,t)=>Dk(e,"name",{value:t,configurable:!0}),"s$3");const Lk=Bk((e,t,r,n)=>{let i="";return i=i||e.constructor.name,(!i||i==="_class")&&(i="<Anonymous Class>"),t.truncate-=i.length,`${i} ${Qo(e,t,r,n)}`},"inspectClass");var Wk=Object.defineProperty,Fk=Ne((e,t)=>Wk(e,"name",{value:t,configurable:!0}),"i$3");const Hk=Fk((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${ar(n[1],t.truncate-i.length-1)}`,"date")},"inspectDate");var qk=Object.defineProperty,zk=Ne((e,t)=>qk(e,"name",{value:t,configurable:!0}),"c$4");const Gk=new Set(["column","columnNumber","description","fileName","line","lineNumber","message","name","number","stack"]),Uk=zk((e,t,r)=>{const n=Object.getOwnPropertyNames(e).filter(a=>!Gk.has(a)),{name:i}=e;t.truncate-=i.length;let o="";typeof e.message=="string"?o=ar(e.message,t.truncate):n.unshift("message"),o=o?`: ${o}`:"",t.truncate-=o.length+5;const s=St(n.map(a=>[a,e[a]]),e,t,r,Ii);return`${i}${o}${s?` { ${s} }`:""}`},"inspectObject");var Kk=Object.defineProperty,Jk=Ne((e,t)=>Kk(e,"name",{value:t,configurable:!0}),"c$3");const td=Jk((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} ${ar(i,t.truncate-11)}]`,"special"):t.stylize(`[${r}]`,"special")},"inspectFunction");var Vk=Object.defineProperty,rv=Ne((e,t)=>Vk(e,"name",{value:t,configurable:!0}),"p$3");const Xk=rv(([e,t],r,n,i)=>(n.truncate-=4,e=i(e,r,n),n.truncate-=e.length,`${e} => ${i(t,r,n)}`),"inspectMapEntry"),Yk=rv((e,t,r,n)=>{if(e.size<=0)return"Map (0) {}";t.truncate-=7;let i=St([...e.entries()],e,t,r,Xk);return n&&(i=Ca(i,n)),`Map (${String(e.size)}) {${n?"":" "}${i}${n?"":" "}}`},"inspectMap");var Qk=Object.defineProperty,Zk=Ne((e,t)=>Qk(e,"name",{value:t,configurable:!0}),"e$3");function jr(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(ar(t.numericSeparator?ev(e,e.toString()):e.toString(),t.truncate),"number")}v(jr,"R$g");Dt(jr,"Y");Re(jr,"j$5");Vg(jr,"P");Ne(jr,"u$3");Zk(jr,"inspectNumber");var ej=Object.defineProperty,tj=Ne((e,t)=>ej(e,"name",{value:t,configurable:!0}),"e$2");const rj=tj(()=>"Promise{…}","getPromiseValue");var nj=Object.defineProperty,ij=Ne((e,t)=>nj(e,"name",{value:t,configurable:!0}),"p$1");const oj=ij((e,t)=>{const r=t.truncate-(2+e.flags.length);return t.stylize(`/${ar(e.source,r)}/${e.flags}`,"regexp")},"inspectRegExp");var sj=Object.defineProperty,aj=Ne((e,t)=>sj(e,"name",{value:t,configurable:!0}),"i$1");const lj=aj((e,t,r,n)=>{if(e.size===0)return"Set (0) {}";t.truncate-=7;let i=St([...e],e,t,r);return n&&(i=Ca(i,n)),`Set (${String(e.size)}) {${n?"":" "}${i}${n?"":" "}}`},"inspectSet");var cj=Object.defineProperty,uj=Ne((e,t)=>cj(e,"name",{value:t,configurable:!0}),"l");const pj=uj((e,t)=>{const r=t.quoteStyle==="double"?'"':"'";return t.quoteStyle==="double"&&(e=e.replaceAll('"','"')),r+e+r},"wrapQuotes");var fj=Object.defineProperty,nv=Ne((e,t)=>fj(e,"name",{value:t,configurable:!0}),"e$1");const rd=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"),dj={" ":String.raw`\t`,"\n":String.raw`\n`,"\f":String.raw`\f`,"\r":String.raw`\r`,"\b":String.raw`\b`,"'":String.raw`\'`,"\\":"\\\\"},mj=16,hj=nv(e=>dj[e]||String.raw`\u${`0000${e.codePointAt(0).toString(mj)}`.slice(-4)}`,"escape"),nd=nv((e,t)=>(rd.test(e)&&(e=e.replaceAll(rd,hj)),t.stylize(pj(ar(e,t.truncate-2),t),"string")),"inspectString");var gj=Object.defineProperty,vj=Ne((e,t)=>gj(e,"name",{value:t,configurable:!0}),"o");const id=vj(e=>"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString(),"inspectSymbol");var bj=Object.defineProperty,iv=Ne((e,t)=>bj(e,"name",{value:t,configurable:!0}),"f");const yj=iv(e=>typeof Buffer=="function"&&e instanceof Buffer?"Buffer":e[Symbol.toStringTag],"getArrayName"),Lt=iv((e,t,r)=>{const n=yj(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(ar(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=St(i.map(a=>[a,e[a]]),e,t,r,Ii)),`${n}[ ${o}${s?`, ${s}`:""} ]`},"inspectTypedArray");var $j=Object.defineProperty,Ue=Ne((e,t)=>$j(e,"name",{value:t,configurable:!0}),"r");const ms=new WeakMap,Qc={},xj={Arguments:gk,Array:kk,ArrayBuffer:Ue(()=>"","ArrayBuffer"),BigInt:ed,bigint:ed,Boolean:Ue((e,t)=>t.stylize(String(e),"boolean"),"Boolean"),boolean:Ue((e,t)=>t.stylize(String(e),"boolean"),"boolean"),DataView:Ue(()=>"","DataView"),Date:Hk,Error:Uk,Float32Array:Lt,Float64Array:Lt,Function:td,function:td,Generator:Ue(()=>"","Generator"),HTMLCollection:Yc,Int8Array:Lt,Int16Array:Lt,Int32Array:Lt,Map:Yk,NodeList:Yc,null:Ue((e,t)=>t.stylize("null","null"),"null"),Number:jr,number:jr,Promise:rj,RegExp:oj,Set:lj,String:nd,string:nd,Symbol:id,symbol:id,Uint8Array:Lt,Uint8ClampedArray:Lt,Uint16Array:Lt,Uint32Array:Lt,undefined:Ue((e,t)=>t.stylize("undefined","undefined"),"undefined"),WeakMap:Ue((e,t)=>t.stylize("WeakMap{…}","special"),"WeakMap"),WeakSet:Ue((e,t)=>t.stylize("WeakSet{…}","special"),"WeakSet")},od=Symbol.for("nodejs.util.inspect.custom"),wj=Ue((e,t,r,n)=>{if(!("window"in globalThis)&&typeof e[od]=="function")return e[od](n,t);if("inspect"in e&&typeof e.inspect=="function")return e.inspect(n,t);if("constructor"in e&&ms.has(e.constructor))return ms.get(e.constructor)?.(e,t)??"unknown";const i=Qc[r];return i?i(e,t):""},"inspectCustom"),ov=Ue((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=Ue((c,u,p)=>(u&&(n=[...n,u]),ov(c,p,r+1,n)),"inspect"),o=t.indent?bk(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=xj[s];if(a!==void 0)return a(e,t,i,o);if(t.customInspect&&e){const c=wj(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?Qo(e,t,i,o):e&&typeof HTMLElement=="function"&&e instanceof HTMLElement?Xg(e,e,t,i):"constructor"in e?e.constructor!==Object?Lk(e,t,i,o):Qo(e,t,i,o):e===Object(e)?Qo(e,t,i,o):t.stylize(String(e),s)},"internalInspect"),sd=Ue((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:Ue(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 ov(e,r,0,[])},"inspect");Ue((e,t)=>ms.has(e)?!1:(ms.set(e,t),!0),"registerConstructor");Ue((e,t)=>e in Qc?!1:(Qc[e]=t,!0),"registerStringTag");var Ej=Object.defineProperty,Sj=Re((e,t)=>Ej(e,"name",{value:t,configurable:!0}),"r$6");const kj=Sj((e,t)=>(t.__write??t.write.bind(t)).call(t,e),"writeStream");var jj=Object.defineProperty,Aj=Re((e,t)=>jj(e,"name",{value:t,configurable:!0}),"A$4"),Oj=Object.defineProperty,sp=Aj((e,t)=>Oj(e,"name",{value:t,configurable:!0}),"$"),Rj=Object.defineProperty,_j=sp((e,t)=>Rj(e,"name",{value:t,configurable:!0}),"r$1");const Pj=_j(e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
31
- `),"normalizeLF"),Cj=globalThis.process??Object.create(null),ad={versions:{}},ld=new Proxy(Cj,{get(e,t){if(t in e)return e[t];if(t in ad)return ad[t]}});var Tj=Object.defineProperty,Nj=sp((e,t)=>Tj(e,"name",{value:t,configurable:!0}),"b");const Ij=Nj((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 u=Math.max(s-(r+1),0),p=Math.min(t.length,l+n);s===-1&&(u=0),l===-1&&(p=t.length);const f=l-s,d={};if(f)for(let m=0;m<=f;m++){const g=m+s;if(!a)d[g]=!0;else if(m===0){const y=t[g-1]?.length;d[g]=[a,(y??0)-a+1]}else if(m===f)d[g]=[0,c];else{const y=t[g-m]?.length;d[g]=[0,y]}}else a===c?d[s]=a?[a,0]:!0:d[s]=[a,(c??0)-(a??0)];return{end:p,markerLines:d,start:u}},"getMarkerLines");var Mj=Object.defineProperty,To=sp((e,t)=>Mj(e,"name",{value:t,configurable:!0}),"t");const Dj=ld.platform==="win32"&&!ld.env?.WT_SESSION?">":"❯",Bj=To((e,t,r)=>{const n={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...r,color:{gutter:To(m=>m,"gutter"),marker:To(m=>m,"marker"),message:To(m=>m,"message"),...r?.color}},i=typeof t.start.column=="number";let o=Pj(e).split(`
32
- `);typeof n.tabWidth=="number"&&(o=o.map(m=>m.replaceAll(" "," ".repeat(n.tabWidth))));const{end:s,markerLines:a,start:l}=Ij(t,o,n.linesAbove,n.linesBelow),c=String(s).length,{gutter:u,marker:p,message:f}=n.color;let d=o.slice(l,s).map((m,g)=>{const y=l+1+g,x=a[y],j=` ${String(y)}`.slice(-c),R=!a[y+1],b=` ${j}${n.showGutter?" |":""}`;if(x){let E="";if(Array.isArray(x)){const h=m.replaceAll(/[^\t]/g," ").slice(0,Math.max(x[0]-1,0)),A=x[1]||1;E=[`
33
- `,n.prefix+u(b.replaceAll(/\d/g," "))," ",h,p("^").repeat(A)].join(""),R&&n.message&&(E+=` ${f(n.message)}`)}return[n.prefix+p(Dj),u(b),m.length>0?` ${m}`:"",E].join("")}return`${n.prefix} ${u(b)}${m.length>0?` ${m}`:""}`}).join(`
34
- `);return n.message&&!i&&(d=`${n.prefix+" ".repeat(c+1)+n.message}
35
- ${d}`),d},"codeFrame");var Lj=Object.defineProperty,Wj=Re((e,t)=>Lj(e,"name",{value:t,configurable:!0}),"x$3"),Fj=Object.defineProperty,Hj=Wj((e,t)=>Fj(e,"name",{value:t,configurable:!0}),"x"),qj=Object.defineProperty,qt=Hj((e,t)=>qj(e,"name",{value:t,configurable:!0}),"u");const Ar=qt((e,...t)=>{process.env.DEBUG&&process.env.DEBUG==="true"&&console.debug(`error:parse-stacktrace: ${e}`,...t)},"debugLog"),Or="<unknown>",zj=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Gj=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,Uj=/(.*?):(\d+):(\d+)(?:\s<-\s.+:\d+:\d+)?/,Kj=/eval\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*<anonymous>?:(\d+)?:(\d+)/,Jj=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,Vj=/in\s(.*)\s\(at\s(.+)\)\sat/,Xj=/^(?:.*@)?(.*):(\d+):(\d+)$/,Yj=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Qj=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Zj=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,cd=/\(error: (.*)\)/,eA=/at\s/,tA=/^(\S+):(\d+):(\d+)$|^(\S+):(\d+)$/,rA=/^\s+|\s+$/g,nA=/\S*(?:Error: |AggregateError:)/,sv=/^Anonymous function$/,iA=/^\s*in\s.*/,oA=/^.*?\s*at\s.*/,sA=/^.*?\s*@.*|\[native code\]/,av=qt((e,t)=>{const r=e.includes("safari-extension"),n=e.includes("safari-web-extension");return r||n?[e.includes("@")?e.split("@")[0]:Or,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},"extractSafariExtensionDetails"),lv=qt((e,t)=>{const r=Uj.exec(t);r&&(e.file=r[1],e.line=+r[2],e.column=+r[3])},"parseMapped"),aA=qt(e=>{const t=Vj.exec(e);if(t){Ar(`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]??Or,raw:e,type:void 0}}const r=Jj.exec(e);if(r){Ar(`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(eA,""):void 0,line:r[3]?+r[3]:void 0,methodName:r[1]??Or,raw:e,type:e.startsWith("internal")?"internal":void 0};return lv(n,`${r[2]}:${r[3]}:${r[4]}`),n}},"parseNode"),lA=qt(e=>{const t=zj.exec(e);if(t){Ar(`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=Gj.exec(e);if(c){const u=tA.exec(c[1]);u?(t[2]=u[4]??u[1],t[3]=u[5]??u[2],t[4]=u[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 u=Kj.exec(e);u&&(o={column:u[4]?+u[4]:void 0,file:u[2],line:u[3]?+u[3]:void 0},i={column:u[6]?+u[6]:void 0,file:u[1],line:u[5]?+u[5]:void 0,methodName:"eval",raw:u[0],type:"eval"})}}const[s,a]=av(t[1]?t[1].replace(sv,"<anonymous>"):Or,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):lv(l,`${a}:${t[3]}:${t[4]}`),l}},"parseChromium"),cA=qt((e,t)=>{const r=Yj.exec(e);if(r){Ar(`parse gecko error stack line: "${e}"`,`found: ${JSON.stringify(r)}`);const n=r[3]?.includes(" > eval"),i=n&&r[3]&&Qj.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]=av(r[1]?r[1].replace(sv,"<anonymous>"):Or,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"),uA=qt((e,t)=>{const r=Zj.exec(e);if(!(r&&r[2].includes(" > eval"))&&r)return Ar(`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]||Or,raw:e,type:void 0}},"parseFirefox"),pA=qt(e=>{const t=Xj.exec(e);if(t)return Ar(`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:Or,raw:e,type:void 0}},"parseReactAndroidNative"),cv=qt((e,{filter:t,frameLimit:r=50}={})=>{const n=e;let i=(typeof n.stacktrace=="string"?n.stacktrace:e.stack??"").split(`
36
- `).map(o=>(cd.test(o)?o.replace(cd,"$1"):o).replaceAll(rA,"")).filter(o=>!nA.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(iA.test(s))l=aA(s);else if(oA.test(s))l=lA(s);else if(sA.test(s)){let c;if(a===0){const u=e,p=u.columnNumber,f=u.lineNumber,d=u.line,m=u.column;p||f?c={column:p,line:f,type:"firefox"}:(d||m)&&(c={column:m,line:d,type:"safari"})}l=uA(s,c)??cA(s,c)}else l=pA(s);return l?o.push(l):Ar(`parse error stack line: "${s}"`,"not parser found"),o},[])},"parseStacktrace");var fA=Object.defineProperty,dA=Re((e,t)=>fA(e,"name",{value:t,configurable:!0}),"p$6"),mA=Object.defineProperty,uv=dA((e,t)=>mA(e,"name",{value:t,configurable:!0}),"m");const hA=Z2(import.meta.url),Ur=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ap=uv(e=>{if(typeof Ur<"u"&&Ur.versions&&Ur.versions.node){const[t,r]=Ur.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Ur.getBuiltinModule(e)}return hA(e)},"__cjs_getBuiltinModule"),{existsSync:gA,readFileSync:vA}=ap("node:fs"),{relative:bA}=ap("node:path"),{cwd:yA}=Ur,{fileURLToPath:$A}=ap("node:url");var xA=Object.defineProperty,Le=uv((e,t)=>xA(e,"name",{value:t,configurable:!0}),"o");const Tn=Le((e,t,r)=>r===0?e:t===" "?e+" ".repeat(r):e+" ".repeat(t*r),"getPrefix"),wA=Le((e,t)=>{const r=e.replace("async file:","file:");return bA(t,r.startsWith("file:")?$A(r):r)},"getRelativePath"),EA=Le((e,t,r)=>{if(t)return r.title(e.message);const n=e.message?`: ${e.message}`:"";return r.title(e.name+n)},"getTitleText"),pv=Le((e,{color:t,hideErrorTitle:r,indentation:n,prefix:i},o)=>`${Tn(i,n,o)}${EA(e,r,t)}
37
- `,"getMessage"),fv=Le((e,{color:t,indentation:r,prefix:n},i)=>{if(e.hint===void 0)return;const o=Tn(n,r,i);let s="";if(Array.isArray(e.hint))for(const a of e.hint)s+=`${o+a}
38
- `;else s+=o+e.hint;return t.hint(s)},"getHint"),lp=Le((e,{color:t,cwd:r,displayShortPath:n,indentation:i,prefix:o},s=0)=>{const a=n?wA(e.file,r):e.file,{fileLine:l,method:c}=t;return`${Tn(o,i,s)}at ${e.methodName?`${c(e.methodName)} `:""}${l(a)}:${l(e.line?.toString()??"")}`},"getMainFrame"),dv=Le((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 u=e.file.replace("file://","");if(!gA(u))return;const p=vA(u,"utf8");return Bj(p,{start:{column:e.column,line:e.line}},{color:t,linesAbove:n,linesBelow:i,prefix:Tn(o,r,c),showGutter:s,showLineNumbers:a,tabWidth:l})},"getCode"),mv=Le((e,t,r)=>{if(e.errors.length===0)return;let n=`${Tn(t.prefix,t.indentation,r)}Errors:
39
-
40
- `,i=!0;for(const o of e.errors)i?i=!1:n+=`
41
-
42
- `,n+=gv(o,{...t,framesMaxLimit:1,hideErrorCodeView:t.hideErrorErrorsCodeView},r+1);return`
43
- ${n}`},"getErrors"),hv=Le((e,t,r)=>{let n=`${Tn(t.prefix,t.indentation,r)}Caused by:
44
-
45
- `;const i=e.cause;n+=pv(i,t,r);const o=cv(i).shift(),s=fv(i,t,r);if(s&&(n+=`${s}
46
- `),o&&(n+=lp(o,t,r),!t.hideErrorCauseCodeView)){const a=dv(o,t,r);a!==void 0&&(n+=`
47
- ${a}`)}if(i.cause)n+=`
48
- ${hv(i,t,r+1)}`;else if(i instanceof AggregateError){const a=mv(i,t,r);a!==void 0&&(n+=`
49
- ${a}`)}return`
50
- ${n}`},"getCause"),SA=Le((e,t)=>(e.length>0?`
51
- `:"")+e.map(r=>lp(r,t)).join(`
52
- `),"getStacktrace"),gv=Le((e,t,r)=>{const n={cwd:yA(),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:Le(s=>s,"fileLine"),gutter:Le(s=>s,"gutter"),hint:Le(s=>s,"hint"),marker:Le(s=>s,"marker"),message:Le(s=>s,"message"),method:Le(s=>s,"method"),title:Le(s=>s,"title"),...t.color}},i=cv(e,{filter:t.filterStacktrace,frameLimit:n.framesMaxLimit}),o=i.shift();return[t.hideMessage?void 0:pv(e,n,r),fv(e,n,r),o?lp(o,n,r):void 0,o&&!n.hideErrorCodeView?dv(o,n,r):void 0,e instanceof AggregateError?mv(e,n,r):void 0,e.cause===void 0?void 0:hv(e,n,r),i.length>0?SA(i,n):void 0].filter(Boolean).join(`
53
- `).replaceAll("\\","/")},"internalRenderError"),Tl=Le((e,t={})=>{if(t.framesMaxLimit!==void 0&&t.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return gv(e,t,0)},"renderError");var kA=Object.defineProperty,cp=Re((e,t)=>kA(e,"name",{value:t,configurable:!0}),"s$3"),jA=Object.defineProperty,Ta=cp((e,t)=>jA(e,"name",{value:t,configurable:!0}),"l");const up=[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],pp=[12288,12288,65281,65376,65504,65510],fp=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],dp=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],Na=[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 AA=Object.defineProperty,OA=Ta((e,t)=>AA(e,"name",{value:t,configurable:!0}),"r$1");const vo=OA((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 RA=Object.defineProperty,Cr=Ta((e,t)=>RA(e,"name",{value:t,configurable:!0}),"r");const _A=up[0],PA=up.at(-1),CA=pp[0],TA=pp.at(-1),NA=fp[0],IA=fp.at(-1),MA=dp[0],DA=dp.at(-1),BA=Na[0],LA=Na.at(-1),ud=19968,[WA,FA]=Nn(Na);function Nn(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(ud>=i&&ud<=o)return[i,o];o-i>r-t&&(t=i,r=o)}return[t,r]}v(Nn,"X$b");Dt(Nn,"ge");Re(Nn,"b$2");cp(Nn,"b");Ta(Nn,"N");Cr(Nn,"findWideFastPathRange");const vv=Cr(e=>e<_A||e>PA?!1:vo(up,e),"isAmbiguous"),bv=Cr(e=>e<CA||e>TA?!1:vo(pp,e),"isFullWidth"),HA=Cr(e=>e<NA||e>IA?!1:vo(fp,e),"isHalfWidth"),qA=Cr(e=>e<MA||e>DA?!1:vo(dp,e),"isNarrow"),yv=Cr(e=>e>=WA&&e<=FA?!0:e<BA||e>LA?!1:vo(Na,e),"isWide");function In(e){return vv(e)?"ambiguous":bv(e)?"fullwidth":HA(e)?"halfwidth":qA(e)?"narrow":yv(e)?"wide":"neutral"}v(In,"ee$a");Dt(In,"pe");Re(In,"v$2");cp(In,"q");Ta(In,"getCategory");Cr(In,"getCategory");var zA=Object.defineProperty,Ia=Re((e,t)=>zA(e,"name",{value:t,configurable:!0}),"i$3"),GA=Object.defineProperty,Ma=Ia((e,t)=>GA(e,"name",{value:t,configurable:!0}),"a"),UA=Object.defineProperty,mp=Ma((e,t)=>UA(e,"name",{value:t,configurable:!0}),"e");function Tr(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}v(Tr,"V$b");Dt(Tr,"J");Re(Tr,"s$2");Ia(Tr,"s");Ma(Tr,"r");mp(Tr,"validate");function Nr(e){return Tr(e),In(e)}v(Nr,"H$c");Dt(Nr,"K");Re(Nr,"r$5");Ia(Nr,"p");Ma(Nr,"eastAsianWidthType");mp(Nr,"eastAsianWidthType");function bo(e,{ambiguousAsWide:t=!1}={}){return Tr(e),bv(e)||yv(e)||t&&vv(e)?2:1}v(bo,"ve$5");Dt(bo,"Fe");Re(bo,"o$5");Ia(bo,"W");Ma(bo,"eastAsianWidth");mp(bo,"eastAsianWidth");var KA=Object.defineProperty,JA=Re((e,t)=>KA(e,"name",{value:t,configurable:!0}),"p$3"),VA=Object.defineProperty,$v=JA((e,t)=>VA(e,"name",{value:t,configurable:!0}),"e"),XA=Object.defineProperty,YA=$v((e,t)=>XA(e,"name",{value:t,configurable:!0}),"E");const xv=String.raw,pd=xv`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,QA=YA(()=>new RegExp(xv`\p{RI}{2}|(?![#*\d](?!\uFE0F?\u20E3))${pd}(?:\u200D${pd})*`,"gu"),"default");var ZA=Object.defineProperty,eO=$v((e,t)=>ZA(e,"name",{value:t,configurable:!0}),"p");const Mn=new Set(["\x1B","›"]),Da="\x07",wv="[",hp="m",hs="]8;;",tO=39,rO=/[\u200B\uFEFF\u2060-\u2064]/g,nO=new RegExp(`(?:\\${wv}(?<code>\\d+)m|\\${hs}(?<uri>.*)${Da})`),iO=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]])),ii=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,No=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Zo=QA();eO(e=>e.replace(Zo,""),"stripEmoji");var oO=Object.defineProperty,sO=Re((e,t)=>oO(e,"name",{value:t,configurable:!0}),"E"),aO=Object.defineProperty,lO=sO((e,t)=>aO(e,"name",{value:t,configurable:!0}),"A"),cO=Object.defineProperty,Ba=lO((e,t)=>cO(e,"name",{value:t,configurable:!0}),"d");const fd=new Map,Io=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,es=Ba(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"),uO=Ba((e,t)=>{const r=Math.floor(e/65536),n=e%65536;let i=fd.get(r);if(i||(i=new Map,fd.set(r,i)),i.has(n))return i.get(n);let o;if(es(e)==="latin")o=t.width.regular;else if(es(e)==="control")o=t.width.control;else if(es(e)==="wide")o=t.width.wide;else switch(Nr(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"),pO=Ba(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"),Zc=Ba((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?Zc(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 u=e.includes("\x1B")||e.includes("›");for(;s<i;){if(u&&(e[s]==="\x1B"||e[s]==="›")){if(e.startsWith("\x1B]8;;",s)){const y="\x1B]8;;\x07",x=y.length,j=e.indexOf("\x07",s+5);if(j!==-1){const R=e.indexOf(y,j+1);if(R!==-1){const b=R+x,E=e.slice(j+1,R).replace(ii,""),h=Zc(E,{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}),A=h.width;if(h.truncated)c=!0,l=Math.min(l,s);else if(a+A>n&&(l=Math.min(l,s),c=!0,a+A>r.truncation.limit))break;if(a+=A,s=b,c&&a>=r.truncation.limit)break;continue}}}if(ii.lastIndex=s,ii.test(e)){const y=ii.lastIndex-s,x=r.truncation.countAnsiEscapeCodes?y:r.width.ansi;if(a+x>n&&(l=Math.min(l,s),a+x>r.truncation.limit)){c=!0;break}a+=x,s=ii.lastIndex;continue}}const d=e.codePointAt(s);if(d===8203||d===65279||d>=8288&&d<=8292){s+=1;continue}if(d===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(Io.lastIndex=s,Io.test(e)){const y=(Io.lastIndex-s)*r.width.regular;if(a+y>n){const x=Math.floor((n-a)/r.width.regular);if(l=Math.min(l,s+x),a+y>r.truncation.limit){c=!0;break}}a+=y,s=Io.lastIndex;continue}if((d<=31||d>=127&&d<=159)&&(No.lastIndex=s,No.test(e))){const y=(No.lastIndex-s)*r.width.control;if(a+y>n&&(l=Math.min(l,s+Math.floor((n-a)/r.width.control)),a+y>r.truncation.limit)){c=!0;break}a+=y,s=No.lastIndex;continue}if(Zo.lastIndex=s,Zo.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=Zo.lastIndex;continue}const m=e.codePointAt(s)??0;if(pO(m)){s+=m>65535?2:1;continue}let g;if(o)g=uO(m,r);else switch(es(m)){case"control":{g=r.width.control;break}case"latin":{g=r.width.regular;break}case"wide":{g=r.width.wide;break}case"zero":{g=0;break}default:switch(Nr(m)){case"ambiguous":{g=r.width.ambiguousIsNarrow?r.width.regular:r.width.wide;break}case"fullwidth":{g=r.width.fullWidth;break}case"wide":{g=r.width.wide;break}default:g=r.width.regular}}if(a+g>n&&(l=Math.min(l,s),a+g>r.truncation.limit)){c=!0;break}a+=g,s+=m>65535?2:1}let p=a,f=!1;return c&&r.truncation.limit>=r.truncation.ellipsisWidth&&(p=r.truncation.limit,f=!0),{ellipsed:f,index:c?l:i,truncated:c,width:p}},"getStringTruncatedWidth");var fO=Object.defineProperty,dO=Re((e,t)=>fO(e,"name",{value:t,configurable:!0}),"i$1"),mO=Object.defineProperty,hO=dO((e,t)=>mO(e,"name",{value:t,configurable:!0}),"e"),gO=Object.defineProperty,vO=hO((e,t)=>gO(e,"name",{value:t,configurable:!0}),"r");const ht=vO((e,t={})=>Zc(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var bO=Object.defineProperty,Ev=Re((e,t)=>bO(e,"name",{value:t,configurable:!0}),"b"),yO=Object.defineProperty,Ir=Ev((e,t)=>yO(e,"name",{value:t,configurable:!0}),"d"),$O=Object.defineProperty,xO=Ir((e,t)=>$O(e,"name",{value:t,configurable:!0}),"a");const wO=/\x1B\[(\d+)m/;let Sv=class{static{v(this,"Wt")}static{Dt(this,"Pt")}static{Re(this,"T")}static{Ev(this,"T")}static{Ir(this,"d")}static{xO(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const r=wO.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 EO=Object.defineProperty,kv=Ir((e,t)=>EO(e,"name",{value:t,configurable:!0}),"o");const jv=kv((e,t)=>{if(!Mn.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const r=!0,n=e.slice(t+1,t+1+hs.length).join("")===hs;return{isInsideEscape:r,isInsideLinkEscape:n}},"checkEscapeSequence"),SO=kv((e,t={})=>{const r=new Sv;let n="",i=!1,o="",s="",a=!1;const l=[...e];for(let c=0;c<l.length;c++){const u=l[c];if(u&&Mn.has(u)){if(n){const g=t.getWidth?.(n)??0,y={isEscapeSequence:!1,isGrapheme:!0,text:n,width:g};if(a&&(y.isHyperlink=!0,y.hyperlinkUrl=s),t.onSegment?.(y,r)===!1)return;n=""}i=!0,o=u;const d=jv(l,c),{isInsideLinkEscape:m}=d;if(m){let g=c+1;for(s="";g<l.length;){const x=l[g];if(x===Da)break;s+=x,g+=1}s=s.slice(4);const y={hyperlinkUrl:s,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(y,r)===!1)return;c=g,a=!0,i=!1,o="";continue}if(c+1<l.length&&l[c+1]==="\\"&&a){const g={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.(g,r)===!1)return;a=!1,s="",c+=1,i=!1,o="";continue}}if(i){if(o!==u&&(o+=u),u===hp){i=!1,r.processEscape(o);const d={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};if(t.onSegment?.(d,r)===!1)return;o=""}continue}n+=u;const p=t.getWidth?.(n)??0,f={isEscapeSequence:!1,isGrapheme:!0,text:n,width:p};if(a&&(f.isHyperlink=!0,f.hyperlinkUrl=s),t.onSegment?.(f,r)===!1)return;n=""}if(n){const c=t.getWidth?.(n)??0,u={isEscapeSequence:!1,isGrapheme:!0,text:n,width:c};a&&(u.isHyperlink=!0,u.hyperlinkUrl=s),t.onSegment?.(u,r)}if(o){const c={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};t.onSegment?.(c,r)}},"processAnsiString");var kO=Object.defineProperty,jO=Ir((e,t)=>kO(e,"name",{value:t,configurable:!0}),"t$1");const dd=jO(e=>`${Mn.values().next().value}${wv}${String(e)}${hp}`,"wrapAnsiCode");var AO=Object.defineProperty,OO=Ir((e,t)=>AO(e,"name",{value:t,configurable:!0}),"s");const md=OO(e=>`${Mn.values().next().value}${hs}${e}${Da}`,"wrapAnsiHyperlink");var RO=Object.defineProperty,_O=Ir((e,t)=>RO(e,"name",{value:t,configurable:!0}),"l");const PO=_O(e=>{if(e.length===0)return"";if(e.length===1)return e[0];let t="",r,n;const i=e.join(`
54
- `),o=[...i];let s=0;for(const[a,l]of o.entries()){if(t+=l,Mn.has(l)){const u=nO.exec(i.slice(s))?.groups??{};if(u.code!==void 0){const p=Number.parseFloat(u.code);r=p===tO?void 0:p}else u.uri!==void 0&&(n=u.uri.length===0?void 0:u.uri)}const c=iO.get(Number(r));o[a+1]===`
55
- `?(n&&(t+=md("")),r&&c&&(t+=dd(c))):l===`
56
- `&&(r&&c&&(t+=dd(r)),n&&(t+=md(n))),s+=l.length}return t},"preserveAnsi");var CO=Object.defineProperty,rr=Ir((e,t)=>CO(e,"name",{value:t,configurable:!0}),"f");const Av=/(?=\s)|(?<=\s)/,Ov=/^\s+$/,Nl=rr(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"),wr=rr(e=>{const t=e.split(" ");let r=t.length;for(;r>0&&ht(t[r-1])===0;)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},"stringVisibleTrimSpacesRight"),Rv=rr((e,t,r)=>{if(e.length===0)return[""];if(t<=0)return[e];const n=[],i=new Sv;let o="",s=0,a=!1,l=!1,c="",u=0;for(;u<e.length;){const p=e[u];if(Mn.has(p)){a=!0,c=p,o+=p,l=jv([...e],u).isInsideLinkEscape,u+=1;continue}if(a){c+=p,o+=p,l?p===Da&&(a=l=!1):p===hp&&(a=!1,i.processEscape(c)),u+=1;continue}const f=ht(p),d=p===" ";if(f===0){o+=p,u+=1;continue}if(s+f>t&&(o&&n.push(o+i.getEndEscapesForAllActiveAttributes()),o=i.getStartEscapesForAllActiveAttributes(),s=ht(o),d&&r)){for(;u<e.length&&e[u]===" ";)u+=1;continue}if(o+=p,s+=f,s===t&&u<e.length-1&&(n.push(o+i.getEndEscapesForAllActiveAttributes()),o=i.getStartEscapesForAllActiveAttributes(),s=ht(o),u+1<e.length&&e[u+1]===" "&&r)){for(u+=1;u<e.length&&e[u]===" ";)u+=1;continue}u+=1}return o&&n.push(o+i.getEndEscapesForAllActiveAttributes()),r?n.map(p=>wr(p)):n},"wrapWithBreakAtWidth"),TO=rr((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 SO(n,{getWidth:ht,onSegment:rr((a,l)=>{const c=a.text??"";if(a.isEscapeSequence)o+=c;else{const u=c===" ";if(a.width===0)return o+=c,!0;if(s+a.width>t&&(o&&i.push(o),o=l.getStartEscapesForAllActiveAttributes(),s=0,u))return r||i.push(l.getStartEscapesForAllActiveAttributes()+c),!0;o+=c,s+=a.width}return!0},"onSegment")}),o&&i.push(o),r?i.map(a=>wr(a)):i},"wrapCharByChar"),NO=rr((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(Av),o=[];let s="",a=0,l=0;for(;l<i.length;){const c=i[l],u=Ov.test(c),p=ht(c);if(c.length===0){l+=1;continue}if(r&&u&&a===0){l+=1;continue}if(a+p>t&&a>0){r?o.push(wr(s)):o.push(s),s="",a=0;continue}s+=c,a+=p,l+=1}return s&&(r?o.push(wr(s)):o.push(s)),o},"wrapWithWordBoundaries"),IO=rr((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(Av),o=[];let s="",a=0,l=0;for(;l<i.length;){const c=i[l],u=Ov.test(c),p=ht(c);if(c.length===0){l+=1;continue}if(r&&u&&a===0){l+=1;continue}if(p>t){s&&o.push(Nl(r?wr(s):s));const f=Rv(c,t,r);if(f.length>0){for(let d=0;d<f.length-1;d+=1)o.push(f[d]);s=f.at(-1),a=ht(s)}else s="",a=0;l+=1;continue}if(a+p>t&&a>0&&(o.push(Nl(r?wr(s):s)),s="",a=0,r&&u)){l+=1;continue}s+=c,a+=p,l+=1}return s&&o.push(Nl(r?wr(s):s)),o},"wrapAndBreakWords"),bi={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},MO=rr((e,t={})=>{const{removeZeroWidthCharacters:r=!0,trim:n=!0,width:i=80,wrapMode:o=bi.PRESERVE_WORDS}=t;if(n&&e.trim()==="")return"";let s=e.normalize("NFC").replaceAll(`\r
57
- `,`
58
- `);return r&&(s=s.replaceAll(rO,"")),s.split(`
59
- `).map(a=>{if(n&&a.trim()==="")return"";let l;switch(o){case bi.BREAK_AT_CHARACTERS:{l=TO(a,i,n);break}case bi.BREAK_WORDS:{l=IO(a,i,n);break}case bi.STRICT_WIDTH:{l=Rv(a,i,n);break}default:l=NO(a,i,n)}return PO(l)}).join(`
60
- `)},"wordWrap");var DO=Object.defineProperty,lr=Re((e,t)=>DO(e,"name",{value:t,configurable:!0}),"n$2");const _v=80,Pv=24,eu=lr((e,t,{shell:r,env:n}={})=>ek(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:r,env:n}).trim(),"exec"),ts=lr((e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),"create"),Cv=lr((e,t)=>{const{columns:r,rows:n}=ts(e,t);if(!(Number.isNaN(r)||Number.isNaN(n))&&!(r===_v&&n===Pv))return{columns:r,rows:n}},"createIfNotDefault"),BO=lr(()=>{if(xr.platform!=="linux")return!0;try{const e=vi.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 La(){const{env:e,stdout:t,stderr:r}=xr;if(t?.columns&&t?.rows)return ts(t.columns,t.rows);if(r?.columns&&r?.rows)return ts(r.columns,r.rows);if(e.COLUMNS&&e.LINES)return ts(e.COLUMNS,e.LINES);const n={columns:_v,rows:Pv};return xr.platform==="win32"?Il()??n:xr.platform==="darwin"?hd()??Il()??n:hd()??Il()??LO()??n}v(La,"_e$4");Dt(La,"ja");Re(La,"O");lr(La,"terminalSize");const hd=lr(()=>{try{const e=xr.platform==="darwin"?vi.constants.O_EVTONLY|vi.constants.O_NONBLOCK:vi.constants.O_NONBLOCK,{columns:t,rows:r}=tk.WriteStream(vi.openSync("/dev/tty",e));return{columns:t,rows:r}}catch{}},"devTty"),Il=lr(()=>{try{const e=eu("tput",["cols"],{env:{TERM:"dumb",...xr.env}}),t=eu("tput",["lines"],{env:{TERM:"dumb",...xr.env}});if(e&&t)return Cv(e,t)}catch{}},"tput"),LO=lr(()=>{try{if(!BO())return;const e=eu("resize",["-u"]).match(/\d+/g);if(e.length===2)return Cv(e[0],e[1])}catch{}},"resize");var WO=Object.defineProperty,FO=Re((e,t)=>WO(e,"name",{value:t,configurable:!0}),"r$2");const HO=FO(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 qO=Object.defineProperty,zO=Re((e,t)=>qO(e,"name",{value:t,configurable:!0}),"r$1");const{bold:GO,cyan:UO,green:gd,grey:KO,magenta:JO,red:VO,yellow:Ml}=As,XO={indent:2,quoteStyle:"single",stylize:zO((e,t)=>{const r={bigint:Ml,boolean:Ml,date:JO,null:GO,number:Ml,regexp:VO,special:UO,string:gd,symbol:gd,undefined:KO};return Object.hasOwn(r,t)?r[t](e):e},"stylize")};var YO=Object.defineProperty,QO=Re((e,t)=>YO(e,"name",{value:t,configurable:!0}),"o$1");const{bold:ZO,underline:eR}=As,tR=QO((e,t)=>{let r=t.uppercase.label?e.toUpperCase():e;return r=t.underline.label?eR(r):r,t.bold.label&&(r=ZO(r)),r},"formatLabel");var rR=Object.defineProperty,Tv=Re((e,t)=>rR(e,"name",{value:t,configurable:!0}),"o");const nR=Tv(e=>[e.getHours(),e.getMinutes(),e.getSeconds()].map(t=>String(t).padStart(2,"0")).join(":"),"dateFormatter");class iR{static{v(this,"to")}static{Dt(this,"ro")}static{Re(this,"AbstractPrettyReporter")}static{Tv(this,"AbstractPrettyReporter")}styles;loggerTypes;constructor(t){this.styles={bold:{label:!1},dateFormatter:nR,underline:{label:!1,message:!1,prefix:!1,suffix:!1},uppercase:{label:!1},...t},this.loggerTypes=rk}setLoggerTypes(t){this.loggerTypes=t}}var oR=Object.defineProperty,Nv=v((e,t)=>oR(e,"name",{value:t,configurable:!0}),"x$l"),sR=Object.defineProperty,Iv=Nv((e,t)=>sR(e,"name",{value:t,configurable:!0}),"x");De(import.meta.url);const aR=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{stdout:lR,stderr:cR}=aR;var uR=Object.defineProperty,Mv=Iv((e,t)=>uR(e,"name",{value:t,configurable:!0}),"b");const{bgGrey:pR,bold:vd,cyan:fR,green:dR,greenBright:mR,grey:ur,red:Dl,underline:bd,white:hR}=As,gR=/[\\/]pail[\\/]dist/,Bl=Mv(e=>!gR.test(e),"pailFileFilter");let VB=class extends iR{static{v(this,"he")}static{Nv(this,"ue")}static{Iv(this,"SimpleReporter")}static{Mv(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={...XO,indent:void 0,...n},this.#n={...r,color:{fileLine:dR,hint:fR,marker:Dl,message:Dl,method:mR,title:Dl}},this.#e=lR,this.#i=cR}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(`
61
- `),0):kj(`${r}
62
- `,o)}formatMessage(t){const{columns:r}=La();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:u,message:p,prefix:f,repeated:d,scope:m,suffix:g,traceError:y,type:x}=t,{color:j}=this.loggerTypes[x.name],R=j?As[j]:hR,b=c.map(()=>" ").join(""),E=[];if(c.length>0&&E.push(`${b+ur(`[${c.at(-1)??""}]`)} `),s&&E.push(`${ur(this.styles.dateFormatter(typeof s=="string"?new Date(s):s))} `),i)E.push(vd(R(i)));else{const O=HO(this.loggerTypes);O.length>0&&E.push(ur(" ".repeat(O.length)))}const h=sk(this.loggerTypes),A=ht(h);if(u){const O=ht(u),k=Math.max(0,A-O);E.push(`${vd(R(tR(u,this.styles)))} `," ".repeat(k))}else E.push(" ".repeat(A+1));d&&E.push(`${pR.white(`[${String(d)}x]`)} `),Array.isArray(m)&&m.length>0&&E.push(`${ur(`[${m.join(" > ")}]`)} `),f&&E.push(`${ur(`[${this.styles.underline.prefix?bd(f):f}]`)} `);const _=ht(E.join(""));if(p!==nk){const O=typeof p=="string"?p:sd(p,this.#r);E.push(b+MO(O,{trim:!1,width:n-3,wrapMode:bi.STRICT_WIDTH}))}if(o){let O=!1;E.push(...o.map(k=>{if(k instanceof Error)return O=!0,`
63
-
64
- ${Tl(k,{...this.#n,filterStacktrace:Bl,prefix:b})}`;if(typeof k=="object")return` ${sd(k,this.#r)}`;const C=(O?`
65
-
66
- `:" ")+String(k);return O=!1,C}))}if(a&&E.push(Tl(a,{...this.#n,filterStacktrace:Bl,prefix:b})),y&&E.push(`
67
-
68
- ${Tl(y,{...this.#n,filterStacktrace:Bl,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:b})}`),g&&E.push(` ${b}${ur(this.styles.underline.suffix?bd(g):g)}`),l){const O=(l.name??"")+(l.line?`:${String(l.line)}`:""),k=Math.max(0,_-ht("Caller: "));E.push(`
69
- `,ur("Caller: ")," ".repeat(k),O,`
70
- `)}return E.join("")}};var vR=Object.defineProperty,Dv=v((e,t)=>vR(e,"name",{value:t,configurable:!0}),"o$e"),bR=Object.defineProperty,Bv=Dv((e,t)=>bR(e,"name",{value:t,configurable:!0}),"o"),yR=Object.defineProperty,$R=Bv((e,t)=>yR(e,"name",{value:t,configurable:!0}),"o");let gp=class extends Error{static{v(this,"s")}static{Dv(this,"u")}static{Bv(this,"n")}static{$R(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 xR=Object.defineProperty,Lv=v((e,t)=>xR(e,"name",{value:t,configurable:!0}),"a$j"),wR=Object.defineProperty,Wv=Lv((e,t)=>wR(e,"name",{value:t,configurable:!0}),"o"),ER=Object.defineProperty,SR=Wv((e,t)=>ER(e,"name",{value:t,configurable:!0}),"r");async function yo(e,t,r){const{buffer:n,compression:i,encoding:o="utf8",flag:s,...a}=r??{},l=await op(e,{buffer:n,compression:i,encoding:o,flag:s});return typeof t=="function"?ls(l,t,a):ls(l,a)}v(yo,"n$i");Lv(yo,"g");Wv(yo,"l");SR(yo,"readYaml");var kR=Object.defineProperty,Fv=v((e,t)=>kR(e,"name",{value:t,configurable:!0}),"n$h"),jR=Object.defineProperty,Hv=Fv((e,t)=>jR(e,"name",{value:t,configurable:!0}),"o"),AR=Object.defineProperty,OR=Hv((e,t)=>AR(e,"name",{value:t,configurable:!0}),"t");function $o(e,t,r){const{buffer:n,compression:i,encoding:o="utf8",flag:s,...a}=r??{},l=xu(e,{buffer:n,compression:i,encoding:o,flag:s});return typeof t=="function"?ls(l,t,a):ls(l,a)}v($o,"o$d");Fv($o,"g");Hv($o,"l");OR($o,"readYamlSync");var RR=Object.defineProperty,_R=v((e,t)=>RR(e,"name",{value:t,configurable:!0}),"d$t"),PR=Object.defineProperty,CR=_R((e,t)=>PR(e,"name",{value:t,configurable:!0}),"f"),TR=Object.defineProperty,Dn=CR((e,t)=>TR(e,"name",{value:t,configurable:!0}),"c");const qv=Dn((e,t,r)=>{const n=Ce(e),i=Ce(t),o=i===n?".":tt(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"),zv=Dn(async e=>{const t=await Sg("pnpm-workspace.yaml",{cwd:Ce(e),type:"file"});if(!t)return;const r=await yo(t),n=Array.isArray(r.packages)?r.packages:[];if(!qv(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"),Gv=Dn(e=>{const t=Ag("pnpm-workspace.yaml",{cwd:Ce(e),type:"file"});if(!t)return;const r=$o(t),n=Array.isArray(r.packages)?r.packages:[];if(!qv(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"),NR=Dn((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"),IR=Dn((e,t)=>{for(const[r,n]of Object.entries(e)){if(typeof n!="string")continue;const i=NR(r,n,t);i&&(e[r]=i)}},"resolveDependenciesCatalogReferences"),Wa=Dn((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];IR(i,t)}},"resolveCatalogReferences");var MR=Object.defineProperty,Ve=v((e,t)=>MR(e,"name",{value:t,configurable:!0}),"l$p"),DR=Object.defineProperty,He=Ve((e,t)=>DR(e,"name",{value:t,configurable:!0}),"f");const BR=De(import.meta.url),oi=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,vp=He(e=>{if(typeof oi<"u"&&oi.versions&&oi.versions.node){const[t,r]=oi.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return oi.getBuiltinModule(e)}return BR(e)},"__cjs_getBuiltinModule"),{existsSync:Uv}=vp("node:fs"),{createInterface:LR}=vp("node:readline"),{styleText:dt}=vp("node:util");var WR=Object.defineProperty,Ge=He((e,t)=>WR(e,"name",{value:t,configurable:!0}),"f");const It=Ge(e=>{const t=typeof e;return e!==null&&(t==="object"||t==="function")},"isObject"),FR=Ge(e=>{if(!It(e))return!1;for(const t in e)if(Object.hasOwn(e,t))return!1;return!0},"isEmptyObject"),Kv=new Set(["__proto__","prototype","constructor"]),Jv=1e6,HR=Ge(e=>e>="0"&&e<="9","isDigit");function Mr(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<=Jv}return!1}v(Mr,"w$h");Ve(Mr,"b");He(Mr,"p$1");Ge(Mr,"shouldCoerceToNumber");function an(e,t){return Kv.has(e)?!1:(e&&Mr(e)?t.push(Number.parseInt(e,10)):t.push(e),!0)}v(an,"P$i");Ve(an,"P");He(an,"y");Ge(an,"processSegment");function Fa(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(!an(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")&&!an(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<=Jv&&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"&&!HR(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(!an(r,t))return[];break}case"index":throw new Error("Index was not closed");case"start":{t.push("");break}}return t}v(Fa,"N$h");Ve(Fa,"B");He(Fa,"parsePath");Ge(Fa,"parsePath");function Dr(e){if(typeof e=="string")return Fa(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(Kv.has(n))return[];typeof n=="string"&&Mr(n)?t.push(Number.parseInt(n,10)):t.push(n)}return t}return[]}v(Dr,"b$n");Ve(Dr,"k");He(Dr,"d");Ge(Dr,"normalizePath");function Nt(e,t,r){if(!It(e)||typeof t!="string"&&!Array.isArray(t))return r===void 0?e:r;const n=Dr(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}v(Nt,"d$s");Ve(Nt,"h");He(Nt,"getProperty");Ge(Nt,"getProperty");function Ha(e,t,r){if(!It(e)||typeof t!="string"&&!Array.isArray(t))return e;const n=e,i=Dr(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(!It(e[s])){const a=typeof i[o+1]=="number";e[s]=a?[]:{}}e=e[s]}return n}v(Ha,"T$f");Ve(Ha,"M");He(Ha,"setProperty");Ge(Ha,"setProperty");function bp(e,t){if(!It(e)||typeof t!="string"&&!Array.isArray(t))return!1;const r=Dr(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],!It(e))return!1}}v(bp,"q$f");Ve(bp,"ue");He(bp,"deleteProperty");Ge(bp,"deleteProperty");function er(e,t){if(!It(e)||typeof t!="string"&&!Array.isArray(t))return!1;const r=Dr(t);if(r.length===0)return!1;for(const n of r){if(!It(e)||!(n in e))return!1;e=e[n]}return!0}v(er,"m$m");Ve(er,"y");He(er,"hasProperty");Ge(er,"hasProperty");function Mi(e){if(typeof e!="string")throw new TypeError(`Expected a string, got ${typeof e}`);return e.replaceAll(/[\\.[]/g,String.raw`\$&`)}v(Mi,"E$d");Ve(Mi,"x");He(Mi,"escapePath");Ge(Mi,"escapePath");function qa(e){const t=Object.entries(e);return Array.isArray(e)?t.map(([r,n])=>[Mr(r)?Number.parseInt(r,10):r,n]):t}v(qa,"D$h");Ve(qa,"R");He(qa,"m$2");Ge(qa,"normalizeEntries");function za(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=Mi(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(Mr(o)){const s=Number.parseInt(o,10);r&&i>0?n.push(`.${s}`):n.push(`[${s}]`)}else{const s=Mi(o);n.push(i===0?s:`.${s}`)}}return n.join("")}v(za,"F$d");Ve(za,"Y");He(za,"stringifyPath");Ge(za,"stringifyPath");function*xo(e,t=[],r=new Set){if(!It(e)||FR(e)){t.length>0&&(yield za(t));return}if(!r.has(e)){r.add(e);for(const[n,i]of qa(e))t.push(n),yield*xo(i,t,r),t.pop();r.delete(e)}}v(xo,"j$i");Ve(xo,"S");He(xo,"x");Ge(xo,"deepKeysIterator");function yp(e){return[...xo(e)]}v(yp,"G$e");Ve(yp,"ge");He(yp,"deepKeys");Ge(yp,"deepKeys");function $p(e){const t={};if(!It(e))return t;for(const[r,n]of Object.entries(e))Ha(t,r,n);return t}v($p,"K$a");Ve($p,"de");He($p,"unflatten");Ge($p,"unflatten");var qR=Object.defineProperty,Ll=He((e,t)=>qR(e,"name",{value:t,configurable:!0}),"i");const zR=Ll(async e=>{const{default:t=!1,message:r,transformer:n}=e,i=Ll(s=>{const a=dt(["cyan","bold"],"?"),l=dt(["bold"],s),c=t?`${dt(["greenBright"],"Y")}${dt(["gray"],"/n")}`:`y/${dt(["yellowBright"],"N")}`;return`${a} ${l} ${dt(["gray"],`(${c})`)}`},"formatMessage"),o=Ll(s=>n?n(s):s?dt(["greenBright"],"Yes"):dt(["yellowBright"],"No"),"formatAnswer");return new Promise(s=>{const a=LR({input:process.stdin,output:process.stdout}),l=i(r);a.question(l,c=>{a.close();const u=c.trim().toLowerCase();if(u===""){s(t);return}if(u==="y"||u==="yes"){console.log(`${dt(["greenBright"],"✓")} ${o(!0)}`),s(!0);return}if(u==="n"||u==="no"){console.log(`${dt(["yellowBright"],"✗")} ${o(!1)}`),s(!1);return}console.log(`${dt(["gray"],"→")} ${o(t)}`),s(t)}),a.on("SIGINT",()=>{a.close(),console.log(`
71
- ${dt(["gray"],"→")} ${o(t)}`),s(t)})})},"confirm"),GR=typeof process.stdout<"u"&&!process.versions.deno&&!globalThis.window;var UR=Object.defineProperty,ze=He((e,t)=>UR(e,"name",{value:t,configurable:!0}),"l");const Vv=/, ([^,]*)$/,gs=new Map,Xv=new Map;let KR=class extends Error{static{v(this,"ke")}static{Ve(this,"be")}static{He(this,"M")}static{ze(this,"PackageJsonValidationError")}constructor(t){super(`The following warnings were encountered while normalizing package data:
72
- - ${t.join(`
73
- - `)}`),this.name="PackageJsonValidationError"}};const Ga=ze((e,t,r=[])=>{const n=[];if(U$(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 KR(i)}return e},"normalizeInput"),JR=ze(async e=>await yo(e),"parseYamlFile"),VR=ze(e=>$o(e),"parseYamlFileSync"),XR=ze(async e=>{const t=await op(e);return Mh.parse(t)},"parseJson5File"),YR=ze(e=>{const t=xu(e);return Mh.parse(t)},"parseJson5FileSync"),Yv=ze(async(e,t)=>t?.yaml!==!1&&(e.endsWith(".yaml")||e.endsWith(".yml"))?JR(e):t?.json5!==!1&&e.endsWith(".json5")?XR(e):Cn(e),"parsePackageFile"),Qv=ze((e,t)=>t?.yaml!==!1&&(e.endsWith(".yaml")||e.endsWith(".yml"))?VR(e):t?.json5!==!1&&e.endsWith(".json5")?YR(e):D$(e),"parsePackageFileSync");ze(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 Sg(l,r),i)break;if(!i)throw new gp(`No such file or directory, for ${n.join(", ").replace(Vv," or $1")} found.`);const o=t.cache&&typeof t.cache!="boolean"?t.cache:Xv;if(t.cache&&o.has(i))return o.get(i);const s=await Yv(i,t);if(t.resolveCatalogs){const l=await zv(i);l&&Wa(s,l)}Ga(s,t.strict??!1,t.ignoreWarnings);const a={packageJson:s,path:i};return t.cache&&o.set(i,a),a},"findPackageJson");ze((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=Ag(l,r),i)break;if(!i)throw new gp(`No such file or directory, for ${n.join(", ").replace(Vv," or $1")} found.`);const o=t.cache&&typeof t.cache!="boolean"?t.cache:Xv;if(t.cache&&o.has(i))return o.get(i);const s=Qv(i,t);if(t.resolveCatalogs){const l=Gv(i);l&&Wa(s,l)}Ga(s,t.strict??!1,t.ignoreWarnings);const a={packageJson:s,path:i};return t.cache&&o.set(i,a),a},"findPackageJsonSync");ze(async(e,t={})=>{const{cwd:r,...n}=t,i=Je(r??process.cwd());await Jg(le(i,"package.json"),e,n)},"writePackageJson");ze((e,t={})=>{const{cwd:r,...n}=t,i=Je(r??process.cwd());B$(le(i,"package.json"),e,n)},"writePackageJsonSync");const QR=ze((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(Uv(e)){o=e;const a=t?.cache&&typeof t.cache!="boolean"?t.cache:gs;if(t?.cache&&a.has(o))return a.get(o);n=Qv(o,t),i=!0}else n=$u(e);if(t?.resolveCatalogs)if(i){const a=Gv(e);a&&Wa(n,a)}else throw new Error("The 'resolveCatalogs' option can only be used on a file path.");Ga(n,t?.strict??!1,t?.ignoreWarnings);const s=n;return i&&t?.cache&&(typeof t.cache=="boolean"?gs:t.cache).set(o,s),s},"parsePackageJsonSync"),ZB=ze(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(Uv(e)){o=e;const a=t?.cache&&typeof t.cache!="boolean"?t.cache:gs;if(t?.cache&&a.has(o))return a.get(o);n=await Yv(o,t),i=!0}else n=$u(e);if(t?.resolveCatalogs)if(i){const a=await zv(e);a&&Wa(n,a)}else throw new Error("The 'resolveCatalogs' option can only be used on a file path.");Ga(n,t?.strict??!1,t?.ignoreWarnings);const s=n;return i&&t?.cache&&(typeof t.cache=="boolean"?gs:t.cache).set(o,s),s},"parsePackageJson");ze((e,t,r)=>Nt(e,t,r),"getPackageJsonProperty");ze((e,t)=>er(e,t),"hasPackageJsonProperty");const Zv=ze((e,t,r)=>{const n=Nt(e,"dependencies",{}),i=Nt(e,"devDependencies",{}),o=Nt(e,"peerDependencies",{}),s={...n,...i,...r?.peerDeps===!1?{}:o};for(const a of t)if(er(s,a))return!0;return!1},"hasPackageJsonAnyDependency"),ZR=ze(async(e,t,r="dependencies",n={})=>{const i=Nt(e,"dependencies",{}),o=Nt(e,"devDependencies",{}),s=Nt(e,"peerDependencies",{}),a=[],l={deps:!0,devDeps:!0,peerDeps:!1,...n};for(const c of t)l.deps&&er(i,c)||l.devDeps&&er(o,c)||l.peerDeps&&er(s,c)||a.push(c);if(a.length!==0){if(process.env.CI||GR&&!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 zR(l.confirm)&&await Th(a,{...l.installPackage,cwd:l.cwd?Je(l.cwd):void 0,dev:r==="devDependencies"})}},"ensurePackages");var e_=Object.defineProperty,eb=v((e,t)=>e_(e,"name",{value:t,configurable:!0}),"o$c");const xp=["packem.config.js","packem.config.mjs","packem.config.cjs","packem.config.ts","packem.config.cts","packem.config.mts"],t_=/\.(?:js|mjs|cjs|ts|cts|mts)$/,e5=eb(async(e,t="")=>{let r=t;if(!r){for(const n of xp)if(await et(le(e,n))){r=`./${n}`;break}}if(!t_.test(r))throw new Error("Invalid packem config file extension. Only .js, .mjs, .cjs, .ts, .cts and .mts extensions are allowed.");return r},"findPackemFile"),t5=eb(async e=>{for(const t of xp)if(await et(le(e,t)))return!0;return!1},"hasPackemConfig");var r_=Object.defineProperty,n_=v((e,t)=>r_(e,"name",{value:t,configurable:!0}),"e$5");const i_={esbuild:"esbuild",oxc:"oxc-transform",sucrase:"sucrase",swc:"@swc/core"},yd=n_(async(e,t)=>{const r=Array.isArray(e)?e:[e],n=await H$(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 o_=Object.defineProperty,tb=v((e,t)=>o_(e,"name",{value:t,configurable:!0}),"s$n");const vs=tb(e=>{if(e.endsWith(".mjs")||e.endsWith(".d.mts"))return"esm";if(e.endsWith(".cjs")||e.endsWith(".d.cts"))return"cjs"},"inferExportTypeFromFileName"),tu=tb((e,t,r,n)=>{if(e==="module-sync")return"esm";if(n){const s=vs(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 tu(i,o,r,n)},"inferExportType");var s_=Object.defineProperty,a_=v((e,t)=>s_(e,"name",{value:t,configurable:!0}),"x$k");const l_=new Set(["browser","bun","default","deno","electron","import","module-sync","node","node-addons","require","types","workerd",...Gh,...Uh]),wp=a_((e,t,r,n,i)=>{if(!e)return[];if(typeof e=="string"){const o=vs(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("./",""),u=i.some(p=>c===p||c.startsWith(`${p}/`));if(typeof l=="string"){let p;Number.isInteger(+a)?p={exportKey:"*"}:a.startsWith("./")?p={exportKey:a.replace("./","")}:p={exportKey:a==="."?".":"*",subKey:a},s.push({...p,file:l,key:"exports",type:tu(a,n,t,l),...u&&{ignored:!0}})}else if(typeof l=="object"&&l!==null)for(const[p,f]of Object.entries(l)){if(r===!1&&p==="types")continue;const d=Number.isInteger(+a)?p:a;if(typeof f=="string")s.push({exportKey:d.replace("./",""),file:f,key:"exports",...l_.has(p)?{subKey:p}:{},type:tu(p,n,t,f),...u&&{ignored:!0}});else{const m=d.replace("./",""),g=u||i.some(x=>m===x||m.startsWith(`${x}/`)),y=wp({[d]:f},t,r,[...n,p],i);g&&y.forEach(x=>{x.ignored=!0}),s=[...s,...y]}}}return s}return[]},"extractExportFilenames");var c_=Object.defineProperty,lt=v((e,t)=>c_(e,"name",{value:t,configurable:!0}),"v$m");const ru=new Map,yn=/\.[^./]+$/,ct=/\.d\.[mc]?ts$/,nu=/\.d\.mts$/,iu=/\.d\.cts$/,$d=/\.d\.[mc]ts$/,u_=/^\.\/dist\//,ou=/^dist\//,p_=/^\//,yi=/^\.\//,f_=/\/$/,xd=/\.\w+$/,wd=/\*.*$/,d_=/\.(?:tsx?|cts|mts)$/,m_=/\.[cm]?tsx?$/,h_=/^(.+?)\.[^.]*$/,g_=/(?:\*[^/\\]|\.d\.[mc]?ts|\.\w+)$/,st=lt(e=>e===void 0||e==="node16","allowsCompatibleDeclarationUpgrade"),rb=lt((e,t)=>{const r=ct.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 gn(e)},"getFullExtension"),v_=lt(async e=>{try{return await Yh.readdir(e,{withFileTypes:!0})}catch(t){const{code:r}=t;if(r==="ENOENT")return[];throw t}},"safeReaddir"),nb=lt(async(e,t)=>{const r=await v_(e);return(await Promise.all(r.map(async n=>{const i=yf.join(e,n.name);return n.isDirectory()?nb(i,t):n.isFile()?yf.relative(t,i):[]}))).flat()},"getDirectoryFilesRecursive"),b_=lt(async e=>{let t=ru.get(e);return t||(t=nb(e,e),ru.set(e,t)),t},"getDirectoryFiles"),Ed=lt((e,t,r)=>{const n=e.replace(yn,"");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"),pr=lt((e,t)=>{let r=e;for(const n of t)r=r.replace("*",n);return r},"substituteWildcards"),y_=lt(e=>e.endsWith(".d.mts")?"d.mts":e.endsWith(".d.cts")?"d.cts":"d.ts","resolveDeclarationExtension"),$_=lt((e,t)=>e.key==="exports"&&e.subKey===ji?ji:e.key==="exports"&&e.subKey===gf?gf:t,"getEnvironment"),x_=lt(e=>{const t=e.replace(u_,"").replace(ou,"").replace(yn,"").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"),w_=lt((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 u=c.replace(n,"").replace(p_,"");return s.test(u)});if(a)return a;const l=`${n}/${i}`;return e.find(c=>{const u=c.replace(yn,"");return u===l||u.endsWith(`/${i}`)})??void 0},"tryFindPatternFile"),Ut=lt((e,t,r,n,i,o,s,a)=>{const l=$_(i,o.environment);let{runtime:c}=o.options;const u=i.subKey==="browser"||typeof i.subKey=="string"&&i.subKey.includes("browser"),p=i.file.includes(".browser");if(u||p)c="browser";else{for(const b of Gh)if(i.file.includes(`.${b}.`)||i.subKey===b){c=b;break}(i.subKey==="node"||i.subKey==="workerd"||i.file.includes(".node")||i.file.includes(".workerd")||i.file.includes(".server"))&&(c="node")}const f=rb(i.file,o.options.outputExtensionMap),d=i.file.replace(f,""),m=o.options.outDir.replace(yi,""),g=d.replace(new RegExp(`^(./)?${m}/`),""),y=t.replace(yn,"").split("/").pop()??"",x=g.split("/").pop()??"",j=!t.includes(g)&&y!==x;let R=e.find(b=>b.input===t&&b.environment===l&&b.runtime===c&&b.fileAlias===(j?g:void 0));if(R===void 0?R=e[e.push({environment:l,exportKey:new Set([i.exportKey].filter(Boolean)),fileAlias:j?g:void 0,input:t,runtime:c})-1]:R.exportKey&&i.exportKey&&R.exportKey.add(i.exportKey),s&&(R.isGlob=!0),r&&(R.outDir=n),i.isExecutable)R.executable=!0,R.declaration=!1,i.type==="cjs"?R.cjs=!0:i.type==="esm"&&(R.esm=!0);else{const b=ct.test(i.file),E=a.filter(A=>A.exportKey===i.exportKey),h=E.length>0&&E.every(A=>ct.test(A.file));if(b&&o.options.declaration!==!1){R.declaration=o.options.declaration;const A=y_(i.file);R.declarationExtensions??=new Set,R.declarationExtensions.add(A)}if(b||h){h&&o.options.declaration!==!1&&(R.declaration=o.options.declaration);const A=E.some(O=>nu.test(O.file)),_=E.some(O=>iu.test(O.file));if(A&&_?(st(o.options.declaration)&&(o.options.declaration="compatible"),o.options.emitCJS=!0,o.options.emitESM=!0):_?(o.options.emitCJS=!0,st(o.options.declaration)&&(o.options.declaration="compatible")):A&&(o.options.emitESM=!0,st(o.options.declaration)&&(o.options.declaration="compatible")),h){const O=a.filter(B=>ct.test(B.file)),k=O.some(B=>nu.test(B.file)),C=O.some(B=>iu.test(B.file));E.every(B=>!B.subKey||B.subKey==="types")?(C&&(R.cjs=!0),k&&(R.esm=!0)):(C&&(R.declarationCjs=!0),k&&(R.declarationEsm=!0))}}else i.type==="cjs"?R.cjs=!0:i.type==="esm"&&(R.esm=!0)}j&&!R.fileAlias&&(R.fileAlias=g)},"createOrUpdateEntry");let Sd=!1;const kd=lt(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"),E_=lt(async(e,t,r)=>{const n=e.types||e.typings;ru.clear();const i=[];t.sort((d,m)=>d.split("/").length-m.split("/").length);const o=e.type==="module"?"esm":"cjs",s=r.options.declaration??"node16",a=wp(e.exports,o,s,[],r.options.ignoreExportKeys??[]).filter(d=>!d.ignored),l=new Set;for(const d of a){const m=a.filter(g=>g.exportKey===d.exportKey);if(m.length>0&&m.every(g=>ct.test(g.file))&&!l.has(d.exportKey)){l.add(d.exportKey);const g=m.some(x=>x.file.endsWith(".d.mts")),y=m.some(x=>x.file.endsWith(".d.cts"));g&&y?(st(r.options.declaration)&&(r.options.declaration="compatible"),r.options.emitCJS=!0,r.options.emitESM=!0):y?(st(r.options.declaration)&&(r.options.declaration="compatible"),r.options.emitCJS=!0):g&&(st(r.options.declaration)&&(r.options.declaration="compatible"),r.options.emitESM=!0)}}r.options.declaration??="node16";const c=a.some(d=>d.type==="esm"&&!nu.test(d.file)),u=a.some(d=>d.type==="cjs"&&!iu.test(d.file));c&&u?(r.options.emitESM=!0,r.options.emitCJS=!0):c?r.options.emitESM=!0:u?r.options.emitCJS=!0:o==="esm"?r.options.emitESM=!0:r.options.emitCJS=!0;const p=r.options.emitCJS&&r.options.emitESM;if(r.options.declaration==="node16"&&p&&(r.options.declaration="compatible"),e.bin){const d=(typeof e.bin=="string"?[e.bin]:Object.values(e.bin)).filter(Boolean);for(const m of d){const g=vs(m);if(g&&g!==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:g??o})}}e.main&&a.push({file:e.main,key:"main",type:vs(e.main)??o}),e.module&&a.push({file:e.module,key:"module",type:"esm"}),n&&(kd(r),st(r.options.declaration)&&p&&(r.options.declaration="compatible"),a.push({file:n,key:"types"}));const f=[];if(!r.options.outputExtensionMap){const d=a.some(y=>!y.isExecutable&&!ct.test(y.file)&&y.file.endsWith(".mjs")),m=a.some(y=>!y.isExecutable&&!ct.test(y.file)&&y.file.endsWith(".cjs")),g=a.some(y=>!y.isExecutable&&!ct.test(y.file)&&y.file.endsWith(".js"));d&&!m&&!g?r.options.outputExtensionMap={esm:"mjs"}:m&&!d&&!g&&(r.options.outputExtensionMap={cjs:"cjs"})}for(const d of a){const m=ct.test(d.file),g=rb(d.file,r.options.outputExtensionMap),y=[..._s];if(r.options.outputExtensionMap)for(const k of Object.values(r.options.outputExtensionMap)){const C=k.startsWith(".")?k:`.${k}`;y.includes(C)||y.push(C)}if(!m&&g!==""&&!y.includes(g)||!m&&d_.test(d.file))continue;let x=d.type;if(!x&&m){if(d.file.endsWith(".d.mts"))x="esm";else if(d.file.endsWith(".d.cts"))x="cjs";else if(d.file.endsWith(".d.ts")){const k=a.some(B=>B.subKey==="import"&&B.file.endsWith(".d.mts")),C=a.some(B=>B.subKey==="require"&&B.file.endsWith(".d.cts"));k&&C?x=void 0:x=r.pkg.type==="module"?"esm":"cjs"}}if(ct.test(d.file)||(r.options.emitCJS===void 0&&(x==="cjs"||d.type==="cjs")&&(r.options.emitCJS=!0),r.options.emitESM===void 0&&(x==="esm"||d.type==="esm")&&(r.options.emitESM=!0)),st(r.options.declaration)){const k=r.options.emitCJS&&r.options.emitESM;r.options.declaration=k?"compatible":"node16"}let j=d.file;if(r.options.outputExtensionMap)for(const k of Object.values(r.options.outputExtensionMap)){const C=k.startsWith(".")?k:`.${k}`;if(d.file.endsWith(C)){j=d.file.slice(0,-C.length);break}}j===d.file&&(j=d.file.replace(g_,""));const R=j.endsWith("/");if(R&&["./","/"].includes(j))continue;const b=j.replace(new RegExp(`(./)?${r.options.outDir}`),r.options.sourceDir).replace("./",""),E=R?"":String.raw`(\.d\.[cm]?ts|(\.[cm]?[tj]sx?))$`,h="(?:^|/)";if((d.file.includes("/*")||j.includes("*"))&&d.key==="exports"){Sd||(r.logger.debug("Private subfolders are not supported, if you need this feature please open an issue on GitHub."),Sd=!0);let k;d.exportKey?k=d.exportKey.startsWith("./")?d.exportKey.slice(2):d.exportKey:k=(d.file.startsWith("./")?d.file.slice(2):d.file).replace(ou,"");const C=d.file,B=xd.exec(C);if(C.includes("*")&&!B&&d.exportKey&&!d.subKey){const K=C.replace(wd,"").replace(yi,""),F=k.replace(wd,"").replace(yi,"");if(K!==F){const N=`package.json#exports["${d.exportKey==="."?".":`./${d.exportKey}`}"]`;i.push(`Wildcard pattern must include a file extension: ${C} at ${N}`);continue}}const J=r.options.sourceDir.replace(yi,""),q=ve(r.options.rootDir,J),X=[],te=await b_(q),re=C.split("*").length-1,I=k.split("*").length-1;for(const K of te){const F=Ed(K,k,re);if(F){if(re>I&&re>1){if(F.length>=re){const V=F[0];if(F.every(U=>U===V)){const U=pr(C,F.slice(0,re));U.includes("*")||X.push({input:ve(q,K),output:U})}continue}const W=K.replace(yn,"").split("/").filter(Boolean);if(W.length>=re){const V=Math.floor(W.length/re),U=[];for(let Y=0;Y<re;Y+=1){const L=Y*V,D=Y===re-1?W.length:(Y+1)*V;U.push(W.slice(L,D).join("/"))}const z=U[0];if(U.every(Y=>Y===z)){const Y=pr(C,U);Y.includes("*")||X.push({input:ve(q,K),output:Y})}}else if(W.length>0){const V=W[0];if(W.every(U=>U===V)){const U=Array.from({length:re}).fill(V),z=pr(C,U);z.includes("*")||X.push({input:ve(q,K),output:z})}}continue}if(F.length<re)continue;if(I>0&&I<re&&re>1&&F.length>1){const W=F[0];if(!F.every(V=>V===W))continue}const N=pr(C,F);if(N.includes("*"))continue;X.push({input:ve(q,K),output:N})}}if(X.length===0&&C.includes("*")){let K=(d.file.startsWith("./")?d.file.slice(2):d.file).replace(ou,"");K=K.replace(xd,"");for(const F of te){const N=Ed(F,K,re);if(N){if(re>1&&I<re){if(N.length>=re){const U=N[0];if(N.every(z=>z===U)){const z=pr(C,N);z.includes("*")||X.push({input:ve(q,F),output:z});continue}}const W=F.replace(yn,""),V=K.split("*");if(V.length>=2){const U=V.map(L=>L.replaceAll(/[.+?^${}()|[\]\\]/g,String.raw`\$&`));let z=`${U[0]}(.+)`;for(let L=1;L<U.length;L+=1)z+=U[L],L<U.length-1&&(z+=String.raw`\1`);const Y=new RegExp(`^${z}$`).exec(W);if(Y){const L=Y[1],D=pr(C,Array.from({length:re}).fill(L));D.includes("*")||X.push({input:ve(q,F),output:D})}}continue}if(N.length>=re){if(I>0&&I<re&&re>1&&N.length>1){const V=N[0];if(!N.every(U=>U===V))continue}const W=pr(C,N);W.includes("*")||X.push({input:ve(q,F),output:W})}}}}if(X.length===0){a.length>1||i.push(`Could not find entrypoints matching pattern \`${k}\` for output \`${C}\``);continue}const M=a.filter(K=>K.exportKey===d.exportKey);if(M.length>0&&M.every(K=>ct.test(K.file))){const K=M.some(U=>U.file.endsWith(".d.ts")),F=M.some(U=>U.file.endsWith(".d.mts")),N=M.some(U=>U.file.endsWith(".d.cts"));F&&N?(st(r.options.declaration)&&(r.options.declaration="compatible"),r.options.emitCJS=!0,r.options.emitESM=!0):N?(st(r.options.declaration)&&(r.options.declaration="compatible"),r.options.emitCJS=!0):F&&(st(r.options.declaration)&&(r.options.declaration="compatible"),r.options.emitESM=!0);const W=M.find(U=>U.file.endsWith(".d.ts")),V=W??M.find(U=>U.file.endsWith(".d.mts"))??M.find(U=>U.file.endsWith(".d.cts"))??d;if(!(V===d||W!==void 0&&d===W||W===void 0&&V===d))continue;for(const{input:U,output:z}of X){let Y=z;if(z.endsWith(".d.mts")||z.endsWith(".d.cts"))Y=z.replace($d,".d.ts");else if(!z.endsWith(".d.ts")){const D=z.replace($d,".d.ts");K&&(Y=D)}const L={...V,file:Y,subKey:"types",type:void 0};Ut(f,U,!1,j,L,r,!0,a)}}else for(const{input:K,output:F}of X){const N=ct.test(F);let W=d.type;N||(F.endsWith(".mjs")?W="esm":F.endsWith(".cjs")?W="cjs":F.endsWith(".js")&&!W&&(W=r.pkg.type==="module"?"esm":"cjs"));const V={...d,file:F,...!N&&W&&{type:W}};Ut(f,K,!1,j,V,r,!0,a)}continue}const A=new RegExp(h+b.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)+E);let _=t.find(k=>A.test(k));if(_===void 0){const k=r.options.sourceDir.replace(yi,""),C=ve(r.options.rootDir,k),B=x_(d.file);if(B){const J=w_(t,B.baseName,B.pattern,C);if(J)_=J;else{const q=B.baseName,X=new RegExp(h+q.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)+E);_=t.find(te=>X.test(te))}}else{const J=b.replace(h_,"$1").replace(f_,"");if(Uh.has(d.subKey)){const q=new RegExp(h+J.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)+E);_=t.find(X=>q.test(X))}}}if(_===void 0){Ft(ve(r.options.rootDir,d.file))||i.push(`Could not find entrypoint for \`${d.file}\``);continue}Ft(_)&&m_.test(_)&&kd(r);const O=a.filter(k=>k.exportKey===d.exportKey);if(O.length>0&&O.every(k=>ct.test(k.file))){const k=O.some(J=>J.file.endsWith(".d.mts")),C=O.some(J=>J.file.endsWith(".d.cts"));k&&C?(st(r.options.declaration)&&(r.options.declaration="compatible"),r.options.emitCJS=!0,r.options.emitESM=!0):C?(st(r.options.declaration)&&(r.options.declaration="compatible"),r.options.emitCJS=!0):k&&(st(r.options.declaration)&&(r.options.declaration="compatible"),r.options.emitESM=!0);const B={...d,subKey:"types",type:void 0};Ut(f,_,R,j,B,r,!1,a)}else{const k=q$(_.replace(ju,"")),C=`${k}.cts`,B=`${k}.mts`,J=Ft(C),q=Ft(B),X=d.file.endsWith(".d.mts")||d.file.endsWith(".mjs"),te=d.file.endsWith(".d.cts")||d.file.endsWith(".cjs");X&&q?Ut(f,B,R,j,{...d,type:"esm"},r,!1,a):te&&J?Ut(f,C,R,j,{...d,type:"cjs"},r,!1,a):J&&q?(Ut(f,C,R,j,{...d,type:"cjs"},r,!1,a),Ut(f,B,R,j,{...d,type:"esm"},r,!1,a)):Ut(f,_,R,j,d,r,!1,a)}}return{entries:f,warnings:i}},"inferEntries");var S_=Object.defineProperty,ib=v((e,t)=>S_(e,"name",{value:t,configurable:!0}),"n$f");const si=ib(e=>typeof e=="string"&&e!=="","isNonEmptyString"),k_=ib((e,t)=>{const{publishConfig:r}=e;return r&&(r.bin&&(typeof r.bin=="object"||typeof r.bin=="string")&&(e.bin=r.bin),si(r.type)&&(e.type=r.type),si(r.main)&&(e.main=r.main),si(r.module)&&(e.module=r.module),t===void 0&&si(r.types)?e.types=r.types:t===void 0&&si(r.typings)&&(e.typings=r.typings),r.exports&&typeof r.exports=="object"&&(e.exports=r.exports)),e},"overwriteWithPublishConfig");var j_=Object.defineProperty,A_=v((e,t)=>j_(e,"name",{value:t,configurable:!0}),"p$m");const jd=/.*\/dist\/.*/,Ad=/\/$/,O_={hooks:{"build:prepare":A_(async function(e){if(e.options.unbundle){e.options.entries.length=0;const s=le(e.options.rootDir,e.options.sourceDir);if(!Ft(s))throw new Error("No 'src' directory found. Please provide entries manually.");const a=Df(s,{extensions:[],includeDirs:!1,includeSymlinks:!1,skip:[gr,jd]}).filter(l=>mr.test(l)&&!l.endsWith(".d.ts"));for(const l of a){const c=l.replace(`${s}/`,"").replace(mr,"").replaceAll("/","/");e.options.entries.push({input:l,name:c})}return}if(e.options.entries.length>0)return;const t=le(e.options.rootDir,e.options.sourceDir);if(!Ft(t))throw new Error("No 'src' directory found. Please provide entries manually.");const r=Df(t,{extensions:[],includeDirs:!1,includeSymlinks:!1,skip:[gr,jd]});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=k_(i,e.options.declaration));const o=await E_(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?`${Ze(s.fileAlias)} => ${Ze(s.input.replace(`${e.options.rootDir}/`,"").replace(Ad,"/*"))}`:Ze(s.input.replace(`${e.options.rootDir}/`,"").replace(Ad,"/*"))).join(", ")),Pt([e.options.emitESM&&"esm",e.options.emitCJS&&"cjs",e.options.declaration&&"dts"].filter(Boolean).map(s=>`[${s}]`).join(" ")))},"build:prepare")}};var R_=Object.defineProperty,Ee=v((e,t)=>R_(e,"name",{value:t,configurable:!0}),"r$5");const __=De(import.meta.url),Kr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ep=Ee(e=>{if(typeof Kr<"u"&&Kr.versions&&Kr.versions.node){const[t,r]=Kr.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Kr.getBuiltinModule(e)}return __(e)},"__cjs_getBuiltinModule"),{existsSync:ln}=Ep("node:fs"),{env:cn,cwd:ob}=Kr,{createRequire:wo}=Ep("node:module"),sb=0,un=2,ab=Symbol("findUpStop"),Sp=Ee(e=>{if(!e||!(e instanceof URL)&&typeof e!="string")throw new TypeError("Path must be a non-empty string or URL.")},"assertValidFileOrDirectoryPath"),Od=Ee(e=>{if(e.isFile())return"file";if(e.isDirectory())return"dir";if(e.isSymbolicLink())return"symlink"},"getFileInfoType"),P_=wo(import.meta.url),ai=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,C_=Ee(e=>{if(typeof ai<"u"&&ai.versions&&ai.versions.node){const[t,r]=ai.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return ai.getBuiltinModule(e)}return P_(e)},"__cjs_getBuiltinModule$5"),{lstatSync:Rd,mkdirSync:T_}=C_("node:fs"),N_=Ee(e=>{Sp(e);try{const t=Rd(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(Od(t))}'`);return}catch(t){if(t.code!=="ENOENT")throw t}try{T_(e,{recursive:!0})}catch(t){if(t.code!=="EEXIST")throw t;const r=Rd(e);if(!r.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(Od(r))}'`,{cause:t})}},"ensureDirSync"),I_=/^[A-Z]:\//i,Eo=Ee((e="")=>e&&e.replaceAll("\\","/").replace(I_,t=>t.toUpperCase()),"normalizeWindowsPath$1"),M_=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,D_=/^[A-Z]:$/i,B_=/.(\.[^./]+)$/,L_=/^[/\\]|^[a-z]:[/\\]/i,W_=/\/$/,F_=Ee(()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd"),H_=Ee((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"),Di=Ee(e=>M_.test(e),"isAbsolute$1"),pn=Ee(function(...e){e=e.map(n=>Eo(n));let t="",r=!1;for(let n=e.length-1;n>=-1&&!r;n--){const i=n>=0?e[n]:F_();!i||i.length===0||(t=`${i}/${t}`,r=Di(i))}return t=H_(t,!r),r&&!Di(t)?`/${t}`:t.length>0?t:"."},"resolve"),q_=Ee(function(e){return B_.exec(Eo(e))?.[1]??""},"extname"),kp=Ee(e=>{const t=Eo(e).replace(W_,"").split("/").slice(0,-1);return t.length===1&&D_.test(t[0])&&(t[0]=`${t[0]}/`),t.join("/")||(Di(e)?"/":".")},"dirname$1"),z_=Ee((e,t)=>{const r=Eo(e).split("/").pop();return t&&r.endsWith(t)?r.slice(0,-t.length):r},"basename"),lb=Ee(function(e){const t=L_.exec(e)?.[0]?.replaceAll("\\","/")??"",r=z_(e),n=q_(r);return{base:r,dir:kp(e),ext:n,name:r.slice(0,r.length-n.length),root:t}},"parse"),G_=wo(import.meta.url),li=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,U_=Ee(e=>{if(typeof li<"u"&&li.versions&&li.versions.node){const[t,r]=li.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return li.getBuiltinModule(e)}return G_(e)},"__cjs_getBuiltinModule$4"),{fileURLToPath:K_}=U_("node:url");function cb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}v(cb,"_e$2");Ee(cb,"getDefaultExportFromCjs");var _d,Pd;function ub(){return Pd||(Pd=1,_d=["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"]),_d}v(ub,"ye$2");Ee(ub,"requireBinaryExtensions");var J_=ub();const V_=cb(J_);new Set(V_);const $n=Ee(e=>Eo(e instanceof URL?K_(e):e),"toPath"),X_=wo(import.meta.url),ci=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,pb=Ee(e=>{if(typeof ci<"u"&&ci.versions&&ci.versions.node){const[t,r]=ci.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return ci.getBuiltinModule(e)}return X_(e)},"__cjs_getBuiltinModule$3"),{stat:Y_,lstat:Q_}=pb("node:fs/promises"),{fileURLToPath:Z_}=pb("node:url"),eP=Ee(async(e,t={})=>{const r=t.cwd?$n(t.cwd):process.cwd();let n=pn(r);const{root:i}=lb(n),o=$n(t.stopAt??i),s=pn(n,o),a=t.type??"file",l=Ee(async function(u){return[e]},"getMatchers");t.allowSymlinks??=!0;const c=t.allowSymlinks?Y_:Q_;for(;n&&n!==s&&n!==i;){const u=await l();for(let p of u){if(p===ab)return;if(p===void 0)continue;Buffer.isBuffer(p)?p=p.toString():p instanceof URL&&(p=Z_(p));const f=Di(p)?p:pn(n,p);try{const d=await c(f);if(a==="file"&&d.isFile()||a==="directory"&&d.isDirectory())return f}catch{}}n=kp(n)}},"findUp"),tP=wo(import.meta.url),ui=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,fb=Ee(e=>{if(typeof ui<"u"&&ui.versions&&ui.versions.node){const[t,r]=ui.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return ui.getBuiltinModule(e)}return tP(e)},"__cjs_getBuiltinModule$2"),{statSync:rP,lstatSync:nP}=fb("node:fs"),{fileURLToPath:iP}=fb("node:url"),oP=Ee((e,t={})=>{const r=t.cwd?$n(t.cwd):process.cwd();let n=pn(r);const{root:i}=lb(n),o=$n(t.stopAt??i),s=pn(n,o),a=t.type??"file",l=Ee(function(u){return[e]},"getMatchers");t.allowSymlinks??=!0;const c=t.allowSymlinks?rP:nP;for(;n&&n!==s&&n!==i;){for(let u of l()){if(u===ab)return;if(u===void 0)continue;Buffer.isBuffer(u)?u=u.toString():u instanceof URL&&(u=iP(u));const p=Di(u)?u:pn(n,u);try{const f=c(p);if(a==="file"&&f.isFile()||a==="directory"&&f.isDirectory())return p}catch{}}n=kp(n)}},"findUpSync"),sP=wo(import.meta.url),pi=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,aP=Ee(e=>{if(typeof pi<"u"&&pi.versions&&pi.versions.node){const[t,r]=pi.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return pi.getBuiltinModule(e)}return sP(e)},"__cjs_getBuiltinModule$1"),{access:lP}=aP("node:fs/promises");async function rs(e,t=sb){Sp(e),e=$n(e);try{return await lP(e,t),!0}catch{return!1}}v(rs,"N$f");Ee(rs,"isAccessible");const{accessSync:cP}=Ep("node:fs");function ns(e,t=sb){Sp(e),e=$n(e);try{return cP(e,t),!0}catch{return!1}}v(ns,"z$c");Ee(ns,"isAccessibleSync");let db=class extends Error{static{v(this,"V")}static{Ee(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 uP=/^[A-Z]:\//i,mb=Ee((e="")=>e&&e.replaceAll("\\","/").replace(uP,t=>t.toUpperCase()),"normalizeWindowsPath"),pP=/^[/\\]{2}/,fP=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,hb=/^[A-Z]:$/i,dP=/\/$/,mP=Ee((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"),su=Ee(e=>fP.test(e),"isAbsolute"),hP=Ee(function(e){if(e.length===0)return".";e=mb(e);const t=pP.exec(e),r=su(e),n=e.at(-1)==="/";return e=mP(e,!r),e.length===0?r?"/":n?"./":".":(n&&(e+="/"),hb.test(e)&&(e+="/"),t?r?`//${e}`:`//./${e}`:r&&!su(e)?`/${e}`:e)},"normalize"),Zt=Ee((...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 hP(t)},"join"),gb=Ee(e=>{const t=mb(e).replace(dP,"").split("/").slice(0,-1);return t.length===1&&hb.test(t[0])&&(t[0]=`${t[0]}/`),t.join("/")||(su(e)?"/":".")},"dirname"),bs=Ee((e,t)=>(t?.create&&N_(e),e),"useDirectory");Ee(async(e,t)=>{if(cn.CACHE_DIR&&!["0","1","false","true"].includes(cn.CACHE_DIR))return bs(Zt(cn.CACHE_DIR,e),t);const r=await eP("package.json",{cwd:t?.cwd??ob(),type:"file"});if(!r){if(t?.throwError)throw new db("No such file or directory found.");return}const n=Zt(gb(r),"node_modules"),i=Zt(n,".cache"),o=Zt(i,e);if(!(ln(o)&&!await rs(o,un))&&!(ln(i)&&!await rs(i,un))&&!(ln(n)&&!await rs(n,un)))return bs(o,t)},"findCacheDirectory");const gP=Ee((e,t)=>{if(cn.CACHE_DIR&&!["0","1","false","true"].includes(cn.CACHE_DIR))return bs(Zt(cn.CACHE_DIR,e),t);const r=oP("package.json",{cwd:t?.cwd??ob(),type:"file"});if(!r){if(t?.throwError)throw new db("No such file or directory found.");return}const n=Zt(gb(r),"node_modules"),i=Zt(n,".cache"),o=Zt(i,e);if(!(ln(o)&&!ns(o,un))&&!(ln(i)&&!ns(i,un))&&!(ln(n)&&!ns(n,un)))return bs(o,t)},"findCacheDirectorySync"),vP=gP;var bP=Object.defineProperty,Ua=v((e,t)=>bP(e,"name",{value:t,configurable:!0}),"l$n");const yP=/^(?<value>-?\d+(?:[.,]\d+)*) *(?<type>[a-z]+)?$/i,$P=/^KIBI/,xP=/^MIBI/,wP=/^GIBI/,EP=/^TEBI/,SP=/^PEBI/,kP=/^EXBI/,jP=/^ZEBI/,AP=/^YIBI/,OP=/^(.)IB$/,vb={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"}]},RP=Ua((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"),bb=Ua(e=>{switch(e){case 2:return 1024;case 10:return 1e3;default:throw new Error("Unsupported base.")}},"fromBase"),_P=Ua((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=yP.exec(e)?.groups;if(!n)return Number.NaN;const i=RP(n.value,r.locale),o=(n.type??"Bytes").toUpperCase().replace($P,"KILO").replace(xP,"MEGA").replace(wP,"GIGA").replace(EP,"TERA").replace(SP,"PETA").replace(kP,"EXA").replace(jP,"ZETTA").replace(AP,"YOTTA").replace(OP,"$1B"),s=vb[r.units].findIndex(l=>l.short[0].toUpperCase()===o[0]),a=bb(r.base);return i*a**s},"parseBytes"),Qe=Ua((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=bb(r),u=Math.abs(e),p=t?.space??!0?" ":"",f=vb[a],d=f.findIndex(j=>j.short===s);if(e===0){const j=Math.min(0,Math.max(d,f.length-1));return"0"+p+f[j][o?"long":"short"]}const m=d===-1?Math.min(Math.floor(Math.log(u)/Math.log(c)),f.length-1):d,g=f[m][o?"long":"short"],y=e/c**m,x=n<0?void 0:n;return new Intl.NumberFormat(i,{maximumFractionDigits:x,minimumFractionDigits:x,...l}).format(y)+p+g},"formatBytes");var PP=Object.defineProperty,CP=v((e,t)=>PP(e,"name",{value:t,configurable:!0}),"n$e");const TP=CP((e,t,r,n,i,o,s,a,l,c,u,p,f,d)=>{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),u!==void 0&&(m.decimal=u),p!==void 0&&(m.unitMap=p),f!==void 0&&(m.groupSeparator=f),d!==void 0&&(m.placeholderSeparator=d),m},"createDurationLanguage"),NP={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"},IP=TP(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",".",NP,",","_");var MP=Object.defineProperty,DP=v((e,t)=>MP(e,"name",{value:t,configurable:!0}),"o$9");const BP=DP(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 LP=Object.defineProperty,So=v((e,t)=>LP(e,"name",{value:t,configurable:!0}),"g$j");const yb=So((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"),Cd=So(({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=yb(e,o));const u=c.toString();if(!r._hideCountIf2||e!==2)if(a){l="";for(const d of u)l+=d==="."?s:a[d]}else l=u.replace(".",s);else l="";const p=r[t];let f=p;return typeof p=="function"&&(f=p(e)),r._hideCountIf2&&e===2&&(i=""),r._numberFirst?f+i+l:l+i+f},"renderPiece"),WP=So((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 p=n[s];l=a===r.length-1?c/p:Math.floor(c/p),o[s]=l,c-=l*p}if(t.round){let p=i;for(a=0;a<r.length;a++)if(s=r[a],l=o[s],l!==0&&(p--,p===0)){for(let f=a+1;f<r.length;f++){const d=r[f],m=o[d];o[s]=(o[s]??0)+m*n[d]/n[s],o[d]=0}break}for(a=r.length-1;a>=0;a--){if(s=r[a],l=o[s],l===0)continue;const f=Math.round(l);if(o[s]=f,a===0)break;const d=r[a-1],m=n[d],g=Math.floor(f*n[s]/m);if(g)o[d]=(o[d]??0)+g,o[s]=0;else break}}const u=[];for(a=0;a<r.length&&u.length<i;a++){if(s=r[a],l=o[s],l&&!t.round&&u.length===i-1){let p,f=0;for(p=a+1,r.length;p<r.length;p++){const d=r[p];f+=o[d]*(t.unitMeasures[d]/t.unitMeasures[s])}l+=f,t.maxDecimalPoints!==void 0&&(l=yb(l,t.maxDecimalPoints))}l&&u.push({unitCount:l,unitName:s})}return u},"getPieces"),FP=So((e,t,r)=>{const{language:n,units:i}=t;if(e.length===0){const p=i.at(-1);return Cd({unitCount:0,unitName:p},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(p=>Cd(p,n,t));let u;return!o||e.length===1?u=c.join(a):e.length===2?u=c.join(o):u=c.slice(0,-1).join(a)+(s?",":"")+o+(c.at(-1)??""),l&&(u=l.replace("%s",u)),u},"formatPieces"),Td=So((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:IP,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};BP(r.language);const n=Math.abs(e),i=WP(n,r);return FP(i,r,e)},"duration");var HP=Object.defineProperty,$b=v((e,t)=>HP(e,"name",{value:t,configurable:!0}),"l$m");const Nd=$b(async e=>{try{const t=await e();return typeof t.rolldown=="function"?t.rolldown:void 0}catch{return}},"tryImport"),xb=$b(async()=>{const e=await Nd(()=>import("@rolldown/node"));if(e)return e;const t=await Nd(()=>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 qP=Object.defineProperty,zP=v((e,t)=>qP(e,"name",{value:t,configurable:!0}),"_$b"),GP=Object.defineProperty,UP=zP((e,t)=>GP(e,"name",{value:t,configurable:!0}),"j"),KP=Object.defineProperty,Br=UP((e,t)=>KP(e,"name",{value:t,configurable:!0}),"u");const wb="__packem_cache_wrapped",au="__packem_watch_files",Kt=Br(e=>typeof e=="function"?e:e.handler,"getHandler"),Wl=Br(e=>{if(e&&typeof e=="object"&&"filter"in e)return e.filter},"getHookFilter"),Id=new Map,JP=Br(e=>{const t=JSON.stringify(e);let r=Id.get(t);return r===void 0&&(r=Wt(t),Id.set(t,r)),r},"hashResolveOptions"),VP=Br(e=>e!==null&&typeof e=="object"&&e[wb]===!0,"isWrappedCacheValue"),XP=Br(e=>e!==null&&typeof e=="object"&&Array.isArray(e[au]),"isWatchFilesCacheValue"),Mo=Br(e=>VP(e)?e.data:e,"unwrapCachedValue"),Ye=Br((e,t,r="")=>{if(!t.isEnabled)return e;const n=le(r,e.name),i={...e,async buildEnd(l){e.buildEnd&&await Kt(e.buildEnd).call(this,l)},async buildStart(l){e.buildStart&&await Kt(e.buildStart).call(this,l)},async load(l){if(!e.load)return;const c=l.includes("?")?l.split("?")[0]:l;let u="";try{if(c&&K$(c)){const g=Dh(c);u=Wt(g)}}catch{}const p=le("load",Wt(l),u),f=await t.get(p,n);if(f!==void 0)return Mo(f);const d=await Kt(e.load).call(this,l);if(d==null)return d;const m=typeof d=="object"&&"code"in d?d:{data:d,[wb]:!0};return t.set(p,m,n),d},name:`cached(${e.name})`,async resolveId(l,c,u){if(!e.resolveId)return;const p=le("resolveId",Wt(l),c?Wt(c):"",JP(u)),f=await t.get(p,n);if(f!==void 0)return Mo(f);const d=await Kt(e.resolveId).call(this,l,c,u);return t.set(p,d,n),d},async transform(l,c){if(!e.transform)return;const u=le("transform",Wt(c),Wt(l)),p=await t.get(u,n);if(p!==void 0){const g=Mo(p);if(XP(g)){for(const y of g[au])this.addWatchFile(y);return Mo(g.result)}return g}const f=[],d=Object.create(this);d.addWatchFile=g=>{f.push(g),this.addWatchFile(g)};const m=await Kt(e.transform).call(d,l,c);return f.length>0?t.set(u,{[au]:f,result:m},n):t.set(u,m,n),m}},o=Wl(e.load),s=Wl(e.resolveId),a=Wl(e.transform);return o&&i.load&&(i.load={filter:o,handler:Kt(i.load)}),s&&i.resolveId&&(i.resolveId={filter:s,handler:Kt(i.resolveId)}),a&&i.transform&&(i.transform={filter:a,handler:Kt(i.transform)}),i},"cachePlugin");var YP=Object.defineProperty,QP=v((e,t)=>YP(e,"name",{value:t,configurable:!0}),"f$k"),ZP=Object.defineProperty,eC=QP((e,t)=>ZP(e,"name",{value:t,configurable:!0}),"c"),tC=Object.defineProperty,rC=eC((e,t)=>tC(e,"name",{value:t,configurable:!0}),"c");const nC=rC(()=>({name:"packem:fix-dynamic-import-extension",renderChunk(e,t,r){if(r.format==="es"||r.format==="cjs"){const n=new Ke(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 u=a.index+l.length,p=u+c.length;n.overwrite(u,p,`.${i}`),s=!0}}if(s)return{code:n.toString(),map:r.sourcemap?n.generateMap({hires:!0}):void 0}}}}),"fixDynamicImportExtension");var iC=Object.defineProperty,oC=v((e,t)=>iC(e,"name",{value:t,configurable:!0}),"n$d"),sC=Object.defineProperty,aC=oC((e,t)=>sC(e,"name",{value:t,configurable:!0}),"s"),lC=Object.defineProperty,cC=aC((e,t)=>lC(e,"name",{value:t,configurable:!0}),"i");const uC=cC(()=>({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(dx,"")}-${e.format??"unknown"}.json`,source:JSON.stringify(r,void 0,2),type:"asset"})},name:"packem:metafile"}),"metafilePlugin");var pC=Object.defineProperty,fC=v((e,t)=>pC(e,"name",{value:t,configurable:!0}),"a$h"),dC=Object.defineProperty,mC=fC((e,t)=>dC(e,"name",{value:t,configurable:!0}),"l"),hC=Object.defineProperty,gC=mC((e,t)=>hC(e,"name",{value:t,configurable:!0}),"r");const vC=/^file:\/\//,Eb=gC(()=>({name:"packem:resolve-file-url",resolveId:{filter:{id:vC},handler(e){if(e.startsWith("file://"))return Jh(e)}}}),"resolveFileUrl");var bC=Object.defineProperty,yC=v((e,t)=>bC(e,"name",{value:t,configurable:!0}),"a$g"),$C=Object.defineProperty,xC=yC((e,t)=>$C(e,"name",{value:t,configurable:!0}),"n"),wC=Object.defineProperty,EC=xC((e,t)=>wC(e,"name",{value:t,configurable:!0}),"s");const SC=/^(\w+)-runtime$/,kC=EC(e=>{const t=xt(e).split(".");if(t.length>=2){const[r,n]=t.slice(-2),i=t[0]??"",o=SC.exec(r)?.[1];if(_s.includes(n)&&o&&o.length>0)return`${i}-${o}`}},"getCustomModuleLayer");var jC=Object.defineProperty,AC=v((e,t)=>jC(e,"name",{value:t,configurable:!0}),"a$f"),OC=Object.defineProperty,RC=AC((e,t)=>OC(e,"name",{value:t,configurable:!0}),"t"),_C=Object.defineProperty,PC=RC((e,t)=>_C(e,"name",{value:t,configurable:!0}),"t");const CC=/^use /,Oi=PC(e=>(e.preserveDirectives??{directives:[]}).directives.map(t=>t.replace(CC,"")).find(t=>t!=="strict"),"getModuleLayer");var TC=Object.defineProperty,NC=v((e,t)=>TC(e,"name",{value:t,configurable:!0}),"w$e"),IC=Object.defineProperty,MC=NC((e,t)=>IC(e,"name",{value:t,configurable:!0}),"I"),DC=Object.defineProperty,ys=MC((e,t)=>DC(e,"name",{value:t,configurable:!0}),"p");const BC=/[\\/]node_modules[\\/]@swc[\\/]helper/,Fl=yx(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)}),Sb=ys((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=Oi(i.meta);if(o)return r.set(e,o),o;let s;for(const a of i.importers){const l=Sb(a,t,r,n);if(l){s=l;break}}return r.set(e,s),s},"getEffectiveModuleLayer"),LC=ys((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=Oi(s.meta);if(a)i.add(a);else{const l=Sb(o,t,r,new Set([e]));l&&i.add(l)}}return i},"getImporterLayers"),WC=ys((e,t,r=!0)=>{const n=new Map,i=new Map;return ys(function(o,s){if(BC.test(o))return"cc";const a=s.getModuleInfo(o);if(!a)return;const{isEntry:l}=a,c=a.meta;let u=Oi(c);if(u&&(u=Fl(u)),!l){const p=n.get(o);if(p)return p;const f=kC(o);if(f)return n.set(o,f),f}if(l&&u){const p=typeof s.getModuleIds=="function"?s.getModuleIds():(()=>{const f=new Set,d=[o];for(;d.length>0;){const m=d.pop();if(f.has(m))continue;f.add(m);const g=s.getModuleInfo(m);if(g)for(const y of g.importedIds)f.has(y)||d.push(y)}return f})();for(const f of p){const d=s.getModuleInfo(f);d&&Oi(d.meta)===u&&(e.has(f)||e.set(f,new Set),e.get(f).add([o,u]))}}if(r&&!u&&!l){const p=LC(o,s.getModuleInfo,i);if(p.size>1){if(n.has(o))return n.get(o);const f=xt(o,gn(o)),d=[...p].toSorted((g,y)=>g.localeCompare(y)).join("-"),m=`${f}-${Fl(d)}`;return n.set(o,m),m}}if(u&&!l&&e.has(o)){const p=[...e.get(o)];if(p.some(([g])=>{if(t.some(y=>y.path===g)){const y=s.getModuleInfo(g);return Oi(y?y.meta:{})===u}return!1}))return;if(p.every(([,g])=>g===u))return n.has(o)?n.get(o):void 0;const f=xt(o,gn(o)),d=Fl(u),m=`${f}-${d}`;return n.set(o,m),m}},"splitChunks")},"createSplitChunks");var FC=Object.defineProperty,HC=v((e,t)=>FC(e,"name",{value:t,configurable:!0}),"i$a"),qC=Object.defineProperty,zC=HC((e,t)=>qC(e,"name",{value:t,configurable:!0}),"i"),GC=Object.defineProperty,UC=zC((e,t)=>GC(e,"name",{value:t,configurable:!0}),"i");const Ka=UC((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 KC=Object.defineProperty,JC=v((e,t)=>KC(e,"name",{value:t,configurable:!0}),"u$k"),VC=Object.defineProperty,XC=JC((e,t)=>VC(e,"name",{value:t,configurable:!0}),"u"),YC=Object.defineProperty,jp=XC((e,t)=>YC(e,"name",{value:t,configurable:!0}),"a");const QC=/\.tsx?$/,ZC=/['"]use memo['"]/,eT=jp(e=>e.find(t=>t==="babel-plugin-react-compiler"||Array.isArray(t)&&t[0]==="babel-plugin-react-compiler"),"getReactCompilerPlugin"),tT=jp((e,t)=>{if(e.length===0)return;const r=eT(e);if(!(!r||!Array.isArray(r))&&r[1]?.compilationMode==="annotation"&&!ZC.test(t)){const n=e.indexOf(r);n!==-1&&e.splice(n,1)}},"filterReactCompilerByAnnotation"),rT=jp(async(e,t,{filename:r,generatorOpts:n,sourceFileName:i,...o})=>{let s=[];o.plugins&&Array.isArray(o.plugins)&&(s=[...o.plugins]),s.length>0&&tT(s,e);const a=[];(t.endsWith(".jsx")||t.endsWith(".tsx"))&&a.push("jsx"),QC.test(t)&&a.push("typescript");const l=o.parserOpts?.plugins;l&&Array.isArray(l)&&a.unshift(...l);const c=[...new Set(a)],u=await Mx(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(u?.code)return{code:u.code,map:u.map??void 0}},"transformCode");var nT=Object.defineProperty,iT=v((e,t)=>nT(e,"name",{value:t,configurable:!0}),"b$h"),oT=Object.defineProperty,sT=iT((e,t)=>oT(e,"name",{value:t,configurable:!0}),"b"),aT=Object.defineProperty,Bi=sT((e,t)=>aT(e,"name",{value:t,configurable:!0}),"i");const lT=20,cT=4,uT=Xh("babel-runtime","plugins","babel","worker.js"),pT=Bi(e=>{const t=Bi(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"),fT=Bi(()=>{let e;try{e=Uc(Jh(import.meta.url))}catch{return}for(let t=0;t<6;t+=1){const r=Xh(e,uT);if(Au(r))return r;const n=Uc(e);if(n===e)break;e=n}},"resolveWorkerScript"),dT=Bi(({exclude:e,filename:t,generatorOpts:r,include:n,parallel:i=!0,parallelThreshold:o=lT,sourceFileName:s,...a})=>{const l=Mt(n,e??gr),c={...a,filename:t,generatorOpts:r,sourceFileName:s};let u=0,p,f=i===!1;const d=Bi(()=>{if(f)return;if(p)return p;if(u<o)return;if(pT(c)!==void 0){f=!0;return}const m=fT();if(!m){f=!0;return}const g=typeof i=="number"?i:Math.min(Px().length,cT);return p=Ix.pool(m,{maxWorkers:g,workerType:"thread"}),p},"ensurePool");return{async closeBundle(){this.meta.watchMode||(await p?.terminate(),p=void 0)},async closeWatcher(){await p?.terminate(),p=void 0},name:"packem:babel",async transform(m,g){if(!l(g))return;u+=1;const y=d();if(y)return y.exec("transform",[m,g,c]);const x=await rT(m,g,c);if(x)return{code:x.code,map:x.map??void 0}}}},"babelTransformPlugin");var mT=Object.defineProperty,hT=v((e,t)=>mT(e,"name",{value:t,configurable:!0}),"l$h"),gT=Object.defineProperty,vT=hT((e,t)=>gT(e,"name",{value:t,configurable:!0}),"l"),bT=Object.defineProperty,yT=vT((e,t)=>bT(e,"name",{value:t,configurable:!0}),"u");const $T=yT((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 Gw(zc(s.src),{ignore:zc(s.exclude).filter(Boolean)}).then(a=>({dest:s.dest??"",parent:n1(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?hn(s.dest):le(s.dest,tt(s.parent,Ce(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 Ki(s);if(!c.isFile())return;const u=c.mtime.getTime();u>a.timestamp&&(a.timestamp=u,a.copied=[]),l=await kr(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 u=xt(s),p=le(c,u);try{this.emitFile({[n.exactFileNames?"fileName":"name"]:p,source:l,type:"asset"}),t.debug({message:`copied ${s} → ${p}`,prefix:"plugin:copy"}),a.copied.push(c)}catch(f){t.error({context:[f],message:`error copying file ${s} → ${p}`,prefix:"plugin:copy"})}}}))},name:"packem:copy"}},"copyPlugin");var xT=Object.defineProperty,kb=v((e,t)=>xT(e,"name",{value:t,configurable:!0}),"s$f"),wT=Object.defineProperty,Ap=kb((e,t)=>wT(e,"name",{value:t,configurable:!0}),"m");const jb={"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(jb);const Ab={"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(Ab);var ET=Object.defineProperty,ST=Ap((e,t)=>ET(e,"name",{value:t,configurable:!0}),"g"),mt=Ap(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"),Jr,$i,fr;let kT=class{static{v(this,"j")}static{kb(this,"w")}static{Ap(this,"p")}static{ST(this,"Mime")}constructor(...t){Jr.set(this,new Map),$i.set(this,new Map),fr.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()),mt(this,fr,"f").has(n)||mt(this,fr,"f").set(n,new Set);const o=mt(this,fr,"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&&mt(this,$i,"f").set(n,a),s=!1,l)continue;const c=mt(this,Jr,"f").get(a);if(c&&c!=n&&!r)throw new Error(`"${n} -> ${a}" conflicts with "${c} -> ${a}". Pass \`force=true\` to override this definition.`);mt(this,Jr,"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:mt(this,Jr,"f").get(n)??null}getExtension(t){return typeof t!="string"?null:(t=t?.split?.(";")[0],(t&&mt(this,$i,"f").get(t.trim().toLowerCase()))??null)}getAllExtensions(t){return typeof t!="string"?null:mt(this,fr,"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 mt(this,fr,"f").values())Object.freeze(t);return this}_getTestState(){return{types:mt(this,Jr,"f"),extensions:mt(this,$i,"f")}}};Jr=new WeakMap,$i=new WeakMap,fr=new WeakMap;const Ob=new kT(Ab,jb)._freeze();var jT=Object.defineProperty,AT=v((e,t)=>jT(e,"name",{value:t,configurable:!0}),"c$l"),OT=Object.defineProperty,RT=AT((e,t)=>OT(e,"name",{value:t,configurable:!0}),"c"),_T=Object.defineProperty,PT=RT((e,t)=>_T(e,"name",{value:t,configurable:!0}),"l");const CT=/\?data-uri/,TT=PT((e={})=>{const t=Mt(e.include??[CT],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=Ob.getType(i)??"application/octet-stream";if(a==="image/svg+xml"){const u=await kr(i,{buffer:!1}),p=o==="css"?mx(u):hx(u);return`export default "${s?p.replaceAll(" ","%20"):p}"`}const l=await kr(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 NT=Object.defineProperty,IT=v((e,t)=>NT(e,"name",{value:t,configurable:!0}),"v$g"),MT=Object.defineProperty,DT=IT((e,t)=>MT(e,"name",{value:t,configurable:!0}),"v"),BT=Object.defineProperty,qe=DT((e,t)=>BT(e,"name",{value:t,configurable:!0}),"u");const LT=/\.[mc]?tsx?(?:\?.*)?$/,WT=/(?:\.[tj]sx?|\/index\.[tj]sx?)(?:\?.*)?$/,FT=/^\s*export/,HT=/^(?:import|export)\s+([\w$]+)/,qT=/([\w$]+)\s*,\s*\{|\}\s*,\s*([\w$]+)/,Hl=/[{,]\s*(type\s+)?([\w$]+)(?:\s+as\s+([\w$]+))?/gi,zT=/default\s+([a-zA-Z_$][\w$]*)(?:[;\n]|$)/,GT=/([\w$]+)\s*as\s*$/,UT=/^export\s+\*(?!\s+as)/,KT=/\bas\b/,JT={exports:[],facade:!1,imports:[]},Rb=qe(e=>LT.test(e),"isSourceFile"),_b=qe(e=>e.includes("/build/cache/vite/")||e.includes("/node_modules/"),"isIgnoredModule"),VT=qe((e,t)=>_b(e)?!1:WT.test(e)?!0:t.possibleBarrelFiles?t.possibleBarrelFiles.some(r=>typeof r=="string"?e.includes(r):r.test(e)):!1,"isPossibleBarrelSpecifier"),Pb=qe(e=>FT.test(e)?"export":"import","getDeclarationKind"),{parseAsync:XT}=Wx,Cb=qe(async(e,t,r)=>{try{const{output:n}=await XT({input:[{code:t,filename:e}]});return n[0]}catch(n){return r.debug({message:`Failed to parse ${e}:
74
- ${n instanceof Error?n.message:String(n)}`,prefix:"plugin:debarrel"}),JT}},"safeParse"),YT=qe(async(e,t,r,n)=>{const i=e.parseCache.get(t);if(i!==void 0)return i;const o=await Cb(t,r,n);return e.parseCache.set(t,o),o},"parsePotentialBarrelFile"),Tb=qe((e,t)=>{const r=e.fileCache.get(t);if(r!==void 0)return r;const n=Yh.readFile(t,"utf8");return e.fileCache.set(t,n),n},"readFileCached"),Nb=qe(e=>{Hl.lastIndex=0;const t=[];if(e.includes("*"))return t;if(!e.includes("{")){const i=HT.exec(e);return i&&t.push({imported:"default",local:i[1]}),t}const r=qT.exec(e);r&&t.push({imported:"default",local:r[1]??r[2]});let n=Hl.exec(e);for(;n!==null;)!n[1]&&n[2]&&t.push({imported:n[2],local:n[3]}),n=Hl.exec(e);return t},"getImportNames"),QT=qe((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??zT.exec(r.slice(e.s))?.[1];o&&(i=t.find(s=>{const a=Nb(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=GT.exec(o)?.[1];s&&(n=s)}}return{imp:i,localExportName:n}},"findMatchingImport"),ZT=qe((e,t)=>Pb(e)!=="import"||!KT.test(e)?void 0:new RegExp(String.raw`(\w+)\s+as\s+${t}(?!\w)`).exec(e)?.[0],"findAliasedImportName");let Li;const e3=qe(async(e,t,r,n,i,o,s,a)=>{const{resolve:l}=e,c=QT(n,i,r),{imp:u,localExportName:p}=c;if(!u?.n)return{exportName:o,id:t,resolved:!0};if(u.d>-1)return{exportName:o,id:t,resolved:!0};const f=r.slice(u.ss,n.s),d=ZT(f,o),m=(await l(u.n,t))?.id;return m?VT(m,s)?Li(e,m,p??n.n,s,a):{aliasedImportName:d,exportName:p??o,id:m,resolved:!1}:{aliasedImportName:d,exportName:p,id:t,resolved:!1}},"resolveExportThroughBarrel"),t3=qe(async(e,t,r,n,i,o,s)=>{const a=n.filter(l=>UT.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 u=await Li(e,c,i,o,s);if(u.resolved)return u}else if(a.length>1){const l=(await Promise.all(a.map(async c=>{const u=c.n;if(!u)return;const p=(await e.resolve(u,t))?.id;if(p)return Li(e,p,i,o,s)}))).find(c=>c?.resolved);if(l)return l}},"resolveWildcardReExports");Li=qe(async(e,t,r,n,i)=>{const o=await Tb(e,t),{exports:s,imports:a}=await YT(e,t,o,i);for(const l of s)if(l.n===r)return await e3(e,t,o,l,a,r,n,i);return await t3(e,t,o,a,r,n,i)||{exportName:r,id:t,resolved:!1}},"resolveThroughBarrel");const r3=qe((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"),n3=qe(async(e,t,r,n,i)=>{const o=[],s=await Tb(e,t),{imports:a}=await Cb(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),u=Nb(c);if(u.length===0)return;const p=(await e.resolve(l.n,t))?.id;if(!p||!Rb(p)||_b(p))return;const f=Pb(c);try{const d=await Promise.all(u.map(async m=>{const g=await Li(e,p,m.imported,n,i),y=r3(g,m,f),x=JSON.stringify(g.id);return`${f} ${y} from ${x}`}));o.push([l.ss,l.se,d.join(";")])}catch(d){i.warn({context:{error:d},message:String(d),prefix:"plugin:debarrel"})}})),o},"getDebarrelModifications"),i3=qe((e,t,r,n)=>{if(r.length===0)return;const i=new Ke(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"),o3=qe((e,t)=>{const r=new Map,n=new Map,i=qe(()=>{r.clear(),n.clear()},"purgeCaches"),o=e.include?Mt(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(!Rb(l)||o&&!o(l))return;const c={fileCache:r,parseCache:n,resolve:this.resolve.bind(this)},u=await n3(c,l,a,e,t);return i3(l,a,u,s)},watchChange(a){r.delete(a),n.delete(a)}}},"debarrelPlugin");var ql,Md;function s3(){if(Md)return ql;Md=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"u");const r=rt();return ql=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"),ql}v(s3,"requireInc");var zl,Dd;function a3(){if(Dd)return zl;Dd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"u");const r=Ui();return zl=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,u=c?s:a,p=c?a:s,f=!!u.prerelease.length;if(p.prerelease.length&&!f){if(!p.patch&&!p.minor)return"major";if(p.compareMain(u)===0)return p.minor&&!p.patch?"minor":"patch"}const d=f?"pre":"";return s.major!==a.major?d+"major":s.minor!==a.minor?d+"minor":s.patch!==a.patch?d+"patch":"prerelease"},"diff"),zl}v(a3,"requireDiff");var Gl,Bd;function l3(){if(Bd)return Gl;Bd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=rt();return Gl=t((i,o)=>new r(i,o).major,"major"),Gl}v(l3,"requireMajor");var Ul,Ld;function c3(){if(Ld)return Ul;Ld=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=rt();return Ul=t((i,o)=>new r(i,o).minor,"minor"),Ul}v(c3,"requireMinor");var Kl,Wd;function u3(){if(Wd)return Kl;Wd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"t");const r=rt();return Kl=t((i,o)=>new r(i,o).patch,"patch"),Kl}v(u3,"requirePatch");var Jl,Fd;function p3(){if(Fd)return Jl;Fd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"t");const r=Ui();return Jl=t((i,o)=>{const s=r(i,o);return s&&s.prerelease.length?s.prerelease:null},"prerelease"),Jl}v(p3,"requirePrerelease");var Vl,Hd;function At(){if(Hd)return Vl;Hd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"c");const r=rt();return Vl=t((i,o,s)=>new r(i,s).compare(new r(o,s)),"compare"),Vl}v(At,"requireCompare");var Xl,qd;function f3(){if(qd)return Xl;qd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"o");const r=At();return Xl=t((i,o,s)=>r(o,i,s),"rcompare"),Xl}v(f3,"requireRcompare");var Yl,zd;function d3(){if(zd)return Yl;zd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=At();return Yl=t((i,o)=>r(i,o,!0),"compareLoose"),Yl}v(d3,"requireCompareLoose");var Ql,Gd;function Op(){if(Gd)return Ql;Gd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"o");const r=rt();return Ql=t((i,o,s)=>{const a=new r(i,s),l=new r(o,s);return a.compare(l)||a.compareBuild(l)},"compareBuild"),Ql}v(Op,"requireCompareBuild");var Zl,Ud;function m3(){if(Ud)return Zl;Ud=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"e");const r=Op();return Zl=t((i,o)=>i.sort((s,a)=>r(s,a,o)),"sort"),Zl}v(m3,"requireSort");var ec,Kd;function h3(){if(Kd)return ec;Kd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"e");const r=Op();return ec=t((i,o)=>i.sort((s,a)=>r(a,s,o)),"rsort"),ec}v(h3,"requireRsort");var tc,Jd;function Ja(){if(Jd)return tc;Jd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=At();return tc=t((i,o,s)=>r(i,o,s)>0,"gt"),tc}v(Ja,"requireGt");var rc,Vd;function Rp(){if(Vd)return rc;Vd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=At();return rc=t((i,o,s)=>r(i,o,s)<0,"lt"),rc}v(Rp,"requireLt");var nc,Xd;function Ib(){if(Xd)return nc;Xd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=At();return nc=t((i,o,s)=>r(i,o,s)===0,"eq"),nc}v(Ib,"requireEq");var ic,Yd;function Mb(){if(Yd)return ic;Yd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=At();return ic=t((i,o,s)=>r(i,o,s)!==0,"neq"),ic}v(Mb,"requireNeq");var oc,Qd;function _p(){if(Qd)return oc;Qd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=At();return oc=t((i,o,s)=>r(i,o,s)>=0,"gte"),oc}v(_p,"requireGte");var sc,Zd;function Pp(){if(Zd)return sc;Zd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=At();return sc=t((i,o,s)=>r(i,o,s)<=0,"lte"),sc}v(Pp,"requireLte");var ac,em;function Db(){if(em)return ac;em=1;var e=Object.defineProperty,t=v((c,u)=>e(c,"name",{value:u,configurable:!0}),"n");const r=Ib(),n=Mb(),i=Ja(),o=_p(),s=Rp(),a=Pp();return ac=t((c,u,p,f)=>{switch(u){case"===":return typeof c=="object"&&(c=c.version),typeof p=="object"&&(p=p.version),c===p;case"!==":return typeof c=="object"&&(c=c.version),typeof p=="object"&&(p=p.version),c!==p;case"":case"=":case"==":return r(c,p,f);case"!=":return n(c,p,f);case">":return i(c,p,f);case">=":return o(c,p,f);case"<":return s(c,p,f);case"<=":return a(c,p,f);default:throw new TypeError(`Invalid operator: ${u}`)}},"cmp"),ac}v(Db,"requireCmp");var lc,tm;function g3(){if(tm)return lc;tm=1;var e=Object.defineProperty,t=v((a,l)=>e(a,"name",{value:l,configurable:!0}),"u");const r=rt(),n=Ui(),{safeRe:i,t:o}=Os();return lc=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 g=l.includePrerelease?i[o.COERCERTLFULL]:i[o.COERCERTL];let y;for(;(y=g.exec(a))&&(!c||c.index+c[0].length!==a.length);)(!c||y.index+y[0].length!==c.index+c[0].length)&&(c=y),g.lastIndex=y.index+y[1].length+y[2].length;g.lastIndex=-1}if(c===null)return null;const u=c[2],p=c[3]||"0",f=c[4]||"0",d=l.includePrerelease&&c[5]?`-${c[5]}`:"",m=l.includePrerelease&&c[6]?`+${c[6]}`:"";return n(`${u}.${p}.${f}${d}${m}`,l)},"coerce"),lc}v(g3,"requireCoerce");var cc,rm;function v3(){if(rm)return cc;rm=1;var e=Object.defineProperty,t=v((c,u)=>e(c,"name",{value:u,configurable:!0}),"t");const r=Ui(),n=Su(),i=rt(),o=t((c,u,p)=>{if(!n.RELEASE_TYPES.includes(u))return null;const f=s(c,p);return f&&a(f,u)},"truncate"),s=t((c,u)=>{const p=c instanceof i?c.version:c;return r(p,u)},"cloneInputVersion"),a=t((c,u)=>{if(l(u))return c.version;switch(c.prerelease=[],u){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 cc=o,cc}v(v3,"requireTruncate");var uc,nm;function b3(){if(nm)return uc;nm=1;var e=Object.defineProperty,t=v((n,i)=>e(n,"name",{value:i,configurable:!0}),"i");class r{static{v(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 uc=r,uc}v(b3,"requireLrucache");var pc,im;function Ot(){if(im)return pc;im=1;var e=Object.defineProperty,t=v((I,M)=>e(I,"name",{value:M,configurable:!0}),"o");const r=/\s+/g;class n{static{v(this,"Range")}static{t(this,"Range")}constructor(M,K){if(K=s(K),M instanceof n)return M.loose===!!K.loose&&M.includePrerelease===!!K.includePrerelease?M:new n(M.raw,K);if(M instanceof a)return this.raw=M.value,this.set=[[M]],this.formatted=void 0,this;if(this.options=K,this.loose=!!K.loose,this.includePrerelease=!!K.includePrerelease,this.raw=M.trim().replace(r," "),this.set=this.raw.split("||").map(F=>this.parseRange(F.trim())).filter(F=>F.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const F=this.set[0];if(this.set=this.set.filter(N=>!R(N[0])),this.set.length===0)this.set=[F];else if(this.set.length>1){for(const N of this.set)if(N.length===1&&b(N[0])){this.set=[N];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let M=0;M<this.set.length;M++){M>0&&(this.formatted+="||");const K=this.set[M];for(let F=0;F<K.length;F++)F>0&&(this.formatted+=" "),this.formatted+=K[F].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(M){M=M.replace(j,"");const K=((this.options.includePrerelease&&y)|(this.options.loose&&x))+":"+M,F=o.get(K);if(F)return F;const N=this.options.loose,W=N?u[f.HYPHENRANGELOOSE]:u[f.HYPHENRANGE];M=M.replace(W,te(this.options.includePrerelease)),l("hyphen replace",M),M=M.replace(u[f.COMPARATORTRIM],d),l("comparator trim",M),M=M.replace(u[f.TILDETRIM],m),l("tilde trim",M),M=M.replace(u[f.CARETTRIM],g),l("caret trim",M);let V=M.split(" ").map(L=>h(L,this.options)).join(" ").split(/\s+/).map(L=>X(L,this.options));N&&(V=V.filter(L=>(l("loose invalid filter",L,this.options),!!L.match(u[f.COMPARATORLOOSE])))),l("range list",V);const U=new Map,z=V.map(L=>new a(L,this.options));for(const L of z){if(R(L))return[L];U.set(L.value,L)}U.size>1&&U.has("")&&U.delete("");const Y=[...U.values()];return o.set(K,Y),Y}intersects(M,K){if(!(M instanceof n))throw new TypeError("a Range is required");return this.set.some(F=>E(F,K)&&M.set.some(N=>E(N,K)&&F.every(W=>N.every(V=>W.intersects(V,K)))))}test(M){if(!M)return!1;if(typeof M=="string")try{M=new c(M,this.options)}catch{return!1}for(let K=0;K<this.set.length;K++)if(re(this.set[K],M,this.options))return!0;return!1}}pc=n;const i=b3(),o=new i,s=Bh(),a=Va(),l=Lh(),c=rt(),{safeRe:u,src:p,t:f,comparatorTrimReplace:d,tildeTrimReplace:m,caretTrimReplace:g}=Os(),{FLAG_INCLUDE_PRERELEASE:y,FLAG_LOOSE:x}=Su(),j=new RegExp(p[f.BUILD],"g"),R=t(I=>I.value==="<0.0.0-0","isNullSet"),b=t(I=>I.value==="","isAny"),E=t((I,M)=>{let K=!0;const F=I.slice();let N=F.pop();for(;K&&F.length;)K=F.every(W=>N.intersects(W,M)),N=F.pop();return K},"isSatisfiable"),h=t((I,M)=>(I=I.replace(u[f.BUILD],""),l("comp",I,M),I=k(I,M),l("caret",I),I=_(I,M),l("tildes",I),I=B(I,M),l("xrange",I),I=q(I,M),l("stars",I),I),"parseComparator"),A=t(I=>!I||I.toLowerCase()==="x"||I==="*","isX"),_=t((I,M)=>I.trim().split(/\s+/).map(K=>O(K,M)).join(" "),"replaceTildes"),O=t((I,M)=>{const K=M.loose?u[f.TILDELOOSE]:u[f.TILDE];return I.replace(K,(F,N,W,V,U)=>{l("tilde",I,F,N,W,V,U);let z;return A(N)?z="":A(W)?z=`>=${N}.0.0 <${+N+1}.0.0-0`:A(V)?z=`>=${N}.${W}.0 <${N}.${+W+1}.0-0`:U?(l("replaceTilde pr",U),z=`>=${N}.${W}.${V}-${U} <${N}.${+W+1}.0-0`):z=`>=${N}.${W}.${V} <${N}.${+W+1}.0-0`,l("tilde return",z),z})},"replaceTilde"),k=t((I,M)=>I.trim().split(/\s+/).map(K=>C(K,M)).join(" "),"replaceCarets"),C=t((I,M)=>{l("caret",I,M);const K=M.loose?u[f.CARETLOOSE]:u[f.CARET],F=M.includePrerelease?"-0":"";return I.replace(K,(N,W,V,U,z)=>{l("caret",I,N,W,V,U,z);let Y;return A(W)?Y="":A(V)?Y=`>=${W}.0.0${F} <${+W+1}.0.0-0`:A(U)?W==="0"?Y=`>=${W}.${V}.0${F} <${W}.${+V+1}.0-0`:Y=`>=${W}.${V}.0${F} <${+W+1}.0.0-0`:z?(l("replaceCaret pr",z),W==="0"?V==="0"?Y=`>=${W}.${V}.${U}-${z} <${W}.${V}.${+U+1}-0`:Y=`>=${W}.${V}.${U}-${z} <${W}.${+V+1}.0-0`:Y=`>=${W}.${V}.${U}-${z} <${+W+1}.0.0-0`):(l("no pr"),W==="0"?V==="0"?Y=`>=${W}.${V}.${U}${F} <${W}.${V}.${+U+1}-0`:Y=`>=${W}.${V}.${U}${F} <${W}.${+V+1}.0-0`:Y=`>=${W}.${V}.${U} <${+W+1}.0.0-0`),l("caret return",Y),Y})},"replaceCaret"),B=t((I,M)=>(l("replaceXRanges",I,M),I.split(/\s+/).map(K=>J(K,M)).join(" ")),"replaceXRanges"),J=t((I,M)=>{I=I.trim();const K=M.loose?u[f.XRANGELOOSE]:u[f.XRANGE];return I.replace(K,(F,N,W,V,U,z)=>{l("xRange",I,F,N,W,V,U,z);const Y=A(W),L=Y||A(V),D=L||A(U),$=D;return N==="="&&$&&(N=""),z=M.includePrerelease?"-0":"",Y?N===">"||N==="<"?F="<0.0.0-0":F="*":N&&$?(L&&(V=0),U=0,N===">"?(N=">=",L?(W=+W+1,V=0,U=0):(V=+V+1,U=0)):N==="<="&&(N="<",L?W=+W+1:V=+V+1),N==="<"&&(z="-0"),F=`${N+W}.${V}.${U}${z}`):L?F=`>=${W}.0.0${z} <${+W+1}.0.0-0`:D&&(F=`>=${W}.${V}.0${z} <${W}.${+V+1}.0-0`),l("xRange return",F),F})},"replaceXRange"),q=t((I,M)=>(l("replaceStars",I,M),I.trim().replace(u[f.STAR],"")),"replaceStars"),X=t((I,M)=>(l("replaceGTE0",I,M),I.trim().replace(u[M.includePrerelease?f.GTE0PRE:f.GTE0],"")),"replaceGTE0"),te=t(I=>(M,K,F,N,W,V,U,z,Y,L,D,$)=>(A(F)?K="":A(N)?K=`>=${F}.0.0${I?"-0":""}`:A(W)?K=`>=${F}.${N}.0${I?"-0":""}`:V?K=`>=${K}`:K=`>=${K}${I?"-0":""}`,A(Y)?z="":A(L)?z=`<${+Y+1}.0.0-0`:A(D)?z=`<${Y}.${+L+1}.0-0`:$?z=`<=${Y}.${L}.${D}-${$}`:I?z=`<${Y}.${L}.${+D+1}-0`:z=`<=${z}`,`${K} ${z}`.trim()),"hyphenReplace"),re=t((I,M,K)=>{for(let F=0;F<I.length;F++)if(!I[F].test(M))return!1;if(M.prerelease.length&&!K.includePrerelease){for(let F=0;F<I.length;F++)if(l(I[F].semver),I[F].semver!==a.ANY&&I[F].semver.prerelease.length>0){const N=I[F].semver;if(N.major===M.major&&N.minor===M.minor&&N.patch===M.patch)return!0}return!1}return!0},"testSet");return pc}v(Ot,"requireRange");var fc,om;function Va(){if(om)return fc;om=1;var e=Object.defineProperty,t=v((p,f)=>e(p,"name",{value:f,configurable:!0}),"i");const r=Symbol("SemVer ANY");class n{static{v(this,"Comparator")}static{t(this,"Comparator")}static get ANY(){return r}constructor(f,d){if(d=i(d),f instanceof n){if(f.loose===!!d.loose)return f;f=f.value}f=f.trim().split(/\s+/).join(" "),l("comparator",f,d),this.options=d,this.loose=!!d.loose,this.parse(f),this.semver===r?this.value="":this.value=this.operator+this.semver.version,l("comp",this)}parse(f){const d=this.options.loose?o[s.COMPARATORLOOSE]:o[s.COMPARATOR],m=f.match(d);if(!m)throw new TypeError(`Invalid comparator: ${f}`);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(f){if(l("Comparator.test",f,this.options.loose),this.semver===r||f===r)return!0;if(typeof f=="string")try{f=new c(f,this.options)}catch{return!1}return a(f,this.operator,this.semver,this.options)}intersects(f,d){if(!(f instanceof n))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(f.value,d).test(this.value):f.operator===""?f.value===""?!0:new u(this.value,d).test(f.semver):(d=i(d),d.includePrerelease&&(this.value==="<0.0.0-0"||f.value==="<0.0.0-0")||!d.includePrerelease&&(this.value.startsWith("<0.0.0")||f.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&f.operator.startsWith(">")||this.operator.startsWith("<")&&f.operator.startsWith("<")||this.semver.version===f.semver.version&&this.operator.includes("=")&&f.operator.includes("=")||a(this.semver,"<",f.semver,d)&&this.operator.startsWith(">")&&f.operator.startsWith("<")||a(this.semver,">",f.semver,d)&&this.operator.startsWith("<")&&f.operator.startsWith(">")))}}fc=n;const i=Bh(),{safeRe:o,t:s}=Os(),a=Db(),l=Lh(),c=rt(),u=Ot();return fc}v(Va,"requireComparator");var dc,sm;function ko(){if(sm)return dc;sm=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"t");const r=Ot();return dc=t((i,o,s)=>{try{o=new r(o,s)}catch{return!1}return o.test(i)},"satisfies"),dc}v(ko,"requireSatisfies");var mc,am;function y3(){if(am)return mc;am=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"t");const r=Ot();return mc=t((i,o)=>new r(i,o).set.map(s=>s.map(a=>a.value).join(" ").trim().split(" ")),"toComparators"),mc}v(y3,"requireToComparators");var hc,lm;function $3(){if(lm)return hc;lm=1;var e=Object.defineProperty,t=v((o,s)=>e(o,"name",{value:s,configurable:!0}),"c");const r=rt(),n=Ot();return hc=t((o,s,a)=>{let l=null,c=null,u=null;try{u=new n(s,a)}catch{return null}return o.forEach(p=>{u.test(p)&&(!l||c.compare(p)===-1)&&(l=p,c=new r(l,a))}),l},"maxSatisfying"),hc}v($3,"requireMaxSatisfying");var gc,cm;function x3(){if(cm)return gc;cm=1;var e=Object.defineProperty,t=v((o,s)=>e(o,"name",{value:s,configurable:!0}),"u");const r=rt(),n=Ot();return gc=t((o,s,a)=>{let l=null,c=null,u=null;try{u=new n(s,a)}catch{return null}return o.forEach(p=>{u.test(p)&&(!l||c.compare(p)===1)&&(l=p,c=new r(l,a))}),l},"minSatisfying"),gc}v(x3,"requireMinSatisfying");var vc,um;function w3(){if(um)return vc;um=1;var e=Object.defineProperty,t=v((s,a)=>e(s,"name",{value:a,configurable:!0}),"i");const r=rt(),n=Ot(),i=Ja();return vc=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 u=s.set[c];let p=null;u.forEach(f=>{const d=new r(f.semver.version);switch(f.operator){case">":d.prerelease.length===0?d.patch++:d.prerelease.push(0),d.raw=d.format();case"":case">=":(!p||i(d,p))&&(p=d);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${f.operator}`)}}),p&&(!l||i(l,p))&&(l=p)}return l&&s.test(l)?l:null},"minVersion"),vc}v(w3,"requireMinVersion");var bc,pm;function E3(){if(pm)return bc;pm=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"n");const r=Ot();return bc=t((i,o)=>{try{return new r(i,o).range||"*"}catch{return null}},"validRange"),bc}v(E3,"requireValid");var yc,fm;function Cp(){if(fm)return yc;fm=1;var e=Object.defineProperty,t=v((f,d)=>e(f,"name",{value:d,configurable:!0}),"m");const r=rt(),n=Va(),{ANY:i}=n,o=Ot(),s=ko(),a=Ja(),l=Rp(),c=Pp(),u=_p();return yc=t((f,d,m,g)=>{f=new r(f,g),d=new o(d,g);let y,x,j,R,b;switch(m){case">":y=a,x=c,j=l,R=">",b=">=";break;case"<":y=l,x=u,j=a,R="<",b="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(s(f,d,g))return!1;for(let E=0;E<d.set.length;++E){const h=d.set[E];let A=null,_=null;if(h.forEach(O=>{O.semver===i&&(O=new n(">=0.0.0")),A=A||O,_=_||O,y(O.semver,A.semver,g)?A=O:j(O.semver,_.semver,g)&&(_=O)}),A.operator===R||A.operator===b||(!_.operator||_.operator===R)&&x(f,_.semver)||_.operator===b&&j(f,_.semver))return!1}return!0},"outside"),yc}v(Cp,"requireOutside");var $c,dm;function S3(){if(dm)return $c;dm=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"s");const r=Cp();return $c=t((i,o,s)=>r(i,o,">",s),"gtr"),$c}v(S3,"requireGtr");var xc,mm;function k3(){if(mm)return xc;mm=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"s");const r=Cp();return xc=t((i,o,s)=>r(i,o,"<",s),"ltr"),xc}v(k3,"requireLtr");var wc,hm;function j3(){if(hm)return wc;hm=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"n");const r=Ot();return wc=t((i,o,s)=>(i=new r(i,s),o=new r(o,s),i.intersects(o,s)),"intersects"),wc}v(j3,"requireIntersects");var Ec,gm;function A3(){if(gm)return Ec;gm=1;const e=ko(),t=At();return Ec=v((r,n,i)=>{const o=[];let s=null,a=null;const l=r.sort((f,d)=>t(f,d,i));for(const f of l)e(f,n,i)?(a=f,s||(s=f)):(a&&o.push([s,a]),a=null,s=null);s&&o.push([s,null]);const c=[];for(const[f,d]of o)f===d?c.push(f):!d&&f===l[0]?c.push("*"):d?f===l[0]?c.push(`<=${d}`):c.push(`${f} - ${d}`):c.push(`>=${f}`);const u=c.join(" || "),p=typeof n.raw=="string"?n.raw:String(n);return u.length<p.length?u:n},"simplify"),Ec}v(A3,"requireSimplify");var Sc,vm;function O3(){if(vm)return Sc;vm=1;var e=Object.defineProperty,t=v((d,m)=>e(d,"name",{value:m,configurable:!0}),"u");const r=Ot(),n=Va(),{ANY:i}=n,o=ko(),s=At(),a=t((d,m,g={})=>{if(d===m)return!0;d=new r(d,g),m=new r(m,g);let y=!1;e:for(const x of d.set){for(const j of m.set){const R=u(x,j,g);if(y=y||R!==null,R)continue e}if(y)return!1}return!0},"subset"),l=[new n(">=0.0.0-0")],c=[new n(">=0.0.0")],u=t((d,m,g)=>{if(d===m)return!0;if(d.length===1&&d[0].semver===i){if(m.length===1&&m[0].semver===i)return!0;g.includePrerelease?d=l:d=c}if(m.length===1&&m[0].semver===i){if(g.includePrerelease)return!0;m=c}const y=new Set;let x,j;for(const k of d)k.operator===">"||k.operator===">="?x=p(x,k,g):k.operator==="<"||k.operator==="<="?j=f(j,k,g):y.add(k.semver);if(y.size>1)return null;let R;if(x&&j&&(R=s(x.semver,j.semver,g),R>0||R===0&&(x.operator!==">="||j.operator!=="<=")))return null;for(const k of y){if(x&&!o(k,String(x),g)||j&&!o(k,String(j),g))return null;for(const C of m)if(!o(k,String(C),g))return!1;return!0}let b,E,h,A,_=j&&!g.includePrerelease&&j.semver.prerelease.length?j.semver:!1,O=x&&!g.includePrerelease&&x.semver.prerelease.length?x.semver:!1;_&&_.prerelease.length===1&&j.operator==="<"&&_.prerelease[0]===0&&(_=!1);for(const k of m){if(A=A||k.operator===">"||k.operator===">=",h=h||k.operator==="<"||k.operator==="<=",x){if(O&&k.semver.prerelease&&k.semver.prerelease.length&&k.semver.major===O.major&&k.semver.minor===O.minor&&k.semver.patch===O.patch&&(O=!1),k.operator===">"||k.operator===">="){if(b=p(x,k,g),b===k&&b!==x)return!1}else if(x.operator===">="&&!k.test(x.semver))return!1}if(j){if(_&&k.semver.prerelease&&k.semver.prerelease.length&&k.semver.major===_.major&&k.semver.minor===_.minor&&k.semver.patch===_.patch&&(_=!1),k.operator==="<"||k.operator==="<="){if(E=f(j,k,g),E===k&&E!==j)return!1}else if(j.operator==="<="&&!k.test(j.semver))return!1}if(!k.operator&&(j||x)&&R!==0)return!1}return!(x&&h&&!j&&R!==0||j&&A&&!x&&R!==0||O||_)},"simpleSubset"),p=t((d,m,g)=>{if(!d)return m;const y=s(d.semver,m.semver,g);return y>0?d:y<0||m.operator===">"&&d.operator===">="?m:d},"higherGT"),f=t((d,m,g)=>{if(!d)return m;const y=s(d.semver,m.semver,g);return y<0?d:y>0||m.operator==="<"&&d.operator==="<="?m:d},"lowerLT");return Sc=a,Sc}v(O3,"requireSubset");var kc,bm;function R3(){if(bm)return kc;bm=1;const e=Os(),t=Su(),r=rt(),n=J$(),i=Ui(),o=Wh(),s=V$(),a=s3(),l=a3(),c=l3(),u=c3(),p=u3(),f=p3(),d=At(),m=f3(),g=d3(),y=Op(),x=m3(),j=h3(),R=Ja(),b=Rp(),E=Ib(),h=Mb(),A=_p(),_=Pp(),O=Db(),k=g3(),C=v3(),B=Va(),J=Ot(),q=ko(),X=y3(),te=$3(),re=x3(),I=w3(),M=E3(),K=Cp(),F=S3(),N=k3(),W=j3(),V=A3(),U=O3();return kc={parse:i,valid:o,clean:s,inc:a,diff:l,major:c,minor:u,patch:p,prerelease:f,compare:d,rcompare:m,compareLoose:g,compareBuild:y,sort:x,rsort:j,gt:R,lt:b,eq:E,neq:h,gte:A,lte:_,cmp:O,coerce:k,truncate:C,Comparator:B,Range:J,satisfies:q,toComparators:X,maxSatisfying:te,minSatisfying:re,minVersion:I,validRange:M,outside:K,gtr:F,ltr:N,intersects:W,simplifyRange:V,subset:U,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},kc}v(R3,"requireSemver");var $t=R3(),_3=Object.defineProperty,P3=v((e,t)=>_3(e,"name",{value:t,configurable:!0}),"P$a"),C3=Object.defineProperty,Bb=P3((e,t)=>C3(e,"name",{value:t,configurable:!0}),"$"),T3=Object.defineProperty,Lb=Bb((e,t)=>T3(e,"name",{value:t,configurable:!0}),"r");const $s=/.*\/node_modules\/(?:@[^/]+\/)?[^/]+/,lu=ku(async e=>{const t=le(e,"package.json");try{const r=await X$(t);return{directory:Ce(t),name:r.name,version:r.version}}catch{return}})(),Wb=Lb(async e=>{const t=_i(e),r=$s.exec(t);if(!r)return;const n=await lu(r[0]);if(n)return n;const i=t.lastIndexOf("node_modules");if(i<=0)return;const o=$s.exec(t.slice(0,i-1));if(o)return lu(o[0])},"getPackageInfo"),N3=Lb(()=>{lu.destroy()},"destroyPackageInfoCache");var I3=Object.defineProperty,nr=Bb((e,t)=>I3(e,"name",{value:t,configurable:!0}),"d");const ym=ku(async(e,t)=>{const r=_i(e);if($s.test(r)){const n=await Wb(r);if(n)return`${n.name}@${n.version}`}return r.replace(`${_i(t)}/`,"")})(),M3=nr(e=>new Set([...e].toSorted((t,r)=>t.localeCompare(r))),"sortImporters"),D3=nr(e=>new Map([...e.entries()].toSorted((t,r)=>t[0].localeCompare(r[0])).map(([t,r])=>[t,M3(r)])),"sortDirectoryMap"),B3=nr(e=>new Map([...e.entries()].toSorted((t,r)=>$t.compare(t[0],r[0])).map(([t,r])=>[t,D3(r)])),"sortVersionMap"),L3=nr(e=>new Map([...e.entries()].toSorted((t,r)=>t[0].localeCompare(r[0])).map(([t,r])=>[t,B3(r)])),"sortPackagesInfo"),W3=nr((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"),F3=nr((e,t,r,n)=>{const i=Math.max(0,...t.map(a=>a.length)),o=nr((a,l)=>a.filter(c=>c!==`${e}@${l}`).map(c=>wu(c)).join(", "),"colorizeImporters"),s=[`
75
- ${Xo(e)}:`];for(const a of t){const l=r.get(e)?.get(a);if(!l)continue;const c=Ze(Qr(a.padEnd(i," ")));if(l.size===1){const[u]=[...l.values()],p=u?[...u]:[];s.push(` - ${c} imported by ${o(p,a)}`);continue}s.push(` - ${c}`);for(const[u,p]of l){const f=Ze(Pe(u.replace(_i(n),".")));s.push(` - ${f} imported by ${o([...p],a)}`)}}return s},"formatDuplicatedPackage"),H3=nr((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 f=>{const d=this.getModuleInfo(f);if(d===null||d.isExternal||d.isIncluded===!1)return;const m=await Wb(f);if(!m)return;const{directory:g,name:y,version:x}=m;for(const j of[...d.importers,...d.dynamicImporters]){const R=_i(j);!n&&$s.test(R)||W3(s,y,x,g,await ym(R,t))}})),N3(),ym.destroy();const a=L3(s),l={},c=new Map;for(const[f,d]of a.entries()){const m=[...d.values()];if(m.length>1||m.length===1&&(m[0]?.size??0)>1){l[f]=[...d.keys()];for(const g of d.keys()){const y=i[f];if(!(y!==void 0&&(y.includes("*")||y.includes(g)))){const x=c.get(f)??[];x.push(g),c.set(f,x)}}}}if(c.size===0)return;const u=[`packages ${[...c.keys()].map(f=>Xo(f)).join(", ")} is bundled multiple times!`];for(const[f,d]of c)u.push(...F3(f,d,a,t));const p=r?r(a):u.join(`
76
- `);o&&(e.error(p),e.info(`Fix this error by eliminating the duplicated dependencies or adjusting the ${Xo("ignore")} option.`),e.info(`You can copy the following duplicated dependencies as the value of the ${Xo("ignore")} option:`),e.info(`
77
- ${JSON.stringify(l,void 0,4)}
78
- `),this.error("Duplicated dependencies detected.")),e.warn(p)},name:"packem:detect-duplicated"}),"detectDuplicatedPlugin");var q3=Object.defineProperty,z3=v((e,t)=>q3(e,"name",{value:t,configurable:!0}),"s$e"),G3=Object.defineProperty,U3=z3((e,t)=>G3(e,"name",{value:t,configurable:!0}),"s"),K3=Object.defineProperty,Xa=U3((e,t)=>K3(e,"name",{value:t,configurable:!0}),"t");const J3=/(?:^|[^.\w'"`])require(\.resolve)?\(\s*([\w'"`])/,V3=Xa((e,t)=>{if(F$.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),J3.test(e)&&(i=!0),!r&&!n&&!i)return;const o=Cs(e).pop(),s=o?o.end:0,a=new Ke(e);return a.appendRight(s,t(r,n,i)),{code:a.toString(),map:a.generateMap()}},"CJSToESM"),X3=Xa((e,t,r)=>{let n="";return(e||t)&&(n+=`import __cjs_url__ from "node:url"; // -- packem CommonJS __filename shim --
79
- `),t&&(n+=`import __cjs_path__ from "node:path"; // -- packem CommonJS __dirname shim --
80
- `),r&&(n+=`import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
81
- `),(e||t)&&(n+=`const __filename = __cjs_url__.fileURLToPath(import.meta.url);
82
- `),t&&(n+=`const __dirname = __cjs_path__.dirname(__filename);
83
- `),r&&(n+=`const require = __cjs_mod__.createRequire(import.meta.url);
84
- `),n},"generateCJSShim"),Y3=Xa((e,t,r)=>{let n="";return r&&(n+=`import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
85
- `),e&&(n+=`const __filename = import.meta.filename; // -- packem CommonJS __filename shim --
86
- `),t&&(n+=`const __dirname = import.meta.dirname; // -- packem CommonJS __dirname shim --
87
- `),r&&(n+=`const require = __cjs_mod__.createRequire(import.meta.url);
88
- `),n},"generateCJSShimNode20_11"),Q3=Xa((e,t)=>{const r=Mt(t.include,t.exclude);return{name:"packem:esm-shim-cjs-syntax",renderChunk(n,i,o){if(o.format==="es"&&r(i.fileName)){let s=X3;if(e.engines?.node){const a=$t.minVersion(e.engines.node);a&&a.major>=20&&a.minor>=11&&(s=Y3)}return V3(n,s)}}}},"esmShimCjsSyntaxPlugin");var Z3=Object.defineProperty,e9=v((e,t)=>Z3(e,"name",{value:t,configurable:!0}),"A$9"),t9=Object.defineProperty,r9=e9((e,t)=>t9(e,"name",{value:t,configurable:!0}),"M"),n9=Object.defineProperty,yt=r9((e,t)=>n9(e,"name",{value:t,configurable:!0}),"f");const cu=/[.*+?^${}()|[\]\\]/g,i9=/.*/,o9=/^(?:\0|\.{1,2}\/)/,s9=/^node:/,a9=/^@visulima\/css-style-inject(?:\/.+)?$/,$m=yt((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(cu,String.raw`\$&`)}$`)):r.warn(`Ignoring wrong entry type #${String(o)} in '${t}' option: ${JSON.stringify(i)}`),n),[]),"getRegExps"),xm=new Map,l9=yt((e,t)=>{xm.has(e)||t.info({message:`Inlined implicit external "${Pe(e)}". If this is incorrect, add it to the "externals" option.`,prefix:"plugin:packem:externals"}),xm.set(e,!0)},"logExternalMessage"),wm=new Set(["node:sqlite","node:test"]),c9=/[\\:]/,u9=yt(e=>e.length>0&&!c9.test(e),"isValidPackageName"),Tp="@types/",Em=yt(e=>{if(e.startsWith("@")){const[t,r]=e.split("/");return`${t??""}/types/${r??""}`}return`${Tp}${e}`},"getAtTypesPackageName"),p9=yt(e=>{if(e.startsWith("@")){const t=e.split("/");if(t[1]==="types")return`@${t[0]??""}/${t.slice(2).join("/")}`}return e.replace(Tp,"")},"getOriginalPackageName"),f9=["peerDependencies","dependencies","optionalDependencies"],Fb=yt((e,t)=>{const r=Rx.realpathSync.native(process.cwd()),{pkg:n}=e,i=new Set;for(const b of f9){const E=n[b];if(E)for(const h of Object.keys(E))h.startsWith(Tp)?i.add(p9(h)):i.add(h)}const o=new Set(Object.keys(n.devDependencies??{})),s=e.options.rollup.resolveExternals??{},a=new Set($m([...e.options.externals??[]],"include",e.logger)),l=new Set($m([...s.exclude??[]],"exclude",e.logger));if(t?.dtsResolve)if(t.dtsResolve===!0)l.add(i9);else for(const b of t.dtsResolve)typeof b=="string"?l.add(new RegExp(`^${b.replaceAll(cu,String.raw`\$&`)}(?:/.+)?$`)):l.add(b);const c=yt(b=>{const{dtsResolve:E}=t??{};return E?typeof E=="boolean"?E:E.some(h=>typeof h=="string"?b===h:h.test(b)):!1},"shouldResolveForDts"),u={...s.deps?n.dependencies??{}:void 0,...s.devDeps?n.devDependencies??{}:void 0,...s.peerDeps?n.peerDependencies??{}:void 0,...s.optDeps?n.optionalDependencies??{}:void 0},p=Object.keys(u);if(p.length>0&&a.add(new RegExp(`^(?:${p.join("|")})(?:/.+)?$`)),a.add(a9),n.peerDependenciesMeta)for(const[b,E]of Object.entries(n.peerDependenciesMeta))E&&typeof E=="object"&&"optional"in E&&a.add(new RegExp(`^${b}(?:/.+)?$`));const f=yt(b=>[...a].some(E=>E.test(b)),"isIncluded"),d=yt(b=>[...l].some(E=>E.test(b)),"isExcluded");let m=[];e.tsconfig&&(m=Object.entries(e.tsconfig.config.compilerOptions?.paths??{}).map(([b])=>b.endsWith("*")?new RegExp(`^${b.replace("*","(.*)")}$`):new RegExp(`^${b}$`)));const g=Ka(n,e.options),y=e.options.sourceDir?new RegExp(String.raw`(?:^|/)${e.options.sourceDir.replaceAll(cu,String.raw`\$&`)}/`):void 0,x=new Set,j=new Set,R=new Map;return{name:"packem:externals",options:yt(b=>{b.external=(E,h)=>{if(R.has(E))return R.get(E);const A=Je(E),_=h?Je(h):void 0;let O;if(Object.keys(g).length>0){const B=z$(A,g);B!==A&&(O=B)}let k="";O&&gi(O)&&(k=bf(O).name??""),!k&&gi(A)&&(k=bf(A).name??xx(A));const C=k&&gi(k)&&u9(k)?k:"";if(C&&!Co(C)){e.usedDependencies.add(C);const B=!_||!vl(_,e.options.rootDir),J=Object.keys(n.dependencies??{}).includes(C)||Object.keys(n.devDependencies??{}).includes(C)||Object.keys(n.peerDependencies??{}).includes(C)||Object.keys(n.optionalDependencies??{}).includes(C);B&&!J&&e.options.validation&&e.options.validation.dependencies&&e.options.validation.dependencies.hoisted!==!1&&!e.options.validation.dependencies.hoisted?.exclude.includes(C)&&e.hoistedDependencies.add(C)}for(const B of[A,O].filter(Boolean)){const J=n.name?B===n.name||B.startsWith(`${n.name}/`):!1;if(o9.test(B)||Gi(B)||(y?.test(B)??!1)||J)return R.set(E,!1),!1;if(Co(B)||wm.has(B)){let q=s.builtins;return q===void 0&&_&&(q=f(_)&&!d(_)),R.set(E,q),q}if(B[0]==="#"&&!B.startsWith("#/"))return R.set(E,!1),!1;if(f(B)&&!d(B))return R.set(E,!0),!0;if(m.some(q=>q.test(B))||C&&c(C))return R.set(E,!1),!1}return e.implicitDependencies.add(A),l9(A,e.logger),R.set(E,!1),!1}},"options"),resolveId:{filter:{id:yt(b=>!b.startsWith("\0"),"id")},async handler(b,E,h){if(h.isEntry)return;if(b[0]==="#"&&!b.startsWith("#/")&&n.imports)return E&&!vl(E,e.options.rootDir)?{external:!0,id:b}:void 0;if(wm.has(b))return{external:!0,id:b,moduleSideEffects:!1};if(Co(b)){const _=b.replace(s9,"");let O=_;return(s.builtinsPrefix==="add"||!Co(_))&&(O=`node:${_}`),{external:(s.builtins??f(b))&&!d(b),id:s.builtinsPrefix==="ignore"?b:O,moduleSideEffects:!1}}if(!gi(b)||b.includes("?")||b.includes(" "))return;const[A]=Gc(b);if(o.has(A)&&!i.has(A)){if(f(b)&&!d(b))return;if(t?.forTypes)return t.dtsResolve&&c(A)?void 0:{external:!0,id:b,moduleSideEffects:!1};const _=await this.resolve(b,E,{skipSelf:!0,...h});if(!_)throw new Error(`Could not resolve "${b}" even though it's declared in package.json. Try re-installing node_modules.`);if(t?.forTypes){const O=Em(A);i.has(O)&&!x.has(O)&&(x.add(O),e.logger.warn(`Recommendation: "${O}" is externalized but "${A}" is bundled (devDependencies). This may cause type mismatches for consumers. Consider moving "${A}" to dependencies or "${O}" to devDependencies.`))}return _}if(i.has(A)){if(t?.forTypes){const _=Em(A);o.has(_)&&!x.has(_)&&(x.add(_),e.logger.warn(`Recommendation: "${_}" is bundled (devDependencies) but "${A}" is externalized. Place "${_}" in dependencies/peerDependencies as well so users don't have missing types.`))}return}if(!o.has(A)&&E&&!vl(E,r)&&!t?.skipUnlistedWarnings&&!j.has(A)&&(j.add(A),e.logger.warn(`"${A}" imported by "${E}" but not declared in package.json. Will be bundled to prevent failure at runtime.`)),t?.forTypes&&E&&$x(E,r))return{external:!0,id:b,moduleSideEffects:!1}},order:"pre"}}},"externalsPlugin");var d9=Object.defineProperty,m9=v((e,t)=>d9(e,"name",{value:t,configurable:!0}),"d$i"),h9=Object.defineProperty,g9=m9((e,t)=>h9(e,"name",{value:t,configurable:!0}),"d"),v9=Object.defineProperty,Sm=g9((e,t)=>v9(e,"name",{value:t,configurable:!0}),"p");const jc="\0packem-import-attribute/",b9=/(import[\s\S]+?from\s*["'])([^"']+)(["'])\s*with\s*\{\s*type\s*:\s*["'](text|bytes)["']\s*\}/g,y9=/(\bimport\s*\(\s*["'])([^"']+)["']\s*,\s*\{\s*with\s*:\s*\{\s*type\s*:\s*["'](text|bytes)["']\s*\}\s*\}\s*\)/g,$9=/\.[mc]?[jt]sx?$/,x9=Sm(()=>{const e=new Map;let t=0;const r=Sm(n=>{const i=`${jc}${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:Tx(Uc(o),s);if(this.addWatchFile(l),a==="text"){const c=await us(l,"utf8");return`export default ${JSON.stringify(c)}`}return`export default new Uint8Array([${(await us(l)).join(",")}])`},name:"packem:import-attributes",resolveId(n,i){return n.startsWith(jc)&&e.has(n)?n:null},transform(n,i){const o=i.split("?")[0]??i;if(o.startsWith(jc)||!$9.test(o)||!n.includes("with")||!n.includes("text")&&!n.includes("bytes"))return null;const s=n.replaceAll(b9,(a,l,c,u,p)=>{const f=r({importer:i,source:c,type:p});return`${l}${f}${u}`}).replaceAll(y9,(a,l,c,u)=>{const p=r({importer:i,source:c,type:u});return`${l}${p}")`});return s===n?null:{code:s,map:null}}}},"importAttributesPlugin");var w9=Object.defineProperty,Hb=v((e,t)=>w9(e,"name",{value:t,configurable:!0}),"u$i"),E9=Object.defineProperty,qb=Hb((e,t)=>E9(e,"name",{value:t,configurable:!0}),"d"),S9=Object.defineProperty,xn=qb((e,t)=>S9(e,"name",{value:t,configurable:!0}),"a");const k9=xn(e=>{const t=[],r=[];e.forEach(i=>{i.startsWith("(")?t.push(i):r.push(i)});const n=xn((i,o)=>i.localeCompare(o),"byLocale");return[...r.toSorted(n),...t.toSorted(n)]},"sortLicenses"),j9=xn((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 Ya(e){return e?`> ${e}`:">"}v(Ya,"d$h");Hb(Ya,"h");qb(Ya,"P");xn(Ya,"prefixQuoteMarker");const A9=xn((e,t,r)=>e.trim().replaceAll(/\r\n|\r/g,`
89
- `).replaceAll(`<!-- ${t} -->`,"").replaceAll(r?`<!-- ${r} -->`:"","").replaceAll(`<!-- /${t} -->`,"").replaceAll(r?`<!-- /${r} -->`:"","").trim().split(`
90
- `).map(n=>Ya(n)).join(`
91
- `),"formatLicenseBody"),zb=xn(({dtsMarker:e,licenseFilePath:t,licenseTemplate:r,logger:n,marker:i,mode:o,packageName:s})=>Ux({thirdParty(a){const l=new Set,c=a.toSorted(({name:p},{name:f})=>{const d=p??"",m=f??"";return d.localeCompare(m)}).map(({author:p,contributors:f,license:d,licenseText:m,maintainers:g,name:y,repository:x})=>{let j=`## ${y??""}
92
- `;d&&(j+=`License: ${d}
93
- `);const R=j9(p,g,f);return R.length>0&&(j+=`By: ${R.join(", ")}
94
- `),x&&(j+=`Repository: ${typeof x=="string"?x:x.url}
95
- `),m&&(j+=`
96
- ${A9(m,i,e)}
97
- `),d&&l.add(d),j}).join(`
98
- ---------------------------------------
99
-
100
- `);if(c===""){n.info({message:"No dependencies license information found.",prefix:`plugin:license:${o}`});return}const u=r(k9(l),c,s);try{const p=Dh(t),f=wx(p,i,u);if(!f){n.error({message:`Could not find the license marker: <!-- ${i} --><!-- /${i} --> in ${t}`,prefix:`plugin:license:${o}`});return}p!==f&&(Y$(t,f),n.info({message:`${t} updated.`,prefix:`plugin:license:${o}`}))}catch(p){n.error(p)}}}),"licensePlugin");var O9=Object.defineProperty,Gb=v((e,t)=>O9(e,"name",{value:t,configurable:!0}),"C$7"),R9=Object.defineProperty,jo=Gb((e,t)=>R9(e,"name",{value:t,configurable:!0}),"g");let Wr;const Vr={getHeadTemplatePart(e){const t=e.getFullText(Wr),r=t.indexOf("`")+1,n=Gt.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(Wr),r=Gt.isTemplateMiddle(e)?2:1;return{end:e.end-r,start:e.getStart(Wr)+1,text:t.slice(1,t.length-r)}},getRootNode(e,t=""){return Gt.createSourceFile(t,e,Gt.ScriptTarget.ESNext)},getTaggedTemplateTemplate(e){return e.template},getTagText(e){return e.tag.getText(Wr)},getTemplateParts(e){return Gt.isNoSubstitutionTemplateLiteral(e)?[Vr.getHeadTemplatePart(e)]:[Vr.getHeadTemplatePart(e.head),...e.templateSpans.map(t=>Vr.getMiddleTailTemplatePart(t.literal))]},isTaggedTemplate:Gt.isTaggedTemplateExpression,isTemplate:Gt.isTemplateLiteral,walkChildNodes(e,t){t(e),Gt.forEachChild(e,r=>{Vr.walkChildNodes(r,t)})},walkNodes(e,t){Wr=e,Vr.walkChildNodes(e,t),Wr=void 0}};var _9=Object.defineProperty,P9=jo((e,t)=>_9(e,"name",{value:t,configurable:!0}),"i");const C9=P9((e,t={})=>{const r={...Vr,...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 T9=Object.defineProperty,Np=jo((e,t)=>T9(e,"name",{value:t,configurable:!0}),"c");const fn={One:"1",Two:"2",Zero:"0"},N9=Np(e=>{const t={[fn.One]:{tidySelectors:!1,transform:void 0},[fn.Two]:{tidySelectors:!1,transform:void 0},[fn.Zero]:{}};if(e===void 0)return t;if(typeof e=="number"){const r=e.toString();return{...t,[r]:{...t[r]}}}return e},"optimizationLevelFrom"),I9=/(:[^()\s]+\(([^()]*)\))\s*\{/g,M9=/\s/g,D9=/\s/,km=Np((e,t)=>{let r=t;const n=[...e.matchAll(I9)];for(const i of n){const o=i[1],s=i[2];if(!o||!s||!D9.test(s))continue;const a=s.replaceAll(M9,""),l=o.replace(s,a),c=r.indexOf(l);if(c===-1)continue;const u=c+l.length;r=r.slice(0,Math.max(0,c))+o+r.slice(Math.max(0,u))}return r},"fixCleanCssTidySelectors"),B9={},L9={caseSensitive:!0,collapseWhitespace:!0,decodeEntities:!0,minifyCSS:B9,minifyJS:!0,removeAttributeQuotes:!1,removeComments:!0,removeEmptyAttributes:!0,removeScriptTypeAttributes:!0,removeStyleLinkTypeAttributes:!0,useShortDoctype:!0},jm=Np((e={})=>{const t=N9(e.level),r=typeof e.level=="object"&&typeof e.level[1]?.transform=="function"?e.level[1].transform:!1;return t[fn.One].transform=(n,i)=>i.startsWith("@TEMPLATE_EXPRESSION")&&!i.endsWith(";")?`${i};`:r?r(n,i):i,{...e,level:t}},"adjustMinifyCSSOptions"),W9={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=jm(t),n=new Kx(r).minify(e);if(n.errors.length>0)throw new Error(n.errors.join(`
101
-
102
- `));return r.level?.[fn.One]?.tidySelectors&&(n.styles=km(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=jm(r));let i=await Jx(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 u=i.slice(a,l);const p=i.slice(Math.max(0,l));u=u.replaceAll(/\r?\n/g,""),i=c+u+p}}return(n?n.level:void 0)?.[fn.One]?.tidySelectors&&(i=km(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 F9=Object.defineProperty,Qa=jo((e,t)=>F9(e,"name",{value:t,configurable:!0}),"f");const H9=Qa((e,t)=>e.generateMap({file:`${t}.map`,hires:!0,source:t}),"defaultGenerateSourceMap"),q9=Qa(e=>{const t=e.tag?.toLowerCase();return!!t&&(t.includes("html")||t.includes("svg"))},"defaultShouldMinify"),z9=Qa(e=>!!e.tag&&e.tag.toLowerCase().includes("css"),"defaultShouldMinifyCSS"),G9={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 Za(e,t={}){t.minifyOptions={...L9,...t.minifyOptions},t.MagicString??=Ke,t.parseLiterals??=C9,t.shouldMinify??=q9,t.shouldMinifyCSS??=z9,t.parseLiteralsOptions={fileName:t.fileName,...t.parseLiteralsOptions};const r=t.parseLiterals(e,t.parseLiteralsOptions),n=t.strategy??W9,{shouldMinify:i,shouldMinifyCSS:o}=t;let s;t.validate!==!1&&(s=t.validate??G9);const a=new t.MagicString(e);for(const u of r){const p=i(u),f=!!n.minifyCSS&&o(u);if(p||f){const d=n.getPlaceholder(u.parts);s&&s.ensurePlaceholderValid(d);const m=n.combineHTMLStrings(u.parts,d);let g;if(f){const x=t.minifyOptions?.minifyCSS;if(typeof x=="function"){const j=x(m);g=typeof j=="string"?j:await j}else if(x===!1)g=m;else{const j=typeof x=="object"&&x!==null?x:void 0,R=n.minifyCSS;if(!R)throw new Error("Strategy does not implement minifyCSS but minifyCSS was requested");const b=R(m,j);g=typeof b=="string"?b:await b}}else{const x=n.minifyHTML(m,t.minifyOptions);g=typeof x=="string"?x:await x}const y=n.splitHTMLByPlaceholder(g,d);s&&s.ensureHTMLPartsValid(u.parts,y),u.parts.forEach((x,j)=>{x.start<x.end&&y[j]!==void 0&&a.overwrite(x.start,x.end,y[j])})}}const l=a.toString();if(e===l)return;let c;return t.generateSourceMap!==!1&&(c=(t.generateSourceMap??H9)(a,t.fileName??"")),{code:l,map:c}}v(Za,"O$8");Gb(Za,"H");jo(Za,"minifyHTMLLiterals");Qa(Za,"minifyHTMLLiterals");var U9=Object.defineProperty,K9=jo((e,t)=>U9(e,"name",{value:t,configurable:!0}),"o");const J9=K9(({exclude:e,failOnError:t=!1,include:r,logger:n,minifyHTMLLiterals:i,options:o})=>{i??=Za;const s=Mt(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(u){const p=u instanceof Error?u.message:u;t?this.error(p):n.warn({message:p,prefix:"plugin:minify-html-literals"})}}}},"minifyHTMLLiteralsPlugin");var V9=Object.defineProperty,X9=v((e,t)=>V9(e,"name",{value:t,configurable:!0}),"h$a"),Y9=Object.defineProperty,Q9=X9((e,t)=>Y9(e,"name",{value:t,configurable:!0}),"h"),Z9=Object.defineProperty,Am=Q9((e,t)=>Z9(e,"name",{value:t,configurable:!0}),"f");const e8=/\.node$/,Ac="\0packem-natives/",t8=Am((e={})=>{const{nativesDirectory:t="natives"}=e,r=new Map;let n=0,i;return{buildStart(){r.clear(),n=0},generateBundle:Am(async o=>{if(r.size===0)return;let s;if(o.dir?s=o.dir:o.file&&(s=Ce(o.file)),!s)throw new Error("Output directory not detected. Please ensure Rollup output options are configured.");const a=le(s,t);await Kc(a);const l=new Set,c=[];for(const{outputName:u,sourcePath:p}of r.values())l.has(p)||(l.add(p),c.push(Dx(p,le(a,u))));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=Ce(a.file))}return o},resolveId:{filter:{id:e8},async handler(o,s){if(o.startsWith(Ac))return;if(s?.startsWith(Ac))return{external:!0,id:o};const a=s?ve(Ce(s),o):ve(o);if(!await Zr(a)){this.warn(`Native module not found: ${a}`);return}for(const[d,m]of r)if(m.sourcePath===a)return d;const l=xt(a);let c=l,u=1;const p=new Set(Array.from(r.values(),d=>d.outputName));for(;p.has(c);){const d=gn(l);c=`${xt(l,d)}_${String(u)}${d}`,u+=1}const f=`${Ac}${String(n)}`;return n+=1,r.set(f,{outputName:c,sourcePath:a}),f}}}},"nativeModulesPlugin");var r8=Object.defineProperty,n8=v((e,t)=>r8(e,"name",{value:t,configurable:!0}),"n$9"),i8=Object.defineProperty,o8=n8((e,t)=>i8(e,"name",{value:t,configurable:!0}),"n"),s8=Object.defineProperty,a8=o8((e,t)=>s8(e,"name",{value:t,configurable:!0}),"a");const l8=a8(e=>{const t=Mt(e.include,e.exclude);return{async load(r){if(r.includes("?raw")){const n=r.split("?")[0];try{const i=await kr(n);return process.platform==="win32"?i.replaceAll(`\r
103
- `,`
104
- `):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
105
- `,`
106
- `):r;return{code:`const data = ${JSON.stringify(s)};
107
- export default data;`,map:null}}return null}}},"rawPlugin");var c8=Object.defineProperty,u8=v((e,t)=>c8(e,"name",{value:t,configurable:!0}),"N$8"),p8=Object.defineProperty,Ub=u8((e,t)=>p8(e,"name",{value:t,configurable:!0}),"w"),f8=Object.defineProperty,d8=Ub((e,t)=>f8(e,"name",{value:t,configurable:!0}),"s");let Om=!1;const m8=d8(async(e,t,r)=>{if(Om||(await ng(),Om=!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=De(t).resolve(e)}catch{}if(n){try{const{packageJson:i}=await Q$(n);if(i.type==="module")return!1;if(i.type==="commonjs")return!0}catch{}try{const i=await kr(n,{encoding:"utf8"});try{return Vx(i,n),!0}catch{}}catch{}}}return!1},"isPureCJS");var h8=Object.defineProperty,Bn=Ub((e,t)=>h8(e,"name",{value:t,configurable:!0}),"d");const Ip="__cjs_require",g8='import { createRequire as __cjs_createRequire } from "node:module";',v8=`const ${Ip} = __cjs_createRequire(import.meta.url);`,b8='const __cjs_getProcess = typeof globalThis !== "undefined" && typeof globalThis.process !== "undefined" ? globalThis.process : process;',y8=`const __cjs_getBuiltinModule = (module) => {
108
- // Check if we're in Node.js and version supports getBuiltinModule
109
- if (typeof __cjs_getProcess !== "undefined" && __cjs_getProcess.versions && __cjs_getProcess.versions.node) {
110
- const [major, minor] = __cjs_getProcess.versions.node.split(".").map(Number);
111
- // Node.js 20.16.0+ and 22.3.0+
112
- if (major > 22 || (major === 22 && minor >= 3) || (major === 20 && minor >= 16)) {
113
- return __cjs_getProcess.getBuiltinModule(module);
114
- }
115
- }
116
- // Fallback to createRequire
117
- return ${Ip}(module);
118
- };`,Do={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},$8=[/node_modules/,/\.d\.[cm]?ts$/],x8=[/\.[cm]?[jt]sx?$/];let Rm=!1;const w8=Bn((e,t)=>t&&(C$.includes(e)||e.startsWith("node:")),"isBuiltinModule"),E8=Bn(async(e,t,r,n,i)=>t?!0:await r?.(e,n,i)??await m8(e,n,i),"shouldTransformImport"),S8=Bn((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:`${Ip}(${JSON.stringify(e)})`,needsBuiltin:!1,needsProcess:!1,needsRequire:!0},"generateRequireCode"),k8=Bn(e=>{const t=new Ke(e),r={builtin:[...e.matchAll(Do.builtin)],import:[...e.matchAll(Do.import)],process:[...e.matchAll(Do.process)],require:[...e.matchAll(Do.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"),j8=Bn(e=>{if(Array.isArray(e.shouldTransform)){const{shouldTransform:t}=e;e.shouldTransform=r=>t.includes(r)}return{builtinNodeModules:!!e.builtinNodeModules,cwd:e.cwd??Vt.cwd(),exclude:e.exclude??$8,include:e.include??x8,order:"order"in e?e.order:"pre",shouldTransform:e.shouldTransform}},"resolveOptions"),A8=Bn((e,t)=>{if(Vt.env.INTERNAL_PACKEM_BUILD)return{name:"require-cjs-transformer"};const{builtinNodeModules:r,cwd:n,exclude:i,include:o,order:s,shouldTransform:a}=j8(e),l=Mt(o,i);return{async buildStart(){Rm||(await ng(),Rm=!0)},name:"packem:plugin-require-cjs",renderChunk:{async handler(c,u,p){if(p.format!=="es"||!l(u.fileName))return;const f=Ts(u.fileName,c,{astType:"js",lang:"js",sourceType:"module"}),d=new Ke(c);let m=!1,g=!1,y=!1;for(const j of f.program.body){if(j.type!=="ImportDeclaration"||j.importKind==="type")continue;const R=j.source.value,b=w8(R,r),E=this.resolve;if(!await E8(R,b,a,n,E))continue;const{code:h,needsBuiltin:A,needsProcess:_,needsRequire:O}=S8(R,b);if(m||=O,g||=_,y||=A,j.specifiers.length===0){b?d.remove(j.start,j.end):d.overwrite(j.start,j.end,`${h};`);continue}const k=[];let C,B;for(const q of j.specifiers)if(q.type==="ImportNamespaceSpecifier")C=q.local.name;else if(q.type==="ImportSpecifier"&&q.importKind!=="type"){const X=c.slice(q.imported.start,q.imported.end);k.push([X,q.local.name])}else q.type==="ImportDefaultSpecifier"&&(B=q.local.name);const J=[];if(C&&(B??=`_cjs_${C}_default`),B&&J.push(`const ${B} = ${h};`),C&&J.push(`const ${C} = { ...${B??""}, default: ${B??""} };`),k.length>0){const q=`const {
119
- ${k.map(([X,te])=>` ${X===te?te:`${X}: ${te}`}`).join(`,
120
- `)}
121
- } = ${B??h};`;J.push(q)}d.overwrite(j.start,j.end,J.join(`
122
- `))}if(m||g||y){const j=[];m&&j.push(g8,v8),g&&j.push(b8),y&&j.push(y8);const R=`${j.join(`
123
-
124
- `)}
125
-
126
- `,b=d.toString();if(b[0]==="#"){const E=b.indexOf(`
127
- `)+1;d.appendLeft(E,R)}else d.prepend(R)}const x=new Ke(k8(d.toString()));return{code:x.toString(),map:x.generateMap()}},order:s}}},"requireCJSTransformerPlugin");var O8=Object.defineProperty,R8=v((e,t)=>O8(e,"name",{value:t,configurable:!0}),"I$6"),_8=Object.defineProperty,P8=R8((e,t)=>_8(e,"name",{value:t,configurable:!0}),"S"),C8=Object.defineProperty,xs=P8((e,t)=>C8(e,"name",{value:t,configurable:!0}),"f");const T8=xs(async e=>{try{const n=await Ki(e);if(n.isFile())return e;if(n.isDirectory()){const i=le(e,"index.js");if(await Zr(i))return i;const o=le(e,"index.json");if(await Zr(o))return o}}catch{}const t=`${e}.js`;if(await Zr(t))return t;const r=`${e}.json`;if(await Zr(r))return r},"tryResolveImplicit"),N8=xs(async(e,t)=>{let r=e;const n=ve("/");for(;r!==n&&r!==Ce(r);){const i=le(r,"node_modules",t,"package.json");if(await Zr(i))return i;r=Ce(r)}},"findPackageJson"),Kb=xs(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=xs(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 d=c[1];if(!d||!gi(d))continue;const[m,g]=Gc(d);if(g&&m&&i(m)){const y=c.index+c[0].indexOf(d);l.push({importId:d,quoteEnd:y+d.length,quoteStart:y})}}if(l.length===0)return;const u=Ce(s),p=(await Promise.all(l.map(async d=>{const[m,g]=Gc(d.importId);if(!g)return;const y=`${m}:${g}:${u}`,x=r.get(y);if(x!==void 0)return x?{...d,resolvedId:x}:void 0;const j=await N8(u,m);if(!j){r.set(y,void 0);return}let R=t.get(j);if(R===void 0)try{R=Z$(j,{resolveCatalogs:!0}),t.set(j,R)}catch{t.set(j,void 0),r.set(y,void 0);return}if(R.exports){r.set(y,void 0);return}const b=Ce(j),E=le(b,g),h=await T8(E);if(!h){r.set(y,void 0);return}const A=tt(b,h),_=`${m}/${A}`;return r.set(y,_),{...d,resolvedId:_}}))).filter(d=>d!==void 0);if(p.length===0)return;const f=new Ke(o);for(const{quoteEnd:d,quoteStart:m,resolvedId:g}of p)f.overwrite(m,d,g),this.debug(`[resolve-implicit-externals] Rewriting ${o.slice(m,d)} -> ${g} in ${s}`);return{code:f.toString(),map:f.generateMap({hires:!0})}}}},"resolveImplicitExternalsPlugin");var I8=Object.defineProperty,M8=v((e,t)=>I8(e,"name",{value:t,configurable:!0}),"m$c"),D8=Object.defineProperty,B8=M8((e,t)=>D8(e,"name",{value:t,configurable:!0}),"u"),L8=Object.defineProperty,el=B8((e,t)=>L8(e,"name",{value:t,configurable:!0}),"o");const ws=/^#![^\n]*/,uu=el(async e=>{await Qh(e,493).catch(()=>{})},"makeExecutable"),W8=el((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(ws,`${t.shebang}
128
- `),map:void 0};if(!o&&e.includes(n.name)){const s=new Ke(r);return s.prepend(`${t.shebang}
129
- `),{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"&&ws.test(o.code)&&r.dir){const s=ve(r.dir,i);await uu(s)}}}),"shebangPlugin"),F8=el(()=>({name:"packem:remove-shebang",renderChunk(e){return e.replace(ws,"")}}),"removeShebangPlugin"),H8=el((e,t=`
130
- `)=>{const r=ws.exec(e);return r?`${r[0]}${t}`:""},"getShebang");var q8=Object.defineProperty,Xe=v((e,t)=>q8(e,"name",{value:t,configurable:!0}),"C$6"),wn=44,Jb=59,_m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Vb=new Uint8Array(64),Xb=new Uint8Array(128);for(let e=0;e<_m.length;e++){const t=_m.charCodeAt(e);Vb[e]=t,Xb[t]=e}function Ie(e,t){let r=0,n=0,i=0;do{const s=e.next();i=Xb[s],r|=(i&31)<<n,n+=5}while(i&32);const o=r&1;return r>>>=1,o&&(r=-2147483648|-r),t+r}v(Ie,"h$9");Xe(Ie,"decodeInteger");function Oe(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(Vb[i])}while(n>0);return t}v(Oe,"i$8");Xe(Oe,"encodeInteger");function Ht(e,t){return e.pos>=t?!1:e.peek()!==wn}v(Ht,"S$6");Xe(Ht,"hasMoreVlq");var Pm=1024*16,Cm=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}},Mp=class{static{v(this,"T")}static{Xe(this,"StringWriter")}constructor(){this.pos=0,this.out="",this.buffer=new Uint8Array(Pm)}write(t){const{buffer:r}=this;r[this.pos++]=t,this.pos===Pm&&(this.out+=Cm.decode(r),this.pos=0)}flush(){const{buffer:t,out:r,pos:n}=this;return n>0?r+Cm.decode(t.subarray(0,n)):r}},Dp=class{static{v(this,"w")}static{Xe(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}},Yb=[];function z8(e){const{length:t}=e,r=new Dp(e),n=[],i=[];let o=0;for(;r.pos<t;r.pos++){o=Ie(r,o);const s=Ie(r,0);if(!Ht(r,t)){const u=i.pop();u[2]=o,u[3]=s;continue}const a=Ie(r,0),l=Ie(r,0)&1?[o,s,0,0,a,Ie(r,0)]:[o,s,0,0,a];let c=Yb;if(Ht(r,t)){c=[];do{const u=Ie(r,0);c.push(u)}while(Ht(r,t))}l.vars=c,n.push(l),i.push(l)}return n}v(z8,"z$4");Xe(z8,"decodeOriginalScopes");function G8(e){const t=new Mp;for(let r=0;r<e.length;)r=Bp(e,r,t,[0]);return t.flush()}v(G8,"F$8");Xe(G8,"encodeOriginalScopes");function Bp(e,t,r,n){const i=e[t],{0:o,1:s,2:a,3:l,4:c,vars:u}=i;t>0&&r.write(wn),n[0]=Oe(r,o,n[0]),Oe(r,s,0),Oe(r,c,0);const p=i.length===6?1:0;Oe(r,p,0),i.length===6&&Oe(r,i[5],0);for(const f of u)Oe(r,f,0);for(t++;t<e.length;){const f=e[t],{0:d,1:m}=f;if(d>a||d===a&&m>=l)break;t=Bp(e,t,r,n)}return r.write(wn),n[0]=Oe(r,a,n[0]),Oe(r,l,0),t}v(Bp,"P$7");Xe(Bp,"_encodeOriginalScopes");function U8(e){const{length:t}=e,r=new Dp(e),n=[],i=[];let o=0,s=0,a=0,l=0,c=0,u=0,p=0,f=0;do{const d=r.indexOf(";");let m=0;for(;r.pos<d;r.pos++){if(m=Ie(r,m),!Ht(r,d)){const h=i.pop();h[2]=o,h[3]=m;continue}const g=Ie(r,0),y=g&1,x=g&2,j=g&4;let R=null,b=Yb,E;if(y){const h=Ie(r,s);a=Ie(r,s===h?a:0),s=h,E=[o,m,0,0,h,a]}else E=[o,m,0,0];if(E.isScope=!!j,x){const h=l,A=c;l=Ie(r,l);const _=h===l;c=Ie(r,_?c:0),u=Ie(r,_&&A===c?u:0),R=[l,c,u]}if(E.callsite=R,Ht(r,d)){b=[];do{p=o,f=m;const h=Ie(r,0);let A;if(h<-1){A=[[Ie(r,0)]];for(let _=-1;_>h;_--){const O=p;p=Ie(r,p),f=Ie(r,p===O?f:0);const k=Ie(r,0);A.push([k,p,f])}}else A=[[h]];b.push(A)}while(Ht(r,d))}E.bindings=b,n.push(E),i.push(E)}o++,r.pos=d+1}while(r.pos<t);return n}v(U8,"H$5");Xe(U8,"decodeGeneratedRanges");function K8(e){if(e.length===0)return"";const t=new Mp;for(let r=0;r<e.length;)r=Lp(e,r,t,[0,0,0,0,0,0,0]);return t.flush()}v(K8,"J$3");Xe(K8,"encodeGeneratedRanges");function Lp(e,t,r,n){const i=e[t],{0:o,1:s,2:a,3:l,isScope:c,callsite:u,bindings:p}=i;n[0]<o?(pu(r,n[0],o),n[0]=o,n[1]=0):t>0&&r.write(wn),n[1]=Oe(r,i[1],n[1]);const f=(i.length===6?1:0)|(u?2:0)|(c?4:0);if(Oe(r,f,0),i.length===6){const{4:d,5:m}=i;d!==n[2]&&(n[3]=0),n[2]=Oe(r,d,n[2]),n[3]=Oe(r,m,n[3])}if(u){const{0:d,1:m,2:g}=i.callsite;d!==n[4]?(n[5]=0,n[6]=0):m!==n[5]&&(n[6]=0),n[4]=Oe(r,d,n[4]),n[5]=Oe(r,m,n[5]),n[6]=Oe(r,g,n[6])}if(p)for(const d of p){d.length>1&&Oe(r,-d.length,0);const m=d[0][0];Oe(r,m,0);let g=o,y=s;for(let x=1;x<d.length;x++){const j=d[x];g=Oe(r,j[1],g),y=Oe(r,j[2],y),Oe(r,j[0],0)}}for(t++;t<e.length;){const d=e[t],{0:m,1:g}=d;if(m>a||m===a&&g>=l)break;t=Lp(e,t,r,n)}return n[0]<a?(pu(r,n[0],a),n[0]=a,n[1]=0):r.write(wn),n[1]=Oe(r,l,n[1]),t}v(Lp,"V$4");Xe(Lp,"_encodeGeneratedRanges");function pu(e,t,r){do e.write(Jb);while(++t<r)}v(pu,"U$5");Xe(pu,"catchupLine");function Qb(e){const{length:t}=e,r=new Dp(e),n=[];let i=0,o=0,s=0,a=0,l=0;do{const c=r.indexOf(";"),u=[];let p=!0,f=0;for(i=0;r.pos<c;){let d;i=Ie(r,i),i<f&&(p=!1),f=i,Ht(r,c)?(o=Ie(r,o),s=Ie(r,s),a=Ie(r,a),Ht(r,c)?(l=Ie(r,l),d=[i,o,s,a,l]):d=[i,o,s,a]):d=[i],u.push(d),r.pos++}p||Zb(u),n.push(u),r.pos=c+1}while(r.pos<=t);return n}v(Qb,"K$4");Xe(Qb,"decode");function Zb(e){e.sort(ey)}v(Zb,"Q$4");Xe(Zb,"sort");function ey(e,t){return e[0]-t[0]}v(ey,"X$5");Xe(ey,"sortComparator");function ty(e){const t=new Mp;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(Jb),a.length===0)continue;let l=0;for(let c=0;c<a.length;c++){const u=a[c];c>0&&t.write(wn),l=Oe(t,u[0],l),u.length!==1&&(r=Oe(t,u[1],r),n=Oe(t,u[2],n),i=Oe(t,u[3],i),u.length!==4&&(o=Oe(t,u[4],o)))}}return t.flush()}v(ty,"Z$4");Xe(ty,"encode");var J8=Object.defineProperty,ft=v((e,t)=>J8(e,"name",{value:t,configurable:!0}),"c$h");const V8=/^[\w+.-]+:\/\//,X8=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,Y8=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function ry(e){return V8.test(e)}v(ry,"R$7");ft(ry,"isAbsoluteUrl");function ny(e){return e.startsWith("//")}v(ny,"q$5");ft(ny,"isSchemeRelativeUrl");function Wp(e){return e.startsWith("/")}v(Wp,"m$b");ft(Wp,"isAbsolutePath");function iy(e){return e.startsWith("file:")}v(iy,"v$c");ft(iy,"isFileUrl");function fu(e){return/^[.?#]/.test(e)}v(fu,"u$f");ft(fu,"isRelative");function xi(e){const t=X8.exec(e);return Fp(t[1],t[2]||"",t[3],t[4]||"",t[5]||"/",t[6]||"",t[7]||"")}v(xi,"f$d");ft(xi,"parseAbsoluteUrl");function oy(e){const t=Y8.exec(e),r=t[2];return Fp("file:","",t[1]||"","",Wp(r)?r:"/"+r,t[3]||"",t[4]||"")}v(oy,"w$7");ft(oy,"parseFileUrl");function Fp(e,t,r,n,i,o,s){return{scheme:e,user:t,host:r,port:n,path:i,query:o,hash:s,type:7}}v(Fp,"y$9");ft(Fp,"makeUrl");function du(e){if(ny(e)){const r=xi("http:"+e);return r.scheme="",r.type=6,r}if(Wp(e)){const r=xi("http://foo.com"+e);return r.scheme="",r.host="",r.type=5,r}if(iy(e))return oy(e);if(ry(e))return xi(e);const t=xi("http://foo.com/"+e);return t.scheme="",t.host="",t.type=e?e.startsWith("?")?3:e.startsWith("#")?2:4:1,t}v(du,"p$d");ft(du,"parseUrl");function sy(e){if(e.endsWith("/.."))return e;const t=e.lastIndexOf("/");return e.slice(0,t+1)}v(sy,"P$6");ft(sy,"stripPathFilename");function ay(e,t){Hp(t,t.type),e.path==="/"?e.path=t.path:e.path=sy(t.path)+e.path}v(ay,"A$5");ft(ay,"mergePaths");function Hp(e,t){const r=t<=4,n=e.path.split("/");let i=1,o=0,s=!1;for(let l=1;l<n.length;l++){const c=n[l];if(!c){s=!0;continue}if(s=!1,c!=="."){if(c===".."){o?(s=!0,o--,i--):r&&(n[i++]=c);continue}n[i++]=c,o++}}let a="";for(let l=1;l<i;l++)a+="/"+n[l];(!a||s&&!a.endsWith("/.."))&&(a+="/"),e.path=a}v(Hp,"d$f");ft(Hp,"normalizePath");function ly(e,t){if(!e&&!t)return"";const r=du(e);let n=r.type;if(t&&n!==7){const o=du(t),s=o.type;switch(n){case 1:r.hash=o.hash;case 2:r.query=o.query;case 3:case 4:ay(r,o);case 5:r.user=o.user,r.host=o.host,r.port=o.port;case 6:r.scheme=o.scheme}s>n&&(n=s)}Hp(r,n);const i=r.query+r.hash;switch(n){case 2:case 3:return i;case 4:{const o=r.path.slice(1);return o?fu(t||e)&&!fu(o)?"./"+o+i:o+i:i||"."}case 5:return r.path+i;default:return r.scheme+"//"+r.user+r.host+r.port+r.path+i}}v(ly,"F$7");ft(ly,"resolve");var Q8=Object.defineProperty,xe=v((e,t)=>Q8(e,"name",{value:t,configurable:!0}),"i$7");function cy(e){if(!e)return"";const t=e.lastIndexOf("/");return e.slice(0,t+1)}v(cy,"ae$4");xe(cy,"stripFilename");function uy(e,t){const r=cy(e),n=t?t+"/":"";return i=>ly(n+(i||""),r)}v(uy,"ge$3");xe(uy,"resolver");var kt=0,qp=1,zp=2,Gp=3,py=4,fy=1,dy=2;function my(e,t){const r=mu(e,0);if(r===e.length)return e;t||(e=e.slice());for(let n=r;n<e.length;n=mu(e,n+1))e[n]=gy(e[n],t);return e}v(my,"he$1");xe(my,"maybeSort");function mu(e,t){for(let r=t;r<e.length;r++)if(!hy(e[r]))return r;return e.length}v(mu,"X$4");xe(mu,"nextUnsortedSegmentLine");function hy(e){for(let t=1;t<e.length;t++)if(e[t][kt]<e[t-1][kt])return!1;return!0}v(hy,"_e$1");xe(hy,"isSorted");function gy(e,t){return t||(e=e.slice()),e.sort(Up)}v(gy,"ve$2");xe(gy,"sortSegments");function Up(e,t){return e[kt]-t[kt]}v(Up,"$$8");xe(Up,"sortComparator");function vy(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[qp],l=s[zp],c=s[Gp],u=r[a];(u[l]||(u[l]=[])).push([c,n,s[kt]])}}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(Up)}}return r}v(vy,"Se$2");xe(vy,"buildBySources");var Er=!1;function by(e,t,r,n){for(;r<=n;){const i=r+(n-r>>1),o=e[i][kt]-t;if(o===0)return Er=!0,i;o<0?r=i+1:n=i-1}return Er=!1,r-1}v(by,"Ee$1");xe(by,"binarySearch");function Kp(e,t,r){for(let n=r+1;n<e.length&&e[n][kt]===t;r=n++);return r}v(Kp,"H$4");xe(Kp,"upperBound");function Jp(e,t,r){for(let n=r-1;n>=0&&e[n][kt]===t;r=n--);return r}v(Jp,"Y$3");xe(Jp,"lowerBound");function Vp(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}v(Vp,"k$7");xe(Vp,"memoizedState");function yy(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 Er=s!==-1&&e[s][kt]===t,s;t>=o?a=s===-1?0:s:l=s}return r.lastKey=n,r.lastNeedle=t,r.lastIndex=by(e,t,a,l)}v(yy,"Me$2");xe(yy,"memoizedBinarySearch");function tl(e){return typeof e=="string"?JSON.parse(e):e}v(tl,"j$8");xe(tl,"parse");var Z8=xe(function(e,t){const r=tl(e);if(!("sections"in r))return new Yp(r,t);const n=[],i=[],o=[],s=[],a=[];Xp(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 ky(l)},"FlattenMap");function Xp(e,t,r,n,i,o,s,a,l,c,u){const{sections:p}=e;for(let f=0;f<p.length;f++){const{map:d,offset:m}=p[f];let g=c,y=u;if(f+1<p.length){const x=p[f+1].offset;g=Math.min(c,a+x.line),g===c?y=Math.min(u,l+x.column):g<c&&(y=l+x.column)}$y(d,t,r,n,i,o,s,a+m.line,l+m.column,g,y)}}v(Xp,"ee$3");xe(Xp,"recurse");function $y(e,t,r,n,i,o,s,a,l,c,u){const p=tl(e);if("sections"in p)return Xp(...arguments);const f=new Yp(p,t),d=n.length,m=o.length,g=Lr(f),{resolvedSources:y,sourcesContent:x,ignoreList:j}=f;if(is(n,y),is(o,f.names),x)is(i,x);else for(let R=0;R<y.length;R++)i.push(null);if(j)for(let R=0;R<j.length;R++)s.push(j[R]+d);for(let R=0;R<g.length;R++){const b=a+R;if(b>c)return;const E=xy(r,b),h=R===0?l:0,A=g[R];for(let _=0;_<A.length;_++){const O=A[_],k=h+O[kt];if(b===c&&k>=u)return;if(O.length===1){E.push([k]);continue}const C=d+O[qp],B=O[zp],J=O[Gp];E.push(O.length===4?[k,C,B,J]:[k,C,B,J,m+O[py]])}}}v($y,"me$3");xe($y,"addSection");function is(e,t){for(let r=0;r<t.length;r++)e.push(t[r])}v(is,"G$7");xe(is,"append");function xy(e,t){for(let r=e.length;r<=t;r++)e[r]=[];return e[t]}v(xy,"xe$1");xe(xy,"getLine");var wy="`line` must be greater than 0 (lines start at line 1)",Ey="`column` must be greater than or equal to 0 (columns start at column 0)",Es=-1,rl=1,Yp=class{static{v(this,"R")}static{xe(this,"TraceMap")}constructor(t,r){const n=typeof t=="string";if(!n&&t._decodedMemo)return t;const i=tl(t),{version:o,file:s,names:a,sourceRoot:l,sources:c,sourcesContent:u}=i;this.version=o,this.file=s,this.names=a||[],this.sourceRoot=l,this.sources=c,this.sourcesContent=u,this.ignoreList=i.ignoreList||i.x_google_ignoreList||void 0;const p=uy(r,l);this.resolvedSources=c.map(p);const{mappings:f}=i;if(typeof f=="string")this._encoded=f,this._decoded=void 0;else if(Array.isArray(f))this._encoded=void 0,this._decoded=my(f,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=Vp(),this._bySources=void 0,this._bySourceMemos=void 0}};function Sy(e){var t,r;return(r=(t=e)._encoded)!=null?r:t._encoded=ty(e._decoded)}v(Sy,"oe$4");xe(Sy,"encodedMappings");function Lr(e){var t;return(t=e)._decoded||(t._decoded=Qb(e._encoded))}v(Lr,"O$7");xe(Lr,"decodedMappings");function eN(e,t,r){const n=Lr(e);if(t>=n.length)return null;const i=n[t],o=Ao(i,e._decodedMemo,t,r,rl);return o===-1?null:i[o]}v(eN,"Oe$2");xe(eN,"traceSegment");function tN(e,t){let{line:r,column:n,bias:i}=t;if(r--,r<0)throw new Error(wy);if(n<0)throw new Error(Ey);const o=Lr(e);if(r>=o.length)return wi(null,null,null,null);const s=o[r],a=Ao(s,e._decodedMemo,r,n,i||rl);if(a===-1)return wi(null,null,null,null);const l=s[a];if(l.length===1)return wi(null,null,null,null);const{names:c,resolvedSources:u}=e;return wi(u[l[qp]],l[zp]+1,l[Gp],l.length===5?c[l[py]]:null)}v(tN,"Le$1");xe(tN,"originalPositionFor");function rN(e,t){const{source:r,line:n,column:i,bias:o}=t;return Zp(e,r,n,i,o||rl,!1)}v(rN,"ye$1");xe(rN,"generatedPositionFor");function nN(e,t){const{source:r,line:n,column:i,bias:o}=t;return Zp(e,r,n,i,o||Es,!0)}v(nN,"Ce$2");xe(nN,"allGeneratedPositionsFor");function iN(e,t){const r=Lr(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,u=l[0];let p=null,f=null,d=null,m=null;l.length!==1&&(p=i[l[1]],f=l[2]+1,d=l[3]),l.length===5&&(m=n[l[4]]),t({generatedLine:c,generatedColumn:u,source:p,originalLine:f,originalColumn:d,name:m})}}}v(iN,"Ie$1");xe(iN,"eachMapping");function Qp(e,t){const{sources:r,resolvedSources:n}=e;let i=r.indexOf(t);return i===-1&&(i=n.indexOf(t)),i}v(Qp,"re$4");xe(Qp,"sourceIndex");function oN(e,t){const{sourcesContent:r}=e;if(r==null)return null;const n=Qp(e,t);return n===-1?null:r[n]}v(oN,"Ne$1");xe(oN,"sourceContentFor");function sN(e,t){const{ignoreList:r}=e;if(r==null)return!1;const n=Qp(e,t);return n===-1?!1:r.includes(n)}v(sN,"be$1");xe(sN,"isIgnored");function ky(e,t){const r=new Yp(nl(e,[]),t);return r._decoded=e.mappings,r}v(ky,"se$4");xe(ky,"presortedDecodedMap");function aN(e){return nl(e,Lr(e))}v(aN,"Re$1");xe(aN,"decodedMap");function lN(e){return nl(e,Sy(e))}v(lN,"we$1");xe(lN,"encodedMap");function nl(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}}v(nl,"B$7");xe(nl,"clone");function wi(e,t,r,n){return{source:e,line:t,column:r,name:n}}v(wi,"b$9");xe(wi,"OMapping");function en(e,t){return{line:e,column:t}}v(en,"y$8");xe(en,"GMapping");function Ao(e,t,r,n,i){let o=yy(e,n,t,r);return Er?o=(i===Es?Kp:Jp)(e,n,o):i===Es&&o++,o===-1||o===e.length?-1:o}v(Ao,"w$6");xe(Ao,"traceSegmentInternal");function jy(e,t,r,n,i){let o=Ao(e,t,r,n,rl);if(!Er&&i===Es&&o++,o===-1||o===e.length)return[];const s=Er?n:e[o][kt];Er||(o=Jp(e,s,o));const a=Kp(e,s,o),l=[];for(;o<=a;o++){const c=e[o];l.push(en(c[fy]+1,c[dy]))}return l}v(jy,"Ue$1");xe(jy,"sliceGeneratedPositions");function Zp(e,t,r,n,i,o){var s,a;if(r--,r<0)throw new Error(wy);if(n<0)throw new Error(Ey);const{sources:l,resolvedSources:c}=e;let u=l.indexOf(t);if(u===-1&&(u=c.indexOf(t)),u===-1)return o?[]:en(null,null);const p=(s=e)._bySourceMemos||(s._bySourceMemos=l.map(Vp)),f=((a=e)._bySources||(a._bySources=vy(Lr(e),p)))[u][r];if(f==null)return o?[]:en(null,null);const d=p[u];if(o)return jy(f,d,r,n,i);const m=Ao(f,d,r,n,i);if(m===-1)return en(null,null);const g=f[m];return en(g[fy]+1,g[dy])}v(Zp,"ie$3");xe(Zp,"generatedPosition");var cN=Object.defineProperty,uN=v((e,t)=>cN(e,"name",{value:t,configurable:!0}),"p$c"),pN=Object.defineProperty,Ay=uN((e,t)=>pN(e,"name",{value:t,configurable:!0}),"c");const fN=De(import.meta.url),fi=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Oy=Ay(e=>{if(typeof fi<"u"&&fi.versions&&fi.versions.node){const[t,r]=fi.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return fi.getBuiltinModule(e)}return fN(e)},"__cjs_getBuiltinModule"),{readFileSync:Tm}=Oy("node:fs"),{resolve:dN,toNamespacedPath:Oc,dirname:mN}=Oy("node:path");var hN=Object.defineProperty,Oo=Ay((e,t)=>hN(e,"name",{value:t,configurable:!0}),"s");const gN=/^data:application\/json[^,]+base64,/,vN=/\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+)[ \t]*$|\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*\*\/[ \t]*$/,bN=/\r?\n/,Ry=Oo(e=>gN.test(e),"isInlineMap"),Rc=Oo((e,t)=>{const r=e instanceof Error?e.message:String(e),n=`${t}:
131
- ${r}`;throw new Error(n)},"enhanceError"),yN=Oo((e,t)=>{const r=e.split(bN);let n;for(let o=r.length-1;o>=0&&!n;o--)n=vN.exec(r[o])??void 0;if(!n)return;const i=n[1]??n[2];if(i)return Ry(i)?i:dN(t,i)},"resolveSourceMapUrl"),$N=Oo(e=>{const t=e.slice(e.indexOf(",")+1);return Buffer.from(t,"base64").toString()},"decodeInlineMap"),xN=Oo(e=>{let t;try{t=Tm(e,{encoding:"utf8"})}catch(i){Rc(i,`Error reading sourcemap for file "${Oc(e)}"`)}const r=yN(t,mN(e));if(!r)return;let n;if(Ry(r))n=$N(r);else try{n=Tm(r,{encoding:"utf8"})}catch(i){Rc(i,`Error reading sourcemap for file "${Oc(e)}"`)}try{return new Z8(n,r)}catch(i){Rc(i,`Error parsing sourcemap for file "${Oc(e)}"`)}},"loadSourceMap");var wN=Object.defineProperty,EN=v((e,t)=>wN(e,"name",{value:t,configurable:!0}),"o$6"),SN=Object.defineProperty,kN=EN((e,t)=>SN(e,"name",{value:t,configurable:!0}),"o"),jN=Object.defineProperty,AN=kN((e,t)=>jN(e,"name",{value:t,configurable:!0}),"o");const ON=/\?[^?]*$/,RN=AN(({exclude:e,include:t}={})=>{const r=Mt(t,e);return{async load(n){if(!r(n))return;let i;try{i=await kr(n,{buffer:!1}),this.addWatchFile(n)}catch{try{const s=n.replace(ON,"");i=await kr(s,{buffer:!1}),this.addWatchFile(s)}catch{this.warn("Failed reading file");return}}let o;try{const s=xN(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 _N=Object.defineProperty,PN=v((e,t)=>_N(e,"name",{value:t,configurable:!0}),"b$8"),CN=Object.defineProperty,TN=PN((e,t)=>CN(e,"name",{value:t,configurable:!0}),"v"),NN=Object.defineProperty,_y=TN((e,t)=>NN(e,"name",{value:t,configurable:!0}),"g");const IN=_y(async(e,t)=>{await new Promise((r,n)=>{const i=Ou(e);i.on("error",n);const o=_x(t);o.on("error",n),o.on("finish",()=>{r(void 0)}),i.pipe(o)})},"copy"),MN=_y(({destDir:e,emitFiles:t,exclude:r,fileName:n,include:i,limit:o,publicPath:s,sourceDir:a})=>{const l=Mt(i,r),c={};return{async generateBundle(u){if(!t)return;const p=e??u.dir??Ce(u.file??"");await Kc(p),await Promise.all(Object.keys(c).map(async f=>{const d=c[f],m=le(p,Ce(d));await Kc(m),await IN(f,le(p,d))}))},async load(u){if(!l(u))return;this.addWatchFile(u);const[p,f]=await Promise.all([Ki(u),us(u)]);let d;if(o&&p.size>o||o===0){const m=Xx.createHash("sha1").update(f).digest("hex").slice(0,16),g=gn(u),y=xt(u,g),x=a?tt(a,Ce(u)):xt(Ce(u)),j=n.replaceAll("[hash]",m).replaceAll("[extname]",g).replaceAll("[dirname]",x===""?"":`${x}/`).replaceAll("[name]",y);d=le(s??"",j),c[u]=j}else{const m=Ob.getType(u);if(m===null)throw new Error(`Could not determine mimetype for ${u}`);d=m==="image/svg+xml"?Ex(f):f.toString("base64"),d=`data:${m};base64,${d}`}return`export default "${d}"`},name:"packem:url"}},"urlPlugin");var DN=Object.defineProperty,Rt=v((e,t)=>DN(e,"name",{value:t,configurable:!0}),"u$c"),BN=Object.defineProperty,nt=Rt((e,t)=>BN(e,"name",{value:t,configurable:!0}),"u"),LN=Object.defineProperty,Bo=nt((e,t)=>LN(e,"name",{value:t,configurable:!0}),"i");let Py=class{static{v(this,"A")}static{Rt(this,"b")}static{nt(this,"WalkerBase")}static{Bo(this,"WalkerBase")}constructor(){this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:Bo(()=>this.should_skip=!0,"skip"),remove:Bo(()=>this.should_remove=!0,"remove"),replace:Bo(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 WN=Object.defineProperty,Ei=nt((e,t)=>WN(e,"name",{value:t,configurable:!0}),"c$1");let FN=class extends Py{static{v(this,"E")}static{Rt(this,"I")}static{nt(this,"SyncWalker")}static{Ei(this,"SyncWalker")}constructor(t,r){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:Ei(()=>this.should_skip=!0,"skip"),remove:Ei(()=>this.should_remove=!0,"remove"),replace:Ei(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,u=this.should_remove;if(this.should_skip=s,this.should_remove=a,this.replacement=l,c)return t;if(u)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];Wi(c)&&(this.visit(c,t,o,l)||l--)}}else Wi(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 Wi(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"}v(Wi,"_$5");Rt(Wi,"k");nt(Wi,"n");Ei(Wi,"isNode");var HN=Object.defineProperty,Si=nt((e,t)=>HN(e,"name",{value:t,configurable:!0}),"c");let qN=class extends Py{static{v(this,"L")}static{Rt(this,"E")}static{nt(this,"AsyncWalker")}static{Si(this,"AsyncWalker")}constructor(t,r){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:Si(()=>this.should_skip=!0,"skip"),remove:Si(()=>this.should_remove=!0,"remove"),replace:Si(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,u=this.should_remove;if(this.should_skip=s,this.should_remove=a,this.replacement=l,c)return t;if(u)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];Fi(c)&&(await this.visit(c,t,o,l)||l--)}}else Fi(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 Fi(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"}v(Fi,"g$3");Rt(Fi,"_");nt(Fi,"a$1");Si(Fi,"isNode");var zN=Object.defineProperty,Cy=nt((e,t)=>zN(e,"name",{value:t,configurable:!0}),"a");function il(e,{enter:t,leave:r}){return new FN(t,r).visit(e,null)}v(il,"b$7");Rt(il,"$");nt(il,"walk");Cy(il,"walk");async function ef(e,{enter:t,leave:r}){return await new qN(t,r).visit(e,null)}v(ef,"T$4");Rt(ef,"M");nt(ef,"asyncWalk");Cy(ef,"asyncWalk");var GN=Object.defineProperty,cr=nt((e,t)=>GN(e,"name",{value:t,configurable:!0}),"l");const UN=/\s/,KN=/\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\//g,JN=/MIT License|MIT license|BSD license/,VN=/\n{2,}/g,XN=/\b(\w+)\$\d+\b/g,YN=/[-/\\^$*+?.()|[\]{}]/g,QN=cr(e=>e.replaceAll(YN,String.raw`\$&`),"escapeRegex"),ZN=cr(e=>[...new Set(e)],"unique"),e7=/\.[^/.]+$/;function ol(e){return JN.test(e)?"":e}v(ol,"w$4");Rt(ol,"x");nt(ol,"k");cr(ol,"stripLicenseComment");const t7=cr(e=>e.replaceAll(KN,ol).replaceAll(VN,`
132
-
133
- `),"cleanUnnecessaryComments"),Nm=new Map;function sl(e,t,{identifierReplacements:r},n){const i=Cs(e);let o=e;for(const a of Object.keys(r??{})){const l=i.find(u=>u.specifier===a&&u.imports.includes("{"));if(!l){this.warn(`${t.fileName} does not import "${a}" for replacement`),process.exitCode=1;continue}const c=r?.[a]??{};for(const u of Object.keys(c)){if(!l.imports.includes(u))throw new Error(`${t.fileName} does not import "${u}" from "${a}" for replacement`);const p=c[u],f=QN(u);p.includes(".")&&(o=o.replace(new RegExp(String.raw`\b\w+\b as ${f},?\s?`),"")),o=o.replaceAll(new RegExp(String.raw`\b${f}\b`,"g"),p)}}const s=ZN(Array.from(o.matchAll(XN),a=>a[0]));if(s.length>0){const a=s.map(c=>`
134
- - ${c}`).join(""),l=t.fileName.replace(e7,"");Nm.has(l)||n.warn({message:`${t.fileName} contains confusing identifier names${a}
135
-
136
- To replace these, add them to the "rollup -> patchTypes -> identifierReplacements" option in your packem config.`,prefix:"plugin:patch-types"}),Nm.set(l,!0)}return o}v(sl,"x$3");Rt(sl,"S");nt(sl,"O");cr(sl,"replaceConfusingTypeNames");function al(e,t){if(!e.includes("@internal"))return e;const r=new Ke(e),n=Ts(t.fileName,e,{lang:"dts",sourceType:"module"}),i=cr(a=>{let l=a,c=!0;for(;c;){for(c=!1;l<e.length&&UN.test(e[l]);)l+=1;for(const u of n.comments)if(u.start===l){l=u.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&&il(n.program,{enter(a){if(a.type==="Program")return;const{end:l,start:c}=a;if(typeof c!="number"||typeof l!="number")return;const u=o.findIndex(d=>d.nextStart===c);if(u===-1)return;const[{commentStart:p}]=o.splice(u,1),f=e[l]===","?l+1:l;r.remove(p,f),this.skip()}});const s=r.toString();if(s.includes("@internal"))throw new Error(`${t.fileName} has unhandled @internal declarations`);return s}v(al,"$$6");Rt(al,"A");nt(al,"v");cr(al,"stripInternalTypes");const r7=cr((e,t)=>({name:"packem:patch-types",renderChunk(r,n){return r=sl.call(this,r,n,e,t),r=al.call(this,r,n),r=t7(r),r}}),"patchTypescriptTypes");var n7=Object.defineProperty,i7=v((e,t)=>n7(e,"name",{value:t,configurable:!0}),"d$b"),o7=Object.defineProperty,s7=i7((e,t)=>o7(e,"name",{value:t,configurable:!0}),"d"),a7=Object.defineProperty,zt=s7((e,t)=>a7(e,"name",{value:t,configurable:!0}),"o");const l7=/^\./,c7=/\0/,u7=42,p7=zt(e=>{let t=!1;for(let r=0;r<e.length;r++)if(e.codePointAt(r)===u7){if(t)return!1;t=!0}return!0},"hasZeroOrOneAsteriskCharacter"),f7=zt(e=>{const t=e.indexOf("*");return t===-1?void 0:{prefix:e.slice(0,t),suffix:e.slice(t+1)}},"tryParsePattern"),d7=zt(({prefix:e,suffix:t},r)=>r.length>=e.length+t.length&&r.startsWith(e)&&r.endsWith(t),"isPatternMatch"),m7=zt((e,t,r)=>{let n,i=-1;for(const o of e){const s=t(o);d7(s,r)&&s.prefix.length>i&&(i=s.prefix.length,n=o)}return n},"findBestPatternMatch"),h7=zt((e,t)=>{const r=[];for(const n of e){if(!p7(n))continue;const i=f7(n);if(i)r.push(i);else if(n===t)return n}return m7(r,n=>n,t)},"matchPatternOrExact"),g7=zt((e,t)=>t.substring(e.prefix.length,t.length-e.suffix.length),"matchedText"),v7=zt(({prefix:e,suffix:t})=>`${e}*${t}`,"patternText"),b7=zt((e,t,r)=>{let n=Ce(t.path);t.config.compilerOptions?.baseUrl&&(n=ve(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"),Ty=zt((e,t,r,n)=>{const{paths:i,resolvedBaseUrl:o}=b7(e,t,r),s=Object.keys(i);return{name:"plugin:resolve-tsconfig-paths",resolveId:{filter:{id:{exclude:[l7,c7]}},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&&Gi(a)){r.debug({message:`Skipping request as it is an absolute path ${a}`,prefix:"plugin:resolve-tsconfig-paths"});return}if(Ih(a)){r.debug({message:`Skipping request as it is a relative path ${a}`,prefix:"plugin:resolve-tsconfig-paths"});return}const u=h7(s,a);if(!u){r.debug({message:`moduleName did not match any paths pattern ${a}`,prefix:"plugin:resolve-tsconfig-paths"});return}const p=typeof u=="string"?void 0:g7(u,a),f=typeof u=="string"?u:v7(u);for(const d of i[f]){const m=p?d.replace("*",p):d;if(m.endsWith(".d.ts")||m.endsWith(".d.cts")||m.endsWith(".d.mts"))continue;const g=le(o,m);try{const y=await this.resolve(g,l,{skipSelf:!0,...c});if(y)return y}catch(y){r.debug({context:[y],message:`Failed to resolve ${g} from ${a}`,prefix:"plugin:resolve-tsconfig-paths"})}}}}}},"resolveTsconfigPathsPlugin");var y7=Object.defineProperty,$7=v((e,t)=>y7(e,"name",{value:t,configurable:!0}),"f$a"),x7=Object.defineProperty,w7=$7((e,t)=>x7(e,"name",{value:t,configurable:!0}),"a"),E7=Object.defineProperty,Ny=w7((e,t)=>E7(e,"name",{value:t,configurable:!0}),"u");const S7=/^\./,k7=Ny((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(ve(e,s))}return o},"getRootDirectories"),Iy=Ny((e,t,r)=>{const n=k7(e,r);return{name:"packem:resolve-tsconfig-root-dirs",resolveId:{filter:{id:S7},async handler(i,o,s){if(!(n===void 0||n.length===0)&&i.startsWith("."))for(const a of n){const l=le(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 j7=Object.defineProperty,A7=v((e,t)=>j7(e,"name",{value:t,configurable:!0}),"l$c"),O7=Object.defineProperty,R7=A7((e,t)=>O7(e,"name",{value:t,configurable:!0}),"l"),_7=Object.defineProperty,tf=R7((e,t)=>_7(e,"name",{value:t,configurable:!0}),"l");const P7={".cjs":[".cts"],".js":[".ts",".tsx"],".jsx":[".tsx",".ts"],".mjs":[".mts"]},Im=/\.(?:[mc]?js|jsx)$/,C7=tf(e=>{const t=e[0];return!(t==="."||t==="/"||t==="#"||Nx(e))},"isBareSpecifier"),Mm=tf(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"),My=tf(()=>({name:"packem:resolve-typescript-mjs-cjs",resolveId:{filter:{id:Im},async handler(e,t,r){if(!t)return;const n=Im.exec(e);if(!n)return;const i=n[0],o=P7[i];if(!o)return;const s=e.slice(0,-i.length),a={...r,skipSelf:!0};return!C7(e)&&!t.includes("/node_modules/")?Mm(this,o,s,t,a,!1):await this.resolve(e,t,a)||Mm(this,o,s,t,a,!0)}}}),"resolveTypescriptMjsCts");var T7=Object.defineProperty,N7=v((e,t)=>T7(e,"name",{value:t,configurable:!0}),"b$4"),I7=Object.defineProperty,Dy=N7((e,t)=>I7(e,"name",{value:t,configurable:!0}),"S"),M7=Object.defineProperty,ir=Dy((e,t)=>M7(e,"name",{value:t,configurable:!0}),"h");const D7=/^export\s+default\s+(\w+);/m,B7=/export\s*\{([^}]*)\}/,L7=/\s*as\s+default\s*/,W7=/\s+\}$/,Lo=/;$/,F7=/(?:\r?\n\s*){2,}/g,_c=/^type\s+/,Dm=/\bas\s+default\b/,H7=ir((e,t,r)=>{const n=Hx(e).find(l=>l.names.includes("default")),i=D7.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=B7.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=L7.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"),q7=ir((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"),Hi=ir((e,t,r,n)=>{const i=Ts(r.fileName,e,{astType:"ts",lang:"ts",sourceType:"module"});let o,s=0;const a=ir(()=>(s+=1,`__unnamed_${String(s)}$$`),"generateUnnamed"),l=new Map,c=new Map,{program:u}=i;for(const m of u.body)if(m.type==="ExportNamedDeclaration")for(const g of m.specifiers)g.exported.type==="Identifier"&&(g.exported.name==="default"?g.local.type==="Identifier"&&(o={end:g.end,local:g.local.name,start:g.start}):c.set(g.exported.name,{type:g.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":{q7(l,m,a);break}case"TSImportEqualsDeclaration":case"TSModuleDeclaration":{l.set(a(),{declare:!1,end:m.end,start:m.start});break}}}const p=[];if(o)for(const[m,g]of c.entries())m!==o.local&&g.type&&p.push(m);if(!o){const m=[...c.values()].every(g=>g.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 f=t,d=new Ke(`${f}
137
- declare namespace ${o.local} {
138
- `);for(const[m,g]of l.entries()){if(p.includes(m)&&m!==o.local)continue;const y=e.slice(g.start,g.end).replace(W7," }");d.append(" "),g.declare?d.append(y.replace("declare","export").replaceAll(" "," ")):d.append(`export ${y}`.replaceAll(" "," ")),d.append(`
139
- `)}return d.append(` import _default = ${o.local};
140
- export { _default as default };
141
- `),d.append(`}
142
- export = ${o.local};
143
- `),d.toString()},"createCjsNamespace"),Pc=ir((e,t,r)=>{const{defaultExport:n,exports:i}=t;if(r){const p=i.length===0?`export = ${r.defaultImport??""};`:`// @ts-ignore
144
- export = ${r.defaultImport??""};
145
- export { ${i.join(", ")} } from '${n.specifier??""}'`,f=e.replace(n.code.replace(Lo,""),p.replace(Lo,""));return f.endsWith(";")?f:`${f};`}const o=`import _default from '${n.specifier??""}';`,s=new Ke(e),a=Cs(e),l=a.length>0?a.at(-1):void 0;l?.end!==void 0&&l.end>0?s.appendRight(l.end,`
146
- ${o}
147
- `):s.prepend(`${o}
148
- `);let c=s.toString();c=c.replaceAll(F7,`
149
- `);let u;if(i.length===0)u=c.replace(n.code.replace(Lo,""),"export = _default");else{const p=`// @ts-ignore
150
- export = _default;
151
- export { ${i.join(", ")} } from '${n.specifier??""}';`;u=c.replace(n.code.replace(Lo,""),p)}return u.replaceAll(";;",";")},"handleDefaultCJSExportAsDefault"),z7=ir((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 d=`export { ${l.join(", ")} } from '${a.specifier??""}'`,m=new Ke(e).replace(a.code,d).toString();return Hi(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??""}';
152
- `;let u=e;const p=n.length>0?n.at(-1)?.end??0:0,f=new Ke(u);if(p>0?f.appendRight(p,`
153
- ${c}`):f.prepend(c),u=f.toString(),l.length>0){const d=`export { ${l.join(", ")} } from '${a.specifier??""}'`,m=new Ke(u).replace(a.code,d).toString();return Hi(e,m,t,i)}return new Ke(u).replace(a.code,`export = ${s}`).toString()},"handleDefaultNamedCJSExport"),Bm=ir((e,t,{defaultAlias:r,defaultExport:n,exports:i},o)=>{const s=i.filter(l=>_c.test(l)),a=i.filter(l=>!_c.test(l));if(s.length>0){let l="";return r&&(l+=`// @ts-ignore
154
- ${r};
155
- `),l+=`export type { ${s.map(c=>c.replace(_c,"").trim()).join(", ")} };
156
- `,a.length>0&&(l+=`export { ${a.join(", ")} };
157
- `),Hi(e,l.trim(),t,o)}if(r&&a.length>0&&s.length===0){let l=`// @ts-ignore
158
- ${r};
159
- `;return l+=`export { ${a.join(", ")} };
160
- `,Hi(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"),G7=/^export\s+default\s+from\s+['"]([^'"]+)['"];?$/m,U7=ir((e,t,r)=>{const n=G7.exec(e);if(n)return{code:`import _default from '${n[1]??""}';
161
- export = _default;`,map:void 0};const i=H7(e,t,r);if(i){let l;if(i.defaultExport.specifier){const{specifier:c}=i.defaultExport,u=Cs(e),p=u.filter(x=>x.imports).map(x=>Fx(x)),f=p.find(x=>x.specifier===c),{defaultAlias:d,defaultExport:m,exports:g}=i,y=m.exports;if(d==="default"&&m.specifier&&g.length>0)l=Pc(e,i,f);else if(d==="default"&&m.specifier&&g.length===0&&y&&Dm.test(y))p.find(x=>x.specifier===m.specifier)?.defaultImport?l=Pc(e,i,f):(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(d==="default"&&m.specifier&&g.length===0)l=Pc(e,i,f);else if(m.specifier&&d!=="default"){l=z7(e,t,i,u,r,f);const x=f&&i.defaultExport.specifier&&d!=="default"&&f.namedImports?.[d]!==d;if(!(l===void 0&&x)&&l===void 0&&!(d==="default"&&g.length===0&&y&&Dm.test(y))){const j=Bm(e,t,i,r);j&&(l=j)}}}else l=Bm(e,t,i,r);return l?{code:l,map:void 0}:void 0}const o=Ts(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=Hi(e,l,t,r);return c?{code:c,map:void 0}:void 0}},"fixDtsDefaultCJSExports");var K7=Object.defineProperty,Lm=Dy((e,t)=>K7(e,"name",{value:t,configurable:!0}),"s");const J7=/\.d\.c?ts$/,V7=Lm((e={})=>{const{matcher:t=Lm(r=>r.exports.length>0&&J7.test(r.fileName)&&r.isEntry,"matcher")}=e;return{name:"packem:fix-dts-default-cjs-exports-plugin",renderChunk(r,n){return t(n)?U7(r,{fileName:n.fileName,imports:n.imports},{warn:this.warn}):void 0}}},"fixDtsDefaultCjsExportsPlugin");var X7=Object.defineProperty,Y7=v((e,t)=>X7(e,"name",{value:t,configurable:!0}),"r$4");const ll=Y7((e,t={},r={})=>({...t,...e,values:e.values?{...e.values}:{...r}}),"cloneReplaceOptions");var Q7=Object.defineProperty,Z7=v((e,t)=>Q7(e,"name",{value:t,configurable:!0}),"n$8");const qi=Z7(e=>!!e?.endsWith(".d"),"isDeclarationOnlyName");var eI=Object.defineProperty,je=v((e,t)=>eI(e,"name",{value:t,configurable:!0}),"i$6");const Me=je(e=>e.logger,"getLogger"),tI=/Circular dependency:[\s\S]*node_modules/,rI=/\.mts$/,nI=/\.(?:m|c)?(?:j|t)sx?$/,iI=/^['|"](use (\w+))['|"]$/,oI=/\.(?:[cm]?jsx?|[cm]?tsx?|json)$/,sI=je(e=>e instanceof RegExp?e.source:e,"regExpOrStringToString"),aI=je(e=>{if(typeof e=="boolean")return String(e);const t=[];for(const r of e)t.push(sI(r));return t.toSorted((r,n)=>r.localeCompare(n)).join(",")},"computeDtsResolveKey"),Wm=je((e,t)=>t?r=>{if(!qi(r.name))return`${r.name}.${e()}`}:r=>{if(!qi(r.name))return Ai(r,e())},"createChunkFileNames"),Fm=je((e,t)=>t?r=>{const{name:n}=r;if(!qi(n))return`${n??"[name]"}.${e(r)}`}:r=>{const{name:n}=r;if(!qi(n))return Sx(r,e(r))},"createEntryFileNames"),By=je(e=>{const t=`node${as.node.split(".")[0]}`;if(!e.pkg.engines?.node)return t;const r=$t.minVersion(e.pkg.engines.node);return r?`node${String(r.major)}`:t},"resolveNodeTarget"),Ly=je((e,t,r)=>{if(t){const n=gx(t);return e.options.runtime==="node"?[...new Set([r,...n])]:e.options.runtime==="browser"?[...new Set([...hf(e.options.browserTargets??[]),...n])]:n}return e.options.runtime==="node"?[r]:hf(e.options.browserTargets??[])},"resolveTransformerTarget"),lI=je((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"&&(Me(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=Ly(e,e.options.rollup.esbuild.target,t),e.options.minify||(e.options.rollup.esbuild.keepNames=!1,Me(e).debug("Disabling keepNames because minify is disabled")),e.tsconfig?.config.compilerOptions?.target==="es5"&&(e.options.rollup.esbuild.keepNames=!1,Me(e).debug("Disabling keepNames because target is set to es5")),{logger:Me(e),minify:e.options.minify,minifyWhitespace:e.options.minify,sourceMap:e.options.sourcemap,...e.options.rollup.esbuild}},"getEsbuildTransformerConfig"),cI=je(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"),Wy=je((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=Ly(e,e.options.rollup.oxc.target,t),e.options.rollup.oxc},"getOxcTransformerConfig"),uI=je((e,t,r)=>{if(r)return"js";if(t.facadeModuleId?.endsWith(".mts")){const n=t.facadeModuleId.replace(rI,".cts");if(Au(n))return"mjs"}return!e.options.emitCJS&&e.options.emitESM&&e.pkg.main?.endsWith(".cjs")?"mjs":gt(e,"esm")},"resolveEsmEntryExtension"),pI=je((e,t)=>{const r=By(t);if(e==="esbuild")return lI(t,r);if(e==="swc")return cI(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 Wy(t,r);throw new Error("A Unknown transformer was provided")},"getTransformerConfig"),Fy=je(e=>{if(e.options.rollup.resolve&&!e.options.experimental?.oxcResolve)return tx({...e.options.rollup.resolve});if(e.options.experimental?.oxcResolve&&e.options.rollup.experimental?.resolve)return ex(e.options.rollup.experimental.resolve,e.options.rootDir,Me(e),e.tsconfig?.path)},"createNodeResolver"),Hy=je((e,t)=>{if(e.code==="CIRCULAR_DEPENDENCY"&&tI.test(e.message))return!0;if(e.code==="UNRESOLVED_IMPORT"){const r=new Error(`Failed to resolve the module "${e.exporter??""}" imported by "${Pe(tt(ve(),e.id??""))}"
162
- Is the module installed? Note:
163
- ↳ to inline a module into your bundle, install it to "devDependencies".
164
- ↳ to depend on a module via import/require, install it to "dependencies".`);throw r.id=e.id,r}return e.code==="MODULE_LEVEL_DIRECTIVE"?!0:e.code==="MIXED_EXPORTS"&&(t.options.cjsInterop??!1)},"sharedOnWarn"),fI=je(e=>{const t={};for(const r of e.options.entries){if(r.name===void 0)continue;const{name:n}=r,i=ve(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"),dI=je(e=>e.stack?`${e.message}
165
- ${e.stack}`:e.message,"formatRollupLog"),mI=je((e,t,r,n)=>{if(t==="warn"&&r.plugin==="node-resolve"&&n.includes("Could not resolve import")&&(e.options.rollup.resolve&&typeof e.options.rollup.resolve=="object"?e.options.rollup.resolve.unresolvedImportBehavior??"error":"error")==="error"){const i=new Error(n);throw r.id&&(i.id=r.id),i}},"throwIfUnresolvedImportIsError"),hI=je((e,t,r,n)=>{if(t==="dts"&&n.code==="EMPTY_BUNDLE")return;const i=dI(n);mI(e,r,n,i);const o=t+(n.plugin?`:plugin:${n.plugin}`:"");switch(r){case"info":{Me(e).info({message:i,prefix:o});return}case"warn":{Me(e).warn({message:i,prefix:o});return}case"debug":Me(e).debug({message:i,prefix:o})}},"handleRollupLog"),qy=je((e,t)=>({input:fI(e),logLevel:e.options.debug?"debug":"info",onLog:je((r,n)=>{hI(e,t,r,n)},"onLog"),onwarn(r,n){Hy(r,e)||r.code||n(r)},preserveEntrySignatures:"strict",treeshake:{moduleSideEffects:!0,preset:"smallest"},watch:e.mode==="watch"?e.options.rollup.watch:!1}),"baseRollupOptions"),gI=je((e,t,r,n)=>{const i={...e.options.rollup.alias,entries:t};return!r&&n&&(i.customResolver=n),Fh(i)},"buildAliasPlugin"),vI=je(e=>{if(!e.options.rollup.pure)return{pureNewExpressionPluginInstance:void 0,purePluginInstance:void 0};const t=rx({...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:nx({constructors:["Proxy","WeakMap","WeakSet","WeakRef",...e.options.rollup.pure.functions?.filter(r=>typeof r=="string"&&!r.includes("."))??[]],sourcemap:e.options.sourcemap}),purePluginInstance:t}},"buildPurePlugins"),bI=je((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"),yI=je((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"),$I=je(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"),xI=je(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 bI(e,n,r),yI(e,n,r),r.length===0&&!t?!1:$I([...r,...t??[]])},"computeDtsResolve"),wI=je(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"),EI=ku(wI),zy=je(async(e,t)=>{const r=Ka(e.pkg,e.options),n=xI(e),i=Fy(e),o=aI(n),s=`dts-plugin:${String(process.pid)}${e.tsconfig?.path??""}:${o}`,[a,l,c]=Kh(e.options.rollup.plugins,"dts");return{...qy(e,"dts"),onwarn(u,p){Hy(u,e)||u.code!=="EMPTY_BUNDLE"&&u.code!=="CIRCULAR_DEPENDENCY"&&p(u)},output:[e.options.emitCJS&&{chunkFileNames:je(u=>Ai(u,Tt(e,"cjs")),"chunkFileNames"),compact:e.options.minify,dir:ve(e.options.rootDir,e.options.outDir),entryFileNames:`[name].${Tt(e,"cjs")}`,format:"cjs",sourcemap:e.options.sourcemap,...e.options.rollup.output},e.options.emitESM&&{chunkFileNames:je(u=>Ai(u,Tt(e,"esm")),"chunkFileNames"),compact:e.options.minify,dir:ve(e.options.rootDir,e.options.outDir),entryFileNames:`[name].${Tt(e,"esm")}`,format:"esm",sourcemap:e.options.sourcemap,...e.options.rollup.output},e.options.declaration==="compatible"&&{chunkFileNames:je(u=>Ai(u,"d.mjs"),"chunkFileNames"),compact:e.options.minify,dir:ve(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.ts",format:"cjs",sourcemap:e.options.sourcemap,...e.options.rollup.output}].filter(Boolean),plugins:[Hh(),Ye(Eb(),t),Ye(My(),t),Fb(e,{dtsResolve:n,forTypes:!0,skipUnlistedWarnings:!0}),{load(u){if(!oI.test(u))return""},name:"packem:ignore-files"},e.tsconfig&&Ye(Iy(e.options.rootDir,Me(e),e.tsconfig),t),e.tsconfig&&e.options.rollup.tsconfigPaths&&Ye(Ty(e.options.rootDir,e.tsconfig,Me(e),e.options.rollup.tsconfigPaths),t),Kb(e),e.options.rollup.replace&&qh(ll(e.options.rollup.replace,{sourcemap:e.options.sourcemap})),e.options.rollup.alias&&Fh({customResolver:i,...e.options.rollup.alias,entries:r}),...a,i,...l,...await EI(s)(e,n),e.options.emitCJS&&V7(),e.options.cjsInterop&&e.options.emitCJS&&ig({...e.options.rollup.cjsInterop,logger:Me(e)}),e.options.rollup.patchTypes&&Ye(r7(e.options.rollup.patchTypes,Me(e)),t),F8(),...c,e.options.rollup.license!==!1&&e.options.rollup.license?.path&&typeof e.options.rollup.license.dtsTemplate=="function"&&zb({licenseFilePath:e.options.rollup.license.path,licenseTemplate:e.options.rollup.license.dtsTemplate,logger:Me(e),marker:e.options.rollup.license.dtsMarker??"TYPE_DEPENDENCIES",mode:"types",packageName:e.pkg.name})].filter(Boolean)}},"getRollupDtsOptions");var SI=Object.defineProperty,Gy=v((e,t)=>SI(e,"name",{value:t,configurable:!0}),"n$7");const Uy=Gy(async(e,t,r)=>{const n=Ka(e.pkg,e.options),i=r==="rolldown",o=i?void 0:Fy(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:WC(e.dependencyGraphMap,e.buildEntries,!i&&!!e.options.rollup.preserveDirectives),preserveModules:!1},[c,u,p]=Kh(e.options.rollup.plugins,"build"),f=e.tsconfig?.config.compilerOptions?.esModuleInterop,{pureNewExpressionPluginInstance:d,purePluginInstance:m}=vI(e);return{...qy(e,"build"),output:[e.options.emitCJS&&{assetFileNames:"[name]-[hash][extname]",chunkFileNames:Wm(()=>gt(e,"cjs"),a),compact:e.options.minify,dir:ve(e.options.rootDir,e.options.outDir),entryFileNames:Fm(g=>gt(e,"cjs"),a),esModule:f??"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:Wm(()=>gt(e,"esm"),a),compact:e.options.minify,dir:ve(e.options.rootDir,e.options.outDir),entryFileNames:Fm(g=>uI(e,g,a),a),esModule:f??"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&&Hh(),x9(),Ye(Eb(),t),Fb(e),My(),e.tsconfig&&Ye(Iy(e.options.rootDir,Me(e),e.tsconfig),t),e.tsconfig&&e.options.rollup.tsconfigPaths&&Ye(Ty(e.options.rootDir,e.tsconfig,Me(e),e.options.rollup.tsconfigPaths),t),Kb(e),e.options.rollup.replace&&qh(ll(e.options.rollup.replace,{sourcemap:e.options.sourcemap})),e.options.rollup.alias&&gI(e,n,i,o),...c,o,e.options.rollup.nativeModules&&t8(e.options.rollup.nativeModules),e.options.rollup.dataUri&&TT({...e.options.rollup.dataUri}),e.options.rollup.polyfillNode&&ix({sourceMap:e.options.sourcemap,...e.options.rollup.polyfillNode}),!i&&e.options.rollup.json&&Yx({...e.options.rollup.json}),e.options.rollup.debarrel&&o3(e.options.rollup.debarrel,Me(e)),!i&&ox(),e.options.rollup.wasm&&sx(e.options.rollup.wasm),e.options.rollup.url&&MN(e.options.rollup.url),s&&Ye(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&&Ye(l8(e.options.rollup.raw),t),e.options.sourcemap&&RN(e.options.rollup.sourcemap),...u,e.options.rollup.minifyHTMLLiterals&&e.options.minify&&J9({...e.options.rollup.minifyHTMLLiterals,logger:Me(e)}),e.options.rollup.requireCJS&&e.options.emitESM&&Ye(A8({...e.options.rollup.requireCJS,cwd:e.options.rootDir},Me(e)),t),e.options.rollup.babel&&Ye(dT({include:e.options.rollup.babel.include??nI,...e.options.rollup.babel,root:e.options.rootDir,sourceMaps:e.options.rollup.babel.sourceMaps??e.options.sourcemap}),t),!i&&d,!i&&m,e.options.rollup.detectDuplicated!==!1&&H3(Me(e),e.options.rootDir,e.options.rollup.detectDuplicated),!i&&e.options.transformer&&Ye(e.options.transformer(pI(e.options.transformerName,e)),t),!i&&e.options.rollup.preserveDirectives&&ax({directiveRegex:iI,...e.options.rollup.preserveDirectives,logger:Me(e)}),e.options.rollup.shebang&&W8(e.options.entries.filter(g=>g.executable).map(g=>g.name).filter(Boolean),e.options.rollup.shebang),!i&&e.options.cjsInterop&&e.options.emitCJS&&ig({...e.options.rollup.cjsInterop,logger:Me(e)}),e.options.rollup.dynamicVars&&nC(),!i&&e.options.rollup.dynamicVars&&lx(e.options.rollup.dynamicVars),!i&&e.options.rollup.commonjs&&Ye(cx({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&&Q3(e.pkg,e.options.rollup.shim),!i&&e.options.rollup.jsxRemoveAttributes&&Ye(ux({attributes:e.options.rollup.jsxRemoveAttributes.attributes,logger:Me(e)}),t),...p,e.options.rollup.metafile&&uC(),e.options.rollup.copy&&$T(e.options.rollup.copy,Me(e)),e.options.rollup.license!==!1&&e.options.rollup.license?.path&&typeof e.options.rollup.license.dependenciesTemplate=="function"&&zb({dtsMarker:e.options.rollup.license.dtsMarker??"TYPE_DEPENDENCIES",licenseFilePath:e.options.rollup.license.path,licenseTemplate:e.options.rollup.license.dependenciesTemplate,logger:Me(e),marker:e.options.rollup.license.dependenciesMarker??"DEPENDENCIES",mode:"dependencies",packageName:e.pkg.name}),e.options.analyze&&e.options.rollup.visualizer!==!1&&px({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"),Ky=Gy((e,t)=>Uy(e,t,"rollup"),"getRollupOptions");var kI=Object.defineProperty,Jy=v((e,t)=>kI(e,"name",{value:t,configurable:!0}),"i$5");const jI=Jy(e=>{if(!e.options.rollup.oxc)return{};const t=Wy(e,By(e));return{jsx:t.jsx,target:t.target,typescript:t.typescript}},"getRolldownTransformOptions"),AI=Jy(async(e,t)=>{const r=await Uy(e,t,"rolldown");return r.transform=jI(e),e.options.minify&&Array.isArray(r.output)&&(r.output=r.output.map(n=>({...n,minify:!0}))),r},"getRolldownOptions");var OI=Object.defineProperty,RI=v((e,t)=>OI(e,"name",{value:t,configurable:!0}),"u$9");const Vy=RI((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 _I=Object.defineProperty,cl=v((e,t)=>_I(e,"name",{value:t,configurable:!0}),"l$9");const rf=cl(async(e,t)=>{try{return t(await e())}catch{return}},"tryImport"),Xy="Rollup is not installed. Please install 'rollup' to use bundler: 'rollup' or DTS generation with the rollup driver.",nf=cl(async()=>{const e=await rf(()=>import("rollup"),t=>t.rollup);if(!e)throw new Error(Xy);return e},"getRollupBuild"),PI=cl(async()=>{const e=await rf(()=>import("rollup"),t=>t.watch);if(!e)throw new Error(Xy);return e},"getRollupWatch");cl(async()=>rf(()=>import("rollup"),e=>e.VERSION),"getRollupVersion");var CI=Object.defineProperty,ul=v((e,t)=>CI(e,"name",{value:t,configurable:!0}),"p$6");const Hm="rollup-build.json",dn="dependencies-cache.json",Yy=ul(e=>e??"rollup","resolveBundlerName"),TI={".css":"js",".less":"js",".pcss":"js",".sass":"js",".scss":"js",".styl":"js",".stylus":"js"},NI=ul(async(e,t,r,n)=>{const i=e.options.validation&&e.options.validation.dependencies!==!1&&!!t.get(dn,r),o=!e.options.validation||e.options.validation.dependencies===!1||i;let s=n;if(o&&(s={...n,cache:t.get(Hm,r)},i)){const l=t.get(dn,r);l&&(l.used?.forEach(c=>e.usedDependencies.add(c)),l.hoisted?.forEach(c=>e.hoistedDependencies.add(c)))}const a=await(await nf())(s);try{o&&t.set(Hm,a.cache,r),e.options.validation&&e.options.validation.dependencies!==!1&&t.set(dn,{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:u}=await a.write(c);Vy(u,e,l)}e.buildEntries.push(...l.values())}finally{await a.close()}},"buildWithRollup"),II=ul(async(e,t,r,n)=>{if(e.options.validation&&e.options.validation.dependencies!==!1&&t.get(dn,r)){const a=t.get(dn,r);a&&(a.used?.forEach(l=>e.usedDependencies.add(l)),a.hoisted?.forEach(l=>e.hoistedDependencies.add(l)))}const i=await xb(),o={...n,moduleTypes:{...TI,...n.moduleTypes}},s=await i(o);try{e.options.validation&&e.options.validation.dependencies!==!1&&t.set(dn,{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);Vy(c,e,a)}e.buildEntries.push(...a.values())}finally{await s.close?.()}},"buildWithRolldown"),MI=ul(async(e,t,r,n)=>{const i=n==="rolldown",o=i?await AI(e,t):await Ky(e,t);await e.hooks.callHook("rollup:options",e,o),Object.keys(o.input??{}).length!==0&&(await(i?II(e,t,r,o):NI(e,t,r,o)),await t.flush())},"build");var DI=Object.defineProperty,Ro=v((e,t)=>DI(e,"name",{value:t,configurable:!0}),"i$4");const qm=Ro(async e=>{try{return await(e==="rolldown"?xb():nf()),!0}catch{return!1}},"isBundlerAvailable"),zm=Ro((e,t)=>{const r=[le(t,"noop.js"),import.meta.url];for(const n of r)try{return De(n).resolve(e),!0}catch{}return!1},"isModuleAvailable"),Qy=Ro(async(e,t,r,n,i)=>{if(!(process.stdout.isTTY&&!process.env.CI)){const a=await yd(e,r);throw new Error(`${e} is required but is not installed. Run: ${a}`)}const o=await Qx({initialValue:!0,message:t});if(Zx(o)||!o){const a=await yd(e,r);throw new Error(`Cannot continue without ${e}. Run: ${a}`)}const s=e0();s.start(`Installing ${e}`);try{await Th([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"),Gm=Ro(async(e,t,r)=>{await qm(e)||await Qy(e,`${e} is required as the bundler but is not installed. Install it now?`,t,r,()=>qm(e))},"ensureBundlerInstalled"),BI=Ro(async(e,t,r)=>{const n=i_[e];zm(n,t)||await Qy(n,`${n} is required for transformer: "${e}" but is not installed. Install it now?`,t,r,()=>Promise.resolve(zm(n,t)))},"ensureTransformerInstalled");var LI=Object.defineProperty,WI=v((e,t)=>LI(e,"name",{value:t,configurable:!0}),"e$2");const pl=WI(e=>{const t=le(e,"package.json");if(!Ft(t))throw new Error(`package.json not found at ${t}`);const r=QR(t,{resolveCatalogs:!0});return r.publishConfig&&Object.assign(r,r.publishConfig),{packageJson:r,packageJsonPath:t}},"loadPackageJson");var FI=Object.defineProperty,HI=v((e,t)=>FI(e,"name",{value:t,configurable:!0}),"f$7");const qI=HI(async(e,t,r,n)=>{let i;if(n){const o=le(e,n);if(!await et(o))throw new Error(`tsconfig.json not found at ${o}`);i={config:t0(o),path:o},r.info("Using tsconfig settings at",o)}else if(Zv(t,["typescript"]))try{i=await r0(e),r.debug("Using tsconfig settings found at",i.path)}catch{r.info("No tsconfig.json or jsconfig.json found.")}return i},"loadTsconfig");var zI=Object.defineProperty,_t=v((e,t)=>zI(e,"name",{value:t,configurable:!0}),"s$9");const GI=/^\.\.?\//,UI=_t((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"),Um=_t((e,t)=>{if(typeof e.name!="string"){let r=Gi(e.input)?tt(t.options.rootDir,e.input):hn(e.input);r.startsWith("./")&&(r=r.slice(2)),e.name=r.replace(new RegExp(`^${t.options.sourceDir}/`),"").replace(ju,"")}if(!e.input)throw new Error(`Missing entry input: ${JSON.stringify(e)}`);Ih(e.input)&&(e.input=ve(t.options.rootDir,e.input)),t.options.declaration&&e.declaration===void 0&&(e.declaration=t.options.declaration),UI(e,t),e.outDir=ve(t.options.rootDir,e.outDir??t.options.outDir)},"extendEntry"),KI=_t(e=>{e.options.entries=e.options.entries.map(t=>typeof t=="string"?{input:t,isGlob:Xc(t)}:{...t,exportKey:t.exportKey??new Set,isGlob:Xc(t.input)})},"normalizeEntries"),JI=_t(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"),VI=_t(e=>{for(const t of e.options.entries.filter(r=>r.isGlob)){const r={...t};delete r.isGlob;const n=Dg([r.input],{cwd:e.options.rootDir,dot:!1,ignore:JI(e),onlyFiles:!0});if(n.length===0)throw new gp(`No files found in the glob pattern: ${Pe(le(e.options.rootDir,r.input))}`);for(const i of n)e.options.entries.push({...r,input:ve(e.options.rootDir,i)});e.options.entries.splice(e.options.entries.indexOf(t),1)}},"expandGlobEntries"),XI=_t(e=>{for(const t of e)if(t==="node"||t==="workerd"||t.includes("node")||t.includes("workerd"))return!0;return!1},"hasNodeLikeExportKey"),YI=_t(e=>e.includes(".server")||e.includes(".node")||e.includes(".workerd"),"fileAliasIndicatesNode"),QI=_t(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&&XI(e.exportKey)||e.fileAlias&&YI(e.fileAlias))return"node"},"resolveEntryRuntime"),ZI=_t(e=>{for(const t of e.options.entries){if(t.runtime)continue;const r=QI(t);r&&(t.runtime=r)}},"detectEntryRuntimes"),eM=_t(e=>{for(const t of e.options.entries)if(t.fileAlias){let r=t.fileAlias;for(;r.startsWith("./")||r.startsWith("../");)r=r.replace(GI,"");t.name=r}},"applyFileAliasNames"),Zy=_t(e=>{KI(e),VI(e),ZI(e),eM(e);for(const t of e.options.entries.filter(r=>!r.fileAlias))Um(t,e);for(const t of e.options.entries.filter(r=>r.fileAlias))Um(t,e),t.fileAlias=void 0},"prepareEntries");var tM=Object.defineProperty,Ln=v((e,t)=>tM(e,"name",{value:t,configurable:!0}),"d$7");const rM=/^[_$a-z\u00A0-\uFFFF][\w$\u00A0-\uFFFF]*$/iu,nM=Ln((e,t)=>{const r=e.options.jiti.transformOptions?.babel?.plugins;return JSON.stringify({...e.options.jiti,alias:{...Ka(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"),iM=Ln(e=>e.filter(t=>t!=="default").map((t,r)=>{if(rM.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};
166
- export { ${n} as ${JSON.stringify(t)} };`}),"buildNamedExportLines"),e$=Ln((e,t,r)=>{Eu(e,`export * from "${t}";
167
- ${r?`export { default } from "${t}";`:""}`)},"writeDtsStub"),oM=Ln(async(e,t,r,n,i,o,s,a,l,c)=>{const u=t(Ce(r),await rg("jiti",{conditions:["node","import"],url:import.meta.url})),p=Tt(e,"esm"),f=`${i}.${p}`;Eu(`${r}.${gt(e,"esm")}`,o+[`import { createJiti } from "${u}";`,...a.map((d,m)=>`import plugin${String(m)} from "${d}";`),"",`const jiti = createJiti(import.meta.url, ${s});`,"",`/** @type {import("${f}")} */`,`const _module = await jiti.import("${n}");`,...c?["export default _module?.default ?? _module;"]:[],...iM(l)].join(`
168
- `)),e.options.declaration&&e$(`${r}.${p}`,f,c)},"buildEsmStub"),sM=Ln(async(e,t,r,n,i,o,s,a,l)=>{const c=t(Ce(r),await rg("jiti",{conditions:["node","require"],url:import.meta.url})),u=Tt(e,"cjs"),p=`${i}.${u}`;Eu(`${r}.${gt(e,"cjs")}`,o+[`const { createJiti } = require("${c}");`,...a.map((f,d)=>`const plugin${String(d)} = require(${JSON.stringify(f)})`),"",`const jiti = createJiti(__filename, ${s});`,"",`/** @type {import("${p}")} */`,`module.exports = jiti("${n}")`].join(`
169
- `)),e.options.declaration&&e$(`${r}.${u}`,p,l)},"buildCjsStub"),aM=Ln(async e=>{const t=[],r=nM(e,t);for(const n of e.options.entries){const i=ve(e.options.rootDir,e.options.outDir,n.name),o=qx(e.jiti.esmResolve(n.input,{try:!0})??n.input),s=o.replace(ju,""),a=xu(o),l=H8(a);let c;try{c=await zx(o,{extensions:_s})}catch(f){be(e,`Cannot analyze ${o} for exports: ${String(f)}`);return}const u=c.includes("default")||c.length===0,p=e.options.jiti.absoluteJitiPath?(...f)=>Gx(ve(...f)):tt;e.options.emitESM&&await oM(e,p,i,o,s,l,r,t,c,u),e.options.emitCJS&&await sM(e,p,i,o,s,l,r,t,u),l&&(await uu(`${i}.${gt(e,"cjs")}`),await uu(`${i}.${gt(e,"esm")}`))}await e.hooks.callHook("rollup:done",e)},"createStub");var lM=Object.defineProperty,Ct=v((e,t)=>lM(e,"name",{value:t,configurable:!0}),"a$9");const of=Ct(e=>e.logger,"getLogger"),Ss="rollup-watch.json",Km=Ct(({context:e,doOnSuccessCleanup:t,fileCache:r,mode:n,runBuilder:i,runOnsuccess:o,useCache:s,watcher:a})=>{const l=`watcher:${n}`,c=of(e);a.on("change",async(u,{event:p})=>{await t?.(),c.info({message:`${Pe(tt(".",u))} was ${p}d`,prefix:l})}),a.on("restart",()=>{c.info({message:"Rebuilding ...",prefix:l})}),a.on("event",async u=>{switch(u.code){case"BUNDLE_END":{await u.result.close(),s&&r.set(n==="bundle"?Ss:`dts-${Ss}`,u.result.cache),c.raw(`
170
- ⚡️ Build run in ${String(u.duration)}ms
171
-
172
- `),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":{zh(u.error),c.error({context:[u.error],message:`Rebuild failed: ${u.error.message}`,prefix:l});break}}})},"watchHandler"),cM=Ct((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+=Pt(`
173
- └─ ${tt(process.cwd(),i)}`);of(e).info(n)},"logInputs"),uM=Ct((e,t,r)=>{const n=[le(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"),pM=Ct((e,t)=>{const r=e.options.rollup.watch;return!r||typeof t!="object"||t.include!==void 0?t:uM(e,t,r)},"configureWatchOptions"),fM=Ct(async(e,t,r,n,i)=>{let o=!0;e.options.rollup.css&&(o=!1);let s=[];const a=Ct(async()=>{await Promise.all(s.map(m=>m.close())),s=[]},"closeWatchers"),l=Ct(async()=>{const m=await PI(),g=await Ky(e,t);if(await e.hooks.callHook("rollup:options",e,g),Object.keys(g.input??{}).length===0)return;o&&(g.cache=t.get(Ss)),g.watch=pM(e,g.watch);const y=m(g);if(await e.hooks.callHook("rollup:watch",e,y),cM(e,g),Km({context:e,doOnSuccessCleanup:i,fileCache:t,mode:"bundle",runBuilder:r,runOnsuccess:n,useCache:o,watcher:y}),s.push(y),e.options.declaration){const x=await zy(e,t);o&&(x.cache=t.get(`dts-${Ss}`)),await e.hooks.callHook("rollup:dts:options",e,x);const j=m(x);await e.hooks.callHook("rollup:watch",e,j),Km({context:e,fileCache:t,mode:"types",useCache:o,watcher:j}),s.push(j)}},"startWatchers");await l();const c=le(e.options.rootDir,"package.json"),u=xp.map(m=>le(e.options.rootDir,m));let p;const f=Ct(async m=>{const g=of(e);g.info(`${tt(".",m)} changed, restarting watchers...`);try{await a();const{packageJson:y}=pl(e.options.rootDir);e.pkg=y,e.options.entries.length=0,e.buildEntries.length=0,await e.hooks.callHook("build:prepare",e),Zy(e),await l()}catch(y){g.error({message:`Failed to restart watchers: ${y.message}`,prefix:"watcher"})}},"runRestart"),d=Ct(m=>{clearTimeout(p),p=setTimeout(()=>{f(m).catch(()=>{})},100)},"restart");vf(c,()=>{d(c)});for(const m of u)if(Ft(m)){vf(m,()=>{d(m)});break}},"watch");var dM=Object.defineProperty,mM=v((e,t)=>dM(e,"name",{value:t,configurable:!0}),"s$8");const hM=mM(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: \`./${tt(e.options.rootDir,n)}\``),await A2(n))}},"cleanDistributionDirectories");var gM=Object.defineProperty,vM=v((e,t)=>gM(e,"name",{value:t,configurable:!0}),"o$4");const bM=vM(()=>n0((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 yM=Object.defineProperty,Wo=v((e,t)=>yM(e,"name",{value:t,configurable:!0}),"n$4");const $M=Mt,xM=Wo((e,t)=>{const{sideEffects:r}=t;let n;if(typeof r=="boolean")n=Wo(()=>r,"hasSideEffects");else if(Array.isArray(r))if(r.length<=0)n=Wo(()=>!1,"hasSideEffects");else{const i=r.map(o=>o.includes("/")?o:`**/${o}`);n=$M(i,void 0,{resolve:e})}else n=Wo(()=>{},"hasSideEffects");return n},"getPackageSideEffect");var Cc,Jm;function wM(){if(Jm)return Cc;Jm=1;var e=Object.defineProperty,t=v((l,c)=>e(l,"name",{value:c,configurable:!0}),"s"),r=i0,n=r.spawn,i=r.exec;Cc=v(function(l,c,u){if(typeof c=="function"&&u===void 0&&(u=c,c=void 0),l=parseInt(l),Number.isNaN(l)){if(u)return u(new Error("pid must be a number"));throw new Error("pid must be a number")}var p={},f={};switch(p[l]=[],f[l]=1,process.platform){case"win32":i("taskkill /pid "+l+" /T /F",u);break;case"darwin":a(l,p,f,function(d){return n("pgrep",["-P",d])},function(){o(p,c,u)});break;default:a(l,p,f,function(d){return n("ps",["-o","pid","--no-headers","--ppid",d])},function(){o(p,c,u)});break}},"treeKill");function o(l,c,u){var p={};try{Object.keys(l).forEach(function(f){l[f].forEach(function(d){p[d]||(s(d,c),p[d]=1)}),p[f]||(s(f,c),p[f]=1)})}catch(f){if(u)return u(f);throw f}if(u)return u()}v(o,"killAll"),t(o,"killAll");function s(l,c){try{process.kill(parseInt(l,10),c)}catch(u){if(u.code!=="ESRCH")throw u}}v(s,"killPid"),t(s,"killPid");function a(l,c,u,p,f){var d=p(l),m="";d.stdout.on("data",function(x){var x=x.toString("ascii");m+=x});var g=t(function(y){if(delete u[l],y!=0){Object.keys(u).length==0&&f();return}m.match(/\d+/g).forEach(function(x){x=parseInt(x,10),c[l].push(x),c[x]=[],u[x]=1,a(x,c,u,p,f)})},"onClose");d.on("close",g)}return v(a,"buildProcessTree"),t(a,"buildProcessTree"),Cc}v(wM,"requireTreeKill");var EM=wM();const SM=Rs(EM);var kM=Object.defineProperty,t$=v((e,t)=>kM(e,"name",{value:t,configurable:!0}),"l$6");const jM=t$(e=>process.platform==="win32"&&"cmd"in e&&"code"in e&&typeof e.cmd=="string"&&e.cmd.startsWith("taskkill")&&e.code===128,"isTaskKillCmdProcessNotFoundError"),AM=t$(async({pid:e,signal:t})=>{await new Promise((r,n)=>{if(!Number.isInteger(e)||e<=0){n(new Error("Invalid process ID"));return}SM(e,t,i=>{if(i&&!jM(i)){n(i);return}r()})})},"killProcess");var OM=Object.defineProperty,RM=v((e,t)=>OM(e,"name",{value:t,configurable:!0}),"o$2");const Vm=RM((e,t)=>{if(e.warnings.size>0){const r=e.logger;if(t&&r.raw(`
174
- `),r.warn(`Build is done with some warnings:
175
-
176
- ${Array.from(e.warnings,n=>`- ${n}`).join(`
177
- `)}`),e.options.failOnWarn)throw new Error("Exiting with code (1). You can change this behavior by setting `failOnWarn: false`.")}},"logBuildErrors");var _M=Object.defineProperty,r$=v((e,t)=>_M(e,"name",{value:t,configurable:!0}),"t$2");const PM=r$(async(e,t,r,n)=>{try{await Ps(le(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(`
178
- `),r.info({message:`Removing ${t} file cache, the cache key is not used anymore.`,prefix:"file-cache"}),!1},"removeStaleCacheDirectory"),CM=r$(async(e,t,r)=>{if(!e)return;const n=le(e,"keystore.json");if(!await et(n))return;const i=await Cn(n),o=(await Bx(e,{withFileTypes:!0})).filter(a=>a.isDirectory());let s=r;for(const a of o)i[a.name]||(s=await PM(e,a.name,t,s))},"removeOldCacheFolders");var TM=Object.defineProperty,n$=v((e,t)=>TM(e,"name",{value:t,configurable:!0}),"s$5");const Xm=n$((e,t)=>{for(const r of zc(e??[]))if(typeof r=="string"&&r.startsWith("node")){const n=$t.coerce(r.slice(4));n&&t.push(n.version)}},"collectNodeTargets"),NM=n$(e=>{if(e.options.runtime!=="node"||!e.options.emitCJS)return;const t=[],r=e.pkg.engines?.node,n=r?$t.minVersion(r):void 0;n&&t.push(n.version);const i=e.options.rollup;if(Xm(i.esbuild?.target,t),Xm(i.oxc?.target,t),t.length===0){const o=$t.coerce(as.node);o&&t.push(o.version)}t.some(o=>$t.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(`
179
- `))},"warnLegacyCJS");var IM=Object.defineProperty,oe=v((e,t)=>IM(e,"name",{value:t,configurable:!0}),"b$2");const MM=De(import.meta.url),Xr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:tr,sf=oe(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 MM(e)},"__cjs_getBuiltinModule"),tr=Xr,{execFileSync:DM}=sf("node:child_process"),ki=sf("node:fs"),BM=sf("node:tty"),af=[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],lf=[12288,12288,65281,65376,65504,65510],cf=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],uf=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],fl=[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],_o=oe((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"),LM=af[0],WM=af.at(-1),FM=lf[0],HM=lf.at(-1),qM=cf[0],zM=cf.at(-1),GM=uf[0],UM=uf.at(-1),KM=fl[0],JM=fl.at(-1),Ym=19968,[VM,XM]=i$(fl);function i$(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(Ym>=i&&Ym<=o)return[i,o];o-i>r-t&&(t=i,r=o)}return[t,r]}v(i$,"ge$1");oe(i$,"findWideFastPathRange");const YM=oe(e=>e<LM||e>WM?!1:_o(af,e),"isAmbiguous"),QM=oe(e=>e<FM||e>HM?!1:_o(lf,e),"isFullWidth"),ZM=oe(e=>e<qM||e>zM?!1:_o(cf,e),"isHalfWidth"),e4=oe(e=>e<GM||e>UM?!1:_o(uf,e),"isNarrow"),t4=oe(e=>e>=VM&&e<=XM?!0:e<KM||e>JM?!1:_o(fl,e),"isWide");function o$(e){return YM(e)?"ambiguous":QM(e)?"fullwidth":ZM(e)?"halfwidth":e4(e)?"narrow":t4(e)?"wide":"neutral"}v(o$,"Se$1");oe(o$,"getCategory");function s$(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}v(s$,"Be");oe(s$,"validate");function pf(e){return s$(e),o$(e)}v(pf,"Vt");oe(pf,"eastAsianWidthType");const a$=String.raw,Qm=a$`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,r4=oe(()=>new RegExp(a$`\p{RI}{2}|(?![#*\d](?!\uFE0F?\u20E3))${Qm}(?:\u200D${Qm})*`,"gu"),"emojiRegex"),Wn=new Set(["\x1B","›"]),dl="\x07",l$="[",ff="m",ks="]8;;",n4=39,i4=/[\u200B\uFEFF\u2060-\u2064]/g,o4=new RegExp(`(?:\\${l$}(?<code>\\d+)m|\\${ks}(?<uri>.*)${dl})`),s4=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]])),hr=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,Zm=/\u001B\[(\d+(?:;\d+)*)?m[^\u001B]*(?:\u001B\[(?:\d+(?:;\d+)*)?m|$)/g,eh=/\u001B\]8;[^\u0007\u001B]*(?:\u0007|\u001B\\)(.*?)\u001B\]8;;(?:\u0007|\u001B\\)/g,Fo=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Tc=r4(),th=new Map,Ho=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,os=oe(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"),a4=oe((e,t)=>{const r=Math.floor(e/65536),n=e%65536;let i=th.get(r);if(i||(i=new Map,th.set(r,i)),i.has(n))return i.get(n);let o;if(os(e)==="latin")o=t.width.regular;else if(os(e)==="control")o=t.width.control;else if(os(e)==="wide")o=t.width.wide;else switch(pf(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"),l4=oe(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"),En=oe((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?En(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 u=e.includes("\x1B")||e.includes("›");for(;s<i;){if(u&&(e[s]==="\x1B"||e[s]==="›")){if(e.startsWith("\x1B]8;;",s)){const y="\x1B]8;;\x07",x=y.length,j=e.indexOf("\x07",s+5);if(j!==-1){const R=e.indexOf(y,j+1);if(R!==-1){const b=R+x,E=e.slice(j+1,R).replace(hr,""),h=En(E,{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}),A=h.width;if(h.truncated)c=!0,l=Math.min(l,s);else if(a+A>n&&(l=Math.min(l,s),c=!0,a+A>r.truncation.limit))break;if(a+=A,s=b,c&&a>=r.truncation.limit)break;continue}}}if(hr.lastIndex=s,hr.test(e)){const y=hr.lastIndex-s,x=r.truncation.countAnsiEscapeCodes?y:r.width.ansi;if(a+x>n&&(l=Math.min(l,s),a+x>r.truncation.limit)){c=!0;break}a+=x,s=hr.lastIndex;continue}}const d=e.codePointAt(s);if(d===8203||d===65279||d>=8288&&d<=8292){s+=1;continue}if(d===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(Ho.lastIndex=s,Ho.test(e)){const y=(Ho.lastIndex-s)*r.width.regular;if(a+y>n){const x=Math.floor((n-a)/r.width.regular);if(l=Math.min(l,s+x),a+y>r.truncation.limit){c=!0;break}}a+=y,s=Ho.lastIndex;continue}if((d<=31||d>=127&&d<=159)&&(Fo.lastIndex=s,Fo.test(e))){const y=(Fo.lastIndex-s)*r.width.control;if(a+y>n&&(l=Math.min(l,s+Math.floor((n-a)/r.width.control)),a+y>r.truncation.limit)){c=!0;break}a+=y,s=Fo.lastIndex;continue}if(Tc.lastIndex=s,Tc.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=Tc.lastIndex;continue}const m=e.codePointAt(s)??0;if(l4(m)){s+=m>65535?2:1;continue}let g;if(o)g=a4(m,r);else switch(os(m)){case"control":{g=r.width.control;break}case"latin":{g=r.width.regular;break}case"wide":{g=r.width.wide;break}case"zero":{g=0;break}default:switch(pf(m)){case"ambiguous":{g=r.width.ambiguousIsNarrow?r.width.regular:r.width.wide;break}case"fullwidth":{g=r.width.fullWidth;break}case"wide":{g=r.width.wide;break}default:g=r.width.regular}}if(a+g>n&&(l=Math.min(l,s),a+g>r.truncation.limit)){c=!0;break}a+=g,s+=m>65535?2:1}let p=a,f=!1;return c&&r.truncation.limit>=r.truncation.ellipsisWidth&&(p=r.truncation.limit,f=!0),{ellipsed:f,index:c?l:i,truncated:c,width:p}},"getStringTruncatedWidth"),Be=oe((e,t={})=>En(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");class c4{static{v(this,"Te")}static{oe(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 rh=new c4(100),u4=new Intl.Segmenter("en",{granularity:"grapheme"}),p4=/^[\u0000-\u007F]*$/,f4=new Set(["0","22","23","24","27","28","29","39","49"]),d4=new Set(["1","3","4","7","8","9"]),nh=new Map([["22","1"],["23","3"],["24","4"],["27","7"],["28","8"],["29","9"]]),qo=oe(e=>e>="30"&&e<="37"||e>="90"&&e<="97"||e.startsWith("38;"),"isForegroundColor"),zo=oe(e=>e>="40"&&e<="47"||e>="100"&&e<="107"||e.startsWith("48;"),"isBackgroundColor"),m4=[{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"}],ih=oe((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"),h4=oe((e,t)=>{if(!e.includes("\x1B"))return[{after:"",before:"",content:e,visibleLength:Be(e,t.width)}];const r=rh.get(e);if(r)return r;const n=[],i=[];let o=0,s;for(hr.lastIndex=0;(s=hr.exec(e))!==null;){const u=s[0];n.push(e.slice(o,s.index)),i.push(u),o=s.index+u.length}o<e.length&&n.push(e.slice(o));const a=[];for(const u of i){if(u==="\x1B[0m"||u==="\x1B]8;;\x07"){a.push(u);continue}if(u.startsWith("\x1B[")&&u.endsWith("m")){const p=u.slice(2,-1);if(f4.has(p)){a.push(u);continue}}}const l=new Set,c=[];for(const[u,p]of n.entries()){if(u>0&&i[u-1]){const m=i[u-1];if(m==="\x1B[0m")l.clear();else if(m==="\x1B]8;;\x07"){for(const g of l)if(g.startsWith("\x1B]8;;")&&!g.endsWith("\x1B]8;;\x07")){l.delete(g);break}}else if(m.startsWith("\x1B[")&&m.endsWith("m")){const g=m.slice(2,-1);if(g==="39"){for(const y of l)if(y.startsWith("\x1B[")&&y.endsWith("m")){const x=y.slice(2,-1);if(qo(x)){l.delete(y);break}}}else if(g==="49"){for(const y of l)if(y.startsWith("\x1B[")&&y.endsWith("m")){const x=y.slice(2,-1);if(zo(x)){l.delete(y);break}}}else if(nh.has(g)){const y=nh.get(g);for(const x of l)if(x===`\x1B[${y}m`){l.delete(x);break}}else{if(qo(g)){for(const y of l)if(y.startsWith("\x1B[")&&y.endsWith("m")){const x=y.slice(2,-1);if(qo(x)){l.delete(y);break}}}else if(zo(g)){for(const y of l)if(y.startsWith("\x1B[")&&y.endsWith("m")){const x=y.slice(2,-1);if(zo(x)){l.delete(y);break}}}else if(d4.has(g)){const y=`\x1B[${g}m`;l.has(y)&&l.delete(y)}l.add(m)}}else if(m.startsWith("\x1B]8;;")&&!m.endsWith("\x1B]8;;\x07")){for(const g of l)if(g.startsWith("\x1B]8;;")&&!g.endsWith("\x1B]8;;\x07")){l.delete(g);break}l.add(m)}}if(p==="")continue;let f="";if(l.size>0)if(a.includes("\x1B[0m"))f="\x1B[0m";else{const m=[];let g=!1;for(const R of l)if(R.startsWith("\x1B]8;;")&&!R.endsWith("\x1B]8;;\x07")){g=!0;break}g&&a.includes("\x1B]8;;\x07")&&m.push("\x1B]8;;\x07");let y=!1,x=!1;for(const R of l)if(R.startsWith("\x1B[")&&R.endsWith("m")){const b=R.slice(2,-1);qo(b)?y=!0:zo(b)&&(x=!0)}if(y&&x){const R=ih(e,["\x1B[3","\x1B[9","\x1B[38;"]),b=ih(e,["\x1B[4","\x1B[10","\x1B[48;"]);R>=0&&b>=0?R>b?m.push("\x1B[39m","\x1B[49m"):m.push("\x1B[49m","\x1B[39m"):m.push("\x1B[39m","\x1B[49m")}else y&&m.push("\x1B[39m"),x&&m.push("\x1B[49m");y&&x&&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 j=m4.filter(R=>l.has(R.open)).map(R=>({position:e.indexOf(R.open),style:R})).filter(R=>R.position>=0).toSorted((R,b)=>b.position-R.position);for(const R of j){const b=R;a.includes(b.style.close)&&m.push(b.style.close)}f=m.join("")}const d=[...l].join("");c.push({after:f,before:d,content:p,visibleLength:Be(p,{fullWidth:1,wideWidth:1})})}return rh.set(e,c),c},"processIntoStyledSegments"),g4=oe((e,t,r,n)=>{const i=[...n.segmenter.segment(e)],o=[];let s=0,a=!1;for(const l of i){const c=Be(l.segment,n.width),u=s,p=s+c;if(!a)if(u<t){s=p;continue}else a=!0;if(u>=r||p>r)break;o.push(l.segment),s=p}return o.join("")},"fastSlice"),Jt=oe((e,t=0,r=Number.MAX_SAFE_INTEGER,n={})=>{const i={segmenter:u4,...n};if(t>=r||e==="")return"";const o=Be(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 p4.test(e)?e.slice(t,r):g4(e,t,r,i);if(Zm.lastIndex=0,eh.lastIndex=0,!Zm.test(e)&&!eh.test(e))return e;const s=h4(e,i);if(s.length===0)return"";let a=0;const l=[];for(const[p,f]of s.entries()){const d=a,m=a+f.visibleLength;if(m>t&&d<r){const g=Math.max(0,t-d),y=Math.min(f.visibleLength,r-d);l.push({end:y,index:p,segment:f,start:g})}a=m}if(l.length===0)return"";const c=[],u=l[0].segment;c.push(u.before);for(let p=0;p<l.length;p++){const{end:f,segment:d,start:m}=l[p];if(m===0&&f===d.visibleLength)c.push(d.content);else{const g=[...i.segmenter.segment(d.content)];c.push(g.slice(m,f).map(y=>y.segment).join(""))}if(p<l.length-1){const g=l[p+1].segment,y=d.after,x=g.before;y!==x&&(y||x)&&c.push(y,x)}}return c.push(l.at(-1).segment.after),c.join("")},"slice"),oh="…",v4=3,Go=oe((e,t,r=!1)=>{if(e.charAt(t)===" ")return t;const n=r?1:-1,i=Math.min(v4,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"),Uo=oe((e,t,r)=>En(e,{...r,ellipsis:"",ellipsisWidth:0,limit:t}).index,"widthToIndex"),Ko=oe((e,t,r)=>Be(e.slice(0,t),r),"indexToWidth"),sh=oe((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=oh,position:o="end",preferTruncationOnSpace:s=!1}=r;let a=r.ellipsisWidth??i===oh?1:void 0;a??=En(i,{...r.width,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width;const{width:l}=En(n,{...r.width,ellipsis:i,ellipsisWidth:a});if(l<=t)return n;switch(o){case"end":{if(s){const c=t-a,u=Uo(n,c,r.width),p=Go(n,u),f=Ko(n,p,r.width);return Jt(n,0,f,{width:r.width})+i}return Jt(n,0,t-a,{width:r.width})+i}case"middle":{const c=Math.floor(t/2),u=Math.max(0,t-a),p=Math.min(c,u),f=Math.max(0,u-p);if(s){const d=Uo(n,p,r.width),m=Go(n,d),g=Ko(n,m,r.width),y=l-f,x=Uo(n,y,r.width),j=Go(n,x,!0),R=Ko(n,j,r.width);return Jt(n,0,g,{width:r.width})+i+Jt(n,R,l,{width:r.width}).trim()}return Jt(n,0,p,{width:r.width})+i+Jt(n,l-f,l,{width:r.width})}case"start":{if(s){const c=l-t+a,u=Uo(n,c,r.width),p=Go(n,u,!0),f=Ko(n,p,r.width);return i+Jt(n,f,l,{width:r.width}).trim()}return i+Jt(n,l-t+a,l,{width:r.width})}default:throw new Error(`Invalid position: expected 'start', 'middle' or 'end', got '${o}'`)}},"truncate"),b4=/\x1B\[(\d+)m/;class c${static{v(this,"Jt")}static{oe(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const r=b4.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 u$=oe((e,t)=>{if(!Wn.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const r=!0,n=e.slice(t+1,t+1+ks.length).join("")===ks;return{isInsideEscape:r,isInsideLinkEscape:n}},"checkEscapeSequence"),y4=oe((e,t={})=>{const r=new c$;let n="",i=!1,o="",s="",a=!1;const l=[...e];for(let c=0;c<l.length;c++){const u=l[c];if(u&&Wn.has(u)){if(n){const g=t.getWidth?.(n)??0,y={isEscapeSequence:!1,isGrapheme:!0,text:n,width:g};if(a&&(y.isHyperlink=!0,y.hyperlinkUrl=s),t.onSegment?.(y,r)===!1)return;n=""}i=!0,o=u;const d=u$(l,c),{isInsideLinkEscape:m}=d;if(m){let g=c+1;for(s="";g<l.length;){const x=l[g];if(x===dl)break;s+=x,g+=1}s=s.slice(4);const y={hyperlinkUrl:s,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(y,r)===!1)return;c=g,a=!0,i=!1,o="";continue}if(c+1<l.length&&l[c+1]==="\\"&&a){const g={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.(g,r)===!1)return;a=!1,s="",c+=1,i=!1,o="";continue}}if(i){if(o!==u&&(o+=u),u===ff){i=!1,r.processEscape(o);const d={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};if(t.onSegment?.(d,r)===!1)return;o=""}continue}n+=u;const p=t.getWidth?.(n)??0,f={isEscapeSequence:!1,isGrapheme:!0,text:n,width:p};if(a&&(f.isHyperlink=!0,f.hyperlinkUrl=s),t.onSegment?.(f,r)===!1)return;n=""}if(n){const c=t.getWidth?.(n)??0,u={isEscapeSequence:!1,isGrapheme:!0,text:n,width:c};a&&(u.isHyperlink=!0,u.hyperlinkUrl=s),t.onSegment?.(u,r)}if(o){const c={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};t.onSegment?.(c,r)}},"processAnsiString"),ah=oe(e=>`${Wn.values().next().value}${l$}${String(e)}${ff}`,"wrapAnsiCode"),lh=oe(e=>`${Wn.values().next().value}${ks}${e}${dl}`,"wrapAnsiHyperlink"),$4=oe(e=>{if(e.length===0)return"";if(e.length===1)return e[0];let t="",r,n;const i=e.join(`
180
- `),o=[...i];let s=0;for(const[a,l]of o.entries()){if(t+=l,Wn.has(l)){const u=o4.exec(i.slice(s))?.groups??{};if(u.code!==void 0){const p=Number.parseFloat(u.code);r=p===n4?void 0:p}else u.uri!==void 0&&(n=u.uri.length===0?void 0:u.uri)}const c=s4.get(Number(r));o[a+1]===`
181
- `?(n&&(t+=lh("")),r&&c&&(t+=ah(c))):l===`
182
- `&&(r&&c&&(t+=ah(r)),n&&(t+=lh(n))),s+=l.length}return t},"preserveAnsi"),p$=/(?=\s)|(?<=\s)/,f$=/^\s+$/,Nc=oe(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"),Sr=oe(e=>{const t=e.split(" ");let r=t.length;for(;r>0&&Be(t[r-1])===0;)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},"stringVisibleTrimSpacesRight"),d$=oe((e,t,r)=>{if(e.length===0)return[""];if(t<=0)return[e];const n=[],i=new c$;let o="",s=0,a=!1,l=!1,c="",u=0;for(;u<e.length;){const p=e[u];if(Wn.has(p)){a=!0,c=p,o+=p,l=u$([...e],u).isInsideLinkEscape,u+=1;continue}if(a){c+=p,o+=p,l?p===dl&&(a=l=!1):p===ff&&(a=!1,i.processEscape(c)),u+=1;continue}const f=Be(p),d=p===" ";if(f===0){o+=p,u+=1;continue}if(s+f>t&&(o&&n.push(o+i.getEndEscapesForAllActiveAttributes()),o=i.getStartEscapesForAllActiveAttributes(),s=Be(o),d&&r)){for(;u<e.length&&e[u]===" ";)u+=1;continue}if(o+=p,s+=f,s===t&&u<e.length-1&&(n.push(o+i.getEndEscapesForAllActiveAttributes()),o=i.getStartEscapesForAllActiveAttributes(),s=Be(o),u+1<e.length&&e[u+1]===" "&&r)){for(u+=1;u<e.length&&e[u]===" ";)u+=1;continue}u+=1}return o&&n.push(o+i.getEndEscapesForAllActiveAttributes()),r?n.map(p=>Sr(p)):n},"wrapWithBreakAtWidth"),x4=oe((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 y4(n,{getWidth:Be,onSegment:oe((a,l)=>{const c=a.text??"";if(a.isEscapeSequence)o+=c;else{const u=c===" ";if(a.width===0)return o+=c,!0;if(s+a.width>t&&(o&&i.push(o),o=l.getStartEscapesForAllActiveAttributes(),s=0,u))return r||i.push(l.getStartEscapesForAllActiveAttributes()+c),!0;o+=c,s+=a.width}return!0},"onSegment")}),o&&i.push(o),r?i.map(a=>Sr(a)):i},"wrapCharByChar"),w4=oe((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(p$),o=[];let s="",a=0,l=0;for(;l<i.length;){const c=i[l],u=f$.test(c),p=Be(c);if(c.length===0){l+=1;continue}if(r&&u&&a===0){l+=1;continue}if(a+p>t&&a>0){r?o.push(Sr(s)):o.push(s),s="",a=0;continue}s+=c,a+=p,l+=1}return s&&(r?o.push(Sr(s)):o.push(s)),o},"wrapWithWordBoundaries"),E4=oe((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(p$),o=[];let s="",a=0,l=0;for(;l<i.length;){const c=i[l],u=f$.test(c),p=Be(c);if(c.length===0){l+=1;continue}if(r&&u&&a===0){l+=1;continue}if(p>t){s&&o.push(Nc(r?Sr(s):s));const f=d$(c,t,r);if(f.length>0){for(let d=0;d<f.length-1;d+=1)o.push(f[d]);s=f.at(-1),a=Be(s)}else s="",a=0;l+=1;continue}if(a+p>t&&a>0&&(o.push(Nc(r?Sr(s):s)),s="",a=0,r&&u)){l+=1;continue}s+=c,a+=p,l+=1}return s&&o.push(Nc(r?Sr(s):s)),o},"wrapAndBreakWords"),Jo={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},S4=oe((e,t={})=>{const{removeZeroWidthCharacters:r=!0,trim:n=!0,width:i=80,wrapMode:o=Jo.PRESERVE_WORDS}=t;if(n&&e.trim()==="")return"";let s=e.normalize("NFC").replaceAll(`\r
183
- `,`
184
- `);return r&&(s=s.replaceAll(i4,"")),s.split(`
185
- `).map(a=>{if(n&&a.trim()==="")return"";let l;switch(o){case Jo.BREAK_AT_CHARACTERS:{l=x4(a,i,n);break}case Jo.BREAK_WORDS:{l=E4(a,i,n);break}case Jo.STRICT_WIDTH:{l=d$(a,i,n);break}default:l=w4(a,i,n)}return $4(l)}).join(`
186
- `)},"wordWrap"),m$=80,h$=24,hu=oe((e,t,{shell:r,env:n}={})=>DM(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:r,env:n}).trim(),"exec"),ss=oe((e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),"create"),g$=oe((e,t)=>{const{columns:r,rows:n}=ss(e,t);if(!(Number.isNaN(r)||Number.isNaN(n))&&!(r===m$&&n===h$))return{columns:r,rows:n}},"createIfNotDefault"),k4=oe(()=>{if(tr.platform!=="linux")return!0;try{const e=ki.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 v$(){const{env:e,stdout:t,stderr:r}=tr;if(t?.columns&&t?.rows)return ss(t.columns,t.rows);if(r?.columns&&r?.rows)return ss(r.columns,r.rows);if(e.COLUMNS&&e.LINES)return ss(e.COLUMNS,e.LINES);const n={columns:m$,rows:h$};return tr.platform==="win32"?Ic()??n:tr.platform==="darwin"?ch()??Ic()??n:ch()??Ic()??j4()??n}v(v$,"Le");oe(v$,"terminalSize");const ch=oe(()=>{try{const e=tr.platform==="darwin"?ki.constants.O_EVTONLY|ki.constants.O_NONBLOCK:ki.constants.O_NONBLOCK,{columns:t,rows:r}=BM.WriteStream(ki.openSync("/dev/tty",e));return{columns:t,rows:r}}catch{}},"devTty"),Ic=oe(()=>{try{const e=hu("tput",["cols"],{env:{TERM:"dumb",...tr.env}}),t=hu("tput",["lines"],{env:{TERM:"dumb",...tr.env}});if(e&&t)return g$(e,t)}catch{}},"tput"),j4=oe(()=>{try{if(!k4())return;const e=hu("resize",["-u"]).match(/\d+/g);if(e.length===2)return g$(e[0],e[1])}catch{}},"resize"),Fr=oe((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"),A4=oe(e=>({join:e.bodyJoin,left:e.bodyLeft,right:e.bodyRight}),"getVerticalBorderChars"),js=oe((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"),gu=oe((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"),O4=oe((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[u,p]of c.entries())if(p&&i(e,l,u,p)===l){const f=gu(e,l,u,p);o=Math.max(o,f.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 u=0;u<r.columns;u+=1){const p=c[u];if(p&&i(e,l,u,p)===l&&(p.rowSpan??1)===1){const f=p.colSpan??1,d=js(t,u,f),m=n(p,d).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 u=0;u<r.columns;u+=1){const p=c[u];if(p&&i(e,l,u,p)===l&&(p.rowSpan??1)>1){const f=p.colSpan??1,d=js(t,u,f),m=n(p,d).length-1,g=gu(e,l,u,p),{firstRow:y,lastRow:x}=g;let j=0,R=0;for(let E=y;E<=x&&E<s.length;E+=1)j+=s[E]??1,a[E]||(R+=1);const b=m-j;if(b>0)if(R>0){const E=Math.ceil(b/R);let h=0;for(let A=y;A<=x&&A<s.length;A+=1)if(!a[A]){const _=Math.min(E,b-h);if(s[A]=(s[A]??1)+_,h+=_,h>=b)break}}else console.warn(`[calculateRowHeights] Content of spanning cell exceeds fixed height allocated. Cell: ${JSON.stringify(p.content)}, Required: ${String(m)}, Allocated: ${String(j)} (fixed).`)}}}return s},"calculateRowHeights"),Hr=oe((e,t,r,n)=>{let i=t;for(;i>0&&e[i-1]?.[r]===n;)i-=1;return i},"findFirstOccurrenceRow"),vu="__EMPTY__",uh=oe(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:vu};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=vu;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"),R4=oe((e,t,r,n,i)=>{const o=Be(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),u=l-c;return s+" ".repeat(c)+e+" ".repeat(u)+a}case"right":return s+" ".repeat(l)+e+a;default:return s+e+" ".repeat(l)+a}},"padAndAlignContent"),di=/\r?\n/,ph=/\s+/,Ae=oe((e,t)=>!e||!t?e:typeof t=="function"?t(e):t.open+e+t.close,"applyColor");class ml{static{v(this,"ht")}static{oe(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}=v$();i=o}this.#t=i,this.#e.maxWidth&&(this.#e.maxWidth=Math.min(this.#e.maxWidth,this.#t))}addItem(t){return this.#i.push(uh(t)),this}addItems(t){return this.#i.push(...t.map(r=>uh(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=ml.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===vu&&!(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,u=r,p=n,f=0;const d=(t.length+l+5)*this.#e.columns;for(;!c&&u<i&&f<d;){for(f+=1;u+l>t.length;)t.push(Array.from({length:this.#e.columns}).fill(void 0));if(this.canPlaceItem(t,u,p,a,l))if(this.placeItem(t,u,p,s),c=!0,this.#e.autoFlow==="row")n=p+a,r=u,n>=this.#e.columns&&(n=0,r+=1);else{r=u+l,n=p;const m=t.length>0?t.length:i;r>=m&&(r=0,n+=1)}else if(this.#e.autoFlow==="row")p+=1,p>=this.#e.columns&&(p=0,u+=1);else{for(u+=1;u+l>t.length;)t.push(Array.from({length:this.#e.columns}).fill(void 0));const m=t.length>0?t.length:i;if(u>=m&&(u=0,p+=1,p>=this.#e.columns))break}}if(!c)if(console.warn(`@visulima/tabular: Could not find position for item: ${JSON.stringify(s)} after ${String(f)} 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(f>=d)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(ph);for(const c of l)s=Math.max(s,Math.min(Be(c),n))}o=Math.min(o,Math.max(s+4,12))}}else{let s=0;for(const a of r){const l=a.split(ph);for(const c of l)s=Math.max(s,Math.min(Be(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 p=s?.bodyJoin.width??0;i+=(o-1)*p}if(i>=n)return Array.from({length:o}).fill(1);const a=n-i,l=t.reduce((p,f)=>p+f,0);if(l===0){const p=Math.floor(a/o);return Array.from({length:o}).fill(p)}const c=t.map(p=>{const f=p/l;return Math.max(1,Math.floor(a*f))});let u=a-c.reduce((p,f)=>p+f,0);if(u>0){const p=c.map((f,d)=>{const m=l>0?(t[d]??0)/l:1/o;return{index:d,remainder:a*m%1}}).toSorted((f,d)=>d.remainder-f.remainder);for(const f of p){if(u<=0)break;const{index:d}=f;c[d]!==void 0&&(c[d]+=1,u-=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 u=s?.bodyJoin.width??0;a+=(this.#e.columns-1)*u}const l=Math.max(0,o-a);if(n.reduce((u,p)=>u+p,0)>0){const u=Math.floor(l/this.#e.columns),p=Array.from({length:this.#e.columns}).fill(u),f=u*this.#e.columns;let d=l-f;for(let x=0;x<p.length&&d>0;x+=1)p[x]=(p[x]??0)+1,d-=1;const m=[];let g=0;for(let x=0;x<this.#e.columns;x+=1){const j=p[x]??0,R=n[x]??0,b=Math.max(j,R);m.push(b),g+=b}if(g>l){const x=l/g,j=m.map(E=>Math.max(3,Math.floor(E*x))),R=j.reduce((E,h)=>E+h,0);let b=l-R;for(let E=0;E<j.length&&b>0;E+=1)j[E]=(j[E]??0)+1,b-=1;return j}let y=l-g;if(y>0){const x=i.length>0?i:m.map((j,R)=>R);for(;y>0&&x.length>0;)for(const j of x){if(y<=0)break;m[j]=(m[j]??0)+1,y-=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||Hr(t,a,s,l)!==a||s>0&&t[a]?.[s-1]===l)continue;const c=l.colSpan??1,u=l.maxWidth??Number.POSITIVE_INFINITY,p=String(l.content??"").split(di),f=this.#e.wordWrap&&l.wordWrap!==!1;let d=0;for(const m of p)d=Math.max(d,Math.min(Be(m),u));d=this.computeWrappedContentWidth(d,p,u,f),c===1&&(r[s]=Math.max(r[s]??0,d+i),f&&!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||Hr(t,s,a,l)!==s||a>0&&t[s]?.[a-1]===l)continue;const c=l.colSpan??1;if(c>1){const u=l.maxWidth??Number.POSITIVE_INFINITY,p=String(l.content??"").split(di),f=this.#e.wordWrap&&l.wordWrap!==!1;let d=0;for(const x of p)d=Math.max(d,Math.min(Be(x),u));d=this.computeWrappedContentWidth(d,p,u,f);const m=(c-1)*o,g=d+i+m;let y=0;for(let x=a;x<a+c;x+=1)y+=r[x]??0;if(g>y){const x=g-y,j=Math.ceil(x/c);for(let R=0;R<c&&a+R<this.#e.columns;R+=1)r[a+R]=Math.max(r[a+R]??0,j)}}}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 u=0;const p=[];for(const[m,g]of o.entries())typeof g=="number"&&Number.isFinite(g)?(s[m]=g,u+=g):p.push(m);let f=Math.max(0,c-u);const d=p.length>0?Math.floor(f/p.length):0;for(const m of p)s[m]=d;f-=d*p.length;for(const m of p){if(f<=0)break;s[m]+=1,f-=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||Hr(t,s,o,a)!==s||o>0&&t[s]?.[o-1]===a)continue;const l=a.colSpan??1,c=a.maxWidth??Number.POSITIVE_INFINITY,u=String(a.content??"").split(di);let p=0;for(const f of u)p=Math.max(p,Math.min(Be(f),c));l===1&&(r[o]=Math.max(r[o]??0,p+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||Hr(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,u=String(a.content??"").split(di),p=this.#e.wordWrap&&a.wordWrap!==!1;let f=0;for(const x of u)f=Math.max(f,Math.min(Be(x),c));f=this.computeWrappedContentWidth(f,u,c,p);let d=0;for(let x=s;x<s+l;x+=1)d+=r[x]??0;const m=l>1?(l-1)*i:0,g=f+n+m,y=d+m;if(g>y){const x=g-y,j=Math.floor(x/l);let R=0;for(let b=0;b<l&&s+b<this.#e.columns;b+=1){const E=Math.min(j,x-R);if(r[s+b]=(r[s+b]??0)+E,R+=E,R>=x)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?A4(this.#e.border):void 0,u=c&&c.left.width>0?c.left.char:"",p=c&&c.right.width>0?c.right.char:"",f=c&&c.join.width>0?c.join.char:"",d=" ".repeat(this.#e.gap);u&&l.push(Ae(Ae(u,a),this.#e.backgroundColor));let m=0;for(;m<this.#e.columns;){const g=s[m]??void 0;let y=1,x;if(g){const j=g.colSpan??1;y=j;const R=Hr(t,r,m,g),b=js(i,m,j),E=this.alignCellContent(g,b),h=E.length,A=this.getCachedCellVerticalPosition(t,r,m,g);A.firstRow!==R&&console.warn(`Mismatch between findFirstOccurrenceRow (${String(R)}) and determineCellVerticalPosition (${String(A.firstRow)})`);const _=o.slice(R,A.lastRow+1).reduce((X,te)=>X+te,0),O=A.lastRow-A.firstRow+1;let k=n,C=0;for(let X=R;X<r;X+=1)X<o.length&&(k+=o[X]??1),X<A.lastRow&&(C+=1);k+=C;const B=g.vAlign??"top";let J;switch(B){case"bottom":{let X=n;for(let re=R;re<r;re+=1)X+=o[re]??1;const te=_-h;J=X>=te?X-te:-1;break}case"middle":{const X=Math.round((_-h)/2);let te=n;for(let re=R;re<r;re+=1)te+=o[re]??1;J=te>=X&&te<X+h?te-X:-1;break}case"top":{J=k;break}default:J=k}const q=J>=0&&J<h;if(x=" ".repeat(Math.max(0,b)),q){let X=!1;B==="middle"&&O%2===0&&J===0&&(X=!0),X||(x=E[J]??x)}g.colSpan&&g.colSpan>1&&(x+=d.repeat(g.colSpan)),g.foregroundColor?x=Ae(x,g.foregroundColor):this.#e.foregroundColor&&(x=Ae(x,this.#e.foregroundColor)),g.backgroundColor?x=Ae(x,g.backgroundColor):this.#e.backgroundColor&&(x=Ae(x,this.#e.backgroundColor))}else{const j=this.#e.paddingLeft+this.#e.paddingRight,R=Math.max(0,(i[m]??0)-j),b=" ".repeat(this.#e.paddingLeft+R+this.#e.paddingRight);x=Ae(Ae(n===0?b:" ".repeat(b.length),this.#e.foregroundColor),this.#e.backgroundColor)}l.push(x),m+y<this.#e.columns&&(l.push(d),this.#e.showBorders&&f&&l.push(Ae(Ae(f,a),this.#e.backgroundColor)),this.#e.gap>0&&l.push(d)),m+=y}return p&&l.push(Ae(Ae(p,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 p=[" ".repeat(s+this.#e.gap)];return n?n.set(r,p):this.#o.set(t,new Map([[r,p]])),p}let l;const c=String(t.content??"");if(l=c.includes(`
187
- `)||c.includes("\r")?c.split(di):[c],this.#e.wordWrap&&t.wordWrap!==!1){const p=typeof this.#e.wordWrap=="object"?this.#e.wordWrap:{},f=typeof t.wordWrap=="object"?t.wordWrap:p;l=S4(c,{...f,width:a}).split(`
188
- `)}if(this.#e.truncate&&t.truncate!==!1){const p=typeof this.#e.truncate=="object"?this.#e.truncate:{},f=typeof t.truncate=="object"?t.truncate:p;l=l.map(d=>sh(d,a,f))}else this.#e.truncateOverflow&&(l=l.map(p=>Be(p)>a?sh(p,a,{}):p));const u=l.map(p=>R4(p,a,t.hAlign??"left",i,o));return n?n.set(r,u):this.#o.set(t,new Map([[r,u]])),u}renderHorizontalBorder(t,r,n,i,o,s=-1){if(!this.#e.showBorders||!this.#e.border)return"";const a=this.#e.border,l=Fr(a,o),c=l.body.char,u=l.body.width,p=a.bodyJoin.char;if(o!=="middle"&&u===0)return"";let f=l.left.char,d=l.right.char;if(o==="middle"&&s!==-1){const x=t[n]?.[0]??void 0,j=t[s]?.[0]??void 0;x&&j&&x===j&&(f=p);const R=this.#e.columns-1,b=t[n]?.[R]??void 0,E=t[s]?.[R]??void 0;b&&E&&b===E&&(d=p)}const m=[],g=" ".repeat(this.#e.gap);f&&m.push(Ae(Ae(f,this.#e.borderColor),this.#e.backgroundColor));let y;for(let x=0;x<this.#e.columns;x+=1){const j=t[n]?.[x]??void 0,R=o==="middle"&&s!==-1?t[s]?.[x]??void 0:void 0;let b,E=!1;if(j&&(x===0||t[n]?.[x-1]!==j)&&(b=j,E=!0),j&&!E)continue;if(!j){const _=i[x]??0;if(y=u>0?c.repeat(_):" ".repeat(_),m.push(Ae(Ae(y,this.#e.borderColor),this.#e.backgroundColor)),x<this.#e.columns-1){const O=this.determineJoinChar(o,t,n,s,x,x+1);m.push(g),O.width>0&&m.push(Ae(Ae(O.char,this.#e.borderColor),this.#e.backgroundColor))}continue}const h=b?.colSpan??1;if(o==="middle"&&o==="middle"&&R&&j===R&&b){const _=b.vAlign==="middle",{firstRow:O,lastRow:k}=this.getCachedCellVerticalPosition(t,n,x,b),C=k-O+1,B=C%2===0,J=O+Math.ceil(C/2)-1,q=js(i,x,h),X=this.alignCellContent(b,q),te=X.length;if(_&&B&&n===J)y=Ae(X[0]??"",this.#e.borderColor);else{let re=0;for(let M=O;M<=n;M+=1)re+=r[M]??1,M<n&&(re+=1);const I=re;if(I>=0&&I<te)y=Ae(X[I]??"",this.#e.foregroundColor);else{const M=i.slice(x,x+h).reduce((K,F)=>K+F,0)+(h-1)*(this.#e.gap+this.#e.border.bodyJoin.width);y=Ae(" ".repeat(M),this.#e.borderColor)}}m.push(Ae(y,this.#e.backgroundColor))}else{const _=[];for(let O=x;O<x+h;O+=1){const k=i[O]??0,C=u>0?c:" ";if(_.push(C.repeat(k+this.#e.gap)),O<x+h-1){const B=this.determineJoinChar(o,t,n,s,O,O+1);B.width>0&&_.push(B.char)}}y=_.join(""),m.push(Ae(Ae(y,this.#e.borderColor),this.#e.backgroundColor))}const A=x+h-1;if(A<this.#e.columns-1){const _=this.determineJoinChar(o,t,n,s,A,A+1);_.width>0&&m.push(Ae(Ae(_.char,this.#e.borderColor),this.#e.backgroundColor))}x+=h-1}return d&&m.push(Ae(Ae(d,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 E=Fr(a,t),h=r[n]?.[o]??void 0,A=s===-1?o+1:s,_=r[n]?.[A]??void 0,O=h!==void 0&&_!==void 0&&h===_?E.body:E.join,{char:k,width:C}=O;return{char:k,width:C>0?C:this.#e.gap}}if(i===-1||s===-1)return{char:" ",width:this.#e.gap};const l=a.bodyJoin,c=r[n]?.[o]??void 0,u=r[i]?.[o]??void 0,p=r[n]?.[s]??void 0,f=r[i]?.[s]??void 0,d=c!==void 0&&u!==void 0&&c===u,m=p!==void 0&&f!==void 0&&p===f,g=c!==void 0&&p!==void 0&&c===p,y=u!==void 0&&f!==void 0&&u===f;let x;const j=Fr(a,"middle");d&&m?x=g?{char:" ",width:l.width}:l:d?x=a.joinLeft:m?x=a.joinRight:g&&y?x=j.body:g?x=a.topJoin:y?x=a.bottomJoin:x=a.joinJoin;const{char:R,width:b}=x;return{char:R,width:b>0?b:this.#e.gap}}renderGrid(t,r){if(t.length===0)return"";const n=[],i=O4(t,r,this.#e,this.alignCellContent.bind(this),Hr),o=this.#e.showBorders&&this.#e.border?Fr(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 u=0;u<l;u+=1)n.push(this.renderVisualRowContent(t,a,u,r,i));const c=this.#e.showBorders&&this.#e.border?Fr(this.#e.border,"middle"):void 0;if(a<t.length-1&&c&&c.body.width>0){const u=t[a],p=t[a+1];let f=!1;if(u&&p)for(let d=0;d<this.#e.columns;d+=1){const m=u[d],g=p[d];if(m!==g){f=!0;break}}f&&n.push(this.renderHorizontalBorder(t,i,a,r,"middle",a+1))}}const s=this.#e.showBorders&&this.#e.border?Fr(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(`
189
- `)}getCachedCellVerticalPosition(t,r,n,i){const o=this.#r.get(i);if(o)return o;const s=gu(t,r,n,i);return this.#r.set(i,s),s}}oe(e=>new ml(e),"createGrid");const _4={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}},P4={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 C4=Object.defineProperty,df=v((e,t)=>C4(e,"name",{value:t,configurable:!0}),"y$1");const T4=df(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 N4=class{static{v(this,"v")}static{df(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:_4,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 p of n){const f=p;Array.isArray(f)?i=Math.max(i,T4(f)):console.error("Unexpected non-array element found while calculating columns:",f)}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 p=[...o];for(const f of n){const d=f;for(const[m,g]of d.entries()){let y={};if(typeof g=="object"&&g!==null&&!Array.isArray(g)){const{content:x,href:j,...R}=g;y=R}y.width!==void 0?p[m]=y.width:y.maxWidth!==void 0&&p[m]!==void 0&&(p[m]=Math.min(p[m],y.maxWidth))}}o=p}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(p=>typeof p=="number")||this.#e.maxWidth!==void 0&&!this.#e.balancedWidths),truncateOverflow:this.#e.truncateOverflow??!0,wordWrap:this.#e.wordWrap??!1},c=new ml(l),u=[];for(const[p,f]of n.entries()){const d=f;if(!Array.isArray(d)){console.error("Skipping non-array row while creating GridItems:",d);continue}const m=this.#e.showHeader?this.#t.length:0,g=this.#i.length,y=this.#e.showHeader&&p<m,x=this.#e.showFooter&&p>=m+g,j=y&&d.length===1&&i>1,R=x&&d.length===1&&i>1;for(const b of d){let E=b,h={};if(typeof E=="object"&&E!==null&&!Array.isArray(E)){const{content:k,href:C,...B}=E;E=C?`\x1B]8;;${C}\x1B\\${String(k)}\x1B]8;;\x1B\\`:k,h=B}j&&(h.colSpan=i),R&&(h.colSpan=i);const A=this.#e.transformTabToSpace&&typeof E=="string"?E.replaceAll(" "," ".repeat(this.#e.transformTabToSpace)):E,{maxWidth:_,width:O}=h;u.push({backgroundColor:h.backgroundColor,colSpan:h.colSpan,content:A,foregroundColor:h.foregroundColor,hAlign:h.hAlign,maxWidth:_,rowSpan:h.rowSpan,truncate:h.truncate??(_===void 0?void 0:!0),vAlign:h.vAlign,width:O,wordWrap:h.wordWrap})}}return c.addItems(u),this.#n=c.toString(),this.#r=!1,this.#n}};const I4=df(e=>new N4(e),"createTable");var M4=Object.defineProperty,jt=v((e,t)=>M4(e,"name",{value:t,configurable:!0}),"c$a");const D4=jt(e=>e.logger,"getLogger"),B4=/\{\s*"name"/,L4=s0(o0.exec);let b$=class extends Error{static{v(this,"D")}static{jt(this,"AttwReportedError")}};function y$(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}}v(y$,"te$1");jt(y$,"memo");const W4={bundler:"bundler",node10:"node10","node16-cjs":"node16 (from CJS)","node16-esm":"node16 (from ESM)"},F4={"":"",1:"(CJS)",99:"(ESM)"},fh={CJSOnlyExportsDefault:Yo,CJSResolvesToESM:Qr,FallbackCondition:Qr,FalseCJS:zr,FalseESM:zr,FalseExportDefault:Yo,InternalResolutionError:zr,MissingExportEquals:Yo,NamedExports:Qr,NoResolution:zr,UnexpectedModuleSyntax:zr,UntypedResolution:Qr},H4={esmOnly:["node10","node16-cjs"],node16:["node10"],strict:[]},q4=jt(e=>{if(e.startsWith("{"))return e;const t=B4.exec(e)?.index;if(t!==void 0)return e.slice(t);const r=e.indexOf("{");return r!==-1?e.slice(r):e},"fixPnpmStdout"),z4=jt(e=>{const t=e.split(`
190
- `);let r="[";for(const n of t)n&&(r+=`${n},`);return r.at(-1)===","&&(r=r.slice(0,-1)),r+="]",r},"fixYarnStdout"),G4=jt(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"),U4=jt((e,t,r)=>{const{allResolutionKinds:n,filterProblems:i,getResolutionOption:o,groupProblemsByKind:s,problemAffectsEntrypoint:a,problemAffectsResolutionKind:l,problemKindInfo:c}=r,u=n.filter(b=>!t.includes(b)),p=n.filter(b=>t.includes(b)),f=[...u,...p],d=Object.keys(e.entrypoints),m=d.map(b=>`"${b==="."?e.packageName:`${e.packageName}/${b.slice(2)}`}"`),g=d.map((b,E)=>{const h=e.problems.some(A=>a(A,b,e))?"redBright":"greenBright";return Ze[h](m[E])}),y=y$((b,E)=>{const h=t.includes(E)?"(ignored) ":"",A=s(i(e.problems,e,{entrypoint:b,resolutionKind:E})),_=e.entrypoints[b].resolutions[E],{resolution:O}=_,k=Object.keys(A);if(k.length>0)return k.map(q=>h+fh[q](c[q].shortDescription)).join(`
191
- `);const C="OK (JSON)",B=e.programInfo[o(E)].moduleKinds?.[O?.fileName??""]?.detectedKind??"",J=_.isWildcard?"(wildcard)":`OK ${F4[B]}`;return h+(O?.isJson?C:J)}),x=I4({style:{border:P4}});x.setHeaders(["",...f.map(b=>W4[b])]),g.forEach((b,E)=>{const[h,A,_,O]=f.map(k=>d.map(C=>y(C,k)));x.addRow([b,h[E]??null,A[E]??null,_[E]??null,O[E]??null])});const j=s(e.problems),R=Object.entries(j).map(([b,E])=>{const h=c[b],A=E.some(O=>u.some(k=>l(O,k,e))),_=`${`${h.description}${h.details?` Use \`-f json\` to see ${h.details}.`:""}`} ${h.docsUrl}`;return`${A?"":"(ignored per resolution) "}${fh[b](_)}`});return`Are the types wrong problems found:
192
-
193
- ${x.toString()}
194
-
195
- ${R.join(`
196
-
197
- `)}`},"buildProblemMessage"),K4=jt(async(e,t,r)=>{let n=`--pack-destination ${t}`;e==="yarn"?n=`--out "${le(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 L4(`${e} pack --json ${n}${i}`,{cwd:r,encoding:"utf8"})).stdout.trim();e==="pnpm"?o=q4(o):e==="yarn"&&(o=z4(o));const s=JSON.parse(o);if(!s?.filename)throw new Error(`Invalid npm pack output format: ${o}`);return s.filename},"packPackage"),J4=jt((e,t,r,n,i,o)=>{if(t.types!==!1&&t.problems.length>0){const s=U4(t,r,o);if(n==="error")throw e.error({message:s,prefix:"attw"}),new b$("attw reported types problems; see the log above.");e.warn({message:s,prefix:"attw"});return}e.success({message:wu(`No Are the types wrong problems found ${Ch`(${Math.round(performance.now()-i).toString()}ms)`}`),prefix:"attw"})},"reportAnalysis"),V4=jt(async(e,t)=>{if(!e.options?.validation)return;const{validation:r}=e.options;if(!r.attw)return;const n=D4(e),{packageJson:i}=pl(e.options.rootDir);e.pkg=i,t&&n.raw(`
198
- `),await ZR(e.pkg,["@arethetypeswrong/core","package-manager-detector"],"devDependencies",{logger:{warn:jt(b=>{n.warn({message:b,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 u=await Zh(le(Vh(),"packem-attw-"));let p;try{p=await import("@arethetypeswrong/core")}catch{n.error({message:`ATTW check requires ${Yo`@arethetypeswrong/core`} to be installed.`,prefix:"attw"});return}const f=await G4(s,e.options.rootDir);if(f===void 0)throw new Error("Could not detect a package manager to run the attw check.");const{allResolutionKinds:d,getResolutionOption:m,groupProblemsByKind:g}=await import("@arethetypeswrong/core/utils"),{filterProblems:y,problemAffectsEntrypoint:x,problemAffectsResolutionKind:j,problemKindInfo:R}=await import("@arethetypeswrong/core/problems");try{const b=await K4(f,u,e.options.rootDir),E=await us(b),h=p.createPackageFromTarballData(new Uint8Array(E)),A=await p.checkPackage(h,l),_=H4[a];J4(n,A,_,o,c,{allResolutionKinds:d,filterProblems:y,getResolutionOption:m,groupProblemsByKind:g,problemAffectsEntrypoint:x,problemAffectsResolutionKind:j,problemKindInfo:R})}catch(b){throw b instanceof b$||n.error({message:`ATTW check failed: ${b instanceof Error?b.message:String(b)}`,prefix:"attw"}),b}finally{await Ps(u,{force:!0,recursive:!0}).catch(()=>{})}},"attw");var X4=Object.defineProperty,$$=v((e,t)=>X4(e,"name",{value:t,configurable:!0}),"d$5");const dh=$$(e=>Array.from(e,t=>Qr(t)).join(", "),"joinWarnings"),Y4=$$(e=>{if(e.hoistedDependencies.size>0){const o=`These dependencies are shamefully hoisted: ${dh(e.hoistedDependencies)}`;be(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: ${dh(t)}`;be(e,o)}},"validateDependencies");var Q4=Object.defineProperty,Z4=v((e,t)=>Q4(e,"name",{value:t,configurable:!0}),"o$1");const mh=">=18.0.0",eD=Z4(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){be(e,`The 'engines.node' field is missing in your package.json. Consider adding "engines": { "node": "${mh}" } to specify Node.js version requirements.`);return}if(!$t.validRange(i)){be(e,`Invalid Node.js version range "${i}" in engines.node field. Please use a valid semver range like "${mh}".`);return}if(!$t.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 tD=Object.defineProperty,x$=v((e,t)=>tD(e,"name",{value:t,configurable:!0}),"i$2");const rD=x$((e,t)=>l0(e,t)<=e.length/3||t.includes(e),"isSimilar"),nD=x$((e,t)=>{const r=e.toLowerCase();return t.filter(n=>rD(n.toLowerCase(),r))},"findAlternatives");var iD=Object.defineProperty,zi=v((e,t)=>iD(e,"name",{value:t,configurable:!0}),"r$2");const oD=/\/[^*/]*\*[^\n\r/\u2028\u2029]*(?:[\n\r\u2028\u2029][^*/]*\*[^\n\r/\u2028\u2029]*)*(?:\/.*)?$/,sD=zi((e,t)=>{const{options:r}=e;return wp(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"),aD=zi((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"),lD=zi((e,t)=>{let r="Potential missing or wrong package.json files:";for(const n of e){const i=nD(n,t);r+=`
199
- - ${Pe(n)}${i.length>0?L$` (did you mean ${i.map(o=>`"${o}"`).join(", ")}?)`:""}`}return r},"buildMissingOutputsMessage"),cD=zi(e=>{const{options:t}=e,r=t.validation,{packageJson:n}=r;if(!n?.exports)return;const i=aD(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,...sD(e,o)].filter(Boolean).map(u=>u&&ve(t.rootDir,u.replace(oD,"")))),a=[];for(const u of s)u&&!u.includes("*")&&!Au(u)&&a.push(u.replace(`${t.rootDir}/`,""));const l=zi(u=>tt(t.rootDir,ve(t.outDir,u)),"rPath"),c=e.buildEntries.filter(u=>!u.chunk).map(u=>l(u.path));if(a.length>0){const u=lD(a,c);be(e,u)}},"validatePackageEntries");var uD=Object.defineProperty,ut=v((e,t)=>uD(e,"name",{value:t,configurable:!0}),"u$1");const pD=ut((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=ut((f,d)=>{if(f!==null){if(typeof f=="string"){if(!f.startsWith("./")){be(e,`Invalid exports path "${f}" at ${d}. Export paths must start with "./"`);return}if(f.includes("../")){be(e,`Invalid exports path "${f}" at ${d}. Export paths should not contain "../" for security reasons`);return}const m=r.packageJson?.allowedExportExtensions??[],g=[...bx,...m];if(Xc(f)){try{const y=f.startsWith("./")?ve(e.options.rootDir,f.slice(2)):ve(e.options.rootDir,f),x=Dg([y],{cwd:e.options.rootDir,dot:!1,ignore:["**/node_modules/**","**/.git/**","**/dist/**"]});if(x.length===0)return;const j=x.filter(R=>!g.some(b=>R.endsWith(b)));j.length>0&&be(e,`Export path "${f}" at ${d} matches files with invalid extensions: ${j.join(", ")}. Valid extensions are: ${g.join(", ")}`)}catch(y){be(e,`Could not validate glob pattern "${f}" at ${d}: ${y instanceof Error?y.message:"Unknown error"}`)}return}g.some(y=>f.endsWith(y))||be(e,`Export path "${f}" at ${d} should have a valid file extension (${g.join(", ")})`);return}if(Array.isArray(f)){if(f.length===0){be(e,`Empty fallback array at ${d}. Fallback arrays should contain at least one entry`);return}f.forEach((m,g)=>{l(m,`${d}[${String(g)}]`)});return}if(typeof f=="object"){const m=Object.keys(f);if(m.length===0){be(e,`Empty conditions object at ${d}. Conditional exports should define at least one condition`);return}const g=m.filter(x=>!a.has(x));if(g.length>0){const x=o.length>0,j=[...n].join(", ");x?be(e,`Unknown export conditions [${g.join(", ")}] at ${d}. Consider using standard conditions (${j}) or add custom conditions to 'validation.packageJson.extraConditions' in your packem config.`):be(e,`Unknown export conditions [${g.join(", ")}] at ${d}. Consider using standard conditions (${j}) or add custom conditions using the 'extraConditions' option in your validation config.`)}const y=m.filter(x=>n.has(x));if(y.length>1){const x=["node-addons","node","import","require","module-sync","default"],j=y,R=x.filter(b=>j.includes(b));JSON.stringify(j)!==JSON.stringify(R)&&be(e,`Incorrect condition order at ${d}. Standard conditions should be ordered: ${R.join(" > ")}`)}m.includes("import")&&m.includes("require"),m.includes("development")&&m.includes("production")&&be(e,`Conflicting conditions "development" and "production" at ${d}. These conditions are mutually exclusive`),m.forEach(x=>{l(f[x],`${d}.${x}`)});return}be(e,`Invalid exports value type at ${d}. Expected string, array, object, or null`)}},"validateExportsValue"),c=ut((f,d)=>{f.startsWith(".")&&!f.startsWith("./")&&f!=="."&&be(e,`Invalid subpath "${f}". Subpaths should start with "./" or be exactly "."`),f.includes("*")&&(f.match(/\*/g)??[]).length>1&&be(e,`Invalid subpath pattern "${f}". Only one "*" wildcard is allowed per subpath`),l(d[f],`exports["${f}"]`)},"validateSubpathKey"),u=ut((f,d,m)=>{const g=f.filter(x=>x!=="."),y=e.pkg.bin!==void 0&&g.length<=1&&g.every(x=>x==="./package.json");!d.includes(".")&&!y&&be(e,'Missing main export ".". Subpaths exports should include a main export entry');for(const x of d)c(x,m)},"validateSubpaths"),p=ut(f=>{const d=Object.keys(f);if(d.length===0){be(e,"Empty exports object. Define at least one export entry");return}const m=d.filter(y=>y.startsWith(".")),g=d.filter(y=>!y.startsWith("."));if(m.length>0&&g.length>0){be(e,'Mixed subpaths and conditions in exports object. Use either subpaths (keys starting with ".") or conditions, not both');return}m.length>0?u(m,d,f):l(f,"exports")},"validateExportsRecord");ut(f=>{if(typeof f=="string"){l(f,"exports");return}if(Array.isArray(f)){f.forEach((d,m)=>{l(d,`exports[${String(m)}]`)});return}if(typeof f=="object"&&f!==null){p(f);return}be(e,"Invalid exports field type. Expected string, array, or object")},"validateExportsObject")(t)},"validateExports"),fD=ut(({context:e,pkg:t,validation:r})=>{t.name===void 0&&r.packageJson?.name!==!1&&be(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?be(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))||be(e,`The 'files' field in your package.json is missing the '${e.options.outDir}' directory. Ensure the output directory is included.`))},"validateNameAndFiles"),dD=ut(({cjsJSExtension:e,context:t,esmJSExtension:r,pkg:n,validation:i})=>{i.packageJson?.main!==!1&&(n.main===void 0&&be(t,"The 'main' field is missing in your package.json. This field should point to your main entry file."),n.main?.endsWith(`.${r}`)&&be(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&&be(t,"The 'module' field is missing in your package.json, but you are emitting ES modules."),n.module&&n.main&&n.module===n.main&&be(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}`)&&be(t,`The 'module' field in your package.json should not use a '.${e}' extension for ES modules.`))},"validateCjsModuleFields"),mD=ut(({cjsJSExtension:e,context:t,pkg:r,validation:n})=>{n.packageJson?.main!==!1&&r.main===void 0&&be(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&&be(t,"The 'module' field is missing in your package.json. This field is necessary when emitting ES modules."),r.module?.endsWith(`.${e}`)&&be(t,`The 'module' field should not use a '.${e}' extension for ES modules.`),r.module&&r.main&&r.module===r.main&&be(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&&be(t,"The 'exports' field is missing in your package.json. This field is required for defining explicit exports.")},"validateEsmCjsEmitFields"),hD=ut(e=>{const{context:t,pkg:r,validation:n}=e;r.exports===void 0&&!t.options.emitCJS?n.packageJson?.exports!==!1&&be(t,"The 'exports' field is missing in your package.json. Define module exports explicitly."):t.options.emitCJS&&mD(e)},"validateEsmModuleFields"),gD=ut(({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}`))be(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}`)&&be(t,`The 'bin.${l}' field in your package.json should not use a .${s} extension for ${a} binaries.`)},"validateBinExtensionFields"),vD=ut(({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&&be(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})()&&be(t,"No 'typesVersions' field found in your package.json. Consider adding this field, or change the declaration option to 'node16' or 'false'.")},"validateDeclarationFields"),bD=ut(e=>{const t=e.options.validation,{pkg:r}=e,n=gt(e,"cjs"),i=gt(e,"esm"),o={cjsJSExtension:n,context:e,esmJSExtension:i,pkg:r,validation:t};fD(o);const s=r.type==="commonjs"||r.type===void 0,a=r.type==="module";s?dD(o):a&&hD(o),r.exports!==void 0&&pD(e,r.exports),gD(o,s),vD(o),t.packageJson?.sideEffects!==!1&&r.sideEffects===void 0&&be(e,"The 'sideEffects' field is missing in your package.json. Consider adding this field to your package.json.")},"validatePackageFields");var yD=Object.defineProperty,$D=v((e,t)=>yD(e,"name",{value:t,configurable:!0}),"o");const xD=$D(e=>{const{packageJson:t}=pl(e.options.rootDir);e.pkg=t,Y4(e),eD(e),bD(e),cD(e)},"validator");var wD=Object.defineProperty,w$=v((e,t)=>wD(e,"name",{value:t,configurable:!0}),"n$3");const ED=/^[^a-z_@#~]|[^\w/@#~-]|@\/|#\/|~\//i,SD=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"]),kD=w$((e,t)=>{if(e.trim()==="")throw new Error(`Alias name "${e}" is invalid. Alias names should be non-empty strings.`);if(ED.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(SD.has(e))throw new Error(`Alias name "${e}" is a reserved keyword and cannot be used.`);const r=ve(t);if(!Ft(r))throw new Error(`Target path "${r}" for alias "${e}" does not exist.`)},"validateAliasEntry"),hh=w$(e=>{if(Array.isArray(e))return;const t=e;for(const[r,n]of Object.entries(t))kD(r,n)},"validateAliasEntries");var Mc={},Dc,gh;function hl(){if(gh)return Dc;gh=1;const e="[^\\\\/]",t="(?=.)",r="[^/]",n="(?:\\/|$)",i="(?:^|\\/)",o=`\\.{1,2}${n}`,s="(?!\\.)",a=`(?!${i}${o})`,l=`(?!\\.{0,1}${n})`,c=`(?!${o})`,u="[^.\\/]",p=`${r}*?`,f="/",d={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:u,STAR:p,START_ANCHOR:i,SEP:f},m={...d,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:"\\"},g={__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 Dc={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:g,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(y){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${y.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(y){return y===!0?m:d}},Dc}v(hl,"requireConstants");var vh;function gl(){return vh||(vh=1,(function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:r,REGEX_SPECIAL_CHARS:n,REGEX_SPECIAL_CHARS_GLOBAL:i}=hl();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 u=`${l}(?:${o})${c}`;return s.negated===!0&&(u=`(?:^(?!${u}).*$)`),u},e.basename=(o,{windows:s}={})=>{const a=o.split(s?/[\\/]/:"/"),l=a[a.length-1];return l===""?a[a.length-2]:l}})(Mc)),Mc}v(gl,"requireUtils");var Bc,bh;function jD(){if(bh)return Bc;bh=1;var e=Object.defineProperty,t=v((E,h)=>e(E,"name",{value:h,configurable:!0}),"k");const r=gl(),{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:u,CHAR_LEFT_PARENTHESES:p,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:d,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:g,CHAR_RIGHT_PARENTHESES:y,CHAR_RIGHT_SQUARE_BRACKET:x}=hl(),j=t(E=>E===c||E===o,"isPathSeparator"),R=t(E=>{E.isPrefix!==!0&&(E.depth=E.isGlobstar?1/0:1)},"depth");return Bc=t((E,h)=>{const A=h||{},_=E.length-1,O=A.parts===!0||A.scanToEnd===!0,k=[],C=[],B=[];let J=E,q=-1,X=0,te=0,re=!1,I=!1,M=!1,K=!1,F=!1,N=!1,W=!1,V=!1,U=!1,z=!1,Y=0,L,D,$={value:"",depth:0,isGlob:!1};const ge=t(()=>q>=_,"eos"),pe=t(()=>J.charCodeAt(q+1),"peek"),se=t(()=>(L=D,J.charCodeAt(++q)),"advance");for(;q<_;){D=se();let ie;if(D===o){W=$.backslashes=!0,D=se(),D===u&&(N=!0);continue}if(N===!0||D===u){for(Y++;ge()!==!0&&(D=se());){if(D===o){W=$.backslashes=!0,se();continue}if(D===u){Y++;continue}if(N!==!0&&D===a&&(D=se())===a){if(re=$.isBrace=!0,M=$.isGlob=!0,z=!0,O===!0)continue;break}if(N!==!0&&D===s){if(re=$.isBrace=!0,M=$.isGlob=!0,z=!0,O===!0)continue;break}if(D===g&&(Y--,Y===0)){N=!1,re=$.isBrace=!0,z=!0;break}}if(O===!0)continue;break}if(D===c){if(k.push(q),C.push($),$={value:"",depth:0,isGlob:!1},z===!0)continue;if(L===a&&q===X+1){X+=2;continue}te=q+1;continue}if(A.noext!==!0&&(D===d||D===i||D===n||D===m||D===l)&&pe()===p){if(M=$.isGlob=!0,K=$.isExtglob=!0,z=!0,D===l&&q===X&&(U=!0),O===!0){for(;ge()!==!0&&(D=se());){if(D===o){W=$.backslashes=!0,D=se();continue}if(D===y){M=$.isGlob=!0,z=!0;break}}continue}break}if(D===n){if(L===n&&(F=$.isGlobstar=!0),M=$.isGlob=!0,z=!0,O===!0)continue;break}if(D===m){if(M=$.isGlob=!0,z=!0,O===!0)continue;break}if(D===f){for(;ge()!==!0&&(ie=se());){if(ie===o){W=$.backslashes=!0,se();continue}if(ie===x){I=$.isBracket=!0,M=$.isGlob=!0,z=!0;break}}if(O===!0)continue;break}if(A.nonegate!==!0&&D===l&&q===X){V=$.negated=!0,X++;continue}if(A.noparen!==!0&&D===p){if(M=$.isGlob=!0,O===!0){for(;ge()!==!0&&(D=se());){if(D===p){W=$.backslashes=!0,D=se();continue}if(D===y){z=!0;break}}continue}break}if(M===!0){if(z=!0,O===!0)continue;break}}A.noext===!0&&(K=!1,M=!1);let w=J,S="",we="";X>0&&(S=J.slice(0,X),J=J.slice(X),te-=X),w&&M===!0&&te>0?(w=J.slice(0,te),we=J.slice(te)):M===!0?(w="",we=J):w=J,w&&w!==""&&w!=="/"&&w!==J&&j(w.charCodeAt(w.length-1))&&(w=w.slice(0,-1)),A.unescape===!0&&(we&&(we=r.removeBackslashes(we)),w&&W===!0&&(w=r.removeBackslashes(w)));const Q={prefix:S,input:E,start:X,base:w,glob:we,isBrace:re,isBracket:I,isGlob:M,isExtglob:K,isGlobstar:F,negated:V,negatedExtglob:U};if(A.tokens===!0&&(Q.maxDepth=0,j(D)||C.push($),Q.tokens=C),A.parts===!0||A.tokens===!0){let ie;for(let ye=0;ye<k.length;ye++){const $e=ie?ie+1:X,Te=k[ye],Bt=E.slice($e,Te);A.tokens&&(ye===0&&X!==0?(C[ye].isPrefix=!0,C[ye].value=S):C[ye].value=Bt,R(C[ye]),Q.maxDepth+=C[ye].depth),(ye!==0||Bt!=="")&&B.push(Bt),ie=Te}if(ie&&ie+1<E.length){const ye=E.slice(ie+1);B.push(ye),A.tokens&&(C[C.length-1].value=ye,R(C[C.length-1]),Q.maxDepth+=C[C.length-1].depth)}Q.slashes=k,Q.parts=B}return Q},"scan"),Bc}v(jD,"requireScan");var Lc,yh;function AD(){if(yh)return Lc;yh=1;var e=Object.defineProperty,t=v((b,E)=>e(b,"name",{value:E,configurable:!0}),"y");const r=hl(),n=gl(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:o,REGEX_NON_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_BACKREF:a,REPLACEMENTS:l}=r,c=t((b,E)=>typeof E.expandRange=="function"?E.expandRange(...b,E):(b.sort(),`[${b.join("-")}]`),"expandRange"),u=t((b,E)=>`Missing ${b}: "${E}" - use "\\\\${E}" to match literal characters`,"syntaxError"),p=t(b=>{const E=[];let h=0,A=0,_=0,O="",k=!1;for(const C of b){if(k===!0){O+=C,k=!1;continue}if(C==="\\"){O+=C,k=!0;continue}if(C==='"'){_=_===1?0:1,O+=C;continue}if(_===0){if(C==="[")h++;else if(C==="]"&&h>0)h--;else if(h===0){if(C==="(")A++;else if(C===")"&&A>0)A--;else if(C==="|"&&A===0){E.push(O),O="";continue}}}O+=C}return E.push(O),E},"splitTopLevel"),f=t(b=>{let E=!1;for(const h of b){if(E===!0){E=!1;continue}if(h==="\\"){E=!0;continue}if(/[?*+@!()[\]{}]/.test(h))return!1}return!0},"isPlainBranch"),d=t(b=>{let E=b.trim(),h=!0;for(;h===!0;)h=!1,/^@\([^\\()[\]{}|]+\)$/.test(E)&&(E=E.slice(2,-1),h=!0);if(f(E))return E.replace(/\\(.)/g,"$1")},"normalizeSimpleBranch"),m=t(b=>{const E=b.map(d).filter(Boolean);for(let h=0;h<E.length;h++)for(let A=h+1;A<E.length;A++){const _=E[h],O=E[A],k=_[0];if(!(!k||_!==k.repeat(_.length)||O!==k.repeat(O.length))&&(_===O||_.startsWith(O)||O.startsWith(_)))return!0}return!1},"hasRepeatedCharPrefixOverlap"),g=t((b,E=!0)=>{if(b[0]!=="+"&&b[0]!=="*"||b[1]!=="(")return;let h=0,A=0,_=0,O=!1;for(let k=1;k<b.length;k++){const C=b[k];if(O===!0){O=!1;continue}if(C==="\\"){O=!0;continue}if(C==='"'){_=_===1?0:1;continue}if(_!==1){if(C==="["){h++;continue}if(C==="]"&&h>0){h--;continue}if(!(h>0)){if(C==="("){A++;continue}if(C===")"&&(A--,A===0))return E===!0&&k!==b.length-1?void 0:{type:b[0],body:b.slice(2,k),end:k}}}}},"parseRepeatedExtglob"),y=t(b=>{let E=0;const h=[];for(;E<b.length;){const A=g(b.slice(E),!1);if(!A||A.type!=="*")return;const _=p(A.body).map(k=>k.trim());if(_.length!==1)return;const O=d(_[0]);if(!O||O.length!==1)return;h.push(O),E+=A.end+1}return h.length<1?void 0:`${h.length===1?n.escapeRegex(h[0]):`[${h.map(A=>n.escapeRegex(A)).join("")}]`}*`},"getStarExtglobSequenceOutput"),x=t(b=>{let E=0,h=b.trim(),A=g(h);for(;A;)E++,h=A.body.trim(),A=g(h);return E},"repeatedExtglobRecursion"),j=t((b,E)=>{if(E.maxExtglobRecursion===!1)return{risky:!1};const h=typeof E.maxExtglobRecursion=="number"?E.maxExtglobRecursion:r.DEFAULT_MAX_EXTGLOB_RECURSION,A=p(b).map(_=>_.trim());if(A.length>1&&(A.some(_=>_==="")||A.some(_=>/^[*?]+$/.test(_))||m(A)))return{risky:!0};for(const _ of A){const O=y(_);if(O)return{risky:!0,safeOutput:O};if(x(_)>h)return{risky:!0}}return{risky:!1}},"analyzeRepeatedExtglob"),R=t((b,E)=>{if(typeof b!="string")throw new TypeError("Expected a string");b=l[b]||b;const h={...E},A=typeof h.maxLength=="number"?Math.min(i,h.maxLength):i;let _=b.length;if(_>A)throw new SyntaxError(`Input length: ${_}, exceeds maximum allowed length: ${A}`);const O={type:"bos",value:"",output:h.prepend||""},k=[O],C=h.capture?"":"?:",B=r.globChars(h.windows),J=r.extglobChars(B),{DOT_LITERAL:q,PLUS_LITERAL:X,SLASH_LITERAL:te,ONE_CHAR:re,DOTS_SLASH:I,NO_DOT:M,NO_DOT_SLASH:K,NO_DOTS_SLASH:F,QMARK:N,QMARK_NO_DOT:W,STAR:V,START_ANCHOR:U}=B,z=t(T=>`(${C}(?:(?!${U}${T.dot?I:q}).)*?)`,"globstar"),Y=h.dot?"":M,L=h.dot?N:W;let D=h.bash===!0?z(h):V;h.capture&&(D=`(${D})`),typeof h.noext=="boolean"&&(h.noextglob=h.noext);const $={input:b,index:-1,start:0,dot:h.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:k};b=n.removePrefix(b,$),_=b.length;const ge=[],pe=[],se=[];let w=O,S;const we=t(()=>$.index===_-1,"eos"),Q=$.peek=(T=1)=>b[$.index+T],ie=$.advance=()=>b[++$.index]||"",ye=t(()=>b.slice($.index+1),"remaining"),$e=t((T="",ee=0)=>{$.consumed+=T,$.index+=ee},"consume"),Te=t(T=>{$.output+=T.output!=null?T.output:T.value,$e(T.value)},"append"),Bt=t(()=>{let T=1;for(;Q()==="!"&&(Q(2)!=="("||Q(3)==="?");)ie(),$.start++,T++;return T%2===0?!1:($.negated=!0,$.start++,!0)},"negate"),it=t(T=>{$[T]++,se.push(T)},"increment"),_e=t(T=>{$[T]--,se.pop()},"decrement"),H=t(T=>{if(w.type==="globstar"){const ee=$.braces>0&&(T.type==="comma"||T.type==="brace"),P=T.extglob===!0||ge.length&&(T.type==="pipe"||T.type==="paren");T.type!=="slash"&&T.type!=="paren"&&!ee&&!P&&($.output=$.output.slice(0,-w.output.length),w.type="star",w.value="*",w.output=D,$.output+=w.output)}if(ge.length&&T.type!=="paren"&&(ge[ge.length-1].inner+=T.value),(T.value||T.output)&&Te(T),w&&w.type==="text"&&T.type==="text"){w.output=(w.output||w.value)+T.value,w.value+=T.value;return}T.prev=w,k.push(T),w=T},"push"),ot=t((T,ee)=>{const P={...J[ee],conditions:1,inner:""};P.prev=w,P.parens=$.parens,P.output=$.output,P.startIndex=$.index,P.tokensIndex=k.length;const G=(h.capture?"(":"")+P.open;it("parens"),H({type:T,value:ee,output:$.output?"":re}),H({type:"paren",extglob:!0,value:ie(),output:G}),ge.push(P)},"extglobOpen"),qn=t(T=>{const ee=b.slice(T.startIndex,$.index+1),P=b.slice(T.startIndex+2,$.index),G=j(P,h);if((T.type==="plus"||T.type==="star")&&G.risky){const Z=G.safeOutput?(T.output?"":re)+(h.capture?`(${G.safeOutput})`:G.safeOutput):void 0,Se=k[T.tokensIndex];Se.type="text",Se.value=ee,Se.output=Z||n.escapeRegex(ee);for(let ke=T.tokensIndex+1;ke<k.length;ke++)k[ke].value="",k[ke].output="",delete k[ke].suffix;$.output=T.output+Se.output,$.backtrack=!0,H({type:"paren",extglob:!0,value:S,output:""}),_e("parens");return}let ne=T.close+(h.capture?")":""),ae;if(T.type==="negate"){let Z=D;if(T.inner&&T.inner.length>1&&T.inner.includes("/")&&(Z=z(h)),(Z!==D||we()||/^\)+$/.test(ye()))&&(ne=T.close=`)$))${Z}`),T.inner.includes("*")&&(ae=ye())&&/^\.[^\\/.]+$/.test(ae)){const Se=R(ae,{...E,fastpaths:!1}).output;ne=T.close=`)${Se})${Z})`}T.prev.type==="bos"&&($.negatedExtglob=!0)}H({type:"paren",extglob:!0,value:S,output:ne}),_e("parens")},"extglobClose");if(h.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(b)){let T=!1,ee=b.replace(a,(P,G,ne,ae,Z,Se)=>ae==="\\"?(T=!0,P):ae==="?"?G?G+ae+(Z?N.repeat(Z.length):""):Se===0?L+(Z?N.repeat(Z.length):""):N.repeat(ne.length):ae==="."?q.repeat(ne.length):ae==="*"?G?G+ae+(Z?D:""):D:G?P:`\\${P}`);return T===!0&&(h.unescape===!0?ee=ee.replace(/\\/g,""):ee=ee.replace(/\\+/g,P=>P.length%2===0?"\\\\":P?"\\":"")),ee===b&&h.contains===!0?($.output=b,$):($.output=n.wrapOutput(ee,$,E),$)}for(;!we();){if(S=ie(),S==="\0")continue;if(S==="\\"){const P=Q();if(P==="/"&&h.bash!==!0||P==="."||P===";")continue;if(!P){S+="\\",H({type:"text",value:S});continue}const G=/^\\+/.exec(ye());let ne=0;if(G&&G[0].length>2&&(ne=G[0].length,$.index+=ne,ne%2!==0&&(S+="\\")),h.unescape===!0?S=ie():S+=ie(),$.brackets===0){H({type:"text",value:S});continue}}if($.brackets>0&&(S!=="]"||w.value==="["||w.value==="[^")){if(h.posix!==!1&&S===":"){const P=w.value.slice(1);if(P.includes("[")&&(w.posix=!0,P.includes(":"))){const G=w.value.lastIndexOf("["),ne=w.value.slice(0,G),ae=w.value.slice(G+2),Z=o[ae];if(Z){w.value=ne+Z,$.backtrack=!0,ie(),!O.output&&k.indexOf(w)===1&&(O.output=re);continue}}}(S==="["&&Q()!==":"||S==="-"&&Q()==="]")&&(S=`\\${S}`),S==="]"&&(w.value==="["||w.value==="[^")&&(S=`\\${S}`),h.posix===!0&&S==="!"&&w.value==="["&&(S="^"),w.value+=S,Te({value:S});continue}if($.quotes===1&&S!=='"'){S=n.escapeRegex(S),w.value+=S,Te({value:S});continue}if(S==='"'){$.quotes=$.quotes===1?0:1,h.keepQuotes===!0&&H({type:"text",value:S});continue}if(S==="("){it("parens"),H({type:"paren",value:S});continue}if(S===")"){if($.parens===0&&h.strictBrackets===!0)throw new SyntaxError(u("opening","("));const P=ge[ge.length-1];if(P&&$.parens===P.parens+1){qn(ge.pop());continue}H({type:"paren",value:S,output:$.parens?")":"\\)"}),_e("parens");continue}if(S==="["){if(h.nobracket===!0||!ye().includes("]")){if(h.nobracket!==!0&&h.strictBrackets===!0)throw new SyntaxError(u("closing","]"));S=`\\${S}`}else it("brackets");H({type:"bracket",value:S});continue}if(S==="]"){if(h.nobracket===!0||w&&w.type==="bracket"&&w.value.length===1){H({type:"text",value:S,output:`\\${S}`});continue}if($.brackets===0){if(h.strictBrackets===!0)throw new SyntaxError(u("opening","["));H({type:"text",value:S,output:`\\${S}`});continue}_e("brackets");const P=w.value.slice(1);if(w.posix!==!0&&P[0]==="^"&&!P.includes("/")&&(S=`/${S}`),w.value+=S,Te({value:S}),h.literalBrackets===!1||n.hasRegexChars(P))continue;const G=n.escapeRegex(w.value);if($.output=$.output.slice(0,-w.value.length),h.literalBrackets===!0){$.output+=G,w.value=G;continue}w.value=`(${C}${G}|${w.value})`,$.output+=w.value;continue}if(S==="{"&&h.nobrace!==!0){it("braces");const P={type:"brace",value:S,output:"(",outputIndex:$.output.length,tokensIndex:$.tokens.length};pe.push(P),H(P);continue}if(S==="}"){const P=pe[pe.length-1];if(h.nobrace===!0||!P){H({type:"text",value:S,output:S});continue}let G=")";if(P.dots===!0){const ne=k.slice(),ae=[];for(let Z=ne.length-1;Z>=0&&(k.pop(),ne[Z].type!=="brace");Z--)ne[Z].type!=="dots"&&ae.unshift(ne[Z].value);G=c(ae,h),$.backtrack=!0}if(P.comma!==!0&&P.dots!==!0){const ne=$.output.slice(0,P.outputIndex),ae=$.tokens.slice(P.tokensIndex);P.value=P.output="\\{",S=G="\\}",$.output=ne;for(const Z of ae)$.output+=Z.output||Z.value}H({type:"brace",value:S,output:G}),_e("braces"),pe.pop();continue}if(S==="|"){ge.length>0&&ge[ge.length-1].conditions++,H({type:"text",value:S});continue}if(S===","){let P=S;const G=pe[pe.length-1];G&&se[se.length-1]==="braces"&&(G.comma=!0,P="|"),H({type:"comma",value:S,output:P});continue}if(S==="/"){if(w.type==="dot"&&$.index===$.start+1){$.start=$.index+1,$.consumed="",$.output="",k.pop(),w=O;continue}H({type:"slash",value:S,output:te});continue}if(S==="."){if($.braces>0&&w.type==="dot"){w.value==="."&&(w.output=q);const P=pe[pe.length-1];w.type="dots",w.output+=S,w.value+=S,P.dots=!0;continue}if($.braces+$.parens===0&&w.type!=="bos"&&w.type!=="slash"){H({type:"text",value:S,output:q});continue}H({type:"dot",value:S,output:q});continue}if(S==="?"){if(!(w&&w.value==="(")&&h.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){ot("qmark",S);continue}if(w&&w.type==="paren"){const P=Q();let G=S;(w.value==="("&&!/[!=<:]/.test(P)||P==="<"&&!/<([!=]|\w+>)/.test(ye()))&&(G=`\\${S}`),H({type:"text",value:S,output:G});continue}if(h.dot!==!0&&(w.type==="slash"||w.type==="bos")){H({type:"qmark",value:S,output:W});continue}H({type:"qmark",value:S,output:N});continue}if(S==="!"){if(h.noextglob!==!0&&Q()==="("&&(Q(2)!=="?"||!/[!=<:]/.test(Q(3)))){ot("negate",S);continue}if(h.nonegate!==!0&&$.index===0){Bt();continue}}if(S==="+"){if(h.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){ot("plus",S);continue}if(w&&w.value==="("||h.regex===!1){H({type:"plus",value:S,output:X});continue}if(w&&(w.type==="bracket"||w.type==="paren"||w.type==="brace")||$.parens>0){H({type:"plus",value:S});continue}H({type:"plus",value:X});continue}if(S==="@"){if(h.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){H({type:"at",extglob:!0,value:S,output:""});continue}H({type:"text",value:S});continue}if(S!=="*"){(S==="$"||S==="^")&&(S=`\\${S}`);const P=s.exec(ye());P&&(S+=P[0],$.index+=P[0].length),H({type:"text",value:S});continue}if(w&&(w.type==="globstar"||w.star===!0)){w.type="star",w.star=!0,w.value+=S,w.output=D,$.backtrack=!0,$.globstar=!0,$e(S);continue}let T=ye();if(h.noextglob!==!0&&/^\([^?]/.test(T)){ot("star",S);continue}if(w.type==="star"){if(h.noglobstar===!0){$e(S);continue}const P=w.prev,G=P.prev,ne=P.type==="slash"||P.type==="bos",ae=G&&(G.type==="star"||G.type==="globstar");if(h.bash===!0&&(!ne||T[0]&&T[0]!=="/")){H({type:"star",value:S,output:""});continue}const Z=$.braces>0&&(P.type==="comma"||P.type==="brace"),Se=ge.length&&(P.type==="pipe"||P.type==="paren");if(!ne&&P.type!=="paren"&&!Z&&!Se){H({type:"star",value:S,output:""});continue}for(;T.slice(0,3)==="/**";){const ke=b[$.index+4];if(ke&&ke!=="/")break;T=T.slice(3),$e("/**",3)}if(P.type==="bos"&&we()){w.type="globstar",w.value+=S,w.output=z(h),$.output=w.output,$.globstar=!0,$e(S);continue}if(P.type==="slash"&&P.prev.type!=="bos"&&!ae&&we()){$.output=$.output.slice(0,-(P.output+w.output).length),P.output=`(?:${P.output}`,w.type="globstar",w.output=z(h)+(h.strictSlashes?")":"|$)"),w.value+=S,$.globstar=!0,$.output+=P.output+w.output,$e(S);continue}if(P.type==="slash"&&P.prev.type!=="bos"&&T[0]==="/"){const ke=T[1]!==void 0?"|$":"";$.output=$.output.slice(0,-(P.output+w.output).length),P.output=`(?:${P.output}`,w.type="globstar",w.output=`${z(h)}${te}|${te}${ke})`,w.value+=S,$.output+=P.output+w.output,$.globstar=!0,$e(S+ie()),H({type:"slash",value:"/",output:""});continue}if(P.type==="bos"&&T[0]==="/"){w.type="globstar",w.value+=S,w.output=`(?:^|${te}|${z(h)}${te})`,$.output=w.output,$.globstar=!0,$e(S+ie()),H({type:"slash",value:"/",output:""});continue}$.output=$.output.slice(0,-w.output.length),w.type="globstar",w.output=z(h),w.value+=S,$.output+=w.output,$.globstar=!0,$e(S);continue}const ee={type:"star",value:S,output:D};if(h.bash===!0){ee.output=".*?",(w.type==="bos"||w.type==="slash")&&(ee.output=Y+ee.output),H(ee);continue}if(w&&(w.type==="bracket"||w.type==="paren")&&h.regex===!0){ee.output=S,H(ee);continue}($.index===$.start||w.type==="slash"||w.type==="dot")&&(w.type==="dot"?($.output+=K,w.output+=K):h.dot===!0?($.output+=F,w.output+=F):($.output+=Y,w.output+=Y),Q()!=="*"&&($.output+=re,w.output+=re)),H(ee)}for(;$.brackets>0;){if(h.strictBrackets===!0)throw new SyntaxError(u("closing","]"));$.output=n.escapeLast($.output,"["),_e("brackets")}for(;$.parens>0;){if(h.strictBrackets===!0)throw new SyntaxError(u("closing",")"));$.output=n.escapeLast($.output,"("),_e("parens")}for(;$.braces>0;){if(h.strictBrackets===!0)throw new SyntaxError(u("closing","}"));$.output=n.escapeLast($.output,"{"),_e("braces")}if(h.strictSlashes!==!0&&(w.type==="star"||w.type==="bracket")&&H({type:"maybe_slash",value:"",output:`${te}?`}),$.backtrack===!0){$.output="";for(const T of $.tokens)$.output+=T.output!=null?T.output:T.value,T.suffix&&($.output+=T.suffix)}return $},"parse");return R.fastpaths=(b,E)=>{const h={...E},A=typeof h.maxLength=="number"?Math.min(i,h.maxLength):i,_=b.length;if(_>A)throw new SyntaxError(`Input length: ${_}, exceeds maximum allowed length: ${A}`);b=l[b]||b;const{DOT_LITERAL:O,SLASH_LITERAL:k,ONE_CHAR:C,DOTS_SLASH:B,NO_DOT:J,NO_DOTS:q,NO_DOTS_SLASH:X,STAR:te,START_ANCHOR:re}=r.globChars(h.windows),I=h.dot?q:J,M=h.dot?X:J,K=h.capture?"":"?:",F={negated:!1,prefix:""};let N=h.bash===!0?".*?":te;h.capture&&(N=`(${N})`);const W=t(Y=>Y.noglobstar===!0?N:`(${K}(?:(?!${re}${Y.dot?B:O}).)*?)`,"globstar"),V=t(Y=>{switch(Y){case"*":return`${I}${C}${N}`;case".*":return`${O}${C}${N}`;case"*.*":return`${I}${N}${O}${C}${N}`;case"*/*":return`${I}${N}${k}${C}${M}${N}`;case"**":return I+W(h);case"**/*":return`(?:${I}${W(h)}${k})?${M}${C}${N}`;case"**/*.*":return`(?:${I}${W(h)}${k})?${M}${N}${O}${C}${N}`;case"**/.*":return`(?:${I}${W(h)}${k})?${O}${C}${N}`;default:{const L=/^(.*?)\.(\w+)$/.exec(Y);if(!L)return;const D=V(L[1]);return D?D+O+L[2]:void 0}}},"create"),U=n.removePrefix(b,F);let z=V(U);return z&&h.strictSlashes!==!0&&(z+=`${k}?`),z},Lc=R,Lc}v(AD,"requireParse");var Wc,$h;function OD(){if($h)return Wc;$h=1;var e=Object.defineProperty,t=v((l,c)=>e(l,"name",{value:c,configurable:!0}),"h");const r=jD(),n=AD(),i=gl(),o=hl(),s=t(l=>l&&typeof l=="object"&&!Array.isArray(l),"isObject"),a=t((l,c,u=!1)=>{if(Array.isArray(l)){const j=l.map(R=>a(R,c,u));return t(R=>{for(const b of j){const E=b(R);if(E)return E}return!1},"arrayMatcher")}const p=s(l)&&l.tokens&&l.input;if(l===""||typeof l!="string"&&!p)throw new TypeError("Expected pattern to be a non-empty string");const f=c||{},d=f.windows,m=p?a.compileRe(l,c):a.makeRe(l,c,!1,!0),g=m.state;delete m.state;let y=t(()=>!1,"isIgnored");if(f.ignore){const j={...c,ignore:null,onMatch:null,onResult:null};y=a(f.ignore,j,u)}const x=t((j,R=!1)=>{const{isMatch:b,match:E,output:h}=a.test(j,m,c,{glob:l,posix:d}),A={glob:l,state:g,regex:m,posix:d,input:j,output:h,match:E,isMatch:b};return typeof f.onResult=="function"&&f.onResult(A),b===!1?(A.isMatch=!1,R?A:!1):y(j)?(typeof f.onIgnore=="function"&&f.onIgnore(A),A.isMatch=!1,R?A:!1):(typeof f.onMatch=="function"&&f.onMatch(A),R?A:!0)},"matcher");return u&&(x.state=g),x},"picomatch");return a.test=(l,c,u,{glob:p,posix:f}={})=>{if(typeof l!="string")throw new TypeError("Expected input to be a string");if(l==="")return{isMatch:!1,output:""};const d=u||{},m=d.format||(f?i.toPosixSlashes:null);let g=l===p,y=g&&m?m(l):l;return g===!1&&(y=m?m(l):l,g=y===p),(g===!1||d.capture===!0)&&(d.matchBase===!0||d.basename===!0?g=a.matchBase(l,c,u,f):g=c.exec(y)),{isMatch:!!g,match:g,output:y}},a.matchBase=(l,c,u)=>(c instanceof RegExp?c:a.makeRe(c,u)).test(i.basename(l)),a.isMatch=(l,c,u)=>a(c,u)(l),a.parse=(l,c)=>Array.isArray(l)?l.map(u=>a.parse(u,c)):n(l,{...c,fastpaths:!1}),a.scan=(l,c)=>r(l,c),a.compileRe=(l,c,u=!1,p=!1)=>{if(u===!0)return l.output;const f=c||{},d=f.contains?"":"^",m=f.contains?"":"$";let g=`${d}(?:${l.output})${m}`;l&&l.negated===!0&&(g=`^(?!${g}).*$`);const y=a.toRegex(g,c);return p===!0&&(y.state=l),y},a.makeRe=(l,c={},u=!1,p=!1)=>{if(!l||typeof l!="string")throw new TypeError("Expected a non-empty string");let f={negated:!1,fastpaths:!0};return c.fastpaths!==!1&&(l[0]==="."||l[0]==="*")&&(f.output=n.fastpaths(l,c)),f.output||(f=n(l,c)),a.compileRe(f,c,u,p)},a.toRegex=(l,c)=>{try{const u=c||{};return new RegExp(l,u.flags||(u.nocase?"i":""))}catch(u){if(c&&c.debug===!0)throw u;return/$^/}},a.constants=o,Wc=a,Wc}v(OD,"requirePicomatch$1");var Fc,xh;function RD(){if(xh)return Fc;xh=1;var e=Object.defineProperty,t=v((o,s)=>e(o,"name",{value:s,configurable:!0}),"c");const r=OD(),n=gl();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 v(i,"picomatch"),t(i,"picomatch"),Object.assign(i,r),Fc=i,Fc}v(RD,"requirePicomatch");var _D=RD();const PD=Rs(_D);var CD=Object.defineProperty,Fn=v((e,t)=>CD(e,"name",{value:t,configurable:!0}),"m$2");const TD=Fn(e=>e.logger,"getLogger"),bu="Validation: File Size",E$=Fn(e=>typeof e=="string"?_P(e):e,"resolveLimit"),S$=Fn((e,t,r,n,i)=>{if(r){i&&e.raw(`
200
- `),e.warn({message:t,prefix:"validation:file-size"});return}be(n,t)},"emitMessage"),ND=Fn((e,t,r,n,i)=>{for(const[o,s]of Object.entries(r)){const a=E$(s);if(!Number.isFinite(a)||a<=0){t.debug({message:`Invalid limit for ${o}: ${String(s)}`,prefix:bu});continue}const l=e.buildEntries.find(c=>{const u=o.replace(new RegExp(`^.?/?${e.options.outDir}/?`),"");return c.path.endsWith(u)||PD(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:bu});continue}if(l.size.bytes>a){const c=`File size exceeds the limit: ${le(e.options.outDir,l.path)} (${Qe(l.size.bytes)} / ${Qe(a,{decimals:2})})`;S$(t,c,n,e,i)}}},"checkPerFileLimits"),ID=Fn((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=E$(r);if(!Number.isFinite(s)||s<=0){t.debug({message:`Invalid total limit: ${String(r)}`,prefix:bu});return}if(o>s){const a=`Total file size exceeds the limit: ${Qe(o)} / ${Qe(s,{decimals:2})}`;S$(t,a,n,e,i)}},"checkTotalLimit"),MD=Fn((e,t)=>{const r=e.options.validation,{allowFail:n=!1,limit:i,limits:o={}}=r.bundleLimit??{},s=TD(e);ND(e,s,o,n,t),i&&ID(e,s,i,n,t&&Object.keys(o).length===0)},"validateBundleSize");var DD=Object.defineProperty,Ri=v((e,t)=>DD(e,"name",{value:t,configurable:!0}),"r$1");const wh="rollup-dts.json",BD=Ri(e=>e.logger,"getLogger"),Eh="__packem_skip__/",Sh=Ri((e,t)=>{const r=new Set;if(t.options.emitCJS&&r.add(Tt(t,"cjs")),t.options.emitESM&&r.add(Tt(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"),LD=Ri(async(e,t,r)=>{const n=await zy(e,t);if(await e.hooks.callHook("rollup:dts:options",e,n),Object.keys(n.input??{}).length===0)return;n.cache=t.get(wh,r);const i=await(await nf())(n);try{t.set(wh,i.cache,r),await e.hooks.callHook("rollup:dts:build",e,i),BD(e).info({message:"Building declaration files...",prefix:"dts"});const o=new Map;for(const c of e.options.entries)c.name&&o.set(c.name,c);const s=new Set;for(const c of e.options.entries)for(const u of Sh(c,e))s.add(u);const a=ve(e.options.rootDir,e.options.outDir),l={generateBundle(c,u){for(const p of Object.keys(u))p.startsWith(Eh)&&delete u[p]},name:"packem:filter-skip-chunks"};for(const c of s)await i.write({chunkFileNames:Ri(u=>Ai(u,c),"chunkFileNames"),dir:a,entryFileNames:Ri(u=>{const p=u.name.endsWith(".d")?u.name.slice(0,-2):u.name,f=p?o.get(p):void 0;return f&&!Sh(f,e).has(c)?`${Eh}[name].${c}`:`[name].${c}`},"entryFileNames"),plugins:[l]});await e.hooks.callHook("rollup:dts:done",e)}finally{await i.close(),await t.flush()}},"buildTypes");var WD=ko();const k$=Rs(WD);var FD=Object.defineProperty,yu=v((e,t)=>FD(e,"name",{value:t,configurable:!0}),"n$2");const HD=a0("packem:exe"),qD=/(?:^|,)packem:exe(?:,|$)/,zD=yu(()=>{const e=process.env.NODE_DEBUG;return e?qD.test(e):!1},"isEnabled"),j$=yu(()=>{const e=yu(((t,...r)=>{HD(t,...r)}),"debug");return Object.defineProperty(e,"enabled",{get:zD}),e},"createDebug");var GD=Object.defineProperty,A$=v((e,t)=>GD(e,"name",{value:t,configurable:!0}),"c$5");const UD=A$(()=>{const e=Cx();if(mn==="darwin")return le(e,"Library/Caches/packem");if(mn==="win32"){const r=process.env.LOCALAPPDATA;return r?le(r,"packem/Caches"):le(e,"AppData/Local/packem/Caches")}const t=process.env.XDG_CACHE_HOME;return t?le(t,"packem"):le(e,".cache/packem")},"getCacheDirectory"),KD=A$(e=>{const t=UD(),r=e.platform==="win"?"node.exe":"node";return le(t,"node",`v${e.nodeVersion}`,`${e.platform}-${e.arch}`,r)},"getCachedBinaryPath");var JD=Wh();const VD=Rs(JD);var XD=Object.defineProperty,Po=v((e,t)=>XD(e,"name",{value:t,configurable:!0}),"s$1");const O$=Po(e=>e==="win"?"zip":e==="linux"?"tar.xz":"tar.gz","getArchiveExtension"),YD=Po(e=>{const{arch:t,nodeVersion:r,platform:n}=e,i=O$(n);return`https://nodejs.org/dist/v${r}/node-v${r}-${n}-${t}.${i}`},"getDownloadUrl"),QD=Po(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"),kh="https://nodejs.org/dist/index.json",ZD=/^v/,e6=Po(async e=>{let t=e;if(t==="latest"||t==="latest-lts"){const n=await fetch(kh);if(!n.ok)throw new Error(`Failed to fetch Node.js releases: HTTP ${String(n.status)} from ${kh}`);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(ZD,"")}const r=VD(t);if(!r)throw new Error(`Invalid Node.js version: ${t}. Please provide a valid version string (e.g., "25.7.0").`);if(!k$(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"),t6=Po(e=>`-${e.platform}-${e.arch}`,"getTargetSuffix");var r6=Object.defineProperty,R$=v((e,t)=>r6(e,"name",{value:t,configurable:!0}),"d$1");const dr=j$(),n6=R$(async(e,t,r)=>{const n=QD(r),i=Ce(t);if(dr("Extracting %s from archive to %s",n,i),r.platform==="win")await cs("tar",["-xf",e,"-C",i,"--strip-components=1",n],{nodeOptions:{stdio:"inherit"},throwOnError:!0});else{const a=e.endsWith(".tar.xz")?"J":"z";await cs("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=le(i,o);s!==t&&await Lx(s,t)},"extractBinary"),i6=R$(async(e,t)=>{dr("Resolving Node.js binary for target: %O",e);const r={...e,nodeVersion:await e6(e.nodeVersion)},n=KD(r);if(dr("Cache path: %s",n),await et(n))return dr("Cache hit: %s",n),t.info(`Using cached Node.js ${r.nodeVersion} for ${r.platform}-${r.arch}`),n;const i=YD(r);dr("Cache miss, downloading from: %s",i),t.info(`Downloading Node.js ${r.nodeVersion} for ${r.platform}-${r.arch}...`),t.info(` ${i}`),await eg(Ce(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=O$(r.platform),a=`${n}.download.${s}`,l=f0.from(await o.arrayBuffer());dr("Downloaded %d bytes, writing to: %s",l.length,a),await tg(a,l);try{await n6(a,n,r),r.platform!=="win"&&await Qh(n,493),dr("Binary cached at: %s",n),t.info(`Cached Node.js binary at: ${n}`)}finally{await Ps(a,{force:!0})}return n},"resolveNodeBinary");var o6=Object.defineProperty,Hn=v((e,t)=>o6(e,"name",{value:t,configurable:!0}),"l");const Yr=j$(),s6=/\.d\.[mc]?ts$/,a6=Hn(e=>({buildEntries:e.buildEntries,logger:e.logger,options:e.options,packageType:e.pkg.type}),"toExeBuildInput"),l6=Hn(e=>{const{logger:t,options:r}=e;if(as.bun||as.deno)throw new Error("The `exe` option is not supported in Bun and Deno environments.");if(!k$(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(`
201
- `);throw new Error(`The \`exe\` feature only supports a single entry point. Found ${String(r.entries.length)} entries:
202
- ${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"),c6=Hn((e,t)=>e.endsWith(".cjs")?"commonjs":e.endsWith(".mjs")||t==="module"?"module":"commonjs","pickMainFormat"),jh=mn==="win32"?"win":mn,Ah=Hn((e,t,r,n,i)=>{let o;return e.fileName?o=typeof e.fileName=="function"?e.fileName(t):e.fileName:o=xt(r,gn(r)),i&&(o+=i),n==="win"&&(o+=".exe"),o},"resolveOutputFileName"),Oh=Hn(async(e,t,r,n,i,o,s)=>{const{logger:a,options:l,packageType:c}=e,u=ve(l.rootDir,t.outDir??"build");await eg(u,{recursive:!0});const p=le(u,i);Yr("Building SEA executable: %s -> %s",n,p);const f=performance.now(),d=await Zh(le(Vh(),"packem-sea-"));try{const g={disableExperimentalSEAWarning:!0,...t.seaConfig,main:n,mainFormat:c6(r.path,c),output:p};s&&(g.executable=s);const y=le(d,"sea-config.json");await tg(y,JSON.stringify(g)),Yr("Wrote sea-config.json: %O -> %s",g,y),Yr("Running: %s --build-sea %s",process.execPath,y),await cs(process.execPath,["--build-sea",y],{nodeOptions:{stdio:["ignore","ignore","inherit"]},throwOnError:!0})}finally{Yr.enabled?Yr("Preserving temp directory for debugging: %s",d):await Ps(d,{force:!0,recursive:!0})}if(o==="darwin")try{await cs("codesign",["--sign","-",p],{nodeOptions:{stdio:"inherit"},throwOnError:!0})}catch{const g=mn==="darwin"?`You can sign it manually using:
203
- codesign --sign - "${p}"`:`Automatic code signing is not supported on ${mn}.`;a.warn(`Failed to code-sign the executable. ${g}`)}if(await et(p)){const g=await Ki(p),y=Qe(g.size,{decimals:2});a.info(`${Ze(tt(l.rootDir,p))} ${Ch(y)}`)}const m=Math.round(performance.now()-f);a.success(`Built executable: ${zr(tt(l.rootDir,p))} ${Pt(`(${String(m)}ms)`)}`)},"buildSingleExe"),u6=Hn(async e=>{const t=a6(e),{buildEntries:r,logger:n,options:i}=t,o=i.exe;if(!o)return;const s=typeof o=="object"?o:{};l6(t);const a=r.filter(p=>p.type==="entry"&&!s6.test(p.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 p=a.map(f=>`- ${f.path}`).join(`
204
- `);throw new Error(`The \`exe\` feature only supports single-chunk outputs. Found ${String(a.length)} chunks:
205
- ${p}`)}const l=a[0],c=le(i.rootDir,i.outDir,l.path);Yr("Building executable with SEA for chunk: %s",l.path);const{targets:u}=s;if(u!==void 0&&u.length>0){s.seaConfig?.executable&&n.warn("`seaConfig.executable` is ignored when `targets` is specified.");for(const p of u){const f=await i6(p,n),d=t6(p),m=Ah(s,l,c,p.platform,d);await Oh(t,s,l,c,m,p.platform,f)}}else{const p=Ah(s,l,c,jh);await Oh(t,s,l,c,p,jh)}},"buildExe");var p6=Object.defineProperty,Rh=v((e,t)=>p6(e,"name",{value:t,configurable:!0}),"t");const f6=Rh(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=Rh(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 d6=Object.defineProperty,m6=v((e,t)=>d6(e,"name",{value:t,configurable:!0}),"a");const h6=m6(async e=>await new Promise((t,r)=>{let n=0;const i=Ou(e).pipe(c0({params:{[u0.BROTLI_PARAM_QUALITY]:4}}));i.on("error",r),i.on("data",o=>{n+=o.length}),i.on("end",()=>{t(n)})}),"brotliSize");var g6=Object.defineProperty,mf=v((e,t)=>g6(e,"name",{value:t,configurable:!0}),"d");const mi=mf(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"),hi=mf((e,t,r)=>{let n=e.get(t);return n===void 0&&(n=r(),e.set(t,n)),n},"getOrCreate"),v6=mf((e,t,r,n)=>{if(n!==void 0){const s=new Map;for(const l of e){const c=hi(s,mi(l[t]),()=>new Map),u=hi(c,mi(l[r]),()=>new Map);hi(u,mi(l[n]),()=>[]).push(l)}const a={};for(const[l,c]of s){const u={};for(const[p,f]of c)u[p]=Object.fromEntries(f);a[l]=u}return a}const i=new Map;for(const s of e){const a=hi(i,mi(s[t]),()=>new Map);hi(a,mi(s[r]),()=>[]).push(s)}const o={};for(const[s,a]of i)o[s]=Object.fromEntries(a);return o},"groupByKeys");var b6=Object.defineProperty,y6=v((e,t)=>b6(e,"name",{value:t,configurable:!0}),"i");const $6=y6(async e=>await new Promise((t,r)=>{let n=0;const i=Ou(e).pipe(p0({level:9}));i.on("error",r),i.on("data",o=>{n+=o.length}),i.on("end",()=>{t(n)})}),"gzipSize");var x6=Object.defineProperty,pt=v((e,t)=>x6(e,"name",{value:t,configurable:!0}),"c$1");const w6=2,E6=/\.js$/,S6=/\.d\.[m|c]ts$/,k6=pt((e,t,r)=>[`total size: ${Pe(Qe(t,{decimals:2}))}`,e.size?.brotli&&`brotli size: ${Pe(Qe(e.size.brotli,{decimals:2}))}`,e.size?.gzip&&`gzip size: ${Pe(Qe(e.size.gzip,{decimals:2}))}`,r!==0&&`chunk size: ${Pe(Qe(r,{decimals:2}))}`].filter(Boolean).join(", "),"buildSizeSummary"),j6=pt((e,t,r,n)=>{const i=gt(t,"cjs"),o=gt(t,"esm"),s=Tt(t,"cjs"),a=Tt(t,"esm");let l=e.path.replace(E6,".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 u=t.buildEntries.find(f=>f.path.endsWith(l));if(!u)return"";n.push(u.path);let p;return l.includes(".d.ts")||(l=l.replace(S6,".d.ts"),p=t.buildEntries.find(f=>f.path.endsWith(l))),p?(n.push(p.path),c==="commonjs"?`
206
- types:
207
- ${[u,p].map(f=>`${Pt(" └─ ")+Ze(r(f.path))} (total size: ${Pe(Qe(f.size?.bytes??0,{decimals:2}))})`).join(`
208
- `)}`:`
209
- types: ${Ze(r(u.path))} (total size: ${Pe(Qe(u.size?.bytes??0,{decimals:2}))})`):""},"buildDeclarationTypesLine"),A6=pt((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=` ${Ze(r(e.path))} (${k6(e,i,o)})`;if(s+=e.exports?.length?`
210
- exports: ${Pt(e.exports.join(", "))}`:"",e.chunks?.length&&(s+=`
211
- ${e.chunks.map(a=>{const l=t.buildEntries.find(c=>c.path===a)?.bytes;return Pt(` └─ ${r(a)}${Ze(l?` (${Qe(l,{decimals:2})})`:"")}`)}).join(`
212
- `)}`),e.dynamicImports&&e.dynamicImports.length>0&&(s+=`
213
- dynamic imports:`,s+=`
214
- ${e.dynamicImports.map(a=>Pt(` └─ ${r(a)}`)).join(`
215
- `)}`),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=>Pt(` 📦 ${r(l.id)}${Ze(l.bytes?` (${Qe(l.bytes,{decimals:2})})`:"")}`)).join(`
216
- `);s+=a.length>0?`
217
- inlined modules:
218
- ${a}`:""}return t.options.declaration&&(s+=j6(e,t,r,n)),s+=`
219
-
220
- `,e.chunk?Pt(s):s},"buildEntryLine"),O6=pt((e,t)=>{const r=pt(s=>tt(t.options.rootDir,ve(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:
221
- `);for(const s of o){const a=A6(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+=`${Pt(`
222
- └─ `)+Ze(r(a.path))} (total size: ${Pe(Qe(a.size?.bytes??0,{decimals:2}))})`;s+=`
223
-
224
- `,e.raw(s)}return n&&e.raw("Σ Total dist size (byte size):",Pe(Qe(t.buildEntries.reduce((s,a)=>s+(a.size?.bytes??0),0),{decimals:2})),`
225
- `),n},"showSizeInformation"),R6=/\.d\.[mc]?ts$/,Hc=pt(e=>e.filter(t=>!R6.test(t.input)),"filterDtsEntries"),_6=pt((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"),P6=pt((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"),C6=pt((e,t)=>{const r=[];return e!=="undefined"&&r.push(e),t!=="undefined"&&r.push(t),r.length>0?`${r.join("/")}/`:""},"createSubDirectory"),Vo=pt((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?ll(e.options.rollup.replace,{},o):!1}}}),"createAdjustedContext"),T6=pt(async(e,t)=>{const r=e.logger,n=pt(l=>{const c=l.name??l.fileAlias;if(!c)return"default";const u=[".browser",".server",".development",".node",".workerd"];for(const p of u)if(c.includes(p))return p.slice(1);return"default"},"getEntryType"),i=e.options.entries.map(l=>({...l,environment:l.environment??"undefined",runtime:l.runtime??"undefined",type:n(l)})),o=v6(i,"environment","runtime","type"),s=new Set,a=new Set;for(const[l,c]of Object.entries(o))for(const[u,p]of Object.entries(c))for(const[,f]of Object.entries(p)){const d={...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"||u!=="undefined")){const k=_6(l,u);k&&r.info(k)}const m=u==="undefined"?void 0:u;d.options.runtime=m;try{await e.hooks.callHook("rollup:options",d,{})}catch(k){throw r.error(`Error calling rollup:options hook: ${String(k)}`),k}const g=d.options.rollup.replace,y=e.options.rollup.replace,x=g?P6(l,u):{};if(g){g.values??={};const k=y?ll(y).values:{};Object.assign(g.values,x,k)}else r.warn("'replace' plugin is disabled. You should enable it to replace 'process.env.*' environments.");const j=g?g.values??x:x,R=C6(l,u);let b=d.options.minify??!1;l==="development"?b=!1:l==="production"&&(b=!0);const E=f.map(k=>{const{environment:C,runtime:B,...J}=k;return{...J,environment:C==="undefined"?void 0:C,runtime:B==="undefined"?void 0:B}}),h=[],A=[],_=[],O=[];for(const k of E){if(qi(k.name)){k.declaration&&O.push(k);continue}k.cjs&&k.esm?h.push(k):k.cjs?_.push(k):k.esm?A.push(k):k.declaration&&O.push(k)}if(h.length>0){const k=Vo(d,!0,!0,Hc(h),b,j);if(e.options.dtsOnly||s.add({context:k,fileCache:t,subDirectory:R}),e.options.declaration){const C=h.filter(B=>B.declaration);C.length>0&&a.add({context:{...k,options:{...k.options,entries:C}},fileCache:t,subDirectory:R})}}if(A.length>0){const k=Vo(d,!1,!0,Hc(A),b,j);if(e.options.dtsOnly||s.add({context:k,fileCache:t,subDirectory:R}),e.options.declaration){const C=A.filter(B=>B.declaration);C.length>0&&a.add({context:{...k,options:{...k.options,entries:C}},fileCache:t,subDirectory:R})}}if(_.length>0){const k=Vo(d,!0,!1,Hc(_),b,j);if(e.options.dtsOnly||s.add({context:k,fileCache:t,subDirectory:R}),e.options.declaration){const C=_.filter(B=>B.declaration);C.length>0&&a.add({context:{...k,options:{...k.options,entries:C}},fileCache:t,subDirectory:R})}}if(d.options.declaration&&O.length>0){const k=O.some(q=>q.declarationCjs),C=O.some(q=>q.declarationEsm),B=O.some(q=>q.declaration&&!q.declarationCjs&&!q.declarationEsm),J=Vo(d,k||B,C,O,b,j);a.add({context:J,fileCache:t,subDirectory:R})}}return{builders:s,typeBuilders:a}},"prepareRollupConfig"),N6=pt(async(e,t)=>{const r=e.logger;await e.hooks.callHook("build:before",e);const{builders:n,typeBuilders:i}=await T6(e,t);if(n.size>0&&await Promise.all(Array.from(n,async({context:a,fileCache:l,subDirectory:c})=>MI(a,l,c,Yy(a.options.bundler)))),i.size>0){const a=e.options.dtsConcurrency??w6;await f6(Array.from(i,({context:l,fileCache:c,subDirectory:u})=>()=>LD(l,c,u)),a)}r.success(wu(e.options.name?`Build succeeded for ${e.options.name}`:"Build succeeded")),e.buildEntries=e.buildEntries.filter((a,l,c)=>c.findIndex(u=>u.path===a.path)===l);const o=le(e.options.rootDir,e.options.outDir),s=[];for await(const a of io(o,{includeDirs:!1,includeFiles:!0})){let l=e.buildEntries.find(p=>le(o,p.path)===a.path);l||(l={chunk:!0,path:a.path},e.buildEntries.push(l)),l.size??={};const c=ve(o,a.path),u=l.size;s.push((async()=>{if(!u.bytes){const d=await Ki(c);u.bytes=d.size}const[p,f]=await Promise.all([u.brotli??h6(c),u.gzip??$6(c)]);u.brotli=p,u.gzip=f})())}return await Promise.all(s),e.options.exe&&await u6(e),await e.hooks.callHook("build:done",e),O6(r,e)},"build");var I6=Object.defineProperty,_$=v((e,t)=>I6(e,"name",{value:t,configurable:!0}),"c");const M6=_$(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"),D6=_$(async(e,t,r,n,i,o)=>{const s=e;if(o!=="*"&&$t.valid($t.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 u of t){if(u.exportKey===void 0||u.name===void 0)continue;const{name:p}=u;for(const f of u.exportKey)a[f]=f.includes("/*")?[`./${le(r,Ce(p),"*.d.ts")}`]:[...a[f]??[],`./${le(r,`${p}.d.ts`)}`]}const l=le(n,"package.json"),c=await Cn(l);i==="file"&&Object.keys(a).length>0?(await Jg(l,{...c,typesVersions:M6({...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:
226
-
227
- ${JSON.stringify({typesVersions:{"*":a}},void 0,4)}
228
- `,prefix:"plugin:packem:node10-compatibility"})},"node10Compatibility");var B6=Object.defineProperty,at=v((e,t)=>B6(e,"name",{value:t,configurable:!0}),"p");const qr=at(e=>e??{},"extras"),L6=/\.(md|txt|htm|html|data)$/,W6=at(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"),F6=at((e,t,r,n,i,o,s,a)=>{const l=W6(s?.config.compilerOptions?.jsx),c=a.split("."),u=bM()(O_,i,{alias:{},browserTargets:kx(),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===ji,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:gr,include:mr},esbuild:{charset:"utf8",jsx:l,jsxDev:s?.config.compilerOptions?.jsx==="react-jsxdev",jsxFactory:s?.config.compilerOptions?.jsxFactory,jsxFragment:qr(s?.config.compilerOptions).jsxFragmentFactory,jsxImportSource:qr(s?.config.compilerOptions).jsxImportSource,jsxSideEffects:!0,keepNames:!0,sourcesContent:!1,supported:{"import-attributes":!0},target:s?.config.compilerOptions?.target,treeShaking:!0,tsconfigRaw:s?.config},experimental:{resolve:{aliasFields:[["browser"]],builtinModules:!1,conditionNames:["default","types","import","require","module-sync","node","node-addons","browser","esm2020","es2020","es2015"],extensionAlias:{".cjs":[".cts",".d.cts",".cjs"],".js":[".ts",".tsx",".d.ts",".js"],".jsx":[".tsx",".d.ts",".jsx"],".mjs":[".mts",".d.mts",".mjs"]},extensions:[".ts",".tsx",".d.ts",".js",".jsx",".json",".node"],mainFields:["types","typings","fesm2020","fesm2015","esm2020","es2020","main","module","browser","jsnext:main"]}},json:{preferConst:!1},license:{dependenciesTemplate:at((d,m,g)=>`
229
- # Licenses of bundled dependencies
230
- The published ${g} artifact additionally contains code with the following licenses:
231
- ${d.length>0?`${d.join(", ")}
232
-
233
- `:`
234
- `}# Bundled dependencies:
235
- ${m}`,"dependenciesTemplate"),dtsTemplate:at((d,m,g)=>`
236
- # Licenses of bundled types
237
- The published ${g} artifact additionally contains code with the following licenses:
238
- ${d.length>0?`${d.join(", ")}
239
-
240
- `:`
241
- `}# Bundled types:
242
- ${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:qr(s?.config.compilerOptions).jsxFragmentFactory,pure:!0,runtime:l==="transform"||l==="automatic"?"automatic":"classic",useBuiltIns:!0,useSpread:!0}},patchTypes:{},polyfillNode:{},preserveDirectives:{include:mr},preserveDynamicImports:!0,pure:{},raw:{exclude:gr,include:[L6]},replace:{objectGuards:!0,preventAssignment:!0},resolve:{allowExportsFolderMapping:!1,exportConditions:[r??"production","module-sync"],extensions:_s,preferBuiltins:!1},resolveExternals:{builtins:!0,builtinsPrefix:"add",deps:!0,devDeps:!1,exclude:[],optDeps:!0,peerDeps:!0},shebang:{replace:!1,shebang:"#!/usr/bin/env node"},shim:{exclude:gr,include:mr},sourcemap:{},sucrase:{disableESTransforms:!0,enableLegacyBabel5ModuleInterop:!1,enableLegacyTypeScriptModuleInterop:!s?.config.compilerOptions?.esModuleInterop,include:mr,injectCreateRequireForImportRequire:!1,preserveDynamicImport:!0,production:r===ji,...s?.config.compilerOptions?.jsx&&["react","react-jsx","react-jsxdev"].includes(s.config.compilerOptions.jsx)?{jsxFragmentPragma:qr(s.config.compilerOptions).jsxFragmentFactory,jsxImportSource:qr(s.config.compilerOptions).jsxImportSource,jsxPragma:s.config.compilerOptions.jsxFactory,jsxRuntime:l,transforms:["typescript","jsx"]}:{transforms:["typescript"]}},swc:{include:mr,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!==ji,pragma:s?.config.compilerOptions?.jsxFactory,pragmaFrag:qr(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:xM(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:gr}},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}}});u.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"),u.runtime="node");const p=new Map([...Object.entries(o.dependencies??{}),...Object.entries(o.devDependencies??{})]),f=u.bundler==="rolldown";if(f&&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(!f){if(u.transformer?.NAME===void 0)throw new Error("Unknown transformer, check your transformer options or install one of the supported transformers: esbuild, swc, sucrase");u.transformerName=u.transformer.NAME}if(e.info({message:`Using ${Pe("node ")}${a}`,prefix:"system"}),e.info({message:f?`Using ${Pe("rolldown")} with ${Pe(u.runtime)} build runtime`:`Using ${Pe("rollup")} with ${Pe(u.runtime)} build runtime`,prefix:"bundler"}),!f&&u.transformerName){let d=u.transformerName;u.transformerName==="oxc"?d="oxc-transform":u.transformerName==="swc"&&(d="@swc/core");const m=p.get(d)??"0.0.0";e.info({message:`Using ${Pe(u.transformerName)} ${m}`,prefix:"transformer"})}if(u.rollup.resolve&&(u.rollup.resolve.preferBuiltins=u.runtime==="node",u.rollup.resolve.preferBuiltins&&(u.rollup.polyfillNode=!1,e.debug("Disabling polyfillNode because preferBuiltins is set to true"))),u.runtime==="node"&&(u.browserTargets=[]),u.runtime==="browser"&&(u.rollup.resolve&&u.rollup.resolve.browser===void 0&&(u.rollup.resolve.browser=!0),u.browserTargets&&u.browserTargets.length>0&&e.debug(`Using browser targets: ${u.browserTargets.join(", ")}`)),hh(u.alias),u.rollup.alias!==!1&&u.rollup.alias?.entries&&hh(u.rollup.alias.entries),u.outputExtensionMap){let d;for(const[m,g]of Object.entries(u.outputExtensionMap)){if(!["cjs","esm"].includes(m))throw new Error(`Invalid output extension map: ${m} must be "cjs" or "esm"`);if(typeof g!="string")throw new TypeError(`Invalid output extension map: ${m} must be a string`);if(g.startsWith("."))throw new Error(`Invalid output extension map: ${m} must not start with a dot. Example: "cjs": "c.js", "esm": "m.js"`);if(d===void 0)d=g;else if(d===g)throw new Error(`Invalid output extension map: ${m} must be different from the other key`)}}return s?.config.compilerOptions?.declarationMap&&(u.sourcemap=!0,e.info("Enabling sourcemap because declarationMap is enabled in tsconfig.json")),u},"generateOptions"),H6=at(async(e,t,r,n,i,o,s,a,l)=>{const c=o.hooks,u=F6(e,t,n,i,o,s,a,l);b1(le(u.rootDir,u.outDir));const p={buildEntries:[],dependencyGraphMap:new Map,environment:n,hoistedDependencies:new Set,hooks:jx(),implicitDependencies:new Set,jiti:Ax(u.rootDir,u.jiti),logger:e,mode:r,options:u,pkg:s,tsconfig:a,usedDependencies:new Set,warnings:new Set};c&&p.hooks.addHooks(c),await p.hooks.callHook("build:prepare",p),p.options.emitESM===void 0&&e.info("Emitting of ESM bundles, is disabled."),p.options.emitCJS===void 0&&e.info("Emitting of CJS bundles, is disabled."),p.options.minify&&e.info("Minification is enabled, the output will be minified"),NM(p);const f=Zv(s,["typescript"]);if(p.options.declaration&&p.tsconfig===void 0&&f)throw new Error("Cannot build declaration files without a tsconfig.json");return f?p.options.declaration===!1&&e.info({message:"Generation of declaration files are disabled.",prefix:"dts"}):(p.options.declaration=!1,e.info({message:"Typescript is not installed. Generation of declaration files are disabled.",prefix:"dts"})),p.options.declaration&&e.info(`Using typescript version: ${Pe(s.devDependencies?.typescript??s.dependencies?.typescript??"unknown")}`),p.options.declaration&&(s.dependencies?.typescript||s.devDependencies?.typescript)&&!p.tsconfig?.config.compilerOptions?.isolatedModules&&e.warn(`'compilerOptions.isolatedModules' is not enabled in tsconfig.
243
- 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.
244
- 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.`),Zy(p),p},"createContext"),q6=at(e=>{switch(e){case"build":return"Building";case"jit":return"Stubbing";case"watch":return"Watching";default:throw new Error(`Unknown mode: ${String(e)}`)}},"getMode"),f5=at(async(e,t,r,n,i,o,s)=>{const a=Vt.version.slice(1);n.wrapAll(),e=ve(Vt.cwd(),e),n.debug("Root directory:",e);const{packageJson:l,packageJsonPath:c}=pl(e);n.debug("Using package.json found at",c);const u=await qI(e,l,n,s),p=vP("@visulima/packem",{cwd:e});let f=!1,d,m,g;const y=Wt(JSON.stringify({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}))+Wt(JSON.stringify(o));p&&W$(y,p,n);const x=new vx(e,p,y,n);try{const j=await H6(n,e,t,r,i,o,l,u,a);x.isEnabled=j.options.fileCache??!0;const R=Yy(j.options.bundler);await Gm(R,e,n),R==="rolldown"&&j.options.declaration&&await Gm("rollup",e,n),j.options.transformerName&&await BI(j.options.transformerName,e,n),n.info(Pe(`${q6(t)} ${j.options.name}`)),n.debug({context:j.options.entries,message:`${Ze("Root dir:")} ${j.options.rootDir}
245
- ${Ze("Entries:")}`});const b=at(async O=>{for(const[k,C]of Object.entries(j.options.builder??{})){n.raw(`
246
- `),await j.hooks.callHook("builder:before",k,j);const B=Date.now(),J=at(()=>Td(Math.floor(Date.now()-B)),"getBuilderDuration");await C(j,p,x,f),await j.hooks.callHook("builder:done",k,j),n.raw(`
247
- ⚡️ ${k} run in ${J()}`),O&&n.raw(`
248
-
249
- `)}},"runBuilder"),E=at(async()=>{if(d?.pid!==void 0)await AM({pid:d.pid,signal:o.killSignal??"SIGTERM"});else if(m!==void 0)try{typeof m=="function"&&await m()}catch(O){throw new Error(`onSuccess function cleanup failed: ${O instanceof Error?O.message:String(O)}`,{cause:O})}d=void 0,m=void 0},"doOnSuccessCleanup"),h=at(async()=>{if(typeof j.options.onSuccess=="function")try{m=await j.options.onSuccess()}catch(O){throw new Error(`onSuccess function failed: ${O instanceof Error?O.message:String(O)}`,{cause:O})}else if(typeof j.options.onSuccess=="string"){const O=j.options.onSuccessTimeout??3e4,k=d=Ox(j.options.onSuccess,[],{nodeOptions:{shell:!0,stdio:"inherit",timeout:O}});await k;const{exitCode:C}=k;if(typeof C=="number"&&C!==0)throw new Error(`onSuccess script failed with exit code ${String(C)}. Check the output above for details.`)}},"runOnsuccess"),A=Date.now(),_=at(()=>Td(Math.floor(Date.now()-A)),"getDuration");if(t==="watch"){if(j.options.rollup.watch===!1)throw new Error("Rollup watch is disabled. You should check your packem config.");j.options.bundler==="rolldown"&&n.warn({message:"Watch mode falls back to rollup; rolldown watch isn't supported yet.",prefix:"bundler"}),await fM(j,x,b,h,E),Vm(j,!1);return}if(await hM(j),t==="jit")await aM(j),await j.hooks.callHook("build:done",j);else{if(f=await N6(j,x),j.options.emitCJS&&j.options.declaration==="compatible"){f&&n.raw(`
250
- `);let O="console",k="*";j.options.node10Compatibility&&(O=j.options.node10Compatibility.writeToPackageJson?"file":"console",k=j.options.node10Compatibility.typeScriptVersion??"*"),await D6(n,j.options.entries,j.options.outDir,j.options.rootDir,O,k)}await j.hooks.callHook("validate:before",j),typeof j.options.validation=="object"&&(j.options.validation.packageJson&&xD(j),j.options.validation.attw&&await V4(j,f),j.options.validation.bundleLimit&&MD(j,f)),await j.hooks.callHook("validate:done",j),Vm(j,f)}n.raw(`
251
- ⚡️ Build run in ${_()}
252
- `),g=at(()=>{E().catch(O=>{n.raw(`
253
- onSuccess cleanup failed: ${O instanceof Error?O.message:String(O)}
254
- `)})},"signalHandler"),Vt.once("SIGINT",g),Vt.once("SIGTERM",g),await b(),await h()}catch(j){throw n.raw(`
255
- `),fx(j),zh(j),j}finally{g&&(Vt.off("SIGINT",g),Vt.off("SIGTERM",g)),n.restoreAll(),await CM(p,n,f)}},"packem");export{Tl as $,O_ as A,op as B,HO as C,bi as K,f5 as M,ZB as N,nk as Q,i_ as T,XO as U,MO as W,tR as Z,La as _,kj as a,KB as b,F2 as c,yd as d,sk as e,bM as f,VB as h,ht as j,t5 as l,e5 as m,rk as r,iR as t,sd as v};