@visulima/packem 2.0.0-alpha.83 → 2.0.0-alpha.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/builder/typedoc/index.d.ts +1 -1
- package/dist/builder/typedoc/index.js +1 -1
- package/dist/cli/index.js +9 -9
- package/dist/config/index.d.ts +1 -1
- package/dist/config/preset/preact.d.ts +1 -1
- package/dist/config/preset/react.d.ts +1 -1
- package/dist/config/preset/solid.d.ts +1 -1
- package/dist/config/preset/svelte.d.ts +1 -1
- package/dist/config/preset/vue.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +34 -30
- package/dist/packem_shared/create-or-update-key-storage-Cp_qI2Lt.js +28 -0
- package/dist/packem_shared/default-Dbrx9zI9.js +1 -0
- package/dist/packem_shared/index-C1JIQmoZ.js +244 -0
- package/dist/packem_shared/oxcTransformPlugin-Dwvbw2jE-CIiF8y3S.js +185 -0
- package/dist/packem_shared/{types.d-Cm6dnCyD.d.ts → types.d-DOt53hsx.d.ts} +0 -4
- package/dist/rollup/plugins/oxc/oxc-transformer.js +1 -1
- package/package.json +4 -4
- package/dist/packem_shared/create-or-update-key-storage-DUTe5Prf.js +0 -13
- package/dist/packem_shared/default-Dj-WgmWM.js +0 -1
- package/dist/packem_shared/index-BcKJ8RJU.js +0 -255
- package/dist/packem_shared/oxcResolvePlugin-DeIohkWk-rspLVIoy.js +0 -170
- package/dist/packem_shared/oxcTransformPlugin-Dwvbw2jE-Bbz81VnA.js +0 -4
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
var T$=Object.defineProperty;var v=(e,t)=>T$(e,"name",{value:t,configurable:!0});import{createRequire as De,builtinModules as N$}from"node:module";import{f as Rr,a as Rh,_ as zc,c as I$,s as _h,d as xu,b as M$,e as D$,M as B$,g as Os,$ as wu,n as L$,w as W$,i as Ft,q as Re,F as $t,j as Ze,P as Yo,I as Eu,h as Qr,B as Su,T as zr,H as Qo,E as Ph,K as F$,m as H$}from"./create-or-update-key-storage-DUTe5Prf.js";import Vt,{env as q$,versions as ls,platform as mn}from"node:process";import{installPackage as Ch,detectPackageManager as z$}from"@antfu/install-pkg";import{L as ve,P as Je,_ as le,B as hn,X as wt,b as Th,M as Ui,V as Ce,R as tt,H as gn,A as G$,a as U$,c as Nh}from"./utils-nmTpa3um.js";import{f as K$,C as cs,l as J$,B as Ih,i as V$,$ as Mh,a as kr,r as rt,b as Ki,c as Rs,d as ku,e as Dh,g as Bh,h as X$,j as Lh,k as Y$,N as Q$,m as Z$,n as Zr,o as ex,p as tx,I as rx,q as _s}from"./oxcResolvePlugin-DeIohkWk-rspLVIoy.js";import{browserslistToEsbuild as gf,nodeResolve as nx,alias as Wh,purePlugin as ix,pureNewExpressionPlugin as ox,importTrace as Fh,replace as Hh,polyfillNode as sx,chunkSplitter as ax,wasm as lx,preserveDirectivesPlugin as cx,dynamicImportVars as ux,commonjs as px,jsxRemoveAttributes as fx,visualizer as dx,patchErrorWithTrace as mx}from"@visulima/packem-rollup";import{ENDING_REGEX as hx,svgToCssDataUri as gx,svgToTinyDataUri as vx,memoizeByKey as ju,arrayify as bx,enhanceRollupError as qh,FileCache as yx}from"@visulima/packem-share";import{RUNTIME_EXPORT_CONVENTIONS as zh,SPECIAL_EXPORT_CONVENTIONS as Gh,PRODUCTION_ENV as Ai,DEVELOPMENT_ENV as vf,DEFAULT_EXTENSIONS as Ps,ENDING_REGEX as Au,EXCLUDE_REGEXP as gr,ALLOWED_TRANSFORM_EXTENSIONS_REGEX as mr,VALID_EXPORT_EXTENSIONS as $x}from"@visulima/packem-share/constants";import{getCacheHash as Wt,memoize as xx,arrayify as Gc,isFromNodeModules as bl,isBareSpecifier as vi,parseSpecifier as Uc,isOutsideProject as wx,getPackageName as Ex,replaceContentWithinMarker as Sx,svgEncoder as kx,getChunkFilename as Oi,getEntryFileNames as jx,getOutputExtension as gt,sortUserPlugins as Uh,getDtsExtension as Tt,warn as be}from"@visulima/packem-share/utils";import Ax from"browserslist";import{createHooks as Ox}from"hookable";import{createJiti as Rx}from"jiti";import{x as us,exec as _x}from"tinyexec";import Ke from"magic-string";import{fileURLToPath as Kh}from"node:url";import Px,{existsSync as Ou,createReadStream as Ru,createWriteStream as Cx,watch as bf}from"node:fs";import{cpus as Tx,tmpdir as Jh,homedir as Nx}from"node:os";import{dirname as Kc,join as Vh,resolve as Ix,isAbsolute as Mx}from"node:path";import{createFilter as Mt,normalizePath as Pi}from"@rollup/pluginutils";import Dx from"workerpool";import{transformAsync as Bx}from"@babel/core";import Xh,{stat as Ji,readFile as ps,copyFile as Lx,chmod as Yh,rm as Cs,readdir as Wx,mkdtemp as Qh,rename as Fx,mkdir as Zh,writeFile as eg}from"node:fs/promises";import*as Hx from"rs-module-lexer";import{findStaticImports as Ts,isNodeBuiltin as To,parseNodeModulePath as yf,parseStaticImport as qx,findExports as zx,resolvePath as tg,fileURLToPath as Gx,resolveModuleExportNames as Ux,pathToFileURL as Kx}from"mlly";import Jx from"rollup-plugin-license";import Gt from"typescript";import Vx from"clean-css";import{minify as Xx}from"html-minifier-next";import{init as rg,parse as Yx}from"cjs-module-lexer";import{parseSync as Ns}from"oxc-parser";import Qx from"node:crypto";import{cjsInteropPlugin as ng}from"@visulima/packem-rollup/plugin/cjs-interop";import{JsonPlugin as Zx}from"@visulima/packem-rollup/plugin/json";import{confirm as e0,isCancel as t0,spinner as r0}from"@clack/prompts";import $f from"node:path/posix";import{readTsConfig as n0,findTsConfig as i0}from"@visulima/tsconfig";import{createDefu as o0}from"defu";import s0 from"child_process";import a0 from"node:child_process";import{promisify as l0,debuglog as c0}from"node:util";import{distance as u0}from"fastest-levenshtein";import{createBrotliCompress as p0,constants as f0,createGzip as d0}from"node:zlib";import{Buffer as m0}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 h0=Object.defineProperty,g0=v((e,t)=>h0(e,"name",{value:t,configurable:!0}),"i$s"),v0=Object.defineProperty,b0=g0((e,t)=>v0(e,"name",{value:t,configurable:!0}),"r"),y0=Object.defineProperty,$0=b0((e,t)=>y0(e,"name",{value:t,configurable:!0}),"i");const xf=$0(e=>{if(e.isFile())return"file";if(e.isDirectory())return"dir";if(e.isSymbolicLink())return"symlink"},"getFileInfoType");var x0=Object.defineProperty,w0=v((e,t)=>x0(e,"name",{value:t,configurable:!0}),"i$r"),E0=Object.defineProperty,ig=w0((e,t)=>E0(e,"name",{value:t,configurable:!0}),"s");const S0=De(import.meta.url),Gn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k0=ig(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 S0(e)},"__cjs_getBuiltinModule"),{lstat:wf,mkdir:j0}=k0("node:fs/promises");var A0=Object.defineProperty,O0=ig((e,t)=>A0(e,"name",{value:t,configurable:!0}),"o");const Jc=O0(async e=>{K$(e);try{const t=await wf(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(xf(t))}'`);return}catch(t){if(t.code!=="ENOENT")throw t}try{await j0(e,{recursive:!0})}catch(t){if(t.code!=="EEXIST")throw t;const r=await wf(e);if(!r.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(xf(r))}'`,{cause:t})}},"ensureDir");var R0=Object.defineProperty,kn=v((e,t)=>R0(e,"name",{value:t,configurable:!0}),"r$e"),_0=Object.defineProperty,jn=kn((e,t)=>_0(e,"name",{value:t,configurable:!0}),"r"),P0=Object.defineProperty,vn=jn((e,t)=>P0(e,"name",{value:t,configurable:!0}),"t");function Vi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}v(Vi,"p$w");kn(Vi,"f");jn(Vi,"getDefaultExportFromCjs");vn(Vi,"getDefaultExportFromCjs");function _u(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}v(_u,"f$x");kn(_u,"l");jn(_u,"getDefaultExportFromNamespaceIfPresent");vn(_u,"getDefaultExportFromNamespaceIfPresent");function Pu(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")&&Object.keys(e).length===1?e.default:e}v(Pu,"l$D");kn(Pu,"s");jn(Pu,"getDefaultExportFromNamespaceIfNotNamed");vn(Pu,"getDefaultExportFromNamespaceIfNotNamed");function Cu(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=vn(jn(kn(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(Cu,"s$D");kn(Cu,"m");jn(Cu,"getAugmentedNamespace");vn(Cu,"getAugmentedNamespace");var C0=Object.defineProperty,or=v((e,t)=>C0(e,"name",{value:t,configurable:!0}),"lt$5"),T0=Object.defineProperty,Et=or((e,t)=>T0(e,"name",{value:t,configurable:!0}),"ut"),Ef={},yl,Sf;function An(){if(Sf)return yl;Sf=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 yl={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}},yl}v(An,"_t$5");or(An,"bt");Et(An,"requireConstants");var kf;function On(){return kf||(kf=1,(function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:r,REGEX_SPECIAL_CHARS:n,REGEX_SPECIAL_CHARS_GLOBAL:i}=An();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}})(Ef)),Ef}v(On,"Et$5");or(On,"yt");Et(On,"requireUtils");var $l,jf;function Tu(){if(jf)return $l;jf=1;var e=Object.defineProperty,t=Et((b,E)=>e(b,"name",{value:E,configurable:!0}),"k");const r=On(),{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}=An(),j=t(b=>b===c||b===o,"isPathSeparator"),R=t(b=>{b.isPrefix!==!0&&(b.depth=b.isGlobstar?1/0:1)},"depth");return $l=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"),$l}v(Tu,"Nt$5");or(Tu,"wt");Et(Tu,"requireScan");var xl,Af;function Nu(){if(Af)return xl;Af=1;var e=Object.defineProperty,t=Et((b,E)=>e(b,"name",{value:E,configurable:!0}),"y");const r=An(),n=On(),{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"),Pe=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"),zn=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:""}),Pe("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}),Pe("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){zn(ge.pop());continue}H({type:"paren",value:S,output:$.parens?")":"\\)"}),Pe("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}Pe("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}),Pe("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,"["),Pe("brackets")}for(;$.parens>0;){if(h.strictBrackets===!0)throw new SyntaxError(u("closing",")"));$.output=n.escapeLast($.output,"("),Pe("parens")}for(;$.braces>0;){if(h.strictBrackets===!0)throw new SyntaxError(u("closing","}"));$.output=n.escapeLast($.output,"{"),Pe("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},xl=R,xl}v(Nu,"It$5");or(Nu,"Bt");Et(Nu,"requireParse");var wl,Of;function Iu(){if(Of)return wl;Of=1;var e=Object.defineProperty,t=Et((l,c)=>e(l,"name",{value:c,configurable:!0}),"h");const r=Tu(),n=Nu(),i=On(),o=An(),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,wl=a,wl}v(Iu,"wt$3");or(Iu,"Gt");Et(Iu,"requirePicomatch$1");var El,Rf;function Mu(){if(Rf)return El;Rf=1;var e=Object.defineProperty,t=Et((o,s)=>e(o,"name",{value:s,configurable:!0}),"c");const r=Iu(),n=On();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"),Et(i,"picomatch"),t(i,"picomatch"),Object.assign(i,r),El=i,El}v(Mu,"Pt$5");or(Mu,"Mt");Et(Mu,"requirePicomatch");var N0=Mu();const vr=Vi(N0);var I0=Object.defineProperty,me=v((e,t)=>I0(e,"name",{value:t,configurable:!0}),"u$C"),M0=Object.defineProperty,fe=me((e,t)=>M0(e,"name",{value:t,configurable:!0}),"l");const D0=De(import.meta.url),Un=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Xi=fe(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 D0(e)},"__cjs_getBuiltinModule"),_f=Xi("fs"),B0={..._f,default:_f},{statSync:L0,stat:W0,realpathSync:F0,realpath:H0,readdirSync:q0,readdir:z0}=Xi("fs"),{sep:og,basename:G0,dirname:Vc,resolve:sg,normalize:U0,relative:K0,posix:br,isAbsolute:J0}=Xi("path"),{fileURLToPath:V0}=Xi("url"),{createRequire:X0}=Xi("module");var Y0=Object.defineProperty,ce=fe((e,t)=>Y0(e,"name",{value:t,configurable:!0}),"r"),Pf=X0(import.meta.url);function Is(e){let t=U0(e);return t.length>1&&t[t.length-1]===og&&(t=t.substring(0,t.length-1)),t}v(Is,"H$e");me(Is,"tt");fe(Is,"M$1");ce(Is,"cleanPath");const Q0=/[\\/]/g;function Yi(e,t){return e.replace(Q0,t)}v(Yi,"M$p");me(Yi,"T");fe(Yi,"D$1");ce(Yi,"convertSlashes");const Z0=/^[a-z]:[\\/]$/i;function Ms(e){return e==="/"||Z0.test(e)}v(Ms,"J$e");me(Ms,"et");fe(Ms,"T$1");ce(Ms,"isRootDirectory");function tn(e,t){const{resolvePaths:r,normalizePath:n,pathSeparator:i}=t,o=process.platform==="win32"&&e.includes("/")||e.startsWith(".");if(r&&(e=sg(e)),(n||o)&&(e=Is(e)),e===".")return"";const s=e[e.length-1]!==i;return Yi(s?e+i:e,i)}v(tn,"q$p");me(tn,"q");fe(tn,"w");ce(tn,"normalizePath");function Qi(e,t){return t+e}v(Qi,"B$n");me(Qi,"I");fe(Qi,"P");ce(Qi,"joinPathWithBasePath");function Ds(e,t){return function(r,n){return n.startsWith(e)?n.slice(e.length)+r:Yi(K0(e,n),t.pathSeparator)+t.pathSeparator+r}}v(Ds,"K$d");me(Ds,"st");fe(Ds,"X");ce(Ds,"joinPathWithRelativePath");function Bs(e){return e}v(Bs,"V$d");me(Bs,"rt");fe(Bs,"H");ce(Bs,"joinPath");function Ls(e,t,r){return t+e+r}v(Ls,"X$d");me(Ls,"nt");fe(Ls,"U$1");ce(Ls,"joinDirectoryPath");function Ws(e,t){const{relativePaths:r,includeBasePath:n}=t;return r&&e?Ds(e,t):n?Qi:Bs}v(Ws,"Z$c");me(Ws,"it");fe(Ws,"J");ce(Ws,"build$7");function Fs(e){return function(t,r){r.push(t.substring(e.length)||".")}}v(Fs,"tt$3");me(Fs,"ot");fe(Fs,"K$1");ce(Fs,"pushDirectoryWithRelativePath");function Hs(e){return function(t,r,n){const i=t.substring(e.length)||".";n.every(o=>o(i,!0))&&r.push(i)}}v(Hs,"et$3");me(Hs,"ut");fe(Hs,"V");ce(Hs,"pushDirectoryFilterWithRelativePath");const ew=ce((e,t)=>{t.push(e||".")},"pushDirectory"),tw=ce((e,t,r)=>{const n=e||".";r.every(i=>i(n,!0))&&t.push(n)},"pushDirectoryFilter"),rw=ce(()=>{},"empty$2");function qs(e,t){const{includeDirs:r,filters:n,relativePaths:i}=t;return r?i?n&&n.length?Hs(e):Fs(e):n&&n.length?tw:ew:rw}v(qs,"st$3");me(qs,"lt");fe(qs,"st$1");ce(qs,"build$6");const nw=ce((e,t,r,n)=>{n.every(i=>i(e,!1))&&r.files++},"pushFileFilterAndCount"),iw=ce((e,t,r,n)=>{n.every(i=>i(e,!1))&&t.push(e)},"pushFileFilter"),ow=ce((e,t,r,n)=>{r.files++},"pushFileCount"),sw=ce((e,t)=>{t.push(e)},"pushFile"),aw=ce(()=>{},"empty$1");function zs(e){const{excludeFiles:t,filters:r,onlyCounts:n}=e;return t?aw:r&&r.length?n?nw:iw:n?ow:sw}v(zs,"it$3");me(zs,"at");fe(zs,"ut$1");ce(zs,"build$5");const lw=ce(e=>e,"getArray"),cw=ce(()=>[""].slice(0,0),"getArrayGroup");function Gs(e){return e.group?cw:lw}v(Gs,"nt$3");me(Gs,"ct");fe(Gs,"ct$1");ce(Gs,"build$4");const uw=ce((e,t,r)=>{e.push({directory:t,files:r,dir:t})},"groupFiles"),pw=ce(()=>{},"empty");function Us(e){return e.group?uw:pw}v(Us,"rt$3");me(Us,"ht");fe(Us,"ft$1");ce(Us,"build$3");const fw=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()&&Zi(e,a,t))return n.dequeue(null,t);r(c,a),n.dequeue(null,t)})})},"resolveSymlinksAsync"),dw=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()&&Zi(e,s,t))return;r(a,s)}catch(s){if(!o)throw s}},"resolveSymlinks");function Ks(e,t){return!e.resolveSymlinks||e.excludeSymlinks?null:t?dw:fw}v(Ks,"ot$3");me(Ks,"pt");fe(Ks,"gt$1");ce(Ks,"build$2");function Zi(e,t,r){if(r.options.useRealPaths)return Js(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(Zi,"_$l");me(Zi,"L");fe(Zi,"E$1");ce(Zi,"isRecursive");function Js(e,t){return t.visited.includes(e+t.options.pathSeparator)}v(Js,"lt$4");me(Js,"ft");fe(Js,"dt$1");ce(Js,"isRecursiveUsingRealPaths");const mw=ce(e=>e.counts,"onlyCountsSync"),hw=ce(e=>e.groups,"groupsSync"),gw=ce(e=>e.paths,"defaultSync"),vw=ce(e=>e.paths.slice(0,e.options.maxFiles),"limitFilesSync"),bw=ce((e,t,r)=>(_r(t,r,e.counts,e.options.suppressErrors),null),"onlyCountsAsync"),yw=ce((e,t,r)=>(_r(t,r,e.paths,e.options.suppressErrors),null),"defaultAsync"),$w=ce((e,t,r)=>(_r(t,r,e.paths.slice(0,e.options.maxFiles),e.options.suppressErrors),null),"limitFilesAsync"),xw=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 Vs(e,t){const{onlyCounts:r,group:n,maxFiles:i}=e;return r?t?mw:bw:n?t?hw:xw:i?t?vw:$w:t?gw:yw}v(Vs,"at$3");me(Vs,"gt");fe(Vs,"Et");ce(Vs,"build$1");const ag={withFileTypes:!0},ww=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||".",ag,(s,a=[])=>{i(a,r,n),e.queue.dequeue(e.options.suppressErrors?null:s,e)})},"walkAsync"),Ew=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||".",ag)}catch(a){if(!e.options.suppressErrors)throw a}i(s,r,n)},"walkSync");function Xs(e){return e?Ew:ww}v(Xs,"ut$3");me(Xs,"yt");fe(Xs,"xt$1");ce(Xs,"build");var Sw=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))}},kw=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}},jw=class{static{v(this,"Ee")}static{me(this,"Se")}static{fe(this,"Wt")}static{ce(this,"Aborter")}aborted=!1;abort(){this.aborted=!0}},lg=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=Vs(r,this.isSynchronous),this.root=tn(t,r),this.state={root:Ms(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new kw,options:r,queue:new Sw((i,o)=>this.callbackInvoker(o,i,n)),symlinks:new Map,visited:[""].slice(0,0),controller:new jw,fs:r.fs||B0},this.joinPath=Ws(this.root,r),this.pushDirectory=qs(this.root,r),this.pushFile=zs(r),this.getArray=Gs(r),this.groupFiles=Us(r),this.resolveSymlink=Ks(r,this.isSynchronous),this.walkDirectory=Xs(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=Ls(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=Qi(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=G0(R),E=tn(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 Ys(e,t){return new Promise((r,n)=>{eo(e,t,(i,o)=>{if(i)return n(i);r(o)})})}v(Ys,"ct$2");me(Ys,"bt");fe(Ys,"Ct");ce(Ys,"promise");function eo(e,t,r){new lg(e,t,r).start()}v(eo,"T$p");me(eo,"G");fe(eo,"x");ce(eo,"callback");function Qs(e,t){return new lg(e,t).start()}v(Qs,"ht$3");me(Qs,"vt");fe(Qs,"jt");ce(Qs,"sync");var Cf=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 Ys(this.root,this.options)}withCallback(t){eo(this.root,this.options,t)}sync(){return Qs(this.root,this.options)}};let cg=null;try{Pf.resolve("picomatch"),cg=Pf("picomatch")}catch{}var Aw=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: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 Cf(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,r){return this.options={...this.options,...r},new Cf(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}},Ow=Object.defineProperty,We=fe((e,t)=>Ow(e,"name",{value:t,configurable:!0}),"a");const Rw=Array.isArray,ug=/\\/g,pg=process.platform==="win32",_w=/^(\/?\.\.)+$/;function Ci(e,t={}){const r=e.length,n=Array(r),i=Array(r);let o,s;for(o=0;o<r;o++){const a=to(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]===".."&&_w.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(Ci,"R$k");me(Ci,"B");fe(Ci,"D");We(Ci,"getPartialMatcher");const Pw=/^[A-Z]:\/$/i,Cw=pg?e=>Pw.test(e):e=>e==="/";function Ti(e,t,r){if(e===t||t.startsWith(`${e}/`)){if(r){const i=e.length+ +!Cw(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(Ti,"O$t");me(Ti,"M");fe(Ti,"M");We(Ti,"buildFormat");function Zs(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(Zs,"pt$3");me(Zs,"St");fe(Zs,"at");We(Zs,"buildRelative");const Tw={parts:!0};function to(e){var t;const r=vr.scan(e,Tw);return!((t=r.parts)===null||t===void 0)&&t.length?r.parts:[e]}v(to,"I$e");me(to,"z");fe(to,"N");We(to,"splitPattern");const Nw=/\\(?![()[\]{}!+@])/g;function Du(e){return fg(e)}v(Du,"qt$2");me(Du,"Ee");fe(Du,"ut");We(Du,"convertPosixPathToPattern");function Bu(e){return dg(e).replace(Nw,"/")}v(Bu,"jt$3");me(Bu,"Re");fe(Bu,"ft");We(Bu,"convertWin32PathToPattern");const Iw=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,Mw=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,fg=We(e=>e.replace(Iw,"\\$&"),"escapePosixPath"),dg=We(e=>e.replace(Mw,"\\$&"),"escapeWin32Path"),Dw=pg?dg:fg;function ea(e,t){if(t?.caseSensitiveMatch===!1)return!0;const r=vr.scan(e);return r.isGlob||r.negated}v(ea,"ft$2");me(ea,"Dt");fe(ea,"k");We(ea,"isDynamicPattern");function Xt(...e){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...e)}v(Xt,"D$m");me(Xt,"D");fe(Xt,"E");We(Xt,"log");function ro(e){return typeof e=="string"?[e]:e??[]}v(ro,"L$e");me(ro,"U");fe(ro,"W");We(ro,"ensureStringArray");const Bw=/^(\/?\.\.)+/,Lw=/\\(?=[()[\]{}!*+?@|])/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=Dw(o);s=J0(s.replace(Lw,""))?br.relative(c,s):br.normalize(s);const u=(i=Bw.exec(s))===null||i===void 0?void 0:i[0],p=to(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]||ea(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 ta(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(ta,"gt$3");me(ta,"xt");fe(ta,"St");We(ta,"processPatterns");function ra(e,t){const r=e.cwd,n={root:r,depthOffset:0},i=ta(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(ug,""),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?Ci(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=Ci(i.match,f),R=Ti(r,p,o),b=o?R:Ti(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 Aw({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&&Zs(r,p)]}v(ra,"dt$3");me(ra,"At");fe(ra,"vt");We(ra,"buildCrawler");function no(e,t){if(t)for(let r=e.length-1;r>=0;r--)e[r]=t(e[r]);return e}v(no,"z$h");me(no,"N");fe(no,"U");We(no,"formatPaths");const Ww={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function na(e){const t={...Ww,...e};return t.cwd=(t.cwd instanceof URL?V0(t.cwd):sg(t.cwd)).replace(ug,"/"),t.ignore=ro(t.ignore),t.fs&&(t.fs={readdir:t.fs.readdir||z0,readdirSync:t.fs.readdirSync||q0,realpath:t.fs.realpath||H0,realpathSync:t.fs.realpathSync||F0,stat:t.fs.stat||W0,statSync:t.fs.statSync||L0}),t.debug&&Xt("globbing with options:",t),t}v(na,"yt$3");me(na,"_t");fe(na,"pt");We(na,"getOptions");function io(e,t={}){var r;if(e&&t?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");const n=Rw(e)||typeof e=="string",i=ro((r=n?e:e.patterns)!==null&&r!==void 0?r:"**/*"),o=na(n?t:e);return i.length>0?ra(o,i):[]}v(io,"G$j");me(io,"Q");fe(io,"G");We(io,"getCrawler");async function ia(e,t){const[r,n]=io(e,t);return r?no(await r.withPromise(),n):[]}v(ia,"mt$4");me(ia,"Ie");fe(ia,"bt");We(ia,"glob");function Lu(e,t){const[r,n]=io(e,t);return r?no(r.sync(),n):[]}v(Lu,"vt$4");me(Lu,"Le");fe(Lu,"xt");We(Lu,"globSync");var Fw=Object.defineProperty,Hw=v((e,t)=>Fw(e,"name",{value:t,configurable:!0}),"r$d"),qw=Object.defineProperty,zw=Hw((e,t)=>qw(e,"name",{value:t,configurable:!0}),"r"),Gw=Object.defineProperty,Uw=zw((e,t)=>Gw(e,"name",{value:t,configurable:!0}),"r");const Kw=Uw(async(e,t)=>await ia(e,t),"glob");var Jw=Object.defineProperty,Wu=v((e,t)=>Jw(e,"name",{value:t,configurable:!0}),"o$r"),Vw=Object.defineProperty,oa=Wu((e,t)=>Vw(e,"name",{value:t,configurable:!0}),"c"),Sl,Tf;function Fu(){if(Tf)return Sl;Tf=1;var e=Object.defineProperty,t=oa((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 Sl=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"),Sl}v(Fu,"h$m");Wu(Fu,"q");oa(Fu,"requireIsExtglob");var kl,Nf;function Hu(){if(Nf)return kl;Nf=1;var e=Object.defineProperty,t=oa((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=Fu(),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 kl=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"),kl}v(Hu,"y$r");Wu(Hu,"G");oa(Hu,"requireIsGlob");var Xw=Object.defineProperty,fs=v((e,t)=>Xw(e,"name",{value:t,configurable:!0}),"s$B"),Yw=Object.defineProperty,nn=fs((e,t)=>Yw(e,"name",{value:t,configurable:!0}),"t");const Qw=De(import.meta.url),Kn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,mg=nn(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 Qw(e)},"__cjs_getBuiltinModule"),Zw=mg("path"),e1=mg("os");var jl,If;function qu(){if(If)return jl;If=1;var e=Object.defineProperty,t=nn((u,p)=>e(u,"name",{value:p,configurable:!0}),"n"),r=Hu(),n=Zw.posix.dirname,i=e1.platform()==="win32",o="/",s=/\\/g,a=/\\([!*?|[\](){}])/g;jl=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"),fs(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"),fs(c,"f"),nn(c,"isGlobby"),t(c,"isGlobby"),jl}v(qu,"d$E");fs(qu,"$");nn(qu,"requireGlobParent");var t1=qu();const r1=Vi(t1);var n1=Object.defineProperty,i1=nn((e,t)=>n1(e,"name",{value:t,configurable:!0}),"e");const o1=i1((e,t)=>r1(e,t),"globParent");var s1=Object.defineProperty,a1=v((e,t)=>s1(e,"name",{value:t,configurable:!0}),"i$n"),l1=Object.defineProperty,c1=a1((e,t)=>l1(e,"name",{value:t,configurable:!0}),"r"),u1=Object.defineProperty,p1=c1((e,t)=>u1(e,"name",{value:t,configurable:!0}),"i");const Mf=p1(e=>{if(e.isFile())return"file";if(e.isDirectory())return"dir";if(e.isSymbolicLink())return"symlink"},"getFileInfoType");var f1=Object.defineProperty,d1=v((e,t)=>f1(e,"name",{value:t,configurable:!0}),"i$m"),m1=Object.defineProperty,hg=d1((e,t)=>m1(e,"name",{value:t,configurable:!0}),"s");const h1=De(import.meta.url),Jn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,g1=hg(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 h1(e)},"__cjs_getBuiltinModule"),{lstatSync:Df,mkdirSync:v1}=g1("node:fs");var b1=Object.defineProperty,y1=hg((e,t)=>b1(e,"name",{value:t,configurable:!0}),"o");const $1=y1(e=>{Rr(e);try{const t=Df(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(Mf(t))}'`);return}catch(t){if(t.code!=="ENOENT")throw t}try{v1(e,{recursive:!0})}catch(t){if(t.code!=="EEXIST")throw t;const r=Df(e);if(!r.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(Mf(r))}'`,{cause:t})}},"ensureDirSync");var x1=Object.defineProperty,gg=v((e,t)=>x1(e,"name",{value:t,configurable:!0}),"t$j"),w1=Object.defineProperty,vg=gg((e,t)=>w1(e,"name",{value:t,configurable:!0}),"t"),E1=Object.defineProperty,S1=vg((e,t)=>E1(e,"name",{value:t,configurable:!0}),"t");let ds=class extends Error{static{v(this,"l")}static{gg(this,"c")}static{vg(this,"i")}static{S1(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 k1=Object.defineProperty,j1=v((e,t)=>k1(e,"name",{value:t,configurable:!0}),"n$o"),A1=Object.defineProperty,bg=j1((e,t)=>A1(e,"name",{value:t,configurable:!0}),"t"),O1=Object.defineProperty,R1=bg((e,t)=>O1(e,"name",{value:t,configurable:!0}),"g");const ms=R1(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 _1=Object.defineProperty,P1=bg((e,t)=>_1(e,"name",{value:t,configurable:!0}),"n");const Yt=P1((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 C1=Object.defineProperty,yg=v((e,t)=>C1(e,"name",{value:t,configurable:!0}),"u$z"),T1=Object.defineProperty,zu=yg((e,t)=>T1(e,"name",{value:t,configurable:!0}),"y");const N1=De(import.meta.url),Vn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,I1=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 N1(e)},"__cjs_getBuiltinModule"),{readdir:M1,realpath:D1,stat:B1}=I1("node:fs/promises");var L1=Object.defineProperty,vt=zu((e,t)=>L1(e,"name",{value:t,configurable:!0}),"r");const W1=vt(async e=>{const t=hn(e),r=wt(t),n=await B1(t);return{isDirectory:vt(()=>n.isDirectory(),"isDirectory"),isFile:vt(()=>n.isFile(),"isFile"),isSymbolicLink:vt(()=>n.isSymbolicLink(),"isSymbolicLink"),name:r,path:t}},"_createWalkEntry");async 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"?ms(p):p):void 0,u=l?l.map(p=>typeof p=="string"?ms(p):p):void 0;if(e=ve(Je(e)),n&&Yt(e,t,c,u)&&(yield await W1(e)),!(a<1||!Yt(e,void 0,void 0,u)))try{const p=await M1(e,{withFileTypes:!0});for(const f of p){let d=le(e,f.name);if(f.isSymbolicLink())if(r)d=await D1(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*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:vt(()=>f.isDirectory(),"isDirectory"),isFile:vt(()=>f.isFile(),"isFile"),isSymbolicLink:vt(()=>f.isSymbolicLink(),"isSymbolicLink"),name:f.name,path:d})}}catch(p){throw p instanceof ds?p:new ds(p,e)}}v(oo,"f$u");yg(oo,"D");zu(oo,"g");vt(oo,"walk");var F1=Object.defineProperty,$g=v((e,t)=>F1(e,"name",{value:t,configurable:!0}),"p$s"),H1=Object.defineProperty,Gu=$g((e,t)=>H1(e,"name",{value:t,configurable:!0}),"m");const q1=De(import.meta.url),Xn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,z1=Gu(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 q1(e)},"__cjs_getBuiltinModule"),{readdirSync:G1,realpathSync:U1,statSync:K1}=z1("node:fs");var J1=Object.defineProperty,bt=Gu((e,t)=>J1(e,"name",{value:t,configurable:!0}),"t");const V1=bt(e=>{const t=hn(e),r=K1(t);return{isDirectory:bt(()=>r.isDirectory(),"isDirectory"),isFile:bt(()=>r.isFile(),"isFile"),isSymbolicLink:bt(()=>r.isSymbolicLink(),"isSymbolicLink"),name:wt(t),path:t}},"_createWalkEntry");function*so(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"?ms(p):p):void 0,u=l?l.map(p=>typeof p=="string"?ms(p):p):void 0;if(e=ve(Je(e)),n&&Yt(e,t,c,u)&&(yield V1(e)),!(a<1||!Yt(e,void 0,void 0,u)))try{const p=G1(e,{withFileTypes:!0});for(const f of p){let d=le(e,f.name);if(f.isSymbolicLink())if(r)d=U1(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*so(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 ds?p:new ds(p,e)}}v(so,"y$p");$g(so,"F");Gu(so,"b");bt(so,"walkSync");var X1=Object.defineProperty,Y1=v((e,t)=>X1(e,"name",{value:t,configurable:!0}),"t$h"),Q1=Object.defineProperty,Z1=Y1((e,t)=>Q1(e,"name",{value:t,configurable:!0}),"s"),eE=Object.defineProperty,tE=Z1((e,t)=>eE(e,"name",{value:t,configurable:!0}),"n");const xg=tE((e,t={})=>{Array.isArray(t.extensions)||(t.extensions=["js","mjs","cjs","ts"]);const r=[];for(const n of so(e,t))r.push(n.path);return r},"collectSync");var rE=Object.defineProperty,nE=v((e,t)=>rE(e,"name",{value:t,configurable:!0}),"p$r"),iE=Object.defineProperty,wg=nE((e,t)=>iE(e,"name",{value:t,configurable:!0}),"a");const oE=De(import.meta.url),Yn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Eg=wg(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 oE(e)},"__cjs_getBuiltinModule"),{stat:sE,lstat:aE}=Eg("node:fs/promises"),{fileURLToPath:lE}=Eg("node:url");var cE=Object.defineProperty,Bf=wg((e,t)=>cE(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}=Th(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?sE:aE;for(;n&&n!==s&&n!==i;){const u=await l(n);for(let p of u){if(p===Rh)return;if(p===void 0)continue;Buffer.isBuffer(p)?p=p.toString():p instanceof URL&&(p=lE(p));const f=Ui(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 uE=Object.defineProperty,pE=v((e,t)=>uE(e,"name",{value:t,configurable:!0}),"u$x"),fE=Object.defineProperty,kg=pE((e,t)=>fE(e,"name",{value:t,configurable:!0}),"i");const dE=De(import.meta.url),Qn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,jg=kg(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 dE(e)},"__cjs_getBuiltinModule"),{statSync:mE,lstatSync:hE}=jg("node:fs"),{fileURLToPath:gE}=jg("node:url");var vE=Object.defineProperty,Lf=kg((e,t)=>vE(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}=Th(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?mE:hE;for(;n&&n!==s&&n!==i;){for(let u of l(n)){if(u===Rh)return;if(u===void 0)continue;Buffer.isBuffer(u)?u=u.toString():u instanceof URL&&(u=gE(u));const p=Ui(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 bE=Object.defineProperty,Rn=v((e,t)=>bE(e,"name",{value:t,configurable:!0}),"r$a"),yE=Object.defineProperty,_n=Rn((e,t)=>yE(e,"name",{value:t,configurable:!0}),"r"),$E=Object.defineProperty,bn=_n((e,t)=>$E(e,"name",{value:t,configurable:!0}),"t");function ao(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}v(ao,"p$q");Rn(ao,"f");_n(ao,"getDefaultExportFromCjs");bn(ao,"getDefaultExportFromCjs");function Uu(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}v(Uu,"f$t");Rn(Uu,"l");_n(Uu,"getDefaultExportFromNamespaceIfPresent");bn(Uu,"getDefaultExportFromNamespaceIfPresent");function Ku(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")&&Object.keys(e).length===1?e.default:e}v(Ku,"l$w");Rn(Ku,"s");_n(Ku,"getDefaultExportFromNamespaceIfNotNamed");bn(Ku,"getDefaultExportFromNamespaceIfNotNamed");function Ju(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=bn(_n(Rn(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(Ju,"s$v");Rn(Ju,"m");_n(Ju,"getAugmentedNamespace");bn(Ju,"getAugmentedNamespace");var xE=Object.defineProperty,sr=v((e,t)=>xE(e,"name",{value:t,configurable:!0}),"lt$3"),wE=Object.defineProperty,St=sr((e,t)=>wE(e,"name",{value:t,configurable:!0}),"ut"),Wf={},Al,Ff;function Pn(){if(Ff)return Al;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 Al={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}},Al}v(Pn,"_t$3");sr(Pn,"bt");St(Pn,"requireConstants");var Hf;function Cn(){return Hf||(Hf=1,(function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:r,REGEX_SPECIAL_CHARS:n,REGEX_SPECIAL_CHARS_GLOBAL:i}=Pn();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(Cn,"Et$3");sr(Cn,"yt");St(Cn,"requireUtils");var Ol,qf;function Vu(){if(qf)return Ol;qf=1;var e=Object.defineProperty,t=St((b,E)=>e(b,"name",{value:E,configurable:!0}),"k");const r=Cn(),{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}=Pn(),j=t(b=>b===c||b===o,"isPathSeparator"),R=t(b=>{b.isPrefix!==!0&&(b.depth=b.isGlobstar?1/0:1)},"depth");return Ol=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"),Ol}v(Vu,"Nt$3");sr(Vu,"wt");St(Vu,"requireScan");var Rl,zf;function Xu(){if(zf)return Rl;zf=1;var e=Object.defineProperty,t=St((b,E)=>e(b,"name",{value:E,configurable:!0}),"y");const r=Pn(),n=Cn(),{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"),Pe=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"),zn=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:""}),Pe("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}),Pe("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){zn(ge.pop());continue}H({type:"paren",value:S,output:$.parens?")":"\\)"}),Pe("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}Pe("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}),Pe("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,"["),Pe("brackets")}for(;$.parens>0;){if(h.strictBrackets===!0)throw new SyntaxError(u("closing",")"));$.output=n.escapeLast($.output,"("),Pe("parens")}for(;$.braces>0;){if(h.strictBrackets===!0)throw new SyntaxError(u("closing","}"));$.output=n.escapeLast($.output,"{"),Pe("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},Rl=R,Rl}v(Xu,"It$3");sr(Xu,"Bt");St(Xu,"requireParse");var _l,Gf;function Yu(){if(Gf)return _l;Gf=1;var e=Object.defineProperty,t=St((l,c)=>e(l,"name",{value:c,configurable:!0}),"h");const r=Vu(),n=Xu(),i=Cn(),o=Pn(),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,_l=a,_l}v(Yu,"wt$2");sr(Yu,"Gt");St(Yu,"requirePicomatch$1");var Pl,Uf;function Qu(){if(Uf)return Pl;Uf=1;var e=Object.defineProperty,t=St((o,s)=>e(o,"name",{value:s,configurable:!0}),"c");const r=Yu(),n=Cn();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"),St(i,"picomatch"),t(i,"picomatch"),Object.assign(i,r),Pl=i,Pl}v(Qu,"Pt$3");sr(Qu,"Mt");St(Qu,"requirePicomatch");var EE=Qu();const yr=ao(EE);var SE=Object.defineProperty,he=v((e,t)=>SE(e,"name",{value:t,configurable:!0}),"u$w"),kE=Object.defineProperty,de=he((e,t)=>kE(e,"name",{value:t,configurable:!0}),"l");const jE=De(import.meta.url),Zn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,lo=de(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 jE(e)},"__cjs_getBuiltinModule"),Kf=lo("fs"),AE={...Kf,default:Kf},{statSync:OE,stat:RE,realpathSync:_E,realpath:PE,readdirSync:CE,readdir:TE}=lo("fs"),{sep:Og,basename:NE,dirname:Xc,resolve:Rg,normalize:IE,relative:ME,posix:$r,isAbsolute:DE}=lo("path"),{fileURLToPath:BE}=lo("url"),{createRequire:LE}=lo("module");var WE=Object.defineProperty,ue=de((e,t)=>WE(e,"name",{value:t,configurable:!0}),"r"),Jf=LE(import.meta.url);function sa(e){let t=IE(e);return t.length>1&&t[t.length-1]===Og&&(t=t.substring(0,t.length-1)),t}v(sa,"H$d");he(sa,"tt");de(sa,"M$1");ue(sa,"cleanPath");const FE=/[\\/]/g;function co(e,t){return e.replace(FE,t)}v(co,"M$j");he(co,"T");de(co,"D$1");ue(co,"convertSlashes");const HE=/^[a-z]:[\\/]$/i;function aa(e){return e==="/"||HE.test(e)}v(aa,"J$d");he(aa,"et");de(aa,"T$1");ue(aa,"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=sa(e)),e===".")return"";const s=e[e.length-1]!==i;return co(s?e+i:e,i)}v(on,"q$k");he(on,"q");de(on,"w");ue(on,"normalizePath");function uo(e,t){return t+e}v(uo,"B$k");he(uo,"I");de(uo,"P");ue(uo,"joinPathWithBasePath");function la(e,t){return function(r,n){return n.startsWith(e)?n.slice(e.length)+r:co(ME(e,n),t.pathSeparator)+t.pathSeparator+r}}v(la,"K$c");he(la,"st");de(la,"X");ue(la,"joinPathWithRelativePath");function ca(e){return e}v(ca,"V$c");he(ca,"rt");de(ca,"H");ue(ca,"joinPath");function ua(e,t,r){return t+e+r}v(ua,"X$c");he(ua,"nt");de(ua,"U$1");ue(ua,"joinDirectoryPath");function pa(e,t){const{relativePaths:r,includeBasePath:n}=t;return r&&e?la(e,t):n?uo:ca}v(pa,"Z$b");he(pa,"it");de(pa,"J");ue(pa,"build$7");function fa(e){return function(t,r){r.push(t.substring(e.length)||".")}}v(fa,"tt$2");he(fa,"ot");de(fa,"K$1");ue(fa,"pushDirectoryWithRelativePath");function da(e){return function(t,r,n){const i=t.substring(e.length)||".";n.every(o=>o(i,!0))&&r.push(i)}}v(da,"et$2");he(da,"ut");de(da,"V");ue(da,"pushDirectoryFilterWithRelativePath");const qE=ue((e,t)=>{t.push(e||".")},"pushDirectory"),zE=ue((e,t,r)=>{const n=e||".";r.every(i=>i(n,!0))&&t.push(n)},"pushDirectoryFilter"),GE=ue(()=>{},"empty$2");function ma(e,t){const{includeDirs:r,filters:n,relativePaths:i}=t;return r?i?n&&n.length?da(e):fa(e):n&&n.length?zE:qE:GE}v(ma,"st$2");he(ma,"lt");de(ma,"st$1");ue(ma,"build$6");const UE=ue((e,t,r,n)=>{n.every(i=>i(e,!1))&&r.files++},"pushFileFilterAndCount"),KE=ue((e,t,r,n)=>{n.every(i=>i(e,!1))&&t.push(e)},"pushFileFilter"),JE=ue((e,t,r,n)=>{r.files++},"pushFileCount"),VE=ue((e,t)=>{t.push(e)},"pushFile"),XE=ue(()=>{},"empty$1");function ha(e){const{excludeFiles:t,filters:r,onlyCounts:n}=e;return t?XE:r&&r.length?n?UE:KE:n?JE:VE}v(ha,"it$2");he(ha,"at");de(ha,"ut$1");ue(ha,"build$5");const YE=ue(e=>e,"getArray"),QE=ue(()=>[""].slice(0,0),"getArrayGroup");function ga(e){return e.group?QE:YE}v(ga,"nt$1");he(ga,"ct");de(ga,"ct$1");ue(ga,"build$4");const ZE=ue((e,t,r)=>{e.push({directory:t,files:r,dir:t})},"groupFiles"),eS=ue(()=>{},"empty");function va(e){return e.group?ZE:eS}v(va,"rt$2");he(va,"ht");de(va,"ft$1");ue(va,"build$3");const tS=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()&&po(e,a,t))return n.dequeue(null,t);r(c,a),n.dequeue(null,t)})})},"resolveSymlinksAsync"),rS=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()&&po(e,s,t))return;r(a,s)}catch(s){if(!o)throw s}},"resolveSymlinks");function ba(e,t){return!e.resolveSymlinks||e.excludeSymlinks?null:t?rS:tS}v(ba,"ot$2");he(ba,"pt");de(ba,"gt$1");ue(ba,"build$2");function po(e,t,r){if(r.options.useRealPaths)return ya(t,r);let n=Xc(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=Xc(n)}return r.symlinks.set(e,t),i>1}v(po,"_$j");he(po,"L");de(po,"E$1");ue(po,"isRecursive");function ya(e,t){return t.visited.includes(e+t.options.pathSeparator)}v(ya,"lt$2");he(ya,"ft");de(ya,"dt$1");ue(ya,"isRecursiveUsingRealPaths");const nS=ue(e=>e.counts,"onlyCountsSync"),iS=ue(e=>e.groups,"groupsSync"),oS=ue(e=>e.paths,"defaultSync"),sS=ue(e=>e.paths.slice(0,e.options.maxFiles),"limitFilesSync"),aS=ue((e,t,r)=>(Pr(t,r,e.counts,e.options.suppressErrors),null),"onlyCountsAsync"),lS=ue((e,t,r)=>(Pr(t,r,e.paths,e.options.suppressErrors),null),"defaultAsync"),cS=ue((e,t,r)=>(Pr(t,r,e.paths.slice(0,e.options.maxFiles),e.options.suppressErrors),null),"limitFilesAsync"),uS=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 $a(e,t){const{onlyCounts:r,group:n,maxFiles:i}=e;return r?t?nS:aS:n?t?iS:uS:i?t?sS:cS:t?oS:lS}v($a,"at$2");he($a,"gt");de($a,"Et");ue($a,"build$1");const _g={withFileTypes:!0},pS=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"),fS=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 xa(e){return e?fS:pS}v(xa,"ut$2");he(xa,"yt");de(xa,"xt$1");ue(xa,"build");var dS=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))}},mS=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}},hS=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=$a(r,this.isSynchronous),this.root=on(t,r),this.state={root:aa(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new mS,options:r,queue:new dS((i,o)=>this.callbackInvoker(o,i,n)),symlinks:new Map,visited:[""].slice(0,0),controller:new hS,fs:r.fs||AE},this.joinPath=pa(this.root,r),this.pushDirectory=ma(this.root,r),this.pushFile=ha(r),this.getArray=ga(r),this.groupFiles=va(r),this.resolveSymlink=ba(r,this.isSynchronous),this.walkDirectory=xa(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=ua(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=uo(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=NE(R),E=on(Xc(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 wa(e,t){return new Promise((r,n)=>{fo(e,t,(i,o)=>{if(i)return n(i);r(o)})})}v(wa,"ct$1");he(wa,"bt");de(wa,"Ct");ue(wa,"promise");function fo(e,t,r){new Pg(e,t,r).start()}v(fo,"T$m");he(fo,"G");de(fo,"x");ue(fo,"callback");function Ea(e,t){return new Pg(e,t).start()}v(Ea,"ht$2");he(Ea,"vt");de(Ea,"jt");ue(Ea,"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 wa(this.root,this.options)}withCallback(t){fo(this.root,this.options,t)}sync(){return Ea(this.root,this.options)}};let Cg=null;try{Jf.resolve("picomatch"),Cg=Jf("picomatch")}catch{}var gS=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}},vS=Object.defineProperty,Fe=de((e,t)=>vS(e,"name",{value:t,configurable:!0}),"a");const bS=Array.isArray,Tg=/\\/g,Ng=process.platform==="win32",yS=/^(\/?\.\.)+$/;function Ni(e,t={}){const r=e.length,n=Array(r),i=Array(r);let o,s;for(o=0;o<r;o++){const a=mo(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]===".."&&yS.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(Ni,"R$h");he(Ni,"B");de(Ni,"D");Fe(Ni,"getPartialMatcher");const $S=/^[A-Z]:\/$/i,xS=Ng?e=>$S.test(e):e=>e==="/";function Ii(e,t,r){if(e===t||t.startsWith(`${e}/`)){if(r){const i=e.length+ +!xS(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(Ii,"O$n");he(Ii,"M");de(Ii,"M");Fe(Ii,"buildFormat");function Sa(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(Sa,"pt$2");he(Sa,"St");de(Sa,"at");Fe(Sa,"buildRelative");const wS={parts:!0};function mo(e){var t;const r=yr.scan(e,wS);return!((t=r.parts)===null||t===void 0)&&t.length?r.parts:[e]}v(mo,"I$d");he(mo,"z");de(mo,"N");Fe(mo,"splitPattern");const ES=/\\(?![()[\]{}!+@])/g;function Zu(e){return Ig(e)}v(Zu,"qt$1");he(Zu,"Ee");de(Zu,"ut");Fe(Zu,"convertPosixPathToPattern");function ep(e){return Mg(e).replace(ES,"/")}v(ep,"jt$2");he(ep,"Re");de(ep,"ft");Fe(ep,"convertWin32PathToPattern");const SS=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,kS=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,Ig=Fe(e=>e.replace(SS,"\\$&"),"escapePosixPath"),Mg=Fe(e=>e.replace(kS,"\\$&"),"escapeWin32Path"),jS=Ng?Mg:Ig;function ka(e,t){if(t?.caseSensitiveMatch===!1)return!0;const r=yr.scan(e);return r.isGlob||r.negated}v(ka,"ft$1");he(ka,"Dt");de(ka,"k");Fe(ka,"isDynamicPattern");function Qt(...e){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...e)}v(Qt,"D$l");he(Qt,"D");de(Qt,"E");Fe(Qt,"log");function ho(e){return typeof e=="string"?[e]:e??[]}v(ho,"L$c");he(ho,"U");de(ho,"W");Fe(ho,"ensureStringArray");const AS=/^(\/?\.\.)+/,OS=/\\(?=[()[\]{}!*+?@|])/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=jS(o);s=DE(s.replace(OS,""))?$r.relative(c,s):$r.normalize(s);const u=(i=AS.exec(s))===null||i===void 0?void 0:i[0],p=mo(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]||ka(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 ja(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(ja,"gt$2");he(ja,"xt");de(ja,"St");Fe(ja,"processPatterns");function Aa(e,t){const r=e.cwd,n={root:r,depthOffset:0},i=ja(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?Ni(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=Ni(i.match,f),R=Ii(r,p,o),b=o?R:Ii(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 gS({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&&Sa(r,p)]}v(Aa,"dt$1");he(Aa,"At");de(Aa,"vt");Fe(Aa,"buildCrawler");function go(e,t){if(t)for(let r=e.length-1;r>=0;r--)e[r]=t(e[r]);return e}v(go,"z$g");he(go,"N");de(go,"U");Fe(go,"formatPaths");const RS={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function Oa(e){const t={...RS,...e};return t.cwd=(t.cwd instanceof URL?BE(t.cwd):Rg(t.cwd)).replace(Tg,"/"),t.ignore=ho(t.ignore),t.fs&&(t.fs={readdir:t.fs.readdir||TE,readdirSync:t.fs.readdirSync||CE,realpath:t.fs.realpath||PE,realpathSync:t.fs.realpathSync||_E,stat:t.fs.stat||RE,statSync:t.fs.statSync||OE}),t.debug&&Qt("globbing with options:",t),t}v(Oa,"yt$2");he(Oa,"_t");de(Oa,"pt");Fe(Oa,"getOptions");function vo(e,t={}){var r;if(e&&t?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");const n=bS(e)||typeof e=="string",i=ho((r=n?e:e.patterns)!==null&&r!==void 0?r:"**/*"),o=Oa(n?t:e);return i.length>0?Aa(o,i):[]}v(vo,"G$g");he(vo,"Q");de(vo,"G");Fe(vo,"getCrawler");async function tp(e,t){const[r,n]=vo(e,t);return r?go(await r.withPromise(),n):[]}v(tp,"mt$2");he(tp,"Ie");de(tp,"bt");Fe(tp,"glob");function Ra(e,t){const[r,n]=vo(e,t);return r?go(r.sync(),n):[]}v(Ra,"vt$2");he(Ra,"Le");de(Ra,"xt");Fe(Ra,"globSync");var _S=Object.defineProperty,PS=v((e,t)=>_S(e,"name",{value:t,configurable:!0}),"r$9"),CS=Object.defineProperty,TS=PS((e,t)=>CS(e,"name",{value:t,configurable:!0}),"a"),NS=Object.defineProperty,IS=TS((e,t)=>NS(e,"name",{value:t,configurable:!0}),"n");const Dg=IS((e,t)=>Ra(e,t),"globSync");var MS=Object.defineProperty,rp=v((e,t)=>MS(e,"name",{value:t,configurable:!0}),"o$k"),DS=Object.defineProperty,_a=rp((e,t)=>DS(e,"name",{value:t,configurable:!0}),"c"),Cl,Xf;function np(){if(Xf)return Cl;Xf=1;var e=Object.defineProperty,t=_a((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 Cl=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"),Cl}v(np,"h$k");rp(np,"q");_a(np,"requireIsExtglob");var Tl,Yf;function ip(){if(Yf)return Tl;Yf=1;var e=Object.defineProperty,t=_a((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=np(),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 Tl=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"),Tl}v(ip,"y$n");rp(ip,"G");_a(ip,"requireIsGlob");var BS=Object.defineProperty,Bg=v((e,t)=>BS(e,"name",{value:t,configurable:!0}),"t$f"),LS=Object.defineProperty,op=Bg((e,t)=>LS(e,"name",{value:t,configurable:!0}),"s");const WS=De(import.meta.url),ei=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,FS=op(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 WS(e)},"__cjs_getBuiltinModule"),{access:HS}=FS("node:fs/promises");var qS=Object.defineProperty,zS=op((e,t)=>qS(e,"name",{value:t,configurable:!0}),"o");async function et(e,t=zc){Rr(e),e=Je(e);try{return await HS(e,t),!0}catch{return!1}}v(et,"i$h");Bg(et,"d");op(et,"m");zS(et,"isAccessible");var GS=Object.defineProperty,US=v((e,t)=>GS(e,"name",{value:t,configurable:!0}),"a$q"),KS=Object.defineProperty,JS=US((e,t)=>KS(e,"name",{value:t,configurable:!0}),"e"),VS=ip();const XS=ao(VS);var YS=Object.defineProperty,QS=JS((e,t)=>YS(e,"name",{value:t,configurable:!0}),"s");const Yc=QS((e,t)=>XS(e,t),"isGlob");var ZS=Object.defineProperty,e2=v((e,t)=>ZS(e,"name",{value:t,configurable:!0}),"f$q"),t2=Object.defineProperty,Lg=e2((e,t)=>t2(e,"name",{value:t,configurable:!0}),"i");const r2=De(import.meta.url),ti=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Wg=Lg(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 r2(e)},"__cjs_getBuiltinModule"),{readFile:n2}=Wg("node:fs/promises"),{unzip:i2,brotliDecompress:o2}=Wg("node:zlib");var s2=Object.defineProperty,Fg=Lg((e,t)=>s2(e,"name",{value:t,configurable:!0}),"n");const a2={brotli:o2,gzip:i2,none:Fg((e,t)=>{t(null,e)},"none")},sp=Fg(async(e,t)=>{if(Rr(e),e=Je(e),!await et(e))throw new I$(`unable to read the non-accessible file: ${e}`);if(!await et(e,_h))throw new Error(`Unable to read the non-readable file: ${e}`);const{buffer:r,compression:n,encoding:i,flag:o}=t??{};return await n2(e,o?{encoding:i,flag:o}:{encoding:i}).then(async s=>await new Promise((a,l)=>{a2[n??"none"](s,(c,u)=>{c?l(c):a(r?u:u.toString())})})).catch(s=>{throw s})},"readFile");var l2=Object.defineProperty,Hg=v((e,t)=>l2(e,"name",{value:t,configurable:!0}),"t$d"),c2=Object.defineProperty,qg=Hg((e,t)=>c2(e,"name",{value:t,configurable:!0}),"t"),u2=Object.defineProperty,p2=qg((e,t)=>u2(e,"name",{value:t,configurable:!0}),"i");async function Tn(e,t,r){typeof t=="object"&&(r=t,t=void 0);const n=await sp(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)),xu(i,t,Je(e),{color:s})}v(Tn,"a$p");Hg(Tn,"l");qg(Tn,"c");p2(Tn,"readJson");var f2=Object.defineProperty,d2=v((e,t)=>f2(e,"name",{value:t,configurable:!0}),"a$o"),m2=Object.defineProperty,h2=d2((e,t)=>m2(e,"name",{value:t,configurable:!0}),"t"),g2=Object.defineProperty,v2=h2((e,t)=>g2(e,"name",{value:t,configurable:!0}),"t");const b2=v2(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 y2=Object.defineProperty,$2=v((e,t)=>y2(e,"name",{value:t,configurable:!0}),"i$f"),x2=Object.defineProperty,zg=$2((e,t)=>x2(e,"name",{value:t,configurable:!0}),"i");const w2=De(import.meta.url),ri=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Gg=zg(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 w2(e)},"__cjs_getBuiltinModule"),{existsSync:E2}=Gg("node:fs"),{mkdir:S2,readdir:k2,rm:j2}=Gg("node:fs/promises");var A2=Object.defineProperty,O2=zg((e,t)=>A2(e,"name",{value:t,configurable:!0}),"o");const R2=O2(async(e,t)=>{if(Rr(e),!E2(e)){await S2(e,{recursive:!0});return}const r=await k2(e),n=b2(t);for(const i of r)await j2(le(Je(e),i),n)},"emptyDir");var _2=Object.defineProperty,P2=v((e,t)=>_2(e,"name",{value:t,configurable:!0}),"m$p"),C2=Object.defineProperty,Ug=P2((e,t)=>C2(e,"name",{value:t,configurable:!0}),"s");const T2=De(import.meta.url),ni=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,N2=Ug(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 T2(e)},"__cjs_getBuiltinModule"),{mkdir:I2,writeFile:M2,stat:D2,rename:Qf,chown:B2,chmod:L2,unlink:W2}=N2("node:fs/promises");var F2=Object.defineProperty,H2=Ug((e,t)=>F2(e,"name",{value:t,configurable:!0}),"d");const q2=H2(async(e,t,r)=>{r={encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...r},Rr(e),M$(t),e=Je(e);const n=`${e}.tmp`;try{const i=await et(e,zc);if(!i&&r.recursive){const s=Ce(e);await et(s,zc)||await I2(s,{recursive:!0})}let o;if(await M2(n,D$(t),{encoding:r.encoding,flag:r.flag}),i&&!r.overwrite&&(o=await D2(e),r.chown??={gid:o.gid,uid:o.uid},await Qf(e,`${e}.bak`)),r.chown)try{await B2(n,r.chown.uid,r.chown.gid)}catch{}await L2(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 W2(`${e}.tmp`)}},"writeFile");var z2=Object.defineProperty,G2=v((e,t)=>z2(e,"name",{value:t,configurable:!0}),"a$m"),U2=Object.defineProperty,Kg=G2((e,t)=>U2(e,"name",{value:t,configurable:!0}),"n");const K2=De(import.meta.url),ii=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,J2=Kg(e=>{if(typeof ii<"u"&&ii.versions&&ii.versions.node){const[t,r]=ii.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return ii.getBuiltinModule(e)}return K2(e)},"__cjs_getBuiltinModule"),{readFile:V2}=J2("node:fs/promises");var X2=Object.defineProperty,Y2=Kg((e,t)=>X2(e,"name",{value:t,configurable:!0}),"r");const Jg=Y2(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,_h))try{const p=await V2(e,"utf8");if(n){const{indent:f}=B$(p);l=f}c=p.endsWith(`
|
|
27
|
-
`)?`
|
|
28
|
-
`:""}catch(p){if(p.code!=="ENOENT")throw p}const u=s(t,o,l);await q2(e,`${u}${c}`,a)},"writeJson");var Q2=Object.defineProperty,Dt=v((e,t)=>Q2(e,"name",{value:t,configurable:!0}),"S$b"),Z2=Object.defineProperty,_e=Dt((e,t)=>Z2(e,"name",{value:t,configurable:!0}),"b");const ek=De(import.meta.url),Gr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Pa=_e(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 ek(e)},"__cjs_getBuiltinModule"),{createRequire:tk}=Pa("node:module"),xr=Gr,{execFileSync:rk}=Pa("node:child_process"),bi=Pa("node:fs"),nk=Pa("node:tty"),r5={alert:7,critical:6,debug:1,emergency:8,error:5,informational:2,notice:3,trace:2,warning:4},ik={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"}},ok=Symbol("EMPTY");var sk=Object.defineProperty,ak=_e((e,t)=>sk(e,"name",{value:t,configurable:!0}),"g$6");const lk=ak(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 ck=Object.defineProperty,Vg=_e((e,t)=>ck(e,"name",{value:t,configurable:!0}),"T$5"),uk=Object.defineProperty,Ne=Vg((e,t)=>uk(e,"name",{value:t,configurable:!0}),"l"),pk=Object.defineProperty,fk=Ne((e,t)=>pk(e,"name",{value:t,configurable:!0}),"L");const kt=fk((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 dk=Object.defineProperty,Ca=Ne((e,t)=>dk(e,"name",{value:t,configurable:!0}),"s$6");const mk=Ca(([e,t],r,n)=>(n.truncate-=3,t?`${n.stylize(String(e),"yellow")}=${n.stylize(`"${t}"`,"string")}`:n.stylize(String(e),"yellow")),"inspectAttribute"),hk=Ca((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"),Qc=Ca((e,t,r,n)=>kt(e,e,t,r,hk,`
|
|
29
|
-
`),"inspectNodeCollection"),Xg=Ca((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+=kt(i.map(f=>[f,e.getAttribute(f)]),t,r,n,mk," ")),r.truncate-=c.length;const{truncate:u}=r;let p=Qc(e.children,r,n,void 0);return p&&p.length>u&&(p=`…(${String(e.children.length)})`),`${s}${c}${a}${p}${l}`},"inspectHTMLElement");var gk=Object.defineProperty,vk=Ne((e,t)=>gk(e,"name",{value:t,configurable:!0}),"n$4");const bk=vk((e,t,r)=>e.length===0?"Arguments []":(t.truncate-=13,`Arguments [ ${kt(e,e,t,r)} ]`),"inspectArguments");var yk=Object.defineProperty,Yg=Ne((e,t)=>yk(e,"name",{value:t,configurable:!0}),"r$3");const $k=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"),Ta=Yg((e,t)=>{if(e.length===0)return"";const r=t.prev+t.base;return r+e.split(", ").join(`,${r}`)+t.prev},"indentedJoin");var xk=Object.defineProperty,Qg=Ne((e,t)=>xk(e,"name",{value:t,configurable:!0}),"i$5");const wk=/^[a-z_]\w*$/i,Ek=/^"|"$/g,Sk=Qg((e,t)=>{if(wk.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(Ek,"'")},"quoteComplexKey"),Mi=Qg(([e,t],r,n,i)=>{n.truncate-=2;let o;typeof e=="string"?o=Sk(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 kk=Object.defineProperty,Zg=Ne((e,t)=>kk(e,"name",{value:t,configurable:!0}),"p$4");const jk=Zg(e=>{for(const t of e)if(Array.isArray(t)||typeof t=="object"&&t!==null)return!0;return!1},"multiLineValues"),Ak=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=kt(e,e,t,r);t.truncate-=o.length;let s="";i.length>0&&(s=kt(i.map(l=>[l,e[l]]),e,t,r,Mi));const a=n&&jk(e);return a&&(o=Ta(o,n)),`[${a?"":" "}${o}${s?`, ${s}`:""}${a?"":" "}]`},"inspectArray");var Ok=Object.defineProperty,Rk=Ne((e,t)=>Ok(e,"name",{value:t,configurable:!0}),"o$7");const Zf=/\d(?=(?:\d{3})+(?!\d))/g,_k=/\d{3}/g,Pk=/_$/,ev=Rk((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(_k,"$&_").replace(Pk,"")}`}}return t.replace(Zf,"$&_")},"addNumericSeparator");var Ck=Object.defineProperty,tv=Ne((e,t)=>Ck(e,"name",{value:t,configurable:!0}),"i$4");const Tk=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&&Tk(e[o-1])&&(o-=1),`${e.slice(0,o)}${r}`}return e},"truncate");var Nk=Object.defineProperty,Ik=Ne((e,t)=>Nk(e,"name",{value:t,configurable:!0}),"e$4");const ed=Ik((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 Mk=Object.defineProperty,Dk=Ne((e,t)=>Mk(e,"name",{value:t,configurable:!0}),"y");const Bk=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:void 0),Zo=Dk((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=Bk(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=kt(i.map(d=>[d,e[d]]),e,t,r,Mi),p=kt(o.map(d=>[d,e[d]]),e,t,r,Mi);let f="";return u&&p&&(f=", "),n?`${c}{${Ta(u+f+p,n)}}`:`${c}{ ${u}${f}${p} }`},"inspectObject");var Lk=Object.defineProperty,Wk=Ne((e,t)=>Lk(e,"name",{value:t,configurable:!0}),"s$3");const Fk=Wk((e,t,r,n)=>{let i="";return i=i||e.constructor.name,(!i||i==="_class")&&(i="<Anonymous Class>"),t.truncate-=i.length,`${i} ${Zo(e,t,r,n)}`},"inspectClass");var Hk=Object.defineProperty,qk=Ne((e,t)=>Hk(e,"name",{value:t,configurable:!0}),"i$3");const zk=qk((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 Gk=Object.defineProperty,Uk=Ne((e,t)=>Gk(e,"name",{value:t,configurable:!0}),"c$4");const Kk=new Set(["column","columnNumber","description","fileName","line","lineNumber","message","name","number","stack"]),Jk=Uk((e,t,r)=>{const n=Object.getOwnPropertyNames(e).filter(a=>!Kk.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=kt(n.map(a=>[a,e[a]]),e,t,r,Mi);return`${i}${o}${s?` { ${s} }`:""}`},"inspectObject");var Vk=Object.defineProperty,Xk=Ne((e,t)=>Vk(e,"name",{value:t,configurable:!0}),"c$3");const td=Xk((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 Yk=Object.defineProperty,rv=Ne((e,t)=>Yk(e,"name",{value:t,configurable:!0}),"p$3");const Qk=rv(([e,t],r,n,i)=>(n.truncate-=4,e=i(e,r,n),n.truncate-=e.length,`${e} => ${i(t,r,n)}`),"inspectMapEntry"),Zk=rv((e,t,r,n)=>{if(e.size<=0)return"Map (0) {}";t.truncate-=7;let i=kt([...e.entries()],e,t,r,Qk);return n&&(i=Ta(i,n)),`Map (${String(e.size)}) {${n?"":" "}${i}${n?"":" "}}`},"inspectMap");var ej=Object.defineProperty,tj=Ne((e,t)=>ej(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$f");Dt(jr,"Y");_e(jr,"j$5");Vg(jr,"P");Ne(jr,"u$3");tj(jr,"inspectNumber");var rj=Object.defineProperty,nj=Ne((e,t)=>rj(e,"name",{value:t,configurable:!0}),"e$2");const ij=nj(()=>"Promise{…}","getPromiseValue");var oj=Object.defineProperty,sj=Ne((e,t)=>oj(e,"name",{value:t,configurable:!0}),"p$1");const aj=sj((e,t)=>{const r=t.truncate-(2+e.flags.length);return t.stylize(`/${ar(e.source,r)}/${e.flags}`,"regexp")},"inspectRegExp");var lj=Object.defineProperty,cj=Ne((e,t)=>lj(e,"name",{value:t,configurable:!0}),"i$1");const uj=cj((e,t,r,n)=>{if(e.size===0)return"Set (0) {}";t.truncate-=7;let i=kt([...e],e,t,r);return n&&(i=Ta(i,n)),`Set (${String(e.size)}) {${n?"":" "}${i}${n?"":" "}}`},"inspectSet");var pj=Object.defineProperty,fj=Ne((e,t)=>pj(e,"name",{value:t,configurable:!0}),"l");const dj=fj((e,t)=>{const r=t.quoteStyle==="double"?'"':"'";return t.quoteStyle==="double"&&(e=e.replaceAll('"','"')),r+e+r},"wrapQuotes");var mj=Object.defineProperty,nv=Ne((e,t)=>mj(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"),hj={" ":String.raw`\t`,"\n":String.raw`\n`,"\f":String.raw`\f`,"\r":String.raw`\r`,"\b":String.raw`\b`,"'":String.raw`\'`,"\\":"\\\\"},gj=16,vj=nv(e=>hj[e]||String.raw`\u${`0000${e.codePointAt(0).toString(gj)}`.slice(-4)}`,"escape"),nd=nv((e,t)=>(rd.test(e)&&(e=e.replaceAll(rd,vj)),t.stylize(dj(ar(e,t.truncate-2),t),"string")),"inspectString");var bj=Object.defineProperty,yj=Ne((e,t)=>bj(e,"name",{value:t,configurable:!0}),"o");const id=yj(e=>"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString(),"inspectSymbol");var $j=Object.defineProperty,iv=Ne((e,t)=>$j(e,"name",{value:t,configurable:!0}),"f");const xj=iv(e=>typeof Buffer=="function"&&e instanceof Buffer?"Buffer":e[Symbol.toStringTag],"getArrayName"),Lt=iv((e,t,r)=>{const n=xj(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=kt(i.map(a=>[a,e[a]]),e,t,r,Mi)),`${n}[ ${o}${s?`, ${s}`:""} ]`},"inspectTypedArray");var wj=Object.defineProperty,Ue=Ne((e,t)=>wj(e,"name",{value:t,configurable:!0}),"r");const hs=new WeakMap,Zc={},Ej={Arguments:bk,Array:Ak,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:zk,Error:Jk,Float32Array:Lt,Float64Array:Lt,Function:td,function:td,Generator:Ue(()=>"","Generator"),HTMLCollection:Qc,Int8Array:Lt,Int16Array:Lt,Int32Array:Lt,Map:Zk,NodeList:Qc,null:Ue((e,t)=>t.stylize("null","null"),"null"),Number:jr,number:jr,Promise:ij,RegExp:aj,Set:uj,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"),Sj=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&&hs.has(e.constructor))return hs.get(e.constructor)?.(e,t)??"unknown";const i=Zc[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?$k(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=Ej[s];if(a!==void 0)return a(e,t,i,o);if(t.customInspect&&e){const c=Sj(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?Zo(e,t,i,o):e&&typeof HTMLElement=="function"&&e instanceof HTMLElement?Xg(e,e,t,i):"constructor"in e?e.constructor!==Object?Fk(e,t,i,o):Zo(e,t,i,o):e===Object(e)?Zo(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)=>hs.has(e)?!1:(hs.set(e,t),!0),"registerConstructor");Ue((e,t)=>e in Zc?!1:(Zc[e]=t,!0),"registerStringTag");var kj=Object.defineProperty,jj=_e((e,t)=>kj(e,"name",{value:t,configurable:!0}),"r$6");const Aj=jj((e,t)=>(t.__write??t.write.bind(t)).call(t,e),"writeStream");var Oj=Object.defineProperty,Rj=_e((e,t)=>Oj(e,"name",{value:t,configurable:!0}),"A$4"),_j=Object.defineProperty,ap=Rj((e,t)=>_j(e,"name",{value:t,configurable:!0}),"$"),Pj=Object.defineProperty,Cj=ap((e,t)=>Pj(e,"name",{value:t,configurable:!0}),"r$1");const Tj=Cj(e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
|
|
31
|
-
`),"normalizeLF"),Nj=globalThis.process??Object.create(null),ad={versions:{}},ld=new Proxy(Nj,{get(e,t){if(t in e)return e[t];if(t in ad)return ad[t]}});var Ij=Object.defineProperty,Mj=ap((e,t)=>Ij(e,"name",{value:t,configurable:!0}),"b");const Dj=Mj((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 Bj=Object.defineProperty,No=ap((e,t)=>Bj(e,"name",{value:t,configurable:!0}),"t");const Lj=ld.platform==="win32"&&!ld.env?.WT_SESSION?">":"❯",Wj=No((e,t,r)=>{const n={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...r,color:{gutter:No(m=>m,"gutter"),marker:No(m=>m,"marker"),message:No(m=>m,"message"),...r?.color}},i=typeof t.start.column=="number";let o=Tj(e).split(`
|
|
32
|
-
`);typeof n.tabWidth=="number"&&(o=o.map(m=>m.replaceAll(" "," ".repeat(n.tabWidth))));const{end:s,markerLines:a,start:l}=Dj(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(Lj),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 Fj=Object.defineProperty,Hj=_e((e,t)=>Fj(e,"name",{value:t,configurable:!0}),"x$3"),qj=Object.defineProperty,zj=Hj((e,t)=>qj(e,"name",{value:t,configurable:!0}),"x"),Gj=Object.defineProperty,qt=zj((e,t)=>Gj(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>",Uj=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Kj=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,Jj=/(.*?):(\d+):(\d+)(?:\s<-\s.+:\d+:\d+)?/,Vj=/eval\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*<anonymous>?:(\d+)?:(\d+)/,Xj=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,Yj=/in\s(.*)\s\(at\s(.+)\)\sat/,Qj=/^(?:.*@)?(.*):(\d+):(\d+)$/,Zj=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,eA=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tA=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,cd=/\(error: (.*)\)/,rA=/at\s/,nA=/^(\S+):(\d+):(\d+)$|^(\S+):(\d+)$/,iA=/^\s+|\s+$/g,oA=/\S*(?:Error: |AggregateError:)/,sv=/^Anonymous function$/,sA=/^\s*in\s.*/,aA=/^.*?\s*at\s.*/,lA=/^.*?\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=Jj.exec(t);r&&(e.file=r[1],e.line=+r[2],e.column=+r[3])},"parseMapped"),cA=qt(e=>{const t=Yj.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=Xj.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(rA,""):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"),uA=qt(e=>{const t=Uj.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=Kj.exec(e);if(c){const u=nA.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=Vj.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"),pA=qt((e,t)=>{const r=Zj.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]&&eA.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"),fA=qt((e,t)=>{const r=tA.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"),dA=qt(e=>{const t=Qj.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(iA,"")).filter(o=>!oA.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(sA.test(s))l=cA(s);else if(aA.test(s))l=uA(s);else if(lA.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=fA(s,c)??pA(s,c)}else l=dA(s);return l?o.push(l):Ar(`parse error stack line: "${s}"`,"not parser found"),o},[])},"parseStacktrace");var mA=Object.defineProperty,hA=_e((e,t)=>mA(e,"name",{value:t,configurable:!0}),"p$6"),gA=Object.defineProperty,uv=hA((e,t)=>gA(e,"name",{value:t,configurable:!0}),"m");const vA=tk(import.meta.url),Ur=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,lp=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 vA(e)},"__cjs_getBuiltinModule"),{existsSync:bA,readFileSync:yA}=lp("node:fs"),{relative:$A}=lp("node:path"),{cwd:xA}=Ur,{fileURLToPath:wA}=lp("node:url");var EA=Object.defineProperty,Le=uv((e,t)=>EA(e,"name",{value:t,configurable:!0}),"o");const Nn=Le((e,t,r)=>r===0?e:t===" "?e+" ".repeat(r):e+" ".repeat(t*r),"getPrefix"),SA=Le((e,t)=>{const r=e.replace("async file:","file:");return $A(t,r.startsWith("file:")?wA(r):r)},"getRelativePath"),kA=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)=>`${Nn(i,n,o)}${kA(e,r,t)}
|
|
37
|
-
`,"getMessage"),fv=Le((e,{color:t,indentation:r,prefix:n},i)=>{if(e.hint===void 0)return;const o=Nn(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"),cp=Le((e,{color:t,cwd:r,displayShortPath:n,indentation:i,prefix:o},s=0)=>{const a=n?SA(e.file,r):e.file,{fileLine:l,method:c}=t;return`${Nn(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(!bA(u))return;const p=yA(u,"utf8");return Wj(p,{start:{column:e.column,line:e.line}},{color:t,linesAbove:n,linesBelow:i,prefix:Nn(o,r,c),showGutter:s,showLineNumbers:a,tabWidth:l})},"getCode"),mv=Le((e,t,r)=>{if(e.errors.length===0)return;let n=`${Nn(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=`${Nn(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+=cp(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"),jA=Le((e,t)=>(e.length>0?`
|
|
51
|
-
`:"")+e.map(r=>cp(r,t)).join(`
|
|
52
|
-
`),"getStacktrace"),gv=Le((e,t,r)=>{const n={cwd:xA(),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?cp(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?jA(i,n):void 0].filter(Boolean).join(`
|
|
53
|
-
`).replaceAll("\\","/")},"internalRenderError"),Nl=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 AA=Object.defineProperty,up=_e((e,t)=>AA(e,"name",{value:t,configurable:!0}),"s$3"),OA=Object.defineProperty,Na=up((e,t)=>OA(e,"name",{value:t,configurable:!0}),"l");const pp=[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],fp=[12288,12288,65281,65376,65504,65510],dp=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],mp=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],Ia=[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 RA=Object.defineProperty,_A=Na((e,t)=>RA(e,"name",{value:t,configurable:!0}),"r$1");const bo=_A((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 PA=Object.defineProperty,Cr=Na((e,t)=>PA(e,"name",{value:t,configurable:!0}),"r");const CA=pp[0],TA=pp.at(-1),NA=fp[0],IA=fp.at(-1),MA=dp[0],DA=dp.at(-1),BA=mp[0],LA=mp.at(-1),WA=Ia[0],FA=Ia.at(-1),ud=19968,[HA,qA]=In(Ia);function In(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(In,"X$b");Dt(In,"ge");_e(In,"b$2");up(In,"b");Na(In,"N");Cr(In,"findWideFastPathRange");const vv=Cr(e=>e<CA||e>TA?!1:bo(pp,e),"isAmbiguous"),bv=Cr(e=>e<NA||e>IA?!1:bo(fp,e),"isFullWidth"),zA=Cr(e=>e<MA||e>DA?!1:bo(dp,e),"isHalfWidth"),GA=Cr(e=>e<BA||e>LA?!1:bo(mp,e),"isNarrow"),yv=Cr(e=>e>=HA&&e<=qA?!0:e<WA||e>FA?!1:bo(Ia,e),"isWide");function Mn(e){return vv(e)?"ambiguous":bv(e)?"fullwidth":zA(e)?"halfwidth":GA(e)?"narrow":yv(e)?"wide":"neutral"}v(Mn,"ee$a");Dt(Mn,"pe");_e(Mn,"v$2");up(Mn,"q");Na(Mn,"getCategory");Cr(Mn,"getCategory");var UA=Object.defineProperty,Ma=_e((e,t)=>UA(e,"name",{value:t,configurable:!0}),"i$3"),KA=Object.defineProperty,Da=Ma((e,t)=>KA(e,"name",{value:t,configurable:!0}),"a"),JA=Object.defineProperty,hp=Da((e,t)=>JA(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");_e(Tr,"s$2");Ma(Tr,"s");Da(Tr,"r");hp(Tr,"validate");function Nr(e){return Tr(e),Mn(e)}v(Nr,"H$c");Dt(Nr,"K");_e(Nr,"r$5");Ma(Nr,"p");Da(Nr,"eastAsianWidthType");hp(Nr,"eastAsianWidthType");function yo(e,{ambiguousAsWide:t=!1}={}){return Tr(e),bv(e)||yv(e)||t&&vv(e)?2:1}v(yo,"ve$5");Dt(yo,"Fe");_e(yo,"o$5");Ma(yo,"W");Da(yo,"eastAsianWidth");hp(yo,"eastAsianWidth");var VA=Object.defineProperty,XA=_e((e,t)=>VA(e,"name",{value:t,configurable:!0}),"p$3"),YA=Object.defineProperty,$v=XA((e,t)=>YA(e,"name",{value:t,configurable:!0}),"e"),QA=Object.defineProperty,ZA=$v((e,t)=>QA(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?)`,eO=ZA(()=>new RegExp(xv`\p{RI}{2}|(?)${pd}(?:\u200D${pd})*`,"gu"),"default");var tO=Object.defineProperty,rO=$v((e,t)=>tO(e,"name",{value:t,configurable:!0}),"p");const Dn=new Set(["\x1B",""]),Ba="\x07",wv="[",gp="m",gs="]8;;",nO=39,iO=/[\u200B\uFEFF\u2060-\u2064]/g,oO=new RegExp(`(?:\\${wv}(?<code>\\d+)m|\\${gs}(?<uri>.*)${Ba})`),sO=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]])),oi=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,Io=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,es=eO();rO(e=>e.replace(es,""),"stripEmoji");var aO=Object.defineProperty,lO=_e((e,t)=>aO(e,"name",{value:t,configurable:!0}),"E"),cO=Object.defineProperty,uO=lO((e,t)=>cO(e,"name",{value:t,configurable:!0}),"A"),pO=Object.defineProperty,La=uO((e,t)=>pO(e,"name",{value:t,configurable:!0}),"d");const fd=new Map,Mo=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,ts=La(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"),fO=La((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(ts(e)==="latin")o=t.width.regular;else if(ts(e)==="control")o=t.width.control;else if(ts(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"),dO=La(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"),eu=La((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?eu(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(oi,""),h=eu(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(oi.lastIndex=s,oi.test(e)){const y=oi.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=oi.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(Mo.lastIndex=s,Mo.test(e)){const y=(Mo.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=Mo.lastIndex;continue}if((d<=31||d>=127&&d<=159)&&(Io.lastIndex=s,Io.test(e))){const y=(Io.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=Io.lastIndex;continue}if(es.lastIndex=s,es.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=es.lastIndex;continue}const m=e.codePointAt(s)??0;if(dO(m)){s+=m>65535?2:1;continue}let g;if(o)g=fO(m,r);else switch(ts(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 mO=Object.defineProperty,hO=_e((e,t)=>mO(e,"name",{value:t,configurable:!0}),"i$1"),gO=Object.defineProperty,vO=hO((e,t)=>gO(e,"name",{value:t,configurable:!0}),"e"),bO=Object.defineProperty,yO=vO((e,t)=>bO(e,"name",{value:t,configurable:!0}),"r");const ht=yO((e,t={})=>eu(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var $O=Object.defineProperty,Ev=_e((e,t)=>$O(e,"name",{value:t,configurable:!0}),"b"),xO=Object.defineProperty,Ir=Ev((e,t)=>xO(e,"name",{value:t,configurable:!0}),"d"),wO=Object.defineProperty,EO=Ir((e,t)=>wO(e,"name",{value:t,configurable:!0}),"a");const SO=/\x1B\[(\d+)m/;let Sv=class{static{v(this,"Wt")}static{Dt(this,"Pt")}static{_e(this,"T")}static{Ev(this,"T")}static{Ir(this,"d")}static{EO(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const r=SO.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 kO=Object.defineProperty,kv=Ir((e,t)=>kO(e,"name",{value:t,configurable:!0}),"o");const jv=kv((e,t)=>{if(!Dn.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const r=!0,n=e.slice(t+1,t+1+gs.length).join("")===gs;return{isInsideEscape:r,isInsideLinkEscape:n}},"checkEscapeSequence"),jO=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&&Dn.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===Ba)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===gp){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 AO=Object.defineProperty,OO=Ir((e,t)=>AO(e,"name",{value:t,configurable:!0}),"t$1");const dd=OO(e=>`${Dn.values().next().value}${wv}${String(e)}${gp}`,"wrapAnsiCode");var RO=Object.defineProperty,_O=Ir((e,t)=>RO(e,"name",{value:t,configurable:!0}),"s");const md=_O(e=>`${Dn.values().next().value}${gs}${e}${Ba}`,"wrapAnsiHyperlink");var PO=Object.defineProperty,CO=Ir((e,t)=>PO(e,"name",{value:t,configurable:!0}),"l");const TO=CO(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,Dn.has(l)){const u=oO.exec(i.slice(s))?.groups??{};if(u.code!==void 0){const p=Number.parseFloat(u.code);r=p===nO?void 0:p}else u.uri!==void 0&&(n=u.uri.length===0?void 0:u.uri)}const c=sO.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 NO=Object.defineProperty,rr=Ir((e,t)=>NO(e,"name",{value:t,configurable:!0}),"f");const Av=/(?=\s)|(?<=\s)/,Ov=/^\s+$/,Il=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(Dn.has(p)){a=!0,c=p,o+=p,l=jv([...e],u).isInsideLinkEscape,u+=1;continue}if(a){c+=p,o+=p,l?p===Ba&&(a=l=!1):p===gp&&(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"),IO=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 jO(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"),MO=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"),DO=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(Il(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(Il(r?wr(s):s)),s="",a=0,r&&u)){l+=1;continue}s+=c,a+=p,l+=1}return s&&o.push(Il(r?wr(s):s)),o},"wrapAndBreakWords"),yi={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},BO=rr((e,t={})=>{const{removeZeroWidthCharacters:r=!0,trim:n=!0,width:i=80,wrapMode:o=yi.PRESERVE_WORDS}=t;if(n&&e.trim()==="")return"";let s=e.normalize("NFC").replaceAll(`\r
|
|
57
|
-
`,`
|
|
58
|
-
`);return r&&(s=s.replaceAll(iO,"")),s.split(`
|
|
59
|
-
`).map(a=>{if(n&&a.trim()==="")return"";let l;switch(o){case yi.BREAK_AT_CHARACTERS:{l=IO(a,i,n);break}case yi.BREAK_WORDS:{l=DO(a,i,n);break}case yi.STRICT_WIDTH:{l=Rv(a,i,n);break}default:l=MO(a,i,n)}return TO(l)}).join(`
|
|
60
|
-
`)},"wordWrap");var LO=Object.defineProperty,lr=_e((e,t)=>LO(e,"name",{value:t,configurable:!0}),"n$2");const _v=80,Pv=24,tu=lr((e,t,{shell:r,env:n}={})=>rk(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:r,env:n}).trim(),"exec"),rs=lr((e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),"create"),Cv=lr((e,t)=>{const{columns:r,rows:n}=rs(e,t);if(!(Number.isNaN(r)||Number.isNaN(n))&&!(r===_v&&n===Pv))return{columns:r,rows:n}},"createIfNotDefault"),WO=lr(()=>{if(xr.platform!=="linux")return!0;try{const e=bi.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 Wa(){const{env:e,stdout:t,stderr:r}=xr;if(t?.columns&&t?.rows)return rs(t.columns,t.rows);if(r?.columns&&r?.rows)return rs(r.columns,r.rows);if(e.COLUMNS&&e.LINES)return rs(e.COLUMNS,e.LINES);const n={columns:_v,rows:Pv};return xr.platform==="win32"?Ml()??n:xr.platform==="darwin"?hd()??Ml()??n:hd()??Ml()??FO()??n}v(Wa,"_e$4");Dt(Wa,"ja");_e(Wa,"O");lr(Wa,"terminalSize");const hd=lr(()=>{try{const e=xr.platform==="darwin"?bi.constants.O_EVTONLY|bi.constants.O_NONBLOCK:bi.constants.O_NONBLOCK,{columns:t,rows:r}=nk.WriteStream(bi.openSync("/dev/tty",e));return{columns:t,rows:r}}catch{}},"devTty"),Ml=lr(()=>{try{const e=tu("tput",["cols"],{env:{TERM:"dumb",...xr.env}}),t=tu("tput",["lines"],{env:{TERM:"dumb",...xr.env}});if(e&&t)return Cv(e,t)}catch{}},"tput"),FO=lr(()=>{try{if(!WO())return;const e=tu("resize",["-u"]).match(/\d+/g);if(e.length===2)return Cv(e[0],e[1])}catch{}},"resize");var HO=Object.defineProperty,qO=_e((e,t)=>HO(e,"name",{value:t,configurable:!0}),"r$2");const zO=qO(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 GO=Object.defineProperty,UO=_e((e,t)=>GO(e,"name",{value:t,configurable:!0}),"r$1");const{bold:KO,cyan:JO,green:gd,grey:VO,magenta:XO,red:YO,yellow:Dl}=Os,QO={indent:2,quoteStyle:"single",stylize:UO((e,t)=>{const r={bigint:Dl,boolean:Dl,date:XO,null:KO,number:Dl,regexp:YO,special:JO,string:gd,symbol:gd,undefined:VO};return Object.hasOwn(r,t)?r[t](e):e},"stylize")};var ZO=Object.defineProperty,eR=_e((e,t)=>ZO(e,"name",{value:t,configurable:!0}),"o$1");const{bold:tR,underline:rR}=Os,nR=eR((e,t)=>{let r=t.uppercase.label?e.toUpperCase():e;return r=t.underline.label?rR(r):r,t.bold.label&&(r=tR(r)),r},"formatLabel");var iR=Object.defineProperty,Tv=_e((e,t)=>iR(e,"name",{value:t,configurable:!0}),"o");const oR=Tv(e=>[e.getHours(),e.getMinutes(),e.getSeconds()].map(t=>String(t).padStart(2,"0")).join(":"),"dateFormatter");class sR{static{v(this,"to")}static{Dt(this,"ro")}static{_e(this,"AbstractPrettyReporter")}static{Tv(this,"AbstractPrettyReporter")}styles;loggerTypes;constructor(t){this.styles={bold:{label:!1},dateFormatter:oR,underline:{label:!1,message:!1,prefix:!1,suffix:!1},uppercase:{label:!1},...t},this.loggerTypes=ik}setLoggerTypes(t){this.loggerTypes=t}}var aR=Object.defineProperty,Nv=v((e,t)=>aR(e,"name",{value:t,configurable:!0}),"x$l"),lR=Object.defineProperty,Iv=Nv((e,t)=>lR(e,"name",{value:t,configurable:!0}),"x");De(import.meta.url);const cR=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{stdout:uR,stderr:pR}=cR;var fR=Object.defineProperty,Mv=Iv((e,t)=>fR(e,"name",{value:t,configurable:!0}),"b");const{bgGrey:dR,bold:vd,cyan:mR,green:hR,greenBright:gR,grey:ur,red:Bl,underline:bd,white:vR}=Os,bR=/[\\/]pail[\\/]dist/,Ll=Mv(e=>!bR.test(e),"pailFileFilter");let i5=class extends sR{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={...QO,indent:void 0,...n},this.#n={...r,color:{fileLine:hR,hint:mR,marker:Bl,message:Bl,method:gR,title:Bl}},this.#e=uR,this.#i=pR}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):Aj(`${r}
|
|
62
|
-
`,o)}formatMessage(t){const{columns:r}=Wa();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?Os[j]:vR,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=zO(this.loggerTypes);O.length>0&&E.push(ur(" ".repeat(O.length)))}const h=lk(this.loggerTypes),A=ht(h);if(u){const O=ht(u),k=Math.max(0,A-O);E.push(`${vd(R(nR(u,this.styles)))} `," ".repeat(k))}else E.push(" ".repeat(A+1));d&&E.push(`${dR.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!==ok){const O=typeof p=="string"?p:sd(p,this.#r);E.push(b+BO(O,{trim:!1,width:n-3,wrapMode:yi.STRICT_WIDTH}))}if(o){let O=!1;E.push(...o.map(k=>{if(k instanceof Error)return O=!0,`
|
|
63
|
-
|
|
64
|
-
${Nl(k,{...this.#n,filterStacktrace:Ll,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(Nl(a,{...this.#n,filterStacktrace:Ll,prefix:b})),y&&E.push(`
|
|
67
|
-
|
|
68
|
-
${Nl(y,{...this.#n,filterStacktrace:Ll,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 s5="@visulima/packem",Dv="2.0.0-alpha.82";const a5={version:Dv};var yR=Object.defineProperty,Bv=v((e,t)=>yR(e,"name",{value:t,configurable:!0}),"o$e"),$R=Object.defineProperty,Lv=Bv((e,t)=>$R(e,"name",{value:t,configurable:!0}),"o"),xR=Object.defineProperty,wR=Lv((e,t)=>xR(e,"name",{value:t,configurable:!0}),"o");let vp=class extends Error{static{v(this,"s")}static{Bv(this,"u")}static{Lv(this,"n")}static{wR(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 ER=Object.defineProperty,Wv=v((e,t)=>ER(e,"name",{value:t,configurable:!0}),"a$k"),SR=Object.defineProperty,Fv=Wv((e,t)=>SR(e,"name",{value:t,configurable:!0}),"o"),kR=Object.defineProperty,jR=Fv((e,t)=>kR(e,"name",{value:t,configurable:!0}),"r");async function $o(e,t,r){const{buffer:n,compression:i,encoding:o="utf8",flag:s,...a}=r??{},l=await sp(e,{buffer:n,compression:i,encoding:o,flag:s});return typeof t=="function"?cs(l,t,a):cs(l,a)}v($o,"n$i");Wv($o,"g");Fv($o,"l");jR($o,"readYaml");var AR=Object.defineProperty,Hv=v((e,t)=>AR(e,"name",{value:t,configurable:!0}),"n$h"),OR=Object.defineProperty,qv=Hv((e,t)=>OR(e,"name",{value:t,configurable:!0}),"o"),RR=Object.defineProperty,_R=qv((e,t)=>RR(e,"name",{value:t,configurable:!0}),"t");function xo(e,t,r){const{buffer:n,compression:i,encoding:o="utf8",flag:s,...a}=r??{},l=wu(e,{buffer:n,compression:i,encoding:o,flag:s});return typeof t=="function"?cs(l,t,a):cs(l,a)}v(xo,"o$d");Hv(xo,"g");qv(xo,"l");_R(xo,"readYamlSync");var PR=Object.defineProperty,CR=v((e,t)=>PR(e,"name",{value:t,configurable:!0}),"d$t"),TR=Object.defineProperty,NR=CR((e,t)=>TR(e,"name",{value:t,configurable:!0}),"f"),IR=Object.defineProperty,Bn=NR((e,t)=>IR(e,"name",{value:t,configurable:!0}),"c");const zv=Bn((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"),Gv=Bn(async e=>{const t=await Sg("pnpm-workspace.yaml",{cwd:Ce(e),type:"file"});if(!t)return;const r=await $o(t),n=Array.isArray(r.packages)?r.packages:[];if(!zv(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"),Uv=Bn(e=>{const t=Ag("pnpm-workspace.yaml",{cwd:Ce(e),type:"file"});if(!t)return;const r=xo(t),n=Array.isArray(r.packages)?r.packages:[];if(!zv(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"),MR=Bn((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"),DR=Bn((e,t)=>{for(const[r,n]of Object.entries(e)){if(typeof n!="string")continue;const i=MR(r,n,t);i&&(e[r]=i)}},"resolveDependenciesCatalogReferences"),Fa=Bn((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];DR(i,t)}},"resolveCatalogReferences");var BR=Object.defineProperty,Ve=v((e,t)=>BR(e,"name",{value:t,configurable:!0}),"l$p"),LR=Object.defineProperty,He=Ve((e,t)=>LR(e,"name",{value:t,configurable:!0}),"f");const WR=De(import.meta.url),si=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,bp=He(e=>{if(typeof si<"u"&&si.versions&&si.versions.node){const[t,r]=si.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return si.getBuiltinModule(e)}return WR(e)},"__cjs_getBuiltinModule"),{existsSync:Kv}=bp("node:fs"),{createInterface:FR}=bp("node:readline"),{styleText:dt}=bp("node:util");var HR=Object.defineProperty,Ge=He((e,t)=>HR(e,"name",{value:t,configurable:!0}),"f");const It=Ge(e=>{const t=typeof e;return e!==null&&(t==="object"||t==="function")},"isObject"),qR=Ge(e=>{if(!It(e))return!1;for(const t in e)if(Object.hasOwn(e,t))return!1;return!0},"isEmptyObject"),Jv=new Set(["__proto__","prototype","constructor"]),Vv=1e6,zR=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<=Vv}return!1}v(Mr,"w$h");Ve(Mr,"b");He(Mr,"p$1");Ge(Mr,"shouldCoerceToNumber");function an(e,t){return Jv.has(e)?!1:(e&&Mr(e)?t.push(Number.parseInt(e,10)):t.push(e),!0)}v(an,"P$j");Ve(an,"P");He(an,"y");Ge(an,"processSegment");function Ha(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<=Vv&&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"&&!zR(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(Ha,"N$h");Ve(Ha,"B");He(Ha,"parsePath");Ge(Ha,"parsePath");function Dr(e){if(typeof e=="string")return Ha(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(Jv.has(n))return[];typeof n=="string"&&Mr(n)?t.push(Number.parseInt(n,10)):t.push(n)}return t}return[]}v(Dr,"b$o");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 qa(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(qa,"T$g");Ve(qa,"M");He(qa,"setProperty");Ge(qa,"setProperty");function yp(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(yp,"q$f");Ve(yp,"ue");He(yp,"deleteProperty");Ge(yp,"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$n");Ve(er,"y");He(er,"hasProperty");Ge(er,"hasProperty");function Di(e){if(typeof e!="string")throw new TypeError(`Expected a string, got ${typeof e}`);return e.replaceAll(/[\\.[]/g,String.raw`\$&`)}v(Di,"E$d");Ve(Di,"x");He(Di,"escapePath");Ge(Di,"escapePath");function za(e){const t=Object.entries(e);return Array.isArray(e)?t.map(([r,n])=>[Mr(r)?Number.parseInt(r,10):r,n]):t}v(za,"D$i");Ve(za,"R");He(za,"m$2");Ge(za,"normalizeEntries");function Ga(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=Di(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=Di(o);n.push(i===0?s:`.${s}`)}}return n.join("")}v(Ga,"F$d");Ve(Ga,"Y");He(Ga,"stringifyPath");Ge(Ga,"stringifyPath");function*wo(e,t=[],r=new Set){if(!It(e)||qR(e)){t.length>0&&(yield Ga(t));return}if(!r.has(e)){r.add(e);for(const[n,i]of za(e))t.push(n),yield*wo(i,t,r),t.pop();r.delete(e)}}v(wo,"j$i");Ve(wo,"S");He(wo,"x");Ge(wo,"deepKeysIterator");function $p(e){return[...wo(e)]}v($p,"G$e");Ve($p,"ge");He($p,"deepKeys");Ge($p,"deepKeys");function xp(e){const t={};if(!It(e))return t;for(const[r,n]of Object.entries(e))qa(t,r,n);return t}v(xp,"K$a");Ve(xp,"de");He(xp,"unflatten");Ge(xp,"unflatten");var GR=Object.defineProperty,Wl=He((e,t)=>GR(e,"name",{value:t,configurable:!0}),"i");const UR=Wl(async e=>{const{default:t=!1,message:r,transformer:n}=e,i=Wl(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=Wl(s=>n?n(s):s?dt(["greenBright"],"Yes"):dt(["yellowBright"],"No"),"formatAnswer");return new Promise(s=>{const a=FR({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"),KR=typeof process.stdout<"u"&&!process.versions.deno&&!globalThis.window;var JR=Object.defineProperty,ze=He((e,t)=>JR(e,"name",{value:t,configurable:!0}),"l");const Xv=/, ([^,]*)$/,vs=new Map,Yv=new Map;let VR=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 Ua=ze((e,t,r=[])=>{const n=[];if(J$(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 VR(i)}return e},"normalizeInput"),XR=ze(async e=>await $o(e),"parseYamlFile"),YR=ze(e=>xo(e),"parseYamlFileSync"),QR=ze(async e=>{const t=await sp(e);return Ih.parse(t)},"parseJson5File"),ZR=ze(e=>{const t=wu(e);return Ih.parse(t)},"parseJson5FileSync"),Qv=ze(async(e,t)=>t?.yaml!==!1&&(e.endsWith(".yaml")||e.endsWith(".yml"))?XR(e):t?.json5!==!1&&e.endsWith(".json5")?QR(e):Tn(e),"parsePackageFile"),Zv=ze((e,t)=>t?.yaml!==!1&&(e.endsWith(".yaml")||e.endsWith(".yml"))?YR(e):t?.json5!==!1&&e.endsWith(".json5")?ZR(e):L$(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 vp(`No such file or directory, for ${n.join(", ").replace(Xv," or $1")} found.`);const o=t.cache&&typeof t.cache!="boolean"?t.cache:Yv;if(t.cache&&o.has(i))return o.get(i);const s=await Qv(i,t);if(t.resolveCatalogs){const l=await Gv(i);l&&Fa(s,l)}Ua(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 vp(`No such file or directory, for ${n.join(", ").replace(Xv," or $1")} found.`);const o=t.cache&&typeof t.cache!="boolean"?t.cache:Yv;if(t.cache&&o.has(i))return o.get(i);const s=Zv(i,t);if(t.resolveCatalogs){const l=Uv(i);l&&Fa(s,l)}Ua(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());W$(le(i,"package.json"),e,n)},"writePackageJsonSync");const e_=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(Kv(e)){o=e;const a=t?.cache&&typeof t.cache!="boolean"?t.cache:vs;if(t?.cache&&a.has(o))return a.get(o);n=Zv(o,t),i=!0}else n=xu(e);if(t?.resolveCatalogs)if(i){const a=Uv(e);a&&Fa(n,a)}else throw new Error("The 'resolveCatalogs' option can only be used on a file path.");Ua(n,t?.strict??!1,t?.ignoreWarnings);const s=n;return i&&t?.cache&&(typeof t.cache=="boolean"?vs:t.cache).set(o,s),s},"parsePackageJsonSync"),u5=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(Kv(e)){o=e;const a=t?.cache&&typeof t.cache!="boolean"?t.cache:vs;if(t?.cache&&a.has(o))return a.get(o);n=await Qv(o,t),i=!0}else n=xu(e);if(t?.resolveCatalogs)if(i){const a=await Gv(e);a&&Fa(n,a)}else throw new Error("The 'resolveCatalogs' option can only be used on a file path.");Ua(n,t?.strict??!1,t?.ignoreWarnings);const s=n;return i&&t?.cache&&(typeof t.cache=="boolean"?vs:t.cache).set(o,s),s},"parsePackageJson");ze((e,t,r)=>Nt(e,t,r),"getPackageJsonProperty");ze((e,t)=>er(e,t),"hasPackageJsonProperty");const eb=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"),t_=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||KR&&!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 UR(l.confirm)&&await Ch(a,{...l.installPackage,cwd:l.cwd?Je(l.cwd):void 0,dev:r==="devDependencies"})}},"ensurePackages");var r_=Object.defineProperty,tb=v((e,t)=>r_(e,"name",{value:t,configurable:!0}),"o$c");const wp=["packem.config.js","packem.config.mjs","packem.config.cjs","packem.config.ts","packem.config.cts","packem.config.mts"],n_=/\.(?:js|mjs|cjs|ts|cts|mts)$/,p5=tb(async(e,t="")=>{let r=t;if(!r){for(const n of wp)if(await et(le(e,n))){r=`./${n}`;break}}if(!n_.test(r))throw new Error("Invalid packem config file extension. Only .js, .mjs, .cjs, .ts, .cts and .mts extensions are allowed.");return r},"findPackemFile"),f5=tb(async e=>{for(const t of wp)if(await et(le(e,t)))return!0;return!1},"hasPackemConfig");var i_=Object.defineProperty,o_=v((e,t)=>i_(e,"name",{value:t,configurable:!0}),"e$5");const s_={esbuild:"esbuild",oxc:"oxc-transform",sucrase:"sucrase",swc:"@swc/core"},yd=o_(async(e,t)=>{const r=Array.isArray(e)?e:[e],n=await z$(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 a_=Object.defineProperty,rb=v((e,t)=>a_(e,"name",{value:t,configurable:!0}),"s$n");const bs=rb(e=>{if(e.endsWith(".mjs")||e.endsWith(".d.mts"))return"esm";if(e.endsWith(".cjs")||e.endsWith(".d.cts"))return"cjs"},"inferExportTypeFromFileName"),ru=rb((e,t,r,n)=>{if(e==="module-sync")return"esm";if(n){const s=bs(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 ru(i,o,r,n)},"inferExportType");var l_=Object.defineProperty,c_=v((e,t)=>l_(e,"name",{value:t,configurable:!0}),"x$k");const u_=new Set(["browser","bun","default","deno","electron","import","module-sync","node","node-addons","require","types","workerd",...zh,...Gh]),Ep=c_((e,t,r,n,i)=>{if(!e)return[];if(typeof e=="string"){const o=bs(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:ru(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",...u_.has(p)?{subKey:p}:{},type:ru(p,n,t,f),...u&&{ignored:!0}});else{const m=d.replace("./",""),g=u||i.some(x=>m===x||m.startsWith(`${x}/`)),y=Ep({[d]:f},t,r,[...n,p],i);g&&y.forEach(x=>{x.ignored=!0}),s=[...s,...y]}}}return s}return[]},"extractExportFilenames");var p_=Object.defineProperty,lt=v((e,t)=>p_(e,"name",{value:t,configurable:!0}),"v$n");const nu=new Map,yn=/\.[^./]+$/,ct=/\.d\.[mc]?ts$/,iu=/\.d\.mts$/,ou=/\.d\.cts$/,$d=/\.d\.[mc]ts$/,f_=/^\.\/dist\//,su=/^dist\//,d_=/^\//,$i=/^\.\//,m_=/\/$/,xd=/\.\w+$/,wd=/\*.*$/,h_=/\.(?:tsx?|cts|mts)$/,g_=/\.[cm]?tsx?$/,v_=/^(.+?)\.[^.]*$/,b_=/(?:\*[^/\\]|\.d\.[mc]?ts|\.\w+)$/,st=lt(e=>e===void 0||e==="node16","allowsCompatibleDeclarationUpgrade"),nb=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"),y_=lt(async e=>{try{return await Xh.readdir(e,{withFileTypes:!0})}catch(t){const{code:r}=t;if(r==="ENOENT")return[];throw t}},"safeReaddir"),ib=lt(async(e,t)=>{const r=await y_(e);return(await Promise.all(r.map(async n=>{const i=$f.join(e,n.name);return n.isDirectory()?ib(i,t):n.isFile()?$f.relative(t,i):[]}))).flat()},"getDirectoryFilesRecursive"),$_=lt(async e=>{let t=nu.get(e);return t||(t=ib(e,e),nu.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"),x_=lt(e=>e.endsWith(".d.mts")?"d.mts":e.endsWith(".d.cts")?"d.cts":"d.ts","resolveDeclarationExtension"),w_=lt((e,t)=>e.key==="exports"&&e.subKey===Ai?Ai:e.key==="exports"&&e.subKey===vf?vf:t,"getEnvironment"),E_=lt(e=>{const t=e.replace(f_,"").replace(su,"").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"),S_=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(d_,"");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=w_(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 zh)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=nb(i.file,o.options.outputExtensionMap),d=i.file.replace(f,""),m=o.options.outDir.replace($i,""),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=x_(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=>iu.test(O.file)),_=E.some(O=>ou.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=>iu.test(B.file)),C=O.some(B=>ou.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"),k_=lt(async(e,t,r)=>{const n=e.types||e.typings;nu.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=Ep(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"&&!iu.test(d.file)),u=a.some(d=>d.type==="cjs"&&!ou.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=bs(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:bs(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=nb(d.file,r.options.outputExtensionMap),y=[...Ps];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&&h_.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(b_,""));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(su,"");const C=d.file,B=xd.exec(C);if(C.includes("*")&&!B&&d.exportKey&&!d.subKey){const K=C.replace(wd,"").replace($i,""),F=k.replace(wd,"").replace($i,"");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($i,""),q=ve(r.options.rootDir,J),X=[],te=await $_(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(su,"");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($i,""),C=ve(r.options.rootDir,k),B=E_(d.file);if(B){const J=S_(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(v_,"$1").replace(m_,"");if(Gh.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(_)&&g_.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=G$(_.replace(Au,"")),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 j_=Object.defineProperty,ob=v((e,t)=>j_(e,"name",{value:t,configurable:!0}),"n$f");const ai=ob(e=>typeof e=="string"&&e!=="","isNonEmptyString"),A_=ob((e,t)=>{const{publishConfig:r}=e;return r&&(r.bin&&(typeof r.bin=="object"||typeof r.bin=="string")&&(e.bin=r.bin),ai(r.type)&&(e.type=r.type),ai(r.main)&&(e.main=r.main),ai(r.module)&&(e.module=r.module),t===void 0&&ai(r.types)?e.types=r.types:t===void 0&&ai(r.typings)&&(e.typings=r.typings),r.exports&&typeof r.exports=="object"&&(e.exports=r.exports)),e},"overwriteWithPublishConfig");var O_=Object.defineProperty,$n=v((e,t)=>O_(e,"name",{value:t,configurable:!0}),"a$i");const sb=/.*\/dist\/.*/,jd=/\/$/,R_=/\.mjs$/,__=/\.cjs$/,P_=/\.d\.[mc]?ts$/,C_=/(?<!\.d)\.js$/,T_=$n(e=>{const t=[],r=new Set,n=$n(i=>{if(typeof i=="string"){t.push(i);return}if(Array.isArray(i)){for(const o of i)n(o);return}if(i&&typeof i=="object")for(const[o,s]of Object.entries(i))o.startsWith(".")||r.add(o),n(s)},"walk");e.exports&&n(e.exports);for(const i of[e.main,e.module,e.types])typeof i=="string"&&t.push(i);return{conditions:r,files:t}},"collectPackageOutputs"),N_=$n((e,t,r)=>{if(e.options.emitESM!==void 0||e.options.emitCJS!==void 0)return;const n=e.pkg.type==="module"?"esm":"cjs",i=r.some(a=>C_.test(a));let o=r.some(a=>R_.test(a))||t.has("import")||t.has("module"),s=r.some(a=>__.test(a))||t.has("require");(i||!o&&!s)&&n==="esm"?o=!0:(i||!o&&!s)&&(s=!0),e.options.emitESM=o,e.options.emitCJS=s},"resolveUnbundleEmitFormats"),I_=$n((e,t,r)=>{if(e.options.declaration!==void 0)return;const n=!!e.pkg.types||t.has("types")||r.some(i=>P_.test(i));e.options.declaration=n?"node16":!1},"resolveUnbundleDeclaration"),M_=$n(e=>{e.options.entries.length=0;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=xg(t,{extensions:[],includeDirs:!1,includeSymlinks:!1,skip:[gr,sb]}).filter(c=>mr.test(c)&&!c.endsWith(".d.ts")),{conditions:n,files:i}=T_(e.pkg);N_(e,n,i),I_(e,n,i);const o=e.options.emitESM??!1,s=e.options.emitCJS??!1;for(const c of r){const u=c.replace(`${t}/`,"").replace(mr,"").replaceAll("/","/");e.options.entries.push({cjs:s,declaration:e.options.declaration,esm:o,input:c,name:u})}const a=[];o&&a.push("[esm]"),s&&a.push("[cjs]"),e.options.declaration&&a.push("[dts]");const l=e.options.entries.length;e.logger.info("Unbundle mode: preserving source structure for",Re(`${String(l)} ${l===1?"entry":"entries"}`),$t(a.join(" ")))},"prepareUnbundleEntries"),D_={hooks:{"build:prepare":$n(async function(e){if(e.options.unbundle){M_(e);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=xg(t,{extensions:[],includeDirs:!1,includeSymlinks:!1,skip:[gr,sb]});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=A_(i,e.options.declaration));const o=await k_(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:",Re(e.options.entries.map(s=>s.fileAlias?`${Ze(s.fileAlias)} => ${Ze(s.input.replace(`${e.options.rootDir}/`,"").replace(jd,"/*"))}`:Ze(s.input.replace(`${e.options.rootDir}/`,"").replace(jd,"/*"))).join(", ")),$t([e.options.emitESM&&"esm",e.options.emitCJS&&"cjs",e.options.declaration&&"dts"].filter(Boolean).map(s=>`[${s}]`).join(" ")))},"build:prepare")}};var B_=Object.defineProperty,Ee=v((e,t)=>B_(e,"name",{value:t,configurable:!0}),"r$5");const L_=De(import.meta.url),Kr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Sp=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 L_(e)},"__cjs_getBuiltinModule"),{existsSync:ln}=Sp("node:fs"),{env:cn,cwd:ab}=Kr,{createRequire:Eo}=Sp("node:module"),lb=0,un=2,cb=Symbol("findUpStop"),kp=Ee(e=>{if(!e||!(e instanceof URL)&&typeof e!="string")throw new TypeError("Path must be a non-empty string or URL.")},"assertValidFileOrDirectoryPath"),Ad=Ee(e=>{if(e.isFile())return"file";if(e.isDirectory())return"dir";if(e.isSymbolicLink())return"symlink"},"getFileInfoType"),W_=Eo(import.meta.url),li=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,F_=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 W_(e)},"__cjs_getBuiltinModule$5"),{lstatSync:Od,mkdirSync:H_}=F_("node:fs"),q_=Ee(e=>{kp(e);try{const t=Od(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(Ad(t))}'`);return}catch(t){if(t.code!=="ENOENT")throw t}try{H_(e,{recursive:!0})}catch(t){if(t.code!=="EEXIST")throw t;const r=Od(e);if(!r.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(Ad(r))}'`,{cause:t})}},"ensureDirSync"),z_=/^[A-Z]:\//i,So=Ee((e="")=>e&&e.replaceAll("\\","/").replace(z_,t=>t.toUpperCase()),"normalizeWindowsPath$1"),G_=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,U_=/^[A-Z]:$/i,K_=/.(\.[^./]+)$/,J_=/^[/\\]|^[a-z]:[/\\]/i,V_=/\/$/,X_=Ee(()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd"),Y_=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"),Bi=Ee(e=>G_.test(e),"isAbsolute$1"),pn=Ee(function(...e){e=e.map(n=>So(n));let t="",r=!1;for(let n=e.length-1;n>=-1&&!r;n--){const i=n>=0?e[n]:X_();!i||i.length===0||(t=`${i}/${t}`,r=Bi(i))}return t=Y_(t,!r),r&&!Bi(t)?`/${t}`:t.length>0?t:"."},"resolve"),Q_=Ee(function(e){return K_.exec(So(e))?.[1]??""},"extname"),jp=Ee(e=>{const t=So(e).replace(V_,"").split("/").slice(0,-1);return t.length===1&&U_.test(t[0])&&(t[0]=`${t[0]}/`),t.join("/")||(Bi(e)?"/":".")},"dirname$1"),Z_=Ee((e,t)=>{const r=So(e).split("/").pop();return t&&r.endsWith(t)?r.slice(0,-t.length):r},"basename"),ub=Ee(function(e){const t=J_.exec(e)?.[0]?.replaceAll("\\","/")??"",r=Z_(e),n=Q_(r);return{base:r,dir:jp(e),ext:n,name:r.slice(0,r.length-n.length),root:t}},"parse"),eP=Eo(import.meta.url),ci=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,tP=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 eP(e)},"__cjs_getBuiltinModule$4"),{fileURLToPath:rP}=tP("node:url");function pb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}v(pb,"_e$2");Ee(pb,"getDefaultExportFromCjs");var Rd,_d;function fb(){return _d||(_d=1,Rd=["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"]),Rd}v(fb,"ye$2");Ee(fb,"requireBinaryExtensions");var nP=fb();const iP=pb(nP);new Set(iP);const xn=Ee(e=>So(e instanceof URL?rP(e):e),"toPath"),oP=Eo(import.meta.url),ui=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,db=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 oP(e)},"__cjs_getBuiltinModule$3"),{stat:sP,lstat:aP}=db("node:fs/promises"),{fileURLToPath:lP}=db("node:url"),cP=Ee(async(e,t={})=>{const r=t.cwd?xn(t.cwd):process.cwd();let n=pn(r);const{root:i}=ub(n),o=xn(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?sP:aP;for(;n&&n!==s&&n!==i;){const u=await l();for(let p of u){if(p===cb)return;if(p===void 0)continue;Buffer.isBuffer(p)?p=p.toString():p instanceof URL&&(p=lP(p));const f=Bi(p)?p:pn(n,p);try{const d=await c(f);if(a==="file"&&d.isFile()||a==="directory"&&d.isDirectory())return f}catch{}}n=jp(n)}},"findUp"),uP=Eo(import.meta.url),pi=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,mb=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 uP(e)},"__cjs_getBuiltinModule$2"),{statSync:pP,lstatSync:fP}=mb("node:fs"),{fileURLToPath:dP}=mb("node:url"),mP=Ee((e,t={})=>{const r=t.cwd?xn(t.cwd):process.cwd();let n=pn(r);const{root:i}=ub(n),o=xn(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?pP:fP;for(;n&&n!==s&&n!==i;){for(let u of l()){if(u===cb)return;if(u===void 0)continue;Buffer.isBuffer(u)?u=u.toString():u instanceof URL&&(u=dP(u));const p=Bi(u)?u:pn(n,u);try{const f=c(p);if(a==="file"&&f.isFile()||a==="directory"&&f.isDirectory())return p}catch{}}n=jp(n)}},"findUpSync"),hP=Eo(import.meta.url),fi=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,gP=Ee(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 hP(e)},"__cjs_getBuiltinModule$1"),{access:vP}=gP("node:fs/promises");async function ns(e,t=lb){kp(e),e=xn(e);try{return await vP(e,t),!0}catch{return!1}}v(ns,"N$f");Ee(ns,"isAccessible");const{accessSync:bP}=Sp("node:fs");function is(e,t=lb){kp(e),e=xn(e);try{return bP(e,t),!0}catch{return!1}}v(is,"z$c");Ee(is,"isAccessibleSync");let hb=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 yP=/^[A-Z]:\//i,gb=Ee((e="")=>e&&e.replaceAll("\\","/").replace(yP,t=>t.toUpperCase()),"normalizeWindowsPath"),$P=/^[/\\]{2}/,xP=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,vb=/^[A-Z]:$/i,wP=/\/$/,EP=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"),au=Ee(e=>xP.test(e),"isAbsolute"),SP=Ee(function(e){if(e.length===0)return".";e=gb(e);const t=$P.exec(e),r=au(e),n=e.at(-1)==="/";return e=EP(e,!r),e.length===0?r?"/":n?"./":".":(n&&(e+="/"),vb.test(e)&&(e+="/"),t?r?`//${e}`:`//./${e}`:r&&!au(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 SP(t)},"join"),bb=Ee(e=>{const t=gb(e).replace(wP,"").split("/").slice(0,-1);return t.length===1&&vb.test(t[0])&&(t[0]=`${t[0]}/`),t.join("/")||(au(e)?"/":".")},"dirname"),ys=Ee((e,t)=>(t?.create&&q_(e),e),"useDirectory");Ee(async(e,t)=>{if(cn.CACHE_DIR&&!["0","1","false","true"].includes(cn.CACHE_DIR))return ys(Zt(cn.CACHE_DIR,e),t);const r=await cP("package.json",{cwd:t?.cwd??ab(),type:"file"});if(!r){if(t?.throwError)throw new hb("No such file or directory found.");return}const n=Zt(bb(r),"node_modules"),i=Zt(n,".cache"),o=Zt(i,e);if(!(ln(o)&&!await ns(o,un))&&!(ln(i)&&!await ns(i,un))&&!(ln(n)&&!await ns(n,un)))return ys(o,t)},"findCacheDirectory");const kP=Ee((e,t)=>{if(cn.CACHE_DIR&&!["0","1","false","true"].includes(cn.CACHE_DIR))return ys(Zt(cn.CACHE_DIR,e),t);const r=mP("package.json",{cwd:t?.cwd??ab(),type:"file"});if(!r){if(t?.throwError)throw new hb("No such file or directory found.");return}const n=Zt(bb(r),"node_modules"),i=Zt(n,".cache"),o=Zt(i,e);if(!(ln(o)&&!is(o,un))&&!(ln(i)&&!is(i,un))&&!(ln(n)&&!is(n,un)))return ys(o,t)},"findCacheDirectorySync"),jP=kP;var AP=Object.defineProperty,Ka=v((e,t)=>AP(e,"name",{value:t,configurable:!0}),"l$n");const OP=/^(?<value>-?\d+(?:[.,]\d+)*) *(?<type>[a-z]+)?$/i,RP=/^KIBI/,_P=/^MIBI/,PP=/^GIBI/,CP=/^TEBI/,TP=/^PEBI/,NP=/^EXBI/,IP=/^ZEBI/,MP=/^YIBI/,DP=/^(.)IB$/,yb={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"}]},BP=Ka((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"),$b=Ka(e=>{switch(e){case 2:return 1024;case 10:return 1e3;default:throw new Error("Unsupported base.")}},"fromBase"),LP=Ka((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=OP.exec(e)?.groups;if(!n)return Number.NaN;const i=BP(n.value,r.locale),o=(n.type??"Bytes").toUpperCase().replace(RP,"KILO").replace(_P,"MEGA").replace(PP,"GIGA").replace(CP,"TERA").replace(TP,"PETA").replace(NP,"EXA").replace(IP,"ZETTA").replace(MP,"YOTTA").replace(DP,"$1B"),s=yb[r.units].findIndex(l=>l.short[0].toUpperCase()===o[0]),a=$b(r.base);return i*a**s},"parseBytes"),Qe=Ka((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=$b(r),u=Math.abs(e),p=t?.space??!0?" ":"",f=yb[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 WP=Object.defineProperty,FP=v((e,t)=>WP(e,"name",{value:t,configurable:!0}),"n$e");const HP=FP((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"),qP={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"},zP=HP(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",".",qP,",","_");var GP=Object.defineProperty,UP=v((e,t)=>GP(e,"name",{value:t,configurable:!0}),"o$9");const KP=UP(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 JP=Object.defineProperty,ko=v((e,t)=>JP(e,"name",{value:t,configurable:!0}),"g$j");const xb=ko((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"),Pd=ko(({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=xb(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"),VP=ko((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=xb(l,t.maxDecimalPoints))}l&&u.push({unitCount:l,unitName:s})}return u},"getPieces"),XP=ko((e,t,r)=>{const{language:n,units:i}=t;if(e.length===0){const p=i.at(-1);return Pd({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=>Pd(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"),Cd=ko((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:zP,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};KP(r.language);const n=Math.abs(e),i=VP(n,r);return XP(i,r,e)},"duration");var YP=Object.defineProperty,wb=v((e,t)=>YP(e,"name",{value:t,configurable:!0}),"l$m");const Td=wb(async e=>{try{const t=await e();return typeof t.rolldown=="function"?t.rolldown:void 0}catch{return}},"tryImport"),Eb=wb(async()=>{const e=await Td(()=>import("@rolldown/node"));if(e)return e;const t=await Td(()=>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"),eC=Object.defineProperty,tC=ZP((e,t)=>eC(e,"name",{value:t,configurable:!0}),"j"),rC=Object.defineProperty,Br=tC((e,t)=>rC(e,"name",{value:t,configurable:!0}),"u");const Sb="__packem_cache_wrapped",lu="__packem_watch_files",Kt=Br(e=>typeof e=="function"?e:e.handler,"getHandler"),Fl=Br(e=>{if(e&&typeof e=="object"&&"filter"in e)return e.filter},"getHookFilter"),Nd=new Map,nC=Br(e=>{const t=JSON.stringify(e);let r=Nd.get(t);return r===void 0&&(r=Wt(t),Nd.set(t,r)),r},"hashResolveOptions"),iC=Br(e=>e!==null&&typeof e=="object"&&e[Sb]===!0,"isWrappedCacheValue"),oC=Br(e=>e!==null&&typeof e=="object"&&Array.isArray(e[lu]),"isWatchFilesCacheValue"),Do=Br(e=>iC(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&&V$(c)){const g=Mh(c);u=Wt(g)}}catch{}const p=le("load",Wt(l),u),f=await t.get(p,n);if(f!==void 0)return Do(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,[Sb]:!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):"",nC(u)),f=await t.get(p,n);if(f!==void 0)return Do(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=Do(p);if(oC(g)){for(const y of g[lu])this.addWatchFile(y);return Do(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,{[lu]:f,result:m},n):t.set(u,m,n),m}},o=Fl(e.load),s=Fl(e.resolveId),a=Fl(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 sC=Object.defineProperty,aC=v((e,t)=>sC(e,"name",{value:t,configurable:!0}),"f$k"),lC=Object.defineProperty,cC=aC((e,t)=>lC(e,"name",{value:t,configurable:!0}),"c"),uC=Object.defineProperty,pC=cC((e,t)=>uC(e,"name",{value:t,configurable:!0}),"c");const fC=pC(()=>({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 dC=Object.defineProperty,mC=v((e,t)=>dC(e,"name",{value:t,configurable:!0}),"n$d"),hC=Object.defineProperty,gC=mC((e,t)=>hC(e,"name",{value:t,configurable:!0}),"s"),vC=Object.defineProperty,bC=gC((e,t)=>vC(e,"name",{value:t,configurable:!0}),"i");const yC=bC(()=>({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(hx,"")}-${e.format??"unknown"}.json`,source:JSON.stringify(r,void 0,2),type:"asset"})},name:"packem:metafile"}),"metafilePlugin");var $C=Object.defineProperty,xC=v((e,t)=>$C(e,"name",{value:t,configurable:!0}),"a$h"),wC=Object.defineProperty,EC=xC((e,t)=>wC(e,"name",{value:t,configurable:!0}),"l"),SC=Object.defineProperty,kC=EC((e,t)=>SC(e,"name",{value:t,configurable:!0}),"r");const jC=/^file:\/\//,kb=kC(()=>({name:"packem:resolve-file-url",resolveId:{filter:{id:jC},handler(e){if(e.startsWith("file://"))return Kh(e)}}}),"resolveFileUrl");var AC=Object.defineProperty,OC=v((e,t)=>AC(e,"name",{value:t,configurable:!0}),"a$g"),RC=Object.defineProperty,_C=OC((e,t)=>RC(e,"name",{value:t,configurable:!0}),"n"),PC=Object.defineProperty,CC=_C((e,t)=>PC(e,"name",{value:t,configurable:!0}),"s");const TC=/^(\w+)-runtime$/,NC=CC(e=>{const t=wt(e).split(".");if(t.length>=2){const[r,n]=t.slice(-2),i=t[0]??"",o=TC.exec(r)?.[1];if(Ps.includes(n)&&o&&o.length>0)return`${i}-${o}`}},"getCustomModuleLayer");var IC=Object.defineProperty,MC=v((e,t)=>IC(e,"name",{value:t,configurable:!0}),"a$f"),DC=Object.defineProperty,BC=MC((e,t)=>DC(e,"name",{value:t,configurable:!0}),"t"),LC=Object.defineProperty,WC=BC((e,t)=>LC(e,"name",{value:t,configurable:!0}),"t");const FC=/^use /,Ri=WC(e=>(e.preserveDirectives??{directives:[]}).directives.map(t=>t.replace(FC,"")).find(t=>t!=="strict"),"getModuleLayer");var HC=Object.defineProperty,qC=v((e,t)=>HC(e,"name",{value:t,configurable:!0}),"w$e"),zC=Object.defineProperty,GC=qC((e,t)=>zC(e,"name",{value:t,configurable:!0}),"I"),UC=Object.defineProperty,$s=GC((e,t)=>UC(e,"name",{value:t,configurable:!0}),"p");const KC=/[\\/]node_modules[\\/]@swc[\\/]helper/,Hl=xx(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)}),jb=$s((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=Ri(i.meta);if(o)return r.set(e,o),o;let s;for(const a of i.importers){const l=jb(a,t,r,n);if(l){s=l;break}}return r.set(e,s),s},"getEffectiveModuleLayer"),JC=$s((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=Ri(s.meta);if(a)i.add(a);else{const l=jb(o,t,r,new Set([e]));l&&i.add(l)}}return i},"getImporterLayers"),VC=$s((e,t,r=!0)=>{const n=new Map,i=new Map;return $s(function(o,s){if(KC.test(o))return"cc";const a=s.getModuleInfo(o);if(!a)return;const{isEntry:l}=a,c=a.meta;let u=Ri(c);if(u&&(u=Hl(u)),!l){const p=n.get(o);if(p)return p;const f=NC(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&&Ri(d.meta)===u&&(e.has(f)||e.set(f,new Set),e.get(f).add([o,u]))}}if(r&&!u&&!l){const p=JC(o,s.getModuleInfo,i);if(p.size>1){if(n.has(o))return n.get(o);const f=wt(o,gn(o)),d=[...p].toSorted((g,y)=>g.localeCompare(y)).join("-"),m=`${f}-${Hl(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 Ri(y?y.meta:{})===u}return!1}))return;if(p.every(([,g])=>g===u))return n.has(o)?n.get(o):void 0;const f=wt(o,gn(o)),d=Hl(u),m=`${f}-${d}`;return n.set(o,m),m}},"splitChunks")},"createSplitChunks");var XC=Object.defineProperty,YC=v((e,t)=>XC(e,"name",{value:t,configurable:!0}),"i$a"),QC=Object.defineProperty,ZC=YC((e,t)=>QC(e,"name",{value:t,configurable:!0}),"i"),eT=Object.defineProperty,tT=ZC((e,t)=>eT(e,"name",{value:t,configurable:!0}),"i");const Ja=tT((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 rT=Object.defineProperty,nT=v((e,t)=>rT(e,"name",{value:t,configurable:!0}),"u$k"),iT=Object.defineProperty,oT=nT((e,t)=>iT(e,"name",{value:t,configurable:!0}),"u"),sT=Object.defineProperty,Ap=oT((e,t)=>sT(e,"name",{value:t,configurable:!0}),"a");const aT=/\.tsx?$/,lT=/['"]use memo['"]/,cT=Ap(e=>e.find(t=>t==="babel-plugin-react-compiler"||Array.isArray(t)&&t[0]==="babel-plugin-react-compiler"),"getReactCompilerPlugin"),uT=Ap((e,t)=>{if(e.length===0)return;const r=cT(e);if(!(!r||!Array.isArray(r))&&r[1]?.compilationMode==="annotation"&&!lT.test(t)){const n=e.indexOf(r);n!==-1&&e.splice(n,1)}},"filterReactCompilerByAnnotation"),pT=Ap(async(e,t,{filename:r,generatorOpts:n,sourceFileName:i,...o})=>{let s=[];o.plugins&&Array.isArray(o.plugins)&&(s=[...o.plugins]),s.length>0&&uT(s,e);const a=[];(t.endsWith(".jsx")||t.endsWith(".tsx"))&&a.push("jsx"),aT.test(t)&&a.push("typescript");const l=o.parserOpts?.plugins;l&&Array.isArray(l)&&a.unshift(...l);const c=[...new Set(a)],u=await Bx(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 fT=Object.defineProperty,dT=v((e,t)=>fT(e,"name",{value:t,configurable:!0}),"b$h"),mT=Object.defineProperty,hT=dT((e,t)=>mT(e,"name",{value:t,configurable:!0}),"b"),gT=Object.defineProperty,Li=hT((e,t)=>gT(e,"name",{value:t,configurable:!0}),"i");const vT=20,bT=4,yT=Vh("babel-runtime","plugins","babel","worker.js"),$T=Li(e=>{const t=Li(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"),xT=Li(()=>{let e;try{e=Kc(Kh(import.meta.url))}catch{return}for(let t=0;t<6;t+=1){const r=Vh(e,yT);if(Ou(r))return r;const n=Kc(e);if(n===e)break;e=n}},"resolveWorkerScript"),wT=Li(({exclude:e,filename:t,generatorOpts:r,include:n,parallel:i=!0,parallelThreshold:o=vT,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=Li(()=>{if(f)return;if(p)return p;if(u<o)return;if($T(c)!==void 0){f=!0;return}const m=xT();if(!m){f=!0;return}const g=typeof i=="number"?i:Math.min(Tx().length,bT);return p=Dx.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 pT(m,g,c);if(x)return{code:x.code,map:x.map??void 0}}}},"babelTransformPlugin");var ET=Object.defineProperty,ST=v((e,t)=>ET(e,"name",{value:t,configurable:!0}),"l$h"),kT=Object.defineProperty,jT=ST((e,t)=>kT(e,"name",{value:t,configurable:!0}),"l"),AT=Object.defineProperty,OT=jT((e,t)=>AT(e,"name",{value:t,configurable:!0}),"u");const RT=OT((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 Kw(Gc(s.src),{ignore:Gc(s.exclude).filter(Boolean)}).then(a=>({dest:s.dest??"",parent:o1(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 Ji(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=wt(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 _T=Object.defineProperty,Ab=v((e,t)=>_T(e,"name",{value:t,configurable:!0}),"s$f"),PT=Object.defineProperty,Op=Ab((e,t)=>PT(e,"name",{value:t,configurable:!0}),"m");const Ob={"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(Ob);const Rb={"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(Rb);var CT=Object.defineProperty,TT=Op((e,t)=>CT(e,"name",{value:t,configurable:!0}),"g"),mt=Op(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,xi,fr;let NT=class{static{v(this,"j")}static{Ab(this,"w")}static{Op(this,"p")}static{TT(this,"Mime")}constructor(...t){Jr.set(this,new Map),xi.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,xi,"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,xi,"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,xi,"f")}}};Jr=new WeakMap,xi=new WeakMap,fr=new WeakMap;const _b=new NT(Rb,Ob)._freeze();var IT=Object.defineProperty,MT=v((e,t)=>IT(e,"name",{value:t,configurable:!0}),"c$k"),DT=Object.defineProperty,BT=MT((e,t)=>DT(e,"name",{value:t,configurable:!0}),"c"),LT=Object.defineProperty,WT=BT((e,t)=>LT(e,"name",{value:t,configurable:!0}),"l");const FT=/\?data-uri/,HT=WT((e={})=>{const t=Mt(e.include??[FT],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=_b.getType(i)??"application/octet-stream";if(a==="image/svg+xml"){const u=await kr(i,{buffer:!1}),p=o==="css"?gx(u):vx(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 qT=Object.defineProperty,zT=v((e,t)=>qT(e,"name",{value:t,configurable:!0}),"v$g"),GT=Object.defineProperty,UT=zT((e,t)=>GT(e,"name",{value:t,configurable:!0}),"v"),KT=Object.defineProperty,qe=UT((e,t)=>KT(e,"name",{value:t,configurable:!0}),"u");const JT=/\.[mc]?tsx?(?:\?.*)?$/,VT=/(?:\.[tj]sx?|\/index\.[tj]sx?)(?:\?.*)?$/,XT=/^\s*export/,YT=/^(?:import|export)\s+([\w$]+)/,QT=/([\w$]+)\s*,\s*\{|\}\s*,\s*([\w$]+)/,ql=/[{,]\s*(type\s+)?([\w$]+)(?:\s+as\s+([\w$]+))?/gi,ZT=/default\s+([a-zA-Z_$][\w$]*)(?:[;\n]|$)/,e3=/([\w$]+)\s*as\s*$/,t3=/^export\s+\*(?!\s+as)/,r3=/\bas\b/,n3={exports:[],facade:!1,imports:[]},Pb=qe(e=>JT.test(e),"isSourceFile"),Cb=qe(e=>e.includes("/build/cache/vite/")||e.includes("/node_modules/"),"isIgnoredModule"),i3=qe((e,t)=>Cb(e)?!1:VT.test(e)?!0:t.possibleBarrelFiles?t.possibleBarrelFiles.some(r=>typeof r=="string"?e.includes(r):r.test(e)):!1,"isPossibleBarrelSpecifier"),Tb=qe(e=>XT.test(e)?"export":"import","getDeclarationKind"),{parseAsync:o3}=Hx,Nb=qe(async(e,t,r)=>{try{const{output:n}=await o3({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"}),n3}},"safeParse"),s3=qe(async(e,t,r,n)=>{const i=e.parseCache.get(t);if(i!==void 0)return i;const o=await Nb(t,r,n);return e.parseCache.set(t,o),o},"parsePotentialBarrelFile"),Ib=qe((e,t)=>{const r=e.fileCache.get(t);if(r!==void 0)return r;const n=Xh.readFile(t,"utf8");return e.fileCache.set(t,n),n},"readFileCached"),Mb=qe(e=>{ql.lastIndex=0;const t=[];if(e.includes("*"))return t;if(!e.includes("{")){const i=YT.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=ql.exec(e);for(;n!==null;)!n[1]&&n[2]&&t.push({imported:n[2],local:n[3]}),n=ql.exec(e);return t},"getImportNames"),a3=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=Mb(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=e3.exec(o)?.[1];s&&(n=s)}}return{imp:i,localExportName:n}},"findMatchingImport"),l3=qe((e,t)=>Tb(e)!=="import"||!r3.test(e)?void 0:new RegExp(String.raw`(\w+)\s+as\s+${t}(?!\w)`).exec(e)?.[0],"findAliasedImportName");let Wi;const c3=qe(async(e,t,r,n,i,o,s,a)=>{const{resolve:l}=e,c=a3(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=l3(f,o),m=(await l(u.n,t))?.id;return m?i3(m,s)?Wi(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"),u3=qe(async(e,t,r,n,i,o,s)=>{const a=n.filter(l=>t3.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 Wi(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 Wi(e,p,i,o,s)}))).find(c=>c?.resolved);if(l)return l}},"resolveWildcardReExports");Wi=qe(async(e,t,r,n,i)=>{const o=await Ib(e,t),{exports:s,imports:a}=await s3(e,t,o,i);for(const l of s)if(l.n===r)return await c3(e,t,o,l,a,r,n,i);return await u3(e,t,o,a,r,n,i)||{exportName:r,id:t,resolved:!1}},"resolveThroughBarrel");const p3=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"),f3=qe(async(e,t,r,n,i)=>{const o=[],s=await Ib(e,t),{imports:a}=await Nb(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=Mb(c);if(u.length===0)return;const p=(await e.resolve(l.n,t))?.id;if(!p||!Pb(p)||Cb(p))return;const f=Tb(c);try{const d=await Promise.all(u.map(async m=>{const g=await Wi(e,p,m.imported,n,i),y=p3(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"),d3=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"),m3=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(l.includes("\0")||l.includes("?")||!Pb(l)||o&&!o(l))return;const c={fileCache:r,parseCache:n,resolve:this.resolve.bind(this)},u=await f3(c,l,a,e,t);return d3(l,a,u,s)},watchChange(a){r.delete(a),n.delete(a)}}},"debarrelPlugin");var zl,Id;function h3(){if(Id)return zl;Id=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"u");const r=rt();return zl=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"),zl}v(h3,"requireInc");var Gl,Md;function g3(){if(Md)return Gl;Md=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"u");const r=Ki();return Gl=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"),Gl}v(g3,"requireDiff");var Ul,Dd;function v3(){if(Dd)return Ul;Dd=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).major,"major"),Ul}v(v3,"requireMajor");var Kl,Bd;function b3(){if(Bd)return Kl;Bd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=rt();return Kl=t((i,o)=>new r(i,o).minor,"minor"),Kl}v(b3,"requireMinor");var Jl,Ld;function y3(){if(Ld)return Jl;Ld=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"t");const r=rt();return Jl=t((i,o)=>new r(i,o).patch,"patch"),Jl}v(y3,"requirePatch");var Vl,Wd;function $3(){if(Wd)return Vl;Wd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"t");const r=Ki();return Vl=t((i,o)=>{const s=r(i,o);return s&&s.prerelease.length?s.prerelease:null},"prerelease"),Vl}v($3,"requirePrerelease");var Xl,Fd;function Ot(){if(Fd)return Xl;Fd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"c");const r=rt();return Xl=t((i,o,s)=>new r(i,s).compare(new r(o,s)),"compare"),Xl}v(Ot,"requireCompare");var Yl,Hd;function x3(){if(Hd)return Yl;Hd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"o");const r=Ot();return Yl=t((i,o,s)=>r(o,i,s),"rcompare"),Yl}v(x3,"requireRcompare");var Ql,qd;function w3(){if(qd)return Ql;qd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=Ot();return Ql=t((i,o)=>r(i,o,!0),"compareLoose"),Ql}v(w3,"requireCompareLoose");var Zl,zd;function Rp(){if(zd)return Zl;zd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"o");const r=rt();return Zl=t((i,o,s)=>{const a=new r(i,s),l=new r(o,s);return a.compare(l)||a.compareBuild(l)},"compareBuild"),Zl}v(Rp,"requireCompareBuild");var ec,Gd;function E3(){if(Gd)return ec;Gd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"e");const r=Rp();return ec=t((i,o)=>i.sort((s,a)=>r(s,a,o)),"sort"),ec}v(E3,"requireSort");var tc,Ud;function S3(){if(Ud)return tc;Ud=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"e");const r=Rp();return tc=t((i,o)=>i.sort((s,a)=>r(a,s,o)),"rsort"),tc}v(S3,"requireRsort");var rc,Kd;function Va(){if(Kd)return rc;Kd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=Ot();return rc=t((i,o,s)=>r(i,o,s)>0,"gt"),rc}v(Va,"requireGt");var nc,Jd;function _p(){if(Jd)return nc;Jd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=Ot();return nc=t((i,o,s)=>r(i,o,s)<0,"lt"),nc}v(_p,"requireLt");var ic,Vd;function Db(){if(Vd)return ic;Vd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=Ot();return ic=t((i,o,s)=>r(i,o,s)===0,"eq"),ic}v(Db,"requireEq");var oc,Xd;function Bb(){if(Xd)return oc;Xd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=Ot();return oc=t((i,o,s)=>r(i,o,s)!==0,"neq"),oc}v(Bb,"requireNeq");var sc,Yd;function Pp(){if(Yd)return sc;Yd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=Ot();return sc=t((i,o,s)=>r(i,o,s)>=0,"gte"),sc}v(Pp,"requireGte");var ac,Qd;function Cp(){if(Qd)return ac;Qd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=Ot();return ac=t((i,o,s)=>r(i,o,s)<=0,"lte"),ac}v(Cp,"requireLte");var lc,Zd;function Lb(){if(Zd)return lc;Zd=1;var e=Object.defineProperty,t=v((c,u)=>e(c,"name",{value:u,configurable:!0}),"n");const r=Db(),n=Bb(),i=Va(),o=Pp(),s=_p(),a=Cp();return lc=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"),lc}v(Lb,"requireCmp");var cc,em;function k3(){if(em)return cc;em=1;var e=Object.defineProperty,t=v((a,l)=>e(a,"name",{value:l,configurable:!0}),"u");const r=rt(),n=Ki(),{safeRe:i,t:o}=Rs();return cc=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"),cc}v(k3,"requireCoerce");var uc,tm;function j3(){if(tm)return uc;tm=1;var e=Object.defineProperty,t=v((c,u)=>e(c,"name",{value:u,configurable:!0}),"t");const r=Ki(),n=ku(),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 uc=o,uc}v(j3,"requireTruncate");var pc,rm;function A3(){if(rm)return pc;rm=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 pc=r,pc}v(A3,"requireLrucache");var fc,nm;function Rt(){if(nm)return fc;nm=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}}fc=n;const i=A3(),o=new i,s=Dh(),a=Xa(),l=Bh(),c=rt(),{safeRe:u,src:p,t:f,comparatorTrimReplace:d,tildeTrimReplace:m,caretTrimReplace:g}=Rs(),{FLAG_INCLUDE_PRERELEASE:y,FLAG_LOOSE:x}=ku(),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 fc}v(Rt,"requireRange");var dc,im;function Xa(){if(im)return dc;im=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(">")))}}dc=n;const i=Dh(),{safeRe:o,t:s}=Rs(),a=Lb(),l=Bh(),c=rt(),u=Rt();return dc}v(Xa,"requireComparator");var mc,om;function jo(){if(om)return mc;om=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"t");const r=Rt();return mc=t((i,o,s)=>{try{o=new r(o,s)}catch{return!1}return o.test(i)},"satisfies"),mc}v(jo,"requireSatisfies");var hc,sm;function O3(){if(sm)return hc;sm=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"t");const r=Rt();return hc=t((i,o)=>new r(i,o).set.map(s=>s.map(a=>a.value).join(" ").trim().split(" ")),"toComparators"),hc}v(O3,"requireToComparators");var gc,am;function R3(){if(am)return gc;am=1;var e=Object.defineProperty,t=v((o,s)=>e(o,"name",{value:s,configurable:!0}),"c");const r=rt(),n=Rt();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},"maxSatisfying"),gc}v(R3,"requireMaxSatisfying");var vc,lm;function _3(){if(lm)return vc;lm=1;var e=Object.defineProperty,t=v((o,s)=>e(o,"name",{value:s,configurable:!0}),"u");const r=rt(),n=Rt();return vc=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"),vc}v(_3,"requireMinSatisfying");var bc,cm;function P3(){if(cm)return bc;cm=1;var e=Object.defineProperty,t=v((s,a)=>e(s,"name",{value:a,configurable:!0}),"i");const r=rt(),n=Rt(),i=Va();return bc=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"),bc}v(P3,"requireMinVersion");var yc,um;function C3(){if(um)return yc;um=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"n");const r=Rt();return yc=t((i,o)=>{try{return new r(i,o).range||"*"}catch{return null}},"validRange"),yc}v(C3,"requireValid");var $c,pm;function Tp(){if(pm)return $c;pm=1;var e=Object.defineProperty,t=v((f,d)=>e(f,"name",{value:d,configurable:!0}),"m");const r=rt(),n=Xa(),{ANY:i}=n,o=Rt(),s=jo(),a=Va(),l=_p(),c=Cp(),u=Pp();return $c=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"),$c}v(Tp,"requireOutside");var xc,fm;function T3(){if(fm)return xc;fm=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"s");const r=Tp();return xc=t((i,o,s)=>r(i,o,">",s),"gtr"),xc}v(T3,"requireGtr");var wc,dm;function N3(){if(dm)return wc;dm=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"s");const r=Tp();return wc=t((i,o,s)=>r(i,o,"<",s),"ltr"),wc}v(N3,"requireLtr");var Ec,mm;function I3(){if(mm)return Ec;mm=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"n");const r=Rt();return Ec=t((i,o,s)=>(i=new r(i,s),o=new r(o,s),i.intersects(o,s)),"intersects"),Ec}v(I3,"requireIntersects");var Sc,hm;function M3(){if(hm)return Sc;hm=1;const e=jo(),t=Ot();return Sc=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"),Sc}v(M3,"requireSimplify");var kc,gm;function D3(){if(gm)return kc;gm=1;var e=Object.defineProperty,t=v((d,m)=>e(d,"name",{value:m,configurable:!0}),"u");const r=Rt(),n=Xa(),{ANY:i}=n,o=jo(),s=Ot(),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 kc=a,kc}v(D3,"requireSubset");var jc,vm;function B3(){if(vm)return jc;vm=1;const e=Rs(),t=ku(),r=rt(),n=X$(),i=Ki(),o=Lh(),s=Y$(),a=h3(),l=g3(),c=v3(),u=b3(),p=y3(),f=$3(),d=Ot(),m=x3(),g=w3(),y=Rp(),x=E3(),j=S3(),R=Va(),b=_p(),E=Db(),h=Bb(),A=Pp(),_=Cp(),O=Lb(),k=k3(),C=j3(),B=Xa(),J=Rt(),q=jo(),X=O3(),te=R3(),re=_3(),I=P3(),M=C3(),K=Tp(),F=T3(),N=N3(),W=I3(),V=M3(),U=D3();return jc={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},jc}v(B3,"requireSemver");var xt=B3(),L3=Object.defineProperty,W3=v((e,t)=>L3(e,"name",{value:t,configurable:!0}),"P$b"),F3=Object.defineProperty,Wb=W3((e,t)=>F3(e,"name",{value:t,configurable:!0}),"$"),H3=Object.defineProperty,Fb=Wb((e,t)=>H3(e,"name",{value:t,configurable:!0}),"r");const xs=/.*\/node_modules\/(?:@[^/]+\/)?[^/]+/,cu=ju(async e=>{const t=le(e,"package.json");try{const r=await Q$(t);return{directory:Ce(t),name:r.name,version:r.version}}catch{return}})(),Hb=Fb(async e=>{const t=Pi(e),r=xs.exec(t);if(!r)return;const n=await cu(r[0]);if(n)return n;const i=t.lastIndexOf("node_modules");if(i<=0)return;const o=xs.exec(t.slice(0,i-1));if(o)return cu(o[0])},"getPackageInfo"),q3=Fb(()=>{cu.destroy()},"destroyPackageInfoCache");var z3=Object.defineProperty,nr=Wb((e,t)=>z3(e,"name",{value:t,configurable:!0}),"d");const bm=ju(async(e,t)=>{const r=Pi(e);if(xs.test(r)){const n=await Hb(r);if(n)return`${n.name}@${n.version}`}return r.replace(`${Pi(t)}/`,"")})(),G3=nr(e=>new Set([...e].toSorted((t,r)=>t.localeCompare(r))),"sortImporters"),U3=nr(e=>new Map([...e.entries()].toSorted((t,r)=>t[0].localeCompare(r[0])).map(([t,r])=>[t,G3(r)])),"sortDirectoryMap"),K3=nr(e=>new Map([...e.entries()].toSorted((t,r)=>xt.compare(t[0],r[0])).map(([t,r])=>[t,U3(r)])),"sortVersionMap"),J3=nr(e=>new Map([...e.entries()].toSorted((t,r)=>t[0].localeCompare(r[0])).map(([t,r])=>[t,K3(r)])),"sortPackagesInfo"),V3=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"),X3=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=>Eu(c)).join(", "),"colorizeImporters"),s=[`
|
|
75
|
-
${Yo(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(Re(u.replace(Pi(n),".")));s.push(` - ${f} imported by ${o([...p],a)}`)}}return s},"formatDuplicatedPackage"),Y3=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 Hb(f);if(!m)return;const{directory:g,name:y,version:x}=m;for(const j of[...d.importers,...d.dynamicImporters]){const R=Pi(j);!n&&xs.test(R)||V3(s,y,x,g,await bm(R,t))}})),q3(),bm.destroy();const a=J3(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=>Yo(f)).join(", ")} is bundled multiple times!`];for(const[f,d]of c)u.push(...X3(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 ${Yo("ignore")} option.`),e.info(`You can copy the following duplicated dependencies as the value of the ${Yo("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"),e9=Object.defineProperty,t9=Z3((e,t)=>e9(e,"name",{value:t,configurable:!0}),"s"),r9=Object.defineProperty,Ya=t9((e,t)=>r9(e,"name",{value:t,configurable:!0}),"t");const n9=/(?:^|[^.\w'"`])require(\.resolve)?\(\s*([\w'"`])/,i9=Ya((e,t)=>{if(q$.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),n9.test(e)&&(i=!0),!r&&!n&&!i)return;const o=Ts(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"),o9=Ya((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"),s9=Ya((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"),a9=Ya((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=o9;if(e.engines?.node){const a=xt.minVersion(e.engines.node);a&&a.major>=20&&a.minor>=11&&(s=s9)}return i9(n,s)}}}},"esmShimCjsSyntaxPlugin");var l9=Object.defineProperty,c9=v((e,t)=>l9(e,"name",{value:t,configurable:!0}),"A$9"),u9=Object.defineProperty,p9=c9((e,t)=>u9(e,"name",{value:t,configurable:!0}),"M"),f9=Object.defineProperty,yt=p9((e,t)=>f9(e,"name",{value:t,configurable:!0}),"f");const uu=/[.*+?^${}()|[\]\\]/g,d9=/.*/,m9=/^(?:\0|\.{1,2}\/)/,h9=/^node:/,g9=/^@visulima\/css-style-inject(?:\/.+)?$/,ym=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(uu,String.raw`\$&`)}$`)):r.warn(`Ignoring wrong entry type #${String(o)} in '${t}' option: ${JSON.stringify(i)}`),n),[]),"getRegExps"),$m=new Map,v9=yt((e,t)=>{$m.has(e)||t.info({message:`Inlined implicit external "${Re(e)}". If this is incorrect, add it to the "externals" option.`,prefix:"plugin:packem:externals"}),$m.set(e,!0)},"logExternalMessage"),xm=new Set(["node:sqlite","node:test"]),b9=/[\\:]/,y9=yt(e=>e.length>0&&!b9.test(e),"isValidPackageName"),Np="@types/",wm=yt(e=>{if(e.startsWith("@")){const[t,r]=e.split("/");return`${t??""}/types/${r??""}`}return`${Np}${e}`},"getAtTypesPackageName"),$9=yt(e=>{if(e.startsWith("@")){const t=e.split("/");if(t[1]==="types")return`@${t[0]??""}/${t.slice(2).join("/")}`}return e.replace(Np,"")},"getOriginalPackageName"),x9=["peerDependencies","dependencies","optionalDependencies"],qb=yt((e,t)=>{const r=Px.realpathSync.native(process.cwd()),{pkg:n}=e,i=new Set;for(const b of x9){const E=n[b];if(E)for(const h of Object.keys(E))h.startsWith(Np)?i.add($9(h)):i.add(h)}const o=new Set(Object.keys(n.devDependencies??{})),s=e.options.rollup.resolveExternals??{},a=new Set(ym([...e.options.externals??[]],"include",e.logger)),l=new Set(ym([...s.exclude??[]],"exclude",e.logger));if(t?.dtsResolve)if(t.dtsResolve===!0)l.add(d9);else for(const b of t.dtsResolve)typeof b=="string"?l.add(new RegExp(`^${b.replaceAll(uu,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(g9),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=Ja(n,e.options),y=e.options.sourceDir?new RegExp(String.raw`(?:^|/)${e.options.sourceDir.replaceAll(uu,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=U$(A,g);B!==A&&(O=B)}let k="";O&&vi(O)&&(k=yf(O).name??""),!k&&vi(A)&&(k=yf(A).name??Ex(A));const C=k&&vi(k)&&y9(k)?k:"";if(C&&!To(C)){e.usedDependencies.add(C);const B=!_||!bl(_,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(m9.test(B)||Ui(B)||(y?.test(B)??!1)||J)return R.set(E,!1),!1;if(To(B)||xm.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),v9(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&&!bl(E,e.options.rootDir)?{external:!0,id:b}:void 0;if(xm.has(b))return{external:!0,id:b,moduleSideEffects:!1};if(To(b)){const _=b.replace(h9,"");let O=_;return(s.builtinsPrefix==="add"||!To(_))&&(O=`node:${_}`),{external:(s.builtins??f(b))&&!d(b),id:s.builtinsPrefix==="ignore"?b:O,moduleSideEffects:!1}}if(!vi(b)||b.includes("?")||b.includes(" "))return;const[A]=Uc(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=wm(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 _=wm(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&&!bl(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&&wx(E,r))return{external:!0,id:b,moduleSideEffects:!1}},order:"pre"}}},"externalsPlugin");var w9=Object.defineProperty,E9=v((e,t)=>w9(e,"name",{value:t,configurable:!0}),"d$i"),S9=Object.defineProperty,k9=E9((e,t)=>S9(e,"name",{value:t,configurable:!0}),"d"),j9=Object.defineProperty,Em=k9((e,t)=>j9(e,"name",{value:t,configurable:!0}),"p");const Ac="\0packem-import-attribute/",A9=/(import[\s\S]+?from\s*["'])([^"']+)(["'])\s*with\s*\{\s*type\s*:\s*["'](text|bytes)["']\s*\}/g,O9=/(\bimport\s*\(\s*["'])([^"']+)["']\s*,\s*\{\s*with\s*:\s*\{\s*type\s*:\s*["'](text|bytes)["']\s*\}\s*\}\s*\)/g,R9=/\.[mc]?[jt]sx?$/,_9=Em(()=>{const e=new Map;let t=0;const r=Em(n=>{const i=`${Ac}${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:Ix(Kc(o),s);if(this.addWatchFile(l),a==="text"){const c=await ps(l,"utf8");return`export default ${JSON.stringify(c)}`}return`export default new Uint8Array([${(await ps(l)).join(",")}])`},name:"packem:import-attributes",resolveId(n,i){return n.startsWith(Ac)&&e.has(n)?n:null},transform(n,i){const o=i.split("?")[0]??i;if(o.startsWith(Ac)||!R9.test(o)||!n.includes("with")||!n.includes("text")&&!n.includes("bytes"))return null;const s=n.replaceAll(A9,(a,l,c,u,p)=>{const f=r({importer:i,source:c,type:p});return`${l}${f}${u}`}).replaceAll(O9,(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 P9=Object.defineProperty,zb=v((e,t)=>P9(e,"name",{value:t,configurable:!0}),"u$i"),C9=Object.defineProperty,Gb=zb((e,t)=>C9(e,"name",{value:t,configurable:!0}),"d"),T9=Object.defineProperty,wn=Gb((e,t)=>T9(e,"name",{value:t,configurable:!0}),"a");const N9=wn(e=>{const t=[],r=[];e.forEach(i=>{i.startsWith("(")?t.push(i):r.push(i)});const n=wn((i,o)=>i.localeCompare(o),"byLocale");return[...r.toSorted(n),...t.toSorted(n)]},"sortLicenses"),I9=wn((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 Qa(e){return e?`> ${e}`:">"}v(Qa,"d$h");zb(Qa,"h");Gb(Qa,"P");wn(Qa,"prefixQuoteMarker");const M9=wn((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=>Qa(n)).join(`
|
|
91
|
-
`),"formatLicenseBody"),Ub=wn(({dtsMarker:e,licenseFilePath:t,licenseTemplate:r,logger:n,marker:i,mode:o,packageName:s})=>Jx({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=I9(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
|
-
${M9(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(N9(l),c,s);try{const p=Mh(t),f=Sx(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&&(Z$(t,f),n.info({message:`${t} updated.`,prefix:`plugin:license:${o}`}))}catch(p){n.error(p)}}}),"licensePlugin");var D9=Object.defineProperty,Kb=v((e,t)=>D9(e,"name",{value:t,configurable:!0}),"C$8"),B9=Object.defineProperty,Ao=Kb((e,t)=>B9(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 L9=Object.defineProperty,W9=Ao((e,t)=>L9(e,"name",{value:t,configurable:!0}),"i");const F9=W9((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 H9=Object.defineProperty,Ip=Ao((e,t)=>H9(e,"name",{value:t,configurable:!0}),"c");const fn={One:"1",Two:"2",Zero:"0"},q9=Ip(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"),z9=/(:[^()\s]+\(([^()]*)\))\s*\{/g,G9=/\s/g,U9=/\s/,Sm=Ip((e,t)=>{let r=t;const n=[...e.matchAll(z9)];for(const i of n){const o=i[1],s=i[2];if(!o||!s||!U9.test(s))continue;const a=s.replaceAll(G9,""),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"),K9={},J9={caseSensitive:!0,collapseWhitespace:!0,decodeEntities:!0,minifyCSS:K9,minifyJS:!0,removeAttributeQuotes:!1,removeComments:!0,removeEmptyAttributes:!0,removeScriptTypeAttributes:!0,removeStyleLinkTypeAttributes:!0,useShortDoctype:!0},km=Ip((e={})=>{const t=q9(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"),V9={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=km(t),n=new Vx(r).minify(e);if(n.errors.length>0)throw new Error(n.errors.join(`
|
|
101
|
-
|
|
102
|
-
`));return r.level?.[fn.One]?.tidySelectors&&(n.styles=Sm(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=km(r));let i=await Xx(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=Sm(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 X9=Object.defineProperty,Za=Ao((e,t)=>X9(e,"name",{value:t,configurable:!0}),"f");const Y9=Za((e,t)=>e.generateMap({file:`${t}.map`,hires:!0,source:t}),"defaultGenerateSourceMap"),Q9=Za(e=>{const t=e.tag?.toLowerCase();return!!t&&(t.includes("html")||t.includes("svg"))},"defaultShouldMinify"),Z9=Za(e=>!!e.tag&&e.tag.toLowerCase().includes("css"),"defaultShouldMinifyCSS"),e8={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 el(e,t={}){t.minifyOptions={...J9,...t.minifyOptions},t.MagicString??=Ke,t.parseLiterals??=F9,t.shouldMinify??=Q9,t.shouldMinifyCSS??=Z9,t.parseLiteralsOptions={fileName:t.fileName,...t.parseLiteralsOptions};const r=t.parseLiterals(e,t.parseLiteralsOptions),n=t.strategy??V9,{shouldMinify:i,shouldMinifyCSS:o}=t;let s;t.validate!==!1&&(s=t.validate??e8);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??Y9)(a,t.fileName??"")),{code:l,map:c}}v(el,"O$8");Kb(el,"H");Ao(el,"minifyHTMLLiterals");Za(el,"minifyHTMLLiterals");var t8=Object.defineProperty,r8=Ao((e,t)=>t8(e,"name",{value:t,configurable:!0}),"o");const n8=r8(({exclude:e,failOnError:t=!1,include:r,logger:n,minifyHTMLLiterals:i,options:o})=>{i??=el;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 i8=Object.defineProperty,o8=v((e,t)=>i8(e,"name",{value:t,configurable:!0}),"h$a"),s8=Object.defineProperty,a8=o8((e,t)=>s8(e,"name",{value:t,configurable:!0}),"h"),l8=Object.defineProperty,jm=a8((e,t)=>l8(e,"name",{value:t,configurable:!0}),"f");const c8=/\.node$/,Oc="\0packem-natives/",u8=jm((e={})=>{const{nativesDirectory:t="natives"}=e,r=new Map;let n=0,i;return{buildStart(){r.clear(),n=0},generateBundle:jm(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 Jc(a);const l=new Set,c=[];for(const{outputName:u,sourcePath:p}of r.values())l.has(p)||(l.add(p),c.push(Lx(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:c8},async handler(o,s){if(o.startsWith(Oc))return;if(s?.startsWith(Oc))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=wt(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=`${wt(l,d)}_${String(u)}${d}`,u+=1}const f=`${Oc}${String(n)}`;return n+=1,r.set(f,{outputName:c,sourcePath:a}),f}}}},"nativeModulesPlugin");var p8=Object.defineProperty,f8=v((e,t)=>p8(e,"name",{value:t,configurable:!0}),"n$9"),d8=Object.defineProperty,m8=f8((e,t)=>d8(e,"name",{value:t,configurable:!0}),"n"),h8=Object.defineProperty,g8=m8((e,t)=>h8(e,"name",{value:t,configurable:!0}),"a");const v8=g8(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 b8=Object.defineProperty,y8=v((e,t)=>b8(e,"name",{value:t,configurable:!0}),"N$8"),$8=Object.defineProperty,Jb=y8((e,t)=>$8(e,"name",{value:t,configurable:!0}),"w"),x8=Object.defineProperty,w8=Jb((e,t)=>x8(e,"name",{value:t,configurable:!0}),"s");let Am=!1;const E8=w8(async(e,t,r)=>{if(Am||(await rg(),Am=!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 ex(n);if(i.type==="module")return!1;if(i.type==="commonjs")return!0}catch{}try{const i=await kr(n,{encoding:"utf8"});try{return Yx(i,n),!0}catch{}}catch{}}}return!1},"isPureCJS");var S8=Object.defineProperty,Ln=Jb((e,t)=>S8(e,"name",{value:t,configurable:!0}),"d");const Mp="__cjs_require",k8='import { createRequire as __cjs_createRequire } from "node:module";',j8=`const ${Mp} = __cjs_createRequire(import.meta.url);`,A8='const __cjs_getProcess = typeof globalThis !== "undefined" && typeof globalThis.process !== "undefined" ? globalThis.process : process;',O8=`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 ${Mp}(module);
|
|
118
|
-
};`,Bo={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},R8=[/node_modules/,/\.d\.[cm]?ts$/],_8=[/\.[cm]?[jt]sx?$/];let Om=!1;const P8=Ln((e,t)=>t&&(N$.includes(e)||e.startsWith("node:")),"isBuiltinModule"),C8=Ln(async(e,t,r,n,i)=>t?!0:await r?.(e,n,i)??await E8(e,n,i),"shouldTransformImport"),T8=Ln((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:`${Mp}(${JSON.stringify(e)})`,needsBuiltin:!1,needsProcess:!1,needsRequire:!0},"generateRequireCode"),N8=Ln(e=>{const t=new Ke(e),r={builtin:[...e.matchAll(Bo.builtin)],import:[...e.matchAll(Bo.import)],process:[...e.matchAll(Bo.process)],require:[...e.matchAll(Bo.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"),I8=Ln(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??R8,include:e.include??_8,order:"order"in e?e.order:"pre",shouldTransform:e.shouldTransform}},"resolveOptions"),M8=Ln((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}=I8(e),l=Mt(o,i);return{async buildStart(){Om||(await rg(),Om=!0)},name:"packem:plugin-require-cjs",renderChunk:{async handler(c,u,p){if(p.format!=="es"||!l(u.fileName))return;const f=Ns(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=P8(R,r),E=this.resolve;if(!await C8(R,b,a,n,E))continue;const{code:h,needsBuiltin:A,needsProcess:_,needsRequire:O}=T8(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(k8,j8),g&&j.push(A8),y&&j.push(O8);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(N8(d.toString()));return{code:x.toString(),map:x.generateMap()}},order:s}}},"requireCJSTransformerPlugin");var D8=Object.defineProperty,B8=v((e,t)=>D8(e,"name",{value:t,configurable:!0}),"I$6"),L8=Object.defineProperty,W8=B8((e,t)=>L8(e,"name",{value:t,configurable:!0}),"S"),F8=Object.defineProperty,ws=W8((e,t)=>F8(e,"name",{value:t,configurable:!0}),"f");const H8=ws(async e=>{try{const n=await Ji(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"),q8=ws(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"),Vb=ws(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=ws(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||!vi(d))continue;const[m,g]=Uc(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]=Uc(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 q8(u,m);if(!j){r.set(y,void 0);return}let R=t.get(j);if(R===void 0)try{R=tx(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 H8(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 z8=Object.defineProperty,G8=v((e,t)=>z8(e,"name",{value:t,configurable:!0}),"m$c"),U8=Object.defineProperty,K8=G8((e,t)=>U8(e,"name",{value:t,configurable:!0}),"u"),J8=Object.defineProperty,tl=K8((e,t)=>J8(e,"name",{value:t,configurable:!0}),"o");const Es=/^#![^\n]*/,pu=tl(async e=>{await Yh(e,493).catch(()=>{})},"makeExecutable"),V8=tl((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(Es,`${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"&&Es.test(o.code)&&r.dir){const s=ve(r.dir,i);await pu(s)}}}),"shebangPlugin"),X8=tl(()=>({name:"packem:remove-shebang",renderChunk(e){return e.replace(Es,"")}}),"removeShebangPlugin"),Y8=tl((e,t=`
|
|
130
|
-
`)=>{const r=Es.exec(e);return r?`${r[0]}${t}`:""},"getShebang");var Q8=Object.defineProperty,Xe=v((e,t)=>Q8(e,"name",{value:t,configurable:!0}),"C$7"),En=44,Xb=59,Rm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Yb=new Uint8Array(64),Qb=new Uint8Array(128);for(let e=0;e<Rm.length;e++){const t=Rm.charCodeAt(e);Yb[e]=t,Qb[t]=e}function Ie(e,t){let r=0,n=0,i=0;do{const s=e.next();i=Qb[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(Yb[i])}while(n>0);return t}v(Oe,"i$8");Xe(Oe,"encodeInteger");function Ht(e,t){return e.pos>=t?!1:e.peek()!==En}v(Ht,"S$6");Xe(Ht,"hasMoreVlq");var _m=1024*16,Pm=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}},Dp=class{static{v(this,"T")}static{Xe(this,"StringWriter")}constructor(){this.pos=0,this.out="",this.buffer=new Uint8Array(_m)}write(t){const{buffer:r}=this;r[this.pos++]=t,this.pos===_m&&(this.out+=Pm.decode(r),this.pos=0)}flush(){const{buffer:t,out:r,pos:n}=this;return n>0?r+Pm.decode(t.subarray(0,n)):r}},Bp=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}},Zb=[];function Z8(e){const{length:t}=e,r=new Bp(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=Zb;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 eN(e){const t=new Dp;for(let r=0;r<e.length;)r=Lp(e,r,t,[0]);return t.flush()}v(eN,"F$8");Xe(eN,"encodeOriginalScopes");function Lp(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(En),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=Lp(e,t,r,n)}return r.write(En),n[0]=Oe(r,a,n[0]),Oe(r,l,0),t}v(Lp,"P$8");Xe(Lp,"_encodeOriginalScopes");function tN(e){const{length:t}=e,r=new Bp(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=Zb,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(tN,"H$5");Xe(tN,"decodeGeneratedRanges");function rN(e){if(e.length===0)return"";const t=new Dp;for(let r=0;r<e.length;)r=Wp(e,r,t,[0,0,0,0,0,0,0]);return t.flush()}v(rN,"J$3");Xe(rN,"encodeGeneratedRanges");function Wp(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?(fu(r,n[0],o),n[0]=o,n[1]=0):t>0&&r.write(En),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=Wp(e,t,r,n)}return n[0]<a?(fu(r,n[0],a),n[0]=a,n[1]=0):r.write(En),n[1]=Oe(r,l,n[1]),t}v(Wp,"V$4");Xe(Wp,"_encodeGeneratedRanges");function fu(e,t,r){do e.write(Xb);while(++t<r)}v(fu,"U$5");Xe(fu,"catchupLine");function ey(e){const{length:t}=e,r=new Bp(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||ty(u),n.push(u),r.pos=c+1}while(r.pos<=t);return n}v(ey,"K$4");Xe(ey,"decode");function ty(e){e.sort(ry)}v(ty,"Q$4");Xe(ty,"sort");function ry(e,t){return e[0]-t[0]}v(ry,"X$5");Xe(ry,"sortComparator");function ny(e){const t=new Dp;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(Xb),a.length===0)continue;let l=0;for(let c=0;c<a.length;c++){const u=a[c];c>0&&t.write(En),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(ny,"Z$3");Xe(ny,"encode");var nN=Object.defineProperty,ft=v((e,t)=>nN(e,"name",{value:t,configurable:!0}),"c$g");const iN=/^[\w+.-]+:\/\//,oN=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,sN=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function iy(e){return iN.test(e)}v(iy,"R$6");ft(iy,"isAbsoluteUrl");function oy(e){return e.startsWith("//")}v(oy,"q$5");ft(oy,"isSchemeRelativeUrl");function Fp(e){return e.startsWith("/")}v(Fp,"m$b");ft(Fp,"isAbsolutePath");function sy(e){return e.startsWith("file:")}v(sy,"v$c");ft(sy,"isFileUrl");function du(e){return/^[.?#]/.test(e)}v(du,"u$f");ft(du,"isRelative");function wi(e){const t=oN.exec(e);return Hp(t[1],t[2]||"",t[3],t[4]||"",t[5]||"/",t[6]||"",t[7]||"")}v(wi,"f$d");ft(wi,"parseAbsoluteUrl");function ay(e){const t=sN.exec(e),r=t[2];return Hp("file:","",t[1]||"","",Fp(r)?r:"/"+r,t[3]||"",t[4]||"")}v(ay,"w$7");ft(ay,"parseFileUrl");function Hp(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(Hp,"y$9");ft(Hp,"makeUrl");function mu(e){if(oy(e)){const r=wi("http:"+e);return r.scheme="",r.type=6,r}if(Fp(e)){const r=wi("http://foo.com"+e);return r.scheme="",r.host="",r.type=5,r}if(sy(e))return ay(e);if(iy(e))return wi(e);const t=wi("http://foo.com/"+e);return t.scheme="",t.host="",t.type=e?e.startsWith("?")?3:e.startsWith("#")?2:4:1,t}v(mu,"p$d");ft(mu,"parseUrl");function ly(e){if(e.endsWith("/.."))return e;const t=e.lastIndexOf("/");return e.slice(0,t+1)}v(ly,"P$7");ft(ly,"stripPathFilename");function cy(e,t){qp(t,t.type),e.path==="/"?e.path=t.path:e.path=ly(t.path)+e.path}v(cy,"A$5");ft(cy,"mergePaths");function qp(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(qp,"d$f");ft(qp,"normalizePath");function uy(e,t){if(!e&&!t)return"";const r=mu(e);let n=r.type;if(t&&n!==7){const o=mu(t),s=o.type;switch(n){case 1:r.hash=o.hash;case 2:r.query=o.query;case 3:case 4:cy(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)}qp(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?du(t||e)&&!du(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(uy,"F$7");ft(uy,"resolve");var aN=Object.defineProperty,xe=v((e,t)=>aN(e,"name",{value:t,configurable:!0}),"i$7");function py(e){if(!e)return"";const t=e.lastIndexOf("/");return e.slice(0,t+1)}v(py,"ae$4");xe(py,"stripFilename");function fy(e,t){const r=py(e),n=t?t+"/":"";return i=>uy(n+(i||""),r)}v(fy,"ge$3");xe(fy,"resolver");var jt=0,zp=1,Gp=2,Up=3,dy=4,my=1,hy=2;function gy(e,t){const r=hu(e,0);if(r===e.length)return e;t||(e=e.slice());for(let n=r;n<e.length;n=hu(e,n+1))e[n]=by(e[n],t);return e}v(gy,"he$1");xe(gy,"maybeSort");function hu(e,t){for(let r=t;r<e.length;r++)if(!vy(e[r]))return r;return e.length}v(hu,"X$4");xe(hu,"nextUnsortedSegmentLine");function vy(e){for(let t=1;t<e.length;t++)if(e[t][jt]<e[t-1][jt])return!1;return!0}v(vy,"_e$1");xe(vy,"isSorted");function by(e,t){return t||(e=e.slice()),e.sort(Kp)}v(by,"ve$2");xe(by,"sortSegments");function Kp(e,t){return e[jt]-t[jt]}v(Kp,"$$8");xe(Kp,"sortComparator");function yy(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[zp],l=s[Gp],c=s[Up],u=r[a];(u[l]||(u[l]=[])).push([c,n,s[jt]])}}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(Kp)}}return r}v(yy,"Se$1");xe(yy,"buildBySources");var Er=!1;function $y(e,t,r,n){for(;r<=n;){const i=r+(n-r>>1),o=e[i][jt]-t;if(o===0)return Er=!0,i;o<0?r=i+1:n=i-1}return Er=!1,r-1}v($y,"Ee$1");xe($y,"binarySearch");function Jp(e,t,r){for(let n=r+1;n<e.length&&e[n][jt]===t;r=n++);return r}v(Jp,"H$4");xe(Jp,"upperBound");function Vp(e,t,r){for(let n=r-1;n>=0&&e[n][jt]===t;r=n--);return r}v(Vp,"Y$3");xe(Vp,"lowerBound");function Xp(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}v(Xp,"k$7");xe(Xp,"memoizedState");function xy(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][jt]===t,s;t>=o?a=s===-1?0:s:l=s}return r.lastKey=n,r.lastNeedle=t,r.lastIndex=$y(e,t,a,l)}v(xy,"Me$2");xe(xy,"memoizedBinarySearch");function rl(e){return typeof e=="string"?JSON.parse(e):e}v(rl,"j$8");xe(rl,"parse");var lN=xe(function(e,t){const r=rl(e);if(!("sections"in r))return new Qp(r,t);const n=[],i=[],o=[],s=[],a=[];Yp(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 Ay(l)},"FlattenMap");function Yp(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)}wy(d,t,r,n,i,o,s,a+m.line,l+m.column,g,y)}}v(Yp,"ee$3");xe(Yp,"recurse");function wy(e,t,r,n,i,o,s,a,l,c,u){const p=rl(e);if("sections"in p)return Yp(...arguments);const f=new Qp(p,t),d=n.length,m=o.length,g=Lr(f),{resolvedSources:y,sourcesContent:x,ignoreList:j}=f;if(os(n,y),os(o,f.names),x)os(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=Ey(r,b),h=R===0?l:0,A=g[R];for(let _=0;_<A.length;_++){const O=A[_],k=h+O[jt];if(b===c&&k>=u)return;if(O.length===1){E.push([k]);continue}const C=d+O[zp],B=O[Gp],J=O[Up];E.push(O.length===4?[k,C,B,J]:[k,C,B,J,m+O[dy]])}}}v(wy,"me$3");xe(wy,"addSection");function os(e,t){for(let r=0;r<t.length;r++)e.push(t[r])}v(os,"G$7");xe(os,"append");function Ey(e,t){for(let r=e.length;r<=t;r++)e[r]=[];return e[t]}v(Ey,"xe$1");xe(Ey,"getLine");var Sy="`line` must be greater than 0 (lines start at line 1)",ky="`column` must be greater than or equal to 0 (columns start at column 0)",Ss=-1,nl=1,Qp=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=rl(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=fy(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=gy(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=Xp(),this._bySources=void 0,this._bySourceMemos=void 0}};function jy(e){var t,r;return(r=(t=e)._encoded)!=null?r:t._encoded=ny(e._decoded)}v(jy,"oe$4");xe(jy,"encodedMappings");function Lr(e){var t;return(t=e)._decoded||(t._decoded=ey(e._encoded))}v(Lr,"O$7");xe(Lr,"decodedMappings");function cN(e,t,r){const n=Lr(e);if(t>=n.length)return null;const i=n[t],o=Oo(i,e._decodedMemo,t,r,nl);return o===-1?null:i[o]}v(cN,"Oe$2");xe(cN,"traceSegment");function uN(e,t){let{line:r,column:n,bias:i}=t;if(r--,r<0)throw new Error(Sy);if(n<0)throw new Error(ky);const o=Lr(e);if(r>=o.length)return Ei(null,null,null,null);const s=o[r],a=Oo(s,e._decodedMemo,r,n,i||nl);if(a===-1)return Ei(null,null,null,null);const l=s[a];if(l.length===1)return Ei(null,null,null,null);const{names:c,resolvedSources:u}=e;return Ei(u[l[zp]],l[Gp]+1,l[Up],l.length===5?c[l[dy]]:null)}v(uN,"Le$1");xe(uN,"originalPositionFor");function pN(e,t){const{source:r,line:n,column:i,bias:o}=t;return ef(e,r,n,i,o||nl,!1)}v(pN,"ye$1");xe(pN,"generatedPositionFor");function fN(e,t){const{source:r,line:n,column:i,bias:o}=t;return ef(e,r,n,i,o||Ss,!0)}v(fN,"Ce$2");xe(fN,"allGeneratedPositionsFor");function dN(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(dN,"Ie$1");xe(dN,"eachMapping");function Zp(e,t){const{sources:r,resolvedSources:n}=e;let i=r.indexOf(t);return i===-1&&(i=n.indexOf(t)),i}v(Zp,"re$4");xe(Zp,"sourceIndex");function mN(e,t){const{sourcesContent:r}=e;if(r==null)return null;const n=Zp(e,t);return n===-1?null:r[n]}v(mN,"Ne$1");xe(mN,"sourceContentFor");function hN(e,t){const{ignoreList:r}=e;if(r==null)return!1;const n=Zp(e,t);return n===-1?!1:r.includes(n)}v(hN,"be$1");xe(hN,"isIgnored");function Ay(e,t){const r=new Qp(il(e,[]),t);return r._decoded=e.mappings,r}v(Ay,"se$4");xe(Ay,"presortedDecodedMap");function gN(e){return il(e,Lr(e))}v(gN,"Re$1");xe(gN,"decodedMap");function vN(e){return il(e,jy(e))}v(vN,"we$1");xe(vN,"encodedMap");function il(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(il,"B$7");xe(il,"clone");function Ei(e,t,r,n){return{source:e,line:t,column:r,name:n}}v(Ei,"b$9");xe(Ei,"OMapping");function en(e,t){return{line:e,column:t}}v(en,"y$8");xe(en,"GMapping");function Oo(e,t,r,n,i){let o=xy(e,n,t,r);return Er?o=(i===Ss?Jp:Vp)(e,n,o):i===Ss&&o++,o===-1||o===e.length?-1:o}v(Oo,"w$6");xe(Oo,"traceSegmentInternal");function Oy(e,t,r,n,i){let o=Oo(e,t,r,n,nl);if(!Er&&i===Ss&&o++,o===-1||o===e.length)return[];const s=Er?n:e[o][jt];Er||(o=Vp(e,s,o));const a=Jp(e,s,o),l=[];for(;o<=a;o++){const c=e[o];l.push(en(c[my]+1,c[hy]))}return l}v(Oy,"Ue$1");xe(Oy,"sliceGeneratedPositions");function ef(e,t,r,n,i,o){var s,a;if(r--,r<0)throw new Error(Sy);if(n<0)throw new Error(ky);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(Xp)),f=((a=e)._bySources||(a._bySources=yy(Lr(e),p)))[u][r];if(f==null)return o?[]:en(null,null);const d=p[u];if(o)return Oy(f,d,r,n,i);const m=Oo(f,d,r,n,i);if(m===-1)return en(null,null);const g=f[m];return en(g[my]+1,g[hy])}v(ef,"ie$3");xe(ef,"generatedPosition");var bN=Object.defineProperty,yN=v((e,t)=>bN(e,"name",{value:t,configurable:!0}),"p$c"),$N=Object.defineProperty,Ry=yN((e,t)=>$N(e,"name",{value:t,configurable:!0}),"c");const xN=De(import.meta.url),di=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_y=Ry(e=>{if(typeof di<"u"&&di.versions&&di.versions.node){const[t,r]=di.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return di.getBuiltinModule(e)}return xN(e)},"__cjs_getBuiltinModule"),{readFileSync:Cm}=_y("node:fs"),{resolve:wN,toNamespacedPath:Rc,dirname:EN}=_y("node:path");var SN=Object.defineProperty,Ro=Ry((e,t)=>SN(e,"name",{value:t,configurable:!0}),"s");const kN=/^data:application\/json[^,]+base64,/,jN=/\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+)[ \t]*$|\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*\*\/[ \t]*$/,AN=/\r?\n/,Py=Ro(e=>kN.test(e),"isInlineMap"),_c=Ro((e,t)=>{const r=e instanceof Error?e.message:String(e),n=`${t}:
|
|
131
|
-
${r}`;throw new Error(n)},"enhanceError"),ON=Ro((e,t)=>{const r=e.split(AN);let n;for(let o=r.length-1;o>=0&&!n;o--)n=jN.exec(r[o])??void 0;if(!n)return;const i=n[1]??n[2];if(i)return Py(i)?i:wN(t,i)},"resolveSourceMapUrl"),RN=Ro(e=>{const t=e.slice(e.indexOf(",")+1);return Buffer.from(t,"base64").toString()},"decodeInlineMap"),_N=Ro(e=>{let t;try{t=Cm(e,{encoding:"utf8"})}catch(i){_c(i,`Error reading sourcemap for file "${Rc(e)}"`)}const r=ON(t,EN(e));if(!r)return;let n;if(Py(r))n=RN(r);else try{n=Cm(r,{encoding:"utf8"})}catch(i){_c(i,`Error reading sourcemap for file "${Rc(e)}"`)}try{return new lN(n,r)}catch(i){_c(i,`Error parsing sourcemap for file "${Rc(e)}"`)}},"loadSourceMap");var PN=Object.defineProperty,CN=v((e,t)=>PN(e,"name",{value:t,configurable:!0}),"o$6"),TN=Object.defineProperty,NN=CN((e,t)=>TN(e,"name",{value:t,configurable:!0}),"o"),IN=Object.defineProperty,MN=NN((e,t)=>IN(e,"name",{value:t,configurable:!0}),"o");const DN=/\?[^?]*$/,BN=MN(({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(DN,"");i=await kr(s,{buffer:!1}),this.addWatchFile(s)}catch{this.warn("Failed reading file");return}}let o;try{const s=_N(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 LN=Object.defineProperty,WN=v((e,t)=>LN(e,"name",{value:t,configurable:!0}),"b$8"),FN=Object.defineProperty,HN=WN((e,t)=>FN(e,"name",{value:t,configurable:!0}),"v"),qN=Object.defineProperty,Cy=HN((e,t)=>qN(e,"name",{value:t,configurable:!0}),"g");const zN=Cy(async(e,t)=>{await new Promise((r,n)=>{const i=Ru(e);i.on("error",n);const o=Cx(t);o.on("error",n),o.on("finish",()=>{r(void 0)}),i.pipe(o)})},"copy"),GN=Cy(({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 Jc(p),await Promise.all(Object.keys(c).map(async f=>{const d=c[f],m=le(p,Ce(d));await Jc(m),await zN(f,le(p,d))}))},async load(u){if(!l(u))return;this.addWatchFile(u);const[p,f]=await Promise.all([Ji(u),ps(u)]);let d;if(o&&p.size>o||o===0){const m=Qx.createHash("sha1").update(f).digest("hex").slice(0,16),g=gn(u),y=wt(u,g),x=a?tt(a,Ce(u)):wt(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=_b.getType(u);if(m===null)throw new Error(`Could not determine mimetype for ${u}`);d=m==="image/svg+xml"?kx(f):f.toString("base64"),d=`data:${m};base64,${d}`}return`export default "${d}"`},name:"packem:url"}},"urlPlugin");var UN=Object.defineProperty,_t=v((e,t)=>UN(e,"name",{value:t,configurable:!0}),"u$c"),KN=Object.defineProperty,nt=_t((e,t)=>KN(e,"name",{value:t,configurable:!0}),"u"),JN=Object.defineProperty,Lo=nt((e,t)=>JN(e,"name",{value:t,configurable:!0}),"i");let Ty=class{static{v(this,"A")}static{_t(this,"b")}static{nt(this,"WalkerBase")}static{Lo(this,"WalkerBase")}constructor(){this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:Lo(()=>this.should_skip=!0,"skip"),remove:Lo(()=>this.should_remove=!0,"remove"),replace:Lo(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 VN=Object.defineProperty,Si=nt((e,t)=>VN(e,"name",{value:t,configurable:!0}),"c$1");let XN=class extends Ty{static{v(this,"E")}static{_t(this,"I")}static{nt(this,"SyncWalker")}static{Si(this,"SyncWalker")}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}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];Fi(c)&&(this.visit(c,t,o,l)||l--)}}else Fi(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 Fi(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"}v(Fi,"_$5");_t(Fi,"k");nt(Fi,"n");Si(Fi,"isNode");var YN=Object.defineProperty,ki=nt((e,t)=>YN(e,"name",{value:t,configurable:!0}),"c");let QN=class extends Ty{static{v(this,"L")}static{_t(this,"E")}static{nt(this,"AsyncWalker")}static{ki(this,"AsyncWalker")}constructor(t,r){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:ki(()=>this.should_skip=!0,"skip"),remove:ki(()=>this.should_remove=!0,"remove"),replace:ki(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];Hi(c)&&(await this.visit(c,t,o,l)||l--)}}else Hi(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 Hi(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"}v(Hi,"g$3");_t(Hi,"_");nt(Hi,"a$1");ki(Hi,"isNode");var ZN=Object.defineProperty,Ny=nt((e,t)=>ZN(e,"name",{value:t,configurable:!0}),"a");function ol(e,{enter:t,leave:r}){return new XN(t,r).visit(e,null)}v(ol,"b$7");_t(ol,"$");nt(ol,"walk");Ny(ol,"walk");async function tf(e,{enter:t,leave:r}){return await new QN(t,r).visit(e,null)}v(tf,"T$4");_t(tf,"M");nt(tf,"asyncWalk");Ny(tf,"asyncWalk");var e7=Object.defineProperty,cr=nt((e,t)=>e7(e,"name",{value:t,configurable:!0}),"l");const t7=/\s/,r7=/\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\//g,n7=/MIT License|MIT license|BSD license/,i7=/\n{2,}/g,o7=/\b(\w+)\$\d+\b/g,s7=/[-/\\^$*+?.()|[\]{}]/g,a7=cr(e=>e.replaceAll(s7,String.raw`\$&`),"escapeRegex"),l7=cr(e=>[...new Set(e)],"unique"),c7=/\.[^/.]+$/;function sl(e){return n7.test(e)?"":e}v(sl,"w$4");_t(sl,"x");nt(sl,"k");cr(sl,"stripLicenseComment");const u7=cr(e=>e.replaceAll(r7,sl).replaceAll(i7,`
|
|
132
|
-
|
|
133
|
-
`),"cleanUnnecessaryComments"),Tm=new Map;function al(e,t,{identifierReplacements:r},n){const i=Ts(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=a7(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=l7(Array.from(o.matchAll(o7),a=>a[0]));if(s.length>0){const a=s.map(c=>`
|
|
134
|
-
- ${c}`).join(""),l=t.fileName.replace(c7,"");Tm.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"}),Tm.set(l,!0)}return o}v(al,"x$3");_t(al,"S");nt(al,"O");cr(al,"replaceConfusingTypeNames");function ll(e,t){if(!e.includes("@internal"))return e;const r=new Ke(e),n=Ns(t.fileName,e,{lang:"dts",sourceType:"module"}),i=cr(a=>{let l=a,c=!0;for(;c;){for(c=!1;l<e.length&&t7.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&&ol(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(ll,"$$6");_t(ll,"A");nt(ll,"v");cr(ll,"stripInternalTypes");const p7=cr((e,t)=>({name:"packem:patch-types",renderChunk(r,n){return r=al.call(this,r,n,e,t),r=ll.call(this,r,n),r=u7(r),r}}),"patchTypescriptTypes");var f7=Object.defineProperty,d7=v((e,t)=>f7(e,"name",{value:t,configurable:!0}),"d$b"),m7=Object.defineProperty,h7=d7((e,t)=>m7(e,"name",{value:t,configurable:!0}),"d"),g7=Object.defineProperty,zt=h7((e,t)=>g7(e,"name",{value:t,configurable:!0}),"o");const v7=/^\./,b7=/\0/,y7=42,$7=zt(e=>{let t=!1;for(let r=0;r<e.length;r++)if(e.codePointAt(r)===y7){if(t)return!1;t=!0}return!0},"hasZeroOrOneAsteriskCharacter"),x7=zt(e=>{const t=e.indexOf("*");return t===-1?void 0:{prefix:e.slice(0,t),suffix:e.slice(t+1)}},"tryParsePattern"),w7=zt(({prefix:e,suffix:t},r)=>r.length>=e.length+t.length&&r.startsWith(e)&&r.endsWith(t),"isPatternMatch"),E7=zt((e,t,r)=>{let n,i=-1;for(const o of e){const s=t(o);w7(s,r)&&s.prefix.length>i&&(i=s.prefix.length,n=o)}return n},"findBestPatternMatch"),S7=zt((e,t)=>{const r=[];for(const n of e){if(!$7(n))continue;const i=x7(n);if(i)r.push(i);else if(n===t)return n}return E7(r,n=>n,t)},"matchPatternOrExact"),k7=zt((e,t)=>t.substring(e.prefix.length,t.length-e.suffix.length),"matchedText"),j7=zt(({prefix:e,suffix:t})=>`${e}*${t}`,"patternText"),A7=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"),Iy=zt((e,t,r,n)=>{const{paths:i,resolvedBaseUrl:o}=A7(e,t,r),s=Object.keys(i);return{name:"plugin:resolve-tsconfig-paths",resolveId:{filter:{id:{exclude:[v7,b7]}},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&&Ui(a)){r.debug({message:`Skipping request as it is an absolute path ${a}`,prefix:"plugin:resolve-tsconfig-paths"});return}if(Nh(a)){r.debug({message:`Skipping request as it is a relative path ${a}`,prefix:"plugin:resolve-tsconfig-paths"});return}const u=S7(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:k7(u,a),f=typeof u=="string"?u:j7(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 O7=Object.defineProperty,R7=v((e,t)=>O7(e,"name",{value:t,configurable:!0}),"f$a"),_7=Object.defineProperty,P7=R7((e,t)=>_7(e,"name",{value:t,configurable:!0}),"a"),C7=Object.defineProperty,My=P7((e,t)=>C7(e,"name",{value:t,configurable:!0}),"u");const T7=/^\./,N7=My((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"),Dy=My((e,t,r)=>{const n=N7(e,r);return{name:"packem:resolve-tsconfig-root-dirs",resolveId:{filter:{id:T7},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 I7=Object.defineProperty,M7=v((e,t)=>I7(e,"name",{value:t,configurable:!0}),"l$c"),D7=Object.defineProperty,B7=M7((e,t)=>D7(e,"name",{value:t,configurable:!0}),"l"),L7=Object.defineProperty,rf=B7((e,t)=>L7(e,"name",{value:t,configurable:!0}),"l");const W7={".cjs":[".cts"],".js":[".ts",".tsx"],".jsx":[".tsx",".ts"],".mjs":[".mts"]},Nm=/\.(?:[mc]?js|jsx)$/,F7=rf(e=>{const t=e[0];return!(t==="."||t==="/"||t==="#"||Mx(e))},"isBareSpecifier"),Im=rf(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"),By=rf(()=>({name:"packem:resolve-typescript-mjs-cjs",resolveId:{filter:{id:Nm},async handler(e,t,r){if(!t)return;const n=Nm.exec(e);if(!n)return;const i=n[0],o=W7[i];if(!o)return;const s=e.slice(0,-i.length),a={...r,skipSelf:!0};return!F7(e)&&!t.includes("/node_modules/")?Im(this,o,s,t,a,!1):await this.resolve(e,t,a)||Im(this,o,s,t,a,!0)}}}),"resolveTypescriptMjsCts");var H7=Object.defineProperty,q7=v((e,t)=>H7(e,"name",{value:t,configurable:!0}),"b$4"),z7=Object.defineProperty,Ly=q7((e,t)=>z7(e,"name",{value:t,configurable:!0}),"S"),G7=Object.defineProperty,ir=Ly((e,t)=>G7(e,"name",{value:t,configurable:!0}),"h");const U7=/^export\s+default\s+(\w+);/m,K7=/export\s*\{([^}]*)\}/,J7=/\s*as\s+default\s*/,V7=/\s+\}$/,Wo=/;$/,X7=/(?:\r?\n\s*){2,}/g,Pc=/^type\s+/,Mm=/\bas\s+default\b/,Y7=ir((e,t,r)=>{const n=zx(e).find(l=>l.names.includes("default")),i=U7.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=K7.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=J7.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"),qi=ir((e,t,r,n)=>{const i=Ns(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(V7," }");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"),Cc=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(Wo,""),p.replace(Wo,""));return f.endsWith(";")?f:`${f};`}const o=`import _default from '${n.specifier??""}';`,s=new Ke(e),a=Ts(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(X7,`
|
|
149
|
-
`);let u;if(i.length===0)u=c.replace(n.code.replace(Wo,""),"export = _default");else{const p=`// @ts-ignore
|
|
150
|
-
export = _default;
|
|
151
|
-
export { ${i.join(", ")} } from '${n.specifier??""}';`;u=c.replace(n.code.replace(Wo,""),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 qi(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 qi(e,m,t,i)}return new Ke(u).replace(a.code,`export = ${s}`).toString()},"handleDefaultNamedCJSExport"),Dm=ir((e,t,{defaultAlias:r,defaultExport:n,exports:i},o)=>{const s=i.filter(l=>Pc.test(l)),a=i.filter(l=>!Pc.test(l));if(s.length>0){let l="";return r&&(l+=`// @ts-ignore
|
|
154
|
-
${r};
|
|
155
|
-
`),l+=`export type { ${s.map(c=>c.replace(Pc,"").trim()).join(", ")} };
|
|
156
|
-
`,a.length>0&&(l+=`export { ${a.join(", ")} };
|
|
157
|
-
`),qi(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
|
-
`,qi(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"),eI=/^export\s+default\s+from\s+['"]([^'"]+)['"];?$/m,tI=ir((e,t,r)=>{const n=eI.exec(e);if(n)return{code:`import _default from '${n[1]??""}';
|
|
161
|
-
export = _default;`,map:void 0};const i=Y7(e,t,r);if(i){let l;if(i.defaultExport.specifier){const{specifier:c}=i.defaultExport,u=Ts(e),p=u.filter(x=>x.imports).map(x=>qx(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=Cc(e,i,f);else if(d==="default"&&m.specifier&&g.length===0&&y&&Mm.test(y))p.find(x=>x.specifier===m.specifier)?.defaultImport?l=Cc(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=Cc(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&&Mm.test(y))){const j=Dm(e,t,i,r);j&&(l=j)}}}else l=Dm(e,t,i,r);return l?{code:l,map:void 0}:void 0}const o=Ns(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=qi(e,l,t,r);return c?{code:c,map:void 0}:void 0}},"fixDtsDefaultCJSExports");var rI=Object.defineProperty,Bm=Ly((e,t)=>rI(e,"name",{value:t,configurable:!0}),"s");const nI=/\.d\.c?ts$/,iI=Bm((e={})=>{const{matcher:t=Bm(r=>r.exports.length>0&&nI.test(r.fileName)&&r.isEntry,"matcher")}=e;return{name:"packem:fix-dts-default-cjs-exports-plugin",renderChunk(r,n){return t(n)?tI(r,{fileName:n.fileName,imports:n.imports},{warn:this.warn}):void 0}}},"fixDtsDefaultCjsExportsPlugin");var oI=Object.defineProperty,sI=v((e,t)=>oI(e,"name",{value:t,configurable:!0}),"r$4");const cl=sI((e,t={},r={})=>({...t,...e,values:e.values?{...e.values}:{...r}}),"cloneReplaceOptions");var aI=Object.defineProperty,lI=v((e,t)=>aI(e,"name",{value:t,configurable:!0}),"n$8");const zi=lI(e=>!!e?.endsWith(".d"),"isDeclarationOnlyName");var cI=Object.defineProperty,je=v((e,t)=>cI(e,"name",{value:t,configurable:!0}),"i$6");const Me=je(e=>e.logger,"getLogger"),uI=/Circular dependency:[\s\S]*node_modules/,pI=/\.mts$/,fI=/\.(?:m|c)?(?:j|t)sx?$/,dI=/^['|"](use (\w+))['|"]$/,mI=/\.(?:[cm]?jsx?|[cm]?tsx?|json)$/,hI=je(e=>e instanceof RegExp?e.source:e,"regExpOrStringToString"),gI=je(e=>{if(typeof e=="boolean")return String(e);const t=[];for(const r of e)t.push(hI(r));return t.toSorted((r,n)=>r.localeCompare(n)).join(",")},"computeDtsResolveKey"),Lm=je((e,t)=>t?r=>{if(!zi(r.name))return`${r.name}.${e()}`}:r=>{if(!zi(r.name))return Oi(r,e())},"createChunkFileNames"),Wm=je((e,t)=>t?r=>{const{name:n}=r;if(!zi(n))return`${n??"[name]"}.${e(r)}`}:r=>{const{name:n}=r;if(!zi(n))return jx(r,e(r))},"createEntryFileNames"),Wy=je(e=>{const t=`node${ls.node.split(".")[0]}`;if(!e.pkg.engines?.node)return t;const r=xt.minVersion(e.pkg.engines.node);return r?`node${String(r.major)}`:t},"resolveNodeTarget"),Fy=je((e,t,r)=>{if(t){const n=bx(t);return e.options.runtime==="node"?[...new Set([r,...n])]:e.options.runtime==="browser"?[...new Set([...gf(e.options.browserTargets??[]),...n])]:n}return e.options.runtime==="node"?[r]:gf(e.options.browserTargets??[])},"resolveTransformerTarget"),vI=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=Fy(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"),bI=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"),Hy=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=Fy(e,e.options.rollup.oxc.target,t),e.options.rollup.oxc},"getOxcTransformerConfig"),yI=je((e,t,r)=>{if(r)return"js";if(t.facadeModuleId?.endsWith(".mts")){const n=t.facadeModuleId.replace(pI,".cts");if(Ou(n))return"mjs"}return!e.options.emitCJS&&e.options.emitESM&&e.pkg.main?.endsWith(".cjs")?"mjs":gt(e,"esm")},"resolveEsmEntryExtension"),$I=je((e,t)=>{const r=Wy(t);if(e==="esbuild")return vI(t,r);if(e==="swc")return bI(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 Hy(t,r);throw new Error("A Unknown transformer was provided")},"getTransformerConfig"),qy=je(e=>{if(e.options.rollup.resolve&&!e.options.experimental?.oxcResolve)return nx({...e.options.rollup.resolve});if(e.options.experimental?.oxcResolve&&e.options.rollup.experimental?.resolve)return rx(e.options.rollup.experimental.resolve,e.options.rootDir,Me(e),e.tsconfig?.path)},"createNodeResolver"),zy=je((e,t)=>{if(e.code==="CIRCULAR_DEPENDENCY"&&uI.test(e.message))return!0;if(e.code==="UNRESOLVED_IMPORT"){const r=new Error(`Failed to resolve the module "${e.exporter??""}" imported by "${Re(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"),xI=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"),wI=je(e=>e.stack?`${e.message}
|
|
165
|
-
${e.stack}`:e.message,"formatRollupLog"),EI=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"),SI=je((e,t,r,n)=>{if(t==="dts"&&n.code==="EMPTY_BUNDLE")return;const i=wI(n);EI(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"),Gy=je((e,t)=>({input:xI(e),logLevel:e.options.debug?"debug":"info",onLog:je((r,n)=>{SI(e,t,r,n)},"onLog"),onwarn(r,n){zy(r,e)||r.code||n(r)},preserveEntrySignatures:"strict",treeshake:{moduleSideEffects:!0,preset:"smallest"},watch:e.mode==="watch"?e.options.rollup.watch:!1}),"baseRollupOptions"),kI=je((e,t,r,n)=>{const i={...e.options.rollup.alias,entries:t};return!r&&n&&(i.customResolver=n),Wh(i)},"buildAliasPlugin"),jI=je(e=>{if(!e.options.rollup.pure)return{pureNewExpressionPluginInstance:void 0,purePluginInstance:void 0};const t=ix({...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:ox({constructors:["Proxy","WeakMap","WeakSet","WeakRef",...e.options.rollup.pure.functions?.filter(r=>typeof r=="string"&&!r.includes("."))??[]],sourcemap:e.options.sourcemap}),purePluginInstance:t}},"buildPurePlugins"),AI=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"),OI=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"),RI=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"),_I=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 AI(e,n,r),OI(e,n,r),r.length===0&&!t?!1:RI([...r,...t??[]])},"computeDtsResolve"),PI=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"),CI=ju(PI),Uy=je(async(e,t)=>{const r=Ja(e.pkg,e.options),n=_I(e),i=qy(e),o=gI(n),s=e.options.entries.map(p=>p.name??"").filter(p=>p!=="").toSorted((p,f)=>p.localeCompare(f)).join(","),a=`dts-plugin:${String(process.pid)}${e.tsconfig?.path??""}:${o}:${s}`,[l,c,u]=Uh(e.options.rollup.plugins,"dts");return{...Gy(e,"dts"),onwarn(p,f){zy(p,e)||p.code!=="EMPTY_BUNDLE"&&p.code!=="CIRCULAR_DEPENDENCY"&&f(p)},output:[e.options.emitCJS&&{chunkFileNames:je(p=>Oi(p,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(p=>Oi(p,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(p=>Oi(p,"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:[Fh(),Ye(kb(),t),Ye(By(),t),qb(e,{dtsResolve:n,forTypes:!0,skipUnlistedWarnings:!0}),{load(p){if(!mI.test(p))return""},name:"packem:ignore-files"},e.tsconfig&&Ye(Dy(e.options.rootDir,Me(e),e.tsconfig),t),e.tsconfig&&e.options.rollup.tsconfigPaths&&Ye(Iy(e.options.rootDir,e.tsconfig,Me(e),e.options.rollup.tsconfigPaths),t),Vb(e),e.options.rollup.replace&&Hh(cl(e.options.rollup.replace,{sourcemap:e.options.sourcemap})),e.options.rollup.alias&&Wh({customResolver:i,...e.options.rollup.alias,entries:r}),...l,i,...c,...await CI(a)(e,n),e.options.emitCJS&&iI(),e.options.cjsInterop&&e.options.emitCJS&&ng({...e.options.rollup.cjsInterop,logger:Me(e)}),e.options.rollup.patchTypes&&Ye(p7(e.options.rollup.patchTypes,Me(e)),t),X8(),...u,e.options.rollup.license!==!1&&e.options.rollup.license?.path&&typeof e.options.rollup.license.dtsTemplate=="function"&&Ub({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 TI=Object.defineProperty,Ky=v((e,t)=>TI(e,"name",{value:t,configurable:!0}),"n$7");const Jy=Ky(async(e,t,r)=>{const n=Ja(e.pkg,e.options),i=r==="rolldown",o=i?void 0:qy(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:VC(e.dependencyGraphMap,e.buildEntries,!i&&!!e.options.rollup.preserveDirectives),preserveModules:!1},[c,u,p]=Uh(e.options.rollup.plugins,"build"),f=e.tsconfig?.config.compilerOptions?.esModuleInterop,{pureNewExpressionPluginInstance:d,purePluginInstance:m}=jI(e);return{...Gy(e,"build"),output:[e.options.emitCJS&&{assetFileNames:"[name]-[hash][extname]",chunkFileNames:Lm(()=>gt(e,"cjs"),a),compact:e.options.minify,dir:ve(e.options.rootDir,e.options.outDir),entryFileNames:Wm(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:Lm(()=>gt(e,"esm"),a),compact:e.options.minify,dir:ve(e.options.rootDir,e.options.outDir),entryFileNames:Wm(g=>yI(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&&Fh(),_9(),Ye(kb(),t),qb(e),By(),e.tsconfig&&Ye(Dy(e.options.rootDir,Me(e),e.tsconfig),t),e.tsconfig&&e.options.rollup.tsconfigPaths&&Ye(Iy(e.options.rootDir,e.tsconfig,Me(e),e.options.rollup.tsconfigPaths),t),Vb(e),e.options.rollup.replace&&Hh(cl(e.options.rollup.replace,{sourcemap:e.options.sourcemap})),e.options.rollup.alias&&kI(e,n,i,o),...c,o,e.options.rollup.nativeModules&&u8(e.options.rollup.nativeModules),e.options.rollup.dataUri&&HT({...e.options.rollup.dataUri}),e.options.rollup.polyfillNode&&sx({sourceMap:e.options.sourcemap,...e.options.rollup.polyfillNode}),!i&&e.options.rollup.json&&Zx({...e.options.rollup.json}),e.options.rollup.debarrel&&m3(e.options.rollup.debarrel,Me(e)),!i&&ax(),e.options.rollup.wasm&&lx(e.options.rollup.wasm),e.options.rollup.url&&GN(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(v8(e.options.rollup.raw),t),e.options.sourcemap&&BN(e.options.rollup.sourcemap),...u,e.options.rollup.minifyHTMLLiterals&&e.options.minify&&n8({...e.options.rollup.minifyHTMLLiterals,logger:Me(e)}),e.options.rollup.requireCJS&&e.options.emitESM&&Ye(M8({...e.options.rollup.requireCJS,cwd:e.options.rootDir},Me(e)),t),e.options.rollup.babel&&Ye(wT({include:e.options.rollup.babel.include??fI,...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&&Y3(Me(e),e.options.rootDir,e.options.rollup.detectDuplicated),!i&&e.options.transformer&&Ye(e.options.transformer($I(e.options.transformerName,e)),t),!i&&e.options.rollup.preserveDirectives&&cx({directiveRegex:dI,...e.options.rollup.preserveDirectives,logger:Me(e)}),e.options.rollup.shebang&&V8(e.options.entries.filter(g=>g.executable).map(g=>g.name).filter(Boolean),e.options.rollup.shebang),!i&&e.options.cjsInterop&&e.options.emitCJS&&ng({...e.options.rollup.cjsInterop,logger:Me(e)}),e.options.rollup.dynamicVars&&fC(),!i&&e.options.rollup.dynamicVars&&ux(e.options.rollup.dynamicVars),!i&&e.options.rollup.commonjs&&Ye(px({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&&a9(e.pkg,e.options.rollup.shim),!i&&e.options.rollup.jsxRemoveAttributes&&Ye(fx({attributes:e.options.rollup.jsxRemoveAttributes.attributes,logger:Me(e)}),t),...p,e.options.rollup.metafile&&yC(),e.options.rollup.copy&&RT(e.options.rollup.copy,Me(e)),e.options.rollup.license!==!1&&e.options.rollup.license?.path&&typeof e.options.rollup.license.dependenciesTemplate=="function"&&Ub({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&&dx({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"),Vy=Ky((e,t)=>Jy(e,t,"rollup"),"getRollupOptions");var NI=Object.defineProperty,Xy=v((e,t)=>NI(e,"name",{value:t,configurable:!0}),"i$5");const II=Xy(e=>{if(!e.options.rollup.oxc)return{};const t=Hy(e,Wy(e));return{jsx:t.jsx,target:t.target,typescript:t.typescript}},"getRolldownTransformOptions"),MI=Xy(async(e,t)=>{const r=await Jy(e,t,"rolldown");return r.transform=II(e),e.options.minify&&Array.isArray(r.output)&&(r.output=r.output.map(n=>({...n,minify:!0}))),r},"getRolldownOptions");var DI=Object.defineProperty,BI=v((e,t)=>DI(e,"name",{value:t,configurable:!0}),"u$9");const Yy=BI((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 LI=Object.defineProperty,ul=v((e,t)=>LI(e,"name",{value:t,configurable:!0}),"l$9");const nf=ul(async(e,t)=>{try{return t(await e())}catch{return}},"tryImport"),Qy="Rollup is not installed. Please install 'rollup' to use bundler: 'rollup' or DTS generation with the rollup driver.",of=ul(async()=>{const e=await nf(()=>import("rollup"),t=>t.rollup);if(!e)throw new Error(Qy);return e},"getRollupBuild"),WI=ul(async()=>{const e=await nf(()=>import("rollup"),t=>t.watch);if(!e)throw new Error(Qy);return e},"getRollupWatch");ul(async()=>nf(()=>import("rollup"),e=>e.VERSION),"getRollupVersion");var FI=Object.defineProperty,pl=v((e,t)=>FI(e,"name",{value:t,configurable:!0}),"p$6");const Fm="rollup-build.json",dn="dependencies-cache.json",Zy=pl(e=>e??"rollup","resolveBundlerName"),HI={".css":"js",".less":"js",".pcss":"js",".sass":"js",".scss":"js",".styl":"js",".stylus":"js"},qI=pl(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(Fm,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 of())(s);try{o&&t.set(Fm,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);Yy(u,e,l)}e.buildEntries.push(...l.values())}finally{await a.close()}},"buildWithRollup"),zI=pl(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 Eb(),o={...n,moduleTypes:{...HI,...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);Yy(c,e,a)}e.buildEntries.push(...a.values())}finally{await s.close?.()}},"buildWithRolldown"),GI=pl(async(e,t,r,n)=>{const i=n==="rolldown",o=i?await MI(e,t):await Vy(e,t);await e.hooks.callHook("rollup:options",e,o),Object.keys(o.input??{}).length!==0&&(await(i?zI(e,t,r,o):qI(e,t,r,o)),await t.flush())},"build");var UI=Object.defineProperty,_o=v((e,t)=>UI(e,"name",{value:t,configurable:!0}),"i$4");const Hm=_o(async e=>{try{return await(e==="rolldown"?Eb():of()),!0}catch{return!1}},"isBundlerAvailable"),qm=_o((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"),e$=_o(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 e0({initialValue:!0,message:t});if(t0(o)||!o){const a=await yd(e,r);throw new Error(`Cannot continue without ${e}. Run: ${a}`)}const s=r0();s.start(`Installing ${e}`);try{await Ch([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"),zm=_o(async(e,t,r)=>{await Hm(e)||await e$(e,`${e} is required as the bundler but is not installed. Install it now?`,t,r,()=>Hm(e))},"ensureBundlerInstalled"),KI=_o(async(e,t,r)=>{const n=s_[e];qm(n,t)||await e$(n,`${n} is required for transformer: "${e}" but is not installed. Install it now?`,t,r,()=>Promise.resolve(qm(n,t)))},"ensureTransformerInstalled");var JI=Object.defineProperty,VI=v((e,t)=>JI(e,"name",{value:t,configurable:!0}),"e$2");const fl=VI(e=>{const t=le(e,"package.json");if(!Ft(t))throw new Error(`package.json not found at ${t}`);const r=e_(t,{resolveCatalogs:!0});return r.publishConfig&&Object.assign(r,r.publishConfig),{packageJson:r,packageJsonPath:t}},"loadPackageJson");var XI=Object.defineProperty,YI=v((e,t)=>XI(e,"name",{value:t,configurable:!0}),"f$7");const QI=YI(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:n0(o),path:o},r.info("Using tsconfig settings at",o)}else if(eb(t,["typescript"]))try{i=await i0(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,Pt=v((e,t)=>ZI(e,"name",{value:t,configurable:!0}),"s$9");const eM=/^\.\.?\//,tM=Pt((e,t)=>{if(e.executable&&(e.cjs===void 0||e.esm===void 0)){t.pkg.type==="commonjs"&&e.cjs===void 0&&t.options.emitCJS!==void 0?(e.cjs=t.options.emitCJS,e.esm=!1):t.pkg.type==="module"&&e.esm===void 0&&t.options.emitESM!==void 0&&(e.esm=t.options.emitESM,e.cjs=!1);return}e.cjs!==void 0||e.esm!==void 0||e.declaration||(t.options.emitCJS!==void 0&&(e.cjs=t.options.emitCJS),t.options.emitESM!==void 0&&(e.esm=t.options.emitESM))},"applyFormatFlags"),Gm=Pt((e,t)=>{if(typeof e.name!="string"){let r=Ui(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(Au,"")}if(!e.input)throw new Error(`Missing entry input: ${JSON.stringify(e)}`);Nh(e.input)&&(e.input=ve(t.options.rootDir,e.input)),t.options.declaration&&e.declaration===void 0&&(e.declaration=t.options.declaration),tM(e,t),e.outDir=ve(t.options.rootDir,e.outDir??t.options.outDir)},"extendEntry"),rM=Pt(e=>{e.options.entries=e.options.entries.map(t=>typeof t=="string"?{input:t,isGlob:Yc(t)}:{...t,exportKey:t.exportKey??new Set,isGlob:Yc(t.input)})},"normalizeEntries"),nM=Pt(e=>{const t=["**/.git/**","**/node_modules/**","**/test-results/**"],{watch:r}=e.options.rollup;if(r){if(typeof r.exclude=="string")t.push(r.exclude);else if(Array.isArray(r.exclude))for(const n of r.exclude)typeof n=="string"&&t.push(n)}return t},"collectGlobIgnorePatterns"),iM=Pt(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:nM(e),onlyFiles:!0});if(n.length===0)throw new vp(`No files found in the glob pattern: ${Re(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"),oM=Pt(e=>{for(const t of e)if(t==="node"||t==="workerd"||t.includes("node")||t.includes("workerd"))return!0;return!1},"hasNodeLikeExportKey"),sM=Pt(e=>e.includes(".server")||e.includes(".node")||e.includes(".workerd"),"fileAliasIndicatesNode"),aM=Pt(e=>{const t=e.exportKey&&[...e.exportKey].some(n=>n.includes("browser")||n==="browser"),r=e.fileAlias?.includes(".browser")??!1;if(t||r)return"browser";if(e.exportKey&&oM(e.exportKey)||e.fileAlias&&sM(e.fileAlias))return"node"},"resolveEntryRuntime"),lM=Pt(e=>{for(const t of e.options.entries){if(t.runtime)continue;const r=aM(t);r&&(t.runtime=r)}},"detectEntryRuntimes"),cM=Pt(e=>{for(const t of e.options.entries)if(t.fileAlias){let r=t.fileAlias;for(;r.startsWith("./")||r.startsWith("../");)r=r.replace(eM,"");t.name=r}},"applyFileAliasNames"),t$=Pt(e=>{rM(e),iM(e),lM(e),cM(e);for(const t of e.options.entries.filter(r=>!r.fileAlias))Gm(t,e);for(const t of e.options.entries.filter(r=>r.fileAlias))Gm(t,e),t.fileAlias=void 0},"prepareEntries");var uM=Object.defineProperty,Wn=v((e,t)=>uM(e,"name",{value:t,configurable:!0}),"d$7");const pM=/^[_$a-z\u00A0-\uFFFF][\w$\u00A0-\uFFFF]*$/iu,fM=Wn((e,t)=>{const r=e.options.jiti.transformOptions?.babel?.plugins;return JSON.stringify({...e.options.jiti,alias:{...Ja(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"),dM=Wn(e=>e.filter(t=>t!=="default").map((t,r)=>{if(pM.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"),r$=Wn((e,t,r)=>{Su(e,`export * from "${t}";
|
|
167
|
-
${r?`export { default } from "${t}";`:""}`)},"writeDtsStub"),mM=Wn(async(e,t,r,n,i,o,s,a,l,c)=>{const u=t(Ce(r),await tg("jiti",{conditions:["node","import"],url:import.meta.url})),p=Tt(e,"esm"),f=`${i}.${p}`;Su(`${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;"]:[],...dM(l)].join(`
|
|
168
|
-
`)),e.options.declaration&&r$(`${r}.${p}`,f,c)},"buildEsmStub"),hM=Wn(async(e,t,r,n,i,o,s,a,l)=>{const c=t(Ce(r),await tg("jiti",{conditions:["node","require"],url:import.meta.url})),u=Tt(e,"cjs"),p=`${i}.${u}`;Su(`${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&&r$(`${r}.${u}`,p,l)},"buildCjsStub"),gM=Wn(async e=>{const t=[],r=fM(e,t);for(const n of e.options.entries){const i=ve(e.options.rootDir,e.options.outDir,n.name),o=Gx(e.jiti.esmResolve(n.input,{try:!0})??n.input),s=o.replace(Au,""),a=wu(o),l=Y8(a);let c;try{c=await Ux(o,{extensions:Ps})}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)=>Kx(ve(...f)):tt;e.options.emitESM&&await mM(e,p,i,o,s,l,r,t,c,u),e.options.emitCJS&&await hM(e,p,i,o,s,l,r,t,u),l&&(await pu(`${i}.${gt(e,"cjs")}`),await pu(`${i}.${gt(e,"esm")}`))}await e.hooks.callHook("rollup:done",e)},"createStub");var vM=Object.defineProperty,Ct=v((e,t)=>vM(e,"name",{value:t,configurable:!0}),"a$9");const sf=Ct(e=>e.logger,"getLogger"),ks="rollup-watch.json",Um=Ct(({context:e,doOnSuccessCleanup:t,fileCache:r,mode:n,runBuilder:i,runOnsuccess:o,useCache:s,watcher:a})=>{const l=`watcher:${n}`,c=sf(e);a.on("change",async(u,{event:p})=>{await t?.(),c.info({message:`${Re(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"?ks:`dts-${ks}`,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:Re("build started..."),prefix:l});break}case"END":{c.success({message:"Rebuild finished",prefix:l}),await o?.();break}case"ERROR":{qh(u.error),c.error({context:[u.error],message:`Rebuild failed: ${u.error.message}`,prefix:l});break}}})},"watchHandler"),bM=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+=$t(`
|
|
173
|
-
└─ ${tt(process.cwd(),i)}`);sf(e).info(n)},"logInputs"),yM=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"),$M=Ct((e,t)=>{const r=e.options.rollup.watch;return!r||typeof t!="object"||t.include!==void 0?t:yM(e,t,r)},"configureWatchOptions"),xM=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 WI(),g=await Vy(e,t);if(await e.hooks.callHook("rollup:options",e,g),Object.keys(g.input??{}).length===0)return;o&&(g.cache=t.get(ks)),g.watch=$M(e,g.watch);const y=m(g);if(await e.hooks.callHook("rollup:watch",e,y),bM(e,g),Um({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 Uy(e,t);o&&(x.cache=t.get(`dts-${ks}`)),await e.hooks.callHook("rollup:dts:options",e,x);const j=m(x);await e.hooks.callHook("rollup:watch",e,j),Um({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=wp.map(m=>le(e.options.rootDir,m));let p;const f=Ct(async m=>{const g=sf(e);g.info(`${tt(".",m)} changed, restarting watchers...`);try{await a();const{packageJson:y}=fl(e.options.rootDir);e.pkg=y,e.options.entries.length=0,e.buildEntries.length=0,await e.hooks.callHook("build:prepare",e),t$(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");bf(c,()=>{d(c)});for(const m of u)if(Ft(m)){bf(m,()=>{d(m)});break}},"watch");var wM=Object.defineProperty,EM=v((e,t)=>wM(e,"name",{value:t,configurable:!0}),"s$8");const SM=EM(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 R2(n))}},"cleanDistributionDirectories");var kM=Object.defineProperty,jM=v((e,t)=>kM(e,"name",{value:t,configurable:!0}),"o$4");const AM=jM(()=>o0((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 OM=Object.defineProperty,Fo=v((e,t)=>OM(e,"name",{value:t,configurable:!0}),"n$4");const RM=Mt,_M=Fo((e,t)=>{const{sideEffects:r}=t;let n;if(typeof r=="boolean")n=Fo(()=>r,"hasSideEffects");else if(Array.isArray(r))if(r.length<=0)n=Fo(()=>!1,"hasSideEffects");else{const i=r.map(o=>o.includes("/")?o:`**/${o}`);n=RM(i,void 0,{resolve:e})}else n=Fo(()=>{},"hasSideEffects");return n},"getPackageSideEffect");var Tc,Km;function PM(){if(Km)return Tc;Km=1;var e=Object.defineProperty,t=v((l,c)=>e(l,"name",{value:c,configurable:!0}),"s"),r=s0,n=r.spawn,i=r.exec;Tc=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"),Tc}v(PM,"requireTreeKill");var CM=PM();const TM=_s(CM);var NM=Object.defineProperty,n$=v((e,t)=>NM(e,"name",{value:t,configurable:!0}),"l$6");const IM=n$(e=>process.platform==="win32"&&"cmd"in e&&"code"in e&&typeof e.cmd=="string"&&e.cmd.startsWith("taskkill")&&e.code===128,"isTaskKillCmdProcessNotFoundError"),MM=n$(async({pid:e,signal:t})=>{await new Promise((r,n)=>{if(!Number.isInteger(e)||e<=0){n(new Error("Invalid process ID"));return}TM(e,t,i=>{if(i&&!IM(i)){n(i);return}r()})})},"killProcess");var DM=Object.defineProperty,BM=v((e,t)=>DM(e,"name",{value:t,configurable:!0}),"o$2");const Jm=BM((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 LM=Object.defineProperty,i$=v((e,t)=>LM(e,"name",{value:t,configurable:!0}),"t$2");const WM=i$(async(e,t,r,n)=>{try{await Cs(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"),FM=i$(async(e,t,r)=>{if(!e)return;const n=le(e,"keystore.json");if(!await et(n))return;const i=await Tn(n),o=(await Wx(e,{withFileTypes:!0})).filter(a=>a.isDirectory());let s=r;for(const a of o)i[a.name]||(s=await WM(e,a.name,t,s))},"removeOldCacheFolders");var HM=Object.defineProperty,o$=v((e,t)=>HM(e,"name",{value:t,configurable:!0}),"s$5");const Vm=o$((e,t)=>{for(const r of Gc(e??[]))if(typeof r=="string"&&r.startsWith("node")){const n=xt.coerce(r.slice(4));n&&t.push(n.version)}},"collectNodeTargets"),qM=o$(e=>{if(e.options.runtime!=="node"||!e.options.emitCJS)return;const t=[],r=e.pkg.engines?.node,n=r?xt.minVersion(r):void 0;n&&t.push(n.version);const i=e.options.rollup;if(Vm(i.esbuild?.target,t),Vm(i.oxc?.target,t),t.length===0){const o=xt.coerce(ls.node);o&&t.push(o.version)}t.some(o=>xt.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 zM=Object.defineProperty,oe=v((e,t)=>zM(e,"name",{value:t,configurable:!0}),"b$2");const GM=De(import.meta.url),Xr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:tr,af=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 GM(e)},"__cjs_getBuiltinModule"),tr=Xr,{execFileSync:UM}=af("node:child_process"),ji=af("node:fs"),KM=af("node:tty"),lf=[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],cf=[12288,12288,65281,65376,65504,65510],uf=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],pf=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],dl=[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],Po=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"),JM=lf[0],VM=lf.at(-1),XM=cf[0],YM=cf.at(-1),QM=uf[0],ZM=uf.at(-1),e4=pf[0],t4=pf.at(-1),r4=dl[0],n4=dl.at(-1),Xm=19968,[i4,o4]=s$(dl);function s$(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(Xm>=i&&Xm<=o)return[i,o];o-i>r-t&&(t=i,r=o)}return[t,r]}v(s$,"ge$1");oe(s$,"findWideFastPathRange");const s4=oe(e=>e<JM||e>VM?!1:Po(lf,e),"isAmbiguous"),a4=oe(e=>e<XM||e>YM?!1:Po(cf,e),"isFullWidth"),l4=oe(e=>e<QM||e>ZM?!1:Po(uf,e),"isHalfWidth"),c4=oe(e=>e<e4||e>t4?!1:Po(pf,e),"isNarrow"),u4=oe(e=>e>=i4&&e<=o4?!0:e<r4||e>n4?!1:Po(dl,e),"isWide");function a$(e){return s4(e)?"ambiguous":a4(e)?"fullwidth":l4(e)?"halfwidth":c4(e)?"narrow":u4(e)?"wide":"neutral"}v(a$,"Se");oe(a$,"getCategory");function l$(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}v(l$,"Be");oe(l$,"validate");function ff(e){return l$(e),a$(e)}v(ff,"Vt");oe(ff,"eastAsianWidthType");const c$=String.raw,Ym=c$`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,p4=oe(()=>new RegExp(c$`\p{RI}{2}|(?)${Ym}(?:\u200D${Ym})*`,"gu"),"emojiRegex"),Fn=new Set(["\x1B",""]),ml="\x07",u$="[",df="m",js="]8;;",f4=39,d4=/[\u200B\uFEFF\u2060-\u2064]/g,m4=new RegExp(`(?:\\${u$}(?<code>\\d+)m|\\${js}(?<uri>.*)${ml})`),h4=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,Qm=/\u001B\[(\d+(?:;\d+)*)?m[^\u001B]*(?:\u001B\[(?:\d+(?:;\d+)*)?m|$)/g,Zm=/\u001B\]8;[^\u0007\u001B]*(?:\u0007|\u001B\\)(.*?)\u001B\]8;;(?:\u0007|\u001B\\)/g,Ho=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Nc=p4(),eh=new Map,qo=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,ss=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"),g4=oe((e,t)=>{const r=Math.floor(e/65536),n=e%65536;let i=eh.get(r);if(i||(i=new Map,eh.set(r,i)),i.has(n))return i.get(n);let o;if(ss(e)==="latin")o=t.width.regular;else if(ss(e)==="control")o=t.width.control;else if(ss(e)==="wide")o=t.width.wide;else switch(ff(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"),v4=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"),Sn=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?Sn(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=Sn(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(qo.lastIndex=s,qo.test(e)){const y=(qo.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=qo.lastIndex;continue}if((d<=31||d>=127&&d<=159)&&(Ho.lastIndex=s,Ho.test(e))){const y=(Ho.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=Ho.lastIndex;continue}if(Nc.lastIndex=s,Nc.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=Nc.lastIndex;continue}const m=e.codePointAt(s)??0;if(v4(m)){s+=m>65535?2:1;continue}let g;if(o)g=g4(m,r);else switch(ss(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(ff(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={})=>Sn(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");let b4=class{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 th=new b4(100),y4=new Intl.Segmenter("en",{granularity:"grapheme"}),$4=/^[\u0000-\u007F]*$/,x4=new Set(["0","22","23","24","27","28","29","39","49"]),w4=new Set(["1","3","4","7","8","9"]),rh=new Map([["22","1"],["23","3"],["24","4"],["27","7"],["28","8"],["29","9"]]),zo=oe(e=>e>="30"&&e<="37"||e>="90"&&e<="97"||e.startsWith("38;"),"isForegroundColor"),Go=oe(e=>e>="40"&&e<="47"||e>="100"&&e<="107"||e.startsWith("48;"),"isBackgroundColor"),E4=[{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"}],nh=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"),S4=oe((e,t)=>{if(!e.includes("\x1B"))return[{after:"",before:"",content:e,visibleLength:Be(e,t.width)}];const r=th.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(x4.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(zo(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(Go(x)){l.delete(y);break}}}else if(rh.has(g)){const y=rh.get(g);for(const x of l)if(x===`\x1B[${y}m`){l.delete(x);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(Go(g)){for(const y of l)if(y.startsWith("\x1B[")&&y.endsWith("m")){const x=y.slice(2,-1);if(Go(x)){l.delete(y);break}}}else if(w4.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);zo(b)?y=!0:Go(b)&&(x=!0)}if(y&&x){const R=nh(e,["\x1B[3","\x1B[9","\x1B[38;"]),b=nh(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=E4.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 th.set(e,c),c},"processIntoStyledSegments"),k4=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:y4,...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 $4.test(e)?e.slice(t,r):k4(e,t,r,i);if(Qm.lastIndex=0,Zm.lastIndex=0,!Qm.test(e)&&!Zm.test(e))return e;const s=S4(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"),ih="…",j4=3,Uo=oe((e,t,r=!1)=>{if(e.charAt(t)===" ")return t;const n=r?1:-1,i=Math.min(j4,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"),Ko=oe((e,t,r)=>Sn(e,{...r,ellipsis:"",ellipsisWidth:0,limit:t}).index,"widthToIndex"),Jo=oe((e,t,r)=>Be(e.slice(0,t),r),"indexToWidth"),oh=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=ih,position:o="end",preferTruncationOnSpace:s=!1}=r;let a=r.ellipsisWidth??i===ih?1:void 0;a??=Sn(i,{...r.width,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width;const{width:l}=Sn(n,{...r.width,ellipsis:i,ellipsisWidth:a});if(l<=t)return n;switch(o){case"end":{if(s){const c=t-a,u=Ko(n,c,r.width),p=Uo(n,u),f=Jo(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=Ko(n,p,r.width),m=Uo(n,d),g=Jo(n,m,r.width),y=l-f,x=Ko(n,y,r.width),j=Uo(n,x,!0),R=Jo(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=Ko(n,c,r.width),p=Uo(n,u,!0),f=Jo(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"),A4=/\x1B\[(\d+)m/;class p${static{v(this,"Jt")}static{oe(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const r=A4.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 f$=oe((e,t)=>{if(!Fn.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const r=!0,n=e.slice(t+1,t+1+js.length).join("")===js;return{isInsideEscape:r,isInsideLinkEscape:n}},"checkEscapeSequence"),O4=oe((e,t={})=>{const r=new p$;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&&Fn.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=f$(l,c),{isInsideLinkEscape:m}=d;if(m){let g=c+1;for(s="";g<l.length;){const x=l[g];if(x===ml)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===df){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"),sh=oe(e=>`${Fn.values().next().value}${u$}${String(e)}${df}`,"wrapAnsiCode"),ah=oe(e=>`${Fn.values().next().value}${js}${e}${ml}`,"wrapAnsiHyperlink"),R4=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,Fn.has(l)){const u=m4.exec(i.slice(s))?.groups??{};if(u.code!==void 0){const p=Number.parseFloat(u.code);r=p===f4?void 0:p}else u.uri!==void 0&&(n=u.uri.length===0?void 0:u.uri)}const c=h4.get(Number(r));o[a+1]===`
|
|
181
|
-
`?(n&&(t+=ah("")),r&&c&&(t+=sh(c))):l===`
|
|
182
|
-
`&&(r&&c&&(t+=sh(r)),n&&(t+=ah(n))),s+=l.length}return t},"preserveAnsi"),d$=/(?=\s)|(?<=\s)/,m$=/^\s+$/,Ic=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"),h$=oe((e,t,r)=>{if(e.length===0)return[""];if(t<=0)return[e];const n=[],i=new p$;let o="",s=0,a=!1,l=!1,c="",u=0;for(;u<e.length;){const p=e[u];if(Fn.has(p)){a=!0,c=p,o+=p,l=f$([...e],u).isInsideLinkEscape,u+=1;continue}if(a){c+=p,o+=p,l?p===ml&&(a=l=!1):p===df&&(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"),_4=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 O4(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"),P4=oe((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(d$),o=[];let s="",a=0,l=0;for(;l<i.length;){const c=i[l],u=m$.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"),C4=oe((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(d$),o=[];let s="",a=0,l=0;for(;l<i.length;){const c=i[l],u=m$.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(Ic(r?Sr(s):s));const f=h$(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(Ic(r?Sr(s):s)),s="",a=0,r&&u)){l+=1;continue}s+=c,a+=p,l+=1}return s&&o.push(Ic(r?Sr(s):s)),o},"wrapAndBreakWords"),Vo={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},T4=oe((e,t={})=>{const{removeZeroWidthCharacters:r=!0,trim:n=!0,width:i=80,wrapMode:o=Vo.PRESERVE_WORDS}=t;if(n&&e.trim()==="")return"";let s=e.normalize("NFC").replaceAll(`\r
|
|
183
|
-
`,`
|
|
184
|
-
`);return r&&(s=s.replaceAll(d4,"")),s.split(`
|
|
185
|
-
`).map(a=>{if(n&&a.trim()==="")return"";let l;switch(o){case Vo.BREAK_AT_CHARACTERS:{l=_4(a,i,n);break}case Vo.BREAK_WORDS:{l=C4(a,i,n);break}case Vo.STRICT_WIDTH:{l=h$(a,i,n);break}default:l=P4(a,i,n)}return R4(l)}).join(`
|
|
186
|
-
`)},"wordWrap"),g$=80,v$=24,gu=oe((e,t,{shell:r,env:n}={})=>UM(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:r,env:n}).trim(),"exec"),as=oe((e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),"create"),b$=oe((e,t)=>{const{columns:r,rows:n}=as(e,t);if(!(Number.isNaN(r)||Number.isNaN(n))&&!(r===g$&&n===v$))return{columns:r,rows:n}},"createIfNotDefault"),N4=oe(()=>{if(tr.platform!=="linux")return!0;try{const e=ji.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 y$(){const{env:e,stdout:t,stderr:r}=tr;if(t?.columns&&t?.rows)return as(t.columns,t.rows);if(r?.columns&&r?.rows)return as(r.columns,r.rows);if(e.COLUMNS&&e.LINES)return as(e.COLUMNS,e.LINES);const n={columns:g$,rows:v$};return tr.platform==="win32"?Mc()??n:tr.platform==="darwin"?lh()??Mc()??n:lh()??Mc()??I4()??n}v(y$,"Le");oe(y$,"terminalSize");const lh=oe(()=>{try{const e=tr.platform==="darwin"?ji.constants.O_EVTONLY|ji.constants.O_NONBLOCK:ji.constants.O_NONBLOCK,{columns:t,rows:r}=KM.WriteStream(ji.openSync("/dev/tty",e));return{columns:t,rows:r}}catch{}},"devTty"),Mc=oe(()=>{try{const e=gu("tput",["cols"],{env:{TERM:"dumb",...tr.env}}),t=gu("tput",["lines"],{env:{TERM:"dumb",...tr.env}});if(e&&t)return b$(e,t)}catch{}},"tput"),I4=oe(()=>{try{if(!N4())return;const e=gu("resize",["-u"]).match(/\d+/g);if(e.length===2)return b$(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"),M4=oe(e=>({join:e.bodyJoin,left:e.bodyLeft,right:e.bodyRight}),"getVerticalBorderChars"),As=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"),vu=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"),D4=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=vu(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=As(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=As(t,u,f),m=n(p,d).length-1,g=vu(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"),bu="__EMPTY__",ch=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:bu};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=bu;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"),B4=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"),mi=/\r?\n/,uh=/\s+/,Ae=oe((e,t)=>!e||!t?e:typeof t=="function"?t(e):t.open+e+t.close,"applyColor");class hl{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}=y$();i=o}this.#t=i,this.#e.maxWidth&&(this.#e.maxWidth=Math.min(this.#e.maxWidth,this.#t))}addItem(t){return this.#i.push(ch(t)),this}addItems(t){return this.#i.push(...t.map(r=>ch(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=hl.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===bu&&!(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(uh);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(uh);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(mi),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(mi),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(mi);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(mi),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?M4(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=As(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(mi):[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=T4(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=>oh(d,a,f))}else this.#e.truncateOverflow&&(l=l.map(p=>Be(p)>a?oh(p,a,{}):p));const u=l.map(p=>B4(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=As(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=D4(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=vu(t,r,n,i);return this.#r.set(i,s),s}}oe(e=>new hl(e),"createGrid");const L4={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}},W4={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 F4=Object.defineProperty,mf=v((e,t)=>F4(e,"name",{value:t,configurable:!0}),"y$1");const H4=mf(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 q4=class{static{v(this,"v")}static{mf(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:L4,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,H4(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 hl(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 z4=mf(e=>new q4(e),"createTable");var G4=Object.defineProperty,At=v((e,t)=>G4(e,"name",{value:t,configurable:!0}),"c$a");const U4=At(e=>e.logger,"getLogger"),K4=/\{\s*"name"/,J4=l0(a0.exec);let $$=class extends Error{static{v(this,"D")}static{At(this,"AttwReportedError")}};function x$(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(x$,"te$1");At(x$,"memo");const V4={bundler:"bundler",node10:"node10","node16-cjs":"node16 (from CJS)","node16-esm":"node16 (from ESM)"},X4={"":"",1:"(CJS)",99:"(ESM)"},ph={CJSOnlyExportsDefault:Qo,CJSResolvesToESM:Qr,FallbackCondition:Qr,FalseCJS:zr,FalseESM:zr,FalseExportDefault:Qo,InternalResolutionError:zr,MissingExportEquals:Qo,NamedExports:Qr,NoResolution:zr,UnexpectedModuleSyntax:zr,UntypedResolution:Qr},Y4={esmOnly:["node10","node16-cjs"],node16:["node10"],strict:[]},Q4=At(e=>{if(e.startsWith("{"))return e;const t=K4.exec(e)?.index;if(t!==void 0)return e.slice(t);const r=e.indexOf("{");return r!==-1?e.slice(r):e},"fixPnpmStdout"),Z4=At(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"),eD=At(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"),tD=At((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=x$((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+ph[q](c[q].shortDescription)).join(`
|
|
191
|
-
`);const C="OK (JSON)",B=e.programInfo[o(E)].moduleKinds?.[O?.fileName??""]?.detectedKind??"",J=_.isWildcard?"(wildcard)":`OK ${X4[B]}`;return h+(O?.isJson?C:J)}),x=z4({style:{border:W4}});x.setHeaders(["",...f.map(b=>V4[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) "}${ph[b](_)}`});return`Are the types wrong problems found:
|
|
192
|
-
|
|
193
|
-
${x.toString()}
|
|
194
|
-
|
|
195
|
-
${R.join(`
|
|
196
|
-
|
|
197
|
-
`)}`},"buildProblemMessage"),rD=At(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 J4(`${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"),nD=At((e,t,r,n,i,o)=>{if(t.types!==!1&&t.problems.length>0){const s=tD(t,r,o);if(n==="error")throw e.error({message:s,prefix:"attw"}),new $$("attw reported types problems; see the log above.");e.warn({message:s,prefix:"attw"});return}e.success({message:Eu(`No Are the types wrong problems found ${Ph`(${Math.round(performance.now()-i).toString()}ms)`}`),prefix:"attw"})},"reportAnalysis"),iD=At(async(e,t)=>{if(!e.options?.validation)return;const{validation:r}=e.options;if(!r.attw)return;const n=U4(e),{packageJson:i}=fl(e.options.rootDir);e.pkg=i,t&&n.raw(`
|
|
198
|
-
`),await t_(e.pkg,["@arethetypeswrong/core","package-manager-detector"],"devDependencies",{logger:{warn:At(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 Qh(le(Jh(),"packem-attw-"));let p;try{p=await import("@arethetypeswrong/core")}catch{n.error({message:`ATTW check requires ${Qo`@arethetypeswrong/core`} to be installed.`,prefix:"attw"});return}const f=await eD(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 rD(f,u,e.options.rootDir),E=await ps(b),h=p.createPackageFromTarballData(new Uint8Array(E)),A=await p.checkPackage(h,l),_=Y4[a];nD(n,A,_,o,c,{allResolutionKinds:d,filterProblems:y,getResolutionOption:m,groupProblemsByKind:g,problemAffectsEntrypoint:x,problemAffectsResolutionKind:j,problemKindInfo:R})}catch(b){throw b instanceof $$||n.error({message:`ATTW check failed: ${b instanceof Error?b.message:String(b)}`,prefix:"attw"}),b}finally{await Cs(u,{force:!0,recursive:!0}).catch(()=>{})}},"attw");var oD=Object.defineProperty,w$=v((e,t)=>oD(e,"name",{value:t,configurable:!0}),"d$5");const fh=w$(e=>Array.from(e,t=>Qr(t)).join(", "),"joinWarnings"),sD=w$(e=>{if(e.hoistedDependencies.size>0){const o=`These dependencies are shamefully hoisted: ${fh(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: ${fh(t)}`;be(e,o)}},"validateDependencies");var aD=Object.defineProperty,lD=v((e,t)=>aD(e,"name",{value:t,configurable:!0}),"o$1");const dh=">=18.0.0",cD=lD(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": "${dh}" } to specify Node.js version requirements.`);return}if(!xt.validRange(i)){be(e,`Invalid Node.js version range "${i}" in engines.node field. Please use a valid semver range like "${dh}".`);return}if(!xt.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 uD=Object.defineProperty,E$=v((e,t)=>uD(e,"name",{value:t,configurable:!0}),"i$2");const pD=E$((e,t)=>u0(e,t)<=e.length/3||t.includes(e),"isSimilar"),fD=E$((e,t)=>{const r=e.toLowerCase();return t.filter(n=>pD(n.toLowerCase(),r))},"findAlternatives");var dD=Object.defineProperty,Gi=v((e,t)=>dD(e,"name",{value:t,configurable:!0}),"r$2");const mD=/\/[^*/]*\*[^\n\r/\u2028\u2029]*(?:[\n\r\u2028\u2029][^*/]*\*[^\n\r/\u2028\u2029]*)*(?:\/.*)?$/,hD=Gi((e,t)=>{const{options:r}=e;return Ep(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"),gD=Gi((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"),vD=Gi((e,t)=>{let r="Potential missing or wrong package.json files:";for(const n of e){const i=fD(n,t);r+=`
|
|
199
|
-
- ${Re(n)}${i.length>0?F$` (did you mean ${i.map(o=>`"${o}"`).join(", ")}?)`:""}`}return r},"buildMissingOutputsMessage"),bD=Gi(e=>{const{options:t}=e,r=t.validation,{packageJson:n}=r;if(!n?.exports)return;const i=gD(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,...hD(e,o)].filter(Boolean).map(u=>u&&ve(t.rootDir,u.replace(mD,"")))),a=[];for(const u of s)u&&!u.includes("*")&&!Ou(u)&&a.push(u.replace(`${t.rootDir}/`,""));const l=Gi(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=vD(a,c);be(e,u)}},"validatePackageEntries");var yD=Object.defineProperty,ut=v((e,t)=>yD(e,"name",{value:t,configurable:!0}),"u$1");const $D=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=[...$x,...m];if(Yc(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.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"),xD=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"),wD=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"),ED=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"),SD=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&&ED(e)},"validateEsmModuleFields"),kD=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"),jD=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"),AD=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};xD(o);const s=r.type==="commonjs"||r.type===void 0,a=r.type==="module";s?wD(o):a&&SD(o),r.exports!==void 0&&$D(e,r.exports),kD(o,s),jD(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 OD=Object.defineProperty,RD=v((e,t)=>OD(e,"name",{value:t,configurable:!0}),"o");const _D=RD(e=>{const{packageJson:t}=fl(e.options.rootDir);e.pkg=t,sD(e),cD(e),AD(e),bD(e)},"validator");var PD=Object.defineProperty,S$=v((e,t)=>PD(e,"name",{value:t,configurable:!0}),"n$3");const CD=/^[^a-z_@#~]|[^\w/@#~-]|@\/|#\/|~\//i,TD=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"]),ND=S$((e,t)=>{if(e.trim()==="")throw new Error(`Alias name "${e}" is invalid. Alias names should be non-empty strings.`);if(CD.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(TD.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"),mh=S$(e=>{if(Array.isArray(e))return;const t=e;for(const[r,n]of Object.entries(t))ND(r,n)},"validateAliasEntries");var Dc={},Bc,hh;function gl(){if(hh)return Bc;hh=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 Bc={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}},Bc}v(gl,"requireConstants");var gh;function vl(){return gh||(gh=1,(function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:r,REGEX_SPECIAL_CHARS:n,REGEX_SPECIAL_CHARS_GLOBAL:i}=gl();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}})(Dc)),Dc}v(vl,"requireUtils");var Lc,vh;function ID(){if(vh)return Lc;vh=1;var e=Object.defineProperty,t=v((E,h)=>e(E,"name",{value:h,configurable:!0}),"k");const r=vl(),{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}=gl(),j=t(E=>E===c||E===o,"isPathSeparator"),R=t(E=>{E.isPrefix!==!0&&(E.depth=E.isGlobstar?1/0:1)},"depth");return Lc=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"),Lc}v(ID,"requireScan");var Wc,bh;function MD(){if(bh)return Wc;bh=1;var e=Object.defineProperty,t=v((b,E)=>e(b,"name",{value:E,configurable:!0}),"y");const r=gl(),n=vl(),{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"),Pe=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"),zn=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:""}),Pe("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}),Pe("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){zn(ge.pop());continue}H({type:"paren",value:S,output:$.parens?")":"\\)"}),Pe("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}Pe("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}),Pe("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,"["),Pe("brackets")}for(;$.parens>0;){if(h.strictBrackets===!0)throw new SyntaxError(u("closing",")"));$.output=n.escapeLast($.output,"("),Pe("parens")}for(;$.braces>0;){if(h.strictBrackets===!0)throw new SyntaxError(u("closing","}"));$.output=n.escapeLast($.output,"{"),Pe("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},Wc=R,Wc}v(MD,"requireParse");var Fc,yh;function DD(){if(yh)return Fc;yh=1;var e=Object.defineProperty,t=v((l,c)=>e(l,"name",{value:c,configurable:!0}),"h");const r=ID(),n=MD(),i=vl(),o=gl(),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,Fc=a,Fc}v(DD,"requirePicomatch$1");var Hc,$h;function BD(){if($h)return Hc;$h=1;var e=Object.defineProperty,t=v((o,s)=>e(o,"name",{value:s,configurable:!0}),"c");const r=DD(),n=vl();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),Hc=i,Hc}v(BD,"requirePicomatch");var LD=BD();const WD=_s(LD);var FD=Object.defineProperty,Hn=v((e,t)=>FD(e,"name",{value:t,configurable:!0}),"m$2");const HD=Hn(e=>e.logger,"getLogger"),yu="Validation: File Size",k$=Hn(e=>typeof e=="string"?LP(e):e,"resolveLimit"),j$=Hn((e,t,r,n,i)=>{if(r){i&&e.raw(`
|
|
200
|
-
`),e.warn({message:t,prefix:"validation:file-size"});return}be(n,t)},"emitMessage"),qD=Hn((e,t,r,n,i)=>{for(const[o,s]of Object.entries(r)){const a=k$(s);if(!Number.isFinite(a)||a<=0){t.debug({message:`Invalid limit for ${o}: ${String(s)}`,prefix:yu});continue}const l=e.buildEntries.find(c=>{const u=o.replace(new RegExp(`^.?/?${e.options.outDir}/?`),"");return c.path.endsWith(u)||WD(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:yu});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})})`;j$(t,c,n,e,i)}}},"checkPerFileLimits"),zD=Hn((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=k$(r);if(!Number.isFinite(s)||s<=0){t.debug({message:`Invalid total limit: ${String(r)}`,prefix:yu});return}if(o>s){const a=`Total file size exceeds the limit: ${Qe(o)} / ${Qe(s,{decimals:2})}`;j$(t,a,n,e,i)}},"checkTotalLimit"),GD=Hn((e,t)=>{const r=e.options.validation,{allowFail:n=!1,limit:i,limits:o={}}=r.bundleLimit??{},s=HD(e);qD(e,s,o,n,t),i&&zD(e,s,i,n,t&&Object.keys(o).length===0)},"validateBundleSize");var UD=Object.defineProperty,_i=v((e,t)=>UD(e,"name",{value:t,configurable:!0}),"r$1");const xh="rollup-dts.json",KD=_i(e=>e.logger,"getLogger"),wh="__packem_skip__/",Eh=_i((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"),JD=_i(async(e,t,r)=>{const n=await Uy(e,t);if(await e.hooks.callHook("rollup:dts:options",e,n),Object.keys(n.input??{}).length===0)return;n.cache=t.get(xh,r);const i=await(await of())(n);try{t.set(xh,i.cache,r),await e.hooks.callHook("rollup:dts:build",e,i),KD(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 Eh(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(wh)&&delete u[p]},name:"packem:filter-skip-chunks"};for(const c of s)await i.write({chunkFileNames:_i(u=>Oi(u,c),"chunkFileNames"),dir:a,entryFileNames:_i(u=>{const p=u.name.endsWith(".d")?u.name.slice(0,-2):u.name,f=p?o.get(p):void 0;return f&&!Eh(f,e).has(c)?`${wh}[name].${c}`:`[name].${c}`},"entryFileNames"),plugins:[l]});await e.hooks.callHook("rollup:dts:done",e)}finally{await i.close(),await t.flush()}},"buildTypes");var VD=jo();const A$=_s(VD);var XD=Object.defineProperty,$u=v((e,t)=>XD(e,"name",{value:t,configurable:!0}),"n$2");const YD=c0("packem:exe"),QD=/(?:^|,)packem:exe(?:,|$)/,ZD=$u(()=>{const e=process.env.NODE_DEBUG;return e?QD.test(e):!1},"isEnabled"),O$=$u(()=>{const e=$u(((t,...r)=>{YD(t,...r)}),"debug");return Object.defineProperty(e,"enabled",{get:ZD}),e},"createDebug");var e6=Object.defineProperty,R$=v((e,t)=>e6(e,"name",{value:t,configurable:!0}),"c$5");const t6=R$(()=>{const e=Nx();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"),r6=R$(e=>{const t=t6(),r=e.platform==="win"?"node.exe":"node";return le(t,"node",`v${e.nodeVersion}`,`${e.platform}-${e.arch}`,r)},"getCachedBinaryPath");var n6=Lh();const i6=_s(n6);var o6=Object.defineProperty,Co=v((e,t)=>o6(e,"name",{value:t,configurable:!0}),"s$1");const _$=Co(e=>e==="win"?"zip":e==="linux"?"tar.xz":"tar.gz","getArchiveExtension"),s6=Co(e=>{const{arch:t,nodeVersion:r,platform:n}=e,i=_$(n);return`https://nodejs.org/dist/v${r}/node-v${r}-${n}-${t}.${i}`},"getDownloadUrl"),a6=Co(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"),Sh="https://nodejs.org/dist/index.json",l6=/^v/,c6=Co(async e=>{let t=e;if(t==="latest"||t==="latest-lts"){const n=await fetch(Sh);if(!n.ok)throw new Error(`Failed to fetch Node.js releases: HTTP ${String(n.status)} from ${Sh}`);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(l6,"")}const r=i6(t);if(!r)throw new Error(`Invalid Node.js version: ${t}. Please provide a valid version string (e.g., "25.7.0").`);if(!A$(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"),u6=Co(e=>`-${e.platform}-${e.arch}`,"getTargetSuffix");var p6=Object.defineProperty,P$=v((e,t)=>p6(e,"name",{value:t,configurable:!0}),"d$1");const dr=O$(),f6=P$(async(e,t,r)=>{const n=a6(r),i=Ce(t);if(dr("Extracting %s from archive to %s",n,i),r.platform==="win")await us("tar",["-xf",e,"-C",i,"--strip-components=1",n],{nodeOptions:{stdio:"inherit"},throwOnError:!0});else{const a=e.endsWith(".tar.xz")?"J":"z";await us("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 Fx(s,t)},"extractBinary"),d6=P$(async(e,t)=>{dr("Resolving Node.js binary for target: %O",e);const r={...e,nodeVersion:await c6(e.nodeVersion)},n=r6(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=s6(r);dr("Cache miss, downloading from: %s",i),t.info(`Downloading Node.js ${r.nodeVersion} for ${r.platform}-${r.arch}...`),t.info(` ${i}`),await Zh(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=_$(r.platform),a=`${n}.download.${s}`,l=m0.from(await o.arrayBuffer());dr("Downloaded %d bytes, writing to: %s",l.length,a),await eg(a,l);try{await f6(a,n,r),r.platform!=="win"&&await Yh(n,493),dr("Binary cached at: %s",n),t.info(`Cached Node.js binary at: ${n}`)}finally{await Cs(a,{force:!0})}return n},"resolveNodeBinary");var m6=Object.defineProperty,qn=v((e,t)=>m6(e,"name",{value:t,configurable:!0}),"l");const Yr=O$(),h6=/\.d\.[mc]?ts$/,g6=qn(e=>({buildEntries:e.buildEntries,logger:e.logger,options:e.options,packageType:e.pkg.type}),"toExeBuildInput"),v6=qn(e=>{const{logger:t,options:r}=e;if(ls.bun||ls.deno)throw new Error("The `exe` option is not supported in Bun and Deno environments.");if(!A$(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"),b6=qn((e,t)=>e.endsWith(".cjs")?"commonjs":e.endsWith(".mjs")||t==="module"?"module":"commonjs","pickMainFormat"),kh=mn==="win32"?"win":mn,jh=qn((e,t,r,n,i)=>{let o;return e.fileName?o=typeof e.fileName=="function"?e.fileName(t):e.fileName:o=wt(r,gn(r)),i&&(o+=i),n==="win"&&(o+=".exe"),o},"resolveOutputFileName"),Ah=qn(async(e,t,r,n,i,o,s)=>{const{logger:a,options:l,packageType:c}=e,u=ve(l.rootDir,t.outDir??"build");await Zh(u,{recursive:!0});const p=le(u,i);Yr("Building SEA executable: %s -> %s",n,p);const f=performance.now(),d=await Qh(le(Jh(),"packem-sea-"));try{const g={disableExperimentalSEAWarning:!0,...t.seaConfig,main:n,mainFormat:b6(r.path,c),output:p};s&&(g.executable=s);const y=le(d,"sea-config.json");await eg(y,JSON.stringify(g)),Yr("Wrote sea-config.json: %O -> %s",g,y),Yr("Running: %s --build-sea %s",process.execPath,y),await us(process.execPath,["--build-sea",y],{nodeOptions:{stdio:["ignore","ignore","inherit"]},throwOnError:!0})}finally{Yr.enabled?Yr("Preserving temp directory for debugging: %s",d):await Cs(d,{force:!0,recursive:!0})}if(o==="darwin")try{await us("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 Ji(p),y=Qe(g.size,{decimals:2});a.info(`${Ze(tt(l.rootDir,p))} ${Ph(y)}`)}const m=Math.round(performance.now()-f);a.success(`Built executable: ${zr(tt(l.rootDir,p))} ${$t(`(${String(m)}ms)`)}`)},"buildSingleExe"),y6=qn(async e=>{const t=g6(e),{buildEntries:r,logger:n,options:i}=t,o=i.exe;if(!o)return;const s=typeof o=="object"?o:{};v6(t);const a=r.filter(p=>p.type==="entry"&&!h6.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 d6(p,n),d=u6(p),m=jh(s,l,c,p.platform,d);await Ah(t,s,l,c,m,p.platform,f)}}else{const p=jh(s,l,c,kh);await Ah(t,s,l,c,p,kh)}},"buildExe");var $6=Object.defineProperty,Oh=v((e,t)=>$6(e,"name",{value:t,configurable:!0}),"t");const x6=Oh(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=Oh(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 w6=Object.defineProperty,E6=v((e,t)=>w6(e,"name",{value:t,configurable:!0}),"a");const S6=E6(async e=>await new Promise((t,r)=>{let n=0;const i=Ru(e).pipe(p0({params:{[f0.BROTLI_PARAM_QUALITY]:4}}));i.on("error",r),i.on("data",o=>{n+=o.length}),i.on("end",()=>{t(n)})}),"brotliSize");var k6=Object.defineProperty,hf=v((e,t)=>k6(e,"name",{value:t,configurable:!0}),"d");const hi=hf(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"),gi=hf((e,t,r)=>{let n=e.get(t);return n===void 0&&(n=r(),e.set(t,n)),n},"getOrCreate"),j6=hf((e,t,r,n)=>{if(n!==void 0){const s=new Map;for(const l of e){const c=gi(s,hi(l[t]),()=>new Map),u=gi(c,hi(l[r]),()=>new Map);gi(u,hi(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=gi(i,hi(s[t]),()=>new Map);gi(a,hi(s[r]),()=>[]).push(s)}const o={};for(const[s,a]of i)o[s]=Object.fromEntries(a);return o},"groupByKeys");var A6=Object.defineProperty,O6=v((e,t)=>A6(e,"name",{value:t,configurable:!0}),"i");const R6=O6(async e=>await new Promise((t,r)=>{let n=0;const i=Ru(e).pipe(d0({level:9}));i.on("error",r),i.on("data",o=>{n+=o.length}),i.on("end",()=>{t(n)})}),"gzipSize");var _6=Object.defineProperty,pt=v((e,t)=>_6(e,"name",{value:t,configurable:!0}),"c$1");const P6=2,C6=/\.js$/,T6=/\.d\.[m|c]ts$/,N6=pt((e,t,r)=>[`total size: ${Re(Qe(t,{decimals:2}))}`,e.size?.brotli&&`brotli size: ${Re(Qe(e.size.brotli,{decimals:2}))}`,e.size?.gzip&&`gzip size: ${Re(Qe(e.size.gzip,{decimals:2}))}`,r!==0&&`chunk size: ${Re(Qe(r,{decimals:2}))}`].filter(Boolean).join(", "),"buildSizeSummary"),I6=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(C6,".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(T6,".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=>`${$t(" └─ ")+Ze(r(f.path))} (total size: ${Re(Qe(f.size?.bytes??0,{decimals:2}))})`).join(`
|
|
208
|
-
`)}`:`
|
|
209
|
-
types: ${Ze(r(u.path))} (total size: ${Re(Qe(u.size?.bytes??0,{decimals:2}))})`):""},"buildDeclarationTypesLine"),M6=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))} (${N6(e,i,o)})`;if(s+=e.exports?.length?`
|
|
210
|
-
exports: ${$t(e.exports.join(", "))}`:"",e.chunks?.length&&(s+=`
|
|
211
|
-
${e.chunks.map(a=>{const l=t.buildEntries.find(c=>c.path===a)?.bytes;return $t(` └─ ${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=>$t(` └─ ${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=>$t(` 📦 ${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+=I6(e,t,r,n)),s+=`
|
|
219
|
-
|
|
220
|
-
`,e.chunk?$t(s):s},"buildEntryLine"),D6=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=M6(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+=`${$t(`
|
|
222
|
-
└─ `)+Ze(r(a.path))} (total size: ${Re(Qe(a.size?.bytes??0,{decimals:2}))})`;s+=`
|
|
223
|
-
|
|
224
|
-
`,e.raw(s)}return n&&e.raw("Σ Total dist size (byte size):",Re(Qe(t.buildEntries.reduce((s,a)=>s+(a.size?.bytes??0),0),{decimals:2})),`
|
|
225
|
-
`),n},"showSizeInformation"),B6=/\.d\.[mc]?ts$/,qc=pt(e=>e.filter(t=>!B6.test(t.input)),"filterDtsEntries"),L6=pt((e,t)=>{const r=[];return e!=="undefined"&&r.push(`${Re(e)} environment`),t!=="undefined"&&r.push(`${Re(t)} runtime`),r.length>0?`Preparing build for ${r.join(" with ")}`:""},"createBuildLogMessage"),W6=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"),F6=pt((e,t)=>{const r=[];return e!=="undefined"&&r.push(e),t!=="undefined"&&r.push(t),r.length>0?`${r.join("/")}/`:""},"createSubDirectory"),Xo=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?cl(e.options.rollup.replace,{},o):!1}}}),"createAdjustedContext"),H6=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=j6(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=L6(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?W6(l,u):{};if(g){g.values??={};const k=y?cl(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=F6(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(zi(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=Xo(d,!0,!0,qc(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=Xo(d,!1,!0,qc(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=Xo(d,!0,!1,qc(_),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=Xo(d,k||B,C,O,b,j);a.add({context:J,fileCache:t,subDirectory:R})}}return{builders:s,typeBuilders:a}},"prepareRollupConfig"),q6=pt(async(e,t)=>{const r=e.logger;await e.hooks.callHook("build:before",e);const{builders:n,typeBuilders:i}=await H6(e,t);if(n.size>0&&await Promise.all(Array.from(n,async({context:a,fileCache:l,subDirectory:c})=>GI(a,l,c,Zy(a.options.bundler)))),i.size>0){const a=e.options.dtsConcurrency??P6;await x6(Array.from(i,({context:l,fileCache:c,subDirectory:u})=>()=>JD(l,c,u)),a)}r.success(Eu(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 oo(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 Ji(c);u.bytes=d.size}const[p,f]=await Promise.all([u.brotli??S6(c),u.gzip??R6(c)]);u.brotli=p,u.gzip=f})())}return await Promise.all(s),e.options.exe&&await y6(e),await e.hooks.callHook("build:done",e),D6(r,e)},"build");var z6=Object.defineProperty,C$=v((e,t)=>z6(e,"name",{value:t,configurable:!0}),"c");const G6=C$(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"),U6=C$(async(e,t,r,n,i,o)=>{const s=e;if(o!=="*"&&xt.valid(xt.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 Tn(l);i==="file"&&Object.keys(a).length>0?(await Jg(l,{...c,typesVersions:G6({...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 K6=Object.defineProperty,at=v((e,t)=>K6(e,"name",{value:t,configurable:!0}),"p");const qr=at(e=>e??{},"extras"),J6=/\.(md|txt|htm|html|data)$/,V6=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"),X6=at((e,t,r,n,i,o,s,a)=>{const l=V6(s?.config.compilerOptions?.jsx),c=a.split("."),u=AM()(D_,i,{alias:{},browserTargets:Ax(),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===Ai,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:[J6]},replace:{objectGuards:!0,preventAssignment:!0},resolve:{allowExportsFolderMapping:!1,exportConditions:[r??"production","module-sync"],extensions:Ps,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===Ai,...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!==Ai,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:_M(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 ${Re("node ")}${a}`,prefix:"system"}),e.info({message:f?`Using ${Re("rolldown")} with ${Re(u.runtime)} build runtime`:`Using ${Re("rollup")} with ${Re(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 ${Re(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(", ")}`)),mh(u.alias),u.rollup.alias!==!1&&u.rollup.alias?.entries&&mh(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"),Y6=at(async(e,t,r,n,i,o,s,a,l)=>{const c=o.hooks,u=X6(e,t,n,i,o,s,a,l);$1(le(u.rootDir,u.outDir));const p={buildEntries:[],dependencyGraphMap:new Map,environment:n,hoistedDependencies:new Set,hooks:Ox(),implicitDependencies:new Set,jiti:Rx(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"),qM(p);const f=eb(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: ${Re(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.`),t$(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"),S5=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}=fl(e);n.debug("Using package.json found at",c);const u=await QI(e,l,n,s),p=jP("@visulima/packem",{cwd:e});let f=!1,d,m,g;const y=Wt(JSON.stringify({packemVersion:Dv,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&&H$(y,p,n);const x=new yx(e,p,y,n);try{const j=await Y6(n,e,t,r,i,o,l,u,a);x.isEnabled=j.options.fileCache??!0;const R=Zy(j.options.bundler);await zm(R,e,n),R==="rolldown"&&j.options.declaration&&await zm("rollup",e,n),j.options.transformerName&&await KI(j.options.transformerName,e,n),n.info(Re(`${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(()=>Cd(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 MM({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=_x(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(()=>Cd(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 xM(j,x,b,h,E),Jm(j,!1);return}if(await SM(j),t==="jit")await gM(j),await j.hooks.callHook("build:done",j);else{if(f=await q6(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 U6(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&&_D(j),j.options.validation.attw&&await iD(j,f),j.options.validation.bundleLimit&&GD(j,f)),await j.hooks.callHook("validate:done",j),Jm(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
|
-
`),mx(j),qh(j),j}finally{g&&(Vt.off("SIGINT",g),Vt.off("SIGTERM",g)),n.restoreAll(),await FM(p,n,f)}},"packem");export{Nl as $,sp as B,zO as C,yi as K,q2 as M,u5 as N,ok as Q,S5 as T,QO as U,BO as W,nR as Z,Wa as _,Aj as a,r5 as b,yd as c,s_ as d,lk as e,AM as f,D_ as g,i5 as h,a5 as i,ht as j,Dv as k,f5 as l,p5 as m,s5 as n,ik as r,sR as t,sd as v};
|