#!/bin/env node 'use strict'; var child_process = require('child_process'); var zlib = require('zlib'); var stream = require('stream'); var fs = require('fs'); var promises = require('fs/promises'); var path = require('path'); var util = require('util'); var events = require('events'); var qx = require('crypto'); function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } var qx__default = /*#__PURE__*/_interopDefault(qx); var Fx=Object.create;var Gn=Object.defineProperty;var kx=Object.getOwnPropertyDescriptor;var Lx=Object.getOwnPropertyNames;var Dx=Object.getPrototypeOf,Bx=Object.prototype.hasOwnProperty;var Nx=(t,e,r)=>e in t?Gn(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 Gi=(t,e)=>()=>(t&&(e=t(t=0)),e);var C=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Qo=(t,e)=>{for(var r in e)Gn(t,r,{get:e[r],enumerable:!0});},Mf=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Lx(e))!Bx.call(t,s)&&s!==r&&Gn(t,s,{get:()=>e[s],enumerable:!(n=kx(e,s))||n.enumerable});return t};var Kn=(t,e,r)=>(r=t!=null?Fx(Dx(t)):{},Mf(e||!t||!t.__esModule?Gn(r,"default",{value:t,enumerable:!0}):r,t)),Zo=t=>Mf(Gn({},"__esModule",{value:!0}),t);var ie=(t,e,r)=>(Nx(t,typeof e!="symbol"?e+"":e,r),r),ea=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)};var S=(t,e,r)=>(ea(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)=>(ea(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r);var Ki=(t,e,r,n)=>({set _(s){ne(t,e,s,r);},get _(){return S(t,e,n)}}),te=(t,e,r)=>(ea(t,e,"access private method"),r);var na=C((t2,Hf)=>{var jf=Object.prototype.toString;Hf.exports=function(e){var r=jf.call(e),n=r==="[object Arguments]";return n||(n=r!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&jf.call(e.callee)==="[object Function]"),n};});var Qf=C((r2,Xf)=>{var Jf;Object.keys||(Vn=Object.prototype.hasOwnProperty,ia=Object.prototype.toString,Wf=na(),sa=Object.prototype.propertyIsEnumerable,zf=!sa.call({toString:null},"toString"),Gf=sa.call(function(){},"prototype"),Yn=["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},Vf=function(){if(typeof window>"u")return !1;for(var t in window)try{if(!Kf["$"+t]&&Vn.call(window,t)&&window[t]!==null&&typeof window[t]=="object")try{Ji(window[t]);}catch{return !0}}catch{return !0}return !1}(),Yf=function(t){if(typeof window>"u"||!Vf)return Ji(t);try{return Ji(t)}catch{return !1}},Jf=function(e){var r=e!==null&&typeof e=="object",n=ia.call(e)==="[object Function]",s=Wf(e),i=r&&ia.call(e)==="[object String]",o=[];if(!r&&!n&&!s)throw new TypeError("Object.keys called on a non-object");var u=Gf&&n;if(i&&e.length>0&&!Vn.call(e,0))for(var c=0;c0)for(var p=0;p{var jx=Array.prototype.slice,Hx=na(),Zf=Object.keys,Xi=Zf?function(e){return Zf(e)}:Qf(),eh=Object.keys;Xi.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 Hx(n)?eh(jx.call(n)):eh(n)});}else Object.keys=Xi;return Object.keys||Xi};th.exports=Xi;});var Zi=C((i2,rh)=>{rh.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 oa=C((s2,ih)=>{var nh=typeof Symbol<"u"&&Symbol,Wx=Zi();ih.exports=function(){return typeof nh!="function"||typeof Symbol!="function"||typeof nh("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Wx()};});var ah=C((o2,oh)=>{var sh={foo:{}},zx=Object;oh.exports=function(){return {__proto__:sh}.foo===sh.foo&&!({__proto__:null}instanceof zx)};});var lh=C((a2,uh)=>{var Gx="Function.prototype.bind called on incompatible ",aa=Array.prototype.slice,Kx=Object.prototype.toString,Vx="[object Function]";uh.exports=function(e){var r=this;if(typeof r!="function"||Kx.call(r)!==Vx)throw new TypeError(Gx+r);for(var n=aa.call(arguments,1),s,i=function(){if(this instanceof s){var l=r.apply(this,n.concat(aa.call(arguments)));return Object(l)===l?l:this}else return r.apply(e,n.concat(aa.call(arguments)))},o=Math.max(0,r.length-n.length),u=[],c=0;c{var Yx=lh();ch.exports=Function.prototype.bind||Yx;});var hh=C((l2,fh)=>{var Jx=es();fh.exports=Jx.call(Function.call,Object.prototype.hasOwnProperty);});var Dt=C((c2,mh)=>{var he,on=SyntaxError,gh=Function,sn=TypeError,ua=function(t){try{return gh('"use strict"; return ('+t+").constructor;")()}catch{}},Pr=Object.getOwnPropertyDescriptor;var la=function(){throw new sn},Xx=Pr?function(){try{return la}catch{try{return Pr(arguments,"callee").get}catch{return la}}}():la,rn=oa()(),Qx=ah()(),Fe=Object.getPrototypeOf||(Qx?function(t){return t.__proto__}:null),nn={},Zx=typeof Uint8Array>"u"||!Fe?he:Fe(Uint8Array),$r={"%AggregateError%":typeof AggregateError>"u"?he:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?he:ArrayBuffer,"%ArrayIteratorPrototype%":rn&&Fe?Fe([][Symbol.iterator]()):he,"%AsyncFromSyncIteratorPrototype%":he,"%AsyncFunction%":nn,"%AsyncGenerator%":nn,"%AsyncGeneratorFunction%":nn,"%AsyncIteratorPrototype%":nn,"%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%":gh,"%GeneratorFunction%":nn,"%Int8Array%":typeof Int8Array>"u"?he:Int8Array,"%Int16Array%":typeof Int16Array>"u"?he:Int16Array,"%Int32Array%":typeof Int32Array>"u"?he:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":rn&&Fe?Fe(Fe([][Symbol.iterator]())):he,"%JSON%":typeof JSON=="object"?JSON:he,"%Map%":typeof Map>"u"?he:Map,"%MapIteratorPrototype%":typeof Map>"u"||!rn||!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"||!rn||!Fe?he:Fe(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?he:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":rn&&Fe?Fe(""[Symbol.iterator]()):he,"%Symbol%":rn?Symbol:he,"%SyntaxError%":on,"%ThrowTypeError%":Xx,"%TypedArray%":Zx,"%TypeError%":sn,"%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 eA=function t(e){var r;if(e==="%AsyncFunction%")r=ua("async function () {}");else if(e==="%GeneratorFunction%")r=ua("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=ua("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},dh={"%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"]},Jn=es(),ts=hh(),tA=Jn.call(Function.call,Array.prototype.concat),rA=Jn.call(Function.apply,Array.prototype.splice),yh=Jn.call(Function.call,String.prototype.replace),rs=Jn.call(Function.call,String.prototype.slice),nA=Jn.call(Function.call,RegExp.prototype.exec),iA=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,sA=/\\(\\)?/g,oA=function(e){var r=rs(e,0,1),n=rs(e,-1);if(r==="%"&&n!=="%")throw new on("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new on("invalid intrinsic syntax, expected opening `%`");var s=[];return yh(e,iA,function(i,o,u,c){s[s.length]=u?yh(c,sA,"$1"):o||i;}),s},aA=function(e,r){var n=e,s;if(ts(dh,n)&&(s=dh[n],n="%"+s[0]+"%"),ts($r,n)){var i=$r[n];if(i===nn&&(i=eA(n)),typeof i>"u"&&!r)throw new sn("intrinsic "+e+" exists, but is not available. Please file an issue!");return {alias:s,name:n,value:i}}throw new on("intrinsic "+e+" does not exist!")};mh.exports=function(e,r){if(typeof e!="string"||e.length===0)throw new sn("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new sn('"allowMissing" argument must be a boolean');if(nA(/^%?[^%]*%?$/,e)===null)throw new on("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=oA(e),s=n.length>0?n[0]:"",i=aA("%"+s+"%",r),o=i.name,u=i.value,c=!1,p=i.alias;p&&(s=p[0],rA(n,tA([0,1],p)));for(var l=1,d=!0;l=n.length){var E=Pr(u,g);d=!!E,d&&"get"in E&&!("originalValue"in E.get)?u=E.get:u=u[g];}else d=ts(u,g),u=u[g];d&&!c&&($r[o]=u);}}return u};});var ns=C((f2,wh)=>{var uA=Dt(),ca=uA("%Object.defineProperty%",!0),fa=function(){if(ca)try{return ca({},"a",{value:1}),!0}catch{return !1}return !1};fa.hasArrayLengthDefineBug=function(){if(!fa())return null;try{return ca([],"length",{value:1}).length!==1}catch{return !0}};wh.exports=fa;});var ha=C((h2,vh)=>{var lA=Dt(),is=lA("%Object.getOwnPropertyDescriptor%",!0);if(is)try{is([],"length");}catch{is=null;}vh.exports=is;});var da=C((p2,Eh)=>{var cA=ns()(),pa=Dt(),Sh=cA&&pa("%Object.defineProperty%",!0),fA=pa("%SyntaxError%"),an=pa("%TypeError%"),bh=ha();Eh.exports=function(e,r,n){if(!e||typeof e!="object"&&typeof e!="function")throw new an("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new an("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new an("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new an("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new an("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new an("`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=!!bh&&bh(e,r);if(Sh)Sh(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 fA("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")};});var lr=C((d2,Rh)=>{var hA=Qi(),pA=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",dA=Object.prototype.toString,yA=Array.prototype.concat,xh=da(),gA=function(t){return typeof t=="function"&&dA.call(t)==="[object Function]"},Ah=ns()(),mA=function(t,e,r,n){if(e in t){if(n===!0){if(t[e]===r)return}else if(!gA(n)||!n())return}Ah?xh(t,e,r,!0):xh(t,e,r);},_h=function(t,e){var r=arguments.length>2?arguments[2]:{},n=hA(e);pA&&(n=yA.call(n,Object.getOwnPropertySymbols(e)));for(var s=0;s{var ya=es(),un=Dt(),Th=un("%Function.prototype.apply%"),Ih=un("%Function.prototype.call%"),Ph=un("%Reflect.apply%",!0)||ya.call(Ih,Th),Ch=un("%Object.getOwnPropertyDescriptor%",!0),Fr=un("%Object.defineProperty%",!0),wA=un("%Math.max%");if(Fr)try{Fr({},"a",{value:1});}catch{Fr=null;}ss.exports=function(e){var r=Ph(ya,Ih,arguments);if(Ch&&Fr){var n=Ch(r,"length");n.configurable&&Fr(r,"length",{value:1+wA(0,e.length-(arguments.length-1))});}return r};var Oh=function(){return Ph(ya,Th,arguments)};Fr?Fr(ss.exports,"apply",{value:Oh}):ss.exports.apply=Oh;});var bt=C((g2,kh)=>{var $h=Dt(),Fh=kr(),vA=Fh($h("String.prototype.indexOf"));kh.exports=function(e,r){var n=$h(e,!!r);return typeof n=="function"&&vA(e,".prototype.")>-1?Fh(n):n};});var ga=C((m2,qh)=>{var SA=Qi(),Bh=Zi()(),Nh=bt(),Lh=Object,bA=Nh("Array.prototype.push"),Dh=Nh("Object.prototype.propertyIsEnumerable"),EA=Bh?Object.getOwnPropertySymbols:null;qh.exports=function(e,r){if(e==null)throw new TypeError("target must be an object");var n=Lh(e);if(arguments.length===1)return n;for(var s=1;s{var ma=ga(),xA=function(){if(!Object.assign)return !1;for(var t="abcdefghijklmnopqrst",e=t.split(""),r={},n=0;n{var _A=lr(),RA=wa();Uh.exports=function(){var e=RA();return _A(Object,{assign:e},{assign:function(){return Object.assign!==e}}),e};});var Gh=C((S2,zh)=>{var CA=lr(),OA=kr(),TA=ga(),Hh=wa(),IA=jh(),PA=OA.apply(Hh()),Wh=function(e,r){return PA(Object,arguments)};CA(Wh,{getPolyfill:Hh,implementation:TA,shim:IA});zh.exports=Wh;});var Vh=C((b2,Kh)=>{var Qn=function(){return typeof function(){}.name=="string"},Xn=Object.getOwnPropertyDescriptor;Qn.functionsHaveConfigurableNames=function(){if(!Qn()||!Xn)return !1;var e=Xn(function(){},"name");return !!e&&!!e.configurable};var $A=Function.prototype.bind;Qn.boundFunctionsHaveNames=function(){return Qn()&&typeof $A=="function"&&function(){}.bind().name!==""};Kh.exports=Qn;});var Xh=C((E2,Jh)=>{var Yh=da(),FA=ns()(),kA=Vh().functionsHaveConfigurableNames(),LA=TypeError;Jh.exports=function(e,r){if(typeof e!="function")throw new LA("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return (!n||kA)&&(FA?Yh(e,"name",r,!0,!0):Yh(e,"name",r)),e};});var va=C((x2,Qh)=>{var DA=Xh(),BA=Object,NA=TypeError;Qh.exports=DA(function(){if(this!=null&&this!==BA(this))throw new NA("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 Sa=C((A2,Zh)=>{var qA=va(),MA=lr().supportsDescriptors,UA=Object.getOwnPropertyDescriptor;Zh.exports=function(){if(MA&&/a/mig.flags==="gim"){var e=UA(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 qA};});var rp=C((_2,tp)=>{var jA=lr().supportsDescriptors,HA=Sa(),WA=Object.getOwnPropertyDescriptor,zA=Object.defineProperty,GA=TypeError,ep=Object.getPrototypeOf,KA=/a/;tp.exports=function(){if(!jA||!ep)throw new GA("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=HA(),r=ep(KA),n=WA(r,"flags");return (!n||n.get!==e)&&zA(r,"flags",{configurable:!0,enumerable:!1,get:e}),e};});var op=C((R2,sp)=>{var VA=lr(),YA=kr(),JA=va(),np=Sa(),XA=rp(),ip=YA(np());VA(ip,{getPolyfill:np,implementation:JA,shim:XA});sp.exports=ip;});var lp=C((C2,up)=>{var ap=Symbol.iterator;up.exports=function(e){if(e!=null&&typeof e[ap]<"u")return e[ap]()};});var fp=C((O2,cp)=>{cp.exports=G("util").inspect;});var Pp=C((T2,Ip)=>{var Ia=typeof Map=="function"&&Map.prototype,ba=Object.getOwnPropertyDescriptor&&Ia?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,as=Ia&&ba&&typeof ba.get=="function"?ba.get:null,hp=Ia&&Map.prototype.forEach,Pa=typeof Set=="function"&&Set.prototype,Ea=Object.getOwnPropertyDescriptor&&Pa?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,us=Pa&&Ea&&typeof Ea.get=="function"?Ea.get:null,pp=Pa&&Set.prototype.forEach,QA=typeof WeakMap=="function"&&WeakMap.prototype,ei=QA?WeakMap.prototype.has:null,ZA=typeof WeakSet=="function"&&WeakSet.prototype,ti=ZA?WeakSet.prototype.has:null,e_=typeof WeakRef=="function"&&WeakRef.prototype,dp=e_?WeakRef.prototype.deref:null,t_=Boolean.prototype.valueOf,r_=Object.prototype.toString,n_=Function.prototype.toString,i_=String.prototype.match,$a=String.prototype.slice,fr=String.prototype.replace,s_=String.prototype.toUpperCase,yp=String.prototype.toLowerCase,Ap=RegExp.prototype.test,gp=Array.prototype.concat,Bt=Array.prototype.join,o_=Array.prototype.slice,mp=Math.floor,_a=typeof BigInt=="function"?BigInt.prototype.valueOf:null,xa=Object.getOwnPropertySymbols,Ra=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,ln=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Ge=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===ln||"symbol")?Symbol.toStringTag:null,_p=Object.prototype.propertyIsEnumerable,wp=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function vp(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||Ap.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-mp(-t):mp(t);if(n!==t){var s=String(n),i=$a.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 Ca=fp(),Sp=Ca.custom,bp=Cp(Sp)?Sp:null;Ip.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 Tp(e,i);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var c=String(e);return u?vp(e,c):c}if(typeof e=="bigint"){var p=String(e)+"n";return u?vp(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 Oa(e)?"[Array]":"[Object]";var d=A_(i,n);if(typeof s>"u")s=[];else if(Op(s,e)>=0)return "[Circular]";function g(J,oe,I){if(oe&&(s=o_.call(s),s.push(oe)),I){var P={depth:i.depth};return cr(i,"quoteStyle")&&(P.quoteStyle=i.quoteStyle),t(J,P,n+1,s)}return t(J,i,n+1,s)}if(typeof e=="function"&&!Ep(e)){var m=y_(e),w=os(e,g);return "[Function"+(m?": "+m:" (anonymous)")+"]"+(w.length>0?" { "+Bt.call(w,", ")+" }":"")}if(Cp(e)){var E=ln?fr.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Ra.call(e);return typeof e=="object"&&!ln?Zn(E):E}if(b_(e)){for(var A="<"+yp.call(String(e.nodeName)),R=e.attributes||[],x=0;x",A}if(Oa(e)){if(e.length===0)return "[]";var O=os(e,g);return d&&!x_(O)?"["+Ta(O,d)+"]":"[ "+Bt.call(O,", ")+" ]"}if(l_(e)){var F=os(e,g);return !("cause"in Error.prototype)&&"cause"in e&&!_p.call(e,"cause")?"{ ["+String(e)+"] "+Bt.call(gp.call("[cause]: "+g(e.cause),F),", ")+" }":F.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Bt.call(F,", ")+" }"}if(typeof e=="object"&&o){if(bp&&typeof e[bp]=="function"&&Ca)return Ca(e,{depth:l-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(g_(e)){var D=[];return hp&&hp.call(e,function(J,oe){D.push(g(oe,e,!0)+" => "+g(J,e));}),xp("Map",as.call(e),D,d)}if(v_(e)){var W=[];return pp&&pp.call(e,function(J){W.push(g(J,e));}),xp("Set",us.call(e),W,d)}if(m_(e))return Aa("WeakMap");if(S_(e))return Aa("WeakSet");if(w_(e))return Aa("WeakRef");if(f_(e))return Zn(g(Number(e)));if(p_(e))return Zn(g(_a.call(e)));if(h_(e))return Zn(t_.call(e));if(c_(e))return Zn(g(String(e)));if(!u_(e)&&!Ep(e)){var H=os(e,g),B=wp?wp(e)===Object.prototype:e instanceof Object||e.constructor===Object,k=e instanceof Object?"":"null prototype",U=!B&&Ge&&Object(e)===e&&Ge in e?$a.call(hr(e),8,-1):k?"Object":"",_=B||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",Y=_+(U||k?"["+Bt.call(gp.call([],U||[],k||[]),": ")+"] ":"");return H.length===0?Y+"{}":d?Y+"{"+Ta(H,d)+"}":Y+"{ "+Bt.call(H,", ")+" }"}return String(e)};function Rp(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function a_(t){return fr.call(String(t),/"/g,""")}function Oa(t){return hr(t)==="[object Array]"&&(!Ge||!(typeof t=="object"&&Ge in t))}function u_(t){return hr(t)==="[object Date]"&&(!Ge||!(typeof t=="object"&&Ge in t))}function Ep(t){return hr(t)==="[object RegExp]"&&(!Ge||!(typeof t=="object"&&Ge in t))}function l_(t){return hr(t)==="[object Error]"&&(!Ge||!(typeof t=="object"&&Ge in t))}function c_(t){return hr(t)==="[object String]"&&(!Ge||!(typeof t=="object"&&Ge in t))}function f_(t){return hr(t)==="[object Number]"&&(!Ge||!(typeof t=="object"&&Ge in t))}function h_(t){return hr(t)==="[object Boolean]"&&(!Ge||!(typeof t=="object"&&Ge in t))}function Cp(t){if(ln)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return !0;if(!t||typeof t!="object"||!Ra)return !1;try{return Ra.call(t),!0}catch{}return !1}function p_(t){if(!t||typeof t!="object"||!_a)return !1;try{return _a.call(t),!0}catch{}return !1}var d_=Object.prototype.hasOwnProperty||function(t){return t in this};function cr(t,e){return d_.call(t,e)}function hr(t){return r_.call(t)}function y_(t){if(t.name)return t.name;var e=i_.call(n_.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function Op(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 Tp($a.call(t,0,e.maxStringLength),e)+n}var s=fr.call(fr.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,E_);return Rp(s,"single",e)}function E_(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":"")+s_.call(e.toString(16))}function Zn(t){return "Object("+t+")"}function Aa(t){return t+" { ? }"}function xp(t,e,r,n){var s=n?Ta(r,n):Bt.call(r,", ");return t+" ("+e+") {"+s+"}"}function x_(t){for(var e=0;e=0)return !1;return !0}function A_(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 Ta(t,e){if(t.length===0)return "";var r=` `+e.prev+e.base;return r+Bt.call(t,","+r)+` `+e.prev}function os(t,e){var r=Oa(t),n=[];if(r){n.length=t.length;for(var s=0;s{var Fa=Dt(),cn=bt(),__=Pp(),R_=Fa("%TypeError%"),ls=Fa("%WeakMap%",!0),cs=Fa("%Map%",!0),C_=cn("WeakMap.prototype.get",!0),O_=cn("WeakMap.prototype.set",!0),T_=cn("WeakMap.prototype.has",!0),I_=cn("Map.prototype.get",!0),P_=cn("Map.prototype.set",!0),$_=cn("Map.prototype.has",!0),ka=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},F_=function(t,e){var r=ka(t,e);return r&&r.value},k_=function(t,e,r){var n=ka(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r};},L_=function(t,e){return !!ka(t,e)};$p.exports=function(){var e,r,n,s={assert:function(i){if(!s.has(i))throw new R_("Side channel does not contain "+__(i))},get:function(i){if(ls&&i&&(typeof i=="object"||typeof i=="function")){if(e)return C_(e,i)}else if(cs){if(r)return I_(r,i)}else if(n)return F_(n,i)},has:function(i){if(ls&&i&&(typeof i=="object"||typeof i=="function")){if(e)return T_(e,i)}else if(cs){if(r)return $_(r,i)}else if(n)return L_(n,i);return !1},set:function(i,o){ls&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new ls),O_(e,i,o)):cs?(r||(r=new cs),P_(r,i,o)):(n||(n={key:{},next:null}),k_(n,i,o));}};return s};});var La=C((P2,Lp)=>{var kp=function(t){return t!==t};Lp.exports=function(e,r){return e===0&&r===0?1/e===1/r:!!(e===r||kp(e)&&kp(r))};});var Da=C(($2,Dp)=>{var D_=La();Dp.exports=function(){return typeof Object.is=="function"?Object.is:D_};});var Np=C((F2,Bp)=>{var B_=Da(),N_=lr();Bp.exports=function(){var e=B_();return N_(Object,{is:e},{is:function(){return Object.is!==e}}),e};});var jp=C((k2,Up)=>{var q_=lr(),M_=kr(),U_=La(),qp=Da(),j_=Np(),Mp=M_(qp(),Object);q_(Mp,{getPolyfill:qp,implementation:U_,shim:j_});Up.exports=Mp;});var pr=C((L2,Hp)=>{var H_=Zi();Hp.exports=function(){return H_()&&!!Symbol.toStringTag};});var Gp=C((D2,zp)=>{var W_=pr()(),z_=bt(),Ba=z_("Object.prototype.toString"),fs=function(e){return W_&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:Ba(e)==="[object Arguments]"},Wp=function(e){return fs(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Ba(e)!=="[object Array]"&&Ba(e.callee)==="[object Function]"},G_=function(){return fs(arguments)}();fs.isLegacyArguments=Wp;zp.exports=G_?fs:Wp;});var Vp=C((B2,Kp)=>{var K_={}.toString;Kp.exports=Array.isArray||function(t){return K_.call(t)=="[object Array]"};});var Qp=C((N2,Xp)=>{var Jp=Function.prototype.toString,fn=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,qa,hs;if(typeof fn=="function"&&typeof Object.defineProperty=="function")try{qa=Object.defineProperty({},"length",{get:function(){throw hs}}),hs={},fn(function(){throw 42},null,qa);}catch(t){t!==hs&&(fn=null);}else fn=null;var V_=/^\s*class\b/,Ma=function(e){try{var r=Jp.call(e);return V_.test(r)}catch{return !1}},Na=function(e){try{return Ma(e)?!1:(Jp.call(e),!0)}catch{return !1}},ps=Object.prototype.toString,Y_="[object Object]",J_="[object Function]",X_="[object GeneratorFunction]",Q_="[object HTMLAllCollection]",Z_="[object HTML document.all class]",e1="[object HTMLCollection]",t1=typeof Symbol=="function"&&!!Symbol.toStringTag,r1=!(0 in[,]),Ua=function(){return !1};typeof document=="object"&&(Yp=document.all,ps.call(Yp)===ps.call(document.all)&&(Ua=function(e){if((r1||!e)&&(typeof e>"u"||typeof e=="object"))try{var r=ps.call(e);return (r===Q_||r===Z_||r===e1||r===Y_)&&e("")==null}catch{}return !1}));var Yp;Xp.exports=fn?function(e){if(Ua(e))return !0;if(!e||typeof e!="function"&&typeof e!="object")return !1;try{fn(e,null,qa);}catch(r){if(r!==hs)return !1}return !Ma(e)&&Na(e)}:function(e){if(Ua(e))return !0;if(!e||typeof e!="function"&&typeof e!="object")return !1;if(t1)return Na(e);if(Ma(e))return !1;var r=ps.call(e);return r!==J_&&r!==X_&&!/^\[object HTML/.test(r)?!1:Na(e)};});var td=C((q2,ed)=>{var n1=Qp(),i1=Object.prototype.toString,Zp=Object.prototype.hasOwnProperty,s1=function(e,r,n){for(var s=0,i=e.length;s=3&&(s=n),i1.call(e)==="[object Array]"?s1(e,r,s):typeof e=="string"?o1(e,r,s):a1(e,r,s);};ed.exports=u1;});var nd=C((M2,rd)=>{var ja=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],l1=typeof globalThis>"u"?global:globalThis;rd.exports=function(){for(var e=[],r=0;r{var ys=td(),c1=nd(),id=kr(),za=bt(),ds=ha(),f1=za("Object.prototype.toString"),od=pr()(),sd=typeof globalThis>"u"?global:globalThis,Wa=c1(),Ga=za("String.prototype.slice"),Ha=Object.getPrototypeOf,h1=za("Array.prototype.indexOf",!0)||function(e,r){for(var n=0;n-1?r:r!=="Object"?!1:d1(e)}return ds?p1(e):null};});var ld=C((j2,ud)=>{var y1=Ka();ud.exports=function(e){return !!y1(e)};});var Va=C((H2,yd)=>{var g1=kr(),m1=bt(),dd=Dt(),w1=ld(),cd=dd("ArrayBuffer",!0),fd=dd("Float32Array",!0),ms=m1("ArrayBuffer.prototype.byteLength",!0),hd=cd&&!ms&&new cd().slice,pd=hd&&g1(hd);yd.exports=ms||pd?function(e){if(!e||typeof e!="object")return !1;try{return ms?ms(e):pd(e,0),!0}catch{return !1}}:fd?function(e){try{return new fd(e).buffer===e&&!w1(e)}catch(r){return typeof e=="object"&&r.name==="RangeError"}}:function(e){return !1};});var md=C((W2,gd)=>{var v1=Date.prototype.getDay,S1=function(e){try{return v1.call(e),!0}catch{return !1}},b1=Object.prototype.toString,E1="[object Date]",x1=pr()();gd.exports=function(e){return typeof e!="object"||e===null?!1:x1?S1(e):b1.call(e)===E1};});var Ed=C((z2,bd)=>{var Ya=bt(),wd=pr()(),vd,Sd,Ja,Xa;wd&&(vd=Ya("Object.prototype.hasOwnProperty"),Sd=Ya("RegExp.prototype.exec"),Ja={},ws=function(){throw Ja},Xa={toString:ws,valueOf:ws},typeof Symbol.toPrimitive=="symbol"&&(Xa[Symbol.toPrimitive]=ws));var ws,A1=Ya("Object.prototype.toString"),_1=Object.getOwnPropertyDescriptor,R1="[object RegExp]";bd.exports=wd?function(e){if(!e||typeof e!="object")return !1;var r=_1(e,"lastIndex"),n=r&&vd(r,"value");if(!n)return !1;try{Sd(e,Xa);}catch(s){return s===Ja}}:function(e){return !e||typeof e!="object"&&typeof e!="function"?!1:A1(e)===R1};});var _d=C((G2,Ad)=>{var C1=bt(),xd=C1("SharedArrayBuffer.prototype.byteLength",!0);Ad.exports=xd?function(e){if(!e||typeof e!="object")return !1;try{return xd(e),!0}catch{return !1}}:function(e){return !1};});var Cd=C((K2,Rd)=>{var O1=String.prototype.valueOf,T1=function(e){try{return O1.call(e),!0}catch{return !1}},I1=Object.prototype.toString,P1="[object String]",$1=pr()();Rd.exports=function(e){return typeof e=="string"?!0:typeof e!="object"?!1:$1?T1(e):I1.call(e)===P1};});var Td=C((V2,Od)=>{var F1=Number.prototype.toString,k1=function(e){try{return F1.call(e),!0}catch{return !1}},L1=Object.prototype.toString,D1="[object Number]",B1=pr()();Od.exports=function(e){return typeof e=="number"?!0:typeof e!="object"?!1:B1?k1(e):L1.call(e)===D1};});var $d=C((Y2,Pd)=>{var Id=bt(),N1=Id("Boolean.prototype.toString"),q1=Id("Object.prototype.toString"),M1=function(e){try{return N1(e),!0}catch{return !1}},U1="[object Boolean]",j1=pr()();Pd.exports=function(e){return typeof e=="boolean"?!0:e===null||typeof e!="object"?!1:j1&&Symbol.toStringTag in e?M1(e):q1(e)===U1};});var Dd=C((J2,Qa)=>{var H1=Object.prototype.toString,W1=oa()();W1?(Fd=Symbol.prototype.toString,kd=/^Symbol\(.*\)$/,Ld=function(e){return typeof e.valueOf()!="symbol"?!1:kd.test(Fd.call(e))},Qa.exports=function(e){if(typeof e=="symbol")return !0;if(H1.call(e)!=="[object Symbol]")return !1;try{return Ld(e)}catch{return !1}}):Qa.exports=function(e){return !1};var Fd,kd,Ld;});var qd=C((X2,Nd)=>{var Bd=typeof BigInt<"u"&&BigInt;Nd.exports=function(){return typeof Bd=="function"&&typeof BigInt=="function"&&typeof Bd(42)=="bigint"&&typeof BigInt(42)=="bigint"};});var jd=C((Q2,Za)=>{var z1=qd()();z1?(Md=BigInt.prototype.valueOf,Ud=function(e){try{return Md.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:Ud(e)}):Za.exports=function(e){return !1};var Md,Ud;});var Wd=C((Z2,Hd)=>{var G1=Cd(),K1=Td(),V1=$d(),Y1=Dd(),J1=jd();Hd.exports=function(e){if(e==null||typeof e!="object"&&typeof e!="function")return null;if(G1(e))return "String";if(K1(e))return "Number";if(V1(e))return "Boolean";if(Y1(e))return "Symbol";if(J1(e))return "BigInt"};});var Vd=C((eN,Kd)=>{var eu=typeof Map=="function"&&Map.prototype?Map:null,X1=typeof Set=="function"&&Set.prototype?Set:null,vs;eu||(vs=function(e){return !1});var Gd=eu?Map.prototype.has:null,zd=X1?Set.prototype.has:null;!vs&&!Gd&&(vs=function(e){return !1});Kd.exports=vs||function(e){if(!e||typeof e!="object")return !1;try{if(Gd.call(e),zd)try{zd.call(e);}catch{return !0}return e instanceof eu}catch{}return !1};});var Qd=C((tN,Xd)=>{var Q1=typeof Map=="function"&&Map.prototype?Map:null,tu=typeof Set=="function"&&Set.prototype?Set:null,Ss;tu||(Ss=function(e){return !1});var Yd=Q1?Map.prototype.has:null,Jd=tu?Set.prototype.has:null;!Ss&&!Jd&&(Ss=function(e){return !1});Xd.exports=Ss||function(e){if(!e||typeof e!="object")return !1;try{if(Jd.call(e),Yd)try{Yd.call(e);}catch{return !0}return e instanceof tu}catch{}return !1};});var ty=C((rN,ey)=>{var bs=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,Zd=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,Es;bs||(Es=function(e){return !1});var nu=bs?bs.prototype.has:null,ru=Zd?Zd.prototype.has:null;!Es&&!nu&&(Es=function(e){return !1});ey.exports=Es||function(e){if(!e||typeof e!="object")return !1;try{if(nu.call(e,nu),ru)try{ru.call(e,ru);}catch{return !0}return e instanceof bs}catch{}return !1};});var ny=C((nN,su)=>{var Z1=Dt(),ry=bt(),eR=Z1("%WeakSet%",!0),iu=ry("WeakSet.prototype.has",!0);iu?(xs=ry("WeakMap.prototype.has",!0),su.exports=function(e){if(!e||typeof e!="object")return !1;try{if(iu(e,iu),xs)try{xs(e,xs);}catch{return !0}return e instanceof eR}catch{}return !1}):su.exports=function(e){return !1};var xs;});var sy=C((iN,iy)=>{var tR=Vd(),rR=Qd(),nR=ty(),iR=ny();iy.exports=function(e){if(e&&typeof e=="object"){if(tR(e))return "Map";if(rR(e))return "Set";if(nR(e))return "WeakMap";if(iR(e))return "WeakSet"}return !1};});var uy=C((sN,ay)=>{var sR=bt(),oy=sR("ArrayBuffer.prototype.byteLength",!0),oR=Va();ay.exports=function(e){return oR(e)?oy?oy(e):e.byteLength:NaN};});var Fy=C((oN,$y)=>{var Ty=Gh(),Nt=bt(),ly=op(),aR=Dt(),hn=lp(),uR=Fp(),cy=jp(),fy=Gp(),hy=Vp(),py=Va(),dy=md(),yy=Ed(),gy=_d(),my=Qi(),wy=Wd(),vy=sy(),Sy=Ka(),by=uy(),Ey=Nt("SharedArrayBuffer.prototype.byteLength",!0),xy=Nt("Date.prototype.getTime"),ou=Object.getPrototypeOf,Ay=Nt("Object.prototype.toString"),_s=aR("%Set%",!0),au=Nt("Map.prototype.has",!0),Rs=Nt("Map.prototype.get",!0),_y=Nt("Map.prototype.size",!0),Cs=Nt("Set.prototype.add",!0),Iy=Nt("Set.prototype.delete",!0),Os=Nt("Set.prototype.has",!0),As=Nt("Set.prototype.size",!0);function Ry(t,e,r,n){for(var s=hn(t),i;(i=s.next())&&!i.done;)if(Rt(e,i.value,r,n))return Iy(t,i.value),!0;return !1}function Py(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 lR(t,e,r,n,s,i){var o=Py(r);if(o!=null)return o;var u=Rs(e,o),c=Ty({},s,{strict:!1});return typeof u>"u"&&!au(e,o)||!Rt(n,u,c,i)?!1:!au(t,o)&&Rt(n,u,c,i)}function cR(t,e,r){var n=Py(r);return n??(Os(e,n)&&!Os(t,n))}function Cy(t,e,r,n,s,i){for(var o=hn(t),u,c;(u=o.next())&&!u.done;)if(c=u.value,Rt(r,c,s,i)&&Rt(n,Rs(e,c),s,i))return Iy(t,c),!0;return !1}function Rt(t,e,r,n){var s=r||{};if(s.strict?cy(t,e):t===e)return !0;var i=wy(t),o=wy(e);if(i!==o)return !1;if(!t||!e||typeof t!="object"&&typeof e!="object")return s.strict?cy(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),pR(t,e,s,n)}function Oy(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 fR(t,e,r,n){if(As(t)!==As(e))return !1;for(var s=hn(t),i=hn(e),o,u,c;(o=s.next())&&!o.done;)if(o.value&&typeof o.value=="object")c||(c=new _s),Cs(c,o.value);else if(!Os(e,o.value)){if(r.strict||!cR(t,e,o.value))return !1;c||(c=new _s),Cs(c,o.value);}if(c){for(;(u=i.next())&&!u.done;)if(u.value&&typeof u.value=="object"){if(!Ry(c,u.value,r.strict,n))return !1}else if(!r.strict&&!Os(t,u.value)&&!Ry(c,u.value,r.strict,n))return !1;return As(c)===0}return !0}function hR(t,e,r,n){if(_y(t)!==_y(e))return !1;for(var s=hn(t),i=hn(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 _s),Cs(c,p);else if(d=Rs(e,p),typeof d>"u"&&!au(e,p)||!Rt(l,d,r,n)){if(r.strict||!lR(t,e,p,l,r,n))return !1;c||(c=new _s),Cs(c,p);}if(c){for(;(u=i.next())&&!u.done;)if(p=u.value[0],d=u.value[1],p&&typeof p=="object"){if(!Cy(c,t,p,d,r,n))return !1}else if(!r.strict&&(!t.has(p)||!Rt(Rs(t,p),d,r,n))&&!Cy(c,t,p,d,Ty({},r,{strict:!1}),n))return !1;return As(c)===0}return !0}function pR(t,e,r,n){var s,i;if(typeof t!=typeof e||t==null||e==null||Ay(t)!==Ay(e)||fy(t)!==fy(e))return !1;var o=hy(t),u=hy(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=yy(t),d=yy(e);if(l!==d||(l||d)&&(t.source!==e.source||ly(t)!==ly(e)))return !1;var g=dy(t),m=dy(e);if(g!==m||(g||m)&&xy(t)!==xy(e)||r.strict&&ou&&ou(t)!==ou(e))return !1;var w=Sy(t),E=Sy(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],!Rt(t[i],e[i],r,n))return !1;var B=vy(t),k=vy(e);return B!==k?!1:B==="Set"||k==="Set"?fR(t,e,r,n):B==="Map"?hR(t,e,r,n):!0}$y.exports=function(e,r,n){return Rt(e,r,n,uR())};});var Gy={};Qo(Gy,{closest:()=>BR,distance:()=>zy});var Yt,LR,DR,zy,BR,Ky=Gi(()=>{Yt=new Uint32Array(65536),LR=(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,D=s[x/32|0]>>>x&1,W=O|w,H=((O|D)&E)+E^E|O|D,B=w|~(H|E),k=E&H;B>>>31^F&&(i[x/32|0]^=1<>>31^D&&(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),D=l&O;m+=F>>>n-1&1,m-=D>>>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=(Ky(),Zo(Gy)),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 ni<"u"&&ni!==null&&typeof hu<"u"&&ni.exports===hu?ni.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 oi=Gi(()=>{});var Ze=C(yu=>{yu.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})};yu.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 eg=C((yN,Zy)=>{var yr=G("constants"),MR=process.cwd,Ps=null,UR=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Ps||(Ps=MR.call(process)),Ps};try{process.cwd();}catch{}typeof process.chdir=="function"&&(gu=process.chdir,process.chdir=function(t){Ps=null,gu.call(process,t);},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,gu));var gu;Zy.exports=jR;function jR(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(){}),UR==="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,D,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 ng=C((gN,rg)=>{var tg=G("stream").Stream;rg.exports=HR;function HR(t){return {ReadStream:e,WriteStream:r};function e(n,s){if(!(this instanceof e))return new e(n,s);tg.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);tg.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 sg=C((mN,ig)=>{ig.exports=zR;var WR=Object.getPrototypeOf||function(t){return t.__proto__};function zR(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:WR(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=C((wN,vu)=>{var Ae=G("fs"),GR=eg(),KR=ng(),VR=sg(),$s=G("util"),We,ks;typeof Symbol=="function"&&typeof Symbol.for=="function"?(We=Symbol.for("graceful-fs.queue"),ks=Symbol.for("graceful-fs.previous")):(We="___graceful-fs.queue",ks="___graceful-fs.previous");function YR(){}function ug(t,e){Object.defineProperty(t,We,{get:function(){return e}});}var Dr=YR;$s.debuglog?Dr=$s.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Dr=function(){var t=$s.format.apply($s,arguments);t="GFS4: "+t.split(/\n/).join(` GFS4: `),console.error(t);});Ae[We]||(og=global[We]||[],ug(Ae,og),Ae.close=function(t){function e(r,n){return t.call(Ae,r,function(s){s||ag(),typeof n=="function"&&n.apply(this,arguments);})}return Object.defineProperty(e,ks,{value:t}),e}(Ae.close),Ae.closeSync=function(t){function e(r){t.apply(Ae,arguments),ag();}return Object.defineProperty(e,ks,{value:t}),e}(Ae.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Dr(Ae[We]),G("assert").equal(Ae[We].length,0);}));var og;global[We]||ug(global,Ae[We]);vu.exports=mu(VR(Ae));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Ae.__patched&&(vu.exports=mu(Ae),Ae.__patched=!0);function mu(t){GR(t),t.gracefulify=mu,t.createReadStream=D,t.createWriteStream=W;var e=t.readFile;t.readFile=r;function r(k,U,_){return typeof U=="function"&&(_=U,U=null),Y(k,U,_);function Y(J,oe,I,P){return e(J,oe,function(re){re&&(re.code==="EMFILE"||re.code==="ENFILE")?dn([Y,[J,oe,I],re,P||Date.now(),Date.now()]):typeof I=="function"&&I.apply(this,arguments);})}}var n=t.writeFile;t.writeFile=s;function s(k,U,_,Y){return typeof _=="function"&&(Y=_,_=null),J(k,U,_,Y);function J(oe,I,P,re,Z){return n(oe,I,P,function(ce){ce&&(ce.code==="EMFILE"||ce.code==="ENFILE")?dn([J,[oe,I,P,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,_,Y){return typeof _=="function"&&(Y=_,_=null),J(k,U,_,Y);function J(oe,I,P,re,Z){return i(oe,I,P,function(ce){ce&&(ce.code==="EMFILE"||ce.code==="ENFILE")?dn([J,[oe,I,P,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,_,Y){return typeof _=="function"&&(Y=_,_=0),J(k,U,_,Y);function J(oe,I,P,re,Z){return u(oe,I,P,function(ce){ce&&(ce.code==="EMFILE"||ce.code==="ENFILE")?dn([J,[oe,I,P,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,_){typeof U=="function"&&(_=U,U=null);var Y=l.test(process.version)?function(I,P,re,Z){return p(I,J(I,P,re,Z))}:function(I,P,re,Z){return p(I,P,J(I,P,re,Z))};return Y(k,U,_);function J(oe,I,P,re){return function(Z,ce){Z&&(Z.code==="EMFILE"||Z.code==="ENFILE")?dn([Y,[oe,I,P],Z,re||Date.now(),Date.now()]):(ce&&ce.sort&&ce.sort(),typeof P=="function"&&P.call(this,Z,ce));}}}if(process.version.substr(0,4)==="v0.8"){var g=KR(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,_){U?(k.autoClose&&k.destroy(),k.emit("error",U)):(k.fd=_,k.emit("open",_),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,_){U?(k.destroy(),k.emit("error",U)):(k.fd=_,k.emit("open",_));});}function D(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,_,Y){return typeof _=="function"&&(Y=_,_=null),J(k,U,_,Y);function J(oe,I,P,re,Z){return H(oe,I,P,function(ce,Ve){ce&&(ce.code==="EMFILE"||ce.code==="ENFILE")?dn([J,[oe,I,P,re],ce,Z||Date.now(),Date.now()]):typeof re=="function"&&re.apply(this,arguments);})}}return t}function dn(t){Dr("ENQUEUE",t[0].name,t[1]),Ae[We].push(t),wu();}var Fs;function ag(){for(var t=Date.now(),e=0;e2&&(Ae[We][e][3]=t,Ae[We][e][4]=t);wu();}function wu(){if(clearTimeout(Fs),Fs=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)Dr("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-s>=6e4){Dr("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?(Dr("RETRY",e.name,r),e.apply(null,r.concat([s]))):Ae[We].push(t);}Fs===void 0&&(Fs=setTimeout(wu,0));}}});var Br=C(Jt=>{var lg=Ze().fromCallback,Ye=et(),JR=["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);JR.forEach(t=>{Jt[t]=lg(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=lg(Ye.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003");});var fg=C((SN,cg)=>{var XR=G("path");cg.exports.checkPath=function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(XR.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}};});var yg=C((bN,Su)=>{var hg=Br(),{checkPath:pg}=fg(),dg=t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode};Su.exports.makeDir=async(t,e)=>(pg(t),hg.mkdir(t,{mode:dg(e),recursive:!0}));Su.exports.makeDirSync=(t,e)=>(pg(t),hg.mkdirSync(t,{mode:dg(e),recursive:!0}));});var Ct=C((EN,gg)=>{var QR=Ze().fromPromise,{makeDir:ZR,makeDirSync:bu}=yg(),Eu=QR(ZR);gg.exports={mkdirs:Eu,mkdirsSync:bu,mkdirp:Eu,mkdirpSync:bu,ensureDir:Eu,ensureDirSync:bu};});var gr=C((xN,wg)=>{var eC=Ze().fromPromise,mg=Br();function tC(t){return mg.access(t).then(()=>!0).catch(()=>!1)}wg.exports={pathExists:eC(tC),pathExistsSync:mg.existsSync};});var xu=C((AN,vg)=>{var yn=et();function rC(t,e,r,n){yn.open(t,"r+",(s,i)=>{if(s)return n(s);yn.futimes(i,e,r,o=>{yn.close(i,u=>{n&&n(o||u);});});});}function nC(t,e,r){let n=yn.openSync(t,"r+");return yn.futimesSync(n,e,r),yn.closeSync(n)}vg.exports={utimesMillis:rC,utimesMillisSync:nC};});var Nr=C((_N,Eg)=>{var gn=Br(),ke=G("path"),iC=G("util");function sC(t,e,r){let n=r.dereference?s=>gn.stat(s,{bigint:!0}):s=>gn.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 oC(t,e,r){let n,s=r.dereference?o=>gn.statSync(o,{bigint:!0}):o=>gn.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 aC(t,e,r,n,s){iC.callbackify(sC)(t,e,n,(i,o)=>{if(i)return s(i);let{srcStat:u,destStat:c}=o;if(c){if(ai(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()&&Au(t,e)?s(new Error(Ls(t,e,r))):s(null,{srcStat:u,destStat:c})});}function uC(t,e,r,n){let{srcStat:s,destStat:i}=oC(t,e,n);if(i){if(ai(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()&&Au(t,e))throw new Error(Ls(t,e,r));return {srcStat:s,destStat:i}}function Sg(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();gn.stat(o,{bigint:!0},(u,c)=>u?u.code==="ENOENT"?s():s(u):ai(e,c)?s(new Error(Ls(t,r,n))):Sg(t,e,o,n,s));}function bg(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=gn.statSync(i,{bigint:!0});}catch(u){if(u.code==="ENOENT")return;throw u}if(ai(e,o))throw new Error(Ls(t,r,n));return bg(t,e,i,n)}function ai(t,e){return e.ino&&e.dev&&e.ino===t.ino&&e.dev===t.dev}function Au(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 Ls(t,e,r){return `Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}Eg.exports={checkPaths:aC,checkPathsSync:uC,checkParentPaths:Sg,checkParentPathsSync:bg,isSrcSubdir:Au,areIdentical:ai};});var Og=C((RN,Cg)=>{var tt=et(),ui=G("path"),lC=Ct().mkdirs,cC=gr().pathExists,fC=xu().utimesMillis,li=Nr();function hC(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"),li.checkPaths(t,e,"copy",r,(s,i)=>{if(s)return n(s);let{srcStat:o,destStat:u}=i;li.checkParentPaths(t,o,e,"copy",c=>{if(c)return n(c);Ag(t,e,r,(p,l)=>{if(p)return n(p);if(!l)return n();pC(u,t,e,r,n);});});});}function pC(t,e,r,n,s){let i=ui.dirname(r);cC(i,(o,u)=>{if(o)return s(o);if(u)return _u(t,e,r,n,s);lC(i,c=>c?s(c):_u(t,e,r,n,s));});}function Ag(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()?SC(u,t,e,r,n,s):u.isFile()||u.isCharacterDevice()||u.isBlockDevice()?dC(u,t,e,r,n,s):u.isSymbolicLink()?xC(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 dC(t,e,r,n,s,i){return e?yC(t,r,n,s,i):_g(t,r,n,s,i)}function yC(t,e,r,n,s){if(n.overwrite)tt.unlink(r,i=>i?s(i):_g(t,e,r,n,s));else return n.errorOnExist?s(new Error(`'${r}' already exists`)):s()}function _g(t,e,r,n,s){tt.copyFile(e,r,i=>i?s(i):n.preserveTimestamps?gC(t.mode,e,r,s):Ds(r,t.mode,s));}function gC(t,e,r,n){return mC(t)?wC(r,t,s=>s?n(s):xg(t,e,r,n)):xg(t,e,r,n)}function mC(t){return (t&128)===0}function wC(t,e,r){return Ds(t,e|128,r)}function xg(t,e,r,n){vC(e,r,s=>s?n(s):Ds(r,t,n));}function Ds(t,e,r){return tt.chmod(t,e,r)}function vC(t,e,r){tt.stat(t,(n,s)=>n?r(n):fC(e,s.atime,s.mtime,r));}function SC(t,e,r,n,s,i){return e?Rg(r,n,s,i):bC(t.mode,r,n,s,i)}function bC(t,e,r,n,s){tt.mkdir(r,i=>{if(i)return s(i);Rg(e,r,n,o=>o?s(o):Ds(r,t,s));});}function Rg(t,e,r,n){tt.readdir(t,(s,i)=>s?n(s):Ru(i,t,e,r,n));}function Ru(t,e,r,n,s){let i=t.pop();return i?EC(t,i,e,r,n,s):s()}function EC(t,e,r,n,s,i){let o=ui.join(r,e),u=ui.join(n,e);Ag(o,u,s,(c,p)=>{if(c)return i(c);if(!p)return Ru(t,r,n,s,i);li.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):Ru(t,r,n,s,i));});});}function xC(t,e,r,n,s){tt.readlink(e,(i,o)=>{if(i)return s(i);if(n.dereference&&(o=ui.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=ui.resolve(process.cwd(),c)),li.isSrcSubdir(o,c)?s(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${c}'.`)):li.isSrcSubdir(c,o)?s(new Error(`Cannot overwrite '${c}' with '${o}'.`)):AC(o,r,s)));else return tt.symlink(o,r,s)});}function AC(t,e,r){tt.unlink(e,n=>n?r(n):tt.symlink(t,e,r));}Cg.exports=hC;});var Fg=C((CN,$g)=>{var Je=et(),ci=G("path"),_C=Ct().mkdirsSync,RC=xu().utimesMillisSync,fi=Nr();function CC(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}=fi.checkPathsSync(t,e,"copy",r);if(fi.checkParentPathsSync(t,n,e,"copy"),r.filter&&!r.filter(t,e))return;let i=ci.dirname(e);return Je.existsSync(i)||_C(i),Tg(s,t,e,r)}function Tg(t,e,r,n){let i=(n.dereference?Je.statSync:Je.lstatSync)(e);if(i.isDirectory())return kC(i,t,e,r,n);if(i.isFile()||i.isCharacterDevice()||i.isBlockDevice())return OC(i,t,e,r,n);if(i.isSymbolicLink())return BC(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 OC(t,e,r,n,s){return e?TC(t,r,n,s):Ig(t,r,n,s)}function TC(t,e,r,n){if(n.overwrite)return Je.unlinkSync(r),Ig(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function Ig(t,e,r,n){return Je.copyFileSync(e,r),n.preserveTimestamps&&IC(t.mode,e,r),Cu(r,t.mode)}function IC(t,e,r){return PC(t)&&$C(r,t),FC(e,r)}function PC(t){return (t&128)===0}function $C(t,e){return Cu(t,e|128)}function Cu(t,e){return Je.chmodSync(t,e)}function FC(t,e){let r=Je.statSync(t);return RC(e,r.atime,r.mtime)}function kC(t,e,r,n,s){return e?Pg(r,n,s):LC(t.mode,r,n,s)}function LC(t,e,r,n){return Je.mkdirSync(r),Pg(e,r,n),Cu(r,t)}function Pg(t,e,r){Je.readdirSync(t).forEach(n=>DC(n,t,e,r));}function DC(t,e,r,n){let s=ci.join(e,t),i=ci.join(r,t);if(n.filter&&!n.filter(s,i))return;let{destStat:o}=fi.checkPathsSync(s,i,"copy",n);return Tg(o,s,i,n)}function BC(t,e,r,n){let s=Je.readlinkSync(e);if(n.dereference&&(s=ci.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=ci.resolve(process.cwd(),i)),fi.isSrcSubdir(s,i))throw new Error(`Cannot copy '${s}' to a subdirectory of itself, '${i}'.`);if(fi.isSrcSubdir(i,s))throw new Error(`Cannot overwrite '${i}' with '${s}'.`);return NC(s,r)}else return Je.symlinkSync(s,r)}function NC(t,e){return Je.unlinkSync(e),Je.symlinkSync(t,e)}$g.exports=CC;});var Bs=C((ON,kg)=>{var qC=Ze().fromCallback;kg.exports={copy:qC(Og()),copySync:Fg()};});var hi=C((TN,Dg)=>{var Lg=et(),MC=Ze().fromCallback;function UC(t,e){Lg.rm(t,{recursive:!0,force:!0},e);}function jC(t){Lg.rmSync(t,{recursive:!0,force:!0});}Dg.exports={remove:MC(UC),removeSync:jC};});var Wg=C((IN,Hg)=>{var HC=Ze().fromPromise,qg=Br(),Mg=G("path"),Ug=Ct(),jg=hi(),Bg=HC(async function(e){let r;try{r=await qg.readdir(e);}catch{return Ug.mkdirs(e)}return Promise.all(r.map(n=>jg.remove(Mg.join(e,n))))});function Ng(t){let e;try{e=qg.readdirSync(t);}catch{return Ug.mkdirsSync(t)}e.forEach(r=>{r=Mg.join(t,r),jg.removeSync(r);});}Hg.exports={emptyDirSync:Ng,emptydirSync:Ng,emptyDir:Bg,emptydir:Bg};});var Vg=C((PN,Kg)=>{var WC=Ze().fromCallback,zg=G("path"),mr=et(),Gg=Ct();function zC(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=zg.dirname(t);mr.stat(i,(o,u)=>{if(o)return o.code==="ENOENT"?Gg.mkdirs(i,c=>{if(c)return e(c);r();}):e(o);u.isDirectory()?r():mr.readdir(i,c=>{if(c)return e(c)});});});}function GC(t){let e;try{e=mr.statSync(t);}catch{}if(e&&e.isFile())return;let r=zg.dirname(t);try{mr.statSync(r).isDirectory()||mr.readdirSync(r);}catch(n){if(n&&n.code==="ENOENT")Gg.mkdirsSync(r);else throw n}mr.writeFileSync(t,"");}Kg.exports={createFile:WC(zC),createFileSync:GC};});var Zg=C(($N,Qg)=>{var KC=Ze().fromCallback,Yg=G("path"),wr=et(),Jg=Ct(),VC=gr().pathExists,{areIdentical:Xg}=Nr();function YC(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&&Xg(u,i))return r(null);let c=Yg.dirname(e);VC(c,(p,l)=>{if(p)return r(p);if(l)return n(t,e);Jg.mkdirs(c,d=>{if(d)return r(d);n(t,e);});});});});}function JC(t,e){let r;try{r=wr.lstatSync(e);}catch{}try{let i=wr.lstatSync(t);if(r&&Xg(i,r))return}catch(i){throw i.message=i.message.replace("lstat","ensureLink"),i}let n=Yg.dirname(e);return wr.existsSync(n)||Jg.mkdirsSync(n),wr.linkSync(t,e)}Qg.exports={createLink:KC(YC),createLinkSync:JC};});var tm=C((FN,em)=>{var vr=G("path"),pi=et(),XC=gr().pathExists;function QC(t,e,r){if(vr.isAbsolute(t))return pi.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 XC(s,(i,o)=>i?r(i):o?r(null,{toCwd:s,toDst:t}):pi.lstat(t,u=>u?(u.message=u.message.replace("lstat","ensureSymlink"),r(u)):r(null,{toCwd:t,toDst:vr.relative(n,t)})))}}function ZC(t,e){let r;if(vr.isAbsolute(t)){if(r=pi.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=pi.existsSync(s),r)return {toCwd:s,toDst:t};if(r=pi.existsSync(t),!r)throw new Error("relative srcpath does not exist");return {toCwd:t,toDst:vr.relative(n,t)}}}em.exports={symlinkPaths:QC,symlinkPathsSync:ZC};});var im=C((kN,nm)=>{var rm=et();function eO(t,e,r){if(r=typeof e=="function"?e:r,e=typeof e=="function"?!1:e,e)return r(null,e);rm.lstat(t,(n,s)=>{if(n)return r(null,"file");e=s&&s.isDirectory()?"dir":"file",r(null,e);});}function tO(t,e){let r;if(e)return e;try{r=rm.lstatSync(t);}catch{return "file"}return r&&r.isDirectory()?"dir":"file"}nm.exports={symlinkType:eO,symlinkTypeSync:tO};});var hm=C((LN,fm)=>{var rO=Ze().fromCallback,om=G("path"),Ot=Br(),am=Ct(),nO=am.mkdirs,iO=am.mkdirsSync,um=tm(),sO=um.symlinkPaths,oO=um.symlinkPathsSync,lm=im(),aO=lm.symlinkType,uO=lm.symlinkTypeSync,lO=gr().pathExists,{areIdentical:cm}=Nr();function cO(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(cm(o,u))return n(null);sm(t,e,r,n);}):sm(t,e,r,n);});}function sm(t,e,r,n){sO(t,e,(s,i)=>{if(s)return n(s);t=i.toDst,aO(i.toCwd,r,(o,u)=>{if(o)return n(o);let c=om.dirname(e);lO(c,(p,l)=>{if(p)return n(p);if(l)return Ot.symlink(t,e,u,n);nO(c,d=>{if(d)return n(d);Ot.symlink(t,e,u,n);});});});});}function fO(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(cm(u,c))return}let s=oO(t,e);t=s.toDst,r=uO(s.toCwd,r);let i=om.dirname(e);return Ot.existsSync(i)||iO(i),Ot.symlinkSync(t,e,r)}fm.exports={createSymlink:rO(cO),createSymlinkSync:fO};});var Sm=C((DN,vm)=>{var{createFile:pm,createFileSync:dm}=Vg(),{createLink:ym,createLinkSync:gm}=Zg(),{createSymlink:mm,createSymlinkSync:wm}=hm();vm.exports={createFile:pm,createFileSync:dm,ensureFile:pm,ensureFileSync:dm,createLink:ym,createLinkSync:gm,ensureLink:ym,ensureLinkSync:gm,createSymlink:mm,createSymlinkSync:wm,ensureSymlink:mm,ensureSymlinkSync:wm};});var Ns=C((BN,bm)=>{function hO(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 pO(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}bm.exports={stringify:hO,stripBom:pO};});var _m=C((NN,Am)=>{var mn;try{mn=et();}catch{mn=G("fs");}var qs=Ze(),{stringify:Em,stripBom:xm}=Ns();async function dO(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||mn,n="throws"in e?e.throws:!0,s=await qs.fromCallback(r.readFile)(t,e);s=xm(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 yO=qs.fromPromise(dO);function gO(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||mn,n="throws"in e?e.throws:!0;try{let s=r.readFileSync(t,e);return s=xm(s),JSON.parse(s,e.reviver)}catch(s){if(n)throw s.message=`${t}: ${s.message}`,s;return null}}async function mO(t,e,r={}){let n=r.fs||mn,s=Em(e,r);await qs.fromCallback(n.writeFile)(t,s,r);}var wO=qs.fromPromise(mO);function vO(t,e,r={}){let n=r.fs||mn,s=Em(e,r);return n.writeFileSync(t,s,r)}var SO={readFile:yO,readFileSync:gO,writeFile:wO,writeFileSync:vO};Am.exports=SO;});var Cm=C((qN,Rm)=>{var Ms=_m();Rm.exports={readJson:Ms.readFile,readJsonSync:Ms.readFileSync,writeJson:Ms.writeFile,writeJsonSync:Ms.writeFileSync};});var Us=C((MN,Im)=>{var bO=Ze().fromCallback,di=et(),Om=G("path"),Tm=Ct(),EO=gr().pathExists;function xO(t,e,r,n){typeof r=="function"&&(n=r,r="utf8");let s=Om.dirname(t);EO(s,(i,o)=>{if(i)return n(i);if(o)return di.writeFile(t,e,r,n);Tm.mkdirs(s,u=>{if(u)return n(u);di.writeFile(t,e,r,n);});});}function AO(t,...e){let r=Om.dirname(t);if(di.existsSync(r))return di.writeFileSync(t,...e);Tm.mkdirsSync(r),di.writeFileSync(t,...e);}Im.exports={outputFile:bO(xO),outputFileSync:AO};});var $m=C((UN,Pm)=>{var{stringify:_O}=Ns(),{outputFile:RO}=Us();async function CO(t,e,r={}){let n=_O(e,r);await RO(t,n,r);}Pm.exports=CO;});var km=C((jN,Fm)=>{var{stringify:OO}=Ns(),{outputFileSync:TO}=Us();function IO(t,e,r){let n=OO(e,r);TO(t,n,r);}Fm.exports=IO;});var Dm=C((HN,Lm)=>{var PO=Ze().fromPromise,Xe=Cm();Xe.outputJson=PO($m());Xe.outputJsonSync=km();Xe.outputJSON=Xe.outputJson;Xe.outputJSONSync=Xe.outputJsonSync;Xe.writeJSON=Xe.writeJson;Xe.writeJSONSync=Xe.writeJsonSync;Xe.readJSON=Xe.readJson;Xe.readJSONSync=Xe.readJsonSync;Lm.exports=Xe;});var Um=C((WN,Mm)=>{var $O=et(),Tu=G("path"),FO=Bs().copy,qm=hi().remove,kO=Ct().mkdirp,LO=gr().pathExists,Bm=Nr();function DO(t,e,r,n){typeof r=="function"&&(n=r,r={}),r=r||{};let s=r.overwrite||r.clobber||!1;Bm.checkPaths(t,e,"move",r,(i,o)=>{if(i)return n(i);let{srcStat:u,isChangingCase:c=!1}=o;Bm.checkParentPaths(t,u,e,"move",p=>{if(p)return n(p);if(BO(e))return Nm(t,e,s,c,n);kO(Tu.dirname(e),l=>l?n(l):Nm(t,e,s,c,n));});});}function BO(t){let e=Tu.dirname(t);return Tu.parse(e).root===e}function Nm(t,e,r,n,s){if(n)return Ou(t,e,r,s);if(r)return qm(e,i=>i?s(i):Ou(t,e,r,s));LO(e,(i,o)=>i?s(i):o?s(new Error("dest already exists.")):Ou(t,e,r,s));}function Ou(t,e,r,n){$O.rename(t,e,s=>s?s.code!=="EXDEV"?n(s):NO(t,e,r,n):n());}function NO(t,e,r,n){FO(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0},i=>i?n(i):qm(t,n));}Mm.exports=DO;});var Gm=C((zN,zm)=>{var Hm=et(),Pu=G("path"),qO=Bs().copySync,Wm=hi().removeSync,MO=Ct().mkdirpSync,jm=Nr();function UO(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:s,isChangingCase:i=!1}=jm.checkPathsSync(t,e,"move",r);return jm.checkParentPathsSync(t,s,e,"move"),jO(e)||MO(Pu.dirname(e)),HO(t,e,n,i)}function jO(t){let e=Pu.dirname(t);return Pu.parse(e).root===e}function HO(t,e,r,n){if(n)return Iu(t,e,r);if(r)return Wm(e),Iu(t,e,r);if(Hm.existsSync(e))throw new Error("dest already exists.");return Iu(t,e,r)}function Iu(t,e,r){try{Hm.renameSync(t,e);}catch(n){if(n.code!=="EXDEV")throw n;return WO(t,e,r)}}function WO(t,e,r){return qO(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),Wm(t)}zm.exports=UO;});var Vm=C((GN,Km)=>{var zO=Ze().fromCallback;Km.exports={move:zO(Um()),moveSync:Gm()};});var $u=C((KN,Ym)=>{Ym.exports={...Br(),...Bs(),...Wg(),...Sm(),...Dm(),...Ct(),...Vm(),...Us(),...gr(),...hi()};});var ku=C((JN,Qm)=>{var yi=t=>t&&typeof t.message=="string",Fu=t=>{if(!t)return;let e=t.cause;if(typeof e=="function"){let r=t.cause();return yi(r)?r:void 0}else return yi(e)?e:void 0},Jm=(t,e)=>{if(!yi(t))return "";let r=t.stack||"";if(e.has(t))return r+` causes have become circular...`;let n=Fu(t);return n?(e.add(t),r+` caused by: `+Jm(n,e)):r},GO=t=>Jm(t,new Set),Xm=(t,e,r)=>{if(!yi(t))return "";let n=r?"":t.message||"";if(e.has(t))return n+": ...";let s=Fu(t);if(s){e.add(t);let i=typeof t.cause=="function";return n+(i?"":": ")+Xm(s,e,i)}else return n},KO=t=>Xm(t,new Set);Qm.exports={isErrorLike:yi,getErrorCause:Fu,stackWithCauses:GO,messageWithCauses:KO};});var Lu=C((XN,ew)=>{var VO=Symbol("circular-ref-tag"),Hs=Symbol("pino-raw-err-ref"),Zm=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[Hs]},set:function(t){this[Hs]=t;}}});Object.defineProperty(Zm,Hs,{writable:!0,value:{}});ew.exports={pinoErrProto:Zm,pinoErrorSymbols:{seen:VO,rawSymbol:Hs}};});var nw=C((QN,rw)=>{rw.exports=Bu;var{messageWithCauses:YO,stackWithCauses:JO,isErrorLike:tw}=ku(),{pinoErrProto:XO,pinoErrorSymbols:QO}=Lu(),{seen:Du}=QO,{toString:ZO}=Object.prototype;function Bu(t){if(!tw(t))return t;t[Du]=void 0;let e=Object.create(XO);e.type=ZO.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=YO(t),e.stack=JO(t),Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>Bu(r)));for(let r in t)if(e[r]===void 0){let n=t[r];tw(n)?r!=="cause"&&!Object.prototype.hasOwnProperty.call(n,Du)&&(e[r]=Bu(n)):e[r]=n;}return delete t[Du],e.raw=t,e}});var sw=C((ZN,iw)=>{iw.exports=zs;var{isErrorLike:Nu}=ku(),{pinoErrProto:eT,pinoErrorSymbols:tT}=Lu(),{seen:Ws}=tT,{toString:rT}=Object.prototype;function zs(t){if(!Nu(t))return t;t[Ws]=void 0;let e=Object.create(eT);e.type=rT.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=>zs(r))),Nu(t.cause)&&!Object.prototype.hasOwnProperty.call(t.cause,Ws)&&(e.cause=zs(t.cause));for(let r in t)if(e[r]===void 0){let n=t[r];Nu(n)?Object.prototype.hasOwnProperty.call(n,Ws)||(e[r]=zs(n)):e[r]=n;}return delete t[Ws],e.raw=t,e}});var lw=C((eq,uw)=>{uw.exports={mapHttpRequest:nT,reqSerializer:aw};var qu=Symbol("pino-raw-req-ref"),ow=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[qu]},set:function(t){this[qu]=t;}}});Object.defineProperty(ow,qu,{writable:!0,value:{}});function aw(t){let e=t.info||t.socket,r=Object.create(ow);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 nT(t){return {req:aw(t)}}});var pw=C((tq,hw)=>{hw.exports={mapHttpResponse:iT,resSerializer:fw};var Mu=Symbol("pino-raw-res-ref"),cw=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Mu]},set:function(t){this[Mu]=t;}}});Object.defineProperty(cw,Mu,{writable:!0,value:{}});function fw(t){let e=Object.create(cw);return e.statusCode=t.headersSent?t.statusCode:null,e.headers=t.getHeaders?t.getHeaders():t._headers,e.raw=t,e}function iT(t){return {res:fw(t)}}});var ju=C((rq,dw)=>{var Uu=nw(),sT=sw(),Gs=lw(),Ks=pw();dw.exports={err:Uu,errWithCause:sT,mapHttpRequest:Gs.mapHttpRequest,mapHttpResponse:Ks.mapHttpResponse,req:Gs.reqSerializer,res:Ks.resSerializer,wrapErrorSerializer:function(e){return e===Uu?e:function(n){return e(Uu(n))}},wrapRequestSerializer:function(e){return e===Gs.reqSerializer?e:function(n){return e(Gs.reqSerializer(n))}},wrapResponseSerializer:function(e){return e===Ks.resSerializer?e:function(n){return e(Ks.resSerializer(n))}}};});var Hu=C((nq,yw)=>{function oT(t,e){return e}yw.exports=function(){let e=Error.prepareStackTrace;Error.prepareStackTrace=oT;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 mw=C((iq,gw)=>{gw.exports=aT;function aT(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 Vs=C((sq,ww)=>{ww.exports=/[^.[\]]+|\[((?:.)*?)\]/g;});var Sw=C((oq,vw)=>{var uT=Vs();vw.exports=lT;function lT({paths:t}){let e=[];var r=0;let n=t.reduce(function(s,i,o){var u=i.match(uT).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 Ew=C((aq,bw)=>{var cT=Vs();bw.exports=fT;function fT({secret:t,serialize:e,wcLen:r,strict:n,isCensorFct:s,censorFctTakesPath:i},o){let u=Function("o",` if (typeof o !== 'object' || o == null) { ${yT(n,e)} } const { censor, secret } = this ${hT(t,s,i)} this.compileRestore() ${pT(r>0,s,i)} ${dT(e)} `).bind(o);return e===!1&&(u.restore=c=>o.restore(c)),u}function hT(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=cT.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=` switch (true) { ${p.reverse().map(w=>` case o${c}${w} === censor: secret[${s}].circle = ${JSON.stringify(w)} break `).join(` `)} } `,m=r?`val, ${JSON.stringify(o)}`:"val";return ` if (${d}) { 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} } } `}).join(` `)}function pT(t,e,r){return t===!0?` { const { wildcards, wcLen, groupRedact, nestedRedact } = this for (var i = 0; i < wcLen; i++) { const { before, beforeStr, after, nested } = wildcards[i] if (nested === true) { secret[beforeStr] = secret[beforeStr] || [] nestedRedact(secret[beforeStr], o, before, after, censor, ${e}, ${r}) } else secret[beforeStr] = groupRedact(o, before, censor, ${e}, ${r}) } } `:""}function dT(t){return t===!1?"return o":` var s = this.serialize(o) this.restore(o) return s `}function yT(t,e){return t===!0?"throw Error('fast-redact: primitives cannot be redacted')":e===!1?"return o":"return this.serialize(o)"}});var zu=C((uq,_w)=>{_w.exports={groupRedact:mT,groupRestore:gT,nestedRedact:vT,nestedRestore:wT};function gT({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 vT(t,e,r,n,s,i,o){let u=xw(e,r);if(u==null)return;let c=Object.keys(u),p=c.length;for(var l=0;l{var{groupRestore:ET,nestedRestore:xT}=zu();Rw.exports=AT;function AT({secret:t,wcLen:e}){return function(){if(this.restore)return;let n=Object.keys(t),s=_T(t,n),i=e>0,o=i?{secret:t,groupRestore:ET,nestedRestore:xT}:{secret:t};this.restore=Function("o",RT(s,n,i)).bind(o);}}function _T(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 ` if (secret[${s}].val !== undefined) { try { ${u} } catch (e) {} ${c} } `}).join("")}function RT(t,e,r){return ` const secret = this.secret ${r===!0?` const keys = Object.keys(secret) const len = keys.length for (var i = len - 1; i >= ${e.length}; i--) { const k = keys[i] const o = secret[k] if (o.flat === true) this.groupRestore(o) else this.nestedRestore(o) secret[k] = null } `:""} ${t} return o `}});var Tw=C((cq,Ow)=>{Ow.exports=CT;function CT(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 $w=C((fq,Pw)=>{var Iw=mw(),OT=Sw(),TT=Ew(),IT=Cw(),{groupRedact:PT,nestedRedact:$T}=zu(),FT=Tw(),kT=Vs(),LT=Iw(),Gu=t=>t;Gu.restore=Gu;var DT="[REDACTED]";Ku.rx=kT;Ku.validator=Iw;Pw.exports=Ku;function Ku(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:DT,i=typeof s=="function",o=i&&s.length>1;if(e.length===0)return r||Gu;LT({paths:e,serialize:r,censor:s});let{wildcards:u,wcLen:c,secret:p}=OT({paths:e,censor:s}),l=IT({secret:p,wcLen:c}),d="strict"in t?t.strict:!0;return TT({secret:p,wcLen:c,serialize:r,strict:d,isCensorFct:i,censorFctTakesPath:o},FT({secret:p,censor:s,compileRestore:l,serialize:r,groupRedact:PT,nestedRedact:$T,wildcards:u,wcLen:c}))}});var wn=C((hq,Fw)=>{var BT=Symbol("pino.setLevel"),NT=Symbol("pino.getLevel"),qT=Symbol("pino.levelVal"),MT=Symbol("pino.useLevelLabels"),UT=Symbol("pino.useOnlyCustomLevels"),jT=Symbol("pino.mixin"),HT=Symbol("pino.lsCache"),WT=Symbol("pino.chindings"),zT=Symbol("pino.asJson"),GT=Symbol("pino.write"),KT=Symbol("pino.redactFmt"),VT=Symbol("pino.time"),YT=Symbol("pino.timeSliceIndex"),JT=Symbol("pino.stream"),XT=Symbol("pino.stringify"),QT=Symbol("pino.stringifySafe"),ZT=Symbol("pino.stringifiers"),eI=Symbol("pino.end"),tI=Symbol("pino.formatOpts"),rI=Symbol("pino.messageKey"),nI=Symbol("pino.errorKey"),iI=Symbol("pino.nestedKey"),sI=Symbol("pino.nestedKeyStr"),oI=Symbol("pino.mixinMergeStrategy"),aI=Symbol("pino.msgPrefix"),uI=Symbol("pino.wildcardFirst"),lI=Symbol.for("pino.serializers"),cI=Symbol.for("pino.formatters"),fI=Symbol.for("pino.hooks"),hI=Symbol.for("pino.metadata");Fw.exports={setLevelSym:BT,getLevelSym:NT,levelValSym:qT,useLevelLabelsSym:MT,mixinSym:jT,lsCacheSym:HT,chindingsSym:WT,asJsonSym:zT,writeSym:GT,serializersSym:lI,redactFmtSym:KT,timeSym:VT,timeSliceIndexSym:YT,streamSym:JT,stringifySym:XT,stringifySafeSym:QT,stringifiersSym:ZT,endSym:eI,formatOptsSym:tI,messageKeySym:rI,errorKeySym:nI,nestedKeySym:iI,wildcardFirstSym:uI,needsMetadataGsym:hI,useOnlyCustomLevelsSym:UT,formattersSym:cI,hooksSym:fI,nestedKeyStrSym:sI,mixinMergeStrategySym:oI,msgPrefixSym:aI};});var Ju=C((pq,Bw)=>{var Yu=$w(),{redactFmtSym:pI,wildcardFirstSym:Ys}=wn(),{rx:Vu,validator:dI}=Yu,kw=dI({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})`}),Lw="[Redacted]",Dw=!1;function yI(t,e){let{paths:r,censor:n}=gI(t),s=r.reduce((u,c)=>{Vu.lastIndex=0;let p=Vu.exec(c),l=Vu.exec(c),d=p[1]!==void 0?p[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):p[0];if(d==="*"&&(d=Ys),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!==Ys&&u[d].length===0&&u[d].push(...u[Ys]||[]),d===Ys&&Object.keys(u).forEach(function(w){u[w]&&u[w].push(m);}),u[d].push(m),u},{}),i={[pI]:Yu({paths:r,censor:n,serialize:e,strict:Dw})},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]=Yu({paths:s[c],censor:p,serialize:e,strict:Dw});}return u},i)}function gI(t){if(Array.isArray(t))return t={paths:t,censor:Lw},kw(t),t;let{paths:e,censor:r=Lw,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),kw({paths:e,censor:r}),{paths:e,censor:r}}Bw.exports=yI;});var qw=C((dq,Nw)=>{var mI=()=>"",wI=()=>`,"time":${Date.now()}`,vI=()=>`,"time":${Math.round(Date.now()/1e3)}`,SI=()=>`,"time":"${new Date(Date.now()).toISOString()}"`;Nw.exports={nullTime:mI,epochTime:wI,unixTime:vI,isoTime:SI};});var Uw=C((yq,Mw)=>{function bI(t){try{return JSON.stringify(t)}catch{return '"[Circular]"'}}Mw.exports=EI;function EI(t,e,r){var n=r&&r.stringify||bI,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));Xu.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");};Xu.exports=t;}});var Gw=C((mq,zw)=>{var rt=G("fs"),xI=G("events"),AI=G("util").inherits,jw=G("path"),Hw=Qu(),Zu=100,_I=16*1024;function Ww(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&&vn(e);}let n=e.append?"a":"w",s=e.mode;if(e.sync)try{e.mkdir&&rt.mkdirSync(jw.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(jw.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||_I,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")Ww(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{Hw(Zu),this.release(void 0,0);}catch(E){this.release(E);}else setTimeout(()=>{rt.write(this.fd,this._writingBuf,"utf8",this.release);},Zu);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?vn(this):this._ending?w>0?vn(this):(this._writing=!1,Js(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(RI,this)):this.emit("drain"));},this.on("newListener",function(g){g==="drain"&&(this._asyncDrainScheduled=!1);});}function RI(t){t.listenerCount("drain")>0&&(t._asyncDrainScheduled=!1,t.emit("drain"));}AI(nt,xI);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&&vn(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)});}),Ww(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?vn(this):Js(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;Hw(Zu);}}};nt.prototype.destroy=function(){this.destroyed||Js(this);};function vn(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 Js(t){if(t.fd===-1){t.once("ready",Js.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;zw.exports=nt;});var el=C((wq,Qw)=>{var br={exit:[],beforeExit:[]},Kw={exit:OI,beforeExit:TI},Vw=new FinalizationRegistry(II);function CI(t){br[t].length>0||process.on(t,Kw[t]);}function Yw(t){br[t].length>0||process.removeListener(t,Kw[t]);}function OI(){Jw("exit");}function TI(){Jw("beforeExit");}function Jw(t){for(let e of br[t]){let r=e.deref(),n=e.fn;r!==void 0&&n(r,t);}}function II(t){for(let e of ["exit","beforeExit"]){let r=br[e].indexOf(t);br[e].splice(r,r+1),Yw(e);}}function Xw(t,e,r){if(e===void 0)throw new Error("the object can't be undefined");CI(t);let n=new WeakRef(e);n.fn=r,Vw.register(e,n),br[t].push(n);}function PI(t,e){Xw("exit",t,e);}function $I(t,e){Xw("beforeExit",t,e);}function FI(t){Vw.unregister(t);for(let e of ["exit","beforeExit"])br[e]=br[e].filter(r=>{let n=r.deref();return n&&n!==t}),Yw(e);}Qw.exports={register:PI,registerBeforeExit:$I,unregister:FI};});var Zw=C((vq,kI)=>{kI.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 t0=C((Sq,e0)=>{function LI(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 DI(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);}e0.exports={wait:LI,waitDiff:DI};});var n0=C((bq,r0)=>{r0.exports={WRITE_INDEX:4,READ_INDEX:8};});var u0=C((xq,a0)=>{var{version:BI}=Zw(),{EventEmitter:NI}=G("events"),{Worker:qI}=G("worker_threads"),{join:MI}=G("path"),{pathToFileURL:UI}=G("url"),{wait:jI}=t0(),{WRITE_INDEX:it,READ_INDEX:qt}=n0(),HI=G("buffer"),WI=G("assert"),N=Symbol("kImpl"),zI=HI.constants.MAX_STRING_LENGTH,Qs=class{constructor(e){this._value=e;}deref(){return this._value}},GI=global.FinalizationRegistry||class{register(){}unregister(){}},KI=global.WeakRef||Qs,i0=new GI(t=>{t.exited||t.terminate();});function VI(t,e){let{filename:r,workerData:n}=e,i=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||MI(__dirname,"lib","worker.js"),o=new qI(i,{...e.workerOpts,trackUnmanagedFds:!1,workerData:{filename:r.indexOf("file://")===0?r:UI(r).href,dataBuf:t[N].dataBuf,stateBuf:t[N].stateBuf,workerData:{$context:{threadStreamVersion:BI},...n}}});return o.stream=new Qs(t),o.on("message",YI),o.on("exit",o0),i0.register(t,o),o}function s0(t){WI(!t[N].sync),t[N].needDrain&&(t[N].needDrain=!1,t.emit("drain"));}function Xs(t){let e=Atomics.load(t[N].state,it),r=t[N].data.length-e;if(r>0){if(t[N].buf.length===0){t[N].flushing=!1,t[N].ending?sl(t):t[N].needDrain&&process.nextTick(s0,t);return}let n=t[N].buf.slice(0,r),s=Buffer.byteLength(n);s<=r?(t[N].buf=t[N].buf.slice(r),Zs(t,n,Xs.bind(null,t))):t.flush(()=>{if(!t.destroyed){for(Atomics.store(t[N].state,qt,0),Atomics.store(t[N].state,it,0);s>t[N].data.length;)r=r/2,n=t[N].buf.slice(0,r),s=Buffer.byteLength(n);t[N].buf=t[N].buf.slice(r),Zs(t,n,Xs.bind(null,t));}});}else if(r===0){if(e===0&&t[N].buf.length===0)return;t.flush(()=>{Atomics.store(t[N].state,qt,0),Atomics.store(t[N].state,it,0),Xs(t);});}else Mt(t,new Error("overwritten"));}function YI(t){let e=this.stream.deref();if(e===void 0){this.exited=!0,this.terminate();return}switch(t.code){case"READY":this.stream=new KI(e),e.flush(()=>{e[N].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 o0(t){let e=this.stream.deref();e!==void 0&&(i0.unregister(e),e.worker.exited=!0,e.worker.off("exit",o0),Mt(e,t!==0?new Error("the worker thread exited"):null));}var rl=class extends NI{constructor(e={}){if(super(),e.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[N]={},this[N].stateBuf=new SharedArrayBuffer(128),this[N].state=new Int32Array(this[N].stateBuf),this[N].dataBuf=new SharedArrayBuffer(e.bufferSize||4*1024*1024),this[N].data=Buffer.from(this[N].dataBuf),this[N].sync=e.sync||!1,this[N].ending=!1,this[N].ended=!1,this[N].needDrain=!1,this[N].destroyed=!1,this[N].flushing=!1,this[N].ready=!1,this[N].finished=!1,this[N].errored=null,this[N].closed=!1,this[N].buf="",this.worker=VI(this,e);}write(e){if(this[N].destroyed)return nl(this,new Error("the worker has exited")),!1;if(this[N].ending)return nl(this,new Error("the worker is ending")),!1;if(this[N].flushing&&this[N].buf.length+e.length>=zI)try{tl(this),this[N].flushing=!0;}catch(r){return Mt(this,r),!1}if(this[N].buf+=e,this[N].sync)try{return tl(this),!0}catch(r){return Mt(this,r),!1}return this[N].flushing||(this[N].flushing=!0,setImmediate(Xs,this)),this[N].needDrain=this[N].data.length-this[N].buf.length-Atomics.load(this[N].state,it)<=0,!this[N].needDrain}end(){this[N].destroyed||(this[N].ending=!0,sl(this));}flush(e){if(this[N].destroyed){typeof e=="function"&&process.nextTick(e,new Error("the worker has exited"));return}let r=Atomics.load(this[N].state,it);jI(this[N].state,qt,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[N].destroyed||(tl(this),il(this));}unref(){this.worker.unref();}ref(){this.worker.ref();}get ready(){return this[N].ready}get destroyed(){return this[N].destroyed}get closed(){return this[N].closed}get writable(){return !this[N].destroyed&&!this[N].ending}get writableEnded(){return this[N].ending}get writableFinished(){return this[N].finished}get writableNeedDrain(){return this[N].needDrain}get writableObjectMode(){return !1}get writableErrored(){return this[N].errored}};function nl(t,e){setImmediate(()=>{t.emit("error",e);});}function Mt(t,e){t[N].destroyed||(t[N].destroyed=!0,e&&(t[N].errored=e,nl(t,e)),t.worker.exited?setImmediate(()=>{t[N].closed=!0,t.emit("close");}):t.worker.terminate().catch(()=>{}).then(()=>{t[N].closed=!0,t.emit("close");}));}function Zs(t,e,r){let n=Atomics.load(t[N].state,it),s=Buffer.byteLength(e);return t[N].data.write(e,n),Atomics.store(t[N].state,it,n+s),Atomics.notify(t[N].state,it),r(),!0}function sl(t){if(!(t[N].ended||!t[N].ending||t[N].flushing)){t[N].ended=!0;try{t.flushSync();let e=Atomics.load(t[N].state,qt);Atomics.store(t[N].state,it,-1),Atomics.notify(t[N].state,it);let r=0;for(;e!==-1;){if(Atomics.wait(t[N].state,qt,e,1e3),e=Atomics.load(t[N].state,qt),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[N].finished=!0,t.emit("finish");});}catch(e){Mt(t,e);}}}function tl(t){let e=()=>{t[N].ending?sl(t):t[N].needDrain&&process.nextTick(s0,t);};for(t[N].flushing=!1;t[N].buf.length!==0;){let r=Atomics.load(t[N].state,it),n=t[N].data.length-r;if(n===0){il(t),Atomics.store(t[N].state,qt,0),Atomics.store(t[N].state,it,0);continue}else if(n<0)throw new Error("overwritten");let s=t[N].buf.slice(0,n),i=Buffer.byteLength(s);if(i<=n)t[N].buf=t[N].buf.slice(n),Zs(t,s,e);else {for(il(t),Atomics.store(t[N].state,qt,0),Atomics.store(t[N].state,it,0);i>t[N].buf.length;)n=n/2,s=t[N].buf.slice(0,n),i=Buffer.byteLength(s);t[N].buf=t[N].buf.slice(n),Zs(t,s,e);}}}function il(t){if(t[N].flushing)throw new Error("unable to flush while flushing");let e=Atomics.load(t[N].state,it),r=0;for(;;){let n=Atomics.load(t[N].state,qt);if(n===-2)throw Error("_flushSync failed");if(n!==e)Atomics.wait(t[N].state,qt,n,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}a0.exports=rl;});var ul=C((Aq,l0)=>{var{createRequire:JI}=G("module"),XI=Hu(),{join:ol,isAbsolute:QI,sep:ZI}=G("path"),eP=Qu(),al=el(),tP=u0();function rP(t){al.register(t,iP),al.registerBeforeExit(t,sP),t.on("close",function(){al.unregister(t);});}function nP(t,e,r){let n=new tP({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&&rP(n);}function i(){n.closed||(n.flushSync(),eP(100),n.end());}return n}function iP(t){t.ref(),t.flushSync(),t.end(),t.once("close",function(){t.unref();});}function sP(t){t.flushSync();}function oP(t){let{pipeline:e,targets:r,levels:n,dedupe:s,options:i={},worker:o={},caller:u=XI()}=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"]||ol(__dirname,"worker.js"),i.targets=r.map(g=>({...g,target:d(g.target)}))):e&&(l=p["pino-pipeline-worker"]||ol(__dirname,"worker-pipeline.js"),i.targets=e.map(g=>({...g,target:d(g.target)}))),n&&(i.levels=n),s&&(i.dedupe=s),nP(d(l),i,o);function d(g){if(g=p[g]||g,QI(g)||g.indexOf("file://")===0)return g;if(g==="pino/file")return ol(__dirname,"..","file.js");let m;for(let w of c)try{let E=w==="node:repl"?process.cwd()+ZI:w;m=JI(E).resolve(g);break}catch{continue}if(!m)throw new Error(`unable to determine transport target for "${g}"`);return m}}l0.exports=oP;});var ro=C((_q,S0)=>{var c0=Uw(),{mapHttpRequest:aP,mapHttpResponse:uP}=ju(),cl=Gw(),f0=el(),{lsCacheSym:lP,chindingsSym:d0,writeSym:h0,serializersSym:y0,formatOptsSym:p0,endSym:cP,stringifiersSym:g0,stringifySym:m0,stringifySafeSym:fl,wildcardFirstSym:w0,nestedKeySym:fP,formattersSym:v0,messageKeySym:hP,errorKeySym:pP,nestedKeyStrSym:dP,msgPrefixSym:eo}=wn(),{isMainThread:yP}=G("worker_threads"),gP=ul();function Sn(){}function mP(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=aP(n):typeof n.setHeader=="function"&&(n=uP(n)));let o;i===null&&s.length===0?o=[null]:(i=s.shift(),o=s),typeof this[eo]=="string"&&i!==void 0&&i!==null&&(i=this[eo]+i),this[h0](n,c0(i,o,this[p0]),t);}else {let i=n===void 0?s.shift():n;typeof this[eo]=="string"&&i!==void 0&&i!==null&&(i=this[eo]+i),this[h0](null,c0(i,s,this[p0]),t);}}}function ll(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 wP(t,e,r,n){let s=this[m0],i=this[fl],o=this[g0],u=this[cP],c=this[d0],p=this[y0],l=this[v0],d=this[hP],g=this[pP],m=this[lP][r]+n;m=m+c;let w;l.log&&(t=l.log(t));let E=o[w0],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||ll)(w);break;default:w=(O||s)(w,i);}if(w===void 0)continue;let F=ll(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||ll)(w),R=',"'+d+'":'+w;break;default:w=(x||s)(w,i),R=',"'+d+'":'+w;}}return this[fP]&&A?m+this[dP]+A.slice(1)+"}"+R+u:m+A+R+u}function vP(t,e){let r,n=t[d0],s=t[m0],i=t[fl],o=t[g0],u=o[w0],c=t[y0],p=t[v0].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 SP(t){return t.write!==t.constructor.prototype.write}function to(t){let e=new cl(t);return e.on("error",r),!t.sync&&yP&&(f0.register(e,bP),e.on("close",function(){f0.unregister(e);})),e;function r(n){if(n.code==="EPIPE"){e.write=Sn,e.end=Sn,e.flushSync=Sn,e.destroy=Sn;return}e.removeListener("error",r),e.emit("error",n);}}function bP(t,e){t.destroyed||(e==="beforeExit"?(t.flush(),t.on("drain",function(){t.end();})):t.flushSync());}function EP(t){return function(r,n,s={},i){if(typeof s=="string")i=to({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=to({dest:i});}else if(s instanceof cl||s.writable||s._writableState)i=s,s={};else if(s.transport){if(s.transport instanceof cl||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=gP({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=Sn),i||(SP(process.stdout)?i=process.stdout:i=to({fd:process.stdout.fd||1})),{opts:s,stream:i}}}function xP(t,e){try{return JSON.stringify(t)}catch{try{return (e||this[fl])(t)}catch{return '"[unable to serialize, circular reference is too complex to analyze]"'}}}function AP(t,e,r){return {level:t,bindings:e,log:r}}function _P(t){let e=Number(t);return typeof t=="string"&&Number.isFinite(e)?e:t===void 0?1:t}S0.exports={noop:Sn,buildSafeSonicBoom:to,asChindings:vP,asJson:wP,genLog:mP,createArgsNormalizer:EP,stringify:xP,buildFormatters:AP,normalizeDestFileDescriptor:_P};});var no=C((Rq,E0)=>{var{lsCacheSym:RP,levelValSym:hl,useOnlyCustomLevelsSym:CP,streamSym:OP,formattersSym:TP,hooksSym:IP}=wn(),{noop:PP,genLog:qr}=ro(),Tt={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},b0={fatal:t=>{let e=qr(Tt.fatal,t);return function(...r){let n=this[OP];if(e.call(this,...r),typeof n.flushSync=="function")try{n.flushSync();}catch{}}},error:t=>qr(Tt.error,t),warn:t=>qr(Tt.warn,t),info:t=>qr(Tt.info,t),debug:t=>qr(Tt.debug,t),trace:t=>qr(Tt.trace,t)},pl=Object.keys(Tt).reduce((t,e)=>(t[Tt[e]]=e,t),{}),$P=Object.keys(pl).reduce((t,e)=>(t[e]='{"level":'+Number(e),t),{});function FP(t){let e=t[TP].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[RP]=n,t}function kP(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 LP(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[hl],s=this[hl]=r[t],i=this[CP],o=this[IP].logMethod;for(let u in r){if(s>r[u]){this[u]=PP;continue}this[u]=kP(u,i)?b0[u](o):qr(r[u],o);}this.emit("level-change",t,s,e[n],n,this);}function DP(t){let{levels:e,levelVal:r}=this;return e&&e.labels?e.labels[r]:""}function BP(t){let{values:e}=this.levels,r=e[t];return r!==void 0&&r>=this[hl]}function NP(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:pl,r),s=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),e?null:Tt,t);return {labels:n,values:s}}function qP(t,e,r){if(typeof t=="number"){if(![].concat(Object.keys(e||{}).map(i=>e[i]),r?[]:Object.keys(pl).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 MP(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")}}E0.exports={initialLsCache:$P,genLsCache:FP,levelMethods:b0,getLevel:DP,setLevel:LP,isLevelEnabled:BP,mappings:NP,levels:Tt,assertNoLevelCollisions:MP,assertDefaultLevelFound:qP};});var dl=C((Cq,x0)=>{x0.exports={version:"8.15.1"};});var k0=C((Tq,F0)=>{var{EventEmitter:UP}=G("events"),{lsCacheSym:jP,levelValSym:HP,setLevelSym:gl,getLevelSym:A0,chindingsSym:ml,parsedChindingsSym:WP,mixinSym:zP,asJsonSym:T0,writeSym:GP,mixinMergeStrategySym:KP,timeSym:VP,timeSliceIndexSym:YP,streamSym:I0,serializersSym:Mr,formattersSym:yl,errorKeySym:JP,messageKeySym:XP,useOnlyCustomLevelsSym:QP,needsMetadataGsym:ZP,redactFmtSym:e$,stringifySym:t$,formatOptsSym:r$,stringifiersSym:n$,msgPrefixSym:_0}=wn(),{getLevel:i$,setLevel:s$,isLevelEnabled:o$,mappings:a$,initialLsCache:u$,genLsCache:l$,assertNoLevelCollisions:c$}=no(),{asChindings:P0,asJson:f$,buildFormatters:R0,stringify:C0}=ro(),{version:h$}=dl(),p$=Ju(),d$=class{},$0={constructor:d$,child:y$,bindings:g$,setBindings:m$,flush:b$,isLevelEnabled:o$,version:h$,get level(){return this[A0]()},set level(t){this[gl](t);},get levelVal(){return this[HP]},set levelVal(t){throw Error("levelVal is read-only")},[jP]:u$,[GP]:v$,[T0]:f$,[A0]:i$,[gl]:s$};Object.setPrototypeOf($0,UP.prototype);F0.exports=function(){return Object.create($0)};var O0=t=>t;function y$(t,e){if(!t)throw Error("missing bindings for child Pino");e=e||{};let r=this[Mr],n=this[yl],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:io}=Object.prototype,jr=Sl();jr.configure=Sl;jr.stringify=jr;jr.default=jr;bl.stringify=jr;bl.configure=Sl;N0.exports=jr;var E$=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;function Er(t){return t.length<5e3&&!E$.test(t)?`"${t}"`:JSON.stringify(t)}function wl(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 x$=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function vl(t){return x$.call(t)!==void 0&&t.length!==0}function L0(t,e,r){t.length= 1`)}return r===void 0?1/0:r}function Ur(t){return t===1?"1 item":`${t} items`}function _$(t){let e=new Set;for(let r of t)(typeof r=="string"||typeof r=="number")&&e.add(String(r));return e}function R$(t){if(io.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 Sl(t){t={...t};let e=R$(t);e&&(t.bigint===void 0&&(t.bigint=!1),"circularValue"in t||(t.circularValue=Error));let r=A$(t),n=D0(t,"bigint"),s=D0(t,"deterministic"),i=B0(t,"maximumDepth"),o=B0(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=",",D=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+=` ${D}`),w.pop(),`[${O}]`}let W=Object.keys(x),H=W.length;if(H===0)return "{}";if(io){let _=H-o;O+=`${k}"...":${B}"${Ur(_)} not stringified"`,k=F;}return A!==""&&k.length>1&&(O=` ${R}${O} ${D}`),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 D="";A!==""&&(R+=A,F=`, ${R}`,D=" ");let W="";for(let H of E){let B=c(H,m[H],w,E,A,R);B!==void 0&&(O+=`${W}${Er(H)}:${D}${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;D+=`${W}"...": "${Ur(B)} not stringified"`,W=F;}return W!==""&&(D=` ${A}${D} ${R}`),w.pop(),`{${D}}`}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,[],_$(m),E,"")}if(E.length!==0)return p("",g,[],E,"")}return l("",g,[])}return d}});var j0=C((Iq,U0)=>{var El=Symbol.for("pino.metadata"),{levels:M0}=no(),C$=M0.info;function O$(t,e){let r=0;t=t||[],e=e||{dedupe:!1};let n=Object.create(M0);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,[El]:!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=I$(m.length,e.dedupe);$$(A,m.length,e.dedupe);A=P$(A,e.dedupe))if(d=m[A],d.level<=g){if(w!==0&&w!==d.level)break;if(E=d.stream,E[El]){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=C$;let A={stream:g,level:E,levelVal:void 0,id:r++};return m.unshift(A),m.sort(T$),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 F$=G("os"),J0=ju(),k$=Hu(),L$=Ju(),X0=qw(),D$=k0(),Q0=wn(),{configure:B$}=q0(),{assertDefaultLevelFound:N$,mappings:Z0,genLsCache:q$,levels:M$}=no(),{createArgsNormalizer:U$,asChindings:j$,buildSafeSonicBoom:H0,buildFormatters:H$,stringify:xl,normalizeDestFileDescriptor:W0,noop:W$}=ro(),{version:z$}=dl(),{chindingsSym:z0,redactFmtSym:G$,serializersSym:G0,timeSym:K$,timeSliceIndexSym:V$,streamSym:Y$,stringifySym:K0,stringifySafeSym:Al,stringifiersSym:V0,setLevelSym:J$,endSym:X$,formatOptsSym:Q$,messageKeySym:Z$,errorKeySym:eF,nestedKeySym:tF,mixinSym:rF,useOnlyCustomLevelsSym:nF,formattersSym:Y0,hooksSym:iF,nestedKeyStrSym:sF,mixinMergeStrategySym:oF,msgPrefixSym:aF}=Q0,{epochTime:ev,nullTime:uF}=X0,{pid:lF}=process,cF=F$.hostname(),fF=J0.err,hF={level:"info",levels:M$,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:lF,hostname:cF},serializers:Object.assign(Object.create(null),{err:fF}),formatters:Object.assign(Object.create(null),{bindings(t){return t},level(t,e){return {level:e}}}),hooks:{logMethod:void 0},timestamp:ev,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},pF=U$(hF),dF=Object.assign(Object.create(null),J0);function _l(...t){let e={},{opts:r,stream:n}=pF(e,k$(),...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:D,onChild:W,msgPrefix:H}=r,B=B$({maximumDepth:F,maximumBreadth:D}),k=H$(x.level,x.bindings,x.log),U=xl.bind({[Al]:B}),_=s?L$(s,U):{},Y=s?{stringify:_[G$]}:{stringify:U},J="}"+(i?`\r `:` `),oe=j$.bind(null,{[z0]:"",[G0]:o,[V0]:_,[K0]:xl,[Al]:B,[Y0]:k}),I="";d!==null&&(g===void 0?I=oe(d):I=oe(Object.assign({},d,{name:g})));let P=u instanceof Function?u:u?ev:uF,re=P().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"`);N$(m,w,R);let Z=Z0(w,R);return Object.assign(e,{levels:Z,[nF]:R,[Y$]:n,[K$]:P,[V$]:re,[K0]:xl,[Al]:B,[V0]:_,[X$]:J,[Q$]:Y,[Z$]:c,[eF]:p,[tF]:l,[sF]:l?`,${JSON.stringify(l)}:{`:"",[G0]:o,[rF]:E,[oF]:A,[z0]:I,[Y0]:k,[iF]:O,silent:W$,onChild:W,[aF]:H}),Object.setPrototypeOf(e,D$()),q$(e),e[J$](m),e}Et.exports=_l;Et.exports.destination=(t=process.stdout.fd)=>typeof t=="object"?(t.dest=W0(t.dest||process.stdout.fd),H0(t)):H0({dest:W0(t),minLength:0});Et.exports.transport=ul();Et.exports.multistream=j0();Et.exports.levels=Z0();Et.exports.stdSerializers=dF;Et.exports.stdTimeFunctions=Object.assign({},X0);Et.exports.symbols=Q0;Et.exports.version=z$;Et.exports.default=_l;Et.exports.pino=_l;});var uv={};Qo(uv,{RotatingFileStream:()=>ao,RotatingFileStreamError:()=>mi,createStream:()=>FF});async function nv(t){return new Promise(e=>fs.access(t,fs.constants.F_OK,r=>e(!r)))}function iv(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 Cl(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 av(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 Ol(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 OF(t){let e=av(t,"interval",CF);switch(e.unit){case"h":Ol(e,"hours",24);break;case"m":Ol(e,"minutes",60);break;case"s":Ol(e,"seconds",60);break}return e}function sv(t){let e=av(t,"size",TF);return e.unit==="K"?e.num*1024:e.unit==="M"?e.num*1048576:e.unit==="G"?e.num*1073741824:e.num}function IF(t){let e={};for(let r in t){let n=t[r],s=typeof n;if(!(r in ov))throw new Error(`Unknown option: ${r}`);e[r]=t[r],ov[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 PF(t,e,r){return n=>n?`${t}.${n}${e&&!r?".gz":""}`:t}function $F(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 FF(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=IF(e),{compress:n,omitExtension:s}=r,i;if(typeof t=="string")i=e.rotate?PF(t,n!==void 0,s):$F(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 ao(i,r)}var mi,ao,CF,TF,ov,lv=Gi(()=>{mi=class extends Error{constructor(){super("Too many destination file attempts");ie(this,"code","RFS-TOO-MANY");}},ao=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 nv(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(` `)+` `,"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 mi}async unlink(r){try{await this.fsUnlink(r);}catch(n){if(n.code!=="ENOENT")throw n;this.emit("warning",n);}}};CF={M:!0,d:!0,h:!0,m:!0,s:!0};TF={B:!0,G:!0,K:!0,M:!0};ov={encoding:(t,e,r)=>new util.TextDecoder(r),immutable:()=>{},initialRotation:()=>{},interval:Cl("interval",OF),intervalBoundary:()=>{},maxFiles:iv("maxFiles"),maxSize:Cl("maxSize",sv),mode:()=>{},omitExtension:()=>{},rotate:iv("rotate"),size:Cl("size",sv),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 hv={};Qo(hv,{allLoggers:()=>wi,rootLogger:()=>Ce});var Tl,cv,Ce,wi,Ut=Gi(()=>{Tl=Kn(tv());oi();cv=(lv(),Zo(uv)).createStream("tabby-agent.log",{path:G("path").join(G("os").homedir(),".tabby-client","agent","logs"),size:"10M",interval:"1d"}),Ce=cv?(0, Tl.default)(cv):(0, Tl.default)();Ce.level="silent";wi=[Ce];Ce.onChild=t=>{wi.push(t);};});var dv=C((Yq,pv)=>{pv.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:vf},u=vf,p=function(){return Nf},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){Jo(je("ObjectPath",a,Me,Ue));},F=function(a){Jo(je("ArrayPath",a,Me,Ue));},D=function(a,h){return a.concat(h)},W=function(a){return [a]},H=function(a){return a},B=".",k={type:"literal",value:".",description:'"."'},U="=",_={type:"literal",value:"=",description:'"="'},Y=function(a,h){Jo(je("Assign",h,Me,Ue,a));},J=function(a){return a.join("")},oe=function(a){return a.value},I='"""',P={type:"literal",value:'"""',description:'"\\"\\"\\""'},re=null,Z=function(a){return je("String",a.join(""),Me,Ue)},ce='"',Ve={type:"literal",value:'"',description:'"\\""'},Te="'''",sr={type:"literal",value:"'''",description:`"'''"`},Nn="'",or={type:"literal",value:"'",description:`"'"`},_t=function(a){return a},fe=function(a){return a},Zr="\\",Ho={type:"literal",value:"\\",description:'"\\\\"'},V=function(){return ""},me="e",z={type:"literal",value:"e",description:'"e"'},le="E",ve={type:"literal",value:"E",description:'"E"'},qe=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:'"+"'},Yc=function(a){return a.join("")},qn="-",Mn={type:"literal",value:"-",description:'"-"'},Jc=function(a){return "-"+a.join("")},mE=function(a){return je("Integer",parseInt(a,10),Me,Ue)},Xc="true",wE={type:"literal",value:"true",description:'"true"'},vE=function(){return je("Boolean",!0,Me,Ue)},Qc="false",SE={type:"literal",value:"false",description:'"false"'},bE=function(){return je("Boolean",!1,Me,Ue)},EE=function(){return je("Array",[],Me,Ue)},xE=function(a){return je("Array",a?[a]:[],Me,Ue)},AE=function(a){return je("Array",a,Me,Ue)},_E=function(a,h){return je("Array",a.concat(h),Me,Ue)},Zc=function(a){return a},ef=",",tf={type:"literal",value:",",description:'","'},RE="{",CE={type:"literal",value:"{",description:'"{"'},OE="}",TE={type:"literal",value:"}",description:'"}"'},IE=function(a){return je("InlineTable",a,Me,Ue)},rf=function(a,h){return je("InlineTableValue",h,Me,Ue,a)},PE=function(a){return "."+a},$E=function(a){return a.join("")},Un=":",jn={type:"literal",value:":",description:'":"'},nf=function(a){return a.join("")},sf="T",of={type:"literal",value:"T",description:'"T"'},FE="Z",kE={type:"literal",value:"Z",description:'"Z"'},LE=function(a,h){return je("Date",new Date(a+"T"+h+"Z"),Me,Ue)},DE=function(a,h){return je("Date",new Date(a+"T"+h),Me,Ue)},BE=/^[ \t]/,NE={type:"class",value:"[ \\t]",description:"[ \\t]"},af=` `,uf={type:"literal",value:` `,description:'"\\n"'},qE="\r",ME={type:"literal",value:"\r",description:'"\\r"'},UE=/^[0-9a-f]/i,jE={type:"class",value:"[0-9a-f]i",description:"[0-9a-f]i"},HE=/^[0-9]/,WE={type:"class",value:"[0-9]",description:"[0-9]"},zE="_",GE={type:"literal",value:"_",description:'"_"'},KE=function(){return ""},VE=/^[A-Za-z0-9_\-]/,YE={type:"class",value:"[A-Za-z0-9_\\-]",description:"[A-Za-z0-9_\\-]"},JE=function(a){return a.join("")},lf='\\"',XE={type:"literal",value:'\\"',description:'"\\\\\\""'},QE=function(){return '"'},cf="\\\\",ZE={type:"literal",value:"\\\\",description:'"\\\\\\\\"'},ex=function(){return "\\"},ff="\\b",tx={type:"literal",value:"\\b",description:'"\\\\b"'},rx=function(){return "\b"},hf="\\t",nx={type:"literal",value:"\\t",description:'"\\\\t"'},ix=function(){return " "},pf="\\n",sx={type:"literal",value:"\\n",description:'"\\\\n"'},ox=function(){return ` `},df="\\f",ax={type:"literal",value:"\\f",description:'"\\\\f"'},ux=function(){return "\f"},yf="\\r",lx={type:"literal",value:"\\r",description:'"\\\\r"'},cx=function(){return "\r"},gf="\\U",fx={type:"literal",value:"\\U",description:'"\\\\U"'},mf=function(a){return Px(a.join(""))},wf="\\u",hx={type:"literal",value:"\\u",description:'"\\\\u"'},f=0,X=0,Hn=0,Wo={line:1,column:1,seenCR:!1},Ui=0,zo=[],q=0,M={},ji;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 Go(X).line}function Ue(){return Go(X).column}function Go(a){function h(y,v,b){var T,L;for(T=v;Ta&&(Hn=0,Wo={line:1,column:1,seenCR:!1}),h(Wo,Hn,a),Hn=a),Wo}function j(a){fUi&&(Ui=f,zo=[]),zo.push(a));}function Ko(a,h,y){function v(K){var se=1;for(K.sort(function(ye,pe){return ye.descriptionpe.description?1:0});se1?pe.slice(0,-1).join(", ")+" or "+pe[K.length-1]:pe[0],Re=se?'"'+ye(se)+'"':"end of input","Expected "+Ee+" but "+Re+" found."}var T=Go(y),L=yf?(T=n.charAt(f),f++):(T=i,q===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,q++,T=vt(),T===i&&(T=zi()),q--,T===i?b=m:(f=b,b=l),b!==i?(n.length>f?(T=n.charAt(f),f++):(T=i,q===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 dx(){var a,h,y,v,b,T,L=f*49+4,K=M[L];if(K)return f=K.nextPos,K.result;if(a=f,n.charCodeAt(f)===91?(h=E,f++):(h=i,q===0&&j(A)),h!==i){for(y=[],v=Q();v!==i;)y.push(v),v=Q();if(y!==i)if(v=bf(),v!==i){for(b=[],T=Q();T!==i;)b.push(T),T=Q();b!==i?(n.charCodeAt(f)===93?(T=R,f++):(T=i,q===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 yx(){var a,h,y,v,b,T,L,K,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,q===0&&j(A)),h!==i)if(n.charCodeAt(f)===91?(y=E,f++):(y=i,q===0&&j(A)),y!==i){for(v=[],b=Q();b!==i;)v.push(b),b=Q();if(v!==i)if(b=bf(),b!==i){for(T=[],L=Q();L!==i;)T.push(L),L=Q();T!==i?(n.charCodeAt(f)===93?(L=R,f++):(L=i,q===0&&j(x)),L!==i?(n.charCodeAt(f)===93?(K=R,f++):(K=i,q===0&&j(x)),K!==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 bf(){var a,h,y,v=f*49+6,b=M[v];if(b)return f=b.nextPos,b.result;if(a=f,h=[],y=xf(),y!==i)for(;y!==i;)h.push(y),y=xf();else h=l;return h!==i?(y=Ef(),y!==i?(X=a,h=D(h,y),a=h):(f=a,a=l)):(f=a,a=l),a===i&&(a=f,h=Ef(),h!==i&&(X=a,h=W(h)),a=h),M[v]={nextPos:f,result:a},a}function Ef(){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=Wn(),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=Vo(),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 xf(){var a,h,y,v,b,T,L,K=f*49+8,se=M[K];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=Wn(),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,q===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=Vo(),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,q===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[K]={nextPos:f,result:a},a}function gx(){var a,h,y,v,b,T,L=f*49+9,K=M[L];if(K)return f=K.nextPos,K.result;if(a=f,h=Wn(),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,q===0&&j(_)),v!==i){for(b=[],T=Q();T!==i;)b.push(T),T=Q();b!==i?(T=en(),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=Vo(),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,q===0&&j(_)),v!==i){for(b=[],T=Q();T!==i;)b.push(T),T=Q();b!==i?(T=en(),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 Wn(){var a,h,y,v=f*49+10,b=M[v];if(b)return f=b.nextPos,b.result;if(a=f,h=[],y=Df(),y!==i)for(;y!==i;)h.push(y),y=Df();else h=l;return h!==i&&(X=a,h=J(h)),a=h,M[v]={nextPos:f,result:a},a}function Vo(){var a,h,y=f*49+11,v=M[y];return v?(f=v.nextPos,v.result):(a=f,h=Af(),h!==i&&(X=a,h=oe(h)),a=h,a===i&&(a=f,h=_f(),h!==i&&(X=a,h=oe(h)),a=h),M[y]={nextPos:f,result:a},a)}function en(){var a,h=f*49+12,y=M[h];return y?(f=y.nextPos,y.result):(a=mx(),a===i&&(a=Ox(),a===i&&(a=bx(),a===i&&(a=Ex(),a===i&&(a=xx(),a===i&&(a=Ax(),a===i&&(a=_x())))))),M[h]={nextPos:f,result:a},a)}function mx(){var a,h=f*49+13,y=M[h];return y?(f=y.nextPos,y.result):(a=wx(),a===i&&(a=Af(),a===i&&(a=vx(),a===i&&(a=_f()))),M[h]={nextPos:f,result:a},a)}function wx(){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)===I?(h=I,f+=3):(h=i,q===0&&j(P)),h!==i)if(y=vt(),y===i&&(y=re),y!==i){for(v=[],b=Of();b!==i;)v.push(b),b=Of();v!==i?(n.substr(f,3)===I?(b=I,f+=3):(b=i,q===0&&j(P)),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 Af(){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,q===0&&j(Ve)),h!==i){for(y=[],v=Rf();v!==i;)y.push(v),v=Rf();y!==i?(n.charCodeAt(f)===34?(v=ce,f++):(v=i,q===0&&j(Ve)),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 vx(){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,q===0&&j(sr)),h!==i)if(y=vt(),y===i&&(y=re),y!==i){for(v=[],b=Tf();b!==i;)v.push(b),b=Tf();v!==i?(n.substr(f,3)===Te?(b=Te,f+=3):(b=i,q===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 _f(){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=Nn,f++):(h=i,q===0&&j(or)),h!==i){for(y=[],v=Cf();v!==i;)y.push(v),v=Cf();y!==i?(n.charCodeAt(f)===39?(v=Nn,f++):(v=i,q===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 Rf(){var a,h,y,v=f*49+18,b=M[v];return b?(f=b.nextPos,b.result):(a=Bf(),a===i&&(a=f,h=f,q++,n.charCodeAt(f)===34?(y=ce,f++):(y=i,q===0&&j(Ve)),q--,y===i?h=m:(f=h,h=l),h!==i?(n.length>f?(y=n.charAt(f),f++):(y=i,q===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 Cf(){var a,h,y,v=f*49+19,b=M[v];return b?(f=b.nextPos,b.result):(a=f,h=f,q++,n.charCodeAt(f)===39?(y=Nn,f++):(y=i,q===0&&j(or)),q--,y===i?h=m:(f=h,h=l),h!==i?(n.length>f?(y=n.charAt(f),f++):(y=i,q===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 Of(){var a,h,y,v=f*49+20,b=M[v];return b?(f=b.nextPos,b.result):(a=Bf(),a===i&&(a=Sx(),a===i&&(a=f,h=f,q++,n.substr(f,3)===I?(y=I,f+=3):(y=i,q===0&&j(P)),q--,y===i?h=m:(f=h,h=l),h!==i?(n.length>f?(y=n.charAt(f),f++):(y=i,q===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 Sx(){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=Zr,f++):(h=i,q===0&&j(Ho)),h!==i)if(y=vt(),y!==i){for(v=[],b=Lf();b!==i;)v.push(b),b=Lf();v!==i?(X=a,h=V(),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 Tf(){var a,h,y,v=f*49+22,b=M[v];return b?(f=b.nextPos,b.result):(a=f,h=f,q++,n.substr(f,3)===Te?(y=Te,f+=3):(y=i,q===0&&j(sr)),q--,y===i?h=m:(f=h,h=l),h!==i?(n.length>f?(y=n.charAt(f),f++):(y=i,q===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 bx(){var a,h,y,v,b=f*49+23,T=M[b];return T?(f=T.nextPos,T.result):(a=f,h=If(),h===i&&(h=Yo()),h!==i?(n.charCodeAt(f)===101?(y=me,f++):(y=i,q===0&&j(z)),y===i&&(n.charCodeAt(f)===69?(y=le,f++):(y=i,q===0&&j(ve))),y!==i?(v=Yo(),v!==i?(X=a,h=qe(h,v),a=h):(f=a,a=l)):(f=a,a=l)):(f=a,a=l),a===i&&(a=f,h=If(),h!==i&&(X=a,h=_e(h)),a=h),M[b]={nextPos:f,result:a},a)}function If(){var a,h,y,v,b,T,L=f*49+24,K=M[L];return K?(f=K.nextPos,K.result):(a=f,n.charCodeAt(f)===43?(h=Tr,f++):(h=i,q===0&&j(ar)),h===i&&(h=re),h!==i?(y=f,v=zn(),v!==i?(n.charCodeAt(f)===46?(b=B,f++):(b=i,q===0&&j(k)),b!==i?(T=zn(),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=Yc(y),a=h):(f=a,a=l)):(f=a,a=l),a===i&&(a=f,n.charCodeAt(f)===45?(h=qn,f++):(h=i,q===0&&j(Mn)),h!==i?(y=f,v=zn(),v!==i?(n.charCodeAt(f)===46?(b=B,f++):(b=i,q===0&&j(k)),b!==i?(T=zn(),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=Jc(y),a=h):(f=a,a=l)):(f=a,a=l)),M[L]={nextPos:f,result:a},a)}function Ex(){var a,h,y=f*49+25,v=M[y];return v?(f=v.nextPos,v.result):(a=f,h=Yo(),h!==i&&(X=a,h=mE(h)),a=h,M[y]={nextPos:f,result:a},a)}function Yo(){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,q===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,q++,n.charCodeAt(f)===46?(b=B,f++):(b=i,q===0&&j(k)),q--,b===i?v=m:(f=v,v=l),v!==i?(X=a,h=Yc(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=qn,f++):(h=i,q===0&&j(Mn)),h!==i){if(y=[],v=de(),v!==i)for(;v!==i;)y.push(v),v=de();else y=l;y!==i?(v=f,q++,n.charCodeAt(f)===46?(b=B,f++):(b=i,q===0&&j(k)),q--,b===i?v=m:(f=v,v=l),v!==i?(X=a,h=Jc(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 xx(){var a,h,y=f*49+27,v=M[y];return v?(f=v.nextPos,v.result):(a=f,n.substr(f,4)===Xc?(h=Xc,f+=4):(h=i,q===0&&j(wE)),h!==i&&(X=a,h=vE()),a=h,a===i&&(a=f,n.substr(f,5)===Qc?(h=Qc,f+=5):(h=i,q===0&&j(SE)),h!==i&&(X=a,h=bE()),a=h),M[y]={nextPos:f,result:a},a)}function Ax(){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,q===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,q===0&&j(x)),v!==i?(X=a,h=EE(),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,q===0&&j(A)),h!==i?(y=Pf(),y===i&&(y=re),y!==i?(n.charCodeAt(f)===93?(v=R,f++):(v=i,q===0&&j(x)),v!==i?(X=a,h=xE(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,q===0&&j(A)),h!==i){if(y=[],v=Wi(),v!==i)for(;v!==i;)y.push(v),v=Wi();else y=l;y!==i?(n.charCodeAt(f)===93?(v=R,f++):(v=i,q===0&&j(x)),v!==i?(X=a,h=AE(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,q===0&&j(A)),h!==i){if(y=[],v=Wi(),v!==i)for(;v!==i;)y.push(v),v=Wi();else y=l;y!==i?(v=Pf(),v!==i?(n.charCodeAt(f)===93?(b=R,f++):(b=i,q===0&&j(x)),b!==i?(X=a,h=_E(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 Pf(){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=en(),y!==i){for(v=[],b=wt();b!==i;)v.push(b),b=wt();v!==i?(X=a,h=Zc(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 Wi(){var a,h,y,v,b,T,L,K=f*49+30,se=M[K];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=en(),y!==i){for(v=[],b=wt();b!==i;)v.push(b),b=wt();if(v!==i)if(n.charCodeAt(f)===44?(b=ef,f++):(b=i,q===0&&j(tf)),b!==i){for(T=[],L=wt();L!==i;)T.push(L),L=wt();T!==i?(X=a,h=Zc(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[K]={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=Hi())),M[h]={nextPos:f,result:a},a)}function _x(){var a,h,y,v,b,T,L=f*49+32,K=M[L];if(K)return f=K.nextPos,K.result;if(a=f,n.charCodeAt(f)===123?(h=RE,f++):(h=i,q===0&&j(CE)),h!==i){for(y=[],v=Q();v!==i;)y.push(v),v=Q();if(y!==i){for(v=[],b=$f();b!==i;)v.push(b),b=$f();if(v!==i){for(b=[],T=Q();T!==i;)b.push(T),T=Q();b!==i?(n.charCodeAt(f)===125?(T=OE,f++):(T=i,q===0&&j(TE)),T!==i?(X=a,h=IE(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 $f(){var a,h,y,v,b,T,L,K,se,ye,pe,Ee=f*49+33,Re=M[Ee];if(Re)return f=Re.nextPos,Re.result;for(a=f,h=[],y=Q();y!==i;)h.push(y),y=Q();if(h!==i)if(y=Wn(),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,q===0&&j(_)),b!==i){for(T=[],L=Q();L!==i;)T.push(L),L=Q();if(T!==i)if(L=en(),L!==i){for(K=[],se=Q();se!==i;)K.push(se),se=Q();if(K!==i)if(n.charCodeAt(f)===44?(se=ef,f++):(se=i,q===0&&j(tf)),se!==i){for(ye=[],pe=Q();pe!==i;)ye.push(pe),pe=Q();ye!==i?(X=a,h=rf(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=Wn(),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,q===0&&j(_)),b!==i){for(T=[],L=Q();L!==i;)T.push(L),L=Q();T!==i?(L=en(),L!==i?(X=a,h=rf(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 Ff(){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,q===0&&j(k)),h!==i?(y=zn(),y!==i?(X=a,h=PE(y),a=h):(f=a,a=l)):(f=a,a=l),M[v]={nextPos:f,result:a},a)}function kf(){var a,h,y,v,b,T,L,K,se,ye,pe,Ee,Re=f*49+35,ut=M[Re];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=qn,f++):(L=i,q===0&&j(Mn)),L!==i?(K=de(),K!==i?(se=de(),se!==i?(n.charCodeAt(f)===45?(ye=qn,f++):(ye=i,q===0&&j(Mn)),ye!==i?(pe=de(),pe!==i?(Ee=de(),Ee!==i?(y=[y,v,b,T,L,K,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=$E(h)),a=h,M[Re]={nextPos:f,result:a},a)}function Rx(){var a,h,y,v,b,T,L,K,se,ye,pe,Ee=f*49+36,Re=M[Ee];return Re?(f=Re.nextPos,Re.result):(a=f,h=f,y=de(),y!==i?(v=de(),v!==i?(n.charCodeAt(f)===58?(b=Un,f++):(b=i,q===0&&j(jn)),b!==i?(T=de(),T!==i?(L=de(),L!==i?(n.charCodeAt(f)===58?(K=Un,f++):(K=i,q===0&&j(jn)),K!==i?(se=de(),se!==i?(ye=de(),ye!==i?(pe=Ff(),pe===i&&(pe=re),pe!==i?(y=[y,v,b,T,L,K,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=nf(h)),a=h,M[Ee]={nextPos:f,result:a},a)}function Cx(){var a,h,y,v,b,T,L,K,se,ye,pe,Ee,Re,ut,tn,ur,lt,qf=f*49+37,Xo=M[qf];return Xo?(f=Xo.nextPos,Xo.result):(a=f,h=f,y=de(),y!==i?(v=de(),v!==i?(n.charCodeAt(f)===58?(b=Un,f++):(b=i,q===0&&j(jn)),b!==i?(T=de(),T!==i?(L=de(),L!==i?(n.charCodeAt(f)===58?(K=Un,f++):(K=i,q===0&&j(jn)),K!==i?(se=de(),se!==i?(ye=de(),ye!==i?(pe=Ff(),pe===i&&(pe=re),pe!==i?(n.charCodeAt(f)===45?(Ee=qn,f++):(Ee=i,q===0&&j(Mn)),Ee===i&&(n.charCodeAt(f)===43?(Ee=Tr,f++):(Ee=i,q===0&&j(ar))),Ee!==i?(Re=de(),Re!==i?(ut=de(),ut!==i?(n.charCodeAt(f)===58?(tn=Un,f++):(tn=i,q===0&&j(jn)),tn!==i?(ur=de(),ur!==i?(lt=de(),lt!==i?(y=[y,v,b,T,L,K,se,ye,pe,Ee,Re,ut,tn,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=nf(h)),a=h,M[qf]={nextPos:f,result:a},a)}function Ox(){var a,h,y,v,b,T=f*49+38,L=M[T];return L?(f=L.nextPos,L.result):(a=f,h=kf(),h!==i?(n.charCodeAt(f)===84?(y=sf,f++):(y=i,q===0&&j(of)),y!==i?(v=Rx(),v!==i?(n.charCodeAt(f)===90?(b=FE,f++):(b=i,q===0&&j(kE)),b!==i?(X=a,h=LE(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=kf(),h!==i?(n.charCodeAt(f)===84?(y=sf,f++):(y=i,q===0&&j(of)),y!==i?(v=Cx(),v!==i?(X=a,h=DE(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):(BE.test(n.charAt(f))?(a=n.charAt(f),f++):(a=i,q===0&&j(NE)),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=af,f++):(a=i,q===0&&j(uf)),a===i&&(a=f,n.charCodeAt(f)===13?(h=qE,f++):(h=i,q===0&&j(ME)),h!==i?(n.charCodeAt(f)===10?(y=af,f++):(y=i,q===0&&j(uf)),y!==i?(h=[h,y],a=h):(f=a,a=l)):(f=a,a=l)),M[v]={nextPos:f,result:a},a)}function Lf(){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 zi(){var a,h,y=f*49+42,v=M[y];return v?(f=v.nextPos,v.result):(a=f,q++,n.length>f?(h=n.charAt(f),f++):(h=i,q===0&&j(w)),q--,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):(UE.test(n.charAt(f))?(a=n.charAt(f),f++):(a=i,q===0&&j(jE)),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):(HE.test(n.charAt(f))?(a=n.charAt(f),f++):(a=i,q===0&&j(WE)),a===i&&(a=f,n.charCodeAt(f)===95?(h=zE,f++):(h=i,q===0&&j(GE)),h!==i&&(X=a,h=KE()),a=h),M[y]={nextPos:f,result:a},a)}function Df(){var a,h=f*49+45,y=M[h];return y?(f=y.nextPos,y.result):(VE.test(n.charAt(f))?(a=n.charAt(f),f++):(a=i,q===0&&j(YE)),M[h]={nextPos:f,result:a},a)}function zn(){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=JE(h)),a=h,M[v]={nextPos:f,result:a},a}function Bf(){var a,h,y=f*49+47,v=M[y];return v?(f=v.nextPos,v.result):(a=f,n.substr(f,2)===lf?(h=lf,f+=2):(h=i,q===0&&j(XE)),h!==i&&(X=a,h=QE()),a=h,a===i&&(a=f,n.substr(f,2)===cf?(h=cf,f+=2):(h=i,q===0&&j(ZE)),h!==i&&(X=a,h=ex()),a=h,a===i&&(a=f,n.substr(f,2)===ff?(h=ff,f+=2):(h=i,q===0&&j(tx)),h!==i&&(X=a,h=rx()),a=h,a===i&&(a=f,n.substr(f,2)===hf?(h=hf,f+=2):(h=i,q===0&&j(nx)),h!==i&&(X=a,h=ix()),a=h,a===i&&(a=f,n.substr(f,2)===pf?(h=pf,f+=2):(h=i,q===0&&j(sx)),h!==i&&(X=a,h=ox()),a=h,a===i&&(a=f,n.substr(f,2)===df?(h=df,f+=2):(h=i,q===0&&j(ax)),h!==i&&(X=a,h=ux()),a=h,a===i&&(a=f,n.substr(f,2)===yf?(h=yf,f+=2):(h=i,q===0&&j(lx)),h!==i&&(X=a,h=cx()),a=h,a===i&&(a=Tx()))))))),M[y]={nextPos:f,result:a},a)}function Tx(){var a,h,y,v,b,T,L,K,se,ye,pe,Ee=f*49+48,Re=M[Ee];return Re?(f=Re.nextPos,Re.result):(a=f,n.substr(f,2)===gf?(h=gf,f+=2):(h=i,q===0&&j(fx)),h!==i?(y=f,v=St(),v!==i?(b=St(),b!==i?(T=St(),T!==i?(L=St(),L!==i?(K=St(),K!==i?(se=St(),se!==i?(ye=St(),ye!==i?(pe=St(),pe!==i?(v=[v,b,T,L,K,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=mf(y),a=h):(f=a,a=l)):(f=a,a=l),a===i&&(a=f,n.substr(f,2)===wf?(h=wf,f+=2):(h=i,q===0&&j(hx)),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=mf(y),a=h):(f=a,a=l)):(f=a,a=l)),M[Ee]={nextPos:f,result:a},a)}var Nf=[];function Ix(a,h,y){var v=new Error(a);throw v.line=h,v.column=y,v}function Jo(a){Nf.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 Px(a,h,y){var v=parseInt("0x"+a);if(!isFinite(v)||Math.floor(v)!=v||v<0||v>1114111||v>55295&&v<57344)Ix("Invalid Unicode escape code: "+a,h,y);else return $x(v)}function $x(){var a=16384,h=[],y,v,b=-1,T=arguments.length;if(!T)return "";for(var L="";++b>10)+55296,v=K%1024+56320,h.push(y,v)),(b+1==T||h.length>a)&&(L+=String.fromCharCode.apply(null,h),h.length=0);}return L}if(ji=u(),ji!==i&&f===n.length)return ji;throw ji!==i&&f{function LF(t){var e=[],r=[],n="",s=Object.create(null),i=s;return u(t);function u(x){for(var O,F=0;F"u"?_===O.length-1?U[Y]=F:U[Y]=Object.create(null):_!==O.length-1&&r.indexOf(B)>-1&&c("Cannot redefine existing key '"+B+"'.",D,W),U=U[Y],U instanceof Array&&U.length&&_-1?'"'+x+'"':x}}yv.exports={compile:LF};});var wv=C((Xq,mv)=>{var DF=dv(),BF=gv();mv.exports={parse:function(t){var e=DF.parse(t.toString());return BF.compile(e)}};});var vi=C((Qq,xv)=>{var NF=G("path"),jt="\\\\/",vv=`[^${jt}]`,Qt="\\.",qF="\\+",MF="\\?",lo="\\/",UF="(?=.)",Sv="[^/]",Il=`(?:${lo}|$)`,bv=`(?:^|${lo})`,Pl=`${Qt}{1,2}${Il}`,jF=`(?!${Qt})`,HF=`(?!${bv}${Pl})`,WF=`(?!${Qt}{0,1}${Il})`,zF=`(?!${Pl})`,GF=`[^.${lo}]`,KF=`${Sv}*?`,Ev={DOT_LITERAL:Qt,PLUS_LITERAL:qF,QMARK_LITERAL:MF,SLASH_LITERAL:lo,ONE_CHAR:UF,QMARK:Sv,END_ANCHOR:Il,DOTS_SLASH:Pl,NO_DOT:jF,NO_DOTS:HF,NO_DOT_SLASH:WF,NO_DOTS_SLASH:zF,QMARK_NO_DOT:GF,STAR:KF,START_ANCHOR:bv},VF={...Ev,SLASH_LITERAL:`[${jt}]`,QMARK:vv,STAR:`${vv}*?`,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}]|$)`},YF={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"};xv.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:YF,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:NF.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?VF:Ev}};});var co=C(st=>{var JF=G("path"),XF=process.platform==="win32",{REGEX_BACKSLASH:QF,REGEX_REMOVE_BACKSLASH:ZF,REGEX_SPECIAL_CHARS:ek,REGEX_SPECIAL_CHARS_GLOBAL:tk}=vi();st.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);st.hasRegexChars=t=>ek.test(t);st.isRegexChar=t=>t.length===1&&st.hasRegexChars(t);st.escapeRegex=t=>t.replace(tk,"\\$1");st.toPosixSlashes=t=>t.replace(QF,"/");st.removeBackslashes=t=>t.replace(ZF,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:XF===!0||JF.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 Pv=C((eM,Iv)=>{var Av=co(),{CHAR_ASTERISK:$l,CHAR_AT:rk,CHAR_BACKWARD_SLASH:Si,CHAR_COMMA:nk,CHAR_DOT:Fl,CHAR_EXCLAMATION_MARK:kl,CHAR_FORWARD_SLASH:Tv,CHAR_LEFT_CURLY_BRACE:Ll,CHAR_LEFT_PARENTHESES:Dl,CHAR_LEFT_SQUARE_BRACKET:ik,CHAR_PLUS:sk,CHAR_QUESTION_MARK:_v,CHAR_RIGHT_CURLY_BRACE:ok,CHAR_RIGHT_PARENTHESES:Rv,CHAR_RIGHT_SQUARE_BRACKET:ak}=vi(),Cv=t=>t===Tv||t===Si,Ov=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1);},uk=(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,D=!1,W=0,H,B,k={value:"",depth:0,isGlob:!1},U=()=>p>=n,_=()=>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),I=c.slice(d)):w===!0?(J="",I=c):J=c,J&&J!==""&&J!=="/"&&J!==c&&Cv(J.charCodeAt(J.length-1))&&(J=J.slice(0,-1)),r.unescape===!0&&(I&&(I=Av.removeBackslashes(I)),J&&x===!0&&(J=Av.removeBackslashes(J)));let P={prefix:oe,input:t,start:l,base:J,glob:I,isBrace:g,isBracket:m,isGlob:w,isExtglob:E,isGlobstar:A,negated:O,negatedExtglob:F};if(r.tokens===!0&&(P.maxDepth=0,Cv(B)||o.push(k),P.tokens=o),r.parts===!0||r.tokens===!0){let re;for(let Z=0;Z{var fo=vi(),ht=co(),{MAX_LENGTH:ho,POSIX_REGEX_SOURCE:lk,REGEX_NON_SPECIAL_CHARS:ck,REGEX_SPECIAL_CHARS_BACKREF:fk,REPLACEMENTS:$v}=fo,hk=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;return r},bn=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,Bl=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=$v[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(ho,r.maxLength):ho,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=fo.globChars(c),l=fo.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:D,START_ANCHOR:W}=p,H=V=>`(${u}(?:(?!${W}${V.dot?E:d}).)*?)`,B=r.dot?"":A,k=r.dot?O:F,U=r.bash===!0?H(r):D;r.capture&&(U=`(${U})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let _={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,_),s=t.length;let Y=[],J=[],oe=[],I=i,P,re=()=>_.index===s-1,Z=_.peek=(V=1)=>t[_.index+V],ce=_.advance=()=>t[++_.index]||"",Ve=()=>t.slice(_.index+1),Te=(V="",me=0)=>{_.consumed+=V,_.index+=me;},sr=V=>{_.output+=V.output!=null?V.output:V.value,Te(V.value);},Nn=()=>{let V=1;for(;Z()==="!"&&(Z(2)!=="("||Z(3)==="?");)ce(),_.start++,V++;return V%2===0?!1:(_.negated=!0,_.start++,!0)},or=V=>{_[V]++,oe.push(V);},_t=V=>{_[V]--,oe.pop();},fe=V=>{if(I.type==="globstar"){let me=_.braces>0&&(V.type==="comma"||V.type==="brace"),z=V.extglob===!0||Y.length&&(V.type==="pipe"||V.type==="paren");V.type!=="slash"&&V.type!=="paren"&&!me&&!z&&(_.output=_.output.slice(0,-I.output.length),I.type="star",I.value="*",I.output=U,_.output+=I.output);}if(Y.length&&V.type!=="paren"&&(Y[Y.length-1].inner+=V.value),(V.value||V.output)&&sr(V),I&&I.type==="text"&&V.type==="text"){I.value+=V.value,I.output=(I.output||"")+V.value;return}V.prev=I,o.push(V),I=V;},Zr=(V,me)=>{let z={...l[me],conditions:1,inner:""};z.prev=I,z.parens=_.parens,z.output=_.output;let le=(r.capture?"(":"")+z.open;or("parens"),fe({type:V,value:me,output:_.output?"":w}),fe({type:"paren",extglob:!0,value:ce(),output:le}),Y.push(z);},Ho=V=>{let me=V.close+(r.capture?")":""),z;if(V.type==="negate"){let le=U;if(V.inner&&V.inner.length>1&&V.inner.includes("/")&&(le=H(r)),(le!==U||re()||/^\)+$/.test(Ve()))&&(me=V.close=`)$))${le}`),V.inner.includes("*")&&(z=Ve())&&/^\.[^\\/.]+$/.test(z)){let ve=Bl(z,{...e,fastpaths:!1}).output;me=V.close=`)${ve})${le})`;}V.prev.type==="bos"&&(_.negatedExtglob=!0);}fe({type:"paren",extglob:!0,value:P,output:me}),_t("parens");};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let V=!1,me=t.replace(fk,(z,le,ve,qe,_e,Tr)=>qe==="\\"?(V=!0,z):qe==="?"?le?le+qe+(_e?O.repeat(_e.length):""):Tr===0?k+(_e?O.repeat(_e.length):""):O.repeat(ve.length):qe==="."?d.repeat(ve.length):qe==="*"?le?le+qe+(_e?U:""):U:le?z:`\\${z}`);return V===!0&&(r.unescape===!0?me=me.replace(/\\/g,""):me=me.replace(/\\+/g,z=>z.length%2===0?"\\\\":z?"\\":"")),me===t&&r.contains===!0?(_.output=t,_):(_.output=ht.wrapOutput(me,_,e),_)}for(;!re();){if(P=ce(),P==="\0")continue;if(P==="\\"){let z=Z();if(z==="/"&&r.bash!==!0||z==="."||z===";")continue;if(!z){P+="\\",fe({type:"text",value:P});continue}let le=/^\\+/.exec(Ve()),ve=0;if(le&&le[0].length>2&&(ve=le[0].length,_.index+=ve,ve%2!==0&&(P+="\\")),r.unescape===!0?P=ce():P+=ce(),_.brackets===0){fe({type:"text",value:P});continue}}if(_.brackets>0&&(P!=="]"||I.value==="["||I.value==="[^")){if(r.posix!==!1&&P===":"){let z=I.value.slice(1);if(z.includes("[")&&(I.posix=!0,z.includes(":"))){let le=I.value.lastIndexOf("["),ve=I.value.slice(0,le),qe=I.value.slice(le+2),_e=lk[qe];if(_e){I.value=ve+_e,_.backtrack=!0,ce(),!i.output&&o.indexOf(I)===1&&(i.output=w);continue}}}(P==="["&&Z()!==":"||P==="-"&&Z()==="]")&&(P=`\\${P}`),P==="]"&&(I.value==="["||I.value==="[^")&&(P=`\\${P}`),r.posix===!0&&P==="!"&&I.value==="["&&(P="^"),I.value+=P,sr({value:P});continue}if(_.quotes===1&&P!=='"'){P=ht.escapeRegex(P),I.value+=P,sr({value:P});continue}if(P==='"'){_.quotes=_.quotes===1?0:1,r.keepQuotes===!0&&fe({type:"text",value:P});continue}if(P==="("){or("parens"),fe({type:"paren",value:P});continue}if(P===")"){if(_.parens===0&&r.strictBrackets===!0)throw new SyntaxError(bn("opening","("));let z=Y[Y.length-1];if(z&&_.parens===z.parens+1){Ho(Y.pop());continue}fe({type:"paren",value:P,output:_.parens?")":"\\)"}),_t("parens");continue}if(P==="["){if(r.nobracket===!0||!Ve().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(bn("closing","]"));P=`\\${P}`;}else or("brackets");fe({type:"bracket",value:P});continue}if(P==="]"){if(r.nobracket===!0||I&&I.type==="bracket"&&I.value.length===1){fe({type:"text",value:P,output:`\\${P}`});continue}if(_.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(bn("opening","["));fe({type:"text",value:P,output:`\\${P}`});continue}_t("brackets");let z=I.value.slice(1);if(I.posix!==!0&&z[0]==="^"&&!z.includes("/")&&(P=`/${P}`),I.value+=P,sr({value:P}),r.literalBrackets===!1||ht.hasRegexChars(z))continue;let le=ht.escapeRegex(I.value);if(_.output=_.output.slice(0,-I.value.length),r.literalBrackets===!0){_.output+=le,I.value=le;continue}I.value=`(${u}${le}|${I.value})`,_.output+=I.value;continue}if(P==="{"&&r.nobrace!==!0){or("braces");let z={type:"brace",value:P,output:"(",outputIndex:_.output.length,tokensIndex:_.tokens.length};J.push(z),fe(z);continue}if(P==="}"){let z=J[J.length-1];if(r.nobrace===!0||!z){fe({type:"text",value:P,output:P});continue}let le=")";if(z.dots===!0){let ve=o.slice(),qe=[];for(let _e=ve.length-1;_e>=0&&(o.pop(),ve[_e].type!=="brace");_e--)ve[_e].type!=="dots"&&qe.unshift(ve[_e].value);le=hk(qe,r),_.backtrack=!0;}if(z.comma!==!0&&z.dots!==!0){let ve=_.output.slice(0,z.outputIndex),qe=_.tokens.slice(z.tokensIndex);z.value=z.output="\\{",P=le="\\}",_.output=ve;for(let _e of qe)_.output+=_e.output||_e.value;}fe({type:"brace",value:P,output:le}),_t("braces"),J.pop();continue}if(P==="|"){Y.length>0&&Y[Y.length-1].conditions++,fe({type:"text",value:P});continue}if(P===","){let z=P,le=J[J.length-1];le&&oe[oe.length-1]==="braces"&&(le.comma=!0,z="|"),fe({type:"comma",value:P,output:z});continue}if(P==="/"){if(I.type==="dot"&&_.index===_.start+1){_.start=_.index+1,_.consumed="",_.output="",o.pop(),I=i;continue}fe({type:"slash",value:P,output:m});continue}if(P==="."){if(_.braces>0&&I.type==="dot"){I.value==="."&&(I.output=d);let z=J[J.length-1];I.type="dots",I.output+=P,I.value+=P,z.dots=!0;continue}if(_.braces+_.parens===0&&I.type!=="bos"&&I.type!=="slash"){fe({type:"text",value:P,output:d});continue}fe({type:"dot",value:P,output:d});continue}if(P==="?"){if(!(I&&I.value==="(")&&r.noextglob!==!0&&Z()==="("&&Z(2)!=="?"){Zr("qmark",P);continue}if(I&&I.type==="paren"){let le=Z(),ve=P;if(le==="<"&&!ht.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(I.value==="("&&!/[!=<:]/.test(le)||le==="<"&&!/<([!=]|\w+>)/.test(Ve()))&&(ve=`\\${P}`),fe({type:"text",value:P,output:ve});continue}if(r.dot!==!0&&(I.type==="slash"||I.type==="bos")){fe({type:"qmark",value:P,output:F});continue}fe({type:"qmark",value:P,output:O});continue}if(P==="!"){if(r.noextglob!==!0&&Z()==="("&&(Z(2)!=="?"||!/[!=<:]/.test(Z(3)))){Zr("negate",P);continue}if(r.nonegate!==!0&&_.index===0){Nn();continue}}if(P==="+"){if(r.noextglob!==!0&&Z()==="("&&Z(2)!=="?"){Zr("plus",P);continue}if(I&&I.value==="("||r.regex===!1){fe({type:"plus",value:P,output:g});continue}if(I&&(I.type==="bracket"||I.type==="paren"||I.type==="brace")||_.parens>0){fe({type:"plus",value:P});continue}fe({type:"plus",value:g});continue}if(P==="@"){if(r.noextglob!==!0&&Z()==="("&&Z(2)!=="?"){fe({type:"at",extglob:!0,value:P,output:""});continue}fe({type:"text",value:P});continue}if(P!=="*"){(P==="$"||P==="^")&&(P=`\\${P}`);let z=ck.exec(Ve());z&&(P+=z[0],_.index+=z[0].length),fe({type:"text",value:P});continue}if(I&&(I.type==="globstar"||I.star===!0)){I.type="star",I.star=!0,I.value+=P,I.output=U,_.backtrack=!0,_.globstar=!0,Te(P);continue}let V=Ve();if(r.noextglob!==!0&&/^\([^?]/.test(V)){Zr("star",P);continue}if(I.type==="star"){if(r.noglobstar===!0){Te(P);continue}let z=I.prev,le=z.prev,ve=z.type==="slash"||z.type==="bos",qe=le&&(le.type==="star"||le.type==="globstar");if(r.bash===!0&&(!ve||V[0]&&V[0]!=="/")){fe({type:"star",value:P,output:""});continue}let _e=_.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:P,output:""});continue}for(;V.slice(0,3)==="/**";){let ar=t[_.index+4];if(ar&&ar!=="/")break;V=V.slice(3),Te("/**",3);}if(z.type==="bos"&&re()){I.type="globstar",I.value+=P,I.output=H(r),_.output=I.output,_.globstar=!0,Te(P);continue}if(z.type==="slash"&&z.prev.type!=="bos"&&!qe&&re()){_.output=_.output.slice(0,-(z.output+I.output).length),z.output=`(?:${z.output}`,I.type="globstar",I.output=H(r)+(r.strictSlashes?")":"|$)"),I.value+=P,_.globstar=!0,_.output+=z.output+I.output,Te(P);continue}if(z.type==="slash"&&z.prev.type!=="bos"&&V[0]==="/"){let ar=V[1]!==void 0?"|$":"";_.output=_.output.slice(0,-(z.output+I.output).length),z.output=`(?:${z.output}`,I.type="globstar",I.output=`${H(r)}${m}|${m}${ar})`,I.value+=P,_.output+=z.output+I.output,_.globstar=!0,Te(P+ce()),fe({type:"slash",value:"/",output:""});continue}if(z.type==="bos"&&V[0]==="/"){I.type="globstar",I.value+=P,I.output=`(?:^|${m}|${H(r)}${m})`,_.output=I.output,_.globstar=!0,Te(P+ce()),fe({type:"slash",value:"/",output:""});continue}_.output=_.output.slice(0,-I.output.length),I.type="globstar",I.output=H(r),I.value+=P,_.output+=I.output,_.globstar=!0,Te(P);continue}let me={type:"star",value:P,output:U};if(r.bash===!0){me.output=".*?",(I.type==="bos"||I.type==="slash")&&(me.output=B+me.output),fe(me);continue}if(I&&(I.type==="bracket"||I.type==="paren")&&r.regex===!0){me.output=P,fe(me);continue}(_.index===_.start||I.type==="slash"||I.type==="dot")&&(I.type==="dot"?(_.output+=R,I.output+=R):r.dot===!0?(_.output+=x,I.output+=x):(_.output+=B,I.output+=B),Z()!=="*"&&(_.output+=w,I.output+=w)),fe(me);}for(;_.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(bn("closing","]"));_.output=ht.escapeLast(_.output,"["),_t("brackets");}for(;_.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(bn("closing",")"));_.output=ht.escapeLast(_.output,"("),_t("parens");}for(;_.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(bn("closing","}"));_.output=ht.escapeLast(_.output,"{"),_t("braces");}if(r.strictSlashes!==!0&&(I.type==="star"||I.type==="bracket")&&fe({type:"maybe_slash",value:"",output:`${m}?`}),_.backtrack===!0){_.output="";for(let V of _.tokens)_.output+=V.output!=null?V.output:V.value,V.suffix&&(_.output+=V.suffix);}return _};Bl.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(ho,r.maxLength):ho,s=t.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);t=$v[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}=fo.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}).)*?)`,D=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=D(k[1]);return U?U+o+k[2]:void 0}}},W=ht.removePrefix(t,x),H=D(W);return H&&r.strictSlashes!==!0&&(H+=`${u}?`),H};Fv.exports=Bl;});var Dv=C((rM,Lv)=>{var pk=G("path"),dk=Pv(),Nl=kv(),ql=co(),yk=vi(),gk=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=gk(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=ql.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?ql.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=ql.isWindows(r))=>(e instanceof RegExp?e:Oe.makeRe(e,r)).test(pk.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)):Nl(t,{...e,fastpaths:!1});Oe.scan=(t,e)=>dk(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=Nl.fastpaths(t,e)),s.output||(s=Nl(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=yk;Lv.exports=Oe;});var Ml=C((nM,Bv)=>{Bv.exports=Dv();});var zv=C((iM,Wv)=>{var Ei=G("fs"),{Readable:mk}=G("stream"),bi=G("path"),{promisify:mo}=G("util"),Ul=Ml(),wk=mo(Ei.readdir),vk=mo(Ei.stat),Nv=mo(Ei.lstat),Sk=mo(Ei.realpath),bk="!",jv="READDIRP_RECURSIVE_ERROR",Ek=new Set(["ENOENT","EPERM","EACCES","ELOOP",jv]),jl="files",Hv="directories",yo="files_directories",po="all",qv=[jl,Hv,yo,po],xk=t=>Ek.has(t.code),[Mv,Ak]=process.versions.node.split(".").slice(0,2).map(t=>Number.parseInt(t,10)),_k=process.platform==="win32"&&(Mv>10||Mv===10&&Ak>=5),Uv=t=>{if(t!==void 0){if(typeof t=="function")return t;if(typeof t=="string"){let e=Ul(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)===bk?r.push(Ul(s.slice(1))):e.push(Ul(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))}}},go=class t extends mk{static get defaultOptions(){return {root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:jl,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=Uv(r.fileFilter),this._directoryFilter=Uv(r.directoryFilter);let i=r.lstat?Nv:vk;_k?this._stat=o=>i(o,{bigint:!0}):this._stat=i,this._maxDepth=r.depth,this._wantsDir=[Hv,yo,po].includes(s),this._wantsFile=[jl,yo,po].includes(s),this._wantsEverything=s===po,this._root=bi.resolve(n),this._isDirent="Dirent"in Ei&&!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 wk(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=bi.resolve(bi.join(r,s));n={path:bi.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){xk(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 Sk(n),i=await Nv(s);if(i.isFile())return "file";if(i.isDirectory()){let o=s.length;if(n.startsWith(s)&&n.substr(o,1)===bi.sep){let u=new Error(`Circular symlink detected: "${n}" points to "${s}"`);return u.code=jv,this._onError(u)}return "directory"}}catch(s){this._onError(s);}}}}_includeAsFile(e){let r=e&&e[this._statsProp];return r&&this._wantsEverything&&!r.isDirectory()}},En=(t,e={})=>{let r=e.entryType||e.type;if(r==="both"&&(r=yo),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&&!qv.includes(r))throw new Error(`readdirp: Invalid type passed. Use one of ${qv.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=t,new go(e)},Rk=(t,e={})=>new Promise((r,n)=>{let s=[];En(t,e).on("data",i=>s.push(i)).on("end",()=>r(s)).on("error",i=>n(i));});En.promise=Rk;En.ReaddirpStream=go;En.default=En;Wv.exports=En;});var Hl=C((sM,Gv)=>{Gv.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 Qv=C((Jv,Xv)=>{Object.defineProperty(Jv,"__esModule",{value:!0});var Yv=Ml(),Ck=Hl(),Kv="!",Ok={returnIndex:!1},Tk=t=>Array.isArray(t)?t:[t],Ik=(t,e)=>{if(typeof t=="function")return t;if(typeof t=="string"){let r=Yv(t,e);return n=>t===n||r(n)}return t instanceof RegExp?r=>t.test(r):r=>!1},Vv=(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=Ck(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=Tk(t),o=i.filter(c=>typeof c=="string"&&c.charAt(0)===Kv).map(c=>c.slice(1)).map(c=>Yv(c,n)),u=i.filter(c=>typeof c!="string"||typeof c=="string"&&c.charAt(0)!==Kv).map(c=>Ik(c,n));return e==null?(c,p=!1)=>Vv(u,o,c,typeof p=="boolean"?p:!1):Vv(u,o,e,s)};Wl.default=Wl;Xv.exports=Wl;});var eS=C((oM,Zv)=>{Zv.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 zl=C((aM,rS)=>{var Pk=eS(),tS={"{":"}","(":")","[":"]"},$k=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=tS[u];if(c){var p=t.indexOf(c,e);p!==-1&&(e=p+1);}if(t[e]==="!")return !0}else e++;}return !1},Fk=function(t){if(t[0]==="!")return !0;for(var e=0;e{var kk=zl(),Lk=G("path").posix.dirname,Dk=G("os").platform()==="win32",Gl="/",Bk=/\\/g,Nk=/[\{\[].*[\}\]]$/,qk=/(^|[^\\])([\{\[]|\([^\)]+$)/,Mk=/\\([\!\*\?\|\[\]\(\)\{\}])/g;nS.exports=function(e,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&Dk&&e.indexOf(Gl)<0&&(e=e.replace(Bk,Gl)),Nk.test(e)&&(e+=Gl),e+="a";do e=Lk(e);while(kk(e)||qk.test(e));return e.replace(Mk,"$1")};});var wo=C(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 sS=wo();oS.exports=(t,e={})=>{let r=(n,s={})=>{let i=e.escapeInvalid&&sS.isInvalidBrace(s),o=n.invalid===!0&&e.escapeInvalid===!0,u="";if(n.value)return (i||o)&&sS.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 uS=C((fM,aS)=>{aS.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1};});var mS=C((hM,gS)=>{var lS=uS(),Hr=(t,e,r)=>{if(lS(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(lS(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=yS(t)||yS(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=cS(E,Math.abs(p),g,n),p=g.a=0;}return l>=0&&(m=cS(p,l,g,n)),g.negatives=w,g.positives=m,g.result=Uk(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 Uk(t,e,r){let n=Kl(t,e,"-",!1)||[],s=Kl(e,t,"",!1)||[],i=Kl(t,e,"-?",!0)||[];return n.concat(i).concat(s).join("|")}function jk(t,e){let r=1,n=1,s=hS(t,r),i=new Set([e]);for(;t<=s&&s<=e;)i.add(s),r+=1,s=hS(t,r);for(s=pS(e+1,n)-1;t1&&u.count.pop(),u.count.push(l.count[0]),u.string=u.pattern+dS(u.count),o=p+1;continue}r.isPadded&&(d=Kk(p,r,n)),l.string=d+l.pattern+dS(l.count),i.push(l),o=p+1,u=l;}return i}function Kl(t,e,r,n,s){let i=[];for(let o of t){let{string:u}=o;!n&&!fS(e,"string",u)&&i.push(r+u),n&&fS(e,"string",u)&&i.push(r+u);}return i}function Wk(t,e){let r=[];for(let n=0;ne?1:e>t?-1:0}function fS(t,e,r){return t.some(n=>n[e]===r)}function hS(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function pS(t,e){return t-t%Math.pow(10,e)}function dS(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function Gk(t,e,r){return `[${t}${e-t===1?"":"-"}${e}]`}function yS(t){return /^-?(0+)\d/.test(t)}function Kk(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={};gS.exports=Hr;});var Jl=C((pM,_S)=>{var Vk=G("util"),SS=mS(),wS=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),Yk=t=>e=>t===!0?Number(e):String(e),Vl=t=>typeof t=="number"||typeof t=="string"&&t!=="",xi=t=>Number.isInteger(+t),Yl=t=>{let e=`${t}`,r=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return !1;for(;e[++r]==="0";);return r>0},Jk=(t,e,r)=>typeof t=="string"||typeof e=="string"?!0:r.stringify===!0,Xk=(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},vS=(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},bS=(t,e,r,n)=>{if(r)return SS(t,e,{wrap:!1,...n});let s=String.fromCharCode(t);if(t===e)return s;let i=String.fromCharCode(e);return `[${s}-${i}]`},ES=(t,e,r)=>{if(Array.isArray(t)){let n=r.wrap===!0,s=r.capture?"":"?:";return n?`(${s}${t.join("|")})`:t.join("|")}return SS(t,e,r)},xS=(...t)=>new RangeError("Invalid range arguments: "+Vk.inspect(...t)),AS=(t,e,r)=>{if(r.strictRanges===!0)throw xS([t,e]);return []},Zk=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return []},eL=(t,e,r=1,n={})=>{let s=Number(t),i=Number(e);if(!Number.isInteger(s)||!Number.isInteger(i)){if(n.strictRanges===!0)throw xS([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=Yl(u)||Yl(c)||Yl(p),d=l?Math.max(u.length,c.length,p.length):0,g=l===!1&&Jk(t,e,n)===!1,m=n.transform||Yk(g);if(n.toRegex&&r===1)return bS(vS(t,d),vS(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(Xk(m(s,R),d,g)),s=o?s-r:s+r,R++;return n.toRegex===!0?r>1?Qk(w,n):ES(A,null,{wrap:!1,...n}):A},tL=(t,e,r=1,n={})=>{if(!xi(t)&&t.length>1||!xi(e)&&e.length>1)return AS(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 bS(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?ES(l,null,{wrap:!1,options:n}):l},So=(t,e,r,n={})=>{if(e==null&&Vl(t))return [t];if(!Vl(t)||!Vl(e))return AS(t,e,n);if(typeof r=="function")return So(t,e,1,{transform:r});if(wS(r))return So(t,e,0,r);let s={...n};return s.capture===!0&&(s.wrap=!0),r=r||s.step||1,xi(r)?xi(t)&&xi(e)?eL(t,e,r,s):tL(t,e,Math.max(Math.abs(r),1),s):r!=null&&!wS(r)?Zk(r,s):So(t,e,1,r)};_S.exports=So;});var OS=C((dM,CS)=>{var rL=Jl(),RS=wo(),nL=(t,e={})=>{let r=(n,s={})=>{let i=RS.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=RS.reduce(n.nodes),d=rL(...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)};CS.exports=nL;});var PS=C((yM,IS)=>{var iL=Jl(),TS=vo(),xn=wo(),Wr=(t="",e="",r=!1)=>{let n=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return r?xn.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 xn.flatten(n)},sL=(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(),TS(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=xn.reduce(s.nodes);if(xn.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=iL(...d,e);g.length===0&&(g=TS(s,e)),u.push(Wr(u.pop(),g)),s.nodes=[];return}let c=xn.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{$S.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 NS=C((mM,BS)=>{var oL=vo(),{MAX_LENGTH:kS,CHAR_BACKSLASH:Xl,CHAR_BACKTICK:aL,CHAR_COMMA:uL,CHAR_DOT:lL,CHAR_LEFT_PARENTHESES:cL,CHAR_RIGHT_PARENTHESES:fL,CHAR_LEFT_CURLY_BRACE:hL,CHAR_RIGHT_CURLY_BRACE:pL,CHAR_LEFT_SQUARE_BRACKET:LS,CHAR_RIGHT_SQUARE_BRACKET:DS,CHAR_DOUBLE_QUOTE:dL,CHAR_SINGLE_QUOTE:yL,CHAR_NO_BREAK_SPACE:gL,CHAR_ZERO_WIDTH_NOBREAK_SPACE:mL}=FS(),wL=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},n=typeof r.maxLength=="number"?Math.min(kS,r.maxLength):kS;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:oL(o)}];}E({type:"comma",value:g}),o.commas++;continue}if(g===lL&&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};BS.exports=wL;});var US=C((wM,MS)=>{var qS=vo(),vL=OS(),SL=PS(),bL=NS(),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={})=>bL(t,e);pt.stringify=(t,e={})=>qS(typeof t=="string"?pt.parse(t,e):t,e);pt.compile=(t,e={})=>(typeof t=="string"&&(t=pt.parse(t,e)),vL(t,e));pt.expand=(t,e={})=>{typeof t=="string"&&(t=pt.parse(t,e));let r=SL(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);MS.exports=pt;});var jS=C((vM,EL)=>{EL.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 WS=C((SM,HS)=>{HS.exports=jS();});var GS=C((bM,zS)=>{var xL=G("path"),AL=WS(),_L=new Set(AL);zS.exports=t=>_L.has(xL.extname(t).slice(1).toLowerCase());});var bo=C(ee=>{var{sep:RL}=G("path"),{platform:Ql}=process,CL=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=`.${RL}`;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=Ql==="win32";ee.isMacos=Ql==="darwin";ee.isLinux=Ql==="linux";ee.isIBMi=CL.type()==="OS400";});var QS=C((xM,XS)=>{var Zt=G("fs"),Le=G("path"),{promisify:Ci}=G("util"),OL=GS(),{isWindows:TL,isLinux:IL,EMPTY_FN:PL,EMPTY_STR:$L,KEY_LISTENERS:An,KEY_ERR:Zl,KEY_RAW:Ai,HANDLER_KEYS:FL,EV_CHANGE:xo,EV_ADD:Eo,EV_ADD_DIR:kL,EV_ERROR:VS,STR_DATA:LL,STR_END:DL,BRACE_START:BL,STAR:NL}=bo(),qL="watch",ML=Ci(Zt.open),YS=Ci(Zt.stat),UL=Ci(Zt.lstat),jL=Ci(Zt.close),ec=Ci(Zt.realpath),HL={lstat:UL,stat:YS},rc=(t,e)=>{t instanceof Set?t.forEach(e):e(t);},_i=(t,e,r)=>{let n=t[e];n instanceof Set||(t[e]=n=new Set([n])),n.add(r);},WL=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];},JS=t=>t instanceof Set?t.size===0:!t,Ao=new Map;function KS(t,e,r,n,s){let i=(o,u)=>{r(t),s(o,u,{watchedPath:t}),u&&t!==u&&_o(Le.resolve(t,u),An,Le.join(t,u));};try{return Zt.watch(t,e,i)}catch(o){n(o);}}var _o=(t,e,r,n,s)=>{let i=Ao.get(t);i&&rc(i[e],o=>{o(r,n,s);});},zL=(t,e,r,n)=>{let{listener:s,errHandler:i,rawEmitter:o}=n,u=Ao.get(e),c;if(!r.persistent)return c=KS(t,r,s,i,o),c.close.bind(c);if(u)_i(u,An,s),_i(u,Zl,i),_i(u,Ai,o);else {if(c=KS(t,r,_o.bind(null,e,An),i,_o.bind(null,e,Ai)),!c)return;c.on(VS,async p=>{let l=_o.bind(null,e,Zl);if(u.watcherUnusable=!0,TL&&p.code==="EPERM")try{let d=await ML(t,"r");await jL(d),l(p);}catch{}else l(p);}),u={listeners:s,errHandlers:i,rawEmitters:o,watcher:c},Ao.set(e,u);}return ()=>{Ri(u,An,s),Ri(u,Zl,i),Ri(u,Ai,o),JS(u.listeners)&&(u.watcher.close(),Ao.delete(e),FL.forEach(WL(u)),u.watcher=void 0,Object.freeze(u));}},tc=new Map,GL=(t,e,r,n)=>{let {listener:s,rawEmitter:i}=n,o=tc.get(e),p=o&&o.options;return p&&(p.persistentr.interval)&&(Zt.unwatchFile(e),o=void 0),o?(_i(o,An,s),_i(o,Ai,i)):(o={listeners:s,rawEmitters:i,options:r,watcher:Zt.watchFile(e,r,(l,d)=>{rc(o.rawEmitters,m=>{m(xo,e,{curr:l,prev:d});});let g=l.mtimeMs;(l.size!==d.size||g>d.mtimeMs||g===0)&&rc(o.listeners,m=>m(t,l));})},tc.set(e,o)),()=>{Ri(o,An,s),Ri(o,Ai,i),JS(o.listeners)&&(tc.delete(e),Zt.unwatchFile(e),o.options=o.watcher=void 0,Object.freeze(o));}},nc=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=PL);let p;return n.usePolling?(c.interval=n.enableBinaryInterval&&OL(i)?n.binaryInterval:n.interval,p=GL(e,u,c,{listener:r,rawEmitter:this.fsw._emitRaw})):p=zL(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(qL,e,5)){if(!d||d.mtimeMs===0)try{let g=await YS(e);if(this.fsw.closed)return;let m=g.atimeMs,w=g.mtimeMs;(!m||m<=w||w!==u.mtimeMs)&&this.fsw._emit(xo,e,g),IL&&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(xo,e,d),u=d;}}},p=this._watchWithNodeFs(e,c);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(Eo,e,0))return;this.fsw._emit(Eo,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 ec(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(xo,n,e.stats)):(o.add(s),this.fsw._symlinkPaths.set(i,u),this.fsw._emit(Eo,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,$L),!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(LL,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(VS,this._boundHandleError);return new Promise(d=>l.once(DL,()=>{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(kL,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 HL[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(NL)&&!e.includes(BL),l;if(c.isDirectory()){let d=Le.resolve(e),g=p?await ec(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 ec(e):e;if(this.fsw.closed)return;let g=Le.dirname(u.watchPath);if(this.fsw._getWatchedDir(g).add(u.watchPath),this.fsw._emit(Eo,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}}};XS.exports=nc;});var sb=C((AM,fc)=>{var lc=G("fs"),De=G("path"),{promisify:cc}=G("util"),_n;try{_n=G("fsevents");}catch(t){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(t);}if(_n){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&&(_n=void 0);}}var{EV_ADD:ic,EV_CHANGE:KL,EV_ADD_DIR:ZS,EV_UNLINK:Ro,EV_ERROR:VL,STR_DATA:YL,STR_END:JL,FSEVENT_CREATED:XL,FSEVENT_MODIFIED:QL,FSEVENT_DELETED:ZL,FSEVENT_MOVED:eD,FSEVENT_UNKNOWN:tD,FSEVENT_TYPE_FILE:rD,FSEVENT_TYPE_DIRECTORY:Oi,FSEVENT_TYPE_SYMLINK:ib,ROOT_GLOBSTAR:eb,DIR_SUFFIX:nD,DOT_SLASH:tb,FUNCTION_TYPE:sc,EMPTY_FN:iD,IDENTITY_FN:sD}=bo(),oD=t=>isNaN(t)?{}:{depth:t},ac=cc(lc.stat),aD=cc(lc.lstat),rb=cc(lc.realpath),uD={stat:ac,lstat:aD},zr=new Map,lD=10,cD=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),fD=(t,e)=>({stop:_n.watch(t,e)});function hD(t,e,r,n){let s=De.extname(e)?De.dirname(e):e,i=De.dirname(s),o=zr.get(s);pD(i)&&(s=i);let u=De.resolve(t),c=u!==e,p=(d,g,m)=>{c&&(d=d.replace(e,u)),(d===u||!d.indexOf(u+De.sep))&&r(d,g,m);},l=!1;for(let d of zr.keys())if(e.indexOf(De.resolve(d)+De.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:fD(s,(d,g)=>{if(!o.listeners.size)return;let m=_n.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 pD=t=>{let e=0;for(let r of zr.keys())if(r.indexOf(t)===0&&(e++,e>=lD))return !0;return !1},dD=()=>_n&&zr.size<128,oc=(t,e)=>{let r=0;for(;!t.indexOf(e)&&(t=De.dirname(t))!==e;)r++;return r},nb=(t,e)=>t.type===Oi&&e.isDirectory()||t.type===ib&&e.isSymbolicLink()||t.type===rD&&e.isFile(),uc=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+eb),!0;n.delete(e),n.delete(e+eb);}addOrChange(e,r,n,s,i,o,u,c){let p=i.has(o)?KL:ic;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 ac(e);if(this.fsw.closed)return;nb(u,p)?this.addOrChange(e,r,n,s,i,o,u,c):this.handleEvent(Ro,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(Ro,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===Ro){let l=c.type===Oi;(l||o.has(u))&&this.fsw._remove(i,u,l);}else {if(e===ic){if(c.type===Oi&&this.fsw._getWatchedDir(r),c.type===ib&&p.followSymlinks){let d=p.depth===void 0?void 0:oc(n,s)+1;return this._addToFsEvents(r,!1,!0,d)}this.fsw._getWatchedDir(i).add(u);}let l=c.type===Oi?e+nD:e;this.fsw._emit(l,r),l===ZS&&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=hD(e,r,async(c,p,l)=>{if(this.fsw.closed||i.depth!==void 0&&oc(c,r)>i.depth)return;let d=n(De.join(e,De.relative(e,c)));if(s&&!s(d))return;let g=De.dirname(d),m=De.basename(d),w=this.fsw._getWatchedDir(l.type===Oi?d:g);if(cD.has(p)||l.event===tD)if(typeof i.ignored===sc){let E;try{E=await ac(d);}catch{}if(this.fsw.closed||this.checkIgnored(d,E))return;nb(l,E)?this.addOrChange(d,c,r,g,w,m,l,i):this.handleEvent(Ro,d,c,r,g,w,m,l,i);}else this.checkExists(d,c,r,g,w,m,l,i);else switch(l.event){case XL:case QL:return this.addOrChange(d,c,r,g,w,m,l,i);case ZL:case eD: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 rb(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!==tb?u=o.replace(i,e):o!==tb&&(u=De.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(De.dirname(o)),p=De.basename(o);u&&this.fsw._getWatchedDir(o),!c.has(p)&&(c.add(p),(!s.ignoreInitial||i===!0)&&this.fsw._emit(u?ZS:ic,o,r));}initWatch(e,r,n,s){if(this.fsw.closed)return;let i=this._watchWithFsEvents(n.watchPath,De.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===sc?r:sD,u=this.fsw._getWatchHelpers(e);try{let c=await uD[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),...oD(i.depth-(s||0))}).on(YL,p=>{if(this.fsw.closed||p.stats.isDirectory()&&!u.filterPath(p))return;let l=De.join(u.watchPath,p.path),{fullPath:d}=p;if(u.followSymlinks&&p.stats.isSymbolicLink()){let g=i.depth===void 0?void 0:oc(l,De.resolve(u.watchPath))+1;this._handleFsEventsSymlink(l,d,o,g);}else this.emitAdd(l,p.stats,o,i,n);}).on(VL,iD).on(JL,()=>{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===sc)this.initWatch(void 0,e,u,o);else {let c;try{c=await rb(u.watchPath);}catch{}this.initWatch(c,e,u,o);}}};fc.exports=uc;fc.exports.canUse=dD;});var gb=C(Rc=>{var{EventEmitter:yD}=G("events"),Ac=G("fs"),ge=G("path"),{promisify:hb}=G("util"),gD=zv(),mc=Qv().default,mD=iS(),hc=zl(),wD=US(),vD=Hl(),SD=QS(),ob=sb(),{EV_ALL:pc,EV_READY:bD,EV_ADD:Co,EV_CHANGE:Ti,EV_UNLINK:ab,EV_ADD_DIR:ED,EV_UNLINK_DIR:xD,EV_RAW:AD,EV_ERROR:dc,STR_CLOSE:_D,STR_END:RD,BACK_SLASH_RE:CD,DOUBLE_SLASH_RE:ub,SLASH_OR_BACK_SLASH_RE:OD,DOT_RE:TD,REPLACER_RE:ID,SLASH:yc,SLASH_SLASH:PD,BRACE_START:$D,BANG:wc,ONE_DOT:pb,TWO_DOTS:FD,GLOBSTAR:kD,SLASH_GLOBSTAR:gc,ANYMATCH_OPTS:vc,STRING_TYPE:_c,FUNCTION_TYPE:LD,EMPTY_STR:Sc,EMPTY_FN:DD,isWindows:BD,isMacos:ND,isIBMi:qD}=bo(),MD=hb(Ac.stat),UD=hb(Ac.readdir),bc=(t=[])=>Array.isArray(t)?t:[t],db=(t,e=[])=>(t.forEach(r=>{Array.isArray(r)?db(r,e):e.push(r);}),e),lb=t=>{let e=db(bc(t));if(!e.every(r=>typeof r===_c))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(yb)},cb=t=>{let e=t.replace(CD,yc),r=!1;for(e.startsWith(PD)&&(r=!0);e.match(ub);)e=e.replace(ub,yc);return r&&(e=yc+e),e},yb=t=>cb(ge.normalize(cb(t))),fb=(t=Sc)=>e=>typeof e!==_c?e:yb(ge.isAbsolute(e)?e:ge.join(t,e)),jD=(t,e)=>ge.isAbsolute(t)?t:t.startsWith(wc)?wc+ge.join(e,t.slice(1)):ge.join(e,t),It=(t,e)=>t[e]===void 0,Ec=class{constructor(e,r){this.path=e,this._removeWatcher=r,this.items=new Set;}add(e){let{items:r}=this;r&&e!==pb&&e!==FD&&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 UD(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);}},HD="stat",WD="lstat",xc=class{constructor(e,r,n,s){this.fsw=s,this.path=e=e.replace(ID,Sc),this.watchPath=r,this.fullWatchPath=ge.resolve(r),this.hasGlob=r!==e,e===Sc&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&n?void 0:!1,this.globFilter=this.hasGlob?mc(e,void 0,vc):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(i=>{i.length>1&&i.pop();}),this.followSymlinks=n,this.statMethod=n?HD:WD;}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===LD?this.globFilter(n):!0)&&this.fsw._isntIgnored(n,r)&&this.fsw._hasReadPermissions(r)}getDirParts(e){if(!this.hasGlob)return [];let r=[];return (e.includes($D)?wD.expand(e):[e]).forEach(s=>{r.push(ge.relative(this.watchPath,s).split(OD));}),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===kD&&(n=!0),n||!r[0][o]||mc(i,r[0][o],vc))));}return !this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}},Oo=class extends yD{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,It(r,"persistent")&&(r.persistent=!0),It(r,"ignoreInitial")&&(r.ignoreInitial=!1),It(r,"ignorePermissionErrors")&&(r.ignorePermissionErrors=!1),It(r,"interval")&&(r.interval=100),It(r,"binaryInterval")&&(r.binaryInterval=300),It(r,"disableGlobbing")&&(r.disableGlobbing=!1),r.enableBinaryInterval=r.binaryInterval!==r.interval,It(r,"useFsEvents")&&(r.useFsEvents=!r.usePolling),ob.canUse()||(r.useFsEvents=!1),It(r,"usePolling")&&!r.useFsEvents&&(r.usePolling=ND),qD&&(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)),It(r,"atomic")&&(r.atomic=!r.usePolling&&!r.useFsEvents),r.atomic&&(this._pendingUnlinks=new Map),It(r,"followSymlinks")&&(r.followSymlinks=!0),It(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=bc(r.ignored));let u=0;this._emitReady=()=>{u++,u>=this._readyCount&&(this._emitReady=DD,this._readyEmitted=!0,process.nextTick(()=>this.emit(bD)));},this._emitRaw=(...c)=>this.emit(AD,...c),this._readyEmitted=!1,this.options=r,r.useFsEvents?this._fsEventsHandler=new ob(this):this._nodeFsHandler=new SD(this),Object.freeze(r);}add(e,r,n){let{cwd:s,disableGlobbing:i}=this.options;this.closed=!1;let o=lb(e);return s&&(o=o.map(u=>{let c=jD(u,s);return i||!hc(u)?c:vD(c)})),o=o.filter(u=>u.startsWith(wc)?(this._ignoredPaths.add(u.slice(1)),!1):(this._ignoredPaths.delete(u),this._ignoredPaths.delete(u+gc),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=lb(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+gc),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||pb]=r.getChildren().sort();}),e}emitWithAll(e,r){this.emit(...r),e!==dc&&this.emit(pc,...r);}async _emit(e,r,n,s,i){if(this.closed)return;let o=this.options;BD&&(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===ab)return this._pendingUnlinks.set(r,u),setTimeout(()=>{this._pendingUnlinks.forEach((l,d)=>{this.emit(...l),this.emit(pc,...l),this._pendingUnlinks.delete(d);});},typeof o.atomic=="number"?o.atomic:100),this;e===Co&&this._pendingUnlinks.has(r)&&(e=u[0]=Ti,this._pendingUnlinks.delete(r));}if(c&&(e===Co||e===Ti)&&this._readyEmitted){let l=(d,g)=>{d?(e=u[0]=dc,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===Ti&&!this._throttle(Ti,r,50))return this;if(o.alwaysStat&&n===void 0&&(e===Co||e===ED||e===Ti)){let l=o.cwd?ge.join(o.cwd,r):r,d;try{d=await MD(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(dc,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=>{Ac.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&&TD.test(e))return !0;if(!this._userIgnored){let{cwd:n}=this.options,s=this.options.ignored,i=s&&s.map(fb(n)),o=bc(i).filter(c=>typeof c===_c&&!hc(c)).map(c=>c+gc),u=this._getGlobIgnored().map(fb(n)).concat(i,o);this._userIgnored=mc(u,void 0,vc);}return this._userIgnored([e,r])}_isntIgnored(e,r){return !this._isIgnored(e,r)}_getWatchHelpers(e,r){let n=r||this.options.disableGlobbing||!hc(e)?e:mD(e),s=this.options.followSymlinks;return new xc(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 Ec(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()===Co)return;this._watched.delete(s),this._watched.delete(i);let d=n?xD:ab;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:pc,alwaysStat:!0,lstat:!0,...r},s=gD(e,n);return this._streams.add(s),s.once(_D,()=>{s=void 0;}),s.once(RD,()=>{s&&(this._streams.delete(s),s=void 0);}),s}};Rc.FSWatcher=Oo;var zD=(t,e)=>{let r=new Oo(e);return r.add(t),r};Rc.watch=zD;});var Cb=C((Jr,Rb)=>{var kc=G("crypto");Jr=Rb.exports=Bi;function Bi(t,e){return e=Ab(t,e),VD(t,e)}Jr.sha1=function(t){return Bi(t)};Jr.keys=function(t){return Bi(t,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})};Jr.MD5=function(t){return Bi(t,{algorithm:"md5",encoding:"hex"})};Jr.keysMD5=function(t){return Bi(t,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var Fn=kc.getHashes?kc.getHashes().slice():["sha1","md5"];Fn.push("passthrough");var Eb=["buffer","hex","binary","base64"];function Ab(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=Lc(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=Ab(t,e),Lc(e,r).dispatch(t)};function Lc(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&&!xb(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 _b,d=r.slice(),g=Lc(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:"),xb(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 _b(){return {buf:"",write:function(t){this.buf+=t;},end:function(t){this.buf+=t;},read:function(){return this.buf}}}});var Tb=C((FM,Ob)=>{Ob.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 $b=C(ko=>{ko.byteLength=JD;ko.toByteArray=QD;ko.fromByteArray=tB;var Kt=[],At=[],YD=typeof Uint8Array<"u"?Uint8Array:Array,Dc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Xr=0,Ib=Dc.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 JD(t){var e=Pb(t),r=e[0],n=e[1];return (r+n)*3/4-n}function XD(t,e,r){return (e+r)*3/4-r}function QD(t){var e,r=Pb(t),n=r[0],s=r[1],i=new YD(XD(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 ZD(t){return Kt[t>>18&63]+Kt[t>>12&63]+Kt[t>>6&63]+Kt[t&63]}function eB(t,e,r){for(var n,s=[],i=e;iu?u:o+i));return n===1?(e=t[r-1],s.push(Kt[e>>2]+Kt[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],s.push(Kt[e>>10]+Kt[e>>4&63]+Kt[e<<2&63]+"=")),s.join("")}});var Fb=C(Bc=>{Bc.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)};Bc.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 Jb=C(Bn=>{var Nc=$b(),Ln=Fb(),kb=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Bn.Buffer=$;Bn.SlowBuffer=aB;Bn.INSPECT_MAX_BYTES=50;var Lo=2147483647;Bn.kMaxLength=Lo;$.TYPED_ARRAY_SUPPORT=rB();!$.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 rB(){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>Lo)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 jc(t)}return Nb(t,e,r)}$.poolSize=8192;function Nb(t,e,r){if(typeof t=="string")return iB(t,e);if(ArrayBuffer.isView(t))return sB(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(Vt(t,ArrayBuffer)||t&&Vt(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Vt(t,SharedArrayBuffer)||t&&Vt(t.buffer,SharedArrayBuffer)))return Mc(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=oB(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 Nb(t,e,r)};Object.setPrototypeOf($.prototype,Uint8Array.prototype);Object.setPrototypeOf($,Uint8Array);function qb(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 nB(t,e,r){return qb(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 nB(t,e,r)};function jc(t){return qb(t),nr(t<0?0:Hc(t)|0)}$.allocUnsafe=function(t){return jc(t)};$.allocUnsafeSlow=function(t){return jc(t)};function iB(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!$.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=Mb(t,e)|0,n=nr(r),s=n.write(t,e);return s!==r&&(n=n.slice(0,s)),n}function qc(t){let e=t.length<0?0:Hc(t.length)|0,r=nr(e);for(let n=0;n=Lo)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Lo.toString(16)+" bytes");return t|0}function aB(t){return +t!=t&&(t=0),$.alloc(+t)}$.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==$.prototype};$.compare=function(e,r){if(Vt(e,Uint8Array)&&(e=$.from(e,e.offset,e.byteLength)),Vt(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 Mb(t,e){if($.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Vt(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 Uc(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Yb(t).length;default:if(s)return n?-1:Uc(t).length;e=(""+e).toLowerCase(),s=!0;}}$.byteLength=Mb;function uB(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 wB(this,e,r);case"utf8":case"utf-8":return jb(this,e,r);case"ascii":return gB(this,e,r);case"latin1":case"binary":return mB(this,e,r);case"base64":return dB(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return vB(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+=" ... "),""};kb&&($.prototype[kb]=$.prototype.inspect);$.prototype.compare=function(e,r,n,s,i){if(Vt(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,zc(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:Lb(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):Lb(t,[e],r,n,s);throw new TypeError("val must be string, number or Buffer")}function Lb(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 lB(this,e,r,n);case"utf8":case"utf-8":return cB(this,e,r,n);case"ascii":case"latin1":case"binary":return fB(this,e,r,n);case"base64":return hB(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pB(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 dB(t,e,r){return e===0&&r===t.length?Nc.fromByteArray(t):Nc.fromByteArray(t.slice(e,r))}function jb(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 yB(n)}var Db=4096;function yB(t){let e=t.length;if(e<=Db)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||Ne(e,r,this.length);let s=this[e],i=1,o=0;for(;++o>>0,r=r>>>0,n||Ne(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||Ne(e,1,this.length),this[e]};$.prototype.readUint16LE=$.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||Ne(e,2,this.length),this[e]|this[e+1]<<8};$.prototype.readUint16BE=$.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||Ne(e,2,this.length),this[e]<<8|this[e+1]};$.prototype.readUint32LE=$.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||Ne(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||Ne(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};$.prototype.readBigUInt64LE=Cr(function(e){e=e>>>0,Dn(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,Dn(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||Ne(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||Ne(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||Ne(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};$.prototype.readInt16LE=function(e,r){e=e>>>0,r||Ne(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||Ne(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||Ne(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||Ne(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};$.prototype.readBigInt64LE=Cr(function(e){e=e>>>0,Dn(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,Dn(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||Ne(e,4,this.length),Ln.read(this,e,!0,23,4)};$.prototype.readFloatBE=function(e,r){return e=e>>>0,r||Ne(e,4,this.length),Ln.read(this,e,!1,23,4)};$.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||Ne(e,8,this.length),Ln.read(this,e,!0,52,8)};$.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||Ne(e,8,this.length),Ln.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 Hb(t,e,r,n,s){Vb(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 Wb(t,e,r,n,s){Vb(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=Cr(function(e,r=0){return Hb(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});$.prototype.writeBigUInt64BE=Cr(function(e,r=0){return Wb(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=Cr(function(e,r=0){return Hb(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});$.prototype.writeBigInt64BE=Cr(function(e,r=0){return Wb(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function zb(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 Gb(t,e,r,n,s){return e=+e,r=r>>>0,s||zb(t,e,r,4),Ln.write(t,e,r,n,23,4),r+4}$.prototype.writeFloatLE=function(e,r,n){return Gb(this,e,r,!0,n)};$.prototype.writeFloatBE=function(e,r,n){return Gb(this,e,r,!1,n)};function Kb(t,e,r,n,s){return e=+e,r=r>>>0,s||zb(t,e,r,8),Ln.write(t,e,r,n,52,8),r+8}$.prototype.writeDoubleLE=function(e,r,n){return Kb(this,e,r,!0,n)};$.prototype.writeDoubleBE=function(e,r,n){return Kb(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=Bb(String(r)):typeof r=="bigint"&&(s=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(s=Bb(s)),s+="n"),n+=` It must be ${e}. Received ${s}`,n},RangeError);function Bb(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 SB(t,e,r){Dn(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&Ni(e,t.length-(r+1));}function Vb(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 kn.ERR_OUT_OF_RANGE("value",u,t)}SB(n,s,i);}function Dn(t,e){if(typeof t!="number")throw new kn.ERR_INVALID_ARG_TYPE(e,"number",t)}function Ni(t,e,r){throw Math.floor(t)!==t?(Dn(t,r),new kn.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new kn.ERR_BUFFER_OUT_OF_BOUNDS:new kn.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var bB=/[^+/0-9A-Za-z-_]/g;function EB(t){if(t=t.split("=")[0],t=t.trim().replace(bB,""),t.length<2)return "";for(;t.length%4!==0;)t=t+"=";return t}function Uc(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 xB(t){let e=[];for(let r=0;r>8,s=r%256,i.push(s),i.push(n);return i}function Yb(t){return Nc.toByteArray(EB(t))}function Do(t,e,r,n){let s;for(s=0;s=e.length||s>=t.length);++s)e[s+r]=t[s];return s}function Vt(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function zc(t){return t!==t}var _B=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 Cr(t){return typeof BigInt>"u"?RB:t}function RB(){throw new Error("BigInt not supported")}});var Zb=C((NM,Qb)=>{var qi=Tb(),Xb=Jb().Buffer;function CB(t){return 12+4*Math.ceil(t.length/4)}function OB(){return !(typeof window<"u"&&typeof document<"u")}function TB(t){return t.BYTES_PER_ELEMENT?t.length*t.BYTES_PER_ELEMENT:-1}function IB(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 TB(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=Xb.byteLength(s,"utf8");}catch(n){return console.error("Error detected, returning "+r,n),r}return e}function PB(t){let e=[],r=[t],n=0;for(;r.length;){let s=r.pop();if(typeof s=="boolean")n+=qi.BYTES;else if(typeof s=="string")OB()?n+=CB(s):n+=s.length*qi.STRING;else if(typeof s=="number")n+=qi.NUMBER;else if(typeof s=="symbol")Symbol.keyFor&&Symbol.keyFor(t)?n+=Symbol.keyFor(t).length*qi.STRING:n+=(t.toString().length-8)*qi.STRING;else if(typeof s=="bigint")n+=Xb.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}Qb.exports=function(t){let e=0;return t!==null&&typeof t=="object"?e=IB(t):e=PB(t),e};});var Yi=new Uint8Array(256),Vi=Yi.length;function ta(){return Vi>Yi.length-16&&(qx__default.default.randomFillSync(Yi),Vi=0),Yi.slice(Vi,Vi+=16)}var He=[];for(let t=0;t<256;++t)He.push((t+256).toString(16).slice(1));function Uf(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 ra={randomUUID:qx__default.default.randomUUID};function Ux(t,e,r){if(ra.randomUUID&&!e&&!t)return ra.randomUUID();t=t||{};let n=t.random||(t.rng||ta)();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 Uf(n)}var Ir=Ux;var dE=Kn(Fy());var dr={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")};function dR(t,e){return e}function ky(t){return typeof t!="object"||t===null?0:Array.isArray(t)?2:mR(t)?1:t instanceof Set?3:t instanceof Map?4:5}function yR(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 gR(t,e){return typeof t=="object"&&Object.prototype.propertyIsEnumerable.call(t,e)}function Dy(t){return {*[Symbol.iterator](){for(let e of t)for(let r of e)yield r;}}}var Ly=new Set(["[object Object]","[object Module]"]);function mR(t){if(!Ly.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"||!Ly.has(Object.prototype.toString.call(r))||!r.hasOwnProperty("isPrototypeOf"))}function wR(t,e,r){let n={};for(let s of yR(t)){let i=[];for(let c of t)gR(c,s)&&i.push(c[s]);if(i.length===0)continue;let o=e.metaDataUpdater(r,{key:s,parents:t}),u=qy(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 vR(t){return t.flat()}function SR(t){return new Set(Dy(t))}function bR(t){return new Map(Dy(t))}function By(t){return t.at(-1)}var uu=Object.freeze({__proto__:null,mergeArrays:vR,mergeMaps:bR,mergeOthers:By,mergeRecords:wR,mergeSets:SR});function Ny(...t){return ER({})(...t)}function ER(t,e){let r=xR(t,n);function n(...s){return qy(s,r,e)}return n}function xR(t,e){return {defaultMergeFunctions:uu,mergeFunctions:{...uu,...Object.fromEntries(Object.entries(t).filter(([r,n])=>Object.hasOwn(uu,r)).map(([r,n])=>n===!1?[r,By]:[r,n]))},metaDataUpdater:t.metaDataUpdater??dR,deepmerge:e,useImplicitDefaultMerging:t.enableImplicitDefaultMerging??!1,actions:dr}}function qy(t,e,r){if(t.length===0)return;if(t.length===1)return lu(t,e,r);let n=ky(t[0]);if(n!==0&&n!==5){for(let s=1;s{let e=typeof t;return t!==null&&(e==="object"||e==="function")};var cu=new Set(["__proto__","prototype","constructor"]),OR=new Set("0123456789");function fu(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(cu.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(cu.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"&&!OR.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(cu.has(r))return [];e.push(r);break}case"index":throw new Error("Index was not closed");case"start":{e.push("");break}}return e}function My(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 Uy(t,e){if(My(t,e))throw new Error("Cannot use string index")}function jy(t,e,r){if(!ri(t)||typeof e!="string")return r===void 0?t:r;let n=fu(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 si(t){return t instanceof Error&&t.name==="TimeoutError"||t instanceof ct&&[408,499].indexOf(t.status)!==-1}function Jy(t){return t instanceof Error&&t.name==="AbortError"}function du(t){this.message=t;}du.prototype=new Error,du.prototype.name="InvalidCharacterError";var Xy=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new du("'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 NR(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(Xy(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 Xy(e)}}function Ts(t){this.message=t;}function qR(t,e){if(typeof t!="string")throw new Ts("Invalid token specified");var r=(e=e||{}).header===!0?0:1;try{return JSON.parse(NR(t.split(".")[r]))}catch(n){throw new Ts("Invalid token specified: "+n.message)}}Ts.prototype=new Error,Ts.prototype.name="InvalidTokenError";var Is=qR;oi();var js=(()=>{let t=G("path").join(G("os").homedir(),".tabby-client","agent","data.json"),e=$u();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=Ce.child({component:"Auth"});this.dataStore=null;this.refreshTokenTimer=null;this.jwt=null;this.endpoint=r.endpoint,this.dataStore=r.dataStore||js,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:Is(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=ii([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:Is(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:Is(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(){let t=G("events"),e=$u(),r=wv(),n=gb();class s extends t{constructor(c){super();this.data={};this.watcher=null;this.logger=(Ut(),Zo(hv)).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,GD);}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,wb=new Set,Oc=typeof process=="object"&&process?process:{},vb=(t,e,r,n)=>{typeof Oc.emitWarning=="function"?Oc.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`);},Po=globalThis.AbortController,mb=globalThis.AbortSignal;if(typeof Po>"u"){mb=class{constructor(){ie(this,"onabort");ie(this,"_onabort",[]);ie(this,"reason");ie(this,"aborted",!1);}addEventListener(n,s){this._onabort.push(s);}},Po=class{constructor(){ie(this,"signal",new mb);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=Oc.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,vb("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 KD=t=>!wb.has(t),xr=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),Sb=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?Cn:null:null,Cn=class extends Array{constructor(e){super(e),this.fill(0);}},On,Gr=class Gr{constructor(e,r){ie(this,"heap");ie(this,"length");if(!S(Gr,On))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0;}static create(e){let r=Sb(e);if(!r)return [];ne(Gr,On,!0);let n=new Gr(e,r);return ne(Gr,On,!1),n}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}};On=new WeakMap,ue(Gr,On,!1);var Tc=Gr,Pt,dt,Ht,$t,Tn,Pe,Ft,$e,Se,ae,Qe,yt,Ke,Be,kt,ze,er,tr,Lt,Wt,Rr,ot,$i,Ic,Kr,rr,Fi,gt,Fo,bb,Vr,In,ki,zt,Ar,Gt,_r,Li,Pc,Pn,To,$n,Io,we,be,Di,$c,Yr,Pi,Fc=class Fc{constructor(e){ue(this,$i);ue(this,Fo);ue(this,zt);ue(this,Gt);ue(this,Li);ue(this,Pn);ue(this,$n);ue(this,we);ue(this,Di);ue(this,Yr);ue(this,Pt,void 0);ue(this,dt,void 0);ue(this,Ht,void 0);ue(this,$t,void 0);ue(this,Tn,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,Pe,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,Ke,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,Rr,void 0);ue(this,ot,void 0);ue(this,Kr,()=>{});ue(this,rr,()=>{});ue(this,Fi,()=>{});ue(this,gt,()=>!1);ue(this,Vr,e=>{});ue(this,In,(e,r,n)=>{});ue(this,ki,(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:D}=e;if(r!==0&&!xr(r))throw new TypeError("max option must be a nonnegative integer");let W=r?Sb(r):Array;if(!W)throw new Error("invalid max value: "+r);if(ne(this,Pt,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,Tn,A),ne(this,Rr,!!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,Ke,0),ne(this,Be,0),ne(this,kt,Tc.create(r)),ne(this,Pe,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=!!D,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,Fo,bb).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,$i,Ic).call(this);}if(S(this,Pt)===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,Pt)&&!S(this,dt)){let H="LRU_CACHE_UNBOUNDED";KD(H)&&(wb.add(H),vb("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",H,Fc));}}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,Ke)},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,$n,Io).call(o,r,n,s,i)},moveToTail:r=>{var n;return te(n=e,Yr,Pi).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,Pt)}get maxSize(){return S(this,dt)}get calculatedSize(){return S(this,Ft)}get size(){return S(this,Pe)}get fetchMethod(){return S(this,Tn)}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,ki).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,Pe)===0?void 0:S(this,$e).get(e);if(d===void 0)d=S(this,Pe)===0?S(this,Be):S(this,kt).length!==0?S(this,kt).pop():S(this,Pe)===S(this,Pt)?te(this,Pn,To).call(this,!1):S(this,Pe),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),Ki(this,Pe)._++,S(this,In).call(this,d,l,c),c&&(c.set="add"),p=!1;else {te(this,Yr,Pi).call(this,d);let w=S(this,ae)[d];if(r!==w){if(S(this,Rr)&&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,Vr).call(this,d),S(this,In).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,$i,Ic).call(this),S(this,Lt)&&(p||S(this,Fi).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,Pe);){let r=S(this,ae)[S(this,Ke)];if(te(this,Pn,To).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,Kr).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,Rr))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 D=te(this,$n,Io).call(this,e,F,O,E);return D.__returned=D}else {let D=S(this,ae)[F];if(te(this,we,be).call(this,D)){let U=n&&D.__staleWhileFetching!==void 0;return R&&(R.fetch="inflight",U&&(R.returnedStale=!0)),U?D.__staleWhileFetching:D.__returned=D}let W=S(this,gt).call(this,F);if(!A&&!W)return R&&(R.fetch="hit"),te(this,Yr,Pi).call(this,F),s&&S(this,Kr).call(this,F),R&&S(this,rr).call(this,R,F),D;let H=te(this,$n,Io).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,Pi).call(this,u),s&&S(this,Kr).call(this,u),c))}else o&&(o.get="miss");}delete(e){var n,s;let r=!1;if(S(this,Pe)!==0){let i=S(this,$e).get(e);if(i!==void 0)if(r=!0,S(this,Pe)===1)this.clear();else {S(this,Vr).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,Ke)?ne(this,Ke,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]),Ki(this,Pe)._--,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,Ke,0),ne(this,Be,0),S(this,kt).length=0,ne(this,Ft,0),ne(this,Pe,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);}}};Pt=new WeakMap,dt=new WeakMap,Ht=new WeakMap,$t=new WeakMap,Tn=new WeakMap,Pe=new WeakMap,Ft=new WeakMap,$e=new WeakMap,Se=new WeakMap,ae=new WeakMap,Qe=new WeakMap,yt=new WeakMap,Ke=new WeakMap,Be=new WeakMap,kt=new WeakMap,ze=new WeakMap,er=new WeakMap,tr=new WeakMap,Lt=new WeakMap,Wt=new WeakMap,Rr=new WeakMap,ot=new WeakMap,$i=new WeakSet,Ic=function(){let e=new Cn(S(this,Pt)),r=new Cn(S(this,Pt));ne(this,Lt,e),ne(this,tr,r),ne(this,Fi,(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,Kr,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]);},Kr=new WeakMap,rr=new WeakMap,Fi=new WeakMap,gt=new WeakMap,Fo=new WeakSet,bb=function(){let e=new Cn(S(this,Pt));ne(this,Ft,0),ne(this,er,e),ne(this,Vr,r=>{ne(this,Ft,S(this,Ft)-e[r]),e[r]=0;}),ne(this,ki,(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,In,(r,n,s)=>{if(e[r]=n,S(this,dt)){let i=S(this,dt)-e[r];for(;S(this,Ft)>i;)te(this,Pn,To).call(this,!0);}ne(this,Ft,S(this,Ft)+e[r]),s&&(s.entrySize=n,s.totalCalculatedSize=S(this,Ft));});},Vr=new WeakMap,In=new WeakMap,ki=new WeakMap,zt=new WeakSet,Ar=function*({allowStale:e=this.allowStale}={}){if(S(this,Pe))for(let r=S(this,Be);!(!te(this,Li,Pc).call(this,r)||((e||!S(this,gt).call(this,r))&&(yield r),r===S(this,Ke)));)r=S(this,yt)[r];},Gt=new WeakSet,_r=function*({allowStale:e=this.allowStale}={}){if(S(this,Pe))for(let r=S(this,Ke);!(!te(this,Li,Pc).call(this,r)||((e||!S(this,gt).call(this,r))&&(yield r),r===S(this,Be)));)r=S(this,Qe)[r];},Li=new WeakSet,Pc=function(e){return e!==void 0&&S(this,$e).get(S(this,Se)[e])===e},Pn=new WeakSet,To=function(e){var i;let r=S(this,Ke),n=S(this,Se)[r],s=S(this,ae)[r];return S(this,Rr)&&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,Vr).call(this,r),e&&(S(this,Se)[r]=void 0,S(this,ae)[r]=void 0,S(this,kt).push(r)),S(this,Pe)===1?(ne(this,Ke,ne(this,Be,0)),S(this,kt).length=0):ne(this,Ke,S(this,Qe)[r]),S(this,$e).delete(n),Ki(this,Pe)._--,r},$n=new WeakSet,Io=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 Po,{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,Tn))==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,Rr))return !1;let r=e;return !!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof Po},Di=new WeakSet,$c=function(e,r){S(this,yt)[r]=e,S(this,Qe)[e]=r;},Yr=new WeakSet,Pi=function(e){e!==S(this,Be)&&(e===S(this,Ke)?ne(this,Ke,S(this,Qe)[e]):te(this,Di,$c).call(this,S(this,yt)[e],S(this,Qe)[e]),te(this,Di,$c).call(this,S(this,Be),e),ne(this,Be,e));};var $o=Fc;var eE=Kn(Cb()),tE=Kn(Zb());Ut();var Bo=class{constructor(){this.logger=Ce.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 $o({maxSize:this.options.maxSize,sizeCalculation:tE.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, eE.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=Ie(e),i=0,o=0;for(;id.indexOf(p)===l).sort((p,l)=>p-l)}};Ut();function Gc(t,e,r){return Math.max(t,Math.min(e,r))}var No=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 u=this.calcContextScore(n),p=(this.options.adaptiveRate.max-(this.options.adaptiveRate.max-this.options.adaptiveRate.min)*u)*this.baseInterval,l=Gc(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=Gc(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=Ie(i)[0]??"";return r+=o.match(/^\W*$/)?n.noSuffixInCurrentLine:0,r+=i.match(/^\W*$/)?n.noSuffix:0,r=Gc(0,1,r),r}};Ut();var mt=Ce.child({component:"Postprocess"});function Kc(t){let e=t.text.slice(0,t.position),r=t.text.slice(t.position),n=Ie(e),s=Ie(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 $B(t){return /\n(\s*)\n/g}var rE=t=>e=>{let r=e.split($B()),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(pn(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 nE=()=>t=>{let e=Ie(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(pn(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 FB=[/(.{3,}?)\1{5,}$/g,/(.{10,}?)\1{3,}$/g],iE=()=>t=>{let e=Ie(t),r=e.length-1;for(;r>=0&&xe(e[r]);)r--;if(r<0)return t;for(let n of FB){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 kB(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=Ie(e);if(LB(i)&&o.length>1)return mt.debug({input:e,prefix:r,suffix:n},"Drop content with multiple lines"),null;let u=DB(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=Ie(e),s=0;for(;st=>xe(t)?null:t;async function uE(t,e){let r=Kc(t);return Promise.resolve(e).then(ir(iE())).then(ir(oE(r))).then(ir(aE(r))).then(ir(Vc()))}async function lE(t,e){let r=Kc(t);return Promise.resolve(e).then(ir(rE())).then(ir(nE())).then(ir(sE(r))).then(ir(Vc()))}Ut();var fE="tabby-agent",hE="0.2.0";oi();Ut();var qo=class t{constructor(){this.anonymousUsageTrackingApi=Lr({baseUrl:"https://app.tabbyml.com/api"});this.logger=Ce.child({component:"AnonymousUsage"});this.systemData={agent:`${fE}, ${hE}`,browser:void 0,node:`${process.version} ${process.platform} ${G("os").arch()} ${G("os").release()}`};this.properties={};this.emittedUniqueEvent=[];this.dataStore=null;}static async create(e){let r=new t;return r.dataStore=e.dataStore||js,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=Ir(),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=Ir();}addProperties(e){this.properties={...this.properties,...e};}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)){n&&this.emittedUniqueEvent.push(e);try{await this.anonymousUsageTrackingApi.POST("/usage",{body:{distinctId:this.anonymousId,event:e,properties:{...this.systemData,...this.properties,...r}}});}catch(s){this.logger.error({error:s},"Error when sending anonymous usage data");}}}};Ut();var pE={maxSize:50,stats:{total:t=>t.length,responses:t=>t.filter(e=>e.status===200).length,timeouts:t=>t.filter(e=>si(e.error)).length,averageResponseTime:t=>t.filter(e=>e.status===200).reduce((e,r)=>e+r.responseTime,0)/t.length},checks:[{name:"healthy",check:(t,e)=>t.slice(-5).every(n=>n.status===200&&n.responseTime<3e3)},{name:"highTimeoutRate",check:(t,e)=>e.total<3?!1:e.timeouts/e.total>.5},{name:"slowResponseTime",check:(t,e)=>e.responses<5?!1:e.averageResponseTime>4e3}]},Mo=class extends events.EventEmitter{constructor(r){super();this.logger=Ce.child({component:"ResponseStats"});this.strategy={maxSize:0,stats:{},checks:[]};this.entries=[];this.strategy=r;}push(r){this.entries.push(r),this.entries.length>this.strategy.maxSize&&this.entries.shift();let n=this.stats();for(let s of this.strategy.checks)s.check(this.entries,n)&&(this.logger.debug({check:s.name,stats:n},"Check condition met"),this.emit(s.name,n));}stats(){let r={};for(let[n,s]of Object.entries(this.strategy.stats))r[n]=s(this.entries);return r}check(){let r=this.stats();for(let n of this.strategy.checks)if(n.check(this.entries,r))return n.name;return null}};var Mi=class Mi extends events.EventEmitter{constructor(){super();this.logger=Ce.child({component:"TabbyAgent"});this.config=Cc;this.userConfig={};this.clientConfig={};this.status="notInitialized";this.issues=[];this.serverHealthState=null;this.dataStore=null;this.completionCache=new Bo;this.completionDebounce=new No;this.nonParallelProvideCompletionAbortController=null;this.completionResponseStats=new Mo(pE);this.tryingConnectTimer=null;this.tryingConnectTimer=setInterval(async()=>{this.status==="disconnected"&&(this.logger.debug("Trying to connect..."),await this.healthCheck());},Mi.tryConnectInterval),this.completionResponseStats.on("healthy",()=>{this.popIssue("slowCompletionResponseTime"),this.popIssue("highCompletionTimeoutRate");}),this.completionResponseStats.on("highTimeoutRate",()=>{(this.status==="ready"||this.status==="issuesExist")&&(this.popIssue("slowCompletionResponseTime"),this.pushIssue("highCompletionTimeoutRate"));}),this.completionResponseStats.on("slowResponseTime",()=>{(this.status==="ready"||this.status==="issuesExist")&&(this.popIssue("highCompletionTimeoutRate"),this.pushIssue("slowCompletionResponseTime"));});}static async create(r){let n=new Mi;return n.dataStore=r?.dataStore,n.anonymousUsageLogger=await qo.create({dataStore:r?.dataStore}),n}async applyConfig(){this.config=Ny(Cc,this.userConfig,this.clientConfig),wi.forEach(r=>r.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 uo.create({endpoint:this.config.server.endpoint,dataStore:this.dataStore}),this.auth.on("updated",this.setupApi.bind(this))):this.auth=null,await this.setupApi();}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();}}issueWithDetails(r){switch(r){case"highCompletionTimeoutRate":return {name:"highCompletionTimeoutRate",completionResponseStats:this.completionResponseStats.stats()};case"slowCompletionResponseTime":return {name:"slowCompletionResponseTime",completionResponseStats:this.completionResponseStats.stats()}}}pushIssue(r){if(this.issues.indexOf(r)===-1){this.issues.push(r),this.changeStatus("issuesExist");let n={event:"newIssue",issue:this.issueWithDetails(r)};this.logger.debug({event:n},"New issue"),super.emit("newIssue",n);}}popIssue(r){this.issues=this.issues.filter(n=>n!==r),this.issues.length===0&&this.status==="issuesExist"&&this.changeStatus("ready");}emitAuthRequired(){let r={event:"authRequired",server:this.config.server};super.emit("authRequired",r);}async post(r,n,s){let i=Ir();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=ii([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.status!=="issuesExist"&&this.changeStatus("ready"),c.data}catch(o){throw si(o)?this.logger.debug({requestId:i,path:r,error:o},"API request timeout"):Jy(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=Ie(i),u=r.text.slice(r.position),c=Ie(u);return {prefix:o.slice(Math.max(o.length-n,0)).join(""),suffix:c.slice(0,s).join("")}}async initialize(r){return (r.client||r.clientProperties)&&(wi.forEach(n=>n.setBindings?.({client:r.client,...r.clientProperties})),this.anonymousUsageLogger.addProperties({client:r.client,...r.clientProperties})),Rn&&(await Rn.load(),this.userConfig=Rn.config,Rn.on("updated",async n=>{this.userConfig=n,await this.applyConfig();}),Rn.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 updateConfig(r,n){let s=jy(this.clientConfig,r);if(!(0, dE.default)(s,n)){n===void 0?Wy(this.clientConfig,r):Hy(this.clientConfig,r,n);let i=this.status;await this.applyConfig(),r.startsWith("server")&&(this.serverHealthState=null),r.startsWith("server")&&i==="unauthorized"&&this.status==="unauthorized"&&this.emitAuthRequired();let o={event:"configUpdated",config:this.config};this.logger.debug({event:o},"Config updated"),super.emit("configUpdated",o);}return !0}async clearConfig(r){return await this.updateConfig(r,void 0)}getConfig(){return this.config}getStatus(){return this.status}getIssues(){return this.issues.map(r=>this.issueWithDetails(r))}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=ii([this.nonParallelProvideCompletionAbortController.signal,n?.signal]),i=null;if(this.completionCache.has(r))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 {let o=this.createSegments(r);if(xe(o.prefix))this.logger.debug("Segment prefix is blank, returning empty completion response"),i={id:"agent-"+Ir(),choices:[]};else {await this.completionDebounce.debounce({request:r,config:this.config.completion.debounce,responseTime:this.completionResponseStats.stats().averageResponseTime},n);let u=performance.now(),c="/v1/completions";try{i=await this.post(c,{body:{language:r.language,segments:o,user:this.auth?.user}},{signal:s,timeout:r.manually?this.config.completion.timeout.manually:this.config.completion.timeout.auto}),this.completionResponseStats.push({name:c,status:200,responseTime:performance.now()-u});}catch(p){si(p)&&this.completionResponseStats.push({name:c,status:p.status,responseTime:performance.now()-u,error:p});}if(i=await uE(r,i),n?.signal?.aborted)throw n.signal.reason;this.completionCache.set(r,i);}}if(i=await lE(r,i),n?.signal?.aborted)throw n.signal.reason;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,parseAs:"text"},n),!0}};Mi.tryConnectInterval=1e3*30;var Uo=Mi;var yE=["statusChanged","configUpdated","authRequired","newIssue"];Ut();var jo=class{constructor(){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=Ie(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 yE)this.agent.on(r,n=>{this.sendResponse([0,n]);});}listen(){this.inStream.on("data",this.handleInput.bind(this));}};var gE=new jo;Uo.create().then(t=>{gE.bind(t),gE.listen();}); /*! Bundled license information: normalize-path/index.js: (*! * normalize-path * * Copyright (c) 2014-2018, Jon Schlinkert. * Released under the MIT License. *) is-extglob/index.js: (*! * is-extglob * * Copyright (c) 2014-2016, Jon Schlinkert. * Licensed under the MIT License. *) is-glob/index.js: (*! * is-glob * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. *) is-number/index.js: (*! * is-number * * Copyright (c) 2014-present, Jon Schlinkert. * Released under the MIT License. *) to-regex-range/index.js: (*! * to-regex-range * * Copyright (c) 2015-present, Jon Schlinkert. * Released under the MIT License. *) fill-range/index.js: (*! * fill-range * * 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