>18&63)+a.charAt(g>>12&63)+a.charAt(g>>6&63)+a.charAt(63&g);return f==2?(p=u.charCodeAt(v)<<8,d=u.charCodeAt(++v),m+=a.charAt((g=p+d)>>10)+a.charAt(g>>4&63)+a.charAt(g<<2&63)+"="):f==1&&(g=u.charCodeAt(v),m+=a.charAt(g>>2)+a.charAt(g<<4&63)+"=="),m},decode:function(u){var p=(u=String(u).replace(l,"")).length;p%4==0&&(p=(u=u.replace(/==?$/,"")).length),(p%4==1||/[^+a-zA-Z0-9/]/.test(u))&&s("Invalid character: the string to be decoded is not correctly encoded.");for(var d,h,g=0,f="",m=-1;++m>(-2*g&6)));return f},version:"1.0.0"};(i=function(){return c}.call(t,n,t,e))===void 0||(e.exports=i)})()},172(e,t){t.d=function(n){if(!n)return 0;for(var i=(n=n.toString()).length,r=n.length;r--;){var o=n.charCodeAt(r);56320<=o&&o<=57343&&r--,127>>32-r},rotr:function(i,r){return i<<32-r|i>>>r},endian:function(i){if(i.constructor==Number)return 16711935&n.rotl(i,8)|4278255360&n.rotl(i,24);for(var r=0;r0;i--)r.push(Math.floor(256*Math.random()));return r},bytesToWords:function(i){for(var r=[],o=0,s=0;o>>5]|=i[o]<<24-s%32;return r},wordsToBytes:function(i){for(var r=[],o=0;o<32*i.length;o+=8)r.push(i[o>>>5]>>>24-o%32&255);return r},bytesToHex:function(i){for(var r=[],o=0;o>>4).toString(16)),r.push((15&i[o]).toString(16));return r.join("")},hexToBytes:function(i){for(var r=[],o=0;o>>6*(3-a)&63)):r.push("=");return r.join("")},base64ToBytes:function(i){i=i.replace(/[^A-Z0-9+\/]/gi,"");for(var r=[],o=0,s=0;o>>6-2*s);return r}},e.exports=n},135(e){function t(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}e.exports=function(n){return n!=null&&(t(n)||(function(i){return typeof i.readFloatLE=="function"&&typeof i.slice=="function"&&t(i.slice(0,0))})(n)||!!n._isBuffer)}},542(e,t,n){(function(){var i=n(298),r=n(526).utf8,o=n(135),s=n(526).bin,a=function(l,c){l.constructor==String?l=c&&c.encoding==="binary"?s.stringToBytes(l):r.stringToBytes(l):o(l)?l=Array.prototype.slice.call(l,0):Array.isArray(l)||l.constructor===Uint8Array||(l=l.toString());for(var u=i.bytesToWords(l),p=8*l.length,d=1732584193,h=-271733879,g=-1732584194,f=271733878,m=0;m>>24)|4278255360&(u[m]<<24|u[m]>>>8);u[p>>>5]|=128<>>9<<4)]=p;var v=a._ff,y=a._gg,b=a._hh,w=a._ii;for(m=0;m>>0,h=h+C>>>0,g=g+L>>>0,f=f+K>>>0}return i.endian([d,h,g,f])};a._ff=function(l,c,u,p,d,h,g){var f=l+(c&u|~c&p)+(d>>>0)+g;return(f<>>32-h)+c},a._gg=function(l,c,u,p,d,h,g){var f=l+(c&p|u&~p)+(d>>>0)+g;return(f<>>32-h)+c},a._hh=function(l,c,u,p,d,h,g){var f=l+(c^u^p)+(d>>>0)+g;return(f<>>32-h)+c},a._ii=function(l,c,u,p,d,h,g){var f=l+(u^(c|~p))+(d>>>0)+g;return(f<>>32-h)+c},a._blocksize=16,a._digestsize=16,e.exports=function(l,c){if(l==null)throw new Error("Illegal argument "+l);var u=i.wordsToBytes(a(l,c));return c&&c.asBytes?u:c&&c.asString?s.bytesToString(u):i.bytesToHex(u)}})()},285(e,t,n){var i=n(2);e.exports=function(v,y){if(!v)return[];var b=(y=y||{}).max==null?1/0:y.max;return v.substr(0,2)==="{}"&&(v="\\{\\}"+v.substr(2)),m((function(w){return w.split("\\\\").join(r).split("\\{").join(o).split("\\}").join(s).split("\\,").join(a).split("\\.").join(l)})(v),b,!0).map(u)};var r="\0SLASH"+Math.random()+"\0",o="\0OPEN"+Math.random()+"\0",s="\0CLOSE"+Math.random()+"\0",a="\0COMMA"+Math.random()+"\0",l="\0PERIOD"+Math.random()+"\0";function c(v){return parseInt(v,10)==v?parseInt(v,10):v.charCodeAt(0)}function u(v){return v.split(r).join("\\").split(o).join("{").split(s).join("}").split(a).join(",").split(l).join(".")}function p(v){if(!v)return[""];var y=[],b=i("{","}",v);if(!b)return v.split(",");var w=b.pre,_=b.body,C=b.post,L=w.split(",");L[L.length-1]+="{"+_+"}";var K=p(C);return C.length&&(L[L.length-1]+=K.shift(),L.push.apply(L,K)),y.push.apply(y,L),y}function d(v){return"{"+v+"}"}function h(v){return/^-?0\d/.test(v)}function g(v,y){return v<=y}function f(v,y){return v>=y}function m(v,y,b){var w=[],_=i("{","}",v);if(!_)return[v];var C=_.pre,L=_.post.length?m(_.post,y,!1):[""];if(/\$$/.test(_.pre))for(var K=0;K=0;if(!j&&!Y)return _.post.match(/,(?!,).*\}/)?m(v=_.pre+"{"+_.body+s+_.post,y,!0):[v];if(j)k=_.body.split(/\.\./);else if((k=p(_.body)).length===1&&(k=m(k[0],y,!1).map(d)).length===1)return L.map((function(x){return _.pre+k[0]+x}));if(j){var G=c(k[0]),X=c(k[1]),z=Math.max(k[0].length,k[1].length),Q=k.length==3?Math.max(Math.abs(c(k[2])),1):1,D=g;X0){var de=new Array(Se+1).join("0");ce=B<0?"-"+de+ce.slice(1):de+ce}}ne.push(ce)}}else{ne=[];for(var oe=0;oe"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch{return!1}})()?Reflect.construct:function(d,h,g){var f=[null];f.push.apply(f,h);var m=new(Function.bind.apply(d,f));return g&&r(m,g.prototype),m},i.apply(null,arguments)}function r(c,u){return r=Object.setPrototypeOf||function(p,d){return p.__proto__=d,p},r(c,u)}function o(c){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},o(c)}var s=(function(c){function u(p){var d;return(function(h,g){if(!(h instanceof g))throw new TypeError("Cannot call a class as a function")})(this,u),(d=(function(h,g){return!g||t(g)!=="object"&&typeof g!="function"?(function(f){if(f===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f})(h):g})(this,o(u).call(this,p))).name="ObjectPrototypeMutationError",d}return(function(p,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(d&&d.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),d&&r(p,d)})(u,c),u})(n(Error));function a(c,u){for(var p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},d=u.split("."),h=d.length,g=function(v){var y=d[v];if(!c)return{v:void 0};if(y==="+"){if(Array.isArray(c))return{v:c.map((function(w,_){var C=d.slice(v+1);return C.length>0?a(w,C.join("."),p):p(c,_,d,v)}))};var b=d.slice(0,v).join(".");throw new Error("Object at wildcard (".concat(b,") is not an array"))}c=p(c,y,d,v)},f=0;f2&&arguments[2]!==void 0?arguments[2]:{};if(t(c)!="object"||c===null||u===void 0)return!1;if(typeof u=="number")return u in c;try{var d=!1;return a(c,u,(function(h,g,f,m){if(!l(f,m))return h&&h[g];d=p.own?h.hasOwnProperty(g):g in h})),d}catch{return!1}},hasOwn:function(c,u,p){return this.has(c,u,p||{own:!0})},isIn:function(c,u,p){var d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(t(c)!="object"||c===null||u===void 0)return!1;try{var h=!1,g=!1;return a(c,u,(function(f,m,v,y){return h=h||f===p||!!f&&f[m]===p,g=l(v,y)&&t(f)==="object"&&m in f,f&&f[m]})),d.validPath?h&&g:h}catch{return!1}},ObjectPrototypeMutationError:s}},47(e,t,n){var i=n(410),r=function(c){return typeof c=="string"};function o(c,u){for(var p=[],d=0;d=-1&&!u;p--){var d=p>=0?arguments[p]:rn.cwd();if(!r(d))throw new TypeError("Arguments to path.resolve must be strings");d&&(c=d+"/"+c,u=d.charAt(0)==="/")}return(u?"/":"")+(c=o(c.split("/"),!u).join("/"))||"."},a.normalize=function(c){var u=a.isAbsolute(c),p=c.substr(-1)==="/";return(c=o(c.split("/"),!u).join("/"))||u||(c="."),c&&p&&(c+="/"),(u?"/":"")+c},a.isAbsolute=function(c){return c.charAt(0)==="/"},a.join=function(){for(var c="",u=0;u=0&&y[w]==="";w--);return b>w?[]:y.slice(b,w+1)}c=a.resolve(c).substr(1),u=a.resolve(u).substr(1);for(var d=p(c.split("/")),h=p(u.split("/")),g=Math.min(d.length,h.length),f=g,m=0;m=2&&(w=w.slice(2)):f(C)?w=_[4]:C?L&&(w=w.slice(2)):V>=2&&f(b.protocol)&&(w=_[4]),{protocol:C,slashes:L||f(C),slashesCount:V,rest:w}}function v(y,b,w){if(y=(y=p(y)).replace(s,""),!(this instanceof v))return new v(y,b,w);var _,C,L,K,V,k,ne=d.slice(),O=typeof b,E=this,j=0;for(O!=="object"&&O!=="string"&&(w=b,b=null),w&&typeof w!="function"&&(w=r.parse),_=!(C=m(y||"",b=g(b))).protocol&&!C.slashes,E.slashes=C.slashes||_&&b.slashes,E.protocol=C.protocol||b.protocol||"",y=C.rest,(C.protocol==="file:"&&(C.slashesCount!==2||u.test(y))||!C.slashes&&(C.protocol||C.slashesCount<2||!f(E.protocol)))&&(ne[3]=[/(.*)/,"pathname"]);j{var t=e&&e.__esModule?()=>e.default:()=>e;return be.d(t,{a:t}),t},be.d=(e,t)=>{for(var n in t)be.o(t,n)&&!be.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},be.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),be.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var P0=be(737),k0=be.n(P0);function sr(e){if(!Hr(e))throw new Error("Parameter was not an error")}function Hr(e){return!!e&&typeof e=="object"&&(t=e,Object.prototype.toString.call(t)==="[object Error]")||e instanceof Error;var t}class He extends Error{constructor(t,n){const i=[...arguments],{options:r,shortMessage:o}=(function(a){let l,c="";if(a.length===0)l={};else if(Hr(a[0]))l={cause:a[0]},c=a.slice(1).join(" ")||"";else if(a[0]&&typeof a[0]=="object")l=Object.assign({},a[0]),c=a.slice(1).join(" ")||"";else{if(typeof a[0]!="string")throw new Error("Invalid arguments passed to Layerr");l={},c=c=a.join(" ")||""}return{options:l,shortMessage:c}})(i);let s=o;if(r.cause&&(s=`${s}: ${r.cause.message}`),super(s),this.message=s,r.name&&typeof r.name=="string"?this.name=r.name:this.name="Layerr",r.cause&&Object.defineProperty(this,"_cause",{value:r.cause}),Object.defineProperty(this,"_info",{value:{}}),r.info&&typeof r.info=="object"&&Object.assign(this._info,r.info),Error.captureStackTrace){const a=r.constructorOpt||this.constructor;Error.captureStackTrace(this,a)}}static cause(t){return sr(t),t._cause&&Hr(t._cause)?t._cause:null}static fullStack(t){sr(t);const n=He.cause(t);return n?`${t.stack}
+caused by: ${He.fullStack(n)}`:t.stack??""}static info(t){sr(t);const n={},i=He.cause(t);return i&&Object.assign(n,He.info(i)),t._info&&Object.assign(n,t._info),n}toString(){let t=this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(t=`${t}: ${this.message}`),t}}var $0=be(47),Ti=be.n($0);const Ms="__PATH_SEPARATOR_POSIX__",Bs="__PATH_SEPARATOR_WINDOWS__";function Ae(e){try{const t=e.replace(/\//g,Ms).replace(/\\\\/g,Bs);return encodeURIComponent(t).split(Bs).join("\\\\").split(Ms).join("/")}catch(t){throw new He(t,"Failed encoding path")}}function zs(e){return e.startsWith("/")?e:"/"+e}function Xn(e){let t=e;return t[0]!=="/"&&(t="/"+t),/^.+\/$/.test(t)&&(t=t.substr(0,t.length-1)),t}function R0(e){let t=new(k0())(e).pathname;return t.length<=0&&(t="/"),Xn(t)}function Ne(){for(var e=arguments.length,t=new Array(e),n=0;n1){var o=i.shift();i[0]=o+i[0]}i[0].match(/^file:\/\/\//)?i[0]=i[0].replace(/^([^/:]+):\/*/,"$1:///"):i[0]=i[0].replace(/^([^/:]+):\/*/,"$1://");for(var s=0;s0&&(a=a.replace(/^[\/]+/,"")),a=s0?"?":"")+c.join("&")})(typeof arguments[0]=="object"?arguments[0]:[].slice.call(arguments))})(t.reduce(((i,r,o)=>((o===0||r!=="/"||r==="/"&&i[i.length-1]!=="/")&&i.push(r),i)),[]))}var L0=be(542),En=be.n(L0);function Fs(e,t){const n=e.url.replace("//",""),i=n.indexOf("/")==-1?"/":n.slice(n.indexOf("/")),r=e.method?e.method.toUpperCase():"GET",o=!!/(^|,)\s*auth\s*($|,)/.test(t.qop)&&"auth",s=`00000000${t.nc}`.slice(-8),a=(function(d,h,g,f,m,v,y){const b=y||En()(`${h}:${g}:${f}`);return d&&d.toLowerCase()==="md5-sess"?En()(`${b}:${m}:${v}`):b})(t.algorithm,t.username,t.realm,t.password,t.nonce,t.cnonce,t.ha1),l=En()(`${r}:${i}`),c=o?En()(`${a}:${t.nonce}:${s}:${t.cnonce}:${o}:${l}`):En()(`${a}:${t.nonce}:${l}`),u={username:t.username,realm:t.realm,nonce:t.nonce,uri:i,qop:o,response:c,nc:s,cnonce:t.cnonce,algorithm:t.algorithm,opaque:t.opaque},p=[];for(const d in u)u[d]&&(d==="qop"||d==="nc"||d==="algorithm"?p.push(`${d}=${u[d]}`):p.push(`${d}="${u[d]}"`));return`Digest ${p.join(", ")}`}function Ul(e){return(e.headers&&e.headers.get("www-authenticate")||"").split(/\s/)[0].toLowerCase()==="digest"}var D0=be(101),Vl=be.n(D0);function Us(e){return Vl().decode(e)}function Vs(e,t){var n;return`Basic ${n=`${e}:${t}`,Vl().encode(n)}`}const Hs=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:typeof window<"u"?window:globalThis,I0=Hs.fetch.bind(Hs);let Ge=(function(e){return e.Auto="auto",e.Digest="digest",e.None="none",e.Password="password",e.Token="token",e})({}),$t=(function(e){return e.DataTypeNoLength="data-type-no-length",e.InvalidAuthType="invalid-auth-type",e.InvalidOutputFormat="invalid-output-format",e.LinkUnsupportedAuthType="link-unsupported-auth",e.InvalidUpdateRange="invalid-update-range",e.NotSupported="not-supported",e})({});function Hl(e,t,n,i,r){switch(e.authType){case Ge.Auto:t&&n&&(e.headers.Authorization=Vs(t,n));break;case Ge.Digest:e.digest=(function(s,a,l){return{username:s,password:a,ha1:l,nc:0,algorithm:"md5",hasDigestAuth:!1}})(t,n,r);break;case Ge.None:break;case Ge.Password:e.headers.Authorization=Vs(t,n);break;case Ge.Token:e.headers.Authorization=`${(o=i).token_type} ${o.access_token}`;break;default:throw new He({info:{code:$t.InvalidAuthType}},`Invalid auth type: ${e.authType}`)}var o}be(345),be(800);const qs="@@HOTPATCHER",j0=()=>{};function ar(e){return{original:e,methods:[e],final:!1}}class M0{constructor(){this._configuration={registry:{},getEmptyAction:"null"},this.__type__=qs}get configuration(){return this._configuration}get getEmptyAction(){return this.configuration.getEmptyAction}set getEmptyAction(t){this.configuration.getEmptyAction=t}control(t){let n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(!t||t.__type__!==qs)throw new Error("Failed taking control of target HotPatcher instance: Invalid type or object");return Object.keys(t.configuration.registry).forEach((i=>{this.configuration.registry.hasOwnProperty(i)?n&&(this.configuration.registry[i]=Object.assign({},t.configuration.registry[i])):this.configuration.registry[i]=Object.assign({},t.configuration.registry[i])})),t._configuration=this.configuration,this}execute(t){const n=this.get(t)||j0;for(var i=arguments.length,r=new Array(i>1?i-1:0),o=1;o0;)c=[r.shift().apply(u,c)];return c[0]}})(...n.methods)}isPatched(t){return!!this.configuration.registry[t]}patch(t,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{chain:r=!1}=i;if(this.configuration.registry[t]&&this.configuration.registry[t].final)throw new Error(`Failed patching '${t}': Method marked as being final`);if(typeof n!="function")throw new Error(`Failed patching '${t}': Provided method is not a function`);if(r)this.configuration.registry[t]?this.configuration.registry[t].methods.push(n):this.configuration.registry[t]=ar(n);else if(this.isPatched(t)){const{original:o}=this.configuration.registry[t];this.configuration.registry[t]=Object.assign(ar(n),{original:o})}else this.configuration.registry[t]=ar(n);return this}patchInline(t,n){this.isPatched(t)||this.patch(t,n);for(var i=arguments.length,r=new Array(i>2?i-2:0),o=2;o1?n-1:0),r=1;r{this.patch(t,o,{chain:!0})})),this}restore(t){if(!this.isPatched(t))throw new Error(`Failed restoring method: No method present for key: ${t}`);if(typeof this.configuration.registry[t].original!="function")throw new Error(`Failed restoring method: Original method not found or of invalid type for key: ${t}`);return this.configuration.registry[t].methods=[this.configuration.registry[t].original],this}setFinal(t){if(!this.configuration.registry.hasOwnProperty(t))throw new Error(`Failed marking '${t}' as final: No method found for key`);return this.configuration.registry[t].final=!0,this}}let lr=null;function ql(){return lr||(lr=new M0),lr}function Oi(e){return(function(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let n=t;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(t)===n})(e)?Object.assign({},e):Object.setPrototypeOf(Object.assign({},e),Object.getPrototypeOf(e))}function Ws(){for(var e=arguments.length,t=new Array(e),n=0;n0;){const o=r.shift();i=i?Wl(i,o):Oi(o)}return i}function Wl(e,t){const n=Oi(e);return Object.keys(t).forEach((i=>{n.hasOwnProperty(i)?Array.isArray(t[i])?n[i]=Array.isArray(n[i])?[...n[i],...t[i]]:[...t[i]]:typeof t[i]=="object"&&t[i]?n[i]=typeof n[i]=="object"&&n[i]?Wl(n[i],t[i]):Oi(t[i]):n[i]=t[i]:n[i]=t[i]})),n}function B0(e){const t={};for(const n of e.keys())t[n]=e.get(n);return t}function qr(){for(var e=arguments.length,t=new Array(e),n=0;n(Object.keys(o).forEach((s=>{const a=s.toLowerCase();i.hasOwnProperty(a)?r[i[a]]=o[s]:(i[a]=s,r[s]=o[s])})),r)),{})}be(805);const z0=typeof ArrayBuffer=="function",{toString:F0}=Object.prototype;function Gl(e){return z0&&(e instanceof ArrayBuffer||F0.call(e)==="[object ArrayBuffer]")}function Kl(e){return e!=null&&e.constructor!=null&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function bo(e){return function(){for(var t=[],n=0;nt.patchInline("fetch",I0,n.url,(function(i){let r={};const o={method:i.method};if(i.headers&&(r=qr(r,i.headers)),i.data!==void 0){const[s,a]=(function(l){if(typeof l=="string")return[l,{}];if(Kl(l))return[l,{}];if(Gl(l))return[l,{}];if(l&&typeof l=="object")return[JSON.stringify(l),{"content-type":"application/json"}];throw new Error("Unable to convert request body: Unexpected body type: "+typeof l)})(i.data);o.body=s,r=qr(r,a)}return i.signal&&(o.signal=i.signal),i.withCredentials&&(o.credentials="include"),o.headers=r,o})(n))),e)}var V0=be(285);const ki=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},H0={"[: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]},Cn=e=>e.replace(/[[\]\\-]/g,"\\$&"),Gs=e=>e.join(""),q0=(e,t)=>{const n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");const i=[],r=[];let o=n+1,s=!1,a=!1,l=!1,c=!1,u=n,p="";e:for(;op?i.push(Cn(p)+"-"+Cn(f)):f===p&&i.push(Cn(f)),p="",o++):e.startsWith("-]",o+1)?(i.push(Cn(f+"-")),o+=2):e.startsWith("-",o+1)?(p=f,o+=2):(i.push(Cn(f)),o++)}else l=!0,o++}else c=!0,o++}if(u1&&arguments[1]!==void 0?arguments[1]:{};return t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")};var We;const W0=new Set(["!","?","+","*","@"]),Gr=e=>W0.has(e),Ks=e=>Gr(e.type),G0=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),K0=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),X0=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),Xs=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),ur="(?!\\.)",Z0=new Set(["[","."]),J0=new Set(["..","."]),Y0=new Set("().*{}+?[]^$\\!"),wo="[^/]",Zs=wo+"*?",Js=wo+"+?";class xo{type;#n;#i;#r=!1;#e=[];#t;#a;#u;#l=!1;#o;#s;#c=!1;constructor(t,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.type=t,t&&(this.#i=!0),this.#t=n,this.#n=this.#t?this.#t.#n:this,this.#o=this.#n===this?i:this.#n.#o,this.#u=this.#n===this?[]:this.#n.#u,t!=="!"||this.#n.#l||this.#u.push(this),this.#a=this.#t?this.#t.#e.length:0}get hasMagic(){if(this.#i!==void 0)return this.#i;for(const t of this.#e)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#i=!0;return this.#i}toString(){return this.#s!==void 0?this.#s:this.type?this.#s=this.type+"("+this.#e.map((t=>String(t))).join("|")+")":this.#s=this.#e.map((t=>String(t))).join("")}#v(){if(this!==this.#n)throw new Error("should only call on root");if(this.#l)return this;let t;for(this.toString(),this.#l=!0;t=this.#u.pop();){if(t.type!=="!")continue;let n=t,i=n.#t;for(;i;){for(let r=n.#a+1;!i.type&&rtypeof n=="string"?n:n.toJSON())):[this.type,...this.#e.map((n=>n.toJSON()))];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#n||this.#n.#l&&this.#t?.type==="!")&&t.push({}),t}isStart(){if(this.#n===this)return!0;if(!this.#t?.isStart())return!1;if(this.#a===0)return!0;const t=this.#t;for(let n=0;n1&&arguments[1]!==void 0?arguments[1]:G0;if(!t||typeof t!="object"||t.type!==null||t.#e.length!==1||this.type===null)return!1;const i=t.#e[0];return!(!i||typeof i!="object"||i.type===null)&&this.#d(i.type,n)}#d(t){return!!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:X0).get(this.type)?.includes(t)}#b(t,n){const i=t.#e[0],r=new We(null,i,this.options);r.#e.push(""),i.push(r),this.#g(t,n)}#g(t,n){const i=t.#e[0];this.#e.splice(n,1,...i.#e);for(const r of i.#e)typeof r=="object"&&(r.#t=this);this.#s=void 0}#w(t){return!!Xs.get(this.type)?.has(t)}#x(t){if(!t||typeof t!="object"||t.type!==null||t.#e.length!==1||this.type===null||this.#e.length!==1)return!1;const n=t.#e[0];return!(!n||typeof n!="object"||n.type===null)&&this.#w(n.type)}#_(t){const n=Xs.get(this.type),i=t.#e[0],r=n?.get(i.type);if(!r)return!1;this.#e=i.#e;for(const o of this.#e)typeof o=="object"&&(o.#t=this);this.type=r,this.#s=void 0,this.#c=!1}#h(){if(Ks(this)){let t=0,n=!1;do{n=!0;for(let i=0;i1&&arguments[1]!==void 0?arguments[1]:{};const i=new We(null,void 0,n);return We.#p(t,i,0,n,0),i}toMMPattern(){if(this!==this.#n)return this.#n.toMMPattern();const t=this.toString(),[n,i,r,o]=this.toRegExpSource();if(!(r||this.#i||this.#o.nocase&&!this.#o.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return i;const s=(this.#o.nocase?"i":"")+(o?"u":"");return Object.assign(new RegExp(`^${n}$`,s),{_src:n,_glob:t})}get options(){return this.#o}toRegExpSource(t){const n=t??!!this.#o.dot;if(this.#n===this&&(this.#h(),this.#v()),!Ks(this)){const l=this.isStart()&&this.isEnd(),c=this.#e.map((d=>{const[h,g,f,m]=typeof d=="string"?We.#S(d,this.#i,l):d.toRegExpSource(t);return this.#i=this.#i||f,this.#r=this.#r||m,h})).join("");let u="";if(this.isStart()&&typeof this.#e[0]=="string"&&(this.#e.length!==1||!J0.has(this.#e[0]))){const d=Z0,h=n&&d.has(c.charAt(0))||c.startsWith("\\.")&&d.has(c.charAt(2))||c.startsWith("\\.\\.")&&d.has(c.charAt(4)),g=!n&&!t&&d.has(c.charAt(0));u=h?"(?!(?:^|/)\\.\\.?(?:$|/))":g?ur:""}let p="";return this.isEnd()&&this.#n.#l&&this.#t?.type==="!"&&(p="(?:$|\\/)"),[u+c+p,On(c),this.#i=!!this.#i,this.#r]}const i=this.type==="*"||this.type==="+",r=this.type==="!"?"(?:(?!(?:":"(?:";let o=this.#m(n);if(this.isStart()&&this.isEnd()&&!o&&this.type!=="!"){const l=this.toString(),c=this;return c.#e=[l],c.type=null,c.#i=void 0,[l,On(this.toString()),!1,!1]}let s=!i||t||n?"":this.#m(!0);s===o&&(s=""),s&&(o=`(?:${o})(?:${s})*?`);let a="";return a=this.type==="!"&&this.#c?(this.isStart()&&!n?ur:"")+Js:r+o+(this.type==="!"?"))"+(!this.isStart()||n||t?"":ur)+Zs+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&s?")":this.type==="*"&&s?")?":`)${this.type}`),[a,On(o),this.#i=!!this.#i,this.#r]}#m(t){return this.#e.map((n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");const[i,r,o,s]=n.toRegExpSource(t);return this.#r=this.#r||s,i})).filter((n=>!(this.isStart()&&this.isEnd()&&!n))).join("|")}static#S(t,n){let i=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=!1,o="",s=!1,a=!1;for(let l=0;l2&&arguments[2]!==void 0?arguments[2]:{};return ki(t),!(!n.nocomment&&t.charAt(0)==="#")&&new $i(t,n).match(e)},Q0=/^\*+([^+@!?\*\[\(]*)$/,ev=e=>t=>!t.startsWith(".")&&t.endsWith(e),tv=e=>t=>t.endsWith(e),nv=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),iv=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),rv=/^\*+\.\*+$/,ov=e=>!e.startsWith(".")&&e.includes("."),sv=e=>e!=="."&&e!==".."&&e.includes("."),av=/^\.\*+$/,lv=e=>e!=="."&&e!==".."&&e.startsWith("."),uv=/^\*+$/,cv=e=>e.length!==0&&!e.startsWith("."),pv=e=>e.length!==0&&e!=="."&&e!=="..",dv=/^\?+([^+@!?\*\[\(]*)?$/,hv=e=>{let[t,n=""]=e;const i=Zl([t]);return n?(n=n.toLowerCase(),r=>i(r)&&r.toLowerCase().endsWith(n)):i},fv=e=>{let[t,n=""]=e;const i=Jl([t]);return n?(n=n.toLowerCase(),r=>i(r)&&r.toLowerCase().endsWith(n)):i},gv=e=>{let[t,n=""]=e;const i=Jl([t]);return n?r=>i(r)&&r.endsWith(n):i},mv=e=>{let[t,n=""]=e;const i=Zl([t]);return n?r=>i(r)&&r.endsWith(n):i},Zl=e=>{let[t]=e;const n=t.length;return i=>i.length===n&&!i.startsWith(".")},Jl=e=>{let[t]=e;const n=t.length;return i=>i.length===n&&i!=="."&&i!==".."},Yl=typeof rn=="object"&&rn?typeof or=="object"&&or&&or.__MINIMATCH_TESTING_PLATFORM__||rn.platform:"posix";Me.sep=Yl==="win32"?"\\":"/";const De=Symbol("globstar **");Me.GLOBSTAR=De,Me.filter=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n=>Me(n,e,t)};const Ye=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.assign({},e,t)};Me.defaults=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return Me;const t=Me;return Object.assign((function(n,i){return t(n,i,Ye(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}),{Minimatch:class extends t.Minimatch{constructor(n){super(n,Ye(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}))}static defaults(n){return t.defaults(Ye(e,n)).Minimatch}},AST:class extends t.AST{constructor(n,i){super(n,i,Ye(e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{}))}static fromGlob(n){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.AST.fromGlob(n,Ye(e,i))}},unescape:function(n){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.unescape(n,Ye(e,i))},escape:function(n){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.escape(n,Ye(e,i))},filter:function(n){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.filter(n,Ye(e,i))},defaults:n=>t.defaults(Ye(e,n)),makeRe:function(n){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.makeRe(n,Ye(e,i))},braceExpand:function(n){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return t.braceExpand(n,Ye(e,i))},match:function(n,i){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t.match(n,i,Ye(e,r))},sep:t.sep,GLOBSTAR:De})};const Ql=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return ki(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:V0(e)};Me.braceExpand=Ql,Me.makeRe=function(e){return new $i(e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).makeRe()},Me.match=function(e,t){const n=new $i(t,arguments.length>2&&arguments[2]!==void 0?arguments[2]:{});return e=e.filter((i=>n.match(i))),n.options.nonull&&!e.length&&e.push(t),e};const Ys=/[?*]|[+@!]\(.*?\)|\[|\]/;class $i{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};ki(t),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=t,this.platform=n.platform||Yl,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.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 n of t)if(typeof n!="string")return!0;return!1}debug(){}make(){const t=this.pattern,n=this.options;if(!n.nocomment&&t.charAt(0)==="#")return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=function(){return console.error(...arguments)}),this.debug(this.pattern,this.globSet);const i=this.globSet.map((o=>this.slashSplit(o)));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let r=this.globParts.map(((o,s,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){const l=!(o[0]!==""||o[1]!==""||o[2]!=="?"&&Ys.test(o[2])||Ys.test(o[3])),c=/^[a-z]:/i.test(o[0]);if(l)return[...o.slice(0,4),...o.slice(4).map((u=>this.parse(u)))];if(c)return[o[0],...o.slice(1).map((u=>this.parse(u)))]}return o.map((l=>this.parse(l)))}));if(this.debug(this.pattern,r),this.set=r.filter((o=>o.indexOf(!1)===-1)),this.isWindows)for(let o=0;o=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):t=n>=1?this.levelOneOptimize(t):this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map((n=>{let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let r=i;for(;n[r+1]==="**";)r++;r!==i&&n.splice(i,r-i)}return n}))}levelOneOptimize(t){return t.map((n=>(n=n.reduce(((i,r)=>{const o=i[i.length-1];return r==="**"&&o==="**"?i:r===".."&&o&&o!==".."&&o!=="."&&o!=="**"?(i.pop(),i):(i.push(r),i)}),[])).length===0?[""]:n))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let r=1;rr&&i.splice(r+1,s-r);let a=i[r+1];const l=i[r+2],c=i[r+3];if(a!==".."||!l||l==="."||l===".."||!c||c==="."||c==="..")continue;n=!0,i.splice(r,1);const u=i.slice(0);u[r]="**",t.push(u),r--}if(!this.preserveMultipleSlashes){for(let s=1;sn.length))}partsMatch(t,n){let i=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=0,o=0,s=[],a="";for(;r2&&arguments[2]!==void 0&&arguments[2],r=0,o=0;if(this.isWindows){const a=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),l=!a&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),c=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),u=l?3:a?0:void 0,p=!c&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3])?3:c?0:void 0;if(typeof u=="number"&&typeof p=="number"){const[d,h]=[t[u],n[p]];d.toLowerCase()===h.toLowerCase()&&(n[p]=d,o=p,r=u)}}const{optimizationLevel:s=1}=this.options;return s>=2&&(t=this.levelTwoFileOptimize(t)),n.includes(De)?this.#n(t,n,i,r,o):this.#r(t,n,i,r,o)}#n(t,n,i,r,o){const s=n.indexOf(De,o),a=n.lastIndexOf(De),[l,c,u]=i?[n.slice(o,s),n.slice(s+1),[]]:[n.slice(o,s),n.slice(s+1,a),n.slice(a+1)];if(l.length){const y=t.slice(r,r+l.length);if(!this.#r(y,l,i,0,0))return!1;r+=l.length}let p=0;if(u.length){if(u.length+r>t.length)return!1;let y=t.length-u.length;if(this.#r(t,u,i,y,0))p=u.length;else{if(t[t.length-1]!==""||r+u.length===t.length||(y--,!this.#r(t,u,i,y,0)))return!1;p=u.length+1}}if(!c.length){let y=!!p;for(let b=r;b{const c=l.map((u=>{if(u instanceof RegExp)for(const p of u.flags.split(""))r.add(p);return typeof u=="string"?u.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):u===De?De:u._src}));return c.forEach(((u,p)=>{const d=c[p+1],h=c[p-1];u===De&&h!==De&&(h===void 0?d!==void 0&&d!==De?c[p+1]="(?:\\/|"+i+"\\/)?"+d:c[p]=i:d===void 0?c[p-1]=h+"(?:\\/|"+i+")?":d!==De&&(c[p-1]=h+"(?:\\/|\\/"+i+"\\/)"+d,c[p+1]=De))})),c.filter((u=>u!==De)).join("/")})).join("|");const[s,a]=t.length>1?["(?:",")"]:["",""];o="^"+s+o+a+"$",this.negate&&(o="^(?!"+o+").+$");try{this.regexp=new RegExp(o,[...r].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){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.partial;if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;const i=this.options;this.isWindows&&(t=t.split("\\").join("/"));const r=this.slashSplit(t);this.debug(this.pattern,"split",r);const o=this.set;this.debug(this.pattern,"set",o);let s=r[r.length-1];if(!s)for(let a=r.length-2;!s&&a>=0;a--)s=r[a];for(let a=0;a