@mherod/get-cookie 4.0.4 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-IRERRCUF.js → chunk-3FVH4L25.js} +2 -2
- package/dist/{chunk-UPNW543B.js → chunk-7XZ7PCDJ.js} +2 -2
- package/dist/chunk-DVWQBWUF.js +4 -0
- package/dist/chunk-DVWQBWUF.js.map +1 -0
- package/dist/{chunk-VMBA4NVU.js → chunk-I6AYGFSQ.js} +2 -2
- package/dist/chunk-U27I5BLR.js +2 -0
- package/dist/chunk-U27I5BLR.js.map +1 -0
- package/dist/chunk-YOZOS2YM.js +2 -0
- package/dist/chunk-YOZOS2YM.js.map +1 -0
- package/dist/cli.cjs +3 -3
- package/dist/cli.cjs.map +1 -1
- package/dist/getChromeCookie-2ROVM47V.js +2 -0
- package/dist/{getChromePassword-GTIXL733.js → getChromePassword-O452VQWI.js} +2 -2
- package/dist/getCookie-CRE6M3GI.js +2 -0
- package/dist/getFirefoxCookie-5P74VDC7.js +2 -0
- package/dist/getGroupedRenderedCookies-DFEJTTC6.js +2 -0
- package/dist/getMergedRenderedCookies-W5GSSHQQ.js +2 -0
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -12
- package/dist/index.d.ts +12 -12
- package/dist/index.js +1 -1
- package/package.json +1 -4
- package/dist/chunk-5FUMK7M3.js +0 -4
- package/dist/chunk-5FUMK7M3.js.map +0 -1
- package/dist/chunk-A6MIB6FP.js +0 -2
- package/dist/chunk-A6MIB6FP.js.map +0 -1
- package/dist/chunk-CFMK2YSL.js +0 -2
- package/dist/chunk-CFMK2YSL.js.map +0 -1
- package/dist/getChromeCookie-CL3SRRWX.js +0 -2
- package/dist/getCookie-WV5KDZN7.js +0 -2
- package/dist/getFirefoxCookie-BXQ2GXAW.js +0 -2
- package/dist/getGroupedRenderedCookies-FNJ6FQVQ.js +0 -2
- package/dist/getMergedRenderedCookies-PNC2LHSD.js +0 -2
- /package/dist/{chunk-IRERRCUF.js.map → chunk-3FVH4L25.js.map} +0 -0
- /package/dist/{chunk-UPNW543B.js.map → chunk-7XZ7PCDJ.js.map} +0 -0
- /package/dist/{chunk-VMBA4NVU.js.map → chunk-I6AYGFSQ.js.map} +0 -0
- /package/dist/{getChromeCookie-CL3SRRWX.js.map → getChromeCookie-2ROVM47V.js.map} +0 -0
- /package/dist/{getChromePassword-GTIXL733.js.map → getChromePassword-O452VQWI.js.map} +0 -0
- /package/dist/{getCookie-WV5KDZN7.js.map → getCookie-CRE6M3GI.js.map} +0 -0
- /package/dist/{getFirefoxCookie-BXQ2GXAW.js.map → getFirefoxCookie-5P74VDC7.js.map} +0 -0
- /package/dist/{getGroupedRenderedCookies-FNJ6FQVQ.js.map → getGroupedRenderedCookies-DFEJTTC6.js.map} +0 -0
- /package/dist/{getMergedRenderedCookies-PNC2LHSD.js.map → getMergedRenderedCookies-W5GSSHQQ.js.map} +0 -0
package/dist/cli.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var zp=Object.create;var io=Object.defineProperty;var Kp=Object.getOwnPropertyDescriptor;var Qp=Object.getOwnPropertyNames;var Vp=Object.getPrototypeOf,Jp=Object.prototype.hasOwnProperty;var _s=r=>{throw TypeError(r)};var Yp=(r,t,e)=>t in r?io(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var p=(r,t)=>()=>(r&&(t=r(r=0)),t);var Rs=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),Zp=(r,t)=>{for(var e in t)io(r,e,{get:t[e],enumerable:!0})},Xp=(r,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Qp(t))!Jp.call(r,i)&&i!==e&&io(r,i,{get:()=>t[i],enumerable:!(o=Kp(t,i))||o.enumerable});return r};var ke=(r,t,e)=>(e=r!=null?zp(Vp(r)):{},Xp(t||!r||!r.__esModule?io(e,"default",{value:r,enumerable:!0}):e,r));var c=(r,t,e)=>Yp(r,typeof t!="symbol"?t+"":t,e),ki=(r,t,e)=>t.has(r)||_s("Cannot "+e);var a=(r,t,e)=>(ki(r,t,"read from private field"),e?e.call(r):t.get(r)),w=(r,t,e)=>t.has(r)?_s("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,e),g=(r,t,e,o)=>(ki(r,t,"write to private field"),o?o.call(r,e):t.set(r,e),e),S=(r,t,e)=>(ki(r,t,"access private method"),e);var Is,eh,O,nt=p(()=>{"use strict";Is=require("consola"),eh=(0,Is.createConsola)({fancy:!0,formatOptions:{showLogLevel:!1,colors:!0,date:!1,compact:!0,columns:typeof process.stdout.columns=="number"?process.stdout.columns:80},level:typeof process.env.LOG_LEVEL=="string"&&process.env.LOG_LEVEL==="debug"?5:2}),O=eh});function Ls(r,t,e){let i=`${t?"\u2705":"\u274C"} ${r} ${t?"succeeded":"failed"}`;t?O.success(i,e):O.error(i,e)}function I(r,t,e){let o={...e!=null?e:{},error:t instanceof Error?{name:t.name,message:t.message,stack:t.stack}:t};O.error(r,o)}function bt(r,t,e){O.withTag(r).debug(t,e)}function so(r){return O.withTag(r)}function no(r,t,e){O.withTag(r).warn(t,e)}var Pt=p(()=>{"use strict";nt();nt()});var rh,ao,Ti=p(()=>{"use strict";rh=typeof global=="object"&&global&&global.Object===Object&&global,ao=rh});var oh,ih,L,ct=p(()=>{"use strict";Ti();oh=typeof self=="object"&&self&&self.Object===Object&&self,ih=ao||oh||Function("return this")(),L=ih});var sh,at,sr=p(()=>{"use strict";ct();sh=L.Symbol,at=sh});function fh(r){var t=nh.call(r,nr),e=r[nr];try{r[nr]=void 0;var o=!0}catch(s){}var i=ah.call(r);return o&&(t?r[nr]=e:delete r[nr]),i}var Fs,nh,ah,nr,Ns,Bs=p(()=>{"use strict";sr();Fs=Object.prototype,nh=Fs.hasOwnProperty,ah=Fs.toString,nr=at?at.toStringTag:void 0;Ns=fh});function ph(r){return uh.call(r)}var lh,uh,js,Ws=p(()=>{"use strict";lh=Object.prototype,uh=lh.toString;js=ph});function mh(r){return r==null?r===void 0?ch:hh:Us&&Us in Object(r)?Ns(r):js(r)}var hh,ch,Us,et,le=p(()=>{"use strict";sr();Bs();Ws();hh="[object Null]",ch="[object Undefined]",Us=at?at.toStringTag:void 0;et=mh});function dh(r){return r!=null&&typeof r=="object"}var V,Ut=p(()=>{"use strict";V=dh});function xh(r){return typeof r=="symbol"||V(r)&&et(r)==gh}var gh,Oe,fo=p(()=>{"use strict";le();Ut();gh="[object Symbol]";Oe=xh});function yh(r,t){for(var e=-1,o=r==null?0:r.length,i=Array(o);++e<o;)i[e]=t(r[e],e,r);return i}var $s,Gs=p(()=>{"use strict";$s=yh});var wh,D,mt=p(()=>{"use strict";wh=Array.isArray,D=wh});function zs(r){if(typeof r=="string")return r;if(D(r))return $s(r,zs)+"";if(Oe(r))return qs?qs.call(r):"";var t=r+"";return t=="0"&&1/r==-bh?"-0":t}var bh,Hs,qs,Ks,Qs=p(()=>{"use strict";sr();Gs();mt();fo();bh=1/0,Hs=at?at.prototype:void 0,qs=Hs?Hs.toString:void 0;Ks=zs});function Sh(r){var t=typeof r;return r!=null&&(t=="object"||t=="function")}var z,_t=p(()=>{"use strict";z=Sh});function vh(r){return r}var Te,lo=p(()=>{"use strict";Te=vh});function Th(r){if(!z(r))return!1;var t=et(r);return t==Eh||t==kh||t==Ch||t==Oh}var Ch,Eh,kh,Oh,Ae,uo=p(()=>{"use strict";le();_t();Ch="[object AsyncFunction]",Eh="[object Function]",kh="[object GeneratorFunction]",Oh="[object Proxy]";Ae=Th});var Ah,po,Vs=p(()=>{"use strict";ct();Ah=L["__core-js_shared__"],po=Ah});function Ph(r){return!!Js&&Js in r}var Js,Ys,Zs=p(()=>{"use strict";Vs();Js=function(){var r=/[^.]+$/.exec(po&&po.keys&&po.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();Ys=Ph});function Dh(r){if(r!=null){try{return Rh.call(r)}catch(t){}try{return r+""}catch(t){}}return""}var _h,Rh,Rt,Ai=p(()=>{"use strict";_h=Function.prototype,Rh=_h.toString;Rt=Dh});function Wh(r){if(!z(r)||Ys(r))return!1;var t=Ae(r)?jh:Ih;return t.test(Rt(r))}var Mh,Ih,Lh,Fh,Nh,Bh,jh,Xs,tn=p(()=>{"use strict";uo();Zs();_t();Ai();Mh=/[\\^$.*+?()[\]{}|]/g,Ih=/^\[object .+?Constructor\]$/,Lh=Function.prototype,Fh=Object.prototype,Nh=Lh.toString,Bh=Fh.hasOwnProperty,jh=RegExp("^"+Nh.call(Bh).replace(Mh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");Xs=Wh});function Uh(r,t){return r==null?void 0:r[t]}var en,rn=p(()=>{"use strict";en=Uh});function $h(r,t){var e=en(r,t);return Xs(e)?e:void 0}var tt,$t=p(()=>{"use strict";tn();rn();tt=$h});var Gh,ho,on=p(()=>{"use strict";$t();ct();Gh=tt(L,"WeakMap"),ho=Gh});var sn,Hh,nn,an=p(()=>{"use strict";_t();sn=Object.create,Hh=function(){function r(){}return function(t){if(!z(t))return{};if(sn)return sn(t);r.prototype=t;var e=new r;return r.prototype=void 0,e}}(),nn=Hh});function qh(r,t,e){switch(e.length){case 0:return r.call(t);case 1:return r.call(t,e[0]);case 2:return r.call(t,e[0],e[1]);case 3:return r.call(t,e[0],e[1],e[2])}return r.apply(t,e)}var fn,ln=p(()=>{"use strict";fn=qh});function zh(r,t){var e=-1,o=r.length;for(t||(t=Array(o));++e<o;)t[e]=r[e];return t}var un,pn=p(()=>{"use strict";un=zh});function Jh(r){var t=0,e=0;return function(){var o=Vh(),i=Qh-(o-e);if(e=o,i>0){if(++t>=Kh)return arguments[0]}else t=0;return r.apply(void 0,arguments)}}var Kh,Qh,Vh,hn,cn=p(()=>{"use strict";Kh=800,Qh=16,Vh=Date.now;hn=Jh});function Yh(r){return function(){return r}}var mn,dn=p(()=>{"use strict";mn=Yh});var Zh,Pe,Pi=p(()=>{"use strict";$t();Zh=function(){try{var r=tt(Object,"defineProperty");return r({},"",{}),r}catch(t){}}(),Pe=Zh});var Xh,gn,xn=p(()=>{"use strict";dn();Pi();lo();Xh=Pe?function(r,t){return Pe(r,"toString",{configurable:!0,enumerable:!1,value:mn(t),writable:!0})}:Te,gn=Xh});var tc,yn,wn=p(()=>{"use strict";xn();cn();tc=hn(gn),yn=tc});function oc(r,t){var e=typeof r;return t=t==null?ec:t,!!t&&(e=="number"||e!="symbol"&&rc.test(r))&&r>-1&&r%1==0&&r<t}var ec,rc,_e,co=p(()=>{"use strict";ec=9007199254740991,rc=/^(?:0|[1-9]\d*)$/;_e=oc});function ic(r,t,e){t=="__proto__"&&Pe?Pe(r,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):r[t]=e}var Gt,ar=p(()=>{"use strict";Pi();Gt=ic});function sc(r,t){return r===t||r!==r&&t!==t}var St,Re=p(()=>{"use strict";St=sc});function fc(r,t,e){var o=r[t];(!(ac.call(r,t)&&St(o,e))||e===void 0&&!(t in r))&&Gt(r,t,e)}var nc,ac,bn,Sn=p(()=>{"use strict";ar();Re();nc=Object.prototype,ac=nc.hasOwnProperty;bn=fc});function lc(r,t,e,o){var i=!e;e||(e={});for(var s=-1,n=t.length;++s<n;){var f=t[s],l=o?o(e[f],r[f],f,e,r):void 0;l===void 0&&(l=r[f]),i?Gt(e,f,l):bn(e,f,l)}return e}var vn,Cn=p(()=>{"use strict";Sn();ar();vn=lc});function uc(r,t,e){return t=En(t===void 0?r.length-1:t,0),function(){for(var o=arguments,i=-1,s=En(o.length-t,0),n=Array(s);++i<s;)n[i]=o[t+i];i=-1;for(var f=Array(t+1);++i<t;)f[i]=o[i];return f[t]=e(n),fn(r,this,f)}}var En,kn,On=p(()=>{"use strict";ln();En=Math.max;kn=uc});function pc(r,t){return yn(kn(r,t,Te),r+"")}var Tn,An=p(()=>{"use strict";lo();On();wn();Tn=pc});function cc(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=hc}var hc,De,mo=p(()=>{"use strict";hc=9007199254740991;De=cc});function mc(r){return r!=null&&De(r.length)&&!Ae(r)}var vt,Me=p(()=>{"use strict";uo();mo();vt=mc});function dc(r,t,e){if(!z(e))return!1;var o=typeof t;return(o=="number"?vt(e)&&_e(t,e.length):o=="string"&&t in e)?St(e[t],r):!1}var Pn,_n=p(()=>{"use strict";Re();Me();co();_t();Pn=dc});function gc(r){return Tn(function(t,e){var o=-1,i=e.length,s=i>1?e[i-1]:void 0,n=i>2?e[2]:void 0;for(s=r.length>3&&typeof s=="function"?(i--,s):void 0,n&&Pn(e[0],e[1],n)&&(s=i<3?void 0:s,i=1),t=Object(t);++o<i;){var f=e[o];f&&r(t,f,o,s)}return t})}var Rn,Dn=p(()=>{"use strict";An();_n();Rn=gc});function yc(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||xc;return r===e}var xc,Ie,go=p(()=>{"use strict";xc=Object.prototype;Ie=yc});function wc(r,t){for(var e=-1,o=Array(r);++e<r;)o[e]=t(e);return o}var Mn,In=p(()=>{"use strict";Mn=wc});function Sc(r){return V(r)&&et(r)==bc}var bc,_i,Ln=p(()=>{"use strict";le();Ut();bc="[object Arguments]";_i=Sc});var Fn,vc,Cc,Ec,ue,xo=p(()=>{"use strict";Ln();Ut();Fn=Object.prototype,vc=Fn.hasOwnProperty,Cc=Fn.propertyIsEnumerable,Ec=_i(function(){return arguments}())?_i:function(r){return V(r)&&vc.call(r,"callee")&&!Cc.call(r,"callee")},ue=Ec});function kc(){return!1}var Nn,Bn=p(()=>{"use strict";Nn=kc});var Un,jn,Oc,Wn,Tc,Ac,pe,yo=p(()=>{"use strict";ct();Bn();Un=typeof exports=="object"&&exports&&!exports.nodeType&&exports,jn=Un&&typeof module=="object"&&module&&!module.nodeType&&module,Oc=jn&&jn.exports===Un,Wn=Oc?L.Buffer:void 0,Tc=Wn?Wn.isBuffer:void 0,Ac=Tc||Nn,pe=Ac});function Xc(r){return V(r)&&De(r.length)&&!!P[et(r)]}var Pc,_c,Rc,Dc,Mc,Ic,Lc,Fc,Nc,Bc,jc,Wc,Uc,$c,Gc,Hc,qc,zc,Kc,Qc,Vc,Jc,Yc,Zc,P,$n,Gn=p(()=>{"use strict";le();mo();Ut();Pc="[object Arguments]",_c="[object Array]",Rc="[object Boolean]",Dc="[object Date]",Mc="[object Error]",Ic="[object Function]",Lc="[object Map]",Fc="[object Number]",Nc="[object Object]",Bc="[object RegExp]",jc="[object Set]",Wc="[object String]",Uc="[object WeakMap]",$c="[object ArrayBuffer]",Gc="[object DataView]",Hc="[object Float32Array]",qc="[object Float64Array]",zc="[object Int8Array]",Kc="[object Int16Array]",Qc="[object Int32Array]",Vc="[object Uint8Array]",Jc="[object Uint8ClampedArray]",Yc="[object Uint16Array]",Zc="[object Uint32Array]",P={};P[Hc]=P[qc]=P[zc]=P[Kc]=P[Qc]=P[Vc]=P[Jc]=P[Yc]=P[Zc]=!0;P[Pc]=P[_c]=P[$c]=P[Rc]=P[Gc]=P[Dc]=P[Mc]=P[Ic]=P[Lc]=P[Fc]=P[Nc]=P[Bc]=P[jc]=P[Wc]=P[Uc]=!1;$n=Xc});function tm(r){return function(t){return r(t)}}var Hn,qn=p(()=>{"use strict";Hn=tm});var zn,fr,em,Ri,rm,Di,Kn=p(()=>{"use strict";Ti();zn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,fr=zn&&typeof module=="object"&&module&&!module.nodeType&&module,em=fr&&fr.exports===zn,Ri=em&&ao.process,rm=function(){try{var r=fr&&fr.require&&fr.require("util").types;return r||Ri&&Ri.binding&&Ri.binding("util")}catch(t){}}(),Di=rm});var Qn,om,Le,wo=p(()=>{"use strict";Gn();qn();Kn();Qn=Di&&Di.isTypedArray,om=Qn?Hn(Qn):$n,Le=om});function nm(r,t){var e=D(r),o=!e&&ue(r),i=!e&&!o&&pe(r),s=!e&&!o&&!i&&Le(r),n=e||o||i||s,f=n?Mn(r.length,String):[],l=f.length;for(var u in r)(t||sm.call(r,u))&&!(n&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||_e(u,l)))&&f.push(u);return f}var im,sm,bo,Mi=p(()=>{"use strict";In();xo();mt();yo();co();wo();im=Object.prototype,sm=im.hasOwnProperty;bo=nm});function am(r,t){return function(e){return r(t(e))}}var So,Ii=p(()=>{"use strict";So=am});var fm,Vn,Jn=p(()=>{"use strict";Ii();fm=So(Object.keys,Object),Vn=fm});function pm(r){if(!Ie(r))return Vn(r);var t=[];for(var e in Object(r))um.call(r,e)&&e!="constructor"&&t.push(e);return t}var lm,um,Yn,Zn=p(()=>{"use strict";go();Jn();lm=Object.prototype,um=lm.hasOwnProperty;Yn=pm});function hm(r){return vt(r)?bo(r):Yn(r)}var Fe,vo=p(()=>{"use strict";Mi();Zn();Me();Fe=hm});function cm(r){var t=[];if(r!=null)for(var e in Object(r))t.push(e);return t}var Xn,ta=p(()=>{"use strict";Xn=cm});function gm(r){if(!z(r))return Xn(r);var t=Ie(r),e=[];for(var o in r)o=="constructor"&&(t||!dm.call(r,o))||e.push(o);return e}var mm,dm,ea,ra=p(()=>{"use strict";_t();go();ta();mm=Object.prototype,dm=mm.hasOwnProperty;ea=gm});function xm(r){return vt(r)?bo(r,!0):ea(r)}var Co,Li=p(()=>{"use strict";Mi();ra();Me();Co=xm});function bm(r,t){if(D(r))return!1;var e=typeof r;return e=="number"||e=="symbol"||e=="boolean"||r==null||Oe(r)?!0:wm.test(r)||!ym.test(r)||t!=null&&r in Object(t)}var ym,wm,Ne,Eo=p(()=>{"use strict";mt();fo();ym=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,wm=/^\w*$/;Ne=bm});var Sm,Dt,lr=p(()=>{"use strict";$t();Sm=tt(Object,"create"),Dt=Sm});function vm(){this.__data__=Dt?Dt(null):{},this.size=0}var oa,ia=p(()=>{"use strict";lr();oa=vm});function Cm(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t}var sa,na=p(()=>{"use strict";sa=Cm});function Tm(r){var t=this.__data__;if(Dt){var e=t[r];return e===Em?void 0:e}return Om.call(t,r)?t[r]:void 0}var Em,km,Om,aa,fa=p(()=>{"use strict";lr();Em="__lodash_hash_undefined__",km=Object.prototype,Om=km.hasOwnProperty;aa=Tm});function _m(r){var t=this.__data__;return Dt?t[r]!==void 0:Pm.call(t,r)}var Am,Pm,la,ua=p(()=>{"use strict";lr();Am=Object.prototype,Pm=Am.hasOwnProperty;la=_m});function Dm(r,t){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=Dt&&t===void 0?Rm:t,this}var Rm,pa,ha=p(()=>{"use strict";lr();Rm="__lodash_hash_undefined__";pa=Dm});function Be(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var o=r[t];this.set(o[0],o[1])}}var Fi,ca=p(()=>{"use strict";ia();na();fa();ua();ha();Be.prototype.clear=oa;Be.prototype.delete=sa;Be.prototype.get=aa;Be.prototype.has=la;Be.prototype.set=pa;Fi=Be});function Mm(){this.__data__=[],this.size=0}var ma,da=p(()=>{"use strict";ma=Mm});function Im(r,t){for(var e=r.length;e--;)if(St(r[e][0],t))return e;return-1}var Ht,ur=p(()=>{"use strict";Re();Ht=Im});function Nm(r){var t=this.__data__,e=Ht(t,r);if(e<0)return!1;var o=t.length-1;return e==o?t.pop():Fm.call(t,e,1),--this.size,!0}var Lm,Fm,ga,xa=p(()=>{"use strict";ur();Lm=Array.prototype,Fm=Lm.splice;ga=Nm});function Bm(r){var t=this.__data__,e=Ht(t,r);return e<0?void 0:t[e][1]}var ya,wa=p(()=>{"use strict";ur();ya=Bm});function jm(r){return Ht(this.__data__,r)>-1}var ba,Sa=p(()=>{"use strict";ur();ba=jm});function Wm(r,t){var e=this.__data__,o=Ht(e,r);return o<0?(++this.size,e.push([r,t])):e[o][1]=t,this}var va,Ca=p(()=>{"use strict";ur();va=Wm});function je(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var o=r[t];this.set(o[0],o[1])}}var qt,pr=p(()=>{"use strict";da();xa();wa();Sa();Ca();je.prototype.clear=ma;je.prototype.delete=ga;je.prototype.get=ya;je.prototype.has=ba;je.prototype.set=va;qt=je});var Um,zt,ko=p(()=>{"use strict";$t();ct();Um=tt(L,"Map"),zt=Um});function $m(){this.size=0,this.__data__={hash:new Fi,map:new(zt||qt),string:new Fi}}var Ea,ka=p(()=>{"use strict";ca();pr();ko();Ea=$m});function Gm(r){var t=typeof r;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?r!=="__proto__":r===null}var Oa,Ta=p(()=>{"use strict";Oa=Gm});function Hm(r,t){var e=r.__data__;return Oa(t)?e[typeof t=="string"?"string":"hash"]:e.map}var Kt,hr=p(()=>{"use strict";Ta();Kt=Hm});function qm(r){var t=Kt(this,r).delete(r);return this.size-=t?1:0,t}var Aa,Pa=p(()=>{"use strict";hr();Aa=qm});function zm(r){return Kt(this,r).get(r)}var _a,Ra=p(()=>{"use strict";hr();_a=zm});function Km(r){return Kt(this,r).has(r)}var Da,Ma=p(()=>{"use strict";hr();Da=Km});function Qm(r,t){var e=Kt(this,r),o=e.size;return e.set(r,t),this.size+=e.size==o?0:1,this}var Ia,La=p(()=>{"use strict";hr();Ia=Qm});function We(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var o=r[t];this.set(o[0],o[1])}}var he,Oo=p(()=>{"use strict";ka();Pa();Ra();Ma();La();We.prototype.clear=Ea;We.prototype.delete=Aa;We.prototype.get=_a;We.prototype.has=Da;We.prototype.set=Ia;he=We});function Ni(r,t){if(typeof r!="function"||t!=null&&typeof t!="function")throw new TypeError(Vm);var e=function(){var o=arguments,i=t?t.apply(this,o):o[0],s=e.cache;if(s.has(i))return s.get(i);var n=r.apply(this,o);return e.cache=s.set(i,n)||s,n};return e.cache=new(Ni.Cache||he),e}var Vm,ft,Bi=p(()=>{"use strict";Oo();Vm="Expected a function";Ni.Cache=he;ft=Ni});function Ym(r){var t=ft(r,function(o){return e.size===Jm&&e.clear(),o}),e=t.cache;return t}var Jm,Fa,Na=p(()=>{"use strict";Bi();Jm=500;Fa=Ym});var Zm,Xm,td,Ba,ja=p(()=>{"use strict";Na();Zm=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Xm=/\\(\\)?/g,td=Fa(function(r){var t=[];return r.charCodeAt(0)===46&&t.push(""),r.replace(Zm,function(e,o,i,s){t.push(i?s.replace(Xm,"$1"):o||e)}),t}),Ba=td});function ed(r){return r==null?"":Ks(r)}var Wa,Ua=p(()=>{"use strict";Qs();Wa=ed});function rd(r,t){return D(r)?r:Ne(r,t)?[r]:Ba(Wa(r))}var To,ji=p(()=>{"use strict";mt();Eo();ja();Ua();To=rd});function id(r){if(typeof r=="string"||Oe(r))return r;var t=r+"";return t=="0"&&1/r==-od?"-0":t}var od,Qt,cr=p(()=>{"use strict";fo();od=1/0;Qt=id});function sd(r,t){t=To(t,r);for(var e=0,o=t.length;r!=null&&e<o;)r=r[Qt(t[e++])];return e&&e==o?r:void 0}var Ao,Wi=p(()=>{"use strict";ji();cr();Ao=sd});function nd(r,t,e){var o=r==null?void 0:Ao(r,t);return o===void 0?e:o}var $a,Ga=p(()=>{"use strict";Wi();$a=nd});function ad(r,t){for(var e=-1,o=t.length,i=r.length;++e<o;)r[i+e]=t[e];return r}var Ha,qa=p(()=>{"use strict";Ha=ad});var fd,Po,Ui=p(()=>{"use strict";Ii();fd=So(Object.getPrototypeOf,Object),Po=fd});function md(r){if(!V(r)||et(r)!=ld)return!1;var t=Po(r);if(t===null)return!0;var e=hd.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&za.call(e)==cd}var ld,ud,pd,za,hd,cd,Ka,Qa=p(()=>{"use strict";le();Ui();Ut();ld="[object Object]",ud=Function.prototype,pd=Object.prototype,za=ud.toString,hd=pd.hasOwnProperty,cd=za.call(Object);Ka=md});function dd(){this.__data__=new qt,this.size=0}var Va,Ja=p(()=>{"use strict";pr();Va=dd});function gd(r){var t=this.__data__,e=t.delete(r);return this.size=t.size,e}var Ya,Za=p(()=>{"use strict";Ya=gd});function xd(r){return this.__data__.get(r)}var Xa,tf=p(()=>{"use strict";Xa=xd});function yd(r){return this.__data__.has(r)}var ef,rf=p(()=>{"use strict";ef=yd});function bd(r,t){var e=this.__data__;if(e instanceof qt){var o=e.__data__;if(!zt||o.length<wd-1)return o.push([r,t]),this.size=++e.size,this;e=this.__data__=new he(o)}return e.set(r,t),this.size=e.size,this}var wd,of,sf=p(()=>{"use strict";pr();ko();Oo();wd=200;of=bd});function Ue(r){var t=this.__data__=new qt(r);this.size=t.size}var Vt,_o=p(()=>{"use strict";pr();Ja();Za();tf();rf();sf();Ue.prototype.clear=Va;Ue.prototype.delete=Ya;Ue.prototype.get=Xa;Ue.prototype.has=ef;Ue.prototype.set=of;Vt=Ue});function vd(r,t){if(t)return r.slice();var e=r.length,o=ff?ff(e):new r.constructor(e);return r.copy(o),o}var lf,nf,Sd,af,ff,uf,pf=p(()=>{"use strict";ct();lf=typeof exports=="object"&&exports&&!exports.nodeType&&exports,nf=lf&&typeof module=="object"&&module&&!module.nodeType&&module,Sd=nf&&nf.exports===lf,af=Sd?L.Buffer:void 0,ff=af?af.allocUnsafe:void 0;uf=vd});function Cd(r,t){for(var e=-1,o=r==null?0:r.length,i=0,s=[];++e<o;){var n=r[e];t(n,e,r)&&(s[i++]=n)}return s}var hf,cf=p(()=>{"use strict";hf=Cd});function Ed(){return[]}var mf,df=p(()=>{"use strict";mf=Ed});var kd,Od,gf,Td,xf,yf=p(()=>{"use strict";cf();df();kd=Object.prototype,Od=kd.propertyIsEnumerable,gf=Object.getOwnPropertySymbols,Td=gf?function(r){return r==null?[]:(r=Object(r),hf(gf(r),function(t){return Od.call(r,t)}))}:mf,xf=Td});function Ad(r,t,e){var o=t(r);return D(r)?o:Ha(o,e(r))}var wf,bf=p(()=>{"use strict";qa();mt();wf=Ad});function Pd(r){return wf(r,Fe,xf)}var $i,Sf=p(()=>{"use strict";bf();yf();vo();$i=Pd});var _d,Ro,vf=p(()=>{"use strict";$t();ct();_d=tt(L,"DataView"),Ro=_d});var Rd,Do,Cf=p(()=>{"use strict";$t();ct();Rd=tt(L,"Promise"),Do=Rd});var Dd,Mo,Ef=p(()=>{"use strict";$t();ct();Dd=tt(L,"Set"),Mo=Dd});var kf,Md,Of,Tf,Af,Pf,Id,Ld,Fd,Nd,Bd,ce,Gi,_f=p(()=>{"use strict";vf();ko();Cf();Ef();on();le();Ai();kf="[object Map]",Md="[object Object]",Of="[object Promise]",Tf="[object Set]",Af="[object WeakMap]",Pf="[object DataView]",Id=Rt(Ro),Ld=Rt(zt),Fd=Rt(Do),Nd=Rt(Mo),Bd=Rt(ho),ce=et;(Ro&&ce(new Ro(new ArrayBuffer(1)))!=Pf||zt&&ce(new zt)!=kf||Do&&ce(Do.resolve())!=Of||Mo&&ce(new Mo)!=Tf||ho&&ce(new ho)!=Af)&&(ce=function(r){var t=et(r),e=t==Md?r.constructor:void 0,o=e?Rt(e):"";if(o)switch(o){case Id:return Pf;case Ld:return kf;case Fd:return Of;case Nd:return Tf;case Bd:return Af}return t});Gi=ce});var jd,$e,Hi=p(()=>{"use strict";ct();jd=L.Uint8Array,$e=jd});function Wd(r){var t=new r.constructor(r.byteLength);return new $e(t).set(new $e(r)),t}var Rf,Df=p(()=>{"use strict";Hi();Rf=Wd});function Ud(r,t){var e=t?Rf(r.buffer):r.buffer;return new r.constructor(e,r.byteOffset,r.length)}var Mf,If=p(()=>{"use strict";Df();Mf=Ud});function $d(r){return typeof r.constructor=="function"&&!Ie(r)?nn(Po(r)):{}}var Lf,Ff=p(()=>{"use strict";an();Ui();go();Lf=$d});function Hd(r){return this.__data__.set(r,Gd),this}var Gd,Nf,Bf=p(()=>{"use strict";Gd="__lodash_hash_undefined__";Nf=Hd});function qd(r){return this.__data__.has(r)}var jf,Wf=p(()=>{"use strict";jf=qd});function Io(r){var t=-1,e=r==null?0:r.length;for(this.__data__=new he;++t<e;)this.add(r[t])}var Uf,$f=p(()=>{"use strict";Oo();Bf();Wf();Io.prototype.add=Io.prototype.push=Nf;Io.prototype.has=jf;Uf=Io});function zd(r,t){for(var e=-1,o=r==null?0:r.length;++e<o;)if(t(r[e],e,r))return!0;return!1}var Gf,Hf=p(()=>{"use strict";Gf=zd});function Kd(r,t){return r.has(t)}var qf,zf=p(()=>{"use strict";qf=Kd});function Jd(r,t,e,o,i,s){var n=e&Qd,f=r.length,l=t.length;if(f!=l&&!(n&&l>f))return!1;var u=s.get(r),h=s.get(t);if(u&&h)return u==t&&h==r;var d=-1,m=!0,y=e&Vd?new Uf:void 0;for(s.set(r,t),s.set(t,r);++d<f;){var b=r[d],x=t[d];if(o)var C=n?o(x,b,d,t,r,s):o(b,x,d,r,t,s);if(C!==void 0){if(C)continue;m=!1;break}if(y){if(!Gf(t,function(E,T){if(!qf(y,T)&&(b===E||i(b,E,e,o,s)))return y.push(T)})){m=!1;break}}else if(!(b===x||i(b,x,e,o,s))){m=!1;break}}return s.delete(r),s.delete(t),m}var Qd,Vd,Lo,qi=p(()=>{"use strict";$f();Hf();zf();Qd=1,Vd=2;Lo=Jd});function Yd(r){var t=-1,e=Array(r.size);return r.forEach(function(o,i){e[++t]=[i,o]}),e}var Kf,Qf=p(()=>{"use strict";Kf=Yd});function Zd(r){var t=-1,e=Array(r.size);return r.forEach(function(o){e[++t]=o}),e}var Vf,Jf=p(()=>{"use strict";Vf=Zd});function hg(r,t,e,o,i,s,n){switch(e){case pg:if(r.byteLength!=t.byteLength||r.byteOffset!=t.byteOffset)return!1;r=r.buffer,t=t.buffer;case ug:return!(r.byteLength!=t.byteLength||!s(new $e(r),new $e(t)));case eg:case rg:case sg:return St(+r,+t);case og:return r.name==t.name&&r.message==t.message;case ng:case fg:return r==t+"";case ig:var f=Kf;case ag:var l=o&Xd;if(f||(f=Vf),r.size!=t.size&&!l)return!1;var u=n.get(r);if(u)return u==t;o|=tg,n.set(r,t);var h=Lo(f(r),f(t),o,i,s,n);return n.delete(r),h;case lg:if(zi)return zi.call(r)==zi.call(t)}return!1}var Xd,tg,eg,rg,og,ig,sg,ng,ag,fg,lg,ug,pg,Yf,zi,Zf,Xf=p(()=>{"use strict";sr();Hi();Re();qi();Qf();Jf();Xd=1,tg=2,eg="[object Boolean]",rg="[object Date]",og="[object Error]",ig="[object Map]",sg="[object Number]",ng="[object RegExp]",ag="[object Set]",fg="[object String]",lg="[object Symbol]",ug="[object ArrayBuffer]",pg="[object DataView]",Yf=at?at.prototype:void 0,zi=Yf?Yf.valueOf:void 0;Zf=hg});function gg(r,t,e,o,i,s){var n=e&cg,f=$i(r),l=f.length,u=$i(t),h=u.length;if(l!=h&&!n)return!1;for(var d=l;d--;){var m=f[d];if(!(n?m in t:dg.call(t,m)))return!1}var y=s.get(r),b=s.get(t);if(y&&b)return y==t&&b==r;var x=!0;s.set(r,t),s.set(t,r);for(var C=n;++d<l;){m=f[d];var E=r[m],T=t[m];if(o)var A=n?o(T,E,m,t,r,s):o(E,T,m,r,t,s);if(!(A===void 0?E===T||i(E,T,e,o,s):A)){x=!1;break}C||(C=m=="constructor")}if(x&&!C){var _=r.constructor,N=t.constructor;_!=N&&"constructor"in r&&"constructor"in t&&!(typeof _=="function"&&_ instanceof _&&typeof N=="function"&&N instanceof N)&&(x=!1)}return s.delete(r),s.delete(t),x}var cg,mg,dg,tl,el=p(()=>{"use strict";Sf();cg=1,mg=Object.prototype,dg=mg.hasOwnProperty;tl=gg});function wg(r,t,e,o,i,s){var n=D(r),f=D(t),l=n?ol:Gi(r),u=f?ol:Gi(t);l=l==rl?Fo:l,u=u==rl?Fo:u;var h=l==Fo,d=u==Fo,m=l==u;if(m&&pe(r)){if(!pe(t))return!1;n=!0,h=!1}if(m&&!h)return s||(s=new Vt),n||Le(r)?Lo(r,t,e,o,i,s):Zf(r,t,l,e,o,i,s);if(!(e&xg)){var y=h&&il.call(r,"__wrapped__"),b=d&&il.call(t,"__wrapped__");if(y||b){var x=y?r.value():r,C=b?t.value():t;return s||(s=new Vt),i(x,C,e,o,s)}}return m?(s||(s=new Vt),tl(r,t,e,o,i,s)):!1}var xg,rl,ol,Fo,yg,il,sl,nl=p(()=>{"use strict";_o();qi();Xf();el();_f();mt();yo();wo();xg=1,rl="[object Arguments]",ol="[object Array]",Fo="[object Object]",yg=Object.prototype,il=yg.hasOwnProperty;sl=wg});function al(r,t,e,o,i){return r===t?!0:r==null||t==null||!V(r)&&!V(t)?r!==r&&t!==t:sl(r,t,e,o,al,i)}var No,Ki=p(()=>{"use strict";nl();Ut();No=al});function vg(r,t,e,o){var i=e.length,s=i,n=!o;if(r==null)return!s;for(r=Object(r);i--;){var f=e[i];if(n&&f[2]?f[1]!==r[f[0]]:!(f[0]in r))return!1}for(;++i<s;){f=e[i];var l=f[0],u=r[l],h=f[1];if(n&&f[2]){if(u===void 0&&!(l in r))return!1}else{var d=new Vt;if(o)var m=o(u,h,l,r,t,d);if(!(m===void 0?No(h,u,bg|Sg,o,d):m))return!1}}return!0}var bg,Sg,fl,ll=p(()=>{"use strict";_o();Ki();bg=1,Sg=2;fl=vg});function Cg(r){return r===r&&!z(r)}var Bo,Qi=p(()=>{"use strict";_t();Bo=Cg});function Eg(r){for(var t=Fe(r),e=t.length;e--;){var o=t[e],i=r[o];t[e]=[o,i,Bo(i)]}return t}var ul,pl=p(()=>{"use strict";Qi();vo();ul=Eg});function kg(r,t){return function(e){return e==null?!1:e[r]===t&&(t!==void 0||r in Object(e))}}var jo,Vi=p(()=>{"use strict";jo=kg});function Og(r){var t=ul(r);return t.length==1&&t[0][2]?jo(t[0][0],t[0][1]):function(e){return e===r||fl(e,r,t)}}var hl,cl=p(()=>{"use strict";ll();pl();Vi();hl=Og});function Tg(r,t){return r!=null&&t in Object(r)}var ml,dl=p(()=>{"use strict";ml=Tg});function Ag(r,t,e){t=To(t,r);for(var o=-1,i=t.length,s=!1;++o<i;){var n=Qt(t[o]);if(!(s=r!=null&&e(r,n)))break;r=r[n]}return s||++o!=i?s:(i=r==null?0:r.length,!!i&&De(i)&&_e(n,i)&&(D(r)||ue(r)))}var gl,xl=p(()=>{"use strict";ji();xo();mt();co();mo();cr();gl=Ag});function Pg(r,t){return r!=null&&gl(r,t,ml)}var yl,wl=p(()=>{"use strict";dl();xl();yl=Pg});function Dg(r,t){return Ne(r)&&Bo(t)?jo(Qt(r),t):function(e){var o=$a(e,r);return o===void 0&&o===t?yl(e,r):No(t,o,_g|Rg)}}var _g,Rg,bl,Sl=p(()=>{"use strict";Ki();Ga();wl();Eo();Qi();Vi();cr();_g=1,Rg=2;bl=Dg});function Mg(r){return function(t){return t==null?void 0:t[r]}}var vl,Cl=p(()=>{"use strict";vl=Mg});function Ig(r){return function(t){return Ao(t,r)}}var El,kl=p(()=>{"use strict";Wi();El=Ig});function Lg(r){return Ne(r)?vl(Qt(r)):El(r)}var Ol,Tl=p(()=>{"use strict";Cl();kl();Eo();cr();Ol=Lg});function Fg(r){return typeof r=="function"?r:r==null?Te:typeof r=="object"?D(r)?bl(r[0],r[1]):hl(r):Ol(r)}var Al,Pl=p(()=>{"use strict";cl();Sl();lo();mt();Tl();Al=Fg});function Ng(r,t,e,o){for(var i=-1,s=r==null?0:r.length;++i<s;){var n=r[i];t(o,n,e(n),r)}return o}var _l,Rl=p(()=>{"use strict";_l=Ng});function Bg(r){return function(t,e,o){for(var i=-1,s=Object(t),n=o(t),f=n.length;f--;){var l=n[r?f:++i];if(e(s[l],l,s)===!1)break}return t}}var Dl,Ml=p(()=>{"use strict";Dl=Bg});var jg,Wo,Ji=p(()=>{"use strict";Ml();jg=Dl(),Wo=jg});function Wg(r,t){return r&&Wo(r,t,Fe)}var Il,Ll=p(()=>{"use strict";Ji();vo();Il=Wg});function Ug(r,t){return function(e,o){if(e==null)return e;if(!vt(e))return r(e,o);for(var i=e.length,s=t?i:-1,n=Object(e);(t?s--:++s<i)&&o(n[s],s,n)!==!1;);return e}}var Fl,Nl=p(()=>{"use strict";Me();Fl=Ug});var $g,Bl,jl=p(()=>{"use strict";Ll();Nl();$g=Fl(Il),Bl=$g});function Gg(r,t,e,o){return Bl(r,function(i,s,n){t(o,i,e(i),n)}),o}var Wl,Ul=p(()=>{"use strict";jl();Wl=Gg});function Hg(r,t){return function(e,o){var i=D(e)?_l:Wl,s=t?t():{};return i(e,r,Al(o,2),s)}}var $l,Gl=p(()=>{"use strict";Rl();Ul();Pl();mt();$l=Hg});function qg(r,t,e){(e!==void 0&&!St(r[t],e)||e===void 0&&!(t in r))&&Gt(r,t,e)}var mr,Yi=p(()=>{"use strict";ar();Re();mr=qg});function zg(r){return V(r)&&vt(r)}var Hl,ql=p(()=>{"use strict";Me();Ut();Hl=zg});function Kg(r,t){if(!(t==="constructor"&&typeof r[t]=="function")&&t!="__proto__")return r[t]}var dr,Zi=p(()=>{"use strict";dr=Kg});function Qg(r){return vn(r,Co(r))}var zl,Kl=p(()=>{"use strict";Cn();Li();zl=Qg});function Vg(r,t,e,o,i,s,n){var f=dr(r,e),l=dr(t,e),u=n.get(l);if(u){mr(r,e,u);return}var h=s?s(f,l,e+"",r,t,n):void 0,d=h===void 0;if(d){var m=D(l),y=!m&&pe(l),b=!m&&!y&&Le(l);h=l,m||y||b?D(f)?h=f:Hl(f)?h=un(f):y?(d=!1,h=uf(l,!0)):b?(d=!1,h=Mf(l,!0)):h=[]:Ka(l)||ue(l)?(h=f,ue(f)?h=zl(f):(!z(f)||Ae(f))&&(h=Lf(l))):d=!1}d&&(n.set(l,h),i(h,l,o,s,n),n.delete(l)),mr(r,e,h)}var Ql,Vl=p(()=>{"use strict";Yi();pf();If();pn();Ff();xo();mt();ql();yo();uo();_t();Qa();wo();Zi();Kl();Ql=Vg});function Jl(r,t,e,o,i){r!==t&&Wo(t,function(s,n){if(i||(i=new Vt),z(s))Ql(r,t,n,e,Jl,o,i);else{var f=o?o(dr(r,n),s,n+"",r,t,i):void 0;f===void 0&&(f=s),mr(r,n,f)}},Co)}var Yl,Zl=p(()=>{"use strict";_o();Yi();Ji();Vl();_t();Li();Zi();Yl=Jl});var Jg,Yg,Zg,gr,Xl=p(()=>{"use strict";ar();Gl();Jg=Object.prototype,Yg=Jg.hasOwnProperty,Zg=$l(function(r,t,e){Yg.call(r,e)?r[e].push(t):Gt(r,e,[t])}),gr=Zg});var Xg,Xi,tu=p(()=>{"use strict";Zl();Dn();Xg=Rn(function(r,t,e){Yl(r,t,e)}),Xi=Xg});var Jt=p(()=>{"use strict";Xl();Bi();tu();});var hu=Rs((Jk,pu)=>{"use strict";pu.exports=lu;function lu(r,t,e){r instanceof RegExp&&(r=fu(r,e)),t instanceof RegExp&&(t=fu(t,e));var o=uu(r,t,e);return o&&{start:o[0],end:o[1],pre:e.slice(0,o[0]),body:e.slice(o[0]+r.length,o[1]),post:e.slice(o[1]+t.length)}}function fu(r,t){var e=t.match(r);return e?e[0]:null}lu.range=uu;function uu(r,t,e){var o,i,s,n,f,l=e.indexOf(r),u=e.indexOf(t,l+1),h=l;if(l>=0&&u>0){if(r===t)return[l,u];for(o=[],s=e.length;h>=0&&!f;)h==l?(o.push(h),l=e.indexOf(r,h+1)):o.length==1?f=[o.pop(),u]:(i=o.pop(),i<s&&(s=i,n=u),u=e.indexOf(t,h+1)),h=l<u&&l>=0?l:u;o.length&&(f=[s,n])}return f}});var bu=Rs((Yk,wu)=>{"use strict";var cu=hu();wu.exports=fx;var mu="\0SLASH"+Math.random()+"\0",du="\0OPEN"+Math.random()+"\0",es="\0CLOSE"+Math.random()+"\0",gu="\0COMMA"+Math.random()+"\0",xu="\0PERIOD"+Math.random()+"\0";function ts(r){return parseInt(r,10)==r?parseInt(r,10):r.charCodeAt(0)}function nx(r){return r.split("\\\\").join(mu).split("\\{").join(du).split("\\}").join(es).split("\\,").join(gu).split("\\.").join(xu)}function ax(r){return r.split(mu).join("\\").split(du).join("{").split(es).join("}").split(gu).join(",").split(xu).join(".")}function yu(r){if(!r)return[""];var t=[],e=cu("{","}",r);if(!e)return r.split(",");var o=e.pre,i=e.body,s=e.post,n=o.split(",");n[n.length-1]+="{"+i+"}";var f=yu(s);return s.length&&(n[n.length-1]+=f.shift(),n.push.apply(n,f)),t.push.apply(t,n),t}function fx(r){return r?(r.substr(0,2)==="{}"&&(r="\\{\\}"+r.substr(2)),xr(nx(r),!0).map(ax)):[]}function lx(r){return"{"+r+"}"}function ux(r){return/^-?0\d/.test(r)}function px(r,t){return r<=t}function hx(r,t){return r>=t}function xr(r,t){var e=[],o=cu("{","}",r);if(!o)return[r];var i=o.pre,s=o.post.length?xr(o.post,!1):[""];if(/\$$/.test(o.pre))for(var n=0;n<s.length;n++){var f=i+"{"+o.body+"}"+s[n];e.push(f)}else{var l=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body),h=l||u,d=o.body.indexOf(",")>=0;if(!h&&!d)return o.post.match(/,.*\}/)?(r=o.pre+"{"+o.body+es+o.post,xr(r)):[r];var m;if(h)m=o.body.split(/\.\./);else if(m=yu(o.body),m.length===1&&(m=xr(m[0],!1).map(lx),m.length===1))return s.map(function(qp){return o.pre+m[0]+qp});var y;if(h){var b=ts(m[0]),x=ts(m[1]),C=Math.max(m[0].length,m[1].length),E=m.length==3?Math.abs(ts(m[2])):1,T=px,A=x<b;A&&(E*=-1,T=hx);var _=m.some(ux);y=[];for(var N=b;T(N,x);N+=E){var st;if(u)st=String.fromCharCode(N),st==="\\"&&(st="");else if(st=String(N),_){var As=C-st.length;if(As>0){var Ps=new Array(As+1).join("0");N<0?st="-"+Ps+st.slice(1):st=Ps+st}}y.push(st)}}else{y=[];for(var fe=0;fe<m.length;fe++)y.push.apply(y,xr(m[fe],!1))}for(var fe=0;fe<y.length;fe++)for(var n=0;n<s.length;n++){var f=i+y[fe]+s[n];(!t||h||f)&&e.push(f)}}return e}});function Cy(r,t){if(r instanceof ae)throw I("Command execution failed",r,{command:r.command,originalError:r.originalError}),r;if(r instanceof Error){let o=new ae(r.message,t,r);throw I("Failed to execute command",r,{command:t,stack:r.stack}),o}let e=new ae("Unknown error occurred during command execution",t);throw I("Failed to execute command",null,{error:r,command:t}),e}async function Mp(r,t={}){if(!r||typeof r!="string")throw new ae("Command must be a non-empty string",r);let e={encoding:"utf8",maxBuffer:5*1024*1024,timeout:3e4};try{let{stdout:o,stderr:i}=await vy(r,{...e,...t}),s=o.trim();if(!s)throw i?new ae(`Command failed with stderr: ${i}`,r):new ae("Command returned empty result",r);return s}catch(o){Cy(o,r)}}var Rp,Dp,vy,ae,Ip=p(()=>{"use strict";Rp=require("child_process"),Dp=require("util");Pt();vy=(0,Dp.promisify)(Rp.exec),ae=class extends Error{constructor(e,o,i){super(e);this.command=o;this.originalError=i;this.name="CommandExecutionError"}}});var Lp={};Zp(Lp,{getChromePassword:()=>ky});var Ey,ky,Fp=p(()=>{"use strict";Jt();Ip();Ey=async()=>Mp('security find-generic-password -w -s "Chrome Safe Storage"'),ky=ft(Ey)});function th(r){let t=r.split("."),e=[];e.push({name:"%",domain:r});for(let o=1;o<t.length-1;o++){let i=t.slice(o).join(".");e.push({name:"%",domain:i})}return e}function Oi(r){if(!r.includes("://"))try{return Oi(`https://${r}`)}catch(t){return[{name:"%",domain:r}]}try{let t=new URL(r);return th(t.hostname)}catch(t){return[{name:"%",domain:r}]}}var Ds=ke(require("minimist"),1);function Ms(r){let t=(0,Ds.default)(r,{string:["browser","profile","url","domain","name","output"],boolean:["help","version","verbose","dump","dump-grouped","render","render-grouped"],alias:{b:"browser",p:"profile",u:"url",d:"domain",n:"name",h:"help",v:"version",D:"dump-grouped",r:"render",R:"render-grouped"}}),{_:e,...o}=t;return{values:o,positionals:e}}nt();Pt();var su=require("fs"),Go=require("path"),nu=ke(require("fast-glob"),1);Pt();var ou=require("path");Jt();var eu={};Xi(eu,process.env);var Uo=eu.HOME;if(typeof Uo!="string"||Uo.length===0)throw new Error("HOME environment variable is not set or empty");var ru,Ge=(0,ou.join)((ru=Uo)!=null?ru:"","Library","Application Support","Google","Chrome");var iu=ke(require("better-sqlite3"),1);Jt();Pt();var tx=ft(r=>{try{return Promise.resolve(new iu.default(r,{readonly:!0}))}catch(t){throw I("Database open failed",t,{file:r}),t}});function ex(r){try{return r.close(),Promise.resolve()}catch(t){return I("Database close failed",t),Promise.reject(t instanceof Error?t:new Error("Failed to close database: Unknown error"))}}async function $o({file:r,sql:t,params:e,rowFilter:o,rowTransform:i}){let s;try{s=await tx(r);let f=s.prepare(t).all(e),l=o?f.filter(o):f;return i?l.map(i):l}catch(n){throw I("Database query failed",n,{file:r,sql:t}),n}finally{s&&await ex(s)}}function rx(r){if(typeof r!="string")return!1;let t=r.trim();return t.length===0?!1:(0,su.existsSync)(t)}async function ox(){let r=[(0,Go.join)(Ge,"Default/Cookies"),(0,Go.join)(Ge,"Profile */Cookies"),(0,Go.join)(Ge,"Profile Default/Cookies")],t=[];for(let e of r){let o=await(0,nu.default)(e);t.push(...o)}return bt("ChromeCookies","Found cookie files",{count:t.length,files:t}),t}function ix(r,t){let e=r==="%",o=e?"SELECT name, encrypted_value, host_key, expires_utc FROM cookies WHERE host_key LIKE ?":"SELECT name, encrypted_value, host_key, expires_utc FROM cookies WHERE name = ? AND host_key LIKE ?",i=e?[`%${t}%`]:[r,`%${t}%`];return{sql:o,params:i}}async function sx(r,t,e){try{let{sql:o,params:i}=ix(t,e);bt("ChromeCookies","Executing query",{sql:o,params:i});let s=await $o({file:r,sql:o,params:i,rowTransform:n=>({name:n.name,domain:n.host_key,value:n.encrypted_value,expiry:n.expires_utc})});return Ls("QueryCookies",!0,{file:r,count:s.length}),s}catch(o){return I("Failed to read cookie file",o,{file:r}),[]}}async function au({name:r,domain:t,file:e}){let o=typeof e=="string"&&e.length>0?[e]:await ox();if(o.length===0)return bt("ChromeCookies","No cookie files found"),[];let i=[];for(let s of o){if(!rx(s)){bt("ChromeCookies","Cookie file missing or invalid",{file:s});continue}let n=await sx(s,r,t);i.push(...n)}return bt("ChromeCookies","Query complete",{totalCookies:i.length}),i}var _u=ke(bu(),1);var yr=r=>{if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>65536)throw new TypeError("pattern is too long")};var cx={"[: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]},wr=r=>r.replace(/[[\]\\-]/g,"\\$&"),mx=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Su=r=>r.join(""),vu=(r,t)=>{let e=t;if(r.charAt(e)!=="[")throw new Error("not in a brace expression");let o=[],i=[],s=e+1,n=!1,f=!1,l=!1,u=!1,h=e,d="";t:for(;s<r.length;){let x=r.charAt(s);if((x==="!"||x==="^")&&s===e+1){u=!0,s++;continue}if(x==="]"&&n&&!l){h=s+1;break}if(n=!0,x==="\\"&&!l){l=!0,s++;continue}if(x==="["&&!l){for(let[C,[E,T,A]]of Object.entries(cx))if(r.startsWith(C,s)){if(d)return["$.",!1,r.length-e,!0];s+=C.length,A?i.push(E):o.push(E),f=f||T;continue t}}if(l=!1,d){x>d?o.push(wr(d)+"-"+wr(x)):x===d&&o.push(wr(x)),d="",s++;continue}if(r.startsWith("-]",s+1)){o.push(wr(x+"-")),s+=2;continue}if(r.startsWith("-",s+1)){d=x,s+=2;continue}o.push(wr(x)),s++}if(h<s)return["",!1,0,!1];if(!o.length&&!i.length)return["$.",!1,r.length-e,!0];if(i.length===0&&o.length===1&&/^\\?.$/.test(o[0])&&!u){let x=o[0].length===2?o[0].slice(-1):o[0];return[mx(x),!1,h-e,!1]}let m="["+(u?"^":"")+Su(o)+"]",y="["+(u?"":"^")+Su(i)+"]";return[o.length&&i.length?"("+m+"|"+y+")":o.length?m:y,f,h-e,!0]};var dt=(r,{windowsPathsNoEscape:t=!1}={})=>t?r.replace(/\[([^\/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var dx=new Set(["!","?","+","*","@"]),Cu=r=>dx.has(r),gx="(?!(?:^|/)\\.\\.?(?:$|/))",Ho="(?!\\.)",xx=new Set(["[","."]),yx=new Set(["..","."]),wx=new Set("().*{}+?[]^$\\!"),bx=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),os="[^/]",Eu=os+"*?",ku=os+"+?",B,W,Mt,R,F,Yt,me,Zt,Ct,de,br,ge,Ou,Xt,qo,rs,Tu,J=class J{constructor(t,e,o={}){w(this,ge);c(this,"type");w(this,B);w(this,W);w(this,Mt,!1);w(this,R,[]);w(this,F);w(this,Yt);w(this,me);w(this,Zt,!1);w(this,Ct);w(this,de);w(this,br,!1);this.type=t,t&&g(this,W,!0),g(this,F,e),g(this,B,a(this,F)?a(a(this,F),B):this),g(this,Ct,a(this,B)===this?o:a(a(this,B),Ct)),g(this,me,a(this,B)===this?[]:a(a(this,B),me)),t==="!"&&!a(a(this,B),Zt)&&a(this,me).push(this),g(this,Yt,a(this,F)?a(a(this,F),R).length:0)}get hasMagic(){if(a(this,W)!==void 0)return a(this,W);for(let t of a(this,R))if(typeof t!="string"&&(t.type||t.hasMagic))return g(this,W,!0);return a(this,W)}toString(){return a(this,de)!==void 0?a(this,de):this.type?g(this,de,this.type+"("+a(this,R).map(t=>String(t)).join("|")+")"):g(this,de,a(this,R).map(t=>String(t)).join(""))}push(...t){for(let e of t)if(e!==""){if(typeof e!="string"&&!(e instanceof J&&a(e,F)===this))throw new Error("invalid part: "+e);a(this,R).push(e)}}toJSON(){var e;let t=this.type===null?a(this,R).slice().map(o=>typeof o=="string"?o:o.toJSON()):[this.type,...a(this,R).map(o=>o.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===a(this,B)||a(a(this,B),Zt)&&((e=a(this,F))==null?void 0:e.type)==="!")&&t.push({}),t}isStart(){var e;if(a(this,B)===this)return!0;if(!((e=a(this,F))!=null&&e.isStart()))return!1;if(a(this,Yt)===0)return!0;let t=a(this,F);for(let o=0;o<a(this,Yt);o++){let i=a(t,R)[o];if(!(i instanceof J&&i.type==="!"))return!1}return!0}isEnd(){var e,o,i;if(a(this,B)===this||((e=a(this,F))==null?void 0:e.type)==="!")return!0;if(!((o=a(this,F))!=null&&o.isEnd()))return!1;if(!this.type)return(i=a(this,F))==null?void 0:i.isEnd();let t=a(this,F)?a(a(this,F),R).length:0;return a(this,Yt)===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let e=new J(this.type,t);for(let o of a(this,R))e.copyIn(o);return e}static fromGlob(t,e={}){var i;let o=new J(null,void 0,e);return S(i=J,Xt,qo).call(i,t,o,0,e),o}toMMPattern(){if(this!==a(this,B))return a(this,B).toMMPattern();let t=this.toString(),[e,o,i,s]=this.toRegExpSource();if(!(i||a(this,W)||a(this,Ct).nocase&&!a(this,Ct).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return o;let f=(a(this,Ct).nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${e}$`,f),{_src:e,_glob:t})}get options(){return a(this,Ct)}toRegExpSource(t){var l;let e=t!=null?t:!!a(this,Ct).dot;if(a(this,B)===this&&S(this,ge,Ou).call(this),!this.type){let u=this.isStart()&&this.isEnd(),h=a(this,R).map(b=>{var A;let[x,C,E,T]=typeof b=="string"?S(A=J,Xt,Tu).call(A,b,a(this,W),u):b.toRegExpSource(t);return g(this,W,a(this,W)||E),g(this,Mt,a(this,Mt)||T),x}).join(""),d="";if(this.isStart()&&typeof a(this,R)[0]=="string"&&!(a(this,R).length===1&&yx.has(a(this,R)[0]))){let x=xx,C=e&&x.has(h.charAt(0))||h.startsWith("\\.")&&x.has(h.charAt(2))||h.startsWith("\\.\\.")&&x.has(h.charAt(4)),E=!e&&!t&&x.has(h.charAt(0));d=C?gx:E?Ho:""}let m="";return this.isEnd()&&a(a(this,B),Zt)&&((l=a(this,F))==null?void 0:l.type)==="!"&&(m="(?:$|\\/)"),[d+h+m,dt(h),g(this,W,!!a(this,W)),a(this,Mt)]}let o=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=S(this,ge,rs).call(this,e);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let u=this.toString();return g(this,R,[u]),this.type=null,g(this,W,void 0),[u,dt(this.toString()),!1,!1]}let n=!o||t||e||!Ho?"":S(this,ge,rs).call(this,!0);n===s&&(n=""),n&&(s=`(?:${s})(?:${n})*?`);let f="";if(this.type==="!"&&a(this,br))f=(this.isStart()&&!e?Ho:"")+ku;else{let u=this.type==="!"?"))"+(this.isStart()&&!e&&!t?Ho:"")+Eu+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&n?")":this.type==="*"&&n?")?":`)${this.type}`;f=i+s+u}return[f,dt(s),g(this,W,!!a(this,W)),a(this,Mt)]}};B=new WeakMap,W=new WeakMap,Mt=new WeakMap,R=new WeakMap,F=new WeakMap,Yt=new WeakMap,me=new WeakMap,Zt=new WeakMap,Ct=new WeakMap,de=new WeakMap,br=new WeakMap,ge=new WeakSet,Ou=function(){if(this!==a(this,B))throw new Error("should only call on root");if(a(this,Zt))return this;this.toString(),g(this,Zt,!0);let t;for(;t=a(this,me).pop();){if(t.type!=="!")continue;let e=t,o=a(e,F);for(;o;){for(let i=a(e,Yt)+1;!o.type&&i<a(o,R).length;i++)for(let s of a(t,R)){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(a(o,R)[i])}e=o,o=a(e,F)}}return this},Xt=new WeakSet,qo=function(t,e,o,i){var y,b;let s=!1,n=!1,f=-1,l=!1;if(e.type===null){let x=o,C="";for(;x<t.length;){let E=t.charAt(x++);if(s||E==="\\"){s=!s,C+=E;continue}if(n){x===f+1?(E==="^"||E==="!")&&(l=!0):E==="]"&&!(x===f+2&&l)&&(n=!1),C+=E;continue}else if(E==="["){n=!0,f=x,l=!1,C+=E;continue}if(!i.noext&&Cu(E)&&t.charAt(x)==="("){e.push(C),C="";let T=new J(E,e);x=S(y=J,Xt,qo).call(y,t,T,x,i),e.push(T);continue}C+=E}return e.push(C),x}let u=o+1,h=new J(null,e),d=[],m="";for(;u<t.length;){let x=t.charAt(u++);if(s||x==="\\"){s=!s,m+=x;continue}if(n){u===f+1?(x==="^"||x==="!")&&(l=!0):x==="]"&&!(u===f+2&&l)&&(n=!1),m+=x;continue}else if(x==="["){n=!0,f=u,l=!1,m+=x;continue}if(Cu(x)&&t.charAt(u)==="("){h.push(m),m="";let C=new J(x,h);h.push(C),u=S(b=J,Xt,qo).call(b,t,C,u,i);continue}if(x==="|"){h.push(m),m="",d.push(h),h=new J(null,e);continue}if(x===")")return m===""&&a(e,R).length===0&&g(e,br,!0),h.push(m),m="",e.push(...d,h),u;m+=x}return e.type=null,g(e,W,void 0),g(e,R,[t.substring(o-1)]),u},rs=function(t){return a(this,R).map(e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");let[o,i,s,n]=e.toRegExpSource(t);return g(this,Mt,a(this,Mt)||n),o}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join("|")},Tu=function(t,e,o=!1){let i=!1,s="",n=!1;for(let f=0;f<t.length;f++){let l=t.charAt(f);if(i){i=!1,s+=(wx.has(l)?"\\":"")+l;continue}if(l==="\\"){f===t.length-1?s+="\\\\":i=!0;continue}if(l==="["){let[u,h,d,m]=vu(t,f);if(d){s+=u,n=n||h,f+=d-1,e=e||m;continue}}if(l==="*"){o&&t==="*"?s+=ku:s+=Eu,e=!0;continue}if(l==="?"){s+=os,e=!0;continue}s+=bx(l)}return[s,dt(t),!!e,n]},w(J,Xt);var He=J;var qe=(r,{windowsPathsNoEscape:t=!1}={})=>t?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&");var Y=(r,t,e={})=>(yr(t),!e.nocomment&&t.charAt(0)==="#"?!1:new rt(t,e).match(r)),Sx=/^\*+([^+@!?\*\[\(]*)$/,vx=r=>t=>!t.startsWith(".")&&t.endsWith(r),Cx=r=>t=>t.endsWith(r),Ex=r=>(r=r.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(r)),kx=r=>(r=r.toLowerCase(),t=>t.toLowerCase().endsWith(r)),Ox=/^\*+\.\*+$/,Tx=r=>!r.startsWith(".")&&r.includes("."),Ax=r=>r!=="."&&r!==".."&&r.includes("."),Px=/^\.\*+$/,_x=r=>r!=="."&&r!==".."&&r.startsWith("."),Rx=/^\*+$/,Dx=r=>r.length!==0&&!r.startsWith("."),Mx=r=>r.length!==0&&r!=="."&&r!=="..",Ix=/^\?+([^+@!?\*\[\(]*)?$/,Lx=([r,t=""])=>{let e=Ru([r]);return t?(t=t.toLowerCase(),o=>e(o)&&o.toLowerCase().endsWith(t)):e},Fx=([r,t=""])=>{let e=Du([r]);return t?(t=t.toLowerCase(),o=>e(o)&&o.toLowerCase().endsWith(t)):e},Nx=([r,t=""])=>{let e=Du([r]);return t?o=>e(o)&&o.endsWith(t):e},Bx=([r,t=""])=>{let e=Ru([r]);return t?o=>e(o)&&o.endsWith(t):e},Ru=([r])=>{let t=r.length;return e=>e.length===t&&!e.startsWith(".")},Du=([r])=>{let t=r.length;return e=>e.length===t&&e!=="."&&e!==".."},Mu=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Au={win32:{sep:"\\"},posix:{sep:"/"}},jx=Mu==="win32"?Au.win32.sep:Au.posix.sep;Y.sep=jx;var q=Symbol("globstar **");Y.GLOBSTAR=q;var Wx="[^/]",Ux=Wx+"*?",$x="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Gx="(?:(?!(?:\\/|^)\\.).)*?",Hx=(r,t={})=>e=>Y(e,r,t);Y.filter=Hx;var lt=(r,t={})=>Object.assign({},r,t),qx=r=>{if(!r||typeof r!="object"||!Object.keys(r).length)return Y;let t=Y;return Object.assign((o,i,s={})=>t(o,i,lt(r,s)),{Minimatch:class extends t.Minimatch{constructor(i,s={}){super(i,lt(r,s))}static defaults(i){return t.defaults(lt(r,i)).Minimatch}},AST:class extends t.AST{constructor(i,s,n={}){super(i,s,lt(r,n))}static fromGlob(i,s={}){return t.AST.fromGlob(i,lt(r,s))}},unescape:(o,i={})=>t.unescape(o,lt(r,i)),escape:(o,i={})=>t.escape(o,lt(r,i)),filter:(o,i={})=>t.filter(o,lt(r,i)),defaults:o=>t.defaults(lt(r,o)),makeRe:(o,i={})=>t.makeRe(o,lt(r,i)),braceExpand:(o,i={})=>t.braceExpand(o,lt(r,i)),match:(o,i,s={})=>t.match(o,i,lt(r,s)),sep:t.sep,GLOBSTAR:q})};Y.defaults=qx;var Iu=(r,t={})=>(yr(r),t.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:(0,_u.default)(r));Y.braceExpand=Iu;var zx=(r,t={})=>new rt(r,t).makeRe();Y.makeRe=zx;var Kx=(r,t,e={})=>{let o=new rt(t,e);return r=r.filter(i=>o.match(i)),o.options.nonull&&!r.length&&r.push(t),r};Y.match=Kx;var Pu=/[?*]|[+@!]\(.*?\)|\[|\]/,Qx=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),rt=class{constructor(t,e={}){c(this,"options");c(this,"set");c(this,"pattern");c(this,"windowsPathsNoEscape");c(this,"nonegate");c(this,"negate");c(this,"comment");c(this,"empty");c(this,"preserveMultipleSlashes");c(this,"partial");c(this,"globSet");c(this,"globParts");c(this,"nocase");c(this,"isWindows");c(this,"platform");c(this,"windowsNoMagicRoot");c(this,"regexp");yr(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||Mu,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(let t of this.set)for(let e of t)if(typeof e!="string")return!0;return!1}debug(...t){}make(){let 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=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let o=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(o),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,n,f)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=s[0]===""&&s[1]===""&&(s[2]==="?"||!Pu.test(s[2]))&&!Pu.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(l)return[...s.slice(0,4),...s.slice(4).map(h=>this.parse(h))];if(u)return[s[0],...s.slice(1).map(h=>this.parse(h))]}return s.map(l=>this.parse(l))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let n=this.set[s];n[0]===""&&n[1]===""&&this.globParts[s][2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3])&&(n[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let o=0;o<t.length;o++)for(let i=0;i<t[o].length;i++)t[o][i]==="**"&&(t[o][i]="*");let{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 o=-1;for(;(o=e.indexOf("**",o+1))!==-1;){let i=o;for(;e[i+1]==="**";)i++;i!==o&&e.splice(o,i-o)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((o,i)=>{let s=o[o.length-1];return i==="**"&&s==="**"?o:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(o.pop(),o):(o.push(i),o)},[]),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++){let s=t[i];i===1&&s===""&&t[0]===""||(s==="."||s==="")&&(e=!0,t.splice(i,1),i--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(e=!0,t.pop())}let o=0;for(;(o=t.indexOf("..",o+1))!==-1;){let i=t[o-1];i&&i!=="."&&i!==".."&&i!=="**"&&(e=!0,t.splice(o-1,2),o-=2)}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let o of t){let i=-1;for(;(i=o.indexOf("**",i+1))!==-1;){let n=i;for(;o[n+1]==="**";)n++;n>i&&o.splice(i+1,n-i);let f=o[i+1],l=o[i+2],u=o[i+3];if(f!==".."||!l||l==="."||l===".."||!u||u==="."||u==="..")continue;e=!0,o.splice(i,1);let h=o.slice(0);h[i]="**",t.push(h),i--}if(!this.preserveMultipleSlashes){for(let n=1;n<o.length-1;n++){let f=o[n];n===1&&f===""&&o[0]===""||(f==="."||f==="")&&(e=!0,o.splice(n,1),n--)}o[0]==="."&&o.length===2&&(o[1]==="."||o[1]==="")&&(e=!0,o.pop())}let s=0;for(;(s=o.indexOf("..",s+1))!==-1;){let n=o[s-1];if(n&&n!=="."&&n!==".."&&n!=="**"){e=!0;let l=s===1&&o[s+1]==="**"?["."]:[];o.splice(s-1,2,...l),o.length===0&&o.push(""),s-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let o=e+1;o<t.length;o++){let i=this.partsMatch(t[e],t[o],!this.preserveMultipleSlashes);if(i){t[e]=[],t[o]=i;break}}return t.filter(e=>e.length)}partsMatch(t,e,o=!1){let i=0,s=0,n=[],f="";for(;i<t.length&&s<e.length;)if(t[i]===e[s])n.push(f==="b"?e[s]:t[i]),i++,s++;else if(o&&t[i]==="**"&&e[s]===t[i+1])n.push(t[i]),i++;else if(o&&e[s]==="**"&&t[i]===e[s+1])n.push(e[s]),s++;else if(t[i]==="*"&&e[s]&&(this.options.dot||!e[s].startsWith("."))&&e[s]!=="**"){if(f==="b")return!1;f="a",n.push(t[i]),i++,s++}else if(e[s]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(f==="a")return!1;f="b",n.push(e[s]),i++,s++}else return!1;return t.length===e.length&&n}parseNegate(){if(this.nonegate)return;let t=this.pattern,e=!1,o=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)e=!e,o++;o&&(this.pattern=t.slice(o)),this.negate=e}matchOne(t,e,o=!1){let i=this.options;if(this.isWindows){let x=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),C=!x&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),E=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),T=!E&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3]),A=C?3:x?0:void 0,_=T?3:E?0:void 0;if(typeof A=="number"&&typeof _=="number"){let[N,st]=[t[A],e[_]];N.toLowerCase()===st.toLowerCase()&&(e[_]=N,_>A?e=e.slice(_):A>_&&(t=t.slice(A)))}}let{optimizationLevel:s=1}=this.options;s>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var n=0,f=0,l=t.length,u=e.length;n<l&&f<u;n++,f++){this.debug("matchOne loop");var h=e[f],d=t[n];if(this.debug(e,h,d),h===!1)return!1;if(h===q){this.debug("GLOBSTAR",[e,h,d]);var m=n,y=f+1;if(y===u){for(this.debug("** at the end");n<l;n++)if(t[n]==="."||t[n]===".."||!i.dot&&t[n].charAt(0)===".")return!1;return!0}for(;m<l;){var b=t[m];if(this.debug(`
|
|
3
|
-
globstar while`,t,
|
|
4
|
-
>>> no match, partial?`,t,m,e,y),m===l))}let x;if(typeof h=="string"?(x=d===h,this.debug("string match",h,d,x)):(x=h.test(d),this.debug("pattern match",h,d,x)),!x)return!1}if(n===l&&f===u)return!0;if(n===l)return o;if(f===u)return n===l-1&&t[n]==="";throw new Error("wtf?")}braceExpand(){return Iu(this.pattern,this.options)}parse(t){yr(t);let e=this.options;if(t==="**")return q;if(t==="")return"";let o,i=null;(o=t.match(Rx))?i=e.dot?Mx:Dx:(o=t.match(Sx))?i=(e.nocase?e.dot?kx:Ex:e.dot?Cx:vx)(o[1]):(o=t.match(Ix))?i=(e.nocase?e.dot?Fx:Lx:e.dot?Nx:Bx)(o):(o=t.match(Ox))?i=e.dot?Ax:Tx:(o=t.match(Px))&&(i=_x);let s=He.fromGlob(t,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let e=this.options,o=e.noglobstar?Ux:e.dot?$x:Gx,i=new Set(e.nocase?["i"]:[]),s=t.map(l=>{let u=l.map(h=>{if(h instanceof RegExp)for(let d of h.flags.split(""))i.add(d);return typeof h=="string"?Qx(h):h===q?q:h._src});return u.forEach((h,d)=>{let m=u[d+1],y=u[d-1];h!==q||y===q||(y===void 0?m!==void 0&&m!==q?u[d+1]="(?:\\/|"+o+"\\/)?"+m:u[d]=o:m===void 0?u[d-1]=y+"(?:\\/|"+o+")?":m!==q&&(u[d-1]=y+"(?:\\/|\\/"+o+"\\/)"+m,u[d+1]=q))}),u.filter(h=>h!==q).join("/")}).join("|"),[n,f]=t.length>1?["(?:",")"]:["",""];s="^"+n+s+f+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch(l){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;let o=this.options;this.isWindows&&(t=t.split("\\").join("/"));let i=this.slashSplit(t);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let n=i[i.length-1];if(!n)for(let f=i.length-2;!n&&f>=0;f--)n=i[f];for(let f=0;f<s.length;f++){let l=s[f],u=i;if(o.matchBase&&l.length===1&&(u=[n]),this.matchOne(u,l,e))return o.flipNegate?!0:!this.negate}return o.flipNegate?!1:this.negate}static defaults(t){return Y.defaults(t).Minimatch}};Y.AST=He;Y.Minimatch=rt;Y.escape=qe;Y.unescape=dt;var Cp=require("url");var bs=require("lru-cache"),Ze=require("path"),lp=require("url"),At=require("fs"),iy=ke(require("fs"),1),oe=require("fs/promises");var Zo=require("events"),us=ke(require("stream"),1),ip=require("string_decoder");var Lu=typeof process=="object"&&process?process:{stdout:null,stderr:null},Vx=r=>!!r&&typeof r=="object"&&(r instanceof ee||r instanceof us.default||Jx(r)||Yx(r)),Jx=r=>!!r&&typeof r=="object"&&r instanceof Zo.EventEmitter&&typeof r.pipe=="function"&&r.pipe!==us.default.Writable.prototype.pipe,Yx=r=>!!r&&typeof r=="object"&&r instanceof Zo.EventEmitter&&typeof r.write=="function"&&typeof r.end=="function",It=Symbol("EOF"),Lt=Symbol("maybeEmitEnd"),te=Symbol("emittedEnd"),zo=Symbol("emittingEnd"),Sr=Symbol("emittedError"),Ko=Symbol("closed"),Fu=Symbol("read"),Qo=Symbol("flush"),Nu=Symbol("flushChunk"),gt=Symbol("encoding"),ze=Symbol("decoder"),U=Symbol("flowing"),vr=Symbol("paused"),Ke=Symbol("resume"),$=Symbol("buffer"),Z=Symbol("pipes"),G=Symbol("bufferLength"),is=Symbol("bufferPush"),Vo=Symbol("bufferShift"),K=Symbol("objectMode"),M=Symbol("destroyed"),ss=Symbol("error"),ns=Symbol("emitData"),Bu=Symbol("emitEnd"),as=Symbol("emitEnd2"),Et=Symbol("async"),fs=Symbol("abort"),Jo=Symbol("aborted"),Cr=Symbol("signal"),xe=Symbol("dataListeners"),ot=Symbol("discarded"),Er=r=>Promise.resolve().then(r),Zx=r=>r(),Xx=r=>r==="end"||r==="finish"||r==="prefinish",ty=r=>r instanceof ArrayBuffer||!!r&&typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,ey=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),Yo=class{constructor(t,e,o){c(this,"src");c(this,"dest");c(this,"opts");c(this,"ondrain");this.src=t,this.dest=e,this.opts=o,this.ondrain=()=>t[Ke](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},ls=class extends Yo{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,e,o){super(t,e,o),this.proxyErrors=i=>e.emit("error",i),t.on("error",this.proxyErrors)}},ry=r=>!!r.objectMode,oy=r=>!r.objectMode&&!!r.encoding&&r.encoding!=="buffer",ju,Wu,Uu,$u,Gu,Hu,qu,zu,Ku,Qu,Vu,Ju,Yu,Zu,Xu,tp,ep,rp,op,ee=class extends Zo.EventEmitter{constructor(...e){let o=e[0]||{};super();c(this,op,!1);c(this,rp,!1);c(this,ep,[]);c(this,tp,[]);c(this,Xu);c(this,Zu);c(this,Yu);c(this,Ju);c(this,Vu,!1);c(this,Qu,!1);c(this,Ku,!1);c(this,zu,!1);c(this,qu,null);c(this,Hu,0);c(this,Gu,!1);c(this,$u);c(this,Uu,!1);c(this,Wu,0);c(this,ju,!1);c(this,"writable",!0);c(this,"readable",!0);if(o.objectMode&&typeof o.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");ry(o)?(this[K]=!0,this[gt]=null):oy(o)?(this[gt]=o.encoding,this[K]=!1):(this[K]=!1,this[gt]=null),this[Et]=!!o.async,this[ze]=this[gt]?new ip.StringDecoder(this[gt]):null,o&&o.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[$]}),o&&o.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[Z]});let{signal:i}=o;i&&(this[Cr]=i,i.aborted?this[fs]():i.addEventListener("abort",()=>this[fs]()))}get bufferLength(){return this[G]}get encoding(){return this[gt]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[K]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Et]}set async(e){this[Et]=this[Et]||!!e}[(op=U,rp=vr,ep=Z,tp=$,Xu=K,Zu=gt,Yu=Et,Ju=ze,Vu=It,Qu=te,Ku=zo,zu=Ko,qu=Sr,Hu=G,Gu=M,$u=Cr,Uu=Jo,Wu=xe,ju=ot,fs)](){var e,o;this[Jo]=!0,this.emit("abort",(e=this[Cr])==null?void 0:e.reason),this.destroy((o=this[Cr])==null?void 0:o.reason)}get aborted(){return this[Jo]}set aborted(e){}write(e,o,i){var n;if(this[Jo])return!1;if(this[It])throw new Error("write after end");if(this[M])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof o=="function"&&(i=o,o="utf8"),o||(o="utf8");let s=this[Et]?Er:Zx;if(!this[K]&&!Buffer.isBuffer(e)){if(ey(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(ty(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[K]?(this[U]&&this[G]!==0&&this[Qo](!0),this[U]?this.emit("data",e):this[is](e),this[G]!==0&&this.emit("readable"),i&&s(i),this[U]):e.length?(typeof e=="string"&&!(o===this[gt]&&!((n=this[ze])!=null&&n.lastNeed))&&(e=Buffer.from(e,o)),Buffer.isBuffer(e)&&this[gt]&&(e=this[ze].write(e)),this[U]&&this[G]!==0&&this[Qo](!0),this[U]?this.emit("data",e):this[is](e),this[G]!==0&&this.emit("readable"),i&&s(i),this[U]):(this[G]!==0&&this.emit("readable"),i&&s(i),this[U])}read(e){if(this[M])return null;if(this[ot]=!1,this[G]===0||e===0||e&&e>this[G])return this[Lt](),null;this[K]&&(e=null),this[$].length>1&&!this[K]&&(this[$]=[this[gt]?this[$].join(""):Buffer.concat(this[$],this[G])]);let o=this[Fu](e||null,this[$][0]);return this[Lt](),o}[Fu](e,o){if(this[K])this[Vo]();else{let i=o;e===i.length||e===null?this[Vo]():typeof i=="string"?(this[$][0]=i.slice(e),o=i.slice(0,e),this[G]-=e):(this[$][0]=i.subarray(e),o=i.subarray(0,e),this[G]-=e)}return this.emit("data",o),!this[$].length&&!this[It]&&this.emit("drain"),o}end(e,o,i){return typeof e=="function"&&(i=e,e=void 0),typeof o=="function"&&(i=o,o="utf8"),e!==void 0&&this.write(e,o),i&&this.once("end",i),this[It]=!0,this.writable=!1,(this[U]||!this[vr])&&this[Lt](),this}[Ke](){this[M]||(!this[xe]&&!this[Z].length&&(this[ot]=!0),this[vr]=!1,this[U]=!0,this.emit("resume"),this[$].length?this[Qo]():this[It]?this[Lt]():this.emit("drain"))}resume(){return this[Ke]()}pause(){this[U]=!1,this[vr]=!0,this[ot]=!1}get destroyed(){return this[M]}get flowing(){return this[U]}get paused(){return this[vr]}[is](e){this[K]?this[G]+=1:this[G]+=e.length,this[$].push(e)}[Vo](){return this[K]?this[G]-=1:this[G]-=this[$][0].length,this[$].shift()}[Qo](e=!1){do;while(this[Nu](this[Vo]())&&this[$].length);!e&&!this[$].length&&!this[It]&&this.emit("drain")}[Nu](e){return this.emit("data",e),this[U]}pipe(e,o){if(this[M])return e;this[ot]=!1;let i=this[te];return o=o||{},e===Lu.stdout||e===Lu.stderr?o.end=!1:o.end=o.end!==!1,o.proxyErrors=!!o.proxyErrors,i?o.end&&e.end():(this[Z].push(o.proxyErrors?new ls(this,e,o):new Yo(this,e,o)),this[Et]?Er(()=>this[Ke]()):this[Ke]()),e}unpipe(e){let o=this[Z].find(i=>i.dest===e);o&&(this[Z].length===1?(this[U]&&this[xe]===0&&(this[U]=!1),this[Z]=[]):this[Z].splice(this[Z].indexOf(o),1),o.unpipe())}addListener(e,o){return this.on(e,o)}on(e,o){let i=super.on(e,o);if(e==="data")this[ot]=!1,this[xe]++,!this[Z].length&&!this[U]&&this[Ke]();else if(e==="readable"&&this[G]!==0)super.emit("readable");else if(Xx(e)&&this[te])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Sr]){let s=o;this[Et]?Er(()=>s.call(this,this[Sr])):s.call(this,this[Sr])}return i}removeListener(e,o){return this.off(e,o)}off(e,o){let i=super.off(e,o);return e==="data"&&(this[xe]=this.listeners("data").length,this[xe]===0&&!this[ot]&&!this[Z].length&&(this[U]=!1)),i}removeAllListeners(e){let o=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[xe]=0,!this[ot]&&!this[Z].length&&(this[U]=!1)),o}get emittedEnd(){return this[te]}[Lt](){!this[zo]&&!this[te]&&!this[M]&&this[$].length===0&&this[It]&&(this[zo]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Ko]&&this.emit("close"),this[zo]=!1)}emit(e,...o){let i=o[0];if(e!=="error"&&e!=="close"&&e!==M&&this[M])return!1;if(e==="data")return!this[K]&&!i?!1:this[Et]?(Er(()=>this[ns](i)),!0):this[ns](i);if(e==="end")return this[Bu]();if(e==="close"){if(this[Ko]=!0,!this[te]&&!this[M])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[Sr]=i,super.emit(ss,i);let n=!this[Cr]||this.listeners("error").length?super.emit("error",i):!1;return this[Lt](),n}else if(e==="resume"){let n=super.emit("resume");return this[Lt](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let s=super.emit(e,...o);return this[Lt](),s}[ns](e){for(let i of this[Z])i.dest.write(e)===!1&&this.pause();let o=this[ot]?!1:super.emit("data",e);return this[Lt](),o}[Bu](){return this[te]?!1:(this[te]=!0,this.readable=!1,this[Et]?(Er(()=>this[as]()),!0):this[as]())}[as](){if(this[ze]){let o=this[ze].end();if(o){for(let i of this[Z])i.dest.write(o);this[ot]||super.emit("data",o)}}for(let o of this[Z])o.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[K]||(e.dataLength=0);let o=this.promise();return this.on("data",i=>{e.push(i),this[K]||(e.dataLength+=i.length)}),await o,e}async concat(){if(this[K])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[gt]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,o)=>{this.on(M,()=>o(new Error("stream destroyed"))),this.on("error",i=>o(i)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[ot]=!1;let e=!1,o=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return o();let s=this.read();if(s!==null)return Promise.resolve({done:!1,value:s});if(this[It])return o();let n,f,l=m=>{this.off("data",u),this.off("end",h),this.off(M,d),o(),f(m)},u=m=>{this.off("error",l),this.off("end",h),this.off(M,d),this.pause(),n({value:m,done:!!this[It]})},h=()=>{this.off("error",l),this.off("data",u),this.off(M,d),o(),n({done:!0,value:void 0})},d=()=>l(new Error("stream destroyed"));return new Promise((m,y)=>{f=y,n=m,this.once(M,d),this.once("error",l),this.once("end",h),this.once("data",u)})},throw:o,return:o,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[ot]=!1;let e=!1,o=()=>(this.pause(),this.off(ss,o),this.off(M,o),this.off("end",o),e=!0,{done:!0,value:void 0}),i=()=>{if(e)return o();let s=this.read();return s===null?o():{done:!1,value:s}};return this.once("end",o),this.once(ss,o),this.once(M,o),{next:i,throw:o,return:o,[Symbol.iterator](){return this}}}destroy(e){if(this[M])return e?this.emit("error",e):this.emit(M),this;this[M]=!0,this[ot]=!0,this[$].length=0,this[G]=0;let o=this;return typeof o.close=="function"&&!this[Ko]&&o.close(),e?this.emit("error",e):this.emit(M),this}static get isStream(){return Vx}};var sy=At.realpathSync.native,Or={lstatSync:At.lstatSync,readdir:At.readdir,readdirSync:At.readdirSync,readlinkSync:At.readlinkSync,realpathSync:sy,promises:{lstat:oe.lstat,readdir:oe.readdir,readlink:oe.readlink,realpath:oe.realpath}},up=r=>!r||r===Or||r===iy?Or:{...Or,...r,promises:{...Or.promises,...r.promises||{}}},pp=/^\\\\\?\\([a-z]:)\\?$/i,ny=r=>r.replace(/\//g,"\\").replace(pp,"$1\\"),ay=/[\\\/]/,pt=0,hp=1,cp=2,kt=4,mp=6,dp=8,ye=10,gp=12,ut=15,kr=~ut,ps=16,sp=32,Tr=64,xt=128,Xo=256,ei=512,np=Tr|xt|ei,fy=1023,hs=r=>r.isFile()?dp:r.isDirectory()?kt:r.isSymbolicLink()?ye:r.isCharacterDevice()?cp:r.isBlockDevice()?mp:r.isSocket()?gp:r.isFIFO()?hp:pt,ap=new Map,Ar=r=>{let t=ap.get(r);if(t)return t;let e=r.normalize("NFKD");return ap.set(r,e),e},fp=new Map,ti=r=>{let t=fp.get(r);if(t)return t;let e=Ar(r.toLowerCase());return fp.set(r,e),e},si=class extends bs.LRUCache{constructor(){super({max:256})}},cs=class extends bs.LRUCache{constructor(t=16*1024){super({maxSize:t,sizeCalculation:e=>e.length+1})}},xp=Symbol("PathScurry setAsCwd"),X,Dr,Mr,Ir,Lr,Fr,Nr,Br,jr,Wr,Ur,$r,Gr,Hr,qr,zr,Kr,Qr,Vr,re,we,Ot,Ft,Nt,Bt,k,be,jt,Tt,v,ms,ri,Pr,ds,gs,_r,oi,xs,ys,ii,yp,wp,bp,ws,Qe,Ve,Sp,Se,Q=class{constructor(t,e=pt,o,i,s,n,f){w(this,v);c(this,"name");c(this,"root");c(this,"roots");c(this,"parent");c(this,"nocase");c(this,"isCWD",!1);w(this,X);w(this,Dr);w(this,Mr);w(this,Ir);w(this,Lr);w(this,Fr);w(this,Nr);w(this,Br);w(this,jr);w(this,Wr);w(this,Ur);w(this,$r);w(this,Gr);w(this,Hr);w(this,qr);w(this,zr);w(this,Kr);w(this,Qr);w(this,Vr);w(this,re);w(this,we);w(this,Ot);w(this,Ft);w(this,Nt);w(this,Bt);w(this,k);w(this,be);w(this,jt);w(this,Tt);w(this,Qe,[]);w(this,Ve,!1);w(this,Se);this.name=t,g(this,re,s?ti(t):Ar(t)),g(this,k,e&fy),this.nocase=s,this.roots=i,this.root=o||this,g(this,be,n),g(this,Ot,f.fullpath),g(this,Nt,f.relative),g(this,Bt,f.relativePosix),this.parent=f.parent,this.parent?g(this,X,a(this.parent,X)):g(this,X,up(f.fs))}get dev(){return a(this,Dr)}get mode(){return a(this,Mr)}get nlink(){return a(this,Ir)}get uid(){return a(this,Lr)}get gid(){return a(this,Fr)}get rdev(){return a(this,Nr)}get blksize(){return a(this,Br)}get ino(){return a(this,jr)}get size(){return a(this,Wr)}get blocks(){return a(this,Ur)}get atimeMs(){return a(this,$r)}get mtimeMs(){return a(this,Gr)}get ctimeMs(){return a(this,Hr)}get birthtimeMs(){return a(this,qr)}get atime(){return a(this,zr)}get mtime(){return a(this,Kr)}get ctime(){return a(this,Qr)}get birthtime(){return a(this,Vr)}get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}depth(){return a(this,we)!==void 0?a(this,we):this.parent?g(this,we,this.parent.depth()+1):g(this,we,0)}childrenCache(){return a(this,be)}resolve(t){var n;if(!t)return this;let e=this.getRootString(t),i=t.substring(e.length).split(this.splitSep);return e?S(n=this.getRoot(e),v,ms).call(n,i):S(this,v,ms).call(this,i)}children(){let t=a(this,be).get(this);if(t)return t;let e=Object.assign([],{provisional:0});return a(this,be).set(this,e),g(this,k,a(this,k)&~ps),e}child(t,e){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let o=this.children(),i=this.nocase?ti(t):Ar(t);for(let l of o)if(a(l,re)===i)return l;let s=this.parent?this.sep:"",n=a(this,Ot)?a(this,Ot)+s+t:void 0,f=this.newChild(t,pt,{...e,parent:this,fullpath:n});return this.canReaddir()||g(f,k,a(f,k)|xt),o.push(f),f}relative(){if(this.isCWD)return"";if(a(this,Nt)!==void 0)return a(this,Nt);let t=this.name,e=this.parent;if(!e)return g(this,Nt,this.name);let o=e.relative();return o+(!o||!e.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(a(this,Bt)!==void 0)return a(this,Bt);let t=this.name,e=this.parent;if(!e)return g(this,Bt,this.fullpathPosix());let o=e.relativePosix();return o+(!o||!e.parent?"":"/")+t}fullpath(){if(a(this,Ot)!==void 0)return a(this,Ot);let t=this.name,e=this.parent;if(!e)return g(this,Ot,this.name);let i=e.fullpath()+(e.parent?this.sep:"")+t;return g(this,Ot,i)}fullpathPosix(){if(a(this,Ft)!==void 0)return a(this,Ft);if(this.sep==="/")return g(this,Ft,this.fullpath());if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?g(this,Ft,`//?/${i}`):g(this,Ft,i)}let t=this.parent,e=t.fullpathPosix(),o=e+(!e||!t.parent?"":"/")+this.name;return g(this,Ft,o)}isUnknown(){return(a(this,k)&ut)===pt}isType(t){return this[`is${t}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(a(this,k)&ut)===dp}isDirectory(){return(a(this,k)&ut)===kt}isCharacterDevice(){return(a(this,k)&ut)===cp}isBlockDevice(){return(a(this,k)&ut)===mp}isFIFO(){return(a(this,k)&ut)===hp}isSocket(){return(a(this,k)&ut)===gp}isSymbolicLink(){return(a(this,k)&ye)===ye}lstatCached(){return a(this,k)&sp?this:void 0}readlinkCached(){return a(this,jt)}realpathCached(){return a(this,Tt)}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(a(this,jt))return!0;if(!this.parent)return!1;let t=a(this,k)&ut;return!(t!==pt&&t!==ye||a(this,k)&Xo||a(this,k)&xt)}calledReaddir(){return!!(a(this,k)&ps)}isENOENT(){return!!(a(this,k)&xt)}isNamed(t){return this.nocase?a(this,re)===ti(t):a(this,re)===Ar(t)}async readlink(){var e;let t=a(this,jt);if(t)return t;if(this.canReadlink()&&this.parent)try{let o=await a(this,X).promises.readlink(this.fullpath()),i=(e=await this.parent.realpath())==null?void 0:e.resolve(o);if(i)return g(this,jt,i)}catch(o){S(this,v,ys).call(this,o.code);return}}readlinkSync(){var e;let t=a(this,jt);if(t)return t;if(this.canReadlink()&&this.parent)try{let o=a(this,X).readlinkSync(this.fullpath()),i=(e=this.parent.realpathSync())==null?void 0:e.resolve(o);if(i)return g(this,jt,i)}catch(o){S(this,v,ys).call(this,o.code);return}}async lstat(){if(!(a(this,k)&xt))try{return S(this,v,ws).call(this,await a(this,X).promises.lstat(this.fullpath())),this}catch(t){S(this,v,xs).call(this,t.code)}}lstatSync(){if(!(a(this,k)&xt))try{return S(this,v,ws).call(this,a(this,X).lstatSync(this.fullpath())),this}catch(t){S(this,v,xs).call(this,t.code)}}readdirCB(t,e=!1){if(!this.canReaddir()){e?t(null,[]):queueMicrotask(()=>t(null,[]));return}let o=this.children();if(this.calledReaddir()){let s=o.slice(0,o.provisional);e?t(null,s):queueMicrotask(()=>t(null,s));return}if(a(this,Qe).push(t),a(this,Ve))return;g(this,Ve,!0);let i=this.fullpath();a(this,X).readdir(i,{withFileTypes:!0},(s,n)=>{if(s)S(this,v,oi).call(this,s.code),o.provisional=0;else{for(let f of n)S(this,v,ii).call(this,f,o);S(this,v,ri).call(this,o)}S(this,v,Sp).call(this,o.slice(0,o.provisional))})}async readdir(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();if(a(this,Se))await a(this,Se);else{let o=()=>{};g(this,Se,new Promise(i=>o=i));try{for(let i of await a(this,X).promises.readdir(e,{withFileTypes:!0}))S(this,v,ii).call(this,i,t);S(this,v,ri).call(this,t)}catch(i){S(this,v,oi).call(this,i.code),t.provisional=0}g(this,Se,void 0),o()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();try{for(let o of a(this,X).readdirSync(e,{withFileTypes:!0}))S(this,v,ii).call(this,o,t);S(this,v,ri).call(this,t)}catch(o){S(this,v,oi).call(this,o.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(a(this,k)&np)return!1;let t=ut&a(this,k);return t===pt||t===kt||t===ye}shouldWalk(t,e){return(a(this,k)&kt)===kt&&!(a(this,k)&np)&&!t.has(this)&&(!e||e(this))}async realpath(){if(a(this,Tt))return a(this,Tt);if(!((ei|Xo|xt)&a(this,k)))try{let t=await a(this,X).promises.realpath(this.fullpath());return g(this,Tt,this.resolve(t))}catch(t){S(this,v,gs).call(this)}}realpathSync(){if(a(this,Tt))return a(this,Tt);if(!((ei|Xo|xt)&a(this,k)))try{let t=a(this,X).realpathSync(this.fullpath());return g(this,Tt,this.resolve(t))}catch(t){S(this,v,gs).call(this)}}[xp](t){if(t===this)return;t.isCWD=!1,this.isCWD=!0;let e=new Set([]),o=[],i=this;for(;i&&i.parent;)e.add(i),g(i,Nt,o.join(this.sep)),g(i,Bt,o.join("/")),i=i.parent,o.push("..");for(i=t;i&&i.parent&&!e.has(i);)g(i,Nt,void 0),g(i,Bt,void 0),i=i.parent}};X=new WeakMap,Dr=new WeakMap,Mr=new WeakMap,Ir=new WeakMap,Lr=new WeakMap,Fr=new WeakMap,Nr=new WeakMap,Br=new WeakMap,jr=new WeakMap,Wr=new WeakMap,Ur=new WeakMap,$r=new WeakMap,Gr=new WeakMap,Hr=new WeakMap,qr=new WeakMap,zr=new WeakMap,Kr=new WeakMap,Qr=new WeakMap,Vr=new WeakMap,re=new WeakMap,we=new WeakMap,Ot=new WeakMap,Ft=new WeakMap,Nt=new WeakMap,Bt=new WeakMap,k=new WeakMap,be=new WeakMap,jt=new WeakMap,Tt=new WeakMap,v=new WeakSet,ms=function(t){let e=this;for(let o of t)e=e.child(o);return e},ri=function(t){var e;g(this,k,a(this,k)|ps);for(let o=t.provisional;o<t.length;o++){let i=t[o];i&&S(e=i,v,Pr).call(e)}},Pr=function(){a(this,k)&xt||(g(this,k,(a(this,k)|xt)&kr),S(this,v,ds).call(this))},ds=function(){var e;let t=this.children();t.provisional=0;for(let o of t)S(e=o,v,Pr).call(e)},gs=function(){g(this,k,a(this,k)|ei),S(this,v,_r).call(this)},_r=function(){if(a(this,k)&Tr)return;let t=a(this,k);(t&ut)===kt&&(t&=kr),g(this,k,t|Tr),S(this,v,ds).call(this)},oi=function(t=""){t==="ENOTDIR"||t==="EPERM"?S(this,v,_r).call(this):t==="ENOENT"?S(this,v,Pr).call(this):this.children().provisional=0},xs=function(t=""){var e;if(t==="ENOTDIR"){let o=this.parent;S(e=o,v,_r).call(e)}else t==="ENOENT"&&S(this,v,Pr).call(this)},ys=function(t=""){var o;let e=a(this,k);e|=Xo,t==="ENOENT"&&(e|=xt),(t==="EINVAL"||t==="UNKNOWN")&&(e&=kr),g(this,k,e),t==="ENOTDIR"&&this.parent&&S(o=this.parent,v,_r).call(o)},ii=function(t,e){return S(this,v,wp).call(this,t,e)||S(this,v,yp).call(this,t,e)},yp=function(t,e){let o=hs(t),i=this.newChild(t.name,o,{parent:this}),s=a(i,k)&ut;return s!==kt&&s!==ye&&s!==pt&&g(i,k,a(i,k)|Tr),e.unshift(i),e.provisional++,i},wp=function(t,e){for(let o=e.provisional;o<e.length;o++){let i=e[o];if((this.nocase?ti(t.name):Ar(t.name))===a(i,re))return S(this,v,bp).call(this,t,i,o,e)}},bp=function(t,e,o,i){let s=e.name;return g(e,k,a(e,k)&kr|hs(t)),s!==t.name&&(e.name=t.name),o!==i.provisional&&(o===i.length-1?i.pop():i.splice(o,1),i.unshift(e)),i.provisional++,e},ws=function(t){let{atime:e,atimeMs:o,birthtime:i,birthtimeMs:s,blksize:n,blocks:f,ctime:l,ctimeMs:u,dev:h,gid:d,ino:m,mode:y,mtime:b,mtimeMs:x,nlink:C,rdev:E,size:T,uid:A}=t;g(this,zr,e),g(this,$r,o),g(this,Vr,i),g(this,qr,s),g(this,Br,n),g(this,Ur,f),g(this,Qr,l),g(this,Hr,u),g(this,Dr,h),g(this,Fr,d),g(this,jr,m),g(this,Mr,y),g(this,Kr,b),g(this,Gr,x),g(this,Ir,C),g(this,Nr,E),g(this,Wr,T),g(this,Lr,A);let _=hs(t);g(this,k,a(this,k)&kr|_|sp),_!==pt&&_!==kt&&_!==ye&&g(this,k,a(this,k)|Tr)},Qe=new WeakMap,Ve=new WeakMap,Sp=function(t){g(this,Ve,!1);let e=a(this,Qe).slice();a(this,Qe).length=0,e.forEach(o=>o(null,t))},Se=new WeakMap;var ni=class r extends Q{constructor(e,o=pt,i,s,n,f,l){super(e,o,i,s,n,f,l);c(this,"sep","\\");c(this,"splitSep",ay)}newChild(e,o=pt,i={}){return new r(e,o,this.root,this.roots,this.nocase,this.childrenCache(),i)}getRootString(e){return Ze.win32.parse(e).root}getRoot(e){if(e=ny(e.toUpperCase()),e===this.root.name)return this.root;for(let[o,i]of Object.entries(this.roots))if(this.sameRoot(e,o))return this.roots[e]=i;return this.roots[e]=new Xe(e,this).root}sameRoot(e,o=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(pp,"$1\\"),e===o}},ai=class r extends Q{constructor(e,o=pt,i,s,n,f,l){super(e,o,i,s,n,f,l);c(this,"splitSep","/");c(this,"sep","/")}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,o=pt,i={}){return new r(e,o,this.root,this.roots,this.nocase,this.childrenCache(),i)}},Je,Ye,Jr,Yr,fi=class{constructor(t=process.cwd(),e,o,{nocase:i,childrenCacheSize:s=16*1024,fs:n=Or}={}){c(this,"root");c(this,"rootPath");c(this,"roots");c(this,"cwd");w(this,Je);w(this,Ye);w(this,Jr);c(this,"nocase");w(this,Yr);g(this,Yr,up(n)),(t instanceof URL||t.startsWith("file://"))&&(t=(0,lp.fileURLToPath)(t));let f=e.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(f),g(this,Je,new si),g(this,Ye,new si),g(this,Jr,new cs(s));let l=f.substring(this.rootPath.length).split(o);if(l.length===1&&!l[0]&&l.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(a(this,Yr)),this.roots[this.rootPath]=this.root;let u=this.root,h=l.length-1,d=e.sep,m=this.rootPath,y=!1;for(let b of l){let x=h--;u=u.child(b,{relative:new Array(x).fill("..").join(d),relativePosix:new Array(x).fill("..").join("/"),fullpath:m+=(y?"":d)+b}),y=!0}this.cwd=u}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return a(this,Jr)}resolve(...t){let e="";for(let s=t.length-1;s>=0;s--){let n=t[s];if(!(!n||n===".")&&(e=e?`${n}/${e}`:n,this.isAbsolute(n)))break}let o=a(this,Je).get(e);if(o!==void 0)return o;let i=this.cwd.resolve(e).fullpath();return a(this,Je).set(e,i),i}resolvePosix(...t){let e="";for(let s=t.length-1;s>=0;s--){let n=t[s];if(!(!n||n===".")&&(e=e?`${n}/${e}`:n,this.isAbsolute(n)))break}let o=a(this,Ye).get(e);if(o!==void 0)return o;let i=this.cwd.resolve(e).fullpathPosix();return a(this,Ye).set(e,i),i}relative(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Q||(e=t,t=this.cwd);let{withFileTypes:o}=e;if(t.canReaddir()){let i=await t.readdir();return o?i:i.map(s=>s.name)}else return[]}readdirSync(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Q||(e=t,t=this.cwd);let{withFileTypes:o=!0}=e;return t.canReaddir()?o?t.readdirSync():t.readdirSync().map(i=>i.name):[]}async lstat(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Q||(e=t.withFileTypes,t=this.cwd);let o=await t.readlink();return e?o:o==null?void 0:o.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Q||(e=t.withFileTypes,t=this.cwd);let o=t.readlinkSync();return e?o:o==null?void 0:o.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Q||(e=t.withFileTypes,t=this.cwd);let o=await t.realpath();return e?o:o==null?void 0:o.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Q||(e=t.withFileTypes,t=this.cwd);let o=t.realpathSync();return e?o:o==null?void 0:o.fullpath()}async walk(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Q||(e=t,t=this.cwd);let{withFileTypes:o=!0,follow:i=!1,filter:s,walkFilter:n}=e,f=[];(!s||s(t))&&f.push(o?t:t.fullpath());let l=new Set,u=(d,m)=>{l.add(d),d.readdirCB((y,b)=>{if(y)return m(y);let x=b.length;if(!x)return m();let C=()=>{--x===0&&m()};for(let E of b)(!s||s(E))&&f.push(o?E:E.fullpath()),i&&E.isSymbolicLink()?E.realpath().then(T=>T!=null&&T.isUnknown()?T.lstat():T).then(T=>T!=null&&T.shouldWalk(l,n)?u(T,C):C()):E.shouldWalk(l,n)?u(E,C):C()},!0)},h=t;return new Promise((d,m)=>{u(h,y=>{if(y)return m(y);d(f)})})}walkSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Q||(e=t,t=this.cwd);let{withFileTypes:o=!0,follow:i=!1,filter:s,walkFilter:n}=e,f=[];(!s||s(t))&&f.push(o?t:t.fullpath());let l=new Set([t]);for(let u of l){let h=u.readdirSync();for(let d of h){(!s||s(d))&&f.push(o?d:d.fullpath());let m=d;if(d.isSymbolicLink()){if(!(i&&(m=d.realpathSync())))continue;m.isUnknown()&&m.lstatSync()}m.shouldWalk(l,n)&&l.add(m)}}return f}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof Q||(e=t,t=this.cwd),this.stream(t,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Q||(e=t,t=this.cwd);let{withFileTypes:o=!0,follow:i=!1,filter:s,walkFilter:n}=e;(!s||s(t))&&(yield o?t:t.fullpath());let f=new Set([t]);for(let l of f){let u=l.readdirSync();for(let h of u){(!s||s(h))&&(yield o?h:h.fullpath());let d=h;if(h.isSymbolicLink()){if(!(i&&(d=h.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(f,n)&&f.add(d)}}}stream(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Q||(e=t,t=this.cwd);let{withFileTypes:o=!0,follow:i=!1,filter:s,walkFilter:n}=e,f=new ee({objectMode:!0});(!s||s(t))&&f.write(o?t:t.fullpath());let l=new Set,u=[t],h=0,d=()=>{let m=!1;for(;!m;){let y=u.shift();if(!y){h===0&&f.end();return}h++,l.add(y);let b=(C,E,T=!1)=>{if(C)return f.emit("error",C);if(i&&!T){let A=[];for(let _ of E)_.isSymbolicLink()&&A.push(_.realpath().then(N=>N!=null&&N.isUnknown()?N.lstat():N));if(A.length){Promise.all(A).then(()=>b(null,E,!0));return}}for(let A of E)A&&(!s||s(A))&&(f.write(o?A:A.fullpath())||(m=!0));h--;for(let A of E){let _=A.realpathCached()||A;_.shouldWalk(l,n)&&u.push(_)}m&&!f.flowing?f.once("drain",d):x||d()},x=!0;y.readdirCB(b,!0),x=!1}};return d(),f}streamSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Q||(e=t,t=this.cwd);let{withFileTypes:o=!0,follow:i=!1,filter:s,walkFilter:n}=e,f=new ee({objectMode:!0}),l=new Set;(!s||s(t))&&f.write(o?t:t.fullpath());let u=[t],h=0,d=()=>{let m=!1;for(;!m;){let y=u.shift();if(!y){h===0&&f.end();return}h++,l.add(y);let b=y.readdirSync();for(let x of b)(!s||s(x))&&(f.write(o?x:x.fullpath())||(m=!0));h--;for(let x of b){let C=x;if(x.isSymbolicLink()){if(!(i&&(C=x.realpathSync())))continue;C.isUnknown()&&C.lstatSync()}C.shouldWalk(l,n)&&u.push(C)}}m&&!f.flowing&&f.once("drain",d)};return d(),f}chdir(t=this.cwd){let e=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[xp](e)}};Je=new WeakMap,Ye=new WeakMap,Jr=new WeakMap,Yr=new WeakMap;var Xe=class extends fi{constructor(e=process.cwd(),o={}){let{nocase:i=!0}=o;super(e,Ze.win32,"\\",{...o,nocase:i});c(this,"sep","\\");this.nocase=i;for(let s=this.cwd;s;s=s.parent)s.nocase=this.nocase}parseRootPath(e){return Ze.win32.parse(e).root.toUpperCase()}newRoot(e){return new ni(this.rootPath,kt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},tr=class extends fi{constructor(e=process.cwd(),o={}){let{nocase:i=!1}=o;super(e,Ze.posix,"/",{...o,nocase:i});c(this,"sep","/");this.nocase=i}parseRootPath(e){return"/"}newRoot(e){return new ai(this.rootPath,kt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},Rr=class extends tr{constructor(t=process.cwd(),e={}){let{nocase:o=!0}=e;super(t,{...e,nocase:o})}},bO=process.platform==="win32"?ni:ai,vp=process.platform==="win32"?Xe:process.platform==="darwin"?Rr:tr;var ly=r=>r.length>=1,uy=r=>r.length>=1,j,it,H,ve,yt,Zr,ie,se,ne,er,Ss=class Ss{constructor(t,e,o,i){w(this,j);w(this,it);w(this,H);c(this,"length");w(this,ve);w(this,yt);w(this,Zr);w(this,ie);w(this,se);w(this,ne);w(this,er,!0);if(!ly(t))throw new TypeError("empty pattern list");if(!uy(e))throw new TypeError("empty glob list");if(e.length!==t.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=t.length,o<0||o>=this.length)throw new TypeError("index out of range");if(g(this,j,t),g(this,it,e),g(this,H,o),g(this,ve,i),a(this,H)===0){if(this.isUNC()){let[s,n,f,l,...u]=a(this,j),[h,d,m,y,...b]=a(this,it);u[0]===""&&(u.shift(),b.shift());let x=[s,n,f,l,""].join("/"),C=[h,d,m,y,""].join("/");g(this,j,[x,...u]),g(this,it,[C,...b]),this.length=a(this,j).length}else if(this.isDrive()||this.isAbsolute()){let[s,...n]=a(this,j),[f,...l]=a(this,it);n[0]===""&&(n.shift(),l.shift());let u=s+"/",h=f+"/";g(this,j,[u,...n]),g(this,it,[h,...l]),this.length=a(this,j).length}}}pattern(){return a(this,j)[a(this,H)]}isString(){return typeof a(this,j)[a(this,H)]=="string"}isGlobstar(){return a(this,j)[a(this,H)]===q}isRegExp(){return a(this,j)[a(this,H)]instanceof RegExp}globString(){return g(this,Zr,a(this,Zr)||(a(this,H)===0?this.isAbsolute()?a(this,it)[0]+a(this,it).slice(1).join("/"):a(this,it).join("/"):a(this,it).slice(a(this,H)).join("/")))}hasMore(){return this.length>a(this,H)+1}rest(){return a(this,yt)!==void 0?a(this,yt):this.hasMore()?(g(this,yt,new Ss(a(this,j),a(this,it),a(this,H)+1,a(this,ve))),g(a(this,yt),ne,a(this,ne)),g(a(this,yt),se,a(this,se)),g(a(this,yt),ie,a(this,ie)),a(this,yt)):g(this,yt,null)}isUNC(){let t=a(this,j);return a(this,se)!==void 0?a(this,se):g(this,se,a(this,ve)==="win32"&&a(this,H)===0&&t[0]===""&&t[1]===""&&typeof t[2]=="string"&&!!t[2]&&typeof t[3]=="string"&&!!t[3])}isDrive(){let t=a(this,j);return a(this,ie)!==void 0?a(this,ie):g(this,ie,a(this,ve)==="win32"&&a(this,H)===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]))}isAbsolute(){let t=a(this,j);return a(this,ne)!==void 0?a(this,ne):g(this,ne,t[0]===""&&t.length>1||this.isDrive()||this.isUNC())}root(){let t=a(this,j)[0];return typeof t=="string"&&this.isAbsolute()&&a(this,H)===0?t:""}checkFollowGlobstar(){return!(a(this,H)===0||!this.isGlobstar()||!a(this,er))}markFollowGlobstar(){return a(this,H)===0||!this.isGlobstar()||!a(this,er)?!1:(g(this,er,!1),!0)}};j=new WeakMap,it=new WeakMap,H=new WeakMap,ve=new WeakMap,yt=new WeakMap,Zr=new WeakMap,ie=new WeakMap,se=new WeakMap,ne=new WeakMap,er=new WeakMap;var rr=Ss;var py=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",or=class{constructor(t,{nobrace:e,nocase:o,noext:i,noglobstar:s,platform:n=py}){c(this,"relative");c(this,"relativeChildren");c(this,"absolute");c(this,"absoluteChildren");c(this,"platform");c(this,"mmopts");this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=n,this.mmopts={dot:!0,nobrace:e,nocase:o,noext:i,noglobstar:s,optimizationLevel:2,platform:n,nocomment:!0,nonegate:!0};for(let f of t)this.add(f)}add(t){let e=new rt(t,this.mmopts);for(let o=0;o<e.set.length;o++){let i=e.set[o],s=e.globParts[o];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let n=new rr(i,s,0,this.platform),f=new rt(n.globString(),this.mmopts),l=s[s.length-1]==="**",u=n.isAbsolute();u?this.absolute.push(f):this.relative.push(f),l&&(u?this.absoluteChildren.push(f):this.relativeChildren.push(f))}}ignored(t){let e=t.fullpath(),o=`${e}/`,i=t.relative()||".",s=`${i}/`;for(let n of this.relative)if(n.match(i)||n.match(s))return!0;for(let n of this.absolute)if(n.match(e)||n.match(o))return!0;return!1}childrenIgnored(t){let e=t.fullpath()+"/",o=(t.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(o))return!0;for(let i of this.absoluteChildren)if(i.match(e))return!0;return!1}};var vs=class r{constructor(t=new Map){c(this,"store");this.store=t}copy(){return new r(new Map(this.store))}hasWalked(t,e){var o;return(o=this.store.get(t.fullpath()))==null?void 0:o.has(e.globString())}storeWalked(t,e){let o=t.fullpath(),i=this.store.get(o);i?i.add(e.globString()):this.store.set(o,new Set([e.globString()]))}},Cs=class{constructor(){c(this,"store",new Map)}add(t,e,o){let i=(e?2:0)|(o?1:0),s=this.store.get(t);this.store.set(t,s===void 0?i:i&s)}entries(){return[...this.store.entries()].map(([t,e])=>[t,!!(e&2),!!(e&1)])}},Es=class{constructor(){c(this,"store",new Map)}add(t,e){if(!t.canReaddir())return;let o=this.store.get(t);o?o.find(i=>i.globString()===e.globString())||o.push(e):this.store.set(t,[e])}get(t){let e=this.store.get(t);if(!e)throw new Error("attempting to walk unknown path");return e}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return[...this.store.keys()].filter(t=>t.canReaddir())}},Xr=class r{constructor(t,e){c(this,"hasWalkedCache");c(this,"matches",new Cs);c(this,"subwalks",new Es);c(this,"patterns");c(this,"follow");c(this,"dot");c(this,"opts");this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=e?e.copy():new vs}processPatterns(t,e){this.patterns=e;let o=e.map(i=>[t,i]);for(let[i,s]of o){this.hasWalkedCache.storeWalked(i,s);let n=s.root(),f=s.isAbsolute()&&this.opts.absolute!==!1;if(n){i=i.resolve(n==="/"&&this.opts.root!==void 0?this.opts.root:n);let d=s.rest();if(d)s=d;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let l,u,h=!1;for(;typeof(l=s.pattern())=="string"&&(u=s.rest());)i=i.resolve(l),s=u,h=!0;if(l=s.pattern(),u=s.rest(),h){if(this.hasWalkedCache.hasWalked(i,s))continue;this.hasWalkedCache.storeWalked(i,s)}if(typeof l=="string"){let d=l===".."||l===""||l===".";this.matches.add(i.resolve(l),f,d);continue}else if(l===q){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let d=u==null?void 0:u.pattern(),m=u==null?void 0:u.rest();if(!u||(d===""||d===".")&&!m)this.matches.add(i,f,d===""||d===".");else if(d===".."){let y=i.parent||i;m?this.hasWalkedCache.hasWalked(y,m)||this.subwalks.add(y,m):this.matches.add(y,f,!0)}}else l instanceof RegExp&&this.subwalks.add(i,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new r(this.opts,this.hasWalkedCache)}filterEntries(t,e){let o=this.subwalks.get(t),i=this.child();for(let s of e)for(let n of o){let f=n.isAbsolute(),l=n.pattern(),u=n.rest();l===q?i.testGlobstar(s,n,u,f):l instanceof RegExp?i.testRegExp(s,l,u,f):i.testString(s,l,u,f)}return i}testGlobstar(t,e,o,i){if((this.dot||!t.name.startsWith("."))&&(e.hasMore()||this.matches.add(t,i,!1),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,e):t.isSymbolicLink()&&(o&&e.checkFollowGlobstar()?this.subwalks.add(t,o):e.markFollowGlobstar()&&this.subwalks.add(t,e)))),o){let s=o.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(t,s,o.rest(),i);else if(s===".."){let n=t.parent||t;this.subwalks.add(n,o)}else s instanceof RegExp&&this.testRegExp(t,s,o.rest(),i)}}testRegExp(t,e,o,i){e.test(t.name)&&(o?this.subwalks.add(t,o):this.matches.add(t,i,!1))}testString(t,e,o,i){t.isNamed(e)&&(o?this.subwalks.add(t,o):this.matches.add(t,i,!1))}};var hy=(r,t)=>typeof r=="string"?new or([r],t):Array.isArray(r)?new or(r,t):r,ir,Wt,Ee,ht,Ce,ks,li=class{constructor(t,e,o){w(this,ht);c(this,"path");c(this,"patterns");c(this,"opts");c(this,"seen",new Set);c(this,"paused",!1);c(this,"aborted",!1);w(this,ir,[]);w(this,Wt);w(this,Ee);c(this,"signal");c(this,"maxDepth");c(this,"includeChildMatches");var i;if(this.patterns=t,this.path=e,this.opts=o,g(this,Ee,!o.posix&&o.platform==="win32"?"\\":"/"),this.includeChildMatches=o.includeChildMatches!==!1,(o.ignore||!this.includeChildMatches)&&(g(this,Wt,hy((i=o.ignore)!=null?i:[],o)),!this.includeChildMatches&&typeof a(this,Wt).add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=o.maxDepth||1/0,o.signal&&(this.signal=o.signal,this.signal.addEventListener("abort",()=>{a(this,ir).length=0}))}pause(){this.paused=!0}resume(){var e;if((e=this.signal)!=null&&e.aborted)return;this.paused=!1;let t;for(;!this.paused&&(t=a(this,ir).shift());)t()}onResume(t){var e;(e=this.signal)!=null&&e.aborted||(this.paused?a(this,ir).push(t):t())}async matchCheck(t,e){if(e&&this.opts.nodir)return;let o;if(this.opts.realpath){if(o=t.realpathCached()||await t.realpath(),!o)return;t=o}let s=t.isUnknown()||this.opts.stat?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&(s!=null&&s.isSymbolicLink())){let n=await s.realpath();n&&(n.isUnknown()||this.opts.stat)&&await n.lstat()}return this.matchCheckTest(s,e)}matchCheckTest(t,e){var o;return t&&(this.maxDepth===1/0||t.depth()<=this.maxDepth)&&(!e||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!((o=t.realpathCached())!=null&&o.isDirectory()))&&!S(this,ht,Ce).call(this,t)?t:void 0}matchCheckSync(t,e){if(e&&this.opts.nodir)return;let o;if(this.opts.realpath){if(o=t.realpathCached()||t.realpathSync(),!o)return;t=o}let s=t.isUnknown()||this.opts.stat?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&(s!=null&&s.isSymbolicLink())){let n=s.realpathSync();n&&(n!=null&&n.isUnknown()||this.opts.stat)&&n.lstatSync()}return this.matchCheckTest(s,e)}matchFinish(t,e){var s;if(S(this,ht,Ce).call(this,t))return;if(!this.includeChildMatches&&((s=a(this,Wt))!=null&&s.add)){let n=`${t.relativePosix()}/**`;a(this,Wt).add(n)}let o=this.opts.absolute===void 0?e:this.opts.absolute;this.seen.add(t);let i=this.opts.mark&&t.isDirectory()?a(this,Ee):"";if(this.opts.withFileTypes)this.matchEmit(t);else if(o){let n=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(n+i)}else{let n=this.opts.posix?t.relativePosix():t.relative(),f=this.opts.dotRelative&&!n.startsWith(".."+a(this,Ee))?"."+a(this,Ee):"";this.matchEmit(n?f+n+i:"."+i)}}async match(t,e,o){let i=await this.matchCheck(t,o);i&&this.matchFinish(i,e)}matchSync(t,e,o){let i=this.matchCheckSync(t,o);i&&this.matchFinish(i,e)}walkCB(t,e,o){var i;(i=this.signal)!=null&&i.aborted&&o(),this.walkCB2(t,e,new Xr(this.opts),o)}walkCB2(t,e,o,i){var f;if(S(this,ht,ks).call(this,t))return i();if((f=this.signal)!=null&&f.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(t,e,o,i));return}o.processPatterns(t,e);let s=1,n=()=>{--s===0&&i()};for(let[l,u,h]of o.matches.entries())S(this,ht,Ce).call(this,l)||(s++,this.match(l,u,h).then(()=>n()));for(let l of o.subwalkTargets()){if(this.maxDepth!==1/0&&l.depth()>=this.maxDepth)continue;s++;let u=l.readdirCached();l.calledReaddir()?this.walkCB3(l,u,o,n):l.readdirCB((h,d)=>this.walkCB3(l,d,o,n),!0)}n()}walkCB3(t,e,o,i){o=o.filterEntries(t,e);let s=1,n=()=>{--s===0&&i()};for(let[f,l,u]of o.matches.entries())S(this,ht,Ce).call(this,f)||(s++,this.match(f,l,u).then(()=>n()));for(let[f,l]of o.subwalks.entries())s++,this.walkCB2(f,l,o.child(),n);n()}walkCBSync(t,e,o){var i;(i=this.signal)!=null&&i.aborted&&o(),this.walkCB2Sync(t,e,new Xr(this.opts),o)}walkCB2Sync(t,e,o,i){var f;if(S(this,ht,ks).call(this,t))return i();if((f=this.signal)!=null&&f.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(t,e,o,i));return}o.processPatterns(t,e);let s=1,n=()=>{--s===0&&i()};for(let[l,u,h]of o.matches.entries())S(this,ht,Ce).call(this,l)||this.matchSync(l,u,h);for(let l of o.subwalkTargets()){if(this.maxDepth!==1/0&&l.depth()>=this.maxDepth)continue;s++;let u=l.readdirSync();this.walkCB3Sync(l,u,o,n)}n()}walkCB3Sync(t,e,o,i){o=o.filterEntries(t,e);let s=1,n=()=>{--s===0&&i()};for(let[f,l,u]of o.matches.entries())S(this,ht,Ce).call(this,f)||this.matchSync(f,l,u);for(let[f,l]of o.subwalks.entries())s++,this.walkCB2Sync(f,l,o.child(),n);n()}};ir=new WeakMap,Wt=new WeakMap,Ee=new WeakMap,ht=new WeakSet,Ce=function(t){var e,o;return this.seen.has(t)||!!((o=(e=a(this,Wt))==null?void 0:e.ignored)!=null&&o.call(e,t))},ks=function(t){var e,o;return!!((o=(e=a(this,Wt))==null?void 0:e.childrenIgnored)!=null&&o.call(e,t))};var to=class extends li{constructor(e,o,i){super(e,o,i);c(this,"matches",new Set)}matchEmit(e){this.matches.add(e)}async walk(){var e;if((e=this.signal)!=null&&e.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((o,i)=>{this.walkCB(this.path,this.patterns,()=>{var s;(s=this.signal)!=null&&s.aborted?i(this.signal.reason):o(this.matches)})}),this.matches}walkSync(){var e;if((e=this.signal)!=null&&e.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{var o;if((o=this.signal)!=null&&o.aborted)throw this.signal.reason}),this.matches}},eo=class extends li{constructor(e,o,i){super(e,o,i);c(this,"results");this.results=new ee({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var cy=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",wt=class{constructor(t,e){c(this,"absolute");c(this,"cwd");c(this,"root");c(this,"dot");c(this,"dotRelative");c(this,"follow");c(this,"ignore");c(this,"magicalBraces");c(this,"mark");c(this,"matchBase");c(this,"maxDepth");c(this,"nobrace");c(this,"nocase");c(this,"nodir");c(this,"noext");c(this,"noglobstar");c(this,"pattern");c(this,"platform");c(this,"realpath");c(this,"scurry");c(this,"stat");c(this,"signal");c(this,"windowsPathsNoEscape");c(this,"withFileTypes");c(this,"includeChildMatches");c(this,"opts");c(this,"patterns");if(!e)throw new TypeError("glob options required");if(this.withFileTypes=!!e.withFileTypes,this.signal=e.signal,this.follow=!!e.follow,this.dot=!!e.dot,this.dotRelative=!!e.dotRelative,this.nodir=!!e.nodir,this.mark=!!e.mark,e.cwd?(e.cwd instanceof URL||e.cwd.startsWith("file://"))&&(e.cwd=(0,Cp.fileURLToPath)(e.cwd)):this.cwd="",this.cwd=e.cwd||"",this.root=e.root,this.magicalBraces=!!e.magicalBraces,this.nobrace=!!e.nobrace,this.noext=!!e.noext,this.realpath=!!e.realpath,this.absolute=e.absolute,this.includeChildMatches=e.includeChildMatches!==!1,this.noglobstar=!!e.noglobstar,this.matchBase=!!e.matchBase,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:1/0,this.stat=!!e.stat,this.ignore=e.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof t=="string"&&(t=[t]),this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(t=t.map(l=>l.replace(/\\/g,"/"))),this.matchBase){if(e.noglobstar)throw new TypeError("base matching requires globstar");t=t.map(l=>l.includes("/")?l:`./**/${l}`)}if(this.pattern=t,this.platform=e.platform||cy,this.opts={...e,platform:this.platform},e.scurry){if(this.scurry=e.scurry,e.nocase!==void 0&&e.nocase!==e.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let l=e.platform==="win32"?Xe:e.platform==="darwin"?Rr:e.platform?tr:vp;this.scurry=new l(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;let o=this.platform==="darwin"||this.platform==="win32",i={...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:o,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(l=>new rt(l,i)),[n,f]=s.reduce((l,u)=>(l[0].push(...u.set),l[1].push(...u.globParts),l),[[],[]]);this.patterns=n.map((l,u)=>{let h=f[u];if(!h)throw new Error("invalid pattern object");return new rr(l,h,0,this.platform)})}async walk(){return[...await new to(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new to(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new eo(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new eo(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var Os=(r,t={})=>{Array.isArray(r)||(r=[r]);for(let e of r)if(new rt(e,t).hasMagic())return!0;return!1};function ui(r,t={}){return new wt(r,t).streamSync()}function Op(r,t={}){return new wt(r,t).stream()}function Tp(r,t={}){return new wt(r,t).walkSync()}async function Ep(r,t={}){return new wt(r,t).walk()}function pi(r,t={}){return new wt(r,t).iterateSync()}function Ap(r,t={}){return new wt(r,t).iterate()}var my=ui,dy=Object.assign(Op,{sync:ui}),gy=pi,xy=Object.assign(Ap,{sync:pi}),ro=Object.assign(Tp,{stream:ui,iterate:pi}),kp=Object.assign(Ep,{glob:Ep,globSync:Tp,sync:ro,globStream:Op,stream:dy,globStreamSync:ui,streamSync:my,globIterate:Ap,iterate:xy,globIterateSync:pi,iterateSync:gy,Glob:wt,hasMagic:Os,escape:qe,unescape:dt});kp.glob=kp;nt();var yy=O.withTag("listChromeProfiles");function Pp(){let r=ro("./**/Cookies",{cwd:Ge,absolute:!0});return yy.debug("Found cookie files:",r),r}var hi=require("crypto");Jt();var wy=ft(r=>r.length>=3&&r[0]===118&&r[1]===49&&r[2]===48?r.slice(3):r,r=>r.toString("hex")),by=ft(r=>{let t=r[r.length-1];return t&&t<=16?r.slice(0,-t):r},r=>r.toString("hex"));function Sy(r){var e;let t=[/.*?0t(.+)$/,/.*?1e`(.+)$/,/.*?[`'](.+)$/,/[^\x20-\x7E]*([\x20-\x7E].+)$/];for(let o of t){let i=r.match(o),s=(e=i==null?void 0:i[1])!=null?e:"";if(s.length>0)return s}return r}async function _p(r,t){if(typeof t!="string")throw new Error("password must be a string");if(!Buffer.isBuffer(r))throw new Error("encryptedData must be a Buffer");return new Promise((e,o)=>{(0,hi.pbkdf2)(t,"saltysalt",1003,16,"sha1",(i,s)=>{try{if(i){o(new Error("Failed to derive key: "+i.message));return}let n=wy(r);if(n.length%16!==0){o(new Error("Encrypted data length is not a multiple of 16"));return}let f=Buffer.alloc(16," "),l=(0,hi.createDecipheriv)("aes-128-cbc",s,f);l.setAutoPadding(!1);let u=l.update(n);try{l.final()}catch(d){o(new Error("Failed to finalize decryption: "+d.message));return}u=by(u);let h=u.toString("utf8");e(Sy(h))}catch(n){o(new Error("Decryption failed: "+n.message))}})})}Jt();Pt();var Np=ft(async()=>{if(process.platform!=="darwin")throw I("Chrome password retrieval failed",new Error("This only works on macOS"),{platform:process.platform}),new Error("This only works on macOS");try{let{getChromePassword:r}=await Promise.resolve().then(()=>(Fp(),Lp)),t=await r();return bt("ChromePassword","Retrieved password successfully",{platform:"macOS"}),t}catch(r){throw I("Chrome password retrieval failed",r,{platform:"macOS"}),r}});function Oy(r){return typeof r!="number"||r<=0?"Infinity":new Date(r)}function Bp(r,t,e,o,i,s){return{domain:r,name:t,value:e,expiry:Oy(o),meta:{file:i,browser:"Chrome",decrypted:s}}}var ci=class{constructor(){this.logger=so("ChromeCookieQueryStrategy");this.browserName="Chrome"}async queryCookies(t,e){try{if(this.logger.info("Querying cookies",{name:t,domain:e}),process.platform!=="darwin")return this.logger.warn("Platform not supported",{platform:process.platform}),[];let o=Pp();if(o.length===0)return this.logger.warn("No Chrome cookie files found"),[];let i=await Np();return(await Promise.all(o.map(n=>this.processFile(n,t,e,i)))).flat()}catch(o){return o instanceof Error?I("Failed to query cookies",o,{name:t,domain:e}):I("Failed to query cookies",new Error(String(o)),{name:t,domain:e}),[]}}async processFile(t,e,o,i){try{let s=await au({name:e,domain:o,file:t}),n={file:t,password:i};return(await Promise.allSettled(s.map(l=>this.processCookie(l,n)))).map(l=>l.status==="fulfilled"?l.value:null).filter(l=>l!==null)}catch(s){return s instanceof Error?this.logger.error("Failed to process cookie file",{error:s,file:t}):this.logger.error("Failed to process cookie file",{error:String(s),file:t}),[]}}async processCookie(t,e){try{let o=Buffer.isBuffer(t.value)?t.value:Buffer.from(String(t.value)),i=await _p(o,e.password);return Bp(t.domain,t.name,i,t.expiry,e.file,!0)}catch(o){return o instanceof Error?this.logger.warn("Failed to decrypt cookie",{error:o}):this.logger.warn("Failed to decrypt cookie",{error:String(o)}),Bp(t.domain,t.name,t.value.toString("utf-8"),t.expiry,e.file,!1)}}};async function jp(r,t,e=[]){return r.length===0?e:(await Promise.all(r.map(async i=>{try{return await t(i)}catch(s){return e}}))).flat()}Pt();var mi=class{constructor(t){this.strategies=t;this.logger=so("CompositeCookieQueryStrategy");this.browserName="internal"}handleStrategyError(t,e){t instanceof Error?this.logger.error("Strategy failed",{error:t,strategy:e}):this.logger.error("Strategy failed with unknown error",{error:String(t),strategy:e})}async queryCookies(t,e){try{return this.logger.info("Querying cookies from all strategies",{name:t,domain:e,strategyCount:this.strategies.length}),await jp(this.strategies,async o=>{try{return await o.queryCookies(t,e)}catch(i){return this.handleStrategyError(i,o),[]}},[])}catch(o){return o instanceof Error?this.logger.error("Failed to query cookies",{error:o}):this.logger.error("Failed to query cookies with unknown error",{error:String(o)}),[]}}};var Ts=require("path");Pt();function Ty(){let r=[],t=process.env.HOME;if(typeof t!="string"||t.length===0)return no("FirefoxCookieQuery","HOME environment variable not set"),r;let e=[(0,Ts.join)(t,"Library/Application Support/Firefox/Profiles/*/cookies.sqlite"),(0,Ts.join)(t,".mozilla/firefox/*/cookies.sqlite")];for(let o of e){let i=ro(o);r.push(...i)}return bt("FirefoxCookieQuery","Found Firefox cookie files",{files:r}),r}var di=class{constructor(){this.browserName="Firefox"}async queryCookies(t,e){let o=Ty(),i=[];for(let s of o)try{let n=await $o({file:s,sql:"SELECT name, value, host as domain, expiry FROM moz_cookies WHERE name = ? AND host LIKE ?",params:[t,`%${e}%`],rowTransform:f=>({name:f.name,value:f.value,domain:f.domain,expiry:f.expiry>0?new Date(f.expiry*1e3):"Infinity",meta:{file:s,browser:"Firefox",decrypted:!1}})});i.push(...n)}catch(n){n instanceof Error?no("FirefoxCookieQuery",`Error reading Firefox cookie file ${s}`,{error:n.message}):no("FirefoxCookieQuery",`Error reading Firefox cookie file ${s}`)}return i}};var $p=require("path");Pt();var Wp=require("fs");var Ay=1706047360;function gi(r,t){let e=t;for(;e<r.length&&r[e]!==0;)e++;return[r.toString("utf8",t,e),e+1]}function Py(r,t){let e=r.readUInt32LE(t),o=t+43,s=r.readUInt32LE(o)-Ay,n=t+56,[f,l]=gi(r,n);n=l;let[u,h]=gi(r,n);n=h;let[d,m]=gi(r,n);n=m;let[y,b]=gi(r,n);return[{name:u,value:y,domain:f.startsWith(".")?f.slice(1):f,path:d||"/",expiry:s,creation:s},e]}function _y(r,t,e){let o=t+5,i=r.readUInt32BE(o),s=t+i,n=[],f=t+e;for(;s<f-8;)try{let[l,u]=Py(r,s);n.push(l),s+=u}catch(l){console.warn(`Error decoding cookie at offset ${s}:`,l);break}return n}function Up(r){let t=(0,Wp.readFileSync)(r),e=t.readUInt32BE(4),o=[];for(let n=0;n<e;n++)o.push(t.readUInt32BE(8+n*4));let i=8+e*4,s=[];for(let n=0;n<e;n++)try{let f=_y(t,i,o[n]);s.push(...f),i+=o[n]}catch(f){console.warn(`Error decoding page ${n}:`,f),i+=o[n]}return s}var xi=class{constructor(){this.browserName="Safari"}getHomeDir(){let t=process.env.HOME;return typeof t!="string"||t.trim().length===0?(I("SafariCookieQueryStrategy","HOME environment variable not set"),""):t}getCookieDbPath(t){return(0,$p.join)(t,"Library","Containers","com.apple.Safari","Data","Library","Cookies","Cookies.binarycookies")}decodeCookies(t,e,o){try{return Up(t).filter(s=>s.name===e&&s.domain.includes(o)).map(s=>({domain:s.domain,name:s.name,value:s.value.toString(),expiry:typeof s.expiry=="number"&&s.expiry>0?new Date(s.expiry*1e3):"Infinity",meta:{file:t,browser:"Safari",decrypted:!1}}))}catch(i){return i instanceof Error?I("SafariCookieQueryStrategy",`Error decoding ${t}`,{error:i,name:e,domain:o}):I("SafariCookieQueryStrategy",`Error decoding ${t}`,{error:"Unknown error",name:e,domain:o}),[]}}async queryCookies(t,e){let o=this.getHomeDir();if(typeof o!="string"||o.length===0)return Promise.resolve([]);let i=this.getCookieDbPath(o);return Promise.resolve(this.decodeCookies(i,t,e))}};function Ry(r){return r.expiry===void 0?r:typeof r.expiry=="number"?{...r,expiry:new Date(r.expiry*1e3)}:r}async function Gp(r,t={}){var n;let e=(n=t.strategy)!=null?n:new mi([new ci,new di,new xi]),o=async f=>(await e.queryCookies(f.name,f.domain)).map(Ry),i=Array.isArray(r)?await Promise.all(r.map(o)):await o(r),s=Array.isArray(i)?i.flat():i;if(t.removeExpired===!0){let f=Date.now();s=s.filter(l=>l.expiry==="Infinity"||l.expiry instanceof Date&&l.expiry.getTime()>f)}return typeof t.limit=="number"&&t.limit>0&&(s=s.slice(0,t.limit)),s}nt();nt();var oo=class{canHandle(t){return!0}handle(t){let e=new Set(t.map(o=>o.value));for(let o of e)O.log(o)}};nt();var yi=class{canHandle(t){return t.dump===!0||t.d===!0}handle(t){O.log(t)}};Jt();nt();var wi=class{canHandle(t){return t["dump-grouped"]===!0||t.D===!0}handle(t){let e=gr(t,o=>{var i,s;return(s=(i=o.meta)==null?void 0:i.file)!=null?s:"unknown"});O.log(JSON.stringify(e,null,2))}};Jt();function bi(r,t={}){let{format:e="merged",showFilePaths:o=!0,separator:i="; "}=t;if(r.length===0)return e==="merged"?"":[];if(e==="merged")return r.map(n=>n.value).join(i);let s=gr(r,n=>{var f,l;return(l=(f=n.meta)==null?void 0:f.file)!=null?l:"unknown"});return Object.entries(s).map(([n,f])=>{let l=f.map(u=>u.value).join(i);return o?`${n}: ${l}`:l})}nt();var Si=class{canHandle(t){return t["render-grouped"]===!0||t.R===!0}handle(t){O.log(bi(t,{format:"grouped"}))}};nt();var vi=class{canHandle(t){return t.output==="json"}handle(t){O.log(JSON.stringify(t,null,2))}};nt();var Ci=class{canHandle(t){return t.render===!0||t["render-merged"]===!0||t.r===!0}handle(t){O.log(bi(t,{format:"merged"}))}};var Ei=class{constructor(){this.handlers=[new yi,new wi,new Ci,new Si,new vi,new oo]}getHandler(t){var e;return(e=this.handlers.find(o=>o.canHandle(t)))!=null?e:new oo}};async function Hp(r,t,e,o,i,s){try{let n=await Gp(r,{limit:i,removeExpired:s});if(n.length===0){O.error("No results");return}new Ei().getHandler(o).handle(n)}catch(n){n instanceof Error?O.error(n.message):O.error("An unknown error occurred")}}function Dy(){O.log("Usage: get-cookie [name] [domain] [options]"),O.log("Options:"),O.log(" -h, --help: Show this help message"),O.log(" -v, --verbose: Enable verbose output"),O.log(" -d, --dump: Dump all results"),O.log(" -D, --dump-grouped: Dump all results, grouped by profile"),O.log(" -r, --render: Render all results"),O.log(" -u, --url: URL to extract cookie specs from"),O.log(" -n, --name: Cookie name pattern"),O.log(" -d, --domain: Cookie domain pattern"),O.log(" --output: Output format (e.g., json)")}function My(r,t){return{name:r||"%",domain:t||"%"}}function Iy(r,t){let e=r.url;if(typeof e=="string"){let s=Oi(e);return Array.isArray(s)?s:(O.error("Invalid cookie specs from URL"),[])}let o=r.name||t[0]||"%",i=r.domain||t[1]||"%";return[My(o,i)]}async function Ly(r,t){let e=Iy(r,t);r.verbose===!0&&O.log("cookieSpecs",e);try{await Hp(e,["chrome","firefox","safari"],["default"],{...r})}catch(o){o instanceof Error?O.error("Error querying cookies:",o.message):O.error("An unknown error occurred while querying cookies")}}async function Fy(){let r=process.argv.slice(2),{values:t,positionals:e}=Ms(r);if(t.help===!0){Dy();return}await Ly(t,e)}Fy().catch(r=>{r instanceof Error?O.error("Fatal error:",r.message):O.error("An unknown fatal error occurred"),process.exit(1)});
|
|
2
|
+
"use strict";var op=Object.create;var Zi=Object.defineProperty;var np=Object.getOwnPropertyDescriptor;var ap=Object.getOwnPropertyNames;var fp=Object.getPrototypeOf,lp=Object.prototype.hasOwnProperty;var Fn=r=>{throw TypeError(r)};var hp=(r,t,e)=>t in r?Zi(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var u=(r,t)=>()=>(r&&(t=r(r=0)),t);var Dn=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),up=(r,t)=>{for(var e in t)Zi(r,e,{get:t[e],enumerable:!0})},cp=(r,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of ap(t))!lp.call(r,s)&&s!==e&&Zi(r,s,{get:()=>t[s],enumerable:!(i=np(t,s))||i.enumerable});return r};var ze=(r,t,e)=>(e=r!=null?op(fp(r)):{},cp(t||!r||!r.__esModule?Zi(e,"default",{value:r,enumerable:!0}):e,r));var d=(r,t,e)=>hp(r,typeof t!="symbol"?t+"":t,e),vo=(r,t,e)=>t.has(r)||Fn("Cannot "+e);var n=(r,t,e)=>(vo(r,t,"read from private field"),e?e.call(r):t.get(r)),b=(r,t,e)=>t.has(r)?Fn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,e),c=(r,t,e,i)=>(vo(r,t,"write to private field"),i?i.call(r,e):t.set(r,e),e),y=(r,t,e)=>(vo(r,t,"access private method"),e);var Yi=(r,t,e,i)=>({set _(s){c(r,t,s,e)},get _(){return n(r,t,i)}});var In,dp,R,vt=u(()=>{"use strict";In=require("consola"),dp=(0,In.createConsola)({fancy:!0,formatOptions:{showLogLevel:!1,colors:!0,date:!1,compact:!0,columns:typeof process.stdout.columns=="number"?process.stdout.columns:80},level:typeof process.env.LOG_LEVEL=="string"&&process.env.LOG_LEVEL==="debug"?5:2}),R=dp});function Nn(r,t,e){let s=`${t?"\u2705":"\u274C"} ${r} ${t?"succeeded":"failed"}`;t?R.success(s,e):R.error(s,e)}function z(r,t,e){let i={...e!=null?e:{},error:t instanceof Error?{name:t.name,message:t.message,stack:t.stack}:t};R.error(r,i)}function qt(r,t,e){R.withTag(r).debug(t,e)}function Ji(r){return R.withTag(r)}function Xi(r,t,e){R.withTag(r).warn(t,e)}var ee=u(()=>{"use strict";vt();vt()});var mp,ts,Eo=u(()=>{"use strict";mp=typeof global=="object"&&global&&global.Object===Object&&global,ts=mp});var gp,yp,U,Pt=u(()=>{"use strict";Eo();gp=typeof self=="object"&&self&&self.Object===Object&&self,yp=ts||gp||Function("return this")(),U=yp});var xp,Ct,qr=u(()=>{"use strict";Pt();xp=U.Symbol,Ct=xp});function Sp(r){var t=wp.call(r,Kr),e=r[Kr];try{r[Kr]=void 0;var i=!0}catch(o){}var s=bp.call(r);return i&&(t?r[Kr]=e:delete r[Kr]),s}var Bn,wp,bp,Kr,jn,Wn=u(()=>{"use strict";qr();Bn=Object.prototype,wp=Bn.hasOwnProperty,bp=Bn.toString,Kr=Ct?Ct.toStringTag:void 0;jn=Sp});function Ep(r){return Cp.call(r)}var vp,Cp,zn,Un=u(()=>{"use strict";vp=Object.prototype,Cp=vp.toString;zn=Ep});function kp(r){return r==null?r===void 0?Ap:Op:Gn&&Gn in Object(r)?jn(r):zn(r)}var Op,Ap,Gn,dt,Ue=u(()=>{"use strict";qr();Wn();Un();Op="[object Null]",Ap="[object Undefined]",Gn=Ct?Ct.toStringTag:void 0;dt=kp});function Tp(r){return r!=null&&typeof r=="object"}var nt,de=u(()=>{"use strict";nt=Tp});function Rp(r){return typeof r=="symbol"||nt(r)&&dt(r)==_p}var _p,ar,es=u(()=>{"use strict";Ue();de();_p="[object Symbol]";ar=Rp});function Pp(r,t){for(var e=-1,i=r==null?0:r.length,s=Array(i);++e<i;)s[e]=t(r[e],e,r);return s}var $n,Hn=u(()=>{"use strict";$n=Pp});var Fp,B,Ft=u(()=>{"use strict";Fp=Array.isArray,B=Fp});function Qn(r){if(typeof r=="string")return r;if(B(r))return $n(r,Qn)+"";if(ar(r))return Kn?Kn.call(r):"";var t=r+"";return t=="0"&&1/r==-Dp?"-0":t}var Dp,qn,Kn,Vn,Zn=u(()=>{"use strict";qr();Hn();Ft();es();Dp=1/0,qn=Ct?Ct.prototype:void 0,Kn=qn?qn.toString:void 0;Vn=Qn});function Lp(r){var t=typeof r;return r!=null&&(t=="object"||t=="function")}var rt,re=u(()=>{"use strict";rt=Lp});function Mp(r){return r}var fr,rs=u(()=>{"use strict";fr=Mp});function Wp(r){if(!rt(r))return!1;var t=dt(r);return t==Np||t==Bp||t==Ip||t==jp}var Ip,Np,Bp,jp,lr,is=u(()=>{"use strict";Ue();re();Ip="[object AsyncFunction]",Np="[object Function]",Bp="[object GeneratorFunction]",jp="[object Proxy]";lr=Wp});var zp,ss,Yn=u(()=>{"use strict";Pt();zp=U["__core-js_shared__"],ss=zp});function Up(r){return!!Jn&&Jn in r}var Jn,Xn,ta=u(()=>{"use strict";Yn();Jn=function(){var r=/[^.]+$/.exec(ss&&ss.keys&&ss.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();Xn=Up});function Hp(r){if(r!=null){try{return $p.call(r)}catch(t){}try{return r+""}catch(t){}}return""}var Gp,$p,ie,Oo=u(()=>{"use strict";Gp=Function.prototype,$p=Gp.toString;ie=Hp});function Xp(r){if(!rt(r)||Xn(r))return!1;var t=lr(r)?Jp:Kp;return t.test(ie(r))}var qp,Kp,Qp,Vp,Zp,Yp,Jp,ea,ra=u(()=>{"use strict";is();ta();re();Oo();qp=/[\\^$.*+?()[\]{}|]/g,Kp=/^\[object .+?Constructor\]$/,Qp=Function.prototype,Vp=Object.prototype,Zp=Qp.toString,Yp=Vp.hasOwnProperty,Jp=RegExp("^"+Zp.call(Yp).replace(qp,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");ea=Xp});function td(r,t){return r==null?void 0:r[t]}var ia,sa=u(()=>{"use strict";ia=td});function ed(r,t){var e=ia(r,t);return ea(e)?e:void 0}var pt,me=u(()=>{"use strict";ra();sa();pt=ed});var rd,os,oa=u(()=>{"use strict";me();Pt();rd=pt(U,"WeakMap"),os=rd});var na,id,aa,fa=u(()=>{"use strict";re();na=Object.create,id=function(){function r(){}return function(t){if(!rt(t))return{};if(na)return na(t);r.prototype=t;var e=new r;return r.prototype=void 0,e}}(),aa=id});function sd(r,t,e){switch(e.length){case 0:return r.call(t);case 1:return r.call(t,e[0]);case 2:return r.call(t,e[0],e[1]);case 3:return r.call(t,e[0],e[1],e[2])}return r.apply(t,e)}var la,ha=u(()=>{"use strict";la=sd});function od(r,t){var e=-1,i=r.length;for(t||(t=Array(i));++e<i;)t[e]=r[e];return t}var ua,ca=u(()=>{"use strict";ua=od});function ld(r){var t=0,e=0;return function(){var i=fd(),s=ad-(i-e);if(e=i,s>0){if(++t>=nd)return arguments[0]}else t=0;return r.apply(void 0,arguments)}}var nd,ad,fd,pa,da=u(()=>{"use strict";nd=800,ad=16,fd=Date.now;pa=ld});function hd(r){return function(){return r}}var ma,ga=u(()=>{"use strict";ma=hd});var ud,hr,Ao=u(()=>{"use strict";me();ud=function(){try{var r=pt(Object,"defineProperty");return r({},"",{}),r}catch(t){}}(),hr=ud});var cd,ya,xa=u(()=>{"use strict";ga();Ao();rs();cd=hr?function(r,t){return hr(r,"toString",{configurable:!0,enumerable:!1,value:ma(t),writable:!0})}:fr,ya=cd});var pd,wa,ba=u(()=>{"use strict";xa();da();pd=pa(ya),wa=pd});function gd(r,t){var e=typeof r;return t=t==null?dd:t,!!t&&(e=="number"||e!="symbol"&&md.test(r))&&r>-1&&r%1==0&&r<t}var dd,md,ur,ns=u(()=>{"use strict";dd=9007199254740991,md=/^(?:0|[1-9]\d*)$/;ur=gd});function yd(r,t,e){t=="__proto__"&&hr?hr(r,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):r[t]=e}var ge,Qr=u(()=>{"use strict";Ao();ge=yd});function xd(r,t){return r===t||r!==r&&t!==t}var Kt,cr=u(()=>{"use strict";Kt=xd});function Sd(r,t,e){var i=r[t];(!(bd.call(r,t)&&Kt(i,e))||e===void 0&&!(t in r))&&ge(r,t,e)}var wd,bd,Sa,va=u(()=>{"use strict";Qr();cr();wd=Object.prototype,bd=wd.hasOwnProperty;Sa=Sd});function vd(r,t,e,i){var s=!e;e||(e={});for(var o=-1,a=t.length;++o<a;){var l=t[o],f=i?i(e[l],r[l],l,e,r):void 0;f===void 0&&(f=r[l]),s?ge(e,l,f):Sa(e,l,f)}return e}var Ca,Ea=u(()=>{"use strict";va();Qr();Ca=vd});function Cd(r,t,e){return t=Oa(t===void 0?r.length-1:t,0),function(){for(var i=arguments,s=-1,o=Oa(i.length-t,0),a=Array(o);++s<o;)a[s]=i[t+s];s=-1;for(var l=Array(t+1);++s<t;)l[s]=i[s];return l[t]=e(a),la(r,this,l)}}var Oa,Aa,ka=u(()=>{"use strict";ha();Oa=Math.max;Aa=Cd});function Ed(r,t){return wa(Aa(r,t,fr),r+"")}var Ta,_a=u(()=>{"use strict";rs();ka();ba();Ta=Ed});function Ad(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Od}var Od,pr,as=u(()=>{"use strict";Od=9007199254740991;pr=Ad});function kd(r){return r!=null&&pr(r.length)&&!lr(r)}var Qt,dr=u(()=>{"use strict";is();as();Qt=kd});function Td(r,t,e){if(!rt(e))return!1;var i=typeof t;return(i=="number"?Qt(e)&&ur(t,e.length):i=="string"&&t in e)?Kt(e[t],r):!1}var Ra,Pa=u(()=>{"use strict";cr();dr();ns();re();Ra=Td});function _d(r){return Ta(function(t,e){var i=-1,s=e.length,o=s>1?e[s-1]:void 0,a=s>2?e[2]:void 0;for(o=r.length>3&&typeof o=="function"?(s--,o):void 0,a&&Ra(e[0],e[1],a)&&(o=s<3?void 0:o,s=1),t=Object(t);++i<s;){var l=e[i];l&&r(t,l,i,o)}return t})}var Fa,Da=u(()=>{"use strict";_a();Pa();Fa=_d});function Pd(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||Rd;return r===e}var Rd,mr,fs=u(()=>{"use strict";Rd=Object.prototype;mr=Pd});function Fd(r,t){for(var e=-1,i=Array(r);++e<r;)i[e]=t(e);return i}var La,Ma=u(()=>{"use strict";La=Fd});function Ld(r){return nt(r)&&dt(r)==Dd}var Dd,ko,Ia=u(()=>{"use strict";Ue();de();Dd="[object Arguments]";ko=Ld});var Na,Md,Id,Nd,Ge,ls=u(()=>{"use strict";Ia();de();Na=Object.prototype,Md=Na.hasOwnProperty,Id=Na.propertyIsEnumerable,Nd=ko(function(){return arguments}())?ko:function(r){return nt(r)&&Md.call(r,"callee")&&!Id.call(r,"callee")},Ge=Nd});function Bd(){return!1}var Ba,ja=u(()=>{"use strict";Ba=Bd});var Ua,Wa,jd,za,Wd,zd,$e,hs=u(()=>{"use strict";Pt();ja();Ua=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Wa=Ua&&typeof module=="object"&&module&&!module.nodeType&&module,jd=Wa&&Wa.exports===Ua,za=jd?U.Buffer:void 0,Wd=za?za.isBuffer:void 0,zd=Wd||Ba,$e=zd});function cm(r){return nt(r)&&pr(r.length)&&!!L[dt(r)]}var Ud,Gd,$d,Hd,qd,Kd,Qd,Vd,Zd,Yd,Jd,Xd,tm,em,rm,im,sm,om,nm,am,fm,lm,hm,um,L,Ga,$a=u(()=>{"use strict";Ue();as();de();Ud="[object Arguments]",Gd="[object Array]",$d="[object Boolean]",Hd="[object Date]",qd="[object Error]",Kd="[object Function]",Qd="[object Map]",Vd="[object Number]",Zd="[object Object]",Yd="[object RegExp]",Jd="[object Set]",Xd="[object String]",tm="[object WeakMap]",em="[object ArrayBuffer]",rm="[object DataView]",im="[object Float32Array]",sm="[object Float64Array]",om="[object Int8Array]",nm="[object Int16Array]",am="[object Int32Array]",fm="[object Uint8Array]",lm="[object Uint8ClampedArray]",hm="[object Uint16Array]",um="[object Uint32Array]",L={};L[im]=L[sm]=L[om]=L[nm]=L[am]=L[fm]=L[lm]=L[hm]=L[um]=!0;L[Ud]=L[Gd]=L[em]=L[$d]=L[rm]=L[Hd]=L[qd]=L[Kd]=L[Qd]=L[Vd]=L[Zd]=L[Yd]=L[Jd]=L[Xd]=L[tm]=!1;Ga=cm});function pm(r){return function(t){return r(t)}}var Ha,qa=u(()=>{"use strict";Ha=pm});var Ka,Vr,dm,To,mm,_o,Qa=u(()=>{"use strict";Eo();Ka=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Vr=Ka&&typeof module=="object"&&module&&!module.nodeType&&module,dm=Vr&&Vr.exports===Ka,To=dm&&ts.process,mm=function(){try{var r=Vr&&Vr.require&&Vr.require("util").types;return r||To&&To.binding&&To.binding("util")}catch(t){}}(),_o=mm});var Va,gm,gr,us=u(()=>{"use strict";$a();qa();Qa();Va=_o&&_o.isTypedArray,gm=Va?Ha(Va):Ga,gr=gm});function wm(r,t){var e=B(r),i=!e&&Ge(r),s=!e&&!i&&$e(r),o=!e&&!i&&!s&&gr(r),a=e||i||s||o,l=a?La(r.length,String):[],f=l.length;for(var h in r)(t||xm.call(r,h))&&!(a&&(h=="length"||s&&(h=="offset"||h=="parent")||o&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||ur(h,f)))&&l.push(h);return l}var ym,xm,cs,Ro=u(()=>{"use strict";Ma();ls();Ft();hs();ns();us();ym=Object.prototype,xm=ym.hasOwnProperty;cs=wm});function bm(r,t){return function(e){return r(t(e))}}var ps,Po=u(()=>{"use strict";ps=bm});var Sm,Za,Ya=u(()=>{"use strict";Po();Sm=ps(Object.keys,Object),Za=Sm});function Em(r){if(!mr(r))return Za(r);var t=[];for(var e in Object(r))Cm.call(r,e)&&e!="constructor"&&t.push(e);return t}var vm,Cm,Ja,Xa=u(()=>{"use strict";fs();Ya();vm=Object.prototype,Cm=vm.hasOwnProperty;Ja=Em});function Om(r){return Qt(r)?cs(r):Ja(r)}var yr,ds=u(()=>{"use strict";Ro();Xa();dr();yr=Om});function Am(r){var t=[];if(r!=null)for(var e in Object(r))t.push(e);return t}var tf,ef=u(()=>{"use strict";tf=Am});function _m(r){if(!rt(r))return tf(r);var t=mr(r),e=[];for(var i in r)i=="constructor"&&(t||!Tm.call(r,i))||e.push(i);return e}var km,Tm,rf,sf=u(()=>{"use strict";re();fs();ef();km=Object.prototype,Tm=km.hasOwnProperty;rf=_m});function Rm(r){return Qt(r)?cs(r,!0):rf(r)}var ms,Fo=u(()=>{"use strict";Ro();sf();dr();ms=Rm});function Dm(r,t){if(B(r))return!1;var e=typeof r;return e=="number"||e=="symbol"||e=="boolean"||r==null||ar(r)?!0:Fm.test(r)||!Pm.test(r)||t!=null&&r in Object(t)}var Pm,Fm,xr,gs=u(()=>{"use strict";Ft();es();Pm=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Fm=/^\w*$/;xr=Dm});var Lm,se,Zr=u(()=>{"use strict";me();Lm=pt(Object,"create"),se=Lm});function Mm(){this.__data__=se?se(null):{},this.size=0}var of,nf=u(()=>{"use strict";Zr();of=Mm});function Im(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t}var af,ff=u(()=>{"use strict";af=Im});function Wm(r){var t=this.__data__;if(se){var e=t[r];return e===Nm?void 0:e}return jm.call(t,r)?t[r]:void 0}var Nm,Bm,jm,lf,hf=u(()=>{"use strict";Zr();Nm="__lodash_hash_undefined__",Bm=Object.prototype,jm=Bm.hasOwnProperty;lf=Wm});function Gm(r){var t=this.__data__;return se?t[r]!==void 0:Um.call(t,r)}var zm,Um,uf,cf=u(()=>{"use strict";Zr();zm=Object.prototype,Um=zm.hasOwnProperty;uf=Gm});function Hm(r,t){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=se&&t===void 0?$m:t,this}var $m,pf,df=u(()=>{"use strict";Zr();$m="__lodash_hash_undefined__";pf=Hm});function wr(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}var Do,mf=u(()=>{"use strict";nf();ff();hf();cf();df();wr.prototype.clear=of;wr.prototype.delete=af;wr.prototype.get=lf;wr.prototype.has=uf;wr.prototype.set=pf;Do=wr});function qm(){this.__data__=[],this.size=0}var gf,yf=u(()=>{"use strict";gf=qm});function Km(r,t){for(var e=r.length;e--;)if(Kt(r[e][0],t))return e;return-1}var ye,Yr=u(()=>{"use strict";cr();ye=Km});function Zm(r){var t=this.__data__,e=ye(t,r);if(e<0)return!1;var i=t.length-1;return e==i?t.pop():Vm.call(t,e,1),--this.size,!0}var Qm,Vm,xf,wf=u(()=>{"use strict";Yr();Qm=Array.prototype,Vm=Qm.splice;xf=Zm});function Ym(r){var t=this.__data__,e=ye(t,r);return e<0?void 0:t[e][1]}var bf,Sf=u(()=>{"use strict";Yr();bf=Ym});function Jm(r){return ye(this.__data__,r)>-1}var vf,Cf=u(()=>{"use strict";Yr();vf=Jm});function Xm(r,t){var e=this.__data__,i=ye(e,r);return i<0?(++this.size,e.push([r,t])):e[i][1]=t,this}var Ef,Of=u(()=>{"use strict";Yr();Ef=Xm});function br(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}var xe,Jr=u(()=>{"use strict";yf();wf();Sf();Cf();Of();br.prototype.clear=gf;br.prototype.delete=xf;br.prototype.get=bf;br.prototype.has=vf;br.prototype.set=Ef;xe=br});var tg,we,ys=u(()=>{"use strict";me();Pt();tg=pt(U,"Map"),we=tg});function eg(){this.size=0,this.__data__={hash:new Do,map:new(we||xe),string:new Do}}var Af,kf=u(()=>{"use strict";mf();Jr();ys();Af=eg});function rg(r){var t=typeof r;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?r!=="__proto__":r===null}var Tf,_f=u(()=>{"use strict";Tf=rg});function ig(r,t){var e=r.__data__;return Tf(t)?e[typeof t=="string"?"string":"hash"]:e.map}var be,Xr=u(()=>{"use strict";_f();be=ig});function sg(r){var t=be(this,r).delete(r);return this.size-=t?1:0,t}var Rf,Pf=u(()=>{"use strict";Xr();Rf=sg});function og(r){return be(this,r).get(r)}var Ff,Df=u(()=>{"use strict";Xr();Ff=og});function ng(r){return be(this,r).has(r)}var Lf,Mf=u(()=>{"use strict";Xr();Lf=ng});function ag(r,t){var e=be(this,r),i=e.size;return e.set(r,t),this.size+=e.size==i?0:1,this}var If,Nf=u(()=>{"use strict";Xr();If=ag});function Sr(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var i=r[t];this.set(i[0],i[1])}}var He,xs=u(()=>{"use strict";kf();Pf();Df();Mf();Nf();Sr.prototype.clear=Af;Sr.prototype.delete=Rf;Sr.prototype.get=Ff;Sr.prototype.has=Lf;Sr.prototype.set=If;He=Sr});function Lo(r,t){if(typeof r!="function"||t!=null&&typeof t!="function")throw new TypeError(fg);var e=function(){var i=arguments,s=t?t.apply(this,i):i[0],o=e.cache;if(o.has(s))return o.get(s);var a=r.apply(this,i);return e.cache=o.set(s,a)||o,a};return e.cache=new(Lo.Cache||He),e}var fg,Et,Mo=u(()=>{"use strict";xs();fg="Expected a function";Lo.Cache=He;Et=Lo});function hg(r){var t=Et(r,function(i){return e.size===lg&&e.clear(),i}),e=t.cache;return t}var lg,Bf,jf=u(()=>{"use strict";Mo();lg=500;Bf=hg});var ug,cg,pg,Wf,zf=u(()=>{"use strict";jf();ug=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,cg=/\\(\\)?/g,pg=Bf(function(r){var t=[];return r.charCodeAt(0)===46&&t.push(""),r.replace(ug,function(e,i,s,o){t.push(s?o.replace(cg,"$1"):i||e)}),t}),Wf=pg});function dg(r){return r==null?"":Vn(r)}var Uf,Gf=u(()=>{"use strict";Zn();Uf=dg});function mg(r,t){return B(r)?r:xr(r,t)?[r]:Wf(Uf(r))}var ws,Io=u(()=>{"use strict";Ft();gs();zf();Gf();ws=mg});function yg(r){if(typeof r=="string"||ar(r))return r;var t=r+"";return t=="0"&&1/r==-gg?"-0":t}var gg,Se,ti=u(()=>{"use strict";es();gg=1/0;Se=yg});function xg(r,t){t=ws(t,r);for(var e=0,i=t.length;r!=null&&e<i;)r=r[Se(t[e++])];return e&&e==i?r:void 0}var bs,No=u(()=>{"use strict";Io();ti();bs=xg});function wg(r,t,e){var i=r==null?void 0:bs(r,t);return i===void 0?e:i}var $f,Hf=u(()=>{"use strict";No();$f=wg});function bg(r,t){for(var e=-1,i=t.length,s=r.length;++e<i;)r[s+e]=t[e];return r}var qf,Kf=u(()=>{"use strict";qf=bg});var Sg,Ss,Bo=u(()=>{"use strict";Po();Sg=ps(Object.getPrototypeOf,Object),Ss=Sg});function kg(r){if(!nt(r)||dt(r)!=vg)return!1;var t=Ss(r);if(t===null)return!0;var e=Og.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&Qf.call(e)==Ag}var vg,Cg,Eg,Qf,Og,Ag,Vf,Zf=u(()=>{"use strict";Ue();Bo();de();vg="[object Object]",Cg=Function.prototype,Eg=Object.prototype,Qf=Cg.toString,Og=Eg.hasOwnProperty,Ag=Qf.call(Object);Vf=kg});function Tg(){this.__data__=new xe,this.size=0}var Yf,Jf=u(()=>{"use strict";Jr();Yf=Tg});function _g(r){var t=this.__data__,e=t.delete(r);return this.size=t.size,e}var Xf,tl=u(()=>{"use strict";Xf=_g});function Rg(r){return this.__data__.get(r)}var el,rl=u(()=>{"use strict";el=Rg});function Pg(r){return this.__data__.has(r)}var il,sl=u(()=>{"use strict";il=Pg});function Dg(r,t){var e=this.__data__;if(e instanceof xe){var i=e.__data__;if(!we||i.length<Fg-1)return i.push([r,t]),this.size=++e.size,this;e=this.__data__=new He(i)}return e.set(r,t),this.size=e.size,this}var Fg,ol,nl=u(()=>{"use strict";Jr();ys();xs();Fg=200;ol=Dg});function vr(r){var t=this.__data__=new xe(r);this.size=t.size}var ve,vs=u(()=>{"use strict";Jr();Jf();tl();rl();sl();nl();vr.prototype.clear=Yf;vr.prototype.delete=Xf;vr.prototype.get=el;vr.prototype.has=il;vr.prototype.set=ol;ve=vr});function Mg(r,t){if(t)return r.slice();var e=r.length,i=ll?ll(e):new r.constructor(e);return r.copy(i),i}var hl,al,Lg,fl,ll,ul,cl=u(()=>{"use strict";Pt();hl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,al=hl&&typeof module=="object"&&module&&!module.nodeType&&module,Lg=al&&al.exports===hl,fl=Lg?U.Buffer:void 0,ll=fl?fl.allocUnsafe:void 0;ul=Mg});function Ig(r,t){for(var e=-1,i=r==null?0:r.length,s=0,o=[];++e<i;){var a=r[e];t(a,e,r)&&(o[s++]=a)}return o}var pl,dl=u(()=>{"use strict";pl=Ig});function Ng(){return[]}var ml,gl=u(()=>{"use strict";ml=Ng});var Bg,jg,yl,Wg,xl,wl=u(()=>{"use strict";dl();gl();Bg=Object.prototype,jg=Bg.propertyIsEnumerable,yl=Object.getOwnPropertySymbols,Wg=yl?function(r){return r==null?[]:(r=Object(r),pl(yl(r),function(t){return jg.call(r,t)}))}:ml,xl=Wg});function zg(r,t,e){var i=t(r);return B(r)?i:qf(i,e(r))}var bl,Sl=u(()=>{"use strict";Kf();Ft();bl=zg});function Ug(r){return bl(r,yr,xl)}var jo,vl=u(()=>{"use strict";Sl();wl();ds();jo=Ug});var Gg,Cs,Cl=u(()=>{"use strict";me();Pt();Gg=pt(U,"DataView"),Cs=Gg});var $g,Es,El=u(()=>{"use strict";me();Pt();$g=pt(U,"Promise"),Es=$g});var Hg,Os,Ol=u(()=>{"use strict";me();Pt();Hg=pt(U,"Set"),Os=Hg});var Al,qg,kl,Tl,_l,Rl,Kg,Qg,Vg,Zg,Yg,qe,Wo,Pl=u(()=>{"use strict";Cl();ys();El();Ol();oa();Ue();Oo();Al="[object Map]",qg="[object Object]",kl="[object Promise]",Tl="[object Set]",_l="[object WeakMap]",Rl="[object DataView]",Kg=ie(Cs),Qg=ie(we),Vg=ie(Es),Zg=ie(Os),Yg=ie(os),qe=dt;(Cs&&qe(new Cs(new ArrayBuffer(1)))!=Rl||we&&qe(new we)!=Al||Es&&qe(Es.resolve())!=kl||Os&&qe(new Os)!=Tl||os&&qe(new os)!=_l)&&(qe=function(r){var t=dt(r),e=t==qg?r.constructor:void 0,i=e?ie(e):"";if(i)switch(i){case Kg:return Rl;case Qg:return Al;case Vg:return kl;case Zg:return Tl;case Yg:return _l}return t});Wo=qe});var Jg,Cr,zo=u(()=>{"use strict";Pt();Jg=U.Uint8Array,Cr=Jg});function Xg(r){var t=new r.constructor(r.byteLength);return new Cr(t).set(new Cr(r)),t}var Fl,Dl=u(()=>{"use strict";zo();Fl=Xg});function ty(r,t){var e=t?Fl(r.buffer):r.buffer;return new r.constructor(e,r.byteOffset,r.length)}var Ll,Ml=u(()=>{"use strict";Dl();Ll=ty});function ey(r){return typeof r.constructor=="function"&&!mr(r)?aa(Ss(r)):{}}var Il,Nl=u(()=>{"use strict";fa();Bo();fs();Il=ey});function iy(r){return this.__data__.set(r,ry),this}var ry,Bl,jl=u(()=>{"use strict";ry="__lodash_hash_undefined__";Bl=iy});function sy(r){return this.__data__.has(r)}var Wl,zl=u(()=>{"use strict";Wl=sy});function As(r){var t=-1,e=r==null?0:r.length;for(this.__data__=new He;++t<e;)this.add(r[t])}var Ul,Gl=u(()=>{"use strict";xs();jl();zl();As.prototype.add=As.prototype.push=Bl;As.prototype.has=Wl;Ul=As});function oy(r,t){for(var e=-1,i=r==null?0:r.length;++e<i;)if(t(r[e],e,r))return!0;return!1}var $l,Hl=u(()=>{"use strict";$l=oy});function ny(r,t){return r.has(t)}var ql,Kl=u(()=>{"use strict";ql=ny});function ly(r,t,e,i,s,o){var a=e&ay,l=r.length,f=t.length;if(l!=f&&!(a&&f>l))return!1;var h=o.get(r),p=o.get(t);if(h&&p)return h==t&&p==r;var m=-1,g=!0,S=e&fy?new Ul:void 0;for(o.set(r,t),o.set(t,r);++m<l;){var C=r[m],x=t[m];if(i)var E=a?i(x,C,m,t,r,o):i(C,x,m,r,t,o);if(E!==void 0){if(E)continue;g=!1;break}if(S){if(!$l(t,function(w,O){if(!ql(S,O)&&(C===w||s(C,w,e,i,o)))return S.push(O)})){g=!1;break}}else if(!(C===x||s(C,x,e,i,o))){g=!1;break}}return o.delete(r),o.delete(t),g}var ay,fy,ks,Uo=u(()=>{"use strict";Gl();Hl();Kl();ay=1,fy=2;ks=ly});function hy(r){var t=-1,e=Array(r.size);return r.forEach(function(i,s){e[++t]=[s,i]}),e}var Ql,Vl=u(()=>{"use strict";Ql=hy});function uy(r){var t=-1,e=Array(r.size);return r.forEach(function(i){e[++t]=i}),e}var Zl,Yl=u(()=>{"use strict";Zl=uy});function Oy(r,t,e,i,s,o,a){switch(e){case Ey:if(r.byteLength!=t.byteLength||r.byteOffset!=t.byteOffset)return!1;r=r.buffer,t=t.buffer;case Cy:return!(r.byteLength!=t.byteLength||!o(new Cr(r),new Cr(t)));case dy:case my:case xy:return Kt(+r,+t);case gy:return r.name==t.name&&r.message==t.message;case wy:case Sy:return r==t+"";case yy:var l=Ql;case by:var f=i&cy;if(l||(l=Zl),r.size!=t.size&&!f)return!1;var h=a.get(r);if(h)return h==t;i|=py,a.set(r,t);var p=ks(l(r),l(t),i,s,o,a);return a.delete(r),p;case vy:if(Go)return Go.call(r)==Go.call(t)}return!1}var cy,py,dy,my,gy,yy,xy,wy,by,Sy,vy,Cy,Ey,Jl,Go,Xl,th=u(()=>{"use strict";qr();zo();cr();Uo();Vl();Yl();cy=1,py=2,dy="[object Boolean]",my="[object Date]",gy="[object Error]",yy="[object Map]",xy="[object Number]",wy="[object RegExp]",by="[object Set]",Sy="[object String]",vy="[object Symbol]",Cy="[object ArrayBuffer]",Ey="[object DataView]",Jl=Ct?Ct.prototype:void 0,Go=Jl?Jl.valueOf:void 0;Xl=Oy});function _y(r,t,e,i,s,o){var a=e&Ay,l=jo(r),f=l.length,h=jo(t),p=h.length;if(f!=p&&!a)return!1;for(var m=f;m--;){var g=l[m];if(!(a?g in t:Ty.call(t,g)))return!1}var S=o.get(r),C=o.get(t);if(S&&C)return S==t&&C==r;var x=!0;o.set(r,t),o.set(t,r);for(var E=a;++m<f;){g=l[m];var w=r[g],O=t[g];if(i)var k=a?i(O,w,g,t,r,o):i(w,O,g,r,t,o);if(!(k===void 0?w===O||s(w,O,e,i,o):k)){x=!1;break}E||(E=g=="constructor")}if(x&&!E){var T=r.constructor,D=t.constructor;T!=D&&"constructor"in r&&"constructor"in t&&!(typeof T=="function"&&T instanceof T&&typeof D=="function"&&D instanceof D)&&(x=!1)}return o.delete(r),o.delete(t),x}var Ay,ky,Ty,eh,rh=u(()=>{"use strict";vl();Ay=1,ky=Object.prototype,Ty=ky.hasOwnProperty;eh=_y});function Fy(r,t,e,i,s,o){var a=B(r),l=B(t),f=a?sh:Wo(r),h=l?sh:Wo(t);f=f==ih?Ts:f,h=h==ih?Ts:h;var p=f==Ts,m=h==Ts,g=f==h;if(g&&$e(r)){if(!$e(t))return!1;a=!0,p=!1}if(g&&!p)return o||(o=new ve),a||gr(r)?ks(r,t,e,i,s,o):Xl(r,t,f,e,i,s,o);if(!(e&Ry)){var S=p&&oh.call(r,"__wrapped__"),C=m&&oh.call(t,"__wrapped__");if(S||C){var x=S?r.value():r,E=C?t.value():t;return o||(o=new ve),s(x,E,e,i,o)}}return g?(o||(o=new ve),eh(r,t,e,i,s,o)):!1}var Ry,ih,sh,Ts,Py,oh,nh,ah=u(()=>{"use strict";vs();Uo();th();rh();Pl();Ft();hs();us();Ry=1,ih="[object Arguments]",sh="[object Array]",Ts="[object Object]",Py=Object.prototype,oh=Py.hasOwnProperty;nh=Fy});function fh(r,t,e,i,s){return r===t?!0:r==null||t==null||!nt(r)&&!nt(t)?r!==r&&t!==t:nh(r,t,e,i,fh,s)}var _s,$o=u(()=>{"use strict";ah();de();_s=fh});function My(r,t,e,i){var s=e.length,o=s,a=!i;if(r==null)return!o;for(r=Object(r);s--;){var l=e[s];if(a&&l[2]?l[1]!==r[l[0]]:!(l[0]in r))return!1}for(;++s<o;){l=e[s];var f=l[0],h=r[f],p=l[1];if(a&&l[2]){if(h===void 0&&!(f in r))return!1}else{var m=new ve;if(i)var g=i(h,p,f,r,t,m);if(!(g===void 0?_s(p,h,Dy|Ly,i,m):g))return!1}}return!0}var Dy,Ly,lh,hh=u(()=>{"use strict";vs();$o();Dy=1,Ly=2;lh=My});function Iy(r){return r===r&&!rt(r)}var Rs,Ho=u(()=>{"use strict";re();Rs=Iy});function Ny(r){for(var t=yr(r),e=t.length;e--;){var i=t[e],s=r[i];t[e]=[i,s,Rs(s)]}return t}var uh,ch=u(()=>{"use strict";Ho();ds();uh=Ny});function By(r,t){return function(e){return e==null?!1:e[r]===t&&(t!==void 0||r in Object(e))}}var Ps,qo=u(()=>{"use strict";Ps=By});function jy(r){var t=uh(r);return t.length==1&&t[0][2]?Ps(t[0][0],t[0][1]):function(e){return e===r||lh(e,r,t)}}var ph,dh=u(()=>{"use strict";hh();ch();qo();ph=jy});function Wy(r,t){return r!=null&&t in Object(r)}var mh,gh=u(()=>{"use strict";mh=Wy});function zy(r,t,e){t=ws(t,r);for(var i=-1,s=t.length,o=!1;++i<s;){var a=Se(t[i]);if(!(o=r!=null&&e(r,a)))break;r=r[a]}return o||++i!=s?o:(s=r==null?0:r.length,!!s&&pr(s)&&ur(a,s)&&(B(r)||Ge(r)))}var yh,xh=u(()=>{"use strict";Io();ls();Ft();ns();as();ti();yh=zy});function Uy(r,t){return r!=null&&yh(r,t,mh)}var wh,bh=u(()=>{"use strict";gh();xh();wh=Uy});function Hy(r,t){return xr(r)&&Rs(t)?Ps(Se(r),t):function(e){var i=$f(e,r);return i===void 0&&i===t?wh(e,r):_s(t,i,Gy|$y)}}var Gy,$y,Sh,vh=u(()=>{"use strict";$o();Hf();bh();gs();Ho();qo();ti();Gy=1,$y=2;Sh=Hy});function qy(r){return function(t){return t==null?void 0:t[r]}}var Ch,Eh=u(()=>{"use strict";Ch=qy});function Ky(r){return function(t){return bs(t,r)}}var Oh,Ah=u(()=>{"use strict";No();Oh=Ky});function Qy(r){return xr(r)?Ch(Se(r)):Oh(r)}var kh,Th=u(()=>{"use strict";Eh();Ah();gs();ti();kh=Qy});function Vy(r){return typeof r=="function"?r:r==null?fr:typeof r=="object"?B(r)?Sh(r[0],r[1]):ph(r):kh(r)}var _h,Rh=u(()=>{"use strict";dh();vh();rs();Ft();Th();_h=Vy});function Zy(r,t,e,i){for(var s=-1,o=r==null?0:r.length;++s<o;){var a=r[s];t(i,a,e(a),r)}return i}var Ph,Fh=u(()=>{"use strict";Ph=Zy});function Yy(r){return function(t,e,i){for(var s=-1,o=Object(t),a=i(t),l=a.length;l--;){var f=a[r?l:++s];if(e(o[f],f,o)===!1)break}return t}}var Dh,Lh=u(()=>{"use strict";Dh=Yy});var Jy,Fs,Ko=u(()=>{"use strict";Lh();Jy=Dh(),Fs=Jy});function Xy(r,t){return r&&Fs(r,t,yr)}var Mh,Ih=u(()=>{"use strict";Ko();ds();Mh=Xy});function tx(r,t){return function(e,i){if(e==null)return e;if(!Qt(e))return r(e,i);for(var s=e.length,o=t?s:-1,a=Object(e);(t?o--:++o<s)&&i(a[o],o,a)!==!1;);return e}}var Nh,Bh=u(()=>{"use strict";dr();Nh=tx});var ex,jh,Wh=u(()=>{"use strict";Ih();Bh();ex=Nh(Mh),jh=ex});function rx(r,t,e,i){return jh(r,function(s,o,a){t(i,s,e(s),a)}),i}var zh,Uh=u(()=>{"use strict";Wh();zh=rx});function ix(r,t){return function(e,i){var s=B(e)?Ph:zh,o=t?t():{};return s(e,r,_h(i,2),o)}}var Gh,$h=u(()=>{"use strict";Fh();Uh();Rh();Ft();Gh=ix});function sx(r,t,e){(e!==void 0&&!Kt(r[t],e)||e===void 0&&!(t in r))&&ge(r,t,e)}var ei,Qo=u(()=>{"use strict";Qr();cr();ei=sx});function ox(r){return nt(r)&&Qt(r)}var Hh,qh=u(()=>{"use strict";dr();de();Hh=ox});function nx(r,t){if(!(t==="constructor"&&typeof r[t]=="function")&&t!="__proto__")return r[t]}var ri,Vo=u(()=>{"use strict";ri=nx});function ax(r){return Ca(r,ms(r))}var Kh,Qh=u(()=>{"use strict";Ea();Fo();Kh=ax});function fx(r,t,e,i,s,o,a){var l=ri(r,e),f=ri(t,e),h=a.get(f);if(h){ei(r,e,h);return}var p=o?o(l,f,e+"",r,t,a):void 0,m=p===void 0;if(m){var g=B(f),S=!g&&$e(f),C=!g&&!S&&gr(f);p=f,g||S||C?B(l)?p=l:Hh(l)?p=ua(l):S?(m=!1,p=ul(f,!0)):C?(m=!1,p=Ll(f,!0)):p=[]:Vf(f)||Ge(f)?(p=l,Ge(l)?p=Kh(l):(!rt(l)||lr(l))&&(p=Il(f))):m=!1}m&&(a.set(f,p),s(p,f,i,o,a),a.delete(f)),ei(r,e,p)}var Vh,Zh=u(()=>{"use strict";Qo();cl();Ml();ca();Nl();ls();Ft();qh();hs();is();re();Zf();us();Vo();Qh();Vh=fx});function Yh(r,t,e,i,s){r!==t&&Fs(t,function(o,a){if(s||(s=new ve),rt(o))Vh(r,t,a,e,Yh,i,s);else{var l=i?i(ri(r,a),o,a+"",r,t,s):void 0;l===void 0&&(l=o),ei(r,a,l)}},ms)}var Jh,Xh=u(()=>{"use strict";vs();Qo();Ko();Zh();re();Fo();Vo();Jh=Yh});var lx,hx,ux,ii,tu=u(()=>{"use strict";Qr();$h();lx=Object.prototype,hx=lx.hasOwnProperty,ux=Gh(function(r,t,e){hx.call(r,e)?r[e].push(t):ge(r,e,[t])}),ii=ux});var cx,Zo,eu=u(()=>{"use strict";Xh();Da();cx=Fa(function(r,t,e){Jh(r,t,e)}),Zo=cx});var Ce=u(()=>{"use strict";tu();Mo();eu();});var pu=Dn((mk,cu)=>{"use strict";cu.exports=hu;function hu(r,t,e){r instanceof RegExp&&(r=lu(r,e)),t instanceof RegExp&&(t=lu(t,e));var i=uu(r,t,e);return i&&{start:i[0],end:i[1],pre:e.slice(0,i[0]),body:e.slice(i[0]+r.length,i[1]),post:e.slice(i[1]+t.length)}}function lu(r,t){var e=t.match(r);return e?e[0]:null}hu.range=uu;function uu(r,t,e){var i,s,o,a,l,f=e.indexOf(r),h=e.indexOf(t,f+1),p=f;if(f>=0&&h>0){if(r===t)return[f,h];for(i=[],o=e.length;p>=0&&!l;)p==f?(i.push(p),f=e.indexOf(r,p+1)):i.length==1?l=[i.pop(),h]:(s=i.pop(),s<o&&(o=s,a=h),h=e.indexOf(t,p+1)),p=f<h&&f>=0?f:h;i.length&&(l=[o,a])}return l}});var Su=Dn((gk,bu)=>{"use strict";var du=pu();bu.exports=Sx;var mu="\0SLASH"+Math.random()+"\0",gu="\0OPEN"+Math.random()+"\0",Jo="\0CLOSE"+Math.random()+"\0",yu="\0COMMA"+Math.random()+"\0",xu="\0PERIOD"+Math.random()+"\0";function Yo(r){return parseInt(r,10)==r?parseInt(r,10):r.charCodeAt(0)}function wx(r){return r.split("\\\\").join(mu).split("\\{").join(gu).split("\\}").join(Jo).split("\\,").join(yu).split("\\.").join(xu)}function bx(r){return r.split(mu).join("\\").split(gu).join("{").split(Jo).join("}").split(yu).join(",").split(xu).join(".")}function wu(r){if(!r)return[""];var t=[],e=du("{","}",r);if(!e)return r.split(",");var i=e.pre,s=e.body,o=e.post,a=i.split(",");a[a.length-1]+="{"+s+"}";var l=wu(o);return o.length&&(a[a.length-1]+=l.shift(),a.push.apply(a,l)),t.push.apply(t,a),t}function Sx(r){return r?(r.substr(0,2)==="{}"&&(r="\\{\\}"+r.substr(2)),si(wx(r),!0).map(bx)):[]}function vx(r){return"{"+r+"}"}function Cx(r){return/^-?0\d/.test(r)}function Ex(r,t){return r<=t}function Ox(r,t){return r>=t}function si(r,t){var e=[],i=du("{","}",r);if(!i)return[r];var s=i.pre,o=i.post.length?si(i.post,!1):[""];if(/\$$/.test(i.pre))for(var a=0;a<o.length;a++){var l=s+"{"+i.body+"}"+o[a];e.push(l)}else{var f=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),h=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),p=f||h,m=i.body.indexOf(",")>=0;if(!p&&!m)return i.post.match(/,.*\}/)?(r=i.pre+"{"+i.body+Jo+i.post,si(r)):[r];var g;if(p)g=i.body.split(/\.\./);else if(g=wu(i.body),g.length===1&&(g=si(g[0],!1).map(vx),g.length===1))return o.map(function(Vi){return i.pre+g[0]+Vi});var S;if(p){var C=Yo(g[0]),x=Yo(g[1]),E=Math.max(g[0].length,g[1].length),w=g.length==3?Math.abs(Yo(g[2])):1,O=Ex,k=x<C;k&&(w*=-1,O=Ox);var T=g.some(Cx);S=[];for(var D=C;O(D,x);D+=w){var W;if(h)W=String.fromCharCode(D),W==="\\"&&(W="");else if(W=String(D),T){var _t=E-W.length;if(_t>0){var We=new Array(_t+1).join("0");D<0?W="-"+We+W.slice(1):W=We+W}}S.push(W)}}else{S=[];for(var Rt=0;Rt<g.length;Rt++)S.push.apply(S,si(g[Rt],!1))}for(var Rt=0;Rt<S.length;Rt++)for(var a=0;a<o.length;a++){var l=s+S[Rt]+o[a];(!t||p||l)&&e.push(l)}}return e}});function Nw(r,t){if(r instanceof je)throw z("Command execution failed",r,{command:r.command,originalError:r.originalError}),r;if(r instanceof Error){let i=new je(r.message,t,r);throw z("Failed to execute command",r,{command:t,stack:r.stack}),i}let e=new je("Unknown error occurred during command execution",t);throw z("Failed to execute command",null,{error:r,command:t}),e}async function Uc(r,t={}){if(!r||typeof r!="string")throw new je("Command must be a non-empty string",r);let e={encoding:"utf8",maxBuffer:5*1024*1024,timeout:3e4};try{let{stdout:i,stderr:s}=await Iw(r,{...e,...t}),o=i.trim();if(!o)throw s?new je(`Command failed with stderr: ${s}`,r):new je("Command returned empty result",r);return o}catch(i){Nw(i,r)}}var Wc,zc,Iw,je,Gc=u(()=>{"use strict";Wc=require("child_process"),zc=require("util");ee();Iw=(0,zc.promisify)(Wc.exec),je=class extends Error{constructor(e,i,s){super(e);this.command=i;this.originalError=s;this.name="CommandExecutionError"}}});var $c={};up($c,{getChromePassword:()=>jw});var Bw,jw,Hc=u(()=>{"use strict";Ce();Gc();Bw=async()=>Uc('security find-generic-password -w -s "Chrome Safe Storage"'),jw=Et(Bw)});function pp(r){let t=r.split("."),e=[];e.push({name:"%",domain:r});for(let i=1;i<t.length-1;i++){let s=t.slice(i).join(".");e.push({name:"%",domain:s})}return e}function Co(r){if(!r.includes("://"))try{return Co(`https://${r}`)}catch(t){return[{name:"%",domain:r}]}try{let t=new URL(r);return pp(t.hostname)}catch(t){return[{name:"%",domain:r}]}}var Ln=ze(require("minimist"),1);function Mn(r){let t=(0,Ln.default)(r,{string:["browser","profile","url","domain","name","output"],boolean:["help","version","verbose","dump","dump-grouped","render","render-grouped"],alias:{b:"browser",p:"profile",u:"url",d:"domain",n:"name",h:"help",v:"version",D:"dump-grouped",r:"render",R:"render-grouped"}}),{_:e,...i}=t;return{values:i,positionals:e}}vt();ee();var nu=require("fs"),Ms=require("path"),au=ze(require("fast-glob"),1);ee();var su=require("path");Ce();var ru={};Zo(ru,process.env);var Ds=ru.HOME;if(typeof Ds!="string"||Ds.length===0)throw new Error("HOME environment variable is not set or empty");var iu,Er=(0,su.join)((iu=Ds)!=null?iu:"","Library","Application Support","Google","Chrome");var ou=ze(require("better-sqlite3"),1);Ce();ee();var px=Et(r=>{try{return Promise.resolve(new ou.default(r,{readonly:!0}))}catch(t){throw z("Database open failed",t,{file:r}),t}});function dx(r){try{return r.close(),Promise.resolve()}catch(t){return z("Database close failed",t),Promise.reject(t instanceof Error?t:new Error("Failed to close database: Unknown error"))}}async function Ls({file:r,sql:t,params:e,rowFilter:i,rowTransform:s}){let o;try{o=await px(r);let l=o.prepare(t).all(e),f=i?l.filter(i):l;return s?f.map(s):f}catch(a){throw z("Database query failed",a,{file:r,sql:t}),a}finally{o&&await dx(o)}}function mx(r){if(typeof r!="string")return!1;let t=r.trim();return t.length===0?!1:(0,nu.existsSync)(t)}async function gx(){let r=[(0,Ms.join)(Er,"Default/Cookies"),(0,Ms.join)(Er,"Profile */Cookies"),(0,Ms.join)(Er,"Profile Default/Cookies")],t=[];for(let e of r){let i=await(0,au.default)(e);t.push(...i)}return qt("ChromeCookies","Found cookie files",{count:t.length,files:t}),t}function yx(r,t){let e=r==="%",i=e?"SELECT name, encrypted_value, host_key, expires_utc FROM cookies WHERE host_key LIKE ?":"SELECT name, encrypted_value, host_key, expires_utc FROM cookies WHERE name = ? AND host_key LIKE ?",s=e?[`%${t}%`]:[r,`%${t}%`];return{sql:i,params:s}}async function xx(r,t,e){try{let{sql:i,params:s}=yx(t,e);qt("ChromeCookies","Executing query",{sql:i,params:s});let o=await Ls({file:r,sql:i,params:s,rowTransform:a=>({name:a.name,domain:a.host_key,value:a.encrypted_value,expiry:a.expires_utc})});return Nn("QueryCookies",!0,{file:r,count:o.length}),o}catch(i){return z("Failed to read cookie file",i,{file:r}),[]}}async function fu({name:r,domain:t,file:e}){let i=typeof e=="string"&&e.length>0?[e]:await gx();if(i.length===0)return qt("ChromeCookies","No cookie files found"),[];let s=[];for(let o of i){if(!mx(o)){qt("ChromeCookies","Cookie file missing or invalid",{file:o});continue}let a=await xx(o,r,t);s.push(...a)}return qt("ChromeCookies","Query complete",{totalCookies:s.length}),s}var Pu=ze(Su(),1);var oi=r=>{if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>65536)throw new TypeError("pattern is too long")};var Ax={"[: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]},ni=r=>r.replace(/[[\]\\-]/g,"\\$&"),kx=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),vu=r=>r.join(""),Cu=(r,t)=>{let e=t;if(r.charAt(e)!=="[")throw new Error("not in a brace expression");let i=[],s=[],o=e+1,a=!1,l=!1,f=!1,h=!1,p=e,m="";t:for(;o<r.length;){let x=r.charAt(o);if((x==="!"||x==="^")&&o===e+1){h=!0,o++;continue}if(x==="]"&&a&&!f){p=o+1;break}if(a=!0,x==="\\"&&!f){f=!0,o++;continue}if(x==="["&&!f){for(let[E,[w,O,k]]of Object.entries(Ax))if(r.startsWith(E,o)){if(m)return["$.",!1,r.length-e,!0];o+=E.length,k?s.push(w):i.push(w),l=l||O;continue t}}if(f=!1,m){x>m?i.push(ni(m)+"-"+ni(x)):x===m&&i.push(ni(x)),m="",o++;continue}if(r.startsWith("-]",o+1)){i.push(ni(x+"-")),o+=2;continue}if(r.startsWith("-",o+1)){m=x,o+=2;continue}i.push(ni(x)),o++}if(p<o)return["",!1,0,!1];if(!i.length&&!s.length)return["$.",!1,r.length-e,!0];if(s.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!h){let x=i[0].length===2?i[0].slice(-1):i[0];return[kx(x),!1,p-e,!1]}let g="["+(h?"^":"")+vu(i)+"]",S="["+(h?"":"^")+vu(s)+"]";return[i.length&&s.length?"("+g+"|"+S+")":i.length?g:S,l,p-e,!0]};var Dt=(r,{windowsPathsNoEscape:t=!1}={})=>t?r.replace(/\[([^\/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var Tx=new Set(["!","?","+","*","@"]),Eu=r=>Tx.has(r),_x="(?!(?:^|/)\\.\\.?(?:$|/))",Is="(?!\\.)",Rx=new Set(["[","."]),Px=new Set(["..","."]),Fx=new Set("().*{}+?[]^$\\!"),Dx=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),tn="[^/]",Ou=tn+"*?",Au=tn+"+?",H,Q,oe,N,G,Ee,Ke,Oe,Vt,Qe,ai,Ve,ku,Ae,Ns,Xo,Tu,at=class at{constructor(t,e,i={}){b(this,Ve);d(this,"type");b(this,H);b(this,Q);b(this,oe,!1);b(this,N,[]);b(this,G);b(this,Ee);b(this,Ke);b(this,Oe,!1);b(this,Vt);b(this,Qe);b(this,ai,!1);this.type=t,t&&c(this,Q,!0),c(this,G,e),c(this,H,n(this,G)?n(n(this,G),H):this),c(this,Vt,n(this,H)===this?i:n(n(this,H),Vt)),c(this,Ke,n(this,H)===this?[]:n(n(this,H),Ke)),t==="!"&&!n(n(this,H),Oe)&&n(this,Ke).push(this),c(this,Ee,n(this,G)?n(n(this,G),N).length:0)}get hasMagic(){if(n(this,Q)!==void 0)return n(this,Q);for(let t of n(this,N))if(typeof t!="string"&&(t.type||t.hasMagic))return c(this,Q,!0);return n(this,Q)}toString(){return n(this,Qe)!==void 0?n(this,Qe):this.type?c(this,Qe,this.type+"("+n(this,N).map(t=>String(t)).join("|")+")"):c(this,Qe,n(this,N).map(t=>String(t)).join(""))}push(...t){for(let e of t)if(e!==""){if(typeof e!="string"&&!(e instanceof at&&n(e,G)===this))throw new Error("invalid part: "+e);n(this,N).push(e)}}toJSON(){var e;let t=this.type===null?n(this,N).slice().map(i=>typeof i=="string"?i:i.toJSON()):[this.type,...n(this,N).map(i=>i.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===n(this,H)||n(n(this,H),Oe)&&((e=n(this,G))==null?void 0:e.type)==="!")&&t.push({}),t}isStart(){var e;if(n(this,H)===this)return!0;if(!((e=n(this,G))!=null&&e.isStart()))return!1;if(n(this,Ee)===0)return!0;let t=n(this,G);for(let i=0;i<n(this,Ee);i++){let s=n(t,N)[i];if(!(s instanceof at&&s.type==="!"))return!1}return!0}isEnd(){var e,i,s;if(n(this,H)===this||((e=n(this,G))==null?void 0:e.type)==="!")return!0;if(!((i=n(this,G))!=null&&i.isEnd()))return!1;if(!this.type)return(s=n(this,G))==null?void 0:s.isEnd();let t=n(this,G)?n(n(this,G),N).length:0;return n(this,Ee)===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let e=new at(this.type,t);for(let i of n(this,N))e.copyIn(i);return e}static fromGlob(t,e={}){var s;let i=new at(null,void 0,e);return y(s=at,Ae,Ns).call(s,t,i,0,e),i}toMMPattern(){if(this!==n(this,H))return n(this,H).toMMPattern();let t=this.toString(),[e,i,s,o]=this.toRegExpSource();if(!(s||n(this,Q)||n(this,Vt).nocase&&!n(this,Vt).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return i;let l=(n(this,Vt).nocase?"i":"")+(o?"u":"");return Object.assign(new RegExp(`^${e}$`,l),{_src:e,_glob:t})}get options(){return n(this,Vt)}toRegExpSource(t){var f;let e=t!=null?t:!!n(this,Vt).dot;if(n(this,H)===this&&y(this,Ve,ku).call(this),!this.type){let h=this.isStart()&&this.isEnd(),p=n(this,N).map(C=>{var k;let[x,E,w,O]=typeof C=="string"?y(k=at,Ae,Tu).call(k,C,n(this,Q),h):C.toRegExpSource(t);return c(this,Q,n(this,Q)||w),c(this,oe,n(this,oe)||O),x}).join(""),m="";if(this.isStart()&&typeof n(this,N)[0]=="string"&&!(n(this,N).length===1&&Px.has(n(this,N)[0]))){let x=Rx,E=e&&x.has(p.charAt(0))||p.startsWith("\\.")&&x.has(p.charAt(2))||p.startsWith("\\.\\.")&&x.has(p.charAt(4)),w=!e&&!t&&x.has(p.charAt(0));m=E?_x:w?Is:""}let g="";return this.isEnd()&&n(n(this,H),Oe)&&((f=n(this,G))==null?void 0:f.type)==="!"&&(g="(?:$|\\/)"),[m+p+g,Dt(p),c(this,Q,!!n(this,Q)),n(this,oe)]}let i=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:",o=y(this,Ve,Xo).call(this,e);if(this.isStart()&&this.isEnd()&&!o&&this.type!=="!"){let h=this.toString();return c(this,N,[h]),this.type=null,c(this,Q,void 0),[h,Dt(this.toString()),!1,!1]}let a=!i||t||e||!Is?"":y(this,Ve,Xo).call(this,!0);a===o&&(a=""),a&&(o=`(?:${o})(?:${a})*?`);let l="";if(this.type==="!"&&n(this,ai))l=(this.isStart()&&!e?Is:"")+Au;else{let h=this.type==="!"?"))"+(this.isStart()&&!e&&!t?Is:"")+Ou+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;l=s+o+h}return[l,Dt(o),c(this,Q,!!n(this,Q)),n(this,oe)]}};H=new WeakMap,Q=new WeakMap,oe=new WeakMap,N=new WeakMap,G=new WeakMap,Ee=new WeakMap,Ke=new WeakMap,Oe=new WeakMap,Vt=new WeakMap,Qe=new WeakMap,ai=new WeakMap,Ve=new WeakSet,ku=function(){if(this!==n(this,H))throw new Error("should only call on root");if(n(this,Oe))return this;this.toString(),c(this,Oe,!0);let t;for(;t=n(this,Ke).pop();){if(t.type!=="!")continue;let e=t,i=n(e,G);for(;i;){for(let s=n(e,Ee)+1;!i.type&&s<n(i,N).length;s++)for(let o of n(t,N)){if(typeof o=="string")throw new Error("string part in extglob AST??");o.copyIn(n(i,N)[s])}e=i,i=n(e,G)}}return this},Ae=new WeakSet,Ns=function(t,e,i,s){var S,C;let o=!1,a=!1,l=-1,f=!1;if(e.type===null){let x=i,E="";for(;x<t.length;){let w=t.charAt(x++);if(o||w==="\\"){o=!o,E+=w;continue}if(a){x===l+1?(w==="^"||w==="!")&&(f=!0):w==="]"&&!(x===l+2&&f)&&(a=!1),E+=w;continue}else if(w==="["){a=!0,l=x,f=!1,E+=w;continue}if(!s.noext&&Eu(w)&&t.charAt(x)==="("){e.push(E),E="";let O=new at(w,e);x=y(S=at,Ae,Ns).call(S,t,O,x,s),e.push(O);continue}E+=w}return e.push(E),x}let h=i+1,p=new at(null,e),m=[],g="";for(;h<t.length;){let x=t.charAt(h++);if(o||x==="\\"){o=!o,g+=x;continue}if(a){h===l+1?(x==="^"||x==="!")&&(f=!0):x==="]"&&!(h===l+2&&f)&&(a=!1),g+=x;continue}else if(x==="["){a=!0,l=h,f=!1,g+=x;continue}if(Eu(x)&&t.charAt(h)==="("){p.push(g),g="";let E=new at(x,p);p.push(E),h=y(C=at,Ae,Ns).call(C,t,E,h,s);continue}if(x==="|"){p.push(g),g="",m.push(p),p=new at(null,e);continue}if(x===")")return g===""&&n(e,N).length===0&&c(e,ai,!0),p.push(g),g="",e.push(...m,p),h;g+=x}return e.type=null,c(e,Q,void 0),c(e,N,[t.substring(i-1)]),h},Xo=function(t){return n(this,N).map(e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");let[i,s,o,a]=e.toRegExpSource(t);return c(this,oe,n(this,oe)||a),i}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join("|")},Tu=function(t,e,i=!1){let s=!1,o="",a=!1;for(let l=0;l<t.length;l++){let f=t.charAt(l);if(s){s=!1,o+=(Fx.has(f)?"\\":"")+f;continue}if(f==="\\"){l===t.length-1?o+="\\\\":s=!0;continue}if(f==="["){let[h,p,m,g]=Cu(t,l);if(m){o+=h,a=a||p,l+=m-1,e=e||g;continue}}if(f==="*"){i&&t==="*"?o+=Au:o+=Ou,e=!0;continue}if(f==="?"){o+=tn,e=!0;continue}o+=Dx(f)}return[o,Dt(t),!!e,a]},b(at,Ae);var Or=at;var Ar=(r,{windowsPathsNoEscape:t=!1}={})=>t?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&");var ft=(r,t,e={})=>(oi(t),!e.nocomment&&t.charAt(0)==="#"?!1:new mt(t,e).match(r)),Lx=/^\*+([^+@!?\*\[\(]*)$/,Mx=r=>t=>!t.startsWith(".")&&t.endsWith(r),Ix=r=>t=>t.endsWith(r),Nx=r=>(r=r.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(r)),Bx=r=>(r=r.toLowerCase(),t=>t.toLowerCase().endsWith(r)),jx=/^\*+\.\*+$/,Wx=r=>!r.startsWith(".")&&r.includes("."),zx=r=>r!=="."&&r!==".."&&r.includes("."),Ux=/^\.\*+$/,Gx=r=>r!=="."&&r!==".."&&r.startsWith("."),$x=/^\*+$/,Hx=r=>r.length!==0&&!r.startsWith("."),qx=r=>r.length!==0&&r!=="."&&r!=="..",Kx=/^\?+([^+@!?\*\[\(]*)?$/,Qx=([r,t=""])=>{let e=Fu([r]);return t?(t=t.toLowerCase(),i=>e(i)&&i.toLowerCase().endsWith(t)):e},Vx=([r,t=""])=>{let e=Du([r]);return t?(t=t.toLowerCase(),i=>e(i)&&i.toLowerCase().endsWith(t)):e},Zx=([r,t=""])=>{let e=Du([r]);return t?i=>e(i)&&i.endsWith(t):e},Yx=([r,t=""])=>{let e=Fu([r]);return t?i=>e(i)&&i.endsWith(t):e},Fu=([r])=>{let t=r.length;return e=>e.length===t&&!e.startsWith(".")},Du=([r])=>{let t=r.length;return e=>e.length===t&&e!=="."&&e!==".."},Lu=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",_u={win32:{sep:"\\"},posix:{sep:"/"}},Jx=Lu==="win32"?_u.win32.sep:_u.posix.sep;ft.sep=Jx;var et=Symbol("globstar **");ft.GLOBSTAR=et;var Xx="[^/]",tw=Xx+"*?",ew="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",rw="(?:(?!(?:\\/|^)\\.).)*?",iw=(r,t={})=>e=>ft(e,r,t);ft.filter=iw;var Ot=(r,t={})=>Object.assign({},r,t),sw=r=>{if(!r||typeof r!="object"||!Object.keys(r).length)return ft;let t=ft;return Object.assign((i,s,o={})=>t(i,s,Ot(r,o)),{Minimatch:class extends t.Minimatch{constructor(s,o={}){super(s,Ot(r,o))}static defaults(s){return t.defaults(Ot(r,s)).Minimatch}},AST:class extends t.AST{constructor(s,o,a={}){super(s,o,Ot(r,a))}static fromGlob(s,o={}){return t.AST.fromGlob(s,Ot(r,o))}},unescape:(i,s={})=>t.unescape(i,Ot(r,s)),escape:(i,s={})=>t.escape(i,Ot(r,s)),filter:(i,s={})=>t.filter(i,Ot(r,s)),defaults:i=>t.defaults(Ot(r,i)),makeRe:(i,s={})=>t.makeRe(i,Ot(r,s)),braceExpand:(i,s={})=>t.braceExpand(i,Ot(r,s)),match:(i,s,o={})=>t.match(i,s,Ot(r,o)),sep:t.sep,GLOBSTAR:et})};ft.defaults=sw;var Mu=(r,t={})=>(oi(r),t.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:(0,Pu.default)(r));ft.braceExpand=Mu;var ow=(r,t={})=>new mt(r,t).makeRe();ft.makeRe=ow;var nw=(r,t,e={})=>{let i=new mt(t,e);return r=r.filter(s=>i.match(s)),i.options.nonull&&!r.length&&r.push(t),r};ft.match=nw;var Ru=/[?*]|[+@!]\(.*?\)|\[|\]/,aw=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),mt=class{constructor(t,e={}){d(this,"options");d(this,"set");d(this,"pattern");d(this,"windowsPathsNoEscape");d(this,"nonegate");d(this,"negate");d(this,"comment");d(this,"empty");d(this,"preserveMultipleSlashes");d(this,"partial");d(this,"globSet");d(this,"globParts");d(this,"nocase");d(this,"isWindows");d(this,"platform");d(this,"windowsNoMagicRoot");d(this,"regexp");oi(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||Lu,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(let t of this.set)for(let e of t)if(typeof e!="string")return!0;return!1}debug(...t){}make(){let 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=(...o)=>console.error(...o)),this.debug(this.pattern,this.globSet);let i=this.globSet.map(o=>this.slashSplit(o));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let s=this.globParts.map((o,a,l)=>{if(this.isWindows&&this.windowsNoMagicRoot){let f=o[0]===""&&o[1]===""&&(o[2]==="?"||!Ru.test(o[2]))&&!Ru.test(o[3]),h=/^[a-z]:/i.test(o[0]);if(f)return[...o.slice(0,4),...o.slice(4).map(p=>this.parse(p))];if(h)return[o[0],...o.slice(1).map(p=>this.parse(p))]}return o.map(f=>this.parse(f))});if(this.debug(this.pattern,s),this.set=s.filter(o=>o.indexOf(!1)===-1),this.isWindows)for(let o=0;o<this.set.length;o++){let a=this.set[o];a[0]===""&&a[1]===""&&this.globParts[o][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let i=0;i<t.length;i++)for(let s=0;s<t[i].length;s++)t[i][s]==="**"&&(t[i][s]="*");let{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 s=i;for(;e[s+1]==="**";)s++;s!==i&&e.splice(i,s-i)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((i,s)=>{let o=i[i.length-1];return s==="**"&&o==="**"?i:s===".."&&o&&o!==".."&&o!=="."&&o!=="**"?(i.pop(),i):(i.push(s),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 s=1;s<t.length-1;s++){let o=t[s];s===1&&o===""&&t[0]===""||(o==="."||o==="")&&(e=!0,t.splice(s,1),s--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(e=!0,t.pop())}let i=0;for(;(i=t.indexOf("..",i+1))!==-1;){let s=t[i-1];s&&s!=="."&&s!==".."&&s!=="**"&&(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 s=-1;for(;(s=i.indexOf("**",s+1))!==-1;){let a=s;for(;i[a+1]==="**";)a++;a>s&&i.splice(s+1,a-s);let l=i[s+1],f=i[s+2],h=i[s+3];if(l!==".."||!f||f==="."||f===".."||!h||h==="."||h==="..")continue;e=!0,i.splice(s,1);let p=i.slice(0);p[s]="**",t.push(p),s--}if(!this.preserveMultipleSlashes){for(let a=1;a<i.length-1;a++){let l=i[a];a===1&&l===""&&i[0]===""||(l==="."||l==="")&&(e=!0,i.splice(a,1),a--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(e=!0,i.pop())}let o=0;for(;(o=i.indexOf("..",o+1))!==-1;){let a=i[o-1];if(a&&a!=="."&&a!==".."&&a!=="**"){e=!0;let f=o===1&&i[o+1]==="**"?["."]:[];i.splice(o-1,2,...f),i.length===0&&i.push(""),o-=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++){let s=this.partsMatch(t[e],t[i],!this.preserveMultipleSlashes);if(s){t[e]=[],t[i]=s;break}}return t.filter(e=>e.length)}partsMatch(t,e,i=!1){let s=0,o=0,a=[],l="";for(;s<t.length&&o<e.length;)if(t[s]===e[o])a.push(l==="b"?e[o]:t[s]),s++,o++;else if(i&&t[s]==="**"&&e[o]===t[s+1])a.push(t[s]),s++;else if(i&&e[o]==="**"&&t[s]===e[o+1])a.push(e[o]),o++;else if(t[s]==="*"&&e[o]&&(this.options.dot||!e[o].startsWith("."))&&e[o]!=="**"){if(l==="b")return!1;l="a",a.push(t[s]),s++,o++}else if(e[o]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(l==="a")return!1;l="b",a.push(e[o]),s++,o++}else return!1;return t.length===e.length&&a}parseNegate(){if(this.nonegate)return;let t=this.pattern,e=!1,i=0;for(let s=0;s<t.length&&t.charAt(s)==="!";s++)e=!e,i++;i&&(this.pattern=t.slice(i)),this.negate=e}matchOne(t,e,i=!1){let s=this.options;if(this.isWindows){let x=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),E=!x&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),w=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),O=!w&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3]),k=E?3:x?0:void 0,T=O?3:w?0:void 0;if(typeof k=="number"&&typeof T=="number"){let[D,W]=[t[k],e[T]];D.toLowerCase()===W.toLowerCase()&&(e[T]=D,T>k?e=e.slice(T):k>T&&(t=t.slice(k)))}}let{optimizationLevel:o=1}=this.options;o>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var a=0,l=0,f=t.length,h=e.length;a<f&&l<h;a++,l++){this.debug("matchOne loop");var p=e[l],m=t[a];if(this.debug(e,p,m),p===!1)return!1;if(p===et){this.debug("GLOBSTAR",[e,p,m]);var g=a,S=l+1;if(S===h){for(this.debug("** at the end");a<f;a++)if(t[a]==="."||t[a]===".."||!s.dot&&t[a].charAt(0)===".")return!1;return!0}for(;g<f;){var C=t[g];if(this.debug(`
|
|
3
|
+
globstar while`,t,g,e,S,C),this.matchOne(t.slice(g),e.slice(S),i))return this.debug("globstar found match!",g,f,C),!0;if(C==="."||C===".."||!s.dot&&C.charAt(0)==="."){this.debug("dot detected!",t,g,e,S);break}this.debug("globstar swallow a segment, and continue"),g++}return!!(i&&(this.debug(`
|
|
4
|
+
>>> no match, partial?`,t,g,e,S),g===f))}let x;if(typeof p=="string"?(x=m===p,this.debug("string match",p,m,x)):(x=p.test(m),this.debug("pattern match",p,m,x)),!x)return!1}if(a===f&&l===h)return!0;if(a===f)return i;if(l===h)return a===f-1&&t[a]==="";throw new Error("wtf?")}braceExpand(){return Mu(this.pattern,this.options)}parse(t){oi(t);let e=this.options;if(t==="**")return et;if(t==="")return"";let i,s=null;(i=t.match($x))?s=e.dot?qx:Hx:(i=t.match(Lx))?s=(e.nocase?e.dot?Bx:Nx:e.dot?Ix:Mx)(i[1]):(i=t.match(Kx))?s=(e.nocase?e.dot?Vx:Qx:e.dot?Zx:Yx)(i):(i=t.match(jx))?s=e.dot?zx:Wx:(i=t.match(Ux))&&(s=Gx);let o=Or.fromGlob(t,this.options).toMMPattern();return s&&typeof o=="object"&&Reflect.defineProperty(o,"test",{value:s}),o}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let e=this.options,i=e.noglobstar?tw:e.dot?ew:rw,s=new Set(e.nocase?["i"]:[]),o=t.map(f=>{let h=f.map(p=>{if(p instanceof RegExp)for(let m of p.flags.split(""))s.add(m);return typeof p=="string"?aw(p):p===et?et:p._src});return h.forEach((p,m)=>{let g=h[m+1],S=h[m-1];p!==et||S===et||(S===void 0?g!==void 0&&g!==et?h[m+1]="(?:\\/|"+i+"\\/)?"+g:h[m]=i:g===void 0?h[m-1]=S+"(?:\\/|"+i+")?":g!==et&&(h[m-1]=S+"(?:\\/|\\/"+i+"\\/)"+g,h[m+1]=et))}),h.filter(p=>p!==et).join("/")}).join("|"),[a,l]=t.length>1?["(?:",")"]:["",""];o="^"+a+o+l+"$",this.negate&&(o="^(?!"+o+").+$");try{this.regexp=new RegExp(o,[...s].join(""))}catch(f){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;let i=this.options;this.isWindows&&(t=t.split("\\").join("/"));let s=this.slashSplit(t);this.debug(this.pattern,"split",s);let o=this.set;this.debug(this.pattern,"set",o);let a=s[s.length-1];if(!a)for(let l=s.length-2;!a&&l>=0;l--)a=s[l];for(let l=0;l<o.length;l++){let f=o[l],h=s;if(i.matchBase&&f.length===1&&(h=[a]),this.matchOne(h,f,e))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(t){return ft.defaults(t).Minimatch}};ft.AST=Or;ft.Minimatch=mt;ft.escape=Ar;ft.unescape=Dt;var Fc=require("url");var kr=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Wu=new Set,en=typeof process=="object"&&process?process:{},zu=(r,t,e,i)=>{typeof en.emitWarning=="function"?en.emitWarning(r,t,e,i):console.error(`[${e}] ${t}: ${r}`)},Ws=globalThis.AbortController,Iu=globalThis.AbortSignal,Nu;if(typeof Ws=="undefined"){Iu=class{constructor(){d(this,"onabort");d(this,"_onabort",[]);d(this,"reason");d(this,"aborted",!1)}addEventListener(i,s){this._onabort.push(s)}},Ws=class{constructor(){d(this,"signal",new Iu);t()}abort(i){var s,o;if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let a of this.signal._onabort)a(i);(o=(s=this.signal).onabort)==null||o.call(s,i)}}};let r=((Nu=en.env)==null?void 0:Nu.LRU_CACHE_IGNORE_AC_WARNING)!=="1",t=()=>{r&&(r=!1,zu("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}var fw=r=>!Wu.has(r),Bk=Symbol("type"),ke=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),Uu=r=>ke(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?Tr:null:null,Tr=class extends Array{constructor(t){super(t),this.fill(0)}},_r,Ze=class Ze{constructor(t,e){d(this,"heap");d(this,"length");if(!n(Ze,_r))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}static create(t){let e=Uu(t);if(!e)return[];c(Ze,_r,!0);let i=new Ze(t,e);return c(Ze,_r,!1),i}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}};_r=new WeakMap,b(Ze,_r,!1);var rn=Ze,Bu,ju,Lt,gt,Mt,It,Rr,Pr,q,Nt,$,I,P,lt,yt,it,V,Bt,Z,jt,Wt,xt,zt,Pe,ht,v,sn,Ye,ne,hi,wt,Gu,Je,Fr,ui,Te,_e,on,Bs,js,M,nn,fi,Re,an,fn=class fn{constructor(t){b(this,v);b(this,Lt);b(this,gt);b(this,Mt);b(this,It);b(this,Rr);b(this,Pr);d(this,"ttl");d(this,"ttlResolution");d(this,"ttlAutopurge");d(this,"updateAgeOnGet");d(this,"updateAgeOnHas");d(this,"allowStale");d(this,"noDisposeOnSet");d(this,"noUpdateTTL");d(this,"maxEntrySize");d(this,"sizeCalculation");d(this,"noDeleteOnFetchRejection");d(this,"noDeleteOnStaleGet");d(this,"allowStaleOnFetchAbort");d(this,"allowStaleOnFetchRejection");d(this,"ignoreFetchAbort");b(this,q);b(this,Nt);b(this,$);b(this,I);b(this,P);b(this,lt);b(this,yt);b(this,it);b(this,V);b(this,Bt);b(this,Z);b(this,jt);b(this,Wt);b(this,xt);b(this,zt);b(this,Pe);b(this,ht);b(this,Ye,()=>{});b(this,ne,()=>{});b(this,hi,()=>{});b(this,wt,()=>!1);b(this,Je,t=>{});b(this,Fr,(t,e,i)=>{});b(this,ui,(t,e,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});d(this,Bu,"LRUCache");let{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:o,updateAgeOnGet:a,updateAgeOnHas:l,allowStale:f,dispose:h,disposeAfter:p,noDisposeOnSet:m,noUpdateTTL:g,maxSize:S=0,maxEntrySize:C=0,sizeCalculation:x,fetchMethod:E,memoMethod:w,noDeleteOnFetchRejection:O,noDeleteOnStaleGet:k,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:D,ignoreFetchAbort:W}=t;if(e!==0&&!ke(e))throw new TypeError("max option must be a nonnegative integer");let _t=e?Uu(e):Array;if(!_t)throw new Error("invalid max value: "+e);if(c(this,Lt,e),c(this,gt,S),this.maxEntrySize=C||n(this,gt),this.sizeCalculation=x,this.sizeCalculation){if(!n(this,gt)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(w!==void 0&&typeof w!="function")throw new TypeError("memoMethod must be a function if defined");if(c(this,Pr,w),E!==void 0&&typeof E!="function")throw new TypeError("fetchMethod must be a function if specified");if(c(this,Rr,E),c(this,Pe,!!E),c(this,$,new Map),c(this,I,new Array(e).fill(void 0)),c(this,P,new Array(e).fill(void 0)),c(this,lt,new _t(e)),c(this,yt,new _t(e)),c(this,it,0),c(this,V,0),c(this,Bt,rn.create(e)),c(this,q,0),c(this,Nt,0),typeof h=="function"&&c(this,Mt,h),typeof p=="function"?(c(this,It,p),c(this,Z,[])):(c(this,It,void 0),c(this,Z,void 0)),c(this,zt,!!n(this,Mt)),c(this,ht,!!n(this,It)),this.noDisposeOnSet=!!m,this.noUpdateTTL=!!g,this.noDeleteOnFetchRejection=!!O,this.allowStaleOnFetchRejection=!!T,this.allowStaleOnFetchAbort=!!D,this.ignoreFetchAbort=!!W,this.maxEntrySize!==0){if(n(this,gt)!==0&&!ke(n(this,gt)))throw new TypeError("maxSize must be a positive integer if specified");if(!ke(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");y(this,v,Gu).call(this)}if(this.allowStale=!!f,this.noDeleteOnStaleGet=!!k,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!l,this.ttlResolution=ke(s)||s===0?s:1,this.ttlAutopurge=!!o,this.ttl=i||0,this.ttl){if(!ke(this.ttl))throw new TypeError("ttl must be a positive integer if specified");y(this,v,sn).call(this)}if(n(this,Lt)===0&&this.ttl===0&&n(this,gt)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!n(this,Lt)&&!n(this,gt)){let We="LRU_CACHE_UNBOUNDED";fw(We)&&(Wu.add(We),zu("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",We,fn))}}static unsafeExposeInternals(t){return{starts:n(t,Wt),ttls:n(t,xt),sizes:n(t,jt),keyMap:n(t,$),keyList:n(t,I),valList:n(t,P),next:n(t,lt),prev:n(t,yt),get head(){return n(t,it)},get tail(){return n(t,V)},free:n(t,Bt),isBackgroundFetch:e=>{var i;return y(i=t,v,M).call(i,e)},backgroundFetch:(e,i,s,o)=>{var a;return y(a=t,v,js).call(a,e,i,s,o)},moveToTail:e=>{var i;return y(i=t,v,fi).call(i,e)},indexes:e=>{var i;return y(i=t,v,Te).call(i,e)},rindexes:e=>{var i;return y(i=t,v,_e).call(i,e)},isStale:e=>{var i;return n(i=t,wt).call(i,e)}}}get max(){return n(this,Lt)}get maxSize(){return n(this,gt)}get calculatedSize(){return n(this,Nt)}get size(){return n(this,q)}get fetchMethod(){return n(this,Rr)}get memoMethod(){return n(this,Pr)}get dispose(){return n(this,Mt)}get disposeAfter(){return n(this,It)}getRemainingTTL(t){return n(this,$).has(t)?1/0:0}*entries(){for(let t of y(this,v,Te).call(this))n(this,P)[t]!==void 0&&n(this,I)[t]!==void 0&&!y(this,v,M).call(this,n(this,P)[t])&&(yield[n(this,I)[t],n(this,P)[t]])}*rentries(){for(let t of y(this,v,_e).call(this))n(this,P)[t]!==void 0&&n(this,I)[t]!==void 0&&!y(this,v,M).call(this,n(this,P)[t])&&(yield[n(this,I)[t],n(this,P)[t]])}*keys(){for(let t of y(this,v,Te).call(this)){let e=n(this,I)[t];e!==void 0&&!y(this,v,M).call(this,n(this,P)[t])&&(yield e)}}*rkeys(){for(let t of y(this,v,_e).call(this)){let e=n(this,I)[t];e!==void 0&&!y(this,v,M).call(this,n(this,P)[t])&&(yield e)}}*values(){for(let t of y(this,v,Te).call(this))n(this,P)[t]!==void 0&&!y(this,v,M).call(this,n(this,P)[t])&&(yield n(this,P)[t])}*rvalues(){for(let t of y(this,v,_e).call(this))n(this,P)[t]!==void 0&&!y(this,v,M).call(this,n(this,P)[t])&&(yield n(this,P)[t])}[(ju=Symbol.iterator,Bu=Symbol.toStringTag,ju)](){return this.entries()}find(t,e={}){for(let i of y(this,v,Te).call(this)){let s=n(this,P)[i],o=y(this,v,M).call(this,s)?s.__staleWhileFetching:s;if(o!==void 0&&t(o,n(this,I)[i],this))return this.get(n(this,I)[i],e)}}forEach(t,e=this){for(let i of y(this,v,Te).call(this)){let s=n(this,P)[i],o=y(this,v,M).call(this,s)?s.__staleWhileFetching:s;o!==void 0&&t.call(e,o,n(this,I)[i],this)}}rforEach(t,e=this){for(let i of y(this,v,_e).call(this)){let s=n(this,P)[i],o=y(this,v,M).call(this,s)?s.__staleWhileFetching:s;o!==void 0&&t.call(e,o,n(this,I)[i],this)}}purgeStale(){let t=!1;for(let e of y(this,v,_e).call(this,{allowStale:!0}))n(this,wt).call(this,e)&&(y(this,v,Re).call(this,n(this,I)[e],"expire"),t=!0);return t}info(t){let e=n(this,$).get(t);if(e===void 0)return;let i=n(this,P)[e],s=y(this,v,M).call(this,i)?i.__staleWhileFetching:i;if(s===void 0)return;let o={value:s};if(n(this,xt)&&n(this,Wt)){let a=n(this,xt)[e],l=n(this,Wt)[e];if(a&&l){let f=a-(kr.now()-l);o.ttl=f,o.start=Date.now()}}return n(this,jt)&&(o.size=n(this,jt)[e]),o}dump(){let t=[];for(let e of y(this,v,Te).call(this,{allowStale:!0})){let i=n(this,I)[e],s=n(this,P)[e],o=y(this,v,M).call(this,s)?s.__staleWhileFetching:s;if(o===void 0||i===void 0)continue;let a={value:o};if(n(this,xt)&&n(this,Wt)){a.ttl=n(this,xt)[e];let l=kr.now()-n(this,Wt)[e];a.start=Math.floor(Date.now()-l)}n(this,jt)&&(a.size=n(this,jt)[e]),t.unshift([i,a])}return t}load(t){this.clear();for(let[e,i]of t){if(i.start){let s=Date.now()-i.start;i.start=kr.now()-s}this.set(e,i.value,i)}}set(t,e,i={}){var g,S,C,x,E;if(e===void 0)return this.delete(t),this;let{ttl:s=this.ttl,start:o,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:f}=i,{noUpdateTTL:h=this.noUpdateTTL}=i,p=n(this,ui).call(this,t,e,i.size||0,l);if(this.maxEntrySize&&p>this.maxEntrySize)return f&&(f.set="miss",f.maxEntrySizeExceeded=!0),y(this,v,Re).call(this,t,"set"),this;let m=n(this,q)===0?void 0:n(this,$).get(t);if(m===void 0)m=n(this,q)===0?n(this,V):n(this,Bt).length!==0?n(this,Bt).pop():n(this,q)===n(this,Lt)?y(this,v,Bs).call(this,!1):n(this,q),n(this,I)[m]=t,n(this,P)[m]=e,n(this,$).set(t,m),n(this,lt)[n(this,V)]=m,n(this,yt)[m]=n(this,V),c(this,V,m),Yi(this,q)._++,n(this,Fr).call(this,m,p,f),f&&(f.set="add"),h=!1;else{y(this,v,fi).call(this,m);let w=n(this,P)[m];if(e!==w){if(n(this,Pe)&&y(this,v,M).call(this,w)){w.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:O}=w;O!==void 0&&!a&&(n(this,zt)&&((g=n(this,Mt))==null||g.call(this,O,t,"set")),n(this,ht)&&((S=n(this,Z))==null||S.push([O,t,"set"])))}else a||(n(this,zt)&&((C=n(this,Mt))==null||C.call(this,w,t,"set")),n(this,ht)&&((x=n(this,Z))==null||x.push([w,t,"set"])));if(n(this,Je).call(this,m),n(this,Fr).call(this,m,p,f),n(this,P)[m]=e,f){f.set="replace";let O=w&&y(this,v,M).call(this,w)?w.__staleWhileFetching:w;O!==void 0&&(f.oldValue=O)}}else f&&(f.set="update")}if(s!==0&&!n(this,xt)&&y(this,v,sn).call(this),n(this,xt)&&(h||n(this,hi).call(this,m,s,o),f&&n(this,ne).call(this,f,m)),!a&&n(this,ht)&&n(this,Z)){let w=n(this,Z),O;for(;O=w==null?void 0:w.shift();)(E=n(this,It))==null||E.call(this,...O)}return this}pop(){var t;try{for(;n(this,q);){let e=n(this,P)[n(this,it)];if(y(this,v,Bs).call(this,!0),y(this,v,M).call(this,e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(n(this,ht)&&n(this,Z)){let e=n(this,Z),i;for(;i=e==null?void 0:e.shift();)(t=n(this,It))==null||t.call(this,...i)}}}has(t,e={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e,o=n(this,$).get(t);if(o!==void 0){let a=n(this,P)[o];if(y(this,v,M).call(this,a)&&a.__staleWhileFetching===void 0)return!1;if(n(this,wt).call(this,o))s&&(s.has="stale",n(this,ne).call(this,s,o));else return i&&n(this,Ye).call(this,o),s&&(s.has="hit",n(this,ne).call(this,s,o)),!0}else s&&(s.has="miss");return!1}peek(t,e={}){let{allowStale:i=this.allowStale}=e,s=n(this,$).get(t);if(s===void 0||!i&&n(this,wt).call(this,s))return;let o=n(this,P)[s];return y(this,v,M).call(this,o)?o.__staleWhileFetching:o}async fetch(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:f=0,sizeCalculation:h=this.sizeCalculation,noUpdateTTL:p=this.noUpdateTTL,noDeleteOnFetchRejection:m=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:g=this.allowStaleOnFetchRejection,ignoreFetchAbort:S=this.ignoreFetchAbort,allowStaleOnFetchAbort:C=this.allowStaleOnFetchAbort,context:x,forceRefresh:E=!1,status:w,signal:O}=e;if(!n(this,Pe))return w&&(w.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:o,status:w});let k={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:o,ttl:a,noDisposeOnSet:l,size:f,sizeCalculation:h,noUpdateTTL:p,noDeleteOnFetchRejection:m,allowStaleOnFetchRejection:g,allowStaleOnFetchAbort:C,ignoreFetchAbort:S,status:w,signal:O},T=n(this,$).get(t);if(T===void 0){w&&(w.fetch="miss");let D=y(this,v,js).call(this,t,T,k,x);return D.__returned=D}else{let D=n(this,P)[T];if(y(this,v,M).call(this,D)){let Vi=i&&D.__staleWhileFetching!==void 0;return w&&(w.fetch="inflight",Vi&&(w.returnedStale=!0)),Vi?D.__staleWhileFetching:D.__returned=D}let W=n(this,wt).call(this,T);if(!E&&!W)return w&&(w.fetch="hit"),y(this,v,fi).call(this,T),s&&n(this,Ye).call(this,T),w&&n(this,ne).call(this,w,T),D;let _t=y(this,v,js).call(this,t,T,k,x),Rt=_t.__staleWhileFetching!==void 0&&i;return w&&(w.fetch=W?"stale":"refresh",Rt&&W&&(w.returnedStale=!0)),Rt?_t.__staleWhileFetching:_t.__returned=_t}}async forceFetch(t,e={}){let i=await this.fetch(t,e);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(t,e={}){let i=n(this,Pr);if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:o,...a}=e,l=this.get(t,a);if(!o&&l!==void 0)return l;let f=i(t,l,{options:a,context:s});return this.set(t,f,a),f}get(t,e={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:a}=e,l=n(this,$).get(t);if(l!==void 0){let f=n(this,P)[l],h=y(this,v,M).call(this,f);return a&&n(this,ne).call(this,a,l),n(this,wt).call(this,l)?(a&&(a.get="stale"),h?(a&&i&&f.__staleWhileFetching!==void 0&&(a.returnedStale=!0),i?f.__staleWhileFetching:void 0):(o||y(this,v,Re).call(this,t,"expire"),a&&i&&(a.returnedStale=!0),i?f:void 0)):(a&&(a.get="hit"),h?f.__staleWhileFetching:(y(this,v,fi).call(this,l),s&&n(this,Ye).call(this,l),f))}else a&&(a.get="miss")}delete(t){return y(this,v,Re).call(this,t,"delete")}clear(){return y(this,v,an).call(this,"delete")}};Lt=new WeakMap,gt=new WeakMap,Mt=new WeakMap,It=new WeakMap,Rr=new WeakMap,Pr=new WeakMap,q=new WeakMap,Nt=new WeakMap,$=new WeakMap,I=new WeakMap,P=new WeakMap,lt=new WeakMap,yt=new WeakMap,it=new WeakMap,V=new WeakMap,Bt=new WeakMap,Z=new WeakMap,jt=new WeakMap,Wt=new WeakMap,xt=new WeakMap,zt=new WeakMap,Pe=new WeakMap,ht=new WeakMap,v=new WeakSet,sn=function(){let t=new Tr(n(this,Lt)),e=new Tr(n(this,Lt));c(this,xt,t),c(this,Wt,e),c(this,hi,(o,a,l=kr.now())=>{if(e[o]=a!==0?l:0,t[o]=a,a!==0&&this.ttlAutopurge){let f=setTimeout(()=>{n(this,wt).call(this,o)&&y(this,v,Re).call(this,n(this,I)[o],"expire")},a+1);f.unref&&f.unref()}}),c(this,Ye,o=>{e[o]=t[o]!==0?kr.now():0}),c(this,ne,(o,a)=>{if(t[a]){let l=t[a],f=e[a];if(!l||!f)return;o.ttl=l,o.start=f,o.now=i||s();let h=o.now-f;o.remainingTTL=l-h}});let i=0,s=()=>{let o=kr.now();if(this.ttlResolution>0){i=o;let a=setTimeout(()=>i=0,this.ttlResolution);a.unref&&a.unref()}return o};this.getRemainingTTL=o=>{let a=n(this,$).get(o);if(a===void 0)return 0;let l=t[a],f=e[a];if(!l||!f)return 1/0;let h=(i||s())-f;return l-h},c(this,wt,o=>{let a=e[o],l=t[o];return!!l&&!!a&&(i||s())-a>l})},Ye=new WeakMap,ne=new WeakMap,hi=new WeakMap,wt=new WeakMap,Gu=function(){let t=new Tr(n(this,Lt));c(this,Nt,0),c(this,jt,t),c(this,Je,e=>{c(this,Nt,n(this,Nt)-t[e]),t[e]=0}),c(this,ui,(e,i,s,o)=>{if(y(this,v,M).call(this,i))return 0;if(!ke(s))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(s=o(i,e),!ke(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s}),c(this,Fr,(e,i,s)=>{if(t[e]=i,n(this,gt)){let o=n(this,gt)-t[e];for(;n(this,Nt)>o;)y(this,v,Bs).call(this,!0)}c(this,Nt,n(this,Nt)+t[e]),s&&(s.entrySize=i,s.totalCalculatedSize=n(this,Nt))})},Je=new WeakMap,Fr=new WeakMap,ui=new WeakMap,Te=function*({allowStale:t=this.allowStale}={}){if(n(this,q))for(let e=n(this,V);!(!y(this,v,on).call(this,e)||((t||!n(this,wt).call(this,e))&&(yield e),e===n(this,it)));)e=n(this,yt)[e]},_e=function*({allowStale:t=this.allowStale}={}){if(n(this,q))for(let e=n(this,it);!(!y(this,v,on).call(this,e)||((t||!n(this,wt).call(this,e))&&(yield e),e===n(this,V)));)e=n(this,lt)[e]},on=function(t){return t!==void 0&&n(this,$).get(n(this,I)[t])===t},Bs=function(t){var o,a;let e=n(this,it),i=n(this,I)[e],s=n(this,P)[e];return n(this,Pe)&&y(this,v,M).call(this,s)?s.__abortController.abort(new Error("evicted")):(n(this,zt)||n(this,ht))&&(n(this,zt)&&((o=n(this,Mt))==null||o.call(this,s,i,"evict")),n(this,ht)&&((a=n(this,Z))==null||a.push([s,i,"evict"]))),n(this,Je).call(this,e),t&&(n(this,I)[e]=void 0,n(this,P)[e]=void 0,n(this,Bt).push(e)),n(this,q)===1?(c(this,it,c(this,V,0)),n(this,Bt).length=0):c(this,it,n(this,lt)[e]),n(this,$).delete(i),Yi(this,q)._--,e},js=function(t,e,i,s){let o=e===void 0?void 0:n(this,P)[e];if(y(this,v,M).call(this,o))return o;let a=new Ws,{signal:l}=i;l==null||l.addEventListener("abort",()=>a.abort(l.reason),{signal:a.signal});let f={signal:a.signal,options:i,context:s},h=(x,E=!1)=>{let{aborted:w}=a.signal,O=i.ignoreFetchAbort&&x!==void 0;if(i.status&&(w&&!E?(i.status.fetchAborted=!0,i.status.fetchError=a.signal.reason,O&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),w&&!O&&!E)return m(a.signal.reason);let k=S;return n(this,P)[e]===S&&(x===void 0?k.__staleWhileFetching?n(this,P)[e]=k.__staleWhileFetching:y(this,v,Re).call(this,t,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(t,x,f.options))),x},p=x=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=x),m(x)),m=x=>{let{aborted:E}=a.signal,w=E&&i.allowStaleOnFetchAbort,O=w||i.allowStaleOnFetchRejection,k=O||i.noDeleteOnFetchRejection,T=S;if(n(this,P)[e]===S&&(!k||T.__staleWhileFetching===void 0?y(this,v,Re).call(this,t,"fetch"):w||(n(this,P)[e]=T.__staleWhileFetching)),O)return i.status&&T.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),T.__staleWhileFetching;if(T.__returned===T)throw x},g=(x,E)=>{var O;let w=(O=n(this,Rr))==null?void 0:O.call(this,t,o,f);w&&w instanceof Promise&&w.then(k=>x(k===void 0?void 0:k),E),a.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(x(void 0),i.allowStaleOnFetchAbort&&(x=k=>h(k,!0)))})};i.status&&(i.status.fetchDispatched=!0);let S=new Promise(g).then(h,p),C=Object.assign(S,{__abortController:a,__staleWhileFetching:o,__returned:void 0});return e===void 0?(this.set(t,C,{...f.options,status:void 0}),e=n(this,$).get(t)):n(this,P)[e]=C,C},M=function(t){if(!n(this,Pe))return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof Ws},nn=function(t,e){n(this,yt)[e]=t,n(this,lt)[t]=e},fi=function(t){t!==n(this,V)&&(t===n(this,it)?c(this,it,n(this,lt)[t]):y(this,v,nn).call(this,n(this,yt)[t],n(this,lt)[t]),y(this,v,nn).call(this,n(this,V),t),c(this,V,t))},Re=function(t,e){var s,o,a,l;let i=!1;if(n(this,q)!==0){let f=n(this,$).get(t);if(f!==void 0)if(i=!0,n(this,q)===1)y(this,v,an).call(this,e);else{n(this,Je).call(this,f);let h=n(this,P)[f];if(y(this,v,M).call(this,h)?h.__abortController.abort(new Error("deleted")):(n(this,zt)||n(this,ht))&&(n(this,zt)&&((s=n(this,Mt))==null||s.call(this,h,t,e)),n(this,ht)&&((o=n(this,Z))==null||o.push([h,t,e]))),n(this,$).delete(t),n(this,I)[f]=void 0,n(this,P)[f]=void 0,f===n(this,V))c(this,V,n(this,yt)[f]);else if(f===n(this,it))c(this,it,n(this,lt)[f]);else{let p=n(this,yt)[f];n(this,lt)[p]=n(this,lt)[f];let m=n(this,lt)[f];n(this,yt)[m]=n(this,yt)[f]}Yi(this,q)._--,n(this,Bt).push(f)}}if(n(this,ht)&&((a=n(this,Z))!=null&&a.length)){let f=n(this,Z),h;for(;h=f==null?void 0:f.shift();)(l=n(this,It))==null||l.call(this,...h)}return i},an=function(t){var e,i,s;for(let o of y(this,v,_e).call(this,{allowStale:!0})){let a=n(this,P)[o];if(y(this,v,M).call(this,a))a.__abortController.abort(new Error("deleted"));else{let l=n(this,I)[o];n(this,zt)&&((e=n(this,Mt))==null||e.call(this,a,l,t)),n(this,ht)&&((i=n(this,Z))==null||i.push([a,l,t]))}}if(n(this,$).clear(),n(this,P).fill(void 0),n(this,I).fill(void 0),n(this,xt)&&n(this,Wt)&&(n(this,xt).fill(0),n(this,Wt).fill(0)),n(this,jt)&&n(this,jt).fill(0),c(this,it,0),c(this,V,0),n(this,Bt).length=0,c(this,Nt,0),c(this,q,0),n(this,ht)&&n(this,Z)){let o=n(this,Z),a;for(;a=o==null?void 0:o.shift();)(s=n(this,It))==null||s.call(this,...a)}};var li=fn;var jr=require("path"),xc=require("url"),te=require("fs"),xw=ze(require("fs"),1),Me=require("fs/promises");var Ks=require("events"),mn=ze(require("stream"),1),pc=require("string_decoder");var $u=typeof process=="object"&&process?process:{stdout:null,stderr:null},lw=r=>!!r&&typeof r=="object"&&(r instanceof De||r instanceof mn.default||hw(r)||uw(r)),hw=r=>!!r&&typeof r=="object"&&r instanceof Ks.EventEmitter&&typeof r.pipe=="function"&&r.pipe!==mn.default.Writable.prototype.pipe,uw=r=>!!r&&typeof r=="object"&&r instanceof Ks.EventEmitter&&typeof r.write=="function"&&typeof r.end=="function",ae=Symbol("EOF"),fe=Symbol("maybeEmitEnd"),Fe=Symbol("emittedEnd"),zs=Symbol("emittingEnd"),ci=Symbol("emittedError"),Us=Symbol("closed"),Hu=Symbol("read"),Gs=Symbol("flush"),qu=Symbol("flushChunk"),Ut=Symbol("encoding"),Dr=Symbol("decoder"),Y=Symbol("flowing"),pi=Symbol("paused"),Lr=Symbol("resume"),J=Symbol("buffer"),ut=Symbol("pipes"),X=Symbol("bufferLength"),ln=Symbol("bufferPush"),$s=Symbol("bufferShift"),st=Symbol("objectMode"),j=Symbol("destroyed"),hn=Symbol("error"),un=Symbol("emitData"),Ku=Symbol("emitEnd"),cn=Symbol("emitEnd2"),Zt=Symbol("async"),pn=Symbol("abort"),Hs=Symbol("aborted"),di=Symbol("signal"),Xe=Symbol("dataListeners"),bt=Symbol("discarded"),mi=r=>Promise.resolve().then(r),cw=r=>r(),pw=r=>r==="end"||r==="finish"||r==="prefinish",dw=r=>r instanceof ArrayBuffer||!!r&&typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,mw=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),qs=class{constructor(t,e,i){d(this,"src");d(this,"dest");d(this,"opts");d(this,"ondrain");this.src=t,this.dest=e,this.opts=i,this.ondrain=()=>t[Lr](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},dn=class extends qs{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,e,i){super(t,e,i),this.proxyErrors=s=>e.emit("error",s),t.on("error",this.proxyErrors)}},gw=r=>!!r.objectMode,yw=r=>!r.objectMode&&!!r.encoding&&r.encoding!=="buffer",Qu,Vu,Zu,Yu,Ju,Xu,tc,ec,rc,ic,sc,oc,nc,ac,fc,lc,hc,uc,cc,De=class extends Ks.EventEmitter{constructor(...e){let i=e[0]||{};super();d(this,cc,!1);d(this,uc,!1);d(this,hc,[]);d(this,lc,[]);d(this,fc);d(this,ac);d(this,nc);d(this,oc);d(this,sc,!1);d(this,ic,!1);d(this,rc,!1);d(this,ec,!1);d(this,tc,null);d(this,Xu,0);d(this,Ju,!1);d(this,Yu);d(this,Zu,!1);d(this,Vu,0);d(this,Qu,!1);d(this,"writable",!0);d(this,"readable",!0);if(i.objectMode&&typeof i.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");gw(i)?(this[st]=!0,this[Ut]=null):yw(i)?(this[Ut]=i.encoding,this[st]=!1):(this[st]=!1,this[Ut]=null),this[Zt]=!!i.async,this[Dr]=this[Ut]?new pc.StringDecoder(this[Ut]):null,i&&i.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[J]}),i&&i.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[ut]});let{signal:s}=i;s&&(this[di]=s,s.aborted?this[pn]():s.addEventListener("abort",()=>this[pn]()))}get bufferLength(){return this[X]}get encoding(){return this[Ut]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[st]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Zt]}set async(e){this[Zt]=this[Zt]||!!e}[(cc=Y,uc=pi,hc=ut,lc=J,fc=st,ac=Ut,nc=Zt,oc=Dr,sc=ae,ic=Fe,rc=zs,ec=Us,tc=ci,Xu=X,Ju=j,Yu=di,Zu=Hs,Vu=Xe,Qu=bt,pn)](){var e,i;this[Hs]=!0,this.emit("abort",(e=this[di])==null?void 0:e.reason),this.destroy((i=this[di])==null?void 0:i.reason)}get aborted(){return this[Hs]}set aborted(e){}write(e,i,s){var a;if(this[Hs])return!1;if(this[ae])throw new Error("write after end");if(this[j])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof i=="function"&&(s=i,i="utf8"),i||(i="utf8");let o=this[Zt]?mi:cw;if(!this[st]&&!Buffer.isBuffer(e)){if(mw(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(dw(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[st]?(this[Y]&&this[X]!==0&&this[Gs](!0),this[Y]?this.emit("data",e):this[ln](e),this[X]!==0&&this.emit("readable"),s&&o(s),this[Y]):e.length?(typeof e=="string"&&!(i===this[Ut]&&!((a=this[Dr])!=null&&a.lastNeed))&&(e=Buffer.from(e,i)),Buffer.isBuffer(e)&&this[Ut]&&(e=this[Dr].write(e)),this[Y]&&this[X]!==0&&this[Gs](!0),this[Y]?this.emit("data",e):this[ln](e),this[X]!==0&&this.emit("readable"),s&&o(s),this[Y]):(this[X]!==0&&this.emit("readable"),s&&o(s),this[Y])}read(e){if(this[j])return null;if(this[bt]=!1,this[X]===0||e===0||e&&e>this[X])return this[fe](),null;this[st]&&(e=null),this[J].length>1&&!this[st]&&(this[J]=[this[Ut]?this[J].join(""):Buffer.concat(this[J],this[X])]);let i=this[Hu](e||null,this[J][0]);return this[fe](),i}[Hu](e,i){if(this[st])this[$s]();else{let s=i;e===s.length||e===null?this[$s]():typeof s=="string"?(this[J][0]=s.slice(e),i=s.slice(0,e),this[X]-=e):(this[J][0]=s.subarray(e),i=s.subarray(0,e),this[X]-=e)}return this.emit("data",i),!this[J].length&&!this[ae]&&this.emit("drain"),i}end(e,i,s){return typeof e=="function"&&(s=e,e=void 0),typeof i=="function"&&(s=i,i="utf8"),e!==void 0&&this.write(e,i),s&&this.once("end",s),this[ae]=!0,this.writable=!1,(this[Y]||!this[pi])&&this[fe](),this}[Lr](){this[j]||(!this[Xe]&&!this[ut].length&&(this[bt]=!0),this[pi]=!1,this[Y]=!0,this.emit("resume"),this[J].length?this[Gs]():this[ae]?this[fe]():this.emit("drain"))}resume(){return this[Lr]()}pause(){this[Y]=!1,this[pi]=!0,this[bt]=!1}get destroyed(){return this[j]}get flowing(){return this[Y]}get paused(){return this[pi]}[ln](e){this[st]?this[X]+=1:this[X]+=e.length,this[J].push(e)}[$s](){return this[st]?this[X]-=1:this[X]-=this[J][0].length,this[J].shift()}[Gs](e=!1){do;while(this[qu](this[$s]())&&this[J].length);!e&&!this[J].length&&!this[ae]&&this.emit("drain")}[qu](e){return this.emit("data",e),this[Y]}pipe(e,i){if(this[j])return e;this[bt]=!1;let s=this[Fe];return i=i||{},e===$u.stdout||e===$u.stderr?i.end=!1:i.end=i.end!==!1,i.proxyErrors=!!i.proxyErrors,s?i.end&&e.end():(this[ut].push(i.proxyErrors?new dn(this,e,i):new qs(this,e,i)),this[Zt]?mi(()=>this[Lr]()):this[Lr]()),e}unpipe(e){let i=this[ut].find(s=>s.dest===e);i&&(this[ut].length===1?(this[Y]&&this[Xe]===0&&(this[Y]=!1),this[ut]=[]):this[ut].splice(this[ut].indexOf(i),1),i.unpipe())}addListener(e,i){return this.on(e,i)}on(e,i){let s=super.on(e,i);if(e==="data")this[bt]=!1,this[Xe]++,!this[ut].length&&!this[Y]&&this[Lr]();else if(e==="readable"&&this[X]!==0)super.emit("readable");else if(pw(e)&&this[Fe])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[ci]){let o=i;this[Zt]?mi(()=>o.call(this,this[ci])):o.call(this,this[ci])}return s}removeListener(e,i){return this.off(e,i)}off(e,i){let s=super.off(e,i);return e==="data"&&(this[Xe]=this.listeners("data").length,this[Xe]===0&&!this[bt]&&!this[ut].length&&(this[Y]=!1)),s}removeAllListeners(e){let i=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Xe]=0,!this[bt]&&!this[ut].length&&(this[Y]=!1)),i}get emittedEnd(){return this[Fe]}[fe](){!this[zs]&&!this[Fe]&&!this[j]&&this[J].length===0&&this[ae]&&(this[zs]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Us]&&this.emit("close"),this[zs]=!1)}emit(e,...i){let s=i[0];if(e!=="error"&&e!=="close"&&e!==j&&this[j])return!1;if(e==="data")return!this[st]&&!s?!1:this[Zt]?(mi(()=>this[un](s)),!0):this[un](s);if(e==="end")return this[Ku]();if(e==="close"){if(this[Us]=!0,!this[Fe]&&!this[j])return!1;let a=super.emit("close");return this.removeAllListeners("close"),a}else if(e==="error"){this[ci]=s,super.emit(hn,s);let a=!this[di]||this.listeners("error").length?super.emit("error",s):!1;return this[fe](),a}else if(e==="resume"){let a=super.emit("resume");return this[fe](),a}else if(e==="finish"||e==="prefinish"){let a=super.emit(e);return this.removeAllListeners(e),a}let o=super.emit(e,...i);return this[fe](),o}[un](e){for(let s of this[ut])s.dest.write(e)===!1&&this.pause();let i=this[bt]?!1:super.emit("data",e);return this[fe](),i}[Ku](){return this[Fe]?!1:(this[Fe]=!0,this.readable=!1,this[Zt]?(mi(()=>this[cn]()),!0):this[cn]())}[cn](){if(this[Dr]){let i=this[Dr].end();if(i){for(let s of this[ut])s.dest.write(i);this[bt]||super.emit("data",i)}}for(let i of this[ut])i.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[st]||(e.dataLength=0);let i=this.promise();return this.on("data",s=>{e.push(s),this[st]||(e.dataLength+=s.length)}),await i,e}async concat(){if(this[st])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Ut]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,i)=>{this.on(j,()=>i(new Error("stream destroyed"))),this.on("error",s=>i(s)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[bt]=!1;let e=!1,i=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return i();let o=this.read();if(o!==null)return Promise.resolve({done:!1,value:o});if(this[ae])return i();let a,l,f=g=>{this.off("data",h),this.off("end",p),this.off(j,m),i(),l(g)},h=g=>{this.off("error",f),this.off("end",p),this.off(j,m),this.pause(),a({value:g,done:!!this[ae]})},p=()=>{this.off("error",f),this.off("data",h),this.off(j,m),i(),a({done:!0,value:void 0})},m=()=>f(new Error("stream destroyed"));return new Promise((g,S)=>{l=S,a=g,this.once(j,m),this.once("error",f),this.once("end",p),this.once("data",h)})},throw:i,return:i,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[bt]=!1;let e=!1,i=()=>(this.pause(),this.off(hn,i),this.off(j,i),this.off("end",i),e=!0,{done:!0,value:void 0}),s=()=>{if(e)return i();let o=this.read();return o===null?i():{done:!1,value:o}};return this.once("end",i),this.once(hn,i),this.once(j,i),{next:s,throw:i,return:i,[Symbol.iterator](){return this}}}destroy(e){if(this[j])return e?this.emit("error",e):this.emit(j),this;this[j]=!0,this[bt]=!0,this[J].length=0,this[X]=0;let i=this;return typeof i.close=="function"&&!this[Us]&&i.close(),e?this.emit("error",e):this.emit(j),this}static get isStream(){return lw}};var ww=te.realpathSync.native,yi={lstatSync:te.lstatSync,readdir:te.readdir,readdirSync:te.readdirSync,readlinkSync:te.readlinkSync,realpathSync:ww,promises:{lstat:Me.lstat,readdir:Me.readdir,readlink:Me.readlink,realpath:Me.realpath}},wc=r=>!r||r===yi||r===xw?yi:{...yi,...r,promises:{...yi.promises,...r.promises||{}}},bc=/^\\\\\?\\([a-z]:)\\?$/i,bw=r=>r.replace(/\//g,"\\").replace(bc,"$1\\"),Sw=/[\\\/]/,kt=0,Sc=1,vc=2,Yt=4,Cc=6,Ec=8,tr=10,Oc=12,At=15,gi=~At,gn=16,dc=32,xi=64,Gt=128,Qs=256,Zs=512,mc=xi|Gt|Zs,vw=1023,yn=r=>r.isFile()?Ec:r.isDirectory()?Yt:r.isSymbolicLink()?tr:r.isCharacterDevice()?vc:r.isBlockDevice()?Cc:r.isSocket()?Oc:r.isFIFO()?Sc:kt,gc=new Map,wi=r=>{let t=gc.get(r);if(t)return t;let e=r.normalize("NFKD");return gc.set(r,e),e},yc=new Map,Vs=r=>{let t=yc.get(r);if(t)return t;let e=wi(r.toLowerCase());return yc.set(r,e),e},to=class extends li{constructor(){super({max:256})}},xn=class extends li{constructor(t=16*1024){super({maxSize:t,sizeCalculation:e=>e.length+1})}},Ac=Symbol("PathScurry setAsCwd"),ct,Ci,Ei,Oi,Ai,ki,Ti,_i,Ri,Pi,Fi,Di,Li,Mi,Ii,Ni,Bi,ji,Wi,Le,er,Jt,le,he,ue,_,rr,ce,Xt,A,wn,Ys,bi,bn,Sn,Si,Js,vn,Cn,Xs,kc,Tc,_c,En,Mr,Ir,Rc,ir,ot=class{constructor(t,e=kt,i,s,o,a,l){b(this,A);d(this,"name");d(this,"root");d(this,"roots");d(this,"parent");d(this,"nocase");d(this,"isCWD",!1);b(this,ct);b(this,Ci);b(this,Ei);b(this,Oi);b(this,Ai);b(this,ki);b(this,Ti);b(this,_i);b(this,Ri);b(this,Pi);b(this,Fi);b(this,Di);b(this,Li);b(this,Mi);b(this,Ii);b(this,Ni);b(this,Bi);b(this,ji);b(this,Wi);b(this,Le);b(this,er);b(this,Jt);b(this,le);b(this,he);b(this,ue);b(this,_);b(this,rr);b(this,ce);b(this,Xt);b(this,Mr,[]);b(this,Ir,!1);b(this,ir);this.name=t,c(this,Le,o?Vs(t):wi(t)),c(this,_,e&vw),this.nocase=o,this.roots=s,this.root=i||this,c(this,rr,a),c(this,Jt,l.fullpath),c(this,he,l.relative),c(this,ue,l.relativePosix),this.parent=l.parent,this.parent?c(this,ct,n(this.parent,ct)):c(this,ct,wc(l.fs))}get dev(){return n(this,Ci)}get mode(){return n(this,Ei)}get nlink(){return n(this,Oi)}get uid(){return n(this,Ai)}get gid(){return n(this,ki)}get rdev(){return n(this,Ti)}get blksize(){return n(this,_i)}get ino(){return n(this,Ri)}get size(){return n(this,Pi)}get blocks(){return n(this,Fi)}get atimeMs(){return n(this,Di)}get mtimeMs(){return n(this,Li)}get ctimeMs(){return n(this,Mi)}get birthtimeMs(){return n(this,Ii)}get atime(){return n(this,Ni)}get mtime(){return n(this,Bi)}get ctime(){return n(this,ji)}get birthtime(){return n(this,Wi)}get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}depth(){return n(this,er)!==void 0?n(this,er):this.parent?c(this,er,this.parent.depth()+1):c(this,er,0)}childrenCache(){return n(this,rr)}resolve(t){var a;if(!t)return this;let e=this.getRootString(t),s=t.substring(e.length).split(this.splitSep);return e?y(a=this.getRoot(e),A,wn).call(a,s):y(this,A,wn).call(this,s)}children(){let t=n(this,rr).get(this);if(t)return t;let e=Object.assign([],{provisional:0});return n(this,rr).set(this,e),c(this,_,n(this,_)&~gn),e}child(t,e){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let i=this.children(),s=this.nocase?Vs(t):wi(t);for(let f of i)if(n(f,Le)===s)return f;let o=this.parent?this.sep:"",a=n(this,Jt)?n(this,Jt)+o+t:void 0,l=this.newChild(t,kt,{...e,parent:this,fullpath:a});return this.canReaddir()||c(l,_,n(l,_)|Gt),i.push(l),l}relative(){if(this.isCWD)return"";if(n(this,he)!==void 0)return n(this,he);let t=this.name,e=this.parent;if(!e)return c(this,he,this.name);let i=e.relative();return i+(!i||!e.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(n(this,ue)!==void 0)return n(this,ue);let t=this.name,e=this.parent;if(!e)return c(this,ue,this.fullpathPosix());let i=e.relativePosix();return i+(!i||!e.parent?"":"/")+t}fullpath(){if(n(this,Jt)!==void 0)return n(this,Jt);let t=this.name,e=this.parent;if(!e)return c(this,Jt,this.name);let s=e.fullpath()+(e.parent?this.sep:"")+t;return c(this,Jt,s)}fullpathPosix(){if(n(this,le)!==void 0)return n(this,le);if(this.sep==="/")return c(this,le,this.fullpath());if(!this.parent){let s=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(s)?c(this,le,`//?/${s}`):c(this,le,s)}let t=this.parent,e=t.fullpathPosix(),i=e+(!e||!t.parent?"":"/")+this.name;return c(this,le,i)}isUnknown(){return(n(this,_)&At)===kt}isType(t){return this[`is${t}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(n(this,_)&At)===Ec}isDirectory(){return(n(this,_)&At)===Yt}isCharacterDevice(){return(n(this,_)&At)===vc}isBlockDevice(){return(n(this,_)&At)===Cc}isFIFO(){return(n(this,_)&At)===Sc}isSocket(){return(n(this,_)&At)===Oc}isSymbolicLink(){return(n(this,_)&tr)===tr}lstatCached(){return n(this,_)&dc?this:void 0}readlinkCached(){return n(this,ce)}realpathCached(){return n(this,Xt)}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(n(this,ce))return!0;if(!this.parent)return!1;let t=n(this,_)&At;return!(t!==kt&&t!==tr||n(this,_)&Qs||n(this,_)&Gt)}calledReaddir(){return!!(n(this,_)&gn)}isENOENT(){return!!(n(this,_)&Gt)}isNamed(t){return this.nocase?n(this,Le)===Vs(t):n(this,Le)===wi(t)}async readlink(){var e;let t=n(this,ce);if(t)return t;if(this.canReadlink()&&this.parent)try{let i=await n(this,ct).promises.readlink(this.fullpath()),s=(e=await this.parent.realpath())==null?void 0:e.resolve(i);if(s)return c(this,ce,s)}catch(i){y(this,A,Cn).call(this,i.code);return}}readlinkSync(){var e;let t=n(this,ce);if(t)return t;if(this.canReadlink()&&this.parent)try{let i=n(this,ct).readlinkSync(this.fullpath()),s=(e=this.parent.realpathSync())==null?void 0:e.resolve(i);if(s)return c(this,ce,s)}catch(i){y(this,A,Cn).call(this,i.code);return}}async lstat(){if(!(n(this,_)&Gt))try{return y(this,A,En).call(this,await n(this,ct).promises.lstat(this.fullpath())),this}catch(t){y(this,A,vn).call(this,t.code)}}lstatSync(){if(!(n(this,_)&Gt))try{return y(this,A,En).call(this,n(this,ct).lstatSync(this.fullpath())),this}catch(t){y(this,A,vn).call(this,t.code)}}readdirCB(t,e=!1){if(!this.canReaddir()){e?t(null,[]):queueMicrotask(()=>t(null,[]));return}let i=this.children();if(this.calledReaddir()){let o=i.slice(0,i.provisional);e?t(null,o):queueMicrotask(()=>t(null,o));return}if(n(this,Mr).push(t),n(this,Ir))return;c(this,Ir,!0);let s=this.fullpath();n(this,ct).readdir(s,{withFileTypes:!0},(o,a)=>{if(o)y(this,A,Js).call(this,o.code),i.provisional=0;else{for(let l of a)y(this,A,Xs).call(this,l,i);y(this,A,Ys).call(this,i)}y(this,A,Rc).call(this,i.slice(0,i.provisional))})}async readdir(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();if(n(this,ir))await n(this,ir);else{let i=()=>{};c(this,ir,new Promise(s=>i=s));try{for(let s of await n(this,ct).promises.readdir(e,{withFileTypes:!0}))y(this,A,Xs).call(this,s,t);y(this,A,Ys).call(this,t)}catch(s){y(this,A,Js).call(this,s.code),t.provisional=0}c(this,ir,void 0),i()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();try{for(let i of n(this,ct).readdirSync(e,{withFileTypes:!0}))y(this,A,Xs).call(this,i,t);y(this,A,Ys).call(this,t)}catch(i){y(this,A,Js).call(this,i.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(n(this,_)&mc)return!1;let t=At&n(this,_);return t===kt||t===Yt||t===tr}shouldWalk(t,e){return(n(this,_)&Yt)===Yt&&!(n(this,_)&mc)&&!t.has(this)&&(!e||e(this))}async realpath(){if(n(this,Xt))return n(this,Xt);if(!((Zs|Qs|Gt)&n(this,_)))try{let t=await n(this,ct).promises.realpath(this.fullpath());return c(this,Xt,this.resolve(t))}catch(t){y(this,A,Sn).call(this)}}realpathSync(){if(n(this,Xt))return n(this,Xt);if(!((Zs|Qs|Gt)&n(this,_)))try{let t=n(this,ct).realpathSync(this.fullpath());return c(this,Xt,this.resolve(t))}catch(t){y(this,A,Sn).call(this)}}[Ac](t){if(t===this)return;t.isCWD=!1,this.isCWD=!0;let e=new Set([]),i=[],s=this;for(;s&&s.parent;)e.add(s),c(s,he,i.join(this.sep)),c(s,ue,i.join("/")),s=s.parent,i.push("..");for(s=t;s&&s.parent&&!e.has(s);)c(s,he,void 0),c(s,ue,void 0),s=s.parent}};ct=new WeakMap,Ci=new WeakMap,Ei=new WeakMap,Oi=new WeakMap,Ai=new WeakMap,ki=new WeakMap,Ti=new WeakMap,_i=new WeakMap,Ri=new WeakMap,Pi=new WeakMap,Fi=new WeakMap,Di=new WeakMap,Li=new WeakMap,Mi=new WeakMap,Ii=new WeakMap,Ni=new WeakMap,Bi=new WeakMap,ji=new WeakMap,Wi=new WeakMap,Le=new WeakMap,er=new WeakMap,Jt=new WeakMap,le=new WeakMap,he=new WeakMap,ue=new WeakMap,_=new WeakMap,rr=new WeakMap,ce=new WeakMap,Xt=new WeakMap,A=new WeakSet,wn=function(t){let e=this;for(let i of t)e=e.child(i);return e},Ys=function(t){var e;c(this,_,n(this,_)|gn);for(let i=t.provisional;i<t.length;i++){let s=t[i];s&&y(e=s,A,bi).call(e)}},bi=function(){n(this,_)&Gt||(c(this,_,(n(this,_)|Gt)&gi),y(this,A,bn).call(this))},bn=function(){var e;let t=this.children();t.provisional=0;for(let i of t)y(e=i,A,bi).call(e)},Sn=function(){c(this,_,n(this,_)|Zs),y(this,A,Si).call(this)},Si=function(){if(n(this,_)&xi)return;let t=n(this,_);(t&At)===Yt&&(t&=gi),c(this,_,t|xi),y(this,A,bn).call(this)},Js=function(t=""){t==="ENOTDIR"||t==="EPERM"?y(this,A,Si).call(this):t==="ENOENT"?y(this,A,bi).call(this):this.children().provisional=0},vn=function(t=""){var e;if(t==="ENOTDIR"){let i=this.parent;y(e=i,A,Si).call(e)}else t==="ENOENT"&&y(this,A,bi).call(this)},Cn=function(t=""){var i;let e=n(this,_);e|=Qs,t==="ENOENT"&&(e|=Gt),(t==="EINVAL"||t==="UNKNOWN")&&(e&=gi),c(this,_,e),t==="ENOTDIR"&&this.parent&&y(i=this.parent,A,Si).call(i)},Xs=function(t,e){return y(this,A,Tc).call(this,t,e)||y(this,A,kc).call(this,t,e)},kc=function(t,e){let i=yn(t),s=this.newChild(t.name,i,{parent:this}),o=n(s,_)&At;return o!==Yt&&o!==tr&&o!==kt&&c(s,_,n(s,_)|xi),e.unshift(s),e.provisional++,s},Tc=function(t,e){for(let i=e.provisional;i<e.length;i++){let s=e[i];if((this.nocase?Vs(t.name):wi(t.name))===n(s,Le))return y(this,A,_c).call(this,t,s,i,e)}},_c=function(t,e,i,s){let o=e.name;return c(e,_,n(e,_)&gi|yn(t)),o!==t.name&&(e.name=t.name),i!==s.provisional&&(i===s.length-1?s.pop():s.splice(i,1),s.unshift(e)),s.provisional++,e},En=function(t){let{atime:e,atimeMs:i,birthtime:s,birthtimeMs:o,blksize:a,blocks:l,ctime:f,ctimeMs:h,dev:p,gid:m,ino:g,mode:S,mtime:C,mtimeMs:x,nlink:E,rdev:w,size:O,uid:k}=t;c(this,Ni,e),c(this,Di,i),c(this,Wi,s),c(this,Ii,o),c(this,_i,a),c(this,Fi,l),c(this,ji,f),c(this,Mi,h),c(this,Ci,p),c(this,ki,m),c(this,Ri,g),c(this,Ei,S),c(this,Bi,C),c(this,Li,x),c(this,Oi,E),c(this,Ti,w),c(this,Pi,O),c(this,Ai,k);let T=yn(t);c(this,_,n(this,_)&gi|T|dc),T!==kt&&T!==Yt&&T!==tr&&c(this,_,n(this,_)|xi)},Mr=new WeakMap,Ir=new WeakMap,Rc=function(t){c(this,Ir,!1);let e=n(this,Mr).slice();n(this,Mr).length=0,e.forEach(i=>i(null,t))},ir=new WeakMap;var eo=class r extends ot{constructor(e,i=kt,s,o,a,l,f){super(e,i,s,o,a,l,f);d(this,"sep","\\");d(this,"splitSep",Sw)}newChild(e,i=kt,s={}){return new r(e,i,this.root,this.roots,this.nocase,this.childrenCache(),s)}getRootString(e){return jr.win32.parse(e).root}getRoot(e){if(e=bw(e.toUpperCase()),e===this.root.name)return this.root;for(let[i,s]of Object.entries(this.roots))if(this.sameRoot(e,i))return this.roots[e]=s;return this.roots[e]=new Wr(e,this).root}sameRoot(e,i=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(bc,"$1\\"),e===i}},ro=class r extends ot{constructor(e,i=kt,s,o,a,l,f){super(e,i,s,o,a,l,f);d(this,"splitSep","/");d(this,"sep","/")}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,i=kt,s={}){return new r(e,i,this.root,this.roots,this.nocase,this.childrenCache(),s)}},Nr,Br,zi,Ui,io=class{constructor(t=process.cwd(),e,i,{nocase:s,childrenCacheSize:o=16*1024,fs:a=yi}={}){d(this,"root");d(this,"rootPath");d(this,"roots");d(this,"cwd");b(this,Nr);b(this,Br);b(this,zi);d(this,"nocase");b(this,Ui);c(this,Ui,wc(a)),(t instanceof URL||t.startsWith("file://"))&&(t=(0,xc.fileURLToPath)(t));let l=e.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(l),c(this,Nr,new to),c(this,Br,new to),c(this,zi,new xn(o));let f=l.substring(this.rootPath.length).split(i);if(f.length===1&&!f[0]&&f.pop(),s===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=s,this.root=this.newRoot(n(this,Ui)),this.roots[this.rootPath]=this.root;let h=this.root,p=f.length-1,m=e.sep,g=this.rootPath,S=!1;for(let C of f){let x=p--;h=h.child(C,{relative:new Array(x).fill("..").join(m),relativePosix:new Array(x).fill("..").join("/"),fullpath:g+=(S?"":m)+C}),S=!0}this.cwd=h}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return n(this,zi)}resolve(...t){let e="";for(let o=t.length-1;o>=0;o--){let a=t[o];if(!(!a||a===".")&&(e=e?`${a}/${e}`:a,this.isAbsolute(a)))break}let i=n(this,Nr).get(e);if(i!==void 0)return i;let s=this.cwd.resolve(e).fullpath();return n(this,Nr).set(e,s),s}resolvePosix(...t){let e="";for(let o=t.length-1;o>=0;o--){let a=t[o];if(!(!a||a===".")&&(e=e?`${a}/${e}`:a,this.isAbsolute(a)))break}let i=n(this,Br).get(e);if(i!==void 0)return i;let s=this.cwd.resolve(e).fullpathPosix();return n(this,Br).set(e,s),s}relative(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof ot||(e=t,t=this.cwd);let{withFileTypes:i}=e;if(t.canReaddir()){let s=await t.readdir();return i?s:s.map(o=>o.name)}else return[]}readdirSync(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof ot||(e=t,t=this.cwd);let{withFileTypes:i=!0}=e;return t.canReaddir()?i?t.readdirSync():t.readdirSync().map(s=>s.name):[]}async lstat(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof ot||(e=t.withFileTypes,t=this.cwd);let i=await t.readlink();return e?i:i==null?void 0:i.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof ot||(e=t.withFileTypes,t=this.cwd);let i=t.readlinkSync();return e?i:i==null?void 0:i.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof ot||(e=t.withFileTypes,t=this.cwd);let i=await t.realpath();return e?i:i==null?void 0:i.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof ot||(e=t.withFileTypes,t=this.cwd);let i=t.realpathSync();return e?i:i==null?void 0:i.fullpath()}async walk(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof ot||(e=t,t=this.cwd);let{withFileTypes:i=!0,follow:s=!1,filter:o,walkFilter:a}=e,l=[];(!o||o(t))&&l.push(i?t:t.fullpath());let f=new Set,h=(m,g)=>{f.add(m),m.readdirCB((S,C)=>{if(S)return g(S);let x=C.length;if(!x)return g();let E=()=>{--x===0&&g()};for(let w of C)(!o||o(w))&&l.push(i?w:w.fullpath()),s&&w.isSymbolicLink()?w.realpath().then(O=>O!=null&&O.isUnknown()?O.lstat():O).then(O=>O!=null&&O.shouldWalk(f,a)?h(O,E):E()):w.shouldWalk(f,a)?h(w,E):E()},!0)},p=t;return new Promise((m,g)=>{h(p,S=>{if(S)return g(S);m(l)})})}walkSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof ot||(e=t,t=this.cwd);let{withFileTypes:i=!0,follow:s=!1,filter:o,walkFilter:a}=e,l=[];(!o||o(t))&&l.push(i?t:t.fullpath());let f=new Set([t]);for(let h of f){let p=h.readdirSync();for(let m of p){(!o||o(m))&&l.push(i?m:m.fullpath());let g=m;if(m.isSymbolicLink()){if(!(s&&(g=m.realpathSync())))continue;g.isUnknown()&&g.lstatSync()}g.shouldWalk(f,a)&&f.add(g)}}return l}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof ot||(e=t,t=this.cwd),this.stream(t,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof ot||(e=t,t=this.cwd);let{withFileTypes:i=!0,follow:s=!1,filter:o,walkFilter:a}=e;(!o||o(t))&&(yield i?t:t.fullpath());let l=new Set([t]);for(let f of l){let h=f.readdirSync();for(let p of h){(!o||o(p))&&(yield i?p:p.fullpath());let m=p;if(p.isSymbolicLink()){if(!(s&&(m=p.realpathSync())))continue;m.isUnknown()&&m.lstatSync()}m.shouldWalk(l,a)&&l.add(m)}}}stream(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof ot||(e=t,t=this.cwd);let{withFileTypes:i=!0,follow:s=!1,filter:o,walkFilter:a}=e,l=new De({objectMode:!0});(!o||o(t))&&l.write(i?t:t.fullpath());let f=new Set,h=[t],p=0,m=()=>{let g=!1;for(;!g;){let S=h.shift();if(!S){p===0&&l.end();return}p++,f.add(S);let C=(E,w,O=!1)=>{if(E)return l.emit("error",E);if(s&&!O){let k=[];for(let T of w)T.isSymbolicLink()&&k.push(T.realpath().then(D=>D!=null&&D.isUnknown()?D.lstat():D));if(k.length){Promise.all(k).then(()=>C(null,w,!0));return}}for(let k of w)k&&(!o||o(k))&&(l.write(i?k:k.fullpath())||(g=!0));p--;for(let k of w){let T=k.realpathCached()||k;T.shouldWalk(f,a)&&h.push(T)}g&&!l.flowing?l.once("drain",m):x||m()},x=!0;S.readdirCB(C,!0),x=!1}};return m(),l}streamSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof ot||(e=t,t=this.cwd);let{withFileTypes:i=!0,follow:s=!1,filter:o,walkFilter:a}=e,l=new De({objectMode:!0}),f=new Set;(!o||o(t))&&l.write(i?t:t.fullpath());let h=[t],p=0,m=()=>{let g=!1;for(;!g;){let S=h.shift();if(!S){p===0&&l.end();return}p++,f.add(S);let C=S.readdirSync();for(let x of C)(!o||o(x))&&(l.write(i?x:x.fullpath())||(g=!0));p--;for(let x of C){let E=x;if(x.isSymbolicLink()){if(!(s&&(E=x.realpathSync())))continue;E.isUnknown()&&E.lstatSync()}E.shouldWalk(f,a)&&h.push(E)}}g&&!l.flowing&&l.once("drain",m)};return m(),l}chdir(t=this.cwd){let e=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[Ac](e)}};Nr=new WeakMap,Br=new WeakMap,zi=new WeakMap,Ui=new WeakMap;var Wr=class extends io{constructor(e=process.cwd(),i={}){let{nocase:s=!0}=i;super(e,jr.win32,"\\",{...i,nocase:s});d(this,"sep","\\");this.nocase=s;for(let o=this.cwd;o;o=o.parent)o.nocase=this.nocase}parseRootPath(e){return jr.win32.parse(e).root.toUpperCase()}newRoot(e){return new eo(this.rootPath,Yt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},zr=class extends io{constructor(e=process.cwd(),i={}){let{nocase:s=!1}=i;super(e,jr.posix,"/",{...i,nocase:s});d(this,"sep","/");this.nocase=s}parseRootPath(e){return"/"}newRoot(e){return new ro(this.rootPath,Yt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},vi=class extends zr{constructor(t=process.cwd(),e={}){let{nocase:i=!0}=e;super(t,{...e,nocase:i})}},Hk=process.platform==="win32"?eo:ro,Pc=process.platform==="win32"?Wr:process.platform==="darwin"?vi:zr;var Cw=r=>r.length>=1,Ew=r=>r.length>=1,K,St,tt,sr,$t,Gi,Ie,Ne,Be,Ur,On=class On{constructor(t,e,i,s){b(this,K);b(this,St);b(this,tt);d(this,"length");b(this,sr);b(this,$t);b(this,Gi);b(this,Ie);b(this,Ne);b(this,Be);b(this,Ur,!0);if(!Cw(t))throw new TypeError("empty pattern list");if(!Ew(e))throw new TypeError("empty glob list");if(e.length!==t.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=t.length,i<0||i>=this.length)throw new TypeError("index out of range");if(c(this,K,t),c(this,St,e),c(this,tt,i),c(this,sr,s),n(this,tt)===0){if(this.isUNC()){let[o,a,l,f,...h]=n(this,K),[p,m,g,S,...C]=n(this,St);h[0]===""&&(h.shift(),C.shift());let x=[o,a,l,f,""].join("/"),E=[p,m,g,S,""].join("/");c(this,K,[x,...h]),c(this,St,[E,...C]),this.length=n(this,K).length}else if(this.isDrive()||this.isAbsolute()){let[o,...a]=n(this,K),[l,...f]=n(this,St);a[0]===""&&(a.shift(),f.shift());let h=o+"/",p=l+"/";c(this,K,[h,...a]),c(this,St,[p,...f]),this.length=n(this,K).length}}}pattern(){return n(this,K)[n(this,tt)]}isString(){return typeof n(this,K)[n(this,tt)]=="string"}isGlobstar(){return n(this,K)[n(this,tt)]===et}isRegExp(){return n(this,K)[n(this,tt)]instanceof RegExp}globString(){return c(this,Gi,n(this,Gi)||(n(this,tt)===0?this.isAbsolute()?n(this,St)[0]+n(this,St).slice(1).join("/"):n(this,St).join("/"):n(this,St).slice(n(this,tt)).join("/")))}hasMore(){return this.length>n(this,tt)+1}rest(){return n(this,$t)!==void 0?n(this,$t):this.hasMore()?(c(this,$t,new On(n(this,K),n(this,St),n(this,tt)+1,n(this,sr))),c(n(this,$t),Be,n(this,Be)),c(n(this,$t),Ne,n(this,Ne)),c(n(this,$t),Ie,n(this,Ie)),n(this,$t)):c(this,$t,null)}isUNC(){let t=n(this,K);return n(this,Ne)!==void 0?n(this,Ne):c(this,Ne,n(this,sr)==="win32"&&n(this,tt)===0&&t[0]===""&&t[1]===""&&typeof t[2]=="string"&&!!t[2]&&typeof t[3]=="string"&&!!t[3])}isDrive(){let t=n(this,K);return n(this,Ie)!==void 0?n(this,Ie):c(this,Ie,n(this,sr)==="win32"&&n(this,tt)===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]))}isAbsolute(){let t=n(this,K);return n(this,Be)!==void 0?n(this,Be):c(this,Be,t[0]===""&&t.length>1||this.isDrive()||this.isUNC())}root(){let t=n(this,K)[0];return typeof t=="string"&&this.isAbsolute()&&n(this,tt)===0?t:""}checkFollowGlobstar(){return!(n(this,tt)===0||!this.isGlobstar()||!n(this,Ur))}markFollowGlobstar(){return n(this,tt)===0||!this.isGlobstar()||!n(this,Ur)?!1:(c(this,Ur,!1),!0)}};K=new WeakMap,St=new WeakMap,tt=new WeakMap,sr=new WeakMap,$t=new WeakMap,Gi=new WeakMap,Ie=new WeakMap,Ne=new WeakMap,Be=new WeakMap,Ur=new WeakMap;var Gr=On;var Ow=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",$r=class{constructor(t,{nobrace:e,nocase:i,noext:s,noglobstar:o,platform:a=Ow}){d(this,"relative");d(this,"relativeChildren");d(this,"absolute");d(this,"absoluteChildren");d(this,"platform");d(this,"mmopts");this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=a,this.mmopts={dot:!0,nobrace:e,nocase:i,noext:s,noglobstar:o,optimizationLevel:2,platform:a,nocomment:!0,nonegate:!0};for(let l of t)this.add(l)}add(t){let e=new mt(t,this.mmopts);for(let i=0;i<e.set.length;i++){let s=e.set[i],o=e.globParts[i];if(!s||!o)throw new Error("invalid pattern object");for(;s[0]==="."&&o[0]===".";)s.shift(),o.shift();let a=new Gr(s,o,0,this.platform),l=new mt(a.globString(),this.mmopts),f=o[o.length-1]==="**",h=a.isAbsolute();h?this.absolute.push(l):this.relative.push(l),f&&(h?this.absoluteChildren.push(l):this.relativeChildren.push(l))}}ignored(t){let e=t.fullpath(),i=`${e}/`,s=t.relative()||".",o=`${s}/`;for(let a of this.relative)if(a.match(s)||a.match(o))return!0;for(let a of this.absolute)if(a.match(e)||a.match(i))return!0;return!1}childrenIgnored(t){let e=t.fullpath()+"/",i=(t.relative()||".")+"/";for(let s of this.relativeChildren)if(s.match(i))return!0;for(let s of this.absoluteChildren)if(s.match(e))return!0;return!1}};var An=class r{constructor(t=new Map){d(this,"store");this.store=t}copy(){return new r(new Map(this.store))}hasWalked(t,e){var i;return(i=this.store.get(t.fullpath()))==null?void 0:i.has(e.globString())}storeWalked(t,e){let i=t.fullpath(),s=this.store.get(i);s?s.add(e.globString()):this.store.set(i,new Set([e.globString()]))}},kn=class{constructor(){d(this,"store",new Map)}add(t,e,i){let s=(e?2:0)|(i?1:0),o=this.store.get(t);this.store.set(t,o===void 0?s:s&o)}entries(){return[...this.store.entries()].map(([t,e])=>[t,!!(e&2),!!(e&1)])}},Tn=class{constructor(){d(this,"store",new Map)}add(t,e){if(!t.canReaddir())return;let i=this.store.get(t);i?i.find(s=>s.globString()===e.globString())||i.push(e):this.store.set(t,[e])}get(t){let e=this.store.get(t);if(!e)throw new Error("attempting to walk unknown path");return e}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return[...this.store.keys()].filter(t=>t.canReaddir())}},$i=class r{constructor(t,e){d(this,"hasWalkedCache");d(this,"matches",new kn);d(this,"subwalks",new Tn);d(this,"patterns");d(this,"follow");d(this,"dot");d(this,"opts");this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=e?e.copy():new An}processPatterns(t,e){this.patterns=e;let i=e.map(s=>[t,s]);for(let[s,o]of i){this.hasWalkedCache.storeWalked(s,o);let a=o.root(),l=o.isAbsolute()&&this.opts.absolute!==!1;if(a){s=s.resolve(a==="/"&&this.opts.root!==void 0?this.opts.root:a);let m=o.rest();if(m)o=m;else{this.matches.add(s,!0,!1);continue}}if(s.isENOENT())continue;let f,h,p=!1;for(;typeof(f=o.pattern())=="string"&&(h=o.rest());)s=s.resolve(f),o=h,p=!0;if(f=o.pattern(),h=o.rest(),p){if(this.hasWalkedCache.hasWalked(s,o))continue;this.hasWalkedCache.storeWalked(s,o)}if(typeof f=="string"){let m=f===".."||f===""||f===".";this.matches.add(s.resolve(f),l,m);continue}else if(f===et){(!s.isSymbolicLink()||this.follow||o.checkFollowGlobstar())&&this.subwalks.add(s,o);let m=h==null?void 0:h.pattern(),g=h==null?void 0:h.rest();if(!h||(m===""||m===".")&&!g)this.matches.add(s,l,m===""||m===".");else if(m===".."){let S=s.parent||s;g?this.hasWalkedCache.hasWalked(S,g)||this.subwalks.add(S,g):this.matches.add(S,l,!0)}}else f instanceof RegExp&&this.subwalks.add(s,o)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new r(this.opts,this.hasWalkedCache)}filterEntries(t,e){let i=this.subwalks.get(t),s=this.child();for(let o of e)for(let a of i){let l=a.isAbsolute(),f=a.pattern(),h=a.rest();f===et?s.testGlobstar(o,a,h,l):f instanceof RegExp?s.testRegExp(o,f,h,l):s.testString(o,f,h,l)}return s}testGlobstar(t,e,i,s){if((this.dot||!t.name.startsWith("."))&&(e.hasMore()||this.matches.add(t,s,!1),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,e):t.isSymbolicLink()&&(i&&e.checkFollowGlobstar()?this.subwalks.add(t,i):e.markFollowGlobstar()&&this.subwalks.add(t,e)))),i){let o=i.pattern();if(typeof o=="string"&&o!==".."&&o!==""&&o!==".")this.testString(t,o,i.rest(),s);else if(o===".."){let a=t.parent||t;this.subwalks.add(a,i)}else o instanceof RegExp&&this.testRegExp(t,o,i.rest(),s)}}testRegExp(t,e,i,s){e.test(t.name)&&(i?this.subwalks.add(t,i):this.matches.add(t,s,!1))}testString(t,e,i,s){t.isNamed(e)&&(i?this.subwalks.add(t,i):this.matches.add(t,s,!1))}};var Aw=(r,t)=>typeof r=="string"?new $r([r],t):Array.isArray(r)?new $r(r,t):r,Hr,pe,nr,Tt,or,_n,so=class{constructor(t,e,i){b(this,Tt);d(this,"path");d(this,"patterns");d(this,"opts");d(this,"seen",new Set);d(this,"paused",!1);d(this,"aborted",!1);b(this,Hr,[]);b(this,pe);b(this,nr);d(this,"signal");d(this,"maxDepth");d(this,"includeChildMatches");var s;if(this.patterns=t,this.path=e,this.opts=i,c(this,nr,!i.posix&&i.platform==="win32"?"\\":"/"),this.includeChildMatches=i.includeChildMatches!==!1,(i.ignore||!this.includeChildMatches)&&(c(this,pe,Aw((s=i.ignore)!=null?s:[],i)),!this.includeChildMatches&&typeof n(this,pe).add!="function")){let o="cannot ignore child matches, ignore lacks add() method.";throw new Error(o)}this.maxDepth=i.maxDepth||1/0,i.signal&&(this.signal=i.signal,this.signal.addEventListener("abort",()=>{n(this,Hr).length=0}))}pause(){this.paused=!0}resume(){var e;if((e=this.signal)!=null&&e.aborted)return;this.paused=!1;let t;for(;!this.paused&&(t=n(this,Hr).shift());)t()}onResume(t){var e;(e=this.signal)!=null&&e.aborted||(this.paused?n(this,Hr).push(t):t())}async matchCheck(t,e){if(e&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=t.realpathCached()||await t.realpath(),!i)return;t=i}let o=t.isUnknown()||this.opts.stat?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&(o!=null&&o.isSymbolicLink())){let a=await o.realpath();a&&(a.isUnknown()||this.opts.stat)&&await a.lstat()}return this.matchCheckTest(o,e)}matchCheckTest(t,e){var i;return t&&(this.maxDepth===1/0||t.depth()<=this.maxDepth)&&(!e||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!((i=t.realpathCached())!=null&&i.isDirectory()))&&!y(this,Tt,or).call(this,t)?t:void 0}matchCheckSync(t,e){if(e&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=t.realpathCached()||t.realpathSync(),!i)return;t=i}let o=t.isUnknown()||this.opts.stat?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&(o!=null&&o.isSymbolicLink())){let a=o.realpathSync();a&&(a!=null&&a.isUnknown()||this.opts.stat)&&a.lstatSync()}return this.matchCheckTest(o,e)}matchFinish(t,e){var o;if(y(this,Tt,or).call(this,t))return;if(!this.includeChildMatches&&((o=n(this,pe))!=null&&o.add)){let a=`${t.relativePosix()}/**`;n(this,pe).add(a)}let i=this.opts.absolute===void 0?e:this.opts.absolute;this.seen.add(t);let s=this.opts.mark&&t.isDirectory()?n(this,nr):"";if(this.opts.withFileTypes)this.matchEmit(t);else if(i){let a=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(a+s)}else{let a=this.opts.posix?t.relativePosix():t.relative(),l=this.opts.dotRelative&&!a.startsWith(".."+n(this,nr))?"."+n(this,nr):"";this.matchEmit(a?l+a+s:"."+s)}}async match(t,e,i){let s=await this.matchCheck(t,i);s&&this.matchFinish(s,e)}matchSync(t,e,i){let s=this.matchCheckSync(t,i);s&&this.matchFinish(s,e)}walkCB(t,e,i){var s;(s=this.signal)!=null&&s.aborted&&i(),this.walkCB2(t,e,new $i(this.opts),i)}walkCB2(t,e,i,s){var l;if(y(this,Tt,_n).call(this,t))return s();if((l=this.signal)!=null&&l.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2(t,e,i,s));return}i.processPatterns(t,e);let o=1,a=()=>{--o===0&&s()};for(let[f,h,p]of i.matches.entries())y(this,Tt,or).call(this,f)||(o++,this.match(f,h,p).then(()=>a()));for(let f of i.subwalkTargets()){if(this.maxDepth!==1/0&&f.depth()>=this.maxDepth)continue;o++;let h=f.readdirCached();f.calledReaddir()?this.walkCB3(f,h,i,a):f.readdirCB((p,m)=>this.walkCB3(f,m,i,a),!0)}a()}walkCB3(t,e,i,s){i=i.filterEntries(t,e);let o=1,a=()=>{--o===0&&s()};for(let[l,f,h]of i.matches.entries())y(this,Tt,or).call(this,l)||(o++,this.match(l,f,h).then(()=>a()));for(let[l,f]of i.subwalks.entries())o++,this.walkCB2(l,f,i.child(),a);a()}walkCBSync(t,e,i){var s;(s=this.signal)!=null&&s.aborted&&i(),this.walkCB2Sync(t,e,new $i(this.opts),i)}walkCB2Sync(t,e,i,s){var l;if(y(this,Tt,_n).call(this,t))return s();if((l=this.signal)!=null&&l.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2Sync(t,e,i,s));return}i.processPatterns(t,e);let o=1,a=()=>{--o===0&&s()};for(let[f,h,p]of i.matches.entries())y(this,Tt,or).call(this,f)||this.matchSync(f,h,p);for(let f of i.subwalkTargets()){if(this.maxDepth!==1/0&&f.depth()>=this.maxDepth)continue;o++;let h=f.readdirSync();this.walkCB3Sync(f,h,i,a)}a()}walkCB3Sync(t,e,i,s){i=i.filterEntries(t,e);let o=1,a=()=>{--o===0&&s()};for(let[l,f,h]of i.matches.entries())y(this,Tt,or).call(this,l)||this.matchSync(l,f,h);for(let[l,f]of i.subwalks.entries())o++,this.walkCB2Sync(l,f,i.child(),a);a()}};Hr=new WeakMap,pe=new WeakMap,nr=new WeakMap,Tt=new WeakSet,or=function(t){var e,i;return this.seen.has(t)||!!((i=(e=n(this,pe))==null?void 0:e.ignored)!=null&&i.call(e,t))},_n=function(t){var e,i;return!!((i=(e=n(this,pe))==null?void 0:e.childrenIgnored)!=null&&i.call(e,t))};var Hi=class extends so{constructor(e,i,s){super(e,i,s);d(this,"matches",new Set)}matchEmit(e){this.matches.add(e)}async walk(){var e;if((e=this.signal)!=null&&e.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((i,s)=>{this.walkCB(this.path,this.patterns,()=>{var o;(o=this.signal)!=null&&o.aborted?s(this.signal.reason):i(this.matches)})}),this.matches}walkSync(){var e;if((e=this.signal)!=null&&e.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{var i;if((i=this.signal)!=null&&i.aborted)throw this.signal.reason}),this.matches}},qi=class extends so{constructor(e,i,s){super(e,i,s);d(this,"results");this.results=new De({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var kw=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Ht=class{constructor(t,e){d(this,"absolute");d(this,"cwd");d(this,"root");d(this,"dot");d(this,"dotRelative");d(this,"follow");d(this,"ignore");d(this,"magicalBraces");d(this,"mark");d(this,"matchBase");d(this,"maxDepth");d(this,"nobrace");d(this,"nocase");d(this,"nodir");d(this,"noext");d(this,"noglobstar");d(this,"pattern");d(this,"platform");d(this,"realpath");d(this,"scurry");d(this,"stat");d(this,"signal");d(this,"windowsPathsNoEscape");d(this,"withFileTypes");d(this,"includeChildMatches");d(this,"opts");d(this,"patterns");if(!e)throw new TypeError("glob options required");if(this.withFileTypes=!!e.withFileTypes,this.signal=e.signal,this.follow=!!e.follow,this.dot=!!e.dot,this.dotRelative=!!e.dotRelative,this.nodir=!!e.nodir,this.mark=!!e.mark,e.cwd?(e.cwd instanceof URL||e.cwd.startsWith("file://"))&&(e.cwd=(0,Fc.fileURLToPath)(e.cwd)):this.cwd="",this.cwd=e.cwd||"",this.root=e.root,this.magicalBraces=!!e.magicalBraces,this.nobrace=!!e.nobrace,this.noext=!!e.noext,this.realpath=!!e.realpath,this.absolute=e.absolute,this.includeChildMatches=e.includeChildMatches!==!1,this.noglobstar=!!e.noglobstar,this.matchBase=!!e.matchBase,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:1/0,this.stat=!!e.stat,this.ignore=e.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof t=="string"&&(t=[t]),this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(t=t.map(f=>f.replace(/\\/g,"/"))),this.matchBase){if(e.noglobstar)throw new TypeError("base matching requires globstar");t=t.map(f=>f.includes("/")?f:`./**/${f}`)}if(this.pattern=t,this.platform=e.platform||kw,this.opts={...e,platform:this.platform},e.scurry){if(this.scurry=e.scurry,e.nocase!==void 0&&e.nocase!==e.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let f=e.platform==="win32"?Wr:e.platform==="darwin"?vi:e.platform?zr:Pc;this.scurry=new f(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;let i=this.platform==="darwin"||this.platform==="win32",s={...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:i,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},o=this.pattern.map(f=>new mt(f,s)),[a,l]=o.reduce((f,h)=>(f[0].push(...h.set),f[1].push(...h.globParts),f),[[],[]]);this.patterns=a.map((f,h)=>{let p=l[h];if(!p)throw new Error("invalid pattern object");return new Gr(f,p,0,this.platform)})}async walk(){return[...await new Hi(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new Hi(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new qi(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new qi(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var Rn=(r,t={})=>{Array.isArray(r)||(r=[r]);for(let e of r)if(new mt(e,t).hasMagic())return!0;return!1};function oo(r,t={}){return new Ht(r,t).streamSync()}function Mc(r,t={}){return new Ht(r,t).stream()}function Ic(r,t={}){return new Ht(r,t).walkSync()}async function Dc(r,t={}){return new Ht(r,t).walk()}function no(r,t={}){return new Ht(r,t).iterateSync()}function Nc(r,t={}){return new Ht(r,t).iterate()}var Tw=oo,_w=Object.assign(Mc,{sync:oo}),Rw=no,Pw=Object.assign(Nc,{sync:no}),Ki=Object.assign(Ic,{stream:oo,iterate:no}),Lc=Object.assign(Dc,{glob:Dc,globSync:Ic,sync:Ki,globStream:Mc,stream:_w,globStreamSync:oo,streamSync:Tw,globIterate:Nc,iterate:Pw,globIterateSync:no,iterateSync:Rw,Glob:Ht,hasMagic:Rn,escape:Ar,unescape:Dt});Lc.glob=Lc;vt();var Fw=R.withTag("listChromeProfiles");function Bc(){let r=Ki("./**/Cookies",{cwd:Er,absolute:!0});return Fw.debug("Found cookie files:",r),r}var ao=require("crypto");Ce();var Dw=Et(r=>r.length>=3&&r[0]===118&&r[1]===49&&r[2]===48?r.slice(3):r,r=>r.toString("hex")),Lw=Et(r=>{let t=r[r.length-1];return t&&t<=16?r.slice(0,-t):r},r=>r.toString("hex"));function Mw(r){var e;let t=[/.*?0t(.+)$/,/.*?1e`(.+)$/,/.*?[`'](.+)$/,/[^\x20-\x7E]*([\x20-\x7E].+)$/];for(let i of t){let s=r.match(i),o=(e=s==null?void 0:s[1])!=null?e:"";if(o.length>0)return o}return r}async function jc(r,t){if(typeof t!="string")throw new Error("password must be a string");if(!Buffer.isBuffer(r))throw new Error("encryptedData must be a Buffer");return new Promise((e,i)=>{(0,ao.pbkdf2)(t,"saltysalt",1003,16,"sha1",(s,o)=>{try{if(s){i(new Error("Failed to derive key: "+s.message));return}let a=Dw(r);if(a.length%16!==0){i(new Error("Encrypted data length is not a multiple of 16"));return}let l=Buffer.alloc(16," "),f=(0,ao.createDecipheriv)("aes-128-cbc",o,l);f.setAutoPadding(!1);let h=f.update(a);try{f.final()}catch(m){i(new Error("Failed to finalize decryption: "+m.message));return}h=Lw(h);let p=h.toString("utf8");e(Mw(p))}catch(a){i(new Error("Decryption failed: "+a.message))}})})}Ce();ee();var qc=Et(async()=>{if(process.platform!=="darwin")throw z("Chrome password retrieval failed",new Error("This only works on macOS"),{platform:process.platform}),new Error("This only works on macOS");try{let{getChromePassword:r}=await Promise.resolve().then(()=>(Hc(),$c)),t=await r();return qt("ChromePassword","Retrieved password successfully",{platform:"macOS"}),t}catch(r){throw z("Chrome password retrieval failed",r,{platform:"macOS"}),r}});function Ww(r){return typeof r!="number"||r<=0?"Infinity":new Date(r)}function Kc(r,t,e,i,s,o){return{domain:r,name:t,value:e,expiry:Ww(i),meta:{file:s,browser:"Chrome",decrypted:o}}}var fo=class{constructor(){this.logger=Ji("ChromeCookieQueryStrategy");this.browserName="Chrome"}async queryCookies(t,e){try{if(this.logger.info("Querying cookies",{name:t,domain:e}),process.platform!=="darwin")return this.logger.warn("Platform not supported",{platform:process.platform}),[];let i=Bc();if(i.length===0)return this.logger.warn("No Chrome cookie files found"),[];let s=await qc();return(await Promise.all(i.map(a=>this.processFile(a,t,e,s)))).flat()}catch(i){return i instanceof Error?z("Failed to query cookies",i,{name:t,domain:e}):z("Failed to query cookies",new Error(String(i)),{name:t,domain:e}),[]}}async processFile(t,e,i,s){try{let o=await fu({name:e,domain:i,file:t}),a={file:t,password:s};return(await Promise.allSettled(o.map(f=>this.processCookie(f,a)))).map(f=>f.status==="fulfilled"?f.value:null).filter(f=>f!==null)}catch(o){return o instanceof Error?this.logger.error("Failed to process cookie file",{error:o,file:t}):this.logger.error("Failed to process cookie file",{error:String(o),file:t}),[]}}async processCookie(t,e){try{let i=Buffer.isBuffer(t.value)?t.value:Buffer.from(String(t.value)),s=await jc(i,e.password);return Kc(t.domain,t.name,s,t.expiry,e.file,!0)}catch(i){return i instanceof Error?this.logger.warn("Failed to decrypt cookie",{error:i}):this.logger.warn("Failed to decrypt cookie",{error:String(i)}),Kc(t.domain,t.name,t.value.toString("utf-8"),t.expiry,e.file,!1)}}};async function Qc(r,t,e=[]){return r.length===0?e:(await Promise.all(r.map(async s=>{try{return await t(s)}catch(o){return e}}))).flat()}ee();var lo=class{constructor(t){this.strategies=t;this.logger=Ji("CompositeCookieQueryStrategy");this.browserName="internal"}handleStrategyError(t,e){t instanceof Error?this.logger.error("Strategy failed",{error:t,strategy:e}):this.logger.error("Strategy failed with unknown error",{error:String(t),strategy:e})}async queryCookies(t,e){try{return this.logger.info("Querying cookies from all strategies",{name:t,domain:e,strategyCount:this.strategies.length}),await Qc(this.strategies,async i=>{try{return await i.queryCookies(t,e)}catch(s){return this.handleStrategyError(s,i),[]}},[])}catch(i){return i instanceof Error?this.logger.error("Failed to query cookies",{error:i}):this.logger.error("Failed to query cookies with unknown error",{error:String(i)}),[]}}};var Pn=require("path");ee();function zw(){let r=[],t=process.env.HOME;if(typeof t!="string"||t.length===0)return Xi("FirefoxCookieQuery","HOME environment variable not set"),r;let e=[(0,Pn.join)(t,"Library/Application Support/Firefox/Profiles/*/cookies.sqlite"),(0,Pn.join)(t,".mozilla/firefox/*/cookies.sqlite")];for(let i of e){let s=Ki(i);r.push(...s)}return qt("FirefoxCookieQuery","Found Firefox cookie files",{files:r}),r}var ho=class{constructor(){this.browserName="Firefox"}async queryCookies(t,e){let i=zw(),s=[];for(let o of i)try{let a=await Ls({file:o,sql:"SELECT name, value, host as domain, expiry FROM moz_cookies WHERE name = ? AND host LIKE ?",params:[t,`%${e}%`],rowTransform:l=>({name:l.name,value:l.value,domain:l.domain,expiry:l.expiry>0?new Date(l.expiry*1e3):"Infinity",meta:{file:o,browser:"Firefox",decrypted:!1}})});s.push(...a)}catch(a){a instanceof Error?Xi("FirefoxCookieQuery",`Error reading Firefox cookie file ${o}`,{error:a.message}):Xi("FirefoxCookieQuery",`Error reading Firefox cookie file ${o}`)}return s}};var rp=require("path");ee();var tp=require("fs");var Vc=ze(require("destr"),1),F=require("zod"),uo=F.z.string().trim().min(1,"Domain cannot be empty").refine(r=>/^\.?[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(r),"Invalid domain format"),co=F.z.string().trim().min(1,"Cookie name cannot be empty").refine(r=>/^[\x21\x23-\x27\x2A\x2B\x2D-\x2E\x30-\x39\x41-\x5A\x5E-\x7E]+$/.test(r),"Invalid cookie name format - must contain only valid characters (letters, numbers, and certain symbols)"),Zc=F.z.string().trim().min(1,"Path cannot be empty").refine(r=>r.startsWith("/"),"Path must start with /").refine(r=>/^\/[!#$%&'()*+,\-./:=@\w]*$/.test(r),"Invalid path format - must contain only valid URL path characters").default("/"),Yc=F.z.string().trim().transform(r=>(0,Vc.default)(r)).pipe(F.z.any()),Jc=F.z.object({name:co,value:Yc,domain:uo,path:Zc,expiry:F.z.number().int(),creation:F.z.number().int(),flags:F.z.number().optional(),version:F.z.number().int().optional(),port:F.z.number().int().optional(),comment:F.z.string().optional(),commentURL:F.z.string().optional()}),XT=F.z.object({name:co,domain:uo}).strict(),Uw=F.z.object({file:F.z.string().trim().min(1,"File path cannot be empty").optional(),browser:F.z.string().trim().optional(),decrypted:F.z.boolean().optional(),secure:F.z.boolean().optional(),httpOnly:F.z.boolean().optional(),path:Zc.optional()}).catchall(F.z.unknown()).strict(),Gw=F.z.object({domain:uo,name:co,value:Yc,expiry:F.z.union([F.z.literal("Infinity"),F.z.date(),F.z.number().int().positive("Expiry must be a positive number")]).optional(),meta:Uw.optional()}).strict(),t_=F.z.object({expiry:F.z.number().int().optional(),domain:uo,name:co,value:F.z.union([F.z.string(),F.z.instanceof(Buffer)])}).strict(),e_=F.z.object({format:F.z.enum(["merged","grouped"]).optional(),separator:F.z.string().optional(),showFilePaths:F.z.boolean().optional()}).strict(),$w=F.z.enum(["Chrome","Firefox","Safari","internal","unknown"]),r_=F.z.object({browserName:$w,queryCookies:F.z.function().args(F.z.string(),F.z.string()).returns(F.z.promise(F.z.array(Gw)))}).strict();var Hw="cook",qw=510912288576766e3,Xc=978307200;function Kw(r,t){let e=t;for(;e<r.length&&r[e]!==0;)e++;return[r.toString("utf8",t,e),e+1]}function Qw(r,t){let e=r.readUInt32LE(t),i=r.readUInt32LE(t+4),s=r.readUInt32LE(t+8),o=r.readUInt32LE(t+12),a=r.readUInt32LE(t+16),l=r.readUInt32LE(t+20),f=r.readUInt32LE(t+24),h=r.readUInt32LE(t+28),p=r.readUInt32LE(t+32),m=r.readUInt32LE(t+36),g=r.readDoubleLE(t+40)+Xc,S=r.readDoubleLE(t+48)+Xc,C=t+56,x;o&&(x=r.readUInt16LE(C),C+=2);let E=[{field:"url",offset:a},{field:"name",offset:l},{field:"path",offset:f},{field:"value",offset:h},{field:"comment",offset:p},{field:"commentURL",offset:m}].sort((k,T)=>k.offset-T.offset),w={};for(let{field:k,offset:T}of E)if(T>0){let[D,W]=Kw(r,t+T);w[k]=D,C=Math.max(C,W)}return[Jc.parse({name:w.name,value:w.value,domain:w.url.startsWith(".")?w.url.slice(1):w.url,path:w.path||"/",expiry:Math.floor(g),creation:Math.floor(S),flags:s,version:i,port:x,comment:w.comment,commentURL:w.commentURL}),e]}function Vw(r,t,e){let i=t+5,s=r.readUInt32BE(i),o=t+s,a=[],l=t+e;for(;o<l-8;)try{let[f,h]=Qw(r,o);a.push(f),o+=h}catch(f){console.warn(`Error decoding cookie at offset ${o}:`,f);break}return a}function ep(r){let t=(0,tp.readFileSync)(r);if(t.toString("utf8",0,4)!==Hw)throw new Error("Invalid cookie file format: wrong magic header");let i=t.readUInt32BE(4),s=[];for(let f=0;f<i;f++)s.push(t.readUInt32BE(8+f*4));let o=8+i*4,a=[];for(let f=0;f<i;f++)try{let h=Vw(t,o,s[f]);a.push(...h),o+=s[f]}catch(h){console.warn(`Error decoding page ${f}:`,h),o+=s[f]}return Number(t.readBigUInt64BE(t.length-8))!==qw&&console.warn("Invalid cookie file format: wrong footer"),a}var po=class{constructor(){this.browserName="Safari"}getHomeDir(){let t=process.env.HOME;return typeof t!="string"||t.trim().length===0?(z("SafariCookieQueryStrategy","HOME environment variable not set"),""):t}getCookieDbPath(t){return(0,rp.join)(t,"Library","Containers","com.apple.Safari","Data","Library","Cookies","Cookies.binarycookies")}decodeCookies(t,e,i){try{return ep(t).filter(o=>o.name===e&&o.domain.includes(i)).map(o=>({domain:o.domain,name:o.name,value:Buffer.isBuffer(o.value)?o.value.toString():String(o.value),expiry:typeof o.expiry=="number"&&o.expiry>0?new Date(o.expiry*1e3):"Infinity",meta:{file:t,browser:"Safari",decrypted:!1}}))}catch(s){return s instanceof Error?z("SafariCookieQueryStrategy",`Error decoding ${t}`,{error:s,name:e,domain:i}):z("SafariCookieQueryStrategy",`Error decoding ${t}`,{error:"Unknown error",name:e,domain:i}),[]}}async queryCookies(t,e){let i=this.getHomeDir();if(typeof i!="string"||i.length===0)return Promise.resolve([]);let s=this.getCookieDbPath(i);return Promise.resolve(this.decodeCookies(s,t,e))}};function Zw(r){return r.expiry===void 0?r:typeof r.expiry=="number"?{...r,expiry:new Date(r.expiry*1e3)}:r}async function ip(r,t={}){var a;let e=(a=t.strategy)!=null?a:new lo([new fo,new ho,new po]),i=async l=>(await e.queryCookies(l.name,l.domain)).map(Zw),s=Array.isArray(r)?await Promise.all(r.map(i)):await i(r),o=Array.isArray(s)?s.flat():s;if(t.removeExpired===!0){let l=Date.now();o=o.filter(f=>f.expiry==="Infinity"||f.expiry instanceof Date&&f.expiry.getTime()>l)}return typeof t.limit=="number"&&t.limit>0&&(o=o.slice(0,t.limit)),o}vt();vt();var Qi=class{canHandle(t){return!0}handle(t){let e=new Set(t.map(i=>i.value));for(let i of e)R.log(i)}};vt();var mo=class{canHandle(t){return t.dump===!0||t.d===!0}handle(t){R.log(t)}};Ce();vt();var go=class{canHandle(t){return t["dump-grouped"]===!0||t.D===!0}handle(t){let e=ii(t,i=>{var s,o;return(o=(s=i.meta)==null?void 0:s.file)!=null?o:"unknown"});R.log(JSON.stringify(e,null,2))}};Ce();function yo(r,t={}){let{format:e="merged",showFilePaths:i=!0,separator:s="; "}=t;if(r.length===0)return e==="merged"?"":[];if(e==="merged")return r.map(a=>a.value).join(s);let o=ii(r,a=>{var l,f;return(f=(l=a.meta)==null?void 0:l.file)!=null?f:"unknown"});return Object.entries(o).map(([a,l])=>{let f=l.map(h=>h.value).join(s);return i?`${a}: ${f}`:f})}vt();var xo=class{canHandle(t){return t["render-grouped"]===!0||t.R===!0}handle(t){R.log(yo(t,{format:"grouped"}))}};vt();var wo=class{canHandle(t){return t.output==="json"}handle(t){R.log(JSON.stringify(t,null,2))}};vt();var bo=class{canHandle(t){return t.render===!0||t["render-merged"]===!0||t.r===!0}handle(t){R.log(yo(t,{format:"merged"}))}};var So=class{constructor(){this.handlers=[new mo,new go,new bo,new xo,new wo,new Qi]}getHandler(t){var e;return(e=this.handlers.find(i=>i.canHandle(t)))!=null?e:new Qi}};async function sp(r,t,e,i,s,o){try{let a=await ip(r,{limit:s,removeExpired:o});if(a.length===0){R.error("No results");return}new So().getHandler(i).handle(a)}catch(a){a instanceof Error?R.error(a.message):R.error("An unknown error occurred")}}function Yw(){R.log("Usage: get-cookie [name] [domain] [options]"),R.log("Options:"),R.log(" -h, --help: Show this help message"),R.log(" -v, --verbose: Enable verbose output"),R.log(" -d, --dump: Dump all results"),R.log(" -D, --dump-grouped: Dump all results, grouped by profile"),R.log(" -r, --render: Render all results"),R.log(" -u, --url: URL to extract cookie specs from"),R.log(" -n, --name: Cookie name pattern"),R.log(" -d, --domain: Cookie domain pattern"),R.log(" --output: Output format (e.g., json)")}function Jw(r,t){return{name:r||"%",domain:t||"%"}}function Xw(r,t){let e=r.url;if(typeof e=="string"){let o=Co(e);return Array.isArray(o)?o:(R.error("Invalid cookie specs from URL"),[])}let i=r.name||t[0]||"%",s=r.domain||t[1]||"%";return[Jw(i,s)]}async function tb(r,t){let e=Xw(r,t);r.verbose===!0&&R.log("cookieSpecs",e);try{await sp(e,["chrome","firefox","safari"],["default"],{...r})}catch(i){i instanceof Error?R.error("Error querying cookies:",i.message):R.error("An unknown error occurred while querying cookies")}}async function eb(){let r=process.argv.slice(2),{values:t,positionals:e}=Mn(r);if(t.help===!0){Yw();return}await tb(t,e)}eb().catch(r=>{r instanceof Error?R.error("Fatal error:",r.message):R.error("An unknown fatal error occurred"),process.exit(1)});
|
|
5
5
|
/*! Bundled license information:
|
|
6
6
|
|
|
7
7
|
lodash-es/lodash.js:
|