From 648348111ea791ff95bd0f281faef46eea8a5fea Mon Sep 17 00:00:00 2001 From: Zhiming Ma Date: Mon, 23 Oct 2023 09:29:35 +0800 Subject: [PATCH] feat(intellij): add completion replace range support. (#613) --- clients/intellij/build.gradle.kts | 2 +- clients/intellij/node_scripts/tabby-agent.js | 157 ++++++++++-------- .../com/tabbyml/intellijtabby/agent/Agent.kt | 31 +--- .../intellijtabby/editor/EditorListener.kt | 6 +- .../editor/InlineCompletionService.kt | 157 +++++++++++++++--- 5 files changed, 235 insertions(+), 118 deletions(-) diff --git a/clients/intellij/build.gradle.kts b/clients/intellij/build.gradle.kts index 35bf8e0..e4eac8a 100644 --- a/clients/intellij/build.gradle.kts +++ b/clients/intellij/build.gradle.kts @@ -6,7 +6,7 @@ plugins { } group = "com.tabbyml" -version = "0.6.0" +version = "1.0.0-dev" repositories { mavenCentral() diff --git a/clients/intellij/node_scripts/tabby-agent.js b/clients/intellij/node_scripts/tabby-agent.js index 6caf81f..e97017a 100755 --- a/clients/intellij/node_scripts/tabby-agent.js +++ b/clients/intellij/node_scripts/tabby-agent.js @@ -9,59 +9,59 @@ var promises = require('fs/promises'); var path = require('path'); var util = require('util'); var events = require('events'); -var Xx = require('crypto'); +var ZE = require('crypto'); function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } -var Xx__default = /*#__PURE__*/_interopDefault(Xx); +var ZE__default = /*#__PURE__*/_interopDefault(ZE); -var zx=Object.create;var Jn=Object.defineProperty;var Gx=Object.getOwnPropertyDescriptor;var Vx=Object.getOwnPropertyNames;var Kx=Object.getPrototypeOf,Yx=Object.prototype.hasOwnProperty;var Jx=(t,e,r)=>e in t?Jn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var G=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var Ji=(t,e)=>()=>(t&&(e=t(t=0)),e);var _=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),sa=(t,e)=>{for(var r in e)Jn(t,r,{get:e[r],enumerable:!0});},Qf=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Vx(e))!Yx.call(t,s)&&s!==r&&Jn(t,s,{get:()=>e[s],enumerable:!(n=Gx(e,s))||n.enumerable});return t};var nn=(t,e,r)=>(r=t!=null?zx(Kx(t)):{},Qf(e||!t||!t.__esModule?Jn(r,"default",{value:t,enumerable:!0}):r,t)),oa=t=>Qf(Jn({},"__esModule",{value:!0}),t);var ie=(t,e,r)=>(Jx(t,typeof e!="symbol"?e+"":e,r),r),aa=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)};var S=(t,e,r)=>(aa(t,e,"read from private field"),r?r.call(t):e.get(t)),ue=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r);},ne=(t,e,r,n)=>(aa(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r);var Xi=(t,e,r,n)=>({set _(s){ne(t,e,s,r);},get _(){return S(t,e,n)}}),te=(t,e,r)=>(aa(t,e,"access private method"),r);var ca=_((dD,th)=>{var eh=Object.prototype.toString;th.exports=function(e){var r=eh.call(e),n=r==="[object Arguments]";return n||(n=r!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&eh.call(e.callee)==="[object Function]"),n};});var ch=_((yD,lh)=>{var uh;Object.keys||(Xn=Object.prototype.hasOwnProperty,fa=Object.prototype.toString,rh=ca(),ha=Object.prototype.propertyIsEnumerable,nh=!ha.call({toString:null},"toString"),ih=ha.call(function(){},"prototype"),Qn=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],es=function(t){var e=t.constructor;return e&&e.prototype===t},sh={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},oh=function(){if(typeof window>"u")return !1;for(var t in window)try{if(!sh["$"+t]&&Xn.call(window,t)&&window[t]!==null&&typeof window[t]=="object")try{es(window[t]);}catch{return !0}}catch{return !0}return !1}(),ah=function(t){if(typeof window>"u"||!oh)return es(t);try{return es(t)}catch{return !1}},uh=function(e){var r=e!==null&&typeof e=="object",n=fa.call(e)==="[object Function]",s=rh(e),i=r&&fa.call(e)==="[object String]",o=[];if(!r&&!n&&!s)throw new TypeError("Object.keys called on a non-object");var u=ih&&n;if(i&&e.length>0&&!Xn.call(e,0))for(var c=0;c0)for(var p=0;p{var eA=Array.prototype.slice,tA=ca(),fh=Object.keys,ts=fh?function(e){return fh(e)}:ch(),hh=Object.keys;ts.shim=function(){if(Object.keys){var e=function(){var r=Object.keys(arguments);return r&&r.length===arguments.length}(1,2);e||(Object.keys=function(n){return tA(n)?hh(eA.call(n)):hh(n)});}else Object.keys=ts;return Object.keys||ts};ph.exports=ts;});var ns=_((mD,dh)=>{dh.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return !1;if(typeof Symbol.iterator=="symbol")return !0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return !1;var s=42;e[r]=s;for(r in e)return !1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return !1;var i=Object.getOwnPropertySymbols(e);if(i.length!==1||i[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return !1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,r);if(o.value!==s||o.enumerable!==!0)return !1}return !0};});var pa=_((wD,gh)=>{var yh=typeof Symbol<"u"&&Symbol,rA=ns();gh.exports=function(){return typeof yh!="function"||typeof Symbol!="function"||typeof yh("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:rA()};});var vh=_((vD,wh)=>{var mh={foo:{}},nA=Object;wh.exports=function(){return {__proto__:mh}.foo===mh.foo&&!({__proto__:null}instanceof nA)};});var bh=_((SD,Sh)=>{var iA="Function.prototype.bind called on incompatible ",da=Array.prototype.slice,sA=Object.prototype.toString,oA="[object Function]";Sh.exports=function(e){var r=this;if(typeof r!="function"||sA.call(r)!==oA)throw new TypeError(iA+r);for(var n=da.call(arguments,1),s,i=function(){if(this instanceof s){var l=r.apply(this,n.concat(da.call(arguments)));return Object(l)===l?l:this}else return r.apply(e,n.concat(da.call(arguments)))},o=Math.max(0,r.length-n.length),u=[],c=0;c{var aA=bh();Eh.exports=Function.prototype.bind||aA;});var Ah=_((ED,xh)=>{var uA=is();xh.exports=uA.call(Function.call,Object.prototype.hasOwnProperty);});var qt=_((xD,Th)=>{var he,un=SyntaxError,Oh=Function,an=TypeError,ya=function(t){try{return Oh('"use strict"; return ('+t+").constructor;")()}catch{}},Ir=Object.getOwnPropertyDescriptor;var ga=function(){throw new an},lA=Ir?function(){try{return ga}catch{try{return Ir(arguments,"callee").get}catch{return ga}}}():ga,sn=pa()(),cA=vh()(),Fe=Object.getPrototypeOf||(cA?function(t){return t.__proto__}:null),on={},fA=typeof Uint8Array>"u"||!Fe?he:Fe(Uint8Array),$r={"%AggregateError%":typeof AggregateError>"u"?he:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?he:ArrayBuffer,"%ArrayIteratorPrototype%":sn&&Fe?Fe([][Symbol.iterator]()):he,"%AsyncFromSyncIteratorPrototype%":he,"%AsyncFunction%":on,"%AsyncGenerator%":on,"%AsyncGeneratorFunction%":on,"%AsyncIteratorPrototype%":on,"%Atomics%":typeof Atomics>"u"?he:Atomics,"%BigInt%":typeof BigInt>"u"?he:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?he:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?he:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?he:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?he:Float32Array,"%Float64Array%":typeof Float64Array>"u"?he:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?he:FinalizationRegistry,"%Function%":Oh,"%GeneratorFunction%":on,"%Int8Array%":typeof Int8Array>"u"?he:Int8Array,"%Int16Array%":typeof Int16Array>"u"?he:Int16Array,"%Int32Array%":typeof Int32Array>"u"?he:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":sn&&Fe?Fe(Fe([][Symbol.iterator]())):he,"%JSON%":typeof JSON=="object"?JSON:he,"%Map%":typeof Map>"u"?he:Map,"%MapIteratorPrototype%":typeof Map>"u"||!sn||!Fe?he:Fe(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?he:Promise,"%Proxy%":typeof Proxy>"u"?he:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?he:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?he:Set,"%SetIteratorPrototype%":typeof Set>"u"||!sn||!Fe?he:Fe(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?he:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":sn&&Fe?Fe(""[Symbol.iterator]()):he,"%Symbol%":sn?Symbol:he,"%SyntaxError%":un,"%ThrowTypeError%":lA,"%TypedArray%":fA,"%TypeError%":an,"%Uint8Array%":typeof Uint8Array>"u"?he:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?he:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?he:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?he:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?he:WeakMap,"%WeakRef%":typeof WeakRef>"u"?he:WeakRef,"%WeakSet%":typeof WeakSet>"u"?he:WeakSet};var hA=function t(e){var r;if(e==="%AsyncFunction%")r=ya("async function () {}");else if(e==="%GeneratorFunction%")r=ya("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=ya("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype);}else if(e==="%AsyncIteratorPrototype%"){var s=t("%AsyncGenerator%");s&&Fe&&(r=Fe(s.prototype));}return $r[e]=r,r},Ch={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Zn=is(),ss=Ah(),pA=Zn.call(Function.call,Array.prototype.concat),dA=Zn.call(Function.apply,Array.prototype.splice),Rh=Zn.call(Function.call,String.prototype.replace),os=Zn.call(Function.call,String.prototype.slice),yA=Zn.call(Function.call,RegExp.prototype.exec),gA=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,mA=/\\(\\)?/g,wA=function(e){var r=os(e,0,1),n=os(e,-1);if(r==="%"&&n!=="%")throw new un("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new un("invalid intrinsic syntax, expected opening `%`");var s=[];return Rh(e,gA,function(i,o,u,c){s[s.length]=u?Rh(c,mA,"$1"):o||i;}),s},vA=function(e,r){var n=e,s;if(ss(Ch,n)&&(s=Ch[n],n="%"+s[0]+"%"),ss($r,n)){var i=$r[n];if(i===on&&(i=hA(n)),typeof i>"u"&&!r)throw new an("intrinsic "+e+" exists, but is not available. Please file an issue!");return {alias:s,name:n,value:i}}throw new un("intrinsic "+e+" does not exist!")};Th.exports=function(e,r){if(typeof e!="string"||e.length===0)throw new an("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new an('"allowMissing" argument must be a boolean');if(yA(/^%?[^%]*%?$/,e)===null)throw new un("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=wA(e),s=n.length>0?n[0]:"",i=vA("%"+s+"%",r),o=i.name,u=i.value,c=!1,p=i.alias;p&&(s=p[0],dA(n,pA([0,1],p)));for(var l=1,d=!0;l=n.length){var E=Ir(u,g);d=!!E,d&&"get"in E&&!("originalValue"in E.get)?u=E.get:u=u[g];}else d=ss(u,g),u=u[g];d&&!c&&($r[o]=u);}}return u};});var as=_((AD,Ph)=>{var SA=qt(),ma=SA("%Object.defineProperty%",!0),wa=function(){if(ma)try{return ma({},"a",{value:1}),!0}catch{return !1}return !1};wa.hasArrayLengthDefineBug=function(){if(!wa())return null;try{return ma([],"length",{value:1}).length!==1}catch{return !0}};Ph.exports=wa;});var va=_((_D,Ih)=>{var bA=qt(),us=bA("%Object.getOwnPropertyDescriptor%",!0);if(us)try{us([],"length");}catch{us=null;}Ih.exports=us;});var ba=_((CD,kh)=>{var EA=as()(),Sa=qt(),$h=EA&&Sa("%Object.defineProperty%",!0),xA=Sa("%SyntaxError%"),ln=Sa("%TypeError%"),Fh=va();kh.exports=function(e,r,n){if(!e||typeof e!="object"&&typeof e!="function")throw new ln("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new ln("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new ln("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new ln("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new ln("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new ln("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,u=arguments.length>6?arguments[6]:!1,c=!!Fh&&Fh(e,r);if($h)$h(e,r,{configurable:o===null&&c?c.configurable:!o,enumerable:s===null&&c?c.enumerable:!s,value:n,writable:i===null&&c?c.writable:!i});else if(u||!s&&!i&&!o)e[r]=n;else throw new xA("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")};});var lr=_((RD,Dh)=>{var AA=rs(),_A=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",CA=Object.prototype.toString,RA=Array.prototype.concat,Lh=ba(),OA=function(t){return typeof t=="function"&&CA.call(t)==="[object Function]"},qh=as()(),TA=function(t,e,r,n){if(e in t){if(n===!0){if(t[e]===r)return}else if(!OA(n)||!n())return}qh?Lh(t,e,r,!0):Lh(t,e,r);},Bh=function(t,e){var r=arguments.length>2?arguments[2]:{},n=AA(e);_A&&(n=RA.call(n,Object.getOwnPropertySymbols(e)));for(var s=0;s{var Ea=is(),cn=qt(),Uh=cn("%Function.prototype.apply%"),jh=cn("%Function.prototype.call%"),Hh=cn("%Reflect.apply%",!0)||Ea.call(jh,Uh),Nh=cn("%Object.getOwnPropertyDescriptor%",!0),Fr=cn("%Object.defineProperty%",!0),PA=cn("%Math.max%");if(Fr)try{Fr({},"a",{value:1});}catch{Fr=null;}ls.exports=function(e){var r=Hh(Ea,jh,arguments);if(Nh&&Fr){var n=Nh(r,"length");n.configurable&&Fr(r,"length",{value:1+PA(0,e.length-(arguments.length-1))});}return r};var Mh=function(){return Hh(Ea,Uh,arguments)};Fr?Fr(ls.exports,"apply",{value:Mh}):ls.exports.apply=Mh;});var bt=_((TD,Gh)=>{var Wh=qt(),zh=kr(),IA=zh(Wh("String.prototype.indexOf"));Gh.exports=function(e,r){var n=Wh(e,!!r);return typeof n=="function"&&IA(e,".prototype.")>-1?zh(n):n};});var xa=_((PD,Xh)=>{var $A=rs(),Yh=ns()(),Jh=bt(),Vh=Object,FA=Jh("Array.prototype.push"),Kh=Jh("Object.prototype.propertyIsEnumerable"),kA=Yh?Object.getOwnPropertySymbols:null;Xh.exports=function(e,r){if(e==null)throw new TypeError("target must be an object");var n=Vh(e);if(arguments.length===1)return n;for(var s=1;s{var Aa=xa(),LA=function(){if(!Object.assign)return !1;for(var t="abcdefghijklmnopqrst",e=t.split(""),r={},n=0;n{var BA=lr(),DA=_a();Zh.exports=function(){var e=DA();return BA(Object,{assign:e},{assign:function(){return Object.assign!==e}}),e};});var ip=_((FD,np)=>{var NA=lr(),MA=kr(),UA=xa(),tp=_a(),jA=ep(),HA=MA.apply(tp()),rp=function(e,r){return HA(Object,arguments)};NA(rp,{getPolyfill:tp,implementation:UA,shim:jA});np.exports=rp;});var op=_((kD,sp)=>{var ti=function(){return typeof function(){}.name=="string"},ei=Object.getOwnPropertyDescriptor;ti.functionsHaveConfigurableNames=function(){if(!ti()||!ei)return !1;var e=ei(function(){},"name");return !!e&&!!e.configurable};var WA=Function.prototype.bind;ti.boundFunctionsHaveNames=function(){return ti()&&typeof WA=="function"&&function(){}.bind().name!==""};sp.exports=ti;});var lp=_((LD,up)=>{var ap=ba(),zA=as()(),GA=op().functionsHaveConfigurableNames(),VA=TypeError;up.exports=function(e,r){if(typeof e!="function")throw new VA("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return (!n||GA)&&(zA?ap(e,"name",r,!0,!0):ap(e,"name",r)),e};});var Ca=_((qD,cp)=>{var KA=lp(),YA=Object,JA=TypeError;cp.exports=KA(function(){if(this!=null&&this!==YA(this))throw new JA("RegExp.prototype.flags getter called on non-object");var e="";return this.hasIndices&&(e+="d"),this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.unicodeSets&&(e+="v"),this.sticky&&(e+="y"),e},"get flags",!0);});var Ra=_((BD,fp)=>{var XA=Ca(),QA=lr().supportsDescriptors,ZA=Object.getOwnPropertyDescriptor;fp.exports=function(){if(QA&&/a/mig.flags==="gim"){var e=ZA(RegExp.prototype,"flags");if(e&&typeof e.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var r="",n={};if(Object.defineProperty(n,"hasIndices",{get:function(){r+="d";}}),Object.defineProperty(n,"sticky",{get:function(){r+="y";}}),r==="dy")return e.get}}return XA};});var dp=_((DD,pp)=>{var e_=lr().supportsDescriptors,t_=Ra(),r_=Object.getOwnPropertyDescriptor,n_=Object.defineProperty,i_=TypeError,hp=Object.getPrototypeOf,s_=/a/;pp.exports=function(){if(!e_||!hp)throw new i_("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=t_(),r=hp(s_),n=r_(r,"flags");return (!n||n.get!==e)&&n_(r,"flags",{configurable:!0,enumerable:!1,get:e}),e};});var wp=_((ND,mp)=>{var o_=lr(),a_=kr(),u_=Ca(),yp=Ra(),l_=dp(),gp=a_(yp());o_(gp,{getPolyfill:yp,implementation:u_,shim:l_});mp.exports=gp;});var bp=_((MD,Sp)=>{var vp=Symbol.iterator;Sp.exports=function(e){if(e!=null&&typeof e[vp]<"u")return e[vp]()};});var xp=_((UD,Ep)=>{Ep.exports=G("util").inspect;});var Hp=_((jD,jp)=>{var Ba=typeof Map=="function"&&Map.prototype,Oa=Object.getOwnPropertyDescriptor&&Ba?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,fs=Ba&&Oa&&typeof Oa.get=="function"?Oa.get:null,Ap=Ba&&Map.prototype.forEach,Da=typeof Set=="function"&&Set.prototype,Ta=Object.getOwnPropertyDescriptor&&Da?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,hs=Da&&Ta&&typeof Ta.get=="function"?Ta.get:null,_p=Da&&Set.prototype.forEach,c_=typeof WeakMap=="function"&&WeakMap.prototype,ni=c_?WeakMap.prototype.has:null,f_=typeof WeakSet=="function"&&WeakSet.prototype,ii=f_?WeakSet.prototype.has:null,h_=typeof WeakRef=="function"&&WeakRef.prototype,Cp=h_?WeakRef.prototype.deref:null,p_=Boolean.prototype.valueOf,d_=Object.prototype.toString,y_=Function.prototype.toString,g_=String.prototype.match,Na=String.prototype.slice,fr=String.prototype.replace,m_=String.prototype.toUpperCase,Rp=String.prototype.toLowerCase,qp=RegExp.prototype.test,Op=Array.prototype.concat,Bt=Array.prototype.join,w_=Array.prototype.slice,Tp=Math.floor,$a=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Pa=Object.getOwnPropertySymbols,Fa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,fn=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Ge=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===fn||"symbol")?Symbol.toStringTag:null,Bp=Object.prototype.propertyIsEnumerable,Pp=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function Ip(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||qp.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-Tp(-t):Tp(t);if(n!==t){var s=String(n),i=Na.call(e,s.length+1);return fr.call(s,r,"$&_")+"."+fr.call(fr.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return fr.call(e,r,"$&_")}var ka=xp(),$p=ka.custom,Fp=Np($p)?$p:null;jp.exports=function t(e,r,n,s){var i=r||{};if(cr(i,"quoteStyle")&&i.quoteStyle!=="single"&&i.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(cr(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=cr(i,"customInspect")?i.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(cr(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(cr(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var u=i.numericSeparator;if(typeof e>"u")return "undefined";if(e===null)return "null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Up(e,i);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var c=String(e);return u?Ip(e,c):c}if(typeof e=="bigint"){var p=String(e)+"n";return u?Ip(e,p):p}var l=typeof i.depth>"u"?5:i.depth;if(typeof n>"u"&&(n=0),n>=l&&l>0&&typeof e=="object")return La(e)?"[Array]":"[Object]";var d=q_(i,n);if(typeof s>"u")s=[];else if(Mp(s,e)>=0)return "[Circular]";function g(J,oe,P){if(oe&&(s=w_.call(s),s.push(oe)),P){var I={depth:i.depth};return cr(i,"quoteStyle")&&(I.quoteStyle=i.quoteStyle),t(J,I,n+1,s)}return t(J,i,n+1,s)}if(typeof e=="function"&&!kp(e)){var m=R_(e),w=cs(e,g);return "[Function"+(m?": "+m:" (anonymous)")+"]"+(w.length>0?" { "+Bt.call(w,", ")+" }":"")}if(Np(e)){var E=fn?fr.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Fa.call(e);return typeof e=="object"&&!fn?ri(E):E}if(F_(e)){for(var A="<"+Rp.call(String(e.nodeName)),R=e.attributes||[],x=0;x",A}if(La(e)){if(e.length===0)return "[]";var O=cs(e,g);return d&&!L_(O)?"["+qa(O,d)+"]":"[ "+Bt.call(O,", ")+" ]"}if(b_(e)){var F=cs(e,g);return !("cause"in Error.prototype)&&"cause"in e&&!Bp.call(e,"cause")?"{ ["+String(e)+"] "+Bt.call(Op.call("[cause]: "+g(e.cause),F),", ")+" }":F.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Bt.call(F,", ")+" }"}if(typeof e=="object"&&o){if(Fp&&typeof e[Fp]=="function"&&ka)return ka(e,{depth:l-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(O_(e)){var q=[];return Ap&&Ap.call(e,function(J,oe){q.push(g(oe,e,!0)+" => "+g(J,e));}),Lp("Map",fs.call(e),q,d)}if(I_(e)){var W=[];return _p&&_p.call(e,function(J){W.push(g(J,e));}),Lp("Set",hs.call(e),W,d)}if(T_(e))return Ia("WeakMap");if($_(e))return Ia("WeakSet");if(P_(e))return Ia("WeakRef");if(x_(e))return ri(g(Number(e)));if(__(e))return ri(g($a.call(e)));if(A_(e))return ri(p_.call(e));if(E_(e))return ri(g(String(e)));if(!S_(e)&&!kp(e)){var H=cs(e,g),B=Pp?Pp(e)===Object.prototype:e instanceof Object||e.constructor===Object,k=e instanceof Object?"":"null prototype",U=!B&&Ge&&Object(e)===e&&Ge in e?Na.call(hr(e),8,-1):k?"Object":"",C=B||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",Y=C+(U||k?"["+Bt.call(Op.call([],U||[],k||[]),": ")+"] ":"");return H.length===0?Y+"{}":d?Y+"{"+qa(H,d)+"}":Y+"{ "+Bt.call(H,", ")+" }"}return String(e)};function Dp(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function v_(t){return fr.call(String(t),/"/g,""")}function La(t){return hr(t)==="[object Array]"&&(!Ge||!(typeof t=="object"&&Ge in t))}function S_(t){return hr(t)==="[object Date]"&&(!Ge||!(typeof t=="object"&&Ge in t))}function kp(t){return hr(t)==="[object RegExp]"&&(!Ge||!(typeof t=="object"&&Ge in t))}function b_(t){return hr(t)==="[object Error]"&&(!Ge||!(typeof t=="object"&&Ge in t))}function E_(t){return hr(t)==="[object String]"&&(!Ge||!(typeof t=="object"&&Ge in t))}function x_(t){return hr(t)==="[object Number]"&&(!Ge||!(typeof t=="object"&&Ge in t))}function A_(t){return hr(t)==="[object Boolean]"&&(!Ge||!(typeof t=="object"&&Ge in t))}function Np(t){if(fn)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return !0;if(!t||typeof t!="object"||!Fa)return !1;try{return Fa.call(t),!0}catch{}return !1}function __(t){if(!t||typeof t!="object"||!$a)return !1;try{return $a.call(t),!0}catch{}return !1}var C_=Object.prototype.hasOwnProperty||function(t){return t in this};function cr(t,e){return C_.call(t,e)}function hr(t){return d_.call(t)}function R_(t){if(t.name)return t.name;var e=g_.call(y_.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function Mp(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Up(Na.call(t,0,e.maxStringLength),e)+n}var s=fr.call(fr.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,k_);return Dp(s,"single",e)}function k_(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+m_.call(e.toString(16))}function ri(t){return "Object("+t+")"}function Ia(t){return t+" { ? }"}function Lp(t,e,r,n){var s=n?qa(r,n):Bt.call(r,", ");return t+" ("+e+") {"+s+"}"}function L_(t){for(var e=0;e=0)return !1;return !0}function q_(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=Bt.call(Array(t.indent+1)," ");else return null;return {base:r,prev:Bt.call(Array(e+1),r)}}function qa(t,e){if(t.length===0)return "";var r=` -`+e.prev+e.base;return r+Bt.call(t,","+r)+` -`+e.prev}function cs(t,e){var r=La(t),n=[];if(r){n.length=t.length;for(var s=0;s{var Ma=qt(),hn=bt(),B_=Hp(),D_=Ma("%TypeError%"),ps=Ma("%WeakMap%",!0),ds=Ma("%Map%",!0),N_=hn("WeakMap.prototype.get",!0),M_=hn("WeakMap.prototype.set",!0),U_=hn("WeakMap.prototype.has",!0),j_=hn("Map.prototype.get",!0),H_=hn("Map.prototype.set",!0),W_=hn("Map.prototype.has",!0),Ua=function(t,e){for(var r=t,n;(n=r.next)!==null;r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n},z_=function(t,e){var r=Ua(t,e);return r&&r.value},G_=function(t,e,r){var n=Ua(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r};},V_=function(t,e){return !!Ua(t,e)};Wp.exports=function(){var e,r,n,s={assert:function(i){if(!s.has(i))throw new D_("Side channel does not contain "+B_(i))},get:function(i){if(ps&&i&&(typeof i=="object"||typeof i=="function")){if(e)return N_(e,i)}else if(ds){if(r)return j_(r,i)}else if(n)return z_(n,i)},has:function(i){if(ps&&i&&(typeof i=="object"||typeof i=="function")){if(e)return U_(e,i)}else if(ds){if(r)return W_(r,i)}else if(n)return V_(n,i);return !1},set:function(i,o){ps&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new ps),M_(e,i,o)):ds?(r||(r=new ds),H_(r,i,o)):(n||(n={key:{},next:null}),G_(n,i,o));}};return s};});var ja=_((WD,Vp)=>{var Gp=function(t){return t!==t};Vp.exports=function(e,r){return e===0&&r===0?1/e===1/r:!!(e===r||Gp(e)&&Gp(r))};});var Ha=_((zD,Kp)=>{var K_=ja();Kp.exports=function(){return typeof Object.is=="function"?Object.is:K_};});var Jp=_((GD,Yp)=>{var Y_=Ha(),J_=lr();Yp.exports=function(){var e=Y_();return J_(Object,{is:e},{is:function(){return Object.is!==e}}),e};});var ed=_((VD,Zp)=>{var X_=lr(),Q_=kr(),Z_=ja(),Xp=Ha(),e1=Jp(),Qp=Q_(Xp(),Object);X_(Qp,{getPolyfill:Xp,implementation:Z_,shim:e1});Zp.exports=Qp;});var pr=_((KD,td)=>{var t1=ns();td.exports=function(){return t1()&&!!Symbol.toStringTag};});var id=_((YD,nd)=>{var r1=pr()(),n1=bt(),Wa=n1("Object.prototype.toString"),ys=function(e){return r1&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:Wa(e)==="[object Arguments]"},rd=function(e){return ys(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Wa(e)!=="[object Array]"&&Wa(e.callee)==="[object Function]"},i1=function(){return ys(arguments)}();ys.isLegacyArguments=rd;nd.exports=i1?ys:rd;});var od=_((JD,sd)=>{var s1={}.toString;sd.exports=Array.isArray||function(t){return s1.call(t)=="[object Array]"};});var cd=_((XD,ld)=>{var ud=Function.prototype.toString,pn=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Ga,gs;if(typeof pn=="function"&&typeof Object.defineProperty=="function")try{Ga=Object.defineProperty({},"length",{get:function(){throw gs}}),gs={},pn(function(){throw 42},null,Ga);}catch(t){t!==gs&&(pn=null);}else pn=null;var o1=/^\s*class\b/,Va=function(e){try{var r=ud.call(e);return o1.test(r)}catch{return !1}},za=function(e){try{return Va(e)?!1:(ud.call(e),!0)}catch{return !1}},ms=Object.prototype.toString,a1="[object Object]",u1="[object Function]",l1="[object GeneratorFunction]",c1="[object HTMLAllCollection]",f1="[object HTML document.all class]",h1="[object HTMLCollection]",p1=typeof Symbol=="function"&&!!Symbol.toStringTag,d1=!(0 in[,]),Ka=function(){return !1};typeof document=="object"&&(ad=document.all,ms.call(ad)===ms.call(document.all)&&(Ka=function(e){if((d1||!e)&&(typeof e>"u"||typeof e=="object"))try{var r=ms.call(e);return (r===c1||r===f1||r===h1||r===a1)&&e("")==null}catch{}return !1}));var ad;ld.exports=pn?function(e){if(Ka(e))return !0;if(!e||typeof e!="function"&&typeof e!="object")return !1;try{pn(e,null,Ga);}catch(r){if(r!==gs)return !1}return !Va(e)&&za(e)}:function(e){if(Ka(e))return !0;if(!e||typeof e!="function"&&typeof e!="object")return !1;if(p1)return za(e);if(Va(e))return !1;var r=ms.call(e);return r!==u1&&r!==l1&&!/^\[object HTML/.test(r)?!1:za(e)};});var pd=_((QD,hd)=>{var y1=cd(),g1=Object.prototype.toString,fd=Object.prototype.hasOwnProperty,m1=function(e,r,n){for(var s=0,i=e.length;s=3&&(s=n),g1.call(e)==="[object Array]"?m1(e,r,s):typeof e=="string"?w1(e,r,s):v1(e,r,s);};hd.exports=S1;});var yd=_((ZD,dd)=>{var Ya=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],b1=typeof globalThis>"u"?global:globalThis;dd.exports=function(){for(var e=[],r=0;r{var vs=pd(),E1=yd(),gd=kr(),Qa=bt(),ws=va(),x1=Qa("Object.prototype.toString"),wd=pr()(),md=typeof globalThis>"u"?global:globalThis,Xa=E1(),Za=Qa("String.prototype.slice"),Ja=Object.getPrototypeOf,A1=Qa("Array.prototype.indexOf",!0)||function(e,r){for(var n=0;n-1?r:r!=="Object"?!1:C1(e)}return ws?_1(e):null};});var bd=_((tN,Sd)=>{var R1=eu();Sd.exports=function(e){return !!R1(e)};});var tu=_((rN,Rd)=>{var O1=kr(),T1=bt(),Cd=qt(),P1=bd(),Ed=Cd("ArrayBuffer",!0),xd=Cd("Float32Array",!0),bs=T1("ArrayBuffer.prototype.byteLength",!0),Ad=Ed&&!bs&&new Ed().slice,_d=Ad&&O1(Ad);Rd.exports=bs||_d?function(e){if(!e||typeof e!="object")return !1;try{return bs?bs(e):_d(e,0),!0}catch{return !1}}:xd?function(e){try{return new xd(e).buffer===e&&!P1(e)}catch(r){return typeof e=="object"&&r.name==="RangeError"}}:function(e){return !1};});var Td=_((nN,Od)=>{var I1=Date.prototype.getDay,$1=function(e){try{return I1.call(e),!0}catch{return !1}},F1=Object.prototype.toString,k1="[object Date]",L1=pr()();Od.exports=function(e){return typeof e!="object"||e===null?!1:L1?$1(e):F1.call(e)===k1};});var kd=_((iN,Fd)=>{var ru=bt(),Pd=pr()(),Id,$d,nu,iu;Pd&&(Id=ru("Object.prototype.hasOwnProperty"),$d=ru("RegExp.prototype.exec"),nu={},Es=function(){throw nu},iu={toString:Es,valueOf:Es},typeof Symbol.toPrimitive=="symbol"&&(iu[Symbol.toPrimitive]=Es));var Es,q1=ru("Object.prototype.toString"),B1=Object.getOwnPropertyDescriptor,D1="[object RegExp]";Fd.exports=Pd?function(e){if(!e||typeof e!="object")return !1;var r=B1(e,"lastIndex"),n=r&&Id(r,"value");if(!n)return !1;try{$d(e,iu);}catch(s){return s===nu}}:function(e){return !e||typeof e!="object"&&typeof e!="function"?!1:q1(e)===D1};});var Bd=_((sN,qd)=>{var N1=bt(),Ld=N1("SharedArrayBuffer.prototype.byteLength",!0);qd.exports=Ld?function(e){if(!e||typeof e!="object")return !1;try{return Ld(e),!0}catch{return !1}}:function(e){return !1};});var Nd=_((oN,Dd)=>{var M1=String.prototype.valueOf,U1=function(e){try{return M1.call(e),!0}catch{return !1}},j1=Object.prototype.toString,H1="[object String]",W1=pr()();Dd.exports=function(e){return typeof e=="string"?!0:typeof e!="object"?!1:W1?U1(e):j1.call(e)===H1};});var Ud=_((aN,Md)=>{var z1=Number.prototype.toString,G1=function(e){try{return z1.call(e),!0}catch{return !1}},V1=Object.prototype.toString,K1="[object Number]",Y1=pr()();Md.exports=function(e){return typeof e=="number"?!0:typeof e!="object"?!1:Y1?G1(e):V1.call(e)===K1};});var Wd=_((uN,Hd)=>{var jd=bt(),J1=jd("Boolean.prototype.toString"),X1=jd("Object.prototype.toString"),Q1=function(e){try{return J1(e),!0}catch{return !1}},Z1="[object Boolean]",eC=pr()();Hd.exports=function(e){return typeof e=="boolean"?!0:e===null||typeof e!="object"?!1:eC&&Symbol.toStringTag in e?Q1(e):X1(e)===Z1};});var Kd=_((lN,su)=>{var tC=Object.prototype.toString,rC=pa()();rC?(zd=Symbol.prototype.toString,Gd=/^Symbol\(.*\)$/,Vd=function(e){return typeof e.valueOf()!="symbol"?!1:Gd.test(zd.call(e))},su.exports=function(e){if(typeof e=="symbol")return !0;if(tC.call(e)!=="[object Symbol]")return !1;try{return Vd(e)}catch{return !1}}):su.exports=function(e){return !1};var zd,Gd,Vd;});var Xd=_((cN,Jd)=>{var Yd=typeof BigInt<"u"&&BigInt;Jd.exports=function(){return typeof Yd=="function"&&typeof BigInt=="function"&&typeof Yd(42)=="bigint"&&typeof BigInt(42)=="bigint"};});var ey=_((fN,ou)=>{var nC=Xd()();nC?(Qd=BigInt.prototype.valueOf,Zd=function(e){try{return Qd.call(e),!0}catch{}return !1},ou.exports=function(e){return e===null||typeof e>"u"||typeof e=="boolean"||typeof e=="string"||typeof e=="number"||typeof e=="symbol"||typeof e=="function"?!1:typeof e=="bigint"?!0:Zd(e)}):ou.exports=function(e){return !1};var Qd,Zd;});var ry=_((hN,ty)=>{var iC=Nd(),sC=Ud(),oC=Wd(),aC=Kd(),uC=ey();ty.exports=function(e){if(e==null||typeof e!="object"&&typeof e!="function")return null;if(iC(e))return "String";if(sC(e))return "Number";if(oC(e))return "Boolean";if(aC(e))return "Symbol";if(uC(e))return "BigInt"};});var oy=_((pN,sy)=>{var au=typeof Map=="function"&&Map.prototype?Map:null,lC=typeof Set=="function"&&Set.prototype?Set:null,xs;au||(xs=function(e){return !1});var iy=au?Map.prototype.has:null,ny=lC?Set.prototype.has:null;!xs&&!iy&&(xs=function(e){return !1});sy.exports=xs||function(e){if(!e||typeof e!="object")return !1;try{if(iy.call(e),ny)try{ny.call(e);}catch{return !0}return e instanceof au}catch{}return !1};});var cy=_((dN,ly)=>{var cC=typeof Map=="function"&&Map.prototype?Map:null,uu=typeof Set=="function"&&Set.prototype?Set:null,As;uu||(As=function(e){return !1});var ay=cC?Map.prototype.has:null,uy=uu?Set.prototype.has:null;!As&&!uy&&(As=function(e){return !1});ly.exports=As||function(e){if(!e||typeof e!="object")return !1;try{if(uy.call(e),ay)try{ay.call(e);}catch{return !0}return e instanceof uu}catch{}return !1};});var py=_((yN,hy)=>{var _s=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,fy=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,Cs;_s||(Cs=function(e){return !1});var cu=_s?_s.prototype.has:null,lu=fy?fy.prototype.has:null;!Cs&&!cu&&(Cs=function(e){return !1});hy.exports=Cs||function(e){if(!e||typeof e!="object")return !1;try{if(cu.call(e,cu),lu)try{lu.call(e,lu);}catch{return !0}return e instanceof _s}catch{}return !1};});var yy=_((gN,hu)=>{var fC=qt(),dy=bt(),hC=fC("%WeakSet%",!0),fu=dy("WeakSet.prototype.has",!0);fu?(Rs=dy("WeakMap.prototype.has",!0),hu.exports=function(e){if(!e||typeof e!="object")return !1;try{if(fu(e,fu),Rs)try{Rs(e,Rs);}catch{return !0}return e instanceof hC}catch{}return !1}):hu.exports=function(e){return !1};var Rs;});var my=_((mN,gy)=>{var pC=oy(),dC=cy(),yC=py(),gC=yy();gy.exports=function(e){if(e&&typeof e=="object"){if(pC(e))return "Map";if(dC(e))return "Set";if(yC(e))return "WeakMap";if(gC(e))return "WeakSet"}return !1};});var Sy=_((wN,vy)=>{var mC=bt(),wy=mC("ArrayBuffer.prototype.byteLength",!0),wC=tu();vy.exports=function(e){return wC(e)?wy?wy(e):e.byteLength:NaN};});var zy=_((vN,Wy)=>{var Uy=ip(),Dt=bt(),by=wp(),vC=qt(),dn=bp(),SC=zp(),Ey=ed(),xy=id(),Ay=od(),_y=tu(),Cy=Td(),Ry=kd(),Oy=Bd(),Ty=rs(),Py=ry(),Iy=my(),$y=eu(),Fy=Sy(),ky=Dt("SharedArrayBuffer.prototype.byteLength",!0),Ly=Dt("Date.prototype.getTime"),pu=Object.getPrototypeOf,qy=Dt("Object.prototype.toString"),Ts=vC("%Set%",!0),du=Dt("Map.prototype.has",!0),Ps=Dt("Map.prototype.get",!0),By=Dt("Map.prototype.size",!0),Is=Dt("Set.prototype.add",!0),jy=Dt("Set.prototype.delete",!0),$s=Dt("Set.prototype.has",!0),Os=Dt("Set.prototype.size",!0);function Dy(t,e,r,n){for(var s=dn(t),i;(i=s.next())&&!i.done;)if(Ct(e,i.value,r,n))return jy(t,i.value),!0;return !1}function Hy(t){if(typeof t>"u")return null;if(typeof t!="object")return typeof t=="symbol"?!1:typeof t=="string"||typeof t=="number"?+t==+t:!0}function bC(t,e,r,n,s,i){var o=Hy(r);if(o!=null)return o;var u=Ps(e,o),c=Uy({},s,{strict:!1});return typeof u>"u"&&!du(e,o)||!Ct(n,u,c,i)?!1:!du(t,o)&&Ct(n,u,c,i)}function EC(t,e,r){var n=Hy(r);return n??($s(e,n)&&!$s(t,n))}function Ny(t,e,r,n,s,i){for(var o=dn(t),u,c;(u=o.next())&&!u.done;)if(c=u.value,Ct(r,c,s,i)&&Ct(n,Ps(e,c),s,i))return jy(t,c),!0;return !1}function Ct(t,e,r,n){var s=r||{};if(s.strict?Ey(t,e):t===e)return !0;var i=Py(t),o=Py(e);if(i!==o)return !1;if(!t||!e||typeof t!="object"&&typeof e!="object")return s.strict?Ey(t,e):t==e;var u=n.has(t),c=n.has(e),p;if(u&&c){if(n.get(t)===n.get(e))return !0}else p={};return u||n.set(t,p),c||n.set(e,p),_C(t,e,s,n)}function My(t){return !t||typeof t!="object"||typeof t.length!="number"||typeof t.copy!="function"||typeof t.slice!="function"||t.length>0&&typeof t[0]!="number"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function xC(t,e,r,n){if(Os(t)!==Os(e))return !1;for(var s=dn(t),i=dn(e),o,u,c;(o=s.next())&&!o.done;)if(o.value&&typeof o.value=="object")c||(c=new Ts),Is(c,o.value);else if(!$s(e,o.value)){if(r.strict||!EC(t,e,o.value))return !1;c||(c=new Ts),Is(c,o.value);}if(c){for(;(u=i.next())&&!u.done;)if(u.value&&typeof u.value=="object"){if(!Dy(c,u.value,r.strict,n))return !1}else if(!r.strict&&!$s(t,u.value)&&!Dy(c,u.value,r.strict,n))return !1;return Os(c)===0}return !0}function AC(t,e,r,n){if(By(t)!==By(e))return !1;for(var s=dn(t),i=dn(e),o,u,c,p,l,d;(o=s.next())&&!o.done;)if(p=o.value[0],l=o.value[1],p&&typeof p=="object")c||(c=new Ts),Is(c,p);else if(d=Ps(e,p),typeof d>"u"&&!du(e,p)||!Ct(l,d,r,n)){if(r.strict||!bC(t,e,p,l,r,n))return !1;c||(c=new Ts),Is(c,p);}if(c){for(;(u=i.next())&&!u.done;)if(p=u.value[0],d=u.value[1],p&&typeof p=="object"){if(!Ny(c,t,p,d,r,n))return !1}else if(!r.strict&&(!t.has(p)||!Ct(Ps(t,p),d,r,n))&&!Ny(c,t,p,d,Uy({},r,{strict:!1}),n))return !1;return Os(c)===0}return !0}function _C(t,e,r,n){var s,i;if(typeof t!=typeof e||t==null||e==null||qy(t)!==qy(e)||xy(t)!==xy(e))return !1;var o=Ay(t),u=Ay(e);if(o!==u)return !1;var c=t instanceof Error,p=e instanceof Error;if(c!==p||(c||p)&&(t.name!==e.name||t.message!==e.message))return !1;var l=Ry(t),d=Ry(e);if(l!==d||(l||d)&&(t.source!==e.source||by(t)!==by(e)))return !1;var g=Cy(t),m=Cy(e);if(g!==m||(g||m)&&Ly(t)!==Ly(e)||r.strict&&pu&&pu(t)!==pu(e))return !1;var w=$y(t),E=$y(e);if(w!==E)return !1;if(w||E){if(t.length!==e.length)return !1;for(s=0;s=0;s--)if(W[s]!=H[s])return !1;for(s=W.length-1;s>=0;s--)if(i=W[s],!Ct(t[i],e[i],r,n))return !1;var B=Iy(t),k=Iy(e);return B!==k?!1:B==="Set"||k==="Set"?xC(t,e,r,n):B==="Map"?AC(t,e,r,n):!0}Wy.exports=function(e,r,n){return Ct(e,r,n,SC())};});var ng={};sa(ng,{closest:()=>YC,distance:()=>rg});var Yt,VC,KC,rg,YC,ig=Ji(()=>{Yt=new Uint32Array(65536),VC=(t,e)=>{let r=t.length,n=e.length,s=1<{let r=e.length,n=t.length,s=[],i=[],o=Math.ceil(r/32),u=Math.ceil(n/32);for(let w=0;w>>x&1,q=s[x/32|0]>>>x&1,W=O|w,H=((O|q)&E)+E^E|O|q,B=w|~(H|E),k=E&H;B>>>31^F&&(i[x/32|0]^=1<>>31^q&&(s[x/32|0]^=1<>>w&1,R=s[w/32|0]>>>w&1,x=E|p,O=((E|R)&l)+l^l|E|R,F=p|~(O|l),q=l&O;m+=F>>>n-1&1,m-=q>>>n-1&1,F>>>31^A&&(i[w/32|0]^=1<>>31^R&&(s[w/32|0]^=1<{if(t.length{let r=1/0,n=0;for(let s=0;s{(function(){var t;try{t=typeof Intl<"u"&&typeof Intl.Collator<"u"?Intl.Collator("generic",{sensitivity:"base"}):null;}catch{console.log("Collator could not be initialized and wouldn't be used");}var e=(ig(),oa(ng)),r=[],n=[],s={get:function(i,o,u){var c=u&&t&&u.useCollator;if(c){var p=i.length,l=o.length;if(p===0)return l;if(l===0)return p;var d,g,m,w,E;for(m=0;mE&&(g=E),E=r[w+1]+1,g>E&&(g=E),r[w]=d;r[w]=g;}return g}return e.distance(i,o)}};typeof define<"u"&&define!==null&&define.amd?define(function(){return s}):typeof oi<"u"&&oi!==null&&typeof vu<"u"&&oi.exports===vu?oi.exports=s:typeof self<"u"&&typeof self.postMessage=="function"&&typeof self.importScripts=="function"?self.Levenshtein=s:typeof window<"u"&&window!==null&&(window.Levenshtein=s);})();});var ui=Ji(()=>{});var Ze=_(Eu=>{Eu.fromCallback=function(t){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")t.apply(this,e);else return new Promise((r,n)=>{t.call(this,...e,(s,i)=>s!=null?n(s):r(i));})},"name",{value:t.name})};Eu.fromPromise=function(t){return Object.defineProperty(function(...e){let r=e[e.length-1];if(typeof r!="function")return t.apply(this,e);t.apply(this,e.slice(0,-1)).then(n=>r(null,n),r);},"name",{value:t.name})};});var cg=_((ON,lg)=>{var yr=G("constants"),QC=process.cwd,Bs=null,ZC=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Bs||(Bs=QC.call(process)),Bs};try{process.cwd();}catch{}typeof process.chdir=="function"&&(xu=process.chdir,process.chdir=function(t){Bs=null,xu.call(process,t);},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,xu));var xu;lg.exports=eR;function eR(t){yr.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=i(t.chown),t.fchown=i(t.fchown),t.lchown=i(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=o(t.chownSync),t.fchownSync=o(t.fchownSync),t.lchownSync=o(t.lchownSync),t.chmodSync=s(t.chmodSync),t.fchmodSync=s(t.fchmodSync),t.lchmodSync=s(t.lchmodSync),t.stat=u(t.stat),t.fstat=u(t.fstat),t.lstat=u(t.lstat),t.statSync=c(t.statSync),t.fstatSync=c(t.fstatSync),t.lstatSync=c(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(l,d,g){g&&process.nextTick(g);},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(l,d,g,m){m&&process.nextTick(m);},t.lchownSync=function(){}),ZC==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(l){function d(g,m,w){var E=Date.now(),A=0;l(g,m,function R(x){if(x&&(x.code==="EACCES"||x.code==="EPERM"||x.code==="EBUSY")&&Date.now()-E<6e4){setTimeout(function(){t.stat(m,function(O,F){O&&O.code==="ENOENT"?l(g,m,R):w(x);});},A),A<100&&(A+=10);return}w&&w(x);});}return Object.setPrototypeOf&&Object.setPrototypeOf(d,l),d}(t.rename)),t.read=typeof t.read!="function"?t.read:function(l){function d(g,m,w,E,A,R){var x;if(R&&typeof R=="function"){var O=0;x=function(F,q,W){if(F&&F.code==="EAGAIN"&&O<10)return O++,l.call(t,g,m,w,E,A,x);R.apply(this,arguments);};}return l.call(t,g,m,w,E,A,x)}return Object.setPrototypeOf&&Object.setPrototypeOf(d,l),d}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(l){return function(d,g,m,w,E){for(var A=0;;)try{return l.call(t,d,g,m,w,E)}catch(R){if(R.code==="EAGAIN"&&A<10){A++;continue}throw R}}}(t.readSync);function e(l){l.lchmod=function(d,g,m){l.open(d,yr.O_WRONLY|yr.O_SYMLINK,g,function(w,E){if(w){m&&m(w);return}l.fchmod(E,g,function(A){l.close(E,function(R){m&&m(A||R);});});});},l.lchmodSync=function(d,g){var m=l.openSync(d,yr.O_WRONLY|yr.O_SYMLINK,g),w=!0,E;try{E=l.fchmodSync(m,g),w=!1;}finally{if(w)try{l.closeSync(m);}catch{}else l.closeSync(m);}return E};}function r(l){yr.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(d,g,m,w){l.open(d,yr.O_SYMLINK,function(E,A){if(E){w&&w(E);return}l.futimes(A,g,m,function(R){l.close(A,function(x){w&&w(R||x);});});});},l.lutimesSync=function(d,g,m){var w=l.openSync(d,yr.O_SYMLINK),E,A=!0;try{E=l.futimesSync(w,g,m),A=!1;}finally{if(A)try{l.closeSync(w);}catch{}else l.closeSync(w);}return E}):l.futimes&&(l.lutimes=function(d,g,m,w){w&&process.nextTick(w);},l.lutimesSync=function(){});}function n(l){return l&&function(d,g,m){return l.call(t,d,g,function(w){p(w)&&(w=null),m&&m.apply(this,arguments);})}}function s(l){return l&&function(d,g){try{return l.call(t,d,g)}catch(m){if(!p(m))throw m}}}function i(l){return l&&function(d,g,m,w){return l.call(t,d,g,m,function(E){p(E)&&(E=null),w&&w.apply(this,arguments);})}}function o(l){return l&&function(d,g,m){try{return l.call(t,d,g,m)}catch(w){if(!p(w))throw w}}}function u(l){return l&&function(d,g,m){typeof g=="function"&&(m=g,g=null);function w(E,A){A&&(A.uid<0&&(A.uid+=4294967296),A.gid<0&&(A.gid+=4294967296)),m&&m.apply(this,arguments);}return g?l.call(t,d,g,w):l.call(t,d,w)}}function c(l){return l&&function(d,g){var m=g?l.call(t,d,g):l.call(t,d);return m&&(m.uid<0&&(m.uid+=4294967296),m.gid<0&&(m.gid+=4294967296)),m}}function p(l){if(!l||l.code==="ENOSYS")return !0;var d=!process.getuid||process.getuid()!==0;return !!(d&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var pg=_((TN,hg)=>{var fg=G("stream").Stream;hg.exports=tR;function tR(t){return {ReadStream:e,WriteStream:r};function e(n,s){if(!(this instanceof e))return new e(n,s);fg.call(this);var i=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,s=s||{};for(var o=Object.keys(s),u=0,c=o.length;uthis.end)throw new Error("start must be <= end");this.pos=this.start;}if(this.fd!==null){process.nextTick(function(){i._read();});return}t.open(this.path,this.flags,this.mode,function(l,d){if(l){i.emit("error",l),i.readable=!1;return}i.fd=d,i.emit("open",d),i._read();});}function r(n,s){if(!(this instanceof r))return new r(n,s);fg.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,s=s||{};for(var i=Object.keys(s),o=0,u=i.length;o= zero");this.pos=this.start;}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush());}}});var yg=_((PN,dg)=>{dg.exports=nR;var rR=Object.getPrototypeOf||function(t){return t.__proto__};function nR(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:rR(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));}),e}});var et=_((IN,Cu)=>{var Ae=G("fs"),iR=cg(),sR=pg(),oR=yg(),Ds=G("util"),We,Ms;typeof Symbol=="function"&&typeof Symbol.for=="function"?(We=Symbol.for("graceful-fs.queue"),Ms=Symbol.for("graceful-fs.previous")):(We="___graceful-fs.queue",Ms="___graceful-fs.previous");function aR(){}function wg(t,e){Object.defineProperty(t,We,{get:function(){return e}});}var qr=aR;Ds.debuglog?qr=Ds.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(qr=function(){var t=Ds.format.apply(Ds,arguments);t="GFS4: "+t.split(/\n/).join(` -GFS4: `),console.error(t);});Ae[We]||(gg=global[We]||[],wg(Ae,gg),Ae.close=function(t){function e(r,n){return t.call(Ae,r,function(s){s||mg(),typeof n=="function"&&n.apply(this,arguments);})}return Object.defineProperty(e,Ms,{value:t}),e}(Ae.close),Ae.closeSync=function(t){function e(r){t.apply(Ae,arguments),mg();}return Object.defineProperty(e,Ms,{value:t}),e}(Ae.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){qr(Ae[We]),G("assert").equal(Ae[We].length,0);}));var gg;global[We]||wg(global,Ae[We]);Cu.exports=Au(oR(Ae));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Ae.__patched&&(Cu.exports=Au(Ae),Ae.__patched=!0);function Au(t){iR(t),t.gracefulify=Au,t.createReadStream=q,t.createWriteStream=W;var e=t.readFile;t.readFile=r;function r(k,U,C){return typeof U=="function"&&(C=U,U=null),Y(k,U,C);function Y(J,oe,P,I){return e(J,oe,function(re){re&&(re.code==="EMFILE"||re.code==="ENFILE")?mn([Y,[J,oe,P],re,I||Date.now(),Date.now()]):typeof P=="function"&&P.apply(this,arguments);})}}var n=t.writeFile;t.writeFile=s;function s(k,U,C,Y){return typeof C=="function"&&(Y=C,C=null),J(k,U,C,Y);function J(oe,P,I,re,Z){return n(oe,P,I,function(ce){ce&&(ce.code==="EMFILE"||ce.code==="ENFILE")?mn([J,[oe,P,I,re],ce,Z||Date.now(),Date.now()]):typeof re=="function"&&re.apply(this,arguments);})}}var i=t.appendFile;i&&(t.appendFile=o);function o(k,U,C,Y){return typeof C=="function"&&(Y=C,C=null),J(k,U,C,Y);function J(oe,P,I,re,Z){return i(oe,P,I,function(ce){ce&&(ce.code==="EMFILE"||ce.code==="ENFILE")?mn([J,[oe,P,I,re],ce,Z||Date.now(),Date.now()]):typeof re=="function"&&re.apply(this,arguments);})}}var u=t.copyFile;u&&(t.copyFile=c);function c(k,U,C,Y){return typeof C=="function"&&(Y=C,C=0),J(k,U,C,Y);function J(oe,P,I,re,Z){return u(oe,P,I,function(ce){ce&&(ce.code==="EMFILE"||ce.code==="ENFILE")?mn([J,[oe,P,I,re],ce,Z||Date.now(),Date.now()]):typeof re=="function"&&re.apply(this,arguments);})}}var p=t.readdir;t.readdir=d;var l=/^v[0-5]\./;function d(k,U,C){typeof U=="function"&&(C=U,U=null);var Y=l.test(process.version)?function(P,I,re,Z){return p(P,J(P,I,re,Z))}:function(P,I,re,Z){return p(P,I,J(P,I,re,Z))};return Y(k,U,C);function J(oe,P,I,re){return function(Z,ce){Z&&(Z.code==="EMFILE"||Z.code==="ENFILE")?mn([Y,[oe,P,I],Z,re||Date.now(),Date.now()]):(ce&&ce.sort&&ce.sort(),typeof I=="function"&&I.call(this,Z,ce));}}}if(process.version.substr(0,4)==="v0.8"){var g=sR(t);R=g.ReadStream,O=g.WriteStream;}var m=t.ReadStream;m&&(R.prototype=Object.create(m.prototype),R.prototype.open=x);var w=t.WriteStream;w&&(O.prototype=Object.create(w.prototype),O.prototype.open=F),Object.defineProperty(t,"ReadStream",{get:function(){return R},set:function(k){R=k;},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return O},set:function(k){O=k;},enumerable:!0,configurable:!0});var E=R;Object.defineProperty(t,"FileReadStream",{get:function(){return E},set:function(k){E=k;},enumerable:!0,configurable:!0});var A=O;Object.defineProperty(t,"FileWriteStream",{get:function(){return A},set:function(k){A=k;},enumerable:!0,configurable:!0});function R(k,U){return this instanceof R?(m.apply(this,arguments),this):R.apply(Object.create(R.prototype),arguments)}function x(){var k=this;B(k.path,k.flags,k.mode,function(U,C){U?(k.autoClose&&k.destroy(),k.emit("error",U)):(k.fd=C,k.emit("open",C),k.read());});}function O(k,U){return this instanceof O?(w.apply(this,arguments),this):O.apply(Object.create(O.prototype),arguments)}function F(){var k=this;B(k.path,k.flags,k.mode,function(U,C){U?(k.destroy(),k.emit("error",U)):(k.fd=C,k.emit("open",C));});}function q(k,U){return new t.ReadStream(k,U)}function W(k,U){return new t.WriteStream(k,U)}var H=t.open;t.open=B;function B(k,U,C,Y){return typeof C=="function"&&(Y=C,C=null),J(k,U,C,Y);function J(oe,P,I,re,Z){return H(oe,P,I,function(ce,Ke){ce&&(ce.code==="EMFILE"||ce.code==="ENFILE")?mn([J,[oe,P,I,re],ce,Z||Date.now(),Date.now()]):typeof re=="function"&&re.apply(this,arguments);})}}return t}function mn(t){qr("ENQUEUE",t[0].name,t[1]),Ae[We].push(t),_u();}var Ns;function mg(){for(var t=Date.now(),e=0;e2&&(Ae[We][e][3]=t,Ae[We][e][4]=t);_u();}function _u(){if(clearTimeout(Ns),Ns=void 0,Ae[We].length!==0){var t=Ae[We].shift(),e=t[0],r=t[1],n=t[2],s=t[3],i=t[4];if(s===void 0)qr("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-s>=6e4){qr("TIMEOUT",e.name,r);var o=r.pop();typeof o=="function"&&o.call(null,n);}else {var u=Date.now()-i,c=Math.max(i-s,1),p=Math.min(c*1.2,100);u>=p?(qr("RETRY",e.name,r),e.apply(null,r.concat([s]))):Ae[We].push(t);}Ns===void 0&&(Ns=setTimeout(_u,0));}}});var Br=_(Jt=>{var vg=Ze().fromCallback,Ye=et(),uR=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof Ye[t]=="function");Object.assign(Jt,Ye);uR.forEach(t=>{Jt[t]=vg(Ye[t]);});Jt.exists=function(t,e){return typeof e=="function"?Ye.exists(t,e):new Promise(r=>Ye.exists(t,r))};Jt.read=function(t,e,r,n,s,i){return typeof i=="function"?Ye.read(t,e,r,n,s,i):new Promise((o,u)=>{Ye.read(t,e,r,n,s,(c,p,l)=>{if(c)return u(c);o({bytesRead:p,buffer:l});});})};Jt.write=function(t,e,...r){return typeof r[r.length-1]=="function"?Ye.write(t,e,...r):new Promise((n,s)=>{Ye.write(t,e,...r,(i,o,u)=>{if(i)return s(i);n({bytesWritten:o,buffer:u});});})};Jt.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?Ye.readv(t,e,...r):new Promise((n,s)=>{Ye.readv(t,e,...r,(i,o,u)=>{if(i)return s(i);n({bytesRead:o,buffers:u});});})};Jt.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?Ye.writev(t,e,...r):new Promise((n,s)=>{Ye.writev(t,e,...r,(i,o,u)=>{if(i)return s(i);n({bytesWritten:o,buffers:u});});})};typeof Ye.realpath.native=="function"?Jt.realpath.native=vg(Ye.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003");});var bg=_((FN,Sg)=>{var lR=G("path");Sg.exports.checkPath=function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(lR.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}};});var _g=_((kN,Ru)=>{var Eg=Br(),{checkPath:xg}=bg(),Ag=t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode};Ru.exports.makeDir=async(t,e)=>(xg(t),Eg.mkdir(t,{mode:Ag(e),recursive:!0}));Ru.exports.makeDirSync=(t,e)=>(xg(t),Eg.mkdirSync(t,{mode:Ag(e),recursive:!0}));});var Rt=_((LN,Cg)=>{var cR=Ze().fromPromise,{makeDir:fR,makeDirSync:Ou}=_g(),Tu=cR(fR);Cg.exports={mkdirs:Tu,mkdirsSync:Ou,mkdirp:Tu,mkdirpSync:Ou,ensureDir:Tu,ensureDirSync:Ou};});var gr=_((qN,Og)=>{var hR=Ze().fromPromise,Rg=Br();function pR(t){return Rg.access(t).then(()=>!0).catch(()=>!1)}Og.exports={pathExists:hR(pR),pathExistsSync:Rg.existsSync};});var Pu=_((BN,Tg)=>{var wn=et();function dR(t,e,r,n){wn.open(t,"r+",(s,i)=>{if(s)return n(s);wn.futimes(i,e,r,o=>{wn.close(i,u=>{n&&n(o||u);});});});}function yR(t,e,r){let n=wn.openSync(t,"r+");return wn.futimesSync(n,e,r),wn.closeSync(n)}Tg.exports={utimesMillis:dR,utimesMillisSync:yR};});var Dr=_((DN,$g)=>{var vn=Br(),ke=G("path"),gR=G("util");function mR(t,e,r){let n=r.dereference?s=>vn.stat(s,{bigint:!0}):s=>vn.lstat(s,{bigint:!0});return Promise.all([n(t),n(e).catch(s=>{if(s.code==="ENOENT")return null;throw s})]).then(([s,i])=>({srcStat:s,destStat:i}))}function wR(t,e,r){let n,s=r.dereference?o=>vn.statSync(o,{bigint:!0}):o=>vn.lstatSync(o,{bigint:!0}),i=s(t);try{n=s(e);}catch(o){if(o.code==="ENOENT")return {srcStat:i,destStat:null};throw o}return {srcStat:i,destStat:n}}function vR(t,e,r,n,s){gR.callbackify(mR)(t,e,n,(i,o)=>{if(i)return s(i);let{srcStat:u,destStat:c}=o;if(c){if(li(u,c)){let p=ke.basename(t),l=ke.basename(e);return r==="move"&&p!==l&&p.toLowerCase()===l.toLowerCase()?s(null,{srcStat:u,destStat:c,isChangingCase:!0}):s(new Error("Source and destination must not be the same."))}if(u.isDirectory()&&!c.isDirectory())return s(new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`));if(!u.isDirectory()&&c.isDirectory())return s(new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`))}return u.isDirectory()&&Iu(t,e)?s(new Error(Us(t,e,r))):s(null,{srcStat:u,destStat:c})});}function SR(t,e,r,n){let{srcStat:s,destStat:i}=wR(t,e,n);if(i){if(li(s,i)){let o=ke.basename(t),u=ke.basename(e);if(r==="move"&&o!==u&&o.toLowerCase()===u.toLowerCase())return {srcStat:s,destStat:i,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(s.isDirectory()&&!i.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!s.isDirectory()&&i.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(s.isDirectory()&&Iu(t,e))throw new Error(Us(t,e,r));return {srcStat:s,destStat:i}}function Pg(t,e,r,n,s){let i=ke.resolve(ke.dirname(t)),o=ke.resolve(ke.dirname(r));if(o===i||o===ke.parse(o).root)return s();vn.stat(o,{bigint:!0},(u,c)=>u?u.code==="ENOENT"?s():s(u):li(e,c)?s(new Error(Us(t,r,n))):Pg(t,e,o,n,s));}function Ig(t,e,r,n){let s=ke.resolve(ke.dirname(t)),i=ke.resolve(ke.dirname(r));if(i===s||i===ke.parse(i).root)return;let o;try{o=vn.statSync(i,{bigint:!0});}catch(u){if(u.code==="ENOENT")return;throw u}if(li(e,o))throw new Error(Us(t,r,n));return Ig(t,e,i,n)}function li(t,e){return e.ino&&e.dev&&e.ino===t.ino&&e.dev===t.dev}function Iu(t,e){let r=ke.resolve(t).split(ke.sep).filter(s=>s),n=ke.resolve(e).split(ke.sep).filter(s=>s);return r.reduce((s,i,o)=>s&&n[o]===i,!0)}function Us(t,e,r){return `Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}$g.exports={checkPaths:vR,checkPathsSync:SR,checkParentPaths:Pg,checkParentPathsSync:Ig,isSrcSubdir:Iu,areIdentical:li};});var Dg=_((NN,Bg)=>{var tt=et(),ci=G("path"),bR=Rt().mkdirs,ER=gr().pathExists,xR=Pu().utimesMillis,fi=Dr();function AR(t,e,r,n){typeof r=="function"&&!n?(n=r,r={}):typeof r=="function"&&(r={filter:r}),n=n||function(){},r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended; +var KE=Object.create;var Dn=Object.defineProperty;var VE=Object.getOwnPropertyDescriptor;var YE=Object.getOwnPropertyNames;var JE=Object.getPrototypeOf,XE=Object.prototype.hasOwnProperty;var QE=(t,e,r)=>e in t?Dn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var z=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var qi=(t,e)=>()=>(t&&(e=t(t=0)),e);var R=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Wo=(t,e)=>{for(var r in e)Dn(t,r,{get:e[r],enumerable:!0});},Cf=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of YE(e))!XE.call(t,s)&&s!==r&&Dn(t,s,{get:()=>e[s],enumerable:!(n=VE(e,s))||n.enumerable});return t};var Nn=(t,e,r)=>(r=t!=null?KE(JE(t)):{},Cf(e||!t||!t.__esModule?Dn(r,"default",{value:t,enumerable:!0}):r,t)),zo=t=>Cf(Dn({},"__esModule",{value:!0}),t);var ne=(t,e,r)=>(QE(t,typeof e!="symbol"?e+"":e,r),r),Go=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)};var S=(t,e,r)=>(Go(t,e,"read from private field"),r?r.call(t):e.get(t)),ae=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r);},re=(t,e,r,n)=>(Go(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r);var Di=(t,e,r,n)=>({set _(s){re(t,e,s,r);},get _(){return S(t,e,n)}}),ee=(t,e,r)=>(Go(t,e,"access private method"),r);var Yo=R((Lq,Pf)=>{var Of=Object.prototype.toString;Pf.exports=function(e){var r=Of.call(e),n=r==="[object Arguments]";return n||(n=r!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Of.call(e.callee)==="[object Function]"),n};});var Nf=R((Fq,Df)=>{var qf;Object.keys||(Mn=Object.prototype.hasOwnProperty,Jo=Object.prototype.toString,Tf=Yo(),Xo=Object.prototype.propertyIsEnumerable,$f=!Xo.call({toString:null},"toString"),If=Xo.call(function(){},"prototype"),jn=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],ji=function(t){var e=t.constructor;return e&&e.prototype===t},kf={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},Lf=function(){if(typeof window>"u")return !1;for(var t in window)try{if(!kf["$"+t]&&Mn.call(window,t)&&window[t]!==null&&typeof window[t]=="object")try{ji(window[t]);}catch{return !0}}catch{return !0}return !1}(),Ff=function(t){if(typeof window>"u"||!Lf)return ji(t);try{return ji(t)}catch{return !1}},qf=function(e){var r=e!==null&&typeof e=="object",n=Jo.call(e)==="[object Function]",s=Tf(e),i=r&&Jo.call(e)==="[object String]",o=[];if(!r&&!n&&!s)throw new TypeError("Object.keys called on a non-object");var l=If&&n;if(i&&e.length>0&&!Mn.call(e,0))for(var c=0;c0)for(var p=0;p{var rA=Array.prototype.slice,nA=Yo(),Mf=Object.keys,Bi=Mf?function(e){return Mf(e)}:Nf(),jf=Object.keys;Bi.shim=function(){if(Object.keys){var e=function(){var r=Object.keys(arguments);return r&&r.length===arguments.length}(1,2);e||(Object.keys=function(n){return nA(n)?jf(rA.call(n)):jf(n)});}else Object.keys=Bi;return Object.keys||Bi};Bf.exports=Bi;});var Ui=R((Dq,Hf)=>{Hf.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return !1;if(typeof Symbol.iterator=="symbol")return !0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return !1;var s=42;e[r]=s;for(r in e)return !1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return !1;var i=Object.getOwnPropertySymbols(e);if(i.length!==1||i[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return !1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,r);if(o.value!==s||o.enumerable!==!0)return !1}return !0};});var Qo=R((Nq,Wf)=>{var Uf=typeof Symbol<"u"&&Symbol,iA=Ui();Wf.exports=function(){return typeof Uf!="function"||typeof Symbol!="function"||typeof Uf("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:iA()};});var Kf=R((Mq,Gf)=>{var zf={foo:{}},sA=Object;Gf.exports=function(){return {__proto__:zf}.foo===zf.foo&&!({__proto__:null}instanceof sA)};});var Yf=R((jq,Vf)=>{var oA="Function.prototype.bind called on incompatible ",Zo=Array.prototype.slice,aA=Object.prototype.toString,lA="[object Function]";Vf.exports=function(e){var r=this;if(typeof r!="function"||aA.call(r)!==lA)throw new TypeError(oA+r);for(var n=Zo.call(arguments,1),s,i=function(){if(this instanceof s){var u=r.apply(this,n.concat(Zo.call(arguments)));return Object(u)===u?u:this}else return r.apply(e,n.concat(Zo.call(arguments)))},o=Math.max(0,r.length-n.length),l=[],c=0;c{var uA=Yf();Jf.exports=Function.prototype.bind||uA;});var Qf=R((Hq,Xf)=>{var cA=Wi();Xf.exports=cA.call(Function.call,Object.prototype.hasOwnProperty);});var kt=R((Uq,nh)=>{var fe,Xr=SyntaxError,rh=Function,Jr=TypeError,ea=function(t){try{return rh('"use strict"; return ('+t+").constructor;")()}catch{}},_r=Object.getOwnPropertyDescriptor;var ta=function(){throw new Jr},fA=_r?function(){try{return ta}catch{try{return _r(arguments,"callee").get}catch{return ta}}}():ta,Vr=Qo()(),hA=Kf()(),Ie=Object.getPrototypeOf||(hA?function(t){return t.__proto__}:null),Yr={},pA=typeof Uint8Array>"u"||!Ie?fe:Ie(Uint8Array),xr={"%AggregateError%":typeof AggregateError>"u"?fe:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?fe:ArrayBuffer,"%ArrayIteratorPrototype%":Vr&&Ie?Ie([][Symbol.iterator]()):fe,"%AsyncFromSyncIteratorPrototype%":fe,"%AsyncFunction%":Yr,"%AsyncGenerator%":Yr,"%AsyncGeneratorFunction%":Yr,"%AsyncIteratorPrototype%":Yr,"%Atomics%":typeof Atomics>"u"?fe:Atomics,"%BigInt%":typeof BigInt>"u"?fe:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?fe:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?fe:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?fe:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?fe:Float32Array,"%Float64Array%":typeof Float64Array>"u"?fe:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?fe:FinalizationRegistry,"%Function%":rh,"%GeneratorFunction%":Yr,"%Int8Array%":typeof Int8Array>"u"?fe:Int8Array,"%Int16Array%":typeof Int16Array>"u"?fe:Int16Array,"%Int32Array%":typeof Int32Array>"u"?fe:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Vr&&Ie?Ie(Ie([][Symbol.iterator]())):fe,"%JSON%":typeof JSON=="object"?JSON:fe,"%Map%":typeof Map>"u"?fe:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Vr||!Ie?fe:Ie(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?fe:Promise,"%Proxy%":typeof Proxy>"u"?fe:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?fe:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?fe:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Vr||!Ie?fe:Ie(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?fe:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Vr&&Ie?Ie(""[Symbol.iterator]()):fe,"%Symbol%":Vr?Symbol:fe,"%SyntaxError%":Xr,"%ThrowTypeError%":fA,"%TypedArray%":pA,"%TypeError%":Jr,"%Uint8Array%":typeof Uint8Array>"u"?fe:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?fe:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?fe:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?fe:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?fe:WeakMap,"%WeakRef%":typeof WeakRef>"u"?fe:WeakRef,"%WeakSet%":typeof WeakSet>"u"?fe:WeakSet};var dA=function t(e){var r;if(e==="%AsyncFunction%")r=ea("async function () {}");else if(e==="%GeneratorFunction%")r=ea("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=ea("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype);}else if(e==="%AsyncIteratorPrototype%"){var s=t("%AsyncGenerator%");s&&Ie&&(r=Ie(s.prototype));}return xr[e]=r,r},eh={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Bn=Wi(),zi=Qf(),gA=Bn.call(Function.call,Array.prototype.concat),yA=Bn.call(Function.apply,Array.prototype.splice),th=Bn.call(Function.call,String.prototype.replace),Gi=Bn.call(Function.call,String.prototype.slice),mA=Bn.call(Function.call,RegExp.prototype.exec),vA=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,wA=/\\(\\)?/g,SA=function(e){var r=Gi(e,0,1),n=Gi(e,-1);if(r==="%"&&n!=="%")throw new Xr("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Xr("invalid intrinsic syntax, expected opening `%`");var s=[];return th(e,vA,function(i,o,l,c){s[s.length]=l?th(c,wA,"$1"):o||i;}),s},bA=function(e,r){var n=e,s;if(zi(eh,n)&&(s=eh[n],n="%"+s[0]+"%"),zi(xr,n)){var i=xr[n];if(i===Yr&&(i=dA(n)),typeof i>"u"&&!r)throw new Jr("intrinsic "+e+" exists, but is not available. Please file an issue!");return {alias:s,name:n,value:i}}throw new Xr("intrinsic "+e+" does not exist!")};nh.exports=function(e,r){if(typeof e!="string"||e.length===0)throw new Jr("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Jr('"allowMissing" argument must be a boolean');if(mA(/^%?[^%]*%?$/,e)===null)throw new Xr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=SA(e),s=n.length>0?n[0]:"",i=bA("%"+s+"%",r),o=i.name,l=i.value,c=!1,p=i.alias;p&&(s=p[0],yA(n,gA([0,1],p)));for(var u=1,g=!0;u=n.length){var b=_r(l,y);g=!!b,g&&"get"in b&&!("originalValue"in b.get)?l=b.get:l=l[y];}else g=zi(l,y),l=l[y];g&&!c&&(xr[o]=l);}}return l};});var Ki=R((Wq,ih)=>{var EA=kt(),ra=EA("%Object.defineProperty%",!0),na=function(){if(ra)try{return ra({},"a",{value:1}),!0}catch{return !1}return !1};na.hasArrayLengthDefineBug=function(){if(!na())return null;try{return ra([],"length",{value:1}).length!==1}catch{return !0}};ih.exports=na;});var ia=R((zq,sh)=>{var AA=kt(),Vi=AA("%Object.getOwnPropertyDescriptor%",!0);if(Vi)try{Vi([],"length");}catch{Vi=null;}sh.exports=Vi;});var oa=R((Gq,lh)=>{var _A=Ki()(),sa=kt(),oh=_A&&sa("%Object.defineProperty%",!0),xA=sa("%SyntaxError%"),Qr=sa("%TypeError%"),ah=ia();lh.exports=function(e,r,n){if(!e||typeof e!="object"&&typeof e!="function")throw new Qr("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new Qr("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Qr("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Qr("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Qr("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Qr("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,c=!!ah&&ah(e,r);if(oh)oh(e,r,{configurable:o===null&&c?c.configurable:!o,enumerable:s===null&&c?c.enumerable:!s,value:n,writable:i===null&&c?c.writable:!i});else if(l||!s&&!i&&!o)e[r]=n;else throw new xA("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")};});var rr=R((Kq,hh)=>{var CA=Hi(),RA=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",OA=Object.prototype.toString,PA=Array.prototype.concat,uh=oa(),TA=function(t){return typeof t=="function"&&OA.call(t)==="[object Function]"},ch=Ki()(),$A=function(t,e,r,n){if(e in t){if(n===!0){if(t[e]===r)return}else if(!TA(n)||!n())return}ch?uh(t,e,r,!0):uh(t,e,r);},fh=function(t,e){var r=arguments.length>2?arguments[2]:{},n=CA(e);RA&&(n=PA.call(n,Object.getOwnPropertySymbols(e)));for(var s=0;s{var aa=Wi(),Zr=kt(),gh=Zr("%Function.prototype.apply%"),yh=Zr("%Function.prototype.call%"),mh=Zr("%Reflect.apply%",!0)||aa.call(yh,gh),ph=Zr("%Object.getOwnPropertyDescriptor%",!0),Cr=Zr("%Object.defineProperty%",!0),IA=Zr("%Math.max%");if(Cr)try{Cr({},"a",{value:1});}catch{Cr=null;}Yi.exports=function(e){var r=mh(aa,yh,arguments);if(ph&&Cr){var n=ph(r,"length");n.configurable&&Cr(r,"length",{value:1+IA(0,e.length-(arguments.length-1))});}return r};var dh=function(){return mh(aa,gh,arguments)};Cr?Cr(Yi.exports,"apply",{value:dh}):Yi.exports.apply=dh;});var mt=R((Yq,Sh)=>{var vh=kt(),wh=Rr(),kA=wh(vh("String.prototype.indexOf"));Sh.exports=function(e,r){var n=vh(e,!!r);return typeof n=="function"&&kA(e,".prototype.")>-1?wh(n):n};});var la=R((Jq,xh)=>{var LA=Hi(),Ah=Ui()(),_h=mt(),bh=Object,FA=_h("Array.prototype.push"),Eh=_h("Object.prototype.propertyIsEnumerable"),qA=Ah?Object.getOwnPropertySymbols:null;xh.exports=function(e,r){if(e==null)throw new TypeError("target must be an object");var n=bh(e);if(arguments.length===1)return n;for(var s=1;s{var ua=la(),DA=function(){if(!Object.assign)return !1;for(var t="abcdefghijklmnopqrst",e=t.split(""),r={},n=0;n{var MA=rr(),jA=ca();Rh.exports=function(){var e=jA();return MA(Object,{assign:e},{assign:function(){return Object.assign!==e}}),e};});var Ih=R((Zq,$h)=>{var BA=rr(),HA=Rr(),UA=la(),Ph=ca(),WA=Oh(),zA=HA.apply(Ph()),Th=function(e,r){return zA(Object,arguments)};BA(Th,{getPolyfill:Ph,implementation:UA,shim:WA});$h.exports=Th;});var Lh=R((eD,kh)=>{var Un=function(){return typeof function(){}.name=="string"},Hn=Object.getOwnPropertyDescriptor;Un.functionsHaveConfigurableNames=function(){if(!Un()||!Hn)return !1;var e=Hn(function(){},"name");return !!e&&!!e.configurable};var GA=Function.prototype.bind;Un.boundFunctionsHaveNames=function(){return Un()&&typeof GA=="function"&&function(){}.bind().name!==""};kh.exports=Un;});var Dh=R((tD,qh)=>{var Fh=oa(),KA=Ki()(),VA=Lh().functionsHaveConfigurableNames(),YA=TypeError;qh.exports=function(e,r){if(typeof e!="function")throw new YA("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return (!n||VA)&&(KA?Fh(e,"name",r,!0,!0):Fh(e,"name",r)),e};});var fa=R((rD,Nh)=>{var JA=Dh(),XA=Object,QA=TypeError;Nh.exports=JA(function(){if(this!=null&&this!==XA(this))throw new QA("RegExp.prototype.flags getter called on non-object");var e="";return this.hasIndices&&(e+="d"),this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.unicodeSets&&(e+="v"),this.sticky&&(e+="y"),e},"get flags",!0);});var ha=R((nD,Mh)=>{var ZA=fa(),e_=rr().supportsDescriptors,t_=Object.getOwnPropertyDescriptor;Mh.exports=function(){if(e_&&/a/mig.flags==="gim"){var e=t_(RegExp.prototype,"flags");if(e&&typeof e.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var r="",n={};if(Object.defineProperty(n,"hasIndices",{get:function(){r+="d";}}),Object.defineProperty(n,"sticky",{get:function(){r+="y";}}),r==="dy")return e.get}}return ZA};});var Hh=R((iD,Bh)=>{var r_=rr().supportsDescriptors,n_=ha(),i_=Object.getOwnPropertyDescriptor,s_=Object.defineProperty,o_=TypeError,jh=Object.getPrototypeOf,a_=/a/;Bh.exports=function(){if(!r_||!jh)throw new o_("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=n_(),r=jh(a_),n=i_(r,"flags");return (!n||n.get!==e)&&s_(r,"flags",{configurable:!0,enumerable:!1,get:e}),e};});var Gh=R((sD,zh)=>{var l_=rr(),u_=Rr(),c_=fa(),Uh=ha(),f_=Hh(),Wh=u_(Uh());l_(Wh,{getPolyfill:Uh,implementation:c_,shim:f_});zh.exports=Wh;});var Yh=R((oD,Vh)=>{var Kh=Symbol.iterator;Vh.exports=function(e){if(e!=null&&typeof e[Kh]<"u")return e[Kh]()};});var Xh=R((aD,Jh)=>{Jh.exports=z("util").inspect;});var mp=R((lD,yp)=>{var Ea=typeof Map=="function"&&Map.prototype,pa=Object.getOwnPropertyDescriptor&&Ea?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Xi=Ea&&pa&&typeof pa.get=="function"?pa.get:null,Qh=Ea&&Map.prototype.forEach,Aa=typeof Set=="function"&&Set.prototype,da=Object.getOwnPropertyDescriptor&&Aa?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Qi=Aa&&da&&typeof da.get=="function"?da.get:null,Zh=Aa&&Set.prototype.forEach,h_=typeof WeakMap=="function"&&WeakMap.prototype,zn=h_?WeakMap.prototype.has:null,p_=typeof WeakSet=="function"&&WeakSet.prototype,Gn=p_?WeakSet.prototype.has:null,d_=typeof WeakRef=="function"&&WeakRef.prototype,ep=d_?WeakRef.prototype.deref:null,g_=Boolean.prototype.valueOf,y_=Object.prototype.toString,m_=Function.prototype.toString,v_=String.prototype.match,_a=String.prototype.slice,ir=String.prototype.replace,w_=String.prototype.toUpperCase,tp=String.prototype.toLowerCase,cp=RegExp.prototype.test,rp=Array.prototype.concat,Lt=Array.prototype.join,S_=Array.prototype.slice,np=Math.floor,ma=typeof BigInt=="function"?BigInt.prototype.valueOf:null,ga=Object.getOwnPropertySymbols,va=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,en=typeof Symbol=="function"&&typeof Symbol.iterator=="object",We=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===en||"symbol")?Symbol.toStringTag:null,fp=Object.prototype.propertyIsEnumerable,ip=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function sp(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||cp.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-np(-t):np(t);if(n!==t){var s=String(n),i=_a.call(e,s.length+1);return ir.call(s,r,"$&_")+"."+ir.call(ir.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ir.call(e,r,"$&_")}var wa=Xh(),op=wa.custom,ap=pp(op)?op:null;yp.exports=function t(e,r,n,s){var i=r||{};if(nr(i,"quoteStyle")&&i.quoteStyle!=="single"&&i.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(nr(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=nr(i,"customInspect")?i.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(nr(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(nr(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=i.numericSeparator;if(typeof e>"u")return "undefined";if(e===null)return "null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return gp(e,i);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var c=String(e);return l?sp(e,c):c}if(typeof e=="bigint"){var p=String(e)+"n";return l?sp(e,p):p}var u=typeof i.depth>"u"?5:i.depth;if(typeof n>"u"&&(n=0),n>=u&&u>0&&typeof e=="object")return Sa(e)?"[Array]":"[Object]";var g=N_(i,n);if(typeof s>"u")s=[];else if(dp(s,e)>=0)return "[Circular]";function y(Y,se,T){if(se&&(s=S_.call(s),s.push(se)),T){var $={depth:i.depth};return nr(i,"quoteStyle")&&($.quoteStyle=i.quoteStyle),t(Y,$,n+1,s)}return t(Y,i,n+1,s)}if(typeof e=="function"&&!lp(e)){var m=P_(e),v=Ji(e,y);return "[Function"+(m?": "+m:" (anonymous)")+"]"+(v.length>0?" { "+Lt.call(v,", ")+" }":"")}if(pp(e)){var b=en?ir.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):va.call(e);return typeof e=="object"&&!en?Wn(b):b}if(F_(e)){for(var _="<"+tp.call(String(e.nodeName)),x=e.attributes||[],A=0;A",_}if(Sa(e)){if(e.length===0)return "[]";var O=Ji(e,y);return g&&!D_(O)?"["+ba(O,g)+"]":"[ "+Lt.call(O,", ")+" ]"}if(A_(e)){var I=Ji(e,y);return !("cause"in Error.prototype)&&"cause"in e&&!fp.call(e,"cause")?"{ ["+String(e)+"] "+Lt.call(rp.call("[cause]: "+y(e.cause),I),", ")+" }":I.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Lt.call(I,", ")+" }"}if(typeof e=="object"&&o){if(ap&&typeof e[ap]=="function"&&wa)return wa(e,{depth:u-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(T_(e)){var F=[];return Qh&&Qh.call(e,function(Y,se){F.push(y(se,e,!0)+" => "+y(Y,e));}),up("Map",Xi.call(e),F,g)}if(k_(e)){var U=[];return Zh&&Zh.call(e,function(Y){U.push(y(Y,e));}),up("Set",Qi.call(e),U,g)}if($_(e))return ya("WeakMap");if(L_(e))return ya("WeakSet");if(I_(e))return ya("WeakRef");if(x_(e))return Wn(y(Number(e)));if(R_(e))return Wn(y(ma.call(e)));if(C_(e))return Wn(g_.call(e));if(__(e))return Wn(y(String(e)));if(!E_(e)&&!lp(e)){var H=Ji(e,y),q=ip?ip(e)===Object.prototype:e instanceof Object||e.constructor===Object,k=e instanceof Object?"":"null prototype",j=!q&&We&&Object(e)===e&&We in e?_a.call(sr(e),8,-1):k?"Object":"",C=q||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",V=C+(j||k?"["+Lt.call(rp.call([],j||[],k||[]),": ")+"] ":"");return H.length===0?V+"{}":g?V+"{"+ba(H,g)+"}":V+"{ "+Lt.call(H,", ")+" }"}return String(e)};function hp(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function b_(t){return ir.call(String(t),/"/g,""")}function Sa(t){return sr(t)==="[object Array]"&&(!We||!(typeof t=="object"&&We in t))}function E_(t){return sr(t)==="[object Date]"&&(!We||!(typeof t=="object"&&We in t))}function lp(t){return sr(t)==="[object RegExp]"&&(!We||!(typeof t=="object"&&We in t))}function A_(t){return sr(t)==="[object Error]"&&(!We||!(typeof t=="object"&&We in t))}function __(t){return sr(t)==="[object String]"&&(!We||!(typeof t=="object"&&We in t))}function x_(t){return sr(t)==="[object Number]"&&(!We||!(typeof t=="object"&&We in t))}function C_(t){return sr(t)==="[object Boolean]"&&(!We||!(typeof t=="object"&&We in t))}function pp(t){if(en)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return !0;if(!t||typeof t!="object"||!va)return !1;try{return va.call(t),!0}catch{}return !1}function R_(t){if(!t||typeof t!="object"||!ma)return !1;try{return ma.call(t),!0}catch{}return !1}var O_=Object.prototype.hasOwnProperty||function(t){return t in this};function nr(t,e){return O_.call(t,e)}function sr(t){return y_.call(t)}function P_(t){if(t.name)return t.name;var e=v_.call(m_.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function dp(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return gp(_a.call(t,0,e.maxStringLength),e)+n}var s=ir.call(ir.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,q_);return hp(s,"single",e)}function q_(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+w_.call(e.toString(16))}function Wn(t){return "Object("+t+")"}function ya(t){return t+" { ? }"}function up(t,e,r,n){var s=n?ba(r,n):Lt.call(r,", ");return t+" ("+e+") {"+s+"}"}function D_(t){for(var e=0;e=0)return !1;return !0}function N_(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=Lt.call(Array(t.indent+1)," ");else return null;return {base:r,prev:Lt.call(Array(e+1),r)}}function ba(t,e){if(t.length===0)return "";var r=` +`+e.prev+e.base;return r+Lt.call(t,","+r)+` +`+e.prev}function Ji(t,e){var r=Sa(t),n=[];if(r){n.length=t.length;for(var s=0;s{var xa=kt(),tn=mt(),M_=mp(),j_=xa("%TypeError%"),Zi=xa("%WeakMap%",!0),es=xa("%Map%",!0),B_=tn("WeakMap.prototype.get",!0),H_=tn("WeakMap.prototype.set",!0),U_=tn("WeakMap.prototype.has",!0),W_=tn("Map.prototype.get",!0),z_=tn("Map.prototype.set",!0),G_=tn("Map.prototype.has",!0),Ca=function(t,e){for(var r=t,n;(n=r.next)!==null;r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n},K_=function(t,e){var r=Ca(t,e);return r&&r.value},V_=function(t,e,r){var n=Ca(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r};},Y_=function(t,e){return !!Ca(t,e)};vp.exports=function(){var e,r,n,s={assert:function(i){if(!s.has(i))throw new j_("Side channel does not contain "+M_(i))},get:function(i){if(Zi&&i&&(typeof i=="object"||typeof i=="function")){if(e)return B_(e,i)}else if(es){if(r)return W_(r,i)}else if(n)return K_(n,i)},has:function(i){if(Zi&&i&&(typeof i=="object"||typeof i=="function")){if(e)return U_(e,i)}else if(es){if(r)return G_(r,i)}else if(n)return Y_(n,i);return !1},set:function(i,o){Zi&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new Zi),H_(e,i,o)):es?(r||(r=new es),z_(r,i,o)):(n||(n={key:{},next:null}),V_(n,i,o));}};return s};});var Ra=R((cD,bp)=>{var Sp=function(t){return t!==t};bp.exports=function(e,r){return e===0&&r===0?1/e===1/r:!!(e===r||Sp(e)&&Sp(r))};});var Oa=R((fD,Ep)=>{var J_=Ra();Ep.exports=function(){return typeof Object.is=="function"?Object.is:J_};});var _p=R((hD,Ap)=>{var X_=Oa(),Q_=rr();Ap.exports=function(){var e=X_();return Q_(Object,{is:e},{is:function(){return Object.is!==e}}),e};});var Op=R((pD,Rp)=>{var Z_=rr(),ex=Rr(),tx=Ra(),xp=Oa(),rx=_p(),Cp=ex(xp(),Object);Z_(Cp,{getPolyfill:xp,implementation:tx,shim:rx});Rp.exports=Cp;});var or=R((dD,Pp)=>{var nx=Ui();Pp.exports=function(){return nx()&&!!Symbol.toStringTag};});var Ip=R((gD,$p)=>{var ix=or()(),sx=mt(),Pa=sx("Object.prototype.toString"),ts=function(e){return ix&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:Pa(e)==="[object Arguments]"},Tp=function(e){return ts(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Pa(e)!=="[object Array]"&&Pa(e.callee)==="[object Function]"},ox=function(){return ts(arguments)}();ts.isLegacyArguments=Tp;$p.exports=ox?ts:Tp;});var Lp=R((yD,kp)=>{var ax={}.toString;kp.exports=Array.isArray||function(t){return ax.call(t)=="[object Array]"};});var Np=R((mD,Dp)=>{var qp=Function.prototype.toString,rn=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,$a,rs;if(typeof rn=="function"&&typeof Object.defineProperty=="function")try{$a=Object.defineProperty({},"length",{get:function(){throw rs}}),rs={},rn(function(){throw 42},null,$a);}catch(t){t!==rs&&(rn=null);}else rn=null;var lx=/^\s*class\b/,Ia=function(e){try{var r=qp.call(e);return lx.test(r)}catch{return !1}},Ta=function(e){try{return Ia(e)?!1:(qp.call(e),!0)}catch{return !1}},ns=Object.prototype.toString,ux="[object Object]",cx="[object Function]",fx="[object GeneratorFunction]",hx="[object HTMLAllCollection]",px="[object HTML document.all class]",dx="[object HTMLCollection]",gx=typeof Symbol=="function"&&!!Symbol.toStringTag,yx=!(0 in[,]),ka=function(){return !1};typeof document=="object"&&(Fp=document.all,ns.call(Fp)===ns.call(document.all)&&(ka=function(e){if((yx||!e)&&(typeof e>"u"||typeof e=="object"))try{var r=ns.call(e);return (r===hx||r===px||r===dx||r===ux)&&e("")==null}catch{}return !1}));var Fp;Dp.exports=rn?function(e){if(ka(e))return !0;if(!e||typeof e!="function"&&typeof e!="object")return !1;try{rn(e,null,$a);}catch(r){if(r!==rs)return !1}return !Ia(e)&&Ta(e)}:function(e){if(ka(e))return !0;if(!e||typeof e!="function"&&typeof e!="object")return !1;if(gx)return Ta(e);if(Ia(e))return !1;var r=ns.call(e);return r!==cx&&r!==fx&&!/^\[object HTML/.test(r)?!1:Ta(e)};});var Bp=R((vD,jp)=>{var mx=Np(),vx=Object.prototype.toString,Mp=Object.prototype.hasOwnProperty,wx=function(e,r,n){for(var s=0,i=e.length;s=3&&(s=n),vx.call(e)==="[object Array]"?wx(e,r,s):typeof e=="string"?Sx(e,r,s):bx(e,r,s);};jp.exports=Ex;});var Up=R((wD,Hp)=>{var La=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],Ax=typeof globalThis>"u"?global:globalThis;Hp.exports=function(){for(var e=[],r=0;r{var ss=Bp(),_x=Up(),Wp=Rr(),Da=mt(),is=ia(),xx=Da("Object.prototype.toString"),Gp=or()(),zp=typeof globalThis>"u"?global:globalThis,qa=_x(),Na=Da("String.prototype.slice"),Fa=Object.getPrototypeOf,Cx=Da("Array.prototype.indexOf",!0)||function(e,r){for(var n=0;n-1?r:r!=="Object"?!1:Ox(e)}return is?Rx(e):null};});var Yp=R((bD,Vp)=>{var Px=Ma();Vp.exports=function(e){return !!Px(e)};});var ja=R((ED,td)=>{var Tx=Rr(),$x=mt(),ed=kt(),Ix=Yp(),Jp=ed("ArrayBuffer",!0),Xp=ed("Float32Array",!0),as=$x("ArrayBuffer.prototype.byteLength",!0),Qp=Jp&&!as&&new Jp().slice,Zp=Qp&&Tx(Qp);td.exports=as||Zp?function(e){if(!e||typeof e!="object")return !1;try{return as?as(e):Zp(e,0),!0}catch{return !1}}:Xp?function(e){try{return new Xp(e).buffer===e&&!Ix(e)}catch(r){return typeof e=="object"&&r.name==="RangeError"}}:function(e){return !1};});var nd=R((AD,rd)=>{var kx=Date.prototype.getDay,Lx=function(e){try{return kx.call(e),!0}catch{return !1}},Fx=Object.prototype.toString,qx="[object Date]",Dx=or()();rd.exports=function(e){return typeof e!="object"||e===null?!1:Dx?Lx(e):Fx.call(e)===qx};});var ld=R((_D,ad)=>{var Ba=mt(),id=or()(),sd,od,Ha,Ua;id&&(sd=Ba("Object.prototype.hasOwnProperty"),od=Ba("RegExp.prototype.exec"),Ha={},ls=function(){throw Ha},Ua={toString:ls,valueOf:ls},typeof Symbol.toPrimitive=="symbol"&&(Ua[Symbol.toPrimitive]=ls));var ls,Nx=Ba("Object.prototype.toString"),Mx=Object.getOwnPropertyDescriptor,jx="[object RegExp]";ad.exports=id?function(e){if(!e||typeof e!="object")return !1;var r=Mx(e,"lastIndex"),n=r&&sd(r,"value");if(!n)return !1;try{od(e,Ua);}catch(s){return s===Ha}}:function(e){return !e||typeof e!="object"&&typeof e!="function"?!1:Nx(e)===jx};});var fd=R((xD,cd)=>{var Bx=mt(),ud=Bx("SharedArrayBuffer.prototype.byteLength",!0);cd.exports=ud?function(e){if(!e||typeof e!="object")return !1;try{return ud(e),!0}catch{return !1}}:function(e){return !1};});var pd=R((CD,hd)=>{var Hx=String.prototype.valueOf,Ux=function(e){try{return Hx.call(e),!0}catch{return !1}},Wx=Object.prototype.toString,zx="[object String]",Gx=or()();hd.exports=function(e){return typeof e=="string"?!0:typeof e!="object"?!1:Gx?Ux(e):Wx.call(e)===zx};});var gd=R((RD,dd)=>{var Kx=Number.prototype.toString,Vx=function(e){try{return Kx.call(e),!0}catch{return !1}},Yx=Object.prototype.toString,Jx="[object Number]",Xx=or()();dd.exports=function(e){return typeof e=="number"?!0:typeof e!="object"?!1:Xx?Vx(e):Yx.call(e)===Jx};});var vd=R((OD,md)=>{var yd=mt(),Qx=yd("Boolean.prototype.toString"),Zx=yd("Object.prototype.toString"),eC=function(e){try{return Qx(e),!0}catch{return !1}},tC="[object Boolean]",rC=or()();md.exports=function(e){return typeof e=="boolean"?!0:e===null||typeof e!="object"?!1:rC&&Symbol.toStringTag in e?eC(e):Zx(e)===tC};});var Ed=R((PD,Wa)=>{var nC=Object.prototype.toString,iC=Qo()();iC?(wd=Symbol.prototype.toString,Sd=/^Symbol\(.*\)$/,bd=function(e){return typeof e.valueOf()!="symbol"?!1:Sd.test(wd.call(e))},Wa.exports=function(e){if(typeof e=="symbol")return !0;if(nC.call(e)!=="[object Symbol]")return !1;try{return bd(e)}catch{return !1}}):Wa.exports=function(e){return !1};var wd,Sd,bd;});var xd=R((TD,_d)=>{var Ad=typeof BigInt<"u"&&BigInt;_d.exports=function(){return typeof Ad=="function"&&typeof BigInt=="function"&&typeof Ad(42)=="bigint"&&typeof BigInt(42)=="bigint"};});var Od=R(($D,za)=>{var sC=xd()();sC?(Cd=BigInt.prototype.valueOf,Rd=function(e){try{return Cd.call(e),!0}catch{}return !1},za.exports=function(e){return e===null||typeof e>"u"||typeof e=="boolean"||typeof e=="string"||typeof e=="number"||typeof e=="symbol"||typeof e=="function"?!1:typeof e=="bigint"?!0:Rd(e)}):za.exports=function(e){return !1};var Cd,Rd;});var Td=R((ID,Pd)=>{var oC=pd(),aC=gd(),lC=vd(),uC=Ed(),cC=Od();Pd.exports=function(e){if(e==null||typeof e!="object"&&typeof e!="function")return null;if(oC(e))return "String";if(aC(e))return "Number";if(lC(e))return "Boolean";if(uC(e))return "Symbol";if(cC(e))return "BigInt"};});var Ld=R((kD,kd)=>{var Ga=typeof Map=="function"&&Map.prototype?Map:null,fC=typeof Set=="function"&&Set.prototype?Set:null,us;Ga||(us=function(e){return !1});var Id=Ga?Map.prototype.has:null,$d=fC?Set.prototype.has:null;!us&&!Id&&(us=function(e){return !1});kd.exports=us||function(e){if(!e||typeof e!="object")return !1;try{if(Id.call(e),$d)try{$d.call(e);}catch{return !0}return e instanceof Ga}catch{}return !1};});var Nd=R((LD,Dd)=>{var hC=typeof Map=="function"&&Map.prototype?Map:null,Ka=typeof Set=="function"&&Set.prototype?Set:null,cs;Ka||(cs=function(e){return !1});var Fd=hC?Map.prototype.has:null,qd=Ka?Set.prototype.has:null;!cs&&!qd&&(cs=function(e){return !1});Dd.exports=cs||function(e){if(!e||typeof e!="object")return !1;try{if(qd.call(e),Fd)try{Fd.call(e);}catch{return !0}return e instanceof Ka}catch{}return !1};});var Bd=R((FD,jd)=>{var fs=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,Md=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,hs;fs||(hs=function(e){return !1});var Ya=fs?fs.prototype.has:null,Va=Md?Md.prototype.has:null;!hs&&!Ya&&(hs=function(e){return !1});jd.exports=hs||function(e){if(!e||typeof e!="object")return !1;try{if(Ya.call(e,Ya),Va)try{Va.call(e,Va);}catch{return !0}return e instanceof fs}catch{}return !1};});var Ud=R((qD,Xa)=>{var pC=kt(),Hd=mt(),dC=pC("%WeakSet%",!0),Ja=Hd("WeakSet.prototype.has",!0);Ja?(ps=Hd("WeakMap.prototype.has",!0),Xa.exports=function(e){if(!e||typeof e!="object")return !1;try{if(Ja(e,Ja),ps)try{ps(e,ps);}catch{return !0}return e instanceof dC}catch{}return !1}):Xa.exports=function(e){return !1};var ps;});var zd=R((DD,Wd)=>{var gC=Ld(),yC=Nd(),mC=Bd(),vC=Ud();Wd.exports=function(e){if(e&&typeof e=="object"){if(gC(e))return "Map";if(yC(e))return "Set";if(mC(e))return "WeakMap";if(vC(e))return "WeakSet"}return !1};});var Vd=R((ND,Kd)=>{var wC=mt(),Gd=wC("ArrayBuffer.prototype.byteLength",!0),SC=ja();Kd.exports=function(e){return SC(e)?Gd?Gd(e):e.byteLength:NaN};});var wg=R((MD,vg)=>{var gg=Ih(),Ft=mt(),Yd=Gh(),bC=kt(),nn=Yh(),EC=wp(),Jd=Op(),Xd=Ip(),Qd=Lp(),Zd=ja(),eg=nd(),tg=ld(),rg=fd(),ng=Hi(),ig=Td(),sg=zd(),og=Ma(),ag=Vd(),lg=Ft("SharedArrayBuffer.prototype.byteLength",!0),ug=Ft("Date.prototype.getTime"),Qa=Object.getPrototypeOf,cg=Ft("Object.prototype.toString"),gs=bC("%Set%",!0),Za=Ft("Map.prototype.has",!0),ys=Ft("Map.prototype.get",!0),fg=Ft("Map.prototype.size",!0),ms=Ft("Set.prototype.add",!0),yg=Ft("Set.prototype.delete",!0),vs=Ft("Set.prototype.has",!0),ds=Ft("Set.prototype.size",!0);function hg(t,e,r,n){for(var s=nn(t),i;(i=s.next())&&!i.done;)if(bt(e,i.value,r,n))return yg(t,i.value),!0;return !1}function mg(t){if(typeof t>"u")return null;if(typeof t!="object")return typeof t=="symbol"?!1:typeof t=="string"||typeof t=="number"?+t==+t:!0}function AC(t,e,r,n,s,i){var o=mg(r);if(o!=null)return o;var l=ys(e,o),c=gg({},s,{strict:!1});return typeof l>"u"&&!Za(e,o)||!bt(n,l,c,i)?!1:!Za(t,o)&&bt(n,l,c,i)}function _C(t,e,r){var n=mg(r);return n??(vs(e,n)&&!vs(t,n))}function pg(t,e,r,n,s,i){for(var o=nn(t),l,c;(l=o.next())&&!l.done;)if(c=l.value,bt(r,c,s,i)&&bt(n,ys(e,c),s,i))return yg(t,c),!0;return !1}function bt(t,e,r,n){var s=r||{};if(s.strict?Jd(t,e):t===e)return !0;var i=ig(t),o=ig(e);if(i!==o)return !1;if(!t||!e||typeof t!="object"&&typeof e!="object")return s.strict?Jd(t,e):t==e;var l=n.has(t),c=n.has(e),p;if(l&&c){if(n.get(t)===n.get(e))return !0}else p={};return l||n.set(t,p),c||n.set(e,p),RC(t,e,s,n)}function dg(t){return !t||typeof t!="object"||typeof t.length!="number"||typeof t.copy!="function"||typeof t.slice!="function"||t.length>0&&typeof t[0]!="number"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function xC(t,e,r,n){if(ds(t)!==ds(e))return !1;for(var s=nn(t),i=nn(e),o,l,c;(o=s.next())&&!o.done;)if(o.value&&typeof o.value=="object")c||(c=new gs),ms(c,o.value);else if(!vs(e,o.value)){if(r.strict||!_C(t,e,o.value))return !1;c||(c=new gs),ms(c,o.value);}if(c){for(;(l=i.next())&&!l.done;)if(l.value&&typeof l.value=="object"){if(!hg(c,l.value,r.strict,n))return !1}else if(!r.strict&&!vs(t,l.value)&&!hg(c,l.value,r.strict,n))return !1;return ds(c)===0}return !0}function CC(t,e,r,n){if(fg(t)!==fg(e))return !1;for(var s=nn(t),i=nn(e),o,l,c,p,u,g;(o=s.next())&&!o.done;)if(p=o.value[0],u=o.value[1],p&&typeof p=="object")c||(c=new gs),ms(c,p);else if(g=ys(e,p),typeof g>"u"&&!Za(e,p)||!bt(u,g,r,n)){if(r.strict||!AC(t,e,p,u,r,n))return !1;c||(c=new gs),ms(c,p);}if(c){for(;(l=i.next())&&!l.done;)if(p=l.value[0],g=l.value[1],p&&typeof p=="object"){if(!pg(c,t,p,g,r,n))return !1}else if(!r.strict&&(!t.has(p)||!bt(ys(t,p),g,r,n))&&!pg(c,t,p,g,gg({},r,{strict:!1}),n))return !1;return ds(c)===0}return !0}function RC(t,e,r,n){var s,i;if(typeof t!=typeof e||t==null||e==null||cg(t)!==cg(e)||Xd(t)!==Xd(e))return !1;var o=Qd(t),l=Qd(e);if(o!==l)return !1;var c=t instanceof Error,p=e instanceof Error;if(c!==p||(c||p)&&(t.name!==e.name||t.message!==e.message))return !1;var u=tg(t),g=tg(e);if(u!==g||(u||g)&&(t.source!==e.source||Yd(t)!==Yd(e)))return !1;var y=eg(t),m=eg(e);if(y!==m||(y||m)&&ug(t)!==ug(e)||r.strict&&Qa&&Qa(t)!==Qa(e))return !1;var v=og(t),b=og(e);if(v!==b)return !1;if(v||b){if(t.length!==e.length)return !1;for(s=0;s=0;s--)if(U[s]!=H[s])return !1;for(s=U.length-1;s>=0;s--)if(i=U[s],!bt(t[i],e[i],r,n))return !1;var q=sg(t),k=sg(e);return q!==k?!1:q==="Set"||k==="Set"?xC(t,e,r,n):q==="Map"?CC(t,e,r,n):!0}vg.exports=function(e,r,n){return bt(e,r,n,EC())};});var $g={};Wo($g,{closest:()=>XC,distance:()=>Tg});var Wt,YC,JC,Tg,XC,Ig=qi(()=>{Wt=new Uint32Array(65536),YC=(t,e)=>{let r=t.length,n=e.length,s=1<{let r=e.length,n=t.length,s=[],i=[],o=Math.ceil(r/32),l=Math.ceil(n/32);for(let v=0;v>>A&1,F=s[A/32|0]>>>A&1,U=O|v,H=((O|F)&b)+b^b|O|F,q=v|~(H|b),k=b&H;q>>>31^I&&(i[A/32|0]^=1<>>31^F&&(s[A/32|0]^=1<>>v&1,x=s[v/32|0]>>>v&1,A=b|p,O=((b|x)&u)+u^u|b|x,I=p|~(O|u),F=u&O;m+=I>>>n-1&1,m-=F>>>n-1&1,I>>>31^_&&(i[v/32|0]^=1<>>31^x&&(s[v/32|0]^=1<{if(t.length{let r=1/0,n=0;for(let s=0;s{(function(){var t;try{t=typeof Intl<"u"&&typeof Intl.Collator<"u"?Intl.Collator("generic",{sensitivity:"base"}):null;}catch{console.log("Collator could not be initialized and wouldn't be used");}var e=(Ig(),zo($g)),r=[],n=[],s={get:function(i,o,l){var c=l&&t&&l.useCollator;if(c){var p=i.length,u=o.length;if(p===0)return u;if(u===0)return p;var g,y,m,v,b;for(m=0;mb&&(y=b),b=r[v+1]+1,y>b&&(y=b),r[v]=g;r[v]=y;}return y}return e.distance(i,o)}};typeof define<"u"&&define!==null&&define.amd?define(function(){return s}):typeof Vn<"u"&&Vn!==null&&typeof il<"u"&&Vn.exports===il?Vn.exports=s:typeof self<"u"&&typeof self.postMessage=="function"&&typeof self.importScripts=="function"?self.Levenshtein=s:typeof window<"u"&&window!==null&&(window.Levenshtein=s);})();});var Jn=qi(()=>{});var Xe=R(ol=>{ol.fromCallback=function(t){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")t.apply(this,e);else return new Promise((r,n)=>{t.call(this,...e,(s,i)=>s!=null?n(s):r(i));})},"name",{value:t.name})};ol.fromPromise=function(t){return Object.defineProperty(function(...e){let r=e[e.length-1];if(typeof r!="function")return t.apply(this,e);t.apply(this,e.slice(0,-1)).then(n=>r(null,n),r);},"name",{value:t.name})};});var jg=R((VD,Mg)=>{var lr=z("constants"),eR=process.cwd,_s=null,tR=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return _s||(_s=eR.call(process)),_s};try{process.cwd();}catch{}typeof process.chdir=="function"&&(al=process.chdir,process.chdir=function(t){_s=null,al.call(process,t);},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,al));var al;Mg.exports=rR;function rR(t){lr.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=i(t.chown),t.fchown=i(t.fchown),t.lchown=i(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=o(t.chownSync),t.fchownSync=o(t.fchownSync),t.lchownSync=o(t.lchownSync),t.chmodSync=s(t.chmodSync),t.fchmodSync=s(t.fchmodSync),t.lchmodSync=s(t.lchmodSync),t.stat=l(t.stat),t.fstat=l(t.fstat),t.lstat=l(t.lstat),t.statSync=c(t.statSync),t.fstatSync=c(t.fstatSync),t.lstatSync=c(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(u,g,y){y&&process.nextTick(y);},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(u,g,y,m){m&&process.nextTick(m);},t.lchownSync=function(){}),tR==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(u){function g(y,m,v){var b=Date.now(),_=0;u(y,m,function x(A){if(A&&(A.code==="EACCES"||A.code==="EPERM"||A.code==="EBUSY")&&Date.now()-b<6e4){setTimeout(function(){t.stat(m,function(O,I){O&&O.code==="ENOENT"?u(y,m,x):v(A);});},_),_<100&&(_+=10);return}v&&v(A);});}return Object.setPrototypeOf&&Object.setPrototypeOf(g,u),g}(t.rename)),t.read=typeof t.read!="function"?t.read:function(u){function g(y,m,v,b,_,x){var A;if(x&&typeof x=="function"){var O=0;A=function(I,F,U){if(I&&I.code==="EAGAIN"&&O<10)return O++,u.call(t,y,m,v,b,_,A);x.apply(this,arguments);};}return u.call(t,y,m,v,b,_,A)}return Object.setPrototypeOf&&Object.setPrototypeOf(g,u),g}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(u){return function(g,y,m,v,b){for(var _=0;;)try{return u.call(t,g,y,m,v,b)}catch(x){if(x.code==="EAGAIN"&&_<10){_++;continue}throw x}}}(t.readSync);function e(u){u.lchmod=function(g,y,m){u.open(g,lr.O_WRONLY|lr.O_SYMLINK,y,function(v,b){if(v){m&&m(v);return}u.fchmod(b,y,function(_){u.close(b,function(x){m&&m(_||x);});});});},u.lchmodSync=function(g,y){var m=u.openSync(g,lr.O_WRONLY|lr.O_SYMLINK,y),v=!0,b;try{b=u.fchmodSync(m,y),v=!1;}finally{if(v)try{u.closeSync(m);}catch{}else u.closeSync(m);}return b};}function r(u){lr.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(g,y,m,v){u.open(g,lr.O_SYMLINK,function(b,_){if(b){v&&v(b);return}u.futimes(_,y,m,function(x){u.close(_,function(A){v&&v(x||A);});});});},u.lutimesSync=function(g,y,m){var v=u.openSync(g,lr.O_SYMLINK),b,_=!0;try{b=u.futimesSync(v,y,m),_=!1;}finally{if(_)try{u.closeSync(v);}catch{}else u.closeSync(v);}return b}):u.futimes&&(u.lutimes=function(g,y,m,v){v&&process.nextTick(v);},u.lutimesSync=function(){});}function n(u){return u&&function(g,y,m){return u.call(t,g,y,function(v){p(v)&&(v=null),m&&m.apply(this,arguments);})}}function s(u){return u&&function(g,y){try{return u.call(t,g,y)}catch(m){if(!p(m))throw m}}}function i(u){return u&&function(g,y,m,v){return u.call(t,g,y,m,function(b){p(b)&&(b=null),v&&v.apply(this,arguments);})}}function o(u){return u&&function(g,y,m){try{return u.call(t,g,y,m)}catch(v){if(!p(v))throw v}}}function l(u){return u&&function(g,y,m){typeof y=="function"&&(m=y,y=null);function v(b,_){_&&(_.uid<0&&(_.uid+=4294967296),_.gid<0&&(_.gid+=4294967296)),m&&m.apply(this,arguments);}return y?u.call(t,g,y,v):u.call(t,g,v)}}function c(u){return u&&function(g,y){var m=y?u.call(t,g,y):u.call(t,g);return m&&(m.uid<0&&(m.uid+=4294967296),m.gid<0&&(m.gid+=4294967296)),m}}function p(u){if(!u||u.code==="ENOSYS")return !0;var g=!process.getuid||process.getuid()!==0;return !!(g&&(u.code==="EINVAL"||u.code==="EPERM"))}}});var Ug=R((YD,Hg)=>{var Bg=z("stream").Stream;Hg.exports=nR;function nR(t){return {ReadStream:e,WriteStream:r};function e(n,s){if(!(this instanceof e))return new e(n,s);Bg.call(this);var i=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,s=s||{};for(var o=Object.keys(s),l=0,c=o.length;lthis.end)throw new Error("start must be <= end");this.pos=this.start;}if(this.fd!==null){process.nextTick(function(){i._read();});return}t.open(this.path,this.flags,this.mode,function(u,g){if(u){i.emit("error",u),i.readable=!1;return}i.fd=g,i.emit("open",g),i._read();});}function r(n,s){if(!(this instanceof r))return new r(n,s);Bg.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,s=s||{};for(var i=Object.keys(s),o=0,l=i.length;o= zero");this.pos=this.start;}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush());}}});var zg=R((JD,Wg)=>{Wg.exports=sR;var iR=Object.getPrototypeOf||function(t){return t.__proto__};function sR(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:iR(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));}),e}});var Qe=R((XD,cl)=>{var Ae=z("fs"),oR=jg(),aR=Ug(),lR=zg(),xs=z("util"),He,Rs;typeof Symbol=="function"&&typeof Symbol.for=="function"?(He=Symbol.for("graceful-fs.queue"),Rs=Symbol.for("graceful-fs.previous")):(He="___graceful-fs.queue",Rs="___graceful-fs.previous");function uR(){}function Vg(t,e){Object.defineProperty(t,He,{get:function(){return e}});}var Pr=uR;xs.debuglog?Pr=xs.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Pr=function(){var t=xs.format.apply(xs,arguments);t="GFS4: "+t.split(/\n/).join(` +GFS4: `),console.error(t);});Ae[He]||(Gg=global[He]||[],Vg(Ae,Gg),Ae.close=function(t){function e(r,n){return t.call(Ae,r,function(s){s||Kg(),typeof n=="function"&&n.apply(this,arguments);})}return Object.defineProperty(e,Rs,{value:t}),e}(Ae.close),Ae.closeSync=function(t){function e(r){t.apply(Ae,arguments),Kg();}return Object.defineProperty(e,Rs,{value:t}),e}(Ae.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Pr(Ae[He]),z("assert").equal(Ae[He].length,0);}));var Gg;global[He]||Vg(global,Ae[He]);cl.exports=ll(lR(Ae));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Ae.__patched&&(cl.exports=ll(Ae),Ae.__patched=!0);function ll(t){oR(t),t.gracefulify=ll,t.createReadStream=F,t.createWriteStream=U;var e=t.readFile;t.readFile=r;function r(k,j,C){return typeof j=="function"&&(C=j,j=null),V(k,j,C);function V(Y,se,T,$){return e(Y,se,function(te){te&&(te.code==="EMFILE"||te.code==="ENFILE")?ln([V,[Y,se,T],te,$||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments);})}}var n=t.writeFile;t.writeFile=s;function s(k,j,C,V){return typeof C=="function"&&(V=C,C=null),Y(k,j,C,V);function Y(se,T,$,te,Q){return n(se,T,$,function(ue){ue&&(ue.code==="EMFILE"||ue.code==="ENFILE")?ln([Y,[se,T,$,te],ue,Q||Date.now(),Date.now()]):typeof te=="function"&&te.apply(this,arguments);})}}var i=t.appendFile;i&&(t.appendFile=o);function o(k,j,C,V){return typeof C=="function"&&(V=C,C=null),Y(k,j,C,V);function Y(se,T,$,te,Q){return i(se,T,$,function(ue){ue&&(ue.code==="EMFILE"||ue.code==="ENFILE")?ln([Y,[se,T,$,te],ue,Q||Date.now(),Date.now()]):typeof te=="function"&&te.apply(this,arguments);})}}var l=t.copyFile;l&&(t.copyFile=c);function c(k,j,C,V){return typeof C=="function"&&(V=C,C=0),Y(k,j,C,V);function Y(se,T,$,te,Q){return l(se,T,$,function(ue){ue&&(ue.code==="EMFILE"||ue.code==="ENFILE")?ln([Y,[se,T,$,te],ue,Q||Date.now(),Date.now()]):typeof te=="function"&&te.apply(this,arguments);})}}var p=t.readdir;t.readdir=g;var u=/^v[0-5]\./;function g(k,j,C){typeof j=="function"&&(C=j,j=null);var V=u.test(process.version)?function(T,$,te,Q){return p(T,Y(T,$,te,Q))}:function(T,$,te,Q){return p(T,$,Y(T,$,te,Q))};return V(k,j,C);function Y(se,T,$,te){return function(Q,ue){Q&&(Q.code==="EMFILE"||Q.code==="ENFILE")?ln([V,[se,T,$],Q,te||Date.now(),Date.now()]):(ue&&ue.sort&&ue.sort(),typeof $=="function"&&$.call(this,Q,ue));}}}if(process.version.substr(0,4)==="v0.8"){var y=aR(t);x=y.ReadStream,O=y.WriteStream;}var m=t.ReadStream;m&&(x.prototype=Object.create(m.prototype),x.prototype.open=A);var v=t.WriteStream;v&&(O.prototype=Object.create(v.prototype),O.prototype.open=I),Object.defineProperty(t,"ReadStream",{get:function(){return x},set:function(k){x=k;},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return O},set:function(k){O=k;},enumerable:!0,configurable:!0});var b=x;Object.defineProperty(t,"FileReadStream",{get:function(){return b},set:function(k){b=k;},enumerable:!0,configurable:!0});var _=O;Object.defineProperty(t,"FileWriteStream",{get:function(){return _},set:function(k){_=k;},enumerable:!0,configurable:!0});function x(k,j){return this instanceof x?(m.apply(this,arguments),this):x.apply(Object.create(x.prototype),arguments)}function A(){var k=this;q(k.path,k.flags,k.mode,function(j,C){j?(k.autoClose&&k.destroy(),k.emit("error",j)):(k.fd=C,k.emit("open",C),k.read());});}function O(k,j){return this instanceof O?(v.apply(this,arguments),this):O.apply(Object.create(O.prototype),arguments)}function I(){var k=this;q(k.path,k.flags,k.mode,function(j,C){j?(k.destroy(),k.emit("error",j)):(k.fd=C,k.emit("open",C));});}function F(k,j){return new t.ReadStream(k,j)}function U(k,j){return new t.WriteStream(k,j)}var H=t.open;t.open=q;function q(k,j,C,V){return typeof C=="function"&&(V=C,C=null),Y(k,j,C,V);function Y(se,T,$,te,Q){return H(se,T,$,function(ue,Ge){ue&&(ue.code==="EMFILE"||ue.code==="ENFILE")?ln([Y,[se,T,$,te],ue,Q||Date.now(),Date.now()]):typeof te=="function"&&te.apply(this,arguments);})}}return t}function ln(t){Pr("ENQUEUE",t[0].name,t[1]),Ae[He].push(t),ul();}var Cs;function Kg(){for(var t=Date.now(),e=0;e2&&(Ae[He][e][3]=t,Ae[He][e][4]=t);ul();}function ul(){if(clearTimeout(Cs),Cs=void 0,Ae[He].length!==0){var t=Ae[He].shift(),e=t[0],r=t[1],n=t[2],s=t[3],i=t[4];if(s===void 0)Pr("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-s>=6e4){Pr("TIMEOUT",e.name,r);var o=r.pop();typeof o=="function"&&o.call(null,n);}else {var l=Date.now()-i,c=Math.max(i-s,1),p=Math.min(c*1.2,100);l>=p?(Pr("RETRY",e.name,r),e.apply(null,r.concat([s]))):Ae[He].push(t);}Cs===void 0&&(Cs=setTimeout(ul,0));}}});var Tr=R(zt=>{var Yg=Xe().fromCallback,Ke=Qe(),cR=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof Ke[t]=="function");Object.assign(zt,Ke);cR.forEach(t=>{zt[t]=Yg(Ke[t]);});zt.exists=function(t,e){return typeof e=="function"?Ke.exists(t,e):new Promise(r=>Ke.exists(t,r))};zt.read=function(t,e,r,n,s,i){return typeof i=="function"?Ke.read(t,e,r,n,s,i):new Promise((o,l)=>{Ke.read(t,e,r,n,s,(c,p,u)=>{if(c)return l(c);o({bytesRead:p,buffer:u});});})};zt.write=function(t,e,...r){return typeof r[r.length-1]=="function"?Ke.write(t,e,...r):new Promise((n,s)=>{Ke.write(t,e,...r,(i,o,l)=>{if(i)return s(i);n({bytesWritten:o,buffer:l});});})};zt.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?Ke.readv(t,e,...r):new Promise((n,s)=>{Ke.readv(t,e,...r,(i,o,l)=>{if(i)return s(i);n({bytesRead:o,buffers:l});});})};zt.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?Ke.writev(t,e,...r):new Promise((n,s)=>{Ke.writev(t,e,...r,(i,o,l)=>{if(i)return s(i);n({bytesWritten:o,buffers:l});});})};typeof Ke.realpath.native=="function"?zt.realpath.native=Yg(Ke.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003");});var Xg=R((ZD,Jg)=>{var fR=z("path");Jg.exports.checkPath=function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(fR.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}};});var ty=R((eN,fl)=>{var Qg=Tr(),{checkPath:Zg}=Xg(),ey=t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode};fl.exports.makeDir=async(t,e)=>(Zg(t),Qg.mkdir(t,{mode:ey(e),recursive:!0}));fl.exports.makeDirSync=(t,e)=>(Zg(t),Qg.mkdirSync(t,{mode:ey(e),recursive:!0}));});var Et=R((tN,ry)=>{var hR=Xe().fromPromise,{makeDir:pR,makeDirSync:hl}=ty(),pl=hR(pR);ry.exports={mkdirs:pl,mkdirsSync:hl,mkdirp:pl,mkdirpSync:hl,ensureDir:pl,ensureDirSync:hl};});var ur=R((rN,iy)=>{var dR=Xe().fromPromise,ny=Tr();function gR(t){return ny.access(t).then(()=>!0).catch(()=>!1)}iy.exports={pathExists:dR(gR),pathExistsSync:ny.existsSync};});var dl=R((nN,sy)=>{var un=Qe();function yR(t,e,r,n){un.open(t,"r+",(s,i)=>{if(s)return n(s);un.futimes(i,e,r,o=>{un.close(i,l=>{n&&n(o||l);});});});}function mR(t,e,r){let n=un.openSync(t,"r+");return un.futimesSync(n,e,r),un.closeSync(n)}sy.exports={utimesMillis:yR,utimesMillisSync:mR};});var $r=R((iN,ly)=>{var cn=Tr(),ke=z("path"),vR=z("util");function wR(t,e,r){let n=r.dereference?s=>cn.stat(s,{bigint:!0}):s=>cn.lstat(s,{bigint:!0});return Promise.all([n(t),n(e).catch(s=>{if(s.code==="ENOENT")return null;throw s})]).then(([s,i])=>({srcStat:s,destStat:i}))}function SR(t,e,r){let n,s=r.dereference?o=>cn.statSync(o,{bigint:!0}):o=>cn.lstatSync(o,{bigint:!0}),i=s(t);try{n=s(e);}catch(o){if(o.code==="ENOENT")return {srcStat:i,destStat:null};throw o}return {srcStat:i,destStat:n}}function bR(t,e,r,n,s){vR.callbackify(wR)(t,e,n,(i,o)=>{if(i)return s(i);let{srcStat:l,destStat:c}=o;if(c){if(Xn(l,c)){let p=ke.basename(t),u=ke.basename(e);return r==="move"&&p!==u&&p.toLowerCase()===u.toLowerCase()?s(null,{srcStat:l,destStat:c,isChangingCase:!0}):s(new Error("Source and destination must not be the same."))}if(l.isDirectory()&&!c.isDirectory())return s(new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`));if(!l.isDirectory()&&c.isDirectory())return s(new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`))}return l.isDirectory()&&gl(t,e)?s(new Error(Os(t,e,r))):s(null,{srcStat:l,destStat:c})});}function ER(t,e,r,n){let{srcStat:s,destStat:i}=SR(t,e,n);if(i){if(Xn(s,i)){let o=ke.basename(t),l=ke.basename(e);if(r==="move"&&o!==l&&o.toLowerCase()===l.toLowerCase())return {srcStat:s,destStat:i,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(s.isDirectory()&&!i.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!s.isDirectory()&&i.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(s.isDirectory()&&gl(t,e))throw new Error(Os(t,e,r));return {srcStat:s,destStat:i}}function oy(t,e,r,n,s){let i=ke.resolve(ke.dirname(t)),o=ke.resolve(ke.dirname(r));if(o===i||o===ke.parse(o).root)return s();cn.stat(o,{bigint:!0},(l,c)=>l?l.code==="ENOENT"?s():s(l):Xn(e,c)?s(new Error(Os(t,r,n))):oy(t,e,o,n,s));}function ay(t,e,r,n){let s=ke.resolve(ke.dirname(t)),i=ke.resolve(ke.dirname(r));if(i===s||i===ke.parse(i).root)return;let o;try{o=cn.statSync(i,{bigint:!0});}catch(l){if(l.code==="ENOENT")return;throw l}if(Xn(e,o))throw new Error(Os(t,r,n));return ay(t,e,i,n)}function Xn(t,e){return e.ino&&e.dev&&e.ino===t.ino&&e.dev===t.dev}function gl(t,e){let r=ke.resolve(t).split(ke.sep).filter(s=>s),n=ke.resolve(e).split(ke.sep).filter(s=>s);return r.reduce((s,i,o)=>s&&n[o]===i,!0)}function Os(t,e,r){return `Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}ly.exports={checkPaths:bR,checkPathsSync:ER,checkParentPaths:oy,checkParentPathsSync:ay,isSrcSubdir:gl,areIdentical:Xn};});var dy=R((sN,py)=>{var Ze=Qe(),Qn=z("path"),AR=Et().mkdirs,_R=ur().pathExists,xR=dl().utimesMillis,Zn=$r();function CR(t,e,r,n){typeof r=="function"&&!n?(n=r,r={}):typeof r=="function"&&(r={filter:r}),n=n||function(){},r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended; - see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001"),fi.checkPaths(t,e,"copy",r,(s,i)=>{if(s)return n(s);let{srcStat:o,destStat:u}=i;fi.checkParentPaths(t,o,e,"copy",c=>{if(c)return n(c);kg(t,e,r,(p,l)=>{if(p)return n(p);if(!l)return n();_R(u,t,e,r,n);});});});}function _R(t,e,r,n,s){let i=ci.dirname(r);ER(i,(o,u)=>{if(o)return s(o);if(u)return $u(t,e,r,n,s);bR(i,c=>c?s(c):$u(t,e,r,n,s));});}function kg(t,e,r,n){if(!r.filter)return n(null,!0);Promise.resolve(r.filter(t,e)).then(s=>n(null,s),s=>n(s));}function $u(t,e,r,n,s){(n.dereference?tt.stat:tt.lstat)(e,(o,u)=>o?s(o):u.isDirectory()?$R(u,t,e,r,n,s):u.isFile()||u.isCharacterDevice()||u.isBlockDevice()?CR(u,t,e,r,n,s):u.isSymbolicLink()?LR(t,e,r,n,s):u.isSocket()?s(new Error(`Cannot copy a socket file: ${e}`)):u.isFIFO()?s(new Error(`Cannot copy a FIFO pipe: ${e}`)):s(new Error(`Unknown file: ${e}`)));}function CR(t,e,r,n,s,i){return e?RR(t,r,n,s,i):Lg(t,r,n,s,i)}function RR(t,e,r,n,s){if(n.overwrite)tt.unlink(r,i=>i?s(i):Lg(t,e,r,n,s));else return n.errorOnExist?s(new Error(`'${r}' already exists`)):s()}function Lg(t,e,r,n,s){tt.copyFile(e,r,i=>i?s(i):n.preserveTimestamps?OR(t.mode,e,r,s):js(r,t.mode,s));}function OR(t,e,r,n){return TR(t)?PR(r,t,s=>s?n(s):Fg(t,e,r,n)):Fg(t,e,r,n)}function TR(t){return (t&128)===0}function PR(t,e,r){return js(t,e|128,r)}function Fg(t,e,r,n){IR(e,r,s=>s?n(s):js(r,t,n));}function js(t,e,r){return tt.chmod(t,e,r)}function IR(t,e,r){tt.stat(t,(n,s)=>n?r(n):xR(e,s.atime,s.mtime,r));}function $R(t,e,r,n,s,i){return e?qg(r,n,s,i):FR(t.mode,r,n,s,i)}function FR(t,e,r,n,s){tt.mkdir(r,i=>{if(i)return s(i);qg(e,r,n,o=>o?s(o):js(r,t,s));});}function qg(t,e,r,n){tt.readdir(t,(s,i)=>s?n(s):Fu(i,t,e,r,n));}function Fu(t,e,r,n,s){let i=t.pop();return i?kR(t,i,e,r,n,s):s()}function kR(t,e,r,n,s,i){let o=ci.join(r,e),u=ci.join(n,e);kg(o,u,s,(c,p)=>{if(c)return i(c);if(!p)return Fu(t,r,n,s,i);fi.checkPaths(o,u,"copy",s,(l,d)=>{if(l)return i(l);let{destStat:g}=d;$u(g,o,u,s,m=>m?i(m):Fu(t,r,n,s,i));});});}function LR(t,e,r,n,s){tt.readlink(e,(i,o)=>{if(i)return s(i);if(n.dereference&&(o=ci.resolve(process.cwd(),o)),t)tt.readlink(r,(u,c)=>u?u.code==="EINVAL"||u.code==="UNKNOWN"?tt.symlink(o,r,s):s(u):(n.dereference&&(c=ci.resolve(process.cwd(),c)),fi.isSrcSubdir(o,c)?s(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${c}'.`)):fi.isSrcSubdir(c,o)?s(new Error(`Cannot overwrite '${c}' with '${o}'.`)):qR(o,r,s)));else return tt.symlink(o,r,s)});}function qR(t,e,r){tt.unlink(e,n=>n?r(n):tt.symlink(t,e,r));}Bg.exports=AR;});var Hg=_((MN,jg)=>{var Je=et(),hi=G("path"),BR=Rt().mkdirsSync,DR=Pu().utimesMillisSync,pi=Dr();function NR(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended; + see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001"),Zn.checkPaths(t,e,"copy",r,(s,i)=>{if(s)return n(s);let{srcStat:o,destStat:l}=i;Zn.checkParentPaths(t,o,e,"copy",c=>{if(c)return n(c);cy(t,e,r,(p,u)=>{if(p)return n(p);if(!u)return n();RR(l,t,e,r,n);});});});}function RR(t,e,r,n,s){let i=Qn.dirname(r);_R(i,(o,l)=>{if(o)return s(o);if(l)return yl(t,e,r,n,s);AR(i,c=>c?s(c):yl(t,e,r,n,s));});}function cy(t,e,r,n){if(!r.filter)return n(null,!0);Promise.resolve(r.filter(t,e)).then(s=>n(null,s),s=>n(s));}function yl(t,e,r,n,s){(n.dereference?Ze.stat:Ze.lstat)(e,(o,l)=>o?s(o):l.isDirectory()?LR(l,t,e,r,n,s):l.isFile()||l.isCharacterDevice()||l.isBlockDevice()?OR(l,t,e,r,n,s):l.isSymbolicLink()?DR(t,e,r,n,s):l.isSocket()?s(new Error(`Cannot copy a socket file: ${e}`)):l.isFIFO()?s(new Error(`Cannot copy a FIFO pipe: ${e}`)):s(new Error(`Unknown file: ${e}`)));}function OR(t,e,r,n,s,i){return e?PR(t,r,n,s,i):fy(t,r,n,s,i)}function PR(t,e,r,n,s){if(n.overwrite)Ze.unlink(r,i=>i?s(i):fy(t,e,r,n,s));else return n.errorOnExist?s(new Error(`'${r}' already exists`)):s()}function fy(t,e,r,n,s){Ze.copyFile(e,r,i=>i?s(i):n.preserveTimestamps?TR(t.mode,e,r,s):Ps(r,t.mode,s));}function TR(t,e,r,n){return $R(t)?IR(r,t,s=>s?n(s):uy(t,e,r,n)):uy(t,e,r,n)}function $R(t){return (t&128)===0}function IR(t,e,r){return Ps(t,e|128,r)}function uy(t,e,r,n){kR(e,r,s=>s?n(s):Ps(r,t,n));}function Ps(t,e,r){return Ze.chmod(t,e,r)}function kR(t,e,r){Ze.stat(t,(n,s)=>n?r(n):xR(e,s.atime,s.mtime,r));}function LR(t,e,r,n,s,i){return e?hy(r,n,s,i):FR(t.mode,r,n,s,i)}function FR(t,e,r,n,s){Ze.mkdir(r,i=>{if(i)return s(i);hy(e,r,n,o=>o?s(o):Ps(r,t,s));});}function hy(t,e,r,n){Ze.readdir(t,(s,i)=>s?n(s):ml(i,t,e,r,n));}function ml(t,e,r,n,s){let i=t.pop();return i?qR(t,i,e,r,n,s):s()}function qR(t,e,r,n,s,i){let o=Qn.join(r,e),l=Qn.join(n,e);cy(o,l,s,(c,p)=>{if(c)return i(c);if(!p)return ml(t,r,n,s,i);Zn.checkPaths(o,l,"copy",s,(u,g)=>{if(u)return i(u);let{destStat:y}=g;yl(y,o,l,s,m=>m?i(m):ml(t,r,n,s,i));});});}function DR(t,e,r,n,s){Ze.readlink(e,(i,o)=>{if(i)return s(i);if(n.dereference&&(o=Qn.resolve(process.cwd(),o)),t)Ze.readlink(r,(l,c)=>l?l.code==="EINVAL"||l.code==="UNKNOWN"?Ze.symlink(o,r,s):s(l):(n.dereference&&(c=Qn.resolve(process.cwd(),c)),Zn.isSrcSubdir(o,c)?s(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${c}'.`)):Zn.isSrcSubdir(c,o)?s(new Error(`Cannot overwrite '${c}' with '${o}'.`)):NR(o,r,s)));else return Ze.symlink(o,r,s)});}function NR(t,e,r){Ze.unlink(e,n=>n?r(n):Ze.symlink(t,e,r));}py.exports=CR;});var wy=R((oN,vy)=>{var Ve=Qe(),ei=z("path"),MR=Et().mkdirsSync,jR=dl().utimesMillisSync,ti=$r();function BR(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended; - see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:n,destStat:s}=pi.checkPathsSync(t,e,"copy",r);if(pi.checkParentPathsSync(t,n,e,"copy"),r.filter&&!r.filter(t,e))return;let i=hi.dirname(e);return Je.existsSync(i)||BR(i),Ng(s,t,e,r)}function Ng(t,e,r,n){let i=(n.dereference?Je.statSync:Je.lstatSync)(e);if(i.isDirectory())return GR(i,t,e,r,n);if(i.isFile()||i.isCharacterDevice()||i.isBlockDevice())return MR(i,t,e,r,n);if(i.isSymbolicLink())return YR(t,e,r,n);throw i.isSocket()?new Error(`Cannot copy a socket file: ${e}`):i.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}function MR(t,e,r,n,s){return e?UR(t,r,n,s):Mg(t,r,n,s)}function UR(t,e,r,n){if(n.overwrite)return Je.unlinkSync(r),Mg(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function Mg(t,e,r,n){return Je.copyFileSync(e,r),n.preserveTimestamps&&jR(t.mode,e,r),ku(r,t.mode)}function jR(t,e,r){return HR(t)&&WR(r,t),zR(e,r)}function HR(t){return (t&128)===0}function WR(t,e){return ku(t,e|128)}function ku(t,e){return Je.chmodSync(t,e)}function zR(t,e){let r=Je.statSync(t);return DR(e,r.atime,r.mtime)}function GR(t,e,r,n,s){return e?Ug(r,n,s):VR(t.mode,r,n,s)}function VR(t,e,r,n){return Je.mkdirSync(r),Ug(e,r,n),ku(r,t)}function Ug(t,e,r){Je.readdirSync(t).forEach(n=>KR(n,t,e,r));}function KR(t,e,r,n){let s=hi.join(e,t),i=hi.join(r,t);if(n.filter&&!n.filter(s,i))return;let{destStat:o}=pi.checkPathsSync(s,i,"copy",n);return Ng(o,s,i,n)}function YR(t,e,r,n){let s=Je.readlinkSync(e);if(n.dereference&&(s=hi.resolve(process.cwd(),s)),t){let i;try{i=Je.readlinkSync(r);}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return Je.symlinkSync(s,r);throw o}if(n.dereference&&(i=hi.resolve(process.cwd(),i)),pi.isSrcSubdir(s,i))throw new Error(`Cannot copy '${s}' to a subdirectory of itself, '${i}'.`);if(pi.isSrcSubdir(i,s))throw new Error(`Cannot overwrite '${i}' with '${s}'.`);return JR(s,r)}else return Je.symlinkSync(s,r)}function JR(t,e){return Je.unlinkSync(e),Je.symlinkSync(t,e)}jg.exports=NR;});var Hs=_((UN,Wg)=>{var XR=Ze().fromCallback;Wg.exports={copy:XR(Dg()),copySync:Hg()};});var di=_((jN,Gg)=>{var zg=et(),QR=Ze().fromCallback;function ZR(t,e){zg.rm(t,{recursive:!0,force:!0},e);}function eO(t){zg.rmSync(t,{recursive:!0,force:!0});}Gg.exports={remove:QR(ZR),removeSync:eO};});var em=_((HN,Zg)=>{var tO=Ze().fromPromise,Yg=Br(),Jg=G("path"),Xg=Rt(),Qg=di(),Vg=tO(async function(e){let r;try{r=await Yg.readdir(e);}catch{return Xg.mkdirs(e)}return Promise.all(r.map(n=>Qg.remove(Jg.join(e,n))))});function Kg(t){let e;try{e=Yg.readdirSync(t);}catch{return Xg.mkdirsSync(t)}e.forEach(r=>{r=Jg.join(t,r),Qg.removeSync(r);});}Zg.exports={emptyDirSync:Kg,emptydirSync:Kg,emptyDir:Vg,emptydir:Vg};});var im=_((WN,nm)=>{var rO=Ze().fromCallback,tm=G("path"),mr=et(),rm=Rt();function nO(t,e){function r(){mr.writeFile(t,"",n=>{if(n)return e(n);e();});}mr.stat(t,(n,s)=>{if(!n&&s.isFile())return e();let i=tm.dirname(t);mr.stat(i,(o,u)=>{if(o)return o.code==="ENOENT"?rm.mkdirs(i,c=>{if(c)return e(c);r();}):e(o);u.isDirectory()?r():mr.readdir(i,c=>{if(c)return e(c)});});});}function iO(t){let e;try{e=mr.statSync(t);}catch{}if(e&&e.isFile())return;let r=tm.dirname(t);try{mr.statSync(r).isDirectory()||mr.readdirSync(r);}catch(n){if(n&&n.code==="ENOENT")rm.mkdirsSync(r);else throw n}mr.writeFileSync(t,"");}nm.exports={createFile:rO(nO),createFileSync:iO};});var lm=_((zN,um)=>{var sO=Ze().fromCallback,sm=G("path"),wr=et(),om=Rt(),oO=gr().pathExists,{areIdentical:am}=Dr();function aO(t,e,r){function n(s,i){wr.link(s,i,o=>{if(o)return r(o);r(null);});}wr.lstat(e,(s,i)=>{wr.lstat(t,(o,u)=>{if(o)return o.message=o.message.replace("lstat","ensureLink"),r(o);if(i&&am(u,i))return r(null);let c=sm.dirname(e);oO(c,(p,l)=>{if(p)return r(p);if(l)return n(t,e);om.mkdirs(c,d=>{if(d)return r(d);n(t,e);});});});});}function uO(t,e){let r;try{r=wr.lstatSync(e);}catch{}try{let i=wr.lstatSync(t);if(r&&am(i,r))return}catch(i){throw i.message=i.message.replace("lstat","ensureLink"),i}let n=sm.dirname(e);return wr.existsSync(n)||om.mkdirsSync(n),wr.linkSync(t,e)}um.exports={createLink:sO(aO),createLinkSync:uO};});var fm=_((GN,cm)=>{var vr=G("path"),yi=et(),lO=gr().pathExists;function cO(t,e,r){if(vr.isAbsolute(t))return yi.lstat(t,n=>n?(n.message=n.message.replace("lstat","ensureSymlink"),r(n)):r(null,{toCwd:t,toDst:t}));{let n=vr.dirname(e),s=vr.join(n,t);return lO(s,(i,o)=>i?r(i):o?r(null,{toCwd:s,toDst:t}):yi.lstat(t,u=>u?(u.message=u.message.replace("lstat","ensureSymlink"),r(u)):r(null,{toCwd:t,toDst:vr.relative(n,t)})))}}function fO(t,e){let r;if(vr.isAbsolute(t)){if(r=yi.existsSync(t),!r)throw new Error("absolute srcpath does not exist");return {toCwd:t,toDst:t}}else {let n=vr.dirname(e),s=vr.join(n,t);if(r=yi.existsSync(s),r)return {toCwd:s,toDst:t};if(r=yi.existsSync(t),!r)throw new Error("relative srcpath does not exist");return {toCwd:t,toDst:vr.relative(n,t)}}}cm.exports={symlinkPaths:cO,symlinkPathsSync:fO};});var dm=_((VN,pm)=>{var hm=et();function hO(t,e,r){if(r=typeof e=="function"?e:r,e=typeof e=="function"?!1:e,e)return r(null,e);hm.lstat(t,(n,s)=>{if(n)return r(null,"file");e=s&&s.isDirectory()?"dir":"file",r(null,e);});}function pO(t,e){let r;if(e)return e;try{r=hm.lstatSync(t);}catch{return "file"}return r&&r.isDirectory()?"dir":"file"}pm.exports={symlinkType:hO,symlinkTypeSync:pO};});var Em=_((KN,bm)=>{var dO=Ze().fromCallback,gm=G("path"),Ot=Br(),mm=Rt(),yO=mm.mkdirs,gO=mm.mkdirsSync,wm=fm(),mO=wm.symlinkPaths,wO=wm.symlinkPathsSync,vm=dm(),vO=vm.symlinkType,SO=vm.symlinkTypeSync,bO=gr().pathExists,{areIdentical:Sm}=Dr();function EO(t,e,r,n){n=typeof r=="function"?r:n,r=typeof r=="function"?!1:r,Ot.lstat(e,(s,i)=>{!s&&i.isSymbolicLink()?Promise.all([Ot.stat(t),Ot.stat(e)]).then(([o,u])=>{if(Sm(o,u))return n(null);ym(t,e,r,n);}):ym(t,e,r,n);});}function ym(t,e,r,n){mO(t,e,(s,i)=>{if(s)return n(s);t=i.toDst,vO(i.toCwd,r,(o,u)=>{if(o)return n(o);let c=gm.dirname(e);bO(c,(p,l)=>{if(p)return n(p);if(l)return Ot.symlink(t,e,u,n);yO(c,d=>{if(d)return n(d);Ot.symlink(t,e,u,n);});});});});}function xO(t,e,r){let n;try{n=Ot.lstatSync(e);}catch{}if(n&&n.isSymbolicLink()){let u=Ot.statSync(t),c=Ot.statSync(e);if(Sm(u,c))return}let s=wO(t,e);t=s.toDst,r=SO(s.toCwd,r);let i=gm.dirname(e);return Ot.existsSync(i)||gO(i),Ot.symlinkSync(t,e,r)}bm.exports={createSymlink:dO(EO),createSymlinkSync:xO};});var Pm=_((YN,Tm)=>{var{createFile:xm,createFileSync:Am}=im(),{createLink:_m,createLinkSync:Cm}=lm(),{createSymlink:Rm,createSymlinkSync:Om}=Em();Tm.exports={createFile:xm,createFileSync:Am,ensureFile:xm,ensureFileSync:Am,createLink:_m,createLinkSync:Cm,ensureLink:_m,ensureLinkSync:Cm,createSymlink:Rm,createSymlinkSync:Om,ensureSymlink:Rm,ensureSymlinkSync:Om};});var Ws=_((JN,Im)=>{function AO(t,{EOL:e=` -`,finalEOL:r=!0,replacer:n=null,spaces:s}={}){let i=r?e:"";return JSON.stringify(t,n,s).replace(/\n/g,e)+i}function _O(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}Im.exports={stringify:AO,stripBom:_O};});var Lm=_((XN,km)=>{var Sn;try{Sn=et();}catch{Sn=G("fs");}var zs=Ze(),{stringify:$m,stripBom:Fm}=Ws();async function CO(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Sn,n="throws"in e?e.throws:!0,s=await zs.fromCallback(r.readFile)(t,e);s=Fm(s);let i;try{i=JSON.parse(s,e?e.reviver:null);}catch(o){if(n)throw o.message=`${t}: ${o.message}`,o;return null}return i}var RO=zs.fromPromise(CO);function OO(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Sn,n="throws"in e?e.throws:!0;try{let s=r.readFileSync(t,e);return s=Fm(s),JSON.parse(s,e.reviver)}catch(s){if(n)throw s.message=`${t}: ${s.message}`,s;return null}}async function TO(t,e,r={}){let n=r.fs||Sn,s=$m(e,r);await zs.fromCallback(n.writeFile)(t,s,r);}var PO=zs.fromPromise(TO);function IO(t,e,r={}){let n=r.fs||Sn,s=$m(e,r);return n.writeFileSync(t,s,r)}var $O={readFile:RO,readFileSync:OO,writeFile:PO,writeFileSync:IO};km.exports=$O;});var Bm=_((QN,qm)=>{var Gs=Lm();qm.exports={readJson:Gs.readFile,readJsonSync:Gs.readFileSync,writeJson:Gs.writeFile,writeJsonSync:Gs.writeFileSync};});var Vs=_((ZN,Mm)=>{var FO=Ze().fromCallback,gi=et(),Dm=G("path"),Nm=Rt(),kO=gr().pathExists;function LO(t,e,r,n){typeof r=="function"&&(n=r,r="utf8");let s=Dm.dirname(t);kO(s,(i,o)=>{if(i)return n(i);if(o)return gi.writeFile(t,e,r,n);Nm.mkdirs(s,u=>{if(u)return n(u);gi.writeFile(t,e,r,n);});});}function qO(t,...e){let r=Dm.dirname(t);if(gi.existsSync(r))return gi.writeFileSync(t,...e);Nm.mkdirsSync(r),gi.writeFileSync(t,...e);}Mm.exports={outputFile:FO(LO),outputFileSync:qO};});var jm=_((e2,Um)=>{var{stringify:BO}=Ws(),{outputFile:DO}=Vs();async function NO(t,e,r={}){let n=BO(e,r);await DO(t,n,r);}Um.exports=NO;});var Wm=_((t2,Hm)=>{var{stringify:MO}=Ws(),{outputFileSync:UO}=Vs();function jO(t,e,r){let n=MO(e,r);UO(t,n,r);}Hm.exports=jO;});var Gm=_((r2,zm)=>{var HO=Ze().fromPromise,Xe=Bm();Xe.outputJson=HO(jm());Xe.outputJsonSync=Wm();Xe.outputJSON=Xe.outputJson;Xe.outputJSONSync=Xe.outputJsonSync;Xe.writeJSON=Xe.writeJson;Xe.writeJSONSync=Xe.writeJsonSync;Xe.readJSON=Xe.readJson;Xe.readJSONSync=Xe.readJsonSync;zm.exports=Xe;});var Xm=_((n2,Jm)=>{var WO=et(),qu=G("path"),zO=Hs().copy,Ym=di().remove,GO=Rt().mkdirp,VO=gr().pathExists,Vm=Dr();function KO(t,e,r,n){typeof r=="function"&&(n=r,r={}),r=r||{};let s=r.overwrite||r.clobber||!1;Vm.checkPaths(t,e,"move",r,(i,o)=>{if(i)return n(i);let{srcStat:u,isChangingCase:c=!1}=o;Vm.checkParentPaths(t,u,e,"move",p=>{if(p)return n(p);if(YO(e))return Km(t,e,s,c,n);GO(qu.dirname(e),l=>l?n(l):Km(t,e,s,c,n));});});}function YO(t){let e=qu.dirname(t);return qu.parse(e).root===e}function Km(t,e,r,n,s){if(n)return Lu(t,e,r,s);if(r)return Ym(e,i=>i?s(i):Lu(t,e,r,s));VO(e,(i,o)=>i?s(i):o?s(new Error("dest already exists.")):Lu(t,e,r,s));}function Lu(t,e,r,n){WO.rename(t,e,s=>s?s.code!=="EXDEV"?n(s):JO(t,e,r,n):n());}function JO(t,e,r,n){zO(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0},i=>i?n(i):Ym(t,n));}Jm.exports=KO;});var rw=_((i2,tw)=>{var Zm=et(),Du=G("path"),XO=Hs().copySync,ew=di().removeSync,QO=Rt().mkdirpSync,Qm=Dr();function ZO(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:s,isChangingCase:i=!1}=Qm.checkPathsSync(t,e,"move",r);return Qm.checkParentPathsSync(t,s,e,"move"),eT(e)||QO(Du.dirname(e)),tT(t,e,n,i)}function eT(t){let e=Du.dirname(t);return Du.parse(e).root===e}function tT(t,e,r,n){if(n)return Bu(t,e,r);if(r)return ew(e),Bu(t,e,r);if(Zm.existsSync(e))throw new Error("dest already exists.");return Bu(t,e,r)}function Bu(t,e,r){try{Zm.renameSync(t,e);}catch(n){if(n.code!=="EXDEV")throw n;return rT(t,e,r)}}function rT(t,e,r){return XO(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),ew(t)}tw.exports=ZO;});var iw=_((s2,nw)=>{var nT=Ze().fromCallback;nw.exports={move:nT(Xm()),moveSync:rw()};});var Nu=_((o2,sw)=>{sw.exports={...Br(),...Hs(),...em(),...Pm(),...Gm(),...Rt(),...iw(),...Vs(),...gr(),...di()};});var Uu=_((l2,uw)=>{var mi=t=>t&&typeof t.message=="string",Mu=t=>{if(!t)return;let e=t.cause;if(typeof e=="function"){let r=t.cause();return mi(r)?r:void 0}else return mi(e)?e:void 0},ow=(t,e)=>{if(!mi(t))return "";let r=t.stack||"";if(e.has(t))return r+` -causes have become circular...`;let n=Mu(t);return n?(e.add(t),r+` -caused by: `+ow(n,e)):r},iT=t=>ow(t,new Set),aw=(t,e,r)=>{if(!mi(t))return "";let n=r?"":t.message||"";if(e.has(t))return n+": ...";let s=Mu(t);if(s){e.add(t);let i=typeof t.cause=="function";return n+(i?"":": ")+aw(s,e,i)}else return n},sT=t=>aw(t,new Set);uw.exports={isErrorLike:mi,getErrorCause:Mu,stackWithCauses:iT,messageWithCauses:sT};});var ju=_((c2,cw)=>{var oT=Symbol("circular-ref-tag"),Ys=Symbol("pino-raw-err-ref"),lw=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[Ys]},set:function(t){this[Ys]=t;}}});Object.defineProperty(lw,Ys,{writable:!0,value:{}});cw.exports={pinoErrProto:lw,pinoErrorSymbols:{seen:oT,rawSymbol:Ys}};});var pw=_((f2,hw)=>{hw.exports=Wu;var{messageWithCauses:aT,stackWithCauses:uT,isErrorLike:fw}=Uu(),{pinoErrProto:lT,pinoErrorSymbols:cT}=ju(),{seen:Hu}=cT,{toString:fT}=Object.prototype;function Wu(t){if(!fw(t))return t;t[Hu]=void 0;let e=Object.create(lT);e.type=fT.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=aT(t),e.stack=uT(t),Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>Wu(r)));for(let r in t)if(e[r]===void 0){let n=t[r];fw(n)?r!=="cause"&&!Object.prototype.hasOwnProperty.call(n,Hu)&&(e[r]=Wu(n)):e[r]=n;}return delete t[Hu],e.raw=t,e}});var yw=_((h2,dw)=>{dw.exports=Xs;var{isErrorLike:zu}=Uu(),{pinoErrProto:hT,pinoErrorSymbols:pT}=ju(),{seen:Js}=pT,{toString:dT}=Object.prototype;function Xs(t){if(!zu(t))return t;t[Js]=void 0;let e=Object.create(hT);e.type=dT.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=t.message,e.stack=t.stack,Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>Xs(r))),zu(t.cause)&&!Object.prototype.hasOwnProperty.call(t.cause,Js)&&(e.cause=Xs(t.cause));for(let r in t)if(e[r]===void 0){let n=t[r];zu(n)?Object.prototype.hasOwnProperty.call(n,Js)||(e[r]=Xs(n)):e[r]=n;}return delete t[Js],e.raw=t,e}});var vw=_((p2,ww)=>{ww.exports={mapHttpRequest:yT,reqSerializer:mw};var Gu=Symbol("pino-raw-req-ref"),gw=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Gu]},set:function(t){this[Gu]=t;}}});Object.defineProperty(gw,Gu,{writable:!0,value:{}});function mw(t){let e=t.info||t.socket,r=Object.create(gw);if(r.id=typeof t.id=="function"?t.id():t.id||(t.info?t.info.id:void 0),r.method=t.method,t.originalUrl)r.url=t.originalUrl;else {let n=t.path;r.url=typeof n=="string"?n:t.url?t.url.path||t.url:void 0;}return t.query&&(r.query=t.query),t.params&&(r.params=t.params),r.headers=t.headers,r.remoteAddress=e&&e.remoteAddress,r.remotePort=e&&e.remotePort,r.raw=t.raw||t,r}function yT(t){return {req:mw(t)}}});var xw=_((d2,Ew)=>{Ew.exports={mapHttpResponse:gT,resSerializer:bw};var Vu=Symbol("pino-raw-res-ref"),Sw=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Vu]},set:function(t){this[Vu]=t;}}});Object.defineProperty(Sw,Vu,{writable:!0,value:{}});function bw(t){let e=Object.create(Sw);return e.statusCode=t.headersSent?t.statusCode:null,e.headers=t.getHeaders?t.getHeaders():t._headers,e.raw=t,e}function gT(t){return {res:bw(t)}}});var Yu=_((y2,Aw)=>{var Ku=pw(),mT=yw(),Qs=vw(),Zs=xw();Aw.exports={err:Ku,errWithCause:mT,mapHttpRequest:Qs.mapHttpRequest,mapHttpResponse:Zs.mapHttpResponse,req:Qs.reqSerializer,res:Zs.resSerializer,wrapErrorSerializer:function(e){return e===Ku?e:function(n){return e(Ku(n))}},wrapRequestSerializer:function(e){return e===Qs.reqSerializer?e:function(n){return e(Qs.reqSerializer(n))}},wrapResponseSerializer:function(e){return e===Zs.resSerializer?e:function(n){return e(Zs.resSerializer(n))}}};});var Ju=_((g2,_w)=>{function wT(t,e){return e}_w.exports=function(){let e=Error.prepareStackTrace;Error.prepareStackTrace=wT;let r=new Error().stack;if(Error.prepareStackTrace=e,!Array.isArray(r))return;let n=r.slice(2),s=[];for(let i of n)i&&s.push(i.getFileName());return s};});var Rw=_((m2,Cw)=>{Cw.exports=vT;function vT(t={}){let{ERR_PATHS_MUST_BE_STRINGS:e=()=>"fast-redact - Paths must be (non-empty) strings",ERR_INVALID_PATH:r=n=>`fast-redact \u2013 Invalid path (${n})`}=t;return function({paths:s}){s.forEach(i=>{if(typeof i!="string")throw Error(e());try{if(/〇/.test(i))throw Error();let o=(i[0]==="["?"":".")+i.replace(/^\*/,"\u3007").replace(/\.\*/g,".\u3007").replace(/\[\*\]/g,"[\u3007]");if(/\n|\r|;/.test(o)||/\/\*/.test(o))throw Error();Function(` + see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:n,destStat:s}=ti.checkPathsSync(t,e,"copy",r);if(ti.checkParentPathsSync(t,n,e,"copy"),r.filter&&!r.filter(t,e))return;let i=ei.dirname(e);return Ve.existsSync(i)||MR(i),gy(s,t,e,r)}function gy(t,e,r,n){let i=(n.dereference?Ve.statSync:Ve.lstatSync)(e);if(i.isDirectory())return VR(i,t,e,r,n);if(i.isFile()||i.isCharacterDevice()||i.isBlockDevice())return HR(i,t,e,r,n);if(i.isSymbolicLink())return XR(t,e,r,n);throw i.isSocket()?new Error(`Cannot copy a socket file: ${e}`):i.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}function HR(t,e,r,n,s){return e?UR(t,r,n,s):yy(t,r,n,s)}function UR(t,e,r,n){if(n.overwrite)return Ve.unlinkSync(r),yy(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function yy(t,e,r,n){return Ve.copyFileSync(e,r),n.preserveTimestamps&&WR(t.mode,e,r),vl(r,t.mode)}function WR(t,e,r){return zR(t)&&GR(r,t),KR(e,r)}function zR(t){return (t&128)===0}function GR(t,e){return vl(t,e|128)}function vl(t,e){return Ve.chmodSync(t,e)}function KR(t,e){let r=Ve.statSync(t);return jR(e,r.atime,r.mtime)}function VR(t,e,r,n,s){return e?my(r,n,s):YR(t.mode,r,n,s)}function YR(t,e,r,n){return Ve.mkdirSync(r),my(e,r,n),vl(r,t)}function my(t,e,r){Ve.readdirSync(t).forEach(n=>JR(n,t,e,r));}function JR(t,e,r,n){let s=ei.join(e,t),i=ei.join(r,t);if(n.filter&&!n.filter(s,i))return;let{destStat:o}=ti.checkPathsSync(s,i,"copy",n);return gy(o,s,i,n)}function XR(t,e,r,n){let s=Ve.readlinkSync(e);if(n.dereference&&(s=ei.resolve(process.cwd(),s)),t){let i;try{i=Ve.readlinkSync(r);}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return Ve.symlinkSync(s,r);throw o}if(n.dereference&&(i=ei.resolve(process.cwd(),i)),ti.isSrcSubdir(s,i))throw new Error(`Cannot copy '${s}' to a subdirectory of itself, '${i}'.`);if(ti.isSrcSubdir(i,s))throw new Error(`Cannot overwrite '${i}' with '${s}'.`);return QR(s,r)}else return Ve.symlinkSync(s,r)}function QR(t,e){return Ve.unlinkSync(e),Ve.symlinkSync(t,e)}vy.exports=BR;});var Ts=R((aN,Sy)=>{var ZR=Xe().fromCallback;Sy.exports={copy:ZR(dy()),copySync:wy()};});var ri=R((lN,Ey)=>{var by=Qe(),eO=Xe().fromCallback;function tO(t,e){by.rm(t,{recursive:!0,force:!0},e);}function rO(t){by.rmSync(t,{recursive:!0,force:!0});}Ey.exports={remove:eO(tO),removeSync:rO};});var Ty=R((uN,Py)=>{var nO=Xe().fromPromise,xy=Tr(),Cy=z("path"),Ry=Et(),Oy=ri(),Ay=nO(async function(e){let r;try{r=await xy.readdir(e);}catch{return Ry.mkdirs(e)}return Promise.all(r.map(n=>Oy.remove(Cy.join(e,n))))});function _y(t){let e;try{e=xy.readdirSync(t);}catch{return Ry.mkdirsSync(t)}e.forEach(r=>{r=Cy.join(t,r),Oy.removeSync(r);});}Py.exports={emptyDirSync:_y,emptydirSync:_y,emptyDir:Ay,emptydir:Ay};});var Ly=R((cN,ky)=>{var iO=Xe().fromCallback,$y=z("path"),cr=Qe(),Iy=Et();function sO(t,e){function r(){cr.writeFile(t,"",n=>{if(n)return e(n);e();});}cr.stat(t,(n,s)=>{if(!n&&s.isFile())return e();let i=$y.dirname(t);cr.stat(i,(o,l)=>{if(o)return o.code==="ENOENT"?Iy.mkdirs(i,c=>{if(c)return e(c);r();}):e(o);l.isDirectory()?r():cr.readdir(i,c=>{if(c)return e(c)});});});}function oO(t){let e;try{e=cr.statSync(t);}catch{}if(e&&e.isFile())return;let r=$y.dirname(t);try{cr.statSync(r).isDirectory()||cr.readdirSync(r);}catch(n){if(n&&n.code==="ENOENT")Iy.mkdirsSync(r);else throw n}cr.writeFileSync(t,"");}ky.exports={createFile:iO(sO),createFileSync:oO};});var My=R((fN,Ny)=>{var aO=Xe().fromCallback,Fy=z("path"),fr=Qe(),qy=Et(),lO=ur().pathExists,{areIdentical:Dy}=$r();function uO(t,e,r){function n(s,i){fr.link(s,i,o=>{if(o)return r(o);r(null);});}fr.lstat(e,(s,i)=>{fr.lstat(t,(o,l)=>{if(o)return o.message=o.message.replace("lstat","ensureLink"),r(o);if(i&&Dy(l,i))return r(null);let c=Fy.dirname(e);lO(c,(p,u)=>{if(p)return r(p);if(u)return n(t,e);qy.mkdirs(c,g=>{if(g)return r(g);n(t,e);});});});});}function cO(t,e){let r;try{r=fr.lstatSync(e);}catch{}try{let i=fr.lstatSync(t);if(r&&Dy(i,r))return}catch(i){throw i.message=i.message.replace("lstat","ensureLink"),i}let n=Fy.dirname(e);return fr.existsSync(n)||qy.mkdirsSync(n),fr.linkSync(t,e)}Ny.exports={createLink:aO(uO),createLinkSync:cO};});var By=R((hN,jy)=>{var hr=z("path"),ni=Qe(),fO=ur().pathExists;function hO(t,e,r){if(hr.isAbsolute(t))return ni.lstat(t,n=>n?(n.message=n.message.replace("lstat","ensureSymlink"),r(n)):r(null,{toCwd:t,toDst:t}));{let n=hr.dirname(e),s=hr.join(n,t);return fO(s,(i,o)=>i?r(i):o?r(null,{toCwd:s,toDst:t}):ni.lstat(t,l=>l?(l.message=l.message.replace("lstat","ensureSymlink"),r(l)):r(null,{toCwd:t,toDst:hr.relative(n,t)})))}}function pO(t,e){let r;if(hr.isAbsolute(t)){if(r=ni.existsSync(t),!r)throw new Error("absolute srcpath does not exist");return {toCwd:t,toDst:t}}else {let n=hr.dirname(e),s=hr.join(n,t);if(r=ni.existsSync(s),r)return {toCwd:s,toDst:t};if(r=ni.existsSync(t),!r)throw new Error("relative srcpath does not exist");return {toCwd:t,toDst:hr.relative(n,t)}}}jy.exports={symlinkPaths:hO,symlinkPathsSync:pO};});var Wy=R((pN,Uy)=>{var Hy=Qe();function dO(t,e,r){if(r=typeof e=="function"?e:r,e=typeof e=="function"?!1:e,e)return r(null,e);Hy.lstat(t,(n,s)=>{if(n)return r(null,"file");e=s&&s.isDirectory()?"dir":"file",r(null,e);});}function gO(t,e){let r;if(e)return e;try{r=Hy.lstatSync(t);}catch{return "file"}return r&&r.isDirectory()?"dir":"file"}Uy.exports={symlinkType:dO,symlinkTypeSync:gO};});var Qy=R((dN,Xy)=>{var yO=Xe().fromCallback,Gy=z("path"),At=Tr(),Ky=Et(),mO=Ky.mkdirs,vO=Ky.mkdirsSync,Vy=By(),wO=Vy.symlinkPaths,SO=Vy.symlinkPathsSync,Yy=Wy(),bO=Yy.symlinkType,EO=Yy.symlinkTypeSync,AO=ur().pathExists,{areIdentical:Jy}=$r();function _O(t,e,r,n){n=typeof r=="function"?r:n,r=typeof r=="function"?!1:r,At.lstat(e,(s,i)=>{!s&&i.isSymbolicLink()?Promise.all([At.stat(t),At.stat(e)]).then(([o,l])=>{if(Jy(o,l))return n(null);zy(t,e,r,n);}):zy(t,e,r,n);});}function zy(t,e,r,n){wO(t,e,(s,i)=>{if(s)return n(s);t=i.toDst,bO(i.toCwd,r,(o,l)=>{if(o)return n(o);let c=Gy.dirname(e);AO(c,(p,u)=>{if(p)return n(p);if(u)return At.symlink(t,e,l,n);mO(c,g=>{if(g)return n(g);At.symlink(t,e,l,n);});});});});}function xO(t,e,r){let n;try{n=At.lstatSync(e);}catch{}if(n&&n.isSymbolicLink()){let l=At.statSync(t),c=At.statSync(e);if(Jy(l,c))return}let s=SO(t,e);t=s.toDst,r=EO(s.toCwd,r);let i=Gy.dirname(e);return At.existsSync(i)||vO(i),At.symlinkSync(t,e,r)}Xy.exports={createSymlink:yO(_O),createSymlinkSync:xO};});var om=R((gN,sm)=>{var{createFile:Zy,createFileSync:em}=Ly(),{createLink:tm,createLinkSync:rm}=My(),{createSymlink:nm,createSymlinkSync:im}=Qy();sm.exports={createFile:Zy,createFileSync:em,ensureFile:Zy,ensureFileSync:em,createLink:tm,createLinkSync:rm,ensureLink:tm,ensureLinkSync:rm,createSymlink:nm,createSymlinkSync:im,ensureSymlink:nm,ensureSymlinkSync:im};});var $s=R((yN,am)=>{function CO(t,{EOL:e=` +`,finalEOL:r=!0,replacer:n=null,spaces:s}={}){let i=r?e:"";return JSON.stringify(t,n,s).replace(/\n/g,e)+i}function RO(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}am.exports={stringify:CO,stripBom:RO};});var fm=R((mN,cm)=>{var fn;try{fn=Qe();}catch{fn=z("fs");}var Is=Xe(),{stringify:lm,stripBom:um}=$s();async function OO(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||fn,n="throws"in e?e.throws:!0,s=await Is.fromCallback(r.readFile)(t,e);s=um(s);let i;try{i=JSON.parse(s,e?e.reviver:null);}catch(o){if(n)throw o.message=`${t}: ${o.message}`,o;return null}return i}var PO=Is.fromPromise(OO);function TO(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||fn,n="throws"in e?e.throws:!0;try{let s=r.readFileSync(t,e);return s=um(s),JSON.parse(s,e.reviver)}catch(s){if(n)throw s.message=`${t}: ${s.message}`,s;return null}}async function $O(t,e,r={}){let n=r.fs||fn,s=lm(e,r);await Is.fromCallback(n.writeFile)(t,s,r);}var IO=Is.fromPromise($O);function kO(t,e,r={}){let n=r.fs||fn,s=lm(e,r);return n.writeFileSync(t,s,r)}var LO={readFile:PO,readFileSync:TO,writeFile:IO,writeFileSync:kO};cm.exports=LO;});var pm=R((vN,hm)=>{var ks=fm();hm.exports={readJson:ks.readFile,readJsonSync:ks.readFileSync,writeJson:ks.writeFile,writeJsonSync:ks.writeFileSync};});var Ls=R((wN,ym)=>{var FO=Xe().fromCallback,ii=Qe(),dm=z("path"),gm=Et(),qO=ur().pathExists;function DO(t,e,r,n){typeof r=="function"&&(n=r,r="utf8");let s=dm.dirname(t);qO(s,(i,o)=>{if(i)return n(i);if(o)return ii.writeFile(t,e,r,n);gm.mkdirs(s,l=>{if(l)return n(l);ii.writeFile(t,e,r,n);});});}function NO(t,...e){let r=dm.dirname(t);if(ii.existsSync(r))return ii.writeFileSync(t,...e);gm.mkdirsSync(r),ii.writeFileSync(t,...e);}ym.exports={outputFile:FO(DO),outputFileSync:NO};});var vm=R((SN,mm)=>{var{stringify:MO}=$s(),{outputFile:jO}=Ls();async function BO(t,e,r={}){let n=MO(e,r);await jO(t,n,r);}mm.exports=BO;});var Sm=R((bN,wm)=>{var{stringify:HO}=$s(),{outputFileSync:UO}=Ls();function WO(t,e,r){let n=HO(e,r);UO(t,n,r);}wm.exports=WO;});var Em=R((EN,bm)=>{var zO=Xe().fromPromise,Ye=pm();Ye.outputJson=zO(vm());Ye.outputJsonSync=Sm();Ye.outputJSON=Ye.outputJson;Ye.outputJSONSync=Ye.outputJsonSync;Ye.writeJSON=Ye.writeJson;Ye.writeJSONSync=Ye.writeJsonSync;Ye.readJSON=Ye.readJson;Ye.readJSONSync=Ye.readJsonSync;bm.exports=Ye;});var Rm=R((AN,Cm)=>{var GO=Qe(),Sl=z("path"),KO=Ts().copy,xm=ri().remove,VO=Et().mkdirp,YO=ur().pathExists,Am=$r();function JO(t,e,r,n){typeof r=="function"&&(n=r,r={}),r=r||{};let s=r.overwrite||r.clobber||!1;Am.checkPaths(t,e,"move",r,(i,o)=>{if(i)return n(i);let{srcStat:l,isChangingCase:c=!1}=o;Am.checkParentPaths(t,l,e,"move",p=>{if(p)return n(p);if(XO(e))return _m(t,e,s,c,n);VO(Sl.dirname(e),u=>u?n(u):_m(t,e,s,c,n));});});}function XO(t){let e=Sl.dirname(t);return Sl.parse(e).root===e}function _m(t,e,r,n,s){if(n)return wl(t,e,r,s);if(r)return xm(e,i=>i?s(i):wl(t,e,r,s));YO(e,(i,o)=>i?s(i):o?s(new Error("dest already exists.")):wl(t,e,r,s));}function wl(t,e,r,n){GO.rename(t,e,s=>s?s.code!=="EXDEV"?n(s):QO(t,e,r,n):n());}function QO(t,e,r,n){KO(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0},i=>i?n(i):xm(t,n));}Cm.exports=JO;});var Im=R((_N,$m)=>{var Pm=Qe(),El=z("path"),ZO=Ts().copySync,Tm=ri().removeSync,eP=Et().mkdirpSync,Om=$r();function tP(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:s,isChangingCase:i=!1}=Om.checkPathsSync(t,e,"move",r);return Om.checkParentPathsSync(t,s,e,"move"),rP(e)||eP(El.dirname(e)),nP(t,e,n,i)}function rP(t){let e=El.dirname(t);return El.parse(e).root===e}function nP(t,e,r,n){if(n)return bl(t,e,r);if(r)return Tm(e),bl(t,e,r);if(Pm.existsSync(e))throw new Error("dest already exists.");return bl(t,e,r)}function bl(t,e,r){try{Pm.renameSync(t,e);}catch(n){if(n.code!=="EXDEV")throw n;return iP(t,e,r)}}function iP(t,e,r){return ZO(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),Tm(t)}$m.exports=tP;});var Lm=R((xN,km)=>{var sP=Xe().fromCallback;km.exports={move:sP(Rm()),moveSync:Im()};});var Al=R((CN,Fm)=>{Fm.exports={...Tr(),...Ts(),...Ty(),...om(),...Em(),...Et(),...Lm(),...Ls(),...ur(),...ri()};});var xl=R((PN,Nm)=>{var si=t=>t&&typeof t.message=="string",_l=t=>{if(!t)return;let e=t.cause;if(typeof e=="function"){let r=t.cause();return si(r)?r:void 0}else return si(e)?e:void 0},qm=(t,e)=>{if(!si(t))return "";let r=t.stack||"";if(e.has(t))return r+` +causes have become circular...`;let n=_l(t);return n?(e.add(t),r+` +caused by: `+qm(n,e)):r},oP=t=>qm(t,new Set),Dm=(t,e,r)=>{if(!si(t))return "";let n=r?"":t.message||"";if(e.has(t))return n+": ...";let s=_l(t);if(s){e.add(t);let i=typeof t.cause=="function";return n+(i?"":": ")+Dm(s,e,i)}else return n},aP=t=>Dm(t,new Set);Nm.exports={isErrorLike:si,getErrorCause:_l,stackWithCauses:oP,messageWithCauses:aP};});var Cl=R((TN,jm)=>{var lP=Symbol("circular-ref-tag"),qs=Symbol("pino-raw-err-ref"),Mm=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[qs]},set:function(t){this[qs]=t;}}});Object.defineProperty(Mm,qs,{writable:!0,value:{}});jm.exports={pinoErrProto:Mm,pinoErrorSymbols:{seen:lP,rawSymbol:qs}};});var Um=R(($N,Hm)=>{Hm.exports=Ol;var{messageWithCauses:uP,stackWithCauses:cP,isErrorLike:Bm}=xl(),{pinoErrProto:fP,pinoErrorSymbols:hP}=Cl(),{seen:Rl}=hP,{toString:pP}=Object.prototype;function Ol(t){if(!Bm(t))return t;t[Rl]=void 0;let e=Object.create(fP);e.type=pP.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=uP(t),e.stack=cP(t),Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>Ol(r)));for(let r in t)if(e[r]===void 0){let n=t[r];Bm(n)?r!=="cause"&&!Object.prototype.hasOwnProperty.call(n,Rl)&&(e[r]=Ol(n)):e[r]=n;}return delete t[Rl],e.raw=t,e}});var zm=R((IN,Wm)=>{Wm.exports=Ns;var{isErrorLike:Pl}=xl(),{pinoErrProto:dP,pinoErrorSymbols:gP}=Cl(),{seen:Ds}=gP,{toString:yP}=Object.prototype;function Ns(t){if(!Pl(t))return t;t[Ds]=void 0;let e=Object.create(dP);e.type=yP.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=t.message,e.stack=t.stack,Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>Ns(r))),Pl(t.cause)&&!Object.prototype.hasOwnProperty.call(t.cause,Ds)&&(e.cause=Ns(t.cause));for(let r in t)if(e[r]===void 0){let n=t[r];Pl(n)?Object.prototype.hasOwnProperty.call(n,Ds)||(e[r]=Ns(n)):e[r]=n;}return delete t[Ds],e.raw=t,e}});var Ym=R((kN,Vm)=>{Vm.exports={mapHttpRequest:mP,reqSerializer:Km};var Tl=Symbol("pino-raw-req-ref"),Gm=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Tl]},set:function(t){this[Tl]=t;}}});Object.defineProperty(Gm,Tl,{writable:!0,value:{}});function Km(t){let e=t.info||t.socket,r=Object.create(Gm);if(r.id=typeof t.id=="function"?t.id():t.id||(t.info?t.info.id:void 0),r.method=t.method,t.originalUrl)r.url=t.originalUrl;else {let n=t.path;r.url=typeof n=="string"?n:t.url?t.url.path||t.url:void 0;}return t.query&&(r.query=t.query),t.params&&(r.params=t.params),r.headers=t.headers,r.remoteAddress=e&&e.remoteAddress,r.remotePort=e&&e.remotePort,r.raw=t.raw||t,r}function mP(t){return {req:Km(t)}}});var Zm=R((LN,Qm)=>{Qm.exports={mapHttpResponse:vP,resSerializer:Xm};var $l=Symbol("pino-raw-res-ref"),Jm=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[$l]},set:function(t){this[$l]=t;}}});Object.defineProperty(Jm,$l,{writable:!0,value:{}});function Xm(t){let e=Object.create(Jm);return e.statusCode=t.headersSent?t.statusCode:null,e.headers=t.getHeaders?t.getHeaders():t._headers,e.raw=t,e}function vP(t){return {res:Xm(t)}}});var kl=R((FN,ev)=>{var Il=Um(),wP=zm(),Ms=Ym(),js=Zm();ev.exports={err:Il,errWithCause:wP,mapHttpRequest:Ms.mapHttpRequest,mapHttpResponse:js.mapHttpResponse,req:Ms.reqSerializer,res:js.resSerializer,wrapErrorSerializer:function(e){return e===Il?e:function(n){return e(Il(n))}},wrapRequestSerializer:function(e){return e===Ms.reqSerializer?e:function(n){return e(Ms.reqSerializer(n))}},wrapResponseSerializer:function(e){return e===js.resSerializer?e:function(n){return e(js.resSerializer(n))}}};});var Ll=R((qN,tv)=>{function SP(t,e){return e}tv.exports=function(){let e=Error.prepareStackTrace;Error.prepareStackTrace=SP;let r=new Error().stack;if(Error.prepareStackTrace=e,!Array.isArray(r))return;let n=r.slice(2),s=[];for(let i of n)i&&s.push(i.getFileName());return s};});var nv=R((DN,rv)=>{rv.exports=bP;function bP(t={}){let{ERR_PATHS_MUST_BE_STRINGS:e=()=>"fast-redact - Paths must be (non-empty) strings",ERR_INVALID_PATH:r=n=>`fast-redact \u2013 Invalid path (${n})`}=t;return function({paths:s}){s.forEach(i=>{if(typeof i!="string")throw Error(e());try{if(/〇/.test(i))throw Error();let o=(i[0]==="["?"":".")+i.replace(/^\*/,"\u3007").replace(/\.\*/g,".\u3007").replace(/\[\*\]/g,"[\u3007]");if(/\n|\r|;/.test(o)||/\/\*/.test(o))throw Error();Function(` 'use strict' const o = new Proxy({}, { get: () => o, set: () => { throw Error() } }); const \u3007 = null; o${o} - if ([o${o}].length !== 1) throw Error()`)();}catch{throw Error(r(i))}});}}});var eo=_((w2,Ow)=>{Ow.exports=/[^.[\]]+|\[((?:.)*?)\]/g;});var Pw=_((v2,Tw)=>{var ST=eo();Tw.exports=bT;function bT({paths:t}){let e=[];var r=0;let n=t.reduce(function(s,i,o){var u=i.match(ST).map(l=>l.replace(/'|"|`/g,""));let c=i[0]==="[";u=u.map(l=>l[0]==="["?l.substr(1,l.length-2):l);let p=u.indexOf("*");if(p>-1){let l=u.slice(0,p),d=l.join("."),g=u.slice(p+1,u.length),m=g.length>0;r++,e.push({before:l,beforeStr:d,after:g,nested:m});}else s[i]={path:u,val:void 0,precensored:!1,circle:"",escPath:JSON.stringify(i),leadingBracket:c};return s},{});return {wildcards:e,wcLen:r,secret:n}}});var $w=_((S2,Iw)=>{var ET=eo();Iw.exports=xT;function xT({secret:t,serialize:e,wcLen:r,strict:n,isCensorFct:s,censorFctTakesPath:i},o){let u=Function("o",` + if ([o${o}].length !== 1) throw Error()`)();}catch{throw Error(r(i))}});}}});var Bs=R((NN,iv)=>{iv.exports=/[^.[\]]+|\[((?:.)*?)\]/g;});var ov=R((MN,sv)=>{var EP=Bs();sv.exports=AP;function AP({paths:t}){let e=[];var r=0;let n=t.reduce(function(s,i,o){var l=i.match(EP).map(u=>u.replace(/'|"|`/g,""));let c=i[0]==="[";l=l.map(u=>u[0]==="["?u.substr(1,u.length-2):u);let p=l.indexOf("*");if(p>-1){let u=l.slice(0,p),g=u.join("."),y=l.slice(p+1,l.length),m=y.length>0;r++,e.push({before:u,beforeStr:g,after:y,nested:m});}else s[i]={path:l,val:void 0,precensored:!1,circle:"",escPath:JSON.stringify(i),leadingBracket:c};return s},{});return {wildcards:e,wcLen:r,secret:n}}});var lv=R((jN,av)=>{var _P=Bs();av.exports=xP;function xP({secret:t,serialize:e,wcLen:r,strict:n,isCensorFct:s,censorFctTakesPath:i},o){let l=Function("o",` if (typeof o !== 'object' || o == null) { - ${RT(n,e)} + ${PP(n,e)} } const { censor, secret } = this - ${AT(t,s,i)} + ${CP(t,s,i)} this.compileRestore() - ${_T(r>0,s,i)} - ${CT(e)} - `).bind(o);return e===!1&&(u.restore=c=>o.restore(c)),u}function AT(t,e,r){return Object.keys(t).map(n=>{let{escPath:s,leadingBracket:i,path:o}=t[n],u=i?1:0,c=i?"":".",p=[];for(var l;(l=ET.exec(n))!==null;){let[,w]=l,{index:E,input:A}=l;E>u&&p.push(A.substring(0,E-(w?0:1)));}var d=p.map(w=>`o${c}${w}`).join(" && ");d.length===0?d+=`o${c}${n} != null`:d+=` && o${c}${n} != null`;let g=` + ${RP(r>0,s,i)} + ${OP(e)} + `).bind(o);return e===!1&&(l.restore=c=>o.restore(c)),l}function CP(t,e,r){return Object.keys(t).map(n=>{let{escPath:s,leadingBracket:i,path:o}=t[n],l=i?1:0,c=i?"":".",p=[];for(var u;(u=_P.exec(n))!==null;){let[,v]=u,{index:b,input:_}=u;b>l&&p.push(_.substring(0,b-(v?0:1)));}var g=p.map(v=>`o${c}${v}`).join(" && ");g.length===0?g+=`o${c}${n} != null`:g+=` && o${c}${n} != null`;let y=` switch (true) { - ${p.reverse().map(w=>` - case o${c}${w} === censor: - secret[${s}].circle = ${JSON.stringify(w)} + ${p.reverse().map(v=>` + case o${c}${v} === censor: + secret[${s}].circle = ${JSON.stringify(v)} break `).join(` `)} } `,m=r?`val, ${JSON.stringify(o)}`:"val";return ` - if (${d}) { + if (${g}) { const val = o${c}${n} if (val === censor) { secret[${s}].precensored = true } else { secret[${s}].val = val o${c}${n} = ${e?`censor(${m})`:"censor"} - ${g} + ${y} } } `}).join(` -`)}function _T(t,e,r){return t===!0?` +`)}function RP(t,e,r){return t===!0?` { const { wildcards, wcLen, groupRedact, nestedRedact } = this for (var i = 0; i < wcLen; i++) { @@ -72,16 +72,16 @@ caused by: `+ow(n,e)):r},iT=t=>ow(t,new Set),aw=(t,e,r)=>{if(!mi(t))return "";le } else secret[beforeStr] = groupRedact(o, before, censor, ${e}, ${r}) } } - `:""}function CT(t){return t===!1?"return o":` + `:""}function OP(t){return t===!1?"return o":` var s = this.serialize(o) this.restore(o) return s - `}function RT(t,e){return t===!0?"throw Error('fast-redact: primitives cannot be redacted')":e===!1?"return o":"return this.serialize(o)"}});var Qu=_((b2,Lw)=>{Lw.exports={groupRedact:TT,groupRestore:OT,nestedRedact:IT,nestedRestore:PT};function OT({keys:t,values:e,target:r}){if(r==null)return;let n=t.length;for(var s=0;s0;o--)i=i[n[o]];i[n[0]]=s;}}function IT(t,e,r,n,s,i,o){let u=Fw(e,r);if(u==null)return;let c=Object.keys(u),p=c.length;for(var l=0;l{var{groupRestore:kT,nestedRestore:LT}=Qu();qw.exports=qT;function qT({secret:t,wcLen:e}){return function(){if(this.restore)return;let n=Object.keys(t),s=BT(t,n),i=e>0,o=i?{secret:t,groupRestore:kT,nestedRestore:LT}:{secret:t};this.restore=Function("o",DT(s,n,i)).bind(o);}}function BT(t,e){return e.map(r=>{let{circle:n,escPath:s,leadingBracket:i}=t[r],u=n?`o.${n} = secret[${s}].val`:`o${i?"":"."}${r} = secret[${s}].val`,c=`secret[${s}].val = undefined`;return ` + `}function PP(t,e){return t===!0?"throw Error('fast-redact: primitives cannot be redacted')":e===!1?"return o":"return this.serialize(o)"}});var ql=R((BN,fv)=>{fv.exports={groupRedact:$P,groupRestore:TP,nestedRedact:kP,nestedRestore:IP};function TP({keys:t,values:e,target:r}){if(r==null)return;let n=t.length;for(var s=0;s0;o--)i=i[n[o]];i[n[0]]=s;}}function kP(t,e,r,n,s,i,o){let l=uv(e,r);if(l==null)return;let c=Object.keys(l),p=c.length;for(var u=0;u{var{groupRestore:qP,nestedRestore:DP}=ql();hv.exports=NP;function NP({secret:t,wcLen:e}){return function(){if(this.restore)return;let n=Object.keys(t),s=MP(t,n),i=e>0,o=i?{secret:t,groupRestore:qP,nestedRestore:DP}:{secret:t};this.restore=Function("o",jP(s,n,i)).bind(o);}}function MP(t,e){return e.map(r=>{let{circle:n,escPath:s,leadingBracket:i}=t[r],l=n?`o.${n} = secret[${s}].val`:`o${i?"":"."}${r} = secret[${s}].val`,c=`secret[${s}].val = undefined`;return ` if (secret[${s}].val !== undefined) { - try { ${u} } catch (e) {} + try { ${l} } catch (e) {} ${c} } - `}).join("")}function DT(t,e,r){return ` + `}).join("")}function jP(t,e,r){return ` const secret = this.secret ${r===!0?` const keys = Object.keys(secret) @@ -96,38 +96,39 @@ caused by: `+ow(n,e)):r},iT=t=>ow(t,new Set),aw=(t,e,r)=>{if(!mi(t))return "";le `:""} ${t} return o - `}});var Nw=_((x2,Dw)=>{Dw.exports=NT;function NT(t){let{secret:e,censor:r,compileRestore:n,serialize:s,groupRedact:i,nestedRedact:o,wildcards:u,wcLen:c}=t,p=[{secret:e,censor:r,compileRestore:n}];return s!==!1&&p.push({serialize:s}),c>0&&p.push({groupRedact:i,nestedRedact:o,wildcards:u,wcLen:c}),Object.assign(...p)}});var jw=_((A2,Uw)=>{var Mw=Rw(),MT=Pw(),UT=$w(),jT=Bw(),{groupRedact:HT,nestedRedact:WT}=Qu(),zT=Nw(),GT=eo(),VT=Mw(),Zu=t=>t;Zu.restore=Zu;var KT="[REDACTED]";el.rx=GT;el.validator=Mw;Uw.exports=el;function el(t={}){let e=Array.from(new Set(t.paths||[])),r="serialize"in t&&(t.serialize===!1||typeof t.serialize=="function")?t.serialize:JSON.stringify,n=t.remove;if(n===!0&&r!==JSON.stringify)throw Error("fast-redact \u2013 remove option may only be set when serializer is JSON.stringify");let s=n===!0?void 0:"censor"in t?t.censor:KT,i=typeof s=="function",o=i&&s.length>1;if(e.length===0)return r||Zu;VT({paths:e,serialize:r,censor:s});let{wildcards:u,wcLen:c,secret:p}=MT({paths:e,censor:s}),l=jT({secret:p,wcLen:c}),d="strict"in t?t.strict:!0;return UT({secret:p,wcLen:c,serialize:r,strict:d,isCensorFct:i,censorFctTakesPath:o},zT({secret:p,censor:s,compileRestore:l,serialize:r,groupRedact:HT,nestedRedact:WT,wildcards:u,wcLen:c}))}});var bn=_((_2,Hw)=>{var YT=Symbol("pino.setLevel"),JT=Symbol("pino.getLevel"),XT=Symbol("pino.levelVal"),QT=Symbol("pino.useLevelLabels"),ZT=Symbol("pino.useOnlyCustomLevels"),eP=Symbol("pino.mixin"),tP=Symbol("pino.lsCache"),rP=Symbol("pino.chindings"),nP=Symbol("pino.asJson"),iP=Symbol("pino.write"),sP=Symbol("pino.redactFmt"),oP=Symbol("pino.time"),aP=Symbol("pino.timeSliceIndex"),uP=Symbol("pino.stream"),lP=Symbol("pino.stringify"),cP=Symbol("pino.stringifySafe"),fP=Symbol("pino.stringifiers"),hP=Symbol("pino.end"),pP=Symbol("pino.formatOpts"),dP=Symbol("pino.messageKey"),yP=Symbol("pino.errorKey"),gP=Symbol("pino.nestedKey"),mP=Symbol("pino.nestedKeyStr"),wP=Symbol("pino.mixinMergeStrategy"),vP=Symbol("pino.msgPrefix"),SP=Symbol("pino.wildcardFirst"),bP=Symbol.for("pino.serializers"),EP=Symbol.for("pino.formatters"),xP=Symbol.for("pino.hooks"),AP=Symbol.for("pino.metadata");Hw.exports={setLevelSym:YT,getLevelSym:JT,levelValSym:XT,useLevelLabelsSym:QT,mixinSym:eP,lsCacheSym:tP,chindingsSym:rP,asJsonSym:nP,writeSym:iP,serializersSym:bP,redactFmtSym:sP,timeSym:oP,timeSliceIndexSym:aP,streamSym:uP,stringifySym:lP,stringifySafeSym:cP,stringifiersSym:fP,endSym:hP,formatOptsSym:pP,messageKeySym:dP,errorKeySym:yP,nestedKeySym:gP,wildcardFirstSym:SP,needsMetadataGsym:AP,useOnlyCustomLevelsSym:ZT,formattersSym:EP,hooksSym:xP,nestedKeyStrSym:mP,mixinMergeStrategySym:wP,msgPrefixSym:vP};});var nl=_((C2,Vw)=>{var rl=jw(),{redactFmtSym:_P,wildcardFirstSym:to}=bn(),{rx:tl,validator:CP}=rl,Ww=CP({ERR_PATHS_MUST_BE_STRINGS:()=>"pino \u2013 redacted paths must be strings",ERR_INVALID_PATH:t=>`pino \u2013 redact paths array contains an invalid path (${t})`}),zw="[Redacted]",Gw=!1;function RP(t,e){let{paths:r,censor:n}=OP(t),s=r.reduce((u,c)=>{tl.lastIndex=0;let p=tl.exec(c),l=tl.exec(c),d=p[1]!==void 0?p[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):p[0];if(d==="*"&&(d=to),l===null)return u[d]=null,u;if(u[d]===null)return u;let{index:g}=l,m=`${c.substr(g,c.length-1)}`;return u[d]=u[d]||[],d!==to&&u[d].length===0&&u[d].push(...u[to]||[]),d===to&&Object.keys(u).forEach(function(w){u[w]&&u[w].push(m);}),u[d].push(m),u},{}),i={[_P]:rl({paths:r,censor:n,serialize:e,strict:Gw})},o=(...u)=>e(typeof n=="function"?n(...u):n);return [...Object.keys(s),...Object.getOwnPropertySymbols(s)].reduce((u,c)=>{if(s[c]===null)u[c]=p=>o(p,[c]);else {let p=typeof n=="function"?(l,d)=>n(l,[c,...d]):n;u[c]=rl({paths:s[c],censor:p,serialize:e,strict:Gw});}return u},i)}function OP(t){if(Array.isArray(t))return t={paths:t,censor:zw},Ww(t),t;let{paths:e,censor:r=zw,remove:n}=t;if(Array.isArray(e)===!1)throw Error("pino \u2013 redact must contain an array of strings");return n===!0&&(r=void 0),Ww({paths:e,censor:r}),{paths:e,censor:r}}Vw.exports=RP;});var Yw=_((R2,Kw)=>{var TP=()=>"",PP=()=>`,"time":${Date.now()}`,IP=()=>`,"time":${Math.round(Date.now()/1e3)}`,$P=()=>`,"time":"${new Date(Date.now()).toISOString()}"`;Kw.exports={nullTime:TP,epochTime:PP,unixTime:IP,isoTime:$P};});var Xw=_((O2,Jw)=>{function FP(t){try{return JSON.stringify(t)}catch{return '"[Circular]"'}}Jw.exports=kP;function kP(t,e,r){var n=r&&r.stringify||FP,s=1;if(typeof t=="object"&&t!==null){var i=e.length+s;if(i===1)return t;var o=new Array(i);o[0]=n(t);for(var u=1;u-1?d:0,t.charCodeAt(m+1)){case 100:case 102:if(l>=c||e[l]==null)break;d=c||e[l]==null)break;d=c||e[l]===void 0)break;d",d=m+2,m++;break}p+=n(e[l]),d=m+2,m++;break;case 115:if(l>=c)break;d{if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let e=function(r){if((r>0&&r<1/0)===!1)throw typeof r!="number"&&typeof r!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(t,0,0,Number(r));},t=new Int32Array(new SharedArrayBuffer(4));il.exports=e;}else {let t=function(e){if((e>0&&e<1/0)===!1)throw typeof e!="number"&&typeof e!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");};il.exports=t;}});var r0=_((P2,t0)=>{var rt=G("fs"),LP=G("events"),qP=G("util").inherits,Qw=G("path"),Zw=sl(),ol=100,BP=16*1024;function e0(t,e){e._opening=!0,e._writing=!0,e._asyncDrainScheduled=!1;function r(i,o){if(i){e._reopening=!1,e._writing=!1,e._opening=!1,e.sync?process.nextTick(()=>{e.listenerCount("error")>0&&e.emit("error",i);}):e.emit("error",i);return}e.fd=o,e.file=t,e._reopening=!1,e._opening=!1,e._writing=!1,e.sync?process.nextTick(()=>e.emit("ready")):e.emit("ready"),!e._reopening&&!e._writing&&e._len>e.minLength&&!e.destroyed&&En(e);}let n=e.append?"a":"w",s=e.mode;if(e.sync)try{e.mkdir&&rt.mkdirSync(Qw.dirname(t),{recursive:!0});let i=rt.openSync(t,n,s);r(null,i);}catch(i){throw r(i),i}else e.mkdir?rt.mkdir(Qw.dirname(t),{recursive:!0},i=>{if(i)return r(i);rt.open(t,n,s,r);}):rt.open(t,n,s,r);}function nt(t){if(!(this instanceof nt))return new nt(t);let{fd:e,dest:r,minLength:n,maxLength:s,maxWrite:i,sync:o,append:u=!0,mode:c,mkdir:p,retryEAGAIN:l,fsync:d}=t||{};if(e=e||r,this._bufs=[],this._len=0,this.fd=-1,this._writing=!1,this._writingBuf="",this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._hwm=Math.max(n||0,16387),this.file=null,this.destroyed=!1,this.minLength=n||0,this.maxLength=s||0,this.maxWrite=i||BP,this.sync=o||!1,this._fsync=d||!1,this.append=u||!1,this.mode=c,this.retryEAGAIN=l||(()=>!0),this.mkdir=p||!1,typeof e=="number")this.fd=e,process.nextTick(()=>this.emit("ready"));else if(typeof e=="string")e0(e,this);else throw new Error("SonicBoom supports only file descriptors and files");if(this.minLength>=this.maxWrite)throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(g,m)=>{if(g){if((g.code==="EAGAIN"||g.code==="EBUSY")&&this.retryEAGAIN(g,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{Zw(ol),this.release(void 0,0);}catch(E){this.release(E);}else setTimeout(()=>{rt.write(this.fd,this._writingBuf,"utf8",this.release);},ol);else this._writing=!1,this.emit("error",g);return}if(this.emit("write",m),this._len-=m,this._len<0&&(this._len=0),this._writingBuf=this._writingBuf.slice(m),this._writingBuf.length){if(!this.sync){rt.write(this.fd,this._writingBuf,"utf8",this.release);return}try{do{let E=rt.writeSync(this.fd,this._writingBuf,"utf8");this._len-=E,this._writingBuf=this._writingBuf.slice(E);}while(this._writingBuf)}catch(E){this.release(E);return}}this._fsync&&rt.fsyncSync(this.fd);let w=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):w>this.minLength?En(this):this._ending?w>0?En(this):(this._writing=!1,ro(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(DP,this)):this.emit("drain"));},this.on("newListener",function(g){g==="drain"&&(this._asyncDrainScheduled=!1);});}function DP(t){t.listenerCount("drain")>0&&(t._asyncDrainScheduled=!1,t.emit("drain"));}qP(nt,LP);nt.prototype.write=function(t){if(this.destroyed)throw new Error("SonicBoom destroyed");let e=this._len+t.length,r=this._bufs;return this.maxLength&&e>this.maxLength?(this.emit("drop",t),this._lenthis.maxWrite?r.push(""+t):r[r.length-1]+=t,this._len=e,!this._writing&&this._len>=this.minLength&&En(this),this._len{this.reopen(t);});return}if(this._ending)return;if(!this.file)throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");if(this._reopening=!0,this._writing)return;let e=this.fd;this.once("ready",()=>{e!==this.fd&&rt.close(e,r=>{if(r)return this.emit("error",r)});}),e0(t||this.file,this);};nt.prototype.end=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.end();});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?En(this):ro(this)));};nt.prototype.flushSync=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");let t="";for(;this._bufs.length||t.length;){t.length<=0&&(t=this._bufs[0]);try{let e=rt.writeSync(this.fd,t,"utf8");t=t.slice(e),this._len=Math.max(this._len-e,0),t.length<=0&&this._bufs.shift();}catch(e){if((e.code==="EAGAIN"||e.code==="EBUSY")&&!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;Zw(ol);}}};nt.prototype.destroy=function(){this.destroyed||ro(this);};function En(t){let e=t.release;if(t._writing=!0,t._writingBuf=t._writingBuf||t._bufs.shift()||"",t.sync)try{let r=rt.writeSync(t.fd,t._writingBuf,"utf8");e(null,r);}catch(r){e(r);}else rt.write(t.fd,t._writingBuf,"utf8",e);}function ro(t){if(t.fd===-1){t.once("ready",ro.bind(null,t));return}t.destroyed=!0,t._bufs=[],t.fd!==1&&t.fd!==2?rt.close(t.fd,e):setImmediate(e);function e(r){if(r){t.emit("error",r);return}t._ending&&!t._writing&&t.emit("finish"),t.emit("close");}}nt.SonicBoom=nt;nt.default=nt;t0.exports=nt;});var al=_((I2,u0)=>{var br={exit:[],beforeExit:[]},n0={exit:MP,beforeExit:UP},i0=new FinalizationRegistry(jP);function NP(t){br[t].length>0||process.on(t,n0[t]);}function s0(t){br[t].length>0||process.removeListener(t,n0[t]);}function MP(){o0("exit");}function UP(){o0("beforeExit");}function o0(t){for(let e of br[t]){let r=e.deref(),n=e.fn;r!==void 0&&n(r,t);}}function jP(t){for(let e of ["exit","beforeExit"]){let r=br[e].indexOf(t);br[e].splice(r,r+1),s0(e);}}function a0(t,e,r){if(e===void 0)throw new Error("the object can't be undefined");NP(t);let n=new WeakRef(e);n.fn=r,i0.register(e,n),br[t].push(n);}function HP(t,e){a0("exit",t,e);}function WP(t,e){a0("beforeExit",t,e);}function zP(t){i0.unregister(t);for(let e of ["exit","beforeExit"])br[e]=br[e].filter(r=>{let n=r.deref();return n&&n!==t}),s0(e);}u0.exports={register:HP,registerBeforeExit:WP,unregister:zP};});var l0=_(($2,GP)=>{GP.exports={name:"thread-stream",version:"2.4.0",description:"A streaming way to send data to a Node.js Worker Thread",main:"index.js",types:"index.d.ts",dependencies:{"real-require":"^0.2.0"},devDependencies:{"@types/node":"^20.1.0","@types/tap":"^15.0.0",desm:"^1.3.0",fastbench:"^1.0.1",husky:"^8.0.1","pino-elasticsearch":"^6.0.0","sonic-boom":"^3.0.0",standard:"^17.0.0",tap:"^16.2.0","ts-node":"^10.8.0",typescript:"^4.7.2","why-is-node-running":"^2.2.2"},scripts:{test:"standard && npm run transpile && tap test/*.test.*js && tap --ts test/*.test.*ts","test:ci":"standard && npm run transpile && npm run test:ci:js && npm run test:ci:ts","test:ci:js":'tap --no-check-coverage --coverage-report=lcovonly "test/**/*.test.*js"',"test:ci:ts":'tap --ts --no-check-coverage --coverage-report=lcovonly "test/**/*.test.*ts"',"test:yarn":'npm run transpile && tap "test/**/*.test.js" --no-check-coverage',transpile:"sh ./test/ts/transpile.sh",prepare:"husky install"},standard:{ignore:["test/ts/**/*"]},repository:{type:"git",url:"git+https://github.com/mcollina/thread-stream.git"},keywords:["worker","thread","threads","stream"],author:"Matteo Collina ",license:"MIT",bugs:{url:"https://github.com/mcollina/thread-stream/issues"},homepage:"https://github.com/mcollina/thread-stream#readme"};});var f0=_((F2,c0)=>{function VP(t,e,r,n,s){let i=Date.now()+n,o=Atomics.load(t,e);if(o===r){s(null,"ok");return}let u=o,c=p=>{Date.now()>i?s(null,"timed-out"):setTimeout(()=>{u=o,o=Atomics.load(t,e),o===u?c(p>=1e3?1e3:p*2):o===r?s(null,"ok"):s(null,"not-equal");},p);};c(1);}function KP(t,e,r,n,s){let i=Date.now()+n,o=Atomics.load(t,e);if(o!==r){s(null,"ok");return}let u=c=>{Date.now()>i?s(null,"timed-out"):setTimeout(()=>{o=Atomics.load(t,e),o!==r?s(null,"ok"):u(c>=1e3?1e3:c*2);},c);};u(1);}c0.exports={wait:VP,waitDiff:KP};});var p0=_((k2,h0)=>{h0.exports={WRITE_INDEX:4,READ_INDEX:8};});var w0=_((q2,m0)=>{var{version:YP}=l0(),{EventEmitter:JP}=G("events"),{Worker:XP}=G("worker_threads"),{join:QP}=G("path"),{pathToFileURL:ZP}=G("url"),{wait:eI}=f0(),{WRITE_INDEX:it,READ_INDEX:Nt}=p0(),tI=G("buffer"),rI=G("assert"),D=Symbol("kImpl"),nI=tI.constants.MAX_STRING_LENGTH,io=class{constructor(e){this._value=e;}deref(){return this._value}},iI=global.FinalizationRegistry||class{register(){}unregister(){}},sI=global.WeakRef||io,d0=new iI(t=>{t.exited||t.terminate();});function oI(t,e){let{filename:r,workerData:n}=e,i=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||QP(__dirname,"lib","worker.js"),o=new XP(i,{...e.workerOpts,trackUnmanagedFds:!1,workerData:{filename:r.indexOf("file://")===0?r:ZP(r).href,dataBuf:t[D].dataBuf,stateBuf:t[D].stateBuf,workerData:{$context:{threadStreamVersion:YP},...n}}});return o.stream=new io(t),o.on("message",aI),o.on("exit",g0),d0.register(t,o),o}function y0(t){rI(!t[D].sync),t[D].needDrain&&(t[D].needDrain=!1,t.emit("drain"));}function no(t){let e=Atomics.load(t[D].state,it),r=t[D].data.length-e;if(r>0){if(t[D].buf.length===0){t[D].flushing=!1,t[D].ending?hl(t):t[D].needDrain&&process.nextTick(y0,t);return}let n=t[D].buf.slice(0,r),s=Buffer.byteLength(n);s<=r?(t[D].buf=t[D].buf.slice(r),so(t,n,no.bind(null,t))):t.flush(()=>{if(!t.destroyed){for(Atomics.store(t[D].state,Nt,0),Atomics.store(t[D].state,it,0);s>t[D].data.length;)r=r/2,n=t[D].buf.slice(0,r),s=Buffer.byteLength(n);t[D].buf=t[D].buf.slice(r),so(t,n,no.bind(null,t));}});}else if(r===0){if(e===0&&t[D].buf.length===0)return;t.flush(()=>{Atomics.store(t[D].state,Nt,0),Atomics.store(t[D].state,it,0),no(t);});}else Mt(t,new Error("overwritten"));}function aI(t){let e=this.stream.deref();if(e===void 0){this.exited=!0,this.terminate();return}switch(t.code){case"READY":this.stream=new sI(e),e.flush(()=>{e[D].ready=!0,e.emit("ready");});break;case"ERROR":Mt(e,t.err);break;case"EVENT":Array.isArray(t.args)?e.emit(t.name,...t.args):e.emit(t.name,t.args);break;case"WARNING":process.emitWarning(t.err);break;default:Mt(e,new Error("this should not happen: "+t.code));}}function g0(t){let e=this.stream.deref();e!==void 0&&(d0.unregister(e),e.worker.exited=!0,e.worker.off("exit",g0),Mt(e,t!==0?new Error("the worker thread exited"):null));}var ll=class extends JP{constructor(e={}){if(super(),e.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[D]={},this[D].stateBuf=new SharedArrayBuffer(128),this[D].state=new Int32Array(this[D].stateBuf),this[D].dataBuf=new SharedArrayBuffer(e.bufferSize||4*1024*1024),this[D].data=Buffer.from(this[D].dataBuf),this[D].sync=e.sync||!1,this[D].ending=!1,this[D].ended=!1,this[D].needDrain=!1,this[D].destroyed=!1,this[D].flushing=!1,this[D].ready=!1,this[D].finished=!1,this[D].errored=null,this[D].closed=!1,this[D].buf="",this.worker=oI(this,e);}write(e){if(this[D].destroyed)return cl(this,new Error("the worker has exited")),!1;if(this[D].ending)return cl(this,new Error("the worker is ending")),!1;if(this[D].flushing&&this[D].buf.length+e.length>=nI)try{ul(this),this[D].flushing=!0;}catch(r){return Mt(this,r),!1}if(this[D].buf+=e,this[D].sync)try{return ul(this),!0}catch(r){return Mt(this,r),!1}return this[D].flushing||(this[D].flushing=!0,setImmediate(no,this)),this[D].needDrain=this[D].data.length-this[D].buf.length-Atomics.load(this[D].state,it)<=0,!this[D].needDrain}end(){this[D].destroyed||(this[D].ending=!0,hl(this));}flush(e){if(this[D].destroyed){typeof e=="function"&&process.nextTick(e,new Error("the worker has exited"));return}let r=Atomics.load(this[D].state,it);eI(this[D].state,Nt,r,1/0,(n,s)=>{if(n){Mt(this,n),process.nextTick(e,n);return}if(s==="not-equal"){this.flush(e);return}process.nextTick(e);});}flushSync(){this[D].destroyed||(ul(this),fl(this));}unref(){this.worker.unref();}ref(){this.worker.ref();}get ready(){return this[D].ready}get destroyed(){return this[D].destroyed}get closed(){return this[D].closed}get writable(){return !this[D].destroyed&&!this[D].ending}get writableEnded(){return this[D].ending}get writableFinished(){return this[D].finished}get writableNeedDrain(){return this[D].needDrain}get writableObjectMode(){return !1}get writableErrored(){return this[D].errored}};function cl(t,e){setImmediate(()=>{t.emit("error",e);});}function Mt(t,e){t[D].destroyed||(t[D].destroyed=!0,e&&(t[D].errored=e,cl(t,e)),t.worker.exited?setImmediate(()=>{t[D].closed=!0,t.emit("close");}):t.worker.terminate().catch(()=>{}).then(()=>{t[D].closed=!0,t.emit("close");}));}function so(t,e,r){let n=Atomics.load(t[D].state,it),s=Buffer.byteLength(e);return t[D].data.write(e,n),Atomics.store(t[D].state,it,n+s),Atomics.notify(t[D].state,it),r(),!0}function hl(t){if(!(t[D].ended||!t[D].ending||t[D].flushing)){t[D].ended=!0;try{t.flushSync();let e=Atomics.load(t[D].state,Nt);Atomics.store(t[D].state,it,-1),Atomics.notify(t[D].state,it);let r=0;for(;e!==-1;){if(Atomics.wait(t[D].state,Nt,e,1e3),e=Atomics.load(t[D].state,Nt),e===-2){Mt(t,new Error("end() failed"));return}if(++r===10){Mt(t,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{t[D].finished=!0,t.emit("finish");});}catch(e){Mt(t,e);}}}function ul(t){let e=()=>{t[D].ending?hl(t):t[D].needDrain&&process.nextTick(y0,t);};for(t[D].flushing=!1;t[D].buf.length!==0;){let r=Atomics.load(t[D].state,it),n=t[D].data.length-r;if(n===0){fl(t),Atomics.store(t[D].state,Nt,0),Atomics.store(t[D].state,it,0);continue}else if(n<0)throw new Error("overwritten");let s=t[D].buf.slice(0,n),i=Buffer.byteLength(s);if(i<=n)t[D].buf=t[D].buf.slice(n),so(t,s,e);else {for(fl(t),Atomics.store(t[D].state,Nt,0),Atomics.store(t[D].state,it,0);i>t[D].buf.length;)n=n/2,s=t[D].buf.slice(0,n),i=Buffer.byteLength(s);t[D].buf=t[D].buf.slice(n),so(t,s,e);}}}function fl(t){if(t[D].flushing)throw new Error("unable to flush while flushing");let e=Atomics.load(t[D].state,it),r=0;for(;;){let n=Atomics.load(t[D].state,Nt);if(n===-2)throw Error("_flushSync failed");if(n!==e)Atomics.wait(t[D].state,Nt,n,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}m0.exports=ll;});var yl=_((B2,v0)=>{var{createRequire:uI}=G("module"),lI=Ju(),{join:pl,isAbsolute:cI,sep:fI}=G("path"),hI=sl(),dl=al(),pI=w0();function dI(t){dl.register(t,gI),dl.registerBeforeExit(t,mI),t.on("close",function(){dl.unregister(t);});}function yI(t,e,r){let n=new pI({filename:t,workerData:e,workerOpts:r});n.on("ready",s),n.on("close",function(){process.removeListener("exit",i);}),process.on("exit",i);function s(){process.removeListener("exit",i),n.unref(),r.autoEnd!==!1&&dI(n);}function i(){n.closed||(n.flushSync(),hI(100),n.end());}return n}function gI(t){t.ref(),t.flushSync(),t.end(),t.once("close",function(){t.unref();});}function mI(t){t.flushSync();}function wI(t){let{pipeline:e,targets:r,levels:n,dedupe:s,options:i={},worker:o={},caller:u=lI()}=t,c=typeof u=="string"?[u]:u,p="__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{},l=t.target;if(l&&r)throw new Error("only one of target or targets can be specified");return r?(l=p["pino-worker"]||pl(__dirname,"worker.js"),i.targets=r.map(g=>({...g,target:d(g.target)}))):e&&(l=p["pino-pipeline-worker"]||pl(__dirname,"worker-pipeline.js"),i.targets=e.map(g=>({...g,target:d(g.target)}))),n&&(i.levels=n),s&&(i.dedupe=s),yI(d(l),i,o);function d(g){if(g=p[g]||g,cI(g)||g.indexOf("file://")===0)return g;if(g==="pino/file")return pl(__dirname,"..","file.js");let m;for(let w of c)try{let E=w==="node:repl"?process.cwd()+fI:w;m=uI(E).resolve(g);break}catch{continue}if(!m)throw new Error(`unable to determine transport target for "${g}"`);return m}}v0.exports=wI;});var uo=_((D2,P0)=>{var S0=Xw(),{mapHttpRequest:vI,mapHttpResponse:SI}=Yu(),ml=r0(),b0=al(),{lsCacheSym:bI,chindingsSym:A0,writeSym:E0,serializersSym:_0,formatOptsSym:x0,endSym:EI,stringifiersSym:C0,stringifySym:R0,stringifySafeSym:wl,wildcardFirstSym:O0,nestedKeySym:xI,formattersSym:T0,messageKeySym:AI,errorKeySym:_I,nestedKeyStrSym:CI,msgPrefixSym:oo}=bn(),{isMainThread:RI}=G("worker_threads"),OI=yl();function xn(){}function TI(t,e){if(!e)return r;return function(...s){e.call(this,s,r,t);};function r(n,...s){if(typeof n=="object"){let i=n;n!==null&&(n.method&&n.headers&&n.socket?n=vI(n):typeof n.setHeader=="function"&&(n=SI(n)));let o;i===null&&s.length===0?o=[null]:(i=s.shift(),o=s),typeof this[oo]=="string"&&i!==void 0&&i!==null&&(i=this[oo]+i),this[E0](n,S0(i,o,this[x0]),t);}else {let i=n===void 0?s.shift():n;typeof this[oo]=="string"&&i!==void 0&&i!==null&&(i=this[oo]+i),this[E0](null,S0(i,s,this[x0]),t);}}}function gl(t){let e="",r=0,n=!1,s=255,i=t.length;if(i>100)return JSON.stringify(t);for(var o=0;o=32;o++)s=t.charCodeAt(o),(s===34||s===92)&&(e+=t.slice(r,o)+"\\",r=o,n=!0);return n?e+=t.slice(r):e=t,s<32?JSON.stringify(t):'"'+e+'"'}function PI(t,e,r,n){let s=this[R0],i=this[wl],o=this[C0],u=this[EI],c=this[A0],p=this[_0],l=this[T0],d=this[AI],g=this[_I],m=this[bI][r]+n;m=m+c;let w;l.log&&(t=l.log(t));let E=o[O0],A="";for(let x in t)if(w=t[x],Object.prototype.hasOwnProperty.call(t,x)&&w!==void 0){p[x]?w=p[x](w):x===g&&p.err&&(w=p.err(w));let O=o[x]||E;switch(typeof w){case"undefined":case"function":continue;case"number":Number.isFinite(w)===!1&&(w=null);case"boolean":O&&(w=O(w));break;case"string":w=(O||gl)(w);break;default:w=(O||s)(w,i);}if(w===void 0)continue;let F=gl(x);A+=","+F+":"+w;}let R="";if(e!==void 0){w=p[d]?p[d](e):e;let x=o[d]||E;switch(typeof w){case"function":break;case"number":Number.isFinite(w)===!1&&(w=null);case"boolean":x&&(w=x(w)),R=',"'+d+'":'+w;break;case"string":w=(x||gl)(w),R=',"'+d+'":'+w;break;default:w=(x||s)(w,i),R=',"'+d+'":'+w;}}return this[xI]&&A?m+this[CI]+A.slice(1)+"}"+R+u:m+A+R+u}function II(t,e){let r,n=t[A0],s=t[R0],i=t[wl],o=t[C0],u=o[O0],c=t[_0],p=t[T0].bindings;e=p(e);for(let l in e)if(r=e[l],(l!=="level"&&l!=="serializers"&&l!=="formatters"&&l!=="customLevels"&&e.hasOwnProperty(l)&&r!==void 0)===!0){if(r=c[l]?c[l](r):r,r=(o[l]||u||s)(r,i),r===void 0)continue;n+=',"'+l+'":'+r;}return n}function $I(t){return t.write!==t.constructor.prototype.write}function ao(t){let e=new ml(t);return e.on("error",r),!t.sync&&RI&&(b0.register(e,FI),e.on("close",function(){b0.unregister(e);})),e;function r(n){if(n.code==="EPIPE"){e.write=xn,e.end=xn,e.flushSync=xn,e.destroy=xn;return}e.removeListener("error",r),e.emit("error",n);}}function FI(t,e){t.destroyed||(e==="beforeExit"?(t.flush(),t.on("drain",function(){t.end();})):t.flushSync());}function kI(t){return function(r,n,s={},i){if(typeof s=="string")i=ao({dest:s}),s={};else if(typeof i=="string"){if(s&&s.transport)throw Error("only one of option.transport or stream can be specified");i=ao({dest:i});}else if(s instanceof ml||s.writable||s._writableState)i=s,s={};else if(s.transport){if(s.transport instanceof ml||s.transport.writable||s.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(s.transport.targets&&s.transport.targets.length&&s.formatters&&typeof s.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let c;s.customLevels&&(c=s.useOnlyCustomLevels?s.customLevels:Object.assign({},s.levels,s.customLevels)),i=OI({caller:n,...s.transport,levels:c});}if(s=Object.assign({},t,s),s.serializers=Object.assign({},t.serializers,s.serializers),s.formatters=Object.assign({},t.formatters,s.formatters),s.prettyPrint)throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");let{enabled:o,onChild:u}=s;return o===!1&&(s.level="silent"),u||(s.onChild=xn),i||($I(process.stdout)?i=process.stdout:i=ao({fd:process.stdout.fd||1})),{opts:s,stream:i}}}function LI(t,e){try{return JSON.stringify(t)}catch{try{return (e||this[wl])(t)}catch{return '"[unable to serialize, circular reference is too complex to analyze]"'}}}function qI(t,e,r){return {level:t,bindings:e,log:r}}function BI(t){let e=Number(t);return typeof t=="string"&&Number.isFinite(e)?e:t===void 0?1:t}P0.exports={noop:xn,buildSafeSonicBoom:ao,asChindings:II,asJson:PI,genLog:TI,createArgsNormalizer:kI,stringify:LI,buildFormatters:qI,normalizeDestFileDescriptor:BI};});var lo=_((N2,$0)=>{var{lsCacheSym:DI,levelValSym:vl,useOnlyCustomLevelsSym:NI,streamSym:MI,formattersSym:UI,hooksSym:jI}=bn(),{noop:HI,genLog:Nr}=uo(),Tt={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},I0={fatal:t=>{let e=Nr(Tt.fatal,t);return function(...r){let n=this[MI];if(e.call(this,...r),typeof n.flushSync=="function")try{n.flushSync();}catch{}}},error:t=>Nr(Tt.error,t),warn:t=>Nr(Tt.warn,t),info:t=>Nr(Tt.info,t),debug:t=>Nr(Tt.debug,t),trace:t=>Nr(Tt.trace,t)},Sl=Object.keys(Tt).reduce((t,e)=>(t[Tt[e]]=e,t),{}),WI=Object.keys(Sl).reduce((t,e)=>(t[e]='{"level":'+Number(e),t),{});function zI(t){let e=t[UI].level,{labels:r}=t.levels,n={};for(let s in r){let i=e(r[s],Number(s));n[s]=JSON.stringify(i).slice(0,-1);}return t[DI]=n,t}function GI(t,e){if(e)return !1;switch(t){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return !0;default:return !1}}function VI(t){let{labels:e,values:r}=this.levels;if(typeof t=="number"){if(e[t]===void 0)throw Error("unknown level value"+t);t=e[t];}if(r[t]===void 0)throw Error("unknown level "+t);let n=this[vl],s=this[vl]=r[t],i=this[NI],o=this[jI].logMethod;for(let u in r){if(s>r[u]){this[u]=HI;continue}this[u]=GI(u,i)?I0[u](o):Nr(r[u],o);}this.emit("level-change",t,s,e[n],n,this);}function KI(t){let{levels:e,levelVal:r}=this;return e&&e.labels?e.labels[r]:""}function YI(t){let{values:e}=this.levels,r=e[t];return r!==void 0&&r>=this[vl]}function JI(t=null,e=!1){let r=t?Object.keys(t).reduce((i,o)=>(i[t[o]]=o,i),{}):null,n=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),e?null:Sl,r),s=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),e?null:Tt,t);return {labels:n,values:s}}function XI(t,e,r){if(typeof t=="number"){if(![].concat(Object.keys(e||{}).map(i=>e[i]),r?[]:Object.keys(Sl).map(i=>+i),1/0).includes(t))throw Error(`default level:${t} must be included in custom levels`);return}let n=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),r?null:Tt,e);if(!(t in n))throw Error(`default level:${t} must be included in custom levels`)}function QI(t,e){let{labels:r,values:n}=t;for(let s in e){if(s in n)throw Error("levels cannot be overridden");if(e[s]in r)throw Error("pre-existing level values cannot be used for new levels")}}$0.exports={initialLsCache:WI,genLsCache:zI,levelMethods:I0,getLevel:KI,setLevel:VI,isLevelEnabled:YI,mappings:JI,levels:Tt,assertNoLevelCollisions:QI,assertDefaultLevelFound:XI};});var bl=_((M2,F0)=>{F0.exports={version:"8.15.1"};});var W0=_((j2,H0)=>{var{EventEmitter:ZI}=G("events"),{lsCacheSym:e$,levelValSym:t$,setLevelSym:xl,getLevelSym:k0,chindingsSym:Al,parsedChindingsSym:r$,mixinSym:n$,asJsonSym:N0,writeSym:i$,mixinMergeStrategySym:s$,timeSym:o$,timeSliceIndexSym:a$,streamSym:M0,serializersSym:Mr,formattersSym:El,errorKeySym:u$,messageKeySym:l$,useOnlyCustomLevelsSym:c$,needsMetadataGsym:f$,redactFmtSym:h$,stringifySym:p$,formatOptsSym:d$,stringifiersSym:y$,msgPrefixSym:L0}=bn(),{getLevel:g$,setLevel:m$,isLevelEnabled:w$,mappings:v$,initialLsCache:S$,genLsCache:b$,assertNoLevelCollisions:E$}=lo(),{asChindings:U0,asJson:x$,buildFormatters:q0,stringify:B0}=uo(),{version:A$}=bl(),_$=nl(),C$=class{},j0={constructor:C$,child:R$,bindings:O$,setBindings:T$,flush:F$,isLevelEnabled:w$,version:A$,get level(){return this[k0]()},set level(t){this[xl](t);},get levelVal(){return this[t$]},set levelVal(t){throw Error("levelVal is read-only")},[e$]:S$,[i$]:I$,[N0]:x$,[k0]:g$,[xl]:m$};Object.setPrototypeOf(j0,ZI.prototype);H0.exports=function(){return Object.create(j0)};var D0=t=>t;function R$(t,e){if(!t)throw Error("missing bindings for child Pino");e=e||{};let r=this[Mr],n=this[El],s=Object.create(this);if(e.hasOwnProperty("serializers")===!0){s[Mr]=Object.create(null);for(let l in r)s[Mr][l]=r[l];let c=Object.getOwnPropertySymbols(r);for(var i=0;i{var{hasOwnProperty:co}=Object.prototype,jr=Rl();jr.configure=Rl;jr.stringify=jr;jr.default=jr;Ol.stringify=jr;Ol.configure=Rl;K0.exports=jr;var k$=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;function Er(t){return t.length<5e3&&!k$.test(t)?`"${t}"`:JSON.stringify(t)}function _l(t){if(t.length>200)return t.sort();for(let e=1;er;)t[n]=t[n-1],n--;t[n]=r;}return t}var L$=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Cl(t){return L$.call(t)!==void 0&&t.length!==0}function z0(t,e,r){t.length= 1`)}return r===void 0?1/0:r}function Ur(t){return t===1?"1 item":`${t} items`}function B$(t){let e=new Set;for(let r of t)(typeof r=="string"||typeof r=="number")&&e.add(String(r));return e}function D$(t){if(co.call(t,"strict")){let e=t.strict;if(typeof e!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(e)return r=>{let n=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(n+=` (${r.toString()})`),new Error(n)}}}function Rl(t){t={...t};let e=D$(t);e&&(t.bigint===void 0&&(t.bigint=!1),"circularValue"in t||(t.circularValue=Error));let r=q$(t),n=G0(t,"bigint"),s=G0(t,"deterministic"),i=V0(t,"maximumDepth"),o=V0(t,"maximumBreadth");function u(g,m,w,E,A,R){let x=m[g];switch(typeof x=="object"&&x!==null&&typeof x.toJSON=="function"&&(x=x.toJSON(g)),x=E.call(m,g,x),typeof x){case"string":return Er(x);case"object":{if(x===null)return "null";if(w.indexOf(x)!==-1)return r;let O="",F=",",q=R;if(Array.isArray(x)){if(x.length===0)return "[]";if(io){let oe=x.length-o-1;O+=`${F}"... ${Ur(oe)} not stringified"`;}return A!==""&&(O+=` -${q}`),w.pop(),`[${O}]`}let W=Object.keys(x),H=W.length;if(H===0)return "{}";if(io){let C=H-o;O+=`${k}"...":${B}"${Ur(C)} not stringified"`,k=F;}return A!==""&&k.length>1&&(O=` -${R}${O} -${q}`),w.pop(),`{${O}}`}case"number":return isFinite(x)?String(x):e?e(x):"null";case"boolean":return x===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(x);default:return e?e(x):void 0}}function c(g,m,w,E,A,R){switch(typeof m=="object"&&m!==null&&typeof m.toJSON=="function"&&(m=m.toJSON(g)),typeof m){case"string":return Er(m);case"object":{if(m===null)return "null";if(w.indexOf(m)!==-1)return r;let x=R,O="",F=",";if(Array.isArray(m)){if(m.length===0)return "[]";if(io){let U=m.length-o-1;O+=`${F}"... ${Ur(U)} not stringified"`;}return A!==""&&(O+=` -${x}`),w.pop(),`[${O}]`}w.push(m);let q="";A!==""&&(R+=A,F=`, -${R}`,q=" ");let W="";for(let H of E){let B=c(H,m[H],w,E,A,R);B!==void 0&&(O+=`${W}${Er(H)}:${q}${B}`,W=F);}return A!==""&&W.length>1&&(O=` -${R}${O} -${x}`),w.pop(),`{${O}}`}case"number":return isFinite(m)?String(m):e?e(m):"null";case"boolean":return m===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(m);default:return e?e(m):void 0}}function p(g,m,w,E,A){switch(typeof m){case"string":return Er(m);case"object":{if(m===null)return "null";if(typeof m.toJSON=="function"){if(m=m.toJSON(g),typeof m!="object")return p(g,m,w,E,A);if(m===null)return "null"}if(w.indexOf(m)!==-1)return r;let R=A;if(Array.isArray(m)){if(m.length===0)return "[]";if(io){let J=m.length-o-1;B+=`${k}"... ${Ur(J)} not stringified"`;}return B+=` -${R}`,w.pop(),`[${B}]`}let x=Object.keys(m),O=x.length;if(O===0)return "{}";if(io){let B=O-o;q+=`${W}"...": "${Ur(B)} not stringified"`,W=F;}return W!==""&&(q=` -${A}${q} -${R}`),w.pop(),`{${q}}`}case"number":return isFinite(m)?String(m):e?e(m):"null";case"boolean":return m===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(m);default:return e?e(m):void 0}}function l(g,m,w){switch(typeof m){case"string":return Er(m);case"object":{if(m===null)return "null";if(typeof m.toJSON=="function"){if(m=m.toJSON(g),typeof m!="object")return l(g,m,w);if(m===null)return "null"}if(w.indexOf(m)!==-1)return r;let E="";if(Array.isArray(m)){if(m.length===0)return "[]";if(io){let H=m.length-o-1;E+=`,"... ${Ur(H)} not stringified"`;}return w.pop(),`[${E}]`}let A=Object.keys(m),R=A.length;if(R===0)return "{}";if(io){let F=R-o;E+=`${x}"...":"${Ur(F)} not stringified"`;}return w.pop(),`{${E}}`}case"number":return isFinite(m)?String(m):e?e(m):"null";case"boolean":return m===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(m);default:return e?e(m):void 0}}function d(g,m,w){if(arguments.length>1){let E="";if(typeof w=="number"?E=" ".repeat(Math.min(w,10)):typeof w=="string"&&(E=w.slice(0,10)),m!=null){if(typeof m=="function")return u("",{"":g},[],m,E,"");if(Array.isArray(m))return c("",g,[],B$(m),E,"")}if(E.length!==0)return p("",g,[],E,"")}return l("",g,[])}return d}});var Q0=_((H2,X0)=>{var Tl=Symbol.for("pino.metadata"),{levels:J0}=lo(),N$=J0.info;function M$(t,e){let r=0;t=t||[],e=e||{dedupe:!1};let n=Object.create(J0);n.silent=1/0,e.levels&&typeof e.levels=="object"&&Object.keys(e.levels).forEach(l=>{n[l]=e.levels[l];});let s={write:i,add:u,flushSync:o,end:c,minLevel:0,streams:[],clone:p,[Tl]:!0,streamLevels:n};return Array.isArray(t)?t.forEach(u,s):u.call(s,t),t=null,s;function i(l){let d,g=this.lastLevel,{streams:m}=this,w=0,E;for(let A=j$(m.length,e.dedupe);W$(A,m.length,e.dedupe);A=H$(A,e.dedupe))if(d=m[A],d.level<=g){if(w!==0&&w!==d.level)break;if(E=d.stream,E[Tl]){let{lastTime:R,lastMsg:x,lastObj:O,lastLogger:F}=this;E.lastLevel=g,E.lastTime=R,E.lastMsg=x,E.lastObj=O,E.lastLogger=F;}E.write(l),e.dedupe&&(w=d.level);}else if(!e.dedupe)break}function o(){for(let{stream:l}of this.streams)typeof l.flushSync=="function"&&l.flushSync();}function u(l){if(!l)return s;let d=typeof l.write=="function"||l.stream,g=l.write?l:l.stream;if(!d)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:m,streamLevels:w}=this,E;typeof l.levelVal=="number"?E=l.levelVal:typeof l.level=="string"?E=w[l.level]:typeof l.level=="number"?E=l.level:E=N$;let A={stream:g,level:E,levelVal:void 0,id:r++};return m.unshift(A),m.sort(U$),this.minLevel=m[0].level,s}function c(){for(let{stream:l}of this.streams)typeof l.flushSync=="function"&&l.flushSync(),l.end();}function p(l){let d=new Array(this.streams.length);for(let g=0;g=0:t{var z$=G("os"),ov=Yu(),G$=Ju(),V$=nl(),av=Yw(),K$=W0(),uv=bn(),{configure:Y$}=Y0(),{assertDefaultLevelFound:J$,mappings:lv,genLsCache:X$,levels:Q$}=lo(),{createArgsNormalizer:Z$,asChindings:eF,buildSafeSonicBoom:Z0,buildFormatters:tF,stringify:Pl,normalizeDestFileDescriptor:ev,noop:rF}=uo(),{version:nF}=bl(),{chindingsSym:tv,redactFmtSym:iF,serializersSym:rv,timeSym:sF,timeSliceIndexSym:oF,streamSym:aF,stringifySym:nv,stringifySafeSym:Il,stringifiersSym:iv,setLevelSym:uF,endSym:lF,formatOptsSym:cF,messageKeySym:fF,errorKeySym:hF,nestedKeySym:pF,mixinSym:dF,useOnlyCustomLevelsSym:yF,formattersSym:sv,hooksSym:gF,nestedKeyStrSym:mF,mixinMergeStrategySym:wF,msgPrefixSym:vF}=uv,{epochTime:cv,nullTime:SF}=av,{pid:bF}=process,EF=z$.hostname(),xF=ov.err,AF={level:"info",levels:Q$,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:bF,hostname:EF},serializers:Object.assign(Object.create(null),{err:xF}),formatters:Object.assign(Object.create(null),{bindings(t){return t},level(t,e){return {level:e}}}),hooks:{logMethod:void 0},timestamp:cv,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},_F=Z$(AF),CF=Object.assign(Object.create(null),ov);function $l(...t){let e={},{opts:r,stream:n}=_F(e,G$(),...t),{redact:s,crlf:i,serializers:o,timestamp:u,messageKey:c,errorKey:p,nestedKey:l,base:d,name:g,level:m,customLevels:w,mixin:E,mixinMergeStrategy:A,useOnlyCustomLevels:R,formatters:x,hooks:O,depthLimit:F,edgeLimit:q,onChild:W,msgPrefix:H}=r,B=Y$({maximumDepth:F,maximumBreadth:q}),k=tF(x.level,x.bindings,x.log),U=Pl.bind({[Il]:B}),C=s?V$(s,U):{},Y=s?{stringify:C[iF]}:{stringify:U},J="}"+(i?`\r + `}});var gv=R((UN,dv)=>{dv.exports=BP;function BP(t){let{secret:e,censor:r,compileRestore:n,serialize:s,groupRedact:i,nestedRedact:o,wildcards:l,wcLen:c}=t,p=[{secret:e,censor:r,compileRestore:n}];return s!==!1&&p.push({serialize:s}),c>0&&p.push({groupRedact:i,nestedRedact:o,wildcards:l,wcLen:c}),Object.assign(...p)}});var vv=R((WN,mv)=>{var yv=nv(),HP=ov(),UP=lv(),WP=pv(),{groupRedact:zP,nestedRedact:GP}=ql(),KP=gv(),VP=Bs(),YP=yv(),Dl=t=>t;Dl.restore=Dl;var JP="[REDACTED]";Nl.rx=VP;Nl.validator=yv;mv.exports=Nl;function Nl(t={}){let e=Array.from(new Set(t.paths||[])),r="serialize"in t&&(t.serialize===!1||typeof t.serialize=="function")?t.serialize:JSON.stringify,n=t.remove;if(n===!0&&r!==JSON.stringify)throw Error("fast-redact \u2013 remove option may only be set when serializer is JSON.stringify");let s=n===!0?void 0:"censor"in t?t.censor:JP,i=typeof s=="function",o=i&&s.length>1;if(e.length===0)return r||Dl;YP({paths:e,serialize:r,censor:s});let{wildcards:l,wcLen:c,secret:p}=HP({paths:e,censor:s}),u=WP({secret:p,wcLen:c}),g="strict"in t?t.strict:!0;return UP({secret:p,wcLen:c,serialize:r,strict:g,isCensorFct:i,censorFctTakesPath:o},KP({secret:p,censor:s,compileRestore:u,serialize:r,groupRedact:zP,nestedRedact:GP,wildcards:l,wcLen:c}))}});var hn=R((zN,wv)=>{var XP=Symbol("pino.setLevel"),QP=Symbol("pino.getLevel"),ZP=Symbol("pino.levelVal"),e1=Symbol("pino.useLevelLabels"),t1=Symbol("pino.useOnlyCustomLevels"),r1=Symbol("pino.mixin"),n1=Symbol("pino.lsCache"),i1=Symbol("pino.chindings"),s1=Symbol("pino.asJson"),o1=Symbol("pino.write"),a1=Symbol("pino.redactFmt"),l1=Symbol("pino.time"),u1=Symbol("pino.timeSliceIndex"),c1=Symbol("pino.stream"),f1=Symbol("pino.stringify"),h1=Symbol("pino.stringifySafe"),p1=Symbol("pino.stringifiers"),d1=Symbol("pino.end"),g1=Symbol("pino.formatOpts"),y1=Symbol("pino.messageKey"),m1=Symbol("pino.errorKey"),v1=Symbol("pino.nestedKey"),w1=Symbol("pino.nestedKeyStr"),S1=Symbol("pino.mixinMergeStrategy"),b1=Symbol("pino.msgPrefix"),E1=Symbol("pino.wildcardFirst"),A1=Symbol.for("pino.serializers"),_1=Symbol.for("pino.formatters"),x1=Symbol.for("pino.hooks"),C1=Symbol.for("pino.metadata");wv.exports={setLevelSym:XP,getLevelSym:QP,levelValSym:ZP,useLevelLabelsSym:e1,mixinSym:r1,lsCacheSym:n1,chindingsSym:i1,asJsonSym:s1,writeSym:o1,serializersSym:A1,redactFmtSym:a1,timeSym:l1,timeSliceIndexSym:u1,streamSym:c1,stringifySym:f1,stringifySafeSym:h1,stringifiersSym:p1,endSym:d1,formatOptsSym:g1,messageKeySym:y1,errorKeySym:m1,nestedKeySym:v1,wildcardFirstSym:E1,needsMetadataGsym:C1,useOnlyCustomLevelsSym:t1,formattersSym:_1,hooksSym:x1,nestedKeyStrSym:w1,mixinMergeStrategySym:S1,msgPrefixSym:b1};});var Bl=R((GN,Av)=>{var jl=vv(),{redactFmtSym:R1,wildcardFirstSym:Hs}=hn(),{rx:Ml,validator:O1}=jl,Sv=O1({ERR_PATHS_MUST_BE_STRINGS:()=>"pino \u2013 redacted paths must be strings",ERR_INVALID_PATH:t=>`pino \u2013 redact paths array contains an invalid path (${t})`}),bv="[Redacted]",Ev=!1;function P1(t,e){let{paths:r,censor:n}=T1(t),s=r.reduce((l,c)=>{Ml.lastIndex=0;let p=Ml.exec(c),u=Ml.exec(c),g=p[1]!==void 0?p[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):p[0];if(g==="*"&&(g=Hs),u===null)return l[g]=null,l;if(l[g]===null)return l;let{index:y}=u,m=`${c.substr(y,c.length-1)}`;return l[g]=l[g]||[],g!==Hs&&l[g].length===0&&l[g].push(...l[Hs]||[]),g===Hs&&Object.keys(l).forEach(function(v){l[v]&&l[v].push(m);}),l[g].push(m),l},{}),i={[R1]:jl({paths:r,censor:n,serialize:e,strict:Ev})},o=(...l)=>e(typeof n=="function"?n(...l):n);return [...Object.keys(s),...Object.getOwnPropertySymbols(s)].reduce((l,c)=>{if(s[c]===null)l[c]=p=>o(p,[c]);else {let p=typeof n=="function"?(u,g)=>n(u,[c,...g]):n;l[c]=jl({paths:s[c],censor:p,serialize:e,strict:Ev});}return l},i)}function T1(t){if(Array.isArray(t))return t={paths:t,censor:bv},Sv(t),t;let{paths:e,censor:r=bv,remove:n}=t;if(Array.isArray(e)===!1)throw Error("pino \u2013 redact must contain an array of strings");return n===!0&&(r=void 0),Sv({paths:e,censor:r}),{paths:e,censor:r}}Av.exports=P1;});var xv=R((KN,_v)=>{var $1=()=>"",I1=()=>`,"time":${Date.now()}`,k1=()=>`,"time":${Math.round(Date.now()/1e3)}`,L1=()=>`,"time":"${new Date(Date.now()).toISOString()}"`;_v.exports={nullTime:$1,epochTime:I1,unixTime:k1,isoTime:L1};});var Rv=R((VN,Cv)=>{function F1(t){try{return JSON.stringify(t)}catch{return '"[Circular]"'}}Cv.exports=q1;function q1(t,e,r){var n=r&&r.stringify||F1,s=1;if(typeof t=="object"&&t!==null){var i=e.length+s;if(i===1)return t;var o=new Array(i);o[0]=n(t);for(var l=1;l-1?g:0,t.charCodeAt(m+1)){case 100:case 102:if(u>=c||e[u]==null)break;g=c||e[u]==null)break;g=c||e[u]===void 0)break;g",g=m+2,m++;break}p+=n(e[u]),g=m+2,m++;break;case 115:if(u>=c)break;g{if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let e=function(r){if((r>0&&r<1/0)===!1)throw typeof r!="number"&&typeof r!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(t,0,0,Number(r));},t=new Int32Array(new SharedArrayBuffer(4));Hl.exports=e;}else {let t=function(e){if((e>0&&e<1/0)===!1)throw typeof e!="number"&&typeof e!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");};Hl.exports=t;}});var Iv=R((JN,$v)=>{var et=z("fs"),D1=z("events"),N1=z("util").inherits,Ov=z("path"),Pv=Ul(),Wl=100,M1=16*1024;function Tv(t,e){e._opening=!0,e._writing=!0,e._asyncDrainScheduled=!1;function r(i,o){if(i){e._reopening=!1,e._writing=!1,e._opening=!1,e.sync?process.nextTick(()=>{e.listenerCount("error")>0&&e.emit("error",i);}):e.emit("error",i);return}e.fd=o,e.file=t,e._reopening=!1,e._opening=!1,e._writing=!1,e.sync?process.nextTick(()=>e.emit("ready")):e.emit("ready"),!e._reopening&&!e._writing&&e._len>e.minLength&&!e.destroyed&&pn(e);}let n=e.append?"a":"w",s=e.mode;if(e.sync)try{e.mkdir&&et.mkdirSync(Ov.dirname(t),{recursive:!0});let i=et.openSync(t,n,s);r(null,i);}catch(i){throw r(i),i}else e.mkdir?et.mkdir(Ov.dirname(t),{recursive:!0},i=>{if(i)return r(i);et.open(t,n,s,r);}):et.open(t,n,s,r);}function tt(t){if(!(this instanceof tt))return new tt(t);let{fd:e,dest:r,minLength:n,maxLength:s,maxWrite:i,sync:o,append:l=!0,mode:c,mkdir:p,retryEAGAIN:u,fsync:g}=t||{};if(e=e||r,this._bufs=[],this._len=0,this.fd=-1,this._writing=!1,this._writingBuf="",this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._hwm=Math.max(n||0,16387),this.file=null,this.destroyed=!1,this.minLength=n||0,this.maxLength=s||0,this.maxWrite=i||M1,this.sync=o||!1,this._fsync=g||!1,this.append=l||!1,this.mode=c,this.retryEAGAIN=u||(()=>!0),this.mkdir=p||!1,typeof e=="number")this.fd=e,process.nextTick(()=>this.emit("ready"));else if(typeof e=="string")Tv(e,this);else throw new Error("SonicBoom supports only file descriptors and files");if(this.minLength>=this.maxWrite)throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(y,m)=>{if(y){if((y.code==="EAGAIN"||y.code==="EBUSY")&&this.retryEAGAIN(y,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{Pv(Wl),this.release(void 0,0);}catch(b){this.release(b);}else setTimeout(()=>{et.write(this.fd,this._writingBuf,"utf8",this.release);},Wl);else this._writing=!1,this.emit("error",y);return}if(this.emit("write",m),this._len-=m,this._len<0&&(this._len=0),this._writingBuf=this._writingBuf.slice(m),this._writingBuf.length){if(!this.sync){et.write(this.fd,this._writingBuf,"utf8",this.release);return}try{do{let b=et.writeSync(this.fd,this._writingBuf,"utf8");this._len-=b,this._writingBuf=this._writingBuf.slice(b);}while(this._writingBuf)}catch(b){this.release(b);return}}this._fsync&&et.fsyncSync(this.fd);let v=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):v>this.minLength?pn(this):this._ending?v>0?pn(this):(this._writing=!1,Us(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(j1,this)):this.emit("drain"));},this.on("newListener",function(y){y==="drain"&&(this._asyncDrainScheduled=!1);});}function j1(t){t.listenerCount("drain")>0&&(t._asyncDrainScheduled=!1,t.emit("drain"));}N1(tt,D1);tt.prototype.write=function(t){if(this.destroyed)throw new Error("SonicBoom destroyed");let e=this._len+t.length,r=this._bufs;return this.maxLength&&e>this.maxLength?(this.emit("drop",t),this._lenthis.maxWrite?r.push(""+t):r[r.length-1]+=t,this._len=e,!this._writing&&this._len>=this.minLength&&pn(this),this._len{this.reopen(t);});return}if(this._ending)return;if(!this.file)throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");if(this._reopening=!0,this._writing)return;let e=this.fd;this.once("ready",()=>{e!==this.fd&&et.close(e,r=>{if(r)return this.emit("error",r)});}),Tv(t||this.file,this);};tt.prototype.end=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.end();});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?pn(this):Us(this)));};tt.prototype.flushSync=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");let t="";for(;this._bufs.length||t.length;){t.length<=0&&(t=this._bufs[0]);try{let e=et.writeSync(this.fd,t,"utf8");t=t.slice(e),this._len=Math.max(this._len-e,0),t.length<=0&&this._bufs.shift();}catch(e){if((e.code==="EAGAIN"||e.code==="EBUSY")&&!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;Pv(Wl);}}};tt.prototype.destroy=function(){this.destroyed||Us(this);};function pn(t){let e=t.release;if(t._writing=!0,t._writingBuf=t._writingBuf||t._bufs.shift()||"",t.sync)try{let r=et.writeSync(t.fd,t._writingBuf,"utf8");e(null,r);}catch(r){e(r);}else et.write(t.fd,t._writingBuf,"utf8",e);}function Us(t){if(t.fd===-1){t.once("ready",Us.bind(null,t));return}t.destroyed=!0,t._bufs=[],t.fd!==1&&t.fd!==2?et.close(t.fd,e):setImmediate(e);function e(r){if(r){t.emit("error",r);return}t._ending&&!t._writing&&t.emit("finish"),t.emit("close");}}tt.SonicBoom=tt;tt.default=tt;$v.exports=tt;});var zl=R((XN,Nv)=>{var dr={exit:[],beforeExit:[]},kv={exit:H1,beforeExit:U1},Lv=new FinalizationRegistry(W1);function B1(t){dr[t].length>0||process.on(t,kv[t]);}function Fv(t){dr[t].length>0||process.removeListener(t,kv[t]);}function H1(){qv("exit");}function U1(){qv("beforeExit");}function qv(t){for(let e of dr[t]){let r=e.deref(),n=e.fn;r!==void 0&&n(r,t);}}function W1(t){for(let e of ["exit","beforeExit"]){let r=dr[e].indexOf(t);dr[e].splice(r,r+1),Fv(e);}}function Dv(t,e,r){if(e===void 0)throw new Error("the object can't be undefined");B1(t);let n=new WeakRef(e);n.fn=r,Lv.register(e,n),dr[t].push(n);}function z1(t,e){Dv("exit",t,e);}function G1(t,e){Dv("beforeExit",t,e);}function K1(t){Lv.unregister(t);for(let e of ["exit","beforeExit"])dr[e]=dr[e].filter(r=>{let n=r.deref();return n&&n!==t}),Fv(e);}Nv.exports={register:z1,registerBeforeExit:G1,unregister:K1};});var Mv=R((QN,V1)=>{V1.exports={name:"thread-stream",version:"2.4.0",description:"A streaming way to send data to a Node.js Worker Thread",main:"index.js",types:"index.d.ts",dependencies:{"real-require":"^0.2.0"},devDependencies:{"@types/node":"^20.1.0","@types/tap":"^15.0.0",desm:"^1.3.0",fastbench:"^1.0.1",husky:"^8.0.1","pino-elasticsearch":"^6.0.0","sonic-boom":"^3.0.0",standard:"^17.0.0",tap:"^16.2.0","ts-node":"^10.8.0",typescript:"^4.7.2","why-is-node-running":"^2.2.2"},scripts:{test:"standard && npm run transpile && tap test/*.test.*js && tap --ts test/*.test.*ts","test:ci":"standard && npm run transpile && npm run test:ci:js && npm run test:ci:ts","test:ci:js":'tap --no-check-coverage --coverage-report=lcovonly "test/**/*.test.*js"',"test:ci:ts":'tap --ts --no-check-coverage --coverage-report=lcovonly "test/**/*.test.*ts"',"test:yarn":'npm run transpile && tap "test/**/*.test.js" --no-check-coverage',transpile:"sh ./test/ts/transpile.sh",prepare:"husky install"},standard:{ignore:["test/ts/**/*"]},repository:{type:"git",url:"git+https://github.com/mcollina/thread-stream.git"},keywords:["worker","thread","threads","stream"],author:"Matteo Collina ",license:"MIT",bugs:{url:"https://github.com/mcollina/thread-stream/issues"},homepage:"https://github.com/mcollina/thread-stream#readme"};});var Bv=R((ZN,jv)=>{function Y1(t,e,r,n,s){let i=Date.now()+n,o=Atomics.load(t,e);if(o===r){s(null,"ok");return}let l=o,c=p=>{Date.now()>i?s(null,"timed-out"):setTimeout(()=>{l=o,o=Atomics.load(t,e),o===l?c(p>=1e3?1e3:p*2):o===r?s(null,"ok"):s(null,"not-equal");},p);};c(1);}function J1(t,e,r,n,s){let i=Date.now()+n,o=Atomics.load(t,e);if(o!==r){s(null,"ok");return}let l=c=>{Date.now()>i?s(null,"timed-out"):setTimeout(()=>{o=Atomics.load(t,e),o!==r?s(null,"ok"):l(c>=1e3?1e3:c*2);},c);};l(1);}jv.exports={wait:Y1,waitDiff:J1};});var Uv=R((eM,Hv)=>{Hv.exports={WRITE_INDEX:4,READ_INDEX:8};});var Vv=R((rM,Kv)=>{var{version:X1}=Mv(),{EventEmitter:Q1}=z("events"),{Worker:Z1}=z("worker_threads"),{join:eT}=z("path"),{pathToFileURL:tT}=z("url"),{wait:rT}=Bv(),{WRITE_INDEX:rt,READ_INDEX:qt}=Uv(),nT=z("buffer"),iT=z("assert"),D=Symbol("kImpl"),sT=nT.constants.MAX_STRING_LENGTH,zs=class{constructor(e){this._value=e;}deref(){return this._value}},oT=global.FinalizationRegistry||class{register(){}unregister(){}},aT=global.WeakRef||zs,Wv=new oT(t=>{t.exited||t.terminate();});function lT(t,e){let{filename:r,workerData:n}=e,i=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||eT(__dirname,"lib","worker.js"),o=new Z1(i,{...e.workerOpts,trackUnmanagedFds:!1,workerData:{filename:r.indexOf("file://")===0?r:tT(r).href,dataBuf:t[D].dataBuf,stateBuf:t[D].stateBuf,workerData:{$context:{threadStreamVersion:X1},...n}}});return o.stream=new zs(t),o.on("message",uT),o.on("exit",Gv),Wv.register(t,o),o}function zv(t){iT(!t[D].sync),t[D].needDrain&&(t[D].needDrain=!1,t.emit("drain"));}function Ws(t){let e=Atomics.load(t[D].state,rt),r=t[D].data.length-e;if(r>0){if(t[D].buf.length===0){t[D].flushing=!1,t[D].ending?Jl(t):t[D].needDrain&&process.nextTick(zv,t);return}let n=t[D].buf.slice(0,r),s=Buffer.byteLength(n);s<=r?(t[D].buf=t[D].buf.slice(r),Gs(t,n,Ws.bind(null,t))):t.flush(()=>{if(!t.destroyed){for(Atomics.store(t[D].state,qt,0),Atomics.store(t[D].state,rt,0);s>t[D].data.length;)r=r/2,n=t[D].buf.slice(0,r),s=Buffer.byteLength(n);t[D].buf=t[D].buf.slice(r),Gs(t,n,Ws.bind(null,t));}});}else if(r===0){if(e===0&&t[D].buf.length===0)return;t.flush(()=>{Atomics.store(t[D].state,qt,0),Atomics.store(t[D].state,rt,0),Ws(t);});}else Dt(t,new Error("overwritten"));}function uT(t){let e=this.stream.deref();if(e===void 0){this.exited=!0,this.terminate();return}switch(t.code){case"READY":this.stream=new aT(e),e.flush(()=>{e[D].ready=!0,e.emit("ready");});break;case"ERROR":Dt(e,t.err);break;case"EVENT":Array.isArray(t.args)?e.emit(t.name,...t.args):e.emit(t.name,t.args);break;case"WARNING":process.emitWarning(t.err);break;default:Dt(e,new Error("this should not happen: "+t.code));}}function Gv(t){let e=this.stream.deref();e!==void 0&&(Wv.unregister(e),e.worker.exited=!0,e.worker.off("exit",Gv),Dt(e,t!==0?new Error("the worker thread exited"):null));}var Kl=class extends Q1{constructor(e={}){if(super(),e.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[D]={},this[D].stateBuf=new SharedArrayBuffer(128),this[D].state=new Int32Array(this[D].stateBuf),this[D].dataBuf=new SharedArrayBuffer(e.bufferSize||4*1024*1024),this[D].data=Buffer.from(this[D].dataBuf),this[D].sync=e.sync||!1,this[D].ending=!1,this[D].ended=!1,this[D].needDrain=!1,this[D].destroyed=!1,this[D].flushing=!1,this[D].ready=!1,this[D].finished=!1,this[D].errored=null,this[D].closed=!1,this[D].buf="",this.worker=lT(this,e);}write(e){if(this[D].destroyed)return Vl(this,new Error("the worker has exited")),!1;if(this[D].ending)return Vl(this,new Error("the worker is ending")),!1;if(this[D].flushing&&this[D].buf.length+e.length>=sT)try{Gl(this),this[D].flushing=!0;}catch(r){return Dt(this,r),!1}if(this[D].buf+=e,this[D].sync)try{return Gl(this),!0}catch(r){return Dt(this,r),!1}return this[D].flushing||(this[D].flushing=!0,setImmediate(Ws,this)),this[D].needDrain=this[D].data.length-this[D].buf.length-Atomics.load(this[D].state,rt)<=0,!this[D].needDrain}end(){this[D].destroyed||(this[D].ending=!0,Jl(this));}flush(e){if(this[D].destroyed){typeof e=="function"&&process.nextTick(e,new Error("the worker has exited"));return}let r=Atomics.load(this[D].state,rt);rT(this[D].state,qt,r,1/0,(n,s)=>{if(n){Dt(this,n),process.nextTick(e,n);return}if(s==="not-equal"){this.flush(e);return}process.nextTick(e);});}flushSync(){this[D].destroyed||(Gl(this),Yl(this));}unref(){this.worker.unref();}ref(){this.worker.ref();}get ready(){return this[D].ready}get destroyed(){return this[D].destroyed}get closed(){return this[D].closed}get writable(){return !this[D].destroyed&&!this[D].ending}get writableEnded(){return this[D].ending}get writableFinished(){return this[D].finished}get writableNeedDrain(){return this[D].needDrain}get writableObjectMode(){return !1}get writableErrored(){return this[D].errored}};function Vl(t,e){setImmediate(()=>{t.emit("error",e);});}function Dt(t,e){t[D].destroyed||(t[D].destroyed=!0,e&&(t[D].errored=e,Vl(t,e)),t.worker.exited?setImmediate(()=>{t[D].closed=!0,t.emit("close");}):t.worker.terminate().catch(()=>{}).then(()=>{t[D].closed=!0,t.emit("close");}));}function Gs(t,e,r){let n=Atomics.load(t[D].state,rt),s=Buffer.byteLength(e);return t[D].data.write(e,n),Atomics.store(t[D].state,rt,n+s),Atomics.notify(t[D].state,rt),r(),!0}function Jl(t){if(!(t[D].ended||!t[D].ending||t[D].flushing)){t[D].ended=!0;try{t.flushSync();let e=Atomics.load(t[D].state,qt);Atomics.store(t[D].state,rt,-1),Atomics.notify(t[D].state,rt);let r=0;for(;e!==-1;){if(Atomics.wait(t[D].state,qt,e,1e3),e=Atomics.load(t[D].state,qt),e===-2){Dt(t,new Error("end() failed"));return}if(++r===10){Dt(t,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{t[D].finished=!0,t.emit("finish");});}catch(e){Dt(t,e);}}}function Gl(t){let e=()=>{t[D].ending?Jl(t):t[D].needDrain&&process.nextTick(zv,t);};for(t[D].flushing=!1;t[D].buf.length!==0;){let r=Atomics.load(t[D].state,rt),n=t[D].data.length-r;if(n===0){Yl(t),Atomics.store(t[D].state,qt,0),Atomics.store(t[D].state,rt,0);continue}else if(n<0)throw new Error("overwritten");let s=t[D].buf.slice(0,n),i=Buffer.byteLength(s);if(i<=n)t[D].buf=t[D].buf.slice(n),Gs(t,s,e);else {for(Yl(t),Atomics.store(t[D].state,qt,0),Atomics.store(t[D].state,rt,0);i>t[D].buf.length;)n=n/2,s=t[D].buf.slice(0,n),i=Buffer.byteLength(s);t[D].buf=t[D].buf.slice(n),Gs(t,s,e);}}}function Yl(t){if(t[D].flushing)throw new Error("unable to flush while flushing");let e=Atomics.load(t[D].state,rt),r=0;for(;;){let n=Atomics.load(t[D].state,qt);if(n===-2)throw Error("_flushSync failed");if(n!==e)Atomics.wait(t[D].state,qt,n,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}Kv.exports=Kl;});var Zl=R((nM,Yv)=>{var{createRequire:cT}=z("module"),fT=Ll(),{join:Xl,isAbsolute:hT,sep:pT}=z("path"),dT=Ul(),Ql=zl(),gT=Vv();function yT(t){Ql.register(t,vT),Ql.registerBeforeExit(t,wT),t.on("close",function(){Ql.unregister(t);});}function mT(t,e,r){let n=new gT({filename:t,workerData:e,workerOpts:r});n.on("ready",s),n.on("close",function(){process.removeListener("exit",i);}),process.on("exit",i);function s(){process.removeListener("exit",i),n.unref(),r.autoEnd!==!1&&yT(n);}function i(){n.closed||(n.flushSync(),dT(100),n.end());}return n}function vT(t){t.ref(),t.flushSync(),t.end(),t.once("close",function(){t.unref();});}function wT(t){t.flushSync();}function ST(t){let{pipeline:e,targets:r,levels:n,dedupe:s,options:i={},worker:o={},caller:l=fT()}=t,c=typeof l=="string"?[l]:l,p="__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{},u=t.target;if(u&&r)throw new Error("only one of target or targets can be specified");return r?(u=p["pino-worker"]||Xl(__dirname,"worker.js"),i.targets=r.map(y=>({...y,target:g(y.target)}))):e&&(u=p["pino-pipeline-worker"]||Xl(__dirname,"worker-pipeline.js"),i.targets=e.map(y=>({...y,target:g(y.target)}))),n&&(i.levels=n),s&&(i.dedupe=s),mT(g(u),i,o);function g(y){if(y=p[y]||y,hT(y)||y.indexOf("file://")===0)return y;if(y==="pino/file")return Xl(__dirname,"..","file.js");let m;for(let v of c)try{let b=v==="node:repl"?process.cwd()+pT:v;m=cT(b).resolve(y);break}catch{continue}if(!m)throw new Error(`unable to determine transport target for "${y}"`);return m}}Yv.exports=ST;});var Ys=R((iM,ow)=>{var Jv=Rv(),{mapHttpRequest:bT,mapHttpResponse:ET}=kl(),tu=Iv(),Xv=zl(),{lsCacheSym:AT,chindingsSym:ew,writeSym:Qv,serializersSym:tw,formatOptsSym:Zv,endSym:_T,stringifiersSym:rw,stringifySym:nw,stringifySafeSym:ru,wildcardFirstSym:iw,nestedKeySym:xT,formattersSym:sw,messageKeySym:CT,errorKeySym:RT,nestedKeyStrSym:OT,msgPrefixSym:Ks}=hn(),{isMainThread:PT}=z("worker_threads"),TT=Zl();function dn(){}function $T(t,e){if(!e)return r;return function(...s){e.call(this,s,r,t);};function r(n,...s){if(typeof n=="object"){let i=n;n!==null&&(n.method&&n.headers&&n.socket?n=bT(n):typeof n.setHeader=="function"&&(n=ET(n)));let o;i===null&&s.length===0?o=[null]:(i=s.shift(),o=s),typeof this[Ks]=="string"&&i!==void 0&&i!==null&&(i=this[Ks]+i),this[Qv](n,Jv(i,o,this[Zv]),t);}else {let i=n===void 0?s.shift():n;typeof this[Ks]=="string"&&i!==void 0&&i!==null&&(i=this[Ks]+i),this[Qv](null,Jv(i,s,this[Zv]),t);}}}function eu(t){let e="",r=0,n=!1,s=255,i=t.length;if(i>100)return JSON.stringify(t);for(var o=0;o=32;o++)s=t.charCodeAt(o),(s===34||s===92)&&(e+=t.slice(r,o)+"\\",r=o,n=!0);return n?e+=t.slice(r):e=t,s<32?JSON.stringify(t):'"'+e+'"'}function IT(t,e,r,n){let s=this[nw],i=this[ru],o=this[rw],l=this[_T],c=this[ew],p=this[tw],u=this[sw],g=this[CT],y=this[RT],m=this[AT][r]+n;m=m+c;let v;u.log&&(t=u.log(t));let b=o[iw],_="";for(let A in t)if(v=t[A],Object.prototype.hasOwnProperty.call(t,A)&&v!==void 0){p[A]?v=p[A](v):A===y&&p.err&&(v=p.err(v));let O=o[A]||b;switch(typeof v){case"undefined":case"function":continue;case"number":Number.isFinite(v)===!1&&(v=null);case"boolean":O&&(v=O(v));break;case"string":v=(O||eu)(v);break;default:v=(O||s)(v,i);}if(v===void 0)continue;let I=eu(A);_+=","+I+":"+v;}let x="";if(e!==void 0){v=p[g]?p[g](e):e;let A=o[g]||b;switch(typeof v){case"function":break;case"number":Number.isFinite(v)===!1&&(v=null);case"boolean":A&&(v=A(v)),x=',"'+g+'":'+v;break;case"string":v=(A||eu)(v),x=',"'+g+'":'+v;break;default:v=(A||s)(v,i),x=',"'+g+'":'+v;}}return this[xT]&&_?m+this[OT]+_.slice(1)+"}"+x+l:m+_+x+l}function kT(t,e){let r,n=t[ew],s=t[nw],i=t[ru],o=t[rw],l=o[iw],c=t[tw],p=t[sw].bindings;e=p(e);for(let u in e)if(r=e[u],(u!=="level"&&u!=="serializers"&&u!=="formatters"&&u!=="customLevels"&&e.hasOwnProperty(u)&&r!==void 0)===!0){if(r=c[u]?c[u](r):r,r=(o[u]||l||s)(r,i),r===void 0)continue;n+=',"'+u+'":'+r;}return n}function LT(t){return t.write!==t.constructor.prototype.write}function Vs(t){let e=new tu(t);return e.on("error",r),!t.sync&&PT&&(Xv.register(e,FT),e.on("close",function(){Xv.unregister(e);})),e;function r(n){if(n.code==="EPIPE"){e.write=dn,e.end=dn,e.flushSync=dn,e.destroy=dn;return}e.removeListener("error",r),e.emit("error",n);}}function FT(t,e){t.destroyed||(e==="beforeExit"?(t.flush(),t.on("drain",function(){t.end();})):t.flushSync());}function qT(t){return function(r,n,s={},i){if(typeof s=="string")i=Vs({dest:s}),s={};else if(typeof i=="string"){if(s&&s.transport)throw Error("only one of option.transport or stream can be specified");i=Vs({dest:i});}else if(s instanceof tu||s.writable||s._writableState)i=s,s={};else if(s.transport){if(s.transport instanceof tu||s.transport.writable||s.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(s.transport.targets&&s.transport.targets.length&&s.formatters&&typeof s.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let c;s.customLevels&&(c=s.useOnlyCustomLevels?s.customLevels:Object.assign({},s.levels,s.customLevels)),i=TT({caller:n,...s.transport,levels:c});}if(s=Object.assign({},t,s),s.serializers=Object.assign({},t.serializers,s.serializers),s.formatters=Object.assign({},t.formatters,s.formatters),s.prettyPrint)throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");let{enabled:o,onChild:l}=s;return o===!1&&(s.level="silent"),l||(s.onChild=dn),i||(LT(process.stdout)?i=process.stdout:i=Vs({fd:process.stdout.fd||1})),{opts:s,stream:i}}}function DT(t,e){try{return JSON.stringify(t)}catch{try{return (e||this[ru])(t)}catch{return '"[unable to serialize, circular reference is too complex to analyze]"'}}}function NT(t,e,r){return {level:t,bindings:e,log:r}}function MT(t){let e=Number(t);return typeof t=="string"&&Number.isFinite(e)?e:t===void 0?1:t}ow.exports={noop:dn,buildSafeSonicBoom:Vs,asChindings:kT,asJson:IT,genLog:$T,createArgsNormalizer:qT,stringify:DT,buildFormatters:NT,normalizeDestFileDescriptor:MT};});var Js=R((sM,lw)=>{var{lsCacheSym:jT,levelValSym:nu,useOnlyCustomLevelsSym:BT,streamSym:HT,formattersSym:UT,hooksSym:WT}=hn(),{noop:zT,genLog:Ir}=Ys(),_t={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},aw={fatal:t=>{let e=Ir(_t.fatal,t);return function(...r){let n=this[HT];if(e.call(this,...r),typeof n.flushSync=="function")try{n.flushSync();}catch{}}},error:t=>Ir(_t.error,t),warn:t=>Ir(_t.warn,t),info:t=>Ir(_t.info,t),debug:t=>Ir(_t.debug,t),trace:t=>Ir(_t.trace,t)},iu=Object.keys(_t).reduce((t,e)=>(t[_t[e]]=e,t),{}),GT=Object.keys(iu).reduce((t,e)=>(t[e]='{"level":'+Number(e),t),{});function KT(t){let e=t[UT].level,{labels:r}=t.levels,n={};for(let s in r){let i=e(r[s],Number(s));n[s]=JSON.stringify(i).slice(0,-1);}return t[jT]=n,t}function VT(t,e){if(e)return !1;switch(t){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return !0;default:return !1}}function YT(t){let{labels:e,values:r}=this.levels;if(typeof t=="number"){if(e[t]===void 0)throw Error("unknown level value"+t);t=e[t];}if(r[t]===void 0)throw Error("unknown level "+t);let n=this[nu],s=this[nu]=r[t],i=this[BT],o=this[WT].logMethod;for(let l in r){if(s>r[l]){this[l]=zT;continue}this[l]=VT(l,i)?aw[l](o):Ir(r[l],o);}this.emit("level-change",t,s,e[n],n,this);}function JT(t){let{levels:e,levelVal:r}=this;return e&&e.labels?e.labels[r]:""}function XT(t){let{values:e}=this.levels,r=e[t];return r!==void 0&&r>=this[nu]}function QT(t=null,e=!1){let r=t?Object.keys(t).reduce((i,o)=>(i[t[o]]=o,i),{}):null,n=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),e?null:iu,r),s=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),e?null:_t,t);return {labels:n,values:s}}function ZT(t,e,r){if(typeof t=="number"){if(![].concat(Object.keys(e||{}).map(i=>e[i]),r?[]:Object.keys(iu).map(i=>+i),1/0).includes(t))throw Error(`default level:${t} must be included in custom levels`);return}let n=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),r?null:_t,e);if(!(t in n))throw Error(`default level:${t} must be included in custom levels`)}function e$(t,e){let{labels:r,values:n}=t;for(let s in e){if(s in n)throw Error("levels cannot be overridden");if(e[s]in r)throw Error("pre-existing level values cannot be used for new levels")}}lw.exports={initialLsCache:GT,genLsCache:KT,levelMethods:aw,getLevel:JT,setLevel:YT,isLevelEnabled:XT,mappings:QT,levels:_t,assertNoLevelCollisions:e$,assertDefaultLevelFound:ZT};});var su=R((oM,uw)=>{uw.exports={version:"8.15.1"};});var Sw=R((lM,ww)=>{var{EventEmitter:t$}=z("events"),{lsCacheSym:r$,levelValSym:n$,setLevelSym:au,getLevelSym:cw,chindingsSym:lu,parsedChindingsSym:i$,mixinSym:s$,asJsonSym:gw,writeSym:o$,mixinMergeStrategySym:a$,timeSym:l$,timeSliceIndexSym:u$,streamSym:yw,serializersSym:kr,formattersSym:ou,errorKeySym:c$,messageKeySym:f$,useOnlyCustomLevelsSym:h$,needsMetadataGsym:p$,redactFmtSym:d$,stringifySym:g$,formatOptsSym:y$,stringifiersSym:m$,msgPrefixSym:fw}=hn(),{getLevel:v$,setLevel:w$,isLevelEnabled:S$,mappings:b$,initialLsCache:E$,genLsCache:A$,assertNoLevelCollisions:_$}=Js(),{asChindings:mw,asJson:x$,buildFormatters:hw,stringify:pw}=Ys(),{version:C$}=su(),R$=Bl(),O$=class{},vw={constructor:O$,child:P$,bindings:T$,setBindings:$$,flush:F$,isLevelEnabled:S$,version:C$,get level(){return this[cw]()},set level(t){this[au](t);},get levelVal(){return this[n$]},set levelVal(t){throw Error("levelVal is read-only")},[r$]:E$,[o$]:k$,[gw]:x$,[cw]:v$,[au]:w$};Object.setPrototypeOf(vw,t$.prototype);ww.exports=function(){return Object.create(vw)};var dw=t=>t;function P$(t,e){if(!t)throw Error("missing bindings for child Pino");e=e||{};let r=this[kr],n=this[ou],s=Object.create(this);if(e.hasOwnProperty("serializers")===!0){s[kr]=Object.create(null);for(let u in r)s[kr][u]=r[u];let c=Object.getOwnPropertySymbols(r);for(var i=0;i{var{hasOwnProperty:Xs}=Object.prototype,Fr=fu();Fr.configure=fu;Fr.stringify=Fr;Fr.default=Fr;hu.stringify=Fr;hu.configure=fu;_w.exports=Fr;var q$=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;function gr(t){return t.length<5e3&&!q$.test(t)?`"${t}"`:JSON.stringify(t)}function uu(t){if(t.length>200)return t.sort();for(let e=1;er;)t[n]=t[n-1],n--;t[n]=r;}return t}var D$=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function cu(t){return D$.call(t)!==void 0&&t.length!==0}function bw(t,e,r){t.length= 1`)}return r===void 0?1/0:r}function Lr(t){return t===1?"1 item":`${t} items`}function M$(t){let e=new Set;for(let r of t)(typeof r=="string"||typeof r=="number")&&e.add(String(r));return e}function j$(t){if(Xs.call(t,"strict")){let e=t.strict;if(typeof e!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(e)return r=>{let n=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(n+=` (${r.toString()})`),new Error(n)}}}function fu(t){t={...t};let e=j$(t);e&&(t.bigint===void 0&&(t.bigint=!1),"circularValue"in t||(t.circularValue=Error));let r=N$(t),n=Ew(t,"bigint"),s=Ew(t,"deterministic"),i=Aw(t,"maximumDepth"),o=Aw(t,"maximumBreadth");function l(y,m,v,b,_,x){let A=m[y];switch(typeof A=="object"&&A!==null&&typeof A.toJSON=="function"&&(A=A.toJSON(y)),A=b.call(m,y,A),typeof A){case"string":return gr(A);case"object":{if(A===null)return "null";if(v.indexOf(A)!==-1)return r;let O="",I=",",F=x;if(Array.isArray(A)){if(A.length===0)return "[]";if(io){let se=A.length-o-1;O+=`${I}"... ${Lr(se)} not stringified"`;}return _!==""&&(O+=` +${F}`),v.pop(),`[${O}]`}let U=Object.keys(A),H=U.length;if(H===0)return "{}";if(io){let C=H-o;O+=`${k}"...":${q}"${Lr(C)} not stringified"`,k=I;}return _!==""&&k.length>1&&(O=` +${x}${O} +${F}`),v.pop(),`{${O}}`}case"number":return isFinite(A)?String(A):e?e(A):"null";case"boolean":return A===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(A);default:return e?e(A):void 0}}function c(y,m,v,b,_,x){switch(typeof m=="object"&&m!==null&&typeof m.toJSON=="function"&&(m=m.toJSON(y)),typeof m){case"string":return gr(m);case"object":{if(m===null)return "null";if(v.indexOf(m)!==-1)return r;let A=x,O="",I=",";if(Array.isArray(m)){if(m.length===0)return "[]";if(io){let j=m.length-o-1;O+=`${I}"... ${Lr(j)} not stringified"`;}return _!==""&&(O+=` +${A}`),v.pop(),`[${O}]`}v.push(m);let F="";_!==""&&(x+=_,I=`, +${x}`,F=" ");let U="";for(let H of b){let q=c(H,m[H],v,b,_,x);q!==void 0&&(O+=`${U}${gr(H)}:${F}${q}`,U=I);}return _!==""&&U.length>1&&(O=` +${x}${O} +${A}`),v.pop(),`{${O}}`}case"number":return isFinite(m)?String(m):e?e(m):"null";case"boolean":return m===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(m);default:return e?e(m):void 0}}function p(y,m,v,b,_){switch(typeof m){case"string":return gr(m);case"object":{if(m===null)return "null";if(typeof m.toJSON=="function"){if(m=m.toJSON(y),typeof m!="object")return p(y,m,v,b,_);if(m===null)return "null"}if(v.indexOf(m)!==-1)return r;let x=_;if(Array.isArray(m)){if(m.length===0)return "[]";if(io){let Y=m.length-o-1;q+=`${k}"... ${Lr(Y)} not stringified"`;}return q+=` +${x}`,v.pop(),`[${q}]`}let A=Object.keys(m),O=A.length;if(O===0)return "{}";if(io){let q=O-o;F+=`${U}"...": "${Lr(q)} not stringified"`,U=I;}return U!==""&&(F=` +${_}${F} +${x}`),v.pop(),`{${F}}`}case"number":return isFinite(m)?String(m):e?e(m):"null";case"boolean":return m===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(m);default:return e?e(m):void 0}}function u(y,m,v){switch(typeof m){case"string":return gr(m);case"object":{if(m===null)return "null";if(typeof m.toJSON=="function"){if(m=m.toJSON(y),typeof m!="object")return u(y,m,v);if(m===null)return "null"}if(v.indexOf(m)!==-1)return r;let b="";if(Array.isArray(m)){if(m.length===0)return "[]";if(io){let H=m.length-o-1;b+=`,"... ${Lr(H)} not stringified"`;}return v.pop(),`[${b}]`}let _=Object.keys(m),x=_.length;if(x===0)return "{}";if(io){let I=x-o;b+=`${A}"...":"${Lr(I)} not stringified"`;}return v.pop(),`{${b}}`}case"number":return isFinite(m)?String(m):e?e(m):"null";case"boolean":return m===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(m);default:return e?e(m):void 0}}function g(y,m,v){if(arguments.length>1){let b="";if(typeof v=="number"?b=" ".repeat(Math.min(v,10)):typeof v=="string"&&(b=v.slice(0,10)),m!=null){if(typeof m=="function")return l("",{"":y},[],m,b,"");if(Array.isArray(m))return c("",y,[],M$(m),b,"")}if(b.length!==0)return p("",y,[],b,"")}return u("",y,[])}return g}});var Ow=R((uM,Rw)=>{var pu=Symbol.for("pino.metadata"),{levels:Cw}=Js(),B$=Cw.info;function H$(t,e){let r=0;t=t||[],e=e||{dedupe:!1};let n=Object.create(Cw);n.silent=1/0,e.levels&&typeof e.levels=="object"&&Object.keys(e.levels).forEach(u=>{n[u]=e.levels[u];});let s={write:i,add:l,flushSync:o,end:c,minLevel:0,streams:[],clone:p,[pu]:!0,streamLevels:n};return Array.isArray(t)?t.forEach(l,s):l.call(s,t),t=null,s;function i(u){let g,y=this.lastLevel,{streams:m}=this,v=0,b;for(let _=W$(m.length,e.dedupe);G$(_,m.length,e.dedupe);_=z$(_,e.dedupe))if(g=m[_],g.level<=y){if(v!==0&&v!==g.level)break;if(b=g.stream,b[pu]){let{lastTime:x,lastMsg:A,lastObj:O,lastLogger:I}=this;b.lastLevel=y,b.lastTime=x,b.lastMsg=A,b.lastObj=O,b.lastLogger=I;}b.write(u),e.dedupe&&(v=g.level);}else if(!e.dedupe)break}function o(){for(let{stream:u}of this.streams)typeof u.flushSync=="function"&&u.flushSync();}function l(u){if(!u)return s;let g=typeof u.write=="function"||u.stream,y=u.write?u:u.stream;if(!g)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:m,streamLevels:v}=this,b;typeof u.levelVal=="number"?b=u.levelVal:typeof u.level=="string"?b=v[u.level]:typeof u.level=="number"?b=u.level:b=B$;let _={stream:y,level:b,levelVal:void 0,id:r++};return m.unshift(_),m.sort(U$),this.minLevel=m[0].level,s}function c(){for(let{stream:u}of this.streams)typeof u.flushSync=="function"&&u.flushSync(),u.end();}function p(u){let g=new Array(this.streams.length);for(let y=0;y=0:t{var K$=z("os"),qw=kl(),V$=Ll(),Y$=Bl(),Dw=xv(),J$=Sw(),Nw=hn(),{configure:X$}=xw(),{assertDefaultLevelFound:Q$,mappings:Mw,genLsCache:Z$,levels:eI}=Js(),{createArgsNormalizer:tI,asChindings:rI,buildSafeSonicBoom:Pw,buildFormatters:nI,stringify:du,normalizeDestFileDescriptor:Tw,noop:iI}=Ys(),{version:sI}=su(),{chindingsSym:$w,redactFmtSym:oI,serializersSym:Iw,timeSym:aI,timeSliceIndexSym:lI,streamSym:uI,stringifySym:kw,stringifySafeSym:gu,stringifiersSym:Lw,setLevelSym:cI,endSym:fI,formatOptsSym:hI,messageKeySym:pI,errorKeySym:dI,nestedKeySym:gI,mixinSym:yI,useOnlyCustomLevelsSym:mI,formattersSym:Fw,hooksSym:vI,nestedKeyStrSym:wI,mixinMergeStrategySym:SI,msgPrefixSym:bI}=Nw,{epochTime:jw,nullTime:EI}=Dw,{pid:AI}=process,_I=K$.hostname(),xI=qw.err,CI={level:"info",levels:eI,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:AI,hostname:_I},serializers:Object.assign(Object.create(null),{err:xI}),formatters:Object.assign(Object.create(null),{bindings(t){return t},level(t,e){return {level:e}}}),hooks:{logMethod:void 0},timestamp:jw,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},RI=tI(CI),OI=Object.assign(Object.create(null),qw);function yu(...t){let e={},{opts:r,stream:n}=RI(e,V$(),...t),{redact:s,crlf:i,serializers:o,timestamp:l,messageKey:c,errorKey:p,nestedKey:u,base:g,name:y,level:m,customLevels:v,mixin:b,mixinMergeStrategy:_,useOnlyCustomLevels:x,formatters:A,hooks:O,depthLimit:I,edgeLimit:F,onChild:U,msgPrefix:H}=r,q=X$({maximumDepth:I,maximumBreadth:F}),k=nI(A.level,A.bindings,A.log),j=du.bind({[gu]:q}),C=s?Y$(s,j):{},V=s?{stringify:C[oI]}:{stringify:j},Y="}"+(i?`\r `:` -`),oe=eF.bind(null,{[tv]:"",[rv]:o,[iv]:C,[nv]:Pl,[Il]:B,[sv]:k}),P="";d!==null&&(g===void 0?P=oe(d):P=oe(Object.assign({},d,{name:g})));let I=u instanceof Function?u:u?cv:SF,re=I().indexOf(":")+1;if(R&&!w)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(E&&typeof E!="function")throw Error(`Unknown mixin type "${typeof E}" - expected "function"`);if(H&&typeof H!="string")throw Error(`Unknown msgPrefix type "${typeof H}" - expected "string"`);J$(m,w,R);let Z=lv(w,R);return Object.assign(e,{levels:Z,[yF]:R,[aF]:n,[sF]:I,[oF]:re,[nv]:Pl,[Il]:B,[iv]:C,[lF]:J,[cF]:Y,[fF]:c,[hF]:p,[pF]:l,[mF]:l?`,${JSON.stringify(l)}:{`:"",[rv]:o,[dF]:E,[wF]:A,[tv]:P,[sv]:k,[gF]:O,silent:rF,onChild:W,[vF]:H}),Object.setPrototypeOf(e,K$()),X$(e),e[uF](m),e}Et.exports=$l;Et.exports.destination=(t=process.stdout.fd)=>typeof t=="object"?(t.dest=ev(t.dest||process.stdout.fd),Z0(t)):Z0({dest:ev(t),minLength:0});Et.exports.transport=yl();Et.exports.multistream=Q0();Et.exports.levels=lv();Et.exports.stdSerializers=CF;Et.exports.stdTimeFunctions=Object.assign({},av);Et.exports.symbols=uv;Et.exports.version=nF;Et.exports.default=$l;Et.exports.pino=$l;});var wv={};sa(wv,{RotatingFileStream:()=>po,RotatingFileStreamError:()=>vi,createStream:()=>zF});async function pv(t){return new Promise(e=>fs.access(t,fs.constants.F_OK,r=>e(!r)))}function dv(t){return (e,r,n)=>{let s=parseInt(n,10);if(e!=="number"||s!==n||s<=0)throw new Error(`'${t}' option must be a positive integer number`)}}function kl(t,e){return (r,n,s)=>{if(r!=="string")throw new Error(`Don't know how to handle 'options.${t}' type: ${r}`);n[t]=e(s);}}function mv(t,e,r){let n={};if(n.num=parseInt(t,10),isNaN(n.num))throw new Error(`Unknown 'options.${e}' format: ${t}`);if(n.num<=0)throw new Error(`A positive integer number is expected for 'options.${e}'`);if(n.unit=t.replace(/^[ 0]*/g,"").substr((n.num+"").length,1),n.unit.length===0)throw new Error(`Missing unit for 'options.${e}'`);if(!r[n.unit])throw new Error(`Unknown 'options.${e}' unit: ${n.unit}`);return n}function Ll(t,e,r){if(parseInt(r/t.num,10)*t.num!==r)throw new Error(`An integer divider of ${r} is expected as ${e} for 'options.interval'`)}function MF(t){let e=mv(t,"interval",NF);switch(e.unit){case"h":Ll(e,"hours",24);break;case"m":Ll(e,"minutes",60);break;case"s":Ll(e,"seconds",60);break}return e}function yv(t){let e=mv(t,"size",UF);return e.unit==="K"?e.num*1024:e.unit==="M"?e.num*1048576:e.unit==="G"?e.num*1073741824:e.num}function jF(t){let e={};for(let r in t){let n=t[r],s=typeof n;if(!(r in gv))throw new Error(`Unknown option: ${r}`);e[r]=t[r],gv[r](s,e,n);}return e.path||(e.path=""),e.interval||(delete e.immutable,delete e.initialRotation,delete e.intervalBoundary),e.rotate&&(delete e.history,delete e.immutable,delete e.maxFiles,delete e.maxSize,delete e.intervalBoundary),e.immutable&&delete e.compress,e.intervalBoundary||delete e.initialRotation,e}function HF(t,e,r){return n=>n?`${t}.${n}${e&&!r?".gz":""}`:t}function WF(t,e,r){let n=s=>(s>9?"":"0")+s;return (s,i)=>{if(!s)return t;let o=s.getFullYear()+""+n(s.getMonth()+1),u=n(s.getDate()),c=n(s.getHours()),p=n(s.getMinutes());return o+u+"-"+c+p+"-"+n(i)+"-"+t+(e&&!r?".gz":"")}}function zF(t,e){if(typeof e>"u")e={};else if(typeof e!="object")throw new Error(`The "options" argument must be of type object. Received type ${typeof e}`);let r=jF(e),{compress:n,omitExtension:s}=r,i;if(typeof t=="string")i=e.rotate?HF(t,n!==void 0,s):WF(t,n!==void 0,s);else if(typeof t=="function")i=t;else throw new Error(`The "filename" argument must be one of type string or function. Received type ${typeof t}`);return new po(i,r)}var vi,po,NF,UF,gv,vv=Ji(()=>{vi=class extends Error{constructor(){super("Too many destination file attempts");ie(this,"code","RFS-TOO-MANY");}},po=class extends stream.Writable{constructor(r,n){let{encoding:s,history:i,maxFiles:o,maxSize:u,path:c}=n;super({decodeStrings:!0,defaultEncoding:s});ie(this,"createGzip");ie(this,"exec");ie(this,"file");ie(this,"filename");ie(this,"finished");ie(this,"fsCreateReadStream");ie(this,"fsCreateWriteStream");ie(this,"fsOpen");ie(this,"fsReadFile");ie(this,"fsStat");ie(this,"fsUnlink");ie(this,"generator");ie(this,"initPromise");ie(this,"last");ie(this,"maxTimeout");ie(this,"next");ie(this,"options");ie(this,"prev");ie(this,"rotation");ie(this,"size");ie(this,"stdout");ie(this,"timeout");ie(this,"timeoutPromise");this.createGzip=zlib.createGzip,this.exec=child_process.exec,this.filename=c+r(null),this.fsCreateReadStream=fs.createReadStream,this.fsCreateWriteStream=fs.createWriteStream,this.fsOpen=promises.open,this.fsReadFile=promises.readFile,this.fsStat=promises.stat,this.fsUnlink=promises.unlink,this.generator=r,this.maxTimeout=2147483640,this.options=n,this.stdout=process.stdout,(o||u)&&(n.history=c+(i||this.generator(null)+".txt")),this.on("close",()=>this.finished?null:this.emit("finish")),this.on("finish",()=>this.finished=this.clear()),(async()=>{try{this.initPromise=this.init(),await this.initPromise,delete this.initPromise;}catch{}})();}_destroy(r,n){this.refinal(r,n);}_final(r){this.refinal(void 0,r);}_write(r,n,s){this.rewrite([{chunk:r,encoding:n}],0,s);}_writev(r,n){this.rewrite(r,0,n);}async refinal(r,n){try{this.clear(),this.initPromise&&await this.initPromise,this.timeoutPromise&&await this.timeoutPromise,await this.reclose();}catch(s){return n(r||s)}n(r);}async rewrite(r,n,s){let{size:i,teeToStdout:o}=this.options;try{this.initPromise&&await this.initPromise;for(let u=0;u=i&&await this.rotate();}}catch(u){return s(u)}s();}async init(){let{immutable:r,initialRotation:n,interval:s,size:i}=this.options;if(r)return new Promise((u,c)=>process.nextTick(()=>this.immutate(!0).then(u).catch(c)));let o;try{o=await promises.stat(this.filename);}catch(u){if(u.code!=="ENOENT")throw u;return this.reopen(0)}if(!o.isFile())throw new Error(`Can't write on: ${this.filename} (it is not a file)`);if(n){this.intervalBounds(this.now());let u=this.prev;if(this.intervalBounds(new Date(o.mtime.getTime())),u!==this.prev)return this.rotate()}return this.size=o.size,!i||o.size0;--o){let u=n+this.generator(o),c=o===1?this.filename:n+this.generator(o-1);if(await pv(c))if(i||(i=u),o===1&&r)await this.compress(u);else try{await promises.rename(c,u);}catch(p){if(p.code!=="ENOENT")throw p;await this.makePath(u),await promises.rename(c,u);}}return this.rotated(i)}clear(){return this.timeout&&(clearTimeout(this.timeout),this.timeout=null),!0}intervalBoundsBig(r){let n=r.getFullYear(),s=r.getMonth(),i=r.getDate(),o=r.getHours(),{num:u,unit:c}=this.options.interval;c==="M"?(i=1,o=0):c==="d"?o=0:o=parseInt(o/u,10)*u,this.prev=new Date(n,s,i,o,0,0,0).getTime(),c==="M"?s+=u:c==="d"?i+=u:o+=u,this.next=new Date(n,s,i,o,0,0,0).getTime();}intervalBounds(r){let n=this.options.interval.unit;if(n==="M"||n==="d"||n==="h")this.intervalBoundsBig(r);else {let s=1e3*this.options.interval.num;n==="m"&&(s*=60),this.prev=parseInt(r.getTime()/s,10)*s,this.next=this.prev+s;}return new Date(this.prev)}interval(){if(!this.options.interval)return;this.intervalBounds(this.now());let r=async()=>{let n=this.next-this.now().getTime();if(n<=0)try{this.timeoutPromise=this.rotate(),await this.timeoutPromise,delete this.timeoutPromise;}catch{}else this.timeout=setTimeout(r,n>this.maxTimeout?this.maxTimeout:n),this.timeout.unref();};r();}async compress(r){let{compress:n}=this.options;return typeof n=="function"?await new Promise((s,i)=>{this.exec(n(this.filename,r),(o,u,c)=>{this.emit("external",u,c),o?i(o):s();});}):await this.gzip(r),this.unlink(this.filename)}async gzip(r){let{mode:n}=this.options,s=n?{mode:n}:{},i=this.fsCreateReadStream(this.filename,{}),o=this.fsCreateWriteStream(r,s),u=this.createGzip();return new Promise((c,p)=>{[i,o,u].map(l=>l.once("error",p)),o.once("finish",c),i.pipe(u).pipe(o);})}async rotated(r){let{maxFiles:n,maxSize:s}=this.options;return (n||s)&&await this.history(r),this.emit("rotated",r),this.reopen(0)}async history(r){let{history:n,maxFiles:s,maxSize:i}=this.options,o=[],u=[r];try{u=[...(await this.fsReadFile(n,"utf8")).toString().split(` -`),r];}catch(c){if(c.code!=="ENOENT")throw c}for(let c of u)if(c)try{let p=await this.fsStat(c);p.isFile()?o.push({name:c,size:p.size,time:p.ctime.getTime()}):this.emit("warning",new Error(`File '${c}' contained in history is not a regular file`));}catch(p){if(p.code!=="ENOENT")throw p}if(o.sort((c,p)=>c.time-p.time),s)for(;o.length>s;){let c=o.shift();await this.unlink(c.name),this.emit("removed",c.name,!0);}if(i)for(;o.reduce((c,p)=>c+p.size,0)>i;){let c=o.shift();await this.unlink(c.name),this.emit("removed",c.name,!1);}await promises.writeFile(n,o.map(c=>c.name).join(` +`),se=rI.bind(null,{[$w]:"",[Iw]:o,[Lw]:C,[kw]:du,[gu]:q,[Fw]:k}),T="";g!==null&&(y===void 0?T=se(g):T=se(Object.assign({},g,{name:y})));let $=l instanceof Function?l:l?jw:EI,te=$().indexOf(":")+1;if(x&&!v)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(b&&typeof b!="function")throw Error(`Unknown mixin type "${typeof b}" - expected "function"`);if(H&&typeof H!="string")throw Error(`Unknown msgPrefix type "${typeof H}" - expected "string"`);Q$(m,v,x);let Q=Mw(v,x);return Object.assign(e,{levels:Q,[mI]:x,[uI]:n,[aI]:$,[lI]:te,[kw]:du,[gu]:q,[Lw]:C,[fI]:Y,[hI]:V,[pI]:c,[dI]:p,[gI]:u,[wI]:u?`,${JSON.stringify(u)}:{`:"",[Iw]:o,[yI]:b,[SI]:_,[$w]:T,[Fw]:k,[vI]:O,silent:iI,onChild:U,[bI]:H}),Object.setPrototypeOf(e,J$()),Z$(e),e[cI](m),e}vt.exports=yu;vt.exports.destination=(t=process.stdout.fd)=>typeof t=="object"?(t.dest=Tw(t.dest||process.stdout.fd),Pw(t)):Pw({dest:Tw(t),minLength:0});vt.exports.transport=Zl();vt.exports.multistream=Ow();vt.exports.levels=Mw();vt.exports.stdSerializers=OI;vt.exports.stdTimeFunctions=Object.assign({},Dw);vt.exports.symbols=Nw;vt.exports.version=sI;vt.exports.default=yu;vt.exports.pino=yu;});var Vw={};Wo(Vw,{RotatingFileStream:()=>eo,RotatingFileStreamError:()=>ai,createStream:()=>KI});async function Uw(t){return new Promise(e=>fs.access(t,fs.constants.F_OK,r=>e(!r)))}function Ww(t){return (e,r,n)=>{let s=parseInt(n,10);if(e!=="number"||s!==n||s<=0)throw new Error(`'${t}' option must be a positive integer number`)}}function vu(t,e){return (r,n,s)=>{if(r!=="string")throw new Error(`Don't know how to handle 'options.${t}' type: ${r}`);n[t]=e(s);}}function Kw(t,e,r){let n={};if(n.num=parseInt(t,10),isNaN(n.num))throw new Error(`Unknown 'options.${e}' format: ${t}`);if(n.num<=0)throw new Error(`A positive integer number is expected for 'options.${e}'`);if(n.unit=t.replace(/^[ 0]*/g,"").substr((n.num+"").length,1),n.unit.length===0)throw new Error(`Missing unit for 'options.${e}'`);if(!r[n.unit])throw new Error(`Unknown 'options.${e}' unit: ${n.unit}`);return n}function wu(t,e,r){if(parseInt(r/t.num,10)*t.num!==r)throw new Error(`An integer divider of ${r} is expected as ${e} for 'options.interval'`)}function HI(t){let e=Kw(t,"interval",BI);switch(e.unit){case"h":wu(e,"hours",24);break;case"m":wu(e,"minutes",60);break;case"s":wu(e,"seconds",60);break}return e}function zw(t){let e=Kw(t,"size",UI);return e.unit==="K"?e.num*1024:e.unit==="M"?e.num*1048576:e.unit==="G"?e.num*1073741824:e.num}function WI(t){let e={};for(let r in t){let n=t[r],s=typeof n;if(!(r in Gw))throw new Error(`Unknown option: ${r}`);e[r]=t[r],Gw[r](s,e,n);}return e.path||(e.path=""),e.interval||(delete e.immutable,delete e.initialRotation,delete e.intervalBoundary),e.rotate&&(delete e.history,delete e.immutable,delete e.maxFiles,delete e.maxSize,delete e.intervalBoundary),e.immutable&&delete e.compress,e.intervalBoundary||delete e.initialRotation,e}function zI(t,e,r){return n=>n?`${t}.${n}${e&&!r?".gz":""}`:t}function GI(t,e,r){let n=s=>(s>9?"":"0")+s;return (s,i)=>{if(!s)return t;let o=s.getFullYear()+""+n(s.getMonth()+1),l=n(s.getDate()),c=n(s.getHours()),p=n(s.getMinutes());return o+l+"-"+c+p+"-"+n(i)+"-"+t+(e&&!r?".gz":"")}}function KI(t,e){if(typeof e>"u")e={};else if(typeof e!="object")throw new Error(`The "options" argument must be of type object. Received type ${typeof e}`);let r=WI(e),{compress:n,omitExtension:s}=r,i;if(typeof t=="string")i=e.rotate?zI(t,n!==void 0,s):GI(t,n!==void 0,s);else if(typeof t=="function")i=t;else throw new Error(`The "filename" argument must be one of type string or function. Received type ${typeof t}`);return new eo(i,r)}var ai,eo,BI,UI,Gw,Yw=qi(()=>{ai=class extends Error{constructor(){super("Too many destination file attempts");ne(this,"code","RFS-TOO-MANY");}},eo=class extends stream.Writable{constructor(r,n){let{encoding:s,history:i,maxFiles:o,maxSize:l,path:c}=n;super({decodeStrings:!0,defaultEncoding:s});ne(this,"createGzip");ne(this,"exec");ne(this,"file");ne(this,"filename");ne(this,"finished");ne(this,"fsCreateReadStream");ne(this,"fsCreateWriteStream");ne(this,"fsOpen");ne(this,"fsReadFile");ne(this,"fsStat");ne(this,"fsUnlink");ne(this,"generator");ne(this,"initPromise");ne(this,"last");ne(this,"maxTimeout");ne(this,"next");ne(this,"options");ne(this,"prev");ne(this,"rotation");ne(this,"size");ne(this,"stdout");ne(this,"timeout");ne(this,"timeoutPromise");this.createGzip=zlib.createGzip,this.exec=child_process.exec,this.filename=c+r(null),this.fsCreateReadStream=fs.createReadStream,this.fsCreateWriteStream=fs.createWriteStream,this.fsOpen=promises.open,this.fsReadFile=promises.readFile,this.fsStat=promises.stat,this.fsUnlink=promises.unlink,this.generator=r,this.maxTimeout=2147483640,this.options=n,this.stdout=process.stdout,(o||l)&&(n.history=c+(i||this.generator(null)+".txt")),this.on("close",()=>this.finished?null:this.emit("finish")),this.on("finish",()=>this.finished=this.clear()),(async()=>{try{this.initPromise=this.init(),await this.initPromise,delete this.initPromise;}catch{}})();}_destroy(r,n){this.refinal(r,n);}_final(r){this.refinal(void 0,r);}_write(r,n,s){this.rewrite([{chunk:r,encoding:n}],0,s);}_writev(r,n){this.rewrite(r,0,n);}async refinal(r,n){try{this.clear(),this.initPromise&&await this.initPromise,this.timeoutPromise&&await this.timeoutPromise,await this.reclose();}catch(s){return n(r||s)}n(r);}async rewrite(r,n,s){let{size:i,teeToStdout:o}=this.options;try{this.initPromise&&await this.initPromise;for(let l=0;l=i&&await this.rotate();}}catch(l){return s(l)}s();}async init(){let{immutable:r,initialRotation:n,interval:s,size:i}=this.options;if(r)return new Promise((l,c)=>process.nextTick(()=>this.immutate(!0).then(l).catch(c)));let o;try{o=await promises.stat(this.filename);}catch(l){if(l.code!=="ENOENT")throw l;return this.reopen(0)}if(!o.isFile())throw new Error(`Can't write on: ${this.filename} (it is not a file)`);if(n){this.intervalBounds(this.now());let l=this.prev;if(this.intervalBounds(new Date(o.mtime.getTime())),l!==this.prev)return this.rotate()}return this.size=o.size,!i||o.size0;--o){let l=n+this.generator(o),c=o===1?this.filename:n+this.generator(o-1);if(await Uw(c))if(i||(i=l),o===1&&r)await this.compress(l);else try{await promises.rename(c,l);}catch(p){if(p.code!=="ENOENT")throw p;await this.makePath(l),await promises.rename(c,l);}}return this.rotated(i)}clear(){return this.timeout&&(clearTimeout(this.timeout),this.timeout=null),!0}intervalBoundsBig(r){let n=r.getFullYear(),s=r.getMonth(),i=r.getDate(),o=r.getHours(),{num:l,unit:c}=this.options.interval;c==="M"?(i=1,o=0):c==="d"?o=0:o=parseInt(o/l,10)*l,this.prev=new Date(n,s,i,o,0,0,0).getTime(),c==="M"?s+=l:c==="d"?i+=l:o+=l,this.next=new Date(n,s,i,o,0,0,0).getTime();}intervalBounds(r){let n=this.options.interval.unit;if(n==="M"||n==="d"||n==="h")this.intervalBoundsBig(r);else {let s=1e3*this.options.interval.num;n==="m"&&(s*=60),this.prev=parseInt(r.getTime()/s,10)*s,this.next=this.prev+s;}return new Date(this.prev)}interval(){if(!this.options.interval)return;this.intervalBounds(this.now());let r=async()=>{let n=this.next-this.now().getTime();if(n<=0)try{this.timeoutPromise=this.rotate(),await this.timeoutPromise,delete this.timeoutPromise;}catch{}else this.timeout=setTimeout(r,n>this.maxTimeout?this.maxTimeout:n),this.timeout.unref();};r();}async compress(r){let{compress:n}=this.options;return typeof n=="function"?await new Promise((s,i)=>{this.exec(n(this.filename,r),(o,l,c)=>{this.emit("external",l,c),o?i(o):s();});}):await this.gzip(r),this.unlink(this.filename)}async gzip(r){let{mode:n}=this.options,s=n?{mode:n}:{},i=this.fsCreateReadStream(this.filename,{}),o=this.fsCreateWriteStream(r,s),l=this.createGzip();return new Promise((c,p)=>{[i,o,l].map(u=>u.once("error",p)),o.once("finish",c),i.pipe(l).pipe(o);})}async rotated(r){let{maxFiles:n,maxSize:s}=this.options;return (n||s)&&await this.history(r),this.emit("rotated",r),this.reopen(0)}async history(r){let{history:n,maxFiles:s,maxSize:i}=this.options,o=[],l=[r];try{l=[...(await this.fsReadFile(n,"utf8")).toString().split(` +`),r];}catch(c){if(c.code!=="ENOENT")throw c}for(let c of l)if(c)try{let p=await this.fsStat(c);p.isFile()?o.push({name:c,size:p.size,time:p.ctime.getTime()}):this.emit("warning",new Error(`File '${c}' contained in history is not a regular file`));}catch(p){if(p.code!=="ENOENT")throw p}if(o.sort((c,p)=>c.time-p.time),s)for(;o.length>s;){let c=o.shift();await this.unlink(c.name),this.emit("removed",c.name,!0);}if(i)for(;o.reduce((c,p)=>c+p.size,0)>i;){let c=o.shift();await this.unlink(c.name),this.emit("removed",c.name,!1);}await promises.writeFile(n,o.map(c=>c.name).join(` `)+` -`,"utf-8"),this.emit("history");}async immutate(r){let{size:n}=this.options,s=this.now();for(let i=1;i<1e3;++i){let o=0,u;this.filename=this.options.path+this.generator(s,i);try{u=await this.fsStat(this.filename);}catch(c){if(c.code!=="ENOENT")throw c}if(u){if(o=u.size,!u.isFile())throw new Error(`Can't write on: '${this.filename}' (it is not a file)`);if(n&&o>=n)continue}if(r)return this.last=this.filename,this.reopen(o);await this.rotated(this.last),this.last=this.filename;return}throw new vi}async unlink(r){try{await this.fsUnlink(r);}catch(n){if(n.code!=="ENOENT")throw n;this.emit("warning",n);}}};NF={M:!0,d:!0,h:!0,m:!0,s:!0};UF={B:!0,G:!0,K:!0,M:!0};gv={encoding:(t,e,r)=>new util.TextDecoder(r),immutable:()=>{},initialRotation:()=>{},interval:kl("interval",MF),intervalBoundary:()=>{},maxFiles:dv("maxFiles"),maxSize:kl("maxSize",yv),mode:()=>{},omitExtension:()=>{},rotate:dv("rotate"),size:kl("size",yv),teeToStdout:()=>{},compress:(t,e,r)=>{if(!r)throw new Error("A value for 'options.compress' must be specified");if(t==="boolean")return e.compress=(n,s)=>`cat ${n} | gzip -c9 > ${s}`;if(t!=="function"){if(t!=="string")throw new Error(`Don't know how to handle 'options.compress' type: ${t}`);if(r!=="gzip")throw new Error(`Don't know how to handle compression method: ${r}`)}},history:t=>{if(t!=="string")throw new Error(`Don't know how to handle 'options.history' type: ${t}`)},path:(t,e,r)=>{if(t!=="string")throw new Error(`Don't know how to handle 'options.path' type: ${t}`);r[r.length-1]!==path.sep&&(e.path=r+path.sep);}};});var Ev={};sa(Ev,{allLoggers:()=>An,rootLogger:()=>Re});var ql,Sv,Re,An,Ut=Ji(()=>{ql=nn(fv());ui();Sv=(vv(),oa(wv)).createStream("tabby-agent.log",{path:G("path").join(G("os").homedir(),".tabby-client","agent","logs"),size:"10M",interval:"1d"}),Re=Sv?(0, ql.default)(Sv):(0, ql.default)();Re.level="silent";An=[Re];Re.onChild=t=>{An.push(t);};});var Av=_((uM,xv)=>{xv.exports=function(){function t(n,s){function i(){this.constructor=n;}i.prototype=s.prototype,n.prototype=new i;}function e(n,s,i,o,u,c){this.message=n,this.expected=s,this.found=i,this.offset=o,this.line=u,this.column=c,this.name="SyntaxError";}t(e,Error);function r(n){var s=arguments.length>1?arguments[1]:{},i={},o={start:If},u=If,p=function(){return Jf},l=i,d="#",g={type:"literal",value:"#",description:'"#"'},m=void 0,w={type:"any",description:"any character"},E="[",A={type:"literal",value:"[",description:'"["'},R="]",x={type:"literal",value:"]",description:'"]"'},O=function(a){na(je("ObjectPath",a,Me,Ue));},F=function(a){na(je("ArrayPath",a,Me,Ue));},q=function(a,h){return a.concat(h)},W=function(a){return [a]},H=function(a){return a},B=".",k={type:"literal",value:".",description:'"."'},U="=",C={type:"literal",value:"=",description:'"="'},Y=function(a,h){na(je("Assign",h,Me,Ue,a));},J=function(a){return a.join("")},oe=function(a){return a.value},P='"""',I={type:"literal",value:'"""',description:'"\\"\\"\\""'},re=null,Z=function(a){return je("String",a.join(""),Me,Ue)},ce='"',Ke={type:"literal",value:'"',description:'"\\""'},Te="'''",sr={type:"literal",value:"'''",description:`"'''"`},jn="'",or={type:"literal",value:"'",description:`"'"`},_t=function(a){return a},fe=function(a){return a},en="\\",Jo={type:"literal",value:"\\",description:'"\\\\"'},K=function(){return ""},me="e",z={type:"literal",value:"e",description:'"e"'},le="E",ve={type:"literal",value:"E",description:'"E"'},Ne=function(a,h){return je("Float",parseFloat(a+"e"+h),Me,Ue)},_e=function(a){return je("Float",parseFloat(a),Me,Ue)},Tr="+",ar={type:"literal",value:"+",description:'"+"'},uf=function(a){return a.join("")},Hn="-",Wn={type:"literal",value:"-",description:'"-"'},lf=function(a){return "-"+a.join("")},TE=function(a){return je("Integer",parseInt(a,10),Me,Ue)},cf="true",PE={type:"literal",value:"true",description:'"true"'},IE=function(){return je("Boolean",!0,Me,Ue)},ff="false",$E={type:"literal",value:"false",description:'"false"'},FE=function(){return je("Boolean",!1,Me,Ue)},kE=function(){return je("Array",[],Me,Ue)},LE=function(a){return je("Array",a?[a]:[],Me,Ue)},qE=function(a){return je("Array",a,Me,Ue)},BE=function(a,h){return je("Array",a.concat(h),Me,Ue)},hf=function(a){return a},pf=",",df={type:"literal",value:",",description:'","'},DE="{",NE={type:"literal",value:"{",description:'"{"'},ME="}",UE={type:"literal",value:"}",description:'"}"'},jE=function(a){return je("InlineTable",a,Me,Ue)},yf=function(a,h){return je("InlineTableValue",h,Me,Ue,a)},HE=function(a){return "."+a},WE=function(a){return a.join("")},zn=":",Gn={type:"literal",value:":",description:'":"'},gf=function(a){return a.join("")},mf="T",wf={type:"literal",value:"T",description:'"T"'},zE="Z",GE={type:"literal",value:"Z",description:'"Z"'},VE=function(a,h){return je("Date",new Date(a+"T"+h+"Z"),Me,Ue)},KE=function(a,h){return je("Date",new Date(a+"T"+h),Me,Ue)},YE=/^[ \t]/,JE={type:"class",value:"[ \\t]",description:"[ \\t]"},vf=` -`,Sf={type:"literal",value:` -`,description:'"\\n"'},XE="\r",QE={type:"literal",value:"\r",description:'"\\r"'},ZE=/^[0-9a-f]/i,ex={type:"class",value:"[0-9a-f]i",description:"[0-9a-f]i"},tx=/^[0-9]/,rx={type:"class",value:"[0-9]",description:"[0-9]"},nx="_",ix={type:"literal",value:"_",description:'"_"'},sx=function(){return ""},ox=/^[A-Za-z0-9_\-]/,ax={type:"class",value:"[A-Za-z0-9_\\-]",description:"[A-Za-z0-9_\\-]"},ux=function(a){return a.join("")},bf='\\"',lx={type:"literal",value:'\\"',description:'"\\\\\\""'},cx=function(){return '"'},Ef="\\\\",fx={type:"literal",value:"\\\\",description:'"\\\\\\\\"'},hx=function(){return "\\"},xf="\\b",px={type:"literal",value:"\\b",description:'"\\\\b"'},dx=function(){return "\b"},Af="\\t",yx={type:"literal",value:"\\t",description:'"\\\\t"'},gx=function(){return " "},_f="\\n",mx={type:"literal",value:"\\n",description:'"\\\\n"'},wx=function(){return ` -`},Cf="\\f",vx={type:"literal",value:"\\f",description:'"\\\\f"'},Sx=function(){return "\f"},Rf="\\r",bx={type:"literal",value:"\\r",description:'"\\\\r"'},Ex=function(){return "\r"},Of="\\U",xx={type:"literal",value:"\\U",description:'"\\\\U"'},Tf=function(a){return Hx(a.join(""))},Pf="\\u",Ax={type:"literal",value:"\\u",description:'"\\\\u"'},f=0,X=0,Vn=0,Xo={line:1,column:1,seenCR:!1},zi=0,Qo=[],N=0,M={},Gi;if("startRule"in s){if(!(s.startRule in o))throw new Error(`Can't start parsing from rule "`+s.startRule+'".');u=o[s.startRule];}function Me(){return Zo(X).line}function Ue(){return Zo(X).column}function Zo(a){function h(y,v,b){var T,L;for(T=v;Ta&&(Vn=0,Xo={line:1,column:1,seenCR:!1}),h(Xo,Vn,a),Vn=a),Xo}function j(a){fzi&&(zi=f,Qo=[]),Qo.push(a));}function ea(a,h,y){function v(V){var se=1;for(V.sort(function(ye,pe){return ye.descriptionpe.description?1:0});se1?pe.slice(0,-1).join(", ")+" or "+pe[V.length-1]:pe[0],Ce=se?'"'+ye(se)+'"':"end of input","Expected "+Ee+" but "+Ce+" found."}var T=Zo(y),L=yf?(T=n.charAt(f),f++):(T=i,N===0&&j(w)),T!==i?(b=[b,T],v=b):(f=v,v=l)):(f=v,v=l);v!==i;)y.push(v),v=f,b=f,N++,T=vt(),T===i&&(T=Yi()),N--,T===i?b=m:(f=b,b=l),b!==i?(n.length>f?(T=n.charAt(f),f++):(T=i,N===0&&j(w)),T!==i?(b=[b,T],v=b):(f=v,v=l)):(f=v,v=l);y!==i?(h=[h,y],a=h):(f=a,a=l);}else f=a,a=l;return M[L]={nextPos:f,result:a},a}function Cx(){var a,h,y,v,b,T,L=f*49+4,V=M[L];if(V)return f=V.nextPos,V.result;if(a=f,n.charCodeAt(f)===91?(h=E,f++):(h=i,N===0&&j(A)),h!==i){for(y=[],v=Q();v!==i;)y.push(v),v=Q();if(y!==i)if(v=Ff(),v!==i){for(b=[],T=Q();T!==i;)b.push(T),T=Q();b!==i?(n.charCodeAt(f)===93?(T=R,f++):(T=i,N===0&&j(x)),T!==i?(X=a,h=O(v),a=h):(f=a,a=l)):(f=a,a=l);}else f=a,a=l;else f=a,a=l;}else f=a,a=l;return M[L]={nextPos:f,result:a},a}function Rx(){var a,h,y,v,b,T,L,V,se=f*49+5,ye=M[se];if(ye)return f=ye.nextPos,ye.result;if(a=f,n.charCodeAt(f)===91?(h=E,f++):(h=i,N===0&&j(A)),h!==i)if(n.charCodeAt(f)===91?(y=E,f++):(y=i,N===0&&j(A)),y!==i){for(v=[],b=Q();b!==i;)v.push(b),b=Q();if(v!==i)if(b=Ff(),b!==i){for(T=[],L=Q();L!==i;)T.push(L),L=Q();T!==i?(n.charCodeAt(f)===93?(L=R,f++):(L=i,N===0&&j(x)),L!==i?(n.charCodeAt(f)===93?(V=R,f++):(V=i,N===0&&j(x)),V!==i?(X=a,h=F(b),a=h):(f=a,a=l)):(f=a,a=l)):(f=a,a=l);}else f=a,a=l;else f=a,a=l;}else f=a,a=l;else f=a,a=l;return M[se]={nextPos:f,result:a},a}function Ff(){var a,h,y,v=f*49+6,b=M[v];if(b)return f=b.nextPos,b.result;if(a=f,h=[],y=Lf(),y!==i)for(;y!==i;)h.push(y),y=Lf();else h=l;return h!==i?(y=kf(),y!==i?(X=a,h=q(h,y),a=h):(f=a,a=l)):(f=a,a=l),a===i&&(a=f,h=kf(),h!==i&&(X=a,h=W(h)),a=h),M[v]={nextPos:f,result:a},a}function kf(){var a,h,y,v,b,T=f*49+7,L=M[T];if(L)return f=L.nextPos,L.result;for(a=f,h=[],y=Q();y!==i;)h.push(y),y=Q();if(h!==i)if(y=Kn(),y!==i){for(v=[],b=Q();b!==i;)v.push(b),b=Q();v!==i?(X=a,h=H(y),a=h):(f=a,a=l);}else f=a,a=l;else f=a,a=l;if(a===i){for(a=f,h=[],y=Q();y!==i;)h.push(y),y=Q();if(h!==i)if(y=ta(),y!==i){for(v=[],b=Q();b!==i;)v.push(b),b=Q();v!==i?(X=a,h=H(y),a=h):(f=a,a=l);}else f=a,a=l;else f=a,a=l;}return M[T]={nextPos:f,result:a},a}function Lf(){var a,h,y,v,b,T,L,V=f*49+8,se=M[V];if(se)return f=se.nextPos,se.result;for(a=f,h=[],y=Q();y!==i;)h.push(y),y=Q();if(h!==i)if(y=Kn(),y!==i){for(v=[],b=Q();b!==i;)v.push(b),b=Q();if(v!==i)if(n.charCodeAt(f)===46?(b=B,f++):(b=i,N===0&&j(k)),b!==i){for(T=[],L=Q();L!==i;)T.push(L),L=Q();T!==i?(X=a,h=H(y),a=h):(f=a,a=l);}else f=a,a=l;else f=a,a=l;}else f=a,a=l;else f=a,a=l;if(a===i){for(a=f,h=[],y=Q();y!==i;)h.push(y),y=Q();if(h!==i)if(y=ta(),y!==i){for(v=[],b=Q();b!==i;)v.push(b),b=Q();if(v!==i)if(n.charCodeAt(f)===46?(b=B,f++):(b=i,N===0&&j(k)),b!==i){for(T=[],L=Q();L!==i;)T.push(L),L=Q();T!==i?(X=a,h=H(y),a=h):(f=a,a=l);}else f=a,a=l;else f=a,a=l;}else f=a,a=l;else f=a,a=l;}return M[V]={nextPos:f,result:a},a}function Ox(){var a,h,y,v,b,T,L=f*49+9,V=M[L];if(V)return f=V.nextPos,V.result;if(a=f,h=Kn(),h!==i){for(y=[],v=Q();v!==i;)y.push(v),v=Q();if(y!==i)if(n.charCodeAt(f)===61?(v=U,f++):(v=i,N===0&&j(C)),v!==i){for(b=[],T=Q();T!==i;)b.push(T),T=Q();b!==i?(T=tn(),T!==i?(X=a,h=Y(h,T),a=h):(f=a,a=l)):(f=a,a=l);}else f=a,a=l;else f=a,a=l;}else f=a,a=l;if(a===i)if(a=f,h=ta(),h!==i){for(y=[],v=Q();v!==i;)y.push(v),v=Q();if(y!==i)if(n.charCodeAt(f)===61?(v=U,f++):(v=i,N===0&&j(C)),v!==i){for(b=[],T=Q();T!==i;)b.push(T),T=Q();b!==i?(T=tn(),T!==i?(X=a,h=Y(h,T),a=h):(f=a,a=l)):(f=a,a=l);}else f=a,a=l;else f=a,a=l;}else f=a,a=l;return M[L]={nextPos:f,result:a},a}function Kn(){var a,h,y,v=f*49+10,b=M[v];if(b)return f=b.nextPos,b.result;if(a=f,h=[],y=Kf(),y!==i)for(;y!==i;)h.push(y),y=Kf();else h=l;return h!==i&&(X=a,h=J(h)),a=h,M[v]={nextPos:f,result:a},a}function ta(){var a,h,y=f*49+11,v=M[y];return v?(f=v.nextPos,v.result):(a=f,h=qf(),h!==i&&(X=a,h=oe(h)),a=h,a===i&&(a=f,h=Bf(),h!==i&&(X=a,h=oe(h)),a=h),M[y]={nextPos:f,result:a},a)}function tn(){var a,h=f*49+12,y=M[h];return y?(f=y.nextPos,y.result):(a=Tx(),a===i&&(a=Mx(),a===i&&(a=Fx(),a===i&&(a=kx(),a===i&&(a=Lx(),a===i&&(a=qx(),a===i&&(a=Bx())))))),M[h]={nextPos:f,result:a},a)}function Tx(){var a,h=f*49+13,y=M[h];return y?(f=y.nextPos,y.result):(a=Px(),a===i&&(a=qf(),a===i&&(a=Ix(),a===i&&(a=Bf()))),M[h]={nextPos:f,result:a},a)}function Px(){var a,h,y,v,b,T=f*49+14,L=M[T];if(L)return f=L.nextPos,L.result;if(a=f,n.substr(f,3)===P?(h=P,f+=3):(h=i,N===0&&j(I)),h!==i)if(y=vt(),y===i&&(y=re),y!==i){for(v=[],b=Mf();b!==i;)v.push(b),b=Mf();v!==i?(n.substr(f,3)===P?(b=P,f+=3):(b=i,N===0&&j(I)),b!==i?(X=a,h=Z(v),a=h):(f=a,a=l)):(f=a,a=l);}else f=a,a=l;else f=a,a=l;return M[T]={nextPos:f,result:a},a}function qf(){var a,h,y,v,b=f*49+15,T=M[b];if(T)return f=T.nextPos,T.result;if(a=f,n.charCodeAt(f)===34?(h=ce,f++):(h=i,N===0&&j(Ke)),h!==i){for(y=[],v=Df();v!==i;)y.push(v),v=Df();y!==i?(n.charCodeAt(f)===34?(v=ce,f++):(v=i,N===0&&j(Ke)),v!==i?(X=a,h=Z(y),a=h):(f=a,a=l)):(f=a,a=l);}else f=a,a=l;return M[b]={nextPos:f,result:a},a}function Ix(){var a,h,y,v,b,T=f*49+16,L=M[T];if(L)return f=L.nextPos,L.result;if(a=f,n.substr(f,3)===Te?(h=Te,f+=3):(h=i,N===0&&j(sr)),h!==i)if(y=vt(),y===i&&(y=re),y!==i){for(v=[],b=Uf();b!==i;)v.push(b),b=Uf();v!==i?(n.substr(f,3)===Te?(b=Te,f+=3):(b=i,N===0&&j(sr)),b!==i?(X=a,h=Z(v),a=h):(f=a,a=l)):(f=a,a=l);}else f=a,a=l;else f=a,a=l;return M[T]={nextPos:f,result:a},a}function Bf(){var a,h,y,v,b=f*49+17,T=M[b];if(T)return f=T.nextPos,T.result;if(a=f,n.charCodeAt(f)===39?(h=jn,f++):(h=i,N===0&&j(or)),h!==i){for(y=[],v=Nf();v!==i;)y.push(v),v=Nf();y!==i?(n.charCodeAt(f)===39?(v=jn,f++):(v=i,N===0&&j(or)),v!==i?(X=a,h=Z(y),a=h):(f=a,a=l)):(f=a,a=l);}else f=a,a=l;return M[b]={nextPos:f,result:a},a}function Df(){var a,h,y,v=f*49+18,b=M[v];return b?(f=b.nextPos,b.result):(a=Yf(),a===i&&(a=f,h=f,N++,n.charCodeAt(f)===34?(y=ce,f++):(y=i,N===0&&j(Ke)),N--,y===i?h=m:(f=h,h=l),h!==i?(n.length>f?(y=n.charAt(f),f++):(y=i,N===0&&j(w)),y!==i?(X=a,h=_t(y),a=h):(f=a,a=l)):(f=a,a=l)),M[v]={nextPos:f,result:a},a)}function Nf(){var a,h,y,v=f*49+19,b=M[v];return b?(f=b.nextPos,b.result):(a=f,h=f,N++,n.charCodeAt(f)===39?(y=jn,f++):(y=i,N===0&&j(or)),N--,y===i?h=m:(f=h,h=l),h!==i?(n.length>f?(y=n.charAt(f),f++):(y=i,N===0&&j(w)),y!==i?(X=a,h=_t(y),a=h):(f=a,a=l)):(f=a,a=l),M[v]={nextPos:f,result:a},a)}function Mf(){var a,h,y,v=f*49+20,b=M[v];return b?(f=b.nextPos,b.result):(a=Yf(),a===i&&(a=$x(),a===i&&(a=f,h=f,N++,n.substr(f,3)===P?(y=P,f+=3):(y=i,N===0&&j(I)),N--,y===i?h=m:(f=h,h=l),h!==i?(n.length>f?(y=n.charAt(f),f++):(y=i,N===0&&j(w)),y!==i?(X=a,h=fe(y),a=h):(f=a,a=l)):(f=a,a=l))),M[v]={nextPos:f,result:a},a)}function $x(){var a,h,y,v,b,T=f*49+21,L=M[T];if(L)return f=L.nextPos,L.result;if(a=f,n.charCodeAt(f)===92?(h=en,f++):(h=i,N===0&&j(Jo)),h!==i)if(y=vt(),y!==i){for(v=[],b=Vf();b!==i;)v.push(b),b=Vf();v!==i?(X=a,h=K(),a=h):(f=a,a=l);}else f=a,a=l;else f=a,a=l;return M[T]={nextPos:f,result:a},a}function Uf(){var a,h,y,v=f*49+22,b=M[v];return b?(f=b.nextPos,b.result):(a=f,h=f,N++,n.substr(f,3)===Te?(y=Te,f+=3):(y=i,N===0&&j(sr)),N--,y===i?h=m:(f=h,h=l),h!==i?(n.length>f?(y=n.charAt(f),f++):(y=i,N===0&&j(w)),y!==i?(X=a,h=_t(y),a=h):(f=a,a=l)):(f=a,a=l),M[v]={nextPos:f,result:a},a)}function Fx(){var a,h,y,v,b=f*49+23,T=M[b];return T?(f=T.nextPos,T.result):(a=f,h=jf(),h===i&&(h=ra()),h!==i?(n.charCodeAt(f)===101?(y=me,f++):(y=i,N===0&&j(z)),y===i&&(n.charCodeAt(f)===69?(y=le,f++):(y=i,N===0&&j(ve))),y!==i?(v=ra(),v!==i?(X=a,h=Ne(h,v),a=h):(f=a,a=l)):(f=a,a=l)):(f=a,a=l),a===i&&(a=f,h=jf(),h!==i&&(X=a,h=_e(h)),a=h),M[b]={nextPos:f,result:a},a)}function jf(){var a,h,y,v,b,T,L=f*49+24,V=M[L];return V?(f=V.nextPos,V.result):(a=f,n.charCodeAt(f)===43?(h=Tr,f++):(h=i,N===0&&j(ar)),h===i&&(h=re),h!==i?(y=f,v=Yn(),v!==i?(n.charCodeAt(f)===46?(b=B,f++):(b=i,N===0&&j(k)),b!==i?(T=Yn(),T!==i?(v=[v,b,T],y=v):(f=y,y=l)):(f=y,y=l)):(f=y,y=l),y!==i?(X=a,h=uf(y),a=h):(f=a,a=l)):(f=a,a=l),a===i&&(a=f,n.charCodeAt(f)===45?(h=Hn,f++):(h=i,N===0&&j(Wn)),h!==i?(y=f,v=Yn(),v!==i?(n.charCodeAt(f)===46?(b=B,f++):(b=i,N===0&&j(k)),b!==i?(T=Yn(),T!==i?(v=[v,b,T],y=v):(f=y,y=l)):(f=y,y=l)):(f=y,y=l),y!==i?(X=a,h=lf(y),a=h):(f=a,a=l)):(f=a,a=l)),M[L]={nextPos:f,result:a},a)}function kx(){var a,h,y=f*49+25,v=M[y];return v?(f=v.nextPos,v.result):(a=f,h=ra(),h!==i&&(X=a,h=TE(h)),a=h,M[y]={nextPos:f,result:a},a)}function ra(){var a,h,y,v,b,T=f*49+26,L=M[T];if(L)return f=L.nextPos,L.result;if(a=f,n.charCodeAt(f)===43?(h=Tr,f++):(h=i,N===0&&j(ar)),h===i&&(h=re),h!==i){if(y=[],v=de(),v!==i)for(;v!==i;)y.push(v),v=de();else y=l;y!==i?(v=f,N++,n.charCodeAt(f)===46?(b=B,f++):(b=i,N===0&&j(k)),N--,b===i?v=m:(f=v,v=l),v!==i?(X=a,h=uf(y),a=h):(f=a,a=l)):(f=a,a=l);}else f=a,a=l;if(a===i)if(a=f,n.charCodeAt(f)===45?(h=Hn,f++):(h=i,N===0&&j(Wn)),h!==i){if(y=[],v=de(),v!==i)for(;v!==i;)y.push(v),v=de();else y=l;y!==i?(v=f,N++,n.charCodeAt(f)===46?(b=B,f++):(b=i,N===0&&j(k)),N--,b===i?v=m:(f=v,v=l),v!==i?(X=a,h=lf(y),a=h):(f=a,a=l)):(f=a,a=l);}else f=a,a=l;return M[T]={nextPos:f,result:a},a}function Lx(){var a,h,y=f*49+27,v=M[y];return v?(f=v.nextPos,v.result):(a=f,n.substr(f,4)===cf?(h=cf,f+=4):(h=i,N===0&&j(PE)),h!==i&&(X=a,h=IE()),a=h,a===i&&(a=f,n.substr(f,5)===ff?(h=ff,f+=5):(h=i,N===0&&j($E)),h!==i&&(X=a,h=FE()),a=h),M[y]={nextPos:f,result:a},a)}function qx(){var a,h,y,v,b,T=f*49+28,L=M[T];if(L)return f=L.nextPos,L.result;if(a=f,n.charCodeAt(f)===91?(h=E,f++):(h=i,N===0&&j(A)),h!==i){for(y=[],v=wt();v!==i;)y.push(v),v=wt();y!==i?(n.charCodeAt(f)===93?(v=R,f++):(v=i,N===0&&j(x)),v!==i?(X=a,h=kE(),a=h):(f=a,a=l)):(f=a,a=l);}else f=a,a=l;if(a===i&&(a=f,n.charCodeAt(f)===91?(h=E,f++):(h=i,N===0&&j(A)),h!==i?(y=Hf(),y===i&&(y=re),y!==i?(n.charCodeAt(f)===93?(v=R,f++):(v=i,N===0&&j(x)),v!==i?(X=a,h=LE(y),a=h):(f=a,a=l)):(f=a,a=l)):(f=a,a=l),a===i)){if(a=f,n.charCodeAt(f)===91?(h=E,f++):(h=i,N===0&&j(A)),h!==i){if(y=[],v=Ki(),v!==i)for(;v!==i;)y.push(v),v=Ki();else y=l;y!==i?(n.charCodeAt(f)===93?(v=R,f++):(v=i,N===0&&j(x)),v!==i?(X=a,h=qE(y),a=h):(f=a,a=l)):(f=a,a=l);}else f=a,a=l;if(a===i)if(a=f,n.charCodeAt(f)===91?(h=E,f++):(h=i,N===0&&j(A)),h!==i){if(y=[],v=Ki(),v!==i)for(;v!==i;)y.push(v),v=Ki();else y=l;y!==i?(v=Hf(),v!==i?(n.charCodeAt(f)===93?(b=R,f++):(b=i,N===0&&j(x)),b!==i?(X=a,h=BE(y,v),a=h):(f=a,a=l)):(f=a,a=l)):(f=a,a=l);}else f=a,a=l;}return M[T]={nextPos:f,result:a},a}function Hf(){var a,h,y,v,b,T=f*49+29,L=M[T];if(L)return f=L.nextPos,L.result;for(a=f,h=[],y=wt();y!==i;)h.push(y),y=wt();if(h!==i)if(y=tn(),y!==i){for(v=[],b=wt();b!==i;)v.push(b),b=wt();v!==i?(X=a,h=hf(y),a=h):(f=a,a=l);}else f=a,a=l;else f=a,a=l;return M[T]={nextPos:f,result:a},a}function Ki(){var a,h,y,v,b,T,L,V=f*49+30,se=M[V];if(se)return f=se.nextPos,se.result;for(a=f,h=[],y=wt();y!==i;)h.push(y),y=wt();if(h!==i)if(y=tn(),y!==i){for(v=[],b=wt();b!==i;)v.push(b),b=wt();if(v!==i)if(n.charCodeAt(f)===44?(b=pf,f++):(b=i,N===0&&j(df)),b!==i){for(T=[],L=wt();L!==i;)T.push(L),L=wt();T!==i?(X=a,h=hf(y),a=h):(f=a,a=l);}else f=a,a=l;else f=a,a=l;}else f=a,a=l;else f=a,a=l;return M[V]={nextPos:f,result:a},a}function wt(){var a,h=f*49+31,y=M[h];return y?(f=y.nextPos,y.result):(a=Q(),a===i&&(a=vt(),a===i&&(a=Vi())),M[h]={nextPos:f,result:a},a)}function Bx(){var a,h,y,v,b,T,L=f*49+32,V=M[L];if(V)return f=V.nextPos,V.result;if(a=f,n.charCodeAt(f)===123?(h=DE,f++):(h=i,N===0&&j(NE)),h!==i){for(y=[],v=Q();v!==i;)y.push(v),v=Q();if(y!==i){for(v=[],b=Wf();b!==i;)v.push(b),b=Wf();if(v!==i){for(b=[],T=Q();T!==i;)b.push(T),T=Q();b!==i?(n.charCodeAt(f)===125?(T=ME,f++):(T=i,N===0&&j(UE)),T!==i?(X=a,h=jE(v),a=h):(f=a,a=l)):(f=a,a=l);}else f=a,a=l;}else f=a,a=l;}else f=a,a=l;return M[L]={nextPos:f,result:a},a}function Wf(){var a,h,y,v,b,T,L,V,se,ye,pe,Ee=f*49+33,Ce=M[Ee];if(Ce)return f=Ce.nextPos,Ce.result;for(a=f,h=[],y=Q();y!==i;)h.push(y),y=Q();if(h!==i)if(y=Kn(),y!==i){for(v=[],b=Q();b!==i;)v.push(b),b=Q();if(v!==i)if(n.charCodeAt(f)===61?(b=U,f++):(b=i,N===0&&j(C)),b!==i){for(T=[],L=Q();L!==i;)T.push(L),L=Q();if(T!==i)if(L=tn(),L!==i){for(V=[],se=Q();se!==i;)V.push(se),se=Q();if(V!==i)if(n.charCodeAt(f)===44?(se=pf,f++):(se=i,N===0&&j(df)),se!==i){for(ye=[],pe=Q();pe!==i;)ye.push(pe),pe=Q();ye!==i?(X=a,h=yf(y,L),a=h):(f=a,a=l);}else f=a,a=l;else f=a,a=l;}else f=a,a=l;else f=a,a=l;}else f=a,a=l;else f=a,a=l;}else f=a,a=l;else f=a,a=l;if(a===i){for(a=f,h=[],y=Q();y!==i;)h.push(y),y=Q();if(h!==i)if(y=Kn(),y!==i){for(v=[],b=Q();b!==i;)v.push(b),b=Q();if(v!==i)if(n.charCodeAt(f)===61?(b=U,f++):(b=i,N===0&&j(C)),b!==i){for(T=[],L=Q();L!==i;)T.push(L),L=Q();T!==i?(L=tn(),L!==i?(X=a,h=yf(y,L),a=h):(f=a,a=l)):(f=a,a=l);}else f=a,a=l;else f=a,a=l;}else f=a,a=l;else f=a,a=l;}return M[Ee]={nextPos:f,result:a},a}function zf(){var a,h,y,v=f*49+34,b=M[v];return b?(f=b.nextPos,b.result):(a=f,n.charCodeAt(f)===46?(h=B,f++):(h=i,N===0&&j(k)),h!==i?(y=Yn(),y!==i?(X=a,h=HE(y),a=h):(f=a,a=l)):(f=a,a=l),M[v]={nextPos:f,result:a},a)}function Gf(){var a,h,y,v,b,T,L,V,se,ye,pe,Ee,Ce=f*49+35,ut=M[Ce];return ut?(f=ut.nextPos,ut.result):(a=f,h=f,y=de(),y!==i?(v=de(),v!==i?(b=de(),b!==i?(T=de(),T!==i?(n.charCodeAt(f)===45?(L=Hn,f++):(L=i,N===0&&j(Wn)),L!==i?(V=de(),V!==i?(se=de(),se!==i?(n.charCodeAt(f)===45?(ye=Hn,f++):(ye=i,N===0&&j(Wn)),ye!==i?(pe=de(),pe!==i?(Ee=de(),Ee!==i?(y=[y,v,b,T,L,V,se,ye,pe,Ee],h=y):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l),h!==i&&(X=a,h=WE(h)),a=h,M[Ce]={nextPos:f,result:a},a)}function Dx(){var a,h,y,v,b,T,L,V,se,ye,pe,Ee=f*49+36,Ce=M[Ee];return Ce?(f=Ce.nextPos,Ce.result):(a=f,h=f,y=de(),y!==i?(v=de(),v!==i?(n.charCodeAt(f)===58?(b=zn,f++):(b=i,N===0&&j(Gn)),b!==i?(T=de(),T!==i?(L=de(),L!==i?(n.charCodeAt(f)===58?(V=zn,f++):(V=i,N===0&&j(Gn)),V!==i?(se=de(),se!==i?(ye=de(),ye!==i?(pe=zf(),pe===i&&(pe=re),pe!==i?(y=[y,v,b,T,L,V,se,ye,pe],h=y):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l),h!==i&&(X=a,h=gf(h)),a=h,M[Ee]={nextPos:f,result:a},a)}function Nx(){var a,h,y,v,b,T,L,V,se,ye,pe,Ee,Ce,ut,rn,ur,lt,Xf=f*49+37,ia=M[Xf];return ia?(f=ia.nextPos,ia.result):(a=f,h=f,y=de(),y!==i?(v=de(),v!==i?(n.charCodeAt(f)===58?(b=zn,f++):(b=i,N===0&&j(Gn)),b!==i?(T=de(),T!==i?(L=de(),L!==i?(n.charCodeAt(f)===58?(V=zn,f++):(V=i,N===0&&j(Gn)),V!==i?(se=de(),se!==i?(ye=de(),ye!==i?(pe=zf(),pe===i&&(pe=re),pe!==i?(n.charCodeAt(f)===45?(Ee=Hn,f++):(Ee=i,N===0&&j(Wn)),Ee===i&&(n.charCodeAt(f)===43?(Ee=Tr,f++):(Ee=i,N===0&&j(ar))),Ee!==i?(Ce=de(),Ce!==i?(ut=de(),ut!==i?(n.charCodeAt(f)===58?(rn=zn,f++):(rn=i,N===0&&j(Gn)),rn!==i?(ur=de(),ur!==i?(lt=de(),lt!==i?(y=[y,v,b,T,L,V,se,ye,pe,Ee,Ce,ut,rn,ur,lt],h=y):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l)):(f=h,h=l),h!==i&&(X=a,h=gf(h)),a=h,M[Xf]={nextPos:f,result:a},a)}function Mx(){var a,h,y,v,b,T=f*49+38,L=M[T];return L?(f=L.nextPos,L.result):(a=f,h=Gf(),h!==i?(n.charCodeAt(f)===84?(y=mf,f++):(y=i,N===0&&j(wf)),y!==i?(v=Dx(),v!==i?(n.charCodeAt(f)===90?(b=zE,f++):(b=i,N===0&&j(GE)),b!==i?(X=a,h=VE(h,v),a=h):(f=a,a=l)):(f=a,a=l)):(f=a,a=l)):(f=a,a=l),a===i&&(a=f,h=Gf(),h!==i?(n.charCodeAt(f)===84?(y=mf,f++):(y=i,N===0&&j(wf)),y!==i?(v=Nx(),v!==i?(X=a,h=KE(h,v),a=h):(f=a,a=l)):(f=a,a=l)):(f=a,a=l)),M[T]={nextPos:f,result:a},a)}function Q(){var a,h=f*49+39,y=M[h];return y?(f=y.nextPos,y.result):(YE.test(n.charAt(f))?(a=n.charAt(f),f++):(a=i,N===0&&j(JE)),M[h]={nextPos:f,result:a},a)}function vt(){var a,h,y,v=f*49+40,b=M[v];return b?(f=b.nextPos,b.result):(n.charCodeAt(f)===10?(a=vf,f++):(a=i,N===0&&j(Sf)),a===i&&(a=f,n.charCodeAt(f)===13?(h=XE,f++):(h=i,N===0&&j(QE)),h!==i?(n.charCodeAt(f)===10?(y=vf,f++):(y=i,N===0&&j(Sf)),y!==i?(h=[h,y],a=h):(f=a,a=l)):(f=a,a=l)),M[v]={nextPos:f,result:a},a)}function Vf(){var a,h=f*49+41,y=M[h];return y?(f=y.nextPos,y.result):(a=vt(),a===i&&(a=Q()),M[h]={nextPos:f,result:a},a)}function Yi(){var a,h,y=f*49+42,v=M[y];return v?(f=v.nextPos,v.result):(a=f,N++,n.length>f?(h=n.charAt(f),f++):(h=i,N===0&&j(w)),N--,h===i?a=m:(f=a,a=l),M[y]={nextPos:f,result:a},a)}function St(){var a,h=f*49+43,y=M[h];return y?(f=y.nextPos,y.result):(ZE.test(n.charAt(f))?(a=n.charAt(f),f++):(a=i,N===0&&j(ex)),M[h]={nextPos:f,result:a},a)}function de(){var a,h,y=f*49+44,v=M[y];return v?(f=v.nextPos,v.result):(tx.test(n.charAt(f))?(a=n.charAt(f),f++):(a=i,N===0&&j(rx)),a===i&&(a=f,n.charCodeAt(f)===95?(h=nx,f++):(h=i,N===0&&j(ix)),h!==i&&(X=a,h=sx()),a=h),M[y]={nextPos:f,result:a},a)}function Kf(){var a,h=f*49+45,y=M[h];return y?(f=y.nextPos,y.result):(ox.test(n.charAt(f))?(a=n.charAt(f),f++):(a=i,N===0&&j(ax)),M[h]={nextPos:f,result:a},a)}function Yn(){var a,h,y,v=f*49+46,b=M[v];if(b)return f=b.nextPos,b.result;if(a=f,h=[],y=de(),y!==i)for(;y!==i;)h.push(y),y=de();else h=l;return h!==i&&(X=a,h=ux(h)),a=h,M[v]={nextPos:f,result:a},a}function Yf(){var a,h,y=f*49+47,v=M[y];return v?(f=v.nextPos,v.result):(a=f,n.substr(f,2)===bf?(h=bf,f+=2):(h=i,N===0&&j(lx)),h!==i&&(X=a,h=cx()),a=h,a===i&&(a=f,n.substr(f,2)===Ef?(h=Ef,f+=2):(h=i,N===0&&j(fx)),h!==i&&(X=a,h=hx()),a=h,a===i&&(a=f,n.substr(f,2)===xf?(h=xf,f+=2):(h=i,N===0&&j(px)),h!==i&&(X=a,h=dx()),a=h,a===i&&(a=f,n.substr(f,2)===Af?(h=Af,f+=2):(h=i,N===0&&j(yx)),h!==i&&(X=a,h=gx()),a=h,a===i&&(a=f,n.substr(f,2)===_f?(h=_f,f+=2):(h=i,N===0&&j(mx)),h!==i&&(X=a,h=wx()),a=h,a===i&&(a=f,n.substr(f,2)===Cf?(h=Cf,f+=2):(h=i,N===0&&j(vx)),h!==i&&(X=a,h=Sx()),a=h,a===i&&(a=f,n.substr(f,2)===Rf?(h=Rf,f+=2):(h=i,N===0&&j(bx)),h!==i&&(X=a,h=Ex()),a=h,a===i&&(a=Ux()))))))),M[y]={nextPos:f,result:a},a)}function Ux(){var a,h,y,v,b,T,L,V,se,ye,pe,Ee=f*49+48,Ce=M[Ee];return Ce?(f=Ce.nextPos,Ce.result):(a=f,n.substr(f,2)===Of?(h=Of,f+=2):(h=i,N===0&&j(xx)),h!==i?(y=f,v=St(),v!==i?(b=St(),b!==i?(T=St(),T!==i?(L=St(),L!==i?(V=St(),V!==i?(se=St(),se!==i?(ye=St(),ye!==i?(pe=St(),pe!==i?(v=[v,b,T,L,V,se,ye,pe],y=v):(f=y,y=l)):(f=y,y=l)):(f=y,y=l)):(f=y,y=l)):(f=y,y=l)):(f=y,y=l)):(f=y,y=l)):(f=y,y=l),y!==i?(X=a,h=Tf(y),a=h):(f=a,a=l)):(f=a,a=l),a===i&&(a=f,n.substr(f,2)===Pf?(h=Pf,f+=2):(h=i,N===0&&j(Ax)),h!==i?(y=f,v=St(),v!==i?(b=St(),b!==i?(T=St(),T!==i?(L=St(),L!==i?(v=[v,b,T,L],y=v):(f=y,y=l)):(f=y,y=l)):(f=y,y=l)):(f=y,y=l),y!==i?(X=a,h=Tf(y),a=h):(f=a,a=l)):(f=a,a=l)),M[Ee]={nextPos:f,result:a},a)}var Jf=[];function jx(a,h,y){var v=new Error(a);throw v.line=h,v.column=y,v}function na(a){Jf.push(a);}function je(a,h,y,v,b){var T={type:a,value:h,line:y(),column:v()};return b&&(T.key=b),T}function Hx(a,h,y){var v=parseInt("0x"+a);if(!isFinite(v)||Math.floor(v)!=v||v<0||v>1114111||v>55295&&v<57344)jx("Invalid Unicode escape code: "+a,h,y);else return Wx(v)}function Wx(){var a=16384,h=[],y,v,b=-1,T=arguments.length;if(!T)return "";for(var L="";++b>10)+55296,v=V%1024+56320,h.push(y,v)),(b+1==T||h.length>a)&&(L+=String.fromCharCode.apply(null,h),h.length=0);}return L}if(Gi=u(),Gi!==i&&f===n.length)return Gi;throw Gi!==i&&f{function VF(t){var e=[],r=[],n="",s=Object.create(null),i=s;return u(t);function u(x){for(var O,F=0;F"u"?C===O.length-1?U[Y]=F:U[Y]=Object.create(null):C!==O.length-1&&r.indexOf(B)>-1&&c("Cannot redefine existing key '"+B+"'.",q,W),U=U[Y],U instanceof Array&&U.length&&C-1?'"'+x+'"':x}}_v.exports={compile:VF};});var Ov=_((cM,Rv)=>{var KF=Av(),YF=Cv();Rv.exports={parse:function(t){var e=KF.parse(t.toString());return YF.compile(e)}};});var Si=_((fM,Fv)=>{var JF=G("path"),jt="\\\\/",Tv=`[^${jt}]`,Qt="\\.",XF="\\+",QF="\\?",go="\\/",ZF="(?=.)",Pv="[^/]",Bl=`(?:${go}|$)`,Iv=`(?:^|${go})`,Dl=`${Qt}{1,2}${Bl}`,ek=`(?!${Qt})`,tk=`(?!${Iv}${Dl})`,rk=`(?!${Qt}{0,1}${Bl})`,nk=`(?!${Dl})`,ik=`[^.${go}]`,sk=`${Pv}*?`,$v={DOT_LITERAL:Qt,PLUS_LITERAL:XF,QMARK_LITERAL:QF,SLASH_LITERAL:go,ONE_CHAR:ZF,QMARK:Pv,END_ANCHOR:Bl,DOTS_SLASH:Dl,NO_DOT:ek,NO_DOTS:tk,NO_DOT_SLASH:rk,NO_DOTS_SLASH:nk,QMARK_NO_DOT:ik,STAR:sk,START_ANCHOR:Iv},ok={...$v,SLASH_LITERAL:`[${jt}]`,QMARK:Tv,STAR:`${Tv}*?`,DOTS_SLASH:`${Qt}{1,2}(?:[${jt}]|$)`,NO_DOT:`(?!${Qt})`,NO_DOTS:`(?!(?:^|[${jt}])${Qt}{1,2}(?:[${jt}]|$))`,NO_DOT_SLASH:`(?!${Qt}{0,1}(?:[${jt}]|$))`,NO_DOTS_SLASH:`(?!${Qt}{1,2}(?:[${jt}]|$))`,QMARK_NO_DOT:`[^.${jt}]`,START_ANCHOR:`(?:^|[${jt}])`,END_ANCHOR:`(?:[${jt}]|$)`},ak={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Fv.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:ak,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:JF.sep,extglobChars(t){return {"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?ok:$v}};});var mo=_(st=>{var uk=G("path"),lk=process.platform==="win32",{REGEX_BACKSLASH:ck,REGEX_REMOVE_BACKSLASH:fk,REGEX_SPECIAL_CHARS:hk,REGEX_SPECIAL_CHARS_GLOBAL:pk}=Si();st.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);st.hasRegexChars=t=>hk.test(t);st.isRegexChar=t=>t.length===1&&st.hasRegexChars(t);st.escapeRegex=t=>t.replace(pk,"\\$1");st.toPosixSlashes=t=>t.replace(ck,"/");st.removeBackslashes=t=>t.replace(fk,e=>e==="\\"?"":e);st.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};st.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:lk===!0||uk.sep==="\\";st.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?st.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};st.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};st.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",s=r.contains?"":"$",i=`${n}(?:${t})${s}`;return e.negated===!0&&(i=`(?:^(?!${i}).*$)`),i};});var Uv=_((pM,Mv)=>{var kv=mo(),{CHAR_ASTERISK:Nl,CHAR_AT:dk,CHAR_BACKWARD_SLASH:bi,CHAR_COMMA:yk,CHAR_DOT:Ml,CHAR_EXCLAMATION_MARK:Ul,CHAR_FORWARD_SLASH:Nv,CHAR_LEFT_CURLY_BRACE:jl,CHAR_LEFT_PARENTHESES:Hl,CHAR_LEFT_SQUARE_BRACKET:gk,CHAR_PLUS:mk,CHAR_QUESTION_MARK:Lv,CHAR_RIGHT_CURLY_BRACE:wk,CHAR_RIGHT_PARENTHESES:qv,CHAR_RIGHT_SQUARE_BRACKET:vk}=Si(),Bv=t=>t===Nv||t===bi,Dv=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1);},Sk=(t,e)=>{let r=e||{},n=t.length-1,s=r.parts===!0||r.scanToEnd===!0,i=[],o=[],u=[],c=t,p=-1,l=0,d=0,g=!1,m=!1,w=!1,E=!1,A=!1,R=!1,x=!1,O=!1,F=!1,q=!1,W=0,H,B,k={value:"",depth:0,isGlob:!1},U=()=>p>=n,C=()=>c.charCodeAt(p+1),Y=()=>(H=B,c.charCodeAt(++p));for(;p0&&(oe=c.slice(0,l),c=c.slice(l),d-=l),J&&w===!0&&d>0?(J=c.slice(0,d),P=c.slice(d)):w===!0?(J="",P=c):J=c,J&&J!==""&&J!=="/"&&J!==c&&Bv(J.charCodeAt(J.length-1))&&(J=J.slice(0,-1)),r.unescape===!0&&(P&&(P=kv.removeBackslashes(P)),J&&x===!0&&(J=kv.removeBackslashes(J)));let I={prefix:oe,input:t,start:l,base:J,glob:P,isBrace:g,isBracket:m,isGlob:w,isExtglob:E,isGlobstar:A,negated:O,negatedExtglob:F};if(r.tokens===!0&&(I.maxDepth=0,Bv(B)||o.push(k),I.tokens=o),r.parts===!0||r.tokens===!0){let re;for(let Z=0;Z{var wo=Si(),ht=mo(),{MAX_LENGTH:vo,POSIX_REGEX_SOURCE:bk,REGEX_NON_SPECIAL_CHARS:Ek,REGEX_SPECIAL_CHARS_BACKREF:xk,REPLACEMENTS:jv}=wo,Ak=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;return r},_n=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,Wl=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=jv[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(vo,r.maxLength):vo,s=t.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);let i={type:"bos",value:"",output:r.prepend||""},o=[i],u=r.capture?"":"?:",c=ht.isWindows(e),p=wo.globChars(c),l=wo.extglobChars(p),{DOT_LITERAL:d,PLUS_LITERAL:g,SLASH_LITERAL:m,ONE_CHAR:w,DOTS_SLASH:E,NO_DOT:A,NO_DOT_SLASH:R,NO_DOTS_SLASH:x,QMARK:O,QMARK_NO_DOT:F,STAR:q,START_ANCHOR:W}=p,H=K=>`(${u}(?:(?!${W}${K.dot?E:d}).)*?)`,B=r.dot?"":A,k=r.dot?O:F,U=r.bash===!0?H(r):q;r.capture&&(U=`(${U})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let C={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};t=ht.removePrefix(t,C),s=t.length;let Y=[],J=[],oe=[],P=i,I,re=()=>C.index===s-1,Z=C.peek=(K=1)=>t[C.index+K],ce=C.advance=()=>t[++C.index]||"",Ke=()=>t.slice(C.index+1),Te=(K="",me=0)=>{C.consumed+=K,C.index+=me;},sr=K=>{C.output+=K.output!=null?K.output:K.value,Te(K.value);},jn=()=>{let K=1;for(;Z()==="!"&&(Z(2)!=="("||Z(3)==="?");)ce(),C.start++,K++;return K%2===0?!1:(C.negated=!0,C.start++,!0)},or=K=>{C[K]++,oe.push(K);},_t=K=>{C[K]--,oe.pop();},fe=K=>{if(P.type==="globstar"){let me=C.braces>0&&(K.type==="comma"||K.type==="brace"),z=K.extglob===!0||Y.length&&(K.type==="pipe"||K.type==="paren");K.type!=="slash"&&K.type!=="paren"&&!me&&!z&&(C.output=C.output.slice(0,-P.output.length),P.type="star",P.value="*",P.output=U,C.output+=P.output);}if(Y.length&&K.type!=="paren"&&(Y[Y.length-1].inner+=K.value),(K.value||K.output)&&sr(K),P&&P.type==="text"&&K.type==="text"){P.value+=K.value,P.output=(P.output||"")+K.value;return}K.prev=P,o.push(K),P=K;},en=(K,me)=>{let z={...l[me],conditions:1,inner:""};z.prev=P,z.parens=C.parens,z.output=C.output;let le=(r.capture?"(":"")+z.open;or("parens"),fe({type:K,value:me,output:C.output?"":w}),fe({type:"paren",extglob:!0,value:ce(),output:le}),Y.push(z);},Jo=K=>{let me=K.close+(r.capture?")":""),z;if(K.type==="negate"){let le=U;if(K.inner&&K.inner.length>1&&K.inner.includes("/")&&(le=H(r)),(le!==U||re()||/^\)+$/.test(Ke()))&&(me=K.close=`)$))${le}`),K.inner.includes("*")&&(z=Ke())&&/^\.[^\\/.]+$/.test(z)){let ve=Wl(z,{...e,fastpaths:!1}).output;me=K.close=`)${ve})${le})`;}K.prev.type==="bos"&&(C.negatedExtglob=!0);}fe({type:"paren",extglob:!0,value:I,output:me}),_t("parens");};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let K=!1,me=t.replace(xk,(z,le,ve,Ne,_e,Tr)=>Ne==="\\"?(K=!0,z):Ne==="?"?le?le+Ne+(_e?O.repeat(_e.length):""):Tr===0?k+(_e?O.repeat(_e.length):""):O.repeat(ve.length):Ne==="."?d.repeat(ve.length):Ne==="*"?le?le+Ne+(_e?U:""):U:le?z:`\\${z}`);return K===!0&&(r.unescape===!0?me=me.replace(/\\/g,""):me=me.replace(/\\+/g,z=>z.length%2===0?"\\\\":z?"\\":"")),me===t&&r.contains===!0?(C.output=t,C):(C.output=ht.wrapOutput(me,C,e),C)}for(;!re();){if(I=ce(),I==="\0")continue;if(I==="\\"){let z=Z();if(z==="/"&&r.bash!==!0||z==="."||z===";")continue;if(!z){I+="\\",fe({type:"text",value:I});continue}let le=/^\\+/.exec(Ke()),ve=0;if(le&&le[0].length>2&&(ve=le[0].length,C.index+=ve,ve%2!==0&&(I+="\\")),r.unescape===!0?I=ce():I+=ce(),C.brackets===0){fe({type:"text",value:I});continue}}if(C.brackets>0&&(I!=="]"||P.value==="["||P.value==="[^")){if(r.posix!==!1&&I===":"){let z=P.value.slice(1);if(z.includes("[")&&(P.posix=!0,z.includes(":"))){let le=P.value.lastIndexOf("["),ve=P.value.slice(0,le),Ne=P.value.slice(le+2),_e=bk[Ne];if(_e){P.value=ve+_e,C.backtrack=!0,ce(),!i.output&&o.indexOf(P)===1&&(i.output=w);continue}}}(I==="["&&Z()!==":"||I==="-"&&Z()==="]")&&(I=`\\${I}`),I==="]"&&(P.value==="["||P.value==="[^")&&(I=`\\${I}`),r.posix===!0&&I==="!"&&P.value==="["&&(I="^"),P.value+=I,sr({value:I});continue}if(C.quotes===1&&I!=='"'){I=ht.escapeRegex(I),P.value+=I,sr({value:I});continue}if(I==='"'){C.quotes=C.quotes===1?0:1,r.keepQuotes===!0&&fe({type:"text",value:I});continue}if(I==="("){or("parens"),fe({type:"paren",value:I});continue}if(I===")"){if(C.parens===0&&r.strictBrackets===!0)throw new SyntaxError(_n("opening","("));let z=Y[Y.length-1];if(z&&C.parens===z.parens+1){Jo(Y.pop());continue}fe({type:"paren",value:I,output:C.parens?")":"\\)"}),_t("parens");continue}if(I==="["){if(r.nobracket===!0||!Ke().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(_n("closing","]"));I=`\\${I}`;}else or("brackets");fe({type:"bracket",value:I});continue}if(I==="]"){if(r.nobracket===!0||P&&P.type==="bracket"&&P.value.length===1){fe({type:"text",value:I,output:`\\${I}`});continue}if(C.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(_n("opening","["));fe({type:"text",value:I,output:`\\${I}`});continue}_t("brackets");let z=P.value.slice(1);if(P.posix!==!0&&z[0]==="^"&&!z.includes("/")&&(I=`/${I}`),P.value+=I,sr({value:I}),r.literalBrackets===!1||ht.hasRegexChars(z))continue;let le=ht.escapeRegex(P.value);if(C.output=C.output.slice(0,-P.value.length),r.literalBrackets===!0){C.output+=le,P.value=le;continue}P.value=`(${u}${le}|${P.value})`,C.output+=P.value;continue}if(I==="{"&&r.nobrace!==!0){or("braces");let z={type:"brace",value:I,output:"(",outputIndex:C.output.length,tokensIndex:C.tokens.length};J.push(z),fe(z);continue}if(I==="}"){let z=J[J.length-1];if(r.nobrace===!0||!z){fe({type:"text",value:I,output:I});continue}let le=")";if(z.dots===!0){let ve=o.slice(),Ne=[];for(let _e=ve.length-1;_e>=0&&(o.pop(),ve[_e].type!=="brace");_e--)ve[_e].type!=="dots"&&Ne.unshift(ve[_e].value);le=Ak(Ne,r),C.backtrack=!0;}if(z.comma!==!0&&z.dots!==!0){let ve=C.output.slice(0,z.outputIndex),Ne=C.tokens.slice(z.tokensIndex);z.value=z.output="\\{",I=le="\\}",C.output=ve;for(let _e of Ne)C.output+=_e.output||_e.value;}fe({type:"brace",value:I,output:le}),_t("braces"),J.pop();continue}if(I==="|"){Y.length>0&&Y[Y.length-1].conditions++,fe({type:"text",value:I});continue}if(I===","){let z=I,le=J[J.length-1];le&&oe[oe.length-1]==="braces"&&(le.comma=!0,z="|"),fe({type:"comma",value:I,output:z});continue}if(I==="/"){if(P.type==="dot"&&C.index===C.start+1){C.start=C.index+1,C.consumed="",C.output="",o.pop(),P=i;continue}fe({type:"slash",value:I,output:m});continue}if(I==="."){if(C.braces>0&&P.type==="dot"){P.value==="."&&(P.output=d);let z=J[J.length-1];P.type="dots",P.output+=I,P.value+=I,z.dots=!0;continue}if(C.braces+C.parens===0&&P.type!=="bos"&&P.type!=="slash"){fe({type:"text",value:I,output:d});continue}fe({type:"dot",value:I,output:d});continue}if(I==="?"){if(!(P&&P.value==="(")&&r.noextglob!==!0&&Z()==="("&&Z(2)!=="?"){en("qmark",I);continue}if(P&&P.type==="paren"){let le=Z(),ve=I;if(le==="<"&&!ht.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(P.value==="("&&!/[!=<:]/.test(le)||le==="<"&&!/<([!=]|\w+>)/.test(Ke()))&&(ve=`\\${I}`),fe({type:"text",value:I,output:ve});continue}if(r.dot!==!0&&(P.type==="slash"||P.type==="bos")){fe({type:"qmark",value:I,output:F});continue}fe({type:"qmark",value:I,output:O});continue}if(I==="!"){if(r.noextglob!==!0&&Z()==="("&&(Z(2)!=="?"||!/[!=<:]/.test(Z(3)))){en("negate",I);continue}if(r.nonegate!==!0&&C.index===0){jn();continue}}if(I==="+"){if(r.noextglob!==!0&&Z()==="("&&Z(2)!=="?"){en("plus",I);continue}if(P&&P.value==="("||r.regex===!1){fe({type:"plus",value:I,output:g});continue}if(P&&(P.type==="bracket"||P.type==="paren"||P.type==="brace")||C.parens>0){fe({type:"plus",value:I});continue}fe({type:"plus",value:g});continue}if(I==="@"){if(r.noextglob!==!0&&Z()==="("&&Z(2)!=="?"){fe({type:"at",extglob:!0,value:I,output:""});continue}fe({type:"text",value:I});continue}if(I!=="*"){(I==="$"||I==="^")&&(I=`\\${I}`);let z=Ek.exec(Ke());z&&(I+=z[0],C.index+=z[0].length),fe({type:"text",value:I});continue}if(P&&(P.type==="globstar"||P.star===!0)){P.type="star",P.star=!0,P.value+=I,P.output=U,C.backtrack=!0,C.globstar=!0,Te(I);continue}let K=Ke();if(r.noextglob!==!0&&/^\([^?]/.test(K)){en("star",I);continue}if(P.type==="star"){if(r.noglobstar===!0){Te(I);continue}let z=P.prev,le=z.prev,ve=z.type==="slash"||z.type==="bos",Ne=le&&(le.type==="star"||le.type==="globstar");if(r.bash===!0&&(!ve||K[0]&&K[0]!=="/")){fe({type:"star",value:I,output:""});continue}let _e=C.braces>0&&(z.type==="comma"||z.type==="brace"),Tr=Y.length&&(z.type==="pipe"||z.type==="paren");if(!ve&&z.type!=="paren"&&!_e&&!Tr){fe({type:"star",value:I,output:""});continue}for(;K.slice(0,3)==="/**";){let ar=t[C.index+4];if(ar&&ar!=="/")break;K=K.slice(3),Te("/**",3);}if(z.type==="bos"&&re()){P.type="globstar",P.value+=I,P.output=H(r),C.output=P.output,C.globstar=!0,Te(I);continue}if(z.type==="slash"&&z.prev.type!=="bos"&&!Ne&&re()){C.output=C.output.slice(0,-(z.output+P.output).length),z.output=`(?:${z.output}`,P.type="globstar",P.output=H(r)+(r.strictSlashes?")":"|$)"),P.value+=I,C.globstar=!0,C.output+=z.output+P.output,Te(I);continue}if(z.type==="slash"&&z.prev.type!=="bos"&&K[0]==="/"){let ar=K[1]!==void 0?"|$":"";C.output=C.output.slice(0,-(z.output+P.output).length),z.output=`(?:${z.output}`,P.type="globstar",P.output=`${H(r)}${m}|${m}${ar})`,P.value+=I,C.output+=z.output+P.output,C.globstar=!0,Te(I+ce()),fe({type:"slash",value:"/",output:""});continue}if(z.type==="bos"&&K[0]==="/"){P.type="globstar",P.value+=I,P.output=`(?:^|${m}|${H(r)}${m})`,C.output=P.output,C.globstar=!0,Te(I+ce()),fe({type:"slash",value:"/",output:""});continue}C.output=C.output.slice(0,-P.output.length),P.type="globstar",P.output=H(r),P.value+=I,C.output+=P.output,C.globstar=!0,Te(I);continue}let me={type:"star",value:I,output:U};if(r.bash===!0){me.output=".*?",(P.type==="bos"||P.type==="slash")&&(me.output=B+me.output),fe(me);continue}if(P&&(P.type==="bracket"||P.type==="paren")&&r.regex===!0){me.output=I,fe(me);continue}(C.index===C.start||P.type==="slash"||P.type==="dot")&&(P.type==="dot"?(C.output+=R,P.output+=R):r.dot===!0?(C.output+=x,P.output+=x):(C.output+=B,P.output+=B),Z()!=="*"&&(C.output+=w,P.output+=w)),fe(me);}for(;C.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(_n("closing","]"));C.output=ht.escapeLast(C.output,"["),_t("brackets");}for(;C.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(_n("closing",")"));C.output=ht.escapeLast(C.output,"("),_t("parens");}for(;C.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(_n("closing","}"));C.output=ht.escapeLast(C.output,"{"),_t("braces");}if(r.strictSlashes!==!0&&(P.type==="star"||P.type==="bracket")&&fe({type:"maybe_slash",value:"",output:`${m}?`}),C.backtrack===!0){C.output="";for(let K of C.tokens)C.output+=K.output!=null?K.output:K.value,K.suffix&&(C.output+=K.suffix);}return C};Wl.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(vo,r.maxLength):vo,s=t.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);t=jv[t]||t;let i=ht.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:u,ONE_CHAR:c,DOTS_SLASH:p,NO_DOT:l,NO_DOTS:d,NO_DOTS_SLASH:g,STAR:m,START_ANCHOR:w}=wo.globChars(i),E=r.dot?d:l,A=r.dot?g:l,R=r.capture?"":"?:",x={negated:!1,prefix:""},O=r.bash===!0?".*?":m;r.capture&&(O=`(${O})`);let F=B=>B.noglobstar===!0?O:`(${R}(?:(?!${w}${B.dot?p:o}).)*?)`,q=B=>{switch(B){case"*":return `${E}${c}${O}`;case".*":return `${o}${c}${O}`;case"*.*":return `${E}${O}${o}${c}${O}`;case"*/*":return `${E}${O}${u}${c}${A}${O}`;case"**":return E+F(r);case"**/*":return `(?:${E}${F(r)}${u})?${A}${c}${O}`;case"**/*.*":return `(?:${E}${F(r)}${u})?${A}${O}${o}${c}${O}`;case"**/.*":return `(?:${E}${F(r)}${u})?${o}${c}${O}`;default:{let k=/^(.*?)\.(\w+)$/.exec(B);if(!k)return;let U=q(k[1]);return U?U+o+k[2]:void 0}}},W=ht.removePrefix(t,x),H=q(W);return H&&r.strictSlashes!==!0&&(H+=`${u}?`),H};Hv.exports=Wl;});var Gv=_((yM,zv)=>{var _k=G("path"),Ck=Uv(),zl=Wv(),Gl=mo(),Rk=Si(),Ok=t=>t&&typeof t=="object"&&!Array.isArray(t),Oe=(t,e,r=!1)=>{if(Array.isArray(t)){let l=t.map(g=>Oe(g,e,r));return g=>{for(let m of l){let w=m(g);if(w)return w}return !1}}let n=Ok(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let s=e||{},i=Gl.isWindows(e),o=n?Oe.compileRe(t,e):Oe.makeRe(t,e,!1,!0),u=o.state;delete o.state;let c=()=>!1;if(s.ignore){let l={...e,ignore:null,onMatch:null,onResult:null};c=Oe(s.ignore,l,r);}let p=(l,d=!1)=>{let{isMatch:g,match:m,output:w}=Oe.test(l,o,e,{glob:t,posix:i}),E={glob:t,state:u,regex:o,posix:i,input:l,output:w,match:m,isMatch:g};return typeof s.onResult=="function"&&s.onResult(E),g===!1?(E.isMatch=!1,d?E:!1):c(l)?(typeof s.onIgnore=="function"&&s.onIgnore(E),E.isMatch=!1,d?E:!1):(typeof s.onMatch=="function"&&s.onMatch(E),d?E:!0)};return r&&(p.state=u),p};Oe.test=(t,e,r,{glob:n,posix:s}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return {isMatch:!1,output:""};let i=r||{},o=i.format||(s?Gl.toPosixSlashes:null),u=t===n,c=u&&o?o(t):t;return u===!1&&(c=o?o(t):t,u=c===n),(u===!1||i.capture===!0)&&(i.matchBase===!0||i.basename===!0?u=Oe.matchBase(t,e,r,s):u=e.exec(c)),{isMatch:!!u,match:u,output:c}};Oe.matchBase=(t,e,r,n=Gl.isWindows(r))=>(e instanceof RegExp?e:Oe.makeRe(e,r)).test(_k.basename(t));Oe.isMatch=(t,e,r)=>Oe(e,r)(t);Oe.parse=(t,e)=>Array.isArray(t)?t.map(r=>Oe.parse(r,e)):zl(t,{...e,fastpaths:!1});Oe.scan=(t,e)=>Ck(t,e);Oe.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let s=e||{},i=s.contains?"":"^",o=s.contains?"":"$",u=`${i}(?:${t.output})${o}`;t&&t.negated===!0&&(u=`^(?!${u}).*$`);let c=Oe.toRegex(u,e);return n===!0&&(c.state=t),c};Oe.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let s={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(s.output=zl.fastpaths(t,e)),s.output||(s=zl(t,e)),Oe.compileRe(s,e,r,n)};Oe.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return /$^/}};Oe.constants=Rk;zv.exports=Oe;});var Vl=_((gM,Vv)=>{Vv.exports=Gv();});var tS=_((mM,eS)=>{var xi=G("fs"),{Readable:Tk}=G("stream"),Ei=G("path"),{promisify:xo}=G("util"),Kl=Vl(),Pk=xo(xi.readdir),Ik=xo(xi.stat),Kv=xo(xi.lstat),$k=xo(xi.realpath),Fk="!",Qv="READDIRP_RECURSIVE_ERROR",kk=new Set(["ENOENT","EPERM","EACCES","ELOOP",Qv]),Yl="files",Zv="directories",bo="files_directories",So="all",Yv=[Yl,Zv,bo,So],Lk=t=>kk.has(t.code),[Jv,qk]=process.versions.node.split(".").slice(0,2).map(t=>Number.parseInt(t,10)),Bk=process.platform==="win32"&&(Jv>10||Jv===10&&qk>=5),Xv=t=>{if(t!==void 0){if(typeof t=="function")return t;if(typeof t=="string"){let e=Kl(t.trim());return r=>e(r.basename)}if(Array.isArray(t)){let e=[],r=[];for(let n of t){let s=n.trim();s.charAt(0)===Fk?r.push(Kl(s.slice(1))):e.push(Kl(s));}return r.length>0?e.length>0?n=>e.some(s=>s(n.basename))&&!r.some(s=>s(n.basename)):n=>!r.some(s=>s(n.basename)):n=>e.some(s=>s(n.basename))}}},Eo=class t extends Tk{static get defaultOptions(){return {root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:Yl,lstat:!1,depth:2147483648,alwaysStat:!1}}constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark||4096});let r={...t.defaultOptions,...e},{root:n,type:s}=r;this._fileFilter=Xv(r.fileFilter),this._directoryFilter=Xv(r.directoryFilter);let i=r.lstat?Kv:Ik;Bk?this._stat=o=>i(o,{bigint:!0}):this._stat=i,this._maxDepth=r.depth,this._wantsDir=[Zv,bo,So].includes(s),this._wantsFile=[Yl,bo,So].includes(s),this._wantsEverything=s===So,this._root=Ei.resolve(n),this._isDirent="Dirent"in xi&&!r.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0;}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let{path:r,depth:n,files:s=[]}=this.parent||{};if(s.length>0){let i=s.splice(0,e).map(o=>this._formatEntry(o,r));for(let o of await Promise.all(i)){if(this.destroyed)return;let u=await this._getEntryType(o);u==="directory"&&this._directoryFilter(o)?(n<=this._maxDepth&&this.parents.push(this._exploreDir(o.fullPath,n+1)),this._wantsDir&&(this.push(o),e--)):(u==="file"||this._includeAsFile(o))&&this._fileFilter(o)&&this._wantsFile&&(this.push(o),e--);}}else {let i=this.parents.pop();if(!i){this.push(null);break}if(this.parent=await i,this.destroyed)return}}}catch(r){this.destroy(r);}finally{this.reading=!1;}}}async _exploreDir(e,r){let n;try{n=await Pk(e,this._rdOptions);}catch(s){this._onError(s);}return {files:n,depth:r,path:e}}async _formatEntry(e,r){let n;try{let s=this._isDirent?e.name:e,i=Ei.resolve(Ei.join(r,s));n={path:Ei.relative(this._root,i),fullPath:i,basename:s},n[this._statsProp]=this._isDirent?e:await this._stat(i);}catch(s){this._onError(s);}return n}_onError(e){Lk(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e);}async _getEntryType(e){let r=e&&e[this._statsProp];if(r){if(r.isFile())return "file";if(r.isDirectory())return "directory";if(r&&r.isSymbolicLink()){let n=e.fullPath;try{let s=await $k(n),i=await Kv(s);if(i.isFile())return "file";if(i.isDirectory()){let o=s.length;if(n.startsWith(s)&&n.substr(o,1)===Ei.sep){let u=new Error(`Circular symlink detected: "${n}" points to "${s}"`);return u.code=Qv,this._onError(u)}return "directory"}}catch(s){this._onError(s);}}}}_includeAsFile(e){let r=e&&e[this._statsProp];return r&&this._wantsEverything&&!r.isDirectory()}},Cn=(t,e={})=>{let r=e.entryType||e.type;if(r==="both"&&(r=bo),r&&(e.type=r),t){if(typeof t!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(r&&!Yv.includes(r))throw new Error(`readdirp: Invalid type passed. Use one of ${Yv.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=t,new Eo(e)},Dk=(t,e={})=>new Promise((r,n)=>{let s=[];Cn(t,e).on("data",i=>s.push(i)).on("end",()=>r(s)).on("error",i=>n(i));});Cn.promise=Dk;Cn.ReaddirpStream=Eo;Cn.default=Cn;eS.exports=Cn;});var Jl=_((wM,rS)=>{rS.exports=function(t,e){if(typeof t!="string")throw new TypeError("expected path to be a string");if(t==="\\"||t==="/")return "/";var r=t.length;if(r<=1)return t;var n="";if(r>4&&t[3]==="\\"){var s=t[2];(s==="?"||s===".")&&t.slice(0,2)==="\\\\"&&(t=t.slice(2),n="//");}var i=t.split(/[/\\]+/);return e!==!1&&i[i.length-1]===""&&i.pop(),n+i.join("/")};});var uS=_((oS,aS)=>{Object.defineProperty(oS,"__esModule",{value:!0});var sS=Vl(),Nk=Jl(),nS="!",Mk={returnIndex:!1},Uk=t=>Array.isArray(t)?t:[t],jk=(t,e)=>{if(typeof t=="function")return t;if(typeof t=="string"){let r=sS(t,e);return n=>t===n||r(n)}return t instanceof RegExp?r=>t.test(r):r=>!1},iS=(t,e,r,n)=>{let s=Array.isArray(r),i=s?r[0]:r;if(!s&&typeof i!="string")throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(i));let o=Nk(i,!1);for(let c=0;c{if(t==null)throw new TypeError("anymatch: specify first argument");let n=typeof r=="boolean"?{returnIndex:r}:r,s=n.returnIndex||!1,i=Uk(t),o=i.filter(c=>typeof c=="string"&&c.charAt(0)===nS).map(c=>c.slice(1)).map(c=>sS(c,n)),u=i.filter(c=>typeof c!="string"||typeof c=="string"&&c.charAt(0)!==nS).map(c=>jk(c,n));return e==null?(c,p=!1)=>iS(u,o,c,typeof p=="boolean"?p:!1):iS(u,o,e,s)};Xl.default=Xl;aS.exports=Xl;});var cS=_((vM,lS)=>{lS.exports=function(e){if(typeof e!="string"||e==="")return !1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(r[2])return !0;e=e.slice(r.index+r[0].length);}return !1};});var Ql=_((SM,hS)=>{var Hk=cS(),fS={"{":"}","(":")","[":"]"},Wk=function(t){if(t[0]==="!")return !0;for(var e=0,r=-2,n=-2,s=-2,i=-2,o=-2;ee&&(o===-1||o>n||(o=t.indexOf("\\",e),o===-1||o>n)))||s!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(s=t.indexOf("}",e),s>e&&(o=t.indexOf("\\",e),o===-1||o>s))||i!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(i=t.indexOf(")",e),i>e&&(o=t.indexOf("\\",e),o===-1||o>i))||r!==-1&&t[e]==="("&&t[e+1]!=="|"&&(rr&&(o=t.indexOf("\\",r),o===-1||o>i))))return !0;if(t[e]==="\\"){var u=t[e+1];e+=2;var c=fS[u];if(c){var p=t.indexOf(c,e);p!==-1&&(e=p+1);}if(t[e]==="!")return !0}else e++;}return !1},zk=function(t){if(t[0]==="!")return !0;for(var e=0;e{var Gk=Ql(),Vk=G("path").posix.dirname,Kk=G("os").platform()==="win32",Zl="/",Yk=/\\/g,Jk=/[\{\[].*[\}\]]$/,Xk=/(^|[^\\])([\{\[]|\([^\)]+$)/,Qk=/\\([\!\*\?\|\[\]\(\)\{\}])/g;pS.exports=function(e,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&Kk&&e.indexOf(Zl)<0&&(e=e.replace(Yk,Zl)),Jk.test(e)&&(e+=Zl),e+="a";do e=Vk(e);while(Gk(e)||Xk.test(e));return e.replace(Qk,"$1")};});var Ao=_(xt=>{xt.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;xt.find=(t,e)=>t.nodes.find(r=>r.type===e);xt.exceedsLimit=(t,e,r=1,n)=>n===!1||!xt.isInteger(t)||!xt.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=n;xt.escapeNode=(t,e=0,r)=>{let n=t.nodes[e];n&&(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0);};xt.encloseBrace=t=>t.type!=="brace"||t.commas>>0+t.ranges>>0?!1:(t.invalid=!0,!0);xt.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:!(t.commas>>0+t.ranges>>0)||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;xt.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;xt.reduce=t=>t.reduce((e,r)=>(r.type==="text"&&e.push(r.value),r.type==="range"&&(r.type="text"),e),[]);xt.flatten=(...t)=>{let e=[],r=n=>{for(let s=0;s{var yS=Ao();gS.exports=(t,e={})=>{let r=(n,s={})=>{let i=e.escapeInvalid&&yS.isInvalidBrace(s),o=n.invalid===!0&&e.escapeInvalid===!0,u="";if(n.value)return (i||o)&&yS.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let c of n.nodes)u+=r(c);return u};return r(t)};});var wS=_((AM,mS)=>{mS.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1};});var RS=_((_M,CS)=>{var vS=wS(),Hr=(t,e,r)=>{if(vS(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(vS(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...r};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let s=String(n.relaxZeros),i=String(n.shorthand),o=String(n.capture),u=String(n.wrap),c=t+":"+e+"="+s+i+o+u;if(Hr.cache.hasOwnProperty(c))return Hr.cache[c].result;let p=Math.min(t,e),l=Math.max(t,e);if(Math.abs(p-l)===1){let E=t+"|"+e;return n.capture?`(${E})`:n.wrap===!1?E:`(?:${E})`}let d=_S(t)||_S(e),g={min:t,max:e,a:p,b:l},m=[],w=[];if(d&&(g.isPadded=d,g.maxLen=String(g.max).length),p<0){let E=l<0?Math.abs(l):1;w=SS(E,Math.abs(p),g,n),p=g.a=0;}return l>=0&&(m=SS(p,l,g,n)),g.negatives=w,g.positives=m,g.result=Zk(w,m),n.capture===!0?g.result=`(${g.result})`:n.wrap!==!1&&m.length+w.length>1&&(g.result=`(?:${g.result})`),Hr.cache[c]=g,g.result};function Zk(t,e,r){let n=ec(t,e,"-",!1)||[],s=ec(e,t,"",!1)||[],i=ec(t,e,"-?",!0)||[];return n.concat(i).concat(s).join("|")}function eL(t,e){let r=1,n=1,s=ES(t,r),i=new Set([e]);for(;t<=s&&s<=e;)i.add(s),r+=1,s=ES(t,r);for(s=xS(e+1,n)-1;t1&&u.count.pop(),u.count.push(l.count[0]),u.string=u.pattern+AS(u.count),o=p+1;continue}r.isPadded&&(d=sL(p,r,n)),l.string=d+l.pattern+AS(l.count),i.push(l),o=p+1,u=l;}return i}function ec(t,e,r,n,s){let i=[];for(let o of t){let{string:u}=o;!n&&!bS(e,"string",u)&&i.push(r+u),n&&bS(e,"string",u)&&i.push(r+u);}return i}function rL(t,e){let r=[];for(let n=0;ne?1:e>t?-1:0}function bS(t,e,r){return t.some(n=>n[e]===r)}function ES(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function xS(t,e){return t-t%Math.pow(10,e)}function AS(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function iL(t,e,r){return `[${t}${e-t===1?"":"-"}${e}]`}function _S(t){return /^-?(0+)\d/.test(t)}function sL(t,e,r){if(!e.isPadded)return t;let n=Math.abs(e.maxLen-String(t).length),s=r.relaxZeros!==!1;switch(n){case 0:return "";case 1:return s?"0?":"0";case 2:return s?"0{0,2}":"00";default:return s?`0{0,${n}}`:`0{${n}}`}}Hr.cache={};Hr.clearCache=()=>Hr.cache={};CS.exports=Hr;});var nc=_((CM,LS)=>{var oL=G("util"),PS=RS(),OS=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),aL=t=>e=>t===!0?Number(e):String(e),tc=t=>typeof t=="number"||typeof t=="string"&&t!=="",Ai=t=>Number.isInteger(+t),rc=t=>{let e=`${t}`,r=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return !1;for(;e[++r]==="0";);return r>0},uL=(t,e,r)=>typeof t=="string"||typeof e=="string"?!0:r.stringify===!0,lL=(t,e,r)=>{if(e>0){let n=t[0]==="-"?"-":"";n&&(t=t.slice(1)),t=n+t.padStart(n?e-1:e,"0");}return r===!1?String(t):t},TS=(t,e)=>{let r=t[0]==="-"?"-":"";for(r&&(t=t.slice(1),e--);t.length{t.negatives.sort((o,u)=>ou?1:0),t.positives.sort((o,u)=>ou?1:0);let r=e.capture?"":"?:",n="",s="",i;return t.positives.length&&(n=t.positives.join("|")),t.negatives.length&&(s=`-(${r}${t.negatives.join("|")})`),n&&s?i=`${n}|${s}`:i=n||s,e.wrap?`(${r}${i})`:i},IS=(t,e,r,n)=>{if(r)return PS(t,e,{wrap:!1,...n});let s=String.fromCharCode(t);if(t===e)return s;let i=String.fromCharCode(e);return `[${s}-${i}]`},$S=(t,e,r)=>{if(Array.isArray(t)){let n=r.wrap===!0,s=r.capture?"":"?:";return n?`(${s}${t.join("|")})`:t.join("|")}return PS(t,e,r)},FS=(...t)=>new RangeError("Invalid range arguments: "+oL.inspect(...t)),kS=(t,e,r)=>{if(r.strictRanges===!0)throw FS([t,e]);return []},fL=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return []},hL=(t,e,r=1,n={})=>{let s=Number(t),i=Number(e);if(!Number.isInteger(s)||!Number.isInteger(i)){if(n.strictRanges===!0)throw FS([t,e]);return []}s===0&&(s=0),i===0&&(i=0);let o=s>i,u=String(t),c=String(e),p=String(r);r=Math.max(Math.abs(r),1);let l=rc(u)||rc(c)||rc(p),d=l?Math.max(u.length,c.length,p.length):0,g=l===!1&&uL(t,e,n)===!1,m=n.transform||aL(g);if(n.toRegex&&r===1)return IS(TS(t,d),TS(e,d),!0,n);let w={negatives:[],positives:[]},E=x=>w[x<0?"negatives":"positives"].push(Math.abs(x)),A=[],R=0;for(;o?s>=i:s<=i;)n.toRegex===!0&&r>1?E(s):A.push(lL(m(s,R),d,g)),s=o?s-r:s+r,R++;return n.toRegex===!0?r>1?cL(w,n):$S(A,null,{wrap:!1,...n}):A},pL=(t,e,r=1,n={})=>{if(!Ai(t)&&t.length>1||!Ai(e)&&e.length>1)return kS(t,e,n);let s=n.transform||(g=>String.fromCharCode(g)),i=`${t}`.charCodeAt(0),o=`${e}`.charCodeAt(0),u=i>o,c=Math.min(i,o),p=Math.max(i,o);if(n.toRegex&&r===1)return IS(c,p,!1,n);let l=[],d=0;for(;u?i>=o:i<=o;)l.push(s(i,d)),i=u?i-r:i+r,d++;return n.toRegex===!0?$S(l,null,{wrap:!1,options:n}):l},Co=(t,e,r,n={})=>{if(e==null&&tc(t))return [t];if(!tc(t)||!tc(e))return kS(t,e,n);if(typeof r=="function")return Co(t,e,1,{transform:r});if(OS(r))return Co(t,e,0,r);let s={...n};return s.capture===!0&&(s.wrap=!0),r=r||s.step||1,Ai(r)?Ai(t)&&Ai(e)?hL(t,e,r,s):pL(t,e,Math.max(Math.abs(r),1),s):r!=null&&!OS(r)?fL(r,s):Co(t,e,1,r)};LS.exports=Co;});var DS=_((RM,BS)=>{var dL=nc(),qS=Ao(),yL=(t,e={})=>{let r=(n,s={})=>{let i=qS.isInvalidBrace(s),o=n.invalid===!0&&e.escapeInvalid===!0,u=i===!0||o===!0,c=e.escapeInvalid===!0?"\\":"",p="";if(n.isOpen===!0||n.isClose===!0)return c+n.value;if(n.type==="open")return u?c+n.value:"(";if(n.type==="close")return u?c+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":u?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let l=qS.reduce(n.nodes),d=dL(...l,{...e,wrap:!1,toRegex:!0});if(d.length!==0)return l.length>1&&d.length>1?`(${d})`:d}if(n.nodes)for(let l of n.nodes)p+=r(l,n);return p};return r(t)};BS.exports=yL;});var US=_((OM,MS)=>{var gL=nc(),NS=_o(),Rn=Ao(),Wr=(t="",e="",r=!1)=>{let n=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return r?Rn.flatten(e).map(s=>`{${s}}`):e;for(let s of t)if(Array.isArray(s))for(let i of s)n.push(Wr(i,e,r));else for(let i of e)r===!0&&typeof i=="string"&&(i=`{${i}}`),n.push(Array.isArray(i)?Wr(s,i,r):s+i);return Rn.flatten(n)},mL=(t,e={})=>{let r=e.rangeLimit===void 0?1e3:e.rangeLimit,n=(s,i={})=>{s.queue=[];let o=i,u=i.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,u=o.queue;if(s.invalid||s.dollar){u.push(Wr(u.pop(),NS(s,e)));return}if(s.type==="brace"&&s.invalid!==!0&&s.nodes.length===2){u.push(Wr(u.pop(),["{}"]));return}if(s.nodes&&s.ranges>0){let d=Rn.reduce(s.nodes);if(Rn.exceedsLimit(...d,e.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let g=gL(...d,e);g.length===0&&(g=NS(s,e)),u.push(Wr(u.pop(),g)),s.nodes=[];return}let c=Rn.encloseBrace(s),p=s.queue,l=s;for(;l.type!=="brace"&&l.type!=="root"&&l.parent;)l=l.parent,p=l.queue;for(let d=0;d{jS.exports={MAX_LENGTH:1024*64,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:` -`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"};});var KS=_((PM,VS)=>{var wL=_o(),{MAX_LENGTH:WS,CHAR_BACKSLASH:ic,CHAR_BACKTICK:vL,CHAR_COMMA:SL,CHAR_DOT:bL,CHAR_LEFT_PARENTHESES:EL,CHAR_RIGHT_PARENTHESES:xL,CHAR_LEFT_CURLY_BRACE:AL,CHAR_RIGHT_CURLY_BRACE:_L,CHAR_LEFT_SQUARE_BRACKET:zS,CHAR_RIGHT_SQUARE_BRACKET:GS,CHAR_DOUBLE_QUOTE:CL,CHAR_SINGLE_QUOTE:RL,CHAR_NO_BREAK_SPACE:OL,CHAR_ZERO_WIDTH_NOBREAK_SPACE:TL}=HS(),PL=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},n=typeof r.maxLength=="number"?Math.min(WS,r.maxLength):WS;if(t.length>n)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${n})`);let s={type:"root",input:t,nodes:[]},i=[s],o=s,u=s,c=0,p=t.length,l=0,d=0,g,w=()=>t[l++],E=A=>{if(A.type==="text"&&u.type==="dot"&&(u.type="text"),u&&u.type==="text"&&A.type==="text"){u.value+=A.value;return}return o.nodes.push(A),A.parent=o,A.prev=u,u=A,A};for(E({type:"bos"});l0){if(o.ranges>0){o.ranges=0;let A=o.nodes.shift();o.nodes=[A,{type:"text",value:wL(o)}];}E({type:"comma",value:g}),o.commas++;continue}if(g===bL&&d>0&&o.commas===0){let A=o.nodes;if(d===0||A.length===0){E({type:"text",value:g});continue}if(u.type==="dot"){if(o.range=[],u.value+=g,u.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,u.type="text";continue}o.ranges++,o.args=[];continue}if(u.type==="range"){A.pop();let R=A[A.length-1];R.value+=u.value+g,u=R,o.ranges--;continue}E({type:"dot",value:g});continue}E({type:"text",value:g});}do if(o=i.pop(),o.type!=="root"){o.nodes.forEach(x=>{x.nodes||(x.type==="open"&&(x.isOpen=!0),x.type==="close"&&(x.isClose=!0),x.nodes||(x.type="text"),x.invalid=!0);});let A=i[i.length-1],R=A.nodes.indexOf(o);A.nodes.splice(R,1,...o.nodes);}while(i.length>0);return E({type:"eos"}),s};VS.exports=PL;});var XS=_((IM,JS)=>{var YS=_o(),IL=DS(),$L=US(),FL=KS(),pt=(t,e={})=>{let r=[];if(Array.isArray(t))for(let n of t){let s=pt.create(n,e);Array.isArray(s)?r.push(...s):r.push(s);}else r=[].concat(pt.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};pt.parse=(t,e={})=>FL(t,e);pt.stringify=(t,e={})=>YS(typeof t=="string"?pt.parse(t,e):t,e);pt.compile=(t,e={})=>(typeof t=="string"&&(t=pt.parse(t,e)),IL(t,e));pt.expand=(t,e={})=>{typeof t=="string"&&(t=pt.parse(t,e));let r=$L(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};pt.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?pt.compile(t,e):pt.expand(t,e);JS.exports=pt;});var QS=_(($M,kL)=>{kL.exports=["3dm","3ds","3g2","3gp","7z","a","aac","adp","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"];});var eb=_((FM,ZS)=>{ZS.exports=QS();});var rb=_((kM,tb)=>{var LL=G("path"),qL=eb(),BL=new Set(qL);tb.exports=t=>BL.has(LL.extname(t).slice(1).toLowerCase());});var Ro=_(ee=>{var{sep:DL}=G("path"),{platform:sc}=process,NL=G("os");ee.EV_ALL="all";ee.EV_READY="ready";ee.EV_ADD="add";ee.EV_CHANGE="change";ee.EV_ADD_DIR="addDir";ee.EV_UNLINK="unlink";ee.EV_UNLINK_DIR="unlinkDir";ee.EV_RAW="raw";ee.EV_ERROR="error";ee.STR_DATA="data";ee.STR_END="end";ee.STR_CLOSE="close";ee.FSEVENT_CREATED="created";ee.FSEVENT_MODIFIED="modified";ee.FSEVENT_DELETED="deleted";ee.FSEVENT_MOVED="moved";ee.FSEVENT_CLONED="cloned";ee.FSEVENT_UNKNOWN="unknown";ee.FSEVENT_TYPE_FILE="file";ee.FSEVENT_TYPE_DIRECTORY="directory";ee.FSEVENT_TYPE_SYMLINK="symlink";ee.KEY_LISTENERS="listeners";ee.KEY_ERR="errHandlers";ee.KEY_RAW="rawEmitters";ee.HANDLER_KEYS=[ee.KEY_LISTENERS,ee.KEY_ERR,ee.KEY_RAW];ee.DOT_SLASH=`.${DL}`;ee.BACK_SLASH_RE=/\\/g;ee.DOUBLE_SLASH_RE=/\/\//;ee.SLASH_OR_BACK_SLASH_RE=/[/\\]/;ee.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/;ee.REPLACER_RE=/^\.[/\\]/;ee.SLASH="/";ee.SLASH_SLASH="//";ee.BRACE_START="{";ee.BANG="!";ee.ONE_DOT=".";ee.TWO_DOTS="..";ee.STAR="*";ee.GLOBSTAR="**";ee.ROOT_GLOBSTAR="/**/*";ee.SLASH_GLOBSTAR="/**";ee.DIR_SUFFIX="Dir";ee.ANYMATCH_OPTS={dot:!0};ee.STRING_TYPE="string";ee.FUNCTION_TYPE="function";ee.EMPTY_STR="";ee.EMPTY_FN=()=>{};ee.IDENTITY_FN=t=>t;ee.isWindows=sc==="win32";ee.isMacos=sc==="darwin";ee.isLinux=sc==="linux";ee.isIBMi=NL.type()==="OS400";});var ub=_((qM,ab)=>{var Zt=G("fs"),Le=G("path"),{promisify:Oi}=G("util"),ML=rb(),{isWindows:UL,isLinux:jL,EMPTY_FN:HL,EMPTY_STR:WL,KEY_LISTENERS:On,KEY_ERR:oc,KEY_RAW:_i,HANDLER_KEYS:zL,EV_CHANGE:To,EV_ADD:Oo,EV_ADD_DIR:GL,EV_ERROR:ib,STR_DATA:VL,STR_END:KL,BRACE_START:YL,STAR:JL}=Ro(),XL="watch",QL=Oi(Zt.open),sb=Oi(Zt.stat),ZL=Oi(Zt.lstat),eq=Oi(Zt.close),ac=Oi(Zt.realpath),tq={lstat:ZL,stat:sb},lc=(t,e)=>{t instanceof Set?t.forEach(e):e(t);},Ci=(t,e,r)=>{let n=t[e];n instanceof Set||(t[e]=n=new Set([n])),n.add(r);},rq=t=>e=>{let r=t[e];r instanceof Set?r.clear():delete t[e];},Ri=(t,e,r)=>{let n=t[e];n instanceof Set?n.delete(r):n===r&&delete t[e];},ob=t=>t instanceof Set?t.size===0:!t,Po=new Map;function nb(t,e,r,n,s){let i=(o,u)=>{r(t),s(o,u,{watchedPath:t}),u&&t!==u&&Io(Le.resolve(t,u),On,Le.join(t,u));};try{return Zt.watch(t,e,i)}catch(o){n(o);}}var Io=(t,e,r,n,s)=>{let i=Po.get(t);i&&lc(i[e],o=>{o(r,n,s);});},nq=(t,e,r,n)=>{let{listener:s,errHandler:i,rawEmitter:o}=n,u=Po.get(e),c;if(!r.persistent)return c=nb(t,r,s,i,o),c.close.bind(c);if(u)Ci(u,On,s),Ci(u,oc,i),Ci(u,_i,o);else {if(c=nb(t,r,Io.bind(null,e,On),i,Io.bind(null,e,_i)),!c)return;c.on(ib,async p=>{let l=Io.bind(null,e,oc);if(u.watcherUnusable=!0,UL&&p.code==="EPERM")try{let d=await QL(t,"r");await eq(d),l(p);}catch{}else l(p);}),u={listeners:s,errHandlers:i,rawEmitters:o,watcher:c},Po.set(e,u);}return ()=>{Ri(u,On,s),Ri(u,oc,i),Ri(u,_i,o),ob(u.listeners)&&(u.watcher.close(),Po.delete(e),zL.forEach(rq(u)),u.watcher=void 0,Object.freeze(u));}},uc=new Map,iq=(t,e,r,n)=>{let {listener:s,rawEmitter:i}=n,o=uc.get(e),p=o&&o.options;return p&&(p.persistentr.interval)&&(Zt.unwatchFile(e),o=void 0),o?(Ci(o,On,s),Ci(o,_i,i)):(o={listeners:s,rawEmitters:i,options:r,watcher:Zt.watchFile(e,r,(l,d)=>{lc(o.rawEmitters,m=>{m(To,e,{curr:l,prev:d});});let g=l.mtimeMs;(l.size!==d.size||g>d.mtimeMs||g===0)&&lc(o.listeners,m=>m(t,l));})},uc.set(e,o)),()=>{Ri(o,On,s),Ri(o,_i,i),ob(o.listeners)&&(uc.delete(e),Zt.unwatchFile(e),o.options=o.watcher=void 0,Object.freeze(o));}},cc=class{constructor(e){this.fsw=e,this._boundHandleError=r=>e._handleError(r);}_watchWithNodeFs(e,r){let n=this.fsw.options,s=Le.dirname(e),i=Le.basename(e);this.fsw._getWatchedDir(s).add(i);let u=Le.resolve(e),c={persistent:n.persistent};r||(r=HL);let p;return n.usePolling?(c.interval=n.enableBinaryInterval&&ML(i)?n.binaryInterval:n.interval,p=iq(e,u,c,{listener:r,rawEmitter:this.fsw._emitRaw})):p=nq(e,u,c,{listener:r,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),p}_handleFile(e,r,n){if(this.fsw.closed)return;let s=Le.dirname(e),i=Le.basename(e),o=this.fsw._getWatchedDir(s),u=r;if(o.has(i))return;let c=async(l,d)=>{if(this.fsw._throttle(XL,e,5)){if(!d||d.mtimeMs===0)try{let g=await sb(e);if(this.fsw.closed)return;let m=g.atimeMs,w=g.mtimeMs;(!m||m<=w||w!==u.mtimeMs)&&this.fsw._emit(To,e,g),jL&&u.ino!==g.ino?(this.fsw._closeFile(l),u=g,this.fsw._addPathCloser(l,this._watchWithNodeFs(e,c))):u=g;}catch{this.fsw._remove(s,i);}else if(o.has(i)){let g=d.atimeMs,m=d.mtimeMs;(!g||g<=m||m!==u.mtimeMs)&&this.fsw._emit(To,e,d),u=d;}}},p=this._watchWithNodeFs(e,c);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(Oo,e,0))return;this.fsw._emit(Oo,e,r);}return p}async _handleSymlink(e,r,n,s){if(this.fsw.closed)return;let i=e.fullPath,o=this.fsw._getWatchedDir(r);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let u;try{u=await ac(n);}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(o.has(s)?this.fsw._symlinkPaths.get(i)!==u&&(this.fsw._symlinkPaths.set(i,u),this.fsw._emit(To,n,e.stats)):(o.add(s),this.fsw._symlinkPaths.set(i,u),this.fsw._emit(Oo,n,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(i))return !0;this.fsw._symlinkPaths.set(i,!0);}_handleRead(e,r,n,s,i,o,u){if(e=Le.join(e,WL),!n.hasGlob&&(u=this.fsw._throttle("readdir",e,1e3),!u))return;let c=this.fsw._getWatchedDir(n.path),p=new Set,l=this.fsw._readdirp(e,{fileFilter:d=>n.filterPath(d),directoryFilter:d=>n.filterDir(d),depth:0}).on(VL,async d=>{if(this.fsw.closed){l=void 0;return}let g=d.path,m=Le.join(e,g);if(p.add(g),!(d.stats.isSymbolicLink()&&await this._handleSymlink(d,e,m,g))){if(this.fsw.closed){l=void 0;return}(g===s||!s&&!c.has(g))&&(this.fsw._incrReadyCount(),m=Le.join(i,Le.relative(i,m)),this._addToNodeFs(m,r,n,o+1));}}).on(ib,this._boundHandleError);return new Promise(d=>l.once(KL,()=>{if(this.fsw.closed){l=void 0;return}let g=u?u.clear():!1;d(),c.getChildren().filter(m=>m!==e&&!p.has(m)&&(!n.hasGlob||n.filterPath({fullPath:Le.resolve(e,m)}))).forEach(m=>{this.fsw._remove(e,m);}),l=void 0,g&&this._handleRead(e,!1,n,s,i,o,u);}))}async _handleDir(e,r,n,s,i,o,u){let c=this.fsw._getWatchedDir(Le.dirname(e)),p=c.has(Le.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!i&&!p&&(!o.hasGlob||o.globFilter(e))&&this.fsw._emit(GL,e,r),c.add(Le.basename(e)),this.fsw._getWatchedDir(e);let l,d,g=this.fsw.options.depth;if((g==null||s<=g)&&!this.fsw._symlinkPaths.has(u)){if(!i&&(await this._handleRead(e,n,o,i,e,s,l),this.fsw.closed))return;d=this._watchWithNodeFs(e,(m,w)=>{w&&w.mtimeMs===0||this._handleRead(m,!1,o,i,e,s,l);});}return d}async _addToNodeFs(e,r,n,s,i){let o=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return o(),!1;let u=this.fsw._getWatchHelpers(e,s);!u.hasGlob&&n&&(u.hasGlob=n.hasGlob,u.globFilter=n.globFilter,u.filterPath=c=>n.filterPath(c),u.filterDir=c=>n.filterDir(c));try{let c=await tq[u.statMethod](u.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(u.watchPath,c))return o(),!1;let p=this.fsw.options.followSymlinks&&!e.includes(JL)&&!e.includes(YL),l;if(c.isDirectory()){let d=Le.resolve(e),g=p?await ac(e):e;if(this.fsw.closed||(l=await this._handleDir(u.watchPath,c,r,s,i,u,g),this.fsw.closed))return;d!==g&&g!==void 0&&this.fsw._symlinkPaths.set(d,g);}else if(c.isSymbolicLink()){let d=p?await ac(e):e;if(this.fsw.closed)return;let g=Le.dirname(u.watchPath);if(this.fsw._getWatchedDir(g).add(u.watchPath),this.fsw._emit(Oo,u.watchPath,c),l=await this._handleDir(g,c,r,s,e,u,d),this.fsw.closed)return;d!==void 0&&this.fsw._symlinkPaths.set(Le.resolve(e),d);}else l=this._handleFile(u.watchPath,c,r);return o(),this.fsw._addPathCloser(e,l),!1}catch(c){if(this.fsw._handleError(c))return o(),e}}};ab.exports=cc;});var yb=_((BM,wc)=>{var gc=G("fs"),qe=G("path"),{promisify:mc}=G("util"),Tn;try{Tn=G("fsevents");}catch(t){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(t);}if(Tn){let t=process.version.match(/v(\d+)\.(\d+)/);if(t&&t[1]&&t[2]){let e=Number.parseInt(t[1],10),r=Number.parseInt(t[2],10);e===8&&r<16&&(Tn=void 0);}}var{EV_ADD:fc,EV_CHANGE:sq,EV_ADD_DIR:lb,EV_UNLINK:$o,EV_ERROR:oq,STR_DATA:aq,STR_END:uq,FSEVENT_CREATED:lq,FSEVENT_MODIFIED:cq,FSEVENT_DELETED:fq,FSEVENT_MOVED:hq,FSEVENT_UNKNOWN:pq,FSEVENT_TYPE_FILE:dq,FSEVENT_TYPE_DIRECTORY:Ti,FSEVENT_TYPE_SYMLINK:db,ROOT_GLOBSTAR:cb,DIR_SUFFIX:yq,DOT_SLASH:fb,FUNCTION_TYPE:hc,EMPTY_FN:gq,IDENTITY_FN:mq}=Ro(),wq=t=>isNaN(t)?{}:{depth:t},dc=mc(gc.stat),vq=mc(gc.lstat),hb=mc(gc.realpath),Sq={stat:dc,lstat:vq},zr=new Map,bq=10,Eq=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),xq=(t,e)=>({stop:Tn.watch(t,e)});function Aq(t,e,r,n){let s=qe.extname(e)?qe.dirname(e):e,i=qe.dirname(s),o=zr.get(s);_q(i)&&(s=i);let u=qe.resolve(t),c=u!==e,p=(d,g,m)=>{c&&(d=d.replace(e,u)),(d===u||!d.indexOf(u+qe.sep))&&r(d,g,m);},l=!1;for(let d of zr.keys())if(e.indexOf(qe.resolve(d)+qe.sep)===0){s=d,o=zr.get(s),l=!0;break}return o||l?o.listeners.add(p):(o={listeners:new Set([p]),rawEmitter:n,watcher:xq(s,(d,g)=>{if(!o.listeners.size)return;let m=Tn.getInfo(d,g);o.listeners.forEach(w=>{w(d,g,m);}),o.rawEmitter(m.event,d,m);})},zr.set(s,o)),()=>{let d=o.listeners;if(d.delete(p),!d.size&&(zr.delete(s),o.watcher))return o.watcher.stop().then(()=>{o.rawEmitter=o.watcher=void 0,Object.freeze(o);})}}var _q=t=>{let e=0;for(let r of zr.keys())if(r.indexOf(t)===0&&(e++,e>=bq))return !0;return !1},Cq=()=>Tn&&zr.size<128,pc=(t,e)=>{let r=0;for(;!t.indexOf(e)&&(t=qe.dirname(t))!==e;)r++;return r},pb=(t,e)=>t.type===Ti&&e.isDirectory()||t.type===db&&e.isSymbolicLink()||t.type===dq&&e.isFile(),yc=class{constructor(e){this.fsw=e;}checkIgnored(e,r){let n=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,r))return n.add(e),r&&r.isDirectory()&&n.add(e+cb),!0;n.delete(e),n.delete(e+cb);}addOrChange(e,r,n,s,i,o,u,c){let p=i.has(o)?sq:fc;this.handleEvent(p,e,r,n,s,i,o,u,c);}async checkExists(e,r,n,s,i,o,u,c){try{let p=await dc(e);if(this.fsw.closed)return;pb(u,p)?this.addOrChange(e,r,n,s,i,o,u,c):this.handleEvent($o,e,r,n,s,i,o,u,c);}catch(p){p.code==="EACCES"?this.addOrChange(e,r,n,s,i,o,u,c):this.handleEvent($o,e,r,n,s,i,o,u,c);}}handleEvent(e,r,n,s,i,o,u,c,p){if(!(this.fsw.closed||this.checkIgnored(r)))if(e===$o){let l=c.type===Ti;(l||o.has(u))&&this.fsw._remove(i,u,l);}else {if(e===fc){if(c.type===Ti&&this.fsw._getWatchedDir(r),c.type===db&&p.followSymlinks){let d=p.depth===void 0?void 0:pc(n,s)+1;return this._addToFsEvents(r,!1,!0,d)}this.fsw._getWatchedDir(i).add(u);}let l=c.type===Ti?e+yq:e;this.fsw._emit(l,r),l===lb&&this._addToFsEvents(r,!1,!0);}}_watchWithFsEvents(e,r,n,s){if(this.fsw.closed||this.fsw._isIgnored(e))return;let i=this.fsw.options,u=Aq(e,r,async(c,p,l)=>{if(this.fsw.closed||i.depth!==void 0&&pc(c,r)>i.depth)return;let d=n(qe.join(e,qe.relative(e,c)));if(s&&!s(d))return;let g=qe.dirname(d),m=qe.basename(d),w=this.fsw._getWatchedDir(l.type===Ti?d:g);if(Eq.has(p)||l.event===pq)if(typeof i.ignored===hc){let E;try{E=await dc(d);}catch{}if(this.fsw.closed||this.checkIgnored(d,E))return;pb(l,E)?this.addOrChange(d,c,r,g,w,m,l,i):this.handleEvent($o,d,c,r,g,w,m,l,i);}else this.checkExists(d,c,r,g,w,m,l,i);else switch(l.event){case lq:case cq:return this.addOrChange(d,c,r,g,w,m,l,i);case fq:case hq:return this.checkExists(d,c,r,g,w,m,l,i)}},this.fsw._emitRaw);return this.fsw._emitReady(),u}async _handleFsEventsSymlink(e,r,n,s){if(!(this.fsw.closed||this.fsw._symlinkPaths.has(r))){this.fsw._symlinkPaths.set(r,!0),this.fsw._incrReadyCount();try{let i=await hb(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(i))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(i||e,o=>{let u=e;return i&&i!==fb?u=o.replace(i,e):o!==fb&&(u=qe.join(e,o)),n(u)},!1,s);}catch(i){if(this.fsw._handleError(i))return this.fsw._emitReady()}}}emitAdd(e,r,n,s,i){let o=n(e),u=r.isDirectory(),c=this.fsw._getWatchedDir(qe.dirname(o)),p=qe.basename(o);u&&this.fsw._getWatchedDir(o),!c.has(p)&&(c.add(p),(!s.ignoreInitial||i===!0)&&this.fsw._emit(u?lb:fc,o,r));}initWatch(e,r,n,s){if(this.fsw.closed)return;let i=this._watchWithFsEvents(n.watchPath,qe.resolve(e||n.watchPath),s,n.globFilter);this.fsw._addPathCloser(r,i);}async _addToFsEvents(e,r,n,s){if(this.fsw.closed)return;let i=this.fsw.options,o=typeof r===hc?r:mq,u=this.fsw._getWatchHelpers(e);try{let c=await Sq[u.statMethod](u.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(u.watchPath,c))throw null;if(c.isDirectory()){if(u.globFilter||this.emitAdd(o(e),c,o,i,n),s&&s>i.depth)return;this.fsw._readdirp(u.watchPath,{fileFilter:p=>u.filterPath(p),directoryFilter:p=>u.filterDir(p),...wq(i.depth-(s||0))}).on(aq,p=>{if(this.fsw.closed||p.stats.isDirectory()&&!u.filterPath(p))return;let l=qe.join(u.watchPath,p.path),{fullPath:d}=p;if(u.followSymlinks&&p.stats.isSymbolicLink()){let g=i.depth===void 0?void 0:pc(l,qe.resolve(u.watchPath))+1;this._handleFsEventsSymlink(l,d,o,g);}else this.emitAdd(l,p.stats,o,i,n);}).on(oq,gq).on(uq,()=>{this.fsw._emitReady();});}else this.emitAdd(u.watchPath,c,o,i,n),this.fsw._emitReady();}catch(c){(!c||this.fsw._handleError(c))&&(this.fsw._emitReady(),this.fsw._emitReady());}if(i.persistent&&n!==!0)if(typeof r===hc)this.initWatch(void 0,e,u,o);else {let c;try{c=await hb(u.watchPath);}catch{}this.initWatch(c,e,u,o);}}};wc.exports=yc;wc.exports.canUse=Cq;});var Cb=_(Fc=>{var{EventEmitter:Rq}=G("events"),Ic=G("fs"),ge=G("path"),{promisify:Eb}=G("util"),Oq=tS(),Ac=uS().default,Tq=dS(),vc=Ql(),Pq=XS(),Iq=Jl(),$q=ub(),gb=yb(),{EV_ALL:Sc,EV_READY:Fq,EV_ADD:Fo,EV_CHANGE:Pi,EV_UNLINK:mb,EV_ADD_DIR:kq,EV_UNLINK_DIR:Lq,EV_RAW:qq,EV_ERROR:bc,STR_CLOSE:Bq,STR_END:Dq,BACK_SLASH_RE:Nq,DOUBLE_SLASH_RE:wb,SLASH_OR_BACK_SLASH_RE:Mq,DOT_RE:Uq,REPLACER_RE:jq,SLASH:Ec,SLASH_SLASH:Hq,BRACE_START:Wq,BANG:_c,ONE_DOT:xb,TWO_DOTS:zq,GLOBSTAR:Gq,SLASH_GLOBSTAR:xc,ANYMATCH_OPTS:Cc,STRING_TYPE:$c,FUNCTION_TYPE:Vq,EMPTY_STR:Rc,EMPTY_FN:Kq,isWindows:Yq,isMacos:Jq,isIBMi:Xq}=Ro(),Qq=Eb(Ic.stat),Zq=Eb(Ic.readdir),Oc=(t=[])=>Array.isArray(t)?t:[t],Ab=(t,e=[])=>(t.forEach(r=>{Array.isArray(r)?Ab(r,e):e.push(r);}),e),vb=t=>{let e=Ab(Oc(t));if(!e.every(r=>typeof r===$c))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(_b)},Sb=t=>{let e=t.replace(Nq,Ec),r=!1;for(e.startsWith(Hq)&&(r=!0);e.match(wb);)e=e.replace(wb,Ec);return r&&(e=Ec+e),e},_b=t=>Sb(ge.normalize(Sb(t))),bb=(t=Rc)=>e=>typeof e!==$c?e:_b(ge.isAbsolute(e)?e:ge.join(t,e)),eB=(t,e)=>ge.isAbsolute(t)?t:t.startsWith(_c)?_c+ge.join(e,t.slice(1)):ge.join(e,t),Pt=(t,e)=>t[e]===void 0,Tc=class{constructor(e,r){this.path=e,this._removeWatcher=r,this.items=new Set;}add(e){let{items:r}=this;r&&e!==xb&&e!==zq&&r.add(e);}async remove(e){let{items:r}=this;if(!r||(r.delete(e),r.size>0))return;let n=this.path;try{await Zq(n);}catch{this._removeWatcher&&this._removeWatcher(ge.dirname(n),ge.basename(n));}}has(e){let{items:r}=this;if(r)return r.has(e)}getChildren(){let{items:e}=this;if(e)return [...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this);}},tB="stat",rB="lstat",Pc=class{constructor(e,r,n,s){this.fsw=s,this.path=e=e.replace(jq,Rc),this.watchPath=r,this.fullWatchPath=ge.resolve(r),this.hasGlob=r!==e,e===Rc&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&n?void 0:!1,this.globFilter=this.hasGlob?Ac(e,void 0,Cc):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(i=>{i.length>1&&i.pop();}),this.followSymlinks=n,this.statMethod=n?tB:rB;}checkGlobSymlink(e){return this.globSymlink===void 0&&(this.globSymlink=e.fullParentDir===this.fullWatchPath?!1:{realPath:e.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):e.fullPath}entryPath(e){return ge.join(this.watchPath,ge.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){let{stats:r}=e;if(r&&r.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return (this.hasGlob&&typeof this.globFilter===Vq?this.globFilter(n):!0)&&this.fsw._isntIgnored(n,r)&&this.fsw._hasReadPermissions(r)}getDirParts(e){if(!this.hasGlob)return [];let r=[];return (e.includes(Wq)?Pq.expand(e):[e]).forEach(s=>{r.push(ge.relative(this.watchPath,s).split(Mq));}),r}filterDir(e){if(this.hasGlob){let r=this.getDirParts(this.checkGlobSymlink(e)),n=!1;this.unmatchedGlob=!this.dirParts.some(s=>s.every((i,o)=>(i===Gq&&(n=!0),n||!r[0][o]||Ac(i,r[0][o],Cc))));}return !this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}},ko=class extends Rq{constructor(e){super();let r={};e&&Object.assign(r,e),this._watched=new Map,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._symlinkPaths=new Map,this._streams=new Set,this.closed=!1,Pt(r,"persistent")&&(r.persistent=!0),Pt(r,"ignoreInitial")&&(r.ignoreInitial=!1),Pt(r,"ignorePermissionErrors")&&(r.ignorePermissionErrors=!1),Pt(r,"interval")&&(r.interval=100),Pt(r,"binaryInterval")&&(r.binaryInterval=300),Pt(r,"disableGlobbing")&&(r.disableGlobbing=!1),r.enableBinaryInterval=r.binaryInterval!==r.interval,Pt(r,"useFsEvents")&&(r.useFsEvents=!r.usePolling),gb.canUse()||(r.useFsEvents=!1),Pt(r,"usePolling")&&!r.useFsEvents&&(r.usePolling=Jq),Xq&&(r.usePolling=!0);let s=process.env.CHOKIDAR_USEPOLLING;if(s!==void 0){let c=s.toLowerCase();c==="false"||c==="0"?r.usePolling=!1:c==="true"||c==="1"?r.usePolling=!0:r.usePolling=!!c;}let i=process.env.CHOKIDAR_INTERVAL;i&&(r.interval=Number.parseInt(i,10)),Pt(r,"atomic")&&(r.atomic=!r.usePolling&&!r.useFsEvents),r.atomic&&(this._pendingUnlinks=new Map),Pt(r,"followSymlinks")&&(r.followSymlinks=!0),Pt(r,"awaitWriteFinish")&&(r.awaitWriteFinish=!1),r.awaitWriteFinish===!0&&(r.awaitWriteFinish={});let o=r.awaitWriteFinish;o&&(o.stabilityThreshold||(o.stabilityThreshold=2e3),o.pollInterval||(o.pollInterval=100),this._pendingWrites=new Map),r.ignored&&(r.ignored=Oc(r.ignored));let u=0;this._emitReady=()=>{u++,u>=this._readyCount&&(this._emitReady=Kq,this._readyEmitted=!0,process.nextTick(()=>this.emit(Fq)));},this._emitRaw=(...c)=>this.emit(qq,...c),this._readyEmitted=!1,this.options=r,r.useFsEvents?this._fsEventsHandler=new gb(this):this._nodeFsHandler=new $q(this),Object.freeze(r);}add(e,r,n){let{cwd:s,disableGlobbing:i}=this.options;this.closed=!1;let o=vb(e);return s&&(o=o.map(u=>{let c=eB(u,s);return i||!vc(u)?c:Iq(c)})),o=o.filter(u=>u.startsWith(_c)?(this._ignoredPaths.add(u.slice(1)),!1):(this._ignoredPaths.delete(u),this._ignoredPaths.delete(u+xc),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=o.length),this.options.persistent&&(this._readyCount*=2),o.forEach(u=>this._fsEventsHandler._addToFsEvents(u))):(this._readyCount||(this._readyCount=0),this._readyCount+=o.length,Promise.all(o.map(async u=>{let c=await this._nodeFsHandler._addToNodeFs(u,!n,0,0,r);return c&&this._emitReady(),c})).then(u=>{this.closed||u.filter(c=>c).forEach(c=>{this.add(ge.dirname(c),ge.basename(r||c));});})),this}unwatch(e){if(this.closed)return this;let r=vb(e),{cwd:n}=this.options;return r.forEach(s=>{!ge.isAbsolute(s)&&!this._closers.has(s)&&(n&&(s=ge.join(n,s)),s=ge.resolve(s)),this._closePath(s),this._ignoredPaths.add(s),this._watched.has(s)&&this._ignoredPaths.add(s+xc),this._userIgnored=void 0;}),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(r=>r.forEach(n=>{let s=n();s instanceof Promise&&e.push(s);})),this._streams.forEach(r=>r.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(r=>r.dispose()),["closers","watched","streams","symlinkPaths","throttled"].forEach(r=>{this[`_${r}`].clear();}),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((r,n)=>{let s=this.options.cwd?ge.relative(this.options.cwd,n):n;e[s||xb]=r.getChildren().sort();}),e}emitWithAll(e,r){this.emit(...r),e!==bc&&this.emit(Sc,...r);}async _emit(e,r,n,s,i){if(this.closed)return;let o=this.options;Yq&&(r=ge.normalize(r)),o.cwd&&(r=ge.relative(o.cwd,r));let u=[e,r];i!==void 0?u.push(n,s,i):s!==void 0?u.push(n,s):n!==void 0&&u.push(n);let c=o.awaitWriteFinish,p;if(c&&(p=this._pendingWrites.get(r)))return p.lastChange=new Date,this;if(o.atomic){if(e===mb)return this._pendingUnlinks.set(r,u),setTimeout(()=>{this._pendingUnlinks.forEach((l,d)=>{this.emit(...l),this.emit(Sc,...l),this._pendingUnlinks.delete(d);});},typeof o.atomic=="number"?o.atomic:100),this;e===Fo&&this._pendingUnlinks.has(r)&&(e=u[0]=Pi,this._pendingUnlinks.delete(r));}if(c&&(e===Fo||e===Pi)&&this._readyEmitted){let l=(d,g)=>{d?(e=u[0]=bc,u[1]=d,this.emitWithAll(e,u)):g&&(u.length>2?u[2]=g:u.push(g),this.emitWithAll(e,u));};return this._awaitWriteFinish(r,c.stabilityThreshold,e,l),this}if(e===Pi&&!this._throttle(Pi,r,50))return this;if(o.alwaysStat&&n===void 0&&(e===Fo||e===kq||e===Pi)){let l=o.cwd?ge.join(o.cwd,r):r,d;try{d=await Qq(l);}catch{}if(!d||this.closed)return;u.push(d);}return this.emitWithAll(e,u),this}_handleError(e){let r=e&&e.code;return e&&r!=="ENOENT"&&r!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||r!=="EPERM"&&r!=="EACCES")&&this.emit(bc,e),e||this.closed}_throttle(e,r,n){this._throttled.has(e)||this._throttled.set(e,new Map);let s=this._throttled.get(e),i=s.get(r);if(i)return i.count++,!1;let o,u=()=>{let p=s.get(r),l=p?p.count:0;return s.delete(r),clearTimeout(o),p&&clearTimeout(p.timeoutObject),l};o=setTimeout(u,n);let c={timeoutObject:o,clear:u,count:0};return s.set(r,c),c}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,r,n,s){let i,o=e;this.options.cwd&&!ge.isAbsolute(e)&&(o=ge.join(this.options.cwd,e));let u=new Date,c=p=>{Ic.stat(o,(l,d)=>{if(l||!this._pendingWrites.has(e)){l&&l.code!=="ENOENT"&&s(l);return}let g=Number(new Date);p&&d.size!==p.size&&(this._pendingWrites.get(e).lastChange=g);let m=this._pendingWrites.get(e);g-m.lastChange>=r?(this._pendingWrites.delete(e),s(void 0,d)):i=setTimeout(c,this.options.awaitWriteFinish.pollInterval,d);});};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:u,cancelWait:()=>(this._pendingWrites.delete(e),clearTimeout(i),n)}),i=setTimeout(c,this.options.awaitWriteFinish.pollInterval));}_getGlobIgnored(){return [...this._ignoredPaths.values()]}_isIgnored(e,r){if(this.options.atomic&&Uq.test(e))return !0;if(!this._userIgnored){let{cwd:n}=this.options,s=this.options.ignored,i=s&&s.map(bb(n)),o=Oc(i).filter(c=>typeof c===$c&&!vc(c)).map(c=>c+xc),u=this._getGlobIgnored().map(bb(n)).concat(i,o);this._userIgnored=Ac(u,void 0,Cc);}return this._userIgnored([e,r])}_isntIgnored(e,r){return !this._isIgnored(e,r)}_getWatchHelpers(e,r){let n=r||this.options.disableGlobbing||!vc(e)?e:Tq(e),s=this.options.followSymlinks;return new Pc(e,n,s,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));let r=ge.resolve(e);return this._watched.has(r)||this._watched.set(r,new Tc(r,this._boundRemove)),this._watched.get(r)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return !0;let n=(e&&Number.parseInt(e.mode,10))&511;return !!(4&Number.parseInt(n.toString(8)[0],10))}_remove(e,r,n){let s=ge.join(e,r),i=ge.resolve(s);if(n=n??(this._watched.has(s)||this._watched.has(i)),!this._throttle("remove",s,100))return;!n&&!this.options.useFsEvents&&this._watched.size===1&&this.add(e,r,!0),this._getWatchedDir(s).getChildren().forEach(g=>this._remove(s,g));let c=this._getWatchedDir(e),p=c.has(r);c.remove(r),this._symlinkPaths.has(i)&&this._symlinkPaths.delete(i);let l=s;if(this.options.cwd&&(l=ge.relative(this.options.cwd,s)),this.options.awaitWriteFinish&&this._pendingWrites.has(l)&&this._pendingWrites.get(l).cancelWait()===Fo)return;this._watched.delete(s),this._watched.delete(i);let d=n?Lq:mb;p&&!this._isIgnored(s)&&this._emit(d,s),this.options.useFsEvents||this._closePath(s);}_closePath(e){this._closeFile(e);let r=ge.dirname(e);this._getWatchedDir(r).remove(ge.basename(e));}_closeFile(e){let r=this._closers.get(e);r&&(r.forEach(n=>n()),this._closers.delete(e));}_addPathCloser(e,r){if(!r)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(r);}_readdirp(e,r){if(this.closed)return;let n={type:Sc,alwaysStat:!0,lstat:!0,...r},s=Oq(e,n);return this._streams.add(s),s.once(Bq,()=>{s=void 0;}),s.once(Dq,()=>{s&&(this._streams.delete(s),s=void 0);}),s}};Fc.FSWatcher=ko;var nB=(t,e)=>{let r=new ko(e);return r.add(t),r};Fc.watch=nB;});var Bb=_((Jr,qb)=>{var Uc=G("crypto");Jr=qb.exports=Di;function Di(t,e){return e=kb(t,e),oB(t,e)}Jr.sha1=function(t){return Di(t)};Jr.keys=function(t){return Di(t,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})};Jr.MD5=function(t){return Di(t,{algorithm:"md5",encoding:"hex"})};Jr.keysMD5=function(t){return Di(t,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var Bn=Uc.getHashes?Uc.getHashes().slice():["sha1","md5"];Bn.push("passthrough");var $b=["buffer","hex","binary","base64"];function kb(t,e){e=e||{};var r={};if(r.algorithm=e.algorithm||"sha1",r.encoding=e.encoding||"hex",r.excludeValues=!!e.excludeValues,r.algorithm=r.algorithm.toLowerCase(),r.encoding=r.encoding.toLowerCase(),r.ignoreUnknown=e.ignoreUnknown===!0,r.respectType=e.respectType!==!1,r.respectFunctionNames=e.respectFunctionNames!==!1,r.respectFunctionProperties=e.respectFunctionProperties!==!1,r.unorderedArrays=e.unorderedArrays===!0,r.unorderedSets=e.unorderedSets!==!1,r.unorderedObjects=e.unorderedObjects!==!1,r.replacer=e.replacer||void 0,r.excludeKeys=e.excludeKeys||void 0,typeof t>"u")throw new Error("Object argument required.");for(var n=0;n"u"&&(r.write=r.update,r.end=r.update);var n=jc(e,r);if(n.dispatch(t),r.update||r.end(""),r.digest)return r.digest(e.encoding==="buffer"?void 0:e.encoding);var s=r.read();return e.encoding==="buffer"?s:s.toString(e.encoding)}Jr.writeToStream=function(t,e,r){return typeof r>"u"&&(r=e,e={}),e=kb(t,e),jc(e,r).dispatch(t)};function jc(t,e,r){r=r||[];var n=function(s){return e.update?e.update(s,"utf8"):e.write(s,"utf8")};return {dispatch:function(s){t.replacer&&(s=t.replacer(s));var i=typeof s;return s===null&&(i="null"),this["_"+i](s)},_object:function(s){var i=/\[object (.*)\]/i,o=Object.prototype.toString.call(s),u=i.exec(o);u?u=u[1]:u="unknown:["+o+"]",u=u.toLowerCase();var c=null;if((c=r.indexOf(s))>=0)return this.dispatch("[CIRCULAR:"+c+"]");if(r.push(s),typeof Buffer<"u"&&Buffer.isBuffer&&Buffer.isBuffer(s))return n("buffer:"),n(s);if(u!=="object"&&u!=="function"&&u!=="asyncfunction")if(this["_"+u])this["_"+u](s);else {if(t.ignoreUnknown)return n("["+u+"]");throw new Error('Unknown object type "'+u+'"')}else {var p=Object.keys(s);t.unorderedObjects&&(p=p.sort()),t.respectType!==!1&&!Fb(s)&&p.splice(0,0,"prototype","__proto__","constructor"),t.excludeKeys&&(p=p.filter(function(d){return !t.excludeKeys(d)})),n("object:"+p.length+":");var l=this;return p.forEach(function(d){l.dispatch(d),n(":"),t.excludeValues||l.dispatch(s[d]),n(",");})}},_array:function(s,i){i=typeof i<"u"?i:t.unorderedArrays!==!1;var o=this;if(n("array:"+s.length+":"),!i||s.length<=1)return s.forEach(function(p){return o.dispatch(p)});var u=[],c=s.map(function(p){var l=new Lb,d=r.slice(),g=jc(t,l,d);return g.dispatch(p),u=u.concat(d.slice(r.length)),l.read().toString()});return r=r.concat(u),c.sort(),this._array(c,!1)},_date:function(s){return n("date:"+s.toJSON())},_symbol:function(s){return n("symbol:"+s.toString())},_error:function(s){return n("error:"+s.toString())},_boolean:function(s){return n("bool:"+s.toString())},_string:function(s){n("string:"+s.length+":"),n(s.toString());},_function:function(s){n("fn:"),Fb(s)?this.dispatch("[native]"):this.dispatch(s.toString()),t.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(s.name)),t.respectFunctionProperties&&this._object(s);},_number:function(s){return n("number:"+s.toString())},_xml:function(s){return n("xml:"+s.toString())},_null:function(){return n("Null")},_undefined:function(){return n("Undefined")},_regexp:function(s){return n("regex:"+s.toString())},_uint8array:function(s){return n("uint8array:"),this.dispatch(Array.prototype.slice.call(s))},_uint8clampedarray:function(s){return n("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(s))},_int8array:function(s){return n("int8array:"),this.dispatch(Array.prototype.slice.call(s))},_uint16array:function(s){return n("uint16array:"),this.dispatch(Array.prototype.slice.call(s))},_int16array:function(s){return n("int16array:"),this.dispatch(Array.prototype.slice.call(s))},_uint32array:function(s){return n("uint32array:"),this.dispatch(Array.prototype.slice.call(s))},_int32array:function(s){return n("int32array:"),this.dispatch(Array.prototype.slice.call(s))},_float32array:function(s){return n("float32array:"),this.dispatch(Array.prototype.slice.call(s))},_float64array:function(s){return n("float64array:"),this.dispatch(Array.prototype.slice.call(s))},_arraybuffer:function(s){return n("arraybuffer:"),this.dispatch(new Uint8Array(s))},_url:function(s){return n("url:"+s.toString())},_map:function(s){n("map:");var i=Array.from(s);return this._array(i,t.unorderedSets!==!1)},_set:function(s){n("set:");var i=Array.from(s);return this._array(i,t.unorderedSets!==!1)},_file:function(s){return n("file:"),this.dispatch([s.name,s.size,s.type,s.lastModfied])},_blob:function(){if(t.ignoreUnknown)return n("[blob]");throw Error(`Hashing Blob objects is currently not supported +`,"utf-8"),this.emit("history");}async immutate(r){let{size:n}=this.options,s=this.now();for(let i=1;i<1e3;++i){let o=0,l;this.filename=this.options.path+this.generator(s,i);try{l=await this.fsStat(this.filename);}catch(c){if(c.code!=="ENOENT")throw c}if(l){if(o=l.size,!l.isFile())throw new Error(`Can't write on: '${this.filename}' (it is not a file)`);if(n&&o>=n)continue}if(r)return this.last=this.filename,this.reopen(o);await this.rotated(this.last),this.last=this.filename;return}throw new ai}async unlink(r){try{await this.fsUnlink(r);}catch(n){if(n.code!=="ENOENT")throw n;this.emit("warning",n);}}};BI={M:!0,d:!0,h:!0,m:!0,s:!0};UI={B:!0,G:!0,K:!0,M:!0};Gw={encoding:(t,e,r)=>new util.TextDecoder(r),immutable:()=>{},initialRotation:()=>{},interval:vu("interval",HI),intervalBoundary:()=>{},maxFiles:Ww("maxFiles"),maxSize:vu("maxSize",zw),mode:()=>{},omitExtension:()=>{},rotate:Ww("rotate"),size:vu("size",zw),teeToStdout:()=>{},compress:(t,e,r)=>{if(!r)throw new Error("A value for 'options.compress' must be specified");if(t==="boolean")return e.compress=(n,s)=>`cat ${n} | gzip -c9 > ${s}`;if(t!=="function"){if(t!=="string")throw new Error(`Don't know how to handle 'options.compress' type: ${t}`);if(r!=="gzip")throw new Error(`Don't know how to handle compression method: ${r}`)}},history:t=>{if(t!=="string")throw new Error(`Don't know how to handle 'options.history' type: ${t}`)},path:(t,e,r)=>{if(t!=="string")throw new Error(`Don't know how to handle 'options.path' type: ${t}`);r[r.length-1]!==path.sep&&(e.path=r+path.sep);}};});var Zw={};Wo(Zw,{allLoggers:()=>gn,rootLogger:()=>Ce});var to,Jw,Xw,Ce,gn,Nt=qi(()=>{to=Nn(Bw());Jn();Jw=(Yw(),zo(Vw)).createStream("tabby-agent.log",{path:z("path").join(z("os").homedir(),".tabby-client","agent","logs"),size:"10M",interval:"1d"}),Xw={serializers:{error:to.default.stdSerializers.err}},Ce=Jw?(0, to.default)(Xw,Jw):(0, to.default)(Xw);Ce.level="silent";gn=[Ce];Ce.onChild=t=>{gn.push(t);};});var tS=R((OM,eS)=>{eS.exports=function(){function t(n,s){function i(){this.constructor=n;}i.prototype=s.prototype,n.prototype=new i;}function e(n,s,i,o,l,c){this.message=n,this.expected=s,this.found=i,this.offset=o,this.line=l,this.column=c,this.name="SyntaxError";}t(e,Error);function r(n){var s=arguments.length>1?arguments[1]:{},i={},o={start:sf},l=sf,p=function(){return _f},u=i,g="#",y={type:"literal",value:"#",description:'"#"'},m=void 0,v={type:"any",description:"any character"},b="[",_={type:"literal",value:"[",description:'"["'},x="]",A={type:"literal",value:"]",description:'"]"'},O=function(a){Ho(je("ObjectPath",a,Ne,Me));},I=function(a){Ho(je("ArrayPath",a,Ne,Me));},F=function(a,h){return a.concat(h)},U=function(a){return [a]},H=function(a){return a},q=".",k={type:"literal",value:".",description:'"."'},j="=",C={type:"literal",value:"=",description:'"="'},V=function(a,h){Ho(je("Assign",h,Ne,Me,a));},Y=function(a){return a.join("")},se=function(a){return a.value},T='"""',$={type:"literal",value:'"""',description:'"\\"\\"\\""'},te=null,Q=function(a){return je("String",a.join(""),Ne,Me)},ue='"',Ge={type:"literal",value:'"',description:'"\\""'},Oe="'''",Qt={type:"literal",value:"'''",description:`"'''"`},Pn="'",Zt={type:"literal",value:"'",description:`"'"`},St=function(a){return a},ce=function(a){return a},zr="\\",Fo={type:"literal",value:"\\",description:'"\\\\"'},K=function(){return ""},me="e",W={type:"literal",value:"e",description:'"e"'},le="E",we={type:"literal",value:"E",description:'"E"'},De=function(a,h){return je("Float",parseFloat(a+"e"+h),Ne,Me)},_e=function(a){return je("Float",parseFloat(a),Ne,Me)},Er="+",er={type:"literal",value:"+",description:'"+"'},Fc=function(a){return a.join("")},Tn="-",$n={type:"literal",value:"-",description:'"-"'},qc=function(a){return "-"+a.join("")},$0=function(a){return je("Integer",parseInt(a,10),Ne,Me)},Dc="true",I0={type:"literal",value:"true",description:'"true"'},k0=function(){return je("Boolean",!0,Ne,Me)},Nc="false",L0={type:"literal",value:"false",description:'"false"'},F0=function(){return je("Boolean",!1,Ne,Me)},q0=function(){return je("Array",[],Ne,Me)},D0=function(a){return je("Array",a?[a]:[],Ne,Me)},N0=function(a){return je("Array",a,Ne,Me)},M0=function(a,h){return je("Array",a.concat(h),Ne,Me)},Mc=function(a){return a},jc=",",Bc={type:"literal",value:",",description:'","'},j0="{",B0={type:"literal",value:"{",description:'"{"'},H0="}",U0={type:"literal",value:"}",description:'"}"'},W0=function(a){return je("InlineTable",a,Ne,Me)},Hc=function(a,h){return je("InlineTableValue",h,Ne,Me,a)},z0=function(a){return "."+a},G0=function(a){return a.join("")},In=":",kn={type:"literal",value:":",description:'":"'},Uc=function(a){return a.join("")},Wc="T",zc={type:"literal",value:"T",description:'"T"'},K0="Z",V0={type:"literal",value:"Z",description:'"Z"'},Y0=function(a,h){return je("Date",new Date(a+"T"+h+"Z"),Ne,Me)},J0=function(a,h){return je("Date",new Date(a+"T"+h),Ne,Me)},X0=/^[ \t]/,Q0={type:"class",value:"[ \\t]",description:"[ \\t]"},Gc=` +`,Kc={type:"literal",value:` +`,description:'"\\n"'},Z0="\r",eE={type:"literal",value:"\r",description:'"\\r"'},tE=/^[0-9a-f]/i,rE={type:"class",value:"[0-9a-f]i",description:"[0-9a-f]i"},nE=/^[0-9]/,iE={type:"class",value:"[0-9]",description:"[0-9]"},sE="_",oE={type:"literal",value:"_",description:'"_"'},aE=function(){return ""},lE=/^[A-Za-z0-9_\-]/,uE={type:"class",value:"[A-Za-z0-9_\\-]",description:"[A-Za-z0-9_\\-]"},cE=function(a){return a.join("")},Vc='\\"',fE={type:"literal",value:'\\"',description:'"\\\\\\""'},hE=function(){return '"'},Yc="\\\\",pE={type:"literal",value:"\\\\",description:'"\\\\\\\\"'},dE=function(){return "\\"},Jc="\\b",gE={type:"literal",value:"\\b",description:'"\\\\b"'},yE=function(){return "\b"},Xc="\\t",mE={type:"literal",value:"\\t",description:'"\\\\t"'},vE=function(){return " "},Qc="\\n",wE={type:"literal",value:"\\n",description:'"\\\\n"'},SE=function(){return ` +`},Zc="\\f",bE={type:"literal",value:"\\f",description:'"\\\\f"'},EE=function(){return "\f"},ef="\\r",AE={type:"literal",value:"\\r",description:'"\\\\r"'},_E=function(){return "\r"},tf="\\U",xE={type:"literal",value:"\\U",description:'"\\\\U"'},rf=function(a){return zE(a.join(""))},nf="\\u",CE={type:"literal",value:"\\u",description:'"\\\\u"'},f=0,J=0,Ln=0,qo={line:1,column:1,seenCR:!1},$i=0,Do=[],N=0,M={},Ii;if("startRule"in s){if(!(s.startRule in o))throw new Error(`Can't start parsing from rule "`+s.startRule+'".');l=o[s.startRule];}function Ne(){return No(J).line}function Me(){return No(J).column}function No(a){function h(d,w,E){var P,L;for(P=w;Pa&&(Ln=0,qo={line:1,column:1,seenCR:!1}),h(qo,Ln,a),Ln=a),qo}function B(a){f<$i||(f>$i&&($i=f,Do=[]),Do.push(a));}function Mo(a,h,d){function w(G){var ie=1;for(G.sort(function(de,he){return de.descriptionhe.description?1:0});ie1?he.slice(0,-1).join(", ")+" or "+he[G.length-1]:he[0],xe=ie?'"'+de(ie)+'"':"end of input","Expected "+Ee+" but "+xe+" found."}var P=No(d),L=df?(P=n.charAt(f),f++):(P=i,N===0&&B(v)),P!==i?(E=[E,P],w=E):(f=w,w=u)):(f=w,w=u);w!==i;)d.push(w),w=f,E=f,N++,P=gt(),P===i&&(P=Fi()),N--,P===i?E=m:(f=E,E=u),E!==i?(n.length>f?(P=n.charAt(f),f++):(P=i,N===0&&B(v)),P!==i?(E=[E,P],w=E):(f=w,w=u)):(f=w,w=u);d!==i?(h=[h,d],a=h):(f=a,a=u);}else f=a,a=u;return M[L]={nextPos:f,result:a},a}function OE(){var a,h,d,w,E,P,L=f*49+4,G=M[L];if(G)return f=G.nextPos,G.result;if(a=f,n.charCodeAt(f)===91?(h=b,f++):(h=i,N===0&&B(_)),h!==i){for(d=[],w=X();w!==i;)d.push(w),w=X();if(d!==i)if(w=af(),w!==i){for(E=[],P=X();P!==i;)E.push(P),P=X();E!==i?(n.charCodeAt(f)===93?(P=x,f++):(P=i,N===0&&B(A)),P!==i?(J=a,h=O(w),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;else f=a,a=u;}else f=a,a=u;return M[L]={nextPos:f,result:a},a}function PE(){var a,h,d,w,E,P,L,G,ie=f*49+5,de=M[ie];if(de)return f=de.nextPos,de.result;if(a=f,n.charCodeAt(f)===91?(h=b,f++):(h=i,N===0&&B(_)),h!==i)if(n.charCodeAt(f)===91?(d=b,f++):(d=i,N===0&&B(_)),d!==i){for(w=[],E=X();E!==i;)w.push(E),E=X();if(w!==i)if(E=af(),E!==i){for(P=[],L=X();L!==i;)P.push(L),L=X();P!==i?(n.charCodeAt(f)===93?(L=x,f++):(L=i,N===0&&B(A)),L!==i?(n.charCodeAt(f)===93?(G=x,f++):(G=i,N===0&&B(A)),G!==i?(J=a,h=I(E),a=h):(f=a,a=u)):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;else f=a,a=u;}else f=a,a=u;else f=a,a=u;return M[ie]={nextPos:f,result:a},a}function af(){var a,h,d,w=f*49+6,E=M[w];if(E)return f=E.nextPos,E.result;if(a=f,h=[],d=uf(),d!==i)for(;d!==i;)h.push(d),d=uf();else h=u;return h!==i?(d=lf(),d!==i?(J=a,h=F(h,d),a=h):(f=a,a=u)):(f=a,a=u),a===i&&(a=f,h=lf(),h!==i&&(J=a,h=U(h)),a=h),M[w]={nextPos:f,result:a},a}function lf(){var a,h,d,w,E,P=f*49+7,L=M[P];if(L)return f=L.nextPos,L.result;for(a=f,h=[],d=X();d!==i;)h.push(d),d=X();if(h!==i)if(d=Fn(),d!==i){for(w=[],E=X();E!==i;)w.push(E),E=X();w!==i?(J=a,h=H(d),a=h):(f=a,a=u);}else f=a,a=u;else f=a,a=u;if(a===i){for(a=f,h=[],d=X();d!==i;)h.push(d),d=X();if(h!==i)if(d=jo(),d!==i){for(w=[],E=X();E!==i;)w.push(E),E=X();w!==i?(J=a,h=H(d),a=h):(f=a,a=u);}else f=a,a=u;else f=a,a=u;}return M[P]={nextPos:f,result:a},a}function uf(){var a,h,d,w,E,P,L,G=f*49+8,ie=M[G];if(ie)return f=ie.nextPos,ie.result;for(a=f,h=[],d=X();d!==i;)h.push(d),d=X();if(h!==i)if(d=Fn(),d!==i){for(w=[],E=X();E!==i;)w.push(E),E=X();if(w!==i)if(n.charCodeAt(f)===46?(E=q,f++):(E=i,N===0&&B(k)),E!==i){for(P=[],L=X();L!==i;)P.push(L),L=X();P!==i?(J=a,h=H(d),a=h):(f=a,a=u);}else f=a,a=u;else f=a,a=u;}else f=a,a=u;else f=a,a=u;if(a===i){for(a=f,h=[],d=X();d!==i;)h.push(d),d=X();if(h!==i)if(d=jo(),d!==i){for(w=[],E=X();E!==i;)w.push(E),E=X();if(w!==i)if(n.charCodeAt(f)===46?(E=q,f++):(E=i,N===0&&B(k)),E!==i){for(P=[],L=X();L!==i;)P.push(L),L=X();P!==i?(J=a,h=H(d),a=h):(f=a,a=u);}else f=a,a=u;else f=a,a=u;}else f=a,a=u;else f=a,a=u;}return M[G]={nextPos:f,result:a},a}function TE(){var a,h,d,w,E,P,L=f*49+9,G=M[L];if(G)return f=G.nextPos,G.result;if(a=f,h=Fn(),h!==i){for(d=[],w=X();w!==i;)d.push(w),w=X();if(d!==i)if(n.charCodeAt(f)===61?(w=j,f++):(w=i,N===0&&B(C)),w!==i){for(E=[],P=X();P!==i;)E.push(P),P=X();E!==i?(P=Gr(),P!==i?(J=a,h=V(h,P),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;else f=a,a=u;}else f=a,a=u;if(a===i)if(a=f,h=jo(),h!==i){for(d=[],w=X();w!==i;)d.push(w),w=X();if(d!==i)if(n.charCodeAt(f)===61?(w=j,f++):(w=i,N===0&&B(C)),w!==i){for(E=[],P=X();P!==i;)E.push(P),P=X();E!==i?(P=Gr(),P!==i?(J=a,h=V(h,P),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;else f=a,a=u;}else f=a,a=u;return M[L]={nextPos:f,result:a},a}function Fn(){var a,h,d,w=f*49+10,E=M[w];if(E)return f=E.nextPos,E.result;if(a=f,h=[],d=Ef(),d!==i)for(;d!==i;)h.push(d),d=Ef();else h=u;return h!==i&&(J=a,h=Y(h)),a=h,M[w]={nextPos:f,result:a},a}function jo(){var a,h,d=f*49+11,w=M[d];return w?(f=w.nextPos,w.result):(a=f,h=cf(),h!==i&&(J=a,h=se(h)),a=h,a===i&&(a=f,h=ff(),h!==i&&(J=a,h=se(h)),a=h),M[d]={nextPos:f,result:a},a)}function Gr(){var a,h=f*49+12,d=M[h];return d?(f=d.nextPos,d.result):(a=$E(),a===i&&(a=HE(),a===i&&(a=FE(),a===i&&(a=qE(),a===i&&(a=DE(),a===i&&(a=NE(),a===i&&(a=ME())))))),M[h]={nextPos:f,result:a},a)}function $E(){var a,h=f*49+13,d=M[h];return d?(f=d.nextPos,d.result):(a=IE(),a===i&&(a=cf(),a===i&&(a=kE(),a===i&&(a=ff()))),M[h]={nextPos:f,result:a},a)}function IE(){var a,h,d,w,E,P=f*49+14,L=M[P];if(L)return f=L.nextPos,L.result;if(a=f,n.substr(f,3)===T?(h=T,f+=3):(h=i,N===0&&B($)),h!==i)if(d=gt(),d===i&&(d=te),d!==i){for(w=[],E=df();E!==i;)w.push(E),E=df();w!==i?(n.substr(f,3)===T?(E=T,f+=3):(E=i,N===0&&B($)),E!==i?(J=a,h=Q(w),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;else f=a,a=u;return M[P]={nextPos:f,result:a},a}function cf(){var a,h,d,w,E=f*49+15,P=M[E];if(P)return f=P.nextPos,P.result;if(a=f,n.charCodeAt(f)===34?(h=ue,f++):(h=i,N===0&&B(Ge)),h!==i){for(d=[],w=hf();w!==i;)d.push(w),w=hf();d!==i?(n.charCodeAt(f)===34?(w=ue,f++):(w=i,N===0&&B(Ge)),w!==i?(J=a,h=Q(d),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;return M[E]={nextPos:f,result:a},a}function kE(){var a,h,d,w,E,P=f*49+16,L=M[P];if(L)return f=L.nextPos,L.result;if(a=f,n.substr(f,3)===Oe?(h=Oe,f+=3):(h=i,N===0&&B(Qt)),h!==i)if(d=gt(),d===i&&(d=te),d!==i){for(w=[],E=gf();E!==i;)w.push(E),E=gf();w!==i?(n.substr(f,3)===Oe?(E=Oe,f+=3):(E=i,N===0&&B(Qt)),E!==i?(J=a,h=Q(w),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;else f=a,a=u;return M[P]={nextPos:f,result:a},a}function ff(){var a,h,d,w,E=f*49+17,P=M[E];if(P)return f=P.nextPos,P.result;if(a=f,n.charCodeAt(f)===39?(h=Pn,f++):(h=i,N===0&&B(Zt)),h!==i){for(d=[],w=pf();w!==i;)d.push(w),w=pf();d!==i?(n.charCodeAt(f)===39?(w=Pn,f++):(w=i,N===0&&B(Zt)),w!==i?(J=a,h=Q(d),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;return M[E]={nextPos:f,result:a},a}function hf(){var a,h,d,w=f*49+18,E=M[w];return E?(f=E.nextPos,E.result):(a=Af(),a===i&&(a=f,h=f,N++,n.charCodeAt(f)===34?(d=ue,f++):(d=i,N===0&&B(Ge)),N--,d===i?h=m:(f=h,h=u),h!==i?(n.length>f?(d=n.charAt(f),f++):(d=i,N===0&&B(v)),d!==i?(J=a,h=St(d),a=h):(f=a,a=u)):(f=a,a=u)),M[w]={nextPos:f,result:a},a)}function pf(){var a,h,d,w=f*49+19,E=M[w];return E?(f=E.nextPos,E.result):(a=f,h=f,N++,n.charCodeAt(f)===39?(d=Pn,f++):(d=i,N===0&&B(Zt)),N--,d===i?h=m:(f=h,h=u),h!==i?(n.length>f?(d=n.charAt(f),f++):(d=i,N===0&&B(v)),d!==i?(J=a,h=St(d),a=h):(f=a,a=u)):(f=a,a=u),M[w]={nextPos:f,result:a},a)}function df(){var a,h,d,w=f*49+20,E=M[w];return E?(f=E.nextPos,E.result):(a=Af(),a===i&&(a=LE(),a===i&&(a=f,h=f,N++,n.substr(f,3)===T?(d=T,f+=3):(d=i,N===0&&B($)),N--,d===i?h=m:(f=h,h=u),h!==i?(n.length>f?(d=n.charAt(f),f++):(d=i,N===0&&B(v)),d!==i?(J=a,h=ce(d),a=h):(f=a,a=u)):(f=a,a=u))),M[w]={nextPos:f,result:a},a)}function LE(){var a,h,d,w,E,P=f*49+21,L=M[P];if(L)return f=L.nextPos,L.result;if(a=f,n.charCodeAt(f)===92?(h=zr,f++):(h=i,N===0&&B(Fo)),h!==i)if(d=gt(),d!==i){for(w=[],E=bf();E!==i;)w.push(E),E=bf();w!==i?(J=a,h=K(),a=h):(f=a,a=u);}else f=a,a=u;else f=a,a=u;return M[P]={nextPos:f,result:a},a}function gf(){var a,h,d,w=f*49+22,E=M[w];return E?(f=E.nextPos,E.result):(a=f,h=f,N++,n.substr(f,3)===Oe?(d=Oe,f+=3):(d=i,N===0&&B(Qt)),N--,d===i?h=m:(f=h,h=u),h!==i?(n.length>f?(d=n.charAt(f),f++):(d=i,N===0&&B(v)),d!==i?(J=a,h=St(d),a=h):(f=a,a=u)):(f=a,a=u),M[w]={nextPos:f,result:a},a)}function FE(){var a,h,d,w,E=f*49+23,P=M[E];return P?(f=P.nextPos,P.result):(a=f,h=yf(),h===i&&(h=Bo()),h!==i?(n.charCodeAt(f)===101?(d=me,f++):(d=i,N===0&&B(W)),d===i&&(n.charCodeAt(f)===69?(d=le,f++):(d=i,N===0&&B(we))),d!==i?(w=Bo(),w!==i?(J=a,h=De(h,w),a=h):(f=a,a=u)):(f=a,a=u)):(f=a,a=u),a===i&&(a=f,h=yf(),h!==i&&(J=a,h=_e(h)),a=h),M[E]={nextPos:f,result:a},a)}function yf(){var a,h,d,w,E,P,L=f*49+24,G=M[L];return G?(f=G.nextPos,G.result):(a=f,n.charCodeAt(f)===43?(h=Er,f++):(h=i,N===0&&B(er)),h===i&&(h=te),h!==i?(d=f,w=qn(),w!==i?(n.charCodeAt(f)===46?(E=q,f++):(E=i,N===0&&B(k)),E!==i?(P=qn(),P!==i?(w=[w,E,P],d=w):(f=d,d=u)):(f=d,d=u)):(f=d,d=u),d!==i?(J=a,h=Fc(d),a=h):(f=a,a=u)):(f=a,a=u),a===i&&(a=f,n.charCodeAt(f)===45?(h=Tn,f++):(h=i,N===0&&B($n)),h!==i?(d=f,w=qn(),w!==i?(n.charCodeAt(f)===46?(E=q,f++):(E=i,N===0&&B(k)),E!==i?(P=qn(),P!==i?(w=[w,E,P],d=w):(f=d,d=u)):(f=d,d=u)):(f=d,d=u),d!==i?(J=a,h=qc(d),a=h):(f=a,a=u)):(f=a,a=u)),M[L]={nextPos:f,result:a},a)}function qE(){var a,h,d=f*49+25,w=M[d];return w?(f=w.nextPos,w.result):(a=f,h=Bo(),h!==i&&(J=a,h=$0(h)),a=h,M[d]={nextPos:f,result:a},a)}function Bo(){var a,h,d,w,E,P=f*49+26,L=M[P];if(L)return f=L.nextPos,L.result;if(a=f,n.charCodeAt(f)===43?(h=Er,f++):(h=i,N===0&&B(er)),h===i&&(h=te),h!==i){if(d=[],w=pe(),w!==i)for(;w!==i;)d.push(w),w=pe();else d=u;d!==i?(w=f,N++,n.charCodeAt(f)===46?(E=q,f++):(E=i,N===0&&B(k)),N--,E===i?w=m:(f=w,w=u),w!==i?(J=a,h=Fc(d),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;if(a===i)if(a=f,n.charCodeAt(f)===45?(h=Tn,f++):(h=i,N===0&&B($n)),h!==i){if(d=[],w=pe(),w!==i)for(;w!==i;)d.push(w),w=pe();else d=u;d!==i?(w=f,N++,n.charCodeAt(f)===46?(E=q,f++):(E=i,N===0&&B(k)),N--,E===i?w=m:(f=w,w=u),w!==i?(J=a,h=qc(d),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;return M[P]={nextPos:f,result:a},a}function DE(){var a,h,d=f*49+27,w=M[d];return w?(f=w.nextPos,w.result):(a=f,n.substr(f,4)===Dc?(h=Dc,f+=4):(h=i,N===0&&B(I0)),h!==i&&(J=a,h=k0()),a=h,a===i&&(a=f,n.substr(f,5)===Nc?(h=Nc,f+=5):(h=i,N===0&&B(L0)),h!==i&&(J=a,h=F0()),a=h),M[d]={nextPos:f,result:a},a)}function NE(){var a,h,d,w,E,P=f*49+28,L=M[P];if(L)return f=L.nextPos,L.result;if(a=f,n.charCodeAt(f)===91?(h=b,f++):(h=i,N===0&&B(_)),h!==i){for(d=[],w=dt();w!==i;)d.push(w),w=dt();d!==i?(n.charCodeAt(f)===93?(w=x,f++):(w=i,N===0&&B(A)),w!==i?(J=a,h=q0(),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;if(a===i&&(a=f,n.charCodeAt(f)===91?(h=b,f++):(h=i,N===0&&B(_)),h!==i?(d=mf(),d===i&&(d=te),d!==i?(n.charCodeAt(f)===93?(w=x,f++):(w=i,N===0&&B(A)),w!==i?(J=a,h=D0(d),a=h):(f=a,a=u)):(f=a,a=u)):(f=a,a=u),a===i)){if(a=f,n.charCodeAt(f)===91?(h=b,f++):(h=i,N===0&&B(_)),h!==i){if(d=[],w=Li(),w!==i)for(;w!==i;)d.push(w),w=Li();else d=u;d!==i?(n.charCodeAt(f)===93?(w=x,f++):(w=i,N===0&&B(A)),w!==i?(J=a,h=N0(d),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;if(a===i)if(a=f,n.charCodeAt(f)===91?(h=b,f++):(h=i,N===0&&B(_)),h!==i){if(d=[],w=Li(),w!==i)for(;w!==i;)d.push(w),w=Li();else d=u;d!==i?(w=mf(),w!==i?(n.charCodeAt(f)===93?(E=x,f++):(E=i,N===0&&B(A)),E!==i?(J=a,h=M0(d,w),a=h):(f=a,a=u)):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;}return M[P]={nextPos:f,result:a},a}function mf(){var a,h,d,w,E,P=f*49+29,L=M[P];if(L)return f=L.nextPos,L.result;for(a=f,h=[],d=dt();d!==i;)h.push(d),d=dt();if(h!==i)if(d=Gr(),d!==i){for(w=[],E=dt();E!==i;)w.push(E),E=dt();w!==i?(J=a,h=Mc(d),a=h):(f=a,a=u);}else f=a,a=u;else f=a,a=u;return M[P]={nextPos:f,result:a},a}function Li(){var a,h,d,w,E,P,L,G=f*49+30,ie=M[G];if(ie)return f=ie.nextPos,ie.result;for(a=f,h=[],d=dt();d!==i;)h.push(d),d=dt();if(h!==i)if(d=Gr(),d!==i){for(w=[],E=dt();E!==i;)w.push(E),E=dt();if(w!==i)if(n.charCodeAt(f)===44?(E=jc,f++):(E=i,N===0&&B(Bc)),E!==i){for(P=[],L=dt();L!==i;)P.push(L),L=dt();P!==i?(J=a,h=Mc(d),a=h):(f=a,a=u);}else f=a,a=u;else f=a,a=u;}else f=a,a=u;else f=a,a=u;return M[G]={nextPos:f,result:a},a}function dt(){var a,h=f*49+31,d=M[h];return d?(f=d.nextPos,d.result):(a=X(),a===i&&(a=gt(),a===i&&(a=ki())),M[h]={nextPos:f,result:a},a)}function ME(){var a,h,d,w,E,P,L=f*49+32,G=M[L];if(G)return f=G.nextPos,G.result;if(a=f,n.charCodeAt(f)===123?(h=j0,f++):(h=i,N===0&&B(B0)),h!==i){for(d=[],w=X();w!==i;)d.push(w),w=X();if(d!==i){for(w=[],E=vf();E!==i;)w.push(E),E=vf();if(w!==i){for(E=[],P=X();P!==i;)E.push(P),P=X();E!==i?(n.charCodeAt(f)===125?(P=H0,f++):(P=i,N===0&&B(U0)),P!==i?(J=a,h=W0(w),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;}else f=a,a=u;}else f=a,a=u;return M[L]={nextPos:f,result:a},a}function vf(){var a,h,d,w,E,P,L,G,ie,de,he,Ee=f*49+33,xe=M[Ee];if(xe)return f=xe.nextPos,xe.result;for(a=f,h=[],d=X();d!==i;)h.push(d),d=X();if(h!==i)if(d=Fn(),d!==i){for(w=[],E=X();E!==i;)w.push(E),E=X();if(w!==i)if(n.charCodeAt(f)===61?(E=j,f++):(E=i,N===0&&B(C)),E!==i){for(P=[],L=X();L!==i;)P.push(L),L=X();if(P!==i)if(L=Gr(),L!==i){for(G=[],ie=X();ie!==i;)G.push(ie),ie=X();if(G!==i)if(n.charCodeAt(f)===44?(ie=jc,f++):(ie=i,N===0&&B(Bc)),ie!==i){for(de=[],he=X();he!==i;)de.push(he),he=X();de!==i?(J=a,h=Hc(d,L),a=h):(f=a,a=u);}else f=a,a=u;else f=a,a=u;}else f=a,a=u;else f=a,a=u;}else f=a,a=u;else f=a,a=u;}else f=a,a=u;else f=a,a=u;if(a===i){for(a=f,h=[],d=X();d!==i;)h.push(d),d=X();if(h!==i)if(d=Fn(),d!==i){for(w=[],E=X();E!==i;)w.push(E),E=X();if(w!==i)if(n.charCodeAt(f)===61?(E=j,f++):(E=i,N===0&&B(C)),E!==i){for(P=[],L=X();L!==i;)P.push(L),L=X();P!==i?(L=Gr(),L!==i?(J=a,h=Hc(d,L),a=h):(f=a,a=u)):(f=a,a=u);}else f=a,a=u;else f=a,a=u;}else f=a,a=u;else f=a,a=u;}return M[Ee]={nextPos:f,result:a},a}function wf(){var a,h,d,w=f*49+34,E=M[w];return E?(f=E.nextPos,E.result):(a=f,n.charCodeAt(f)===46?(h=q,f++):(h=i,N===0&&B(k)),h!==i?(d=qn(),d!==i?(J=a,h=z0(d),a=h):(f=a,a=u)):(f=a,a=u),M[w]={nextPos:f,result:a},a)}function Sf(){var a,h,d,w,E,P,L,G,ie,de,he,Ee,xe=f*49+35,st=M[xe];return st?(f=st.nextPos,st.result):(a=f,h=f,d=pe(),d!==i?(w=pe(),w!==i?(E=pe(),E!==i?(P=pe(),P!==i?(n.charCodeAt(f)===45?(L=Tn,f++):(L=i,N===0&&B($n)),L!==i?(G=pe(),G!==i?(ie=pe(),ie!==i?(n.charCodeAt(f)===45?(de=Tn,f++):(de=i,N===0&&B($n)),de!==i?(he=pe(),he!==i?(Ee=pe(),Ee!==i?(d=[d,w,E,P,L,G,ie,de,he,Ee],h=d):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u),h!==i&&(J=a,h=G0(h)),a=h,M[xe]={nextPos:f,result:a},a)}function jE(){var a,h,d,w,E,P,L,G,ie,de,he,Ee=f*49+36,xe=M[Ee];return xe?(f=xe.nextPos,xe.result):(a=f,h=f,d=pe(),d!==i?(w=pe(),w!==i?(n.charCodeAt(f)===58?(E=In,f++):(E=i,N===0&&B(kn)),E!==i?(P=pe(),P!==i?(L=pe(),L!==i?(n.charCodeAt(f)===58?(G=In,f++):(G=i,N===0&&B(kn)),G!==i?(ie=pe(),ie!==i?(de=pe(),de!==i?(he=wf(),he===i&&(he=te),he!==i?(d=[d,w,E,P,L,G,ie,de,he],h=d):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u),h!==i&&(J=a,h=Uc(h)),a=h,M[Ee]={nextPos:f,result:a},a)}function BE(){var a,h,d,w,E,P,L,G,ie,de,he,Ee,xe,st,Kr,tr,ot,xf=f*49+37,Uo=M[xf];return Uo?(f=Uo.nextPos,Uo.result):(a=f,h=f,d=pe(),d!==i?(w=pe(),w!==i?(n.charCodeAt(f)===58?(E=In,f++):(E=i,N===0&&B(kn)),E!==i?(P=pe(),P!==i?(L=pe(),L!==i?(n.charCodeAt(f)===58?(G=In,f++):(G=i,N===0&&B(kn)),G!==i?(ie=pe(),ie!==i?(de=pe(),de!==i?(he=wf(),he===i&&(he=te),he!==i?(n.charCodeAt(f)===45?(Ee=Tn,f++):(Ee=i,N===0&&B($n)),Ee===i&&(n.charCodeAt(f)===43?(Ee=Er,f++):(Ee=i,N===0&&B(er))),Ee!==i?(xe=pe(),xe!==i?(st=pe(),st!==i?(n.charCodeAt(f)===58?(Kr=In,f++):(Kr=i,N===0&&B(kn)),Kr!==i?(tr=pe(),tr!==i?(ot=pe(),ot!==i?(d=[d,w,E,P,L,G,ie,de,he,Ee,xe,st,Kr,tr,ot],h=d):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u)):(f=h,h=u),h!==i&&(J=a,h=Uc(h)),a=h,M[xf]={nextPos:f,result:a},a)}function HE(){var a,h,d,w,E,P=f*49+38,L=M[P];return L?(f=L.nextPos,L.result):(a=f,h=Sf(),h!==i?(n.charCodeAt(f)===84?(d=Wc,f++):(d=i,N===0&&B(zc)),d!==i?(w=jE(),w!==i?(n.charCodeAt(f)===90?(E=K0,f++):(E=i,N===0&&B(V0)),E!==i?(J=a,h=Y0(h,w),a=h):(f=a,a=u)):(f=a,a=u)):(f=a,a=u)):(f=a,a=u),a===i&&(a=f,h=Sf(),h!==i?(n.charCodeAt(f)===84?(d=Wc,f++):(d=i,N===0&&B(zc)),d!==i?(w=BE(),w!==i?(J=a,h=J0(h,w),a=h):(f=a,a=u)):(f=a,a=u)):(f=a,a=u)),M[P]={nextPos:f,result:a},a)}function X(){var a,h=f*49+39,d=M[h];return d?(f=d.nextPos,d.result):(X0.test(n.charAt(f))?(a=n.charAt(f),f++):(a=i,N===0&&B(Q0)),M[h]={nextPos:f,result:a},a)}function gt(){var a,h,d,w=f*49+40,E=M[w];return E?(f=E.nextPos,E.result):(n.charCodeAt(f)===10?(a=Gc,f++):(a=i,N===0&&B(Kc)),a===i&&(a=f,n.charCodeAt(f)===13?(h=Z0,f++):(h=i,N===0&&B(eE)),h!==i?(n.charCodeAt(f)===10?(d=Gc,f++):(d=i,N===0&&B(Kc)),d!==i?(h=[h,d],a=h):(f=a,a=u)):(f=a,a=u)),M[w]={nextPos:f,result:a},a)}function bf(){var a,h=f*49+41,d=M[h];return d?(f=d.nextPos,d.result):(a=gt(),a===i&&(a=X()),M[h]={nextPos:f,result:a},a)}function Fi(){var a,h,d=f*49+42,w=M[d];return w?(f=w.nextPos,w.result):(a=f,N++,n.length>f?(h=n.charAt(f),f++):(h=i,N===0&&B(v)),N--,h===i?a=m:(f=a,a=u),M[d]={nextPos:f,result:a},a)}function yt(){var a,h=f*49+43,d=M[h];return d?(f=d.nextPos,d.result):(tE.test(n.charAt(f))?(a=n.charAt(f),f++):(a=i,N===0&&B(rE)),M[h]={nextPos:f,result:a},a)}function pe(){var a,h,d=f*49+44,w=M[d];return w?(f=w.nextPos,w.result):(nE.test(n.charAt(f))?(a=n.charAt(f),f++):(a=i,N===0&&B(iE)),a===i&&(a=f,n.charCodeAt(f)===95?(h=sE,f++):(h=i,N===0&&B(oE)),h!==i&&(J=a,h=aE()),a=h),M[d]={nextPos:f,result:a},a)}function Ef(){var a,h=f*49+45,d=M[h];return d?(f=d.nextPos,d.result):(lE.test(n.charAt(f))?(a=n.charAt(f),f++):(a=i,N===0&&B(uE)),M[h]={nextPos:f,result:a},a)}function qn(){var a,h,d,w=f*49+46,E=M[w];if(E)return f=E.nextPos,E.result;if(a=f,h=[],d=pe(),d!==i)for(;d!==i;)h.push(d),d=pe();else h=u;return h!==i&&(J=a,h=cE(h)),a=h,M[w]={nextPos:f,result:a},a}function Af(){var a,h,d=f*49+47,w=M[d];return w?(f=w.nextPos,w.result):(a=f,n.substr(f,2)===Vc?(h=Vc,f+=2):(h=i,N===0&&B(fE)),h!==i&&(J=a,h=hE()),a=h,a===i&&(a=f,n.substr(f,2)===Yc?(h=Yc,f+=2):(h=i,N===0&&B(pE)),h!==i&&(J=a,h=dE()),a=h,a===i&&(a=f,n.substr(f,2)===Jc?(h=Jc,f+=2):(h=i,N===0&&B(gE)),h!==i&&(J=a,h=yE()),a=h,a===i&&(a=f,n.substr(f,2)===Xc?(h=Xc,f+=2):(h=i,N===0&&B(mE)),h!==i&&(J=a,h=vE()),a=h,a===i&&(a=f,n.substr(f,2)===Qc?(h=Qc,f+=2):(h=i,N===0&&B(wE)),h!==i&&(J=a,h=SE()),a=h,a===i&&(a=f,n.substr(f,2)===Zc?(h=Zc,f+=2):(h=i,N===0&&B(bE)),h!==i&&(J=a,h=EE()),a=h,a===i&&(a=f,n.substr(f,2)===ef?(h=ef,f+=2):(h=i,N===0&&B(AE)),h!==i&&(J=a,h=_E()),a=h,a===i&&(a=UE()))))))),M[d]={nextPos:f,result:a},a)}function UE(){var a,h,d,w,E,P,L,G,ie,de,he,Ee=f*49+48,xe=M[Ee];return xe?(f=xe.nextPos,xe.result):(a=f,n.substr(f,2)===tf?(h=tf,f+=2):(h=i,N===0&&B(xE)),h!==i?(d=f,w=yt(),w!==i?(E=yt(),E!==i?(P=yt(),P!==i?(L=yt(),L!==i?(G=yt(),G!==i?(ie=yt(),ie!==i?(de=yt(),de!==i?(he=yt(),he!==i?(w=[w,E,P,L,G,ie,de,he],d=w):(f=d,d=u)):(f=d,d=u)):(f=d,d=u)):(f=d,d=u)):(f=d,d=u)):(f=d,d=u)):(f=d,d=u)):(f=d,d=u),d!==i?(J=a,h=rf(d),a=h):(f=a,a=u)):(f=a,a=u),a===i&&(a=f,n.substr(f,2)===nf?(h=nf,f+=2):(h=i,N===0&&B(CE)),h!==i?(d=f,w=yt(),w!==i?(E=yt(),E!==i?(P=yt(),P!==i?(L=yt(),L!==i?(w=[w,E,P,L],d=w):(f=d,d=u)):(f=d,d=u)):(f=d,d=u)):(f=d,d=u),d!==i?(J=a,h=rf(d),a=h):(f=a,a=u)):(f=a,a=u)),M[Ee]={nextPos:f,result:a},a)}var _f=[];function WE(a,h,d){var w=new Error(a);throw w.line=h,w.column=d,w}function Ho(a){_f.push(a);}function je(a,h,d,w,E){var P={type:a,value:h,line:d(),column:w()};return E&&(P.key=E),P}function zE(a,h,d){var w=parseInt("0x"+a);if(!isFinite(w)||Math.floor(w)!=w||w<0||w>1114111||w>55295&&w<57344)WE("Invalid Unicode escape code: "+a,h,d);else return GE(w)}function GE(){var a=16384,h=[],d,w,E=-1,P=arguments.length;if(!P)return "";for(var L="";++E>10)+55296,w=G%1024+56320,h.push(d,w)),(E+1==P||h.length>a)&&(L+=String.fromCharCode.apply(null,h),h.length=0);}return L}if(Ii=l(),Ii!==i&&f===n.length)return Ii;throw Ii!==i&&f{function YI(t){var e=[],r=[],n="",s=Object.create(null),i=s;return l(t);function l(A){for(var O,I=0;I"u"?C===O.length-1?j[V]=I:j[V]=Object.create(null):C!==O.length-1&&r.indexOf(q)>-1&&c("Cannot redefine existing key '"+q+"'.",F,U),j=j[V],j instanceof Array&&j.length&&C-1?'"'+A+'"':A}}rS.exports={compile:YI};});var sS=R((TM,iS)=>{var JI=tS(),XI=nS();iS.exports={parse:function(t){var e=JI.parse(t.toString());return XI.compile(e)}};});var li=R(($M,cS)=>{var QI=z("path"),Mt="\\\\/",oS=`[^${Mt}]`,Kt="\\.",ZI="\\+",ek="\\?",no="\\/",tk="(?=.)",aS="[^/]",Su=`(?:${no}|$)`,lS=`(?:^|${no})`,bu=`${Kt}{1,2}${Su}`,rk=`(?!${Kt})`,nk=`(?!${lS}${bu})`,ik=`(?!${Kt}{0,1}${Su})`,sk=`(?!${bu})`,ok=`[^.${no}]`,ak=`${aS}*?`,uS={DOT_LITERAL:Kt,PLUS_LITERAL:ZI,QMARK_LITERAL:ek,SLASH_LITERAL:no,ONE_CHAR:tk,QMARK:aS,END_ANCHOR:Su,DOTS_SLASH:bu,NO_DOT:rk,NO_DOTS:nk,NO_DOT_SLASH:ik,NO_DOTS_SLASH:sk,QMARK_NO_DOT:ok,STAR:ak,START_ANCHOR:lS},lk={...uS,SLASH_LITERAL:`[${Mt}]`,QMARK:oS,STAR:`${oS}*?`,DOTS_SLASH:`${Kt}{1,2}(?:[${Mt}]|$)`,NO_DOT:`(?!${Kt})`,NO_DOTS:`(?!(?:^|[${Mt}])${Kt}{1,2}(?:[${Mt}]|$))`,NO_DOT_SLASH:`(?!${Kt}{0,1}(?:[${Mt}]|$))`,NO_DOTS_SLASH:`(?!${Kt}{1,2}(?:[${Mt}]|$))`,QMARK_NO_DOT:`[^.${Mt}]`,START_ANCHOR:`(?:^|[${Mt}])`,END_ANCHOR:`(?:[${Mt}]|$)`},uk={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};cS.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:uk,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:QI.sep,extglobChars(t){return {"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?lk:uS}};});var io=R(nt=>{var ck=z("path"),fk=process.platform==="win32",{REGEX_BACKSLASH:hk,REGEX_REMOVE_BACKSLASH:pk,REGEX_SPECIAL_CHARS:dk,REGEX_SPECIAL_CHARS_GLOBAL:gk}=li();nt.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);nt.hasRegexChars=t=>dk.test(t);nt.isRegexChar=t=>t.length===1&&nt.hasRegexChars(t);nt.escapeRegex=t=>t.replace(gk,"\\$1");nt.toPosixSlashes=t=>t.replace(hk,"/");nt.removeBackslashes=t=>t.replace(pk,e=>e==="\\"?"":e);nt.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};nt.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:fk===!0||ck.sep==="\\";nt.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?nt.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};nt.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};nt.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",s=r.contains?"":"$",i=`${n}(?:${t})${s}`;return e.negated===!0&&(i=`(?:^(?!${i}).*$)`),i};});var vS=R((kM,mS)=>{var fS=io(),{CHAR_ASTERISK:Eu,CHAR_AT:yk,CHAR_BACKWARD_SLASH:ui,CHAR_COMMA:mk,CHAR_DOT:Au,CHAR_EXCLAMATION_MARK:_u,CHAR_FORWARD_SLASH:yS,CHAR_LEFT_CURLY_BRACE:xu,CHAR_LEFT_PARENTHESES:Cu,CHAR_LEFT_SQUARE_BRACKET:vk,CHAR_PLUS:wk,CHAR_QUESTION_MARK:hS,CHAR_RIGHT_CURLY_BRACE:Sk,CHAR_RIGHT_PARENTHESES:pS,CHAR_RIGHT_SQUARE_BRACKET:bk}=li(),dS=t=>t===yS||t===ui,gS=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1);},Ek=(t,e)=>{let r=e||{},n=t.length-1,s=r.parts===!0||r.scanToEnd===!0,i=[],o=[],l=[],c=t,p=-1,u=0,g=0,y=!1,m=!1,v=!1,b=!1,_=!1,x=!1,A=!1,O=!1,I=!1,F=!1,U=0,H,q,k={value:"",depth:0,isGlob:!1},j=()=>p>=n,C=()=>c.charCodeAt(p+1),V=()=>(H=q,c.charCodeAt(++p));for(;p0&&(se=c.slice(0,u),c=c.slice(u),g-=u),Y&&v===!0&&g>0?(Y=c.slice(0,g),T=c.slice(g)):v===!0?(Y="",T=c):Y=c,Y&&Y!==""&&Y!=="/"&&Y!==c&&dS(Y.charCodeAt(Y.length-1))&&(Y=Y.slice(0,-1)),r.unescape===!0&&(T&&(T=fS.removeBackslashes(T)),Y&&A===!0&&(Y=fS.removeBackslashes(Y)));let $={prefix:se,input:t,start:u,base:Y,glob:T,isBrace:y,isBracket:m,isGlob:v,isExtglob:b,isGlobstar:_,negated:O,negatedExtglob:I};if(r.tokens===!0&&($.maxDepth=0,dS(q)||o.push(k),$.tokens=o),r.parts===!0||r.tokens===!0){let te;for(let Q=0;Q{var so=li(),ut=io(),{MAX_LENGTH:oo,POSIX_REGEX_SOURCE:Ak,REGEX_NON_SPECIAL_CHARS:_k,REGEX_SPECIAL_CHARS_BACKREF:xk,REPLACEMENTS:wS}=so,Ck=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;return r},yn=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,Ru=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=wS[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(oo,r.maxLength):oo,s=t.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);let i={type:"bos",value:"",output:r.prepend||""},o=[i],l=r.capture?"":"?:",c=ut.isWindows(e),p=so.globChars(c),u=so.extglobChars(p),{DOT_LITERAL:g,PLUS_LITERAL:y,SLASH_LITERAL:m,ONE_CHAR:v,DOTS_SLASH:b,NO_DOT:_,NO_DOT_SLASH:x,NO_DOTS_SLASH:A,QMARK:O,QMARK_NO_DOT:I,STAR:F,START_ANCHOR:U}=p,H=K=>`(${l}(?:(?!${U}${K.dot?b:g}).)*?)`,q=r.dot?"":_,k=r.dot?O:I,j=r.bash===!0?H(r):F;r.capture&&(j=`(${j})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let C={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};t=ut.removePrefix(t,C),s=t.length;let V=[],Y=[],se=[],T=i,$,te=()=>C.index===s-1,Q=C.peek=(K=1)=>t[C.index+K],ue=C.advance=()=>t[++C.index]||"",Ge=()=>t.slice(C.index+1),Oe=(K="",me=0)=>{C.consumed+=K,C.index+=me;},Qt=K=>{C.output+=K.output!=null?K.output:K.value,Oe(K.value);},Pn=()=>{let K=1;for(;Q()==="!"&&(Q(2)!=="("||Q(3)==="?");)ue(),C.start++,K++;return K%2===0?!1:(C.negated=!0,C.start++,!0)},Zt=K=>{C[K]++,se.push(K);},St=K=>{C[K]--,se.pop();},ce=K=>{if(T.type==="globstar"){let me=C.braces>0&&(K.type==="comma"||K.type==="brace"),W=K.extglob===!0||V.length&&(K.type==="pipe"||K.type==="paren");K.type!=="slash"&&K.type!=="paren"&&!me&&!W&&(C.output=C.output.slice(0,-T.output.length),T.type="star",T.value="*",T.output=j,C.output+=T.output);}if(V.length&&K.type!=="paren"&&(V[V.length-1].inner+=K.value),(K.value||K.output)&&Qt(K),T&&T.type==="text"&&K.type==="text"){T.value+=K.value,T.output=(T.output||"")+K.value;return}K.prev=T,o.push(K),T=K;},zr=(K,me)=>{let W={...u[me],conditions:1,inner:""};W.prev=T,W.parens=C.parens,W.output=C.output;let le=(r.capture?"(":"")+W.open;Zt("parens"),ce({type:K,value:me,output:C.output?"":v}),ce({type:"paren",extglob:!0,value:ue(),output:le}),V.push(W);},Fo=K=>{let me=K.close+(r.capture?")":""),W;if(K.type==="negate"){let le=j;if(K.inner&&K.inner.length>1&&K.inner.includes("/")&&(le=H(r)),(le!==j||te()||/^\)+$/.test(Ge()))&&(me=K.close=`)$))${le}`),K.inner.includes("*")&&(W=Ge())&&/^\.[^\\/.]+$/.test(W)){let we=Ru(W,{...e,fastpaths:!1}).output;me=K.close=`)${we})${le})`;}K.prev.type==="bos"&&(C.negatedExtglob=!0);}ce({type:"paren",extglob:!0,value:$,output:me}),St("parens");};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let K=!1,me=t.replace(xk,(W,le,we,De,_e,Er)=>De==="\\"?(K=!0,W):De==="?"?le?le+De+(_e?O.repeat(_e.length):""):Er===0?k+(_e?O.repeat(_e.length):""):O.repeat(we.length):De==="."?g.repeat(we.length):De==="*"?le?le+De+(_e?j:""):j:le?W:`\\${W}`);return K===!0&&(r.unescape===!0?me=me.replace(/\\/g,""):me=me.replace(/\\+/g,W=>W.length%2===0?"\\\\":W?"\\":"")),me===t&&r.contains===!0?(C.output=t,C):(C.output=ut.wrapOutput(me,C,e),C)}for(;!te();){if($=ue(),$==="\0")continue;if($==="\\"){let W=Q();if(W==="/"&&r.bash!==!0||W==="."||W===";")continue;if(!W){$+="\\",ce({type:"text",value:$});continue}let le=/^\\+/.exec(Ge()),we=0;if(le&&le[0].length>2&&(we=le[0].length,C.index+=we,we%2!==0&&($+="\\")),r.unescape===!0?$=ue():$+=ue(),C.brackets===0){ce({type:"text",value:$});continue}}if(C.brackets>0&&($!=="]"||T.value==="["||T.value==="[^")){if(r.posix!==!1&&$===":"){let W=T.value.slice(1);if(W.includes("[")&&(T.posix=!0,W.includes(":"))){let le=T.value.lastIndexOf("["),we=T.value.slice(0,le),De=T.value.slice(le+2),_e=Ak[De];if(_e){T.value=we+_e,C.backtrack=!0,ue(),!i.output&&o.indexOf(T)===1&&(i.output=v);continue}}}($==="["&&Q()!==":"||$==="-"&&Q()==="]")&&($=`\\${$}`),$==="]"&&(T.value==="["||T.value==="[^")&&($=`\\${$}`),r.posix===!0&&$==="!"&&T.value==="["&&($="^"),T.value+=$,Qt({value:$});continue}if(C.quotes===1&&$!=='"'){$=ut.escapeRegex($),T.value+=$,Qt({value:$});continue}if($==='"'){C.quotes=C.quotes===1?0:1,r.keepQuotes===!0&&ce({type:"text",value:$});continue}if($==="("){Zt("parens"),ce({type:"paren",value:$});continue}if($===")"){if(C.parens===0&&r.strictBrackets===!0)throw new SyntaxError(yn("opening","("));let W=V[V.length-1];if(W&&C.parens===W.parens+1){Fo(V.pop());continue}ce({type:"paren",value:$,output:C.parens?")":"\\)"}),St("parens");continue}if($==="["){if(r.nobracket===!0||!Ge().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(yn("closing","]"));$=`\\${$}`;}else Zt("brackets");ce({type:"bracket",value:$});continue}if($==="]"){if(r.nobracket===!0||T&&T.type==="bracket"&&T.value.length===1){ce({type:"text",value:$,output:`\\${$}`});continue}if(C.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(yn("opening","["));ce({type:"text",value:$,output:`\\${$}`});continue}St("brackets");let W=T.value.slice(1);if(T.posix!==!0&&W[0]==="^"&&!W.includes("/")&&($=`/${$}`),T.value+=$,Qt({value:$}),r.literalBrackets===!1||ut.hasRegexChars(W))continue;let le=ut.escapeRegex(T.value);if(C.output=C.output.slice(0,-T.value.length),r.literalBrackets===!0){C.output+=le,T.value=le;continue}T.value=`(${l}${le}|${T.value})`,C.output+=T.value;continue}if($==="{"&&r.nobrace!==!0){Zt("braces");let W={type:"brace",value:$,output:"(",outputIndex:C.output.length,tokensIndex:C.tokens.length};Y.push(W),ce(W);continue}if($==="}"){let W=Y[Y.length-1];if(r.nobrace===!0||!W){ce({type:"text",value:$,output:$});continue}let le=")";if(W.dots===!0){let we=o.slice(),De=[];for(let _e=we.length-1;_e>=0&&(o.pop(),we[_e].type!=="brace");_e--)we[_e].type!=="dots"&&De.unshift(we[_e].value);le=Ck(De,r),C.backtrack=!0;}if(W.comma!==!0&&W.dots!==!0){let we=C.output.slice(0,W.outputIndex),De=C.tokens.slice(W.tokensIndex);W.value=W.output="\\{",$=le="\\}",C.output=we;for(let _e of De)C.output+=_e.output||_e.value;}ce({type:"brace",value:$,output:le}),St("braces"),Y.pop();continue}if($==="|"){V.length>0&&V[V.length-1].conditions++,ce({type:"text",value:$});continue}if($===","){let W=$,le=Y[Y.length-1];le&&se[se.length-1]==="braces"&&(le.comma=!0,W="|"),ce({type:"comma",value:$,output:W});continue}if($==="/"){if(T.type==="dot"&&C.index===C.start+1){C.start=C.index+1,C.consumed="",C.output="",o.pop(),T=i;continue}ce({type:"slash",value:$,output:m});continue}if($==="."){if(C.braces>0&&T.type==="dot"){T.value==="."&&(T.output=g);let W=Y[Y.length-1];T.type="dots",T.output+=$,T.value+=$,W.dots=!0;continue}if(C.braces+C.parens===0&&T.type!=="bos"&&T.type!=="slash"){ce({type:"text",value:$,output:g});continue}ce({type:"dot",value:$,output:g});continue}if($==="?"){if(!(T&&T.value==="(")&&r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){zr("qmark",$);continue}if(T&&T.type==="paren"){let le=Q(),we=$;if(le==="<"&&!ut.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(T.value==="("&&!/[!=<:]/.test(le)||le==="<"&&!/<([!=]|\w+>)/.test(Ge()))&&(we=`\\${$}`),ce({type:"text",value:$,output:we});continue}if(r.dot!==!0&&(T.type==="slash"||T.type==="bos")){ce({type:"qmark",value:$,output:I});continue}ce({type:"qmark",value:$,output:O});continue}if($==="!"){if(r.noextglob!==!0&&Q()==="("&&(Q(2)!=="?"||!/[!=<:]/.test(Q(3)))){zr("negate",$);continue}if(r.nonegate!==!0&&C.index===0){Pn();continue}}if($==="+"){if(r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){zr("plus",$);continue}if(T&&T.value==="("||r.regex===!1){ce({type:"plus",value:$,output:y});continue}if(T&&(T.type==="bracket"||T.type==="paren"||T.type==="brace")||C.parens>0){ce({type:"plus",value:$});continue}ce({type:"plus",value:y});continue}if($==="@"){if(r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){ce({type:"at",extglob:!0,value:$,output:""});continue}ce({type:"text",value:$});continue}if($!=="*"){($==="$"||$==="^")&&($=`\\${$}`);let W=_k.exec(Ge());W&&($+=W[0],C.index+=W[0].length),ce({type:"text",value:$});continue}if(T&&(T.type==="globstar"||T.star===!0)){T.type="star",T.star=!0,T.value+=$,T.output=j,C.backtrack=!0,C.globstar=!0,Oe($);continue}let K=Ge();if(r.noextglob!==!0&&/^\([^?]/.test(K)){zr("star",$);continue}if(T.type==="star"){if(r.noglobstar===!0){Oe($);continue}let W=T.prev,le=W.prev,we=W.type==="slash"||W.type==="bos",De=le&&(le.type==="star"||le.type==="globstar");if(r.bash===!0&&(!we||K[0]&&K[0]!=="/")){ce({type:"star",value:$,output:""});continue}let _e=C.braces>0&&(W.type==="comma"||W.type==="brace"),Er=V.length&&(W.type==="pipe"||W.type==="paren");if(!we&&W.type!=="paren"&&!_e&&!Er){ce({type:"star",value:$,output:""});continue}for(;K.slice(0,3)==="/**";){let er=t[C.index+4];if(er&&er!=="/")break;K=K.slice(3),Oe("/**",3);}if(W.type==="bos"&&te()){T.type="globstar",T.value+=$,T.output=H(r),C.output=T.output,C.globstar=!0,Oe($);continue}if(W.type==="slash"&&W.prev.type!=="bos"&&!De&&te()){C.output=C.output.slice(0,-(W.output+T.output).length),W.output=`(?:${W.output}`,T.type="globstar",T.output=H(r)+(r.strictSlashes?")":"|$)"),T.value+=$,C.globstar=!0,C.output+=W.output+T.output,Oe($);continue}if(W.type==="slash"&&W.prev.type!=="bos"&&K[0]==="/"){let er=K[1]!==void 0?"|$":"";C.output=C.output.slice(0,-(W.output+T.output).length),W.output=`(?:${W.output}`,T.type="globstar",T.output=`${H(r)}${m}|${m}${er})`,T.value+=$,C.output+=W.output+T.output,C.globstar=!0,Oe($+ue()),ce({type:"slash",value:"/",output:""});continue}if(W.type==="bos"&&K[0]==="/"){T.type="globstar",T.value+=$,T.output=`(?:^|${m}|${H(r)}${m})`,C.output=T.output,C.globstar=!0,Oe($+ue()),ce({type:"slash",value:"/",output:""});continue}C.output=C.output.slice(0,-T.output.length),T.type="globstar",T.output=H(r),T.value+=$,C.output+=T.output,C.globstar=!0,Oe($);continue}let me={type:"star",value:$,output:j};if(r.bash===!0){me.output=".*?",(T.type==="bos"||T.type==="slash")&&(me.output=q+me.output),ce(me);continue}if(T&&(T.type==="bracket"||T.type==="paren")&&r.regex===!0){me.output=$,ce(me);continue}(C.index===C.start||T.type==="slash"||T.type==="dot")&&(T.type==="dot"?(C.output+=x,T.output+=x):r.dot===!0?(C.output+=A,T.output+=A):(C.output+=q,T.output+=q),Q()!=="*"&&(C.output+=v,T.output+=v)),ce(me);}for(;C.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(yn("closing","]"));C.output=ut.escapeLast(C.output,"["),St("brackets");}for(;C.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(yn("closing",")"));C.output=ut.escapeLast(C.output,"("),St("parens");}for(;C.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(yn("closing","}"));C.output=ut.escapeLast(C.output,"{"),St("braces");}if(r.strictSlashes!==!0&&(T.type==="star"||T.type==="bracket")&&ce({type:"maybe_slash",value:"",output:`${m}?`}),C.backtrack===!0){C.output="";for(let K of C.tokens)C.output+=K.output!=null?K.output:K.value,K.suffix&&(C.output+=K.suffix);}return C};Ru.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(oo,r.maxLength):oo,s=t.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);t=wS[t]||t;let i=ut.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:l,ONE_CHAR:c,DOTS_SLASH:p,NO_DOT:u,NO_DOTS:g,NO_DOTS_SLASH:y,STAR:m,START_ANCHOR:v}=so.globChars(i),b=r.dot?g:u,_=r.dot?y:u,x=r.capture?"":"?:",A={negated:!1,prefix:""},O=r.bash===!0?".*?":m;r.capture&&(O=`(${O})`);let I=q=>q.noglobstar===!0?O:`(${x}(?:(?!${v}${q.dot?p:o}).)*?)`,F=q=>{switch(q){case"*":return `${b}${c}${O}`;case".*":return `${o}${c}${O}`;case"*.*":return `${b}${O}${o}${c}${O}`;case"*/*":return `${b}${O}${l}${c}${_}${O}`;case"**":return b+I(r);case"**/*":return `(?:${b}${I(r)}${l})?${_}${c}${O}`;case"**/*.*":return `(?:${b}${I(r)}${l})?${_}${O}${o}${c}${O}`;case"**/.*":return `(?:${b}${I(r)}${l})?${o}${c}${O}`;default:{let k=/^(.*?)\.(\w+)$/.exec(q);if(!k)return;let j=F(k[1]);return j?j+o+k[2]:void 0}}},U=ut.removePrefix(t,A),H=F(U);return H&&r.strictSlashes!==!0&&(H+=`${l}?`),H};SS.exports=Ru;});var AS=R((FM,ES)=>{var Rk=z("path"),Ok=vS(),Ou=bS(),Pu=io(),Pk=li(),Tk=t=>t&&typeof t=="object"&&!Array.isArray(t),Re=(t,e,r=!1)=>{if(Array.isArray(t)){let u=t.map(y=>Re(y,e,r));return y=>{for(let m of u){let v=m(y);if(v)return v}return !1}}let n=Tk(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let s=e||{},i=Pu.isWindows(e),o=n?Re.compileRe(t,e):Re.makeRe(t,e,!1,!0),l=o.state;delete o.state;let c=()=>!1;if(s.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};c=Re(s.ignore,u,r);}let p=(u,g=!1)=>{let{isMatch:y,match:m,output:v}=Re.test(u,o,e,{glob:t,posix:i}),b={glob:t,state:l,regex:o,posix:i,input:u,output:v,match:m,isMatch:y};return typeof s.onResult=="function"&&s.onResult(b),y===!1?(b.isMatch=!1,g?b:!1):c(u)?(typeof s.onIgnore=="function"&&s.onIgnore(b),b.isMatch=!1,g?b:!1):(typeof s.onMatch=="function"&&s.onMatch(b),g?b:!0)};return r&&(p.state=l),p};Re.test=(t,e,r,{glob:n,posix:s}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return {isMatch:!1,output:""};let i=r||{},o=i.format||(s?Pu.toPosixSlashes:null),l=t===n,c=l&&o?o(t):t;return l===!1&&(c=o?o(t):t,l=c===n),(l===!1||i.capture===!0)&&(i.matchBase===!0||i.basename===!0?l=Re.matchBase(t,e,r,s):l=e.exec(c)),{isMatch:!!l,match:l,output:c}};Re.matchBase=(t,e,r,n=Pu.isWindows(r))=>(e instanceof RegExp?e:Re.makeRe(e,r)).test(Rk.basename(t));Re.isMatch=(t,e,r)=>Re(e,r)(t);Re.parse=(t,e)=>Array.isArray(t)?t.map(r=>Re.parse(r,e)):Ou(t,{...e,fastpaths:!1});Re.scan=(t,e)=>Ok(t,e);Re.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let s=e||{},i=s.contains?"":"^",o=s.contains?"":"$",l=`${i}(?:${t.output})${o}`;t&&t.negated===!0&&(l=`^(?!${l}).*$`);let c=Re.toRegex(l,e);return n===!0&&(c.state=t),c};Re.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let s={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(s.output=Ou.fastpaths(t,e)),s.output||(s=Ou(t,e)),Re.compileRe(s,e,r,n)};Re.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return /$^/}};Re.constants=Pk;ES.exports=Re;});var Tu=R((qM,_S)=>{_S.exports=AS();});var IS=R((DM,$S)=>{var fi=z("fs"),{Readable:$k}=z("stream"),ci=z("path"),{promisify:co}=z("util"),$u=Tu(),Ik=co(fi.readdir),kk=co(fi.stat),xS=co(fi.lstat),Lk=co(fi.realpath),Fk="!",PS="READDIRP_RECURSIVE_ERROR",qk=new Set(["ENOENT","EPERM","EACCES","ELOOP",PS]),Iu="files",TS="directories",lo="files_directories",ao="all",CS=[Iu,TS,lo,ao],Dk=t=>qk.has(t.code),[RS,Nk]=process.versions.node.split(".").slice(0,2).map(t=>Number.parseInt(t,10)),Mk=process.platform==="win32"&&(RS>10||RS===10&&Nk>=5),OS=t=>{if(t!==void 0){if(typeof t=="function")return t;if(typeof t=="string"){let e=$u(t.trim());return r=>e(r.basename)}if(Array.isArray(t)){let e=[],r=[];for(let n of t){let s=n.trim();s.charAt(0)===Fk?r.push($u(s.slice(1))):e.push($u(s));}return r.length>0?e.length>0?n=>e.some(s=>s(n.basename))&&!r.some(s=>s(n.basename)):n=>!r.some(s=>s(n.basename)):n=>e.some(s=>s(n.basename))}}},uo=class t extends $k{static get defaultOptions(){return {root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:Iu,lstat:!1,depth:2147483648,alwaysStat:!1}}constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark||4096});let r={...t.defaultOptions,...e},{root:n,type:s}=r;this._fileFilter=OS(r.fileFilter),this._directoryFilter=OS(r.directoryFilter);let i=r.lstat?xS:kk;Mk?this._stat=o=>i(o,{bigint:!0}):this._stat=i,this._maxDepth=r.depth,this._wantsDir=[TS,lo,ao].includes(s),this._wantsFile=[Iu,lo,ao].includes(s),this._wantsEverything=s===ao,this._root=ci.resolve(n),this._isDirent="Dirent"in fi&&!r.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0;}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let{path:r,depth:n,files:s=[]}=this.parent||{};if(s.length>0){let i=s.splice(0,e).map(o=>this._formatEntry(o,r));for(let o of await Promise.all(i)){if(this.destroyed)return;let l=await this._getEntryType(o);l==="directory"&&this._directoryFilter(o)?(n<=this._maxDepth&&this.parents.push(this._exploreDir(o.fullPath,n+1)),this._wantsDir&&(this.push(o),e--)):(l==="file"||this._includeAsFile(o))&&this._fileFilter(o)&&this._wantsFile&&(this.push(o),e--);}}else {let i=this.parents.pop();if(!i){this.push(null);break}if(this.parent=await i,this.destroyed)return}}}catch(r){this.destroy(r);}finally{this.reading=!1;}}}async _exploreDir(e,r){let n;try{n=await Ik(e,this._rdOptions);}catch(s){this._onError(s);}return {files:n,depth:r,path:e}}async _formatEntry(e,r){let n;try{let s=this._isDirent?e.name:e,i=ci.resolve(ci.join(r,s));n={path:ci.relative(this._root,i),fullPath:i,basename:s},n[this._statsProp]=this._isDirent?e:await this._stat(i);}catch(s){this._onError(s);}return n}_onError(e){Dk(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e);}async _getEntryType(e){let r=e&&e[this._statsProp];if(r){if(r.isFile())return "file";if(r.isDirectory())return "directory";if(r&&r.isSymbolicLink()){let n=e.fullPath;try{let s=await Lk(n),i=await xS(s);if(i.isFile())return "file";if(i.isDirectory()){let o=s.length;if(n.startsWith(s)&&n.substr(o,1)===ci.sep){let l=new Error(`Circular symlink detected: "${n}" points to "${s}"`);return l.code=PS,this._onError(l)}return "directory"}}catch(s){this._onError(s);}}}}_includeAsFile(e){let r=e&&e[this._statsProp];return r&&this._wantsEverything&&!r.isDirectory()}},mn=(t,e={})=>{let r=e.entryType||e.type;if(r==="both"&&(r=lo),r&&(e.type=r),t){if(typeof t!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(r&&!CS.includes(r))throw new Error(`readdirp: Invalid type passed. Use one of ${CS.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=t,new uo(e)},jk=(t,e={})=>new Promise((r,n)=>{let s=[];mn(t,e).on("data",i=>s.push(i)).on("end",()=>r(s)).on("error",i=>n(i));});mn.promise=jk;mn.ReaddirpStream=uo;mn.default=mn;$S.exports=mn;});var ku=R((NM,kS)=>{kS.exports=function(t,e){if(typeof t!="string")throw new TypeError("expected path to be a string");if(t==="\\"||t==="/")return "/";var r=t.length;if(r<=1)return t;var n="";if(r>4&&t[3]==="\\"){var s=t[2];(s==="?"||s===".")&&t.slice(0,2)==="\\\\"&&(t=t.slice(2),n="//");}var i=t.split(/[/\\]+/);return e!==!1&&i[i.length-1]===""&&i.pop(),n+i.join("/")};});var MS=R((DS,NS)=>{Object.defineProperty(DS,"__esModule",{value:!0});var qS=Tu(),Bk=ku(),LS="!",Hk={returnIndex:!1},Uk=t=>Array.isArray(t)?t:[t],Wk=(t,e)=>{if(typeof t=="function")return t;if(typeof t=="string"){let r=qS(t,e);return n=>t===n||r(n)}return t instanceof RegExp?r=>t.test(r):r=>!1},FS=(t,e,r,n)=>{let s=Array.isArray(r),i=s?r[0]:r;if(!s&&typeof i!="string")throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(i));let o=Bk(i,!1);for(let c=0;c{if(t==null)throw new TypeError("anymatch: specify first argument");let n=typeof r=="boolean"?{returnIndex:r}:r,s=n.returnIndex||!1,i=Uk(t),o=i.filter(c=>typeof c=="string"&&c.charAt(0)===LS).map(c=>c.slice(1)).map(c=>qS(c,n)),l=i.filter(c=>typeof c!="string"||typeof c=="string"&&c.charAt(0)!==LS).map(c=>Wk(c,n));return e==null?(c,p=!1)=>FS(l,o,c,typeof p=="boolean"?p:!1):FS(l,o,e,s)};Lu.default=Lu;NS.exports=Lu;});var BS=R((MM,jS)=>{jS.exports=function(e){if(typeof e!="string"||e==="")return !1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(r[2])return !0;e=e.slice(r.index+r[0].length);}return !1};});var Fu=R((jM,US)=>{var zk=BS(),HS={"{":"}","(":")","[":"]"},Gk=function(t){if(t[0]==="!")return !0;for(var e=0,r=-2,n=-2,s=-2,i=-2,o=-2;ee&&(o===-1||o>n||(o=t.indexOf("\\",e),o===-1||o>n)))||s!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(s=t.indexOf("}",e),s>e&&(o=t.indexOf("\\",e),o===-1||o>s))||i!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(i=t.indexOf(")",e),i>e&&(o=t.indexOf("\\",e),o===-1||o>i))||r!==-1&&t[e]==="("&&t[e+1]!=="|"&&(rr&&(o=t.indexOf("\\",r),o===-1||o>i))))return !0;if(t[e]==="\\"){var l=t[e+1];e+=2;var c=HS[l];if(c){var p=t.indexOf(c,e);p!==-1&&(e=p+1);}if(t[e]==="!")return !0}else e++;}return !1},Kk=function(t){if(t[0]==="!")return !0;for(var e=0;e{var Vk=Fu(),Yk=z("path").posix.dirname,Jk=z("os").platform()==="win32",qu="/",Xk=/\\/g,Qk=/[\{\[].*[\}\]]$/,Zk=/(^|[^\\])([\{\[]|\([^\)]+$)/,eL=/\\([\!\*\?\|\[\]\(\)\{\}])/g;WS.exports=function(e,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&Jk&&e.indexOf(qu)<0&&(e=e.replace(Xk,qu)),Qk.test(e)&&(e+=qu),e+="a";do e=Yk(e);while(Vk(e)||Zk.test(e));return e.replace(eL,"$1")};});var fo=R(wt=>{wt.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;wt.find=(t,e)=>t.nodes.find(r=>r.type===e);wt.exceedsLimit=(t,e,r=1,n)=>n===!1||!wt.isInteger(t)||!wt.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=n;wt.escapeNode=(t,e=0,r)=>{let n=t.nodes[e];n&&(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0);};wt.encloseBrace=t=>t.type!=="brace"||t.commas>>0+t.ranges>>0?!1:(t.invalid=!0,!0);wt.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:!(t.commas>>0+t.ranges>>0)||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;wt.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;wt.reduce=t=>t.reduce((e,r)=>(r.type==="text"&&e.push(r.value),r.type==="range"&&(r.type="text"),e),[]);wt.flatten=(...t)=>{let e=[],r=n=>{for(let s=0;s{var GS=fo();KS.exports=(t,e={})=>{let r=(n,s={})=>{let i=e.escapeInvalid&&GS.isInvalidBrace(s),o=n.invalid===!0&&e.escapeInvalid===!0,l="";if(n.value)return (i||o)&&GS.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let c of n.nodes)l+=r(c);return l};return r(t)};});var YS=R((WM,VS)=>{VS.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1};});var ib=R((zM,nb)=>{var JS=YS(),qr=(t,e,r)=>{if(JS(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(JS(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...r};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let s=String(n.relaxZeros),i=String(n.shorthand),o=String(n.capture),l=String(n.wrap),c=t+":"+e+"="+s+i+o+l;if(qr.cache.hasOwnProperty(c))return qr.cache[c].result;let p=Math.min(t,e),u=Math.max(t,e);if(Math.abs(p-u)===1){let b=t+"|"+e;return n.capture?`(${b})`:n.wrap===!1?b:`(?:${b})`}let g=rb(t)||rb(e),y={min:t,max:e,a:p,b:u},m=[],v=[];if(g&&(y.isPadded=g,y.maxLen=String(y.max).length),p<0){let b=u<0?Math.abs(u):1;v=XS(b,Math.abs(p),y,n),p=y.a=0;}return u>=0&&(m=XS(p,u,y,n)),y.negatives=v,y.positives=m,y.result=tL(v,m),n.capture===!0?y.result=`(${y.result})`:n.wrap!==!1&&m.length+v.length>1&&(y.result=`(?:${y.result})`),qr.cache[c]=y,y.result};function tL(t,e,r){let n=Du(t,e,"-",!1)||[],s=Du(e,t,"",!1)||[],i=Du(t,e,"-?",!0)||[];return n.concat(i).concat(s).join("|")}function rL(t,e){let r=1,n=1,s=ZS(t,r),i=new Set([e]);for(;t<=s&&s<=e;)i.add(s),r+=1,s=ZS(t,r);for(s=eb(e+1,n)-1;t1&&l.count.pop(),l.count.push(u.count[0]),l.string=l.pattern+tb(l.count),o=p+1;continue}r.isPadded&&(g=aL(p,r,n)),u.string=g+u.pattern+tb(u.count),i.push(u),o=p+1,l=u;}return i}function Du(t,e,r,n,s){let i=[];for(let o of t){let{string:l}=o;!n&&!QS(e,"string",l)&&i.push(r+l),n&&QS(e,"string",l)&&i.push(r+l);}return i}function iL(t,e){let r=[];for(let n=0;ne?1:e>t?-1:0}function QS(t,e,r){return t.some(n=>n[e]===r)}function ZS(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function eb(t,e){return t-t%Math.pow(10,e)}function tb(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function oL(t,e,r){return `[${t}${e-t===1?"":"-"}${e}]`}function rb(t){return /^-?(0+)\d/.test(t)}function aL(t,e,r){if(!e.isPadded)return t;let n=Math.abs(e.maxLen-String(t).length),s=r.relaxZeros!==!1;switch(n){case 0:return "";case 1:return s?"0?":"0";case 2:return s?"0{0,2}":"00";default:return s?`0{0,${n}}`:`0{${n}}`}}qr.cache={};qr.clearCache=()=>qr.cache={};nb.exports=qr;});var ju=R((GM,hb)=>{var lL=z("util"),ab=ib(),sb=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),uL=t=>e=>t===!0?Number(e):String(e),Nu=t=>typeof t=="number"||typeof t=="string"&&t!=="",hi=t=>Number.isInteger(+t),Mu=t=>{let e=`${t}`,r=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return !1;for(;e[++r]==="0";);return r>0},cL=(t,e,r)=>typeof t=="string"||typeof e=="string"?!0:r.stringify===!0,fL=(t,e,r)=>{if(e>0){let n=t[0]==="-"?"-":"";n&&(t=t.slice(1)),t=n+t.padStart(n?e-1:e,"0");}return r===!1?String(t):t},ob=(t,e)=>{let r=t[0]==="-"?"-":"";for(r&&(t=t.slice(1),e--);t.length{t.negatives.sort((o,l)=>ol?1:0),t.positives.sort((o,l)=>ol?1:0);let r=e.capture?"":"?:",n="",s="",i;return t.positives.length&&(n=t.positives.join("|")),t.negatives.length&&(s=`-(${r}${t.negatives.join("|")})`),n&&s?i=`${n}|${s}`:i=n||s,e.wrap?`(${r}${i})`:i},lb=(t,e,r,n)=>{if(r)return ab(t,e,{wrap:!1,...n});let s=String.fromCharCode(t);if(t===e)return s;let i=String.fromCharCode(e);return `[${s}-${i}]`},ub=(t,e,r)=>{if(Array.isArray(t)){let n=r.wrap===!0,s=r.capture?"":"?:";return n?`(${s}${t.join("|")})`:t.join("|")}return ab(t,e,r)},cb=(...t)=>new RangeError("Invalid range arguments: "+lL.inspect(...t)),fb=(t,e,r)=>{if(r.strictRanges===!0)throw cb([t,e]);return []},pL=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return []},dL=(t,e,r=1,n={})=>{let s=Number(t),i=Number(e);if(!Number.isInteger(s)||!Number.isInteger(i)){if(n.strictRanges===!0)throw cb([t,e]);return []}s===0&&(s=0),i===0&&(i=0);let o=s>i,l=String(t),c=String(e),p=String(r);r=Math.max(Math.abs(r),1);let u=Mu(l)||Mu(c)||Mu(p),g=u?Math.max(l.length,c.length,p.length):0,y=u===!1&&cL(t,e,n)===!1,m=n.transform||uL(y);if(n.toRegex&&r===1)return lb(ob(t,g),ob(e,g),!0,n);let v={negatives:[],positives:[]},b=A=>v[A<0?"negatives":"positives"].push(Math.abs(A)),_=[],x=0;for(;o?s>=i:s<=i;)n.toRegex===!0&&r>1?b(s):_.push(fL(m(s,x),g,y)),s=o?s-r:s+r,x++;return n.toRegex===!0?r>1?hL(v,n):ub(_,null,{wrap:!1,...n}):_},gL=(t,e,r=1,n={})=>{if(!hi(t)&&t.length>1||!hi(e)&&e.length>1)return fb(t,e,n);let s=n.transform||(y=>String.fromCharCode(y)),i=`${t}`.charCodeAt(0),o=`${e}`.charCodeAt(0),l=i>o,c=Math.min(i,o),p=Math.max(i,o);if(n.toRegex&&r===1)return lb(c,p,!1,n);let u=[],g=0;for(;l?i>=o:i<=o;)u.push(s(i,g)),i=l?i-r:i+r,g++;return n.toRegex===!0?ub(u,null,{wrap:!1,options:n}):u},po=(t,e,r,n={})=>{if(e==null&&Nu(t))return [t];if(!Nu(t)||!Nu(e))return fb(t,e,n);if(typeof r=="function")return po(t,e,1,{transform:r});if(sb(r))return po(t,e,0,r);let s={...n};return s.capture===!0&&(s.wrap=!0),r=r||s.step||1,hi(r)?hi(t)&&hi(e)?dL(t,e,r,s):gL(t,e,Math.max(Math.abs(r),1),s):r!=null&&!sb(r)?pL(r,s):po(t,e,1,r)};hb.exports=po;});var gb=R((KM,db)=>{var yL=ju(),pb=fo(),mL=(t,e={})=>{let r=(n,s={})=>{let i=pb.isInvalidBrace(s),o=n.invalid===!0&&e.escapeInvalid===!0,l=i===!0||o===!0,c=e.escapeInvalid===!0?"\\":"",p="";if(n.isOpen===!0||n.isClose===!0)return c+n.value;if(n.type==="open")return l?c+n.value:"(";if(n.type==="close")return l?c+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":l?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let u=pb.reduce(n.nodes),g=yL(...u,{...e,wrap:!1,toRegex:!0});if(g.length!==0)return u.length>1&&g.length>1?`(${g})`:g}if(n.nodes)for(let u of n.nodes)p+=r(u,n);return p};return r(t)};db.exports=mL;});var vb=R((VM,mb)=>{var vL=ju(),yb=ho(),vn=fo(),Dr=(t="",e="",r=!1)=>{let n=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return r?vn.flatten(e).map(s=>`{${s}}`):e;for(let s of t)if(Array.isArray(s))for(let i of s)n.push(Dr(i,e,r));else for(let i of e)r===!0&&typeof i=="string"&&(i=`{${i}}`),n.push(Array.isArray(i)?Dr(s,i,r):s+i);return vn.flatten(n)},wL=(t,e={})=>{let r=e.rangeLimit===void 0?1e3:e.rangeLimit,n=(s,i={})=>{s.queue=[];let o=i,l=i.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,l=o.queue;if(s.invalid||s.dollar){l.push(Dr(l.pop(),yb(s,e)));return}if(s.type==="brace"&&s.invalid!==!0&&s.nodes.length===2){l.push(Dr(l.pop(),["{}"]));return}if(s.nodes&&s.ranges>0){let g=vn.reduce(s.nodes);if(vn.exceedsLimit(...g,e.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let y=vL(...g,e);y.length===0&&(y=yb(s,e)),l.push(Dr(l.pop(),y)),s.nodes=[];return}let c=vn.encloseBrace(s),p=s.queue,u=s;for(;u.type!=="brace"&&u.type!=="root"&&u.parent;)u=u.parent,p=u.queue;for(let g=0;g{wb.exports={MAX_LENGTH:1024*64,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:` +`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"};});var xb=R((JM,_b)=>{var SL=ho(),{MAX_LENGTH:bb,CHAR_BACKSLASH:Bu,CHAR_BACKTICK:bL,CHAR_COMMA:EL,CHAR_DOT:AL,CHAR_LEFT_PARENTHESES:_L,CHAR_RIGHT_PARENTHESES:xL,CHAR_LEFT_CURLY_BRACE:CL,CHAR_RIGHT_CURLY_BRACE:RL,CHAR_LEFT_SQUARE_BRACKET:Eb,CHAR_RIGHT_SQUARE_BRACKET:Ab,CHAR_DOUBLE_QUOTE:OL,CHAR_SINGLE_QUOTE:PL,CHAR_NO_BREAK_SPACE:TL,CHAR_ZERO_WIDTH_NOBREAK_SPACE:$L}=Sb(),IL=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},n=typeof r.maxLength=="number"?Math.min(bb,r.maxLength):bb;if(t.length>n)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${n})`);let s={type:"root",input:t,nodes:[]},i=[s],o=s,l=s,c=0,p=t.length,u=0,g=0,y,v=()=>t[u++],b=_=>{if(_.type==="text"&&l.type==="dot"&&(l.type="text"),l&&l.type==="text"&&_.type==="text"){l.value+=_.value;return}return o.nodes.push(_),_.parent=o,_.prev=l,l=_,_};for(b({type:"bos"});u0){if(o.ranges>0){o.ranges=0;let _=o.nodes.shift();o.nodes=[_,{type:"text",value:SL(o)}];}b({type:"comma",value:y}),o.commas++;continue}if(y===AL&&g>0&&o.commas===0){let _=o.nodes;if(g===0||_.length===0){b({type:"text",value:y});continue}if(l.type==="dot"){if(o.range=[],l.value+=y,l.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,l.type="text";continue}o.ranges++,o.args=[];continue}if(l.type==="range"){_.pop();let x=_[_.length-1];x.value+=l.value+y,l=x,o.ranges--;continue}b({type:"dot",value:y});continue}b({type:"text",value:y});}do if(o=i.pop(),o.type!=="root"){o.nodes.forEach(A=>{A.nodes||(A.type==="open"&&(A.isOpen=!0),A.type==="close"&&(A.isClose=!0),A.nodes||(A.type="text"),A.invalid=!0);});let _=i[i.length-1],x=_.nodes.indexOf(o);_.nodes.splice(x,1,...o.nodes);}while(i.length>0);return b({type:"eos"}),s};_b.exports=IL;});var Ob=R((XM,Rb)=>{var Cb=ho(),kL=gb(),LL=vb(),FL=xb(),ct=(t,e={})=>{let r=[];if(Array.isArray(t))for(let n of t){let s=ct.create(n,e);Array.isArray(s)?r.push(...s):r.push(s);}else r=[].concat(ct.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};ct.parse=(t,e={})=>FL(t,e);ct.stringify=(t,e={})=>Cb(typeof t=="string"?ct.parse(t,e):t,e);ct.compile=(t,e={})=>(typeof t=="string"&&(t=ct.parse(t,e)),kL(t,e));ct.expand=(t,e={})=>{typeof t=="string"&&(t=ct.parse(t,e));let r=LL(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};ct.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?ct.compile(t,e):ct.expand(t,e);Rb.exports=ct;});var Pb=R((QM,qL)=>{qL.exports=["3dm","3ds","3g2","3gp","7z","a","aac","adp","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"];});var $b=R((ZM,Tb)=>{Tb.exports=Pb();});var kb=R((ej,Ib)=>{var DL=z("path"),NL=$b(),ML=new Set(NL);Ib.exports=t=>ML.has(DL.extname(t).slice(1).toLowerCase());});var go=R(Z=>{var{sep:jL}=z("path"),{platform:Hu}=process,BL=z("os");Z.EV_ALL="all";Z.EV_READY="ready";Z.EV_ADD="add";Z.EV_CHANGE="change";Z.EV_ADD_DIR="addDir";Z.EV_UNLINK="unlink";Z.EV_UNLINK_DIR="unlinkDir";Z.EV_RAW="raw";Z.EV_ERROR="error";Z.STR_DATA="data";Z.STR_END="end";Z.STR_CLOSE="close";Z.FSEVENT_CREATED="created";Z.FSEVENT_MODIFIED="modified";Z.FSEVENT_DELETED="deleted";Z.FSEVENT_MOVED="moved";Z.FSEVENT_CLONED="cloned";Z.FSEVENT_UNKNOWN="unknown";Z.FSEVENT_TYPE_FILE="file";Z.FSEVENT_TYPE_DIRECTORY="directory";Z.FSEVENT_TYPE_SYMLINK="symlink";Z.KEY_LISTENERS="listeners";Z.KEY_ERR="errHandlers";Z.KEY_RAW="rawEmitters";Z.HANDLER_KEYS=[Z.KEY_LISTENERS,Z.KEY_ERR,Z.KEY_RAW];Z.DOT_SLASH=`.${jL}`;Z.BACK_SLASH_RE=/\\/g;Z.DOUBLE_SLASH_RE=/\/\//;Z.SLASH_OR_BACK_SLASH_RE=/[/\\]/;Z.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/;Z.REPLACER_RE=/^\.[/\\]/;Z.SLASH="/";Z.SLASH_SLASH="//";Z.BRACE_START="{";Z.BANG="!";Z.ONE_DOT=".";Z.TWO_DOTS="..";Z.STAR="*";Z.GLOBSTAR="**";Z.ROOT_GLOBSTAR="/**/*";Z.SLASH_GLOBSTAR="/**";Z.DIR_SUFFIX="Dir";Z.ANYMATCH_OPTS={dot:!0};Z.STRING_TYPE="string";Z.FUNCTION_TYPE="function";Z.EMPTY_STR="";Z.EMPTY_FN=()=>{};Z.IDENTITY_FN=t=>t;Z.isWindows=Hu==="win32";Z.isMacos=Hu==="darwin";Z.isLinux=Hu==="linux";Z.isIBMi=BL.type()==="OS400";});var Mb=R((rj,Nb)=>{var Vt=z("fs"),Le=z("path"),{promisify:yi}=z("util"),HL=kb(),{isWindows:UL,isLinux:WL,EMPTY_FN:zL,EMPTY_STR:GL,KEY_LISTENERS:wn,KEY_ERR:Uu,KEY_RAW:pi,HANDLER_KEYS:KL,EV_CHANGE:mo,EV_ADD:yo,EV_ADD_DIR:VL,EV_ERROR:Fb,STR_DATA:YL,STR_END:JL,BRACE_START:XL,STAR:QL}=go(),ZL="watch",eF=yi(Vt.open),qb=yi(Vt.stat),tF=yi(Vt.lstat),rF=yi(Vt.close),Wu=yi(Vt.realpath),nF={lstat:tF,stat:qb},Gu=(t,e)=>{t instanceof Set?t.forEach(e):e(t);},di=(t,e,r)=>{let n=t[e];n instanceof Set||(t[e]=n=new Set([n])),n.add(r);},iF=t=>e=>{let r=t[e];r instanceof Set?r.clear():delete t[e];},gi=(t,e,r)=>{let n=t[e];n instanceof Set?n.delete(r):n===r&&delete t[e];},Db=t=>t instanceof Set?t.size===0:!t,vo=new Map;function Lb(t,e,r,n,s){let i=(o,l)=>{r(t),s(o,l,{watchedPath:t}),l&&t!==l&&wo(Le.resolve(t,l),wn,Le.join(t,l));};try{return Vt.watch(t,e,i)}catch(o){n(o);}}var wo=(t,e,r,n,s)=>{let i=vo.get(t);i&&Gu(i[e],o=>{o(r,n,s);});},sF=(t,e,r,n)=>{let{listener:s,errHandler:i,rawEmitter:o}=n,l=vo.get(e),c;if(!r.persistent)return c=Lb(t,r,s,i,o),c.close.bind(c);if(l)di(l,wn,s),di(l,Uu,i),di(l,pi,o);else {if(c=Lb(t,r,wo.bind(null,e,wn),i,wo.bind(null,e,pi)),!c)return;c.on(Fb,async p=>{let u=wo.bind(null,e,Uu);if(l.watcherUnusable=!0,UL&&p.code==="EPERM")try{let g=await eF(t,"r");await rF(g),u(p);}catch{}else u(p);}),l={listeners:s,errHandlers:i,rawEmitters:o,watcher:c},vo.set(e,l);}return ()=>{gi(l,wn,s),gi(l,Uu,i),gi(l,pi,o),Db(l.listeners)&&(l.watcher.close(),vo.delete(e),KL.forEach(iF(l)),l.watcher=void 0,Object.freeze(l));}},zu=new Map,oF=(t,e,r,n)=>{let {listener:s,rawEmitter:i}=n,o=zu.get(e),p=o&&o.options;return p&&(p.persistentr.interval)&&(Vt.unwatchFile(e),o=void 0),o?(di(o,wn,s),di(o,pi,i)):(o={listeners:s,rawEmitters:i,options:r,watcher:Vt.watchFile(e,r,(u,g)=>{Gu(o.rawEmitters,m=>{m(mo,e,{curr:u,prev:g});});let y=u.mtimeMs;(u.size!==g.size||y>g.mtimeMs||y===0)&&Gu(o.listeners,m=>m(t,u));})},zu.set(e,o)),()=>{gi(o,wn,s),gi(o,pi,i),Db(o.listeners)&&(zu.delete(e),Vt.unwatchFile(e),o.options=o.watcher=void 0,Object.freeze(o));}},Ku=class{constructor(e){this.fsw=e,this._boundHandleError=r=>e._handleError(r);}_watchWithNodeFs(e,r){let n=this.fsw.options,s=Le.dirname(e),i=Le.basename(e);this.fsw._getWatchedDir(s).add(i);let l=Le.resolve(e),c={persistent:n.persistent};r||(r=zL);let p;return n.usePolling?(c.interval=n.enableBinaryInterval&&HL(i)?n.binaryInterval:n.interval,p=oF(e,l,c,{listener:r,rawEmitter:this.fsw._emitRaw})):p=sF(e,l,c,{listener:r,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),p}_handleFile(e,r,n){if(this.fsw.closed)return;let s=Le.dirname(e),i=Le.basename(e),o=this.fsw._getWatchedDir(s),l=r;if(o.has(i))return;let c=async(u,g)=>{if(this.fsw._throttle(ZL,e,5)){if(!g||g.mtimeMs===0)try{let y=await qb(e);if(this.fsw.closed)return;let m=y.atimeMs,v=y.mtimeMs;(!m||m<=v||v!==l.mtimeMs)&&this.fsw._emit(mo,e,y),WL&&l.ino!==y.ino?(this.fsw._closeFile(u),l=y,this.fsw._addPathCloser(u,this._watchWithNodeFs(e,c))):l=y;}catch{this.fsw._remove(s,i);}else if(o.has(i)){let y=g.atimeMs,m=g.mtimeMs;(!y||y<=m||m!==l.mtimeMs)&&this.fsw._emit(mo,e,g),l=g;}}},p=this._watchWithNodeFs(e,c);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(yo,e,0))return;this.fsw._emit(yo,e,r);}return p}async _handleSymlink(e,r,n,s){if(this.fsw.closed)return;let i=e.fullPath,o=this.fsw._getWatchedDir(r);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let l;try{l=await Wu(n);}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(o.has(s)?this.fsw._symlinkPaths.get(i)!==l&&(this.fsw._symlinkPaths.set(i,l),this.fsw._emit(mo,n,e.stats)):(o.add(s),this.fsw._symlinkPaths.set(i,l),this.fsw._emit(yo,n,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(i))return !0;this.fsw._symlinkPaths.set(i,!0);}_handleRead(e,r,n,s,i,o,l){if(e=Le.join(e,GL),!n.hasGlob&&(l=this.fsw._throttle("readdir",e,1e3),!l))return;let c=this.fsw._getWatchedDir(n.path),p=new Set,u=this.fsw._readdirp(e,{fileFilter:g=>n.filterPath(g),directoryFilter:g=>n.filterDir(g),depth:0}).on(YL,async g=>{if(this.fsw.closed){u=void 0;return}let y=g.path,m=Le.join(e,y);if(p.add(y),!(g.stats.isSymbolicLink()&&await this._handleSymlink(g,e,m,y))){if(this.fsw.closed){u=void 0;return}(y===s||!s&&!c.has(y))&&(this.fsw._incrReadyCount(),m=Le.join(i,Le.relative(i,m)),this._addToNodeFs(m,r,n,o+1));}}).on(Fb,this._boundHandleError);return new Promise(g=>u.once(JL,()=>{if(this.fsw.closed){u=void 0;return}let y=l?l.clear():!1;g(),c.getChildren().filter(m=>m!==e&&!p.has(m)&&(!n.hasGlob||n.filterPath({fullPath:Le.resolve(e,m)}))).forEach(m=>{this.fsw._remove(e,m);}),u=void 0,y&&this._handleRead(e,!1,n,s,i,o,l);}))}async _handleDir(e,r,n,s,i,o,l){let c=this.fsw._getWatchedDir(Le.dirname(e)),p=c.has(Le.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!i&&!p&&(!o.hasGlob||o.globFilter(e))&&this.fsw._emit(VL,e,r),c.add(Le.basename(e)),this.fsw._getWatchedDir(e);let u,g,y=this.fsw.options.depth;if((y==null||s<=y)&&!this.fsw._symlinkPaths.has(l)){if(!i&&(await this._handleRead(e,n,o,i,e,s,u),this.fsw.closed))return;g=this._watchWithNodeFs(e,(m,v)=>{v&&v.mtimeMs===0||this._handleRead(m,!1,o,i,e,s,u);});}return g}async _addToNodeFs(e,r,n,s,i){let o=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return o(),!1;let l=this.fsw._getWatchHelpers(e,s);!l.hasGlob&&n&&(l.hasGlob=n.hasGlob,l.globFilter=n.globFilter,l.filterPath=c=>n.filterPath(c),l.filterDir=c=>n.filterDir(c));try{let c=await nF[l.statMethod](l.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(l.watchPath,c))return o(),!1;let p=this.fsw.options.followSymlinks&&!e.includes(QL)&&!e.includes(XL),u;if(c.isDirectory()){let g=Le.resolve(e),y=p?await Wu(e):e;if(this.fsw.closed||(u=await this._handleDir(l.watchPath,c,r,s,i,l,y),this.fsw.closed))return;g!==y&&y!==void 0&&this.fsw._symlinkPaths.set(g,y);}else if(c.isSymbolicLink()){let g=p?await Wu(e):e;if(this.fsw.closed)return;let y=Le.dirname(l.watchPath);if(this.fsw._getWatchedDir(y).add(l.watchPath),this.fsw._emit(yo,l.watchPath,c),u=await this._handleDir(y,c,r,s,e,l,g),this.fsw.closed)return;g!==void 0&&this.fsw._symlinkPaths.set(Le.resolve(e),g);}else u=this._handleFile(l.watchPath,c,r);return o(),this.fsw._addPathCloser(e,u),!1}catch(c){if(this.fsw._handleError(c))return o(),e}}};Nb.exports=Ku;});var Gb=R((nj,tc)=>{var Zu=z("fs"),Fe=z("path"),{promisify:ec}=z("util"),Sn;try{Sn=z("fsevents");}catch(t){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(t);}if(Sn){let t=process.version.match(/v(\d+)\.(\d+)/);if(t&&t[1]&&t[2]){let e=Number.parseInt(t[1],10),r=Number.parseInt(t[2],10);e===8&&r<16&&(Sn=void 0);}}var{EV_ADD:Vu,EV_CHANGE:aF,EV_ADD_DIR:jb,EV_UNLINK:So,EV_ERROR:lF,STR_DATA:uF,STR_END:cF,FSEVENT_CREATED:fF,FSEVENT_MODIFIED:hF,FSEVENT_DELETED:pF,FSEVENT_MOVED:dF,FSEVENT_UNKNOWN:gF,FSEVENT_TYPE_FILE:yF,FSEVENT_TYPE_DIRECTORY:mi,FSEVENT_TYPE_SYMLINK:zb,ROOT_GLOBSTAR:Bb,DIR_SUFFIX:mF,DOT_SLASH:Hb,FUNCTION_TYPE:Yu,EMPTY_FN:vF,IDENTITY_FN:wF}=go(),SF=t=>isNaN(t)?{}:{depth:t},Xu=ec(Zu.stat),bF=ec(Zu.lstat),Ub=ec(Zu.realpath),EF={stat:Xu,lstat:bF},Nr=new Map,AF=10,_F=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),xF=(t,e)=>({stop:Sn.watch(t,e)});function CF(t,e,r,n){let s=Fe.extname(e)?Fe.dirname(e):e,i=Fe.dirname(s),o=Nr.get(s);RF(i)&&(s=i);let l=Fe.resolve(t),c=l!==e,p=(g,y,m)=>{c&&(g=g.replace(e,l)),(g===l||!g.indexOf(l+Fe.sep))&&r(g,y,m);},u=!1;for(let g of Nr.keys())if(e.indexOf(Fe.resolve(g)+Fe.sep)===0){s=g,o=Nr.get(s),u=!0;break}return o||u?o.listeners.add(p):(o={listeners:new Set([p]),rawEmitter:n,watcher:xF(s,(g,y)=>{if(!o.listeners.size)return;let m=Sn.getInfo(g,y);o.listeners.forEach(v=>{v(g,y,m);}),o.rawEmitter(m.event,g,m);})},Nr.set(s,o)),()=>{let g=o.listeners;if(g.delete(p),!g.size&&(Nr.delete(s),o.watcher))return o.watcher.stop().then(()=>{o.rawEmitter=o.watcher=void 0,Object.freeze(o);})}}var RF=t=>{let e=0;for(let r of Nr.keys())if(r.indexOf(t)===0&&(e++,e>=AF))return !0;return !1},OF=()=>Sn&&Nr.size<128,Ju=(t,e)=>{let r=0;for(;!t.indexOf(e)&&(t=Fe.dirname(t))!==e;)r++;return r},Wb=(t,e)=>t.type===mi&&e.isDirectory()||t.type===zb&&e.isSymbolicLink()||t.type===yF&&e.isFile(),Qu=class{constructor(e){this.fsw=e;}checkIgnored(e,r){let n=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,r))return n.add(e),r&&r.isDirectory()&&n.add(e+Bb),!0;n.delete(e),n.delete(e+Bb);}addOrChange(e,r,n,s,i,o,l,c){let p=i.has(o)?aF:Vu;this.handleEvent(p,e,r,n,s,i,o,l,c);}async checkExists(e,r,n,s,i,o,l,c){try{let p=await Xu(e);if(this.fsw.closed)return;Wb(l,p)?this.addOrChange(e,r,n,s,i,o,l,c):this.handleEvent(So,e,r,n,s,i,o,l,c);}catch(p){p.code==="EACCES"?this.addOrChange(e,r,n,s,i,o,l,c):this.handleEvent(So,e,r,n,s,i,o,l,c);}}handleEvent(e,r,n,s,i,o,l,c,p){if(!(this.fsw.closed||this.checkIgnored(r)))if(e===So){let u=c.type===mi;(u||o.has(l))&&this.fsw._remove(i,l,u);}else {if(e===Vu){if(c.type===mi&&this.fsw._getWatchedDir(r),c.type===zb&&p.followSymlinks){let g=p.depth===void 0?void 0:Ju(n,s)+1;return this._addToFsEvents(r,!1,!0,g)}this.fsw._getWatchedDir(i).add(l);}let u=c.type===mi?e+mF:e;this.fsw._emit(u,r),u===jb&&this._addToFsEvents(r,!1,!0);}}_watchWithFsEvents(e,r,n,s){if(this.fsw.closed||this.fsw._isIgnored(e))return;let i=this.fsw.options,l=CF(e,r,async(c,p,u)=>{if(this.fsw.closed||i.depth!==void 0&&Ju(c,r)>i.depth)return;let g=n(Fe.join(e,Fe.relative(e,c)));if(s&&!s(g))return;let y=Fe.dirname(g),m=Fe.basename(g),v=this.fsw._getWatchedDir(u.type===mi?g:y);if(_F.has(p)||u.event===gF)if(typeof i.ignored===Yu){let b;try{b=await Xu(g);}catch{}if(this.fsw.closed||this.checkIgnored(g,b))return;Wb(u,b)?this.addOrChange(g,c,r,y,v,m,u,i):this.handleEvent(So,g,c,r,y,v,m,u,i);}else this.checkExists(g,c,r,y,v,m,u,i);else switch(u.event){case fF:case hF:return this.addOrChange(g,c,r,y,v,m,u,i);case pF:case dF:return this.checkExists(g,c,r,y,v,m,u,i)}},this.fsw._emitRaw);return this.fsw._emitReady(),l}async _handleFsEventsSymlink(e,r,n,s){if(!(this.fsw.closed||this.fsw._symlinkPaths.has(r))){this.fsw._symlinkPaths.set(r,!0),this.fsw._incrReadyCount();try{let i=await Ub(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(i))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(i||e,o=>{let l=e;return i&&i!==Hb?l=o.replace(i,e):o!==Hb&&(l=Fe.join(e,o)),n(l)},!1,s);}catch(i){if(this.fsw._handleError(i))return this.fsw._emitReady()}}}emitAdd(e,r,n,s,i){let o=n(e),l=r.isDirectory(),c=this.fsw._getWatchedDir(Fe.dirname(o)),p=Fe.basename(o);l&&this.fsw._getWatchedDir(o),!c.has(p)&&(c.add(p),(!s.ignoreInitial||i===!0)&&this.fsw._emit(l?jb:Vu,o,r));}initWatch(e,r,n,s){if(this.fsw.closed)return;let i=this._watchWithFsEvents(n.watchPath,Fe.resolve(e||n.watchPath),s,n.globFilter);this.fsw._addPathCloser(r,i);}async _addToFsEvents(e,r,n,s){if(this.fsw.closed)return;let i=this.fsw.options,o=typeof r===Yu?r:wF,l=this.fsw._getWatchHelpers(e);try{let c=await EF[l.statMethod](l.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(l.watchPath,c))throw null;if(c.isDirectory()){if(l.globFilter||this.emitAdd(o(e),c,o,i,n),s&&s>i.depth)return;this.fsw._readdirp(l.watchPath,{fileFilter:p=>l.filterPath(p),directoryFilter:p=>l.filterDir(p),...SF(i.depth-(s||0))}).on(uF,p=>{if(this.fsw.closed||p.stats.isDirectory()&&!l.filterPath(p))return;let u=Fe.join(l.watchPath,p.path),{fullPath:g}=p;if(l.followSymlinks&&p.stats.isSymbolicLink()){let y=i.depth===void 0?void 0:Ju(u,Fe.resolve(l.watchPath))+1;this._handleFsEventsSymlink(u,g,o,y);}else this.emitAdd(u,p.stats,o,i,n);}).on(lF,vF).on(cF,()=>{this.fsw._emitReady();});}else this.emitAdd(l.watchPath,c,o,i,n),this.fsw._emitReady();}catch(c){(!c||this.fsw._handleError(c))&&(this.fsw._emitReady(),this.fsw._emitReady());}if(i.persistent&&n!==!0)if(typeof r===Yu)this.initWatch(void 0,e,l,o);else {let c;try{c=await Ub(l.watchPath);}catch{}this.initWatch(c,e,l,o);}}};tc.exports=Qu;tc.exports.canUse=OF;});var n0=R(yc=>{var{EventEmitter:PF}=z("events"),dc=z("fs"),ye=z("path"),{promisify:Zb}=z("util"),TF=IS(),ac=MS().default,$F=zS(),rc=Fu(),IF=Ob(),kF=ku(),LF=Mb(),Kb=Gb(),{EV_ALL:nc,EV_READY:FF,EV_ADD:bo,EV_CHANGE:vi,EV_UNLINK:Vb,EV_ADD_DIR:qF,EV_UNLINK_DIR:DF,EV_RAW:NF,EV_ERROR:ic,STR_CLOSE:MF,STR_END:jF,BACK_SLASH_RE:BF,DOUBLE_SLASH_RE:Yb,SLASH_OR_BACK_SLASH_RE:HF,DOT_RE:UF,REPLACER_RE:WF,SLASH:sc,SLASH_SLASH:zF,BRACE_START:GF,BANG:lc,ONE_DOT:e0,TWO_DOTS:KF,GLOBSTAR:VF,SLASH_GLOBSTAR:oc,ANYMATCH_OPTS:uc,STRING_TYPE:gc,FUNCTION_TYPE:YF,EMPTY_STR:cc,EMPTY_FN:JF,isWindows:XF,isMacos:QF,isIBMi:ZF}=go(),eq=Zb(dc.stat),tq=Zb(dc.readdir),fc=(t=[])=>Array.isArray(t)?t:[t],t0=(t,e=[])=>(t.forEach(r=>{Array.isArray(r)?t0(r,e):e.push(r);}),e),Jb=t=>{let e=t0(fc(t));if(!e.every(r=>typeof r===gc))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(r0)},Xb=t=>{let e=t.replace(BF,sc),r=!1;for(e.startsWith(zF)&&(r=!0);e.match(Yb);)e=e.replace(Yb,sc);return r&&(e=sc+e),e},r0=t=>Xb(ye.normalize(Xb(t))),Qb=(t=cc)=>e=>typeof e!==gc?e:r0(ye.isAbsolute(e)?e:ye.join(t,e)),rq=(t,e)=>ye.isAbsolute(t)?t:t.startsWith(lc)?lc+ye.join(e,t.slice(1)):ye.join(e,t),xt=(t,e)=>t[e]===void 0,hc=class{constructor(e,r){this.path=e,this._removeWatcher=r,this.items=new Set;}add(e){let{items:r}=this;r&&e!==e0&&e!==KF&&r.add(e);}async remove(e){let{items:r}=this;if(!r||(r.delete(e),r.size>0))return;let n=this.path;try{await tq(n);}catch{this._removeWatcher&&this._removeWatcher(ye.dirname(n),ye.basename(n));}}has(e){let{items:r}=this;if(r)return r.has(e)}getChildren(){let{items:e}=this;if(e)return [...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this);}},nq="stat",iq="lstat",pc=class{constructor(e,r,n,s){this.fsw=s,this.path=e=e.replace(WF,cc),this.watchPath=r,this.fullWatchPath=ye.resolve(r),this.hasGlob=r!==e,e===cc&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&n?void 0:!1,this.globFilter=this.hasGlob?ac(e,void 0,uc):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(i=>{i.length>1&&i.pop();}),this.followSymlinks=n,this.statMethod=n?nq:iq;}checkGlobSymlink(e){return this.globSymlink===void 0&&(this.globSymlink=e.fullParentDir===this.fullWatchPath?!1:{realPath:e.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):e.fullPath}entryPath(e){return ye.join(this.watchPath,ye.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){let{stats:r}=e;if(r&&r.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return (this.hasGlob&&typeof this.globFilter===YF?this.globFilter(n):!0)&&this.fsw._isntIgnored(n,r)&&this.fsw._hasReadPermissions(r)}getDirParts(e){if(!this.hasGlob)return [];let r=[];return (e.includes(GF)?IF.expand(e):[e]).forEach(s=>{r.push(ye.relative(this.watchPath,s).split(HF));}),r}filterDir(e){if(this.hasGlob){let r=this.getDirParts(this.checkGlobSymlink(e)),n=!1;this.unmatchedGlob=!this.dirParts.some(s=>s.every((i,o)=>(i===VF&&(n=!0),n||!r[0][o]||ac(i,r[0][o],uc))));}return !this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}},Eo=class extends PF{constructor(e){super();let r={};e&&Object.assign(r,e),this._watched=new Map,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._symlinkPaths=new Map,this._streams=new Set,this.closed=!1,xt(r,"persistent")&&(r.persistent=!0),xt(r,"ignoreInitial")&&(r.ignoreInitial=!1),xt(r,"ignorePermissionErrors")&&(r.ignorePermissionErrors=!1),xt(r,"interval")&&(r.interval=100),xt(r,"binaryInterval")&&(r.binaryInterval=300),xt(r,"disableGlobbing")&&(r.disableGlobbing=!1),r.enableBinaryInterval=r.binaryInterval!==r.interval,xt(r,"useFsEvents")&&(r.useFsEvents=!r.usePolling),Kb.canUse()||(r.useFsEvents=!1),xt(r,"usePolling")&&!r.useFsEvents&&(r.usePolling=QF),ZF&&(r.usePolling=!0);let s=process.env.CHOKIDAR_USEPOLLING;if(s!==void 0){let c=s.toLowerCase();c==="false"||c==="0"?r.usePolling=!1:c==="true"||c==="1"?r.usePolling=!0:r.usePolling=!!c;}let i=process.env.CHOKIDAR_INTERVAL;i&&(r.interval=Number.parseInt(i,10)),xt(r,"atomic")&&(r.atomic=!r.usePolling&&!r.useFsEvents),r.atomic&&(this._pendingUnlinks=new Map),xt(r,"followSymlinks")&&(r.followSymlinks=!0),xt(r,"awaitWriteFinish")&&(r.awaitWriteFinish=!1),r.awaitWriteFinish===!0&&(r.awaitWriteFinish={});let o=r.awaitWriteFinish;o&&(o.stabilityThreshold||(o.stabilityThreshold=2e3),o.pollInterval||(o.pollInterval=100),this._pendingWrites=new Map),r.ignored&&(r.ignored=fc(r.ignored));let l=0;this._emitReady=()=>{l++,l>=this._readyCount&&(this._emitReady=JF,this._readyEmitted=!0,process.nextTick(()=>this.emit(FF)));},this._emitRaw=(...c)=>this.emit(NF,...c),this._readyEmitted=!1,this.options=r,r.useFsEvents?this._fsEventsHandler=new Kb(this):this._nodeFsHandler=new LF(this),Object.freeze(r);}add(e,r,n){let{cwd:s,disableGlobbing:i}=this.options;this.closed=!1;let o=Jb(e);return s&&(o=o.map(l=>{let c=rq(l,s);return i||!rc(l)?c:kF(c)})),o=o.filter(l=>l.startsWith(lc)?(this._ignoredPaths.add(l.slice(1)),!1):(this._ignoredPaths.delete(l),this._ignoredPaths.delete(l+oc),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=o.length),this.options.persistent&&(this._readyCount*=2),o.forEach(l=>this._fsEventsHandler._addToFsEvents(l))):(this._readyCount||(this._readyCount=0),this._readyCount+=o.length,Promise.all(o.map(async l=>{let c=await this._nodeFsHandler._addToNodeFs(l,!n,0,0,r);return c&&this._emitReady(),c})).then(l=>{this.closed||l.filter(c=>c).forEach(c=>{this.add(ye.dirname(c),ye.basename(r||c));});})),this}unwatch(e){if(this.closed)return this;let r=Jb(e),{cwd:n}=this.options;return r.forEach(s=>{!ye.isAbsolute(s)&&!this._closers.has(s)&&(n&&(s=ye.join(n,s)),s=ye.resolve(s)),this._closePath(s),this._ignoredPaths.add(s),this._watched.has(s)&&this._ignoredPaths.add(s+oc),this._userIgnored=void 0;}),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(r=>r.forEach(n=>{let s=n();s instanceof Promise&&e.push(s);})),this._streams.forEach(r=>r.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(r=>r.dispose()),["closers","watched","streams","symlinkPaths","throttled"].forEach(r=>{this[`_${r}`].clear();}),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((r,n)=>{let s=this.options.cwd?ye.relative(this.options.cwd,n):n;e[s||e0]=r.getChildren().sort();}),e}emitWithAll(e,r){this.emit(...r),e!==ic&&this.emit(nc,...r);}async _emit(e,r,n,s,i){if(this.closed)return;let o=this.options;XF&&(r=ye.normalize(r)),o.cwd&&(r=ye.relative(o.cwd,r));let l=[e,r];i!==void 0?l.push(n,s,i):s!==void 0?l.push(n,s):n!==void 0&&l.push(n);let c=o.awaitWriteFinish,p;if(c&&(p=this._pendingWrites.get(r)))return p.lastChange=new Date,this;if(o.atomic){if(e===Vb)return this._pendingUnlinks.set(r,l),setTimeout(()=>{this._pendingUnlinks.forEach((u,g)=>{this.emit(...u),this.emit(nc,...u),this._pendingUnlinks.delete(g);});},typeof o.atomic=="number"?o.atomic:100),this;e===bo&&this._pendingUnlinks.has(r)&&(e=l[0]=vi,this._pendingUnlinks.delete(r));}if(c&&(e===bo||e===vi)&&this._readyEmitted){let u=(g,y)=>{g?(e=l[0]=ic,l[1]=g,this.emitWithAll(e,l)):y&&(l.length>2?l[2]=y:l.push(y),this.emitWithAll(e,l));};return this._awaitWriteFinish(r,c.stabilityThreshold,e,u),this}if(e===vi&&!this._throttle(vi,r,50))return this;if(o.alwaysStat&&n===void 0&&(e===bo||e===qF||e===vi)){let u=o.cwd?ye.join(o.cwd,r):r,g;try{g=await eq(u);}catch{}if(!g||this.closed)return;l.push(g);}return this.emitWithAll(e,l),this}_handleError(e){let r=e&&e.code;return e&&r!=="ENOENT"&&r!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||r!=="EPERM"&&r!=="EACCES")&&this.emit(ic,e),e||this.closed}_throttle(e,r,n){this._throttled.has(e)||this._throttled.set(e,new Map);let s=this._throttled.get(e),i=s.get(r);if(i)return i.count++,!1;let o,l=()=>{let p=s.get(r),u=p?p.count:0;return s.delete(r),clearTimeout(o),p&&clearTimeout(p.timeoutObject),u};o=setTimeout(l,n);let c={timeoutObject:o,clear:l,count:0};return s.set(r,c),c}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,r,n,s){let i,o=e;this.options.cwd&&!ye.isAbsolute(e)&&(o=ye.join(this.options.cwd,e));let l=new Date,c=p=>{dc.stat(o,(u,g)=>{if(u||!this._pendingWrites.has(e)){u&&u.code!=="ENOENT"&&s(u);return}let y=Number(new Date);p&&g.size!==p.size&&(this._pendingWrites.get(e).lastChange=y);let m=this._pendingWrites.get(e);y-m.lastChange>=r?(this._pendingWrites.delete(e),s(void 0,g)):i=setTimeout(c,this.options.awaitWriteFinish.pollInterval,g);});};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:l,cancelWait:()=>(this._pendingWrites.delete(e),clearTimeout(i),n)}),i=setTimeout(c,this.options.awaitWriteFinish.pollInterval));}_getGlobIgnored(){return [...this._ignoredPaths.values()]}_isIgnored(e,r){if(this.options.atomic&&UF.test(e))return !0;if(!this._userIgnored){let{cwd:n}=this.options,s=this.options.ignored,i=s&&s.map(Qb(n)),o=fc(i).filter(c=>typeof c===gc&&!rc(c)).map(c=>c+oc),l=this._getGlobIgnored().map(Qb(n)).concat(i,o);this._userIgnored=ac(l,void 0,uc);}return this._userIgnored([e,r])}_isntIgnored(e,r){return !this._isIgnored(e,r)}_getWatchHelpers(e,r){let n=r||this.options.disableGlobbing||!rc(e)?e:$F(e),s=this.options.followSymlinks;return new pc(e,n,s,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));let r=ye.resolve(e);return this._watched.has(r)||this._watched.set(r,new hc(r,this._boundRemove)),this._watched.get(r)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return !0;let n=(e&&Number.parseInt(e.mode,10))&511;return !!(4&Number.parseInt(n.toString(8)[0],10))}_remove(e,r,n){let s=ye.join(e,r),i=ye.resolve(s);if(n=n??(this._watched.has(s)||this._watched.has(i)),!this._throttle("remove",s,100))return;!n&&!this.options.useFsEvents&&this._watched.size===1&&this.add(e,r,!0),this._getWatchedDir(s).getChildren().forEach(y=>this._remove(s,y));let c=this._getWatchedDir(e),p=c.has(r);c.remove(r),this._symlinkPaths.has(i)&&this._symlinkPaths.delete(i);let u=s;if(this.options.cwd&&(u=ye.relative(this.options.cwd,s)),this.options.awaitWriteFinish&&this._pendingWrites.has(u)&&this._pendingWrites.get(u).cancelWait()===bo)return;this._watched.delete(s),this._watched.delete(i);let g=n?DF:Vb;p&&!this._isIgnored(s)&&this._emit(g,s),this.options.useFsEvents||this._closePath(s);}_closePath(e){this._closeFile(e);let r=ye.dirname(e);this._getWatchedDir(r).remove(ye.basename(e));}_closeFile(e){let r=this._closers.get(e);r&&(r.forEach(n=>n()),this._closers.delete(e));}_addPathCloser(e,r){if(!r)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(r);}_readdirp(e,r){if(this.closed)return;let n={type:nc,alwaysStat:!0,lstat:!0,...r},s=TF(e,n);return this._streams.add(s),s.once(MF,()=>{s=void 0;}),s.once(jF,()=>{s&&(this._streams.delete(s),s=void 0);}),s}};yc.FSWatcher=Eo;var sq=(t,e)=>{let r=new Eo(e);return r.add(t),r};yc.watch=sq;});var d0=R((Ur,p0)=>{var _c=z("crypto");Ur=p0.exports=Ci;function Ci(t,e){return e=f0(t,e),uq(t,e)}Ur.sha1=function(t){return Ci(t)};Ur.keys=function(t){return Ci(t,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})};Ur.MD5=function(t){return Ci(t,{algorithm:"md5",encoding:"hex"})};Ur.keysMD5=function(t){return Ci(t,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var On=_c.getHashes?_c.getHashes().slice():["sha1","md5"];On.push("passthrough");var u0=["buffer","hex","binary","base64"];function f0(t,e){e=e||{};var r={};if(r.algorithm=e.algorithm||"sha1",r.encoding=e.encoding||"hex",r.excludeValues=!!e.excludeValues,r.algorithm=r.algorithm.toLowerCase(),r.encoding=r.encoding.toLowerCase(),r.ignoreUnknown=e.ignoreUnknown===!0,r.respectType=e.respectType!==!1,r.respectFunctionNames=e.respectFunctionNames!==!1,r.respectFunctionProperties=e.respectFunctionProperties!==!1,r.unorderedArrays=e.unorderedArrays===!0,r.unorderedSets=e.unorderedSets!==!1,r.unorderedObjects=e.unorderedObjects!==!1,r.replacer=e.replacer||void 0,r.excludeKeys=e.excludeKeys||void 0,typeof t>"u")throw new Error("Object argument required.");for(var n=0;n"u"&&(r.write=r.update,r.end=r.update);var n=xc(e,r);if(n.dispatch(t),r.update||r.end(""),r.digest)return r.digest(e.encoding==="buffer"?void 0:e.encoding);var s=r.read();return e.encoding==="buffer"?s:s.toString(e.encoding)}Ur.writeToStream=function(t,e,r){return typeof r>"u"&&(r=e,e={}),e=f0(t,e),xc(e,r).dispatch(t)};function xc(t,e,r){r=r||[];var n=function(s){return e.update?e.update(s,"utf8"):e.write(s,"utf8")};return {dispatch:function(s){t.replacer&&(s=t.replacer(s));var i=typeof s;return s===null&&(i="null"),this["_"+i](s)},_object:function(s){var i=/\[object (.*)\]/i,o=Object.prototype.toString.call(s),l=i.exec(o);l?l=l[1]:l="unknown:["+o+"]",l=l.toLowerCase();var c=null;if((c=r.indexOf(s))>=0)return this.dispatch("[CIRCULAR:"+c+"]");if(r.push(s),typeof Buffer<"u"&&Buffer.isBuffer&&Buffer.isBuffer(s))return n("buffer:"),n(s);if(l!=="object"&&l!=="function"&&l!=="asyncfunction")if(this["_"+l])this["_"+l](s);else {if(t.ignoreUnknown)return n("["+l+"]");throw new Error('Unknown object type "'+l+'"')}else {var p=Object.keys(s);t.unorderedObjects&&(p=p.sort()),t.respectType!==!1&&!c0(s)&&p.splice(0,0,"prototype","__proto__","constructor"),t.excludeKeys&&(p=p.filter(function(g){return !t.excludeKeys(g)})),n("object:"+p.length+":");var u=this;return p.forEach(function(g){u.dispatch(g),n(":"),t.excludeValues||u.dispatch(s[g]),n(",");})}},_array:function(s,i){i=typeof i<"u"?i:t.unorderedArrays!==!1;var o=this;if(n("array:"+s.length+":"),!i||s.length<=1)return s.forEach(function(p){return o.dispatch(p)});var l=[],c=s.map(function(p){var u=new h0,g=r.slice(),y=xc(t,u,g);return y.dispatch(p),l=l.concat(g.slice(r.length)),u.read().toString()});return r=r.concat(l),c.sort(),this._array(c,!1)},_date:function(s){return n("date:"+s.toJSON())},_symbol:function(s){return n("symbol:"+s.toString())},_error:function(s){return n("error:"+s.toString())},_boolean:function(s){return n("bool:"+s.toString())},_string:function(s){n("string:"+s.length+":"),n(s.toString());},_function:function(s){n("fn:"),c0(s)?this.dispatch("[native]"):this.dispatch(s.toString()),t.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(s.name)),t.respectFunctionProperties&&this._object(s);},_number:function(s){return n("number:"+s.toString())},_xml:function(s){return n("xml:"+s.toString())},_null:function(){return n("Null")},_undefined:function(){return n("Undefined")},_regexp:function(s){return n("regex:"+s.toString())},_uint8array:function(s){return n("uint8array:"),this.dispatch(Array.prototype.slice.call(s))},_uint8clampedarray:function(s){return n("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(s))},_int8array:function(s){return n("int8array:"),this.dispatch(Array.prototype.slice.call(s))},_uint16array:function(s){return n("uint16array:"),this.dispatch(Array.prototype.slice.call(s))},_int16array:function(s){return n("int16array:"),this.dispatch(Array.prototype.slice.call(s))},_uint32array:function(s){return n("uint32array:"),this.dispatch(Array.prototype.slice.call(s))},_int32array:function(s){return n("int32array:"),this.dispatch(Array.prototype.slice.call(s))},_float32array:function(s){return n("float32array:"),this.dispatch(Array.prototype.slice.call(s))},_float64array:function(s){return n("float64array:"),this.dispatch(Array.prototype.slice.call(s))},_arraybuffer:function(s){return n("arraybuffer:"),this.dispatch(new Uint8Array(s))},_url:function(s){return n("url:"+s.toString())},_map:function(s){n("map:");var i=Array.from(s);return this._array(i,t.unorderedSets!==!1)},_set:function(s){n("set:");var i=Array.from(s);return this._array(i,t.unorderedSets!==!1)},_file:function(s){return n("file:"),this.dispatch([s.name,s.size,s.type,s.lastModfied])},_blob:function(){if(t.ignoreUnknown)return n("[blob]");throw Error(`Hashing Blob objects is currently not supported (see https://github.com/puleos/object-hash/issues/26) Use "options.replacer" or "options.ignoreUnknown" -`)},_domwindow:function(){return n("domwindow")},_bigint:function(s){return n("bigint:"+s.toString())},_process:function(){return n("process")},_timer:function(){return n("timer")},_pipe:function(){return n("pipe")},_tcp:function(){return n("tcp")},_udp:function(){return n("udp")},_tty:function(){return n("tty")},_statwatcher:function(){return n("statwatcher")},_securecontext:function(){return n("securecontext")},_connection:function(){return n("connection")},_zlib:function(){return n("zlib")},_context:function(){return n("context")},_nodescript:function(){return n("nodescript")},_httpparser:function(){return n("httpparser")},_dataview:function(){return n("dataview")},_signal:function(){return n("signal")},_fsevent:function(){return n("fsevent")},_tlswrap:function(){return n("tlswrap")}}}function Lb(){return {buf:"",write:function(t){this.buf+=t;},end:function(t){this.buf+=t;},read:function(){return this.buf}}}});var Nb=_((GM,Db)=>{Db.exports={STRING:2,BOOLEAN:4,BYTES:4,NUMBER:8,Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8};});var jb=_(Mo=>{Mo.byteLength=uB;Mo.toByteArray=cB;Mo.fromByteArray=pB;var Vt=[],At=[],aB=typeof Uint8Array<"u"?Uint8Array:Array,Hc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Xr=0,Mb=Hc.length;Xr0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return [r,n]}function uB(t){var e=Ub(t),r=e[0],n=e[1];return (r+n)*3/4-n}function lB(t,e,r){return (e+r)*3/4-r}function cB(t){var e,r=Ub(t),n=r[0],s=r[1],i=new aB(lB(t,n,s)),o=0,u=s>0?n-4:n,c;for(c=0;c>16&255,i[o++]=e>>8&255,i[o++]=e&255;return s===2&&(e=At[t.charCodeAt(c)]<<2|At[t.charCodeAt(c+1)]>>4,i[o++]=e&255),s===1&&(e=At[t.charCodeAt(c)]<<10|At[t.charCodeAt(c+1)]<<4|At[t.charCodeAt(c+2)]>>2,i[o++]=e>>8&255,i[o++]=e&255),i}function fB(t){return Vt[t>>18&63]+Vt[t>>12&63]+Vt[t>>6&63]+Vt[t&63]}function hB(t,e,r){for(var n,s=[],i=e;iu?u:o+i));return n===1?(e=t[r-1],s.push(Vt[e>>2]+Vt[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],s.push(Vt[e>>10]+Vt[e>>4&63]+Vt[e<<2&63]+"=")),s.join("")}});var Hb=_(Wc=>{Wc.read=function(t,e,r,n,s){var i,o,u=s*8-n-1,c=(1<>1,l=-7,d=r?s-1:0,g=r?-1:1,m=t[e+d];for(d+=g,i=m&(1<<-l)-1,m>>=-l,l+=u;l>0;i=i*256+t[e+d],d+=g,l-=8);for(o=i&(1<<-l)-1,i>>=-l,l+=n;l>0;o=o*256+t[e+d],d+=g,l-=8);if(i===0)i=1-p;else {if(i===c)return o?NaN:(m?-1:1)*(1/0);o=o+Math.pow(2,n),i=i-p;}return (m?-1:1)*o*Math.pow(2,i-n)};Wc.write=function(t,e,r,n,s,i){var o,u,c,p=i*8-s-1,l=(1<>1,g=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:i-1,w=n?1:-1,E=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+d>=1?e+=g/c:e+=g*Math.pow(2,1-d),e*c>=2&&(o++,c/=2),o+d>=l?(u=0,o=l):o+d>=1?(u=(e*c-1)*Math.pow(2,s),o=o+d):(u=e*Math.pow(2,d-1)*Math.pow(2,s),o=0));s>=8;t[r+m]=u&255,m+=w,u/=256,s-=8);for(o=o<0;t[r+m]=o&255,m+=w,o/=256,p-=8);t[r+m-w]|=E*128;};});var oE=_(Un=>{var zc=jb(),Nn=Hb(),Wb=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Un.Buffer=$;Un.SlowBuffer=vB;Un.INSPECT_MAX_BYTES=50;var Uo=2147483647;Un.kMaxLength=Uo;$.TYPED_ARRAY_SUPPORT=dB();!$.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function dB(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return !1}}Object.defineProperty($.prototype,"parent",{enumerable:!0,get:function(){if($.isBuffer(this))return this.buffer}});Object.defineProperty($.prototype,"offset",{enumerable:!0,get:function(){if($.isBuffer(this))return this.byteOffset}});function nr(t){if(t>Uo)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,$.prototype),e}function $(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Yc(t)}return Kb(t,e,r)}$.poolSize=8192;function Kb(t,e,r){if(typeof t=="string")return gB(t,e);if(ArrayBuffer.isView(t))return mB(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Kt(t,ArrayBuffer)||t&&Kt(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Kt(t,SharedArrayBuffer)||t&&Kt(t.buffer,SharedArrayBuffer)))return Vc(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return $.from(n,e,r);let s=wB(t);if(s)return s;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return $.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}$.from=function(t,e,r){return Kb(t,e,r)};Object.setPrototypeOf($.prototype,Uint8Array.prototype);Object.setPrototypeOf($,Uint8Array);function Yb(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function yB(t,e,r){return Yb(t),t<=0?nr(t):e!==void 0?typeof r=="string"?nr(t).fill(e,r):nr(t).fill(e):nr(t)}$.alloc=function(t,e,r){return yB(t,e,r)};function Yc(t){return Yb(t),nr(t<0?0:Jc(t)|0)}$.allocUnsafe=function(t){return Yc(t)};$.allocUnsafeSlow=function(t){return Yc(t)};function gB(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!$.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=Jb(t,e)|0,n=nr(r),s=n.write(t,e);return s!==r&&(n=n.slice(0,s)),n}function Gc(t){let e=t.length<0?0:Jc(t.length)|0,r=nr(e);for(let n=0;n=Uo)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Uo.toString(16)+" bytes");return t|0}function vB(t){return +t!=t&&(t=0),$.alloc(+t)}$.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==$.prototype};$.compare=function(e,r){if(Kt(e,Uint8Array)&&(e=$.from(e,e.offset,e.byteLength)),Kt(r,Uint8Array)&&(r=$.from(r,r.offset,r.byteLength)),!$.isBuffer(e)||!$.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let n=e.length,s=r.length;for(let i=0,o=Math.min(n,s);is.length?($.isBuffer(o)||(o=$.from(o)),o.copy(s,i)):Uint8Array.prototype.set.call(s,o,i);else if($.isBuffer(o))o.copy(s,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=o.length;}return s};function Jb(t,e){if($.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Kt(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let s=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Kc(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return sE(t).length;default:if(s)return n?-1:Kc(t).length;e=(""+e).toLowerCase(),s=!0;}}$.byteLength=Jb;function SB(t,e,r){let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return "";for(t||(t="utf8");;)switch(t){case"hex":return PB(this,e,r);case"utf8":case"utf-8":return Qb(this,e,r);case"ascii":return OB(this,e,r);case"latin1":case"binary":return TB(this,e,r);case"base64":return CB(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return IB(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0;}}$.prototype._isBuffer=!0;function Qr(t,e,r){let n=t[e];t[e]=t[r],t[r]=n;}$.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;rr&&(e+=" ... "),""};Wb&&($.prototype[Wb]=$.prototype.inspect);$.prototype.compare=function(e,r,n,s,i){if(Kt(e,Uint8Array)&&(e=$.from(e,e.offset,e.byteLength)),!$.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),s===void 0&&(s=0),i===void 0&&(i=this.length),r<0||n>e.length||s<0||i>this.length)throw new RangeError("out of range index");if(s>=i&&r>=n)return 0;if(s>=i)return -1;if(r>=n)return 1;if(r>>>=0,n>>>=0,s>>>=0,i>>>=0,this===e)return 0;let o=i-s,u=n-r,c=Math.min(o,u),p=this.slice(s,i),l=e.slice(r,n);for(let d=0;d2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Qc(r)&&(r=s?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(s)return -1;r=t.length-1;}else if(r<0)if(s)r=0;else return -1;if(typeof e=="string"&&(e=$.from(e,n)),$.isBuffer(e))return e.length===0?-1:zb(t,e,r,n,s);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?s?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):zb(t,[e],r,n,s);throw new TypeError("val must be string, number or Buffer")}function zb(t,e,r,n,s){let i=1,o=t.length,u=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return -1;i=2,o/=2,u/=2,r/=2;}function c(l,d){return i===1?l[d]:l.readUInt16BE(d*i)}let p;if(s){let l=-1;for(p=r;po&&(r=o-u),p=r;p>=0;p--){let l=!0;for(let d=0;ds&&(n=s)):n=s;let i=e.length;n>i/2&&(n=i/2);let o;for(o=0;o>>0,isFinite(n)?(n=n>>>0,s===void 0&&(s="utf8")):(s=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let i=this.length-r;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");s||(s="utf8");let o=!1;for(;;)switch(s){case"hex":return bB(this,e,r,n);case"utf8":case"utf-8":return EB(this,e,r,n);case"ascii":case"latin1":case"binary":return xB(this,e,r,n);case"base64":return AB(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _B(this,e,r,n);default:if(o)throw new TypeError("Unknown encoding: "+s);s=(""+s).toLowerCase(),o=!0;}};$.prototype.toJSON=function(){return {type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function CB(t,e,r){return e===0&&r===t.length?zc.fromByteArray(t):zc.fromByteArray(t.slice(e,r))}function Qb(t,e,r){r=Math.min(t.length,r);let n=[],s=e;for(;s239?4:i>223?3:i>191?2:1;if(s+u<=r){let c,p,l,d;switch(u){case 1:i<128&&(o=i);break;case 2:c=t[s+1],(c&192)===128&&(d=(i&31)<<6|c&63,d>127&&(o=d));break;case 3:c=t[s+1],p=t[s+2],(c&192)===128&&(p&192)===128&&(d=(i&15)<<12|(c&63)<<6|p&63,d>2047&&(d<55296||d>57343)&&(o=d));break;case 4:c=t[s+1],p=t[s+2],l=t[s+3],(c&192)===128&&(p&192)===128&&(l&192)===128&&(d=(i&15)<<18|(c&63)<<12|(p&63)<<6|l&63,d>65535&&d<1114112&&(o=d));}}o===null?(o=65533,u=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),s+=u;}return RB(n)}var Gb=4096;function RB(t){let e=t.length;if(e<=Gb)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn)&&(r=n);let s="";for(let i=e;in&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),rr)throw new RangeError("Trying to access beyond buffer length")}$.prototype.readUintLE=$.prototype.readUIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||De(e,r,this.length);let s=this[e],i=1,o=0;for(;++o>>0,r=r>>>0,n||De(e,r,this.length);let s=this[e+--r],i=1;for(;r>0&&(i*=256);)s+=this[e+--r]*i;return s};$.prototype.readUint8=$.prototype.readUInt8=function(e,r){return e=e>>>0,r||De(e,1,this.length),this[e]};$.prototype.readUint16LE=$.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||De(e,2,this.length),this[e]|this[e+1]<<8};$.prototype.readUint16BE=$.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||De(e,2,this.length),this[e]<<8|this[e+1]};$.prototype.readUint32LE=$.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||De(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};$.prototype.readUint32BE=$.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||De(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};$.prototype.readBigUInt64LE=Rr(function(e){e=e>>>0,Mn(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Ni(e,this.length-8);let s=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(s)+(BigInt(i)<>>0,Mn(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Ni(e,this.length-8);let s=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return (BigInt(s)<>>0,r=r>>>0,n||De(e,r,this.length);let s=this[e],i=1,o=0;for(;++o=i&&(s-=Math.pow(2,8*r)),s};$.prototype.readIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||De(e,r,this.length);let s=r,i=1,o=this[e+--s];for(;s>0&&(i*=256);)o+=this[e+--s]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*r)),o};$.prototype.readInt8=function(e,r){return e=e>>>0,r||De(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};$.prototype.readInt16LE=function(e,r){e=e>>>0,r||De(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};$.prototype.readInt16BE=function(e,r){e=e>>>0,r||De(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};$.prototype.readInt32LE=function(e,r){return e=e>>>0,r||De(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};$.prototype.readInt32BE=function(e,r){return e=e>>>0,r||De(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};$.prototype.readBigInt64LE=Rr(function(e){e=e>>>0,Mn(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Ni(e,this.length-8);let s=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return (BigInt(s)<>>0,Mn(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Ni(e,this.length-8);let s=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return (BigInt(s)<>>0,r||De(e,4,this.length),Nn.read(this,e,!0,23,4)};$.prototype.readFloatBE=function(e,r){return e=e>>>0,r||De(e,4,this.length),Nn.read(this,e,!1,23,4)};$.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||De(e,8,this.length),Nn.read(this,e,!0,52,8)};$.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||De(e,8,this.length),Nn.read(this,e,!1,52,8)};function at(t,e,r,n,s,i){if(!$.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>s||et.length)throw new RangeError("Index out of range")}$.prototype.writeUintLE=$.prototype.writeUIntLE=function(e,r,n,s){if(e=+e,r=r>>>0,n=n>>>0,!s){let u=Math.pow(2,8*n)-1;at(this,e,r,n,u,0);}let i=1,o=0;for(this[r]=e&255;++o>>0,n=n>>>0,!s){let u=Math.pow(2,8*n)-1;at(this,e,r,n,u,0);}let i=n-1,o=1;for(this[r+i]=e&255;--i>=0&&(o*=256);)this[r+i]=e/o&255;return r+n};$.prototype.writeUint8=$.prototype.writeUInt8=function(e,r,n){return e=+e,r=r>>>0,n||at(this,e,r,1,255,0),this[r]=e&255,r+1};$.prototype.writeUint16LE=$.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||at(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};$.prototype.writeUint16BE=$.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||at(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};$.prototype.writeUint32LE=$.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||at(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};$.prototype.writeUint32BE=$.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||at(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function Zb(t,e,r,n,s){iE(e,n,s,t,r,7);let i=Number(e&BigInt(4294967295));t[r++]=i,i=i>>8,t[r++]=i,i=i>>8,t[r++]=i,i=i>>8,t[r++]=i;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,r}function eE(t,e,r,n,s){iE(e,n,s,t,r,7);let i=Number(e&BigInt(4294967295));t[r+7]=i,i=i>>8,t[r+6]=i,i=i>>8,t[r+5]=i,i=i>>8,t[r+4]=i;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o=o>>8,t[r+2]=o,o=o>>8,t[r+1]=o,o=o>>8,t[r]=o,r+8}$.prototype.writeBigUInt64LE=Rr(function(e,r=0){return Zb(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});$.prototype.writeBigUInt64BE=Rr(function(e,r=0){return eE(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});$.prototype.writeIntLE=function(e,r,n,s){if(e=+e,r=r>>>0,!s){let c=Math.pow(2,8*n-1);at(this,e,r,n,c-1,-c);}let i=0,o=1,u=0;for(this[r]=e&255;++i>0)-u&255;return r+n};$.prototype.writeIntBE=function(e,r,n,s){if(e=+e,r=r>>>0,!s){let c=Math.pow(2,8*n-1);at(this,e,r,n,c-1,-c);}let i=n-1,o=1,u=0;for(this[r+i]=e&255;--i>=0&&(o*=256);)e<0&&u===0&&this[r+i+1]!==0&&(u=1),this[r+i]=(e/o>>0)-u&255;return r+n};$.prototype.writeInt8=function(e,r,n){return e=+e,r=r>>>0,n||at(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};$.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||at(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};$.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||at(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};$.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||at(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};$.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||at(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};$.prototype.writeBigInt64LE=Rr(function(e,r=0){return Zb(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});$.prototype.writeBigInt64BE=Rr(function(e,r=0){return eE(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function tE(t,e,r,n,s,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function rE(t,e,r,n,s){return e=+e,r=r>>>0,s||tE(t,e,r,4),Nn.write(t,e,r,n,23,4),r+4}$.prototype.writeFloatLE=function(e,r,n){return rE(this,e,r,!0,n)};$.prototype.writeFloatBE=function(e,r,n){return rE(this,e,r,!1,n)};function nE(t,e,r,n,s){return e=+e,r=r>>>0,s||tE(t,e,r,8),Nn.write(t,e,r,n,52,8),r+8}$.prototype.writeDoubleLE=function(e,r,n){return nE(this,e,r,!0,n)};$.prototype.writeDoubleBE=function(e,r,n){return nE(this,e,r,!1,n)};$.prototype.copy=function(e,r,n,s){if(!$.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!s&&s!==0&&(s=this.length),r>=e.length&&(r=e.length),r||(r=0),s>0&&s=this.length)throw new RangeError("Index out of range");if(s<0)throw new RangeError("sourceEnd out of bounds");s>this.length&&(s=this.length),e.length-r>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let i;if(typeof e=="number")for(i=r;i2**32?s=Vb(String(r)):typeof r=="bigint"&&(s=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(s=Vb(s)),s+="n"),n+=` It must be ${e}. Received ${s}`,n},RangeError);function Vb(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return `${t.slice(0,r)}${e}`}function $B(t,e,r){Mn(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&Ni(e,t.length-(r+1));}function iE(t,e,r,n,s,i){if(t>r||t3?e===0||e===BigInt(0)?u=`>= 0${o} and < 2${o} ** ${(i+1)*8}${o}`:u=`>= -(2${o} ** ${(i+1)*8-1}${o}) and < 2 ** ${(i+1)*8-1}${o}`:u=`>= ${e}${o} and <= ${r}${o}`,new Dn.ERR_OUT_OF_RANGE("value",u,t)}$B(n,s,i);}function Mn(t,e){if(typeof t!="number")throw new Dn.ERR_INVALID_ARG_TYPE(e,"number",t)}function Ni(t,e,r){throw Math.floor(t)!==t?(Mn(t,r),new Dn.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new Dn.ERR_BUFFER_OUT_OF_BOUNDS:new Dn.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var FB=/[^+/0-9A-Za-z-_]/g;function kB(t){if(t=t.split("=")[0],t=t.trim().replace(FB,""),t.length<2)return "";for(;t.length%4!==0;)t=t+"=";return t}function Kc(t,e){e=e||1/0;let r,n=t.length,s=null,i=[];for(let o=0;o55295&&r<57344){if(!s){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&&i.push(239,191,189);continue}s=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),s=r;continue}r=(s-55296<<10|r-56320)+65536;}else s&&(e-=3)>-1&&i.push(239,191,189);if(s=null,r<128){if((e-=1)<0)break;i.push(r);}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,r&63|128);}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,r&63|128);}else if(r<1114112){if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128);}else throw new Error("Invalid code point")}return i}function LB(t){let e=[];for(let r=0;r>8,s=r%256,i.push(s),i.push(n);return i}function sE(t){return zc.toByteArray(kB(t))}function jo(t,e,r,n){let s;for(s=0;s=e.length||s>=t.length);++s)e[s+r]=t[s];return s}function Kt(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function Qc(t){return t!==t}var BB=function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let s=0;s<16;++s)e[n+s]=t[r]+t[s];}return e}();function Rr(t){return typeof BigInt>"u"?DB:t}function DB(){throw new Error("BigInt not supported")}});var lE=_((XM,uE)=>{var Mi=Nb(),aE=oE().Buffer;function NB(t){return 12+4*Math.ceil(t.length/4)}function MB(){return !(typeof window<"u"&&typeof document<"u")}function UB(t){return t.BYTES_PER_ELEMENT?t.length*t.BYTES_PER_ELEMENT:-1}function jB(t){let e=0,r=-1;try{let n=t;if(t instanceof Map?n=Object.fromEntries(t):t instanceof Set&&(n=Array.from(t)),ArrayBuffer.isView(t))return UB(t);let s=JSON.stringify(n,(i,o)=>typeof o=="bigint"||typeof o=="function"?o.toString():typeof o>"u"?"undefined":typeof o=="symbol"||o instanceof RegExp?o.toString():o);e=aE.byteLength(s,"utf8");}catch(n){return console.error("Error detected, returning "+r,n),r}return e}function HB(t){let e=[],r=[t],n=0;for(;r.length;){let s=r.pop();if(typeof s=="boolean")n+=Mi.BYTES;else if(typeof s=="string")MB()?n+=NB(s):n+=s.length*Mi.STRING;else if(typeof s=="number")n+=Mi.NUMBER;else if(typeof s=="symbol")Symbol.keyFor&&Symbol.keyFor(t)?n+=Symbol.keyFor(t).length*Mi.STRING:n+=(t.toString().length-8)*Mi.STRING;else if(typeof s=="bigint")n+=aE.from(s.toString()).byteLength;else if(typeof s=="function")n+=s.toString().length;else if(typeof s=="object"&&e.indexOf(s)===-1){e.push(s);for(let i in s)r.push(s[i]);}}return n}uE.exports=function(t){let e=0;return t!==null&&typeof t=="object"?e=jB(t):e=HB(t),e};});var nf=_((ij,xE)=>{var rf=class{constructor(e={}){let r=e.base||1.001,n=e.precision||1e-9;if(!(r>1)||!(r<1.5))throw new Error("base must be a number between 1 and 1.5");if(r+=1e-9,r=2**(1/Math.ceil(Math.log(2)/Math.log(r))),r===1)throw new Error("base too close to 1");n=Number.parseFloat(""+n);let s=Math.ceil(1/(r-1)),i=n*s;this._thresh=i,this._precision=n,this._base=r;}getBase(){return this._base}getPrecision(){return this._precision}round(e){if(typeof e!="number"&&(e=Number.parseFloat(e)),Number.isNaN(e))throw new Error("Attempt to round a non-numeric value: "+e);return e<0?-this.round(-e):ee)return Ui(e,t,r);let n=-Math.floor(Math.log(e-t)/Math.log(r));for(;Math.ceil(t*r**n)<=Math.floor(e*r**n);)n--;return n++,n>=0?Math.ceil(t*r**n)/r**n:Math.ceil(t/r**-n)*r**-n}xE.exports={Binning:rf,shorten:Ui};});var _E=_((sj,AE)=>{var{Binning:YB}=nf(),JB="stats-logscale/univariate@1.0",ji=class t extends YB{constructor(e={}){super(e),this.storage=new Map,this._count=0,this._cache={},this.neat=new Hi(this),e.bins&&this.addWeighted(e.bins);}add(...e){return this._cache={},e.forEach(r=>{let n=this.round(r),s=this.storage.get(n)??0;this.storage.set(n,s+1),this._count++;}),this}addWeighted(e){return this._cache={},e.forEach(r=>{let n=r[0],s=Number.parseFloat(r[1]);if(Number.isNaN(s))throw new Error("Attempt to provide a non-numeric weight");let i=this.round(n),o=(this.storage.get(i)??0)+s;o<=0?(this.storage.delete(i),this._count+=s-o):(this.storage.set(i,o),this._count+=s);}),this}toJSON(){return {version:JB,precision:this.getPrecision(),base:this.getBase(),bins:this.getBins()}}clone(e={}){let r=this.getBins(e);return e.transform&&(r=r.map(n=>[e.transform(n[0]),n[1]])),new t({precision:e.precision??this.getPrecision(),base:e.base??this.getBase(),bins:r})}getBins(e){if(this._cache.data||(this._cache.data=[...this.storage].sort((u,c)=>u[0]-c[0])),!e)return this._cache.data;let r=Math.max(e.min??-1/0,this.percentile(e.ltrim??0)),n=Math.min(e.max??1/0,this.percentile(100-(e.rtrim??0)));if(!e.winsorize)return this._cache.data.filter(u=>u[0]>=r&&u[0]<=n);let s=[this.round(r),0],i=[this.round(n),0],o=[s];for(let[u,c]of this._cache.data)u<=s[0]?s[1]+=c:u>=i[0]?i[1]+=c:o.push([u,c]);return i[1]>0&&o.push(i),o}count(){return this._count}min(){let e=this.getBins();return this.lower(e[0][0])}max(){let e=this.getBins();return this.upper(e[e.length-1][0])}sumOf(e){let r=0;return [...this.storage].forEach(n=>{r+=n[1]*e(n[0]);}),r}E(e){return this._count?this.sumOf(e)/this._count:void 0}mean(){return this._count?this.sumOf(e=>e)/this._count:void 0}stdev(){if(this._count<2)return;let e=this.mean();return Math.sqrt(this.sumOf(r=>(r-e)*(r-e))/(this._count-1))}skewness(){let e=this.count();return e<3?void 0:e*e/((e-1)*(e-2))*this.momentStd(3)}kurtosis(){let e=this.count();if(e<4)return;let r=e*e*(e+1)/((e-1)*(e-2)*(e-3)),n=(e-1)*(e-1)/((e-2)*(e-3));return this.momentStd(4)*r-3*n}moment(e,r){if(!Number.isInteger(e))throw new Error("Cannot calculate non-integer moment (did you mean momentAbs?)");return r===void 0&&(r=this.mean()),this.E(n=>(n-r)**e)}momentAbs(e=1,r){return r===void 0&&(r=this.mean()),this.E(n=>Math.abs(n-r)**e)}momentStd(e){return this.moment(e)/this.stdev()**e}quantile(e){let r=e*this._count,n=this._cumulative(),s=0,i=n.length;for(;s+1=r?i=c:s=c;}let o=this.lower(n[s][0]),u=this.upper(n[s][0])-o;return o+u*(r-n[s][1])/(n[s][2]-n[s][1])}percentile(e){return this.quantile(e/100)}median(){return this.quantile(.5)}cdf(e){return this._rawCdf(e)/this._count}_rawCdf(e){let r=this._cumulative(),n=this.round(e),s=0,i=r.length;for(;s=r.length)return this._count;let o=s>0?r[s-1][2]:0,u=n!==r[s][0]?0:(r[s][2]-r[s][1])*(e-this.lower(e))/(this.upper(e)-this.lower(e));return o+u}histogram(e={}){if(!this._count)return [];let r=this.min(),n=this.max(),s=e.count||10,i=[],o=r,u=(n-r)/s;for(let c=0;c1;)i[c][0]-=i[c-1][0];if(i[0][0]-=this._rawCdf(r),e.scale){let c=0;for(let p=0;p{let e=!!t.match(/\+/);e&&(t=t.replace("+",""));let r=ji.prototype[t];if(typeof r!="function")throw new Error('method "'+t+'" is cached but never defined');ji.prototype[t]=e?function(...n){if(this._count===0)return;this._cache[t]===void 0&&(this._cache[t]={});let s=n.join(":");return this._cache[t][s]===void 0&&(this._cache[t][s]=r.apply(this,n)),this._cache[t][s]}:function(){if(this._count!==0)return this._cache[t]===void 0&&(this._cache[t]=r.apply(this)),this._cache[t]};});var Hi=class{constructor(e){this._main=e;}min(){if(!this._main._count)return;let e=this._main.getBins();return this._main.shorten(e[0][0])}max(){if(!this._main._count)return;let e=this._main.getBins();return this._main.shorten(e[e.length-1][0])}};["E","kurtosis","mean","median","moment","momentAbs","momentStd","percentile","quantile","skewness","stdev","sumOf"].forEach(t=>{Hi.prototype[t]=function(e){return this._main.shorten(this._main[t](e))};});["cdf","count"].forEach(t=>{Hi.prototype[t]=function(e){return this._main[t](e)};});AE.exports={Univariate:ji};});var CE=_((oj,sf)=>{(()=>{let{Binning:t}=nf(),{Univariate:e}=_E(),r={Binning:t,Univariate:e};typeof window<"u"&&(window.logstat=r),typeof sf=="object"&&(sf.exports=r);})();});var Zi=new Uint8Array(256),Qi=Zi.length;function ua(){return Qi>Zi.length-16&&(Xx__default.default.randomFillSync(Zi),Qi=0),Zi.slice(Qi,Qi+=16)}var He=[];for(let t=0;t<256;++t)He.push((t+256).toString(16).slice(1));function Zf(t,e=0){return He[t[e+0]]+He[t[e+1]]+He[t[e+2]]+He[t[e+3]]+"-"+He[t[e+4]]+He[t[e+5]]+"-"+He[t[e+6]]+He[t[e+7]]+"-"+He[t[e+8]]+He[t[e+9]]+"-"+He[t[e+10]]+He[t[e+11]]+He[t[e+12]]+He[t[e+13]]+He[t[e+14]]+He[t[e+15]]}var la={randomUUID:Xx__default.default.randomUUID};function Zx(t,e,r){if(la.randomUUID&&!e&&!t)return la.randomUUID();t=t||{};let n=t.random||(t.rng||ua)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(let s=0;s<16;++s)e[r+s]=n[s];return e}return Zf(n)}var Pr=Zx;var af=nn(zy());var dr={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")};function CC(t,e){return e}function Gy(t){return typeof t!="object"||t===null?0:Array.isArray(t)?2:TC(t)?1:t instanceof Set?3:t instanceof Map?4:5}function RC(t){let e=new Set;for(let r of t)for(let n of [...Object.keys(r),...Object.getOwnPropertySymbols(r)])e.add(n);return e}function OC(t,e){return typeof t=="object"&&Object.prototype.propertyIsEnumerable.call(t,e)}function Ky(t){return {*[Symbol.iterator](){for(let e of t)for(let r of e)yield r;}}}var Vy=new Set(["[object Object]","[object Module]"]);function TC(t){if(!Vy.has(Object.prototype.toString.call(t)))return !1;let{constructor:e}=t;if(e===void 0)return !0;let r=e.prototype;return !(r===null||typeof r!="object"||!Vy.has(Object.prototype.toString.call(r))||!r.hasOwnProperty("isPrototypeOf"))}function PC(t,e,r){let n={};for(let s of RC(t)){let i=[];for(let c of t)OC(c,s)&&i.push(c[s]);if(i.length===0)continue;let o=e.metaDataUpdater(r,{key:s,parents:t}),u=Xy(i,e,o);u!==dr.skip&&(s==="__proto__"?Object.defineProperty(n,s,{value:u,configurable:!0,enumerable:!0,writable:!0}):n[s]=u);}return n}function IC(t){return t.flat()}function $C(t){return new Set(Ky(t))}function FC(t){return new Map(Ky(t))}function Yy(t){return t.at(-1)}var yu=Object.freeze({__proto__:null,mergeArrays:IC,mergeMaps:FC,mergeOthers:Yy,mergeRecords:PC,mergeSets:$C});function Jy(...t){return kC({})(...t)}function kC(t,e){let r=LC(t,n);function n(...s){return Xy(s,r,e)}return n}function LC(t,e){return {defaultMergeFunctions:yu,mergeFunctions:{...yu,...Object.fromEntries(Object.entries(t).filter(([r,n])=>Object.hasOwn(yu,r)).map(([r,n])=>n===!1?[r,Yy]:[r,n]))},metaDataUpdater:t.metaDataUpdater??CC,deepmerge:e,useImplicitDefaultMerging:t.enableImplicitDefaultMerging??!1,actions:dr}}function Xy(t,e,r){if(t.length===0)return;if(t.length===1)return gu(t,e,r);let n=Gy(t[0]);if(n!==0&&n!==5){for(let s=1;s{let e=typeof t;return t!==null&&(e==="object"||e==="function")};var mu=new Set(["__proto__","prototype","constructor"]),MC=new Set("0123456789");function wu(t){let e=[],r="",n="start",s=!1;for(let i of t)switch(i){case"\\":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");s&&(r+=i),n="property",s=!s;break}case".":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(s){s=!1,r+=i;break}if(mu.has(r))return [];e.push(r),r="",n="property";break}case"[":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(s){s=!1,r+=i;break}if(n==="property"){if(mu.has(r))return [];e.push(r),r="";}n="index";break}case"]":{if(n==="index"){e.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw new Error("Invalid character after an index")}default:{if(n==="index"&&!MC.has(i))throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");n==="start"&&(n="property"),s&&(s=!1,r+="\\"),r+=i;}}switch(s&&(r+="\\"),n){case"property":{if(mu.has(r))return [];e.push(r);break}case"index":throw new Error("Index was not closed");case"start":{e.push("");break}}return e}function Qy(t,e){if(typeof e!="number"&&Array.isArray(t)){let r=Number.parseInt(e,10);return Number.isInteger(r)&&t[r]===t[e]}return !1}function Zy(t,e){if(Qy(t,e))throw new Error("Cannot use string index")}function eg(t,e,r){if(!si(t)||typeof e!="string")return r===void 0?t:r;let n=wu(e);if(n.length===0)return r;for(let s=0;se.abort(r.reason),{signal:e.signal});}return e.signal}var ct=class extends Error{constructor(r){super(`${r.status} ${r.statusText}`);this.name="HttpError",this.status=r.status,this.statusText=r.statusText,this.response=r;}};function Fs(t){return t instanceof Error&&t.name==="TimeoutError"||t instanceof ct&&[408,499].indexOf(t.status)!==-1}function ks(t){return t instanceof Error&&t.name==="AbortError"}function bu(t){this.message=t;}bu.prototype=new Error,bu.prototype.name="InvalidCharacterError";var ag=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new bu("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,s=0,i=0,o="";n=e.charAt(i++);~n&&(r=s%4?64*r+n:n,s++%4)?o+=String.fromCharCode(255&r>>(-2*s&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return o};function JC(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw "Illegal base64url string!"}try{return function(r){return decodeURIComponent(ag(r).replace(/(.)/g,function(n,s){var i=s.charCodeAt(0).toString(16).toUpperCase();return i.length<2&&(i="0"+i),"%"+i}))}(e)}catch{return ag(e)}}function Ls(t){this.message=t;}function XC(t,e){if(typeof t!="string")throw new Ls("Invalid token specified");var r=(e=e||{}).header===!0?0:1;try{return JSON.parse(JC(t.split(".")[r]))}catch(n){throw new Ls("Invalid token specified: "+n.message)}}Ls.prototype=new Error,Ls.prototype.name="InvalidTokenError";var qs=XC;ui();var Ks=(()=>{let t=G("path").join(G("os").homedir(),".tabby-client","agent","data.json"),e=Nu();return {data:{},load:async function(){await this.migrateFrom_0_3_0(),this.data=await e.readJson(t,{throws:!1})||{};},save:async function(){await e.outputJson(t,this.data);},migrateFrom_0_3_0:async function(){let r=G("path").join(G("os").homedir(),".tabby","agent","data.json"),n=G("path").join(G("os").homedir(),".tabby","agent",".data_json_migrated");if(await e.pathExists(r)&&!await e.pathExists(n)){let s=await e.readJson(r);await e.outputJson(t,s),await e.outputFile(n,"");}}}})();Ut();var ft=class ft extends events.EventEmitter{constructor(r){super();this.logger=Re.child({component:"Auth"});this.dataStore=null;this.refreshTokenTimer=null;this.jwt=null;this.endpoint=r.endpoint,this.dataStore=r.dataStore||Ks,this.authApi=Lr({baseUrl:"https://app.tabbyml.com/api"}),this.scheduleRefreshToken();}static async create(r){let n=new ft(r);return await n.load(),n}get token(){return this.jwt?.token}get user(){return this.jwt?.payload.email}async load(){if(this.dataStore)try{await this.dataStore.load();let r=this.dataStore.data.auth?.[this.endpoint]?.jwt;if(typeof r=="string"&&this.jwt?.token!==r){this.logger.debug({storedJwt:r},"Load jwt from data store.");let n={token:r,payload:qs(r)};n.payload.exp*1e3-Date.now()"u")return;delete this.dataStore.data.auth[this.endpoint];}await this.dataStore.save(),this.logger.debug("Save changes to data store.");}catch(r){this.logger.error({error:r},"Error when saving auth");}}async reset(){this.jwt&&(this.jwt=null,await this.save());}async requestAuthUrl(r){try{if(await this.reset(),r?.signal.aborted)throw r.signal.reason;this.logger.debug("Start to request device token");let n=await this.authApi.POST("/device-token",{body:{auth_url:this.endpoint},signal:r?.signal});if(n.error)throw new ct(n.response);let s=n.data;this.logger.debug({deviceToken:s},"Request device token response");let i=new URL(ft.authPageUrl);return i.searchParams.append("code",s.data.code),{authUrl:i.toString(),code:s.data.code}}catch(n){throw this.logger.error({error:n},"Error when requesting token"),n}}async pollingToken(r,n){return new Promise((s,i)=>{let o=ai([AbortSignal.timeout(ft.tokenStrategy.polling.timeout),n?.signal]),u=setInterval(async()=>{try{let c=await this.authApi.POST("/device-token/accept",{params:{query:{code:r}},signal:o});if(c.error)throw new ct(c.response);let p=c.data;this.logger.debug({result:p},"Poll jwt response"),this.jwt={token:p.data.jwt,payload:qs(p.data.jwt)},super.emit("updated",this.jwt),await this.save(),clearInterval(u),s(!0);}catch(c){c instanceof ct&&[400,401,403,405].indexOf(c.status)!==-1?this.logger.debug({error:c},"Expected error when polling jwt"):this.logger.error({error:c},"Error when polling jwt");}},ft.tokenStrategy.polling.interval);o.aborted?(clearInterval(u),i(o.reason)):o.addEventListener("abort",()=>{clearInterval(u),i(o.reason);});})}async refreshToken(r,n={maxTry:1,retryDelay:1e3},s=0){try{this.logger.debug({retry:s},"Start to refresh token");let i=await this.authApi.POST("/device-token/refresh",{headers:{Authorization:`Bearer ${r.token}`}});if(i.error)throw new ct(i.response);let o=i.data;return this.logger.debug({refreshedJwt:o},"Refresh token response"),{token:o.data.jwt,payload:qs(o.data.jwt)}}catch(i){if(i instanceof ct&&[400,401,403,405].indexOf(i.status)!==-1)this.logger.debug({error:i},"Error when refreshing jwt");else if(this.logger.error({error:i},"Unknown error when refreshing jwt"),ssetTimeout(o,n.retryDelay)),this.refreshToken(r,n,s+1);throw {...i,retry:s}}}scheduleRefreshToken(){this.refreshTokenTimer=setInterval(async()=>{if(!this.jwt)return null;if(this.jwt.payload.exp*1e3-Date.now(){var Tc=class{constructor(e={}){let r=e.base||1.001,n=e.precision||1e-9;if(!(r>1)||!(r<1.5))throw new Error("base must be a number between 1 and 1.5");if(r+=1e-9,r=2**(1/Math.ceil(Math.log(2)/Math.log(r))),r===1)throw new Error("base too close to 1");n=Number.parseFloat(""+n);let s=Math.ceil(1/(r-1)),i=n*s;this._thresh=i,this._precision=n,this._base=r;}getBase(){return this._base}getPrecision(){return this._precision}round(e){if(typeof e!="number"&&(e=Number.parseFloat(e)),Number.isNaN(e))throw new Error("Attempt to round a non-numeric value: "+e);return e<0?-this.round(-e):ee)return Ri(e,t,r);let n=-Math.floor(Math.log(e-t)/Math.log(r));for(;Math.ceil(t*r**n)<=Math.floor(e*r**n);)n--;return n++,n>=0?Math.ceil(t*r**n)/r**n:Math.ceil(t/r**-n)*r**-n}C0.exports={Binning:Tc,shorten:Ri};});var O0=R((SB,R0)=>{var{Binning:gq}=$c(),yq="stats-logscale/univariate@1.0",Oi=class t extends gq{constructor(e={}){super(e),this.storage=new Map,this._count=0,this._cache={},this.neat=new Pi(this),e.bins&&this.addWeighted(e.bins);}add(...e){return this._cache={},e.forEach(r=>{let n=this.round(r),s=this.storage.get(n)??0;this.storage.set(n,s+1),this._count++;}),this}addWeighted(e){return this._cache={},e.forEach(r=>{let n=r[0],s=Number.parseFloat(r[1]);if(Number.isNaN(s))throw new Error("Attempt to provide a non-numeric weight");let i=this.round(n),o=(this.storage.get(i)??0)+s;o<=0?(this.storage.delete(i),this._count+=s-o):(this.storage.set(i,o),this._count+=s);}),this}toJSON(){return {version:yq,precision:this.getPrecision(),base:this.getBase(),bins:this.getBins()}}clone(e={}){let r=this.getBins(e);return e.transform&&(r=r.map(n=>[e.transform(n[0]),n[1]])),new t({precision:e.precision??this.getPrecision(),base:e.base??this.getBase(),bins:r})}getBins(e){if(this._cache.data||(this._cache.data=[...this.storage].sort((l,c)=>l[0]-c[0])),!e)return this._cache.data;let r=Math.max(e.min??-1/0,this.percentile(e.ltrim??0)),n=Math.min(e.max??1/0,this.percentile(100-(e.rtrim??0)));if(!e.winsorize)return this._cache.data.filter(l=>l[0]>=r&&l[0]<=n);let s=[this.round(r),0],i=[this.round(n),0],o=[s];for(let[l,c]of this._cache.data)l<=s[0]?s[1]+=c:l>=i[0]?i[1]+=c:o.push([l,c]);return i[1]>0&&o.push(i),o}count(){return this._count}min(){let e=this.getBins();return this.lower(e[0][0])}max(){let e=this.getBins();return this.upper(e[e.length-1][0])}sumOf(e){let r=0;return [...this.storage].forEach(n=>{r+=n[1]*e(n[0]);}),r}E(e){return this._count?this.sumOf(e)/this._count:void 0}mean(){return this._count?this.sumOf(e=>e)/this._count:void 0}stdev(){if(this._count<2)return;let e=this.mean();return Math.sqrt(this.sumOf(r=>(r-e)*(r-e))/(this._count-1))}skewness(){let e=this.count();return e<3?void 0:e*e/((e-1)*(e-2))*this.momentStd(3)}kurtosis(){let e=this.count();if(e<4)return;let r=e*e*(e+1)/((e-1)*(e-2)*(e-3)),n=(e-1)*(e-1)/((e-2)*(e-3));return this.momentStd(4)*r-3*n}moment(e,r){if(!Number.isInteger(e))throw new Error("Cannot calculate non-integer moment (did you mean momentAbs?)");return r===void 0&&(r=this.mean()),this.E(n=>(n-r)**e)}momentAbs(e=1,r){return r===void 0&&(r=this.mean()),this.E(n=>Math.abs(n-r)**e)}momentStd(e){return this.moment(e)/this.stdev()**e}quantile(e){let r=e*this._count,n=this._cumulative(),s=0,i=n.length;for(;s+1=r?i=c:s=c;}let o=this.lower(n[s][0]),l=this.upper(n[s][0])-o;return o+l*(r-n[s][1])/(n[s][2]-n[s][1])}percentile(e){return this.quantile(e/100)}median(){return this.quantile(.5)}cdf(e){return this._rawCdf(e)/this._count}_rawCdf(e){let r=this._cumulative(),n=this.round(e),s=0,i=r.length;for(;s=r.length)return this._count;let o=s>0?r[s-1][2]:0,l=n!==r[s][0]?0:(r[s][2]-r[s][1])*(e-this.lower(e))/(this.upper(e)-this.lower(e));return o+l}histogram(e={}){if(!this._count)return [];let r=this.min(),n=this.max(),s=e.count||10,i=[],o=r,l=(n-r)/s;for(let c=0;c1;)i[c][0]-=i[c-1][0];if(i[0][0]-=this._rawCdf(r),e.scale){let c=0;for(let p=0;p{let e=!!t.match(/\+/);e&&(t=t.replace("+",""));let r=Oi.prototype[t];if(typeof r!="function")throw new Error('method "'+t+'" is cached but never defined');Oi.prototype[t]=e?function(...n){if(this._count===0)return;this._cache[t]===void 0&&(this._cache[t]={});let s=n.join(":");return this._cache[t][s]===void 0&&(this._cache[t][s]=r.apply(this,n)),this._cache[t][s]}:function(){if(this._count!==0)return this._cache[t]===void 0&&(this._cache[t]=r.apply(this)),this._cache[t]};});var Pi=class{constructor(e){this._main=e;}min(){if(!this._main._count)return;let e=this._main.getBins();return this._main.shorten(e[0][0])}max(){if(!this._main._count)return;let e=this._main.getBins();return this._main.shorten(e[e.length-1][0])}};["E","kurtosis","mean","median","moment","momentAbs","momentStd","percentile","quantile","skewness","stdev","sumOf"].forEach(t=>{Pi.prototype[t]=function(e){return this._main.shorten(this._main[t](e))};});["cdf","count"].forEach(t=>{Pi.prototype[t]=function(e){return this._main[t](e)};});R0.exports={Univariate:Oi};});var P0=R((bB,Ic)=>{(()=>{let{Binning:t}=$c(),{Univariate:e}=O0(),r={Binning:t,Univariate:e};typeof window<"u"&&(window.logstat=r),typeof Ic=="object"&&(Ic.exports=r);})();});var Mi=new Uint8Array(256),Ni=Mi.length;function Ko(){return Ni>Mi.length-16&&(ZE__default.default.randomFillSync(Mi),Ni=0),Mi.slice(Ni,Ni+=16)}var Be=[];for(let t=0;t<256;++t)Be.push((t+256).toString(16).slice(1));function Rf(t,e=0){return Be[t[e+0]]+Be[t[e+1]]+Be[t[e+2]]+Be[t[e+3]]+"-"+Be[t[e+4]]+Be[t[e+5]]+"-"+Be[t[e+6]]+Be[t[e+7]]+"-"+Be[t[e+8]]+Be[t[e+9]]+"-"+Be[t[e+10]]+Be[t[e+11]]+Be[t[e+12]]+Be[t[e+13]]+Be[t[e+14]]+Be[t[e+15]]}var Vo={randomUUID:ZE__default.default.randomUUID};function tA(t,e,r){if(Vo.randomUUID&&!e&&!t)return Vo.randomUUID();t=t||{};let n=t.random||(t.rng||Ko)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(let s=0;s<16;++s)e[r+s]=n[s];return e}return Rf(n)}var Ar=tA;var Lc=Nn(wg());var ar={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")};function OC(t,e){return e}function Sg(t){return typeof t!="object"||t===null?0:Array.isArray(t)?2:$C(t)?1:t instanceof Set?3:t instanceof Map?4:5}function PC(t){let e=new Set;for(let r of t)for(let n of [...Object.keys(r),...Object.getOwnPropertySymbols(r)])e.add(n);return e}function TC(t,e){return typeof t=="object"&&Object.prototype.propertyIsEnumerable.call(t,e)}function Eg(t){return {*[Symbol.iterator](){for(let e of t)for(let r of e)yield r;}}}var bg=new Set(["[object Object]","[object Module]"]);function $C(t){if(!bg.has(Object.prototype.toString.call(t)))return !1;let{constructor:e}=t;if(e===void 0)return !0;let r=e.prototype;return !(r===null||typeof r!="object"||!bg.has(Object.prototype.toString.call(r))||!r.hasOwnProperty("isPrototypeOf"))}function IC(t,e,r){let n={};for(let s of PC(t)){let i=[];for(let c of t)TC(c,s)&&i.push(c[s]);if(i.length===0)continue;let o=e.metaDataUpdater(r,{key:s,parents:t}),l=xg(i,e,o);l!==ar.skip&&(s==="__proto__"?Object.defineProperty(n,s,{value:l,configurable:!0,enumerable:!0,writable:!0}):n[s]=l);}return n}function kC(t){return t.flat()}function LC(t){return new Set(Eg(t))}function FC(t){return new Map(Eg(t))}function Ag(t){return t.at(-1)}var el=Object.freeze({__proto__:null,mergeArrays:kC,mergeMaps:FC,mergeOthers:Ag,mergeRecords:IC,mergeSets:LC});function _g(...t){return qC({})(...t)}function qC(t,e){let r=DC(t,n);function n(...s){return xg(s,r,e)}return n}function DC(t,e){return {defaultMergeFunctions:el,mergeFunctions:{...el,...Object.fromEntries(Object.entries(t).filter(([r,n])=>Object.hasOwn(el,r)).map(([r,n])=>n===!1?[r,Ag]:[r,n]))},metaDataUpdater:t.metaDataUpdater??OC,deepmerge:e,useImplicitDefaultMerging:t.enableImplicitDefaultMerging??!1,actions:ar}}function xg(t,e,r){if(t.length===0)return;if(t.length===1)return tl(t,e,r);let n=Sg(t[0]);if(n!==0&&n!==5){for(let s=1;s{let e=typeof t;return t!==null&&(e==="object"||e==="function")};var rl=new Set(["__proto__","prototype","constructor"]),HC=new Set("0123456789");function nl(t){let e=[],r="",n="start",s=!1;for(let i of t)switch(i){case"\\":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");s&&(r+=i),n="property",s=!s;break}case".":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(s){s=!1,r+=i;break}if(rl.has(r))return [];e.push(r),r="",n="property";break}case"[":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(s){s=!1,r+=i;break}if(n==="property"){if(rl.has(r))return [];e.push(r),r="";}n="index";break}case"]":{if(n==="index"){e.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw new Error("Invalid character after an index")}default:{if(n==="index"&&!HC.has(i))throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");n==="start"&&(n="property"),s&&(s=!1,r+="\\"),r+=i;}}switch(s&&(r+="\\"),n){case"property":{if(rl.has(r))return [];e.push(r);break}case"index":throw new Error("Index was not closed");case"start":{e.push("");break}}return e}function Cg(t,e){if(typeof e!="number"&&Array.isArray(t)){let r=Number.parseInt(e,10);return Number.isInteger(r)&&t[r]===t[e]}return !1}function Rg(t,e){if(Cg(t,e))throw new Error("Cannot use string index")}function Og(t,e,r){if(!Kn(t)||typeof e!="string")return r===void 0?t:r;let n=nl(e);if(n.length===0)return r;for(let s=0;s0&&e[e.length-1].endsWith(` +`)&&e.push(""),e}function ge(t){return t.trim().length===0}var Lg=[["(",")"],["[","]"],["{","}"],["'","'"],['"','"'],["`","`"]],Fg=Lg.map(t=>t[0]),ws=Lg.map(t=>t[1]);function Ss(t){let e=[];for(let r of t)[["(",")"],["[","]"],["{","}"]].forEach(n=>{r===n[1]&&(e.length>0&&e[e.length-1]===n[0]?e.pop():e.push(r));}),"([{".includes(r)&&e.push(r),["'",'"',"`"].forEach(n=>{r===n&&(e.length>0&&e.includes(n)?e.splice(e.lastIndexOf(n),e.length-e.lastIndexOf(n)):e.push(r));});return e.join("")}function on(t,e){return qg.get(t,e)}function Yn(t){let e=new AbortController;for(let r of t){if(r?.aborted)return e.abort(r.reason),r;r?.addEventListener("abort",()=>e.abort(r.reason),{signal:e.signal});}return e.signal}var at=class extends Error{constructor(r){super(`${r.status} ${r.statusText}`);this.name="HttpError",this.status=r.status,this.statusText=r.statusText,this.response=r;}};function bs(t){return t instanceof Error&&t.name==="TimeoutError"||t instanceof at&&[408,499].indexOf(t.status)!==-1}function an(t){return t instanceof Error&&t.name==="AbortError"}function sl(t){this.message=t;}sl.prototype=new Error,sl.prototype.name="InvalidCharacterError";var Dg=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new sl("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,s=0,i=0,o="";n=e.charAt(i++);~n&&(r=s%4?64*r+n:n,s++%4)?o+=String.fromCharCode(255&r>>(-2*s&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return o};function QC(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw "Illegal base64url string!"}try{return function(r){return decodeURIComponent(Dg(r).replace(/(.)/g,function(n,s){var i=s.charCodeAt(0).toString(16).toUpperCase();return i.length<2&&(i="0"+i),"%"+i}))}(e)}catch{return Dg(e)}}function Es(t){this.message=t;}function ZC(t,e){if(typeof t!="string")throw new Es("Invalid token specified");var r=(e=e||{}).header===!0?0:1;try{return JSON.parse(QC(t.split(".")[r]))}catch(n){throw new Es("Invalid token specified: "+n.message)}}Es.prototype=new Error,Es.prototype.name="InvalidTokenError";var As=ZC;Jn();var Fs=(()=>{let t=z("path").join(z("os").homedir(),".tabby-client","agent","data.json"),e=Al();return {data:{},load:async function(){await this.migrateFrom_0_3_0(),this.data=await e.readJson(t,{throws:!1})||{};},save:async function(){await e.outputJson(t,this.data);},migrateFrom_0_3_0:async function(){let r=z("path").join(z("os").homedir(),".tabby","agent","data.json"),n=z("path").join(z("os").homedir(),".tabby","agent",".data_json_migrated");if(await e.pathExists(r)&&!await e.pathExists(n)){let s=await e.readJson(r);await e.outputJson(t,s),await e.outputFile(n,"");}}}})();Nt();var lt=class lt extends events.EventEmitter{constructor(r){super();this.logger=Ce.child({component:"Auth"});this.dataStore=null;this.refreshTokenTimer=null;this.jwt=null;this.endpoint=r.endpoint,this.dataStore=r.dataStore||Fs,this.authApi=Or({baseUrl:"https://app.tabbyml.com/api"}),this.scheduleRefreshToken();}static async create(r){let n=new lt(r);return await n.load(),n}get token(){return this.jwt?.token}get user(){return this.jwt?.payload.email}async load(){if(this.dataStore)try{await this.dataStore.load();let r=this.dataStore.data.auth?.[this.endpoint]?.jwt;if(typeof r=="string"&&this.jwt?.token!==r){this.logger.debug({storedJwt:r},"Load jwt from data store.");let n={token:r,payload:As(r)};n.payload.exp*1e3-Date.now()"u")return;delete this.dataStore.data.auth[this.endpoint];}await this.dataStore.save(),this.logger.debug("Save changes to data store.");}catch(r){this.logger.error({error:r},"Error when saving auth");}}async reset(){this.jwt&&(this.jwt=null,await this.save());}async requestAuthUrl(r){try{if(await this.reset(),r?.signal.aborted)throw r.signal.reason;this.logger.debug("Start to request device token");let n=await this.authApi.POST("/device-token",{body:{auth_url:this.endpoint},signal:r?.signal});if(n.error)throw new at(n.response);let s=n.data;this.logger.debug({deviceToken:s},"Request device token response");let i=new URL(lt.authPageUrl);return i.searchParams.append("code",s.data.code),{authUrl:i.toString(),code:s.data.code}}catch(n){throw this.logger.error({error:n},"Error when requesting token"),n}}async pollingToken(r,n){return new Promise((s,i)=>{let o=Yn([AbortSignal.timeout(lt.tokenStrategy.polling.timeout),n?.signal]),l=setInterval(async()=>{try{let c=await this.authApi.POST("/device-token/accept",{params:{query:{code:r}},signal:o});if(c.error)throw new at(c.response);let p=c.data;this.logger.debug({result:p},"Poll jwt response"),this.jwt={token:p.data.jwt,payload:As(p.data.jwt)},super.emit("updated",this.jwt),await this.save(),clearInterval(l),s(!0);}catch(c){c instanceof at&&[400,401,403,405].indexOf(c.status)!==-1?this.logger.debug({error:c},"Expected error when polling jwt"):this.logger.error({error:c},"Error when polling jwt");}},lt.tokenStrategy.polling.interval);o.aborted?(clearInterval(l),i(o.reason)):o.addEventListener("abort",()=>{clearInterval(l),i(o.reason);});})}async refreshToken(r,n={maxTry:1,retryDelay:1e3},s=0){try{this.logger.debug({retry:s},"Start to refresh token");let i=await this.authApi.POST("/device-token/refresh",{headers:{Authorization:`Bearer ${r.token}`}});if(i.error)throw new at(i.response);let o=i.data;return this.logger.debug({refreshedJwt:o},"Refresh token response"),{token:o.data.jwt,payload:As(o.data.jwt)}}catch(i){if(i instanceof at&&[400,401,403,405].indexOf(i.status)!==-1)this.logger.debug({error:i},"Error when refreshing jwt");else if(this.logger.error({error:i},"Unknown error when refreshing jwt"),ssetTimeout(o,n.retryDelay)),this.refreshToken(r,n,s+1);throw {...i,retry:s}}}scheduleRefreshToken(){this.refreshTokenTimer=setInterval(async()=>{if(!this.jwt)return null;if(this.jwt.payload.exp*1e3-Date.now(){let t=G("events"),e=Nu(),r=Ov(),n=Cb();class s extends t{constructor(c){super();this.data={};this.watcher=null;this.logger=(Ut(),oa(Ev)).rootLogger.child({component:"ConfigFile"});this.filepath=c;}get config(){return this.data}async load(){try{let c=await e.readFile(this.filepath,"utf8");this.data=r.parse(c),super.emit("updated",this.data);}catch(c){c.code==="ENOENT"?await this.createTemplate():this.logger.error({error:c},"Failed to load config file");}}async createTemplate(){try{await e.outputFile(this.filepath,iB);}catch(c){this.logger.error({error:c},"Failed to create config template file");}}watch(){this.watcher=n.watch(this.filepath,{interval:1e3}),this.watcher.on("add",this.load.bind(this)),this.watcher.on("change",this.load.bind(this));}}let i=G("path").join(G("os").homedir(),".tabby-client","agent","config.toml");return new s(i)})();var Ii=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Ob=new Set,Lc=typeof process=="object"&&process?process:{},Tb=(t,e,r,n)=>{typeof Lc.emitWarning=="function"?Lc.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`);},Bo=globalThis.AbortController,Rb=globalThis.AbortSignal;if(typeof Bo>"u"){Rb=class{constructor(){ie(this,"onabort");ie(this,"_onabort",[]);ie(this,"reason");ie(this,"aborted",!1);}addEventListener(n,s){this._onabort.push(s);}},Bo=class{constructor(){ie(this,"signal",new Rb);e();}abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let s of this.signal._onabort)s(n);this.signal.onabort?.(n);}}};let t=Lc.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,Tb("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",e));};}var sB=t=>!Ob.has(t),xr=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),Pb=t=>xr(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?In:null:null,In=class extends Array{constructor(e){super(e),this.fill(0);}},$n,Gr=class Gr{constructor(e,r){ie(this,"heap");ie(this,"length");if(!S(Gr,$n))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0;}static create(e){let r=Pb(e);if(!r)return [];ne(Gr,$n,!0);let n=new Gr(e,r);return ne(Gr,$n,!1),n}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}};$n=new WeakMap,ue(Gr,$n,!1);var qc=Gr,It,dt,Ht,$t,Fn,Ie,Ft,$e,Se,ae,Qe,yt,Ve,Be,kt,ze,er,tr,Lt,Wt,Cr,ot,Fi,Bc,Vr,rr,ki,gt,No,Ib,Kr,kn,Li,zt,Ar,Gt,_r,qi,Dc,Ln,Lo,qn,qo,we,be,Bi,Nc,Yr,$i,Mc=class Mc{constructor(e){ue(this,Fi);ue(this,No);ue(this,zt);ue(this,Gt);ue(this,qi);ue(this,Ln);ue(this,qn);ue(this,we);ue(this,Bi);ue(this,Yr);ue(this,It,void 0);ue(this,dt,void 0);ue(this,Ht,void 0);ue(this,$t,void 0);ue(this,Fn,void 0);ie(this,"ttl");ie(this,"ttlResolution");ie(this,"ttlAutopurge");ie(this,"updateAgeOnGet");ie(this,"updateAgeOnHas");ie(this,"allowStale");ie(this,"noDisposeOnSet");ie(this,"noUpdateTTL");ie(this,"maxEntrySize");ie(this,"sizeCalculation");ie(this,"noDeleteOnFetchRejection");ie(this,"noDeleteOnStaleGet");ie(this,"allowStaleOnFetchAbort");ie(this,"allowStaleOnFetchRejection");ie(this,"ignoreFetchAbort");ue(this,Ie,void 0);ue(this,Ft,void 0);ue(this,$e,void 0);ue(this,Se,void 0);ue(this,ae,void 0);ue(this,Qe,void 0);ue(this,yt,void 0);ue(this,Ve,void 0);ue(this,Be,void 0);ue(this,kt,void 0);ue(this,ze,void 0);ue(this,er,void 0);ue(this,tr,void 0);ue(this,Lt,void 0);ue(this,Wt,void 0);ue(this,Cr,void 0);ue(this,ot,void 0);ue(this,Vr,()=>{});ue(this,rr,()=>{});ue(this,ki,()=>{});ue(this,gt,()=>!1);ue(this,Kr,e=>{});ue(this,kn,(e,r,n)=>{});ue(this,Li,(e,r,n,s)=>{if(n||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});let{max:r=0,ttl:n,ttlResolution:s=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:u,allowStale:c,dispose:p,disposeAfter:l,noDisposeOnSet:d,noUpdateTTL:g,maxSize:m=0,maxEntrySize:w=0,sizeCalculation:E,fetchMethod:A,noDeleteOnFetchRejection:R,noDeleteOnStaleGet:x,allowStaleOnFetchRejection:O,allowStaleOnFetchAbort:F,ignoreFetchAbort:q}=e;if(r!==0&&!xr(r))throw new TypeError("max option must be a nonnegative integer");let W=r?Pb(r):Array;if(!W)throw new Error("invalid max value: "+r);if(ne(this,It,r),ne(this,dt,m),this.maxEntrySize=w||S(this,dt),this.sizeCalculation=E,this.sizeCalculation){if(!S(this,dt)&&!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(A!==void 0&&typeof A!="function")throw new TypeError("fetchMethod must be a function if specified");if(ne(this,Fn,A),ne(this,Cr,!!A),ne(this,$e,new Map),ne(this,Se,new Array(r).fill(void 0)),ne(this,ae,new Array(r).fill(void 0)),ne(this,Qe,new W(r)),ne(this,yt,new W(r)),ne(this,Ve,0),ne(this,Be,0),ne(this,kt,qc.create(r)),ne(this,Ie,0),ne(this,Ft,0),typeof p=="function"&&ne(this,Ht,p),typeof l=="function"?(ne(this,$t,l),ne(this,ze,[])):(ne(this,$t,void 0),ne(this,ze,void 0)),ne(this,Wt,!!S(this,Ht)),ne(this,ot,!!S(this,$t)),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!g,this.noDeleteOnFetchRejection=!!R,this.allowStaleOnFetchRejection=!!O,this.allowStaleOnFetchAbort=!!F,this.ignoreFetchAbort=!!q,this.maxEntrySize!==0){if(S(this,dt)!==0&&!xr(S(this,dt)))throw new TypeError("maxSize must be a positive integer if specified");if(!xr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");te(this,No,Ib).call(this);}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!x,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!u,this.ttlResolution=xr(s)||s===0?s:1,this.ttlAutopurge=!!i,this.ttl=n||0,this.ttl){if(!xr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");te(this,Fi,Bc).call(this);}if(S(this,It)===0&&this.ttl===0&&S(this,dt)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!S(this,It)&&!S(this,dt)){let H="LRU_CACHE_UNBOUNDED";sB(H)&&(Ob.add(H),Tb("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",H,Mc));}}static unsafeExposeInternals(e){return {starts:S(e,tr),ttls:S(e,Lt),sizes:S(e,er),keyMap:S(e,$e),keyList:S(e,Se),valList:S(e,ae),next:S(e,Qe),prev:S(e,yt),get head(){return S(e,Ve)},get tail(){return S(e,Be)},free:S(e,kt),isBackgroundFetch:r=>{var n;return te(n=e,we,be).call(n,r)},backgroundFetch:(r,n,s,i)=>{var o;return te(o=e,qn,qo).call(o,r,n,s,i)},moveToTail:r=>{var n;return te(n=e,Yr,$i).call(n,r)},indexes:r=>{var n;return te(n=e,zt,Ar).call(n,r)},rindexes:r=>{var n;return te(n=e,Gt,_r).call(n,r)},isStale:r=>{var n;return S(n=e,gt).call(n,r)}}}get max(){return S(this,It)}get maxSize(){return S(this,dt)}get calculatedSize(){return S(this,Ft)}get size(){return S(this,Ie)}get fetchMethod(){return S(this,Fn)}get dispose(){return S(this,Ht)}get disposeAfter(){return S(this,$t)}getRemainingTTL(e){return S(this,$e).has(e)?1/0:0}*entries(){for(let e of te(this,zt,Ar).call(this))S(this,ae)[e]!==void 0&&S(this,Se)[e]!==void 0&&!te(this,we,be).call(this,S(this,ae)[e])&&(yield [S(this,Se)[e],S(this,ae)[e]]);}*rentries(){for(let e of te(this,Gt,_r).call(this))S(this,ae)[e]!==void 0&&S(this,Se)[e]!==void 0&&!te(this,we,be).call(this,S(this,ae)[e])&&(yield [S(this,Se)[e],S(this,ae)[e]]);}*keys(){for(let e of te(this,zt,Ar).call(this)){let r=S(this,Se)[e];r!==void 0&&!te(this,we,be).call(this,S(this,ae)[e])&&(yield r);}}*rkeys(){for(let e of te(this,Gt,_r).call(this)){let r=S(this,Se)[e];r!==void 0&&!te(this,we,be).call(this,S(this,ae)[e])&&(yield r);}}*values(){for(let e of te(this,zt,Ar).call(this))S(this,ae)[e]!==void 0&&!te(this,we,be).call(this,S(this,ae)[e])&&(yield S(this,ae)[e]);}*rvalues(){for(let e of te(this,Gt,_r).call(this))S(this,ae)[e]!==void 0&&!te(this,we,be).call(this,S(this,ae)[e])&&(yield S(this,ae)[e]);}[Symbol.iterator](){return this.entries()}find(e,r={}){for(let n of te(this,zt,Ar).call(this)){let s=S(this,ae)[n],i=te(this,we,be).call(this,s)?s.__staleWhileFetching:s;if(i!==void 0&&e(i,S(this,Se)[n],this))return this.get(S(this,Se)[n],r)}}forEach(e,r=this){for(let n of te(this,zt,Ar).call(this)){let s=S(this,ae)[n],i=te(this,we,be).call(this,s)?s.__staleWhileFetching:s;i!==void 0&&e.call(r,i,S(this,Se)[n],this);}}rforEach(e,r=this){for(let n of te(this,Gt,_r).call(this)){let s=S(this,ae)[n],i=te(this,we,be).call(this,s)?s.__staleWhileFetching:s;i!==void 0&&e.call(r,i,S(this,Se)[n],this);}}purgeStale(){let e=!1;for(let r of te(this,Gt,_r).call(this,{allowStale:!0}))S(this,gt).call(this,r)&&(this.delete(S(this,Se)[r]),e=!0);return e}dump(){let e=[];for(let r of te(this,zt,Ar).call(this,{allowStale:!0})){let n=S(this,Se)[r],s=S(this,ae)[r],i=te(this,we,be).call(this,s)?s.__staleWhileFetching:s;if(i===void 0||n===void 0)continue;let o={value:i};if(S(this,Lt)&&S(this,tr)){o.ttl=S(this,Lt)[r];let u=Ii.now()-S(this,tr)[r];o.start=Math.floor(Date.now()-u);}S(this,er)&&(o.size=S(this,er)[r]),e.unshift([n,o]);}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let s=Date.now()-n.start;n.start=Ii.now()-s;}this.set(r,n.value,n);}}set(e,r,n={}){var g,m;if(r===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:u=this.sizeCalculation,status:c}=n,{noUpdateTTL:p=this.noUpdateTTL}=n,l=S(this,Li).call(this,e,r,n.size||0,u);if(this.maxEntrySize&&l>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.delete(e),this;let d=S(this,Ie)===0?void 0:S(this,$e).get(e);if(d===void 0)d=S(this,Ie)===0?S(this,Be):S(this,kt).length!==0?S(this,kt).pop():S(this,Ie)===S(this,It)?te(this,Ln,Lo).call(this,!1):S(this,Ie),S(this,Se)[d]=e,S(this,ae)[d]=r,S(this,$e).set(e,d),S(this,Qe)[S(this,Be)]=d,S(this,yt)[d]=S(this,Be),ne(this,Be,d),Xi(this,Ie)._++,S(this,kn).call(this,d,l,c),c&&(c.set="add"),p=!1;else {te(this,Yr,$i).call(this,d);let w=S(this,ae)[d];if(r!==w){if(S(this,Cr)&&te(this,we,be).call(this,w)?w.__abortController.abort(new Error("replaced")):o||(S(this,Wt)&&((g=S(this,Ht))==null||g.call(this,w,e,"set")),S(this,ot)&&S(this,ze)?.push([w,e,"set"])),S(this,Kr).call(this,d),S(this,kn).call(this,d,l,c),S(this,ae)[d]=r,c){c.set="replace";let E=w&&te(this,we,be).call(this,w)?w.__staleWhileFetching:w;E!==void 0&&(c.oldValue=E);}}else c&&(c.set="update");}if(s!==0&&!S(this,Lt)&&te(this,Fi,Bc).call(this),S(this,Lt)&&(p||S(this,ki).call(this,d,s,i),c&&S(this,rr).call(this,c,d)),!o&&S(this,ot)&&S(this,ze)){let w=S(this,ze),E;for(;E=w?.shift();)(m=S(this,$t))==null||m.call(this,...E);}return this}pop(){var e;try{for(;S(this,Ie);){let r=S(this,ae)[S(this,Ve)];if(te(this,Ln,Lo).call(this,!0),te(this,we,be).call(this,r)){if(r.__staleWhileFetching)return r.__staleWhileFetching}else if(r!==void 0)return r}}finally{if(S(this,ot)&&S(this,ze)){let r=S(this,ze),n;for(;n=r?.shift();)(e=S(this,$t))==null||e.call(this,...n);}}}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:s}=r,i=S(this,$e).get(e);if(i!==void 0){let o=S(this,ae)[i];if(te(this,we,be).call(this,o)&&o.__staleWhileFetching===void 0)return !1;if(S(this,gt).call(this,i))s&&(s.has="stale",S(this,rr).call(this,s,i));else return n&&S(this,Vr).call(this,i),s&&(s.has="hit",S(this,rr).call(this,s,i)),!0}else s&&(s.has="miss");return !1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,s=S(this,$e).get(e);if(s!==void 0&&(n||!S(this,gt).call(this,s))){let i=S(this,ae)[s];return te(this,we,be).call(this,i)?i.__staleWhileFetching:i}}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:u=this.noDisposeOnSet,size:c=0,sizeCalculation:p=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:g=this.allowStaleOnFetchRejection,ignoreFetchAbort:m=this.ignoreFetchAbort,allowStaleOnFetchAbort:w=this.allowStaleOnFetchAbort,context:E,forceRefresh:A=!1,status:R,signal:x}=r;if(!S(this,Cr))return R&&(R.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:i,status:R});let O={allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:u,size:c,sizeCalculation:p,noUpdateTTL:l,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:g,allowStaleOnFetchAbort:w,ignoreFetchAbort:m,status:R,signal:x},F=S(this,$e).get(e);if(F===void 0){R&&(R.fetch="miss");let q=te(this,qn,qo).call(this,e,F,O,E);return q.__returned=q}else {let q=S(this,ae)[F];if(te(this,we,be).call(this,q)){let U=n&&q.__staleWhileFetching!==void 0;return R&&(R.fetch="inflight",U&&(R.returnedStale=!0)),U?q.__staleWhileFetching:q.__returned=q}let W=S(this,gt).call(this,F);if(!A&&!W)return R&&(R.fetch="hit"),te(this,Yr,$i).call(this,F),s&&S(this,Vr).call(this,F),R&&S(this,rr).call(this,R,F),q;let H=te(this,qn,qo).call(this,e,F,O,E),k=H.__staleWhileFetching!==void 0&&n;return R&&(R.fetch=W?"stale":"refresh",k&&W&&(R.returnedStale=!0)),k?H.__staleWhileFetching:H.__returned=H}}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=r,u=S(this,$e).get(e);if(u!==void 0){let c=S(this,ae)[u],p=te(this,we,be).call(this,c);return o&&S(this,rr).call(this,o,u),S(this,gt).call(this,u)?(o&&(o.get="stale"),p?(o&&n&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?c.__staleWhileFetching:void 0):(i||this.delete(e),o&&n&&(o.returnedStale=!0),n?c:void 0)):(o&&(o.get="hit"),p?c.__staleWhileFetching:(te(this,Yr,$i).call(this,u),s&&S(this,Vr).call(this,u),c))}else o&&(o.get="miss");}delete(e){var n,s;let r=!1;if(S(this,Ie)!==0){let i=S(this,$e).get(e);if(i!==void 0)if(r=!0,S(this,Ie)===1)this.clear();else {S(this,Kr).call(this,i);let o=S(this,ae)[i];te(this,we,be).call(this,o)?o.__abortController.abort(new Error("deleted")):(S(this,Wt)||S(this,ot))&&(S(this,Wt)&&((n=S(this,Ht))==null||n.call(this,o,e,"delete")),S(this,ot)&&S(this,ze)?.push([o,e,"delete"])),S(this,$e).delete(e),S(this,Se)[i]=void 0,S(this,ae)[i]=void 0,i===S(this,Be)?ne(this,Be,S(this,yt)[i]):i===S(this,Ve)?ne(this,Ve,S(this,Qe)[i]):(S(this,Qe)[S(this,yt)[i]]=S(this,Qe)[i],S(this,yt)[S(this,Qe)[i]]=S(this,yt)[i]),Xi(this,Ie)._--,S(this,kt).push(i);}}if(S(this,ot)&&S(this,ze)?.length){let i=S(this,ze),o;for(;o=i?.shift();)(s=S(this,$t))==null||s.call(this,...o);}return r}clear(){var e,r;for(let n of te(this,Gt,_r).call(this,{allowStale:!0})){let s=S(this,ae)[n];if(te(this,we,be).call(this,s))s.__abortController.abort(new Error("deleted"));else {let i=S(this,Se)[n];S(this,Wt)&&((e=S(this,Ht))==null||e.call(this,s,i,"delete")),S(this,ot)&&S(this,ze)?.push([s,i,"delete"]);}}if(S(this,$e).clear(),S(this,ae).fill(void 0),S(this,Se).fill(void 0),S(this,Lt)&&S(this,tr)&&(S(this,Lt).fill(0),S(this,tr).fill(0)),S(this,er)&&S(this,er).fill(0),ne(this,Ve,0),ne(this,Be,0),S(this,kt).length=0,ne(this,Ft,0),ne(this,Ie,0),S(this,ot)&&S(this,ze)){let n=S(this,ze),s;for(;s=n?.shift();)(r=S(this,$t))==null||r.call(this,...s);}}};It=new WeakMap,dt=new WeakMap,Ht=new WeakMap,$t=new WeakMap,Fn=new WeakMap,Ie=new WeakMap,Ft=new WeakMap,$e=new WeakMap,Se=new WeakMap,ae=new WeakMap,Qe=new WeakMap,yt=new WeakMap,Ve=new WeakMap,Be=new WeakMap,kt=new WeakMap,ze=new WeakMap,er=new WeakMap,tr=new WeakMap,Lt=new WeakMap,Wt=new WeakMap,Cr=new WeakMap,ot=new WeakMap,Fi=new WeakSet,Bc=function(){let e=new In(S(this,It)),r=new In(S(this,It));ne(this,Lt,e),ne(this,tr,r),ne(this,ki,(i,o,u=Ii.now())=>{if(r[i]=o!==0?u:0,e[i]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{S(this,gt).call(this,i)&&this.delete(S(this,Se)[i]);},o+1);c.unref&&c.unref();}}),ne(this,Vr,i=>{r[i]=e[i]!==0?Ii.now():0;}),ne(this,rr,(i,o)=>{if(e[o]){let u=e[o],c=r[o];i.ttl=u,i.start=c,i.now=n||s();let p=i.now-c;i.remainingTTL=u-p;}});let n=0,s=()=>{let i=Ii.now();if(this.ttlResolution>0){n=i;let o=setTimeout(()=>n=0,this.ttlResolution);o.unref&&o.unref();}return i};this.getRemainingTTL=i=>{let o=S(this,$e).get(i);if(o===void 0)return 0;let u=e[o],c=r[o];if(u===0||c===0)return 1/0;let p=(n||s())-c;return u-p},ne(this,gt,i=>e[i]!==0&&r[i]!==0&&(n||s())-r[i]>e[i]);},Vr=new WeakMap,rr=new WeakMap,ki=new WeakMap,gt=new WeakMap,No=new WeakSet,Ib=function(){let e=new In(S(this,It));ne(this,Ft,0),ne(this,er,e),ne(this,Kr,r=>{ne(this,Ft,S(this,Ft)-e[r]),e[r]=0;}),ne(this,Li,(r,n,s,i)=>{if(te(this,we,be).call(this,n))return 0;if(!xr(s))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(s=i(n,r),!xr(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}),ne(this,kn,(r,n,s)=>{if(e[r]=n,S(this,dt)){let i=S(this,dt)-e[r];for(;S(this,Ft)>i;)te(this,Ln,Lo).call(this,!0);}ne(this,Ft,S(this,Ft)+e[r]),s&&(s.entrySize=n,s.totalCalculatedSize=S(this,Ft));});},Kr=new WeakMap,kn=new WeakMap,Li=new WeakMap,zt=new WeakSet,Ar=function*({allowStale:e=this.allowStale}={}){if(S(this,Ie))for(let r=S(this,Be);!(!te(this,qi,Dc).call(this,r)||((e||!S(this,gt).call(this,r))&&(yield r),r===S(this,Ve)));)r=S(this,yt)[r];},Gt=new WeakSet,_r=function*({allowStale:e=this.allowStale}={}){if(S(this,Ie))for(let r=S(this,Ve);!(!te(this,qi,Dc).call(this,r)||((e||!S(this,gt).call(this,r))&&(yield r),r===S(this,Be)));)r=S(this,Qe)[r];},qi=new WeakSet,Dc=function(e){return e!==void 0&&S(this,$e).get(S(this,Se)[e])===e},Ln=new WeakSet,Lo=function(e){var i;let r=S(this,Ve),n=S(this,Se)[r],s=S(this,ae)[r];return S(this,Cr)&&te(this,we,be).call(this,s)?s.__abortController.abort(new Error("evicted")):(S(this,Wt)||S(this,ot))&&(S(this,Wt)&&((i=S(this,Ht))==null||i.call(this,s,n,"evict")),S(this,ot)&&S(this,ze)?.push([s,n,"evict"])),S(this,Kr).call(this,r),e&&(S(this,Se)[r]=void 0,S(this,ae)[r]=void 0,S(this,kt).push(r)),S(this,Ie)===1?(ne(this,Ve,ne(this,Be,0)),S(this,kt).length=0):ne(this,Ve,S(this,Qe)[r]),S(this,$e).delete(n),Xi(this,Ie)._--,r},qn=new WeakSet,qo=function(e,r,n,s){let i=r===void 0?void 0:S(this,ae)[r];if(te(this,we,be).call(this,i))return i;let o=new Bo,{signal:u}=n;u?.addEventListener("abort",()=>o.abort(u.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:s},p=(E,A=!1)=>{let{aborted:R}=o.signal,x=n.ignoreFetchAbort&&E!==void 0;if(n.status&&(R&&!A?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,x&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),R&&!x&&!A)return d(o.signal.reason);let O=m;return S(this,ae)[r]===m&&(E===void 0?O.__staleWhileFetching?S(this,ae)[r]=O.__staleWhileFetching:this.delete(e):(n.status&&(n.status.fetchUpdated=!0),this.set(e,E,c.options))),E},l=E=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=E),d(E)),d=E=>{let{aborted:A}=o.signal,R=A&&n.allowStaleOnFetchAbort,x=R||n.allowStaleOnFetchRejection,O=x||n.noDeleteOnFetchRejection,F=m;if(S(this,ae)[r]===m&&(!O||F.__staleWhileFetching===void 0?this.delete(e):R||(S(this,ae)[r]=F.__staleWhileFetching)),x)return n.status&&F.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),F.__staleWhileFetching;if(F.__returned===F)throw E},g=(E,A)=>{var x;let R=(x=S(this,Fn))==null?void 0:x.call(this,e,i,c);R&&R instanceof Promise&&R.then(O=>E(O),A),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(E(),n.allowStaleOnFetchAbort&&(E=O=>p(O,!0)));});};n.status&&(n.status.fetchDispatched=!0);let m=new Promise(g).then(p,l),w=Object.assign(m,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return r===void 0?(this.set(e,w,{...c.options,status:void 0}),r=S(this,$e).get(e)):S(this,ae)[r]=w,w},we=new WeakSet,be=function(e){if(!S(this,Cr))return !1;let r=e;return !!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof Bo},Bi=new WeakSet,Nc=function(e,r){S(this,yt)[r]=e,S(this,Qe)[e]=r;},Yr=new WeakSet,$i=function(e){e!==S(this,Be)&&(e===S(this,Ve)?ne(this,Ve,S(this,Qe)[e]):te(this,Bi,Nc).call(this,S(this,yt)[e],S(this,Qe)[e]),te(this,Bi,Nc).call(this,S(this,Be),e),ne(this,Be,e));};var Do=Mc;var cE=nn(Bb()),fE=nn(lE());Ut();var Ho=class{constructor(){this.logger=Re.child({component:"CompletionCache"});this.options={maxSize:1*1024*1024,partiallyAcceptedCacheGeneration:{enabled:!0,perCharacter:{lines:1,words:10,max:30},perWord:{lines:1,max:20},perLine:{max:3}}};this.cache=new Do({maxSize:this.options.maxSize,sizeCalculation:fE.default});}has(e){return this.cache.has(this.hash(e))}set(e,r){for(let n of this.createCacheEntries(e,r))this.logger.debug({entry:n},"Setting cache entry"),this.cache.set(this.hash(n.key),n.value);this.logger.debug({size:this.cache.calculatedSize},"Cache size");}get(e){return this.cache.get(this.hash(e))}hash(e){return (0, cE.default)(e)}createCacheEntries(e,r){let n=[{key:e,value:r}];if(this.options.partiallyAcceptedCacheGeneration.enabled){let s=r.choices.map(i=>this.calculatePartiallyAcceptedPositions(i.text).map(o=>({prefix:i.text.slice(0,o),suffix:i.text.slice(o),choiceIndex:i.index}))).flat().reduce((i,o)=>(i[o.prefix]=i[o.prefix]||[],i[o.prefix].push({suffix:o.suffix,choiceIndex:o.choiceIndex}),i),{});for(let i in s){let o={...e,text:e.text.slice(0,e.position)+i+e.text.slice(e.position),position:e.position+i.length},u={...r,choices:s[i].map(c=>({index:c.choiceIndex,text:c.suffix}))};n.push({key:o,value:u});}}return n}calculatePartiallyAcceptedPositions(e){let r=[],n=this.options.partiallyAcceptedCacheGeneration,s=Pe(e),i=0,o=0;for(;id.indexOf(p)===l).sort((p,l)=>p-l)}};Ut();function Zc(t,e,r){return Math.max(t,Math.min(e,r))}var Wo=class{constructor(){this.logger=Re.child({component:"CompletionDebounce"});this.lastCalledTimeStamp=0;this.baseInterval=200;this.calledIntervalHistory=[];this.options={baseIntervalSlideWindowAvg:{minSize:20,maxSize:100,min:100,max:400},adaptiveRate:{min:1.5,max:3},contextScoreWeights:{triggerCharacter:.5,noSuffixInCurrentLine:.4,noSuffix:.1},requestDelay:{min:100,max:1e3}};}async debounce(e,r){let{request:n,config:s,responseTime:i}=e;if(n.manually)return this.sleep(0,r);if(s.mode==="fixed")return this.sleep(s.interval,r);let o=Date.now();this.updateBaseInterval(o-this.lastCalledTimeStamp),this.lastCalledTimeStamp=o;let u=this.calcContextScore(n),p=(this.options.adaptiveRate.max-(this.options.adaptiveRate.max-this.options.adaptiveRate.min)*u)*this.baseInterval,l=Zc(this.options.requestDelay.min,this.options.requestDelay.max,p-i);return this.sleep(l,r)}async sleep(e,r){return new Promise((n,s)=>{let i=setTimeout(n,Math.min(e,2147483647));r?.signal&&(r.signal.aborted?(clearTimeout(i),s(r.signal.reason)):r.signal.addEventListener("abort",()=>{clearTimeout(i),s(r.signal.reason);}));})}updateBaseInterval(e){if(!(e>this.options.baseIntervalSlideWindowAvg.max)&&(this.calledIntervalHistory.push(e),this.calledIntervalHistory.length>this.options.baseIntervalSlideWindowAvg.maxSize&&this.calledIntervalHistory.shift(),this.calledIntervalHistory.length>this.options.baseIntervalSlideWindowAvg.minSize)){let r=this.calledIntervalHistory.reduce((n,s)=>n+s,0)/this.calledIntervalHistory.length;this.baseInterval=Zc(this.options.baseIntervalSlideWindowAvg.min,this.options.baseIntervalSlideWindowAvg.max,r);}}calcContextScore(e){let r=0,n=this.options.contextScoreWeights,s=e.text[e.position-1]??"";r+=s.match(/^\W*$/)?n.triggerCharacter:0;let i=e.text.slice(e.position)??"",o=Pe(i)[0]??"";return r+=o.match(/^\W*$/)?n.noSuffixInCurrentLine:0,r+=i.match(/^\W*$/)?n.noSuffix:0,r=Zc(0,1,r),r}};Ut();var mt=Re.child({component:"Postprocess"});function ef(t){let e=t.text.slice(0,t.position),r=t.text.slice(t.position),n=Pe(e),s=Pe(r);return {request:t,prefix:e,suffix:r,prefixLines:n,suffixLines:s}}Array.prototype.distinct||(Array.prototype.distinct=function(t){return [...new Map(this.map(e=>[t?.(e)??e,e])).values()]});function ir(t){return async e=>(e.choices=(await Promise.all(e.choices.map(async r=>(r.text=await t(r.text),r)))).filter(r=>!!r.text).distinct(r=>r.text),e)}function WB(t){return /\n(\s*)\n/g}var hE=t=>e=>{let r=e.split(WB()),n=0,s=2,i=r.length-2;for(;i>=1;){if(xe(r[i])){i--;continue}let o=i-1;for(;o>=0&&xe(r[o]);)o--;if(o<0)break;let u=r[i].trim(),c=r[o].trim(),p=Math.max(3,.1*u.length,.1*c.length);if(gn(u,c)<=p)n++,i--;else break}return n>=s?(mt.debug({inputBlocks:r,repetitionCount:n},"Remove repetitive blocks."),r.slice(0,i+1).join("").trimEnd()):e};var pE=()=>t=>{let e=Pe(t),r=0,n=5,s=e.length-2;for(;s>=1;){if(xe(e[s])){s--;continue}let i=s-1;for(;i>=0&&xe(e[i]);)i--;if(i<0)break;let o=e[s].trim(),u=e[i].trim(),c=Math.max(3,.1*o.length,.1*u.length);if(gn(o,u)<=c)r++,s=i;else break}return r>=n?(mt.debug({inputLines:e,repetitionCount:r},"Remove repetitive lines."),e.slice(0,s+1).join("").trimEnd()):t};var zB=[/(.{3,}?)\1{5,}$/g,/(.{10,}?)\1{3,}$/g],dE=()=>t=>{let e=Pe(t),r=e.length-1;for(;r>=0&&xe(e[r]);)r--;if(r<0)return t;for(let n of zB){let s=e[r].match(n);if(s)return mt.debug({inputLines:e,lineNumber:r,match:s},"Remove line ends with repetition."),r<1?null:e.slice(0,r).join("").trimEnd()}return t};function Or(t){return t.match(/^[ \t]*/)?.[0]?.length??0}function GB(t,e){return e>=t.length-1?!1:Or(t[e])=0&&xe(e[o]);)o--;if(o<0)return n;let u=e[o],c=Or(u),p=t[0],l=xe(p),d=0;for(;d=t.length)return n;let g=t[d],m;l?m=Or(g):m=Or(s+g),!l&&!i?(n.indentLevelLimit=c+1,n.allowClosingLine=!!t[1]&&Or(t[1])>c):m>c?(n.indentLevelLimit=c+1,n.allowClosingLine=!0):me=>{let{prefix:r,suffix:n,prefixLines:s,suffixLines:i}=t,o=Pe(e);if(VB(i)&&o.length>1)return mt.debug({input:e,prefix:r,suffix:n},"Drop content with multiple lines"),null;let u=KB(o,s,i),c;for(c=1;ce=>{let r=t.request,n=r.text.slice(r.position);for(let s=Math.max(0,e.length-n.length);se=>{let{suffixLines:r}=t,n=Pe(e),s=0;for(;st=>xe(t)?null:t;async function wE(t,e){let r=ef(t);return Promise.resolve(e).then(ir(dE())).then(ir(gE(r))).then(ir(mE(r))).then(ir(tf()))}async function vE(t,e){let r=ef(t);return Promise.resolve(e).then(ir(hE())).then(ir(pE())).then(ir(yE(r))).then(ir(tf()))}Ut();var bE="tabby-agent",EE="0.3.1";ui();Ut();var zo=class t{constructor(){this.anonymousUsageTrackingApi=Lr({baseUrl:"https://app.tabbyml.com/api"});this.logger=Re.child({component:"AnonymousUsage"});this.systemData={agent:`${bE}, ${EE}`,browser:void 0,node:`${process.version} ${process.platform} ${G("os").arch()} ${G("os").release()}`};this.sessionProperties={};this.userProperties={};this.userPropertiesUpdated=!1;this.emittedUniqueEvent=[];this.dataStore=null;}static async create(e){let r=new t;return r.dataStore=e.dataStore||Ks,await r.checkAnonymousId(),r}async checkAnonymousId(){if(this.dataStore){try{await this.dataStore.load();}catch(e){this.logger.debug({error:e},"Error when loading anonymousId");}if(typeof this.dataStore.data.anonymousId=="string")this.anonymousId=this.dataStore.data.anonymousId;else {this.anonymousId=Pr(),this.dataStore.data.anonymousId=this.anonymousId;try{await this.dataStore.save();}catch(e){this.logger.debug({error:e},"Error when saving anonymousId");}}}else this.anonymousId=Pr();}setSessionProperties(e,r){yn(this.sessionProperties,e,r);}setUserProperties(e,r){yn(this.userProperties,e,r),this.userPropertiesUpdated=!0;}async uniqueEvent(e,r={}){await this.event(e,r,!0);}async event(e,r={},n=!1){if(this.disabled||n&&this.emittedUniqueEvent.indexOf(e)>=0)return;n&&this.emittedUniqueEvent.push(e);let s={...this.systemData,...this.sessionProperties,...r};this.userPropertiesUpdated&&(s.$set=this.userProperties,this.userPropertiesUpdated=!1);try{await this.anonymousUsageTrackingApi.POST("/usage",{body:{distinctId:this.anonymousId,event:e,properties:s}});}catch(i){this.logger.error({error:i},"Error when sending anonymous usage data");}}};var of=nn(CE());Ut();var Go=class{constructor(){this.sum=0;this.quantity=0;}add(e){this.sum+=e,this.quantity+=1;}mean(){if(this.quantity!==0)return this.sum/this.quantity}count(){return this.quantity}},Vo=class{constructor(e){this.values=[];this.maxSize=e;}add(e){this.values.push(e),this.values.length>this.maxSize&&this.values.shift();}getValues(){return this.values}},Wi=class{constructor(){this.logger=Re.child({component:"CompletionProviderStats"});this.autoCompletionCount=0;this.manualCompletionCount=0;this.cacheHitCount=0;this.cacheMissCount=0;this.completionRequestLatencyStats=new of.Univariate;this.completionRequestCanceledStats=new Go;this.completionRequestTimeoutCount=0;this.recentCompletionRequestLatencies=new Vo(10);}add(e){let{triggerMode:r,cacheHit:n,aborted:s,requestSent:i,requestLatency:o,requestCanceled:u,requestTimeout:c}=e;s||(r==="auto"?this.autoCompletionCount+=1:this.manualCompletionCount+=1,n?this.cacheHitCount+=1:this.cacheMissCount+=1),i&&(u?this.completionRequestCanceledStats.add(o):c?this.completionRequestTimeoutCount+=1:this.completionRequestLatencyStats.add(o),u||this.recentCompletionRequestLatencies.add(o));}reset(){this.autoCompletionCount=0,this.manualCompletionCount=0,this.cacheHitCount=0,this.cacheMissCount=0,this.completionRequestLatencyStats=new of.Univariate,this.completionRequestCanceledStats=new Go,this.completionRequestTimeoutCount=0;}resetWindowed(){this.recentCompletionRequestLatencies=new Vo(10);}stats(){return {completion:{count_auto:this.autoCompletionCount,count_manual:this.manualCompletionCount,cache_hit:this.cacheHitCount,cache_miss:this.cacheMissCount},completion_request:{count:this.completionRequestLatencyStats.count(),latency_avg:this.completionRequestLatencyStats.mean(),latency_p50:this.completionRequestLatencyStats.percentile(50),latency_p95:this.completionRequestLatencyStats.percentile(95),latency_p99:this.completionRequestLatencyStats.percentile(99)},completion_request_canceled:{count:this.completionRequestCanceledStats.count(),latency_avg:this.completionRequestCanceledStats.mean()},completion_request_timeout:{count:this.completionRequestTimeoutCount}}}windowed(){let e=this.recentCompletionRequestLatencies.getValues(),r=e.filter(i=>Number.isNaN(i)),n=e.filter(i=>!Number.isNaN(i)),s=n.reduce((i,o)=>i+o,0)/n.length;return {values:e,stats:{total:e.length,timeouts:r.length,responses:n.length,averageResponseTime:s}}}static check(e){let{values:r,stats:{total:n,timeouts:s,responses:i,averageResponseTime:o}}=e;return r.slice(-3).every(u=>u<3e3)?"healthy":s/n>.5&&s>=3?"highTimeoutRate":i>=3&&o>4e3?"slowResponseTime":null}};var Zr=class Zr extends events.EventEmitter{constructor(){super();this.logger=Re.child({component:"TabbyAgent"});this.config=kc;this.userConfig={};this.clientConfig={};this.status="notInitialized";this.issues=[];this.serverHealthState=null;this.dataStore=null;this.completionCache=new Ho;this.completionDebounce=new Wo;this.nonParallelProvideCompletionAbortController=null;this.completionProviderStats=new Wi;this.tryingConnectTimer=null;this.submitStatsTimer=null;this.tryingConnectTimer=setInterval(async()=>{this.status==="disconnected"&&(this.logger.debug("Trying to connect..."),await this.healthCheck());},Zr.tryConnectInterval),this.submitStatsTimer=setInterval(async()=>{await this.submitStats();},Zr.submitStatsInterval);}static async create(r){let n=new Zr;return n.dataStore=r?.dataStore,n.anonymousUsageLogger=await zo.create({dataStore:r?.dataStore}),n}async applyConfig(){let r=this.config,n=this.status;this.config=Jy(kc,this.userConfig,this.clientConfig),An.forEach(i=>i.level=this.config.logs.level),this.anonymousUsageLogger.disabled=this.config.anonymousUsageTracking.disable,this.config.server.requestHeaders.Authorization===void 0?this.config.server.endpoint!==this.auth?.endpoint&&(this.auth=await yo.create({endpoint:this.config.server.endpoint,dataStore:this.dataStore}),this.auth.on("updated",this.setupApi.bind(this))):this.auth=null,await this.setupApi(),(0, af.default)(r.server,this.config.server)||(this.serverHealthState=null,this.completionProviderStats.resetWindowed(),this.popIssue("slowCompletionResponseTime"),this.popIssue("highCompletionTimeoutRate"),n==="unauthorized"&&this.status==="unauthorized"&&this.emitAuthRequired());let s={event:"configUpdated",config:this.config};this.logger.debug({event:s},"Config updated"),super.emit("configUpdated",s);}async setupApi(){this.api=Lr({baseUrl:this.config.server.endpoint.replace(/\/+$/,""),headers:{Authorization:this.auth?.token?`Bearer ${this.auth.token}`:void 0,...this.config.server.requestHeaders}}),await this.healthCheck();}changeStatus(r){if(this.status!=r){this.status=r;let n={event:"statusChanged",status:r};this.logger.debug({event:n},"Status changed"),super.emit("statusChanged",n),this.status==="unauthorized"&&this.emitAuthRequired();}}issueFromName(r){switch(r){case"highCompletionTimeoutRate":return {name:"highCompletionTimeoutRate",completionResponseStats:this.completionProviderStats.windowed().stats};case"slowCompletionResponseTime":return {name:"slowCompletionResponseTime",completionResponseStats:this.completionProviderStats.windowed().stats}}}pushIssue(r){this.issues.indexOf(r)===-1&&(this.issues.push(r),this.logger.debug({issue:r},"Issues Pushed"),this.emitIssueUpdated());}popIssue(r){let n=this.issues.indexOf(r);n>=0&&(this.issues.splice(n,1),this.logger.debug({issue:r},"Issues Popped"),this.emitIssueUpdated());}emitAuthRequired(){let r={event:"authRequired",server:this.config.server};super.emit("authRequired",r);}emitIssueUpdated(){let r={event:"issuesUpdated",issues:this.issues};super.emit("issuesUpdated",r);}async submitStats(){let r=this.completionProviderStats.stats();r.completion_request.count>0&&(await this.anonymousUsageLogger.event("AgentStats",{stats:r}),this.completionProviderStats.reset(),this.logger.debug({stats:r},"Stats submitted"));}async post(r,n,s){let i=Pr();this.logger.debug({requestId:i,path:r,requestOptions:n,abortOptions:s},"API request");try{let o=Math.min(2147483647,s?.timeout||this.config.server.requestTimeout),u=ai([AbortSignal.timeout(o),s?.signal]),c=await this.api.POST(r,{...n,signal:u});if(c.error)throw new ct(c.response);return this.logger.debug({requestId:i,path:r,response:c.data},"API response"),this.changeStatus("ready"),c.data}catch(o){throw Fs(o)?this.logger.debug({requestId:i,path:r,error:o},"API request timeout"):ks(o)?this.logger.debug({requestId:i,path:r,error:o},"API request canceled"):o instanceof ct&&[401,403,405].indexOf(o.status)!==-1&&new URL(this.config.server.endpoint).hostname.endsWith("app.tabbyml.com")&&this.config.server.requestHeaders.Authorization===void 0?(this.logger.debug({requestId:i,path:r,error:o},"API unauthorized"),this.changeStatus("unauthorized")):o instanceof ct?(this.logger.error({requestId:i,path:r,error:o},"API error"),this.changeStatus("disconnected")):(this.logger.error({requestId:i,path:r,error:o},"API request failed with unknown error"),this.changeStatus("disconnected")),o}}async healthCheck(r){try{let n=await this.post("/v1/health",{},r);typeof n=="object"&&n.model!==void 0&&n.device!==void 0&&(this.serverHealthState=n,this.status==="ready"&&this.anonymousUsageLogger.uniqueEvent("AgentConnected",n));}catch{}}createSegments(r){let n=this.config.completion.prompt.maxPrefixLines,s=this.config.completion.prompt.maxSuffixLines,i=r.text.slice(0,r.position),o=Pe(i),u=r.text.slice(r.position),c=Pe(u);return {prefix:o.slice(Math.max(o.length-n,0)).join(""),suffix:c.slice(0,s).join("")}}async initialize(r){if(r.clientProperties){let{user:n,session:s}=r.clientProperties;An.forEach(i=>i.setBindings?.({...s})),s&&Object.entries(s).forEach(([i,o])=>{this.anonymousUsageLogger.setSessionProperties(i,o);}),n&&Object.entries(n).forEach(([i,o])=>{this.anonymousUsageLogger.setUserProperties(i,o);});}return Pn&&(await Pn.load(),this.userConfig=Pn.config,Pn.on("updated",async n=>{this.userConfig=n,await this.applyConfig();}),Pn.watch()),r.config&&(this.clientConfig=r.config),await this.applyConfig(),await this.anonymousUsageLogger.uniqueEvent("AgentInitialized"),this.logger.debug({options:r},"Initialized"),this.status!=="notInitialized"}async finalize(){return await this.submitStats(),this.tryingConnectTimer&&(clearInterval(this.tryingConnectTimer),this.tryingConnectTimer=null),this.submitStatsTimer&&(clearInterval(this.submitStatsTimer),this.submitStatsTimer=null),this.logger.debug("Finalized"),!0}async updateClientProperties(r,n,s){switch(r){case"session":let i={};yn(i,n,s),An.forEach(o=>o.setBindings?.(i)),this.anonymousUsageLogger.setSessionProperties(n,s);break;case"user":this.anonymousUsageLogger.setUserProperties(n,s);break}return !0}async updateConfig(r,n){let s=eg(this.clientConfig,r);return (0, af.default)(s,n)||(n===void 0?tg(this.clientConfig,r):yn(this.clientConfig,r,n),await this.applyConfig()),!0}async clearConfig(r){return await this.updateConfig(r,void 0)}getConfig(){return this.config}getStatus(){return this.status}getIssues(){return this.issues}getIssueDetail(r){return r.index!==void 0?this.issueFromName(this.issues[r.index]):r.name!==void 0&&this.issues.indexOf(r.name)!==-1?this.issueFromName(r.name):null}getServerHealthState(){return this.serverHealthState}async requestAuthUrl(r){if(this.status==="notInitialized")throw new Error("Agent is not initialized");return await this.healthCheck(r),this.status!=="unauthorized"?null:await this.auth.requestAuthUrl(r)}async waitForAuthToken(r,n){if(this.status==="notInitialized")throw new Error("Agent is not initialized");await this.auth.pollingToken(r,n),await this.setupApi();}async provideCompletions(r,n){if(this.status==="notInitialized")throw new Error("Agent is not initialized");this.nonParallelProvideCompletionAbortController&&this.nonParallelProvideCompletionAbortController.abort(),this.nonParallelProvideCompletionAbortController=new AbortController;let s=ai([this.nonParallelProvideCompletionAbortController.signal,n?.signal]),i=null,o={triggerMode:r.manually?"manual":"auto",cacheHit:!1,aborted:!1,requestSent:!1,requestLatency:0,requestCanceled:!1,requestTimeout:!1},u=null;try{if(this.completionCache.has(r))o.cacheHit=!0,this.logger.debug({request:r},"Completion cache hit"),await this.completionDebounce.debounce({request:r,config:this.config.completion.debounce,responseTime:0},{signal:s}),i=this.completionCache.get(r);else {o.cacheHit=!1;let c=this.createSegments(r);if(xe(c.prefix))o=null,this.logger.debug("Segment prefix is blank, returning empty completion response"),i={id:"agent-"+Pr(),choices:[]};else {await this.completionDebounce.debounce({request:r,config:this.config.completion.debounce,responseTime:this.completionProviderStats.stats().averageResponseTime},n),o.requestSent=!0,u=performance.now();try{i=await this.post("/v1/completions",{body:{language:r.language,segments:c,user:this.auth?.user}},{signal:s,timeout:r.manually?this.config.completion.timeout.manually:this.config.completion.timeout.auto}),o.requestLatency=performance.now()-u;}catch(p){throw ks(p)&&(o.requestCanceled=!0,o.requestLatency=performance.now()-u),Fs(p)&&(o.requestTimeout=!0,o.requestLatency=NaN),p}if(i=await wE(r,i),n?.signal?.aborted)throw n.signal.reason;this.completionCache.set(r,i);}}if(i=await vE(r,i),n?.signal?.aborted)throw n.signal.reason}catch(c){throw ks(c)||Fs(c)?o&&(o.aborted=!0):o=null,c}finally{if(o&&(this.completionProviderStats.add(o),o.requestSent&&!o.requestCanceled)){let c=this.completionProviderStats.windowed();switch(Wi.check(c)){case"healthy":this.popIssue("slowCompletionResponseTime"),this.popIssue("highCompletionTimeoutRate");break;case"highTimeoutRate":this.popIssue("slowCompletionResponseTime"),this.pushIssue("highCompletionTimeoutRate");break;case"slowResponseTime":this.popIssue("highCompletionTimeoutRate"),this.pushIssue("slowCompletionResponseTime");break}}}return i}async postEvent(r,n){if(this.status==="notInitialized")throw new Error("Agent is not initialized");return await this.post("/v1/events",{body:r,params:{query:{select_kind:r.select_kind}},parseAs:"text"},n),!0}};Zr.tryConnectInterval=1e3*30,Zr.submitStatsInterval=1e3*60*60*24;var Ko=Zr;var RE=["statusChanged","configUpdated","authRequired","issuesUpdated"];Ut();var Yo=class{constructor(){this.inStream=process.stdin;this.outStream=process.stdout;this.logger=Re.child({component:"StdIO"});this.buffer="";this.abortControllers={};this.agent=null;}async handleInput(e){let r=e.toString();this.buffer+=r;let n=Pe(this.buffer);if(!(n.length<1)){n[n.length-1].endsWith(` -`)?this.buffer="":this.buffer=n.pop();for(let s of n){let i=null;try{i=JSON.parse(s);}catch(u){this.logger.error({error:u},`Failed to parse request: ${s}`);continue}this.logger.debug({request:i},"Received request");let o=await this.handleRequest(i);this.sendResponse(o),this.logger.debug({response:o},"Sent response");}}}async handleRequest(e){let r=0,n=[0,null],s=new AbortController;try{if(!this.agent)throw new Error(`Agent not bound. -`);r=e[0],n[0]=r;let i=e[1].func;if(i==="cancelRequest")n[1]=this.cancelRequest(e);else {let o=this.agent[i];if(!o)throw new Error(`Unknown function: ${i}`);let u=e[1].args;u.length>0&&typeof u[u.length-1]=="object"&&u[u.length-1].signal&&(this.abortControllers[r]=s,u[u.length-1].signal=s.signal),n[1]=await o.apply(this.agent,u);}}catch(i){this.logger.error({error:i,request:e},"Failed to handle request");}finally{return this.abortControllers[r]&&delete this.abortControllers[r],n}}cancelRequest(e){let r=e[1].args[0],n=this.abortControllers[r];return n?(n.abort(),!0):!1}sendResponse(e){this.outStream.write(JSON.stringify(e)+` -`);}bind(e){this.agent=e;for(let r of RE)this.agent.on(r,n=>{this.sendResponse([0,n]);});}listen(){this.inStream.on("data",this.handleInput.bind(this));}};var OE=new Yo;Ko.create().then(t=>{OE.bind(t),OE.listen();}); +`,aq=`## Tabby agent configuration file + +## You can uncomment any block to enable settings. +## Configurations in this file has lower priority than in IDE settings. + +## Server +## You can set the server endpoint here. +# [server] +# endpoint = "http://localhost:8080" # http or https URL + +## You can add custom request headers, e.g. for authentication. +# [server.requestHeaders] +# Authorization = "Bearer eyJhbGciOiJ..........." + +## Logs +## You can set the log level here. The log file is located at ~/.tabby-client/agent/logs/. +# [logs] +# level = "silent" # or "error" or "debug" + +## Anonymous usage tracking +## You can disable anonymous usage tracking here. +# [anonymousUsageTracking] +# disable = false # set to true to disable + +`,bn=(()=>{let t=z("events"),e=Al(),r=sS(),n=n0();class s extends t{constructor(c){super();this.data={};this.watcher=null;this.logger=(Nt(),zo(Zw)).rootLogger.child({component:"ConfigFile"});this.filepath=c;}get config(){return this.data}async load(){try{let c=await e.readFile(this.filepath,"utf8");if(c.trim()===oq.trim())return await this.createTemplate(),await this.load();this.data=r.parse(c),super.emit("updated",this.data);}catch(c){c.code==="ENOENT"?await this.createTemplate():this.logger.error({error:c},"Failed to load config file");}}async createTemplate(){try{await e.outputFile(this.filepath,aq);}catch(c){this.logger.error({error:c},"Failed to create config template file");}}watch(){this.watcher=n.watch(this.filepath,{interval:1e3}),this.watcher.on("add",this.load.bind(this)),this.watcher.on("change",this.load.bind(this));}}let i=z("path").join(z("os").homedir(),".tabby-client","agent","config.toml");return new s(i)})();var wi=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,s0=new Set,vc=typeof process=="object"&&process?process:{},o0=(t,e,r,n)=>{typeof vc.emitWarning=="function"?vc.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`);},xo=globalThis.AbortController,i0=globalThis.AbortSignal;if(typeof xo>"u"){i0=class{constructor(){ne(this,"onabort");ne(this,"_onabort",[]);ne(this,"reason");ne(this,"aborted",!1);}addEventListener(n,s){this._onabort.push(s);}},xo=class{constructor(){ne(this,"signal",new i0);e();}abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let s of this.signal._onabort)s(n);this.signal.onabort?.(n);}}};let t=vc.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,o0("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",e));};}var lq=t=>!s0.has(t),yr=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),a0=t=>yr(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?En:null:null,En=class extends Array{constructor(e){super(e),this.fill(0);}},An,Mr=class Mr{constructor(e,r){ne(this,"heap");ne(this,"length");if(!S(Mr,An))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0;}static create(e){let r=a0(e);if(!r)return [];re(Mr,An,!0);let n=new Mr(e,r);return re(Mr,An,!1),n}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}};An=new WeakMap,ae(Mr,An,!1);var wc=Mr,Ct,ft,jt,Rt,_n,Te,Ot,$e,Se,oe,Je,ht,ze,qe,Pt,Ue,Yt,Jt,Tt,Bt,wr,it,bi,Sc,jr,Xt,Ei,pt,Ro,l0,Br,xn,Ai,Ht,mr,Ut,vr,_i,bc,Cn,Ao,Rn,_o,ve,be,xi,Ec,Hr,Si,Ac=class Ac{constructor(e){ae(this,bi);ae(this,Ro);ae(this,Ht);ae(this,Ut);ae(this,_i);ae(this,Cn);ae(this,Rn);ae(this,ve);ae(this,xi);ae(this,Hr);ae(this,Ct,void 0);ae(this,ft,void 0);ae(this,jt,void 0);ae(this,Rt,void 0);ae(this,_n,void 0);ne(this,"ttl");ne(this,"ttlResolution");ne(this,"ttlAutopurge");ne(this,"updateAgeOnGet");ne(this,"updateAgeOnHas");ne(this,"allowStale");ne(this,"noDisposeOnSet");ne(this,"noUpdateTTL");ne(this,"maxEntrySize");ne(this,"sizeCalculation");ne(this,"noDeleteOnFetchRejection");ne(this,"noDeleteOnStaleGet");ne(this,"allowStaleOnFetchAbort");ne(this,"allowStaleOnFetchRejection");ne(this,"ignoreFetchAbort");ae(this,Te,void 0);ae(this,Ot,void 0);ae(this,$e,void 0);ae(this,Se,void 0);ae(this,oe,void 0);ae(this,Je,void 0);ae(this,ht,void 0);ae(this,ze,void 0);ae(this,qe,void 0);ae(this,Pt,void 0);ae(this,Ue,void 0);ae(this,Yt,void 0);ae(this,Jt,void 0);ae(this,Tt,void 0);ae(this,Bt,void 0);ae(this,wr,void 0);ae(this,it,void 0);ae(this,jr,()=>{});ae(this,Xt,()=>{});ae(this,Ei,()=>{});ae(this,pt,()=>!1);ae(this,Br,e=>{});ae(this,xn,(e,r,n)=>{});ae(this,Ai,(e,r,n,s)=>{if(n||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});let{max:r=0,ttl:n,ttlResolution:s=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:l,allowStale:c,dispose:p,disposeAfter:u,noDisposeOnSet:g,noUpdateTTL:y,maxSize:m=0,maxEntrySize:v=0,sizeCalculation:b,fetchMethod:_,noDeleteOnFetchRejection:x,noDeleteOnStaleGet:A,allowStaleOnFetchRejection:O,allowStaleOnFetchAbort:I,ignoreFetchAbort:F}=e;if(r!==0&&!yr(r))throw new TypeError("max option must be a nonnegative integer");let U=r?a0(r):Array;if(!U)throw new Error("invalid max value: "+r);if(re(this,Ct,r),re(this,ft,m),this.maxEntrySize=v||S(this,ft),this.sizeCalculation=b,this.sizeCalculation){if(!S(this,ft)&&!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(_!==void 0&&typeof _!="function")throw new TypeError("fetchMethod must be a function if specified");if(re(this,_n,_),re(this,wr,!!_),re(this,$e,new Map),re(this,Se,new Array(r).fill(void 0)),re(this,oe,new Array(r).fill(void 0)),re(this,Je,new U(r)),re(this,ht,new U(r)),re(this,ze,0),re(this,qe,0),re(this,Pt,wc.create(r)),re(this,Te,0),re(this,Ot,0),typeof p=="function"&&re(this,jt,p),typeof u=="function"?(re(this,Rt,u),re(this,Ue,[])):(re(this,Rt,void 0),re(this,Ue,void 0)),re(this,Bt,!!S(this,jt)),re(this,it,!!S(this,Rt)),this.noDisposeOnSet=!!g,this.noUpdateTTL=!!y,this.noDeleteOnFetchRejection=!!x,this.allowStaleOnFetchRejection=!!O,this.allowStaleOnFetchAbort=!!I,this.ignoreFetchAbort=!!F,this.maxEntrySize!==0){if(S(this,ft)!==0&&!yr(S(this,ft)))throw new TypeError("maxSize must be a positive integer if specified");if(!yr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");ee(this,Ro,l0).call(this);}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!A,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!l,this.ttlResolution=yr(s)||s===0?s:1,this.ttlAutopurge=!!i,this.ttl=n||0,this.ttl){if(!yr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");ee(this,bi,Sc).call(this);}if(S(this,Ct)===0&&this.ttl===0&&S(this,ft)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!S(this,Ct)&&!S(this,ft)){let H="LRU_CACHE_UNBOUNDED";lq(H)&&(s0.add(H),o0("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",H,Ac));}}static unsafeExposeInternals(e){return {starts:S(e,Jt),ttls:S(e,Tt),sizes:S(e,Yt),keyMap:S(e,$e),keyList:S(e,Se),valList:S(e,oe),next:S(e,Je),prev:S(e,ht),get head(){return S(e,ze)},get tail(){return S(e,qe)},free:S(e,Pt),isBackgroundFetch:r=>{var n;return ee(n=e,ve,be).call(n,r)},backgroundFetch:(r,n,s,i)=>{var o;return ee(o=e,Rn,_o).call(o,r,n,s,i)},moveToTail:r=>{var n;return ee(n=e,Hr,Si).call(n,r)},indexes:r=>{var n;return ee(n=e,Ht,mr).call(n,r)},rindexes:r=>{var n;return ee(n=e,Ut,vr).call(n,r)},isStale:r=>{var n;return S(n=e,pt).call(n,r)}}}get max(){return S(this,Ct)}get maxSize(){return S(this,ft)}get calculatedSize(){return S(this,Ot)}get size(){return S(this,Te)}get fetchMethod(){return S(this,_n)}get dispose(){return S(this,jt)}get disposeAfter(){return S(this,Rt)}getRemainingTTL(e){return S(this,$e).has(e)?1/0:0}*entries(){for(let e of ee(this,Ht,mr).call(this))S(this,oe)[e]!==void 0&&S(this,Se)[e]!==void 0&&!ee(this,ve,be).call(this,S(this,oe)[e])&&(yield [S(this,Se)[e],S(this,oe)[e]]);}*rentries(){for(let e of ee(this,Ut,vr).call(this))S(this,oe)[e]!==void 0&&S(this,Se)[e]!==void 0&&!ee(this,ve,be).call(this,S(this,oe)[e])&&(yield [S(this,Se)[e],S(this,oe)[e]]);}*keys(){for(let e of ee(this,Ht,mr).call(this)){let r=S(this,Se)[e];r!==void 0&&!ee(this,ve,be).call(this,S(this,oe)[e])&&(yield r);}}*rkeys(){for(let e of ee(this,Ut,vr).call(this)){let r=S(this,Se)[e];r!==void 0&&!ee(this,ve,be).call(this,S(this,oe)[e])&&(yield r);}}*values(){for(let e of ee(this,Ht,mr).call(this))S(this,oe)[e]!==void 0&&!ee(this,ve,be).call(this,S(this,oe)[e])&&(yield S(this,oe)[e]);}*rvalues(){for(let e of ee(this,Ut,vr).call(this))S(this,oe)[e]!==void 0&&!ee(this,ve,be).call(this,S(this,oe)[e])&&(yield S(this,oe)[e]);}[Symbol.iterator](){return this.entries()}find(e,r={}){for(let n of ee(this,Ht,mr).call(this)){let s=S(this,oe)[n],i=ee(this,ve,be).call(this,s)?s.__staleWhileFetching:s;if(i!==void 0&&e(i,S(this,Se)[n],this))return this.get(S(this,Se)[n],r)}}forEach(e,r=this){for(let n of ee(this,Ht,mr).call(this)){let s=S(this,oe)[n],i=ee(this,ve,be).call(this,s)?s.__staleWhileFetching:s;i!==void 0&&e.call(r,i,S(this,Se)[n],this);}}rforEach(e,r=this){for(let n of ee(this,Ut,vr).call(this)){let s=S(this,oe)[n],i=ee(this,ve,be).call(this,s)?s.__staleWhileFetching:s;i!==void 0&&e.call(r,i,S(this,Se)[n],this);}}purgeStale(){let e=!1;for(let r of ee(this,Ut,vr).call(this,{allowStale:!0}))S(this,pt).call(this,r)&&(this.delete(S(this,Se)[r]),e=!0);return e}dump(){let e=[];for(let r of ee(this,Ht,mr).call(this,{allowStale:!0})){let n=S(this,Se)[r],s=S(this,oe)[r],i=ee(this,ve,be).call(this,s)?s.__staleWhileFetching:s;if(i===void 0||n===void 0)continue;let o={value:i};if(S(this,Tt)&&S(this,Jt)){o.ttl=S(this,Tt)[r];let l=wi.now()-S(this,Jt)[r];o.start=Math.floor(Date.now()-l);}S(this,Yt)&&(o.size=S(this,Yt)[r]),e.unshift([n,o]);}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let s=Date.now()-n.start;n.start=wi.now()-s;}this.set(r,n.value,n);}}set(e,r,n={}){var y,m;if(r===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:c}=n,{noUpdateTTL:p=this.noUpdateTTL}=n,u=S(this,Ai).call(this,e,r,n.size||0,l);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.delete(e),this;let g=S(this,Te)===0?void 0:S(this,$e).get(e);if(g===void 0)g=S(this,Te)===0?S(this,qe):S(this,Pt).length!==0?S(this,Pt).pop():S(this,Te)===S(this,Ct)?ee(this,Cn,Ao).call(this,!1):S(this,Te),S(this,Se)[g]=e,S(this,oe)[g]=r,S(this,$e).set(e,g),S(this,Je)[S(this,qe)]=g,S(this,ht)[g]=S(this,qe),re(this,qe,g),Di(this,Te)._++,S(this,xn).call(this,g,u,c),c&&(c.set="add"),p=!1;else {ee(this,Hr,Si).call(this,g);let v=S(this,oe)[g];if(r!==v){if(S(this,wr)&&ee(this,ve,be).call(this,v)?v.__abortController.abort(new Error("replaced")):o||(S(this,Bt)&&((y=S(this,jt))==null||y.call(this,v,e,"set")),S(this,it)&&S(this,Ue)?.push([v,e,"set"])),S(this,Br).call(this,g),S(this,xn).call(this,g,u,c),S(this,oe)[g]=r,c){c.set="replace";let b=v&&ee(this,ve,be).call(this,v)?v.__staleWhileFetching:v;b!==void 0&&(c.oldValue=b);}}else c&&(c.set="update");}if(s!==0&&!S(this,Tt)&&ee(this,bi,Sc).call(this),S(this,Tt)&&(p||S(this,Ei).call(this,g,s,i),c&&S(this,Xt).call(this,c,g)),!o&&S(this,it)&&S(this,Ue)){let v=S(this,Ue),b;for(;b=v?.shift();)(m=S(this,Rt))==null||m.call(this,...b);}return this}pop(){var e;try{for(;S(this,Te);){let r=S(this,oe)[S(this,ze)];if(ee(this,Cn,Ao).call(this,!0),ee(this,ve,be).call(this,r)){if(r.__staleWhileFetching)return r.__staleWhileFetching}else if(r!==void 0)return r}}finally{if(S(this,it)&&S(this,Ue)){let r=S(this,Ue),n;for(;n=r?.shift();)(e=S(this,Rt))==null||e.call(this,...n);}}}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:s}=r,i=S(this,$e).get(e);if(i!==void 0){let o=S(this,oe)[i];if(ee(this,ve,be).call(this,o)&&o.__staleWhileFetching===void 0)return !1;if(S(this,pt).call(this,i))s&&(s.has="stale",S(this,Xt).call(this,s,i));else return n&&S(this,jr).call(this,i),s&&(s.has="hit",S(this,Xt).call(this,s,i)),!0}else s&&(s.has="miss");return !1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,s=S(this,$e).get(e);if(s!==void 0&&(n||!S(this,pt).call(this,s))){let i=S(this,oe)[s];return ee(this,ve,be).call(this,i)?i.__staleWhileFetching:i}}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:c=0,sizeCalculation:p=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:g=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:y=this.allowStaleOnFetchRejection,ignoreFetchAbort:m=this.ignoreFetchAbort,allowStaleOnFetchAbort:v=this.allowStaleOnFetchAbort,context:b,forceRefresh:_=!1,status:x,signal:A}=r;if(!S(this,wr))return x&&(x.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:i,status:x});let O={allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:l,size:c,sizeCalculation:p,noUpdateTTL:u,noDeleteOnFetchRejection:g,allowStaleOnFetchRejection:y,allowStaleOnFetchAbort:v,ignoreFetchAbort:m,status:x,signal:A},I=S(this,$e).get(e);if(I===void 0){x&&(x.fetch="miss");let F=ee(this,Rn,_o).call(this,e,I,O,b);return F.__returned=F}else {let F=S(this,oe)[I];if(ee(this,ve,be).call(this,F)){let j=n&&F.__staleWhileFetching!==void 0;return x&&(x.fetch="inflight",j&&(x.returnedStale=!0)),j?F.__staleWhileFetching:F.__returned=F}let U=S(this,pt).call(this,I);if(!_&&!U)return x&&(x.fetch="hit"),ee(this,Hr,Si).call(this,I),s&&S(this,jr).call(this,I),x&&S(this,Xt).call(this,x,I),F;let H=ee(this,Rn,_o).call(this,e,I,O,b),k=H.__staleWhileFetching!==void 0&&n;return x&&(x.fetch=U?"stale":"refresh",k&&U&&(x.returnedStale=!0)),k?H.__staleWhileFetching:H.__returned=H}}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=r,l=S(this,$e).get(e);if(l!==void 0){let c=S(this,oe)[l],p=ee(this,ve,be).call(this,c);return o&&S(this,Xt).call(this,o,l),S(this,pt).call(this,l)?(o&&(o.get="stale"),p?(o&&n&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?c.__staleWhileFetching:void 0):(i||this.delete(e),o&&n&&(o.returnedStale=!0),n?c:void 0)):(o&&(o.get="hit"),p?c.__staleWhileFetching:(ee(this,Hr,Si).call(this,l),s&&S(this,jr).call(this,l),c))}else o&&(o.get="miss");}delete(e){var n,s;let r=!1;if(S(this,Te)!==0){let i=S(this,$e).get(e);if(i!==void 0)if(r=!0,S(this,Te)===1)this.clear();else {S(this,Br).call(this,i);let o=S(this,oe)[i];ee(this,ve,be).call(this,o)?o.__abortController.abort(new Error("deleted")):(S(this,Bt)||S(this,it))&&(S(this,Bt)&&((n=S(this,jt))==null||n.call(this,o,e,"delete")),S(this,it)&&S(this,Ue)?.push([o,e,"delete"])),S(this,$e).delete(e),S(this,Se)[i]=void 0,S(this,oe)[i]=void 0,i===S(this,qe)?re(this,qe,S(this,ht)[i]):i===S(this,ze)?re(this,ze,S(this,Je)[i]):(S(this,Je)[S(this,ht)[i]]=S(this,Je)[i],S(this,ht)[S(this,Je)[i]]=S(this,ht)[i]),Di(this,Te)._--,S(this,Pt).push(i);}}if(S(this,it)&&S(this,Ue)?.length){let i=S(this,Ue),o;for(;o=i?.shift();)(s=S(this,Rt))==null||s.call(this,...o);}return r}clear(){var e,r;for(let n of ee(this,Ut,vr).call(this,{allowStale:!0})){let s=S(this,oe)[n];if(ee(this,ve,be).call(this,s))s.__abortController.abort(new Error("deleted"));else {let i=S(this,Se)[n];S(this,Bt)&&((e=S(this,jt))==null||e.call(this,s,i,"delete")),S(this,it)&&S(this,Ue)?.push([s,i,"delete"]);}}if(S(this,$e).clear(),S(this,oe).fill(void 0),S(this,Se).fill(void 0),S(this,Tt)&&S(this,Jt)&&(S(this,Tt).fill(0),S(this,Jt).fill(0)),S(this,Yt)&&S(this,Yt).fill(0),re(this,ze,0),re(this,qe,0),S(this,Pt).length=0,re(this,Ot,0),re(this,Te,0),S(this,it)&&S(this,Ue)){let n=S(this,Ue),s;for(;s=n?.shift();)(r=S(this,Rt))==null||r.call(this,...s);}}};Ct=new WeakMap,ft=new WeakMap,jt=new WeakMap,Rt=new WeakMap,_n=new WeakMap,Te=new WeakMap,Ot=new WeakMap,$e=new WeakMap,Se=new WeakMap,oe=new WeakMap,Je=new WeakMap,ht=new WeakMap,ze=new WeakMap,qe=new WeakMap,Pt=new WeakMap,Ue=new WeakMap,Yt=new WeakMap,Jt=new WeakMap,Tt=new WeakMap,Bt=new WeakMap,wr=new WeakMap,it=new WeakMap,bi=new WeakSet,Sc=function(){let e=new En(S(this,Ct)),r=new En(S(this,Ct));re(this,Tt,e),re(this,Jt,r),re(this,Ei,(i,o,l=wi.now())=>{if(r[i]=o!==0?l:0,e[i]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{S(this,pt).call(this,i)&&this.delete(S(this,Se)[i]);},o+1);c.unref&&c.unref();}}),re(this,jr,i=>{r[i]=e[i]!==0?wi.now():0;}),re(this,Xt,(i,o)=>{if(e[o]){let l=e[o],c=r[o];i.ttl=l,i.start=c,i.now=n||s();let p=i.now-c;i.remainingTTL=l-p;}});let n=0,s=()=>{let i=wi.now();if(this.ttlResolution>0){n=i;let o=setTimeout(()=>n=0,this.ttlResolution);o.unref&&o.unref();}return i};this.getRemainingTTL=i=>{let o=S(this,$e).get(i);if(o===void 0)return 0;let l=e[o],c=r[o];if(l===0||c===0)return 1/0;let p=(n||s())-c;return l-p},re(this,pt,i=>e[i]!==0&&r[i]!==0&&(n||s())-r[i]>e[i]);},jr=new WeakMap,Xt=new WeakMap,Ei=new WeakMap,pt=new WeakMap,Ro=new WeakSet,l0=function(){let e=new En(S(this,Ct));re(this,Ot,0),re(this,Yt,e),re(this,Br,r=>{re(this,Ot,S(this,Ot)-e[r]),e[r]=0;}),re(this,Ai,(r,n,s,i)=>{if(ee(this,ve,be).call(this,n))return 0;if(!yr(s))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(s=i(n,r),!yr(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}),re(this,xn,(r,n,s)=>{if(e[r]=n,S(this,ft)){let i=S(this,ft)-e[r];for(;S(this,Ot)>i;)ee(this,Cn,Ao).call(this,!0);}re(this,Ot,S(this,Ot)+e[r]),s&&(s.entrySize=n,s.totalCalculatedSize=S(this,Ot));});},Br=new WeakMap,xn=new WeakMap,Ai=new WeakMap,Ht=new WeakSet,mr=function*({allowStale:e=this.allowStale}={}){if(S(this,Te))for(let r=S(this,qe);!(!ee(this,_i,bc).call(this,r)||((e||!S(this,pt).call(this,r))&&(yield r),r===S(this,ze)));)r=S(this,ht)[r];},Ut=new WeakSet,vr=function*({allowStale:e=this.allowStale}={}){if(S(this,Te))for(let r=S(this,ze);!(!ee(this,_i,bc).call(this,r)||((e||!S(this,pt).call(this,r))&&(yield r),r===S(this,qe)));)r=S(this,Je)[r];},_i=new WeakSet,bc=function(e){return e!==void 0&&S(this,$e).get(S(this,Se)[e])===e},Cn=new WeakSet,Ao=function(e){var i;let r=S(this,ze),n=S(this,Se)[r],s=S(this,oe)[r];return S(this,wr)&&ee(this,ve,be).call(this,s)?s.__abortController.abort(new Error("evicted")):(S(this,Bt)||S(this,it))&&(S(this,Bt)&&((i=S(this,jt))==null||i.call(this,s,n,"evict")),S(this,it)&&S(this,Ue)?.push([s,n,"evict"])),S(this,Br).call(this,r),e&&(S(this,Se)[r]=void 0,S(this,oe)[r]=void 0,S(this,Pt).push(r)),S(this,Te)===1?(re(this,ze,re(this,qe,0)),S(this,Pt).length=0):re(this,ze,S(this,Je)[r]),S(this,$e).delete(n),Di(this,Te)._--,r},Rn=new WeakSet,_o=function(e,r,n,s){let i=r===void 0?void 0:S(this,oe)[r];if(ee(this,ve,be).call(this,i))return i;let o=new xo,{signal:l}=n;l?.addEventListener("abort",()=>o.abort(l.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:s},p=(b,_=!1)=>{let{aborted:x}=o.signal,A=n.ignoreFetchAbort&&b!==void 0;if(n.status&&(x&&!_?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,A&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),x&&!A&&!_)return g(o.signal.reason);let O=m;return S(this,oe)[r]===m&&(b===void 0?O.__staleWhileFetching?S(this,oe)[r]=O.__staleWhileFetching:this.delete(e):(n.status&&(n.status.fetchUpdated=!0),this.set(e,b,c.options))),b},u=b=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=b),g(b)),g=b=>{let{aborted:_}=o.signal,x=_&&n.allowStaleOnFetchAbort,A=x||n.allowStaleOnFetchRejection,O=A||n.noDeleteOnFetchRejection,I=m;if(S(this,oe)[r]===m&&(!O||I.__staleWhileFetching===void 0?this.delete(e):x||(S(this,oe)[r]=I.__staleWhileFetching)),A)return n.status&&I.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),I.__staleWhileFetching;if(I.__returned===I)throw b},y=(b,_)=>{var A;let x=(A=S(this,_n))==null?void 0:A.call(this,e,i,c);x&&x instanceof Promise&&x.then(O=>b(O),_),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(b(),n.allowStaleOnFetchAbort&&(b=O=>p(O,!0)));});};n.status&&(n.status.fetchDispatched=!0);let m=new Promise(y).then(p,u),v=Object.assign(m,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return r===void 0?(this.set(e,v,{...c.options,status:void 0}),r=S(this,$e).get(e)):S(this,oe)[r]=v,v},ve=new WeakSet,be=function(e){if(!S(this,wr))return !1;let r=e;return !!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof xo},xi=new WeakSet,Ec=function(e,r){S(this,ht)[r]=e,S(this,Je)[e]=r;},Hr=new WeakSet,Si=function(e){e!==S(this,qe)&&(e===S(this,ze)?re(this,ze,S(this,Je)[e]):ee(this,xi,Ec).call(this,S(this,ht)[e],S(this,Je)[e]),ee(this,xi,Ec).call(this,S(this,qe),e),re(this,qe,e));};var Co=Ac;var g0=Nn(d0());function cq(t){return t.trimEnd().split("").every(e=>ws.includes(e))}var Sr=class{constructor(e){this.filepath=e.filepath,this.language=e.language,this.text=e.text,this.position=e.position,this.prefix=e.text.slice(0,e.position),this.suffix=e.text.slice(e.position),this.prefixLines=Pe(this.prefix),this.suffixLines=Pe(this.suffix);let r=cq(this.suffixLines[0]??"");this.mode=r?"default":"fill-in-line",this.hash=(0, g0.default)({filepath:e.filepath,language:e.language,text:e.text,position:e.position});}};var y0=["statusChanged","configUpdated","authRequired","issuesUpdated"];Nt();var Oo=class{constructor(){this.logger=Ce.child({component:"CompletionCache"});this.options={maxCount:1e4,prebuildCache:{enabled:!0,perCharacter:{lines:1,max:50},perLine:{max:10},autoClosingPairCheck:{max:3}}};this.cache=new Co({max:this.options.maxCount});}has(e){return this.cache.has(e.hash)}buildCache(e,r){this.logger.debug({key:e,value:r},"Starting to build cache");let n=this.createCacheEntries(e,r);n.forEach(s=>{this.cache.set(s.key.hash,{value:s.value,rebuildFlag:s.rebuildFlag});}),this.logger.debug({newEntries:n.length,cacheSize:this.cache.size},"Cache updated");}get(e){let r=this.cache.get(e.hash);return r?.rebuildFlag&&this.buildCache(e,r?.value),r?.value}createCacheEntries(e,r){let n=[{key:e,value:r,rebuildFlag:!1}];if(this.options.prebuildCache.enabled)for(let i of r.choices){let o=i.text.slice(e.position-i.replaceRange.start),l=this.getPerLinePositions(o);this.logger.trace({completionText:o,perLinePositions:l},"Calculate per-line cache positions");for(let p of l){let u=o.slice(0,p),g=this.generateAutoClosedPrefixes(u);for(let y of [u,...g]){let m={key:new Sr({...e,text:e.text.slice(0,e.position)+y+e.text.slice(e.position),position:e.position+p}),value:{...r,choices:[{index:i.index,text:o.slice(p),replaceRange:{start:e.position+p,end:e.position+p}}]},rebuildFlag:!0};this.logger.trace({prefix:y,entry:m},"Build per-line cache entry"),n.push(m);}}let c=this.getPerCharacterPositions(o);this.logger.trace({completionText:o,perCharacterPositions:c},"Calculate per-character cache positions");for(let p of c){let u=p;for(;u>0&&o[u-1]!==` +`;)u--;let g=o.slice(0,p),y=this.generateAutoClosedPrefixes(g);for(let m of [g,...y]){let v={key:new Sr({...e,text:e.text.slice(0,e.position)+m+e.text.slice(e.position),position:e.position+p}),value:{...r,choices:[{index:i.index,text:o.slice(u),replaceRange:{start:e.position+u,end:e.position+p}}]},rebuildFlag:!1};this.logger.trace({prefix:m,entry:v},"Build per-character cache entry"),n.push(v);}}}return n.reduce((i,o)=>{let l=i.find(c=>c.key.hash===o.key.hash);return l?(l.value.choices.push(...o.value.choices),l.rebuildFlag=l.rebuildFlag||o.rebuildFlag):i.push(o),i},[])}getPerLinePositions(e){let r=[],n=this.options.prebuildCache,s=Pe(e),i=0,o=0;for(;is;s++){let o=Fg.indexOf(n[n.length-1-s]);if(o<0)break;i=i+ws[o],r.push(e+i);}return r}};Nt();function Cc(t,e,r){return Math.max(t,Math.min(e,r))}var Po=class{constructor(){this.logger=Ce.child({component:"CompletionDebounce"});this.lastCalledTimeStamp=0;this.baseInterval=200;this.calledIntervalHistory=[];this.options={baseIntervalSlideWindowAvg:{minSize:20,maxSize:100,min:100,max:400},adaptiveRate:{min:1.5,max:3},contextScoreWeights:{triggerCharacter:.5,noSuffixInCurrentLine:.4,noSuffix:.1},requestDelay:{min:100,max:1e3}};}async debounce(e,r){let{request:n,config:s,responseTime:i}=e;if(n.manually)return this.sleep(0,r);if(s.mode==="fixed")return this.sleep(s.interval,r);let o=Date.now();this.updateBaseInterval(o-this.lastCalledTimeStamp),this.lastCalledTimeStamp=o;let l=this.calcContextScore(n),p=(this.options.adaptiveRate.max-(this.options.adaptiveRate.max-this.options.adaptiveRate.min)*l)*this.baseInterval,u=Cc(this.options.requestDelay.min,this.options.requestDelay.max,p-i);return this.sleep(u,r)}async sleep(e,r){return new Promise((n,s)=>{let i=setTimeout(n,Math.min(e,2147483647));r?.signal&&(r.signal.aborted?(clearTimeout(i),s(r.signal.reason)):r.signal.addEventListener("abort",()=>{clearTimeout(i),s(r.signal.reason);}));})}updateBaseInterval(e){if(!(e>this.options.baseIntervalSlideWindowAvg.max)&&(this.calledIntervalHistory.push(e),this.calledIntervalHistory.length>this.options.baseIntervalSlideWindowAvg.maxSize&&this.calledIntervalHistory.shift(),this.calledIntervalHistory.length>this.options.baseIntervalSlideWindowAvg.minSize)){let r=this.calledIntervalHistory.reduce((n,s)=>n+s,0)/this.calledIntervalHistory.length;this.baseInterval=Cc(this.options.baseIntervalSlideWindowAvg.min,this.options.baseIntervalSlideWindowAvg.max,r);}}calcContextScore(e){let r=0,n=this.options.contextScoreWeights,s=e.text[e.position-1]??"";r+=s.match(/^\W*$/)?n.triggerCharacter:0;let i=e.text.slice(e.position)??"",o=Pe(i)[0]??"";return r+=o.match(/^\W*$/)?n.noSuffixInCurrentLine:0,r+=i.match(/^\W*$/)?n.noSuffix:0,r=Cc(0,1,r),r}};Nt();var $t=Ce.child({component:"Postprocess"});Array.prototype.distinct||(Array.prototype.distinct=function(t){return [...new Map(this.map(e=>[t?.(e)??e,e])).values()]});function It(t,e){return async r=>(r.choices=(await Promise.all(r.choices.map(async n=>{let s=e.position-n.replaceRange.start,i=await t(n.text.slice(s));return n.text=n.text.slice(0,s)+(i??""),n}))).filter(n=>!!n.text).distinct(n=>n.text),r)}function fq(t){return /\n(\s*)\n/g}var m0=t=>e=>{let r=e.split(fq()),n=0,s=2,i=r.length-2;for(;i>=1;){if(ge(r[i])){i--;continue}let o=i-1;for(;o>=0&&ge(r[o]);)o--;if(o<0)break;let l=r[i].trim(),c=r[o].trim(),p=Math.max(.1*l.length,.1*c.length);if(on(l,c)<=p)n++,i--;else break}return n>=s?($t.debug({inputBlocks:r,repetitionCount:n},"Remove repetitive blocks."),r.slice(0,i+1).join("").trimEnd()):e};var v0=()=>t=>{let e=Pe(t),r=0,n=5,s=e.length-2;for(;s>=1;){if(ge(e[s])){s--;continue}let i=s-1;for(;i>=0&&ge(e[i]);)i--;if(i<0)break;let o=e[s].trim(),l=e[i].trim(),c=Math.max(.1*o.length,.1*l.length);if(on(o,l)<=c)r++,s=i;else break}return r>=n?($t.debug({inputLines:e,repetitionCount:r},"Remove repetitive lines."),e.slice(0,s+1).join("").trimEnd()):t};var hq=[/(.{3,}?)\1{5,}$/g,/(.{10,}?)\1{3,}$/g],w0=()=>t=>{let e=Pe(t),r=e.length-1;for(;r>=0&&ge(e[r]);)r--;if(r<0)return t;for(let n of hq){let s=e[r].match(n);if(s)return $t.debug({inputLines:e,lineNumber:r,match:s},"Remove line ends with repetition."),r<1?null:e.slice(0,r).join("").trimEnd()}return t};function br(t){return t.match(/^[ \t]*/)?.[0]?.length??0}function pq(t,e){return e>=t.length-1?!1:br(t[e])n};if(t.length==0||e.length==0)return s;let i=e[e.length-1],o=ge(i),l=e.length-1;for(;l>=0&&ge(e[l]);)l--;if(l<0)return s;let c=e[l],p=br(c),u=t[0],g=ge(u),y=0;for(;y=t.length)return s;let m=t[y],v;g?v=br(m):v=br(i+m),!g&&!o?(s.indentLevelLimit=p+1,n=!!t[1]&&br(t[1])>p):v>p?(s.indentLevelLimit=p+1,n=!0):(s.indentLevelLimit=p,n=!0);let b=1;for(;b{let x=_.startsWith(r[b])||r[b].startsWith(_);return n&&!x}),s}var S0=t=>e=>{let{prefix:r,suffix:n,prefixLines:s,suffixLines:i}=t,o=Pe(e);if(t.mode==="fill-in-line"&&o.length>1)return $t.debug({input:e,prefix:r,suffix:n},"Drop content with multiple lines"),null;let l=dq(o,s,i),c;for(c=1;ce=>{let {prefixLines:r,suffixLines:n}=t;Pe(e);let i=e,o=r[r.length-1]??"",l=n[0]??"";return !ge(o)&&o.match(/\s$/)&&(i=i.trimStart()),(ge(l)||!ge(l)&&l.match(/^\s/))&&(i=i.trimEnd()),i};var Oc=t=>e=>{let{suffixLines:r}=t,n=Pe(e),s=0;for(;st=>ge(t)?null:t;async function b0(t,e){return Promise.resolve(e).then(It(w0(),t)).then(It(Oc(t),t)).then(It(Rc(t),t)).then(It(Pc(),t))}async function E0(t,e){return Promise.resolve(e).then(It(m0(),t)).then(It(v0(),t)).then(It(S0(t),t)).then(It(Oc(t),t)).then(It(Rc(t),t)).then(It(Pc(),t))}Nt();var _0="tabby-agent",x0="1.0.0";Jn();Nt();var To=class t{constructor(){this.anonymousUsageTrackingApi=Or({baseUrl:"https://app.tabbyml.com/api"});this.logger=Ce.child({component:"AnonymousUsage"});this.systemData={agent:`${_0}, ${x0}`,browser:void 0,node:`${process.version} ${process.platform} ${z("os").arch()} ${z("os").release()}`};this.sessionProperties={};this.userProperties={};this.userPropertiesUpdated=!1;this.emittedUniqueEvent=[];this.dataStore=null;}static async create(e){let r=new t;return r.dataStore=e.dataStore||Fs,await r.checkAnonymousId(),r}async checkAnonymousId(){if(this.dataStore){try{await this.dataStore.load();}catch(e){this.logger.debug({error:e},"Error when loading anonymousId");}if(typeof this.dataStore.data.anonymousId=="string")this.anonymousId=this.dataStore.data.anonymousId;else {this.anonymousId=Ar(),this.dataStore.data.anonymousId=this.anonymousId;try{await this.dataStore.save();}catch(e){this.logger.debug({error:e},"Error when saving anonymousId");}}}else this.anonymousId=Ar();}setSessionProperties(e,r){sn(this.sessionProperties,e,r);}setUserProperties(e,r){sn(this.userProperties,e,r),this.userPropertiesUpdated=!0;}async uniqueEvent(e,r={}){await this.event(e,r,!0);}async event(e,r={},n=!1){if(this.disabled||n&&this.emittedUniqueEvent.indexOf(e)>=0)return;n&&this.emittedUniqueEvent.push(e);let s={...this.systemData,...this.sessionProperties,...r};this.userPropertiesUpdated&&(s.$set=this.userProperties,this.userPropertiesUpdated=!1);try{await this.anonymousUsageTrackingApi.POST("/usage",{body:{distinctId:this.anonymousId,event:e,properties:s}});}catch(i){this.logger.error({error:i},"Error when sending anonymous usage data");}}};var kc=Nn(P0());Nt();var $o=class{constructor(){this.sum=0;this.quantity=0;}add(e){this.sum+=e,this.quantity+=1;}mean(){if(this.quantity!==0)return this.sum/this.quantity}count(){return this.quantity}},Io=class{constructor(e){this.values=[];this.maxSize=e;}add(e){this.values.push(e),this.values.length>this.maxSize&&this.values.shift();}getValues(){return this.values}},Ti=class{constructor(){this.logger=Ce.child({component:"CompletionProviderStats"});this.autoCompletionCount=0;this.manualCompletionCount=0;this.cacheHitCount=0;this.cacheMissCount=0;this.eventMap=new Map;this.completionRequestLatencyStats=new kc.Univariate;this.completionRequestCanceledStats=new $o;this.completionRequestTimeoutCount=0;this.recentCompletionRequestLatencies=new Io(10);}add(e){let{triggerMode:r,cacheHit:n,aborted:s,requestSent:i,requestLatency:o,requestCanceled:l,requestTimeout:c}=e;s||(r==="auto"?this.autoCompletionCount+=1:this.manualCompletionCount+=1,n?this.cacheHitCount+=1:this.cacheMissCount+=1),i&&(l?this.completionRequestCanceledStats.add(o):c?this.completionRequestTimeoutCount+=1:this.completionRequestLatencyStats.add(o),l||this.recentCompletionRequestLatencies.add(o));}addEvent(e){let r=this.eventMap.get(e)||0;this.eventMap.set(e,r+1);}reset(){this.autoCompletionCount=0,this.manualCompletionCount=0,this.cacheHitCount=0,this.cacheMissCount=0,this.eventMap=new Map,this.completionRequestLatencyStats=new kc.Univariate,this.completionRequestCanceledStats=new $o,this.completionRequestTimeoutCount=0;}resetWindowed(){this.recentCompletionRequestLatencies=new Io(10);}stats(){let e=Object.fromEntries(Array.from(this.eventMap.entries()).map(([r,n])=>["count_"+r,n]));return {completion:{count_auto:this.autoCompletionCount,count_manual:this.manualCompletionCount,cache_hit:this.cacheHitCount,cache_miss:this.cacheMissCount,...e},completion_request:{count:this.completionRequestLatencyStats.count(),latency_avg:this.completionRequestLatencyStats.mean(),latency_p50:this.completionRequestLatencyStats.percentile(50),latency_p95:this.completionRequestLatencyStats.percentile(95),latency_p99:this.completionRequestLatencyStats.percentile(99)},completion_request_canceled:{count:this.completionRequestCanceledStats.count(),latency_avg:this.completionRequestCanceledStats.mean()},completion_request_timeout:{count:this.completionRequestTimeoutCount}}}windowed(){let e=this.recentCompletionRequestLatencies.getValues(),r=e.filter(i=>Number.isNaN(i)),n=e.filter(i=>!Number.isNaN(i)),s=n.reduce((i,o)=>i+o,0)/n.length;return {values:e,stats:{total:e.length,timeouts:r.length,responses:n.length,averageResponseTime:s}}}static check(e){let{values:r,stats:{total:n,timeouts:s,responses:i,averageResponseTime:o}}=e;return r.slice(-3).every(l=>l<3e3)?"healthy":s/n>.5&&s>=3?"highTimeoutRate":i>=3&&o>4e3?"slowResponseTime":null}};var Wr=class Wr extends events.EventEmitter{constructor(){super();this.logger=Ce.child({component:"TabbyAgent"});this.config=mc;this.userConfig={};this.clientConfig={};this.status="notInitialized";this.issues=[];this.serverHealthState=null;this.dataStore=null;this.completionCache=new Oo;this.completionDebounce=new Po;this.nonParallelProvideCompletionAbortController=null;this.completionProviderStats=new Ti;this.tryingConnectTimer=null;this.submitStatsTimer=null;this.tryingConnectTimer=setInterval(async()=>{this.status==="disconnected"&&(this.logger.debug("Trying to connect..."),await this.healthCheck());},Wr.tryConnectInterval),this.submitStatsTimer=setInterval(async()=>{await this.submitStats();},Wr.submitStatsInterval);}static async create(r){let n=new Wr;return n.dataStore=r?.dataStore,n.anonymousUsageLogger=await To.create({dataStore:r?.dataStore}),n}async applyConfig(){let r=this.config,n=this.status;this.config=_g(mc,this.userConfig,this.clientConfig),gn.forEach(i=>i.level=this.config.logs.level),this.anonymousUsageLogger.disabled=this.config.anonymousUsageTracking.disable,this.config.server.requestHeaders.Authorization===void 0?this.config.server.endpoint!==this.auth?.endpoint&&(this.auth=await ro.create({endpoint:this.config.server.endpoint,dataStore:this.dataStore}),this.auth.on("updated",this.setupApi.bind(this))):this.auth=null,await this.setupApi(),(0, Lc.default)(r.server,this.config.server)||(this.serverHealthState=null,this.completionProviderStats.resetWindowed(),this.popIssue("slowCompletionResponseTime"),this.popIssue("highCompletionTimeoutRate"),n==="unauthorized"&&this.status==="unauthorized"&&this.emitAuthRequired());let s={event:"configUpdated",config:this.config};this.logger.debug({event:s},"Config updated"),super.emit("configUpdated",s);}async setupApi(){this.api=Or({baseUrl:this.config.server.endpoint.replace(/\/+$/,""),headers:{Authorization:this.auth?.token?`Bearer ${this.auth.token}`:void 0,...this.config.server.requestHeaders}}),await this.healthCheck();}changeStatus(r){if(this.status!=r){this.status=r;let n={event:"statusChanged",status:r};this.logger.debug({event:n},"Status changed"),super.emit("statusChanged",n),this.status==="unauthorized"&&this.emitAuthRequired();}}issueFromName(r){switch(r){case"highCompletionTimeoutRate":return {name:"highCompletionTimeoutRate",completionResponseStats:this.completionProviderStats.windowed().stats};case"slowCompletionResponseTime":return {name:"slowCompletionResponseTime",completionResponseStats:this.completionProviderStats.windowed().stats}}}pushIssue(r){this.issues.indexOf(r)===-1&&(this.issues.push(r),this.logger.debug({issue:r},"Issues Pushed"),this.emitIssueUpdated());}popIssue(r){let n=this.issues.indexOf(r);n>=0&&(this.issues.splice(n,1),this.logger.debug({issue:r},"Issues Popped"),this.emitIssueUpdated());}emitAuthRequired(){let r={event:"authRequired",server:this.config.server};super.emit("authRequired",r);}emitIssueUpdated(){let r={event:"issuesUpdated",issues:this.issues};super.emit("issuesUpdated",r);}async submitStats(){let r=this.completionProviderStats.stats();r.completion_request.count>0&&(await this.anonymousUsageLogger.event("AgentStats",{stats:r}),this.completionProviderStats.reset(),this.logger.debug({stats:r},"Stats submitted"));}async post(r,n,s){let i=Ar();this.logger.debug({requestId:i,path:r,requestOptions:n,abortOptions:s},"API request");try{let o=Math.min(2147483647,s?.timeout||this.config.server.requestTimeout),l=Yn([AbortSignal.timeout(o),s?.signal]),c=await this.api.POST(r,{...n,signal:l});if(c.error)throw new at(c.response);return this.logger.debug({requestId:i,path:r,response:c.data},"API response"),this.changeStatus("ready"),c.data}catch(o){throw bs(o)?this.logger.debug({requestId:i,path:r,error:o},"API request timeout"):an(o)?this.logger.debug({requestId:i,path:r,error:o},"API request canceled"):o instanceof at&&[401,403,405].indexOf(o.status)!==-1&&new URL(this.config.server.endpoint).hostname.endsWith("app.tabbyml.com")&&this.config.server.requestHeaders.Authorization===void 0?(this.logger.debug({requestId:i,path:r,error:o},"API unauthorized"),this.changeStatus("unauthorized")):o instanceof at?(this.logger.error({requestId:i,path:r,error:o},"API error"),this.changeStatus("disconnected")):(this.logger.error({requestId:i,path:r,error:o},"API request failed with unknown error"),this.changeStatus("disconnected")),o}}async healthCheck(r){try{let n=await this.post("/v1/health",{},r);typeof n=="object"&&n.model!==void 0&&n.device!==void 0&&(this.serverHealthState=n,this.status==="ready"&&this.anonymousUsageLogger.uniqueEvent("AgentConnected",n));}catch{this.changeStatus("disconnected"),this.serverHealthState=null;}}createSegments(r){let n=this.config.completion.prompt.maxPrefixLines,s=this.config.completion.prompt.maxSuffixLines,{prefixLines:i,suffixLines:o}=r;return {prefix:i.slice(Math.max(i.length-n,0)).join(""),suffix:o.slice(0,s).join("")}}calculateReplaceRange(r,n){let{suffixLines:s}=n,i=s[0]?.trimEnd()||"";if(ge(i))return r;for(let o of r.choices){let l=o.text.slice(n.position-o.replaceRange.start),c=Ss(l);ge(c)||(i.startsWith(c)?(o.replaceRange.end=n.position+c.length,this.logger.trace({context:n,completion:o.text,range:o.replaceRange,unpaired:c},"Adjust replace range")):c.startsWith(i)&&(o.replaceRange.end=n.position+i.length,this.logger.trace({context:n,completion:o.text,range:o.replaceRange,unpaired:c},"Adjust replace range")));}return r}async initialize(r){if(r.clientProperties){let{user:n,session:s}=r.clientProperties;gn.forEach(i=>i.setBindings?.({...s})),s&&Object.entries(s).forEach(([i,o])=>{this.anonymousUsageLogger.setSessionProperties(i,o);}),n&&Object.entries(n).forEach(([i,o])=>{this.anonymousUsageLogger.setUserProperties(i,o);});}return bn&&(await bn.load(),this.userConfig=bn.config,bn.on("updated",async n=>{this.userConfig=n,await this.applyConfig();}),bn.watch()),r.config&&(this.clientConfig=r.config),await this.applyConfig(),await this.anonymousUsageLogger.uniqueEvent("AgentInitialized"),this.logger.debug({options:r},"Initialized"),this.status!=="notInitialized"}async finalize(){return this.status==="finalized"?!1:(await this.submitStats(),this.tryingConnectTimer&&(clearInterval(this.tryingConnectTimer),this.tryingConnectTimer=null),this.submitStatsTimer&&(clearInterval(this.submitStatsTimer),this.submitStatsTimer=null),this.changeStatus("finalized"),!0)}async updateClientProperties(r,n,s){switch(r){case"session":let i={};sn(i,n,s),gn.forEach(o=>o.setBindings?.(i)),this.anonymousUsageLogger.setSessionProperties(n,s);break;case"user":this.anonymousUsageLogger.setUserProperties(n,s);break}return !0}async updateConfig(r,n){let s=Og(this.clientConfig,r);return (0, Lc.default)(s,n)||(n===void 0?Pg(this.clientConfig,r):sn(this.clientConfig,r,n),await this.applyConfig()),!0}async clearConfig(r){return await this.updateConfig(r,void 0)}getConfig(){return this.config}getStatus(){return this.status}getIssues(){return this.issues}getIssueDetail(r){return r.index!==void 0?this.issueFromName(this.issues[r.index]):r.name!==void 0&&this.issues.indexOf(r.name)!==-1?this.issueFromName(r.name):null}getServerHealthState(){return this.serverHealthState}async requestAuthUrl(r){if(this.status==="notInitialized")throw new Error("Agent is not initialized");return await this.healthCheck(r),this.status!=="unauthorized"?null:await this.auth.requestAuthUrl(r)}async waitForAuthToken(r,n){if(this.status==="notInitialized")throw new Error("Agent is not initialized");await this.auth.pollingToken(r,n),await this.setupApi();}async provideCompletions(r,n){if(this.status==="notInitialized")throw new Error("Agent is not initialized");this.logger.trace({request:r},"Call provideCompletions"),this.nonParallelProvideCompletionAbortController&&this.nonParallelProvideCompletionAbortController.abort(),this.nonParallelProvideCompletionAbortController=new AbortController;let s=Yn([this.nonParallelProvideCompletionAbortController.signal,n?.signal]),i=null,o={triggerMode:r.manually?"manual":"auto",cacheHit:!1,aborted:!1,requestSent:!1,requestLatency:0,requestCanceled:!1,requestTimeout:!1},l=null,c=new Sr(r);try{if(this.completionCache.has(c))o.cacheHit=!0,this.logger.debug({context:c},"Completion cache hit"),await this.completionDebounce.debounce({request:r,config:this.config.completion.debounce,responseTime:0},{signal:s}),i=this.completionCache.get(c);else {o.cacheHit=!1;let p=this.createSegments(c);if(ge(p.prefix))o=null,this.logger.debug("Segment prefix is blank, returning empty completion response"),i={id:"agent-"+Ar(),choices:[]};else {await this.completionDebounce.debounce({request:r,config:this.config.completion.debounce,responseTime:this.completionProviderStats.stats().averageResponseTime},n),o.requestSent=!0,l=performance.now();try{let u=await this.post("/v1/completions",{body:{language:r.language,segments:p,user:this.auth?.user}},{signal:s,timeout:r.manually?this.config.completion.timeout.manually:this.config.completion.timeout.auto});o.requestLatency=performance.now()-l,i={id:u.id,choices:u.choices.map(g=>({index:g.index,text:g.text,replaceRange:{start:r.position,end:r.position}}))};}catch(u){throw an(u)&&(o.requestCanceled=!0,o.requestLatency=performance.now()-l),bs(u)&&(o.requestTimeout=!0,o.requestLatency=NaN),u}if(i=await b0(c,i),n?.signal?.aborted)throw n.signal.reason;this.completionCache.buildCache(c,i);}}if(i=await E0(c,i),n?.signal?.aborted)throw n.signal.reason;i=this.calculateReplaceRange(i,c);}catch(p){throw an(p)||bs(p)?o&&(o.aborted=!0):o=null,p}finally{if(o&&(this.completionProviderStats.add(o),o.requestSent&&!o.requestCanceled)){let p=this.completionProviderStats.windowed();switch(Ti.check(p)){case"healthy":this.popIssue("slowCompletionResponseTime"),this.popIssue("highCompletionTimeoutRate");break;case"highTimeoutRate":this.popIssue("slowCompletionResponseTime"),this.pushIssue("highCompletionTimeoutRate");break;case"slowResponseTime":this.popIssue("highCompletionTimeoutRate"),this.pushIssue("slowCompletionResponseTime");break}}}return this.logger.trace({context:c,completionResponse:i},"Return from provideCompletions"),i}async postEvent(r,n){if(this.status==="notInitialized")throw new Error("Agent is not initialized");return this.completionProviderStats.addEvent(r.type),await this.post("/v1/events",{body:r,params:{query:{select_kind:r.select_kind}},parseAs:"text"},n),!0}};Wr.tryConnectInterval=1e3*30,Wr.submitStatsInterval=1e3*60*60*24;var ko=Wr;Nt();var Lo=class{constructor(){this.process=process;this.inStream=process.stdin;this.outStream=process.stdout;this.logger=Ce.child({component:"StdIO"});this.buffer="";this.abortControllers={};this.agent=null;}async handleInput(e){let r=e.toString();this.buffer+=r;let n=Pe(this.buffer);if(!(n.length<1)){n[n.length-1].endsWith(` +`)?this.buffer="":this.buffer=n.pop();for(let s of n){let i=null;try{i=JSON.parse(s);}catch(l){this.logger.error({error:l},`Failed to parse request: ${s}`);continue}this.logger.debug({request:i},"Received request");let o=await this.handleRequest(i);this.sendResponse(o),this.logger.debug({response:o},"Sent response");}}}async handleRequest(e){let r=0,n=[0,null],s=new AbortController;try{if(!this.agent)throw new Error(`Agent not bound. +`);r=e[0],n[0]=r;let i=e[1].func;if(i==="cancelRequest")n[1]=this.cancelRequest(e);else {let o=this.agent[i];if(!o)throw new Error(`Unknown function: ${i}`);let l=e[1].args;l.length>0&&typeof l[l.length-1]=="object"&&l[l.length-1].signal&&(this.abortControllers[r]=s,l[l.length-1].signal=s.signal),n[1]=await o.apply(this.agent,l);}}catch(i){an(i)?this.logger.debug({error:i,request:e},"Request canceled"):this.logger.error({error:i,request:e},"Failed to handle request");}finally{return this.abortControllers[r]&&delete this.abortControllers[r],n}}cancelRequest(e){let r=e[1].args[0],n=this.abortControllers[r];return n?(n.abort(),!0):!1}sendResponse(e){this.outStream.write(JSON.stringify(e)+` +`);}bind(e){this.agent=e;for(let r of y0)this.agent.on(r,n=>{this.sendResponse([0,n]);});}listen(){this.inStream.on("data",this.handleInput.bind(this)),["SIGTERM","SIGINT"].forEach(e=>{this.process.on(e,async()=>{this.agent&&this.agent.getStatus()!=="finalized"&&await this.agent.finalize(),this.process.exit(0);});});}};var T0=new Lo;ko.create().then(t=>{T0.bind(t),T0.listen();}); /*! Bundled license information: normalize-path/index.js: @@ -221,17 +247,6 @@ fill-range/index.js: * Copyright (c) 2014-present, Jon Schlinkert. * Licensed under the MIT License. *) - -ieee754/index.js: - (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *) - -buffer/index.js: - (*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - *) */ //# sourceMappingURL=out.js.map //# sourceMappingURL=cli.js.map \ No newline at end of file diff --git a/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/agent/Agent.kt b/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/agent/Agent.kt index 51e9703..bddfe86 100644 --- a/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/agent/Agent.kt +++ b/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/agent/Agent.kt @@ -127,37 +127,14 @@ class Agent : ProcessAdapter() { data class Config( val server: Server? = null, - val completion: Completion? = null, val logs: Logs? = null, val anonymousUsageTracking: AnonymousUsageTracking? = null, ) { data class Server( val endpoint: String? = null, val requestHeaders: Map? = null, - val requestTimeout: Int? = null, ) - data class Completion( - val prompt: Prompt? = null, - val debounce: Debounce? = null, - val timeout: Timeout? = null, - ) { - data class Prompt( - val maxPrefixLines: Int? = null, - val maxSuffixLines: Int? = null, - ) - - data class Debounce( - val mode: String? = null, - val interval: Int? = null, - ) - - data class Timeout( - val auto: Int? = null, - val manually: Int? = null, - ) - } - data class Logs( val level: String? = null, ) @@ -252,7 +229,13 @@ class Agent : ProcessAdapter() { data class Choice( val index: Int, val text: String, - ) + val replaceRange: Range, + ) { + data class Range( + val start: Int, + val end: Int, + ) + } } suspend fun provideCompletions(request: CompletionRequest): CompletionResponse? { diff --git a/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/editor/EditorListener.kt b/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/editor/EditorListener.kt index b8c993d..93ed0fb 100644 --- a/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/editor/EditorListener.kt +++ b/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/editor/EditorListener.kt @@ -1,5 +1,6 @@ package com.tabbyml.intellijtabby.editor +import com.intellij.openapi.application.invokeLater import com.intellij.openapi.components.service import com.intellij.openapi.diagnostic.Logger import com.intellij.openapi.editor.Editor @@ -38,8 +39,9 @@ class EditorListener : EditorFactoryListener { override fun documentChanged(event: DocumentEvent) { if (editorManager.selectedTextEditor == editor) { if (settings.completionTriggerMode == ApplicationSettingsState.TriggerMode.AUTOMATIC) { - val offset = event.offset + event.newFragment.length - completionProvider.provideCompletion(editor, offset) + invokeLater { + completionProvider.provideCompletion(editor, editor.caretModel.primaryCaret.offset) + } } } } diff --git a/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/editor/InlineCompletionService.kt b/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/editor/InlineCompletionService.kt index 1ddb1f9..3a515b4 100644 --- a/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/editor/InlineCompletionService.kt +++ b/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/editor/InlineCompletionService.kt @@ -10,8 +10,12 @@ import com.intellij.openapi.editor.EditorCustomElementRenderer import com.intellij.openapi.editor.Inlay import com.intellij.openapi.editor.colors.EditorFontType import com.intellij.openapi.editor.impl.FontInfo +import com.intellij.openapi.editor.markup.HighlighterLayer +import com.intellij.openapi.editor.markup.HighlighterTargetArea +import com.intellij.openapi.editor.markup.RangeHighlighter import com.intellij.openapi.editor.markup.TextAttributes import com.intellij.openapi.util.Disposer +import com.intellij.openapi.util.TextRange import com.intellij.ui.JBColor import com.intellij.util.ui.UIUtil import com.tabbyml.intellijtabby.agent.Agent @@ -30,8 +34,8 @@ class InlineCompletionService { val editor: Editor, val offset: Int, val completion: Agent.CompletionResponse, - val text: String, val inlays: List>, + val markups: List, ) var shownInlineCompletion: InlineCompletion? = null @@ -43,14 +47,109 @@ class InlineCompletionService { return } invokeLater { - // FIXME: support multiple choices - val text = completion.choices.first().text - logger.info("Showing inline completion at $offset: $text") - val lines = text.split("\n") - val inlays = lines - .mapIndexed { index, line -> createInlayLine(editor, offset, line, index) } - .filterNotNull() - shownInlineCompletion = InlineCompletion(editor, offset, completion, text, inlays) + if (editor.caretModel.offset != offset) { + return@invokeLater + } + + // only support multiple choices for now + val choice = completion.choices.first() + logger.info("Showing inline completion at $offset: $choice") + + val prefixReplaceLength = offset - choice.replaceRange.start + val suffixReplaceLength = choice.replaceRange.end - offset + val text = choice.text.substring(prefixReplaceLength) + if (text.isEmpty()) { + return@invokeLater + } + val currentLineNumber = editor.document.getLineNumber(offset) + val currentLineEndOffset = editor.document.getLineEndOffset(currentLineNumber) + if (currentLineEndOffset - offset < suffixReplaceLength) { + return@invokeLater + } + val currentLineSuffix = editor.document.getText(TextRange(offset, currentLineEndOffset)) + + val textLines = text.split("\n").toMutableList() + + val inlays = mutableListOf>() + val markups = mutableListOf() + if (suffixReplaceLength == 0) { + // No replace range to handle + createInlayText(editor, textLines[0], offset, 0)?.let { inlays.add(it) } + if (textLines.size > 1) { + if (currentLineSuffix.isNotEmpty()) { + markupReplaceText(editor, offset, currentLineEndOffset).let { markups.add(it) } + textLines[textLines.lastIndex] += currentLineSuffix + } + textLines.forEachIndexed { index, line -> + if (index > 0) { + createInlayText(editor, line, offset, index)?.let { inlays.add(it) } + } + } + } + } else if (suffixReplaceLength == 1) { + logger.info("suffixReplaceLength: $suffixReplaceLength") + logger.info("currentLineSuffix: $currentLineSuffix") + logger.info("textLines[0]: ${textLines[0]}") + logger.info("textLines.size: ${textLines.size}") + // Replace range contains one char + val replaceChar = currentLineSuffix[0] + // Insert part is substring of first line that before the char + // Append part is substring of first line that after the char + // If first line doesn't contain the char, insert part is full first line, append part is empty + val insertPart = if (textLines[0].startsWith(replaceChar)) { + "" + } else { + textLines[0].split(replaceChar).first() + } + val appendPart = if (insertPart.length < textLines[0].length) { + textLines[0].substring(insertPart.length + 1) + } else { + "" + } + if (insertPart.isNotEmpty()) { + createInlayText(editor, insertPart, offset, 0)?.let { inlays.add(it) } + } + if (appendPart.isNotEmpty()) { + createInlayText(editor, appendPart, offset + 1, 0)?.let { inlays.add(it) } + } + if (textLines.size > 1) { + if (currentLineSuffix.isNotEmpty()) { + val startOffset = if (insertPart.length < textLines[0].length) { + // First line contains the char + offset + 1 + } else { + // First line doesn't contain the char + offset + } + logger.info("startOffset: $startOffset") + markupReplaceText(editor, startOffset, currentLineEndOffset).let { markups.add(it) } + textLines[textLines.lastIndex] += currentLineSuffix.substring(1) + } + textLines.forEachIndexed { index, line -> + if (index > 0) { + createInlayText(editor, line, offset, index)?.let { inlays.add(it) } + } + } + } + } else { + // Replace range contains multiple chars + // It's hard to match these chars in the insertion text, we just mark them up + createInlayText(editor, textLines[0], offset, 0)?.let { inlays.add(it) } + markupReplaceText(editor, offset, offset + suffixReplaceLength).let { markups.add(it) } + if (textLines.size > 1) { + if (currentLineSuffix.length > suffixReplaceLength) { + markupReplaceText(editor, offset + suffixReplaceLength, currentLineEndOffset).let { markups.add(it) } + textLines[textLines.lastIndex] += currentLineSuffix.substring(suffixReplaceLength) + } + textLines.forEachIndexed { index, line -> + if (index > 0) { + createInlayText(editor, line, offset, index)?.let { inlays.add(it) } + } + } + } + } + + shownInlineCompletion = InlineCompletion(editor, offset, completion, inlays, markups) } val agentService = service() agentService.scope.launch { @@ -66,10 +165,15 @@ class InlineCompletionService { fun accept() { shownInlineCompletion?.let { - logger.info("Accept inline completion at ${it.offset}: ${it.text}") + val choice = it.completion.choices.first() + logger.info("Accept inline completion at ${it.offset}: $choice") + + val prefixReplaceLength = it.offset - choice.replaceRange.start + val text = choice.text.substring(prefixReplaceLength) WriteCommandAction.runWriteCommandAction(it.editor.project) { - it.editor.document.insertString(it.offset, it.text) - it.editor.caretModel.moveToOffset(it.offset + it.text.length) + it.editor.document.deleteString(it.offset, choice.replaceRange.end) + it.editor.document.insertString(it.offset, text) + it.editor.caretModel.moveToOffset(it.offset + text.length) } invokeLater { it.inlays.forEach(Disposer::dispose) @@ -80,7 +184,7 @@ class InlineCompletionService { Agent.LogEventRequest( type = Agent.LogEventRequest.EventType.SELECT, completionId = it.completion.id, - choiceIndex = it.completion.choices.first().index + choiceIndex = choice.index ) ) } @@ -92,26 +196,29 @@ class InlineCompletionService { shownInlineCompletion?.let { invokeLater { it.inlays.forEach(Disposer::dispose) + it.markups.forEach { markup -> + it.editor.markupModel.removeHighlighter(markup) + } } shownInlineCompletion = null } } - private fun createInlayLine(editor: Editor, offset: Int, line: String, index: Int): Inlay<*>? { + private fun createInlayText(editor: Editor, text: String, offset: Int, lineOffset: Int): Inlay<*>? { val renderer = object : EditorCustomElementRenderer { override fun calcWidthInPixels(inlay: Inlay<*>): Int { - return maxOf(getWidth(inlay.editor, line), 1) + return maxOf(getWidth(inlay.editor, text), 1) } override fun paint(inlay: Inlay<*>, graphics: Graphics, targetRect: Rectangle, textAttributes: TextAttributes) { graphics.font = getFont(inlay.editor) graphics.color = JBColor.GRAY - graphics.drawString(line, targetRect.x, targetRect.y + inlay.editor.ascent) + graphics.drawString(text, targetRect.x, targetRect.y + inlay.editor.ascent) } private fun getFont(editor: Editor): Font { return editor.colorsScheme.getFont(EditorFontType.PLAIN).let { - UIUtil.getFontWithFallbackIfNeeded(it, line).deriveFont(editor.colorsScheme.editorFontSize) + UIUtil.getFontWithFallbackIfNeeded(it, text).deriveFont(editor.colorsScheme.editorFontSize) } } @@ -121,10 +228,20 @@ class InlineCompletionService { return metrics.stringWidth(line) } } - return if (index == 0) { + return if (lineOffset == 0) { editor.inlayModel.addInlineElement(offset, true, renderer) } else { - editor.inlayModel.addBlockElement(offset, true, false, -index, renderer) + editor.inlayModel.addBlockElement(offset, true, false, -lineOffset, renderer) } } -} \ No newline at end of file + + private fun markupReplaceText(editor: Editor, startOffset: Int, endOffset: Int): RangeHighlighter { + val textAttributes = TextAttributes().apply { + foregroundColor = JBColor.background() + backgroundColor = JBColor.background() + } + return editor.markupModel.addRangeHighlighter( + startOffset, endOffset, HighlighterLayer.LAST + 1000, textAttributes, HighlighterTargetArea.EXACT_RANGE + ) + } +}