@redocly/cli 2.62.1 → 2.62.2

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 (100) hide show
  1. package/THIRD_PARTY_NOTICES +2 -2
  2. package/lib/chunks/{O7F2NBMC.js → 2OBVZIAW.js} +2 -2
  3. package/lib/chunks/{GVQMC2WB.js → 2OQM5ARW.js} +1 -1
  4. package/lib/chunks/{DBBMGF4W.js → 36IHQANV.js} +1 -1
  5. package/lib/chunks/{YPYZCXVX.js → 3FXYWWTJ.js} +1 -1
  6. package/lib/chunks/{UFZ7VJKO.js → 3JYQOGV3.js} +1 -1
  7. package/lib/chunks/{YINR7LU6.js → 3WHXM4DJ.js} +1 -1
  8. package/lib/chunks/{RGU6OZYB.js → 4AM55DEH.js} +1 -1
  9. package/lib/chunks/{G55KF2JU.js → 4OEXH5EV.js} +1 -1
  10. package/lib/chunks/{23KTTVIR.js → 5SIJI5LC.js} +1 -1
  11. package/lib/chunks/{PRSNVDUV.js → 5X35UU2C.js} +1 -1
  12. package/lib/chunks/{3M4FKKBI.js → 6MH5ZWLD.js} +1 -1
  13. package/lib/chunks/{XVZ7A34Y.js → 6WZUCZGV.js} +1 -1
  14. package/lib/chunks/{7YNVVBUW.js → 73RBZL53.js} +1 -1
  15. package/lib/chunks/{Y5AAEFMH.js → 7WM6VLB3.js} +1 -1
  16. package/lib/chunks/{ZNQTCB4Q.js → 7WTV5KH3.js} +1 -1
  17. package/lib/chunks/{LWPTRXNP.js → CIDSJFJO.js} +1 -1
  18. package/lib/chunks/{KQ5RN67Y.js → CQKQB4PJ.js} +1 -1
  19. package/lib/chunks/DS4SCWID.js +9 -0
  20. package/lib/chunks/{QWPV64G2.js → EDQ6QRIB.js} +1 -1
  21. package/lib/chunks/{LNYTDBAU.js → ENSYM7KY.js} +1 -1
  22. package/lib/chunks/{5YW5LAGV.js → FDGP3ZYZ.js} +1 -1
  23. package/lib/chunks/GKXY6U4S.js +145 -0
  24. package/lib/chunks/{WEOCCL26.js → GWXT3QO6.js} +5 -5
  25. package/lib/chunks/{VE45GKNY.js → HUWKDZPP.js} +1 -1
  26. package/lib/chunks/{W3G6AQCC.js → HWTYAU4Y.js} +1 -1
  27. package/lib/chunks/{VXLODB3S.js → HYE4U6V5.js} +1 -1
  28. package/lib/chunks/{REIGI2Y7.js → I5CGSLGR.js} +1 -1
  29. package/lib/chunks/{P7MVM2ZA.js → IUSSBOYO.js} +1 -1
  30. package/lib/chunks/{5UYYEBJY.js → JLVGRO3I.js} +1 -1
  31. package/lib/chunks/{AB2EMYEK.js → KOR5TUJG.js} +1 -1
  32. package/lib/chunks/{WPIZQQ5C.js → LCFG5N4V.js} +1 -1
  33. package/lib/chunks/{BX2H6D2W.js → M3XPS7UF.js} +1 -1
  34. package/lib/chunks/{B64RMZSV.js → PWGFZ5ZK.js} +1 -1
  35. package/lib/chunks/{UWK3L6LB.js → RU7T4CKG.js} +1 -1
  36. package/lib/chunks/{RUIEI3YV.js → SHZZKTDE.js} +1 -1
  37. package/lib/chunks/{SOI7RTB4.js → TKLMYBPI.js} +1 -1
  38. package/lib/chunks/{QMIOB64K.js → V2YF33JL.js} +1 -1
  39. package/lib/chunks/{ID2DJAJI.js → V3ILUN2S.js} +1 -1
  40. package/lib/chunks/{L3H2DSRP.js → VXONEXYX.js} +1 -1
  41. package/lib/chunks/{5S5OMDQZ.js → WX24BERR.js} +381 -381
  42. package/lib/chunks/{ZJYDDU5M.js → XFBJHVYU.js} +1 -1
  43. package/lib/chunks/{U77FTE2C.js → Z6GHMX6Z.js} +1 -1
  44. package/lib/chunks/{NBI4EQPC.js → ZCVUIIPU.js} +1 -1
  45. package/lib/eject-assets/generators/cli/docs.ts +1 -1
  46. package/lib/eject-assets/generators/cli/engine-source.ts +1 -1
  47. package/lib/eject-assets/generators/cli/index.ts +2 -2
  48. package/lib/eject-assets/generators/cli/render.ts +1 -1
  49. package/lib/eject-assets/generators/go/client.ts +1 -1
  50. package/lib/eject-assets/generators/go/descriptor.ts +1 -1
  51. package/lib/eject-assets/generators/go/index.ts +2 -2
  52. package/lib/eject-assets/generators/go/models.ts +1 -1
  53. package/lib/eject-assets/generators/go/naming.ts +1 -1
  54. package/lib/eject-assets/generators/go/operations.ts +1 -1
  55. package/lib/eject-assets/generators/go/pagination.ts +1 -1
  56. package/lib/eject-assets/generators/go/types.ts +1 -1
  57. package/lib/eject-assets/generators/mock/faker.ts +1 -1
  58. package/lib/eject-assets/generators/mock/index.ts +2 -2
  59. package/lib/eject-assets/generators/mock/render.ts +1 -1
  60. package/lib/eject-assets/generators/mock/sample.ts +1 -1
  61. package/lib/eject-assets/generators/mock/values.ts +1 -1
  62. package/lib/eject-assets/generators/php/client.ts +1 -1
  63. package/lib/eject-assets/generators/php/descriptor.ts +1 -1
  64. package/lib/eject-assets/generators/php/index.ts +2 -2
  65. package/lib/eject-assets/generators/php/models.ts +1 -1
  66. package/lib/eject-assets/generators/php/naming.ts +1 -1
  67. package/lib/eject-assets/generators/php/operations.ts +1 -1
  68. package/lib/eject-assets/generators/php/pagination.ts +1 -1
  69. package/lib/eject-assets/generators/php/types.ts +1 -1
  70. package/lib/eject-assets/generators/python/client.ts +1 -1
  71. package/lib/eject-assets/generators/python/descriptor.ts +1 -1
  72. package/lib/eject-assets/generators/python/index.ts +2 -2
  73. package/lib/eject-assets/generators/python/models.ts +1 -1
  74. package/lib/eject-assets/generators/python/naming.ts +1 -1
  75. package/lib/eject-assets/generators/python/operations.ts +1 -1
  76. package/lib/eject-assets/generators/python/pagination.ts +1 -1
  77. package/lib/eject-assets/generators/python/types.ts +1 -1
  78. package/lib/eject-assets/generators/swr/index.ts +2 -2
  79. package/lib/eject-assets/generators/swr/render.ts +1 -1
  80. package/lib/eject-assets/generators/tanstack-query/index.ts +2 -2
  81. package/lib/eject-assets/generators/tanstack-query/render.ts +1 -1
  82. package/lib/eject-assets/generators/transformers/index.ts +2 -2
  83. package/lib/eject-assets/generators/transformers/render.ts +1 -1
  84. package/lib/eject-assets/generators/typescript/banner.ts +1 -1
  85. package/lib/eject-assets/generators/typescript/client.ts +1 -1
  86. package/lib/eject-assets/generators/typescript/descriptor.ts +1 -1
  87. package/lib/eject-assets/generators/typescript/index.ts +2 -2
  88. package/lib/eject-assets/generators/typescript/inline-runtime.ts +1 -1
  89. package/lib/eject-assets/generators/typescript/operation-signature.ts +1 -1
  90. package/lib/eject-assets/generators/typescript/operation-types.ts +1 -1
  91. package/lib/eject-assets/generators/typescript/operations.ts +1 -1
  92. package/lib/eject-assets/generators/typescript/response-headers.ts +1 -1
  93. package/lib/eject-assets/generators/typescript/type-guards.ts +1 -1
  94. package/lib/eject-assets/generators/typescript/types.ts +1 -1
  95. package/lib/eject-assets/generators/zod/index.ts +2 -2
  96. package/lib/eject-assets/generators/zod/schemas.ts +1 -1
  97. package/lib/index.js +25 -25
  98. package/package.json +1 -1
  99. package/lib/chunks/5NOJ76EP.js +0 -9
  100. package/lib/chunks/LRUXN6H5.js +0 -59
package/lib/index.js CHANGED
@@ -5,19 +5,19 @@ import { dirname as __pathDirname } from 'node:path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  var __filename = __fileURLToPath(import.meta.url);
7
7
  var __dirname = __pathDirname(__filename);
8
- import{a as ri,f as te}from"./chunks/U5DIFWGH.js";import{c as ni}from"./chunks/4PTNG4EI.js";import{a as Xt}from"./chunks/3DEJQSYG.js";import{a as Na,b as si,c as oi}from"./chunks/GHSNC2OX.js";import{a as ai}from"./chunks/HBENVUR4.js";import{a as Zn}from"./chunks/6NB3FKVN.js";import{a as Ta}from"./chunks/LRUXN6H5.js";import{a as ii,c as Jt,d as Lr,e as ci,g as li}from"./chunks/TZMWTSOQ.js";import{a as Ie,b as ei,c as ti}from"./chunks/W3G6AQCC.js";import{Ba as Qn,O as Wn,R as Hn,Z as Vn,a as Gn,aa as Bt,ba as Bn,c as we,ea as Lt,ia as K,ja as Yt,ka as Yn,l as Pr,oa as Oe,pa as Kt,sa as Kn,u as kn,va as Xn,wa as Jn}from"./chunks/22EANOP2.js";import"./chunks/NEWT5A6S.js";import{a as Ue,c as z,e as Pt}from"./chunks/RFWIIJFG.js";var wt=z((md,ui)=>{"use strict";var Da="2.0.0",qa=Number.MAX_SAFE_INTEGER||9007199254740991,Ma=16,Fa=250,za=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ui.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Ma,MAX_SAFE_BUILD_LENGTH:Fa,MAX_SAFE_INTEGER:qa,RELEASE_TYPES:za,SEMVER_SPEC_VERSION:Da,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Nt=z((gd,fi)=>{"use strict";var Ua=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};fi.exports=Ua});var Ot=z((Ge,di)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Nr,MAX_SAFE_BUILD_LENGTH:Ga,MAX_LENGTH:ka}=wt(),Wa=Nt();Ge=di.exports={};var Ha=Ge.re=[],Va=Ge.safeRe=[],C=Ge.src=[],Ba=Ge.safeSrc=[],x=Ge.t={},Ya=0,Tr="[a-zA-Z0-9-]",Ka=[["\\s",1],["\\d",ka],[Tr,Ga]],Xa=r=>{for(let[e,t]of Ka)r=r.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return r},k=(r,e,t)=>{let n=Xa(e),i=Ya++;Wa(r,i,e),x[r]=i,C[i]=e,Ba[i]=n,Ha[i]=new RegExp(e,t?"g":void 0),Va[i]=new RegExp(n,t?"g":void 0)};k("NUMERICIDENTIFIER","0|[1-9]\\d*");k("NUMERICIDENTIFIERLOOSE","\\d+");k("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Tr}*`);k("MAINVERSION",`(${C[x.NUMERICIDENTIFIER]})\\.(${C[x.NUMERICIDENTIFIER]})\\.(${C[x.NUMERICIDENTIFIER]})`);k("MAINVERSIONLOOSE",`(${C[x.NUMERICIDENTIFIERLOOSE]})\\.(${C[x.NUMERICIDENTIFIERLOOSE]})\\.(${C[x.NUMERICIDENTIFIERLOOSE]})`);k("PRERELEASEIDENTIFIER",`(?:${C[x.NONNUMERICIDENTIFIER]}|${C[x.NUMERICIDENTIFIER]})`);k("PRERELEASEIDENTIFIERLOOSE",`(?:${C[x.NONNUMERICIDENTIFIER]}|${C[x.NUMERICIDENTIFIERLOOSE]})`);k("PRERELEASE",`(?:-(${C[x.PRERELEASEIDENTIFIER]}(?:\\.${C[x.PRERELEASEIDENTIFIER]})*))`);k("PRERELEASELOOSE",`(?:-?(${C[x.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${C[x.PRERELEASEIDENTIFIERLOOSE]})*))`);k("BUILDIDENTIFIER",`${Tr}+`);k("BUILD",`(?:\\+(${C[x.BUILDIDENTIFIER]}(?:\\.${C[x.BUILDIDENTIFIER]})*))`);k("FULLPLAIN",`v?${C[x.MAINVERSION]}${C[x.PRERELEASE]}?${C[x.BUILD]}?`);k("FULL",`^${C[x.FULLPLAIN]}$`);k("LOOSEPLAIN",`[v=\\s]*${C[x.MAINVERSIONLOOSE]}${C[x.PRERELEASELOOSE]}?${C[x.BUILD]}?`);k("LOOSE",`^${C[x.LOOSEPLAIN]}$`);k("GTLT","((?:<|>)?=?)");k("XRANGEIDENTIFIERLOOSE",`${C[x.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);k("XRANGEIDENTIFIER",`${C[x.NUMERICIDENTIFIER]}|x|X|\\*`);k("XRANGEPLAIN",`[v=\\s]*(${C[x.XRANGEIDENTIFIER]})(?:\\.(${C[x.XRANGEIDENTIFIER]})(?:\\.(${C[x.XRANGEIDENTIFIER]})(?:${C[x.PRERELEASE]})?${C[x.BUILD]}?)?)?`);k("XRANGEPLAINLOOSE",`[v=\\s]*(${C[x.XRANGEIDENTIFIERLOOSE]})(?:\\.(${C[x.XRANGEIDENTIFIERLOOSE]})(?:\\.(${C[x.XRANGEIDENTIFIERLOOSE]})(?:${C[x.PRERELEASELOOSE]})?${C[x.BUILD]}?)?)?`);k("XRANGE",`^${C[x.GTLT]}\\s*${C[x.XRANGEPLAIN]}$`);k("XRANGELOOSE",`^${C[x.GTLT]}\\s*${C[x.XRANGEPLAINLOOSE]}$`);k("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Nr}})(?:\\.(\\d{1,${Nr}}))?(?:\\.(\\d{1,${Nr}}))?`);k("COERCE",`${C[x.COERCEPLAIN]}(?:$|[^\\d])`);k("COERCEFULL",C[x.COERCEPLAIN]+`(?:${C[x.PRERELEASE]})?(?:${C[x.BUILD]})?(?:$|[^\\d])`);k("COERCERTL",C[x.COERCE],!0);k("COERCERTLFULL",C[x.COERCEFULL],!0);k("LONETILDE","(?:~>?)");k("TILDETRIM",`(\\s*)${C[x.LONETILDE]}\\s+`,!0);Ge.tildeTrimReplace="$1~";k("TILDE",`^${C[x.LONETILDE]}${C[x.XRANGEPLAIN]}$`);k("TILDELOOSE",`^${C[x.LONETILDE]}${C[x.XRANGEPLAINLOOSE]}$`);k("LONECARET","(?:\\^)");k("CARETTRIM",`(\\s*)${C[x.LONECARET]}\\s+`,!0);Ge.caretTrimReplace="$1^";k("CARET",`^${C[x.LONECARET]}${C[x.XRANGEPLAIN]}$`);k("CARETLOOSE",`^${C[x.LONECARET]}${C[x.XRANGEPLAINLOOSE]}$`);k("COMPARATORLOOSE",`^${C[x.GTLT]}\\s*(${C[x.LOOSEPLAIN]})$|^$`);k("COMPARATOR",`^${C[x.GTLT]}\\s*(${C[x.FULLPLAIN]})$|^$`);k("COMPARATORTRIM",`(\\s*)${C[x.GTLT]}\\s*(${C[x.LOOSEPLAIN]}|${C[x.XRANGEPLAIN]})`,!0);Ge.comparatorTrimReplace="$1$2$3";k("HYPHENRANGE",`^\\s*(${C[x.XRANGEPLAIN]})\\s+-\\s+(${C[x.XRANGEPLAIN]})\\s*$`);k("HYPHENRANGELOOSE",`^\\s*(${C[x.XRANGEPLAINLOOSE]})\\s+-\\s+(${C[x.XRANGEPLAINLOOSE]})\\s*$`);k("STAR","(<|>)?=?\\s*\\*");k("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");k("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Qt=z((yd,pi)=>{"use strict";var Ja=Object.freeze({loose:!0}),Qa=Object.freeze({}),Za=r=>r?typeof r!="object"?Ja:r:Qa;pi.exports=Za});var Dr=z((bd,gi)=>{"use strict";var hi=/^[0-9]+$/,mi=(r,e)=>{if(typeof r=="number"&&typeof e=="number")return r===e?0:r<e?-1:1;let t=hi.test(r),n=hi.test(e);return t&&n&&(r=+r,e=+e),r===e?0:t&&!n?-1:n&&!t?1:r<e?-1:1},ec=(r,e)=>mi(e,r);gi.exports={compareIdentifiers:mi,rcompareIdentifiers:ec}});var me=z((Ed,bi)=>{"use strict";var Zt=Nt(),{MAX_LENGTH:yi,MAX_SAFE_INTEGER:er}=wt(),{safeRe:tr,t:rr}=Ot(),tc=Qt(),{compareIdentifiers:qr}=Dr(),rc=(r,e)=>{let t=e.split(".");if(t.length>r.length)return!1;for(let n=0;n<t.length;n++)if(qr(r[n],t[n])!==0)return!1;return!0},Mr=class r{constructor(e,t){if(t=tc(t),e instanceof r){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>yi)throw new TypeError(`version is longer than ${yi} characters`);Zt("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let n=e.trim().match(t.loose?tr[rr.LOOSE]:tr[rr.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>er||this.major<0)throw new TypeError("Invalid major version");if(this.minor>er||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>er||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let s=+i;if(s>=0&&s<er)return s}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Zt("SemVer.compare",this.version,this.options,e),!(e instanceof r)){if(typeof e=="string"&&e===this.version)return 0;e=new r(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof r||(e=new r(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof r||(e=new r(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let n=this.prerelease[t],i=e.prerelease[t];if(Zt("prerelease compare",t,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return qr(n,i)}while(++t)}compareBuild(e){e instanceof r||(e=new r(e,this.options));let t=0;do{let n=this.build[t],i=e.build[t];if(Zt("build compare",t,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return qr(n,i)}while(++t)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(t){let i=`-${t}`.match(this.options.loose?tr[rr.PRERELEASELOOSE]:tr[rr.PRERELEASE]);if(!i||i[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(t===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(t){let s=[t,i];if(n===!1&&(s=[t]),rc(this.prerelease,t)){let o=this.prerelease[t.split(".").length];isNaN(o)&&(this.prerelease=s)}else this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};bi.exports=Mr});var Qe=z((wd,wi)=>{"use strict";var Ei=me(),nc=(r,e,t=!1)=>{if(r instanceof Ei)return r;try{return new Ei(r,e)}catch(n){if(!t)return null;throw n}};wi.exports=nc});var Ai=z((Od,Oi)=>{"use strict";var ic=Qe(),sc=(r,e)=>{let t=ic(r,e);return t?t.version:null};Oi.exports=sc});var Si=z((Ad,_i)=>{"use strict";var oc=Qe(),ac=(r,e)=>{let t=oc(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null};_i.exports=ac});var Ri=z((_d,xi)=>{"use strict";var Ci=me(),cc=(r,e,t,n,i)=>{typeof t=="string"&&(i=n,n=t,t=void 0);try{return new Ci(r instanceof Ci?r.version:r,t).inc(e,n,i).version}catch{return null}};xi.exports=cc});var $i=z((Sd,ji)=>{"use strict";var vi=Qe(),lc=(r,e)=>{let t=vi(r,null,!0),n=vi(e,null,!0),i=t.compare(n);if(i===0)return null;let s=i>0,o=s?t:n,c=s?n:t,u=!!o.prerelease.length;if(!!c.prerelease.length&&!u){if(!c.patch&&!c.minor)return"major";if(c.compareMain(o)===0)return c.minor&&!c.patch?"minor":"patch"}let h=u?"pre":"";return t.major!==n.major?h+"major":t.minor!==n.minor?h+"minor":t.patch!==n.patch?h+"patch":"prerelease"};ji.exports=lc});var Pi=z((Cd,Ii)=>{"use strict";var uc=me(),fc=(r,e)=>new uc(r,e).major;Ii.exports=fc});var Ni=z((xd,Li)=>{"use strict";var dc=me(),pc=(r,e)=>new dc(r,e).minor;Li.exports=pc});var Di=z((Rd,Ti)=>{"use strict";var hc=me(),mc=(r,e)=>new hc(r,e).patch;Ti.exports=mc});var Mi=z((vd,qi)=>{"use strict";var gc=Qe(),yc=(r,e)=>{let t=gc(r,e);return t&&t.prerelease.length?t.prerelease:null};qi.exports=yc});var Pe=z((jd,zi)=>{"use strict";var Fi=me(),bc=(r,e,t)=>new Fi(r,t).compare(new Fi(e,t));zi.exports=bc});var Gi=z(($d,Ui)=>{"use strict";var Ec=Pe(),wc=(r,e,t)=>Ec(e,r,t);Ui.exports=wc});var Wi=z((Id,ki)=>{"use strict";var Oc=Pe(),Ac=(r,e)=>Oc(r,e,!0);ki.exports=Ac});var nr=z((Pd,Vi)=>{"use strict";var Hi=me(),_c=(r,e,t)=>{let n=new Hi(r,t),i=new Hi(e,t);return n.compare(i)||n.compareBuild(i)};Vi.exports=_c});var Yi=z((Ld,Bi)=>{"use strict";var Sc=nr(),Cc=(r,e)=>r.sort((t,n)=>Sc(t,n,e));Bi.exports=Cc});var Xi=z((Nd,Ki)=>{"use strict";var xc=nr(),Rc=(r,e)=>r.sort((t,n)=>xc(n,t,e));Ki.exports=Rc});var Tt=z((Td,Ji)=>{"use strict";var vc=Pe(),jc=(r,e,t)=>vc(r,e,t)>0;Ji.exports=jc});var ir=z((Dd,Qi)=>{"use strict";var $c=Pe(),Ic=(r,e,t)=>$c(r,e,t)<0;Qi.exports=Ic});var Fr=z((qd,Zi)=>{"use strict";var Pc=Pe(),Lc=(r,e,t)=>Pc(r,e,t)===0;Zi.exports=Lc});var zr=z((Md,es)=>{"use strict";var Nc=Pe(),Tc=(r,e,t)=>Nc(r,e,t)!==0;es.exports=Tc});var sr=z((Fd,ts)=>{"use strict";var Dc=Pe(),qc=(r,e,t)=>Dc(r,e,t)>=0;ts.exports=qc});var or=z((zd,rs)=>{"use strict";var Mc=Pe(),Fc=(r,e,t)=>Mc(r,e,t)<=0;rs.exports=Fc});var Ur=z((Ud,ns)=>{"use strict";var zc=Fr(),Uc=zr(),Gc=Tt(),kc=sr(),Wc=ir(),Hc=or(),Vc=(r,e,t,n)=>{switch(e){case"===":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r===t;case"!==":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r!==t;case"":case"=":case"==":return zc(r,t,n);case"!=":return Uc(r,t,n);case">":return Gc(r,t,n);case">=":return kc(r,t,n);case"<":return Wc(r,t,n);case"<=":return Hc(r,t,n);default:throw new TypeError(`Invalid operator: ${e}`)}};ns.exports=Vc});var ss=z((Gd,is)=>{"use strict";var Bc=me(),Yc=Qe(),{safeRe:ar,t:cr}=Ot(),Kc=(r,e)=>{if(r instanceof Bc)return r;if(typeof r=="number"&&(r=String(r)),typeof r!="string")return null;e=e||{};let t=null;if(!e.rtl)t=r.match(e.includePrerelease?ar[cr.COERCEFULL]:ar[cr.COERCE]);else{let u=e.includePrerelease?ar[cr.COERCERTLFULL]:ar[cr.COERCERTL],p;for(;(p=u.exec(r))&&(!t||t.index+t[0].length!==r.length);)(!t||p.index+p[0].length!==t.index+t[0].length)&&(t=p),u.lastIndex=p.index+p[1].length+p[2].length;u.lastIndex=-1}if(t===null)return null;let n=t[2],i=t[3]||"0",s=t[4]||"0",o=e.includePrerelease&&t[5]?`-${t[5]}`:"",c=e.includePrerelease&&t[6]?`+${t[6]}`:"";return Yc(`${n}.${i}.${s}${o}${c}`,e)};is.exports=Kc});var as=z((kd,os)=>{"use strict";var Xc=Qe(),Jc=wt(),Qc=me(),Zc=(r,e,t)=>{if(!Jc.RELEASE_TYPES.includes(e))return null;let n=el(r,t);return n&&tl(n,e)},el=(r,e)=>{let t=r instanceof Qc?r.version:r;return Xc(t,e)},tl=(r,e)=>{if(rl(e))return r.version;switch(r.prerelease=[],e){case"major":r.minor=0,r.patch=0;break;case"minor":r.patch=0;break}return r.format()},rl=r=>r.startsWith("pre");os.exports=Zc});var ls=z((Wd,cs)=>{"use strict";var Gr=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,t)}return this}};cs.exports=Gr});var Le=z((Hd,ps)=>{"use strict";var nl=/\s+/g,kr=class r{constructor(e,t){if(t=sl(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof Wr)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(nl," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!fs(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&hl(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let n=0;n<t.length;n++)n>0&&(this.formatted+=" "),this.formatted+=t[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(pl,"");let n=((this.options.includePrerelease&&fl)|(this.options.loose&&dl))+":"+e,i=us.get(n);if(i)return i;let s=this.options.loose,o=s?Ae[ge.HYPHENRANGELOOSE]:Ae[ge.HYPHENRANGE];e=e.replace(o,Cl(this.options.includePrerelease)),re("hyphen replace",e),e=e.replace(Ae[ge.COMPARATORTRIM],cl),re("comparator trim",e),e=e.replace(Ae[ge.TILDETRIM],ll),re("tilde trim",e),e=e.replace(Ae[ge.CARETTRIM],ul),re("caret trim",e);let c=e.split(" ").map(l=>ml(l,this.options)).join(" ").split(/\s+/).map(l=>Sl(l,this.options));s&&(c=c.filter(l=>(re("loose invalid filter",l,this.options),!!l.match(Ae[ge.COMPARATORLOOSE])))),re("range list",c);let u=new Map,p=c.map(l=>new Wr(l,this.options));for(let l of p){if(fs(l))return[l];u.set(l.value,l)}u.size>1&&u.has("")&&u.delete("");let h=[...u.values()];return us.set(n,h),h}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(n=>ds(n,t)&&e.set.some(i=>ds(i,t)&&n.every(s=>i.every(o=>s.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new ol(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(xl(this.set[t],e,this.options))return!0;return!1}};ps.exports=kr;var il=ls(),us=new il,sl=Qt(),Wr=Dt(),re=Nt(),ol=me(),{safeRe:Ae,src:al,t:ge,comparatorTrimReplace:cl,tildeTrimReplace:ll,caretTrimReplace:ul}=Ot(),{FLAG_INCLUDE_PRERELEASE:fl,FLAG_LOOSE:dl}=wt(),pl=new RegExp(al[ge.BUILD],"g"),fs=r=>r.value==="<0.0.0-0",hl=r=>r.value==="",ds=(r,e)=>{let t=!0,n=r.slice(),i=n.pop();for(;t&&n.length;)t=n.every(s=>i.intersects(s,e)),i=n.pop();return t},ml=(r,e)=>(r=r.replace(Ae[ge.BUILD],""),re("comp",r,e),r=El(r,e),re("caret",r),r=yl(r,e),re("tildes",r),r=Ol(r,e),re("xrange",r),r=_l(r,e),re("stars",r),r),de=r=>!r||r.toLowerCase()==="x"||r==="*",gl=(r,e,t)=>de(r)&&!de(e)||de(e)&&t&&!de(t),yl=(r,e)=>r.trim().split(/\s+/).map(t=>bl(t,e)).join(" "),bl=(r,e)=>{let t=e.loose?Ae[ge.TILDELOOSE]:Ae[ge.TILDE],n=e.includePrerelease?"-0":"";return r.replace(t,(i,s,o,c,u)=>{re("tilde",r,i,s,o,c,u);let p;return de(s)?p="":de(o)?p=`>=${s}.0.0${n} <${+s+1}.0.0-0`:de(c)?p=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`:u?(re("replaceTilde pr",u),p=`>=${s}.${o}.${c}-${u} <${s}.${+o+1}.0-0`):p=`>=${s}.${o}.${c} <${s}.${+o+1}.0-0`,re("tilde return",p),p})},El=(r,e)=>r.trim().split(/\s+/).map(t=>wl(t,e)).join(" "),wl=(r,e)=>{re("caret",r,e);let t=e.loose?Ae[ge.CARETLOOSE]:Ae[ge.CARET],n=e.includePrerelease?"-0":"";return r.replace(t,(i,s,o,c,u)=>{re("caret",r,i,s,o,c,u);let p;return de(s)?p="":de(o)?p=`>=${s}.0.0${n} <${+s+1}.0.0-0`:de(c)?s==="0"?p=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`:p=`>=${s}.${o}.0${n} <${+s+1}.0.0-0`:u?(re("replaceCaret pr",u),s==="0"?o==="0"?p=`>=${s}.${o}.${c}-${u} <${s}.${o}.${+c+1}-0`:p=`>=${s}.${o}.${c}-${u} <${s}.${+o+1}.0-0`:p=`>=${s}.${o}.${c}-${u} <${+s+1}.0.0-0`):(re("no pr"),s==="0"?o==="0"?p=`>=${s}.${o}.${c} <${s}.${o}.${+c+1}-0`:p=`>=${s}.${o}.${c} <${s}.${+o+1}.0-0`:p=`>=${s}.${o}.${c} <${+s+1}.0.0-0`),re("caret return",p),p})},Ol=(r,e)=>(re("replaceXRanges",r,e),r.split(/\s+/).map(t=>Al(t,e)).join(" ")),Al=(r,e)=>{r=r.trim();let t=e.loose?Ae[ge.XRANGELOOSE]:Ae[ge.XRANGE];return r.replace(t,(n,i,s,o,c,u)=>{if(re("xRange",r,n,i,s,o,c,u),gl(s,o,c))return r;let p=de(s),h=p||de(o),l=h||de(c),b=l;return i==="="&&b&&(i=""),u=e.includePrerelease?"-0":"",p?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&b?(h&&(o=0),c=0,i===">"?(i=">=",h?(s=+s+1,o=0,c=0):(o=+o+1,c=0)):i==="<="&&(i="<",h?s=+s+1:o=+o+1),i==="<"&&(u="-0"),n=`${i+s}.${o}.${c}${u}`):h?n=`>=${s}.0.0${u} <${+s+1}.0.0-0`:l&&(n=`>=${s}.${o}.0${u} <${s}.${+o+1}.0-0`),re("xRange return",n),n})},_l=(r,e)=>(re("replaceStars",r,e),r.trim().replace(Ae[ge.STAR],"")),Sl=(r,e)=>(re("replaceGTE0",r,e),r.trim().replace(Ae[e.includePrerelease?ge.GTE0PRE:ge.GTE0],"")),Cl=r=>(e,t,n,i,s,o,c,u,p,h,l,b)=>(de(n)?t="":de(i)?t=`>=${n}.0.0${r?"-0":""}`:de(s)?t=`>=${n}.${i}.0${r?"-0":""}`:o?t=`>=${t}`:t=`>=${t}${r?"-0":""}`,de(p)?u="":de(h)?u=`<${+p+1}.0.0-0`:de(l)?u=`<${p}.${+h+1}.0-0`:b?u=`<=${p}.${h}.${l}-${b}`:r?u=`<${p}.${h}.${+l+1}-0`:u=`<=${u}`,`${t} ${u}`.trim()),xl=(r,e,t)=>{for(let n=0;n<r.length;n++)if(!r[n].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let n=0;n<r.length;n++)if(re(r[n].semver),r[n].semver!==Wr.ANY&&r[n].semver.prerelease.length>0){let i=r[n].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var Dt=z((Vd,Es)=>{"use strict";var qt=Symbol("SemVer ANY"),Br=class r{static get ANY(){return qt}constructor(e,t){if(t=hs(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Vr("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===qt?this.value="":this.value=this.operator+this.semver.version,Vr("comp",this)}parse(e){let t=this.options.loose?ms[gs.COMPARATORLOOSE]:ms[gs.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new ys(n[2],this.options.loose):this.semver=qt}toString(){return this.value}test(e){if(Vr("Comparator.test",e,this.options.loose),this.semver===qt||e===qt)return!0;if(typeof e=="string")try{e=new ys(e,this.options)}catch{return!1}return Hr(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new bs(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new bs(this.value,t).test(e.semver):(t=hs(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Hr(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Hr(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Es.exports=Br;var hs=Qt(),{safeRe:ms,t:gs}=Ot(),Hr=Ur(),Vr=Nt(),ys=me(),bs=Le()});var Mt=z((Bd,ws)=>{"use strict";var Rl=Le(),vl=(r,e,t)=>{try{e=new Rl(e,t)}catch{return!1}return e.test(r)};ws.exports=vl});var As=z((Yd,Os)=>{"use strict";var jl=Le(),$l=(r,e)=>new jl(r,e).set.map(t=>t.map(n=>n.value).join(" ").trim().split(" "));Os.exports=$l});var Ss=z((Kd,_s)=>{"use strict";var Il=me(),Pl=Le(),Ll=(r,e,t)=>{let n=null,i=null,s=null;try{s=new Pl(e,t)}catch{return null}return r.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new Il(n,t))}),n};_s.exports=Ll});var xs=z((Xd,Cs)=>{"use strict";var Nl=me(),Tl=Le(),Dl=(r,e,t)=>{let n=null,i=null,s=null;try{s=new Tl(e,t)}catch{return null}return r.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new Nl(n,t))}),n};Cs.exports=Dl});var js=z((Jd,vs)=>{"use strict";var Yr=me(),ql=Le(),Rs=Tt(),Ml=(r,e)=>{r=new ql(r,e);let t=new Yr("0.0.0");if(r.test(t)||(t=new Yr("0.0.0-0"),r.test(t)))return t;t=null;for(let n=0;n<r.set.length;++n){let i=r.set[n],s=null;i.forEach(o=>{let c=new Yr(o.semver.version);switch(o.operator){case">":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!s||Rs(c,s))&&(s=c);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!t||Rs(t,s))&&(t=s)}return t&&r.test(t)?t:null};vs.exports=Ml});var Is=z((Qd,$s)=>{"use strict";var Fl=Le(),zl=(r,e)=>{try{return new Fl(r,e).range||"*"}catch{return null}};$s.exports=zl});var lr=z((Zd,Ts)=>{"use strict";var Ul=me(),Ns=Dt(),{ANY:Gl}=Ns,kl=Le(),Wl=Mt(),Ps=Tt(),Ls=ir(),Hl=or(),Vl=sr(),Bl=(r,e,t,n)=>{r=new Ul(r,n),e=new kl(e,n);let i,s,o,c,u;switch(t){case">":i=Ps,s=Hl,o=Ls,c=">",u=">=";break;case"<":i=Ls,s=Vl,o=Ps,c="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Wl(r,e,n))return!1;for(let p=0;p<e.set.length;++p){let h=e.set[p],l=null,b=null;if(h.forEach(g=>{g.semver===Gl&&(g=new Ns(">=0.0.0")),l=l||g,b=b||g,i(g.semver,l.semver,n)?l=g:o(g.semver,b.semver,n)&&(b=g)}),l.operator===c||l.operator===u||(!b.operator||b.operator===c)&&s(r,b.semver))return!1;if(b.operator===u&&o(r,b.semver))return!1}return!0};Ts.exports=Bl});var qs=z((ep,Ds)=>{"use strict";var Yl=lr(),Kl=(r,e,t)=>Yl(r,e,">",t);Ds.exports=Kl});var Fs=z((tp,Ms)=>{"use strict";var Xl=lr(),Jl=(r,e,t)=>Xl(r,e,"<",t);Ms.exports=Jl});var Gs=z((rp,Us)=>{"use strict";var zs=Le(),Ql=(r,e,t)=>(r=new zs(r,t),e=new zs(e,t),r.intersects(e,t));Us.exports=Ql});var Ws=z((np,ks)=>{"use strict";var Zl=Mt(),eu=Pe();ks.exports=(r,e,t)=>{let n=[],i=null,s=null,o=r.sort((h,l)=>eu(h,l,t));for(let h of o)Zl(h,e,t)?(s=h,i||(i=h)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);let c=[];for(let[h,l]of n)h===l?c.push(h):!l&&h===o[0]?c.push("*"):l?h===o[0]?c.push(`<=${l}`):c.push(`${h} - ${l}`):c.push(`>=${h}`);let u=c.join(" || "),p=typeof e.raw=="string"?e.raw:String(e);return u.length<p.length?u:e}});var Xs=z((ip,Ks)=>{"use strict";var Hs=Le(),Jr=Dt(),{ANY:Kr}=Jr,Xr=Mt(),Qr=Pe(),tu=(r,e,t={})=>{if(r===e)return!0;r=new Hs(r,t),e=new Hs(e,t);let n=!1;e:for(let i of r.set){for(let s of e.set){let o=nu(i,s,t);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},ru=[new Jr(">=0.0.0-0")],Vs=[new Jr(">=0.0.0")],nu=(r,e,t)=>{if(r===e)return!0;if(r.length===1&&r[0].semver===Kr){if(e.length===1&&e[0].semver===Kr)return!0;t.includePrerelease?r=ru:r=Vs}if(e.length===1&&e[0].semver===Kr){if(t.includePrerelease)return!0;e=Vs}let n=new Set,i,s;for(let g of r)g.operator===">"||g.operator===">="?i=Bs(i,g,t):g.operator==="<"||g.operator==="<="?s=Ys(s,g,t):n.add(g.semver);if(n.size>1)return null;let o;if(i&&s){if(o=Qr(i.semver,s.semver,t),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let g of n){if(i&&!Xr(g,String(i),t)||s&&!Xr(g,String(s),t))return null;for(let w of e)if(!Xr(g,String(w),t))return!1;return!0}let c,u,p,h,l=s&&!t.includePrerelease&&s.semver.prerelease.length?s.semver:!1,b=i&&!t.includePrerelease&&i.semver.prerelease.length?i.semver:!1;l&&l.prerelease.length===1&&s.operator==="<"&&l.prerelease[0]===0&&(l=!1);for(let g of e){if(h=h||g.operator===">"||g.operator===">=",p=p||g.operator==="<"||g.operator==="<=",i){if(b&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===b.major&&g.semver.minor===b.minor&&g.semver.patch===b.patch&&(b=!1),g.operator===">"||g.operator===">="){if(c=Bs(i,g,t),c===g&&c!==i)return!1}else if(i.operator===">="&&!g.test(i.semver))return!1}if(s){if(l&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===l.major&&g.semver.minor===l.minor&&g.semver.patch===l.patch&&(l=!1),g.operator==="<"||g.operator==="<="){if(u=Ys(s,g,t),u===g&&u!==s)return!1}else if(s.operator==="<="&&!g.test(s.semver))return!1}if(!g.operator&&(s||i)&&o!==0)return!1}return!(i&&p&&!s&&o!==0||s&&h&&!i&&o!==0||b||l)},Bs=(r,e,t)=>{if(!r)return e;let n=Qr(r.semver,e.semver,t);return n>0?r:n<0||e.operator===">"&&r.operator===">="?e:r},Ys=(r,e,t)=>{if(!r)return e;let n=Qr(r.semver,e.semver,t);return n<0?r:n>0||e.operator==="<"&&r.operator==="<="?e:r};Ks.exports=tu});var ur=z((sp,Zs)=>{"use strict";var Zr=Ot(),Js=wt(),iu=me(),Qs=Dr(),su=Qe(),ou=Ai(),au=Si(),cu=Ri(),lu=$i(),uu=Pi(),fu=Ni(),du=Di(),pu=Mi(),hu=Pe(),mu=Gi(),gu=Wi(),yu=nr(),bu=Yi(),Eu=Xi(),wu=Tt(),Ou=ir(),Au=Fr(),_u=zr(),Su=sr(),Cu=or(),xu=Ur(),Ru=ss(),vu=as(),ju=Dt(),$u=Le(),Iu=Mt(),Pu=As(),Lu=Ss(),Nu=xs(),Tu=js(),Du=Is(),qu=lr(),Mu=qs(),Fu=Fs(),zu=Gs(),Uu=Ws(),Gu=Xs();Zs.exports={parse:su,valid:ou,clean:au,inc:cu,diff:lu,major:uu,minor:fu,patch:du,prerelease:pu,compare:hu,rcompare:mu,compareLoose:gu,compareBuild:yu,sort:bu,rsort:Eu,gt:wu,lt:Ou,eq:Au,neq:_u,gte:Su,lte:Cu,cmp:xu,coerce:Ru,truncate:vu,Comparator:ju,Range:$u,satisfies:Iu,toComparators:Pu,maxSatisfying:Lu,minSatisfying:Nu,minVersion:Tu,validRange:Du,outside:qu,gtr:Mu,ltr:Fu,intersects:zu,simplifyRange:Uu,subset:Gu,SemVer:iu,re:Zr.re,src:Zr.src,tokens:Zr.t,SEMVER_SPEC_VERSION:Js.SEMVER_SPEC_VERSION,RELEASE_TYPES:Js.RELEASE_TYPES,compareIdentifiers:Qs.compareIdentifiers,rcompareIdentifiers:Qs.rcompareIdentifiers}});var fr=Pt(ur(),1);import*as Ft from"node:process";try{let r=ti?.node;typeof r=="string"&&!fr.satisfies(Ft.version,r)&&K.warn(`
9
- \u26A0\uFE0F Warning: failed to satisfy expected node version. Expected: "${r}", Current "${Ft.version}"
8
+ import{a as ri,f as te}from"./chunks/U5DIFWGH.js";import{c as ni}from"./chunks/4PTNG4EI.js";import{a as Jt}from"./chunks/3DEJQSYG.js";import{a as Na,b as si,c as oi}from"./chunks/GHSNC2OX.js";import{a as ai}from"./chunks/HBENVUR4.js";import{a as Zn}from"./chunks/6NB3FKVN.js";import{a as Ta}from"./chunks/GKXY6U4S.js";import{a as ii,c as Qt,d as Lr,e as ci,g as li}from"./chunks/TZMWTSOQ.js";import{a as Ie,b as ei,c as ti}from"./chunks/HWTYAU4Y.js";import{Ba as Qn,O as Wn,R as Hn,Z as Vn,a as Gn,aa as Yt,ba as Bn,c as we,ea as Nt,ia as K,ja as Kt,ka as Yn,l as Pr,oa as Oe,pa as Xt,sa as Kn,u as kn,va as Xn,wa as Jn}from"./chunks/22EANOP2.js";import"./chunks/NEWT5A6S.js";import{a as ze,c as U,e as Lt}from"./chunks/RFWIIJFG.js";var wt=U((md,ui)=>{"use strict";var Da="2.0.0",qa=Number.MAX_SAFE_INTEGER||9007199254740991,Ma=16,Fa=250,Ua=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ui.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Ma,MAX_SAFE_BUILD_LENGTH:Fa,MAX_SAFE_INTEGER:qa,RELEASE_TYPES:Ua,SEMVER_SPEC_VERSION:Da,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Tt=U((gd,fi)=>{"use strict";var za=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};fi.exports=za});var Ot=U((Ge,di)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Nr,MAX_SAFE_BUILD_LENGTH:Ga,MAX_LENGTH:ka}=wt(),Wa=Tt();Ge=di.exports={};var Ha=Ge.re=[],Va=Ge.safeRe=[],C=Ge.src=[],Ba=Ge.safeSrc=[],x=Ge.t={},Ya=0,Tr="[a-zA-Z0-9-]",Ka=[["\\s",1],["\\d",ka],[Tr,Ga]],Xa=r=>{for(let[e,t]of Ka)r=r.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return r},k=(r,e,t)=>{let n=Xa(e),i=Ya++;Wa(r,i,e),x[r]=i,C[i]=e,Ba[i]=n,Ha[i]=new RegExp(e,t?"g":void 0),Va[i]=new RegExp(n,t?"g":void 0)};k("NUMERICIDENTIFIER","0|[1-9]\\d*");k("NUMERICIDENTIFIERLOOSE","\\d+");k("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Tr}*`);k("MAINVERSION",`(${C[x.NUMERICIDENTIFIER]})\\.(${C[x.NUMERICIDENTIFIER]})\\.(${C[x.NUMERICIDENTIFIER]})`);k("MAINVERSIONLOOSE",`(${C[x.NUMERICIDENTIFIERLOOSE]})\\.(${C[x.NUMERICIDENTIFIERLOOSE]})\\.(${C[x.NUMERICIDENTIFIERLOOSE]})`);k("PRERELEASEIDENTIFIER",`(?:${C[x.NONNUMERICIDENTIFIER]}|${C[x.NUMERICIDENTIFIER]})`);k("PRERELEASEIDENTIFIERLOOSE",`(?:${C[x.NONNUMERICIDENTIFIER]}|${C[x.NUMERICIDENTIFIERLOOSE]})`);k("PRERELEASE",`(?:-(${C[x.PRERELEASEIDENTIFIER]}(?:\\.${C[x.PRERELEASEIDENTIFIER]})*))`);k("PRERELEASELOOSE",`(?:-?(${C[x.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${C[x.PRERELEASEIDENTIFIERLOOSE]})*))`);k("BUILDIDENTIFIER",`${Tr}+`);k("BUILD",`(?:\\+(${C[x.BUILDIDENTIFIER]}(?:\\.${C[x.BUILDIDENTIFIER]})*))`);k("FULLPLAIN",`v?${C[x.MAINVERSION]}${C[x.PRERELEASE]}?${C[x.BUILD]}?`);k("FULL",`^${C[x.FULLPLAIN]}$`);k("LOOSEPLAIN",`[v=\\s]*${C[x.MAINVERSIONLOOSE]}${C[x.PRERELEASELOOSE]}?${C[x.BUILD]}?`);k("LOOSE",`^${C[x.LOOSEPLAIN]}$`);k("GTLT","((?:<|>)?=?)");k("XRANGEIDENTIFIERLOOSE",`${C[x.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);k("XRANGEIDENTIFIER",`${C[x.NUMERICIDENTIFIER]}|x|X|\\*`);k("XRANGEPLAIN",`[v=\\s]*(${C[x.XRANGEIDENTIFIER]})(?:\\.(${C[x.XRANGEIDENTIFIER]})(?:\\.(${C[x.XRANGEIDENTIFIER]})(?:${C[x.PRERELEASE]})?${C[x.BUILD]}?)?)?`);k("XRANGEPLAINLOOSE",`[v=\\s]*(${C[x.XRANGEIDENTIFIERLOOSE]})(?:\\.(${C[x.XRANGEIDENTIFIERLOOSE]})(?:\\.(${C[x.XRANGEIDENTIFIERLOOSE]})(?:${C[x.PRERELEASELOOSE]})?${C[x.BUILD]}?)?)?`);k("XRANGE",`^${C[x.GTLT]}\\s*${C[x.XRANGEPLAIN]}$`);k("XRANGELOOSE",`^${C[x.GTLT]}\\s*${C[x.XRANGEPLAINLOOSE]}$`);k("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Nr}})(?:\\.(\\d{1,${Nr}}))?(?:\\.(\\d{1,${Nr}}))?`);k("COERCE",`${C[x.COERCEPLAIN]}(?:$|[^\\d])`);k("COERCEFULL",C[x.COERCEPLAIN]+`(?:${C[x.PRERELEASE]})?(?:${C[x.BUILD]})?(?:$|[^\\d])`);k("COERCERTL",C[x.COERCE],!0);k("COERCERTLFULL",C[x.COERCEFULL],!0);k("LONETILDE","(?:~>?)");k("TILDETRIM",`(\\s*)${C[x.LONETILDE]}\\s+`,!0);Ge.tildeTrimReplace="$1~";k("TILDE",`^${C[x.LONETILDE]}${C[x.XRANGEPLAIN]}$`);k("TILDELOOSE",`^${C[x.LONETILDE]}${C[x.XRANGEPLAINLOOSE]}$`);k("LONECARET","(?:\\^)");k("CARETTRIM",`(\\s*)${C[x.LONECARET]}\\s+`,!0);Ge.caretTrimReplace="$1^";k("CARET",`^${C[x.LONECARET]}${C[x.XRANGEPLAIN]}$`);k("CARETLOOSE",`^${C[x.LONECARET]}${C[x.XRANGEPLAINLOOSE]}$`);k("COMPARATORLOOSE",`^${C[x.GTLT]}\\s*(${C[x.LOOSEPLAIN]})$|^$`);k("COMPARATOR",`^${C[x.GTLT]}\\s*(${C[x.FULLPLAIN]})$|^$`);k("COMPARATORTRIM",`(\\s*)${C[x.GTLT]}\\s*(${C[x.LOOSEPLAIN]}|${C[x.XRANGEPLAIN]})`,!0);Ge.comparatorTrimReplace="$1$2$3";k("HYPHENRANGE",`^\\s*(${C[x.XRANGEPLAIN]})\\s+-\\s+(${C[x.XRANGEPLAIN]})\\s*$`);k("HYPHENRANGELOOSE",`^\\s*(${C[x.XRANGEPLAINLOOSE]})\\s+-\\s+(${C[x.XRANGEPLAINLOOSE]})\\s*$`);k("STAR","(<|>)?=?\\s*\\*");k("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");k("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Zt=U((yd,pi)=>{"use strict";var Ja=Object.freeze({loose:!0}),Qa=Object.freeze({}),Za=r=>r?typeof r!="object"?Ja:r:Qa;pi.exports=Za});var Dr=U((bd,gi)=>{"use strict";var hi=/^[0-9]+$/,mi=(r,e)=>{if(typeof r=="number"&&typeof e=="number")return r===e?0:r<e?-1:1;let t=hi.test(r),n=hi.test(e);return t&&n&&(r=+r,e=+e),r===e?0:t&&!n?-1:n&&!t?1:r<e?-1:1},ec=(r,e)=>mi(e,r);gi.exports={compareIdentifiers:mi,rcompareIdentifiers:ec}});var me=U((Ed,bi)=>{"use strict";var er=Tt(),{MAX_LENGTH:yi,MAX_SAFE_INTEGER:tr}=wt(),{safeRe:rr,t:nr}=Ot(),tc=Zt(),{compareIdentifiers:qr}=Dr(),rc=(r,e)=>{let t=e.split(".");if(t.length>r.length)return!1;for(let n=0;n<t.length;n++)if(qr(r[n],t[n])!==0)return!1;return!0},Mr=class r{constructor(e,t){if(t=tc(t),e instanceof r){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>yi)throw new TypeError(`version is longer than ${yi} characters`);er("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let n=e.trim().match(t.loose?rr[nr.LOOSE]:rr[nr.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>tr||this.major<0)throw new TypeError("Invalid major version");if(this.minor>tr||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>tr||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let s=+i;if(s>=0&&s<tr)return s}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(er("SemVer.compare",this.version,this.options,e),!(e instanceof r)){if(typeof e=="string"&&e===this.version)return 0;e=new r(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof r||(e=new r(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof r||(e=new r(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let n=this.prerelease[t],i=e.prerelease[t];if(er("prerelease compare",t,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return qr(n,i)}while(++t)}compareBuild(e){e instanceof r||(e=new r(e,this.options));let t=0;do{let n=this.build[t],i=e.build[t];if(er("build compare",t,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return qr(n,i)}while(++t)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(t){let i=`-${t}`.match(this.options.loose?rr[nr.PRERELEASELOOSE]:rr[nr.PRERELEASE]);if(!i||i[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(t===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(t){let s=[t,i];if(n===!1&&(s=[t]),rc(this.prerelease,t)){let o=this.prerelease[t.split(".").length];isNaN(o)&&(this.prerelease=s)}else this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};bi.exports=Mr});var Qe=U((wd,wi)=>{"use strict";var Ei=me(),nc=(r,e,t=!1)=>{if(r instanceof Ei)return r;try{return new Ei(r,e)}catch(n){if(!t)return null;throw n}};wi.exports=nc});var Ai=U((Od,Oi)=>{"use strict";var ic=Qe(),sc=(r,e)=>{let t=ic(r,e);return t?t.version:null};Oi.exports=sc});var Si=U((Ad,_i)=>{"use strict";var oc=Qe(),ac=(r,e)=>{let t=oc(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null};_i.exports=ac});var Ri=U((_d,xi)=>{"use strict";var Ci=me(),cc=(r,e,t,n,i)=>{typeof t=="string"&&(i=n,n=t,t=void 0);try{return new Ci(r instanceof Ci?r.version:r,t).inc(e,n,i).version}catch{return null}};xi.exports=cc});var $i=U((Sd,ji)=>{"use strict";var vi=Qe(),lc=(r,e)=>{let t=vi(r,null,!0),n=vi(e,null,!0),i=t.compare(n);if(i===0)return null;let s=i>0,o=s?t:n,c=s?n:t,u=!!o.prerelease.length;if(!!c.prerelease.length&&!u){if(!c.patch&&!c.minor)return"major";if(c.compareMain(o)===0)return c.minor&&!c.patch?"minor":"patch"}let h=u?"pre":"";return t.major!==n.major?h+"major":t.minor!==n.minor?h+"minor":t.patch!==n.patch?h+"patch":"prerelease"};ji.exports=lc});var Pi=U((Cd,Ii)=>{"use strict";var uc=me(),fc=(r,e)=>new uc(r,e).major;Ii.exports=fc});var Ni=U((xd,Li)=>{"use strict";var dc=me(),pc=(r,e)=>new dc(r,e).minor;Li.exports=pc});var Di=U((Rd,Ti)=>{"use strict";var hc=me(),mc=(r,e)=>new hc(r,e).patch;Ti.exports=mc});var Mi=U((vd,qi)=>{"use strict";var gc=Qe(),yc=(r,e)=>{let t=gc(r,e);return t&&t.prerelease.length?t.prerelease:null};qi.exports=yc});var Pe=U((jd,Ui)=>{"use strict";var Fi=me(),bc=(r,e,t)=>new Fi(r,t).compare(new Fi(e,t));Ui.exports=bc});var Gi=U(($d,zi)=>{"use strict";var Ec=Pe(),wc=(r,e,t)=>Ec(e,r,t);zi.exports=wc});var Wi=U((Id,ki)=>{"use strict";var Oc=Pe(),Ac=(r,e)=>Oc(r,e,!0);ki.exports=Ac});var ir=U((Pd,Vi)=>{"use strict";var Hi=me(),_c=(r,e,t)=>{let n=new Hi(r,t),i=new Hi(e,t);return n.compare(i)||n.compareBuild(i)};Vi.exports=_c});var Yi=U((Ld,Bi)=>{"use strict";var Sc=ir(),Cc=(r,e)=>r.sort((t,n)=>Sc(t,n,e));Bi.exports=Cc});var Xi=U((Nd,Ki)=>{"use strict";var xc=ir(),Rc=(r,e)=>r.sort((t,n)=>xc(n,t,e));Ki.exports=Rc});var Dt=U((Td,Ji)=>{"use strict";var vc=Pe(),jc=(r,e,t)=>vc(r,e,t)>0;Ji.exports=jc});var sr=U((Dd,Qi)=>{"use strict";var $c=Pe(),Ic=(r,e,t)=>$c(r,e,t)<0;Qi.exports=Ic});var Fr=U((qd,Zi)=>{"use strict";var Pc=Pe(),Lc=(r,e,t)=>Pc(r,e,t)===0;Zi.exports=Lc});var Ur=U((Md,es)=>{"use strict";var Nc=Pe(),Tc=(r,e,t)=>Nc(r,e,t)!==0;es.exports=Tc});var or=U((Fd,ts)=>{"use strict";var Dc=Pe(),qc=(r,e,t)=>Dc(r,e,t)>=0;ts.exports=qc});var ar=U((Ud,rs)=>{"use strict";var Mc=Pe(),Fc=(r,e,t)=>Mc(r,e,t)<=0;rs.exports=Fc});var zr=U((zd,ns)=>{"use strict";var Uc=Fr(),zc=Ur(),Gc=Dt(),kc=or(),Wc=sr(),Hc=ar(),Vc=(r,e,t,n)=>{switch(e){case"===":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r===t;case"!==":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r!==t;case"":case"=":case"==":return Uc(r,t,n);case"!=":return zc(r,t,n);case">":return Gc(r,t,n);case">=":return kc(r,t,n);case"<":return Wc(r,t,n);case"<=":return Hc(r,t,n);default:throw new TypeError(`Invalid operator: ${e}`)}};ns.exports=Vc});var ss=U((Gd,is)=>{"use strict";var Bc=me(),Yc=Qe(),{safeRe:cr,t:lr}=Ot(),Kc=(r,e)=>{if(r instanceof Bc)return r;if(typeof r=="number"&&(r=String(r)),typeof r!="string")return null;e=e||{};let t=null;if(!e.rtl)t=r.match(e.includePrerelease?cr[lr.COERCEFULL]:cr[lr.COERCE]);else{let u=e.includePrerelease?cr[lr.COERCERTLFULL]:cr[lr.COERCERTL],p;for(;(p=u.exec(r))&&(!t||t.index+t[0].length!==r.length);)(!t||p.index+p[0].length!==t.index+t[0].length)&&(t=p),u.lastIndex=p.index+p[1].length+p[2].length;u.lastIndex=-1}if(t===null)return null;let n=t[2],i=t[3]||"0",s=t[4]||"0",o=e.includePrerelease&&t[5]?`-${t[5]}`:"",c=e.includePrerelease&&t[6]?`+${t[6]}`:"";return Yc(`${n}.${i}.${s}${o}${c}`,e)};is.exports=Kc});var as=U((kd,os)=>{"use strict";var Xc=Qe(),Jc=wt(),Qc=me(),Zc=(r,e,t)=>{if(!Jc.RELEASE_TYPES.includes(e))return null;let n=el(r,t);return n&&tl(n,e)},el=(r,e)=>{let t=r instanceof Qc?r.version:r;return Xc(t,e)},tl=(r,e)=>{if(rl(e))return r.version;switch(r.prerelease=[],e){case"major":r.minor=0,r.patch=0;break;case"minor":r.patch=0;break}return r.format()},rl=r=>r.startsWith("pre");os.exports=Zc});var ls=U((Wd,cs)=>{"use strict";var Gr=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,t)}return this}};cs.exports=Gr});var Le=U((Hd,ps)=>{"use strict";var nl=/\s+/g,kr=class r{constructor(e,t){if(t=sl(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof Wr)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(nl," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!fs(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&hl(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let n=0;n<t.length;n++)n>0&&(this.formatted+=" "),this.formatted+=t[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(pl,"");let n=((this.options.includePrerelease&&fl)|(this.options.loose&&dl))+":"+e,i=us.get(n);if(i)return i;let s=this.options.loose,o=s?Ae[ge.HYPHENRANGELOOSE]:Ae[ge.HYPHENRANGE];e=e.replace(o,Cl(this.options.includePrerelease)),re("hyphen replace",e),e=e.replace(Ae[ge.COMPARATORTRIM],cl),re("comparator trim",e),e=e.replace(Ae[ge.TILDETRIM],ll),re("tilde trim",e),e=e.replace(Ae[ge.CARETTRIM],ul),re("caret trim",e);let c=e.split(" ").map(l=>ml(l,this.options)).join(" ").split(/\s+/).map(l=>Sl(l,this.options));s&&(c=c.filter(l=>(re("loose invalid filter",l,this.options),!!l.match(Ae[ge.COMPARATORLOOSE])))),re("range list",c);let u=new Map,p=c.map(l=>new Wr(l,this.options));for(let l of p){if(fs(l))return[l];u.set(l.value,l)}u.size>1&&u.has("")&&u.delete("");let h=[...u.values()];return us.set(n,h),h}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(n=>ds(n,t)&&e.set.some(i=>ds(i,t)&&n.every(s=>i.every(o=>s.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new ol(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(xl(this.set[t],e,this.options))return!0;return!1}};ps.exports=kr;var il=ls(),us=new il,sl=Zt(),Wr=qt(),re=Tt(),ol=me(),{safeRe:Ae,src:al,t:ge,comparatorTrimReplace:cl,tildeTrimReplace:ll,caretTrimReplace:ul}=Ot(),{FLAG_INCLUDE_PRERELEASE:fl,FLAG_LOOSE:dl}=wt(),pl=new RegExp(al[ge.BUILD],"g"),fs=r=>r.value==="<0.0.0-0",hl=r=>r.value==="",ds=(r,e)=>{let t=!0,n=r.slice(),i=n.pop();for(;t&&n.length;)t=n.every(s=>i.intersects(s,e)),i=n.pop();return t},ml=(r,e)=>(r=r.replace(Ae[ge.BUILD],""),re("comp",r,e),r=El(r,e),re("caret",r),r=yl(r,e),re("tildes",r),r=Ol(r,e),re("xrange",r),r=_l(r,e),re("stars",r),r),de=r=>!r||r.toLowerCase()==="x"||r==="*",gl=(r,e,t)=>de(r)&&!de(e)||de(e)&&t&&!de(t),yl=(r,e)=>r.trim().split(/\s+/).map(t=>bl(t,e)).join(" "),bl=(r,e)=>{let t=e.loose?Ae[ge.TILDELOOSE]:Ae[ge.TILDE],n=e.includePrerelease?"-0":"";return r.replace(t,(i,s,o,c,u)=>{re("tilde",r,i,s,o,c,u);let p;return de(s)?p="":de(o)?p=`>=${s}.0.0${n} <${+s+1}.0.0-0`:de(c)?p=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`:u?(re("replaceTilde pr",u),p=`>=${s}.${o}.${c}-${u} <${s}.${+o+1}.0-0`):p=`>=${s}.${o}.${c} <${s}.${+o+1}.0-0`,re("tilde return",p),p})},El=(r,e)=>r.trim().split(/\s+/).map(t=>wl(t,e)).join(" "),wl=(r,e)=>{re("caret",r,e);let t=e.loose?Ae[ge.CARETLOOSE]:Ae[ge.CARET],n=e.includePrerelease?"-0":"";return r.replace(t,(i,s,o,c,u)=>{re("caret",r,i,s,o,c,u);let p;return de(s)?p="":de(o)?p=`>=${s}.0.0${n} <${+s+1}.0.0-0`:de(c)?s==="0"?p=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`:p=`>=${s}.${o}.0${n} <${+s+1}.0.0-0`:u?(re("replaceCaret pr",u),s==="0"?o==="0"?p=`>=${s}.${o}.${c}-${u} <${s}.${o}.${+c+1}-0`:p=`>=${s}.${o}.${c}-${u} <${s}.${+o+1}.0-0`:p=`>=${s}.${o}.${c}-${u} <${+s+1}.0.0-0`):(re("no pr"),s==="0"?o==="0"?p=`>=${s}.${o}.${c} <${s}.${o}.${+c+1}-0`:p=`>=${s}.${o}.${c} <${s}.${+o+1}.0-0`:p=`>=${s}.${o}.${c} <${+s+1}.0.0-0`),re("caret return",p),p})},Ol=(r,e)=>(re("replaceXRanges",r,e),r.split(/\s+/).map(t=>Al(t,e)).join(" ")),Al=(r,e)=>{r=r.trim();let t=e.loose?Ae[ge.XRANGELOOSE]:Ae[ge.XRANGE];return r.replace(t,(n,i,s,o,c,u)=>{if(re("xRange",r,n,i,s,o,c,u),gl(s,o,c))return r;let p=de(s),h=p||de(o),l=h||de(c),b=l;return i==="="&&b&&(i=""),u=e.includePrerelease?"-0":"",p?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&b?(h&&(o=0),c=0,i===">"?(i=">=",h?(s=+s+1,o=0,c=0):(o=+o+1,c=0)):i==="<="&&(i="<",h?s=+s+1:o=+o+1),i==="<"&&(u="-0"),n=`${i+s}.${o}.${c}${u}`):h?n=`>=${s}.0.0${u} <${+s+1}.0.0-0`:l&&(n=`>=${s}.${o}.0${u} <${s}.${+o+1}.0-0`),re("xRange return",n),n})},_l=(r,e)=>(re("replaceStars",r,e),r.trim().replace(Ae[ge.STAR],"")),Sl=(r,e)=>(re("replaceGTE0",r,e),r.trim().replace(Ae[e.includePrerelease?ge.GTE0PRE:ge.GTE0],"")),Cl=r=>(e,t,n,i,s,o,c,u,p,h,l,b)=>(de(n)?t="":de(i)?t=`>=${n}.0.0${r?"-0":""}`:de(s)?t=`>=${n}.${i}.0${r?"-0":""}`:o?t=`>=${t}`:t=`>=${t}${r?"-0":""}`,de(p)?u="":de(h)?u=`<${+p+1}.0.0-0`:de(l)?u=`<${p}.${+h+1}.0-0`:b?u=`<=${p}.${h}.${l}-${b}`:r?u=`<${p}.${h}.${+l+1}-0`:u=`<=${u}`,`${t} ${u}`.trim()),xl=(r,e,t)=>{for(let n=0;n<r.length;n++)if(!r[n].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let n=0;n<r.length;n++)if(re(r[n].semver),r[n].semver!==Wr.ANY&&r[n].semver.prerelease.length>0){let i=r[n].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var qt=U((Vd,Es)=>{"use strict";var Mt=Symbol("SemVer ANY"),Br=class r{static get ANY(){return Mt}constructor(e,t){if(t=hs(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Vr("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Mt?this.value="":this.value=this.operator+this.semver.version,Vr("comp",this)}parse(e){let t=this.options.loose?ms[gs.COMPARATORLOOSE]:ms[gs.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new ys(n[2],this.options.loose):this.semver=Mt}toString(){return this.value}test(e){if(Vr("Comparator.test",e,this.options.loose),this.semver===Mt||e===Mt)return!0;if(typeof e=="string")try{e=new ys(e,this.options)}catch{return!1}return Hr(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new bs(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new bs(this.value,t).test(e.semver):(t=hs(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Hr(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Hr(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Es.exports=Br;var hs=Zt(),{safeRe:ms,t:gs}=Ot(),Hr=zr(),Vr=Tt(),ys=me(),bs=Le()});var Ft=U((Bd,ws)=>{"use strict";var Rl=Le(),vl=(r,e,t)=>{try{e=new Rl(e,t)}catch{return!1}return e.test(r)};ws.exports=vl});var As=U((Yd,Os)=>{"use strict";var jl=Le(),$l=(r,e)=>new jl(r,e).set.map(t=>t.map(n=>n.value).join(" ").trim().split(" "));Os.exports=$l});var Ss=U((Kd,_s)=>{"use strict";var Il=me(),Pl=Le(),Ll=(r,e,t)=>{let n=null,i=null,s=null;try{s=new Pl(e,t)}catch{return null}return r.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new Il(n,t))}),n};_s.exports=Ll});var xs=U((Xd,Cs)=>{"use strict";var Nl=me(),Tl=Le(),Dl=(r,e,t)=>{let n=null,i=null,s=null;try{s=new Tl(e,t)}catch{return null}return r.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new Nl(n,t))}),n};Cs.exports=Dl});var js=U((Jd,vs)=>{"use strict";var Yr=me(),ql=Le(),Rs=Dt(),Ml=(r,e)=>{r=new ql(r,e);let t=new Yr("0.0.0");if(r.test(t)||(t=new Yr("0.0.0-0"),r.test(t)))return t;t=null;for(let n=0;n<r.set.length;++n){let i=r.set[n],s=null;i.forEach(o=>{let c=new Yr(o.semver.version);switch(o.operator){case">":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!s||Rs(c,s))&&(s=c);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!t||Rs(t,s))&&(t=s)}return t&&r.test(t)?t:null};vs.exports=Ml});var Is=U((Qd,$s)=>{"use strict";var Fl=Le(),Ul=(r,e)=>{try{return new Fl(r,e).range||"*"}catch{return null}};$s.exports=Ul});var ur=U((Zd,Ts)=>{"use strict";var zl=me(),Ns=qt(),{ANY:Gl}=Ns,kl=Le(),Wl=Ft(),Ps=Dt(),Ls=sr(),Hl=ar(),Vl=or(),Bl=(r,e,t,n)=>{r=new zl(r,n),e=new kl(e,n);let i,s,o,c,u;switch(t){case">":i=Ps,s=Hl,o=Ls,c=">",u=">=";break;case"<":i=Ls,s=Vl,o=Ps,c="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Wl(r,e,n))return!1;for(let p=0;p<e.set.length;++p){let h=e.set[p],l=null,b=null;if(h.forEach(g=>{g.semver===Gl&&(g=new Ns(">=0.0.0")),l=l||g,b=b||g,i(g.semver,l.semver,n)?l=g:o(g.semver,b.semver,n)&&(b=g)}),l.operator===c||l.operator===u||(!b.operator||b.operator===c)&&s(r,b.semver))return!1;if(b.operator===u&&o(r,b.semver))return!1}return!0};Ts.exports=Bl});var qs=U((ep,Ds)=>{"use strict";var Yl=ur(),Kl=(r,e,t)=>Yl(r,e,">",t);Ds.exports=Kl});var Fs=U((tp,Ms)=>{"use strict";var Xl=ur(),Jl=(r,e,t)=>Xl(r,e,"<",t);Ms.exports=Jl});var Gs=U((rp,zs)=>{"use strict";var Us=Le(),Ql=(r,e,t)=>(r=new Us(r,t),e=new Us(e,t),r.intersects(e,t));zs.exports=Ql});var Ws=U((np,ks)=>{"use strict";var Zl=Ft(),eu=Pe();ks.exports=(r,e,t)=>{let n=[],i=null,s=null,o=r.sort((h,l)=>eu(h,l,t));for(let h of o)Zl(h,e,t)?(s=h,i||(i=h)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);let c=[];for(let[h,l]of n)h===l?c.push(h):!l&&h===o[0]?c.push("*"):l?h===o[0]?c.push(`<=${l}`):c.push(`${h} - ${l}`):c.push(`>=${h}`);let u=c.join(" || "),p=typeof e.raw=="string"?e.raw:String(e);return u.length<p.length?u:e}});var Xs=U((ip,Ks)=>{"use strict";var Hs=Le(),Jr=qt(),{ANY:Kr}=Jr,Xr=Ft(),Qr=Pe(),tu=(r,e,t={})=>{if(r===e)return!0;r=new Hs(r,t),e=new Hs(e,t);let n=!1;e:for(let i of r.set){for(let s of e.set){let o=nu(i,s,t);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},ru=[new Jr(">=0.0.0-0")],Vs=[new Jr(">=0.0.0")],nu=(r,e,t)=>{if(r===e)return!0;if(r.length===1&&r[0].semver===Kr){if(e.length===1&&e[0].semver===Kr)return!0;t.includePrerelease?r=ru:r=Vs}if(e.length===1&&e[0].semver===Kr){if(t.includePrerelease)return!0;e=Vs}let n=new Set,i,s;for(let g of r)g.operator===">"||g.operator===">="?i=Bs(i,g,t):g.operator==="<"||g.operator==="<="?s=Ys(s,g,t):n.add(g.semver);if(n.size>1)return null;let o;if(i&&s){if(o=Qr(i.semver,s.semver,t),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let g of n){if(i&&!Xr(g,String(i),t)||s&&!Xr(g,String(s),t))return null;for(let w of e)if(!Xr(g,String(w),t))return!1;return!0}let c,u,p,h,l=s&&!t.includePrerelease&&s.semver.prerelease.length?s.semver:!1,b=i&&!t.includePrerelease&&i.semver.prerelease.length?i.semver:!1;l&&l.prerelease.length===1&&s.operator==="<"&&l.prerelease[0]===0&&(l=!1);for(let g of e){if(h=h||g.operator===">"||g.operator===">=",p=p||g.operator==="<"||g.operator==="<=",i){if(b&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===b.major&&g.semver.minor===b.minor&&g.semver.patch===b.patch&&(b=!1),g.operator===">"||g.operator===">="){if(c=Bs(i,g,t),c===g&&c!==i)return!1}else if(i.operator===">="&&!g.test(i.semver))return!1}if(s){if(l&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===l.major&&g.semver.minor===l.minor&&g.semver.patch===l.patch&&(l=!1),g.operator==="<"||g.operator==="<="){if(u=Ys(s,g,t),u===g&&u!==s)return!1}else if(s.operator==="<="&&!g.test(s.semver))return!1}if(!g.operator&&(s||i)&&o!==0)return!1}return!(i&&p&&!s&&o!==0||s&&h&&!i&&o!==0||b||l)},Bs=(r,e,t)=>{if(!r)return e;let n=Qr(r.semver,e.semver,t);return n>0?r:n<0||e.operator===">"&&r.operator===">="?e:r},Ys=(r,e,t)=>{if(!r)return e;let n=Qr(r.semver,e.semver,t);return n<0?r:n>0||e.operator==="<"&&r.operator==="<="?e:r};Ks.exports=tu});var fr=U((sp,Zs)=>{"use strict";var Zr=Ot(),Js=wt(),iu=me(),Qs=Dr(),su=Qe(),ou=Ai(),au=Si(),cu=Ri(),lu=$i(),uu=Pi(),fu=Ni(),du=Di(),pu=Mi(),hu=Pe(),mu=Gi(),gu=Wi(),yu=ir(),bu=Yi(),Eu=Xi(),wu=Dt(),Ou=sr(),Au=Fr(),_u=Ur(),Su=or(),Cu=ar(),xu=zr(),Ru=ss(),vu=as(),ju=qt(),$u=Le(),Iu=Ft(),Pu=As(),Lu=Ss(),Nu=xs(),Tu=js(),Du=Is(),qu=ur(),Mu=qs(),Fu=Fs(),Uu=Gs(),zu=Ws(),Gu=Xs();Zs.exports={parse:su,valid:ou,clean:au,inc:cu,diff:lu,major:uu,minor:fu,patch:du,prerelease:pu,compare:hu,rcompare:mu,compareLoose:gu,compareBuild:yu,sort:bu,rsort:Eu,gt:wu,lt:Ou,eq:Au,neq:_u,gte:Su,lte:Cu,cmp:xu,coerce:Ru,truncate:vu,Comparator:ju,Range:$u,satisfies:Iu,toComparators:Pu,maxSatisfying:Lu,minSatisfying:Nu,minVersion:Tu,validRange:Du,outside:qu,gtr:Mu,ltr:Fu,intersects:Uu,simplifyRange:zu,subset:Gu,SemVer:iu,re:Zr.re,src:Zr.src,tokens:Zr.t,SEMVER_SPEC_VERSION:Js.SEMVER_SPEC_VERSION,RELEASE_TYPES:Js.RELEASE_TYPES,compareIdentifiers:Qs.compareIdentifiers,rcompareIdentifiers:Qs.rcompareIdentifiers}});var dr=Lt(fr(),1);import*as Ut from"node:process";try{let r=ti?.node;typeof r=="string"&&!dr.satisfies(Ut.version,r)&&K.warn(`
9
+ \u26A0\uFE0F Warning: failed to satisfy expected node version. Expected: "${r}", Current "${Ut.version}"
10
10
 
11
- `),fr.major(Ft.version)===20&&K.info(Xt([Vn(Bn("Deprecation warning: Node.js 20 support is ending")),"","Node.js 20 reached end-of-life on April 30, 2026.","Future Redocly CLI releases require Node.js 22.12.0 or later.",`You are using Node.js ${Ft.version}.`,"",`Update Node.js: ${Lt("https://nodejs.org/en/download")}`]))}catch{}var Pa=Pt(Na(),1);import*as La from"node:path";import{notStrictEqual as pf,strictEqual as hf}from"assert";var ku={right:Yu,center:Ku},Wu=0,dr=1,Hu=2,pr=3,en=class{constructor(e){var t;this.width=e.width,this.wrap=(t=e.wrap)!==null&&t!==void 0?t:!0,this.rows=[]}span(...e){let t=this.div(...e);t.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]=="string")return this.applyLayoutDSL(e[0]);let t=e.map(n=>typeof n=="string"?this.colFromString(n):n);return this.rows.push(t),t}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]=="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){let t=e.split(`
11
+ `),dr.major(Ut.version)===20&&K.info(Jt([Vn(Bn("Deprecation warning: Node.js 20 support is ending")),"","Node.js 20 reached end-of-life on April 30, 2026.","Future Redocly CLI releases require Node.js 22.12.0 or later.",`You are using Node.js ${Ut.version}.`,"",`Update Node.js: ${Nt("https://nodejs.org/en/download")}`]))}catch{}var Pa=Lt(Na(),1);import*as La from"node:path";import{notStrictEqual as pf,strictEqual as hf}from"assert";var ku={right:Yu,center:Ku},Wu=0,pr=1,Hu=2,hr=3,en=class{constructor(e){var t;this.width=e.width,this.wrap=(t=e.wrap)!==null&&t!==void 0?t:!0,this.rows=[]}span(...e){let t=this.div(...e);t.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]=="string")return this.applyLayoutDSL(e[0]);let t=e.map(n=>typeof n=="string"?this.colFromString(n):n);return this.rows.push(t),t}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]=="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){let t=e.split(`
12
12
  `).map(i=>i.split(" ")),n=0;return t.forEach(i=>{i.length>1&&Re.stringWidth(i[0])>n&&(n=Math.min(Math.floor(this.width*.5),Re.stringWidth(i[0])))}),t.forEach(i=>{this.div(...i.map((s,o)=>({text:s.trim(),padding:this.measurePadding(s),width:o===0&&i.length>1?n:void 0})))}),this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){let t=Re.stripAnsi(e);return[0,t.match(/\s*$/)[0].length,0,t.match(/^\s*/)[0].length]}toString(){let e=[];return this.rows.forEach(t=>{this.rowToString(t,e)}),e.filter(t=>!t.hidden).map(t=>t.text).join(`
13
- `)}rowToString(e,t){return this.rasterize(e).forEach((n,i)=>{let s="";n.forEach((o,c)=>{let{width:u}=e[c],p=this.negatePadding(e[c]),h=o;if(p>Re.stringWidth(o)&&(h+=" ".repeat(p-Re.stringWidth(o))),e[c].align&&e[c].align!=="left"&&this.wrap){let b=ku[e[c].align];h=b(h,p),Re.stringWidth(h)<p&&(h+=" ".repeat((u||0)-Re.stringWidth(h)-1))}let l=e[c].padding||[0,0,0,0];l[pr]&&(s+=" ".repeat(l[pr])),s+=eo(e[c],h,"| "),s+=h,s+=eo(e[c],h," |"),l[dr]&&(s+=" ".repeat(l[dr])),i===0&&t.length>0&&(s=this.renderInline(s,t[t.length-1]))}),t.push({text:s.replace(/ +$/,""),span:e.span})}),t}renderInline(e,t){let n=e.match(/^ */),i=n?n[0].length:0,s=t.text,o=Re.stringWidth(s.trimRight());return t.span?this.wrap?i<o?e:(t.hidden=!0,s.trimRight()+" ".repeat(i-o)+e.trimLeft()):(t.hidden=!0,s+e):e}rasterize(e){let t=[],n=this.columnWidths(e),i;return e.forEach((s,o)=>{s.width=n[o],this.wrap?i=Re.wrap(s.text,this.negatePadding(s),{hard:!0}).split(`
13
+ `)}rowToString(e,t){return this.rasterize(e).forEach((n,i)=>{let s="";n.forEach((o,c)=>{let{width:u}=e[c],p=this.negatePadding(e[c]),h=o;if(p>Re.stringWidth(o)&&(h+=" ".repeat(p-Re.stringWidth(o))),e[c].align&&e[c].align!=="left"&&this.wrap){let b=ku[e[c].align];h=b(h,p),Re.stringWidth(h)<p&&(h+=" ".repeat((u||0)-Re.stringWidth(h)-1))}let l=e[c].padding||[0,0,0,0];l[hr]&&(s+=" ".repeat(l[hr])),s+=eo(e[c],h,"| "),s+=h,s+=eo(e[c],h," |"),l[pr]&&(s+=" ".repeat(l[pr])),i===0&&t.length>0&&(s=this.renderInline(s,t[t.length-1]))}),t.push({text:s.replace(/ +$/,""),span:e.span})}),t}renderInline(e,t){let n=e.match(/^ */),i=n?n[0].length:0,s=t.text,o=Re.stringWidth(s.trimRight());return t.span?this.wrap?i<o?e:(t.hidden=!0,s.trimRight()+" ".repeat(i-o)+e.trimLeft()):(t.hidden=!0,s+e):e}rasterize(e){let t=[],n=this.columnWidths(e),i;return e.forEach((s,o)=>{s.width=n[o],this.wrap?i=Re.wrap(s.text,this.negatePadding(s),{hard:!0}).split(`
14
14
  `):i=s.text.split(`
15
- `),s.border&&(i.unshift("."+"-".repeat(this.negatePadding(s)+2)+"."),i.push("'"+"-".repeat(this.negatePadding(s)+2)+"'")),s.padding&&(i.unshift(...new Array(s.padding[Wu]||0).fill("")),i.push(...new Array(s.padding[Hu]||0).fill(""))),i.forEach((c,u)=>{t[u]||t.push([]);let p=t[u];for(let h=0;h<o;h++)p[h]===void 0&&p.push("");p.push(c)})}),t}negatePadding(e){let t=e.width||0;return e.padding&&(t-=(e.padding[pr]||0)+(e.padding[dr]||0)),e.border&&(t-=4),t}columnWidths(e){if(!this.wrap)return e.map(o=>o.width||Re.stringWidth(o.text));let t=e.length,n=this.width,i=e.map(o=>{if(o.width)return t--,n-=o.width,o.width}),s=t?Math.floor(n/t):0;return i.map((o,c)=>o===void 0?Math.max(s,Vu(e[c])):o)}};function eo(r,e,t){return r.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?t:" ":""}function Vu(r){let e=r.padding||[],t=1+(e[pr]||0)+(e[dr]||0);return r.border?t+4:t}function Bu(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function Yu(r,e){r=r.trim();let t=Re.stringWidth(r);return t<e?" ".repeat(e-t)+r:r}function Ku(r,e){r=r.trim();let t=Re.stringWidth(r);return t>=e?r:" ".repeat(e-t>>1)+r}var Re;function to(r,e){return Re=e,new en({width:r?.width||Bu(),wrap:r?.wrap})}var ro=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function tn(r){return r.replace(ro,"")}function no(r,e){let[t,n]=r.match(ro)||["",""];r=tn(r);let i="";for(let s=0;s<r.length;s++)s!==0&&s%e===0&&(i+=`
16
- `),i+=r.charAt(s);return t&&n&&(i=`${t}${i}${n}`),i}function rn(r){return to(r,{stringWidth:e=>[...e].length,stripAnsi:tn,wrap:no})}import{dirname as io,resolve as so}from"path";import{readdirSync as Xu,statSync as Ju}from"fs";function oo(r,e){let t=so(".",r),n;for(Ju(t).isDirectory()||(t=io(t));;){if(n=e(t,Xu(t)),n)return so(t,n);if(t=io(n=t),n===t)break}}import{inspect as mf}from"util";import{readFileSync as gf}from"fs";import{fileURLToPath as Eo}from"url";import{format as Zu}from"util";import{readFileSync as ef}from"fs";import{normalize as tf,resolve as rf}from"path";function ot(r){if(r!==r.toLowerCase()&&r!==r.toUpperCase()||(r=r.toLowerCase()),r.indexOf("-")===-1&&r.indexOf("_")===-1)return r;{let t="",n=!1,i=r.match(/^-+/);for(let s=i?i[0].length:0;s<r.length;s++){let o=r.charAt(s);n&&(n=!1,o=o.toUpperCase()),s!==0&&(o==="-"||o==="_")?n=!0:o!=="-"&&o!=="_"&&(t+=o)}return t}}function hr(r,e){let t=r.toLowerCase();e=e||"-";let n="";for(let i=0;i<r.length;i++){let s=t.charAt(i),o=r.charAt(i);s!==o&&i>0?n+=`${e}${t.charAt(i)}`:n+=o}return n}function mr(r){return r==null?!1:typeof r=="number"||/^0x[0-9a-f]+$/i.test(r)?!0:/^0[^.]/.test(r)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(r)}function ao(r){if(Array.isArray(r))return r.map(o=>typeof o!="string"?o+"":o);r=r.trim();let e=0,t=null,n=null,i=null,s=[];for(let o=0;o<r.length;o++){if(t=n,n=r.charAt(o),n===" "&&!i){t!==" "&&e++;continue}n===i?i=null:(n==="'"||n==='"')&&!i&&(i=n),s[e]||(s[e]=""),s[e]+=n}return s}var Ne;(function(r){r.BOOLEAN="boolean",r.STRING="string",r.NUMBER="number",r.ARRAY="array"})(Ne||(Ne={}));var Ve,gr=class{constructor(e){Ve=e}parse(e,t){let n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},t),i=ao(e),s=Qu(Object.assign(Object.create(null),n.alias)),o=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),c=Object.assign(Object.create(null),n.default),u=n.configObjects||[],p=n.envPrefix,h=o["populate--"],l=h?"--":"_",b=Object.create(null),g=Object.create(null),w=n.__||Ve.format,d={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},S=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,N=new RegExp("^--"+o["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach(function(f){let m=typeof f=="object"?f.key:f,O=Object.keys(f).map(function(E){return{boolean:"bools",string:"strings",number:"numbers"}[E]}).filter(Boolean).pop();O&&(d[O][m]=!0),d.arrays[m]=!0,d.keys.push(m)}),[].concat(n.boolean||[]).filter(Boolean).forEach(function(f){d.bools[f]=!0,d.keys.push(f)}),[].concat(n.string||[]).filter(Boolean).forEach(function(f){d.strings[f]=!0,d.keys.push(f)}),[].concat(n.number||[]).filter(Boolean).forEach(function(f){d.numbers[f]=!0,d.keys.push(f)}),[].concat(n.count||[]).filter(Boolean).forEach(function(f){d.counts[f]=!0,d.keys.push(f)}),[].concat(n.normalize||[]).filter(Boolean).forEach(function(f){d.normalize[f]=!0,d.keys.push(f)}),typeof n.narg=="object"&&Object.entries(n.narg).forEach(([f,m])=>{typeof m=="number"&&(d.nargs[f]=m,d.keys.push(f))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([f,m])=>{typeof m=="function"&&(d.coercions[f]=m,d.keys.push(f))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(f){d.configs[f]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([f,m])=>{(typeof m=="boolean"||typeof m=="function")&&(d.configs[f]=m)})),It(n.key,s,n.default,d.arrays),Object.keys(c).forEach(function(f){(d.aliases[f]||[]).forEach(function(m){c[m]=c[f]})});let A=null;Ir();let G=[],W=Object.assign(Object.create(null),{_:[]}),xe={};for(let f=0;f<i.length;f++){let m=i[f],O=m.replace(/^-{3,}/,"---"),E,y,R,v,q,pe;if(m!=="--"&&Q(m))Ye(m);else if(O.match(/---+(=|$)/)){Ye(m);continue}else if(m.match(/^--.+=/)||!o["short-option-groups"]&&m.match(/^-.+=/))v=m.match(/^--?([^=]+)=([\s\S]*)$/),v!==null&&Array.isArray(v)&&v.length>=3&&(T(v[1],d.arrays)?f=Xe(f,v[1],i,v[2]):T(v[1],d.nargs)!==!1?f=Ke(f,v[1],i,v[2]):V(v[1],v[2]));else if(m.match(N)&&o["boolean-negation"])v=m.match(N),v!==null&&Array.isArray(v)&&v.length>=2&&(y=v[1],V(y,T(y,d.arrays)?[!1]:!1));else if(m.match(/^--.+/)||!o["short-option-groups"]&&m.match(/^-[^-]+/))v=m.match(/^--?(.+)/),v!==null&&Array.isArray(v)&&v.length>=2&&(y=v[1],T(y,d.arrays)?f=Xe(f,y,i):T(y,d.nargs)!==!1?f=Ke(f,y,i):(q=i[f+1],q!==void 0&&(!q.match(/^-/)||q.match(S))&&!T(y,d.bools)&&!T(y,d.counts)||/^(true|false)$/.test(q)?(V(y,q),f++):V(y,B(y))));else if(m.match(/^-.\..+=/))v=m.match(/^-([^=]+)=([\s\S]*)$/),v!==null&&Array.isArray(v)&&v.length>=3&&V(v[1],v[2]);else if(m.match(/^-.\..+/)&&!m.match(S))q=i[f+1],v=m.match(/^-(.\..+)/),v!==null&&Array.isArray(v)&&v.length>=2&&(y=v[1],q!==void 0&&!q.match(/^-/)&&!T(y,d.bools)&&!T(y,d.counts)?(V(y,q),f++):V(y,B(y)));else if(m.match(/^-[^-]+/)&&!m.match(S)){R=m.slice(1,-1).split(""),E=!1;for(let Ee=0;Ee<R.length;Ee++){if(q=m.slice(Ee+2),R[Ee+1]&&R[Ee+1]==="="){pe=m.slice(Ee+3),y=R[Ee],T(y,d.arrays)?f=Xe(f,y,i,pe):T(y,d.nargs)!==!1?f=Ke(f,y,i,pe):V(y,pe),E=!0;break}if(q==="-"){V(R[Ee],q);continue}if(/[A-Za-z]/.test(R[Ee])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(q)&&T(q,d.bools)===!1){V(R[Ee],q),E=!0;break}if(R[Ee+1]&&R[Ee+1].match(/\W/)){V(R[Ee],q),E=!0;break}else V(R[Ee],B(R[Ee]))}y=m.slice(-1)[0],!E&&y!=="-"&&(T(y,d.arrays)?f=Xe(f,y,i):T(y,d.nargs)!==!1?f=Ke(f,y,i):(q=i[f+1],q!==void 0&&(!/^(-|--)[^-]/.test(q)||q.match(S))&&!T(y,d.bools)&&!T(y,d.counts)||/^(true|false)$/.test(q)?(V(y,q),f++):V(y,B(y))))}else if(m.match(/^-[0-9]$/)&&m.match(S)&&T(m.slice(1),d.bools))y=m.slice(1),V(y,B(y));else if(m==="--"){G=i.slice(f+1);break}else if(o["halt-at-non-option"]){G=i.slice(f);break}else Ye(m)}se(W,!0),se(W,!1),L(W),ee(),Je(W,d.aliases,c,!0),Y(W),o["set-placeholder-key"]&&ue(W),Object.keys(d.counts).forEach(function(f){Z(W,f.split("."))||V(f,0)}),h&&G.length&&(W[l]=[]),G.forEach(function(f){W[l].push(f)}),o["camel-case-expansion"]&&o["strip-dashed"]&&Object.keys(W).filter(f=>f!=="--"&&f.includes("-")).forEach(f=>{delete W[f]}),o["strip-aliased"]&&[].concat(...Object.keys(s).map(f=>s[f])).forEach(f=>{o["camel-case-expansion"]&&f.includes("-")&&delete W[f.split(".").map(m=>ot(m)).join(".")],delete W[f]});function Ye(f){let m=_("_",f);(typeof m=="string"||typeof m=="number")&&W._.push(m)}function Ke(f,m,O,E){let y,R=T(m,d.nargs);if(R=typeof R!="number"||isNaN(R)?1:R,R===0)return fe(E)||(A=Error(w("Argument unexpected for: %s",m))),V(m,B(m)),f;let v=fe(E)?0:1;if(o["nargs-eats-options"])O.length-(f+1)+v<R&&(A=Error(w("Not enough arguments following: %s",m))),v=R;else{for(y=f+1;y<O.length&&(!O[y].match(/^-[^0-9]/)||O[y].match(S)||Q(O[y]));y++)v++;v<R&&(A=Error(w("Not enough arguments following: %s",m)))}let q=Math.min(v,R);for(!fe(E)&&q>0&&(V(m,E),q--),y=f+1;y<q+f+1;y++)V(m,O[y]);return f+q}function Xe(f,m,O,E){let y=[],R=E||O[f+1],v=T(m,d.nargs);if(T(m,d.bools)&&!/^(true|false)$/.test(R))y.push(!0);else if(fe(R)||fe(E)&&/^-/.test(R)&&!S.test(R)&&!Q(R)){if(c[m]!==void 0){let q=c[m];y=Array.isArray(q)?q:[q]}}else{fe(E)||y.push($(m,E));for(let q=f+1;q<O.length&&!(!o["greedy-arrays"]&&y.length>0||v&&typeof v=="number"&&y.length>=v||(R=O[q],/^-/.test(R)&&!S.test(R)&&!Q(R)));q++)f=q,y.push($(m,R))}return typeof v=="number"&&(v&&y.length<v||isNaN(v)&&y.length===0)&&(A=Error(w("Not enough arguments following: %s",m))),V(m,y),f}function V(f,m){if(/-/.test(f)&&o["camel-case-expansion"]){let y=f.split(".").map(function(R){return ot(R)}).join(".");We(f,y)}let O=$(f,m),E=f.split(".");He(W,E,O),d.aliases[f]&&d.aliases[f].forEach(function(y){let R=y.split(".");He(W,R,O)}),E.length>1&&o["dot-notation"]&&(d.aliases[E[0]]||[]).forEach(function(y){let R=y.split("."),v=[].concat(E);v.shift(),R=R.concat(v),(d.aliases[f]||[]).includes(R.join("."))||He(W,R,O)}),T(f,d.normalize)&&!T(f,d.arrays)&&[f].concat(d.aliases[f]||[]).forEach(function(R){Object.defineProperty(xe,R,{enumerable:!0,get(){return m},set(v){m=typeof v=="string"?Ve.normalize(v):v}})})}function We(f,m){d.aliases[f]&&d.aliases[f].length||(d.aliases[f]=[m],b[m]=!0),d.aliases[m]&&d.aliases[m].length||We(m,f)}function $(f,m){typeof m=="string"&&(m[0]==="'"||m[0]==='"')&&m[m.length-1]===m[0]&&(m=m.substring(1,m.length-1)),(T(f,d.bools)||T(f,d.counts))&&typeof m=="string"&&(m=m==="true");let O=Array.isArray(m)?m.map(function(E){return _(f,E)}):_(f,m);return T(f,d.counts)&&(fe(O)||typeof O=="boolean")&&(O=nn()),T(f,d.normalize)&&T(f,d.arrays)&&(Array.isArray(m)?O=m.map(E=>Ve.normalize(E)):O=Ve.normalize(m)),O}function _(f,m){return!o["parse-positional-numbers"]&&f==="_"||!T(f,d.strings)&&!T(f,d.bools)&&!Array.isArray(m)&&(mr(m)&&o["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${m}`)))||!fe(m)&&T(f,d.numbers))&&(m=Number(m)),m}function L(f){let m=Object.create(null);Je(m,d.aliases,c),Object.keys(d.configs).forEach(function(O){let E=f[O]||m[O];if(E)try{let y=null,R=Ve.resolve(Ve.cwd(),E),v=d.configs[O];if(typeof v=="function"){try{y=v(R)}catch(q){y=q}if(y instanceof Error){A=y;return}}else y=Ve.require(R);F(y)}catch(y){y.name==="PermissionDenied"?A=y:f[O]&&(A=Error(w("Invalid JSON config file: %s",E)))}})}function F(f,m){Object.keys(f).forEach(function(O){let E=f[O],y=m?m+"."+O:O;typeof E=="object"&&E!==null&&!Array.isArray(E)&&o["dot-notation"]?F(E,y):(!Z(W,y.split("."))||T(y,d.arrays)&&o["combine-arrays"])&&V(y,E)})}function ee(){typeof u<"u"&&u.forEach(function(f){F(f)})}function se(f,m){if(typeof p>"u")return;let O=typeof p=="string"?p:"",E=Ve.env();Object.keys(E).forEach(function(y){if(O===""||y.lastIndexOf(O,0)===0){let R=y.split("__").map(function(v,q){return q===0&&(v=v.substring(O.length)),ot(v)});(m&&d.configs[R.join(".")]||!m)&&!Z(f,R)&&V(R.join("."),E[y])}})}function Y(f){let m,O=new Set;Object.keys(f).forEach(function(E){if(!O.has(E)&&(m=T(E,d.coercions),typeof m=="function"))try{let y=_(E,m(f[E]));[].concat(d.aliases[E]||[],E).forEach(R=>{O.add(R),f[R]=y})}catch(y){A=y}})}function ue(f){return d.keys.forEach(m=>{~m.indexOf(".")||typeof f[m]>"u"&&(f[m]=void 0)}),f}function Je(f,m,O,E=!1){Object.keys(O).forEach(function(y){Z(f,y.split("."))||(He(f,y.split("."),O[y]),E&&(g[y]=!0),(m[y]||[]).forEach(function(R){Z(f,R.split("."))||He(f,R.split("."),O[y])}))})}function Z(f,m){let O=f;o["dot-notation"]||(m=[m.join(".")]),m.slice(0,-1).forEach(function(y){O=O[y]||{}});let E=m[m.length-1];return typeof O!="object"?!1:E in O}function He(f,m,O){let E=f;o["dot-notation"]||(m=[m.join(".")]),m.slice(0,-1).forEach(function(pe){pe=co(pe),typeof E=="object"&&E[pe]===void 0&&(E[pe]={}),typeof E[pe]!="object"||Array.isArray(E[pe])?(Array.isArray(E[pe])?E[pe].push({}):E[pe]=[E[pe],{}],E=E[pe][E[pe].length-1]):E=E[pe]});let y=co(m[m.length-1]),R=T(m.join("."),d.arrays),v=Array.isArray(O),q=o["duplicate-arguments-array"];!q&&T(y,d.nargs)&&(q=!0,(!fe(E[y])&&d.nargs[y]===1||Array.isArray(E[y])&&E[y].length===d.nargs[y])&&(E[y]=void 0)),O===nn()?E[y]=nn(E[y]):Array.isArray(E[y])?q&&R&&v?E[y]=o["flatten-duplicate-arrays"]?E[y].concat(O):(Array.isArray(E[y][0])?E[y]:[E[y]]).concat([O]):!q&&!!R==!!v?E[y]=O:E[y]=E[y].concat([O]):E[y]===void 0&&R?E[y]=v?O:[O]:q&&!(E[y]===void 0||T(y,d.counts)||T(y,d.bools))?E[y]=[E[y],O]:E[y]=O}function It(...f){f.forEach(function(m){Object.keys(m||{}).forEach(function(O){d.aliases[O]||(d.aliases[O]=[].concat(s[O]||[]),d.aliases[O].concat(O).forEach(function(E){if(/-/.test(E)&&o["camel-case-expansion"]){let y=ot(E);y!==O&&d.aliases[O].indexOf(y)===-1&&(d.aliases[O].push(y),b[y]=!0)}}),d.aliases[O].concat(O).forEach(function(E){if(E.length>1&&/[A-Z]/.test(E)&&o["camel-case-expansion"]){let y=hr(E,"-");y!==O&&d.aliases[O].indexOf(y)===-1&&(d.aliases[O].push(y),b[y]=!0)}}),d.aliases[O].forEach(function(E){d.aliases[E]=[O].concat(d.aliases[O].filter(function(y){return E!==y}))}))})})}function T(f,m){let O=[].concat(d.aliases[f]||[],f),E=Object.keys(m),y=O.find(R=>E.includes(R));return y?m[y]:!1}function Et(f){let m=Object.keys(d);return[].concat(m.map(E=>d[E])).some(function(E){return Array.isArray(E)?E.includes(f):E[f]})}function Un(f,...m){return[].concat(...m).some(function(E){let y=f.match(E);return y&&Et(y[1])})}function D(f){if(f.match(S)||!f.match(/^-[^-]+/))return!1;let m=!0,O,E=f.slice(1).split("");for(let y=0;y<E.length;y++){if(O=f.slice(y+2),!Et(E[y])){m=!1;break}if(E[y+1]&&E[y+1]==="="||O==="-"||/[A-Za-z]/.test(E[y])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(O)||E[y+1]&&E[y+1].match(/\W/))break}return m}function Q(f){return o["unknown-options-as-args"]&&X(f)}function X(f){return f=f.replace(/^-{3,}/,"--"),f.match(S)||D(f)?!1:!Un(f,/^-+([^=]+?)=[\s\S]*$/,N,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function B(f){return!T(f,d.bools)&&!T(f,d.counts)&&`${f}`in c?c[f]:le(Se(f))}function le(f){return{[Ne.BOOLEAN]:!0,[Ne.STRING]:"",[Ne.NUMBER]:void 0,[Ne.ARRAY]:[]}[f]}function Se(f){let m=Ne.BOOLEAN;return T(f,d.strings)?m=Ne.STRING:T(f,d.numbers)?m=Ne.NUMBER:T(f,d.bools)?m=Ne.BOOLEAN:T(f,d.arrays)&&(m=Ne.ARRAY),m}function fe(f){return f===void 0}function Ir(){Object.keys(d.counts).find(f=>T(f,d.arrays)?(A=Error(w("Invalid configuration: %s, opts.count excludes opts.array.",f)),!0):T(f,d.nargs)?(A=Error(w("Invalid configuration: %s, opts.count excludes opts.narg.",f)),!0):!1)}return{aliases:Object.assign({},d.aliases),argv:Object.assign(xe,W),configuration:o,defaulted:Object.assign({},g),error:A,newAliases:Object.assign({},b)}}};function Qu(r){let e=[],t=Object.create(null),n=!0;for(Object.keys(r).forEach(function(i){e.push([].concat(r[i],i))});n;){n=!1;for(let i=0;i<e.length;i++)for(let s=i+1;s<e.length;s++)if(e[i].filter(function(c){return e[s].indexOf(c)!==-1}).length){e[i]=e[i].concat(e[s]),e.splice(s,1),n=!0;break}}return e.forEach(function(i){i=i.filter(function(o,c,u){return u.indexOf(o)===c});let s=i.pop();s!==void 0&&typeof s=="string"&&(t[s]=i)}),t}function nn(r){return r!==void 0?r+1:1}function co(r){return r==="__proto__"?"___proto___":r}var lo=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):10;if(process&&process.version&&Number(process.version.match(/v([^.]+)/)[1])<lo)throw Error(`yargs parser supports a minimum Node.js version of ${lo}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var nf=process?process.env:{},uo=new gr({cwd:process.cwd,env:()=>nf,format:Zu,normalize:tf,resolve:rf,require:r=>{if(typeof Ue<"u")return Ue(r);if(r.match(/\.json$/))return ef(r,"utf8");throw Error("only .json config files are supported in ESM")}}),zt=function(e,t){return uo.parse(e.slice(),t).argv};zt.detailed=function(r,e){return uo.parse(r.slice(),e)};zt.camelCase=ot;zt.decamelize=hr;zt.looksLikeNumber=mr;var sn=zt;import{basename as yf,dirname as bf,extname as Ef,relative as wf,resolve as yo}from"path";function fo(){return sf()?0:1}function sf(){return of()&&!process.defaultApp}function of(){return!!process.versions.electron}function on(r){return r.slice(fo()+1)}function po(){return process.argv[fo()]}var ne=class r extends Error{constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace(this,r)}};import{readFileSync as af,statSync as cf,writeFile as lf}from"fs";import{format as uf}from"util";import{resolve as ff}from"path";var ho={fs:{readFileSync:af,writeFile:lf},format:uf,resolve:ff,exists:r=>{try{return cf(r).isFile()}catch{return!1}}};var ze,an=class{constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles=typeof e.updateFiles=="boolean"?e.updateFiles:!0,this.locale=e.locale||"en",this.fallbackToLanguage=typeof e.fallbackToLanguage=="boolean"?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let t=e.shift(),n=function(){};return typeof e[e.length-1]=="function"&&(n=e.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]=t,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),ze.format.apply(ze.format,[this.cache[this.locale][t]||t].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),t=e.shift(),n=e.shift(),i=e.shift(),s=function(){};typeof e[e.length-1]=="function"&&(s=e.pop()),this.cache[this.locale]||this._readLocaleFile();let o=i===1?t:n;this.cache[this.locale][t]&&(o=this.cache[this.locale][t][i===1?"one":"other"]),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]={one:t,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let c=[o];return~o.indexOf("%d")&&c.push(i),ze.format.apply(ze.format,c.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this.cache[this.locale][t]=e[t])}_taggedLiteral(e,...t){let n="";return e.forEach(function(i,s){let o=t[s+1];n+=i,typeof o<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(t,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let e=this,t=this.writeQueue[0],n=t.directory,i=t.locale,s=t.cb,o=this._resolveLocaleFile(n,i),c=JSON.stringify(this.cache[i],null,2);ze.fs.writeFile(o,c,"utf-8",function(u){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),s(u)})}_readLocaleFile(){let e={},t=this._resolveLocaleFile(this.directory,this.locale);try{ze.fs.readFileSync&&(e=JSON.parse(ze.fs.readFileSync(t,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+t),n.code==="ENOENT")e={};else throw n}this.cache[this.locale]=e}_resolveLocaleFile(e,t){let n=ze.resolve(e,"./",t+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~t.lastIndexOf("_")){let i=ze.resolve(e,"./",t.split("_")[0]+".json");this._fileExistsSync(i)&&(n=i)}return n}_fileExistsSync(e){return ze.exists(e)}};function mo(r,e){ze=e;let t=new an(r);return{__:t.__.bind(t),__n:t.__n.bind(t),setLocale:t.setLocale.bind(t),getLocale:t.getLocale.bind(t),updateLocale:t.updateLocale.bind(t),locale:t.locale}}var df=r=>mo(r,ho),go=df;var Of="require is not supported by ESM",bo="loading a directory of commands is not supported yet for ESM",Af=Eo(import.meta.url).split("node_modules")[0],_f=Eo(import.meta.url),cn={assert:{notStrictEqual:pf,strictEqual:hf},cliui:rn,findUp:oo,getEnv:r=>process.env[r],inspect:mf,getCallerFile:()=>{throw new ne(bo)},getProcessArgvBin:po,mainFilename:Af||process.cwd(),Parser:sn,path:{basename:yf,dirname:bf,extname:Ef,relative:wf,resolve:yo},process:{argv:()=>process.argv,cwd:process.cwd,execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:gf,require:()=>{throw new ne(Of)},requireDirectory:()=>{throw new ne(bo)},stringWidth:r=>[...r].length,y18n:go({directory:yo(_f,"../../../locales"),updateFiles:!1})};function _e(r,e,t,n){t.assert.notStrictEqual(r,e,n)}function ln(r,e){e.assert.strictEqual(typeof r,"string")}function At(r){return Object.keys(r)}function ie(r){return!!r&&!!r.then&&typeof r.then=="function"}function Ze(r){let t=r.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,i=t.shift();if(!i)throw new Error(`No command found in: ${r}`);let s={cmd:i.replace(n,""),demanded:[],optional:[]};return t.forEach((o,c)=>{let u=!1;o=o.replace(/\s/g,""),/\.+[\]>]/.test(o)&&c===t.length-1&&(u=!0),/^\[/.test(o)?s.optional.push({cmd:o.replace(n,"").split("|"),variadic:u}):s.demanded.push({cmd:o.replace(n,"").split("|"),variadic:u})}),s}var Sf=["first","second","third","fourth","fifth","sixth"];function j(r,e,t){function n(){return typeof r=="object"?[{demanded:[],optional:[]},r,e]:[Ze(`cmd ${r}`),e,t]}try{let i=0,[s,o,c]=n(),u=[].slice.call(o);for(;u.length&&u[u.length-1]===void 0;)u.pop();let p=c||u.length;if(p<s.demanded.length)throw new ne(`Not enough arguments provided. Expected ${s.demanded.length} but received ${u.length}.`);let h=s.demanded.length+s.optional.length;if(p>h)throw new ne(`Too many arguments provided. Expected max ${h} but received ${p}.`);s.demanded.forEach(l=>{let b=u.shift(),g=wo(b);l.cmd.filter(d=>d===g||d==="*").length===0&&Oo(g,l.cmd,i),i+=1}),s.optional.forEach(l=>{if(u.length===0)return;let b=u.shift(),g=wo(b);l.cmd.filter(d=>d===g||d==="*").length===0&&Oo(g,l.cmd,i),i+=1})}catch(i){console.warn(i.stack)}}function wo(r){return Array.isArray(r)?"array":r===null?"null":typeof r}function Oo(r,e,t){throw new ne(`Invalid ${Sf[t]||"manyith"} argument. Expected ${e.join(" or ")} but received ${r}.`)}var yr=class{constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,t,n=!0){if(j("<array|function> [boolean] [boolean]",[e,t,n],arguments.length),Array.isArray(e)){for(let i=0;i<e.length;i++){if(typeof e[i]!="function")throw Error("middleware must be a function");let s=e[i];s.applyBeforeValidation=t,s.global=n}Array.prototype.push.apply(this.globalMiddleware,e)}else if(typeof e=="function"){let i=e;i.applyBeforeValidation=t,i.global=n,this.globalMiddleware.push(e)}return this.yargs}addCoerceMiddleware(e,t){let n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(i=>{let s=[...n[t]||[],t];return i.option?!s.includes(i.option):!0}),e.option=t,this.addMiddleware(e,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let e=this.frozens.pop();e!==void 0&&(this.globalMiddleware=e)}reset(){this.globalMiddleware=this.globalMiddleware.filter(e=>e.global)}};function Ao(r){return r?r.map(e=>(e.applyBeforeValidation=!1,e)):[]}function at(r,e,t,n){return t.reduce((i,s)=>{if(s.applyBeforeValidation!==n)return i;if(ie(i))return i.then(o=>Promise.all([o,s(o,e)])).then(([o,c])=>Object.assign(o,c));{let o=s(i,e);return ie(o)?o.then(c=>Object.assign(i,c)):Object.assign(i,o)}},r)}function ct(r,e,t=n=>{throw n}){try{let n=Cf(r)?r():r;return ie(n)?n.then(i=>e(i)):e(n)}catch(n){return t(n)}}function Cf(r){return typeof r=="function"}function un(r){if(typeof Ue>"u")return null;for(let e=0,t=Object.keys(Ue.cache),n;e<t.length;e++)if(n=Ue.cache[t[e]],n.exports===r)return n;return null}var _t=/(^\*)|(^\$0)/,fn=class{constructor(e,t,n,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=e,this.globalMiddleware=n,this.validation=t}addDirectory(e,t,n,i){i=i||{},typeof i.recurse!="boolean"&&(i.recurse=!1),Array.isArray(i.extensions)||(i.extensions=["js"]);let s=typeof i.visit=="function"?i.visit:o=>o;i.visit=(o,c,u)=>{let p=s(o,c,u);if(p){if(this.requireCache.has(c))return p;this.requireCache.add(c),this.addHandler(p)}return p},this.shim.requireDirectory({require:t,filename:n},e,i)}addHandler(e,t,n,i,s,o){let c=[],u=Ao(s);if(i=i||(()=>{}),Array.isArray(e))if(xf(e))[e,...c]=e;else for(let p of e)this.addHandler(p);else if(vf(e)){let p=Array.isArray(e.command)||typeof e.command=="string"?e.command:this.moduleName(e);e.aliases&&(p=[].concat(p).concat(e.aliases)),this.addHandler(p,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(_o(n)){this.addHandler([e].concat(c),t,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e=="string"){let p=Ze(e);c=c.map(b=>Ze(b).cmd);let h=!1,l=[p.cmd].concat(c).filter(b=>_t.test(b)?(h=!0,!1):!0);l.length===0&&h&&l.push("$0"),h&&(p.cmd=l[0],c=l.slice(1),e=e.replace(_t,p.cmd)),c.forEach(b=>{this.aliasMap[b]=p.cmd}),t!==!1&&this.usage.command(e,t,h,c,o),this.handlers[p.cmd]={original:e,description:t,handler:i,builder:n||{},middlewares:u,deprecated:o,demanded:p.demanded,optional:p.optional},h&&(this.defaultCommand=this.handlers[p.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,t,n,i,s,o){let c=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,u=t.getInternalMethods().getContext(),p=u.commands.slice(),h=!e;e&&(u.commands.push(e),u.fullCommands.push(c.original));let l=this.applyBuilderUpdateUsageAndParse(h,c,t,n.aliases,p,i,s,o);return ie(l)?l.then(b=>this.applyMiddlewareAndGetResult(h,c,b.innerArgv,u,s,b.aliases,t)):this.applyMiddlewareAndGetResult(h,c,l.innerArgv,u,s,l.aliases,t)}applyBuilderUpdateUsageAndParse(e,t,n,i,s,o,c,u){let p=t.builder,h=n;if(br(p)){let l=p(n.getInternalMethods().reset(i),u);if(ie(l))return l.then(b=>(h=Co(b)?b:n,this.parseAndUpdateUsage(e,t,h,s,o,c)))}else Rf(p)&&(h=n.getInternalMethods().reset(i),Object.keys(t.builder).forEach(l=>{h.option(l,p[l])}));return this.parseAndUpdateUsage(e,t,h,s,o,c)}parseAndUpdateUsage(e,t,n,i,s,o){e&&n.getInternalMethods().getUsageInstance().unfreeze(),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,t),t.description);let c=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,o);return ie(c)?c.then(u=>({aliases:n.parsed.aliases,innerArgv:u})):{aliases:n.parsed.aliases,innerArgv:c}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,t){let n=_t.test(t.original)?t.original.replace(_t,"").trim():t.original,i=e.filter(s=>!_t.test(s));return i.push(n),`$0 ${i.join(" ")}`}applyMiddlewareAndGetResult(e,t,n,i,s,o,c){let u={};if(s)return n;c.getInternalMethods().getHasOutput()||(u=this.populatePositionals(t,n,i,c));let p=this.globalMiddleware.getMiddleware().slice(0).concat(t.middlewares);if(n=at(n,c,p,!0),!c.getInternalMethods().getHasOutput()){let h=c.getInternalMethods().runValidation(o,u,c.parsed.error,e);n=ct(n,l=>(h(l),l))}if(t.handler&&!c.getInternalMethods().getHasOutput()){c.getInternalMethods().setHasOutput();let h=!!c.getOptions().configuration["populate--"];c.getInternalMethods().postProcess(n,h,!1,!1),n=at(n,c,p,!1),n=ct(n,l=>{let b=t.handler(l);return ie(b)?b.then(()=>l):l}),e||c.getInternalMethods().getUsageInstance().cacheHelpMessage(),ie(n)&&!c.getInternalMethods().hasParseCallback()&&n.catch(l=>{try{c.getInternalMethods().getUsageInstance().fail(null,l)}catch{}})}return e||(i.commands.pop(),i.fullCommands.pop()),n}populatePositionals(e,t,n,i){t._=t._.slice(n.commands.length);let s=e.demanded.slice(0),o=e.optional.slice(0),c={};for(this.validation.positionalCount(s.length,t._.length);s.length;){let u=s.shift();this.populatePositional(u,t,c)}for(;o.length;){let u=o.shift();this.populatePositional(u,t,c)}return t._=n.commands.concat(t._.map(u=>""+u)),this.postProcessPositionals(t,c,this.cmdToParseOptions(e.original),i),c}populatePositional(e,t,n){let i=e.cmd[0];e.variadic?n[i]=t._.splice(0).map(String):t._.length&&(n[i]=[String(t._.shift())])}cmdToParseOptions(e){let t={array:[],default:{},alias:{},demand:{}},n=Ze(e);return n.demanded.forEach(i=>{let[s,...o]=i.cmd;i.variadic&&(t.array.push(s),t.default[s]=[]),t.alias[s]=o,t.demand[s]=!0}),n.optional.forEach(i=>{let[s,...o]=i.cmd;i.variadic&&(t.array.push(s),t.default[s]=[]),t.alias[s]=o}),t}postProcessPositionals(e,t,n,i){let s=Object.assign({},i.getOptions());s.default=Object.assign(n.default,s.default);for(let p of Object.keys(n.alias))s.alias[p]=(s.alias[p]||[]).concat(n.alias[p]);s.array=s.array.concat(n.array),s.config={};let o=[];if(Object.keys(t).forEach(p=>{t[p].map(h=>{s.configuration["unknown-options-as-args"]&&(s.key[p]=!0),o.push(`--${p}`),o.push(h)})}),!o.length)return;let c=Object.assign({},s.configuration,{"populate--":!1}),u=this.shim.Parser.detailed(o,Object.assign({},s,{configuration:c}));if(u.error)i.getInternalMethods().getUsageInstance().fail(u.error.message,u.error);else{let p=Object.keys(t);Object.keys(t).forEach(h=>{p.push(...u.aliases[h])}),Object.keys(u.argv).forEach(h=>{p.indexOf(h)!==-1&&(t[h]||(t[h]=u.argv[h]),e[h]=u.argv[h])})}}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){let n=_t.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}let t=this.defaultCommand.builder;if(br(t))return t(e,!0);_o(t)||Object.keys(t).forEach(n=>{e.option(n,t[n])})}moduleName(e){let t=un(e);if(!t)throw new Error(`No command name given for module: ${this.shim.inspect(e)}`);return this.commandFromFilename(t.filename)}commandFromFilename(e){return this.shim.path.basename(e,this.shim.path.extname(e))}extractDesc({describe:e,description:t,desc:n}){for(let i of[e,t,n]){if(typeof i=="string"||i===!1)return i;_e(i,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let e=this.frozens.pop();_e(e,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function So(r,e,t,n){return new fn(r,e,t,n)}function _o(r){return typeof r=="object"&&!!r.builder&&typeof r.handler=="function"}function xf(r){return r.every(e=>typeof e=="string")}function br(r){return typeof r=="function"}function Rf(r){return typeof r=="object"}function vf(r){return typeof r=="object"&&!Array.isArray(r)}function et(r={},e=()=>!0){let t={};return At(r).forEach(n=>{e(n,r[n])&&(t[n]=r[n])}),t}function tt(r){typeof process>"u"||[process.stdout,process.stderr].forEach(e=>{let t=e;t._handle&&t.isTTY&&typeof t._handle.setBlocking=="function"&&t._handle.setBlocking(r)})}function jf(r){return typeof r=="boolean"}function Ro(r,e){let t=e.y18n.__,n={},i=[];n.failFn=function(_){i.push(_)};let s=null,o=!0;n.showHelpOnFail=function(_=!0,L){function F(){return typeof _=="string"?[!0,_]:[_,L]}let[ee,se]=F();return s=se,o=ee,n};let c=!1;n.fail=function(_,L){let F=r.getInternalMethods().getLoggerInstance();if(i.length)for(let ee=i.length-1;ee>=0;--ee){let se=i[ee];if(jf(se)){if(L)throw L;if(_)throw Error(_)}else se(_,L,n)}else{if(r.getExitProcess()&&tt(!0),c||(c=!0,o&&(r.showHelp("error"),F.error()),(_||L)&&F.error(_||L),s&&((_||L)&&F.error(""),F.error(s))),L=L||new ne(_),r.getExitProcess())return r.exit(1);if(r.getInternalMethods().hasParseCallback())return r.exit(1,L);throw L}};let u=[],p=!1;n.usage=($,_)=>$===null?(p=!0,u=[],n):(p=!1,u.push([$,_||""]),n),n.getUsage=()=>u,n.getUsageDisabled=()=>p,n.getPositionalGroupName=()=>t("Positionals:");let h=[];n.example=($,_)=>{h.push([$,_||""])};let l=[];n.command=function(_,L,F,ee,se=!1){F&&(l=l.map(Y=>(Y[2]=!1,Y))),l.push([_,L||"",F,ee,se])},n.getCommands=()=>l;let b={};n.describe=function(_,L){Array.isArray(_)?_.forEach(F=>{n.describe(F,L)}):typeof _=="object"?Object.keys(_).forEach(F=>{n.describe(F,_[F])}):b[_]=L},n.getDescriptions=()=>b;let g=[];n.epilog=$=>{g.push($)};let w=!1,d;n.wrap=$=>{w=!0,d=$};function S(){return w||(d=Xe(),w=!0),d}let N="__yargsString__:";n.deferY18nLookup=$=>N+$,n.help=function(){if(W)return W;G();let _=r.customScriptName?r.$0:e.path.basename(r.$0),L=r.getDemandedOptions(),F=r.getDemandedCommands(),ee=r.getDeprecatedOptions(),se=r.getGroups(),Y=r.getOptions(),ue=[];ue=ue.concat(Object.keys(b)),ue=ue.concat(Object.keys(L)),ue=ue.concat(Object.keys(F)),ue=ue.concat(Object.keys(Y.default)),ue=ue.filter(Ye),ue=Object.keys(ue.reduce((D,Q)=>(Q!=="_"&&(D[Q]=!0),D),{}));let Je=S(),Z=e.cliui({width:Je,wrap:!!Je});if(!p){if(u.length)u.forEach(D=>{Z.div(`${D[0].replace(/\$0/g,_)}`),D[1]&&Z.div({text:`${D[1]}`,padding:[1,0,0,0]})}),Z.div();else if(l.length){let D=null;F._?D=`${_} <${t("command")}>
15
+ `),s.border&&(i.unshift("."+"-".repeat(this.negatePadding(s)+2)+"."),i.push("'"+"-".repeat(this.negatePadding(s)+2)+"'")),s.padding&&(i.unshift(...new Array(s.padding[Wu]||0).fill("")),i.push(...new Array(s.padding[Hu]||0).fill(""))),i.forEach((c,u)=>{t[u]||t.push([]);let p=t[u];for(let h=0;h<o;h++)p[h]===void 0&&p.push("");p.push(c)})}),t}negatePadding(e){let t=e.width||0;return e.padding&&(t-=(e.padding[hr]||0)+(e.padding[pr]||0)),e.border&&(t-=4),t}columnWidths(e){if(!this.wrap)return e.map(o=>o.width||Re.stringWidth(o.text));let t=e.length,n=this.width,i=e.map(o=>{if(o.width)return t--,n-=o.width,o.width}),s=t?Math.floor(n/t):0;return i.map((o,c)=>o===void 0?Math.max(s,Vu(e[c])):o)}};function eo(r,e,t){return r.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?t:" ":""}function Vu(r){let e=r.padding||[],t=1+(e[hr]||0)+(e[pr]||0);return r.border?t+4:t}function Bu(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function Yu(r,e){r=r.trim();let t=Re.stringWidth(r);return t<e?" ".repeat(e-t)+r:r}function Ku(r,e){r=r.trim();let t=Re.stringWidth(r);return t>=e?r:" ".repeat(e-t>>1)+r}var Re;function to(r,e){return Re=e,new en({width:r?.width||Bu(),wrap:r?.wrap})}var ro=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function tn(r){return r.replace(ro,"")}function no(r,e){let[t,n]=r.match(ro)||["",""];r=tn(r);let i="";for(let s=0;s<r.length;s++)s!==0&&s%e===0&&(i+=`
16
+ `),i+=r.charAt(s);return t&&n&&(i=`${t}${i}${n}`),i}function rn(r){return to(r,{stringWidth:e=>[...e].length,stripAnsi:tn,wrap:no})}import{dirname as io,resolve as so}from"path";import{readdirSync as Xu,statSync as Ju}from"fs";function oo(r,e){let t=so(".",r),n;for(Ju(t).isDirectory()||(t=io(t));;){if(n=e(t,Xu(t)),n)return so(t,n);if(t=io(n=t),n===t)break}}import{inspect as mf}from"util";import{readFileSync as gf}from"fs";import{fileURLToPath as Eo}from"url";import{format as Zu}from"util";import{readFileSync as ef}from"fs";import{normalize as tf,resolve as rf}from"path";function ot(r){if(r!==r.toLowerCase()&&r!==r.toUpperCase()||(r=r.toLowerCase()),r.indexOf("-")===-1&&r.indexOf("_")===-1)return r;{let t="",n=!1,i=r.match(/^-+/);for(let s=i?i[0].length:0;s<r.length;s++){let o=r.charAt(s);n&&(n=!1,o=o.toUpperCase()),s!==0&&(o==="-"||o==="_")?n=!0:o!=="-"&&o!=="_"&&(t+=o)}return t}}function mr(r,e){let t=r.toLowerCase();e=e||"-";let n="";for(let i=0;i<r.length;i++){let s=t.charAt(i),o=r.charAt(i);s!==o&&i>0?n+=`${e}${t.charAt(i)}`:n+=o}return n}function gr(r){return r==null?!1:typeof r=="number"||/^0x[0-9a-f]+$/i.test(r)?!0:/^0[^.]/.test(r)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(r)}function ao(r){if(Array.isArray(r))return r.map(o=>typeof o!="string"?o+"":o);r=r.trim();let e=0,t=null,n=null,i=null,s=[];for(let o=0;o<r.length;o++){if(t=n,n=r.charAt(o),n===" "&&!i){t!==" "&&e++;continue}n===i?i=null:(n==="'"||n==='"')&&!i&&(i=n),s[e]||(s[e]=""),s[e]+=n}return s}var Ne;(function(r){r.BOOLEAN="boolean",r.STRING="string",r.NUMBER="number",r.ARRAY="array"})(Ne||(Ne={}));var Ve,yr=class{constructor(e){Ve=e}parse(e,t){let n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},t),i=ao(e),s=Qu(Object.assign(Object.create(null),n.alias)),o=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),c=Object.assign(Object.create(null),n.default),u=n.configObjects||[],p=n.envPrefix,h=o["populate--"],l=h?"--":"_",b=Object.create(null),g=Object.create(null),w=n.__||Ve.format,d={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},S=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,N=new RegExp("^--"+o["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach(function(f){let m=typeof f=="object"?f.key:f,O=Object.keys(f).map(function(E){return{boolean:"bools",string:"strings",number:"numbers"}[E]}).filter(Boolean).pop();O&&(d[O][m]=!0),d.arrays[m]=!0,d.keys.push(m)}),[].concat(n.boolean||[]).filter(Boolean).forEach(function(f){d.bools[f]=!0,d.keys.push(f)}),[].concat(n.string||[]).filter(Boolean).forEach(function(f){d.strings[f]=!0,d.keys.push(f)}),[].concat(n.number||[]).filter(Boolean).forEach(function(f){d.numbers[f]=!0,d.keys.push(f)}),[].concat(n.count||[]).filter(Boolean).forEach(function(f){d.counts[f]=!0,d.keys.push(f)}),[].concat(n.normalize||[]).filter(Boolean).forEach(function(f){d.normalize[f]=!0,d.keys.push(f)}),typeof n.narg=="object"&&Object.entries(n.narg).forEach(([f,m])=>{typeof m=="number"&&(d.nargs[f]=m,d.keys.push(f))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([f,m])=>{typeof m=="function"&&(d.coercions[f]=m,d.keys.push(f))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(f){d.configs[f]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([f,m])=>{(typeof m=="boolean"||typeof m=="function")&&(d.configs[f]=m)})),Pt(n.key,s,n.default,d.arrays),Object.keys(c).forEach(function(f){(d.aliases[f]||[]).forEach(function(m){c[m]=c[f]})});let A=null;Ir();let G=[],W=Object.assign(Object.create(null),{_:[]}),xe={};for(let f=0;f<i.length;f++){let m=i[f],O=m.replace(/^-{3,}/,"---"),E,y,R,v,q,pe;if(m!=="--"&&Q(m))Ye(m);else if(O.match(/---+(=|$)/)){Ye(m);continue}else if(m.match(/^--.+=/)||!o["short-option-groups"]&&m.match(/^-.+=/))v=m.match(/^--?([^=]+)=([\s\S]*)$/),v!==null&&Array.isArray(v)&&v.length>=3&&(T(v[1],d.arrays)?f=Xe(f,v[1],i,v[2]):T(v[1],d.nargs)!==!1?f=Ke(f,v[1],i,v[2]):V(v[1],v[2]));else if(m.match(N)&&o["boolean-negation"])v=m.match(N),v!==null&&Array.isArray(v)&&v.length>=2&&(y=v[1],V(y,T(y,d.arrays)?[!1]:!1));else if(m.match(/^--.+/)||!o["short-option-groups"]&&m.match(/^-[^-]+/))v=m.match(/^--?(.+)/),v!==null&&Array.isArray(v)&&v.length>=2&&(y=v[1],T(y,d.arrays)?f=Xe(f,y,i):T(y,d.nargs)!==!1?f=Ke(f,y,i):(q=i[f+1],q!==void 0&&(!q.match(/^-/)||q.match(S))&&!T(y,d.bools)&&!T(y,d.counts)||/^(true|false)$/.test(q)?(V(y,q),f++):V(y,B(y))));else if(m.match(/^-.\..+=/))v=m.match(/^-([^=]+)=([\s\S]*)$/),v!==null&&Array.isArray(v)&&v.length>=3&&V(v[1],v[2]);else if(m.match(/^-.\..+/)&&!m.match(S))q=i[f+1],v=m.match(/^-(.\..+)/),v!==null&&Array.isArray(v)&&v.length>=2&&(y=v[1],q!==void 0&&!q.match(/^-/)&&!T(y,d.bools)&&!T(y,d.counts)?(V(y,q),f++):V(y,B(y)));else if(m.match(/^-[^-]+/)&&!m.match(S)){R=m.slice(1,-1).split(""),E=!1;for(let Ee=0;Ee<R.length;Ee++){if(q=m.slice(Ee+2),R[Ee+1]&&R[Ee+1]==="="){pe=m.slice(Ee+3),y=R[Ee],T(y,d.arrays)?f=Xe(f,y,i,pe):T(y,d.nargs)!==!1?f=Ke(f,y,i,pe):V(y,pe),E=!0;break}if(q==="-"){V(R[Ee],q);continue}if(/[A-Za-z]/.test(R[Ee])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(q)&&T(q,d.bools)===!1){V(R[Ee],q),E=!0;break}if(R[Ee+1]&&R[Ee+1].match(/\W/)){V(R[Ee],q),E=!0;break}else V(R[Ee],B(R[Ee]))}y=m.slice(-1)[0],!E&&y!=="-"&&(T(y,d.arrays)?f=Xe(f,y,i):T(y,d.nargs)!==!1?f=Ke(f,y,i):(q=i[f+1],q!==void 0&&(!/^(-|--)[^-]/.test(q)||q.match(S))&&!T(y,d.bools)&&!T(y,d.counts)||/^(true|false)$/.test(q)?(V(y,q),f++):V(y,B(y))))}else if(m.match(/^-[0-9]$/)&&m.match(S)&&T(m.slice(1),d.bools))y=m.slice(1),V(y,B(y));else if(m==="--"){G=i.slice(f+1);break}else if(o["halt-at-non-option"]){G=i.slice(f);break}else Ye(m)}se(W,!0),se(W,!1),L(W),ee(),Je(W,d.aliases,c,!0),Y(W),o["set-placeholder-key"]&&ue(W),Object.keys(d.counts).forEach(function(f){Z(W,f.split("."))||V(f,0)}),h&&G.length&&(W[l]=[]),G.forEach(function(f){W[l].push(f)}),o["camel-case-expansion"]&&o["strip-dashed"]&&Object.keys(W).filter(f=>f!=="--"&&f.includes("-")).forEach(f=>{delete W[f]}),o["strip-aliased"]&&[].concat(...Object.keys(s).map(f=>s[f])).forEach(f=>{o["camel-case-expansion"]&&f.includes("-")&&delete W[f.split(".").map(m=>ot(m)).join(".")],delete W[f]});function Ye(f){let m=_("_",f);(typeof m=="string"||typeof m=="number")&&W._.push(m)}function Ke(f,m,O,E){let y,R=T(m,d.nargs);if(R=typeof R!="number"||isNaN(R)?1:R,R===0)return fe(E)||(A=Error(w("Argument unexpected for: %s",m))),V(m,B(m)),f;let v=fe(E)?0:1;if(o["nargs-eats-options"])O.length-(f+1)+v<R&&(A=Error(w("Not enough arguments following: %s",m))),v=R;else{for(y=f+1;y<O.length&&(!O[y].match(/^-[^0-9]/)||O[y].match(S)||Q(O[y]));y++)v++;v<R&&(A=Error(w("Not enough arguments following: %s",m)))}let q=Math.min(v,R);for(!fe(E)&&q>0&&(V(m,E),q--),y=f+1;y<q+f+1;y++)V(m,O[y]);return f+q}function Xe(f,m,O,E){let y=[],R=E||O[f+1],v=T(m,d.nargs);if(T(m,d.bools)&&!/^(true|false)$/.test(R))y.push(!0);else if(fe(R)||fe(E)&&/^-/.test(R)&&!S.test(R)&&!Q(R)){if(c[m]!==void 0){let q=c[m];y=Array.isArray(q)?q:[q]}}else{fe(E)||y.push($(m,E));for(let q=f+1;q<O.length&&!(!o["greedy-arrays"]&&y.length>0||v&&typeof v=="number"&&y.length>=v||(R=O[q],/^-/.test(R)&&!S.test(R)&&!Q(R)));q++)f=q,y.push($(m,R))}return typeof v=="number"&&(v&&y.length<v||isNaN(v)&&y.length===0)&&(A=Error(w("Not enough arguments following: %s",m))),V(m,y),f}function V(f,m){if(/-/.test(f)&&o["camel-case-expansion"]){let y=f.split(".").map(function(R){return ot(R)}).join(".");We(f,y)}let O=$(f,m),E=f.split(".");He(W,E,O),d.aliases[f]&&d.aliases[f].forEach(function(y){let R=y.split(".");He(W,R,O)}),E.length>1&&o["dot-notation"]&&(d.aliases[E[0]]||[]).forEach(function(y){let R=y.split("."),v=[].concat(E);v.shift(),R=R.concat(v),(d.aliases[f]||[]).includes(R.join("."))||He(W,R,O)}),T(f,d.normalize)&&!T(f,d.arrays)&&[f].concat(d.aliases[f]||[]).forEach(function(R){Object.defineProperty(xe,R,{enumerable:!0,get(){return m},set(v){m=typeof v=="string"?Ve.normalize(v):v}})})}function We(f,m){d.aliases[f]&&d.aliases[f].length||(d.aliases[f]=[m],b[m]=!0),d.aliases[m]&&d.aliases[m].length||We(m,f)}function $(f,m){typeof m=="string"&&(m[0]==="'"||m[0]==='"')&&m[m.length-1]===m[0]&&(m=m.substring(1,m.length-1)),(T(f,d.bools)||T(f,d.counts))&&typeof m=="string"&&(m=m==="true");let O=Array.isArray(m)?m.map(function(E){return _(f,E)}):_(f,m);return T(f,d.counts)&&(fe(O)||typeof O=="boolean")&&(O=nn()),T(f,d.normalize)&&T(f,d.arrays)&&(Array.isArray(m)?O=m.map(E=>Ve.normalize(E)):O=Ve.normalize(m)),O}function _(f,m){return!o["parse-positional-numbers"]&&f==="_"||!T(f,d.strings)&&!T(f,d.bools)&&!Array.isArray(m)&&(gr(m)&&o["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${m}`)))||!fe(m)&&T(f,d.numbers))&&(m=Number(m)),m}function L(f){let m=Object.create(null);Je(m,d.aliases,c),Object.keys(d.configs).forEach(function(O){let E=f[O]||m[O];if(E)try{let y=null,R=Ve.resolve(Ve.cwd(),E),v=d.configs[O];if(typeof v=="function"){try{y=v(R)}catch(q){y=q}if(y instanceof Error){A=y;return}}else y=Ve.require(R);F(y)}catch(y){y.name==="PermissionDenied"?A=y:f[O]&&(A=Error(w("Invalid JSON config file: %s",E)))}})}function F(f,m){Object.keys(f).forEach(function(O){let E=f[O],y=m?m+"."+O:O;typeof E=="object"&&E!==null&&!Array.isArray(E)&&o["dot-notation"]?F(E,y):(!Z(W,y.split("."))||T(y,d.arrays)&&o["combine-arrays"])&&V(y,E)})}function ee(){typeof u<"u"&&u.forEach(function(f){F(f)})}function se(f,m){if(typeof p>"u")return;let O=typeof p=="string"?p:"",E=Ve.env();Object.keys(E).forEach(function(y){if(O===""||y.lastIndexOf(O,0)===0){let R=y.split("__").map(function(v,q){return q===0&&(v=v.substring(O.length)),ot(v)});(m&&d.configs[R.join(".")]||!m)&&!Z(f,R)&&V(R.join("."),E[y])}})}function Y(f){let m,O=new Set;Object.keys(f).forEach(function(E){if(!O.has(E)&&(m=T(E,d.coercions),typeof m=="function"))try{let y=_(E,m(f[E]));[].concat(d.aliases[E]||[],E).forEach(R=>{O.add(R),f[R]=y})}catch(y){A=y}})}function ue(f){return d.keys.forEach(m=>{~m.indexOf(".")||typeof f[m]>"u"&&(f[m]=void 0)}),f}function Je(f,m,O,E=!1){Object.keys(O).forEach(function(y){Z(f,y.split("."))||(He(f,y.split("."),O[y]),E&&(g[y]=!0),(m[y]||[]).forEach(function(R){Z(f,R.split("."))||He(f,R.split("."),O[y])}))})}function Z(f,m){let O=f;o["dot-notation"]||(m=[m.join(".")]),m.slice(0,-1).forEach(function(y){O=O[y]||{}});let E=m[m.length-1];return typeof O!="object"?!1:E in O}function He(f,m,O){let E=f;o["dot-notation"]||(m=[m.join(".")]),m.slice(0,-1).forEach(function(pe){pe=co(pe),typeof E=="object"&&E[pe]===void 0&&(E[pe]={}),typeof E[pe]!="object"||Array.isArray(E[pe])?(Array.isArray(E[pe])?E[pe].push({}):E[pe]=[E[pe],{}],E=E[pe][E[pe].length-1]):E=E[pe]});let y=co(m[m.length-1]),R=T(m.join("."),d.arrays),v=Array.isArray(O),q=o["duplicate-arguments-array"];!q&&T(y,d.nargs)&&(q=!0,(!fe(E[y])&&d.nargs[y]===1||Array.isArray(E[y])&&E[y].length===d.nargs[y])&&(E[y]=void 0)),O===nn()?E[y]=nn(E[y]):Array.isArray(E[y])?q&&R&&v?E[y]=o["flatten-duplicate-arrays"]?E[y].concat(O):(Array.isArray(E[y][0])?E[y]:[E[y]]).concat([O]):!q&&!!R==!!v?E[y]=O:E[y]=E[y].concat([O]):E[y]===void 0&&R?E[y]=v?O:[O]:q&&!(E[y]===void 0||T(y,d.counts)||T(y,d.bools))?E[y]=[E[y],O]:E[y]=O}function Pt(...f){f.forEach(function(m){Object.keys(m||{}).forEach(function(O){d.aliases[O]||(d.aliases[O]=[].concat(s[O]||[]),d.aliases[O].concat(O).forEach(function(E){if(/-/.test(E)&&o["camel-case-expansion"]){let y=ot(E);y!==O&&d.aliases[O].indexOf(y)===-1&&(d.aliases[O].push(y),b[y]=!0)}}),d.aliases[O].concat(O).forEach(function(E){if(E.length>1&&/[A-Z]/.test(E)&&o["camel-case-expansion"]){let y=mr(E,"-");y!==O&&d.aliases[O].indexOf(y)===-1&&(d.aliases[O].push(y),b[y]=!0)}}),d.aliases[O].forEach(function(E){d.aliases[E]=[O].concat(d.aliases[O].filter(function(y){return E!==y}))}))})})}function T(f,m){let O=[].concat(d.aliases[f]||[],f),E=Object.keys(m),y=O.find(R=>E.includes(R));return y?m[y]:!1}function Et(f){let m=Object.keys(d);return[].concat(m.map(E=>d[E])).some(function(E){return Array.isArray(E)?E.includes(f):E[f]})}function zn(f,...m){return[].concat(...m).some(function(E){let y=f.match(E);return y&&Et(y[1])})}function D(f){if(f.match(S)||!f.match(/^-[^-]+/))return!1;let m=!0,O,E=f.slice(1).split("");for(let y=0;y<E.length;y++){if(O=f.slice(y+2),!Et(E[y])){m=!1;break}if(E[y+1]&&E[y+1]==="="||O==="-"||/[A-Za-z]/.test(E[y])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(O)||E[y+1]&&E[y+1].match(/\W/))break}return m}function Q(f){return o["unknown-options-as-args"]&&X(f)}function X(f){return f=f.replace(/^-{3,}/,"--"),f.match(S)||D(f)?!1:!zn(f,/^-+([^=]+?)=[\s\S]*$/,N,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function B(f){return!T(f,d.bools)&&!T(f,d.counts)&&`${f}`in c?c[f]:le(Se(f))}function le(f){return{[Ne.BOOLEAN]:!0,[Ne.STRING]:"",[Ne.NUMBER]:void 0,[Ne.ARRAY]:[]}[f]}function Se(f){let m=Ne.BOOLEAN;return T(f,d.strings)?m=Ne.STRING:T(f,d.numbers)?m=Ne.NUMBER:T(f,d.bools)?m=Ne.BOOLEAN:T(f,d.arrays)&&(m=Ne.ARRAY),m}function fe(f){return f===void 0}function Ir(){Object.keys(d.counts).find(f=>T(f,d.arrays)?(A=Error(w("Invalid configuration: %s, opts.count excludes opts.array.",f)),!0):T(f,d.nargs)?(A=Error(w("Invalid configuration: %s, opts.count excludes opts.narg.",f)),!0):!1)}return{aliases:Object.assign({},d.aliases),argv:Object.assign(xe,W),configuration:o,defaulted:Object.assign({},g),error:A,newAliases:Object.assign({},b)}}};function Qu(r){let e=[],t=Object.create(null),n=!0;for(Object.keys(r).forEach(function(i){e.push([].concat(r[i],i))});n;){n=!1;for(let i=0;i<e.length;i++)for(let s=i+1;s<e.length;s++)if(e[i].filter(function(c){return e[s].indexOf(c)!==-1}).length){e[i]=e[i].concat(e[s]),e.splice(s,1),n=!0;break}}return e.forEach(function(i){i=i.filter(function(o,c,u){return u.indexOf(o)===c});let s=i.pop();s!==void 0&&typeof s=="string"&&(t[s]=i)}),t}function nn(r){return r!==void 0?r+1:1}function co(r){return r==="__proto__"?"___proto___":r}var lo=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):10;if(process&&process.version&&Number(process.version.match(/v([^.]+)/)[1])<lo)throw Error(`yargs parser supports a minimum Node.js version of ${lo}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var nf=process?process.env:{},uo=new yr({cwd:process.cwd,env:()=>nf,format:Zu,normalize:tf,resolve:rf,require:r=>{if(typeof ze<"u")return ze(r);if(r.match(/\.json$/))return ef(r,"utf8");throw Error("only .json config files are supported in ESM")}}),zt=function(e,t){return uo.parse(e.slice(),t).argv};zt.detailed=function(r,e){return uo.parse(r.slice(),e)};zt.camelCase=ot;zt.decamelize=mr;zt.looksLikeNumber=gr;var sn=zt;import{basename as yf,dirname as bf,extname as Ef,relative as wf,resolve as yo}from"path";function fo(){return sf()?0:1}function sf(){return of()&&!process.defaultApp}function of(){return!!process.versions.electron}function on(r){return r.slice(fo()+1)}function po(){return process.argv[fo()]}var ne=class r extends Error{constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace(this,r)}};import{readFileSync as af,statSync as cf,writeFile as lf}from"fs";import{format as uf}from"util";import{resolve as ff}from"path";var ho={fs:{readFileSync:af,writeFile:lf},format:uf,resolve:ff,exists:r=>{try{return cf(r).isFile()}catch{return!1}}};var Ue,an=class{constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles=typeof e.updateFiles=="boolean"?e.updateFiles:!0,this.locale=e.locale||"en",this.fallbackToLanguage=typeof e.fallbackToLanguage=="boolean"?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let t=e.shift(),n=function(){};return typeof e[e.length-1]=="function"&&(n=e.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]=t,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),Ue.format.apply(Ue.format,[this.cache[this.locale][t]||t].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),t=e.shift(),n=e.shift(),i=e.shift(),s=function(){};typeof e[e.length-1]=="function"&&(s=e.pop()),this.cache[this.locale]||this._readLocaleFile();let o=i===1?t:n;this.cache[this.locale][t]&&(o=this.cache[this.locale][t][i===1?"one":"other"]),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]={one:t,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let c=[o];return~o.indexOf("%d")&&c.push(i),Ue.format.apply(Ue.format,c.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this.cache[this.locale][t]=e[t])}_taggedLiteral(e,...t){let n="";return e.forEach(function(i,s){let o=t[s+1];n+=i,typeof o<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(t,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let e=this,t=this.writeQueue[0],n=t.directory,i=t.locale,s=t.cb,o=this._resolveLocaleFile(n,i),c=JSON.stringify(this.cache[i],null,2);Ue.fs.writeFile(o,c,"utf-8",function(u){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),s(u)})}_readLocaleFile(){let e={},t=this._resolveLocaleFile(this.directory,this.locale);try{Ue.fs.readFileSync&&(e=JSON.parse(Ue.fs.readFileSync(t,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+t),n.code==="ENOENT")e={};else throw n}this.cache[this.locale]=e}_resolveLocaleFile(e,t){let n=Ue.resolve(e,"./",t+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~t.lastIndexOf("_")){let i=Ue.resolve(e,"./",t.split("_")[0]+".json");this._fileExistsSync(i)&&(n=i)}return n}_fileExistsSync(e){return Ue.exists(e)}};function mo(r,e){Ue=e;let t=new an(r);return{__:t.__.bind(t),__n:t.__n.bind(t),setLocale:t.setLocale.bind(t),getLocale:t.getLocale.bind(t),updateLocale:t.updateLocale.bind(t),locale:t.locale}}var df=r=>mo(r,ho),go=df;var Of="require is not supported by ESM",bo="loading a directory of commands is not supported yet for ESM",Af=Eo(import.meta.url).split("node_modules")[0],_f=Eo(import.meta.url),cn={assert:{notStrictEqual:pf,strictEqual:hf},cliui:rn,findUp:oo,getEnv:r=>process.env[r],inspect:mf,getCallerFile:()=>{throw new ne(bo)},getProcessArgvBin:po,mainFilename:Af||process.cwd(),Parser:sn,path:{basename:yf,dirname:bf,extname:Ef,relative:wf,resolve:yo},process:{argv:()=>process.argv,cwd:process.cwd,execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:gf,require:()=>{throw new ne(Of)},requireDirectory:()=>{throw new ne(bo)},stringWidth:r=>[...r].length,y18n:go({directory:yo(_f,"../../../locales"),updateFiles:!1})};function _e(r,e,t,n){t.assert.notStrictEqual(r,e,n)}function ln(r,e){e.assert.strictEqual(typeof r,"string")}function At(r){return Object.keys(r)}function ie(r){return!!r&&!!r.then&&typeof r.then=="function"}function Ze(r){let t=r.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,i=t.shift();if(!i)throw new Error(`No command found in: ${r}`);let s={cmd:i.replace(n,""),demanded:[],optional:[]};return t.forEach((o,c)=>{let u=!1;o=o.replace(/\s/g,""),/\.+[\]>]/.test(o)&&c===t.length-1&&(u=!0),/^\[/.test(o)?s.optional.push({cmd:o.replace(n,"").split("|"),variadic:u}):s.demanded.push({cmd:o.replace(n,"").split("|"),variadic:u})}),s}var Sf=["first","second","third","fourth","fifth","sixth"];function j(r,e,t){function n(){return typeof r=="object"?[{demanded:[],optional:[]},r,e]:[Ze(`cmd ${r}`),e,t]}try{let i=0,[s,o,c]=n(),u=[].slice.call(o);for(;u.length&&u[u.length-1]===void 0;)u.pop();let p=c||u.length;if(p<s.demanded.length)throw new ne(`Not enough arguments provided. Expected ${s.demanded.length} but received ${u.length}.`);let h=s.demanded.length+s.optional.length;if(p>h)throw new ne(`Too many arguments provided. Expected max ${h} but received ${p}.`);s.demanded.forEach(l=>{let b=u.shift(),g=wo(b);l.cmd.filter(d=>d===g||d==="*").length===0&&Oo(g,l.cmd,i),i+=1}),s.optional.forEach(l=>{if(u.length===0)return;let b=u.shift(),g=wo(b);l.cmd.filter(d=>d===g||d==="*").length===0&&Oo(g,l.cmd,i),i+=1})}catch(i){console.warn(i.stack)}}function wo(r){return Array.isArray(r)?"array":r===null?"null":typeof r}function Oo(r,e,t){throw new ne(`Invalid ${Sf[t]||"manyith"} argument. Expected ${e.join(" or ")} but received ${r}.`)}var br=class{constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,t,n=!0){if(j("<array|function> [boolean] [boolean]",[e,t,n],arguments.length),Array.isArray(e)){for(let i=0;i<e.length;i++){if(typeof e[i]!="function")throw Error("middleware must be a function");let s=e[i];s.applyBeforeValidation=t,s.global=n}Array.prototype.push.apply(this.globalMiddleware,e)}else if(typeof e=="function"){let i=e;i.applyBeforeValidation=t,i.global=n,this.globalMiddleware.push(e)}return this.yargs}addCoerceMiddleware(e,t){let n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(i=>{let s=[...n[t]||[],t];return i.option?!s.includes(i.option):!0}),e.option=t,this.addMiddleware(e,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let e=this.frozens.pop();e!==void 0&&(this.globalMiddleware=e)}reset(){this.globalMiddleware=this.globalMiddleware.filter(e=>e.global)}};function Ao(r){return r?r.map(e=>(e.applyBeforeValidation=!1,e)):[]}function at(r,e,t,n){return t.reduce((i,s)=>{if(s.applyBeforeValidation!==n)return i;if(ie(i))return i.then(o=>Promise.all([o,s(o,e)])).then(([o,c])=>Object.assign(o,c));{let o=s(i,e);return ie(o)?o.then(c=>Object.assign(i,c)):Object.assign(i,o)}},r)}function ct(r,e,t=n=>{throw n}){try{let n=Cf(r)?r():r;return ie(n)?n.then(i=>e(i)):e(n)}catch(n){return t(n)}}function Cf(r){return typeof r=="function"}function un(r){if(typeof ze>"u")return null;for(let e=0,t=Object.keys(ze.cache),n;e<t.length;e++)if(n=ze.cache[t[e]],n.exports===r)return n;return null}var _t=/(^\*)|(^\$0)/,fn=class{constructor(e,t,n,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=e,this.globalMiddleware=n,this.validation=t}addDirectory(e,t,n,i){i=i||{},typeof i.recurse!="boolean"&&(i.recurse=!1),Array.isArray(i.extensions)||(i.extensions=["js"]);let s=typeof i.visit=="function"?i.visit:o=>o;i.visit=(o,c,u)=>{let p=s(o,c,u);if(p){if(this.requireCache.has(c))return p;this.requireCache.add(c),this.addHandler(p)}return p},this.shim.requireDirectory({require:t,filename:n},e,i)}addHandler(e,t,n,i,s,o){let c=[],u=Ao(s);if(i=i||(()=>{}),Array.isArray(e))if(xf(e))[e,...c]=e;else for(let p of e)this.addHandler(p);else if(vf(e)){let p=Array.isArray(e.command)||typeof e.command=="string"?e.command:this.moduleName(e);e.aliases&&(p=[].concat(p).concat(e.aliases)),this.addHandler(p,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(_o(n)){this.addHandler([e].concat(c),t,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e=="string"){let p=Ze(e);c=c.map(b=>Ze(b).cmd);let h=!1,l=[p.cmd].concat(c).filter(b=>_t.test(b)?(h=!0,!1):!0);l.length===0&&h&&l.push("$0"),h&&(p.cmd=l[0],c=l.slice(1),e=e.replace(_t,p.cmd)),c.forEach(b=>{this.aliasMap[b]=p.cmd}),t!==!1&&this.usage.command(e,t,h,c,o),this.handlers[p.cmd]={original:e,description:t,handler:i,builder:n||{},middlewares:u,deprecated:o,demanded:p.demanded,optional:p.optional},h&&(this.defaultCommand=this.handlers[p.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,t,n,i,s,o){let c=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,u=t.getInternalMethods().getContext(),p=u.commands.slice(),h=!e;e&&(u.commands.push(e),u.fullCommands.push(c.original));let l=this.applyBuilderUpdateUsageAndParse(h,c,t,n.aliases,p,i,s,o);return ie(l)?l.then(b=>this.applyMiddlewareAndGetResult(h,c,b.innerArgv,u,s,b.aliases,t)):this.applyMiddlewareAndGetResult(h,c,l.innerArgv,u,s,l.aliases,t)}applyBuilderUpdateUsageAndParse(e,t,n,i,s,o,c,u){let p=t.builder,h=n;if(Er(p)){let l=p(n.getInternalMethods().reset(i),u);if(ie(l))return l.then(b=>(h=Co(b)?b:n,this.parseAndUpdateUsage(e,t,h,s,o,c)))}else Rf(p)&&(h=n.getInternalMethods().reset(i),Object.keys(t.builder).forEach(l=>{h.option(l,p[l])}));return this.parseAndUpdateUsage(e,t,h,s,o,c)}parseAndUpdateUsage(e,t,n,i,s,o){e&&n.getInternalMethods().getUsageInstance().unfreeze(),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,t),t.description);let c=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,o);return ie(c)?c.then(u=>({aliases:n.parsed.aliases,innerArgv:u})):{aliases:n.parsed.aliases,innerArgv:c}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,t){let n=_t.test(t.original)?t.original.replace(_t,"").trim():t.original,i=e.filter(s=>!_t.test(s));return i.push(n),`$0 ${i.join(" ")}`}applyMiddlewareAndGetResult(e,t,n,i,s,o,c){let u={};if(s)return n;c.getInternalMethods().getHasOutput()||(u=this.populatePositionals(t,n,i,c));let p=this.globalMiddleware.getMiddleware().slice(0).concat(t.middlewares);if(n=at(n,c,p,!0),!c.getInternalMethods().getHasOutput()){let h=c.getInternalMethods().runValidation(o,u,c.parsed.error,e);n=ct(n,l=>(h(l),l))}if(t.handler&&!c.getInternalMethods().getHasOutput()){c.getInternalMethods().setHasOutput();let h=!!c.getOptions().configuration["populate--"];c.getInternalMethods().postProcess(n,h,!1,!1),n=at(n,c,p,!1),n=ct(n,l=>{let b=t.handler(l);return ie(b)?b.then(()=>l):l}),e||c.getInternalMethods().getUsageInstance().cacheHelpMessage(),ie(n)&&!c.getInternalMethods().hasParseCallback()&&n.catch(l=>{try{c.getInternalMethods().getUsageInstance().fail(null,l)}catch{}})}return e||(i.commands.pop(),i.fullCommands.pop()),n}populatePositionals(e,t,n,i){t._=t._.slice(n.commands.length);let s=e.demanded.slice(0),o=e.optional.slice(0),c={};for(this.validation.positionalCount(s.length,t._.length);s.length;){let u=s.shift();this.populatePositional(u,t,c)}for(;o.length;){let u=o.shift();this.populatePositional(u,t,c)}return t._=n.commands.concat(t._.map(u=>""+u)),this.postProcessPositionals(t,c,this.cmdToParseOptions(e.original),i),c}populatePositional(e,t,n){let i=e.cmd[0];e.variadic?n[i]=t._.splice(0).map(String):t._.length&&(n[i]=[String(t._.shift())])}cmdToParseOptions(e){let t={array:[],default:{},alias:{},demand:{}},n=Ze(e);return n.demanded.forEach(i=>{let[s,...o]=i.cmd;i.variadic&&(t.array.push(s),t.default[s]=[]),t.alias[s]=o,t.demand[s]=!0}),n.optional.forEach(i=>{let[s,...o]=i.cmd;i.variadic&&(t.array.push(s),t.default[s]=[]),t.alias[s]=o}),t}postProcessPositionals(e,t,n,i){let s=Object.assign({},i.getOptions());s.default=Object.assign(n.default,s.default);for(let p of Object.keys(n.alias))s.alias[p]=(s.alias[p]||[]).concat(n.alias[p]);s.array=s.array.concat(n.array),s.config={};let o=[];if(Object.keys(t).forEach(p=>{t[p].map(h=>{s.configuration["unknown-options-as-args"]&&(s.key[p]=!0),o.push(`--${p}`),o.push(h)})}),!o.length)return;let c=Object.assign({},s.configuration,{"populate--":!1}),u=this.shim.Parser.detailed(o,Object.assign({},s,{configuration:c}));if(u.error)i.getInternalMethods().getUsageInstance().fail(u.error.message,u.error);else{let p=Object.keys(t);Object.keys(t).forEach(h=>{p.push(...u.aliases[h])}),Object.keys(u.argv).forEach(h=>{p.indexOf(h)!==-1&&(t[h]||(t[h]=u.argv[h]),e[h]=u.argv[h])})}}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){let n=_t.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}let t=this.defaultCommand.builder;if(Er(t))return t(e,!0);_o(t)||Object.keys(t).forEach(n=>{e.option(n,t[n])})}moduleName(e){let t=un(e);if(!t)throw new Error(`No command name given for module: ${this.shim.inspect(e)}`);return this.commandFromFilename(t.filename)}commandFromFilename(e){return this.shim.path.basename(e,this.shim.path.extname(e))}extractDesc({describe:e,description:t,desc:n}){for(let i of[e,t,n]){if(typeof i=="string"||i===!1)return i;_e(i,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let e=this.frozens.pop();_e(e,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function So(r,e,t,n){return new fn(r,e,t,n)}function _o(r){return typeof r=="object"&&!!r.builder&&typeof r.handler=="function"}function xf(r){return r.every(e=>typeof e=="string")}function Er(r){return typeof r=="function"}function Rf(r){return typeof r=="object"}function vf(r){return typeof r=="object"&&!Array.isArray(r)}function et(r={},e=()=>!0){let t={};return At(r).forEach(n=>{e(n,r[n])&&(t[n]=r[n])}),t}function tt(r){typeof process>"u"||[process.stdout,process.stderr].forEach(e=>{let t=e;t._handle&&t.isTTY&&typeof t._handle.setBlocking=="function"&&t._handle.setBlocking(r)})}function jf(r){return typeof r=="boolean"}function Ro(r,e){let t=e.y18n.__,n={},i=[];n.failFn=function(_){i.push(_)};let s=null,o=!0;n.showHelpOnFail=function(_=!0,L){function F(){return typeof _=="string"?[!0,_]:[_,L]}let[ee,se]=F();return s=se,o=ee,n};let c=!1;n.fail=function(_,L){let F=r.getInternalMethods().getLoggerInstance();if(i.length)for(let ee=i.length-1;ee>=0;--ee){let se=i[ee];if(jf(se)){if(L)throw L;if(_)throw Error(_)}else se(_,L,n)}else{if(r.getExitProcess()&&tt(!0),c||(c=!0,o&&(r.showHelp("error"),F.error()),(_||L)&&F.error(_||L),s&&((_||L)&&F.error(""),F.error(s))),L=L||new ne(_),r.getExitProcess())return r.exit(1);if(r.getInternalMethods().hasParseCallback())return r.exit(1,L);throw L}};let u=[],p=!1;n.usage=($,_)=>$===null?(p=!0,u=[],n):(p=!1,u.push([$,_||""]),n),n.getUsage=()=>u,n.getUsageDisabled=()=>p,n.getPositionalGroupName=()=>t("Positionals:");let h=[];n.example=($,_)=>{h.push([$,_||""])};let l=[];n.command=function(_,L,F,ee,se=!1){F&&(l=l.map(Y=>(Y[2]=!1,Y))),l.push([_,L||"",F,ee,se])},n.getCommands=()=>l;let b={};n.describe=function(_,L){Array.isArray(_)?_.forEach(F=>{n.describe(F,L)}):typeof _=="object"?Object.keys(_).forEach(F=>{n.describe(F,_[F])}):b[_]=L},n.getDescriptions=()=>b;let g=[];n.epilog=$=>{g.push($)};let w=!1,d;n.wrap=$=>{w=!0,d=$};function S(){return w||(d=Xe(),w=!0),d}let N="__yargsString__:";n.deferY18nLookup=$=>N+$,n.help=function(){if(W)return W;G();let _=r.customScriptName?r.$0:e.path.basename(r.$0),L=r.getDemandedOptions(),F=r.getDemandedCommands(),ee=r.getDeprecatedOptions(),se=r.getGroups(),Y=r.getOptions(),ue=[];ue=ue.concat(Object.keys(b)),ue=ue.concat(Object.keys(L)),ue=ue.concat(Object.keys(F)),ue=ue.concat(Object.keys(Y.default)),ue=ue.filter(Ye),ue=Object.keys(ue.reduce((D,Q)=>(Q!=="_"&&(D[Q]=!0),D),{}));let Je=S(),Z=e.cliui({width:Je,wrap:!!Je});if(!p){if(u.length)u.forEach(D=>{Z.div(`${D[0].replace(/\$0/g,_)}`),D[1]&&Z.div({text:`${D[1]}`,padding:[1,0,0,0]})}),Z.div();else if(l.length){let D=null;F._?D=`${_} <${t("command")}>
17
17
  `:D=`${_} [${t("command")}]
18
- `,Z.div(`${D}`)}}if(l.length>1||l.length===1&&!l[0][2]){Z.div(t("Commands:"));let D=r.getInternalMethods().getContext(),Q=D.commands.length?`${D.commands.join(" ")} `:"";r.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(l=l.sort((X,B)=>X[0].localeCompare(B[0]))),l.forEach(X=>{let B=`${_} ${Q}${X[0].replace(/^\$0 ?/,"")}`;Z.span({text:B,padding:[0,2,0,2],width:A(l,Je,`${_}${Q}`)+4},{text:X[1]});let le=[];X[2]&&le.push(`[${t("default")}]`),X[3]&&X[3].length&&le.push(`[${t("aliases:")} ${X[3].join(", ")}]`),X[4]&&(typeof X[4]=="string"?le.push(`[${t("deprecated: %s",X[4])}]`):le.push(`[${t("deprecated")}]`)),le.length?Z.div({text:le.join(" "),padding:[0,0,0,2],align:"right"}):Z.div()}),Z.div()}let He=(Object.keys(Y.alias)||[]).concat(Object.keys(r.parsed.newAliases)||[]);ue=ue.filter(D=>!r.parsed.newAliases[D]&&He.every(Q=>(Y.alias[Q]||[]).indexOf(D)===-1));let It=t("Options:");se[It]||(se[It]=[]),xe(ue,Y.alias,se,It);let T=D=>/^--/.test(Er(D)),Et=Object.keys(se).filter(D=>se[D].length>0).map(D=>{let Q=se[D].filter(Ye).map(X=>{if(~He.indexOf(X))return X;for(let B=0,le;(le=He[B])!==void 0;B++)if(~(Y.alias[le]||[]).indexOf(X))return le;return X});return{groupName:D,normalizedKeys:Q}}).filter(({normalizedKeys:D})=>D.length>0).map(({groupName:D,normalizedKeys:Q})=>{let X=Q.reduce((B,le)=>(B[le]=[le].concat(Y.alias[le]||[]).map(Se=>D===n.getPositionalGroupName()?Se:(/^[0-9]$/.test(Se)?~Y.boolean.indexOf(le)?"-":"--":Se.length>1?"--":"-")+Se).sort((Se,fe)=>T(Se)===T(fe)?0:T(Se)?1:-1).join(", "),B),{});return{groupName:D,normalizedKeys:Q,switches:X}});if(Et.filter(({groupName:D})=>D!==n.getPositionalGroupName()).some(({normalizedKeys:D,switches:Q})=>!D.every(X=>T(Q[X])))&&Et.filter(({groupName:D})=>D!==n.getPositionalGroupName()).forEach(({normalizedKeys:D,switches:Q})=>{D.forEach(X=>{T(Q[X])&&(Q[X]=$f(Q[X],4))})}),Et.forEach(({groupName:D,normalizedKeys:Q,switches:X})=>{Z.div(D),Q.forEach(B=>{let le=X[B],Se=b[B]||"",fe=null;~Se.lastIndexOf(N)&&(Se=t(Se.substring(N.length))),~Y.boolean.indexOf(B)&&(fe=`[${t("boolean")}]`),~Y.count.indexOf(B)&&(fe=`[${t("count")}]`),~Y.string.indexOf(B)&&(fe=`[${t("string")}]`),~Y.normalize.indexOf(B)&&(fe=`[${t("string")}]`),~Y.array.indexOf(B)&&(fe=`[${t("array")}]`),~Y.number.indexOf(B)&&(fe=`[${t("number")}]`);let Ir=m=>typeof m=="string"?`[${t("deprecated: %s",m)}]`:`[${t("deprecated")}]`,f=[B in ee?Ir(ee[B]):null,fe,B in L?`[${t("required")}]`:null,Y.choices&&Y.choices[B]?`[${t("choices:")} ${n.stringifiedValues(Y.choices[B])}]`:null,Ke(Y.default[B],Y.defaultDescription[B])].filter(Boolean).join(" ");Z.span({text:Er(le),padding:[0,2,0,2+xo(le)],width:A(X,Je)+4},Se),f?Z.div({text:f,padding:[0,0,0,2],align:"right"}):Z.div()}),Z.div()}),h.length&&(Z.div(t("Examples:")),h.forEach(D=>{D[0]=D[0].replace(/\$0/g,_)}),h.forEach(D=>{D[1]===""?Z.div({text:D[0],padding:[0,2,0,2]}):Z.div({text:D[0],padding:[0,2,0,2],width:A(h,Je)+4},{text:D[1]})}),Z.div()),g.length>0){let D=g.map(Q=>Q.replace(/\$0/g,_)).join(`
18
+ `,Z.div(`${D}`)}}if(l.length>1||l.length===1&&!l[0][2]){Z.div(t("Commands:"));let D=r.getInternalMethods().getContext(),Q=D.commands.length?`${D.commands.join(" ")} `:"";r.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(l=l.sort((X,B)=>X[0].localeCompare(B[0]))),l.forEach(X=>{let B=`${_} ${Q}${X[0].replace(/^\$0 ?/,"")}`;Z.span({text:B,padding:[0,2,0,2],width:A(l,Je,`${_}${Q}`)+4},{text:X[1]});let le=[];X[2]&&le.push(`[${t("default")}]`),X[3]&&X[3].length&&le.push(`[${t("aliases:")} ${X[3].join(", ")}]`),X[4]&&(typeof X[4]=="string"?le.push(`[${t("deprecated: %s",X[4])}]`):le.push(`[${t("deprecated")}]`)),le.length?Z.div({text:le.join(" "),padding:[0,0,0,2],align:"right"}):Z.div()}),Z.div()}let He=(Object.keys(Y.alias)||[]).concat(Object.keys(r.parsed.newAliases)||[]);ue=ue.filter(D=>!r.parsed.newAliases[D]&&He.every(Q=>(Y.alias[Q]||[]).indexOf(D)===-1));let Pt=t("Options:");se[Pt]||(se[Pt]=[]),xe(ue,Y.alias,se,Pt);let T=D=>/^--/.test(wr(D)),Et=Object.keys(se).filter(D=>se[D].length>0).map(D=>{let Q=se[D].filter(Ye).map(X=>{if(~He.indexOf(X))return X;for(let B=0,le;(le=He[B])!==void 0;B++)if(~(Y.alias[le]||[]).indexOf(X))return le;return X});return{groupName:D,normalizedKeys:Q}}).filter(({normalizedKeys:D})=>D.length>0).map(({groupName:D,normalizedKeys:Q})=>{let X=Q.reduce((B,le)=>(B[le]=[le].concat(Y.alias[le]||[]).map(Se=>D===n.getPositionalGroupName()?Se:(/^[0-9]$/.test(Se)?~Y.boolean.indexOf(le)?"-":"--":Se.length>1?"--":"-")+Se).sort((Se,fe)=>T(Se)===T(fe)?0:T(Se)?1:-1).join(", "),B),{});return{groupName:D,normalizedKeys:Q,switches:X}});if(Et.filter(({groupName:D})=>D!==n.getPositionalGroupName()).some(({normalizedKeys:D,switches:Q})=>!D.every(X=>T(Q[X])))&&Et.filter(({groupName:D})=>D!==n.getPositionalGroupName()).forEach(({normalizedKeys:D,switches:Q})=>{D.forEach(X=>{T(Q[X])&&(Q[X]=$f(Q[X],4))})}),Et.forEach(({groupName:D,normalizedKeys:Q,switches:X})=>{Z.div(D),Q.forEach(B=>{let le=X[B],Se=b[B]||"",fe=null;~Se.lastIndexOf(N)&&(Se=t(Se.substring(N.length))),~Y.boolean.indexOf(B)&&(fe=`[${t("boolean")}]`),~Y.count.indexOf(B)&&(fe=`[${t("count")}]`),~Y.string.indexOf(B)&&(fe=`[${t("string")}]`),~Y.normalize.indexOf(B)&&(fe=`[${t("string")}]`),~Y.array.indexOf(B)&&(fe=`[${t("array")}]`),~Y.number.indexOf(B)&&(fe=`[${t("number")}]`);let Ir=m=>typeof m=="string"?`[${t("deprecated: %s",m)}]`:`[${t("deprecated")}]`,f=[B in ee?Ir(ee[B]):null,fe,B in L?`[${t("required")}]`:null,Y.choices&&Y.choices[B]?`[${t("choices:")} ${n.stringifiedValues(Y.choices[B])}]`:null,Ke(Y.default[B],Y.defaultDescription[B])].filter(Boolean).join(" ");Z.span({text:wr(le),padding:[0,2,0,2+xo(le)],width:A(X,Je)+4},Se),f?Z.div({text:f,padding:[0,0,0,2],align:"right"}):Z.div()}),Z.div()}),h.length&&(Z.div(t("Examples:")),h.forEach(D=>{D[0]=D[0].replace(/\$0/g,_)}),h.forEach(D=>{D[1]===""?Z.div({text:D[0],padding:[0,2,0,2]}):Z.div({text:D[0],padding:[0,2,0,2],width:A(h,Je)+4},{text:D[1]})}),Z.div()),g.length>0){let D=g.map(Q=>Q.replace(/\$0/g,_)).join(`
19
19
  `);Z.div(`${D}
20
- `)}return Z.toString().replace(/\s*$/,"")};function A($,_,L){let F=0;return Array.isArray($)||($=Object.values($).map(ee=>[ee])),$.forEach(ee=>{F=Math.max(e.stringWidth(L?`${L} ${Er(ee[0])}`:Er(ee[0]))+xo(ee[0]),F)}),_&&(F=Math.min(F,parseInt((_*.5).toString(),10))),F}function G(){let $=r.getDemandedOptions(),_=r.getOptions();(Object.keys(_.alias)||[]).forEach(L=>{_.alias[L].forEach(F=>{b[F]&&n.describe(L,b[F]),F in $&&r.demandOption(L,$[F]),~_.boolean.indexOf(F)&&r.boolean(L),~_.count.indexOf(F)&&r.count(L),~_.string.indexOf(F)&&r.string(L),~_.normalize.indexOf(F)&&r.normalize(L),~_.array.indexOf(F)&&r.array(L),~_.number.indexOf(F)&&r.number(L)})})}let W;n.cacheHelpMessage=function(){W=this.help()},n.clearCachedHelpMessage=function(){W=void 0},n.hasCachedHelpMessage=function(){return!!W};function xe($,_,L,F){let ee=[],se=null;return Object.keys(L).forEach(Y=>{ee=ee.concat(L[Y])}),$.forEach(Y=>{se=[Y].concat(_[Y]),se.some(ue=>ee.indexOf(ue)!==-1)||L[F].push(Y)}),ee}function Ye($){return r.getOptions().hiddenOptions.indexOf($)<0||r.parsed.argv[r.getOptions().showHiddenOpt]}n.showHelp=$=>{let _=r.getInternalMethods().getLoggerInstance();$||($="error"),(typeof $=="function"?$:_[$])(n.help())},n.functionDescription=$=>["(",$.name?e.Parser.decamelize($.name,"-"):t("generated-value"),")"].join(""),n.stringifiedValues=function(_,L){let F="",ee=L||", ",se=[].concat(_);return!_||!se.length||se.forEach(Y=>{F.length&&(F+=ee),F+=JSON.stringify(Y)}),F};function Ke($,_){let L=`[${t("default:")} `;if($===void 0&&!_)return null;if(_)L+=_;else switch(typeof $){case"string":L+=`"${$}"`;break;case"object":L+=JSON.stringify($);break;default:L+=$}return`${L}]`}function Xe(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}let V=null;n.version=$=>{V=$},n.showVersion=$=>{let _=r.getInternalMethods().getLoggerInstance();$||($="error"),(typeof $=="function"?$:_[$])(V)},n.reset=function(_){return s=null,c=!1,u=[],p=!1,g=[],h=[],l=[],b=et(b,L=>!_[L]),n};let We=[];return n.freeze=function(){We.push({failMessage:s,failureOutput:c,usages:u,usageDisabled:p,epilogs:g,examples:h,commands:l,descriptions:b})},n.unfreeze=function(){let _=We.pop();_&&({failMessage:s,failureOutput:c,usages:u,usageDisabled:p,epilogs:g,examples:h,commands:l,descriptions:b}=_)},n}function dn(r){return typeof r=="object"}function $f(r,e){return dn(r)?{text:r.text,indentation:r.indentation+e}:{text:r,indentation:e}}function xo(r){return dn(r)?r.indentation:0}function Er(r){return dn(r)?r.text:r}var vo=`###-begin-{{app_name}}-completions-###
20
+ `)}return Z.toString().replace(/\s*$/,"")};function A($,_,L){let F=0;return Array.isArray($)||($=Object.values($).map(ee=>[ee])),$.forEach(ee=>{F=Math.max(e.stringWidth(L?`${L} ${wr(ee[0])}`:wr(ee[0]))+xo(ee[0]),F)}),_&&(F=Math.min(F,parseInt((_*.5).toString(),10))),F}function G(){let $=r.getDemandedOptions(),_=r.getOptions();(Object.keys(_.alias)||[]).forEach(L=>{_.alias[L].forEach(F=>{b[F]&&n.describe(L,b[F]),F in $&&r.demandOption(L,$[F]),~_.boolean.indexOf(F)&&r.boolean(L),~_.count.indexOf(F)&&r.count(L),~_.string.indexOf(F)&&r.string(L),~_.normalize.indexOf(F)&&r.normalize(L),~_.array.indexOf(F)&&r.array(L),~_.number.indexOf(F)&&r.number(L)})})}let W;n.cacheHelpMessage=function(){W=this.help()},n.clearCachedHelpMessage=function(){W=void 0},n.hasCachedHelpMessage=function(){return!!W};function xe($,_,L,F){let ee=[],se=null;return Object.keys(L).forEach(Y=>{ee=ee.concat(L[Y])}),$.forEach(Y=>{se=[Y].concat(_[Y]),se.some(ue=>ee.indexOf(ue)!==-1)||L[F].push(Y)}),ee}function Ye($){return r.getOptions().hiddenOptions.indexOf($)<0||r.parsed.argv[r.getOptions().showHiddenOpt]}n.showHelp=$=>{let _=r.getInternalMethods().getLoggerInstance();$||($="error"),(typeof $=="function"?$:_[$])(n.help())},n.functionDescription=$=>["(",$.name?e.Parser.decamelize($.name,"-"):t("generated-value"),")"].join(""),n.stringifiedValues=function(_,L){let F="",ee=L||", ",se=[].concat(_);return!_||!se.length||se.forEach(Y=>{F.length&&(F+=ee),F+=JSON.stringify(Y)}),F};function Ke($,_){let L=`[${t("default:")} `;if($===void 0&&!_)return null;if(_)L+=_;else switch(typeof $){case"string":L+=`"${$}"`;break;case"object":L+=JSON.stringify($);break;default:L+=$}return`${L}]`}function Xe(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}let V=null;n.version=$=>{V=$},n.showVersion=$=>{let _=r.getInternalMethods().getLoggerInstance();$||($="error"),(typeof $=="function"?$:_[$])(V)},n.reset=function(_){return s=null,c=!1,u=[],p=!1,g=[],h=[],l=[],b=et(b,L=>!_[L]),n};let We=[];return n.freeze=function(){We.push({failMessage:s,failureOutput:c,usages:u,usageDisabled:p,epilogs:g,examples:h,commands:l,descriptions:b})},n.unfreeze=function(){let _=We.pop();_&&({failMessage:s,failureOutput:c,usages:u,usageDisabled:p,epilogs:g,examples:h,commands:l,descriptions:b}=_)},n}function dn(r){return typeof r=="object"}function $f(r,e){return dn(r)?{text:r.text,indentation:r.indentation+e}:{text:r,indentation:e}}function xo(r){return dn(r)?r.indentation:0}function wr(r){return dn(r)?r.text:r}var vo=`###-begin-{{app_name}}-completions-###
21
21
  #
22
22
  # yargs command completion script
23
23
  #
@@ -64,16 +64,16 @@ _{{app_name}}_yargs_completions()
64
64
  }
65
65
  compdef _{{app_name}}_yargs_completions {{app_name}}
66
66
  ###-end-{{app_name}}-completions-###
67
- `;var pn=class{constructor(e,t,n,i){var s,o,c;this.yargs=e,this.usage=t,this.command=n,this.shim=i,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.zshShell=(c=((s=this.shim.getEnv("SHELL"))===null||s===void 0?void 0:s.includes("zsh"))||((o=this.shim.getEnv("ZSH_NAME"))===null||o===void 0?void 0:o.includes("zsh")))!==null&&c!==void 0?c:!1}defaultCompletion(e,t,n,i){let s=this.command.getCommandHandlers();for(let c=0,u=e.length;c<u;++c)if(s[e[c]]&&s[e[c]].builder){let p=s[e[c]].builder;if(br(p)){let h=this.yargs.getInternalMethods().reset();return p(h,!0),h.argv}}let o=[];this.commandCompletions(o,e,n),this.optionCompletions(o,e,t,n),i(null,o)}commandCompletions(e,t,n){let i=this.yargs.getInternalMethods().getContext().commands;!n.match(/^-/)&&i[i.length-1]!==n&&this.usage.getCommands().forEach(s=>{let o=Ze(s[0]).cmd;if(t.indexOf(o)===-1)if(!this.zshShell)e.push(o);else{let c=s[1]||"";e.push(o.replace(/:/g,"\\:")+":"+c)}})}optionCompletions(e,t,n,i){if(i.match(/^-/)||i===""&&e.length===0){let s=this.yargs.getOptions(),o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(s.key).forEach(c=>{let u=!!s.configuration["boolean-negation"]&&s.boolean.includes(c);!o.includes(c)&&!this.argsContainKey(t,n,c,u)&&(this.completeOptionKey(c,e,i),u&&s.default[c]&&this.completeOptionKey(`no-${c}`,e,i))})}}argsContainKey(e,t,n,i){if(e.indexOf(`--${n}`)!==-1||i&&e.indexOf(`--no-${n}`)!==-1)return!0;if(this.aliases){for(let s of this.aliases[n])if(t[s]!==void 0)return!0}return!1}completeOptionKey(e,t,n){let i=this.usage.getDescriptions(),s=u=>/^--/.test(u),o=u=>/^[^0-9]$/.test(u),c=!s(n)&&o(e)?"-":"--";if(!this.zshShell)t.push(c+e);else{let u=i[e]||"";t.push(c+`${e.replace(/:/g,"\\:")}:${u.replace("__yargsString__:","")}`)}}customCompletion(e,t,n,i){if(_e(this.customCompletionFunction,null,this.shim),Pf(this.customCompletionFunction)){let s=this.customCompletionFunction(n,t);return ie(s)?s.then(o=>{this.shim.process.nextTick(()=>{i(null,o)})}).catch(o=>{this.shim.process.nextTick(()=>{i(o,void 0)})}):i(null,s)}else return Lf(this.customCompletionFunction)?this.customCompletionFunction(n,t,(s=i)=>this.defaultCompletion(e,t,n,s),s=>{i(null,s)}):this.customCompletionFunction(n,t,s=>{i(null,s)})}getCompletion(e,t){let n=e.length?e[e.length-1]:"",i=this.yargs.parse(e,!0),s=this.customCompletionFunction?o=>this.customCompletion(e,o,n,t):o=>this.defaultCompletion(e,o,n,t);return ie(i)?i.then(s):s(i)}generateCompletionScript(e,t){let n=this.zshShell?jo:vo,i=this.shim.path.basename(e);return e.match(/\.js$/)&&(e=`./${e}`),n=n.replace(/{{app_name}}/g,i),n=n.replace(/{{completion_command}}/g,t),n.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}};function $o(r,e,t,n){return new pn(r,e,t,n)}function Pf(r){return r.length<3}function Lf(r){return r.length>3}function Io(r,e){if(r.length===0)return e.length;if(e.length===0)return r.length;let t=[],n;for(n=0;n<=e.length;n++)t[n]=[n];let i;for(i=0;i<=r.length;i++)t[0][i]=i;for(n=1;n<=e.length;n++)for(i=1;i<=r.length;i++)e.charAt(n-1)===r.charAt(i-1)?t[n][i]=t[n-1][i-1]:t[n][i]=Math.min(t[n-1][i-1]+1,Math.min(t[n][i-1]+1,t[n-1][i]+1));return t[e.length][r.length]}var Po=["$0","--","_"];function Lo(r,e,t){let n=t.y18n.__,i=t.y18n.__n,s={};s.nonOptionCount=function(l){let b=r.getDemandedCommands(),w=l._.length+(l["--"]?l["--"].length:0)-r.getInternalMethods().getContext().commands.length;b._&&(w<b._.min||w>b._.max)&&(w<b._.min?b._.minMsg!==void 0?e.fail(b._.minMsg?b._.minMsg.replace(/\$0/g,w.toString()).replace(/\$1/,b._.min.toString()):null):e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",w,w.toString(),b._.min.toString())):w>b._.max&&(b._.maxMsg!==void 0?e.fail(b._.maxMsg?b._.maxMsg.replace(/\$0/g,w.toString()).replace(/\$1/,b._.max.toString()):null):e.fail(i("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",w,w.toString(),b._.max.toString()))))},s.positionalCount=function(l,b){b<l&&e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",b,b+"",l+""))},s.requiredArguments=function(l,b){let g=null;for(let w of Object.keys(b))(!Object.prototype.hasOwnProperty.call(l,w)||typeof l[w]>"u")&&(g=g||{},g[w]=b[w]);if(g){let w=[];for(let S of Object.keys(g)){let N=g[S];N&&w.indexOf(N)<0&&w.push(N)}let d=w.length?`
67
+ `;var pn=class{constructor(e,t,n,i){var s,o,c;this.yargs=e,this.usage=t,this.command=n,this.shim=i,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.zshShell=(c=((s=this.shim.getEnv("SHELL"))===null||s===void 0?void 0:s.includes("zsh"))||((o=this.shim.getEnv("ZSH_NAME"))===null||o===void 0?void 0:o.includes("zsh")))!==null&&c!==void 0?c:!1}defaultCompletion(e,t,n,i){let s=this.command.getCommandHandlers();for(let c=0,u=e.length;c<u;++c)if(s[e[c]]&&s[e[c]].builder){let p=s[e[c]].builder;if(Er(p)){let h=this.yargs.getInternalMethods().reset();return p(h,!0),h.argv}}let o=[];this.commandCompletions(o,e,n),this.optionCompletions(o,e,t,n),i(null,o)}commandCompletions(e,t,n){let i=this.yargs.getInternalMethods().getContext().commands;!n.match(/^-/)&&i[i.length-1]!==n&&this.usage.getCommands().forEach(s=>{let o=Ze(s[0]).cmd;if(t.indexOf(o)===-1)if(!this.zshShell)e.push(o);else{let c=s[1]||"";e.push(o.replace(/:/g,"\\:")+":"+c)}})}optionCompletions(e,t,n,i){if(i.match(/^-/)||i===""&&e.length===0){let s=this.yargs.getOptions(),o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(s.key).forEach(c=>{let u=!!s.configuration["boolean-negation"]&&s.boolean.includes(c);!o.includes(c)&&!this.argsContainKey(t,n,c,u)&&(this.completeOptionKey(c,e,i),u&&s.default[c]&&this.completeOptionKey(`no-${c}`,e,i))})}}argsContainKey(e,t,n,i){if(e.indexOf(`--${n}`)!==-1||i&&e.indexOf(`--no-${n}`)!==-1)return!0;if(this.aliases){for(let s of this.aliases[n])if(t[s]!==void 0)return!0}return!1}completeOptionKey(e,t,n){let i=this.usage.getDescriptions(),s=u=>/^--/.test(u),o=u=>/^[^0-9]$/.test(u),c=!s(n)&&o(e)?"-":"--";if(!this.zshShell)t.push(c+e);else{let u=i[e]||"";t.push(c+`${e.replace(/:/g,"\\:")}:${u.replace("__yargsString__:","")}`)}}customCompletion(e,t,n,i){if(_e(this.customCompletionFunction,null,this.shim),Pf(this.customCompletionFunction)){let s=this.customCompletionFunction(n,t);return ie(s)?s.then(o=>{this.shim.process.nextTick(()=>{i(null,o)})}).catch(o=>{this.shim.process.nextTick(()=>{i(o,void 0)})}):i(null,s)}else return Lf(this.customCompletionFunction)?this.customCompletionFunction(n,t,(s=i)=>this.defaultCompletion(e,t,n,s),s=>{i(null,s)}):this.customCompletionFunction(n,t,s=>{i(null,s)})}getCompletion(e,t){let n=e.length?e[e.length-1]:"",i=this.yargs.parse(e,!0),s=this.customCompletionFunction?o=>this.customCompletion(e,o,n,t):o=>this.defaultCompletion(e,o,n,t);return ie(i)?i.then(s):s(i)}generateCompletionScript(e,t){let n=this.zshShell?jo:vo,i=this.shim.path.basename(e);return e.match(/\.js$/)&&(e=`./${e}`),n=n.replace(/{{app_name}}/g,i),n=n.replace(/{{completion_command}}/g,t),n.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}};function $o(r,e,t,n){return new pn(r,e,t,n)}function Pf(r){return r.length<3}function Lf(r){return r.length>3}function Io(r,e){if(r.length===0)return e.length;if(e.length===0)return r.length;let t=[],n;for(n=0;n<=e.length;n++)t[n]=[n];let i;for(i=0;i<=r.length;i++)t[0][i]=i;for(n=1;n<=e.length;n++)for(i=1;i<=r.length;i++)e.charAt(n-1)===r.charAt(i-1)?t[n][i]=t[n-1][i-1]:t[n][i]=Math.min(t[n-1][i-1]+1,Math.min(t[n][i-1]+1,t[n-1][i]+1));return t[e.length][r.length]}var Po=["$0","--","_"];function Lo(r,e,t){let n=t.y18n.__,i=t.y18n.__n,s={};s.nonOptionCount=function(l){let b=r.getDemandedCommands(),w=l._.length+(l["--"]?l["--"].length:0)-r.getInternalMethods().getContext().commands.length;b._&&(w<b._.min||w>b._.max)&&(w<b._.min?b._.minMsg!==void 0?e.fail(b._.minMsg?b._.minMsg.replace(/\$0/g,w.toString()).replace(/\$1/,b._.min.toString()):null):e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",w,w.toString(),b._.min.toString())):w>b._.max&&(b._.maxMsg!==void 0?e.fail(b._.maxMsg?b._.maxMsg.replace(/\$0/g,w.toString()).replace(/\$1/,b._.max.toString()):null):e.fail(i("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",w,w.toString(),b._.max.toString()))))},s.positionalCount=function(l,b){b<l&&e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",b,b+"",l+""))},s.requiredArguments=function(l,b){let g=null;for(let w of Object.keys(b))(!Object.prototype.hasOwnProperty.call(l,w)||typeof l[w]>"u")&&(g=g||{},g[w]=b[w]);if(g){let w=[];for(let S of Object.keys(g)){let N=g[S];N&&w.indexOf(N)<0&&w.push(N)}let d=w.length?`
68
68
  ${w.join(`
69
69
  `)}`:"";e.fail(i("Missing required argument: %s","Missing required arguments: %s",Object.keys(g).length,Object.keys(g).join(", ")+d))}},s.unknownArguments=function(l,b,g,w,d=!0){let S=r.getInternalMethods().getCommandInstance().getCommands(),N=[],A=r.getInternalMethods().getContext();Object.keys(l).forEach(G=>{Po.indexOf(G)===-1&&!Object.prototype.hasOwnProperty.call(g,G)&&!Object.prototype.hasOwnProperty.call(r.getInternalMethods().getParseContext(),G)&&!s.isValidAndSomeAliasIsNotNew(G,b)&&N.push(G)}),d&&(A.commands.length>0||S.length>0||w)&&l._.slice(A.commands.length).forEach(G=>{S.indexOf(""+G)===-1&&N.push(""+G)}),N.length>0&&e.fail(i("Unknown argument: %s","Unknown arguments: %s",N.length,N.join(", ")))},s.unknownCommands=function(l){let b=r.getInternalMethods().getCommandInstance().getCommands(),g=[],w=r.getInternalMethods().getContext();return(w.commands.length>0||b.length>0)&&l._.slice(w.commands.length).forEach(d=>{b.indexOf(""+d)===-1&&g.push(""+d)}),g.length>0?(e.fail(i("Unknown command: %s","Unknown commands: %s",g.length,g.join(", "))),!0):!1},s.isValidAndSomeAliasIsNotNew=function(l,b){if(!Object.prototype.hasOwnProperty.call(b,l))return!1;let g=r.parsed.newAliases;return[l,...b[l]].some(w=>!Object.prototype.hasOwnProperty.call(g,w)||!g[l])},s.limitedChoices=function(l){let b=r.getOptions(),g={};if(!Object.keys(b.choices).length)return;Object.keys(l).forEach(S=>{Po.indexOf(S)===-1&&Object.prototype.hasOwnProperty.call(b.choices,S)&&[].concat(l[S]).forEach(N=>{b.choices[S].indexOf(N)===-1&&N!==void 0&&(g[S]=(g[S]||[]).concat(N))})});let w=Object.keys(g);if(!w.length)return;let d=n("Invalid values:");w.forEach(S=>{d+=`
70
70
  ${n("Argument: %s, Given: %s, Choices: %s",S,e.stringifiedValues(g[S]),e.stringifiedValues(b.choices[S]))}`}),e.fail(d)};let o={};s.implies=function(l,b){j("<string|object> [array|number|string]",[l,b],arguments.length),typeof l=="object"?Object.keys(l).forEach(g=>{s.implies(g,l[g])}):(r.global(l),o[l]||(o[l]=[]),Array.isArray(b)?b.forEach(g=>s.implies(l,g)):(_e(b,void 0,t),o[l].push(b)))},s.getImplied=function(){return o};function c(h,l){let b=Number(l);return l=isNaN(b)?l:b,typeof l=="number"?l=h._.length>=l:l.match(/^--no-.+/)?(l=l.match(/^--no-(.+)/)[1],l=!h[l]):l=h[l],l}s.implications=function(l){let b=[];if(Object.keys(o).forEach(g=>{let w=g;(o[g]||[]).forEach(d=>{let S=w,N=d;S=c(l,S),d=c(l,d),S&&!d&&b.push(` ${w} -> ${N}`)})}),b.length){let g=`${n("Implications failed:")}
71
- `;b.forEach(w=>{g+=w}),e.fail(g)}};let u={};s.conflicts=function(l,b){j("<string|object> [array|string]",[l,b],arguments.length),typeof l=="object"?Object.keys(l).forEach(g=>{s.conflicts(g,l[g])}):(r.global(l),u[l]||(u[l]=[]),Array.isArray(b)?b.forEach(g=>s.conflicts(l,g)):u[l].push(b))},s.getConflicting=()=>u,s.conflicting=function(l){Object.keys(l).forEach(b=>{u[b]&&u[b].forEach(g=>{g&&l[b]!==void 0&&l[g]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",b,g))})})},s.recommendCommands=function(l,b){b=b.sort((S,N)=>N.length-S.length);let w=null,d=1/0;for(let S=0,N;(N=b[S])!==void 0;S++){let A=Io(l,N);A<=3&&A<d&&(d=A,w=N)}w&&e.fail(n("Did you mean %s?",w))},s.reset=function(l){return o=et(o,b=>!l[b]),u=et(u,b=>!l[b]),s};let p=[];return s.freeze=function(){p.push({implied:o,conflicting:u})},s.unfreeze=function(){let l=p.pop();_e(l,void 0,t),{implied:o,conflicting:u}=l},s}var hn=[],Ut;function Gt(r,e,t,n){Ut=n;let i={};if(Object.prototype.hasOwnProperty.call(r,"extends")){if(typeof r.extends!="string")return i;let s=/\.json|\..*rc$/.test(r.extends),o=null;if(s)o=Tf(e,r.extends);else try{o=Ue.resolve(r.extends)}catch{return r}Nf(o),hn.push(o),i=s?JSON.parse(Ut.readFileSync(o,"utf8")):Ue(r.extends),delete r.extends,i=Gt(i,Ut.path.dirname(o),t,Ut)}return hn=[],t?No(i,r):Object.assign({},i,r)}function Nf(r){if(hn.indexOf(r)>-1)throw new ne(`Circular extended configurations: '${r}'.`)}function Tf(r,e){return Ut.path.resolve(r,e)}function No(r,e){let t={};function n(i){return i&&typeof i=="object"&&!Array.isArray(i)}Object.assign(t,r);for(let i of Object.keys(e))n(e[i])&&n(t[i])?t[i]=No(r[i],e[i]):t[i]=e[i];return t}var I=function(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t},a=function(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)},ce,lt,kt,Te,ve,wr,rt,ut,De,Or,qe,ke,je,Me,St,he,P,Ar,_r,$e,ft,Ct,dt,nt,Sr,M,pt,ht,mt,U,Be,oe;function Jo(r){return(e=[],t=r.process.cwd(),n)=>{let i=new Cn(e,t,n,r);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}var To=Symbol("copyDoubleDash"),Do=Symbol("copyDoubleDash"),mn=Symbol("deleteFromParserHintObject"),qo=Symbol("freeze"),Mo=Symbol("getDollarZero"),gt=Symbol("getParserConfiguration"),gn=Symbol("guessLocale"),Fo=Symbol("guessVersion"),zo=Symbol("parsePositionalNumbers"),yn=Symbol("pkgUp"),it=Symbol("populateParserHintArray"),xt=Symbol("populateParserHintSingleValueDictionary"),bn=Symbol("populateParserHintArrayDictionary"),En=Symbol("populateParserHintDictionary"),wn=Symbol("sanitizeKey"),On=Symbol("setKey"),An=Symbol("unfreeze"),Uo=Symbol("validateAsync"),Go=Symbol("getCommandInstance"),ko=Symbol("getContext"),Wo=Symbol("getHasOutput"),Ho=Symbol("getLoggerInstance"),Vo=Symbol("getParseContext"),Bo=Symbol("getUsageInstance"),Yo=Symbol("getValidationInstance"),Cr=Symbol("hasParseCallback"),yt=Symbol("postProcess"),Ko=Symbol("rebase"),_n=Symbol("reset"),Wt=Symbol("runYargsParserAndExecuteCommands"),Sn=Symbol("runValidation"),Xo=Symbol("setHasOutput"),Cn=class{constructor(e=[],t,n,i){this.customScriptName=!1,this.parsed=!1,ce.set(this,void 0),lt.set(this,void 0),kt.set(this,{commands:[],fullCommands:[]}),Te.set(this,null),ve.set(this,null),wr.set(this,"show-hidden"),rt.set(this,null),ut.set(this,!0),De.set(this,!0),Or.set(this,[]),qe.set(this,void 0),ke.set(this,{}),je.set(this,!1),Me.set(this,null),St.set(this,void 0),he.set(this,""),P.set(this,void 0),Ar.set(this,void 0),_r.set(this,{}),$e.set(this,null),ft.set(this,null),Ct.set(this,{}),dt.set(this,{}),nt.set(this,void 0),Sr.set(this,!1),M.set(this,void 0),pt.set(this,!1),ht.set(this,!1),mt.set(this,!1),U.set(this,void 0),Be.set(this,null),oe.set(this,void 0),I(this,M,i),I(this,nt,e),I(this,lt,t),I(this,Ar,n),I(this,qe,new yr(this)),this.$0=this[Mo](),this[_n](),I(this,ce,a(this,ce)),I(this,U,a(this,U)),I(this,oe,a(this,oe)),I(this,P,a(this,P)),a(this,P).showHiddenOpt=a(this,wr),I(this,St,this[Do]())}addHelpOpt(e,t){let n="help";return j("[string|boolean] [string]",[e,t],arguments.length),a(this,Me)&&(this[mn](a(this,Me)),I(this,Me,null)),e===!1&&t===void 0?this:(I(this,Me,typeof e=="string"?e:n),this.boolean(a(this,Me)),this.describe(a(this,Me),t||a(this,U).deferY18nLookup("Show help")),this)}help(e,t){return this.addHelpOpt(e,t)}addShowHiddenOpt(e,t){if(j("[string|boolean] [string]",[e,t],arguments.length),e===!1&&t===void 0)return this;let n=typeof e=="string"?e:a(this,wr);return this.boolean(n),this.describe(n,t||a(this,U).deferY18nLookup("Show hidden options")),a(this,P).showHiddenOpt=n,this}showHidden(e,t){return this.addShowHiddenOpt(e,t)}alias(e,t){return j("<object|string|array> [string|array]",[e,t],arguments.length),this[bn](this.alias.bind(this),"alias",e,t),this}array(e){return j("<array|string>",[e],arguments.length),this[it]("array",e),this}boolean(e){return j("<array|string>",[e],arguments.length),this[it]("boolean",e),this}check(e,t){return j("<function> [boolean]",[e,t],arguments.length),this.middleware((n,i)=>ct(()=>e(n),s=>(s?(typeof s=="string"||s instanceof Error)&&a(this,U).fail(s.toString(),s):a(this,U).fail(a(this,M).y18n.__("Argument check failed: %s",e.toString())),n),s=>(a(this,U).fail(s.message?s.message:s.toString(),s),n)),!1,t),this}choices(e,t){return j("<object|string|array> [string|array]",[e,t],arguments.length),this[bn](this.choices.bind(this),"choices",e,t),this}coerce(e,t){if(j("<object|string|array> [function]",[e,t],arguments.length),Array.isArray(e)){if(!t)throw new ne("coerce callback must be provided");for(let n of e)this.coerce(n,t);return this}else if(typeof e=="object"){for(let n of Object.keys(e))this.coerce(n,e[n]);return this}if(!t)throw new ne("coerce callback must be provided");return a(this,P).key[e]=!0,a(this,qe).addCoerceMiddleware((n,i)=>{let s;return ct(()=>(s=i.getAliases(),t(n[e])),o=>{if(n[e]=o,s[e])for(let c of s[e])n[c]=o;return n},o=>{throw new ne(o.message)})},e),this}conflicts(e,t){return j("<string|object> [string|array]",[e,t],arguments.length),a(this,oe).conflicts(e,t),this}config(e="config",t,n){return j("[object|string] [string|function] [function]",[e,t,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=Gt(e,a(this,lt),this[gt]()["deep-merge-config"]||!1,a(this,M)),a(this,P).configObjects=(a(this,P).configObjects||[]).concat(e),this):(typeof t=="function"&&(n=t,t=void 0),this.describe(e,t||a(this,U).deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(i=>{a(this,P).config[i]=n||!0}),this)}completion(e,t,n){return j("[string] [string|boolean|function] [function]",[e,t,n],arguments.length),typeof t=="function"&&(n=t,t=void 0),I(this,ve,e||a(this,ve)||"completion"),!t&&t!==!1&&(t="generate completion script"),this.command(a(this,ve),t),n&&a(this,Te).registerFunction(n),this}command(e,t,n,i,s,o){return j("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[e,t,n,i,s,o],arguments.length),a(this,ce).addHandler(e,t,n,i,s,o),this}commands(e,t,n,i,s,o){return this.command(e,t,n,i,s,o)}commandDir(e,t){j("<string> [object]",[e,t],arguments.length);let n=a(this,Ar)||a(this,M).require;return a(this,ce).addDirectory(e,n,a(this,M).getCallerFile(),t),this}count(e){return j("<array|string>",[e],arguments.length),this[it]("count",e),this}default(e,t,n){return j("<object|string|array> [*] [string]",[e,t,n],arguments.length),n&&(ln(e,a(this,M)),a(this,P).defaultDescription[e]=n),typeof t=="function"&&(ln(e,a(this,M)),a(this,P).defaultDescription[e]||(a(this,P).defaultDescription[e]=a(this,U).functionDescription(t)),t=t.call()),this[xt](this.default.bind(this),"default",e,t),this}defaults(e,t,n){return this.default(e,t,n)}demandCommand(e=1,t,n,i){return j("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,t,n,i],arguments.length),typeof t!="number"&&(n=t,t=1/0),this.global("_",!1),a(this,P).demandedCommands._={min:e,max:t,minMsg:n,maxMsg:i},this}demand(e,t,n){return Array.isArray(t)?(t.forEach(i=>{_e(n,!0,a(this,M)),this.demandOption(i,n)}),t=1/0):typeof t!="number"&&(n=t,t=1/0),typeof e=="number"?(_e(n,!0,a(this,M)),this.demandCommand(e,t,n,n)):Array.isArray(e)?e.forEach(i=>{_e(n,!0,a(this,M)),this.demandOption(i,n)}):typeof n=="string"?this.demandOption(e,n):(n===!0||typeof n>"u")&&this.demandOption(e),this}demandOption(e,t){return j("<object|string|array> [string]",[e,t],arguments.length),this[xt](this.demandOption.bind(this),"demandedOptions",e,t),this}deprecateOption(e,t){return j("<string> [string|boolean]",[e,t],arguments.length),a(this,P).deprecatedOptions[e]=t,this}describe(e,t){return j("<object|string|array> [string]",[e,t],arguments.length),this[On](e,!0),a(this,U).describe(e,t),this}detectLocale(e){return j("<boolean>",[e],arguments.length),I(this,ut,e),this}env(e){return j("[string|boolean]",[e],arguments.length),e===!1?delete a(this,P).envPrefix:a(this,P).envPrefix=e||"",this}epilogue(e){return j("<string>",[e],arguments.length),a(this,U).epilog(e),this}epilog(e){return this.epilogue(e)}example(e,t){return j("<string|array> [string]",[e,t],arguments.length),Array.isArray(e)?e.forEach(n=>this.example(...n)):a(this,U).example(e,t),this}exit(e,t){I(this,je,!0),I(this,rt,t),a(this,De)&&a(this,M).process.exit(e)}exitProcess(e=!0){return j("[boolean]",[e],arguments.length),I(this,De,e),this}fail(e){if(j("<function|boolean>",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new ne("Invalid first argument. Expected function or boolean 'false'");return a(this,U).failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,t){return j("<array> [function]",[e,t],arguments.length),t?a(this,Te).getCompletion(e,t):new Promise((n,i)=>{a(this,Te).getCompletion(e,(s,o)=>{s?i(s):n(o)})})}getDemandedOptions(){return j([],0),a(this,P).demandedOptions}getDemandedCommands(){return j([],0),a(this,P).demandedCommands}getDeprecatedOptions(){return j([],0),a(this,P).deprecatedOptions}getDetectLocale(){return a(this,ut)}getExitProcess(){return a(this,De)}getGroups(){return Object.assign({},a(this,ke),a(this,dt))}getHelp(){if(I(this,je,!0),!a(this,U).hasCachedHelpMessage()){if(!this.parsed){let t=this[Wt](a(this,nt),void 0,void 0,0,!0);if(ie(t))return t.then(()=>a(this,U).help())}let e=a(this,ce).runDefaultBuilderOn(this);if(ie(e))return e.then(()=>a(this,U).help())}return Promise.resolve(a(this,U).help())}getOptions(){return a(this,P)}getStrict(){return a(this,pt)}getStrictCommands(){return a(this,ht)}getStrictOptions(){return a(this,mt)}global(e,t){return j("<string|array> [boolean]",[e,t],arguments.length),e=[].concat(e),t!==!1?a(this,P).local=a(this,P).local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{a(this,P).local.indexOf(n)===-1&&a(this,P).local.push(n)}),this}group(e,t){j("<string|array> <string>",[e,t],arguments.length);let n=a(this,dt)[t]||a(this,ke)[t];a(this,dt)[t]&&delete a(this,dt)[t];let i={};return a(this,ke)[t]=(n||[]).concat(e).filter(s=>i[s]?!1:i[s]=!0),this}hide(e){return j("<string>",[e],arguments.length),a(this,P).hiddenOptions.push(e),this}implies(e,t){return j("<string|object> [number|string|array]",[e,t],arguments.length),a(this,oe).implies(e,t),this}locale(e){return j("[string]",[e],arguments.length),e?(I(this,ut,!1),a(this,M).y18n.setLocale(e),this):(this[gn](),a(this,M).y18n.getLocale())}middleware(e,t,n){return a(this,qe).addMiddleware(e,!!t,n)}nargs(e,t){return j("<string|object|array> [number]",[e,t],arguments.length),this[xt](this.nargs.bind(this),"narg",e,t),this}normalize(e){return j("<array|string>",[e],arguments.length),this[it]("normalize",e),this}number(e){return j("<array|string>",[e],arguments.length),this[it]("number",e),this}option(e,t){if(j("<string|object> [object]",[e,t],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof t!="object"&&(t={}),a(this,P).key[e]=!0,t.alias&&this.alias(e,t.alias);let n=t.deprecate||t.deprecated;n&&this.deprecateOption(e,n);let i=t.demand||t.required||t.require;i&&this.demand(e,i),t.demandOption&&this.demandOption(e,typeof t.demandOption=="string"?t.demandOption:void 0),t.conflicts&&this.conflicts(e,t.conflicts),"default"in t&&this.default(e,t.default),t.implies!==void 0&&this.implies(e,t.implies),t.nargs!==void 0&&this.nargs(e,t.nargs),t.config&&this.config(e,t.configParser),t.normalize&&this.normalize(e),t.choices&&this.choices(e,t.choices),t.coerce&&this.coerce(e,t.coerce),t.group&&this.group(e,t.group),(t.boolean||t.type==="boolean")&&(this.boolean(e),t.alias&&this.boolean(t.alias)),(t.array||t.type==="array")&&(this.array(e),t.alias&&this.array(t.alias)),(t.number||t.type==="number")&&(this.number(e),t.alias&&this.number(t.alias)),(t.string||t.type==="string")&&(this.string(e),t.alias&&this.string(t.alias)),(t.count||t.type==="count")&&this.count(e),typeof t.global=="boolean"&&this.global(e,t.global),t.defaultDescription&&(a(this,P).defaultDescription[e]=t.defaultDescription),t.skipValidation&&this.skipValidation(e);let s=t.describe||t.description||t.desc;this.describe(e,s),t.hidden&&this.hide(e),t.requiresArg&&this.requiresArg(e)}return this}options(e,t){return this.option(e,t)}parse(e,t,n){j("[string|array] [function|boolean|object] [function]",[e,t,n],arguments.length),this[qo](),typeof e>"u"&&(e=a(this,nt)),typeof t=="object"&&(I(this,ft,t),t=n),typeof t=="function"&&(I(this,$e,t),t=!1),t||I(this,nt,e),a(this,$e)&&I(this,De,!1);let i=this[Wt](e,!!t),s=this.parsed;return a(this,Te).setParsed(this.parsed),ie(i)?i.then(o=>(a(this,$e)&&a(this,$e).call(this,a(this,rt),o,a(this,he)),o)).catch(o=>{throw a(this,$e)&&a(this,$e)(o,this.parsed.argv,a(this,he)),o}).finally(()=>{this[An](),this.parsed=s}):(a(this,$e)&&a(this,$e).call(this,a(this,rt),i,a(this,he)),this[An](),this.parsed=s,i)}parseAsync(e,t,n){let i=this.parse(e,t,n);return ie(i)?i:Promise.resolve(i)}parseSync(e,t,n){let i=this.parse(e,t,n);if(ie(i))throw new ne(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(e){return j("<object>",[e],arguments.length),I(this,_r,e),this}pkgConf(e,t){j("<string> [string]",[e,t],arguments.length);let n=null,i=this[yn](t||a(this,lt));return i[e]&&typeof i[e]=="object"&&(n=Gt(i[e],t||a(this,lt),this[gt]()["deep-merge-config"]||!1,a(this,M)),a(this,P).configObjects=(a(this,P).configObjects||[]).concat(n)),this}positional(e,t){j("<string> <object>",[e,t],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];t=et(t,(o,c)=>{let u=n.indexOf(o)!==-1;return o==="type"&&["string","number","boolean"].indexOf(c)===-1&&(u=!1),u});let i=a(this,kt).fullCommands[a(this,kt).fullCommands.length-1],s=i?a(this,ce).cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return At(s).forEach(o=>{let c=s[o];Array.isArray(c)?c.indexOf(e)!==-1&&(t[o]=!0):c[e]&&!(o in t)&&(t[o]=c[e])}),this.group(e,a(this,U).getPositionalGroupName()),this.option(e,t)}recommendCommands(e=!0){return j("[boolean]",[e],arguments.length),I(this,Sr,e),this}required(e,t,n){return this.demand(e,t,n)}require(e,t,n){return this.demand(e,t,n)}requiresArg(e){return j("<array|string|object> [number]",[e],arguments.length),typeof e=="string"&&a(this,P).narg[e]?this:(this[xt](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,t){return j("[string] [string]",[e,t],arguments.length),e=e||this.$0,a(this,St).log(a(this,Te).generateCompletionScript(e,t||a(this,ve)||"completion")),this}showHelp(e){if(j("[string|function]",[e],arguments.length),I(this,je,!0),!a(this,U).hasCachedHelpMessage()){if(!this.parsed){let n=this[Wt](a(this,nt),void 0,void 0,0,!0);if(ie(n))return n.then(()=>{a(this,U).showHelp(e)}),this}let t=a(this,ce).runDefaultBuilderOn(this);if(ie(t))return t.then(()=>{a(this,U).showHelp(e)}),this}return a(this,U).showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,t){return j("[boolean|string] [string]",[e,t],arguments.length),a(this,U).showHelpOnFail(e,t),this}showVersion(e){return j("[string|function]",[e],arguments.length),a(this,U).showVersion(e),this}skipValidation(e){return j("<array|string>",[e],arguments.length),this[it]("skipValidation",e),this}strict(e){return j("[boolean]",[e],arguments.length),I(this,pt,e!==!1),this}strictCommands(e){return j("[boolean]",[e],arguments.length),I(this,ht,e!==!1),this}strictOptions(e){return j("[boolean]",[e],arguments.length),I(this,mt,e!==!1),this}string(e){return j("<array|string>",[e],arguments.length),this[it]("string",e),this}terminalWidth(){return j([],0),a(this,M).process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return j("<object>",[e],arguments.length),I(this,ut,!1),a(this,M).y18n.updateLocale(e),this}usage(e,t,n,i){if(j("<string|null|undefined> [string|boolean] [function|object] [function]",[e,t,n,i],arguments.length),t!==void 0){if(_e(e,null,a(this,M)),(e||"").match(/^\$0( |$)/))return this.command(e,t,n,i);throw new ne(".usage() description must start with $0 if being used as alias for .command()")}else return a(this,U).usage(e),this}version(e,t,n){let i="version";if(j("[boolean|string] [string] [string]",[e,t,n],arguments.length),a(this,Be)&&(this[mn](a(this,Be)),a(this,U).version(void 0),I(this,Be,null)),arguments.length===0)n=this[Fo](),e=i;else if(arguments.length===1){if(e===!1)return this;n=e,e=i}else arguments.length===2&&(n=t,t=void 0);return I(this,Be,typeof e=="string"?e:i),t=t||a(this,U).deferY18nLookup("Show version number"),a(this,U).version(n||void 0),this.boolean(a(this,Be)),this.describe(a(this,Be),t),this}wrap(e){return j("<number|null|undefined>",[e],arguments.length),a(this,U).wrap(e),this}[(ce=new WeakMap,lt=new WeakMap,kt=new WeakMap,Te=new WeakMap,ve=new WeakMap,wr=new WeakMap,rt=new WeakMap,ut=new WeakMap,De=new WeakMap,Or=new WeakMap,qe=new WeakMap,ke=new WeakMap,je=new WeakMap,Me=new WeakMap,St=new WeakMap,he=new WeakMap,P=new WeakMap,Ar=new WeakMap,_r=new WeakMap,$e=new WeakMap,ft=new WeakMap,Ct=new WeakMap,dt=new WeakMap,nt=new WeakMap,Sr=new WeakMap,M=new WeakMap,pt=new WeakMap,ht=new WeakMap,mt=new WeakMap,U=new WeakMap,Be=new WeakMap,oe=new WeakMap,To)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[Do](){return{log:(...e)=>{this[Cr]()||console.log(...e),I(this,je,!0),a(this,he).length&&I(this,he,a(this,he)+`
72
- `),I(this,he,a(this,he)+e.join(" "))},error:(...e)=>{this[Cr]()||console.error(...e),I(this,je,!0),a(this,he).length&&I(this,he,a(this,he)+`
73
- `),I(this,he,a(this,he)+e.join(" "))}}}[mn](e){At(a(this,P)).forEach(t=>{if((i=>i==="configObjects")(t))return;let n=a(this,P)[t];Array.isArray(n)?~n.indexOf(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete a(this,U).getDescriptions()[e]}[qo](){a(this,Or).push({options:a(this,P),configObjects:a(this,P).configObjects.slice(0),exitProcess:a(this,De),groups:a(this,ke),strict:a(this,pt),strictCommands:a(this,ht),strictOptions:a(this,mt),completionCommand:a(this,ve),output:a(this,he),exitError:a(this,rt),hasOutput:a(this,je),parsed:this.parsed,parseFn:a(this,$e),parseContext:a(this,ft)}),a(this,U).freeze(),a(this,oe).freeze(),a(this,ce).freeze(),a(this,qe).freeze()}[Mo](){let e="",t;return/\b(node|iojs|electron)(\.exe)?$/.test(a(this,M).process.argv()[0])?t=a(this,M).process.argv().slice(1,2):t=a(this,M).process.argv().slice(0,1),e=t.map(n=>{let i=this[Ko](a(this,lt),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<n.length?i:n}).join(" ").trim(),a(this,M).getEnv("_")&&a(this,M).getProcessArgvBin()===a(this,M).getEnv("_")&&(e=a(this,M).getEnv("_").replace(`${a(this,M).path.dirname(a(this,M).process.execPath())}/`,"")),e}[gt](){return a(this,_r)}[gn](){if(!a(this,ut))return;let e=a(this,M).getEnv("LC_ALL")||a(this,M).getEnv("LC_MESSAGES")||a(this,M).getEnv("LANG")||a(this,M).getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[Fo](){return this[yn]().version||"unknown"}[zo](e){let t=e["--"]?e["--"]:e._;for(let n=0,i;(i=t[n])!==void 0;n++)a(this,M).Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(t[n]=Number(i));return e}[yn](e){let t=e||"*";if(a(this,Ct)[t])return a(this,Ct)[t];let n={};try{let i=e||a(this,M).mainFilename;!e&&a(this,M).path.extname(i)&&(i=a(this,M).path.dirname(i));let s=a(this,M).findUp(i,(o,c)=>{if(c.includes("package.json"))return"package.json"});_e(s,void 0,a(this,M)),n=JSON.parse(a(this,M).readFileSync(s,"utf8"))}catch{}return a(this,Ct)[t]=n||{},a(this,Ct)[t]}[it](e,t){t=[].concat(t),t.forEach(n=>{n=this[wn](n),a(this,P)[e].push(n)})}[xt](e,t,n,i){this[En](e,t,n,i,(s,o,c)=>{a(this,P)[s][o]=c})}[bn](e,t,n,i){this[En](e,t,n,i,(s,o,c)=>{a(this,P)[s][o]=(a(this,P)[s][o]||[]).concat(c)})}[En](e,t,n,i,s){if(Array.isArray(n))n.forEach(o=>{e(o,i)});else if((o=>typeof o=="object")(n))for(let o of At(n))e(o,n[o]);else s(t,this[wn](n),i)}[wn](e){return e==="__proto__"?"___proto___":e}[On](e,t){return this[xt](this[On].bind(this),"key",e,t),this}[An](){var e,t,n,i,s,o,c,u,p,h,l,b;let g=a(this,Or).pop();_e(g,void 0,a(this,M));let w;e=this,t=this,n=this,i=this,s=this,o=this,c=this,u=this,p=this,h=this,l=this,b=this,{options:{set value(d){I(e,P,d)}}.value,configObjects:w,exitProcess:{set value(d){I(t,De,d)}}.value,groups:{set value(d){I(n,ke,d)}}.value,output:{set value(d){I(i,he,d)}}.value,exitError:{set value(d){I(s,rt,d)}}.value,hasOutput:{set value(d){I(o,je,d)}}.value,parsed:this.parsed,strict:{set value(d){I(c,pt,d)}}.value,strictCommands:{set value(d){I(u,ht,d)}}.value,strictOptions:{set value(d){I(p,mt,d)}}.value,completionCommand:{set value(d){I(h,ve,d)}}.value,parseFn:{set value(d){I(l,$e,d)}}.value,parseContext:{set value(d){I(b,ft,d)}}.value}=g,a(this,P).configObjects=w,a(this,U).unfreeze(),a(this,oe).unfreeze(),a(this,ce).unfreeze(),a(this,qe).unfreeze()}[Uo](e,t){return ct(t,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[Go].bind(this),getContext:this[ko].bind(this),getHasOutput:this[Wo].bind(this),getLoggerInstance:this[Ho].bind(this),getParseContext:this[Vo].bind(this),getParserConfiguration:this[gt].bind(this),getUsageInstance:this[Bo].bind(this),getValidationInstance:this[Yo].bind(this),hasParseCallback:this[Cr].bind(this),postProcess:this[yt].bind(this),reset:this[_n].bind(this),runValidation:this[Sn].bind(this),runYargsParserAndExecuteCommands:this[Wt].bind(this),setHasOutput:this[Xo].bind(this)}}[Go](){return a(this,ce)}[ko](){return a(this,kt)}[Wo](){return a(this,je)}[Ho](){return a(this,St)}[Vo](){return a(this,ft)||{}}[Bo](){return a(this,U)}[Yo](){return a(this,oe)}[Cr](){return!!a(this,$e)}[yt](e,t,n,i){return n||ie(e)||(t||(e=this[To](e)),(this[gt]()["parse-positional-numbers"]||this[gt]()["parse-positional-numbers"]===void 0)&&(e=this[zo](e)),i&&(e=at(e,this,a(this,qe).getMiddleware(),!1))),e}[_n](e={}){I(this,P,a(this,P)||{});let t={};t.local=a(this,P).local?a(this,P).local:[],t.configObjects=a(this,P).configObjects?a(this,P).configObjects:[];let n={};t.local.forEach(o=>{n[o]=!0,(e[o]||[]).forEach(c=>{n[c]=!0})}),Object.assign(a(this,dt),Object.keys(a(this,ke)).reduce((o,c)=>{let u=a(this,ke)[c].filter(p=>!(p in n));return u.length>0&&(o[c]=u),o},{})),I(this,ke,{});let i=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return i.forEach(o=>{t[o]=(a(this,P)[o]||[]).filter(c=>!n[c])}),s.forEach(o=>{t[o]=et(a(this,P)[o],c=>!n[c])}),t.envPrefix=a(this,P).envPrefix,I(this,P,t),I(this,U,a(this,U)?a(this,U).reset(n):Ro(this,a(this,M))),I(this,oe,a(this,oe)?a(this,oe).reset(n):Lo(this,a(this,U),a(this,M))),I(this,ce,a(this,ce)?a(this,ce).reset():So(a(this,U),a(this,oe),a(this,qe),a(this,M))),a(this,Te)||I(this,Te,$o(this,a(this,U),a(this,ce),a(this,M))),a(this,qe).reset(),I(this,ve,null),I(this,he,""),I(this,rt,null),I(this,je,!1),this.parsed=!1,this}[Ko](e,t){return a(this,M).path.relative(e,t)}[Wt](e,t,n,i=0,s=!1){let o=!!n||s;e=e||a(this,nt),a(this,P).__=a(this,M).y18n.__,a(this,P).configuration=this[gt]();let c=!!a(this,P).configuration["populate--"],u=Object.assign({},a(this,P).configuration,{"populate--":!0}),p=a(this,M).Parser.detailed(e,Object.assign({},a(this,P),{configuration:{"parse-positional-numbers":!1,...u}})),h=Object.assign(p.argv,a(this,ft)),l,b=p.aliases,g=!1,w=!1;Object.keys(h).forEach(d=>{d===a(this,Me)&&h[d]?g=!0:d===a(this,Be)&&h[d]&&(w=!0)}),h.$0=this.$0,this.parsed=p,i===0&&a(this,U).clearCachedHelpMessage();try{if(this[gn](),t)return this[yt](h,c,!!n,!1);a(this,Me)&&~[a(this,Me)].concat(b[a(this,Me)]||[]).filter(G=>G.length>1).indexOf(""+h._[h._.length-1])&&(h._.pop(),g=!0);let d=a(this,ce).getCommands(),S=a(this,Te).completionKey in h,N=g||S||s;if(h._.length){if(d.length){let A;for(let G=i||0,W;h._[G]!==void 0;G++)if(W=String(h._[G]),~d.indexOf(W)&&W!==a(this,ve)){let xe=a(this,ce).runCommand(W,this,p,G+1,s,g||w||s);return this[yt](xe,c,!!n,!1)}else if(!A&&W!==a(this,ve)){A=W;break}!a(this,ce).hasDefaultCommand()&&a(this,Sr)&&A&&!N&&a(this,oe).recommendCommands(A,d)}a(this,ve)&&~h._.indexOf(a(this,ve))&&!S&&(a(this,De)&&tt(!0),this.showCompletionScript(),this.exit(0))}if(a(this,ce).hasDefaultCommand()&&!N){let A=a(this,ce).runCommand(null,this,p,0,s,g||w||s);return this[yt](A,c,!!n,!1)}if(S){a(this,De)&&tt(!0),e=[].concat(e);let A=e.slice(e.indexOf(`--${a(this,Te).completionKey}`)+1);return a(this,Te).getCompletion(A,(G,W)=>{if(G)throw new ne(G.message);(W||[]).forEach(xe=>{a(this,St).log(xe)}),this.exit(0)}),this[yt](h,!c,!!n,!1)}if(a(this,je)||(g?(a(this,De)&&tt(!0),o=!0,this.showHelp("log"),this.exit(0)):w&&(a(this,De)&&tt(!0),o=!0,a(this,U).showVersion("log"),this.exit(0))),!o&&a(this,P).skipValidation.length>0&&(o=Object.keys(h).some(A=>a(this,P).skipValidation.indexOf(A)>=0&&h[A]===!0)),!o){if(p.error)throw new ne(p.error.message);if(!S){let A=this[Sn](b,{},p.error);n||(l=at(h,this,a(this,qe).getMiddleware(),!0)),l=this[Uo](A,l??h),ie(l)&&!n&&(l=l.then(()=>at(h,this,a(this,qe).getMiddleware(),!1)))}}}catch(d){if(d instanceof ne)a(this,U).fail(d.message,d);else throw d}return this[yt](l??h,c,!!n,!0)}[Sn](e,t,n,i){e={...e},t={...t};let s={...this.getDemandedOptions()};return o=>{if(n)throw new ne(n.message);a(this,oe).nonOptionCount(o),a(this,oe).requiredArguments(o,s);let c=!1;a(this,ht)&&(c=a(this,oe).unknownCommands(o)),a(this,pt)&&!c?a(this,oe).unknownArguments(o,e,t,!!i):a(this,mt)&&a(this,oe).unknownArguments(o,e,{},!1,!1),a(this,oe).limitedChoices(o),a(this,oe).implications(o),a(this,oe).conflicting(o)}}[Xo](){I(this,je,!0)}};function Co(r){return!!r&&typeof r.getInternalMethods=="function"}var Df=Jo(cn),Qo=Df;var bt=Pt(ur(),1);import{spawnSync as vn}from"node:child_process";import{existsSync as ye,mkdirSync as jn,mkdtempSync as sa,readdirSync as oa,readFileSync as be,realpathSync as Zo,rmSync as aa,statSync as qf,writeFileSync as ae}from"node:fs";import{createRequire as Mf}from"node:module";import{tmpdir as ca}from"node:os";import{dirname as Ht,join as H,relative as Fe,resolve as Ff}from"node:path";import{fileURLToPath as zf}from"node:url";var Rt=new Set(["python","go","php","typescript","zod","mock","swr","tanstack-query","transformers","cli"]),ea=new Map([["tanstack-query-vue","vue"],["tanstack-query-svelte","svelte"],["tanstack-query-solid","solid"]]),Ce="@redocly/client-generator",Uf="https://redocly.com/docs/cli/commands/eject-generator",xn="@redocly/openapi-core",ta="<!-- redocly-generators:begin \u2014 managed by `redocly eject-generator`; content between markers is refreshed on eject -->",Rn="<!-- redocly-generators:end -->";function Gf(){let r=zf(new URL("./eject-assets/",import.meta.url));if(ye(H(r,"generators")))return r;let e=Mf(import.meta.url).resolve(Ce),t=H(Ht(e),"..","eject-assets");if(ye(H(t,"generators")))return t;throw new Oe(`
71
+ `;b.forEach(w=>{g+=w}),e.fail(g)}};let u={};s.conflicts=function(l,b){j("<string|object> [array|string]",[l,b],arguments.length),typeof l=="object"?Object.keys(l).forEach(g=>{s.conflicts(g,l[g])}):(r.global(l),u[l]||(u[l]=[]),Array.isArray(b)?b.forEach(g=>s.conflicts(l,g)):u[l].push(b))},s.getConflicting=()=>u,s.conflicting=function(l){Object.keys(l).forEach(b=>{u[b]&&u[b].forEach(g=>{g&&l[b]!==void 0&&l[g]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",b,g))})})},s.recommendCommands=function(l,b){b=b.sort((S,N)=>N.length-S.length);let w=null,d=1/0;for(let S=0,N;(N=b[S])!==void 0;S++){let A=Io(l,N);A<=3&&A<d&&(d=A,w=N)}w&&e.fail(n("Did you mean %s?",w))},s.reset=function(l){return o=et(o,b=>!l[b]),u=et(u,b=>!l[b]),s};let p=[];return s.freeze=function(){p.push({implied:o,conflicting:u})},s.unfreeze=function(){let l=p.pop();_e(l,void 0,t),{implied:o,conflicting:u}=l},s}var hn=[],Gt;function kt(r,e,t,n){Gt=n;let i={};if(Object.prototype.hasOwnProperty.call(r,"extends")){if(typeof r.extends!="string")return i;let s=/\.json|\..*rc$/.test(r.extends),o=null;if(s)o=Tf(e,r.extends);else try{o=ze.resolve(r.extends)}catch{return r}Nf(o),hn.push(o),i=s?JSON.parse(Gt.readFileSync(o,"utf8")):ze(r.extends),delete r.extends,i=kt(i,Gt.path.dirname(o),t,Gt)}return hn=[],t?No(i,r):Object.assign({},i,r)}function Nf(r){if(hn.indexOf(r)>-1)throw new ne(`Circular extended configurations: '${r}'.`)}function Tf(r,e){return Gt.path.resolve(r,e)}function No(r,e){let t={};function n(i){return i&&typeof i=="object"&&!Array.isArray(i)}Object.assign(t,r);for(let i of Object.keys(e))n(e[i])&&n(t[i])?t[i]=No(r[i],e[i]):t[i]=e[i];return t}var I=function(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t},a=function(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)},ce,lt,Wt,Te,ve,Or,rt,ut,De,Ar,qe,ke,je,Me,St,he,P,_r,Sr,$e,ft,Ct,dt,nt,Cr,M,pt,ht,mt,z,Be,oe;function Jo(r){return(e=[],t=r.process.cwd(),n)=>{let i=new Cn(e,t,n,r);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}var To=Symbol("copyDoubleDash"),Do=Symbol("copyDoubleDash"),mn=Symbol("deleteFromParserHintObject"),qo=Symbol("freeze"),Mo=Symbol("getDollarZero"),gt=Symbol("getParserConfiguration"),gn=Symbol("guessLocale"),Fo=Symbol("guessVersion"),Uo=Symbol("parsePositionalNumbers"),yn=Symbol("pkgUp"),it=Symbol("populateParserHintArray"),xt=Symbol("populateParserHintSingleValueDictionary"),bn=Symbol("populateParserHintArrayDictionary"),En=Symbol("populateParserHintDictionary"),wn=Symbol("sanitizeKey"),On=Symbol("setKey"),An=Symbol("unfreeze"),zo=Symbol("validateAsync"),Go=Symbol("getCommandInstance"),ko=Symbol("getContext"),Wo=Symbol("getHasOutput"),Ho=Symbol("getLoggerInstance"),Vo=Symbol("getParseContext"),Bo=Symbol("getUsageInstance"),Yo=Symbol("getValidationInstance"),xr=Symbol("hasParseCallback"),yt=Symbol("postProcess"),Ko=Symbol("rebase"),_n=Symbol("reset"),Ht=Symbol("runYargsParserAndExecuteCommands"),Sn=Symbol("runValidation"),Xo=Symbol("setHasOutput"),Cn=class{constructor(e=[],t,n,i){this.customScriptName=!1,this.parsed=!1,ce.set(this,void 0),lt.set(this,void 0),Wt.set(this,{commands:[],fullCommands:[]}),Te.set(this,null),ve.set(this,null),Or.set(this,"show-hidden"),rt.set(this,null),ut.set(this,!0),De.set(this,!0),Ar.set(this,[]),qe.set(this,void 0),ke.set(this,{}),je.set(this,!1),Me.set(this,null),St.set(this,void 0),he.set(this,""),P.set(this,void 0),_r.set(this,void 0),Sr.set(this,{}),$e.set(this,null),ft.set(this,null),Ct.set(this,{}),dt.set(this,{}),nt.set(this,void 0),Cr.set(this,!1),M.set(this,void 0),pt.set(this,!1),ht.set(this,!1),mt.set(this,!1),z.set(this,void 0),Be.set(this,null),oe.set(this,void 0),I(this,M,i),I(this,nt,e),I(this,lt,t),I(this,_r,n),I(this,qe,new br(this)),this.$0=this[Mo](),this[_n](),I(this,ce,a(this,ce)),I(this,z,a(this,z)),I(this,oe,a(this,oe)),I(this,P,a(this,P)),a(this,P).showHiddenOpt=a(this,Or),I(this,St,this[Do]())}addHelpOpt(e,t){let n="help";return j("[string|boolean] [string]",[e,t],arguments.length),a(this,Me)&&(this[mn](a(this,Me)),I(this,Me,null)),e===!1&&t===void 0?this:(I(this,Me,typeof e=="string"?e:n),this.boolean(a(this,Me)),this.describe(a(this,Me),t||a(this,z).deferY18nLookup("Show help")),this)}help(e,t){return this.addHelpOpt(e,t)}addShowHiddenOpt(e,t){if(j("[string|boolean] [string]",[e,t],arguments.length),e===!1&&t===void 0)return this;let n=typeof e=="string"?e:a(this,Or);return this.boolean(n),this.describe(n,t||a(this,z).deferY18nLookup("Show hidden options")),a(this,P).showHiddenOpt=n,this}showHidden(e,t){return this.addShowHiddenOpt(e,t)}alias(e,t){return j("<object|string|array> [string|array]",[e,t],arguments.length),this[bn](this.alias.bind(this),"alias",e,t),this}array(e){return j("<array|string>",[e],arguments.length),this[it]("array",e),this}boolean(e){return j("<array|string>",[e],arguments.length),this[it]("boolean",e),this}check(e,t){return j("<function> [boolean]",[e,t],arguments.length),this.middleware((n,i)=>ct(()=>e(n),s=>(s?(typeof s=="string"||s instanceof Error)&&a(this,z).fail(s.toString(),s):a(this,z).fail(a(this,M).y18n.__("Argument check failed: %s",e.toString())),n),s=>(a(this,z).fail(s.message?s.message:s.toString(),s),n)),!1,t),this}choices(e,t){return j("<object|string|array> [string|array]",[e,t],arguments.length),this[bn](this.choices.bind(this),"choices",e,t),this}coerce(e,t){if(j("<object|string|array> [function]",[e,t],arguments.length),Array.isArray(e)){if(!t)throw new ne("coerce callback must be provided");for(let n of e)this.coerce(n,t);return this}else if(typeof e=="object"){for(let n of Object.keys(e))this.coerce(n,e[n]);return this}if(!t)throw new ne("coerce callback must be provided");return a(this,P).key[e]=!0,a(this,qe).addCoerceMiddleware((n,i)=>{let s;return ct(()=>(s=i.getAliases(),t(n[e])),o=>{if(n[e]=o,s[e])for(let c of s[e])n[c]=o;return n},o=>{throw new ne(o.message)})},e),this}conflicts(e,t){return j("<string|object> [string|array]",[e,t],arguments.length),a(this,oe).conflicts(e,t),this}config(e="config",t,n){return j("[object|string] [string|function] [function]",[e,t,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=kt(e,a(this,lt),this[gt]()["deep-merge-config"]||!1,a(this,M)),a(this,P).configObjects=(a(this,P).configObjects||[]).concat(e),this):(typeof t=="function"&&(n=t,t=void 0),this.describe(e,t||a(this,z).deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(i=>{a(this,P).config[i]=n||!0}),this)}completion(e,t,n){return j("[string] [string|boolean|function] [function]",[e,t,n],arguments.length),typeof t=="function"&&(n=t,t=void 0),I(this,ve,e||a(this,ve)||"completion"),!t&&t!==!1&&(t="generate completion script"),this.command(a(this,ve),t),n&&a(this,Te).registerFunction(n),this}command(e,t,n,i,s,o){return j("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[e,t,n,i,s,o],arguments.length),a(this,ce).addHandler(e,t,n,i,s,o),this}commands(e,t,n,i,s,o){return this.command(e,t,n,i,s,o)}commandDir(e,t){j("<string> [object]",[e,t],arguments.length);let n=a(this,_r)||a(this,M).require;return a(this,ce).addDirectory(e,n,a(this,M).getCallerFile(),t),this}count(e){return j("<array|string>",[e],arguments.length),this[it]("count",e),this}default(e,t,n){return j("<object|string|array> [*] [string]",[e,t,n],arguments.length),n&&(ln(e,a(this,M)),a(this,P).defaultDescription[e]=n),typeof t=="function"&&(ln(e,a(this,M)),a(this,P).defaultDescription[e]||(a(this,P).defaultDescription[e]=a(this,z).functionDescription(t)),t=t.call()),this[xt](this.default.bind(this),"default",e,t),this}defaults(e,t,n){return this.default(e,t,n)}demandCommand(e=1,t,n,i){return j("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,t,n,i],arguments.length),typeof t!="number"&&(n=t,t=1/0),this.global("_",!1),a(this,P).demandedCommands._={min:e,max:t,minMsg:n,maxMsg:i},this}demand(e,t,n){return Array.isArray(t)?(t.forEach(i=>{_e(n,!0,a(this,M)),this.demandOption(i,n)}),t=1/0):typeof t!="number"&&(n=t,t=1/0),typeof e=="number"?(_e(n,!0,a(this,M)),this.demandCommand(e,t,n,n)):Array.isArray(e)?e.forEach(i=>{_e(n,!0,a(this,M)),this.demandOption(i,n)}):typeof n=="string"?this.demandOption(e,n):(n===!0||typeof n>"u")&&this.demandOption(e),this}demandOption(e,t){return j("<object|string|array> [string]",[e,t],arguments.length),this[xt](this.demandOption.bind(this),"demandedOptions",e,t),this}deprecateOption(e,t){return j("<string> [string|boolean]",[e,t],arguments.length),a(this,P).deprecatedOptions[e]=t,this}describe(e,t){return j("<object|string|array> [string]",[e,t],arguments.length),this[On](e,!0),a(this,z).describe(e,t),this}detectLocale(e){return j("<boolean>",[e],arguments.length),I(this,ut,e),this}env(e){return j("[string|boolean]",[e],arguments.length),e===!1?delete a(this,P).envPrefix:a(this,P).envPrefix=e||"",this}epilogue(e){return j("<string>",[e],arguments.length),a(this,z).epilog(e),this}epilog(e){return this.epilogue(e)}example(e,t){return j("<string|array> [string]",[e,t],arguments.length),Array.isArray(e)?e.forEach(n=>this.example(...n)):a(this,z).example(e,t),this}exit(e,t){I(this,je,!0),I(this,rt,t),a(this,De)&&a(this,M).process.exit(e)}exitProcess(e=!0){return j("[boolean]",[e],arguments.length),I(this,De,e),this}fail(e){if(j("<function|boolean>",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new ne("Invalid first argument. Expected function or boolean 'false'");return a(this,z).failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,t){return j("<array> [function]",[e,t],arguments.length),t?a(this,Te).getCompletion(e,t):new Promise((n,i)=>{a(this,Te).getCompletion(e,(s,o)=>{s?i(s):n(o)})})}getDemandedOptions(){return j([],0),a(this,P).demandedOptions}getDemandedCommands(){return j([],0),a(this,P).demandedCommands}getDeprecatedOptions(){return j([],0),a(this,P).deprecatedOptions}getDetectLocale(){return a(this,ut)}getExitProcess(){return a(this,De)}getGroups(){return Object.assign({},a(this,ke),a(this,dt))}getHelp(){if(I(this,je,!0),!a(this,z).hasCachedHelpMessage()){if(!this.parsed){let t=this[Ht](a(this,nt),void 0,void 0,0,!0);if(ie(t))return t.then(()=>a(this,z).help())}let e=a(this,ce).runDefaultBuilderOn(this);if(ie(e))return e.then(()=>a(this,z).help())}return Promise.resolve(a(this,z).help())}getOptions(){return a(this,P)}getStrict(){return a(this,pt)}getStrictCommands(){return a(this,ht)}getStrictOptions(){return a(this,mt)}global(e,t){return j("<string|array> [boolean]",[e,t],arguments.length),e=[].concat(e),t!==!1?a(this,P).local=a(this,P).local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{a(this,P).local.indexOf(n)===-1&&a(this,P).local.push(n)}),this}group(e,t){j("<string|array> <string>",[e,t],arguments.length);let n=a(this,dt)[t]||a(this,ke)[t];a(this,dt)[t]&&delete a(this,dt)[t];let i={};return a(this,ke)[t]=(n||[]).concat(e).filter(s=>i[s]?!1:i[s]=!0),this}hide(e){return j("<string>",[e],arguments.length),a(this,P).hiddenOptions.push(e),this}implies(e,t){return j("<string|object> [number|string|array]",[e,t],arguments.length),a(this,oe).implies(e,t),this}locale(e){return j("[string]",[e],arguments.length),e?(I(this,ut,!1),a(this,M).y18n.setLocale(e),this):(this[gn](),a(this,M).y18n.getLocale())}middleware(e,t,n){return a(this,qe).addMiddleware(e,!!t,n)}nargs(e,t){return j("<string|object|array> [number]",[e,t],arguments.length),this[xt](this.nargs.bind(this),"narg",e,t),this}normalize(e){return j("<array|string>",[e],arguments.length),this[it]("normalize",e),this}number(e){return j("<array|string>",[e],arguments.length),this[it]("number",e),this}option(e,t){if(j("<string|object> [object]",[e,t],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof t!="object"&&(t={}),a(this,P).key[e]=!0,t.alias&&this.alias(e,t.alias);let n=t.deprecate||t.deprecated;n&&this.deprecateOption(e,n);let i=t.demand||t.required||t.require;i&&this.demand(e,i),t.demandOption&&this.demandOption(e,typeof t.demandOption=="string"?t.demandOption:void 0),t.conflicts&&this.conflicts(e,t.conflicts),"default"in t&&this.default(e,t.default),t.implies!==void 0&&this.implies(e,t.implies),t.nargs!==void 0&&this.nargs(e,t.nargs),t.config&&this.config(e,t.configParser),t.normalize&&this.normalize(e),t.choices&&this.choices(e,t.choices),t.coerce&&this.coerce(e,t.coerce),t.group&&this.group(e,t.group),(t.boolean||t.type==="boolean")&&(this.boolean(e),t.alias&&this.boolean(t.alias)),(t.array||t.type==="array")&&(this.array(e),t.alias&&this.array(t.alias)),(t.number||t.type==="number")&&(this.number(e),t.alias&&this.number(t.alias)),(t.string||t.type==="string")&&(this.string(e),t.alias&&this.string(t.alias)),(t.count||t.type==="count")&&this.count(e),typeof t.global=="boolean"&&this.global(e,t.global),t.defaultDescription&&(a(this,P).defaultDescription[e]=t.defaultDescription),t.skipValidation&&this.skipValidation(e);let s=t.describe||t.description||t.desc;this.describe(e,s),t.hidden&&this.hide(e),t.requiresArg&&this.requiresArg(e)}return this}options(e,t){return this.option(e,t)}parse(e,t,n){j("[string|array] [function|boolean|object] [function]",[e,t,n],arguments.length),this[qo](),typeof e>"u"&&(e=a(this,nt)),typeof t=="object"&&(I(this,ft,t),t=n),typeof t=="function"&&(I(this,$e,t),t=!1),t||I(this,nt,e),a(this,$e)&&I(this,De,!1);let i=this[Ht](e,!!t),s=this.parsed;return a(this,Te).setParsed(this.parsed),ie(i)?i.then(o=>(a(this,$e)&&a(this,$e).call(this,a(this,rt),o,a(this,he)),o)).catch(o=>{throw a(this,$e)&&a(this,$e)(o,this.parsed.argv,a(this,he)),o}).finally(()=>{this[An](),this.parsed=s}):(a(this,$e)&&a(this,$e).call(this,a(this,rt),i,a(this,he)),this[An](),this.parsed=s,i)}parseAsync(e,t,n){let i=this.parse(e,t,n);return ie(i)?i:Promise.resolve(i)}parseSync(e,t,n){let i=this.parse(e,t,n);if(ie(i))throw new ne(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(e){return j("<object>",[e],arguments.length),I(this,Sr,e),this}pkgConf(e,t){j("<string> [string]",[e,t],arguments.length);let n=null,i=this[yn](t||a(this,lt));return i[e]&&typeof i[e]=="object"&&(n=kt(i[e],t||a(this,lt),this[gt]()["deep-merge-config"]||!1,a(this,M)),a(this,P).configObjects=(a(this,P).configObjects||[]).concat(n)),this}positional(e,t){j("<string> <object>",[e,t],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];t=et(t,(o,c)=>{let u=n.indexOf(o)!==-1;return o==="type"&&["string","number","boolean"].indexOf(c)===-1&&(u=!1),u});let i=a(this,Wt).fullCommands[a(this,Wt).fullCommands.length-1],s=i?a(this,ce).cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return At(s).forEach(o=>{let c=s[o];Array.isArray(c)?c.indexOf(e)!==-1&&(t[o]=!0):c[e]&&!(o in t)&&(t[o]=c[e])}),this.group(e,a(this,z).getPositionalGroupName()),this.option(e,t)}recommendCommands(e=!0){return j("[boolean]",[e],arguments.length),I(this,Cr,e),this}required(e,t,n){return this.demand(e,t,n)}require(e,t,n){return this.demand(e,t,n)}requiresArg(e){return j("<array|string|object> [number]",[e],arguments.length),typeof e=="string"&&a(this,P).narg[e]?this:(this[xt](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,t){return j("[string] [string]",[e,t],arguments.length),e=e||this.$0,a(this,St).log(a(this,Te).generateCompletionScript(e,t||a(this,ve)||"completion")),this}showHelp(e){if(j("[string|function]",[e],arguments.length),I(this,je,!0),!a(this,z).hasCachedHelpMessage()){if(!this.parsed){let n=this[Ht](a(this,nt),void 0,void 0,0,!0);if(ie(n))return n.then(()=>{a(this,z).showHelp(e)}),this}let t=a(this,ce).runDefaultBuilderOn(this);if(ie(t))return t.then(()=>{a(this,z).showHelp(e)}),this}return a(this,z).showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,t){return j("[boolean|string] [string]",[e,t],arguments.length),a(this,z).showHelpOnFail(e,t),this}showVersion(e){return j("[string|function]",[e],arguments.length),a(this,z).showVersion(e),this}skipValidation(e){return j("<array|string>",[e],arguments.length),this[it]("skipValidation",e),this}strict(e){return j("[boolean]",[e],arguments.length),I(this,pt,e!==!1),this}strictCommands(e){return j("[boolean]",[e],arguments.length),I(this,ht,e!==!1),this}strictOptions(e){return j("[boolean]",[e],arguments.length),I(this,mt,e!==!1),this}string(e){return j("<array|string>",[e],arguments.length),this[it]("string",e),this}terminalWidth(){return j([],0),a(this,M).process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return j("<object>",[e],arguments.length),I(this,ut,!1),a(this,M).y18n.updateLocale(e),this}usage(e,t,n,i){if(j("<string|null|undefined> [string|boolean] [function|object] [function]",[e,t,n,i],arguments.length),t!==void 0){if(_e(e,null,a(this,M)),(e||"").match(/^\$0( |$)/))return this.command(e,t,n,i);throw new ne(".usage() description must start with $0 if being used as alias for .command()")}else return a(this,z).usage(e),this}version(e,t,n){let i="version";if(j("[boolean|string] [string] [string]",[e,t,n],arguments.length),a(this,Be)&&(this[mn](a(this,Be)),a(this,z).version(void 0),I(this,Be,null)),arguments.length===0)n=this[Fo](),e=i;else if(arguments.length===1){if(e===!1)return this;n=e,e=i}else arguments.length===2&&(n=t,t=void 0);return I(this,Be,typeof e=="string"?e:i),t=t||a(this,z).deferY18nLookup("Show version number"),a(this,z).version(n||void 0),this.boolean(a(this,Be)),this.describe(a(this,Be),t),this}wrap(e){return j("<number|null|undefined>",[e],arguments.length),a(this,z).wrap(e),this}[(ce=new WeakMap,lt=new WeakMap,Wt=new WeakMap,Te=new WeakMap,ve=new WeakMap,Or=new WeakMap,rt=new WeakMap,ut=new WeakMap,De=new WeakMap,Ar=new WeakMap,qe=new WeakMap,ke=new WeakMap,je=new WeakMap,Me=new WeakMap,St=new WeakMap,he=new WeakMap,P=new WeakMap,_r=new WeakMap,Sr=new WeakMap,$e=new WeakMap,ft=new WeakMap,Ct=new WeakMap,dt=new WeakMap,nt=new WeakMap,Cr=new WeakMap,M=new WeakMap,pt=new WeakMap,ht=new WeakMap,mt=new WeakMap,z=new WeakMap,Be=new WeakMap,oe=new WeakMap,To)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[Do](){return{log:(...e)=>{this[xr]()||console.log(...e),I(this,je,!0),a(this,he).length&&I(this,he,a(this,he)+`
72
+ `),I(this,he,a(this,he)+e.join(" "))},error:(...e)=>{this[xr]()||console.error(...e),I(this,je,!0),a(this,he).length&&I(this,he,a(this,he)+`
73
+ `),I(this,he,a(this,he)+e.join(" "))}}}[mn](e){At(a(this,P)).forEach(t=>{if((i=>i==="configObjects")(t))return;let n=a(this,P)[t];Array.isArray(n)?~n.indexOf(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete a(this,z).getDescriptions()[e]}[qo](){a(this,Ar).push({options:a(this,P),configObjects:a(this,P).configObjects.slice(0),exitProcess:a(this,De),groups:a(this,ke),strict:a(this,pt),strictCommands:a(this,ht),strictOptions:a(this,mt),completionCommand:a(this,ve),output:a(this,he),exitError:a(this,rt),hasOutput:a(this,je),parsed:this.parsed,parseFn:a(this,$e),parseContext:a(this,ft)}),a(this,z).freeze(),a(this,oe).freeze(),a(this,ce).freeze(),a(this,qe).freeze()}[Mo](){let e="",t;return/\b(node|iojs|electron)(\.exe)?$/.test(a(this,M).process.argv()[0])?t=a(this,M).process.argv().slice(1,2):t=a(this,M).process.argv().slice(0,1),e=t.map(n=>{let i=this[Ko](a(this,lt),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<n.length?i:n}).join(" ").trim(),a(this,M).getEnv("_")&&a(this,M).getProcessArgvBin()===a(this,M).getEnv("_")&&(e=a(this,M).getEnv("_").replace(`${a(this,M).path.dirname(a(this,M).process.execPath())}/`,"")),e}[gt](){return a(this,Sr)}[gn](){if(!a(this,ut))return;let e=a(this,M).getEnv("LC_ALL")||a(this,M).getEnv("LC_MESSAGES")||a(this,M).getEnv("LANG")||a(this,M).getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[Fo](){return this[yn]().version||"unknown"}[Uo](e){let t=e["--"]?e["--"]:e._;for(let n=0,i;(i=t[n])!==void 0;n++)a(this,M).Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(t[n]=Number(i));return e}[yn](e){let t=e||"*";if(a(this,Ct)[t])return a(this,Ct)[t];let n={};try{let i=e||a(this,M).mainFilename;!e&&a(this,M).path.extname(i)&&(i=a(this,M).path.dirname(i));let s=a(this,M).findUp(i,(o,c)=>{if(c.includes("package.json"))return"package.json"});_e(s,void 0,a(this,M)),n=JSON.parse(a(this,M).readFileSync(s,"utf8"))}catch{}return a(this,Ct)[t]=n||{},a(this,Ct)[t]}[it](e,t){t=[].concat(t),t.forEach(n=>{n=this[wn](n),a(this,P)[e].push(n)})}[xt](e,t,n,i){this[En](e,t,n,i,(s,o,c)=>{a(this,P)[s][o]=c})}[bn](e,t,n,i){this[En](e,t,n,i,(s,o,c)=>{a(this,P)[s][o]=(a(this,P)[s][o]||[]).concat(c)})}[En](e,t,n,i,s){if(Array.isArray(n))n.forEach(o=>{e(o,i)});else if((o=>typeof o=="object")(n))for(let o of At(n))e(o,n[o]);else s(t,this[wn](n),i)}[wn](e){return e==="__proto__"?"___proto___":e}[On](e,t){return this[xt](this[On].bind(this),"key",e,t),this}[An](){var e,t,n,i,s,o,c,u,p,h,l,b;let g=a(this,Ar).pop();_e(g,void 0,a(this,M));let w;e=this,t=this,n=this,i=this,s=this,o=this,c=this,u=this,p=this,h=this,l=this,b=this,{options:{set value(d){I(e,P,d)}}.value,configObjects:w,exitProcess:{set value(d){I(t,De,d)}}.value,groups:{set value(d){I(n,ke,d)}}.value,output:{set value(d){I(i,he,d)}}.value,exitError:{set value(d){I(s,rt,d)}}.value,hasOutput:{set value(d){I(o,je,d)}}.value,parsed:this.parsed,strict:{set value(d){I(c,pt,d)}}.value,strictCommands:{set value(d){I(u,ht,d)}}.value,strictOptions:{set value(d){I(p,mt,d)}}.value,completionCommand:{set value(d){I(h,ve,d)}}.value,parseFn:{set value(d){I(l,$e,d)}}.value,parseContext:{set value(d){I(b,ft,d)}}.value}=g,a(this,P).configObjects=w,a(this,z).unfreeze(),a(this,oe).unfreeze(),a(this,ce).unfreeze(),a(this,qe).unfreeze()}[zo](e,t){return ct(t,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[Go].bind(this),getContext:this[ko].bind(this),getHasOutput:this[Wo].bind(this),getLoggerInstance:this[Ho].bind(this),getParseContext:this[Vo].bind(this),getParserConfiguration:this[gt].bind(this),getUsageInstance:this[Bo].bind(this),getValidationInstance:this[Yo].bind(this),hasParseCallback:this[xr].bind(this),postProcess:this[yt].bind(this),reset:this[_n].bind(this),runValidation:this[Sn].bind(this),runYargsParserAndExecuteCommands:this[Ht].bind(this),setHasOutput:this[Xo].bind(this)}}[Go](){return a(this,ce)}[ko](){return a(this,Wt)}[Wo](){return a(this,je)}[Ho](){return a(this,St)}[Vo](){return a(this,ft)||{}}[Bo](){return a(this,z)}[Yo](){return a(this,oe)}[xr](){return!!a(this,$e)}[yt](e,t,n,i){return n||ie(e)||(t||(e=this[To](e)),(this[gt]()["parse-positional-numbers"]||this[gt]()["parse-positional-numbers"]===void 0)&&(e=this[Uo](e)),i&&(e=at(e,this,a(this,qe).getMiddleware(),!1))),e}[_n](e={}){I(this,P,a(this,P)||{});let t={};t.local=a(this,P).local?a(this,P).local:[],t.configObjects=a(this,P).configObjects?a(this,P).configObjects:[];let n={};t.local.forEach(o=>{n[o]=!0,(e[o]||[]).forEach(c=>{n[c]=!0})}),Object.assign(a(this,dt),Object.keys(a(this,ke)).reduce((o,c)=>{let u=a(this,ke)[c].filter(p=>!(p in n));return u.length>0&&(o[c]=u),o},{})),I(this,ke,{});let i=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return i.forEach(o=>{t[o]=(a(this,P)[o]||[]).filter(c=>!n[c])}),s.forEach(o=>{t[o]=et(a(this,P)[o],c=>!n[c])}),t.envPrefix=a(this,P).envPrefix,I(this,P,t),I(this,z,a(this,z)?a(this,z).reset(n):Ro(this,a(this,M))),I(this,oe,a(this,oe)?a(this,oe).reset(n):Lo(this,a(this,z),a(this,M))),I(this,ce,a(this,ce)?a(this,ce).reset():So(a(this,z),a(this,oe),a(this,qe),a(this,M))),a(this,Te)||I(this,Te,$o(this,a(this,z),a(this,ce),a(this,M))),a(this,qe).reset(),I(this,ve,null),I(this,he,""),I(this,rt,null),I(this,je,!1),this.parsed=!1,this}[Ko](e,t){return a(this,M).path.relative(e,t)}[Ht](e,t,n,i=0,s=!1){let o=!!n||s;e=e||a(this,nt),a(this,P).__=a(this,M).y18n.__,a(this,P).configuration=this[gt]();let c=!!a(this,P).configuration["populate--"],u=Object.assign({},a(this,P).configuration,{"populate--":!0}),p=a(this,M).Parser.detailed(e,Object.assign({},a(this,P),{configuration:{"parse-positional-numbers":!1,...u}})),h=Object.assign(p.argv,a(this,ft)),l,b=p.aliases,g=!1,w=!1;Object.keys(h).forEach(d=>{d===a(this,Me)&&h[d]?g=!0:d===a(this,Be)&&h[d]&&(w=!0)}),h.$0=this.$0,this.parsed=p,i===0&&a(this,z).clearCachedHelpMessage();try{if(this[gn](),t)return this[yt](h,c,!!n,!1);a(this,Me)&&~[a(this,Me)].concat(b[a(this,Me)]||[]).filter(G=>G.length>1).indexOf(""+h._[h._.length-1])&&(h._.pop(),g=!0);let d=a(this,ce).getCommands(),S=a(this,Te).completionKey in h,N=g||S||s;if(h._.length){if(d.length){let A;for(let G=i||0,W;h._[G]!==void 0;G++)if(W=String(h._[G]),~d.indexOf(W)&&W!==a(this,ve)){let xe=a(this,ce).runCommand(W,this,p,G+1,s,g||w||s);return this[yt](xe,c,!!n,!1)}else if(!A&&W!==a(this,ve)){A=W;break}!a(this,ce).hasDefaultCommand()&&a(this,Cr)&&A&&!N&&a(this,oe).recommendCommands(A,d)}a(this,ve)&&~h._.indexOf(a(this,ve))&&!S&&(a(this,De)&&tt(!0),this.showCompletionScript(),this.exit(0))}if(a(this,ce).hasDefaultCommand()&&!N){let A=a(this,ce).runCommand(null,this,p,0,s,g||w||s);return this[yt](A,c,!!n,!1)}if(S){a(this,De)&&tt(!0),e=[].concat(e);let A=e.slice(e.indexOf(`--${a(this,Te).completionKey}`)+1);return a(this,Te).getCompletion(A,(G,W)=>{if(G)throw new ne(G.message);(W||[]).forEach(xe=>{a(this,St).log(xe)}),this.exit(0)}),this[yt](h,!c,!!n,!1)}if(a(this,je)||(g?(a(this,De)&&tt(!0),o=!0,this.showHelp("log"),this.exit(0)):w&&(a(this,De)&&tt(!0),o=!0,a(this,z).showVersion("log"),this.exit(0))),!o&&a(this,P).skipValidation.length>0&&(o=Object.keys(h).some(A=>a(this,P).skipValidation.indexOf(A)>=0&&h[A]===!0)),!o){if(p.error)throw new ne(p.error.message);if(!S){let A=this[Sn](b,{},p.error);n||(l=at(h,this,a(this,qe).getMiddleware(),!0)),l=this[zo](A,l??h),ie(l)&&!n&&(l=l.then(()=>at(h,this,a(this,qe).getMiddleware(),!1)))}}}catch(d){if(d instanceof ne)a(this,z).fail(d.message,d);else throw d}return this[yt](l??h,c,!!n,!0)}[Sn](e,t,n,i){e={...e},t={...t};let s={...this.getDemandedOptions()};return o=>{if(n)throw new ne(n.message);a(this,oe).nonOptionCount(o),a(this,oe).requiredArguments(o,s);let c=!1;a(this,ht)&&(c=a(this,oe).unknownCommands(o)),a(this,pt)&&!c?a(this,oe).unknownArguments(o,e,t,!!i):a(this,mt)&&a(this,oe).unknownArguments(o,e,{},!1,!1),a(this,oe).limitedChoices(o),a(this,oe).implications(o),a(this,oe).conflicting(o)}}[Xo](){I(this,je,!0)}};function Co(r){return!!r&&typeof r.getInternalMethods=="function"}var Df=Jo(cn),Qo=Df;var bt=Lt(fr(),1);import{spawnSync as vn}from"node:child_process";import{existsSync as ye,mkdirSync as jn,mkdtempSync as sa,readdirSync as oa,readFileSync as be,realpathSync as Zo,rmSync as aa,statSync as qf,writeFileSync as ae}from"node:fs";import{createRequire as Mf}from"node:module";import{tmpdir as ca}from"node:os";import{dirname as Vt,join as H,relative as Fe,resolve as Ff}from"node:path";import{fileURLToPath as Uf}from"node:url";var Rt=new Set(["python","go","php","typescript","zod","mock","swr","tanstack-query","transformers","cli"]),ea=new Map([["tanstack-query-vue","vue"],["tanstack-query-svelte","svelte"],["tanstack-query-solid","solid"]]),Ce="@redocly/client-generator",zf="https://redocly.com/docs/cli/commands/eject-generator",xn="@redocly/openapi-core",ta="<!-- redocly-generators:begin \u2014 managed by `redocly eject-generator`; content between markers is refreshed on eject -->",Rn="<!-- redocly-generators:end -->";function Gf(){let r=Uf(new URL("./eject-assets/",import.meta.url));if(ye(H(r,"generators")))return r;let e=Mf(import.meta.url).resolve(Ce),t=H(Vt(e),"..","eject-assets");if(ye(H(t,"generators")))return t;throw new Oe(`
74
74
  \u274C The ejectable generator sources are missing from ${Ce}.
75
75
  In a checkout of the CLI, build them first: npm run prepare -w ${Ce}
76
- `)}function ra(r,e){let t=H(process.cwd(),".claude","skills",r,"SKILL.md");return jn(Ht(t),{recursive:!0}),ae(t,be(H(e,"skills",r,"SKILL.md"),"utf-8"),"utf-8"),Fe(process.cwd(),t)}function $n(r,e){let t=["# Ejected client generators","","These files are Redocly client generators you own; `redocly generate-client` runs them.","Their design and the authoring toolkit are agent skills \u2014 edit the skill first, then make","the code match, and never hand-edit generated client output:","","- `.claude/skills/client-generators/SKILL.md` \u2014 the API model, the helpers, the loop.",...e.map(u=>`- \`.claude/skills/${u}-generator/SKILL.md\` \u2014 the \`${u}\` generator's design.`)],n=`${ta}
76
+ `)}function ra(r,e){let t=H(process.cwd(),".claude","skills",r,"SKILL.md");return jn(Vt(t),{recursive:!0}),ae(t,be(H(e,"skills",r,"SKILL.md"),"utf-8"),"utf-8"),Fe(process.cwd(),t)}function $n(r,e){let t=["# Ejected client generators","","These files are Redocly client generators you own; `redocly generate-client` runs them.","Their design and the authoring toolkit are agent skills \u2014 edit the skill first, then make","the code match, and never hand-edit generated client output:","","- `.claude/skills/client-generators/SKILL.md` \u2014 the API model, the helpers, the loop.",...e.map(u=>`- \`.claude/skills/${u}-generator/SKILL.md\` \u2014 the \`${u}\` generator's design.`)],n=`${ta}
77
77
 
78
78
  ${t.join(`
79
79
  `)}
@@ -82,7 +82,7 @@ ${Rn}
82
82
  `,i=H(r,"AGENTS.md");if(!ye(i)){ae(i,n,"utf-8");return}let s=be(i,"utf-8"),o=s.indexOf(ta),c=s.indexOf(Rn);if(o===-1||c===-1){K.warn(`eject-generator: ${i} exists without the managed markers \u2014 leaving it untouched.
83
83
  `);return}ae(i,s.slice(0,o)+n.trimEnd()+s.slice(c+Rn.length),"utf-8")}function In(r,e,t){let n=sa(H(ca(),"redocly-eject-merge-")),i={ours:H(n,".merge-ours"),base:H(n,".merge-base"),theirs:H(n,".merge-theirs")};ae(i.ours,r,"utf-8"),ae(i.base,e,"utf-8"),ae(i.theirs,t,"utf-8");let s=vn("git",["merge-file","-p","-L","yours","-L","ejected-from","-L","update",i.ours,i.base,i.theirs],{encoding:"utf-8"});if(aa(n,{recursive:!0,force:!0}),s.error||s.status===null)throw te.eject_generator_outcome="merge-tool-missing",new Oe("\n\u274C `--update` needs `git` on PATH for the three-way merge. Alternative: eject to a temporary directory and diff by hand.\n");if(s.status>127)throw te.eject_generator_outcome="merge-failed",new Oe(`
84
84
  \u274C \`git merge-file\` could not merge the update (your copy is untouched): ${s.stderr.trim()}
85
- `);return{merged:s.stdout,conflicts:s.status}}function la(r){return/Ejected from @redocly\/client-generator@(\S+)/.exec(r)?.[1]}function ua(r,e){let t=sa(H(ca(),"redocly-eject-base-")),n=new Map;try{if(vn("npm",["pack",r,"--pack-destination",t],{encoding:"utf-8"}).status!==0)return n;let s=oa(t).find(o=>o.endsWith(".tgz"));if(s===void 0)return n;for(let o of e)vn("tar",["-xzf",H(t,s),"-C",t,o],{encoding:"utf-8"}).status===0&&n.set(o,be(H(t,o),"utf-8"));return n}finally{aa(t,{recursive:!0,force:!0})}}var na=r=>`package/eject-assets/generators/${r}.mjs`,ia=(r,e)=>`package/eject-assets/generators/${r}/${e}`,vt=r=>`package/eject-assets/skills/${r}/SKILL.md`;function kf(r,e){let t=H(r,"generators",e);if(!(!ye(t)||!qf(t).isDirectory()))return oa(t).filter(n=>n.endsWith(".ts")).sort()}function xr(r,e,t){let n=H(process.cwd(),".claude","skills",r,"SKILL.md"),i=be(H(e,"skills",r,"SKILL.md"),"utf-8");if(!ye(n))return jn(Ht(n),{recursive:!0}),ae(n,i,"utf-8"),0;let s=be(n,"utf-8");if(s===i)return 0;if(t===void 0)return ae(`${n}.new`,i,"utf-8"),K.warn(`${Fe(process.cwd(),n)} was edited and has no merge base \u2014 the new skill is beside it as SKILL.md.new.
85
+ `);return{merged:s.stdout,conflicts:s.status}}function la(r){return/Ejected from @redocly\/client-generator@(\S+)/.exec(r)?.[1]}function ua(r,e){let t=sa(H(ca(),"redocly-eject-base-")),n=new Map;try{if(vn("npm",["pack",r,"--pack-destination",t],{encoding:"utf-8"}).status!==0)return n;let s=oa(t).find(o=>o.endsWith(".tgz"));if(s===void 0)return n;for(let o of e)vn("tar",["-xzf",H(t,s),"-C",t,o],{encoding:"utf-8"}).status===0&&n.set(o,be(H(t,o),"utf-8"));return n}finally{aa(t,{recursive:!0,force:!0})}}var na=r=>`package/eject-assets/generators/${r}.mjs`,ia=(r,e)=>`package/eject-assets/generators/${r}/${e}`,vt=r=>`package/eject-assets/skills/${r}/SKILL.md`;function kf(r,e){let t=H(r,"generators",e);if(!(!ye(t)||!qf(t).isDirectory()))return oa(t).filter(n=>n.endsWith(".ts")).sort()}function Rr(r,e,t){let n=H(process.cwd(),".claude","skills",r,"SKILL.md"),i=be(H(e,"skills",r,"SKILL.md"),"utf-8");if(!ye(n))return jn(Vt(n),{recursive:!0}),ae(n,i,"utf-8"),0;let s=be(n,"utf-8");if(s===i)return 0;if(t===void 0)return ae(`${n}.new`,i,"utf-8"),K.warn(`${Fe(process.cwd(),n)} was edited and has no merge base \u2014 the new skill is beside it as SKILL.md.new.
86
86
  `),0;let{merged:o,conflicts:c}=In(s,t,i);return ae(n,o,"utf-8"),c}function Pn(r){return[...Rt].filter(e=>ye(H(r,`${e}.mjs`))||ye(H(r,e,"index.ts")))}function Ln(r,e=!1){let t=H(process.cwd(),"package.json");if(!ye(t))return"no-package-json";let n=be(t,"utf-8"),i=JSON.parse(n),s="present",o={};for(let[u,p]of Object.entries(r)){let h=i.devDependencies?.[u]!==void 0?i.devDependencies:i.dependencies?.[u]!==void 0?i.dependencies:void 0;h===void 0?(o[u]=`^${p}`,s="added"):e&&!(bt.validRange(h[u])!==null&&bt.satisfies(p,h[u]))&&(h[u]=`^${p}`,s==="present"&&(s="updated"))}if(s==="present")return"present";if(Object.keys(o).length>0){let u={...i.devDependencies,...o};i.devDependencies=Object.fromEntries(Object.entries(u).sort(([p],[h])=>p.localeCompare(h)))}let c=/^([ \t]+)"/m.exec(n)?.[1]??" ";return ae(t,`${JSON.stringify(i,null,c)}
87
87
  `,"utf-8"),s}function Wf(r,e,t,n,i){let s=Wn(e),o=we(s)&&we(s.apis)?s.apis:{};if(Object.values(o).some(c=>we(c)&&we(c.client)))return!1;if(n===-1){if(/^client:/m.test(e))return!1;let c=e===""||e.endsWith(`
88
88
  `)?"":`
@@ -102,7 +102,7 @@ ${Rn}
102
102
  \u274C Could not read the version ${c} was ejected from (not recorded in its header), so there is no merge base.
103
103
  Eject to a temporary directory and diff by hand, or re-eject with --force.
104
104
  `);let h=0;for(let S of e){let N=be(H(n,"generators",r,S),"utf-8"),A=H(s,S);if(!ye(A)){ae(A,N,"utf-8");continue}let G=be(A,"utf-8");if(G===N)continue;let W=u===t?N:p.get(ia(r,S));if(W===void 0){ae(`${A}.new`,N,"utf-8"),K.warn(`${Fe(process.cwd(),A)} has no merge base in ${Ce}@${u} \u2014 the new file is beside it as ${S}.new.
105
- `);continue}let xe=In(G,W,N);ae(A,xe.merged,"utf-8"),h+=xe.conflicts}let l=S=>u===t?be(H(n,"skills",S,"SKILL.md"),"utf-8"):p.get(vt(S)),b=xr("client-generators",n,l("client-generators"))+xr(`${r}-generator`,n,l(`${r}-generator`));$n(i,Pn(i));let g=Ln({[Ce]:t},!0);(g==="updated"||g==="added")&&K.info(`Set ${Ce} to ^${t} in package.json \u2014 run your installer.
105
+ `);continue}let xe=In(G,W,N);ae(A,xe.merged,"utf-8"),h+=xe.conflicts}let l=S=>u===t?be(H(n,"skills",S,"SKILL.md"),"utf-8"):p.get(vt(S)),b=Rr("client-generators",n,l("client-generators"))+Rr(`${r}-generator`,n,l(`${r}-generator`));$n(i,Pn(i));let g=Ln({[Ce]:t},!0);(g==="updated"||g==="added")&&K.info(`Set ${Ce} to ^${t} in package.json \u2014 run your installer.
106
106
  `);let w=h+b;te.eject_generator_outcome=w>0?"conflicts":"success";let d=Fe(process.cwd(),s)||s;w>0?(te.eject_generator_conflicts=w,K.warn(`Updated ${d} with ${w} conflict(s)${b>0?" (some in .claude/skills)":""} \u2014 resolve the <<<<<<< markers, then regenerate.
107
107
  `)):K.info(`Updated ${d} cleanly.
108
108
  `)}function Bf({name:r,asset:e,toolkitVersion:t,assetsDir:n,dir:i,target:s,printedTarget:o}){if(!ye(s))throw te.eject_generator_outcome="missing-target",new Oe(`
@@ -111,7 +111,7 @@ ${Rn}
111
111
  \u274C Could not read the version this file was ejected from (${p??"not recorded in its header"}), so there is no merge base.
112
112
  The current generator is written to ${Fe(process.cwd(),A)} \u2014 diff it against your copy and merge by hand.
113
113
  `)}let{merged:b,conflicts:g}=In(u,l,e);ae(s,b,"utf-8"),ye(c)&&K.info(`Used ${Fe(process.cwd(),c)} as the merge base. Later updates read the version from the file's header, so you can delete that .pristine directory.
114
- `);let w=A=>p===t?be(H(n,"skills",A,"SKILL.md"),"utf-8"):h.get(vt(A)),d=xr("client-generators",n,w("client-generators"))+xr(`${r}-generator`,n,w(`${r}-generator`));$n(i,Pn(i));let S=Ln({[Ce]:t},!0);(S==="updated"||S==="added")&&K.info(`Set ${Ce} to ^${t} in package.json \u2014 run your installer.
114
+ `);let w=A=>p===t?be(H(n,"skills",A,"SKILL.md"),"utf-8"):h.get(vt(A)),d=Rr("client-generators",n,w("client-generators"))+Rr(`${r}-generator`,n,w(`${r}-generator`));$n(i,Pn(i));let S=Ln({[Ce]:t},!0);(S==="updated"||S==="added")&&K.info(`Set ${Ce} to ^${t} in package.json \u2014 run your installer.
115
115
  `);let N=g+d;te.eject_generator_outcome=N>0?"conflicts":"success",N>0?(te.eject_generator_conflicts=N,K.warn(`Updated ${o} with ${N} conflict(s)${d>0?" (some in .claude/skills)":""} \u2014 resolve the <<<<<<< markers, then regenerate.
116
116
  `)):K.info(`Updated ${o} cleanly.
117
117
  `)}var fa=async({argv:r,config:e})=>{let t=r.generator??"";te.eject_generator_action=r.update?"update":"eject",(Rt.has(t)||ea.has(t))&&(te.eject_generator_name=t),te.eject_generator_outcome="unexpected-error";let n=ea.get(t);if(n!==void 0){te.eject_generator_action="guidance",te.eject_generator_outcome="success",K.info(`
@@ -122,9 +122,9 @@ Eject that one and set the framework in your copy's default export:
122
122
  # then in generators/tanstack-query/index.ts: run: tanstackQueryGenerator('${n}')
123
123
  `);return}if(!Rt.has(t))throw te.eject_generator_outcome="unknown-generator",new Oe(`
124
124
  \u274C Unknown generator "${t}". Ejectable generators: ${[...Rt].join(", ")}.
125
- `);let i=Gf(),s=kf(i,t),{GENERATOR_VERSION:o}=await import("./chunks/B64RMZSV.js"),c=Ff(r.dir??"./generators"),u=s===void 0?H(c,`${t}.mjs`):H(c,t,"index.ts"),p=Fe(process.cwd(),u)||u;if(r.update){if(s===void 0){let A=be(H(i,"generators",`${t}.mjs`),"utf-8");Bf({name:t,asset:A,toolkitVersion:o,assetsDir:i,dir:c,target:u,printedTarget:p})}else Vf({name:t,files:s,toolkitVersion:o,assetsDir:i,dir:c,targetDir:H(c,t)});return}if(ye(u)&&!r.force)throw te.eject_generator_outcome="already-exists",new Oe(`
125
+ `);let i=Gf(),s=kf(i,t),{GENERATOR_VERSION:o}=await import("./chunks/PWGFZ5ZK.js"),c=Ff(r.dir??"./generators"),u=s===void 0?H(c,`${t}.mjs`):H(c,t,"index.ts"),p=Fe(process.cwd(),u)||u;if(r.update){if(s===void 0){let A=be(H(i,"generators",`${t}.mjs`),"utf-8");Bf({name:t,asset:A,toolkitVersion:o,assetsDir:i,dir:c,target:u,printedTarget:p})}else Vf({name:t,files:s,toolkitVersion:o,assetsDir:i,dir:c,targetDir:H(c,t)});return}if(ye(u)&&!r.force)throw te.eject_generator_outcome="already-exists",new Oe(`
126
126
  \u274C ${p} already exists. Use --update to merge the newer version in, or --force to overwrite.
127
- `);jn(Ht(u),{recursive:!0});let h=s===void 0?[be(H(i,"generators",`${t}.mjs`),"utf-8")]:s.map(A=>be(H(i,"generators",t,A),"utf-8"));s===void 0?ae(u,h[0],"utf-8"):s.forEach((A,G)=>{ae(H(c,t,A),h[G],"utf-8")});let l=ra("client-generators",i),b=ra(`${t}-generator`,i);$n(c,Pn(c));let g=`./${Fe(e.configPath===void 0?process.cwd():Zo(Ht(e.configPath)),Zo(u)).split("\\").join("/")}`,w=Ln({[Ce]:o}),d=h.some(A=>A.includes(`from "${xn}"`)||A.includes(`from '${xn}'`)),S=Hf(e.configPath,t,g),N=s===void 0?p:Fe(process.cwd(),H(c,t))+"/";K.info(`Ejected the "${t}" generator to ${N}.
127
+ `);jn(Vt(u),{recursive:!0});let h=s===void 0?[be(H(i,"generators",`${t}.mjs`),"utf-8")]:s.map(A=>be(H(i,"generators",t,A),"utf-8"));s===void 0?ae(u,h[0],"utf-8"):s.forEach((A,G)=>{ae(H(c,t,A),h[G],"utf-8")});let l=ra("client-generators",i),b=ra(`${t}-generator`,i);$n(c,Pn(c));let g=`./${Fe(e.configPath===void 0?process.cwd():Zo(Vt(e.configPath)),Zo(u)).split("\\").join("/")}`,w=Ln({[Ce]:o}),d=h.some(A=>A.includes(`from "${xn}"`)||A.includes(`from '${xn}'`)),S=Hf(e.configPath,t,g),N=s===void 0?p:Fe(process.cwd(),H(c,t))+"/";K.info(`Ejected the "${t}" generator to ${N}.
128
128
  `+(w==="added"?`Added ${Ce} to devDependencies (the ejected file imports its toolkit) \u2014 run your installer.
129
129
  `:w==="no-package-json"?`The ejected file imports its toolkit from ${Ce} \u2014 install it: npm install --save-dev ${Ce}
130
130
  `:"")+(d?`It also imports ${xn} (a dependency of the toolkit) \u2014 add it explicitly if your package manager does not hoist.
@@ -140,19 +140,19 @@ Eject that one and set the framework in your copy's default export:
140
140
 
141
141
  Run it: redocly generate-client <api> --output <path>${S?"":` --generator ${g}`}
142
142
  Edit ${N} and run that again to see your change.
143
- Reference: ${Uf}
144
- `),te.eject_generator_outcome="success"};function pa(r){if(Array.isArray(r)){let e={};for(let t of r)if(t&&typeof t=="string"){let n=da(t);Object.assign(e,n)}return Object.keys(e).length>0?e:void 0}if(!(!r||typeof r!="string"))return da(r)}function da(r){try{let e=JSON.parse(r);if(!we(e))throw new Error("mTLS config must be an object mapping domains to certificate configurations");for(let[t,n]of Object.entries(e)){if(!we(n))throw new Error(`mTLS config for domain "${t}" must be an object`);Nn(n,"clientCert",t,!0),Nn(n,"clientKey",t,!0),Nn(n,"caCert",t,!1)}return e}catch(e){throw e instanceof SyntaxError?new Error(`Invalid JSON for --mtls option: ${e.message}`):e}}function Nn(r,e,t,n){let i=r[e];if(!i){if(n)throw new Error(`${e} is required for domain "${t}"`);return}if(typeof i!="string")throw new Error(`${e} for domain "${t}" must be a string`)}var ha=Pt(ur(),1);import{existsSync as Yf,writeFileSync as Kf,readFileSync as Xf,statSync as Jf}from"node:fs";import{tmpdir as Tn}from"node:os";import{join as Dn}from"node:path";import*as Vt from"node:process";var Rr=Pt(Ta(),1);var vr=async(r,{timeout:e,...t}={})=>{let n=si(),i=n&&!oi(r),s,o=e?{connect:{timeout:e}}:{};return i?s=new Rr.ProxyAgent({uri:n,...o}):e&&(s=new Rr.Agent(o)),await fetch(r,{signal:e?AbortSignal.timeout(e):void 0,...t,dispatcher:s})};var qn="redocly-cli-version",Qf=1e3*60*60*12,ma=Vt.env.NODE_ENV==="test"||Vt.env.CI||!!Vt.env.LAMBDA_TASK_ROOT||Vt.env.REDOCLY_SUPPRESS_UPDATE_NOTICE==="true",ga=()=>{if(!ma)try{let r=Xf(Dn(Tn(),qn)).toString();Zf(Ie,r)&&td(Ie,r)}catch{return}},Zf=(r,e)=>(0,ha.compare)(r,e)<0,ed=async r=>{let e=`http://registry.npmjs.org/${r}/latest`;try{return(await(await vr(e,{timeout:Jt})).json()).version}catch{return}},ya=()=>{!rd()||ma||ed(ei).then(r=>{if(r){let e=Dn(Tn(),qn);Kf(e,r)}}).catch(()=>{})},td=(r,e)=>{K.info(Xt([`A new version of ${Lt("Redocly CLI")} (${Bt(e)}) is available.`,`Update now: \`${Lt("npm i -g @redocly/cli@latest")}\`.`,"Changelog: https://redocly.com/docs/cli/changelog/"]))},rd=()=>{try{let r=Dn(Tn(),qn);if(!Yf(r))return!0;let e=new Date().getTime(),n=Jf(r).mtime.getTime();return e-n>=Qf}catch{return!1}};function ba(r){if(!r||r==="/")throw new Error("Mount path cannot be empty or root path. Please use --mount-path option with a valid path.");return r}function st(r,e=!1){return t=>{let n=Number(t);if(isNaN(n)||n<=0)throw new Error(`${r} must be a positive number`);if(e&&!Number.isInteger(n))throw new Error(`${r} must be a positive integer`);return n}}function Ea(r){return r?._?.[0]??""}async function wa(r,e,t){let n;try{n=await Kn({configPath:r.config,customExtends:r.extends,plugins:t})}catch(o){throw new Oe(`Failed to load the configuration file:
143
+ Reference: ${zf}
144
+ `),te.eject_generator_outcome="success"};function pa(r){if(Array.isArray(r)){let e={};for(let t of r)if(t&&typeof t=="string"){let n=da(t);Object.assign(e,n)}return Object.keys(e).length>0?e:void 0}if(!(!r||typeof r!="string"))return da(r)}function da(r){try{let e=JSON.parse(r);if(!we(e))throw new Error("mTLS config must be an object mapping domains to certificate configurations");for(let[t,n]of Object.entries(e)){if(!we(n))throw new Error(`mTLS config for domain "${t}" must be an object`);Nn(n,"clientCert",t,!0),Nn(n,"clientKey",t,!0),Nn(n,"caCert",t,!1)}return e}catch(e){throw e instanceof SyntaxError?new Error(`Invalid JSON for --mtls option: ${e.message}`):e}}function Nn(r,e,t,n){let i=r[e];if(!i){if(n)throw new Error(`${e} is required for domain "${t}"`);return}if(typeof i!="string")throw new Error(`${e} for domain "${t}" must be a string`)}var ha=Lt(fr(),1);import{existsSync as Yf,writeFileSync as Kf,readFileSync as Xf,statSync as Jf}from"node:fs";import{tmpdir as Tn}from"node:os";import{join as Dn}from"node:path";import*as Bt from"node:process";var jt=Lt(Ta(),1);var vr=async(r,{timeout:e,...t}={})=>{let n=si(),i=n&&!oi(r),s;i?s=new jt.ProxyAgent({uri:n}):e&&(s=new jt.Agent({connect:{timeout:e}}));try{return await(0,jt.fetch)(r,{signal:e?AbortSignal.timeout(e):void 0,...t,dispatcher:s})}catch(o){throw await s?.destroy(),o}};var qn="redocly-cli-version",Qf=1e3*60*60*12,ma=Bt.env.NODE_ENV==="test"||Bt.env.CI||!!Bt.env.LAMBDA_TASK_ROOT||Bt.env.REDOCLY_SUPPRESS_UPDATE_NOTICE==="true",ga=()=>{if(!ma)try{let r=Xf(Dn(Tn(),qn)).toString();Zf(Ie,r)&&td(Ie,r)}catch{return}},Zf=(r,e)=>(0,ha.compare)(r,e)<0,ed=async r=>{let e=`http://registry.npmjs.org/${r}/latest`;try{return(await(await vr(e,{timeout:Qt})).json()).version}catch{return}},ya=()=>{!rd()||ma||ed(ei).then(r=>{if(r){let e=Dn(Tn(),qn);Kf(e,r)}}).catch(()=>{})},td=(r,e)=>{K.info(Jt([`A new version of ${Nt("Redocly CLI")} (${Yt(e)}) is available.`,`Update now: \`${Nt("npm i -g @redocly/cli@latest")}\`.`,"Changelog: https://redocly.com/docs/cli/changelog/"]))},rd=()=>{try{let r=Dn(Tn(),qn);if(!Yf(r))return!0;let e=new Date().getTime(),n=Jf(r).mtime.getTime();return e-n>=Qf}catch{return!1}};function ba(r){if(!r||r==="/")throw new Error("Mount path cannot be empty or root path. Please use --mount-path option with a valid path.");return r}function st(r,e=!1){return t=>{let n=Number(t);if(isNaN(n)||n<=0)throw new Error(`${r} must be a positive number`);if(e&&!Number.isInteger(n))throw new Error(`${r} must be a positive integer`);return n}}function Ea(r){return r?._?.[0]??""}async function wa(r,e,t){let n;try{n=await Kn({configPath:r.config,customExtends:r.extends,plugins:t})}catch(o){throw new Oe(`Failed to load the configuration file:
145
145
 
146
- - ${o.message}`)}if(r["lint-config"]==="off"||n.document===void 0)return n;let i=await Qn({config:n,severity:r["lint-config"]||"warn"}),s=Xn(i);if(Jn(i,{maxProblems:r["max-problems"],totals:s,version:e,command:"check-config"}),nd(s,Ea(r)),s.errors>0)throw new Kt("Config check failed.");return n}function nd(r,e){r.errors>0?K.error(`\u274C Your config has ${r.errors} ${Pr("error",r.errors)}.
146
+ - ${o.message}`)}if(r["lint-config"]==="off"||n.document===void 0)return n;let i=await Qn({config:n,severity:r["lint-config"]||"warn"}),s=Xn(i);if(Jn(i,{maxProblems:r["max-problems"],totals:s,version:e,command:"check-config"}),nd(s,Ea(r)),s.errors>0)throw new Xt("Config check failed.");return n}function nd(r,e){r.errors>0?K.error(`\u274C Your config has ${r.errors} ${Pr("error",r.errors)}.
147
147
  `):r.warnings>0?K.warn(`\u26A0\uFE0F Your config has ${r.warnings} ${Pr("warning",r.warnings)}.
148
- `):e==="check-config"&&K.info(Bt(`\u2705 Your config is valid.
149
- `))}import{execSync as id}from"node:child_process";import*as $t from"node:fs";import{existsSync as sd,writeFileSync as od,readFileSync as _a}from"node:fs";import*as Sa from"node:os";import{tmpdir as Ca}from"node:os";import{dirname as Aa,join as $r}from"node:path";async function Oa(r=Jt){try{return await vr(ii,{timeout:r}),!0}catch{return!1}}var jr="***";async function xa({config:r,argv:e,exit_code:t,execution_time:n,spec_version:i,spec_keyword:s,spec_full_version:o,respect_x_security_auth_types:c,respect_source_description_types:u,respect_criterion_object_types:p,lint_rules_with_errors:h,lint_rules_with_warnings:l,lint_rules_with_ignored_problems:b,generate_client:g,eject_generator:w,bundle:d}){try{if(!e||!await Oa(1e3))return;let{_:[N],$0:A,...G}=e,{RedoclyOAuthClient:W,getReuniteUrl:xe}=await import("./chunks/AB2EMYEK.js"),Ye=new W(Ie),Ke=xe(r,G.residency),Xe=await Ye.isAuthorized(Ke),V=hd();V||(V=`ann_${li()}`,pd(V));let We=Yt(i),$=[{id:N,object:"command",uri:`urn:redocly:cli:command:${N}`,logged_in:Xe?"yes":"no",command:N,...ud(G,process.argv.slice(2)),node_version:process.version,npm_version:dd(),version:Ie,exit_code:t,execution_time:n,metadata:process.env.REDOCLY_CLI_TELEMETRY_METADATA,environment_ci:process.env.CI,environment:process.env.REDOCLY_ENVIRONMENT,has_config:typeof r?.document?.parsed>"u"?"no":"yes",spec_version:i,spec_keyword:s,spec_full_version:o,respect_x_security_auth_types:We==="arazzo1"&&c?.length?JSON.stringify(c):void 0,respect_source_description_types:We==="arazzo1"&&u?.length?JSON.stringify(u):void 0,respect_criterion_object_types:We==="arazzo1"&&p?.length?JSON.stringify(p):void 0,lint_rules_with_errors:h?.length?JSON.stringify(h):void 0,lint_rules_with_warnings:l?.length?JSON.stringify(l):void 0,lint_rules_with_ignored_problems:b?.length?JSON.stringify(b):void 0,generate_client_builtin_generators:g?.generate_client_builtin_generators?.length?JSON.stringify(g.generate_client_builtin_generators):void 0,generate_client_custom_generators_count:g?.generate_client_custom_generators_count,generate_client_toolkit_imports:g?.generate_client_toolkit_imports?.length?JSON.stringify(g.generate_client_toolkit_imports):void 0,generate_client_error_category:g?.generate_client_error_category,generate_client_ejected_generators:g?.generate_client_ejected_generators?.length?JSON.stringify(g.generate_client_ejected_generators):void 0,generate_client_composed_apis_count:g?.generate_client_composed_apis_count,eject_generator_action:w?.eject_generator_action,eject_generator_name:w?.eject_generator_name,eject_generator_outcome:w?.eject_generator_outcome,eject_generator_conflicts:w?.eject_generator_conflicts,eject_generator_from_version:w?.eject_generator_from_version,eject_generator_to_version:w?.eject_generator_to_version,bundle_overlays_count:d?.bundle_overlays_count}],_=ci.mapToCloudEvent({type:"com.redocly.command.ran",source:"urn:redocly:cli",origin:"redocly-cli",env:"production",osPlatform:Sa.platform(),actor:{id:V,object:"user",uri:""},category:"product",data:$}),{otelTelemetry:L}=await import("./chunks/VE45GKNY.js");L.send(_)}catch{}}function Ra(r,e){for(let t of r.sourceDescriptions??[])t.type&&e.add(t.type)}function va(r,e){for(let t of r.workflows??[]){jt(t.successActions,e),jt(t.failureActions,e);for(let n of t.steps??[])ja(n.successCriteria,e),jt(n.onSuccess,e),jt(n.onFailure,e)}jt(Object.values(r.components?.successActions??{}),e),jt(Object.values(r.components?.failureActions??{}),e)}function jt(r,e){for(let t of r??[])ja(t.criteria,e)}function ja(r,e){for(let t of r??[]){let n=ad(t);n&&e.add(n)}}function ad(r){let e=r.type;return typeof e=="string"?e:e?.type||(r.condition?"simple":void 0)}function $a(r,e){for(let t of r.workflows??[]){for(let n of t["x-security"]??[]){let i=n.scheme;if(i?.type){let s=i.type==="http"?i.scheme:i.type;s&&e.add(s)}}for(let n of t.steps??[])for(let i of n["x-security"]??[]){let s=i.scheme;if(s?.type){let c=s.type==="http"?s.scheme:s.type;c&&e.add(c)}let o=i.schemeName;o&&e.add(o)}}}function cd(r){return $t.existsSync(r)&&$t.statSync(r).isFile()}function ld(r){return $t.existsSync(r)&&$t.statSync(r).isDirectory()}function Mn(r){return r&&(kn(r)?r.split("://")[0]+"://url":cd(r)?r.replace(/.+\.([^.]+)$/,(e,t)=>"file-"+t):ld(r)?"folder":r)}function Fn(r,e,t){let n=Array.isArray(e)?e:[e];for(let i of n)i.length>1&&(r=r.replaceAll(i,t));return r}function Ia(r,e){let t={};for(let[n,i]of Object.entries(r))e.includes(n)?t[n]=jr:we(i)?t[n]=Ia(i,e):t[n]=i;return t}function zn(r,e,t=[]){if(Array.isArray(r))return r.forEach(n=>zn(n,e,t)),t;if(we(r))for(let[n,i]of Object.entries(r))e.includes(n)&&typeof i=="string"?t.push(i):(we(i)||Array.isArray(i))&&zn(i,e,t);return t}function ud(r,e){let t=["organization","o","input","i","author","a","clientCert","clientKey","caCert","server","S"],n=e.join(" "),i={};for(let[s,o]of Object.entries(r))if(t.includes(s))i[s]=jr,n=Fn(n,o,jr);else if(typeof o=="string"){let c=Mn(o);i[s]=c,n=Fn(n,o,c)}else if(Array.isArray(o)){i[s]=o.map(Mn);for(let c of o){let u=Mn(c);n.includes(c)&&(n=n.replaceAll(c,u))}}else if(we(o)){let c=zn(o,t);for(let u of c)n=Fn(n,u,jr);i[s]=Ia(o,t)}else i[s]=o;return{arguments:JSON.stringify(i),raw_input:n}}var fd=process.platform==="win32"?$r(Aa(process.execPath),"node_modules","npm","package.json"):$r(Aa(process.execPath),"..","lib","node_modules","npm","package.json");function dd(){try{return JSON.parse(_a(fd,"utf8")).version}catch{}try{return id("npm -v",{stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return"unknown"}}var pd=r=>{if(!(process.env.CI||!r))try{let t=$r(Ca(),Lr);od(t,r)}catch{}},hd=()=>{if(!process.env.CI)try{let e=$r(Ca(),Lr);return sd(e)?_a(e).toString().trim():void 0}catch{return}};function J(r,e={}){return async t=>{let n=performance.now(),i=2,s,o="unknown",c,u,p,h=new Set,l=new Set,b=new Set,g=({parsed:A,source:G})=>{if(o="unknown",c=void 0,u=void 0,G?.absoluteRef&&Hn(G.absoluteRef)){o="graphql";return}try{o=Yn(A)}catch{o="unsupported"}we(A)&&(c=A?.openapi?"openapi":A?.swagger?"swagger":A?.asyncapi?"asyncapi":A?.arazzo?"arazzo":A?.overlay?"overlay":void 0,c&&(u=A[c]),Yt(o)==="arazzo1"&&($a(A,h),Ra(A,l),va(A,b)))},w=new Set,d=new Set,S=new Set,N=A=>{for(let G of A)G.ignored?S.add(G.ruleId):G.severity==="error"?w.add(G.ruleId):G.severity==="warn"&&d.add(G.ruleId)};try{if(t.config&&!Gn(t.config))throw new Oe("Please provide a valid path to the configuration file.");p=await wa(t,Ie,e.plugins),s=p.resolvedConfig.telemetry,i=1,typeof r=="function"&&await r({argv:t,config:p,version:Ie,collectSpecData:g,collectResults:N}),i=0}catch(A){A instanceof Kt||(A instanceof Oe?K.error(A.message+`
148
+ `):e==="check-config"&&K.info(Yt(`\u2705 Your config is valid.
149
+ `))}import{execSync as id}from"node:child_process";import*as It from"node:fs";import{existsSync as sd,writeFileSync as od,readFileSync as _a}from"node:fs";import*as Sa from"node:os";import{tmpdir as Ca}from"node:os";import{dirname as Aa,join as $r}from"node:path";async function Oa(r=Qt){try{return await vr(ii,{timeout:r}),!0}catch{return!1}}var jr="***";async function xa({config:r,argv:e,exit_code:t,execution_time:n,spec_version:i,spec_keyword:s,spec_full_version:o,respect_x_security_auth_types:c,respect_source_description_types:u,respect_criterion_object_types:p,lint_rules_with_errors:h,lint_rules_with_warnings:l,lint_rules_with_ignored_problems:b,generate_client:g,eject_generator:w,bundle:d}){try{if(!e||!await Oa(1e3))return;let{_:[N],$0:A,...G}=e,{RedoclyOAuthClient:W,getReuniteUrl:xe}=await import("./chunks/KOR5TUJG.js"),Ye=new W(Ie),Ke=xe(r,G.residency),Xe=await Ye.isAuthorized(Ke),V=hd();V||(V=`ann_${li()}`,pd(V));let We=Kt(i),$=[{id:N,object:"command",uri:`urn:redocly:cli:command:${N}`,logged_in:Xe?"yes":"no",command:N,...ud(G,process.argv.slice(2)),node_version:process.version,npm_version:dd(),version:Ie,exit_code:t,execution_time:n,metadata:process.env.REDOCLY_CLI_TELEMETRY_METADATA,environment_ci:process.env.CI,environment:process.env.REDOCLY_ENVIRONMENT,has_config:typeof r?.document?.parsed>"u"?"no":"yes",spec_version:i,spec_keyword:s,spec_full_version:o,respect_x_security_auth_types:We==="arazzo1"&&c?.length?JSON.stringify(c):void 0,respect_source_description_types:We==="arazzo1"&&u?.length?JSON.stringify(u):void 0,respect_criterion_object_types:We==="arazzo1"&&p?.length?JSON.stringify(p):void 0,lint_rules_with_errors:h?.length?JSON.stringify(h):void 0,lint_rules_with_warnings:l?.length?JSON.stringify(l):void 0,lint_rules_with_ignored_problems:b?.length?JSON.stringify(b):void 0,generate_client_builtin_generators:g?.generate_client_builtin_generators?.length?JSON.stringify(g.generate_client_builtin_generators):void 0,generate_client_custom_generators_count:g?.generate_client_custom_generators_count,generate_client_toolkit_imports:g?.generate_client_toolkit_imports?.length?JSON.stringify(g.generate_client_toolkit_imports):void 0,generate_client_error_category:g?.generate_client_error_category,generate_client_ejected_generators:g?.generate_client_ejected_generators?.length?JSON.stringify(g.generate_client_ejected_generators):void 0,generate_client_composed_apis_count:g?.generate_client_composed_apis_count,eject_generator_action:w?.eject_generator_action,eject_generator_name:w?.eject_generator_name,eject_generator_outcome:w?.eject_generator_outcome,eject_generator_conflicts:w?.eject_generator_conflicts,eject_generator_from_version:w?.eject_generator_from_version,eject_generator_to_version:w?.eject_generator_to_version,bundle_overlays_count:d?.bundle_overlays_count}],_=ci.mapToCloudEvent({type:"com.redocly.command.ran",source:"urn:redocly:cli",origin:"redocly-cli",env:"production",osPlatform:Sa.platform(),actor:{id:V,object:"user",uri:""},category:"product",data:$}),{otelTelemetry:L}=await import("./chunks/HUWKDZPP.js");L.send(_)}catch{}}function Ra(r,e){for(let t of r.sourceDescriptions??[])t.type&&e.add(t.type)}function va(r,e){for(let t of r.workflows??[]){$t(t.successActions,e),$t(t.failureActions,e);for(let n of t.steps??[])ja(n.successCriteria,e),$t(n.onSuccess,e),$t(n.onFailure,e)}$t(Object.values(r.components?.successActions??{}),e),$t(Object.values(r.components?.failureActions??{}),e)}function $t(r,e){for(let t of r??[])ja(t.criteria,e)}function ja(r,e){for(let t of r??[]){let n=ad(t);n&&e.add(n)}}function ad(r){let e=r.type;return typeof e=="string"?e:e?.type||(r.condition?"simple":void 0)}function $a(r,e){for(let t of r.workflows??[]){for(let n of t["x-security"]??[]){let i=n.scheme;if(i?.type){let s=i.type==="http"?i.scheme:i.type;s&&e.add(s)}}for(let n of t.steps??[])for(let i of n["x-security"]??[]){let s=i.scheme;if(s?.type){let c=s.type==="http"?s.scheme:s.type;c&&e.add(c)}let o=i.schemeName;o&&e.add(o)}}}function cd(r){return It.existsSync(r)&&It.statSync(r).isFile()}function ld(r){return It.existsSync(r)&&It.statSync(r).isDirectory()}function Mn(r){return r&&(kn(r)?r.split("://")[0]+"://url":cd(r)?r.replace(/.+\.([^.]+)$/,(e,t)=>"file-"+t):ld(r)?"folder":r)}function Fn(r,e,t){let n=Array.isArray(e)?e:[e];for(let i of n)i.length>1&&(r=r.replaceAll(i,t));return r}function Ia(r,e){let t={};for(let[n,i]of Object.entries(r))e.includes(n)?t[n]=jr:we(i)?t[n]=Ia(i,e):t[n]=i;return t}function Un(r,e,t=[]){if(Array.isArray(r))return r.forEach(n=>Un(n,e,t)),t;if(we(r))for(let[n,i]of Object.entries(r))e.includes(n)&&typeof i=="string"?t.push(i):(we(i)||Array.isArray(i))&&Un(i,e,t);return t}function ud(r,e){let t=["organization","o","input","i","author","a","clientCert","clientKey","caCert","server","S"],n=e.join(" "),i={};for(let[s,o]of Object.entries(r))if(t.includes(s))i[s]=jr,n=Fn(n,o,jr);else if(typeof o=="string"){let c=Mn(o);i[s]=c,n=Fn(n,o,c)}else if(Array.isArray(o)){i[s]=o.map(Mn);for(let c of o){let u=Mn(c);n.includes(c)&&(n=n.replaceAll(c,u))}}else if(we(o)){let c=Un(o,t);for(let u of c)n=Fn(n,u,jr);i[s]=Ia(o,t)}else i[s]=o;return{arguments:JSON.stringify(i),raw_input:n}}var fd=process.platform==="win32"?$r(Aa(process.execPath),"node_modules","npm","package.json"):$r(Aa(process.execPath),"..","lib","node_modules","npm","package.json");function dd(){try{return JSON.parse(_a(fd,"utf8")).version}catch{}try{return id("npm -v",{stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return"unknown"}}var pd=r=>{if(!(process.env.CI||!r))try{let t=$r(Ca(),Lr);od(t,r)}catch{}},hd=()=>{if(!process.env.CI)try{let e=$r(Ca(),Lr);return sd(e)?_a(e).toString().trim():void 0}catch{return}};function J(r,e={}){return async t=>{let n=performance.now(),i=2,s,o="unknown",c,u,p,h=new Set,l=new Set,b=new Set,g=({parsed:A,source:G})=>{if(o="unknown",c=void 0,u=void 0,G?.absoluteRef&&Hn(G.absoluteRef)){o="graphql";return}try{o=Yn(A)}catch{o="unsupported"}we(A)&&(c=A?.openapi?"openapi":A?.swagger?"swagger":A?.asyncapi?"asyncapi":A?.arazzo?"arazzo":A?.overlay?"overlay":void 0,c&&(u=A[c]),Kt(o)==="arazzo1"&&($a(A,h),Ra(A,l),va(A,b)))},w=new Set,d=new Set,S=new Set,N=A=>{for(let G of A)G.ignored?S.add(G.ruleId):G.severity==="error"?w.add(G.ruleId):G.severity==="warn"&&d.add(G.ruleId)};try{if(t.config&&!Gn(t.config))throw new Oe("Please provide a valid path to the configuration file.");p=await wa(t,Ie,e.plugins),s=p.resolvedConfig.telemetry,i=1,typeof r=="function"&&await r({argv:t,config:p,version:Ie,collectSpecData:g,collectResults:N}),i=0}catch(A){A instanceof Xt||(A instanceof Oe?K.error(A.message+`
150
150
 
151
151
  `):(K.error(`An unexpected error occurred. This is likely a bug that should be reported.
152
152
  `),K.error(A instanceof Error?A.stack||A.message:String(A)),K.error(`
153
153
  `)))}finally{if(process.env.REDOCLY_TELEMETRY!=="off"&&s!=="off"){let A=Math.round(performance.now()-n);await xa({config:p,argv:t,exit_code:i,execution_time:A,spec_version:o,spec_keyword:c,spec_full_version:u,respect_x_security_auth_types:[...h],respect_source_description_types:[...l],respect_criterion_object_types:[...b],lint_rules_with_errors:[...w],lint_rules_with_warnings:[...d],lint_rules_with_ignored_problems:[...S],generate_client:ri,eject_generator:te,bundle:ai})}process.once("beforeExit",()=>{process.exit(i)})}}}Pa.config({path:La.resolve(process.cwd(),"./.env")});ya();Qo(on(process.argv)).version(!1).option("version",{type:"boolean",description:"Show version number.",global:!1}).middleware(r=>{r.version&&r._.length===0&&(K.output(`${Ie}
154
- `),process.exit(0))},!0).help("help","Show help.").parserConfiguration({"greedy-arrays":!1,"boolean-negation":!1}).command("stats [api]","Show statistics for an API description.",r=>r.env("REDOCLY_CLI_STATS").positional("api",{type:"string"}).option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},format:{description:"Use a specific output format.",choices:["stylish","json","markdown"],default:"stylish"}}),async r=>{let{handleStats:e}=await import("./chunks/LVGVWPDB.js");J(e)(r)}).command("inspect-node-types <api>","Show the node types of an API description, for writing configurable rules and custom plugins [experimental].",r=>r.env("REDOCLY_CLI_INSPECT_NODE_TYPES").positional("api",{description:"API description file to inspect.",type:"string",demandOption:!0}).option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},pointer:{description:"JSON pointer to a node, optionally prefixed with a file: `#/paths` or `schemas.yaml#/User`.",type:"string",alias:"p"},type:{description:"List only the nodes of this type.",type:"string"},summary:{description:"List the node types used in the description, with counts.",type:"boolean"},parents:{description:"Show the chain of node types leading to the node: down to the node with --pointer, or the distinct chains that reach the type with --type.",type:"boolean"}}).conflicts({pointer:["type","summary"],type:["summary"],summary:["parents"]}).check(e=>{if(e.parents&&!e.pointer&&!e.type)throw new Error("The --parents option requires --pointer or --type.");return!0}),async r=>{let{handleInspectNodeTypes:e}=await import("./chunks/SXBAAS4M.js");J(e)(r)}).command("score [api]","Score an API description for integration simplicity and agent readiness.",r=>r.env("REDOCLY_CLI_SCORE").positional("api",{type:"string"}).option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},format:{description:"Use a specific output format.",choices:["stylish","json"],default:"stylish"},"operation-details":{description:"Print per-operation metric details.",type:"boolean",default:!1},"debug-operation-id":{description:"Print detailed schema breakdown for a specific operation.",type:"string"}}),async r=>{let{handleScore:e}=await import("./chunks/XJTGJYVS.js");J(e)(r)}).command("split [api]","Split an API description into a multi-file structure.",r=>r.env("REDOCLY_CLI_SPLIT").positional("api",{description:"API description file that you want to split",type:"string"}).option({outDir:{description:"Output directory where files will be saved.",required:!0,type:"string"},separator:{description:"File path separator used while splitting.",required:!1,type:"string",default:"_"},"file-name-conflicts-severity":{description:"Severity level for file name conflicts.",choices:["warn","error","off"],default:"warn"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}).demandOption("api"),async r=>{let{handleSplit:e}=await import("./chunks/37WWN4MA.js");J(e)(r)}).command("join [apis...]","Join multiple API descriptions into one [experimental].",r=>r.env("REDOCLY_CLI_JOIN").positional("apis",{array:!0,type:"string",demandOption:!0}).option({"prefix-tags-with-info-prop":{description:"Prefix tags with property value from info object.",requiresArg:!0,type:"string"},"prefix-tags-with-filename":{description:"Prefix tags with property value from file name.",type:"boolean",default:!1},"prefix-components-with-info-prop":{description:"Prefix components with property value from info object.",requiresArg:!0,type:"string"},"without-x-tag-groups":{description:"Skip automated x-tagGroups creation",type:"boolean"},output:{description:"Output file.",alias:"o",type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handleJoin:e}=await import("./chunks/3C6UUCEW.js");J(e)(r)}).command("push-status [pushId]",!1,r=>r.env("REDOCLY_CLI_PUSH_STATUS").positional("pushId",{description:"Push id.",type:"string",demandOption:!0}).implies("max-execution-time","wait").option({organization:{description:"ID of the organization to push to.",type:"string",alias:"o",required:!0},project:{description:"ID of the project to push to.",type:"string",required:!0,alias:"p"},domain:{description:"Specify a domain.",alias:"d",type:"string",required:!1},wait:{description:"Wait for build to finish.",type:"boolean",default:!1},"max-execution-time":{description:"Maximum execution time in seconds.",type:"number"},"continue-on-deploy-failures":{description:"Command does not fail even if the deployment fails.",type:"boolean",default:!1},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handlePushStatus:e}=await import("./chunks/RGU6OZYB.js");J(e)(r)}).command("push [files...]","Push documents to Reunite.",r=>r.env("REDOCLY_CLI_PUSH").positional("files",{type:"string",array:!0,demandOption:!0}).option({branch:{description:"Branch name to push to.",type:"string",alias:"b",required:!0},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},organization:{description:"ID of the organization to push to.",type:"string",alias:"o",required:!0},project:{description:"ID of the project to push to.",type:"string",alias:"p",required:!0},"mount-path":{description:"The path files should be pushed to.",type:"string",alias:"mp",required:!0,coerce:ba},author:{description:"Author of the commit.",type:"string",alias:"a",required:!0},message:{description:"Commit message.",type:"string",alias:"m",required:!0},"commit-sha":{description:"Commit SHA.",type:"string",alias:"sha"},"commit-url":{description:"Commit URL.",type:"string",alias:"url"},namespace:{description:"Repository namespace.",type:"string"},repository:{description:"Repository name.",type:"string"},"created-at":{description:"Commit creation date.",type:"string"},domain:{description:"Specify a domain.",alias:"d",type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},"default-branch":{type:"string",default:"main"},"max-execution-time":{description:"Maximum execution time in seconds.",type:"number"},"wait-for-deployment":{description:"Wait for build to finish.",type:"boolean",default:!1},replace:{description:"Remove the files under the mount path that are not part of this push.",type:"boolean",default:!1},verbose:{type:"boolean",default:!1},"continue-on-deploy-failures":{description:"Command does not fail even if the deployment fails.",type:"boolean",default:!1}}),async r=>{let{handlePush:e}=await import("./chunks/YPYZCXVX.js");J(e)(r)}).command("recheck [paths..]","Lint Markdown prose and structure from the recheck block in redocly.yaml.",r=>r.env("REDOCLY_CLI_RECHECK").positional("paths",{array:!0,type:"string",describe:"Files or directories to lint. Default: the current directory."}).option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},format:{description:"Use a specific output format.",choices:["table","json","sarif","github-actions"],default:"table"},tags:{description:"Run only rules with these tags.",array:!0,type:"string"},rule:{description:"Run only these rules.",alias:"r",array:!0,type:"string"},"skip-rule":{description:"Skip these rules.",array:!0,type:"string"},stats:{description:"Print rule statistics.",alias:"s",type:"boolean"},fix:{description:"Apply fixes to Markdown files.",alias:"f",type:"boolean"},"max-problems":{description:"Maximum number of problems in the report.",type:"number"},summary:{description:"Print a run summary.",choices:["json","text"],type:"string"},"summary-path":{description:"Write the summary to a file.",type:"string"},readability:{description:"Report readability scores instead of linting.",type:"boolean"},"generate-baseline":{description:"Write the baseline file from the current findings.",type:"boolean"},"generate-markdoc-schema":{description:"Generate a Markdoc tag schema from theme modules.",type:"boolean"},from:{description:"Module paths to read Markdoc tags from (with --generate-markdoc-schema).",array:!0,type:"string"},output:{description:"Output file for the generated schema.",type:"string"},check:{description:"Fail if the generated schema differs from --output.",type:"boolean"}}),async r=>{let{handleRecheck:e}=await import("./chunks/2XK7ML3U.js"),{recheckPresetsPlugin:t}=await import("./chunks/WSDNWUOV.js");J(e,{plugins:[t]})(r)}).command("lint [apis...]","Lint an API or Arazzo description.",r=>r.env("REDOCLY_CLI_LINT").positional("apis",{array:!0,type:"string",demandOption:!0}).option({format:{description:"Use a specific output format.",choices:["stylish","codeframe","json","checkstyle","codeclimate","summary","markdown","github-actions","junit"],default:"codeframe"},"max-problems":{requiresArg:!0,description:"Reduce output to a maximum of N problems.",type:"number",default:100},"generate-ignore-file":{description:"Generate an ignore file.",type:"boolean"},"skip-rule":{description:"Ignore certain rules.",array:!0,type:"string"},"skip-preprocessor":{description:"Ignore certain preprocessors.",array:!0,type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},extends:{description:"Override extends configurations (defaults or config file settings).",requiresArg:!0,array:!0,type:"string"}}),async r=>{let{handleLint:e}=await import("./chunks/S6NFOZ34.js");J(e)(r)}).command("bundle [apis...]","Bundle a multi-file API description to a single file.",r=>r.env("REDOCLY_CLI_BUNDLE").positional("apis",{array:!0,type:"string",demandOption:!0}).options({output:{type:"string",description:"Output file or folder for inline APIs.",alias:"o"},ext:{description:"Bundle file extension.",requiresArg:!0,choices:Zn},"skip-preprocessor":{description:"Ignore certain preprocessors.",array:!0,type:"string"},"skip-decorator":{description:"Ignore certain decorators.",array:!0,type:"string"},overlay:{description:"Overlay file to apply. Repeat to apply several, in order.",array:!0,type:"string",requiresArg:!0},dereferenced:{alias:"d",type:"boolean",description:"Produce a fully dereferenced bundle."},force:{alias:"f",type:"boolean",description:"Produce bundle output even when errors occur."},config:{description:"Path to the config file.",type:"string"},metafile:{description:"Produce metadata about the bundle",type:"string"},extends:{description:"Override extends configurations (defaults or config file settings).",requiresArg:!0,array:!0,type:"string",hidden:!0},"remove-unused-components":{description:"Remove unused components.",type:"boolean",default:!1},"keep-url-references":{description:"Keep absolute url references.",type:"boolean",alias:"k"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},"component-renaming-conflicts-severity":{description:"Whether to show warnings or fail on renaming conflicts (defaults to warn).",choices:["warn","error","off"]},"component-names-strategy":{description:"How to name inlined Schema components: 'basename' (default) or 'title' (from each schema's `title`).",choices:["basename","title"],default:"basename"}}).check(e=>{if(e.output&&(!e.apis||e.apis.length===0))throw new Error("At least one inline API must be specified when using --output.");return!0}),async r=>{let{handleBundle:e}=await import("./chunks/6EGJEFXO.js");J(e)(r)}).command("check-config","Lint the Redocly configuration file.",async r=>r.env("REDOCLY_CLI_CHECK_CONFIG").option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error"],default:"error"}}),r=>{J()(r)}).command("login","Log in to Redocly.",async r=>r.env("REDOCLY_CLI_LOGIN").options({residency:{description:"Residency of the application. Defaults to `us`.",alias:["r"],type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},verbose:{alias:"v",describe:"Apply verbose mode.",type:"boolean"}}),async r=>{let{handleLogin:e}=await import("./chunks/VXLODB3S.js");J(e)(r)}).command("logout","Clear your stored credentials.",r=>r,async r=>{let{handleLogout:e}=await import("./chunks/NBI4EQPC.js");J(e)(r)}).command("project","[early access] Work with a Redocly-hosted project.",r=>r.env("REDOCLY_CLI_PROJECT").command("clone <project> [directory]","Clone a Redocly-hosted project as a Git repository.",e=>e.positional("project",{description:"Organization and project slugs or IDs, as `<organization>/<project>`.",type:"string",demandOption:!0}).positional("directory",{description:"Directory to clone into. Defaults to the project.",type:"string"}).options({residency:{description:"Residency of the application. Defaults to `us`.",alias:["r"],type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"}}),async e=>{let{handleProjectClone:t}=await import("./chunks/SOI7RTB4.js");J(t)(e)}).command("git-credentials <operation>",!1,e=>e.positional("operation",{description:"Credential helper operation: get, store, or erase.",type:"string",demandOption:!0}),async e=>{let{handleProjectGitCredentials:t}=await import("./chunks/LNYTDBAU.js");process.stdout.write(await t({operation:e.operation,input:process.stdin,version:Ie}))}).demandCommand(1,"Specify a project subcommand: clone.")).command("preview","Preview Redocly project using one of the product NPM packages.",r=>r.env("REDOCLY_CLI_PREVIEW").options({product:{type:"string",choices:["redoc","revel","reef","realm","redoc-revel","redoc-reef","revel-reef"],description:"Product used to launch preview. Default is inferred from project's package.json or 'realm' is used."},plan:{type:"string",choices:ni,default:"enterprise"},port:{alias:"p",type:"number",description:"Preview port.",default:4e3,coerce:st("port",!0)},"project-dir":{alias:["d","source-dir"],type:"string",description:"Specifies the project content directory. The default value is the directory where the command is executed.",default:"."},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{process.argv.some(t=>t.startsWith("--source-dir"))&&K.error(`Option --source-dir is deprecated and will be removed soon. Use --project-dir instead.
155
- `);let{previewProject:e}=await import("./chunks/SYWAPWW7.js");J(e)(r)}).command("build-docs [api]","Produce API documentation as an HTML file",r=>r.positional("api",{type:"string"}).options({o:{describe:"Output destination file.",alias:"output",type:"string",default:"redoc-static.html"},title:{describe:"Page title.",type:"string"},disableGoogleFont:{describe:"Disable Google fonts.",type:"boolean",default:!1},t:{alias:"template",describe:"Path to handlebars page template, see https://github.com/Redocly/redocly-cli/blob/main/packages/cli/src/commands/build-docs/template.hbs for the example.",type:"string"},templateOptions:{describe:"Additional options to pass to the template. Use dot notation, e.g. templateOptions.metaDescription"},theme:{describe:"Redoc theme.openapi configuration. Use dot notation, e.g. theme.openapi.nativeScrollbars"},config:{describe:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}).check(e=>{if(e.theme&&!e.theme?.openapi)throw new Error("Invalid option: theme.openapi not set.");return!0}),async r=>{let{handlerBuildCommand:e}=await import("./chunks/5S5OMDQZ.js");J(e)(r)}).command("translate <locale>","Creates or updates translations.yaml files and fills them with missing built-in translations and translations from the redocly.yaml and sidebars.yaml files.",r=>r.env("REDOCLY_CLI_TRANSLATE").positional("locale",{description:"Locale code to generate translations for, or `all` for all current project locales.",type:"string",demandOption:!0}).options({"project-dir":{alias:"d",type:"string",description:"Specifies the project content directory. The default value is the directory where the command is executed.",default:"."},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handleTranslations:e}=await import("./chunks/LRLGVYCG.js");J(e)(r)}).command("eject <type> [path]","Helper function to eject project elements for customization.",r=>r.env("REDOCLY_CLI_EJECT").positional("type",{description:"Specifies what type of project element to eject. Currently this value must be `component`.",demandOption:!0,choices:["component"]}).positional("path",{description:"Filepath to a component or filepath with glob pattern.",type:"string"}).options({"project-dir":{alias:"d",type:"string",description:"Specifies the project content directory. The default value is the directory where the command is executed.",default:"."},force:{alias:"f",type:"boolean",description:'Skips the "overwrite existing" confirmation when ejecting a component that is already ejected in the destination.'},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handleEject:e}=await import("./chunks/TBZEEKTV.js");J(e)(r)}).command("respect [files...]","Run Arazzo tests.",r=>r.env("REDOCLY_CLI_RESPECT").positional("files",{describe:"Test files or glob pattern.",type:"string",array:!0,default:[]}).options({input:{alias:"i",describe:"Input parameters.",type:"string"},server:{alias:"S",describe:"Server parameters.",type:"string"},workflow:{alias:"w",describe:"Workflow name.",type:"string",array:!0},skip:{alias:"s",describe:"Workflow to skip.",type:"string",array:!0},verbose:{alias:"v",describe:"Apply verbose mode.",type:"boolean"},"har-output":{describe:"Har file output name.",type:"string",alias:"H"},"json-output":{describe:"JSON file output name.",type:"string",alias:"J"},mtls:{describe:'Per-domain mutual TLS certificates configuration as JSON. Format: {"<domain>": {"clientCert": "<path>", "clientKey": "<path>", "caCert": "<path>"}}',type:"string",array:!0,coerce:pa},severity:{describe:"Severity of the check.",type:"string"},"max-steps":{describe:"Maximum number of steps to run (default: 2000).",type:"number",default:2e3,coerce:st("max-steps",!0)},"max-fetch-timeout":{describe:"Maximum time to wait for API response per request in milliseconds (default: 40 seconds).",type:"number",default:4e4,coerce:st("max-fetch-timeout",!1)},"execution-timeout":{describe:"Maximum time to wait for the Respect execution in milliseconds (default: 1 hour).",type:"number",default:36e5,coerce:st("execution-timeout",!1)},"no-secrets-masking":{describe:"Do not mask secrets in the output.",type:"boolean",default:!1}}),async r=>{let{handleRespect:e}=await import("./chunks/WEOCCL26.js");J(e)(r)}).command("generate-arazzo <descriptionPath>","Auto-generate arazzo description file from an API description.",r=>r.env("REDOCLY_CLI_GENERATE_ARAZZO").positional("descriptionPath",{describe:"Description file path.",type:"string"}).options({"output-file":{alias:"o",describe:"Output File name.",type:"string",requiresArg:!0},"with-ai":{describe:"Redesign the generated workflows with an AI provider, using the OpenAPI description as context.",type:"boolean",default:!1},"ai-provider":{describe:'AI provider used with --with-ai; runs the "claude", "codex", or "cursor" CLI in non-interactive mode.',choices:["claude","codex","cursor"],default:"claude"},"ai-model":{describe:"Model passed to the selected AI provider (provider-specific default applies).",type:"string"},"ai-concurrency":{describe:"Number of workflows designed in parallel with --with-ai for large descriptions.",type:"number",default:4,coerce:st("ai-concurrency",!0)},"max-workflows":{describe:"Most workflows the AI may design with --with-ai.",type:"number",default:10,coerce:st("max-workflows",!0)}}),async r=>{let{handleGenerateArazzo:e}=await import("./chunks/5PG3ST2N.js");J(e)(r)}).command("generate-client [api]","Generate a TypeScript client from an OpenAPI description [experimental].",r=>r.env("REDOCLY_CLI_GENERATE_CLIENT").positional("api",{describe:"OpenAPI description file path (or alias from redocly.yaml `apis:`).",type:"string"}).options({output:{alias:"o",describe:"Output file path for the generated client (must end in .ts).",type:"string",requiresArg:!0},"server-url":{describe:"Override the server URL inlined into the generated runtime. Defaults to `servers[0].url`.",type:"string",requiresArg:!0},"output-mode":{describe:"How the client is split across files: `single` (default, one file) or `split` (schema types and guards in a sibling `<name>.schemas.ts` the entry re-exports).",choices:["single","split"],requiresArg:!0},runtime:{describe:"Runtime distribution: 'inline' (default) embeds the runtime in the generated file; 'module' writes it as real files in a runtime/ folder beside the client.",choices:["inline","module"],requiresArg:!0},docs:{description:"Also write reference documentation for what this run generates: one Markdown page per selected generator that documents itself (the CLI, and each SDK).",type:"boolean"},"go-package":{description:"Package clause of the `go` generator's output (a valid Go package name). Defaults to `client`.",type:"string",requiresArg:!0},"import-ext":{describe:"Extension in generated relative imports: 'js' (default) suits tsc and bundlers; 'ts' suits runtimes that resolve specifiers literally, like Node's built-in type stripping (node client.ts).",choices:["js","ts"],requiresArg:!0},setup:{describe:"Path to a publisher setup module (a file default-exporting { config, middleware }) that gets included into the generated client \u2014 pre-configure defaults such as the server URL, retries, headers, and middleware, so a published SDK ships with them built in. Works across all output modes.",type:"string",requiresArg:!0},"args-style":{describe:"How operation inputs are passed: `flat` (default) spreads path params as positional arguments followed by `params`/`body`/`headers`; `grouped` bundles every input into a single `args` object (the per-call request `init` stays a separate trailing argument).",choices:["flat","grouped"],requiresArg:!0},"error-mode":{describe:"Error handling: 'throw' (default) throws ApiError on non-2xx; 'result' returns { data, error, response }.",choices:["throw","result"],requiresArg:!0},"date-type":{describe:"How `date-time`/`date` string fields are typed: 'string' (default) keeps the ISO wire shape; 'Date' emits a `Date` (pair with --generator transformers so the runtime value matches).",choices:["string","Date"],requiresArg:!0},"mock-data":{describe:"How the `mock` generator produces data: 'static' (default) inlines deterministic literals (zero-dep); 'faker' emits @faker-js/faker calls for realistic data (install @faker-js/faker as a dev dependency).",choices:["static","faker"],requiresArg:!0},"mock-seed":{describe:"Seed for faker-mode mocks: emits a top-level `faker.seed(<n>)` so generated data is reproducible across runs. Ignored in static mode.",type:"number",requiresArg:!0},generator:{describe:'Generator to run; repeat the flag to run several (default: typescript). Built-in: typescript, zod, tanstack-query, tanstack-query-vue, tanstack-query-svelte, tanstack-query-solid, swr, mock, transformers, cli, python, go, php \u2014 or a path/package specifier for a custom generator. What each one emits is in the "Use the generated client" guide. Example: --generator typescript --generator zod',type:"string",array:!0,requiresArg:!0},config:{describe:"Path to the config file.",type:"string",requiresArg:!0}}),async r=>{let{handleGenerateClient:e}=await import("./chunks/O7F2NBMC.js");J(e)(r)}).command("eject-generator [generator]","Vendor a built-in client generator into your repo as an editable file [experimental].",r=>r.positional("generator",{describe:`Built-in generator to eject (${[...Rt].join(", ")}).`,type:"string"}).options({config:{description:"Path to the config file.",type:"string"},dir:{describe:"Directory to eject into (default: ./generators).",type:"string",requiresArg:!0},force:{describe:"Overwrite an existing ejected file (discards local edits).",type:"boolean",default:!1},update:{describe:"Three-way merge a newer generator version into your customized copy (pristine \xD7 new \xD7 yours).",type:"boolean",default:!1}}),async r=>{J(fa)(r)}).command("generate-spec <traffic>","Infer an OpenAPI description from recorded HTTP traffic, optionally refined with AI [experimental].",r=>r.env("REDOCLY_CLI_GENERATE_SPEC").positional("traffic",{describe:"Path to a traffic log file or folder (HAR, Kong, Nginx/Apache JSON, NDJSON).",type:"string"}).option({type:{describe:"Target API description type.",choices:["openapi"],default:"openapi"},"traffic-format":{describe:"Traffic input format.",choices:["auto","har","kong","nginx-json","apache-json","ndjson"],default:"auto"},server:{describe:"Server URL the traffic was captured against: only requests under it are considered, the rest of their URL becomes the API path, and it becomes the servers URL of the generated description.",type:"string"},title:{describe:"Title for the generated API description.",type:"string"},"with-ai":{describe:"Refine the inferred description with an AI provider to narrow the hypothesis.",type:"boolean",default:!1},"ai-provider":{describe:'AI provider used with --with-ai; runs the "claude", "codex", or "cursor" CLI in non-interactive mode.',choices:["claude","codex","cursor"],default:"claude"},"ai-model":{describe:"Model passed to the selected AI provider (provider-specific default applies).",type:"string"},"ai-concurrency":{describe:"Number of operations refined in parallel with --with-ai.",type:"number",default:4,coerce:st("ai-concurrency",!0)},output:{alias:"o",describe:"Write the generated description to this file instead of stdout.",type:"string"},config:{describe:"Path to the config file.",type:"string"}}),async r=>{let{handleGenerateSpec:e}=await import("./chunks/OP7NIAI7.js");J(e)(r)}).command("introspect-mcp [server-url]","Introspect a running MCP server and record its capabilities in the x-mcp extension of an OpenAPI description [experimental].",r=>r.env("REDOCLY_CLI_INTROSPECT_MCP").positional("server-url",{describe:"URL of the MCP server (Streamable HTTP, with a fallback to the legacy HTTP+SSE transport). Alternative to --command.",type:"string"}).option({command:{describe:'Command that starts a local MCP server to introspect over stdio, for example "npx -y my-mcp-server". Quote arguments that contain spaces. Alternative to a server URL.',type:"string",requiresArg:!0},output:{alias:"o",describe:"OpenAPI description file to create or update.",type:"string",default:"openapi.yaml"},header:{alias:"H",describe:'Header sent with every request to the MCP server, in "Name: value" format. Repeat the option for multiple headers.',array:!0,type:"string"},check:{describe:"Verify the description is up to date with the MCP server instead of writing: report the differences and exit with an error when it is not.",type:"boolean",default:!1},config:{describe:"Path to the config file.",type:"string"}}).check(e=>{if(!!e["server-url"]==!!e.command)throw new Error("Provide either an MCP server URL or --command, not both.");if(e.command&&e.header)throw new Error("The --header option only applies to an MCP server URL.");return!0}),async r=>{let{handleIntrospectMcp:e}=await import("./chunks/2OVI7BIW.js");J(e)(r)}).command("scorecard-classic [api]","Run quality scorecards with multiple rule levels to validate and maintain API description standards.",r=>r.positional("api",{type:"string"}).option({config:{describe:"Path to the config file.",type:"string"},"project-url":{describe:"URL to the project scorecard configuration.",type:"string"},format:{description:"Use a specific output format.",choices:["stylish","json","checkstyle","junit"],default:"stylish"},"target-level":{describe:"Target level for the scorecard.",type:"string"},verbose:{alias:"v",describe:"Apply verbose mode.",type:"boolean"}}),async r=>{let{handleScorecardClassic:e}=await import("./chunks/RUIEI3YV.js");J(e)(r)}).command("drift <traffic>","Detect drift between recorded HTTP traffic and an OpenAPI description [experimental].",r=>r.env("REDOCLY_CLI_DRIFT").positional("traffic",{describe:"Path to a traffic log file or folder (HAR, Kong, Nginx/Apache JSON, NDJSON).",type:"string"}).option({api:{describe:"OpenAPI description file or folder to validate against.",type:"string",demandOption:!0},"traffic-format":{describe:"Traffic input format.",choices:["auto","har","kong","nginx-json","apache-json","ndjson"],default:"auto"},"report-format":{describe:"Output format.",alias:"format",choices:["pretty","json","csv","sarif"],default:"pretty"},"match-mode":{describe:"Endpoint matching mode (how requests are located via the description servers). Mutually exclusive with --server.",choices:["strict-host","basepath"],defaultDescription:"strict-host"},"ignore-cookies":{describe:"Ignore cookie-based checks (useful for logs exported without cookies).",type:"boolean",default:!1},"ignore-headers":{describe:'Comma-separated header names to skip in undocumented-header checks. A trailing "*" matches by prefix, e.g. "x-consumer-*".',type:"string"},"max-findings":{describe:"Maximum findings shown in pretty output.",type:"number",default:10},"min-severity":{describe:"Discard findings below this severity from the report.",choices:["info","warning","error"],default:"info"},rules:{describe:"Comma-separated builtin rules to run.",type:"string"},output:{alias:"o",describe:"Write the drift report (in the format selected with --format) to this file instead of stdout.",type:"string"},server:{describe:"Server URL the traffic was captured against: only requests under it are considered, and the rest of their URL is treated as the API path. It replaces the description servers and the remaining path is matched against the description paths directly. Mutually exclusive with --match-mode.",type:"string"},coverage:{describe:"Print how much of the description the traffic exercised: operations, parameters, schema properties, and response codes.",type:"boolean",default:!1},"coverage-output":{describe:"Write a detailed JSON coverage report (per operation, with covered and missing items) to this file.",type:"string"},config:{describe:"Path to the config file.",type:"string"},"lint-config":{describe:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handleDrift:e}=await import("./chunks/3JYY42DL.js");J(e)(r)}).command("proxy","Capture live HTTP traffic through a reverse proxy into a HAR file, optionally validating it against an OpenAPI description [experimental].",r=>r.env("REDOCLY_CLI_PROXY").option({target:{describe:"Upstream base URL to forward captured requests to.",type:"string",demandOption:!0},port:{describe:"Port the proxy listens on.",type:"number",default:4040},host:{describe:"Host the proxy binds to.",type:"string",default:"127.0.0.1"},har:{describe:"Path to the HAR file where captured traffic is written.",type:"string",demandOption:!0},api:{describe:"OpenAPI description file or folder to validate captured traffic against (live).",type:"string"},"report-format":{describe:"Output format for the validation report printed on shutdown.",alias:"format",choices:["pretty","json","csv","sarif"],default:"pretty"},"match-mode":{describe:"Endpoint matching mode.",choices:["strict-host","basepath"],default:"strict-host"},"ignore-cookies":{describe:"Ignore cookie-based checks.",type:"boolean",default:!1},"ignore-headers":{describe:'Comma-separated header names to skip in undocumented-header checks. A trailing "*" matches by prefix, e.g. "x-consumer-*".',type:"string"},"max-findings":{describe:"Maximum findings shown in pretty output.",type:"number",default:10},rules:{describe:"Comma-separated builtin rules to run.",type:"string"},config:{describe:"Path to the config file.",type:"string"},"lint-config":{describe:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handleProxy:e}=await import("./chunks/GVQMC2WB.js");J(e)(r)}).completion("completion","Generate autocomplete script for `redocly` command.").demandCommand(1).middleware([ga]).strict().argv;
154
+ `),process.exit(0))},!0).help("help","Show help.").parserConfiguration({"greedy-arrays":!1,"boolean-negation":!1}).command("stats [api]","Show statistics for an API description.",r=>r.env("REDOCLY_CLI_STATS").positional("api",{type:"string"}).option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},format:{description:"Use a specific output format.",choices:["stylish","json","markdown"],default:"stylish"}}),async r=>{let{handleStats:e}=await import("./chunks/LVGVWPDB.js");J(e)(r)}).command("inspect-node-types <api>","Show the node types of an API description, for writing configurable rules and custom plugins [experimental].",r=>r.env("REDOCLY_CLI_INSPECT_NODE_TYPES").positional("api",{description:"API description file to inspect.",type:"string",demandOption:!0}).option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},pointer:{description:"JSON pointer to a node, optionally prefixed with a file: `#/paths` or `schemas.yaml#/User`.",type:"string",alias:"p"},type:{description:"List only the nodes of this type.",type:"string"},summary:{description:"List the node types used in the description, with counts.",type:"boolean"},parents:{description:"Show the chain of node types leading to the node: down to the node with --pointer, or the distinct chains that reach the type with --type.",type:"boolean"}}).conflicts({pointer:["type","summary"],type:["summary"],summary:["parents"]}).check(e=>{if(e.parents&&!e.pointer&&!e.type)throw new Error("The --parents option requires --pointer or --type.");return!0}),async r=>{let{handleInspectNodeTypes:e}=await import("./chunks/SXBAAS4M.js");J(e)(r)}).command("score [api]","Score an API description for integration simplicity and agent readiness.",r=>r.env("REDOCLY_CLI_SCORE").positional("api",{type:"string"}).option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},format:{description:"Use a specific output format.",choices:["stylish","json"],default:"stylish"},"operation-details":{description:"Print per-operation metric details.",type:"boolean",default:!1},"debug-operation-id":{description:"Print detailed schema breakdown for a specific operation.",type:"string"}}),async r=>{let{handleScore:e}=await import("./chunks/XJTGJYVS.js");J(e)(r)}).command("split [api]","Split an API description into a multi-file structure.",r=>r.env("REDOCLY_CLI_SPLIT").positional("api",{description:"API description file that you want to split",type:"string"}).option({outDir:{description:"Output directory where files will be saved.",required:!0,type:"string"},separator:{description:"File path separator used while splitting.",required:!1,type:"string",default:"_"},"file-name-conflicts-severity":{description:"Severity level for file name conflicts.",choices:["warn","error","off"],default:"warn"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}).demandOption("api"),async r=>{let{handleSplit:e}=await import("./chunks/37WWN4MA.js");J(e)(r)}).command("join [apis...]","Join multiple API descriptions into one [experimental].",r=>r.env("REDOCLY_CLI_JOIN").positional("apis",{array:!0,type:"string",demandOption:!0}).option({"prefix-tags-with-info-prop":{description:"Prefix tags with property value from info object.",requiresArg:!0,type:"string"},"prefix-tags-with-filename":{description:"Prefix tags with property value from file name.",type:"boolean",default:!1},"prefix-components-with-info-prop":{description:"Prefix components with property value from info object.",requiresArg:!0,type:"string"},"without-x-tag-groups":{description:"Skip automated x-tagGroups creation",type:"boolean"},output:{description:"Output file.",alias:"o",type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handleJoin:e}=await import("./chunks/3C6UUCEW.js");J(e)(r)}).command("push-status [pushId]",!1,r=>r.env("REDOCLY_CLI_PUSH_STATUS").positional("pushId",{description:"Push id.",type:"string",demandOption:!0}).implies("max-execution-time","wait").option({organization:{description:"ID of the organization to push to.",type:"string",alias:"o",required:!0},project:{description:"ID of the project to push to.",type:"string",required:!0,alias:"p"},domain:{description:"Specify a domain.",alias:"d",type:"string",required:!1},wait:{description:"Wait for build to finish.",type:"boolean",default:!1},"max-execution-time":{description:"Maximum execution time in seconds.",type:"number"},"continue-on-deploy-failures":{description:"Command does not fail even if the deployment fails.",type:"boolean",default:!1},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handlePushStatus:e}=await import("./chunks/4AM55DEH.js");J(e)(r)}).command("push [files...]","Push documents to Reunite.",r=>r.env("REDOCLY_CLI_PUSH").positional("files",{type:"string",array:!0,demandOption:!0}).option({branch:{description:"Branch name to push to.",type:"string",alias:"b",required:!0},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},organization:{description:"ID of the organization to push to.",type:"string",alias:"o",required:!0},project:{description:"ID of the project to push to.",type:"string",alias:"p",required:!0},"mount-path":{description:"The path files should be pushed to.",type:"string",alias:"mp",required:!0,coerce:ba},author:{description:"Author of the commit.",type:"string",alias:"a",required:!0},message:{description:"Commit message.",type:"string",alias:"m",required:!0},"commit-sha":{description:"Commit SHA.",type:"string",alias:"sha"},"commit-url":{description:"Commit URL.",type:"string",alias:"url"},namespace:{description:"Repository namespace.",type:"string"},repository:{description:"Repository name.",type:"string"},"created-at":{description:"Commit creation date.",type:"string"},domain:{description:"Specify a domain.",alias:"d",type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},"default-branch":{type:"string",default:"main"},"max-execution-time":{description:"Maximum execution time in seconds.",type:"number"},"wait-for-deployment":{description:"Wait for build to finish.",type:"boolean",default:!1},replace:{description:"Remove the files under the mount path that are not part of this push.",type:"boolean",default:!1},verbose:{type:"boolean",default:!1},"continue-on-deploy-failures":{description:"Command does not fail even if the deployment fails.",type:"boolean",default:!1}}),async r=>{let{handlePush:e}=await import("./chunks/3FXYWWTJ.js");J(e)(r)}).command("recheck [paths..]","Lint Markdown prose and structure from the recheck block in redocly.yaml.",r=>r.env("REDOCLY_CLI_RECHECK").positional("paths",{array:!0,type:"string",describe:"Files or directories to lint. Default: the current directory."}).option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},format:{description:"Use a specific output format.",choices:["table","json","sarif","github-actions"],default:"table"},tags:{description:"Run only rules with these tags.",array:!0,type:"string"},rule:{description:"Run only these rules.",alias:"r",array:!0,type:"string"},"skip-rule":{description:"Skip these rules.",array:!0,type:"string"},stats:{description:"Print rule statistics.",alias:"s",type:"boolean"},fix:{description:"Apply fixes to Markdown files.",alias:"f",type:"boolean"},"max-problems":{description:"Maximum number of problems in the report.",type:"number"},summary:{description:"Print a run summary.",choices:["json","text"],type:"string"},"summary-path":{description:"Write the summary to a file.",type:"string"},readability:{description:"Report readability scores instead of linting.",type:"boolean"},"generate-baseline":{description:"Write the baseline file from the current findings.",type:"boolean"},"generate-markdoc-schema":{description:"Generate a Markdoc tag schema from theme modules.",type:"boolean"},from:{description:"Module paths to read Markdoc tags from (with --generate-markdoc-schema).",array:!0,type:"string"},output:{description:"Output file for the generated schema.",type:"string"},check:{description:"Fail if the generated schema differs from --output.",type:"boolean"}}),async r=>{let{handleRecheck:e}=await import("./chunks/2XK7ML3U.js"),{recheckPresetsPlugin:t}=await import("./chunks/WSDNWUOV.js");J(e,{plugins:[t]})(r)}).command("lint [apis...]","Lint an API or Arazzo description.",r=>r.env("REDOCLY_CLI_LINT").positional("apis",{array:!0,type:"string",demandOption:!0}).option({format:{description:"Use a specific output format.",choices:["stylish","codeframe","json","checkstyle","codeclimate","summary","markdown","github-actions","junit"],default:"codeframe"},"max-problems":{requiresArg:!0,description:"Reduce output to a maximum of N problems.",type:"number",default:100},"generate-ignore-file":{description:"Generate an ignore file.",type:"boolean"},"skip-rule":{description:"Ignore certain rules.",array:!0,type:"string"},"skip-preprocessor":{description:"Ignore certain preprocessors.",array:!0,type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},extends:{description:"Override extends configurations (defaults or config file settings).",requiresArg:!0,array:!0,type:"string"}}),async r=>{let{handleLint:e}=await import("./chunks/S6NFOZ34.js");J(e)(r)}).command("bundle [apis...]","Bundle a multi-file API description to a single file.",r=>r.env("REDOCLY_CLI_BUNDLE").positional("apis",{array:!0,type:"string",demandOption:!0}).options({output:{type:"string",description:"Output file or folder for inline APIs.",alias:"o"},ext:{description:"Bundle file extension.",requiresArg:!0,choices:Zn},"skip-preprocessor":{description:"Ignore certain preprocessors.",array:!0,type:"string"},"skip-decorator":{description:"Ignore certain decorators.",array:!0,type:"string"},overlay:{description:"Overlay file to apply. Repeat to apply several, in order.",array:!0,type:"string",requiresArg:!0},dereferenced:{alias:"d",type:"boolean",description:"Produce a fully dereferenced bundle."},force:{alias:"f",type:"boolean",description:"Produce bundle output even when errors occur."},config:{description:"Path to the config file.",type:"string"},metafile:{description:"Produce metadata about the bundle",type:"string"},extends:{description:"Override extends configurations (defaults or config file settings).",requiresArg:!0,array:!0,type:"string",hidden:!0},"remove-unused-components":{description:"Remove unused components.",type:"boolean",default:!1},"keep-url-references":{description:"Keep absolute url references.",type:"boolean",alias:"k"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},"component-renaming-conflicts-severity":{description:"Whether to show warnings or fail on renaming conflicts (defaults to warn).",choices:["warn","error","off"]},"component-names-strategy":{description:"How to name inlined Schema components: 'basename' (default) or 'title' (from each schema's `title`).",choices:["basename","title"],default:"basename"}}).check(e=>{if(e.output&&(!e.apis||e.apis.length===0))throw new Error("At least one inline API must be specified when using --output.");return!0}),async r=>{let{handleBundle:e}=await import("./chunks/6EGJEFXO.js");J(e)(r)}).command("check-config","Lint the Redocly configuration file.",async r=>r.env("REDOCLY_CLI_CHECK_CONFIG").option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error"],default:"error"}}),r=>{J()(r)}).command("login","Log in to Redocly.",async r=>r.env("REDOCLY_CLI_LOGIN").options({residency:{description:"Residency of the application. Defaults to `us`.",alias:["r"],type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},verbose:{alias:"v",describe:"Apply verbose mode.",type:"boolean"}}),async r=>{let{handleLogin:e}=await import("./chunks/HYE4U6V5.js");J(e)(r)}).command("logout","Clear your stored credentials.",r=>r,async r=>{let{handleLogout:e}=await import("./chunks/ZCVUIIPU.js");J(e)(r)}).command("project","[early access] Work with a Redocly-hosted project.",r=>r.env("REDOCLY_CLI_PROJECT").command("clone <project> [directory]","Clone a Redocly-hosted project as a Git repository.",e=>e.positional("project",{description:"Organization and project slugs or IDs, as `<organization>/<project>`.",type:"string",demandOption:!0}).positional("directory",{description:"Directory to clone into. Defaults to the project.",type:"string"}).options({residency:{description:"Residency of the application. Defaults to `us`.",alias:["r"],type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"}}),async e=>{let{handleProjectClone:t}=await import("./chunks/TKLMYBPI.js");J(t)(e)}).command("git-credentials <operation>",!1,e=>e.positional("operation",{description:"Credential helper operation: get, store, or erase.",type:"string",demandOption:!0}),async e=>{let{handleProjectGitCredentials:t}=await import("./chunks/ENSYM7KY.js");process.stdout.write(await t({operation:e.operation,input:process.stdin,version:Ie}))}).demandCommand(1,"Specify a project subcommand: clone.")).command("preview","Preview Redocly project using one of the product NPM packages.",r=>r.env("REDOCLY_CLI_PREVIEW").options({product:{type:"string",choices:["redoc","revel","reef","realm","redoc-revel","redoc-reef","revel-reef"],description:"Product used to launch preview. Default is inferred from project's package.json or 'realm' is used."},plan:{type:"string",choices:ni,default:"enterprise"},port:{alias:"p",type:"number",description:"Preview port.",default:4e3,coerce:st("port",!0)},"project-dir":{alias:["d","source-dir"],type:"string",description:"Specifies the project content directory. The default value is the directory where the command is executed.",default:"."},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{process.argv.some(t=>t.startsWith("--source-dir"))&&K.error(`Option --source-dir is deprecated and will be removed soon. Use --project-dir instead.
155
+ `);let{previewProject:e}=await import("./chunks/SYWAPWW7.js");J(e)(r)}).command("build-docs [api]","Produce API documentation as an HTML file",r=>r.positional("api",{type:"string"}).options({o:{describe:"Output destination file.",alias:"output",type:"string",default:"redoc-static.html"},title:{describe:"Page title.",type:"string"},disableGoogleFont:{describe:"Disable Google fonts.",type:"boolean",default:!1},t:{alias:"template",describe:"Path to handlebars page template, see https://github.com/Redocly/redocly-cli/blob/main/packages/cli/src/commands/build-docs/template.hbs for the example.",type:"string"},templateOptions:{describe:"Additional options to pass to the template. Use dot notation, e.g. templateOptions.metaDescription"},theme:{describe:"Redoc theme.openapi configuration. Use dot notation, e.g. theme.openapi.nativeScrollbars"},config:{describe:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}).check(e=>{if(e.theme&&!e.theme?.openapi)throw new Error("Invalid option: theme.openapi not set.");return!0}),async r=>{let{handlerBuildCommand:e}=await import("./chunks/WX24BERR.js");J(e)(r)}).command("translate <locale>","Creates or updates translations.yaml files and fills them with missing built-in translations and translations from the redocly.yaml and sidebars.yaml files.",r=>r.env("REDOCLY_CLI_TRANSLATE").positional("locale",{description:"Locale code to generate translations for, or `all` for all current project locales.",type:"string",demandOption:!0}).options({"project-dir":{alias:"d",type:"string",description:"Specifies the project content directory. The default value is the directory where the command is executed.",default:"."},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handleTranslations:e}=await import("./chunks/LRLGVYCG.js");J(e)(r)}).command("eject <type> [path]","Helper function to eject project elements for customization.",r=>r.env("REDOCLY_CLI_EJECT").positional("type",{description:"Specifies what type of project element to eject. Currently this value must be `component`.",demandOption:!0,choices:["component"]}).positional("path",{description:"Filepath to a component or filepath with glob pattern.",type:"string"}).options({"project-dir":{alias:"d",type:"string",description:"Specifies the project content directory. The default value is the directory where the command is executed.",default:"."},force:{alias:"f",type:"boolean",description:'Skips the "overwrite existing" confirmation when ejecting a component that is already ejected in the destination.'},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handleEject:e}=await import("./chunks/TBZEEKTV.js");J(e)(r)}).command("respect [files...]","Run Arazzo tests.",r=>r.env("REDOCLY_CLI_RESPECT").positional("files",{describe:"Test files or glob pattern.",type:"string",array:!0,default:[]}).options({input:{alias:"i",describe:"Input parameters.",type:"string"},server:{alias:"S",describe:"Server parameters.",type:"string"},workflow:{alias:"w",describe:"Workflow name.",type:"string",array:!0},skip:{alias:"s",describe:"Workflow to skip.",type:"string",array:!0},verbose:{alias:"v",describe:"Apply verbose mode.",type:"boolean"},"har-output":{describe:"Har file output name.",type:"string",alias:"H"},"json-output":{describe:"JSON file output name.",type:"string",alias:"J"},mtls:{describe:'Per-domain mutual TLS certificates configuration as JSON. Format: {"<domain>": {"clientCert": "<path>", "clientKey": "<path>", "caCert": "<path>"}}',type:"string",array:!0,coerce:pa},severity:{describe:"Severity of the check.",type:"string"},"max-steps":{describe:"Maximum number of steps to run (default: 2000).",type:"number",default:2e3,coerce:st("max-steps",!0)},"max-fetch-timeout":{describe:"Maximum time to wait for API response per request in milliseconds (default: 40 seconds).",type:"number",default:4e4,coerce:st("max-fetch-timeout",!1)},"execution-timeout":{describe:"Maximum time to wait for the Respect execution in milliseconds (default: 1 hour).",type:"number",default:36e5,coerce:st("execution-timeout",!1)},"no-secrets-masking":{describe:"Do not mask secrets in the output.",type:"boolean",default:!1}}),async r=>{let{handleRespect:e}=await import("./chunks/GWXT3QO6.js");J(e)(r)}).command("generate-arazzo <descriptionPath>","Auto-generate arazzo description file from an API description.",r=>r.env("REDOCLY_CLI_GENERATE_ARAZZO").positional("descriptionPath",{describe:"Description file path.",type:"string"}).options({"output-file":{alias:"o",describe:"Output File name.",type:"string",requiresArg:!0},"with-ai":{describe:"Redesign the generated workflows with an AI provider, using the OpenAPI description as context.",type:"boolean",default:!1},"ai-provider":{describe:'AI provider used with --with-ai; runs the "claude", "codex", or "cursor" CLI in non-interactive mode.',choices:["claude","codex","cursor"],default:"claude"},"ai-model":{describe:"Model passed to the selected AI provider (provider-specific default applies).",type:"string"},"ai-concurrency":{describe:"Number of workflows designed in parallel with --with-ai for large descriptions.",type:"number",default:4,coerce:st("ai-concurrency",!0)},"max-workflows":{describe:"Most workflows the AI may design with --with-ai.",type:"number",default:10,coerce:st("max-workflows",!0)}}),async r=>{let{handleGenerateArazzo:e}=await import("./chunks/5PG3ST2N.js");J(e)(r)}).command("generate-client [api]","Generate a TypeScript client from an OpenAPI description [experimental].",r=>r.env("REDOCLY_CLI_GENERATE_CLIENT").positional("api",{describe:"OpenAPI description file path (or alias from redocly.yaml `apis:`).",type:"string"}).options({output:{alias:"o",describe:"Output file path for the generated client (must end in .ts).",type:"string",requiresArg:!0},"server-url":{describe:"Override the server URL inlined into the generated runtime. Defaults to `servers[0].url`.",type:"string",requiresArg:!0},"output-mode":{describe:"How the client is split across files: `single` (default, one file) or `split` (schema types and guards in a sibling `<name>.schemas.ts` the entry re-exports).",choices:["single","split"],requiresArg:!0},runtime:{describe:"Runtime distribution: 'inline' (default) embeds the runtime in the generated file; 'module' writes it as real files in a runtime/ folder beside the client.",choices:["inline","module"],requiresArg:!0},docs:{description:"Also write reference documentation for what this run generates: one Markdown page per selected generator that documents itself (the CLI, and each SDK).",type:"boolean"},"go-package":{description:"Package clause of the `go` generator's output (a valid Go package name). Defaults to `client`.",type:"string",requiresArg:!0},"import-ext":{describe:"Extension in generated relative imports: 'js' (default) suits tsc and bundlers; 'ts' suits runtimes that resolve specifiers literally, like Node's built-in type stripping (node client.ts).",choices:["js","ts"],requiresArg:!0},setup:{describe:"Path to a publisher setup module (a file default-exporting { config, middleware }) that gets included into the generated client \u2014 pre-configure defaults such as the server URL, retries, headers, and middleware, so a published SDK ships with them built in. Works across all output modes.",type:"string",requiresArg:!0},"args-style":{describe:"How operation inputs are passed: `flat` (default) spreads path params as positional arguments followed by `params`/`body`/`headers`; `grouped` bundles every input into a single `args` object (the per-call request `init` stays a separate trailing argument).",choices:["flat","grouped"],requiresArg:!0},"error-mode":{describe:"Error handling: 'throw' (default) throws ApiError on non-2xx; 'result' returns { data, error, response }.",choices:["throw","result"],requiresArg:!0},"date-type":{describe:"How `date-time`/`date` string fields are typed: 'string' (default) keeps the ISO wire shape; 'Date' emits a `Date` (pair with --generator transformers so the runtime value matches).",choices:["string","Date"],requiresArg:!0},"mock-data":{describe:"How the `mock` generator produces data: 'static' (default) inlines deterministic literals (zero-dep); 'faker' emits @faker-js/faker calls for realistic data (install @faker-js/faker as a dev dependency).",choices:["static","faker"],requiresArg:!0},"mock-seed":{describe:"Seed for faker-mode mocks: emits a top-level `faker.seed(<n>)` so generated data is reproducible across runs. Ignored in static mode.",type:"number",requiresArg:!0},generator:{describe:'Generator to run; repeat the flag to run several (default: typescript). Built-in: typescript, zod, tanstack-query, tanstack-query-vue, tanstack-query-svelte, tanstack-query-solid, swr, mock, transformers, cli, python, go, php \u2014 or a path/package specifier for a custom generator. What each one emits is in the "Use the generated client" guide. Example: --generator typescript --generator zod',type:"string",array:!0,requiresArg:!0},config:{describe:"Path to the config file.",type:"string",requiresArg:!0}}),async r=>{let{handleGenerateClient:e}=await import("./chunks/2OBVZIAW.js");J(e)(r)}).command("eject-generator [generator]","Vendor a built-in client generator into your repo as an editable file [experimental].",r=>r.positional("generator",{describe:`Built-in generator to eject (${[...Rt].join(", ")}).`,type:"string"}).options({config:{description:"Path to the config file.",type:"string"},dir:{describe:"Directory to eject into (default: ./generators).",type:"string",requiresArg:!0},force:{describe:"Overwrite an existing ejected file (discards local edits).",type:"boolean",default:!1},update:{describe:"Three-way merge a newer generator version into your customized copy (pristine \xD7 new \xD7 yours).",type:"boolean",default:!1}}),async r=>{J(fa)(r)}).command("generate-spec <traffic>","Infer an OpenAPI description from recorded HTTP traffic, optionally refined with AI [experimental].",r=>r.env("REDOCLY_CLI_GENERATE_SPEC").positional("traffic",{describe:"Path to a traffic log file or folder (HAR, Kong, Nginx/Apache JSON, NDJSON).",type:"string"}).option({type:{describe:"Target API description type.",choices:["openapi"],default:"openapi"},"traffic-format":{describe:"Traffic input format.",choices:["auto","har","kong","nginx-json","apache-json","ndjson"],default:"auto"},server:{describe:"Server URL the traffic was captured against: only requests under it are considered, the rest of their URL becomes the API path, and it becomes the servers URL of the generated description.",type:"string"},title:{describe:"Title for the generated API description.",type:"string"},"with-ai":{describe:"Refine the inferred description with an AI provider to narrow the hypothesis.",type:"boolean",default:!1},"ai-provider":{describe:'AI provider used with --with-ai; runs the "claude", "codex", or "cursor" CLI in non-interactive mode.',choices:["claude","codex","cursor"],default:"claude"},"ai-model":{describe:"Model passed to the selected AI provider (provider-specific default applies).",type:"string"},"ai-concurrency":{describe:"Number of operations refined in parallel with --with-ai.",type:"number",default:4,coerce:st("ai-concurrency",!0)},output:{alias:"o",describe:"Write the generated description to this file instead of stdout.",type:"string"},config:{describe:"Path to the config file.",type:"string"}}),async r=>{let{handleGenerateSpec:e}=await import("./chunks/OP7NIAI7.js");J(e)(r)}).command("introspect-mcp [server-url]","Introspect a running MCP server and record its capabilities in the x-mcp extension of an OpenAPI description [experimental].",r=>r.env("REDOCLY_CLI_INTROSPECT_MCP").positional("server-url",{describe:"URL of the MCP server (Streamable HTTP, with a fallback to the legacy HTTP+SSE transport). Alternative to --command.",type:"string"}).option({command:{describe:'Command that starts a local MCP server to introspect over stdio, for example "npx -y my-mcp-server". Quote arguments that contain spaces. Alternative to a server URL.',type:"string",requiresArg:!0},output:{alias:"o",describe:"OpenAPI description file to create or update.",type:"string",default:"openapi.yaml"},header:{alias:"H",describe:'Header sent with every request to the MCP server, in "Name: value" format. Repeat the option for multiple headers.',array:!0,type:"string"},check:{describe:"Verify the description is up to date with the MCP server instead of writing: report the differences and exit with an error when it is not.",type:"boolean",default:!1},config:{describe:"Path to the config file.",type:"string"}}).check(e=>{if(!!e["server-url"]==!!e.command)throw new Error("Provide either an MCP server URL or --command, not both.");if(e.command&&e.header)throw new Error("The --header option only applies to an MCP server URL.");return!0}),async r=>{let{handleIntrospectMcp:e}=await import("./chunks/2OVI7BIW.js");J(e)(r)}).command("scorecard-classic [api]","Run quality scorecards with multiple rule levels to validate and maintain API description standards.",r=>r.positional("api",{type:"string"}).option({config:{describe:"Path to the config file.",type:"string"},"project-url":{describe:"URL to the project scorecard configuration.",type:"string"},format:{description:"Use a specific output format.",choices:["stylish","json","checkstyle","junit"],default:"stylish"},"target-level":{describe:"Target level for the scorecard.",type:"string"},verbose:{alias:"v",describe:"Apply verbose mode.",type:"boolean"}}),async r=>{let{handleScorecardClassic:e}=await import("./chunks/SHZZKTDE.js");J(e)(r)}).command("drift <traffic>","Detect drift between recorded HTTP traffic and an OpenAPI description [experimental].",r=>r.env("REDOCLY_CLI_DRIFT").positional("traffic",{describe:"Path to a traffic log file or folder (HAR, Kong, Nginx/Apache JSON, NDJSON).",type:"string"}).option({api:{describe:"OpenAPI description file or folder to validate against.",type:"string",demandOption:!0},"traffic-format":{describe:"Traffic input format.",choices:["auto","har","kong","nginx-json","apache-json","ndjson"],default:"auto"},"report-format":{describe:"Output format.",alias:"format",choices:["pretty","json","csv","sarif"],default:"pretty"},"match-mode":{describe:"Endpoint matching mode (how requests are located via the description servers). Mutually exclusive with --server.",choices:["strict-host","basepath"],defaultDescription:"strict-host"},"ignore-cookies":{describe:"Ignore cookie-based checks (useful for logs exported without cookies).",type:"boolean",default:!1},"ignore-headers":{describe:'Comma-separated header names to skip in undocumented-header checks. A trailing "*" matches by prefix, e.g. "x-consumer-*".',type:"string"},"max-findings":{describe:"Maximum findings shown in pretty output.",type:"number",default:10},"min-severity":{describe:"Discard findings below this severity from the report.",choices:["info","warning","error"],default:"info"},rules:{describe:"Comma-separated builtin rules to run.",type:"string"},output:{alias:"o",describe:"Write the drift report (in the format selected with --format) to this file instead of stdout.",type:"string"},server:{describe:"Server URL the traffic was captured against: only requests under it are considered, and the rest of their URL is treated as the API path. It replaces the description servers and the remaining path is matched against the description paths directly. Mutually exclusive with --match-mode.",type:"string"},coverage:{describe:"Print how much of the description the traffic exercised: operations, parameters, schema properties, and response codes.",type:"boolean",default:!1},"coverage-output":{describe:"Write a detailed JSON coverage report (per operation, with covered and missing items) to this file.",type:"string"},config:{describe:"Path to the config file.",type:"string"},"lint-config":{describe:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handleDrift:e}=await import("./chunks/3JYY42DL.js");J(e)(r)}).command("proxy","Capture live HTTP traffic through a reverse proxy into a HAR file, optionally validating it against an OpenAPI description [experimental].",r=>r.env("REDOCLY_CLI_PROXY").option({target:{describe:"Upstream base URL to forward captured requests to.",type:"string",demandOption:!0},port:{describe:"Port the proxy listens on.",type:"number",default:4040},host:{describe:"Host the proxy binds to.",type:"string",default:"127.0.0.1"},har:{describe:"Path to the HAR file where captured traffic is written.",type:"string",demandOption:!0},api:{describe:"OpenAPI description file or folder to validate captured traffic against (live).",type:"string"},"report-format":{describe:"Output format for the validation report printed on shutdown.",alias:"format",choices:["pretty","json","csv","sarif"],default:"pretty"},"match-mode":{describe:"Endpoint matching mode.",choices:["strict-host","basepath"],default:"strict-host"},"ignore-cookies":{describe:"Ignore cookie-based checks.",type:"boolean",default:!1},"ignore-headers":{describe:'Comma-separated header names to skip in undocumented-header checks. A trailing "*" matches by prefix, e.g. "x-consumer-*".',type:"string"},"max-findings":{describe:"Maximum findings shown in pretty output.",type:"number",default:10},rules:{describe:"Comma-separated builtin rules to run.",type:"string"},config:{describe:"Path to the config file.",type:"string"},"lint-config":{describe:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handleProxy:e}=await import("./chunks/2OQM5ARW.js");J(e)(r)}).completion("completion","Generate autocomplete script for `redocly` command.").demandCommand(1).middleware([ga]).strict().argv;
156
156
  /*! Bundled license information:
157
157
 
158
158
  yargs-parser/build/lib/string-utils.js: