@visulima/cerebro 1.1.29 → 1.1.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## @visulima/cerebro [1.1.30](https://github.com/visulima/visulima/compare/@visulima/cerebro@1.1.29...@visulima/cerebro@1.1.30) (2025-01-08)
2
+
3
+
4
+ ### Dependencies
5
+
6
+ * **@visulima/boxen:** upgraded to 1.0.25
7
+ * **@visulima/colorize:** upgraded to 1.4.16
8
+ * **@visulima/find-cache-dir:** upgraded to 1.0.20
9
+ * **@visulima/pail:** upgraded to 2.1.15
10
+ * **@visulima/path:** upgraded to 1.3.1
11
+
1
12
  ## @visulima/cerebro [1.1.29](https://github.com/visulima/visulima/compare/@visulima/cerebro@1.1.28...@visulima/cerebro@1.1.29) (2025-01-08)
2
13
 
3
14
 
@@ -1,3 +1,3 @@
1
- "use strict";var zt=Object.defineProperty;var v=(s,t)=>zt(s,"name",{value:t,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("node:fs"),Dt=require("@visulima/find-cache-dir"),Rt=require("node:https");var Gt=Object.defineProperty,Bt=v((s,t)=>Gt(s,"name",{value:t,configurable:!0}),"o$1");const Ut=Bt((s,t)=>{const e=s.split(".").map(Number),n=t.split(".").map(Number);for(const[i,r]of e.entries()){if(r>n[i])return!0;if(r<n[i])return!1}return!1},"semverGt");var _t=Object.defineProperty,x=v((s,t)=>_t(s,"name",{value:t,configurable:!0}),"w"),Ft=Object.defineProperty,y=x((s,t)=>Ft(s,"name",{value:t,configurable:!0}),"y");function Y(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}v(Y,"Y");x(Y,"Wt");y(Y,"getDefaultExportFromCjs");var K,ut;function tt(){if(ut)return K;ut=1;var s=Object.defineProperty,t=y((r,o)=>s(r,"name",{value:o,configurable:!0}),"u");K=e;function e(r,o,a){r instanceof RegExp&&(r=n(r,a)),o instanceof RegExp&&(o=n(o,a));var h=i(r,o,a);return h&&{start:h[0],end:h[1],pre:a.slice(0,h[0]),body:a.slice(h[0]+r.length,h[1]),post:a.slice(h[1]+o.length)}}v(e,"e"),x(e,"e"),y(e,"balanced"),t(e,"balanced");function n(r,o){var a=o.match(r);return a?a[0]:null}v(n,"s"),x(n,"s"),y(n,"maybeMatch"),t(n,"maybeMatch"),e.range=i;function i(r,o,a){var h,c,l,g,u,p=a.indexOf(r),f=a.indexOf(o,p+1),m=p;if(p>=0&&f>0){if(r===o)return[p,f];for(h=[],l=a.length;m>=0&&!u;)m==p?(h.push(m),p=a.indexOf(r,m+1)):h.length==1?u=[h.pop(),f]:(c=h.pop(),c<l&&(l=c,g=f),f=a.indexOf(o,m+1)),m=p<f&&p>=0?p:f;h.length&&(u=[l,g])}return u}return v(i,"n"),x(i,"r"),y(i,"range"),t(i,"range"),K}v(tt,"xt");x(tt,"Ct");y(tt,"requireBalancedMatch");var Q,ft;function et(){if(ft)return Q;ft=1;var s=Object.defineProperty,t=y((d,O)=>s(d,"name",{value:O,configurable:!0}),"o"),e=tt();Q=u;var n="\0SLASH"+Math.random()+"\0",i="\0OPEN"+Math.random()+"\0",r="\0CLOSE"+Math.random()+"\0",o="\0COMMA"+Math.random()+"\0",a="\0PERIOD"+Math.random()+"\0";function h(d){return parseInt(d,10)==d?parseInt(d,10):d.charCodeAt(0)}v(h,"h"),x(h,"h"),y(h,"numeric"),t(h,"numeric");function c(d){return d.split("\\\\").join(n).split("\\{").join(i).split("\\}").join(r).split("\\,").join(o).split("\\.").join(a)}v(c,"c"),x(c,"c"),y(c,"escapeBraces"),t(c,"escapeBraces");function l(d){return d.split(n).join("\\").split(i).join("{").split(r).join("}").split(o).join(",").split(a).join(".")}v(l,"l"),x(l,"l"),y(l,"unescapeBraces"),t(l,"unescapeBraces");function g(d){if(!d)return[""];var O=[],S=e("{","}",d);if(!S)return d.split(",");var w=S.pre,G=S.body,W=S.post,P=w.split(",");P[P.length-1]+="{"+G+"}";var L=g(W);return W.length&&(P[P.length-1]+=L.shift(),P.push.apply(P,L)),O.push.apply(O,P),O}v(g,"g"),x(g,"g"),y(g,"parseCommaParts"),t(g,"parseCommaParts");function u(d){return d?(d.substr(0,2)==="{}"&&(d="\\{\\}"+d.substr(2)),T(c(d),!0).map(l)):[]}v(u,"u"),x(u,"u"),y(u,"expandTop"),t(u,"expandTop");function p(d){return"{"+d+"}"}v(p,"p"),x(p,"p"),y(p,"embrace"),t(p,"embrace");function f(d){return/^-?0\d/.test(d)}v(f,"f"),x(f,"f"),y(f,"isPadded"),t(f,"isPadded");function m(d,O){return d<=O}v(m,"m"),x(m,"m"),y(m,"lte"),t(m,"lte");function j(d,O){return d>=O}v(j,"O"),x(j,"M"),y(j,"gte"),t(j,"gte");function T(d,O){var S=[],w=e("{","}",d);if(!w)return[d];var G=w.pre,W=w.post.length?T(w.post,!1):[""];if(/\$$/.test(w.pre))for(var P=0;P<W.length;P++){var L=G+"{"+w.body+"}"+W[P];S.push(L)}else{var Tt=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(w.body),it=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(w.body),q=Tt||it,At=w.body.indexOf(",")>=0;if(!q&&!At)return w.post.match(/,.*\}/)?(d=w.pre+"{"+w.body+r+w.post,T(d)):[d];var $;if(q)$=w.body.split(/\.\./);else if($=g(w.body),$.length===1&&($=T($[0],!1).map(p),$.length===1))return W.map(function(Lt){return w.pre+$[0]+Lt});var z;if(q){var ot=h($[0]),at=h($[1]),Ct=Math.max($[0].length,$[1].length),ht=$.length==3?Math.abs(h($[2])):1,ct=m,kt=at<ot;kt&&(ht*=-1,ct=j);var Wt=$.some(f);z=[];for(var B=ot;ct(B,at);B+=ht){var k;if(it)k=String.fromCharCode(B),k==="\\"&&(k="");else if(k=String(B),Wt){var lt=Ct-k.length;if(lt>0){var pt=new Array(lt+1).join("0");B<0?k="-"+pt+k.slice(1):k=pt+k}}z.push(k)}}else{z=[];for(var D=0;D<$.length;D++)z.push.apply(z,T($[D],!1))}for(var D=0;D<z.length;D++)for(var P=0;P<W.length;P++){var L=G+z[D]+W[P];(!O||q||L)&&S.push(L)}}return S}return v(T,"$"),x(T,"A"),y(T,"expand"),t(T,"expand"),Q}v(et,"St");x(et,"Rt");y(et,"requireBraceExpansion");var Zt=et();const qt=Y(Zt);var It=Object.defineProperty,Jt=y((s,t)=>It(s,"name",{value:t,configurable:!0}),"r");const J=Jt(s=>{if(typeof s!="string")throw new TypeError("invalid pattern");if(s.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var Ht=Object.defineProperty,H=y((s,t)=>Ht(s,"name",{value:t,configurable:!0}),"p$1");const Vt={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},U=H(s=>s.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),Kt=H(s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),gt=H(s=>s.join(""),"rangesToString"),Qt=H((s,t)=>{const e=t;if(s.charAt(e)!=="[")throw new Error("not in a brace expression");const n=[],i=[];let r=e+1,o=!1,a=!1,h=!1,c=!1,l=e,g="";t:for(;r<s.length;){const f=s.charAt(r);if((f==="!"||f==="^")&&r===e+1){c=!0,r++;continue}if(f==="]"&&o&&!h){l=r+1;break}if(o=!0,f==="\\"&&!h){h=!0,r++;continue}if(f==="["&&!h){for(const[m,[j,T,d]]of Object.entries(Vt))if(s.startsWith(m,r)){if(g)return["$.",!1,s.length-e,!0];r+=m.length,d?i.push(j):n.push(j),a=a||T;continue t}}if(h=!1,g){f>g?n.push(U(g)+"-"+U(f)):f===g&&n.push(U(f)),g="",r++;continue}if(s.startsWith("-]",r+1)){n.push(U(f+"-")),r+=2;continue}if(s.startsWith("-",r+1)){g=f,r+=2;continue}n.push(U(f)),r++}if(l<r)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,s.length-e,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!c){const f=n[0].length===2?n[0].slice(-1):n[0];return[Kt(f),!1,l-e,!1]}const u="["+(c?"^":"")+gt(n)+"]",p="["+(c?"":"^")+gt(i)+"]";return[n.length&&i.length?"("+u+"|"+p+")":n.length?u:p,a,l-e,!0]},"parseClass");var Xt=Object.defineProperty,Yt=y((s,t)=>Xt(s,"name",{value:t,configurable:!0}),"a$2");const _=Yt((s,{windowsPathsNoEscape:t=!1}={})=>t?s.replace(/\[([^\/\\])\]/g,"$1"):s.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),"unescape");var te=Object.defineProperty,st=y((s,t)=>te(s,"name",{value:t,configurable:!0}),"E$1");const ee=new Set(["!","?","+","*","@"]),dt=st(s=>ee.has(s),"isExtglobType"),se="(?!(?:^|/)\\.\\.?(?:$|/))",I="(?!\\.)",ne=new Set(["[","."]),re=new Set(["..","."]),ie=new Set("().*{}+?[]^$\\!"),oe=st(s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),nt="[^/]",mt=nt+"*?",bt=nt+"+?";class M{static{v(this,"A")}static{x(this,"O")}static{y(this,"AST")}static{st(this,"AST")}type;#s;#n;#i=!1;#t=[];#e;#o;#h;#a=!1;#r;#c;#p=!1;constructor(t,e,n={}){this.type=t,t&&(this.#n=!0),this.#e=e,this.#s=this.#e?this.#e.#s:this,this.#r=this.#s===this?n:this.#s.#r,this.#h=this.#s===this?[]:this.#s.#h,t==="!"&&!this.#s.#a&&this.#h.push(this),this.#o=this.#e?this.#e.#t.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(const t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#n=!0;return this.#n}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#c=this.#t.map(t=>String(t)).join("")}#f(){if(this!==this.#s)throw new Error("should only call on root");if(this.#a)return this;this.toString(),this.#a=!0;let t;for(;t=this.#h.pop();){if(t.type!=="!")continue;let e=t,n=e.#e;for(;n;){for(let i=e.#o+1;!n.type&&i<n.#t.length;i++)for(const r of t.#t){if(typeof r=="string")throw new Error("string part in extglob AST??");r.copyIn(n.#t[i])}e=n,n=e.#e}}return this}push(...t){for(const e of t)if(e!==""){if(typeof e!="string"&&!(e instanceof M&&e.#e===this))throw new Error("invalid part: "+e);this.#t.push(e)}}toJSON(){const t=this.type===null?this.#t.slice().map(e=>typeof e=="string"?e:e.toJSON()):[this.type,...this.#t.map(e=>e.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#s||this.#s.#a&&this.#e?.type==="!")&&t.push({}),t}isStart(){if(this.#s===this)return!0;if(!this.#e?.isStart())return!1;if(this.#o===0)return!0;const t=this.#e;for(let e=0;e<this.#o;e++){const n=t.#t[e];if(!(n instanceof M&&n.type==="!"))return!1}return!0}isEnd(){if(this.#s===this||this.#e?.type==="!")return!0;if(!this.#e?.isEnd())return!1;if(!this.type)return this.#e?.isEnd();const t=this.#e?this.#e.#t.length:0;return this.#o===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){const e=new M(this.type,t);for(const n of this.#t)e.copyIn(n);return e}static#l(t,e,n,i){let r=!1,o=!1,a=-1,h=!1;if(e.type===null){let p=n,f="";for(;p<t.length;){const m=t.charAt(p++);if(r||m==="\\"){r=!r,f+=m;continue}if(o){p===a+1?(m==="^"||m==="!")&&(h=!0):m==="]"&&!(p===a+2&&h)&&(o=!1),f+=m;continue}else if(m==="["){o=!0,a=p,h=!1,f+=m;continue}if(!i.noext&&dt(m)&&t.charAt(p)==="("){e.push(f),f="";const j=new M(m,e);p=M.#l(t,j,p,i),e.push(j);continue}f+=m}return e.push(f),p}let c=n+1,l=new M(null,e);const g=[];let u="";for(;c<t.length;){const p=t.charAt(c++);if(r||p==="\\"){r=!r,u+=p;continue}if(o){c===a+1?(p==="^"||p==="!")&&(h=!0):p==="]"&&!(c===a+2&&h)&&(o=!1),u+=p;continue}else if(p==="["){o=!0,a=c,h=!1,u+=p;continue}if(dt(p)&&t.charAt(c)==="("){l.push(u),u="";const f=new M(p,l);l.push(f),c=M.#l(t,f,c,i);continue}if(p==="|"){l.push(u),u="",g.push(l),l=new M(null,e);continue}if(p===")")return u===""&&e.#t.length===0&&(e.#p=!0),l.push(u),u="",e.push(...g,l),c;u+=p}return e.type=null,e.#n=void 0,e.#t=[t.substring(n-1)],c}static fromGlob(t,e={}){const n=new M(null,void 0,e);return M.#l(t,n,0,e),n}toMMPattern(){if(this!==this.#s)return this.#s.toMMPattern();const t=this.toString(),[e,n,i,r]=this.toRegExpSource();if(!(i||this.#n||this.#r.nocase&&!this.#r.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return n;const o=(this.#r.nocase?"i":"")+(r?"u":"");return Object.assign(new RegExp(`^${e}$`,o),{_src:e,_glob:t})}get options(){return this.#r}toRegExpSource(t){const e=t??!!this.#r.dot;if(this.#s===this&&this.#f(),!this.type){const h=this.isStart()&&this.isEnd(),c=this.#t.map(u=>{const[p,f,m,j]=typeof u=="string"?M.#g(u,this.#n,h):u.toRegExpSource(t);return this.#n=this.#n||m,this.#i=this.#i||j,p}).join("");let l="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&re.has(this.#t[0]))){const u=ne,p=e&&u.has(c.charAt(0))||c.startsWith("\\.")&&u.has(c.charAt(2))||c.startsWith("\\.\\.")&&u.has(c.charAt(4)),f=!e&&!t&&u.has(c.charAt(0));l=p?se:f?I:""}let g="";return this.isEnd()&&this.#s.#a&&this.#e?.type==="!"&&(g="(?:$|\\/)"),[l+c+g,_(c),this.#n=!!this.#n,this.#i]}const n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:";let r=this.#u(e);if(this.isStart()&&this.isEnd()&&!r&&this.type!=="!"){const h=this.toString();return this.#t=[h],this.type=null,this.#n=void 0,[h,_(this.toString()),!1,!1]}let o=!n||t||e||!I?"":this.#u(!0);o===r&&(o=""),o&&(r=`(?:${r})(?:${o})*?`);let a="";if(this.type==="!"&&this.#p)a=(this.isStart()&&!e?I:"")+bt;else{const h=this.type==="!"?"))"+(this.isStart()&&!e&&!t?I:"")+mt+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+r+h}return[a,_(r),this.#n=!!this.#n,this.#i]}#u(t){return this.#t.map(e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");const[n,i,r,o]=e.toRegExpSource(t);return this.#i=this.#i||o,n}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join("|")}static#g(t,e,n=!1){let i=!1,r="",o=!1;for(let a=0;a<t.length;a++){const h=t.charAt(a);if(i){i=!1,r+=(ie.has(h)?"\\":"")+h;continue}if(h==="\\"){a===t.length-1?r+="\\\\":i=!0;continue}if(h==="["){const[c,l,g,u]=Qt(t,a);if(g){r+=c,o=o||l,a+=g-1,e=e||u;continue}}if(h==="*"){n&&t==="*"?r+=bt:r+=mt,e=!0;continue}if(h==="?"){r+=nt,e=!0;continue}r+=oe(h)}return[r,_(t),!!e,o]}}var ae=Object.defineProperty,he=y((s,t)=>ae(s,"name",{value:t,configurable:!0}),"a$1");const ce=he((s,{windowsPathsNoEscape:t=!1}={})=>t?s.replace(/[?*()[\]]/g,"[$&]"):s.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var le=Object.defineProperty,b=y((s,t)=>le(s,"name",{value:t,configurable:!0}),"h$1");const E=b((s,t,e={})=>(J(t),!e.nocomment&&t.charAt(0)==="#"?!1:new V(t,e).match(s)),"minimatch"),pe=/^\*+([^+@!?\*\[\(]*)$/,ue=b(s=>t=>!t.startsWith(".")&&t.endsWith(s),"starDotExtTest"),fe=b(s=>t=>t.endsWith(s),"starDotExtTestDot"),ge=b(s=>(s=s.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(s)),"starDotExtTestNocase"),de=b(s=>(s=s.toLowerCase(),t=>t.toLowerCase().endsWith(s)),"starDotExtTestNocaseDot"),me=/^\*+\.\*+$/,be=b(s=>!s.startsWith(".")&&s.includes("."),"starDotStarTest"),ye=b(s=>s!=="."&&s!==".."&&s.includes("."),"starDotStarTestDot"),ve=/^\.\*+$/,we=b(s=>s!=="."&&s!==".."&&s.startsWith("."),"dotStarTest"),xe=/^\*+$/,Oe=b(s=>s.length!==0&&!s.startsWith("."),"starTest"),$e=b(s=>s.length!==0&&s!=="."&&s!=="..","starTestDot"),Ee=/^\?+([^+@!?\*\[\(]*)?$/,Se=b(([s,t=""])=>{const e=xt([s]);return t?(t=t.toLowerCase(),n=>e(n)&&n.toLowerCase().endsWith(t)):e},"qmarksTestNocase"),Pe=b(([s,t=""])=>{const e=Ot([s]);return t?(t=t.toLowerCase(),n=>e(n)&&n.toLowerCase().endsWith(t)):e},"qmarksTestNocaseDot"),Me=b(([s,t=""])=>{const e=Ot([s]);return t?n=>e(n)&&n.endsWith(t):e},"qmarksTestDot"),je=b(([s,t=""])=>{const e=xt([s]);return t?n=>e(n)&&n.endsWith(t):e},"qmarksTest"),xt=b(([s])=>{const t=s.length;return e=>e.length===t&&!e.startsWith(".")},"qmarksTestNoExt"),Ot=b(([s])=>{const t=s.length;return e=>e.length===t&&e!=="."&&e!==".."},"qmarksTestNoExtDot"),$t=process?process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",yt={win32:{sep:"\\"},posix:{sep:"/"}},Ne=$t==="win32"?yt.win32.sep:yt.posix.sep;E.sep=Ne;const C=Symbol("globstar **");E.GLOBSTAR=C;const Te="[^/]",Ae=Te+"*?",Ce="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",ke="(?:(?!(?:\\/|^)\\.).)*?",We=b((s,t={})=>e=>E(e,s,t),"filter");E.filter=We;const A=b((s,t={})=>Object.assign({},s,t),"ext"),Le=b(s=>{if(!s||typeof s!="object"||!Object.keys(s).length)return E;const t=E;return Object.assign(b((e,n,i={})=>t(e,n,A(s,i)),"m"),{Minimatch:class extends t.Minimatch{static{v(this,"Minimatch")}static{x(this,"Minimatch")}static{y(this,"Minimatch")}static{b(this,"Minimatch")}constructor(e,n={}){super(e,A(s,n))}static defaults(e){return t.defaults(A(s,e)).Minimatch}},AST:class extends t.AST{static{v(this,"AST")}static{x(this,"AST")}static{y(this,"AST")}static{b(this,"AST")}constructor(e,n,i={}){super(e,n,A(s,i))}static fromGlob(e,n={}){return t.AST.fromGlob(e,A(s,n))}},unescape:b((e,n={})=>t.unescape(e,A(s,n)),"unescape"),escape:b((e,n={})=>t.escape(e,A(s,n)),"escape"),filter:b((e,n={})=>t.filter(e,A(s,n)),"filter"),defaults:b(e=>t.defaults(A(s,e)),"defaults"),makeRe:b((e,n={})=>t.makeRe(e,A(s,n)),"makeRe"),braceExpand:b((e,n={})=>t.braceExpand(e,A(s,n)),"braceExpand"),match:b((e,n,i={})=>t.match(e,n,A(s,i)),"match"),sep:t.sep,GLOBSTAR:C})},"defaults");E.defaults=Le;const Et=b((s,t={})=>(J(s),t.nobrace||!/\{(?:(?!\{).)*\}/.test(s)?[s]:qt(s)),"braceExpand");E.braceExpand=Et;const ze=b((s,t={})=>new V(s,t).makeRe(),"makeRe");E.makeRe=ze;const De=b((s,t,e={})=>{const n=new V(t,e);return s=s.filter(i=>n.match(i)),n.options.nonull&&!s.length&&s.push(t),s},"match");E.match=De;const vt=/[?*]|[+@!]\(.*?\)|\[|\]/,Re=b(s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape");class V{static{v(this,"U")}static{x(this,"H")}static{y(this,"Minimatch")}static{b(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){J(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||$t,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const e of t)if(typeof e!="string")return!0;return!1}debug(...t){}make(){const t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...r)=>console.error(...r)),this.debug(this.pattern,this.globSet);const n=this.globSet.map(r=>this.slashSplit(r));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let i=this.globParts.map((r,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){const h=r[0]===""&&r[1]===""&&(r[2]==="?"||!vt.test(r[2]))&&!vt.test(r[3]),c=/^[a-z]:/i.test(r[0]);if(h)return[...r.slice(0,4),...r.slice(4).map(l=>this.parse(l))];if(c)return[r[0],...r.slice(1).map(l=>this.parse(l))]}return r.map(h=>this.parse(h))});if(this.debug(this.pattern,i),this.set=i.filter(r=>r.indexOf(!1)===-1),this.isWindows)for(let r=0;r<this.set.length;r++){const o=this.set[r];o[0]===""&&o[1]===""&&this.globParts[r][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let n=0;n<t.length;n++)for(let i=0;i<t[n].length;i++)t[n][i]==="**"&&(t[n][i]="*");const{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let n=-1;for(;(n=e.indexOf("**",n+1))!==-1;){let i=n;for(;e[i+1]==="**";)i++;i!==n&&e.splice(n,i-n)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((n,i)=>{const r=n[n.length-1];return i==="**"&&r==="**"?n:i===".."&&r&&r!==".."&&r!=="."&&r!=="**"?(n.pop(),n):(n.push(i),n)},[]),e.length===0?[""]:e))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let i=1;i<t.length-1;i++){const r=t[i];i===1&&r===""&&t[0]===""||(r==="."||r==="")&&(e=!0,t.splice(i,1),i--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(e=!0,t.pop())}let n=0;for(;(n=t.indexOf("..",n+1))!==-1;){const i=t[n-1];i&&i!=="."&&i!==".."&&i!=="**"&&(e=!0,t.splice(n-1,2),n-=2)}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let n of t){let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let o=i;for(;n[o+1]==="**";)o++;o>i&&n.splice(i+1,o-i);let a=n[i+1];const h=n[i+2],c=n[i+3];if(a!==".."||!h||h==="."||h===".."||!c||c==="."||c==="..")continue;e=!0,n.splice(i,1);const l=n.slice(0);l[i]="**",t.push(l),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){const a=n[o];o===1&&a===""&&n[0]===""||(a==="."||a==="")&&(e=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(e=!0,n.pop())}let r=0;for(;(r=n.indexOf("..",r+1))!==-1;){const o=n[r-1];if(o&&o!=="."&&o!==".."&&o!=="**"){e=!0;const a=r===1&&n[r+1]==="**"?["."]:[];n.splice(r-1,2,...a),n.length===0&&n.push(""),r-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let n=e+1;n<t.length;n++){const i=this.partsMatch(t[e],t[n],!this.preserveMultipleSlashes);if(i){t[e]=[],t[n]=i;break}}return t.filter(e=>e.length)}partsMatch(t,e,n=!1){let i=0,r=0,o=[],a="";for(;i<t.length&&r<e.length;)if(t[i]===e[r])o.push(a==="b"?e[r]:t[i]),i++,r++;else if(n&&t[i]==="**"&&e[r]===t[i+1])o.push(t[i]),i++;else if(n&&e[r]==="**"&&t[i]===e[r+1])o.push(e[r]),r++;else if(t[i]==="*"&&e[r]&&(this.options.dot||!e[r].startsWith("."))&&e[r]!=="**"){if(a==="b")return!1;a="a",o.push(t[i]),i++,r++}else if(e[r]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(a==="a")return!1;a="b",o.push(e[r]),i++,r++}else return!1;return t.length===e.length&&o}parseNegate(){if(this.nonegate)return;const t=this.pattern;let e=!1,n=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)e=!e,n++;n&&(this.pattern=t.slice(n)),this.negate=e}matchOne(t,e,n=!1){const i=this.options;if(this.isWindows){const m=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),j=!m&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),T=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),d=!T&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3]),O=j?3:m?0:void 0,S=d?3:T?0:void 0;if(typeof O=="number"&&typeof S=="number"){const[w,G]=[t[O],e[S]];w.toLowerCase()===G.toLowerCase()&&(e[S]=w,S>O?e=e.slice(S):O>S&&(t=t.slice(O)))}}const{optimizationLevel:r=1}=this.options;r>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var o=0,a=0,h=t.length,c=e.length;o<h&&a<c;o++,a++){this.debug("matchOne loop");var l=e[a],g=t[o];if(this.debug(e,l,g),l===!1)return!1;if(l===C){this.debug("GLOBSTAR",[e,l,g]);var u=o,p=a+1;if(p===c){for(this.debug("** at the end");o<h;o++)if(t[o]==="."||t[o]===".."||!i.dot&&t[o].charAt(0)===".")return!1;return!0}for(;u<h;){var f=t[u];if(this.debug(`
2
- globstar while`,t,u,e,p,f),this.matchOne(t.slice(u),e.slice(p),n))return this.debug("globstar found match!",u,h,f),!0;if(f==="."||f===".."||!i.dot&&f.charAt(0)==="."){this.debug("dot detected!",t,u,e,p);break}this.debug("globstar swallow a segment, and continue"),u++}return!!(n&&(this.debug(`
3
- >>> no match, partial?`,t,u,e,p),u===h))}let m;if(typeof l=="string"?(m=g===l,this.debug("string match",l,g,m)):(m=l.test(g),this.debug("pattern match",l,g,m)),!m)return!1}if(o===h&&a===c)return!0;if(o===h)return n;if(a===c)return o===h-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return Et(this.pattern,this.options)}parse(t){J(t);const e=this.options;if(t==="**")return C;if(t==="")return"";let n,i=null;(n=t.match(xe))?i=e.dot?$e:Oe:(n=t.match(pe))?i=(e.nocase?e.dot?de:ge:e.dot?fe:ue)(n[1]):(n=t.match(Ee))?i=(e.nocase?e.dot?Pe:Se:e.dot?Me:je)(n):(n=t.match(me))?i=e.dot?ye:be:(n=t.match(ve))&&(i=we);const r=M.fromGlob(t,this.options).toMMPattern();return i&&typeof r=="object"&&Reflect.defineProperty(r,"test",{value:i}),r}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const e=this.options,n=e.noglobstar?Ae:e.dot?Ce:ke,i=new Set(e.nocase?["i"]:[]);let r=t.map(h=>{const c=h.map(l=>{if(l instanceof RegExp)for(const g of l.flags.split(""))i.add(g);return typeof l=="string"?Re(l):l===C?C:l._src});return c.forEach((l,g)=>{const u=c[g+1],p=c[g-1];l!==C||p===C||(p===void 0?u!==void 0&&u!==C?c[g+1]="(?:\\/|"+n+"\\/)?"+u:c[g]=n:u===void 0?c[g-1]=p+"(?:\\/|"+n+")?":u!==C&&(c[g-1]=p+"(?:\\/|\\/"+n+"\\/)"+u,c[g+1]=C))}),c.filter(l=>l!==C).join("/")}).join("|");const[o,a]=t.length>1?["(?:",")"]:["",""];r="^"+o+r+a+"$",this.negate&&(r="^(?!"+r+").+$");try{this.regexp=new RegExp(r,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;const n=this.options;this.isWindows&&(t=t.split("\\").join("/"));const i=this.slashSplit(t);this.debug(this.pattern,"split",i);const r=this.set;this.debug(this.pattern,"set",r);let o=i[i.length-1];if(!o)for(let a=i.length-2;!o&&a>=0;a--)o=i[a];for(let a=0;a<r.length;a++){const h=r[a];let c=i;if(n.matchBase&&h.length===1&&(c=[o]),this.matchOne(c,h,e))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(t){return E.defaults(t).Minimatch}}E.AST=M;E.Minimatch=V;E.escape=ce;E.unescape=_;var Ge=Object.defineProperty,Be=y((s,t)=>Ge(s,"name",{value:t,configurable:!0}),"t");const Ue=/^[A-Z]:\//i,R=Be((s="")=>s&&s.replaceAll("\\","/").replace(Ue,t=>t.toUpperCase()),"normalizeWindowsPath");var _e=Object.defineProperty,N=y((s,t)=>_e(s,"name",{value:t,configurable:!0}),"s");const Fe=/^[/\\]{2}/,Ze=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,St=/^[A-Z]:$/i,wt=/^\/([A-Z]:)?$/i,qe=/.(\.[^./]+)$/,Ie=/^[/\\]|^[a-z]:[/\\]/i,Je=N(()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd"),Pt=N((s,t)=>{let e="",n=0,i=-1,r=0,o=null;for(let a=0;a<=s.length;++a){if(a<s.length)o=s[a];else{if(o==="/")break;o="/"}if(o==="/"){if(!(i===a-1||r===1))if(r===2){if(e.length<2||n!==2||!e.endsWith(".")||e.at(-2)!=="."){if(e.length>2){const h=e.lastIndexOf("/");h===-1?(e="",n=0):(e=e.slice(0,h),n=e.length-1-e.lastIndexOf("/")),i=a,r=0;continue}else if(e.length>0){e="",n=0,i=a,r=0;continue}}t&&(e+=e.length>0?"/..":"..",n=2)}else e.length>0?e+=`/${s.slice(i+1,a)}`:e=s.slice(i+1,a),n=a-i-1;i=a,r=0}else o==="."&&r!==-1?++r:r=-1}return e},"normalizeString"),Z=N(s=>Ze.test(s),"isAbsolute"),Mt=N(function(s){if(s.length===0)return".";s=R(s);const t=Fe.exec(s),e=Z(s),n=s.at(-1)==="/";return s=Pt(s,!e),s.length===0?e?"/":n?"./":".":(n&&(s+="/"),St.test(s)&&(s+="/"),t?e?`//${s}`:`//./${s}`:e&&!Z(s)?`/${s}`:s)},"normalize"),He=N(function(...s){if(s.length===0)return".";let t;for(const e of s)e&&e.length>0&&(t===void 0?t=e:t+=`/${e}`);return t===void 0?".":Mt(t.replaceAll(/\/{2,}/g,"/"))},"join"),X=N(function(...s){s=s.map(n=>R(n));let t="",e=!1;for(let n=s.length-1;n>=-1&&!e;n--){const i=n>=0?s[n]:Je();!i||i.length===0||(t=`${i}/${t}`,e=Z(i))}return t=Pt(t,!e),e&&!Z(t)?`/${t}`:t.length>0?t:"."},"resolve");N(function(s){return R(s)},"toNamespacedPath");const Ve=N(function(s){return qe.exec(R(s))?.[1]??""},"extname");N(function(s,t){const e=X(s).replace(wt,"$1").split("/"),n=X(t).replace(wt,"$1").split("/");if(n[0][1]===":"&&e[0][1]===":"&&e[0]!==n[0])return n.join("/");const i=[...e];for(const r of i){if(n[0]!==r)break;e.shift(),n.shift()}return[...e.map(()=>".."),...n].join("/")},"relative");const jt=N(s=>{const t=R(s).replace(/\/$/,"").split("/").slice(0,-1);return t.length===1&&St.test(t[0])&&(t[0]+="/"),t.join("/")||(Z(s)?"/":".")},"dirname");N(function(s){const t=[s.root,s.dir,s.base??s.name+s.ext].filter(Boolean);return R(s.root?X(...t):t.join("/"))},"format");const Ke=N((s,t)=>{const e=R(s).split("/").pop();return t&&e.endsWith(t)?e.slice(0,-t.length):e},"basename");N(function(s){const t=Ie.exec(s)?.[0]?.replace(/\\/g,"/")??"",e=Ke(s),n=Ve(e);return{base:e,dir:jt(s),ext:n,name:e.slice(0,e.length-n.length),root:t}},"parse");N((s,t)=>E(Mt(s),t,{nocaseMagicOnly:!0,nocomment:!0,nonegate:!0,optimizationLevel:2,windowsPathsNoEscape:!0}),"matchesGlob");var Qe=Object.defineProperty,rt=v((s,t)=>Qe(s,"name",{value:t,configurable:!0}),"r");const Xe="last-update-check.json",Nt=rt(s=>{const t=Dt.findCacheDirSync(s);if(t===void 0)throw new Error("Could not find cache directory");return He(t,Xe)},"getConfigFile"),Ye=rt(s=>{const t=Nt(s);try{if(!F.existsSync(t))return;const{lastUpdateCheck:e}=JSON.parse(F.readFileSync(t,"utf8"));return e}catch{return}},"getLastUpdate"),ts=rt(s=>{const t=Nt(s),e=jt(t);F.existsSync(e)||F.mkdirSync(e,{recursive:!0}),F.writeFileSync(t,JSON.stringify({lastUpdateCheck:Date.now()}))},"saveLastUpdate");var es=Object.defineProperty,ss=v((s,t)=>es(s,"name",{value:t,configurable:!0}),"g");const ns=ss(async(s,t,e)=>{const n=e.replace("__NAME__",s);return await new Promise((i,r)=>{Rt.get(n,o=>{let a="";o.on("data",h=>a+=h),o.on("end",()=>{try{const h=JSON.parse(a)[t];h||r(new Error("Error getting version")),i(h)}catch{r(new Error("Could not parse version response"))}})}).on("error",o=>r(o))})},"getDistributionVersion");var rs=Object.defineProperty,is=v((s,t)=>rs(s,"name",{value:t,configurable:!0}),"i");const os=is(async({alwaysRun:s,debug:t,distTag:e="latest",pkg:n,registryUrl:i="https://registry.npmjs.org/-/package/__NAME__/dist-tags",updateCheckInterval:r=1e3*60*60*24})=>{const o=Ye(n.name);if(s||!o||o<Date.now()-r){const a=await ns(n.name,e,i);if(ts(n.name),Ut(a,n.version))return a;t&&console.error(`Latest version (${a}) not newer than current version (${n.version})`)}else t&&console.error(`Too recent to check for a new update. simpleUpdateNotifier() interval set to ${r}ms but only ${Date.now()-o}ms since last check.`);return null},"hasNewVersion");exports.default=os;
1
+ "use strict";var zt=Object.defineProperty;var v=(s,t)=>zt(s,"name",{value:t,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("node:fs"),Dt=require("@visulima/find-cache-dir"),Rt=require("node:https");var Gt=Object.defineProperty,Bt=v((s,t)=>Gt(s,"name",{value:t,configurable:!0}),"o$1");const Ut=Bt((s,t)=>{const e=s.split(".").map(Number),i=t.split(".").map(Number);for(const[n,r]of e.entries()){if(r>i[n])return!0;if(r<i[n])return!1}return!1},"semverGt");var _t=Object.defineProperty,x=v((s,t)=>_t(s,"name",{value:t,configurable:!0}),"w"),Ft=Object.defineProperty,y=x((s,t)=>Ft(s,"name",{value:t,configurable:!0}),"y");function Y(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}v(Y,"Y");x(Y,"Wt");y(Y,"getDefaultExportFromCjs");var K,ut;function tt(){if(ut)return K;ut=1;var s=Object.defineProperty,t=y((r,o)=>s(r,"name",{value:o,configurable:!0}),"u");K=e;function e(r,o,a){r instanceof RegExp&&(r=i(r,a)),o instanceof RegExp&&(o=i(o,a));var h=n(r,o,a);return h&&{start:h[0],end:h[1],pre:a.slice(0,h[0]),body:a.slice(h[0]+r.length,h[1]),post:a.slice(h[1]+o.length)}}v(e,"e"),x(e,"e"),y(e,"balanced"),t(e,"balanced");function i(r,o){var a=o.match(r);return a?a[0]:null}v(i,"s"),x(i,"s"),y(i,"maybeMatch"),t(i,"maybeMatch"),e.range=n;function n(r,o,a){var h,c,l,g,u,p=a.indexOf(r),f=a.indexOf(o,p+1),m=p;if(p>=0&&f>0){if(r===o)return[p,f];for(h=[],l=a.length;m>=0&&!u;)m==p?(h.push(m),p=a.indexOf(r,m+1)):h.length==1?u=[h.pop(),f]:(c=h.pop(),c<l&&(l=c,g=f),f=a.indexOf(o,m+1)),m=p<f&&p>=0?p:f;h.length&&(u=[l,g])}return u}return v(n,"i"),x(n,"r"),y(n,"range"),t(n,"range"),K}v(tt,"xt");x(tt,"Ct");y(tt,"requireBalancedMatch");var Q,ft;function et(){if(ft)return Q;ft=1;var s=Object.defineProperty,t=y((d,O)=>s(d,"name",{value:O,configurable:!0}),"o"),e=tt();Q=u;var i="\0SLASH"+Math.random()+"\0",n="\0OPEN"+Math.random()+"\0",r="\0CLOSE"+Math.random()+"\0",o="\0COMMA"+Math.random()+"\0",a="\0PERIOD"+Math.random()+"\0";function h(d){return parseInt(d,10)==d?parseInt(d,10):d.charCodeAt(0)}v(h,"h"),x(h,"h"),y(h,"numeric"),t(h,"numeric");function c(d){return d.split("\\\\").join(i).split("\\{").join(n).split("\\}").join(r).split("\\,").join(o).split("\\.").join(a)}v(c,"c"),x(c,"c"),y(c,"escapeBraces"),t(c,"escapeBraces");function l(d){return d.split(i).join("\\").split(n).join("{").split(r).join("}").split(o).join(",").split(a).join(".")}v(l,"l"),x(l,"l"),y(l,"unescapeBraces"),t(l,"unescapeBraces");function g(d){if(!d)return[""];var O=[],S=e("{","}",d);if(!S)return d.split(",");var w=S.pre,G=S.body,W=S.post,P=w.split(",");P[P.length-1]+="{"+G+"}";var L=g(W);return W.length&&(P[P.length-1]+=L.shift(),P.push.apply(P,L)),O.push.apply(O,P),O}v(g,"g"),x(g,"g"),y(g,"parseCommaParts"),t(g,"parseCommaParts");function u(d){return d?(d.substr(0,2)==="{}"&&(d="\\{\\}"+d.substr(2)),j(c(d),!0).map(l)):[]}v(u,"u"),x(u,"u"),y(u,"expandTop"),t(u,"expandTop");function p(d){return"{"+d+"}"}v(p,"p"),x(p,"p"),y(p,"embrace"),t(p,"embrace");function f(d){return/^-?0\d/.test(d)}v(f,"f"),x(f,"f"),y(f,"isPadded"),t(f,"isPadded");function m(d,O){return d<=O}v(m,"m"),x(m,"m"),y(m,"lte"),t(m,"lte");function A(d,O){return d>=O}v(A,"O"),x(A,"M"),y(A,"gte"),t(A,"gte");function j(d,O){var S=[],w=e("{","}",d);if(!w)return[d];var G=w.pre,W=w.post.length?j(w.post,!1):[""];if(/\$$/.test(w.pre))for(var P=0;P<W.length;P++){var L=G+"{"+w.body+"}"+W[P];S.push(L)}else{var jt=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(w.body),nt=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(w.body),q=jt||nt,Tt=w.body.indexOf(",")>=0;if(!q&&!Tt)return w.post.match(/,.*\}/)?(d=w.pre+"{"+w.body+r+w.post,j(d)):[d];var $;if(q)$=w.body.split(/\.\./);else if($=g(w.body),$.length===1&&($=j($[0],!1).map(p),$.length===1))return W.map(function(Lt){return w.pre+$[0]+Lt});var z;if(q){var ot=h($[0]),at=h($[1]),Ct=Math.max($[0].length,$[1].length),ht=$.length==3?Math.abs(h($[2])):1,ct=m,kt=at<ot;kt&&(ht*=-1,ct=A);var Wt=$.some(f);z=[];for(var B=ot;ct(B,at);B+=ht){var k;if(nt)k=String.fromCharCode(B),k==="\\"&&(k="");else if(k=String(B),Wt){var lt=Ct-k.length;if(lt>0){var pt=new Array(lt+1).join("0");B<0?k="-"+pt+k.slice(1):k=pt+k}}z.push(k)}}else{z=[];for(var D=0;D<$.length;D++)z.push.apply(z,j($[D],!1))}for(var D=0;D<z.length;D++)for(var P=0;P<W.length;P++){var L=G+z[D]+W[P];(!O||q||L)&&S.push(L)}}return S}return v(j,"$"),x(j,"A"),y(j,"expand"),t(j,"expand"),Q}v(et,"St");x(et,"Rt");y(et,"requireBraceExpansion");var Zt=et();const qt=Y(Zt);var It=Object.defineProperty,Jt=y((s,t)=>It(s,"name",{value:t,configurable:!0}),"r$1");const J=Jt(s=>{if(typeof s!="string")throw new TypeError("invalid pattern");if(s.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var Ht=Object.defineProperty,H=y((s,t)=>Ht(s,"name",{value:t,configurable:!0}),"p$1");const Vt={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},U=H(s=>s.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),Kt=H(s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),gt=H(s=>s.join(""),"rangesToString"),Qt=H((s,t)=>{const e=t;if(s.charAt(e)!=="[")throw new Error("not in a brace expression");const i=[],n=[];let r=e+1,o=!1,a=!1,h=!1,c=!1,l=e,g="";t:for(;r<s.length;){const f=s.charAt(r);if((f==="!"||f==="^")&&r===e+1){c=!0,r++;continue}if(f==="]"&&o&&!h){l=r+1;break}if(o=!0,f==="\\"&&!h){h=!0,r++;continue}if(f==="["&&!h){for(const[m,[A,j,d]]of Object.entries(Vt))if(s.startsWith(m,r)){if(g)return["$.",!1,s.length-e,!0];r+=m.length,d?n.push(A):i.push(A),a=a||j;continue t}}if(h=!1,g){f>g?i.push(U(g)+"-"+U(f)):f===g&&i.push(U(f)),g="",r++;continue}if(s.startsWith("-]",r+1)){i.push(U(f+"-")),r+=2;continue}if(s.startsWith("-",r+1)){g=f,r+=2;continue}i.push(U(f)),r++}if(l<r)return["",!1,0,!1];if(!i.length&&!n.length)return["$.",!1,s.length-e,!0];if(n.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!c){const f=i[0].length===2?i[0].slice(-1):i[0];return[Kt(f),!1,l-e,!1]}const u="["+(c?"^":"")+gt(i)+"]",p="["+(c?"":"^")+gt(n)+"]";return[i.length&&n.length?"("+u+"|"+p+")":i.length?u:p,a,l-e,!0]},"parseClass");var Xt=Object.defineProperty,Yt=y((s,t)=>Xt(s,"name",{value:t,configurable:!0}),"a$2");const _=Yt((s,{windowsPathsNoEscape:t=!1}={})=>t?s.replace(/\[([^\/\\])\]/g,"$1"):s.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),"unescape");var te=Object.defineProperty,st=y((s,t)=>te(s,"name",{value:t,configurable:!0}),"E$1");const ee=new Set(["!","?","+","*","@"]),dt=st(s=>ee.has(s),"isExtglobType"),se="(?!(?:^|/)\\.\\.?(?:$|/))",I="(?!\\.)",ie=new Set(["[","."]),re=new Set(["..","."]),ne=new Set("().*{}+?[]^$\\!"),oe=st(s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),it="[^/]",mt=it+"*?",bt=it+"+?";class M{static{v(this,"j")}static{x(this,"O")}static{y(this,"AST")}static{st(this,"AST")}type;#s;#i;#n=!1;#t=[];#e;#o;#h;#a=!1;#r;#c;#p=!1;constructor(t,e,i={}){this.type=t,t&&(this.#i=!0),this.#e=e,this.#s=this.#e?this.#e.#s:this,this.#r=this.#s===this?i:this.#s.#r,this.#h=this.#s===this?[]:this.#s.#h,t==="!"&&!this.#s.#a&&this.#h.push(this),this.#o=this.#e?this.#e.#t.length:0}get hasMagic(){if(this.#i!==void 0)return this.#i;for(const t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#i=!0;return this.#i}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#c=this.#t.map(t=>String(t)).join("")}#f(){if(this!==this.#s)throw new Error("should only call on root");if(this.#a)return this;this.toString(),this.#a=!0;let t;for(;t=this.#h.pop();){if(t.type!=="!")continue;let e=t,i=e.#e;for(;i;){for(let n=e.#o+1;!i.type&&n<i.#t.length;n++)for(const r of t.#t){if(typeof r=="string")throw new Error("string part in extglob AST??");r.copyIn(i.#t[n])}e=i,i=e.#e}}return this}push(...t){for(const e of t)if(e!==""){if(typeof e!="string"&&!(e instanceof M&&e.#e===this))throw new Error("invalid part: "+e);this.#t.push(e)}}toJSON(){const t=this.type===null?this.#t.slice().map(e=>typeof e=="string"?e:e.toJSON()):[this.type,...this.#t.map(e=>e.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#s||this.#s.#a&&this.#e?.type==="!")&&t.push({}),t}isStart(){if(this.#s===this)return!0;if(!this.#e?.isStart())return!1;if(this.#o===0)return!0;const t=this.#e;for(let e=0;e<this.#o;e++){const i=t.#t[e];if(!(i instanceof M&&i.type==="!"))return!1}return!0}isEnd(){if(this.#s===this||this.#e?.type==="!")return!0;if(!this.#e?.isEnd())return!1;if(!this.type)return this.#e?.isEnd();const t=this.#e?this.#e.#t.length:0;return this.#o===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){const e=new M(this.type,t);for(const i of this.#t)e.copyIn(i);return e}static#l(t,e,i,n){let r=!1,o=!1,a=-1,h=!1;if(e.type===null){let p=i,f="";for(;p<t.length;){const m=t.charAt(p++);if(r||m==="\\"){r=!r,f+=m;continue}if(o){p===a+1?(m==="^"||m==="!")&&(h=!0):m==="]"&&!(p===a+2&&h)&&(o=!1),f+=m;continue}else if(m==="["){o=!0,a=p,h=!1,f+=m;continue}if(!n.noext&&dt(m)&&t.charAt(p)==="("){e.push(f),f="";const A=new M(m,e);p=M.#l(t,A,p,n),e.push(A);continue}f+=m}return e.push(f),p}let c=i+1,l=new M(null,e);const g=[];let u="";for(;c<t.length;){const p=t.charAt(c++);if(r||p==="\\"){r=!r,u+=p;continue}if(o){c===a+1?(p==="^"||p==="!")&&(h=!0):p==="]"&&!(c===a+2&&h)&&(o=!1),u+=p;continue}else if(p==="["){o=!0,a=c,h=!1,u+=p;continue}if(dt(p)&&t.charAt(c)==="("){l.push(u),u="";const f=new M(p,l);l.push(f),c=M.#l(t,f,c,n);continue}if(p==="|"){l.push(u),u="",g.push(l),l=new M(null,e);continue}if(p===")")return u===""&&e.#t.length===0&&(e.#p=!0),l.push(u),u="",e.push(...g,l),c;u+=p}return e.type=null,e.#i=void 0,e.#t=[t.substring(i-1)],c}static fromGlob(t,e={}){const i=new M(null,void 0,e);return M.#l(t,i,0,e),i}toMMPattern(){if(this!==this.#s)return this.#s.toMMPattern();const t=this.toString(),[e,i,n,r]=this.toRegExpSource();if(!(n||this.#i||this.#r.nocase&&!this.#r.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return i;const o=(this.#r.nocase?"i":"")+(r?"u":"");return Object.assign(new RegExp(`^${e}$`,o),{_src:e,_glob:t})}get options(){return this.#r}toRegExpSource(t){const e=t??!!this.#r.dot;if(this.#s===this&&this.#f(),!this.type){const h=this.isStart()&&this.isEnd(),c=this.#t.map(u=>{const[p,f,m,A]=typeof u=="string"?M.#g(u,this.#i,h):u.toRegExpSource(t);return this.#i=this.#i||m,this.#n=this.#n||A,p}).join("");let l="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&re.has(this.#t[0]))){const u=ie,p=e&&u.has(c.charAt(0))||c.startsWith("\\.")&&u.has(c.charAt(2))||c.startsWith("\\.\\.")&&u.has(c.charAt(4)),f=!e&&!t&&u.has(c.charAt(0));l=p?se:f?I:""}let g="";return this.isEnd()&&this.#s.#a&&this.#e?.type==="!"&&(g="(?:$|\\/)"),[l+c+g,_(c),this.#i=!!this.#i,this.#n]}const i=this.type==="*"||this.type==="+",n=this.type==="!"?"(?:(?!(?:":"(?:";let r=this.#u(e);if(this.isStart()&&this.isEnd()&&!r&&this.type!=="!"){const h=this.toString();return this.#t=[h],this.type=null,this.#i=void 0,[h,_(this.toString()),!1,!1]}let o=!i||t||e||!I?"":this.#u(!0);o===r&&(o=""),o&&(r=`(?:${r})(?:${o})*?`);let a="";if(this.type==="!"&&this.#p)a=(this.isStart()&&!e?I:"")+bt;else{const h=this.type==="!"?"))"+(this.isStart()&&!e&&!t?I:"")+mt+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=n+r+h}return[a,_(r),this.#i=!!this.#i,this.#n]}#u(t){return this.#t.map(e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");const[i,n,r,o]=e.toRegExpSource(t);return this.#n=this.#n||o,i}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join("|")}static#g(t,e,i=!1){let n=!1,r="",o=!1;for(let a=0;a<t.length;a++){const h=t.charAt(a);if(n){n=!1,r+=(ne.has(h)?"\\":"")+h;continue}if(h==="\\"){a===t.length-1?r+="\\\\":n=!0;continue}if(h==="["){const[c,l,g,u]=Qt(t,a);if(g){r+=c,o=o||l,a+=g-1,e=e||u;continue}}if(h==="*"){i&&t==="*"?r+=bt:r+=mt,e=!0;continue}if(h==="?"){r+=it,e=!0;continue}r+=oe(h)}return[r,_(t),!!e,o]}}var ae=Object.defineProperty,he=y((s,t)=>ae(s,"name",{value:t,configurable:!0}),"a$1");const ce=he((s,{windowsPathsNoEscape:t=!1}={})=>t?s.replace(/[?*()[\]]/g,"[$&]"):s.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var le=Object.defineProperty,b=y((s,t)=>le(s,"name",{value:t,configurable:!0}),"h$1");const E=b((s,t,e={})=>(J(t),!e.nocomment&&t.charAt(0)==="#"?!1:new V(t,e).match(s)),"minimatch"),pe=/^\*+([^+@!?\*\[\(]*)$/,ue=b(s=>t=>!t.startsWith(".")&&t.endsWith(s),"starDotExtTest"),fe=b(s=>t=>t.endsWith(s),"starDotExtTestDot"),ge=b(s=>(s=s.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(s)),"starDotExtTestNocase"),de=b(s=>(s=s.toLowerCase(),t=>t.toLowerCase().endsWith(s)),"starDotExtTestNocaseDot"),me=/^\*+\.\*+$/,be=b(s=>!s.startsWith(".")&&s.includes("."),"starDotStarTest"),ye=b(s=>s!=="."&&s!==".."&&s.includes("."),"starDotStarTestDot"),ve=/^\.\*+$/,we=b(s=>s!=="."&&s!==".."&&s.startsWith("."),"dotStarTest"),xe=/^\*+$/,Oe=b(s=>s.length!==0&&!s.startsWith("."),"starTest"),$e=b(s=>s.length!==0&&s!=="."&&s!=="..","starTestDot"),Ee=/^\?+([^+@!?\*\[\(]*)?$/,Se=b(([s,t=""])=>{const e=xt([s]);return t?(t=t.toLowerCase(),i=>e(i)&&i.toLowerCase().endsWith(t)):e},"qmarksTestNocase"),Pe=b(([s,t=""])=>{const e=Ot([s]);return t?(t=t.toLowerCase(),i=>e(i)&&i.toLowerCase().endsWith(t)):e},"qmarksTestNocaseDot"),Me=b(([s,t=""])=>{const e=Ot([s]);return t?i=>e(i)&&i.endsWith(t):e},"qmarksTestDot"),Ae=b(([s,t=""])=>{const e=xt([s]);return t?i=>e(i)&&i.endsWith(t):e},"qmarksTest"),xt=b(([s])=>{const t=s.length;return e=>e.length===t&&!e.startsWith(".")},"qmarksTestNoExt"),Ot=b(([s])=>{const t=s.length;return e=>e.length===t&&e!=="."&&e!==".."},"qmarksTestNoExtDot"),$t=process?process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",yt={win32:{sep:"\\"},posix:{sep:"/"}},Ne=$t==="win32"?yt.win32.sep:yt.posix.sep;E.sep=Ne;const C=Symbol("globstar **");E.GLOBSTAR=C;const je="[^/]",Te=je+"*?",Ce="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",ke="(?:(?!(?:\\/|^)\\.).)*?",We=b((s,t={})=>e=>E(e,s,t),"filter");E.filter=We;const T=b((s,t={})=>Object.assign({},s,t),"ext"),Le=b(s=>{if(!s||typeof s!="object"||!Object.keys(s).length)return E;const t=E;return Object.assign(b((e,i,n={})=>t(e,i,T(s,n)),"m"),{Minimatch:class extends t.Minimatch{static{v(this,"Minimatch")}static{x(this,"Minimatch")}static{y(this,"Minimatch")}static{b(this,"Minimatch")}constructor(e,i={}){super(e,T(s,i))}static defaults(e){return t.defaults(T(s,e)).Minimatch}},AST:class extends t.AST{static{v(this,"AST")}static{x(this,"AST")}static{y(this,"AST")}static{b(this,"AST")}constructor(e,i,n={}){super(e,i,T(s,n))}static fromGlob(e,i={}){return t.AST.fromGlob(e,T(s,i))}},unescape:b((e,i={})=>t.unescape(e,T(s,i)),"unescape"),escape:b((e,i={})=>t.escape(e,T(s,i)),"escape"),filter:b((e,i={})=>t.filter(e,T(s,i)),"filter"),defaults:b(e=>t.defaults(T(s,e)),"defaults"),makeRe:b((e,i={})=>t.makeRe(e,T(s,i)),"makeRe"),braceExpand:b((e,i={})=>t.braceExpand(e,T(s,i)),"braceExpand"),match:b((e,i,n={})=>t.match(e,i,T(s,n)),"match"),sep:t.sep,GLOBSTAR:C})},"defaults");E.defaults=Le;const Et=b((s,t={})=>(J(s),t.nobrace||!/\{(?:(?!\{).)*\}/.test(s)?[s]:qt(s)),"braceExpand");E.braceExpand=Et;const ze=b((s,t={})=>new V(s,t).makeRe(),"makeRe");E.makeRe=ze;const De=b((s,t,e={})=>{const i=new V(t,e);return s=s.filter(n=>i.match(n)),i.options.nonull&&!s.length&&s.push(t),s},"match");E.match=De;const vt=/[?*]|[+@!]\(.*?\)|\[|\]/,Re=b(s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape");class V{static{v(this,"U")}static{x(this,"H")}static{y(this,"Minimatch")}static{b(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){J(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||$t,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const e of t)if(typeof e!="string")return!0;return!1}debug(...t){}make(){const t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...r)=>console.error(...r)),this.debug(this.pattern,this.globSet);const i=this.globSet.map(r=>this.slashSplit(r));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let n=this.globParts.map((r,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){const h=r[0]===""&&r[1]===""&&(r[2]==="?"||!vt.test(r[2]))&&!vt.test(r[3]),c=/^[a-z]:/i.test(r[0]);if(h)return[...r.slice(0,4),...r.slice(4).map(l=>this.parse(l))];if(c)return[r[0],...r.slice(1).map(l=>this.parse(l))]}return r.map(h=>this.parse(h))});if(this.debug(this.pattern,n),this.set=n.filter(r=>r.indexOf(!1)===-1),this.isWindows)for(let r=0;r<this.set.length;r++){const o=this.set[r];o[0]===""&&o[1]===""&&this.globParts[r][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let i=0;i<t.length;i++)for(let n=0;n<t[i].length;n++)t[i][n]==="**"&&(t[i][n]="*");const{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let i=-1;for(;(i=e.indexOf("**",i+1))!==-1;){let n=i;for(;e[n+1]==="**";)n++;n!==i&&e.splice(i,n-i)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((i,n)=>{const r=i[i.length-1];return n==="**"&&r==="**"?i:n===".."&&r&&r!==".."&&r!=="."&&r!=="**"?(i.pop(),i):(i.push(n),i)},[]),e.length===0?[""]:e))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let n=1;n<t.length-1;n++){const r=t[n];n===1&&r===""&&t[0]===""||(r==="."||r==="")&&(e=!0,t.splice(n,1),n--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(e=!0,t.pop())}let i=0;for(;(i=t.indexOf("..",i+1))!==-1;){const n=t[i-1];n&&n!=="."&&n!==".."&&n!=="**"&&(e=!0,t.splice(i-1,2),i-=2)}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let i of t){let n=-1;for(;(n=i.indexOf("**",n+1))!==-1;){let o=n;for(;i[o+1]==="**";)o++;o>n&&i.splice(n+1,o-n);let a=i[n+1];const h=i[n+2],c=i[n+3];if(a!==".."||!h||h==="."||h===".."||!c||c==="."||c==="..")continue;e=!0,i.splice(n,1);const l=i.slice(0);l[n]="**",t.push(l),n--}if(!this.preserveMultipleSlashes){for(let o=1;o<i.length-1;o++){const a=i[o];o===1&&a===""&&i[0]===""||(a==="."||a==="")&&(e=!0,i.splice(o,1),o--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(e=!0,i.pop())}let r=0;for(;(r=i.indexOf("..",r+1))!==-1;){const o=i[r-1];if(o&&o!=="."&&o!==".."&&o!=="**"){e=!0;const a=r===1&&i[r+1]==="**"?["."]:[];i.splice(r-1,2,...a),i.length===0&&i.push(""),r-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let i=e+1;i<t.length;i++){const n=this.partsMatch(t[e],t[i],!this.preserveMultipleSlashes);if(n){t[e]=[],t[i]=n;break}}return t.filter(e=>e.length)}partsMatch(t,e,i=!1){let n=0,r=0,o=[],a="";for(;n<t.length&&r<e.length;)if(t[n]===e[r])o.push(a==="b"?e[r]:t[n]),n++,r++;else if(i&&t[n]==="**"&&e[r]===t[n+1])o.push(t[n]),n++;else if(i&&e[r]==="**"&&t[n]===e[r+1])o.push(e[r]),r++;else if(t[n]==="*"&&e[r]&&(this.options.dot||!e[r].startsWith("."))&&e[r]!=="**"){if(a==="b")return!1;a="a",o.push(t[n]),n++,r++}else if(e[r]==="*"&&t[n]&&(this.options.dot||!t[n].startsWith("."))&&t[n]!=="**"){if(a==="a")return!1;a="b",o.push(e[r]),n++,r++}else return!1;return t.length===e.length&&o}parseNegate(){if(this.nonegate)return;const t=this.pattern;let e=!1,i=0;for(let n=0;n<t.length&&t.charAt(n)==="!";n++)e=!e,i++;i&&(this.pattern=t.slice(i)),this.negate=e}matchOne(t,e,i=!1){const n=this.options;if(this.isWindows){const m=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),A=!m&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),j=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),d=!j&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3]),O=A?3:m?0:void 0,S=d?3:j?0:void 0;if(typeof O=="number"&&typeof S=="number"){const[w,G]=[t[O],e[S]];w.toLowerCase()===G.toLowerCase()&&(e[S]=w,S>O?e=e.slice(S):O>S&&(t=t.slice(O)))}}const{optimizationLevel:r=1}=this.options;r>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var o=0,a=0,h=t.length,c=e.length;o<h&&a<c;o++,a++){this.debug("matchOne loop");var l=e[a],g=t[o];if(this.debug(e,l,g),l===!1)return!1;if(l===C){this.debug("GLOBSTAR",[e,l,g]);var u=o,p=a+1;if(p===c){for(this.debug("** at the end");o<h;o++)if(t[o]==="."||t[o]===".."||!n.dot&&t[o].charAt(0)===".")return!1;return!0}for(;u<h;){var f=t[u];if(this.debug(`
2
+ globstar while`,t,u,e,p,f),this.matchOne(t.slice(u),e.slice(p),i))return this.debug("globstar found match!",u,h,f),!0;if(f==="."||f===".."||!n.dot&&f.charAt(0)==="."){this.debug("dot detected!",t,u,e,p);break}this.debug("globstar swallow a segment, and continue"),u++}return!!(i&&(this.debug(`
3
+ >>> no match, partial?`,t,u,e,p),u===h))}let m;if(typeof l=="string"?(m=g===l,this.debug("string match",l,g,m)):(m=l.test(g),this.debug("pattern match",l,g,m)),!m)return!1}if(o===h&&a===c)return!0;if(o===h)return i;if(a===c)return o===h-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return Et(this.pattern,this.options)}parse(t){J(t);const e=this.options;if(t==="**")return C;if(t==="")return"";let i,n=null;(i=t.match(xe))?n=e.dot?$e:Oe:(i=t.match(pe))?n=(e.nocase?e.dot?de:ge:e.dot?fe:ue)(i[1]):(i=t.match(Ee))?n=(e.nocase?e.dot?Pe:Se:e.dot?Me:Ae)(i):(i=t.match(me))?n=e.dot?ye:be:(i=t.match(ve))&&(n=we);const r=M.fromGlob(t,this.options).toMMPattern();return n&&typeof r=="object"&&Reflect.defineProperty(r,"test",{value:n}),r}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const e=this.options,i=e.noglobstar?Te:e.dot?Ce:ke,n=new Set(e.nocase?["i"]:[]);let r=t.map(h=>{const c=h.map(l=>{if(l instanceof RegExp)for(const g of l.flags.split(""))n.add(g);return typeof l=="string"?Re(l):l===C?C:l._src});return c.forEach((l,g)=>{const u=c[g+1],p=c[g-1];l!==C||p===C||(p===void 0?u!==void 0&&u!==C?c[g+1]="(?:\\/|"+i+"\\/)?"+u:c[g]=i:u===void 0?c[g-1]=p+"(?:\\/|"+i+")?":u!==C&&(c[g-1]=p+"(?:\\/|\\/"+i+"\\/)"+u,c[g+1]=C))}),c.filter(l=>l!==C).join("/")}).join("|");const[o,a]=t.length>1?["(?:",")"]:["",""];r="^"+o+r+a+"$",this.negate&&(r="^(?!"+r+").+$");try{this.regexp=new RegExp(r,[...n].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;const i=this.options;this.isWindows&&(t=t.split("\\").join("/"));const n=this.slashSplit(t);this.debug(this.pattern,"split",n);const r=this.set;this.debug(this.pattern,"set",r);let o=n[n.length-1];if(!o)for(let a=n.length-2;!o&&a>=0;a--)o=n[a];for(let a=0;a<r.length;a++){const h=r[a];let c=n;if(i.matchBase&&h.length===1&&(c=[o]),this.matchOne(c,h,e))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(t){return E.defaults(t).Minimatch}}E.AST=M;E.Minimatch=V;E.escape=ce;E.unescape=_;var Ge=Object.defineProperty,Be=y((s,t)=>Ge(s,"name",{value:t,configurable:!0}),"t");const Ue=/^[A-Z]:\//i,R=Be((s="")=>s&&s.replaceAll("\\","/").replace(Ue,t=>t.toUpperCase()),"normalizeWindowsPath");var _e=Object.defineProperty,N=y((s,t)=>_e(s,"name",{value:t,configurable:!0}),"r");const Fe=/^[/\\]{2}/,Ze=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,St=/^[A-Z]:$/i,wt=/^\/([A-Z]:)?$/i,qe=/.(\.[^./]+)$/,Ie=/^[/\\]|^[a-z]:[/\\]/i,Je=N(()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd"),Pt=N((s,t)=>{let e="",i=0,n=-1,r=0,o=null;for(let a=0;a<=s.length;++a){if(a<s.length)o=s[a];else{if(o==="/")break;o="/"}if(o==="/"){if(!(n===a-1||r===1))if(r===2){if(e.length<2||i!==2||!e.endsWith(".")||e.at(-2)!=="."){if(e.length>2){const h=e.lastIndexOf("/");h===-1?(e="",i=0):(e=e.slice(0,h),i=e.length-1-e.lastIndexOf("/")),n=a,r=0;continue}else if(e.length>0){e="",i=0,n=a,r=0;continue}}t&&(e+=e.length>0?"/..":"..",i=2)}else e.length>0?e+=`/${s.slice(n+1,a)}`:e=s.slice(n+1,a),i=a-n-1;n=a,r=0}else o==="."&&r!==-1?++r:r=-1}return e},"normalizeString"),Z=N(s=>Ze.test(s),"isAbsolute"),Mt=N(function(s){if(s.length===0)return".";s=R(s);const t=Fe.exec(s),e=Z(s),i=s.at(-1)==="/";return s=Pt(s,!e),s.length===0?e?"/":i?"./":".":(i&&(s+="/"),St.test(s)&&(s+="/"),t?e?`//${s}`:`//./${s}`:e&&!Z(s)?`/${s}`:s)},"normalize"),He=N((...s)=>{let t="";for(const e of s)if(e)if(t.length>0){const i=t[t.length-1]==="/",n=e[0]==="/";i&&n?t+=e.slice(1):t+=i||n?e:`/${e}`}else t+=e;return Mt(t)},"join"),X=N(function(...s){s=s.map(i=>R(i));let t="",e=!1;for(let i=s.length-1;i>=-1&&!e;i--){const n=i>=0?s[i]:Je();!n||n.length===0||(t=`${n}/${t}`,e=Z(n))}return t=Pt(t,!e),e&&!Z(t)?`/${t}`:t.length>0?t:"."},"resolve");N(function(s){return R(s)},"toNamespacedPath");const Ve=N(function(s){return qe.exec(R(s))?.[1]??""},"extname");N(function(s,t){const e=X(s).replace(wt,"$1").split("/"),i=X(t).replace(wt,"$1").split("/");if(i[0][1]===":"&&e[0][1]===":"&&e[0]!==i[0])return i.join("/");const n=[...e];for(const r of n){if(i[0]!==r)break;e.shift(),i.shift()}return[...e.map(()=>".."),...i].join("/")},"relative");const At=N(s=>{const t=R(s).replace(/\/$/,"").split("/").slice(0,-1);return t.length===1&&St.test(t[0])&&(t[0]+="/"),t.join("/")||(Z(s)?"/":".")},"dirname");N(function(s){const t=[s.root,s.dir,s.base??s.name+s.ext].filter(Boolean);return R(s.root?X(...t):t.join("/"))},"format");const Ke=N((s,t)=>{const e=R(s).split("/").pop();return t&&e.endsWith(t)?e.slice(0,-t.length):e},"basename");N(function(s){const t=Ie.exec(s)?.[0]?.replace(/\\/g,"/")??"",e=Ke(s),i=Ve(e);return{base:e,dir:At(s),ext:i,name:e.slice(0,e.length-i.length),root:t}},"parse");N((s,t)=>E(Mt(s),t,{nocaseMagicOnly:!0,nocomment:!0,nonegate:!0,optimizationLevel:2,windowsPathsNoEscape:!0}),"matchesGlob");var Qe=Object.defineProperty,rt=v((s,t)=>Qe(s,"name",{value:t,configurable:!0}),"r");const Xe="last-update-check.json",Nt=rt(s=>{const t=Dt.findCacheDirSync(s);if(t===void 0)throw new Error("Could not find cache directory");return He(t,Xe)},"getConfigFile"),Ye=rt(s=>{const t=Nt(s);try{if(!F.existsSync(t))return;const{lastUpdateCheck:e}=JSON.parse(F.readFileSync(t,"utf8"));return e}catch{return}},"getLastUpdate"),ts=rt(s=>{const t=Nt(s),e=At(t);F.existsSync(e)||F.mkdirSync(e,{recursive:!0}),F.writeFileSync(t,JSON.stringify({lastUpdateCheck:Date.now()}))},"saveLastUpdate");var es=Object.defineProperty,ss=v((s,t)=>es(s,"name",{value:t,configurable:!0}),"g");const is=ss(async(s,t,e)=>{const i=e.replace("__NAME__",s);return await new Promise((n,r)=>{Rt.get(i,o=>{let a="";o.on("data",h=>a+=h),o.on("end",()=>{try{const h=JSON.parse(a)[t];h||r(new Error("Error getting version")),n(h)}catch{r(new Error("Could not parse version response"))}})}).on("error",o=>r(o))})},"getDistributionVersion");var rs=Object.defineProperty,ns=v((s,t)=>rs(s,"name",{value:t,configurable:!0}),"i");const os=ns(async({alwaysRun:s,debug:t,distTag:e="latest",pkg:i,registryUrl:n="https://registry.npmjs.org/-/package/__NAME__/dist-tags",updateCheckInterval:r=1e3*60*60*24})=>{const o=Ye(i.name);if(s||!o||o<Date.now()-r){const a=await is(i.name,e,n);if(ts(i.name),Ut(a,i.version))return a;t&&console.error(`Latest version (${a}) not newer than current version (${i.version})`)}else t&&console.error(`Too recent to check for a new update. simpleUpdateNotifier() interval set to ${r}ms but only ${Date.now()-o}ms since last check.`);return null},"hasNewVersion");exports.default=os;
@@ -1,3 +1,3 @@
1
- var zt=Object.defineProperty;var v=(s,t)=>zt(s,"name",{value:t,configurable:!0});import{existsSync as wt,readFileSync as Dt,mkdirSync as Rt,writeFileSync as Gt}from"node:fs";import{findCacheDirSync as Bt}from"@visulima/find-cache-dir";import{get as Ut}from"node:https";var Ft=Object.defineProperty,Zt=v((s,t)=>Ft(s,"name",{value:t,configurable:!0}),"o$1");const _t=Zt((s,t)=>{const e=s.split(".").map(Number),n=t.split(".").map(Number);for(const[i,r]of e.entries()){if(r>n[i])return!0;if(r<n[i])return!1}return!1},"semverGt");var It=Object.defineProperty,x=v((s,t)=>It(s,"name",{value:t,configurable:!0}),"w"),Jt=Object.defineProperty,y=x((s,t)=>Jt(s,"name",{value:t,configurable:!0}),"y");function X(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}v(X,"Y");x(X,"Wt");y(X,"getDefaultExportFromCjs");var V,pt;function Y(){if(pt)return V;pt=1;var s=Object.defineProperty,t=y((r,o)=>s(r,"name",{value:o,configurable:!0}),"u");V=e;function e(r,o,a){r instanceof RegExp&&(r=n(r,a)),o instanceof RegExp&&(o=n(o,a));var h=i(r,o,a);return h&&{start:h[0],end:h[1],pre:a.slice(0,h[0]),body:a.slice(h[0]+r.length,h[1]),post:a.slice(h[1]+o.length)}}v(e,"e"),x(e,"e"),y(e,"balanced"),t(e,"balanced");function n(r,o){var a=o.match(r);return a?a[0]:null}v(n,"s"),x(n,"s"),y(n,"maybeMatch"),t(n,"maybeMatch"),e.range=i;function i(r,o,a){var h,c,l,g,u,p=a.indexOf(r),f=a.indexOf(o,p+1),m=p;if(p>=0&&f>0){if(r===o)return[p,f];for(h=[],l=a.length;m>=0&&!u;)m==p?(h.push(m),p=a.indexOf(r,m+1)):h.length==1?u=[h.pop(),f]:(c=h.pop(),c<l&&(l=c,g=f),f=a.indexOf(o,m+1)),m=p<f&&p>=0?p:f;h.length&&(u=[l,g])}return u}return v(i,"n"),x(i,"r"),y(i,"range"),t(i,"range"),V}v(Y,"xt");x(Y,"Ct");y(Y,"requireBalancedMatch");var K,ut;function tt(){if(ut)return K;ut=1;var s=Object.defineProperty,t=y((d,O)=>s(d,"name",{value:O,configurable:!0}),"o"),e=Y();K=u;var n="\0SLASH"+Math.random()+"\0",i="\0OPEN"+Math.random()+"\0",r="\0CLOSE"+Math.random()+"\0",o="\0COMMA"+Math.random()+"\0",a="\0PERIOD"+Math.random()+"\0";function h(d){return parseInt(d,10)==d?parseInt(d,10):d.charCodeAt(0)}v(h,"h"),x(h,"h"),y(h,"numeric"),t(h,"numeric");function c(d){return d.split("\\\\").join(n).split("\\{").join(i).split("\\}").join(r).split("\\,").join(o).split("\\.").join(a)}v(c,"c"),x(c,"c"),y(c,"escapeBraces"),t(c,"escapeBraces");function l(d){return d.split(n).join("\\").split(i).join("{").split(r).join("}").split(o).join(",").split(a).join(".")}v(l,"l"),x(l,"l"),y(l,"unescapeBraces"),t(l,"unescapeBraces");function g(d){if(!d)return[""];var O=[],S=e("{","}",d);if(!S)return d.split(",");var w=S.pre,G=S.body,W=S.post,P=w.split(",");P[P.length-1]+="{"+G+"}";var L=g(W);return W.length&&(P[P.length-1]+=L.shift(),P.push.apply(P,L)),O.push.apply(O,P),O}v(g,"g"),x(g,"g"),y(g,"parseCommaParts"),t(g,"parseCommaParts");function u(d){return d?(d.substr(0,2)==="{}"&&(d="\\{\\}"+d.substr(2)),T(c(d),!0).map(l)):[]}v(u,"u"),x(u,"u"),y(u,"expandTop"),t(u,"expandTop");function p(d){return"{"+d+"}"}v(p,"p"),x(p,"p"),y(p,"embrace"),t(p,"embrace");function f(d){return/^-?0\d/.test(d)}v(f,"f"),x(f,"f"),y(f,"isPadded"),t(f,"isPadded");function m(d,O){return d<=O}v(m,"m"),x(m,"m"),y(m,"lte"),t(m,"lte");function j(d,O){return d>=O}v(j,"O"),x(j,"M"),y(j,"gte"),t(j,"gte");function T(d,O){var S=[],w=e("{","}",d);if(!w)return[d];var G=w.pre,W=w.post.length?T(w.post,!1):[""];if(/\$$/.test(w.pre))for(var P=0;P<W.length;P++){var L=G+"{"+w.body+"}"+W[P];S.push(L)}else{var Tt=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(w.body),rt=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(w.body),_=Tt||rt,At=w.body.indexOf(",")>=0;if(!_&&!At)return w.post.match(/,.*\}/)?(d=w.pre+"{"+w.body+r+w.post,T(d)):[d];var $;if(_)$=w.body.split(/\.\./);else if($=g(w.body),$.length===1&&($=T($[0],!1).map(p),$.length===1))return W.map(function(Lt){return w.pre+$[0]+Lt});var z;if(_){var it=h($[0]),ot=h($[1]),Ct=Math.max($[0].length,$[1].length),at=$.length==3?Math.abs(h($[2])):1,ht=m,kt=ot<it;kt&&(at*=-1,ht=j);var Wt=$.some(f);z=[];for(var B=it;ht(B,ot);B+=at){var k;if(rt)k=String.fromCharCode(B),k==="\\"&&(k="");else if(k=String(B),Wt){var ct=Ct-k.length;if(ct>0){var lt=new Array(ct+1).join("0");B<0?k="-"+lt+k.slice(1):k=lt+k}}z.push(k)}}else{z=[];for(var D=0;D<$.length;D++)z.push.apply(z,T($[D],!1))}for(var D=0;D<z.length;D++)for(var P=0;P<W.length;P++){var L=G+z[D]+W[P];(!O||_||L)&&S.push(L)}}return S}return v(T,"$"),x(T,"A"),y(T,"expand"),t(T,"expand"),K}v(tt,"St");x(tt,"Rt");y(tt,"requireBraceExpansion");var qt=tt();const Ht=X(qt);var Vt=Object.defineProperty,Kt=y((s,t)=>Vt(s,"name",{value:t,configurable:!0}),"r");const J=Kt(s=>{if(typeof s!="string")throw new TypeError("invalid pattern");if(s.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var Qt=Object.defineProperty,q=y((s,t)=>Qt(s,"name",{value:t,configurable:!0}),"p$1");const Xt={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},U=q(s=>s.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),Yt=q(s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),ft=q(s=>s.join(""),"rangesToString"),te=q((s,t)=>{const e=t;if(s.charAt(e)!=="[")throw new Error("not in a brace expression");const n=[],i=[];let r=e+1,o=!1,a=!1,h=!1,c=!1,l=e,g="";t:for(;r<s.length;){const f=s.charAt(r);if((f==="!"||f==="^")&&r===e+1){c=!0,r++;continue}if(f==="]"&&o&&!h){l=r+1;break}if(o=!0,f==="\\"&&!h){h=!0,r++;continue}if(f==="["&&!h){for(const[m,[j,T,d]]of Object.entries(Xt))if(s.startsWith(m,r)){if(g)return["$.",!1,s.length-e,!0];r+=m.length,d?i.push(j):n.push(j),a=a||T;continue t}}if(h=!1,g){f>g?n.push(U(g)+"-"+U(f)):f===g&&n.push(U(f)),g="",r++;continue}if(s.startsWith("-]",r+1)){n.push(U(f+"-")),r+=2;continue}if(s.startsWith("-",r+1)){g=f,r+=2;continue}n.push(U(f)),r++}if(l<r)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,s.length-e,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!c){const f=n[0].length===2?n[0].slice(-1):n[0];return[Yt(f),!1,l-e,!1]}const u="["+(c?"^":"")+ft(n)+"]",p="["+(c?"":"^")+ft(i)+"]";return[n.length&&i.length?"("+u+"|"+p+")":n.length?u:p,a,l-e,!0]},"parseClass");var ee=Object.defineProperty,se=y((s,t)=>ee(s,"name",{value:t,configurable:!0}),"a$2");const F=se((s,{windowsPathsNoEscape:t=!1}={})=>t?s.replace(/\[([^\/\\])\]/g,"$1"):s.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),"unescape");var ne=Object.defineProperty,et=y((s,t)=>ne(s,"name",{value:t,configurable:!0}),"E$1");const re=new Set(["!","?","+","*","@"]),gt=et(s=>re.has(s),"isExtglobType"),ie="(?!(?:^|/)\\.\\.?(?:$|/))",I="(?!\\.)",oe=new Set(["[","."]),ae=new Set(["..","."]),he=new Set("().*{}+?[]^$\\!"),ce=et(s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),st="[^/]",dt=st+"*?",mt=st+"+?";class M{static{v(this,"A")}static{x(this,"O")}static{y(this,"AST")}static{et(this,"AST")}type;#s;#n;#i=!1;#t=[];#e;#o;#h;#a=!1;#r;#c;#p=!1;constructor(t,e,n={}){this.type=t,t&&(this.#n=!0),this.#e=e,this.#s=this.#e?this.#e.#s:this,this.#r=this.#s===this?n:this.#s.#r,this.#h=this.#s===this?[]:this.#s.#h,t==="!"&&!this.#s.#a&&this.#h.push(this),this.#o=this.#e?this.#e.#t.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(const t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#n=!0;return this.#n}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#c=this.#t.map(t=>String(t)).join("")}#f(){if(this!==this.#s)throw new Error("should only call on root");if(this.#a)return this;this.toString(),this.#a=!0;let t;for(;t=this.#h.pop();){if(t.type!=="!")continue;let e=t,n=e.#e;for(;n;){for(let i=e.#o+1;!n.type&&i<n.#t.length;i++)for(const r of t.#t){if(typeof r=="string")throw new Error("string part in extglob AST??");r.copyIn(n.#t[i])}e=n,n=e.#e}}return this}push(...t){for(const e of t)if(e!==""){if(typeof e!="string"&&!(e instanceof M&&e.#e===this))throw new Error("invalid part: "+e);this.#t.push(e)}}toJSON(){const t=this.type===null?this.#t.slice().map(e=>typeof e=="string"?e:e.toJSON()):[this.type,...this.#t.map(e=>e.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#s||this.#s.#a&&this.#e?.type==="!")&&t.push({}),t}isStart(){if(this.#s===this)return!0;if(!this.#e?.isStart())return!1;if(this.#o===0)return!0;const t=this.#e;for(let e=0;e<this.#o;e++){const n=t.#t[e];if(!(n instanceof M&&n.type==="!"))return!1}return!0}isEnd(){if(this.#s===this||this.#e?.type==="!")return!0;if(!this.#e?.isEnd())return!1;if(!this.type)return this.#e?.isEnd();const t=this.#e?this.#e.#t.length:0;return this.#o===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){const e=new M(this.type,t);for(const n of this.#t)e.copyIn(n);return e}static#l(t,e,n,i){let r=!1,o=!1,a=-1,h=!1;if(e.type===null){let p=n,f="";for(;p<t.length;){const m=t.charAt(p++);if(r||m==="\\"){r=!r,f+=m;continue}if(o){p===a+1?(m==="^"||m==="!")&&(h=!0):m==="]"&&!(p===a+2&&h)&&(o=!1),f+=m;continue}else if(m==="["){o=!0,a=p,h=!1,f+=m;continue}if(!i.noext&&gt(m)&&t.charAt(p)==="("){e.push(f),f="";const j=new M(m,e);p=M.#l(t,j,p,i),e.push(j);continue}f+=m}return e.push(f),p}let c=n+1,l=new M(null,e);const g=[];let u="";for(;c<t.length;){const p=t.charAt(c++);if(r||p==="\\"){r=!r,u+=p;continue}if(o){c===a+1?(p==="^"||p==="!")&&(h=!0):p==="]"&&!(c===a+2&&h)&&(o=!1),u+=p;continue}else if(p==="["){o=!0,a=c,h=!1,u+=p;continue}if(gt(p)&&t.charAt(c)==="("){l.push(u),u="";const f=new M(p,l);l.push(f),c=M.#l(t,f,c,i);continue}if(p==="|"){l.push(u),u="",g.push(l),l=new M(null,e);continue}if(p===")")return u===""&&e.#t.length===0&&(e.#p=!0),l.push(u),u="",e.push(...g,l),c;u+=p}return e.type=null,e.#n=void 0,e.#t=[t.substring(n-1)],c}static fromGlob(t,e={}){const n=new M(null,void 0,e);return M.#l(t,n,0,e),n}toMMPattern(){if(this!==this.#s)return this.#s.toMMPattern();const t=this.toString(),[e,n,i,r]=this.toRegExpSource();if(!(i||this.#n||this.#r.nocase&&!this.#r.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return n;const o=(this.#r.nocase?"i":"")+(r?"u":"");return Object.assign(new RegExp(`^${e}$`,o),{_src:e,_glob:t})}get options(){return this.#r}toRegExpSource(t){const e=t??!!this.#r.dot;if(this.#s===this&&this.#f(),!this.type){const h=this.isStart()&&this.isEnd(),c=this.#t.map(u=>{const[p,f,m,j]=typeof u=="string"?M.#g(u,this.#n,h):u.toRegExpSource(t);return this.#n=this.#n||m,this.#i=this.#i||j,p}).join("");let l="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&ae.has(this.#t[0]))){const u=oe,p=e&&u.has(c.charAt(0))||c.startsWith("\\.")&&u.has(c.charAt(2))||c.startsWith("\\.\\.")&&u.has(c.charAt(4)),f=!e&&!t&&u.has(c.charAt(0));l=p?ie:f?I:""}let g="";return this.isEnd()&&this.#s.#a&&this.#e?.type==="!"&&(g="(?:$|\\/)"),[l+c+g,F(c),this.#n=!!this.#n,this.#i]}const n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:";let r=this.#u(e);if(this.isStart()&&this.isEnd()&&!r&&this.type!=="!"){const h=this.toString();return this.#t=[h],this.type=null,this.#n=void 0,[h,F(this.toString()),!1,!1]}let o=!n||t||e||!I?"":this.#u(!0);o===r&&(o=""),o&&(r=`(?:${r})(?:${o})*?`);let a="";if(this.type==="!"&&this.#p)a=(this.isStart()&&!e?I:"")+mt;else{const h=this.type==="!"?"))"+(this.isStart()&&!e&&!t?I:"")+dt+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+r+h}return[a,F(r),this.#n=!!this.#n,this.#i]}#u(t){return this.#t.map(e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");const[n,i,r,o]=e.toRegExpSource(t);return this.#i=this.#i||o,n}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join("|")}static#g(t,e,n=!1){let i=!1,r="",o=!1;for(let a=0;a<t.length;a++){const h=t.charAt(a);if(i){i=!1,r+=(he.has(h)?"\\":"")+h;continue}if(h==="\\"){a===t.length-1?r+="\\\\":i=!0;continue}if(h==="["){const[c,l,g,u]=te(t,a);if(g){r+=c,o=o||l,a+=g-1,e=e||u;continue}}if(h==="*"){n&&t==="*"?r+=mt:r+=dt,e=!0;continue}if(h==="?"){r+=st,e=!0;continue}r+=ce(h)}return[r,F(t),!!e,o]}}var le=Object.defineProperty,pe=y((s,t)=>le(s,"name",{value:t,configurable:!0}),"a$1");const ue=pe((s,{windowsPathsNoEscape:t=!1}={})=>t?s.replace(/[?*()[\]]/g,"[$&]"):s.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var fe=Object.defineProperty,b=y((s,t)=>fe(s,"name",{value:t,configurable:!0}),"h$1");const E=b((s,t,e={})=>(J(t),!e.nocomment&&t.charAt(0)==="#"?!1:new H(t,e).match(s)),"minimatch"),ge=/^\*+([^+@!?\*\[\(]*)$/,de=b(s=>t=>!t.startsWith(".")&&t.endsWith(s),"starDotExtTest"),me=b(s=>t=>t.endsWith(s),"starDotExtTestDot"),be=b(s=>(s=s.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(s)),"starDotExtTestNocase"),ye=b(s=>(s=s.toLowerCase(),t=>t.toLowerCase().endsWith(s)),"starDotExtTestNocaseDot"),ve=/^\*+\.\*+$/,we=b(s=>!s.startsWith(".")&&s.includes("."),"starDotStarTest"),xe=b(s=>s!=="."&&s!==".."&&s.includes("."),"starDotStarTestDot"),Oe=/^\.\*+$/,$e=b(s=>s!=="."&&s!==".."&&s.startsWith("."),"dotStarTest"),Ee=/^\*+$/,Se=b(s=>s.length!==0&&!s.startsWith("."),"starTest"),Pe=b(s=>s.length!==0&&s!=="."&&s!=="..","starTestDot"),Me=/^\?+([^+@!?\*\[\(]*)?$/,je=b(([s,t=""])=>{const e=xt([s]);return t?(t=t.toLowerCase(),n=>e(n)&&n.toLowerCase().endsWith(t)):e},"qmarksTestNocase"),Ne=b(([s,t=""])=>{const e=Ot([s]);return t?(t=t.toLowerCase(),n=>e(n)&&n.toLowerCase().endsWith(t)):e},"qmarksTestNocaseDot"),Te=b(([s,t=""])=>{const e=Ot([s]);return t?n=>e(n)&&n.endsWith(t):e},"qmarksTestDot"),Ae=b(([s,t=""])=>{const e=xt([s]);return t?n=>e(n)&&n.endsWith(t):e},"qmarksTest"),xt=b(([s])=>{const t=s.length;return e=>e.length===t&&!e.startsWith(".")},"qmarksTestNoExt"),Ot=b(([s])=>{const t=s.length;return e=>e.length===t&&e!=="."&&e!==".."},"qmarksTestNoExtDot"),$t=process?process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",bt={win32:{sep:"\\"},posix:{sep:"/"}},Ce=$t==="win32"?bt.win32.sep:bt.posix.sep;E.sep=Ce;const C=Symbol("globstar **");E.GLOBSTAR=C;const ke="[^/]",We=ke+"*?",Le="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",ze="(?:(?!(?:\\/|^)\\.).)*?",De=b((s,t={})=>e=>E(e,s,t),"filter");E.filter=De;const A=b((s,t={})=>Object.assign({},s,t),"ext"),Re=b(s=>{if(!s||typeof s!="object"||!Object.keys(s).length)return E;const t=E;return Object.assign(b((e,n,i={})=>t(e,n,A(s,i)),"m"),{Minimatch:class extends t.Minimatch{static{v(this,"Minimatch")}static{x(this,"Minimatch")}static{y(this,"Minimatch")}static{b(this,"Minimatch")}constructor(e,n={}){super(e,A(s,n))}static defaults(e){return t.defaults(A(s,e)).Minimatch}},AST:class extends t.AST{static{v(this,"AST")}static{x(this,"AST")}static{y(this,"AST")}static{b(this,"AST")}constructor(e,n,i={}){super(e,n,A(s,i))}static fromGlob(e,n={}){return t.AST.fromGlob(e,A(s,n))}},unescape:b((e,n={})=>t.unescape(e,A(s,n)),"unescape"),escape:b((e,n={})=>t.escape(e,A(s,n)),"escape"),filter:b((e,n={})=>t.filter(e,A(s,n)),"filter"),defaults:b(e=>t.defaults(A(s,e)),"defaults"),makeRe:b((e,n={})=>t.makeRe(e,A(s,n)),"makeRe"),braceExpand:b((e,n={})=>t.braceExpand(e,A(s,n)),"braceExpand"),match:b((e,n,i={})=>t.match(e,n,A(s,i)),"match"),sep:t.sep,GLOBSTAR:C})},"defaults");E.defaults=Re;const Et=b((s,t={})=>(J(s),t.nobrace||!/\{(?:(?!\{).)*\}/.test(s)?[s]:Ht(s)),"braceExpand");E.braceExpand=Et;const Ge=b((s,t={})=>new H(s,t).makeRe(),"makeRe");E.makeRe=Ge;const Be=b((s,t,e={})=>{const n=new H(t,e);return s=s.filter(i=>n.match(i)),n.options.nonull&&!s.length&&s.push(t),s},"match");E.match=Be;const yt=/[?*]|[+@!]\(.*?\)|\[|\]/,Ue=b(s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape");class H{static{v(this,"U")}static{x(this,"H")}static{y(this,"Minimatch")}static{b(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){J(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||$t,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const e of t)if(typeof e!="string")return!0;return!1}debug(...t){}make(){const t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...r)=>console.error(...r)),this.debug(this.pattern,this.globSet);const n=this.globSet.map(r=>this.slashSplit(r));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let i=this.globParts.map((r,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){const h=r[0]===""&&r[1]===""&&(r[2]==="?"||!yt.test(r[2]))&&!yt.test(r[3]),c=/^[a-z]:/i.test(r[0]);if(h)return[...r.slice(0,4),...r.slice(4).map(l=>this.parse(l))];if(c)return[r[0],...r.slice(1).map(l=>this.parse(l))]}return r.map(h=>this.parse(h))});if(this.debug(this.pattern,i),this.set=i.filter(r=>r.indexOf(!1)===-1),this.isWindows)for(let r=0;r<this.set.length;r++){const o=this.set[r];o[0]===""&&o[1]===""&&this.globParts[r][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let n=0;n<t.length;n++)for(let i=0;i<t[n].length;i++)t[n][i]==="**"&&(t[n][i]="*");const{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let n=-1;for(;(n=e.indexOf("**",n+1))!==-1;){let i=n;for(;e[i+1]==="**";)i++;i!==n&&e.splice(n,i-n)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((n,i)=>{const r=n[n.length-1];return i==="**"&&r==="**"?n:i===".."&&r&&r!==".."&&r!=="."&&r!=="**"?(n.pop(),n):(n.push(i),n)},[]),e.length===0?[""]:e))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let i=1;i<t.length-1;i++){const r=t[i];i===1&&r===""&&t[0]===""||(r==="."||r==="")&&(e=!0,t.splice(i,1),i--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(e=!0,t.pop())}let n=0;for(;(n=t.indexOf("..",n+1))!==-1;){const i=t[n-1];i&&i!=="."&&i!==".."&&i!=="**"&&(e=!0,t.splice(n-1,2),n-=2)}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let n of t){let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let o=i;for(;n[o+1]==="**";)o++;o>i&&n.splice(i+1,o-i);let a=n[i+1];const h=n[i+2],c=n[i+3];if(a!==".."||!h||h==="."||h===".."||!c||c==="."||c==="..")continue;e=!0,n.splice(i,1);const l=n.slice(0);l[i]="**",t.push(l),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){const a=n[o];o===1&&a===""&&n[0]===""||(a==="."||a==="")&&(e=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(e=!0,n.pop())}let r=0;for(;(r=n.indexOf("..",r+1))!==-1;){const o=n[r-1];if(o&&o!=="."&&o!==".."&&o!=="**"){e=!0;const a=r===1&&n[r+1]==="**"?["."]:[];n.splice(r-1,2,...a),n.length===0&&n.push(""),r-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let n=e+1;n<t.length;n++){const i=this.partsMatch(t[e],t[n],!this.preserveMultipleSlashes);if(i){t[e]=[],t[n]=i;break}}return t.filter(e=>e.length)}partsMatch(t,e,n=!1){let i=0,r=0,o=[],a="";for(;i<t.length&&r<e.length;)if(t[i]===e[r])o.push(a==="b"?e[r]:t[i]),i++,r++;else if(n&&t[i]==="**"&&e[r]===t[i+1])o.push(t[i]),i++;else if(n&&e[r]==="**"&&t[i]===e[r+1])o.push(e[r]),r++;else if(t[i]==="*"&&e[r]&&(this.options.dot||!e[r].startsWith("."))&&e[r]!=="**"){if(a==="b")return!1;a="a",o.push(t[i]),i++,r++}else if(e[r]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(a==="a")return!1;a="b",o.push(e[r]),i++,r++}else return!1;return t.length===e.length&&o}parseNegate(){if(this.nonegate)return;const t=this.pattern;let e=!1,n=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)e=!e,n++;n&&(this.pattern=t.slice(n)),this.negate=e}matchOne(t,e,n=!1){const i=this.options;if(this.isWindows){const m=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),j=!m&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),T=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),d=!T&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3]),O=j?3:m?0:void 0,S=d?3:T?0:void 0;if(typeof O=="number"&&typeof S=="number"){const[w,G]=[t[O],e[S]];w.toLowerCase()===G.toLowerCase()&&(e[S]=w,S>O?e=e.slice(S):O>S&&(t=t.slice(O)))}}const{optimizationLevel:r=1}=this.options;r>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var o=0,a=0,h=t.length,c=e.length;o<h&&a<c;o++,a++){this.debug("matchOne loop");var l=e[a],g=t[o];if(this.debug(e,l,g),l===!1)return!1;if(l===C){this.debug("GLOBSTAR",[e,l,g]);var u=o,p=a+1;if(p===c){for(this.debug("** at the end");o<h;o++)if(t[o]==="."||t[o]===".."||!i.dot&&t[o].charAt(0)===".")return!1;return!0}for(;u<h;){var f=t[u];if(this.debug(`
2
- globstar while`,t,u,e,p,f),this.matchOne(t.slice(u),e.slice(p),n))return this.debug("globstar found match!",u,h,f),!0;if(f==="."||f===".."||!i.dot&&f.charAt(0)==="."){this.debug("dot detected!",t,u,e,p);break}this.debug("globstar swallow a segment, and continue"),u++}return!!(n&&(this.debug(`
3
- >>> no match, partial?`,t,u,e,p),u===h))}let m;if(typeof l=="string"?(m=g===l,this.debug("string match",l,g,m)):(m=l.test(g),this.debug("pattern match",l,g,m)),!m)return!1}if(o===h&&a===c)return!0;if(o===h)return n;if(a===c)return o===h-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return Et(this.pattern,this.options)}parse(t){J(t);const e=this.options;if(t==="**")return C;if(t==="")return"";let n,i=null;(n=t.match(Ee))?i=e.dot?Pe:Se:(n=t.match(ge))?i=(e.nocase?e.dot?ye:be:e.dot?me:de)(n[1]):(n=t.match(Me))?i=(e.nocase?e.dot?Ne:je:e.dot?Te:Ae)(n):(n=t.match(ve))?i=e.dot?xe:we:(n=t.match(Oe))&&(i=$e);const r=M.fromGlob(t,this.options).toMMPattern();return i&&typeof r=="object"&&Reflect.defineProperty(r,"test",{value:i}),r}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const e=this.options,n=e.noglobstar?We:e.dot?Le:ze,i=new Set(e.nocase?["i"]:[]);let r=t.map(h=>{const c=h.map(l=>{if(l instanceof RegExp)for(const g of l.flags.split(""))i.add(g);return typeof l=="string"?Ue(l):l===C?C:l._src});return c.forEach((l,g)=>{const u=c[g+1],p=c[g-1];l!==C||p===C||(p===void 0?u!==void 0&&u!==C?c[g+1]="(?:\\/|"+n+"\\/)?"+u:c[g]=n:u===void 0?c[g-1]=p+"(?:\\/|"+n+")?":u!==C&&(c[g-1]=p+"(?:\\/|\\/"+n+"\\/)"+u,c[g+1]=C))}),c.filter(l=>l!==C).join("/")}).join("|");const[o,a]=t.length>1?["(?:",")"]:["",""];r="^"+o+r+a+"$",this.negate&&(r="^(?!"+r+").+$");try{this.regexp=new RegExp(r,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;const n=this.options;this.isWindows&&(t=t.split("\\").join("/"));const i=this.slashSplit(t);this.debug(this.pattern,"split",i);const r=this.set;this.debug(this.pattern,"set",r);let o=i[i.length-1];if(!o)for(let a=i.length-2;!o&&a>=0;a--)o=i[a];for(let a=0;a<r.length;a++){const h=r[a];let c=i;if(n.matchBase&&h.length===1&&(c=[o]),this.matchOne(c,h,e))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(t){return E.defaults(t).Minimatch}}E.AST=M;E.Minimatch=H;E.escape=ue;E.unescape=F;var Fe=Object.defineProperty,Ze=y((s,t)=>Fe(s,"name",{value:t,configurable:!0}),"t");const _e=/^[A-Z]:\//i,R=Ze((s="")=>s&&s.replaceAll("\\","/").replace(_e,t=>t.toUpperCase()),"normalizeWindowsPath");var Ie=Object.defineProperty,N=y((s,t)=>Ie(s,"name",{value:t,configurable:!0}),"s");const Je=/^[/\\]{2}/,qe=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,St=/^[A-Z]:$/i,vt=/^\/([A-Z]:)?$/i,He=/.(\.[^./]+)$/,Ve=/^[/\\]|^[a-z]:[/\\]/i,Ke=N(()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd"),Pt=N((s,t)=>{let e="",n=0,i=-1,r=0,o=null;for(let a=0;a<=s.length;++a){if(a<s.length)o=s[a];else{if(o==="/")break;o="/"}if(o==="/"){if(!(i===a-1||r===1))if(r===2){if(e.length<2||n!==2||!e.endsWith(".")||e.at(-2)!=="."){if(e.length>2){const h=e.lastIndexOf("/");h===-1?(e="",n=0):(e=e.slice(0,h),n=e.length-1-e.lastIndexOf("/")),i=a,r=0;continue}else if(e.length>0){e="",n=0,i=a,r=0;continue}}t&&(e+=e.length>0?"/..":"..",n=2)}else e.length>0?e+=`/${s.slice(i+1,a)}`:e=s.slice(i+1,a),n=a-i-1;i=a,r=0}else o==="."&&r!==-1?++r:r=-1}return e},"normalizeString"),Z=N(s=>qe.test(s),"isAbsolute"),Mt=N(function(s){if(s.length===0)return".";s=R(s);const t=Je.exec(s),e=Z(s),n=s.at(-1)==="/";return s=Pt(s,!e),s.length===0?e?"/":n?"./":".":(n&&(s+="/"),St.test(s)&&(s+="/"),t?e?`//${s}`:`//./${s}`:e&&!Z(s)?`/${s}`:s)},"normalize"),Qe=N(function(...s){if(s.length===0)return".";let t;for(const e of s)e&&e.length>0&&(t===void 0?t=e:t+=`/${e}`);return t===void 0?".":Mt(t.replaceAll(/\/{2,}/g,"/"))},"join"),Q=N(function(...s){s=s.map(n=>R(n));let t="",e=!1;for(let n=s.length-1;n>=-1&&!e;n--){const i=n>=0?s[n]:Ke();!i||i.length===0||(t=`${i}/${t}`,e=Z(i))}return t=Pt(t,!e),e&&!Z(t)?`/${t}`:t.length>0?t:"."},"resolve");N(function(s){return R(s)},"toNamespacedPath");const Xe=N(function(s){return He.exec(R(s))?.[1]??""},"extname");N(function(s,t){const e=Q(s).replace(vt,"$1").split("/"),n=Q(t).replace(vt,"$1").split("/");if(n[0][1]===":"&&e[0][1]===":"&&e[0]!==n[0])return n.join("/");const i=[...e];for(const r of i){if(n[0]!==r)break;e.shift(),n.shift()}return[...e.map(()=>".."),...n].join("/")},"relative");const jt=N(s=>{const t=R(s).replace(/\/$/,"").split("/").slice(0,-1);return t.length===1&&St.test(t[0])&&(t[0]+="/"),t.join("/")||(Z(s)?"/":".")},"dirname");N(function(s){const t=[s.root,s.dir,s.base??s.name+s.ext].filter(Boolean);return R(s.root?Q(...t):t.join("/"))},"format");const Ye=N((s,t)=>{const e=R(s).split("/").pop();return t&&e.endsWith(t)?e.slice(0,-t.length):e},"basename");N(function(s){const t=Ve.exec(s)?.[0]?.replace(/\\/g,"/")??"",e=Ye(s),n=Xe(e);return{base:e,dir:jt(s),ext:n,name:e.slice(0,e.length-n.length),root:t}},"parse");N((s,t)=>E(Mt(s),t,{nocaseMagicOnly:!0,nocomment:!0,nonegate:!0,optimizationLevel:2,windowsPathsNoEscape:!0}),"matchesGlob");var ts=Object.defineProperty,nt=v((s,t)=>ts(s,"name",{value:t,configurable:!0}),"r");const es="last-update-check.json",Nt=nt(s=>{const t=Bt(s);if(t===void 0)throw new Error("Could not find cache directory");return Qe(t,es)},"getConfigFile"),ss=nt(s=>{const t=Nt(s);try{if(!wt(t))return;const{lastUpdateCheck:e}=JSON.parse(Dt(t,"utf8"));return e}catch{return}},"getLastUpdate"),ns=nt(s=>{const t=Nt(s),e=jt(t);wt(e)||Rt(e,{recursive:!0}),Gt(t,JSON.stringify({lastUpdateCheck:Date.now()}))},"saveLastUpdate");var rs=Object.defineProperty,is=v((s,t)=>rs(s,"name",{value:t,configurable:!0}),"g");const os=is(async(s,t,e)=>{const n=e.replace("__NAME__",s);return await new Promise((i,r)=>{Ut(n,o=>{let a="";o.on("data",h=>a+=h),o.on("end",()=>{try{const h=JSON.parse(a)[t];h||r(new Error("Error getting version")),i(h)}catch{r(new Error("Could not parse version response"))}})}).on("error",o=>r(o))})},"getDistributionVersion");var as=Object.defineProperty,hs=v((s,t)=>as(s,"name",{value:t,configurable:!0}),"i");const fs=hs(async({alwaysRun:s,debug:t,distTag:e="latest",pkg:n,registryUrl:i="https://registry.npmjs.org/-/package/__NAME__/dist-tags",updateCheckInterval:r=1e3*60*60*24})=>{const o=ss(n.name);if(s||!o||o<Date.now()-r){const a=await os(n.name,e,i);if(ns(n.name),_t(a,n.version))return a;t&&console.error(`Latest version (${a}) not newer than current version (${n.version})`)}else t&&console.error(`Too recent to check for a new update. simpleUpdateNotifier() interval set to ${r}ms but only ${Date.now()-o}ms since last check.`);return null},"hasNewVersion");export{fs as default};
1
+ var zt=Object.defineProperty;var v=(s,t)=>zt(s,"name",{value:t,configurable:!0});import{existsSync as wt,readFileSync as Dt,mkdirSync as Rt,writeFileSync as Gt}from"node:fs";import{findCacheDirSync as Bt}from"@visulima/find-cache-dir";import{get as Ut}from"node:https";var Ft=Object.defineProperty,Zt=v((s,t)=>Ft(s,"name",{value:t,configurable:!0}),"o$1");const _t=Zt((s,t)=>{const e=s.split(".").map(Number),i=t.split(".").map(Number);for(const[n,r]of e.entries()){if(r>i[n])return!0;if(r<i[n])return!1}return!1},"semverGt");var It=Object.defineProperty,x=v((s,t)=>It(s,"name",{value:t,configurable:!0}),"w"),Jt=Object.defineProperty,y=x((s,t)=>Jt(s,"name",{value:t,configurable:!0}),"y");function X(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}v(X,"Y");x(X,"Wt");y(X,"getDefaultExportFromCjs");var V,pt;function Y(){if(pt)return V;pt=1;var s=Object.defineProperty,t=y((r,o)=>s(r,"name",{value:o,configurable:!0}),"u");V=e;function e(r,o,a){r instanceof RegExp&&(r=i(r,a)),o instanceof RegExp&&(o=i(o,a));var h=n(r,o,a);return h&&{start:h[0],end:h[1],pre:a.slice(0,h[0]),body:a.slice(h[0]+r.length,h[1]),post:a.slice(h[1]+o.length)}}v(e,"e"),x(e,"e"),y(e,"balanced"),t(e,"balanced");function i(r,o){var a=o.match(r);return a?a[0]:null}v(i,"s"),x(i,"s"),y(i,"maybeMatch"),t(i,"maybeMatch"),e.range=n;function n(r,o,a){var h,c,l,g,u,p=a.indexOf(r),f=a.indexOf(o,p+1),m=p;if(p>=0&&f>0){if(r===o)return[p,f];for(h=[],l=a.length;m>=0&&!u;)m==p?(h.push(m),p=a.indexOf(r,m+1)):h.length==1?u=[h.pop(),f]:(c=h.pop(),c<l&&(l=c,g=f),f=a.indexOf(o,m+1)),m=p<f&&p>=0?p:f;h.length&&(u=[l,g])}return u}return v(n,"i"),x(n,"r"),y(n,"range"),t(n,"range"),V}v(Y,"xt");x(Y,"Ct");y(Y,"requireBalancedMatch");var K,ut;function tt(){if(ut)return K;ut=1;var s=Object.defineProperty,t=y((d,O)=>s(d,"name",{value:O,configurable:!0}),"o"),e=Y();K=u;var i="\0SLASH"+Math.random()+"\0",n="\0OPEN"+Math.random()+"\0",r="\0CLOSE"+Math.random()+"\0",o="\0COMMA"+Math.random()+"\0",a="\0PERIOD"+Math.random()+"\0";function h(d){return parseInt(d,10)==d?parseInt(d,10):d.charCodeAt(0)}v(h,"h"),x(h,"h"),y(h,"numeric"),t(h,"numeric");function c(d){return d.split("\\\\").join(i).split("\\{").join(n).split("\\}").join(r).split("\\,").join(o).split("\\.").join(a)}v(c,"c"),x(c,"c"),y(c,"escapeBraces"),t(c,"escapeBraces");function l(d){return d.split(i).join("\\").split(n).join("{").split(r).join("}").split(o).join(",").split(a).join(".")}v(l,"l"),x(l,"l"),y(l,"unescapeBraces"),t(l,"unescapeBraces");function g(d){if(!d)return[""];var O=[],S=e("{","}",d);if(!S)return d.split(",");var w=S.pre,G=S.body,W=S.post,P=w.split(",");P[P.length-1]+="{"+G+"}";var L=g(W);return W.length&&(P[P.length-1]+=L.shift(),P.push.apply(P,L)),O.push.apply(O,P),O}v(g,"g"),x(g,"g"),y(g,"parseCommaParts"),t(g,"parseCommaParts");function u(d){return d?(d.substr(0,2)==="{}"&&(d="\\{\\}"+d.substr(2)),j(c(d),!0).map(l)):[]}v(u,"u"),x(u,"u"),y(u,"expandTop"),t(u,"expandTop");function p(d){return"{"+d+"}"}v(p,"p"),x(p,"p"),y(p,"embrace"),t(p,"embrace");function f(d){return/^-?0\d/.test(d)}v(f,"f"),x(f,"f"),y(f,"isPadded"),t(f,"isPadded");function m(d,O){return d<=O}v(m,"m"),x(m,"m"),y(m,"lte"),t(m,"lte");function A(d,O){return d>=O}v(A,"O"),x(A,"M"),y(A,"gte"),t(A,"gte");function j(d,O){var S=[],w=e("{","}",d);if(!w)return[d];var G=w.pre,W=w.post.length?j(w.post,!1):[""];if(/\$$/.test(w.pre))for(var P=0;P<W.length;P++){var L=G+"{"+w.body+"}"+W[P];S.push(L)}else{var jt=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(w.body),rt=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(w.body),_=jt||rt,Tt=w.body.indexOf(",")>=0;if(!_&&!Tt)return w.post.match(/,.*\}/)?(d=w.pre+"{"+w.body+r+w.post,j(d)):[d];var $;if(_)$=w.body.split(/\.\./);else if($=g(w.body),$.length===1&&($=j($[0],!1).map(p),$.length===1))return W.map(function(Lt){return w.pre+$[0]+Lt});var z;if(_){var nt=h($[0]),ot=h($[1]),Ct=Math.max($[0].length,$[1].length),at=$.length==3?Math.abs(h($[2])):1,ht=m,kt=ot<nt;kt&&(at*=-1,ht=A);var Wt=$.some(f);z=[];for(var B=nt;ht(B,ot);B+=at){var k;if(rt)k=String.fromCharCode(B),k==="\\"&&(k="");else if(k=String(B),Wt){var ct=Ct-k.length;if(ct>0){var lt=new Array(ct+1).join("0");B<0?k="-"+lt+k.slice(1):k=lt+k}}z.push(k)}}else{z=[];for(var D=0;D<$.length;D++)z.push.apply(z,j($[D],!1))}for(var D=0;D<z.length;D++)for(var P=0;P<W.length;P++){var L=G+z[D]+W[P];(!O||_||L)&&S.push(L)}}return S}return v(j,"$"),x(j,"A"),y(j,"expand"),t(j,"expand"),K}v(tt,"St");x(tt,"Rt");y(tt,"requireBraceExpansion");var qt=tt();const Ht=X(qt);var Vt=Object.defineProperty,Kt=y((s,t)=>Vt(s,"name",{value:t,configurable:!0}),"r$1");const J=Kt(s=>{if(typeof s!="string")throw new TypeError("invalid pattern");if(s.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var Qt=Object.defineProperty,q=y((s,t)=>Qt(s,"name",{value:t,configurable:!0}),"p$1");const Xt={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},U=q(s=>s.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),Yt=q(s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),ft=q(s=>s.join(""),"rangesToString"),te=q((s,t)=>{const e=t;if(s.charAt(e)!=="[")throw new Error("not in a brace expression");const i=[],n=[];let r=e+1,o=!1,a=!1,h=!1,c=!1,l=e,g="";t:for(;r<s.length;){const f=s.charAt(r);if((f==="!"||f==="^")&&r===e+1){c=!0,r++;continue}if(f==="]"&&o&&!h){l=r+1;break}if(o=!0,f==="\\"&&!h){h=!0,r++;continue}if(f==="["&&!h){for(const[m,[A,j,d]]of Object.entries(Xt))if(s.startsWith(m,r)){if(g)return["$.",!1,s.length-e,!0];r+=m.length,d?n.push(A):i.push(A),a=a||j;continue t}}if(h=!1,g){f>g?i.push(U(g)+"-"+U(f)):f===g&&i.push(U(f)),g="",r++;continue}if(s.startsWith("-]",r+1)){i.push(U(f+"-")),r+=2;continue}if(s.startsWith("-",r+1)){g=f,r+=2;continue}i.push(U(f)),r++}if(l<r)return["",!1,0,!1];if(!i.length&&!n.length)return["$.",!1,s.length-e,!0];if(n.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!c){const f=i[0].length===2?i[0].slice(-1):i[0];return[Yt(f),!1,l-e,!1]}const u="["+(c?"^":"")+ft(i)+"]",p="["+(c?"":"^")+ft(n)+"]";return[i.length&&n.length?"("+u+"|"+p+")":i.length?u:p,a,l-e,!0]},"parseClass");var ee=Object.defineProperty,se=y((s,t)=>ee(s,"name",{value:t,configurable:!0}),"a$2");const F=se((s,{windowsPathsNoEscape:t=!1}={})=>t?s.replace(/\[([^\/\\])\]/g,"$1"):s.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),"unescape");var ie=Object.defineProperty,et=y((s,t)=>ie(s,"name",{value:t,configurable:!0}),"E$1");const re=new Set(["!","?","+","*","@"]),gt=et(s=>re.has(s),"isExtglobType"),ne="(?!(?:^|/)\\.\\.?(?:$|/))",I="(?!\\.)",oe=new Set(["[","."]),ae=new Set(["..","."]),he=new Set("().*{}+?[]^$\\!"),ce=et(s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),st="[^/]",dt=st+"*?",mt=st+"+?";class M{static{v(this,"j")}static{x(this,"O")}static{y(this,"AST")}static{et(this,"AST")}type;#s;#i;#n=!1;#t=[];#e;#o;#h;#a=!1;#r;#c;#p=!1;constructor(t,e,i={}){this.type=t,t&&(this.#i=!0),this.#e=e,this.#s=this.#e?this.#e.#s:this,this.#r=this.#s===this?i:this.#s.#r,this.#h=this.#s===this?[]:this.#s.#h,t==="!"&&!this.#s.#a&&this.#h.push(this),this.#o=this.#e?this.#e.#t.length:0}get hasMagic(){if(this.#i!==void 0)return this.#i;for(const t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#i=!0;return this.#i}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#c=this.#t.map(t=>String(t)).join("")}#f(){if(this!==this.#s)throw new Error("should only call on root");if(this.#a)return this;this.toString(),this.#a=!0;let t;for(;t=this.#h.pop();){if(t.type!=="!")continue;let e=t,i=e.#e;for(;i;){for(let n=e.#o+1;!i.type&&n<i.#t.length;n++)for(const r of t.#t){if(typeof r=="string")throw new Error("string part in extglob AST??");r.copyIn(i.#t[n])}e=i,i=e.#e}}return this}push(...t){for(const e of t)if(e!==""){if(typeof e!="string"&&!(e instanceof M&&e.#e===this))throw new Error("invalid part: "+e);this.#t.push(e)}}toJSON(){const t=this.type===null?this.#t.slice().map(e=>typeof e=="string"?e:e.toJSON()):[this.type,...this.#t.map(e=>e.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#s||this.#s.#a&&this.#e?.type==="!")&&t.push({}),t}isStart(){if(this.#s===this)return!0;if(!this.#e?.isStart())return!1;if(this.#o===0)return!0;const t=this.#e;for(let e=0;e<this.#o;e++){const i=t.#t[e];if(!(i instanceof M&&i.type==="!"))return!1}return!0}isEnd(){if(this.#s===this||this.#e?.type==="!")return!0;if(!this.#e?.isEnd())return!1;if(!this.type)return this.#e?.isEnd();const t=this.#e?this.#e.#t.length:0;return this.#o===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){const e=new M(this.type,t);for(const i of this.#t)e.copyIn(i);return e}static#l(t,e,i,n){let r=!1,o=!1,a=-1,h=!1;if(e.type===null){let p=i,f="";for(;p<t.length;){const m=t.charAt(p++);if(r||m==="\\"){r=!r,f+=m;continue}if(o){p===a+1?(m==="^"||m==="!")&&(h=!0):m==="]"&&!(p===a+2&&h)&&(o=!1),f+=m;continue}else if(m==="["){o=!0,a=p,h=!1,f+=m;continue}if(!n.noext&&gt(m)&&t.charAt(p)==="("){e.push(f),f="";const A=new M(m,e);p=M.#l(t,A,p,n),e.push(A);continue}f+=m}return e.push(f),p}let c=i+1,l=new M(null,e);const g=[];let u="";for(;c<t.length;){const p=t.charAt(c++);if(r||p==="\\"){r=!r,u+=p;continue}if(o){c===a+1?(p==="^"||p==="!")&&(h=!0):p==="]"&&!(c===a+2&&h)&&(o=!1),u+=p;continue}else if(p==="["){o=!0,a=c,h=!1,u+=p;continue}if(gt(p)&&t.charAt(c)==="("){l.push(u),u="";const f=new M(p,l);l.push(f),c=M.#l(t,f,c,n);continue}if(p==="|"){l.push(u),u="",g.push(l),l=new M(null,e);continue}if(p===")")return u===""&&e.#t.length===0&&(e.#p=!0),l.push(u),u="",e.push(...g,l),c;u+=p}return e.type=null,e.#i=void 0,e.#t=[t.substring(i-1)],c}static fromGlob(t,e={}){const i=new M(null,void 0,e);return M.#l(t,i,0,e),i}toMMPattern(){if(this!==this.#s)return this.#s.toMMPattern();const t=this.toString(),[e,i,n,r]=this.toRegExpSource();if(!(n||this.#i||this.#r.nocase&&!this.#r.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return i;const o=(this.#r.nocase?"i":"")+(r?"u":"");return Object.assign(new RegExp(`^${e}$`,o),{_src:e,_glob:t})}get options(){return this.#r}toRegExpSource(t){const e=t??!!this.#r.dot;if(this.#s===this&&this.#f(),!this.type){const h=this.isStart()&&this.isEnd(),c=this.#t.map(u=>{const[p,f,m,A]=typeof u=="string"?M.#g(u,this.#i,h):u.toRegExpSource(t);return this.#i=this.#i||m,this.#n=this.#n||A,p}).join("");let l="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&ae.has(this.#t[0]))){const u=oe,p=e&&u.has(c.charAt(0))||c.startsWith("\\.")&&u.has(c.charAt(2))||c.startsWith("\\.\\.")&&u.has(c.charAt(4)),f=!e&&!t&&u.has(c.charAt(0));l=p?ne:f?I:""}let g="";return this.isEnd()&&this.#s.#a&&this.#e?.type==="!"&&(g="(?:$|\\/)"),[l+c+g,F(c),this.#i=!!this.#i,this.#n]}const i=this.type==="*"||this.type==="+",n=this.type==="!"?"(?:(?!(?:":"(?:";let r=this.#u(e);if(this.isStart()&&this.isEnd()&&!r&&this.type!=="!"){const h=this.toString();return this.#t=[h],this.type=null,this.#i=void 0,[h,F(this.toString()),!1,!1]}let o=!i||t||e||!I?"":this.#u(!0);o===r&&(o=""),o&&(r=`(?:${r})(?:${o})*?`);let a="";if(this.type==="!"&&this.#p)a=(this.isStart()&&!e?I:"")+mt;else{const h=this.type==="!"?"))"+(this.isStart()&&!e&&!t?I:"")+dt+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=n+r+h}return[a,F(r),this.#i=!!this.#i,this.#n]}#u(t){return this.#t.map(e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");const[i,n,r,o]=e.toRegExpSource(t);return this.#n=this.#n||o,i}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join("|")}static#g(t,e,i=!1){let n=!1,r="",o=!1;for(let a=0;a<t.length;a++){const h=t.charAt(a);if(n){n=!1,r+=(he.has(h)?"\\":"")+h;continue}if(h==="\\"){a===t.length-1?r+="\\\\":n=!0;continue}if(h==="["){const[c,l,g,u]=te(t,a);if(g){r+=c,o=o||l,a+=g-1,e=e||u;continue}}if(h==="*"){i&&t==="*"?r+=mt:r+=dt,e=!0;continue}if(h==="?"){r+=st,e=!0;continue}r+=ce(h)}return[r,F(t),!!e,o]}}var le=Object.defineProperty,pe=y((s,t)=>le(s,"name",{value:t,configurable:!0}),"a$1");const ue=pe((s,{windowsPathsNoEscape:t=!1}={})=>t?s.replace(/[?*()[\]]/g,"[$&]"):s.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var fe=Object.defineProperty,b=y((s,t)=>fe(s,"name",{value:t,configurable:!0}),"h$1");const E=b((s,t,e={})=>(J(t),!e.nocomment&&t.charAt(0)==="#"?!1:new H(t,e).match(s)),"minimatch"),ge=/^\*+([^+@!?\*\[\(]*)$/,de=b(s=>t=>!t.startsWith(".")&&t.endsWith(s),"starDotExtTest"),me=b(s=>t=>t.endsWith(s),"starDotExtTestDot"),be=b(s=>(s=s.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(s)),"starDotExtTestNocase"),ye=b(s=>(s=s.toLowerCase(),t=>t.toLowerCase().endsWith(s)),"starDotExtTestNocaseDot"),ve=/^\*+\.\*+$/,we=b(s=>!s.startsWith(".")&&s.includes("."),"starDotStarTest"),xe=b(s=>s!=="."&&s!==".."&&s.includes("."),"starDotStarTestDot"),Oe=/^\.\*+$/,$e=b(s=>s!=="."&&s!==".."&&s.startsWith("."),"dotStarTest"),Ee=/^\*+$/,Se=b(s=>s.length!==0&&!s.startsWith("."),"starTest"),Pe=b(s=>s.length!==0&&s!=="."&&s!=="..","starTestDot"),Me=/^\?+([^+@!?\*\[\(]*)?$/,Ae=b(([s,t=""])=>{const e=xt([s]);return t?(t=t.toLowerCase(),i=>e(i)&&i.toLowerCase().endsWith(t)):e},"qmarksTestNocase"),Ne=b(([s,t=""])=>{const e=Ot([s]);return t?(t=t.toLowerCase(),i=>e(i)&&i.toLowerCase().endsWith(t)):e},"qmarksTestNocaseDot"),je=b(([s,t=""])=>{const e=Ot([s]);return t?i=>e(i)&&i.endsWith(t):e},"qmarksTestDot"),Te=b(([s,t=""])=>{const e=xt([s]);return t?i=>e(i)&&i.endsWith(t):e},"qmarksTest"),xt=b(([s])=>{const t=s.length;return e=>e.length===t&&!e.startsWith(".")},"qmarksTestNoExt"),Ot=b(([s])=>{const t=s.length;return e=>e.length===t&&e!=="."&&e!==".."},"qmarksTestNoExtDot"),$t=process?process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",bt={win32:{sep:"\\"},posix:{sep:"/"}},Ce=$t==="win32"?bt.win32.sep:bt.posix.sep;E.sep=Ce;const C=Symbol("globstar **");E.GLOBSTAR=C;const ke="[^/]",We=ke+"*?",Le="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",ze="(?:(?!(?:\\/|^)\\.).)*?",De=b((s,t={})=>e=>E(e,s,t),"filter");E.filter=De;const T=b((s,t={})=>Object.assign({},s,t),"ext"),Re=b(s=>{if(!s||typeof s!="object"||!Object.keys(s).length)return E;const t=E;return Object.assign(b((e,i,n={})=>t(e,i,T(s,n)),"m"),{Minimatch:class extends t.Minimatch{static{v(this,"Minimatch")}static{x(this,"Minimatch")}static{y(this,"Minimatch")}static{b(this,"Minimatch")}constructor(e,i={}){super(e,T(s,i))}static defaults(e){return t.defaults(T(s,e)).Minimatch}},AST:class extends t.AST{static{v(this,"AST")}static{x(this,"AST")}static{y(this,"AST")}static{b(this,"AST")}constructor(e,i,n={}){super(e,i,T(s,n))}static fromGlob(e,i={}){return t.AST.fromGlob(e,T(s,i))}},unescape:b((e,i={})=>t.unescape(e,T(s,i)),"unescape"),escape:b((e,i={})=>t.escape(e,T(s,i)),"escape"),filter:b((e,i={})=>t.filter(e,T(s,i)),"filter"),defaults:b(e=>t.defaults(T(s,e)),"defaults"),makeRe:b((e,i={})=>t.makeRe(e,T(s,i)),"makeRe"),braceExpand:b((e,i={})=>t.braceExpand(e,T(s,i)),"braceExpand"),match:b((e,i,n={})=>t.match(e,i,T(s,n)),"match"),sep:t.sep,GLOBSTAR:C})},"defaults");E.defaults=Re;const Et=b((s,t={})=>(J(s),t.nobrace||!/\{(?:(?!\{).)*\}/.test(s)?[s]:Ht(s)),"braceExpand");E.braceExpand=Et;const Ge=b((s,t={})=>new H(s,t).makeRe(),"makeRe");E.makeRe=Ge;const Be=b((s,t,e={})=>{const i=new H(t,e);return s=s.filter(n=>i.match(n)),i.options.nonull&&!s.length&&s.push(t),s},"match");E.match=Be;const yt=/[?*]|[+@!]\(.*?\)|\[|\]/,Ue=b(s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape");class H{static{v(this,"U")}static{x(this,"H")}static{y(this,"Minimatch")}static{b(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){J(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||$t,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const e of t)if(typeof e!="string")return!0;return!1}debug(...t){}make(){const t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...r)=>console.error(...r)),this.debug(this.pattern,this.globSet);const i=this.globSet.map(r=>this.slashSplit(r));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let n=this.globParts.map((r,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){const h=r[0]===""&&r[1]===""&&(r[2]==="?"||!yt.test(r[2]))&&!yt.test(r[3]),c=/^[a-z]:/i.test(r[0]);if(h)return[...r.slice(0,4),...r.slice(4).map(l=>this.parse(l))];if(c)return[r[0],...r.slice(1).map(l=>this.parse(l))]}return r.map(h=>this.parse(h))});if(this.debug(this.pattern,n),this.set=n.filter(r=>r.indexOf(!1)===-1),this.isWindows)for(let r=0;r<this.set.length;r++){const o=this.set[r];o[0]===""&&o[1]===""&&this.globParts[r][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let i=0;i<t.length;i++)for(let n=0;n<t[i].length;n++)t[i][n]==="**"&&(t[i][n]="*");const{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let i=-1;for(;(i=e.indexOf("**",i+1))!==-1;){let n=i;for(;e[n+1]==="**";)n++;n!==i&&e.splice(i,n-i)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((i,n)=>{const r=i[i.length-1];return n==="**"&&r==="**"?i:n===".."&&r&&r!==".."&&r!=="."&&r!=="**"?(i.pop(),i):(i.push(n),i)},[]),e.length===0?[""]:e))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let n=1;n<t.length-1;n++){const r=t[n];n===1&&r===""&&t[0]===""||(r==="."||r==="")&&(e=!0,t.splice(n,1),n--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(e=!0,t.pop())}let i=0;for(;(i=t.indexOf("..",i+1))!==-1;){const n=t[i-1];n&&n!=="."&&n!==".."&&n!=="**"&&(e=!0,t.splice(i-1,2),i-=2)}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let i of t){let n=-1;for(;(n=i.indexOf("**",n+1))!==-1;){let o=n;for(;i[o+1]==="**";)o++;o>n&&i.splice(n+1,o-n);let a=i[n+1];const h=i[n+2],c=i[n+3];if(a!==".."||!h||h==="."||h===".."||!c||c==="."||c==="..")continue;e=!0,i.splice(n,1);const l=i.slice(0);l[n]="**",t.push(l),n--}if(!this.preserveMultipleSlashes){for(let o=1;o<i.length-1;o++){const a=i[o];o===1&&a===""&&i[0]===""||(a==="."||a==="")&&(e=!0,i.splice(o,1),o--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(e=!0,i.pop())}let r=0;for(;(r=i.indexOf("..",r+1))!==-1;){const o=i[r-1];if(o&&o!=="."&&o!==".."&&o!=="**"){e=!0;const a=r===1&&i[r+1]==="**"?["."]:[];i.splice(r-1,2,...a),i.length===0&&i.push(""),r-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let i=e+1;i<t.length;i++){const n=this.partsMatch(t[e],t[i],!this.preserveMultipleSlashes);if(n){t[e]=[],t[i]=n;break}}return t.filter(e=>e.length)}partsMatch(t,e,i=!1){let n=0,r=0,o=[],a="";for(;n<t.length&&r<e.length;)if(t[n]===e[r])o.push(a==="b"?e[r]:t[n]),n++,r++;else if(i&&t[n]==="**"&&e[r]===t[n+1])o.push(t[n]),n++;else if(i&&e[r]==="**"&&t[n]===e[r+1])o.push(e[r]),r++;else if(t[n]==="*"&&e[r]&&(this.options.dot||!e[r].startsWith("."))&&e[r]!=="**"){if(a==="b")return!1;a="a",o.push(t[n]),n++,r++}else if(e[r]==="*"&&t[n]&&(this.options.dot||!t[n].startsWith("."))&&t[n]!=="**"){if(a==="a")return!1;a="b",o.push(e[r]),n++,r++}else return!1;return t.length===e.length&&o}parseNegate(){if(this.nonegate)return;const t=this.pattern;let e=!1,i=0;for(let n=0;n<t.length&&t.charAt(n)==="!";n++)e=!e,i++;i&&(this.pattern=t.slice(i)),this.negate=e}matchOne(t,e,i=!1){const n=this.options;if(this.isWindows){const m=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),A=!m&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),j=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),d=!j&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3]),O=A?3:m?0:void 0,S=d?3:j?0:void 0;if(typeof O=="number"&&typeof S=="number"){const[w,G]=[t[O],e[S]];w.toLowerCase()===G.toLowerCase()&&(e[S]=w,S>O?e=e.slice(S):O>S&&(t=t.slice(O)))}}const{optimizationLevel:r=1}=this.options;r>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var o=0,a=0,h=t.length,c=e.length;o<h&&a<c;o++,a++){this.debug("matchOne loop");var l=e[a],g=t[o];if(this.debug(e,l,g),l===!1)return!1;if(l===C){this.debug("GLOBSTAR",[e,l,g]);var u=o,p=a+1;if(p===c){for(this.debug("** at the end");o<h;o++)if(t[o]==="."||t[o]===".."||!n.dot&&t[o].charAt(0)===".")return!1;return!0}for(;u<h;){var f=t[u];if(this.debug(`
2
+ globstar while`,t,u,e,p,f),this.matchOne(t.slice(u),e.slice(p),i))return this.debug("globstar found match!",u,h,f),!0;if(f==="."||f===".."||!n.dot&&f.charAt(0)==="."){this.debug("dot detected!",t,u,e,p);break}this.debug("globstar swallow a segment, and continue"),u++}return!!(i&&(this.debug(`
3
+ >>> no match, partial?`,t,u,e,p),u===h))}let m;if(typeof l=="string"?(m=g===l,this.debug("string match",l,g,m)):(m=l.test(g),this.debug("pattern match",l,g,m)),!m)return!1}if(o===h&&a===c)return!0;if(o===h)return i;if(a===c)return o===h-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return Et(this.pattern,this.options)}parse(t){J(t);const e=this.options;if(t==="**")return C;if(t==="")return"";let i,n=null;(i=t.match(Ee))?n=e.dot?Pe:Se:(i=t.match(ge))?n=(e.nocase?e.dot?ye:be:e.dot?me:de)(i[1]):(i=t.match(Me))?n=(e.nocase?e.dot?Ne:Ae:e.dot?je:Te)(i):(i=t.match(ve))?n=e.dot?xe:we:(i=t.match(Oe))&&(n=$e);const r=M.fromGlob(t,this.options).toMMPattern();return n&&typeof r=="object"&&Reflect.defineProperty(r,"test",{value:n}),r}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const e=this.options,i=e.noglobstar?We:e.dot?Le:ze,n=new Set(e.nocase?["i"]:[]);let r=t.map(h=>{const c=h.map(l=>{if(l instanceof RegExp)for(const g of l.flags.split(""))n.add(g);return typeof l=="string"?Ue(l):l===C?C:l._src});return c.forEach((l,g)=>{const u=c[g+1],p=c[g-1];l!==C||p===C||(p===void 0?u!==void 0&&u!==C?c[g+1]="(?:\\/|"+i+"\\/)?"+u:c[g]=i:u===void 0?c[g-1]=p+"(?:\\/|"+i+")?":u!==C&&(c[g-1]=p+"(?:\\/|\\/"+i+"\\/)"+u,c[g+1]=C))}),c.filter(l=>l!==C).join("/")}).join("|");const[o,a]=t.length>1?["(?:",")"]:["",""];r="^"+o+r+a+"$",this.negate&&(r="^(?!"+r+").+$");try{this.regexp=new RegExp(r,[...n].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;const i=this.options;this.isWindows&&(t=t.split("\\").join("/"));const n=this.slashSplit(t);this.debug(this.pattern,"split",n);const r=this.set;this.debug(this.pattern,"set",r);let o=n[n.length-1];if(!o)for(let a=n.length-2;!o&&a>=0;a--)o=n[a];for(let a=0;a<r.length;a++){const h=r[a];let c=n;if(i.matchBase&&h.length===1&&(c=[o]),this.matchOne(c,h,e))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(t){return E.defaults(t).Minimatch}}E.AST=M;E.Minimatch=H;E.escape=ue;E.unescape=F;var Fe=Object.defineProperty,Ze=y((s,t)=>Fe(s,"name",{value:t,configurable:!0}),"t");const _e=/^[A-Z]:\//i,R=Ze((s="")=>s&&s.replaceAll("\\","/").replace(_e,t=>t.toUpperCase()),"normalizeWindowsPath");var Ie=Object.defineProperty,N=y((s,t)=>Ie(s,"name",{value:t,configurable:!0}),"r");const Je=/^[/\\]{2}/,qe=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,St=/^[A-Z]:$/i,vt=/^\/([A-Z]:)?$/i,He=/.(\.[^./]+)$/,Ve=/^[/\\]|^[a-z]:[/\\]/i,Ke=N(()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/","cwd"),Pt=N((s,t)=>{let e="",i=0,n=-1,r=0,o=null;for(let a=0;a<=s.length;++a){if(a<s.length)o=s[a];else{if(o==="/")break;o="/"}if(o==="/"){if(!(n===a-1||r===1))if(r===2){if(e.length<2||i!==2||!e.endsWith(".")||e.at(-2)!=="."){if(e.length>2){const h=e.lastIndexOf("/");h===-1?(e="",i=0):(e=e.slice(0,h),i=e.length-1-e.lastIndexOf("/")),n=a,r=0;continue}else if(e.length>0){e="",i=0,n=a,r=0;continue}}t&&(e+=e.length>0?"/..":"..",i=2)}else e.length>0?e+=`/${s.slice(n+1,a)}`:e=s.slice(n+1,a),i=a-n-1;n=a,r=0}else o==="."&&r!==-1?++r:r=-1}return e},"normalizeString"),Z=N(s=>qe.test(s),"isAbsolute"),Mt=N(function(s){if(s.length===0)return".";s=R(s);const t=Je.exec(s),e=Z(s),i=s.at(-1)==="/";return s=Pt(s,!e),s.length===0?e?"/":i?"./":".":(i&&(s+="/"),St.test(s)&&(s+="/"),t?e?`//${s}`:`//./${s}`:e&&!Z(s)?`/${s}`:s)},"normalize"),Qe=N((...s)=>{let t="";for(const e of s)if(e)if(t.length>0){const i=t[t.length-1]==="/",n=e[0]==="/";i&&n?t+=e.slice(1):t+=i||n?e:`/${e}`}else t+=e;return Mt(t)},"join"),Q=N(function(...s){s=s.map(i=>R(i));let t="",e=!1;for(let i=s.length-1;i>=-1&&!e;i--){const n=i>=0?s[i]:Ke();!n||n.length===0||(t=`${n}/${t}`,e=Z(n))}return t=Pt(t,!e),e&&!Z(t)?`/${t}`:t.length>0?t:"."},"resolve");N(function(s){return R(s)},"toNamespacedPath");const Xe=N(function(s){return He.exec(R(s))?.[1]??""},"extname");N(function(s,t){const e=Q(s).replace(vt,"$1").split("/"),i=Q(t).replace(vt,"$1").split("/");if(i[0][1]===":"&&e[0][1]===":"&&e[0]!==i[0])return i.join("/");const n=[...e];for(const r of n){if(i[0]!==r)break;e.shift(),i.shift()}return[...e.map(()=>".."),...i].join("/")},"relative");const At=N(s=>{const t=R(s).replace(/\/$/,"").split("/").slice(0,-1);return t.length===1&&St.test(t[0])&&(t[0]+="/"),t.join("/")||(Z(s)?"/":".")},"dirname");N(function(s){const t=[s.root,s.dir,s.base??s.name+s.ext].filter(Boolean);return R(s.root?Q(...t):t.join("/"))},"format");const Ye=N((s,t)=>{const e=R(s).split("/").pop();return t&&e.endsWith(t)?e.slice(0,-t.length):e},"basename");N(function(s){const t=Ve.exec(s)?.[0]?.replace(/\\/g,"/")??"",e=Ye(s),i=Xe(e);return{base:e,dir:At(s),ext:i,name:e.slice(0,e.length-i.length),root:t}},"parse");N((s,t)=>E(Mt(s),t,{nocaseMagicOnly:!0,nocomment:!0,nonegate:!0,optimizationLevel:2,windowsPathsNoEscape:!0}),"matchesGlob");var ts=Object.defineProperty,it=v((s,t)=>ts(s,"name",{value:t,configurable:!0}),"r");const es="last-update-check.json",Nt=it(s=>{const t=Bt(s);if(t===void 0)throw new Error("Could not find cache directory");return Qe(t,es)},"getConfigFile"),ss=it(s=>{const t=Nt(s);try{if(!wt(t))return;const{lastUpdateCheck:e}=JSON.parse(Dt(t,"utf8"));return e}catch{return}},"getLastUpdate"),is=it(s=>{const t=Nt(s),e=At(t);wt(e)||Rt(e,{recursive:!0}),Gt(t,JSON.stringify({lastUpdateCheck:Date.now()}))},"saveLastUpdate");var rs=Object.defineProperty,ns=v((s,t)=>rs(s,"name",{value:t,configurable:!0}),"g");const os=ns(async(s,t,e)=>{const i=e.replace("__NAME__",s);return await new Promise((n,r)=>{Ut(i,o=>{let a="";o.on("data",h=>a+=h),o.on("end",()=>{try{const h=JSON.parse(a)[t];h||r(new Error("Error getting version")),n(h)}catch{r(new Error("Could not parse version response"))}})}).on("error",o=>r(o))})},"getDistributionVersion");var as=Object.defineProperty,hs=v((s,t)=>as(s,"name",{value:t,configurable:!0}),"i");const fs=hs(async({alwaysRun:s,debug:t,distTag:e="latest",pkg:i,registryUrl:n="https://registry.npmjs.org/-/package/__NAME__/dist-tags",updateCheckInterval:r=1e3*60*60*24})=>{const o=ss(i.name);if(s||!o||o<Date.now()-r){const a=await os(i.name,e,n);if(is(i.name),_t(a,i.version))return a;t&&console.error(`Latest version (${a}) not newer than current version (${i.version})`)}else t&&console.error(`Too recent to check for a new update. simpleUpdateNotifier() interval set to ${r}ms but only ${Date.now()-o}ms since last check.`);return null},"hasNewVersion");export{fs as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/cerebro",
3
- "version": "1.1.29",
3
+ "version": "1.1.30",
4
4
  "description": "A delightful toolkit for building Node-powered CLIs.",
5
5
  "keywords": [
6
6
  "command",
@@ -86,10 +86,10 @@
86
86
  "LICENSE.md"
87
87
  ],
88
88
  "dependencies": {
89
- "@visulima/boxen": "1.0.24",
90
- "@visulima/colorize": "1.4.15",
91
- "@visulima/find-cache-dir": "1.0.19",
92
- "@visulima/pail": "2.1.14",
89
+ "@visulima/boxen": "1.0.25",
90
+ "@visulima/colorize": "1.4.16",
91
+ "@visulima/find-cache-dir": "1.0.20",
92
+ "@visulima/pail": "2.1.15",
93
93
  "cli-table3": "^0.6.5",
94
94
  "command-line-args": "^6.0.0",
95
95
  "fastest-levenshtein": "^1.0.16"
@@ -112,7 +112,7 @@
112
112
  "@types/node": "18.19.15",
113
113
  "@visulima/nextra-theme-docs": "4.0.26",
114
114
  "@visulima/packem": "1.9.2",
115
- "@visulima/path": "1.3.0",
115
+ "@visulima/path": "1.3.1",
116
116
  "@vitest/coverage-v8": "^2.1.8",
117
117
  "camelcase": "8.0.0",
118
118
  "conventional-changelog-conventionalcommits": "8.0.0",