next-ws 0.0.0-beta-20250820015207 → 0.0.0-beta-20250820141901

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.cjs CHANGED
@@ -1,33 +1,2391 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var wr=Object.create;var Ke=Object.defineProperty;var vr=Object.getOwnPropertyDescriptor;var Ar=Object.getOwnPropertyNames;var Sr=Object.getPrototypeOf,Lr=Object.prototype.hasOwnProperty;var x=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var Cr=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ar(e))!Lr.call(r,n)&&n!==t&&Ke(r,n,{get:()=>e[n],enumerable:!(s=vr(e,n))||s.enumerable});return r};var S=(r,e,t)=>(t=r!=null?wr(Sr(r)):{},Cr(e||!r||!r.__esModule?Ke(t,"default",{value:r,enumerable:!0}):t,r));var et=x((Tn,Qe)=>{"use strict";function yr(r,e){var t=r;e.slice(0,-1).forEach(function(n){t=t[n]||{}});var s=e[e.length-1];return s in t}function Ze(r){return typeof r=="number"||/^0x[0-9a-f]+$/i.test(r)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(r)}function Je(r,e){return e==="constructor"&&typeof r[e]=="function"||e==="__proto__"}Qe.exports=function(r,e){e||(e={});var t={bools:{},strings:{},unknownFn:null};typeof e.unknown=="function"&&(t.unknownFn=e.unknown),typeof e.boolean=="boolean"&&e.boolean?t.allBools=!0:[].concat(e.boolean).filter(Boolean).forEach(function(d){t.bools[d]=!0});var s={};function n(d){return s[d].some(function(I){return t.bools[I]})}Object.keys(e.alias||{}).forEach(function(d){s[d]=[].concat(e.alias[d]),s[d].forEach(function(I){s[I]=[d].concat(s[d].filter(function(F){return I!==F}))})}),[].concat(e.string).filter(Boolean).forEach(function(d){t.strings[d]=!0,s[d]&&[].concat(s[d]).forEach(function(I){t.strings[I]=!0})});var o=e.default||{},i={_:[]};function l(d,I){return t.allBools&&/^--[^=]+$/.test(I)||t.strings[d]||t.bools[d]||s[d]}function u(d,I,F){for(var $=d,z=0;z<I.length-1;z++){var P=I[z];if(Je($,P))return;$[P]===void 0&&($[P]={}),($[P]===Object.prototype||$[P]===Number.prototype||$[P]===String.prototype)&&($[P]={}),$[P]===Array.prototype&&($[P]=[]),$=$[P]}var G=I[I.length-1];Je($,G)||(($===Object.prototype||$===Number.prototype||$===String.prototype)&&($={}),$===Array.prototype&&($=[]),$[G]===void 0||t.bools[G]||typeof $[G]=="boolean"?$[G]=F:Array.isArray($[G])?$[G].push(F):$[G]=[$[G],F])}function m(d,I,F){if(!(F&&t.unknownFn&&!l(d,F)&&t.unknownFn(F)===!1)){var $=!t.strings[d]&&Ze(I)?Number(I):I;u(i,d.split("."),$),(s[d]||[]).forEach(function(z){u(i,z.split("."),$)})}}Object.keys(t.bools).forEach(function(d){m(d,o[d]===void 0?!1:o[d])});var N=[];r.indexOf("--")!==-1&&(N=r.slice(r.indexOf("--")+1),r=r.slice(0,r.indexOf("--")));for(var p=0;p<r.length;p++){var f=r[p],E,A;if(/^--.+=/.test(f)){var ze=f.match(/^--([^=]+)=([\s\S]*)$/);E=ze[1];var xe=ze[2];t.bools[E]&&(xe=xe!=="false"),m(E,xe,f)}else if(/^--no-.+/.test(f))E=f.match(/^--no-(.+)/)[1],m(E,!1,f);else if(/^--.+/.test(f))E=f.match(/^--(.+)/)[1],A=r[p+1],A!==void 0&&!/^(-|--)[^-]/.test(A)&&!t.bools[E]&&!t.allBools&&(!s[E]||!n(E))?(m(E,A,f),p+=1):/^(true|false)$/.test(A)?(m(E,A==="true",f),p+=1):m(E,t.strings[E]?"":!0,f);else if(/^-[^-]+/.test(f)){for(var C=f.slice(1,-1).split(""),ne=!1,w=0;w<C.length;w++){if(A=f.slice(w+2),A==="-"){m(C[w],A,f);continue}if(/[A-Za-z]/.test(C[w])&&A[0]==="="){m(C[w],A.slice(1),f),ne=!0;break}if(/[A-Za-z]/.test(C[w])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(A)){m(C[w],A,f),ne=!0;break}if(C[w+1]&&C[w+1].match(/\W/)){m(C[w],f.slice(w+2),f),ne=!0;break}else m(C[w],t.strings[C[w]]?"":!0,f)}E=f.slice(-1)[0],!ne&&E!=="-"&&(r[p+1]&&!/^(-|--)[^-]/.test(r[p+1])&&!t.bools[E]&&(!s[E]||!n(E))?(m(E,r[p+1],f),p+=1):r[p+1]&&/^(true|false)$/.test(r[p+1])?(m(E,r[p+1]==="true",f),p+=1):m(E,t.strings[E]?"":!0,f))}else if((!t.unknownFn||t.unknownFn(f)!==!1)&&i._.push(t.strings._||!Ze(f)?f:Number(f)),e.stopEarly){i._.push.apply(i._,r.slice(p+1));break}}return Object.keys(o).forEach(function(d){yr(i,d.split("."))||(u(i,d.split("."),o[d]),(s[d]||[]).forEach(function(I){u(i,I.split("."),o[d])}))}),e["--"]?i["--"]=N.slice():N.forEach(function(d){i._.push(d)}),i}});var vt=x((Jn,wt)=>{"use strict";var Se=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 n=this.map.keys().next().value;this.delete(n)}this.map.set(e,t)}return this}};wt.exports=Se});var he=x((Qn,At)=>{"use strict";var es=Object.freeze({loose:!0}),ts=Object.freeze({}),rs=r=>r?typeof r!="object"?es:r:ts;At.exports=rs});var me=x((eo,St)=>{"use strict";var ss="2.0.0",ns=Number.MAX_SAFE_INTEGER||9007199254740991,os=16,is=250,as=["major","premajor","minor","preminor","patch","prepatch","prerelease"];St.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:os,MAX_SAFE_BUILD_LENGTH:is,MAX_SAFE_INTEGER:ns,RELEASE_TYPES:as,SEMVER_SPEC_VERSION:ss,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var te=x((to,Lt)=>{"use strict";var cs=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};Lt.exports=cs});var de=x((D,Ct)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Le,MAX_SAFE_BUILD_LENGTH:ls,MAX_LENGTH:us}=me(),fs=te();D=Ct.exports={};var ps=D.re=[],hs=D.safeRe=[],a=D.src=[],ms=D.safeSrc=[],c=D.t={},ds=0,Ce="[a-zA-Z0-9-]",Es=[["\\s",1],["\\d",us],[Ce,ls]],$s=r=>{for(let[e,t]of Es)r=r.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return r},h=(r,e,t)=>{let s=$s(e),n=ds++;fs(r,n,e),c[r]=n,a[n]=e,ms[n]=s,ps[n]=new RegExp(e,t?"g":void 0),hs[n]=new RegExp(s,t?"g":void 0)};h("NUMERICIDENTIFIER","0|[1-9]\\d*");h("NUMERICIDENTIFIERLOOSE","\\d+");h("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Ce}*`);h("MAINVERSION",`(${a[c.NUMERICIDENTIFIER]})\\.(${a[c.NUMERICIDENTIFIER]})\\.(${a[c.NUMERICIDENTIFIER]})`);h("MAINVERSIONLOOSE",`(${a[c.NUMERICIDENTIFIERLOOSE]})\\.(${a[c.NUMERICIDENTIFIERLOOSE]})\\.(${a[c.NUMERICIDENTIFIERLOOSE]})`);h("PRERELEASEIDENTIFIER",`(?:${a[c.NUMERICIDENTIFIER]}|${a[c.NONNUMERICIDENTIFIER]})`);h("PRERELEASEIDENTIFIERLOOSE",`(?:${a[c.NUMERICIDENTIFIERLOOSE]}|${a[c.NONNUMERICIDENTIFIER]})`);h("PRERELEASE",`(?:-(${a[c.PRERELEASEIDENTIFIER]}(?:\\.${a[c.PRERELEASEIDENTIFIER]})*))`);h("PRERELEASELOOSE",`(?:-?(${a[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${a[c.PRERELEASEIDENTIFIERLOOSE]})*))`);h("BUILDIDENTIFIER",`${Ce}+`);h("BUILD",`(?:\\+(${a[c.BUILDIDENTIFIER]}(?:\\.${a[c.BUILDIDENTIFIER]})*))`);h("FULLPLAIN",`v?${a[c.MAINVERSION]}${a[c.PRERELEASE]}?${a[c.BUILD]}?`);h("FULL",`^${a[c.FULLPLAIN]}$`);h("LOOSEPLAIN",`[v=\\s]*${a[c.MAINVERSIONLOOSE]}${a[c.PRERELEASELOOSE]}?${a[c.BUILD]}?`);h("LOOSE",`^${a[c.LOOSEPLAIN]}$`);h("GTLT","((?:<|>)?=?)");h("XRANGEIDENTIFIERLOOSE",`${a[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);h("XRANGEIDENTIFIER",`${a[c.NUMERICIDENTIFIER]}|x|X|\\*`);h("XRANGEPLAIN",`[v=\\s]*(${a[c.XRANGEIDENTIFIER]})(?:\\.(${a[c.XRANGEIDENTIFIER]})(?:\\.(${a[c.XRANGEIDENTIFIER]})(?:${a[c.PRERELEASE]})?${a[c.BUILD]}?)?)?`);h("XRANGEPLAINLOOSE",`[v=\\s]*(${a[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[c.XRANGEIDENTIFIERLOOSE]})(?:${a[c.PRERELEASELOOSE]})?${a[c.BUILD]}?)?)?`);h("XRANGE",`^${a[c.GTLT]}\\s*${a[c.XRANGEPLAIN]}$`);h("XRANGELOOSE",`^${a[c.GTLT]}\\s*${a[c.XRANGEPLAINLOOSE]}$`);h("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Le}})(?:\\.(\\d{1,${Le}}))?(?:\\.(\\d{1,${Le}}))?`);h("COERCE",`${a[c.COERCEPLAIN]}(?:$|[^\\d])`);h("COERCEFULL",a[c.COERCEPLAIN]+`(?:${a[c.PRERELEASE]})?(?:${a[c.BUILD]})?(?:$|[^\\d])`);h("COERCERTL",a[c.COERCE],!0);h("COERCERTLFULL",a[c.COERCEFULL],!0);h("LONETILDE","(?:~>?)");h("TILDETRIM",`(\\s*)${a[c.LONETILDE]}\\s+`,!0);D.tildeTrimReplace="$1~";h("TILDE",`^${a[c.LONETILDE]}${a[c.XRANGEPLAIN]}$`);h("TILDELOOSE",`^${a[c.LONETILDE]}${a[c.XRANGEPLAINLOOSE]}$`);h("LONECARET","(?:\\^)");h("CARETTRIM",`(\\s*)${a[c.LONECARET]}\\s+`,!0);D.caretTrimReplace="$1^";h("CARET",`^${a[c.LONECARET]}${a[c.XRANGEPLAIN]}$`);h("CARETLOOSE",`^${a[c.LONECARET]}${a[c.XRANGEPLAINLOOSE]}$`);h("COMPARATORLOOSE",`^${a[c.GTLT]}\\s*(${a[c.LOOSEPLAIN]})$|^$`);h("COMPARATOR",`^${a[c.GTLT]}\\s*(${a[c.FULLPLAIN]})$|^$`);h("COMPARATORTRIM",`(\\s*)${a[c.GTLT]}\\s*(${a[c.LOOSEPLAIN]}|${a[c.XRANGEPLAIN]})`,!0);D.comparatorTrimReplace="$1$2$3";h("HYPHENRANGE",`^\\s*(${a[c.XRANGEPLAIN]})\\s+-\\s+(${a[c.XRANGEPLAIN]})\\s*$`);h("HYPHENRANGELOOSE",`^\\s*(${a[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${a[c.XRANGEPLAINLOOSE]})\\s*$`);h("STAR","(<|>)?=?\\s*\\*");h("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");h("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Ft=x((ro,Dt)=>{"use strict";var yt=/^[0-9]+$/,Pt=(r,e)=>{let t=yt.test(r),s=yt.test(e);return t&&s&&(r=+r,e=+e),r===e?0:t&&!s?-1:s&&!t?1:r<e?-1:1},Rs=(r,e)=>Pt(e,r);Dt.exports={compareIdentifiers:Pt,rcompareIdentifiers:Rs}});var M=x((so,_t)=>{"use strict";var Ee=te(),{MAX_LENGTH:Gt,MAX_SAFE_INTEGER:$e}=me(),{safeRe:jt,safeSrc:qt,t:Re}=de(),Os=he(),{compareIdentifiers:Y}=Ft(),ye=class r{constructor(e,t){if(t=Os(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>Gt)throw new TypeError(`version is longer than ${Gt} characters`);Ee("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let s=e.trim().match(t.loose?jt[Re.LOOSE]:jt[Re.FULL]);if(!s)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>$e||this.major<0)throw new TypeError("Invalid major version");if(this.minor>$e||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>$e||this.patch<0)throw new TypeError("Invalid patch version");s[4]?this.prerelease=s[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let o=+n;if(o>=0&&o<$e)return o}return n}):this.prerelease=[],this.build=s[5]?s[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(Ee("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)),Y(this.major,e.major)||Y(this.minor,e.minor)||Y(this.patch,e.patch)}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 s=this.prerelease[t],n=e.prerelease[t];if(Ee("prerelease compare",t,s,n),s===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(s===void 0)return-1;if(s===n)continue;return Y(s,n)}while(++t)}compareBuild(e){e instanceof r||(e=new r(e,this.options));let t=0;do{let s=this.build[t],n=e.build[t];if(Ee("build compare",t,s,n),s===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(s===void 0)return-1;if(s===n)continue;return Y(s,n)}while(++t)}inc(e,t,s){if(e.startsWith("pre")){if(!t&&s===!1)throw new Error("invalid increment argument: identifier is empty");if(t){let n=new RegExp(`^${this.options.loose?qt[Re.PRERELEASELOOSE]:qt[Re.PRERELEASE]}$`),o=`-${t}`.match(n);if(!o||o[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,s);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,s);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,s),this.inc("pre",t,s);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,s),this.inc("pre",t,s);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 n=Number(s)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(t===this.prerelease.join(".")&&s===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(t){let o=[t,n];s===!1&&(o=[t]),Y(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};_t.exports=ye});var X=x((no,Ut)=>{"use strict";var Bt=M(),xs=(r,e,t)=>new Bt(r,t).compare(new Bt(e,t));Ut.exports=xs});var Xt=x((oo,Mt)=>{"use strict";var gs=X(),Ns=(r,e,t)=>gs(r,e,t)===0;Mt.exports=Ns});var Vt=x((io,kt)=>{"use strict";var Is=X(),bs=(r,e,t)=>Is(r,e,t)!==0;kt.exports=bs});var re=x((ao,Wt)=>{"use strict";var Ts=X(),ws=(r,e,t)=>Ts(r,e,t)>0;Wt.exports=ws});var Pe=x((co,Yt)=>{"use strict";var vs=X(),As=(r,e,t)=>vs(r,e,t)>=0;Yt.exports=As});var De=x((lo,Ht)=>{"use strict";var Ss=X(),Ls=(r,e,t)=>Ss(r,e,t)<0;Ht.exports=Ls});var Fe=x((uo,zt)=>{"use strict";var Cs=X(),ys=(r,e,t)=>Cs(r,e,t)<=0;zt.exports=ys});var Zt=x((fo,Kt)=>{"use strict";var Ps=Xt(),Ds=Vt(),Fs=re(),Gs=Pe(),js=De(),qs=Fe(),_s=(r,e,t,s)=>{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 Ps(r,t,s);case"!=":return Ds(r,t,s);case">":return Fs(r,t,s);case">=":return Gs(r,t,s);case"<":return js(r,t,s);case"<=":return qs(r,t,s);default:throw new TypeError(`Invalid operator: ${e}`)}};Kt.exports=_s});var _e=x((po,sr)=>{"use strict";var se=Symbol("SemVer ANY"),qe=class r{static get ANY(){return se}constructor(e,t){if(t=Jt(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),je("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===se?this.value="":this.value=this.operator+this.semver.version,je("comp",this)}parse(e){let t=this.options.loose?Qt[er.COMPARATORLOOSE]:Qt[er.COMPARATOR],s=e.match(t);if(!s)throw new TypeError(`Invalid comparator: ${e}`);this.operator=s[1]!==void 0?s[1]:"",this.operator==="="&&(this.operator=""),s[2]?this.semver=new tr(s[2],this.options.loose):this.semver=se}toString(){return this.value}test(e){if(je("Comparator.test",e,this.options.loose),this.semver===se||e===se)return!0;if(typeof e=="string")try{e=new tr(e,this.options)}catch{return!1}return Ge(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 rr(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new rr(this.value,t).test(e.semver):(t=Jt(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("=")||Ge(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Ge(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};sr.exports=qe;var Jt=he(),{safeRe:Qt,t:er}=de(),Ge=Zt(),je=te(),tr=M(),rr=H()});var H=x((ho,ar)=>{"use strict";var Bs=/\s+/g,Be=class r{constructor(e,t){if(t=Ms(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof Ue)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(Bs," "),this.set=this.raw.split("||").map(s=>this.parseRange(s.trim())).filter(s=>s.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let s=this.set[0];if(this.set=this.set.filter(n=>!or(n[0])),this.set.length===0)this.set=[s];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&zs(n[0])){this.set=[n];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 s=0;s<t.length;s++)s>0&&(this.formatted+=" "),this.formatted+=t[s].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let s=((this.options.includePrerelease&&Ys)|(this.options.loose&&Hs))+":"+e,n=nr.get(s);if(n)return n;let o=this.options.loose,i=o?v[b.HYPHENRANGELOOSE]:v[b.HYPHENRANGE];e=e.replace(i,on(this.options.includePrerelease)),R("hyphen replace",e),e=e.replace(v[b.COMPARATORTRIM],ks),R("comparator trim",e),e=e.replace(v[b.TILDETRIM],Vs),R("tilde trim",e),e=e.replace(v[b.CARETTRIM],Ws),R("caret trim",e);let l=e.split(" ").map(p=>Ks(p,this.options)).join(" ").split(/\s+/).map(p=>nn(p,this.options));o&&(l=l.filter(p=>(R("loose invalid filter",p,this.options),!!p.match(v[b.COMPARATORLOOSE])))),R("range list",l);let u=new Map,m=l.map(p=>new Ue(p,this.options));for(let p of m){if(or(p))return[p];u.set(p.value,p)}u.size>1&&u.has("")&&u.delete("");let N=[...u.values()];return nr.set(s,N),N}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(s=>ir(s,t)&&e.set.some(n=>ir(n,t)&&s.every(o=>n.every(i=>o.intersects(i,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new Xs(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(an(this.set[t],e,this.options))return!0;return!1}};ar.exports=Be;var Us=vt(),nr=new Us,Ms=he(),Ue=_e(),R=te(),Xs=M(),{safeRe:v,t:b,comparatorTrimReplace:ks,tildeTrimReplace:Vs,caretTrimReplace:Ws}=de(),{FLAG_INCLUDE_PRERELEASE:Ys,FLAG_LOOSE:Hs}=me(),or=r=>r.value==="<0.0.0-0",zs=r=>r.value==="",ir=(r,e)=>{let t=!0,s=r.slice(),n=s.pop();for(;t&&s.length;)t=s.every(o=>n.intersects(o,e)),n=s.pop();return t},Ks=(r,e)=>(R("comp",r,e),r=Qs(r,e),R("caret",r),r=Zs(r,e),R("tildes",r),r=tn(r,e),R("xrange",r),r=sn(r,e),R("stars",r),r),T=r=>!r||r.toLowerCase()==="x"||r==="*",Zs=(r,e)=>r.trim().split(/\s+/).map(t=>Js(t,e)).join(" "),Js=(r,e)=>{let t=e.loose?v[b.TILDELOOSE]:v[b.TILDE];return r.replace(t,(s,n,o,i,l)=>{R("tilde",r,s,n,o,i,l);let u;return T(n)?u="":T(o)?u=`>=${n}.0.0 <${+n+1}.0.0-0`:T(i)?u=`>=${n}.${o}.0 <${n}.${+o+1}.0-0`:l?(R("replaceTilde pr",l),u=`>=${n}.${o}.${i}-${l} <${n}.${+o+1}.0-0`):u=`>=${n}.${o}.${i} <${n}.${+o+1}.0-0`,R("tilde return",u),u})},Qs=(r,e)=>r.trim().split(/\s+/).map(t=>en(t,e)).join(" "),en=(r,e)=>{R("caret",r,e);let t=e.loose?v[b.CARETLOOSE]:v[b.CARET],s=e.includePrerelease?"-0":"";return r.replace(t,(n,o,i,l,u)=>{R("caret",r,n,o,i,l,u);let m;return T(o)?m="":T(i)?m=`>=${o}.0.0${s} <${+o+1}.0.0-0`:T(l)?o==="0"?m=`>=${o}.${i}.0${s} <${o}.${+i+1}.0-0`:m=`>=${o}.${i}.0${s} <${+o+1}.0.0-0`:u?(R("replaceCaret pr",u),o==="0"?i==="0"?m=`>=${o}.${i}.${l}-${u} <${o}.${i}.${+l+1}-0`:m=`>=${o}.${i}.${l}-${u} <${o}.${+i+1}.0-0`:m=`>=${o}.${i}.${l}-${u} <${+o+1}.0.0-0`):(R("no pr"),o==="0"?i==="0"?m=`>=${o}.${i}.${l}${s} <${o}.${i}.${+l+1}-0`:m=`>=${o}.${i}.${l}${s} <${o}.${+i+1}.0-0`:m=`>=${o}.${i}.${l} <${+o+1}.0.0-0`),R("caret return",m),m})},tn=(r,e)=>(R("replaceXRanges",r,e),r.split(/\s+/).map(t=>rn(t,e)).join(" ")),rn=(r,e)=>{r=r.trim();let t=e.loose?v[b.XRANGELOOSE]:v[b.XRANGE];return r.replace(t,(s,n,o,i,l,u)=>{R("xRange",r,s,n,o,i,l,u);let m=T(o),N=m||T(i),p=N||T(l),f=p;return n==="="&&f&&(n=""),u=e.includePrerelease?"-0":"",m?n===">"||n==="<"?s="<0.0.0-0":s="*":n&&f?(N&&(i=0),l=0,n===">"?(n=">=",N?(o=+o+1,i=0,l=0):(i=+i+1,l=0)):n==="<="&&(n="<",N?o=+o+1:i=+i+1),n==="<"&&(u="-0"),s=`${n+o}.${i}.${l}${u}`):N?s=`>=${o}.0.0${u} <${+o+1}.0.0-0`:p&&(s=`>=${o}.${i}.0${u} <${o}.${+i+1}.0-0`),R("xRange return",s),s})},sn=(r,e)=>(R("replaceStars",r,e),r.trim().replace(v[b.STAR],"")),nn=(r,e)=>(R("replaceGTE0",r,e),r.trim().replace(v[e.includePrerelease?b.GTE0PRE:b.GTE0],"")),on=r=>(e,t,s,n,o,i,l,u,m,N,p,f)=>(T(s)?t="":T(n)?t=`>=${s}.0.0${r?"-0":""}`:T(o)?t=`>=${s}.${n}.0${r?"-0":""}`:i?t=`>=${t}`:t=`>=${t}${r?"-0":""}`,T(m)?u="":T(N)?u=`<${+m+1}.0.0-0`:T(p)?u=`<${m}.${+N+1}.0-0`:f?u=`<=${m}.${N}.${p}-${f}`:r?u=`<${m}.${N}.${+p+1}-0`:u=`<=${u}`,`${t} ${u}`.trim()),an=(r,e,t)=>{for(let s=0;s<r.length;s++)if(!r[s].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let s=0;s<r.length;s++)if(R(r[s].semver),r[s].semver!==Ue.ANY&&r[s].semver.prerelease.length>0){let n=r[s].semver;if(n.major===e.major&&n.minor===e.minor&&n.patch===e.patch)return!0}return!1}return!0}});var ur=x((mo,lr)=>{"use strict";var Me=M(),cn=H(),cr=re(),ln=(r,e)=>{r=new cn(r,e);let t=new Me("0.0.0");if(r.test(t)||(t=new Me("0.0.0-0"),r.test(t)))return t;t=null;for(let s=0;s<r.set.length;++s){let n=r.set[s],o=null;n.forEach(i=>{let l=new Me(i.semver.version);switch(i.operator){case">":l.prerelease.length===0?l.patch++:l.prerelease.push(0),l.raw=l.format();case"":case">=":(!o||cr(l,o))&&(o=l);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${i.operator}`)}}),o&&(!t||cr(t,o))&&(t=o)}return t&&r.test(t)?t:null};lr.exports=ln});var Xe=x((Eo,fr)=>{"use strict";var un=H(),fn=(r,e,t)=>{try{e=new un(e,t)}catch{return!1}return e.test(r)};fr.exports=fn});var ke=x(($o,dr)=>{"use strict";var pn=M(),mr=_e(),{ANY:hn}=mr,mn=H(),dn=Xe(),pr=re(),hr=De(),En=Fe(),$n=Pe(),Rn=(r,e,t,s)=>{r=new pn(r,s),e=new mn(e,s);let n,o,i,l,u;switch(t){case">":n=pr,o=En,i=hr,l=">",u=">=";break;case"<":n=hr,o=$n,i=pr,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(dn(r,e,s))return!1;for(let m=0;m<e.set.length;++m){let N=e.set[m],p=null,f=null;if(N.forEach(E=>{E.semver===hn&&(E=new mr(">=0.0.0")),p=p||E,f=f||E,n(E.semver,p.semver,s)?p=E:i(E.semver,f.semver,s)&&(f=E)}),p.operator===l||p.operator===u||(!f.operator||f.operator===l)&&o(r,f.semver))return!1;if(f.operator===u&&i(r,f.semver))return!1}return!0};dr.exports=Rn});var $r=x((Ro,Er)=>{"use strict";var On=ke(),xn=(r,e,t)=>On(r,e,"<",t);Er.exports=xn});var Or=x((Oo,Rr)=>{"use strict";var gn=ke(),Nn=(r,e,t)=>gn(r,e,">",t);Rr.exports=Nn});var ge=S(et(),1);var tt="0.0.0-beta-20250820015207";function st(r){return{...r,parse(e,t){let s=(0,ge.default)(t);for(let n of this.children)if(s._[0]===n.name)return void n.parse(e.concat(this),t.slice(1));return s.help?void console.log(rt(e,this)):s.v||s.version?void console.log(tt):void console.log(rt(e,this))}}}function rt(r,e){return`Usage: ${[...r,e].map(t=>t.name).join(" ")} [command] [options]
2
+ "use strict";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __commonJS = (cb, mod) => function __require() {
10
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
3
28
 
4
- ${e.description}
29
+ // node_modules/.pnpm/minimist@1.2.8/node_modules/minimist/index.js
30
+ var require_minimist = __commonJS({
31
+ "node_modules/.pnpm/minimist@1.2.8/node_modules/minimist/index.js"(exports2, module2) {
32
+ "use strict";
33
+ function hasKey(obj, keys) {
34
+ var o = obj;
35
+ keys.slice(0, -1).forEach(function(key2) {
36
+ o = o[key2] || {};
37
+ });
38
+ var key = keys[keys.length - 1];
39
+ return key in o;
40
+ }
41
+ function isNumber(x) {
42
+ if (typeof x === "number") {
43
+ return true;
44
+ }
45
+ if (/^0x[0-9a-f]+$/i.test(x)) {
46
+ return true;
47
+ }
48
+ return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
49
+ }
50
+ function isConstructorOrProto(obj, key) {
51
+ return key === "constructor" && typeof obj[key] === "function" || key === "__proto__";
52
+ }
53
+ module2.exports = function(args, opts) {
54
+ if (!opts) {
55
+ opts = {};
56
+ }
57
+ var flags = {
58
+ bools: {},
59
+ strings: {},
60
+ unknownFn: null
61
+ };
62
+ if (typeof opts.unknown === "function") {
63
+ flags.unknownFn = opts.unknown;
64
+ }
65
+ if (typeof opts.boolean === "boolean" && opts.boolean) {
66
+ flags.allBools = true;
67
+ } else {
68
+ [].concat(opts.boolean).filter(Boolean).forEach(function(key2) {
69
+ flags.bools[key2] = true;
70
+ });
71
+ }
72
+ var aliases = {};
73
+ function aliasIsBoolean(key2) {
74
+ return aliases[key2].some(function(x) {
75
+ return flags.bools[x];
76
+ });
77
+ }
78
+ Object.keys(opts.alias || {}).forEach(function(key2) {
79
+ aliases[key2] = [].concat(opts.alias[key2]);
80
+ aliases[key2].forEach(function(x) {
81
+ aliases[x] = [key2].concat(aliases[key2].filter(function(y) {
82
+ return x !== y;
83
+ }));
84
+ });
85
+ });
86
+ [].concat(opts.string).filter(Boolean).forEach(function(key2) {
87
+ flags.strings[key2] = true;
88
+ if (aliases[key2]) {
89
+ [].concat(aliases[key2]).forEach(function(k) {
90
+ flags.strings[k] = true;
91
+ });
92
+ }
93
+ });
94
+ var defaults = opts.default || {};
95
+ var argv = { _: [] };
96
+ function argDefined(key2, arg2) {
97
+ return flags.allBools && /^--[^=]+$/.test(arg2) || flags.strings[key2] || flags.bools[key2] || aliases[key2];
98
+ }
99
+ function setKey(obj, keys, value2) {
100
+ var o = obj;
101
+ for (var i2 = 0; i2 < keys.length - 1; i2++) {
102
+ var key2 = keys[i2];
103
+ if (isConstructorOrProto(o, key2)) {
104
+ return;
105
+ }
106
+ if (o[key2] === void 0) {
107
+ o[key2] = {};
108
+ }
109
+ if (o[key2] === Object.prototype || o[key2] === Number.prototype || o[key2] === String.prototype) {
110
+ o[key2] = {};
111
+ }
112
+ if (o[key2] === Array.prototype) {
113
+ o[key2] = [];
114
+ }
115
+ o = o[key2];
116
+ }
117
+ var lastKey = keys[keys.length - 1];
118
+ if (isConstructorOrProto(o, lastKey)) {
119
+ return;
120
+ }
121
+ if (o === Object.prototype || o === Number.prototype || o === String.prototype) {
122
+ o = {};
123
+ }
124
+ if (o === Array.prototype) {
125
+ o = [];
126
+ }
127
+ if (o[lastKey] === void 0 || flags.bools[lastKey] || typeof o[lastKey] === "boolean") {
128
+ o[lastKey] = value2;
129
+ } else if (Array.isArray(o[lastKey])) {
130
+ o[lastKey].push(value2);
131
+ } else {
132
+ o[lastKey] = [o[lastKey], value2];
133
+ }
134
+ }
135
+ function setArg(key2, val, arg2) {
136
+ if (arg2 && flags.unknownFn && !argDefined(key2, arg2)) {
137
+ if (flags.unknownFn(arg2) === false) {
138
+ return;
139
+ }
140
+ }
141
+ var value2 = !flags.strings[key2] && isNumber(val) ? Number(val) : val;
142
+ setKey(argv, key2.split("."), value2);
143
+ (aliases[key2] || []).forEach(function(x) {
144
+ setKey(argv, x.split("."), value2);
145
+ });
146
+ }
147
+ Object.keys(flags.bools).forEach(function(key2) {
148
+ setArg(key2, defaults[key2] === void 0 ? false : defaults[key2]);
149
+ });
150
+ var notFlags = [];
151
+ if (args.indexOf("--") !== -1) {
152
+ notFlags = args.slice(args.indexOf("--") + 1);
153
+ args = args.slice(0, args.indexOf("--"));
154
+ }
155
+ for (var i = 0; i < args.length; i++) {
156
+ var arg = args[i];
157
+ var key;
158
+ var next;
159
+ if (/^--.+=/.test(arg)) {
160
+ var m = arg.match(/^--([^=]+)=([\s\S]*)$/);
161
+ key = m[1];
162
+ var value = m[2];
163
+ if (flags.bools[key]) {
164
+ value = value !== "false";
165
+ }
166
+ setArg(key, value, arg);
167
+ } else if (/^--no-.+/.test(arg)) {
168
+ key = arg.match(/^--no-(.+)/)[1];
169
+ setArg(key, false, arg);
170
+ } else if (/^--.+/.test(arg)) {
171
+ key = arg.match(/^--(.+)/)[1];
172
+ next = args[i + 1];
173
+ if (next !== void 0 && !/^(-|--)[^-]/.test(next) && !flags.bools[key] && !flags.allBools && (aliases[key] ? !aliasIsBoolean(key) : true)) {
174
+ setArg(key, next, arg);
175
+ i += 1;
176
+ } else if (/^(true|false)$/.test(next)) {
177
+ setArg(key, next === "true", arg);
178
+ i += 1;
179
+ } else {
180
+ setArg(key, flags.strings[key] ? "" : true, arg);
181
+ }
182
+ } else if (/^-[^-]+/.test(arg)) {
183
+ var letters = arg.slice(1, -1).split("");
184
+ var broken = false;
185
+ for (var j = 0; j < letters.length; j++) {
186
+ next = arg.slice(j + 2);
187
+ if (next === "-") {
188
+ setArg(letters[j], next, arg);
189
+ continue;
190
+ }
191
+ if (/[A-Za-z]/.test(letters[j]) && next[0] === "=") {
192
+ setArg(letters[j], next.slice(1), arg);
193
+ broken = true;
194
+ break;
195
+ }
196
+ if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
197
+ setArg(letters[j], next, arg);
198
+ broken = true;
199
+ break;
200
+ }
201
+ if (letters[j + 1] && letters[j + 1].match(/\W/)) {
202
+ setArg(letters[j], arg.slice(j + 2), arg);
203
+ broken = true;
204
+ break;
205
+ } else {
206
+ setArg(letters[j], flags.strings[letters[j]] ? "" : true, arg);
207
+ }
208
+ }
209
+ key = arg.slice(-1)[0];
210
+ if (!broken && key !== "-") {
211
+ if (args[i + 1] && !/^(-|--)[^-]/.test(args[i + 1]) && !flags.bools[key] && (aliases[key] ? !aliasIsBoolean(key) : true)) {
212
+ setArg(key, args[i + 1], arg);
213
+ i += 1;
214
+ } else if (args[i + 1] && /^(true|false)$/.test(args[i + 1])) {
215
+ setArg(key, args[i + 1] === "true", arg);
216
+ i += 1;
217
+ } else {
218
+ setArg(key, flags.strings[key] ? "" : true, arg);
219
+ }
220
+ }
221
+ } else {
222
+ if (!flags.unknownFn || flags.unknownFn(arg) !== false) {
223
+ argv._.push(flags.strings._ || !isNumber(arg) ? arg : Number(arg));
224
+ }
225
+ if (opts.stopEarly) {
226
+ argv._.push.apply(argv._, args.slice(i + 1));
227
+ break;
228
+ }
229
+ }
230
+ }
231
+ Object.keys(defaults).forEach(function(k) {
232
+ if (!hasKey(argv, k.split("."))) {
233
+ setKey(argv, k.split("."), defaults[k]);
234
+ (aliases[k] || []).forEach(function(x) {
235
+ setKey(argv, x.split("."), defaults[k]);
236
+ });
237
+ }
238
+ });
239
+ if (opts["--"]) {
240
+ argv["--"] = notFlags.slice();
241
+ } else {
242
+ notFlags.forEach(function(k) {
243
+ argv._.push(k);
244
+ });
245
+ }
246
+ return argv;
247
+ };
248
+ }
249
+ });
250
+
251
+ // node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/lrucache.js
252
+ var require_lrucache = __commonJS({
253
+ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/lrucache.js"(exports2, module2) {
254
+ "use strict";
255
+ var LRUCache = class {
256
+ constructor() {
257
+ this.max = 1e3;
258
+ this.map = /* @__PURE__ */ new Map();
259
+ }
260
+ get(key) {
261
+ const value = this.map.get(key);
262
+ if (value === void 0) {
263
+ return void 0;
264
+ } else {
265
+ this.map.delete(key);
266
+ this.map.set(key, value);
267
+ return value;
268
+ }
269
+ }
270
+ delete(key) {
271
+ return this.map.delete(key);
272
+ }
273
+ set(key, value) {
274
+ const deleted = this.delete(key);
275
+ if (!deleted && value !== void 0) {
276
+ if (this.map.size >= this.max) {
277
+ const firstKey = this.map.keys().next().value;
278
+ this.delete(firstKey);
279
+ }
280
+ this.map.set(key, value);
281
+ }
282
+ return this;
283
+ }
284
+ };
285
+ module2.exports = LRUCache;
286
+ }
287
+ });
288
+
289
+ // node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/parse-options.js
290
+ var require_parse_options = __commonJS({
291
+ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/parse-options.js"(exports2, module2) {
292
+ "use strict";
293
+ var looseOption = Object.freeze({ loose: true });
294
+ var emptyOpts = Object.freeze({});
295
+ var parseOptions = (options) => {
296
+ if (!options) {
297
+ return emptyOpts;
298
+ }
299
+ if (typeof options !== "object") {
300
+ return looseOption;
301
+ }
302
+ return options;
303
+ };
304
+ module2.exports = parseOptions;
305
+ }
306
+ });
307
+
308
+ // node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/constants.js
309
+ var require_constants = __commonJS({
310
+ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/constants.js"(exports2, module2) {
311
+ "use strict";
312
+ var SEMVER_SPEC_VERSION = "2.0.0";
313
+ var MAX_LENGTH = 256;
314
+ var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
315
+ 9007199254740991;
316
+ var MAX_SAFE_COMPONENT_LENGTH = 16;
317
+ var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
318
+ var RELEASE_TYPES = [
319
+ "major",
320
+ "premajor",
321
+ "minor",
322
+ "preminor",
323
+ "patch",
324
+ "prepatch",
325
+ "prerelease"
326
+ ];
327
+ module2.exports = {
328
+ MAX_LENGTH,
329
+ MAX_SAFE_COMPONENT_LENGTH,
330
+ MAX_SAFE_BUILD_LENGTH,
331
+ MAX_SAFE_INTEGER,
332
+ RELEASE_TYPES,
333
+ SEMVER_SPEC_VERSION,
334
+ FLAG_INCLUDE_PRERELEASE: 1,
335
+ FLAG_LOOSE: 2
336
+ };
337
+ }
338
+ });
339
+
340
+ // node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/debug.js
341
+ var require_debug = __commonJS({
342
+ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/debug.js"(exports2, module2) {
343
+ "use strict";
344
+ var debug2 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
345
+ };
346
+ module2.exports = debug2;
347
+ }
348
+ });
349
+
350
+ // node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/re.js
351
+ var require_re = __commonJS({
352
+ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/re.js"(exports2, module2) {
353
+ "use strict";
354
+ var {
355
+ MAX_SAFE_COMPONENT_LENGTH,
356
+ MAX_SAFE_BUILD_LENGTH,
357
+ MAX_LENGTH
358
+ } = require_constants();
359
+ var debug2 = require_debug();
360
+ exports2 = module2.exports = {};
361
+ var re = exports2.re = [];
362
+ var safeRe = exports2.safeRe = [];
363
+ var src = exports2.src = [];
364
+ var safeSrc = exports2.safeSrc = [];
365
+ var t = exports2.t = {};
366
+ var R = 0;
367
+ var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
368
+ var safeRegexReplacements = [
369
+ ["\\s", 1],
370
+ ["\\d", MAX_LENGTH],
371
+ [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
372
+ ];
373
+ var makeSafeRegex = (value) => {
374
+ for (const [token, max] of safeRegexReplacements) {
375
+ value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
376
+ }
377
+ return value;
378
+ };
379
+ var createToken = (name, value, isGlobal) => {
380
+ const safe = makeSafeRegex(value);
381
+ const index = R++;
382
+ debug2(name, index, value);
383
+ t[name] = index;
384
+ src[index] = value;
385
+ safeSrc[index] = safe;
386
+ re[index] = new RegExp(value, isGlobal ? "g" : void 0);
387
+ safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
388
+ };
389
+ createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
390
+ createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
391
+ createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
392
+ createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
393
+ createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
394
+ createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
395
+ createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
396
+ createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
397
+ createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
398
+ createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
399
+ createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
400
+ createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
401
+ createToken("FULL", `^${src[t.FULLPLAIN]}$`);
402
+ createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
403
+ createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
404
+ createToken("GTLT", "((?:<|>)?=?)");
405
+ createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
406
+ createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
407
+ createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
408
+ createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
409
+ createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
410
+ createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
411
+ createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
412
+ createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
413
+ createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
414
+ createToken("COERCERTL", src[t.COERCE], true);
415
+ createToken("COERCERTLFULL", src[t.COERCEFULL], true);
416
+ createToken("LONETILDE", "(?:~>?)");
417
+ createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
418
+ exports2.tildeTrimReplace = "$1~";
419
+ createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
420
+ createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
421
+ createToken("LONECARET", "(?:\\^)");
422
+ createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
423
+ exports2.caretTrimReplace = "$1^";
424
+ createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
425
+ createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
426
+ createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
427
+ createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
428
+ createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
429
+ exports2.comparatorTrimReplace = "$1$2$3";
430
+ createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
431
+ createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
432
+ createToken("STAR", "(<|>)?=?\\s*\\*");
433
+ createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
434
+ createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
435
+ }
436
+ });
437
+
438
+ // node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/identifiers.js
439
+ var require_identifiers = __commonJS({
440
+ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/identifiers.js"(exports2, module2) {
441
+ "use strict";
442
+ var numeric = /^[0-9]+$/;
443
+ var compareIdentifiers = (a, b) => {
444
+ const anum = numeric.test(a);
445
+ const bnum = numeric.test(b);
446
+ if (anum && bnum) {
447
+ a = +a;
448
+ b = +b;
449
+ }
450
+ return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
451
+ };
452
+ var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
453
+ module2.exports = {
454
+ compareIdentifiers,
455
+ rcompareIdentifiers
456
+ };
457
+ }
458
+ });
459
+
460
+ // node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/semver.js
461
+ var require_semver = __commonJS({
462
+ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/semver.js"(exports2, module2) {
463
+ "use strict";
464
+ var debug2 = require_debug();
465
+ var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
466
+ var { safeRe: re, t } = require_re();
467
+ var parseOptions = require_parse_options();
468
+ var { compareIdentifiers } = require_identifiers();
469
+ var SemVer2 = class _SemVer {
470
+ constructor(version2, options) {
471
+ options = parseOptions(options);
472
+ if (version2 instanceof _SemVer) {
473
+ if (version2.loose === !!options.loose && version2.includePrerelease === !!options.includePrerelease) {
474
+ return version2;
475
+ } else {
476
+ version2 = version2.version;
477
+ }
478
+ } else if (typeof version2 !== "string") {
479
+ throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version2}".`);
480
+ }
481
+ if (version2.length > MAX_LENGTH) {
482
+ throw new TypeError(
483
+ `version is longer than ${MAX_LENGTH} characters`
484
+ );
485
+ }
486
+ debug2("SemVer", version2, options);
487
+ this.options = options;
488
+ this.loose = !!options.loose;
489
+ this.includePrerelease = !!options.includePrerelease;
490
+ const m = version2.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
491
+ if (!m) {
492
+ throw new TypeError(`Invalid Version: ${version2}`);
493
+ }
494
+ this.raw = version2;
495
+ this.major = +m[1];
496
+ this.minor = +m[2];
497
+ this.patch = +m[3];
498
+ if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
499
+ throw new TypeError("Invalid major version");
500
+ }
501
+ if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
502
+ throw new TypeError("Invalid minor version");
503
+ }
504
+ if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
505
+ throw new TypeError("Invalid patch version");
506
+ }
507
+ if (!m[4]) {
508
+ this.prerelease = [];
509
+ } else {
510
+ this.prerelease = m[4].split(".").map((id) => {
511
+ if (/^[0-9]+$/.test(id)) {
512
+ const num = +id;
513
+ if (num >= 0 && num < MAX_SAFE_INTEGER) {
514
+ return num;
515
+ }
516
+ }
517
+ return id;
518
+ });
519
+ }
520
+ this.build = m[5] ? m[5].split(".") : [];
521
+ this.format();
522
+ }
523
+ format() {
524
+ this.version = `${this.major}.${this.minor}.${this.patch}`;
525
+ if (this.prerelease.length) {
526
+ this.version += `-${this.prerelease.join(".")}`;
527
+ }
528
+ return this.version;
529
+ }
530
+ toString() {
531
+ return this.version;
532
+ }
533
+ compare(other) {
534
+ debug2("SemVer.compare", this.version, this.options, other);
535
+ if (!(other instanceof _SemVer)) {
536
+ if (typeof other === "string" && other === this.version) {
537
+ return 0;
538
+ }
539
+ other = new _SemVer(other, this.options);
540
+ }
541
+ if (other.version === this.version) {
542
+ return 0;
543
+ }
544
+ return this.compareMain(other) || this.comparePre(other);
545
+ }
546
+ compareMain(other) {
547
+ if (!(other instanceof _SemVer)) {
548
+ other = new _SemVer(other, this.options);
549
+ }
550
+ return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
551
+ }
552
+ comparePre(other) {
553
+ if (!(other instanceof _SemVer)) {
554
+ other = new _SemVer(other, this.options);
555
+ }
556
+ if (this.prerelease.length && !other.prerelease.length) {
557
+ return -1;
558
+ } else if (!this.prerelease.length && other.prerelease.length) {
559
+ return 1;
560
+ } else if (!this.prerelease.length && !other.prerelease.length) {
561
+ return 0;
562
+ }
563
+ let i = 0;
564
+ do {
565
+ const a = this.prerelease[i];
566
+ const b = other.prerelease[i];
567
+ debug2("prerelease compare", i, a, b);
568
+ if (a === void 0 && b === void 0) {
569
+ return 0;
570
+ } else if (b === void 0) {
571
+ return 1;
572
+ } else if (a === void 0) {
573
+ return -1;
574
+ } else if (a === b) {
575
+ continue;
576
+ } else {
577
+ return compareIdentifiers(a, b);
578
+ }
579
+ } while (++i);
580
+ }
581
+ compareBuild(other) {
582
+ if (!(other instanceof _SemVer)) {
583
+ other = new _SemVer(other, this.options);
584
+ }
585
+ let i = 0;
586
+ do {
587
+ const a = this.build[i];
588
+ const b = other.build[i];
589
+ debug2("build compare", i, a, b);
590
+ if (a === void 0 && b === void 0) {
591
+ return 0;
592
+ } else if (b === void 0) {
593
+ return 1;
594
+ } else if (a === void 0) {
595
+ return -1;
596
+ } else if (a === b) {
597
+ continue;
598
+ } else {
599
+ return compareIdentifiers(a, b);
600
+ }
601
+ } while (++i);
602
+ }
603
+ // preminor will bump the version up to the next minor release, and immediately
604
+ // down to pre-release. premajor and prepatch work the same way.
605
+ inc(release, identifier, identifierBase) {
606
+ if (release.startsWith("pre")) {
607
+ if (!identifier && identifierBase === false) {
608
+ throw new Error("invalid increment argument: identifier is empty");
609
+ }
610
+ if (identifier) {
611
+ const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
612
+ if (!match || match[1] !== identifier) {
613
+ throw new Error(`invalid identifier: ${identifier}`);
614
+ }
615
+ }
616
+ }
617
+ switch (release) {
618
+ case "premajor":
619
+ this.prerelease.length = 0;
620
+ this.patch = 0;
621
+ this.minor = 0;
622
+ this.major++;
623
+ this.inc("pre", identifier, identifierBase);
624
+ break;
625
+ case "preminor":
626
+ this.prerelease.length = 0;
627
+ this.patch = 0;
628
+ this.minor++;
629
+ this.inc("pre", identifier, identifierBase);
630
+ break;
631
+ case "prepatch":
632
+ this.prerelease.length = 0;
633
+ this.inc("patch", identifier, identifierBase);
634
+ this.inc("pre", identifier, identifierBase);
635
+ break;
636
+ // If the input is a non-prerelease version, this acts the same as
637
+ // prepatch.
638
+ case "prerelease":
639
+ if (this.prerelease.length === 0) {
640
+ this.inc("patch", identifier, identifierBase);
641
+ }
642
+ this.inc("pre", identifier, identifierBase);
643
+ break;
644
+ case "release":
645
+ if (this.prerelease.length === 0) {
646
+ throw new Error(`version ${this.raw} is not a prerelease`);
647
+ }
648
+ this.prerelease.length = 0;
649
+ break;
650
+ case "major":
651
+ if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
652
+ this.major++;
653
+ }
654
+ this.minor = 0;
655
+ this.patch = 0;
656
+ this.prerelease = [];
657
+ break;
658
+ case "minor":
659
+ if (this.patch !== 0 || this.prerelease.length === 0) {
660
+ this.minor++;
661
+ }
662
+ this.patch = 0;
663
+ this.prerelease = [];
664
+ break;
665
+ case "patch":
666
+ if (this.prerelease.length === 0) {
667
+ this.patch++;
668
+ }
669
+ this.prerelease = [];
670
+ break;
671
+ // This probably shouldn't be used publicly.
672
+ // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
673
+ case "pre": {
674
+ const base = Number(identifierBase) ? 1 : 0;
675
+ if (this.prerelease.length === 0) {
676
+ this.prerelease = [base];
677
+ } else {
678
+ let i = this.prerelease.length;
679
+ while (--i >= 0) {
680
+ if (typeof this.prerelease[i] === "number") {
681
+ this.prerelease[i]++;
682
+ i = -2;
683
+ }
684
+ }
685
+ if (i === -1) {
686
+ if (identifier === this.prerelease.join(".") && identifierBase === false) {
687
+ throw new Error("invalid increment argument: identifier already exists");
688
+ }
689
+ this.prerelease.push(base);
690
+ }
691
+ }
692
+ if (identifier) {
693
+ let prerelease = [identifier, base];
694
+ if (identifierBase === false) {
695
+ prerelease = [identifier];
696
+ }
697
+ if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
698
+ if (isNaN(this.prerelease[1])) {
699
+ this.prerelease = prerelease;
700
+ }
701
+ } else {
702
+ this.prerelease = prerelease;
703
+ }
704
+ }
705
+ break;
706
+ }
707
+ default:
708
+ throw new Error(`invalid increment argument: ${release}`);
709
+ }
710
+ this.raw = this.format();
711
+ if (this.build.length) {
712
+ this.raw += `+${this.build.join(".")}`;
713
+ }
714
+ return this;
715
+ }
716
+ };
717
+ module2.exports = SemVer2;
718
+ }
719
+ });
720
+
721
+ // node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare.js
722
+ var require_compare = __commonJS({
723
+ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare.js"(exports2, module2) {
724
+ "use strict";
725
+ var SemVer2 = require_semver();
726
+ var compare = (a, b, loose) => new SemVer2(a, loose).compare(new SemVer2(b, loose));
727
+ module2.exports = compare;
728
+ }
729
+ });
730
+
731
+ // node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/eq.js
732
+ var require_eq = __commonJS({
733
+ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/eq.js"(exports2, module2) {
734
+ "use strict";
735
+ var compare = require_compare();
736
+ var eq = (a, b, loose) => compare(a, b, loose) === 0;
737
+ module2.exports = eq;
738
+ }
739
+ });
740
+
741
+ // node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/neq.js
742
+ var require_neq = __commonJS({
743
+ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/neq.js"(exports2, module2) {
744
+ "use strict";
745
+ var compare = require_compare();
746
+ var neq = (a, b, loose) => compare(a, b, loose) !== 0;
747
+ module2.exports = neq;
748
+ }
749
+ });
750
+
751
+ // node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gt.js
752
+ var require_gt = __commonJS({
753
+ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gt.js"(exports2, module2) {
754
+ "use strict";
755
+ var compare = require_compare();
756
+ var gt2 = (a, b, loose) => compare(a, b, loose) > 0;
757
+ module2.exports = gt2;
758
+ }
759
+ });
760
+
761
+ // node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gte.js
762
+ var require_gte = __commonJS({
763
+ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gte.js"(exports2, module2) {
764
+ "use strict";
765
+ var compare = require_compare();
766
+ var gte = (a, b, loose) => compare(a, b, loose) >= 0;
767
+ module2.exports = gte;
768
+ }
769
+ });
770
+
771
+ // node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lt.js
772
+ var require_lt = __commonJS({
773
+ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lt.js"(exports2, module2) {
774
+ "use strict";
775
+ var compare = require_compare();
776
+ var lt = (a, b, loose) => compare(a, b, loose) < 0;
777
+ module2.exports = lt;
778
+ }
779
+ });
780
+
781
+ // node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lte.js
782
+ var require_lte = __commonJS({
783
+ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lte.js"(exports2, module2) {
784
+ "use strict";
785
+ var compare = require_compare();
786
+ var lte = (a, b, loose) => compare(a, b, loose) <= 0;
787
+ module2.exports = lte;
788
+ }
789
+ });
790
+
791
+ // node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/cmp.js
792
+ var require_cmp = __commonJS({
793
+ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/cmp.js"(exports2, module2) {
794
+ "use strict";
795
+ var eq = require_eq();
796
+ var neq = require_neq();
797
+ var gt2 = require_gt();
798
+ var gte = require_gte();
799
+ var lt = require_lt();
800
+ var lte = require_lte();
801
+ var cmp = (a, op, b, loose) => {
802
+ switch (op) {
803
+ case "===":
804
+ if (typeof a === "object") {
805
+ a = a.version;
806
+ }
807
+ if (typeof b === "object") {
808
+ b = b.version;
809
+ }
810
+ return a === b;
811
+ case "!==":
812
+ if (typeof a === "object") {
813
+ a = a.version;
814
+ }
815
+ if (typeof b === "object") {
816
+ b = b.version;
817
+ }
818
+ return a !== b;
819
+ case "":
820
+ case "=":
821
+ case "==":
822
+ return eq(a, b, loose);
823
+ case "!=":
824
+ return neq(a, b, loose);
825
+ case ">":
826
+ return gt2(a, b, loose);
827
+ case ">=":
828
+ return gte(a, b, loose);
829
+ case "<":
830
+ return lt(a, b, loose);
831
+ case "<=":
832
+ return lte(a, b, loose);
833
+ default:
834
+ throw new TypeError(`Invalid operator: ${op}`);
835
+ }
836
+ };
837
+ module2.exports = cmp;
838
+ }
839
+ });
840
+
841
+ // node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/comparator.js
842
+ var require_comparator = __commonJS({
843
+ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/comparator.js"(exports2, module2) {
844
+ "use strict";
845
+ var ANY = Symbol("SemVer ANY");
846
+ var Comparator = class _Comparator {
847
+ static get ANY() {
848
+ return ANY;
849
+ }
850
+ constructor(comp, options) {
851
+ options = parseOptions(options);
852
+ if (comp instanceof _Comparator) {
853
+ if (comp.loose === !!options.loose) {
854
+ return comp;
855
+ } else {
856
+ comp = comp.value;
857
+ }
858
+ }
859
+ comp = comp.trim().split(/\s+/).join(" ");
860
+ debug2("comparator", comp, options);
861
+ this.options = options;
862
+ this.loose = !!options.loose;
863
+ this.parse(comp);
864
+ if (this.semver === ANY) {
865
+ this.value = "";
866
+ } else {
867
+ this.value = this.operator + this.semver.version;
868
+ }
869
+ debug2("comp", this);
870
+ }
871
+ parse(comp) {
872
+ const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
873
+ const m = comp.match(r);
874
+ if (!m) {
875
+ throw new TypeError(`Invalid comparator: ${comp}`);
876
+ }
877
+ this.operator = m[1] !== void 0 ? m[1] : "";
878
+ if (this.operator === "=") {
879
+ this.operator = "";
880
+ }
881
+ if (!m[2]) {
882
+ this.semver = ANY;
883
+ } else {
884
+ this.semver = new SemVer2(m[2], this.options.loose);
885
+ }
886
+ }
887
+ toString() {
888
+ return this.value;
889
+ }
890
+ test(version2) {
891
+ debug2("Comparator.test", version2, this.options.loose);
892
+ if (this.semver === ANY || version2 === ANY) {
893
+ return true;
894
+ }
895
+ if (typeof version2 === "string") {
896
+ try {
897
+ version2 = new SemVer2(version2, this.options);
898
+ } catch (er) {
899
+ return false;
900
+ }
901
+ }
902
+ return cmp(version2, this.operator, this.semver, this.options);
903
+ }
904
+ intersects(comp, options) {
905
+ if (!(comp instanceof _Comparator)) {
906
+ throw new TypeError("a Comparator is required");
907
+ }
908
+ if (this.operator === "") {
909
+ if (this.value === "") {
910
+ return true;
911
+ }
912
+ return new Range2(comp.value, options).test(this.value);
913
+ } else if (comp.operator === "") {
914
+ if (comp.value === "") {
915
+ return true;
916
+ }
917
+ return new Range2(this.value, options).test(comp.semver);
918
+ }
919
+ options = parseOptions(options);
920
+ if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
921
+ return false;
922
+ }
923
+ if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
924
+ return false;
925
+ }
926
+ if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
927
+ return true;
928
+ }
929
+ if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
930
+ return true;
931
+ }
932
+ if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
933
+ return true;
934
+ }
935
+ if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
936
+ return true;
937
+ }
938
+ if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
939
+ return true;
940
+ }
941
+ return false;
942
+ }
943
+ };
944
+ module2.exports = Comparator;
945
+ var parseOptions = require_parse_options();
946
+ var { safeRe: re, t } = require_re();
947
+ var cmp = require_cmp();
948
+ var debug2 = require_debug();
949
+ var SemVer2 = require_semver();
950
+ var Range2 = require_range();
951
+ }
952
+ });
953
+
954
+ // node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/range.js
955
+ var require_range = __commonJS({
956
+ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/range.js"(exports2, module2) {
957
+ "use strict";
958
+ var SPACE_CHARACTERS = /\s+/g;
959
+ var Range2 = class _Range {
960
+ constructor(range, options) {
961
+ options = parseOptions(options);
962
+ if (range instanceof _Range) {
963
+ if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
964
+ return range;
965
+ } else {
966
+ return new _Range(range.raw, options);
967
+ }
968
+ }
969
+ if (range instanceof Comparator) {
970
+ this.raw = range.value;
971
+ this.set = [[range]];
972
+ this.formatted = void 0;
973
+ return this;
974
+ }
975
+ this.options = options;
976
+ this.loose = !!options.loose;
977
+ this.includePrerelease = !!options.includePrerelease;
978
+ this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
979
+ this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
980
+ if (!this.set.length) {
981
+ throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
982
+ }
983
+ if (this.set.length > 1) {
984
+ const first = this.set[0];
985
+ this.set = this.set.filter((c) => !isNullSet(c[0]));
986
+ if (this.set.length === 0) {
987
+ this.set = [first];
988
+ } else if (this.set.length > 1) {
989
+ for (const c of this.set) {
990
+ if (c.length === 1 && isAny(c[0])) {
991
+ this.set = [c];
992
+ break;
993
+ }
994
+ }
995
+ }
996
+ }
997
+ this.formatted = void 0;
998
+ }
999
+ get range() {
1000
+ if (this.formatted === void 0) {
1001
+ this.formatted = "";
1002
+ for (let i = 0; i < this.set.length; i++) {
1003
+ if (i > 0) {
1004
+ this.formatted += "||";
1005
+ }
1006
+ const comps = this.set[i];
1007
+ for (let k = 0; k < comps.length; k++) {
1008
+ if (k > 0) {
1009
+ this.formatted += " ";
1010
+ }
1011
+ this.formatted += comps[k].toString().trim();
1012
+ }
1013
+ }
1014
+ }
1015
+ return this.formatted;
1016
+ }
1017
+ format() {
1018
+ return this.range;
1019
+ }
1020
+ toString() {
1021
+ return this.range;
1022
+ }
1023
+ parseRange(range) {
1024
+ const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
1025
+ const memoKey = memoOpts + ":" + range;
1026
+ const cached = cache.get(memoKey);
1027
+ if (cached) {
1028
+ return cached;
1029
+ }
1030
+ const loose = this.options.loose;
1031
+ const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
1032
+ range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
1033
+ debug2("hyphen replace", range);
1034
+ range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
1035
+ debug2("comparator trim", range);
1036
+ range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
1037
+ debug2("tilde trim", range);
1038
+ range = range.replace(re[t.CARETTRIM], caretTrimReplace);
1039
+ debug2("caret trim", range);
1040
+ let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
1041
+ if (loose) {
1042
+ rangeList = rangeList.filter((comp) => {
1043
+ debug2("loose invalid filter", comp, this.options);
1044
+ return !!comp.match(re[t.COMPARATORLOOSE]);
1045
+ });
1046
+ }
1047
+ debug2("range list", rangeList);
1048
+ const rangeMap = /* @__PURE__ */ new Map();
1049
+ const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
1050
+ for (const comp of comparators) {
1051
+ if (isNullSet(comp)) {
1052
+ return [comp];
1053
+ }
1054
+ rangeMap.set(comp.value, comp);
1055
+ }
1056
+ if (rangeMap.size > 1 && rangeMap.has("")) {
1057
+ rangeMap.delete("");
1058
+ }
1059
+ const result = [...rangeMap.values()];
1060
+ cache.set(memoKey, result);
1061
+ return result;
1062
+ }
1063
+ intersects(range, options) {
1064
+ if (!(range instanceof _Range)) {
1065
+ throw new TypeError("a Range is required");
1066
+ }
1067
+ return this.set.some((thisComparators) => {
1068
+ return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
1069
+ return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
1070
+ return rangeComparators.every((rangeComparator) => {
1071
+ return thisComparator.intersects(rangeComparator, options);
1072
+ });
1073
+ });
1074
+ });
1075
+ });
1076
+ }
1077
+ // if ANY of the sets match ALL of its comparators, then pass
1078
+ test(version2) {
1079
+ if (!version2) {
1080
+ return false;
1081
+ }
1082
+ if (typeof version2 === "string") {
1083
+ try {
1084
+ version2 = new SemVer2(version2, this.options);
1085
+ } catch (er) {
1086
+ return false;
1087
+ }
1088
+ }
1089
+ for (let i = 0; i < this.set.length; i++) {
1090
+ if (testSet(this.set[i], version2, this.options)) {
1091
+ return true;
1092
+ }
1093
+ }
1094
+ return false;
1095
+ }
1096
+ };
1097
+ module2.exports = Range2;
1098
+ var LRU = require_lrucache();
1099
+ var cache = new LRU();
1100
+ var parseOptions = require_parse_options();
1101
+ var Comparator = require_comparator();
1102
+ var debug2 = require_debug();
1103
+ var SemVer2 = require_semver();
1104
+ var {
1105
+ safeRe: re,
1106
+ t,
1107
+ comparatorTrimReplace,
1108
+ tildeTrimReplace,
1109
+ caretTrimReplace
1110
+ } = require_re();
1111
+ var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
1112
+ var isNullSet = (c) => c.value === "<0.0.0-0";
1113
+ var isAny = (c) => c.value === "";
1114
+ var isSatisfiable = (comparators, options) => {
1115
+ let result = true;
1116
+ const remainingComparators = comparators.slice();
1117
+ let testComparator = remainingComparators.pop();
1118
+ while (result && remainingComparators.length) {
1119
+ result = remainingComparators.every((otherComparator) => {
1120
+ return testComparator.intersects(otherComparator, options);
1121
+ });
1122
+ testComparator = remainingComparators.pop();
1123
+ }
1124
+ return result;
1125
+ };
1126
+ var parseComparator = (comp, options) => {
1127
+ debug2("comp", comp, options);
1128
+ comp = replaceCarets(comp, options);
1129
+ debug2("caret", comp);
1130
+ comp = replaceTildes(comp, options);
1131
+ debug2("tildes", comp);
1132
+ comp = replaceXRanges(comp, options);
1133
+ debug2("xrange", comp);
1134
+ comp = replaceStars(comp, options);
1135
+ debug2("stars", comp);
1136
+ return comp;
1137
+ };
1138
+ var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
1139
+ var replaceTildes = (comp, options) => {
1140
+ return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
1141
+ };
1142
+ var replaceTilde = (comp, options) => {
1143
+ const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
1144
+ return comp.replace(r, (_, M, m, p, pr) => {
1145
+ debug2("tilde", comp, _, M, m, p, pr);
1146
+ let ret;
1147
+ if (isX(M)) {
1148
+ ret = "";
1149
+ } else if (isX(m)) {
1150
+ ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
1151
+ } else if (isX(p)) {
1152
+ ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
1153
+ } else if (pr) {
1154
+ debug2("replaceTilde pr", pr);
1155
+ ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
1156
+ } else {
1157
+ ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
1158
+ }
1159
+ debug2("tilde return", ret);
1160
+ return ret;
1161
+ });
1162
+ };
1163
+ var replaceCarets = (comp, options) => {
1164
+ return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
1165
+ };
1166
+ var replaceCaret = (comp, options) => {
1167
+ debug2("caret", comp, options);
1168
+ const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
1169
+ const z = options.includePrerelease ? "-0" : "";
1170
+ return comp.replace(r, (_, M, m, p, pr) => {
1171
+ debug2("caret", comp, _, M, m, p, pr);
1172
+ let ret;
1173
+ if (isX(M)) {
1174
+ ret = "";
1175
+ } else if (isX(m)) {
1176
+ ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
1177
+ } else if (isX(p)) {
1178
+ if (M === "0") {
1179
+ ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
1180
+ } else {
1181
+ ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
1182
+ }
1183
+ } else if (pr) {
1184
+ debug2("replaceCaret pr", pr);
1185
+ if (M === "0") {
1186
+ if (m === "0") {
1187
+ ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
1188
+ } else {
1189
+ ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
1190
+ }
1191
+ } else {
1192
+ ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
1193
+ }
1194
+ } else {
1195
+ debug2("no pr");
1196
+ if (M === "0") {
1197
+ if (m === "0") {
1198
+ ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
1199
+ } else {
1200
+ ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
1201
+ }
1202
+ } else {
1203
+ ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
1204
+ }
1205
+ }
1206
+ debug2("caret return", ret);
1207
+ return ret;
1208
+ });
1209
+ };
1210
+ var replaceXRanges = (comp, options) => {
1211
+ debug2("replaceXRanges", comp, options);
1212
+ return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
1213
+ };
1214
+ var replaceXRange = (comp, options) => {
1215
+ comp = comp.trim();
1216
+ const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
1217
+ return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
1218
+ debug2("xRange", comp, ret, gtlt, M, m, p, pr);
1219
+ const xM = isX(M);
1220
+ const xm = xM || isX(m);
1221
+ const xp = xm || isX(p);
1222
+ const anyX = xp;
1223
+ if (gtlt === "=" && anyX) {
1224
+ gtlt = "";
1225
+ }
1226
+ pr = options.includePrerelease ? "-0" : "";
1227
+ if (xM) {
1228
+ if (gtlt === ">" || gtlt === "<") {
1229
+ ret = "<0.0.0-0";
1230
+ } else {
1231
+ ret = "*";
1232
+ }
1233
+ } else if (gtlt && anyX) {
1234
+ if (xm) {
1235
+ m = 0;
1236
+ }
1237
+ p = 0;
1238
+ if (gtlt === ">") {
1239
+ gtlt = ">=";
1240
+ if (xm) {
1241
+ M = +M + 1;
1242
+ m = 0;
1243
+ p = 0;
1244
+ } else {
1245
+ m = +m + 1;
1246
+ p = 0;
1247
+ }
1248
+ } else if (gtlt === "<=") {
1249
+ gtlt = "<";
1250
+ if (xm) {
1251
+ M = +M + 1;
1252
+ } else {
1253
+ m = +m + 1;
1254
+ }
1255
+ }
1256
+ if (gtlt === "<") {
1257
+ pr = "-0";
1258
+ }
1259
+ ret = `${gtlt + M}.${m}.${p}${pr}`;
1260
+ } else if (xm) {
1261
+ ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
1262
+ } else if (xp) {
1263
+ ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
1264
+ }
1265
+ debug2("xRange return", ret);
1266
+ return ret;
1267
+ });
1268
+ };
1269
+ var replaceStars = (comp, options) => {
1270
+ debug2("replaceStars", comp, options);
1271
+ return comp.trim().replace(re[t.STAR], "");
1272
+ };
1273
+ var replaceGTE0 = (comp, options) => {
1274
+ debug2("replaceGTE0", comp, options);
1275
+ return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
1276
+ };
1277
+ var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
1278
+ if (isX(fM)) {
1279
+ from = "";
1280
+ } else if (isX(fm)) {
1281
+ from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
1282
+ } else if (isX(fp)) {
1283
+ from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
1284
+ } else if (fpr) {
1285
+ from = `>=${from}`;
1286
+ } else {
1287
+ from = `>=${from}${incPr ? "-0" : ""}`;
1288
+ }
1289
+ if (isX(tM)) {
1290
+ to = "";
1291
+ } else if (isX(tm)) {
1292
+ to = `<${+tM + 1}.0.0-0`;
1293
+ } else if (isX(tp)) {
1294
+ to = `<${tM}.${+tm + 1}.0-0`;
1295
+ } else if (tpr) {
1296
+ to = `<=${tM}.${tm}.${tp}-${tpr}`;
1297
+ } else if (incPr) {
1298
+ to = `<${tM}.${tm}.${+tp + 1}-0`;
1299
+ } else {
1300
+ to = `<=${to}`;
1301
+ }
1302
+ return `${from} ${to}`.trim();
1303
+ };
1304
+ var testSet = (set, version2, options) => {
1305
+ for (let i = 0; i < set.length; i++) {
1306
+ if (!set[i].test(version2)) {
1307
+ return false;
1308
+ }
1309
+ }
1310
+ if (version2.prerelease.length && !options.includePrerelease) {
1311
+ for (let i = 0; i < set.length; i++) {
1312
+ debug2(set[i].semver);
1313
+ if (set[i].semver === Comparator.ANY) {
1314
+ continue;
1315
+ }
1316
+ if (set[i].semver.prerelease.length > 0) {
1317
+ const allowed = set[i].semver;
1318
+ if (allowed.major === version2.major && allowed.minor === version2.minor && allowed.patch === version2.patch) {
1319
+ return true;
1320
+ }
1321
+ }
1322
+ }
1323
+ return false;
1324
+ }
1325
+ return true;
1326
+ };
1327
+ }
1328
+ });
1329
+
1330
+ // node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-version.js
1331
+ var require_min_version = __commonJS({
1332
+ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-version.js"(exports2, module2) {
1333
+ "use strict";
1334
+ var SemVer2 = require_semver();
1335
+ var Range2 = require_range();
1336
+ var gt2 = require_gt();
1337
+ var minVersion = (range, loose) => {
1338
+ range = new Range2(range, loose);
1339
+ let minver = new SemVer2("0.0.0");
1340
+ if (range.test(minver)) {
1341
+ return minver;
1342
+ }
1343
+ minver = new SemVer2("0.0.0-0");
1344
+ if (range.test(minver)) {
1345
+ return minver;
1346
+ }
1347
+ minver = null;
1348
+ for (let i = 0; i < range.set.length; ++i) {
1349
+ const comparators = range.set[i];
1350
+ let setMin = null;
1351
+ comparators.forEach((comparator) => {
1352
+ const compver = new SemVer2(comparator.semver.version);
1353
+ switch (comparator.operator) {
1354
+ case ">":
1355
+ if (compver.prerelease.length === 0) {
1356
+ compver.patch++;
1357
+ } else {
1358
+ compver.prerelease.push(0);
1359
+ }
1360
+ compver.raw = compver.format();
1361
+ /* fallthrough */
1362
+ case "":
1363
+ case ">=":
1364
+ if (!setMin || gt2(compver, setMin)) {
1365
+ setMin = compver;
1366
+ }
1367
+ break;
1368
+ case "<":
1369
+ case "<=":
1370
+ break;
1371
+ /* istanbul ignore next */
1372
+ default:
1373
+ throw new Error(`Unexpected operation: ${comparator.operator}`);
1374
+ }
1375
+ });
1376
+ if (setMin && (!minver || gt2(minver, setMin))) {
1377
+ minver = setMin;
1378
+ }
1379
+ }
1380
+ if (minver && range.test(minver)) {
1381
+ return minver;
1382
+ }
1383
+ return null;
1384
+ };
1385
+ module2.exports = minVersion;
1386
+ }
1387
+ });
1388
+
1389
+ // node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/satisfies.js
1390
+ var require_satisfies = __commonJS({
1391
+ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/satisfies.js"(exports2, module2) {
1392
+ "use strict";
1393
+ var Range2 = require_range();
1394
+ var satisfies = (version2, range, options) => {
1395
+ try {
1396
+ range = new Range2(range, options);
1397
+ } catch (er) {
1398
+ return false;
1399
+ }
1400
+ return range.test(version2);
1401
+ };
1402
+ module2.exports = satisfies;
1403
+ }
1404
+ });
1405
+
1406
+ // node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/outside.js
1407
+ var require_outside = __commonJS({
1408
+ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/outside.js"(exports2, module2) {
1409
+ "use strict";
1410
+ var SemVer2 = require_semver();
1411
+ var Comparator = require_comparator();
1412
+ var { ANY } = Comparator;
1413
+ var Range2 = require_range();
1414
+ var satisfies = require_satisfies();
1415
+ var gt2 = require_gt();
1416
+ var lt = require_lt();
1417
+ var lte = require_lte();
1418
+ var gte = require_gte();
1419
+ var outside = (version2, range, hilo, options) => {
1420
+ version2 = new SemVer2(version2, options);
1421
+ range = new Range2(range, options);
1422
+ let gtfn, ltefn, ltfn, comp, ecomp;
1423
+ switch (hilo) {
1424
+ case ">":
1425
+ gtfn = gt2;
1426
+ ltefn = lte;
1427
+ ltfn = lt;
1428
+ comp = ">";
1429
+ ecomp = ">=";
1430
+ break;
1431
+ case "<":
1432
+ gtfn = lt;
1433
+ ltefn = gte;
1434
+ ltfn = gt2;
1435
+ comp = "<";
1436
+ ecomp = "<=";
1437
+ break;
1438
+ default:
1439
+ throw new TypeError('Must provide a hilo val of "<" or ">"');
1440
+ }
1441
+ if (satisfies(version2, range, options)) {
1442
+ return false;
1443
+ }
1444
+ for (let i = 0; i < range.set.length; ++i) {
1445
+ const comparators = range.set[i];
1446
+ let high = null;
1447
+ let low = null;
1448
+ comparators.forEach((comparator) => {
1449
+ if (comparator.semver === ANY) {
1450
+ comparator = new Comparator(">=0.0.0");
1451
+ }
1452
+ high = high || comparator;
1453
+ low = low || comparator;
1454
+ if (gtfn(comparator.semver, high.semver, options)) {
1455
+ high = comparator;
1456
+ } else if (ltfn(comparator.semver, low.semver, options)) {
1457
+ low = comparator;
1458
+ }
1459
+ });
1460
+ if (high.operator === comp || high.operator === ecomp) {
1461
+ return false;
1462
+ }
1463
+ if ((!low.operator || low.operator === comp) && ltefn(version2, low.semver)) {
1464
+ return false;
1465
+ } else if (low.operator === ecomp && ltfn(version2, low.semver)) {
1466
+ return false;
1467
+ }
1468
+ }
1469
+ return true;
1470
+ };
1471
+ module2.exports = outside;
1472
+ }
1473
+ });
1474
+
1475
+ // node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/ltr.js
1476
+ var require_ltr = __commonJS({
1477
+ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/ltr.js"(exports2, module2) {
1478
+ "use strict";
1479
+ var outside = require_outside();
1480
+ var ltr = (version2, range, options) => outside(version2, range, "<", options);
1481
+ module2.exports = ltr;
1482
+ }
1483
+ });
1484
+
1485
+ // node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/gtr.js
1486
+ var require_gtr = __commonJS({
1487
+ "node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/gtr.js"(exports2, module2) {
1488
+ "use strict";
1489
+ var outside = require_outside();
1490
+ var gtr = (version2, range, options) => outside(version2, range, ">", options);
1491
+ module2.exports = gtr;
1492
+ }
1493
+ });
1494
+
1495
+ // src/commands/helpers/define.ts
1496
+ var import_minimist = __toESM(require_minimist());
1497
+
1498
+ // package.json
1499
+ var version = "0.0.0-beta-20250820141901";
1500
+
1501
+ // src/commands/helpers/define.ts
1502
+ function defineCommandGroup(definition) {
1503
+ return {
1504
+ ...definition,
1505
+ parse(parents, argv) {
1506
+ const parsed = (0, import_minimist.default)(argv);
1507
+ for (const child of this.children)
1508
+ if (parsed._[0] === child.name)
1509
+ return void child.parse(parents.concat(this), argv.slice(1));
1510
+ if (parsed.help)
1511
+ return void console.log(buildCommandGroupHelp(parents, this));
1512
+ if (parsed.v || parsed.version) return void console.log(version);
1513
+ return void console.log(buildCommandGroupHelp(parents, this));
1514
+ }
1515
+ };
1516
+ }
1517
+ function buildCommandGroupHelp(parents, group) {
1518
+ return `Usage: ${[...parents, group].map((p) => p.name).join(" ")} [command] [options]
1519
+
1520
+ ${group.description}
5
1521
 
6
1522
  Commands:
7
- ${e.children.map(t=>`${t.name} | ${t.description}`).join(`
8
- `)}
1523
+ ${group.children.map((c) => `${c.name} | ${c.description}`).join("\n ")}
9
1524
 
10
1525
  Options:
11
1526
  --help | Show this help message and exit.
12
1527
  --version | Show the version number and exit.
13
- `}function oe(r){return{...r,parse(e,t){let s=(0,ge.default)(t);return s.help?void console.log(Dr(e,this)):this.action(s)}}}function Dr(r,e){return`Usage: ${[...r,e].map(t=>t.name).join(" ")} [options]
1528
+ `;
1529
+ }
1530
+ function defineCommand(definition) {
1531
+ return {
1532
+ ...definition,
1533
+ parse(parents, argv) {
1534
+ const parsed = (0, import_minimist.default)(argv);
1535
+ if (parsed.help) return void console.log(buildCommandHelp(parents, this));
1536
+ return this.action(parsed);
1537
+ }
1538
+ };
1539
+ }
1540
+ function buildCommandHelp(parents, command) {
1541
+ return `Usage: ${[...parents, command].map((p) => p.name).join(" ")} [options]
14
1542
 
15
- ${e.description}
1543
+ ${command.description}
16
1544
 
17
1545
  Options:
18
1546
  --help | Show this help message and exit.
19
- ${e.options.map(t=>`--${t.name} | ${t.description}`).join(`
20
- `)}
21
- `}var fe=require("fs/promises"),It=require("path");var q=S(require("readline"),1),dt=require("util");var nt=(r=0)=>e=>`\x1B[${e+r}m`,ot=(r=0)=>e=>`\x1B[${38+r};5;${e}m`,it=(r=0)=>(e,t,s)=>`\x1B[${38+r};2;${e};${t};${s}m`,O={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},Sn=Object.keys(O.modifier),Fr=Object.keys(O.color),Gr=Object.keys(O.bgColor),Ln=[...Fr,...Gr];function jr(){let r=new Map;for(let[e,t]of Object.entries(O)){for(let[s,n]of Object.entries(t))O[s]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},t[s]=O[s],r.set(n[0],n[1]);Object.defineProperty(O,e,{value:t,enumerable:!1})}return Object.defineProperty(O,"codes",{value:r,enumerable:!1}),O.color.close="\x1B[39m",O.bgColor.close="\x1B[49m",O.color.ansi=nt(),O.color.ansi256=ot(),O.color.ansi16m=it(),O.bgColor.ansi=nt(10),O.bgColor.ansi256=ot(10),O.bgColor.ansi16m=it(10),Object.defineProperties(O,{rgbToAnsi256:{value(e,t,s){return e===t&&t===s?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(s/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[s]=t;s.length===3&&(s=[...s].map(o=>o+o).join(""));let n=Number.parseInt(s,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:e=>O.rgbToAnsi256(...O.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,s,n;if(e>=232)t=((e-232)*10+8)/255,s=t,n=t;else{e-=16;let l=e%36;t=Math.floor(e/36)/5,s=Math.floor(l/6)/5,n=l%6/5}let o=Math.max(t,s,n)*2;if(o===0)return 30;let i=30+(Math.round(n)<<2|Math.round(s)<<1|Math.round(t));return o===2&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(e,t,s)=>O.ansi256ToAnsi(O.rgbToAnsi256(e,t,s)),enumerable:!1},hexToAnsi:{value:e=>O.ansi256ToAnsi(O.hexToAnsi256(e)),enumerable:!1}}),O}var qr=jr(),y=qr;var ae=S(require("process"),1),ct=S(require("os"),1),Ne=S(require("tty"),1);function L(r,e=globalThis.Deno?globalThis.Deno.args:ae.default.argv){let t=r.startsWith("-")?"":r.length===1?"-":"--",s=e.indexOf(t+r),n=e.indexOf("--");return s!==-1&&(n===-1||s<n)}var{env:g}=ae.default,ie;L("no-color")||L("no-colors")||L("color=false")||L("color=never")?ie=0:(L("color")||L("colors")||L("color=true")||L("color=always"))&&(ie=1);function _r(){if("FORCE_COLOR"in g)return g.FORCE_COLOR==="true"?1:g.FORCE_COLOR==="false"?0:g.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(g.FORCE_COLOR,10),3)}function Br(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function Ur(r,{streamIsTTY:e,sniffFlags:t=!0}={}){let s=_r();s!==void 0&&(ie=s);let n=t?ie:s;if(n===0)return 0;if(t){if(L("color=16m")||L("color=full")||L("color=truecolor"))return 3;if(L("color=256"))return 2}if("TF_BUILD"in g&&"AGENT_NAME"in g)return 1;if(r&&!e&&n===void 0)return 0;let o=n||0;if(g.TERM==="dumb")return o;if(ae.default.platform==="win32"){let i=ct.default.release().split(".");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in g)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(i=>i in g)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(i=>i in g)||g.CI_NAME==="codeship"?1:o;if("TEAMCITY_VERSION"in g)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(g.TEAMCITY_VERSION)?1:0;if(g.COLORTERM==="truecolor"||g.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in g){let i=Number.parseInt((g.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(g.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(g.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(g.TERM)||"COLORTERM"in g?1:o}function at(r,e={}){let t=Ur(r,{streamIsTTY:r&&r.isTTY,...e});return Br(t)}var Mr={stdout:at({isTTY:Ne.default.isatty(1)}),stderr:at({isTTY:Ne.default.isatty(2)})},lt=Mr;function ut(r,e,t){let s=r.indexOf(e);if(s===-1)return r;let n=e.length,o=0,i="";do i+=r.slice(o,s)+e+t,o=s+n,s=r.indexOf(e,o);while(s!==-1);return i+=r.slice(o),i}function ft(r,e,t,s){let n=0,o="";do{let i=r[s-1]==="\r";o+=r.slice(n,i?s-1:s)+e+(i?`\r
22
- `:`
23
- `)+t,n=s+1,s=r.indexOf(`
24
- `,n)}while(s!==-1);return o+=r.slice(n),o}var{stdout:pt,stderr:ht}=lt,Ie=Symbol("GENERATOR"),k=Symbol("STYLER"),K=Symbol("IS_EMPTY"),mt=["ansi","ansi","ansi256","ansi16m"],V=Object.create(null),Xr=(r,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let t=pt?pt.level:0;r.level=e.level===void 0?t:e.level};var kr=r=>{let e=(...t)=>t.join(" ");return Xr(e,r),Object.setPrototypeOf(e,Z.prototype),e};function Z(r){return kr(r)}Object.setPrototypeOf(Z.prototype,Function.prototype);for(let[r,e]of Object.entries(y))V[r]={get(){let t=ce(this,Te(e.open,e.close,this[k]),this[K]);return Object.defineProperty(this,r,{value:t}),t}};V.visible={get(){let r=ce(this,this[k],!0);return Object.defineProperty(this,"visible",{value:r}),r}};var be=(r,e,t,...s)=>r==="rgb"?e==="ansi16m"?y[t].ansi16m(...s):e==="ansi256"?y[t].ansi256(y.rgbToAnsi256(...s)):y[t].ansi(y.rgbToAnsi(...s)):r==="hex"?be("rgb",e,t,...y.hexToRgb(...s)):y[t][r](...s),Vr=["rgb","hex","ansi256"];for(let r of Vr){V[r]={get(){let{level:t}=this;return function(...s){let n=Te(be(r,mt[t],"color",...s),y.color.close,this[k]);return ce(this,n,this[K])}}};let e="bg"+r[0].toUpperCase()+r.slice(1);V[e]={get(){let{level:t}=this;return function(...s){let n=Te(be(r,mt[t],"bgColor",...s),y.bgColor.close,this[k]);return ce(this,n,this[K])}}}}var Wr=Object.defineProperties(()=>{},{...V,level:{enumerable:!0,get(){return this[Ie].level},set(r){this[Ie].level=r}}}),Te=(r,e,t)=>{let s,n;return t===void 0?(s=r,n=e):(s=t.openAll+r,n=e+t.closeAll),{open:r,close:e,openAll:s,closeAll:n,parent:t}},ce=(r,e,t)=>{let s=(...n)=>Yr(s,n.length===1?""+n[0]:n.join(" "));return Object.setPrototypeOf(s,Wr),s[Ie]=r,s[k]=e,s[K]=t,s},Yr=(r,e)=>{if(r.level<=0||!e)return r[K]?"":e;let t=r[k];if(t===void 0)return e;let{openAll:s,closeAll:n}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=ut(e,t.close,t.open),t=t.parent;let o=e.indexOf(`
25
- `);return o!==-1&&(e=ft(e,n,s,o)),s+e+n};Object.defineProperties(Z.prototype,V);var Hr=Z(),jn=Z({level:ht?ht.level:0});var j=Hr;function Et(...r){console.log("[next-ws]",...r)}function _(...r){console.log(j.blue("[next-ws]"),...r)}function le(...r){console.log(j.yellow("[next-ws]"),...r)}function B(...r){console.log(j.red("[next-ws]"),...r)}var $t=(0,dt.debuglog)("next-ws");function zr(...r){console.log(j.green("[next-ws]","\u2714"),...r)}function Kr(...r){console.log(j.red("[next-ws]","\u2716"),...r)}async function Rt(...r){let e=q.default.createInterface({input:process.stdin,output:process.stdout});return new Promise(t=>{let s=j.yellow("[next-ws]",...r),n=j.cyan("[y/N]");e.question(`${s} ${n}`,o=>{let i=o.trim().toLowerCase();t(i==="y"),e.close()})})}async function Ot(r,...e){process.stdout.write("\x1B[?25l");let t=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827"],s=0,n=setInterval(()=>{q.default.cursorTo(process.stdout,0);let o=t[s++%t.length];process.stdout.write(j.cyan("[next-ws]",o,...e))},100);return r.then(o=>(clearInterval(n),q.default.cursorTo(process.stdout,0),q.default.clearLine(process.stdout,0),zr(...e),o)).catch(o=>{throw clearInterval(n),q.default.cursorTo(process.stdout,0),q.default.clearLine(process.stdout,0),Kr(...e),o}).finally(()=>{process.stdout.write("\x1B[?25h")})}var J=require("fs/promises"),U=require("path");function xt(){let r={paths:[process.cwd()]},e=require.resolve("next-ws/package.json",r);return`${(0,U.dirname)(e)}/dist`.replace(/\\/g,"/").replace(/'/g,"\\'")}async function Q(){let r={paths:[process.cwd()]},e=require.resolve("next/package.json",r);return(0,U.dirname)(e)}async function ue(){let r=await Q(),e=(0,U.join)(r,"package.json"),t=await(0,J.readFile)(e,"utf-8").then(JSON.parse);return String(t.version.split("-")[0])}async function gt(){let r=await Q(),e=(0,U.join)(r,".next-ws-trace.json");return(0,J.readFile)(e,"utf-8").then(JSON.parse).catch(()=>null)}async function Nt(r){let e=await Q(),t=(0,U.join)(e,".next-ws-trace.json");await(0,J.writeFile)(t,JSON.stringify(r,null,2))}function pe(r){return{...r,async execute(){let e=[];for(let t of this.steps)await Ot(t.execute(),t.title).then(s=>e.push(s));return e.every(t=>t)}}}function W(r){return{...r,async execute(){let e=await Zr(this.path);$t("Applying",`"${this.title}"`,"to",`"${e}"`);let t=await(0,fe.readFile)(e,"utf-8");if(this.ignore&&t.includes(this.ignore))return!1;let s=await this.modify(t);return await(0,fe.writeFile)(e,s),!0}}}async function Zr(r){switch(r.split(":")[0]){case"next":{let e=await Q(),t=r.slice(5);return(0,It.resolve)(e,t)}default:return r}}var ve=W({title:"Add WebSocket server setup script to NextNodeServer constructor.",path:"next:dist/server/next-server.js",ignore:"setupWebSocketServer(this)",async modify(r){let e=r.split(`
26
- `),t=!1,s=-1,n=0;for(let l=0;l<e.length;l++){let u=e[l]??"";if(!t&&u.includes("constructor(")&&(t=!0,n=0),t&&(n+=(u.match(/{/g)||[]).length,n-=(u.match(/}/g)||[]).length,n===0)){s=l;break}}if(s===-1)throw new Error("Could not find constructor end index.");let o=`;{
1547
+ ${command.options.map((o) => `--${o.name} | ${o.description}`).join("\n ")}
1548
+ `;
1549
+ }
1550
+
1551
+ // src/patches/helpers/define.ts
1552
+ var import_promises2 = require("fs/promises");
1553
+ var import_node_path2 = require("path");
1554
+
1555
+ // src/commands/helpers/console.ts
1556
+ var import_node_readline = __toESM(require("readline"));
1557
+ var import_node_util = require("util");
1558
+
1559
+ // node_modules/.pnpm/chalk@5.6.0/node_modules/chalk/source/vendor/ansi-styles/index.js
1560
+ var ANSI_BACKGROUND_OFFSET = 10;
1561
+ var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
1562
+ var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
1563
+ var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
1564
+ var styles = {
1565
+ modifier: {
1566
+ reset: [0, 0],
1567
+ // 21 isn't widely supported and 22 does the same thing
1568
+ bold: [1, 22],
1569
+ dim: [2, 22],
1570
+ italic: [3, 23],
1571
+ underline: [4, 24],
1572
+ overline: [53, 55],
1573
+ inverse: [7, 27],
1574
+ hidden: [8, 28],
1575
+ strikethrough: [9, 29]
1576
+ },
1577
+ color: {
1578
+ black: [30, 39],
1579
+ red: [31, 39],
1580
+ green: [32, 39],
1581
+ yellow: [33, 39],
1582
+ blue: [34, 39],
1583
+ magenta: [35, 39],
1584
+ cyan: [36, 39],
1585
+ white: [37, 39],
1586
+ // Bright color
1587
+ blackBright: [90, 39],
1588
+ gray: [90, 39],
1589
+ // Alias of `blackBright`
1590
+ grey: [90, 39],
1591
+ // Alias of `blackBright`
1592
+ redBright: [91, 39],
1593
+ greenBright: [92, 39],
1594
+ yellowBright: [93, 39],
1595
+ blueBright: [94, 39],
1596
+ magentaBright: [95, 39],
1597
+ cyanBright: [96, 39],
1598
+ whiteBright: [97, 39]
1599
+ },
1600
+ bgColor: {
1601
+ bgBlack: [40, 49],
1602
+ bgRed: [41, 49],
1603
+ bgGreen: [42, 49],
1604
+ bgYellow: [43, 49],
1605
+ bgBlue: [44, 49],
1606
+ bgMagenta: [45, 49],
1607
+ bgCyan: [46, 49],
1608
+ bgWhite: [47, 49],
1609
+ // Bright color
1610
+ bgBlackBright: [100, 49],
1611
+ bgGray: [100, 49],
1612
+ // Alias of `bgBlackBright`
1613
+ bgGrey: [100, 49],
1614
+ // Alias of `bgBlackBright`
1615
+ bgRedBright: [101, 49],
1616
+ bgGreenBright: [102, 49],
1617
+ bgYellowBright: [103, 49],
1618
+ bgBlueBright: [104, 49],
1619
+ bgMagentaBright: [105, 49],
1620
+ bgCyanBright: [106, 49],
1621
+ bgWhiteBright: [107, 49]
1622
+ }
1623
+ };
1624
+ var modifierNames = Object.keys(styles.modifier);
1625
+ var foregroundColorNames = Object.keys(styles.color);
1626
+ var backgroundColorNames = Object.keys(styles.bgColor);
1627
+ var colorNames = [...foregroundColorNames, ...backgroundColorNames];
1628
+ function assembleStyles() {
1629
+ const codes = /* @__PURE__ */ new Map();
1630
+ for (const [groupName, group] of Object.entries(styles)) {
1631
+ for (const [styleName, style] of Object.entries(group)) {
1632
+ styles[styleName] = {
1633
+ open: `\x1B[${style[0]}m`,
1634
+ close: `\x1B[${style[1]}m`
1635
+ };
1636
+ group[styleName] = styles[styleName];
1637
+ codes.set(style[0], style[1]);
1638
+ }
1639
+ Object.defineProperty(styles, groupName, {
1640
+ value: group,
1641
+ enumerable: false
1642
+ });
1643
+ }
1644
+ Object.defineProperty(styles, "codes", {
1645
+ value: codes,
1646
+ enumerable: false
1647
+ });
1648
+ styles.color.close = "\x1B[39m";
1649
+ styles.bgColor.close = "\x1B[49m";
1650
+ styles.color.ansi = wrapAnsi16();
1651
+ styles.color.ansi256 = wrapAnsi256();
1652
+ styles.color.ansi16m = wrapAnsi16m();
1653
+ styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
1654
+ styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
1655
+ styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
1656
+ Object.defineProperties(styles, {
1657
+ rgbToAnsi256: {
1658
+ value(red, green, blue) {
1659
+ if (red === green && green === blue) {
1660
+ if (red < 8) {
1661
+ return 16;
1662
+ }
1663
+ if (red > 248) {
1664
+ return 231;
1665
+ }
1666
+ return Math.round((red - 8) / 247 * 24) + 232;
1667
+ }
1668
+ return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
1669
+ },
1670
+ enumerable: false
1671
+ },
1672
+ hexToRgb: {
1673
+ value(hex) {
1674
+ const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
1675
+ if (!matches) {
1676
+ return [0, 0, 0];
1677
+ }
1678
+ let [colorString] = matches;
1679
+ if (colorString.length === 3) {
1680
+ colorString = [...colorString].map((character) => character + character).join("");
1681
+ }
1682
+ const integer = Number.parseInt(colorString, 16);
1683
+ return [
1684
+ /* eslint-disable no-bitwise */
1685
+ integer >> 16 & 255,
1686
+ integer >> 8 & 255,
1687
+ integer & 255
1688
+ /* eslint-enable no-bitwise */
1689
+ ];
1690
+ },
1691
+ enumerable: false
1692
+ },
1693
+ hexToAnsi256: {
1694
+ value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
1695
+ enumerable: false
1696
+ },
1697
+ ansi256ToAnsi: {
1698
+ value(code) {
1699
+ if (code < 8) {
1700
+ return 30 + code;
1701
+ }
1702
+ if (code < 16) {
1703
+ return 90 + (code - 8);
1704
+ }
1705
+ let red;
1706
+ let green;
1707
+ let blue;
1708
+ if (code >= 232) {
1709
+ red = ((code - 232) * 10 + 8) / 255;
1710
+ green = red;
1711
+ blue = red;
1712
+ } else {
1713
+ code -= 16;
1714
+ const remainder = code % 36;
1715
+ red = Math.floor(code / 36) / 5;
1716
+ green = Math.floor(remainder / 6) / 5;
1717
+ blue = remainder % 6 / 5;
1718
+ }
1719
+ const value = Math.max(red, green, blue) * 2;
1720
+ if (value === 0) {
1721
+ return 30;
1722
+ }
1723
+ let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
1724
+ if (value === 2) {
1725
+ result += 60;
1726
+ }
1727
+ return result;
1728
+ },
1729
+ enumerable: false
1730
+ },
1731
+ rgbToAnsi: {
1732
+ value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
1733
+ enumerable: false
1734
+ },
1735
+ hexToAnsi: {
1736
+ value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
1737
+ enumerable: false
1738
+ }
1739
+ });
1740
+ return styles;
1741
+ }
1742
+ var ansiStyles = assembleStyles();
1743
+ var ansi_styles_default = ansiStyles;
1744
+
1745
+ // node_modules/.pnpm/chalk@5.6.0/node_modules/chalk/source/vendor/supports-color/index.js
1746
+ var import_node_process = __toESM(require("process"), 1);
1747
+ var import_node_os = __toESM(require("os"), 1);
1748
+ var import_node_tty = __toESM(require("tty"), 1);
1749
+ function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : import_node_process.default.argv) {
1750
+ const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
1751
+ const position = argv.indexOf(prefix + flag);
1752
+ const terminatorPosition = argv.indexOf("--");
1753
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
1754
+ }
1755
+ var { env } = import_node_process.default;
1756
+ var flagForceColor;
1757
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
1758
+ flagForceColor = 0;
1759
+ } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
1760
+ flagForceColor = 1;
1761
+ }
1762
+ function envForceColor() {
1763
+ if ("FORCE_COLOR" in env) {
1764
+ if (env.FORCE_COLOR === "true") {
1765
+ return 1;
1766
+ }
1767
+ if (env.FORCE_COLOR === "false") {
1768
+ return 0;
1769
+ }
1770
+ return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
1771
+ }
1772
+ }
1773
+ function translateLevel(level) {
1774
+ if (level === 0) {
1775
+ return false;
1776
+ }
1777
+ return {
1778
+ level,
1779
+ hasBasic: true,
1780
+ has256: level >= 2,
1781
+ has16m: level >= 3
1782
+ };
1783
+ }
1784
+ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
1785
+ const noFlagForceColor = envForceColor();
1786
+ if (noFlagForceColor !== void 0) {
1787
+ flagForceColor = noFlagForceColor;
1788
+ }
1789
+ const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
1790
+ if (forceColor === 0) {
1791
+ return 0;
1792
+ }
1793
+ if (sniffFlags) {
1794
+ if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
1795
+ return 3;
1796
+ }
1797
+ if (hasFlag("color=256")) {
1798
+ return 2;
1799
+ }
1800
+ }
1801
+ if ("TF_BUILD" in env && "AGENT_NAME" in env) {
1802
+ return 1;
1803
+ }
1804
+ if (haveStream && !streamIsTTY && forceColor === void 0) {
1805
+ return 0;
1806
+ }
1807
+ const min = forceColor || 0;
1808
+ if (env.TERM === "dumb") {
1809
+ return min;
1810
+ }
1811
+ if (import_node_process.default.platform === "win32") {
1812
+ const osRelease = import_node_os.default.release().split(".");
1813
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
1814
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
1815
+ }
1816
+ return 1;
1817
+ }
1818
+ if ("CI" in env) {
1819
+ if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => key in env)) {
1820
+ return 3;
1821
+ }
1822
+ if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
1823
+ return 1;
1824
+ }
1825
+ return min;
1826
+ }
1827
+ if ("TEAMCITY_VERSION" in env) {
1828
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
1829
+ }
1830
+ if (env.COLORTERM === "truecolor") {
1831
+ return 3;
1832
+ }
1833
+ if (env.TERM === "xterm-kitty") {
1834
+ return 3;
1835
+ }
1836
+ if (env.TERM === "xterm-ghostty") {
1837
+ return 3;
1838
+ }
1839
+ if (env.TERM === "wezterm") {
1840
+ return 3;
1841
+ }
1842
+ if ("TERM_PROGRAM" in env) {
1843
+ const version2 = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
1844
+ switch (env.TERM_PROGRAM) {
1845
+ case "iTerm.app": {
1846
+ return version2 >= 3 ? 3 : 2;
1847
+ }
1848
+ case "Apple_Terminal": {
1849
+ return 2;
1850
+ }
1851
+ }
1852
+ }
1853
+ if (/-256(color)?$/i.test(env.TERM)) {
1854
+ return 2;
1855
+ }
1856
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
1857
+ return 1;
1858
+ }
1859
+ if ("COLORTERM" in env) {
1860
+ return 1;
1861
+ }
1862
+ return min;
1863
+ }
1864
+ function createSupportsColor(stream, options = {}) {
1865
+ const level = _supportsColor(stream, {
1866
+ streamIsTTY: stream && stream.isTTY,
1867
+ ...options
1868
+ });
1869
+ return translateLevel(level);
1870
+ }
1871
+ var supportsColor = {
1872
+ stdout: createSupportsColor({ isTTY: import_node_tty.default.isatty(1) }),
1873
+ stderr: createSupportsColor({ isTTY: import_node_tty.default.isatty(2) })
1874
+ };
1875
+ var supports_color_default = supportsColor;
1876
+
1877
+ // node_modules/.pnpm/chalk@5.6.0/node_modules/chalk/source/utilities.js
1878
+ function stringReplaceAll(string, substring, replacer) {
1879
+ let index = string.indexOf(substring);
1880
+ if (index === -1) {
1881
+ return string;
1882
+ }
1883
+ const substringLength = substring.length;
1884
+ let endIndex = 0;
1885
+ let returnValue = "";
1886
+ do {
1887
+ returnValue += string.slice(endIndex, index) + substring + replacer;
1888
+ endIndex = index + substringLength;
1889
+ index = string.indexOf(substring, endIndex);
1890
+ } while (index !== -1);
1891
+ returnValue += string.slice(endIndex);
1892
+ return returnValue;
1893
+ }
1894
+ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
1895
+ let endIndex = 0;
1896
+ let returnValue = "";
1897
+ do {
1898
+ const gotCR = string[index - 1] === "\r";
1899
+ returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
1900
+ endIndex = index + 1;
1901
+ index = string.indexOf("\n", endIndex);
1902
+ } while (index !== -1);
1903
+ returnValue += string.slice(endIndex);
1904
+ return returnValue;
1905
+ }
1906
+
1907
+ // node_modules/.pnpm/chalk@5.6.0/node_modules/chalk/source/index.js
1908
+ var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
1909
+ var GENERATOR = Symbol("GENERATOR");
1910
+ var STYLER = Symbol("STYLER");
1911
+ var IS_EMPTY = Symbol("IS_EMPTY");
1912
+ var levelMapping = [
1913
+ "ansi",
1914
+ "ansi",
1915
+ "ansi256",
1916
+ "ansi16m"
1917
+ ];
1918
+ var styles2 = /* @__PURE__ */ Object.create(null);
1919
+ var applyOptions = (object, options = {}) => {
1920
+ if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
1921
+ throw new Error("The `level` option should be an integer from 0 to 3");
1922
+ }
1923
+ const colorLevel = stdoutColor ? stdoutColor.level : 0;
1924
+ object.level = options.level === void 0 ? colorLevel : options.level;
1925
+ };
1926
+ var chalkFactory = (options) => {
1927
+ const chalk2 = (...strings) => strings.join(" ");
1928
+ applyOptions(chalk2, options);
1929
+ Object.setPrototypeOf(chalk2, createChalk.prototype);
1930
+ return chalk2;
1931
+ };
1932
+ function createChalk(options) {
1933
+ return chalkFactory(options);
1934
+ }
1935
+ Object.setPrototypeOf(createChalk.prototype, Function.prototype);
1936
+ for (const [styleName, style] of Object.entries(ansi_styles_default)) {
1937
+ styles2[styleName] = {
1938
+ get() {
1939
+ const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
1940
+ Object.defineProperty(this, styleName, { value: builder });
1941
+ return builder;
1942
+ }
1943
+ };
1944
+ }
1945
+ styles2.visible = {
1946
+ get() {
1947
+ const builder = createBuilder(this, this[STYLER], true);
1948
+ Object.defineProperty(this, "visible", { value: builder });
1949
+ return builder;
1950
+ }
1951
+ };
1952
+ var getModelAnsi = (model, level, type, ...arguments_) => {
1953
+ if (model === "rgb") {
1954
+ if (level === "ansi16m") {
1955
+ return ansi_styles_default[type].ansi16m(...arguments_);
1956
+ }
1957
+ if (level === "ansi256") {
1958
+ return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
1959
+ }
1960
+ return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
1961
+ }
1962
+ if (model === "hex") {
1963
+ return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
1964
+ }
1965
+ return ansi_styles_default[type][model](...arguments_);
1966
+ };
1967
+ var usedModels = ["rgb", "hex", "ansi256"];
1968
+ for (const model of usedModels) {
1969
+ styles2[model] = {
1970
+ get() {
1971
+ const { level } = this;
1972
+ return function(...arguments_) {
1973
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
1974
+ return createBuilder(this, styler, this[IS_EMPTY]);
1975
+ };
1976
+ }
1977
+ };
1978
+ const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
1979
+ styles2[bgModel] = {
1980
+ get() {
1981
+ const { level } = this;
1982
+ return function(...arguments_) {
1983
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
1984
+ return createBuilder(this, styler, this[IS_EMPTY]);
1985
+ };
1986
+ }
1987
+ };
1988
+ }
1989
+ var proto = Object.defineProperties(() => {
1990
+ }, {
1991
+ ...styles2,
1992
+ level: {
1993
+ enumerable: true,
1994
+ get() {
1995
+ return this[GENERATOR].level;
1996
+ },
1997
+ set(level) {
1998
+ this[GENERATOR].level = level;
1999
+ }
2000
+ }
2001
+ });
2002
+ var createStyler = (open, close, parent) => {
2003
+ let openAll;
2004
+ let closeAll;
2005
+ if (parent === void 0) {
2006
+ openAll = open;
2007
+ closeAll = close;
2008
+ } else {
2009
+ openAll = parent.openAll + open;
2010
+ closeAll = close + parent.closeAll;
2011
+ }
2012
+ return {
2013
+ open,
2014
+ close,
2015
+ openAll,
2016
+ closeAll,
2017
+ parent
2018
+ };
2019
+ };
2020
+ var createBuilder = (self, _styler, _isEmpty) => {
2021
+ const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
2022
+ Object.setPrototypeOf(builder, proto);
2023
+ builder[GENERATOR] = self;
2024
+ builder[STYLER] = _styler;
2025
+ builder[IS_EMPTY] = _isEmpty;
2026
+ return builder;
2027
+ };
2028
+ var applyStyle = (self, string) => {
2029
+ if (self.level <= 0 || !string) {
2030
+ return self[IS_EMPTY] ? "" : string;
2031
+ }
2032
+ let styler = self[STYLER];
2033
+ if (styler === void 0) {
2034
+ return string;
2035
+ }
2036
+ const { openAll, closeAll } = styler;
2037
+ if (string.includes("\x1B")) {
2038
+ while (styler !== void 0) {
2039
+ string = stringReplaceAll(string, styler.close, styler.open);
2040
+ styler = styler.parent;
2041
+ }
2042
+ }
2043
+ const lfIndex = string.indexOf("\n");
2044
+ if (lfIndex !== -1) {
2045
+ string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
2046
+ }
2047
+ return openAll + string + closeAll;
2048
+ };
2049
+ Object.defineProperties(createChalk.prototype, styles2);
2050
+ var chalk = createChalk();
2051
+ var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
2052
+ var source_default = chalk;
2053
+
2054
+ // src/commands/helpers/console.ts
2055
+ function log(...message) {
2056
+ console.log("[next-ws]", ...message);
2057
+ }
2058
+ function info(...message) {
2059
+ console.log(source_default.blue("[next-ws]"), ...message);
2060
+ }
2061
+ function warn(...message) {
2062
+ console.log(source_default.yellow("[next-ws]"), ...message);
2063
+ }
2064
+ function error(...message) {
2065
+ console.log(source_default.red("[next-ws]"), ...message);
2066
+ }
2067
+ var debug = (0, import_node_util.debuglog)("next-ws");
2068
+ function success(...message) {
2069
+ console.log(source_default.green("[next-ws]", "\u2714"), ...message);
2070
+ }
2071
+ function failure(...message) {
2072
+ console.log(source_default.red("[next-ws]", "\u2716"), ...message);
2073
+ }
2074
+ async function confirm(...message) {
2075
+ const rl = import_node_readline.default.createInterface({
2076
+ input: process.stdin,
2077
+ output: process.stdout
2078
+ });
2079
+ return new Promise((resolve2) => {
2080
+ const question = source_default.yellow("[next-ws]", ...message);
2081
+ const options = source_default.cyan("[y/N]");
2082
+ rl.question(`${question} ${options}`, (answer) => {
2083
+ const normalisedAnswer = answer.trim().toLowerCase();
2084
+ if (normalisedAnswer === "y") resolve2(true);
2085
+ else resolve2(false);
2086
+ rl.close();
2087
+ });
2088
+ });
2089
+ }
2090
+ async function task(promise, ...message) {
2091
+ process.stdout.write("\x1B[?25l");
2092
+ const spinnerChars = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827"];
2093
+ let spinnerIndex = 0;
2094
+ const spinnerInterval = setInterval(() => {
2095
+ import_node_readline.default.cursorTo(process.stdout, 0);
2096
+ const spinnerChar = spinnerChars[spinnerIndex++ % spinnerChars.length];
2097
+ process.stdout.write(source_default.cyan("[next-ws]", spinnerChar, ...message));
2098
+ }, 100);
2099
+ return promise.then((value) => {
2100
+ clearInterval(spinnerInterval);
2101
+ import_node_readline.default.cursorTo(process.stdout, 0);
2102
+ import_node_readline.default.clearLine(process.stdout, 0);
2103
+ success(...message);
2104
+ return value;
2105
+ }).catch((err) => {
2106
+ clearInterval(spinnerInterval);
2107
+ import_node_readline.default.cursorTo(process.stdout, 0);
2108
+ import_node_readline.default.clearLine(process.stdout, 0);
2109
+ failure(...message);
2110
+ throw err;
2111
+ }).finally(() => {
2112
+ process.stdout.write("\x1B[?25h");
2113
+ });
2114
+ }
2115
+
2116
+ // src/patches/helpers/next.ts
2117
+ var import_promises = require("fs/promises");
2118
+ var import_node_path = require("path");
2119
+ function getDistDirname() {
2120
+ const resolveOptions = { paths: [process.cwd()] };
2121
+ const nextWsPackagePath = (
2122
+ //
2123
+ require.resolve("next-ws/package.json", resolveOptions)
2124
+ );
2125
+ const nextWsDirName = (0, import_node_path.dirname)(nextWsPackagePath);
2126
+ return `${nextWsDirName}/dist`.replace(/\\/g, "/").replace(/'/g, "\\'");
2127
+ }
2128
+ async function findNextDirectory() {
2129
+ const resolveOptions = { paths: [process.cwd()] };
2130
+ const nextPackagePath = require.resolve("next/package.json", resolveOptions);
2131
+ return (0, import_node_path.dirname)(nextPackagePath);
2132
+ }
2133
+ async function getNextVersion() {
2134
+ const nextDirectory = await findNextDirectory();
2135
+ const nextPackagePath = (0, import_node_path.join)(nextDirectory, "package.json");
2136
+ const nextPackage = await (0, import_promises.readFile)(nextPackagePath, "utf-8").then(JSON.parse);
2137
+ return String(nextPackage.version.split("-")[0]);
2138
+ }
2139
+ async function getTrace() {
2140
+ const nextDirectory = await findNextDirectory();
2141
+ const tracePath = (0, import_node_path.join)(nextDirectory, ".next-ws-trace.json");
2142
+ return (0, import_promises.readFile)(tracePath, "utf-8").then(JSON.parse).catch(() => null);
2143
+ }
2144
+ async function setTrace(trace) {
2145
+ const nextDirectory = await findNextDirectory();
2146
+ const tracePath = (0, import_node_path.join)(nextDirectory, ".next-ws-trace.json");
2147
+ await (0, import_promises.writeFile)(tracePath, JSON.stringify(trace, null, 2));
2148
+ }
2149
+
2150
+ // src/patches/helpers/define.ts
2151
+ function definePatch(definition) {
2152
+ return {
2153
+ ...definition,
2154
+ async execute() {
2155
+ const results = [];
2156
+ for (const step of this.steps)
2157
+ await task(step.execute(), step.title).then((r) => results.push(r));
2158
+ return results.every((r) => r);
2159
+ }
2160
+ };
2161
+ }
2162
+ function definePatchStep(definition) {
2163
+ return {
2164
+ ...definition,
2165
+ async execute() {
2166
+ const path = await resolvePath(this.path);
2167
+ debug("Applying", `"${this.title}"`, "to", `"${path}"`);
2168
+ const source = await (0, import_promises2.readFile)(path, "utf-8");
2169
+ if (this.ignore && source.includes(this.ignore)) return false;
2170
+ const newSource = await this.modify(source);
2171
+ await (0, import_promises2.writeFile)(path, newSource);
2172
+ return true;
2173
+ }
2174
+ };
2175
+ }
2176
+ async function resolvePath(path) {
2177
+ switch (path.split(":")[0]) {
2178
+ case "next": {
2179
+ const nextDirectory = await findNextDirectory();
2180
+ const realPath = path.slice(5);
2181
+ return (0, import_node_path2.resolve)(nextDirectory, realPath);
2182
+ }
2183
+ default: {
2184
+ return path;
2185
+ }
2186
+ }
2187
+ }
2188
+
2189
+ // src/patches/patch-1.ts
2190
+ var patchNextNodeServer = definePatchStep({
2191
+ title: "Add WebSocket server setup script to NextNodeServer constructor.",
2192
+ path: "next:dist/server/next-server.js",
2193
+ ignore: "setupWebSocketServer(this)",
2194
+ async modify(source) {
2195
+ const sourceLines = source.split("\n");
2196
+ let inConstructor = false;
2197
+ let constructorEndIndex = -1;
2198
+ let braceCount = 0;
2199
+ for (let i = 0; i < sourceLines.length; i++) {
2200
+ const line = sourceLines[i] ?? "";
2201
+ if (!inConstructor && line.includes("constructor(")) {
2202
+ inConstructor = true;
2203
+ braceCount = 0;
2204
+ }
2205
+ if (inConstructor) {
2206
+ braceCount += (line.match(/{/g) || []).length;
2207
+ braceCount -= (line.match(/}/g) || []).length;
2208
+ if (braceCount === 0) {
2209
+ constructorEndIndex = i;
2210
+ break;
2211
+ }
2212
+ }
2213
+ }
2214
+ if (constructorEndIndex === -1)
2215
+ throw new Error("Could not find constructor end index.");
2216
+ const setupScript = `;{
27
2217
  let nextWs;
28
2218
  try { nextWs = require('next-ws/server') } catch {
29
- try { nextWs = require('${xt()}/server/index.cjs') } catch {
2219
+ try { nextWs = require('${getDistDirname()}/server/index.cjs') } catch {
30
2220
  /* don't let this crash apps that don't use next-ws */ }}
31
2221
  nextWs?.setupWebSocketServer(this);
32
- };`;return e.splice(s,0,o),e.join(`
33
- `)}}),Ae=W({title:"Add SOCKET type to Next types",path:"next:dist/build/webpack/plugins/next-types-plugin.js",ignore:"SOCKET?: Function;",async modify(r){let e=/\.map\(\(method\)=>`\${method}\?: Function`\).join\(['"]\\n +['"]\)/g;return r.replace(e,s=>`${s} + "; SOCKET?: Function;"`)}}),bt=pe({name:"patch-1",versions:">=13.2.0 <=13.4.8",steps:[ve,Ae]});var Jr=W({...Ae,path:"next:dist/build/webpack/plugins/next-types-plugin/index.js"}),Qr=W({title:"Prevent Next.js from immediately closing WebSocket connections",path:"next:dist/server/lib/router-server.js",async modify(r){return r.replaceAll("return socket.end();","").replaceAll(/(\/\/ [a-zA-Z .]+\s+)socket\.end\(\);/g,"")}}),Tt=pe({name:"patch-2",versions:">=13.5.1 <=15.5.0",steps:[ve,Qr,Jr]});var ee=[bt,Tt];var xr=S(H(),1),gr=S(M(),1),Nr=S(re(),1),Ve=S(ur(),1),We=S($r(),1),Ye=S(Or(),1),He=S(Xe(),1);function Ir(r,e){r=new xr.default(r,e);let t=null;for(let s of r.set)for(let{operator:n,semver:{version:o}}of s){if(n===">"||n===">=")continue;let i=new gr.default(o);n==="<"&&(i.patch--,i.raw=i.format()),(!t||(0,Nr.default)(i,t))&&(t=i)}return t}var Oe=oe({name:"patch",description:"Patch the local Next.js installation to support WebSockets",options:[{name:"yes",description:"Skip confirmation prompt for unsupported versions",alias:"y"}],async action(r){let e=ee.map(i=>i.versions).join(" || "),t=Ve.default(e)?.version??e,s=Ir(e)?.version??e,n=await ue();We.default(n,t)&&(B(`Next.js v${n} is not supported, a minimum of v${t} is required`),process.exit(1));let o=ee.find(i=>He.default(n,i.versions));Ye.default(n,s)&&(le(`Next.js v${n} is not officially supported, a maximum of v${s} is recommended.`),r.yes||await Rt("Are you sure you want to proceed?")?(o=ee[ee.length-1],_("Proceeding with the latest patch"),Et("If you encounter any issues please report them at https://github.com/apteryxxyz/next-ws/issues")):(B("Aborted"),process.exit(1))),o||(B(`Next.js v${n} is not supported, please upgrade to a version within the range '${e}'`),process.exit(1)),_(`Patching Next.js v${n} with '${o.versions}'`),await o.execute(),_("Saving patch trace file..."),await Nt({patch:o.versions,version:n}),_("All done!")}});var br=oe({name:"verify",description:"Verify that the local Next.js installation has been patched",options:[{name:"ensure",description:"If not patched, then run the patch command",alias:"e"}],async action(r){let e=await gt();if(!e){if(r.ensure)return le("Next.js has not been patched, running the patch command"),Oe.action({yes:!0});B("Next.js has not been patched, you'll need to run the patch command"),process.exit(1)}await ue()!==e.version&&(B("Next.js has been patched with a different version, you'll need to run the patch command"),process.exit(1)),_("Next.js has been patched!")}});var Tr=st({name:"next-ws",description:"Patch the local Next.js installation to support WebSockets",children:[Oe,br]});Tr.parse([],process.argv.slice(2));
2222
+ };`;
2223
+ sourceLines.splice(constructorEndIndex, 0, setupScript);
2224
+ const newSource = sourceLines.join("\n");
2225
+ return newSource;
2226
+ }
2227
+ });
2228
+ var patchNextTypesPlugin = definePatchStep({
2229
+ title: "Add SOCKET type to Next types",
2230
+ path: "next:dist/build/webpack/plugins/next-types-plugin.js",
2231
+ ignore: "SOCKET?: Function;",
2232
+ async modify(source) {
2233
+ const mapRegex = /\.map\(\(method\)=>`\${method}\?: Function`\).join\(['"]\\n +['"]\)/g;
2234
+ const newSource = source.replace(mapRegex, (m) => `${m} + "; SOCKET?: Function;"`);
2235
+ return newSource;
2236
+ }
2237
+ });
2238
+ var patch_1_default = definePatch({
2239
+ name: "patch-1",
2240
+ versions: ">=13.2.0 <=13.4.8",
2241
+ steps: [patchNextNodeServer, patchNextTypesPlugin]
2242
+ });
2243
+
2244
+ // src/patches/patch-2.ts
2245
+ var patchNextTypesPlugin2 = definePatchStep({
2246
+ ...patchNextTypesPlugin,
2247
+ path: "next:dist/build/webpack/plugins/next-types-plugin/index.js"
2248
+ });
2249
+ var patchRouterServer = definePatchStep({
2250
+ title: "Prevent Next.js from immediately closing WebSocket connections",
2251
+ path: "next:dist/server/lib/router-server.js",
2252
+ async modify(source) {
2253
+ const newSource = source.replaceAll("return socket.end();", "").replaceAll(/(\/\/ [a-zA-Z .]+\s+)socket\.end\(\);/g, "");
2254
+ return newSource;
2255
+ }
2256
+ });
2257
+ var patch_2_default = definePatch({
2258
+ name: "patch-2",
2259
+ versions: ">=13.5.1 <=15.5.0",
2260
+ steps: [patchNextNodeServer, patchRouterServer, patchNextTypesPlugin2]
2261
+ });
2262
+
2263
+ // src/patches/index.ts
2264
+ var patches_default = [patch_1_default, patch_2_default];
2265
+
2266
+ // src/commands/helpers/semver.ts
2267
+ var import_range = __toESM(require_range());
2268
+ var import_semver = __toESM(require_semver());
2269
+ var import_gt = __toESM(require_gt());
2270
+ var import_min_version = __toESM(require_min_version());
2271
+ var import_ltr = __toESM(require_ltr());
2272
+ var import_gtr = __toESM(require_gtr());
2273
+ var import_satisfies = __toESM(require_satisfies());
2274
+ function maxVersion(range, loose) {
2275
+ range = new import_range.default(range, loose);
2276
+ let maximumVersion = null;
2277
+ for (const comparators of range.set) {
2278
+ for (const {
2279
+ operator,
2280
+ semver: { version: version_ }
2281
+ } of comparators) {
2282
+ if (operator === ">" || operator === ">=") continue;
2283
+ const version2 = new import_semver.default(version_);
2284
+ if (operator === "<") {
2285
+ version2.patch--;
2286
+ version2.raw = version2.format();
2287
+ }
2288
+ if (!maximumVersion || (0, import_gt.default)(version2, maximumVersion))
2289
+ maximumVersion = version2;
2290
+ }
2291
+ }
2292
+ return maximumVersion;
2293
+ }
2294
+
2295
+ // src/commands/patch.ts
2296
+ var patch_default = defineCommand({
2297
+ name: "patch",
2298
+ description: "Patch the local Next.js installation to support WebSockets",
2299
+ options: [
2300
+ {
2301
+ name: "yes",
2302
+ description: "Skip confirmation prompt for unsupported versions",
2303
+ alias: "y"
2304
+ }
2305
+ ],
2306
+ async action(options) {
2307
+ const supported = patches_default.map((p) => p.versions).join(" || ");
2308
+ const minimum = import_min_version.default(supported)?.version ?? supported;
2309
+ const maximum = maxVersion(supported)?.version ?? supported;
2310
+ const current = await getNextVersion();
2311
+ if (import_ltr.default(current, minimum)) {
2312
+ error(
2313
+ `Next.js v${current} is not supported, a minimum of v${minimum} is required`
2314
+ );
2315
+ process.exit(1);
2316
+ }
2317
+ let patch = patches_default.find((p) => import_satisfies.default(current, p.versions));
2318
+ if (import_gtr.default(current, maximum)) {
2319
+ warn(
2320
+ `Next.js v${current} is not officially supported, a maximum of v${maximum} is recommended.`
2321
+ );
2322
+ const confirm2 = options.yes || await confirm("Are you sure you want to proceed?");
2323
+ if (confirm2) {
2324
+ patch = patches_default[patches_default.length - 1];
2325
+ info("Proceeding with the latest patch");
2326
+ log(
2327
+ "If you encounter any issues please report them at https://github.com/apteryxxyz/next-ws/issues"
2328
+ );
2329
+ } else {
2330
+ error("Aborted");
2331
+ process.exit(1);
2332
+ }
2333
+ }
2334
+ if (!patch) {
2335
+ error(
2336
+ `Next.js v${current} is not supported, please upgrade to a version within the range '${supported}'`
2337
+ );
2338
+ process.exit(1);
2339
+ }
2340
+ info(`Patching Next.js v${current} with '${patch.versions}'`);
2341
+ await patch.execute();
2342
+ info("Saving patch trace file...");
2343
+ await setTrace({ patch: patch.versions, version: current });
2344
+ info("All done!");
2345
+ }
2346
+ });
2347
+
2348
+ // src/commands/verify.ts
2349
+ var verify_default = defineCommand({
2350
+ name: "verify",
2351
+ description: "Verify that the local Next.js installation has been patched",
2352
+ options: [
2353
+ {
2354
+ name: "ensure",
2355
+ description: "If not patched, then run the patch command",
2356
+ alias: "e"
2357
+ }
2358
+ ],
2359
+ async action(options) {
2360
+ const trace = await getTrace();
2361
+ if (!trace) {
2362
+ if (options.ensure) {
2363
+ warn("Next.js has not been patched, running the patch command");
2364
+ return patch_default.action({ yes: true });
2365
+ } else {
2366
+ error(
2367
+ "Next.js has not been patched, you'll need to run the patch command"
2368
+ );
2369
+ process.exit(1);
2370
+ }
2371
+ }
2372
+ const current = await getNextVersion();
2373
+ if (current !== trace.version) {
2374
+ error(
2375
+ "Next.js has been patched with a different version, you'll need to run the patch command"
2376
+ );
2377
+ process.exit(1);
2378
+ }
2379
+ info("Next.js has been patched!");
2380
+ }
2381
+ });
2382
+
2383
+ // src/commands/index.ts
2384
+ var commands_default = defineCommandGroup({
2385
+ name: "next-ws",
2386
+ description: "Patch the local Next.js installation to support WebSockets",
2387
+ children: [patch_default, verify_default]
2388
+ });
2389
+
2390
+ // src/cli.ts
2391
+ commands_default.parse([], process.argv.slice(2));