@visulima/packem 2.0.0-alpha.8 → 2.0.0-alpha.80

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.
Files changed (94) hide show
  1. package/CHANGELOG.md +1145 -2
  2. package/LICENSE.md +3812 -2243
  3. package/README.md +59 -32
  4. package/dist/builder/typedoc/index.d.ts +11 -23
  5. package/dist/builder/typedoc/index.js +3 -3
  6. package/dist/cli/index.js +67 -39
  7. package/dist/config/index.d.ts +55 -24
  8. package/dist/config/preset/preact.d.ts +31 -0
  9. package/dist/config/preset/preact.js +2 -0
  10. package/dist/config/preset/react.d.ts +72 -0
  11. package/dist/config/preset/react.js +1 -0
  12. package/dist/config/preset/solid.d.ts +114 -0
  13. package/dist/config/preset/solid.js +1 -0
  14. package/dist/config/preset/svelte.d.ts +84 -0
  15. package/dist/config/preset/svelte.js +1 -0
  16. package/dist/config/preset/vue.d.ts +66 -0
  17. package/dist/config/preset/vue.js +1 -0
  18. package/dist/css/loaders/less.d.ts +1 -0
  19. package/dist/css/loaders/less.js +1 -0
  20. package/dist/css/loaders/lightningcss.d.ts +1 -0
  21. package/dist/css/loaders/lightningcss.js +1 -0
  22. package/dist/css/loaders/postcss.d.ts +1 -0
  23. package/dist/css/loaders/postcss.js +1 -0
  24. package/dist/css/loaders/sass.d.ts +1 -0
  25. package/dist/css/loaders/sass.js +1 -0
  26. package/dist/css/loaders/sourcemap.d.ts +1 -0
  27. package/dist/css/loaders/sourcemap.js +1 -0
  28. package/dist/css/loaders/stylus.d.ts +1 -0
  29. package/dist/css/loaders/stylus.js +1 -0
  30. package/dist/{rollup/plugins/css/minifiers/lightningcss.js → css/loaders/tailwindcss.d.ts} +1 -1
  31. package/dist/css/loaders/tailwindcss.js +1 -0
  32. package/dist/css/minifiers/cssnano.d.ts +1 -0
  33. package/dist/css/minifiers/cssnano.js +1 -0
  34. package/dist/css/minifiers/lightningcss.d.ts +1 -0
  35. package/dist/css/minifiers/lightningcss.js +1 -0
  36. package/dist/index.d.ts +55 -30
  37. package/dist/index.js +41 -1
  38. package/dist/packem_shared/create-or-update-key-storage-D8L6IRYf.js +13 -0
  39. package/dist/packem_shared/default-DCITr7u7.js +1 -0
  40. package/dist/packem_shared/index-D4AUfFZu.js +251 -0
  41. package/dist/packem_shared/oxcResolvePlugin-DeIohkWk-DfJ30lek.js +170 -0
  42. package/dist/packem_shared/oxcTransformPlugin-Dwvbw2jE-Bbz81VnA.js +4 -0
  43. package/dist/packem_shared/types.d-Cm6dnCyD.d.ts +426 -0
  44. package/dist/packem_shared/utils-nmTpa3um.js +1 -0
  45. package/dist/rollup/plugins/esbuild/index.d.ts +1 -24
  46. package/dist/rollup/plugins/esbuild/index.js +1 -1
  47. package/dist/rollup/plugins/oxc/oxc-transformer.d.ts +1 -20
  48. package/dist/rollup/plugins/oxc/oxc-transformer.js +1 -1
  49. package/dist/rollup/plugins/sucrase/index.d.ts +1 -19
  50. package/dist/rollup/plugins/sucrase/index.js +1 -1
  51. package/dist/rollup/plugins/swc/swc-plugin.d.ts +1 -26
  52. package/dist/rollup/plugins/swc/swc-plugin.js +1 -1
  53. package/files.d.ts +37 -0
  54. package/package.json +108 -76
  55. package/dist/packem_shared/browserslistToEsbuild-C0IWmbNe-C6xPL1oW.js +0 -1
  56. package/dist/packem_shared/create-or-update-key-storage-GwAIWW7R.js +0 -3
  57. package/dist/packem_shared/default-B6X7-Lx3.js +0 -1
  58. package/dist/packem_shared/default-B_dUKZ_J.js +0 -1
  59. package/dist/packem_shared/default-C3sdXf4G.js +0 -1
  60. package/dist/packem_shared/default-DR5Fia_R.js +0 -1
  61. package/dist/packem_shared/default-DqRcOUe1.js +0 -1
  62. package/dist/packem_shared/esbuildPlugin-BAwyhG6L-yty60jMl.js +0 -3
  63. package/dist/packem_shared/index-CDdkRKp3.js +0 -138
  64. package/dist/packem_shared/index-CUp9WuCG.js +0 -1
  65. package/dist/packem_shared/index-zikl8Yu3.d.ts +0 -5229
  66. package/dist/packem_shared/isolatedDeclarationsOxcTransformer-WbfE6cGu-NeZOx2Y7.js +0 -1
  67. package/dist/packem_shared/isolatedDeclarationsSwcTransformer-Ch2AgtWC-B-0lOgFf.js +0 -1
  68. package/dist/packem_shared/isolatedDeclarationsTypescriptTransformer-DkuEkofo-Cwe3ODMG.js +0 -3
  69. package/dist/packem_shared/oxcResolvePlugin-BJpi-eSG-BsYx9cDO.js +0 -1
  70. package/dist/packem_shared/oxcTransformPlugin-DfVQouIB-Cpfv95eA.js +0 -4
  71. package/dist/packem_shared/resolveTypescriptMjsCtsPlugin-DcZrZTmM-BEkYWTsH.js +0 -6
  72. package/dist/packem_shared/swcPlugin-Boip4lWG-CwJ-HVJc.js +0 -1
  73. package/dist/packem_shared/types-Dn9KmF6u.d.ts +0 -163
  74. package/dist/rollup/plugins/css/loaders/less.d.ts +0 -1
  75. package/dist/rollup/plugins/css/loaders/less.js +0 -1
  76. package/dist/rollup/plugins/css/loaders/lightningcss.d.ts +0 -1
  77. package/dist/rollup/plugins/css/loaders/lightningcss.js +0 -1
  78. package/dist/rollup/plugins/css/loaders/postcss.d.ts +0 -1
  79. package/dist/rollup/plugins/css/loaders/postcss.js +0 -1
  80. package/dist/rollup/plugins/css/loaders/sass.d.ts +0 -1
  81. package/dist/rollup/plugins/css/loaders/sass.js +0 -1
  82. package/dist/rollup/plugins/css/loaders/sourcemap.d.ts +0 -8
  83. package/dist/rollup/plugins/css/loaders/sourcemap.js +0 -1
  84. package/dist/rollup/plugins/css/loaders/stylus.d.ts +0 -1
  85. package/dist/rollup/plugins/css/loaders/stylus.js +0 -1
  86. package/dist/rollup/plugins/css/minifiers/cssnano.d.ts +0 -1
  87. package/dist/rollup/plugins/css/minifiers/cssnano.js +0 -1
  88. package/dist/rollup/plugins/css/minifiers/lightningcss.d.ts +0 -1
  89. package/dist/rollup/plugins/oxc/isolated-declarations-oxc-transformer.d.ts +0 -25
  90. package/dist/rollup/plugins/oxc/isolated-declarations-oxc-transformer.js +0 -1
  91. package/dist/rollup/plugins/swc/isolated-declarations-swc-transformer.d.ts +0 -20
  92. package/dist/rollup/plugins/swc/isolated-declarations-swc-transformer.js +0 -1
  93. package/dist/rollup/plugins/typescript/isolated-declarations-typescript-transformer.d.ts +0 -24
  94. package/dist/rollup/plugins/typescript/isolated-declarations-typescript-transformer.js +0 -1
@@ -0,0 +1,251 @@
1
+ var v$=Object.defineProperty;var v=(e,t)=>v$(e,"name",{value:t,configurable:!0});import{createRequire as De,builtinModules as b$}from"node:module";import{f as Or,a as yh,_ as Bc,c as y$,s as $h,d as du,b as $$,e as x$,M as w$,g as ws,$ as mu,n as E$,w as S$,i as Ft,q as Ce,j as ut,F as _t,B as hu,h as mi,T as qr,H as Ko,I as xh,E as wh,K as k$,m as j$}from"./create-or-update-key-storage-D8L6IRYf.js";import Vt,{env as A$,versions as ns,platform as fn}from"node:process";import{installPackage as Eh,detectPackageManager as O$}from"@antfu/install-pkg";import{L as ve,P as Je,_ as le,B as dn,X as $t,b as Sh,M as Hi,V as Te,R as et,H as mn,A as R$,a as _$,c as kh}from"./utils-nmTpa3um.js";import{f as P$,C as is,l as C$,B as jh,i as T$,$ as Ah,a as Sr,r as tt,b as qi,c as Es,d as gu,e as Oh,g as Rh,h as N$,j as _h,k as I$,m as M$,n as Yr,o as D$,p as B$,I as L$,q as Ss}from"./oxcResolvePlugin-DeIohkWk-DfJ30lek.js";import{browserslistToEsbuild as of,nodeResolve as W$,alias as Ph,purePlugin as F$,pureNewExpressionPlugin as H$,importTrace as Ch,replace as Th,polyfillNode as q$,chunkSplitter as z$,wasm as G$,preserveDirectivesPlugin as U$,dynamicImportVars as K$,commonjs as J$,jsxRemoveAttributes as V$,visualizer as X$,patchErrorWithTrace as Y$}from"@visulima/packem-rollup";import{ENDING_REGEX as Q$,svgToCssDataUri as Z$,svgToTinyDataUri as ex,arrayify as tx,memoizeByKey as rx,enhanceRollupError as Nh,FileCache as nx}from"@visulima/packem-share";import{RUNTIME_EXPORT_CONVENTIONS as Ih,SPECIAL_EXPORT_CONVENTIONS as Mh,PRODUCTION_ENV as ki,DEVELOPMENT_ENV as sf,DEFAULT_EXTENSIONS as ks,ENDING_REGEX as vu,EXCLUDE_REGEXP as hr,ALLOWED_TRANSFORM_EXTENSIONS_REGEX as dr,VALID_EXPORT_EXTENSIONS as ix}from"@visulima/packem-share/constants";import{getCacheHash as Wt,memoize as ox,arrayify as Lc,isFromNodeModules as fl,isBareSpecifier as hi,parseSpecifier as Wc,isOutsideProject as sx,getPackageName as ax,replaceContentWithinMarker as lx,svgEncoder as cx,getChunkFilename as ji,getEntryFileNames as ux,getOutputExtension as gt,sortUserPlugins as Dh,getDtsExtension as Ct,warn as be}from"@visulima/packem-share/utils";import px from"browserslist";import{createHooks as fx}from"hookable";import{createJiti as dx}from"jiti";import{x as os,exec as mx}from"tinyexec";import Ke from"magic-string";import{fileURLToPath as hx}from"node:url";import{transformAsync as gx}from"@babel/core";import{createFilter as Mt}from"@rollup/pluginutils";import Bh,{stat as zi,readFile as ss,copyFile as vx,chmod as Lh,rm as js,readdir as bx,mkdtemp as Wh,rename as yx,mkdir as Fh,writeFile as Hh}from"node:fs/promises";import*as $x from"rs-module-lexer";import{findStaticImports as As,isNodeBuiltin as Ro,parseNodeModulePath as af,parseStaticImport as xx,findExports as wx,resolvePath as qh,fileURLToPath as Ex,resolveModuleExportNames as Sx,pathToFileURL as kx}from"mlly";import jx,{createReadStream as bu,createWriteStream as Ax,existsSync as zh,watch as lf}from"node:fs";import{resolve as Ox,dirname as Rx,isAbsolute as _x}from"node:path";import Px from"rollup-plugin-license";import Gt from"typescript";import Cx from"clean-css";import{minify as Tx}from"html-minifier-next";import{init as Gh,parse as Nx}from"cjs-module-lexer";import{parseSync as Os}from"oxc-parser";import Ix from"node:crypto";import{cjsInteropPlugin as Uh}from"@visulima/packem-rollup/plugin/cjs-interop";import{JsonPlugin as Mx}from"@visulima/packem-rollup/plugin/json";import{confirm as Dx,isCancel as Bx,spinner as Lx}from"@clack/prompts";import cf from"node:path/posix";import{readTsConfig as Wx,findTsConfig as Fx}from"@visulima/tsconfig";import{createDefu as Hx}from"defu";import qx from"child_process";import zx from"node:child_process";import{tmpdir as Kh,homedir as Gx}from"node:os";import{promisify as Ux,debuglog as Kx}from"node:util";import{distance as Jx}from"fastest-levenshtein";import{createBrotliCompress as Vx,constants as Xx,createGzip as Yx}from"node:zlib";import{Buffer as Qx}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 Zx=Object.defineProperty,e0=v((e,t)=>Zx(e,"name",{value:t,configurable:!0}),"i$s"),t0=Object.defineProperty,r0=e0((e,t)=>t0(e,"name",{value:t,configurable:!0}),"r"),n0=Object.defineProperty,i0=r0((e,t)=>n0(e,"name",{value:t,configurable:!0}),"i");const uf=i0(e=>{if(e.isFile())return"file";if(e.isDirectory())return"dir";if(e.isSymbolicLink())return"symlink"},"getFileInfoType");var o0=Object.defineProperty,s0=v((e,t)=>o0(e,"name",{value:t,configurable:!0}),"i$r"),a0=Object.defineProperty,Jh=s0((e,t)=>a0(e,"name",{value:t,configurable:!0}),"s");const l0=De(import.meta.url),Hn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,c0=Jh(e=>{if(typeof Hn<"u"&&Hn.versions&&Hn.versions.node){const[t,r]=Hn.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Hn.getBuiltinModule(e)}return l0(e)},"__cjs_getBuiltinModule"),{lstat:pf,mkdir:u0}=c0("node:fs/promises");var p0=Object.defineProperty,f0=Jh((e,t)=>p0(e,"name",{value:t,configurable:!0}),"o");const Fc=f0(async e=>{P$(e);try{const t=await pf(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(uf(t))}'`);return}catch(t){if(t.code!=="ENOENT")throw t}try{await u0(e,{recursive:!0})}catch(t){if(t.code!=="EEXIST")throw t;const r=await pf(e);if(!r.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(uf(r))}'`,{cause:t})}},"ensureDir");var d0=Object.defineProperty,wn=v((e,t)=>d0(e,"name",{value:t,configurable:!0}),"r$e"),m0=Object.defineProperty,En=wn((e,t)=>m0(e,"name",{value:t,configurable:!0}),"r"),h0=Object.defineProperty,hn=En((e,t)=>h0(e,"name",{value:t,configurable:!0}),"t");function Gi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}v(Gi,"p$x");wn(Gi,"f");En(Gi,"getDefaultExportFromCjs");hn(Gi,"getDefaultExportFromCjs");function yu(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}v(yu,"f$w");wn(yu,"l");En(yu,"getDefaultExportFromNamespaceIfPresent");hn(yu,"getDefaultExportFromNamespaceIfPresent");function $u(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")&&Object.keys(e).length===1?e.default:e}v($u,"l$C");wn($u,"s");En($u,"getDefaultExportFromNamespaceIfNotNamed");hn($u,"getDefaultExportFromNamespaceIfNotNamed");function xu(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=hn(En(wn(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:hn(function(){return e[n]},"get")})}),r}v(xu,"s$C");wn(xu,"m");En(xu,"getAugmentedNamespace");hn(xu,"getAugmentedNamespace");var g0=Object.defineProperty,ir=v((e,t)=>g0(e,"name",{value:t,configurable:!0}),"lt$5"),v0=Object.defineProperty,xt=ir((e,t)=>v0(e,"name",{value:t,configurable:!0}),"ut"),ff={},dl,df;function Sn(){if(df)return dl;df=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}*?`,E="/",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:E},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 dl={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(w){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${w.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(w){return w===!0?R:j}},dl}v(Sn,"_t$5");ir(Sn,"bt");xt(Sn,"requireConstants");var mf;function kn(){return mf||(mf=1,(function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:r,REGEX_SPECIAL_CHARS:n,REGEX_SPECIAL_CHARS_GLOBAL:i}=Sn();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}})(ff)),ff}v(kn,"Et$5");ir(kn,"yt");xt(kn,"requireUtils");var ml,hf;function wu(){if(hf)return ml;hf=1;var e=Object.defineProperty,t=xt((b,w)=>e(b,"name",{value:w,configurable:!0}),"k");const r=kn(),{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:E}=Sn(),j=t(b=>b===c||b===o,"isPathSeparator"),R=t(b=>{b.isPrefix!==!0&&(b.depth=b.isGlobstar?1/0:1)},"depth");return ml=t((b,w)=>{const h=w||{},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===E){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,x="",S="";q>0&&(x=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:x,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],Pe=b.slice(ye,$e);h.tokens&&(ie===0&&q!==0?(k[ie].isPrefix=!0,k[ie].value=x):k[ie].value=Pe,R(k[ie]),we.maxDepth+=k[ie].depth),(ie!==0||Pe!=="")&&C.push(Pe),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"),ml}v(wu,"Nt$5");ir(wu,"wt");xt(wu,"requireScan");var hl,gf;function Eu(){if(gf)return hl;gf=1;var e=Object.defineProperty,t=xt((b,w)=>e(b,"name",{value:w,configurable:!0}),"y");const r=Sn(),n=kn(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:o,REGEX_NON_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_BACKREF:a,REPLACEMENTS:l}=r,c=t((b,w)=>typeof w.expandRange=="function"?w.expandRange(...b,w):(b.sort(),`[${b.join("-")}]`),"expandRange"),u=t((b,w)=>`Missing ${b}: "${w}" - use "\\\\${w}" to match literal characters`,"syntaxError"),p=t(b=>{const w=[];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){w.push(O),O="";continue}}}O+=C}return w.push(O),w},"splitTopLevel"),f=t(b=>{let w=!1;for(const h of b){if(w===!0){w=!1;continue}if(h==="\\"){w=!0;continue}if(/[?*+@!()[\]{}]/.test(h))return!1}return!0},"isPlainBranch"),d=t(b=>{let w=b.trim(),h=!0;for(;h===!0;)h=!1,/^@\([^\\()[\]{}|]+\)$/.test(w)&&(w=w.slice(2,-1),h=!0);if(f(w))return w.replace(/\\(.)/g,"$1")},"normalizeSimpleBranch"),m=t(b=>{const w=b.map(d).filter(Boolean);for(let h=0;h<w.length;h++)for(let A=h+1;A<w.length;A++){const _=w[h],O=w[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,w=!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 w===!0&&k!==b.length-1?void 0:{type:b[0],body:b.slice(2,k),end:k}}}}},"parseRepeatedExtglob"),y=t(b=>{let w=0;const h=[];for(;w<b.length;){const A=g(b.slice(w),!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),w+=A.end+1}return h.length<1?void 0:`${h.length===1?n.escapeRegex(h[0]):`[${h.map(A=>n.escapeRegex(A)).join("")}]`}*`},"getStarExtglobSequenceOutput"),E=t(b=>{let w=0,h=b.trim(),A=g(h);for(;A;)w++,h=A.body.trim(),A=g(h);return w},"repeatedExtglobRecursion"),j=t((b,w)=>{if(w.maxExtglobRecursion===!1)return{risky:!1};const h=typeof w.maxExtglobRecursion=="number"?w.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(E(_)>h)return{risky:!0}}return{risky:!1}},"analyzeRepeatedExtglob"),R=t((b,w)=>{if(typeof b!="string")throw new TypeError("Expected a string");b=l[b]||b;const h={...w},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 x=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"),Pe=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"),nt=t(T=>{$[T]++,se.push(T)},"increment"),_e=t(T=>{$[T]--,se.pop()},"decrement"),H=t(T=>{if(x.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,-x.output.length),x.type="star",x.value="*",x.output=D,$.output+=x.output)}if(ge.length&&T.type!=="paren"&&(ge[ge.length-1].inner+=T.value),(T.value||T.output)&&Pe(T),x&&x.type==="text"&&T.type==="text"){x.output=(x.output||x.value)+T.value,x.value+=T.value;return}T.prev=x,k.push(T),x=T},"push"),it=t((T,ee)=>{const P={...J[ee],conditions:1,inner:""};P.prev=x,P.parens=$.parens,P.output=$.output,P.startIndex=$.index,P.tokensIndex=k.length;const G=(h.capture?"(":"")+P.open;nt("parens"),H({type:T,value:ee,output:$.output?"":re}),H({type:"paren",extglob:!0,value:ie(),output:G}),ge.push(P)},"extglobOpen"),Fn=t(T=>{const ee=b.slice(T.startIndex,$.index+1),P=b.slice(T.startIndex+2,$.index),G=j(P,h);if((T.type==="plus"||T.type==="star")&&G.risky){const Z=G.safeOutput?(T.output?"":re)+(h.capture?`(${G.safeOutput})`:G.safeOutput):void 0,Se=k[T.tokensIndex];Se.type="text",Se.value=ee,Se.output=Z||n.escapeRegex(ee);for(let ke=T.tokensIndex+1;ke<k.length;ke++)k[ke].value="",k[ke].output="",delete k[ke].suffix;$.output=T.output+Se.output,$.backtrack=!0,H({type:"paren",extglob:!0,value:S,output:""}),_e("parens");return}let ne=T.close+(h.capture?")":""),ae;if(T.type==="negate"){let Z=D;if(T.inner&&T.inner.length>1&&T.inner.includes("/")&&(Z=z(h)),(Z!==D||we()||/^\)+$/.test(ye()))&&(ne=T.close=`)$))${Z}`),T.inner.includes("*")&&(ae=ye())&&/^\.[^\\/.]+$/.test(ae)){const Se=R(ae,{...w,fastpaths:!1}).output;ne=T.close=`)${Se})${Z})`}T.prev.type==="bos"&&($.negatedExtglob=!0)}H({type:"paren",extglob:!0,value:S,output:ne}),_e("parens")},"extglobClose");if(h.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(b)){let T=!1,ee=b.replace(a,(P,G,ne,ae,Z,Se)=>ae==="\\"?(T=!0,P):ae==="?"?G?G+ae+(Z?N.repeat(Z.length):""):Se===0?L+(Z?N.repeat(Z.length):""):N.repeat(ne.length):ae==="."?q.repeat(ne.length):ae==="*"?G?G+ae+(Z?D:""):D:G?P:`\\${P}`);return T===!0&&(h.unescape===!0?ee=ee.replace(/\\/g,""):ee=ee.replace(/\\+/g,P=>P.length%2===0?"\\\\":P?"\\":"")),ee===b&&h.contains===!0?($.output=b,$):($.output=n.wrapOutput(ee,$,w),$)}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!=="]"||x.value==="["||x.value==="[^")){if(h.posix!==!1&&S===":"){const P=x.value.slice(1);if(P.includes("[")&&(x.posix=!0,P.includes(":"))){const G=x.value.lastIndexOf("["),ne=x.value.slice(0,G),ae=x.value.slice(G+2),Z=o[ae];if(Z){x.value=ne+Z,$.backtrack=!0,ie(),!O.output&&k.indexOf(x)===1&&(O.output=re);continue}}}(S==="["&&Q()!==":"||S==="-"&&Q()==="]")&&(S=`\\${S}`),S==="]"&&(x.value==="["||x.value==="[^")&&(S=`\\${S}`),h.posix===!0&&S==="!"&&x.value==="["&&(S="^"),x.value+=S,Pe({value:S});continue}if($.quotes===1&&S!=='"'){S=n.escapeRegex(S),x.value+=S,Pe({value:S});continue}if(S==='"'){$.quotes=$.quotes===1?0:1,h.keepQuotes===!0&&H({type:"text",value:S});continue}if(S==="("){nt("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){Fn(ge.pop());continue}H({type:"paren",value:S,output:$.parens?")":"\\)"}),_e("parens");continue}if(S==="["){if(h.nobracket===!0||!ye().includes("]")){if(h.nobracket!==!0&&h.strictBrackets===!0)throw new SyntaxError(u("closing","]"));S=`\\${S}`}else nt("brackets");H({type:"bracket",value:S});continue}if(S==="]"){if(h.nobracket===!0||x&&x.type==="bracket"&&x.value.length===1){H({type:"text",value:S,output:`\\${S}`});continue}if($.brackets===0){if(h.strictBrackets===!0)throw new SyntaxError(u("opening","["));H({type:"text",value:S,output:`\\${S}`});continue}_e("brackets");const P=x.value.slice(1);if(x.posix!==!0&&P[0]==="^"&&!P.includes("/")&&(S=`/${S}`),x.value+=S,Pe({value:S}),h.literalBrackets===!1||n.hasRegexChars(P))continue;const G=n.escapeRegex(x.value);if($.output=$.output.slice(0,-x.value.length),h.literalBrackets===!0){$.output+=G,x.value=G;continue}x.value=`(${C}${G}|${x.value})`,$.output+=x.value;continue}if(S==="{"&&h.nobrace!==!0){nt("braces");const P={type:"brace",value:S,output:"(",outputIndex:$.output.length,tokensIndex:$.tokens.length};pe.push(P),H(P);continue}if(S==="}"){const P=pe[pe.length-1];if(h.nobrace===!0||!P){H({type:"text",value:S,output:S});continue}let G=")";if(P.dots===!0){const ne=k.slice(),ae=[];for(let Z=ne.length-1;Z>=0&&(k.pop(),ne[Z].type!=="brace");Z--)ne[Z].type!=="dots"&&ae.unshift(ne[Z].value);G=c(ae,h),$.backtrack=!0}if(P.comma!==!0&&P.dots!==!0){const ne=$.output.slice(0,P.outputIndex),ae=$.tokens.slice(P.tokensIndex);P.value=P.output="\\{",S=G="\\}",$.output=ne;for(const Z of ae)$.output+=Z.output||Z.value}H({type:"brace",value:S,output:G}),_e("braces"),pe.pop();continue}if(S==="|"){ge.length>0&&ge[ge.length-1].conditions++,H({type:"text",value:S});continue}if(S===","){let P=S;const G=pe[pe.length-1];G&&se[se.length-1]==="braces"&&(G.comma=!0,P="|"),H({type:"comma",value:S,output:P});continue}if(S==="/"){if(x.type==="dot"&&$.index===$.start+1){$.start=$.index+1,$.consumed="",$.output="",k.pop(),x=O;continue}H({type:"slash",value:S,output:te});continue}if(S==="."){if($.braces>0&&x.type==="dot"){x.value==="."&&(x.output=q);const P=pe[pe.length-1];x.type="dots",x.output+=S,x.value+=S,P.dots=!0;continue}if($.braces+$.parens===0&&x.type!=="bos"&&x.type!=="slash"){H({type:"text",value:S,output:q});continue}H({type:"dot",value:S,output:q});continue}if(S==="?"){if(!(x&&x.value==="(")&&h.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){it("qmark",S);continue}if(x&&x.type==="paren"){const P=Q();let G=S;(x.value==="("&&!/[!=<:]/.test(P)||P==="<"&&!/<([!=]|\w+>)/.test(ye()))&&(G=`\\${S}`),H({type:"text",value:S,output:G});continue}if(h.dot!==!0&&(x.type==="slash"||x.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)))){it("negate",S);continue}if(h.nonegate!==!0&&$.index===0){Bt();continue}}if(S==="+"){if(h.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){it("plus",S);continue}if(x&&x.value==="("||h.regex===!1){H({type:"plus",value:S,output:X});continue}if(x&&(x.type==="bracket"||x.type==="paren"||x.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(x&&(x.type==="globstar"||x.star===!0)){x.type="star",x.star=!0,x.value+=S,x.output=D,$.backtrack=!0,$.globstar=!0,$e(S);continue}let T=ye();if(h.noextglob!==!0&&/^\([^?]/.test(T)){it("star",S);continue}if(x.type==="star"){if(h.noglobstar===!0){$e(S);continue}const P=x.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()){x.type="globstar",x.value+=S,x.output=z(h),$.output=x.output,$.globstar=!0,$e(S);continue}if(P.type==="slash"&&P.prev.type!=="bos"&&!ae&&we()){$.output=$.output.slice(0,-(P.output+x.output).length),P.output=`(?:${P.output}`,x.type="globstar",x.output=z(h)+(h.strictSlashes?")":"|$)"),x.value+=S,$.globstar=!0,$.output+=P.output+x.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+x.output).length),P.output=`(?:${P.output}`,x.type="globstar",x.output=`${z(h)}${te}|${te}${ke})`,x.value+=S,$.output+=P.output+x.output,$.globstar=!0,$e(S+ie()),H({type:"slash",value:"/",output:""});continue}if(P.type==="bos"&&T[0]==="/"){x.type="globstar",x.value+=S,x.output=`(?:^|${te}|${z(h)}${te})`,$.output=x.output,$.globstar=!0,$e(S+ie()),H({type:"slash",value:"/",output:""});continue}if(Z&&T[0]==="/"){x.type="globstar",x.value+=S,x.output=`(?:^|${te}|${z(h)}${te})`,$.output+=x.output,$.globstar=!0,$e(S+ie()),H({type:"slash",value:"/",output:""});continue}$.output=$.output.slice(0,-x.output.length),x.type="globstar",x.output=z(h),x.value+=S,$.output+=x.output,$.globstar=!0,$e(S);continue}const ee={type:"star",value:S,output:D};if(h.bash===!0){ee.output=".*?",(x.type==="bos"||x.type==="slash")&&(ee.output=Y+ee.output),H(ee);continue}if(x&&(x.type==="bracket"||x.type==="paren")&&h.regex===!0){ee.output=S,H(ee);continue}($.index===$.start||x.type==="slash"||x.type==="dot")&&(x.type==="dot"?($.output+=K,x.output+=K):h.dot===!0?($.output+=F,x.output+=F):($.output+=Y,x.output+=Y),Q()!=="*"&&($.output+=re,x.output+=re)),H(ee)}for(;$.brackets>0;){if(h.strictBrackets===!0)throw new SyntaxError(u("closing","]"));$.output=n.escapeLast($.output,"["),_e("brackets")}for(;$.parens>0;){if(h.strictBrackets===!0)throw new SyntaxError(u("closing",")"));$.output=n.escapeLast($.output,"("),_e("parens")}for(;$.braces>0;){if(h.strictBrackets===!0)throw new SyntaxError(u("closing","}"));$.output=n.escapeLast($.output,"{"),_e("braces")}if(h.strictSlashes!==!0&&(x.type==="star"||x.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,w)=>{const h={...w},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},hl=R,hl}v(Eu,"It$5");ir(Eu,"Bt");xt(Eu,"requireParse");var gl,vf;function Su(){if(vf)return gl;vf=1;var e=Object.defineProperty,t=xt((l,c)=>e(l,"name",{value:c,configurable:!0}),"h");const r=wu(),n=Eu(),i=kn(),o=Sn(),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 w=b(R);if(w)return w}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 E=t((j,R=!1)=>{const{isMatch:b,match:w,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:w,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&&(E.state=g),E},"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,gl=a,gl}v(Su,"wt$3");ir(Su,"Gt");xt(Su,"requirePicomatch$1");var vl,bf;function ku(){if(bf)return vl;bf=1;var e=Object.defineProperty,t=xt((o,s)=>e(o,"name",{value:s,configurable:!0}),"c");const r=Su(),n=kn();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"),ir(i,"D"),xt(i,"picomatch"),t(i,"picomatch"),Object.assign(i,r),vl=i,vl}v(ku,"Pt$5");ir(ku,"Mt");xt(ku,"requirePicomatch");var b0=ku();const gr=Gi(b0);var y0=Object.defineProperty,me=v((e,t)=>y0(e,"name",{value:t,configurable:!0}),"u$C"),$0=Object.defineProperty,fe=me((e,t)=>$0(e,"name",{value:t,configurable:!0}),"l");const x0=De(import.meta.url),qn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ui=fe(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 x0(e)},"__cjs_getBuiltinModule"),yf=Ui("fs"),w0={...yf,default:yf},{statSync:E0,stat:S0,realpathSync:k0,realpath:j0,readdirSync:A0,readdir:O0}=Ui("fs"),{sep:Vh,basename:R0,dirname:Hc,resolve:Xh,normalize:_0,relative:P0,posix:vr,isAbsolute:C0}=Ui("path"),{fileURLToPath:T0}=Ui("url"),{createRequire:N0}=Ui("module");var I0=Object.defineProperty,ce=fe((e,t)=>I0(e,"name",{value:t,configurable:!0}),"r"),$f=N0(import.meta.url);function Rs(e){let t=_0(e);return t.length>1&&t[t.length-1]===Vh&&(t=t.substring(0,t.length-1)),t}v(Rs,"H$d");me(Rs,"tt");fe(Rs,"M$1");ce(Rs,"cleanPath");const M0=/[\\/]/g;function Ki(e,t){return e.replace(M0,t)}v(Ki,"M$n");me(Ki,"T");fe(Ki,"D$1");ce(Ki,"convertSlashes");const D0=/^[a-z]:[\\/]$/i;function _s(e){return e==="/"||D0.test(e)}v(_s,"J$e");me(_s,"et");fe(_s,"T$1");ce(_s,"isRootDirectory");function Zr(e,t){const{resolvePaths:r,normalizePath:n,pathSeparator:i}=t,o=process.platform==="win32"&&e.includes("/")||e.startsWith(".");if(r&&(e=Xh(e)),(n||o)&&(e=Rs(e)),e===".")return"";const s=e[e.length-1]!==i;return Ki(s?e+i:e,i)}v(Zr,"q$o");me(Zr,"q");fe(Zr,"w");ce(Zr,"normalizePath");function Ji(e,t){return t+e}v(Ji,"B$m");me(Ji,"I");fe(Ji,"P");ce(Ji,"joinPathWithBasePath");function Ps(e,t){return function(r,n){return n.startsWith(e)?n.slice(e.length)+r:Ki(P0(e,n),t.pathSeparator)+t.pathSeparator+r}}v(Ps,"K$d");me(Ps,"st");fe(Ps,"X");ce(Ps,"joinPathWithRelativePath");function Cs(e){return e}v(Cs,"V$d");me(Cs,"rt");fe(Cs,"H");ce(Cs,"joinPath");function Ts(e,t,r){return t+e+r}v(Ts,"X$d");me(Ts,"nt");fe(Ts,"U$1");ce(Ts,"joinDirectoryPath");function Ns(e,t){const{relativePaths:r,includeBasePath:n}=t;return r&&e?Ps(e,t):n?Ji:Cs}v(Ns,"Z$d");me(Ns,"it");fe(Ns,"J");ce(Ns,"build$7");function Is(e){return function(t,r){r.push(t.substring(e.length)||".")}}v(Is,"tt$3");me(Is,"ot");fe(Is,"K$1");ce(Is,"pushDirectoryWithRelativePath");function Ms(e){return function(t,r,n){const i=t.substring(e.length)||".";n.every(o=>o(i,!0))&&r.push(i)}}v(Ms,"et$3");me(Ms,"ut");fe(Ms,"V");ce(Ms,"pushDirectoryFilterWithRelativePath");const B0=ce((e,t)=>{t.push(e||".")},"pushDirectory"),L0=ce((e,t,r)=>{const n=e||".";r.every(i=>i(n,!0))&&t.push(n)},"pushDirectoryFilter"),W0=ce(()=>{},"empty$2");function Ds(e,t){const{includeDirs:r,filters:n,relativePaths:i}=t;return r?i?n&&n.length?Ms(e):Is(e):n&&n.length?L0:B0:W0}v(Ds,"st$3");me(Ds,"lt");fe(Ds,"st$1");ce(Ds,"build$6");const F0=ce((e,t,r,n)=>{n.every(i=>i(e,!1))&&r.files++},"pushFileFilterAndCount"),H0=ce((e,t,r,n)=>{n.every(i=>i(e,!1))&&t.push(e)},"pushFileFilter"),q0=ce((e,t,r,n)=>{r.files++},"pushFileCount"),z0=ce((e,t)=>{t.push(e)},"pushFile"),G0=ce(()=>{},"empty$1");function Bs(e){const{excludeFiles:t,filters:r,onlyCounts:n}=e;return t?G0:r&&r.length?n?F0:H0:n?q0:z0}v(Bs,"it$3");me(Bs,"at");fe(Bs,"ut$1");ce(Bs,"build$5");const U0=ce(e=>e,"getArray"),K0=ce(()=>[""].slice(0,0),"getArrayGroup");function Ls(e){return e.group?K0:U0}v(Ls,"nt$3");me(Ls,"ct");fe(Ls,"ct$1");ce(Ls,"build$4");const J0=ce((e,t,r)=>{e.push({directory:t,files:r,dir:t})},"groupFiles"),V0=ce(()=>{},"empty");function Ws(e){return e.group?J0:V0}v(Ws,"rt$3");me(Ws,"ht");fe(Ws,"ft$1");ce(Ws,"build$3");const X0=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()&&Vi(e,a,t))return n.dequeue(null,t);r(c,a),n.dequeue(null,t)})})},"resolveSymlinksAsync"),Y0=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()&&Vi(e,s,t))return;r(a,s)}catch(s){if(!o)throw s}},"resolveSymlinks");function Fs(e,t){return!e.resolveSymlinks||e.excludeSymlinks?null:t?Y0:X0}v(Fs,"ot$3");me(Fs,"pt");fe(Fs,"gt$1");ce(Fs,"build$2");function Vi(e,t,r){if(r.options.useRealPaths)return Hs(t,r);let n=Hc(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=Hc(n)}return r.symlinks.set(e,t),i>1}v(Vi,"_$l");me(Vi,"L");fe(Vi,"E$1");ce(Vi,"isRecursive");function Hs(e,t){return t.visited.includes(e+t.options.pathSeparator)}v(Hs,"lt$4");me(Hs,"ft");fe(Hs,"dt$1");ce(Hs,"isRecursiveUsingRealPaths");const Q0=ce(e=>e.counts,"onlyCountsSync"),Z0=ce(e=>e.groups,"groupsSync"),ew=ce(e=>e.paths,"defaultSync"),tw=ce(e=>e.paths.slice(0,e.options.maxFiles),"limitFilesSync"),rw=ce((e,t,r)=>(Rr(t,r,e.counts,e.options.suppressErrors),null),"onlyCountsAsync"),nw=ce((e,t,r)=>(Rr(t,r,e.paths,e.options.suppressErrors),null),"defaultAsync"),iw=ce((e,t,r)=>(Rr(t,r,e.paths.slice(0,e.options.maxFiles),e.options.suppressErrors),null),"limitFilesAsync"),ow=ce((e,t,r)=>(Rr(t,r,e.groups,e.options.suppressErrors),null),"groupsAsync");function Rr(e,t,r,n){t(e&&!n?e:null,r)}v(Rr,"A$i");me(Rr,"j");fe(Rr,"y");ce(Rr,"report");function qs(e,t){const{onlyCounts:r,group:n,maxFiles:i}=e;return r?t?Q0:rw:n?t?Z0:ow:i?t?tw:iw:t?ew:nw}v(qs,"at$3");me(qs,"gt");fe(qs,"Et");ce(qs,"build$1");const Yh={withFileTypes:!0},sw=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||".",Yh,(s,a=[])=>{i(a,r,n),e.queue.dequeue(e.options.suppressErrors?null:s,e)})},"walkAsync"),aw=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||".",Yh)}catch(a){if(!e.options.suppressErrors)throw a}i(s,r,n)},"walkSync");function zs(e){return e?aw:sw}v(zs,"ut$3");me(zs,"yt");fe(zs,"xt$1");ce(zs,"build");var lw=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))}},cw=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}},uw=class{static{v(this,"Ee")}static{me(this,"Se")}static{fe(this,"Wt")}static{ce(this,"Aborter")}aborted=!1;abort(){this.aborted=!0}},Qh=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=qs(r,this.isSynchronous),this.root=Zr(t,r),this.state={root:_s(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new cw,options:r,queue:new lw((i,o)=>this.callbackInvoker(o,i,n)),symlinks:new Map,visited:[""].slice(0,0),controller:new uw,fs:r.fs||w0},this.joinPath=Ns(this.root,r),this.pushDirectory=Ds(this.root,r),this.pushFile=Bs(r),this.getArray=Ls(r),this.groupFiles=Ws(r),this.resolveSymlink=Fs(r,this.isSynchronous),this.walkDirectory=zs(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 E=this.joinPath(y.name,r);this.pushFile(E,m,this.state.counts,o)}else if(y.isDirectory()){let E=Ts(y.name,r,this.state.options.pathSeparator);if(l&&l(y.name,E))continue;this.pushDirectory(E,i,o),this.walkDirectory(this.state,E,E,n-1,this.walk)}else if(this.resolveSymlink&&y.isSymbolicLink()){let E=Ji(y.name,r);this.resolveSymlink(E,this.state,(j,R)=>{if(j.isDirectory()){if(R=Zr(R,this.state.options),l&&l(y.name,p?R:E+f))return;this.walkDirectory(this.state,R,p?R:E+f,n-1,this.walk)}else{R=p?R:E;const b=R0(R),w=Zr(Hc(R),this.state.options);R=this.joinPath(b,w),this.pushFile(R,m,this.state.counts,o)}})}}this.groupFiles(this.state.groups,r,m)},"walk")};function Gs(e,t){return new Promise((r,n)=>{Xi(e,t,(i,o)=>{if(i)return n(i);r(o)})})}v(Gs,"ct$2");me(Gs,"bt");fe(Gs,"Ct");ce(Gs,"promise");function Xi(e,t,r){new Qh(e,t,r).start()}v(Xi,"T$n");me(Xi,"G");fe(Xi,"x");ce(Xi,"callback");function Us(e,t){return new Qh(e,t).start()}v(Us,"ht$3");me(Us,"vt");fe(Us,"jt");ce(Us,"sync");var xf=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 Gs(this.root,this.options)}withCallback(t){Xi(this.root,this.options,t)}sync(){return Us(this.root,this.options)}};let Zh=null;try{$f.resolve("picomatch"),Zh=$f("picomatch")}catch{}var pw=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:Vh,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 xf(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,r){return this.options={...this.options,...r},new xf(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...r){const n=this.globFunction||Zh;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}},fw=Object.defineProperty,We=fe((e,t)=>fw(e,"name",{value:t,configurable:!0}),"a");const dw=Array.isArray,eg=/\\/g,tg=process.platform==="win32",mw=/^(\/?\.\.)+$/;function Ri(e,t={}){const r=e.length,n=Array(r),i=Array(r);let o,s;for(o=0;o<r;o++){const a=Yi(e[o]);n[o]=a;const l=a.length,c=Array(l);for(s=0;s<l;s++)c[s]=gr(a[s],t);i[o]=c}return a=>{const l=a.split("/");if(l[0]===".."&&mw.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(Ri,"R$j");me(Ri,"B");fe(Ri,"D");We(Ri,"getPartialMatcher");const hw=/^[A-Z]:\/$/i,gw=tg?e=>hw.test(e):e=>e==="/";function _i(e,t,r){if(e===t||t.startsWith(`${e}/`)){if(r){const i=e.length+ +!gw(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=>vr.relative(e,n)||".":n=>vr.relative(e,`${t}/${n}`)||"."}v(_i,"O$p");me(_i,"M");fe(_i,"M");We(_i,"buildFormat");function Ks(e,t){if(t.startsWith(`${e}/`)){const r=t.slice(e.length+1);return n=>`${r}/${n}`}return r=>{const n=vr.relative(e,`${t}/${r}`);return r[r.length-1]==="/"&&n!==""?`${n}/`:n||"."}}v(Ks,"pt$3");me(Ks,"St");fe(Ks,"at");We(Ks,"buildRelative");const vw={parts:!0};function Yi(e){var t;const r=gr.scan(e,vw);return!((t=r.parts)===null||t===void 0)&&t.length?r.parts:[e]}v(Yi,"I$e");me(Yi,"z");fe(Yi,"N");We(Yi,"splitPattern");const bw=/\\(?![()[\]{}!+@])/g;function ju(e){return rg(e)}v(ju,"qt$2");me(ju,"Ee");fe(ju,"ut");We(ju,"convertPosixPathToPattern");function Au(e){return ng(e).replace(bw,"/")}v(Au,"jt$3");me(Au,"Re");fe(Au,"ft");We(Au,"convertWin32PathToPattern");const yw=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,$w=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,rg=We(e=>e.replace(yw,"\\$&"),"escapePosixPath"),ng=We(e=>e.replace($w,"\\$&"),"escapeWin32Path"),xw=tg?ng:rg;function Js(e,t){if(t?.caseSensitiveMatch===!1)return!0;const r=gr.scan(e);return r.isGlob||r.negated}v(Js,"ft$2");me(Js,"Dt");fe(Js,"k");We(Js,"isDynamicPattern");function Xt(...e){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...e)}v(Xt,"D$k");me(Xt,"D");fe(Xt,"E");We(Xt,"log");function Qi(e){return typeof e=="string"?[e]:e??[]}v(Qi,"L$c");me(Qi,"U");fe(Qi,"W");We(Qi,"ensureStringArray");const ww=/^(\/?\.\.)+/,Ew=/\\(?=[()[\]{}!*+?@|])/g;function en(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=xw(o);s=C0(s.replace(Ew,""))?vr.relative(c,s):vr.normalize(s);const u=(i=ww.exec(s))===null||i===void 0?void 0:i[0],p=Yi(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=vr.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]||Js(y))break;d.push(y)}r.depthOffset=d.length,r.commonPath=d,r.root=d.length>0?vr.join(o,...d):o}return s}v(en,"j$r");me(en,"E");fe(en,"$");We(en,"normalizePattern");function Vs(e,t,r){const n=[],i=[],o=[];for(const s of e.ignore)s&&(s[0]!=="!"||s[1]==="("?i.push(en(s,e,r,!0)):o.push(s.slice(1)));for(const s of t)s&&(s[0]!=="!"||s[1]==="("?n.push(en(s,e,r,!1)):(s[1]!=="!"||s[2]==="(")&&i.push(en(s.slice(1),e,r,!0)));return{match:n,ignore:i,unignore:o}}v(Vs,"gt$3");me(Vs,"xt");fe(Vs,"St");We(Vs,"processPatterns");function Xs(e,t){const r=e.cwd,n={root:r,depthOffset:0},i=Vs(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(eg,""),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?gr(i.unignore,f):void 0,g=d?Ri(i.unignore,f):void 0,y=gr(i.match,{...f,ignore:i.ignore,onIgnore:m?O=>m(O.output)&&gr.constants.UNIGNORE:void 0}),E=gr(i.ignore,f),j=Ri(i.match,f),R=_i(r,p,o),b=o?R:_i(r,p,!0),w=i.match.length>0&&i.match.every(O=>O==="**"||O==="**/*"),h=i.ignore.length>0||d||!w?(O,k)=>{const C=b(k,!0);return C==="."||g&&g(C)?!1:!j(C)||E(C)}:void 0;let A;e.deep!==void 0&&(A=Math.round(e.deep-n.depthOffset));const _=new pw({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&&Ks(r,p)]}v(Xs,"dt$3");me(Xs,"At");fe(Xs,"vt");We(Xs,"buildCrawler");function Zi(e,t){if(t)for(let r=e.length-1;r>=0;r--)e[r]=t(e[r]);return e}v(Zi,"z$f");me(Zi,"N");fe(Zi,"U");We(Zi,"formatPaths");const Sw={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function Ys(e){const t={...Sw,...e};return t.cwd=(t.cwd instanceof URL?T0(t.cwd):Xh(t.cwd)).replace(eg,"/"),t.ignore=Qi(t.ignore),t.fs&&(t.fs={readdir:t.fs.readdir||O0,readdirSync:t.fs.readdirSync||A0,realpath:t.fs.realpath||j0,realpathSync:t.fs.realpathSync||k0,stat:t.fs.stat||S0,statSync:t.fs.statSync||E0}),t.debug&&Xt("globbing with options:",t),t}v(Ys,"yt$3");me(Ys,"_t");fe(Ys,"pt");We(Ys,"getOptions");function eo(e,t={}){var r;if(e&&t?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");const n=dw(e)||typeof e=="string",i=Qi((r=n?e:e.patterns)!==null&&r!==void 0?r:"**/*"),o=Ys(n?t:e);return i.length>0?Xs(o,i):[]}v(eo,"G$i");me(eo,"Q");fe(eo,"G");We(eo,"getCrawler");async function Qs(e,t){const[r,n]=eo(e,t);return r?Zi(await r.withPromise(),n):[]}v(Qs,"mt$4");me(Qs,"Ie");fe(Qs,"bt");We(Qs,"glob");function Ou(e,t){const[r,n]=eo(e,t);return r?Zi(r.sync(),n):[]}v(Ou,"vt$4");me(Ou,"Le");fe(Ou,"xt");We(Ou,"globSync");var kw=Object.defineProperty,jw=v((e,t)=>kw(e,"name",{value:t,configurable:!0}),"r$d"),Aw=Object.defineProperty,Ow=jw((e,t)=>Aw(e,"name",{value:t,configurable:!0}),"r"),Rw=Object.defineProperty,_w=Ow((e,t)=>Rw(e,"name",{value:t,configurable:!0}),"r");const Pw=_w(async(e,t)=>await Qs(e,t),"glob");var Cw=Object.defineProperty,Ru=v((e,t)=>Cw(e,"name",{value:t,configurable:!0}),"o$r"),Tw=Object.defineProperty,Zs=Ru((e,t)=>Tw(e,"name",{value:t,configurable:!0}),"c"),bl,wf;function _u(){if(wf)return bl;wf=1;var e=Object.defineProperty,t=Zs((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 bl=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"),bl}v(_u,"h$m");Ru(_u,"q");Zs(_u,"requireIsExtglob");var yl,Ef;function Pu(){if(Ef)return yl;Ef=1;var e=Object.defineProperty,t=Zs((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=_u(),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 yl=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"),yl}v(Pu,"y$s");Ru(Pu,"G");Zs(Pu,"requireIsGlob");var Nw=Object.defineProperty,as=v((e,t)=>Nw(e,"name",{value:t,configurable:!0}),"s$A"),Iw=Object.defineProperty,tn=as((e,t)=>Iw(e,"name",{value:t,configurable:!0}),"t");const Mw=De(import.meta.url),zn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ig=tn(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 Mw(e)},"__cjs_getBuiltinModule"),Dw=ig("path"),Bw=ig("os");var $l,Sf;function Cu(){if(Sf)return $l;Sf=1;var e=Object.defineProperty,t=tn((u,p)=>e(u,"name",{value:p,configurable:!0}),"n"),r=Pu(),n=Dw.posix.dirname,i=Bw.platform()==="win32",o="/",s=/\\/g,a=/\\([!*?|[\](){}])/g;$l=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"),as(l,"c"),tn(l,"isEnclosure"),t(l,"isEnclosure");function c(u){return/\([^()]+$/.test(u)||u[0]==="{"||u[0]==="["||/[^\\][{[]/.test(u)?!0:r(u)}return v(c,"f"),as(c,"f"),tn(c,"isGlobby"),t(c,"isGlobby"),$l}v(Cu,"d$D");as(Cu,"$");tn(Cu,"requireGlobParent");var Lw=Cu();const Ww=Gi(Lw);var Fw=Object.defineProperty,Hw=tn((e,t)=>Fw(e,"name",{value:t,configurable:!0}),"e");const qw=Hw((e,t)=>Ww(e,t),"globParent");var zw=Object.defineProperty,Gw=v((e,t)=>zw(e,"name",{value:t,configurable:!0}),"i$n"),Uw=Object.defineProperty,Kw=Gw((e,t)=>Uw(e,"name",{value:t,configurable:!0}),"r"),Jw=Object.defineProperty,Vw=Kw((e,t)=>Jw(e,"name",{value:t,configurable:!0}),"i");const kf=Vw(e=>{if(e.isFile())return"file";if(e.isDirectory())return"dir";if(e.isSymbolicLink())return"symlink"},"getFileInfoType");var Xw=Object.defineProperty,Yw=v((e,t)=>Xw(e,"name",{value:t,configurable:!0}),"i$m"),Qw=Object.defineProperty,og=Yw((e,t)=>Qw(e,"name",{value:t,configurable:!0}),"s");const Zw=De(import.meta.url),Gn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,e1=og(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 Zw(e)},"__cjs_getBuiltinModule"),{lstatSync:jf,mkdirSync:t1}=e1("node:fs");var r1=Object.defineProperty,n1=og((e,t)=>r1(e,"name",{value:t,configurable:!0}),"o");const i1=n1(e=>{Or(e);try{const t=jf(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(kf(t))}'`);return}catch(t){if(t.code!=="ENOENT")throw t}try{t1(e,{recursive:!0})}catch(t){if(t.code!=="EEXIST")throw t;const r=jf(e);if(!r.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(kf(r))}'`,{cause:t})}},"ensureDirSync");var o1=Object.defineProperty,sg=v((e,t)=>o1(e,"name",{value:t,configurable:!0}),"t$j"),s1=Object.defineProperty,ag=sg((e,t)=>s1(e,"name",{value:t,configurable:!0}),"t"),a1=Object.defineProperty,l1=ag((e,t)=>a1(e,"name",{value:t,configurable:!0}),"t");let ls=class extends Error{static{v(this,"l")}static{sg(this,"c")}static{ag(this,"i")}static{l1(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 c1=Object.defineProperty,u1=v((e,t)=>c1(e,"name",{value:t,configurable:!0}),"n$o"),p1=Object.defineProperty,lg=u1((e,t)=>p1(e,"name",{value:t,configurable:!0}),"t"),f1=Object.defineProperty,d1=lg((e,t)=>f1(e,"name",{value:t,configurable:!0}),"g");const cs=d1(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 m1=Object.defineProperty,h1=lg((e,t)=>m1(e,"name",{value:t,configurable:!0}),"n");const Yt=h1((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 g1=Object.defineProperty,cg=v((e,t)=>g1(e,"name",{value:t,configurable:!0}),"u$z"),v1=Object.defineProperty,Tu=cg((e,t)=>v1(e,"name",{value:t,configurable:!0}),"y");const b1=De(import.meta.url),Un=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,y1=Tu(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 b1(e)},"__cjs_getBuiltinModule"),{readdir:$1,realpath:x1,stat:w1}=y1("node:fs/promises");var E1=Object.defineProperty,vt=Tu((e,t)=>E1(e,"name",{value:t,configurable:!0}),"r");const S1=vt(async e=>{const t=dn(e),r=$t(t),n=await w1(t);return{isDirectory:vt(()=>n.isDirectory(),"isDirectory"),isFile:vt(()=>n.isFile(),"isFile"),isSymbolicLink:vt(()=>n.isSymbolicLink(),"isSymbolicLink"),name:r,path:t}},"_createWalkEntry");async function*to(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(Or(e),a<0)return;const c=s?s.map(p=>typeof p=="string"?cs(p):p):void 0,u=l?l.map(p=>typeof p=="string"?cs(p):p):void 0;if(e=ve(Je(e)),n&&Yt(e,t,c,u)&&(yield await S1(e)),!(a<1||!Yt(e,void 0,void 0,u)))try{const p=await $1(e,{withFileTypes:!0});for(const f of p){let d=le(e,f.name);if(f.isSymbolicLink())if(r)d=await x1(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*to(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 ls?p:new ls(p,e)}}v(to,"f$t");cg(to,"D");Tu(to,"g");vt(to,"walk");var k1=Object.defineProperty,ug=v((e,t)=>k1(e,"name",{value:t,configurable:!0}),"p$t"),j1=Object.defineProperty,Nu=ug((e,t)=>j1(e,"name",{value:t,configurable:!0}),"m");const A1=De(import.meta.url),Kn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,O1=Nu(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 A1(e)},"__cjs_getBuiltinModule"),{readdirSync:R1,realpathSync:_1,statSync:P1}=O1("node:fs");var C1=Object.defineProperty,bt=Nu((e,t)=>C1(e,"name",{value:t,configurable:!0}),"t");const T1=bt(e=>{const t=dn(e),r=P1(t);return{isDirectory:bt(()=>r.isDirectory(),"isDirectory"),isFile:bt(()=>r.isFile(),"isFile"),isSymbolicLink:bt(()=>r.isSymbolicLink(),"isSymbolicLink"),name:$t(t),path:t}},"_createWalkEntry");function*ro(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(Or(e),a<0)return;const c=s?s.map(p=>typeof p=="string"?cs(p):p):void 0,u=l?l.map(p=>typeof p=="string"?cs(p):p):void 0;if(e=ve(Je(e)),n&&Yt(e,t,c,u)&&(yield T1(e)),!(a<1||!Yt(e,void 0,void 0,u)))try{const p=R1(e,{withFileTypes:!0});for(const f of p){let d=le(e,f.name);if(f.isSymbolicLink())if(r)d=_1(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:dn(d)};continue}else continue;f.isDirectory()?yield*ro(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:dn(d)})}}catch(p){throw p instanceof ls?p:new ls(p,e)}}v(ro,"y$q");ug(ro,"F");Nu(ro,"b");bt(ro,"walkSync");var N1=Object.defineProperty,I1=v((e,t)=>N1(e,"name",{value:t,configurable:!0}),"t$h"),M1=Object.defineProperty,D1=I1((e,t)=>M1(e,"name",{value:t,configurable:!0}),"s"),B1=Object.defineProperty,L1=D1((e,t)=>B1(e,"name",{value:t,configurable:!0}),"n");const Af=L1((e,t={})=>{Array.isArray(t.extensions)||(t.extensions=["js","mjs","cjs","ts"]);const r=[];for(const n of ro(e,t))r.push(n.path);return r},"collectSync");var W1=Object.defineProperty,F1=v((e,t)=>W1(e,"name",{value:t,configurable:!0}),"p$s"),H1=Object.defineProperty,pg=F1((e,t)=>H1(e,"name",{value:t,configurable:!0}),"a");const q1=De(import.meta.url),Jn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,fg=pg(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 q1(e)},"__cjs_getBuiltinModule"),{stat:z1,lstat:G1}=fg("node:fs/promises"),{fileURLToPath:U1}=fg("node:url");var K1=Object.defineProperty,Of=pg((e,t)=>K1(e,"name",{value:t,configurable:!0}),"n");const dg=Of(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}=Sh(n),o=Je(t.stopAt??i),s=ve(n,o),a=t.type??"file",l=Of(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?z1:G1;for(;n&&n!==s&&n!==i;){const u=await l(n);for(let p of u){if(p===yh)return;if(p===void 0)continue;Buffer.isBuffer(p)?p=p.toString():p instanceof URL&&(p=U1(p));const f=Hi(p)?p:ve(n,p);try{const d=await c(f);if(a==="file"&&d.isFile()||a==="directory"&&d.isDirectory())return f}catch{}}n=Te(n)}},"findUp");var J1=Object.defineProperty,V1=v((e,t)=>J1(e,"name",{value:t,configurable:!0}),"u$x"),X1=Object.defineProperty,mg=V1((e,t)=>X1(e,"name",{value:t,configurable:!0}),"i");const Y1=De(import.meta.url),Vn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,hg=mg(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 Y1(e)},"__cjs_getBuiltinModule"),{statSync:Q1,lstatSync:Z1}=hg("node:fs"),{fileURLToPath:eE}=hg("node:url");var tE=Object.defineProperty,Rf=mg((e,t)=>tE(e,"name",{value:t,configurable:!0}),"o");const gg=Rf((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}=Sh(n),o=Je(t.stopAt??i),s=ve(n,o),a=t.type??"file",l=Rf(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?Q1:Z1;for(;n&&n!==s&&n!==i;){for(let u of l(n)){if(u===yh)return;if(u===void 0)continue;Buffer.isBuffer(u)?u=u.toString():u instanceof URL&&(u=eE(u));const p=Hi(u)?u:ve(n,u);try{const f=c(p);if(a==="file"&&f.isFile()||a==="directory"&&f.isDirectory())return p}catch{}}n=Te(n)}},"findUpSync");var rE=Object.defineProperty,jn=v((e,t)=>rE(e,"name",{value:t,configurable:!0}),"r$a"),nE=Object.defineProperty,An=jn((e,t)=>nE(e,"name",{value:t,configurable:!0}),"r"),iE=Object.defineProperty,gn=An((e,t)=>iE(e,"name",{value:t,configurable:!0}),"t");function no(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}v(no,"p$r");jn(no,"f");An(no,"getDefaultExportFromCjs");gn(no,"getDefaultExportFromCjs");function Iu(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}v(Iu,"f$s");jn(Iu,"l");An(Iu,"getDefaultExportFromNamespaceIfPresent");gn(Iu,"getDefaultExportFromNamespaceIfPresent");function Mu(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")&&Object.keys(e).length===1?e.default:e}v(Mu,"l$v");jn(Mu,"s");An(Mu,"getDefaultExportFromNamespaceIfNotNamed");gn(Mu,"getDefaultExportFromNamespaceIfNotNamed");function Du(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=gn(An(jn(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:gn(function(){return e[n]},"get")})}),r}v(Du,"s$u");jn(Du,"m");An(Du,"getAugmentedNamespace");gn(Du,"getAugmentedNamespace");var oE=Object.defineProperty,or=v((e,t)=>oE(e,"name",{value:t,configurable:!0}),"lt$3"),sE=Object.defineProperty,wt=or((e,t)=>sE(e,"name",{value:t,configurable:!0}),"ut"),_f={},xl,Pf;function On(){if(Pf)return xl;Pf=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}*?`,E="/",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:E},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 xl={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(w){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${w.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(w){return w===!0?R:j}},xl}v(On,"_t$3");or(On,"bt");wt(On,"requireConstants");var Cf;function Rn(){return Cf||(Cf=1,(function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:r,REGEX_SPECIAL_CHARS:n,REGEX_SPECIAL_CHARS_GLOBAL:i}=On();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}})(_f)),_f}v(Rn,"Et$3");or(Rn,"yt");wt(Rn,"requireUtils");var wl,Tf;function Bu(){if(Tf)return wl;Tf=1;var e=Object.defineProperty,t=wt((b,w)=>e(b,"name",{value:w,configurable:!0}),"k");const r=Rn(),{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:E}=On(),j=t(b=>b===c||b===o,"isPathSeparator"),R=t(b=>{b.isPrefix!==!0&&(b.depth=b.isGlobstar?1/0:1)},"depth");return wl=t((b,w)=>{const h=w||{},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===E){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,x="",S="";q>0&&(x=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:x,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],Pe=b.slice(ye,$e);h.tokens&&(ie===0&&q!==0?(k[ie].isPrefix=!0,k[ie].value=x):k[ie].value=Pe,R(k[ie]),we.maxDepth+=k[ie].depth),(ie!==0||Pe!=="")&&C.push(Pe),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"),wl}v(Bu,"Nt$3");or(Bu,"wt");wt(Bu,"requireScan");var El,Nf;function Lu(){if(Nf)return El;Nf=1;var e=Object.defineProperty,t=wt((b,w)=>e(b,"name",{value:w,configurable:!0}),"y");const r=On(),n=Rn(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:o,REGEX_NON_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_BACKREF:a,REPLACEMENTS:l}=r,c=t((b,w)=>typeof w.expandRange=="function"?w.expandRange(...b,w):(b.sort(),`[${b.join("-")}]`),"expandRange"),u=t((b,w)=>`Missing ${b}: "${w}" - use "\\\\${w}" to match literal characters`,"syntaxError"),p=t(b=>{const w=[];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){w.push(O),O="";continue}}}O+=C}return w.push(O),w},"splitTopLevel"),f=t(b=>{let w=!1;for(const h of b){if(w===!0){w=!1;continue}if(h==="\\"){w=!0;continue}if(/[?*+@!()[\]{}]/.test(h))return!1}return!0},"isPlainBranch"),d=t(b=>{let w=b.trim(),h=!0;for(;h===!0;)h=!1,/^@\([^\\()[\]{}|]+\)$/.test(w)&&(w=w.slice(2,-1),h=!0);if(f(w))return w.replace(/\\(.)/g,"$1")},"normalizeSimpleBranch"),m=t(b=>{const w=b.map(d).filter(Boolean);for(let h=0;h<w.length;h++)for(let A=h+1;A<w.length;A++){const _=w[h],O=w[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,w=!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 w===!0&&k!==b.length-1?void 0:{type:b[0],body:b.slice(2,k),end:k}}}}},"parseRepeatedExtglob"),y=t(b=>{let w=0;const h=[];for(;w<b.length;){const A=g(b.slice(w),!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),w+=A.end+1}return h.length<1?void 0:`${h.length===1?n.escapeRegex(h[0]):`[${h.map(A=>n.escapeRegex(A)).join("")}]`}*`},"getStarExtglobSequenceOutput"),E=t(b=>{let w=0,h=b.trim(),A=g(h);for(;A;)w++,h=A.body.trim(),A=g(h);return w},"repeatedExtglobRecursion"),j=t((b,w)=>{if(w.maxExtglobRecursion===!1)return{risky:!1};const h=typeof w.maxExtglobRecursion=="number"?w.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(E(_)>h)return{risky:!0}}return{risky:!1}},"analyzeRepeatedExtglob"),R=t((b,w)=>{if(typeof b!="string")throw new TypeError("Expected a string");b=l[b]||b;const h={...w},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 x=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"),Pe=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"),nt=t(T=>{$[T]++,se.push(T)},"increment"),_e=t(T=>{$[T]--,se.pop()},"decrement"),H=t(T=>{if(x.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,-x.output.length),x.type="star",x.value="*",x.output=D,$.output+=x.output)}if(ge.length&&T.type!=="paren"&&(ge[ge.length-1].inner+=T.value),(T.value||T.output)&&Pe(T),x&&x.type==="text"&&T.type==="text"){x.output=(x.output||x.value)+T.value,x.value+=T.value;return}T.prev=x,k.push(T),x=T},"push"),it=t((T,ee)=>{const P={...J[ee],conditions:1,inner:""};P.prev=x,P.parens=$.parens,P.output=$.output,P.startIndex=$.index,P.tokensIndex=k.length;const G=(h.capture?"(":"")+P.open;nt("parens"),H({type:T,value:ee,output:$.output?"":re}),H({type:"paren",extglob:!0,value:ie(),output:G}),ge.push(P)},"extglobOpen"),Fn=t(T=>{const ee=b.slice(T.startIndex,$.index+1),P=b.slice(T.startIndex+2,$.index),G=j(P,h);if((T.type==="plus"||T.type==="star")&&G.risky){const Z=G.safeOutput?(T.output?"":re)+(h.capture?`(${G.safeOutput})`:G.safeOutput):void 0,Se=k[T.tokensIndex];Se.type="text",Se.value=ee,Se.output=Z||n.escapeRegex(ee);for(let ke=T.tokensIndex+1;ke<k.length;ke++)k[ke].value="",k[ke].output="",delete k[ke].suffix;$.output=T.output+Se.output,$.backtrack=!0,H({type:"paren",extglob:!0,value:S,output:""}),_e("parens");return}let ne=T.close+(h.capture?")":""),ae;if(T.type==="negate"){let Z=D;if(T.inner&&T.inner.length>1&&T.inner.includes("/")&&(Z=z(h)),(Z!==D||we()||/^\)+$/.test(ye()))&&(ne=T.close=`)$))${Z}`),T.inner.includes("*")&&(ae=ye())&&/^\.[^\\/.]+$/.test(ae)){const Se=R(ae,{...w,fastpaths:!1}).output;ne=T.close=`)${Se})${Z})`}T.prev.type==="bos"&&($.negatedExtglob=!0)}H({type:"paren",extglob:!0,value:S,output:ne}),_e("parens")},"extglobClose");if(h.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(b)){let T=!1,ee=b.replace(a,(P,G,ne,ae,Z,Se)=>ae==="\\"?(T=!0,P):ae==="?"?G?G+ae+(Z?N.repeat(Z.length):""):Se===0?L+(Z?N.repeat(Z.length):""):N.repeat(ne.length):ae==="."?q.repeat(ne.length):ae==="*"?G?G+ae+(Z?D:""):D:G?P:`\\${P}`);return T===!0&&(h.unescape===!0?ee=ee.replace(/\\/g,""):ee=ee.replace(/\\+/g,P=>P.length%2===0?"\\\\":P?"\\":"")),ee===b&&h.contains===!0?($.output=b,$):($.output=n.wrapOutput(ee,$,w),$)}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!=="]"||x.value==="["||x.value==="[^")){if(h.posix!==!1&&S===":"){const P=x.value.slice(1);if(P.includes("[")&&(x.posix=!0,P.includes(":"))){const G=x.value.lastIndexOf("["),ne=x.value.slice(0,G),ae=x.value.slice(G+2),Z=o[ae];if(Z){x.value=ne+Z,$.backtrack=!0,ie(),!O.output&&k.indexOf(x)===1&&(O.output=re);continue}}}(S==="["&&Q()!==":"||S==="-"&&Q()==="]")&&(S=`\\${S}`),S==="]"&&(x.value==="["||x.value==="[^")&&(S=`\\${S}`),h.posix===!0&&S==="!"&&x.value==="["&&(S="^"),x.value+=S,Pe({value:S});continue}if($.quotes===1&&S!=='"'){S=n.escapeRegex(S),x.value+=S,Pe({value:S});continue}if(S==='"'){$.quotes=$.quotes===1?0:1,h.keepQuotes===!0&&H({type:"text",value:S});continue}if(S==="("){nt("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){Fn(ge.pop());continue}H({type:"paren",value:S,output:$.parens?")":"\\)"}),_e("parens");continue}if(S==="["){if(h.nobracket===!0||!ye().includes("]")){if(h.nobracket!==!0&&h.strictBrackets===!0)throw new SyntaxError(u("closing","]"));S=`\\${S}`}else nt("brackets");H({type:"bracket",value:S});continue}if(S==="]"){if(h.nobracket===!0||x&&x.type==="bracket"&&x.value.length===1){H({type:"text",value:S,output:`\\${S}`});continue}if($.brackets===0){if(h.strictBrackets===!0)throw new SyntaxError(u("opening","["));H({type:"text",value:S,output:`\\${S}`});continue}_e("brackets");const P=x.value.slice(1);if(x.posix!==!0&&P[0]==="^"&&!P.includes("/")&&(S=`/${S}`),x.value+=S,Pe({value:S}),h.literalBrackets===!1||n.hasRegexChars(P))continue;const G=n.escapeRegex(x.value);if($.output=$.output.slice(0,-x.value.length),h.literalBrackets===!0){$.output+=G,x.value=G;continue}x.value=`(${C}${G}|${x.value})`,$.output+=x.value;continue}if(S==="{"&&h.nobrace!==!0){nt("braces");const P={type:"brace",value:S,output:"(",outputIndex:$.output.length,tokensIndex:$.tokens.length};pe.push(P),H(P);continue}if(S==="}"){const P=pe[pe.length-1];if(h.nobrace===!0||!P){H({type:"text",value:S,output:S});continue}let G=")";if(P.dots===!0){const ne=k.slice(),ae=[];for(let Z=ne.length-1;Z>=0&&(k.pop(),ne[Z].type!=="brace");Z--)ne[Z].type!=="dots"&&ae.unshift(ne[Z].value);G=c(ae,h),$.backtrack=!0}if(P.comma!==!0&&P.dots!==!0){const ne=$.output.slice(0,P.outputIndex),ae=$.tokens.slice(P.tokensIndex);P.value=P.output="\\{",S=G="\\}",$.output=ne;for(const Z of ae)$.output+=Z.output||Z.value}H({type:"brace",value:S,output:G}),_e("braces"),pe.pop();continue}if(S==="|"){ge.length>0&&ge[ge.length-1].conditions++,H({type:"text",value:S});continue}if(S===","){let P=S;const G=pe[pe.length-1];G&&se[se.length-1]==="braces"&&(G.comma=!0,P="|"),H({type:"comma",value:S,output:P});continue}if(S==="/"){if(x.type==="dot"&&$.index===$.start+1){$.start=$.index+1,$.consumed="",$.output="",k.pop(),x=O;continue}H({type:"slash",value:S,output:te});continue}if(S==="."){if($.braces>0&&x.type==="dot"){x.value==="."&&(x.output=q);const P=pe[pe.length-1];x.type="dots",x.output+=S,x.value+=S,P.dots=!0;continue}if($.braces+$.parens===0&&x.type!=="bos"&&x.type!=="slash"){H({type:"text",value:S,output:q});continue}H({type:"dot",value:S,output:q});continue}if(S==="?"){if(!(x&&x.value==="(")&&h.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){it("qmark",S);continue}if(x&&x.type==="paren"){const P=Q();let G=S;(x.value==="("&&!/[!=<:]/.test(P)||P==="<"&&!/<([!=]|\w+>)/.test(ye()))&&(G=`\\${S}`),H({type:"text",value:S,output:G});continue}if(h.dot!==!0&&(x.type==="slash"||x.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)))){it("negate",S);continue}if(h.nonegate!==!0&&$.index===0){Bt();continue}}if(S==="+"){if(h.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){it("plus",S);continue}if(x&&x.value==="("||h.regex===!1){H({type:"plus",value:S,output:X});continue}if(x&&(x.type==="bracket"||x.type==="paren"||x.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(x&&(x.type==="globstar"||x.star===!0)){x.type="star",x.star=!0,x.value+=S,x.output=D,$.backtrack=!0,$.globstar=!0,$e(S);continue}let T=ye();if(h.noextglob!==!0&&/^\([^?]/.test(T)){it("star",S);continue}if(x.type==="star"){if(h.noglobstar===!0){$e(S);continue}const P=x.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()){x.type="globstar",x.value+=S,x.output=z(h),$.output=x.output,$.globstar=!0,$e(S);continue}if(P.type==="slash"&&P.prev.type!=="bos"&&!ae&&we()){$.output=$.output.slice(0,-(P.output+x.output).length),P.output=`(?:${P.output}`,x.type="globstar",x.output=z(h)+(h.strictSlashes?")":"|$)"),x.value+=S,$.globstar=!0,$.output+=P.output+x.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+x.output).length),P.output=`(?:${P.output}`,x.type="globstar",x.output=`${z(h)}${te}|${te}${ke})`,x.value+=S,$.output+=P.output+x.output,$.globstar=!0,$e(S+ie()),H({type:"slash",value:"/",output:""});continue}if(P.type==="bos"&&T[0]==="/"){x.type="globstar",x.value+=S,x.output=`(?:^|${te}|${z(h)}${te})`,$.output=x.output,$.globstar=!0,$e(S+ie()),H({type:"slash",value:"/",output:""});continue}if(Z&&T[0]==="/"){x.type="globstar",x.value+=S,x.output=`(?:^|${te}|${z(h)}${te})`,$.output+=x.output,$.globstar=!0,$e(S+ie()),H({type:"slash",value:"/",output:""});continue}$.output=$.output.slice(0,-x.output.length),x.type="globstar",x.output=z(h),x.value+=S,$.output+=x.output,$.globstar=!0,$e(S);continue}const ee={type:"star",value:S,output:D};if(h.bash===!0){ee.output=".*?",(x.type==="bos"||x.type==="slash")&&(ee.output=Y+ee.output),H(ee);continue}if(x&&(x.type==="bracket"||x.type==="paren")&&h.regex===!0){ee.output=S,H(ee);continue}($.index===$.start||x.type==="slash"||x.type==="dot")&&(x.type==="dot"?($.output+=K,x.output+=K):h.dot===!0?($.output+=F,x.output+=F):($.output+=Y,x.output+=Y),Q()!=="*"&&($.output+=re,x.output+=re)),H(ee)}for(;$.brackets>0;){if(h.strictBrackets===!0)throw new SyntaxError(u("closing","]"));$.output=n.escapeLast($.output,"["),_e("brackets")}for(;$.parens>0;){if(h.strictBrackets===!0)throw new SyntaxError(u("closing",")"));$.output=n.escapeLast($.output,"("),_e("parens")}for(;$.braces>0;){if(h.strictBrackets===!0)throw new SyntaxError(u("closing","}"));$.output=n.escapeLast($.output,"{"),_e("braces")}if(h.strictSlashes!==!0&&(x.type==="star"||x.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,w)=>{const h={...w},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},El=R,El}v(Lu,"It$3");or(Lu,"Bt");wt(Lu,"requireParse");var Sl,If;function Wu(){if(If)return Sl;If=1;var e=Object.defineProperty,t=wt((l,c)=>e(l,"name",{value:c,configurable:!0}),"h");const r=Bu(),n=Lu(),i=Rn(),o=On(),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 w=b(R);if(w)return w}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 E=t((j,R=!1)=>{const{isMatch:b,match:w,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:w,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&&(E.state=g),E},"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,Sl=a,Sl}v(Wu,"wt$2");or(Wu,"Gt");wt(Wu,"requirePicomatch$1");var kl,Mf;function Fu(){if(Mf)return kl;Mf=1;var e=Object.defineProperty,t=wt((o,s)=>e(o,"name",{value:s,configurable:!0}),"c");const r=Wu(),n=Rn();function i(o,s,a=!1){return s&&(s.windows===null||s.windows===void 0)&&(s={...s,windows:n.isWindows()}),r(o,s,a)}return v(i,"D"),or(i,"D"),wt(i,"picomatch"),t(i,"picomatch"),Object.assign(i,r),kl=i,kl}v(Fu,"Pt$3");or(Fu,"Mt");wt(Fu,"requirePicomatch");var aE=Fu();const br=no(aE);var lE=Object.defineProperty,he=v((e,t)=>lE(e,"name",{value:t,configurable:!0}),"u$w"),cE=Object.defineProperty,de=he((e,t)=>cE(e,"name",{value:t,configurable:!0}),"l");const uE=De(import.meta.url),Xn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,io=de(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 uE(e)},"__cjs_getBuiltinModule"),Df=io("fs"),pE={...Df,default:Df},{statSync:fE,stat:dE,realpathSync:mE,realpath:hE,readdirSync:gE,readdir:vE}=io("fs"),{sep:vg,basename:bE,dirname:qc,resolve:bg,normalize:yE,relative:$E,posix:yr,isAbsolute:xE}=io("path"),{fileURLToPath:wE}=io("url"),{createRequire:EE}=io("module");var SE=Object.defineProperty,ue=de((e,t)=>SE(e,"name",{value:t,configurable:!0}),"r"),Bf=EE(import.meta.url);function ea(e){let t=yE(e);return t.length>1&&t[t.length-1]===vg&&(t=t.substring(0,t.length-1)),t}v(ea,"H$c");he(ea,"tt");de(ea,"M$1");ue(ea,"cleanPath");const kE=/[\\/]/g;function oo(e,t){return e.replace(kE,t)}v(oo,"M$h");he(oo,"T");de(oo,"D$1");ue(oo,"convertSlashes");const jE=/^[a-z]:[\\/]$/i;function ta(e){return e==="/"||jE.test(e)}v(ta,"J$d");he(ta,"et");de(ta,"T$1");ue(ta,"isRootDirectory");function rn(e,t){const{resolvePaths:r,normalizePath:n,pathSeparator:i}=t,o=process.platform==="win32"&&e.includes("/")||e.startsWith(".");if(r&&(e=bg(e)),(n||o)&&(e=ea(e)),e===".")return"";const s=e[e.length-1]!==i;return oo(s?e+i:e,i)}v(rn,"q$j");he(rn,"q");de(rn,"w");ue(rn,"normalizePath");function so(e,t){return t+e}v(so,"B$j");he(so,"I");de(so,"P");ue(so,"joinPathWithBasePath");function ra(e,t){return function(r,n){return n.startsWith(e)?n.slice(e.length)+r:oo($E(e,n),t.pathSeparator)+t.pathSeparator+r}}v(ra,"K$c");he(ra,"st");de(ra,"X");ue(ra,"joinPathWithRelativePath");function na(e){return e}v(na,"V$c");he(na,"rt");de(na,"H");ue(na,"joinPath");function ia(e,t,r){return t+e+r}v(ia,"X$c");he(ia,"nt");de(ia,"U$1");ue(ia,"joinDirectoryPath");function oa(e,t){const{relativePaths:r,includeBasePath:n}=t;return r&&e?ra(e,t):n?so:na}v(oa,"Z$c");he(oa,"it");de(oa,"J");ue(oa,"build$7");function sa(e){return function(t,r){r.push(t.substring(e.length)||".")}}v(sa,"tt$2");he(sa,"ot");de(sa,"K$1");ue(sa,"pushDirectoryWithRelativePath");function aa(e){return function(t,r,n){const i=t.substring(e.length)||".";n.every(o=>o(i,!0))&&r.push(i)}}v(aa,"et$2");he(aa,"ut");de(aa,"V");ue(aa,"pushDirectoryFilterWithRelativePath");const AE=ue((e,t)=>{t.push(e||".")},"pushDirectory"),OE=ue((e,t,r)=>{const n=e||".";r.every(i=>i(n,!0))&&t.push(n)},"pushDirectoryFilter"),RE=ue(()=>{},"empty$2");function la(e,t){const{includeDirs:r,filters:n,relativePaths:i}=t;return r?i?n&&n.length?aa(e):sa(e):n&&n.length?OE:AE:RE}v(la,"st$2");he(la,"lt");de(la,"st$1");ue(la,"build$6");const _E=ue((e,t,r,n)=>{n.every(i=>i(e,!1))&&r.files++},"pushFileFilterAndCount"),PE=ue((e,t,r,n)=>{n.every(i=>i(e,!1))&&t.push(e)},"pushFileFilter"),CE=ue((e,t,r,n)=>{r.files++},"pushFileCount"),TE=ue((e,t)=>{t.push(e)},"pushFile"),NE=ue(()=>{},"empty$1");function ca(e){const{excludeFiles:t,filters:r,onlyCounts:n}=e;return t?NE:r&&r.length?n?_E:PE:n?CE:TE}v(ca,"it$2");he(ca,"at");de(ca,"ut$1");ue(ca,"build$5");const IE=ue(e=>e,"getArray"),ME=ue(()=>[""].slice(0,0),"getArrayGroup");function ua(e){return e.group?ME:IE}v(ua,"nt$1");he(ua,"ct");de(ua,"ct$1");ue(ua,"build$4");const DE=ue((e,t,r)=>{e.push({directory:t,files:r,dir:t})},"groupFiles"),BE=ue(()=>{},"empty");function pa(e){return e.group?DE:BE}v(pa,"rt$2");he(pa,"ht");de(pa,"ft$1");ue(pa,"build$3");const LE=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()&&ao(e,a,t))return n.dequeue(null,t);r(c,a),n.dequeue(null,t)})})},"resolveSymlinksAsync"),WE=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()&&ao(e,s,t))return;r(a,s)}catch(s){if(!o)throw s}},"resolveSymlinks");function fa(e,t){return!e.resolveSymlinks||e.excludeSymlinks?null:t?WE:LE}v(fa,"ot$2");he(fa,"pt");de(fa,"gt$1");ue(fa,"build$2");function ao(e,t,r){if(r.options.useRealPaths)return da(t,r);let n=qc(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=qc(n)}return r.symlinks.set(e,t),i>1}v(ao,"_$j");he(ao,"L");de(ao,"E$1");ue(ao,"isRecursive");function da(e,t){return t.visited.includes(e+t.options.pathSeparator)}v(da,"lt$2");he(da,"ft");de(da,"dt$1");ue(da,"isRecursiveUsingRealPaths");const FE=ue(e=>e.counts,"onlyCountsSync"),HE=ue(e=>e.groups,"groupsSync"),qE=ue(e=>e.paths,"defaultSync"),zE=ue(e=>e.paths.slice(0,e.options.maxFiles),"limitFilesSync"),GE=ue((e,t,r)=>(_r(t,r,e.counts,e.options.suppressErrors),null),"onlyCountsAsync"),UE=ue((e,t,r)=>(_r(t,r,e.paths,e.options.suppressErrors),null),"defaultAsync"),KE=ue((e,t,r)=>(_r(t,r,e.paths.slice(0,e.options.maxFiles),e.options.suppressErrors),null),"limitFilesAsync"),JE=ue((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$g");he(_r,"j");de(_r,"y");ue(_r,"report");function ma(e,t){const{onlyCounts:r,group:n,maxFiles:i}=e;return r?t?FE:GE:n?t?HE:JE:i?t?zE:KE:t?qE:UE}v(ma,"at$2");he(ma,"gt");de(ma,"Et");ue(ma,"build$1");const yg={withFileTypes:!0},VE=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||".",yg,(s,a=[])=>{i(a,r,n),e.queue.dequeue(e.options.suppressErrors?null:s,e)})},"walkAsync"),XE=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||".",yg)}catch(a){if(!e.options.suppressErrors)throw a}i(s,r,n)},"walkSync");function ha(e){return e?XE:VE}v(ha,"ut$2");he(ha,"yt");de(ha,"xt$1");ue(ha,"build");var YE=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))}},QE=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}},ZE=class{static{v(this,"Ee")}static{he(this,"Se")}static{de(this,"Wt")}static{ue(this,"Aborter")}aborted=!1;abort(){this.aborted=!0}},$g=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=ma(r,this.isSynchronous),this.root=rn(t,r),this.state={root:ta(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new QE,options:r,queue:new YE((i,o)=>this.callbackInvoker(o,i,n)),symlinks:new Map,visited:[""].slice(0,0),controller:new ZE,fs:r.fs||pE},this.joinPath=oa(this.root,r),this.pushDirectory=la(this.root,r),this.pushFile=ca(r),this.getArray=ua(r),this.groupFiles=pa(r),this.resolveSymlink=fa(r,this.isSynchronous),this.walkDirectory=ha(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 E=this.joinPath(y.name,r);this.pushFile(E,m,this.state.counts,o)}else if(y.isDirectory()){let E=ia(y.name,r,this.state.options.pathSeparator);if(l&&l(y.name,E))continue;this.pushDirectory(E,i,o),this.walkDirectory(this.state,E,E,n-1,this.walk)}else if(this.resolveSymlink&&y.isSymbolicLink()){let E=so(y.name,r);this.resolveSymlink(E,this.state,(j,R)=>{if(j.isDirectory()){if(R=rn(R,this.state.options),l&&l(y.name,p?R:E+f))return;this.walkDirectory(this.state,R,p?R:E+f,n-1,this.walk)}else{R=p?R:E;const b=bE(R),w=rn(qc(R),this.state.options);R=this.joinPath(b,w),this.pushFile(R,m,this.state.counts,o)}})}}this.groupFiles(this.state.groups,r,m)},"walk")};function ga(e,t){return new Promise((r,n)=>{lo(e,t,(i,o)=>{if(i)return n(i);r(o)})})}v(ga,"ct$1");he(ga,"bt");de(ga,"Ct");ue(ga,"promise");function lo(e,t,r){new $g(e,t,r).start()}v(lo,"T$k");he(lo,"G");de(lo,"x");ue(lo,"callback");function va(e,t){return new $g(e,t).start()}v(va,"ht$2");he(va,"vt");de(va,"jt");ue(va,"sync");var Lf=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 ga(this.root,this.options)}withCallback(t){lo(this.root,this.options,t)}sync(){return va(this.root,this.options)}};let xg=null;try{Bf.resolve("picomatch"),xg=Bf("picomatch")}catch{}var eS=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:vg,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 Lf(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,r){return this.options={...this.options,...r},new Lf(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...r){const n=this.globFunction||xg;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}},tS=Object.defineProperty,Fe=de((e,t)=>tS(e,"name",{value:t,configurable:!0}),"a");const rS=Array.isArray,wg=/\\/g,Eg=process.platform==="win32",nS=/^(\/?\.\.)+$/;function Pi(e,t={}){const r=e.length,n=Array(r),i=Array(r);let o,s;for(o=0;o<r;o++){const a=co(e[o]);n[o]=a;const l=a.length,c=Array(l);for(s=0;s<l;s++)c[s]=br(a[s],t);i[o]=c}return a=>{const l=a.split("/");if(l[0]===".."&&nS.test(a))return!0;for(o=0;o<r;o++){const c=n[o],u=i[o],p=l.length,f=Math.min(p,c.length);for(s=0;s<f;){const d=c[s];if(d.includes("/"))return!0;if(!u[s](l[s]))break;if(!t.noglobstar&&d==="**")return!0;s++}if(s===p)return!0}return!1}}v(Pi,"R$g");he(Pi,"B");de(Pi,"D");Fe(Pi,"getPartialMatcher");const iS=/^[A-Z]:\/$/i,oS=Eg?e=>iS.test(e):e=>e==="/";function Ci(e,t,r){if(e===t||t.startsWith(`${e}/`)){if(r){const i=e.length+ +!oS(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=>yr.relative(e,n)||".":n=>yr.relative(e,`${t}/${n}`)||"."}v(Ci,"O$j");he(Ci,"M");de(Ci,"M");Fe(Ci,"buildFormat");function ba(e,t){if(t.startsWith(`${e}/`)){const r=t.slice(e.length+1);return n=>`${r}/${n}`}return r=>{const n=yr.relative(e,`${t}/${r}`);return r[r.length-1]==="/"&&n!==""?`${n}/`:n||"."}}v(ba,"pt$2");he(ba,"St");de(ba,"at");Fe(ba,"buildRelative");const sS={parts:!0};function co(e){var t;const r=br.scan(e,sS);return!((t=r.parts)===null||t===void 0)&&t.length?r.parts:[e]}v(co,"I$d");he(co,"z");de(co,"N");Fe(co,"splitPattern");const aS=/\\(?![()[\]{}!+@])/g;function Hu(e){return Sg(e)}v(Hu,"qt$1");he(Hu,"Ee");de(Hu,"ut");Fe(Hu,"convertPosixPathToPattern");function qu(e){return kg(e).replace(aS,"/")}v(qu,"jt$2");he(qu,"Re");de(qu,"ft");Fe(qu,"convertWin32PathToPattern");const lS=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,cS=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,Sg=Fe(e=>e.replace(lS,"\\$&"),"escapePosixPath"),kg=Fe(e=>e.replace(cS,"\\$&"),"escapeWin32Path"),uS=Eg?kg:Sg;function ya(e,t){if(t?.caseSensitiveMatch===!1)return!0;const r=br.scan(e);return r.isGlob||r.negated}v(ya,"ft$1");he(ya,"Dt");de(ya,"k");Fe(ya,"isDynamicPattern");function Qt(...e){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...e)}v(Qt,"D$j");he(Qt,"D");de(Qt,"E");Fe(Qt,"log");function uo(e){return typeof e=="string"?[e]:e??[]}v(uo,"L$a");he(uo,"U");de(uo,"W");Fe(uo,"ensureStringArray");const pS=/^(\/?\.\.)+/,fS=/\\(?=[()[\]{}!*+?@|])/g;function nn(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=uS(o);s=xE(s.replace(fS,""))?yr.relative(c,s):yr.normalize(s);const u=(i=pS.exec(s))===null||i===void 0?void 0:i[0],p=co(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=yr.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]||ya(y))break;d.push(y)}r.depthOffset=d.length,r.commonPath=d,r.root=d.length>0?yr.join(o,...d):o}return s}v(nn,"j$n");he(nn,"E");de(nn,"$");Fe(nn,"normalizePattern");function $a(e,t,r){const n=[],i=[],o=[];for(const s of e.ignore)s&&(s[0]!=="!"||s[1]==="("?i.push(nn(s,e,r,!0)):o.push(s.slice(1)));for(const s of t)s&&(s[0]!=="!"||s[1]==="("?n.push(nn(s,e,r,!1)):(s[1]!=="!"||s[2]==="(")&&i.push(nn(s.slice(1),e,r,!0)));return{match:n,ignore:i,unignore:o}}v($a,"gt$2");he($a,"xt");de($a,"St");Fe($a,"processPatterns");function xa(e,t){const r=e.cwd,n={root:r,depthOffset:0},i=$a(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(wg,""),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?br(i.unignore,f):void 0,g=d?Pi(i.unignore,f):void 0,y=br(i.match,{...f,ignore:i.ignore,onIgnore:m?O=>m(O.output)&&br.constants.UNIGNORE:void 0}),E=br(i.ignore,f),j=Pi(i.match,f),R=Ci(r,p,o),b=o?R:Ci(r,p,!0),w=i.match.length>0&&i.match.every(O=>O==="**"||O==="**/*"),h=i.ignore.length>0||d||!w?(O,k)=>{const C=b(k,!0);return C==="."||g&&g(C)?!1:!j(C)||E(C)}:void 0;let A;e.deep!==void 0&&(A=Math.round(e.deep-n.depthOffset));const _=new eS({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&&ba(r,p)]}v(xa,"dt$1");he(xa,"At");de(xa,"vt");Fe(xa,"buildCrawler");function po(e,t){if(t)for(let r=e.length-1;r>=0;r--)e[r]=t(e[r]);return e}v(po,"z$e");he(po,"N");de(po,"U");Fe(po,"formatPaths");const dS={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function wa(e){const t={...dS,...e};return t.cwd=(t.cwd instanceof URL?wE(t.cwd):bg(t.cwd)).replace(wg,"/"),t.ignore=uo(t.ignore),t.fs&&(t.fs={readdir:t.fs.readdir||vE,readdirSync:t.fs.readdirSync||gE,realpath:t.fs.realpath||hE,realpathSync:t.fs.realpathSync||mE,stat:t.fs.stat||dE,statSync:t.fs.statSync||fE}),t.debug&&Qt("globbing with options:",t),t}v(wa,"yt$2");he(wa,"_t");de(wa,"pt");Fe(wa,"getOptions");function fo(e,t={}){var r;if(e&&t?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");const n=rS(e)||typeof e=="string",i=uo((r=n?e:e.patterns)!==null&&r!==void 0?r:"**/*"),o=wa(n?t:e);return i.length>0?xa(o,i):[]}v(fo,"G$f");he(fo,"Q");de(fo,"G");Fe(fo,"getCrawler");async function zu(e,t){const[r,n]=fo(e,t);return r?po(await r.withPromise(),n):[]}v(zu,"mt$2");he(zu,"Ie");de(zu,"bt");Fe(zu,"glob");function Ea(e,t){const[r,n]=fo(e,t);return r?po(r.sync(),n):[]}v(Ea,"vt$2");he(Ea,"Le");de(Ea,"xt");Fe(Ea,"globSync");var mS=Object.defineProperty,hS=v((e,t)=>mS(e,"name",{value:t,configurable:!0}),"r$9"),gS=Object.defineProperty,vS=hS((e,t)=>gS(e,"name",{value:t,configurable:!0}),"a"),bS=Object.defineProperty,yS=vS((e,t)=>bS(e,"name",{value:t,configurable:!0}),"n");const jg=yS((e,t)=>Ea(e,t),"globSync");var $S=Object.defineProperty,Gu=v((e,t)=>$S(e,"name",{value:t,configurable:!0}),"o$k"),xS=Object.defineProperty,Sa=Gu((e,t)=>xS(e,"name",{value:t,configurable:!0}),"c"),jl,Wf;function Uu(){if(Wf)return jl;Wf=1;var e=Object.defineProperty,t=Sa((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 jl=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"),jl}v(Uu,"h$k");Gu(Uu,"q");Sa(Uu,"requireIsExtglob");var Al,Ff;function Ku(){if(Ff)return Al;Ff=1;var e=Object.defineProperty,t=Sa((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=Uu(),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 Al=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"),Al}v(Ku,"y$o");Gu(Ku,"G");Sa(Ku,"requireIsGlob");var wS=Object.defineProperty,Ag=v((e,t)=>wS(e,"name",{value:t,configurable:!0}),"t$f"),ES=Object.defineProperty,Ju=Ag((e,t)=>ES(e,"name",{value:t,configurable:!0}),"s");const SS=De(import.meta.url),Yn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,kS=Ju(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 SS(e)},"__cjs_getBuiltinModule"),{access:jS}=kS("node:fs/promises");var AS=Object.defineProperty,OS=Ju((e,t)=>AS(e,"name",{value:t,configurable:!0}),"o");async function Ze(e,t=Bc){Or(e),e=Je(e);try{return await jS(e,t),!0}catch{return!1}}v(Ze,"i$h");Ag(Ze,"d");Ju(Ze,"m");OS(Ze,"isAccessible");var RS=Object.defineProperty,_S=v((e,t)=>RS(e,"name",{value:t,configurable:!0}),"a$p"),PS=Object.defineProperty,CS=_S((e,t)=>PS(e,"name",{value:t,configurable:!0}),"e"),TS=Ku();const NS=no(TS);var IS=Object.defineProperty,MS=CS((e,t)=>IS(e,"name",{value:t,configurable:!0}),"s");const zc=MS((e,t)=>NS(e,t),"isGlob");var DS=Object.defineProperty,BS=v((e,t)=>DS(e,"name",{value:t,configurable:!0}),"f$p"),LS=Object.defineProperty,Og=BS((e,t)=>LS(e,"name",{value:t,configurable:!0}),"i");const WS=De(import.meta.url),Qn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Rg=Og(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 WS(e)},"__cjs_getBuiltinModule"),{readFile:FS}=Rg("node:fs/promises"),{unzip:HS,brotliDecompress:qS}=Rg("node:zlib");var zS=Object.defineProperty,_g=Og((e,t)=>zS(e,"name",{value:t,configurable:!0}),"n");const GS={brotli:qS,gzip:HS,none:_g((e,t)=>{t(null,e)},"none")},Vu=_g(async(e,t)=>{if(Or(e),e=Je(e),!await Ze(e))throw new y$(`unable to read the non-accessible file: ${e}`);if(!await Ze(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 FS(e,o?{encoding:i,flag:o}:{encoding:i}).then(async s=>await new Promise((a,l)=>{GS[n??"none"](s,(c,u)=>{c?l(c):a(r?u:u.toString())})})).catch(s=>{throw s})},"readFile");var US=Object.defineProperty,Pg=v((e,t)=>US(e,"name",{value:t,configurable:!0}),"t$d"),KS=Object.defineProperty,Cg=Pg((e,t)=>KS(e,"name",{value:t,configurable:!0}),"t"),JS=Object.defineProperty,VS=Cg((e,t)=>JS(e,"name",{value:t,configurable:!0}),"i");async function _n(e,t,r){typeof t=="object"&&(r=t,t=void 0);const n=await Vu(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)),du(i,t,Je(e),{color:s})}v(_n,"a$o");Pg(_n,"l");Cg(_n,"c");VS(_n,"readJson");var XS=Object.defineProperty,YS=v((e,t)=>XS(e,"name",{value:t,configurable:!0}),"a$n"),QS=Object.defineProperty,ZS=YS((e,t)=>QS(e,"name",{value:t,configurable:!0}),"t"),e2=Object.defineProperty,t2=ZS((e,t)=>e2(e,"name",{value:t,configurable:!0}),"t");const r2=t2(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 n2=Object.defineProperty,i2=v((e,t)=>n2(e,"name",{value:t,configurable:!0}),"i$f"),o2=Object.defineProperty,Tg=i2((e,t)=>o2(e,"name",{value:t,configurable:!0}),"i");const s2=De(import.meta.url),Zn=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ng=Tg(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 s2(e)},"__cjs_getBuiltinModule"),{existsSync:a2}=Ng("node:fs"),{mkdir:l2,readdir:c2,rm:u2}=Ng("node:fs/promises");var p2=Object.defineProperty,f2=Tg((e,t)=>p2(e,"name",{value:t,configurable:!0}),"o");const d2=f2(async(e,t)=>{if(Or(e),!a2(e)){await l2(e,{recursive:!0});return}const r=await c2(e),n=r2(t);for(const i of r)await u2(le(Je(e),i),n)},"emptyDir");var m2=Object.defineProperty,h2=v((e,t)=>m2(e,"name",{value:t,configurable:!0}),"m$n"),g2=Object.defineProperty,Ig=h2((e,t)=>g2(e,"name",{value:t,configurable:!0}),"s");const v2=De(import.meta.url),ei=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,b2=Ig(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 v2(e)},"__cjs_getBuiltinModule"),{mkdir:y2,writeFile:$2,stat:x2,rename:Hf,chown:w2,chmod:E2,unlink:S2}=b2("node:fs/promises");var k2=Object.defineProperty,j2=Ig((e,t)=>k2(e,"name",{value:t,configurable:!0}),"d");const A2=j2(async(e,t,r)=>{r={encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...r},Or(e),$$(t),e=Je(e);const n=`${e}.tmp`;try{const i=await Ze(e,Bc);if(!i&&r.recursive){const s=Te(e);await Ze(s,Bc)||await y2(s,{recursive:!0})}let o;if(await $2(n,x$(t),{encoding:r.encoding,flag:r.flag}),i&&!r.overwrite&&(o=await x2(e),r.chown??={gid:o.gid,uid:o.uid},await Hf(e,`${e}.bak`)),r.chown)try{await w2(n,r.chown.uid,r.chown.gid)}catch{}await E2(n,o&&!r.mode?o.mode:r.mode??438),await Hf(n,e)}catch(i){throw new Error(`Failed to write file at: ${e} - ${i.message}`,{cause:i})}finally{await Ze(n)&&await S2(`${e}.tmp`)}},"writeFile");var O2=Object.defineProperty,R2=v((e,t)=>O2(e,"name",{value:t,configurable:!0}),"a$l"),_2=Object.defineProperty,Mg=R2((e,t)=>_2(e,"name",{value:t,configurable:!0}),"n");const P2=De(import.meta.url),ti=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,C2=Mg(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 P2(e)},"__cjs_getBuiltinModule"),{readFile:T2}=C2("node:fs/promises");var N2=Object.defineProperty,I2=Mg((e,t)=>N2(e,"name",{value:t,configurable:!0}),"r");const Dg=I2(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 Ze(e,$h))try{const p=await T2(e,"utf8");if(n){const{indent:f}=w$(p);l=f}c=p.endsWith(`
27
+ `)?`
28
+ `:""}catch(p){if(p.code!=="ENOENT")throw p}const u=s(t,o,l);await A2(e,`${u}${c}`,a)},"writeJson");var M2=Object.defineProperty,Dt=v((e,t)=>M2(e,"name",{value:t,configurable:!0}),"S$b"),D2=Object.defineProperty,Re=Dt((e,t)=>D2(e,"name",{value:t,configurable:!0}),"b");const B2=De(import.meta.url),zr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ka=Re(e=>{if(typeof zr<"u"&&zr.versions&&zr.versions.node){const[t,r]=zr.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return zr.getBuiltinModule(e)}return B2(e)},"__cjs_getBuiltinModule"),{createRequire:L2}=ka("node:module"),$r=zr,{execFileSync:W2}=ka("node:child_process"),gi=ka("node:fs"),F2=ka("node:tty"),lB={alert:7,critical:6,debug:1,emergency:8,error:5,informational:2,notice:3,trace:2,warning:4},H2={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"}},q2=Symbol("EMPTY");var z2=Object.defineProperty,G2=Re((e,t)=>z2(e,"name",{value:t,configurable:!0}),"g$6");const U2=G2(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 K2=Object.defineProperty,Bg=Re((e,t)=>K2(e,"name",{value:t,configurable:!0}),"T$5"),J2=Object.defineProperty,Ne=Bg((e,t)=>J2(e,"name",{value:t,configurable:!0}),"l"),V2=Object.defineProperty,X2=Ne((e,t)=>V2(e,"name",{value:t,configurable:!0}),"L");const Et=X2((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),E=c.length+y.length,j=E+p.length;if(d&&E>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&&E+u.length>l)break;if(c+=y,!d&&!m&&E+u.length>=l){p=`…(${String(e.length-f-1)})`;break}p=""}return`${c}${p}`},"inspectList");var Y2=Object.defineProperty,ja=Ne((e,t)=>Y2(e,"name",{value:t,configurable:!0}),"s$6");const Q2=ja(([e,t],r,n)=>(n.truncate-=3,t?`${n.stylize(String(e),"yellow")}=${n.stylize(`"${t}"`,"string")}`:n.stylize(String(e),"yellow")),"inspectAttribute"),Z2=ja((e,t,r)=>{switch(e.nodeType){case 1:return Lg(e,e,r,t);case 3:return t(e.data,t,r);default:return t(e,t,r)}},"inspectNode"),Gc=ja((e,t,r,n)=>Et(e,e,t,r,Z2,`
29
+ `),"inspectNodeCollection"),Lg=ja((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+=Et(i.map(f=>[f,e.getAttribute(f)]),t,r,n,Q2," ")),r.truncate-=c.length;const{truncate:u}=r;let p=Gc(e.children,r,n,void 0);return p&&p.length>u&&(p=`…(${String(e.children.length)})`),`${s}${c}${a}${p}${l}`},"inspectHTMLElement");var ek=Object.defineProperty,tk=Ne((e,t)=>ek(e,"name",{value:t,configurable:!0}),"n$4");const rk=tk((e,t,r)=>e.length===0?"Arguments []":(t.truncate-=13,`Arguments [ ${Et(e,e,t,r)} ]`),"inspectArguments");var nk=Object.defineProperty,Wg=Ne((e,t)=>nk(e,"name",{value:t,configurable:!0}),"r$3");const ik=Wg((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"),Aa=Wg((e,t)=>{if(e.length===0)return"";const r=t.prev+t.base;return r+e.split(", ").join(`,${r}`)+t.prev},"indentedJoin");var ok=Object.defineProperty,Fg=Ne((e,t)=>ok(e,"name",{value:t,configurable:!0}),"i$5");const sk=/^[a-z_]\w*$/i,ak=/^"|"$/g,lk=Fg((e,t)=>{if(sk.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(ak,"'")},"quoteComplexKey"),Ti=Fg(([e,t],r,n,i)=>{n.truncate-=2;let o;typeof e=="string"?o=lk(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 ck=Object.defineProperty,Hg=Ne((e,t)=>ck(e,"name",{value:t,configurable:!0}),"p$4");const uk=Hg(e=>{for(const t of e)if(Array.isArray(t)||typeof t=="object"&&t!==null)return!0;return!1},"multiLineValues"),pk=Hg((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=Et(e,e,t,r);t.truncate-=o.length;let s="";i.length>0&&(s=Et(i.map(l=>[l,e[l]]),e,t,r,Ti));const a=n&&uk(e);return a&&(o=Aa(o,n)),`[${a?"":" "}${o}${s?`, ${s}`:""}${a?"":" "}]`},"inspectArray");var fk=Object.defineProperty,dk=Ne((e,t)=>fk(e,"name",{value:t,configurable:!0}),"o$7");const qf=/\d(?=(?:\d{3})+(?!\d))/g,mk=/\d{3}/g,hk=/_$/,qg=dk((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(qf,"$&_")}.${i.replace(mk,"$&_").replace(hk,"")}`}}return t.replace(qf,"$&_")},"addNumericSeparator");var gk=Object.defineProperty,zg=Ne((e,t)=>gk(e,"name",{value:t,configurable:!0}),"i$4");const vk=zg(e=>e>="\uD800"&&e<="\uDBFF","isHighSurrogate"),sr=zg((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&&vk(e[o-1])&&(o-=1),`${e.slice(0,o)}${r}`}return e},"truncate");var bk=Object.defineProperty,yk=Ne((e,t)=>bk(e,"name",{value:t,configurable:!0}),"e$4");const zf=yk((e,t)=>{let r=sr(e.toString(),t.truncate-1);return r!=="…"&&(r+="n"),t.stylize(t.numericSeparator?qg(e,r):r,"bigint")},"inspectBigInt");var $k=Object.defineProperty,xk=Ne((e,t)=>$k(e,"name",{value:t,configurable:!0}),"y");const wk=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:void 0),Jo=xk((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=wk(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=Et(i.map(d=>[d,e[d]]),e,t,r,Ti),p=Et(o.map(d=>[d,e[d]]),e,t,r,Ti);let f="";return u&&p&&(f=", "),n?`${c}{${Aa(u+f+p,n)}}`:`${c}{ ${u}${f}${p} }`},"inspectObject");var Ek=Object.defineProperty,Sk=Ne((e,t)=>Ek(e,"name",{value:t,configurable:!0}),"s$3");const kk=Sk((e,t,r,n)=>{let i="";return i=i||e.constructor.name,(!i||i==="_class")&&(i="<Anonymous Class>"),t.truncate-=i.length,`${i} ${Jo(e,t,r,n)}`},"inspectClass");var jk=Object.defineProperty,Ak=Ne((e,t)=>jk(e,"name",{value:t,configurable:!0}),"i$3");const Ok=Ak((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${sr(n[1],t.truncate-i.length-1)}`,"date")},"inspectDate");var Rk=Object.defineProperty,_k=Ne((e,t)=>Rk(e,"name",{value:t,configurable:!0}),"c$4");const Pk=new Set(["column","columnNumber","description","fileName","line","lineNumber","message","name","number","stack"]),Ck=_k((e,t,r)=>{const n=Object.getOwnPropertyNames(e).filter(a=>!Pk.has(a)),{name:i}=e;t.truncate-=i.length;let o="";typeof e.message=="string"?o=sr(e.message,t.truncate):n.unshift("message"),o=o?`: ${o}`:"",t.truncate-=o.length+5;const s=Et(n.map(a=>[a,e[a]]),e,t,r,Ti);return`${i}${o}${s?` { ${s} }`:""}`},"inspectObject");var Tk=Object.defineProperty,Nk=Ne((e,t)=>Tk(e,"name",{value:t,configurable:!0}),"c$3");const Gf=Nk((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} ${sr(i,t.truncate-11)}]`,"special"):t.stylize(`[${r}]`,"special")},"inspectFunction");var Ik=Object.defineProperty,Gg=Ne((e,t)=>Ik(e,"name",{value:t,configurable:!0}),"p$3");const Mk=Gg(([e,t],r,n,i)=>(n.truncate-=4,e=i(e,r,n),n.truncate-=e.length,`${e} => ${i(t,r,n)}`),"inspectMapEntry"),Dk=Gg((e,t,r,n)=>{if(e.size<=0)return"Map (0) {}";t.truncate-=7;let i=Et([...e.entries()],e,t,r,Mk);return n&&(i=Aa(i,n)),`Map (${String(e.size)}) {${n?"":" "}${i}${n?"":" "}}`},"inspectMap");var Bk=Object.defineProperty,Lk=Ne((e,t)=>Bk(e,"name",{value:t,configurable:!0}),"e$3");function kr(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(sr(t.numericSeparator?qg(e,e.toString()):e.toString(),t.truncate),"number")}v(kr,"R$e");Dt(kr,"Y");Re(kr,"j$5");Bg(kr,"P");Ne(kr,"u$3");Lk(kr,"inspectNumber");var Wk=Object.defineProperty,Fk=Ne((e,t)=>Wk(e,"name",{value:t,configurable:!0}),"e$2");const Hk=Fk(()=>"Promise{…}","getPromiseValue");var qk=Object.defineProperty,zk=Ne((e,t)=>qk(e,"name",{value:t,configurable:!0}),"p$1");const Gk=zk((e,t)=>{const r=t.truncate-(2+e.flags.length);return t.stylize(`/${sr(e.source,r)}/${e.flags}`,"regexp")},"inspectRegExp");var Uk=Object.defineProperty,Kk=Ne((e,t)=>Uk(e,"name",{value:t,configurable:!0}),"i$1");const Jk=Kk((e,t,r,n)=>{if(e.size===0)return"Set (0) {}";t.truncate-=7;let i=Et([...e],e,t,r);return n&&(i=Aa(i,n)),`Set (${String(e.size)}) {${n?"":" "}${i}${n?"":" "}}`},"inspectSet");var Vk=Object.defineProperty,Xk=Ne((e,t)=>Vk(e,"name",{value:t,configurable:!0}),"l");const Yk=Xk((e,t)=>{const r=t.quoteStyle==="double"?'"':"'";return t.quoteStyle==="double"&&(e=e.replaceAll('"','"')),r+e+r},"wrapQuotes");var Qk=Object.defineProperty,Ug=Ne((e,t)=>Qk(e,"name",{value:t,configurable:!0}),"e$1");const Uf=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"),Zk={" ":String.raw`\t`,"\n":String.raw`\n`,"\f":String.raw`\f`,"\r":String.raw`\r`,"\b":String.raw`\b`,"'":String.raw`\'`,"\\":"\\\\"},ej=16,tj=Ug(e=>Zk[e]||String.raw`\u${`0000${e.codePointAt(0).toString(ej)}`.slice(-4)}`,"escape"),Kf=Ug((e,t)=>(Uf.test(e)&&(e=e.replaceAll(Uf,tj)),t.stylize(Yk(sr(e,t.truncate-2),t),"string")),"inspectString");var rj=Object.defineProperty,nj=Ne((e,t)=>rj(e,"name",{value:t,configurable:!0}),"o");const Jf=nj(e=>"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString(),"inspectSymbol");var ij=Object.defineProperty,Kg=Ne((e,t)=>ij(e,"name",{value:t,configurable:!0}),"f");const oj=Kg(e=>typeof Buffer=="function"&&e instanceof Buffer?"Buffer":e[Symbol.toStringTag],"getArrayName"),Lt=Kg((e,t,r)=>{const n=oj(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(sr(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=Et(i.map(a=>[a,e[a]]),e,t,r,Ti)),`${n}[ ${o}${s?`, ${s}`:""} ]`},"inspectTypedArray");var sj=Object.defineProperty,Ue=Ne((e,t)=>sj(e,"name",{value:t,configurable:!0}),"r");const us=new WeakMap,Uc={},aj={Arguments:rk,Array:pk,ArrayBuffer:Ue(()=>"","ArrayBuffer"),BigInt:zf,bigint:zf,Boolean:Ue((e,t)=>t.stylize(String(e),"boolean"),"Boolean"),boolean:Ue((e,t)=>t.stylize(String(e),"boolean"),"boolean"),DataView:Ue(()=>"","DataView"),Date:Ok,Error:Ck,Float32Array:Lt,Float64Array:Lt,Function:Gf,function:Gf,Generator:Ue(()=>"","Generator"),HTMLCollection:Gc,Int8Array:Lt,Int16Array:Lt,Int32Array:Lt,Map:Dk,NodeList:Gc,null:Ue((e,t)=>t.stylize("null","null"),"null"),Number:kr,number:kr,Promise:Hk,RegExp:Gk,Set:Jk,String:Kf,string:Kf,Symbol:Jf,symbol:Jf,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")},Vf=Symbol.for("nodejs.util.inspect.custom"),lj=Ue((e,t,r,n)=>{if(!("window"in globalThis)&&typeof e[Vf]=="function")return e[Vf](n,t);if("inspect"in e&&typeof e.inspect=="function")return e.inspect(n,t);if("constructor"in e&&us.has(e.constructor))return us.get(e.constructor)?.(e,t)??"unknown";const i=Uc[r];return i?i(e,t):""},"inspectCustom"),Jg=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]),Jg(c,p,r+1,n)),"inspect"),o=t.indent?ik(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=aj[s];if(a!==void 0)return a(e,t,i,o);if(t.customInspect&&e){const c=lj(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?Jo(e,t,i,o):e&&typeof HTMLElement=="function"&&e instanceof HTMLElement?Lg(e,e,t,i):"constructor"in e?e.constructor!==Object?kk(e,t,i,o):Jo(e,t,i,o):e===Object(e)?Jo(e,t,i,o):t.stylize(String(e),s)},"internalInspect"),Xf=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 Jg(e,r,0,[])},"inspect");Ue((e,t)=>us.has(e)?!1:(us.set(e,t),!0),"registerConstructor");Ue((e,t)=>e in Uc?!1:(Uc[e]=t,!0),"registerStringTag");var cj=Object.defineProperty,uj=Re((e,t)=>cj(e,"name",{value:t,configurable:!0}),"r$6");const pj=uj((e,t)=>(t.__write??t.write.bind(t)).call(t,e),"writeStream");var fj=Object.defineProperty,dj=Re((e,t)=>fj(e,"name",{value:t,configurable:!0}),"A$4"),mj=Object.defineProperty,Xu=dj((e,t)=>mj(e,"name",{value:t,configurable:!0}),"$"),hj=Object.defineProperty,gj=Xu((e,t)=>hj(e,"name",{value:t,configurable:!0}),"r$1");const vj=gj(e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
31
+ `),"normalizeLF"),bj=globalThis.process??Object.create(null),Yf={versions:{}},Qf=new Proxy(bj,{get(e,t){if(t in e)return e[t];if(t in Yf)return Yf[t]}});var yj=Object.defineProperty,$j=Xu((e,t)=>yj(e,"name",{value:t,configurable:!0}),"b");const xj=$j((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 wj=Object.defineProperty,_o=Xu((e,t)=>wj(e,"name",{value:t,configurable:!0}),"t");const Ej=Qf.platform==="win32"&&!Qf.env?.WT_SESSION?">":"❯",Sj=_o((e,t,r)=>{const n={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...r,color:{gutter:_o(m=>m,"gutter"),marker:_o(m=>m,"marker"),message:_o(m=>m,"message"),...r?.color}},i=typeof t.start.column=="number";let o=vj(e).split(`
32
+ `);typeof n.tabWidth=="number"&&(o=o.map(m=>m.replaceAll(" "," ".repeat(n.tabWidth))));const{end:s,markerLines:a,start:l}=xj(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,E=a[y],j=` ${String(y)}`.slice(-c),R=!a[y+1],b=` ${j}${n.showGutter?" |":""}`;if(E){let w="";if(Array.isArray(E)){const h=m.replaceAll(/[^\t]/g," ").slice(0,Math.max(E[0]-1,0)),A=E[1]||1;w=[`
33
+ `,n.prefix+u(b.replaceAll(/\d/g," "))," ",h,p("^").repeat(A)].join(""),R&&n.message&&(w+=` ${f(n.message)}`)}return[n.prefix+p(Ej),u(b),m.length>0?` ${m}`:"",w].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 kj=Object.defineProperty,jj=Re((e,t)=>kj(e,"name",{value:t,configurable:!0}),"x$3"),Aj=Object.defineProperty,Oj=jj((e,t)=>Aj(e,"name",{value:t,configurable:!0}),"x"),Rj=Object.defineProperty,qt=Oj((e,t)=>Rj(e,"name",{value:t,configurable:!0}),"u");const jr=qt((e,...t)=>{process.env.DEBUG&&process.env.DEBUG==="true"&&console.debug(`error:parse-stacktrace: ${e}`,...t)},"debugLog"),Ar="<unknown>",_j=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Pj=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,Cj=/(.*?):(\d+):(\d+)(?:\s<-\s.+:\d+:\d+)?/,Tj=/eval\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*<anonymous>?:(\d+)?:(\d+)/,Nj=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,Ij=/in\s(.*)\s\(at\s(.+)\)\sat/,Mj=/^(?:.*@)?(.*):(\d+):(\d+)$/,Dj=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Bj=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Lj=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,Zf=/\(error: (.*)\)/,Wj=/at\s/,Fj=/^(\S+):(\d+):(\d+)$|^(\S+):(\d+)$/,Hj=/^\s+|\s+$/g,qj=/\S*(?:Error: |AggregateError:)/,Vg=/^Anonymous function$/,zj=/^\s*in\s.*/,Gj=/^.*?\s*at\s.*/,Uj=/^.*?\s*@.*|\[native code\]/,Xg=qt((e,t)=>{const r=e.includes("safari-extension"),n=e.includes("safari-web-extension");return r||n?[e.includes("@")?e.split("@")[0]:Ar,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},"extractSafariExtensionDetails"),Yg=qt((e,t)=>{const r=Cj.exec(t);r&&(e.file=r[1],e.line=+r[2],e.column=+r[3])},"parseMapped"),Kj=qt(e=>{const t=Ij.exec(e);if(t){jr(`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]??Ar,raw:e,type:void 0}}const r=Nj.exec(e);if(r){jr(`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(Wj,""):void 0,line:r[3]?+r[3]:void 0,methodName:r[1]??Ar,raw:e,type:e.startsWith("internal")?"internal":void 0};return Yg(n,`${r[2]}:${r[3]}:${r[4]}`),n}},"parseNode"),Jj=qt(e=>{const t=_j.exec(e);if(t){jr(`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=Pj.exec(e);if(c){const u=Fj.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=Tj.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]=Xg(t[1]?t[1].replace(Vg,"<anonymous>"):Ar,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):Yg(l,`${a}:${t[3]}:${t[4]}`),l}},"parseChromium"),Vj=qt((e,t)=>{const r=Dj.exec(e);if(r){jr(`parse gecko error stack line: "${e}"`,`found: ${JSON.stringify(r)}`);const n=r[3]?.includes(" > eval"),i=n&&r[3]&&Bj.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]=Xg(r[1]?r[1].replace(Vg,"<anonymous>"):Ar,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"),Xj=qt((e,t)=>{const r=Lj.exec(e);if(!(r&&r[2].includes(" > eval"))&&r)return jr(`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]||Ar,raw:e,type:void 0}},"parseFirefox"),Yj=qt(e=>{const t=Mj.exec(e);if(t)return jr(`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:Ar,raw:e,type:void 0}},"parseReactAndroidNative"),Qg=qt((e,{filter:t,frameLimit:r=50}={})=>{const n=e;let i=(typeof n.stacktrace=="string"?n.stacktrace:e.stack??"").split(`
36
+ `).map(o=>(Zf.test(o)?o.replace(Zf,"$1"):o).replaceAll(Hj,"")).filter(o=>!qj.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(zj.test(s))l=Kj(s);else if(Gj.test(s))l=Jj(s);else if(Uj.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=Xj(s,c)??Vj(s,c)}else l=Yj(s);return l?o.push(l):jr(`parse error stack line: "${s}"`,"not parser found"),o},[])},"parseStacktrace");var Qj=Object.defineProperty,Zj=Re((e,t)=>Qj(e,"name",{value:t,configurable:!0}),"p$6"),eA=Object.defineProperty,Zg=Zj((e,t)=>eA(e,"name",{value:t,configurable:!0}),"m");const tA=L2(import.meta.url),Gr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Yu=Zg(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 tA(e)},"__cjs_getBuiltinModule"),{existsSync:rA,readFileSync:nA}=Yu("node:fs"),{relative:iA}=Yu("node:path"),{cwd:oA}=Gr,{fileURLToPath:sA}=Yu("node:url");var aA=Object.defineProperty,Le=Zg((e,t)=>aA(e,"name",{value:t,configurable:!0}),"o");const Pn=Le((e,t,r)=>r===0?e:t===" "?e+" ".repeat(r):e+" ".repeat(t*r),"getPrefix"),lA=Le((e,t)=>{const r=e.replace("async file:","file:");return iA(t,r.startsWith("file:")?sA(r):r)},"getRelativePath"),cA=Le((e,t,r)=>{if(t)return r.title(e.message);const n=e.message?`: ${e.message}`:"";return r.title(e.name+n)},"getTitleText"),ev=Le((e,{color:t,hideErrorTitle:r,indentation:n,prefix:i},o)=>`${Pn(i,n,o)}${cA(e,r,t)}
37
+ `,"getMessage"),tv=Le((e,{color:t,indentation:r,prefix:n},i)=>{if(e.hint===void 0)return;const o=Pn(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"),Qu=Le((e,{color:t,cwd:r,displayShortPath:n,indentation:i,prefix:o},s=0)=>{const a=n?lA(e.file,r):e.file,{fileLine:l,method:c}=t;return`${Pn(o,i,s)}at ${e.methodName?`${c(e.methodName)} `:""}${l(a)}:${l(e.line?.toString()??"")}`},"getMainFrame"),rv=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(!rA(u))return;const p=nA(u,"utf8");return Sj(p,{start:{column:e.column,line:e.line}},{color:t,linesAbove:n,linesBelow:i,prefix:Pn(o,r,c),showGutter:s,showLineNumbers:a,tabWidth:l})},"getCode"),nv=Le((e,t,r)=>{if(e.errors.length===0)return;let n=`${Pn(t.prefix,t.indentation,r)}Errors:
39
+
40
+ `,i=!0;for(const o of e.errors)i?i=!1:n+=`
41
+
42
+ `,n+=ov(o,{...t,framesMaxLimit:1,hideErrorCodeView:t.hideErrorErrorsCodeView},r+1);return`
43
+ ${n}`},"getErrors"),iv=Le((e,t,r)=>{let n=`${Pn(t.prefix,t.indentation,r)}Caused by:
44
+
45
+ `;const i=e.cause;n+=ev(i,t,r);const o=Qg(i).shift(),s=tv(i,t,r);if(s&&(n+=`${s}
46
+ `),o&&(n+=Qu(o,t,r),!t.hideErrorCauseCodeView)){const a=rv(o,t,r);a!==void 0&&(n+=`
47
+ ${a}`)}if(i.cause)n+=`
48
+ ${iv(i,t,r+1)}`;else if(i instanceof AggregateError){const a=nv(i,t,r);a!==void 0&&(n+=`
49
+ ${a}`)}return`
50
+ ${n}`},"getCause"),uA=Le((e,t)=>(e.length>0?`
51
+ `:"")+e.map(r=>Qu(r,t)).join(`
52
+ `),"getStacktrace"),ov=Le((e,t,r)=>{const n={cwd:oA(),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=Qg(e,{filter:t.filterStacktrace,frameLimit:n.framesMaxLimit}),o=i.shift();return[t.hideMessage?void 0:ev(e,n,r),tv(e,n,r),o?Qu(o,n,r):void 0,o&&!n.hideErrorCodeView?rv(o,n,r):void 0,e instanceof AggregateError?nv(e,n,r):void 0,e.cause===void 0?void 0:iv(e,n,r),i.length>0?uA(i,n):void 0].filter(Boolean).join(`
53
+ `).replaceAll("\\","/")},"internalRenderError"),Ol=Le((e,t={})=>{if(t.framesMaxLimit!==void 0&&t.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return ov(e,t,0)},"renderError");var pA=Object.defineProperty,Zu=Re((e,t)=>pA(e,"name",{value:t,configurable:!0}),"s$3"),fA=Object.defineProperty,Oa=Zu((e,t)=>fA(e,"name",{value:t,configurable:!0}),"l");const ep=[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],tp=[12288,12288,65281,65376,65504,65510],rp=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],np=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],Ra=[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 dA=Object.defineProperty,mA=Oa((e,t)=>dA(e,"name",{value:t,configurable:!0}),"r$1");const mo=mA((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 hA=Object.defineProperty,Pr=Oa((e,t)=>hA(e,"name",{value:t,configurable:!0}),"r");const gA=ep[0],vA=ep.at(-1),bA=tp[0],yA=tp.at(-1),$A=rp[0],xA=rp.at(-1),wA=np[0],EA=np.at(-1),SA=Ra[0],kA=Ra.at(-1),ed=19968,[jA,AA]=Cn(Ra);function Cn(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(ed>=i&&ed<=o)return[i,o];o-i>r-t&&(t=i,r=o)}return[t,r]}v(Cn,"X$b");Dt(Cn,"ge");Re(Cn,"b$2");Zu(Cn,"b");Oa(Cn,"N");Pr(Cn,"findWideFastPathRange");const sv=Pr(e=>e<gA||e>vA?!1:mo(ep,e),"isAmbiguous"),av=Pr(e=>e<bA||e>yA?!1:mo(tp,e),"isFullWidth"),OA=Pr(e=>e<$A||e>xA?!1:mo(rp,e),"isHalfWidth"),RA=Pr(e=>e<wA||e>EA?!1:mo(np,e),"isNarrow"),lv=Pr(e=>e>=jA&&e<=AA?!0:e<SA||e>kA?!1:mo(Ra,e),"isWide");function Tn(e){return sv(e)?"ambiguous":av(e)?"fullwidth":OA(e)?"halfwidth":RA(e)?"narrow":lv(e)?"wide":"neutral"}v(Tn,"ee$a");Dt(Tn,"pe");Re(Tn,"v$2");Zu(Tn,"q");Oa(Tn,"getCategory");Pr(Tn,"getCategory");var _A=Object.defineProperty,_a=Re((e,t)=>_A(e,"name",{value:t,configurable:!0}),"i$3"),PA=Object.defineProperty,Pa=_a((e,t)=>PA(e,"name",{value:t,configurable:!0}),"a"),CA=Object.defineProperty,ip=Pa((e,t)=>CA(e,"name",{value:t,configurable:!0}),"e");function Cr(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}v(Cr,"V$b");Dt(Cr,"J");Re(Cr,"s$2");_a(Cr,"s");Pa(Cr,"r");ip(Cr,"validate");function Tr(e){return Cr(e),Tn(e)}v(Tr,"H$b");Dt(Tr,"K");Re(Tr,"r$5");_a(Tr,"p");Pa(Tr,"eastAsianWidthType");ip(Tr,"eastAsianWidthType");function ho(e,{ambiguousAsWide:t=!1}={}){return Cr(e),av(e)||lv(e)||t&&sv(e)?2:1}v(ho,"ve$5");Dt(ho,"Fe");Re(ho,"o$5");_a(ho,"W");Pa(ho,"eastAsianWidth");ip(ho,"eastAsianWidth");var TA=Object.defineProperty,NA=Re((e,t)=>TA(e,"name",{value:t,configurable:!0}),"p$3"),IA=Object.defineProperty,cv=NA((e,t)=>IA(e,"name",{value:t,configurable:!0}),"e"),MA=Object.defineProperty,DA=cv((e,t)=>MA(e,"name",{value:t,configurable:!0}),"E");const uv=String.raw,td=uv`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,BA=DA(()=>new RegExp(uv`\p{RI}{2}|(?![#*\d](?!\uFE0F?\u20E3))${td}(?:\u200D${td})*`,"gu"),"default");var LA=Object.defineProperty,WA=cv((e,t)=>LA(e,"name",{value:t,configurable:!0}),"p");const Nn=new Set(["\x1B","›"]),Ca="\x07",pv="[",op="m",ps="]8;;",FA=39,HA=/[\u200B\uFEFF\u2060-\u2064]/g,qA=new RegExp(`(?:\\${pv}(?<code>\\d+)m|\\${ps}(?<uri>.*)${Ca})`),zA=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]])),ri=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,Po=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Vo=BA();WA(e=>e.replace(Vo,""),"stripEmoji");var GA=Object.defineProperty,UA=Re((e,t)=>GA(e,"name",{value:t,configurable:!0}),"E"),KA=Object.defineProperty,JA=UA((e,t)=>KA(e,"name",{value:t,configurable:!0}),"A"),VA=Object.defineProperty,Ta=JA((e,t)=>VA(e,"name",{value:t,configurable:!0}),"d");const rd=new Map,Co=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,Xo=Ta(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"),XA=Ta((e,t)=>{const r=Math.floor(e/65536),n=e%65536;let i=rd.get(r);if(i||(i=new Map,rd.set(r,i)),i.has(n))return i.get(n);let o;if(Xo(e)==="latin")o=t.width.regular;else if(Xo(e)==="control")o=t.width.control;else if(Xo(e)==="wide")o=t.width.wide;else switch(Tr(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"),YA=Ta(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"),Kc=Ta((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?Kc(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",E=y.length,j=e.indexOf("\x07",s+5);if(j!==-1){const R=e.indexOf(y,j+1);if(R!==-1){const b=R+E,w=e.slice(j+1,R).replace(ri,""),h=Kc(w,{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(ri.lastIndex=s,ri.test(e)){const y=ri.lastIndex-s,E=r.truncation.countAnsiEscapeCodes?y:r.width.ansi;if(a+E>n&&(l=Math.min(l,s),a+E>r.truncation.limit)){c=!0;break}a+=E,s=ri.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(Co.lastIndex=s,Co.test(e)){const y=(Co.lastIndex-s)*r.width.regular;if(a+y>n){const E=Math.floor((n-a)/r.width.regular);if(l=Math.min(l,s+E),a+y>r.truncation.limit){c=!0;break}}a+=y,s=Co.lastIndex;continue}if((d<=31||d>=127&&d<=159)&&(Po.lastIndex=s,Po.test(e))){const y=(Po.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=Po.lastIndex;continue}if(Vo.lastIndex=s,Vo.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=Vo.lastIndex;continue}const m=e.codePointAt(s)??0;if(YA(m)){s+=m>65535?2:1;continue}let g;if(o)g=XA(m,r);else switch(Xo(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(Tr(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 QA=Object.defineProperty,ZA=Re((e,t)=>QA(e,"name",{value:t,configurable:!0}),"i$1"),eO=Object.defineProperty,tO=ZA((e,t)=>eO(e,"name",{value:t,configurable:!0}),"e"),rO=Object.defineProperty,nO=tO((e,t)=>rO(e,"name",{value:t,configurable:!0}),"r");const ht=nO((e,t={})=>Kc(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var iO=Object.defineProperty,fv=Re((e,t)=>iO(e,"name",{value:t,configurable:!0}),"b"),oO=Object.defineProperty,Nr=fv((e,t)=>oO(e,"name",{value:t,configurable:!0}),"d"),sO=Object.defineProperty,aO=Nr((e,t)=>sO(e,"name",{value:t,configurable:!0}),"a");const lO=/\x1B\[(\d+)m/;let dv=class{static{v(this,"Wt")}static{Dt(this,"Pt")}static{Re(this,"T")}static{fv(this,"T")}static{Nr(this,"d")}static{aO(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const r=lO.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 cO=Object.defineProperty,mv=Nr((e,t)=>cO(e,"name",{value:t,configurable:!0}),"o");const hv=mv((e,t)=>{if(!Nn.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const r=!0,n=e.slice(t+1,t+1+ps.length).join("")===ps;return{isInsideEscape:r,isInsideLinkEscape:n}},"checkEscapeSequence"),uO=mv((e,t={})=>{const r=new dv;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&&Nn.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=hv(l,c),{isInsideLinkEscape:m}=d;if(m){let g=c+1;for(s="";g<l.length;){const E=l[g];if(E===Ca)break;s+=E,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===op){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 pO=Object.defineProperty,fO=Nr((e,t)=>pO(e,"name",{value:t,configurable:!0}),"t$1");const nd=fO(e=>`${Nn.values().next().value}${pv}${String(e)}${op}`,"wrapAnsiCode");var dO=Object.defineProperty,mO=Nr((e,t)=>dO(e,"name",{value:t,configurable:!0}),"s");const id=mO(e=>`${Nn.values().next().value}${ps}${e}${Ca}`,"wrapAnsiHyperlink");var hO=Object.defineProperty,gO=Nr((e,t)=>hO(e,"name",{value:t,configurable:!0}),"l");const vO=gO(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,Nn.has(l)){const u=qA.exec(i.slice(s))?.groups??{};if(u.code!==void 0){const p=Number.parseFloat(u.code);r=p===FA?void 0:p}else u.uri!==void 0&&(n=u.uri.length===0?void 0:u.uri)}const c=zA.get(Number(r));o[a+1]===`
55
+ `?(n&&(t+=id("")),r&&c&&(t+=nd(c))):l===`
56
+ `&&(r&&c&&(t+=nd(r)),n&&(t+=id(n))),s+=l.length}return t},"preserveAnsi");var bO=Object.defineProperty,rr=Nr((e,t)=>bO(e,"name",{value:t,configurable:!0}),"f");const gv=/(?=\s)|(?<=\s)/,vv=/^\s+$/,Rl=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"),xr=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"),bv=rr((e,t,r)=>{if(e.length===0)return[""];if(t<=0)return[e];const n=[],i=new dv;let o="",s=0,a=!1,l=!1,c="",u=0;for(;u<e.length;){const p=e[u];if(Nn.has(p)){a=!0,c=p,o+=p,l=hv([...e],u).isInsideLinkEscape,u+=1;continue}if(a){c+=p,o+=p,l?p===Ca&&(a=l=!1):p===op&&(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=>xr(p)):n},"wrapWithBreakAtWidth"),yO=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 uO(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=>xr(a)):i},"wrapCharByChar"),$O=rr((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(gv),o=[];let s="",a=0,l=0;for(;l<i.length;){const c=i[l],u=vv.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(xr(s)):o.push(s),s="",a=0;continue}s+=c,a+=p,l+=1}return s&&(r?o.push(xr(s)):o.push(s)),o},"wrapWithWordBoundaries"),xO=rr((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(gv),o=[];let s="",a=0,l=0;for(;l<i.length;){const c=i[l],u=vv.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(Rl(r?xr(s):s));const f=bv(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(Rl(r?xr(s):s)),s="",a=0,r&&u)){l+=1;continue}s+=c,a+=p,l+=1}return s&&o.push(Rl(r?xr(s):s)),o},"wrapAndBreakWords"),vi={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},wO=rr((e,t={})=>{const{removeZeroWidthCharacters:r=!0,trim:n=!0,width:i=80,wrapMode:o=vi.PRESERVE_WORDS}=t;if(n&&e.trim()==="")return"";let s=e.normalize("NFC").replaceAll(`\r
57
+ `,`
58
+ `);return r&&(s=s.replaceAll(HA,"")),s.split(`
59
+ `).map(a=>{if(n&&a.trim()==="")return"";let l;switch(o){case vi.BREAK_AT_CHARACTERS:{l=yO(a,i,n);break}case vi.BREAK_WORDS:{l=xO(a,i,n);break}case vi.STRICT_WIDTH:{l=bv(a,i,n);break}default:l=$O(a,i,n)}return vO(l)}).join(`
60
+ `)},"wordWrap");var EO=Object.defineProperty,ar=Re((e,t)=>EO(e,"name",{value:t,configurable:!0}),"n$2");const yv=80,$v=24,Jc=ar((e,t,{shell:r,env:n}={})=>W2(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:r,env:n}).trim(),"exec"),Yo=ar((e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),"create"),xv=ar((e,t)=>{const{columns:r,rows:n}=Yo(e,t);if(!(Number.isNaN(r)||Number.isNaN(n))&&!(r===yv&&n===$v))return{columns:r,rows:n}},"createIfNotDefault"),SO=ar(()=>{if($r.platform!=="linux")return!0;try{const e=gi.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 Na(){const{env:e,stdout:t,stderr:r}=$r;if(t?.columns&&t?.rows)return Yo(t.columns,t.rows);if(r?.columns&&r?.rows)return Yo(r.columns,r.rows);if(e.COLUMNS&&e.LINES)return Yo(e.COLUMNS,e.LINES);const n={columns:yv,rows:$v};return $r.platform==="win32"?_l()??n:$r.platform==="darwin"?od()??_l()??n:od()??_l()??kO()??n}v(Na,"_e$4");Dt(Na,"ja");Re(Na,"O");ar(Na,"terminalSize");const od=ar(()=>{try{const e=$r.platform==="darwin"?gi.constants.O_EVTONLY|gi.constants.O_NONBLOCK:gi.constants.O_NONBLOCK,{columns:t,rows:r}=F2.WriteStream(gi.openSync("/dev/tty",e));return{columns:t,rows:r}}catch{}},"devTty"),_l=ar(()=>{try{const e=Jc("tput",["cols"],{env:{TERM:"dumb",...$r.env}}),t=Jc("tput",["lines"],{env:{TERM:"dumb",...$r.env}});if(e&&t)return xv(e,t)}catch{}},"tput"),kO=ar(()=>{try{if(!SO())return;const e=Jc("resize",["-u"]).match(/\d+/g);if(e.length===2)return xv(e[0],e[1])}catch{}},"resize");var jO=Object.defineProperty,AO=Re((e,t)=>jO(e,"name",{value:t,configurable:!0}),"r$2");const OO=AO(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 RO=Object.defineProperty,_O=Re((e,t)=>RO(e,"name",{value:t,configurable:!0}),"r$1");const{bold:PO,cyan:CO,green:sd,grey:TO,magenta:NO,red:IO,yellow:Pl}=ws,MO={indent:2,quoteStyle:"single",stylize:_O((e,t)=>{const r={bigint:Pl,boolean:Pl,date:NO,null:PO,number:Pl,regexp:IO,special:CO,string:sd,symbol:sd,undefined:TO};return Object.hasOwn(r,t)?r[t](e):e},"stylize")};var DO=Object.defineProperty,BO=Re((e,t)=>DO(e,"name",{value:t,configurable:!0}),"o$1");const{bold:LO,underline:WO}=ws,FO=BO((e,t)=>{let r=t.uppercase.label?e.toUpperCase():e;return r=t.underline.label?WO(r):r,t.bold.label&&(r=LO(r)),r},"formatLabel");var HO=Object.defineProperty,wv=Re((e,t)=>HO(e,"name",{value:t,configurable:!0}),"o");const qO=wv(e=>[e.getHours(),e.getMinutes(),e.getSeconds()].map(t=>String(t).padStart(2,"0")).join(":"),"dateFormatter");class zO{static{v(this,"to")}static{Dt(this,"ro")}static{Re(this,"AbstractPrettyReporter")}static{wv(this,"AbstractPrettyReporter")}styles;loggerTypes;constructor(t){this.styles={bold:{label:!1},dateFormatter:qO,underline:{label:!1,message:!1,prefix:!1,suffix:!1},uppercase:{label:!1},...t},this.loggerTypes=H2}setLoggerTypes(t){this.loggerTypes=t}}var GO=Object.defineProperty,Ev=v((e,t)=>GO(e,"name",{value:t,configurable:!0}),"x$j"),UO=Object.defineProperty,Sv=Ev((e,t)=>UO(e,"name",{value:t,configurable:!0}),"x");De(import.meta.url);const KO=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{stdout:JO,stderr:VO}=KO;var XO=Object.defineProperty,kv=Sv((e,t)=>XO(e,"name",{value:t,configurable:!0}),"b");const{bgGrey:YO,bold:ad,cyan:QO,green:ZO,greenBright:eR,grey:cr,red:Cl,underline:ld,white:tR}=ws,rR=/[\\/]pail[\\/]dist/,Tl=kv(e=>!rR.test(e),"pailFileFilter");let uB=class extends zO{static{v(this,"he")}static{Ev(this,"ue")}static{Sv(this,"SimpleReporter")}static{kv(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={...MO,indent:void 0,...n},this.#n={...r,color:{fileLine:ZO,hint:QO,marker:Cl,message:Cl,method:eR,title:Cl}},this.#e=JO,this.#i=VO}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):pj(`${r}
62
+ `,o)}formatMessage(t){const{columns:r}=Na();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:E}=t,{color:j}=this.loggerTypes[E.name],R=j?ws[j]:tR,b=c.map(()=>" ").join(""),w=[];if(c.length>0&&w.push(`${b+cr(`[${c.at(-1)??""}]`)} `),s&&w.push(`${cr(this.styles.dateFormatter(typeof s=="string"?new Date(s):s))} `),i)w.push(ad(R(i)));else{const O=OO(this.loggerTypes);O.length>0&&w.push(cr(" ".repeat(O.length)))}const h=U2(this.loggerTypes),A=ht(h);if(u){const O=ht(u),k=Math.max(0,A-O);w.push(`${ad(R(FO(u,this.styles)))} `," ".repeat(k))}else w.push(" ".repeat(A+1));d&&w.push(`${YO.white(`[${String(d)}x]`)} `),Array.isArray(m)&&m.length>0&&w.push(`${cr(`[${m.join(" > ")}]`)} `),f&&w.push(`${cr(`[${this.styles.underline.prefix?ld(f):f}]`)} `);const _=ht(w.join(""));if(p!==q2){const O=typeof p=="string"?p:Xf(p,this.#r);w.push(b+wO(O,{trim:!1,width:n-3,wrapMode:vi.STRICT_WIDTH}))}if(o){let O=!1;w.push(...o.map(k=>{if(k instanceof Error)return O=!0,`
63
+
64
+ ${Ol(k,{...this.#n,filterStacktrace:Tl,prefix:b})}`;if(typeof k=="object")return` ${Xf(k,this.#r)}`;const C=(O?`
65
+
66
+ `:" ")+String(k);return O=!1,C}))}if(a&&w.push(Ol(a,{...this.#n,filterStacktrace:Tl,prefix:b})),y&&w.push(`
67
+
68
+ ${Ol(y,{...this.#n,filterStacktrace:Tl,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:b})}`),g&&w.push(` ${b}${cr(this.styles.underline.suffix?ld(g):g)}`),l){const O=(l.name??"")+(l.line?`:${String(l.line)}`:""),k=Math.max(0,_-ht("Caller: "));w.push(`
69
+ `,cr("Caller: ")," ".repeat(k),O,`
70
+ `)}return w.join("")}};var nR=Object.defineProperty,jv=v((e,t)=>nR(e,"name",{value:t,configurable:!0}),"o$e"),iR=Object.defineProperty,Av=jv((e,t)=>iR(e,"name",{value:t,configurable:!0}),"o"),oR=Object.defineProperty,sR=Av((e,t)=>oR(e,"name",{value:t,configurable:!0}),"o");let sp=class extends Error{static{v(this,"s")}static{jv(this,"u")}static{Av(this,"n")}static{sR(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 aR=Object.defineProperty,Ov=v((e,t)=>aR(e,"name",{value:t,configurable:!0}),"a$j"),lR=Object.defineProperty,Rv=Ov((e,t)=>lR(e,"name",{value:t,configurable:!0}),"o"),cR=Object.defineProperty,uR=Rv((e,t)=>cR(e,"name",{value:t,configurable:!0}),"r");async function go(e,t,r){const{buffer:n,compression:i,encoding:o="utf8",flag:s,...a}=r??{},l=await Vu(e,{buffer:n,compression:i,encoding:o,flag:s});return typeof t=="function"?is(l,t,a):is(l,a)}v(go,"n$i");Ov(go,"g");Rv(go,"l");uR(go,"readYaml");var pR=Object.defineProperty,_v=v((e,t)=>pR(e,"name",{value:t,configurable:!0}),"n$h"),fR=Object.defineProperty,Pv=_v((e,t)=>fR(e,"name",{value:t,configurable:!0}),"o"),dR=Object.defineProperty,mR=Pv((e,t)=>dR(e,"name",{value:t,configurable:!0}),"t");function vo(e,t,r){const{buffer:n,compression:i,encoding:o="utf8",flag:s,...a}=r??{},l=mu(e,{buffer:n,compression:i,encoding:o,flag:s});return typeof t=="function"?is(l,t,a):is(l,a)}v(vo,"o$d");_v(vo,"g");Pv(vo,"l");mR(vo,"readYamlSync");var hR=Object.defineProperty,gR=v((e,t)=>hR(e,"name",{value:t,configurable:!0}),"d$s"),vR=Object.defineProperty,bR=gR((e,t)=>vR(e,"name",{value:t,configurable:!0}),"f"),yR=Object.defineProperty,In=bR((e,t)=>yR(e,"name",{value:t,configurable:!0}),"c");const Cv=In((e,t,r)=>{const n=Te(e),i=Te(t),o=i===n?".":et(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"),Tv=In(async e=>{const t=await dg("pnpm-workspace.yaml",{cwd:Te(e),type:"file"});if(!t)return;const r=await go(t),n=Array.isArray(r.packages)?r.packages:[];if(!Cv(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"),Nv=In(e=>{const t=gg("pnpm-workspace.yaml",{cwd:Te(e),type:"file"});if(!t)return;const r=vo(t),n=Array.isArray(r.packages)?r.packages:[];if(!Cv(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"),$R=In((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"),xR=In((e,t)=>{for(const[r,n]of Object.entries(e)){if(typeof n!="string")continue;const i=$R(r,n,t);i&&(e[r]=i)}},"resolveDependenciesCatalogReferences"),Ia=In((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];xR(i,t)}},"resolveCatalogReferences");var wR=Object.defineProperty,Ve=v((e,t)=>wR(e,"name",{value:t,configurable:!0}),"l$o"),ER=Object.defineProperty,He=Ve((e,t)=>ER(e,"name",{value:t,configurable:!0}),"f");const SR=De(import.meta.url),ni=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ap=He(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 SR(e)},"__cjs_getBuiltinModule"),{existsSync:Iv}=ap("node:fs"),{createInterface:kR}=ap("node:readline"),{styleText:dt}=ap("node:util");var jR=Object.defineProperty,Ge=He((e,t)=>jR(e,"name",{value:t,configurable:!0}),"f");const It=Ge(e=>{const t=typeof e;return e!==null&&(t==="object"||t==="function")},"isObject"),AR=Ge(e=>{if(!It(e))return!1;for(const t in e)if(Object.hasOwn(e,t))return!1;return!0},"isEmptyObject"),Mv=new Set(["__proto__","prototype","constructor"]),Dv=1e6,OR=Ge(e=>e>="0"&&e<="9","isDigit");function Ir(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<=Dv}return!1}v(Ir,"w$g");Ve(Ir,"b");He(Ir,"p$1");Ge(Ir,"shouldCoerceToNumber");function on(e,t){return Mv.has(e)?!1:(e&&Ir(e)?t.push(Number.parseInt(e,10)):t.push(e),!0)}v(on,"P$h");Ve(on,"P");He(on,"y");Ge(on,"processSegment");function Ma(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(!on(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")&&!on(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<=Dv&&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"&&!OR(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(!on(r,t))return[];break}case"index":throw new Error("Index was not closed");case"start":{t.push("");break}}return t}v(Ma,"N$h");Ve(Ma,"B");He(Ma,"parsePath");Ge(Ma,"parsePath");function Mr(e){if(typeof e=="string")return Ma(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(Mv.has(n))return[];typeof n=="string"&&Ir(n)?t.push(Number.parseInt(n,10)):t.push(n)}return t}return[]}v(Mr,"b$l");Ve(Mr,"k");He(Mr,"d");Ge(Mr,"normalizePath");function Tt(e,t,r){if(!It(e)||typeof t!="string"&&!Array.isArray(t))return r===void 0?e:r;const n=Mr(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(Tt,"d$r");Ve(Tt,"h");He(Tt,"getProperty");Ge(Tt,"getProperty");function Da(e,t,r){if(!It(e)||typeof t!="string"&&!Array.isArray(t))return e;const n=e,i=Mr(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(Da,"T$e");Ve(Da,"M");He(Da,"setProperty");Ge(Da,"setProperty");function lp(e,t){if(!It(e)||typeof t!="string"&&!Array.isArray(t))return!1;const r=Mr(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(lp,"q$e");Ve(lp,"ue");He(lp,"deleteProperty");Ge(lp,"deleteProperty");function er(e,t){if(!It(e)||typeof t!="string"&&!Array.isArray(t))return!1;const r=Mr(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$l");Ve(er,"y");He(er,"hasProperty");Ge(er,"hasProperty");function Ni(e){if(typeof e!="string")throw new TypeError(`Expected a string, got ${typeof e}`);return e.replaceAll(/[\\.[]/g,String.raw`\$&`)}v(Ni,"E$e");Ve(Ni,"x");He(Ni,"escapePath");Ge(Ni,"escapePath");function Ba(e){const t=Object.entries(e);return Array.isArray(e)?t.map(([r,n])=>[Ir(r)?Number.parseInt(r,10):r,n]):t}v(Ba,"D$g");Ve(Ba,"R");He(Ba,"m$2");Ge(Ba,"normalizeEntries");function La(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=Ni(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(Ir(o)){const s=Number.parseInt(o,10);r&&i>0?n.push(`.${s}`):n.push(`[${s}]`)}else{const s=Ni(o);n.push(i===0?s:`.${s}`)}}return n.join("")}v(La,"F$e");Ve(La,"Y");He(La,"stringifyPath");Ge(La,"stringifyPath");function*bo(e,t=[],r=new Set){if(!It(e)||AR(e)){t.length>0&&(yield La(t));return}if(!r.has(e)){r.add(e);for(const[n,i]of Ba(e))t.push(n),yield*bo(i,t,r),t.pop();r.delete(e)}}v(bo,"j$i");Ve(bo,"S");He(bo,"x");Ge(bo,"deepKeysIterator");function cp(e){return[...bo(e)]}v(cp,"G$d");Ve(cp,"ge");He(cp,"deepKeys");Ge(cp,"deepKeys");function up(e){const t={};if(!It(e))return t;for(const[r,n]of Object.entries(e))Da(t,r,n);return t}v(up,"K$a");Ve(up,"de");He(up,"unflatten");Ge(up,"unflatten");var RR=Object.defineProperty,Nl=He((e,t)=>RR(e,"name",{value:t,configurable:!0}),"i");const _R=Nl(async e=>{const{default:t=!1,message:r,transformer:n}=e,i=Nl(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=Nl(s=>n?n(s):s?dt(["greenBright"],"Yes"):dt(["yellowBright"],"No"),"formatAnswer");return new Promise(s=>{const a=kR({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"),PR=typeof process.stdout<"u"&&!process.versions.deno&&!globalThis.window;var CR=Object.defineProperty,ze=He((e,t)=>CR(e,"name",{value:t,configurable:!0}),"l");const Bv=/, ([^,]*)$/,fs=new Map,Lv=new Map;let TR=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 Wa=ze((e,t,r=[])=>{const n=[];if(C$(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 TR(i)}return e},"normalizeInput"),NR=ze(async e=>await go(e),"parseYamlFile"),IR=ze(e=>vo(e),"parseYamlFileSync"),MR=ze(async e=>{const t=await Vu(e);return jh.parse(t)},"parseJson5File"),DR=ze(e=>{const t=mu(e);return jh.parse(t)},"parseJson5FileSync"),Wv=ze(async(e,t)=>t?.yaml!==!1&&(e.endsWith(".yaml")||e.endsWith(".yml"))?NR(e):t?.json5!==!1&&e.endsWith(".json5")?MR(e):_n(e),"parsePackageFile"),Fv=ze((e,t)=>t?.yaml!==!1&&(e.endsWith(".yaml")||e.endsWith(".yml"))?IR(e):t?.json5!==!1&&e.endsWith(".json5")?DR(e):E$(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 dg(l,r),i)break;if(!i)throw new sp(`No such file or directory, for ${n.join(", ").replace(Bv," or $1")} found.`);const o=t.cache&&typeof t.cache!="boolean"?t.cache:Lv;if(t.cache&&o.has(i))return o.get(i);const s=await Wv(i,t);if(t.resolveCatalogs){const l=await Tv(i);l&&Ia(s,l)}Wa(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=gg(l,r),i)break;if(!i)throw new sp(`No such file or directory, for ${n.join(", ").replace(Bv," or $1")} found.`);const o=t.cache&&typeof t.cache!="boolean"?t.cache:Lv;if(t.cache&&o.has(i))return o.get(i);const s=Fv(i,t);if(t.resolveCatalogs){const l=Nv(i);l&&Ia(s,l)}Wa(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 Dg(le(i,"package.json"),e,n)},"writePackageJson");ze((e,t={})=>{const{cwd:r,...n}=t,i=Je(r??process.cwd());S$(le(i,"package.json"),e,n)},"writePackageJsonSync");const BR=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(Iv(e)){o=e;const a=t?.cache&&typeof t.cache!="boolean"?t.cache:fs;if(t?.cache&&a.has(o))return a.get(o);n=Fv(o,t),i=!0}else n=du(e);if(t?.resolveCatalogs)if(i){const a=Nv(e);a&&Ia(n,a)}else throw new Error("The 'resolveCatalogs' option can only be used on a file path.");Wa(n,t?.strict??!1,t?.ignoreWarnings);const s=n;return i&&t?.cache&&(typeof t.cache=="boolean"?fs:t.cache).set(o,s),s},"parsePackageJsonSync"),mB=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(Iv(e)){o=e;const a=t?.cache&&typeof t.cache!="boolean"?t.cache:fs;if(t?.cache&&a.has(o))return a.get(o);n=await Wv(o,t),i=!0}else n=du(e);if(t?.resolveCatalogs)if(i){const a=await Tv(e);a&&Ia(n,a)}else throw new Error("The 'resolveCatalogs' option can only be used on a file path.");Wa(n,t?.strict??!1,t?.ignoreWarnings);const s=n;return i&&t?.cache&&(typeof t.cache=="boolean"?fs:t.cache).set(o,s),s},"parsePackageJson");ze((e,t,r)=>Tt(e,t,r),"getPackageJsonProperty");ze((e,t)=>er(e,t),"hasPackageJsonProperty");const Hv=ze((e,t,r)=>{const n=Tt(e,"dependencies",{}),i=Tt(e,"devDependencies",{}),o=Tt(e,"peerDependencies",{}),s={...n,...i,...r?.peerDeps===!1?{}:o};for(const a of t)if(er(s,a))return!0;return!1},"hasPackageJsonAnyDependency"),LR=ze(async(e,t,r="dependencies",n={})=>{const i=Tt(e,"dependencies",{}),o=Tt(e,"devDependencies",{}),s=Tt(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||PR&&!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 _R(l.confirm)&&await Eh(a,{...l.installPackage,cwd:l.cwd?Je(l.cwd):void 0,dev:r==="devDependencies"})}},"ensurePackages");var WR=Object.defineProperty,qv=v((e,t)=>WR(e,"name",{value:t,configurable:!0}),"o$c");const pp=["packem.config.js","packem.config.mjs","packem.config.cjs","packem.config.ts","packem.config.cts","packem.config.mts"],FR=/\.(?:js|mjs|cjs|ts|cts|mts)$/,hB=qv(async(e,t="")=>{let r=t;if(!r){for(const n of pp)if(await Ze(le(e,n))){r=`./${n}`;break}}if(!FR.test(r))throw new Error("Invalid packem config file extension. Only .js, .mjs, .cjs, .ts, .cts and .mts extensions are allowed.");return r},"findPackemFile"),gB=qv(async e=>{for(const t of pp)if(await Ze(le(e,t)))return!0;return!1},"hasPackemConfig");var HR=Object.defineProperty,qR=v((e,t)=>HR(e,"name",{value:t,configurable:!0}),"e$5");const zR={esbuild:"esbuild",oxc:"oxc-transform",sucrase:"sucrase",swc:"@swc/core"},cd=qR(async(e,t)=>{const r=Array.isArray(e)?e:[e],n=await O$(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 GR=Object.defineProperty,zv=v((e,t)=>GR(e,"name",{value:t,configurable:!0}),"s$m");const ds=zv(e=>{if(e.endsWith(".mjs")||e.endsWith(".d.mts"))return"esm";if(e.endsWith(".cjs")||e.endsWith(".d.cts"))return"cjs"},"inferExportTypeFromFileName"),Vc=zv((e,t,r,n)=>{if(e==="module-sync")return"esm";if(n){const s=ds(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 Vc(i,o,r,n)},"inferExportType");var UR=Object.defineProperty,KR=v((e,t)=>UR(e,"name",{value:t,configurable:!0}),"x$i");const JR=new Set(["browser","bun","default","deno","electron","import","module-sync","node","node-addons","require","types","workerd",...Ih,...Mh]),fp=KR((e,t,r,n,i)=>{if(!e)return[];if(typeof e=="string"){const o=ds(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:Vc(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",...JR.has(p)?{subKey:p}:{},type:Vc(p,n,t,f),...u&&{ignored:!0}});else{const m=d.replace("./",""),g=u||i.some(E=>m===E||m.startsWith(`${E}/`)),y=fp({[d]:f},t,r,[...n,p],i);g&&y.forEach(E=>{E.ignored=!0}),s=[...s,...y]}}}return s}return[]},"extractExportFilenames");var VR=Object.defineProperty,at=v((e,t)=>VR(e,"name",{value:t,configurable:!0}),"v$n");const Xc=new Map,vn=/\.[^./]+$/,lt=/\.d\.[mc]?ts$/,Yc=/\.d\.mts$/,Qc=/\.d\.cts$/,ud=/\.d\.[mc]ts$/,XR=/^\.\/dist\//,Zc=/^dist\//,YR=/^\//,bi=/^\.\//,QR=/\/$/,pd=/\.\w+$/,fd=/\*.*$/,ZR=/\.(?:tsx?|cts|mts)$/,e_=/\.[cm]?tsx?$/,t_=/^(.+?)\.[^.]*$/,r_=/(?:\*[^/\\]|\.d\.[mc]?ts|\.\w+)$/,ot=at(e=>e===void 0||e==="node16","allowsCompatibleDeclarationUpgrade"),Gv=at((e,t)=>{const r=lt.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 mn(e)},"getFullExtension"),n_=at(async e=>{try{return await Bh.readdir(e,{withFileTypes:!0})}catch(t){const{code:r}=t;if(r==="ENOENT")return[];throw t}},"safeReaddir"),Uv=at(async(e,t)=>{const r=await n_(e);return(await Promise.all(r.map(async n=>{const i=cf.join(e,n.name);return n.isDirectory()?Uv(i,t):n.isFile()?cf.relative(t,i):[]}))).flat()},"getDirectoryFilesRecursive"),i_=at(async e=>{let t=Xc.get(e);return t||(t=Uv(e,e),Xc.set(e,t)),t},"getDirectoryFiles"),dd=at((e,t,r)=>{const n=e.replace(vn,"");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"),ur=at((e,t)=>{let r=e;for(const n of t)r=r.replace("*",n);return r},"substituteWildcards"),o_=at(e=>e.endsWith(".d.mts")?"d.mts":e.endsWith(".d.cts")?"d.cts":"d.ts","resolveDeclarationExtension"),s_=at((e,t)=>e.key==="exports"&&e.subKey===ki?ki:e.key==="exports"&&e.subKey===sf?sf:t,"getEnvironment"),a_=at(e=>{const t=e.replace(XR,"").replace(Zc,"").replace(vn,"").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"),l_=at((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(YR,"");return s.test(u)});if(a)return a;const l=`${n}/${i}`;return e.find(c=>{const u=c.replace(vn,"");return u===l||u.endsWith(`/${i}`)})??void 0},"tryFindPatternFile"),Ut=at((e,t,r,n,i,o,s,a)=>{const l=s_(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 Ih)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=Gv(i.file,o.options.outputExtensionMap),d=i.file.replace(f,""),m=o.options.outDir.replace(bi,""),g=d.replace(new RegExp(`^(./)?${m}/`),""),y=t.replace(vn,"").split("/").pop()??"",E=g.split("/").pop()??"",j=!t.includes(g)&&y!==E;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=lt.test(i.file),w=a.filter(A=>A.exportKey===i.exportKey),h=w.length>0&&w.every(A=>lt.test(A.file));if(b&&o.options.declaration!==!1){R.declaration=o.options.declaration;const A=o_(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=w.some(O=>Yc.test(O.file)),_=w.some(O=>Qc.test(O.file));if(A&&_?(ot(o.options.declaration)&&(o.options.declaration="compatible"),o.options.emitCJS=!0,o.options.emitESM=!0):_?(o.options.emitCJS=!0,ot(o.options.declaration)&&(o.options.declaration="compatible")):A&&(o.options.emitESM=!0,ot(o.options.declaration)&&(o.options.declaration="compatible")),h){const O=a.filter(B=>lt.test(B.file)),k=O.some(B=>Yc.test(B.file)),C=O.some(B=>Qc.test(B.file));w.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 md=!1;const hd=at(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"),c_=at(async(e,t,r)=>{const n=e.types||e.typings;Xc.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=fp(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=>lt.test(g.file))&&!l.has(d.exportKey)){l.add(d.exportKey);const g=m.some(E=>E.file.endsWith(".d.mts")),y=m.some(E=>E.file.endsWith(".d.cts"));g&&y?(ot(r.options.declaration)&&(r.options.declaration="compatible"),r.options.emitCJS=!0,r.options.emitESM=!0):y?(ot(r.options.declaration)&&(r.options.declaration="compatible"),r.options.emitCJS=!0):g&&(ot(r.options.declaration)&&(r.options.declaration="compatible"),r.options.emitESM=!0)}}r.options.declaration??="node16";const c=a.some(d=>d.type==="esm"&&!Yc.test(d.file)),u=a.some(d=>d.type==="cjs"&&!Qc.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=ds(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:ds(e.main)??o}),e.module&&a.push({file:e.module,key:"module",type:"esm"}),n&&(hd(r),ot(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&&!lt.test(y.file)&&y.file.endsWith(".mjs")),m=a.some(y=>!y.isExecutable&&!lt.test(y.file)&&y.file.endsWith(".cjs")),g=a.some(y=>!y.isExecutable&&!lt.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=lt.test(d.file),g=Gv(d.file,r.options.outputExtensionMap),y=[...ks];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&&ZR.test(d.file))continue;let E=d.type;if(!E&&m){if(d.file.endsWith(".d.mts"))E="esm";else if(d.file.endsWith(".d.cts"))E="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?E=void 0:E=r.pkg.type==="module"?"esm":"cjs"}}if(lt.test(d.file)||(r.options.emitCJS===void 0&&(E==="cjs"||d.type==="cjs")&&(r.options.emitCJS=!0),r.options.emitESM===void 0&&(E==="esm"||d.type==="esm")&&(r.options.emitESM=!0)),ot(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(r_,""));const R=j.endsWith("/");if(R&&["./","/"].includes(j))continue;const b=j.replace(new RegExp(`(./)?${r.options.outDir}`),r.options.sourceDir).replace("./",""),w=R?"":String.raw`(\.d\.[cm]?ts|(\.[cm]?[tj]sx?))$`,h="(?:^|/)";if((d.file.includes("/*")||j.includes("*"))&&d.key==="exports"){md||(r.logger.debug("Private subfolders are not supported, if you need this feature please open an issue on GitHub."),md=!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(Zc,"");const C=d.file,B=pd.exec(C);if(C.includes("*")&&!B&&d.exportKey&&!d.subKey){const K=C.replace(fd,"").replace(bi,""),F=k.replace(fd,"").replace(bi,"");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(bi,""),q=ve(r.options.rootDir,J),X=[],te=await i_(q),re=C.split("*").length-1,I=k.split("*").length-1;for(const K of te){const F=dd(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=ur(C,F.slice(0,re));U.includes("*")||X.push({input:ve(q,K),output:U})}continue}const W=K.replace(vn,"").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=ur(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=ur(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=ur(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(Zc,"");K=K.replace(pd,"");for(const F of te){const N=dd(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=ur(C,N);z.includes("*")||X.push({input:ve(q,F),output:z});continue}}const W=F.replace(vn,""),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=ur(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=ur(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=>lt.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?(ot(r.options.declaration)&&(r.options.declaration="compatible"),r.options.emitCJS=!0,r.options.emitESM=!0):N?(ot(r.options.declaration)&&(r.options.declaration="compatible"),r.options.emitCJS=!0):F&&(ot(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(ud,".d.ts");else if(!z.endsWith(".d.ts")){const D=z.replace(ud,".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=lt.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`\$&`)+w);let _=t.find(k=>A.test(k));if(_===void 0){const k=r.options.sourceDir.replace(bi,""),C=ve(r.options.rootDir,k),B=a_(d.file);if(B){const J=l_(t,B.baseName,B.pattern,C);if(J)_=J;else{const q=B.baseName,X=new RegExp(h+q.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)+w);_=t.find(te=>X.test(te))}}else{const J=b.replace(t_,"$1").replace(QR,"");if(Mh.has(d.subKey)){const q=new RegExp(h+J.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)+w);_=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(_)&&e_.test(_)&&hd(r);const O=a.filter(k=>k.exportKey===d.exportKey);if(O.length>0&&O.every(k=>lt.test(k.file))){const k=O.some(J=>J.file.endsWith(".d.mts")),C=O.some(J=>J.file.endsWith(".d.cts"));k&&C?(ot(r.options.declaration)&&(r.options.declaration="compatible"),r.options.emitCJS=!0,r.options.emitESM=!0):C?(ot(r.options.declaration)&&(r.options.declaration="compatible"),r.options.emitCJS=!0):k&&(ot(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=R$(_.replace(vu,"")),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 u_=Object.defineProperty,Kv=v((e,t)=>u_(e,"name",{value:t,configurable:!0}),"n$f");const ii=Kv(e=>typeof e=="string"&&e!=="","isNonEmptyString"),p_=Kv((e,t)=>{const{publishConfig:r}=e;return r&&(r.bin&&(typeof r.bin=="object"||typeof r.bin=="string")&&(e.bin=r.bin),ii(r.type)&&(e.type=r.type),ii(r.main)&&(e.main=r.main),ii(r.module)&&(e.module=r.module),t===void 0&&ii(r.types)?e.types=r.types:t===void 0&&ii(r.typings)&&(e.typings=r.typings),r.exports&&typeof r.exports=="object"&&(e.exports=r.exports)),e},"overwriteWithPublishConfig");var f_=Object.defineProperty,d_=v((e,t)=>f_(e,"name",{value:t,configurable:!0}),"p$m");const gd=/.*\/dist\/.*/,vd=/\/$/,m_={hooks:{"build:prepare":d_(async function(e){if(e.options.unbundle){e.options.entries.length=0;const s=le(e.options.rootDir,e.options.sourceDir);if(!Ft(s))throw new Error("No 'src' directory found. Please provide entries manually.");const a=Af(s,{extensions:[],includeDirs:!1,includeSymlinks:!1,skip:[hr,gd]}).filter(l=>dr.test(l)&&!l.endsWith(".d.ts"));for(const l of a){const c=l.replace(`${s}/`,"").replace(dr,"").replaceAll("/","/");e.options.entries.push({input:l,name:c})}return}if(e.options.entries.length>0)return;const t=le(e.options.rootDir,e.options.sourceDir);if(!Ft(t))throw new Error("No 'src' directory found. Please provide entries manually.");const r=Af(t,{extensions:[],includeDirs:!1,includeSymlinks:!1,skip:[hr,gd]});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=p_(i,e.options.declaration));const o=await c_(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:",Ce(e.options.entries.map(s=>s.fileAlias?`${ut(s.fileAlias)} => ${ut(s.input.replace(`${e.options.rootDir}/`,"").replace(vd,"/*"))}`:ut(s.input.replace(`${e.options.rootDir}/`,"").replace(vd,"/*"))).join(", ")),_t([e.options.emitESM&&"esm",e.options.emitCJS&&"cjs",e.options.declaration&&"dts"].filter(Boolean).map(s=>`[${s}]`).join(" ")))},"build:prepare")}};var h_=Object.defineProperty,Ee=v((e,t)=>h_(e,"name",{value:t,configurable:!0}),"r$5");const g_=De(import.meta.url),Ur=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,dp=Ee(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 g_(e)},"__cjs_getBuiltinModule"),{existsSync:sn}=dp("node:fs"),{env:an,cwd:Jv}=Ur,{createRequire:yo}=dp("node:module"),Vv=0,ln=2,Xv=Symbol("findUpStop"),mp=Ee(e=>{if(!e||!(e instanceof URL)&&typeof e!="string")throw new TypeError("Path must be a non-empty string or URL.")},"assertValidFileOrDirectoryPath"),bd=Ee(e=>{if(e.isFile())return"file";if(e.isDirectory())return"dir";if(e.isSymbolicLink())return"symlink"},"getFileInfoType"),v_=yo(import.meta.url),oi=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,b_=Ee(e=>{if(typeof oi<"u"&&oi.versions&&oi.versions.node){const[t,r]=oi.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return oi.getBuiltinModule(e)}return v_(e)},"__cjs_getBuiltinModule$5"),{lstatSync:yd,mkdirSync:y_}=b_("node:fs"),$_=Ee(e=>{mp(e);try{const t=yd(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(bd(t))}'`);return}catch(t){if(t.code!=="ENOENT")throw t}try{y_(e,{recursive:!0})}catch(t){if(t.code!=="EEXIST")throw t;const r=yd(e);if(!r.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(bd(r))}'`,{cause:t})}},"ensureDirSync"),x_=/^[A-Z]:\//i,$o=Ee((e="")=>e&&e.replaceAll("\\","/").replace(x_,t=>t.toUpperCase()),"normalizeWindowsPath$1"),w_=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,E_=/^[A-Z]:$/i,S_=/.(\.[^./]+)$/,k_=/^[/\\]|^[a-z]:[/\\]/i,j_=/\/$/,A_=Ee(()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd"),O_=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"),Ii=Ee(e=>w_.test(e),"isAbsolute$1"),cn=Ee(function(...e){e=e.map(n=>$o(n));let t="",r=!1;for(let n=e.length-1;n>=-1&&!r;n--){const i=n>=0?e[n]:A_();!i||i.length===0||(t=`${i}/${t}`,r=Ii(i))}return t=O_(t,!r),r&&!Ii(t)?`/${t}`:t.length>0?t:"."},"resolve"),R_=Ee(function(e){return S_.exec($o(e))?.[1]??""},"extname"),hp=Ee(e=>{const t=$o(e).replace(j_,"").split("/").slice(0,-1);return t.length===1&&E_.test(t[0])&&(t[0]=`${t[0]}/`),t.join("/")||(Ii(e)?"/":".")},"dirname$1"),__=Ee((e,t)=>{const r=$o(e).split("/").pop();return t&&r.endsWith(t)?r.slice(0,-t.length):r},"basename"),Yv=Ee(function(e){const t=k_.exec(e)?.[0]?.replaceAll("\\","/")??"",r=__(e),n=R_(r);return{base:r,dir:hp(e),ext:n,name:r.slice(0,r.length-n.length),root:t}},"parse"),P_=yo(import.meta.url),si=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,C_=Ee(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 P_(e)},"__cjs_getBuiltinModule$4"),{fileURLToPath:T_}=C_("node:url");function Qv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}v(Qv,"_e$2");Ee(Qv,"getDefaultExportFromCjs");var $d,xd;function Zv(){return xd||(xd=1,$d=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cr3","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),$d}v(Zv,"ye$2");Ee(Zv,"requireBinaryExtensions");var N_=Zv();const I_=Qv(N_);new Set(I_);const bn=Ee(e=>$o(e instanceof URL?T_(e):e),"toPath"),M_=yo(import.meta.url),ai=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,eb=Ee(e=>{if(typeof ai<"u"&&ai.versions&&ai.versions.node){const[t,r]=ai.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return ai.getBuiltinModule(e)}return M_(e)},"__cjs_getBuiltinModule$3"),{stat:D_,lstat:B_}=eb("node:fs/promises"),{fileURLToPath:L_}=eb("node:url"),W_=Ee(async(e,t={})=>{const r=t.cwd?bn(t.cwd):process.cwd();let n=cn(r);const{root:i}=Yv(n),o=bn(t.stopAt??i),s=cn(n,o),a=t.type??"file",l=Ee(async function(u){return[e]},"getMatchers");t.allowSymlinks??=!0;const c=t.allowSymlinks?D_:B_;for(;n&&n!==s&&n!==i;){const u=await l();for(let p of u){if(p===Xv)return;if(p===void 0)continue;Buffer.isBuffer(p)?p=p.toString():p instanceof URL&&(p=L_(p));const f=Ii(p)?p:cn(n,p);try{const d=await c(f);if(a==="file"&&d.isFile()||a==="directory"&&d.isDirectory())return f}catch{}}n=hp(n)}},"findUp"),F_=yo(import.meta.url),li=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,tb=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 F_(e)},"__cjs_getBuiltinModule$2"),{statSync:H_,lstatSync:q_}=tb("node:fs"),{fileURLToPath:z_}=tb("node:url"),G_=Ee((e,t={})=>{const r=t.cwd?bn(t.cwd):process.cwd();let n=cn(r);const{root:i}=Yv(n),o=bn(t.stopAt??i),s=cn(n,o),a=t.type??"file",l=Ee(function(u){return[e]},"getMatchers");t.allowSymlinks??=!0;const c=t.allowSymlinks?H_:q_;for(;n&&n!==s&&n!==i;){for(let u of l()){if(u===Xv)return;if(u===void 0)continue;Buffer.isBuffer(u)?u=u.toString():u instanceof URL&&(u=z_(u));const p=Ii(u)?u:cn(n,u);try{const f=c(p);if(a==="file"&&f.isFile()||a==="directory"&&f.isDirectory())return p}catch{}}n=hp(n)}},"findUpSync"),U_=yo(import.meta.url),ci=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,K_=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 U_(e)},"__cjs_getBuiltinModule$1"),{access:J_}=K_("node:fs/promises");async function Qo(e,t=Vv){mp(e),e=bn(e);try{return await J_(e,t),!0}catch{return!1}}v(Qo,"N$f");Ee(Qo,"isAccessible");const{accessSync:V_}=dp("node:fs");function Zo(e,t=Vv){mp(e),e=bn(e);try{return V_(e,t),!0}catch{return!1}}v(Zo,"z$a");Ee(Zo,"isAccessibleSync");let rb=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 X_=/^[A-Z]:\//i,nb=Ee((e="")=>e&&e.replaceAll("\\","/").replace(X_,t=>t.toUpperCase()),"normalizeWindowsPath"),Y_=/^[/\\]{2}/,Q_=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,ib=/^[A-Z]:$/i,Z_=/\/$/,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"),eu=Ee(e=>Q_.test(e),"isAbsolute"),tP=Ee(function(e){if(e.length===0)return".";e=nb(e);const t=Y_.exec(e),r=eu(e),n=e.at(-1)==="/";return e=eP(e,!r),e.length===0?r?"/":n?"./":".":(n&&(e+="/"),ib.test(e)&&(e+="/"),t?r?`//${e}`:`//./${e}`:r&&!eu(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 tP(t)},"join"),ob=Ee(e=>{const t=nb(e).replace(Z_,"").split("/").slice(0,-1);return t.length===1&&ib.test(t[0])&&(t[0]=`${t[0]}/`),t.join("/")||(eu(e)?"/":".")},"dirname"),ms=Ee((e,t)=>(t?.create&&$_(e),e),"useDirectory");Ee(async(e,t)=>{if(an.CACHE_DIR&&!["0","1","false","true"].includes(an.CACHE_DIR))return ms(Zt(an.CACHE_DIR,e),t);const r=await W_("package.json",{cwd:t?.cwd??Jv(),type:"file"});if(!r){if(t?.throwError)throw new rb("No such file or directory found.");return}const n=Zt(ob(r),"node_modules"),i=Zt(n,".cache"),o=Zt(i,e);if(!(sn(o)&&!await Qo(o,ln))&&!(sn(i)&&!await Qo(i,ln))&&!(sn(n)&&!await Qo(n,ln)))return ms(o,t)},"findCacheDirectory");const rP=Ee((e,t)=>{if(an.CACHE_DIR&&!["0","1","false","true"].includes(an.CACHE_DIR))return ms(Zt(an.CACHE_DIR,e),t);const r=G_("package.json",{cwd:t?.cwd??Jv(),type:"file"});if(!r){if(t?.throwError)throw new rb("No such file or directory found.");return}const n=Zt(ob(r),"node_modules"),i=Zt(n,".cache"),o=Zt(i,e);if(!(sn(o)&&!Zo(o,ln))&&!(sn(i)&&!Zo(i,ln))&&!(sn(n)&&!Zo(n,ln)))return ms(o,t)},"findCacheDirectorySync"),nP=rP;var iP=Object.defineProperty,Fa=v((e,t)=>iP(e,"name",{value:t,configurable:!0}),"l$m");const oP=/^(?<value>-?\d+(?:[.,]\d+)*) *(?<type>[a-z]+)?$/i,sP=/^KIBI/,aP=/^MIBI/,lP=/^GIBI/,cP=/^TEBI/,uP=/^PEBI/,pP=/^EXBI/,fP=/^ZEBI/,dP=/^YIBI/,mP=/^(.)IB$/,sb={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"}]},hP=Fa((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"),ab=Fa(e=>{switch(e){case 2:return 1024;case 10:return 1e3;default:throw new Error("Unsupported base.")}},"fromBase"),gP=Fa((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=hP(n.value,r.locale),o=(n.type??"Bytes").toUpperCase().replace(sP,"KILO").replace(aP,"MEGA").replace(lP,"GIGA").replace(cP,"TERA").replace(uP,"PETA").replace(pP,"EXA").replace(fP,"ZETTA").replace(dP,"YOTTA").replace(mP,"$1B"),s=sb[r.units].findIndex(l=>l.short[0].toUpperCase()===o[0]),a=ab(r.base);return i*a**s},"parseBytes"),Qe=Fa((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=ab(r),u=Math.abs(e),p=t?.space??!0?" ":"",f=sb[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,E=n<0?void 0:n;return new Intl.NumberFormat(i,{maximumFractionDigits:E,minimumFractionDigits:E,...l}).format(y)+p+g},"formatBytes");var vP=Object.defineProperty,bP=v((e,t)=>vP(e,"name",{value:t,configurable:!0}),"n$e");const yP=bP((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"),$P={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"},xP=yP(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",".",$P,",","_");var wP=Object.defineProperty,EP=v((e,t)=>wP(e,"name",{value:t,configurable:!0}),"o$9");const SP=EP(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 kP=Object.defineProperty,xo=v((e,t)=>kP(e,"name",{value:t,configurable:!0}),"g$i");const lb=xo((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"),wd=xo(({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=lb(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"),jP=xo((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=lb(l,t.maxDecimalPoints))}l&&u.push({unitCount:l,unitName:s})}return u},"getPieces"),AP=xo((e,t,r)=>{const{language:n,units:i}=t;if(e.length===0){const p=i.at(-1);return wd({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=>wd(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"),Ed=xo((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:xP,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};SP(r.language);const n=Math.abs(e),i=jP(n,r);return AP(i,r,e)},"duration");var OP=Object.defineProperty,cb=v((e,t)=>OP(e,"name",{value:t,configurable:!0}),"l$l");const Sd=cb(async e=>{try{const t=await e();return typeof t.rolldown=="function"?t.rolldown:void 0}catch{return}},"tryImport"),ub=cb(async()=>{const e=await Sd(()=>import("@rolldown/node"));if(e)return e;const t=await Sd(()=>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 RP=Object.defineProperty,_P=v((e,t)=>RP(e,"name",{value:t,configurable:!0}),"_$b"),PP=Object.defineProperty,CP=_P((e,t)=>PP(e,"name",{value:t,configurable:!0}),"j"),TP=Object.defineProperty,Dr=CP((e,t)=>TP(e,"name",{value:t,configurable:!0}),"u");const pb="__packem_cache_wrapped",tu="__packem_watch_files",Kt=Dr(e=>typeof e=="function"?e:e.handler,"getHandler"),Il=Dr(e=>{if(e&&typeof e=="object"&&"filter"in e)return e.filter},"getHookFilter"),kd=new Map,NP=Dr(e=>{const t=JSON.stringify(e);let r=kd.get(t);return r===void 0&&(r=Wt(t),kd.set(t,r)),r},"hashResolveOptions"),IP=Dr(e=>e!==null&&typeof e=="object"&&e[pb]===!0,"isWrappedCacheValue"),MP=Dr(e=>e!==null&&typeof e=="object"&&Array.isArray(e[tu]),"isWatchFilesCacheValue"),To=Dr(e=>IP(e)?e.data:e,"unwrapCachedValue"),Ye=Dr((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&&T$(c)){const g=Ah(c);u=Wt(g)}}catch{}const p=le("load",Wt(l),u),f=await t.get(p,n);if(f!==void 0)return To(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,[pb]:!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):"",NP(u)),f=await t.get(p,n);if(f!==void 0)return To(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=To(p);if(MP(g)){for(const y of g[tu])this.addWatchFile(y);return To(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,{[tu]:f,result:m},n):t.set(u,m,n),m}},o=Il(e.load),s=Il(e.resolveId),a=Il(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 DP=Object.defineProperty,BP=v((e,t)=>DP(e,"name",{value:t,configurable:!0}),"f$k"),LP=Object.defineProperty,WP=BP((e,t)=>LP(e,"name",{value:t,configurable:!0}),"c"),FP=Object.defineProperty,HP=WP((e,t)=>FP(e,"name",{value:t,configurable:!0}),"c");const qP=HP(()=>({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 zP=Object.defineProperty,GP=v((e,t)=>zP(e,"name",{value:t,configurable:!0}),"n$d"),UP=Object.defineProperty,KP=GP((e,t)=>UP(e,"name",{value:t,configurable:!0}),"s"),JP=Object.defineProperty,VP=KP((e,t)=>JP(e,"name",{value:t,configurable:!0}),"i");const XP=VP(()=>({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(Q$,"")}-${e.format??"unknown"}.json`,source:JSON.stringify(r,void 0,2),type:"asset"})},name:"packem:metafile"}),"metafilePlugin");var YP=Object.defineProperty,QP=v((e,t)=>YP(e,"name",{value:t,configurable:!0}),"a$h"),ZP=Object.defineProperty,eC=QP((e,t)=>ZP(e,"name",{value:t,configurable:!0}),"l"),tC=Object.defineProperty,rC=eC((e,t)=>tC(e,"name",{value:t,configurable:!0}),"r");const nC=/^file:\/\//,fb=rC(()=>({name:"packem:resolve-file-url",resolveId:{filter:{id:nC},handler(e){if(e.startsWith("file://"))return hx(e)}}}),"resolveFileUrl");var iC=Object.defineProperty,oC=v((e,t)=>iC(e,"name",{value:t,configurable:!0}),"a$g"),sC=Object.defineProperty,aC=oC((e,t)=>sC(e,"name",{value:t,configurable:!0}),"n"),lC=Object.defineProperty,cC=aC((e,t)=>lC(e,"name",{value:t,configurable:!0}),"s");const uC=/^(\w+)-runtime$/,pC=cC(e=>{const t=$t(e).split(".");if(t.length>=2){const[r,n]=t.slice(-2),i=t[0]??"",o=uC.exec(r)?.[1];if(ks.includes(n)&&o&&o.length>0)return`${i}-${o}`}},"getCustomModuleLayer");var fC=Object.defineProperty,dC=v((e,t)=>fC(e,"name",{value:t,configurable:!0}),"a$f"),mC=Object.defineProperty,hC=dC((e,t)=>mC(e,"name",{value:t,configurable:!0}),"t"),gC=Object.defineProperty,vC=hC((e,t)=>gC(e,"name",{value:t,configurable:!0}),"t");const bC=/^use /,Ai=vC(e=>(e.preserveDirectives??{directives:[]}).directives.map(t=>t.replace(bC,"")).find(t=>t!=="strict"),"getModuleLayer");var yC=Object.defineProperty,$C=v((e,t)=>yC(e,"name",{value:t,configurable:!0}),"w$d"),xC=Object.defineProperty,wC=$C((e,t)=>xC(e,"name",{value:t,configurable:!0}),"I"),EC=Object.defineProperty,hs=wC((e,t)=>EC(e,"name",{value:t,configurable:!0}),"p");const SC=/[\\/]node_modules[\\/]@swc[\\/]helper/,Ml=ox(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)}),db=hs((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=Ai(i.meta);if(o)return r.set(e,o),o;let s;for(const a of i.importers){const l=db(a,t,r,n);if(l){s=l;break}}return r.set(e,s),s},"getEffectiveModuleLayer"),kC=hs((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=Ai(s.meta);if(a)i.add(a);else{const l=db(o,t,r,new Set([e]));l&&i.add(l)}}return i},"getImporterLayers"),jC=hs((e,t,r=!0)=>{const n=new Map,i=new Map;return hs(function(o,s){if(SC.test(o))return"cc";const a=s.getModuleInfo(o);if(!a)return;const{isEntry:l}=a,c=a.meta;let u=Ai(c);if(u&&(u=Ml(u)),!l){const p=n.get(o);if(p)return p;const f=pC(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&&Ai(d.meta)===u&&(e.has(f)||e.set(f,new Set),e.get(f).add([o,u]))}}if(r&&!u&&!l){const p=kC(o,s.getModuleInfo,i);if(p.size>1){if(n.has(o))return n.get(o);const f=$t(o,mn(o)),d=[...p].toSorted((g,y)=>g.localeCompare(y)).join("-"),m=`${f}-${Ml(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 Ai(y?y.meta:{})===u}return!1}))return;if(p.every(([,g])=>g===u))return n.has(o)?n.get(o):void 0;const f=$t(o,mn(o)),d=Ml(u),m=`${f}-${d}`;return n.set(o,m),m}},"splitChunks")},"createSplitChunks");var AC=Object.defineProperty,OC=v((e,t)=>AC(e,"name",{value:t,configurable:!0}),"i$a"),RC=Object.defineProperty,_C=OC((e,t)=>RC(e,"name",{value:t,configurable:!0}),"i"),PC=Object.defineProperty,CC=_C((e,t)=>PC(e,"name",{value:t,configurable:!0}),"i");const Ha=CC((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 TC=Object.defineProperty,NC=v((e,t)=>TC(e,"name",{value:t,configurable:!0}),"f$i"),IC=Object.defineProperty,MC=NC((e,t)=>IC(e,"name",{value:t,configurable:!0}),"f"),DC=Object.defineProperty,gp=MC((e,t)=>DC(e,"name",{value:t,configurable:!0}),"u");const BC=/\.tsx?$/,LC=/['"]use memo['"]/,WC=gp(e=>e.find(t=>t==="babel-plugin-react-compiler"||Array.isArray(t)&&t[0]==="babel-plugin-react-compiler"),"getReactCompilerPlugin"),FC=gp((e,t)=>{if(e.length===0)return;const r=WC(e);if(!(!r||!Array.isArray(r))&&r[1]?.compilationMode==="annotation"&&!LC.test(t)){const n=e.indexOf(r);n!==-1&&e.splice(n,1)}},"filterReactCompilerByAnnotation"),HC=gp(({exclude:e,filename:t,generatorOpts:r,include:n,sourceFileName:i,...o})=>{const s=Mt(n,e??hr);return{name:"packem:babel",async transform(a,l){if(!s(l))return;let c=[];o.plugins&&Array.isArray(o.plugins)&&(c=[...o.plugins]),c.length>0&&FC(c,a);const u=[];(l.endsWith(".jsx")||l.endsWith(".tsx"))&&u.push("jsx"),BC.test(l)&&u.push("typescript");const p=o.parserOpts?.plugins;p&&Array.isArray(p)&&u.unshift(...p);const f=[...new Set(u)],d=await gx(a,{...o,filename:t??l,generatorOpts:{...r,decoratorsBeforeExport:!0,importAttributesKeyword:"with"},parserOpts:{...o.parserOpts,allowAwaitOutsideFunction:!0,plugins:f.length>0?f:[],sourceType:"module"},plugins:c.length>0?c:[],sourceFileName:i??l});if(d?.code)return{code:d.code,map:d.map??void 0}}}},"babelTransformPlugin");var qC=Object.defineProperty,zC=v((e,t)=>qC(e,"name",{value:t,configurable:!0}),"l$h"),GC=Object.defineProperty,UC=zC((e,t)=>GC(e,"name",{value:t,configurable:!0}),"l"),KC=Object.defineProperty,JC=UC((e,t)=>KC(e,"name",{value:t,configurable:!0}),"u");const VC=JC((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 Pw(Lc(s.src),{ignore:Lc(s.exclude).filter(Boolean)}).then(a=>({dest:s.dest??"",parent:qw(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?dn(s.dest):le(s.dest,et(s.parent,Te(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 zi(s);if(!c.isFile())return;const u=c.mtime.getTime();u>a.timestamp&&(a.timestamp=u,a.copied=[]),l=await Sr(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=$t(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 XC=Object.defineProperty,mb=v((e,t)=>XC(e,"name",{value:t,configurable:!0}),"s$f"),YC=Object.defineProperty,vp=mb((e,t)=>YC(e,"name",{value:t,configurable:!0}),"m");const hb={"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(hb);const gb={"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(gb);var QC=Object.defineProperty,ZC=vp((e,t)=>QC(e,"name",{value:t,configurable:!0}),"g"),mt=vp(function(e,t,r,n){if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},"n"),Kr,yi,pr;let eT=class{static{v(this,"j")}static{mb(this,"w")}static{vp(this,"p")}static{ZC(this,"Mime")}constructor(...t){Kr.set(this,new Map),yi.set(this,new Map),pr.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,pr,"f").has(n)||mt(this,pr,"f").set(n,new Set);const o=mt(this,pr,"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,yi,"f").set(n,a),s=!1,l)continue;const c=mt(this,Kr,"f").get(a);if(c&&c!=n&&!r)throw new Error(`"${n} -> ${a}" conflicts with "${c} -> ${a}". Pass \`force=true\` to override this definition.`);mt(this,Kr,"f").set(a,n)}}return this}getType(t){if(typeof t!="string")return null;const r=t.replace(/^.*[/\\]/s,"").toLowerCase(),n=r.replace(/^.*\./s,"").toLowerCase(),i=r.length<t.length;return!(n.length<r.length-1)&&i?null:mt(this,Kr,"f").get(n)??null}getExtension(t){return typeof t!="string"?null:(t=t?.split?.(";")[0],(t&&mt(this,yi,"f").get(t.trim().toLowerCase()))??null)}getAllExtensions(t){return typeof t!="string"?null:mt(this,pr,"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,pr,"f").values())Object.freeze(t);return this}_getTestState(){return{types:mt(this,Kr,"f"),extensions:mt(this,yi,"f")}}};Kr=new WeakMap,yi=new WeakMap,pr=new WeakMap;const vb=new eT(gb,hb)._freeze();var tT=Object.defineProperty,rT=v((e,t)=>tT(e,"name",{value:t,configurable:!0}),"c$l"),nT=Object.defineProperty,iT=rT((e,t)=>nT(e,"name",{value:t,configurable:!0}),"c"),oT=Object.defineProperty,sT=iT((e,t)=>oT(e,"name",{value:t,configurable:!0}),"l");const aT=/\?data-uri/,lT=sT((e={})=>{const t=Mt(e.include??[aT],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=vb.getType(i)??"application/octet-stream";if(a==="image/svg+xml"){const u=await Sr(i,{buffer:!1}),p=o==="css"?Z$(u):ex(u);return`export default "${s?p.replaceAll(" ","%20"):p}"`}const l=await Sr(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 cT=Object.defineProperty,uT=v((e,t)=>cT(e,"name",{value:t,configurable:!0}),"v$g"),pT=Object.defineProperty,fT=uT((e,t)=>pT(e,"name",{value:t,configurable:!0}),"v"),dT=Object.defineProperty,qe=fT((e,t)=>dT(e,"name",{value:t,configurable:!0}),"u");const mT=/\.[mc]?tsx?(?:\?.*)?$/,hT=/(?:\.[tj]sx?|\/index\.[tj]sx?)(?:\?.*)?$/,gT=/^\s*export/,vT=/^(?:import|export)\s+([\w$]+)/,bT=/([\w$]+)\s*,\s*\{|\}\s*,\s*([\w$]+)/,Dl=/[{,]\s*(type\s+)?([\w$]+)(?:\s+as\s+([\w$]+))?/gi,yT=/default\s+([a-zA-Z_$][\w$]*)(?:[;\n]|$)/,$T=/([\w$]+)\s*as\s*$/,xT=/^export\s+\*(?!\s+as)/,wT=/\bas\b/,ET={exports:[],facade:!1,imports:[]},bb=qe(e=>mT.test(e),"isSourceFile"),yb=qe(e=>e.includes("/build/cache/vite/")||e.includes("/node_modules/"),"isIgnoredModule"),ST=qe((e,t)=>yb(e)?!1:hT.test(e)?!0:t.possibleBarrelFiles?t.possibleBarrelFiles.some(r=>typeof r=="string"?e.includes(r):r.test(e)):!1,"isPossibleBarrelSpecifier"),$b=qe(e=>gT.test(e)?"export":"import","getDeclarationKind"),{parseAsync:kT}=$x,xb=qe(async(e,t,r)=>{try{const{output:n}=await kT({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"}),ET}},"safeParse"),jT=qe(async(e,t,r,n)=>{const i=e.parseCache.get(t);if(i!==void 0)return i;const o=await xb(t,r,n);return e.parseCache.set(t,o),o},"parsePotentialBarrelFile"),wb=qe((e,t)=>{const r=e.fileCache.get(t);if(r!==void 0)return r;const n=Bh.readFile(t,"utf8");return e.fileCache.set(t,n),n},"readFileCached"),Eb=qe(e=>{Dl.lastIndex=0;const t=[];if(e.includes("*"))return t;if(!e.includes("{")){const i=vT.exec(e);return i&&t.push({imported:"default",local:i[1]}),t}const r=bT.exec(e);r&&t.push({imported:"default",local:r[1]??r[2]});let n=Dl.exec(e);for(;n!==null;)!n[1]&&n[2]&&t.push({imported:n[2],local:n[3]}),n=Dl.exec(e);return t},"getImportNames"),AT=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??yT.exec(r.slice(e.s))?.[1];o&&(i=t.find(s=>{const a=Eb(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=$T.exec(o)?.[1];s&&(n=s)}}return{imp:i,localExportName:n}},"findMatchingImport"),OT=qe((e,t)=>$b(e)!=="import"||!wT.test(e)?void 0:new RegExp(String.raw`(\w+)\s+as\s+${t}(?!\w)`).exec(e)?.[0],"findAliasedImportName");let Mi;const RT=qe(async(e,t,r,n,i,o,s,a)=>{const{resolve:l}=e,c=AT(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=OT(f,o),m=(await l(u.n,t))?.id;return m?ST(m,s)?Mi(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"),_T=qe(async(e,t,r,n,i,o,s)=>{const a=n.filter(l=>xT.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 Mi(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 Mi(e,p,i,o,s)}))).find(c=>c?.resolved);if(l)return l}},"resolveWildcardReExports");Mi=qe(async(e,t,r,n,i)=>{const o=await wb(e,t),{exports:s,imports:a}=await jT(e,t,o,i);for(const l of s)if(l.n===r)return await RT(e,t,o,l,a,r,n,i);return await _T(e,t,o,a,r,n,i)||{exportName:r,id:t,resolved:!1}},"resolveThroughBarrel");const PT=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"),CT=qe(async(e,t,r,n,i)=>{const o=[],s=await wb(e,t),{imports:a}=await xb(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=Eb(c);if(u.length===0)return;const p=(await e.resolve(l.n,t))?.id;if(!p||!bb(p)||yb(p))return;const f=$b(c);try{const d=await Promise.all(u.map(async m=>{const g=await Mi(e,p,m.imported,n,i),y=PT(g,m,f),E=JSON.stringify(g.id);return`${f} ${y} from ${E}`}));o.push([l.ss,l.se,d.join(";")])}catch(d){i.warn({context:{error:d},message:String(d),prefix:"plugin:debarrel"})}})),o},"getDebarrelModifications"),TT=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"),NT=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(!bb(l)||o&&!o(l))return;const c={fileCache:r,parseCache:n,resolve:this.resolve.bind(this)},u=await CT(c,l,a,e,t);return TT(l,a,u,s)},watchChange(a){r.delete(a),n.delete(a)}}},"debarrelPlugin");var Bl,jd;function IT(){if(jd)return Bl;jd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"u");const r=tt();return Bl=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"),Bl}v(IT,"requireInc");var Ll,Ad;function MT(){if(Ad)return Ll;Ad=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"u");const r=qi();return Ll=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"),Ll}v(MT,"requireDiff");var Wl,Od;function DT(){if(Od)return Wl;Od=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=tt();return Wl=t((i,o)=>new r(i,o).major,"major"),Wl}v(DT,"requireMajor");var Fl,Rd;function BT(){if(Rd)return Fl;Rd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=tt();return Fl=t((i,o)=>new r(i,o).minor,"minor"),Fl}v(BT,"requireMinor");var Hl,_d;function LT(){if(_d)return Hl;_d=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"t");const r=tt();return Hl=t((i,o)=>new r(i,o).patch,"patch"),Hl}v(LT,"requirePatch");var ql,Pd;function WT(){if(Pd)return ql;Pd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"t");const r=qi();return ql=t((i,o)=>{const s=r(i,o);return s&&s.prerelease.length?s.prerelease:null},"prerelease"),ql}v(WT,"requirePrerelease");var zl,Cd;function jt(){if(Cd)return zl;Cd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"c");const r=tt();return zl=t((i,o,s)=>new r(i,s).compare(new r(o,s)),"compare"),zl}v(jt,"requireCompare");var Gl,Td;function FT(){if(Td)return Gl;Td=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"o");const r=jt();return Gl=t((i,o,s)=>r(o,i,s),"rcompare"),Gl}v(FT,"requireRcompare");var Ul,Nd;function HT(){if(Nd)return Ul;Nd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=jt();return Ul=t((i,o)=>r(i,o,!0),"compareLoose"),Ul}v(HT,"requireCompareLoose");var Kl,Id;function bp(){if(Id)return Kl;Id=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"o");const r=tt();return Kl=t((i,o,s)=>{const a=new r(i,s),l=new r(o,s);return a.compare(l)||a.compareBuild(l)},"compareBuild"),Kl}v(bp,"requireCompareBuild");var Jl,Md;function qT(){if(Md)return Jl;Md=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"e");const r=bp();return Jl=t((i,o)=>i.sort((s,a)=>r(s,a,o)),"sort"),Jl}v(qT,"requireSort");var Vl,Dd;function zT(){if(Dd)return Vl;Dd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"e");const r=bp();return Vl=t((i,o)=>i.sort((s,a)=>r(a,s,o)),"rsort"),Vl}v(zT,"requireRsort");var Xl,Bd;function qa(){if(Bd)return Xl;Bd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=jt();return Xl=t((i,o,s)=>r(i,o,s)>0,"gt"),Xl}v(qa,"requireGt");var Yl,Ld;function yp(){if(Ld)return Yl;Ld=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=jt();return Yl=t((i,o,s)=>r(i,o,s)<0,"lt"),Yl}v(yp,"requireLt");var Ql,Wd;function Sb(){if(Wd)return Ql;Wd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=jt();return Ql=t((i,o,s)=>r(i,o,s)===0,"eq"),Ql}v(Sb,"requireEq");var Zl,Fd;function kb(){if(Fd)return Zl;Fd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=jt();return Zl=t((i,o,s)=>r(i,o,s)!==0,"neq"),Zl}v(kb,"requireNeq");var ec,Hd;function $p(){if(Hd)return ec;Hd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=jt();return ec=t((i,o,s)=>r(i,o,s)>=0,"gte"),ec}v($p,"requireGte");var tc,qd;function xp(){if(qd)return tc;qd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"r");const r=jt();return tc=t((i,o,s)=>r(i,o,s)<=0,"lte"),tc}v(xp,"requireLte");var rc,zd;function jb(){if(zd)return rc;zd=1;var e=Object.defineProperty,t=v((c,u)=>e(c,"name",{value:u,configurable:!0}),"n");const r=Sb(),n=kb(),i=qa(),o=$p(),s=yp(),a=xp();return rc=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"),rc}v(jb,"requireCmp");var nc,Gd;function GT(){if(Gd)return nc;Gd=1;var e=Object.defineProperty,t=v((a,l)=>e(a,"name",{value:l,configurable:!0}),"u");const r=tt(),n=qi(),{safeRe:i,t:o}=Es();return nc=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"),nc}v(GT,"requireCoerce");var ic,Ud;function UT(){if(Ud)return ic;Ud=1;var e=Object.defineProperty,t=v((c,u)=>e(c,"name",{value:u,configurable:!0}),"t");const r=qi(),n=gu(),i=tt(),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 ic=o,ic}v(UT,"requireTruncate");var oc,Kd;function KT(){if(Kd)return oc;Kd=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 oc=r,oc}v(KT,"requireLrucache");var sc,Jd;function At(){if(Jd)return sc;Jd=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&&E))+":"+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=>w(F,K)&&M.set.some(N=>w(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}}sc=n;const i=KT(),o=new i,s=Oh(),a=za(),l=Rh(),c=tt(),{safeRe:u,src:p,t:f,comparatorTrimReplace:d,tildeTrimReplace:m,caretTrimReplace:g}=Es(),{FLAG_INCLUDE_PRERELEASE:y,FLAG_LOOSE:E}=gu(),j=new RegExp(p[f.BUILD],"g"),R=t(I=>I.value==="<0.0.0-0","isNullSet"),b=t(I=>I.value==="","isAny"),w=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 sc}v(At,"requireRange");var ac,Vd;function za(){if(Vd)return ac;Vd=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(">")))}}ac=n;const i=Oh(),{safeRe:o,t:s}=Es(),a=jb(),l=Rh(),c=tt(),u=At();return ac}v(za,"requireComparator");var lc,Xd;function wo(){if(Xd)return lc;Xd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"t");const r=At();return lc=t((i,o,s)=>{try{o=new r(o,s)}catch{return!1}return o.test(i)},"satisfies"),lc}v(wo,"requireSatisfies");var cc,Yd;function JT(){if(Yd)return cc;Yd=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"t");const r=At();return cc=t((i,o)=>new r(i,o).set.map(s=>s.map(a=>a.value).join(" ").trim().split(" ")),"toComparators"),cc}v(JT,"requireToComparators");var uc,Qd;function VT(){if(Qd)return uc;Qd=1;var e=Object.defineProperty,t=v((o,s)=>e(o,"name",{value:s,configurable:!0}),"c");const r=tt(),n=At();return uc=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"),uc}v(VT,"requireMaxSatisfying");var pc,Zd;function XT(){if(Zd)return pc;Zd=1;var e=Object.defineProperty,t=v((o,s)=>e(o,"name",{value:s,configurable:!0}),"u");const r=tt(),n=At();return pc=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"),pc}v(XT,"requireMinSatisfying");var fc,em;function YT(){if(em)return fc;em=1;var e=Object.defineProperty,t=v((s,a)=>e(s,"name",{value:a,configurable:!0}),"i");const r=tt(),n=At(),i=qa();return fc=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"),fc}v(YT,"requireMinVersion");var dc,tm;function QT(){if(tm)return dc;tm=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"n");const r=At();return dc=t((i,o)=>{try{return new r(i,o).range||"*"}catch{return null}},"validRange"),dc}v(QT,"requireValid");var mc,rm;function wp(){if(rm)return mc;rm=1;var e=Object.defineProperty,t=v((f,d)=>e(f,"name",{value:d,configurable:!0}),"m");const r=tt(),n=za(),{ANY:i}=n,o=At(),s=wo(),a=qa(),l=yp(),c=xp(),u=$p();return mc=t((f,d,m,g)=>{f=new r(f,g),d=new o(d,g);let y,E,j,R,b;switch(m){case">":y=a,E=c,j=l,R=">",b=">=";break;case"<":y=l,E=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 w=0;w<d.set.length;++w){const h=d.set[w];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)&&E(f,_.semver)||_.operator===b&&j(f,_.semver))return!1}return!0},"outside"),mc}v(wp,"requireOutside");var hc,nm;function ZT(){if(nm)return hc;nm=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"s");const r=wp();return hc=t((i,o,s)=>r(i,o,">",s),"gtr"),hc}v(ZT,"requireGtr");var gc,im;function e3(){if(im)return gc;im=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"s");const r=wp();return gc=t((i,o,s)=>r(i,o,"<",s),"ltr"),gc}v(e3,"requireLtr");var vc,om;function t3(){if(om)return vc;om=1;var e=Object.defineProperty,t=v((i,o)=>e(i,"name",{value:o,configurable:!0}),"n");const r=At();return vc=t((i,o,s)=>(i=new r(i,s),o=new r(o,s),i.intersects(o,s)),"intersects"),vc}v(t3,"requireIntersects");var bc,sm;function r3(){if(sm)return bc;sm=1;const e=wo(),t=jt();return bc=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"),bc}v(r3,"requireSimplify");var yc,am;function n3(){if(am)return yc;am=1;var e=Object.defineProperty,t=v((d,m)=>e(d,"name",{value:m,configurable:!0}),"u");const r=At(),n=za(),{ANY:i}=n,o=wo(),s=jt(),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 E of d.set){for(const j of m.set){const R=u(E,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 E,j;for(const k of d)k.operator===">"||k.operator===">="?E=p(E,k,g):k.operator==="<"||k.operator==="<="?j=f(j,k,g):y.add(k.semver);if(y.size>1)return null;let R;if(E&&j&&(R=s(E.semver,j.semver,g),R>0||R===0&&(E.operator!==">="||j.operator!=="<=")))return null;for(const k of y){if(E&&!o(k,String(E),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,w,h,A,_=j&&!g.includePrerelease&&j.semver.prerelease.length?j.semver:!1,O=E&&!g.includePrerelease&&E.semver.prerelease.length?E.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==="<=",E){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(E,k,g),b===k&&b!==E)return!1}else if(E.operator===">="&&!k.test(E.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(w=f(j,k,g),w===k&&w!==j)return!1}else if(j.operator==="<="&&!k.test(j.semver))return!1}if(!k.operator&&(j||E)&&R!==0)return!1}return!(E&&h&&!j&&R!==0||j&&A&&!E&&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 yc=a,yc}v(n3,"requireSubset");var $c,lm;function i3(){if(lm)return $c;lm=1;const e=Es(),t=gu(),r=tt(),n=N$(),i=qi(),o=_h(),s=I$(),a=IT(),l=MT(),c=DT(),u=BT(),p=LT(),f=WT(),d=jt(),m=FT(),g=HT(),y=bp(),E=qT(),j=zT(),R=qa(),b=yp(),w=Sb(),h=kb(),A=$p(),_=xp(),O=jb(),k=GT(),C=UT(),B=za(),J=At(),q=wo(),X=JT(),te=VT(),re=XT(),I=YT(),M=QT(),K=wp(),F=ZT(),N=e3(),W=t3(),V=r3(),U=n3();return $c={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:E,rsort:j,gt:R,lt:b,eq:w,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},$c}v(i3,"requireSemver");var Nt=i3(),o3=Object.defineProperty,s3=v((e,t)=>o3(e,"name",{value:t,configurable:!0}),"s$e"),a3=Object.defineProperty,l3=s3((e,t)=>a3(e,"name",{value:t,configurable:!0}),"s"),c3=Object.defineProperty,Ga=l3((e,t)=>c3(e,"name",{value:t,configurable:!0}),"t");const u3=/(?:^|[^.\w'"`])require(\.resolve)?\(\s*([\w'"`])/,p3=Ga((e,t)=>{if(A$.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),u3.test(e)&&(i=!0),!r&&!n&&!i)return;const o=As(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"),f3=Ga((e,t,r)=>{let n="";return(e||t)&&(n+=`import __cjs_url__ from "node:url"; // -- packem CommonJS __filename shim --
75
+ `),t&&(n+=`import __cjs_path__ from "node:path"; // -- packem CommonJS __dirname shim --
76
+ `),r&&(n+=`import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
77
+ `),(e||t)&&(n+=`const __filename = __cjs_url__.fileURLToPath(import.meta.url);
78
+ `),t&&(n+=`const __dirname = __cjs_path__.dirname(__filename);
79
+ `),r&&(n+=`const require = __cjs_mod__.createRequire(import.meta.url);
80
+ `),n},"generateCJSShim"),d3=Ga((e,t,r)=>{let n="";return r&&(n+=`import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
81
+ `),e&&(n+=`const __filename = import.meta.filename; // -- packem CommonJS __filename shim --
82
+ `),t&&(n+=`const __dirname = import.meta.dirname; // -- packem CommonJS __dirname shim --
83
+ `),r&&(n+=`const require = __cjs_mod__.createRequire(import.meta.url);
84
+ `),n},"generateCJSShimNode20_11"),m3=Ga((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=f3;if(e.engines?.node){const a=Nt.minVersion(e.engines.node);a&&a.major>=20&&a.minor>=11&&(s=d3)}return p3(n,s)}}}},"esmShimCjsSyntaxPlugin");var h3=Object.defineProperty,g3=v((e,t)=>h3(e,"name",{value:t,configurable:!0}),"A$9"),v3=Object.defineProperty,b3=g3((e,t)=>v3(e,"name",{value:t,configurable:!0}),"M"),y3=Object.defineProperty,yt=b3((e,t)=>y3(e,"name",{value:t,configurable:!0}),"f");const ru=/[.*+?^${}()|[\]\\]/g,$3=/.*/,x3=/^(?:\0|\.{1,2}\/)/,w3=/^node:/,E3=/^@visulima\/css-style-inject(?:\/.+)?$/,cm=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(ru,String.raw`\$&`)}$`)):r.warn(`Ignoring wrong entry type #${String(o)} in '${t}' option: ${JSON.stringify(i)}`),n),[]),"getRegExps"),um=new Map,S3=yt((e,t)=>{um.has(e)||t.info({message:`Inlined implicit external "${Ce(e)}". If this is incorrect, add it to the "externals" option.`,prefix:"plugin:packem:externals"}),um.set(e,!0)},"logExternalMessage"),pm=new Set(["node:sqlite","node:test"]),k3=/[\\:]/,j3=yt(e=>e.length>0&&!k3.test(e),"isValidPackageName"),Ep="@types/",fm=yt(e=>{if(e.startsWith("@")){const[t,r]=e.split("/");return`${t??""}/types/${r??""}`}return`${Ep}${e}`},"getAtTypesPackageName"),A3=yt(e=>{if(e.startsWith("@")){const t=e.split("/");if(t[1]==="types")return`@${t[0]??""}/${t.slice(2).join("/")}`}return e.replace(Ep,"")},"getOriginalPackageName"),O3=["peerDependencies","dependencies","optionalDependencies"],Ab=yt((e,t)=>{const r=jx.realpathSync.native(process.cwd()),{pkg:n}=e,i=new Set;for(const b of O3){const w=n[b];if(w)for(const h of Object.keys(w))h.startsWith(Ep)?i.add(A3(h)):i.add(h)}const o=new Set(Object.keys(n.devDependencies??{})),s=e.options.rollup.resolveExternals??{},a=new Set(cm([...e.options.externals??[]],"include",e.logger)),l=new Set(cm([...s.exclude??[]],"exclude",e.logger));if(t?.dtsResolve)if(t.dtsResolve===!0)l.add($3);else for(const b of t.dtsResolve)typeof b=="string"?l.add(new RegExp(`^${b.replaceAll(ru,String.raw`\$&`)}(?:/.+)?$`)):l.add(b);const c=yt(b=>{const{dtsResolve:w}=t??{};return w?typeof w=="boolean"?w:w.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(E3),n.peerDependenciesMeta)for(const[b,w]of Object.entries(n.peerDependenciesMeta))w&&typeof w=="object"&&"optional"in w&&a.add(new RegExp(`^${b}(?:/.+)?$`));const f=yt(b=>[...a].some(w=>w.test(b)),"isIncluded"),d=yt(b=>[...l].some(w=>w.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=Ha(n,e.options),y=e.options.sourceDir?new RegExp(String.raw`(?:^|/)${e.options.sourceDir.replaceAll(ru,String.raw`\$&`)}/`):void 0,E=new Set,j=new Set,R=new Map;return{name:"packem:externals",options:yt(b=>{b.external=(w,h)=>{if(R.has(w))return R.get(w);const A=Je(w),_=h?Je(h):void 0;let O;if(Object.keys(g).length>0){const B=_$(A,g);B!==A&&(O=B)}let k="";O&&hi(O)&&(k=af(O).name??""),!k&&hi(A)&&(k=af(A).name??ax(A));const C=k&&hi(k)&&j3(k)?k:"";if(C&&!Ro(C)){e.usedDependencies.add(C);const B=!_||!fl(_,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(x3.test(B)||Hi(B)||(y?.test(B)??!1)||J)return R.set(w,!1),!1;if(Ro(B)||pm.has(B)){let q=s.builtins;return q===void 0&&_&&(q=f(_)&&!d(_)),R.set(w,q),q}if(B[0]==="#"&&!B.startsWith("#/"))return R.set(w,!1),!1;if(f(B)&&!d(B))return R.set(w,!0),!0;if(m.some(q=>q.test(B))||C&&c(C))return R.set(w,!1),!1}return e.implicitDependencies.add(A),S3(A,e.logger),R.set(w,!1),!1}},"options"),resolveId:{filter:{id:yt(b=>!b.startsWith("\0"),"id")},async handler(b,w,h){if(h.isEntry)return;if(b[0]==="#"&&!b.startsWith("#/")&&n.imports)return w&&!fl(w,e.options.rootDir)?{external:!0,id:b}:void 0;if(pm.has(b))return{external:!0,id:b,moduleSideEffects:!1};if(Ro(b)){const _=b.replace(w3,"");let O=_;return(s.builtinsPrefix==="add"||!Ro(_))&&(O=`node:${_}`),{external:(s.builtins??f(b))&&!d(b),id:s.builtinsPrefix==="ignore"?b:O,moduleSideEffects:!1}}if(!hi(b)||b.includes("?")||b.includes(" "))return;const[A]=Wc(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,w,{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=fm(A);i.has(O)&&!E.has(O)&&(E.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 _=fm(A);o.has(_)&&!E.has(_)&&(E.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)&&w&&!fl(w,r)&&!t?.skipUnlistedWarnings&&!j.has(A)&&(j.add(A),e.logger.warn(`"${A}" imported by "${w}" but not declared in package.json. Will be bundled to prevent failure at runtime.`)),t?.forTypes&&w&&sx(w,r))return{external:!0,id:b,moduleSideEffects:!1}},order:"pre"}}},"externalsPlugin");var R3=Object.defineProperty,_3=v((e,t)=>R3(e,"name",{value:t,configurable:!0}),"d$i"),P3=Object.defineProperty,C3=_3((e,t)=>P3(e,"name",{value:t,configurable:!0}),"d"),T3=Object.defineProperty,dm=C3((e,t)=>T3(e,"name",{value:t,configurable:!0}),"p");const xc="\0packem-import-attribute/",N3=/(import[\s\S]+?from\s*["'])([^"']+)(["'])\s*with\s*\{\s*type\s*:\s*["'](text|bytes)["']\s*\}/g,I3=/(\bimport\s*\(\s*["'])([^"']+)["']\s*,\s*\{\s*with\s*:\s*\{\s*type\s*:\s*["'](text|bytes)["']\s*\}\s*\}\s*\)/g,M3=/\.[mc]?[jt]sx?$/,D3=dm(()=>{const e=new Map;let t=0;const r=dm(n=>{const i=`${xc}${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:Ox(Rx(o),s);if(this.addWatchFile(l),a==="text"){const c=await ss(l,"utf8");return`export default ${JSON.stringify(c)}`}return`export default new Uint8Array([${(await ss(l)).join(",")}])`},name:"packem:import-attributes",resolveId(n,i){return n.startsWith(xc)&&e.has(n)?n:null},transform(n,i){const o=i.split("?")[0]??i;if(o.startsWith(xc)||!M3.test(o)||!n.includes("with")||!n.includes("text")&&!n.includes("bytes"))return null;const s=n.replaceAll(N3,(a,l,c,u,p)=>{const f=r({importer:i,source:c,type:p});return`${l}${f}${u}`}).replaceAll(I3,(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 B3=Object.defineProperty,Ob=v((e,t)=>B3(e,"name",{value:t,configurable:!0}),"u$i"),L3=Object.defineProperty,Rb=Ob((e,t)=>L3(e,"name",{value:t,configurable:!0}),"d"),W3=Object.defineProperty,yn=Rb((e,t)=>W3(e,"name",{value:t,configurable:!0}),"a");const F3=yn(e=>{const t=[],r=[];e.forEach(i=>{i.startsWith("(")?t.push(i):r.push(i)});const n=yn((i,o)=>i.localeCompare(o),"byLocale");return[...r.toSorted(n),...t.toSorted(n)]},"sortLicenses"),H3=yn((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 Ua(e){return e?`> ${e}`:">"}v(Ua,"d$h");Ob(Ua,"h");Rb(Ua,"P");yn(Ua,"prefixQuoteMarker");const q3=yn((e,t,r)=>e.trim().replaceAll(/\r\n|\r/g,`
85
+ `).replaceAll(`<!-- ${t} -->`,"").replaceAll(r?`<!-- ${r} -->`:"","").replaceAll(`<!-- /${t} -->`,"").replaceAll(r?`<!-- /${r} -->`:"","").trim().split(`
86
+ `).map(n=>Ua(n)).join(`
87
+ `),"formatLicenseBody"),_b=yn(({dtsMarker:e,licenseFilePath:t,licenseTemplate:r,logger:n,marker:i,mode:o,packageName:s})=>Px({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:E})=>{let j=`## ${y??""}
88
+ `;d&&(j+=`License: ${d}
89
+ `);const R=H3(p,g,f);return R.length>0&&(j+=`By: ${R.join(", ")}
90
+ `),E&&(j+=`Repository: ${typeof E=="string"?E:E.url}
91
+ `),m&&(j+=`
92
+ ${q3(m,i,e)}
93
+ `),d&&l.add(d),j}).join(`
94
+ ---------------------------------------
95
+
96
+ `);if(c===""){n.info({message:"No dependencies license information found.",prefix:`plugin:license:${o}`});return}const u=r(F3(l),c,s);try{const p=Ah(t),f=lx(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&&(M$(t,f),n.info({message:`${t} updated.`,prefix:`plugin:license:${o}`}))}catch(p){n.error(p)}}}),"licensePlugin");var z3=Object.defineProperty,Pb=v((e,t)=>z3(e,"name",{value:t,configurable:!0}),"C$7"),G3=Object.defineProperty,Eo=Pb((e,t)=>G3(e,"name",{value:t,configurable:!0}),"g");let Lr;const Jr={getHeadTemplatePart(e){const t=e.getFullText(Lr),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(Lr),r=Gt.isTemplateMiddle(e)?2:1;return{end:e.end-r,start:e.getStart(Lr)+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(Lr)},getTemplateParts(e){return Gt.isNoSubstitutionTemplateLiteral(e)?[Jr.getHeadTemplatePart(e)]:[Jr.getHeadTemplatePart(e.head),...e.templateSpans.map(t=>Jr.getMiddleTailTemplatePart(t.literal))]},isTaggedTemplate:Gt.isTaggedTemplateExpression,isTemplate:Gt.isTemplateLiteral,walkChildNodes(e,t){t(e),Gt.forEachChild(e,r=>{Jr.walkChildNodes(r,t)})},walkNodes(e,t){Lr=e,Jr.walkChildNodes(e,t),Lr=void 0}};var U3=Object.defineProperty,K3=Eo((e,t)=>U3(e,"name",{value:t,configurable:!0}),"i");const J3=K3((e,t={})=>{const r={...Jr,...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 V3=Object.defineProperty,Sp=Eo((e,t)=>V3(e,"name",{value:t,configurable:!0}),"c");const un={One:"1",Two:"2",Zero:"0"},X3=Sp(e=>{const t={[un.One]:{tidySelectors:!1,transform:void 0},[un.Two]:{tidySelectors:!1,transform:void 0},[un.Zero]:{}};if(e===void 0)return t;if(typeof e=="number"){const r=e.toString();return{...t,[r]:{...t[r]}}}return e},"optimizationLevelFrom"),Y3=/(:[^()\s]+\(([^()]*)\))\s*\{/g,Q3=/\s/g,Z3=/\s/,mm=Sp((e,t)=>{let r=t;const n=[...e.matchAll(Y3)];for(const i of n){const o=i[1],s=i[2];if(!o||!s||!Z3.test(s))continue;const a=s.replaceAll(Q3,""),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"),e9={},t9={caseSensitive:!0,collapseWhitespace:!0,decodeEntities:!0,minifyCSS:e9,minifyJS:!0,removeAttributeQuotes:!1,removeComments:!0,removeEmptyAttributes:!0,removeScriptTypeAttributes:!0,removeStyleLinkTypeAttributes:!0,useShortDoctype:!0},hm=Sp((e={})=>{const t=X3(e.level),r=typeof e.level=="object"&&typeof e.level[1]?.transform=="function"?e.level[1].transform:!1;return t[un.One].transform=(n,i)=>i.startsWith("@TEMPLATE_EXPRESSION")&&!i.endsWith(";")?`${i};`:r?r(n,i):i,{...e,level:t}},"adjustMinifyCSSOptions"),r9={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=hm(t),n=new Cx(r).minify(e);if(n.errors.length>0)throw new Error(n.errors.join(`
97
+
98
+ `));return r.level?.[un.One]?.tidySelectors&&(n.styles=mm(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=hm(r));let i=await Tx(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)?.[un.One]?.tidySelectors&&(i=mm(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 n9=Object.defineProperty,Ka=Eo((e,t)=>n9(e,"name",{value:t,configurable:!0}),"f");const i9=Ka((e,t)=>e.generateMap({file:`${t}.map`,hires:!0,source:t}),"defaultGenerateSourceMap"),o9=Ka(e=>{const t=e.tag?.toLowerCase();return!!t&&(t.includes("html")||t.includes("svg"))},"defaultShouldMinify"),s9=Ka(e=>!!e.tag&&e.tag.toLowerCase().includes("css"),"defaultShouldMinifyCSS"),a9={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 Ja(e,t={}){t.minifyOptions={...t9,...t.minifyOptions},t.MagicString??=Ke,t.parseLiterals??=J3,t.shouldMinify??=o9,t.shouldMinifyCSS??=s9,t.parseLiteralsOptions={fileName:t.fileName,...t.parseLiteralsOptions};const r=t.parseLiterals(e,t.parseLiteralsOptions),n=t.strategy??r9,{shouldMinify:i,shouldMinifyCSS:o}=t;let s;t.validate!==!1&&(s=t.validate??a9);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 E=t.minifyOptions?.minifyCSS;if(typeof E=="function"){const j=E(m);g=typeof j=="string"?j:await j}else if(E===!1)g=m;else{const j=typeof E=="object"&&E!==null?E: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 E=n.minifyHTML(m,t.minifyOptions);g=typeof E=="string"?E:await E}const y=n.splitHTMLByPlaceholder(g,d);s&&s.ensureHTMLPartsValid(u.parts,y),u.parts.forEach((E,j)=>{E.start<E.end&&y[j]!==void 0&&a.overwrite(E.start,E.end,y[j])})}}const l=a.toString();if(e===l)return;let c;return t.generateSourceMap!==!1&&(c=(t.generateSourceMap??i9)(a,t.fileName??"")),{code:l,map:c}}v(Ja,"O$8");Pb(Ja,"H");Eo(Ja,"minifyHTMLLiterals");Ka(Ja,"minifyHTMLLiterals");var l9=Object.defineProperty,c9=Eo((e,t)=>l9(e,"name",{value:t,configurable:!0}),"o");const u9=c9(({exclude:e,failOnError:t=!1,include:r,logger:n,minifyHTMLLiterals:i,options:o})=>{i??=Ja;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 p9=Object.defineProperty,f9=v((e,t)=>p9(e,"name",{value:t,configurable:!0}),"h$a"),d9=Object.defineProperty,m9=f9((e,t)=>d9(e,"name",{value:t,configurable:!0}),"h"),h9=Object.defineProperty,gm=m9((e,t)=>h9(e,"name",{value:t,configurable:!0}),"f");const g9=/\.node$/,wc="\0packem-natives/",v9=gm((e={})=>{const{nativesDirectory:t="natives"}=e,r=new Map;let n=0,i;return{buildStart(){r.clear(),n=0},generateBundle:gm(async o=>{if(r.size===0)return;let s;if(o.dir?s=o.dir:o.file&&(s=Te(o.file)),!s)throw new Error("Output directory not detected. Please ensure Rollup output options are configured.");const a=le(s,t);await Fc(a);const l=new Set,c=[];for(const{outputName:u,sourcePath:p}of r.values())l.has(p)||(l.add(p),c.push(vx(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=Te(a.file))}return o},resolveId:{filter:{id:g9},async handler(o,s){if(o.startsWith(wc))return;if(s?.startsWith(wc))return{external:!0,id:o};const a=s?ve(Te(s),o):ve(o);if(!await Yr(a)){this.warn(`Native module not found: ${a}`);return}for(const[d,m]of r)if(m.sourcePath===a)return d;const l=$t(a);let c=l,u=1;const p=new Set(Array.from(r.values(),d=>d.outputName));for(;p.has(c);){const d=mn(l);c=`${$t(l,d)}_${String(u)}${d}`,u+=1}const f=`${wc}${String(n)}`;return n+=1,r.set(f,{outputName:c,sourcePath:a}),f}}}},"nativeModulesPlugin");var b9=Object.defineProperty,y9=v((e,t)=>b9(e,"name",{value:t,configurable:!0}),"n$9"),$9=Object.defineProperty,x9=y9((e,t)=>$9(e,"name",{value:t,configurable:!0}),"n"),w9=Object.defineProperty,E9=x9((e,t)=>w9(e,"name",{value:t,configurable:!0}),"a");const S9=E9(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 Sr(n);return process.platform==="win32"?i.replaceAll(`\r
99
+ `,`
100
+ `):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
101
+ `,`
102
+ `):r;return{code:`const data = ${JSON.stringify(s)};
103
+ export default data;`,map:null}}return null}}},"rawPlugin");var k9=Object.defineProperty,j9=v((e,t)=>k9(e,"name",{value:t,configurable:!0}),"N$8"),A9=Object.defineProperty,Cb=j9((e,t)=>A9(e,"name",{value:t,configurable:!0}),"w"),O9=Object.defineProperty,R9=Cb((e,t)=>O9(e,"name",{value:t,configurable:!0}),"s");let vm=!1;const _9=R9(async(e,t,r)=>{if(vm||(await Gh(),vm=!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 D$(n);if(i.type==="module")return!1;if(i.type==="commonjs")return!0}catch{}try{const i=await Sr(n,{encoding:"utf8"});try{return Nx(i,n),!0}catch{}}catch{}}}return!1},"isPureCJS");var P9=Object.defineProperty,Mn=Cb((e,t)=>P9(e,"name",{value:t,configurable:!0}),"d");const kp="__cjs_require",C9='import { createRequire as __cjs_createRequire } from "node:module";',T9=`const ${kp} = __cjs_createRequire(import.meta.url);`,N9='const __cjs_getProcess = typeof globalThis !== "undefined" && typeof globalThis.process !== "undefined" ? globalThis.process : process;',I9=`const __cjs_getBuiltinModule = (module) => {
104
+ // Check if we're in Node.js and version supports getBuiltinModule
105
+ if (typeof __cjs_getProcess !== "undefined" && __cjs_getProcess.versions && __cjs_getProcess.versions.node) {
106
+ const [major, minor] = __cjs_getProcess.versions.node.split(".").map(Number);
107
+ // Node.js 20.16.0+ and 22.3.0+
108
+ if (major > 22 || (major === 22 && minor >= 3) || (major === 20 && minor >= 16)) {
109
+ return __cjs_getProcess.getBuiltinModule(module);
110
+ }
111
+ }
112
+ // Fallback to createRequire
113
+ return ${kp}(module);
114
+ };`,No={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},M9=[/node_modules/,/\.d\.[cm]?ts$/],D9=[/\.[cm]?[jt]sx?$/];let bm=!1;const B9=Mn((e,t)=>t&&(b$.includes(e)||e.startsWith("node:")),"isBuiltinModule"),L9=Mn(async(e,t,r,n,i)=>t?!0:await r?.(e,n,i)??await _9(e,n,i),"shouldTransformImport"),W9=Mn((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:`${kp}(${JSON.stringify(e)})`,needsBuiltin:!1,needsProcess:!1,needsRequire:!0},"generateRequireCode"),F9=Mn(e=>{const t=new Ke(e),r={builtin:[...e.matchAll(No.builtin)],import:[...e.matchAll(No.import)],process:[...e.matchAll(No.process)],require:[...e.matchAll(No.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"),H9=Mn(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??M9,include:e.include??D9,order:"order"in e?e.order:"pre",shouldTransform:e.shouldTransform}},"resolveOptions"),q9=Mn((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}=H9(e),l=Mt(o,i);return{async buildStart(){bm||(await Gh(),bm=!0)},name:"packem:plugin-require-cjs",renderChunk:{async handler(c,u,p){if(p.format!=="es"||!l(u.fileName))return;const f=Os(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=B9(R,r),w=this.resolve;if(!await L9(R,b,a,n,w))continue;const{code:h,needsBuiltin:A,needsProcess:_,needsRequire:O}=W9(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 {
115
+ ${k.map(([X,te])=>` ${X===te?te:`${X}: ${te}`}`).join(`,
116
+ `)}
117
+ } = ${B??h};`;J.push(q)}d.overwrite(j.start,j.end,J.join(`
118
+ `))}if(m||g||y){const j=[];m&&j.push(C9,T9),g&&j.push(N9),y&&j.push(I9);const R=`${j.join(`
119
+
120
+ `)}
121
+
122
+ `,b=d.toString();if(b[0]==="#"){const w=b.indexOf(`
123
+ `)+1;d.appendLeft(w,R)}else d.prepend(R)}const E=new Ke(F9(d.toString()));return{code:E.toString(),map:E.generateMap()}},order:s}}},"requireCJSTransformerPlugin");var z9=Object.defineProperty,G9=v((e,t)=>z9(e,"name",{value:t,configurable:!0}),"I$6"),U9=Object.defineProperty,K9=G9((e,t)=>U9(e,"name",{value:t,configurable:!0}),"S"),J9=Object.defineProperty,gs=K9((e,t)=>J9(e,"name",{value:t,configurable:!0}),"f");const V9=gs(async e=>{try{const n=await zi(e);if(n.isFile())return e;if(n.isDirectory()){const i=le(e,"index.js");if(await Yr(i))return i;const o=le(e,"index.json");if(await Yr(o))return o}}catch{}const t=`${e}.js`;if(await Yr(t))return t;const r=`${e}.json`;if(await Yr(r))return r},"tryResolveImplicit"),X9=gs(async(e,t)=>{let r=e;const n=ve("/");for(;r!==n&&r!==Te(r);){const i=le(r,"node_modules",t,"package.json");if(await Yr(i))return i;r=Te(r)}},"findPackageJson"),Tb=gs(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=gs(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||!hi(d))continue;const[m,g]=Wc(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=Te(s),p=(await Promise.all(l.map(async d=>{const[m,g]=Wc(d.importId);if(!g)return;const y=`${m}:${g}:${u}`,E=r.get(y);if(E!==void 0)return E?{...d,resolvedId:E}:void 0;const j=await X9(u,m);if(!j){r.set(y,void 0);return}let R=t.get(j);if(R===void 0)try{R=B$(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=Te(j),w=le(b,g),h=await V9(w);if(!h){r.set(y,void 0);return}const A=et(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 Y9=Object.defineProperty,Q9=v((e,t)=>Y9(e,"name",{value:t,configurable:!0}),"m$c"),Z9=Object.defineProperty,e8=Q9((e,t)=>Z9(e,"name",{value:t,configurable:!0}),"u"),t8=Object.defineProperty,Va=e8((e,t)=>t8(e,"name",{value:t,configurable:!0}),"o");const vs=/^#![^\n]*/,nu=Va(async e=>{await Lh(e,493).catch(()=>{})},"makeExecutable"),r8=Va((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(vs,`${t.shebang}
124
+ `),map:void 0};if(!o&&e.includes(n.name)){const s=new Ke(r);return s.prepend(`${t.shebang}
125
+ `),{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"&&vs.test(o.code)&&r.dir){const s=ve(r.dir,i);await nu(s)}}}),"shebangPlugin"),n8=Va(()=>({name:"packem:remove-shebang",renderChunk(e){return e.replace(vs,"")}}),"removeShebangPlugin"),i8=Va((e,t=`
126
+ `)=>{const r=vs.exec(e);return r?`${r[0]}${t}`:""},"getShebang");var o8=Object.defineProperty,Xe=v((e,t)=>o8(e,"name",{value:t,configurable:!0}),"C$6"),$n=44,Nb=59,ym="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ib=new Uint8Array(64),Mb=new Uint8Array(128);for(let e=0;e<ym.length;e++){const t=ym.charCodeAt(e);Ib[e]=t,Mb[t]=e}function Ie(e,t){let r=0,n=0,i=0;do{const s=e.next();i=Mb[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(Ib[i])}while(n>0);return t}v(Oe,"i$8");Xe(Oe,"encodeInteger");function Ht(e,t){return e.pos>=t?!1:e.peek()!==$n}v(Ht,"S$6");Xe(Ht,"hasMoreVlq");var $m=1024*16,xm=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}},jp=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+=xm.decode(r),this.pos=0)}flush(){const{buffer:t,out:r,pos:n}=this;return n>0?r+xm.decode(t.subarray(0,n)):r}},Ap=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}},Db=[];function s8(e){const{length:t}=e,r=new Ap(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=Db;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(s8,"z$4");Xe(s8,"decodeOriginalScopes");function a8(e){const t=new jp;for(let r=0;r<e.length;)r=Op(e,r,t,[0]);return t.flush()}v(a8,"F$8");Xe(a8,"encodeOriginalScopes");function Op(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($n),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=Op(e,t,r,n)}return r.write($n),n[0]=Oe(r,a,n[0]),Oe(r,l,0),t}v(Op,"P$7");Xe(Op,"_encodeOriginalScopes");function l8(e){const{length:t}=e,r=new Ap(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,E=g&2,j=g&4;let R=null,b=Db,w;if(y){const h=Ie(r,s);a=Ie(r,s===h?a:0),s=h,w=[o,m,0,0,h,a]}else w=[o,m,0,0];if(w.isScope=!!j,E){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(w.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))}w.bindings=b,n.push(w),i.push(w)}o++,r.pos=d+1}while(r.pos<t);return n}v(l8,"H$5");Xe(l8,"decodeGeneratedRanges");function c8(e){if(e.length===0)return"";const t=new jp;for(let r=0;r<e.length;)r=Rp(e,r,t,[0,0,0,0,0,0,0]);return t.flush()}v(c8,"J$3");Xe(c8,"encodeGeneratedRanges");function Rp(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?(iu(r,n[0],o),n[0]=o,n[1]=0):t>0&&r.write($n),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 E=1;E<d.length;E++){const j=d[E];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=Rp(e,t,r,n)}return n[0]<a?(iu(r,n[0],a),n[0]=a,n[1]=0):r.write($n),n[1]=Oe(r,l,n[1]),t}v(Rp,"V$4");Xe(Rp,"_encodeGeneratedRanges");function iu(e,t,r){do e.write(Nb);while(++t<r)}v(iu,"U$5");Xe(iu,"catchupLine");function Bb(e){const{length:t}=e,r=new Ap(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||Lb(u),n.push(u),r.pos=c+1}while(r.pos<=t);return n}v(Bb,"K$4");Xe(Bb,"decode");function Lb(e){e.sort(Wb)}v(Lb,"Q$4");Xe(Lb,"sort");function Wb(e,t){return e[0]-t[0]}v(Wb,"X$5");Xe(Wb,"sortComparator");function Fb(e){const t=new jp;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(Nb),a.length===0)continue;let l=0;for(let c=0;c<a.length;c++){const u=a[c];c>0&&t.write($n),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(Fb,"Z$4");Xe(Fb,"encode");var u8=Object.defineProperty,ft=v((e,t)=>u8(e,"name",{value:t,configurable:!0}),"c$h");const p8=/^[\w+.-]+:\/\//,f8=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,d8=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function Hb(e){return p8.test(e)}v(Hb,"R$7");ft(Hb,"isAbsoluteUrl");function qb(e){return e.startsWith("//")}v(qb,"q$5");ft(qb,"isSchemeRelativeUrl");function _p(e){return e.startsWith("/")}v(_p,"m$b");ft(_p,"isAbsolutePath");function zb(e){return e.startsWith("file:")}v(zb,"v$c");ft(zb,"isFileUrl");function ou(e){return/^[.?#]/.test(e)}v(ou,"u$f");ft(ou,"isRelative");function $i(e){const t=f8.exec(e);return Pp(t[1],t[2]||"",t[3],t[4]||"",t[5]||"/",t[6]||"",t[7]||"")}v($i,"f$d");ft($i,"parseAbsoluteUrl");function Gb(e){const t=d8.exec(e),r=t[2];return Pp("file:","",t[1]||"","",_p(r)?r:"/"+r,t[3]||"",t[4]||"")}v(Gb,"w$7");ft(Gb,"parseFileUrl");function Pp(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(Pp,"y$9");ft(Pp,"makeUrl");function su(e){if(qb(e)){const r=$i("http:"+e);return r.scheme="",r.type=6,r}if(_p(e)){const r=$i("http://foo.com"+e);return r.scheme="",r.host="",r.type=5,r}if(zb(e))return Gb(e);if(Hb(e))return $i(e);const t=$i("http://foo.com/"+e);return t.scheme="",t.host="",t.type=e?e.startsWith("?")?3:e.startsWith("#")?2:4:1,t}v(su,"p$d");ft(su,"parseUrl");function Ub(e){if(e.endsWith("/.."))return e;const t=e.lastIndexOf("/");return e.slice(0,t+1)}v(Ub,"P$6");ft(Ub,"stripPathFilename");function Kb(e,t){Cp(t,t.type),e.path==="/"?e.path=t.path:e.path=Ub(t.path)+e.path}v(Kb,"A$5");ft(Kb,"mergePaths");function Cp(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(Cp,"d$f");ft(Cp,"normalizePath");function Jb(e,t){if(!e&&!t)return"";const r=su(e);let n=r.type;if(t&&n!==7){const o=su(t),s=o.type;switch(n){case 1:r.hash=o.hash;case 2:r.query=o.query;case 3:case 4:Kb(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)}Cp(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?ou(t||e)&&!ou(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(Jb,"F$7");ft(Jb,"resolve");var m8=Object.defineProperty,xe=v((e,t)=>m8(e,"name",{value:t,configurable:!0}),"i$7");function Vb(e){if(!e)return"";const t=e.lastIndexOf("/");return e.slice(0,t+1)}v(Vb,"ae$4");xe(Vb,"stripFilename");function Xb(e,t){const r=Vb(e),n=t?t+"/":"";return i=>Jb(n+(i||""),r)}v(Xb,"ge$3");xe(Xb,"resolver");var St=0,Tp=1,Np=2,Ip=3,Yb=4,Qb=1,Zb=2;function ey(e,t){const r=au(e,0);if(r===e.length)return e;t||(e=e.slice());for(let n=r;n<e.length;n=au(e,n+1))e[n]=ry(e[n],t);return e}v(ey,"he$1");xe(ey,"maybeSort");function au(e,t){for(let r=t;r<e.length;r++)if(!ty(e[r]))return r;return e.length}v(au,"X$4");xe(au,"nextUnsortedSegmentLine");function ty(e){for(let t=1;t<e.length;t++)if(e[t][St]<e[t-1][St])return!1;return!0}v(ty,"_e$1");xe(ty,"isSorted");function ry(e,t){return t||(e=e.slice()),e.sort(Mp)}v(ry,"ve$2");xe(ry,"sortSegments");function Mp(e,t){return e[St]-t[St]}v(Mp,"$$8");xe(Mp,"sortComparator");function ny(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[Tp],l=s[Np],c=s[Ip],u=r[a];(u[l]||(u[l]=[])).push([c,n,s[St]])}}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(Mp)}}return r}v(ny,"Se$2");xe(ny,"buildBySources");var wr=!1;function iy(e,t,r,n){for(;r<=n;){const i=r+(n-r>>1),o=e[i][St]-t;if(o===0)return wr=!0,i;o<0?r=i+1:n=i-1}return wr=!1,r-1}v(iy,"Ee$1");xe(iy,"binarySearch");function Dp(e,t,r){for(let n=r+1;n<e.length&&e[n][St]===t;r=n++);return r}v(Dp,"H$4");xe(Dp,"upperBound");function Bp(e,t,r){for(let n=r-1;n>=0&&e[n][St]===t;r=n--);return r}v(Bp,"Y$3");xe(Bp,"lowerBound");function Lp(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}v(Lp,"k$7");xe(Lp,"memoizedState");function oy(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 wr=s!==-1&&e[s][St]===t,s;t>=o?a=s===-1?0:s:l=s}return r.lastKey=n,r.lastNeedle=t,r.lastIndex=iy(e,t,a,l)}v(oy,"Me$2");xe(oy,"memoizedBinarySearch");function Xa(e){return typeof e=="string"?JSON.parse(e):e}v(Xa,"j$8");xe(Xa,"parse");var h8=xe(function(e,t){const r=Xa(e);if(!("sections"in r))return new Fp(r,t);const n=[],i=[],o=[],s=[],a=[];Wp(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 py(l)},"FlattenMap");function Wp(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 E=p[f+1].offset;g=Math.min(c,a+E.line),g===c?y=Math.min(u,l+E.column):g<c&&(y=l+E.column)}sy(d,t,r,n,i,o,s,a+m.line,l+m.column,g,y)}}v(Wp,"ee$3");xe(Wp,"recurse");function sy(e,t,r,n,i,o,s,a,l,c,u){const p=Xa(e);if("sections"in p)return Wp(...arguments);const f=new Fp(p,t),d=n.length,m=o.length,g=Br(f),{resolvedSources:y,sourcesContent:E,ignoreList:j}=f;if(es(n,y),es(o,f.names),E)es(i,E);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 w=ay(r,b),h=R===0?l:0,A=g[R];for(let _=0;_<A.length;_++){const O=A[_],k=h+O[St];if(b===c&&k>=u)return;if(O.length===1){w.push([k]);continue}const C=d+O[Tp],B=O[Np],J=O[Ip];w.push(O.length===4?[k,C,B,J]:[k,C,B,J,m+O[Yb]])}}}v(sy,"me$3");xe(sy,"addSection");function es(e,t){for(let r=0;r<t.length;r++)e.push(t[r])}v(es,"G$7");xe(es,"append");function ay(e,t){for(let r=e.length;r<=t;r++)e[r]=[];return e[t]}v(ay,"xe$1");xe(ay,"getLine");var ly="`line` must be greater than 0 (lines start at line 1)",cy="`column` must be greater than or equal to 0 (columns start at column 0)",bs=-1,Ya=1,Fp=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=Xa(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=Xb(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=ey(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=Lp(),this._bySources=void 0,this._bySourceMemos=void 0}};function uy(e){var t,r;return(r=(t=e)._encoded)!=null?r:t._encoded=Fb(e._decoded)}v(uy,"oe$4");xe(uy,"encodedMappings");function Br(e){var t;return(t=e)._decoded||(t._decoded=Bb(e._encoded))}v(Br,"O$7");xe(Br,"decodedMappings");function g8(e,t,r){const n=Br(e);if(t>=n.length)return null;const i=n[t],o=So(i,e._decodedMemo,t,r,Ya);return o===-1?null:i[o]}v(g8,"Oe$2");xe(g8,"traceSegment");function v8(e,t){let{line:r,column:n,bias:i}=t;if(r--,r<0)throw new Error(ly);if(n<0)throw new Error(cy);const o=Br(e);if(r>=o.length)return xi(null,null,null,null);const s=o[r],a=So(s,e._decodedMemo,r,n,i||Ya);if(a===-1)return xi(null,null,null,null);const l=s[a];if(l.length===1)return xi(null,null,null,null);const{names:c,resolvedSources:u}=e;return xi(u[l[Tp]],l[Np]+1,l[Ip],l.length===5?c[l[Yb]]:null)}v(v8,"Le$1");xe(v8,"originalPositionFor");function b8(e,t){const{source:r,line:n,column:i,bias:o}=t;return qp(e,r,n,i,o||Ya,!1)}v(b8,"ye$1");xe(b8,"generatedPositionFor");function y8(e,t){const{source:r,line:n,column:i,bias:o}=t;return qp(e,r,n,i,o||bs,!0)}v(y8,"Ce$2");xe(y8,"allGeneratedPositionsFor");function $8(e,t){const r=Br(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($8,"Ie$1");xe($8,"eachMapping");function Hp(e,t){const{sources:r,resolvedSources:n}=e;let i=r.indexOf(t);return i===-1&&(i=n.indexOf(t)),i}v(Hp,"re$4");xe(Hp,"sourceIndex");function x8(e,t){const{sourcesContent:r}=e;if(r==null)return null;const n=Hp(e,t);return n===-1?null:r[n]}v(x8,"Ne$1");xe(x8,"sourceContentFor");function w8(e,t){const{ignoreList:r}=e;if(r==null)return!1;const n=Hp(e,t);return n===-1?!1:r.includes(n)}v(w8,"be$1");xe(w8,"isIgnored");function py(e,t){const r=new Fp(Qa(e,[]),t);return r._decoded=e.mappings,r}v(py,"se$4");xe(py,"presortedDecodedMap");function E8(e){return Qa(e,Br(e))}v(E8,"Re$1");xe(E8,"decodedMap");function S8(e){return Qa(e,uy(e))}v(S8,"we$1");xe(S8,"encodedMap");function Qa(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(Qa,"B$7");xe(Qa,"clone");function xi(e,t,r,n){return{source:e,line:t,column:r,name:n}}v(xi,"b$9");xe(xi,"OMapping");function Qr(e,t){return{line:e,column:t}}v(Qr,"y$8");xe(Qr,"GMapping");function So(e,t,r,n,i){let o=oy(e,n,t,r);return wr?o=(i===bs?Dp:Bp)(e,n,o):i===bs&&o++,o===-1||o===e.length?-1:o}v(So,"w$6");xe(So,"traceSegmentInternal");function fy(e,t,r,n,i){let o=So(e,t,r,n,Ya);if(!wr&&i===bs&&o++,o===-1||o===e.length)return[];const s=wr?n:e[o][St];wr||(o=Bp(e,s,o));const a=Dp(e,s,o),l=[];for(;o<=a;o++){const c=e[o];l.push(Qr(c[Qb]+1,c[Zb]))}return l}v(fy,"Ue$1");xe(fy,"sliceGeneratedPositions");function qp(e,t,r,n,i,o){var s,a;if(r--,r<0)throw new Error(ly);if(n<0)throw new Error(cy);const{sources:l,resolvedSources:c}=e;let u=l.indexOf(t);if(u===-1&&(u=c.indexOf(t)),u===-1)return o?[]:Qr(null,null);const p=(s=e)._bySourceMemos||(s._bySourceMemos=l.map(Lp)),f=((a=e)._bySources||(a._bySources=ny(Br(e),p)))[u][r];if(f==null)return o?[]:Qr(null,null);const d=p[u];if(o)return fy(f,d,r,n,i);const m=So(f,d,r,n,i);if(m===-1)return Qr(null,null);const g=f[m];return Qr(g[Qb]+1,g[Zb])}v(qp,"ie$3");xe(qp,"generatedPosition");var k8=Object.defineProperty,j8=v((e,t)=>k8(e,"name",{value:t,configurable:!0}),"p$c"),A8=Object.defineProperty,dy=j8((e,t)=>A8(e,"name",{value:t,configurable:!0}),"c");const O8=De(import.meta.url),ui=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,my=dy(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 O8(e)},"__cjs_getBuiltinModule"),{readFileSync:wm}=my("node:fs"),{resolve:R8,toNamespacedPath:Ec,dirname:_8}=my("node:path");var P8=Object.defineProperty,ko=dy((e,t)=>P8(e,"name",{value:t,configurable:!0}),"s");const C8=/^data:application\/json[^,]+base64,/,T8=/\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+)[ \t]*$|\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*\*\/[ \t]*$/,N8=/\r?\n/,hy=ko(e=>C8.test(e),"isInlineMap"),Sc=ko((e,t)=>{const r=e instanceof Error?e.message:String(e),n=`${t}:
127
+ ${r}`;throw new Error(n)},"enhanceError"),I8=ko((e,t)=>{const r=e.split(N8);let n;for(let o=r.length-1;o>=0&&!n;o--)n=T8.exec(r[o])??void 0;if(!n)return;const i=n[1]??n[2];if(i)return hy(i)?i:R8(t,i)},"resolveSourceMapUrl"),M8=ko(e=>{const t=e.slice(e.indexOf(",")+1);return Buffer.from(t,"base64").toString()},"decodeInlineMap"),D8=ko(e=>{let t;try{t=wm(e,{encoding:"utf8"})}catch(i){Sc(i,`Error reading sourcemap for file "${Ec(e)}"`)}const r=I8(t,_8(e));if(!r)return;let n;if(hy(r))n=M8(r);else try{n=wm(r,{encoding:"utf8"})}catch(i){Sc(i,`Error reading sourcemap for file "${Ec(e)}"`)}try{return new h8(n,r)}catch(i){Sc(i,`Error parsing sourcemap for file "${Ec(e)}"`)}},"loadSourceMap");var B8=Object.defineProperty,L8=v((e,t)=>B8(e,"name",{value:t,configurable:!0}),"o$6"),W8=Object.defineProperty,F8=L8((e,t)=>W8(e,"name",{value:t,configurable:!0}),"o"),H8=Object.defineProperty,q8=F8((e,t)=>H8(e,"name",{value:t,configurable:!0}),"o");const z8=/\?[^?]*$/,G8=q8(({exclude:e,include:t}={})=>{const r=Mt(t,e);return{async load(n){if(!r(n))return;let i;try{i=await Sr(n,{buffer:!1}),this.addWatchFile(n)}catch{try{const s=n.replace(z8,"");i=await Sr(s,{buffer:!1}),this.addWatchFile(s)}catch{this.warn("Failed reading file");return}}let o;try{const s=D8(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 U8=Object.defineProperty,K8=v((e,t)=>U8(e,"name",{value:t,configurable:!0}),"b$8"),J8=Object.defineProperty,V8=K8((e,t)=>J8(e,"name",{value:t,configurable:!0}),"v"),X8=Object.defineProperty,gy=V8((e,t)=>X8(e,"name",{value:t,configurable:!0}),"g");const Y8=gy(async(e,t)=>{await new Promise((r,n)=>{const i=bu(e);i.on("error",n);const o=Ax(t);o.on("error",n),o.on("finish",()=>{r(void 0)}),i.pipe(o)})},"copy"),Q8=gy(({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??Te(u.file??"");await Fc(p),await Promise.all(Object.keys(c).map(async f=>{const d=c[f],m=le(p,Te(d));await Fc(m),await Y8(f,le(p,d))}))},async load(u){if(!l(u))return;this.addWatchFile(u);const[p,f]=await Promise.all([zi(u),ss(u)]);let d;if(o&&p.size>o||o===0){const m=Ix.createHash("sha1").update(f).digest("hex").slice(0,16),g=mn(u),y=$t(u,g),E=a?et(a,Te(u)):$t(Te(u)),j=n.replaceAll("[hash]",m).replaceAll("[extname]",g).replaceAll("[dirname]",E===""?"":`${E}/`).replaceAll("[name]",y);d=le(s??"",j),c[u]=j}else{const m=vb.getType(u);if(m===null)throw new Error(`Could not determine mimetype for ${u}`);d=m==="image/svg+xml"?cx(f):f.toString("base64"),d=`data:${m};base64,${d}`}return`export default "${d}"`},name:"packem:url"}},"urlPlugin");var Z8=Object.defineProperty,Ot=v((e,t)=>Z8(e,"name",{value:t,configurable:!0}),"u$c"),eN=Object.defineProperty,rt=Ot((e,t)=>eN(e,"name",{value:t,configurable:!0}),"u"),tN=Object.defineProperty,Io=rt((e,t)=>tN(e,"name",{value:t,configurable:!0}),"i");let vy=class{static{v(this,"A")}static{Ot(this,"b")}static{rt(this,"WalkerBase")}static{Io(this,"WalkerBase")}constructor(){this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:Io(()=>this.should_skip=!0,"skip"),remove:Io(()=>this.should_remove=!0,"remove"),replace:Io(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 rN=Object.defineProperty,wi=rt((e,t)=>rN(e,"name",{value:t,configurable:!0}),"c$1");let nN=class extends vy{static{v(this,"E")}static{Ot(this,"I")}static{rt(this,"SyncWalker")}static{wi(this,"SyncWalker")}constructor(t,r){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:wi(()=>this.should_skip=!0,"skip"),remove:wi(()=>this.should_remove=!0,"remove"),replace:wi(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];Di(c)&&(this.visit(c,t,o,l)||l--)}}else Di(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 Di(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"}v(Di,"_$5");Ot(Di,"k");rt(Di,"n");wi(Di,"isNode");var iN=Object.defineProperty,Ei=rt((e,t)=>iN(e,"name",{value:t,configurable:!0}),"c");let oN=class extends vy{static{v(this,"L")}static{Ot(this,"E")}static{rt(this,"AsyncWalker")}static{Ei(this,"AsyncWalker")}constructor(t,r){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:Ei(()=>this.should_skip=!0,"skip"),remove:Ei(()=>this.should_remove=!0,"remove"),replace:Ei(n=>this.replacement=n,"replace")},this.enter=t,this.leave=r}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];Bi(c)&&(await this.visit(c,t,o,l)||l--)}}else Bi(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 Bi(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"}v(Bi,"g$3");Ot(Bi,"_");rt(Bi,"a$1");Ei(Bi,"isNode");var sN=Object.defineProperty,by=rt((e,t)=>sN(e,"name",{value:t,configurable:!0}),"a");function Za(e,{enter:t,leave:r}){return new nN(t,r).visit(e,null)}v(Za,"b$7");Ot(Za,"$");rt(Za,"walk");by(Za,"walk");async function zp(e,{enter:t,leave:r}){return await new oN(t,r).visit(e,null)}v(zp,"T$4");Ot(zp,"M");rt(zp,"asyncWalk");by(zp,"asyncWalk");var aN=Object.defineProperty,lr=rt((e,t)=>aN(e,"name",{value:t,configurable:!0}),"l");const lN=/\s/,cN=/\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\//g,uN=/MIT License|MIT license|BSD license/,pN=/\n{2,}/g,fN=/\b(\w+)\$\d+\b/g,dN=/[-/\\^$*+?.()|[\]{}]/g,mN=lr(e=>e.replaceAll(dN,String.raw`\$&`),"escapeRegex"),hN=lr(e=>[...new Set(e)],"unique"),gN=/\.[^/.]+$/;function el(e){return uN.test(e)?"":e}v(el,"w$4");Ot(el,"x");rt(el,"k");lr(el,"stripLicenseComment");const vN=lr(e=>e.replaceAll(cN,el).replaceAll(pN,`
128
+
129
+ `),"cleanUnnecessaryComments"),Em=new Map;function tl(e,t,{identifierReplacements:r},n){const i=As(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=mN(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=hN(Array.from(o.matchAll(fN),a=>a[0]));if(s.length>0){const a=s.map(c=>`
130
+ - ${c}`).join(""),l=t.fileName.replace(gN,"");Em.has(l)||n.warn({message:`${t.fileName} contains confusing identifier names${a}
131
+
132
+ To replace these, add them to the "rollup -> patchTypes -> identifierReplacements" option in your packem config.`,prefix:"plugin:patch-types"}),Em.set(l,!0)}return o}v(tl,"x$3");Ot(tl,"S");rt(tl,"O");lr(tl,"replaceConfusingTypeNames");function rl(e,t){if(!e.includes("@internal"))return e;const r=new Ke(e),n=Os(t.fileName,e,{lang:"dts",sourceType:"module"}),i=lr(a=>{let l=a,c=!0;for(;c;){for(c=!1;l<e.length&&lN.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&&Za(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(rl,"$$6");Ot(rl,"A");rt(rl,"v");lr(rl,"stripInternalTypes");const bN=lr((e,t)=>({name:"packem:patch-types",renderChunk(r,n){return r=tl.call(this,r,n,e,t),r=rl.call(this,r,n),r=vN(r),r}}),"patchTypescriptTypes");var yN=Object.defineProperty,$N=v((e,t)=>yN(e,"name",{value:t,configurable:!0}),"d$b"),xN=Object.defineProperty,wN=$N((e,t)=>xN(e,"name",{value:t,configurable:!0}),"d"),EN=Object.defineProperty,zt=wN((e,t)=>EN(e,"name",{value:t,configurable:!0}),"o");const SN=/^\./,kN=/\0/,jN=42,AN=zt(e=>{let t=!1;for(let r=0;r<e.length;r++)if(e.codePointAt(r)===jN){if(t)return!1;t=!0}return!0},"hasZeroOrOneAsteriskCharacter"),ON=zt(e=>{const t=e.indexOf("*");return t===-1?void 0:{prefix:e.slice(0,t),suffix:e.slice(t+1)}},"tryParsePattern"),RN=zt(({prefix:e,suffix:t},r)=>r.length>=e.length+t.length&&r.startsWith(e)&&r.endsWith(t),"isPatternMatch"),_N=zt((e,t,r)=>{let n,i=-1;for(const o of e){const s=t(o);RN(s,r)&&s.prefix.length>i&&(i=s.prefix.length,n=o)}return n},"findBestPatternMatch"),PN=zt((e,t)=>{const r=[];for(const n of e){if(!AN(n))continue;const i=ON(n);if(i)r.push(i);else if(n===t)return n}return _N(r,n=>n,t)},"matchPatternOrExact"),CN=zt((e,t)=>t.substring(e.prefix.length,t.length-e.suffix.length),"matchedText"),TN=zt(({prefix:e,suffix:t})=>`${e}*${t}`,"patternText"),NN=zt((e,t,r)=>{let n=Te(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"),yy=zt((e,t,r,n)=>{const{paths:i,resolvedBaseUrl:o}=NN(e,t,r),s=Object.keys(i);return{name:"plugin:resolve-tsconfig-paths",resolveId:{filter:{id:{exclude:[SN,kN]}},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&&Hi(a)){r.debug({message:`Skipping request as it is an absolute path ${a}`,prefix:"plugin:resolve-tsconfig-paths"});return}if(kh(a)){r.debug({message:`Skipping request as it is a relative path ${a}`,prefix:"plugin:resolve-tsconfig-paths"});return}const u=PN(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:CN(u,a),f=typeof u=="string"?u:TN(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 IN=Object.defineProperty,MN=v((e,t)=>IN(e,"name",{value:t,configurable:!0}),"f$a"),DN=Object.defineProperty,BN=MN((e,t)=>DN(e,"name",{value:t,configurable:!0}),"a"),LN=Object.defineProperty,$y=BN((e,t)=>LN(e,"name",{value:t,configurable:!0}),"u");const WN=/^\./,FN=$y((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"),xy=$y((e,t,r)=>{const n=FN(e,r);return{name:"packem:resolve-tsconfig-root-dirs",resolveId:{filter:{id:WN},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 HN=Object.defineProperty,qN=v((e,t)=>HN(e,"name",{value:t,configurable:!0}),"l$c"),zN=Object.defineProperty,GN=qN((e,t)=>zN(e,"name",{value:t,configurable:!0}),"l"),UN=Object.defineProperty,Gp=GN((e,t)=>UN(e,"name",{value:t,configurable:!0}),"l");const KN={".cjs":[".cts"],".js":[".ts",".tsx"],".jsx":[".tsx",".ts"],".mjs":[".mts"]},Sm=/\.(?:[mc]?js|jsx)$/,JN=Gp(e=>{const t=e[0];return!(t==="."||t==="/"||t==="#"||_x(e))},"isBareSpecifier"),km=Gp(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"),wy=Gp(()=>({name:"packem:resolve-typescript-mjs-cjs",resolveId:{filter:{id:Sm},async handler(e,t,r){if(!t)return;const n=Sm.exec(e);if(!n)return;const i=n[0],o=KN[i];if(!o)return;const s=e.slice(0,-i.length),a={...r,skipSelf:!0};return!JN(e)&&!t.includes("/node_modules/")?km(this,o,s,t,a,!1):await this.resolve(e,t,a)||km(this,o,s,t,a,!0)}}}),"resolveTypescriptMjsCts");var VN=Object.defineProperty,XN=v((e,t)=>VN(e,"name",{value:t,configurable:!0}),"b$4"),YN=Object.defineProperty,Ey=XN((e,t)=>YN(e,"name",{value:t,configurable:!0}),"S"),QN=Object.defineProperty,nr=Ey((e,t)=>QN(e,"name",{value:t,configurable:!0}),"h");const ZN=/^export\s+default\s+(\w+);/m,e7=/export\s*\{([^}]*)\}/,t7=/\s*as\s+default\s*/,r7=/\s+\}$/,Mo=/;$/,n7=/(?:\r?\n\s*){2,}/g,kc=/^type\s+/,jm=/\bas\s+default\b/,i7=nr((e,t,r)=>{const n=wx(e).find(l=>l.names.includes("default")),i=ZN.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=e7.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=t7.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"),o7=nr((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"),Li=nr((e,t,r,n)=>{const i=Os(r.fileName,e,{astType:"ts",lang:"ts",sourceType:"module"});let o,s=0;const a=nr(()=>(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":{o7(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}
133
+ declare namespace ${o.local} {
134
+ `);for(const[m,g]of l.entries()){if(p.includes(m)&&m!==o.local)continue;const y=e.slice(g.start,g.end).replace(r7," }");d.append(" "),g.declare?d.append(y.replace("declare","export").replaceAll(" "," ")):d.append(`export ${y}`.replaceAll(" "," ")),d.append(`
135
+ `)}return d.append(` import _default = ${o.local};
136
+ export { _default as default };
137
+ `),d.append(`}
138
+ export = ${o.local};
139
+ `),d.toString()},"createCjsNamespace"),jc=nr((e,t,r)=>{const{defaultExport:n,exports:i}=t;if(r){const p=i.length===0?`export = ${r.defaultImport??""};`:`// @ts-ignore
140
+ export = ${r.defaultImport??""};
141
+ export { ${i.join(", ")} } from '${n.specifier??""}'`,f=e.replace(n.code.replace(Mo,""),p.replace(Mo,""));return f.endsWith(";")?f:`${f};`}const o=`import _default from '${n.specifier??""}';`,s=new Ke(e),a=As(e),l=a.length>0?a.at(-1):void 0;l?.end!==void 0&&l.end>0?s.appendRight(l.end,`
142
+ ${o}
143
+ `):s.prepend(`${o}
144
+ `);let c=s.toString();c=c.replaceAll(n7,`
145
+ `);let u;if(i.length===0)u=c.replace(n.code.replace(Mo,""),"export = _default");else{const p=`// @ts-ignore
146
+ export = _default;
147
+ export { ${i.join(", ")} } from '${n.specifier??""}';`;u=c.replace(n.code.replace(Mo,""),p)}return u.replaceAll(";;",";")},"handleDefaultCJSExportAsDefault"),s7=nr((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 Li(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??""}';
148
+ `;let u=e;const p=n.length>0?n.at(-1)?.end??0:0,f=new Ke(u);if(p>0?f.appendRight(p,`
149
+ ${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 Li(e,m,t,i)}return new Ke(u).replace(a.code,`export = ${s}`).toString()},"handleDefaultNamedCJSExport"),Am=nr((e,t,{defaultAlias:r,defaultExport:n,exports:i},o)=>{const s=i.filter(l=>kc.test(l)),a=i.filter(l=>!kc.test(l));if(s.length>0){let l="";return r&&(l+=`// @ts-ignore
150
+ ${r};
151
+ `),l+=`export type { ${s.map(c=>c.replace(kc,"").trim()).join(", ")} };
152
+ `,a.length>0&&(l+=`export { ${a.join(", ")} };
153
+ `),Li(e,l.trim(),t,o)}if(r&&a.length>0&&s.length===0){let l=`// @ts-ignore
154
+ ${r};
155
+ `;return l+=`export { ${a.join(", ")} };
156
+ `,Li(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"),a7=/^export\s+default\s+from\s+['"]([^'"]+)['"];?$/m,l7=nr((e,t,r)=>{const n=a7.exec(e);if(n)return{code:`import _default from '${n[1]??""}';
157
+ export = _default;`,map:void 0};const i=i7(e,t,r);if(i){let l;if(i.defaultExport.specifier){const{specifier:c}=i.defaultExport,u=As(e),p=u.filter(E=>E.imports).map(E=>xx(E)),f=p.find(E=>E.specifier===c),{defaultAlias:d,defaultExport:m,exports:g}=i,y=m.exports;if(d==="default"&&m.specifier&&g.length>0)l=jc(e,i,f);else if(d==="default"&&m.specifier&&g.length===0&&y&&jm.test(y))p.find(E=>E.specifier===m.specifier)?.defaultImport?l=jc(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=jc(e,i,f);else if(m.specifier&&d!=="default"){l=s7(e,t,i,u,r,f);const E=f&&i.defaultExport.specifier&&d!=="default"&&f.namedImports?.[d]!==d;if(!(l===void 0&&E)&&l===void 0&&!(d==="default"&&g.length===0&&y&&jm.test(y))){const j=Am(e,t,i,r);j&&(l=j)}}}else l=Am(e,t,i,r);return l?{code:l,map:void 0}:void 0}const o=Os(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=Li(e,l,t,r);return c?{code:c,map:void 0}:void 0}},"fixDtsDefaultCJSExports");var c7=Object.defineProperty,Om=Ey((e,t)=>c7(e,"name",{value:t,configurable:!0}),"s");const u7=/\.d\.c?ts$/,p7=Om((e={})=>{const{matcher:t=Om(r=>r.exports.length>0&&u7.test(r.fileName)&&r.isEntry,"matcher")}=e;return{name:"packem:fix-dts-default-cjs-exports-plugin",renderChunk(r,n){return t(n)?l7(r,{fileName:n.fileName,imports:n.imports},{warn:this.warn}):void 0}}},"fixDtsDefaultCjsExportsPlugin");var f7=Object.defineProperty,d7=v((e,t)=>f7(e,"name",{value:t,configurable:!0}),"r$4");const nl=d7((e,t={},r={})=>({...t,...e,values:e.values?{...e.values}:{...r}}),"cloneReplaceOptions");var m7=Object.defineProperty,h7=v((e,t)=>m7(e,"name",{value:t,configurable:!0}),"n$8");const Wi=h7(e=>!!e?.endsWith(".d"),"isDeclarationOnlyName");var g7=Object.defineProperty,je=v((e,t)=>g7(e,"name",{value:t,configurable:!0}),"i$6");const Me=je(e=>e.logger,"getLogger"),v7=/Circular dependency:[\s\S]*node_modules/,b7=/\.mts$/,y7=/\.(?:m|c)?(?:j|t)sx?$/,$7=/^['|"](use (\w+))['|"]$/,x7=/\.(?:[cm]?jsx?|[cm]?tsx?|json)$/,w7=je(e=>e instanceof RegExp?e.source:e,"regExpOrStringToString"),E7=je(e=>{if(typeof e=="boolean")return String(e);const t=[];for(const r of e)t.push(w7(r));return t.toSorted((r,n)=>r.localeCompare(n)).join(",")},"computeDtsResolveKey"),Rm=je((e,t)=>t?r=>{if(!Wi(r.name))return`${r.name}.${e()}`}:r=>{if(!Wi(r.name))return ji(r,e())},"createChunkFileNames"),_m=je((e,t)=>t?r=>{const{name:n}=r;if(!Wi(n))return`${n??"[name]"}.${e(r)}`}:r=>{const{name:n}=r;if(!Wi(n))return ux(r,e(r))},"createEntryFileNames"),Sy=je(e=>{const t=`node${ns.node.split(".")[0]}`;if(!e.pkg.engines?.node)return t;const r=Nt.minVersion(e.pkg.engines.node);return r?`node${String(r.major)}`:t},"resolveNodeTarget"),ky=je((e,t,r)=>{if(t){const n=tx(t);return e.options.runtime==="node"?[...new Set([r,...n])]:e.options.runtime==="browser"?[...new Set([...of(e.options.browserTargets??[]),...n])]:n}return e.options.runtime==="node"?[r]:of(e.options.browserTargets??[])},"resolveTransformerTarget"),S7=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=ky(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"),k7=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"),jy=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=ky(e,e.options.rollup.oxc.target,t),e.options.rollup.oxc},"getOxcTransformerConfig"),j7=je((e,t,r)=>{if(r)return"js";if(t.facadeModuleId?.endsWith(".mts")){const n=t.facadeModuleId.replace(b7,".cts");if(zh(n))return"mjs"}return!e.options.emitCJS&&e.options.emitESM&&e.pkg.main?.endsWith(".cjs")?"mjs":gt(e,"esm")},"resolveEsmEntryExtension"),A7=je((e,t)=>{const r=Sy(t);if(e==="esbuild")return S7(t,r);if(e==="swc")return k7(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 jy(t,r);throw new Error("A Unknown transformer was provided")},"getTransformerConfig"),Ay=je(e=>{if(e.options.rollup.resolve&&!e.options.experimental?.oxcResolve)return W$({...e.options.rollup.resolve});if(e.options.experimental?.oxcResolve&&e.options.rollup.experimental?.resolve)return L$(e.options.rollup.experimental.resolve,e.options.rootDir,Me(e),e.tsconfig?.path)},"createNodeResolver"),Oy=je((e,t)=>{if(e.code==="CIRCULAR_DEPENDENCY"&&v7.test(e.message))return!0;if(e.code==="UNRESOLVED_IMPORT"){const r=new Error(`Failed to resolve the module "${e.exporter??""}" imported by "${Ce(et(ve(),e.id??""))}"
158
+ Is the module installed? Note:
159
+ ↳ to inline a module into your bundle, install it to "devDependencies".
160
+ ↳ 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"),O7=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"),R7=je(e=>e.stack?`${e.message}
161
+ ${e.stack}`:e.message,"formatRollupLog"),_7=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"),P7=je((e,t,r,n)=>{if(t==="dts"&&n.code==="EMPTY_BUNDLE")return;const i=R7(n);_7(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"),Ry=je((e,t)=>({input:O7(e),logLevel:e.options.debug?"debug":"info",onLog:je((r,n)=>{P7(e,t,r,n)},"onLog"),onwarn(r,n){Oy(r,e)||r.code||n(r)},preserveEntrySignatures:"strict",treeshake:{moduleSideEffects:!0,preset:"smallest"},watch:e.mode==="watch"?e.options.rollup.watch:!1}),"baseRollupOptions"),C7=je((e,t,r,n)=>{const i={...e.options.rollup.alias,entries:t};return!r&&n&&(i.customResolver=n),Ph(i)},"buildAliasPlugin"),T7=je(e=>{if(!e.options.rollup.pure)return{pureNewExpressionPluginInstance:void 0,purePluginInstance:void 0};const t=F$({...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:H$({constructors:["Proxy","WeakMap","WeakSet","WeakRef",...e.options.rollup.pure.functions?.filter(r=>typeof r=="string"&&!r.includes("."))??[]],sourcemap:e.options.sourcemap}),purePluginInstance:t}},"buildPurePlugins"),N7=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"),I7=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"),M7=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"),D7=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 N7(e,n,r),I7(e,n,r),r.length===0&&!t?!1:M7([...r,...t??[]])},"computeDtsResolve"),B7=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"),L7=rx(B7),_y=je(async(e,t)=>{const r=Ha(e.pkg,e.options),n=D7(e),i=Ay(e),o=E7(n),s=`dts-plugin:${String(process.pid)}${e.tsconfig?.path??""}:${o}`,[a,l,c]=Dh(e.options.rollup.plugins,"dts");return{...Ry(e,"dts"),onwarn(u,p){Oy(u,e)||u.code!=="EMPTY_BUNDLE"&&u.code!=="CIRCULAR_DEPENDENCY"&&p(u)},output:[e.options.emitCJS&&{chunkFileNames:je(u=>ji(u,Ct(e,"cjs")),"chunkFileNames"),compact:e.options.minify,dir:ve(e.options.rootDir,e.options.outDir),entryFileNames:`[name].${Ct(e,"cjs")}`,format:"cjs",sourcemap:e.options.sourcemap,...e.options.rollup.output},e.options.emitESM&&{chunkFileNames:je(u=>ji(u,Ct(e,"esm")),"chunkFileNames"),compact:e.options.minify,dir:ve(e.options.rootDir,e.options.outDir),entryFileNames:`[name].${Ct(e,"esm")}`,format:"esm",sourcemap:e.options.sourcemap,...e.options.rollup.output},e.options.declaration==="compatible"&&{chunkFileNames:je(u=>ji(u,"d.mjs"),"chunkFileNames"),compact:e.options.minify,dir:ve(e.options.rootDir,e.options.outDir),entryFileNames:"[name].d.ts",format:"cjs",sourcemap:e.options.sourcemap,...e.options.rollup.output}].filter(Boolean),plugins:[Ch(),Ye(fb(),t),Ye(wy(),t),Ab(e,{dtsResolve:n,forTypes:!0,skipUnlistedWarnings:!0}),{load(u){if(!x7.test(u))return""},name:"packem:ignore-files"},e.tsconfig&&Ye(xy(e.options.rootDir,Me(e),e.tsconfig),t),e.tsconfig&&e.options.rollup.tsconfigPaths&&Ye(yy(e.options.rootDir,e.tsconfig,Me(e),e.options.rollup.tsconfigPaths),t),Tb(e),e.options.rollup.replace&&Th(nl(e.options.rollup.replace,{sourcemap:e.options.sourcemap})),e.options.rollup.alias&&Ph({customResolver:i,...e.options.rollup.alias,entries:r}),...a,i,...l,...await L7(s)(e,n),e.options.emitCJS&&p7(),e.options.cjsInterop&&e.options.emitCJS&&Uh({...e.options.rollup.cjsInterop,logger:Me(e)}),e.options.rollup.patchTypes&&Ye(bN(e.options.rollup.patchTypes,Me(e)),t),n8(),...c,e.options.rollup.license!==!1&&e.options.rollup.license?.path&&typeof e.options.rollup.license.dtsTemplate=="function"&&_b({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 W7=Object.defineProperty,Py=v((e,t)=>W7(e,"name",{value:t,configurable:!0}),"n$7");const Cy=Py(async(e,t,r)=>{const n=Ha(e.pkg,e.options),i=r==="rolldown",o=i?void 0:Ay(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:jC(e.dependencyGraphMap,e.buildEntries,!i&&!!e.options.rollup.preserveDirectives),preserveModules:!1},[c,u,p]=Dh(e.options.rollup.plugins,"build"),f=e.tsconfig?.config.compilerOptions?.esModuleInterop,{pureNewExpressionPluginInstance:d,purePluginInstance:m}=T7(e);return{...Ry(e,"build"),output:[e.options.emitCJS&&{assetFileNames:"[name]-[hash][extname]",chunkFileNames:Rm(()=>gt(e,"cjs"),a),compact:e.options.minify,dir:ve(e.options.rootDir,e.options.outDir),entryFileNames:_m(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:Rm(()=>gt(e,"esm"),a),compact:e.options.minify,dir:ve(e.options.rootDir,e.options.outDir),entryFileNames:_m(g=>j7(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&&Ch(),D3(),Ye(fb(),t),Ab(e),wy(),e.tsconfig&&Ye(xy(e.options.rootDir,Me(e),e.tsconfig),t),e.tsconfig&&e.options.rollup.tsconfigPaths&&Ye(yy(e.options.rootDir,e.tsconfig,Me(e),e.options.rollup.tsconfigPaths),t),Tb(e),e.options.rollup.replace&&Th(nl(e.options.rollup.replace,{sourcemap:e.options.sourcemap})),e.options.rollup.alias&&C7(e,n,i,o),...c,o,e.options.rollup.nativeModules&&v9(e.options.rollup.nativeModules),e.options.rollup.dataUri&&lT({...e.options.rollup.dataUri}),e.options.rollup.polyfillNode&&q$({sourceMap:e.options.sourcemap,...e.options.rollup.polyfillNode}),!i&&e.options.rollup.json&&Mx({...e.options.rollup.json}),e.options.rollup.debarrel&&NT(e.options.rollup.debarrel,Me(e)),!i&&z$(),e.options.rollup.wasm&&G$(e.options.rollup.wasm),e.options.rollup.url&&Q8(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(S9(e.options.rollup.raw),t),e.options.sourcemap&&G8(e.options.rollup.sourcemap),...u,e.options.rollup.minifyHTMLLiterals&&e.options.minify&&u9({...e.options.rollup.minifyHTMLLiterals,logger:Me(e)}),e.options.rollup.requireCJS&&e.options.emitESM&&Ye(q9({...e.options.rollup.requireCJS,cwd:e.options.rootDir},Me(e)),t),e.options.rollup.babel&&Ye(HC({include:e.options.rollup.babel.include??y7,...e.options.rollup.babel,root:e.options.rootDir,sourceMaps:e.options.rollup.babel.sourceMaps??e.options.sourcemap}),t),!i&&d,!i&&m,!i&&e.options.transformer&&Ye(e.options.transformer(A7(e.options.transformerName,e)),t),!i&&e.options.rollup.preserveDirectives&&U$({directiveRegex:$7,...e.options.rollup.preserveDirectives,logger:Me(e)}),e.options.rollup.shebang&&r8(e.options.entries.filter(g=>g.executable).map(g=>g.name).filter(Boolean),e.options.rollup.shebang),!i&&e.options.cjsInterop&&e.options.emitCJS&&Uh({...e.options.rollup.cjsInterop,logger:Me(e)}),e.options.rollup.dynamicVars&&qP(),!i&&e.options.rollup.dynamicVars&&K$(e.options.rollup.dynamicVars),!i&&e.options.rollup.commonjs&&Ye(J$({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&&m3(e.pkg,e.options.rollup.shim),!i&&e.options.rollup.jsxRemoveAttributes&&Ye(V$({attributes:e.options.rollup.jsxRemoveAttributes.attributes,logger:Me(e)}),t),...p,e.options.rollup.metafile&&XP(),e.options.rollup.copy&&VC(e.options.rollup.copy,Me(e)),e.options.rollup.license!==!1&&e.options.rollup.license?.path&&typeof e.options.rollup.license.dependenciesTemplate=="function"&&_b({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&&X$({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"),Ty=Py((e,t)=>Cy(e,t,"rollup"),"getRollupOptions");var F7=Object.defineProperty,Ny=v((e,t)=>F7(e,"name",{value:t,configurable:!0}),"i$5");const H7=Ny(e=>{if(!e.options.rollup.oxc)return{};const t=jy(e,Sy(e));return{jsx:t.jsx,target:t.target,typescript:t.typescript}},"getRolldownTransformOptions"),q7=Ny(async(e,t)=>{const r=await Cy(e,t,"rolldown");return r.transform=H7(e),e.options.minify&&Array.isArray(r.output)&&(r.output=r.output.map(n=>({...n,minify:!0}))),r},"getRolldownOptions");var z7=Object.defineProperty,G7=v((e,t)=>z7(e,"name",{value:t,configurable:!0}),"u$9");const Iy=G7((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 U7=Object.defineProperty,il=v((e,t)=>U7(e,"name",{value:t,configurable:!0}),"l$9");const Up=il(async(e,t)=>{try{return t(await e())}catch{return}},"tryImport"),My="Rollup is not installed. Please install 'rollup' to use bundler: 'rollup' or DTS generation with the rollup driver.",Kp=il(async()=>{const e=await Up(()=>import("rollup"),t=>t.rollup);if(!e)throw new Error(My);return e},"getRollupBuild"),K7=il(async()=>{const e=await Up(()=>import("rollup"),t=>t.watch);if(!e)throw new Error(My);return e},"getRollupWatch");il(async()=>Up(()=>import("rollup"),e=>e.VERSION),"getRollupVersion");var J7=Object.defineProperty,ol=v((e,t)=>J7(e,"name",{value:t,configurable:!0}),"p$6");const Pm="rollup-build.json",pn="dependencies-cache.json",Dy=ol(e=>e??"rollup","resolveBundlerName"),V7={".css":"js",".less":"js",".pcss":"js",".sass":"js",".scss":"js",".styl":"js",".stylus":"js"},X7=ol(async(e,t,r,n)=>{const i=e.options.validation&&e.options.validation.dependencies!==!1&&!!t.get(pn,r),o=!e.options.validation||e.options.validation.dependencies===!1||i;let s=n;if(o&&(s={...n,cache:t.get(Pm,r)},i)){const l=t.get(pn,r);l&&(l.used?.forEach(c=>e.usedDependencies.add(c)),l.hoisted?.forEach(c=>e.hoistedDependencies.add(c)))}const a=await(await Kp())(s);try{o&&t.set(Pm,a.cache,r),e.options.validation&&e.options.validation.dependencies!==!1&&t.set(pn,{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);Iy(u,e,l)}e.buildEntries.push(...l.values())}finally{await a.close()}},"buildWithRollup"),Y7=ol(async(e,t,r,n)=>{if(e.options.validation&&e.options.validation.dependencies!==!1&&t.get(pn,r)){const a=t.get(pn,r);a&&(a.used?.forEach(l=>e.usedDependencies.add(l)),a.hoisted?.forEach(l=>e.hoistedDependencies.add(l)))}const i=await ub(),o={...n,moduleTypes:{...V7,...n.moduleTypes}},s=await i(o);try{e.options.validation&&e.options.validation.dependencies!==!1&&t.set(pn,{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);Iy(c,e,a)}e.buildEntries.push(...a.values())}finally{await s.close?.()}},"buildWithRolldown"),Q7=ol(async(e,t,r,n)=>{const i=n==="rolldown",o=i?await q7(e,t):await Ty(e,t);await e.hooks.callHook("rollup:options",e,o),Object.keys(o.input??{}).length!==0&&(await(i?Y7(e,t,r,o):X7(e,t,r,o)),await t.flush())},"build");var Z7=Object.defineProperty,jo=v((e,t)=>Z7(e,"name",{value:t,configurable:!0}),"i$4");const Cm=jo(async e=>{try{return await(e==="rolldown"?ub():Kp()),!0}catch{return!1}},"isBundlerAvailable"),Tm=jo((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"),By=jo(async(e,t,r,n,i)=>{if(!(process.stdout.isTTY&&!process.env.CI)){const a=await cd(e,r);throw new Error(`${e} is required but is not installed. Run: ${a}`)}const o=await Dx({initialValue:!0,message:t});if(Bx(o)||!o){const a=await cd(e,r);throw new Error(`Cannot continue without ${e}. Run: ${a}`)}const s=Lx();s.start(`Installing ${e}`);try{await Eh([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"),Nm=jo(async(e,t,r)=>{await Cm(e)||await By(e,`${e} is required as the bundler but is not installed. Install it now?`,t,r,()=>Cm(e))},"ensureBundlerInstalled"),eI=jo(async(e,t,r)=>{const n=zR[e];Tm(n,t)||await By(n,`${n} is required for transformer: "${e}" but is not installed. Install it now?`,t,r,()=>Promise.resolve(Tm(n,t)))},"ensureTransformerInstalled");var tI=Object.defineProperty,rI=v((e,t)=>tI(e,"name",{value:t,configurable:!0}),"e$2");const sl=rI(e=>{const t=le(e,"package.json");if(!Ft(t))throw new Error(`package.json not found at ${t}`);const r=BR(t,{resolveCatalogs:!0});return r.publishConfig&&Object.assign(r,r.publishConfig),{packageJson:r,packageJsonPath:t}},"loadPackageJson");var nI=Object.defineProperty,iI=v((e,t)=>nI(e,"name",{value:t,configurable:!0}),"f$7");const oI=iI(async(e,t,r,n)=>{let i;if(n){const o=le(e,n);if(!await Ze(o))throw new Error(`tsconfig.json not found at ${o}`);i={config:Wx(o),path:o},r.info("Using tsconfig settings at",o)}else if(Hv(t,["typescript"]))try{i=await Fx(e),r.debug("Using tsconfig settings found at",i.path)}catch{r.info("No tsconfig.json or jsconfig.json found.")}return i},"loadTsconfig");var sI=Object.defineProperty,Rt=v((e,t)=>sI(e,"name",{value:t,configurable:!0}),"s$9");const aI=/^\.\.?\//,lI=Rt((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"),Im=Rt((e,t)=>{if(typeof e.name!="string"){let r=Hi(e.input)?et(t.options.rootDir,e.input):dn(e.input);r.startsWith("./")&&(r=r.slice(2)),e.name=r.replace(new RegExp(`^${t.options.sourceDir}/`),"").replace(vu,"")}if(!e.input)throw new Error(`Missing entry input: ${JSON.stringify(e)}`);kh(e.input)&&(e.input=ve(t.options.rootDir,e.input)),t.options.declaration&&e.declaration===void 0&&(e.declaration=t.options.declaration),lI(e,t),e.outDir=ve(t.options.rootDir,e.outDir??t.options.outDir)},"extendEntry"),cI=Rt(e=>{e.options.entries=e.options.entries.map(t=>typeof t=="string"?{input:t,isGlob:zc(t)}:{...t,exportKey:t.exportKey??new Set,isGlob:zc(t.input)})},"normalizeEntries"),uI=Rt(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"),pI=Rt(e=>{for(const t of e.options.entries.filter(r=>r.isGlob)){const r={...t};delete r.isGlob;const n=jg([r.input],{cwd:e.options.rootDir,dot:!1,ignore:uI(e),onlyFiles:!0});if(n.length===0)throw new sp(`No files found in the glob pattern: ${Ce(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"),fI=Rt(e=>{for(const t of e)if(t==="node"||t==="workerd"||t.includes("node")||t.includes("workerd"))return!0;return!1},"hasNodeLikeExportKey"),dI=Rt(e=>e.includes(".server")||e.includes(".node")||e.includes(".workerd"),"fileAliasIndicatesNode"),mI=Rt(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&&fI(e.exportKey)||e.fileAlias&&dI(e.fileAlias))return"node"},"resolveEntryRuntime"),hI=Rt(e=>{for(const t of e.options.entries){if(t.runtime)continue;const r=mI(t);r&&(t.runtime=r)}},"detectEntryRuntimes"),gI=Rt(e=>{for(const t of e.options.entries)if(t.fileAlias){let r=t.fileAlias;for(;r.startsWith("./")||r.startsWith("../");)r=r.replace(aI,"");t.name=r}},"applyFileAliasNames"),Ly=Rt(e=>{cI(e),pI(e),hI(e),gI(e);for(const t of e.options.entries.filter(r=>!r.fileAlias))Im(t,e);for(const t of e.options.entries.filter(r=>r.fileAlias))Im(t,e),t.fileAlias=void 0},"prepareEntries");var vI=Object.defineProperty,Dn=v((e,t)=>vI(e,"name",{value:t,configurable:!0}),"d$7");const bI=/^[_$a-z\u00A0-\uFFFF][\w$\u00A0-\uFFFF]*$/iu,yI=Dn((e,t)=>{const r=e.options.jiti.transformOptions?.babel?.plugins;return JSON.stringify({...e.options.jiti,alias:{...Ha(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"),$I=Dn(e=>e.filter(t=>t!=="default").map((t,r)=>{if(bI.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};
162
+ export { ${n} as ${JSON.stringify(t)} };`}),"buildNamedExportLines"),Wy=Dn((e,t,r)=>{hu(e,`export * from "${t}";
163
+ ${r?`export { default } from "${t}";`:""}`)},"writeDtsStub"),xI=Dn(async(e,t,r,n,i,o,s,a,l,c)=>{const u=t(Te(r),await qh("jiti",{conditions:["node","import"],url:import.meta.url})),p=Ct(e,"esm"),f=`${i}.${p}`;hu(`${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;"]:[],...$I(l)].join(`
164
+ `)),e.options.declaration&&Wy(`${r}.${p}`,f,c)},"buildEsmStub"),wI=Dn(async(e,t,r,n,i,o,s,a,l)=>{const c=t(Te(r),await qh("jiti",{conditions:["node","require"],url:import.meta.url})),u=Ct(e,"cjs"),p=`${i}.${u}`;hu(`${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(`
165
+ `)),e.options.declaration&&Wy(`${r}.${u}`,p,l)},"buildCjsStub"),EI=Dn(async e=>{const t=[],r=yI(e,t);for(const n of e.options.entries){const i=ve(e.options.rootDir,e.options.outDir,n.name),o=Ex(e.jiti.esmResolve(n.input,{try:!0})??n.input),s=o.replace(vu,""),a=mu(o),l=i8(a);let c;try{c=await Sx(o,{extensions:ks})}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)):et;e.options.emitESM&&await xI(e,p,i,o,s,l,r,t,c,u),e.options.emitCJS&&await wI(e,p,i,o,s,l,r,t,u),l&&(await nu(`${i}.${gt(e,"cjs")}`),await nu(`${i}.${gt(e,"esm")}`))}await e.hooks.callHook("rollup:done",e)},"createStub");var SI=Object.defineProperty,Pt=v((e,t)=>SI(e,"name",{value:t,configurable:!0}),"a$9");const Jp=Pt(e=>e.logger,"getLogger"),ys="rollup-watch.json",Mm=Pt(({context:e,doOnSuccessCleanup:t,fileCache:r,mode:n,runBuilder:i,runOnsuccess:o,useCache:s,watcher:a})=>{const l=`watcher:${n}`,c=Jp(e);a.on("change",async(u,{event:p})=>{await t?.(),c.info({message:`${Ce(et(".",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"?ys:`dts-${ys}`,u.result.cache),c.raw(`
166
+ ⚡️ Build run in ${String(u.duration)}ms
167
+
168
+ `),await i?.(!0);break}case"BUNDLE_START":{c.info({message:Ce("build started..."),prefix:l});break}case"END":{c.success({message:"Rebuild finished",prefix:l}),await o?.();break}case"ERROR":{Nh(u.error),c.error({context:[u.error],message:`Rebuild failed: ${u.error.message}`,prefix:l});break}}})},"watchHandler"),kI=Pt((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(`
169
+ └─ ${et(process.cwd(),i)}`);Jp(e).info(n)},"logInputs"),jI=Pt((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"),AI=Pt((e,t)=>{const r=e.options.rollup.watch;return!r||typeof t!="object"||t.include!==void 0?t:jI(e,t,r)},"configureWatchOptions"),OI=Pt(async(e,t,r,n,i)=>{let o=!0;e.options.rollup.css&&(o=!1);let s=[];const a=Pt(async()=>{await Promise.all(s.map(m=>m.close())),s=[]},"closeWatchers"),l=Pt(async()=>{const m=await K7(),g=await Ty(e,t);if(await e.hooks.callHook("rollup:options",e,g),Object.keys(g.input??{}).length===0)return;o&&(g.cache=t.get(ys)),g.watch=AI(e,g.watch);const y=m(g);if(await e.hooks.callHook("rollup:watch",e,y),kI(e,g),Mm({context:e,doOnSuccessCleanup:i,fileCache:t,mode:"bundle",runBuilder:r,runOnsuccess:n,useCache:o,watcher:y}),s.push(y),e.options.declaration){const E=await _y(e,t);o&&(E.cache=t.get(`dts-${ys}`)),await e.hooks.callHook("rollup:dts:options",e,E);const j=m(E);await e.hooks.callHook("rollup:watch",e,j),Mm({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=pp.map(m=>le(e.options.rootDir,m));let p;const f=Pt(async m=>{const g=Jp(e);g.info(`${et(".",m)} changed, restarting watchers...`);try{await a();const{packageJson:y}=sl(e.options.rootDir);e.pkg=y,e.options.entries.length=0,e.buildEntries.length=0,await e.hooks.callHook("build:prepare",e),Ly(e),await l()}catch(y){g.error({message:`Failed to restart watchers: ${y.message}`,prefix:"watcher"})}},"runRestart"),d=Pt(m=>{clearTimeout(p),p=setTimeout(()=>{f(m).catch(()=>{})},100)},"restart");lf(c,()=>{d(c)});for(const m of u)if(Ft(m)){lf(m,()=>{d(m)});break}},"watch");var RI=Object.defineProperty,_I=v((e,t)=>RI(e,"name",{value:t,configurable:!0}),"s$8");const PI=_I(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: \`./${et(e.options.rootDir,n)}\``),await d2(n))}},"cleanDistributionDirectories");var CI=Object.defineProperty,TI=v((e,t)=>CI(e,"name",{value:t,configurable:!0}),"o$4");const NI=TI(()=>Hx((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 II=Object.defineProperty,Do=v((e,t)=>II(e,"name",{value:t,configurable:!0}),"n$4");const MI=Mt,DI=Do((e,t)=>{const{sideEffects:r}=t;let n;if(typeof r=="boolean")n=Do(()=>r,"hasSideEffects");else if(Array.isArray(r))if(r.length<=0)n=Do(()=>!1,"hasSideEffects");else{const i=r.map(o=>o.includes("/")?o:`**/${o}`);n=MI(i,void 0,{resolve:e})}else n=Do(()=>{},"hasSideEffects");return n},"getPackageSideEffect");var Ac,Dm;function BI(){if(Dm)return Ac;Dm=1;var e=Object.defineProperty,t=v((l,c)=>e(l,"name",{value:c,configurable:!0}),"s"),r=qx,n=r.spawn,i=r.exec;Ac=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(E){var E=E.toString("ascii");m+=E});var g=t(function(y){if(delete u[l],y!=0){Object.keys(u).length==0&&f();return}m.match(/\d+/g).forEach(function(E){E=parseInt(E,10),c[l].push(E),c[E]=[],u[E]=1,a(E,c,u,p,f)})},"onClose");d.on("close",g)}return v(a,"buildProcessTree"),t(a,"buildProcessTree"),Ac}v(BI,"requireTreeKill");var LI=BI();const WI=Ss(LI);var FI=Object.defineProperty,Fy=v((e,t)=>FI(e,"name",{value:t,configurable:!0}),"l$6");const HI=Fy(e=>process.platform==="win32"&&"cmd"in e&&"code"in e&&typeof e.cmd=="string"&&e.cmd.startsWith("taskkill")&&e.code===128,"isTaskKillCmdProcessNotFoundError"),qI=Fy(async({pid:e,signal:t})=>{await new Promise((r,n)=>{if(!Number.isInteger(e)||e<=0){n(new Error("Invalid process ID"));return}WI(e,t,i=>{if(i&&!HI(i)){n(i);return}r()})})},"killProcess");var zI=Object.defineProperty,GI=v((e,t)=>zI(e,"name",{value:t,configurable:!0}),"o$2");const Bm=GI((e,t)=>{if(e.warnings.size>0){const r=e.logger;if(t&&r.raw(`
170
+ `),r.warn(`Build is done with some warnings:
171
+
172
+ ${Array.from(e.warnings,n=>`- ${n}`).join(`
173
+ `)}`),e.options.failOnWarn)throw new Error("Exiting with code (1). You can change this behavior by setting `failOnWarn: false`.")}},"logBuildErrors");var UI=Object.defineProperty,Hy=v((e,t)=>UI(e,"name",{value:t,configurable:!0}),"t$2");const KI=Hy(async(e,t,r,n)=>{try{await js(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(`
174
+ `),r.info({message:`Removing ${t} file cache, the cache key is not used anymore.`,prefix:"file-cache"}),!1},"removeStaleCacheDirectory"),JI=Hy(async(e,t,r)=>{if(!e)return;const n=le(e,"keystore.json");if(!await Ze(n))return;const i=await _n(n),o=(await bx(e,{withFileTypes:!0})).filter(a=>a.isDirectory());let s=r;for(const a of o)i[a.name]||(s=await KI(e,a.name,t,s))},"removeOldCacheFolders");var VI=Object.defineProperty,qy=v((e,t)=>VI(e,"name",{value:t,configurable:!0}),"s$5");const Lm=qy((e,t)=>{for(const r of Lc(e??[]))if(typeof r=="string"&&r.startsWith("node")){const n=Nt.coerce(r.slice(4));n&&t.push(n.version)}},"collectNodeTargets"),XI=qy(e=>{if(e.options.runtime!=="node"||!e.options.emitCJS)return;const t=[],r=e.pkg.engines?.node,n=r?Nt.minVersion(r):void 0;n&&t.push(n.version);const i=e.options.rollup;if(Lm(i.esbuild?.target,t),Lm(i.oxc?.target,t),t.length===0){const o=Nt.coerce(ns.node);o&&t.push(o.version)}t.some(o=>Nt.satisfies(o,">=23.0.0 || >=22.12.0"))&&e.logger.warn(["We recommend using the ESM format instead of CommonJS.","The ESM format is compatible with modern platforms and runtimes, and most new libraries are now distributed only in ESM format.","Learn more at https://nodejs.org/en/learn/modules/publishing-a-package#how-did-we-get-here"].join(`
175
+ `))},"warnLegacyCJS");var YI=Object.defineProperty,oe=v((e,t)=>YI(e,"name",{value:t,configurable:!0}),"b$2");const QI=De(import.meta.url),Vr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:tr,Vp=oe(e=>{if(typeof Vr<"u"&&Vr.versions&&Vr.versions.node){const[t,r]=Vr.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Vr.getBuiltinModule(e)}return QI(e)},"__cjs_getBuiltinModule"),tr=Vr,{execFileSync:ZI}=Vp("node:child_process"),Si=Vp("node:fs"),e4=Vp("node:tty"),Xp=[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],Yp=[12288,12288,65281,65376,65504,65510],Qp=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Zp=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],al=[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],Ao=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"),t4=Xp[0],r4=Xp.at(-1),n4=Yp[0],i4=Yp.at(-1),o4=Qp[0],s4=Qp.at(-1),a4=Zp[0],l4=Zp.at(-1),c4=al[0],u4=al.at(-1),Wm=19968,[p4,f4]=zy(al);function zy(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(Wm>=i&&Wm<=o)return[i,o];o-i>r-t&&(t=i,r=o)}return[t,r]}v(zy,"ge$1");oe(zy,"findWideFastPathRange");const d4=oe(e=>e<t4||e>r4?!1:Ao(Xp,e),"isAmbiguous"),m4=oe(e=>e<n4||e>i4?!1:Ao(Yp,e),"isFullWidth"),h4=oe(e=>e<o4||e>s4?!1:Ao(Qp,e),"isHalfWidth"),g4=oe(e=>e<a4||e>l4?!1:Ao(Zp,e),"isNarrow"),v4=oe(e=>e>=p4&&e<=f4?!0:e<c4||e>u4?!1:Ao(al,e),"isWide");function Gy(e){return d4(e)?"ambiguous":m4(e)?"fullwidth":h4(e)?"halfwidth":g4(e)?"narrow":v4(e)?"wide":"neutral"}v(Gy,"Se$1");oe(Gy,"getCategory");function Uy(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}v(Uy,"Be");oe(Uy,"validate");function ef(e){return Uy(e),Gy(e)}v(ef,"Vt");oe(ef,"eastAsianWidthType");const Ky=String.raw,Fm=Ky`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,b4=oe(()=>new RegExp(Ky`\p{RI}{2}|(?![#*\d](?!\uFE0F?\u20E3))${Fm}(?:\u200D${Fm})*`,"gu"),"emojiRegex"),Bn=new Set(["\x1B","›"]),ll="\x07",Jy="[",tf="m",$s="]8;;",y4=39,$4=/[\u200B\uFEFF\u2060-\u2064]/g,x4=new RegExp(`(?:\\${Jy}(?<code>\\d+)m|\\${$s}(?<uri>.*)${ll})`),w4=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]])),mr=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,Hm=/\u001B\[(\d+(?:;\d+)*)?m[^\u001B]*(?:\u001B\[(?:\d+(?:;\d+)*)?m|$)/g,qm=/\u001B\]8;[^\u0007\u001B]*(?:\u0007|\u001B\\)(.*?)\u001B\]8;;(?:\u0007|\u001B\\)/g,Bo=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Oc=b4(),zm=new Map,Lo=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,ts=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"),E4=oe((e,t)=>{const r=Math.floor(e/65536),n=e%65536;let i=zm.get(r);if(i||(i=new Map,zm.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(ef(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"),S4=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"),xn=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?xn(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",E=y.length,j=e.indexOf("\x07",s+5);if(j!==-1){const R=e.indexOf(y,j+1);if(R!==-1){const b=R+E,w=e.slice(j+1,R).replace(mr,""),h=xn(w,{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(mr.lastIndex=s,mr.test(e)){const y=mr.lastIndex-s,E=r.truncation.countAnsiEscapeCodes?y:r.width.ansi;if(a+E>n&&(l=Math.min(l,s),a+E>r.truncation.limit)){c=!0;break}a+=E,s=mr.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(Lo.lastIndex=s,Lo.test(e)){const y=(Lo.lastIndex-s)*r.width.regular;if(a+y>n){const E=Math.floor((n-a)/r.width.regular);if(l=Math.min(l,s+E),a+y>r.truncation.limit){c=!0;break}}a+=y,s=Lo.lastIndex;continue}if((d<=31||d>=127&&d<=159)&&(Bo.lastIndex=s,Bo.test(e))){const y=(Bo.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=Bo.lastIndex;continue}if(Oc.lastIndex=s,Oc.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=Oc.lastIndex;continue}const m=e.codePointAt(s)??0;if(S4(m)){s+=m>65535?2:1;continue}let g;if(o)g=E4(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(ef(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={})=>xn(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");class k4{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 Gm=new k4(100),j4=new Intl.Segmenter("en",{granularity:"grapheme"}),A4=/^[\u0000-\u007F]*$/,O4=new Set(["0","22","23","24","27","28","29","39","49"]),R4=new Set(["1","3","4","7","8","9"]),Um=new Map([["22","1"],["23","3"],["24","4"],["27","7"],["28","8"],["29","9"]]),Wo=oe(e=>e>="30"&&e<="37"||e>="90"&&e<="97"||e.startsWith("38;"),"isForegroundColor"),Fo=oe(e=>e>="40"&&e<="47"||e>="100"&&e<="107"||e.startsWith("48;"),"isBackgroundColor"),_4=[{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"}],Km=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"),P4=oe((e,t)=>{if(!e.includes("\x1B"))return[{after:"",before:"",content:e,visibleLength:Be(e,t.width)}];const r=Gm.get(e);if(r)return r;const n=[],i=[];let o=0,s;for(mr.lastIndex=0;(s=mr.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(O4.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 E=y.slice(2,-1);if(Wo(E)){l.delete(y);break}}}else if(g==="49"){for(const y of l)if(y.startsWith("\x1B[")&&y.endsWith("m")){const E=y.slice(2,-1);if(Fo(E)){l.delete(y);break}}}else if(Um.has(g)){const y=Um.get(g);for(const E of l)if(E===`\x1B[${y}m`){l.delete(E);break}}else{if(Wo(g)){for(const y of l)if(y.startsWith("\x1B[")&&y.endsWith("m")){const E=y.slice(2,-1);if(Wo(E)){l.delete(y);break}}}else if(Fo(g)){for(const y of l)if(y.startsWith("\x1B[")&&y.endsWith("m")){const E=y.slice(2,-1);if(Fo(E)){l.delete(y);break}}}else if(R4.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,E=!1;for(const R of l)if(R.startsWith("\x1B[")&&R.endsWith("m")){const b=R.slice(2,-1);Wo(b)?y=!0:Fo(b)&&(E=!0)}if(y&&E){const R=Km(e,["\x1B[3","\x1B[9","\x1B[38;"]),b=Km(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"),E&&m.push("\x1B[49m");y&&E&&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=_4.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 Gm.set(e,c),c},"processIntoStyledSegments"),C4=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:j4,...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 A4.test(e)?e.slice(t,r):C4(e,t,r,i);if(Hm.lastIndex=0,qm.lastIndex=0,!Hm.test(e)&&!qm.test(e))return e;const s=P4(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,E=g.before;y!==E&&(y||E)&&c.push(y,E)}}return c.push(l.at(-1).segment.after),c.join("")},"slice"),Jm="…",T4=3,Ho=oe((e,t,r=!1)=>{if(e.charAt(t)===" ")return t;const n=r?1:-1,i=Math.min(T4,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"),qo=oe((e,t,r)=>xn(e,{...r,ellipsis:"",ellipsisWidth:0,limit:t}).index,"widthToIndex"),zo=oe((e,t,r)=>Be(e.slice(0,t),r),"indexToWidth"),Vm=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=Jm,position:o="end",preferTruncationOnSpace:s=!1}=r;let a=r.ellipsisWidth??i===Jm?1:void 0;a??=xn(i,{...r.width,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width;const{width:l}=xn(n,{...r.width,ellipsis:i,ellipsisWidth:a});if(l<=t)return n;switch(o){case"end":{if(s){const c=t-a,u=qo(n,c,r.width),p=Ho(n,u),f=zo(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=qo(n,p,r.width),m=Ho(n,d),g=zo(n,m,r.width),y=l-f,E=qo(n,y,r.width),j=Ho(n,E,!0),R=zo(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=qo(n,c,r.width),p=Ho(n,u,!0),f=zo(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"),N4=/\x1B\[(\d+)m/;class Vy{static{v(this,"Jt")}static{oe(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const r=N4.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 Xy=oe((e,t)=>{if(!Bn.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const r=!0,n=e.slice(t+1,t+1+$s.length).join("")===$s;return{isInsideEscape:r,isInsideLinkEscape:n}},"checkEscapeSequence"),I4=oe((e,t={})=>{const r=new Vy;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&&Bn.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=Xy(l,c),{isInsideLinkEscape:m}=d;if(m){let g=c+1;for(s="";g<l.length;){const E=l[g];if(E===ll)break;s+=E,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===tf){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"),Xm=oe(e=>`${Bn.values().next().value}${Jy}${String(e)}${tf}`,"wrapAnsiCode"),Ym=oe(e=>`${Bn.values().next().value}${$s}${e}${ll}`,"wrapAnsiHyperlink"),M4=oe(e=>{if(e.length===0)return"";if(e.length===1)return e[0];let t="",r,n;const i=e.join(`
176
+ `),o=[...i];let s=0;for(const[a,l]of o.entries()){if(t+=l,Bn.has(l)){const u=x4.exec(i.slice(s))?.groups??{};if(u.code!==void 0){const p=Number.parseFloat(u.code);r=p===y4?void 0:p}else u.uri!==void 0&&(n=u.uri.length===0?void 0:u.uri)}const c=w4.get(Number(r));o[a+1]===`
177
+ `?(n&&(t+=Ym("")),r&&c&&(t+=Xm(c))):l===`
178
+ `&&(r&&c&&(t+=Xm(r)),n&&(t+=Ym(n))),s+=l.length}return t},"preserveAnsi"),Yy=/(?=\s)|(?<=\s)/,Qy=/^\s+$/,Rc=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"),Er=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"),Zy=oe((e,t,r)=>{if(e.length===0)return[""];if(t<=0)return[e];const n=[],i=new Vy;let o="",s=0,a=!1,l=!1,c="",u=0;for(;u<e.length;){const p=e[u];if(Bn.has(p)){a=!0,c=p,o+=p,l=Xy([...e],u).isInsideLinkEscape,u+=1;continue}if(a){c+=p,o+=p,l?p===ll&&(a=l=!1):p===tf&&(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=>Er(p)):n},"wrapWithBreakAtWidth"),D4=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 I4(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=>Er(a)):i},"wrapCharByChar"),B4=oe((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(Yy),o=[];let s="",a=0,l=0;for(;l<i.length;){const c=i[l],u=Qy.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(Er(s)):o.push(s),s="",a=0;continue}s+=c,a+=p,l+=1}return s&&(r?o.push(Er(s)):o.push(s)),o},"wrapWithWordBoundaries"),L4=oe((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const i=n.split(Yy),o=[];let s="",a=0,l=0;for(;l<i.length;){const c=i[l],u=Qy.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(Rc(r?Er(s):s));const f=Zy(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(Rc(r?Er(s):s)),s="",a=0,r&&u)){l+=1;continue}s+=c,a+=p,l+=1}return s&&o.push(Rc(r?Er(s):s)),o},"wrapAndBreakWords"),Go={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},W4=oe((e,t={})=>{const{removeZeroWidthCharacters:r=!0,trim:n=!0,width:i=80,wrapMode:o=Go.PRESERVE_WORDS}=t;if(n&&e.trim()==="")return"";let s=e.normalize("NFC").replaceAll(`\r
179
+ `,`
180
+ `);return r&&(s=s.replaceAll($4,"")),s.split(`
181
+ `).map(a=>{if(n&&a.trim()==="")return"";let l;switch(o){case Go.BREAK_AT_CHARACTERS:{l=D4(a,i,n);break}case Go.BREAK_WORDS:{l=L4(a,i,n);break}case Go.STRICT_WIDTH:{l=Zy(a,i,n);break}default:l=B4(a,i,n)}return M4(l)}).join(`
182
+ `)},"wordWrap"),e$=80,t$=24,lu=oe((e,t,{shell:r,env:n}={})=>ZI(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:r,env:n}).trim(),"exec"),rs=oe((e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),"create"),r$=oe((e,t)=>{const{columns:r,rows:n}=rs(e,t);if(!(Number.isNaN(r)||Number.isNaN(n))&&!(r===e$&&n===t$))return{columns:r,rows:n}},"createIfNotDefault"),F4=oe(()=>{if(tr.platform!=="linux")return!0;try{const e=Si.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 n$(){const{env:e,stdout:t,stderr:r}=tr;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:e$,rows:t$};return tr.platform==="win32"?_c()??n:tr.platform==="darwin"?Qm()??_c()??n:Qm()??_c()??H4()??n}v(n$,"Le");oe(n$,"terminalSize");const Qm=oe(()=>{try{const e=tr.platform==="darwin"?Si.constants.O_EVTONLY|Si.constants.O_NONBLOCK:Si.constants.O_NONBLOCK,{columns:t,rows:r}=e4.WriteStream(Si.openSync("/dev/tty",e));return{columns:t,rows:r}}catch{}},"devTty"),_c=oe(()=>{try{const e=lu("tput",["cols"],{env:{TERM:"dumb",...tr.env}}),t=lu("tput",["lines"],{env:{TERM:"dumb",...tr.env}});if(e&&t)return r$(e,t)}catch{}},"tput"),H4=oe(()=>{try{if(!F4())return;const e=lu("resize",["-u"]).match(/\d+/g);if(e.length===2)return r$(e[0],e[1])}catch{}},"resize"),Wr=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"),q4=oe(e=>({join:e.bodyJoin,left:e.bodyLeft,right:e.bodyRight}),"getVerticalBorderChars"),xs=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"),cu=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"),z4=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=cu(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=xs(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=xs(t,u,f),m=n(p,d).length-1,g=cu(e,l,u,p),{firstRow:y,lastRow:E}=g;let j=0,R=0;for(let w=y;w<=E&&w<s.length;w+=1)j+=s[w]??1,a[w]||(R+=1);const b=m-j;if(b>0)if(R>0){const w=Math.ceil(b/R);let h=0;for(let A=y;A<=E&&A<s.length;A+=1)if(!a[A]){const _=Math.min(w,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"),Fr=oe((e,t,r,n)=>{let i=t;for(;i>0&&e[i-1]?.[r]===n;)i-=1;return i},"findFirstOccurrenceRow"),uu="__EMPTY__",Zm=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:uu};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=uu;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"),G4=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"),pi=/\r?\n/,eh=/\s+/,Ae=oe((e,t)=>!e||!t?e:typeof t=="function"?t(e):t.open+e+t.close,"applyColor");class cl{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}=n$();i=o}this.#t=i,this.#e.maxWidth&&(this.#e.maxWidth=Math.min(this.#e.maxWidth,this.#t))}addItem(t){return this.#i.push(Zm(t)),this}addItems(t){return this.#i.push(...t.map(r=>Zm(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=cl.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===uu&&!(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(eh);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(eh);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 E=0;E<p.length&&d>0;E+=1)p[E]=(p[E]??0)+1,d-=1;const m=[];let g=0;for(let E=0;E<this.#e.columns;E+=1){const j=p[E]??0,R=n[E]??0,b=Math.max(j,R);m.push(b),g+=b}if(g>l){const E=l/g,j=m.map(w=>Math.max(3,Math.floor(w*E))),R=j.reduce((w,h)=>w+h,0);let b=l-R;for(let w=0;w<j.length&&b>0;w+=1)j[w]=(j[w]??0)+1,b-=1;return j}let y=l-g;if(y>0){const E=i.length>0?i:m.map((j,R)=>R);for(;y>0&&E.length>0;)for(const j of E){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||Fr(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(pi),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||Fr(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(pi),f=this.#e.wordWrap&&l.wordWrap!==!1;let d=0;for(const E of p)d=Math.max(d,Math.min(Be(E),u));d=this.computeWrappedContentWidth(d,p,u,f);const m=(c-1)*o,g=d+i+m;let y=0;for(let E=a;E<a+c;E+=1)y+=r[E]??0;if(g>y){const E=g-y,j=Math.ceil(E/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||Fr(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(pi);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||Fr(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(pi),p=this.#e.wordWrap&&a.wordWrap!==!1;let f=0;for(const E of u)f=Math.max(f,Math.min(Be(E),c));f=this.computeWrappedContentWidth(f,u,c,p);let d=0;for(let E=s;E<s+l;E+=1)d+=r[E]??0;const m=l>1?(l-1)*i:0,g=f+n+m,y=d+m;if(g>y){const E=g-y,j=Math.floor(E/l);let R=0;for(let b=0;b<l&&s+b<this.#e.columns;b+=1){const w=Math.min(j,E-R);if(r[s+b]=(r[s+b]??0)+w,R+=w,R>=E)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?q4(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,E;if(g){const j=g.colSpan??1;y=j;const R=Fr(t,r,m,g),b=xs(i,m,j),w=this.alignCellContent(g,b),h=w.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(E=" ".repeat(Math.max(0,b)),q){let X=!1;B==="middle"&&O%2===0&&J===0&&(X=!0),X||(E=w[J]??E)}g.colSpan&&g.colSpan>1&&(E+=d.repeat(g.colSpan)),g.foregroundColor?E=Ae(E,g.foregroundColor):this.#e.foregroundColor&&(E=Ae(E,this.#e.foregroundColor)),g.backgroundColor?E=Ae(E,g.backgroundColor):this.#e.backgroundColor&&(E=Ae(E,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);E=Ae(Ae(n===0?b:" ".repeat(b.length),this.#e.foregroundColor),this.#e.backgroundColor)}l.push(E),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(`
183
+ `)||c.includes("\r")?c.split(pi):[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=W4(c,{...f,width:a}).split(`
184
+ `)}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=>Vm(d,a,f))}else this.#e.truncateOverflow&&(l=l.map(p=>Be(p)>a?Vm(p,a,{}):p));const u=l.map(p=>G4(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=Wr(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 E=t[n]?.[0]??void 0,j=t[s]?.[0]??void 0;E&&j&&E===j&&(f=p);const R=this.#e.columns-1,b=t[n]?.[R]??void 0,w=t[s]?.[R]??void 0;b&&w&&b===w&&(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 E=0;E<this.#e.columns;E+=1){const j=t[n]?.[E]??void 0,R=o==="middle"&&s!==-1?t[s]?.[E]??void 0:void 0;let b,w=!1;if(j&&(E===0||t[n]?.[E-1]!==j)&&(b=j,w=!0),j&&!w)continue;if(!j){const _=i[E]??0;if(y=u>0?c.repeat(_):" ".repeat(_),m.push(Ae(Ae(y,this.#e.borderColor),this.#e.backgroundColor)),E<this.#e.columns-1){const O=this.determineJoinChar(o,t,n,s,E,E+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,E,b),C=k-O+1,B=C%2===0,J=O+Math.ceil(C/2)-1,q=xs(i,E,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(E,E+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=E;O<E+h;O+=1){const k=i[O]??0,C=u>0?c:" ";if(_.push(C.repeat(k+this.#e.gap)),O<E+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=E+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))}E+=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 w=Wr(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===_?w.body:w.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 E;const j=Wr(a,"middle");d&&m?E=g?{char:" ",width:l.width}:l:d?E=a.joinLeft:m?E=a.joinRight:g&&y?E=j.body:g?E=a.topJoin:y?E=a.bottomJoin:E=a.joinJoin;const{char:R,width:b}=E;return{char:R,width:b>0?b:this.#e.gap}}renderGrid(t,r){if(t.length===0)return"";const n=[],i=z4(t,r,this.#e,this.alignCellContent.bind(this),Fr),o=this.#e.showBorders&&this.#e.border?Wr(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?Wr(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?Wr(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(`
185
+ `)}getCachedCellVerticalPosition(t,r,n,i){const o=this.#r.get(i);if(o)return o;const s=cu(t,r,n,i);return this.#r.set(i,s),s}}oe(e=>new cl(e),"createGrid");const U4={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}},K4={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 J4=Object.defineProperty,rf=v((e,t)=>J4(e,"name",{value:t,configurable:!0}),"y$1");const V4=rf(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 X4=class{static{v(this,"v")}static{rf(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:U4,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,V4(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:E,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 cl(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,E=this.#e.showFooter&&p>=m+g,j=y&&d.length===1&&i>1,R=E&&d.length===1&&i>1;for(const b of d){let w=b,h={};if(typeof w=="object"&&w!==null&&!Array.isArray(w)){const{content:k,href:C,...B}=w;w=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 w=="string"?w.replaceAll(" "," ".repeat(this.#e.transformTabToSpace)):w,{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 Y4=rf(e=>new X4(e),"createTable");var Q4=Object.defineProperty,kt=v((e,t)=>Q4(e,"name",{value:t,configurable:!0}),"c$a");const Z4=kt(e=>e.logger,"getLogger"),eM=/\{\s*"name"/,tM=Ux(zx.exec);let i$=class extends Error{static{v(this,"D")}static{kt(this,"AttwReportedError")}};function o$(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(o$,"te$1");kt(o$,"memo");const rM={bundler:"bundler",node10:"node10","node16-cjs":"node16 (from CJS)","node16-esm":"node16 (from ESM)"},nM={"":"",1:"(CJS)",99:"(ESM)"},th={CJSOnlyExportsDefault:Ko,CJSResolvesToESM:mi,FallbackCondition:mi,FalseCJS:qr,FalseESM:qr,FalseExportDefault:Ko,InternalResolutionError:qr,MissingExportEquals:Ko,NamedExports:mi,NoResolution:qr,UnexpectedModuleSyntax:qr,UntypedResolution:mi},iM={esmOnly:["node10","node16-cjs"],node16:["node10"],strict:[]},oM=kt(e=>{if(e.startsWith("{"))return e;const t=eM.exec(e)?.index;if(t!==void 0)return e.slice(t);const r=e.indexOf("{");return r!==-1?e.slice(r):e},"fixPnpmStdout"),sM=kt(e=>{const t=e.split(`
186
+ `);let r="[";for(const n of t)n&&(r+=`${n},`);return r.at(-1)===","&&(r=r.slice(0,-1)),r+="]",r},"fixYarnStdout"),aM=kt(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"),lM=kt((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,w)=>{const h=e.problems.some(A=>a(A,b,e))?"redBright":"greenBright";return ut[h](m[w])}),y=o$((b,w)=>{const h=t.includes(w)?"(ignored) ":"",A=s(i(e.problems,e,{entrypoint:b,resolutionKind:w})),_=e.entrypoints[b].resolutions[w],{resolution:O}=_,k=Object.keys(A);if(k.length>0)return k.map(q=>h+th[q](c[q].shortDescription)).join(`
187
+ `);const C="OK (JSON)",B=e.programInfo[o(w)].moduleKinds?.[O?.fileName??""]?.detectedKind??"",J=_.isWildcard?"(wildcard)":`OK ${nM[B]}`;return h+(O?.isJson?C:J)}),E=Y4({style:{border:K4}});E.setHeaders(["",...f.map(b=>rM[b])]),g.forEach((b,w)=>{const[h,A,_,O]=f.map(k=>d.map(C=>y(C,k)));E.addRow([b,h[w]??null,A[w]??null,_[w]??null,O[w]??null])});const j=s(e.problems),R=Object.entries(j).map(([b,w])=>{const h=c[b],A=w.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) "}${th[b](_)}`});return`Are the types wrong problems found:
188
+
189
+ ${E.toString()}
190
+
191
+ ${R.join(`
192
+
193
+ `)}`},"buildProblemMessage"),cM=kt(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 tM(`${e} pack --json ${n}${i}`,{cwd:r,encoding:"utf8"})).stdout.trim();e==="pnpm"?o=oM(o):e==="yarn"&&(o=sM(o));const s=JSON.parse(o);if(!s?.filename)throw new Error(`Invalid npm pack output format: ${o}`);return s.filename},"packPackage"),uM=kt((e,t,r,n,i,o)=>{if(t.types!==!1&&t.problems.length>0){const s=lM(t,r,o);if(n==="error")throw e.error({message:s,prefix:"attw"}),new i$("attw reported types problems; see the log above.");e.warn({message:s,prefix:"attw"});return}e.success({message:xh(`No Are the types wrong problems found ${wh`(${Math.round(performance.now()-i).toString()}ms)`}`),prefix:"attw"})},"reportAnalysis"),pM=kt(async(e,t)=>{if(!e.options?.validation)return;const{validation:r}=e.options;if(!r.attw)return;const n=Z4(e),{packageJson:i}=sl(e.options.rootDir);e.pkg=i,t&&n.raw(`
194
+ `),await LR(e.pkg,["@arethetypeswrong/core","package-manager-detector"],"devDependencies",{logger:{warn:kt(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 Wh(le(Kh(),"packem-attw-"));let p;try{p=await import("@arethetypeswrong/core")}catch{n.error({message:`ATTW check requires ${Ko`@arethetypeswrong/core`} to be installed.`,prefix:"attw"});return}const f=await aM(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:E,problemAffectsResolutionKind:j,problemKindInfo:R}=await import("@arethetypeswrong/core/problems");try{const b=await cM(f,u,e.options.rootDir),w=await ss(b),h=p.createPackageFromTarballData(new Uint8Array(w)),A=await p.checkPackage(h,l),_=iM[a];uM(n,A,_,o,c,{allResolutionKinds:d,filterProblems:y,getResolutionOption:m,groupProblemsByKind:g,problemAffectsEntrypoint:E,problemAffectsResolutionKind:j,problemKindInfo:R})}catch(b){throw b instanceof i$||n.error({message:`ATTW check failed: ${b instanceof Error?b.message:String(b)}`,prefix:"attw"}),b}finally{await js(u,{force:!0,recursive:!0}).catch(()=>{})}},"attw");var fM=Object.defineProperty,s$=v((e,t)=>fM(e,"name",{value:t,configurable:!0}),"d$5");const rh=s$(e=>Array.from(e,t=>mi(t)).join(", "),"joinWarnings"),dM=s$(e=>{if(e.hoistedDependencies.size>0){const o=`These dependencies are shamefully hoisted: ${rh(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: ${rh(t)}`;be(e,o)}},"validateDependencies");var mM=Object.defineProperty,hM=v((e,t)=>mM(e,"name",{value:t,configurable:!0}),"o$1");const nh=">=18.0.0",gM=hM(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": "${nh}" } to specify Node.js version requirements.`);return}if(!Nt.validRange(i)){be(e,`Invalid Node.js version range "${i}" in engines.node field. Please use a valid semver range like "${nh}".`);return}if(!Nt.satisfies(n,i))throw new Error(`Node.js version mismatch: Current version ${n} does not satisfy the required range "${i}" specified in package.json engines.node field.`)},"validateEngines");var vM=Object.defineProperty,a$=v((e,t)=>vM(e,"name",{value:t,configurable:!0}),"i$2");const bM=a$((e,t)=>Jx(e,t)<=e.length/3||t.includes(e),"isSimilar"),yM=a$((e,t)=>{const r=e.toLowerCase();return t.filter(n=>bM(n.toLowerCase(),r))},"findAlternatives");var $M=Object.defineProperty,Fi=v((e,t)=>$M(e,"name",{value:t,configurable:!0}),"r$2");const xM=/\/[^*/]*\*[^\n\r/\u2028\u2029]*(?:[\n\r\u2028\u2029][^*/]*\*[^\n\r/\u2028\u2029]*)*(?:\/.*)?$/,wM=Fi((e,t)=>{const{options:r}=e;return fp(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"),EM=Fi((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"),SM=Fi((e,t)=>{let r="Potential missing or wrong package.json files:";for(const n of e){const i=yM(n,t);r+=`
195
+ - ${Ce(n)}${i.length>0?k$` (did you mean ${i.map(o=>`"${o}"`).join(", ")}?)`:""}`}return r},"buildMissingOutputsMessage"),kM=Fi(e=>{const{options:t}=e,r=t.validation,{packageJson:n}=r;if(!n?.exports)return;const i=EM(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,...wM(e,o)].filter(Boolean).map(u=>u&&ve(t.rootDir,u.replace(xM,"")))),a=[];for(const u of s)u&&!u.includes("*")&&!zh(u)&&a.push(u.replace(`${t.rootDir}/`,""));const l=Fi(u=>et(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=SM(a,c);be(e,u)}},"validatePackageEntries");var jM=Object.defineProperty,ct=v((e,t)=>jM(e,"name",{value:t,configurable:!0}),"u$1");const AM=ct((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=ct((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=[...ix,...m];if(zc(f)){try{const y=f.startsWith("./")?ve(e.options.rootDir,f.slice(2)):ve(e.options.rootDir,f),E=jg([y],{cwd:e.options.rootDir,dot:!1,ignore:["**/node_modules/**","**/.git/**","**/dist/**"]});if(E.length===0)return;const j=E.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(E=>!a.has(E));if(g.length>0){const E=o.length>0,j=[...n].join(", ");E?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(E=>n.has(E));if(y.length>1){const E=["node-addons","node","import","require","module-sync","default"],j=y,R=E.filter(b=>j.includes(b));JSON.stringify(j)!==JSON.stringify(R)&&be(e,`Incorrect condition order at ${d}. Standard conditions should be ordered: ${R.join(" > ")}`)}m.includes("import")&&m.includes("require"),m.includes("development")&&m.includes("production")&&be(e,`Conflicting conditions "development" and "production" at ${d}. These conditions are mutually exclusive`),m.forEach(E=>{l(f[E],`${d}.${E}`)});return}be(e,`Invalid exports value type at ${d}. Expected string, array, object, or null`)}},"validateExportsValue"),c=ct((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=ct((f,d,m)=>{const g=f.filter(E=>E!=="."),y=e.pkg.bin!==void 0&&g.length<=1&&g.every(E=>E==="./package.json");!d.includes(".")&&!y&&be(e,'Missing main export ".". Subpaths exports should include a main export entry');for(const E of d)c(E,m)},"validateSubpaths"),p=ct(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");ct(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"),OM=ct(({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"),RM=ct(({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"),_M=ct(({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"),PM=ct(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&&_M(e)},"validateEsmModuleFields"),CM=ct(({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"),TM=ct(({cjsJSExtension:e,context:t,pkg:r,validation:n})=>{if(!t.options.declaration)return;let i=!0;r.type==="module"&&(i=!!r.main?.endsWith(`.${e}`)),r.types===void 0&&r.typings===void 0&&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."),(t.options.declaration===!0||t.options.declaration==="compatible")&&i&&n.packageJson?.typesVersions!==!1&&(()=>{const o=r.typesVersions;return o===void 0||Object.keys(o).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"),NM=ct(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};OM(o);const s=r.type==="commonjs"||r.type===void 0,a=r.type==="module";s?RM(o):a&&PM(o),r.exports!==void 0&&AM(e,r.exports),CM(o,s),TM(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 IM=Object.defineProperty,MM=v((e,t)=>IM(e,"name",{value:t,configurable:!0}),"o");const DM=MM(e=>{const{packageJson:t}=sl(e.options.rootDir);e.pkg=t,dM(e),gM(e),NM(e),kM(e)},"validator");var BM=Object.defineProperty,l$=v((e,t)=>BM(e,"name",{value:t,configurable:!0}),"n$3");const LM=/^[^a-z_@#~]|[^\w/@#~-]|@\/|#\/|~\//i,WM=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"]),FM=l$((e,t)=>{if(e.trim()==="")throw new Error(`Alias name "${e}" is invalid. Alias names should be non-empty strings.`);if(LM.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(WM.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"),ih=l$(e=>{if(Array.isArray(e))return;const t=e;for(const[r,n]of Object.entries(t))FM(r,n)},"validateAliasEntries");var Pc={},Cc,oh;function ul(){if(oh)return Cc;oh=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 Cc={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}},Cc}v(ul,"requireConstants");var sh;function pl(){return sh||(sh=1,(function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:r,REGEX_SPECIAL_CHARS:n,REGEX_SPECIAL_CHARS_GLOBAL:i}=ul();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}})(Pc)),Pc}v(pl,"requireUtils");var Tc,ah;function HM(){if(ah)return Tc;ah=1;var e=Object.defineProperty,t=v((w,h)=>e(w,"name",{value:h,configurable:!0}),"k");const r=pl(),{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:E}=ul(),j=t(w=>w===c||w===o,"isPathSeparator"),R=t(w=>{w.isPrefix!==!0&&(w.depth=w.isGlobstar?1/0:1)},"depth");return Tc=t((w,h)=>{const A=h||{},_=w.length-1,O=A.parts===!0||A.scanToEnd===!0,k=[],C=[],B=[];let J=w,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===E){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 x=J,S="",we="";X>0&&(S=J.slice(0,X),J=J.slice(X),te-=X),x&&M===!0&&te>0?(x=J.slice(0,te),we=J.slice(te)):M===!0?(x="",we=J):x=J,x&&x!==""&&x!=="/"&&x!==J&&j(x.charCodeAt(x.length-1))&&(x=x.slice(0,-1)),A.unescape===!0&&(we&&(we=r.removeBackslashes(we)),x&&W===!0&&(x=r.removeBackslashes(x)));const Q={prefix:S,input:w,start:X,base:x,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,Pe=k[ye],Bt=w.slice($e,Pe);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=Pe}if(ie&&ie+1<w.length){const ye=w.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"),Tc}v(HM,"requireScan");var Nc,lh;function qM(){if(lh)return Nc;lh=1;var e=Object.defineProperty,t=v((b,w)=>e(b,"name",{value:w,configurable:!0}),"y");const r=ul(),n=pl(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:o,REGEX_NON_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_BACKREF:a,REPLACEMENTS:l}=r,c=t((b,w)=>typeof w.expandRange=="function"?w.expandRange(...b,w):(b.sort(),`[${b.join("-")}]`),"expandRange"),u=t((b,w)=>`Missing ${b}: "${w}" - use "\\\\${w}" to match literal characters`,"syntaxError"),p=t(b=>{const w=[];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){w.push(O),O="";continue}}}O+=C}return w.push(O),w},"splitTopLevel"),f=t(b=>{let w=!1;for(const h of b){if(w===!0){w=!1;continue}if(h==="\\"){w=!0;continue}if(/[?*+@!()[\]{}]/.test(h))return!1}return!0},"isPlainBranch"),d=t(b=>{let w=b.trim(),h=!0;for(;h===!0;)h=!1,/^@\([^\\()[\]{}|]+\)$/.test(w)&&(w=w.slice(2,-1),h=!0);if(f(w))return w.replace(/\\(.)/g,"$1")},"normalizeSimpleBranch"),m=t(b=>{const w=b.map(d).filter(Boolean);for(let h=0;h<w.length;h++)for(let A=h+1;A<w.length;A++){const _=w[h],O=w[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,w=!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 w===!0&&k!==b.length-1?void 0:{type:b[0],body:b.slice(2,k),end:k}}}}},"parseRepeatedExtglob"),y=t(b=>{let w=0;const h=[];for(;w<b.length;){const A=g(b.slice(w),!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),w+=A.end+1}return h.length<1?void 0:`${h.length===1?n.escapeRegex(h[0]):`[${h.map(A=>n.escapeRegex(A)).join("")}]`}*`},"getStarExtglobSequenceOutput"),E=t(b=>{let w=0,h=b.trim(),A=g(h);for(;A;)w++,h=A.body.trim(),A=g(h);return w},"repeatedExtglobRecursion"),j=t((b,w)=>{if(w.maxExtglobRecursion===!1)return{risky:!1};const h=typeof w.maxExtglobRecursion=="number"?w.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(E(_)>h)return{risky:!0}}return{risky:!1}},"analyzeRepeatedExtglob"),R=t((b,w)=>{if(typeof b!="string")throw new TypeError("Expected a string");b=l[b]||b;const h={...w},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 x=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"),Pe=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"),nt=t(T=>{$[T]++,se.push(T)},"increment"),_e=t(T=>{$[T]--,se.pop()},"decrement"),H=t(T=>{if(x.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,-x.output.length),x.type="star",x.value="*",x.output=D,$.output+=x.output)}if(ge.length&&T.type!=="paren"&&(ge[ge.length-1].inner+=T.value),(T.value||T.output)&&Pe(T),x&&x.type==="text"&&T.type==="text"){x.output=(x.output||x.value)+T.value,x.value+=T.value;return}T.prev=x,k.push(T),x=T},"push"),it=t((T,ee)=>{const P={...J[ee],conditions:1,inner:""};P.prev=x,P.parens=$.parens,P.output=$.output,P.startIndex=$.index,P.tokensIndex=k.length;const G=(h.capture?"(":"")+P.open;nt("parens"),H({type:T,value:ee,output:$.output?"":re}),H({type:"paren",extglob:!0,value:ie(),output:G}),ge.push(P)},"extglobOpen"),Fn=t(T=>{const ee=b.slice(T.startIndex,$.index+1),P=b.slice(T.startIndex+2,$.index),G=j(P,h);if((T.type==="plus"||T.type==="star")&&G.risky){const Z=G.safeOutput?(T.output?"":re)+(h.capture?`(${G.safeOutput})`:G.safeOutput):void 0,Se=k[T.tokensIndex];Se.type="text",Se.value=ee,Se.output=Z||n.escapeRegex(ee);for(let ke=T.tokensIndex+1;ke<k.length;ke++)k[ke].value="",k[ke].output="",delete k[ke].suffix;$.output=T.output+Se.output,$.backtrack=!0,H({type:"paren",extglob:!0,value:S,output:""}),_e("parens");return}let ne=T.close+(h.capture?")":""),ae;if(T.type==="negate"){let Z=D;if(T.inner&&T.inner.length>1&&T.inner.includes("/")&&(Z=z(h)),(Z!==D||we()||/^\)+$/.test(ye()))&&(ne=T.close=`)$))${Z}`),T.inner.includes("*")&&(ae=ye())&&/^\.[^\\/.]+$/.test(ae)){const Se=R(ae,{...w,fastpaths:!1}).output;ne=T.close=`)${Se})${Z})`}T.prev.type==="bos"&&($.negatedExtglob=!0)}H({type:"paren",extglob:!0,value:S,output:ne}),_e("parens")},"extglobClose");if(h.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(b)){let T=!1,ee=b.replace(a,(P,G,ne,ae,Z,Se)=>ae==="\\"?(T=!0,P):ae==="?"?G?G+ae+(Z?N.repeat(Z.length):""):Se===0?L+(Z?N.repeat(Z.length):""):N.repeat(ne.length):ae==="."?q.repeat(ne.length):ae==="*"?G?G+ae+(Z?D:""):D:G?P:`\\${P}`);return T===!0&&(h.unescape===!0?ee=ee.replace(/\\/g,""):ee=ee.replace(/\\+/g,P=>P.length%2===0?"\\\\":P?"\\":"")),ee===b&&h.contains===!0?($.output=b,$):($.output=n.wrapOutput(ee,$,w),$)}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!=="]"||x.value==="["||x.value==="[^")){if(h.posix!==!1&&S===":"){const P=x.value.slice(1);if(P.includes("[")&&(x.posix=!0,P.includes(":"))){const G=x.value.lastIndexOf("["),ne=x.value.slice(0,G),ae=x.value.slice(G+2),Z=o[ae];if(Z){x.value=ne+Z,$.backtrack=!0,ie(),!O.output&&k.indexOf(x)===1&&(O.output=re);continue}}}(S==="["&&Q()!==":"||S==="-"&&Q()==="]")&&(S=`\\${S}`),S==="]"&&(x.value==="["||x.value==="[^")&&(S=`\\${S}`),h.posix===!0&&S==="!"&&x.value==="["&&(S="^"),x.value+=S,Pe({value:S});continue}if($.quotes===1&&S!=='"'){S=n.escapeRegex(S),x.value+=S,Pe({value:S});continue}if(S==='"'){$.quotes=$.quotes===1?0:1,h.keepQuotes===!0&&H({type:"text",value:S});continue}if(S==="("){nt("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){Fn(ge.pop());continue}H({type:"paren",value:S,output:$.parens?")":"\\)"}),_e("parens");continue}if(S==="["){if(h.nobracket===!0||!ye().includes("]")){if(h.nobracket!==!0&&h.strictBrackets===!0)throw new SyntaxError(u("closing","]"));S=`\\${S}`}else nt("brackets");H({type:"bracket",value:S});continue}if(S==="]"){if(h.nobracket===!0||x&&x.type==="bracket"&&x.value.length===1){H({type:"text",value:S,output:`\\${S}`});continue}if($.brackets===0){if(h.strictBrackets===!0)throw new SyntaxError(u("opening","["));H({type:"text",value:S,output:`\\${S}`});continue}_e("brackets");const P=x.value.slice(1);if(x.posix!==!0&&P[0]==="^"&&!P.includes("/")&&(S=`/${S}`),x.value+=S,Pe({value:S}),h.literalBrackets===!1||n.hasRegexChars(P))continue;const G=n.escapeRegex(x.value);if($.output=$.output.slice(0,-x.value.length),h.literalBrackets===!0){$.output+=G,x.value=G;continue}x.value=`(${C}${G}|${x.value})`,$.output+=x.value;continue}if(S==="{"&&h.nobrace!==!0){nt("braces");const P={type:"brace",value:S,output:"(",outputIndex:$.output.length,tokensIndex:$.tokens.length};pe.push(P),H(P);continue}if(S==="}"){const P=pe[pe.length-1];if(h.nobrace===!0||!P){H({type:"text",value:S,output:S});continue}let G=")";if(P.dots===!0){const ne=k.slice(),ae=[];for(let Z=ne.length-1;Z>=0&&(k.pop(),ne[Z].type!=="brace");Z--)ne[Z].type!=="dots"&&ae.unshift(ne[Z].value);G=c(ae,h),$.backtrack=!0}if(P.comma!==!0&&P.dots!==!0){const ne=$.output.slice(0,P.outputIndex),ae=$.tokens.slice(P.tokensIndex);P.value=P.output="\\{",S=G="\\}",$.output=ne;for(const Z of ae)$.output+=Z.output||Z.value}H({type:"brace",value:S,output:G}),_e("braces"),pe.pop();continue}if(S==="|"){ge.length>0&&ge[ge.length-1].conditions++,H({type:"text",value:S});continue}if(S===","){let P=S;const G=pe[pe.length-1];G&&se[se.length-1]==="braces"&&(G.comma=!0,P="|"),H({type:"comma",value:S,output:P});continue}if(S==="/"){if(x.type==="dot"&&$.index===$.start+1){$.start=$.index+1,$.consumed="",$.output="",k.pop(),x=O;continue}H({type:"slash",value:S,output:te});continue}if(S==="."){if($.braces>0&&x.type==="dot"){x.value==="."&&(x.output=q);const P=pe[pe.length-1];x.type="dots",x.output+=S,x.value+=S,P.dots=!0;continue}if($.braces+$.parens===0&&x.type!=="bos"&&x.type!=="slash"){H({type:"text",value:S,output:q});continue}H({type:"dot",value:S,output:q});continue}if(S==="?"){if(!(x&&x.value==="(")&&h.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){it("qmark",S);continue}if(x&&x.type==="paren"){const P=Q();let G=S;(x.value==="("&&!/[!=<:]/.test(P)||P==="<"&&!/<([!=]|\w+>)/.test(ye()))&&(G=`\\${S}`),H({type:"text",value:S,output:G});continue}if(h.dot!==!0&&(x.type==="slash"||x.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)))){it("negate",S);continue}if(h.nonegate!==!0&&$.index===0){Bt();continue}}if(S==="+"){if(h.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){it("plus",S);continue}if(x&&x.value==="("||h.regex===!1){H({type:"plus",value:S,output:X});continue}if(x&&(x.type==="bracket"||x.type==="paren"||x.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(x&&(x.type==="globstar"||x.star===!0)){x.type="star",x.star=!0,x.value+=S,x.output=D,$.backtrack=!0,$.globstar=!0,$e(S);continue}let T=ye();if(h.noextglob!==!0&&/^\([^?]/.test(T)){it("star",S);continue}if(x.type==="star"){if(h.noglobstar===!0){$e(S);continue}const P=x.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()){x.type="globstar",x.value+=S,x.output=z(h),$.output=x.output,$.globstar=!0,$e(S);continue}if(P.type==="slash"&&P.prev.type!=="bos"&&!ae&&we()){$.output=$.output.slice(0,-(P.output+x.output).length),P.output=`(?:${P.output}`,x.type="globstar",x.output=z(h)+(h.strictSlashes?")":"|$)"),x.value+=S,$.globstar=!0,$.output+=P.output+x.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+x.output).length),P.output=`(?:${P.output}`,x.type="globstar",x.output=`${z(h)}${te}|${te}${ke})`,x.value+=S,$.output+=P.output+x.output,$.globstar=!0,$e(S+ie()),H({type:"slash",value:"/",output:""});continue}if(P.type==="bos"&&T[0]==="/"){x.type="globstar",x.value+=S,x.output=`(?:^|${te}|${z(h)}${te})`,$.output=x.output,$.globstar=!0,$e(S+ie()),H({type:"slash",value:"/",output:""});continue}$.output=$.output.slice(0,-x.output.length),x.type="globstar",x.output=z(h),x.value+=S,$.output+=x.output,$.globstar=!0,$e(S);continue}const ee={type:"star",value:S,output:D};if(h.bash===!0){ee.output=".*?",(x.type==="bos"||x.type==="slash")&&(ee.output=Y+ee.output),H(ee);continue}if(x&&(x.type==="bracket"||x.type==="paren")&&h.regex===!0){ee.output=S,H(ee);continue}($.index===$.start||x.type==="slash"||x.type==="dot")&&(x.type==="dot"?($.output+=K,x.output+=K):h.dot===!0?($.output+=F,x.output+=F):($.output+=Y,x.output+=Y),Q()!=="*"&&($.output+=re,x.output+=re)),H(ee)}for(;$.brackets>0;){if(h.strictBrackets===!0)throw new SyntaxError(u("closing","]"));$.output=n.escapeLast($.output,"["),_e("brackets")}for(;$.parens>0;){if(h.strictBrackets===!0)throw new SyntaxError(u("closing",")"));$.output=n.escapeLast($.output,"("),_e("parens")}for(;$.braces>0;){if(h.strictBrackets===!0)throw new SyntaxError(u("closing","}"));$.output=n.escapeLast($.output,"{"),_e("braces")}if(h.strictSlashes!==!0&&(x.type==="star"||x.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,w)=>{const h={...w},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},Nc=R,Nc}v(qM,"requireParse");var Ic,ch;function zM(){if(ch)return Ic;ch=1;var e=Object.defineProperty,t=v((l,c)=>e(l,"name",{value:c,configurable:!0}),"h");const r=HM(),n=qM(),i=pl(),o=ul(),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 w=b(R);if(w)return w}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 E=t((j,R=!1)=>{const{isMatch:b,match:w,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:w,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&&(E.state=g),E},"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,Ic=a,Ic}v(zM,"requirePicomatch$1");var Mc,uh;function GM(){if(uh)return Mc;uh=1;var e=Object.defineProperty,t=v((o,s)=>e(o,"name",{value:s,configurable:!0}),"c");const r=zM(),n=pl();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),Mc=i,Mc}v(GM,"requirePicomatch");var UM=GM();const KM=Ss(UM);var JM=Object.defineProperty,Ln=v((e,t)=>JM(e,"name",{value:t,configurable:!0}),"m$2");const VM=Ln(e=>e.logger,"getLogger"),pu="Validation: File Size",c$=Ln(e=>typeof e=="string"?gP(e):e,"resolveLimit"),u$=Ln((e,t,r,n,i)=>{if(r){i&&e.raw(`
196
+ `),e.warn({message:t,prefix:"validation:file-size"});return}be(n,t)},"emitMessage"),XM=Ln((e,t,r,n,i)=>{for(const[o,s]of Object.entries(r)){const a=c$(s);if(!Number.isFinite(a)||a<=0){t.debug({message:`Invalid limit for ${o}: ${String(s)}`,prefix:pu});continue}const l=e.buildEntries.find(c=>{const u=o.replace(new RegExp(`^.?/?${e.options.outDir}/?`),"");return c.path.endsWith(u)||KM(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:pu});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})})`;u$(t,c,n,e,i)}}},"checkPerFileLimits"),YM=Ln((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=c$(r);if(!Number.isFinite(s)||s<=0){t.debug({message:`Invalid total limit: ${String(r)}`,prefix:pu});return}if(o>s){const a=`Total file size exceeds the limit: ${Qe(o)} / ${Qe(s,{decimals:2})}`;u$(t,a,n,e,i)}},"checkTotalLimit"),QM=Ln((e,t)=>{const r=e.options.validation,{allowFail:n=!1,limit:i,limits:o={}}=r.bundleLimit??{},s=VM(e);XM(e,s,o,n,t),i&&YM(e,s,i,n,t&&Object.keys(o).length===0)},"validateBundleSize");var ZM=Object.defineProperty,Oi=v((e,t)=>ZM(e,"name",{value:t,configurable:!0}),"r$1");const ph="rollup-dts.json",eD=Oi(e=>e.logger,"getLogger"),fh="__packem_skip__/",dh=Oi((e,t)=>{const r=new Set;if(t.options.emitCJS&&r.add(Ct(t,"cjs")),t.options.emitESM&&r.add(Ct(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"),tD=Oi(async(e,t,r)=>{const n=await _y(e,t);if(await e.hooks.callHook("rollup:dts:options",e,n),Object.keys(n.input??{}).length===0)return;n.cache=t.get(ph,r);const i=await(await Kp())(n);try{t.set(ph,i.cache,r),await e.hooks.callHook("rollup:dts:build",e,i),eD(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 dh(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(fh)&&delete u[p]},name:"packem:filter-skip-chunks"};for(const c of s)await i.write({chunkFileNames:Oi(u=>ji(u,c),"chunkFileNames"),dir:a,entryFileNames:Oi(u=>{const p=u.name.endsWith(".d")?u.name.slice(0,-2):u.name,f=p?o.get(p):void 0;return f&&!dh(f,e).has(c)?`${fh}[name].${c}`:`[name].${c}`},"entryFileNames"),plugins:[l]});await e.hooks.callHook("rollup:dts:done",e)}finally{await i.close(),await t.flush()}},"buildTypes");var rD=wo();const p$=Ss(rD);var nD=Object.defineProperty,fu=v((e,t)=>nD(e,"name",{value:t,configurable:!0}),"n$2");const iD=Kx("packem:exe"),oD=/(?:^|,)packem:exe(?:,|$)/,sD=fu(()=>{const e=process.env.NODE_DEBUG;return e?oD.test(e):!1},"isEnabled"),f$=fu(()=>{const e=fu(((t,...r)=>{iD(t,...r)}),"debug");return Object.defineProperty(e,"enabled",{get:sD}),e},"createDebug");var aD=Object.defineProperty,d$=v((e,t)=>aD(e,"name",{value:t,configurable:!0}),"c$5");const lD=d$(()=>{const e=Gx();if(fn==="darwin")return le(e,"Library/Caches/packem");if(fn==="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"),cD=d$(e=>{const t=lD(),r=e.platform==="win"?"node.exe":"node";return le(t,"node",`v${e.nodeVersion}`,`${e.platform}-${e.arch}`,r)},"getCachedBinaryPath");var uD=_h();const pD=Ss(uD);var fD=Object.defineProperty,Oo=v((e,t)=>fD(e,"name",{value:t,configurable:!0}),"s$1");const m$=Oo(e=>e==="win"?"zip":e==="linux"?"tar.xz":"tar.gz","getArchiveExtension"),dD=Oo(e=>{const{arch:t,nodeVersion:r,platform:n}=e,i=m$(n);return`https://nodejs.org/dist/v${r}/node-v${r}-${n}-${t}.${i}`},"getDownloadUrl"),mD=Oo(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"),mh="https://nodejs.org/dist/index.json",hD=/^v/,gD=Oo(async e=>{let t=e;if(t==="latest"||t==="latest-lts"){const n=await fetch(mh);if(!n.ok)throw new Error(`Failed to fetch Node.js releases: HTTP ${String(n.status)} from ${mh}`);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(hD,"")}const r=pD(t);if(!r)throw new Error(`Invalid Node.js version: ${t}. Please provide a valid version string (e.g., "25.7.0").`);if(!p$(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"),vD=Oo(e=>`-${e.platform}-${e.arch}`,"getTargetSuffix");var bD=Object.defineProperty,h$=v((e,t)=>bD(e,"name",{value:t,configurable:!0}),"d$1");const fr=f$(),yD=h$(async(e,t,r)=>{const n=mD(r),i=Te(t);if(fr("Extracting %s from archive to %s",n,i),r.platform==="win")await os("tar",["-xf",e,"-C",i,"--strip-components=1",n],{nodeOptions:{stdio:"inherit"},throwOnError:!0});else{const a=e.endsWith(".tar.xz")?"J":"z";await os("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 yx(s,t)},"extractBinary"),$D=h$(async(e,t)=>{fr("Resolving Node.js binary for target: %O",e);const r={...e,nodeVersion:await gD(e.nodeVersion)},n=cD(r);if(fr("Cache path: %s",n),await Ze(n))return fr("Cache hit: %s",n),t.info(`Using cached Node.js ${r.nodeVersion} for ${r.platform}-${r.arch}`),n;const i=dD(r);fr("Cache miss, downloading from: %s",i),t.info(`Downloading Node.js ${r.nodeVersion} for ${r.platform}-${r.arch}...`),t.info(` ${i}`),await Fh(Te(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=m$(r.platform),a=`${n}.download.${s}`,l=Qx.from(await o.arrayBuffer());fr("Downloaded %d bytes, writing to: %s",l.length,a),await Hh(a,l);try{await yD(a,n,r),r.platform!=="win"&&await Lh(n,493),fr("Binary cached at: %s",n),t.info(`Cached Node.js binary at: ${n}`)}finally{await js(a,{force:!0})}return n},"resolveNodeBinary");var xD=Object.defineProperty,Wn=v((e,t)=>xD(e,"name",{value:t,configurable:!0}),"l");const Xr=f$(),wD=/\.d\.[mc]?ts$/,ED=Wn(e=>({buildEntries:e.buildEntries,logger:e.logger,options:e.options,packageType:e.pkg.type}),"toExeBuildInput"),SD=Wn(e=>{const{logger:t,options:r}=e;if(ns.bun||ns.deno)throw new Error("The `exe` option is not supported in Bun and Deno environments.");if(!p$(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(`
197
+ `);throw new Error(`The \`exe\` feature only supports a single entry point. Found ${String(r.entries.length)} entries:
198
+ ${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"),kD=Wn((e,t)=>e.endsWith(".cjs")?"commonjs":e.endsWith(".mjs")||t==="module"?"module":"commonjs","pickMainFormat"),hh=fn==="win32"?"win":fn,gh=Wn((e,t,r,n,i)=>{let o;return e.fileName?o=typeof e.fileName=="function"?e.fileName(t):e.fileName:o=$t(r,mn(r)),i&&(o+=i),n==="win"&&(o+=".exe"),o},"resolveOutputFileName"),vh=Wn(async(e,t,r,n,i,o,s)=>{const{logger:a,options:l,packageType:c}=e,u=ve(l.rootDir,t.outDir??"build");await Fh(u,{recursive:!0});const p=le(u,i);Xr("Building SEA executable: %s -> %s",n,p);const f=performance.now(),d=await Wh(le(Kh(),"packem-sea-"));try{const g={disableExperimentalSEAWarning:!0,...t.seaConfig,main:n,mainFormat:kD(r.path,c),output:p};s&&(g.executable=s);const y=le(d,"sea-config.json");await Hh(y,JSON.stringify(g)),Xr("Wrote sea-config.json: %O -> %s",g,y),Xr("Running: %s --build-sea %s",process.execPath,y),await os(process.execPath,["--build-sea",y],{nodeOptions:{stdio:["ignore","ignore","inherit"]},throwOnError:!0})}finally{Xr.enabled?Xr("Preserving temp directory for debugging: %s",d):await js(d,{force:!0,recursive:!0})}if(o==="darwin")try{await os("codesign",["--sign","-",p],{nodeOptions:{stdio:"inherit"},throwOnError:!0})}catch{const g=fn==="darwin"?`You can sign it manually using:
199
+ codesign --sign - "${p}"`:`Automatic code signing is not supported on ${fn}.`;a.warn(`Failed to code-sign the executable. ${g}`)}if(await Ze(p)){const g=await zi(p),y=Qe(g.size,{decimals:2});a.info(`${ut(et(l.rootDir,p))} ${wh(y)}`)}const m=Math.round(performance.now()-f);a.success(`Built executable: ${qr(et(l.rootDir,p))} ${_t(`(${String(m)}ms)`)}`)},"buildSingleExe"),jD=Wn(async e=>{const t=ED(e),{buildEntries:r,logger:n,options:i}=t,o=i.exe;if(!o)return;const s=typeof o=="object"?o:{};SD(t);const a=r.filter(p=>p.type==="entry"&&!wD.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(`
200
+ `);throw new Error(`The \`exe\` feature only supports single-chunk outputs. Found ${String(a.length)} chunks:
201
+ ${p}`)}const l=a[0],c=le(i.rootDir,i.outDir,l.path);Xr("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 $D(p,n),d=vD(p),m=gh(s,l,c,p.platform,d);await vh(t,s,l,c,m,p.platform,f)}}else{const p=gh(s,l,c,hh);await vh(t,s,l,c,p,hh)}},"buildExe");var AD=Object.defineProperty,bh=v((e,t)=>AD(e,"name",{value:t,configurable:!0}),"t");const OD=bh(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=bh(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 RD=Object.defineProperty,_D=v((e,t)=>RD(e,"name",{value:t,configurable:!0}),"a");const PD=_D(async e=>await new Promise((t,r)=>{let n=0;const i=bu(e).pipe(Vx({params:{[Xx.BROTLI_PARAM_QUALITY]:4}}));i.on("error",r),i.on("data",o=>{n+=o.length}),i.on("end",()=>{t(n)})}),"brotliSize");var CD=Object.defineProperty,nf=v((e,t)=>CD(e,"name",{value:t,configurable:!0}),"d");const fi=nf(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"),di=nf((e,t,r)=>{let n=e.get(t);return n===void 0&&(n=r(),e.set(t,n)),n},"getOrCreate"),TD=nf((e,t,r,n)=>{if(n!==void 0){const s=new Map;for(const l of e){const c=di(s,fi(l[t]),()=>new Map),u=di(c,fi(l[r]),()=>new Map);di(u,fi(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=di(i,fi(s[t]),()=>new Map);di(a,fi(s[r]),()=>[]).push(s)}const o={};for(const[s,a]of i)o[s]=Object.fromEntries(a);return o},"groupByKeys");var ND=Object.defineProperty,ID=v((e,t)=>ND(e,"name",{value:t,configurable:!0}),"i");const MD=ID(async e=>await new Promise((t,r)=>{let n=0;const i=bu(e).pipe(Yx({level:9}));i.on("error",r),i.on("data",o=>{n+=o.length}),i.on("end",()=>{t(n)})}),"gzipSize");var DD=Object.defineProperty,pt=v((e,t)=>DD(e,"name",{value:t,configurable:!0}),"c$1");const BD=2,LD=/\.js$/,WD=/\.d\.[m|c]ts$/,FD=pt((e,t,r)=>[`total size: ${Ce(Qe(t,{decimals:2}))}`,e.size?.brotli&&`brotli size: ${Ce(Qe(e.size.brotli,{decimals:2}))}`,e.size?.gzip&&`gzip size: ${Ce(Qe(e.size.gzip,{decimals:2}))}`,r!==0&&`chunk size: ${Ce(Qe(r,{decimals:2}))}`].filter(Boolean).join(", "),"buildSizeSummary"),HD=pt((e,t,r,n)=>{const i=gt(t,"cjs"),o=gt(t,"esm"),s=Ct(t,"cjs"),a=Ct(t,"esm");let l=e.path.replace(LD,".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(WD,".d.ts"),p=t.buildEntries.find(f=>f.path.endsWith(l))),p?(n.push(p.path),c==="commonjs"?`
202
+ types:
203
+ ${[u,p].map(f=>`${_t(" └─ ")+ut(r(f.path))} (total size: ${Ce(Qe(f.size?.bytes??0,{decimals:2}))})`).join(`
204
+ `)}`:`
205
+ types: ${ut(r(u.path))} (total size: ${Ce(Qe(u.size?.bytes??0,{decimals:2}))})`):""},"buildDeclarationTypesLine"),qD=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=` ${ut(r(e.path))} (${FD(e,i,o)})`;if(s+=e.exports?.length?`
206
+ exports: ${_t(e.exports.join(", "))}`:"",e.chunks?.length&&(s+=`
207
+ ${e.chunks.map(a=>{const l=t.buildEntries.find(c=>c.path===a)?.bytes;return _t(` └─ ${r(a)}${ut(l?` (${Qe(l,{decimals:2})})`:"")}`)}).join(`
208
+ `)}`),e.dynamicImports&&e.dynamicImports.length>0&&(s+=`
209
+ dynamic imports:`,s+=`
210
+ ${e.dynamicImports.map(a=>_t(` └─ ${r(a)}`)).join(`
211
+ `)}`),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)}${ut(l.bytes?` (${Qe(l.bytes,{decimals:2})})`:"")}`)).join(`
212
+ `);s+=a.length>0?`
213
+ inlined modules:
214
+ ${a}`:""}return t.options.declaration&&(s+=HD(e,t,r,n)),s+=`
215
+
216
+ `,e.chunk?_t(s):s},"buildEntryLine"),zD=pt((e,t)=>{const r=pt(s=>et(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:
217
+ `);for(const s of o){const a=qD(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(`
218
+ └─ `)+ut(r(a.path))} (total size: ${Ce(Qe(a.size?.bytes??0,{decimals:2}))})`;s+=`
219
+
220
+ `,e.raw(s)}return n&&e.raw("Σ Total dist size (byte size):",Ce(Qe(t.buildEntries.reduce((s,a)=>s+(a.size?.bytes??0),0),{decimals:2})),`
221
+ `),n},"showSizeInformation"),GD=/\.d\.[mc]?ts$/,Dc=pt(e=>e.filter(t=>!GD.test(t.input)),"filterDtsEntries"),UD=pt((e,t)=>{const r=[];return e!=="undefined"&&r.push(`${Ce(e)} environment`),t!=="undefined"&&r.push(`${Ce(t)} runtime`),r.length>0?`Preparing build for ${r.join(" with ")}`:""},"createBuildLogMessage"),KD=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"),JD=pt((e,t)=>{const r=[];return e!=="undefined"&&r.push(e),t!=="undefined"&&r.push(t),r.length>0?`${r.join("/")}/`:""},"createSubDirectory"),Uo=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?nl(e.options.rollup.replace,{},o):!1}}}),"createAdjustedContext"),VD=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=TD(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=UD(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,E=g?KD(l,u):{};if(g){g.values??={};const k=y?nl(y).values:{};Object.assign(g.values,E,k)}else r.warn("'replace' plugin is disabled. You should enable it to replace 'process.env.*' environments.");const j=g?g.values??E:E,R=JD(l,u);let b=d.options.minify??!1;l==="development"?b=!1:l==="production"&&(b=!0);const w=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 w){if(Wi(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=Uo(d,!0,!0,Dc(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=Uo(d,!1,!0,Dc(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=Uo(d,!0,!1,Dc(_),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=Uo(d,k||B,C,O,b,j);a.add({context:J,fileCache:t,subDirectory:R})}}return{builders:s,typeBuilders:a}},"prepareRollupConfig"),XD=pt(async(e,t)=>{const r=e.logger;await e.hooks.callHook("build:before",e);const{builders:n,typeBuilders:i}=await VD(e,t);if(n.size>0&&await Promise.all(Array.from(n,async({context:a,fileCache:l,subDirectory:c})=>Q7(a,l,c,Dy(a.options.bundler)))),i.size>0){const a=e.options.dtsConcurrency??BD;await OD(Array.from(i,({context:l,fileCache:c,subDirectory:u})=>()=>tD(l,c,u)),a)}r.success(xh(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 to(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 zi(c);u.bytes=d.size}const[p,f]=await Promise.all([u.brotli??PD(c),u.gzip??MD(c)]);u.brotli=p,u.gzip=f})())}return await Promise.all(s),e.options.exe&&await jD(e),await e.hooks.callHook("build:done",e),zD(r,e)},"build");var YD=Object.defineProperty,g$=v((e,t)=>YD(e,"name",{value:t,configurable:!0}),"c");const QD=g$(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"),ZD=g$(async(e,t,r,n,i,o)=>{const s=e;if(o!=="*"&&Nt.valid(Nt.coerce(o))===null)throw new Error("Invalid typeScriptVersion option. It must be a valid semver range.");s.info({message:"Declaration node10 compatibility mode is enabled.",prefix:"plugin:packem:node10-compatibility"});const a={};for(const 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,Te(p),"*.d.ts")}`]:[...a[f]??[],`./${le(r,`${p}.d.ts`)}`]}const l=le(n,"package.json"),c=await _n(l);i==="file"&&Object.keys(a).length>0?(await Dg(l,{...c,typesVersions:QD({...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:
222
+
223
+ ${JSON.stringify({typesVersions:{"*":a}},void 0,4)}
224
+ `,prefix:"plugin:packem:node10-compatibility"})},"node10Compatibility");var e6=Object.defineProperty,st=v((e,t)=>e6(e,"name",{value:t,configurable:!0}),"p");const Hr=st(e=>e??{},"extras"),t6=/\.(md|txt|htm|html|data)$/,r6=st(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"),n6=st((e,t,r,n,i,o,s,a)=>{const l=r6(s?.config.compilerOptions?.jsx),c=a.split("."),u=NI()(m_,i,{alias:{},browserTargets:px(),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===ki,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:{},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:hr,include:dr},esbuild:{charset:"utf8",jsx:l,jsxDev:s?.config.compilerOptions?.jsx==="react-jsxdev",jsxFactory:s?.config.compilerOptions?.jsxFactory,jsxFragment:Hr(s?.config.compilerOptions).jsxFragmentFactory,jsxImportSource:Hr(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:st((d,m,g)=>`
225
+ # Licenses of bundled dependencies
226
+ The published ${g} artifact additionally contains code with the following licenses:
227
+ ${d.length>0?`${d.join(", ")}
228
+
229
+ `:`
230
+ `}# Bundled dependencies:
231
+ ${m}`,"dependenciesTemplate"),dtsTemplate:st((d,m,g)=>`
232
+ # Licenses of bundled types
233
+ The published ${g} artifact additionally contains code with the following licenses:
234
+ ${d.length>0?`${d.join(", ")}
235
+
236
+ `:`
237
+ `}# Bundled types:
238
+ ${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:Hr(s?.config.compilerOptions).jsxFragmentFactory,pure:!0,runtime:l==="transform"||l==="automatic"?"automatic":"classic",useBuiltIns:!0,useSpread:!0}},patchTypes:{},polyfillNode:{},preserveDirectives:{include:dr},preserveDynamicImports:!0,pure:{},raw:{exclude:hr,include:[t6]},replace:{objectGuards:!0,preventAssignment:!0},resolve:{allowExportsFolderMapping:!1,exportConditions:[r??"production","module-sync"],extensions:ks,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:hr,include:dr},sourcemap:{},sucrase:{disableESTransforms:!0,enableLegacyBabel5ModuleInterop:!1,enableLegacyTypeScriptModuleInterop:!s?.config.compilerOptions?.esModuleInterop,include:dr,injectCreateRequireForImportRequire:!1,preserveDynamicImport:!0,production:r===ki,...s?.config.compilerOptions?.jsx&&["react","react-jsx","react-jsxdev"].includes(s.config.compilerOptions.jsx)?{jsxFragmentPragma:Hr(s.config.compilerOptions).jsxFragmentFactory,jsxImportSource:Hr(s.config.compilerOptions).jsxImportSource,jsxPragma:s.config.compilerOptions.jsxFactory,jsxRuntime:l,transforms:["typescript","jsx"]}:{transforms:["typescript"]}},swc:{include:dr,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!==ki,pragma:s?.config.compilerOptions?.jsxFactory,pragmaFrag:Hr(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:DI(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:hr}},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 ${Ce("node ")}${a}`,prefix:"system"}),e.info({message:f?`Using ${Ce("rolldown")} with ${Ce(u.runtime)} build runtime`:`Using ${Ce("rollup")} with ${Ce(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 ${Ce(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(", ")}`)),ih(u.alias),u.rollup.alias!==!1&&u.rollup.alias?.entries&&ih(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"),i6=st(async(e,t,r,n,i,o,s,a,l)=>{const c=o.hooks,u=n6(e,t,n,i,o,s,a,l);i1(le(u.rootDir,u.outDir));const p={buildEntries:[],dependencyGraphMap:new Map,environment:n,hoistedDependencies:new Set,hooks:fx(),implicitDependencies:new Set,jiti:dx(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"),XI(p);const f=Hv(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: ${Ce(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.
239
+ 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.
240
+ 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.`),Ly(p),p},"createContext"),o6=st(e=>{switch(e){case"build":return"Building";case"jit":return"Stubbing";case"watch":return"Watching";default:throw new Error(`Unknown mode: ${String(e)}`)}},"getMode"),AB=st(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}=sl(e);n.debug("Using package.json found at",c);const u=await oI(e,l,n,s),p=nP("@visulima/packem",{cwd:e});let f=!1,d,m,g;const y=Wt(JSON.stringify({version:l.version,...l.dependencies,...l.devDependencies,...l.peerDependencies,...l.peerDependenciesMeta,browser:l.browser,eNode:l.engines?.node,exports:l.exports,main:l.main,module:l.module,nodeVersion:a,type:l.type,types:l.types}))+Wt(JSON.stringify(o));p&&j$(y,p,n);const E=new nx(e,p,y,n);try{const j=await i6(n,e,t,r,i,o,l,u,a);E.isEnabled=j.options.fileCache??!0;const R=Dy(j.options.bundler);await Nm(R,e,n),R==="rolldown"&&j.options.declaration&&await Nm("rollup",e,n),j.options.transformerName&&await eI(j.options.transformerName,e,n),n.info(Ce(`${o6(t)} ${j.options.name}`)),n.debug({context:j.options.entries,message:`${ut("Root dir:")} ${j.options.rootDir}
241
+ ${ut("Entries:")}`});const b=st(async O=>{for(const[k,C]of Object.entries(j.options.builder??{})){n.raw(`
242
+ `),await j.hooks.callHook("builder:before",k,j);const B=Date.now(),J=st(()=>Ed(Math.floor(Date.now()-B)),"getBuilderDuration");await C(j,p,E,f),await j.hooks.callHook("builder:done",k,j),n.raw(`
243
+ ⚡️ ${k} run in ${J()}`),O&&n.raw(`
244
+
245
+ `)}},"runBuilder"),w=st(async()=>{if(d?.pid!==void 0)await qI({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=st(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=mx(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(),_=st(()=>Ed(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 OI(j,E,b,h,w),Bm(j,!1);return}if(await PI(j),t==="jit")await EI(j),await j.hooks.callHook("build:done",j);else{if(f=await XD(j,E),j.options.emitCJS&&j.options.declaration==="compatible"){f&&n.raw(`
246
+ `);let O="console",k="*";j.options.node10Compatibility&&(O=j.options.node10Compatibility.writeToPackageJson?"file":"console",k=j.options.node10Compatibility.typeScriptVersion??"*"),await ZD(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&&DM(j),j.options.validation.attw&&await pM(j,f),j.options.validation.bundleLimit&&QM(j,f)),await j.hooks.callHook("validate:done",j),Bm(j,f)}n.raw(`
247
+ ⚡️ Build run in ${_()}
248
+ `),g=st(()=>{w().catch(O=>{n.raw(`
249
+ onSuccess cleanup failed: ${O instanceof Error?O.message:String(O)}
250
+ `)})},"signalHandler"),Vt.once("SIGINT",g),Vt.once("SIGTERM",g),await b(),await h()}catch(j){throw n.raw(`
251
+ `),Y$(j),Nh(j),j}finally{g&&(Vt.off("SIGINT",g),Vt.off("SIGTERM",g)),n.restoreAll(),await JI(p,n,f)}},"packem");export{Ol as $,m_ as A,Vu as B,OO as C,vi as K,AB as M,mB as N,q2 as Q,zR as T,MO as U,wO as W,FO as Z,Na as _,pj as a,lB as b,A2 as c,cd as d,U2 as e,NI as f,uB as h,ht as j,gB as l,hB as m,H2 as r,zO as t,Xf as v};